fusible 0.8.6

Electronic linter: a fuse that blows to block firmware code generation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
4068
4069
4070
4071
4072
4073
4074
4075
4076
4077
4078
4079
4080
4081
4082
4083
4084
4085
4086
4087
4088
4089
4090
4091
4092
4093
4094
4095
4096
4097
4098
4099
4100
4101
4102
4103
4104
4105
4106
4107
4108
4109
4110
4111
4112
4113
4114
4115
4116
4117
4118
4119
4120
4121
4122
4123
4124
4125
4126
4127
4128
4129
4130
4131
4132
4133
4134
4135
4136
4137
4138
4139
4140
4141
4142
4143
4144
4145
4146
4147
4148
4149
4150
4151
4152
4153
4154
4155
4156
4157
4158
4159
4160
4161
4162
4163
4164
4165
4166
4167
4168
4169
4170
4171
4172
4173
4174
4175
4176
4177
4178
4179
4180
4181
4182
4183
4184
4185
4186
4187
4188
4189
4190
4191
4192
4193
4194
4195
4196
4197
4198
4199
4200
4201
4202
4203
4204
4205
4206
4207
4208
4209
4210
4211
4212
4213
4214
4215
4216
4217
4218
4219
4220
4221
4222
4223
4224
4225
4226
4227
4228
4229
4230
4231
4232
4233
4234
4235
4236
4237
4238
4239
4240
4241
4242
4243
4244
4245
4246
4247
4248
4249
4250
4251
4252
4253
4254
4255
4256
4257
4258
4259
4260
4261
4262
4263
4264
4265
4266
4267
4268
4269
4270
4271
4272
4273
4274
4275
4276
4277
4278
4279
4280
4281
4282
4283
4284
4285
4286
4287
4288
4289
4290
4291
4292
4293
4294
4295
4296
4297
4298
4299
4300
4301
4302
4303
4304
4305
4306
4307
4308
4309
4310
4311
4312
4313
4314
4315
4316
4317
4318
4319
4320
4321
4322
4323
4324
4325
4326
4327
4328
4329
4330
4331
4332
4333
4334
4335
4336
4337
4338
4339
4340
4341
4342
4343
4344
4345
4346
4347
4348
4349
4350
4351
4352
4353
4354
4355
4356
4357
4358
4359
4360
4361
4362
4363
4364
4365
4366
4367
4368
4369
4370
4371
4372
4373
4374
4375
4376
4377
4378
4379
4380
4381
4382
4383
4384
4385
4386
4387
4388
4389
4390
4391
4392
4393
4394
4395
4396
4397
4398
4399
4400
4401
4402
4403
4404
4405
4406
4407
4408
4409
4410
4411
4412
4413
4414
4415
4416
4417
4418
4419
4420
4421
4422
4423
4424
4425
4426
4427
4428
4429
4430
4431
4432
4433
4434
4435
4436
4437
4438
4439
4440
4441
4442
4443
4444
4445
4446
4447
4448
4449
4450
4451
4452
4453
4454
4455
4456
4457
4458
4459
4460
4461
4462
4463
4464
4465
4466
4467
4468
4469
4470
4471
4472
4473
4474
4475
4476
4477
4478
4479
4480
4481
4482
4483
4484
4485
4486
4487
4488
4489
4490
4491
4492
4493
4494
4495
4496
4497
4498
4499
4500
4501
4502
4503
4504
4505
4506
4507
4508
4509
4510
4511
4512
4513
4514
4515
4516
4517
4518
4519
4520
4521
4522
4523
4524
4525
4526
4527
4528
4529
4530
4531
4532
4533
4534
4535
4536
4537
4538
4539
4540
4541
4542
4543
4544
4545
4546
4547
4548
4549
4550
4551
4552
4553
4554
4555
4556
4557
4558
4559
4560
4561
4562
4563
4564
4565
4566
4567
4568
4569
4570
4571
4572
4573
4574
4575
4576
4577
4578
4579
4580
4581
4582
4583
4584
4585
4586
4587
4588
4589
4590
4591
4592
4593
4594
4595
4596
4597
4598
4599
4600
4601
4602
4603
4604
4605
4606
4607
4608
4609
4610
4611
4612
4613
4614
4615
4616
4617
4618
4619
4620
4621
4622
4623
4624
4625
4626
4627
4628
4629
4630
4631
4632
4633
4634
4635
4636
4637
4638
4639
4640
4641
4642
4643
4644
4645
4646
4647
4648
4649
4650
4651
4652
4653
4654
4655
4656
4657
4658
4659
4660
4661
4662
4663
4664
4665
4666
4667
4668
4669
4670
4671
4672
4673
4674
4675
4676
4677
4678
4679
4680
4681
4682
4683
4684
4685
4686
4687
4688
4689
4690
4691
4692
4693
4694
4695
4696
4697
4698
4699
4700
4701
4702
4703
4704
4705
4706
4707
4708
4709
4710
4711
4712
4713
4714
4715
4716
4717
4718
4719
4720
4721
4722
4723
4724
4725
4726
4727
4728
4729
4730
4731
4732
4733
4734
4735
4736
4737
4738
4739
4740
4741
4742
4743
4744
4745
4746
4747
4748
4749
4750
4751
4752
4753
4754
4755
4756
4757
4758
4759
4760
4761
4762
4763
4764
4765
4766
4767
4768
4769
4770
4771
4772
4773
4774
4775
4776
4777
4778
4779
4780
4781
4782
4783
4784
4785
4786
4787
4788
4789
4790
4791
4792
4793
4794
4795
4796
4797
4798
4799
4800
4801
4802
4803
4804
4805
4806
4807
4808
4809
4810
4811
4812
4813
4814
4815
4816
4817
4818
4819
4820
4821
4822
4823
4824
4825
4826
4827
4828
4829
4830
4831
4832
4833
4834
4835
4836
4837
4838
4839
4840
4841
4842
4843
4844
4845
4846
4847
4848
4849
4850
4851
4852
4853
4854
4855
4856
4857
4858
4859
4860
4861
4862
4863
4864
4865
4866
4867
4868
4869
4870
4871
4872
4873
4874
4875
4876
4877
4878
4879
4880
4881
4882
4883
4884
4885
4886
4887
4888
4889
4890
4891
4892
4893
4894
4895
4896
4897
4898
4899
4900
4901
4902
4903
4904
4905
4906
4907
4908
4909
4910
4911
4912
4913
4914
4915
4916
4917
4918
4919
4920
4921
4922
4923
4924
4925
4926
4927
4928
4929
4930
4931
4932
4933
4934
4935
4936
4937
4938
4939
4940
4941
4942
4943
4944
4945
4946
4947
4948
4949
4950
4951
4952
4953
4954
4955
4956
4957
4958
4959
4960
4961
4962
4963
4964
4965
4966
4967
4968
4969
4970
4971
4972
4973
4974
4975
4976
4977
4978
4979
4980
4981
4982
4983
4984
4985
4986
4987
4988
4989
4990
4991
4992
4993
4994
4995
4996
4997
4998
4999
5000
5001
5002
5003
5004
5005
5006
5007
5008
5009
5010
5011
5012
5013
5014
5015
5016
5017
5018
5019
5020
5021
5022
5023
5024
5025
5026
5027
5028
5029
5030
5031
5032
5033
5034
5035
5036
5037
5038
5039
5040
5041
5042
5043
5044
5045
5046
5047
5048
5049
5050
5051
5052
5053
5054
5055
5056
5057
5058
5059
5060
5061
5062
5063
5064
5065
5066
5067
5068
5069
5070
5071
5072
5073
5074
5075
5076
5077
5078
5079
5080
5081
5082
5083
5084
5085
5086
5087
5088
5089
5090
5091
5092
5093
5094
5095
5096
5097
5098
5099
5100
5101
5102
5103
5104
5105
5106
5107
5108
5109
5110
5111
5112
5113
5114
5115
5116
5117
5118
5119
5120
5121
5122
5123
5124
5125
5126
5127
5128
5129
5130
5131
5132
5133
5134
5135
5136
5137
5138
5139
5140
5141
5142
5143
5144
5145
5146
5147
5148
5149
5150
5151
5152
5153
5154
5155
5156
5157
5158
5159
5160
5161
5162
5163
5164
5165
5166
5167
5168
5169
5170
5171
5172
5173
5174
5175
5176
5177
5178
5179
5180
5181
5182
5183
5184
5185
5186
5187
5188
5189
5190
5191
5192
5193
5194
5195
5196
5197
5198
5199
5200
5201
5202
5203
5204
5205
5206
5207
5208
5209
5210
5211
5212
5213
5214
5215
5216
5217
5218
5219
5220
5221
5222
5223
5224
5225
5226
5227
5228
5229
5230
5231
5232
5233
5234
5235
5236
5237
5238
5239
5240
5241
5242
5243
5244
5245
5246
5247
5248
5249
5250
5251
5252
5253
5254
5255
5256
5257
5258
5259
5260
5261
5262
5263
5264
5265
5266
5267
5268
5269
5270
5271
5272
5273
5274
5275
5276
5277
5278
5279
5280
5281
5282
5283
5284
5285
5286
5287
5288
5289
5290
5291
5292
5293
5294
5295
5296
5297
5298
5299
5300
5301
5302
5303
5304
5305
5306
5307
5308
5309
5310
5311
5312
5313
5314
5315
5316
5317
5318
5319
5320
5321
5322
5323
5324
5325
5326
5327
5328
5329
5330
5331
5332
5333
5334
5335
5336
5337
5338
5339
5340
5341
5342
5343
5344
5345
5346
5347
5348
5349
5350
5351
5352
5353
5354
5355
5356
5357
5358
5359
5360
5361
5362
5363
5364
5365
5366
5367
5368
5369
5370
5371
5372
5373
5374
5375
5376
5377
5378
5379
5380
5381
5382
5383
5384
5385
5386
5387
5388
5389
5390
5391
5392
5393
5394
5395
5396
5397
5398
5399
5400
5401
5402
5403
5404
5405
5406
5407
5408
5409
5410
5411
5412
5413
5414
5415
5416
5417
5418
5419
5420
5421
5422
5423
5424
5425
5426
5427
5428
5429
5430
5431
5432
5433
5434
5435
5436
5437
5438
5439
5440
5441
5442
5443
5444
5445
5446
5447
5448
5449
5450
5451
5452
5453
5454
5455
5456
5457
5458
5459
5460
5461
5462
5463
5464
5465
5466
5467
5468
5469
5470
5471
5472
5473
5474
5475
5476
5477
5478
5479
5480
5481
5482
5483
5484
5485
5486
5487
5488
5489
5490
5491
5492
5493
5494
5495
5496
5497
5498
5499
5500
5501
5502
5503
5504
5505
5506
5507
5508
5509
5510
5511
5512
5513
5514
5515
5516
5517
5518
5519
5520
5521
5522
5523
5524
5525
5526
5527
5528
5529
5530
5531
5532
5533
5534
5535
5536
5537
5538
5539
5540
5541
5542
5543
5544
5545
5546
5547
5548
5549
5550
5551
5552
5553
5554
5555
5556
5557
5558
5559
5560
5561
5562
5563
5564
5565
5566
5567
5568
5569
5570
5571
5572
5573
5574
5575
5576
5577
5578
5579
5580
5581
5582
5583
5584
5585
5586
5587
5588
5589
5590
5591
5592
5593
5594
5595
5596
5597
5598
5599
5600
5601
5602
5603
5604
5605
5606
5607
5608
5609
5610
5611
5612
5613
5614
5615
5616
5617
5618
5619
5620
5621
5622
5623
5624
5625
5626
5627
5628
5629
5630
5631
5632
5633
5634
5635
5636
5637
5638
5639
5640
5641
5642
5643
5644
5645
5646
5647
5648
5649
5650
5651
5652
5653
5654
5655
5656
5657
5658
5659
5660
5661
5662
5663
5664
5665
5666
5667
5668
5669
5670
5671
5672
5673
5674
5675
5676
5677
5678
5679
5680
5681
5682
5683
5684
5685
5686
5687
5688
5689
5690
5691
5692
5693
5694
5695
5696
5697
5698
5699
5700
5701
5702
5703
5704
5705
5706
5707
5708
5709
5710
5711
5712
5713
5714
5715
5716
5717
5718
5719
5720
5721
5722
5723
5724
5725
5726
5727
5728
5729
5730
5731
5732
5733
5734
5735
5736
5737
5738
5739
5740
5741
5742
5743
5744
5745
5746
5747
5748
5749
5750
5751
5752
5753
5754
5755
5756
5757
5758
5759
5760
5761
5762
5763
5764
5765
5766
5767
5768
5769
5770
5771
5772
5773
5774
5775
5776
5777
5778
5779
5780
5781
5782
5783
5784
5785
5786
5787
5788
5789
5790
5791
5792
5793
5794
5795
5796
5797
5798
5799
5800
5801
5802
5803
5804
5805
5806
5807
5808
5809
5810
5811
5812
5813
5814
5815
5816
var Zfo=Object.create;var{getPrototypeOf:e2o,defineProperty:MDe,getOwnPropertyNames:t2o}=Object;var u1t=Object.prototype.hasOwnProperty;function n2o(e){return this[e]}var o2o,r2o,Qe=(e,t,n)=>{var o=e!=null&&typeof e==="object";if(o){var r=t?o2o??=new WeakMap:r2o??=new WeakMap,i=r.get(e);if(i)return i}n=e!=null?Zfo(e2o(e)):{};let s=t||!e||!e.__esModule||!u1t.call(e,"default")?MDe(n,"default",{value:e,enumerable:!0}):n;if(e&&typeof e==="object"||typeof e==="function"){for(let a of t2o(e))if(!u1t.call(s,a))MDe(s,a,{get:n2o.bind(e,a),enumerable:!0})}if(o)r.set(e,s);return s};var lt=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var i2o=(e)=>e;function s2o(e,t){this[e]=i2o.bind(null,t)}var jW=(e,t)=>{for(var n in t)MDe(e,n,{get:t[n],enumerable:!0,configurable:!0,set:s2o.bind(t,n)})};var El=(e,t,n)=>()=>{if(e)try{t=e(e=0)}catch(o){n=[o]}if(n)throw n[0];return t};var KW=((e)=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,n)=>(typeof require<"u"?require:t)[n]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var rn=lt(function(a2o,Hge){(function(){function e(Fe,tt){Object.defineProperty(o.prototype,Fe,{get:function(){console.warn("%s(...) is deprecated in plain JavaScript React classes. %s",tt[0],tt[1])}})}function t(Fe){if(Fe===null||typeof Fe!=="object")return null;return Fe=ue&&Fe[ue]||Fe["@@iterator"],typeof Fe==="function"?Fe:null}function n(Fe,tt){Fe=(Fe=Fe.constructor)&&(Fe.displayName||Fe.name)||"ReactClass";var Je=Fe+"."+tt;de[Je]||(console.error("Can't call %s on a component that is not yet mounted. This is a no-op, but it might indicate a bug in your application. Instead, assign to `this.state` directly or define a `state = {};` class property with the desired state in the %s component.",tt,Fe),de[Je]=!0)}function o(Fe,tt,Je){this.props=Fe,this.context=tt,this.refs=xe,this.updater=Je||me}function r(){}function i(Fe,tt,Je){this.props=Fe,this.context=tt,this.refs=xe,this.updater=Je||me}function s(){}function a(Fe){return""+Fe}function c(Fe){try{a(Fe);var tt=!1}catch(ft){tt=!0}if(tt){tt=console;var Je=tt.error,$e=typeof Symbol==="function"&&Symbol.toStringTag&&Fe[Symbol.toStringTag]||Fe.constructor.name||"Object";return Je.call(tt,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",$e),a(Fe)}}function l(Fe){if(Fe==null)return null;if(typeof Fe==="function")return Fe.$$typeof===Me?null:Fe.displayName||Fe.name||null;if(typeof Fe==="string")return Fe;switch(Fe){case Y:return"Fragment";case K:return"Profiler";case X:return"StrictMode";case ne:return"Suspense";case re:return"SuspenseList";case ie:return"Activity";case ce:return"ViewTransition"}if(typeof Fe==="object")switch(typeof Fe.tag==="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),Fe.$$typeof){case j:return"Portal";case ee:return Fe.displayName||"Context";case J:return(Fe._context.displayName||"Context")+".Consumer";case se:var tt=Fe.render;return Fe=Fe.displayName,Fe||(Fe=tt.displayName||tt.name||"",Fe=Fe!==""?"ForwardRef("+Fe+")":"ForwardRef"),Fe;case Z:return tt=Fe.displayName||null,tt!==null?tt:l(Fe.type)||"Memo";case te:tt=Fe._payload,Fe=Fe._init;try{return l(Fe(tt))}catch(Je){}}return null}function h(Fe){if(Fe===Y)return"<>";if(typeof Fe==="object"&&Fe!==null&&Fe.$$typeof===te)return"<...>";try{var tt=l(Fe);return tt?"<"+tt+">":"<...>"}catch(Je){return"<...>"}}function d(){var Fe=_e.A;return Fe===null?null:Fe.getOwner()}function u(){return Error("react-stack-top-frame")}function _(Fe){if(ye.call(Fe,"key")){var tt=Object.getOwnPropertyDescriptor(Fe,"key").get;if(tt&&tt.isReactWarning)return!1}return Fe.key!==void 0}function p(Fe,tt){function Je(){Ne||(Ne=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",tt))}Je.isReactWarning=!0,Object.defineProperty(Fe,"key",{get:Je,configurable:!0})}function m(){var Fe=l(this.type);return nt[Fe]||(nt[Fe]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),Fe=this.props.ref,Fe!==void 0?Fe:null}function A(Fe,tt,Je,$e,ft,vt){var Ye=Je.ref;return Fe={$$typeof:U,type:Fe,key:tt,props:Je,_owner:$e},(Ye!==void 0?Ye:null)!==null?Object.defineProperty(Fe,"ref",{enumerable:!1,get:m}):Object.defineProperty(Fe,"ref",{enumerable:!1,value:null}),Fe._store={},Object.defineProperty(Fe._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(Fe,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(Fe,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:ft}),Object.defineProperty(Fe,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:vt}),Object.freeze&&(Object.freeze(Fe.props),Object.freeze(Fe)),Fe}function g(Fe,tt){return tt=A(Fe.type,tt,Fe.props,Fe._owner,Fe._debugStack,Fe._debugTask),Fe._store&&(tt._store.validated=Fe._store.validated),tt}function f(Fe){y(Fe)?Fe._store&&(Fe._store.validated=1):typeof Fe==="object"&&Fe!==null&&Fe.$$typeof===te&&(Fe._payload.status==="fulfilled"?y(Fe._payload.value)&&Fe._payload.value._store&&(Fe._payload.value._store.validated=1):Fe._store&&(Fe._store.validated=1))}function y(Fe){return typeof Fe==="object"&&Fe!==null&&Fe.$$typeof===U}function x(Fe){var tt={"=":"=0",":":"=2"};return"$"+Fe.replace(/[=:]/g,function(Je){return tt[Je]})}function C(Fe,tt){return typeof Fe==="object"&&Fe!==null&&Fe.key!=null?(c(Fe.key),x(""+Fe.key)):tt.toString(36)}function b(Fe){switch(Fe.status){case"fulfilled":return Fe.value;case"rejected":throw Fe.reason;default:switch(typeof Fe.status==="string"?Fe.then(s,s):(Fe.status="pending",Fe.then(function(tt){Fe.status==="pending"&&(Fe.status="fulfilled",Fe.value=tt)},function(tt){Fe.status==="pending"&&(Fe.status="rejected",Fe.reason=tt)})),Fe.status){case"fulfilled":return Fe.value;case"rejected":throw Fe.reason}}throw Fe}function I(Fe,tt,Je,$e,ft){var vt=typeof Fe;if(vt==="undefined"||vt==="boolean")Fe=null;var Ye=!1;if(Fe===null)Ye=!0;else switch(vt){case"bigint":case"string":case"number":Ye=!0;break;case"object":switch(Fe.$$typeof){case U:case j:Ye=!0;break;case te:return Ye=Fe._init,I(Ye(Fe._payload),tt,Je,$e,ft)}}if(Ye){Ye=Fe,ft=ft(Ye);var je=$e===""?"."+C(Ye,0):$e;return Re(ft)?(Je="",je!=null&&(Je=je.replace(ct,"$&/")+"/"),I(ft,tt,Je,"",function(St){return St})):ft!=null&&(y(ft)&&(ft.key!=null&&(Ye&&Ye.key===ft.key||c(ft.key)),Je=g(ft,Je+(ft.key==null||Ye&&Ye.key===ft.key?"":(""+ft.key).replace(ct,"$&/")+"/")+je),$e!==""&&Ye!=null&&y(Ye)&&Ye.key==null&&Ye._store&&!Ye._store.validated&&(Je._store.validated=2),ft=Je),tt.push(ft)),1}if(Ye=0,je=$e===""?".":$e+":",Re(Fe))for(var st=0;st<Fe.length;st++)$e=Fe[st],vt=je+C($e,st),Ye+=I($e,tt,Je,vt,ft);else if(st=t(Fe),typeof st==="function")for(st===Fe.entries&&(pt||console.warn("Using Maps as children is not supported. Use an array of keyed ReactElements instead."),pt=!0),Fe=st.call(Fe),st=0;!($e=Fe.next()).done;)$e=$e.value,vt=je+C($e,st++),Ye+=I($e,tt,Je,vt,ft);else if(vt==="object"){if(typeof Fe.then==="function")return I(b(Fe),tt,Je,$e,ft);throw tt=String(Fe),Error("Objects are not valid as a React child (found: "+(tt==="[object Object]"?"object with keys {"+Object.keys(Fe).join(", ")+"}":tt)+"). If you meant to render a collection of children, use an array instead.")}return Ye}function v(Fe,tt,Je){if(Fe==null)return Fe;var $e=[],ft=0;return I(Fe,$e,"","",function(vt){return tt.call(Je,vt,ft++)}),$e}function P(Fe){if(Fe._status===-1){var tt=null,Je=null,$e=Fe._ioInfo;$e!=null&&($e.start=$e.end=performance.now(),$e.value=new Promise(function(Ye,je){tt=Ye,Je=je})),$e=Fe._result;var ft=$e();if(ft.then(function(Ye){if(Fe._status===0||Fe._status===-1){Fe._status=1,Fe._result=Ye;var je=Fe._ioInfo;if(je!=null){je.end=performance.now();var st=Ye==null?void 0:Ye.default;tt(st),je.value.status="fulfilled",je.value.value=st}ft.status===void 0&&(ft.status="fulfilled",ft.value=Ye)}},function(Ye){if(Fe._status===0||Fe._status===-1){Fe._status=2,Fe._result=Ye;var je=Fe._ioInfo;je!=null&&(je.end=performance.now(),je.value.then(s,s),Je(Ye),je.value.status="rejected",je.value.reason=Ye),ft.status===void 0&&(ft.status="rejected",ft.reason=Ye)}}),$e=Fe._ioInfo,$e!=null){var vt=ft.displayName;typeof vt==="string"&&($e.name=vt)}Fe._status===-1&&(Fe._status=0,Fe._result=ft)}if(Fe._status===1)return $e=Fe._result,$e===void 0&&console.error(`lazy: Expected the result of a dynamic import() call. Instead received: %s

Your code should look like: 
  const MyComponent = lazy(() => import('./MyComponent'))

Did you accidentally put curly braces around the import?`,$e),"default"in $e||console.error(`lazy: Expected the result of a dynamic import() call. Instead received: %s

Your code should look like: 
  const MyComponent = lazy(() => import('./MyComponent'))`,$e),$e.default;throw Fe._result}function M(){var Fe=_e.H;return Fe===null&&console.error(`Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
1. You might have mismatching versions of React and the renderer (such as React DOM)
2. You might be breaking the Rules of Hooks
3. You might have more than one copy of React in the same app
See https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem.`),Fe}function B(){_e.asyncTransitions--}function T(Fe){var tt=_e.T,Je={};Je.types=tt!==null?tt.types:null,Je._updatedFibers=new Set,_e.T=Je;try{var $e=Fe(),ft=_e.S;ft!==null&&ft(Je,$e),typeof $e==="object"&&$e!==null&&typeof $e.then==="function"&&(_e.asyncTransitions++,$e.then(B,B),$e.then(s,Ct))}catch(vt){Ct(vt)}finally{tt===null&&Je._updatedFibers&&(Fe=Je._updatedFibers.size,Je._updatedFibers.clear(),10<Fe&&console.warn("Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table.")),tt!==null&&Je.types!==null&&(tt.types!==null&&tt.types!==Je.types&&console.error("We expected inner Transitions to have transferred the outer types set and that you cannot add to the outer Transition while inside the inner.This is a bug in React."),tt.types=Je.types),_e.T=tt}}function N(Fe){var tt=_e.T;if(tt!==null){var Je=tt.types;Je===null?tt.types=[Fe]:Je.indexOf(Fe)===-1&&Je.push(Fe)}else _e.asyncTransitions===0&&console.error("addTransitionType can only be called inside a `startTransition()` callback. It must be associated with a specific Transition."),T(N.bind(null,Fe))}function D(Fe){if(Lt===null)try{var tt=("require"+Math.random()).slice(0,7);Lt=(Hge&&Hge[tt]).call(Hge,"timers").setImmediate}catch(Je){Lt=function($e){kt===!1&&(kt=!0,typeof MessageChannel>"u"&&console.error("This browser does not have a MessageChannel implementation, so enqueuing tasks via await act(async () => ...) will fail. Please file an issue at https://github.com/facebook/react/issues if you encounter this warning."));var ft=new MessageChannel;ft.port1.onmessage=$e,ft.port2.postMessage(void 0)}}return Lt(Fe)}function L(Fe){return 1<Fe.length&&typeof AggregateError==="function"?AggregateError(Fe):Fe[0]}function H(Fe,tt){tt!==Bt-1&&console.error("You seem to have overlapping act() calls, this is not supported. Be sure to await previous act() calls before making a new one. "),Bt=tt}function V(Fe,tt,Je){var $e=_e.actQueue;if($e!==null)if($e.length!==0)try{O($e),D(function(){return V(Fe,tt,Je)});return}catch(ft){_e.thrownErrors.push(ft)}else _e.actQueue=null;0<_e.thrownErrors.length?($e=L(_e.thrownErrors),_e.thrownErrors.length=0,Je($e)):tt(Fe)}function O(Fe){if(!Yt){Yt=!0;var tt=0;try{for(;tt<Fe.length;tt++){var Je=Fe[tt];do{_e.didUsePromise=!1;var $e=Je(!1);if($e!==null){if(_e.didUsePromise){Fe[tt]=Je,Fe.splice(0,tt);return}Je=$e}else break}while(1)}Fe.length=0}catch(ft){Fe.splice(0,tt+1),_e.thrownErrors.push(ft)}finally{Yt=!1}}}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart==="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var U=Symbol.for("react.transitional.element"),j=Symbol.for("react.portal"),Y=Symbol.for("react.fragment"),X=Symbol.for("react.strict_mode"),K=Symbol.for("react.profiler"),J=Symbol.for("react.consumer"),ee=Symbol.for("react.context"),se=Symbol.for("react.forward_ref"),ne=Symbol.for("react.suspense"),re=Symbol.for("react.suspense_list"),Z=Symbol.for("react.memo"),te=Symbol.for("react.lazy"),ie=Symbol.for("react.activity"),ce=Symbol.for("react.view_transition"),ue=Symbol.iterator,de={},me={isMounted:function(){return!1},enqueueForceUpdate:function(Fe){n(Fe,"forceUpdate")},enqueueReplaceState:function(Fe){n(Fe,"replaceState")},enqueueSetState:function(Fe){n(Fe,"setState")}},ge=Object.assign,xe={};Object.freeze(xe),o.prototype.isReactComponent={},o.prototype.setState=function(Fe,tt){if(typeof Fe!=="object"&&typeof Fe!=="function"&&Fe!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,Fe,tt,"setState")},o.prototype.forceUpdate=function(Fe){this.updater.enqueueForceUpdate(this,Fe,"forceUpdate")};var Ee={isMounted:["isMounted","Instead, make sure to clean up subscriptions and pending requests in componentWillUnmount to prevent memory leaks."],replaceState:["replaceState","Refactor your code to use setState instead (see https://github.com/facebook/react/issues/3236)."]};for(Ze in Ee)Ee.hasOwnProperty(Ze)&&e(Ze,Ee[Ze]);r.prototype=o.prototype,Ee=i.prototype=new r,Ee.constructor=i,ge(Ee,o.prototype),Ee.isPureReactComponent=!0;var Re=Array.isArray,Me=Symbol.for("react.client.reference"),_e={H:null,A:null,T:null,S:null,actQueue:null,asyncTransitions:0,isBatchingLegacy:!1,didScheduleLegacyUpdate:!1,didUsePromise:!1,thrownErrors:[],getCurrentStack:null,recentlyCreatedOwnerStacks:0},ye=Object.prototype.hasOwnProperty,Se=console.createTask?console.createTask:function(){return null};Ee={react_stack_bottom_frame:function(Fe){return Fe()}};var Ne,Le,nt={},dt=Ee.react_stack_bottom_frame.bind(Ee,u)(),rt=Se(h(u)),pt=!1,ct=/\/+/g,Ct=typeof reportError==="function"?reportError:function(Fe){if(typeof window==="object"&&typeof window.ErrorEvent==="function"){var tt=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof Fe==="object"&&Fe!==null&&typeof Fe.message==="string"?String(Fe.message):String(Fe),error:Fe});if(!window.dispatchEvent(tt))return}else if(typeof process==="object"&&typeof process.emit==="function"){process.emit("uncaughtException",Fe);return}console.error(Fe)},kt=!1,Lt=null,Bt=0,xt=!1,Yt=!1,ut=typeof queueMicrotask==="function"?function(Fe){queueMicrotask(function(){return queueMicrotask(Fe)})}:D;Ee=Object.freeze({__proto__:null,c:function(Fe){return M().useMemoCache(Fe)}});var Ze={map:v,forEach:function(Fe,tt,Je){v(Fe,function(){tt.apply(this,arguments)},Je)},count:function(Fe){var tt=0;return v(Fe,function(){tt++}),tt},toArray:function(Fe){return v(Fe,function(tt){return tt})||[]},only:function(Fe){if(!y(Fe))throw Error("React.Children.only expected to receive a single React element child.");return Fe}};a2o.Activity=ie,a2o.Children=Ze,a2o.Component=o,a2o.Fragment=Y,a2o.Profiler=K,a2o.PureComponent=i,a2o.StrictMode=X,a2o.Suspense=ne,a2o.ViewTransition=ce,a2o.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=_e,a2o.__COMPILER_RUNTIME=Ee,a2o.act=function(Fe){var tt=_e.actQueue,Je=Bt;Bt++;var $e=_e.actQueue=tt!==null?tt:[],ft=!1;try{var vt=Fe()}catch(st){_e.thrownErrors.push(st)}if(0<_e.thrownErrors.length)throw H(tt,Je),Fe=L(_e.thrownErrors),_e.thrownErrors.length=0,Fe;if(vt!==null&&typeof vt==="object"&&typeof vt.then==="function"){var Ye=vt;return ut(function(){ft||xt||(xt=!0,console.error("You called act(async () => ...) without await. This could lead to unexpected testing behaviour, interleaving multiple act calls and mixing their scopes. You should - await act(async () => ...);"))}),{then:function(st,St){ft=!0,Ye.then(function(Nt){if(H(tt,Je),Je===0){try{O($e),D(function(){return V(Nt,st,St)})}catch(Ut){_e.thrownErrors.push(Ut)}if(0<_e.thrownErrors.length){var Ot=L(_e.thrownErrors);_e.thrownErrors.length=0,St(Ot)}}else st(Nt)},function(Nt){H(tt,Je),0<_e.thrownErrors.length?(Nt=L(_e.thrownErrors),_e.thrownErrors.length=0,St(Nt)):St(Nt)})}}}var je=vt;if(H(tt,Je),Je===0&&(O($e),$e.length!==0&&ut(function(){ft||xt||(xt=!0,console.error("A component suspended inside an `act` scope, but the `act` call was not awaited. When testing React components that depend on asynchronous data, you must await the result:\n\nawait act(() => ...)"))}),_e.actQueue=null),0<_e.thrownErrors.length)throw Fe=L(_e.thrownErrors),_e.thrownErrors.length=0,Fe;return{then:function(st,St){ft=!0,Je===0?(_e.actQueue=$e,D(function(){return V(je,st,St)})):st(je)}}},a2o.addTransitionType=N,a2o.cache=function(Fe){return function(){return Fe.apply(null,arguments)}},a2o.cacheSignal=function(){return null},a2o.captureOwnerStack=function(){var Fe=_e.getCurrentStack;return Fe===null?null:Fe()},a2o.cloneElement=function(Fe,tt,Je){if(Fe===null||Fe===void 0)throw Error("The argument must be a React element, but you passed "+Fe+".");var $e=ge({},Fe.props),{key:ft,_owner:vt}=Fe;if(tt!=null){var Ye;e:{if(ye.call(tt,"ref")&&(Ye=Object.getOwnPropertyDescriptor(tt,"ref").get)&&Ye.isReactWarning){Ye=!1;break e}Ye=tt.ref!==void 0}Ye&&(vt=d()),_(tt)&&(c(tt.key),ft=""+tt.key);for(je in tt)!ye.call(tt,je)||je==="key"||je==="__self"||je==="__source"||je==="ref"&&tt.ref===void 0||($e[je]=tt[je])}var je=arguments.length-2;if(je===1)$e.children=Je;else if(1<je){Ye=Array(je);for(var st=0;st<je;st++)Ye[st]=arguments[st+2];$e.children=Ye}$e=A(Fe.type,ft,$e,vt,Fe._debugStack,Fe._debugTask);for(ft=2;ft<arguments.length;ft++)f(arguments[ft]);return $e},a2o.createContext=function(Fe){return Fe={$$typeof:ee,_currentValue:Fe,_currentValue2:Fe,_threadCount:0,Provider:null,Consumer:null},Fe.Provider=Fe,Fe.Consumer={$$typeof:J,_context:Fe},Fe._currentRenderer=null,Fe._currentRenderer2=null,Fe},a2o.createElement=function(Fe,tt,Je){for(var $e=2;$e<arguments.length;$e++)f(arguments[$e]);var ft;$e={};var vt=null;if(tt!=null)for(ft in Le||!("__self"in tt)||"key"in tt||(Le=!0,console.warn("Your app (or one of its dependencies) is using an outdated JSX transform. Update to the modern JSX transform for faster performance: https://react.dev/link/new-jsx-transform")),_(tt)&&(c(tt.key),vt=""+tt.key),tt)ye.call(tt,ft)&&ft!=="key"&&ft!=="__self"&&ft!=="__source"&&($e[ft]=tt[ft]);var Ye=arguments.length-2;if(Ye===1)$e.children=Je;else if(1<Ye){for(var je=Array(Ye),st=0;st<Ye;st++)je[st]=arguments[st+2];Object.freeze&&Object.freeze(je),$e.children=je}if(Fe&&Fe.defaultProps)for(ft in Ye=Fe.defaultProps,Ye)$e[ft]===void 0&&($e[ft]=Ye[ft]);return vt&&p($e,typeof Fe==="function"?Fe.displayName||Fe.name||"Unknown":Fe),(ft=1e4>_e.recentlyCreatedOwnerStacks++)?(je=Error.stackTraceLimit,Error.stackTraceLimit=10,Ye=Error("react-stack-top-frame"),Error.stackTraceLimit=je):Ye=dt,A(Fe,vt,$e,d(),Ye,ft?Se(h(Fe)):rt)},a2o.createRef=function(){var Fe={current:null};return Object.seal(Fe),Fe},a2o.forwardRef=function(Fe){Fe!=null&&Fe.$$typeof===Z?console.error("forwardRef requires a render function but received a `memo` component. Instead of forwardRef(memo(...)), use memo(forwardRef(...))."):typeof Fe!=="function"?console.error("forwardRef requires a render function but was given %s.",Fe===null?"null":typeof Fe):Fe.length!==0&&Fe.length!==2&&console.error("forwardRef render functions accept exactly two parameters: props and ref. %s",Fe.length===1?"Did you forget to use the ref parameter?":"Any additional parameter will be undefined."),Fe!=null&&Fe.defaultProps!=null&&console.error("forwardRef render functions do not support defaultProps. Did you accidentally pass a React component?");var tt={$$typeof:se,render:Fe},Je;return Object.defineProperty(tt,"displayName",{enumerable:!1,configurable:!0,get:function(){return Je},set:function($e){Je=$e,Fe.name||Fe.displayName||(Object.defineProperty(Fe,"name",{value:$e}),Fe.displayName=$e)}}),tt},a2o.isValidElement=y,a2o.lazy=function(Fe){Fe={_status:-1,_result:Fe};var tt={$$typeof:te,_payload:Fe,_init:P},Je={name:"lazy",start:-1,end:-1,value:null,owner:null,debugStack:Error("react-stack-top-frame"),debugTask:console.createTask?console.createTask("lazy()"):null};return Fe._ioInfo=Je,tt._debugInfo=[{awaited:Je}],tt},a2o.memo=function(Fe,tt){Fe==null&&console.error("memo: The first argument must be a component. Instead received: %s",Fe===null?"null":typeof Fe),tt={$$typeof:Z,type:Fe,compare:tt===void 0?null:tt};var Je;return Object.defineProperty(tt,"displayName",{enumerable:!1,configurable:!0,get:function(){return Je},set:function($e){Je=$e,Fe.name||Fe.displayName||(Object.defineProperty(Fe,"name",{value:$e}),Fe.displayName=$e)}}),tt},a2o.startTransition=T,a2o.unstable_useCacheRefresh=function(){return M().useCacheRefresh()},a2o.use=function(Fe){return M().use(Fe)},a2o.useActionState=function(Fe,tt,Je){return M().useActionState(Fe,tt,Je)},a2o.useCallback=function(Fe,tt){return M().useCallback(Fe,tt)},a2o.useContext=function(Fe){var tt=M();return Fe.$$typeof===J&&console.error("Calling useContext(Context.Consumer) is not supported and will cause bugs. Did you mean to call useContext(Context) instead?"),tt.useContext(Fe)},a2o.useDebugValue=function(Fe,tt){return M().useDebugValue(Fe,tt)},a2o.useDeferredValue=function(Fe,tt){return M().useDeferredValue(Fe,tt)},a2o.useEffect=function(Fe,tt){return Fe==null&&console.warn("React Hook useEffect requires an effect callback. Did you forget to pass a callback to the hook?"),M().useEffect(Fe,tt)},a2o.useEffectEvent=function(Fe){return M().useEffectEvent(Fe)},a2o.useId=function(){return M().useId()},a2o.useImperativeHandle=function(Fe,tt,Je){return M().useImperativeHandle(Fe,tt,Je)},a2o.useInsertionEffect=function(Fe,tt){return Fe==null&&console.warn("React Hook useInsertionEffect requires an effect callback. Did you forget to pass a callback to the hook?"),M().useInsertionEffect(Fe,tt)},a2o.useLayoutEffect=function(Fe,tt){return Fe==null&&console.warn("React Hook useLayoutEffect requires an effect callback. Did you forget to pass a callback to the hook?"),M().useLayoutEffect(Fe,tt)},a2o.useMemo=function(Fe,tt){return M().useMemo(Fe,tt)},a2o.useOptimistic=function(Fe,tt){return M().useOptimistic(Fe,tt)},a2o.useReducer=function(Fe,tt,Je){return M().useReducer(Fe,tt,Je)},a2o.useRef=function(Fe){return M().useRef(Fe)},a2o.useState=function(Fe){return M().useState(Fe)},a2o.useSyncExternalStore=function(Fe,tt,Je){return M().useSyncExternalStore(Fe,tt,Je)},a2o.useTransition=function(){return M().useTransition()},a2o.version="19.3.1",typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop==="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()});var p1t=lt(function($W){(function(){function e(){if(x=!1,v){var L=$W.unstable_now();B=L;var H=!0;try{e:{f=!1,y&&(y=!1,b(P),P=-1),g=!0;var V=A;try{t:{i(L);for(m=n(u);m!==null&&!(m.expirationTime>L&&a());){var O=m.callback;if(typeof O==="function"){m.callback=null,A=m.priorityLevel;var U=O(m.expirationTime<=L);if(L=$W.unstable_now(),typeof U==="function"){m.callback=U,i(L),H=!0;break t}m===n(u)&&o(u),i(L)}else o(u);m=n(u)}if(m!==null)H=!0;else{var j=n(_);j!==null&&c(s,j.startTime-L),H=!1}}break e}finally{m=null,A=V,g=!1}H=void 0}}finally{H?T():v=!1}}}function t(L,H){var V=L.length;L.push(H);e:for(;0<V;){var O=V-1>>>1,U=L[O];if(0<r(U,H))L[O]=H,L[V]=U,V=O;else break e}}function n(L){return L.length===0?null:L[0]}function o(L){if(L.length===0)return null;var H=L[0],V=L.pop();if(V!==H){L[0]=V;e:for(var O=0,U=L.length,j=U>>>1;O<j;){var Y=2*(O+1)-1,X=L[Y],K=Y+1,J=L[K];if(0>r(X,V))K<U&&0>r(J,X)?(L[O]=J,L[K]=V,O=K):(L[O]=X,L[Y]=V,O=Y);else if(K<U&&0>r(J,V))L[O]=J,L[K]=V,O=K;else break e}}return H}function r(L,H){var V=L.sortIndex-H.sortIndex;return V!==0?V:L.id-H.id}function i(L){for(var H=n(_);H!==null;){if(H.callback===null)o(_);else if(H.startTime<=L)o(_),H.sortIndex=H.expirationTime,t(u,H);else break;H=n(_)}}function s(L){if(y=!1,i(L),!f)if(n(u)!==null)f=!0,v||(v=!0,T());else{var H=n(_);H!==null&&c(s,H.startTime-L)}}function a(){return x?!0:$W.unstable_now()-B<M?!1:!0}function c(L,H){P=C(function(){L($W.unstable_now())},H)}if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart==="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error()),$W.unstable_now=void 0,typeof performance==="object"&&typeof performance.now==="function"){var l=performance;$W.unstable_now=function(){return l.now()}}else{var h=Date,d=h.now();$W.unstable_now=function(){return h.now()-d}}var u=[],_=[],p=1,m=null,A=3,g=!1,f=!1,y=!1,x=!1,C=typeof setTimeout==="function"?setTimeout:null,b=typeof clearTimeout==="function"?clearTimeout:null,I=typeof setImmediate<"u"?setImmediate:null,v=!1,P=-1,M=5,B=-1;if(typeof I==="function")var T=function(){I(e)};else if(typeof MessageChannel<"u"){var N=new MessageChannel,D=N.port2;N.port1.onmessage=e,T=function(){D.postMessage(null)}}else T=function(){C(e,0)};$W.unstable_IdlePriority=5,$W.unstable_ImmediatePriority=1,$W.unstable_LowPriority=4,$W.unstable_NormalPriority=3,$W.unstable_Profiling=null,$W.unstable_UserBlockingPriority=2,$W.unstable_cancelCallback=function(L){L.callback=null},$W.unstable_forceFrameRate=function(L){0>L||125<L?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):M=0<L?Math.floor(1000/L):5},$W.unstable_getCurrentPriorityLevel=function(){return A},$W.unstable_next=function(L){switch(A){case 1:case 2:case 3:var H=3;break;default:H=A}var V=A;A=H;try{return L()}finally{A=V}},$W.unstable_requestPaint=function(){x=!0},$W.unstable_runWithPriority=function(L,H){switch(L){case 1:case 2:case 3:case 4:case 5:break;default:L=3}var V=A;A=L;try{return H()}finally{A=V}},$W.unstable_scheduleCallback=function(L,H,V){var O=$W.unstable_now();switch(typeof V==="object"&&V!==null?(V=V.delay,V=typeof V==="number"&&0<V?O+V:O):V=O,L){case 1:var U=-1;break;case 2:U=250;break;case 5:U=1073741823;break;case 4:U=1e4;break;default:U=5000}return U=V+U,L={id:p++,callback:H,priorityLevel:L,startTime:V,expirationTime:U,sortIndex:-1},V>O?(L.sortIndex=V,t(_,L),n(u)===null&&L===n(_)&&(y?(b(P),P=-1):y=!0,c(s,V-O))):(L.sortIndex=U,t(u,L),f||g||(f=!0,v||(v=!0,T()))),L},$W.unstable_shouldYield=a,$W.unstable_wrapCallback=function(L){var H=A;return function(){var V=A;A=H;try{return L.apply(this,arguments)}finally{A=V}}},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop==="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()});var m1t=lt(function(c2o){var wDe=Qe(rn());(function(){function e(){}function t(u){return""+u}function n(u,_,p){var m=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;if(m==null)m=null;else if(m===h)m=h;else{try{t(m);var A=!1}catch(g){A=!0}A&&(console.error("The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",typeof Symbol==="function"&&Symbol.toStringTag&&m[Symbol.toStringTag]||m.constructor.name||"Object"),t(m)),m=""+m}return{$$typeof:c,key:m,children:u,containerInfo:_,implementation:p}}function o(u,_){if(u==="font")return"";if(typeof _==="string")return _==="use-credentials"?_:""}function r(u){return u===null?"`null`":u===void 0?"`undefined`":u===""?"an empty string":'something with type "'+typeof u+'"'}function i(u){return u===null?"`null`":u===void 0?"`undefined`":u===""?"an empty string":typeof u==="string"?JSON.stringify(u):typeof u==="number"?"`"+u+"`":'something with type "'+typeof u+'"'}function s(){var u=d.H;return u===null&&console.error(`Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
1. You might have mismatching versions of React and the renderer (such as React DOM)
2. You might be breaking the Rules of Hooks
3. You might have more than one copy of React in the same app
See https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem.`),u}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart==="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var a={d:{f:e,r:function(){throw Error("Invalid form element. requestFormReset must be passed a form that was rendered by React.")},D:e,C:e,L:e,m:e,X:e,S:e,M:e},p:0,findDOMNode:null},c=Symbol.for("react.portal"),l=Symbol.for("react.recoverable"),h=Symbol.for("react.optimistic_key"),d=wDe.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;typeof Map==="function"&&Map.prototype!=null&&typeof Map.prototype.forEach==="function"&&typeof Set==="function"&&Set.prototype!=null&&typeof Set.prototype.clear==="function"&&typeof Set.prototype.forEach==="function"||console.error("React depends on Map and Set built-in types. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills"),c2o.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,c2o.browser=function(u){return{$$typeof:l,_reason:u}},c2o.createPortal=function(u,_){var p=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!_||_.nodeType!==1&&_.nodeType!==9&&_.nodeType!==11)throw Error("Target container is not a DOM element.");return n(u,_,null,p)},c2o.flushSync=function(u){var _=d.T,p=a.p;try{if(d.T=null,a.p=2,u)return u()}finally{d.T=_,a.p=p,a.d.f()&&console.error("flushSync was called from inside a lifecycle method. React cannot flush when React is already rendering. Consider moving this call to a scheduler task or micro task.")}},c2o.preconnect=function(u,_){typeof u==="string"&&u?_!=null&&typeof _!=="object"?console.error("ReactDOM.preconnect(): Expected the `options` argument (second) to be an object but encountered %s instead. The only supported option at this time is `crossOrigin` which accepts a string.",i(_)):_!=null&&typeof _.crossOrigin!=="string"&&console.error("ReactDOM.preconnect(): Expected the `crossOrigin` option (second argument) to be a string but encountered %s instead. Try removing this option or passing a string value instead.",r(_.crossOrigin)):console.error("ReactDOM.preconnect(): Expected the `href` argument (first) to be a non-empty string but encountered %s instead.",r(u)),typeof u==="string"&&(_?(_=_.crossOrigin,_=typeof _==="string"?_==="use-credentials"?_:"":void 0):_=null,a.d.C(u,_))},c2o.prefetchDNS=function(u){if(typeof u!=="string"||!u)console.error("ReactDOM.prefetchDNS(): Expected the `href` argument (first) to be a non-empty string but encountered %s instead.",r(u));else if(1<arguments.length){var _=arguments[1];typeof _==="object"&&_.hasOwnProperty("crossOrigin")?console.error("ReactDOM.prefetchDNS(): Expected only one argument, `href`, but encountered %s as a second argument instead. This argument is reserved for future options and is currently disallowed. It looks like the you are attempting to set a crossOrigin property for this DNS lookup hint. Browsers do not perform DNS queries using CORS and setting this attribute on the resource hint has no effect. Try calling ReactDOM.prefetchDNS() with just a single string argument, `href`.",i(_)):console.error("ReactDOM.prefetchDNS(): Expected only one argument, `href`, but encountered %s as a second argument instead. This argument is reserved for future options and is currently disallowed. Try calling ReactDOM.prefetchDNS() with just a single string argument, `href`.",i(_))}typeof u==="string"&&a.d.D(u)},c2o.preinit=function(u,_){if(typeof u==="string"&&u?_==null||typeof _!=="object"?console.error("ReactDOM.preinit(): Expected the `options` argument (second) to be an object with an `as` property describing the type of resource to be preinitialized but encountered %s instead.",i(_)):_.as!=="style"&&_.as!=="script"&&console.error('ReactDOM.preinit(): Expected the `as` property in the `options` argument (second) to contain a valid value describing the type of resource to be preinitialized but encountered %s instead. Valid values for `as` are "style" and "script".',i(_.as)):console.error("ReactDOM.preinit(): Expected the `href` argument (first) to be a non-empty string but encountered %s instead.",r(u)),typeof u==="string"&&_&&typeof _.as==="string"){var p=_.as,m=o(p,_.crossOrigin),A=typeof _.integrity==="string"?_.integrity:void 0,g=typeof _.fetchPriority==="string"?_.fetchPriority:void 0;p==="style"?a.d.S(u,typeof _.precedence==="string"?_.precedence:void 0,{crossOrigin:m,integrity:A,fetchPriority:g}):p==="script"&&a.d.X(u,{crossOrigin:m,integrity:A,fetchPriority:g,nonce:typeof _.nonce==="string"?_.nonce:void 0})}},c2o.preinitModule=function(u,_){var p="";if(typeof u==="string"&&u||(p+=" The `href` argument encountered was "+r(u)+"."),_!==void 0&&typeof _!=="object"?p+=" The `options` argument encountered was "+r(_)+".":_&&("as"in _)&&_.as!=="script"&&(p+=" The `as` option encountered was "+i(_.as)+"."),p)console.error("ReactDOM.preinitModule(): Expected up to two arguments, a non-empty `href` string and, optionally, an `options` object with a valid `as` property.%s",p);else switch(p=_&&typeof _.as==="string"?_.as:"script",p){case"script":break;default:p=i(p),console.error('ReactDOM.preinitModule(): Currently the only supported "as" type for this function is "script" but received "%s" instead. This warning was generated for `href` "%s". In the future other module types will be supported, aligning with the import-attributes proposal. Learn more here: (https://github.com/tc39/proposal-import-attributes)',p,u)}if(typeof u==="string")if(typeof _==="object"&&_!==null){if(_.as==null||_.as==="script")p=o(_.as,_.crossOrigin),a.d.M(u,{crossOrigin:p,integrity:typeof _.integrity==="string"?_.integrity:void 0,nonce:typeof _.nonce==="string"?_.nonce:void 0,fetchPriority:typeof _.fetchPriority==="string"?_.fetchPriority:void 0})}else _==null&&a.d.M(u)},c2o.preload=function(u,_){var p="";if(typeof u==="string"&&u||(p+=" The `href` argument encountered was "+r(u)+"."),_==null||typeof _!=="object"?p+=" The `options` argument encountered was "+r(_)+".":typeof _.as==="string"&&_.as||(p+=" The `as` option encountered was "+r(_.as)+"."),p&&console.error('ReactDOM.preload(): Expected two arguments, a non-empty `href` string and an `options` object with an `as` property valid for a `<link rel="preload" as="..." />` tag.%s',p),typeof u==="string"&&typeof _==="object"&&_!==null&&typeof _.as==="string"){p=_.as;var m=o(p,_.crossOrigin);a.d.L(u,p,{crossOrigin:m,integrity:typeof _.integrity==="string"?_.integrity:void 0,nonce:typeof _.nonce==="string"?_.nonce:void 0,type:typeof _.type==="string"?_.type:void 0,fetchPriority:typeof _.fetchPriority==="string"?_.fetchPriority:void 0,referrerPolicy:typeof _.referrerPolicy==="string"?_.referrerPolicy:void 0,imageSrcSet:typeof _.imageSrcSet==="string"?_.imageSrcSet:void 0,imageSizes:typeof _.imageSizes==="string"?_.imageSizes:void 0,media:typeof _.media==="string"?_.media:void 0})}},c2o.preloadModule=function(u,_){var p="";typeof u==="string"&&u||(p+=" The `href` argument encountered was "+r(u)+"."),_!==void 0&&typeof _!=="object"?p+=" The `options` argument encountered was "+r(_)+".":_&&("as"in _)&&typeof _.as!=="string"&&(p+=" The `as` option encountered was "+r(_.as)+"."),p&&console.error('ReactDOM.preloadModule(): Expected two arguments, a non-empty `href` string and, optionally, an `options` object with an `as` property valid for a `<link rel="modulepreload" as="..." />` tag.%s',p),typeof u==="string"&&(_?(p=o(_.as,_.crossOrigin),a.d.m(u,{as:typeof _.as==="string"&&_.as!=="script"?_.as:void 0,crossOrigin:p,integrity:typeof _.integrity==="string"?_.integrity:void 0,nonce:typeof _.nonce==="string"?_.nonce:void 0,fetchPriority:typeof _.fetchPriority==="string"?_.fetchPriority:void 0})):a.d.m(u))},c2o.requestFormReset=function(u){a.d.r(u)},c2o.unstable_batchedUpdates=function(u,_){return u(_)},c2o.useFormState=function(u,_,p){return s().useFormState(u,_,p)},c2o.useFormStatus=function(){return s().useHostTransitionStatus()},c2o.version="19.3.1",typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop==="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()});var Y8=lt(function(l2o,Fge){Fge.exports=Qe(m1t())});var _1t=lt(function(h2o){var el=Qe(p1t()),qW=Qe(rn()),BDe=Qe(Y8());(function(){function e(S,w){for(S=S.memoizedState;S!==null&&0<w;)S=S.next,w--;return S}function t(S,w,Q,W){if(Q>=w.length)return W;var oe=w[Q],ae=a0(S)?S.slice():ta({},S);return ae[oe]=t(S[oe],w,Q+1,W),ae}function n(S,w,Q){if(w.length!==Q.length)console.warn("copyWithRename() expects paths of the same length");else{for(var W=0;W<Q.length-1;W++)if(w[W]!==Q[W]){console.warn("copyWithRename() expects paths to be the same except for the deepest key");return}return o(S,w,Q,0)}}function o(S,w,Q,W){var oe=w[W],ae=a0(S)?S.slice():ta({},S);return W+1===w.length?(ae[Q[W]]=ae[oe],a0(ae)?ae.splice(oe,1):delete ae[oe]):ae[oe]=o(S[oe],w,Q,W+1),ae}function r(S,w,Q){var W=w[Q],oe=a0(S)?S.slice():ta({},S);if(Q+1===w.length)return a0(oe)?oe.splice(W,1):delete oe[W],oe;return oe[W]=r(S[W],w,Q+1),oe}function i(){return!1}function s(){return null}function a(){console.error("Do not call Hooks inside useEffect(...), useMemo(...), or other built-in Hooks. You can only call Hooks at the top level of your React function. For more information, see https://react.dev/link/rules-of-hooks")}function c(){console.error("Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo().")}function l(){}function h(){}function d(S){var w=[];return S.forEach(function(Q){w.push(Q)}),w.sort().join(", ")}function u(S,w,Q,W){return new Qs(S,w,Q,W)}function _(S,w){S.context===ZD&&(AC(S.current,2,w,S,null,null),W6())}function p(S,w){if($E!==null){var Q=w.staleFamilies;w=w.updatedFamilies,E1(),pa(S.current,w,Q),W6()}}function m(S){$E=S}function A(S){return!(!S||S.nodeType!==1&&S.nodeType!==9&&S.nodeType!==11)}function g(S){for(var w=S,Q=w;Q&&!Q.alternate;)w=Q,(w.flags&4098)!==0&&(S=w.return),Q=w.return;for(;w.return;)w=w.return;return w.tag===3?S:null}function f(S){if(S.tag===13){var w=S.memoizedState;if(w===null&&(S=S.alternate,S!==null&&(w=S.memoizedState)),w!==null)return w.dehydrated}return null}function y(S){if(S.tag===31){var w=S.memoizedState;if(w===null&&(S=S.alternate,S!==null&&(w=S.memoizedState)),w!==null)return w.dehydrated}return null}function x(S){if(g(S)!==S)throw Error("Unable to find node on an unmounted component.")}function C(S){var w=S.alternate;if(!w){if(w=g(S),w===null)throw Error("Unable to find node on an unmounted component.");return w!==S?null:S}for(var Q=S,W=w;;){var oe=Q.return;if(oe===null)break;var ae=oe.alternate;if(ae===null){if(W=oe.return,W!==null){Q=W;continue}break}if(oe.child===ae.child){for(ae=oe.child;ae;){if(ae===Q)return x(oe),S;if(ae===W)return x(oe),w;ae=ae.sibling}throw Error("Unable to find node on an unmounted component.")}if(Q.return!==W.return)Q=oe,W=ae;else{for(var De=!1,ke=oe.child;ke;){if(ke===Q){De=!0,Q=oe,W=ae;break}if(ke===W){De=!0,W=oe,Q=ae;break}ke=ke.sibling}if(!De){for(ke=ae.child;ke;){if(ke===Q){De=!0,Q=ae,W=oe;break}if(ke===W){De=!0,W=ae,Q=oe;break}ke=ke.sibling}if(!De)throw Error("Child was not found in either parent set. This indicates a bug in React related to the return pointer. Please file an issue.")}}if(Q.alternate!==W)throw Error("Return fibers should always be each others' alternates. This error is likely caused by a bug in React. Please file an issue.")}if(Q.tag!==3)throw Error("Unable to find node on an unmounted component.");return Q.stateNode.current===Q?S:w}function b(S){var w=S.tag;if(w===5||w===26||w===27||w===6)return S;for(S=S.child;S!==null;){if(w=b(S),w!==null)return w;S=S.sibling}return null}function I(S,w,Q,W,oe){v(S.child,!1,w,Q,W,oe)}function v(S,w,Q,W,oe,ae){for(;S!==null;){if((S.tag===5||S.tag===27||S.tag===6)&&Q(S,W,oe,ae)||(S.tag!==22||S.memoizedState===null)&&(w||S.tag!==5&&S.tag!==27)&&v(S.child,w,Q,W,oe,ae))return!0;S=S.sibling}return!1}function P(S){for(S=S.return;S!==null;){if(S.tag===3||S.tag===5||S.tag===27)return S;S=S.return}return null}function M(S){var w=!1;for(S=S.return;S!==null;){if(S.tag===4&&(w=!0),S.tag===3||S.tag===5||S.tag===27)break;S=S.return}return w}function B(S){var w=[null,null],Q=P(S);if(Q===null)return w;return T(w,S,Q.child,{foundSelf:!1}),w}function T(S,w,Q,W){for(;Q!==null;){if(Q===w)W.foundSelf=!0;else if(Q.tag===5||Q.tag===27||Q.tag===6){if(W.foundSelf)return S[1]=Q,!0;S[0]=Q}else if((Q.tag!==22||Q.memoizedState===null)&&T(S,w,Q.child,W))return!0;Q=Q.sibling}return!1}function N(S){switch(S.tag){case 5:case 27:case 6:return S.stateNode;case 3:return S.stateNode.containerInfo;default:throw Error("Expected to find a host node. This is a bug in React.")}}function D(S,w,Q){return S===Q?!0:S===w?(t4=S,!0):!1}function L(S,w,Q){return S===Q?(YE=S,!1):S===w?(YE!==null&&(t4=S),!0):!1}function H(S){if(S===null)return null;do S=S===null?null:S.return;while(S&&S.tag!==5&&S.tag!==27&&S.tag!==3);return S?S:null}function V(S,w,Q){for(var W=0,oe=S;oe;oe=Q(oe))W++;oe=0;for(var ae=w;ae;ae=Q(ae))oe++;for(;0<W-oe;)S=Q(S),W--;for(;0<oe-W;)w=Q(w),oe--;for(;W--;){if(S===w||w!==null&&S===w.alternate)return S;S=Q(S),w=Q(w)}return null}function O(S){if(S===null||typeof S!=="object")return null;return S=ZH&&S[ZH]||S["@@iterator"],typeof S==="function"?S:null}function U(S){if(S==null)return null;if(typeof S==="function")return S.$$typeof===cW?null:S.displayName||S.name||null;if(typeof S==="string")return S;switch(S){case b8:return"Fragment";case sW:return"Profiler";case JH:return"StrictMode";case aW:return"Suspense";case up:return"SuspenseList";case s0:return"Activity";case I8:return"ViewTransition"}if(typeof S==="object")switch(typeof S.tag==="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),S.$$typeof){case C8:return"Portal";case fl:return S.displayName||"Context";case o4:return(S._context.displayName||"Context")+".Consumer";case YD:var w=S.render;return S=S.displayName,S||(S=w.displayName||w.name||"",S=S!==""?"ForwardRef("+S+")":"ForwardRef"),S;case uI:return w=S.displayName||null,w!==null?w:U(S.type)||"Memo";case nm:w=S._payload,S=S._init;try{return U(S(w))}catch(Q){}}return null}function j(S){return typeof S.tag==="number"?Y(S):typeof S.name==="string"?S.name:null}function Y(S){var w=S.type;switch(S.tag){case 31:return"Activity";case 24:return"Cache";case 9:return(w._context.displayName||"Context")+".Consumer";case 10:return w.displayName||"Context";case 18:return"DehydratedFragment";case 11:return S=w.render,S=S.displayName||S.name||"",w.displayName||(S!==""?"ForwardRef("+S+")":"ForwardRef");case 7:return"Fragment";case 26:case 27:case 5:return w;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return U(w);case 8:return w===JH?"StrictMode":"Mode";case 22:if(S.return!==null)return Y(S.return);break;case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 30:return"ViewTransition";case 1:case 0:case 14:case 15:if(typeof w==="function")return w.displayName||w.name||null;if(typeof w==="string")return w;break;case 29:if(w=S._debugInfo,w!=null){for(var Q=w.length-1;0<=Q;Q--)if(typeof w[Q].name==="string")return w[Q].name}if(S.return!==null)return Y(S.return)}return null}function X(S){return{current:S}}function K(S,w){0>Ru?console.error("Unexpected pop."):(w!==One[Ru]&&console.error("Unexpected Fiber popped."),S.current=GD[Ru],GD[Ru]=null,One[Ru]=null,Ru--)}function J(S,w,Q){Ru++,GD[Ru]=S.current,One[Ru]=Q,S.current=w}function ee(S){return S===null&&console.error("Expected host context to exist. This error is likely caused by a bug in React. Please file an issue."),S}function se(S,w){J(Xg,w,S),J(Wg,S,S),J(Qu,null,S);var Q=w.nodeType;switch(Q){case 9:case 11:Q=Q===9?"#document":"#fragment",w=(w=w.documentElement)?(w=w.namespaceURI)?eI(w):sM:sM;break;default:if(Q=w.tagName,w=w.namespaceURI)w=eI(w),w=QE(w,Q);else switch(Q){case"svg":w=GW;break;case"math":w=Tge;break;default:w=sM}}Q=Q.toLowerCase(),Q=Fp(null,Q),Q={context:w,ancestorInfo:Q},K(Qu,S),J(Qu,Q,S)}function ne(S){K(Qu,S),K(Wg,S),K(Xg,S)}function re(){return ee(Qu.current)}function Z(S){var w=S.memoizedState;w!==null&&(WW._currentValue=w.memoizedState,J(v8,S,S)),w=ee(Qu.current);var Q=S.type,W=QE(w.context,Q);Q=Fp(w.ancestorInfo,Q),W={context:W,ancestorInfo:Q},w!==W&&(J(Wg,S,S),J(Qu,W,S))}function te(S){Wg.current===S&&(K(Qu,S),K(Wg,S)),v8.current===S&&(K(v8,S),WW._currentValue=BF)}function ie(){}function ce(){if(bC===0){lW=console.log,S8=console.info,tF=console.warn,Vne=console.error,Za=console.group,uh=console.groupCollapsed,Ia=console.groupEnd;var S={configurable:!0,enumerable:!0,value:ie,writable:!0};Object.defineProperties(console,{info:S,log:S,warn:S,error:S,group:S,groupCollapsed:S,groupEnd:S})}bC++}function ue(){if(bC--,bC===0){var S={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:ta({},S,{value:lW}),info:ta({},S,{value:S8}),warn:ta({},S,{value:tF}),error:ta({},S,{value:Vne}),group:ta({},S,{value:Za}),groupCollapsed:ta({},S,{value:uh}),groupEnd:ta({},S,{value:Ia})})}0>bC&&console.error("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}function de(S){var w=Error.prepareStackTrace;if(Error.prepareStackTrace=void 0,S=S.stack,Error.prepareStackTrace=w,S.startsWith(`Error: react-stack-top-frame
`)&&(S=S.slice(29)),w=S.indexOf(`
`),w!==-1&&(S=S.slice(w+1)),w=S.indexOf("react_stack_bottom_frame"),w!==-1&&(w=S.lastIndexOf(`
`,w)),w!==-1)S=S.slice(0,w);else return"";return S}function me(S){if(va===void 0)try{throw Error()}catch(Q){var w=Q.stack.trim().match(/\n( *(at )?)/);va=w&&w[1]||"",gf=-1<Q.stack.indexOf(`
    at`)?" (<anonymous>)":-1<Q.stack.indexOf("@")?"@unknown:0:0":""}return`
`+va+S+gf}function ge(S,w){if(!S||GE)return"";var Q=pI.get(S);if(Q!==void 0)return Q;GE=!0,Q=Error.prepareStackTrace,Error.prepareStackTrace=void 0;var W=null;W=Vn.H,Vn.H=null,ce();try{var oe={DetermineComponentFrameRoot:function(){try{if(w){var Zt=function(){throw Error()};if(Object.defineProperty(Zt.prototype,"props",{set:function(){throw Error()}}),typeof Reflect==="object"&&Reflect.construct){try{Reflect.construct(Zt,[])}catch(xr){var xn=xr}Reflect.construct(S,[],Zt)}else{try{Zt.call()}catch(xr){xn=xr}Zt=!1;try{var Co=Object.getOwnPropertyDescriptor(S.prototype,"props");Object.defineProperty(S.prototype,"props",{configurable:!0,set:function(){throw Error()}}),Zt=!0,new S}finally{Zt&&(Co!==void 0?Object.defineProperty(S.prototype,"props",Co):delete S.prototype.props)}}}else{try{throw Error()}catch(xr){xn=xr}(Zt=S())&&typeof Zt.catch==="function"&&Zt.catch(function(){})}}catch(xr){if(xr&&xn&&typeof xr.stack==="string")return[xr.stack,xn.stack]}return[null,null]}};oe.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var ae=Object.getOwnPropertyDescriptor(oe.DetermineComponentFrameRoot,"name");ae&&ae.configurable&&Object.defineProperty(oe.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var De=oe.DetermineComponentFrameRoot(),ke=De[0],ot=De[1];if(ke&&ot){var _t=ke.split(`
`),zt=ot.split(`
`);for(De=ae=0;ae<_t.length&&!_t[ae].includes("DetermineComponentFrameRoot");)ae++;for(;De<zt.length&&!zt[De].includes("DetermineComponentFrameRoot");)De++;if(ae===_t.length||De===zt.length)for(ae=_t.length-1,De=zt.length-1;1<=ae&&0<=De&&_t[ae]!==zt[De];)De--;for(;1<=ae&&0<=De;ae--,De--)if(_t[ae]!==zt[De]){if(ae!==1||De!==1)do if(ae--,De--,0>De||_t[ae]!==zt[De]){var en=`
`+_t[ae].replace(" at new "," at ");return S.displayName&&en.includes("<anonymous>")&&(en=en.replace("<anonymous>",S.displayName)),typeof S==="function"&&pI.set(S,en),en}while(1<=ae&&0<=De);break}}}finally{GE=!1,Vn.H=W,ue(),Error.prepareStackTrace=Q}return _t=(_t=S?S.displayName||S.name:"")?me(_t):"",typeof S==="function"&&pI.set(S,_t),_t}function xe(S,w){switch(S.tag){case 26:case 27:case 5:return me(S.type);case 16:return me("Lazy");case 13:return S.child!==w&&w!==null?me("Suspense Fallback"):me("Suspense");case 19:return me("SuspenseList");case 0:case 15:return ge(S.type,!1);case 11:return ge(S.type.render,!1);case 1:return ge(S.type,!0);case 31:return me("Activity");case 30:return me("ViewTransition");default:return""}}function Ee(S){try{var w="",Q=null;do{w+=xe(S,Q);var W=S._debugInfo;if(W)for(var oe=W.length-1;0<=oe;oe--){var ae=W[oe];if(typeof ae.name==="string"){var De=w;e:{var{name:ke,env:ot,debugLocation:_t}=ae;if(_t!=null){var zt=de(_t),en=zt.lastIndexOf(`
`),Zt=en===-1?zt:zt.slice(en+1);if(Zt.indexOf(ke)!==-1){var xn=`
`+Zt;break e}}xn=me(ke+(ot?" ["+ot+"]":""))}w=De+xn}}Q=S,S=S.return}while(S);return w}catch(Co){return`
Error generating stack: `+Co.message+`
`+Co.stack}}function Re(S){return(S=S?S.displayName||S.name:"")?me(S):""}function Me(){if(K_===null)return null;var S=K_._debugOwner;return S!=null?j(S):null}function _e(){if(K_===null)return"";var S=K_;try{var w="";switch(S.tag===6&&(S=S.return),S.tag){case 26:case 27:case 5:w+=me(S.type);break;case 13:w+=me("Suspense");break;case 19:w+=me("SuspenseList");break;case 31:w+=me("Activity");break;case 30:w+=me("ViewTransition");break;case 0:case 15:case 1:S._debugOwner||w!==""||(w+=Re(S.type));break;case 11:S._debugOwner||w!==""||(w+=Re(S.type.render))}for(;S;)if(typeof S.tag==="number"){var Q=S;S=Q._debugOwner;var W=Q._debugStack;if(S&&W){var oe=de(W);oe!==""&&(w+=`
`+oe)}}else if(S.debugStack!=null){var ae=S.debugStack;(S=S.owner)&&ae&&(w+=`
`+de(ae))}else break;var De=w}catch(ke){De=`
Error generating stack: `+ke.message+`
`+ke.stack}return De}function ye(S,w,Q,W,oe,ae,De){var ke=K_;Se(S);try{return S!==null&&S._debugTask?S._debugTask.run(w.bind(null,Q,W,oe,ae,De)):w(Q,W,oe,ae,De)}finally{Se(ke)}throw Error("runWithFiberInDEV should never be called in production. This is a bug in React.")}function Se(S){Vn.getCurrentStack=S===null?null:_e,i4=!1,K_=S}function Ne(S){return typeof Symbol==="function"&&Symbol.toStringTag&&S[Symbol.toStringTag]||S.constructor.name||"Object"}function Le(S){try{return nt(S),!1}catch(w){return!0}}function nt(S){return""+S}function dt(S,w){if(Le(S))return console.error("The provided `%s` attribute is an unsupported type %s. This value must be coerced to a string before using it here.",w,Ne(S)),nt(S)}function rt(S,w){if(Le(S))return console.error("The provided `%s` CSS property is an unsupported type %s. This value must be coerced to a string before using it here.",w,Ne(S)),nt(S)}function pt(S){if(Le(S))return console.error("Form field values (value, checked, defaultValue, or defaultChecked props) must be strings, not %s. This value must be coerced to a string before using it here.",Ne(S)),nt(S)}function ct(S){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")return!1;var w=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(w.isDisabled)return!0;if(!w.supportsFiber)return console.error("The installed version of React DevTools is too old and will not work with the current version of React. Please update React DevTools. https://react.dev/link/react-devtools"),!0;try{T8=w.inject(S),ph=w}catch(Q){console.error("React instrumentation encountered an error: %o.",Q)}return w.checkDCE?!0:!1}function Ct(S){if(typeof w8==="function"&&B8(S),ph&&typeof ph.setStrictMode==="function")try{ph.setStrictMode(T8,S)}catch(w){jg||(jg=!0,console.error("React instrumentation encountered an error: %o",w))}}function kt(S){return S>>>=0,S===0?32:31-(hW(S)/Gne|0)|0}function Lt(S){var w=S&42;if(w!==0)return w;switch(S&-S){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return S&-S;case 262144:case 524288:case 1048576:case 2097152:return S&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return S&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return console.error("Should have found matching lanes. This is a bug in React."),S}}function Bt(S,w,Q){var W=S.pendingLanes;if(W===0)return 0;var oe=0,ae=S.suspendedLanes,De=S.pingedLanes;S=S.warmLanes;var ke=W&134217727;return ke!==0?(W=ke&~ae,W!==0?oe=Lt(W):(De&=ke,De!==0?oe=Lt(De):Q||(Q=ke&~S,Q!==0&&(oe=Lt(Q))))):(ke=W&~ae,ke!==0?oe=Lt(ke):De!==0?oe=Lt(De):Q||(Q=W&~S,Q!==0&&(oe=Lt(Q)))),oe===0?0:w!==0&&w!==oe&&(w&ae)===0&&(ae=oe&-oe,Q=w&-w,ae>=Q||ae===32&&(Q&4194048)!==0)?w:oe}function xt(S,w){return(S.pendingLanes&~(S.suspendedLanes&~S.pingedLanes)&w)===0}function Yt(S,w){(w&8)!==0&&(w|=w&32);var Q=S.entangledLanes;if(Q!==0)for(S=S.entanglements,Q&=w;0<Q;){var W=31-Wl(Q),oe=1<<W;w|=S[W],Q&=~oe}return w}function ut(S,w){switch(S){case 1:case 2:case 4:case 8:case 64:return w+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return w+5000;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return console.error("Should have found matching lanes. This is a bug in React."),-1}}function Ze(){var S=UD;return UD<<=1,(UD&62914560)===0&&(UD=4194304),S}function Fe(S){for(var w=[],Q=0;31>Q;Q++)w.push(S);return w}function tt(S,w){S.pendingLanes|=w,w!==268435456&&(S.suspendedLanes=0,S.pingedLanes=0,S.warmLanes=0)}function Je(S,w,Q,W,oe,ae){var De=S.pendingLanes;S.pendingLanes=Q,S.suspendedLanes=0,S.pingedLanes=0,S.warmLanes=0,S.expiredLanes&=Q,S.entangledLanes&=Q,S.errorRecoveryDisabledLanes&=Q,S.shellSuspendCounter=0;var{entanglements:ke,expirationTimes:ot,hiddenUpdates:_t}=S;for(Q=De&~Q;0<Q;){var zt=31-Wl(Q),en=1<<zt;ke[zt]=0,ot[zt]=-1;var Zt=_t[zt];if(Zt!==null)for(_t[zt]=null,zt=0;zt<Zt.length;zt++){var xn=Zt[zt];xn!==null&&(xn.lane&=-536870913)}Q&=~en}W!==0&&$e(S,W,0),ae!==0&&oe===0&&S.tag!==0&&(S.suspendedLanes|=ae&~(De&~w))}function $e(S,w,Q){S.pendingLanes|=w,S.suspendedLanes&=~w;var W=31-Wl(w);S.entangledLanes|=w,S.entanglements[W]=S.entanglements[W]|1073741824|Q&261930}function ft(S,w){var Q=S.entangledLanes|=w;for(S=S.entanglements;Q;){var W=31-Wl(Q),oe=1<<W;oe&w|S[W]&w&&(S[W]|=w),Q&=~oe}}function vt(S,w){var Q=w&-w;return Q=(Q&42)!==0?1:Ye(Q),(Q&(S.suspendedLanes|w))!==0?0:Q}function Ye(S){switch(S){case 2:S=1;break;case 8:S=4;break;case 32:S=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:S=128;break;case 268435456:S=134217728;break;default:S=0}return S}function je(S,w,Q){if(g2)for(S=S.pendingUpdatersLaneMap;0<Q;){var W=31-Wl(Q),oe=1<<W;S[W].add(w),Q&=~oe}}function st(S,w){if(g2)for(var Q=S.pendingUpdatersLaneMap,W=S.memoizedUpdaters;0<w;){var oe=31-Wl(w);S=1<<oe,oe=Q[oe],0<oe.size&&(oe.forEach(function(ae){var De=ae.alternate;De!==null&&W.has(De)||W.add(ae)}),oe.clear()),w&=~S}}function St(S){return S&=-S,om!==0&&om<S?Ym!==0&&Ym<S?(S&134217727)!==0?SC:dW:Ym:om}function Nt(){var S=Dc.p;if(S!==0)return S;return S=window.event,S===void 0?SC:hI(S.type)}function Ot(S,w){var Q=Dc.p;try{return Dc.p=S,w()}finally{Dc.p=Q}}function Ut(S){delete S[ku],delete S[Kg],delete S[pTe],delete S[Wne]}function mn(S){var w;if(w=S[ku])return w;for(var Q=S.parentNode;Q;){if(w=Q[_I]||Q[ku]){if(Q=w.alternate,w.child!==null||Q!==null&&Q.child!==null)for(S=sI(S);S!==null;){if(Q=S[ku])return Q;S=sI(S)}return w}S=Q,Q=S.parentNode}return null}function _n(S){if(S=S[ku]||S[_I]){var w=S.tag;if(w===5||w===6||w===13||w===31||w===26||w===27||w===3)return S}return null}function En(S){var w=S.tag;if(w===5||w===26||w===27||w===6)return S.stateNode;throw Error("getNodeFromInstance: Invalid argument.")}function Qn(S){var w=S[Gm];return w||(w=S[Gm]={hoistableStyles:new Map,hoistableScripts:new Map}),w}function ln(S){S[ix]=!0}function hn(S){S[gI]=void 0}function Zn(S,w){bo(S,w),bo(S+"Capture",w)}function bo(S,w){fI[S]&&console.error("EventRegistry: More than one plugin attempted to publish the same registration name, `%s`.",S),fI[S]=w;var Q=S.toLowerCase();rF[Q]=S,S==="onDoubleClick"&&(rF.ondblclick=S);for(S=0;S<w.length;S++)AI.add(w[S])}function ir(S,w){T_e[w.type]||w.onChange||w.onInput||w.readOnly||w.disabled||w.value==null||(S==="select"?console.error("You provided a `value` prop to a form field without an `onChange` handler. This will render a read-only field. If the field should be mutable use `defaultValue`. Otherwise, set `onChange`."):console.error("You provided a `value` prop to a form field without an `onChange` handler. This will render a read-only field. If the field should be mutable use `defaultValue`. Otherwise, set either `onChange` or `readOnly`.")),w.onChange||w.readOnly||w.disabled||w.checked==null||console.error("You provided a `checked` prop to a form field without an `onChange` handler. This will render a read-only field. If the field should be mutable use `defaultChecked`. Otherwise, set either `onChange` or `readOnly`.")}function gt(S){if(_2.call(uW,S))return!0;if(_2.call(WD,S))return!1;if(mTe.test(S))return uW[S]=!0;return WD[S]=!0,console.error("Invalid attribute name: `%s`",S),!1}function Oe(){var S=Nc;return Nc=!1,S}function mt(S,w,Q){if(gt(w)){if(!S.hasAttribute(w)){switch(typeof Q){case"symbol":case"object":return Q;case"function":return Q;case"boolean":if(Q===!1)return Q}return Q===void 0?void 0:null}if(S=w.toLowerCase()==="nonce"?S.nonce:S.getAttribute(w),S===""&&Q===!0)return!0;return dt(Q,w),S===""+Q?Q:S}}function It(S,w,Q){if(gt(w))if(Q===null)S.removeAttribute(w);else{switch(typeof Q){case"undefined":case"function":case"symbol":S.removeAttribute(w);return;case"boolean":var W=w.toLowerCase().slice(0,5);if(W!=="data-"&&W!=="aria-"){S.removeAttribute(w);return}}dt(Q,w),S.setAttribute(w,Q)}}function bt(S,w,Q){if(Q===null)S.removeAttribute(w);else{switch(typeof Q){case"undefined":case"function":case"symbol":case"boolean":S.removeAttribute(w);return}dt(Q,w),S.setAttribute(w,Q)}}function cn(S,w,Q,W){if(W===null)S.removeAttribute(Q);else{switch(typeof W){case"undefined":case"function":case"symbol":case"boolean":S.removeAttribute(Q);return}dt(W,Q),S.setAttributeNS(w,Q,W)}}function dn(S){switch(typeof S){case"bigint":case"boolean":case"number":case"string":case"undefined":return S;case"object":return pt(S),S;default:return""}}function wn(S){var w=S.type;return(S=S.nodeName)&&S.toLowerCase()==="input"&&(w==="checkbox"||w==="radio")}function eo(S,w,Q){var W=Object.getOwnPropertyDescriptor(S.constructor.prototype,w);if(!S.hasOwnProperty(w)&&typeof W<"u"&&typeof W.get==="function"&&typeof W.set==="function"){var{get:oe,set:ae}=W;return Object.defineProperty(S,w,{configurable:!0,get:function(){return oe.call(this)},set:function(De){pt(De),Q=""+De,ae.call(this,De)}}),Object.defineProperty(S,w,{enumerable:W.enumerable}),{getValue:function(){return Q},setValue:function(De){pt(De),Q=""+De},stopTracking:function(){S._valueTracker=null,delete S[w]}}}}function _o(S){if(!S._valueTracker){var w=wn(S)?"checked":"value";S._valueTracker=eo(S,w,""+S[w])}}function $n(S){if(!S)return!1;var w=S._valueTracker;if(!w)return!0;var Q=w.getValue(),W="";return S&&(W=wn(S)?S.checked?"true":"false":S.value),S=W,S!==Q?(w.setValue(S),!0):!1}function qn(S){return S.replace(pW,function(w){return"\\"+w.charCodeAt(0).toString(16)+" "})}function Po(S,w){w.checked===void 0||w.defaultChecked===void 0||N8||(console.error("%s contains an input of type %s with both checked and defaultChecked props. Input elements must be either controlled or uncontrolled (specify either the checked prop, or the defaultChecked prop, but not both). Decide between using a controlled or uncontrolled input element and remove one of these props. More info: https://react.dev/link/controlled-components",Me()||"A component",w.type),N8=!0),w.value===void 0||w.defaultValue===void 0||D_e||(console.error("%s contains an input of type %s with both value and defaultValue props. Input elements must be either controlled or uncontrolled (specify either the value prop, or the defaultValue prop, but not both). Decide between using a controlled or uncontrolled input element and remove one of these props. More info: https://react.dev/link/controlled-components",Me()||"A component",w.type),D_e=!0)}function To(S,w,Q,W,oe,ae,De,ke){if(S.name="",De!=null&&typeof De!=="function"&&typeof De!=="symbol"&&typeof De!=="boolean"?(dt(De,"type"),S.type=De):S.removeAttribute("type"),w!=null)if(De==="number"){if(w===0&&S.value===""||S.value!=w)S.value=""+dn(w)}else S.value!==""+dn(w)&&(S.value=""+dn(w));else De!=="submit"&&De!=="reset"||S.removeAttribute("value");w!=null?De==="number"&&S.value==w?lo(S,dn(S.value)):lo(S,dn(w)):Q!=null?lo(S,dn(Q)):W!=null&&S.removeAttribute("value"),oe==null&&ae!=null&&(S.defaultChecked=!!ae),oe!=null&&(S.checked=oe&&typeof oe!=="function"&&typeof oe!=="symbol"),ke!=null&&typeof ke!=="function"&&typeof ke!=="symbol"&&typeof ke!=="boolean"?(dt(ke,"name"),S.name=""+dn(ke)):S.removeAttribute("name")}function Tn(S,w,Q,W,oe,ae,De,ke){if(ae!=null&&typeof ae!=="function"&&typeof ae!=="symbol"&&typeof ae!=="boolean"&&(dt(ae,"type"),S.type=ae),w!=null||Q!=null){if(!(ae!=="submit"&&ae!=="reset"||w!==void 0&&w!==null)){_o(S);return}Q=Q!=null?""+dn(Q):"",w=w!=null?""+dn(w):Q,ke||w===S.value||(S.value=w),S.defaultValue=w}W=W!=null?W:oe,W=typeof W!=="function"&&typeof W!=="symbol"&&!!W,S.checked=ke?S.checked:!!W,S.defaultChecked=!!W,De!=null&&typeof De!=="function"&&typeof De!=="symbol"&&typeof De!=="boolean"&&(dt(De,"name"),S.name=De),_o(S)}function lo(S,w){S.defaultValue!==""+w&&(S.defaultValue=""+w)}function fo(S,w){w.value==null&&(typeof w.children==="object"&&w.children!==null?qW.Children.forEach(w.children,function(Q){Q==null||typeof Q==="string"||typeof Q==="number"||typeof Q==="bigint"||WE||(WE=!0,console.error("Cannot infer the option value of complex children. Pass a `value` prop or use a plain string as children to <option>."))}):w.dangerouslySetInnerHTML==null||iF||(iF=!0,console.error("Pass a `value` prop if you set dangerouslyInnerHTML so React knows which value should be selected."))),w.selected==null||XD||(console.error("Use the `defaultValue` or `value` props on <select> instead of setting `selected` on <option>."),XD=!0)}function oo(){var S=Me();return S?`

Check the render method of \``+S+"`.":""}function Ro(S,w,Q,W){if(S=S.options,w){w={};for(var oe=0;oe<Q.length;oe++)w["$"+Q[oe]]=!0;for(Q=0;Q<S.length;Q++)oe=w.hasOwnProperty("$"+S[Q].value),S[Q].selected!==oe&&(S[Q].selected=oe),oe&&W&&(S[Q].defaultSelected=!0)}else{Q=""+dn(Q),w=null;for(oe=0;oe<S.length;oe++){if(S[oe].value===Q){S[oe].selected=!0,W&&(S[oe].defaultSelected=!0);return}w!==null||S[oe].disabled||(w=S[oe])}w!==null&&(w.selected=!0)}}function or(S,w){for(S=0;S<jne.length;S++){var Q=jne[S];if(w[Q]!=null){var W=a0(w[Q]);w.multiple&&!W?console.error("The `%s` prop supplied to <select> must be an array if `multiple` is true.%s",Q,oo()):!w.multiple&&W&&console.error("The `%s` prop supplied to <select> must be a scalar value if `multiple` is false.%s",Q,oo())}}w.value===void 0||w.defaultValue===void 0||Xne||(console.error("Select elements must be either controlled or uncontrolled (specify either the value prop, or the defaultValue prop, but not both). Decide between using a controlled or uncontrolled select element and remove one of these props. More info: https://react.dev/link/controlled-components"),Xne=!0)}function Er(S,w){w.value===void 0||w.defaultValue===void 0||N_e||(console.error("%s contains a textarea with both value and defaultValue props. Textarea elements must be either controlled or uncontrolled (specify either the value prop, or the defaultValue prop, but not both). Decide between using a controlled or uncontrolled textarea and remove one of these props. More info: https://react.dev/link/controlled-components",Me()||"A component"),N_e=!0),w.children!=null&&w.value==null&&console.error("Use the `defaultValue` or `value` props instead of setting children on <textarea>.")}function Xi(S,w,Q){if(w!=null&&(w=""+dn(w),w!==S.value&&(S.value=w),Q==null)){S.defaultValue!==w&&(S.defaultValue=w);return}S.defaultValue=Q!=null?""+dn(Q):""}function Ys(S,w,Q,W){if(w==null){if(W!=null){if(Q!=null)throw Error("If you supply `defaultValue` on a <textarea>, do not pass children.");if(a0(W)){if(1<W.length)throw Error("<textarea> can only have at most one child.");W=W[0]}Q=W}Q==null&&(Q=""),w=Q}Q=dn(w),S.defaultValue=Q,W=S.textContent,W===Q&&W!==""&&W!==null&&(S.value=W),_o(S)}function aa(S,w){return S.serverProps===void 0&&S.serverTail.length===0&&S.children.length===1&&3<S.distanceFromLeaf&&S.distanceFromLeaf>15-w?aa(S.children[0],w):S}function Lo(S){return"  "+"  ".repeat(S)}function Gi(S){return"+ "+"  ".repeat(S)}function bi(S){return"- "+"  ".repeat(S)}function os(S){switch(S.tag){case 26:case 27:case 5:return S.type;case 16:return"Lazy";case 31:return"Activity";case 13:return"Suspense";case 19:return"SuspenseList";case 0:case 15:return S=S.type,S.displayName||S.name||null;case 11:return S=S.type.render,S.displayName||S.name||null;case 1:return S=S.type,S.displayName||S.name||null;default:return null}}function Lc(S,w){return R1.test(S)?(S=JSON.stringify(S),S.length>w-2?8>w?'{"..."}':"{"+S.slice(0,w-7)+'..."}':"{"+S+"}"):S.length>w?5>w?'{"..."}':S.slice(0,w-3)+"...":S}function dl(S,w,Q){var W=120-2*Q;if(w===null)return Gi(Q)+Lc(S,W)+`
`;if(typeof w==="string"){for(var oe=0;oe<w.length&&oe<S.length&&w.charCodeAt(oe)===S.charCodeAt(oe);oe++);return oe>W-8&&10<oe&&(S="..."+S.slice(oe-8),w="..."+w.slice(oe-8)),Gi(Q)+Lc(S,W)+`
`+bi(Q)+Lc(w,W)+`
`}return Lo(Q)+Lc(S,W)+`
`}function Ec(S){return Object.prototype.toString.call(S).replace(/^\[object (.*)\]$/,function(w,Q){return Q})}function _d(S,w){switch(typeof S){case"string":return S=JSON.stringify(S),S.length>w?5>w?'"..."':S.slice(0,w-4)+'..."':S;case"object":if(S===null)return"null";if(a0(S))return"[...]";if(S.$$typeof===n4)return(w=U(S.type))?"<"+w+">":"<...>";var Q=Ec(S);if(Q==="Object"){Q="",w-=2;for(var W in S)if(S.hasOwnProperty(W)){var oe=JSON.stringify(W);if(oe!=='"'+W+'"'&&(W=oe),w-=W.length-2,oe=_d(S[W],15>w?w:15),w-=oe.length,0>w){Q+=Q===""?"...":", ...";break}Q+=(Q===""?"":",")+W+":"+oe}return"{"+Q+"}"}return Q;case"function":return(w=S.displayName||S.name)?"function "+w:"function";default:return String(S)}}function B0(S,w){return typeof S!=="string"||R1.test(S)?"{"+_d(S,w-2)+"}":S.length>w-2?5>w?'"..."':'"'+S.slice(0,w-5)+'..."':'"'+S+'"'}function Jo(S,w,Q){var W=120-Q.length-S.length,oe=[],ae;for(ae in w)if(w.hasOwnProperty(ae)&&ae!=="children"){var De=B0(w[ae],120-Q.length-ae.length-1);W-=ae.length+De.length+2,oe.push(ae+"="+De)}return oe.length===0?Q+"<"+S+`>
`:0<W?Q+"<"+S+" "+oe.join(" ")+`>
`:Q+"<"+S+`
`+Q+"  "+oe.join(`
`+Q+"  ")+`
`+Q+`>
`}function zr(S,w,Q){var W="",oe=ta({},w),ae;for(ae in S)if(S.hasOwnProperty(ae)){delete oe[ae];var De=120-2*Q-ae.length-2,ke=_d(S[ae],De);w.hasOwnProperty(ae)?(De=_d(w[ae],De),W+=Gi(Q)+ae+": "+ke+`
`,W+=bi(Q)+ae+": "+De+`
`):W+=Gi(Q)+ae+": "+ke+`
`}for(var ot in oe)oe.hasOwnProperty(ot)&&(S=_d(oe[ot],120-2*Q-ot.length-2),W+=bi(Q)+ot+": "+S+`
`);return W}function $r(S,w,Q,W){var oe="",ae=new Map;for(_t in Q)Q.hasOwnProperty(_t)&&ae.set(_t.toLowerCase(),_t);if(ae.size===1&&ae.has("children"))oe+=Jo(S,w,Lo(W));else{for(var De in w)if(w.hasOwnProperty(De)&&De!=="children"){var ke=120-2*(W+1)-De.length-1,ot=ae.get(De.toLowerCase());if(ot!==void 0){ae.delete(De.toLowerCase());var _t=w[De];ot=Q[ot];var zt=B0(_t,ke);ke=B0(ot,ke),typeof _t==="object"&&_t!==null&&typeof ot==="object"&&ot!==null&&Ec(_t)==="Object"&&Ec(ot)==="Object"&&(2<Object.keys(_t).length||2<Object.keys(ot).length||-1<zt.indexOf("...")||-1<ke.indexOf("..."))?oe+=Lo(W+1)+De+`={{
`+zr(_t,ot,W+2)+Lo(W+1)+`}}
`:(oe+=Gi(W+1)+De+"="+zt+`
`,oe+=bi(W+1)+De+"="+ke+`
`)}else oe+=Lo(W+1)+De+"="+B0(w[De],ke)+`
`}ae.forEach(function(en){if(en!=="children"){var Zt=120-2*(W+1)-en.length-1;oe+=bi(W+1)+en+"="+B0(Q[en],Zt)+`
`}}),oe=oe===""?Lo(W)+"<"+S+`>
`:Lo(W)+"<"+S+`
`+oe+Lo(W)+`>
`}if(S=Q.children,w=w.children,typeof S==="string"||typeof S==="number"||typeof S==="bigint"){if(ae="",typeof w==="string"||typeof w==="number"||typeof w==="bigint")ae=""+w;oe+=dl(ae,""+S,W+1)}else if(typeof w==="string"||typeof w==="number"||typeof w==="bigint")oe=S==null?oe+dl(""+w,null,W+1):oe+dl(""+w,void 0,W+1);return oe}function Sl(S,w){var Q=os(S);if(Q===null){Q="";for(S=S.child;S;)Q+=Sl(S,w),S=S.sibling;return Q}return Lo(w)+"<"+Q+`>
`}function ul(S,w){var Q=aa(S,w);if(Q!==S&&(S.children.length!==1||S.children[0]!==Q))return Lo(w)+`...
`+ul(Q,w+1);Q="";var W=S.fiber._debugInfo;if(W)for(var oe=0;oe<W.length;oe++){var ae=W[oe].name;typeof ae==="string"&&(Q+=Lo(w)+"<"+ae+`>
`,w++)}if(W="",oe=S.fiber.pendingProps,S.fiber.tag===6)W=dl(oe,S.serverProps,w),w++;else if(ae=os(S.fiber),ae!==null)if(S.serverProps===void 0){W=w;var De=120-2*W-ae.length-2,ke="";for(_t in oe)if(oe.hasOwnProperty(_t)&&_t!=="children"){var ot=B0(oe[_t],15);if(De-=_t.length+ot.length+2,0>De){ke+=" ...";break}ke+=" "+_t+"="+ot}W=Lo(W)+"<"+ae+ke+`>
`,w++}else S.serverProps===null?(W=Jo(ae,oe,Gi(w)),w++):typeof S.serverProps==="string"?console.error("Should not have matched a non HostText fiber to a Text node. This is a bug in React."):(W=$r(ae,oe,S.serverProps,w),w++);var _t="";oe=S.fiber.child;for(ae=0;oe&&ae<S.children.length;)De=S.children[ae],De.fiber===oe?(_t+=ul(De,w),ae++):_t+=Sl(oe,w),oe=oe.sibling;oe&&0<S.children.length&&(_t+=Lo(w)+`...
`),oe=S.serverTail,S.serverProps===null&&w--;for(S=0;S<oe.length;S++)ae=oe[S],_t=typeof ae==="string"?_t+(bi(w)+Lc(ae,120-2*w)+`
`):_t+Jo(ae.type,ae.props,bi(w));return Q+W+_t}function gd(S){try{return`

`+ul(S,0)}catch(w){return""}}function i1(S,w,Q){for(var W=w,oe=null,ae=0;W;)W===S&&(ae=0),oe={fiber:W,children:oe!==null?[oe]:[],serverProps:W===w?Q:W===S?null:void 0,serverTail:[],distanceFromLeaf:ae},ae++,W=W.return;return oe!==null?gd(oe).replaceAll(/^[+-]/gm,">"):""}function Fp(S,w){var Q=ta({},S||$ne),W={tag:w};if(Kne.indexOf(w)!==-1&&(Q.aTagInScope=null,Q.buttonTagInScope=null,Q.nobrTagInScope=null),R_e.indexOf(w)!==-1&&(Q.pTagInButtonScope=null),jD.indexOf(w)!==-1&&w!=="address"&&w!=="div"&&w!=="p"&&(Q.listItemTagAutoclosing=null,Q.dlItemTagAutoclosing=null),Q.current=W,w==="form"&&(Q.formTag=W),w==="a"&&(Q.aTagInScope=W),w==="button"&&(Q.buttonTagInScope=W),w==="nobr"&&(Q.nobrTagInScope=W),w==="p"&&(Q.pTagInButtonScope=W),w==="li"&&(Q.listItemTagAutoclosing=W),w==="dd"||w==="dt")Q.dlItemTagAutoclosing=W;return w==="#document"||w==="html"?Q.containerTagInScope=null:Q.containerTagInScope||(Q.containerTagInScope=W),S!==null||w!=="#document"&&w!=="html"&&w!=="body"?Q.implicitRootScope===!0&&(Q.implicitRootScope=!1):Q.implicitRootScope=!0,Q}function ca(S,w,Q){switch(w){case"tr":return S==="th"||S==="td"||S==="style"||S==="script"||S==="template";case"tbody":case"thead":case"tfoot":return S==="tr"||S==="style"||S==="script"||S==="template";case"colgroup":return S==="col"||S==="template";case"table":return S==="caption"||S==="colgroup"||S==="tbody"||S==="tfoot"||S==="thead"||S==="style"||S==="script"||S==="template";case"head":return S==="base"||S==="basefont"||S==="bgsound"||S==="link"||S==="meta"||S==="title"||S==="noscript"||S==="noframes"||S==="style"||S==="script"||S==="template";case"html":if(Q)break;return S==="head"||S==="body"||S==="frameset";case"frameset":return S==="frame";case"#document":if(!Q)return S==="html"}switch(S){case"h1":case"h2":case"h3":case"h4":case"h5":case"h6":return w!=="h1"&&w!=="h2"&&w!=="h3"&&w!=="h4"&&w!=="h5"&&w!=="h6";case"rp":case"rt":return Q_e.indexOf(w)===-1;case"caption":case"col":case"colgroup":case"input":return w!=="select";case"frameset":case"frame":case"tbody":case"td":case"tfoot":case"th":case"thead":case"tr":return w==null;case"head":return Q||w===null;case"html":return Q&&w==="#document"||w===null;case"body":return Q&&(w==="#document"||w==="html")||w===null}return!0}function n0(S,w){switch(S){case"address":case"article":case"aside":case"blockquote":case"center":case"details":case"dialog":case"dir":case"div":case"dl":case"fieldset":case"figcaption":case"figure":case"footer":case"header":case"hgroup":case"main":case"menu":case"nav":case"ol":case"p":case"section":case"summary":case"ul":case"pre":case"listing":case"table":case"hr":case"xmp":case"h1":case"h2":case"h3":case"h4":case"h5":case"h6":return w.pTagInButtonScope;case"form":return w.formTag||w.pTagInButtonScope;case"li":return w.listItemTagAutoclosing;case"dd":case"dt":return w.dlItemTagAutoclosing;case"button":return w.buttonTagInScope;case"a":return w.aTagInScope;case"nobr":return w.nobrTagInScope}return null}function zp(S,w){for(;S;){switch(S.tag){case 5:case 26:case 27:if(S.type===w)return S}S=S.return}return null}function Yd(S,w){w=w||$ne;var Q=w.current;if(w=(Q=ca(S,Q&&Q.tag,w.implicitRootScope)?null:Q)?null:n0(S,w),w=Q||w,!w)return!0;var W=w.tag;if(w=String(!!Q)+"|"+S+"|"+W,sF[w])return!1;sF[w]=!0;var oe=(w=K_)?zp(w.return,W):null,ae=w!==null&&oe!==null?i1(oe,w,null):"",De="<"+S+">";return Q?(Q="",W==="table"&&S==="tr"&&(Q+=" Add a <tbody>, <thead> or <tfoot> to your code to match the DOM tree generated by the browser."),console.error(`In HTML, %s cannot be a child of <%s>.%s
This will cause a hydration error.%s`,De,W,Q,ae)):console.error(`In HTML, %s cannot be a descendant of <%s>.
This will cause a hydration error.%s`,De,W,ae),w&&(S=w.return,oe===null||S===null||oe===S&&S._debugOwner===w._debugOwner||ye(oe,function(){console.error(`<%s> cannot contain a nested %s.
See this log for the ancestor stack trace.`,W,De)})),!1}function vu(S,w,Q){if(Q||ca("#text",w,!1))return!0;if(Q="#text|"+w,sF[Q])return!1;sF[Q]=!0;var W=(Q=K_)?zp(Q,w):null;return Q=Q!==null&&W!==null?i1(W,Q,Q.tag!==6?{children:null}:null):"",/\S/.test(S)?console.error(`In HTML, text nodes cannot be a child of <%s>.
This will cause a hydration error.%s`,w,Q):console.error(`In HTML, whitespace text nodes cannot be a child of <%s>. Make sure you don't have any extra whitespace between tags on each line of your source code.
This will cause a hydration error.%s`,w,Q),!1}function ji(S,w){if(w){var Q=S.firstChild;if(Q&&Q===S.lastChild&&Q.nodeType===3){Q.nodeValue=w;return}}S.textContent=w}function pl(S){return S.replace(H_e,function(w,Q){return Q.toUpperCase()})}function Zs(S,w,Q){var W=w.indexOf("--")===0;W||(-1<w.indexOf("-")?XE.hasOwnProperty(w)&&XE[w]||(XE[w]=!0,console.error("Unsupported style property %s. Did you mean %s?",w,pl(w.replace(L_e,"ms-")))):k_e.test(w)?XE.hasOwnProperty(w)&&XE[w]||(XE[w]=!0,console.error("Unsupported vendor-prefixed style property %s. Did you mean %s?",w,w.charAt(0).toUpperCase()+w.slice(1))):!Zne.test(Q)||R.hasOwnProperty(Q)&&R[Q]||(R[Q]=!0,console.error(`Style property values shouldn't contain a semicolon. Try "%s: %s" instead.`,w,Q.replace(Zne,""))),typeof Q==="number"&&(isNaN(Q)?z||(z=!0,console.error("`NaN` is an invalid value for the `%s` css style property.",w)):isFinite(Q)||q||(q=!0,console.error("`Infinity` is an invalid value for the `%s` css style property.",w)))),Q==null||typeof Q==="boolean"||Q===""?W?S.setProperty(w,""):w==="float"?S.cssFloat="":S[w]="":W?S.setProperty(w,Q):typeof Q!=="number"||Q===0||pe.has(w)?w==="float"?S.cssFloat=Q:(rt(Q,w),S[w]=(""+Q).trim()):S[w]=Q+"px"}function Cc(S,w,Q){if(w!=null&&typeof w!=="object")throw Error("The `style` prop expects a mapping from style properties to values, not a string. For example, style={{marginRight: spacing + 'em'}} when using JSX.");if(w&&Object.freeze(w),S=S.style,Q!=null){if(w){var W={};if(Q){for(var oe in Q)if(Q.hasOwnProperty(oe)&&!w.hasOwnProperty(oe))for(var ae=mW[oe]||[oe],De=0;De<ae.length;De++)W[ae[De]]=oe}for(var ke in w)if(w.hasOwnProperty(ke)&&(!Q||Q[ke]!==w[ke]))for(oe=mW[ke]||[ke],ae=0;ae<oe.length;ae++)W[oe[ae]]=ke;ke={};for(var ot in w)for(oe=mW[ot]||[ot],ae=0;ae<oe.length;ae++)ke[oe[ae]]=ot;ot={};for(var _t in W)if(oe=W[_t],(ae=ke[_t])&&oe!==ae&&(De=oe+","+ae,!ot[De])){ot[De]=!0,De=console;var zt=w[oe];De.error.call(De,"%s a style property during rerender (%s) when a conflicting property is set (%s) can lead to styling bugs. To avoid this, don't mix shorthand and non-shorthand properties for the same value; instead, replace the shorthand with separate values.",zt==null||typeof zt==="boolean"||zt===""?"Removing":"Updating",oe,ae)}}for(var en in Q)!Q.hasOwnProperty(en)||w!=null&&w.hasOwnProperty(en)||(en.indexOf("--")===0?S.setProperty(en,""):en==="float"?S.cssFloat="":S[en]="",Nc=!0);for(var Zt in w)_t=w[Zt],w.hasOwnProperty(Zt)&&Q[Zt]!==_t&&(Zs(S,Zt,_t),Nc=!0)}else for(W in w)w.hasOwnProperty(W)&&Zs(S,W,w[W])}function ea(S){if(S.indexOf("-")===-1)return!1;switch(S){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}function Zr(S){return ht.get(S)||S}function Ya(S,w){if(_2.call(Kn,w)&&Kn[w])return!0;if(jo.test(w)){if(S="aria-"+w.slice(4).toLowerCase(),S=Cn.hasOwnProperty(S)?S:null,S==null)return console.error("Invalid ARIA attribute `%s`. ARIA attributes follow the pattern aria-* and must be lowercase.",w),Kn[w]=!0;if(w!==S)return console.error("Invalid ARIA attribute `%s`. Did you mean `%s`?",w,S),Kn[w]=!0}if(Vo.test(w)){if(S=w.toLowerCase(),S=Cn.hasOwnProperty(S)?S:null,S==null)return Kn[w]=!0,!1;w!==S&&(console.error("Unknown ARIA attribute `%s`. Did you mean `%s`?",w,S),Kn[w]=!0)}return!0}function sh(S,w){var Q=[],W;for(W in w)Ya(S,W)||Q.push(W);w=Q.map(function(oe){return"`"+oe+"`"}).join(", "),Q.length===1?console.error("Invalid aria prop %s on <%s> tag. For details, see https://react.dev/link/invalid-aria-props",w,S):1<Q.length&&console.error("Invalid aria props %s on <%s> tag. For details, see https://react.dev/link/invalid-aria-props",w,S)}function vs(S,w,Q,W){if(_2.call($i,w)&&$i[w])return!0;var oe=w.toLowerCase();if(oe==="onfocusin"||oe==="onfocusout")return console.error("React uses onFocus and onBlur instead of onFocusIn and onFocusOut. All React events are normalized to bubble, so onFocusIn and onFocusOut are not needed/supported by React."),$i[w]=!0;if(typeof Q==="function"&&(S==="form"&&w==="action"||S==="input"&&w==="formAction"||S==="button"&&w==="formAction"))return!0;if(W!=null){if(S=W.possibleRegistrationNames,W.registrationNameDependencies.hasOwnProperty(w))return!0;if(W=S.hasOwnProperty(oe)?S[oe]:null,W!=null)return console.error("Invalid event handler property `%s`. Did you mean `%s`?",w,W),$i[w]=!0;if(Zc.test(w))return console.error("Unknown event handler property `%s`. It will be ignored.",w),$i[w]=!0}else if(Zc.test(w))return KD.test(w)&&console.error("Invalid event handler property `%s`. React events use the camelCase naming convention, for example `onClick`.",w),$i[w]=!0;if($D.test(w)||s4.test(w))return!0;if(oe==="innerhtml")return console.error("Directly setting property `innerHTML` is not permitted. For more information, lookup documentation on `dangerouslySetInnerHTML`."),$i[w]=!0;if(oe==="aria")return console.error("The `aria` attribute is reserved for future use in React. Pass individual `aria-` attributes instead."),$i[w]=!0;if(oe==="is"&&Q!==null&&Q!==void 0&&typeof Q!=="string")return console.error("Received a `%s` for a string attribute `is`. If this is expected, cast the value to a string.",typeof Q),$i[w]=!0;if(typeof Q==="number"&&isNaN(Q))return console.error("Received NaN for the `%s` attribute. If this is expected, cast the value to a string.",w),$i[w]=!0;if(Et.hasOwnProperty(oe)){if(oe=Et[oe],oe!==w)return console.error("Invalid DOM property `%s`. Did you mean `%s`?",w,oe),$i[w]=!0}else if(w!==oe)return console.error("React does not recognize the `%s` prop on a DOM element. If you intentionally want it to appear in the DOM as a custom attribute, spell it as lowercase `%s` instead. If you accidentally passed it from a parent component, remove it from the DOM element.",w,oe),$i[w]=!0;switch(w){case"dangerouslySetInnerHTML":case"children":case"style":case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":return!0;case"innerText":case"textContent":return!0}switch(typeof Q){case"boolean":switch(w){case"autoFocus":case"checked":case"multiple":case"muted":case"selected":case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"credentialless":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":case"capture":case"download":case"inert":return!0;default:if(oe=w.toLowerCase().slice(0,5),oe==="data-"||oe==="aria-")return!0;return Q?console.error('Received `%s` for a non-boolean attribute `%s`.\n\nIf you want to write it to the DOM, pass a string instead: %s="%s" or %s={value.toString()}.',Q,w,w,Q,w):console.error('Received `%s` for a non-boolean attribute `%s`.\n\nIf you want to write it to the DOM, pass a string instead: %s="%s" or %s={value.toString()}.\n\nIf you used to conditionally omit it with %s={condition && value}, pass %s={condition ? value : undefined} instead.',Q,w,w,Q,w,w,w),$i[w]=!0}case"function":case"symbol":return $i[w]=!0,!1;case"string":if(Q==="false"||Q==="true"){switch(w){case"checked":case"selected":case"multiple":case"muted":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"credentialless":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":case"inert":break;default:return!0}console.error("Received the string `%s` for the boolean attribute `%s`. %s Did you mean %s={%s}?",Q,w,Q==="false"?"The browser will interpret it as a truthy value.":'Although this works, it will not work as expected if you pass the string "false".',w,Q),$i[w]=!0}}return!0}function Ad(S,w,Q){var W=[],oe;for(oe in w)vs(S,oe,w[oe],Q)||W.push(oe);w=W.map(function(ae){return"`"+ae+"`"}).join(", "),W.length===1?console.error("Invalid value for prop %s on <%s> tag. Either remove it from the element, or pass a string or number value to keep it in the DOM. For details, see https://react.dev/link/attribute-behavior ",w,S):1<W.length&&console.error("Invalid values for props %s on <%s> tag. Either remove them from the element, or pass a string or number value to keep them in the DOM. For details, see https://react.dev/link/attribute-behavior ",w,S)}function ah(S){return on.test(""+S)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":S}function fd(){}function Rg(S){return S=S.target||S.srcElement||window,S.correspondingUseElement&&(S=S.correspondingUseElement),S.nodeType===3?S.parentNode:S}function Su(S){var w=_n(S);if(w&&(S=w.stateNode)){var Q=S[Kg]||null;e:switch(S=w.stateNode,w.type){case"input":if(To(S,Q.value,Q.defaultValue,Q.defaultValue,Q.checked,Q.defaultChecked,Q.type,Q.name),w=Q.name,Q.type==="radio"&&w!=null){for(Q=S;Q.parentNode;)Q=Q.parentNode;dt(w,"name"),Q=Q.querySelectorAll('input[name="'+qn(""+w)+'"][type="radio"]');for(w=0;w<Q.length;w++){var W=Q[w];if(W!==S&&W.form===S.form){var oe=W[Kg]||null;if(!oe)throw Error("ReactDOMInput: Mixing React and non-React radio inputs with the same `name` is not supported.");To(W,oe.value,oe.defaultValue,oe.defaultValue,oe.checked,oe.defaultChecked,oe.type,oe.name)}}for(w=0;w<Q.length;w++)W=Q[w],W.form===S.form&&$n(W)}break e;case"textarea":Xi(S,Q.value,Q.defaultValue);break e;case"select":w=Q.value,w!=null&&Ro(S,!!Q.multiple,w,!1)}}}function s1(S,w,Q){if(wr)return S(w,Q);wr=!0;try{var W=S(w);return W}finally{if(wr=!1,An!==null||io!==null){if(W6(),An&&(w=An,S=io,io=An=null,Su(w),S))for(w=0;w<S.length;w++)Su(S[w])}}}function KA(S,w){var Q=S.stateNode;if(Q===null)return null;var W=Q[Kg]||null;if(W===null)return null;Q=W[w];e:switch(w){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(W=!W.disabled)||(S=S.type,W=!(S==="button"||S==="input"||S==="select"||S==="textarea")),S=!W;break e;default:S=!1}if(S)return null;if(Q&&typeof Q!=="function")throw Error("Expected `"+w+"` listener to be a function, instead got a value of `"+typeof Q+"` type.");return Q}function T0(){if(Zd)return Zd;var S,w=mh,Q=w.length,W,oe="value"in Ji?Ji.value:Ji.textContent,ae=oe.length;for(S=0;S<Q&&w[S]===oe[S];S++);var De=Q-S;for(W=1;W<=De&&w[Q-W]===oe[ae-W];W++);return Zd=oe.slice(S,1<W?1-W:void 0)}function Q_(S){var w=S.keyCode;return"charCode"in S?(S=S.charCode,S===0&&w===13&&(S=13)):S=w,S===10&&(S=13),32<=S||S===13?S:0}function Gd(){return!0}function Dm(){return!1}function Ph(S){function w(Q,W,oe,ae,De){this._reactName=Q,this._targetInst=oe,this.type=W,this.nativeEvent=ae,this.target=De,this.currentTarget=null;for(var ke in S)S.hasOwnProperty(ke)&&(Q=S[ke],this[ke]=Q?Q(ae):ae[ke]);return this.isDefaultPrevented=(ae.defaultPrevented!=null?ae.defaultPrevented:ae.returnValue===!1)?Gd:Dm,this.isPropagationStopped=Dm,this}return ta(w.prototype,{preventDefault:function(){this.defaultPrevented=!0;var Q=this.nativeEvent;Q&&(Q.preventDefault?Q.preventDefault():typeof Q.returnValue!=="unknown"&&(Q.returnValue=!1),this.isDefaultPrevented=Gd)},stopPropagation:function(){var Q=this.nativeEvent;Q&&(Q.stopPropagation?Q.stopPropagation():typeof Q.cancelBubble!=="unknown"&&(Q.cancelBubble=!0),this.isPropagationStopped=Gd)},persist:function(){},isPersistent:Gd}),w}function Yy(S){var w=this.nativeEvent;return w.getModifierState?w.getModifierState(S):(S=WAo[S])?!!w[S]:!1}function Nm(){return Yy}function $f(S,w){switch(S){case"keyup":return sfo.indexOf(w.keyCode)!==-1;case"keydown":return w.keyCode!==aft;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function a1(S){return S=S.detail,typeof S==="object"&&"data"in S?S.data:null}function u6(S,w){switch(S){case"compositionend":return a1(w);case"keypress":if(w.which!==lft)return null;return dft=!0,hft;case"textInput":return S=w.data,S===hft&&dft?null:S;default:return null}}function o0(S,w){if(gW)return S==="compositionend"||!fTe&&$f(S,w)?(S=T0(),Zd=mh=Ji=null,gW=!1,S):null;switch(S){case"paste":return null;case"keypress":if(!(w.ctrlKey||w.altKey||w.metaKey)||w.ctrlKey&&w.altKey){if(w.char&&1<w.char.length)return w.char;if(w.which)return String.fromCharCode(w.which)}return null;case"compositionend":return cft&&w.locale!=="ko"?null:w.data;default:return null}}function p6(S){var w=S&&S.nodeName&&S.nodeName.toLowerCase();return w==="input"?!!cfo[S.type]:w==="textarea"?!0:!1}function c1(S){if(!js)return!1;S="on"+S;var w=S in document;return w||(w=document.createElement("div"),w.setAttribute(S,"return;"),w=typeof w[S]==="function"),w}function yd(S,w,Q,W){An?io?io.push(W):io=[W]:An=W,w=dC(w,"onChange"),0<w.length&&(Q=new _W("onChange","change",null,Q,W),S.push({event:Q,listeners:w}))}function Rs(S){U_(S,0)}function So(S){var w=En(S);if($n(w))return S}function Gh(S,w){if(S==="change")return w}function Hc(){ooe&&(ooe.detachEvent("onpropertychange",ua),roe=ooe=null)}function ua(S){if(S.propertyName==="value"&&So(roe)){var w=[];yd(w,roe,S,Rg(S)),s1(Rs,w)}}function Qg(S,w,Q){S==="focusin"?(Hc(),ooe=w,roe=Q,ooe.attachEvent("onpropertychange",ua)):S==="focusout"&&Hc()}function L3(S){if(S==="selectionchange"||S==="keyup"||S==="keydown")return So(roe)}function vT(S,w){if(S==="click")return So(w)}function H3(S,w){if(S==="input"||S==="change")return So(w)}function nH(S,w){return S===w&&(S!==0||1/S===1/w)||S!==S&&w!==w}function M5(S,w){if(Q1(S,w))return!0;if(typeof S!=="object"||S===null||typeof w!=="object"||w===null)return!1;var Q=Object.keys(S),W=Object.keys(w);if(Q.length!==W.length)return!1;for(W=0;W<Q.length;W++){var oe=Q[W];if(!_2.call(w,oe)||!Q1(S[oe],w[oe]))return!1}return!0}function w5(S){if(S=S||(typeof document<"u"?document:void 0),typeof S>"u")return null;try{return S.activeElement||S.body}catch(w){return S.body}}function xv(S){for(;S&&S.firstChild;)S=S.firstChild;return S}function Pu(S,w){var Q=xv(S);S=0;for(var W;Q;){if(Q.nodeType===3){if(W=S+Q.textContent.length,S<=w&&W>=w)return{node:Q,offset:w-S};S=W}e:{for(;Q;){if(Q.nextSibling){Q=Q.nextSibling;break e}Q=Q.parentNode}Q=void 0}Q=xv(Q)}}function Mc(S,w){return S&&w?S===w?!0:S&&S.nodeType===3?!1:w&&w.nodeType===3?Mc(S,w.parentNode):("contains"in S)?S.contains(w):S.compareDocumentPosition?!!(S.compareDocumentPosition(w)&16):!1:!1}function Cv(S){S=S!=null&&S.ownerDocument!=null&&S.ownerDocument.defaultView!=null?S.ownerDocument.defaultView:window;for(var w=w5(S.document);w instanceof S.HTMLIFrameElement;){try{var Q=typeof w.contentWindow.location.href==="string"}catch(W){Q=!1}if(Q)S=w.contentWindow;else break;w=w5(S.document)}return w}function k_(S){var w=S&&S.nodeName&&S.nodeName.toLowerCase();return w&&(w==="input"&&(S.type==="text"||S.type==="search"||S.type==="tel"||S.type==="url"||S.type==="password")||w==="textarea"||S.contentEditable==="true")}function l1(S,w,Q){var W=Q.window===Q?Q.document:Q.nodeType===9?Q:Q.ownerDocument;xTe||AW==null||AW!==w5(W)||(W=AW,("selectionStart"in W)&&k_(W)?W={start:W.selectionStart,end:W.selectionEnd}:(W=(W.ownerDocument&&W.ownerDocument.defaultView||window).getSelection(),W={anchorNode:W.anchorNode,anchorOffset:W.anchorOffset,focusNode:W.focusNode,focusOffset:W.focusOffset}),ioe&&M5(ioe,W)||(ioe=W,W=dC(yTe,"onSelect"),0<W.length&&(w=new _W("onSelect","select",null,w,Q),S.push({event:w,listeners:W}),w.target=AW)))}function Op(S,w){var Q={};return Q[S.toLowerCase()]=w.toLowerCase(),Q["Webkit"+S]="webkit"+w,Q["Moz"+S]="moz"+w,Q}function D0(S){if(CTe[S])return CTe[S];if(!fW[S])return S;var w=fW[S],Q;for(Q in w)if(w.hasOwnProperty(Q)&&Q in pft)return CTe[S]=w[Q];return S}function Vp(S,w){fft.set(S,w),Zn(w,[S])}function Yp(S,w){if(S.name!=null&&S.name!=="auto")return S.name;if(w.autoName!==null)return w.autoName;S=SI.identifierPrefix;var Q=pfo++;return S="_"+S+"t_"+Q.toString(32)+"_",w.autoName=S}function bv(S){if(S==null||typeof S==="string")return S;var w=null,Q=FW;if(Q!==null)for(var W=0;W<Q.length;W++){var oe=S[Q[W]];if(oe!=null){if(oe==="none")return"none";w=w==null?oe:w+(" "+oe)}}return w==null?S.default:w}function Rm(S,w){return S=bv(S),w=bv(w),w==null?S==="auto"?null:S:w==="auto"?null:w}function JP(S){for(var w=z_e,Q=0;Q<S.length&&Q<PC;Q++){var W=S[Q];if(typeof W==="object"&&W!==null)if(a0(W)&&W.length===2&&typeof W[0]==="string"){if(w!==z_e&&w!==PTe)return vTe;w=PTe}else return vTe;else{if(typeof W==="function"||typeof W==="string"&&50<W.length||w!==z_e&&w!==STe||typeof W==="bigint")return vTe;w=STe}}return w}function r0(S,w,Q,W){if(!ArrayBuffer.isView(S)){var oe=0,ae;for(ae in S)if(_2.call(S,ae)&&ae[0]!=="_"&&(oe++,ap(ae,S[ae],w,Q,W),oe>=PC)){w.push([W+"  ".repeat(Q)+"Only "+PC+" properties are shown. React will not log more properties of this object.",""]);break}}}function $A(S){return"$$typeof"in S&&_2.call(S,"$$typeof")?S.$$typeof:void 0}function ap(S,w,Q,W,oe){switch(typeof w){case"object":if(w===null){w="null";break}else{if($A(w)===n4){var ae=U(w.type)||"…",De=w.key;w=w.props;var ke=Object.keys(w),ot=ke.length;if(De==null&&ot===0){w="<"+ae+" />";break}if(3>W||ot===1&&ke[0]==="children"&&De==null){w="<"+ae+" … />";break}Q.push([oe+"  ".repeat(W)+S,"<"+ae]),De!==null&&ap("key",De,Q,W+1,oe),S=!1,De=0;for(var _t in w)if(De++,_t==="children"?w.children!=null&&(!a0(w.children)||0<w.children.length)&&(S=!0):_2.call(w,_t)&&_t[0]!=="_"&&ap(_t,w[_t],Q,W+1,oe),De>=PC)break;Q.push(["",S?">…</"+ae+">":"/>"]);return}if(ae=Object.prototype.toString.call(w),ae=ae.slice(8,ae.length-1),ArrayBuffer.isView(w)){w=w.length,w=typeof w==="number"?ae+"("+w+")":ae;break}if(ae==="Array"){if(_t=w.length>PC,De=JP(w),De===STe||De===z_e){w=JSON.stringify(_t?w.slice(0,PC).concat("…"):w);break}else if(De===PTe){Q.push([oe+"  ".repeat(W)+S,""]);for(S=0;S<w.length&&S<PC;S++)ae=w[S],ap(ae[0],ae[1],Q,W+1,oe);_t&&ap(PC.toString(),"…",Q,W+1,oe);return}}if(ae==="Promise"){if(w.status==="fulfilled"){if(ae=Q.length,ap(S,w.value,Q,W,oe),Q.length>ae){Q=Q[ae],Q[1]="Promise<"+(Q[1]||"Object")+">";return}}else if(w.status==="rejected"&&(ae=Q.length,ap(S,w.reason,Q,W,oe),Q.length>ae)){Q=Q[ae],Q[1]="Rejected Promise<"+Q[1]+">";return}Q.push(["  ".repeat(W)+S,"Promise"]);return}ae==="Object"&&(_t=Object.getPrototypeOf(w))&&typeof _t.constructor==="function"&&(ae=_t.constructor.name),Q.push([oe+"  ".repeat(W)+S,ae==="Object"?3>W?"":"…":ae]),3>W&&r0(w,Q,W+1,oe);return}case"function":w=w.name,w=w===""||typeof w!=="string"?"() => {}":w+"() {}";break;case"string":w=w===gfo?"…":JSON.stringify(1024<=w.length?w.slice(0,1023)+"…":w);break;case"undefined":w="undefined";break;case"boolean":w=w?"true":"false";break;default:w=String(w)}Q.push([oe+"  ".repeat(W)+S,w])}function m6(S,w,Q,W){var oe=!0,ae=0;for(ke in S){if(ae>PC){Q.push(["Previous object has more than "+PC+" properties. React will not attempt to diff objects with too many properties.",""]),oe=!1;break}ke in w||(Q.push([O_e+"  ".repeat(W)+ke,"…"]),oe=!1),ae++}ae=0;for(var De in w){if(ae>PC){Q.push(["Next object has more than "+PC+" properties. React will not attempt to diff objects with too many properties.",""]),oe=!1;break}if(De in S){var ke=S[De],ot=w[De];if(ke!==ot){if(W===0&&De==="children"){oe="  ".repeat(W)+De,Q.push([O_e+oe,"…"],[V_e+oe,"…"]),oe=!1;continue}if(!(3<=W)){if(typeof ke==="object"&&typeof ot==="object"&&ke!==null&&ot!==null&&$A(ke)===$A(ot))if($A(ot)===n4){if(ke.type===ot.type&&ke.key===ot.key){ke=U(ot.type)||"…",oe="  ".repeat(W)+De,ke="<"+ke+" … />",Q.push([O_e+oe,ke],[V_e+oe,ke]),oe=!1;continue}}else{var _t=Object.prototype.toString.call(ke),zt=Object.prototype.toString.call(ot);if(_t===zt&&(zt==="[object Object]"||zt==="[object Array]")){_t=[Cft+"  ".repeat(W)+De,zt==="[object Array]"?"Array":""],Q.push(_t),zt=Q.length,m6(ke,ot,Q,W+1)?zt===Q.length&&(_t[1]="Referentially unequal but deeply equal objects. Consider memoization."):oe=!1;continue}}else if(typeof ke==="function"&&typeof ot==="function"&&ke.name===ot.name&&ke.length===ot.length&&(_t=Function.prototype.toString.call(ke),zt=Function.prototype.toString.call(ot),_t===zt)){ke=ot.name===""?"() => {}":ot.name+"() {}",Q.push([Cft+"  ".repeat(W)+De,ke+" Referentially unequal function closure. Consider memoization."]);continue}}ap(De,ke,Q,W,O_e),ap(De,ot,Q,W,V_e),oe=!1}}else Q.push([V_e+"  ".repeat(W)+De,"…"]),oe=!1;ae++}return oe}function Ol(S){ec=S&63?"Blocking":S&64?"Gesture":S&4194176?"Transition":S&62914560?"Suspense":S&2080374784?"Idle":"Other"}function qA(S,w,Q,W){eu&&(JD.start=w,JD.end=Q,jE.color="warning",jE.tooltipText=W,jE.properties=null,(S=S._debugTask)?S.run(performance.measure.bind(performance,W,JD)):performance.measure(W,JD),performance.clearMeasures(W))}function F3(S,w,Q){qA(S,w,Q,"Reconnect")}function h1(S,w,Q,W,oe){var ae=Y(S);if(ae!==null&&eu){var De=S.alternate,ke=S.actualDuration;if(De===null||De.child!==S.child)for(var ot=S.child;ot!==null;ot=ot.sibling)ke-=ot.actualDuration;ke=0.5>ke?W?"tertiary-light":"primary-light":10>ke?W?"tertiary":"primary":100>ke?W?"tertiary-dark":"primary-dark":"error";var _t=S.memoizedProps;W=S._debugTask,_t!==null&&De!==null&&De.memoizedProps!==_t?(ot=[Afo],_t=m6(De.memoizedProps,_t,ot,0),1<ot.length?(_t&&!qD&&(De.lanes&oe)===0&&100<S.actualDuration?(qD=!0,ot[0]=ffo,jE.color="warning",jE.tooltipText=bft):(jE.color=ke,jE.tooltipText=ae),jE.properties=ot,JD.start=w,JD.end=Q,S="​"+ae,W!=null?W.run(performance.measure.bind(performance,S,JD)):performance.measure(S,JD),performance.clearMeasures(S)):W!=null?W.run(console.timeStamp.bind(console,ae,w,Q,sx,void 0,ke)):console.timeStamp(ae,w,Q,sx,void 0,ke)):W!=null?W.run(console.timeStamp.bind(console,ae,w,Q,sx,void 0,ke)):console.timeStamp(ae,w,Q,sx,void 0,ke)}}function d1(S,w,Q,W){if(eu){var oe=Y(S);if(oe!==null){for(var ae=null,De=[],ke=0;ke<W.length;ke++){var ot=W[ke];ae==null&&ot.source!==null&&(ae=ot.source._debugTask),ot=ot.value,De.push(["Error",typeof ot==="object"&&ot!==null&&typeof ot.message==="string"?String(ot.message):String(ot)])}S.key!==null&&ap("key",S.key,De,0,""),S.memoizedProps!==null&&r0(S.memoizedProps,De,0,""),ae==null&&(ae=S._debugTask),S={start:w,end:Q,detail:{devtools:{color:"error",track:sx,tooltipText:S.tag===13?"Hydration failed":"Error boundary caught an error",properties:De}}},oe="​"+oe,ae?ae.run(performance.measure.bind(performance,oe,S)):performance.measure(oe,S),performance.clearMeasures(oe)}}}function Eu(S,w,Q,W,oe){if(oe!==null){if(eu){var ae=Y(S);if(ae!==null){W=[];for(var De=0;De<oe.length;De++){var ke=oe[De].value;W.push(["Error",typeof ke==="object"&&ke!==null&&typeof ke.message==="string"?String(ke.message):String(ke)])}S.key!==null&&ap("key",S.key,W,0,""),S.memoizedProps!==null&&r0(S.memoizedProps,W,0,""),w={start:w,end:Q,detail:{devtools:{color:"error",track:sx,tooltipText:"A lifecycle or effect errored",properties:W}}},S=S._debugTask,Q="​"+ae,S?S.run(performance.measure.bind(performance,Q,w)):performance.measure(Q,w),performance.clearMeasures(Q)}}}else ae=Y(S),ae!==null&&eu&&(oe=1>W?"secondary-light":100>W?"secondary":500>W?"secondary-dark":"error",(S=S._debugTask)?S.run(console.timeStamp.bind(console,ae,w,Q,sx,void 0,oe)):console.timeStamp(ae,w,Q,sx,void 0,oe))}function ZP(S,w,Q,W){!eu||w<=S||(Q=(Q&738197653)===Q?"tertiary-dark":"primary-dark",W?W.run(console.timeStamp.bind(console,"Prewarm",S,w,ec,Ga,Q)):console.timeStamp("Prewarm",S,w,ec,Ga,Q))}function B5(S,w,Q,W){!eu||w<=S||(Q=(Q&738197653)===Q?"tertiary-dark":"primary-dark",W?W.run(console.timeStamp.bind(console,"Suspended",S,w,ec,Ga,Q)):console.timeStamp("Suspended",S,w,ec,Ga,Q))}function eE(S,w,Q,W){!eu||w<=S||(W?W.run(console.timeStamp.bind(console,"Errored",S,w,ec,Ga,"error")):console.timeStamp("Errored",S,w,ec,Ga,"error"))}function T5(S,w,Q,W){!eu||w<=S||(W?W.run(console.timeStamp.bind(console,Q,S,w,ec,Ga,"secondary-light")):console.timeStamp(Q,S,w,ec,Ga,"secondary-light"))}function qe(S,w,Q,W,oe){if(eu&&!(w<=S)){for(var ae=[],De=0;De<Q.length;De++){var ke=Q[De].value;ae.push(["Error",typeof ke==="object"&&ke!==null&&typeof ke.message==="string"?String(ke.message):String(ke)])}S={start:S,end:w,detail:{devtools:{color:"error",track:ec,trackGroup:Ga,tooltipText:W?"Remaining Effects Errored":"Commit Errored",properties:ae}}},oe?oe.run(performance.measure.bind(performance,"Errored",S)):performance.measure("Errored",S),performance.clearMeasures("Errored")}}function at(S,w,Q,W,oe){Q!==null?qe(S,w,Q,!1,oe):!eu||w<=S||(oe?oe.run(console.timeStamp.bind(console,W?"Commit Interrupted View Transition":"Commit",S,w,ec,Ga,W?"error":"secondary-dark")):console.timeStamp(W?"Commit Interrupted View Transition":"Commit",S,w,ec,Ga,W?"error":"secondary-dark"))}function Tt(S,w,Q){!eu||w<=S||(Q?Q.run(console.timeStamp.bind(console,"Animating",S,w,ec,Ga,"secondary-dark")):console.timeStamp("Animating",S,w,ec,Ga,"secondary-dark"))}function Jt(){for(var S=yW,w=ETe=yW=0;w<S;){var Q=EC[w];EC[w++]=null;var W=EC[w];EC[w++]=null;var oe=EC[w];EC[w++]=null;var ae=EC[w];if(EC[w++]=null,W!==null&&oe!==null){var De=W.pending;De===null?oe.next=oe:(oe.next=De.next,De.next=oe),W.pending=oe}ae!==0&&ao(Q,oe,ae)}}function yn(S,w,Q,W){EC[yW++]=S,EC[yW++]=w,EC[yW++]=Q,EC[yW++]=W,ETe|=W,S.lanes|=W,S=S.alternate,S!==null&&(S.lanes|=W)}function Pn(S,w,Q,W){return yn(S,w,Q,W),wo(S)}function Nn(S,w){return yn(S,null,null,w),wo(S)}function ao(S,w,Q){S.lanes|=Q;var W=S.alternate;W!==null&&(W.lanes|=Q);for(var oe=!1,ae=S.return;ae!==null;)ae.childLanes|=Q,W=ae.alternate,W!==null&&(W.childLanes|=Q),ae.tag===22&&(S=ae.stateNode,S===null||S._visibility&soe||(oe=!0)),S=ae,ae=ae.return;return S.tag===3?(ae=S.stateNode,oe&&w!==null&&(oe=31-Wl(Q),S=ae.hiddenUpdates,W=S[oe],W===null?S[oe]=[w]:W.push(w),w.lane=Q|536870912),ae):null}function wo(S){if(Loe>Nfo)throw vF=Loe=0,Hoe=Cge=null,Error("Maximum update depth exceeded. This can happen when a component repeatedly calls setState inside componentWillUpdate or componentDidUpdate. React limits the number of nested updates to prevent infinite loops.");vF>Rfo&&(vF=0,Hoe=null,console.error("Maximum update depth exceeded. This can happen when a component calls setState inside useEffect, but useEffect either doesn't have a dependency array, or one of the dependencies changes on every render.")),S.alternate===null&&(S.flags&4098)!==0&&jh(S);for(var w=S,Q=w.return;Q!==null;)w.alternate===null&&(w.flags&4098)!==0&&jh(S),w=Q,Q=w.return;return w.tag===3?w.stateNode:null}function $o(S){if($E===null)return S;var w=$E(S);return w===void 0?S:w.current}function Mr(S,w){if($E===null)return!1;var Q=$E,W=S.elementType;w=w.type;var oe=!1,ae=typeof w==="object"&&w!==null?w.$$typeof:null;switch(S.tag){case 1:typeof w==="function"&&(oe=!0);break;case 0:typeof w==="function"?oe=!0:ae===nm&&(oe=!0);break;case 11:ae===YD?oe=!0:ae===nm&&(oe=!0);break;case 14:case 15:ae===uI?oe=!0:ae===nm&&(oe=!0);break;default:return!1}return oe&&(S=Q(W),S!==void 0&&S===Q(w))?!0:!1}function Gs(S){$E!==null&&typeof WeakSet==="function"&&(xW===null&&(xW=new WeakSet),xW.add(S))}function pa(S,w,Q){do{var W=S,oe=W.alternate,ae=W.child,De=W.sibling,ke=W.tag,ot=W.type,_t=W.elementType,zt=null;switch(W=null,ke){case 0:case 1:zt=ot;break;case 15:zt=ot,W=_t;break;case 14:W=_t;break;case 11:zt=ot.render,W=_t}if($E===null)throw Error("Expected resolveFamily to be set during hot reload.");var en=$E;if(ot=_t=!1,zt!==null&&(zt=en(zt),zt!==void 0&&(Q.has(zt)?ot=!0:w.has(zt)&&(ke===1?ot=!0:_t=!0))),ot||W===null||(ke=en(W),ke!==void 0&&Q.has(ke)?ot=!0:typeof W==="object"&&W.$$typeof===nm&&(ke=W._payload,ke._status===1&&(ke=en(ke._result.default),ke!==void 0&&Q.has(ke)&&(ot=!0)))),xW!==null&&(xW.has(S)||oe!==null&&xW.has(oe))&&(ot=!0),ot&&(S._debugNeedsRemount=!0),ot||_t)oe=Nn(S,2),oe!==null&&Id(oe,S,2);if(ae===null||ot||pa(ae,w,Q),De===null)break;S=De}while(1)}function Qs(S,w,Q,W){this.tag=S,this.key=Q,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=w,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=W,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null,this.actualDuration=-0,this.actualStartTime=-1.1,this.treeBaseDuration=this.selfBaseDuration=-0,this._debugTask=this._debugStack=this._debugOwner=this._debugInfo=null,this._debugNeedsRemount=!1,this._debugHookTypes=null,vft||typeof Object.preventExtensions!=="function"||Object.preventExtensions(this)}function Us(S){return S=S.prototype,!(!S||!S.isReactComponent)}function sc(S,w){var Q=S.alternate;switch(Q===null?(Q=u(S.tag,w,S.key,S.mode),Q.elementType=S.elementType,Q.type=S.type,Q.stateNode=S.stateNode,Q._debugOwner=S._debugOwner,Q._debugStack=S._debugStack,Q._debugTask=S._debugTask,Q._debugHookTypes=S._debugHookTypes,Q.alternate=S,S.alternate=Q):(Q.pendingProps=w,Q.type=S.type,Q.flags=0,Q.subtreeFlags=0,Q.deletions=null,Q.actualDuration=-0,Q.actualStartTime=-1.1),Q.flags=S.flags&1206910976,Q.childLanes=S.childLanes,Q.lanes=S.lanes,Q.child=S.child,Q.memoizedProps=S.memoizedProps,Q.memoizedState=S.memoizedState,Q.updateQueue=S.updateQueue,w=S.dependencies,Q.dependencies=w===null?null:{lanes:w.lanes,firstContext:w.firstContext,_debugThenableState:w._debugThenableState},Q.sibling=S.sibling,Q.index=S.index,Q.ref=S.ref,Q.refCleanup=S.refCleanup,Q.selfBaseDuration=S.selfBaseDuration,Q.treeBaseDuration=S.treeBaseDuration,Q._debugInfo=S._debugInfo,Q._debugNeedsRemount=S._debugNeedsRemount,Q.tag){case 0:case 15:case 14:case 1:case 11:Q.type=$o(S.type)}return Q}function cp(S,w){S.flags&=1206910978;var Q=S.alternate;return Q===null?(S.childLanes=0,S.lanes=w,S.child=null,S.subtreeFlags=0,S.memoizedProps=null,S.memoizedState=null,S.updateQueue=null,S.dependencies=null,S.stateNode=null,S.selfBaseDuration=0,S.treeBaseDuration=0):(S.childLanes=Q.childLanes,S.lanes=Q.lanes,S.child=Q.child,S.subtreeFlags=0,S.deletions=null,S.memoizedProps=Q.memoizedProps,S.memoizedState=Q.memoizedState,S.updateQueue=Q.updateQueue,S.type=Q.type,w=Q.dependencies,S.dependencies=w===null?null:{lanes:w.lanes,firstContext:w.firstContext,_debugThenableState:w._debugThenableState},S.selfBaseDuration=Q.selfBaseDuration,S.treeBaseDuration=Q.treeBaseDuration),S}function Xt(S,w,Q,W,oe,ae){var De=0,ke=$o(S);if(typeof ke==="function")Us(ke)&&(De=1);else if(typeof ke==="string")De=re(),De=Wt(S,Q,De)?26:S==="html"||S==="head"||S==="body"?27:5;else e:switch(ke){case s0:return w=u(31,Q,w,oe),w.elementType=s0,w.lanes=ae,w;case b8:return to(Q.children,oe,ae,w);case JH:De=8,oe|=A2,oe|=yI;break;case sW:return S=Q,W=oe,typeof S.id!=="string"&&console.error('Profiler must specify an "id" of type `string` as a prop. Received the type `%s` instead.',typeof S.id),w=u(12,S,w,W|Sa),w.elementType=sW,w.lanes=ae,w.stateNode={effectDuration:0,passiveEffectDuration:0},w;case aW:return w=u(13,Q,w,oe),w.elementType=aW,w.lanes=ae,w;case up:return w=u(19,Q,w,oe),w.elementType=up,w.lanes=ae,w;case m2:case I8:return S=oe|Ift,w=u(30,Q,w,S),w.elementType=I8,w.lanes=ae,w.stateNode={autoName:null,paired:null,clones:null,ref:null},w;default:if(typeof ke==="object"&&ke!==null)switch(ke.$$typeof){case fl:De=10;break e;case o4:De=9;break e;case YD:De=11;break e;case uI:De=14;break e;case nm:De=16,ke=null;break e}if(Q="",S===void 0||typeof S==="object"&&S!==null&&Object.keys(S).length===0)Q+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.";S===null?ke="null":a0(S)?ke="array":S!==void 0&&S.$$typeof===n4?(ke="<"+(U(S.type)||"Unknown")+" />",Q=" Did you accidentally export a JSX literal instead of a component?"):ke=typeof S,(De=W?j(W):null)&&(Q+=`

Check the render method of \``+De+"`."),De=29,Q=Error("Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: "+(ke+"."+Q)),ke=null}return w=u(De,Q,w,oe),w.elementType=S,w.type=ke,w.lanes=ae,w._debugOwner=W,w}function bn(S,w,Q){return w=Xt(S.type,S.key,S.props,S._owner,w,Q),w._debugOwner=S._owner,w._debugStack=S._debugStack,w._debugTask=S._debugTask,w}function to(S,w,Q,W){return S=u(7,S,W,w),S.lanes=Q,S}function yo(S,w,Q){return S=u(6,S,null,w),S.lanes=Q,S}function ci(S){var w=u(18,null,null,hs);return w.stateNode=S,w}function Ws(S,w,Q){return w=u(4,S.children!==null?S.children:[],S.key,w),w.lanes=Q,w.stateNode={containerInfo:S.containerInfo,pendingChildren:null,implementation:S.implementation},w}function rs(S,w){if(typeof S==="object"&&S!==null){var Q=MTe.get(S);if(Q!==void 0)return Q;return w={value:S,source:w,stack:Ee(w)},MTe.set(S,w),w}return{value:S,source:w,stack:Ee(w)}}function ma(S,w){D5(),CW[bW++]=aoe,CW[bW++]=Y_e,Y_e=S,aoe=w}function ch(S,w,Q){D5(),MC[wC++]=qE,MC[wC++]=JE,MC[wC++]=aF,aF=S;var W=qE;S=JE;var oe=32-Wl(W)-1;W&=~(1<<oe),Q+=1;var ae=32-Wl(w)+oe;if(30<ae){var De=oe-oe%5;ae=(W&(1<<De)-1).toString(32),W>>=De,oe-=De,qE=1<<32-Wl(w)+oe|Q<<oe|W,JE=ae+S}else qE=1<<ae|Q<<oe|W,JE=S}function L_(S){D5(),S.return!==null&&(ma(S,1),ch(S,1,0))}function H_(S){for(;S===Y_e;)Y_e=CW[--bW],CW[bW]=null,aoe=CW[--bW],CW[bW]=null;for(;S===aF;)aF=MC[--wC],MC[wC]=null,JE=MC[--wC],MC[wC]=null,qE=MC[--wC],MC[wC]=null}function ml(){return D5(),aF!==null?{id:qE,overflow:JE}:null}function tE(S,w){D5(),MC[wC++]=qE,MC[wC++]=JE,MC[wC++]=aF,qE=w.id,JE=w.overflow,aF=S}function D5(){Pa||console.error("Expected to be hydrating. This is a bug in React. Please file an issue.")}function N5(S,w){if(S.return===null){if(a4===null)a4={fiber:S,children:[],serverProps:void 0,serverTail:[],distanceFromLeaf:w};else{if(a4.fiber!==S)throw Error("Saw multiple hydration diff roots in a pass. This is a bug in React.");a4.distanceFromLeaf>w&&(a4.distanceFromLeaf=w)}return a4}var Q=N5(S.return,w+1).children;if(0<Q.length&&Q[Q.length-1].fiber===S)return Q=Q[Q.length-1],Q.distanceFromLeaf>w&&(Q.distanceFromLeaf=w),Q;return w={fiber:S,children:[],serverProps:void 0,serverTail:[],distanceFromLeaf:w},Q.push(w),w}function oH(){Pa&&console.error("We should not be hydrating here. This is a bug in React. Please file a bug.")}function nE(S,w){R8||(S=N5(S,0),S.serverProps=null,w!==null&&(w=_C(w),S.serverTail.push(w)))}function kg(S){var w=1<arguments.length&&arguments[1]!==void 0?arguments[1]:!1,Q="",W=a4;throw W!==null&&(a4=null,Q=gd(W)),R5(rs(Error("Hydration failed because the server rendered "+(w?"text":"HTML")+` didn't match the client. As a result this tree will be regenerated on the client. This can happen if a SSR-ed Client Component used:

- A server/client branch \`if (typeof window !== 'undefined')\`.
- Variable input such as \`Date.now()\` or \`Math.random()\` which changes each time it's called.
- Date formatting in a user's locale which doesn't match the server.
- External changing data without sending a snapshot of it along with the HTML.
- Invalid HTML tag nesting.

It can also happen if the client has a browser extension installed which messes with the HTML before React loaded.

https://react.dev/link/hydration-mismatch`+Q),S)),wTe}function JA(S){var{stateNode:w,type:Q,memoizedProps:W}=S;switch(w[ku]=S,w[Kg]=W,pf(Q,W),Q){case"dialog":ks("cancel",w),ks("close",w);break;case"iframe":case"object":case"embed":ks("load",w);break;case"video":case"audio":for(Q=0;Q<Foe.length;Q++)ks(Foe[Q],w);break;case"source":ks("error",w);break;case"img":case"image":case"link":ks("error",w),ks("load",w);break;case"details":ks("toggle",w);break;case"input":ir("input",W),ks("invalid",w),Po(w,W),Tn(w,W.value,W.defaultValue,W.checked,W.defaultChecked,W.type,W.name,!0);break;case"option":fo(w,W);break;case"select":ir("select",W),ks("invalid",w),or(w,W);break;case"textarea":ir("textarea",W),ks("invalid",w),Er(w,W),Ys(w,W.value,W.defaultValue,W.children)}Q=W.children,typeof Q!=="string"&&typeof Q!=="number"&&typeof Q!=="bigint"||w.textContent===""+Q||W.suppressHydrationWarning===!0||RE(w.textContent,Q)?(W.popover!=null&&(ks("beforetoggle",w),ks("toggle",w)),W.onScroll!=null&&ks("scroll",w),W.onScrollEnd!=null&&ks("scrollend",w),W.onClick!=null&&(w.onclick=fd),w=!0):w=!1,w||kg(S,!0)}function Iv(S){for(qg=S.return;qg;)switch(qg.tag){case 5:case 31:case 13:BC=!1;return;case 27:case 3:BC=!0;return;default:qg=qg.return}}function vv(S){if(S!==qg)return!1;if(!Pa)return Iv(S),Pa=!0,!1;var w=S.tag,Q;if(Q=w!==3&&w!==27){if(Q=w===5)Q=S.type,Q=!(Q!=="form"&&Q!=="button")||a8(S.type,S.memoizedProps);Q=!Q}if(Q&&Sd){for(Q=Sd;Q;){var W=N5(S,0),oe=_C(Q);W.serverTail.push(oe),Q=oe.type==="Suspense"?Z5(Q):Jp(Q.nextSibling)}kg(S)}if(Iv(S),w===13){if(S=S.memoizedState,S=S!==null?S.dehydrated:null,!S)throw Error("Expected to have a hydrated suspense instance. This error is likely caused by a bug in React. Please file an issue.");Sd=Z5(S)}else if(w===31){if(S=S.memoizedState,S=S!==null?S.dehydrated:null,!S)throw Error("Expected to have a hydrated suspense instance. This error is likely caused by a bug in React. Please file an issue.");Sd=Z5(S)}else w===27?(w=Sd,ox(S.type)?(S=SDe,SDe=null,Sd=S):Sd=w):Sd=qg?Jp(S.stateNode.nextSibling):null;return!0}function z3(){Sd=qg=null,R8=Pa=!1}function oE(){var S=eN;return S!==null&&(H1===null?H1=S:H1.push.apply(H1,S),eN=null),S}function R5(S){eN===null?eN=[S]:eN.push(S)}function Sv(){var S=a4;if(S!==null){a4=null;for(var w=gd(S);0<S.children.length;)S=S.children[0];ye(S.fiber,function(){console.error(`A tree hydrated but some attributes of the server rendered HTML didn't match the client properties. This won't be patched up. This can happen if a SSR-ed Client Component used:

- A server/client branch \`if (typeof window !== 'undefined')\`.
- Variable input such as \`Date.now()\` or \`Math.random()\` which changes each time it's called.
- Date formatting in a user's locale which doesn't match the server.
- External changing data without sending a snapshot of it along with the HTML.
- Invalid HTML tag nesting.

It can also happen if the client has a browser extension installed which messes with the HTML before React loaded.

%s%s`,"https://react.dev/link/hydration-mismatch",w)})}}function O3(){IW=G_e=null,vW=!1}function Q5(S,w,Q){J(BTe,w._currentValue,S),w._currentValue=Q,J(TTe,w._currentRenderer,S),w._currentRenderer!==void 0&&w._currentRenderer!==null&&w._currentRenderer!==Pft&&console.error("Detected multiple renderers concurrently rendering the same context provider. This is currently unsupported."),w._currentRenderer=Pft}function qf(S,w){S._currentValue=BTe.current;var Q=TTe.current;K(TTe,w),S._currentRenderer=Q,K(BTe,w)}function Mu(S,w,Q){for(;S!==null;){var W=S.alternate;if((S.childLanes&w)!==w?(S.childLanes|=w,W!==null&&(W.childLanes|=w)):W!==null&&(W.childLanes&w)!==w&&(W.childLanes|=w),S===Q)break;S=S.return}S!==Q&&console.error("Expected to find the propagation root when scheduling context work. This error is likely caused by a bug in React. Please file an issue.")}function Pv(S,w,Q,W){var oe=S.child;oe!==null&&(oe.return=S);for(;oe!==null;){var ae=oe.dependencies;if(ae!==null){var De=oe.child;ae=ae.firstContext;e:for(;ae!==null;){var ke=ae;ae=oe;for(var ot=0;ot<w.length;ot++)if(ke.context===w[ot]){ae.lanes|=Q,ke=ae.alternate,ke!==null&&(ke.lanes|=Q),Mu(ae.return,Q,S),W||(De=null);break e}ae=ke.next}}else if(oe.tag===18){if(De=oe.return,De===null)throw Error("We just came from a parent so we must have had a parent. This is a bug in React.");De.lanes|=Q,ae=De.alternate,ae!==null&&(ae.lanes|=Q),Mu(De,Q,S),De=null}else oe.tag===13&&oe.memoizedState!==null&&oe.memoizedState.dehydrated===null?(oe.lanes|=Q,De=oe.alternate,De!==null&&(De.lanes|=Q),Mu(oe.return,Q,S),De=oe.child,De=De!==null?De.sibling:null):De=oe.child;if(De!==null)De.return=oe;else for(De=oe;De!==null;){if(De===S){De=null;break}if(oe=De.sibling,oe!==null){oe.return=De.return,De=oe;break}De=De.return}oe=De}}function Gy(S,w,Q,W){S=null;for(var oe=w,ae=!1;oe!==null;){if(!ae){if((oe.flags&524288)!==0)ae=!0;else if((oe.flags&262144)!==0)break}if(oe.tag===10){var De=oe.alternate;if(De===null)throw Error("Should have a current fiber. This is a bug in React.");if(De=De.memoizedProps,De!==null){var ke=oe.type;Q1(oe.pendingProps.value,De.value)||(S!==null?S.push(ke):S=[ke])}}else if(oe===v8.current){if(De=oe.alternate,De===null)throw Error("Should have a current fiber. This is a bug in React.");De.memoizedState.memoizedState!==oe.memoizedState.memoizedState&&(S!==null?S.push(WW):S=[WW])}oe=oe.return}return S!==null&&Pv(w,S,Q,W),w.flags|=262144,S!==null}function k5(S){for(S=S.firstContext;S!==null;){if(!Q1(S.context._currentValue,S.memoizedValue))return!0;S=S.next}return!1}function Uy(S){G_e=S,IW=null,S=S.dependencies,S!==null&&(S.firstContext=null)}function Kc(S){return vW&&console.error("Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo()."),rH(G_e,S)}function _6(S,w){return G_e===null&&Uy(S),rH(S,w)}function rH(S,w){var Q=w._currentValue;if(w={context:w,memoizedValue:Q,next:null},IW===null){if(S===null)throw Error("Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo().");IW=w,S.dependencies={lanes:0,firstContext:w,_debugThenableState:null},S.flags|=524288}else IW=IW.next=w;return Q}function Wy(){return{controller:new xfo,data:new Map,refCount:0}}function L5(S){S.controller.signal.aborted&&console.warn("A cache instance was retained after it was already freed. This likely indicates a bug in React."),S.refCount++}function Jf(S){S.refCount--,0>S.refCount&&console.warn("A cache instance was released after it was already freed. This likely indicates a bug in React."),S.refCount===0&&Cfo(bfo,function(){S.controller.abort()})}function u1(S,w){if((S.pendingLanes&4194048)!==0){var Q=S.transitionTypes;Q===null&&(Q=S.transitionTypes=[]);for(S=0;S<w.length;S++){var W=w[S];Q.indexOf(W)===-1&&Q.push(W)}}}function Ev(S){var w=S.transitionTypes;return S.transitionTypes=null,w}function ZA(S,w,Q){if((S&127)!==0)0>Q8&&(Q8=rm(),hoe=U_e(w),DTe=w,Q!=null&&(NTe=Y(Q)),(Vc&(q_|h4))!==tA&&(O0=!0,nN=loe),S=mf(),w=U5(),S!==SW||w!==doe?SW=-1.1:w!==null&&(nN=loe),lF=S,doe=w);else if((S&4194048)!==0&&0>TC&&(TC=rm(),uoe=U_e(w),Eft=w,Q!=null&&(Mft=Y(Q)),0>tM)){if(S=mf(),w=U5(),S!==rN||w!==hF)rN=-1.1;oN=S,hF=w}}function iH(S){if(0>Q8){Q8=rm(),hoe=S._debugTask!=null?S._debugTask:null,(Vc&(q_|h4))!==tA&&(nN=loe);var w=mf(),Q=U5();w!==SW||Q!==doe?SW=-1.1:Q!==null&&(nN=loe),lF=w,doe=Q}if(0>TC&&(TC=rm(),uoe=S._debugTask!=null?S._debugTask:null,0>tM)){if(S=mf(),w=U5(),S!==rN||w!==hF)rN=-1.1;oN=S,hF=w}}function Zf(){var S=cF;return cF=0,S}function rE(S){var w=cF;return cF=S,w}function ef(S){var w=cF;return cF+=S,w}function g6(){Zi=Ti=-1.1}function N0(){var S=Ti;return Ti=-1.1,S}function Qm(S){0<=S&&(Ti=S)}function e2(){var S=c0;return c0=-0,S}function tf(S){0<=S&&(c0=S)}function p1(){var S=Lu;return Lu=null,S}function Vl(){var S=O0;return O0=!1,S}function iE(S){k1=rm(),0>S.actualStartTime&&(S.actualStartTime=k1)}function ST(S){if(0<=k1){var w=rm()-k1;S.actualDuration+=w,S.selfBaseDuration=w,k1=-1}}function sH(S){if(0<=k1){var w=rm()-k1;S.actualDuration+=w,k1=-1}}function m1(){if(0<=k1){var S=rm(),w=S-k1;k1=-1,cF+=w,c0+=w,Zi=S}}function aH(S){Lu===null&&(Lu=[]),Lu.push(S),eM===null&&(eM=[]),eM.push(S)}function nf(){k1=rm(),0>Ti&&(Ti=k1)}function of(S){for(var w=S.child;w;)S.actualDuration+=w.actualDuration,w=w.sibling}function A6(S,w){if(moe===null){var Q=moe=[];LTe=0,iN=Y5(),PW={status:"pending",value:void 0,then:function(W){Q.push(W)}}}return LTe++,w.then(cH,cH),w}function cH(){if(--LTe===0&&(-1<TC||(tM=-1.1),coe=null,moe!==null)){PW!==null&&(PW.status="fulfilled");var S=moe;moe=null,iN=0,PW=null;for(var w=0;w<S.length;w++)(0,S[w])()}}function vU(S,w){var Q=[],W={status:"pending",value:null,reason:null,then:function(oe){Q.push(oe)}};return S.then(function(){W.status="fulfilled",W.value=w;for(var oe=0;oe<Q.length;oe++)(0,Q[oe])(w)},function(oe){W.status="rejected",W.reason=oe;for(oe=0;oe<Q.length;oe++)(0,Q[oe])(void 0)}),W}function sE(){var S=uF.current;return S!==null?S:$h.pooledCache}function Mv(S,w){w===null?J(uF,uF.current,S):J(uF,w.pool,S)}function f6(){var S=sE();return S===null?null:{parent:Um._currentValue,pool:S}}function aE(){return{didWarnAboutUncachedPromise:!1,thenables:[]}}function PT(S){return S=S.status,S==="fulfilled"||S==="rejected"}function cE(S,w,Q,W){Vn.actQueue!==null&&(Vn.didUsePromise=!0);var oe=S.thenables;if(Q=oe[Q],Q===void 0?oe.push(w):Q!==w&&(S.didWarnAboutUncachedPromise||(S.didWarnAboutUncachedPromise=!0,console.error("A component was suspended by an uncached promise. Creating promises inside a Client Component or hook is not yet supported, except via a Suspense-compatible library or framework.")),w.then(fd,fd),w=Q),w._debugInfo===void 0){S=performance.now(),oe=w.displayName;var ae={name:typeof oe==="string"?oe:"Promise",start:S,end:S,value:w};w._debugInfo=[{awaited:ae}],w.status!=="fulfilled"&&w.status!=="rejected"&&(S=function(){ae.end=performance.now()},w.then(S,S))}switch(w.status){case"fulfilled":return w.value;case"rejected":if(W=w.reason,MT(W),W===void 0&&!("reason"in w))throw Error("A rejected Promise was passed to React without a `reason` property. React threw a generic error from where the Promise was used to assist in identifying the problematic Promise. Make sure that instrumented Promises correctly set the `reason` property when setting `status` to `'rejected'`.");throw W;default:if(typeof w.status==="string")w.then(fd,fd);else{if(S=$h,S!==null&&100<S.shellSuspendCounter)throw Error("An unknown Component is an async Client Component. Only Server Components can be async at the moment. This error is often caused by accidentally adding `'use client'` to a module that was originally written for the server.");S=w,S.status="pending",S.then(function(De){if(w.status==="pending"){var ke=w;ke.status="fulfilled",ke.value=De}},function(De){if(w.status==="pending"){var ke=w;ke.status="rejected",ke.reason=De}})}switch(w.status){case"fulfilled":return w.value;case"rejected":throw W=w.reason,MT(W),W}throw _F=w,Coe=!0,OTe||W===null||W.alternate!==null||(mF=W,ege=Error("This library called use() to suspend in a previous render but did not call use() when it finished. This indicates an incorrect use of use(). Learn more: https://react.dev/warnings/conditional-use-of-use")),EW}}function Xy(S){try{return Efo(S)}catch(w){if(w!==null&&typeof w==="object"&&typeof w.then==="function")throw _F=w,Coe=!0,EW;throw w}}function ET(){if(_F===null)throw Error("Expected a suspended thenable. This is a bug in React. Please file an issue.");var S=_F;return _F=null,Coe=!1,S}function MT(S){if(S===EW||S===J_e)throw Error("Hooks are not supported inside an async component. This error is often caused by accidentally adding `'use client'` to a module that was originally written for the server.")}function wT(S,w){return S===w?!0:S.tag!==w.tag||S.type!==w.type||S.key!==w.key||S.index!==w.index||S.tag===3&&S.stateNode!==w.stateNode||S.return===null||w.return===null?!1:wT(S.return,w.return)}function km(S){var w=Ua;return S!=null&&(Ua=w===null?S:w.concat(S)),w}function _1(){var S=Ua;if(S!=null){for(var w=S.length-1;0<=w;w--)if(S[w].name!=null){var Q=S[w].debugTask;if(Q!=null)return Q}}return null}function wv(S,w,Q){for(var W=Object.keys(S.props),oe=0;oe<W.length;oe++){var ae=W[oe];if(ae!=="children"&&ae!=="key"&&ae!=="ref"){w===null&&(w=bn(S,Q.mode,0),w._debugInfo=Ua,w.return=Q),ye(w,function(De){console.error("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key`, `ref`, and `children` props.",De)},ae);break}}}function BT(S){var w=boe;return boe+=1,MW===null&&(MW=aE()),cE(MW,S,w,null)}function jy(S,w){w=w.props.ref,S.ref=w!==void 0?w:null}function Lg(S,w){if(w.$$typeof===VD)throw Error(`A React Element from an older version of React was rendered. This is not supported. It can happen if:
- Multiple copies of the "react" package is used.
- A library pre-bundled an old copy of "react" or "react/jsx-runtime".
- A compiler tries to "inline" JSX instead of using the runtime.`);throw S=Object.prototype.toString.call(w),Error("Objects are not valid as a React child (found: "+(S==="[object Object]"?"object with keys {"+Object.keys(w).join(", ")+"}":S)+"). If you meant to render a collection of children, use an array instead.")}function lE(S,w){var Q=_1();Q!==null?Q.run(Lg.bind(null,S,w)):Lg(S,w)}function TT(S,w){var Q=Y(S)||"Component";Wft[Q]||(Wft[Q]=!0,w=w.displayName||w.name||"Component",S.tag===3?console.error(`Functions are not valid as a React child. This may happen if you return %s instead of <%s /> from render. Or maybe you meant to call this function rather than return it.
  root.render(%s)`,w,w,w):console.error(`Functions are not valid as a React child. This may happen if you return %s instead of <%s /> from render. Or maybe you meant to call this function rather than return it.
  <%s>{%s}</%s>`,w,w,Q,w,Q))}function hE(S,w){var Q=_1();Q!==null?Q.run(TT.bind(null,S,w)):TT(S,w)}function lH(S,w){var Q=Y(S)||"Component";Xft[Q]||(Xft[Q]=!0,w=String(w),S.tag===3?console.error(`Symbols are not valid as a React child.
  root.render(%s)`,w):console.error(`Symbols are not valid as a React child.
  <%s>%s</%s>`,Q,w,Q))}function Bv(S,w){var Q=_1();Q!==null?Q.run(lH.bind(null,S,w)):lH(S,w)}function DT(S){function w($t,qt){if(S){var tn=$t.deletions;tn===null?($t.deletions=[qt],$t.flags|=16):tn.push(qt)}}function Q($t,qt){if(!S)return null;for(;qt!==null;)w($t,qt),qt=qt.sibling;return null}function W($t){for(var qt=new Map;$t!==null;)$t.key===null?qt.set($t.index,$t):qt.set($t.key,$t),$t=$t.sibling;return qt}function oe($t,qt){return $t=sc($t,qt),$t.index=0,$t.sibling=null,$t}function ae($t,qt,tn){if($t.index=tn,!S)return $t.flags|=1048576,qt;if(tn=$t.alternate,tn!==null)return tn=tn.index,tn<qt?($t.flags|=2,qt):tn;return $t.flags|=134217730,qt}function De($t){return S&&$t.alternate===null&&($t.flags|=134217730),$t}function ke($t,qt,tn,Yn){if(qt===null||qt.tag!==6)return qt=yo(tn,$t.mode,Yn),qt.return=$t,qt._debugOwner=$t,qt._debugTask=$t._debugTask,qt._debugInfo=Ua,qt;return qt=oe(qt,tn),qt.return=$t,qt._debugInfo=Ua,qt}function ot($t,qt,tn,Yn){var ko=tn.type;if(ko===b8)return qt=zt($t,qt,tn.props.children,Yn,tn.key),jy(qt,tn),wv(tn,qt,$t),qt;if(qt!==null&&(qt.elementType===ko||Mr(qt,tn)||typeof ko==="object"&&ko!==null&&ko.$$typeof===nm&&Xy(ko)===qt.type))return qt=oe(qt,tn.props),jy(qt,tn),qt.return=$t,qt._debugOwner=tn._owner,qt._debugInfo=Ua,qt;return qt=bn(tn,$t.mode,Yn),jy(qt,tn),qt.return=$t,qt._debugInfo=Ua,qt}function _t($t,qt,tn,Yn){if(qt===null||qt.tag!==4||qt.stateNode.containerInfo!==tn.containerInfo||qt.stateNode.implementation!==tn.implementation)return qt=Ws(tn,$t.mode,Yn),qt.return=$t,qt._debugInfo=Ua,qt;return qt=oe(qt,tn.children||[]),qt.return=$t,qt._debugInfo=Ua,qt}function zt($t,qt,tn,Yn,ko){if(qt===null||qt.tag!==7)return qt=to(tn,$t.mode,Yn,ko),qt.return=$t,qt._debugOwner=$t,qt._debugTask=$t._debugTask,qt._debugInfo=Ua,qt;return qt=oe(qt,tn),qt.return=$t,qt._debugInfo=Ua,qt}function en($t,qt,tn){if(typeof qt==="string"&&qt!==""||typeof qt==="number"||typeof qt==="bigint")return qt=yo(""+qt,$t.mode,tn),qt.return=$t,qt._debugOwner=$t,qt._debugTask=$t._debugTask,qt._debugInfo=Ua,qt;if(typeof qt==="object"&&qt!==null){switch(qt.$$typeof){case n4:return tn=bn(qt,$t.mode,tn),jy(tn,qt),tn.return=$t,$t=km(qt._debugInfo),tn._debugInfo=Ua,Ua=$t,tn;case C8:return qt=Ws(qt,$t.mode,tn),qt.return=$t,qt._debugInfo=Ua,qt;case nm:var Yn=km(qt._debugInfo);return qt=Xy(qt),$t=en($t,qt,tn),Ua=Yn,$t}if(a0(qt)||O(qt))return tn=to(qt,$t.mode,tn,null),tn.return=$t,tn._debugOwner=$t,tn._debugTask=$t._debugTask,$t=km(qt._debugInfo),tn._debugInfo=Ua,Ua=$t,tn;if(typeof qt.then==="function")return Yn=km(qt._debugInfo),$t=en($t,BT(qt),tn),Ua=Yn,$t;if(qt.$$typeof===fl)return en($t,_6($t,qt),tn);lE($t,qt)}return typeof qt==="function"&&hE($t,qt),typeof qt==="symbol"&&Bv($t,qt),null}function Zt($t,qt,tn,Yn){var ko=qt!==null?qt.key:null;if(typeof tn==="string"&&tn!==""||typeof tn==="number"||typeof tn==="bigint")return ko!==null?null:ke($t,qt,""+tn,Yn);if(typeof tn==="object"&&tn!==null){switch(tn.$$typeof){case n4:return tn.key===ko?(ko=km(tn._debugInfo),$t=ot($t,qt,tn,Yn),Ua=ko,$t):null;case C8:return tn.key===ko?_t($t,qt,tn,Yn):null;case nm:return ko=km(tn._debugInfo),tn=Xy(tn),$t=Zt($t,qt,tn,Yn),Ua=ko,$t}if(a0(tn)||O(tn)){if(ko!==null)return null;return ko=km(tn._debugInfo),$t=zt($t,qt,tn,Yn,null),Ua=ko,$t}if(typeof tn.then==="function")return ko=km(tn._debugInfo),$t=Zt($t,qt,BT(tn),Yn),Ua=ko,$t;if(tn.$$typeof===fl)return Zt($t,qt,_6($t,tn),Yn);lE($t,tn)}return typeof tn==="function"&&hE($t,tn),typeof tn==="symbol"&&Bv($t,tn),null}function xn($t,qt,tn,Yn,ko){if(typeof Yn==="string"&&Yn!==""||typeof Yn==="number"||typeof Yn==="bigint")return $t=$t.get(tn)||null,ke(qt,$t,""+Yn,ko);if(typeof Yn==="object"&&Yn!==null){switch(Yn.$$typeof){case n4:return tn=$t.get(Yn.key===null?tn:Yn.key)||null,$t=km(Yn._debugInfo),qt=ot(qt,tn,Yn,ko),Ua=$t,qt;case C8:return $t=$t.get(Yn.key===null?tn:Yn.key)||null,_t(qt,$t,Yn,ko);case nm:var es=km(Yn._debugInfo);return Yn=Xy(Yn),qt=xn($t,qt,tn,Yn,ko),Ua=es,qt}if(a0(Yn)||O(Yn))return tn=$t.get(tn)||null,$t=km(Yn._debugInfo),qt=zt(qt,tn,Yn,ko,null),Ua=$t,qt;if(typeof Yn.then==="function")return es=km(Yn._debugInfo),qt=xn($t,qt,tn,BT(Yn),ko),Ua=es,qt;if(Yn.$$typeof===fl)return xn($t,qt,tn,_6(qt,Yn),ko);lE(qt,Yn)}return typeof Yn==="function"&&hE(qt,Yn),typeof Yn==="symbol"&&Bv(qt,Yn),null}function Co($t,qt,tn,Yn){if(typeof tn!=="object"||tn===null)return Yn;switch(tn.$$typeof){case n4:case C8:h($t,qt,tn);var ko=tn.key;if(typeof ko!=="string")break;if(Yn===null){Yn=new Set,Yn.add(ko);break}if(!Yn.has(ko)){Yn.add(ko);break}ye(qt,function(){console.error("Encountered two children with the same key, `%s`. Keys should be unique so that components maintain their identity across updates. Non-unique keys may cause children to be duplicated and/or omitted — the behavior is unsupported and could change in a future version.",ko)});break;case nm:tn=Xy(tn),Co($t,qt,tn,Yn)}return Yn}function xr($t,qt,tn,Yn){for(var ko=null,es=null,hi=null,la=qt,ka=qt=0,d0=null;la!==null&&ka<tn.length;ka++){la.index>ka?(d0=la,la=null):d0=la.sibling;var Mh=Zt($t,la,tn[ka],Yn);if(Mh===null){la===null&&(la=d0);break}ko=Co($t,Mh,tn[ka],ko),S&&la&&Mh.alternate===null&&w($t,la),qt=ae(Mh,qt,ka),hi===null?es=Mh:hi.sibling=Mh,hi=Mh,la=d0}if(ka===tn.length)return Q($t,la),Pa&&ma($t,ka),es;if(la===null){for(;ka<tn.length;ka++)la=en($t,tn[ka],Yn),la!==null&&(ko=Co($t,la,tn[ka],ko),qt=ae(la,qt,ka),hi===null?es=la:hi.sibling=la,hi=la);return Pa&&ma($t,ka),es}for(la=W(la);ka<tn.length;ka++)d0=xn(la,$t,ka,tn[ka],Yn),d0!==null&&(ko=Co($t,d0,tn[ka],ko),S&&(Mh=d0.alternate,Mh!==null&&la.delete(Mh.key===null?ka:Mh.key)),qt=ae(d0,qt,ka),hi===null?es=d0:hi.sibling=d0,hi=d0);return S&&la.forEach(function(cM){return w($t,cM)}),Pa&&ma($t,ka),es}function li($t,qt,tn,Yn){if(tn==null)throw Error("An iterable object provided no iterator.");for(var ko=null,es=null,hi=qt,la=qt=0,ka=null,d0=null,Mh=tn.next();hi!==null&&!Mh.done;la++,Mh=tn.next()){hi.index>la?(ka=hi,hi=null):ka=hi.sibling;var cM=Zt($t,hi,Mh.value,Yn);if(cM===null){hi===null&&(hi=ka);break}d0=Co($t,cM,Mh.value,d0),S&&hi&&cM.alternate===null&&w($t,hi),qt=ae(cM,qt,la),es===null?ko=cM:es.sibling=cM,es=cM,hi=ka}if(Mh.done)return Q($t,hi),Pa&&ma($t,la),ko;if(hi===null){for(;!Mh.done;la++,Mh=tn.next())hi=en($t,Mh.value,Yn),hi!==null&&(d0=Co($t,hi,Mh.value,d0),qt=ae(hi,qt,la),es===null?ko=hi:es.sibling=hi,es=hi);return Pa&&ma($t,la),ko}for(hi=W(hi);!Mh.done;la++,Mh=tn.next())ka=xn(hi,$t,la,Mh.value,Yn),ka!==null&&(d0=Co($t,ka,Mh.value,d0),S&&(Mh=ka.alternate,Mh!==null&&hi.delete(Mh.key===null?la:Mh.key)),qt=ae(ka,qt,la),es===null?ko=ka:es.sibling=ka,es=ka);return S&&hi.forEach(function(Jfo){return w($t,Jfo)}),Pa&&ma($t,la),ko}function ga($t,qt,tn,Yn){if(typeof tn==="object"&&tn!==null&&tn.type===b8&&tn.key===null&&tn.props.ref===void 0&&(wv(tn,null,$t),tn=tn.props.children),typeof tn==="object"&&tn!==null){switch(tn.$$typeof){case n4:var ko=km(tn._debugInfo);e:{for(var es=tn.key;qt!==null;){if(qt.key===es){if(es=tn.type,es===b8){if(qt.tag===7){Q($t,qt.sibling),Yn=oe(qt,tn.props.children),jy(Yn,tn),Yn.return=$t,Yn._debugOwner=tn._owner,Yn._debugInfo=Ua,wv(tn,Yn,$t),$t=Yn;break e}}else if(qt.elementType===es||Mr(qt,tn)||typeof es==="object"&&es!==null&&es.$$typeof===nm&&Xy(es)===qt.type){Q($t,qt.sibling),Yn=oe(qt,tn.props),jy(Yn,tn),Yn.return=$t,Yn._debugOwner=tn._owner,Yn._debugInfo=Ua,$t=Yn;break e}Q($t,qt);break}else w($t,qt);qt=qt.sibling}tn.type===b8?(Yn=to(tn.props.children,$t.mode,Yn,tn.key),jy(Yn,tn),Yn.return=$t,Yn._debugOwner=$t,Yn._debugTask=$t._debugTask,Yn._debugInfo=Ua,wv(tn,Yn,$t),$t=Yn):(Yn=bn(tn,$t.mode,Yn),jy(Yn,tn),Yn.return=$t,Yn._debugInfo=Ua,$t=Yn)}return $t=De($t),Ua=ko,$t;case C8:e:{ko=tn;for(tn=ko.key;qt!==null;){if(qt.key===tn)if(qt.tag===4&&qt.stateNode.containerInfo===ko.containerInfo&&qt.stateNode.implementation===ko.implementation){Q($t,qt.sibling),Yn=oe(qt,ko.children||[]),Yn.return=$t,$t=Yn;break e}else{Q($t,qt);break}else w($t,qt);qt=qt.sibling}Yn=Ws(ko,$t.mode,Yn),Yn.return=$t,$t=Yn}return De($t);case nm:return ko=km(tn._debugInfo),tn=Xy(tn),$t=ga($t,qt,tn,Yn),Ua=ko,$t}if(a0(tn))return xr($t,qt,tn,Yn);if(O(tn)){if(ko=tn,tn=O(ko),typeof tn!=="function")throw Error("An object is not an iterable. This error is likely caused by a bug in React. Please file an issue.");if(es=tn.call(ko),es===ko){if($t.tag!==0||Object.prototype.toString.call($t.type)!=="[object GeneratorFunction]"||Object.prototype.toString.call(es)!=="[object Generator]")Gft||console.error("Using Iterators as children is unsupported and will likely yield unexpected results because enumerating a generator mutates it. You may convert it to an array with `Array.from()` or the `[...spread]` operator before rendering. You can also use an Iterable that can iterate multiple times over the same items."),Gft=!0}else ko.entries!==tn||VTe||(console.error("Using Maps as children is not supported. Use an array of keyed ReactElements instead."),VTe=!0);return li($t,qt,es,Yn)}if(typeof tn.then==="function")return ko=km(tn._debugInfo),$t=ga($t,qt,BT(tn),Yn),Ua=ko,$t;if(tn.$$typeof===fl)return ga($t,qt,_6($t,tn),Yn);lE($t,tn)}if(typeof tn==="string"&&tn!==""||typeof tn==="number"||typeof tn==="bigint")return ko=""+tn,qt!==null&&qt.tag===6?(Q($t,qt.sibling),Yn=oe(qt,ko),Yn.return=$t,$t=Yn):(Q($t,qt),Yn=yo(ko,$t.mode,Yn),Yn.return=$t,Yn._debugOwner=$t,Yn._debugTask=$t._debugTask,Yn._debugInfo=Ua,$t=Yn),De($t);return typeof tn==="function"&&hE($t,tn),typeof tn==="symbol"&&Bv($t,tn),Q($t,qt)}return function($t,qt,tn,Yn){var ko=Ua;Ua=null;try{boe=0;var es=ga($t,qt,tn,Yn);return MW=null,es}catch(d0){if(d0===EW||d0===J_e)throw d0;var hi=u(29,d0,null,$t.mode);hi.lanes=Yn,hi.return=$t;var la=hi._debugInfo=Ua;if(hi._debugOwner=$t._debugOwner,hi._debugTask=$t._debugTask,la!=null){for(var ka=la.length-1;0<=ka;ka--)if(typeof la[ka].stack==="string"){hi._debugOwner=la[ka],hi._debugTask=la[ka].debugTask;break}}return hi}finally{Ua=ko}}}function hH(S,w){var Q=a0(S);return S=!Q&&typeof O(S)==="function",Q||S?(Q=Q?"array":"iterable",console.error("A nested %s was passed to row #%s in <SuspenseList />. Wrap it in an additional SuspenseList to configure its revealOrder: <SuspenseList revealOrder=...> ... <SuspenseList revealOrder=...>{%s}</SuspenseList> ... </SuspenseList>",Q,w,Q),!1):!0}function Tv(S){S.updateQueue={baseState:S.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function y6(S,w){S=S.updateQueue,w.updateQueue===S&&(w.updateQueue={baseState:S.baseState,firstBaseUpdate:S.firstBaseUpdate,lastBaseUpdate:S.lastBaseUpdate,shared:S.shared,callbacks:null})}function Fc(S){return{lane:S,tag:Kft,payload:null,callback:null,next:null}}function V3(S,w,Q){var W=S.updateQueue;if(W===null)return null;if(W=W.shared,GTe===W&&!Jft){var oe=Y(S);console.error(`An update (setState, replaceState, or forceUpdate) was scheduled from inside an update function. Update functions should be pure, with zero side-effects. Consider using componentDidUpdate or a callback.

Please update the following component: %s`,oe),Jft=!0}if((Vc&q_)!==tA)return oe=W.pending,oe===null?w.next=w:(w.next=oe.next,oe.next=w),W.pending=w,w=wo(S),ao(S,null,Q),w;return yn(S,W,w,Q),wo(S)}function dE(S,w,Q){if(w=w.updateQueue,w!==null&&(w=w.shared,(Q&4194048)!==0)){var W=w.lanes;W&=S.pendingLanes,Q|=W,w.lanes=Q,ft(S,Q)}}function uE(S,w){var Q=S.updateQueue,W=S.alternate;if(W!==null&&(W=W.updateQueue,Q===W)){var oe=null,ae=null;if(Q=Q.firstBaseUpdate,Q!==null){do{var De={lane:Q.lane,tag:Q.tag,payload:Q.payload,callback:null,next:null};ae===null?oe=ae=De:ae=ae.next=De,Q=Q.next}while(Q!==null);ae===null?oe=ae=w:ae=ae.next=w}else oe=ae=w;Q={baseState:W.baseState,firstBaseUpdate:oe,lastBaseUpdate:ae,shared:W.shared,callbacks:W.callbacks},S.updateQueue=Q;return}S=Q.lastBaseUpdate,S===null?Q.firstBaseUpdate=w:S.next=w,Q.lastBaseUpdate=w}function Hg(){if(UTe){var S=PW;if(S!==null)throw S}}function Dv(S,w,Q,W){UTe=!1;var oe=S.updateQueue;sN=!1,GTe=oe.shared;var{firstBaseUpdate:ae,lastBaseUpdate:De}=oe,ke=oe.shared.pending;if(ke!==null){oe.shared.pending=null;var ot=ke,_t=ot.next;ot.next=null,De===null?ae=_t:De.next=_t,De=ot;var zt=S.alternate;zt!==null&&(zt=zt.updateQueue,ke=zt.lastBaseUpdate,ke!==De&&(ke===null?zt.firstBaseUpdate=_t:ke.next=_t,zt.lastBaseUpdate=ot))}if(ae!==null){var en=oe.baseState;De=0,zt=_t=ot=null,ke=ae;do{var Zt=ke.lane&-536870913,xn=Zt!==ke.lane;if(xn?(na&Zt)===Zt:(W&Zt)===Zt){Zt!==0&&Zt===iN&&(UTe=!0),zt!==null&&(zt=zt.next={lane:0,tag:ke.tag,payload:ke.payload,callback:null,next:null});e:{Zt=S;var Co=ke,xr=w,li=Q;switch(Co.tag){case $ft:if(Co=Co.payload,typeof Co==="function"){vW=!0;var ga=Co.call(li,en,xr);if(Zt.mode&A2){Ct(!0);try{Co.call(li,en,xr)}finally{Ct(!1)}}vW=!1,en=ga;break e}en=Co;break e;case YTe:Zt.flags=Zt.flags&-65537|128;case Kft:if(ga=Co.payload,typeof ga==="function"){if(vW=!0,Co=ga.call(li,en,xr),Zt.mode&A2){Ct(!0);try{ga.call(li,en,xr)}finally{Ct(!1)}}vW=!1}else Co=ga;if(Co===null||Co===void 0)break e;en=ta({},en,Co);break e;case qft:sN=!0}}Zt=ke.callback,Zt!==null&&(S.flags|=64,xn&&(S.flags|=8192),xn=oe.callbacks,xn===null?oe.callbacks=[Zt]:xn.push(Zt))}else xn={lane:Zt,tag:ke.tag,payload:ke.payload,callback:ke.callback,next:null},zt===null?(_t=zt=xn,ot=en):zt=zt.next=xn,De|=Zt;if(ke=ke.next,ke===null)if(ke=oe.shared.pending,ke===null)break;else xn=ke,ke=xn.next,xn.next=null,oe.lastBaseUpdate=xn,oe.shared.pending=null}while(1);zt===null&&(ot=en),oe.baseState=ot,oe.firstBaseUpdate=_t,oe.lastBaseUpdate=zt,ae===null&&(oe.shared.lanes=0),lN|=De,S.lanes=De,S.memoizedState=en}GTe=null}function NT(S,w){if(typeof S!=="function")throw Error("Invalid argument passed as callback. Expected a function. Instead received: "+S);S.call(w)}function pE(S,w){var Q=S.shared.hiddenCallbacks;if(Q!==null)for(S.shared.hiddenCallbacks=null,S=0;S<Q.length;S++)NT(Q[S],w)}function x6(S,w){var Q=S.callbacks;if(Q!==null)for(S.callbacks=null,S=0;S<Q.length;S++)NT(Q[S],w)}function RT(S,w){var Q=O8;J(tge,Q,S),J(aN,w,S),O8=Q|w.baseLanes}function mE(S){J(tge,O8,S),J(aN,aN.current,S)}function QT(S){O8=tge.current,K(aN,S),K(tge,S)}function Y3(S){var w=S.alternate;J(ff,ff.current&wW,S),J(Af,S,S),f2===null&&(w===null||aN.current!==null?f2=S:w.memoizedState!==null&&(f2=S))}function dH(S){J(ff,ff.current,S),J(Af,S,S),f2===null&&(f2=S)}function kT(S){S.tag===22?(J(ff,ff.current,S),J(Af,S,S),f2===null&&(f2=S)):G3(S)}function G3(S){J(ff,ff.current,S),J(Af,Af.current,S)}function Gp(S){K(Af,S),f2===S&&(f2=null),K(ff,S)}function Fg(S,w){J(Af,Af.current,S),J(ff,w,S)}function LT(S){K(ff,S),K(Af,S),f2===S&&(f2=null)}function HT(S){for(var w=S;w!==null;){if(w.tag===13){var Q=w.memoizedState;if(Q!==null&&(Q=Q.dehydrated,Q===null||Wi(Q)||Oc(Q)))return w}else if(w.tag===19&&w.memoizedProps.revealOrder!=="independent"){if((w.flags&128)!==0)return w}else if(w.child!==null){w.child.return=w,w=w.child;continue}if(w===S)break;for(;w.sibling===null;){if(w.return===null||w.return===S)return null;w=w.return}w.sibling.return=w.return,w=w.sibling}return null}function Xs(){var S=zn;NC===null?NC=[S]:NC.push(S)}function Eo(){var S=zn;if(NC!==null&&(oM++,NC[oM]!==S)){var w=Y(_s);if(!Zft.has(w)&&(Zft.add(w),NC!==null)){for(var Q="",W=0;W<=oM;W++){var oe=NC[W],ae=W===oM?S:oe;for(oe=W+1+". "+oe;30>oe.length;)oe+=" ";oe+=ae+`
`,Q+=oe}console.error(`React has detected a change in the order of Hooks called by %s. This will lead to bugs and errors if not fixed. For more information, read the Rules of Hooks: https://react.dev/link/rules-of-hooks

   Previous render            Next render
   ------------------------------------------------------
%s   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
`,w,Q)}}}function C6(S){S===void 0||S===null||a0(S)||console.error("%s received a final argument that is not an array (instead, received `%s`). When specified, the final argument must be an array.",zn,typeof S)}function Nv(){var S=Y(_s);t2t.has(S)||(t2t.add(S),console.error("ReactDOM.useFormState has been renamed to React.useActionState. Please update %s to use React.useActionState.",S))}function Uh(){throw Error(`Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
1. You might have mismatching versions of React and the renderer (such as React DOM)
2. You might be breaking the Rules of Hooks
3. You might have more than one copy of React in the same app
See https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem.`)}function b6(S,w){if(Poe)return!1;if(w===null)return console.error("%s received a final argument during this render, but not during the previous render. Even though the final argument is optional, its type cannot change between renders.",zn),!1;S.length!==w.length&&console.error(`The final argument passed to %s changed size between renders. The order and size of this array must remain constant.

Previous: %s
Incoming: %s`,zn,"["+w.join(", ")+"]","["+S.join(", ")+"]");for(var Q=0;Q<w.length&&Q<S.length;Q++)if(!Q1(S[Q],w[Q]))return!1;return!0}function uH(S,w,Q,W,oe,ae){if(nM=ae,_s=w,NC=S!==null?S._debugHookTypes:null,oM=-1,Poe=S!==null&&S.type!==w.type,Object.prototype.toString.call(Q)==="[object AsyncFunction]"||Object.prototype.toString.call(Q)==="[object AsyncGeneratorFunction]")ae=Y(_s),WTe.has(ae)||(WTe.add(ae),console.error("%s is an async Client Component. Only Server Components can be async at the moment. This error is often caused by accidentally adding `'use client'` to a module that was originally written for the server.",ae===null?"An unknown Component":"<"+ae+">"));w.memoizedState=null,w.updateQueue=null,w.lanes=0,Vn.H=S!==null&&S.memoizedState!==null?jTe:NC!==null?n2t:XTe,AF=ae=(w.mode&A2)!==hs;var De=HTe(Q,W,oe);if(AF=!1,TW&&(De=FT(w,Q,W,oe)),ae){Ct(!0);try{De=FT(w,Q,W,oe)}finally{Ct(!1)}}return pH(S,w),De}function pH(S,w){w._debugHookTypes=NC,w.dependencies===null?k8!==null&&(w.dependencies={lanes:0,firstContext:null,_debugThenableState:k8}):w.dependencies._debugThenableState=k8;var Q=k8;if(mF!==null&&wT(mF,w)&&(Q!==null||ege===null||OTe||(OTe=!0,console.error(ege)),ege=mF=null),Vn.H=rge,Q=Kh!==null&&Kh.next!==null,nM=0,NC=zn=Wm=Kh=_s=null,oM=-1,S!==null&&(S.flags&1206910976)!==(w.flags&1206910976)&&console.error("Internal React error: Expected static flag was missing. Please notify the React team."),nge=!1,Soe=0,k8=null,Q)throw Error("Rendered fewer hooks than expected. This may be caused by an accidental early return statement.");S===null||im||(S=S.dependencies,S!==null&&k5(S)&&(im=!0)),Coe?(Coe=!1,S=!0):S=!1,S&&(w=Y(w)||"Unknown",e2t.has(w)||WTe.has(w)||(e2t.add(w),console.error("`use` was called from inside a try/catch block. This is not allowed and can lead to unexpected behavior. To handle errors triggered by `use`, wrap your component in a error boundary.")))}function FT(S,w,Q,W){_s=S;var oe=0;do{if(TW&&(k8=null),Soe=0,TW=!1,oe>=wfo)throw Error("Too many re-renders. React limits the number of renders to prevent an infinite loop.");if(oe+=1,Poe=!1,Wm=Kh=null,S.updateQueue!=null){var ae=S.updateQueue;ae.lastEffect=null,ae.events=null,ae.stores=null,ae.memoCache!=null&&(ae.memoCache.index=0)}oM=-1,Vn.H=o2t,ae=HTe(w,Q,W)}while(TW);return ae}function SU(){var S=Vn.H,w=S.useState()[0];return w=typeof w.then==="function"?I6(w):w,S=S.useState()[0],(Kh!==null?Kh.memoizedState:null)!==S&&(_s.flags|=1024),w}function zT(){var S=oge!==0;return oge=0,S}function OT(S,w,Q){w.updateQueue=S.updateQueue,w.flags=(w.mode&yI)!==hs?w.flags&-805308421:w.flags&-2053,S.lanes&=~Q}function rf(S){if(nge){for(S=S.memoizedState;S!==null;){var w=S.queue;w!==null&&(w.pending=null),S=S.next}nge=!1}nM=0,NC=Wm=Kh=_s=null,oM=-1,zn=null,TW=!1,Soe=oge=0,k8=null}function Up(){var S={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Wm===null?_s.memoizedState=Wm=S:Wm=Wm.next=S,Wm}function zc(){if(Kh===null){var S=_s.alternate;S=S!==null?S.memoizedState:null}else S=Kh.next;var w=Wm===null?_s.memoizedState:Wm.next;if(w!==null)Wm=w,Kh=S;else{if(S===null){if(_s.alternate===null)throw Error("Update hook called on initial render. This is likely a bug in React. Please file an issue.");throw Error("Rendered more hooks than during the previous render.")}Kh=S,S={memoizedState:Kh.memoizedState,baseState:Kh.baseState,baseQueue:Kh.baseQueue,queue:Kh.queue,next:null},Wm===null?_s.memoizedState=Wm=S:Wm=Wm.next=S}return Wm}function VT(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function I6(S){var w=Soe;return Soe+=1,k8===null&&(k8=aE()),S=cE(k8,S,w,_s),w=_s,(Wm===null?w.memoizedState:Wm.next)===null&&(w=w.alternate,Vn.H=w!==null&&w.memoizedState!==null?jTe:XTe),S}function Ud(S){if(S!==null&&typeof S==="object"){if(typeof S.then==="function")return I6(S);if(S.$$typeof===uTe)return;if(S.$$typeof===fl)return Kc(S)}throw Error("An unsupported type was passed to use(): "+String(S))}function U3(S){var w=null,Q=_s.updateQueue;if(Q!==null&&(w=Q.memoCache),w==null){var W=_s.alternate;W!==null&&(W=W.updateQueue,W!==null&&(W=W.memoCache,W!=null&&(w={data:W.data.map(function(oe){return oe.slice()}),index:0})))}if(w==null&&(w={data:[],index:0}),Q===null&&(Q=VT(),_s.updateQueue=Q),Q.memoCache=w,Q=w.data[w.index],Q===void 0||Poe)for(Q=w.data[w.index]=Array(S),W=0;W<S;W++)Q[W]=r4;else Q.length!==S&&console.error("Expected a constant size argument for each invocation of useMemoCache. The previous cache was allocated with size %s but size %s was requested.",Q.length,S);return w.index++,Q}function Wh(S,w){return typeof w==="function"?w(S):w}function YT(S,w,Q){var W=Up();if(Q!==void 0){var oe=Q(w);if(AF){Ct(!0);try{Q(w)}finally{Ct(!1)}}}else oe=w;return W.memoizedState=W.baseState=oe,S={pending:null,lanes:0,dispatch:null,lastRenderedReducer:S,lastRenderedState:oe},W.queue=S,S=S.dispatch=$c.bind(null,_s,S),[W.memoizedState,S]}function zg(S){var w=zc();return GT(w,Kh,S)}function GT(S,w,Q){var W=S.queue;if(W===null)throw Error("Should have a queue. You are likely calling Hooks conditionally, which is not allowed. (https://react.dev/link/invalid-hook-call)");W.lastRenderedReducer=Q;var oe=S.baseQueue,ae=W.pending;if(ae!==null){if(oe!==null){var De=oe.next;oe.next=ae.next,ae.next=De}w.baseQueue!==oe&&console.error("Internal error: Expected work-in-progress queue to be a clone. This is a bug in React."),w.baseQueue=oe=ae,W.pending=null}if(ae=S.baseState,oe===null)S.memoizedState=ae;else{w=oe.next;var ke=De=null,ot=null,_t=w,zt=!1;do{var en=_t.lane&-536870913;if(en!==_t.lane?(na&en)===en:(nM&en)===en){var Zt=_t.revertLane;if(Zt===0)ot!==null&&(ot=ot.next={lane:0,revertLane:0,gesture:null,action:_t.action,hasEagerState:_t.hasEagerState,eagerState:_t.eagerState,next:null}),en===iN&&(zt=!0);else if((nM&Zt)===Zt){_t=_t.next,Zt===iN&&(zt=!0);continue}else en={lane:0,revertLane:_t.revertLane,gesture:null,action:_t.action,hasEagerState:_t.hasEagerState,eagerState:_t.eagerState,next:null},ot===null?(ke=ot=en,De=ae):ot=ot.next=en,_s.lanes|=Zt,lN|=Zt;en=_t.action,AF&&Q(ae,en),ae=_t.hasEagerState?_t.eagerState:Q(ae,en)}else Zt={lane:en,revertLane:_t.revertLane,gesture:_t.gesture,action:_t.action,hasEagerState:_t.hasEagerState,eagerState:_t.eagerState,next:null},ot===null?(ke=ot=Zt,De=ae):ot=ot.next=Zt,_s.lanes|=en,lN|=en;_t=_t.next}while(_t!==null&&_t!==w);if(ot===null?De=ae:ot.next=ke,!Q1(ae,S.memoizedState)&&(im=!0,zt&&(Q=PW,Q!==null)))throw Q;S.memoizedState=ae,S.baseState=De,S.baseQueue=ot,W.lastRenderedState=ae}return oe===null&&(W.lanes=0),[S.memoizedState,W.dispatch]}function g1(S){var w=zc(),Q=w.queue;if(Q===null)throw Error("Should have a queue. You are likely calling Hooks conditionally, which is not allowed. (https://react.dev/link/invalid-hook-call)");Q.lastRenderedReducer=S;var{dispatch:W,pending:oe}=Q,ae=w.memoizedState;if(oe!==null){Q.pending=null;var De=oe=oe.next;do ae=S(ae,De.action),De=De.next;while(De!==oe);Q1(ae,w.memoizedState)||(im=!0),w.memoizedState=ae,w.baseQueue===null&&(w.baseState=ae),Q.lastRenderedState=ae}return[ae,W]}function UT(S,w,Q){var W=_s,oe=Up();if(Pa){if(Q===void 0)throw Error("Missing getServerSnapshot, which is required for server-rendered content. Will revert to client rendering.");var ae=Q();BW||ae===Q()||(console.error("The result of getServerSnapshot should be cached to avoid an infinite loop"),BW=!0)}else{if(ae=w(),BW||(Q=w(),Q1(ae,Q)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),BW=!0)),$h===null)throw Error("Expected a work-in-progress root. This is a bug in React. Please file an issue.");(na&127)!==0||_l(W,w,ae)}return oe.memoizedState=ae,Q={value:ae,getSnapshot:w},oe.queue=Q,qT(A1.bind(null,W,Q,S),[S]),W.flags|=2048,w6(DC|y2,{destroy:void 0},v6.bind(null,W,Q,ae,w),null),ae}function t2(S,w,Q){var W=_s,oe=zc(),ae=Pa;if(ae){if(Q===void 0)throw Error("Missing getServerSnapshot, which is required for server-rendered content. Will revert to client rendering.");Q=Q()}else if(Q=w(),!BW){var De=w();Q1(Q,De)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),BW=!0)}if(De=!Q1((Kh||oe).memoizedState,Q))oe.memoizedState=Q,im=!0;oe=oe.queue;var ke=A1.bind(null,W,oe,S);if(F_(2048,y2,ke,[S]),S=oe.getSnapshot!==w||De||Wm!==null&&(Wm.memoizedState.tag&DC)!==voe,w6(S?DC|y2:y2,{destroy:void 0},v6.bind(null,W,oe,Q,w),null),S){if(W.flags|=2048,$h===null)throw Error("Expected a work-in-progress root. This is a bug in React. Please file an issue.");ae||(nM&127)!==0||_l(W,w,Q)}return Q}function _l(S,w,Q){S.flags|=16384,S={getSnapshot:w,value:Q},w=_s.updateQueue,w===null?(w=VT(),_s.updateQueue=w,w.stores=[S]):(Q=w.stores,Q===null?w.stores=[S]:Q.push(S))}function v6(S,w,Q,W){w.value=Q,w.getSnapshot=W,R0(w)&&f1(S)}function A1(S,w,Q){return Q(function(){R0(w)&&(ZA(2,"updateSyncExternalStore()",S),f1(S))})}function R0(S){var w=S.getSnapshot;S=S.value;try{var Q=w();return!Q1(S,Q)}catch(W){return!0}}function f1(S){var w=Nn(S,2);w!==null&&Id(w,S,2)}function WT(S){var w=Up();if(typeof S==="function"){var Q=S;if(S=Q(),AF){Ct(!0);try{Q()}finally{Ct(!1)}}}return w.memoizedState=w.baseState=S,w.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Wh,lastRenderedState:S},w}function S6(S){S=WT(S);var w=S.queue,Q=iD.bind(null,_s,w);return w.dispatch=Q,[S.memoizedState,Q]}function H5(S){var w=Up();w.memoizedState=w.baseState=S;var Q={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return w.queue=Q,w=sD.bind(null,_s,!0,Q),Q.dispatch=w,[S,w]}function W3(S,w){var Q=zc();return XT(Q,Kh,S,w)}function XT(S,w,Q,W){return S.baseState=Q,GT(S,Kh,typeof W==="function"?W:Wh)}function X3(S,w){var Q=zc();if(Kh!==null)return XT(Q,Kh,S,w);return Q.baseState=S,[S,Q.queue.dispatch]}function PU(S,w,Q,W,oe){if(sf(S))throw Error("Cannot update action state while rendering.");if(S=w.action,S!==null){var ae={payload:oe,action:S,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(De){ae.listeners.push(De)}};Vn.T!==null?Q(!0):ae.isTransition=!1,W(ae),Q=w.pending,Q===null?(ae.next=w.pending=ae,_E(w,ae)):(ae.next=Q.next,w.pending=Q.next=ae)}}function _E(S,w){var{action:Q,payload:W}=w,oe=S.state;if(w.isTransition){var ae=Vn.T,De={};De.types=ae!==null?ae.types:null,De._updatedFibers=new Set,Vn.T=De;try{var ke=Q(oe,W),ot=Vn.S;ot!==null&&ot(De,ke),jT(S,w,ke)}catch(_t){P6(S,w,_t)}finally{ae!==null&&De.types!==null&&(ae.types!==null&&ae.types!==De.types&&console.error("We expected inner Transitions to have transferred the outer types set and that you cannot add to the outer Transition while inside the inner.This is a bug in React."),ae.types=De.types),Vn.T=ae,ae===null&&De._updatedFibers&&(S=De._updatedFibers.size,De._updatedFibers.clear(),10<S&&console.warn("Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table."))}}else try{De=Q(oe,W),jT(S,w,De)}catch(_t){P6(S,w,_t)}}function jT(S,w,Q){Q!==null&&typeof Q==="object"&&typeof Q.then==="function"?(Vn.asyncTransitions++,Q.then(F5,F5),Q.then(function(W){mH(S,w,W)},function(W){return P6(S,w,W)}),w.isTransition||console.error("An async function with useActionState was called outside of a transition. This is likely not what you intended (for example, isPending will not update correctly). Either call the returned function inside startTransition, or pass it to an `action` or `formAction` prop.")):mH(S,w,Q)}function mH(S,w,Q){w.status="fulfilled",w.value=Q,KT(w),S.state=Q,w=S.pending,w!==null&&(Q=w.next,Q===w?S.pending=null:(Q=Q.next,w.next=Q,_E(S,Q)))}function P6(S,w,Q){var W=S.pending;if(S.pending=null,W!==null){W=W.next;do w.status="rejected",w.reason=Q,KT(w),w=w.next;while(w!==W)}S.action=null}function KT(S){S=S.listeners;for(var w=0;w<S.length;w++)(0,S[w])()}function $T(S,w){return w}function E6(S,w){if(Pa){var Q=$h.formState;if(Q!==null){e:{var W=_s;if(Pa){if(Sd){t:{var oe=Sd;for(var ae=BC;oe.nodeType!==8;){if(!ae){oe=null;break t}if(oe=Jp(oe.nextSibling),oe===null){oe=null;break t}}ae=oe.data,oe=ae===yDe||ae===O2t?oe:null}if(oe){Sd=Jp(oe.nextSibling),W=oe.data===yDe;break e}}kg(W)}W=!1}W&&(w=Q[0])}}return Q=Up(),Q.memoizedState=Q.baseState=w,W={pending:null,lanes:0,dispatch:null,lastRenderedReducer:$T,lastRenderedState:w},Q.queue=W,Q=iD.bind(null,_s,W),W.dispatch=Q,W=WT(!1),ae=sD.bind(null,_s,!1,W.queue),W=Up(),oe={state:w,dispatch:null,action:S,pending:null},W.queue=oe,Q=PU.bind(null,_s,oe,ae,Q),oe.dispatch=Q,W.memoizedState=S,[w,Q,!1]}function M6(S){var w=zc();return EU(w,Kh,S)}function EU(S,w,Q){if(w=GT(S,w,$T)[0],S=zg(Wh)[0],typeof w==="object"&&w!==null&&typeof w.then==="function")try{var W=I6(w)}catch(De){if(De===EW)throw J_e;throw De}else W=w;w=zc();var oe=w.queue,ae=oe.dispatch;return Q!==w.memoizedState&&(_s.flags|=2048,w6(DC|y2,{destroy:void 0},MU.bind(null,oe,Q),null)),[W,ae,S]}function MU(S,w){S.action=w}function Lm(S){var w=zc(),Q=Kh;if(Q!==null)return EU(w,Q,S);zc(),w=w.memoizedState,Q=zc();var W=Q.queue.dispatch;return Q.memoizedState=S,[w,W,!1]}function w6(S,w,Q,W){return S={tag:S,create:Q,deps:W,inst:w,next:null},w=_s.updateQueue,w===null&&(w=VT(),_s.updateQueue=w),Q=w.lastEffect,Q===null?w.lastEffect=S.next=S:(W=Q.next,Q.next=S,S.next=W,w.lastEffect=S),S}function xd(S){var w=Up();return S={current:S},w.memoizedState=S}function j3(S,w,Q,W){var oe=Up();_s.flags|=S,oe.memoizedState=w6(DC|w,{destroy:void 0},Q,W===void 0?null:W)}function F_(S,w,Q,W){var oe=zc();W=W===void 0?null:W;var ae=oe.memoizedState.inst;Kh!==null&&W!==null&&b6(W,Kh.memoizedState.deps)?oe.memoizedState=w6(w,ae,Q,W):(_s.flags|=S,oe.memoizedState=w6(DC|w,ae,Q,W))}function qT(S,w){(_s.mode&yI)!==hs?j3(545261568,y2,S,w):j3(8390656,y2,S,w)}function K3(S){_s.flags|=4;var w=_s.updateQueue;if(w===null)w=VT(),_s.updateQueue=w,w.events=[S];else{var Q=w.events;Q===null?w.events=[S]:Q.push(S)}}function B6(S){var w=Up(),Q={impl:S};return w.memoizedState=Q,function(){if((Vc&q_)!==tA)throw Error("A function wrapped in useEffectEvent can't be called during rendering.");return Q.impl.apply(void 0,arguments)}}function $3(S){var w=zc().memoizedState;return K3({ref:w,nextImpl:S}),function(){if((Vc&q_)!==tA)throw Error("A function wrapped in useEffectEvent can't be called during rendering.");return w.impl.apply(void 0,arguments)}}function q3(S,w){var Q=4194308;return(_s.mode&yI)!==hs&&(Q|=268435456),j3(Q,c4,S,w)}function _H(S,w){if(typeof w==="function"){S=S();var Q=w(S);return function(){typeof Q==="function"?Q():w(null)}}if(w!==null&&w!==void 0)return w.hasOwnProperty("current")||console.error("Expected useImperativeHandle() first argument to either be a ref callback or React.createRef() object. Instead received: %s.","an object with keys {"+Object.keys(w).join(", ")+"}"),S=S(),w.current=S,function(){w.current=null}}function JT(S,w,Q){typeof w!=="function"&&console.error("Expected useImperativeHandle() second argument to be a function that creates a handle. Instead received: %s.",w!==null?typeof w:"null"),Q=Q!==null&&Q!==void 0?Q.concat([S]):null;var W=4194308;(_s.mode&yI)!==hs&&(W|=268435456),j3(W,c4,_H.bind(null,w,S),Q)}function gE(S,w,Q){typeof w!=="function"&&console.error("Expected useImperativeHandle() second argument to be a function that creates a handle. Instead received: %s.",w!==null?typeof w:"null"),Q=Q!==null&&Q!==void 0?Q.concat([S]):null,F_(4,c4,_H.bind(null,w,S),Q)}function ZT(S,w){return Up().memoizedState=[S,w===void 0?null:w],S}function Rv(S,w){var Q=zc();w=w===void 0?null:w;var W=Q.memoizedState;if(w!==null&&b6(w,W[1]))return W[0];return Q.memoizedState=[S,w],S}function Qv(S,w){var Q=Up();w=w===void 0?null:w;var W=S();if(AF){Ct(!0);try{S()}finally{Ct(!1)}}return Q.memoizedState=[W,w],W}function kv(S,w){var Q=zc();w=w===void 0?null:w;var W=Q.memoizedState;if(w!==null&&b6(w,W[1]))return W[0];if(W=S(),AF){Ct(!0);try{S()}finally{Ct(!1)}}return Q.memoizedState=[W,w],W}function Lv(S,w){var Q=Up();return tD(Q,S,w)}function wU(S,w){var Q=zc();return nD(Q,Kh.memoizedState,S,w)}function eD(S,w){var Q=zc();return Kh===null?tD(Q,S,w):nD(Q,Kh.memoizedState,S,w)}function tD(S,w,Q){if(Q===void 0||(nM&1073741824)!==0&&(na&261930)===0)return S.memoizedState=w;return S.memoizedState=Q,S=ID(),_s.lanes|=S,lN|=S,Q}function nD(S,w,Q,W){if(Q1(Q,w))return Q;if(aN.current!==null)return S=tD(S,Q,W),Q1(S,w)||(im=!0),S;if((nM&106)===0||(nM&1073741824)!==0&&(na&261930)===0)return im=!0,S.memoizedState=Q;return S=ID(),_s.lanes|=S,lN|=S,w}function F5(){Vn.asyncTransitions--}function AE(S,w,Q,W,oe){var ae=Dc.p;Dc.p=ae!==0&&ae<Ym?ae:Ym;var De=Vn.T,ke={};ke.types=De!==null?De.types:null,ke._updatedFibers=new Set,Vn.T=ke,sD(S,!1,w,Q);try{var ot=oe(),_t=Vn.S;if(_t!==null&&_t(ke,ot),ot!==null&&typeof ot==="object"&&typeof ot.then==="function"){Vn.asyncTransitions++,ot.then(F5,F5);var zt=vU(ot,W);xE(S,w,zt,Xp(S))}else xE(S,w,W,Xp(S))}catch(en){xE(S,w,{then:function(){},status:"rejected",reason:en},Xp(S))}finally{Dc.p=ae,De!==null&&ke.types!==null&&(De.types!==null&&De.types!==ke.types&&console.error("We expected inner Transitions to have transferred the outer types set and that you cannot add to the outer Transition while inside the inner.This is a bug in React."),De.types=ke.types),Vn.T=De,De===null&&ke._updatedFibers&&(S=ke._updatedFibers.size,ke._updatedFibers.clear(),10<S&&console.warn("Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table."))}}function oD(S,w,Q,W){if(S.tag!==5)throw Error("Expected the form instance to be a HostComponent. This is a bug in React.");var oe=fE(S).queue;iH(S),AE(S,oe,w,BF,Q===null?l:function(){return gH(S),Q(W)})}function fE(S){var w=S.memoizedState;if(w!==null)return w;w={memoizedState:BF,baseState:BF,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Wh,lastRenderedState:BF},next:null};var Q={};return w.next={memoizedState:Q,baseState:Q,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Wh,lastRenderedState:Q},next:null},S.memoizedState=w,S=S.alternate,S!==null&&(S.memoizedState=w),w}function gH(S){Vn.T===null&&console.error("requestFormReset was called outside a transition or action. To fix, move to an action, or wrap with startTransition.");var w=fE(S);w.next===null&&(w=S.alternate.memoizedState),xE(S,w.next.queue,{},Xp(S))}function yE(){var S=WT(!1);return S=AE.bind(null,_s,S.queue,!0,!1),Up().memoizedState=S,[!1,S]}function AH(){var S=zg(Wh)[0],w=zc().memoizedState;return[typeof S==="boolean"?S:I6(S),w]}function BU(){var S=g1(Wh)[0],w=zc().memoizedState;return[typeof S==="boolean"?S:I6(S),w]}function z5(){return Kc(WW)}function J3(){var S=Up(),w=$h.identifierPrefix;if(Pa){var Q=JE,W=qE;Q=(W&~(1<<32-Wl(W)-1)).toString(32)+Q,w="_"+w+"R_"+Q,Q=oge++,0<Q&&(w+="H"+Q.toString(32)),w+="_"}else Q=Mfo++,w="_"+w+"r_"+Q.toString(32)+"_";return S.memoizedState=w}function rD(){return Up().memoizedState=TU.bind(null,_s)}function TU(S,w){for(var Q=S.return;Q!==null;){switch(Q.tag){case 24:case 3:var W=Xp(Q),oe=Fc(W),ae=V3(Q,oe,W);ae!==null&&(ZA(W,"refresh()",S),Id(ae,Q,W),dE(ae,Q,W)),S=Wy(),w!==null&&w!==void 0&&ae!==null&&console.error("The seed argument is not enabled outside experimental channels."),oe.payload={cache:S};return}Q=Q.return}}function $c(S,w,Q){var W=arguments;typeof W[3]==="function"&&console.error("State updates from the useState() and useReducer() Hooks don't support the second callback argument. To execute a side effect after rendering, declare it in the component body with useEffect()."),W=Xp(S);var oe={lane:W,revertLane:0,gesture:null,action:Q,hasEagerState:!1,eagerState:null,next:null};sf(S)?DU(w,oe):(oe=Pn(S,w,oe,W),oe!==null&&(ZA(W,"dispatch()",S),Id(oe,S,W),aD(oe,w,W)))}function iD(S,w,Q){var W=arguments;typeof W[3]==="function"&&console.error("State updates from the useState() and useReducer() Hooks don't support the second callback argument. To execute a side effect after rendering, declare it in the component body with useEffect()."),W=Xp(S),xE(S,w,Q,W)&&ZA(W,"setState()",S)}function xE(S,w,Q,W){var oe={lane:W,revertLane:0,gesture:null,action:Q,hasEagerState:!1,eagerState:null,next:null};if(sf(S))DU(w,oe);else{var ae=S.alternate;if(S.lanes===0&&(ae===null||ae.lanes===0)&&(ae=w.lastRenderedReducer,ae!==null)){var De=Vn.H;Vn.H=II;try{var ke=w.lastRenderedState,ot=ae(ke,Q);if(oe.hasEagerState=!0,oe.eagerState=ot,Q1(ot,ke))return yn(S,w,oe,0),$h===null&&Jt(),!1}catch(_t){}finally{Vn.H=De}}if(Q=Pn(S,w,oe,W),Q!==null)return Id(Q,S,W),aD(Q,w,W),!0}return!1}function sD(S,w,Q,W){if(Vn.T===null&&iN===0&&console.error("An optimistic state update occurred outside a transition or action. To fix, move the update to an action, or wrap with startTransition."),W={lane:2,revertLane:Y5(),gesture:null,action:W,hasEagerState:!1,eagerState:null,next:null},sf(S)){if(w)throw Error("Cannot update optimistic state while rendering.");console.error("Cannot call startTransition while rendering.")}else w=Pn(S,Q,W,2),w!==null&&(ZA(2,"setOptimistic()",S),Id(w,S,2))}function sf(S){var w=S.alternate;return S===_s||w!==null&&w===_s}function DU(S,w){TW=nge=!0;var Q=S.pending;Q===null?w.next=w:(w.next=Q.next,Q.next=w),S.pending=w}function aD(S,w,Q){if((Q&4194048)!==0){var W=w.lanes;W&=S.pendingLanes,Q|=W,w.lanes=Q,ft(S,Q)}}function cD(S){if(S!==null&&typeof S!=="function"){var w=String(S);m2t.has(w)||(m2t.add(w),console.error("Expected the last optional `callback` argument to be a function. Instead received: %s.",S))}}function lD(S,w,Q,W){var oe=S.memoizedState,ae=Q(W,oe);if(S.mode&A2){Ct(!0);try{ae=Q(W,oe)}finally{Ct(!1)}}ae===void 0&&(w=U(w)||"Component",h2t.has(w)||(h2t.add(w),console.error("%s.getDerivedStateFromProps(): A valid state object (or null) must be returned. You have returned undefined.",w))),oe=ae===null||ae===void 0?oe:ta({},oe,ae),S.memoizedState=oe,S.lanes===0&&(S.updateQueue.baseState=oe)}function fH(S,w,Q,W,oe,ae,De){var ke=S.stateNode;if(typeof ke.shouldComponentUpdate==="function"){if(Q=ke.shouldComponentUpdate(W,ae,De),S.mode&A2){Ct(!0);try{Q=ke.shouldComponentUpdate(W,ae,De)}finally{Ct(!1)}}return Q===void 0&&console.error("%s.shouldComponentUpdate(): Returned undefined instead of a boolean value. Make sure to return true or false.",U(w)||"Component"),Q}return w.prototype&&w.prototype.isPureReactComponent?!M5(Q,W)||!M5(oe,ae):!0}function Hv(S,w,Q,W){var oe=w.state;typeof w.componentWillReceiveProps==="function"&&w.componentWillReceiveProps(Q,W),typeof w.UNSAFE_componentWillReceiveProps==="function"&&w.UNSAFE_componentWillReceiveProps(Q,W),w.state!==oe&&(S=Y(S)||"Component",i2t.has(S)||(i2t.add(S),console.error("%s.componentWillReceiveProps(): Assigning directly to this.state is deprecated (except inside a component's constructor). Use setState instead.",S)),KTe.enqueueReplaceState(w,w.state,null))}function T6(S,w){var Q=w;if("ref"in w){Q={};for(var W in w)W!=="ref"&&(Q[W]=w[W])}if(S=S.defaultProps){Q===w&&(Q=ta({},Q));for(var oe in S)Q[oe]===void 0&&(Q[oe]=S[oe])}return Q}function Z3(S){ITe(S),console.warn(`%s

%s
`,DW?"An error occurred in the <"+DW+"> component.":"An error occurred in one of your React components.",`Consider adding an error boundary to your tree to customize error handling behavior.
Visit https://react.dev/link/error-boundaries to learn more about error boundaries.`)}function eC(S){var w=DW?"The above error occurred in the <"+DW+"> component.":"The above error occurred in one of your React components.",Q="React will try to recreate this component tree from scratch using the error boundary you provided, "+(($Te||"Anonymous")+".");if(typeof S==="object"&&S!==null&&typeof S.environmentName==="string"){var W=S.environmentName;S=[`%o

%s

%s
`,S,w,Q].slice(0),typeof S[0]==="string"?S.splice(0,1,q2t+" "+S[0],J2t,Qge+W+Qge,Z2t):S.splice(0,0,q2t,J2t,Qge+W+Qge,Z2t),S.unshift(console),W=$fo.apply(console.error,S),W()}else console.error(`%o

%s

%s
`,S,w,Q)}function hD(S){ITe(S)}function Fv(S,w){try{DW=w.source?Y(w.source):null,$Te=null;var Q=w.value;if(Vn.actQueue!==null)Vn.thrownErrors.push(Q);else{var W=S.onUncaughtError;W(Q,{componentStack:w.stack})}}catch(oe){setTimeout(function(){throw oe})}}function yH(S,w,Q){try{DW=Q.source?Y(Q.source):null,$Te=Y(w);var W=S.onCaughtError;W(Q.value,{componentStack:Q.stack,errorBoundary:w.tag===1?w.stateNode:null})}catch(oe){setTimeout(function(){throw oe})}}function CE(S,w,Q){return Q=Fc(Q),Q.tag=YTe,Q.payload={element:null},Q.callback=function(){ye(w.source,Fv,S,w)},Q}function bE(S){return S=Fc(S),S.tag=YTe,S}function zv(S,w,Q,W){var oe=Q.type.getDerivedStateFromError;if(typeof oe==="function"){var ae=W.value;S.payload=function(){return oe(ae)},S.callback=function(){Gs(Q),ye(W.source,yH,w,Q,W)}}var De=Q.stateNode;De!==null&&typeof De.componentDidCatch==="function"&&(S.callback=function(){Gs(Q),ye(W.source,yH,w,Q,W),typeof oe!=="function"&&(dN===null?dN=new Set([this]):dN.add(this)),vfo(this,W),typeof oe==="function"||(Q.lanes&2)===0&&console.error("%s: Error boundaries should implement getDerivedStateFromError(). In that method, return a state update to display an error message or fallback UI.",Y(Q)||"Unknown")})}function Ky(S,w,Q,W,oe){if(Q.flags|=32768,g2&&tx(S,oe),W!==null&&typeof W==="object"&&typeof W.then==="function"){if(w=Q.alternate,w!==null&&Gy(w,Q,oe,!0),Pa&&(R8=!0),Q=Af.current,Q!==null){switch(Q.tag){case 31:case 13:case 19:return f2===null?BE():Q.alternate===null&&l0===rM&&(l0=hge),Q.flags&=-257,Q.flags|=65536,Q.lanes=oe,W===Z_e?Q.flags|=16384:(w=Q.updateQueue,w===null?Q.updateQueue=new Set([W]):w.add(W),zH(S,W,oe)),!1;case 22:return Q.flags|=65536,W===Z_e?Q.flags|=16384:(w=Q.updateQueue,w===null?(w={transitions:null,markerInstances:null,retryQueue:new Set([W])},Q.updateQueue=w):(Q=w.retryQueue,Q===null?w.retryQueue=new Set([W]):Q.add(W)),zH(S,W,oe)),!1}throw Error("Unexpected Suspense handler tag ("+Q.tag+"). This is a bug in React.")}return zH(S,W,oe),BE(),!1}if(Pa)return R8=!0,w=Af.current,w!==null?(w.tag===19&&console.error("SuspenseList should never catch while hydrating. This is a bug in React."),(w.flags&65536)===0&&(w.flags|=256),w.flags|=65536,w.lanes=oe,W!==wTe&&R5(rs(Error("There was an error while hydrating but React was able to recover by instead client rendering from the nearest Suspense boundary.",{cause:W}),Q))):(W!==wTe&&R5(rs(Error("There was an error while hydrating but React was able to recover by instead client rendering the entire root.",{cause:W}),Q)),S=S.current.alternate,S.flags|=65536,oe&=-oe,S.lanes|=oe,W=rs(W,Q),oe=CE(S.stateNode,W,oe),uE(S,oe),l0!==cN&&(l0=yF)),!1;var ae=rs(Error("There was an error during concurrent rendering but React was able to recover by instead synchronously rendering the entire root.",{cause:W}),Q);if(Roe===null?Roe=[ae]:Roe.push(ae),l0!==cN&&(l0=yF),w===null)return!0;W=rs(W,Q),Q=w;do{switch(Q.tag){case 3:return Q.flags|=65536,S=oe&-oe,Q.lanes|=S,S=CE(Q.stateNode,W,S),uE(Q,S),!1;case 1:if(w=Q.type,ae=Q.stateNode,(Q.flags&128)===0&&(typeof w.getDerivedStateFromError==="function"||ae!==null&&typeof ae.componentDidCatch==="function"&&(dN===null||!dN.has(ae))))return Q.flags|=65536,oe&=-oe,Q.lanes|=oe,oe=bE(oe),zv(oe,S,Q,W),uE(Q,oe),!1;break;case 22:if(Q.memoizedState!==null)return Q.flags|=65536,!1}Q=Q.return}while(Q!==null);return!1}function i0(S,w,Q,W){w.child=S===null?jft(w,null,Q,W):gF(w,S.child,Q,W)}function dD(S,w,Q,W,oe){Q=Q.render;var ae=$o(Q);if(ae!==Q&&(Q=ae,S!==null&&(im=!0)),ae=w.ref,"ref"in W){var De={};for(var ke in W)ke!=="ref"&&(De[ke]=W[ke])}else De=W;if(Uy(w),W=uH(S,w,Q,De,ae,oe),ke=zT(),S!==null&&!im)return OT(S,w,oe),C1(S,w,oe);return Pa&&ke&&L_(w),w.flags|=1,i0(S,w,W,oe),w.child}function IE(S,w,Q,W,oe){if(S===null){var ae=Q.type;if(typeof ae==="function"&&!Us(ae)&&ae.defaultProps===void 0&&Q.compare===null)return Q=$o(ae),w.tag=15,w.type=Q,xH(w,ae),y1(S,w,Q,W,oe);return S=Xt(Q.type,null,W,w,w.mode,oe),S.ref=w.ref,S.return=w,w.child=S}if(ae=S.child,!Ai(S,oe)){var De=ae.memoizedProps;if(Q=Q.compare,Q=Q!==null?Q:M5,Q(De,W)&&S.ref===w.ref)return C1(S,w,oe)}return w.flags|=1,S=sc(ae,W),S.ref=w.ref,S.return=w,w.child=S}function y1(S,w,Q,W,oe){if(S!==null){var ae=S.memoizedProps;if(M5(ae,W)&&S.ref===w.ref&&w.type===S.type)if(im=!1,w.pendingProps=W=ae,Ai(S,oe))(S.flags&131072)!==0&&(im=!0);else return w.lanes=S.lanes,C1(S,w,oe)}return Og(S,w,Q,W,oe)}function O5(S,w,Q,W){var oe=W.children,ae=S!==null?S.memoizedState:null;if(S===null&&w.stateNode===null&&(w.stateNode={_visibility:soe,_pendingMarkers:null,_retryCache:null,_transitions:null}),W.mode==="hidden"){if((w.flags&128)!==0){if(ae=ae!==null?ae.baseLanes|Q:Q,S!==null){W=w.child=S.child;for(oe=0;W!==null;)oe=oe|W.lanes|W.childLanes,W=W.sibling;W=oe&~ae}else W=0,w.child=null;return Ov(S,w,ae,Q,W)}if((Q&536870912)!==0)w.memoizedState={baseLanes:0,cachePool:null},S!==null&&Mv(w,ae!==null?ae.cachePool:null),ae!==null?RT(w,ae):mE(w),kT(w);else return W=w.lanes=536870912,Ov(S,w,ae!==null?ae.baseLanes|Q:Q,Q,W)}else ae!==null?(Mv(w,ae.cachePool),RT(w,ae),G3(w),w.memoizedState=null):(S!==null&&Mv(w,null),mE(w),G3(w));return i0(S,w,oe,Q),w.child}function Cd(S,w){return S!==null&&S.tag===22||w.stateNode!==null||(w.stateNode={_visibility:soe,_pendingMarkers:null,_retryCache:null,_transitions:null}),w.sibling}function Ov(S,w,Q,W,oe){var ae=sE();return ae=ae===null?null:{parent:Um._currentValue,pool:ae},w.memoizedState={baseLanes:Q,cachePool:ae},S!==null&&Mv(w,null),mE(w),kT(w),S!==null&&Gy(S,w,W,!0),w.childLanes=oe,null}function vE(S,w){var Q=w.hidden;return Q!==void 0&&console.error(`<Activity> doesn't accept a hidden prop. Use mode="hidden" instead.
- <Activity %s>
+ <Activity %s>`,Q===!0?"hidden":Q===!1?"hidden={false}":"hidden={...}",Q?'mode="hidden"':'mode="visible"'),w=$y({mode:w.mode,children:w.children},S.mode),w.ref=S.ref,S.child=w,w.return=S,w}function Li(S,w,Q){return gF(w,S.child,null,Q),S=vE(w,w.pendingProps),S.flags|=2,Gp(w),w.memoizedState=null,S}function NU(S,w,Q){var W=w.pendingProps,oe=(w.flags&128)!==0;if(w.flags&=-129,S===null){if(Pa){if(W.mode==="hidden")return S=vE(w,W),w.lanes=536870912,S.memoizedState={baseLanes:0,cachePool:null},Cd(null,S);if(dH(w),(S=Sd)?(Q=q5(S,BC),Q=Q!==null&&Q.data===PF?Q:null,Q!==null&&(W={dehydrated:Q,treeContext:ml(),retryLane:536870912,hydrationErrors:null},w.memoizedState=W,W=ci(Q),W.return=w,w.child=W,qg=w,Sd=null)):Q=null,Q===null)throw nE(w,S),kg(w);return w.lanes=536870912,null}return vE(w,W)}var ae=S.memoizedState;if(ae!==null){var De=ae.dehydrated;if(dH(w),oe)if(w.flags&256)w.flags&=-257,w=Li(S,w,Q);else if(w.memoizedState!==null)w.child=S.child,w.flags|=128,w=null;else throw Error("Client rendering an Activity suspended it again. This is a bug in React.");else if(oH(),(Q&536870912)!==0&&SD(w),im||Gy(S,w,Q,!1),oe=(Q&S.childLanes)!==0,im||oe){if(aN.current===null){if(W=$h,W!==null&&(De=vt(W,Q),De!==0&&De!==ae.retryLane))throw ae.retryLane=De,Nn(S,De),Id(W,S,De),qTe;BE()}w=Li(S,w,Q)}else S=ae.treeContext,Sd=Jp(De.nextSibling),qg=w,Pa=!0,eN=null,R8=!1,a4=null,BC=!1,S!==null&&tE(w,S),w=vE(w,W),w.flags|=134221824;return w}return ae=S.child,W={mode:W.mode,children:W.children},(Q&536870912)!==0&&(Q&S.lanes)!==0&&SD(w),S=sc(ae,W),S.ref=w.ref,w.child=S,S.return=w,S}function D6(S,w){var Q=w.ref;if(Q===null)S!==null&&S.ref!==null&&(w.flags|=4194816);else{if(typeof Q!=="function"&&typeof Q!=="object")throw Error("Expected ref to be a function, an object returned by React.createRef(), or undefined/null.");if(S===null||S.ref!==Q)w.flags|=4194816}}function Og(S,w,Q,W,oe){if(Q.prototype&&typeof Q.prototype.render==="function"){var ae=U(Q)||"Unknown";_2t[ae]||(console.error("The <%s /> component appears to have a render method, but doesn't extend React.Component. This is likely to cause errors. Change %s to extend React.Component instead.",ae,ae),_2t[ae]=!0)}if(w.mode&A2&&bI.recordLegacyContextWarning(w,null),S===null&&(xH(w,w.type),Q.contextTypes&&(ae=U(Q)||"Unknown",A2t[ae]||(A2t[ae]=!0,console.error("%s uses the legacy contextTypes API which was removed in React 19. Use React.createContext() with React.useContext() instead. (https://react.dev/link/legacy-context)",ae)))),Uy(w),Q=uH(S,w,Q,W,void 0,oe),W=zT(),S!==null&&!im)return OT(S,w,oe),C1(S,w,oe);return Pa&&W&&L_(w),w.flags|=1,i0(S,w,Q,oe),w.child}function uD(S,w,Q,W,oe,ae){if(Uy(w),oM=-1,Poe=S!==null&&S.type!==w.type,w.updateQueue=null,Q=FT(w,W,Q,oe),pH(S,w),W=zT(),S!==null&&!im)return OT(S,w,ae),C1(S,w,ae);return Pa&&W&&L_(w),w.flags|=1,i0(S,w,Q,ae),w.child}function z_(S,w,Q,W,oe){switch(s(w)){case!1:var ae=w.stateNode,De=new w.type(w.memoizedProps,ae.context).state;ae.updater.enqueueSetState(ae,De,null);break;case!0:w.flags|=128,w.flags|=65536,ae=Error("Simulated error coming from DevTools");var ke=oe&-oe;if(w.lanes|=ke,De=$h,De===null)throw Error("Expected a work-in-progress root. This is a bug in React. Please file an issue.");ke=bE(ke),zv(ke,De,w,rs(ae,w)),uE(w,ke)}if(Uy(w),w.stateNode===null){if(De=ZD,ae=Q.contextType,"contextType"in Q&&ae!==null&&(ae===void 0||ae.$$typeof!==fl)&&!p2t.has(Q)&&(p2t.add(Q),ke=ae===void 0?" However, it is set to undefined. This can be caused by a typo or by mixing up named and default imports. This can also happen due to a circular dependency, so try moving the createContext() call to a separate file.":typeof ae!=="object"?" However, it is set to a "+typeof ae+".":ae.$$typeof===o4?" Did you accidentally pass the Context.Consumer instead?":" However, it is set to an object with keys {"+Object.keys(ae).join(", ")+"}.",console.error("%s defines an invalid contextType. contextType should point to the Context object returned by React.createContext().%s",U(Q)||"Component",ke)),typeof ae==="object"&&ae!==null&&(De=Kc(ae)),ae=new Q(W,De),w.mode&A2){Ct(!0);try{ae=new Q(W,De)}finally{Ct(!1)}}if(De=w.memoizedState=ae.state!==null&&ae.state!==void 0?ae.state:null,ae.updater=KTe,w.stateNode=ae,ae._reactInternals=w,ae._reactInternalInstance=r2t,typeof Q.getDerivedStateFromProps==="function"&&De===null&&(De=U(Q)||"Component",s2t.has(De)||(s2t.add(De),console.error("`%s` uses `getDerivedStateFromProps` but its initial state is %s. This is not recommended. Instead, define the initial state by assigning an object to `this.state` in the constructor of `%s`. This ensures that `getDerivedStateFromProps` arguments have a consistent shape.",De,ae.state===null?"null":"undefined",De))),typeof Q.getDerivedStateFromProps==="function"||typeof ae.getSnapshotBeforeUpdate==="function"){var ot=ke=De=null;if(typeof ae.componentWillMount==="function"&&ae.componentWillMount.__suppressDeprecationWarning!==!0?De="componentWillMount":typeof ae.UNSAFE_componentWillMount==="function"&&(De="UNSAFE_componentWillMount"),typeof ae.componentWillReceiveProps==="function"&&ae.componentWillReceiveProps.__suppressDeprecationWarning!==!0?ke="componentWillReceiveProps":typeof ae.UNSAFE_componentWillReceiveProps==="function"&&(ke="UNSAFE_componentWillReceiveProps"),typeof ae.componentWillUpdate==="function"&&ae.componentWillUpdate.__suppressDeprecationWarning!==!0?ot="componentWillUpdate":typeof ae.UNSAFE_componentWillUpdate==="function"&&(ot="UNSAFE_componentWillUpdate"),De!==null||ke!==null||ot!==null){ae=U(Q)||"Component";var _t=typeof Q.getDerivedStateFromProps==="function"?"getDerivedStateFromProps()":"getSnapshotBeforeUpdate()";c2t.has(ae)||(c2t.add(ae),console.error(`Unsafe legacy lifecycles will not be called for components using new component APIs.

%s uses %s but also contains the following legacy lifecycles:%s%s%s

The above lifecycles should be removed. Learn more about this warning here:
https://react.dev/link/unsafe-component-lifecycles`,ae,_t,De!==null?`
  `+De:"",ke!==null?`
  `+ke:"",ot!==null?`
  `+ot:""))}}ae=w.stateNode,De=U(Q)||"Component",ae.render||(Q.prototype&&typeof Q.prototype.render==="function"?console.error("No `render` method found on the %s instance: did you accidentally return an object from the constructor?",De):console.error("No `render` method found on the %s instance: you may have forgotten to define `render`.",De)),!ae.getInitialState||ae.getInitialState.isReactClassApproved||ae.state||console.error("getInitialState was defined on %s, a plain JavaScript class. This is only supported for classes created using React.createClass. Did you mean to define a state property instead?",De),ae.getDefaultProps&&!ae.getDefaultProps.isReactClassApproved&&console.error("getDefaultProps was defined on %s, a plain JavaScript class. This is only supported for classes created using React.createClass. Use a static property to define defaultProps instead.",De),ae.contextType&&console.error("contextType was defined as an instance property on %s. Use a static property to define contextType instead.",De),Q.childContextTypes&&!u2t.has(Q)&&(u2t.add(Q),console.error("%s uses the legacy childContextTypes API which was removed in React 19. Use React.createContext() instead. (https://react.dev/link/legacy-context)",De)),Q.contextTypes&&!d2t.has(Q)&&(d2t.add(Q),console.error("%s uses the legacy contextTypes API which was removed in React 19. Use React.createContext() with static contextType instead. (https://react.dev/link/legacy-context)",De)),typeof ae.componentShouldUpdate==="function"&&console.error("%s has a method called componentShouldUpdate(). Did you mean shouldComponentUpdate()? The name is phrased as a question because the function is expected to return a value.",De),Q.prototype&&Q.prototype.isPureReactComponent&&typeof ae.shouldComponentUpdate<"u"&&console.error("%s has a method called shouldComponentUpdate(). shouldComponentUpdate should not be used when extending React.PureComponent. Please extend React.Component if shouldComponentUpdate is used.",U(Q)||"A pure component"),typeof ae.componentDidUnmount==="function"&&console.error("%s has a method called componentDidUnmount(). But there is no such lifecycle method. Did you mean componentWillUnmount()?",De),typeof ae.componentDidReceiveProps==="function"&&console.error("%s has a method called componentDidReceiveProps(). But there is no such lifecycle method. If you meant to update the state in response to changing props, use componentWillReceiveProps(). If you meant to fetch data or run side-effects or mutations after React has updated the UI, use componentDidUpdate().",De),typeof ae.componentWillRecieveProps==="function"&&console.error("%s has a method called componentWillRecieveProps(). Did you mean componentWillReceiveProps()?",De),typeof ae.UNSAFE_componentWillRecieveProps==="function"&&console.error("%s has a method called UNSAFE_componentWillRecieveProps(). Did you mean UNSAFE_componentWillReceiveProps()?",De),ke=ae.props!==W,ae.props!==void 0&&ke&&console.error("When calling super() in `%s`, make sure to pass up the same props that your component's constructor was passed.",De),ae.defaultProps&&console.error("Setting defaultProps as an instance property on %s is not supported and will be ignored. Instead, define defaultProps as a static property on %s.",De,De),typeof ae.getSnapshotBeforeUpdate!=="function"||typeof ae.componentDidUpdate==="function"||a2t.has(Q)||(a2t.add(Q),console.error("%s: getSnapshotBeforeUpdate() should be used with componentDidUpdate(). This component defines getSnapshotBeforeUpdate() only.",U(Q))),typeof ae.getDerivedStateFromProps==="function"&&console.error("%s: getDerivedStateFromProps() is defined as an instance method and will be ignored. Instead, declare it as a static method.",De),typeof ae.getDerivedStateFromError==="function"&&console.error("%s: getDerivedStateFromError() is defined as an instance method and will be ignored. Instead, declare it as a static method.",De),typeof Q.getSnapshotBeforeUpdate==="function"&&console.error("%s: getSnapshotBeforeUpdate() is defined as a static method and will be ignored. Instead, declare it as an instance method.",De),(ke=ae.state)&&(typeof ke!=="object"||a0(ke))&&console.error("%s.state: must be set to an object or null",De),typeof ae.getChildContext==="function"&&typeof Q.childContextTypes!=="object"&&console.error("%s.getChildContext(): childContextTypes must be defined in order to use getChildContext().",De),ae=w.stateNode,ae.props=W,ae.state=w.memoizedState,ae.refs={},Tv(w),De=Q.contextType,ae.context=typeof De==="object"&&De!==null?Kc(De):ZD,ae.state===W&&(De=U(Q)||"Component",l2t.has(De)||(l2t.add(De),console.error("%s: It is not recommended to assign props directly to state because updates to props won't be reflected in state. In most cases, it is better to use props directly.",De))),w.mode&A2&&bI.recordLegacyContextWarning(w,ae),bI.recordUnsafeLifecycleWarnings(w,ae),ae.state=w.memoizedState,De=Q.getDerivedStateFromProps,typeof De==="function"&&(lD(w,Q,De,W),ae.state=w.memoizedState),typeof Q.getDerivedStateFromProps==="function"||typeof ae.getSnapshotBeforeUpdate==="function"||typeof ae.UNSAFE_componentWillMount!=="function"&&typeof ae.componentWillMount!=="function"||(De=ae.state,typeof ae.componentWillMount==="function"&&ae.componentWillMount(),typeof ae.UNSAFE_componentWillMount==="function"&&ae.UNSAFE_componentWillMount(),De!==ae.state&&(console.error("%s.componentWillMount(): Assigning directly to this.state is deprecated (except inside a component's constructor). Use setState instead.",Y(w)||"Component"),KTe.enqueueReplaceState(ae,ae.state,null)),Dv(w,W,ae,oe),Hg(),ae.state=w.memoizedState),typeof ae.componentDidMount==="function"&&(w.flags|=4194308),(w.mode&yI)!==hs&&(w.flags|=268435456),ae=!0}else if(S===null){ae=w.stateNode;var zt=w.memoizedProps;ke=T6(Q,zt),ae.props=ke;var en=ae.context;ot=Q.contextType,De=ZD,typeof ot==="object"&&ot!==null&&(De=Kc(ot)),_t=Q.getDerivedStateFromProps,ot=typeof _t==="function"||typeof ae.getSnapshotBeforeUpdate==="function",zt=w.pendingProps!==zt,ot||typeof ae.UNSAFE_componentWillReceiveProps!=="function"&&typeof ae.componentWillReceiveProps!=="function"||(zt||en!==De)&&Hv(w,ae,W,De),sN=!1;var Zt=w.memoizedState;ae.state=Zt,Dv(w,W,ae,oe),Hg(),en=w.memoizedState,zt||Zt!==en||sN?(typeof _t==="function"&&(lD(w,Q,_t,W),en=w.memoizedState),(ke=sN||fH(w,Q,ke,W,Zt,en,De))?(ot||typeof ae.UNSAFE_componentWillMount!=="function"&&typeof ae.componentWillMount!=="function"||(typeof ae.componentWillMount==="function"&&ae.componentWillMount(),typeof ae.UNSAFE_componentWillMount==="function"&&ae.UNSAFE_componentWillMount()),typeof ae.componentDidMount==="function"&&(w.flags|=4194308),(w.mode&yI)!==hs&&(w.flags|=268435456)):(typeof ae.componentDidMount==="function"&&(w.flags|=4194308),(w.mode&yI)!==hs&&(w.flags|=268435456),w.memoizedProps=W,w.memoizedState=en),ae.props=W,ae.state=en,ae.context=De,ae=ke):(typeof ae.componentDidMount==="function"&&(w.flags|=4194308),(w.mode&yI)!==hs&&(w.flags|=268435456),ae=!1)}else{ae=w.stateNode,y6(S,w),De=w.memoizedProps,ot=T6(Q,De),ae.props=ot,_t=w.pendingProps,Zt=ae.context,en=Q.contextType,ke=ZD,typeof en==="object"&&en!==null&&(ke=Kc(en)),zt=Q.getDerivedStateFromProps,(en=typeof zt==="function"||typeof ae.getSnapshotBeforeUpdate==="function")||typeof ae.UNSAFE_componentWillReceiveProps!=="function"&&typeof ae.componentWillReceiveProps!=="function"||(De!==_t||Zt!==ke)&&Hv(w,ae,W,ke),sN=!1,Zt=w.memoizedState,ae.state=Zt,Dv(w,W,ae,oe),Hg();var xn=w.memoizedState;De!==_t||Zt!==xn||sN||S!==null&&S.dependencies!==null&&k5(S.dependencies)?(typeof zt==="function"&&(lD(w,Q,zt,W),xn=w.memoizedState),(ot=sN||fH(w,Q,ot,W,Zt,xn,ke)||S!==null&&S.dependencies!==null&&k5(S.dependencies))?(en||typeof ae.UNSAFE_componentWillUpdate!=="function"&&typeof ae.componentWillUpdate!=="function"||(typeof ae.componentWillUpdate==="function"&&ae.componentWillUpdate(W,xn,ke),typeof ae.UNSAFE_componentWillUpdate==="function"&&ae.UNSAFE_componentWillUpdate(W,xn,ke)),typeof ae.componentDidUpdate==="function"&&(w.flags|=4),typeof ae.getSnapshotBeforeUpdate==="function"&&(w.flags|=1024)):(typeof ae.componentDidUpdate!=="function"||De===S.memoizedProps&&Zt===S.memoizedState||(w.flags|=4),typeof ae.getSnapshotBeforeUpdate!=="function"||De===S.memoizedProps&&Zt===S.memoizedState||(w.flags|=1024),w.memoizedProps=W,w.memoizedState=xn),ae.props=W,ae.state=xn,ae.context=ke,ae=ot):(typeof ae.componentDidUpdate!=="function"||De===S.memoizedProps&&Zt===S.memoizedState||(w.flags|=4),typeof ae.getSnapshotBeforeUpdate!=="function"||De===S.memoizedProps&&Zt===S.memoizedState||(w.flags|=1024),ae=!1)}if(ke=ae,D6(S,w),De=(w.flags&128)!==0,ke||De){if(ke=w.stateNode,Se(w),De&&typeof Q.getDerivedStateFromError!=="function")Q=null,k1=-1;else if(Q=Rft(ke),w.mode&A2){Ct(!0);try{Rft(ke)}finally{Ct(!1)}}w.flags|=1,S!==null&&De?(w.child=gF(w,S.child,null,oe),w.child=gF(w,null,Q,oe)):i0(S,w,Q,oe),w.memoizedState=ke.state,S=w.child}else S=C1(S,w,oe);return oe=w.stateNode,ae&&oe.props!==W&&(NW||console.error("It looks like %s is reassigning its own `this.props` while rendering. This is not supported and can lead to confusing bugs.",Y(w)||"a component"),NW=!0),S}function RU(S,w,Q,W){return z3(),w.flags|=256,i0(S,w,Q,W),w.child}function xH(S,w){w&&w.childContextTypes&&console.error(`childContextTypes cannot be defined on a function component.
  %s.childContextTypes = ...`,w.displayName||w.name||"Component"),typeof w.getDerivedStateFromProps==="function"&&(S=U(w)||"Unknown",f2t[S]||(console.error("%s: Function components do not support getDerivedStateFromProps.",S),f2t[S]=!0)),typeof w.contextType==="object"&&w.contextType!==null&&(w=U(w)||"Unknown",g2t[w]||(console.error("%s: Function components do not support contextType.",w),g2t[w]=!0))}function _a(S){return{baseLanes:S,cachePool:f6()}}function Q0(S,w,Q){return S=S!==null?S.childLanes&~Q:0,w&&(S|=dx),S}function N6(S,w,Q){var W=w.pendingProps;i(w)&&(w.flags|=128);var oe=!1,ae=(w.flags&128)!==0,De;if((De=ae)||(De=S!==null&&S.memoizedState===null?!1:(ff.current&Ioe)!==0),De&&(oe=!0,w.flags&=-129),De=(w.flags&32)!==0,w.flags&=-33,S===null){if(Pa){if(oe?Y3(w):G3(w),(S=Sd)?(Q=q5(S,BC),Q=Q!==null&&Q.data!==PF?Q:null,Q!==null&&(De={dehydrated:Q,treeContext:ml(),retryLane:536870912,hydrationErrors:null},w.memoizedState=De,De=ci(Q),De.return=w,w.child=De,qg=w,Sd=null)):Q=null,Q===null)throw nE(w,S),kg(w);return Oc(Q)?w.lanes=32:w.lanes=536870912,null}if(ae=W.children,W=W.fallback,oe)return G3(w),oe=w.mode,ae=$y({mode:"hidden",children:ae},oe),W=to(W,oe,Q,null),ae.return=w,W.return=w,ae.sibling=W,w.child=ae,W=w.child,W.memoizedState=_a(Q),W.childLanes=Q0(S,De,Q),w.memoizedState=ZTe,Cd(null,W);return Y3(w),k0(w,ae)}var ke=S.memoizedState;if(ke!==null){var ot=ke.dehydrated;if(ot!==null)return O_(S,w,ae,De,W,ot,ke,Q)}if(oe)return G3(w),oe=W.fallback,ae=w.mode,ke=S.child,ot=ke.sibling,W=sc(ke,{mode:"hidden",children:W.children}),W.subtreeFlags=ke.subtreeFlags&1206910976,ot!==null?oe=sc(ot,oe):(oe=to(oe,ae,Q,null),oe.flags|=2),oe.return=w,W.return=w,W.sibling=oe,w.child=W,Cd(null,W),W=w.child,oe=S.child.memoizedState,oe===null?oe=_a(Q):(ae=oe.cachePool,ae!==null?(ke=Um._currentValue,ae=ae.parent!==ke?{parent:ke,pool:ke}:ae):ae=f6(),oe={baseLanes:oe.baseLanes|Q,cachePool:ae}),W.memoizedState=oe,W.childLanes=Q0(S,De,Q),w.memoizedState=ZTe,Cd(S.child,W);return ke!==null&&(Q&62914560)===Q&&(Q&S.lanes)!==0&&SD(w),Y3(w),Q=S.child,S=Q.sibling,Q=sc(Q,{mode:"visible",children:W.children}),Q.return=w,Q.sibling=null,S!==null&&(De=w.deletions,De===null?(w.deletions=[S],w.flags|=16):De.push(S)),w.child=Q,w.memoizedState=null,Q}function k0(S,w){return w=$y({mode:"visible",children:w},S.mode),w.return=S,S.child=w}function $y(S,w){return S=u(22,S,null,w),S.lanes=0,S}function Or(S,w,Q){return gF(w,S.child,null,Q),S=k0(w,w.pendingProps.children),S.flags|=2,w.memoizedState=null,S}function O_(S,w,Q,W,oe,ae,De,ke){if(Q){if(w.flags&256)return Y3(w),w.flags&=-257,Or(S,w,ke);if(w.memoizedState!==null)return G3(w),w.child=S.child,w.flags|=128,null;G3(w);var ot=oe.fallback,_t=w.mode,zt=$y({mode:"visible",children:oe.children},_t);return ot=to(ot,_t,ke,null),ot.flags|=2,zt.return=w,ot.return=w,zt.sibling=ot,w.child=zt,gF(w,S.child,null,ke),ot=w.child,ot.memoizedState=_a(ke),ot.childLanes=Q0(S,W,ke),w.memoizedState=ZTe,Cd(null,ot)}if(Y3(w),oH(),(ke&536870912)!==0&&SD(w),Oc(ae)){if(W=ae.nextSibling&&ae.nextSibling.dataset,W){ot=W.dgst;var en=W.msg;_t=W.stck,zt=W.cstck}return ae=en,De=ot,oe=_t,W=zt,ot=De,_t=ae,zt=oe,oe=W,ot!==Ifo&&(W=_t?Error(_t):Error("The server could not finish this Suspense boundary, likely due to an error during server rendering. Switched to client rendering."),W.stack=zt||"",W.digest=ot,ot=oe===void 0?null:oe,_t={value:W,source:null,stack:ot},typeof ot==="string"&&MTe.set(W,_t),R5(_t)),Or(S,w,ke)}if(im||Gy(S,w,ke,!1),W=(ke&S.childLanes)!==0,im||W){if(aN.current!==null)return Or(S,w,ke);if(W=$h,W!==null&&(ot=vt(W,ke),ot!==0&&ot!==De.retryLane))throw De.retryLane=ot,Nn(S,ot),Id(W,S,ot),qTe;return Wi(ae)||BE(),Or(S,w,ke)}if(Wi(ae))return w.flags|=192,w.child=S.child,null;return S=De.treeContext,Sd=Jp(ae.nextSibling),qg=w,Pa=!0,eN=null,R8=!1,a4=null,BC=!1,S!==null&&tE(w,S),w=k0(w,oe.children),w.flags|=134221824,w}function pD(S,w,Q){S.lanes|=w;var W=S.alternate;W!==null&&(W.lanes|=w),Mu(S.return,w,Q)}function QU(S){for(var w=null;S!==null;){var Q=S.alternate;Q!==null&&HT(Q)===null&&(w=S),S=S.sibling}return w}function Vv(S,w,Q,W,oe,ae){var De=S.memoizedState;De===null?S.memoizedState={isBackwards:w,rendering:null,renderingStartTime:0,last:W,tail:Q,tailMode:oe,treeForkCount:ae}:(De.isBackwards=w,De.rendering=null,De.renderingStartTime=0,De.last=W,De.tail=Q,De.tailMode=oe,De.treeForkCount=ae)}function x1(S){var w=S.child;for(S.child=null;w!==null;){var Q=w.sibling;w.sibling=S.child,S.child=w,w=Q}}function R6(S,w,Q){var W=w.pendingProps,oe=W.revealOrder,ae=W.tail,De=W.children,ke=ff.current;if(w.flags&128)return Fg(w,ke),null;if((W=(ke&Ioe)!==0)?(ke=ke&wW|Ioe,w.flags|=128):ke&=wW,Fg(w,ke),ke=oe==null?"null":oe,oe!=null&&oe!=="forwards"&&oe!=="backwards"&&oe!=="unstable_legacy-backwards"&&oe!=="together"&&oe!=="independent"&&!y2t[ke])if(y2t[ke]=!0,typeof oe==="string")switch(oe.toLowerCase()){case"together":case"forwards":case"backwards":case"independent":console.error('"%s" is not a valid value for revealOrder on <SuspenseList />. Use lowercase "%s" instead.',oe,oe.toLowerCase());break;case"forward":case"backward":console.error('"%s" is not a valid value for revealOrder on <SuspenseList />. React uses the -s suffix in the spelling. Use "%ss" instead.',oe,oe.toLowerCase());break;default:console.error('"%s" is not a supported revealOrder on <SuspenseList />. Did you mean "independent", "together", "forwards" or "backwards"?',oe)}else console.error('%s is not a supported value for revealOrder on <SuspenseList />. Did you mean "independent", "together", "forwards" or "backwards"?',oe);ke=ae==null?"null":ae,JTe[ke]||ae==null||(ae!=="visible"&&ae!=="collapsed"&&ae!=="hidden"?(JTe[ke]=!0,console.error('"%s" is not a supported value for tail on <SuspenseList />. Did you mean "visible", "collapsed" or "hidden"?',ae)):oe!=null&&oe!=="forwards"&&oe!=="backwards"&&oe!=="unstable_legacy-backwards"&&(JTe[ke]=!0,console.error('<SuspenseList tail="%s" /> is only valid if revealOrder is "forwards" (default) or "backwards". Did you mean to specify revealOrder="forwards"?',ae)));e:if((oe==null||oe==="forwards"||oe==="backwards"||oe==="unstable_legacy-backwards")&&De!==void 0&&De!==null&&De!==!1)if(a0(De)){for(ke=0;ke<De.length;ke++)if(!hH(De[ke],ke))break e}else if(ke=O(De),typeof ke==="function"){if(ke=ke.call(De))for(var ot=ke.next(),_t=0;!ot.done;ot=ke.next()){if(!hH(ot.value,_t))break e;_t++}}else console.error('A single row was passed to a <SuspenseList revealOrder="%s" />. This is not useful since it needs multiple rows. Did you mean to pass multiple children or an array?',oe);if(oe==="backwards"&&S!==null?(x1(S),i0(S,w,De,Q),x1(S)):i0(S,w,De,Q),Pa?(D5(),De=aoe):De=0,!W&&S!==null&&(S.flags&128)!==0)e:for(S=w.child;S!==null;){if(S.tag===13)S.memoizedState!==null&&pD(S,Q,w);else if(S.tag===19)pD(S,Q,w);else if(S.child!==null){S.child.return=S,S=S.child;continue}if(S===w)break e;for(;S.sibling===null;){if(S.return===null||S.return===w)break e;S=S.return}S.sibling.return=S.return,S=S.sibling}switch(oe){case"backwards":Q=QU(w.child),Q===null?(oe=w.child,w.child=null):(oe=Q.sibling,Q.sibling=null,x1(w)),Vv(w,!0,oe,null,ae,De);break;case"unstable_legacy-backwards":Q=null,oe=w.child;for(w.child=null;oe!==null;){if(S=oe.alternate,S!==null&&HT(S)===null){w.child=oe;break}S=oe.sibling,oe.sibling=Q,Q=oe,oe=S}Vv(w,!0,Q,null,ae,De);break;case"together":Vv(w,!1,null,null,void 0,De);break;case"independent":w.memoizedState=null;break;default:Q=QU(w.child),Q===null?(oe=w.child,w.child=null):(oe=Q.sibling,Q.sibling=null),Vv(w,!1,oe,Q,ae,De)}return w.child}function mD(S,w,Q){var{type:W,pendingProps:oe}=w,ae=oe.value;return"value"in oe||C2t||(C2t=!0,console.error("The `value` prop is required for the `<Context.Provider>`. Did you misspell it or forget to pass it?")),Q5(w,W,ae),i0(S,w,oe.children,Q),w.child}function C1(S,w,Q){if(S!==null&&(w.dependencies=S.dependencies),k1=-1,lN|=w.lanes,(Q&w.childLanes)===0)if(S!==null){if(Gy(S,w,Q,!1),(Q&w.childLanes)===0)return null}else return null;if(S!==null&&w.child!==S.child)throw Error("Resuming work not yet implemented.");if(w.child!==null){S=w.child,Q=sc(S,S.pendingProps),w.child=Q;for(Q.return=w;S.sibling!==null;)S=S.sibling,Q=Q.sibling=sc(S,S.pendingProps),Q.return=w;Q.sibling=null}return w.child}function Ai(S,w){if((S.lanes&w)!==0)return!0;return S=S.dependencies,S!==null&&k5(S)?!0:!1}function af(S,w,Q){switch(w.tag){case 3:se(w,w.stateNode.containerInfo),Q5(w,Um,S.memoizedState.cache),z3();break;case 27:case 5:Z(w);break;case 4:se(w,w.stateNode.containerInfo);break;case 10:Q5(w,w.type,w.memoizedProps.value);break;case 12:(Q&w.childLanes)!==0&&(w.flags|=4),w.flags|=2048;var W=w.stateNode;W.effectDuration=-0,W.passiveEffectDuration=-0;break;case 31:if(w.memoizedState!==null)return w.flags|=128,dH(w),null;break;case 13:if(W=w.memoizedState,W!==null){if(W.dehydrated!==null)return Y3(w),w.flags|=128,null;W=Gy(S,w,Q,!1);var oe=w.child.childLanes;if(W||(Q&oe)!==0)return N6(S,w,Q);return Y3(w),S=C1(S,w,Q),S!==null?S.sibling:null}Y3(w);break;case 19:if(w.flags&128)return R6(S,w,Q);if(oe=(S.flags&128)!==0,W=(Q&w.childLanes)!==0,W||(Gy(S,w,Q,!1),W=(Q&w.childLanes)!==0),oe){if(W)return R6(S,w,Q);w.flags|=128}if(oe=w.memoizedState,oe!==null&&(oe.rendering=null,oe.tail=null,oe.lastEffect=null),Fg(w,ff.current),W)break;else return null;case 22:return w.lanes=0,O5(S,w,Q,w.pendingProps);case 24:Q5(w,Um,S.memoizedState.cache)}return C1(S,w,Q)}function lp(S,w,Q){if(w._debugNeedsRemount&&S!==null){Q=Xt($o(w.elementType),w.key,w.pendingProps,w._debugOwner||null,w.mode,w.lanes),Q._debugStack=w._debugStack,Q._debugTask=w._debugTask;var W=w.return;if(W===null)throw Error("Cannot swap the root fiber.");if(S.alternate=null,w.alternate=null,Q.index=w.index,Q.sibling=w.sibling,Q.return=w.return,Q.ref=w.ref,Q._debugInfo=w._debugInfo,w===W.child)W.child=Q;else{var oe=W.child;if(oe===null)throw Error("Expected parent to have a child.");for(;oe.sibling!==w;)if(oe=oe.sibling,oe===null)throw Error("Expected to find the previous sibling.");oe.sibling=Q}return w=W.deletions,w===null?(W.deletions=[S],W.flags|=16):w.push(S),Q.flags|=134217730,Q}if(S!==null)if(S.memoizedProps!==w.pendingProps||w.type!==S.type)im=!0;else{if(!Ai(S,Q)&&(w.flags&128)===0)return im=!1,af(S,w,Q);im=(S.flags&131072)!==0?!0:!1}else{if(im=!1,W=Pa)D5(),W=(w.flags&1048576)!==0;W&&(W=w.index,D5(),ch(w,aoe,W))}switch(w.lanes=0,w.tag){case 16:e:if(W=w.pendingProps,S=Xy(w.elementType),S=$o(S),w.type=S,typeof S==="function")Us(S)?(W=T6(S,W),w.tag=1,w=z_(null,w,S,W,Q)):(w.tag=0,xH(w,S),w=Og(null,w,S,W,Q));else{if(S!==void 0&&S!==null){if(oe=S.$$typeof,oe===YD){w.tag=11,w=dD(null,w,S,W,Q);break e}else if(oe===uI){w.tag=14,w=IE(null,w,S,W,Q);break e}else if(oe===fl){w.tag=10,w.type=S,w=mD(null,w,Q);break e}}throw w="",S!==null&&typeof S==="object"&&S.$$typeof===nm&&(w=" Did you wrap a component in React.lazy() more than once?"),Q=U(S)||S,Error("Element type is invalid. Received a promise that resolves to: "+Q+". Lazy element type must resolve to a class or function."+w)}return w;case 0:return Og(S,w,w.type,w.pendingProps,Q);case 1:return W=w.type,oe=T6(W,w.pendingProps),z_(S,w,W,oe,Q);case 3:e:{if(se(w,w.stateNode.containerInfo),S===null)throw Error("Should have a current fiber. This is a bug in React.");W=w.pendingProps;var ae=w.memoizedState;oe=ae.element,y6(S,w),Dv(w,W,null,Q);var De=w.memoizedState;if(W=De.cache,Q5(w,Um,W),W!==ae.cache&&Pv(w,[Um],Q,!0),Hg(),W=De.element,ae.isDehydrated)if(ae={element:W,isDehydrated:!1,cache:De.cache},w.updateQueue.baseState=ae,w.memoizedState=ae,w.flags&256){w=RU(S,w,W,Q);break e}else if(W!==oe){oe=rs(Error("This root received an early update, before anything was able hydrate. Switched the entire root to client rendering."),w),R5(oe),w=RU(S,w,W,Q);break e}else{switch(S=w.stateNode.containerInfo,S.nodeType){case 9:S=S.body;break;default:S=S.nodeName==="HTML"?S.ownerDocument.body:S}Sd=Jp(S.firstChild),qg=w,Pa=!0,eN=null,R8=!1,a4=null,BC=!0,Q=jft(w,null,W,Q);for(w.child=Q;Q;)Q.flags=Q.flags&-3|134221824,Q=Q.sibling}else{if(z3(),W===oe){w=C1(S,w,Q);break e}i0(S,w,W,Q)}w=w.child}return w;case 26:return D6(S,w),S===null?(Q=x8(w.type,null,w.pendingProps,null))?w.memoizedState=Q:Pa||(w.stateNode=Om(w.type,w.pendingProps,ee(Xg.current),w)):w.memoizedState=x8(w.type,S.memoizedProps,w.pendingProps,S.memoizedState),null;case 27:return Z(w),S===null&&Pa&&(W=ee(Xg.current),oe=re(),W=w.stateNode=Ug(w.type,w.pendingProps,W,oe,!1),R8||(oe=G5(W,w.type,w.pendingProps,oe),oe!==null&&(N5(w,0).serverProps=oe)),qg=w,BC=!0,oe=Sd,ox(w.type)?(SDe=oe,Sd=Jp(W.firstChild)):Sd=oe),i0(S,w,w.pendingProps.children,Q),D6(S,w),S===null&&(w.flags|=4194304),w.child;case 5:return S===null&&Pa&&(ae=re(),W=Yd(w.type,ae.ancestorInfo),oe=Sd,(De=!oe)||(De=zE(oe,w.type,w.pendingProps,BC),De!==null?(w.stateNode=De,R8||(ae=G5(De,w.type,w.pendingProps,ae),ae!==null&&(N5(w,0).serverProps=ae)),qg=w,Sd=Jp(De.firstChild),BC=!1,ae=!0):ae=!1,De=!ae),De&&(W&&nE(w,oe),kg(w))),Z(w),oe=w.type,ae=w.pendingProps,De=S!==null?S.memoizedProps:null,W=ae.children,a8(oe,ae)?W=null:De!==null&&a8(oe,De)&&(w.flags|=32),w.memoizedState!==null&&(oe=uH(S,w,SU,null,null,Q),WW._currentValue=oe),D6(S,w),i0(S,w,W,Q),w.child;case 6:return S===null&&Pa&&(Q=w.pendingProps,S=re(),W=S.ancestorInfo.current,Q=W!=null?vu(Q,W.tag,S.ancestorInfo.implicitRootScope):!0,S=Sd,(W=!S)||(W=nW(S,w.pendingProps,BC),W!==null?(w.stateNode=W,qg=w,Sd=null,W=!0):W=!1,W=!W),W&&(Q&&nE(w,S),kg(w))),null;case 13:return N6(S,w,Q);case 4:return se(w,w.stateNode.containerInfo),W=w.pendingProps,S===null?w.child=gF(w,null,W,Q):i0(S,w,W,Q),w.child;case 11:return dD(S,w,w.type,w.pendingProps,Q);case 7:return W=w.pendingProps,D6(S,w),i0(S,w,W,Q),w.child;case 8:return i0(S,w,w.pendingProps.children,Q),w.child;case 12:return w.flags|=4,w.flags|=2048,W=w.stateNode,W.effectDuration=-0,W.passiveEffectDuration=-0,i0(S,w,w.pendingProps.children,Q),w.child;case 10:return mD(S,w,Q);case 9:return oe=w.type._context,W=w.pendingProps.children,typeof W!=="function"&&console.error("A context consumer was rendered with multiple children, or a child that isn't a function. A context consumer expects a single child that is a function. If you did pass a function, make sure there is no trailing or leading whitespace around it."),Uy(w),oe=Kc(oe),W=HTe(W,oe,void 0),w.flags|=1,i0(S,w,W,Q),w.child;case 14:return IE(S,w,w.type,w.pendingProps,Q);case 15:return y1(S,w,w.type,w.pendingProps,Q);case 19:return R6(S,w,Q);case 31:return NU(S,w,Q);case 22:return O5(S,w,Q,w.pendingProps);case 24:return Uy(w),W=Kc(Um),S===null?(oe=sE(),oe===null&&(oe=$h,ae=Wy(),oe.pooledCache=ae,L5(ae),ae!==null&&(oe.pooledCacheLanes|=Q),oe=ae),w.memoizedState={parent:W,cache:oe},Tv(w),Q5(w,Um,oe)):((S.lanes&Q)!==0&&(y6(S,w),Dv(w,null,null,Q),Hg()),oe=S.memoizedState,ae=w.memoizedState,oe.parent!==W?(oe={parent:W,cache:W},w.memoizedState=oe,w.lanes===0&&(w.memoizedState=w.updateQueue.baseState=oe),Q5(w,Um,W)):(W=ae.cache,Q5(w,Um,W),W!==oe.cache&&Pv(w,[Um],Q,!0))),i0(S,w,w.pendingProps.children,Q),w.child;case 30:return w.stateNode===null&&(w.stateNode={autoName:null,paired:null,clones:null,ref:null}),W=w.pendingProps,W.name!=null&&W.name!=="auto"?w.flags|=S===null?18882560:18874368:Pa&&L_(w),W.className!==void 0&&(oe=typeof W.className==="string"?JSON.stringify(W.className):"{...}",x2t[oe]||(x2t[oe]=!0,console.error(`<ViewTransition> doesn't accept a "className" prop. It has been renamed to "default".
-   <ViewTransition className=%s>
+   <ViewTransition default=%s>`,oe,oe))),S!==null&&S.memoizedProps.name!==W.name?w.flags|=4194816:D6(S,w),i0(S,w,W.children,Q),w.child;case 29:throw w.pendingProps}throw Error("Unknown unit of work tag ("+w.tag+"). This error is likely caused by a bug in React. Please file an issue.")}function V5(S){S.flags|=4}function Wd(S,w,Q,W,oe){var ae;if(ae=(S.mode&Ift)!==hs)ae=Q===null?Rn(w,W):Rn(w,W)&&(W.src!==Q.src||W.srcSet!==Q.srcSet);if(ae){if(S.flags|=16777216,(oe&335544128)===oe)if(S.stateNode.complete)S.flags|=8192;else if(NH())S.flags|=8192;else throw _F=Z_e,zTe}else S.flags&=-16777217}function kU(S,w){if(w.type!=="stylesheet"||(w.state.loading&RC)!==wF)S.flags&=-16777217;else if(S.flags|=16777216,!no(w))if(NH())S.flags|=8192;else throw _F=Z_e,zTe}function wc(S,w){w!==null&&(S.flags|=4),S.flags&16384&&(w=S.tag!==22?Ze():536870912,S.lanes|=w,bF|=w)}function kn(S,w){if(!Pa)switch(S.tailMode){case"visible":break;case"collapsed":for(var Q=S.tail,W=null;Q!==null;)Q.alternate!==null&&(W=Q),Q=Q.sibling;W===null?w||S.tail===null?S.tail=null:S.tail.sibling=null:W.sibling=null;break;default:w=S.tail;for(Q=null;w!==null;)w.alternate!==null&&(Q=w),w=w.sibling;Q===null?S.tail=null:Q.sibling=null}}function gl(S){var w=S.alternate!==null&&S.alternate.child===S.child,Q=0,W=0;if(w)if((S.mode&Sa)!==hs){for(var{selfBaseDuration:oe,child:ae}=S;ae!==null;)Q|=ae.lanes|ae.childLanes,W|=ae.subtreeFlags&1206910976,W|=ae.flags&1206910976,oe+=ae.treeBaseDuration,ae=ae.sibling;S.treeBaseDuration=oe}else for(oe=S.child;oe!==null;)Q|=oe.lanes|oe.childLanes,W|=oe.subtreeFlags&1206910976,W|=oe.flags&1206910976,oe.return=S,oe=oe.sibling;else if((S.mode&Sa)!==hs){oe=S.actualDuration,ae=S.selfBaseDuration;for(var De=S.child;De!==null;)Q|=De.lanes|De.childLanes,W|=De.subtreeFlags,W|=De.flags,oe+=De.actualDuration,ae+=De.treeBaseDuration,De=De.sibling;S.actualDuration=oe,S.treeBaseDuration=ae}else for(oe=S.child;oe!==null;)Q|=oe.lanes|oe.childLanes,W|=oe.subtreeFlags,W|=oe.flags,oe.return=S,oe=oe.sibling;return S.subtreeFlags|=W,S.childLanes=Q,w}function Qne(S,w,Q){var W=w.pendingProps;switch(H_(w),w.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return gl(w),null;case 1:return gl(w),null;case 3:if(Q=w.stateNode,W=null,S!==null&&(W=S.memoizedState.cache),w.memoizedState.cache!==W&&(w.flags|=2048),qf(Um,w),ne(w),Q.pendingContext&&(Q.context=Q.pendingContext,Q.pendingContext=null),S===null||S.child===null)vv(w)?(Sv(),V5(w)):S===null||S.memoizedState.isDehydrated&&(w.flags&256)===0||(w.flags|=1024,oE());return gl(w),null;case 26:var{type:oe,memoizedState:ae}=w;return S===null?(V5(w),ae!==null?(gl(w),kU(w,ae)):(gl(w),Wd(w,oe,null,W,Q))):ae?ae!==S.memoizedState?(V5(w),gl(w),kU(w,ae)):(gl(w),w.flags&=-16777217):(S=S.memoizedProps,S!==W&&V5(w),gl(w),Wd(w,oe,S,W,Q)),null;case 27:if(te(w),Q=ee(Xg.current),oe=w.type,S!==null&&w.stateNode!=null)S.memoizedProps!==W&&V5(w);else{if(!W){if(w.stateNode===null)throw Error("We must have new props for new mounts. This error is likely caused by a bug in React. Please file an issue.");return gl(w),w.subtreeFlags&=-33554433,null}S=re(),vv(w)?JA(w,S):(S=Ug(oe,W,Q,S,!0),w.stateNode=S,V5(w))}return gl(w),w.subtreeFlags&=-33554433,null;case 5:if(te(w),oe=w.type,S!==null&&w.stateNode!=null)S.memoizedProps!==W&&V5(w);else{if(!W){if(w.stateNode===null)throw Error("We must have new props for new mounts. This error is likely caused by a bug in React. Please file an issue.");return gl(w),w.subtreeFlags&=-33554433,null}var De=re();if(vv(w))JA(w,De);else{switch(ae=ee(Xg.current),Yd(oe,De.ancestorInfo),De=De.context,ae=lh(ae),De){case GW:ae=ae.createElementNS(Te,oe);break;case Tge:ae=ae.createElementNS(Ce,oe);break;default:switch(oe){case"svg":ae=ae.createElementNS(Te,oe);break;case"math":ae=ae.createElementNS(Ce,oe);break;case"script":ae=ae.createElement("div"),G2t||pC(W)||(console.error("Encountered a script tag while rendering React component. Scripts inside React components are never executed when rendering on the client. Consider using template tag instead (https://developer.mozilla.org/en-US/docs/Web/HTML/Element/template)."),G2t=!0),ae.innerHTML="<script></script>",ae=ae.removeChild(ae.firstChild);break;case"select":ae=typeof W.is==="string"?ae.createElement("select",{is:W.is}):ae.createElement("select"),W.multiple?ae.multiple=!0:W.size&&(ae.size=W.size);break;default:ae=typeof W.is==="string"?ae.createElement(oe,{is:W.is}):ae.createElement(oe),oe.indexOf("-")===-1&&(oe!==oe.toLowerCase()&&console.error("<%s /> is using incorrect casing. Use PascalCase for React components, or lowercase for HTML elements.",oe),Object.prototype.toString.call(ae)!=="[object HTMLUnknownElement]"||_2.call(U2t,oe)||(U2t[oe]=!0,console.error("The tag <%s> is unrecognized in this browser. If you meant to render a React component, start its name with an uppercase letter.",oe)))}}ae[ku]=w,ae[Kg]=W;e:for(De=w.child;De!==null;){if(De.tag===5||De.tag===6)ae.appendChild(De.stateNode);else if(De.tag!==4&&De.tag!==27&&De.child!==null){De.child.return=De,De=De.child;continue}if(De===w)break e;for(;De.sibling===null;){if(De.return===null||De.return===w)break e;De=De.return}De.sibling.return=De.return,De=De.sibling}w.stateNode=ae;e:switch(hp(ae,oe,W),oe){case"button":case"input":case"select":case"textarea":W=!!W.autoFocus;break e;case"img":W=!0;break e;default:W=!1}W&&V5(w)}}return gl(w),w.subtreeFlags&=-33554433,Wd(w,w.type,S===null?null:S.memoizedProps,w.pendingProps,Q),null;case 6:if(S&&w.stateNode!=null)S.memoizedProps!==W&&V5(w);else{if(typeof W!=="string"&&w.stateNode===null)throw Error("We must have new props for new mounts. This error is likely caused by a bug in React. Please file an issue.");if(S=ee(Xg.current),Q=re(),vv(w)){if(S=w.stateNode,Q=w.memoizedProps,oe=!R8,W=null,ae=qg,ae!==null)switch(ae.tag){case 3:oe&&(oe=J5(S,Q,W),oe!==null&&(N5(w,0).serverProps=oe));break;case 27:case 5:W=ae.memoizedProps,oe&&(oe=J5(S,Q,W),oe!==null&&(N5(w,0).serverProps=oe))}S[ku]=w,S=S.nodeValue===Q||W!==null&&W.suppressHydrationWarning===!0||RE(S.nodeValue,Q)?!0:!1,S||kg(w,!0)}else oe=Q.ancestorInfo.current,oe!=null&&vu(W,oe.tag,Q.ancestorInfo.implicitRootScope),S=lh(S).createTextNode(W),S[ku]=w,w.stateNode=S}return gl(w),null;case 31:if(Q=w.memoizedState,S===null||S.memoizedState!==null){if(W=vv(w),Q!==null){if(S===null){if(!W)throw Error("A dehydrated suspense component was completed without a hydrated node. This is probably a bug in React.");if(S=w.memoizedState,S=S!==null?S.dehydrated:null,!S)throw Error("Expected to have a hydrated activity instance. This error is likely caused by a bug in React. Please file an issue.");S[ku]=w,gl(w),(w.mode&Sa)!==hs&&Q!==null&&(S=w.child,S!==null&&(w.treeBaseDuration-=S.treeBaseDuration))}else Sv(),z3(),(w.flags&128)===0&&(Q=w.memoizedState=null),w.flags|=4,gl(w),(w.mode&Sa)!==hs&&Q!==null&&(S=w.child,S!==null&&(w.treeBaseDuration-=S.treeBaseDuration));S=!1}else Q=oE(),S!==null&&S.memoizedState!==null&&(S.memoizedState.hydrationErrors=Q),S=!0;if(!S){if(w.flags&256)return Gp(w),w;return Gp(w),null}if((w.flags&128)!==0)throw Error("Client rendering an Activity suspended it again. This is a bug in React.")}return gl(w),null;case 13:if(W=w.memoizedState,S===null||S.memoizedState!==null&&S.memoizedState.dehydrated!==null){if(oe=W,ae=vv(w),oe!==null&&oe.dehydrated!==null){if(S===null){if(!ae)throw Error("A dehydrated suspense component was completed without a hydrated node. This is probably a bug in React.");if(ae=w.memoizedState,ae=ae!==null?ae.dehydrated:null,!ae)throw Error("Expected to have a hydrated suspense instance. This error is likely caused by a bug in React. Please file an issue.");ae[ku]=w,gl(w),(w.mode&Sa)!==hs&&oe!==null&&(oe=w.child,oe!==null&&(w.treeBaseDuration-=oe.treeBaseDuration))}else Sv(),z3(),(w.flags&128)===0&&(oe=w.memoizedState=null),w.flags|=4,gl(w),(w.mode&Sa)!==hs&&oe!==null&&(oe=w.child,oe!==null&&(w.treeBaseDuration-=oe.treeBaseDuration));oe=!1}else oe=oE(),S!==null&&S.memoizedState!==null&&(S.memoizedState.hydrationErrors=oe),oe=!0;if(!oe){if(w.flags&256)return Gp(w),w;return Gp(w),null}}if(Gp(w),(w.flags&128)!==0)return w.lanes=Q,(w.mode&Sa)!==hs&&of(w),w;return Q=W!==null,S=S!==null&&S.memoizedState!==null,Q&&(W=w.child,oe=null,W.alternate!==null&&W.alternate.memoizedState!==null&&W.alternate.memoizedState.cachePool!==null&&(oe=W.alternate.memoizedState.cachePool.pool),ae=null,W.memoizedState!==null&&W.memoizedState.cachePool!==null&&(ae=W.memoizedState.cachePool.pool),ae!==oe&&(W.flags|=2048)),Q!==S&&Q&&(w.child.flags|=8192),wc(w,w.updateQueue),gl(w),(w.mode&Sa)!==hs&&Q&&(S=w.child,S!==null&&(w.treeBaseDuration-=S.treeBaseDuration)),null;case 4:return ne(w),S===null&&M1(w.stateNode.containerInfo),w.flags|=67108864,gl(w),null;case 10:return qf(w.type,w),gl(w),null;case 19:if(LT(w),W=w.memoizedState,W===null)return gl(w),null;if(oe=(w.flags&128)!==0,ae=W.rendering,ae===null)if(oe)kn(W,!1);else{if(l0!==rM||S!==null&&(S.flags&128)!==0)for(S=w.child;S!==null;){if(ae=HT(S),ae!==null){w.flags|=128,kn(W,!1),S=ae.updateQueue,w.updateQueue=S,wc(w,S),w.subtreeFlags=0,S=Q;for(Q=w.child;Q!==null;)cp(Q,S),Q=Q.sibling;return Fg(w,ff.current&wW|Ioe),Pa&&ma(w,W.treeForkCount),w.child}S=S.sibling}W.tail!==null&&Ki()>gge&&(w.flags|=128,oe=!0,kn(W,!1),w.lanes=4194304)}else{if(!oe)if(S=HT(ae),S!==null){if(w.flags|=128,oe=!0,S=S.updateQueue,w.updateQueue=S,wc(w,S),kn(W,!0),W.tail===null&&W.tailMode!=="collapsed"&&W.tailMode!=="visible"&&!ae.alternate&&!Pa)return gl(w),null}else 2*Ki()-W.renderingStartTime>gge&&Q!==536870912&&(w.flags|=128,oe=!0,kn(W,!1),w.lanes=4194304);W.isBackwards?(ae.sibling=w.child,w.child=ae):(S=W.last,S!==null?S.sibling=ae:w.child=ae,W.last=ae)}if(W.tail!==null){S=W.tail;e:{for(Q=S;Q!==null;){if(Q.alternate!==null){Q=!1;break e}Q=Q.sibling}Q=!0}return W.rendering=S,W.tail=S.sibling,W.renderingStartTime=Ki(),S.sibling=null,ae=ff.current,ae=oe?ae&wW|Ioe:ae&wW,W.tailMode==="visible"||W.tailMode==="collapsed"||!Q||Pa?Fg(w,ae):(Q=ae,J(Af,w,w),J(ff,Q,w),f2===null&&(f2=w)),Pa&&ma(w,W.treeForkCount),S}return gl(w),null;case 22:case 23:return Gp(w),QT(w),W=w.memoizedState!==null,S!==null?S.memoizedState!==null!==W&&(w.flags|=8192):W&&(w.flags|=8192),W?(Q&536870912)!==0&&(w.flags&128)===0&&(gl(w),w.subtreeFlags&6&&(w.flags|=8192)):gl(w),Q=w.updateQueue,Q!==null&&wc(w,Q.retryQueue),Q=null,S!==null&&S.memoizedState!==null&&S.memoizedState.cachePool!==null&&(Q=S.memoizedState.cachePool.pool),W=null,w.memoizedState!==null&&w.memoizedState.cachePool!==null&&(W=w.memoizedState.cachePool.pool),W!==Q&&(w.flags|=2048),S!==null&&K(uF,w),null;case 24:return Q=null,S!==null&&(Q=S.memoizedState.cache),w.memoizedState.cache!==Q&&(w.flags|=2048),qf(Um,w),gl(w),null;case 25:return null;case 30:return w.flags|=33554432,gl(w),null}throw Error("Unknown unit of work tag ("+w.tag+"). This error is likely caused by a bug in React. Please file an issue.")}function LU(S,w){switch(H_(w),w.tag){case 1:return S=w.flags,S&65536?(w.flags=S&-65537|128,(w.mode&Sa)!==hs&&of(w),w):null;case 3:return qf(Um,w),ne(w),S=w.flags,(S&65536)!==0&&(S&128)===0?(w.flags=S&-65537|128,w):null;case 26:case 27:case 5:return te(w),null;case 31:if(w.memoizedState!==null){if(Gp(w),w.alternate===null)throw Error("Threw in newly mounted dehydrated component. This is likely a bug in React. Please file an issue.");z3()}return S=w.flags,S&65536?(w.flags=S&-65537|128,(w.mode&Sa)!==hs&&of(w),w):null;case 13:if(Gp(w),S=w.memoizedState,S!==null&&S.dehydrated!==null){if(w.alternate===null)throw Error("Threw in newly mounted dehydrated component. This is likely a bug in React. Please file an issue.");z3()}return S=w.flags,S&65536?(w.flags=S&-65537|128,(w.mode&Sa)!==hs&&of(w),w):null;case 19:return LT(w),S=w.flags,S&65536?(w.flags=S&-65537|128,S=w.memoizedState,S!==null&&(S.rendering=null,S.tail=null),w.flags|=4,w):null;case 4:return ne(w),null;case 10:return qf(w.type,w),null;case 22:case 23:return Gp(w),QT(w),S!==null&&K(uF,w),S=w.flags,S&65536?(w.flags=S&-65537|128,(w.mode&Sa)!==hs&&of(w),w):null;case 24:return qf(Um,w),null;case 25:return null;default:return null}}function Q6(S,w){switch(H_(w),w.tag){case 3:qf(Um,w),ne(w);break;case 26:case 27:case 5:te(w);break;case 4:ne(w);break;case 31:w.memoizedState!==null&&Gp(w);break;case 13:Gp(w);break;case 19:LT(w);break;case 10:qf(w.type,w);break;case 22:case 23:Gp(w),QT(w),S!==null&&K(uF,w);break;case 24:qf(Um,w)}}function qy(S){return(S.mode&Sa)!==hs}function Yl(S,w){qy(S)?(nf(),SE(w,S),m1()):SE(w,S)}function CH(S,w,Q){qy(S)?(nf(),k6(Q,S,w),m1()):k6(Q,S,w)}function SE(S,w){try{var Q=w.updateQueue,W=Q!==null?Q.lastEffect:null;if(W!==null){var oe=W.next;Q=oe;do{if((Q.tag&S)===S&&(W=void 0,(S&L1)!==voe&&(zW=!0),W=ye(w,Sfo,Q),(S&L1)!==voe&&(zW=!1),W!==void 0&&typeof W!=="function")){var ae=void 0;ae=(Q.tag&c4)!==0?"useLayoutEffect":(Q.tag&L1)!==0?"useInsertionEffect":"useEffect";var De=void 0;De=W===null?" You returned null. If your effect does not require clean up, return undefined (or nothing).":typeof W.then==="function"?`

It looks like you wrote `+ae+`(async () => ...) or returned a Promise. Instead, write the async function inside your effect and call it immediately:

`+ae+`(() => {
  async function fetchData() {
    // You can await here
    const response = await MyAPI.getData(someId);
    // ...
  }
  fetchData();
}, [someId]); // Or [] if effect doesn't need props or state

Learn more about data fetching with Hooks: https://react.dev/link/hooks-data-fetching`:" You returned: "+W,ye(w,function(ke,ot){console.error("%s must not return anything besides a function, which is used for clean-up.%s",ke,ot)},ae,De)}Q=Q.next}while(Q!==oe)}}catch(ke){Tc(w,w.return,ke)}}function k6(S,w,Q){try{var W=w.updateQueue,oe=W!==null?W.lastEffect:null;if(oe!==null){var ae=oe.next;W=ae;do{if((W.tag&S)===S){var De=W.inst,ke=De.destroy;ke!==void 0&&(De.destroy=void 0,(S&L1)!==voe&&(zW=!0),oe=w,ye(oe,Pfo,oe,Q,ke),(S&L1)!==voe&&(zW=!1))}W=W.next}while(W!==ae)}}catch(ot){Tc(w,w.return,ot)}}function _D(S,w){qy(S)?(nf(),SE(w,S),m1()):SE(w,S)}function n2(S,w,Q){qy(S)?(nf(),k6(Q,S,w),m1()):k6(Q,S,w)}function cf(S){var w=S.updateQueue;if(w!==null){var Q=S.stateNode;S.type.defaultProps||"ref"in S.memoizedProps||NW||(Q.props!==S.memoizedProps&&console.error("Expected %s props to match memoized props before processing the update queue. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.",Y(S)||"instance"),Q.state!==S.memoizedState&&console.error("Expected %s state to match memoized state before processing the update queue. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.",Y(S)||"instance"));try{ye(S,x6,w,Q)}catch(W){Tc(S,S.return,W)}}}function HU(S,w,Q){return S.getSnapshotBeforeUpdate(w,Q)}function kne(S,w){var Q=w.memoizedProps,W=w.memoizedState;w=S.stateNode,S.type.defaultProps||"ref"in S.memoizedProps||NW||(w.props!==S.memoizedProps&&console.error("Expected %s props to match memoized props before getSnapshotBeforeUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.",Y(S)||"instance"),w.state!==S.memoizedState&&console.error("Expected %s state to match memoized state before getSnapshotBeforeUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.",Y(S)||"instance"));try{var oe=T6(S.type,Q),ae=ye(S,HU,w,oe,W);Q=b2t,ae!==void 0||Q.has(S.type)||(Q.add(S.type),ye(S,function(){console.error("%s.getSnapshotBeforeUpdate(): A snapshot value (or null) must be returned. You have returned undefined.",Y(S))})),w.__reactInternalSnapshotBeforeUpdate=ae}catch(De){Tc(S,S.return,De)}}function FU(S,w,Q){Q.props=T6(S.type,S.memoizedProps),Q.state=S.memoizedState,qy(S)?(nf(),ye(S,zft,S,w,Q),m1()):ye(S,zft,S,w,Q)}function L6(S){var w=S.ref;if(w!==null){switch(S.tag){case 26:case 27:case 5:var Q=S.stateNode;break;case 30:Q=S.stateNode;var W=Yp(S.memoizedProps,Q);if(Q.ref===null||Q.ref.name!==W)Q.ref=Gg(W);Q=Q.ref;break;case 7:S.stateNode===null&&(Q=new Eh(S),I(S,A8,Q),S.stateNode=Q),Q=S.stateNode;break;default:Q=S.stateNode}if(typeof w==="function")if(qy(S))try{nf(),S.refCleanup=w(Q)}finally{m1()}else S.refCleanup=w(Q);else typeof w==="string"?console.error("String refs are no longer supported."):w.hasOwnProperty("current")||console.error("Unexpected ref object provided for %s. Use either a ref-setter function or React.createRef().",Y(S)),w.current=Q}}function Pl(S,w){try{ye(S,L6,S)}catch(Q){Tc(S,w,Q)}}function Bc(S,w){var Q=S.ref,W=S.refCleanup;if(Q!==null)if(typeof W==="function")try{if(qy(S))try{nf(),ye(S,W)}finally{m1(S)}else ye(S,W)}catch(oe){Tc(S,w,oe)}finally{S.refCleanup=null,S=S.alternate,S!=null&&(S.refCleanup=null)}else if(typeof Q==="function")try{if(qy(S))try{nf(),ye(S,Q,null)}finally{m1(S)}else ye(S,Q,null)}catch(oe){Tc(S,w,oe)}else Q.current=null}function wu(S,w,Q,W){var oe=S.memoizedProps,ae=oe.id,De=oe.onCommit;oe=oe.onRender,w=w===null?"mount":"update",K_e&&(w="nested-update"),typeof oe==="function"&&oe(ae,w,S.actualDuration,S.treeBaseDuration,S.actualStartTime,Q),typeof De==="function"&&De(ae,w,W,Q)}function V_(S,w,Q,W){var oe=S.memoizedProps;S=oe.id,oe=oe.onPostCommit,w=w===null?"mount":"update",K_e&&(w="nested-update"),typeof oe==="function"&&oe(S,w,W,Q)}function gD(S,w){if((S.tag===5||S.tag===27||S.tag===6)&&S.alternate===null&&w!==null)for(var Q=0;Q<w.length;Q++)iI(S.stateNode,w[Q])}function bH(S){for(var w=S.return;w!==null;){if(IH(w)&&iI(S.stateNode,w.stateNode),b1(w))break;w=w.return}}function Xd(S){for(var w=S.return;w!==null;){if(IH(w)&&tW(S.stateNode,w.stateNode),b1(w))break;w=w.return}}function b1(S){return S.tag===5||S.tag===3||S.tag===27}function IH(S){return S&&S.tag===7&&S.stateNode!==null}function vH(S){var{type:w,memoizedProps:Q,stateNode:W}=S;try{ye(S,UH,W,w,Q,S)}catch(oe){Tc(S,S.return,oe)}}function SH(S,w,Q){try{ye(S,DD,S.stateNode,S.type,Q,w,S)}catch(W){Tc(S,S.return,W)}}function AD(S){return S.tag===5||S.tag===3||S.tag===26||S.tag===27&&ox(S.type)||S.tag===4}function Yv(S){e:for(;;){for(;S.sibling===null;){if(S.return===null||AD(S.return))return null;S=S.return}S.sibling.return=S.return;for(S=S.sibling;S.tag!==5&&S.tag!==6&&S.tag!==18;){if(S.tag===27&&ox(S.type))continue e;if(S.flags&2)continue e;if(S.child===null||S.tag===4)continue e;else S.child.return=S,S=S.child}if(!(S.flags&2))return S.stateNode}}function fD(S,w,Q,W){var oe=S.tag;if(oe===5||oe===6)oe=S.stateNode,w?(l8(Q),(Q.nodeType===9?Q.body:Q.nodeName==="HTML"?Q.ownerDocument.body:Q).insertBefore(oe,w)):(l8(Q),w=Q.nodeType===9?Q.body:Q.nodeName==="HTML"?Q.ownerDocument.body:Q,w.appendChild(oe),oe=Q._reactRootContainer,oe!==null&&oe!==void 0||w.onclick!==null||(w.onclick=fd)),gD(S,W),Nc=!0;else if(oe!==4&&(oe===27&&(gD(S,W),W=null,ox(S.type)&&(Q=S.stateNode,w=null)),S=S.child,S!==null))for(fD(S,w,Q,W),S=S.sibling;S!==null;)fD(S,w,Q,W),S=S.sibling}function Gv(S,w,Q,W){var oe=S.tag;if(oe===5||oe===6)oe=S.stateNode,w?Q.insertBefore(oe,w):Q.appendChild(oe),gD(S,W),Nc=!0;else if(oe!==4&&(oe===27&&(gD(S,W),W=null,ox(S.type)&&(Q=S.stateNode)),S=S.child,S!==null))for(Gv(S,w,Q,W),S=S.sibling;S!==null;)Gv(S,w,Q,W),S=S.sibling}function zU(S){for(var w,Q=S.return;Q!==null;){if(AD(Q)){w=Q;break}Q=Q.return}Q=null;for(var W=S.return;W!==null;){if(IH(W)){var oe=W.stateNode;Q===null?Q=[oe]:Q.push(oe)}if(b1(W))break;W=W.return}if(w==null)throw Error("Expected to find a host parent. This error is likely caused by a bug in React. Please file an issue.");switch(w.tag){case 27:w=w.stateNode,W=Yv(S),Gv(S,W,w,Q);break;case 5:W=w.stateNode,w.flags&32&&(tI(W),w.flags&=-33),w=Yv(S),Gv(S,w,W,Q);break;case 3:case 4:w=w.stateNode.containerInfo,W=Yv(S),fD(S,W,w,Q);break;default:throw Error("Invalid host parent fiber. This error is likely caused by a bug in React. Please file an issue.")}}function H6(S){var{stateNode:w,memoizedProps:Q}=S;try{ye(S,OE,S.type,Q,w,S)}catch(W){Tc(S,S.return,W)}}function tC(S){if(S.tag===30||(S.subtreeFlags&33554432)!==0)sge=!0}function o2(){var S=H8;return H8=null,S}function L0(S,w,Q,W,oe){return cx=0,(w=nC(S.child,w,Q,W,oe))&&S._debugTask!=null&&ax===null&&(ax=S._debugTask),w}function nC(S,w,Q,W,oe){for(var ae=!1;S!==null;){if(S.tag===5){var De=S.stateNode;if(W!==null){var ke=m8(De);W.push(ke),ke.view&&(ae=!0)}else ae||m8(De).view&&(ae=!0);sge=!0,rI(De,cx===0?w:w+"_"+cx,Q),cx++}else if(S.tag!==22||S.memoizedState===null)S.tag===30&&oe||nC(S.child,w,Q,W,oe)&&(ae=!0);S=S.sibling}return ae}function Xh(S,w){for(;S!==null;){if(S.tag===5)j5(S.stateNode,S.memoizedProps);else if(S.tag!==22||S.memoizedState===null)S.tag===30&&w||Xh(S.child,w);S=S.sibling}}function bd(S){if((S.subtreeFlags&18874368)!==0)for(S=S.child;S!==null;){if(S.tag!==22||S.memoizedState===null){if(bd(S),S.tag===30&&(S.flags&18874368)!==0&&S.stateNode.paired){var w=S.memoizedProps;if(w.name==null||w.name==="auto")throw Error("Found a pair with an auto name. This is a bug in React.");var Q=w.name;w=Rm(w.default,w.share),w!=="none"&&(L0(S,Q,w,null,!1)||Xh(S.child,!1))}}S=S.sibling}}function lf(S,w){if(S.tag===30){var Q=S.stateNode,W=S.memoizedProps,oe=Yp(W,Q),ae=Rm(W.default,Q.paired?W.share:W.enter);ae!=="none"?L0(S,oe,ae,null,!1)?(bd(S),Q.paired||w||U6(S,W.onEnter)):Xh(S.child,!1):bd(S)}else if((S.subtreeFlags&33554432)!==0)for(S=S.child;S!==null;)lf(S,w),S=S.sibling;else bd(S)}function hf(S){if(l4!==null&&l4.size!==0){var w=l4;if((S.subtreeFlags&18874368)!==0)for(S=S.child;S!==null;){if(S.tag!==22||S.memoizedState===null){if(S.tag===30&&(S.flags&18874368)!==0){var Q=S.memoizedProps,W=Q.name;if(W!=null&&W!=="auto"){var oe=w.get(W);if(oe!==void 0){var ae=Rm(Q.default,Q.share);if(ae!=="none"&&(L0(S,W,ae,null,!1)?(ae=S.stateNode,oe.paired=ae,ae.paired=oe,U6(S,Q.onShare)):Xh(S.child,!1)),w.delete(W),w.size===0)break}}}hf(S)}S=S.sibling}}}function jd(S){if(S.tag===30){var w=S.memoizedProps,Q=Yp(w,S.stateNode),W=l4!==null?l4.get(Q):void 0,oe=Rm(w.default,W!==void 0?w.share:w.exit);oe!=="none"&&(L0(S,Q,oe,null,!1)?W!==void 0?(oe=S.stateNode,W.paired=oe,oe.paired=W,l4.delete(Q),U6(S,w.onShare)):U6(S,w.onExit):Xh(S.child,!1)),l4!==null&&hf(S)}else if((S.subtreeFlags&33554432)!==0)for(S=S.child;S!==null;)jd(S),S=S.sibling;else l4!==null&&hf(S)}function Wp(S){for(S=S.child;S!==null;){if(S.tag===30){var w=S.memoizedProps,Q=Yp(w,S.stateNode);w=Rm(w.default,w.update),S.flags&=-5,w!=="none"&&L0(S,Q,w,S.memoizedState=[],!1)}else(S.subtreeFlags&33554432)!==0&&Wp(S);S=S.sibling}}function Vg(S){if((S.subtreeFlags&18874368)!==0)for(S=S.child;S!==null;){if(S.tag!==22||S.memoizedState===null){if(S.tag===30&&(S.flags&18874368)!==0){var w=S.stateNode;w.paired!==null&&(w.paired=null,Xh(S.child,!1))}Vg(S)}S=S.sibling}}function Gl(S){if(S.tag===30)S.stateNode.paired=null,Xh(S.child,!1),Vg(S);else if((S.subtreeFlags&33554432)!==0)for(S=S.child;S!==null;)Gl(S),S=S.sibling;else Vg(S)}function OU(S){for(S=S.child;S!==null;)S.tag===30?Xh(S.child,!1):(S.subtreeFlags&33554432)!==0&&OU(S),S=S.sibling}function Uv(S,w,Q,W,oe,ae,De){for(var ke=!1;w!==null;){if(w.tag===5){var ot=w.stateNode;if(ae!==null&&cx<ae.length){var _t=ae[cx],zt=m8(ot);if(_t.view||zt.view)ke=!0;var en;if(en=(S.flags&4)===0)if(zt.clip)en=!0;else{en=_t.rect;var Zt=zt.rect;en=en.y!==Zt.y||en.x!==Zt.x||en.height!==Zt.height||en.width!==Zt.width}en&&(S.flags|=4),zt.abs?zt=!_t.abs:(_t=_t.rect,zt=zt.rect,zt=_t.height!==zt.height||_t.width!==zt.width),zt&&(S.flags|=32)}else S.flags|=32;(S.flags&4)!==0&&rI(ot,cx===0?Q:Q+"_"+cx,oe),ke&&(S.flags&4)!==0||(H8===null&&(H8=[]),H8.push(ot,cx===0?W:W+"_"+cx,w.memoizedProps)),cx++}else if(w.tag!==22||w.memoizedState===null)w.tag===30&&De?S.flags|=w.flags&32:Uv(S,w.child,Q,W,oe,ae,De)&&(ke=!0);w=w.sibling}return ke}function oC(S,w){for(S=S.child;S!==null;){if(S.tag===30){var Q=S.memoizedProps,W=S.stateNode,oe=Yp(Q,W),ae=Rm(Q.default,Q.update);if(w){W=W.clones;var De=W===null?null:W.map(_8)}else De=S.memoizedState,S.memoizedState=null;W=S;var ke=S.child,ot=oe;cx=0,ae=Uv(W,ke,ot,oe,ae,De,!1),(S.flags&4)!==0&&ae&&(w||U6(S,Q.onUpdate))}else(S.subtreeFlags&33554432)!==0&&oC(S,w);S=S.sibling}}function VU(S){var w=S.memoizedProps.name;if(w!=null&&w!=="auto"){var Q=age.get(w);if(Q!==void 0){if(Q!==S&&Q!==S.alternate&&!I2t[w]){I2t[w]=!0;var W=JSON.stringify(w);ye(S,function(){console.error("There are two <ViewTransition name=%s> components with the same name mounted at the same time. This is not supported and will cause View Transitions to error. Try to use a more unique name e.g. by using a namespace prefix and adding the id of an item to the name.",W)}),ye(Q,function(){console.error("The existing <ViewTransition name=%s> duplicate has this stack trace.",W)})}}else age.set(w,S)}}function PE(S){var w=S.memoizedProps.name;if(w!=null&&w!=="auto"){var Q=age.get(w);Q===void 0||Q!==S&&Q!==S.alternate||age.delete(w)}}function YU(S,w){return w.tag===31?(w=w.memoizedState,S.memoizedState!==null&&w===null):w.tag===13?(S=S.memoizedState,w=w.memoizedState,S!==null&&S.dehydrated!==null&&(w===null||w.dehydrated===null)):w.tag===3?S.memoizedState.isDehydrated&&(w.flags&256)===0:!1}function Jy(S,w,Q){if(S=S.containerInfo,xDe=XW,S=Cv(S),k_(S)){if("selectionStart"in S)var W={start:S.selectionStart,end:S.selectionEnd};else e:{W=(W=S.ownerDocument)&&W.defaultView||window;var oe=W.getSelection&&W.getSelection();if(oe&&oe.rangeCount!==0){W=oe.anchorNode;var ae=oe.anchorOffset,De=oe.focusNode;oe=oe.focusOffset;try{W.nodeType,De.nodeType}catch(xr){W=null;break e}var ke=0,ot=-1,_t=-1,zt=0,en=0,Zt=S,xn=null;t:for(;;){for(var Co;;){if(Zt!==W||ae!==0&&Zt.nodeType!==3||(ot=ke+ae),Zt!==De||oe!==0&&Zt.nodeType!==3||(_t=ke+oe),Zt.nodeType===3&&(ke+=Zt.nodeValue.length),(Co=Zt.firstChild)===null)break;xn=Zt,Zt=Co}for(;;){if(Zt===S)break t;if(xn===W&&++zt===ae&&(ot=ke),xn===De&&++en===oe&&(_t=ke),(Co=Zt.nextSibling)!==null)break;Zt=xn,xn=Zt.parentNode}Zt=Co}W=ot===-1||_t===-1?null:{start:ot,end:_t}}else W=null}W=W||{start:0,end:0}}else W=null;CDe={focusedElem:S,selectionRange:W},XW=!1,Q=(Q&335544064)===Q,eA=w;for(w=Q?9270:1024;eA!==null;){if(S=eA,Q&&(W=S.deletions,W!==null))for(ae=0;ae<W.length;ae++)Q&&jd(W[ae]);if(S.alternate===null&&(S.flags&2)!==0)Q&&tC(S),rC(Q);else{if(S.tag===22){if(W=S.alternate,S.memoizedState!==null){W!==null&&W.memoizedState===null&&Q&&jd(W),rC(Q);continue}else if(W!==null&&W.memoizedState!==null){Q&&tC(S),rC(Q);continue}}W=S.child,(S.subtreeFlags&w)!==0&&W!==null?(W.return=S,eA=W):(Q&&Wp(S),rC(Q))}}l4=null}function rC(S){for(;eA!==null;){var w=eA,Q=w,W=S,oe=Q.alternate,ae=Q.flags;switch(Q.tag){case 0:case 11:case 15:break;case 1:(ae&1024)!==0&&oe!==null&&kne(Q,oe);break;case 3:if((ae&1024)!==0){if(W=Q.stateNode.containerInfo,Q=W.nodeType,Q===9)kD(W);else if(Q===1)switch(W.nodeName){case"HEAD":case"HTML":case"BODY":kD(W);break;default:W.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;case 30:W&&oe!==null&&(W=oe,oe=Q,Q=Yp(W.memoizedProps,W.stateNode),oe=oe.memoizedProps,oe=Rm(oe.default,oe.update),oe!=="none"&&L0(W,Q,oe,W.memoizedState=[],!0));break;default:if((ae&1024)!==0)throw Error("This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue.")}if(W=w.sibling,W!==null){W.return=w.return,eA=W;break}eA=w.return}}function PH(S,w,Q){var W=N0(),oe=e2(),ae=p1(),De=Vl(),ke=Q.flags;switch(Q.tag){case 0:case 11:case 15:i2(S,Q),ke&4&&Yl(Q,c4|DC);break;case 1:if(i2(S,Q),ke&4)if(S=Q.stateNode,w===null)Q.type.defaultProps||"ref"in Q.memoizedProps||NW||(S.props!==Q.memoizedProps&&console.error("Expected %s props to match memoized props before componentDidMount. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.",Y(Q)||"instance"),S.state!==Q.memoizedState&&console.error("Expected %s state to match memoized state before componentDidMount. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.",Y(Q)||"instance")),qy(Q)?(nf(),ye(Q,FTe,Q,S),m1()):ye(Q,FTe,Q,S);else{var ot=T6(Q.type,w.memoizedProps);w=w.memoizedState,Q.type.defaultProps||"ref"in Q.memoizedProps||NW||(S.props!==Q.memoizedProps&&console.error("Expected %s props to match memoized props before componentDidUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.",Y(Q)||"instance"),S.state!==Q.memoizedState&&console.error("Expected %s state to match memoized state before componentDidUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.",Y(Q)||"instance")),qy(Q)?(nf(),ye(Q,Lft,Q,S,ot,w,S.__reactInternalSnapshotBeforeUpdate),m1()):ye(Q,Lft,Q,S,ot,w,S.__reactInternalSnapshotBeforeUpdate)}ke&64&&cf(Q),ke&512&&Pl(Q,Q.return);break;case 3:if(w=Zf(),i2(S,Q),ke&64&&(ke=Q.updateQueue,ke!==null)){if(ot=null,Q.child!==null)switch(Q.child.tag){case 27:case 5:ot=Q.child.stateNode;break;case 1:ot=Q.child.stateNode}try{ye(Q,x6,ke,ot)}catch(zt){Tc(Q,Q.return,zt)}}S.effectDuration+=rE(w);break;case 27:w===null&&ke&4&&H6(Q);case 26:case 5:if(i2(S,Q),w===null){if(ke&4)vH(Q);else if(ke&64){S=Q.type,w=Q.memoizedProps,ot=Q.stateNode;try{ye(Q,TD,ot,S,w,Q)}catch(zt){Tc(Q,Q.return,zt)}}}ke&512&&Pl(Q,Q.return);break;case 12:if(ke&4){ke=Zf(),i2(S,Q),S=Q.stateNode,S.effectDuration+=ef(ke);try{ye(Q,wu,Q,w,ZE,S.effectDuration)}catch(zt){Tc(Q,Q.return,zt)}}else i2(S,Q);break;case 31:i2(S,Q),ke&4&&UU(S,Q);break;case 13:i2(S,Q),ke&4&&WU(S,Q),ke&64&&(S=Q.memoizedState,S!==null&&(S=S.dehydrated,S!==null&&(ke=jp.bind(null,Q),Du(S,ke))));break;case 22:if(ke=Q.memoizedState!==null||Zg,!ke){var _t=w!==null&&w.memoizedState!==null||_h;w=Zg,ot=_h,Zg=ke,(_h=_t)&&!ot?(ke=cge,(Q.subtreeFlags&8772)!==0&&(ke|=eDe),Y_(S,Q,ke),(Q.mode&Sa)!==hs&&0<=Ti&&0<=Zi&&0.05<Zi-Ti&&F3(Q,Ti,Zi)):i2(S,Q),Zg=w,_h=ot}break;case 30:ke&18874368&&VU(Q),i2(S,Q),ke&512&&Pl(Q,Q.return);break;case 7:ke&512&&Pl(Q,Q.return);default:i2(S,Q)}(Q.mode&Sa)!==hs&&0<=Ti&&0<=Zi&&((O0||0.05<c0)&&Eu(Q,Ti,Zi,c0,Lu),Q.alternate===null&&Q.return!==null&&Q.return.alternate!==null&&0.05<Zi-Ti&&(YU(Q.return.alternate,Q.return)||qA(Q,Ti,Zi,"Mount"))),Qm(W),tf(oe),Lu=ae,O0=De}function F6(S,w){for(S=S.child;S!==null;)EH(S,w),S=S.sibling}function EH(S,w){switch(S.tag){case 5:case 26:try{var Q=S.stateNode;w?ye(S,u2,Q):ye(S,mC,S.stateNode,S.memoizedProps)}catch(ae){Tc(S,S.return,ae)}MH(S,w);break;case 6:try{var W=S.stateNode;w?ye(S,d8,W):ye(S,X5,W,S.memoizedProps),Nc=!0}catch(ae){Tc(S,S.return,ae)}break;case 18:try{var oe=S.stateNode;w?ye(S,eW,oe):ye(S,u8,S.stateNode)}catch(ae){Tc(S,S.return,ae)}break;case 22:case 23:S.memoizedState===null&&F6(S,w);break;default:F6(S,w)}}function MH(S,w){if(S.subtreeFlags&67108864)for(S=S.child;S!==null;){e:{var Q=S,W=w;switch(Q.tag){case 4:EH(Q,W);break e;case 22:Q.memoizedState===null&&MH(Q,W);break e;default:MH(Q,W)}}S=S.sibling}}function GU(S){var w=S.alternate;w!==null&&(S.alternate=null,GU(w)),S.child=null,S.deletions=null,S.sibling=null,S.tag===5&&(w=S.stateNode,w!==null&&Ut(w)),S.stateNode=null,S._debugOwner=null,S.return=null,S.dependencies=null,S.memoizedProps=null,S.memoizedState=null,S.pendingProps=null,S.stateNode=null,S.updateQueue=null}function r2(S,w,Q){for(Q=Q.child;Q!==null;)wH(S,w,Q),Q=Q.sibling}function wH(S,w,Q){if(ph&&typeof ph.onCommitFiberUnmount==="function")try{ph.onCommitFiberUnmount(T8,Q)}catch(_t){jg||(jg=!0,console.error("React instrumentation encountered an error: %o",_t))}var W=N0(),oe=e2(),ae=p1(),De=Vl();switch(Q.tag){case 26:_h||Bc(Q,w),r2(S,w,Q),Q.memoizedState?Q.memoizedState.count--:Q.stateNode&&!_h&&(S=Q.stateNode,S.parentNode.removeChild(S));break;case 27:_h||Bc(Q,w),Xd(Q);var ke=Xm,ot=lx;ox(Q.type)&&(Xm=Q.stateNode,lx=!1),r2(S,w,Q),ye(Q,y8,Q.stateNode,Q.type,Q.memoizedProps),Xm=ke,lx=ot;break;case 5:_h||Bc(Q,w),Xd(Q);case 6:if(Q.tag===6&&Xd(Q),ke=Xm,ot=lx,Xm=null,r2(S,w,Q),Xm=ke,lx=ot,Xm!==null)if(lx)try{ye(Q,h8,Xm,Q.stateNode),Nc=!0}catch(_t){Tc(Q,w,_t)}else try{ye(Q,nI,Xm,Q.stateNode),Nc=!0}catch(_t){Tc(Q,w,_t)}break;case 18:Xm!==null&&(lx?(S=Xm,XH(S.nodeType===9?S.body:S.nodeName==="HTML"?S.ownerDocument.body:S,Q.stateNode),vd(S)):XH(Xm,Q.stateNode));break;case 4:ke=Xm,ot=lx,Xm=Q.stateNode.containerInfo,lx=!0,r2(S,w,Q),Xm=ke,lx=ot;break;case 0:case 11:case 14:case 15:k6(L1,Q,w),_h||CH(Q,w,c4),r2(S,w,Q);break;case 1:_h||(Bc(Q,w),ke=Q.stateNode,typeof ke.componentWillUnmount==="function"&&FU(Q,w,ke)),r2(S,w,Q);break;case 21:r2(S,w,Q);break;case 22:_h=(ke=_h)||Q.memoizedState!==null,r2(S,w,Q),_h=ke;break;case 30:Q.flags&18874368&&PE(Q),Bc(Q,w),r2(S,w,Q);break;case 7:_h||Bc(Q,w),r2(S,w,Q);break;default:r2(S,w,Q)}(Q.mode&Sa)!==hs&&0<=Ti&&0<=Zi&&(O0||0.05<c0)&&Eu(Q,Ti,Zi,c0,Lu),Qm(W),tf(oe),Lu=ae,O0=De}function UU(S,w){if(w.memoizedState===null&&(S=w.alternate,S!==null&&(S=S.memoizedState,S!==null))){S=S.dehydrated;try{ye(w,oW,S)}catch(Q){Tc(w,w.return,Q)}}}function WU(S,w){if(w.memoizedState===null&&(S=w.alternate,S!==null&&(S=S.memoizedState,S!==null&&(S=S.dehydrated,S!==null))))try{ye(w,rW,S)}catch(Q){Tc(w,w.return,Q)}}function Ui(S){switch(S.tag){case 31:case 13:case 19:var w=S.stateNode;return w===null&&(w=S.stateNode=new v2t),w;case 22:return S=S.stateNode,w=S._retryCache,w===null&&(w=S._retryCache=new v2t),w;default:throw Error("Unexpected Suspense handler tag ("+S.tag+"). This is a bug in React.")}}function z6(S,w){var Q=Ui(S);w.forEach(function(W){if(!Q.has(W)){if(Q.add(W),g2)if(RW!==null&&QW!==null)tx(QW,RW);else throw Error("Expected finished root and lanes to be set. This is a bug in React.");var oe=gr.bind(null,S,W);W.then(oe,oe)}})}function H0(S,w,Q){var W=w.deletions;if(W!==null)for(var oe=0;oe<W.length;oe++){var ae=S,De=w,ke=W[oe],ot=N0(),_t=De;e:for(;_t!==null;){switch(_t.tag){case 27:if(ox(_t.type)){Xm=_t.stateNode,lx=!1;break e}break;case 5:Xm=_t.stateNode,lx=!1;break e;case 3:case 4:Xm=_t.stateNode.containerInfo,lx=!0;break e}_t=_t.return}if(Xm===null)throw Error("Expected to find a host parent. This error is likely caused by a bug in React. Please file an issue.");wH(ae,De,ke),Xm=null,lx=!1,(ke.mode&Sa)!==hs&&0<=Ti&&0<=Zi&&0.05<Zi-Ti&&qA(ke,Ti,Zi,"Unmount"),Qm(ot),ae=ke,De=ae.alternate,De!==null&&(De.return=null),ae.return=null}if(w.subtreeFlags&13886)for(w=w.child;w!==null;)iC(w,S,Q),w=w.sibling}function iC(S,w,Q){var W=N0(),oe=e2(),ae=p1(),De=Vl(),{alternate:ke,flags:ot}=S;switch(S.tag){case 0:case 11:case 14:case 15:if(ot&4&&(ke=S.updateQueue,ke=ke!==null?ke.events:null,ke!==null))for(var _t=0;_t<ke.length;_t++){var zt=ke[_t];zt.ref.impl=zt.nextImpl}H0(w,S,Q),Hm(S),ot&4&&(k6(L1|DC,S,S.return),SE(L1|DC,S),CH(S,S.return,c4|DC));break;case 1:H0(w,S,Q),Hm(S),ot&512&&(_h||ke===null||Bc(ke,ke.return)),ot&64&&Zg&&(w=S.updateQueue,w!==null&&(Q=w.callbacks,Q!==null&&(ot=w.shared.hiddenCallbacks,w.shared.hiddenCallbacks=ot===null?Q:ot.concat(Q))));break;case 26:if(_t=vI,H0(w,S,Q),Hm(S),ot&512&&(_h||ke===null||Bc(ke,ke.return)),ot&4)if(ot=ke!==null?ke.memoizedState:null,Q=S.memoizedState,ke===null)if(Q===null)if(S.stateNode===null)if(Zg)S.stateNode=Om(S.type,S.memoizedProps,w.containerInfo,S);else{e:{w=S.type,Q=S.memoizedProps,ot=_t.ownerDocument||_t;t:switch(w){case"title":if(ke=ot.getElementsByTagName("title")[0],!ke||ke[ix]||ke[ku]||ke.namespaceURI===Te||ke.hasAttribute("itemprop"))ke=ot.createElement(w),ot.head.insertBefore(ke,ot.querySelector("head > title"));hp(ke,w,Q),ke[ku]=S,ln(ke),w=ke;break e;case"link":if(_t=Mt("link","href",ot).get(w+(Q.href||""))){for(zt=0;zt<_t.length;zt++)if(ke=_t[zt],ke.getAttribute("href")===(Q.href==null||Q.href===""?null:Q.href)&&ke.getAttribute("rel")===(Q.rel==null?null:Q.rel)&&ke.getAttribute("title")===(Q.title==null?null:Q.title)&&ke.getAttribute("crossorigin")===(Q.crossOrigin==null?null:Q.crossOrigin)){_t.splice(zt,1);break t}}ke=ot.createElement(w),hp(ke,w,Q),ot.head.appendChild(ke);break;case"meta":if(_t=Mt("meta","content",ot).get(w+(Q.content||""))){for(zt=0;zt<_t.length;zt++)if(ke=_t[zt],dt(Q.content,"content"),ke.getAttribute("content")===(Q.content==null?null:""+Q.content)&&ke.getAttribute("name")===(Q.name==null?null:Q.name)&&ke.getAttribute("property")===(Q.property==null?null:Q.property)&&ke.getAttribute("http-equiv")===(Q.httpEquiv==null?null:Q.httpEquiv)&&ke.getAttribute("charset")===(Q.charSet==null?null:Q.charSet)){_t.splice(zt,1);break t}}ke=ot.createElement(w),hp(ke,w,Q),ot.head.appendChild(ke);break;default:throw Error('getNodesForType encountered a type it did not expect: "'+w+'". This is a bug in React.')}ke[ku]=S,ln(ke),w=ke}S.stateNode=w}else Zg||Rt(_t,S.type,S.stateNode);else S.stateNode=fe(_t,Q,S.memoizedProps);else ot!==Q?(ot===null?(w=ke.stateNode,w===null||_h||w.parentNode.removeChild(w)):ot.count--,Q===null?Zg||Rt(_t,S.type,S.stateNode):fe(_t,Q,S.memoizedProps)):Q===null&&S.stateNode!==null&&SH(S,S.memoizedProps,ke.memoizedProps);break;case 27:H0(w,S,Q),Hm(S),ot&512&&(_h||ke===null||Bc(ke,ke.return)),ke!==null&&ot&4&&SH(S,S.memoizedProps,ke.memoizedProps);break;case 5:if(_t=F8,F8=!1,H0(w,S,Q),F8=_t,Hm(S),ot&512&&(_h||ke===null||Bc(ke,ke.return)),S.flags&32){w=S.stateNode;try{ye(S,tI,w),Nc=!0}catch(Co){Tc(S,S.return,Co)}}ot&4&&S.stateNode!=null&&(w=S.memoizedProps,SH(S,w,ke!==null?ke.memoizedProps:w)),ot&1024&&(tDe=!0,S.type!=="form"&&console.error("Unexpected host component type. Expected a form. This is a bug in React."));break;case 6:if(H0(w,S,Q),Hm(S),ot&4){if(S.stateNode===null)throw Error("This should have a text node initialized. This error is likely caused by a bug in React. Please file an issue.");w=S.memoizedProps,Q=ke!==null?ke.memoizedProps:w,ot=S.stateNode;try{ye(S,WH,ot,Q,w),Nc=!0}catch(Co){Tc(S,S.return,Co)}}break;case 3:if(_t=Zf(),Nc=!1,Dge=null,zt=vI,vI=aI(w.containerInfo),H0(w,S,Q),vI=zt,Hm(S),ot&4&&ke!==null&&ke.memoizedState.isDehydrated)try{ye(S,rx,w.containerInfo)}catch(Co){Tc(S,S.return,Co)}tDe&&(tDe=!1,yD(S)),w.effectDuration+=rE(_t),Nc=!1;break;case 4:ot=F8,F8=Zg,ke=Oe(),_t=vI,vI=aI(S.stateNode.containerInfo),H0(w,S,Q),Hm(S),vI=_t,Nc&&Moe&&(lge=!0),Nc=ke,F8=ot;break;case 12:ot=Zf(),H0(w,S,Q),Hm(S),S.stateNode.effectDuration+=ef(ot);break;case 31:H0(w,S,Q),Hm(S),ot&4&&(w=S.updateQueue,w!==null&&(S.updateQueue=null,z6(S,w)));break;case 13:H0(w,S,Q),Hm(S),S.child.flags&8192&&S.memoizedState!==null!==(ke!==null&&ke.memoizedState!==null)&&(_ge=Ki()),ot&4&&(w=S.updateQueue,w!==null&&(S.updateQueue=null,z6(S,w)));break;case 22:_t=S.memoizedState!==null,zt=ke!==null&&ke.memoizedState!==null;var en=Zg,Zt=_h,xn=F8;Zg=en||_t,F8=xn||_t,_h=Zt||zt,H0(w,S,Q),_h=Zt,F8=xn,Zg=en,zt&&!_t&&!en&&!Zt&&(S.mode&Sa)!==hs&&0<=Ti&&0<=Zi&&0.05<Zi-Ti&&F3(S,Ti,Zi),Hm(S),ot&8192&&(w=S.stateNode,w._visibility=_t?w._visibility&~soe:w._visibility|soe,!_t||ke===null||zt||Zg||_h||(w=cge,Q=zt||_h,ke=Zg,zt=_h,Zg=_t||Zg,_h=Q,v1(S,w),(S.mode&Sa)!==hs&&0<=Ti&&0<=Zi&&0.05<Zi-Ti&&qA(S,Ti,Zi,"Disconnect"),Zg=ke,_h=zt),!_t&&F8||F6(S,_t)),ot&4&&(w=S.updateQueue,w!==null&&(Q=w.retryQueue,Q!==null&&(w.retryQueue=null,z6(S,Q))));break;case 19:H0(w,S,Q),Hm(S),ot&4&&(w=S.updateQueue,w!==null&&(S.updateQueue=null,z6(S,w)));break;case 30:ot&512&&(_h||ke===null||Bc(ke,ke.return)),ot=Oe(),_t=Moe,zt=(Q&335544064)===Q,en=S.memoizedProps,Moe=zt&&Rm(en.default,en.update)!=="none",H0(w,S,Q),Hm(S),zt&&ke!==null&&Nc&&(S.flags|=4),Moe=_t,Nc=ot;break;case 21:break;case 7:ot&512&&(_h||ke===null||Bc(ke,ke.return)),ke&&ke.stateNode!==null&&(ke.stateNode._fragmentFiber=S);default:H0(w,S,Q),Hm(S)}(S.mode&Sa)!==hs&&0<=Ti&&0<=Zi&&((O0||0.05<c0)&&Eu(S,Ti,Zi,c0,Lu),S.alternate===null&&S.return!==null&&S.return.alternate!==null&&0.05<Zi-Ti&&(YU(S.return.alternate,S.return)||qA(S,Ti,Zi,"Mount"))),Qm(W),tf(oe),Lu=ae,O0=De}function Hm(S){var w=S.flags;if(w&2){try{ye(S,zU,S)}catch(Q){Tc(S,S.return,Q)}S.flags&=-3}w&4096&&(S.flags&=-4097)}function yD(S){if(S.subtreeFlags&1024)for(S=S.child;S!==null;){var w=S;yD(w),w.tag===5&&w.flags&1024&&(w=w.stateNode,XW=!0,w.reset(),XW=!1),S=S.sibling}}function I1(S,w){if(w.subtreeFlags&9270)for(w=w.child;w!==null;)O6(w,S),w=w.sibling;else oC(w,!1)}function O6(S,w){var Q=S.alternate;if(Q===null)lf(S,!1);else switch(S.tag){case 3:if(nDe=z8=!1,o2(),I1(w,S),!z8&&!lge){if(S=H8,S!==null)for(var W=0;W<S.length;W+=3){Q=S[W];var oe=S[W+1];j5(Q,S[W+2]),Q=Q.ownerDocument.documentElement,Q!==null&&Q.animate({opacity:[0,0],pointerEvents:["none","none"]},{duration:0,fill:"forwards",pseudoElement:"::view-transition-group("+oe+")"})}S=w.containerInfo,S=S.nodeType===9?S.documentElement:S.ownerDocument.documentElement,S!==null&&S.style.viewTransitionName===""&&(S.style.viewTransitionName="none",S.animate({opacity:[0,0],pointerEvents:["none","none"]},{duration:0,fill:"forwards",pseudoElement:"::view-transition-group(root)"}),S.animate({width:[0,0],height:[0,0]},{duration:0,fill:"forwards",pseudoElement:"::view-transition"})),nDe=!0}H8=null;break;case 5:I1(w,S);break;case 4:W=z8,z8=!1,I1(w,S),z8&&(lge=!0),z8=W;break;case 22:S.memoizedState===null&&(Q.memoizedState!==null?lf(S,!1):I1(w,S));break;case 30:W=z8,oe=o2(),z8=!1,I1(w,S),z8&&(S.flags|=4);var ae=S.memoizedProps,De=S.stateNode;w=Yp(ae,De),De=Yp(Q.memoizedProps,De);var ke=Rm(ae.default,ae.update);ke==="none"?w=!1:(ae=Q.memoizedState,Q.memoizedState=null,Q=S.child,cx=0,w=Uv(S,Q,w,De,ke,ae,!0),cx!==(ae===null?0:ae.length)&&(S.flags|=32)),(S.flags&4)!==0&&w?(U6(S,S.memoizedProps.onUpdate),H8=oe):oe!==null&&(oe.push.apply(oe,H8),H8=oe),z8=(S.flags&32)!==0?!0:W;break;default:I1(w,S)}}function i2(S,w){if(w.subtreeFlags&8772)for(w=w.child;w!==null;)PH(S,w.alternate,w),w=w.sibling}function XU(S,w){var Q=N0(),W=e2(),oe=p1(),ae=Vl();switch(S.tag){case 0:case 11:case 14:case 15:CH(S,S.return,c4),v1(S,w);break;case 1:Bc(S,S.return);var De=S.stateNode;typeof De.componentWillUnmount==="function"&&FU(S,S.return,De),v1(S,w);break;case 27:(w&cge)!==Eoe&&ye(S,y8,S.stateNode,S.type,S.memoizedProps);case 5:Bc(S,S.return),S.tag!==5&&S.tag!==27||Xd(S),v1(S,w);break;case 6:Xd(S);break;case 26:Bc(S,S.return),De=S.stateNode,S.memoizedState!==null||De===null||_h||De.parentNode.removeChild(De),v1(S,w);break;case 22:S.memoizedState===null&&v1(S,w);break;case 30:S.flags&18874368&&PE(S),Bc(S,S.return),v1(S,w);break;case 7:Bc(S,S.return);default:v1(S,w)}(S.mode&Sa)!==hs&&0<=Ti&&0<=Zi&&(O0||0.05<c0)&&Eu(S,Ti,Zi,c0,Lu),Qm(Q),tf(W),Lu=oe,O0=ae}function v1(S,w){for(S=S.child;S!==null;)XU(S,w),S=S.sibling}function jU(S,w,Q,W){var oe=N0(),ae=e2(),De=p1(),ke=Vl(),ot=Q.flags,_t=(W&eDe)!==Eoe;switch(Q.tag){case 0:case 11:case 15:Y_(S,Q,W),Yl(Q,c4);break;case 1:if(Y_(S,Q,W),w=Q.stateNode,typeof w.componentDidMount==="function"&&ye(Q,FTe,Q,w),w=Q.updateQueue,w!==null){S=Q.stateNode;try{ye(Q,pE,w,S)}catch(en){Tc(Q,Q.return,en)}}_t&&ot&64&&cf(Q),Pl(Q,Q.return);break;case 27:(W&cge)!==Eoe&&H6(Q);case 5:Q.tag!==5&&Q.tag!==27||bH(Q),Y_(S,Q,W),_t&&w===null&&ot&4&&vH(Q),Pl(Q,Q.return);break;case 6:bH(Q);break;case 26:var zt=Q.stateNode;Q.memoizedState!==null||zt===null||Zg||Rt(aI(zt.ownerDocument),Q.type,zt),Y_(S,Q,W),_t&&w===null&&ot&4&&vH(Q),Pl(Q,Q.return);break;case 12:if(_t&&ot&4){ot=Zf(),Y_(S,Q,W),_t=Q.stateNode,_t.effectDuration+=ef(ot);try{ye(Q,wu,Q,w,ZE,_t.effectDuration)}catch(en){Tc(Q,Q.return,en)}}else Y_(S,Q,W);break;case 31:Y_(S,Q,W),_t&&ot&4&&UU(S,Q);break;case 13:Y_(S,Q,W),_t&&ot&4&&WU(S,Q);break;case 22:Q.memoizedState===null&&Y_(S,Q,W),Pl(Q,Q.return);break;case 30:Y_(S,Q,W),ot&18874368&&VU(Q),Pl(Q,Q.return);break;case 7:Pl(Q,Q.return);default:Y_(S,Q,W)}(Q.mode&Sa)!==hs&&0<=Ti&&0<=Zi&&(O0||0.05<c0)&&Eu(Q,Ti,Zi,c0,Lu),Qm(oe),tf(ae),Lu=De,O0=ke}function Y_(S,w,Q){Q=(w.subtreeFlags&8772)!==0?Q:Q&~eDe;for(w=w.child;w!==null;)jU(S,w.alternate,w,Q),w=w.sibling}function Wv(S,w){var Q=null;S!==null&&S.memoizedState!==null&&S.memoizedState.cachePool!==null&&(Q=S.memoizedState.cachePool.pool),S=null,w.memoizedState!==null&&w.memoizedState.cachePool!==null&&(S=w.memoizedState.cachePool.pool),S!==Q&&(S!=null&&L5(S),Q!=null&&Jf(Q))}function Xv(S,w){S=null,w.alternate!==null&&(S=w.alternate.memoizedState.cache),w=w.memoizedState.cache,w!==S&&(L5(w),S!=null&&Jf(S))}function s2(S,w,Q,W,oe){var ae=(Q&335544064)===Q;if(w.subtreeFlags&(ae?10262:10256)||w.actualDuration!==0&&(w.alternate===null||w.alternate.child!==w.child))for(w=w.child;w!==null;)ae=w.sibling,EE(S,w,Q,W,ae!==null?ae.actualStartTime:oe),w=ae;else ae&&OU(w)}function EE(S,w,Q,W,oe){var ae=N0(),De=e2(),ke=p1(),ot=Vl(),_t=qD,zt=(Q&335544064)===Q;zt&&w.alternate===null&&w.return!==null&&w.return.alternate!==null&&Gl(w);var en=w.flags;switch(w.tag){case 0:case 11:case 15:(w.mode&Sa)!==hs&&0<w.actualStartTime&&(w.flags&1)!==0&&h1(w,w.actualStartTime,oe,$_,Q),s2(S,w,Q,W,oe),en&2048&&_D(w,y2|DC);break;case 1:(w.mode&Sa)!==hs&&0<w.actualStartTime&&((w.flags&128)!==0?d1(w,w.actualStartTime,oe,[]):(w.flags&1)!==0&&h1(w,w.actualStartTime,oe,$_,Q)),s2(S,w,Q,W,oe);break;case 3:var Zt=Zf(),xn=$_;$_=w.alternate!==null&&w.alternate.memoizedState.isDehydrated&&(w.flags&256)===0,s2(S,w,Q,W,oe),$_=xn,zt&&nDe&&(Q=S.containerInfo,Q=Q.nodeType===9?Q.body:Q.nodeName==="HTML"?Q.ownerDocument.body:Q,Q.style.viewTransitionName==="root"&&(Q.style.viewTransitionName=""),Q=Q.ownerDocument.documentElement,Q!==null&&Q.style.viewTransitionName==="none"&&(Q.style.viewTransitionName="")),en&2048&&(Q=null,w.alternate!==null&&(Q=w.alternate.memoizedState.cache),W=w.memoizedState.cache,W!==Q&&(L5(W),Q!=null&&Jf(Q))),S.passiveEffectDuration+=rE(Zt);break;case 12:if(en&2048){en=Zf(),s2(S,w,Q,W,oe),S=w.stateNode,S.passiveEffectDuration+=ef(en);try{ye(w,V_,w,w.alternate,ZE,S.passiveEffectDuration)}catch(Co){Tc(w,w.return,Co)}}else s2(S,w,Q,W,oe);break;case 31:en=$_,Zt=w.alternate!==null?w.alternate.memoizedState:null,zt=w.memoizedState,Zt!==null&&zt===null?(zt=w.deletions,zt!==null&&0<zt.length&&zt[0].tag===18?($_=!1,Zt=Zt.hydrationErrors,Zt!==null&&d1(w,w.actualStartTime,oe,Zt)):$_=!0):$_=!1,s2(S,w,Q,W,oe),$_=en;break;case 13:en=$_,Zt=w.alternate!==null?w.alternate.memoizedState:null,zt=w.memoizedState,Zt===null||Zt.dehydrated===null||zt!==null&&zt.dehydrated!==null?$_=!1:(zt=w.deletions,zt!==null&&0<zt.length&&zt[0].tag===18?($_=!1,Zt=Zt.hydrationErrors,Zt!==null&&d1(w,w.actualStartTime,oe,Zt)):$_=!0),s2(S,w,Q,W,oe),$_=en;break;case 23:break;case 22:xn=w.stateNode,Zt=w.alternate,w.memoizedState!==null?(zt&&Zt!==null&&Zt.memoizedState===null&&Gl(Zt),xn._visibility&KE?s2(S,w,Q,W,oe):sC(S,w,Q,W,oe)):(zt&&Zt!==null&&Zt.memoizedState!==null&&Gl(w),xn._visibility&KE?s2(S,w,Q,W,oe):(xn._visibility|=KE,jv(S,w,Q,W,(w.subtreeFlags&10256)!==0||w.actualDuration!==0&&(w.alternate===null||w.alternate.child!==w.child),oe),(w.mode&Sa)===hs||$_||(S=w.actualStartTime,0<=S&&0.05<oe-S&&F3(w,S,oe),0<=Ti&&0<=Zi&&0.05<Zi-Ti&&F3(w,Ti,Zi)))),en&2048&&Wv(Zt,w);break;case 24:s2(S,w,Q,W,oe),en&2048&&Xv(w.alternate,w);break;case 30:zt&&(en=w.alternate,en!==null&&(Xh(en.child,!0),Xh(w.child,!0))),s2(S,w,Q,W,oe);break;default:s2(S,w,Q,W,oe)}if((w.mode&Sa)!==hs){if(S=!$_&&w.alternate===null&&w.return!==null&&w.return.alternate!==null)Q=w.actualStartTime,0<=Q&&0.05<oe-Q&&qA(w,Q,oe,"Mount");0<=Ti&&0<=Zi&&((O0||0.05<c0)&&Eu(w,Ti,Zi,c0,Lu),S&&0.05<Zi-Ti&&qA(w,Ti,Zi,"Mount"))}Qm(ae),tf(De),Lu=ke,O0=ot,qD=_t}function jv(S,w,Q,W,oe,ae){oe=oe&&((w.subtreeFlags&10256)!==0||w.actualDuration!==0&&(w.alternate===null||w.alternate.child!==w.child));for(w=w.child;w!==null;){var De=w.sibling;BH(S,w,Q,W,oe,De!==null?De.actualStartTime:ae),w=De}}function BH(S,w,Q,W,oe,ae){var De=N0(),ke=e2(),ot=p1(),_t=Vl(),zt=qD;oe&&(w.mode&Sa)!==hs&&0<w.actualStartTime&&(w.flags&1)!==0&&h1(w,w.actualStartTime,ae,$_,Q);var en=w.flags;switch(w.tag){case 0:case 11:case 15:jv(S,w,Q,W,oe,ae),_D(w,y2);break;case 23:break;case 22:var Zt=w.stateNode;w.memoizedState!==null?Zt._visibility&KE?jv(S,w,Q,W,oe,ae):sC(S,w,Q,W,ae):(Zt._visibility|=KE,jv(S,w,Q,W,oe,ae)),oe&&en&2048&&Wv(w.alternate,w);break;case 24:jv(S,w,Q,W,oe,ae),oe&&en&2048&&Xv(w.alternate,w);break;default:jv(S,w,Q,W,oe,ae)}(w.mode&Sa)!==hs&&0<=Ti&&0<=Zi&&(O0||0.05<c0)&&Eu(w,Ti,Zi,c0,Lu),Qm(De),tf(ke),Lu=ot,O0=_t,qD=zt}function sC(S,w,Q,W,oe){if(w.subtreeFlags&10256||w.actualDuration!==0&&(w.alternate===null||w.alternate.child!==w.child))for(var ae=w.child;ae!==null;){w=ae.sibling;var De=S,ke=Q,ot=W,_t=w!==null?w.actualStartTime:oe,zt=qD;(ae.mode&Sa)!==hs&&0<ae.actualStartTime&&(ae.flags&1)!==0&&h1(ae,ae.actualStartTime,_t,$_,ke);var en=ae.flags;switch(ae.tag){case 22:sC(De,ae,ke,ot,_t),en&2048&&Wv(ae.alternate,ae);break;case 24:sC(De,ae,ke,ot,_t),en&2048&&Xv(ae.alternate,ae);break;default:sC(De,ae,ke,ot,_t)}qD=zt,ae=w}}function V6(S,w,Q){if(S.subtreeFlags&fF)for(S=S.child;S!==null;)xD(S,w,Q),S=S.sibling}function xD(S,w,Q){switch(S.tag){case 26:V6(S,w,Q),S.flags&fF&&(S.memoizedState!==null?Br(Q,vI,S.memoizedState,S.memoizedProps):(S=S.stateNode,(w&335544128)===w&&qo(Q,S)));break;case 5:V6(S,w,Q),S.flags&fF&&(S=S.stateNode,(w&335544128)===w&&qo(Q,S));break;case 3:case 4:var W=vI;vI=aI(S.stateNode.containerInfo),V6(S,w,Q),vI=W;break;case 22:S.memoizedState===null&&(W=S.alternate,W!==null&&W.memoizedState!==null?(W=fF,fF=16777216,V6(S,w,Q),fF=W):V6(S,w,Q));break;case 30:if((S.flags&fF)!==0&&(W=S.memoizedProps.name,W!=null&&W!=="auto")){var oe=S.stateNode;oe.paired=null,l4===null&&(l4=new Map),l4.set(W,oe)}V6(S,w,Q);break;default:V6(S,w,Q)}}function ME(S){var w=S.alternate;if(w!==null&&(S=w.child,S!==null)){w.child=null;do w=S.sibling,S.sibling=null,S=w;while(S!==null)}}function wE(S){var w=S.deletions;if((S.flags&16)!==0){if(w!==null)for(var Q=0;Q<w.length;Q++){var W=w[Q],oe=N0();eA=W,bD(W,S),(W.mode&Sa)!==hs&&0<=Ti&&0<=Zi&&0.05<Zi-Ti&&qA(W,Ti,Zi,"Unmount"),Qm(oe)}ME(S)}if(S.subtreeFlags&10256)for(S=S.child;S!==null;)CD(S),S=S.sibling}function CD(S){var w=N0(),Q=e2(),W=p1(),oe=Vl();switch(S.tag){case 0:case 11:case 15:wE(S),S.flags&2048&&n2(S,S.return,y2|DC);break;case 3:var ae=Zf();wE(S),S.stateNode.passiveEffectDuration+=rE(ae);break;case 12:ae=Zf(),wE(S),S.stateNode.passiveEffectDuration+=ef(ae);break;case 22:ae=S.stateNode,S.memoizedState!==null&&ae._visibility&KE&&(S.return===null||S.return.tag!==13)?(ae._visibility&=~KE,Kv(S),(S.mode&Sa)!==hs&&0<=Ti&&0<=Zi&&0.05<Zi-Ti&&qA(S,Ti,Zi,"Disconnect")):wE(S);break;default:wE(S)}(S.mode&Sa)!==hs&&0<=Ti&&0<=Zi&&(O0||0.05<c0)&&Eu(S,Ti,Zi,c0,Lu),Qm(w),tf(Q),O0=oe,Lu=W}function Kv(S){var w=S.deletions;if((S.flags&16)!==0){if(w!==null)for(var Q=0;Q<w.length;Q++){var W=w[Q],oe=N0();eA=W,bD(W,S),(W.mode&Sa)!==hs&&0<=Ti&&0<=Zi&&0.05<Zi-Ti&&qA(W,Ti,Zi,"Unmount"),Qm(oe)}ME(S)}for(S=S.child;S!==null;)TH(S),S=S.sibling}function TH(S){var w=N0(),Q=e2(),W=p1(),oe=Vl();switch(S.tag){case 0:case 11:case 15:n2(S,S.return,y2),Kv(S);break;case 22:var ae=S.stateNode;ae._visibility&KE&&(ae._visibility&=~KE,Kv(S));break;default:Kv(S)}(S.mode&Sa)!==hs&&0<=Ti&&0<=Zi&&(O0||0.05<c0)&&Eu(S,Ti,Zi,c0,Lu),Qm(w),tf(Q),O0=oe,Lu=W}function bD(S,w){for(;eA!==null;){var Q=eA,W=Q,oe=w,ae=N0(),De=e2(),ke=p1(),ot=Vl();switch(W.tag){case 0:case 11:case 15:n2(W,oe,y2);break;case 23:case 22:W.memoizedState!==null&&W.memoizedState.cachePool!==null&&(oe=W.memoizedState.cachePool.pool,oe!=null&&L5(oe));break;case 24:Jf(W.memoizedState.cache)}if((W.mode&Sa)!==hs&&0<=Ti&&0<=Zi&&(O0||0.05<c0)&&Eu(W,Ti,Zi,c0,Lu),Qm(ae),tf(De),O0=ot,Lu=ke,W=Q.child,W!==null)W.return=Q,eA=W;else e:for(Q=S;eA!==null;){if(W=eA,ae=W.sibling,De=W.return,GU(W),W===Q){eA=null;break e}if(ae!==null){ae.return=De,eA=ae;break e}eA=De}}}function Y6(){Tfo.forEach(function(S){return S()})}function G6(){var S=typeof IS_REACT_ACT_ENVIRONMENT<"u"?IS_REACT_ACT_ENVIRONMENT:void 0;return S||Vn.actQueue===null||console.error("The current testing environment is not configured to support act(...)"),S}function Xp(S){if((Vc&q_)!==tA&&na!==0)return na&-na;var w=Vn.T;if(w!==null)return w._updatedFibers||(w._updatedFibers=new Set),w._updatedFibers.add(S),mF!==null&&Nt()===om&&(mF=null),Y5();return S=Nt(),S===om&&(mF=null),S}function ID(){if(dx===0)if((na&536870912)===0||Pa){var S=D8;D8<<=1,(D8&3932160)===0&&(D8=262144),dx=S}else dx=536870912;return S=Af.current,S!==null&&(S.flags|=32),dx}function U6(S,w){if(w!=null){var Q=S.stateNode,W=Q.ref;W===null&&(W=Q.ref=Gg(Yp(S.memoizedProps,Q))),HW===null&&(HW=[]),HW.push(w.bind(null,W))}}function Id(S,w,Q){if(zW&&console.error("useInsertionEffect must not schedule updates."),uDe&&(bge=!0),S===$h&&(gh===xF||gh===CF)||S.cancelPendingCommit!==null)$v(S,0),Zy(S,na,dx,!1);if(tt(S,Q),(Vc&q_)!==tA&&S===$h){if(i4)switch(w.tag){case 0:case 11:case 15:S=Qa&&Y(Qa)||"Unknown",k2t.has(S)||(k2t.add(S),w=Y(w)||"Unknown",console.error("Cannot update a component (`%s`) while rendering a different component (`%s`). To locate the bad setState() call inside `%s`, follow the stack trace as described in https://react.dev/link/setstate-in-render",w,S,S));break;case 1:Q2t||(console.error("Cannot update during an existing state transition (such as within `render`). Render methods should be a pure function of props and state."),Q2t=!0)}}else g2&&je(S,w,Q),n8(w),S===$h&&((Vc&q_)===tA&&(hN|=Q),l0===cN&&Zy(S,na,dx,!1)),h2(S)}function KU(S,w,Q){if((Vc&(q_|h4))!==tA)throw Error("Should not already be working.");if(na!==0&&Qa!==null){var W=Qa,oe=Ki();switch(wft){case Doe:case xF:var ae=poe;eu&&((W=W._debugTask)?W.run(console.timeStamp.bind(console,"Suspended",ae,oe,sx,void 0,"primary-light")):console.timeStamp("Suspended",ae,oe,sx,void 0,"primary-light"));break;case CF:ae=poe,eu&&((W=W._debugTask)?W.run(console.timeStamp.bind(console,"Action",ae,oe,sx,void 0,"primary-light")):console.timeStamp("Action",ae,oe,sx,void 0,"primary-light"));break;default:eu&&(W=oe-poe,3>W||console.timeStamp("Blocked",poe,oe,sx,void 0,5>W?"primary-light":10>W?"primary":100>W?"primary-dark":"error"))}}ae=(Q=!Q&&(w&127)===0&&(w&S.expiredLanes)===0||xt(S,w))?QH(S,w):RH(S,w,!0);var De=Q;do{if(ae===rM){kW&&!Q&&Zy(S,w,0,!1),w=gh,poe=rm(),wft=w;break}else{if(W=Ki(),oe=S.current.alternate,De&&!$U(oe)){Ol(w),oe=Jg,ae=W,!eu||ae<=oe||(V0?V0.run(console.timeStamp.bind(console,"Teared Render",oe,ae,ec,Ga,"error")):console.timeStamp("Teared Render",oe,ae,ec,Ga,"error")),aC(w,W),ae=RH(S,w,!1),De=!1;continue}if(ae===yF){if(De=w,S.errorRecoveryDisabledLanes&De)var ke=0;else ke=S.pendingLanes&-536870913,ke=ke!==0?ke:ke&536870912?536870912:0;if(ke!==0){Ol(w),eE(Jg,W,w,V0),aC(w,W),w=ke;e:{W=S,ae=De,De=Roe;var ot=W.current.memoizedState.isDehydrated;if(ot&&($v(W,ke).flags|=256),ke=RH(W,ke,!1),ke!==yF&&ke!==Toe){if(iDe&&!ot){W.errorRecoveryDisabledLanes|=ae,hN|=ae,ae=cN;break e}W=H1,H1=De,W!==null&&(H1===null?H1=W:H1.push.apply(H1,W))}ae=ke}if(De=!1,ae!==yF)continue;else W=Ki()}}if(ae===Boe){Ol(w),eE(Jg,W,w,V0),aC(w,W),$v(S,0),Zy(S,w,0,!0);break}e:{switch(Q=S,ae){case rM:case Boe:throw Error("Root did not complete. This is a bug in React.");case cN:if((w&4194048)!==w&&(w&62914560)!==w)break;case Toe:Ol(w),ZP(Jg,W,w,V0),aC(w,W),oe=w,(oe&127)!==0?X_e=W:(oe&4194048)!==0&&(j_e=W),Zy(Q,w,dx,!iM);break e;case yF:H1=null;break;case hge:case S2t:break;default:throw Error("Unknown root exit status.")}if(Vn.actQueue!==null)ex(Q,oe,w,H1,Qoe,mge,dx,hN,bF,iM,ae,null,null,Jg,W);else{if((w&62914560)===w&&(De=_ge+M2t-Ki(),10<De)){if(Zy(Q,w,dx,!iM),Bt(Q,0,!0)!==0)break e;ux=w,Q.timeoutHandle=IDe(a2.bind(null,Q,oe,H1,Qoe,mge,w,dx,hN,bF,iM,ae,"Throttled",Jg,W),De);break e}a2(Q,oe,H1,Qoe,mge,w,dx,hN,bF,iM,ae,null,Jg,W)}}}break}while(1);h2(S)}function a2(S,w,Q,W,oe,ae,De,ke,ot,_t,zt,en,Zt,xn){S.timeoutHandle=MF;var Co=w.subtreeFlags,xr=(ae&335544064)===ae,li=null;if(xr||Co&8192||(Co&16785408)===16785408){if(li={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:fd},l4=null,xD(w,ae,li),xr&&(Co=li,xr=S.containerInfo,xr=(xr.nodeType===9?xr:xr.ownerDocument).__reactViewTransition,xr!=null&&(Co.count++,Co.waitingForViewTransition=!0,Co=kr.bind(Co),xr.finished.then(Co,Co))),Co=(ae&62914560)===ae?_ge-Ki():(ae&4194048)===ae?E2t-Ki():0,Co=Hi(li,Co),Co!==null){ux=ae,S.cancelPendingCommit=Co(ex.bind(null,S,w,ae,Q,W,oe,De,ke,ot,_t,zt,li,li.waitingForViewTransition?"Waiting for the previous Animation":0<li.count?0<li.imgCount?"Suspended on CSS and Images":"Suspended on CSS":li.imgCount===1?"Suspended on an Image":0<li.imgCount?"Suspended on Images":null,Zt,xn)),Zy(S,ae,De,!_t);return}}ex(S,w,ae,Q,W,oe,De,ke,ot,_t,zt,li,en,Zt,xn)}function $U(S){for(var w=S;;){var Q=w.tag;if((Q===0||Q===11||Q===15)&&w.flags&16384&&(Q=w.updateQueue,Q!==null&&(Q=Q.stores,Q!==null)))for(var W=0;W<Q.length;W++){var oe=Q[W],ae=oe.getSnapshot;oe=oe.value;try{if(!Q1(ae(),oe))return!1}catch(De){return!1}}if(Q=w.child,w.subtreeFlags&16384&&Q!==null)Q.return=w,w=Q;else{if(w===S)break;for(;w.sibling===null;){if(w.return===null||w.return===S)return!0;w=w.return}w.sibling.return=w.return,w=w.sibling}}return!0}function Zy(S,w,Q,W){w=Yt(S,w),w&=~pge,w&=~hN,S.suspendedLanes|=w,S.pingedLanes&=~w,W&&(S.warmLanes|=w),W=S.expirationTimes;for(var oe=w;0<oe;){var ae=31-Wl(oe),De=1<<ae;W[ae]=-1,oe&=~De}Q!==0&&$e(S,Q,w)}function W6(){return(Vc&(q_|h4))===tA?(o8(0,!1),!1):!0}function vD(){if(Qa!==null){if(gh===hx)var S=Qa.return;else S=Qa,O3(),rf(S),MW=null,boe=0,S=Qa;for(;S!==null;)Q6(S.alternate,S),S=S.return;Qa=null}}function aC(S,w){(S&127)!==0&&(tN=w),(S&4194048)!==0&&(CI=w),(S&62914560)!==0&&(QTe=w),(S&2080374784)!==0&&(kTe=w)}function $v(S,w){eu&&(console.timeStamp("Blocking Track",0.003,0.003,"Blocking",Ga,"primary-light"),console.timeStamp("Transition Track",0.003,0.003,"Transition",Ga,"primary-light"),console.timeStamp("Suspense Track",0.003,0.003,"Suspense",Ga,"primary-light"),console.timeStamp("Idle Track",0.003,0.003,"Idle",Ga,"primary-light"));var Q=Jg;if(Jg=rm(),na!==0&&0<Q){if(Ol(na),l0===hge||l0===cN)ZP(Q,Jg,w,V0);else{var W=Jg,oe=V0;if(eu&&!(W<=Q)){var ae=(w&738197653)===w?"tertiary-dark":"primary-dark",De=(w&536870912)===w?"Prewarm":(w&201326741)===w?"Interrupted Hydration":"Interrupted Render";oe?oe.run(console.timeStamp.bind(console,De,Q,W,ec,Ga,ae)):console.timeStamp(De,Q,W,ec,Ga,ae)}}aC(na,Jg)}if(Q=V0,V0=null,(w&127)!==0){V0=hoe,oe=0<=Q8&&Q8<tN?tN:Q8,W=0<=lF&&lF<tN?tN:lF,ae=0<=W?W:0<=oe?oe:Jg,0<=X_e?(Ol(2),B5(X_e,ae,w,Q)):(dF&127)!==0&&(Ol(2),Tt(tN,ae,ax)),Q=oe;var ke=W,ot=doe,_t=0<SW,zt=nN===loe,en=nN===W_e;if(oe=Jg,W=hoe,ae=DTe,De=NTe,eu){if(ec="Blocking",0<Q?Q>oe&&(Q=oe):Q=oe,0<ke?ke>Q&&(ke=Q):ke=Q,ot!==null&&Q>ke){var Zt=_t?"secondary-light":"warning";W?W.run(console.timeStamp.bind(console,_t?"Consecutive":"Event: "+ot,ke,Q,ec,Ga,Zt)):console.timeStamp(_t?"Consecutive":"Event: "+ot,ke,Q,ec,Ga,Zt)}oe>Q&&(ke=zt?"error":(w&738197653)===w?"tertiary-light":"primary-light",zt=en?"Promise Resolved":zt?"Cascading Update":5<oe-Q?"Update Blocked":"Update",en=[],De!=null&&en.push(["Component name",De]),ae!=null&&en.push(["Method name",ae]),Q={start:Q,end:oe,detail:{devtools:{properties:en,track:ec,trackGroup:Ga,color:ke}}},W?W.run(performance.measure.bind(performance,zt,Q)):performance.measure(zt,Q),performance.clearMeasures(zt))}Q8=-1.1,nN=0,NTe=DTe=null,X_e=-1.1,SW=lF,lF=-1.1,tN=rm()}return(w&4194048)!==0&&(V0=uoe,oe=0<=tM&&tM<CI?CI:tM,Q=0<=TC&&TC<CI?CI:TC,W=0<=oN&&oN<CI?CI:oN,ae=0<=W?W:0<=Q?Q:Jg,0<=j_e?(Ol(256),B5(j_e,ae,w,V0)):(dF&4194048)!==0&&(Ol(256),Tt(CI,ae,ax)),en=W,ke=hF,ot=0<rN,_t=RTe===W_e,ae=Jg,W=uoe,De=Eft,zt=Mft,eu&&(ec="Transition",0<Q?Q>ae&&(Q=ae):Q=ae,0<oe?oe>Q&&(oe=Q):oe=Q,0<en?en>oe&&(en=oe):en=oe,oe>en&&ke!==null&&(Zt=ot?"secondary-light":"warning",W?W.run(console.timeStamp.bind(console,ot?"Consecutive":"Event: "+ke,en,oe,ec,Ga,Zt)):console.timeStamp(ot?"Consecutive":"Event: "+ke,en,oe,ec,Ga,Zt)),Q>oe&&(W?W.run(console.timeStamp.bind(console,"Action",oe,Q,ec,Ga,"primary-dark")):console.timeStamp("Action",oe,Q,ec,Ga,"primary-dark")),ae>Q&&(oe=_t?"Promise Resolved":5<ae-Q?"Update Blocked":"Update",en=[],zt!=null&&en.push(["Component name",zt]),De!=null&&en.push(["Method name",De]),Q={start:Q,end:ae,detail:{devtools:{properties:en,track:ec,trackGroup:Ga,color:"primary-light"}}},W?W.run(performance.measure.bind(performance,oe,Q)):performance.measure(oe,Q),performance.clearMeasures(oe))),TC=tM=-1.1,RTe=0,j_e=-1.1,rN=oN,oN=-1.1,CI=rm()),(w&62914560)!==0&&(dF&62914560)!==0&&(Ol(4194304),Tt(QTe,Jg,ax)),(w&2080374784)!==0&&(dF&2080374784)!==0&&(Ol(268435456),Tt(kTe,Jg,ax)),Q=S.timeoutHandle,Q!==MF&&(S.timeoutHandle=MF,Gfo(Q)),Q=S.cancelPendingCommit,Q!==null&&(S.cancelPendingCommit=null,Q()),ux=0,vD(),$h=S,Qa=Q=sc(S.current,null),na=w,gh=hx,d4=null,iM=!1,kW=xt(S,w),iDe=!1,l0=rM,bF=dx=pge=hN=lN=0,H1=Roe=null,mge=!1,O8=Yt(S,w),Jt(),S=xft(),1000<S-yft&&(Vn.recentlyCreatedOwnerStacks=0,yft=S),bI.discardPendingWarnings(),Q}function DH(S,w){_s=null,Vn.H=rge,Vn.getCurrentStack=null,i4=!1,K_=null,w===EW||w===J_e?(w=ET(),gh=Doe):w===zTe?(w=ET(),gh=P2t):gh=w===qTe?rDe:w!==null&&typeof w==="object"&&typeof w.then==="function"?Noe:dge,d4=w;var Q=Qa;Q===null?(l0=Boe,Fv(S,rs(w,S.current))):Q.mode&Sa&&ST(Q)}function NH(){var S=Af.current;return S===null?!0:(na&4194048)===na?f2===null?!0:!1:(na&62914560)===na||(na&536870912)!==0?S===f2:!1}function qU(){var S=Vn.H;return Vn.H=rge,S===null?rge:S}function JU(){var S=Vn.A;return Vn.A=Bfo,S}function SD(S){V0===null&&(V0=S._debugTask==null?null:S._debugTask)}function BE(){l0=cN,iM||(na&4194048)!==na&&Af.current!==null||(kW=!0),(lN&134217727)===0&&(hN&134217727)===0||$h===null||Zy($h,na,dx,!1)}function RH(S,w,Q){var W=Vc;Vc|=q_;var oe=qU(),ae=JU();if($h!==S||na!==w){if(g2){var De=S.memoizedUpdaters;0<De.size&&(tx(S,na),De.clear()),st(S,w)}Qoe=null,$v(S,w)}w=!1,De=l0;e:do try{if(gh!==hx&&Qa!==null){var ke=Qa,ot=d4;switch(gh){case rDe:vD(),De=Toe;break e;case Doe:case xF:case CF:case Noe:Af.current===null&&(w=!0);var _t=gh;if(gh=hx,d4=null,cC(S,ke,ot,_t),Q&&kW){De=rM;break e}break;default:_t=gh,gh=hx,d4=null,cC(S,ke,ot,_t)}}Bu(),De=l0;break}catch(zt){DH(S,zt)}while(1);return w&&S.shellSuspendCounter++,O3(),Vc=W,Vn.H=oe,Vn.A=ae,Qa===null&&($h=null,na=0,Jt()),De}function Bu(){for(;Qa!==null;)kH(Qa)}function QH(S,w){var Q=Vc;Vc|=q_;var W=qU(),oe=JU();if($h!==S||na!==w){if(g2){var ae=S.memoizedUpdaters;0<ae.size&&(tx(S,na),ae.clear()),st(S,w)}Qoe=null,gge=Ki()+w2t,$v(S,w)}else kW=xt(S,w);e:do try{if(gh!==hx&&Qa!==null)t:switch(w=Qa,ae=d4,gh){case dge:gh=hx,d4=null,cC(S,w,ae,dge);break;case xF:case CF:if(PT(ae)){gh=hx,d4=null,LH(w);break}w=function(){gh!==xF&&gh!==CF||$h!==S||(gh=uge),h2(S)},ae.then(w,w);break e;case Doe:gh=uge;break e;case P2t:gh=oDe;break e;case uge:PT(ae)?(gh=hx,d4=null,LH(w)):(gh=hx,d4=null,cC(S,w,ae,uge));break;case oDe:var De=null;switch(Qa.tag){case 26:De=Qa.memoizedState;case 5:case 27:var ke=Qa;if(De?no(De):ke.stateNode.complete){gh=hx,d4=null;var ot=ke.sibling;if(ot!==null)Qa=ot;else{var _t=ke.return;_t!==null?(Qa=_t,qv(_t)):Qa=null}break t}break;default:console.error("Unexpected type of fiber triggered a suspensey commit. This is a bug in React.")}gh=hx,d4=null,cC(S,w,ae,oDe);break;case Noe:gh=hx,d4=null,cC(S,w,ae,Noe);break;case rDe:vD(),l0=Toe;break e;default:throw Error("Unexpected SuspendedReason. This is a bug in React.")}Vn.actQueue!==null?Bu():Lne();break}catch(zt){DH(S,zt)}while(1);if(O3(),Vn.H=W,Vn.A=oe,Vc=Q,Qa!==null)return rM;return $h=null,na=0,Jt(),l0}function Lne(){for(;Qa!==null&&!Yne();)kH(Qa)}function kH(S){var w=S.alternate;(S.mode&Sa)!==hs?(iE(S),w=ye(S,lp,w,S,O8),ST(S)):w=ye(S,lp,w,S,O8),S.memoizedProps=S.pendingProps,w===null?qv(S):Qa=w}function LH(S){var w=ye(S,X6,S);S.memoizedProps=S.pendingProps,w===null?qv(S):Qa=w}function X6(S){var w=S.alternate,Q=(S.mode&Sa)!==hs;switch(Q&&iE(S),S.tag){case 15:case 0:w=uD(w,S,S.pendingProps,S.type,void 0,na);break;case 11:w=uD(w,S,S.pendingProps,S.type.render,S.ref,na);break;case 5:rf(S);var W=S;W===qg&&(Pa?(Iv(W),W.tag===5&&W.stateNode!=null&&(Sd=W.stateNode)):(Iv(W),Pa=!0));default:Q6(w,S),S=Qa=cp(S,O8),w=lp(w,S,O8)}return Q&&ST(S),w}function cC(S,w,Q,W){O3(),rf(w),MW=null,boe=0;var oe=w.return;try{if(Ky(S,oe,w,Q,na)){l0=Boe,Fv(S,rs(Q,S.current)),Qa=null;return}}catch(ae){if(oe!==null)throw Qa=oe,ae;l0=Boe,Fv(S,rs(Q,S.current)),Qa=null;return}if(w.flags&32768){if(Pa||W===dge)S=!0;else if(kW||(na&536870912)!==0)S=!1;else if(iM=S=!0,W===xF||W===CF||W===Doe||W===Noe)W=Af.current,W!==null&&W.tag===13&&(W.flags|=16384);S1(w,S)}else qv(w)}function qv(S){var w=S;do{if((w.flags&32768)!==0){S1(w,iM);return}var Q=w.alternate;if(S=w.return,iE(w),Q=ye(w,Qne,Q,w,O8),(w.mode&Sa)!==hs&&sH(w),Q!==null){Qa=Q;return}if(w=w.sibling,w!==null){Qa=w;return}Qa=w=S}while(w!==null);l0===rM&&(l0=S2t)}function S1(S,w){do{var Q=LU(S.alternate,S);if(Q!==null){Q.flags&=32767,Qa=Q;return}if((S.mode&Sa)!==hs){sH(S),Q=S.actualDuration;for(var W=S.child;W!==null;)Q+=W.actualDuration,W=W.sibling;S.actualDuration=Q}if(Q=S.return,Q!==null&&(Q.flags|=32768,Q.subtreeFlags=0,Q.deletions=null),!w&&(S=S.sibling,S!==null)){Qa=S;return}Qa=S=Q}while(S!==null);l0=Toe,Qa=null}function ex(S,w,Q,W,oe,ae,De,ke,ot,_t,zt,en,Zt,xn,Co){S.cancelPendingCommit=null;do E1();while(h0!==V8);if(bI.flushLegacyContextWarning(),bI.flushPendingUnsafeLifecycleWarnings(),(Vc&(q_|h4))!==tA)throw Error("Should not already be working.");if(Ol(Q),zt===yF)eE(xn,Co,Q,V0);else if(W!==null){if(_t=w!==null&&w.alternate!==null&&w.alternate.memoizedState.isDehydrated&&(w.flags&256)!==0,ae=V0,eu&&!(Co<=xn)){zt=[];for(var xr=0;xr<W.length;xr++){var li=W[xr].value;zt.push(["Recoverable Error",typeof li==="object"&&li!==null&&typeof li.message==="string"?String(li.message):String(li)])}xn={start:xn,end:Co,detail:{devtools:{color:"primary-dark",track:ec,trackGroup:Ga,tooltipText:_t?"Hydration Failed":"Recovered after Error",properties:zt}}},ae?ae.run(performance.measure.bind(performance,"Recovered",xn)):performance.measure("Recovered",xn),performance.clearMeasures("Recovered")}}else ae=V0,!eu||Co<=xn||(_t=(Q&738197653)===Q?"tertiary-dark":"primary-dark",zt=(Q&536870912)===Q?"Prepared":(Q&201326741)===Q?"Hydrated":"Render",ae?ae.run(console.timeStamp.bind(console,zt,xn,Co,ec,Ga,_t)):console.timeStamp(zt,xn,Co,ec,Ga,_t));if(w!==null){if(Q===0&&console.error("finishedLanes should not be empty during a commit. This is a bug in React."),w===S.current)throw Error("Cannot commit the same tree as before. This error is likely caused by a bug in React. Please file an issue.");S===$h&&(Qa=$h=null,na=0),IF=w,SI=S,ux=Q,hDe=oe,N2t=W,yge=Co,xge=Zt,u4=Age,dDe=null,Fm(S,w,Q,De,ke,ot,en,Zt,Co)}}function Fm(S,w,Q,W,oe,ae,De,ke,ot){var _t=w.lanes|w.childLanes;if(lDe=_t,_t|=ETe,Je(S,Q,_t,W,oe,ae),HW=null,(Q&335544064)===Q?(FW=Ev(S),W=10262):(FW=null,W=10256),w.actualDuration!==0||(w.subtreeFlags&W)!==0||(w.flags&W)!==0?(S.callbackNode=null,S.callbackPriority=0,G_(M8,function(){return Voe=window.event,u4===Age&&(u4=sDe),PD(),null})):(S.callbackNode=null,S.callbackPriority=0),eM=null,ZE=rm(),ke!==null&&T5(ot,ZE,ke,V0),sge=!1,ke=(w.flags&13878)!==0,(w.subtreeFlags&13878)!==0||ke){ke=Vn.T,Vn.T=null,ot=Dc.p,Dc.p=om,W=Vc,Vc|=h4;try{Jy(S,w,Q)}finally{Vc=W,Dc.p=ot,Vn.T=ke}}h0=T2t,sge?(dF|=Q,ax=null,LW=g8(De,S.containerInfo,FW,Jv,K6,P1,Zv,PD,HH,TE,j6.bind(null,Q))):(Jv(),K6(),Zv())}function HH(S){if(h0!==V8){var w=SI.onRecoverableError;w(S,FH(null))}}function TE(S){xI=rm(),at(xge===null?yge:ZE,xI,eM,u4===koe,V0),xge=dDe=S}function j6(S){if((dF&S)!==0){var w=ax;dF&=~S,ax=null,(S&4194048)!==0&&(na&4194048)===0&&(ux&4194048)===0&&(Ol(256),Tt(CI,Ki(),w)),(S&62914560)!==0&&(na&62914560)===0&&(ux&62914560)===0&&(Ol(4194304),Tt(QTe,Ki(),w)),(S&2080374784)!==0&&(na&2080374784)===0&&(ux&2080374784)===0&&(Ol(268435456),Tt(kTe,Ki(),w))}}function P1(){h0===aDe&&(h0=V8,O6(IF,SI),h0=cDe)}function Jv(){if(h0===T2t){h0=V8;var S=SI,w=IF,Q=ux,W=(w.flags&13878)!==0;if((w.subtreeFlags&13878)!==0||W){W=Vn.T,Vn.T=null;var oe=Dc.p;Dc.p=om;var ae=Vc;Vc|=h4;try{RW=Q,QW=S,Moe=lge=!1,g6(),iC(w,S,Q),QW=RW=null,Q=CDe;var De=Cv(S.containerInfo),ke=Q.focusedElem,ot=Q.selectionRange;if(De!==ke&&ke&&ke.ownerDocument&&Mc(ke.ownerDocument.documentElement,ke)){if(ot!==null&&k_(ke)){var{start:_t,end:zt}=ot;if(zt===void 0&&(zt=_t),"selectionStart"in ke)ke.selectionStart=_t,ke.selectionEnd=Math.min(zt,ke.value.length);else{var en=ke.ownerDocument||document,Zt=en&&en.defaultView||window;if(Zt.getSelection){var xn=Zt.getSelection(),Co=ke.textContent.length,xr=Math.min(ot.start,Co),li=ot.end===void 0?xr:Math.min(ot.end,Co);!xn.extend&&xr>li&&(De=li,li=xr,xr=De);var ga=Pu(ke,xr),$t=Pu(ke,li);if(ga&&$t&&(xn.rangeCount!==1||xn.anchorNode!==ga.node||xn.anchorOffset!==ga.offset||xn.focusNode!==$t.node||xn.focusOffset!==$t.offset)){var qt=en.createRange();qt.setStart(ga.node,ga.offset),xn.removeAllRanges(),xr>li?(xn.addRange(qt),xn.extend($t.node,$t.offset)):(qt.setEnd($t.node,$t.offset),xn.addRange(qt))}}}}en=[];for(xn=ke;xn=xn.parentNode;)xn.nodeType===1&&en.push({element:xn,left:xn.scrollLeft,top:xn.scrollTop});typeof ke.focus==="function"&&ke.focus();for(ke=0;ke<en.length;ke++){var tn=en[ke];tn.element.scrollLeft=tn.left,tn.element.scrollTop=tn.top}}XW=!!xDe,CDe=xDe=null}finally{Vc=ae,Dc.p=oe,Vn.T=W}}S.current=w,h0=D2t}}function K6(){if(h0===D2t){h0=V8;var S=dDe;if(S!==null){ZE=rm();var w=xI,Q=ZE;!eu||Q<=w||(ax?ax.run(console.timeStamp.bind(console,S,w,Q,ec,Ga,"secondary-light")):console.timeStamp(S,w,Q,ec,Ga,"secondary-light"))}S=SI,w=IF,Q=ux;var W=(w.flags&8772)!==0;if((w.subtreeFlags&8772)!==0||W){W=Vn.T,Vn.T=null;var oe=Dc.p;Dc.p=om;var ae=Vc;Vc|=h4;try{RW=Q,QW=S,g6(),PH(S,w.alternate,w),QW=RW=null}finally{Vc=ae,Dc.p=oe,Vn.T=W}}S=yge,w=xge,xI=rm(),at(w===null?S:ZE,xI,eM,u4===koe,V0),h0=aDe}}function Zv(){if(h0===cDe||h0===aDe){if(h0===cDe){var S=xI;xI=rm();var w=xI,Q=u4===koe;!eu||w<=S||(ax?ax.run(console.timeStamp.bind(console,Q?"Interrupted View Transition":"Starting Animation",S,w,ec,Ga,Q?"error":"secondary-light")):console.timeStamp(Q?"Interrupted View Transition":"Starting Animation",S,w,ec,Ga,Q?" error":"secondary-light")),u4!==koe&&(u4=B2t)}h0=V8,S=LW,LW=null,UE(),w=SI;var W=IF;Q=ux;var oe=N2t,ae=(Q&335544064)===Q?10262:10256;(ae=W.actualDuration!==0||(W.subtreeFlags&ae)!==0||(W.flags&ae)!==0)?h0=fge:(h0=V8,IF=SI=null,df(w,w.pendingLanes),vF=0,Hoe=null);var De=w.pendingLanes;if(De===0&&(dN=null),ae||t8(w),De=St(Q),W=W.stateNode,ph&&typeof ph.onCommitFiberRoot==="function")try{var ke=(W.current.flags&128)===128;switch(De){case om:var ot=IC;break;case Ym:ot=E8;break;case SC:ot=M8;break;case dW:ot=Jd;break;default:ot=M8}ph.onCommitFiberRoot(T8,W,ot,ke)}catch(Zt){jg||(jg=!0,console.error("React instrumentation encountered an error: %o",Zt))}if(g2&&w.memoizedUpdaters.clear(),Y6(),oe!==null){ke=Vn.T,ot=Dc.p,Dc.p=om,Vn.T=null;try{var _t=w.onRecoverableError;for(W=0;W<oe.length;W++){var zt=oe[W],en=FH(zt.stack);ye(zt.source,_t,zt.value,en)}}finally{Vn.T=ke,Dc.p=ot}}if(_t=HW,zt=FW,FW=null,_t!==null&&(HW=null,zt===null&&(zt=[]),S!==null))for(en=0;en<_t.length;en++)oe=(0,_t[en])(zt),oe!==void 0&&S.finished.finally(oe);(ux&3)!==0&&E1(),h2(w),De=w.pendingLanes,(Q&261930)!==0&&(De&42)!==0?($_e=!0,w===Cge?Loe++:(Loe=0,Cge=w)):(Loe=0,Cge=null),ae||aC(Q,xI),o8(0,!1)}}function FH(S){return S={componentStack:S},Object.defineProperty(S,"digest",{get:function(){console.error('You are accessing "digest" from the errorInfo object passed to onRecoverableError. This property is no longer provided as part of errorInfo but can be accessed as a property of the Error instance itself.')}}),S}function df(S,w){(S.pooledCacheLanes&=w)===0&&(w=S.pooledCache,w!=null&&(S.pooledCache=null,Jf(w)))}function E1(){return LW!==null&&(LW.skipTransition(),R2t||(R2t=!0,console.warn("A flushSync update cancelled a View Transition because it was called while the View Transition was still preparing. To preserve the synchronous semantics, React had to skip the View Transition. If you can, try to avoid flushSync() in a scenario that's likely to interfere.")),LW=null,u4=koe),Jv(),K6(),Zv(),PD()}function PD(){if(h0!==fge)return!1;var S=SI,w=lDe;lDe=0;var Q=St(ux),W=SC===0||SC>Q?SC:Q;Q=Vn.T;var oe=Dc.p;try{Dc.p=W,Vn.T=null;var ae=hDe;hDe=null,W=SI;var De=ux;if(h0=V8,IF=SI=null,ux=0,(Vc&(q_|h4))!==tA)throw Error("Cannot flush passive effects while already rendering.");Ol(De),uDe=!0,bge=!1;var ke=0;if(eM=null,ke=Ki(),u4===B2t)Tt(xI,ke,ax);else{var ot=xI,_t=ke,zt=u4===sDe;!eu||_t<=ot||(V0?V0.run(console.timeStamp.bind(console,zt?"Waiting for Paint":"Waiting",ot,_t,ec,Ga,"secondary-light")):console.timeStamp(zt?"Waiting for Paint":"Waiting",ot,_t,ec,Ga,"secondary-light"))}ot=Vc,Vc|=h4;var en=W.current;g6(),CD(en);var Zt=W.current;en=yge,g6(),EE(W,Zt,De,ae,en),t8(W),Vc=ot;var xn=Ki();if(Zt=ke,en=V0,eM!==null?qe(Zt,xn,eM,!0,en):!eu||xn<=Zt||(en?en.run(console.timeStamp.bind(console,"Remaining Effects",Zt,xn,ec,Ga,"secondary-dark")):console.timeStamp("Remaining Effects",Zt,xn,ec,Ga,"secondary-dark")),aC(De,xn),o8(0,!1),bge?W===Hoe?vF++:(vF=0,Hoe=W):vF=0,bge=uDe=!1,ph&&typeof ph.onPostCommitFiberRoot==="function")try{ph.onPostCommitFiberRoot(T8,W)}catch(xr){jg||(jg=!0,console.error("React instrumentation encountered an error: %o",xr))}var Co=W.current.stateNode;return Co.effectDuration=0,Co.passiveEffectDuration=0,!0}finally{Dc.p=oe,Vn.T=Q,df(S,w)}}function e8(S,w,Q){w=rs(Q,w),aH(w),w=CE(S.stateNode,w,2),S=V3(S,w,2),S!==null&&(tt(S,2),h2(S))}function Tc(S,w,Q){if(zW=!1,S.tag===3)e8(S,S,Q);else{for(;w!==null;){if(w.tag===3){e8(w,S,Q);return}if(w.tag===1){var W=w.stateNode;if(typeof w.type.getDerivedStateFromError==="function"||typeof W.componentDidCatch==="function"&&(dN===null||!dN.has(W))){S=rs(Q,S),aH(S),Q=bE(2),W=V3(w,Q,2),W!==null&&(zv(Q,W,w,S),tt(W,2),h2(W));return}}w=w.return}console.error(`Internal React error: Attempted to capture a commit phase error inside a detached tree. This indicates a bug in React. Potential causes include deleting the same fiber more than once, committing an already-finished tree, or an inconsistent return pointer.

Error message:

%s`,Q)}}function zH(S,w,Q){var W=S.pingCache;if(W===null){W=S.pingCache=new Dfo;var oe=new Set;W.set(w,oe)}else oe=W.get(w),oe===void 0&&(oe=new Set,W.set(w,oe));oe.has(Q)||(iDe=!0,oe.add(Q),W=ZU.bind(null,S,w,Q),g2&&tx(S,Q),w.then(W,W))}function ZU(S,w,Q){var W=S.pingCache;W!==null&&W.delete(w),S.pingedLanes|=S.suspendedLanes&Q,S.warmLanes&=~Q,(Q&127)!==0?0>Q8&&(tN=Q8=rm(),hoe=U_e("Promise Resolved"),nN=W_e):(Q&4194048)!==0&&0>TC&&(CI=TC=rm(),uoe=U_e("Promise Resolved"),RTe=W_e),G6()&&Vn.actQueue===null&&console.error(`A suspended resource finished loading inside a test, but the event was not wrapped in act(...).

When testing, code that resolves suspended data should be wrapped into act(...):

act(() => {
  /* finish loading suspended data */
});
/* assert on the output */

This ensures that you're testing the behavior the user would see in the browser. Learn more at https://react.dev/link/wrap-tests-with-act`),$h===S&&(na&Q)===Q&&(l0===cN||l0===hge&&(na&62914560)===na&&Ki()-_ge<M2t?(Vc&q_)===tA?$v(S,0):pge|=Q:pge|=Q,bF===na&&(bF=0)),h2(S)}function lC(S,w){w===0&&(w=Ze()),S=Nn(S,w),S!==null&&(tt(S,w),h2(S))}function jp(S){var w=S.memoizedState,Q=0;w!==null&&(Q=w.retryLane),lC(S,Q)}function gr(S,w){var Q=0;switch(S.tag){case 31:case 13:var{stateNode:W,memoizedState:oe}=S;oe!==null&&(Q=oe.retryLane);break;case 19:W=S.stateNode;break;case 22:W=S.stateNode._retryCache;break;default:throw Error("Pinged unknown suspense boundary type. This is probably a bug in React.")}W!==null&&W.delete(w),lC(S,Q)}function c2(S,w,Q){if((w.subtreeFlags&134225920)!==0)for(w=w.child;w!==null;){var W=S,oe=w,ae=oe.type===JH;ae=Q||ae,oe.tag!==22?oe.flags&134217728?ae&&ye(oe,l2,W,oe):c2(W,oe,ae):oe.memoizedState===null&&(ae&&oe.flags&134225920?ye(oe,l2,W,oe):oe.subtreeFlags&134217728&&ye(oe,c2,W,oe,ae)),w=w.sibling}}function l2(S,w){Ct(!0);try{XU(w,Eoe),TH(w),jU(S,w.alternate,w,Eoe),BH(S,w,0,null,!1,0)}finally{Ct(!1)}}function t8(S){var w=!0;S.current.mode&(A2|yI)||(w=!1),c2(S,S.current,w)}function jh(S){if((Vc&q_)===tA){var w=S.tag;if(w===3||w===1||w===0||w===11||w===14||w===15){if(w=Y(S)||"ReactComponent",Ige!==null){if(Ige.has(w))return;Ige.add(w)}else Ige=new Set([w]);ye(S,function(){console.error("Can't perform a React state update on a component that hasn't mounted yet. This indicates that you have a side-effect in your render function that asynchronously tries to update the component. Move this work to useEffect instead.")})}}}function tx(S,w){g2&&S.memoizedUpdaters.forEach(function(Q){je(S,Q,w)})}function G_(S,w){var Q=Vn.actQueue;return Q!==null?(Q.push(w),Qfo):P8(S,w)}function n8(S){G6()&&Vn.actQueue===null&&ye(S,function(){console.error(`An update to %s inside a test was not wrapped in act(...).

When testing, code that causes React state updates should be wrapped into act(...):

act(() => {
  /* fire events that update state */
});
/* assert on the output */

This ensures that you're testing the behavior the user would see in the browser. Learn more at https://react.dev/link/wrap-tests-with-act`,Y(S))})}function h2(S){S!==VW&&S.next===null&&(VW===null?OW=VW=S:VW=VW.next=S),vge=!0,Vn.actQueue!==null?mDe||(mDe=!0,hC()):pDe||(pDe=!0,hC())}function o8(S,w){if(!_De&&vge){_De=!0;do{var Q=!1;for(var W=OW;W!==null;){if(!w)if(S!==0){var oe=W.pendingLanes;if(oe===0)var ae=0;else{var De=W.suspendedLanes,ke=W.pingedLanes;ae=(1<<31-Wl(42|S)+1)-1,ae&=oe&~(De&~ke),ae=ae&201326741?ae&201326741|1:ae?ae|2:0}ae!==0&&(Q=!0,NE(W,ae))}else ae=na,ae=Bt(W,W===$h?ae:0,W.cancelPendingCommit!==null||W.timeoutHandle!==MF),(ae&3)===0||xt(W,ae)||(Q=!0,NE(W,ae));W=W.next}}while(Q);_De=!1}}function OH(){Voe=window.event,r8()}function r8(){vge=mDe=pDe=!1;var S=0;uN!==0&&BD()&&(S=uN);for(var w=Ki(),Q=null,W=OW;W!==null;){var oe=W.next,ae=ED(W,w);if(ae===0)W.next=null,Q===null?OW=oe:Q.next=oe,oe===null&&(VW=Q);else if(Q=W,S!==0||(ae&3)!==0)vge=!0;W=oe}h0!==V8&&h0!==fge||o8(S,!1),uN!==0&&(uN=0)}function ED(S,w){for(var{suspendedLanes:Q,pingedLanes:W,expirationTimes:oe}=S,ae=S.pendingLanes&-62914561;0<ae;){var De=31-Wl(ae),ke=1<<De,ot=oe[De];if(ot===-1){if((ke&Q)===0||(ke&W)!==0)oe[De]=ut(ke,w)}else ot<=w&&(S.expiredLanes|=ke);ae&=~ke}if(w=$h,Q=na,Q=Bt(S,S===w?Q:0,S.cancelPendingCommit!==null||S.timeoutHandle!==MF),W=S.callbackNode,Q===0||S===w&&(gh===xF||gh===CF)||S.cancelPendingCommit!==null)return W!==null&&i8(W),S.callbackNode=null,S.callbackPriority=0;if((Q&3)===0||xt(S,Q)){if(w=Q&-Q,w!==S.callbackPriority||Vn.actQueue!==null&&W!==gDe)i8(W);else return w;switch(St(Q)){case om:case Ym:Q=E8;break;case SC:Q=M8;break;case dW:Q=Jd;break;default:Q=M8}return W=DE.bind(null,S),Vn.actQueue!==null?(Vn.actQueue.push(W),Q=gDe):Q=P8(Q,W),S.callbackPriority=w,S.callbackNode=Q,w}return W!==null&&i8(W),S.callbackPriority=2,S.callbackNode=null,2}function DE(S,w){if($_e=K_e=!1,Voe=window.event,h0!==V8&&h0!==fge)return S.callbackNode=null,S.callbackPriority=0,null;var Q=S.callbackNode;if(u4===Age&&(u4=sDe),E1()&&S.callbackNode!==Q)return null;var W=na;if(W=Bt(S,S===$h?W:0,S.cancelPendingCommit!==null||S.timeoutHandle!==MF),W===0)return null;return KU(S,W,w),ED(S,Ki()),S.callbackNode!=null&&S.callbackNode===Q?DE.bind(null,S):null}function NE(S,w){if(E1())return null;K_e=$_e,$_e=!1,KU(S,w,!0)}function i8(S){S!==gDe&&S!==null&&nF(S)}function hC(){Vn.actQueue!==null&&Vn.actQueue.push(function(){return r8(),null}),Ufo(function(){(Vc&(q_|h4))!==tA?P8(IC,OH):r8()})}function Y5(){if(uN===0){var S=iN;S===0&&(S=oF,oF<<=1,(oF&261888)===0&&(oF=256)),uN=S}return uN}function $6(S){if(S==null||typeof S==="symbol"||typeof S==="boolean")return null;if(typeof S==="function")return S;return dt(S,"action"),ah(S)}function MD(S,w,Q,W,oe){if(w==="submit"&&Q&&Q.stateNode===oe){var ae=$6((oe[Kg]||null).action),De=W.submitter;De&&(w=(w=De[Kg]||null)?$6(w.formAction):De.getAttribute("formAction"),w!==null&&(ae=w,De=null));var ke=new _W("action","action",null,W,oe);S.push({event:ke,listeners:[{instance:null,listener:function(){if(W.defaultPrevented){if(uN!==0){var ot=new FormData(oe,De),_t={pending:!0,data:ot,method:oe.method,action:ae};Object.freeze(_t),oD(Q,_t,null,ot)}}else typeof ae==="function"&&(ke.preventDefault(),ot=new FormData(oe,De),_t={pending:!0,data:ot,method:oe.method,action:ae},Object.freeze(_t),oD(Q,_t,ae,ot))},currentTarget:oe}]})}}function Tu(S,w,Q){S.currentTarget=Q;try{w(S)}catch(W){ITe(W)}S.currentTarget=null}function U_(S,w){w=(w&4)!==0;for(var Q=0;Q<S.length;Q++){var W=S[Q];e:{var oe=void 0,ae=W.event;if(W=W.listeners,w)for(var De=W.length-1;0<=De;De--){var ke=W[De],ot=ke.instance,_t=ke.currentTarget;if(ke=ke.listener,ot!==oe&&ae.isPropagationStopped())break e;ot!==null?ye(ot,Tu,ae,ke,_t):Tu(ae,ke,_t),oe=ot}else for(De=0;De<W.length;De++){if(ke=W[De],ot=ke.instance,_t=ke.currentTarget,ke=ke.listener,ot!==oe&&ae.isPropagationStopped())break e;ot!==null?ye(ot,Tu,ae,ke,_t):Tu(ae,ke,_t),oe=ot}}}}function ks(S,w){ADe.has(S)||console.error('Did not expect a listenToNonDelegatedEvent() call for "%s". This is a bug in React. Please file an issue.',S);var Q=w[Une];Q===void 0&&(Q=w[Une]=new Set);var W=S+"__bubble";Q.has(W)||(W_(w,S,2,!1),Q.add(W))}function d2(S,w,Q){ADe.has(S)&&!w&&console.error('Did not expect a listenToNativeEvent() call for "%s" in the bubble phase. This is a bug in React. Please file an issue.',S);var W=0;w&&(W|=4),W_(Q,S,W,w)}function M1(S){if(!S[Sge]){S[Sge]=!0,AI.forEach(function(Q){Q!=="selectionchange"&&(ADe.has(Q)||d2(Q,!1,S),d2(Q,!0,S))});var w=S.nodeType===9?S:S.ownerDocument;w===null||w[Sge]||(w[Sge]=!0,d2("selectionchange",!1,w))}}function W_(S,w,Q,W){switch(hI(w)){case om:var oe=yC;break;case Ym:oe=dh;break;default:oe=xC}Q=oe.bind(null,w,Q,S),oe=void 0,!qi||w!=="touchstart"&&w!=="touchmove"&&w!=="wheel"||(oe=!0),W?oe!==void 0?S.addEventListener(w,Q,{capture:!0,passive:oe}):S.addEventListener(w,Q,!0):oe!==void 0?S.addEventListener(w,Q,{passive:oe}):S.addEventListener(w,Q,!1)}function q6(S,w,Q,W,oe){var ae=W;if((w&1)===0&&(w&2)===0&&W!==null)e:for(;;){if(W===null)return;var De=W.tag;if(De===3||De===4){var ke=W.stateNode.containerInfo;if(ke===oe)break;if(De===4)for(De=W.return;De!==null;){var ot=De.tag;if((ot===3||ot===4)&&De.stateNode.containerInfo===oe)return;De=De.return}for(;ke!==null;){if(De=mn(ke),De===null)return;if(ot=De.tag,ot===5||ot===6||ot===26||ot===27){W=ae=De;continue e}ke=ke.parentNode}}W=W.return}s1(function(){var _t=ae,zt=Rg(Q),en=[];e:{var Zt=fft.get(S);if(Zt!==void 0){var xn=_W,Co=S;switch(S){case"keypress":if(Q_(Q)===0)break e;case"keydown":case"keyup":xn=jAo;break;case"focusin":Co="focus",xn=ATe;break;case"focusout":Co="blur",xn=ATe;break;case"beforeblur":case"afterblur":xn=ATe;break;case"click":if(Q.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":xn=rft;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":xn=kAo;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":xn=ZAo;break;case mft:case _ft:case gft:xn=FAo;break;case Aft:xn=tfo;break;case"scroll":case"scrollend":xn=RAo;break;case"wheel":xn=ofo;break;case"copy":case"cut":case"paste":xn=OAo;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":xn=sft;break;case"submit":xn=qAo;break;case"toggle":case"beforetoggle":xn=ifo}var xr=(w&4)!==0,li=!xr&&(S==="scroll"||S==="scrollend"),ga=xr?Zt!==null?Zt+"Capture":null:Zt;xr=[];for(var $t=_t,qt;$t!==null;){var tn=$t;if(qt=tn.stateNode,tn=tn.tag,tn!==5&&tn!==26&&tn!==27||qt===null||ga===null||(tn=KA($t,ga),tn!=null&&xr.push(uf($t,tn,qt))),li)break;$t=$t.return}0<xr.length&&(Zt=new xn(Zt,Co,null,Q,zt),en.push({event:Zt,listeners:xr}))}}if((w&7)===0){e:{if(xn=S==="mouseover"||S==="pointerover",Zt=S==="mouseout"||S==="pointerout",xn&&Q!==nn&&(Co=Q.relatedTarget||Q.fromElement)&&(mn(Co)||Co[_I]))break e;if(Zt||xn){if(Co=zt.window===zt?zt:(xn=zt.ownerDocument)?xn.defaultView||xn.parentWindow:window,Zt){if(xn=Q.relatedTarget||Q.toElement,Zt=_t,xn=xn?mn(xn):null,xn!==null&&(li=g(xn),xr=xn.tag,xn!==li||xr!==5&&xr!==27&&xr!==6))xn=null}else Zt=null,xn=_t;if(Zt!==xn){if(xr=rft,tn="onMouseLeave",ga="onMouseEnter",$t="mouse",S==="pointerout"||S==="pointerover")xr=sft,tn="onPointerLeave",ga="onPointerEnter",$t="pointer";li=Zt==null?Co:En(Zt),qt=xn==null?Co:En(xn),Co=new xr(tn,$t+"leave",Zt,Q,zt),Co.target=li,Co.relatedTarget=qt,tn=null,mn(zt)===_t&&(xr=new xr(ga,$t+"enter",xn,Q,zt),xr.target=qt,xr.relatedTarget=li,tn=xr),li=tn,xr=Zt&&xn?V(Zt,xn,VH):null,Zt!==null&&Yg(en,Co,Zt,xr,!1),xn!==null&&li!==null&&Yg(en,li,xn,xr,!0)}}}e:{if(Zt=_t?En(_t):window,xn=Zt.nodeName&&Zt.nodeName.toLowerCase(),xn==="select"||xn==="input"&&Zt.type==="file")var Yn=Gh;else if(p6(Zt))if(uft)Yn=H3;else{Yn=L3;var ko=Qg}else xn=Zt.nodeName,!xn||xn.toLowerCase()!=="input"||Zt.type!=="checkbox"&&Zt.type!=="radio"?_t&&ea(_t.elementType)&&(Yn=Gh):Yn=vT;if(Yn&&(Yn=Yn(S,_t))){yd(en,Yn,Q,zt);break e}ko&&ko(S,Zt,_t)}switch(ko=_t?En(_t):window,S){case"focusin":if(p6(ko)||ko.contentEditable==="true")AW=ko,yTe=_t,ioe=null;break;case"focusout":ioe=yTe=AW=null;break;case"mousedown":xTe=!0;break;case"contextmenu":case"mouseup":case"dragend":xTe=!1,l1(en,Q,zt);break;case"selectionchange":if(lfo)break;case"keydown":case"keyup":l1(en,Q,zt)}var es;if(fTe)e:{switch(S){case"compositionstart":var hi="onCompositionStart";break e;case"compositionend":hi="onCompositionEnd";break e;case"compositionupdate":hi="onCompositionUpdate";break e}hi=void 0}else gW?$f(S,Q)&&(hi="onCompositionEnd"):S==="keydown"&&Q.keyCode===aft&&(hi="onCompositionStart");if(hi&&(cft&&Q.locale!=="ko"&&(gW||hi!=="onCompositionStart"?hi==="onCompositionEnd"&&gW&&(es=T0()):(Ji=zt,mh=("value"in Ji)?Ji.value:Ji.textContent,gW=!0)),ko=dC(_t,hi),0<ko.length&&(hi=new ift(hi,S,null,Q,zt),en.push({event:hi,listeners:ko}),es?hi.data=es:(es=a1(Q),es!==null&&(hi.data=es)))),es=afo?u6(S,Q):o0(S,Q))hi=dC(_t,"onBeforeInput"),0<hi.length&&(ko=new YAo("onBeforeInput","beforeinput",null,Q,zt),en.push({event:ko,listeners:hi}),ko.data=es);MD(en,S,_t,Q,zt)}U_(en,w)})}function uf(S,w,Q){return{instance:S,listener:w,currentTarget:Q}}function dC(S,w){for(var Q=w+"Capture",W=[];S!==null;){var oe=S,ae=oe.stateNode;if(oe=oe.tag,oe!==5&&oe!==26&&oe!==27||ae===null||(oe=KA(S,Q),oe!=null&&W.unshift(uf(S,oe,ae)),oe=KA(S,w),oe!=null&&W.push(uf(S,oe,ae))),S.tag===3)return W;S=S.return}return[]}function VH(S){if(S===null)return null;do S=S.return;while(S&&S.tag!==5&&S.tag!==27);return S?S:null}function Yg(S,w,Q,W,oe){for(var ae=w._reactName,De=[];Q!==null&&Q!==W;){var ke=Q,ot=ke.alternate,_t=ke.stateNode;if(ke=ke.tag,ot!==null&&ot===W)break;ke!==5&&ke!==26&&ke!==27||_t===null||(ot=_t,oe?(_t=KA(Q,ae),_t!=null&&De.unshift(uf(Q,_t,ot))):oe||(_t=KA(Q,ae),_t!=null&&De.push(uf(Q,_t,ot)))),Q=Q.return}De.length!==0&&S.push({event:w,listeners:De})}function pf(S,w){sh(S,w),S!=="input"&&S!=="textarea"&&S!=="select"||w==null||w.value!==null||yr||(yr=!0,S==="select"&&w.multiple?console.error("`value` prop on `%s` should not be null. Consider using an empty array when `multiple` is set to `true` to clear the component or `undefined` for uncontrolled components.",S):console.error("`value` prop on `%s` should not be null. Consider using an empty string to clear the component or `undefined` for uncontrolled components.",S));var Q={registrationNameDependencies:fI,possibleRegistrationNames:rF};ea(S)||typeof w.is==="string"||Ad(S,w,Q),w.contentEditable&&!w.suppressContentEditableWarning&&w.children!=null&&console.error("A component is `contentEditable` and contains `children` managed by React. It is now your responsibility to guarantee that none of those nodes are unexpectedly modified or duplicated. This is probably not intentional.")}function ac(S,w,Q,W){w!==Q&&(Q=ba(Q),ba(w)!==Q&&(W[S]=w))}function Kd(S){return!!(S.getAttribute("vt-share")||S.getAttribute("vt-exit")||S.getAttribute("vt-enter")||S.getAttribute("vt-update"))}function Ra(S){if(!Kd(S))return!1;var w=S.getAttribute("vt-name");return S=S.style["view-transition-name"],w?w===S:S.startsWith("_T_")}function w1(S,w,Q){w.forEach(function(W){W==="style"?S.getAttribute(W)!==""&&(W=S.style,(W.length===1&&W[0]==="view-transition-name"||W.length===2&&W[0]==="view-transition-class"&&W[1]==="view-transition-name")&&Ra(S)||(Q.style=Jc(S))):Q[Kp(W)]=S.getAttribute(W)})}function $d(S,w){w===!1?console.error("Expected `%s` listener to be a function, instead got `false`.\n\nIf you used to conditionally omit it with %s={condition && value}, pass %s={condition ? value : undefined} instead.",S,S,S):console.error("Expected `%s` listener to be a function, instead got a value of `%s` type.",S,typeof w)}function uC(S,w){return S=S.namespaceURI===Ce||S.namespaceURI===Te?S.ownerDocument.createElementNS(S.namespaceURI,S.tagName):S.ownerDocument.createElement(S.tagName),S.innerHTML=w,S.innerHTML}function ba(S){return Le(S)&&(console.error("The provided HTML markup uses a value of unsupported type %s. This value must be coerced to a string before using it here.",Ne(S)),nt(S)),(typeof S==="string"?S:""+S).replace(kfo,`
`).replace(Lfo,"")}function RE(S,w){return w=ba(w),ba(S)===w?!0:!1}function qc(S,w,Q,W,oe,ae){switch(Q){case"children":if(typeof W==="string")vu(W,w,!1),w==="body"||w==="textarea"&&W===""||ji(S,W);else if(typeof W==="number"||typeof W==="bigint")vu(""+W,w,!1),w!=="body"&&ji(S,""+W);else return;break;case"className":bt(S,"class",W);break;case"tabIndex":bt(S,"tabindex",W);break;case"dir":case"role":case"viewBox":case"width":case"height":bt(S,Q,W);break;case"style":Cc(S,W,ae);return;case"data":if(w!=="object"){bt(S,"data",W);break}case"src":case"href":if(W===""&&(w!=="a"||Q!=="href")){Q==="src"?console.error('An empty string ("") was passed to the %s attribute. This may cause the browser to download the whole page again over the network. To fix this, either do not render the element at all or pass null to %s instead of an empty string.',Q,Q):console.error('An empty string ("") was passed to the %s attribute. To fix this, either do not render the element at all or pass null to %s instead of an empty string.',Q,Q),S.removeAttribute(Q);break}if(W==null||typeof W==="function"||typeof W==="symbol"||typeof W==="boolean"){S.removeAttribute(Q);break}dt(W,Q),W=ah(W),S.setAttribute(Q,W);break;case"action":case"formAction":if(W!=null&&(w==="form"?Q==="formAction"?console.error("You can only pass the formAction prop to <input> or <button>. Use the action prop on <form>."):typeof W==="function"&&(oe.encType==null&&oe.method==null||Mge||(Mge=!0,console.error("Cannot specify a encType or method for a form that specifies a function as the action. React provides those automatically. They will get overridden.")),oe.target==null||Ege||(Ege=!0,console.error("Cannot specify a target for a form that specifies a function as the action. The function will always be executed in the same window."))):w==="input"||w==="button"?Q==="action"?console.error("You can only pass the action prop to <form>. Use the formAction prop on <input> or <button>."):w!=="input"||oe.type==="submit"||oe.type==="image"||Pge?w!=="button"||oe.type==null||oe.type==="submit"||Pge?typeof W==="function"&&(oe.name==null||F2t||(F2t=!0,console.error('Cannot specify a "name" prop for a button that specifies a function as a formAction. React needs it to encode which action should be invoked. It will get overridden.')),oe.formEncType==null&&oe.formMethod==null||Mge||(Mge=!0,console.error("Cannot specify a formEncType or formMethod for a button that specifies a function as a formAction. React provides those automatically. They will get overridden.")),oe.formTarget==null||Ege||(Ege=!0,console.error("Cannot specify a formTarget for a button that specifies a function as a formAction. The function will always be executed in the same window."))):(Pge=!0,console.error('A button can only specify a formAction along with type="submit" or no type.')):(Pge=!0,console.error('An input can only specify a formAction along with type="submit" or type="image".')):Q==="action"?console.error("You can only pass the action prop to <form>."):console.error("You can only pass the formAction prop to <input> or <button>.")),typeof W==="function"){S.setAttribute(Q,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof ae==="function"&&(Q==="formAction"?(w!=="input"&&qc(S,w,"name",oe.name,oe,null),qc(S,w,"formEncType",oe.formEncType,oe,null),qc(S,w,"formMethod",oe.formMethod,oe,null),qc(S,w,"formTarget",oe.formTarget,oe,null)):(qc(S,w,"encType",oe.encType,oe,null),qc(S,w,"method",oe.method,oe,null),qc(S,w,"target",oe.target,oe,null)));if(W==null||typeof W==="symbol"||typeof W==="boolean"){S.removeAttribute(Q);break}dt(W,Q),W=ah(W),S.setAttribute(Q,W);break;case"onClick":W!=null&&(typeof W!=="function"&&$d(Q,W),S.onclick=fd);return;case"onScroll":W!=null&&(typeof W!=="function"&&$d(Q,W),ks("scroll",S));return;case"onScrollEnd":W!=null&&(typeof W!=="function"&&$d(Q,W),ks("scrollend",S));return;case"dangerouslySetInnerHTML":if(W!=null){if(typeof W!=="object"||!("__html"in W))throw Error("`props.dangerouslySetInnerHTML` must be in the form `{__html: ...}`. Please visit https://react.dev/link/dangerously-set-inner-html for more information.");if(Q=W.__html,Q!=null){if(oe.children!=null)throw Error("Can only set one of `children` or `props.dangerouslySetInnerHTML`.");(ae!=null?ae.__html:void 0)!==Q&&(S.innerHTML=Q)}}break;case"multiple":S.multiple=W&&typeof W!=="function"&&typeof W!=="symbol";break;case"muted":S.muted=W&&typeof W!=="function"&&typeof W!=="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(W==null||typeof W==="function"||typeof W==="boolean"||typeof W==="symbol"){S.removeAttribute("xlink:href");break}dt(W,Q),Q=ah(W),S.setAttributeNS(SF,"xlink:href",Q);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":W!=null&&typeof W!=="function"&&typeof W!=="symbol"?(dt(W,Q),S.setAttribute(Q,W)):S.removeAttribute(Q);break;case"inert":W!==""||wge[Q]||(wge[Q]=!0,console.error("Received an empty string for a boolean attribute `%s`. This will treat the attribute as if it were false. Either pass `false` to silence this warning, or pass `true` if you used an empty string in earlier versions of React to indicate this attribute is true.",Q));case"allowFullScreen":case"async":case"autoPlay":case"controls":case"credentialless":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":W&&typeof W!=="function"&&typeof W!=="symbol"?S.setAttribute(Q,""):S.removeAttribute(Q);break;case"capture":case"download":W===!0?S.setAttribute(Q,""):W!==!1&&W!=null&&typeof W!=="function"&&typeof W!=="symbol"?(dt(W,Q),S.setAttribute(Q,W)):S.removeAttribute(Q);break;case"cols":case"rows":case"size":case"span":W!=null&&typeof W!=="function"&&typeof W!=="symbol"&&!isNaN(W)&&1<=W?(dt(W,Q),S.setAttribute(Q,W)):S.removeAttribute(Q);break;case"rowSpan":case"start":W==null||typeof W==="function"||typeof W==="symbol"||isNaN(W)?S.removeAttribute(Q):(dt(W,Q),S.setAttribute(Q,W));break;case"popover":ks("beforetoggle",S),ks("toggle",S),It(S,"popover",W);break;case"xlinkActuate":cn(S,SF,"xlink:actuate",W);break;case"xlinkArcrole":cn(S,SF,"xlink:arcrole",W);break;case"xlinkRole":cn(S,SF,"xlink:role",W);break;case"xlinkShow":cn(S,SF,"xlink:show",W);break;case"xlinkTitle":cn(S,SF,"xlink:title",W);break;case"xlinkType":cn(S,SF,"xlink:type",W);break;case"xmlBase":cn(S,fDe,"xml:base",W);break;case"xmlLang":cn(S,fDe,"xml:lang",W);break;case"xmlSpace":cn(S,fDe,"xml:space",W);break;case"is":ae!=null&&console.error('Cannot update the "is" prop after it has been initialized.'),It(S,"is",W);break;case"innerText":case"textContent":return;case"popoverTarget":z2t||W==null||typeof W!=="object"||(z2t=!0,console.error("The `popoverTarget` prop expects the ID of an Element as a string. Received %s instead.",W));default:if(!(2<Q.length)||Q[0]!=="o"&&Q[0]!=="O"||Q[1]!=="n"&&Q[1]!=="N")Q=Zr(Q),It(S,Q,W);else{fI.hasOwnProperty(Q)&&W!=null&&typeof W!=="function"&&$d(Q,W);return}}Nc=!0}function YH(S,w,Q,W,oe,ae){switch(Q){case"style":Cc(S,W,ae);return;case"dangerouslySetInnerHTML":if(W!=null){if(typeof W!=="object"||!("__html"in W))throw Error("`props.dangerouslySetInnerHTML` must be in the form `{__html: ...}`. Please visit https://react.dev/link/dangerously-set-inner-html for more information.");if(Q=W.__html,Q!=null){if(oe.children!=null)throw Error("Can only set one of `children` or `props.dangerouslySetInnerHTML`.");(ae!=null?ae.__html:void 0)!==Q&&(S.innerHTML=Q)}}break;case"children":if(typeof W==="string")ji(S,W);else if(typeof W==="number"||typeof W==="bigint")ji(S,""+W);else return;break;case"onScroll":W!=null&&(typeof W!=="function"&&$d(Q,W),ks("scroll",S));return;case"onScrollEnd":W!=null&&(typeof W!=="function"&&$d(Q,W),ks("scrollend",S));return;case"onClick":W!=null&&(typeof W!=="function"&&$d(Q,W),S.onclick=fd);return;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":return;case"innerText":case"textContent":return;default:if(fI.hasOwnProperty(Q))W!=null&&typeof W!=="function"&&$d(Q,W);else e:{if(Q[0]==="o"&&Q[1]==="n"&&(oe=Q.endsWith("Capture"),ae=Q.slice(2,oe?Q.length-7:void 0),w=S[Kg]||null,w=w!=null?w[Q]:null,typeof w==="function"&&S.removeEventListener(ae,w,oe),typeof W==="function")){typeof w!=="function"&&w!==null&&(Q in S?S[Q]=null:S.hasAttribute(Q)&&S.removeAttribute(Q)),S.addEventListener(ae,W,oe);break e}Nc=!0,Q in S?S[Q]=W:W===!0?S.setAttribute(Q,""):It(S,Q,W)}return}Nc=!0}function hp(S,w,Q){switch(pf(w,Q),w){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":ks("error",S),ks("load",S);var W=!1,oe=!1,ae;for(ae in Q)if(Q.hasOwnProperty(ae)){var De=Q[ae];if(De!=null)switch(ae){case"src":W=!0;break;case"srcSet":oe=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(w+" is a void element tag and must neither have `children` nor use `dangerouslySetInnerHTML`.");default:qc(S,w,ae,De,Q,null)}}oe&&qc(S,w,"srcSet",Q.srcSet,Q,null),W&&qc(S,w,"src",Q.src,Q,null);return;case"input":ir("input",Q),ks("invalid",S);var ke=ae=De=oe=null,ot=null,_t=null;for(W in Q)if(Q.hasOwnProperty(W)){var zt=Q[W];if(zt!=null)switch(W){case"name":oe=zt;break;case"type":De=zt;break;case"checked":ot=zt;break;case"defaultChecked":_t=zt;break;case"value":ae=zt;break;case"defaultValue":ke=zt;break;case"children":case"dangerouslySetInnerHTML":if(zt!=null)throw Error(w+" is a void element tag and must neither have `children` nor use `dangerouslySetInnerHTML`.");break;default:qc(S,w,W,zt,Q,null)}}Po(S,Q),Tn(S,ae,ke,ot,_t,De,oe,!1);return;case"select":ir("select",Q),ks("invalid",S),W=De=ae=null;for(oe in Q)if(Q.hasOwnProperty(oe)&&(ke=Q[oe],ke!=null))switch(oe){case"value":ae=ke;break;case"defaultValue":De=ke;break;case"multiple":W=ke;default:qc(S,w,oe,ke,Q,null)}or(S,Q),w=ae,Q=De,S.multiple=!!W,w!=null?Ro(S,!!W,w,!1):Q!=null&&Ro(S,!!W,Q,!0);return;case"textarea":ir("textarea",Q),ks("invalid",S),ae=oe=W=null;for(De in Q)if(Q.hasOwnProperty(De)&&(ke=Q[De],ke!=null))switch(De){case"value":W=ke;break;case"defaultValue":oe=ke;break;case"children":ae=ke;break;case"dangerouslySetInnerHTML":if(ke!=null)throw Error("`dangerouslySetInnerHTML` does not make sense on <textarea>.");break;default:qc(S,w,De,ke,Q,null)}Er(S,Q),Ys(S,W,oe,ae);return;case"option":fo(S,Q);for(ot in Q)if(Q.hasOwnProperty(ot)&&(W=Q[ot],W!=null))switch(ot){case"selected":S.selected=W&&typeof W!=="function"&&typeof W!=="symbol";break;default:qc(S,w,ot,W,Q,null)}return;case"dialog":ks("beforetoggle",S),ks("toggle",S),ks("cancel",S),ks("close",S);break;case"iframe":case"object":ks("load",S);break;case"video":case"audio":for(W=0;W<Foe.length;W++)ks(Foe[W],S);break;case"image":ks("error",S),ks("load",S);break;case"details":ks("toggle",S);break;case"embed":case"source":case"link":ks("error",S),ks("load",S);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(_t in Q)if(Q.hasOwnProperty(_t)&&(W=Q[_t],W!=null))switch(_t){case"children":case"dangerouslySetInnerHTML":throw Error(w+" is a void element tag and must neither have `children` nor use `dangerouslySetInnerHTML`.");default:qc(S,w,_t,W,Q,null)}return;default:if(ea(w)){for(zt in Q)Q.hasOwnProperty(zt)&&(W=Q[zt],W!==void 0&&YH(S,w,zt,W,Q,void 0));return}}for(ke in Q)Q.hasOwnProperty(ke)&&(W=Q[ke],W!=null&&qc(S,w,ke,W,Q,null))}function Hne(S,w,Q,W){switch(pf(w,W),w){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var oe=null,ae=null,De=null,ke=null,ot=null,_t=null,zt=null;for(xn in Q){var en=Q[xn];if(Q.hasOwnProperty(xn)&&en!=null)switch(xn){case"checked":break;case"value":break;case"defaultValue":ot=en;default:W.hasOwnProperty(xn)||qc(S,w,xn,null,W,en)}}for(var Zt in W){var xn=W[Zt];if(en=Q[Zt],W.hasOwnProperty(Zt)&&(xn!=null||en!=null))switch(Zt){case"type":xn!==en&&(Nc=!0),ae=xn;break;case"name":xn!==en&&(Nc=!0),oe=xn;break;case"checked":xn!==en&&(Nc=!0),_t=xn;break;case"defaultChecked":xn!==en&&(Nc=!0),zt=xn;break;case"value":xn!==en&&(Nc=!0),De=xn;break;case"defaultValue":xn!==en&&(Nc=!0),ke=xn;break;case"children":case"dangerouslySetInnerHTML":if(xn!=null)throw Error(w+" is a void element tag and must neither have `children` nor use `dangerouslySetInnerHTML`.");break;default:xn!==en&&qc(S,w,Zt,xn,W,en)}}w=Q.type==="checkbox"||Q.type==="radio"?Q.checked!=null:Q.value!=null,W=W.type==="checkbox"||W.type==="radio"?W.checked!=null:W.value!=null,w||!W||H2t||(console.error("A component is changing an uncontrolled input to be controlled. This is likely caused by the value changing from undefined to a defined value, which should not happen. Decide between using a controlled or uncontrolled input element for the lifetime of the component. More info: https://react.dev/link/controlled-components"),H2t=!0),!w||W||L2t||(console.error("A component is changing a controlled input to be uncontrolled. This is likely caused by the value changing from a defined to undefined, which should not happen. Decide between using a controlled or uncontrolled input element for the lifetime of the component. More info: https://react.dev/link/controlled-components"),L2t=!0),To(S,De,ke,ot,_t,zt,ae,oe);return;case"select":xn=De=ke=Zt=null;for(ae in Q)if(ot=Q[ae],Q.hasOwnProperty(ae)&&ot!=null)switch(ae){case"value":break;case"multiple":xn=ot;default:W.hasOwnProperty(ae)||qc(S,w,ae,null,W,ot)}for(oe in W)if(ae=W[oe],ot=Q[oe],W.hasOwnProperty(oe)&&(ae!=null||ot!=null))switch(oe){case"value":ae!==ot&&(Nc=!0),Zt=ae;break;case"defaultValue":ae!==ot&&(Nc=!0),ke=ae;break;case"multiple":ae!==ot&&(Nc=!0),De=ae;default:ae!==ot&&qc(S,w,oe,ae,W,ot)}W=ke,w=De,Q=xn,Zt!=null?Ro(S,!!w,Zt,!1):!!Q!==!!w&&(W!=null?Ro(S,!!w,W,!0):Ro(S,!!w,w?[]:"",!1));return;case"textarea":xn=Zt=null;for(ke in Q)if(oe=Q[ke],Q.hasOwnProperty(ke)&&oe!=null&&!W.hasOwnProperty(ke))switch(ke){case"value":break;case"children":break;default:qc(S,w,ke,null,W,oe)}for(De in W)if(oe=W[De],ae=Q[De],W.hasOwnProperty(De)&&(oe!=null||ae!=null))switch(De){case"value":oe!==ae&&(Nc=!0),Zt=oe;break;case"defaultValue":oe!==ae&&(Nc=!0),xn=oe;break;case"children":break;case"dangerouslySetInnerHTML":if(oe!=null)throw Error("`dangerouslySetInnerHTML` does not make sense on <textarea>.");break;default:oe!==ae&&qc(S,w,De,oe,W,ae)}Xi(S,Zt,xn);return;case"option":for(var Co in Q)if(Zt=Q[Co],Q.hasOwnProperty(Co)&&Zt!=null&&!W.hasOwnProperty(Co))switch(Co){case"selected":S.selected=!1;break;default:qc(S,w,Co,null,W,Zt)}for(ot in W)if(Zt=W[ot],xn=Q[ot],W.hasOwnProperty(ot)&&Zt!==xn&&(Zt!=null||xn!=null))switch(ot){case"selected":Zt!==xn&&(Nc=!0),S.selected=Zt&&typeof Zt!=="function"&&typeof Zt!=="symbol";break;default:qc(S,w,ot,Zt,W,xn)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var xr in Q)Zt=Q[xr],Q.hasOwnProperty(xr)&&Zt!=null&&!W.hasOwnProperty(xr)&&qc(S,w,xr,null,W,Zt);for(_t in W)if(Zt=W[_t],xn=Q[_t],W.hasOwnProperty(_t)&&Zt!==xn&&(Zt!=null||xn!=null))switch(_t){case"children":case"dangerouslySetInnerHTML":if(Zt!=null)throw Error(w+" is a void element tag and must neither have `children` nor use `dangerouslySetInnerHTML`.");break;default:qc(S,w,_t,Zt,W,xn)}return;default:if(ea(w)){for(var li in Q)Zt=Q[li],Q.hasOwnProperty(li)&&Zt!==void 0&&!W.hasOwnProperty(li)&&YH(S,w,li,void 0,W,Zt);for(zt in W)Zt=W[zt],xn=Q[zt],!W.hasOwnProperty(zt)||Zt===xn||Zt===void 0&&xn===void 0||YH(S,w,zt,Zt,W,xn);return}}for(var ga in Q)Zt=Q[ga],Q.hasOwnProperty(ga)&&Zt!=null&&!W.hasOwnProperty(ga)&&qc(S,w,ga,null,W,Zt);for(en in W)Zt=W[en],xn=Q[en],!W.hasOwnProperty(en)||Zt===xn||Zt==null&&xn==null||qc(S,w,en,Zt,W,xn)}function Kp(S){switch(S){case"class":return"className";case"for":return"htmlFor";default:return S}}function Jc(S){for(var w={},Q=S.style,W=0;W<Q.length;W++){var oe=Q[W];oe==="view-transition-name"&&Ra(S)||(w[oe]=Q.getPropertyValue(oe))}return w}function s8(S,w,Q){if(w!=null&&typeof w!=="object")console.error("The `style` prop expects a mapping from style properties to values, not a string. For example, style={{marginRight: spacing + 'em'}} when using JSX.");else{var W,oe=W="",ae;for(ae in w)if(w.hasOwnProperty(ae)){var De=w[ae];De!=null&&typeof De!=="boolean"&&De!==""&&(ae.indexOf("--")===0?(rt(De,ae),W+=oe+ae+":"+(""+De).trim()):typeof De!=="number"||De===0||pe.has(ae)?(rt(De,ae),W+=oe+ae.replace(qne,"-$1").toLowerCase().replace(Jne,"-ms-")+":"+(""+De).trim()):W+=oe+ae.replace(qne,"-$1").toLowerCase().replace(Jne,"-ms-")+":"+De+"px",oe=";")}W=W||null,w=S.getAttribute("style"),w!==W&&(W=ba(W),w=ba(w),w===W||w[w.length-1]===";"&&Kd(S)||(Q.style=Jc(S)))}}function zm(S,w,Q,W,oe,ae){if(oe.delete(Q),S=S.getAttribute(Q),S===null)switch(typeof W){case"undefined":case"function":case"symbol":case"boolean":return}else if(W!=null)switch(typeof W){case"function":case"symbol":case"boolean":break;default:if(dt(W,w),S===""+W)return}ac(w,S,W,ae)}function wD(S,w,Q,W,oe,ae){if(oe.delete(Q),S=S.getAttribute(Q),S===null){switch(typeof W){case"function":case"symbol":return}if(!W)return}else switch(typeof W){case"function":case"symbol":break;default:if(W)return}ac(w,S,W,ae)}function J6(S,w,Q,W,oe,ae){if(oe.delete(Q),S=S.getAttribute(Q),S===null)switch(typeof W){case"undefined":case"function":case"symbol":return}else if(W!=null)switch(typeof W){case"function":case"symbol":break;default:if(dt(W,Q),S===""+W)return}ac(w,S,W,ae)}function Z6(S,w,Q,W,oe,ae){if(oe.delete(Q),S=S.getAttribute(Q),S===null)switch(typeof W){case"undefined":case"function":case"symbol":case"boolean":return;default:if(isNaN(W))return}else if(W!=null)switch(typeof W){case"function":case"symbol":case"boolean":break;default:if(!isNaN(W)&&(dt(W,w),S===""+W))return}ac(w,S,W,ae)}function nx(S,w,Q,W,oe,ae){if(oe.delete(Q),S=S.getAttribute(Q),S===null)switch(typeof W){case"undefined":case"function":case"symbol":case"boolean":return}else if(W!=null)switch(typeof W){case"function":case"symbol":case"boolean":break;default:if(dt(W,w),Q=ah(""+W),S===Q)return}ac(w,S,W,ae)}function G5(S,w,Q,W){for(var oe={},ae=new Set,De=S.attributes,ke=0;ke<De.length;ke++)switch(De[ke].name.toLowerCase()){case"value":break;case"checked":break;case"selected":break;case"vt-name":case"vt-update":case"vt-enter":case"vt-exit":case"vt-share":case"vt-parent-enter":case"vt-parent-exit":break;default:ae.add(De[ke].name)}if(ea(w)){for(var ot in Q)if(Q.hasOwnProperty(ot)){var _t=Q[ot];if(_t!=null){if(fI.hasOwnProperty(ot))typeof _t!=="function"&&$d(ot,_t);else if(Q.suppressHydrationWarning!==!0)switch(ot){case"children":typeof _t!=="string"&&typeof _t!=="number"||ac("children",S.textContent,_t,oe);continue;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":continue;case"dangerouslySetInnerHTML":De=S.innerHTML,_t=_t?_t.__html:void 0,_t!=null&&(_t=uC(S,_t),ac(ot,De,_t,oe));continue;case"style":ae.delete(ot),s8(S,_t,oe);continue;case"offsetParent":case"offsetTop":case"offsetLeft":case"offsetWidth":case"offsetHeight":case"isContentEditable":case"outerText":case"outerHTML":ae.delete(ot.toLowerCase()),console.error("Assignment to read-only property will result in a no-op: `%s`",ot);continue;case"className":ae.delete("class"),De=mt(S,"class",_t),ac("className",De,_t,oe);continue;default:W.context===sM&&w!=="svg"&&w!=="math"?ae.delete(ot.toLowerCase()):ae.delete(ot),De=mt(S,ot,_t),ac(ot,De,_t,oe)}}}}else for(_t in Q)if(Q.hasOwnProperty(_t)&&(ot=Q[_t],ot!=null)){if(fI.hasOwnProperty(_t))typeof ot!=="function"&&$d(_t,ot);else if(Q.suppressHydrationWarning!==!0)switch(_t){case"children":typeof ot!=="string"&&typeof ot!=="number"||ac("children",S.textContent,ot,oe);continue;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"value":case"checked":case"selected":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":continue;case"dangerouslySetInnerHTML":De=S.innerHTML,ot=ot?ot.__html:void 0,ot!=null&&(ot=uC(S,ot),De!==ot&&(oe[_t]={__html:De}));continue;case"className":zm(S,_t,"class",ot,ae,oe);continue;case"tabIndex":zm(S,_t,"tabindex",ot,ae,oe);continue;case"style":ae.delete(_t),s8(S,ot,oe);continue;case"multiple":ae.delete(_t),ac(_t,S.multiple,ot,oe);continue;case"muted":ae.delete(_t),ac(_t,S.muted,ot,oe);continue;case"autoFocus":ae.delete("autofocus"),ac(_t,S.autofocus,ot,oe);continue;case"data":if(w!=="object"){ae.delete(_t),De=S.getAttribute("data"),ac(_t,De,ot,oe);continue}case"src":case"href":if(!(ot!==""||w==="a"&&_t==="href"||w==="object"&&_t==="data")){_t==="src"?console.error('An empty string ("") was passed to the %s attribute. This may cause the browser to download the whole page again over the network. To fix this, either do not render the element at all or pass null to %s instead of an empty string.',_t,_t):console.error('An empty string ("") was passed to the %s attribute. To fix this, either do not render the element at all or pass null to %s instead of an empty string.',_t,_t);continue}nx(S,_t,_t,ot,ae,oe);continue;case"action":case"formAction":if(De=S.getAttribute(_t),typeof ot==="function"){ae.delete(_t.toLowerCase()),_t==="formAction"?(ae.delete("name"),ae.delete("formenctype"),ae.delete("formmethod"),ae.delete("formtarget")):(ae.delete("enctype"),ae.delete("method"),ae.delete("target"));continue}else if(De===Ffo){ae.delete(_t.toLowerCase()),ac(_t,"function",ot,oe);continue}nx(S,_t,_t.toLowerCase(),ot,ae,oe);continue;case"xlinkHref":nx(S,_t,"xlink:href",ot,ae,oe);continue;case"contentEditable":J6(S,_t,"contenteditable",ot,ae,oe);continue;case"spellCheck":J6(S,_t,"spellcheck",ot,ae,oe);continue;case"draggable":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":J6(S,_t,_t,ot,ae,oe);continue;case"allowFullScreen":case"async":case"autoPlay":case"controls":case"credentialless":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":wD(S,_t,_t.toLowerCase(),ot,ae,oe);continue;case"capture":case"download":e:{ke=S;var zt=De=_t,en=oe;if(ae.delete(zt),ke=ke.getAttribute(zt),ke===null)switch(typeof ot){case"undefined":case"function":case"symbol":break e;default:if(ot===!1)break e}else if(ot!=null)switch(typeof ot){case"function":case"symbol":break;case"boolean":if(ot===!0&&ke==="")break e;break;default:if(dt(ot,De),ke===""+ot)break e}ac(De,ke,ot,en)}continue;case"cols":case"rows":case"size":case"span":e:{if(ke=S,zt=De=_t,en=oe,ae.delete(zt),ke=ke.getAttribute(zt),ke===null)switch(typeof ot){case"undefined":case"function":case"symbol":case"boolean":break e;default:if(isNaN(ot)||1>ot)break e}else if(ot!=null)switch(typeof ot){case"function":case"symbol":case"boolean":break;default:if(!(isNaN(ot)||1>ot)&&(dt(ot,De),ke===""+ot))break e}ac(De,ke,ot,en)}continue;case"rowSpan":Z6(S,_t,"rowspan",ot,ae,oe);continue;case"start":Z6(S,_t,_t,ot,ae,oe);continue;case"xHeight":zm(S,_t,"x-height",ot,ae,oe);continue;case"xlinkActuate":zm(S,_t,"xlink:actuate",ot,ae,oe);continue;case"xlinkArcrole":zm(S,_t,"xlink:arcrole",ot,ae,oe);continue;case"xlinkRole":zm(S,_t,"xlink:role",ot,ae,oe);continue;case"xlinkShow":zm(S,_t,"xlink:show",ot,ae,oe);continue;case"xlinkTitle":zm(S,_t,"xlink:title",ot,ae,oe);continue;case"xlinkType":zm(S,_t,"xlink:type",ot,ae,oe);continue;case"xmlBase":zm(S,_t,"xml:base",ot,ae,oe);continue;case"xmlLang":zm(S,_t,"xml:lang",ot,ae,oe);continue;case"xmlSpace":zm(S,_t,"xml:space",ot,ae,oe);continue;case"inert":ot!==""||wge[_t]||(wge[_t]=!0,console.error("Received an empty string for a boolean attribute `%s`. This will treat the attribute as if it were false. Either pass `false` to silence this warning, or pass `true` if you used an empty string in earlier versions of React to indicate this attribute is true.",_t)),wD(S,_t,_t,ot,ae,oe);continue;default:if(!(2<_t.length)||_t[0]!=="o"&&_t[0]!=="O"||_t[1]!=="n"&&_t[1]!=="N"){ke=Zr(_t),De=!1,W.context===sM&&w!=="svg"&&w!=="math"?ae.delete(ke.toLowerCase()):(zt=_t.toLowerCase(),zt=Et.hasOwnProperty(zt)?Et[zt]||null:null,zt!==null&&zt!==_t&&(De=!0,ae.delete(zt)),ae.delete(ke));e:if(zt=S,en=ke,ke=ot,gt(en))if(zt.hasAttribute(en))zt=en.toLowerCase()==="nonce"?zt.nonce:zt.getAttribute(en),dt(ke,en),ke=zt===""+ke?ke:zt;else{switch(typeof ke){case"function":case"symbol":break e;case"boolean":if(zt=en.toLowerCase().slice(0,5),zt!=="data-"&&zt!=="aria-")break e}ke=ke===void 0?void 0:null}else ke=void 0;De||ac(_t,ke,ot,oe)}}}return 0<ae.size&&Q.suppressHydrationWarning!==!0&&w1(S,ae,oe),Object.keys(oe).length===0?null:oe}function Fne(S,w){switch(S.length){case 0:return"";case 1:return S[0];case 2:return S[0]+" "+w+" "+S[1];default:return S.slice(0,-1).join(", ")+", "+w+" "+S[S.length-1]}}function GH(S){switch(S){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function zne(){if(typeof performance.getEntriesByType==="function"){for(var S=0,w=0,Q=performance.getEntriesByType("resource"),W=0;W<Q.length;W++){var oe=Q[W],{transferSize:ae,initiatorType:De,duration:ke}=oe;if(ae&&ke&&GH(De)){De=0,ke=oe.responseEnd;for(W+=1;W<Q.length;W++){var ot=Q[W],_t=ot.startTime;if(_t>ke)break;var zt=ot.transferSize,en=ot.initiatorType;zt&&GH(en)&&(ot=ot.responseEnd,De+=zt*(ot<ke?1:(ke-_t)/(ot-_t)))}if(--W,w+=8*(ae+De)/(oe.duration/1000),S++,10<S)break}}if(0<S)return w/S/1e6}return navigator.connection&&(S=navigator.connection.downlink,typeof S==="number")?S:5}function lh(S){return S.nodeType===9?S:S.ownerDocument}function eI(S){switch(S){case Te:return GW;case Ce:return Tge;default:return sM}}function QE(S,w){if(S===sM)switch(w){case"svg":return GW;case"math":return Tge;default:return sM}return S===GW&&w==="foreignObject"?sM:S}function Om(S,w,Q,W){return Q=lh(Q).createElement(S),Q[ku]=W,Q[Kg]=w,hp(Q,S,w),ln(Q),Q}function pC(S){if(S=S.type,typeof S!=="string"||S==="")return!1;if(S=S.toLowerCase(),S==="module"||S==="importmap"||S==="speculationrules")return!1;switch(S){case"application/ecmascript":case"application/javascript":case"application/x-ecmascript":case"application/x-javascript":case"text/ecmascript":case"text/javascript":case"text/javascript1.0":case"text/javascript1.1":case"text/javascript1.2":case"text/javascript1.3":case"text/javascript1.4":case"text/javascript1.5":case"text/jscript":case"text/livescript":case"text/x-ecmascript":case"text/x-javascript":return!1}return!0}function a8(S,w){return S==="textarea"||S==="noscript"||typeof w.children==="string"||typeof w.children==="number"||typeof w.children==="bigint"||typeof w.dangerouslySetInnerHTML==="object"&&w.dangerouslySetInnerHTML!==null&&w.dangerouslySetInnerHTML.__html!=null}function BD(){var S=window.event;if(S&&S.type==="popstate"){if(S===bDe)return!1;return bDe=S,!0}return bDe=null,!1}function U5(){var S=window.event;return S&&S!==Voe?S.type:null}function mf(){var S=window.event;return S&&S!==Voe?S.timeStamp:-1.1}function c8(S){setTimeout(function(){throw S})}function UH(S,w,Q){switch(w){case"button":case"input":case"select":case"textarea":Q.autoFocus&&S.focus();break;case"img":Q.src?S.src=Q.src:Q.srcSet&&(S.srcset=Q.srcSet)}}function TD(){}function DD(S,w,Q,W){Hne(S,w,Q,W),S[Kg]=W}function tI(S){ji(S,"")}function WH(S,w,Q){S.nodeValue=Q}function l8(S){if(!S.__reactWarnedAboutChildrenConflict){var w=S[Kg]||null;if(w!==null){var Q=_n(S);Q!==null&&(typeof w.children==="string"||typeof w.children==="number"?(S.__reactWarnedAboutChildrenConflict=!0,ye(Q,function(){console.error('Cannot use a ref on a React element as a container to `createRoot` or `createPortal` if that element also sets "children" text content using React. It should be a leaf with no children. Otherwise it\'s ambiguous which children should be used.')})):w.dangerouslySetInnerHTML!=null&&(S.__reactWarnedAboutChildrenConflict=!0,ye(Q,function(){console.error('Cannot use a ref on a React element as a container to `createRoot` or `createPortal` if that element also sets "dangerouslySetInnerHTML" using React. It should be a leaf with no children. Otherwise it\'s ambiguous which children should be used.')})))}}}function ox(S){return S==="head"}function nI(S,w){S.removeChild(w)}function h8(S,w){(S.nodeType===9?S.body:S.nodeName==="HTML"?S.ownerDocument.body:S).removeChild(w)}function XH(S,w){var Q=w,W=0;do{var oe=Q.nextSibling;if(S.removeChild(Q),oe&&oe.nodeType===8)if(Q=oe.data,Q===Ooe||Q===Bge){if(W===0){S.removeChild(oe),vd(w);return}W--}else if(Q===zoe||Q===pN||Q===EF||Q===YW||Q===PF)W++;else if(Q===Ofo)gC(S.ownerDocument.documentElement);else if(Q===Yfo){Q=S.ownerDocument.head,gC(Q);for(var ae=Q.firstChild;ae;){var De=ae.nextSibling,ke=ae.nodeName;ae[ix]||ke==="SCRIPT"||ke==="STYLE"||ke==="LINK"&&ae.rel.toLowerCase()==="stylesheet"||Q.removeChild(ae),ae=De}}else Q===Vfo&&gC(S.ownerDocument.body);Q=oe}while(Q);vd(w)}function W5(S,w){var Q=S;S=0;do{var W=Q.nextSibling;if(Q.nodeType===1?w?(Q._stashedDisplay=Q.style.display,Q.style.display="none"):(Q.style.display=Q._stashedDisplay||"",Q.getAttribute("style")===""&&Q.removeAttribute("style")):Q.nodeType===3&&(w?(Q._stashedText=Q.nodeValue,Q.nodeValue=""):Q.nodeValue=Q._stashedText||""),W&&W.nodeType===8)if(Q=W.data,Q===Ooe)if(S===0)break;else S--;else Q!==zoe&&Q!==pN&&Q!==EF&&Q!==YW||S++;Q=W}while(Q)}function eW(S){W5(S,!0)}function u2(S){S=S.style,typeof S.setProperty==="function"?S.setProperty("display","none","important"):S.display="none"}function d8(S){S.nodeValue=""}function u8(S){W5(S,!1)}function mC(S,w){w=w[Y2t],w=w!==void 0&&w!==null&&w.hasOwnProperty("display")?w.display:null,S.style.display=w==null||typeof w==="boolean"?"":(""+w).trim()}function X5(S,w){S.nodeValue=w}function oI(S){for(var w=S.firstChild;w!=null;){if(w.nodeType===1&&getComputedStyle(w).display==="block"){var Q=_n(w)||_n(S);ye(Q,function(W,oe){console.error(`You're about to start a <ViewTransition> around a display: inline element <%s>, which itself has a display: block element <%s> inside it. This might trigger a bug in Safari which causes the View Transition to be skipped with a duplicate name error.
https://bugs.webkit.org/show_bug.cgi?id=290923`,W.toLocaleLowerCase(),oe.toLocaleLowerCase())},S.tagName,w.tagName);break}if(w.firstChild!=null)w=w.firstChild;else{if(w===S)break;for(;w.nextSibling==null&&w.parentNode!=null&&w.parentNode!==S;)w=w.parentNode;w=w.nextSibling}}}function rI(S,w,Q){if(w=CSS.escape(w)!==w?"r-"+btoa(w).replace(/=/g,""):w,S.style.viewTransitionName=w,Q!=null&&(S.style.viewTransitionClass=Q),Q=getComputedStyle(S),Q.display==="inline"){if(w=S.getClientRects(),w.length===1)var W=1;else for(var oe=W=0;oe<w.length;oe++){var ae=w[oe];0<ae.width&&0<ae.height&&W++}W===1?(S=S.style,S.display=w.length===1?"inline-block":"block",S.marginTop="-"+Q.paddingTop,S.marginBottom="-"+Q.paddingBottom):oI(S)}}function j5(S,w){S=S.style,w=w[Y2t];var Q=w!=null?w.hasOwnProperty("viewTransitionName")?w.viewTransitionName:w.hasOwnProperty("view-transition-name")?w["view-transition-name"]:null:null;S.viewTransitionName=Q==null||typeof Q==="boolean"?"":(""+Q).trim(),Q=w!=null?w.hasOwnProperty("viewTransitionClass")?w.viewTransitionClass:w.hasOwnProperty("view-transition-class")?w["view-transition-class"]:null:null,S.viewTransitionClass=Q==null||typeof Q==="boolean"?"":(""+Q).trim(),S.display==="inline-block"&&(w==null?S.display=S.margin="":(Q=w.display,S.display=Q==null||typeof Q==="boolean"?"":Q,Q=w.margin,Q!=null?S.margin=Q:(Q=w.hasOwnProperty("marginTop")?w.marginTop:w["margin-top"],S.marginTop=Q==null||typeof Q==="boolean"?"":Q,w=w.hasOwnProperty("marginBottom")?w.marginBottom:w["margin-bottom"],S.marginBottom=w==null||typeof w==="boolean"?"":w)))}function p8(S,w,Q){return Q=Q.ownerDocument.defaultView,{rect:S,abs:w.position==="absolute"||w.position==="fixed",clip:w.clipPath!=="none"||w.overflow!=="visible"||w.filter!=="none"||w.mask!=="none"||w.mask!=="none"||w.borderRadius!=="0px",view:0<=S.bottom&&0<=S.right&&S.top<=Q.innerHeight&&S.left<=Q.innerWidth}}function m8(S){var w=S.getBoundingClientRect(),Q=getComputedStyle(S);return p8(w,Q,S)}function _8(S){var w=S.getBoundingClientRect();w=new DOMRect(w.x+20000,w.y+20000,w.width,w.height);var Q=getComputedStyle(S);return p8(w,Q,S)}function ND(S,w){if(typeof S==="object"&&S!==null)switch(S.name){case"TimeoutError":return Error("A ViewTransition timed out because a Navigation stalled. This can happen if a Navigation is blocked on React itself. Such as if it's resolved inside useEffect. This can be solved by moving the resolution to useLayoutEffect.",{cause:S});case"AbortError":return w?null:Error("A ViewTransition was aborted early. This might be because you have other View Transition libraries on the page and only one can run at a time. To avoid this, use only React's built-in <ViewTransition> to coordinate.",{cause:S});case"InvalidStateError":if(S.message==="View transition was skipped because document visibility state is hidden."||S.message==="Skipping view transition because document visibility state has become hidden."||S.message==="Skipping view transition because viewport size changed."||S.message==="Transition was aborted because of invalid state")return null}return S}function kE(S){return S.documentElement.clientHeight}function RD(S){this.addEventListener("load",S),this.addEventListener("error",S)}function g8(S,w,Q,W,oe,ae,De,ke,ot,_t,zt){var en=w.nodeType===9?w:w.ownerDocument;try{var Zt=en.startViewTransition({update:function(){var Co=en.defaultView,xr=Co.navigation&&Co.navigation.transition,li=en.fonts.status;W();var ga=[];if(li==="loaded"&&(kE(en),en.fonts.status==="loading"&&ga.push(en.fonts.ready)),li=ga.length,S!==null)for(var $t=S.suspenseyImages,qt=0,tn=0;tn<$t.length;tn++){var Yn=$t[tn];if(!Yn.complete){var ko=Yn.getBoundingClientRect();if(0<ko.bottom&&0<ko.right&&ko.top<Co.innerHeight&&ko.left<Co.innerWidth){if(qt+=xo(Yn),qt>Nge){ga.length=li;break}Yn=new Promise(RD.bind(Yn)),ga.push(Yn)}}}if(0<ga.length)return _t(0<li?ga.length>li?"Waiting on Fonts and Images":"Waiting on Fonts":"Waiting on Images"),Co=Promise.race([Promise.all(ga),new Promise(function(es){return setTimeout(es,Wfo)})]).then(oe,oe),(xr?Promise.allSettled([xr.finished,Co]):Co).then(ae,ae);if(oe(),xr)return xr.finished.then(ae,ae);ae()},types:Q});en.__reactViewTransition=Zt;var xn=[];return Zt.ready.then(function(){for(var Co=en.documentElement.getAnimations({subtree:!0}),xr=0;xr<Co.length;xr++){var li=Co[xr],ga=li.effect,$t=ga.pseudoElement;if($t!=null&&$t.startsWith("::view-transition")){xn.push(li),li=ga.getKeyframes();for(var qt=$t=void 0,tn=!0,Yn=0;Yn<li.length;Yn++){var ko=li[Yn],es=ko.width;if($t===void 0)$t=es;else if($t!==es){tn=!1;break}if(es=ko.height,qt===void 0)qt=es;else if(qt!==es){tn=!1;break}delete ko.width,delete ko.height,ko.transform==="none"&&delete ko.transform}tn&&$t!==void 0&&qt!==void 0&&(ga.setKeyframes(li),tn=getComputedStyle(ga.target,ga.pseudoElement),tn.width!==$t||tn.height!==qt)&&(tn=li[0],tn.width=$t,tn.height=qt,tn=li[li.length-1],tn.width=$t,tn.height=qt,ga.setKeyframes(li))}}De()},function(Co){en.__reactViewTransition===Zt&&(en.__reactViewTransition=null);try{Co=ND(Co,!1),Co!==null&&ot(Co)}finally{W(),oe(),De(),zt()}}),Zt.finished.finally(function(){for(var Co=0;Co<xn.length;Co++)xn[Co].cancel();en.__reactViewTransition===Zt&&(en.__reactViewTransition=null),zt(),ke()}),Zt}catch(Co){return W(),oe(),zt(),De(),null}}function $p(S,w){this._scope=document.documentElement,this._selector="::view-transition-"+S+"("+w+")"}function Gg(S){return{name:S,group:new $p("group",S),imagePair:new $p("image-pair",S),old:new $p("old",S),new:new $p("new",S)}}function Eh(S){this._fragmentFiber=S,this._observers=this._eventListeners=null}function qp(S,w,Q,W){return N(S).addEventListener(w,Q,W),!1}function F0(S,w,Q,W){return N(S).removeEventListener(w,Q,W),!1}function hh(S){return S!=null&&typeof S!=="boolean"&&(S.once===!0||S.signal instanceof AbortSignal)?{capture:S.capture,passive:S.passive}:S}function Vm(S){return S==null?"c=0":typeof S==="boolean"?"c="+(S?"1":"0"):"c="+(S.capture?"1":"0")}function K5(S,w,Q,W){if(S.length===0)return-1;W=Vm(W);for(var oe=0;oe<S.length;oe++){var ae=S[oe];if(ae.type===w&&ae.listener===Q&&Vm(ae.optionsOrUseCapture)===W)return oe}return-1}function LE(S,w){if(S.tag===6)return!1;return S=N(S),Un(S,w)}function HE(S,w){return w.push(S),!1}function jH(S,w){if(S.tag===6)return!1;return S=N(S),S===w||S.contains(w)?(w.blur(),!0):!1}function FE(S,w){if(S.tag===6)return!1;return S=N(S),w.observe(S),!1}function KH(S,w){if(S.tag===6)return!1;return S=N(S),w.unobserve(S),!1}function $5(S,w,Q){PI.push({fragmentInstance:S,observer:w,instance:Q}),vDe||(vDe=!0,_f(function(){vDe=!1;var W=PI;PI=[];for(var oe=0;oe<W.length;oe++){var ae=W[oe];ae.observer.unobserve(ae.instance)}}))}function $H(S,w){if(S.tag===6){S=S.stateNode;var Q=S.ownerDocument.createRange();Q.selectNodeContents(S),w.push.apply(w,Q.getClientRects())}else S=N(S),w.push.apply(w,S.getClientRects());return!1}function qH(S,w,Q,W,oe){var ae=mn(oe);if(S&Node.DOCUMENT_POSITION_CONTAINED_BY){if(Q=!!ae)e:{for(;ae!==null;){if(ae.tag===7&&(ae===w||ae.alternate===w)){Q=!0;break e}ae=ae.return}Q=!1}return Q}if(S&Node.DOCUMENT_POSITION_CONTAINS){if(ae===null)return ae=oe.ownerDocument,oe===ae||oe===ae.documentElement||oe===ae.body;e:{ae=w;for(w=P(w);ae!==null;){if(!(ae.tag!==5&&ae.tag!==3&&ae.tag!==27||ae!==w&&ae.alternate!==w)){ae=!0;break e}ae=ae.return}ae=!1}return ae}return S&Node.DOCUMENT_POSITION_PRECEDING?((w=!!ae)&&!(w=ae===Q)&&(w=V(Q,ae,H),w===null?w=!1:(v(w,!0,D,ae,Q),ae=t4,t4=null,w=ae!==null)),w):S&Node.DOCUMENT_POSITION_FOLLOWING?((w=!!ae)&&!(w=ae===W)&&(w=V(W,ae,H),w===null?w=!1:(v(w,!0,L,ae,W),ae=t4,YE=t4=null,w=ae!==null)),w):!1}function QD(S,w){var Q=S.ownerDocument.createRange();Q.selectNodeContents(S),S=Q.getBoundingClientRect(),window.scrollTo(window.scrollX+S.left,w?window.scrollY+S.top:window.scrollY+S.bottom-window.innerHeight)}function A8(S,w){return S=N(S),f8(S,w),!1}function f8(S,w){S.reactFragments==null&&(S.reactFragments=new Set),S.reactFragments.add(w)}function iI(S,w){var Q=w._eventListeners;if(Q!==null)for(var W=0;W<Q.length;W++){var oe=Q[W];S.addEventListener(oe.type,oe.attachedListener,hh(oe.optionsOrUseCapture))}S.nodeType!==3&&(Q=w._observers,Q!==null&&Q.forEach(function(ae){for(var De=0,ke=0;ke<PI.length;ke++){var ot=PI[ke];if(ot.fragmentInstance!==w||ot.observer!==ae||ot.instance!==S)PI[De++]=ot}PI.length=De,ae.observe(S)}),f8(S,w))}function tW(S,w){var Q=w._eventListeners;if(Q!==null)for(var W=0;W<Q.length;W++){var oe=Q[W];S.removeEventListener(oe.type,oe.attachedListener,hh(oe.optionsOrUseCapture))}S.nodeType!==3&&(Q=w._observers,Q!==null&&Q.forEach(function(ae){typeof ae.rootMargin==="string"?$5(w,ae,S):ae.unobserve(S)}),S.reactFragments!=null&&S.reactFragments.delete(w))}function kD(S){var w=S.firstChild;w&&w.nodeType===10&&(w=w.nextSibling);for(;w;){var Q=w;switch(w=w.nextSibling,Q.nodeName){case"HTML":case"HEAD":case"BODY":kD(Q),Ut(Q);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(Q.rel.toLowerCase()==="stylesheet")continue}S.removeChild(Q)}}function zE(S,w,Q,W){for(;S.nodeType===1;){var oe=Q;if(S.nodeName.toLowerCase()!==w.toLowerCase()){if(!W&&(S.nodeName!=="INPUT"||S.type!=="hidden"))break}else if(!W)if(w==="input"&&S.type==="hidden"){dt(oe.name,"name");var ae=oe.name==null?null:""+oe.name;if(oe.type==="hidden"&&S.getAttribute("name")===ae)return S}else return S;else if(!S[ix])switch(w){case"meta":if(!S.hasAttribute("itemprop"))break;return S;case"link":if(ae=S.getAttribute("rel"),ae==="stylesheet"&&S.hasAttribute("data-precedence"))break;else if(ae!==oe.rel||S.getAttribute("href")!==(oe.href==null||oe.href===""?null:oe.href)||S.getAttribute("crossorigin")!==(oe.crossOrigin==null?null:oe.crossOrigin)||S.getAttribute("title")!==(oe.title==null?null:oe.title))break;return S;case"style":if(S.hasAttribute("data-precedence"))break;return S;case"script":if(ae=S.getAttribute("src"),(ae!==(oe.src==null?null:oe.src)||S.getAttribute("type")!==(oe.type==null?null:oe.type)||S.getAttribute("crossorigin")!==(oe.crossOrigin==null?null:oe.crossOrigin))&&ae&&S.hasAttribute("async")&&!S.hasAttribute("itemprop"))break;return S;default:return S}if(S=Jp(S.nextSibling),S===null)break}return null}function nW(S,w,Q){if(w==="")return null;for(;S.nodeType!==3;){if((S.nodeType!==1||S.nodeName!=="INPUT"||S.type!=="hidden")&&!Q)return null;if(S=Jp(S.nextSibling),S===null)return null}return S}function q5(S,w){for(;S.nodeType!==8;){if((S.nodeType!==1||S.nodeName!=="INPUT"||S.type!=="hidden")&&!w)return null;if(S=Jp(S.nextSibling),S===null)return null}return S}function Wi(S){return S.data===pN||S.data===EF}function Oc(S){return S.data===YW||S.data===pN&&S.ownerDocument.readyState!==V2t}function Du(S,w){var Q=S.ownerDocument;if(S.data===EF)S._reactRetry=w;else if(S.data!==pN||Q.readyState!==V2t)w();else{var W=function(){w(),Q.removeEventListener("DOMContentLoaded",W)};Q.addEventListener("DOMContentLoaded",W),S._reactRetry=W}}function Jp(S){for(;S!=null;S=S.nextSibling){var w=S.nodeType;if(w===1||w===3)break;if(w===8){if(w=S.data,w===zoe||w===YW||w===pN||w===EF||w===PF||w===yDe||w===O2t)break;if(w===Ooe||w===Bge)return null}}return S}function _C(S){if(S.nodeType===1){for(var w=S.nodeName.toLowerCase(),Q={},W=S.attributes,oe=0;oe<W.length;oe++){var ae=W[oe];Q[Kp(ae.name)]=ae.name.toLowerCase()==="style"?Jc(S):ae.value}return{type:w,props:Q}}return S.nodeType===8?S.data===PF?{type:"Activity",props:{}}:{type:"Suspense",props:{}}:S.nodeValue}function J5(S,w,Q){return Q===null||Q[zfo]!==!0?(S.nodeValue===w?S=null:(w=ba(w),S=ba(S.nodeValue)===w?null:S.nodeValue),S):null}function Z5(S){S=S.nextSibling;for(var w=0;S;){if(S.nodeType===8){var Q=S.data;if(Q===Ooe||Q===Bge){if(w===0)return Jp(S.nextSibling);w--}else Q!==zoe&&Q!==YW&&Q!==pN&&Q!==EF&&Q!==PF||w++}S=S.nextSibling}return null}function sI(S){S=S.previousSibling;for(var w=0;S;){if(S.nodeType===8){var Q=S.data;if(Q===zoe||Q===YW||Q===pN||Q===EF||Q===PF){if(w===0)return S;w--}else Q!==Ooe&&Q!==Bge||w++}S=S.previousSibling}return null}function rx(S){vd(S)}function oW(S){vd(S)}function rW(S){vd(S)}function Un(S,w){function Q(){W=!0}if(S.ownerDocument.activeElement===S)return!0;var W=!1;try{S.ownerDocument.addEventListener("focus",Q,!0),(S.focus||HTMLElement.prototype.focus).call(S,w)}finally{S.ownerDocument.removeEventListener("focus",Q,!0)}return W}function _f(S){X2t(function(){X2t(function(w){return S(w)})})}function Ug(S,w,Q,W,oe){switch(oe&&Yd(S,W.ancestorInfo),w=lh(Q),S){case"html":if(S=w.documentElement,!S)throw Error("React expected an <html> element (document.documentElement) to exist in the Document but one was not found. React never removes the documentElement for any Document it renders into so the cause is likely in some other script running on this page.");return S;case"head":if(S=w.head,!S)throw Error("React expected a <head> element (document.head) to exist in the Document but one was not found. React never removes the head for any Document it renders into so the cause is likely in some other script running on this page.");return S;case"body":if(S=w.body,!S)throw Error("React expected a <body> element (document.body) to exist in the Document but one was not found. React never removes the body for any Document it renders into so the cause is likely in some other script running on this page.");return S;default:throw Error("resolveSingletonInstance was called with an element type that is not supported. This is a bug in React.")}}function OE(S,w,Q,W){if(!Q[_I]&&_n(Q)){var oe=Q.tagName.toLowerCase();console.error("You are mounting a new %s component when a previous one has not first unmounted. It is an error to render more than one %s component at a time and attributes and children of these components will likely fail in unpredictable ways. Please only render a single instance of <%s> and if you need to mount a new one, ensure any previous ones have unmounted first.",oe,oe,oe)}switch(S){case"html":case"head":case"body":break;default:console.error("acquireSingletonInstance was called with an element type that is not supported. This is a bug in React.")}for(oe=Q.attributes;oe.length;)Q.removeAttributeNode(oe[0]);hp(Q,S,w),Q[ku]=W,Q[Kg]=w}function y8(S,w,Q){for(var W in Q){var oe=Q[W];Q.hasOwnProperty(W)&&oe!=null&&qc(S,w,W,null,Hfo,oe)}Q.dangerouslySetInnerHTML!=null&&(S.textContent=""),S.onclick===fd&&(S.onclick=null),Ut(S)}function gC(S){for(var w=S.attributes;w.length;)S.removeAttributeNode(w[0]);Ut(S)}function aI(S){if(typeof S.getRootNode==="function"){var w=S.getRootNode();if(w.nodeType===9||w.nodeType===11)return w}return S.nodeType===9?S:S.ownerDocument}function LD(S,w,Q){var W=UW;if(W&&typeof w==="string"&&w){var oe=qn(w);oe='link[rel="'+S+'"][href="'+oe+'"]',typeof Q==="string"&&(oe+='[crossorigin="'+Q+'"]'),$2t.has(oe)||($2t.add(oe),S={rel:S,crossOrigin:Q,href:w},W.querySelector(oe)===null&&(w=W.createElement("link"),hp(w,"link",S),ln(w),W.head.appendChild(w)))}}function x8(S,w,Q,W){var oe=(oe=Xg.current)?aI(oe):null;if(!oe)throw Error('"resourceRoot" was expected to exist. This is a bug in React.');switch(S){case"meta":case"title":return null;case"style":return typeof Q.precedence==="string"&&typeof Q.href==="string"?(Q=z0(Q.href),w=Qn(oe).hoistableStyles,W=w.get(Q),W||(W={type:"style",instance:null,count:0,state:null},w.set(Q,W)),W):{type:"void",instance:null,count:0,state:null};case"link":if(Q.rel==="stylesheet"&&typeof Q.href==="string"&&typeof Q.precedence==="string"){S=z0(Q.href);var ae=Qn(oe).hoistableStyles,De=ae.get(S);if(De||(oe=oe.ownerDocument||oe,De={type:"stylesheet",instance:null,count:0,state:{loading:wF,preload:null}},ae.set(S,De),(ae=oe.querySelector(qd(S)))?ae._p||(De.instance=ae,De.state.loading=Yoe|RC):(ae=QC.get(S),ae||(ae={rel:"preload",as:"style",href:Q.href,crossOrigin:Q.crossOrigin,integrity:Q.integrity,media:Q.media,hrefLang:Q.hrefLang,referrerPolicy:Q.referrerPolicy},QC.set(S,ae)),HD(oe,S,ae,De.state))),w&&W===null)throw Q=`

  - `+Nu(w)+`
  + `+Nu(Q),Error("Expected <link> not to update to be updated to a stylesheet with precedence. Check the `rel`, `href`, and `precedence` props of this component. Alternatively, check whether two different <link> components render in the same slot or share the same key."+Q);return De}if(w&&W!==null)throw Q=`

  - `+Nu(w)+`
  + `+Nu(Q),Error("Expected stylesheet with precedence to not be updated to a different kind of <link>. Check the `rel`, `href`, and `precedence` props of this component. Alternatively, check whether two different <link> components render in the same slot or share the same key."+Q);return null;case"script":return w=Q.async,Q=Q.src,typeof Q==="string"&&w&&typeof w!=="function"&&typeof w!=="symbol"?(Q=G(Q),w=Qn(oe).hoistableScripts,W=w.get(Q),W||(W={type:"script",instance:null,count:0,state:null},w.set(Q,W)),W):{type:"void",instance:null,count:0,state:null};default:throw Error('getResource encountered a type it did not expect: "'+S+'". this is a bug in React.')}}function Nu(S){var w=0,Q="<link";return typeof S.rel==="string"?(w++,Q+=' rel="'+S.rel+'"'):_2.call(S,"rel")&&(w++,Q+=' rel="'+(S.rel===null?"null":"invalid type "+typeof S.rel)+'"'),typeof S.href==="string"?(w++,Q+=' href="'+S.href+'"'):_2.call(S,"href")&&(w++,Q+=' href="'+(S.href===null?"null":"invalid type "+typeof S.href)+'"'),typeof S.precedence==="string"?(w++,Q+=' precedence="'+S.precedence+'"'):_2.call(S,"precedence")&&(w++,Q+=" precedence={"+(S.precedence===null?"null":"invalid type "+typeof S.precedence)+"}"),Object.getOwnPropertyNames(S).length>w&&(Q+=" ..."),Q+" />"}function z0(S){return'href="'+qn(S)+'"'}function qd(S){return'link[rel="stylesheet"]['+S+"]"}function cI(S){return ta({},S,{"data-precedence":S.precedence,precedence:null})}function HD(S,w,Q,W){if(w=S.querySelector('link[rel="preload"][as="style"]['+w+"]")){if(w[gI]!==!0){W.loading=Yoe;return}}else w=S.createElement("link"),w[gI]=!0,w.onload=w.onerror=hn.bind(null,w),hp(w,"link",Q),ln(w),S.head.appendChild(w);W.preload=w,w.addEventListener("load",function(){return W.loading|=Yoe}),w.addEventListener("error",function(){return W.loading|=j2t})}function G(S){return'[src="'+qn(S)+'"]'}function le(S){return"script[async]"+S}function fe(S,w,Q){if(w.count++,w.instance===null)switch(w.type){case"style":var W=S.querySelector('style[data-href~="'+qn(Q.href)+'"]');if(W)return w.instance=W,ln(W),W;var oe=ta({},Q,{"data-href":Q.href,"data-precedence":Q.precedence,href:null,precedence:null});return W=(S.ownerDocument||S).createElement("style"),ln(W),hp(W,"style",oe),ze(W,Q.precedence,S),w.instance=W;case"stylesheet":oe=z0(Q.href);var ae=S.querySelector(qd(oe));if(ae)return w.state.loading|=RC,w.instance=ae,ln(ae),ae;W=cI(Q),(oe=QC.get(oe))&&et(W,oe),ae=(S.ownerDocument||S).createElement("link"),ln(ae);var De=ae;return De._p=new Promise(function(ke,ot){De.onload=ke,De.onerror=ot}),hp(ae,"link",W),w.state.loading|=RC,ze(ae,Q.precedence,S),w.instance=ae;case"script":if(ae=G(Q.src),oe=S.querySelector(le(ae)))return w.instance=oe,ln(oe),oe;if(W=Q,oe=QC.get(ae))W=ta({},Q),yt(W,oe);return S=S.ownerDocument||S,oe=S.createElement("script"),ln(oe),hp(oe,"link",W),S.head.appendChild(oe),w.instance=oe;case"void":return null;default:throw Error('acquireResource encountered a resource type it did not expect: "'+w.type+'". this is a bug in React.')}else w.type==="stylesheet"&&(w.state.loading&RC)===wF&&(W=w.instance,w.state.loading|=RC,ze(W,Q.precedence,S));return w.instance}function ze(S,w,Q){for(var W=Q.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),oe=W.length?W[W.length-1]:null,ae=oe,De=0;De<W.length;De++){var ke=W[De];if(ke.dataset.precedence===w)ae=ke;else if(ae!==oe)break}ae?ae.parentNode.insertBefore(S,ae.nextSibling):(w=Q.nodeType===9?Q.head:Q,w.insertBefore(S,w.firstChild))}function et(S,w){S.crossOrigin==null&&(S.crossOrigin=w.crossOrigin),S.referrerPolicy==null&&(S.referrerPolicy=w.referrerPolicy),S.title==null&&(S.title=w.title)}function yt(S,w){S.crossOrigin==null&&(S.crossOrigin=w.crossOrigin),S.referrerPolicy==null&&(S.referrerPolicy=w.referrerPolicy),S.integrity==null&&(S.integrity=w.integrity)}function Mt(S,w,Q){if(Dge===null){var W=new Map,oe=Dge=new Map;oe.set(Q,W)}else oe=Dge,W=oe.get(Q),W||(W=new Map,oe.set(Q,W));if(W.has(S))return W;W.set(S,null),Q=Q.getElementsByTagName(S);for(oe=0;oe<Q.length;oe++){var ae=Q[oe];if(!(ae[ix]||ae[ku]||S==="link"&&ae.getAttribute("rel")==="stylesheet")&&ae.namespaceURI!==Te){var De=ae.getAttribute(w)||"";De=S+De;var ke=W.get(De);ke?ke.push(ae):W.set(De,[ae])}}return W}function Rt(S,w,Q){S=S.ownerDocument||S,S.head.insertBefore(Q,w==="title"?S.querySelector("head > title"):null)}function Wt(S,w,Q){var W=!Q.ancestorInfo.containerTagInScope;if(Q.context===GW||w.itemProp!=null)return!W||w.itemProp==null||S!=="meta"&&S!=="title"&&S!=="style"&&S!=="link"&&S!=="script"||console.error("Cannot render a <%s> outside the main document if it has an `itemProp` prop. `itemProp` suggests the tag belongs to an `itemScope` which can appear anywhere in the DOM. If you were intending for React to hoist this <%s> remove the `itemProp` prop. Otherwise, try moving this tag into the <head> or <body> of the Document.",S,S),!1;switch(S){case"meta":case"title":return!0;case"style":if(typeof w.precedence!=="string"||typeof w.href!=="string"||w.href===""){W&&console.error('Cannot render a <style> outside the main document without knowing its precedence and a unique href key. React can hoist and deduplicate <style> tags if you provide a `precedence` prop along with an `href` prop that does not conflict with the `href` values used in any other hoisted <style> or <link rel="stylesheet" ...> tags.  Note that hoisting <style> tags is considered an advanced feature that most will not use directly. Consider moving the <style> tag to the <head> or consider adding a `precedence="default"` and `href="some unique resource identifier"`.');break}return!0;case"link":if(typeof w.rel!=="string"||typeof w.href!=="string"||w.href===""||w.onLoad||w.onError){if(w.rel==="stylesheet"&&typeof w.precedence==="string"){S=w.href;var oe=w.onError,ae=w.disabled;Q=[],w.onLoad&&Q.push("`onLoad`"),oe&&Q.push("`onError`"),ae!=null&&Q.push("`disabled`"),oe=Fne(Q,"and"),oe+=Q.length===1?" prop":" props",ae=Q.length===1?"an "+oe:"the "+oe,Q.length&&console.error('React encountered a <link rel="stylesheet" href="%s" ... /> with a `precedence` prop that also included %s. The presence of loading and error handlers indicates an intent to manage the stylesheet loading state from your from your Component code and React will not hoist or deduplicate this stylesheet. If your intent was to have React hoist and deduplciate this stylesheet using the `precedence` prop remove the %s, otherwise remove the `precedence` prop.',S,ae,oe)}W&&(typeof w.rel!=="string"||typeof w.href!=="string"||w.href===""?console.error("Cannot render a <link> outside the main document without a `rel` and `href` prop. Try adding a `rel` and/or `href` prop to this <link> or moving the link into the <head> tag"):(w.onError||w.onLoad)&&console.error("Cannot render a <link> with onLoad or onError listeners outside the main document. Try removing onLoad={...} and onError={...} or moving it into the root <head> tag or somewhere in the <body>."));break}switch(w.rel){case"stylesheet":return S=w.precedence,w=w.disabled,typeof S!=="string"&&W&&console.error('Cannot render a <link rel="stylesheet" /> outside the main document without knowing its precedence. Consider adding precedence="default" or moving it into the root <head> tag.'),typeof S==="string"&&w==null;default:return!0}case"script":if(S=w.async&&typeof w.async!=="function"&&typeof w.async!=="symbol",!S||w.onLoad||w.onError||!w.src||typeof w.src!=="string"){W&&(S?w.onLoad||w.onError?console.error("Cannot render a <script> with onLoad or onError listeners outside the main document. Try removing onLoad={...} and onError={...} or moving it into the root <head> tag or somewhere in the <body>."):console.error("Cannot render a <script> outside the main document without `async={true}` and a non-empty `src` prop. Ensure there is a valid `src` and either make the script async or move it into the root <head> tag or somewhere in the <body>."):console.error('Cannot render a sync or defer <script> outside the main document without knowing its order. Try adding async="" or moving it into the root <head> tag.'));break}return!0;case"noscript":case"template":W&&console.error("Cannot render <%s> outside the main document. Try moving it into the root <head> tag.",S)}return!1}function Rn(S,w){return S==="img"&&w.src!=null&&w.src!==""&&w.onLoad==null&&w.loading!=="lazy"}function no(S){return S.type==="stylesheet"&&(S.state.loading&K2t)===wF?!1:!0}function xo(S){return(S.width||100)*(S.height||100)*(typeof devicePixelRatio==="number"?devicePixelRatio:1)*0.25}function qo(S,w){typeof w.decode==="function"&&(S.imgCount++,w.complete||(S.imgBytes+=xo(w),S.suspenseyImages.push(w)),S=Cr.bind(S),w.decode().then(S,S))}function Br(S,w,Q,W){if(Q.type==="stylesheet"&&(typeof W.media!=="string"||matchMedia(W.media).matches!==!1)&&(Q.state.loading&RC)===wF){if(Q.instance===null){var oe=z0(W.href),ae=w.querySelector(qd(oe));if(ae){w=ae._p,w!==null&&typeof w==="object"&&typeof w.then==="function"&&(S.count++,S=kr.bind(S),w.then(S,S)),Q.state.loading|=RC,Q.instance=ae,ln(ae);return}ae=w.ownerDocument||w,W=cI(W),(oe=QC.get(oe))&&et(W,oe),ae=ae.createElement("link"),ln(ae);var De=ae;De._p=new Promise(function(ke,ot){De.onload=ke,De.onerror=ot}),hp(ae,"link",W),Q.instance=ae}S.stylesheets===null&&(S.stylesheets=new Map),S.stylesheets.set(Q,w),(w=Q.state.preload)&&(Q.state.loading&K2t)===wF&&(S.count++,Q=kr.bind(S),w.addEventListener("load",Q),w.addEventListener("error",Q))}}function Hi(S,w){return S.stylesheets&&S.count===0&&Io(S,S.stylesheets),0<S.count||0<S.imgCount?function(Q){var W=setTimeout(function(){if(S.stylesheets&&Io(S,S.stylesheets),S.unsuspend){var ae=S.unsuspend;S.unsuspend=null,ae()}},Xfo+w);0<S.imgBytes&&Nge===0&&(Nge=125*zne()*Kfo);var oe=setTimeout(function(){if(S.waitingForImages=!1,S.count===0&&(S.stylesheets&&Io(S,S.stylesheets),S.unsuspend)){var ae=S.unsuspend;S.unsuspend=null,ae()}},(S.imgBytes>Nge?50:jfo)+w);return S.unsuspend=Q,function(){S.unsuspend=null,clearTimeout(W),clearTimeout(oe)}}:null}function ri(S){if(S.count===0&&(S.imgCount===0||!S.waitingForImages)){if(S.stylesheets)Io(S,S.stylesheets);else if(S.unsuspend){var w=S.unsuspend;S.unsuspend=null,w()}}}function kr(){this.count--,ri(this)}function Cr(){this.imgCount--,ri(this)}function Io(S,w){S.stylesheets=null,S.unsuspend!==null&&(S.count++,Rge=new Map,w.forEach(No,S),Rge=null,kr.call(S))}function No(S,w){if(!(w.state.loading&RC)){var Q=Rge.get(S);if(Q)var W=Q.get(PDe);else{Q=new Map,Rge.set(S,Q);for(var oe=S.querySelectorAll("link[data-precedence],style[data-precedence]"),ae=0;ae<oe.length;ae++){var De=oe[ae];if(De.nodeName==="LINK"||De.getAttribute("media")!=="not all")Q.set(De.dataset.precedence,De),W=De}W&&Q.set(PDe,W)}oe=w.instance,De=oe.getAttribute("data-precedence"),ae=Q.get(De)||W,ae===W&&Q.set(PDe,oe),Q.set(De,oe),this.count++,W=kr.bind(this),oe.addEventListener("load",W),oe.addEventListener("error",W),ae?ae.parentNode.insertBefore(oe,ae.nextSibling):(S=S.nodeType===9?S.head:S,S.insertBefore(oe,S.firstChild)),w.state.loading|=RC}}function Ss(S,w,Q,W,oe,ae,De,ke,ot){this.tag=1,this.containerInfo=S,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=MF,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Fe(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Fe(0),this.hiddenUpdates=Fe(null),this.identifierPrefix=W,this.onUncaughtError=oe,this.onCaughtError=ae,this.onRecoverableError=De,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=ot,this.transitionTypes=null,this.incompleteTransitions=new Map,this.passiveEffectDuration=this.effectDuration=-0,this.memoizedUpdaters=new Set,S=this.pendingUpdatersLaneMap=[];for(w=0;31>w;w++)S.push(new Set);this._debugRootType=Q?"hydrateRoot()":"createRoot()"}function Ul(S,w,Q,W,oe,ae,De,ke,ot,_t,zt,en){return S=new Ss(S,w,Q,De,ot,_t,zt,en,ke),w=yfo,ae===!0&&(w|=A2|yI),w|=Sa,ae=u(3,null,null,w),S.current=ae,ae.stateNode=S,w=Wy(),L5(w),S.pooledCache=w,L5(w),ae.memoizedState={element:W,isDehydrated:Q,cache:w},Tv(ae),S}function dp(S){if(!S)return ZD;return S=ZD,S}function AC(S,w,Q,W,oe,ae){if(ph&&typeof ph.onScheduleFiberRoot==="function")try{ph.onScheduleFiberRoot(T8,W,Q)}catch(De){jg||(jg=!0,console.error("React instrumentation encountered an error: %o",De))}oe=dp(oe),W.context===null?W.context=oe:W.pendingContext=oe,i4&&K_!==null&&!e1t&&(e1t=!0,console.error(`Render methods should be a pure function of props and state; triggering nested component updates from render is not allowed. If necessary, trigger nested updates in componentDidUpdate.

Check the render method of %s.`,Y(K_)||"Unknown")),W=Fc(w),W.payload={element:Q},ae=ae===void 0?null:ae,ae!==null&&(typeof ae!=="function"&&console.error("Expected the last optional `callback` argument to be a function. Instead received: %s.",ae),W.callback=ae),Q=V3(S,W,w),Q!==null&&(ZA(w,"root.render()",null),Id(Q,S,w),dE(Q,S,w))}function X_(S,w){if(S=S.memoizedState,S!==null&&S.dehydrated!==null){var Q=S.retryLane;S.retryLane=Q!==0&&Q<w?Q:w}}function B1(S,w){X_(S,w),(S=S.alternate)&&X_(S,w)}function Zp(S){if(S.tag===13||S.tag===31){var w=Nn(S,67108864);w!==null&&Id(w,S,67108864),B1(S,67108864)}}function T1(S){if(S.tag===13||S.tag===31){var w=Xp(S);w=Ye(w);var Q=Nn(S,w);Q!==null&&Id(Q,S,w),B1(S,w)}}function fC(){return K_}function yC(S,w,Q,W){var oe=Vn.T;Vn.T=null;var ae=Dc.p;try{Dc.p=om,xC(S,w,Q,W)}finally{Dc.p=ae,Vn.T=oe}}function dh(S,w,Q,W){var oe=Vn.T;Vn.T=null;var ae=Dc.p;try{Dc.p=Ym,xC(S,w,Q,W)}finally{Dc.p=ae,Vn.T=oe}}function xC(S,w,Q,W){if(XW){var oe=lI(W);if(oe===null)q6(S,w,W,kge,Q),FD(S,W);else if(iW(oe,S,w,Q,W))W.stopPropagation();else if(FD(S,W),w&4&&-1<qfo.indexOf(S)){for(;oe!==null;){var ae=_n(oe);if(ae!==null)switch(ae.tag){case 3:if(ae=ae.stateNode,ae.current.memoizedState.isDehydrated){var De=Lt(ae.pendingLanes);if(De!==0){var ke=ae;ke.pendingLanes|=2;for(ke.entangledLanes|=2;De;){var ot=1<<31-Wl(De);ke.entanglements[1]|=ot,De&=~ot}h2(ae),(Vc&(q_|h4))===tA&&(gge=Ki()+w2t,o8(0,!1))}}break;case 31:case 13:ke=Nn(ae,2),ke!==null&&Id(ke,ae,2),W6(),B1(ae,2)}if(ae=lI(W),ae===null&&q6(S,w,W,kge,Q),ae===oe)break;oe=ae}oe!==null&&W.stopPropagation()}else q6(S,w,W,null,Q)}}function lI(S){return S=Rg(S),VE(S)}function VE(S){if(kge=null,S=mn(S),S!==null){var w=g(S);if(w===null)S=null;else{var Q=w.tag;if(Q===13){if(S=f(w),S!==null)return S;S=null}else if(Q===31){if(S=y(w),S!==null)return S;S=null}else if(Q===3){if(w.stateNode.current.memoizedState.isDehydrated)return w.tag===3?w.stateNode.containerInfo:null;S=null}else w!==S&&(S=null)}}return kge=S,null}function hI(S){switch(S){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"fullscreenerror":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return om;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"resize":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return Ym;case"message":switch(N1()){case IC:return om;case E8:return Ym;case M8:case vC:return SC;case Jd:return dW;default:return SC}default:return SC}}function FD(S,w){switch(S){case"focusin":case"focusout":mN=null;break;case"dragenter":case"dragleave":_N=null;break;case"mouseover":case"mouseout":gN=null;break;case"pointerover":case"pointerout":Goe.delete(w.pointerId);break;case"gotpointercapture":case"lostpointercapture":Uoe.delete(w.pointerId)}}function dI(S,w,Q,W,oe,ae){if(S===null||S.nativeEvent!==ae)return S={blockedOn:w,domEventName:Q,eventSystemFlags:W,nativeEvent:ae,targetContainers:[oe]},w!==null&&(w=_n(w),w!==null&&Zp(w)),S;return S.eventSystemFlags|=W,w=S.targetContainers,oe!==null&&w.indexOf(oe)===-1&&w.push(oe),S}function iW(S,w,Q,W,oe){switch(w){case"focusin":return mN=dI(mN,S,w,Q,W,oe),!0;case"dragenter":return _N=dI(_N,S,w,Q,W,oe),!0;case"mouseover":return gN=dI(gN,S,w,Q,W,oe),!0;case"pointerover":var ae=oe.pointerId;return Goe.set(ae,dI(Goe.get(ae)||null,S,w,Q,W,oe)),!0;case"gotpointercapture":return ae=oe.pointerId,Uoe.set(ae,dI(Uoe.get(ae)||null,S,w,Q,W,oe)),!0}return!1}function zD(S){var w=mn(S.target);if(w!==null){var Q=g(w);if(Q!==null){if(w=Q.tag,w===13){if(w=f(Q),w!==null){S.blockedOn=w,Ot(S.priority,function(){T1(Q)});return}}else if(w===31){if(w=y(Q),w!==null){S.blockedOn=w,Ot(S.priority,function(){T1(Q)});return}}else if(w===3&&Q.stateNode.current.memoizedState.isDehydrated){S.blockedOn=Q.tag===3?Q.stateNode.containerInfo:null;return}}}S.blockedOn=null}function j_(S){if(S.blockedOn!==null)return!1;for(var w=S.targetContainers;0<w.length;){var Q=lI(S.nativeEvent);if(Q===null){Q=S.nativeEvent;var W=new Q.constructor(Q.type,Q),oe=W;nn!==null&&console.error("Expected currently replaying event to be null. This error is likely caused by a bug in React. Please file an issue."),nn=oe,Q.target.dispatchEvent(W),nn===null&&console.error("Expected currently replaying event to not be null. This error is likely caused by a bug in React. Please file an issue."),nn=null}else return w=_n(Q),w!==null&&Zp(w),S.blockedOn=Q,!1;w.shift()}return!0}function OD(S,w,Q){j_(S)&&Q.delete(w)}function em(){EDe=!1,mN!==null&&j_(mN)&&(mN=null),_N!==null&&j_(_N)&&(_N=null),gN!==null&&j_(gN)&&(gN=null),Goe.forEach(OD),Uoe.forEach(OD)}function tm(S,w){S.blockedOn===w&&(S.blockedOn=null,EDe||(EDe=!0,el.unstable_scheduleCallback(el.unstable_NormalPriority,em)))}function CC(S){Lge!==S&&(Lge=S,el.unstable_scheduleCallback(el.unstable_NormalPriority,function(){Lge===S&&(Lge=null);for(var w=0;w<S.length;w+=3){var Q=S[w],W=S[w+1],oe=S[w+2];if(typeof W!=="function")if(VE(W||Q)===null)continue;else break;var ae=_n(Q);ae!==null&&(S.splice(w,3),w-=3,Q={pending:!0,data:oe,method:Q.method,action:W},Object.freeze(Q),oD(ae,Q,W,oe))}}))}function vd(S){function w(ot){return tm(ot,S)}mN!==null&&tm(mN,S),_N!==null&&tm(_N,S),gN!==null&&tm(gN,S),Goe.forEach(w),Uoe.forEach(w);for(var Q=0;Q<AN.length;Q++){var W=AN[Q];W.blockedOn===S&&(W.blockedOn=null)}for(;0<AN.length&&(Q=AN[0],Q.blockedOn===null);)zD(Q),Q.blockedOn===null&&AN.shift();if(Q=(S.ownerDocument||S).$$reactFormReplay,Q!=null)for(W=0;W<Q.length;W+=3){var oe=Q[W],ae=Q[W+1],De=oe[Kg]||null;if(typeof ae==="function")De||CC(Q);else if(De){var ke=null;if(ae&&ae.hasAttribute("formAction")){if(oe=ae,De=ae[Kg]||null)ke=De.formAction;else if(VE(oe)!==null)continue}else ke=De.action;typeof ke==="function"?Q[W+1]=ke:(Q.splice(W,3),W-=3),CC(Q)}}}function p2(){function S(ae){ae.canIntercept&&ae.info==="react-transition"&&ae.intercept({handler:function(){return new Promise(function(De){return oe=De})},focusReset:"manual",scroll:"manual"})}function w(){oe!==null&&(oe(),oe=null),W||setTimeout(Q,20)}function Q(){if(!W&&!navigation.transition){var ae=navigation.currentEntry;ae&&ae.url!=null&&navigation.navigate(ae.url,{state:ae.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation==="object"){var W=!1,oe=null;return navigation.addEventListener("navigate",S),navigation.addEventListener("navigatesuccess",w),navigation.addEventListener("navigateerror",w),setTimeout(Q,100),function(){W=!0,navigation.removeEventListener("navigate",S),navigation.removeEventListener("navigatesuccess",w),navigation.removeEventListener("navigateerror",w),oe!==null&&(oe(),oe=null)}}}function D1(S){this._internalRoot=S}function Al(S){this._internalRoot=S}function e4(S){S[_I]&&(S._reactRootContainer?console.error("You are calling ReactDOMClient.createRoot() on a container that was previously passed to ReactDOM.render(). This is not supported."):console.error("You are calling ReactDOMClient.createRoot() on a container that has already been passed to createRoot() before. Instead, call root.render() on the existing root instead if you want to update it."))}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart==="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var t4=null,YE=null,ta=Object.assign,VD=Symbol.for("react.element"),n4=Symbol.for("react.transitional.element"),C8=Symbol.for("react.portal"),b8=Symbol.for("react.fragment"),JH=Symbol.for("react.strict_mode"),sW=Symbol.for("react.profiler"),o4=Symbol.for("react.consumer"),fl=Symbol.for("react.context"),YD=Symbol.for("react.forward_ref"),aW=Symbol.for("react.suspense"),up=Symbol.for("react.suspense_list"),uI=Symbol.for("react.memo"),nm=Symbol.for("react.lazy"),s0=Symbol.for("react.activity"),m2=Symbol.for("react.legacy_hidden"),r4=Symbol.for("react.memo_cache_sentinel"),I8=Symbol.for("react.view_transition"),uTe=Symbol.for("react.recoverable"),ZH=Symbol.iterator,cW=Symbol.for("react.client.reference"),a0=Array.isArray,Vn=qW.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Dc=BDe.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,eF=Object.freeze({pending:!1,data:null,method:null,action:null}),GD=[],One=[],Ru=-1,Qu=X(null),Wg=X(null),Xg=X(null),v8=X(null),bC=0,lW,S8,tF,Vne,Za,uh,Ia;ie.__reactDisabledLog=!0;var va,gf,GE=!1,pI=new(typeof WeakMap==="function"?WeakMap:Map),K_=null,i4=!1,_2=Object.prototype.hasOwnProperty,P8=el.unstable_scheduleCallback,nF=el.unstable_cancelCallback,Yne=el.unstable_shouldYield,UE=el.unstable_requestPaint,Ki=el.unstable_now,N1=el.unstable_getCurrentPriorityLevel,IC=el.unstable_ImmediatePriority,E8=el.unstable_UserBlockingPriority,M8=el.unstable_NormalPriority,vC=el.unstable_LowPriority,Jd=el.unstable_IdlePriority,w8=el.log,B8=el.unstable_setDisableYieldValue,T8=null,ph=null,jg=!1,g2=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u",Wl=Math.clz32?Math.clz32:kt,{log:hW,LN2:Gne}=Math,oF=256,D8=262144,UD=4194304,om=2,Ym=8,SC=32,dW=268435456,mI=Math.random().toString(36).slice(2),ku="__reactFiber$"+mI,Kg="__reactProps$"+mI,_I="__reactContainer$"+mI,Une="__reactEvents$"+mI,pTe="__reactListeners$"+mI,Wne="__reactHandles$"+mI,Gm="__reactResources$"+mI,ix="__reactMarker$"+mI,gI="__reactLoad$"+mI,AI=new Set,fI={},rF={},T_e={button:!0,checkbox:!0,image:!0,hidden:!0,radio:!0,reset:!0,submit:!0},mTe=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),WD={},uW={},Nc=!1,pW=/[\n"\\]/g,D_e=!1,N8=!1,XD=!1,WE=!1,iF=!1,Xne=!1,jne=["value","defaultValue"],N_e=!1,R1=/["'&<>\n\t]|^\s|\s$/,jD="address applet area article aside base basefont bgsound blockquote body br button caption center col colgroup dd details dir div dl dt embed fieldset figcaption figure footer form frame frameset h1 h2 h3 h4 h5 h6 head header hgroup hr html iframe img input isindex li link listing main marquee menu menuitem meta nav noembed noframes noscript object ol p param plaintext pre script section select source style summary table tbody td template textarea tfoot th thead title tr track ul wbr xmp".split(" "),Kne="applet caption html table td th marquee object select template foreignObject desc title".split(" "),R_e=Kne.concat(["button"]),Q_e="dd dt li option optgroup p rp rt".split(" "),$ne={current:null,formTag:null,aTagInScope:null,buttonTagInScope:null,nobrTagInScope:null,pTagInButtonScope:null,listItemTagAutoclosing:null,dlItemTagAutoclosing:null,containerTagInScope:null,implicitRootScope:!1},sF={},mW={animation:"animationDelay animationDirection animationDuration animationFillMode animationIterationCount animationName animationPlayState animationTimingFunction".split(" "),background:"backgroundAttachment backgroundClip backgroundColor backgroundImage backgroundOrigin backgroundPositionX backgroundPositionY backgroundRepeat backgroundSize".split(" "),backgroundPosition:["backgroundPositionX","backgroundPositionY"],border:"borderBottomColor borderBottomStyle borderBottomWidth borderImageOutset borderImageRepeat borderImageSlice borderImageSource borderImageWidth borderLeftColor borderLeftStyle borderLeftWidth borderRightColor borderRightStyle borderRightWidth borderTopColor borderTopStyle borderTopWidth".split(" "),borderBlock:"borderBlockEndColor borderBlockEndStyle borderBlockEndWidth borderBlockStartColor borderBlockStartStyle borderBlockStartWidth".split(" "),borderBlockColor:["borderBlockEndColor","borderBlockStartColor"],borderBlockEnd:["borderBlockEndColor","borderBlockEndStyle","borderBlockEndWidth"],borderBlockStart:["borderBlockStartColor","borderBlockStartStyle","borderBlockStartWidth"],borderBlockStyle:["borderBlockEndStyle","borderBlockStartStyle"],borderBlockWidth:["borderBlockEndWidth","borderBlockStartWidth"],borderBottom:["borderBottomColor","borderBottomStyle","borderBottomWidth"],borderColor:["borderBottomColor","borderLeftColor","borderRightColor","borderTopColor"],borderImage:["borderImageOutset","borderImageRepeat","borderImageSlice","borderImageSource","borderImageWidth"],borderInline:"borderInlineEndColor borderInlineEndStyle borderInlineEndWidth borderInlineStartColor borderInlineStartStyle borderInlineStartWidth".split(" "),borderInlineColor:["borderInlineEndColor","borderInlineStartColor"],borderInlineEnd:["borderInlineEndColor","borderInlineEndStyle","borderInlineEndWidth"],borderInlineStart:["borderInlineStartColor","borderInlineStartStyle","borderInlineStartWidth"],borderInlineStyle:["borderInlineEndStyle","borderInlineStartStyle"],borderInlineWidth:["borderInlineEndWidth","borderInlineStartWidth"],borderLeft:["borderLeftColor","borderLeftStyle","borderLeftWidth"],borderRadius:["borderBottomLeftRadius","borderBottomRightRadius","borderTopLeftRadius","borderTopRightRadius"],borderRight:["borderRightColor","borderRightStyle","borderRightWidth"],borderStyle:["borderBottomStyle","borderLeftStyle","borderRightStyle","borderTopStyle"],borderTop:["borderTopColor","borderTopStyle","borderTopWidth"],borderWidth:["borderBottomWidth","borderLeftWidth","borderRightWidth","borderTopWidth"],colorAdjust:["printColorAdjust"],columnRule:["columnRuleColor","columnRuleStyle","columnRuleWidth"],columns:["columnCount","columnWidth"],containIntrinsicSize:["containIntrinsicHeight","containIntrinsicWidth"],container:["containerName","containerType"],flex:["flexBasis","flexGrow","flexShrink"],flexFlow:["flexDirection","flexWrap"],font:"fontFamily fontFeatureSettings fontKerning fontLanguageOverride fontSize fontSizeAdjust fontStretch fontStyle fontVariant fontVariantAlternates fontVariantCaps fontVariantEastAsian fontVariantLigatures fontVariantNumeric fontVariantPosition fontWeight lineHeight".split(" "),fontSynthesis:["fontSynthesisPosition","fontSynthesisSmallCaps","fontSynthesisStyle","fontSynthesisWeight"],fontVariant:"fontVariantAlternates fontVariantCaps fontVariantEastAsian fontVariantLigatures fontVariantNumeric fontVariantPosition".split(" "),gap:["columnGap","rowGap"],grid:"gridAutoColumns gridAutoFlow gridAutoRows gridTemplateAreas gridTemplateColumns gridTemplateRows".split(" "),gridArea:["gridColumnEnd","gridColumnStart","gridRowEnd","gridRowStart"],gridColumn:["gridColumnEnd","gridColumnStart"],gridColumnGap:["columnGap"],gridGap:["columnGap","rowGap"],gridRow:["gridRowEnd","gridRowStart"],gridRowGap:["rowGap"],gridTemplate:["gridTemplateAreas","gridTemplateColumns","gridTemplateRows"],inset:["bottom","left","right","top"],insetBlock:["insetBlockEnd","insetBlockStart"],insetInline:["insetInlineEnd","insetInlineStart"],listStyle:["listStyleImage","listStylePosition","listStyleType"],margin:["marginBottom","marginLeft","marginRight","marginTop"],marginBlock:["marginBlockEnd","marginBlockStart"],marginInline:["marginInlineEnd","marginInlineStart"],marker:["markerEnd","markerMid","markerStart"],mask:"maskClip maskComposite maskImage maskMode maskOrigin maskPositionX maskPositionY maskRepeat maskSize".split(" "),maskPosition:["maskPositionX","maskPositionY"],offset:["offsetAnchor","offsetDistance","offsetPath","offsetPosition","offsetRotate"],outline:["outlineColor","outlineStyle","outlineWidth"],overflow:["overflowX","overflowY"],overscrollBehavior:["overscrollBehaviorX","overscrollBehaviorY"],padding:["paddingBottom","paddingLeft","paddingRight","paddingTop"],paddingBlock:["paddingBlockEnd","paddingBlockStart"],paddingInline:["paddingInlineEnd","paddingInlineStart"],pageBreakAfter:["breakAfter"],pageBreakBefore:["breakBefore"],pageBreakInside:["breakInside"],placeContent:["alignContent","justifyContent"],placeItems:["alignItems","justifyItems"],placeSelf:["alignSelf","justifySelf"],scrollMargin:["scrollMarginBottom","scrollMarginLeft","scrollMarginRight","scrollMarginTop"],scrollMarginBlock:["scrollMarginBlockEnd","scrollMarginBlockStart"],scrollMarginInline:["scrollMarginInlineEnd","scrollMarginInlineStart"],scrollPadding:["scrollPaddingBottom","scrollPaddingLeft","scrollPaddingRight","scrollPaddingTop"],scrollPaddingBlock:["scrollPaddingBlockEnd","scrollPaddingBlockStart"],scrollPaddingInline:["scrollPaddingInlineEnd","scrollPaddingInlineStart"],textDecoration:["textDecorationColor","textDecorationLine","textDecorationStyle","textDecorationThickness"],textEmphasis:["textEmphasisColor","textEmphasisStyle"],textWrap:["textWrapMode","textWrapStyle"],transition:["transitionBehavior","transitionDelay","transitionDuration","transitionProperty","transitionTimingFunction"],verticalAlign:["alignmentBaseline","baselineShift","baselineSource"],whiteSpace:["textWrapMode","whiteSpaceCollapse"],wordWrap:["overflowWrap"]},qne=/([A-Z])/g,Jne=/^ms-/,k_e=/^(?:webkit|moz|o)[A-Z]/,L_e=/^-ms-/,H_e=/-(.)/g,Zne=/;\s*$/,XE={},R={},z=!1,q=!1,pe=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" ")),Ce="http://www.w3.org/1998/Math/MathML",Te="http://www.w3.org/2000/svg",ht=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["maskType","mask-type"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),Et={accept:"accept",acceptcharset:"acceptCharset","accept-charset":"acceptCharset",accesskey:"accessKey",action:"action",allowfullscreen:"allowFullScreen",alt:"alt",as:"as",async:"async",autocapitalize:"autoCapitalize",autocomplete:"autoComplete",autocorrect:"autoCorrect",autofocus:"autoFocus",autoplay:"autoPlay",autosave:"autoSave",capture:"capture",cellpadding:"cellPadding",cellspacing:"cellSpacing",challenge:"challenge",charset:"charSet",checked:"checked",children:"children",cite:"cite",class:"className",classid:"classID",classname:"className",cols:"cols",colspan:"colSpan",content:"content",contenteditable:"contentEditable",contextmenu:"contextMenu",controls:"controls",controlslist:"controlsList",coords:"coords",credentialless:"credentialless",crossorigin:"crossOrigin",dangerouslysetinnerhtml:"dangerouslySetInnerHTML",data:"data",datetime:"dateTime",default:"default",defaultchecked:"defaultChecked",defaultvalue:"defaultValue",defer:"defer",dir:"dir",disabled:"disabled",disablepictureinpicture:"disablePictureInPicture",disableremoteplayback:"disableRemotePlayback",download:"download",draggable:"draggable",enctype:"encType",enterkeyhint:"enterKeyHint",fetchpriority:"fetchPriority",for:"htmlFor",form:"form",formmethod:"formMethod",formaction:"formAction",formenctype:"formEncType",formnovalidate:"formNoValidate",formtarget:"formTarget",frameborder:"frameBorder",headers:"headers",height:"height",hidden:"hidden",high:"high",href:"href",hreflang:"hrefLang",htmlfor:"htmlFor",httpequiv:"httpEquiv","http-equiv":"httpEquiv",icon:"icon",id:"id",imagesizes:"imageSizes",imagesrcset:"imageSrcSet",inert:"inert",innerhtml:"innerHTML",inputmode:"inputMode",integrity:"integrity",is:"is",itemid:"itemID",itemprop:"itemProp",itemref:"itemRef",itemscope:"itemScope",itemtype:"itemType",keyparams:"keyParams",keytype:"keyType",kind:"kind",label:"label",lang:"lang",list:"list",loop:"loop",low:"low",manifest:"manifest",marginwidth:"marginWidth",marginheight:"marginHeight",max:"max",maxlength:"maxLength",media:"media",mediagroup:"mediaGroup",method:"method",min:"min",minlength:"minLength",multiple:"multiple",muted:"muted",name:"name",nomodule:"noModule",nonce:"nonce",novalidate:"noValidate",open:"open",optimum:"optimum",pattern:"pattern",placeholder:"placeholder",playsinline:"playsInline",poster:"poster",preload:"preload",profile:"profile",radiogroup:"radioGroup",readonly:"readOnly",referrerpolicy:"referrerPolicy",rel:"rel",required:"required",reversed:"reversed",role:"role",rows:"rows",rowspan:"rowSpan",sandbox:"sandbox",scope:"scope",scoped:"scoped",scrolling:"scrolling",seamless:"seamless",selected:"selected",shape:"shape",size:"size",sizes:"sizes",span:"span",spellcheck:"spellCheck",src:"src",srcdoc:"srcDoc",srclang:"srcLang",srcset:"srcSet",start:"start",step:"step",style:"style",summary:"summary",tabindex:"tabIndex",target:"target",title:"title",type:"type",usemap:"useMap",value:"value",width:"width",wmode:"wmode",wrap:"wrap",about:"about",accentheight:"accentHeight","accent-height":"accentHeight",accumulate:"accumulate",additive:"additive",alignmentbaseline:"alignmentBaseline","alignment-baseline":"alignmentBaseline",allowreorder:"allowReorder",alphabetic:"alphabetic",amplitude:"amplitude",arabicform:"arabicForm","arabic-form":"arabicForm",ascent:"ascent",attributename:"attributeName",attributetype:"attributeType",autoreverse:"autoReverse",azimuth:"azimuth",basefrequency:"baseFrequency",baselineshift:"baselineShift","baseline-shift":"baselineShift",baseprofile:"baseProfile",bbox:"bbox",begin:"begin",bias:"bias",by:"by",calcmode:"calcMode",capheight:"capHeight","cap-height":"capHeight",clip:"clip",clippath:"clipPath","clip-path":"clipPath",clippathunits:"clipPathUnits",cliprule:"clipRule","clip-rule":"clipRule",color:"color",colorinterpolation:"colorInterpolation","color-interpolation":"colorInterpolation",colorinterpolationfilters:"colorInterpolationFilters","color-interpolation-filters":"colorInterpolationFilters",colorprofile:"colorProfile","color-profile":"colorProfile",colorrendering:"colorRendering","color-rendering":"colorRendering",contentscripttype:"contentScriptType",contentstyletype:"contentStyleType",cursor:"cursor",cx:"cx",cy:"cy",d:"d",datatype:"datatype",decelerate:"decelerate",descent:"descent",diffuseconstant:"diffuseConstant",direction:"direction",display:"display",divisor:"divisor",dominantbaseline:"dominantBaseline","dominant-baseline":"dominantBaseline",dur:"dur",dx:"dx",dy:"dy",edgemode:"edgeMode",elevation:"elevation",enablebackground:"enableBackground","enable-background":"enableBackground",end:"end",exponent:"exponent",externalresourcesrequired:"externalResourcesRequired",fill:"fill",fillopacity:"fillOpacity","fill-opacity":"fillOpacity",fillrule:"fillRule","fill-rule":"fillRule",filter:"filter",filterres:"filterRes",filterunits:"filterUnits",floodopacity:"floodOpacity","flood-opacity":"floodOpacity",floodcolor:"floodColor","flood-color":"floodColor",focusable:"focusable",fontfamily:"fontFamily","font-family":"fontFamily",fontsize:"fontSize","font-size":"fontSize",fontsizeadjust:"fontSizeAdjust","font-size-adjust":"fontSizeAdjust",fontstretch:"fontStretch","font-stretch":"fontStretch",fontstyle:"fontStyle","font-style":"fontStyle",fontvariant:"fontVariant","font-variant":"fontVariant",fontweight:"fontWeight","font-weight":"fontWeight",format:"format",from:"from",fx:"fx",fy:"fy",g1:"g1",g2:"g2",glyphname:"glyphName","glyph-name":"glyphName",glyphorientationhorizontal:"glyphOrientationHorizontal","glyph-orientation-horizontal":"glyphOrientationHorizontal",glyphorientationvertical:"glyphOrientationVertical","glyph-orientation-vertical":"glyphOrientationVertical",glyphref:"glyphRef",gradienttransform:"gradientTransform",gradientunits:"gradientUnits",hanging:"hanging",horizadvx:"horizAdvX","horiz-adv-x":"horizAdvX",horizoriginx:"horizOriginX","horiz-origin-x":"horizOriginX",ideographic:"ideographic",imagerendering:"imageRendering","image-rendering":"imageRendering",in2:"in2",in:"in",inlist:"inlist",intercept:"intercept",k1:"k1",k2:"k2",k3:"k3",k4:"k4",k:"k",kernelmatrix:"kernelMatrix",kernelunitlength:"kernelUnitLength",kerning:"kerning",keypoints:"keyPoints",keysplines:"keySplines",keytimes:"keyTimes",lengthadjust:"lengthAdjust",letterspacing:"letterSpacing","letter-spacing":"letterSpacing",lightingcolor:"lightingColor","lighting-color":"lightingColor",limitingconeangle:"limitingConeAngle",local:"local",markerend:"markerEnd","marker-end":"markerEnd",markerheight:"markerHeight",markermid:"markerMid","marker-mid":"markerMid",markerstart:"markerStart","marker-start":"markerStart",markerunits:"markerUnits",markerwidth:"markerWidth",mask:"mask",maskcontentunits:"maskContentUnits",masktype:"maskType",maskunits:"maskUnits",mathematical:"mathematical",mode:"mode",numoctaves:"numOctaves",offset:"offset",opacity:"opacity",operator:"operator",order:"order",orient:"orient",orientation:"orientation",origin:"origin",overflow:"overflow",overlineposition:"overlinePosition","overline-position":"overlinePosition",overlinethickness:"overlineThickness","overline-thickness":"overlineThickness",paintorder:"paintOrder","paint-order":"paintOrder",panose1:"panose1","panose-1":"panose1",pathlength:"pathLength",patterncontentunits:"patternContentUnits",patterntransform:"patternTransform",patternunits:"patternUnits",pointerevents:"pointerEvents","pointer-events":"pointerEvents",points:"points",pointsatx:"pointsAtX",pointsaty:"pointsAtY",pointsatz:"pointsAtZ",popover:"popover",popovertarget:"popoverTarget",popovertargetaction:"popoverTargetAction",prefix:"prefix",preservealpha:"preserveAlpha",preserveaspectratio:"preserveAspectRatio",primitiveunits:"primitiveUnits",property:"property",r:"r",radius:"radius",refx:"refX",refy:"refY",renderingintent:"renderingIntent","rendering-intent":"renderingIntent",repeatcount:"repeatCount",repeatdur:"repeatDur",requiredextensions:"requiredExtensions",requiredfeatures:"requiredFeatures",resource:"resource",restart:"restart",result:"result",results:"results",rotate:"rotate",rx:"rx",ry:"ry",scale:"scale",security:"security",seed:"seed",shaperendering:"shapeRendering","shape-rendering":"shapeRendering",slope:"slope",spacing:"spacing",specularconstant:"specularConstant",specularexponent:"specularExponent",speed:"speed",spreadmethod:"spreadMethod",startoffset:"startOffset",stddeviation:"stdDeviation",stemh:"stemh",stemv:"stemv",stitchtiles:"stitchTiles",stopcolor:"stopColor","stop-color":"stopColor",stopopacity:"stopOpacity","stop-opacity":"stopOpacity",strikethroughposition:"strikethroughPosition","strikethrough-position":"strikethroughPosition",strikethroughthickness:"strikethroughThickness","strikethrough-thickness":"strikethroughThickness",string:"string",stroke:"stroke",strokedasharray:"strokeDasharray","stroke-dasharray":"strokeDasharray",strokedashoffset:"strokeDashoffset","stroke-dashoffset":"strokeDashoffset",strokelinecap:"strokeLinecap","stroke-linecap":"strokeLinecap",strokelinejoin:"strokeLinejoin","stroke-linejoin":"strokeLinejoin",strokemiterlimit:"strokeMiterlimit","stroke-miterlimit":"strokeMiterlimit",strokewidth:"strokeWidth","stroke-width":"strokeWidth",strokeopacity:"strokeOpacity","stroke-opacity":"strokeOpacity",suppresscontenteditablewarning:"suppressContentEditableWarning",suppresshydrationwarning:"suppressHydrationWarning",surfacescale:"surfaceScale",systemlanguage:"systemLanguage",tablevalues:"tableValues",targetx:"targetX",targety:"targetY",textanchor:"textAnchor","text-anchor":"textAnchor",textdecoration:"textDecoration","text-decoration":"textDecoration",textlength:"textLength",textrendering:"textRendering","text-rendering":"textRendering",to:"to",transform:"transform",transformorigin:"transformOrigin","transform-origin":"transformOrigin",typeof:"typeof",u1:"u1",u2:"u2",underlineposition:"underlinePosition","underline-position":"underlinePosition",underlinethickness:"underlineThickness","underline-thickness":"underlineThickness",unicode:"unicode",unicodebidi:"unicodeBidi","unicode-bidi":"unicodeBidi",unicoderange:"unicodeRange","unicode-range":"unicodeRange",unitsperem:"unitsPerEm","units-per-em":"unitsPerEm",unselectable:"unselectable",valphabetic:"vAlphabetic","v-alphabetic":"vAlphabetic",values:"values",vectoreffect:"vectorEffect","vector-effect":"vectorEffect",version:"version",vertadvy:"vertAdvY","vert-adv-y":"vertAdvY",vertoriginx:"vertOriginX","vert-origin-x":"vertOriginX",vertoriginy:"vertOriginY","vert-origin-y":"vertOriginY",vhanging:"vHanging","v-hanging":"vHanging",videographic:"vIdeographic","v-ideographic":"vIdeographic",viewbox:"viewBox",viewtarget:"viewTarget",visibility:"visibility",vmathematical:"vMathematical","v-mathematical":"vMathematical",vocab:"vocab",widths:"widths",wordspacing:"wordSpacing","word-spacing":"wordSpacing",writingmode:"writingMode","writing-mode":"writingMode",x1:"x1",x2:"x2",x:"x",xchannelselector:"xChannelSelector",xheight:"xHeight","x-height":"xHeight",xlinkactuate:"xlinkActuate","xlink:actuate":"xlinkActuate",xlinkarcrole:"xlinkArcrole","xlink:arcrole":"xlinkArcrole",xlinkhref:"xlinkHref","xlink:href":"xlinkHref",xlinkrole:"xlinkRole","xlink:role":"xlinkRole",xlinkshow:"xlinkShow","xlink:show":"xlinkShow",xlinktitle:"xlinkTitle","xlink:title":"xlinkTitle",xlinktype:"xlinkType","xlink:type":"xlinkType",xmlbase:"xmlBase","xml:base":"xmlBase",xmllang:"xmlLang","xml:lang":"xmlLang",xmlns:"xmlns","xml:space":"xmlSpace",xmlnsxlink:"xmlnsXlink","xmlns:xlink":"xmlnsXlink",xmlspace:"xmlSpace",y1:"y1",y2:"y2",y:"y",ychannelselector:"yChannelSelector",z:"z",zoomandpan:"zoomAndPan"},Cn={"aria-current":0,"aria-description":0,"aria-details":0,"aria-disabled":0,"aria-hidden":0,"aria-invalid":0,"aria-keyshortcuts":0,"aria-label":0,"aria-roledescription":0,"aria-autocomplete":0,"aria-checked":0,"aria-expanded":0,"aria-haspopup":0,"aria-level":0,"aria-modal":0,"aria-multiline":0,"aria-multiselectable":0,"aria-orientation":0,"aria-placeholder":0,"aria-pressed":0,"aria-readonly":0,"aria-required":0,"aria-selected":0,"aria-sort":0,"aria-valuemax":0,"aria-valuemin":0,"aria-valuenow":0,"aria-valuetext":0,"aria-atomic":0,"aria-busy":0,"aria-live":0,"aria-relevant":0,"aria-dropeffect":0,"aria-grabbed":0,"aria-activedescendant":0,"aria-colcount":0,"aria-colindex":0,"aria-colspan":0,"aria-controls":0,"aria-describedby":0,"aria-errormessage":0,"aria-flowto":0,"aria-labelledby":0,"aria-owns":0,"aria-posinset":0,"aria-rowcount":0,"aria-rowindex":0,"aria-rowspan":0,"aria-setsize":0,"aria-braillelabel":0,"aria-brailleroledescription":0,"aria-colindextext":0,"aria-rowindextext":0},Kn={},Vo=RegExp("^(aria)-[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),jo=RegExp("^(aria)[A-Z][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),yr=!1,$i={},Zc=/^on./,KD=/^on[^A-Z]/,$D=RegExp("^(aria)-[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),s4=RegExp("^(aria)[A-Z][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),on=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i,nn=null,An=null,io=null,wr=!1,js=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),qi=!1;if(js)try{var ls={};Object.defineProperty(ls,"passive",{get:function(){qi=!0}}),window.addEventListener("test",ls,ls),window.removeEventListener("test",ls,ls)}catch(S){qi=!1}var Ji=null,mh=null,Zd=null,$g={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(S){return S.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},_W=Ph($g),eoe=ta({},$g,{view:0,detail:0}),RAo=Ph(eoe),_Te,gTe,toe,F_e=ta({},eoe,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Nm,button:0,buttons:0,relatedTarget:function(S){return S.relatedTarget===void 0?S.fromElement===S.srcElement?S.toElement:S.fromElement:S.relatedTarget},movementX:function(S){if("movementX"in S)return S.movementX;return S!==toe&&(toe&&S.type==="mousemove"?(_Te=S.screenX-toe.screenX,gTe=S.screenY-toe.screenY):gTe=_Te=0,toe=S),_Te},movementY:function(S){return"movementY"in S?S.movementY:gTe}}),rft=Ph(F_e),QAo=ta({},F_e,{dataTransfer:0}),kAo=Ph(QAo),LAo=ta({},eoe,{relatedTarget:0}),ATe=Ph(LAo),HAo=ta({},$g,{animationName:0,elapsedTime:0,pseudoElement:0}),FAo=Ph(HAo),zAo=ta({},$g,{clipboardData:function(S){return"clipboardData"in S?S.clipboardData:window.clipboardData}}),OAo=Ph(zAo),VAo=ta({},$g,{data:0}),ift=Ph(VAo),YAo=ift,GAo={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},UAo={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},WAo={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"},XAo=ta({},eoe,{key:function(S){if(S.key){var w=GAo[S.key]||S.key;if(w!=="Unidentified")return w}return S.type==="keypress"?(S=Q_(S),S===13?"Enter":String.fromCharCode(S)):S.type==="keydown"||S.type==="keyup"?UAo[S.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Nm,charCode:function(S){return S.type==="keypress"?Q_(S):0},keyCode:function(S){return S.type==="keydown"||S.type==="keyup"?S.keyCode:0},which:function(S){return S.type==="keypress"?Q_(S):S.type==="keydown"||S.type==="keyup"?S.keyCode:0}}),jAo=Ph(XAo),KAo=ta({},F_e,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),sft=Ph(KAo),$Ao=ta({},$g,{submitter:0}),qAo=Ph($Ao),JAo=ta({},eoe,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Nm}),ZAo=Ph(JAo),efo=ta({},$g,{propertyName:0,elapsedTime:0,pseudoElement:0}),tfo=Ph(efo),nfo=ta({},F_e,{deltaX:function(S){return"deltaX"in S?S.deltaX:("wheelDeltaX"in S)?-S.wheelDeltaX:0},deltaY:function(S){return"deltaY"in S?S.deltaY:("wheelDeltaY"in S)?-S.wheelDeltaY:("wheelDelta"in S)?-S.wheelDelta:0},deltaZ:0,deltaMode:0}),ofo=Ph(nfo),rfo=ta({},$g,{newState:0,oldState:0,source:0}),ifo=Ph(rfo),sfo=[9,13,27,32],aft=229,fTe=js&&"CompositionEvent"in window,noe=null;js&&"documentMode"in document&&(noe=document.documentMode);var afo=js&&"TextEvent"in window&&!noe,cft=js&&(!fTe||noe&&8<noe&&11>=noe),lft=32,hft=String.fromCharCode(lft),dft=!1,gW=!1,cfo={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0},ooe=null,roe=null,uft=!1;js&&(uft=c1("input")&&(!document.documentMode||9<document.documentMode));var Q1=typeof Object.is==="function"?Object.is:nH,lfo=js&&"documentMode"in document&&11>=document.documentMode,AW=null,yTe=null,ioe=null,xTe=!1,fW={animationend:Op("Animation","AnimationEnd"),animationiteration:Op("Animation","AnimationIteration"),animationstart:Op("Animation","AnimationStart"),transitionrun:Op("Transition","TransitionRun"),transitionstart:Op("Transition","TransitionStart"),transitioncancel:Op("Transition","TransitionCancel"),transitionend:Op("Transition","TransitionEnd")},CTe={},pft={};js&&(pft=document.createElement("div").style,("AnimationEvent"in window)||(delete fW.animationend.animation,delete fW.animationiteration.animation,delete fW.animationstart.animation),("TransitionEvent"in window)||delete fW.transitionend.transition);var mft=D0("animationend"),_ft=D0("animationiteration"),gft=D0("animationstart"),hfo=D0("transitionrun"),dfo=D0("transitionstart"),ufo=D0("transitioncancel"),Aft=D0("transitionend"),fft=new Map,bTe="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error fullscreenChange fullscreenError gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");bTe.push("scrollEnd");var pfo=0,yft=0;if(typeof performance==="object"&&typeof performance.now==="function")var mfo=performance,xft=function(){return mfo.now()};else{var _fo=Date;xft=function(){return _fo.now()}}var ITe=typeof reportError==="function"?reportError:function(S){if(typeof window==="object"&&typeof window.ErrorEvent==="function"){var w=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof S==="object"&&S!==null&&typeof S.message==="string"?String(S.message):String(S),error:S});if(!window.dispatchEvent(w))return}else if(typeof process==="object"&&typeof process.emit==="function"){process.emit("uncaughtException",S);return}console.error(S)},gfo="This object has been omitted by React in the console log to avoid sending too much data from the server. Try logging smaller or more specific objects.",z_e=0,vTe=1,STe=2,PTe=3,PC=100,O_e="- ",V_e="+ ",Cft="  ",eu=typeof console<"u"&&typeof console.timeStamp==="function"&&typeof performance<"u"&&typeof performance.measure==="function",sx="Components ⚛",Ga="Scheduler ⚛",ec="Blocking",qD=!1,jE={color:"primary",properties:null,tooltipText:"",track:sx},JD={start:-0,end:-0,detail:{devtools:jE}},Afo=["Changed Props",""],bft="This component received deeply equal props. It might benefit from useMemo or the React Compiler in its owner.",ffo=["Changed Props",bft],soe=1,KE=2,EC=[],yW=0,ETe=0,ZD={};Object.freeze(ZD);var $E=null,xW=null,hs=0,yfo=1,Sa=2,A2=8,yI=16,Ift=32,vft=!1;try{var Sft=Object.preventExtensions({})}catch(S){vft=!0}var MTe=new WeakMap,CW=[],bW=0,Y_e=null,aoe=0,MC=[],wC=0,aF=null,qE=1,JE="",qg=null,Sd=null,Pa=!1,R8=!1,a4=null,eN=null,BC=!1,wTe=Error("Hydration Mismatch Exception: This is not a real error, and should not leak into userspace. If you're seeing this, it's likely a bug in React."),BTe=X(null),TTe=X(null),Pft={},G_e=null,IW=null,vW=!1,xfo=typeof AbortController<"u"?AbortController:function(){var S=[],w=this.signal={aborted:!1,addEventListener:function(Q,W){S.push(W)}};this.abort=function(){w.aborted=!0,S.forEach(function(Q){return Q()})}},Cfo=el.unstable_scheduleCallback,bfo=el.unstable_NormalPriority,Um={$$typeof:fl,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0,_currentRenderer:null,_currentRenderer2:null},coe=null,rm=el.unstable_now,U_e=console.createTask?console.createTask:function(){return null},loe=1,W_e=2,Jg=-0,ZE=-0,xI=-0,eM=null,k1=-1.1,cF=-0,c0=-0,Ti=-1.1,Zi=-1.1,Lu=null,O0=!1,tN=-0,Q8=-1.1,hoe=null,nN=0,DTe=null,NTe=null,lF=-1.1,doe=null,SW=-1.1,X_e=-1.1,CI=-0,tM=-1.1,TC=-1.1,RTe=0,uoe=null,Eft=null,Mft=null,oN=-1.1,hF=null,rN=-1.1,j_e=-1.1,QTe=-0,kTe=-0,dF=0,ax=null,wft=0,poe=-1.1,K_e=!1,$_e=!1,moe=null,LTe=0,iN=0,PW=null,Bft=Vn.S;Vn.S=function(S,w){if(E2t=Ki(),typeof w==="object"&&w!==null&&typeof w.then==="function"){if(0>tM&&0>TC){tM=rm();var Q=mf(),W=U5();if(Q!==rN||W!==hF)rN=-1.1;oN=Q,hF=W}A6(S,w)}if(coe!==null)for(Q=OW;Q!==null;)u1(Q,coe),Q=Q.next;if(Q=S.types,Q!==null){for(W=OW;W!==null;)u1(W,Q),W=W.next;if(iN!==0){W=coe,W===null&&(W=coe=[]);for(var oe=0;oe<Q.length;oe++){var ae=Q[oe];W.indexOf(ae)===-1&&W.push(ae)}}}Bft!==null&&Bft(S,w)};var uF=X(null),bI={recordUnsafeLifecycleWarnings:function(){},flushPendingUnsafeLifecycleWarnings:function(){},recordLegacyContextWarning:function(){},flushLegacyContextWarning:function(){},discardPendingWarnings:function(){}},_oe=[],goe=[],Aoe=[],foe=[],yoe=[],xoe=[],pF=new Set;bI.recordUnsafeLifecycleWarnings=function(S,w){pF.has(S.type)||(typeof w.componentWillMount==="function"&&w.componentWillMount.__suppressDeprecationWarning!==!0&&_oe.push(S),S.mode&A2&&typeof w.UNSAFE_componentWillMount==="function"&&goe.push(S),typeof w.componentWillReceiveProps==="function"&&w.componentWillReceiveProps.__suppressDeprecationWarning!==!0&&Aoe.push(S),S.mode&A2&&typeof w.UNSAFE_componentWillReceiveProps==="function"&&foe.push(S),typeof w.componentWillUpdate==="function"&&w.componentWillUpdate.__suppressDeprecationWarning!==!0&&yoe.push(S),S.mode&A2&&typeof w.UNSAFE_componentWillUpdate==="function"&&xoe.push(S))},bI.flushPendingUnsafeLifecycleWarnings=function(){var S=new Set;0<_oe.length&&(_oe.forEach(function(ke){S.add(Y(ke)||"Component"),pF.add(ke.type)}),_oe=[]);var w=new Set;0<goe.length&&(goe.forEach(function(ke){w.add(Y(ke)||"Component"),pF.add(ke.type)}),goe=[]);var Q=new Set;0<Aoe.length&&(Aoe.forEach(function(ke){Q.add(Y(ke)||"Component"),pF.add(ke.type)}),Aoe=[]);var W=new Set;0<foe.length&&(foe.forEach(function(ke){W.add(Y(ke)||"Component"),pF.add(ke.type)}),foe=[]);var oe=new Set;0<yoe.length&&(yoe.forEach(function(ke){oe.add(Y(ke)||"Component"),pF.add(ke.type)}),yoe=[]);var ae=new Set;if(0<xoe.length&&(xoe.forEach(function(ke){ae.add(Y(ke)||"Component"),pF.add(ke.type)}),xoe=[]),0<w.size){var De=d(w);console.error(`Using UNSAFE_componentWillMount in strict mode is not recommended and may indicate bugs in your code. See https://react.dev/link/unsafe-component-lifecycles for details.

* Move code with side effects to componentDidMount, and set initial state in the constructor.

Please update the following components: %s`,De)}0<W.size&&(De=d(W),console.error(`Using UNSAFE_componentWillReceiveProps in strict mode is not recommended and may indicate bugs in your code. See https://react.dev/link/unsafe-component-lifecycles for details.

* Move data fetching code or side effects to componentDidUpdate.
* If you're updating state whenever props change, refactor your code to use memoization techniques or move it to static getDerivedStateFromProps. Learn more at: https://react.dev/link/derived-state

Please update the following components: %s`,De)),0<ae.size&&(De=d(ae),console.error(`Using UNSAFE_componentWillUpdate in strict mode is not recommended and may indicate bugs in your code. See https://react.dev/link/unsafe-component-lifecycles for details.

* Move data fetching code or side effects to componentDidUpdate.

Please update the following components: %s`,De)),0<S.size&&(De=d(S),console.warn(`componentWillMount has been renamed, and is not recommended for use. See https://react.dev/link/unsafe-component-lifecycles for details.

* Move code with side effects to componentDidMount, and set initial state in the constructor.
* Rename componentWillMount to UNSAFE_componentWillMount to suppress this warning in non-strict mode. In React 18.x, only the UNSAFE_ name will work. To rename all deprecated lifecycles to their new names, you can run \`npx react-codemod rename-unsafe-lifecycles\` in your project source folder.

Please update the following components: %s`,De)),0<Q.size&&(De=d(Q),console.warn(`componentWillReceiveProps has been renamed, and is not recommended for use. See https://react.dev/link/unsafe-component-lifecycles for details.

* Move data fetching code or side effects to componentDidUpdate.
* If you're updating state whenever props change, refactor your code to use memoization techniques or move it to static getDerivedStateFromProps. Learn more at: https://react.dev/link/derived-state
* Rename componentWillReceiveProps to UNSAFE_componentWillReceiveProps to suppress this warning in non-strict mode. In React 18.x, only the UNSAFE_ name will work. To rename all deprecated lifecycles to their new names, you can run \`npx react-codemod rename-unsafe-lifecycles\` in your project source folder.

Please update the following components: %s`,De)),0<oe.size&&(De=d(oe),console.warn(`componentWillUpdate has been renamed, and is not recommended for use. See https://react.dev/link/unsafe-component-lifecycles for details.

* Move data fetching code or side effects to componentDidUpdate.
* Rename componentWillUpdate to UNSAFE_componentWillUpdate to suppress this warning in non-strict mode. In React 18.x, only the UNSAFE_ name will work. To rename all deprecated lifecycles to their new names, you can run \`npx react-codemod rename-unsafe-lifecycles\` in your project source folder.

Please update the following components: %s`,De))};var q_e=new Map,Tft=new Set;bI.recordLegacyContextWarning=function(S,w){var Q=null;for(var W=S;W!==null;)W.mode&A2&&(Q=W),W=W.return;Q===null?console.error("Expected to find a StrictMode component in a strict mode tree. This error is likely caused by a bug in React. Please file an issue."):!Tft.has(S.type)&&(W=q_e.get(Q),S.type.contextTypes!=null||S.type.childContextTypes!=null||w!==null&&typeof w.getChildContext==="function")&&(W===void 0&&(W=[],q_e.set(Q,W)),W.push(S))},bI.flushLegacyContextWarning=function(){q_e.forEach(function(S){if(S.length!==0){var w=S[0],Q=new Set;S.forEach(function(oe){Q.add(Y(oe)||"Component"),Tft.add(oe.type)});var W=d(Q);ye(w,function(){console.error(`Legacy context API has been detected within a strict-mode tree.

The old API will be supported in all 16.x releases, but applications using it should migrate to the new version.

Please update the following components: %s

Learn more about this warning here: https://react.dev/link/legacy-context`,W)})}})},bI.discardPendingWarnings=function(){_oe=[],goe=[],Aoe=[],foe=[],yoe=[],xoe=[],q_e=new Map};var Ifo="",Dft={react_stack_bottom_frame:function(S,w,Q){var W=i4;i4=!0;try{return S(w,Q)}finally{i4=W}}},HTe=Dft.react_stack_bottom_frame.bind(Dft),Nft={react_stack_bottom_frame:function(S){var w=i4;i4=!0;try{return S.render()}finally{i4=w}}},Rft=Nft.react_stack_bottom_frame.bind(Nft),Qft={react_stack_bottom_frame:function(S,w){try{w.componentDidMount()}catch(Q){Tc(S,S.return,Q)}}},FTe=Qft.react_stack_bottom_frame.bind(Qft),kft={react_stack_bottom_frame:function(S,w,Q,W,oe){try{w.componentDidUpdate(Q,W,oe)}catch(ae){Tc(S,S.return,ae)}}},Lft=kft.react_stack_bottom_frame.bind(kft),Hft={react_stack_bottom_frame:function(S,w){var Q=w.stack;S.componentDidCatch(w.value,{componentStack:Q!==null?Q:""})}},vfo=Hft.react_stack_bottom_frame.bind(Hft),Fft={react_stack_bottom_frame:function(S,w,Q){try{Q.componentWillUnmount()}catch(W){Tc(S,w,W)}}},zft=Fft.react_stack_bottom_frame.bind(Fft),Oft={react_stack_bottom_frame:function(S){var w=S.create;return S=S.inst,w=w(),S.destroy=w}},Sfo=Oft.react_stack_bottom_frame.bind(Oft),Vft={react_stack_bottom_frame:function(S,w,Q){try{Q()}catch(W){Tc(S,w,W)}}},Pfo=Vft.react_stack_bottom_frame.bind(Vft),Yft={react_stack_bottom_frame:function(S){var w=S._init;return w(S._payload)}},Efo=Yft.react_stack_bottom_frame.bind(Yft),EW=Error("Suspense Exception: This is not a real error! It's an implementation detail of `use` to interrupt the current render. You must either rethrow it immediately, or move the `use` call outside of the `try/catch` block. Capturing without rethrowing will lead to unexpected behavior.\n\nTo handle async errors, wrap your component in an error boundary, or call the promise's `.catch` method and pass the result to `use`."),zTe=Error("Suspense Exception: This is not a real error, and should not leak into userspace. If you're seeing this, it's likely a bug in React."),J_e=Error("Suspense Exception: This is not a real error! It's an implementation detail of `useActionState` to interrupt the current render. You must either rethrow it immediately, or move the `useActionState` call outside of the `try/catch` block. Capturing without rethrowing will lead to unexpected behavior.\n\nTo handle async errors, wrap your component in an error boundary."),Z_e={then:function(){console.error('Internal React error: A listener was unexpectedly attached to a "noop" thenable. This is a bug in React. Please file an issue.')}},mF=null,ege=null,OTe=!1,_F=null,Coe=!1,MW=null,boe=0,Ua=null,VTe,Gft=VTe=!1,Uft={},Wft={},Xft={};h=function(S,w,Q){if(Q!==null&&typeof Q==="object"&&Q._store&&(!Q._store.validated&&Q.key==null||Q._store.validated===2)){if(typeof Q._store!=="object")throw Error("React Component in warnForMissingKey should have a _store. This error is likely caused by a bug in React. Please file an issue.");Q._store.validated=1;var W=Y(S),oe=W||"null";if(!Uft[oe]){Uft[oe]=!0,Q=Q._owner,S=S._debugOwner;var ae="";S&&typeof S.tag==="number"&&(oe=Y(S))&&(ae=`

Check the render method of \``+oe+"`."),ae||W&&(ae=`

Check the top-level render call using <`+W+">.");var De="";Q!=null&&S!==Q&&(W=null,typeof Q.tag==="number"?W=Y(Q):typeof Q.name==="string"&&(W=Q.name),W&&(De=" It was passed a child from "+W+".")),ye(w,function(){console.error('Each child in a list should have a unique "key" prop.%s%s See https://react.dev/link/warning-keys for more information.',ae,De)})}}};var gF=DT(!0),jft=DT(!1),Kft=0,$ft=1,qft=2,YTe=3,sN=!1,Jft=!1,GTe=null,UTe=!1,aN=X(null),tge=X(0),Af=X(null),f2=null,wW=1,Ioe=2,ff=X(0),voe=0,DC=1,L1=2,c4=4,y2=8,BW,Zft=new Set,e2t=new Set,WTe=new Set,t2t=new Set,nM=0,_s=null,Kh=null,Wm=null,nge=!1,TW=!1,AF=!1,oge=0,Soe=0,k8=null,Mfo=0,wfo=25,zn=null,NC=null,oM=-1,Poe=!1,rge={readContext:Kc,use:Ud,useCallback:Uh,useContext:Uh,useEffect:Uh,useImperativeHandle:Uh,useLayoutEffect:Uh,useInsertionEffect:Uh,useMemo:Uh,useReducer:Uh,useRef:Uh,useState:Uh,useDebugValue:Uh,useDeferredValue:Uh,useTransition:Uh,useSyncExternalStore:Uh,useId:Uh,useHostTransitionStatus:Uh,useFormState:Uh,useActionState:Uh,useOptimistic:Uh,useMemoCache:Uh,useCacheRefresh:Uh,useEffectEvent:Uh},XTe=null,n2t=null,jTe=null,o2t=null,L8=null,II=null,ige=null;XTe={readContext:function(S){return Kc(S)},use:Ud,useCallback:function(S,w){return zn="useCallback",Xs(),C6(w),ZT(S,w)},useContext:function(S){return zn="useContext",Xs(),Kc(S)},useEffect:function(S,w){return zn="useEffect",Xs(),C6(w),qT(S,w)},useImperativeHandle:function(S,w,Q){return zn="useImperativeHandle",Xs(),C6(Q),JT(S,w,Q)},useInsertionEffect:function(S,w){zn="useInsertionEffect",Xs(),C6(w),j3(4,L1,S,w)},useLayoutEffect:function(S,w){return zn="useLayoutEffect",Xs(),C6(w),q3(S,w)},useMemo:function(S,w){zn="useMemo",Xs(),C6(w);var Q=Vn.H;Vn.H=L8;try{return Qv(S,w)}finally{Vn.H=Q}},useReducer:function(S,w,Q){zn="useReducer",Xs();var W=Vn.H;Vn.H=L8;try{return YT(S,w,Q)}finally{Vn.H=W}},useRef:function(S){return zn="useRef",Xs(),xd(S)},useState:function(S){zn="useState",Xs();var w=Vn.H;Vn.H=L8;try{return S6(S)}finally{Vn.H=w}},useDebugValue:function(){zn="useDebugValue",Xs()},useDeferredValue:function(S,w){return zn="useDeferredValue",Xs(),Lv(S,w)},useTransition:function(){return zn="useTransition",Xs(),yE()},useSyncExternalStore:function(S,w,Q){return zn="useSyncExternalStore",Xs(),UT(S,w,Q)},useId:function(){return zn="useId",Xs(),J3()},useFormState:function(S,w){return zn="useFormState",Xs(),Nv(),E6(S,w)},useActionState:function(S,w){return zn="useActionState",Xs(),E6(S,w)},useOptimistic:function(S){return zn="useOptimistic",Xs(),H5(S)},useHostTransitionStatus:z5,useMemoCache:U3,useCacheRefresh:function(){return zn="useCacheRefresh",Xs(),rD()},useEffectEvent:function(S){return zn="useEffectEvent",Xs(),B6(S)}},n2t={readContext:function(S){return Kc(S)},use:Ud,useCallback:function(S,w){return zn="useCallback",Eo(),ZT(S,w)},useContext:function(S){return zn="useContext",Eo(),Kc(S)},useEffect:function(S,w){return zn="useEffect",Eo(),qT(S,w)},useImperativeHandle:function(S,w,Q){return zn="useImperativeHandle",Eo(),JT(S,w,Q)},useInsertionEffect:function(S,w){zn="useInsertionEffect",Eo(),j3(4,L1,S,w)},useLayoutEffect:function(S,w){return zn="useLayoutEffect",Eo(),q3(S,w)},useMemo:function(S,w){zn="useMemo",Eo();var Q=Vn.H;Vn.H=L8;try{return Qv(S,w)}finally{Vn.H=Q}},useReducer:function(S,w,Q){zn="useReducer",Eo();var W=Vn.H;Vn.H=L8;try{return YT(S,w,Q)}finally{Vn.H=W}},useRef:function(S){return zn="useRef",Eo(),xd(S)},useState:function(S){zn="useState",Eo();var w=Vn.H;Vn.H=L8;try{return S6(S)}finally{Vn.H=w}},useDebugValue:function(){zn="useDebugValue",Eo()},useDeferredValue:function(S,w){return zn="useDeferredValue",Eo(),Lv(S,w)},useTransition:function(){return zn="useTransition",Eo(),yE()},useSyncExternalStore:function(S,w,Q){return zn="useSyncExternalStore",Eo(),UT(S,w,Q)},useId:function(){return zn="useId",Eo(),J3()},useActionState:function(S,w){return zn="useActionState",Eo(),E6(S,w)},useFormState:function(S,w){return zn="useFormState",Eo(),Nv(),E6(S,w)},useOptimistic:function(S){return zn="useOptimistic",Eo(),H5(S)},useHostTransitionStatus:z5,useMemoCache:U3,useCacheRefresh:function(){return zn="useCacheRefresh",Eo(),rD()},useEffectEvent:function(S){return zn="useEffectEvent",Eo(),B6(S)}},jTe={readContext:function(S){return Kc(S)},use:Ud,useCallback:function(S,w){return zn="useCallback",Eo(),Rv(S,w)},useContext:function(S){return zn="useContext",Eo(),Kc(S)},useEffect:function(S,w){zn="useEffect",Eo(),F_(2048,y2,S,w)},useImperativeHandle:function(S,w,Q){return zn="useImperativeHandle",Eo(),gE(S,w,Q)},useInsertionEffect:function(S,w){return zn="useInsertionEffect",Eo(),F_(4,L1,S,w)},useLayoutEffect:function(S,w){return zn="useLayoutEffect",Eo(),F_(4,c4,S,w)},useMemo:function(S,w){zn="useMemo",Eo();var Q=Vn.H;Vn.H=II;try{return kv(S,w)}finally{Vn.H=Q}},useReducer:function(S,w,Q){zn="useReducer",Eo();var W=Vn.H;Vn.H=II;try{return zg(S,w,Q)}finally{Vn.H=W}},useRef:function(){return zn="useRef",Eo(),zc().memoizedState},useState:function(){zn="useState",Eo();var S=Vn.H;Vn.H=II;try{return zg(Wh)}finally{Vn.H=S}},useDebugValue:function(){zn="useDebugValue",Eo()},useDeferredValue:function(S,w){return zn="useDeferredValue",Eo(),wU(S,w)},useTransition:function(){return zn="useTransition",Eo(),AH()},useSyncExternalStore:function(S,w,Q){return zn="useSyncExternalStore",Eo(),t2(S,w,Q)},useId:function(){return zn="useId",Eo(),zc().memoizedState},useFormState:function(S){return zn="useFormState",Eo(),Nv(),M6(S)},useActionState:function(S){return zn="useActionState",Eo(),M6(S)},useOptimistic:function(S,w){return zn="useOptimistic",Eo(),W3(S,w)},useHostTransitionStatus:z5,useMemoCache:U3,useCacheRefresh:function(){return zn="useCacheRefresh",Eo(),zc().memoizedState},useEffectEvent:function(S){return zn="useEffectEvent",Eo(),$3(S)}},o2t={readContext:function(S){return Kc(S)},use:Ud,useCallback:function(S,w){return zn="useCallback",Eo(),Rv(S,w)},useContext:function(S){return zn="useContext",Eo(),Kc(S)},useEffect:function(S,w){zn="useEffect",Eo(),F_(2048,y2,S,w)},useImperativeHandle:function(S,w,Q){return zn="useImperativeHandle",Eo(),gE(S,w,Q)},useInsertionEffect:function(S,w){return zn="useInsertionEffect",Eo(),F_(4,L1,S,w)},useLayoutEffect:function(S,w){return zn="useLayoutEffect",Eo(),F_(4,c4,S,w)},useMemo:function(S,w){zn="useMemo",Eo();var Q=Vn.H;Vn.H=ige;try{return kv(S,w)}finally{Vn.H=Q}},useReducer:function(S,w,Q){zn="useReducer",Eo();var W=Vn.H;Vn.H=ige;try{return g1(S,w,Q)}finally{Vn.H=W}},useRef:function(){return zn="useRef",Eo(),zc().memoizedState},useState:function(){zn="useState",Eo();var S=Vn.H;Vn.H=ige;try{return g1(Wh)}finally{Vn.H=S}},useDebugValue:function(){zn="useDebugValue",Eo()},useDeferredValue:function(S,w){return zn="useDeferredValue",Eo(),eD(S,w)},useTransition:function(){return zn="useTransition",Eo(),BU()},useSyncExternalStore:function(S,w,Q){return zn="useSyncExternalStore",Eo(),t2(S,w,Q)},useId:function(){return zn="useId",Eo(),zc().memoizedState},useFormState:function(S){return zn="useFormState",Eo(),Nv(),Lm(S)},useActionState:function(S){return zn="useActionState",Eo(),Lm(S)},useOptimistic:function(S,w){return zn="useOptimistic",Eo(),X3(S,w)},useHostTransitionStatus:z5,useMemoCache:U3,useCacheRefresh:function(){return zn="useCacheRefresh",Eo(),zc().memoizedState},useEffectEvent:function(S){return zn="useEffectEvent",Eo(),$3(S)}},L8={readContext:function(S){return c(),Kc(S)},use:function(S){return a(),Ud(S)},useCallback:function(S,w){return zn="useCallback",a(),Xs(),ZT(S,w)},useContext:function(S){return zn="useContext",a(),Xs(),Kc(S)},useEffect:function(S,w){return zn="useEffect",a(),Xs(),qT(S,w)},useImperativeHandle:function(S,w,Q){return zn="useImperativeHandle",a(),Xs(),JT(S,w,Q)},useInsertionEffect:function(S,w){zn="useInsertionEffect",a(),Xs(),j3(4,L1,S,w)},useLayoutEffect:function(S,w){return zn="useLayoutEffect",a(),Xs(),q3(S,w)},useMemo:function(S,w){zn="useMemo",a(),Xs();var Q=Vn.H;Vn.H=L8;try{return Qv(S,w)}finally{Vn.H=Q}},useReducer:function(S,w,Q){zn="useReducer",a(),Xs();var W=Vn.H;Vn.H=L8;try{return YT(S,w,Q)}finally{Vn.H=W}},useRef:function(S){return zn="useRef",a(),Xs(),xd(S)},useState:function(S){zn="useState",a(),Xs();var w=Vn.H;Vn.H=L8;try{return S6(S)}finally{Vn.H=w}},useDebugValue:function(){zn="useDebugValue",a(),Xs()},useDeferredValue:function(S,w){return zn="useDeferredValue",a(),Xs(),Lv(S,w)},useTransition:function(){return zn="useTransition",a(),Xs(),yE()},useSyncExternalStore:function(S,w,Q){return zn="useSyncExternalStore",a(),Xs(),UT(S,w,Q)},useId:function(){return zn="useId",a(),Xs(),J3()},useFormState:function(S,w){return zn="useFormState",a(),Xs(),E6(S,w)},useActionState:function(S,w){return zn="useActionState",a(),Xs(),E6(S,w)},useOptimistic:function(S){return zn="useOptimistic",a(),Xs(),H5(S)},useMemoCache:function(S){return a(),U3(S)},useHostTransitionStatus:z5,useCacheRefresh:function(){return zn="useCacheRefresh",Xs(),rD()},useEffectEvent:function(S){return zn="useEffectEvent",a(),Xs(),B6(S)}},II={readContext:function(S){return c(),Kc(S)},use:function(S){return a(),Ud(S)},useCallback:function(S,w){return zn="useCallback",a(),Eo(),Rv(S,w)},useContext:function(S){return zn="useContext",a(),Eo(),Kc(S)},useEffect:function(S,w){zn="useEffect",a(),Eo(),F_(2048,y2,S,w)},useImperativeHandle:function(S,w,Q){return zn="useImperativeHandle",a(),Eo(),gE(S,w,Q)},useInsertionEffect:function(S,w){return zn="useInsertionEffect",a(),Eo(),F_(4,L1,S,w)},useLayoutEffect:function(S,w){return zn="useLayoutEffect",a(),Eo(),F_(4,c4,S,w)},useMemo:function(S,w){zn="useMemo",a(),Eo();var Q=Vn.H;Vn.H=II;try{return kv(S,w)}finally{Vn.H=Q}},useReducer:function(S,w,Q){zn="useReducer",a(),Eo();var W=Vn.H;Vn.H=II;try{return zg(S,w,Q)}finally{Vn.H=W}},useRef:function(){return zn="useRef",a(),Eo(),zc().memoizedState},useState:function(){zn="useState",a(),Eo();var S=Vn.H;Vn.H=II;try{return zg(Wh)}finally{Vn.H=S}},useDebugValue:function(){zn="useDebugValue",a(),Eo()},useDeferredValue:function(S,w){return zn="useDeferredValue",a(),Eo(),wU(S,w)},useTransition:function(){return zn="useTransition",a(),Eo(),AH()},useSyncExternalStore:function(S,w,Q){return zn="useSyncExternalStore",a(),Eo(),t2(S,w,Q)},useId:function(){return zn="useId",a(),Eo(),zc().memoizedState},useFormState:function(S){return zn="useFormState",a(),Eo(),M6(S)},useActionState:function(S){return zn="useActionState",a(),Eo(),M6(S)},useOptimistic:function(S,w){return zn="useOptimistic",a(),Eo(),W3(S,w)},useMemoCache:function(S){return a(),U3(S)},useHostTransitionStatus:z5,useCacheRefresh:function(){return zn="useCacheRefresh",Eo(),zc().memoizedState},useEffectEvent:function(S){return zn="useEffectEvent",a(),Eo(),$3(S)}},ige={readContext:function(S){return c(),Kc(S)},use:function(S){return a(),Ud(S)},useCallback:function(S,w){return zn="useCallback",a(),Eo(),Rv(S,w)},useContext:function(S){return zn="useContext",a(),Eo(),Kc(S)},useEffect:function(S,w){zn="useEffect",a(),Eo(),F_(2048,y2,S,w)},useImperativeHandle:function(S,w,Q){return zn="useImperativeHandle",a(),Eo(),gE(S,w,Q)},useInsertionEffect:function(S,w){return zn="useInsertionEffect",a(),Eo(),F_(4,L1,S,w)},useLayoutEffect:function(S,w){return zn="useLayoutEffect",a(),Eo(),F_(4,c4,S,w)},useMemo:function(S,w){zn="useMemo",a(),Eo();var Q=Vn.H;Vn.H=II;try{return kv(S,w)}finally{Vn.H=Q}},useReducer:function(S,w,Q){zn="useReducer",a(),Eo();var W=Vn.H;Vn.H=II;try{return g1(S,w,Q)}finally{Vn.H=W}},useRef:function(){return zn="useRef",a(),Eo(),zc().memoizedState},useState:function(){zn="useState",a(),Eo();var S=Vn.H;Vn.H=II;try{return g1(Wh)}finally{Vn.H=S}},useDebugValue:function(){zn="useDebugValue",a(),Eo()},useDeferredValue:function(S,w){return zn="useDeferredValue",a(),Eo(),eD(S,w)},useTransition:function(){return zn="useTransition",a(),Eo(),BU()},useSyncExternalStore:function(S,w,Q){return zn="useSyncExternalStore",a(),Eo(),t2(S,w,Q)},useId:function(){return zn="useId",a(),Eo(),zc().memoizedState},useFormState:function(S){return zn="useFormState",a(),Eo(),Lm(S)},useActionState:function(S){return zn="useActionState",a(),Eo(),Lm(S)},useOptimistic:function(S,w){return zn="useOptimistic",a(),Eo(),X3(S,w)},useMemoCache:function(S){return a(),U3(S)},useHostTransitionStatus:z5,useCacheRefresh:function(){return zn="useCacheRefresh",Eo(),zc().memoizedState},useEffectEvent:function(S){return zn="useEffectEvent",a(),Eo(),$3(S)}};var r2t={},i2t=new Set,s2t=new Set,a2t=new Set,c2t=new Set,l2t=new Set,h2t=new Set,d2t=new Set,u2t=new Set,p2t=new Set,m2t=new Set;Object.freeze(r2t);var KTe={enqueueSetState:function(S,w,Q){S=S._reactInternals;var W=Xp(S),oe=Fc(W);oe.payload=w,Q!==void 0&&Q!==null&&(cD(Q),oe.callback=Q),w=V3(S,oe,W),w!==null&&(ZA(W,"this.setState()",S),Id(w,S,W),dE(w,S,W))},enqueueReplaceState:function(S,w,Q){S=S._reactInternals;var W=Xp(S),oe=Fc(W);oe.tag=$ft,oe.payload=w,Q!==void 0&&Q!==null&&(cD(Q),oe.callback=Q),w=V3(S,oe,W),w!==null&&(ZA(W,"this.replaceState()",S),Id(w,S,W),dE(w,S,W))},enqueueForceUpdate:function(S,w){S=S._reactInternals;var Q=Xp(S),W=Fc(Q);W.tag=qft,w!==void 0&&w!==null&&(cD(w),W.callback=w),w=V3(S,W,Q),w!==null&&(ZA(Q,"this.forceUpdate()",S),Id(w,S,Q),dE(w,S,Q))}},DW=null,$Te=null,qTe=Error("This is not a real error. It's an implementation detail of React's selective hydration feature. If this leaks into userspace, it's a bug in React. Please file an issue."),im=!1,_2t={},g2t={},A2t={},f2t={},NW=!1,y2t={},JTe={},x2t={},ZTe={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null},C2t=!1,b2t=null;b2t=new Set;var sge=!1,l4=null,H8=null,cx=0,age=new Map,I2t={},Eoe=0,eDe=1,cge=2,Zg=!1,_h=!1,F8=!1,tDe=!1,v2t=typeof WeakSet==="function"?WeakSet:Set,eA=null,RW=null,QW=null,z8=!1,Moe=!1,lge=!1,nDe=!1,Xm=null,lx=!1,vI=null,$_=!1,fF=8192,Bfo={getCacheForType:function(S){var w=Kc(Um),Q=w.data.get(S);return Q===void 0&&(Q=S(),w.data.set(S,Q)),Q},cacheSignal:function(){return Kc(Um).controller.signal},getOwner:function(){return K_}};if(typeof Symbol==="function"&&Symbol.for){var woe=Symbol.for;woe("selector.component"),woe("selector.has_pseudo_class"),woe("selector.role"),woe("selector.test_id"),woe("selector.text")}var Tfo=[],Dfo=typeof WeakMap==="function"?WeakMap:Map,tA=0,q_=2,h4=4,rM=0,Boe=1,yF=2,hge=3,cN=4,Toe=6,S2t=5,Vc=tA,$h=null,Qa=null,na=0,hx=0,dge=1,xF=2,Doe=3,P2t=4,oDe=5,Noe=6,uge=7,rDe=8,CF=9,gh=hx,d4=null,iM=!1,kW=!1,iDe=!1,O8=0,l0=rM,lN=0,hN=0,pge=0,dx=0,bF=0,Roe=null,H1=null,mge=!1,_ge=0,E2t=0,M2t=300,gge=1/0,w2t=500,Qoe=null,V0=null,dN=null,Age=0,koe=1,sDe=2,B2t=3,V8=0,T2t=1,D2t=2,aDe=3,cDe=4,fge=5,h0=0,SI=null,IF=null,ux=0,lDe=0,yge=-0,hDe=null,N2t=null,LW=null,HW=null,FW=null,xge=null,u4=Age,dDe=null,Nfo=50,Loe=0,Cge=null,uDe=!1,bge=!1,Rfo=50,vF=0,Hoe=null,zW=!1,R2t=!1,Ige=null,Q2t=!1,k2t=new Set,Qfo={},OW=null,VW=null,pDe=!1,mDe=!1,vge=!1,_De=!1,uN=0,gDe={};(function(){for(var S=0;S<bTe.length;S++){var w=bTe[S],Q=w.toLowerCase();w=w[0].toUpperCase()+w.slice(1),Vp(Q,"on"+w)}Vp(mft,"onAnimationEnd"),Vp(_ft,"onAnimationIteration"),Vp(gft,"onAnimationStart"),Vp("dblclick","onDoubleClick"),Vp("focusin","onFocus"),Vp("focusout","onBlur"),Vp(hfo,"onTransitionRun"),Vp(dfo,"onTransitionStart"),Vp(ufo,"onTransitionCancel"),Vp(Aft,"onTransitionEnd")})(),bo("onMouseEnter",["mouseout","mouseover"]),bo("onMouseLeave",["mouseout","mouseover"]),bo("onPointerEnter",["pointerout","pointerover"]),bo("onPointerLeave",["pointerout","pointerover"]),Zn("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Zn("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Zn("onBeforeInput",["compositionend","keypress","textInput","paste"]),Zn("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Zn("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Zn("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Foe="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),ADe=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Foe)),Sge="_reactListening"+Math.random().toString(36).slice(2),L2t=!1,H2t=!1,Pge=!1,F2t=!1,Ege=!1,Mge=!1,z2t=!1,wge={},kfo=/\r\n?/g,Lfo=/\u0000|\uFFFD/g,SF="http://www.w3.org/1999/xlink",fDe="http://www.w3.org/XML/1998/namespace",Hfo={},Ffo="javascript:throw new Error('React form unexpectedly submitted.')",zfo="suppressHydrationWarning",PF="&",Bge="/&",zoe="$",Ooe="/$",pN="$?",EF="$~",YW="$!",Ofo="html",Vfo="body",Yfo="head",yDe="F!",O2t="F",V2t="loading",Y2t="style",sM=0,GW=1,Tge=2,xDe=null,CDe=null,G2t=!1,U2t={dialog:!0,webview:!0},bDe=null,Voe=void 0,IDe=typeof setTimeout==="function"?setTimeout:void 0,Gfo=typeof clearTimeout==="function"?clearTimeout:void 0,MF=-1,W2t=typeof Promise==="function"?Promise:void 0,X2t=typeof requestAnimationFrame==="function"?requestAnimationFrame:IDe,Ufo=typeof queueMicrotask==="function"?queueMicrotask:typeof W2t<"u"?function(S){return W2t.resolve(null).then(S).catch(c8)}:IDe,Wfo=500;$p.prototype.animate=function(S,w){return w=typeof w==="number"?{duration:w}:ta({},w),w.pseudoElement=this._selector,this._scope.animate(S,w)},$p.prototype.getAnimations=function(){for(var S=this._scope,w=this._selector,Q=S.getAnimations({subtree:!0}),W=[],oe=0;oe<Q.length;oe++){var ae=Q[oe].effect;ae!==null&&ae.target===S&&ae.pseudoElement===w&&W.push(Q[oe])}return W},$p.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)},Eh.prototype.addEventListener=function(S,w,Q){var W=null,oe=null;if(Q!=null&&typeof Q!=="boolean"&&(W=Q.signal||null,W!==null&&W.aborted))return;this._eventListeners===null&&(this._eventListeners=[]);var ae=this._eventListeners;if(K5(ae,S,w,Q)===-1){var De=this,ke=w;Q!=null&&typeof Q!=="boolean"&&Q.once===!0&&(ke=function(ot){De.removeEventListener(S,w,Q),typeof w==="function"?w.call(this,ot):w.handleEvent(ot)}),W!==null&&(oe=De.removeEventListener.bind(De,S,w,Q),W.addEventListener("abort",oe,{once:!0}),oe=W.removeEventListener.bind(W,"abort",oe)),W=hh(Q),ae.push({type:S,listener:w,optionsOrUseCapture:Q,attachedListener:ke,cleanup:oe}),I(this._fragmentFiber,qp,S,ke,W)}this._eventListeners=ae},Eh.prototype.removeEventListener=function(S,w,Q){var W=this._eventListeners;if(W!==null&&(w=K5(W,S,w,Q),w!==-1)){var oe=W[w];Q=oe.attachedListener;var ae=oe.cleanup;oe=hh(oe.optionsOrUseCapture),I(this._fragmentFiber,F0,S,Q,oe),W.splice(w,1),ae!==null&&ae()}},Eh.prototype.dispatchEvent=function(S){var w=P(this._fragmentFiber);if(w===null)return!0;w=N(w);var Q=this._eventListeners;if(Q!==null&&0<Q.length||!S.bubbles){var W=w.nodeType===9?w.createComment(""):document.createTextNode("");if(Q)for(var oe=0;oe<Q.length;oe++){var ae=Q[oe];W.addEventListener(ae.type,ae.attachedListener,hh(ae.optionsOrUseCapture))}if(w.appendChild(W),S=W.dispatchEvent(S),Q)for(oe=0;oe<Q.length;oe++)ae=Q[oe],W.removeEventListener(ae.type,ae.attachedListener,hh(ae.optionsOrUseCapture));return w.removeChild(W),S}return w.dispatchEvent(S)},Eh.prototype.focus=function(S){v(this._fragmentFiber.child,!0,LE,S,void 0,void 0)},Eh.prototype.focusLast=function(S){var w=[];v(this._fragmentFiber.child,!0,HE,w,void 0,void 0);for(var Q=w.length-1;0<=Q&&!LE(w[Q],S);Q--);},Eh.prototype.blur=function(){var S=P(this._fragmentFiber);S!==null&&(S=N(S),S=lh(S).activeElement,S!==null&&I(this._fragmentFiber,jH,S))},Eh.prototype.observeUsing=function(S){var w=!1,Q=!1;I(this._fragmentFiber,function(W){if(W.tag===6)w=!0;else return Q=!0;return!1}),w&&!Q&&console.error("observeUsing() was called on a FragmentInstance with only text children. Observers do not work on text nodes."),this._observers===null&&(this._observers=new Set),this._observers.add(S),I(this._fragmentFiber,FE,S)},Eh.prototype.unobserveUsing=function(S){var w=this._observers;if(w!==null&&w.has(S)){w.delete(S),I(this._fragmentFiber,KH,S);for(var Q=w=0;Q<PI.length;Q++){var W=PI[Q];W.fragmentInstance===this&&W.observer===S?S.unobserve(W.instance):PI[w++]=W}PI.length=w}else console.error("You are calling unobserveUsing() with an observer that is not being observed with this fragment instance. First attach the observer with observeUsing()")};var PI=[],vDe=!1;Eh.prototype.getClientRects=function(){var S=[];return I(this._fragmentFiber,$H,S),S},Eh.prototype.getRootNode=function(S){var w=P(this._fragmentFiber);return w===null?this:N(w).getRootNode(S)},Eh.prototype.compareDocumentPosition=function(S){var w=P(this._fragmentFiber);if(w===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var Q=[];I(this._fragmentFiber,HE,Q);var W=N(w);if(Q.length===0){if(w=W,M(this._fragmentFiber)){e:{for(Q=this._fragmentFiber.return;Q!==null;){if(Q.tag===4){Q=Q.stateNode.containerInfo;break e}if(Q.tag===3||Q.tag===5||Q.tag===27)break;Q=Q.return}Q=null}Q!=null&&(w=Q)}Q=this._fragmentFiber;var oe=W=w.compareDocumentPosition(S);return w===S?oe=Node.DOCUMENT_POSITION_CONTAINS:W&Node.DOCUMENT_POSITION_CONTAINED_BY&&(Q=B(Q)[1],Q===null?oe=Node.DOCUMENT_POSITION_PRECEDING:(S=N(Q).compareDocumentPosition(S),oe=S===0||S&Node.DOCUMENT_POSITION_FOLLOWING?Node.DOCUMENT_POSITION_FOLLOWING:Node.DOCUMENT_POSITION_PRECEDING)),oe|=Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC}w=N(Q[0]),oe=N(Q[Q.length-1]);var ae=M(this._fragmentFiber)?w.parentElement:W;if(ae==null)return Node.DOCUMENT_POSITION_DISCONNECTED;W=ae.compareDocumentPosition(w)&Node.DOCUMENT_POSITION_CONTAINED_BY,ae=ae.compareDocumentPosition(oe)&Node.DOCUMENT_POSITION_CONTAINED_BY;var De=w.compareDocumentPosition(S),ke=oe.compareDocumentPosition(S),ot=De&Node.DOCUMENT_POSITION_CONTAINED_BY||ke&Node.DOCUMENT_POSITION_CONTAINED_BY;return ke=W&&ae&&De&Node.DOCUMENT_POSITION_FOLLOWING&&ke&Node.DOCUMENT_POSITION_PRECEDING,w=W&&w===S||ae&&oe===S||ot||ke?Node.DOCUMENT_POSITION_CONTAINED_BY:!W&&w===S||!ae&&oe===S?Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:De,w&Node.DOCUMENT_POSITION_DISCONNECTED||w&Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC||qH(w,this._fragmentFiber,Q[0],Q[Q.length-1],S)?w:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC},Eh.prototype.scrollIntoView=function(S){if(typeof S==="object")throw Error("FragmentInstance.scrollIntoView() does not support scrollIntoViewOptions. Use the alignToTop boolean instead.");var w=[];I(this._fragmentFiber,HE,w);var Q=S!==!1;if(w.length===0){var W=B(this._fragmentFiber);if(W=Q?W[1]||W[0]||P(this._fragmentFiber):W[0]||W[1],W===null)return;if(W.tag===6){S=N(W),QD(S,Q);return}if(W=N(W),W.nodeType!==9){if(W.nodeType===11){Q="host"in W?W.host:null,Q!==null?Q.scrollIntoView(S):console.warn("You are attempting to scroll a FragmentInstance that is only mounted inside a detached DocumentFragment. No scroll was performed.");return}W.scrollIntoView(S)}}for(W=Q?w.length-1:0;W!==(Q?-1:w.length);){var oe=w[W];oe.tag===6?(oe=N(oe),QD(oe,Q)):N(oe).scrollIntoView(S),W+=Q?-1:1}};var SDe=null,wF=0,Yoe=1,j2t=2,K2t=3,RC=4,QC=new Map,$2t=new Set,aM=Dc.d;Dc.d={f:function(){var S=aM.f(),w=W6();return S||w},r:function(S){var w=_n(S);w!==null&&w.tag===5&&w.type==="form"?gH(w):aM.r(S)},D:function(S){aM.D(S),LD("dns-prefetch",S,null)},C:function(S,w){aM.C(S,w),LD("preconnect",S,w)},L:function(S,w,Q){aM.L(S,w,Q);var W=UW;if(W&&S&&w){var oe='link[rel="preload"][as="'+qn(w)+'"]';w==="image"?Q&&Q.imageSrcSet?(oe+='[imagesrcset="'+qn(Q.imageSrcSet)+'"]',typeof Q.imageSizes==="string"&&(oe+='[imagesizes="'+qn(Q.imageSizes)+'"]')):oe+='[href="'+qn(S)+'"]':oe+='[href="'+qn(S)+'"]';var ae=oe;switch(w){case"style":ae=z0(S);break;case"script":ae=G(S)}if(!(QC.has(ae)||(S=ta({rel:"preload",href:w==="image"&&Q&&Q.imageSrcSet?void 0:S,as:w},Q),QC.set(ae,S),W.querySelector(oe)!==null||w==="style"&&W.querySelector(qd(ae))||w==="script"&&W.querySelector(le(ae))))){var De=W.createElement("link");hp(De,"link",S),w==="style"&&(De[gI]=!0,De.onload=De.onerror=function(){hn(De)}),ln(De),W.head.appendChild(De)}}},m:function(S,w){aM.m(S,w);var Q=UW;if(Q&&S){var W=w&&typeof w.as==="string"?w.as:"script",oe='link[rel="modulepreload"][as="'+qn(W)+'"][href="'+qn(S)+'"]',ae=oe;switch(W){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":ae=G(S)}if(!QC.has(ae)&&(S=ta({rel:"modulepreload",href:S},w),QC.set(ae,S),Q.querySelector(oe)===null)){switch(W){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(Q.querySelector(le(ae)))return}W=Q.createElement("link"),hp(W,"link",S),ln(W),Q.head.appendChild(W)}}},X:function(S,w){aM.X(S,w);var Q=UW;if(Q&&S){var W=Qn(Q).hoistableScripts,oe=G(S),ae=W.get(oe);ae||(ae=Q.querySelector(le(oe)),ae||(S=ta({src:S,async:!0},w),(w=QC.get(oe))&&yt(S,w),ae=Q.createElement("script"),ln(ae),hp(ae,"link",S),Q.head.appendChild(ae)),ae={type:"script",instance:ae,count:1,state:null},W.set(oe,ae))}},S:function(S,w,Q){aM.S(S,w,Q);var W=UW;if(W&&S){var oe=Qn(W).hoistableStyles,ae=z0(S);w=w||"default";var De=oe.get(ae);if(!De){var ke={loading:wF,preload:null};if(De=W.querySelector(qd(ae)))ke.loading=Yoe|RC;else{S=ta({rel:"stylesheet",href:S,"data-precedence":w},Q),(Q=QC.get(ae))&&et(S,Q);var ot=De=W.createElement("link");ln(ot),hp(ot,"link",S),ot._p=new Promise(function(_t,zt){ot.onload=_t,ot.onerror=zt}),ot.addEventListener("load",function(){ke.loading|=Yoe}),ot.addEventListener("error",function(){ke.loading|=j2t}),ke.loading|=RC,ze(De,w,W)}De={type:"stylesheet",instance:De,count:1,state:ke},oe.set(ae,De)}}},M:function(S,w){aM.M(S,w);var Q=UW;if(Q&&S){var W=Qn(Q).hoistableScripts,oe=G(S),ae=W.get(oe);ae||(ae=Q.querySelector(le(oe)),ae||(S=ta({src:S,async:!0,type:"module"},w),(w=QC.get(oe))&&yt(S,w),ae=Q.createElement("script"),ln(ae),hp(ae,"link",S),Q.head.appendChild(ae)),ae={type:"script",instance:ae,count:1,state:null},W.set(oe,ae))}}};var UW=typeof document>"u"?null:document,Dge=null,Xfo=60000,jfo=800,Kfo=500,Nge=0,PDe=null,Rge=null,BF=eF,WW={$$typeof:fl,Provider:null,Consumer:null,_currentValue:BF,_currentValue2:BF,_threadCount:0},q2t="%c%s%c",J2t="background: #e6e6e6;background: light-dark(rgba(0,0,0,0.1), rgba(255,255,255,0.25));color: #000000;color: light-dark(#000000, #ffffff);border-radius: 2px",Z2t="",Qge=" ",$fo=Function.prototype.bind,e1t=!1,t1t=null,n1t=null,o1t=null,r1t=null,i1t=null,s1t=null,a1t=null,c1t=null,l1t=null,h1t=null;t1t=function(S,w,Q,W){w=e(S,w),w!==null&&(Q=t(w.memoizedState,Q,0,W),w.memoizedState=Q,w.baseState=Q,S.memoizedProps=ta({},S.memoizedProps),Q=Nn(S,2),Q!==null&&Id(Q,S,2))},n1t=function(S,w,Q){w=e(S,w),w!==null&&(Q=r(w.memoizedState,Q,0),w.memoizedState=Q,w.baseState=Q,S.memoizedProps=ta({},S.memoizedProps),Q=Nn(S,2),Q!==null&&Id(Q,S,2))},o1t=function(S,w,Q,W){w=e(S,w),w!==null&&(Q=n(w.memoizedState,Q,W),w.memoizedState=Q,w.baseState=Q,S.memoizedProps=ta({},S.memoizedProps),Q=Nn(S,2),Q!==null&&Id(Q,S,2))},r1t=function(S,w,Q){S.pendingProps=t(S.memoizedProps,w,0,Q),S.alternate&&(S.alternate.pendingProps=S.pendingProps),w=Nn(S,2),w!==null&&Id(w,S,2)},i1t=function(S,w){S.pendingProps=r(S.memoizedProps,w,0),S.alternate&&(S.alternate.pendingProps=S.pendingProps),w=Nn(S,2),w!==null&&Id(w,S,2)},s1t=function(S,w,Q){S.pendingProps=n(S.memoizedProps,w,Q),S.alternate&&(S.alternate.pendingProps=S.pendingProps),w=Nn(S,2),w!==null&&Id(w,S,2)},a1t=function(S){var w=Nn(S,2);w!==null&&Id(w,S,2)},c1t=function(S){var w=Ze(),Q=Nn(S,w);Q!==null&&Id(Q,S,w)},l1t=function(S){s=S},h1t=function(S){i=S};var XW=!0,kge=null,EDe=!1,mN=null,_N=null,gN=null,Goe=new Map,Uoe=new Map,AN=[],qfo="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" "),Lge=null;if(Al.prototype.render=D1.prototype.render=function(S){var w=this._internalRoot;if(w===null)throw Error("Cannot update an unmounted root.");var Q=arguments;typeof Q[1]==="function"?console.error("does not support the second callback argument. To execute a side effect after rendering, declare it in a component body with useEffect()."):A(Q[1])?console.error("You passed a container to the second argument of root.render(...). You don't need to pass it again since you already passed it to create the root."):typeof Q[1]<"u"&&console.error("You passed a second argument to root.render(...) but it only accepts one argument."),Q=S;var W=w.current,oe=Xp(W);AC(W,oe,Q,w,null,null)},Al.prototype.unmount=D1.prototype.unmount=function(){var S=arguments;if(typeof S[0]==="function"&&console.error("does not support a callback argument. To execute a side effect after rendering, declare it in a component body with useEffect()."),S=this._internalRoot,S!==null){this._internalRoot=null;var w=S.containerInfo;(Vc&(q_|h4))!==tA&&console.error("Attempted to synchronously unmount a root while React was already rendering. React cannot finish unmounting the root until the current render has completed, which may lead to a race condition."),AC(S.current,2,null,S,null,null),W6(),w[_I]=null}},Al.prototype.unstable_scheduleHydration=function(S){if(S){var w=Nt();S={blockedOn:null,target:S,priority:w};for(var Q=0;Q<AN.length&&w!==0&&w<AN[Q].priority;Q++);AN.splice(Q,0,S),Q===0&&zD(S)}},function(){var S=qW.version;if(S!=="19.3.1")throw Error(`Incompatible React versions: The "react" and "react-dom" packages must have the exact same version. Instead got:
  - react:      `+(S+`
  - react-dom:  19.3.1
Learn more: https://react.dev/warnings/version-mismatch`))}(),typeof Map==="function"&&Map.prototype!=null&&typeof Map.prototype.forEach==="function"&&typeof Set==="function"&&Set.prototype!=null&&typeof Set.prototype.clear==="function"&&typeof Set.prototype.forEach==="function"||console.error("React depends on Map and Set built-in types. Make sure that you load a polyfill in older browsers. https://react.dev/link/react-polyfills"),Dc.findDOMNode=function(S){var w=S._reactInternals;if(w===void 0){if(typeof S.render==="function")throw Error("Unable to find node on an unmounted component.");throw S=Object.keys(S).join(","),Error("Argument appears to not be a ReactComponent. Keys: "+S)}return S=C(w),S=S!==null?b(S):null,S=S===null?null:S.stateNode,S},!function(){var S={bundleType:1,version:"19.3.1",rendererPackageName:"react-dom",currentDispatcherRef:Vn,reconcilerVersion:"19.3.1"};return S.overrideHookState=t1t,S.overrideHookStateDeletePath=n1t,S.overrideHookStateRenamePath=o1t,S.overrideProps=r1t,S.overridePropsDeletePath=i1t,S.overridePropsRenamePath=s1t,S.scheduleUpdate=a1t,S.scheduleRetry=c1t,S.setErrorHandler=l1t,S.setSuspenseHandler=h1t,S.scheduleRefresh=p,S.scheduleRoot=_,S.setRefreshHandler=m,S.getCurrentFiber=fC,ct(S)}()&&js&&window.top===window.self&&(-1<navigator.userAgent.indexOf("Chrome")&&navigator.userAgent.indexOf("Edge")===-1||-1<navigator.userAgent.indexOf("Firefox"))){var d1t=window.location.protocol;/^(https?|file):$/.test(d1t)&&console.info("%cDownload the React DevTools for a better development experience: https://react.dev/link/react-devtools"+(d1t==="file:"?`
You might need to use a local HTTP server (instead of file://): https://react.dev/link/react-devtools-faq`:""),"font-weight:bold")}h2o.createRoot=function(S,w){if(!A(S))throw Error("Target container is not a DOM element.");e4(S);var Q=!1,W="",oe=Z3,ae=eC,De=hD;return w!==null&&w!==void 0&&(w.hydrate?console.warn("hydrate through createRoot is deprecated. Use ReactDOMClient.hydrateRoot(container, <App />) instead."):typeof w==="object"&&w!==null&&w.$$typeof===n4&&console.error(`You passed a JSX element to createRoot. You probably meant to call root.render instead. Example usage:

  let root = createRoot(domContainer);
  root.render(<App />);`),w.unstable_strictMode===!0&&(Q=!0),w.identifierPrefix!==void 0&&(W=w.identifierPrefix),w.onUncaughtError!==void 0&&(oe=w.onUncaughtError),w.onCaughtError!==void 0&&(ae=w.onCaughtError),w.onRecoverableError!==void 0&&(De=w.onRecoverableError)),w=Ul(S,1,!1,null,null,Q,W,null,oe,ae,De,p2),S[_I]=w.current,M1(S),new D1(w)},h2o.hydrateRoot=function(S,w,Q){if(!A(S))throw Error("Target container is not a DOM element.");e4(S),w===void 0&&console.error("Must provide initial children as second argument to hydrateRoot. Example usage: hydrateRoot(domContainer, <App />)");var W=!1,oe="",ae=Z3,De=eC,ke=hD,ot=null;return Q!==null&&Q!==void 0&&(Q.unstable_strictMode===!0&&(W=!0),Q.identifierPrefix!==void 0&&(oe=Q.identifierPrefix),Q.onUncaughtError!==void 0&&(ae=Q.onUncaughtError),Q.onCaughtError!==void 0&&(De=Q.onCaughtError),Q.onRecoverableError!==void 0&&(ke=Q.onRecoverableError),Q.formState!==void 0&&(ot=Q.formState)),w=Ul(S,1,!0,w,Q!=null?Q:null,W,oe,ot,ae,De,ke,p2),w.context=dp(null),Q=w.current,W=Xp(Q),W=Ye(W),oe=Fc(W),oe.callback=null,V3(Q,oe,W),ZA(W,"hydrateRoot()",null),Q=W,w.current.lanes=Q,tt(w,Q),h2(w),S[_I]=w.current,M1(S),new Al(w)},h2o.version="19.3.1",typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop==="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()});var g1t=lt(function(d2o,zge){zge.exports=Qe(_1t())});function f1t(e){return A1t.get(e)}function p2o(e){for(let t of Object.values(y1t)){if(e in t.variants)return{baseUnit:t.baseUnit,conversionFactor:t.variants[e]};for(let[n,o]of Object.entries(t.variants)){if(!e.endsWith(n))continue;let r=e.slice(0,-n.length),i=f1t(r);if(i==null)continue;return{baseUnit:t.baseUnit,conversionFactor:i*o}}}return{baseUnit:e,conversionFactor:1}}function Aa(e,t){if(e===void 0||e===null)return{parsedUnit:null,unitOfValue:null,value:null};if(typeof e==="string"&&e.match(/^-?[\d.]+$/))return{value:Number.parseFloat(e),parsedUnit:null,unitOfValue:null};if(typeof e==="number")return{value:e,parsedUnit:null,unitOfValue:null};if(typeof e==="object"&&"x"in e&&"y"in e){let l=Aa(e.x,t),h=Aa(e.x,t),d=Aa(e.y,t);if(h.value===null||d.value===null)return{parsedUnit:null,unitOfValue:null,value:null};return{parsedUnit:l.parsedUnit,unitOfValue:l.unitOfValue,value:{x:h.value,y:d.value}}}let o=e.toString().split("").reverse().join("").match(/[^\d\s]+/)?.[0];if(!o)throw Error(`Could not determine unit: "${e}"`);let r=o.split("").reverse().join(""),i=e.slice(0,-r.length),s=f1t(r);if(t&&s!=null)return{parsedUnit:null,unitOfValue:t,value:Number.parseFloat(i)*s};if(s!=null&&!TDe.has(r))return{parsedUnit:null,unitOfValue:null,value:Number.parseFloat(i)*s};let{baseUnit:a,conversionFactor:c}=p2o(r);return{parsedUnit:r,unitOfValue:a,value:c*Number.parseFloat(i)}}function qh(e){if(e==null)return"";if(e===0)return"0";let t=Math.abs(e),n=JW.findIndex((s)=>{let a=t/s.value;return a>=1&&a<1000});if(n===-1)n=JW.indexOf(_2o);let o=JW[n],r=e/o.value;while(n>0&&Math.abs(Number(r.toPrecision(3)))>=1000)n-=1,o=JW[n],r=e/o.value;let i=r.toPrecision(3);if(i.includes(".")&&!/\.0+$/.test(i))i=i.replace(/0+$/,"");return i=i.replace(/\.0+$/,""),`${i}${o.symbol}`}var Yc=(e)=>{let t=Math.round(e*1000)/1000;return`${Number(t.toFixed(3))}mm`},A1t,u2o,y1t,TDe,m2o,Fus,JW,_2o;var Y0=El(()=>{A1t=new Map([["T",1000000000000],["G",1e9],["M",1e6],["K",1000],["k",1000],["",1],["m",0.001],["µ",0.000001],["μ",0.000001],["u",0.000001],["n",0.000000001],["p",0.000000000001],["f",0.000000000000001]]),u2o=[...A1t.keys()];y1t={Hz:{baseUnit:"Hz",variants:{MHz:1e6,kHz:1000,Hz:1}},g:{baseUnit:"g",variants:{kg:1000,g:1}},Ω:{baseUnit:"Ω",variants:{mΩ:0.001,mohm:0.001,mOhm:0.001,milliohm:0.001,Ω:1,ohm:1,Ohm:1,kΩ:1000,KΩ:1000,kohm:1000,kOhm:1000,KOhm:1000,Kohm:1000,MΩ:1e6,Mohm:1e6,MOhm:1e6,megohm:1e6,Megohm:1e6,GΩ:1e9,Gohm:1e9,GOhm:1e9,TΩ:1000000000000,Tohm:1000000000000,TOhm:1000000000000}},V:{baseUnit:"V",variants:{mV:0.001,V:1,kV:1000,KV:1000,MV:1e6,GV:1e9,TV:1000000000000}},A:{baseUnit:"A",variants:{µA:0.000001,μA:0.000001,mA:0.001,ma:0.001,A:1,kA:1000,MA:1e6}},F:{baseUnit:"F",variants:{pF:0.000000000001,nF:0.000000001,µF:0.000001,μF:0.000001,uF:0.000001,mF:0.001,F:1,kF:1000,KF:1000,MF:1e6}},H:{baseUnit:"H",variants:{pH:0.000000000001,nH:0.000000001,µH:0.000001,μH:0.000001,uH:0.000001,mH:0.001,H:1,kH:1000,KH:1000,MH:1e6}},ml:{baseUnit:"ml",variants:{ml:1,mL:1,l:1000,L:1000}},deg:{baseUnit:"deg",variants:{rad:180/Math.PI}},ms:{baseUnit:"ms",variants:{fs:0.000000000001,ps:0.000000001,ns:0.000001,us:0.001,µs:0.001,μs:0.001,ms:1,s:1000}},mm:{baseUnit:"mm",variants:{nm:0.000001,µm:0.001,μm:0.001,um:0.001,mm:1,cm:10,dm:100,m:1000,km:1e6,in:25.4,ft:304.8,IN:25.4,FT:304.8,yd:914.4,mi:1609344,mil:0.0254}}},TDe=new Set;for(let[e,t]of Object.entries(y1t)){TDe.add(e);for(let n of Object.keys(t.variants))TDe.add(n)}m2o=u2o.filter((e)=>e!=="").sort((e,t)=>t.length-e.length).map((e)=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|"),Fus=new RegExp(`^([+-]?(?:\\d+(?:\\.\\d*)?|\\.\\d+)(?:[eE][+-]?\\d+)?)(?:(${m2o}))?$`),JW=[{value:1000000000000,symbol:"T"},{value:1e9,symbol:"G"},{value:1e6,symbol:"M"},{value:1000,symbol:"k"},{value:1,symbol:""},{value:0.001,symbol:"m"},{value:0.000001,symbol:"µ"},{value:0.000000001,symbol:"n"},{value:0.000000000001,symbol:"p"}],_2o=JW[JW.length-1]});var Rc,x1t,Lr,lM=(e)=>{switch(typeof e){case"undefined":return Lr.undefined;case"string":return Lr.string;case"number":return Number.isNaN(e)?Lr.nan:Lr.number;case"boolean":return Lr.boolean;case"function":return Lr.function;case"bigint":return Lr.bigint;case"symbol":return Lr.symbol;case"object":if(Array.isArray(e))return Lr.array;if(e===null)return Lr.null;if(e.then&&typeof e.then==="function"&&e.catch&&typeof e.catch==="function")return Lr.promise;if(typeof Map<"u"&&e instanceof Map)return Lr.map;if(typeof Set<"u"&&e instanceof Set)return Lr.set;if(typeof Date<"u"&&e instanceof Date)return Lr.date;return Lr.object;default:return Lr.unknown}};var Woe=El(()=>{(function(e){e.assertEqual=(r)=>{};function t(r){}e.assertIs=t;function n(r){throw Error()}e.assertNever=n,e.arrayToEnum=(r)=>{let i={};for(let s of r)i[s]=s;return i},e.getValidEnumValues=(r)=>{let i=e.objectKeys(r).filter((a)=>typeof r[r[a]]!=="number"),s={};for(let a of i)s[a]=r[a];return e.objectValues(s)},e.objectValues=(r)=>e.objectKeys(r).map(function(i){return r[i]}),e.objectKeys=typeof Object.keys==="function"?(r)=>Object.keys(r):(r)=>{let i=[];for(let s in r)if(Object.prototype.hasOwnProperty.call(r,s))i.push(s);return i},e.find=(r,i)=>{for(let s of r)if(i(s))return s;return},e.isInteger=typeof Number.isInteger==="function"?(r)=>Number.isInteger(r):(r)=>typeof r==="number"&&Number.isFinite(r)&&Math.floor(r)===r;function o(r,i=" | "){return r.map((s)=>typeof s==="string"?`'${s}'`:s).join(i)}e.joinValues=o,e.jsonStringifyReplacer=(r,i)=>{if(typeof i==="bigint")return i.toString();return i}})(Rc||(Rc={}));(function(e){e.mergeShapes=(t,n)=>({...t,...n})})(x1t||(x1t={}));Lr=Rc.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"])});var Vt,F1;var Oge=El(()=>{Woe();Vt=Rc.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);F1=class F1 extends Error{get errors(){return this.issues}constructor(e){super();this.issues=[],this.addIssue=(n)=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};let t=new.target.prototype;if(Object.setPrototypeOf)Object.setPrototypeOf(this,t);else this.__proto__=t;this.name="ZodError",this.issues=e}format(e){let t=e||function(r){return r.message},n={_errors:[]},o=(r)=>{for(let i of r.issues)if(i.code==="invalid_union")i.unionErrors.map(o);else if(i.code==="invalid_return_type")o(i.returnTypeError);else if(i.code==="invalid_arguments")o(i.argumentsError);else if(i.path.length===0)n._errors.push(t(i));else{let s=n,a=0;while(a<i.path.length){let c=i.path[a];if(a!==i.path.length-1)s[c]=s[c]||{_errors:[]};else s[c]=s[c]||{_errors:[]},s[c]._errors.push(t(i));s=s[c],a++}}};return o(this),n}static assert(e){if(!(e instanceof F1))throw Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Rc.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=(t)=>t.message){let t={},n=[];for(let o of this.issues)if(o.path.length>0){let r=o.path[0];t[r]=t[r]||[],t[r].push(e(o))}else n.push(e(o));return{formErrors:n,fieldErrors:t}}get formErrors(){return this.flatten()}};F1.create=(e)=>new F1(e)});var g2o=(e,t)=>{let n;switch(e.code){case Vt.invalid_type:if(e.received===Lr.undefined)n="Required";else n=`Expected ${e.expected}, received ${e.received}`;break;case Vt.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,Rc.jsonStringifyReplacer)}`;break;case Vt.unrecognized_keys:n=`Unrecognized key(s) in object: ${Rc.joinValues(e.keys,", ")}`;break;case Vt.invalid_union:n="Invalid input";break;case Vt.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${Rc.joinValues(e.options)}`;break;case Vt.invalid_enum_value:n=`Invalid enum value. Expected ${Rc.joinValues(e.options)}, received '${e.received}'`;break;case Vt.invalid_arguments:n="Invalid function arguments";break;case Vt.invalid_return_type:n="Invalid function return type";break;case Vt.invalid_date:n="Invalid date";break;case Vt.invalid_string:if(typeof e.validation==="object")if("includes"in e.validation){if(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position==="number")n=`${n} at one or more positions greater than or equal to ${e.validation.position}`}else if("startsWith"in e.validation)n=`Invalid input: must start with "${e.validation.startsWith}"`;else if("endsWith"in e.validation)n=`Invalid input: must end with "${e.validation.endsWith}"`;else Rc.assertNever(e.validation);else if(e.validation!=="regex")n=`Invalid ${e.validation}`;else n="Invalid";break;case Vt.too_small:if(e.type==="array")n=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`;else if(e.type==="string")n=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`;else if(e.type==="number")n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`;else if(e.type==="bigint")n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`;else if(e.type==="date")n=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`;else n="Invalid input";break;case Vt.too_big:if(e.type==="array")n=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`;else if(e.type==="string")n=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`;else if(e.type==="number")n=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`;else if(e.type==="bigint")n=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`;else if(e.type==="date")n=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`;else n="Invalid input";break;case Vt.custom:n="Invalid input";break;case Vt.invalid_intersection_types:n="Intersection results could not be merged";break;case Vt.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case Vt.not_finite:n="Number must be finite";break;default:n=t.defaultError,Rc.assertNever(e)}return{message:n}},fN;var DDe=El(()=>{Oge();Woe();fN=g2o});function Xoe(){return A2o}var A2o;var Vge=El(()=>{DDe();A2o=fN});function br(e,t){let n=Xoe(),o=Yge({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===fN?void 0:fN].filter((r)=>!!r)});e.common.issues.push(o)}class x2{constructor(){this.value="valid"}dirty(){if(this.value==="valid")this.value="dirty"}abort(){if(this.value!=="aborted")this.value="aborted"}static mergeArray(e,t){let n=[];for(let o of t){if(o.status==="aborted")return is;if(o.status==="dirty")e.dirty();n.push(o.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,t){let n=[];for(let o of t){let r=await o.key,i=await o.value;n.push({key:r,value:i})}return x2.mergeObjectSync(e,n)}static mergeObjectSync(e,t){let n={};for(let o of t){let{key:r,value:i}=o;if(r.status==="aborted")return is;if(i.status==="aborted")return is;if(r.status==="dirty")e.dirty();if(i.status==="dirty")e.dirty();if(r.value!=="__proto__"&&(typeof i.value<"u"||o.alwaysSet))n[r.value]=i.value}return{status:e.value,value:n}}}var Yge=(e)=>{let{data:t,path:n,errorMaps:o,issueData:r}=e,i=[...n,...r.path||[]],s={...r,path:i};if(r.message!==void 0)return{...r,path:i,message:r.message};let a="",c=o.filter((l)=>!!l).slice().reverse();for(let l of c)a=l(s,{data:t,defaultError:a}).message;return{...r,path:i,message:a}},is,ZW=(e)=>({status:"dirty",value:e}),z1=(e)=>({status:"valid",value:e}),NDe=(e)=>e.status==="aborted",RDe=(e)=>e.status==="dirty",DF=(e)=>e.status==="valid",joe=(e)=>typeof Promise<"u"&&e instanceof Promise;var QDe=El(()=>{Vge();DDe();is=Object.freeze({status:"aborted"})});var C1t=()=>{};var pi;var b1t=El(()=>{(function(e){e.errToObj=(t)=>typeof t==="string"?{message:t}:t||{},e.toString=(t)=>typeof t==="string"?t:t?.message})(pi||(pi={}))});class EI{constructor(e,t,n,o){this._cachedPath=[],this.parent=e,this.data=t,this._path=n,this._key=o}get path(){if(!this._cachedPath.length)if(Array.isArray(this._key))this._cachedPath.push(...this._path,...this._key);else this._cachedPath.push(...this._path,this._key);return this._cachedPath}}function Ea(e){if(!e)return{};let{errorMap:t,invalid_type_error:n,required_error:o,description:r}=e;if(t&&(n||o))throw Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);if(t)return{errorMap:t,description:r};return{errorMap:(s,a)=>{let{message:c}=e;if(s.code==="invalid_enum_value")return{message:c??a.defaultError};if(typeof a.data>"u")return{message:c??o??a.defaultError};if(s.code!=="invalid_type")return{message:a.defaultError};return{message:c??n??a.defaultError}},description:r}}class cc{get description(){return this._def.description}_getType(e){return lM(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:lM(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new x2,ctx:{common:e.parent.common,data:e.data,parsedType:lM(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let t=this._parse(e);if(joe(t))throw Error("Synchronous parse encountered promise.");return t}_parseAsync(e){let t=this._parse(e);return Promise.resolve(t)}parse(e,t){let n=this.safeParse(e,t);if(n.success)return n.data;throw n.error}safeParse(e,t){let n={common:{issues:[],async:t?.async??!1,contextualErrorMap:t?.errorMap},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:lM(e)},o=this._parseSync({data:e,path:n.path,parent:n});return I1t(n,o)}"~validate"(e){let t={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:lM(e)};if(!this["~standard"].async)try{let n=this._parseSync({data:e,path:[],parent:t});return DF(n)?{value:n.value}:{issues:t.common.issues}}catch(n){if(n?.message?.toLowerCase()?.includes("encountered"))this["~standard"].async=!0;t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then((n)=>DF(n)?{value:n.value}:{issues:t.common.issues})}async parseAsync(e,t){let n=await this.safeParseAsync(e,t);if(n.success)return n.data;throw n.error}async safeParseAsync(e,t){let n={common:{issues:[],contextualErrorMap:t?.errorMap,async:!0},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:lM(e)},o=this._parse({data:e,path:n.path,parent:n}),r=await(joe(o)?o:Promise.resolve(o));return I1t(n,r)}refine(e,t){let n=(o)=>{if(typeof t==="string"||typeof t>"u")return{message:t};else if(typeof t==="function")return t(o);else return t};return this._refinement((o,r)=>{let i=e(o),s=()=>r.addIssue({code:Vt.custom,...n(o)});if(typeof Promise<"u"&&i instanceof Promise)return i.then((a)=>{if(!a)return s(),!1;else return!0});if(!i)return s(),!1;else return!0})}refinement(e,t){return this._refinement((n,o)=>{if(!e(n))return o.addIssue(typeof t==="function"?t(n,o):t),!1;else return!0})}_refinement(e){return new X8({schema:this,typeName:Ps.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:(t)=>this["~validate"](t)}}optional(){return W8.create(this,this._def)}nullable(){return yN.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return U8.create(this)}promise(){return rX.create(this,this._def)}or(e){return Zoe.create([this,e],this._def)}and(e){return ere.create(this,e,this._def)}transform(e){return new X8({...Ea(this._def),schema:this,typeName:Ps.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let t=typeof e==="function"?e:()=>e;return new rre({...Ea(this._def),innerType:this,defaultValue:t,typeName:Ps.ZodDefault})}brand(){return new FDe({typeName:Ps.ZodBranded,type:this,...Ea(this._def)})}catch(e){let t=typeof e==="function"?e:()=>e;return new ire({...Ea(this._def),innerType:this,catchValue:t,typeName:Ps.ZodCatch})}describe(e){return new this.constructor({...this._def,description:e})}pipe(e){return Kge.create(this,e)}readonly(){return sre.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}function P1t(e){let t="[0-5]\\d";if(e.precision)t=`${t}\\.\\d{${e.precision}}`;else if(e.precision==null)t=`${t}(\\.\\d+)?`;let n=e.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${n}`}function R2o(e){return new RegExp(`^${P1t(e)}$`)}function Q2o(e){let t=`${S1t}T${P1t(e)}`,n=[];if(n.push(e.local?"Z?":"Z"),e.offset)n.push("([+-]\\d{2}:?\\d{2})");return t=`${t}(${n.join("|")})`,new RegExp(`^${t}$`)}function k2o(e,t){if((t==="v4"||!t)&&E2o.test(e))return!0;if((t==="v6"||!t)&&w2o.test(e))return!0;return!1}function L2o(e,t){if(!I2o.test(e))return!1;try{let[n]=e.split(".");if(!n)return!1;let o=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),r=JSON.parse(atob(o));if(typeof r!=="object"||r===null)return!1;if("typ"in r&&r?.typ!=="JWT")return!1;if(!r.alg)return!1;if(t&&r.alg!==t)return!1;return!0}catch{return!1}}function H2o(e,t){if((t==="v4"||!t)&&M2o.test(e))return!0;if((t==="v6"||!t)&&B2o.test(e))return!0;return!1}function F2o(e,t){let n=(e.toString().split(".")[1]||"").length,o=(t.toString().split(".")[1]||"").length,r=n>o?n:o,i=Number.parseInt(e.toFixed(r).replace(".","")),s=Number.parseInt(t.toFixed(r).replace(".",""));return i%s/10**r}function eX(e){if(e instanceof pp){let t={};for(let n in e.shape){let o=e.shape[n];t[n]=W8.create(eX(o))}return new pp({...e._def,shape:()=>t})}else if(e instanceof U8)return new U8({...e._def,type:eX(e.element)});else if(e instanceof W8)return W8.create(eX(e.unwrap()));else if(e instanceof yN)return yN.create(eX(e.unwrap()));else if(e instanceof uM)return uM.create(e.items.map((t)=>eX(t)));else return e}function LDe(e,t){let n=lM(e),o=lM(t);if(e===t)return{valid:!0,data:e};else if(n===Lr.object&&o===Lr.object){let r=Rc.objectKeys(t),i=Rc.objectKeys(e).filter((a)=>r.indexOf(a)!==-1),s={...e,...t};for(let a of i){let c=LDe(e[a],t[a]);if(!c.valid)return{valid:!1};s[a]=c.data}return{valid:!0,data:s}}else if(n===Lr.array&&o===Lr.array){if(e.length!==t.length)return{valid:!1};let r=[];for(let i=0;i<e.length;i++){let s=e[i],a=t[i],c=LDe(s,a);if(!c.valid)return{valid:!1};r.push(c.data)}return{valid:!0,data:r}}else if(n===Lr.date&&o===Lr.date&&+e===+t)return{valid:!0,data:e};else return{valid:!1}}function E1t(e,t){return new kF({values:e,typeName:Ps.ZodEnum,...Ea(t)})}function v1t(e,t){let n=typeof e==="function"?e(t):typeof e==="string"?{message:e}:e;return typeof n==="string"?{message:n}:n}function Wa(e,t={},n){if(e)return nX.create().superRefine((o,r)=>{let i=e(o);if(i instanceof Promise)return i.then((s)=>{if(!s){let a=v1t(t,o),c=a.fatal??n??!0;r.addIssue({code:"custom",...a,fatal:c})}});if(!i){let s=v1t(t,o),a=s.fatal??n??!0;r.addIssue({code:"custom",...s,fatal:a})}return});return nX.create()}var I1t=(e,t)=>{if(DF(t))return{success:!0,data:t.value};else{if(!e.common.issues.length)throw Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let n=new F1(e.common.issues);return this._error=n,this._error}}}},f2o,y2o,x2o,C2o,b2o,I2o,v2o,S2o,P2o="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",kDe,E2o,M2o,w2o,B2o,T2o,D2o,S1t="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",N2o,G8,RF,QF,$oe,tX,Gge,qoe,Joe,nX,NF,dM,Uge,U8,pp,Zoe,hM=(e)=>{if(e instanceof tre)return hM(e.schema);else if(e instanceof X8)return hM(e.innerType());else if(e instanceof nre)return[e.value];else if(e instanceof kF)return e.options;else if(e instanceof ore)return Rc.objectValues(e.enum);else if(e instanceof rre)return hM(e._def.innerType);else if(e instanceof qoe)return[void 0];else if(e instanceof Joe)return[null];else if(e instanceof W8)return[void 0,...hM(e.unwrap())];else if(e instanceof yN)return[null,...hM(e.unwrap())];else if(e instanceof FDe)return hM(e.unwrap());else if(e instanceof sre)return hM(e.unwrap());else if(e instanceof ire)return hM(e._def.innerType);else return[]},HDe,ere,uM,Wge,Xge,oX,Koe,tre,nre,kF,ore,rX,X8,W8,yN,rre,ire,jge,r0s,FDe,Kge,sre,i0s,Ps,k,Ae,s0s,a0s,Be,c0s,l0s,h0s,M1t,Jh,LF,sm,d0s,it,we,u0s,un,ss,p0s,kC,gs,m0s,_0s,xN,g0s,he,Pt,A0s,CN,f0s,y0s,x0s,are,C0s,j8,$ge;var w1t=El(()=>{Oge();Vge();b1t();QDe();Woe();f2o=/^c[^\s-]{8,}$/i,y2o=/^[0-9a-z]+$/,x2o=/^[0-9A-HJKMNP-TV-Z]{26}$/i,C2o=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,b2o=/^[a-z0-9_-]{21}$/i,I2o=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,v2o=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,S2o=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,E2o=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,M2o=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,w2o=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,B2o=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,T2o=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,D2o=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,N2o=new RegExp(`^${S1t}$`);G8=class G8 extends cc{_parse(e){if(this._def.coerce)e.data=String(e.data);if(this._getType(e)!==Lr.string){let r=this._getOrReturnCtx(e);return br(r,{code:Vt.invalid_type,expected:Lr.string,received:r.parsedType}),is}let n=new x2,o=void 0;for(let r of this._def.checks)if(r.kind==="min"){if(e.data.length<r.value)o=this._getOrReturnCtx(e,o),br(o,{code:Vt.too_small,minimum:r.value,type:"string",inclusive:!0,exact:!1,message:r.message}),n.dirty()}else if(r.kind==="max"){if(e.data.length>r.value)o=this._getOrReturnCtx(e,o),br(o,{code:Vt.too_big,maximum:r.value,type:"string",inclusive:!0,exact:!1,message:r.message}),n.dirty()}else if(r.kind==="length"){let i=e.data.length>r.value,s=e.data.length<r.value;if(i||s){if(o=this._getOrReturnCtx(e,o),i)br(o,{code:Vt.too_big,maximum:r.value,type:"string",inclusive:!0,exact:!0,message:r.message});else if(s)br(o,{code:Vt.too_small,minimum:r.value,type:"string",inclusive:!0,exact:!0,message:r.message});n.dirty()}}else if(r.kind==="email"){if(!S2o.test(e.data))o=this._getOrReturnCtx(e,o),br(o,{validation:"email",code:Vt.invalid_string,message:r.message}),n.dirty()}else if(r.kind==="emoji"){if(!kDe)kDe=new RegExp(P2o,"u");if(!kDe.test(e.data))o=this._getOrReturnCtx(e,o),br(o,{validation:"emoji",code:Vt.invalid_string,message:r.message}),n.dirty()}else if(r.kind==="uuid"){if(!C2o.test(e.data))o=this._getOrReturnCtx(e,o),br(o,{validation:"uuid",code:Vt.invalid_string,message:r.message}),n.dirty()}else if(r.kind==="nanoid"){if(!b2o.test(e.data))o=this._getOrReturnCtx(e,o),br(o,{validation:"nanoid",code:Vt.invalid_string,message:r.message}),n.dirty()}else if(r.kind==="cuid"){if(!f2o.test(e.data))o=this._getOrReturnCtx(e,o),br(o,{validation:"cuid",code:Vt.invalid_string,message:r.message}),n.dirty()}else if(r.kind==="cuid2"){if(!y2o.test(e.data))o=this._getOrReturnCtx(e,o),br(o,{validation:"cuid2",code:Vt.invalid_string,message:r.message}),n.dirty()}else if(r.kind==="ulid"){if(!x2o.test(e.data))o=this._getOrReturnCtx(e,o),br(o,{validation:"ulid",code:Vt.invalid_string,message:r.message}),n.dirty()}else if(r.kind==="url")try{new URL(e.data)}catch{o=this._getOrReturnCtx(e,o),br(o,{validation:"url",code:Vt.invalid_string,message:r.message}),n.dirty()}else if(r.kind==="regex"){if(r.regex.lastIndex=0,!r.regex.test(e.data))o=this._getOrReturnCtx(e,o),br(o,{validation:"regex",code:Vt.invalid_string,message:r.message}),n.dirty()}else if(r.kind==="trim")e.data=e.data.trim();else if(r.kind==="includes"){if(!e.data.includes(r.value,r.position))o=this._getOrReturnCtx(e,o),br(o,{code:Vt.invalid_string,validation:{includes:r.value,position:r.position},message:r.message}),n.dirty()}else if(r.kind==="toLowerCase")e.data=e.data.toLowerCase();else if(r.kind==="toUpperCase")e.data=e.data.toUpperCase();else if(r.kind==="startsWith"){if(!e.data.startsWith(r.value))o=this._getOrReturnCtx(e,o),br(o,{code:Vt.invalid_string,validation:{startsWith:r.value},message:r.message}),n.dirty()}else if(r.kind==="endsWith"){if(!e.data.endsWith(r.value))o=this._getOrReturnCtx(e,o),br(o,{code:Vt.invalid_string,validation:{endsWith:r.value},message:r.message}),n.dirty()}else if(r.kind==="datetime"){if(!Q2o(r).test(e.data))o=this._getOrReturnCtx(e,o),br(o,{code:Vt.invalid_string,validation:"datetime",message:r.message}),n.dirty()}else if(r.kind==="date"){if(!N2o.test(e.data))o=this._getOrReturnCtx(e,o),br(o,{code:Vt.invalid_string,validation:"date",message:r.message}),n.dirty()}else if(r.kind==="time"){if(!R2o(r).test(e.data))o=this._getOrReturnCtx(e,o),br(o,{code:Vt.invalid_string,validation:"time",message:r.message}),n.dirty()}else if(r.kind==="duration"){if(!v2o.test(e.data))o=this._getOrReturnCtx(e,o),br(o,{validation:"duration",code:Vt.invalid_string,message:r.message}),n.dirty()}else if(r.kind==="ip"){if(!k2o(e.data,r.version))o=this._getOrReturnCtx(e,o),br(o,{validation:"ip",code:Vt.invalid_string,message:r.message}),n.dirty()}else if(r.kind==="jwt"){if(!L2o(e.data,r.alg))o=this._getOrReturnCtx(e,o),br(o,{validation:"jwt",code:Vt.invalid_string,message:r.message}),n.dirty()}else if(r.kind==="cidr"){if(!H2o(e.data,r.version))o=this._getOrReturnCtx(e,o),br(o,{validation:"cidr",code:Vt.invalid_string,message:r.message}),n.dirty()}else if(r.kind==="base64"){if(!T2o.test(e.data))o=this._getOrReturnCtx(e,o),br(o,{validation:"base64",code:Vt.invalid_string,message:r.message}),n.dirty()}else if(r.kind==="base64url"){if(!D2o.test(e.data))o=this._getOrReturnCtx(e,o),br(o,{validation:"base64url",code:Vt.invalid_string,message:r.message}),n.dirty()}else Rc.assertNever(r);return{status:n.value,value:e.data}}_regex(e,t,n){return this.refinement((o)=>e.test(o),{validation:t,code:Vt.invalid_string,...pi.errToObj(n)})}_addCheck(e){return new G8({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...pi.errToObj(e)})}url(e){return this._addCheck({kind:"url",...pi.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...pi.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...pi.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...pi.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...pi.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...pi.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...pi.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...pi.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...pi.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...pi.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...pi.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...pi.errToObj(e)})}datetime(e){if(typeof e==="string")return this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e});return this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...pi.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){if(typeof e==="string")return this._addCheck({kind:"time",precision:null,message:e});return this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...pi.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...pi.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...pi.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t?.position,...pi.errToObj(t?.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...pi.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...pi.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...pi.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...pi.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...pi.errToObj(t)})}nonempty(e){return this.min(1,pi.errToObj(e))}trim(){return new G8({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new G8({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new G8({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find((e)=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find((e)=>e.kind==="date")}get isTime(){return!!this._def.checks.find((e)=>e.kind==="time")}get isDuration(){return!!this._def.checks.find((e)=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find((e)=>e.kind==="email")}get isURL(){return!!this._def.checks.find((e)=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find((e)=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find((e)=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find((e)=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find((e)=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find((e)=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find((e)=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find((e)=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find((e)=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find((e)=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find((e)=>e.kind==="base64url")}get minLength(){let e=null;for(let t of this._def.checks)if(t.kind==="min"){if(e===null||t.value>e)e=t.value}return e}get maxLength(){let e=null;for(let t of this._def.checks)if(t.kind==="max"){if(e===null||t.value<e)e=t.value}return e}};G8.create=(e)=>new G8({checks:[],typeName:Ps.ZodString,coerce:e?.coerce??!1,...Ea(e)});RF=class RF extends cc{constructor(){super(...arguments);this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce)e.data=Number(e.data);if(this._getType(e)!==Lr.number){let r=this._getOrReturnCtx(e);return br(r,{code:Vt.invalid_type,expected:Lr.number,received:r.parsedType}),is}let n=void 0,o=new x2;for(let r of this._def.checks)if(r.kind==="int"){if(!Rc.isInteger(e.data))n=this._getOrReturnCtx(e,n),br(n,{code:Vt.invalid_type,expected:"integer",received:"float",message:r.message}),o.dirty()}else if(r.kind==="min"){if(r.inclusive?e.data<r.value:e.data<=r.value)n=this._getOrReturnCtx(e,n),br(n,{code:Vt.too_small,minimum:r.value,type:"number",inclusive:r.inclusive,exact:!1,message:r.message}),o.dirty()}else if(r.kind==="max"){if(r.inclusive?e.data>r.value:e.data>=r.value)n=this._getOrReturnCtx(e,n),br(n,{code:Vt.too_big,maximum:r.value,type:"number",inclusive:r.inclusive,exact:!1,message:r.message}),o.dirty()}else if(r.kind==="multipleOf"){if(F2o(e.data,r.value)!==0)n=this._getOrReturnCtx(e,n),br(n,{code:Vt.not_multiple_of,multipleOf:r.value,message:r.message}),o.dirty()}else if(r.kind==="finite"){if(!Number.isFinite(e.data))n=this._getOrReturnCtx(e,n),br(n,{code:Vt.not_finite,message:r.message}),o.dirty()}else Rc.assertNever(r);return{status:o.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,pi.toString(t))}gt(e,t){return this.setLimit("min",e,!1,pi.toString(t))}lte(e,t){return this.setLimit("max",e,!0,pi.toString(t))}lt(e,t){return this.setLimit("max",e,!1,pi.toString(t))}setLimit(e,t,n,o){return new RF({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:pi.toString(o)}]})}_addCheck(e){return new RF({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:pi.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:pi.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:pi.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:pi.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:pi.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:pi.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:pi.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:pi.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:pi.toString(e)})}get minValue(){let e=null;for(let t of this._def.checks)if(t.kind==="min"){if(e===null||t.value>e)e=t.value}return e}get maxValue(){let e=null;for(let t of this._def.checks)if(t.kind==="max"){if(e===null||t.value<e)e=t.value}return e}get isInt(){return!!this._def.checks.find((e)=>e.kind==="int"||e.kind==="multipleOf"&&Rc.isInteger(e.value))}get isFinite(){let e=null,t=null;for(let n of this._def.checks)if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;else if(n.kind==="min"){if(t===null||n.value>t)t=n.value}else if(n.kind==="max"){if(e===null||n.value<e)e=n.value}return Number.isFinite(t)&&Number.isFinite(e)}};RF.create=(e)=>new RF({checks:[],typeName:Ps.ZodNumber,coerce:e?.coerce||!1,...Ea(e)});QF=class QF extends cc{constructor(){super(...arguments);this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==Lr.bigint)return this._getInvalidInput(e);let n=void 0,o=new x2;for(let r of this._def.checks)if(r.kind==="min"){if(r.inclusive?e.data<r.value:e.data<=r.value)n=this._getOrReturnCtx(e,n),br(n,{code:Vt.too_small,type:"bigint",minimum:r.value,inclusive:r.inclusive,message:r.message}),o.dirty()}else if(r.kind==="max"){if(r.inclusive?e.data>r.value:e.data>=r.value)n=this._getOrReturnCtx(e,n),br(n,{code:Vt.too_big,type:"bigint",maximum:r.value,inclusive:r.inclusive,message:r.message}),o.dirty()}else if(r.kind==="multipleOf"){if(e.data%r.value!==BigInt(0))n=this._getOrReturnCtx(e,n),br(n,{code:Vt.not_multiple_of,multipleOf:r.value,message:r.message}),o.dirty()}else Rc.assertNever(r);return{status:o.value,value:e.data}}_getInvalidInput(e){let t=this._getOrReturnCtx(e);return br(t,{code:Vt.invalid_type,expected:Lr.bigint,received:t.parsedType}),is}gte(e,t){return this.setLimit("min",e,!0,pi.toString(t))}gt(e,t){return this.setLimit("min",e,!1,pi.toString(t))}lte(e,t){return this.setLimit("max",e,!0,pi.toString(t))}lt(e,t){return this.setLimit("max",e,!1,pi.toString(t))}setLimit(e,t,n,o){return new QF({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:pi.toString(o)}]})}_addCheck(e){return new QF({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:pi.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:pi.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:pi.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:pi.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:pi.toString(t)})}get minValue(){let e=null;for(let t of this._def.checks)if(t.kind==="min"){if(e===null||t.value>e)e=t.value}return e}get maxValue(){let e=null;for(let t of this._def.checks)if(t.kind==="max"){if(e===null||t.value<e)e=t.value}return e}};QF.create=(e)=>new QF({checks:[],typeName:Ps.ZodBigInt,coerce:e?.coerce??!1,...Ea(e)});$oe=class $oe extends cc{_parse(e){if(this._def.coerce)e.data=Boolean(e.data);if(this._getType(e)!==Lr.boolean){let n=this._getOrReturnCtx(e);return br(n,{code:Vt.invalid_type,expected:Lr.boolean,received:n.parsedType}),is}return z1(e.data)}};$oe.create=(e)=>new $oe({typeName:Ps.ZodBoolean,coerce:e?.coerce||!1,...Ea(e)});tX=class tX extends cc{_parse(e){if(this._def.coerce)e.data=new Date(e.data);if(this._getType(e)!==Lr.date){let r=this._getOrReturnCtx(e);return br(r,{code:Vt.invalid_type,expected:Lr.date,received:r.parsedType}),is}if(Number.isNaN(e.data.getTime())){let r=this._getOrReturnCtx(e);return br(r,{code:Vt.invalid_date}),is}let n=new x2,o=void 0;for(let r of this._def.checks)if(r.kind==="min"){if(e.data.getTime()<r.value)o=this._getOrReturnCtx(e,o),br(o,{code:Vt.too_small,message:r.message,inclusive:!0,exact:!1,minimum:r.value,type:"date"}),n.dirty()}else if(r.kind==="max"){if(e.data.getTime()>r.value)o=this._getOrReturnCtx(e,o),br(o,{code:Vt.too_big,message:r.message,inclusive:!0,exact:!1,maximum:r.value,type:"date"}),n.dirty()}else Rc.assertNever(r);return{status:n.value,value:new Date(e.data.getTime())}}_addCheck(e){return new tX({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:pi.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:pi.toString(t)})}get minDate(){let e=null;for(let t of this._def.checks)if(t.kind==="min"){if(e===null||t.value>e)e=t.value}return e!=null?new Date(e):null}get maxDate(){let e=null;for(let t of this._def.checks)if(t.kind==="max"){if(e===null||t.value<e)e=t.value}return e!=null?new Date(e):null}};tX.create=(e)=>new tX({checks:[],coerce:e?.coerce||!1,typeName:Ps.ZodDate,...Ea(e)});Gge=class Gge extends cc{_parse(e){if(this._getType(e)!==Lr.symbol){let n=this._getOrReturnCtx(e);return br(n,{code:Vt.invalid_type,expected:Lr.symbol,received:n.parsedType}),is}return z1(e.data)}};Gge.create=(e)=>new Gge({typeName:Ps.ZodSymbol,...Ea(e)});qoe=class qoe extends cc{_parse(e){if(this._getType(e)!==Lr.undefined){let n=this._getOrReturnCtx(e);return br(n,{code:Vt.invalid_type,expected:Lr.undefined,received:n.parsedType}),is}return z1(e.data)}};qoe.create=(e)=>new qoe({typeName:Ps.ZodUndefined,...Ea(e)});Joe=class Joe extends cc{_parse(e){if(this._getType(e)!==Lr.null){let n=this._getOrReturnCtx(e);return br(n,{code:Vt.invalid_type,expected:Lr.null,received:n.parsedType}),is}return z1(e.data)}};Joe.create=(e)=>new Joe({typeName:Ps.ZodNull,...Ea(e)});nX=class nX extends cc{constructor(){super(...arguments);this._any=!0}_parse(e){return z1(e.data)}};nX.create=(e)=>new nX({typeName:Ps.ZodAny,...Ea(e)});NF=class NF extends cc{constructor(){super(...arguments);this._unknown=!0}_parse(e){return z1(e.data)}};NF.create=(e)=>new NF({typeName:Ps.ZodUnknown,...Ea(e)});dM=class dM extends cc{_parse(e){let t=this._getOrReturnCtx(e);return br(t,{code:Vt.invalid_type,expected:Lr.never,received:t.parsedType}),is}};dM.create=(e)=>new dM({typeName:Ps.ZodNever,...Ea(e)});Uge=class Uge extends cc{_parse(e){if(this._getType(e)!==Lr.undefined){let n=this._getOrReturnCtx(e);return br(n,{code:Vt.invalid_type,expected:Lr.void,received:n.parsedType}),is}return z1(e.data)}};Uge.create=(e)=>new Uge({typeName:Ps.ZodVoid,...Ea(e)});U8=class U8 extends cc{_parse(e){let{ctx:t,status:n}=this._processInputParams(e),o=this._def;if(t.parsedType!==Lr.array)return br(t,{code:Vt.invalid_type,expected:Lr.array,received:t.parsedType}),is;if(o.exactLength!==null){let i=t.data.length>o.exactLength.value,s=t.data.length<o.exactLength.value;if(i||s)br(t,{code:i?Vt.too_big:Vt.too_small,minimum:s?o.exactLength.value:void 0,maximum:i?o.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:o.exactLength.message}),n.dirty()}if(o.minLength!==null){if(t.data.length<o.minLength.value)br(t,{code:Vt.too_small,minimum:o.minLength.value,type:"array",inclusive:!0,exact:!1,message:o.minLength.message}),n.dirty()}if(o.maxLength!==null){if(t.data.length>o.maxLength.value)br(t,{code:Vt.too_big,maximum:o.maxLength.value,type:"array",inclusive:!0,exact:!1,message:o.maxLength.message}),n.dirty()}if(t.common.async)return Promise.all([...t.data].map((i,s)=>o.type._parseAsync(new EI(t,i,t.path,s)))).then((i)=>x2.mergeArray(n,i));let r=[...t.data].map((i,s)=>o.type._parseSync(new EI(t,i,t.path,s)));return x2.mergeArray(n,r)}get element(){return this._def.type}min(e,t){return new U8({...this._def,minLength:{value:e,message:pi.toString(t)}})}max(e,t){return new U8({...this._def,maxLength:{value:e,message:pi.toString(t)}})}length(e,t){return new U8({...this._def,exactLength:{value:e,message:pi.toString(t)}})}nonempty(e){return this.min(1,e)}};U8.create=(e,t)=>new U8({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Ps.ZodArray,...Ea(t)});pp=class pp extends cc{constructor(){super(...arguments);this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),t=Rc.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==Lr.object){let c=this._getOrReturnCtx(e);return br(c,{code:Vt.invalid_type,expected:Lr.object,received:c.parsedType}),is}let{status:n,ctx:o}=this._processInputParams(e),{shape:r,keys:i}=this._getCached(),s=[];if(!(this._def.catchall instanceof dM&&this._def.unknownKeys==="strip")){for(let c in o.data)if(!i.includes(c))s.push(c)}let a=[];for(let c of i){let l=r[c],h=o.data[c];a.push({key:{status:"valid",value:c},value:l._parse(new EI(o,h,o.path,c)),alwaysSet:c in o.data})}if(this._def.catchall instanceof dM){let c=this._def.unknownKeys;if(c==="passthrough")for(let l of s)a.push({key:{status:"valid",value:l},value:{status:"valid",value:o.data[l]}});else if(c==="strict"){if(s.length>0)br(o,{code:Vt.unrecognized_keys,keys:s}),n.dirty()}else if(c==="strip");else throw Error("Internal ZodObject error: invalid unknownKeys value.")}else{let c=this._def.catchall;for(let l of s){let h=o.data[l];a.push({key:{status:"valid",value:l},value:c._parse(new EI(o,h,o.path,l)),alwaysSet:l in o.data})}}if(o.common.async)return Promise.resolve().then(async()=>{let c=[];for(let l of a){let h=await l.key,d=await l.value;c.push({key:h,value:d,alwaysSet:l.alwaysSet})}return c}).then((c)=>x2.mergeObjectSync(n,c));else return x2.mergeObjectSync(n,a)}get shape(){return this._def.shape()}strict(e){return pi.errToObj,new pp({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(t,n)=>{let o=this._def.errorMap?.(t,n).message??n.defaultError;if(t.code==="unrecognized_keys")return{message:pi.errToObj(e).message??o};return{message:o}}}:{}})}strip(){return new pp({...this._def,unknownKeys:"strip"})}passthrough(){return new pp({...this._def,unknownKeys:"passthrough"})}extend(e){return new pp({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new pp({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:Ps.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new pp({...this._def,catchall:e})}pick(e){let t={};for(let n of Rc.objectKeys(e))if(e[n]&&this.shape[n])t[n]=this.shape[n];return new pp({...this._def,shape:()=>t})}omit(e){let t={};for(let n of Rc.objectKeys(this.shape))if(!e[n])t[n]=this.shape[n];return new pp({...this._def,shape:()=>t})}deepPartial(){return eX(this)}partial(e){let t={};for(let n of Rc.objectKeys(this.shape)){let o=this.shape[n];if(e&&!e[n])t[n]=o;else t[n]=o.optional()}return new pp({...this._def,shape:()=>t})}required(e){let t={};for(let n of Rc.objectKeys(this.shape))if(e&&!e[n])t[n]=this.shape[n];else{let r=this.shape[n];while(r instanceof W8)r=r._def.innerType;t[n]=r}return new pp({...this._def,shape:()=>t})}keyof(){return E1t(Rc.objectKeys(this.shape))}};pp.create=(e,t)=>new pp({shape:()=>e,unknownKeys:"strip",catchall:dM.create(),typeName:Ps.ZodObject,...Ea(t)});pp.strictCreate=(e,t)=>new pp({shape:()=>e,unknownKeys:"strict",catchall:dM.create(),typeName:Ps.ZodObject,...Ea(t)});pp.lazycreate=(e,t)=>new pp({shape:e,unknownKeys:"strip",catchall:dM.create(),typeName:Ps.ZodObject,...Ea(t)});Zoe=class Zoe extends cc{_parse(e){let{ctx:t}=this._processInputParams(e),n=this._def.options;function o(r){for(let s of r)if(s.result.status==="valid")return s.result;for(let s of r)if(s.result.status==="dirty")return t.common.issues.push(...s.ctx.common.issues),s.result;let i=r.map((s)=>new F1(s.ctx.common.issues));return br(t,{code:Vt.invalid_union,unionErrors:i}),is}if(t.common.async)return Promise.all(n.map(async(r)=>{let i={...t,common:{...t.common,issues:[]},parent:null};return{result:await r._parseAsync({data:t.data,path:t.path,parent:i}),ctx:i}})).then(o);else{let r=void 0,i=[];for(let a of n){let c={...t,common:{...t.common,issues:[]},parent:null},l=a._parseSync({data:t.data,path:t.path,parent:c});if(l.status==="valid")return l;else if(l.status==="dirty"&&!r)r={result:l,ctx:c};if(c.common.issues.length)i.push(c.common.issues)}if(r)return t.common.issues.push(...r.ctx.common.issues),r.result;let s=i.map((a)=>new F1(a));return br(t,{code:Vt.invalid_union,unionErrors:s}),is}}get options(){return this._def.options}};Zoe.create=(e,t)=>new Zoe({options:e,typeName:Ps.ZodUnion,...Ea(t)});HDe=class HDe extends cc{_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==Lr.object)return br(t,{code:Vt.invalid_type,expected:Lr.object,received:t.parsedType}),is;let n=this.discriminator,o=t.data[n],r=this.optionsMap.get(o);if(!r)return br(t,{code:Vt.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),is;if(t.common.async)return r._parseAsync({data:t.data,path:t.path,parent:t});else return r._parseSync({data:t.data,path:t.path,parent:t})}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,n){let o=new Map;for(let r of t){let i=hM(r.shape[e]);if(!i.length)throw Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let s of i){if(o.has(s))throw Error(`Discriminator property ${String(e)} has duplicate value ${String(s)}`);o.set(s,r)}}return new HDe({typeName:Ps.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:o,...Ea(n)})}};ere=class ere extends cc{_parse(e){let{status:t,ctx:n}=this._processInputParams(e),o=(r,i)=>{if(NDe(r)||NDe(i))return is;let s=LDe(r.value,i.value);if(!s.valid)return br(n,{code:Vt.invalid_intersection_types}),is;if(RDe(r)||RDe(i))t.dirty();return{status:t.value,value:s.data}};if(n.common.async)return Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([r,i])=>o(r,i));else return o(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};ere.create=(e,t,n)=>new ere({left:e,right:t,typeName:Ps.ZodIntersection,...Ea(n)});uM=class uM extends cc{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==Lr.array)return br(n,{code:Vt.invalid_type,expected:Lr.array,received:n.parsedType}),is;if(n.data.length<this._def.items.length)return br(n,{code:Vt.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),is;if(!this._def.rest&&n.data.length>this._def.items.length)br(n,{code:Vt.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty();let r=[...n.data].map((i,s)=>{let a=this._def.items[s]||this._def.rest;if(!a)return null;return a._parse(new EI(n,i,n.path,s))}).filter((i)=>!!i);if(n.common.async)return Promise.all(r).then((i)=>x2.mergeArray(t,i));else return x2.mergeArray(t,r)}get items(){return this._def.items}rest(e){return new uM({...this._def,rest:e})}};uM.create=(e,t)=>{if(!Array.isArray(e))throw Error("You must pass an array of schemas to z.tuple([ ... ])");return new uM({items:e,typeName:Ps.ZodTuple,rest:null,...Ea(t)})};Wge=class Wge extends cc{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==Lr.object)return br(n,{code:Vt.invalid_type,expected:Lr.object,received:n.parsedType}),is;let o=[],r=this._def.keyType,i=this._def.valueType;for(let s in n.data)o.push({key:r._parse(new EI(n,s,n.path,s)),value:i._parse(new EI(n,n.data[s],n.path,s)),alwaysSet:s in n.data});if(n.common.async)return x2.mergeObjectAsync(t,o);else return x2.mergeObjectSync(t,o)}get element(){return this._def.valueType}static create(e,t,n){if(t instanceof cc)return new Wge({keyType:e,valueType:t,typeName:Ps.ZodRecord,...Ea(n)});return new Wge({keyType:G8.create(),valueType:e,typeName:Ps.ZodRecord,...Ea(t)})}};Xge=class Xge extends cc{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==Lr.map)return br(n,{code:Vt.invalid_type,expected:Lr.map,received:n.parsedType}),is;let o=this._def.keyType,r=this._def.valueType,i=[...n.data.entries()].map(([s,a],c)=>({key:o._parse(new EI(n,s,n.path,[c,"key"])),value:r._parse(new EI(n,a,n.path,[c,"value"]))}));if(n.common.async){let s=new Map;return Promise.resolve().then(async()=>{for(let a of i){let c=await a.key,l=await a.value;if(c.status==="aborted"||l.status==="aborted")return is;if(c.status==="dirty"||l.status==="dirty")t.dirty();s.set(c.value,l.value)}return{status:t.value,value:s}})}else{let s=new Map;for(let a of i){let{key:c,value:l}=a;if(c.status==="aborted"||l.status==="aborted")return is;if(c.status==="dirty"||l.status==="dirty")t.dirty();s.set(c.value,l.value)}return{status:t.value,value:s}}}};Xge.create=(e,t,n)=>new Xge({valueType:t,keyType:e,typeName:Ps.ZodMap,...Ea(n)});oX=class oX extends cc{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==Lr.set)return br(n,{code:Vt.invalid_type,expected:Lr.set,received:n.parsedType}),is;let o=this._def;if(o.minSize!==null){if(n.data.size<o.minSize.value)br(n,{code:Vt.too_small,minimum:o.minSize.value,type:"set",inclusive:!0,exact:!1,message:o.minSize.message}),t.dirty()}if(o.maxSize!==null){if(n.data.size>o.maxSize.value)br(n,{code:Vt.too_big,maximum:o.maxSize.value,type:"set",inclusive:!0,exact:!1,message:o.maxSize.message}),t.dirty()}let r=this._def.valueType;function i(a){let c=new Set;for(let l of a){if(l.status==="aborted")return is;if(l.status==="dirty")t.dirty();c.add(l.value)}return{status:t.value,value:c}}let s=[...n.data.values()].map((a,c)=>r._parse(new EI(n,a,n.path,c)));if(n.common.async)return Promise.all(s).then((a)=>i(a));else return i(s)}min(e,t){return new oX({...this._def,minSize:{value:e,message:pi.toString(t)}})}max(e,t){return new oX({...this._def,maxSize:{value:e,message:pi.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}};oX.create=(e,t)=>new oX({valueType:e,minSize:null,maxSize:null,typeName:Ps.ZodSet,...Ea(t)});Koe=class Koe extends cc{constructor(){super(...arguments);this.validate=this.implement}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==Lr.function)return br(t,{code:Vt.invalid_type,expected:Lr.function,received:t.parsedType}),is;function n(s,a){return Yge({data:s,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,Xoe(),fN].filter((c)=>!!c),issueData:{code:Vt.invalid_arguments,argumentsError:a}})}function o(s,a){return Yge({data:s,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,Xoe(),fN].filter((c)=>!!c),issueData:{code:Vt.invalid_return_type,returnTypeError:a}})}let r={errorMap:t.common.contextualErrorMap},i=t.data;if(this._def.returns instanceof rX){let s=this;return z1(async function(...a){let c=new F1([]),l=await s._def.args.parseAsync(a,r).catch((u)=>{throw c.addIssue(n(a,u)),c}),h=await Reflect.apply(i,this,l);return await s._def.returns._def.type.parseAsync(h,r).catch((u)=>{throw c.addIssue(o(h,u)),c})})}else{let s=this;return z1(function(...a){let c=s._def.args.safeParse(a,r);if(!c.success)throw new F1([n(a,c.error)]);let l=Reflect.apply(i,this,c.data),h=s._def.returns.safeParse(l,r);if(!h.success)throw new F1([o(l,h.error)]);return h.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new Koe({...this._def,args:uM.create(e).rest(NF.create())})}returns(e){return new Koe({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,n){return new Koe({args:e?e:uM.create([]).rest(NF.create()),returns:t||NF.create(),typeName:Ps.ZodFunction,...Ea(n)})}};tre=class tre extends cc{get schema(){return this._def.getter()}_parse(e){let{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}};tre.create=(e,t)=>new tre({getter:e,typeName:Ps.ZodLazy,...Ea(t)});nre=class nre extends cc{_parse(e){if(e.data!==this._def.value){let t=this._getOrReturnCtx(e);return br(t,{received:t.data,code:Vt.invalid_literal,expected:this._def.value}),is}return{status:"valid",value:e.data}}get value(){return this._def.value}};nre.create=(e,t)=>new nre({value:e,typeName:Ps.ZodLiteral,...Ea(t)});kF=class kF extends cc{_parse(e){if(typeof e.data!=="string"){let t=this._getOrReturnCtx(e),n=this._def.values;return br(t,{expected:Rc.joinValues(n),received:t.parsedType,code:Vt.invalid_type}),is}if(!this._cache)this._cache=new Set(this._def.values);if(!this._cache.has(e.data)){let t=this._getOrReturnCtx(e),n=this._def.values;return br(t,{received:t.data,code:Vt.invalid_enum_value,options:n}),is}return z1(e.data)}get options(){return this._def.values}get enum(){let e={};for(let t of this._def.values)e[t]=t;return e}get Values(){let e={};for(let t of this._def.values)e[t]=t;return e}get Enum(){let e={};for(let t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return kF.create(e,{...this._def,...t})}exclude(e,t=this._def){return kF.create(this.options.filter((n)=>!e.includes(n)),{...this._def,...t})}};kF.create=E1t;ore=class ore extends cc{_parse(e){let t=Rc.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==Lr.string&&n.parsedType!==Lr.number){let o=Rc.objectValues(t);return br(n,{expected:Rc.joinValues(o),received:n.parsedType,code:Vt.invalid_type}),is}if(!this._cache)this._cache=new Set(Rc.getValidEnumValues(this._def.values));if(!this._cache.has(e.data)){let o=Rc.objectValues(t);return br(n,{received:n.data,code:Vt.invalid_enum_value,options:o}),is}return z1(e.data)}get enum(){return this._def.values}};ore.create=(e,t)=>new ore({values:e,typeName:Ps.ZodNativeEnum,...Ea(t)});rX=class rX extends cc{unwrap(){return this._def.type}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==Lr.promise&&t.common.async===!1)return br(t,{code:Vt.invalid_type,expected:Lr.promise,received:t.parsedType}),is;let n=t.parsedType===Lr.promise?t.data:Promise.resolve(t.data);return z1(n.then((o)=>this._def.type.parseAsync(o,{path:t.path,errorMap:t.common.contextualErrorMap})))}};rX.create=(e,t)=>new rX({type:e,typeName:Ps.ZodPromise,...Ea(t)});X8=class X8 extends cc{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Ps.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:t,ctx:n}=this._processInputParams(e),o=this._def.effect||null,r={addIssue:(i)=>{if(br(n,i),i.fatal)t.abort();else t.dirty()},get path(){return n.path}};if(r.addIssue=r.addIssue.bind(r),o.type==="preprocess"){let i=o.transform(n.data,r);if(n.common.async)return Promise.resolve(i).then(async(s)=>{if(t.value==="aborted")return is;let a=await this._def.schema._parseAsync({data:s,path:n.path,parent:n});if(a.status==="aborted")return is;if(a.status==="dirty")return ZW(a.value);if(t.value==="dirty")return ZW(a.value);return a});else{if(t.value==="aborted")return is;let s=this._def.schema._parseSync({data:i,path:n.path,parent:n});if(s.status==="aborted")return is;if(s.status==="dirty")return ZW(s.value);if(t.value==="dirty")return ZW(s.value);return s}}if(o.type==="refinement"){let i=(s)=>{let a=o.refinement(s,r);if(n.common.async)return Promise.resolve(a);if(a instanceof Promise)throw Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return s};if(n.common.async===!1){let s=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(s.status==="aborted")return is;if(s.status==="dirty")t.dirty();return i(s.value),{status:t.value,value:s.value}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then((s)=>{if(s.status==="aborted")return is;if(s.status==="dirty")t.dirty();return i(s.value).then(()=>({status:t.value,value:s.value}))})}if(o.type==="transform")if(n.common.async===!1){let i=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!DF(i))return is;let s=o.transform(i.value,r);if(s instanceof Promise)throw Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:s}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then((i)=>{if(!DF(i))return is;return Promise.resolve(o.transform(i.value,r)).then((s)=>({status:t.value,value:s}))});Rc.assertNever(o)}};X8.create=(e,t,n)=>new X8({schema:e,typeName:Ps.ZodEffects,effect:t,...Ea(n)});X8.createWithPreprocess=(e,t,n)=>new X8({schema:t,effect:{type:"preprocess",transform:e},typeName:Ps.ZodEffects,...Ea(n)});W8=class W8 extends cc{_parse(e){if(this._getType(e)===Lr.undefined)return z1(void 0);return this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};W8.create=(e,t)=>new W8({innerType:e,typeName:Ps.ZodOptional,...Ea(t)});yN=class yN extends cc{_parse(e){if(this._getType(e)===Lr.null)return z1(null);return this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};yN.create=(e,t)=>new yN({innerType:e,typeName:Ps.ZodNullable,...Ea(t)});rre=class rre extends cc{_parse(e){let{ctx:t}=this._processInputParams(e),n=t.data;if(t.parsedType===Lr.undefined)n=this._def.defaultValue();return this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}};rre.create=(e,t)=>new rre({innerType:e,typeName:Ps.ZodDefault,defaultValue:typeof t.default==="function"?t.default:()=>t.default,...Ea(t)});ire=class ire extends cc{_parse(e){let{ctx:t}=this._processInputParams(e),n={...t,common:{...t.common,issues:[]}},o=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});if(joe(o))return o.then((r)=>({status:"valid",value:r.status==="valid"?r.value:this._def.catchValue({get error(){return new F1(n.common.issues)},input:n.data})}));else return{status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new F1(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};ire.create=(e,t)=>new ire({innerType:e,typeName:Ps.ZodCatch,catchValue:typeof t.catch==="function"?t.catch:()=>t.catch,...Ea(t)});jge=class jge extends cc{_parse(e){if(this._getType(e)!==Lr.nan){let n=this._getOrReturnCtx(e);return br(n,{code:Vt.invalid_type,expected:Lr.nan,received:n.parsedType}),is}return{status:"valid",value:e.data}}};jge.create=(e)=>new jge({typeName:Ps.ZodNaN,...Ea(e)});r0s=Symbol("zod_brand");FDe=class FDe extends cc{_parse(e){let{ctx:t}=this._processInputParams(e),n=t.data;return this._def.type._parse({data:n,path:t.path,parent:t})}unwrap(){return this._def.type}};Kge=class Kge extends cc{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{let r=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});if(r.status==="aborted")return is;if(r.status==="dirty")return t.dirty(),ZW(r.value);else return this._def.out._parseAsync({data:r.value,path:n.path,parent:n})})();else{let o=this._def.in._parseSync({data:n.data,path:n.path,parent:n});if(o.status==="aborted")return is;if(o.status==="dirty")return t.dirty(),{status:"dirty",value:o.value};else return this._def.out._parseSync({data:o.value,path:n.path,parent:n})}}static create(e,t){return new Kge({in:e,out:t,typeName:Ps.ZodPipeline})}};sre=class sre extends cc{_parse(e){let t=this._def.innerType._parse(e),n=(o)=>{if(DF(o))o.value=Object.freeze(o.value);return o};return joe(t)?t.then((o)=>n(o)):n(t)}unwrap(){return this._def.innerType}};sre.create=(e,t)=>new sre({innerType:e,typeName:Ps.ZodReadonly,...Ea(t)});i0s={object:pp.lazycreate};(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(Ps||(Ps={}));k=G8.create,Ae=RF.create,s0s=jge.create,a0s=QF.create,Be=$oe.create,c0s=tX.create,l0s=Gge.create,h0s=qoe.create,M1t=Joe.create,Jh=nX.create,LF=NF.create,sm=dM.create,d0s=Uge.create,it=U8.create,we=pp.create,u0s=pp.strictCreate,un=Zoe.create,ss=HDe.create,p0s=ere.create,kC=uM.create,gs=Wge.create,m0s=Xge.create,_0s=oX.create,xN=Koe.create,g0s=tre.create,he=nre.create,Pt=kF.create,A0s=ore.create,CN=rX.create,f0s=X8.create,y0s=W8.create,x0s=yN.create,are=X8.createWithPreprocess,C0s=Kge.create,j8={string:(e)=>G8.create({...e,coerce:!0}),number:(e)=>RF.create({...e,coerce:!0}),boolean:(e)=>$oe.create({...e,coerce:!0}),bigint:(e)=>QF.create({...e,coerce:!0}),date:(e)=>tX.create({...e,coerce:!0})},$ge=is});var zDe=El(()=>{Vge();QDe();C1t();Woe();w1t();Oge()});var Ie=El(()=>{zDe();zDe()});var PN={};jW(PN,{all_layers:()=>J_,any_circuit_element:()=>yAe,any_soup_element:()=>SN,any_source_component:()=>Ayt,asset:()=>ure,base_circuit_json_error:()=>hc,battery_capacity:()=>V1t,brep_shape:()=>INe,cadModelDefaultDirectionMap:()=>v1o,cad_cable:()=>_4t,cad_collision_error:()=>m4t,cad_component:()=>p4t,cad_model_axis_directions:()=>u4t,cad_model_formats:()=>I1o,cad_reference_surface:()=>A4t,capacitance:()=>MI,circle_shape:()=>KDe,circuit_json_footprint_load_error:()=>dAe,current:()=>C2,distance:()=>Ke,duration_ms:()=>lX,experiment_type:()=>v4t,external_footprint_load_error:()=>dX,frequency:()=>mp,getRotationBetweenPcbPin1Locations:()=>$2o,getSimulationReturnCurrentGridJsonSchema:()=>mre,getZodPrefixedIdWithDefault:()=>In,inductance:()=>cX,insertionDirectionToCanonical:()=>iAe,insertionDirectionToVector:()=>j2o,insertion_direction:()=>gxt,kicadAt:()=>eAe,kicadEffects:()=>Y1t,kicadFont:()=>qDe,kicadFootprintAttributes:()=>U1t,kicadFootprintMetadata:()=>j1t,kicadFootprintModel:()=>X1t,kicadFootprintPad:()=>W1t,kicadFootprintProperties:()=>G1t,kicadProperty:()=>hre,kicadSymbolEffects:()=>q1t,kicadSymbolMetadata:()=>Z1t,kicadSymbolPinNames:()=>$1t,kicadSymbolPinNumbers:()=>K1t,kicadSymbolProperties:()=>J1t,kicadSymbolProperty:()=>bN,layer_ref:()=>Bo,layer_string:()=>GDe,length:()=>be,manufacturing_drc_properties:()=>fxt,ms:()=>lc,ninePointAnchor:()=>pM,parseAndConvertSiUnit:()=>Aa,pcbRenderLayer:()=>U2o,pcb_autorouting_error:()=>V5t,pcb_bend:()=>e5t,pcb_board:()=>Zxt,pcb_breakout_point:()=>X5t,pcb_bus_length_skew_error:()=>Uxt,pcb_bus_routing_constraint_error:()=>cAe,pcb_bus_routing_constraint_warning:()=>lAe,pcb_component:()=>yxt,pcb_component_invalid_layer_error:()=>uX,pcb_component_missing_courtyard_warning:()=>U5t,pcb_component_not_on_board_edge_error:()=>n4t,pcb_component_outside_board_error:()=>t4t,pcb_connector_not_in_accessible_orientation_warning:()=>G5t,pcb_copper_pour:()=>e4t,pcb_copper_pour_brep:()=>J5t,pcb_copper_pour_polygon:()=>Z5t,pcb_copper_pour_rect:()=>q5t,pcb_copper_text:()=>m5t,pcb_courtyard_circle:()=>h4t,pcb_courtyard_outline:()=>c4t,pcb_courtyard_overlap_error:()=>T5t,pcb_courtyard_pill:()=>d4t,pcb_courtyard_polygon:()=>l4t,pcb_courtyard_rect:()=>a4t,pcb_cutout:()=>F5t,pcb_cutout_circle:()=>k5t,pcb_cutout_path:()=>H5t,pcb_cutout_polygon:()=>L5t,pcb_cutout_rect:()=>Q5t,pcb_debug_line:()=>Cxt,pcb_debug_object:()=>Ixt,pcb_debug_object_base:()=>sAe,pcb_debug_point:()=>bxt,pcb_debug_rect:()=>xxt,pcb_fabrication_note_dimension:()=>v5t,pcb_fabrication_note_path:()=>b5t,pcb_fabrication_note_rect:()=>I5t,pcb_fabrication_note_text:()=>C5t,pcb_fabricator_extra_charge_warning:()=>W5t,pcb_footprint_overlap_error:()=>B5t,pcb_ground_plane:()=>j5t,pcb_ground_plane_region:()=>K5t,pcb_group:()=>O5t,pcb_hole:()=>Bxt,pcb_hole_circle_or_square_shape:()=>e1o,pcb_hole_circle_shape:()=>J2o,pcb_hole_oval_shape:()=>t1o,pcb_hole_pill_shape:()=>n1o,pcb_hole_rect_shape:()=>Z2o,pcb_hole_rotated_pill_shape:()=>o1o,pcb_keepout:()=>N5t,pcb_keepout_outline:()=>D5t,pcb_keepout_overlap_warning:()=>R5t,pcb_manual_edit_conflict_warning:()=>uAe,pcb_missing_footprint_error:()=>z5t,pcb_net:()=>Jxt,pcb_note_dimension:()=>w5t,pcb_note_line:()=>M5t,pcb_note_path:()=>E5t,pcb_note_rect:()=>P5t,pcb_note_text:()=>S5t,pcb_packing_error:()=>c5t,pcb_pad_pad_clearance_error:()=>i4t,pcb_pad_trace_clearance_error:()=>s4t,pcb_panel:()=>s5t,pcb_panelization_placement_error:()=>l5t,pcb_pin1_location:()=>aX,pcb_placement_error:()=>a5t,pcb_plated_hole:()=>Txt,pcb_port:()=>Dxt,pcb_port_not_connected_error:()=>qxt,pcb_port_not_matched_error:()=>$xt,pcb_preflight_routing_error:()=>Y5t,pcb_route_hint:()=>Axt,pcb_route_hints:()=>q2o,pcb_silkscreen_circle:()=>g5t,pcb_silkscreen_graphic:()=>y5t,pcb_silkscreen_graphic_brep:()=>f5t,pcb_silkscreen_line:()=>d5t,pcb_silkscreen_oval:()=>A5t,pcb_silkscreen_path:()=>u5t,pcb_silkscreen_pill:()=>x5t,pcb_silkscreen_rect:()=>_5t,pcb_silkscreen_text:()=>p5t,pcb_smtpad:()=>Rxt,pcb_smtpad_pill:()=>Nxt,pcb_solder_paste:()=>Qxt,pcb_soldermask_opening:()=>kxt,pcb_stiffener:()=>i5t,pcb_stiffener_polygon:()=>r5t,pcb_stiffener_rect:()=>o5t,pcb_text:()=>Lxt,pcb_thermal_spoke:()=>$5t,pcb_trace:()=>Oxt,pcb_trace_error:()=>jxt,pcb_trace_hint:()=>h5t,pcb_trace_missing_error:()=>Kxt,pcb_trace_route_point:()=>aAe,pcb_trace_route_point_through_pad:()=>zxt,pcb_trace_route_point_via:()=>Fxt,pcb_trace_route_point_wire:()=>Hxt,pcb_trace_style_warning:()=>Yxt,pcb_trace_too_long_error:()=>Gxt,pcb_trace_too_long_warning:()=>Wxt,pcb_trace_too_many_vias_warning:()=>Xxt,pcb_trace_warning:()=>Vxt,pcb_via:()=>vN,pcb_via_clearance_error:()=>o4t,pcb_via_trace_clearance_error:()=>r4t,point:()=>Yo,point3:()=>px,point_with_bulge:()=>_xt,polygon_shape:()=>dre,port_arrangement:()=>Oyt,position:()=>O2o,position3:()=>V2o,rect_shape:()=>Zge,resistance:()=>mx,ring:()=>UDe,rotated_rect_shape:()=>$De,rotation:()=>ei,route_hint_point:()=>yf,schematic_arc:()=>Xyt,schematic_box:()=>kyt,schematic_circle:()=>Wyt,schematic_component:()=>Vyt,schematic_component_overlap_warning:()=>ixt,schematic_component_port_arrangement_by_sides:()=>zyt,schematic_component_port_arrangement_by_size:()=>Fyt,schematic_component_styling_warning:()=>sxt,schematic_debug_line:()=>txt,schematic_debug_object:()=>oxt,schematic_debug_object_base:()=>nAe,schematic_debug_point:()=>nxt,schematic_debug_rect:()=>ext,schematic_element_outside_sheet_warning:()=>cxt,schematic_error:()=>Jyt,schematic_graphic:()=>lxt,schematic_group:()=>hxt,schematic_layout_error:()=>Zyt,schematic_line:()=>Gyt,schematic_manual_edit_conflict_warning:()=>oAe,schematic_missing_sheet_warning:()=>mxt,schematic_net_label:()=>qyt,schematic_path:()=>Lyt,schematic_pin_styles:()=>Hyt,schematic_port:()=>$yt,schematic_rect:()=>Uyt,schematic_sheet:()=>pxt,schematic_sheet_size:()=>rAe,schematic_sheet_styling_warning:()=>axt,schematic_symbol:()=>Yyt,schematic_table:()=>dxt,schematic_table_cell:()=>uxt,schematic_text:()=>Kyt,schematic_text_part:()=>bNe,schematic_trace:()=>jyt,schematic_voltage_probe:()=>rxt,simulation_ac_current_source:()=>b4t,simulation_ac_sweep_current_graph:()=>F4t,simulation_ac_sweep_voltage_graph:()=>H4t,simulation_ac_voltage_source:()=>y4t,simulation_complex_sample:()=>ENe,simulation_current_probe:()=>T4t,simulation_current_source:()=>I4t,simulation_dc_current_source:()=>C4t,simulation_dc_operating_point_current:()=>Q4t,simulation_dc_operating_point_voltage:()=>R4t,simulation_dc_sweep_current_graph:()=>L4t,simulation_dc_sweep_unit:()=>mAe,simulation_dc_sweep_voltage_graph:()=>k4t,simulation_dc_voltage_source:()=>f4t,simulation_experiment:()=>P4t,simulation_op_amp:()=>z4t,simulation_oscilloscope_trace:()=>V4t,simulation_parameter_sweep:()=>N4t,simulation_parameter_sweep_coordinate:()=>_M,simulation_parameter_type:()=>E1o,simulation_parameter_unit:()=>PNe,simulation_pcb_return_current_field:()=>pX,simulation_pcb_return_current_heatmap:()=>AAe,simulation_pcb_return_current_marker:()=>fAe,simulation_pcb_return_current_result:()=>_Ae,simulation_return_current_contact:()=>XDe,simulation_return_current_excitation:()=>Y4t,simulation_return_current_field_asset:()=>U4t,simulation_return_current_grid_json:()=>W4t,simulation_return_current_image_asset:()=>gAe,simulation_spice_subcircuit:()=>O4t,simulation_switch:()=>w4t,simulation_terminal_port:()=>jDe,simulation_transient_current_graph:()=>M4t,simulation_transient_voltage_graph:()=>E4t,simulation_unknown_experiment_error:()=>D4t,simulation_voltage_probe:()=>B4t,simulation_voltage_source:()=>x4t,size:()=>Jge,source_ambiguous_port_reference:()=>vyt,source_board:()=>Iyt,source_bus:()=>Ryt,source_component_availability_warning:()=>pre,source_component_base:()=>jl,source_component_internal_connection:()=>yyt,source_component_misconfigured_error:()=>mM,source_component_pins_underspecified_warning:()=>Byt,source_confusing_net_name_warning:()=>Nyt,source_failed_to_create_component_error:()=>uyt,source_group:()=>Cyt,source_i2c_misconfigured_error:()=>CNe,source_interconnect:()=>_yt,source_invalid_component_property_error:()=>gNe,source_manually_placed_via:()=>Pyt,source_missing_manufacturer_part_number_warning:()=>yNe,source_missing_property_error:()=>dyt,source_motor:()=>ryt,source_net:()=>byt,source_no_ground_pin_defined_warning:()=>wyt,source_no_power_pin_defined_warning:()=>Myt,source_part_not_found_warning:()=>IN,source_pcb_ground_plane:()=>Syt,source_pin_attributes:()=>hX,source_pin_missing_trace_warning:()=>fNe,source_pin_must_be_connected_error:()=>Tyt,source_port:()=>fyt,source_printed_part:()=>nyt,source_project_metadata:()=>_Ne,source_property_ignored_warning:()=>pyt,source_refdes_convention_warning:()=>xNe,source_runtime_error:()=>Qyt,source_simple_ammeter:()=>ayt,source_simple_battery:()=>oNe,source_simple_capacitor:()=>JDe,source_simple_chip:()=>tNe,source_simple_connector:()=>hyt,source_simple_connector_standards:()=>lyt,source_simple_crystal:()=>cyt,source_simple_current_source:()=>iyt,source_simple_diode:()=>tAe,source_simple_fiducial:()=>eyt,source_simple_fuse:()=>syt,source_simple_ground:()=>tyt,source_simple_inductor:()=>rNe,source_simple_led:()=>eNe,source_simple_mosfet:()=>uNe,source_simple_op_amp:()=>pNe,source_simple_pin_header:()=>aNe,source_simple_pinout:()=>cNe,source_simple_potentiometer:()=>sNe,source_simple_power_source:()=>nNe,source_simple_push_button:()=>iNe,source_simple_resistor:()=>ZDe,source_simple_resonator:()=>lNe,source_simple_switch:()=>mNe,source_simple_test_point:()=>dNe,source_simple_transistor:()=>hNe,source_simple_voltage_probe:()=>myt,source_simple_voltage_source:()=>gyt,source_subassembly:()=>oyt,source_trace:()=>xyt,source_trace_not_connected_error:()=>ANe,source_unnamed_trace_warning:()=>Eyt,spice_simulation_options:()=>S4t,standard_shape:()=>Y2o,supplier_footprint_mismatch_warning:()=>pAe,supplier_name:()=>K8,time:()=>z2o,timestamp:()=>O1t,unknown_error_finding_part:()=>Dyt,visible_layer:()=>_p,voltage:()=>Xl,wave_shape:()=>SNe});function G4t(e){return ure.extend({project_relative_path:k().min(1),url:k().url()}).superRefine((t,n)=>{if(!e.includes(t.mimetype))n.addIssue({code:Vt.custom,path:["mimetype"],message:`Expected one of: ${e.join(", ")}`});if(t.url.startsWith("data:")){if(/^data:([^;,]*)(?:;[^,]*)?,/i.exec(t.url)?.[1]?.toLowerCase()!==t.mimetype)n.addIssue({code:Vt.custom,path:["url"],message:"Data URL media type must match asset.mimetype"})}})}function mre(e){let t=e.columns*e.rows;if(!Number.isSafeInteger(e.columns)||e.columns<=0||!Number.isSafeInteger(e.rows)||e.rows<=0||!Number.isSafeInteger(t))throw Error("Grid dimensions must be positive safe integers");return W4t.superRefine((n,o)=>{if(n.field_type!==e.field_type)o.addIssue({code:Vt.custom,path:["field_type"],message:"Decoded field_type must match the parent field"});if((n.field_type==="real"?n.sheet_current_x:n.sheet_current_x_real).length!==t)o.addIssue({code:Vt.custom,message:`Each current channel must have ${t} entries (columns * rows)`})})}var mx,MI,cX,Xl,be,mp,Ke,C2,lX,z2o,lc,O1t,ei,V1t,Qt=(e)=>{},FF=(e)=>{},Yo,O2o,px,V2o,Jge,sX,YDe,KDe,Zge,$De,dre,Y2o,G2o=(e)=>Array.from({length:e},()=>"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"[Math.floor(Math.random()*62)]).join(""),In=(e)=>k().optional().default(()=>`${e}_${G2o(10)}`),pM,U2o,ure,eAe,qDe,Y1t,hre,G1t,U1t,W1t,X1t,j1t,K1t,$1t,q1t,bN,J1t,Z1t,hc,K8,jl,JDe,ZDe,tAe,eyt,eNe,tyt,tNe,nyt,oyt,ryt,nNe,iyt,syt,ayt,B1t,hX,oNe,rNe,iNe,sNe,cyt,aNe,lyt,hyt,cNe,lNe,hNe,dNe,uNe,pNe,mNe,_Ne,dyt,uyt,gNe,ANe,pyt,fNe,yNe,xNe,pre,myt,_yt,CNe,mM,gyt,Ayt,fyt,yyt,xyt,Cyt,byt,Iyt,vyt,Syt,J_,GDe,Bo,_p,Pyt,Eyt,Myt,wyt,Byt,Tyt,Dyt,IN,Nyt,ODe,T1t,Ryt,Qyt,kyt,Lyt,Hyt,Fyt,zyt,Oyt,Vyt,W2o,Yyt,Gyt,Uyt,Wyt,Xyt,jyt,X2o,bNe,Kyt,$yt,qyt,Jyt,Zyt,nAe,ext,txt,nxt,oxt,rxt,oAe,ixt,sxt,axt,cxt,D1t,lxt,hxt,dxt,uxt,rAe,pxt,mxt,_xt,UDe,INe,iAe,j2o,gxt,aX,K2o,$2o=(e,t)=>{for(let n of K2o){let o=n.indexOf(e),r=n.indexOf(t);if(o!==-1&&r!==-1)return(r-o+n.length)%n.length*90}return null},Axt,q2o,yf,fxt,yxt,sAe,xxt,Cxt,bxt,Ixt,vxt,J2o,Sxt,Z2o,Pxt,e1o,Ext,t1o,Mxt,n1o,wxt,o1o,Bxt,r1o,i1o,s1o,a1o,c1o,l1o,Txt,Dxt,h1o,d1o,u1o,Nxt,p1o,m1o,Rxt,_1o,g1o,A1o,f1o,y1o,x1o,C1o,Qxt,qge,kxt,Lxt,N1t,Hxt,Fxt,zxt,aAe,Oxt,Vxt,Yxt,Gxt,Uxt,Wxt,Xxt,HF,cAe,cre,lAe,jxt,Kxt,$xt,qxt,Jxt,vN,Zxt,R1t,e5t,WDe,t5t,n5t,o5t,r5t,i5t,s5t,a5t,c5t,l5t,h5t,d5t,u5t,p5t,m5t,_5t,g5t,A5t,b1o,f5t,y5t,x5t,C5t,b5t,I5t,v5t,S5t,P5t,E5t,M5t,w5t,B5t,T5t,D5t,N5t,R5t,hAe,Q5t,k5t,L5t,H5t,F5t,z5t,dX,dAe,O5t,V5t,Y5t,uAe,Q1t,G5t,U5t,pAe,W5t,X5t,j5t,K5t,$5t,vNe,q5t,J5t,Z5t,e4t,t4t,n4t,uX,o4t,r4t,i4t,s4t,a4t,c4t,l4t,h4t,d4t,I1o,u4t,v1o,p4t,m4t,k1t,_4t,g4t=0.000001,L1t,H1t,A4t,SNe,S1o,f4t,y4t,x4t,P1o,C4t,b4t,I4t,mAe,PNe,v4t,S4t,P4t,_M,E4t,M4t,w4t,B4t,T4t,D4t,E1o,lre,N4t,R4t,Q4t,k4t,L4t,ENe,H4t,F4t,z4t,O4t,F1t=(e)=>e!==void 0,V4t,VDe,XDe,jDe,Y4t,_Ae,U4t,gAe,pX,iX,W4t,AAe,z1t,fAe,yAe,SN;var Kt=El(()=>{Y0();Ie();Y0();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();mx=k().or(Ae()).transform((e)=>Aa(e,"Ω").value),MI=k().or(Ae()).transform((e)=>Aa(e,"F").value).transform((e)=>Number.parseFloat(e.toPrecision(12))),cX=k().or(Ae()).transform((e)=>Aa(e,"H").value),Xl=k().or(Ae()).transform((e)=>Aa(e,"V").value),be=k().or(Ae()).transform((e)=>Aa(e).value),mp=k().or(Ae()).transform((e)=>Aa(e,"Hz").value),Ke=be,C2=k().or(Ae()).transform((e)=>Aa(e,"A").value),lX=k().or(Ae()).transform((e)=>Aa(e).value),z2o=lX,lc=lX,O1t=k().datetime(),ei=k().or(Ae()).transform((e)=>{if(typeof e==="number")return e;if(e.endsWith("deg"))return Number.parseFloat(e.split("deg")[0]);if(e.endsWith("rad"))return Number.parseFloat(e.split("rad")[0])*180/Math.PI;return Number.parseFloat(e)}),V1t=Ae().or(k().endsWith("mAh")).transform((e)=>{if(typeof e==="string"){let t=e.replace("mAh",""),n=Number.parseFloat(t);if(Number.isNaN(n))throw Error("Invalid capacity");return n}return e}).describe("Battery capacity in mAh");Qt("extra props b");Qt("missing props b");Qt(!0);Qt("mismatched prop types: a");FF(!0);FF('T1 has extra: "c", T2 has extra: "d"');FF('T1 has extra: "c"');FF('T2 has extra: "c"');FF('T1 has extra: "d", T2 has extra: "c"');FF(!0);Yo=we({x:Ke,y:Ke}),O2o=Yo;Qt(!0);Qt(!0);px=we({x:Ke,y:Ke,z:Ke}),V2o=px;Qt(!0);Jge=we({width:Ae(),height:Ae()});Qt(!0);sX=Ke.pipe(Ae().finite()),YDe=Ke.pipe(Ae().finite().positive()),KDe=we({shape:he("circle"),x:sX,y:sX,radius:YDe}).strict(),Zge=we({shape:he("rect"),x:sX,y:sX,width:YDe,height:YDe}).strict(),$De=Zge.extend({shape:he("rotated_rect"),ccw_rotation:ei.pipe(Ae().finite())}),dre=we({shape:he("polygon"),points:it(Yo.extend({x:sX,y:sX})).min(3).refine((e)=>{let t=e.reduce((n,o,r)=>{let i=e[(r+1)%e.length];return n+o.x*i.y-i.x*o.y},0);return Number.isFinite(t)&&t!==0},"Polygon boundary must enclose a nonzero area")}).strict();Qt(!0);Qt(!0);Qt(!0);Qt(!0);Y2o=ss("shape",[KDe,Zge,$De,dre]);Qt(!0);pM=Pt(["top_left","top_center","top_right","center_left","center","center_right","bottom_left","bottom_center","bottom_right"]);Qt(!0);U2o=Pt(["top_silkscreen","bottom_silkscreen","top_copper","bottom_copper","top_soldermask","bottom_soldermask","top_fabrication_note","bottom_fabrication_note","top_user_note","bottom_user_note","top_courtyard","bottom_courtyard","inner1_copper","inner2_copper","inner3_copper","inner4_copper","inner5_copper","inner6_copper","inner7_copper","inner8_copper","edge_cuts","drill"]);Qt(!0);ure=we({project_relative_path:k(),url:k(),mimetype:k()});Qt(!0);eAe=Yo.extend({rotation:ei.optional()});Qt(!0);qDe=we({size:Yo.optional(),thickness:Ke.optional()});Qt(!0);Y1t=we({font:qDe.optional()});Qt(!0);hre=we({value:k(),at:eAe.optional(),layer:k().optional(),uuid:k().optional(),hide:Be().optional(),effects:Y1t.optional()});Qt(!0);G1t=we({Reference:hre.optional(),Value:hre.optional(),Datasheet:hre.optional(),Description:hre.optional()});Qt(!0);U1t=we({through_hole:Be().optional(),smd:Be().optional(),exclude_from_pos_files:Be().optional(),exclude_from_bom:Be().optional()});Qt(!0);W1t=we({name:k(),type:k(),shape:k().optional(),at:eAe.optional(),size:Yo.optional(),drill:Ke.optional(),layers:it(k()).optional(),removeUnusedLayers:Be().optional(),uuid:k().optional()});Qt(!0);X1t=we({path:k(),offset:px.optional(),scale:px.optional(),rotate:px.optional()});Qt(!0);j1t=we({footprintName:k().optional(),version:un([Ae(),k()]).optional(),generator:k().optional(),generatorVersion:un([Ae(),k()]).optional(),layer:k().optional(),properties:G1t.optional(),attributes:U1t.optional(),pads:it(W1t).optional(),embeddedFonts:Be().optional(),model:X1t.optional()});Qt(!0);K1t=we({hide:Be().optional()});Qt(!0);$1t=we({offset:Ke.optional(),hide:Be().optional()});Qt(!0);q1t=we({font:qDe.optional(),justify:un([k(),it(k())]).optional(),hide:Be().optional()});Qt(!0);bN=we({value:k(),id:un([Ae(),k()]).optional(),at:eAe.optional(),effects:q1t.optional()});Qt(!0);J1t=we({Reference:bN.optional(),Value:bN.optional(),Footprint:bN.optional(),Datasheet:bN.optional(),Description:bN.optional(),ki_keywords:bN.optional(),ki_fp_filters:bN.optional()});Qt(!0);Z1t=we({symbolName:k().optional(),extends:k().optional(),pinNumbers:K1t.optional(),pinNames:$1t.optional(),excludeFromSim:Be().optional(),inBom:Be().optional(),onBoard:Be().optional(),properties:J1t.optional(),embeddedFonts:Be().optional()});Qt(!0);hc=we({error_type:k(),message:k(),is_fatal:Be().optional()});Qt(!0);K8=Pt(["jlcpcb","macrofab","pcbway","digikey","mouser","lcsc"]);Qt(!0);jl=we({type:he("source_component"),ftype:k().optional(),source_component_id:k(),name:k(),manufacturer_part_number:k().optional(),supplier_part_numbers:gs(K8,it(k())).optional(),display_value:k().optional(),display_name:k().optional(),are_pins_interchangeable:Be().optional(),internally_connected_source_port_ids:it(it(k())).optional(),source_group_id:k().optional(),subcircuit_id:k().optional()});Qt(!0);JDe=jl.extend({ftype:he("simple_capacitor"),capacitance:MI,max_voltage_rating:Xl.optional(),display_capacitance:k().optional(),max_decoupling_trace_length:Ke.optional()});Qt(!0);ZDe=jl.extend({ftype:he("simple_resistor"),resistance:mx,display_resistance:k().optional()});Qt(!0);tAe=jl.extend({ftype:he("simple_diode")});Qt(!0);eyt=jl.extend({ftype:he("simple_fiducial")});Qt(!0);eNe=tAe.extend({ftype:he("simple_led"),color:k().optional(),wavelength:k().optional()});Qt(!0);tyt=jl.extend({ftype:he("simple_ground")});Qt(!0);tNe=jl.extend({ftype:he("simple_chip")});Qt(!0);nyt=jl.extend({ftype:he("printedpart"),material:Pt(["pla","petg","nylon"]).optional(),color:k().trim().min(1).optional()});Qt(!0);oyt=jl.extend({ftype:he("subassembly")});Qt(!0);ryt=jl.extend({ftype:he("motor")});Qt(!0);nNe=jl.extend({ftype:he("simple_power_source"),voltage:Xl});Qt(!0);iyt=jl.extend({ftype:he("simple_current_source"),current:C2,frequency:mp.optional(),peak_to_peak_current:C2.optional(),wave_shape:Pt(["sine","square","triangle","sawtooth","dc"]).optional().default("dc"),phase:Ae().optional(),duty_cycle:Ae().min(0).max(1).optional()});Qt(!0);syt=jl.extend({ftype:he("simple_fuse"),current_rating_amps:Ae().describe("Nominal current in amps the fuse is rated for"),voltage_rating_volts:Ae().describe("Voltage rating in volts, e.g. ±5V would be 5")});Qt(!0);ayt=jl.extend({ftype:he("simple_ammeter")});Qt(!0);B1t=un([Ae(),k().trim().regex(/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?\s*(?:[fpnumkKMGTµμ]?V?|V)?$/,"Expected a scalar voltage, optionally with SI units")]).pipe(Xl).pipe(Ae().finite()),hX=we({is_input:Be().optional(),is_output:Be().optional(),is_bidirectional:Be().optional(),is_passive:Be().optional(),can_use_tri_state:Be().optional(),is_using_tri_state:Be().optional(),can_use_open_collector:Be().optional(),is_using_open_collector:Be().optional(),can_use_open_emitter:Be().optional(),is_using_open_emitter:Be().optional(),is_gpio:Be().optional(),highlight_color:k().optional(),must_be_connected:Be().optional(),provides_power:Be().optional(),requires_power:Be().optional(),provides_ground:Be().optional(),requires_ground:Be().optional(),provides_voltage:B1t.optional(),requires_voltage:B1t.optional(),required_voltage_tolerance:Ae().finite().min(0).max(1).optional(),do_not_connect:Be().optional(),include_in_board_pinout:Be().optional(),can_use_internal_pullup:Be().optional(),is_using_internal_pullup:Be().optional(),needs_external_pullup:Be().optional(),can_use_internal_pulldown:Be().optional(),is_using_internal_pulldown:Be().optional(),needs_external_pulldown:Be().optional(),can_use_open_drain:Be().optional(),is_using_open_drain:Be().optional(),can_use_push_pull:Be().optional(),is_using_push_pull:Be().optional(),should_have_decoupling_capacitor:Be().optional(),recommended_decoupling_capacitor_capacitance:un([k(),Ae()]).optional(),is_configured_for_i2c_sda:Be().optional(),is_configured_for_i2c_scl:Be().optional(),is_configured_for_spi_mosi:Be().optional(),is_configured_for_spi_miso:Be().optional(),is_configured_for_spi_sck:Be().optional(),is_configured_for_spi_cs:Be().optional(),is_configured_for_uart_tx:Be().optional(),is_configured_for_uart_rx:Be().optional(),supports_i2c_sda:Be().optional(),supports_i2c_scl:Be().optional(),supports_spi_mosi:Be().optional(),supports_spi_miso:Be().optional(),supports_spi_sck:Be().optional(),supports_spi_cs:Be().optional(),supports_uart_tx:Be().optional(),supports_uart_rx:Be().optional()});Qt(!0);oNe=jl.extend({ftype:he("simple_battery"),capacity:V1t});Qt(!0);rNe=jl.extend({ftype:he("simple_inductor"),inductance:cX,display_inductance:k().optional(),max_current_rating:Ae().optional()});Qt(!0);iNe=jl.extend({ftype:he("simple_push_button")});Qt(!0);sNe=jl.extend({ftype:he("simple_potentiometer"),max_resistance:mx,display_max_resistance:k().optional()});Qt(!0);cyt=jl.extend({ftype:he("simple_crystal"),frequency:Ae().describe("Frequency in Hz"),load_capacitance:Ae().optional().describe("Load capacitance in pF"),pin_variant:Pt(["two_pin","four_pin"]).optional()});Qt(!0);aNe=jl.extend({ftype:he("simple_pin_header"),pin_count:Ae(),gender:Pt(["male","female"]).optional().default("male")});Qt(!0);lyt=["usb_c","m2","jst_sh","jst_gh","jst_zh","jst_ph","jst_xh","jst_vh"],hyt=jl.extend({ftype:he("simple_connector"),standard:Pt(lyt).optional(),pin_count:Ae().int().positive().optional()});Qt(!0);cNe=jl.extend({ftype:he("simple_pinout")});Qt(!0);lNe=jl.extend({ftype:he("simple_resonator"),load_capacitance:MI,equivalent_series_resistance:mx.optional(),frequency:mp});Qt(!0);hNe=jl.extend({ftype:he("simple_transistor"),transistor_type:Pt(["npn","pnp"])});Qt(!0);dNe=jl.extend({ftype:he("simple_test_point"),footprint_variant:Pt(["pad","through_hole"]).optional(),pad_shape:Pt(["rect","circle"]).optional(),pad_diameter:un([Ae(),k()]).optional(),hole_diameter:un([Ae(),k()]).optional(),width:un([Ae(),k()]).optional(),height:un([Ae(),k()]).optional()});Qt(!0);uNe=jl.extend({ftype:he("simple_mosfet"),channel_type:Pt(["n","p"]),mosfet_mode:Pt(["enhancement","depletion"])});Qt(!0);pNe=jl.extend({ftype:he("simple_op_amp")});Qt(!0);mNe=jl.extend({ftype:he("simple_switch")});Qt(!0);_Ne=we({type:he("source_project_metadata"),name:k().optional(),software_used_string:k().optional(),project_url:k().optional(),source_filesystem_md5_hash:k().optional(),created_at:O1t.optional()});Qt(!0);dyt=hc.extend({type:he("source_missing_property_error"),source_missing_property_error_id:In("source_missing_property_error"),source_component_id:k(),property_name:k(),subcircuit_id:k().optional(),error_type:he("source_missing_property_error").default("source_missing_property_error")}).describe("The source code is missing a property");Qt(!0);uyt=hc.extend({type:he("source_failed_to_create_component_error"),source_failed_to_create_component_error_id:In("source_failed_to_create_component_error"),error_type:he("source_failed_to_create_component_error").default("source_failed_to_create_component_error"),component_name:k().optional(),subcircuit_id:k().optional(),parent_source_component_id:k().optional(),pcb_center:we({x:Ae().optional(),y:Ae().optional()}).optional(),schematic_center:we({x:Ae().optional(),y:Ae().optional()}).optional()}).describe("Error emitted when a component fails to be constructed");Qt(!0);gNe=hc.extend({type:he("source_invalid_component_property_error"),source_invalid_component_property_error_id:In("source_invalid_component_property_error"),source_component_id:k(),property_name:k(),property_value:LF().optional(),expected_format:k().optional(),subcircuit_id:k().optional(),error_type:he("source_invalid_component_property_error").default("source_invalid_component_property_error")}).describe("The source component property is invalid");Qt(!0);ANe=hc.extend({type:he("source_trace_not_connected_error"),source_trace_not_connected_error_id:In("source_trace_not_connected_error"),error_type:he("source_trace_not_connected_error").default("source_trace_not_connected_error"),subcircuit_id:k().optional(),source_group_id:k().optional(),source_trace_id:k().optional(),connected_source_port_ids:it(k()).optional(),selectors_not_found:it(k()).optional()}).describe("Occurs when a source trace selector does not match any ports");Qt(!0);pyt=we({type:he("source_property_ignored_warning"),source_property_ignored_warning_id:In("source_property_ignored_warning"),source_component_id:k(),property_name:k(),subcircuit_id:k().optional(),error_type:he("source_property_ignored_warning").default("source_property_ignored_warning"),message:k()}).describe("The source property was ignored");Qt(!0);fNe=we({type:he("source_pin_missing_trace_warning"),source_pin_missing_trace_warning_id:In("source_pin_missing_trace_warning"),warning_type:he("source_pin_missing_trace_warning").default("source_pin_missing_trace_warning"),message:k(),source_component_id:k(),source_port_id:k(),subcircuit_id:k().optional()}).describe("Warning emitted when a source component pin is missing a trace connection");Qt(!0);yNe=we({type:he("source_missing_manufacturer_part_number_warning"),source_missing_manufacturer_part_number_warning_id:In("source_missing_manufacturer_part_number_warning"),warning_type:he("source_missing_manufacturer_part_number_warning").default("source_missing_manufacturer_part_number_warning"),message:k(),source_component_id:k(),standard:k().optional(),subcircuit_id:k().optional()}).describe("Warning emitted when a source component is missing its manufacturer part number");Qt(!0);xNe=we({type:he("source_refdes_convention_warning"),source_refdes_convention_warning_id:In("source_refdes_convention_warning"),warning_type:he("source_refdes_convention_warning").default("source_refdes_convention_warning"),message:k(),source_component_id:k(),refdes:k(),source_component_ftype:k(),expected_prefixes:it(k()),actual_prefix:k().optional(),subcircuit_id:k().optional()}).describe("Warning emitted when a source component reference designator does not match the component type convention");Qt(!0);pre=we({type:he("source_component_availability_warning"),source_component_availability_warning_id:In("source_component_availability_warning"),warning_type:he("source_component_availability_warning").default("source_component_availability_warning"),message:k(),source_component_id:k(),subcircuit_id:k().optional(),supplier_name:K8,supplier_part_numbers:it(k()).nonempty()}).describe("Warning emitted when no supplier alternative can be confirmed in stock. Availability may be unknown or change over time.");Qt(!0);myt=jl.extend({ftype:he("simple_voltage_probe")});Qt(!0);_yt=jl.extend({ftype:he("interconnect")});Qt(!0);CNe=hc.extend({type:he("source_i2c_misconfigured_error"),source_i2c_misconfigured_error_id:In("source_i2c_misconfigured_error"),error_type:he("source_i2c_misconfigured_error").default("source_i2c_misconfigured_error"),source_port_ids:it(k())}).describe("Error emitted when incompatible I2C pins (e.g. SDA and SCL) are connected to the same net");Qt(!0);mM=hc.extend({type:he("source_component_misconfigured_error"),source_component_misconfigured_error_id:In("source_component_misconfigured_error"),error_type:he("source_component_misconfigured_error").default("source_component_misconfigured_error"),source_component_ids:it(k()),source_port_ids:it(k()).optional()}).describe("Error emitted when one or more source components have an invalid or conflicting configuration");Qt(!0);gyt=jl.extend({ftype:he("simple_voltage_source"),voltage:Xl,frequency:mp.optional(),peak_to_peak_voltage:Xl.optional(),wave_shape:Pt(["sinewave","square","triangle","sawtooth"]).optional(),phase:ei.optional(),duty_cycle:Ae().optional().describe("Duty cycle as a fraction (0 to 1)"),pulse_delay:lc.optional(),rise_time:lc.optional(),fall_time:lc.optional(),pulse_width:lc.optional(),period:lc.optional()});Qt(!0);Ayt=un([ZDe,JDe,tAe,eyt,eNe,tyt,tNe,nyt,oyt,ryt,nNe,iyt,ayt,oNe,rNe,iNe,sNe,cyt,aNe,hyt,cNe,lNe,mNe,hNe,dNe,uNe,pNe,syt,myt,_yt,gyt,_Ne,dyt,gNe,uyt,ANe,pyt,fNe,yNe,xNe,pre,CNe,mM]);Qt(!0);fyt=we({type:he("source_port"),pin_number:Ae().optional(),port_hints:it(k()).optional(),name:k(),source_port_id:k(),source_component_id:k().optional(),source_group_id:k().optional(),most_frequently_referenced_by_name:k().optional(),subcircuit_id:k().optional(),subcircuit_connectivity_map_key:k().optional()}).merge(hX);Qt(!0);yyt=we({type:he("source_component_internal_connection"),source_component_internal_connection_id:k(),source_component_id:k(),source_port_ids:it(k()),subcircuit_id:k().optional()});Qt(!0);xyt=we({type:he("source_trace"),source_trace_id:k(),connected_source_port_ids:it(k()),connected_source_net_ids:it(k()),subcircuit_id:k().optional(),subcircuit_connectivity_map_key:k().optional(),max_length:Ae().optional(),max_via_count:Ae().int().nonnegative().optional(),name:k().optional(),min_trace_thickness:Ae().optional(),display_name:k().optional()});Qt(!0);Cyt=we({type:he("source_group"),source_group_id:k(),subcircuit_id:k().optional(),parent_subcircuit_id:k().optional(),parent_source_group_id:k().optional(),is_subcircuit:Be().optional(),show_as_schematic_box:Be().optional(),name:k().optional(),was_automatically_named:Be().optional()});Qt(!0);byt=we({type:he("source_net"),source_net_id:k(),name:k(),member_source_group_ids:it(k()),is_power:Be().optional(),is_ground:Be().optional(),is_digital_signal:Be().optional(),is_analog_signal:Be().optional(),is_positive_voltage_source:Be().optional(),trace_width:Ae().optional(),subcircuit_id:k().optional(),subcircuit_connectivity_map_key:k().optional()});Qt(!0);Iyt=we({type:he("source_board"),source_board_id:k(),source_group_id:k(),title:k().optional()}).describe("Defines a board in the source domain");Qt(!0);vyt=hc.extend({type:he("source_ambiguous_port_reference"),source_ambiguous_port_reference_id:In("source_ambiguous_port_reference"),error_type:he("source_ambiguous_port_reference").default("source_ambiguous_port_reference"),source_port_id:k().optional(),source_component_id:k().optional()}).describe("Error emitted when a port hint matches multiple non-overlapping pads, making the port reference ambiguous");Qt(!0);Syt=we({type:he("source_pcb_ground_plane"),source_pcb_ground_plane_id:k(),source_group_id:k(),source_net_id:k(),subcircuit_id:k().optional()}).describe("Defines a ground plane in the source domain");Qt(!0);J_=["top","bottom","inner1","inner2","inner3","inner4","inner5","inner6","inner7","inner8"],GDe=Pt(J_),Bo=GDe.or(we({name:GDe})).transform((e)=>{if(typeof e==="string")return e;return e.name});Qt(!0);_p=Pt(["top","bottom"]),Pyt=we({type:he("source_manually_placed_via"),source_manually_placed_via_id:k(),source_group_id:k(),source_net_id:k().min(1).optional(),subcircuit_id:k().optional(),source_trace_id:k().optional()}).describe("Defines a via that is manually placed in the source domain");Qt(!0);Eyt=we({type:he("source_unnamed_trace_warning"),source_unnamed_trace_warning_id:In("source_unnamed_trace_warning"),warning_type:he("source_unnamed_trace_warning").default("source_unnamed_trace_warning"),message:k(),source_trace_id:k(),subcircuit_id:k().optional()}).describe("Warning emitted when a source trace is missing a name");Qt(!0);Myt=we({type:he("source_no_power_pin_defined_warning"),source_no_power_pin_defined_warning_id:In("source_no_power_pin_defined_warning"),warning_type:he("source_no_power_pin_defined_warning").default("source_no_power_pin_defined_warning"),message:k(),source_component_id:k(),source_port_ids:it(k()),subcircuit_id:k().optional()}).describe("Warning emitted when a chip has no source ports with requires_power=true");Qt(!0);wyt=we({type:he("source_no_ground_pin_defined_warning"),source_no_ground_pin_defined_warning_id:In("source_no_ground_pin_defined_warning"),warning_type:he("source_no_ground_pin_defined_warning").default("source_no_ground_pin_defined_warning"),message:k(),source_component_id:k(),source_port_ids:it(k()),subcircuit_id:k().optional()}).describe("Warning emitted when a chip has no source ports marked as ground pins");Qt(!0);Byt=we({type:he("source_component_pins_underspecified_warning"),source_component_pins_underspecified_warning_id:In("source_component_pins_underspecified_warning"),warning_type:he("source_component_pins_underspecified_warning").default("source_component_pins_underspecified_warning"),message:k(),source_component_id:k(),source_port_ids:it(k()),subcircuit_id:k().optional()}).describe("Warning emitted when all ports on a source component are underspecified");Qt(!0);Tyt=hc.extend({type:he("source_pin_must_be_connected_error"),source_pin_must_be_connected_error_id:In("source_pin_must_be_connected_error"),error_type:he("source_pin_must_be_connected_error").default("source_pin_must_be_connected_error"),source_component_id:k(),source_port_id:k(),subcircuit_id:k().optional()}).describe("Error emitted when a pin with mustBeConnected attribute is not connected to any trace");Qt(!0);Dyt=hc.extend({type:he("unknown_error_finding_part"),unknown_error_finding_part_id:In("unknown_error_finding_part"),error_type:he("unknown_error_finding_part").default("unknown_error_finding_part"),source_component_id:k().optional(),subcircuit_id:k().optional()}).describe("Error emitted when an unexpected error occurs while finding a part");Qt(!0);IN=we({type:he("source_part_not_found_warning"),source_part_not_found_warning_id:In("source_part_not_found_warning"),warning_type:he("source_part_not_found_warning").default("source_part_not_found_warning"),message:k(),source_component_id:k().optional(),subcircuit_id:k().optional(),supplier_name:K8.optional(),manufacturer_part_number:k().optional(),supplier_part_number:k().optional(),part_name:k().optional()}).describe("Warning emitted when a requested part can not be found");Qt(!0);Nyt=we({type:he("source_confusing_net_name_warning"),source_confusing_net_name_warning_id:In("source_confusing_net_name_warning"),warning_type:he("source_confusing_net_name_warning").default("source_confusing_net_name_warning"),message:k(),source_net_ids:it(k()).min(2),net_name:k(),subcircuit_id:k().optional()}).describe("Warning emitted when electrically disconnected source nets share a name");Qt(!0);ODe=un([Ae().nonnegative().finite(),we({reference:he("longest_manhattan"),source_trace_ids:it(k()).min(1).optional(),offset:Ae().finite().optional()})]),T1t=un([Ae().positive().finite(),we({width_multiplier:Ae().positive().finite()})]),Ryt=we({type:he("source_bus"),source_bus_id:k(),name:k().optional(),source_trace_ids:it(k()).min(1),max_length_skew:Ae().nonnegative().finite().optional(),target_impedance:Ae().positive().finite().optional(),target_differential_impedance:Ae().positive().finite().optional(),differential_pair:we({positive_source_trace_id:k(),negative_source_trace_id:k(),trace_gap:Ae().positive().finite().optional(),max_uncoupled_length:Ae().nonnegative().finite().optional()}).optional(),length_match_source_trace_ids:it(k()).min(1).optional(),min_length:ODe.optional(),max_length:ODe.optional(),target_length:ODe.optional(),length_tolerance:Ae().nonnegative().finite().optional(),pcb_trace_spacing:T1t.optional(),pcb_spacing_to_other_signals:T1t.optional(),target_impedance_min:Ae().positive().finite().optional(),target_impedance_max:Ae().positive().finite().optional(),target_differential_impedance_min:Ae().positive().finite().optional(),target_differential_impedance_max:Ae().positive().finite().optional(),subcircuit_id:k().optional()});Qt(!0);Qyt=hc.pick({message:!0,error_type:!0}).extend({type:he("source_runtime_error"),source_runtime_error_id:In("source_runtime_error"),error_type:he("source_runtime_error").default("source_runtime_error"),phase_name:k().optional()}).describe("An unexpected runtime failure while generating or validating a circuit");Qt(!0);kyt=we({type:he("schematic_box"),schematic_sheet_id:k().optional(),schematic_component_id:k().optional(),schematic_symbol_id:k().optional(),width:Ke,height:Ke,is_dashed:Be().default(!1),x:Ke,y:Ke,subcircuit_id:k().optional()}).describe("Draws a box on the schematic");Qt(!0);Lyt=we({type:he("schematic_path"),schematic_path_id:In("schematic_path"),schematic_sheet_id:k().optional(),schematic_component_id:k().optional(),schematic_symbol_id:k().optional(),fill_color:k().optional(),is_filled:Be().optional(),is_dashed:Be().default(!1),stroke_width:Ke.nullable().optional(),stroke_color:k().optional(),dash_length:Ke.optional(),dash_gap:Ke.optional(),points:it(Yo),subcircuit_id:k().optional()});Qt(!0);Hyt=gs(we({left_margin:be.optional(),right_margin:be.optional(),top_margin:be.optional(),bottom_margin:be.optional()})),Fyt=we({left_size:Ae(),right_size:Ae(),top_size:Ae().optional(),bottom_size:Ae().optional()});Qt(!0);zyt=we({left_side:we({pins:it(Ae()),direction:Pt(["top-to-bottom","bottom-to-top"]).optional()}).optional(),right_side:we({pins:it(Ae()),direction:Pt(["top-to-bottom","bottom-to-top"]).optional()}).optional(),top_side:we({pins:it(Ae()),direction:Pt(["left-to-right","right-to-left"]).optional()}).optional(),bottom_side:we({pins:it(Ae()),direction:Pt(["left-to-right","right-to-left"]).optional()}).optional()});Qt(!0);Oyt=un([Fyt,zyt]),Vyt=we({type:he("schematic_component"),size:Jge,center:Yo,source_component_id:k().optional(),schematic_component_id:k(),schematic_sheet_id:k().optional(),schematic_symbol_id:k().optional(),pin_spacing:be.optional(),pin_styles:Hyt.optional(),box_width:be.optional(),symbol_name:k().optional(),port_arrangement:Oyt.optional(),port_labels:gs(k()).optional(),symbol_display_value:k().optional(),subcircuit_id:k().optional(),schematic_group_id:k().optional(),is_schematic_group:Be().optional(),source_group_id:k().optional(),is_box_with_pins:Be().optional().default(!0)});Qt(!0);W2o=we({kicad_symbol:Z1t.optional()}).catchall(LF()),Yyt=we({type:he("schematic_symbol"),schematic_symbol_id:k(),name:k().optional(),metadata:W2o.optional()}).describe("Defines a named schematic symbol that can be referenced by components.");Qt(!0);Gyt=we({type:he("schematic_line"),schematic_line_id:In("schematic_line"),schematic_sheet_id:k().optional(),schematic_component_id:k().optional(),schematic_symbol_id:k().optional(),x1:Ke,y1:Ke,x2:Ke,y2:Ke,stroke_width:Ke.nullable().optional(),color:k().default("#000000"),is_dashed:Be().default(!1),dash_length:Ke.optional(),dash_gap:Ke.optional(),subcircuit_id:k().optional()}).describe("Draws a styled line on the schematic");Qt(!0);Uyt=we({type:he("schematic_rect"),schematic_rect_id:In("schematic_rect"),schematic_sheet_id:k().optional(),schematic_component_id:k().optional(),schematic_symbol_id:k().optional(),center:Yo,width:Ke,height:Ke,rotation:ei.default(0),stroke_width:Ke.nullable().optional(),color:k().default("#000000"),is_filled:Be().default(!1),fill_color:k().optional(),is_dashed:Be().default(!1),subcircuit_id:k().optional()}).describe("Draws a styled rectangle on the schematic");Qt(!0);Wyt=we({type:he("schematic_circle"),schematic_circle_id:In("schematic_circle"),schematic_sheet_id:k().optional(),schematic_component_id:k().optional(),schematic_symbol_id:k().optional(),center:Yo,radius:Ke,stroke_width:Ke.nullable().optional(),color:k().default("#000000"),is_filled:Be().default(!1),fill_color:k().optional(),is_dashed:Be().default(!1),subcircuit_id:k().optional()}).describe("Draws a styled circle on the schematic");Qt(!0);Xyt=we({type:he("schematic_arc"),schematic_arc_id:In("schematic_arc"),schematic_sheet_id:k().optional(),schematic_component_id:k().optional(),schematic_symbol_id:k().optional(),center:Yo,radius:Ke,start_angle_degrees:ei,end_angle_degrees:ei,direction:Pt(["clockwise","counterclockwise"]).default("counterclockwise"),stroke_width:Ke.nullable().optional(),color:k().default("#000000"),is_dashed:Be().default(!1),subcircuit_id:k().optional()}).describe("Draws a styled arc on the schematic");Qt(!0);jyt=we({type:he("schematic_trace"),schematic_trace_id:k(),schematic_sheet_id:k().optional(),source_trace_id:k().optional(),junctions:it(we({x:Ae(),y:Ae()})),edges:it(we({from:we({x:Ae(),y:Ae()}),to:we({x:Ae(),y:Ae()}),is_crossing:Be().optional(),from_schematic_port_id:k().optional(),to_schematic_port_id:k().optional()})),subcircuit_id:k().optional(),subcircuit_connectivity_map_key:k().optional()});Qt(!0);X2o=Pt(["center","left","right","top","bottom"]);Qt(!0);bNe=we({text:k(),is_overlined:Be().optional()}),Kyt=we({type:he("schematic_text"),schematic_sheet_id:k().optional(),schematic_component_id:k().optional(),schematic_symbol_id:k().optional(),schematic_text_id:k(),source_trace_id:k().optional(),text:k(),text_parts:it(bNe).min(1).optional(),display_superscript:k().optional(),font_size:Ae().default(0.18),position:we({x:Ke,y:Ke}),rotation:Ae().default(0),anchor:un([X2o.describe("legacy"),pM]).default("center"),color:k().default("#000000"),subcircuit_id:k().optional()});Qt(!0);$yt=we({type:he("schematic_port"),schematic_port_id:k(),source_port_id:k(),schematic_sheet_id:k().optional(),schematic_component_id:k().optional(),center:Yo,facing_direction:Pt(["up","down","left","right"]).optional(),distance_from_component_edge:Ae().optional(),side_of_component:Pt(["top","bottom","left","right"]).optional(),true_ccw_index:Ae().optional(),pin_number:Ae().optional(),display_pin_label:k().optional(),display_pin_label_text_parts:it(bNe).min(1).optional(),display_pin_label_font_size:Ae().positive().finite().optional(),subcircuit_id:k().optional(),is_connected:Be().optional(),is_internal_circuit_port:Be().optional(),is_overlapping_internal_circuit_port:Be().optional(),has_input_arrow:Be().optional(),has_output_arrow:Be().optional(),is_drawn_with_inversion_circle:Be().optional()}).describe("Defines a port on a schematic component");Qt(!0);qyt=we({type:he("schematic_net_label"),schematic_net_label_id:In("schematic_net_label"),schematic_sheet_id:k().optional(),schematic_trace_id:k().optional(),source_trace_id:k().optional(),source_net_id:k(),center:Yo,anchor_position:Yo.optional(),anchor_side:Pt(["top","bottom","left","right"]),text:k(),display_superscript:k().optional(),symbol_name:k().optional(),is_movable:Be().optional(),subcircuit_id:k().optional()});Qt(!0);Jyt=hc.extend({type:he("schematic_error"),schematic_error_id:k(),error_type:he("schematic_port_not_found").default("schematic_port_not_found"),subcircuit_id:k().optional()}).describe("Defines a schematic error on the schematic");Qt(!0);Zyt=hc.extend({type:he("schematic_layout_error"),schematic_layout_error_id:In("schematic_layout_error"),error_type:he("schematic_layout_error").default("schematic_layout_error"),source_group_id:k(),schematic_group_id:k(),subcircuit_id:k().optional()}).describe("Error emitted when schematic layout fails for a group");Qt(!0);nAe=we({type:he("schematic_debug_object"),label:k().optional(),subcircuit_id:k().optional()}),ext=nAe.extend({shape:he("rect"),center:Yo,size:Jge}),txt=nAe.extend({shape:he("line"),start:Yo,end:Yo}),nxt=nAe.extend({shape:he("point"),center:Yo}),oxt=ss("shape",[ext,txt,nxt]);Qt(!0);rxt=we({type:he("schematic_voltage_probe"),schematic_voltage_probe_id:k(),schematic_sheet_id:k().optional(),source_component_id:k().optional(),name:k().optional(),position:Yo,schematic_trace_id:k(),voltage:Xl.optional(),subcircuit_id:k().optional(),color:k().optional(),label_alignment:pM.optional()}).describe("Defines a voltage probe measurement point on a schematic trace");Qt(!0);oAe=we({type:he("schematic_manual_edit_conflict_warning"),schematic_manual_edit_conflict_warning_id:In("schematic_manual_edit_conflict_warning"),warning_type:he("schematic_manual_edit_conflict_warning").default("schematic_manual_edit_conflict_warning"),message:k(),schematic_component_id:k(),schematic_group_id:k().optional(),subcircuit_id:k().optional(),source_component_id:k()}).describe("Warning emitted when a component has both manual placement and explicit schX/schY coordinates");Qt(!0);ixt=we({type:he("schematic_component_overlap_warning"),schematic_component_overlap_warning_id:In("schematic_component_overlap_warning"),warning_type:he("schematic_component_overlap_warning").default("schematic_component_overlap_warning"),message:k(),schematic_component_ids:kC([k(),k()]),schematic_sheet_id:k().optional()}).describe("Warning emitted when the rendered bounds of two schematic components overlap");Qt(!0);sxt=we({type:he("schematic_component_styling_warning"),schematic_component_styling_warning_id:In("schematic_component_styling_warning"),warning_type:he("schematic_component_styling_warning").default("schematic_component_styling_warning"),message:k(),schematic_component_id:k(),styling_issue_type:k(),schematic_port_ids:it(k()).optional(),source_component_id:k().optional(),schematic_sheet_id:k().optional(),subcircuit_id:k().optional()}).describe("Warning emitted when a schematic component has a visual styling issue");Qt(!0);axt=we({type:he("schematic_sheet_styling_warning"),schematic_sheet_styling_warning_id:In("schematic_sheet_styling_warning"),warning_type:he("schematic_sheet_styling_warning").default("schematic_sheet_styling_warning"),message:k(),schematic_sheet_id:k(),styling_issue_type:he("non_default_sheet_size"),subcircuit_id:k().optional()}).describe("Style warning emitted when a schematic sheet uses a non-default size");Qt(!0);cxt=we({type:he("schematic_element_outside_sheet_warning"),schematic_element_outside_sheet_warning_id:In("schematic_element_outside_sheet_warning"),warning_type:he("schematic_element_outside_sheet_warning").default("schematic_element_outside_sheet_warning"),message:k(),schematic_sheet_id:k(),schematic_element_type:Pt(["schematic_component","schematic_net_label","schematic_trace"]),schematic_element_id:k()}).describe("Warning emitted when a schematic component, net label, or trace extends outside its schematic sheet");Qt(!0);D1t=Ke.pipe(Ae().positive().finite()),lxt=we({type:he("schematic_graphic"),schematic_graphic_id:In("schematic_graphic"),schematic_sheet_id:k().optional(),asset:ure.optional(),svg_content:k().optional(),width:D1t.optional(),height:D1t.optional()}).describe("References a graphic asset or inline SVG content with optional centered layout bounds on a schematic sheet").superRefine(({asset:e,svg_content:t},n)=>{if(e===void 0&&t===void 0)n.addIssue({code:Vt.custom,message:"At least one of asset or svg_content is required"})});Qt(!0);hxt=we({type:he("schematic_group"),schematic_group_id:In("schematic_group"),schematic_sheet_id:k().optional(),source_group_id:k(),is_subcircuit:Be().optional(),subcircuit_id:k().optional(),width:be,height:be,center:Yo,schematic_component_ids:it(k()),show_as_schematic_box:Be().optional(),name:k().optional(),description:k().optional()}).describe("Defines a group of components on the schematic");Qt(!0);dxt=we({type:he("schematic_table"),schematic_table_id:In("schematic_table"),schematic_sheet_id:k().optional(),anchor_position:Yo,column_widths:it(Ke),row_heights:it(Ke),cell_padding:Ke.optional(),border_width:Ke.optional(),subcircuit_id:k().optional(),schematic_component_id:k().optional(),anchor:pM.optional()}).describe("Defines a table on the schematic");Qt(!0);uxt=we({type:he("schematic_table_cell"),schematic_table_cell_id:In("schematic_table_cell"),schematic_sheet_id:k().optional(),schematic_table_id:k(),start_row_index:Ae(),end_row_index:Ae(),start_column_index:Ae(),end_column_index:Ae(),text:k().optional(),center:Yo,width:Ke,height:Ke,horizontal_align:Pt(["left","center","right"]).optional(),vertical_align:Pt(["top","middle","bottom"]).optional(),font_size:Ke.optional(),subcircuit_id:k().optional()}).describe("Defines a cell within a schematic_table");Qt(!0);rAe=Pt(["a4","ansi_b"]),pxt=we({type:he("schematic_sheet"),schematic_sheet_id:In("schematic_sheet"),name:k().optional(),sheet_index:Ae().optional(),sheet_size:rAe.optional(),sheet_width:Ae().positive().optional(),sheet_height:Ae().positive().optional(),subcircuit_id:k().optional(),outline_color:k().optional()}).describe("Defines a schematic sheet or page that components can be placed on");Qt(!0);mxt=we({type:he("schematic_missing_sheet_warning"),schematic_missing_sheet_warning_id:In("schematic_missing_sheet_warning"),warning_type:he("schematic_missing_sheet_warning").default("schematic_missing_sheet_warning"),message:k()}).describe("Circuit-wide warning emitted when a schematic has no schematic sheet. Display as a banner without attaching it to a component or drawing a target outline or leader line.");Qt(!0);_xt=we({x:Ke,y:Ke,bulge:Ae().optional()});Qt(!0);UDe=we({vertices:it(_xt)});Qt(!0);INe=we({outer_ring:UDe,inner_rings:it(UDe).default([])});Qt(!0);iAe={from_left:"from_left",from_right:"from_right",from_top:"from_top",from_bottom:"from_bottom",from_above:"from_above",from_below:"from_below",from_x_neg:"from_left",from_x_pos:"from_right",from_y_pos:"from_top",from_y_neg:"from_bottom",from_z_pos:"from_above",from_z_neg:"from_below",from_front:"from_top",from_back:"from_bottom"},j2o={from_left:{x:-1,y:0,z:0},from_right:{x:1,y:0,z:0},from_top:{x:0,y:1,z:0},from_bottom:{x:0,y:-1,z:0},from_above:{x:0,y:0,z:1},from_below:{x:0,y:0,z:-1}},gxt=Pt(["from_left","from_right","from_top","from_bottom","from_above","from_below","from_x_neg","from_x_pos","from_y_pos","from_y_neg","from_z_pos","from_z_neg","from_front","from_back"]).transform((e)=>iAe[e]).describe('The side exposing the receptacle where the cable or mating part is attached, following the 2D PCB diagram convention, not a 3D viewport frame. In project coordinate space, "from_top" is +Y, "from_bottom" -Y, "from_left" -X, "from_right" +X, "from_above" +Z and "from_below" -Z. A receptacle on the +Y edge is "from_top" even though the plug moves in -Y as it seats. Cartesian spellings such as "from_y_pos" are accepted and normalized to the named values, as are the deprecated "from_front" (now "from_top") and "from_back" (now "from_bottom").');Qt(!0);Qt(!0);aX=Pt(["leftside_top","leftside_bottom","rightside_top","rightside_bottom","topside_left","topside_right","bottomside_left","bottomside_right"]);Qt(!0);K2o=[["leftside_top","bottomside_left","rightside_bottom","topside_right"],["leftside_bottom","bottomside_right","rightside_top","topside_left"]],Axt=we({x:Ke,y:Ke,via:Be().optional(),via_to_layer:Bo.optional()}),q2o=it(Axt);Qt(!0);Qt(!0);yf=we({x:Ke,y:Ke,via:Be().optional(),to_layer:Bo.optional(),trace_width:Ke.optional()});Qt(!0);fxt=we({min_trace_width:be.optional(),min_board_edge_clearance:be.optional(),min_via_hole_edge_to_via_hole_edge_clearance:be.optional(),min_plated_hole_drill_edge_to_drill_edge_clearance:be.optional(),min_trace_to_pad_edge_clearance:be.optional(),min_trace_to_hole_edge_clearance:be.optional().describe("Minimum distance from a trace copper edge to a non-plated hole edge, in mm. No default is applied when omitted."),min_pad_edge_to_pad_edge_clearance:be.optional(),min_same_net_trace_edge_to_trace_edge_clearance:be.optional(),min_different_net_trace_edge_to_trace_edge_clearance:be.optional(),min_via_edge_to_pad_edge_clearance:be.optional(),min_via_hole_diameter:be.optional(),min_via_pad_diameter:be.optional()}),yxt=we({type:he("pcb_component"),pcb_component_id:In("pcb_component"),source_component_id:k(),center:Yo,layer:Bo,rotation:ei,display_offset_x:k().optional().describe("How to display the x offset for this part, usually corresponding with how the user specified it"),display_offset_y:k().optional().describe("How to display the y offset for this part, usually corresponding with how the user specified it"),width:be,height:be,do_not_place:Be().optional(),is_allowed_to_be_off_board:Be().optional(),subcircuit_id:k().optional(),pcb_group_id:k().optional(),position_mode:Pt(["packed","relative_to_group_anchor","relative_to_another_component","none"]).optional(),anchor_position:Yo.optional(),anchor_alignment:pM.optional(),positioned_relative_to_pcb_group_id:k().optional(),positioned_relative_to_pcb_board_id:k().optional(),cable_insertion_center:Yo.optional(),insertion_direction:gxt.optional(),pin1_location:aX.optional().describe("Location of pin 1 on the unrotated, top-view component footprint"),supplier_pin1_location_map:gs(K8,aX).optional().describe("Pin 1 location for each supplier's unrotated, top-view footprint"),metadata:we({kicad_footprint:j1t.optional()}).optional(),obstructs_within_bounds:Be().default(!0).describe("Does this component take up all the space within its bounds on a layer. This is generally true except for when separated pin headers are being represented by a single component (in which case, chips can be placed between the pin headers) or for tall modules where chips fit underneath")}).describe("Defines a component on the PCB");Qt(!0);sAe=we({type:he("pcb_debug_object"),pcb_debug_object_id:In("pcb_debug_object"),label:k().optional(),subcircuit_id:k().optional()}),xxt=sAe.extend({shape:he("rect"),center:Yo,size:Jge}),Cxt=sAe.extend({shape:he("line"),start:Yo,end:Yo}),bxt=sAe.extend({shape:he("point"),center:Yo}),Ixt=ss("shape",[xxt,Cxt,bxt]);Qt(!0);vxt=we({type:he("pcb_hole"),pcb_hole_id:In("pcb_hole"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),pcb_component_id:k().optional(),hole_shape:he("circle"),hole_diameter:Ae(),x:Ke,y:Ke,is_covered_with_solder_mask:Be().optional(),soldermask_margin:Ae().optional()}),J2o=vxt.describe("Defines a circular hole on the PCB");Qt(!0);Sxt=we({type:he("pcb_hole"),pcb_hole_id:In("pcb_hole"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),pcb_component_id:k().optional(),hole_shape:he("rect"),hole_width:Ae(),hole_height:Ae(),x:Ke,y:Ke,is_covered_with_solder_mask:Be().optional(),soldermask_margin:Ae().optional()}),Z2o=Sxt.describe("Defines a rectangular (square-capable) hole on the PCB. Use equal width/height for square.");Qt(!0);Pxt=we({type:he("pcb_hole"),pcb_hole_id:In("pcb_hole"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),pcb_component_id:k().optional(),hole_shape:Pt(["circle","square"]),hole_diameter:Ae(),x:Ke,y:Ke,is_covered_with_solder_mask:Be().optional(),soldermask_margin:Ae().optional()}),e1o=Pxt.describe("Defines a circular or square hole on the PCB");Qt(!0);Ext=we({type:he("pcb_hole"),pcb_hole_id:In("pcb_hole"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),pcb_component_id:k().optional(),hole_shape:he("oval"),hole_width:Ae(),hole_height:Ae(),x:Ke,y:Ke,is_covered_with_solder_mask:Be().optional(),soldermask_margin:Ae().optional()}),t1o=Ext.describe("Defines an oval hole on the PCB");Qt(!0);Mxt=we({type:he("pcb_hole"),pcb_hole_id:In("pcb_hole"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),pcb_component_id:k().optional(),hole_shape:he("pill"),hole_width:Ae(),hole_height:Ae(),x:Ke,y:Ke,is_covered_with_solder_mask:Be().optional(),soldermask_margin:Ae().optional()}),n1o=Mxt.describe("Defines a pill-shaped hole on the PCB");Qt(!0);wxt=we({type:he("pcb_hole"),pcb_hole_id:In("pcb_hole"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),pcb_component_id:k().optional(),hole_shape:he("rotated_pill"),hole_width:Ae(),hole_height:Ae(),x:Ke,y:Ke,ccw_rotation:ei,is_covered_with_solder_mask:Be().optional(),soldermask_margin:Ae().optional()}),o1o=wxt.describe("Defines a rotated pill-shaped hole on the PCB");Qt(!0);Bxt=Pxt.or(Ext).or(Mxt).or(wxt).or(vxt).or(Sxt),r1o=we({type:he("pcb_plated_hole"),shape:he("circle"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),outer_diameter:Ae(),hole_diameter:Ae(),is_covered_with_solder_mask:Be().optional(),x:Ke,y:Ke,layers:it(Bo),port_hints:it(k()).optional(),pcb_component_id:k().optional(),pcb_port_id:k().optional(),pcb_plated_hole_id:In("pcb_plated_hole"),soldermask_margin:Ae().optional()}),i1o=we({type:he("pcb_plated_hole"),shape:Pt(["oval","pill"]),pcb_group_id:k().optional(),subcircuit_id:k().optional(),outer_width:Ae(),outer_height:Ae(),hole_width:Ae(),hole_height:Ae(),is_covered_with_solder_mask:Be().optional(),x:Ke,y:Ke,ccw_rotation:ei,layers:it(Bo),port_hints:it(k()).optional(),pcb_component_id:k().optional(),pcb_port_id:k().optional(),pcb_plated_hole_id:In("pcb_plated_hole"),soldermask_margin:Ae().optional()}),s1o=we({type:he("pcb_plated_hole"),shape:he("circular_hole_with_rect_pad"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),hole_shape:he("circle"),pad_shape:he("rect"),hole_diameter:Ae(),rect_pad_width:Ae(),rect_pad_height:Ae(),rect_border_radius:Ae().optional(),hole_offset_x:Ke.default(0),hole_offset_y:Ke.default(0),is_covered_with_solder_mask:Be().optional(),x:Ke,y:Ke,layers:it(Bo),port_hints:it(k()).optional(),pcb_component_id:k().optional(),pcb_port_id:k().optional(),pcb_plated_hole_id:In("pcb_plated_hole"),soldermask_margin:Ae().optional(),rect_ccw_rotation:ei.optional()}),a1o=we({type:he("pcb_plated_hole"),shape:he("pill_hole_with_rect_pad"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),hole_shape:he("pill"),pad_shape:he("rect"),hole_width:Ae(),hole_height:Ae(),rect_pad_width:Ae(),rect_pad_height:Ae(),rect_border_radius:Ae().optional(),hole_offset_x:Ke.default(0),hole_offset_y:Ke.default(0),is_covered_with_solder_mask:Be().optional(),x:Ke,y:Ke,layers:it(Bo),port_hints:it(k()).optional(),pcb_component_id:k().optional(),pcb_port_id:k().optional(),pcb_plated_hole_id:In("pcb_plated_hole"),soldermask_margin:Ae().optional()}),c1o=we({type:he("pcb_plated_hole"),shape:he("rotated_pill_hole_with_rect_pad"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),hole_shape:he("rotated_pill"),pad_shape:he("rect"),hole_width:Ae(),hole_height:Ae(),hole_ccw_rotation:ei,rect_pad_width:Ae(),rect_pad_height:Ae(),rect_border_radius:Ae().optional(),rect_ccw_rotation:ei,hole_offset_x:Ke.default(0),hole_offset_y:Ke.default(0),is_covered_with_solder_mask:Be().optional(),x:Ke,y:Ke,layers:it(Bo),port_hints:it(k()).optional(),pcb_component_id:k().optional(),pcb_port_id:k().optional(),pcb_plated_hole_id:In("pcb_plated_hole"),soldermask_margin:Ae().optional()}),l1o=we({type:he("pcb_plated_hole"),shape:he("hole_with_polygon_pad"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),hole_shape:Pt(["circle","oval","pill","rotated_pill"]),hole_diameter:Ae().optional(),hole_width:Ae().optional(),hole_height:Ae().optional(),pad_outline:it(we({x:Ke,y:Ke})).min(3),hole_offset_x:Ke.default(0),hole_offset_y:Ke.default(0),is_covered_with_solder_mask:Be().optional(),x:Ke,y:Ke,layers:it(Bo),port_hints:it(k()).optional(),pcb_component_id:k().optional(),pcb_port_id:k().optional(),pcb_plated_hole_id:In("pcb_plated_hole"),soldermask_margin:Ae().optional(),ccw_rotation:ei.optional()}),Txt=un([r1o,i1o,s1o,a1o,c1o,l1o]);Qt(!0);Qt(!0);Qt(!0);Qt(!0);Qt(!0);Qt(!0);Dxt=we({type:he("pcb_port"),pcb_port_id:In("pcb_port"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),source_port_id:k(),pcb_component_id:k().optional(),x:Ke,y:Ke,layers:it(Bo),is_board_pinout:Be().optional()}).describe("Defines a port on the PCB");Qt(!0);h1o=we({type:he("pcb_smtpad"),shape:he("circle"),pcb_smtpad_id:In("pcb_smtpad"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),x:Ke,y:Ke,radius:Ae(),layer:Bo,port_hints:it(k()).optional(),pcb_component_id:k().optional(),pcb_port_id:k().optional(),is_covered_with_solder_mask:Be().optional(),soldermask_margin:Ae().optional(),solderpaste_margin:Ae().optional()}),d1o=we({type:he("pcb_smtpad"),shape:he("rect"),pcb_smtpad_id:In("pcb_smtpad"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),x:Ke,y:Ke,width:Ae(),height:Ae(),rect_border_radius:Ae().optional(),corner_radius:Ae().optional(),layer:Bo,port_hints:it(k()).optional(),pcb_component_id:k().optional(),pcb_port_id:k().optional(),is_covered_with_solder_mask:Be().optional(),soldermask_margin:Ae().optional(),soldermask_margin_left:Ae().optional(),soldermask_margin_top:Ae().optional(),soldermask_margin_right:Ae().optional(),soldermask_margin_bottom:Ae().optional(),solderpaste_margin:Ae().optional()}),u1o=we({type:he("pcb_smtpad"),shape:he("rotated_rect"),pcb_smtpad_id:In("pcb_smtpad"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),x:Ke,y:Ke,width:Ae(),height:Ae(),rect_border_radius:Ae().optional(),corner_radius:Ae().optional(),ccw_rotation:ei,layer:Bo,port_hints:it(k()).optional(),pcb_component_id:k().optional(),pcb_port_id:k().optional(),is_covered_with_solder_mask:Be().optional(),soldermask_margin:Ae().optional(),soldermask_margin_left:Ae().optional(),soldermask_margin_top:Ae().optional(),soldermask_margin_right:Ae().optional(),soldermask_margin_bottom:Ae().optional(),solderpaste_margin:Ae().optional()}),Nxt=we({type:he("pcb_smtpad"),shape:he("pill"),pcb_smtpad_id:In("pcb_smtpad"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),x:Ke,y:Ke,width:Ae(),height:Ae(),radius:Ae(),layer:Bo,port_hints:it(k()).optional(),pcb_component_id:k().optional(),pcb_port_id:k().optional(),is_covered_with_solder_mask:Be().optional(),soldermask_margin:Ae().optional(),solderpaste_margin:Ae().optional()}),p1o=we({type:he("pcb_smtpad"),shape:he("rotated_pill"),pcb_smtpad_id:In("pcb_smtpad"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),x:Ke,y:Ke,width:Ae(),height:Ae(),radius:Ae(),ccw_rotation:ei,layer:Bo,port_hints:it(k()).optional(),pcb_component_id:k().optional(),pcb_port_id:k().optional(),is_covered_with_solder_mask:Be().optional(),soldermask_margin:Ae().optional(),solderpaste_margin:Ae().optional()}),m1o=we({type:he("pcb_smtpad"),shape:he("polygon"),pcb_smtpad_id:In("pcb_smtpad"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),points:it(Yo),layer:Bo,port_hints:it(k()).optional(),pcb_component_id:k().optional(),pcb_port_id:k().optional(),is_covered_with_solder_mask:Be().optional(),soldermask_margin:Ae().optional(),solderpaste_margin:Ae().optional()}),Rxt=ss("shape",[h1o,d1o,u1o,p1o,Nxt,m1o]).describe("Defines an SMT pad on the PCB");Qt(!0);Qt(!0);Qt(!0);Qt(!0);Qt(!0);Qt(!0);_1o=we({type:he("pcb_solder_paste"),shape:he("circle"),pcb_solder_paste_id:In("pcb_solder_paste"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),x:Ke,y:Ke,radius:Ae(),layer:Bo,pcb_component_id:k().optional(),pcb_smtpad_id:k().optional()}),g1o=we({type:he("pcb_solder_paste"),shape:he("rect"),pcb_solder_paste_id:In("pcb_solder_paste"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),x:Ke,y:Ke,width:Ae(),height:Ae(),layer:Bo,pcb_component_id:k().optional(),pcb_smtpad_id:k().optional()}),A1o=we({type:he("pcb_solder_paste"),shape:he("pill"),pcb_solder_paste_id:In("pcb_solder_paste"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),x:Ke,y:Ke,width:Ae(),height:Ae(),radius:Ae(),layer:Bo,pcb_component_id:k().optional(),pcb_smtpad_id:k().optional()}),f1o=we({type:he("pcb_solder_paste"),shape:he("rotated_rect"),pcb_solder_paste_id:In("pcb_solder_paste"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),x:Ke,y:Ke,width:Ae(),height:Ae(),ccw_rotation:Ke,layer:Bo,pcb_component_id:k().optional(),pcb_smtpad_id:k().optional()}),y1o=we({type:he("pcb_solder_paste"),shape:he("rotated_pill"),pcb_solder_paste_id:In("pcb_solder_paste"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),x:Ke,y:Ke,width:Ae(),height:Ae(),radius:Ae(),ccw_rotation:ei,layer:Bo,pcb_component_id:k().optional(),pcb_smtpad_id:k().optional()}),x1o=we({type:he("pcb_solder_paste"),shape:he("oval"),pcb_solder_paste_id:In("pcb_solder_paste"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),x:Ke,y:Ke,width:Ae(),height:Ae(),layer:Bo,pcb_component_id:k().optional(),pcb_smtpad_id:k().optional()}),C1o=dre.extend({type:he("pcb_solder_paste"),pcb_solder_paste_id:In("pcb_solder_paste"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),holes:it(dre.shape.points).optional(),layer:Bo,pcb_component_id:k().optional(),pcb_smtpad_id:k().optional()}),Qxt=un([_1o,g1o,A1o,f1o,y1o,x1o,C1o]).describe("Defines solderpaste on the PCB");Qt(!0);Qt(!0);Qt(!0);Qt(!0);Qt(!0);Qt(!0);Qt(!0);qge=we({type:he("pcb_soldermask_opening"),pcb_soldermask_opening_id:In("pcb_soldermask_opening"),layer:Bo.pipe(_p),pcb_component_id:k().optional(),pcb_group_id:k().optional(),subcircuit_id:k().optional()}),kxt=ss("shape",[KDe.extend(qge.shape),Zge.extend(qge.shape),$De.extend(qge.shape),dre.extend(qge.shape)]).describe("An explicit opening in top or bottom solder mask or flex coverlay, independent of pads. Removes mask without adding copper or solder paste.");Qt(!0);Lxt=we({type:he("pcb_text"),pcb_text_id:In("pcb_text"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),text:k(),center:Yo,layer:Bo,width:be,height:be,lines:Ae(),align:Pt(["bottom-left"])}).describe("Defines text on the PCB");Qt(!0);N1t=Ke.pipe(Ae().finite().positive()),Hxt=we({route_type:he("wire"),x:Ke,y:Ke,width:Ke,start_width:N1t.optional(),end_width:N1t.optional(),width_interpolation_mode:Pt(["linear","quadratic"]).optional(),copper_pour_id:k().optional(),is_inside_copper_pour:Be().optional(),start_pcb_port_id:k().optional(),end_pcb_port_id:k().optional(),layer:Bo}).superRefine((e,t)=>{let n=[e.start_width,e.end_width,e.width_interpolation_mode].filter((o)=>o!==void 0).length;if(n===0)return;if(n!==3)t.addIssue({code:Vt.custom,message:"Wire taper requires start_width, end_width and width_interpolation_mode together"});if(e.width!==e.start_width)t.addIssue({code:Vt.custom,path:["start_width"],message:"start_width must equal width"});if(!Number.isFinite(e.x)||!Number.isFinite(e.y))t.addIssue({code:Vt.custom,message:"Tapered wire coordinates must be finite"})}),Fxt=we({route_type:he("via"),x:Ke,y:Ke,copper_pour_id:k().optional(),is_inside_copper_pour:Be().optional(),hole_diameter:Ke.optional(),outer_diameter:Ke.optional(),tented_on_top:Be().optional(),tented_on_bottom:Be().optional(),from_layer:Bo,to_layer:Bo}),zxt=we({route_type:he("through_pad"),start:Yo,end:Yo,width:Ke,start_layer:Bo,end_layer:Bo,pcb_smtpad_id:k().optional(),pcb_plated_hole_id:k().optional()}),aAe=un([Hxt,Fxt,zxt]),Oxt=we({type:he("pcb_trace"),source_trace_id:k().optional(),pcb_component_id:k().optional(),pcb_trace_id:In("pcb_trace"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),route_thickness_mode:Pt(["constant","interpolated"]).default("constant").optional(),route_order_index:Ae().optional(),should_round_corners:Be().optional(),trace_length:Ae().optional(),is_antenna_trace:Be().optional(),highlight_color:k().optional(),route:it(aAe).superRefine((e,t)=>{for(let[n,o]of e.entries()){if(o.route_type!=="wire"||o.width_interpolation_mode===void 0)continue;let r=e[n+1],i=r?.route_type==="through_pad"?r.start:r,s=r?.route_type==="wire"?r.layer:r?.route_type==="via"?r.from_layer:r?.start_layer,a=i?Math.hypot(i.x-o.x,i.y-o.y):NaN;if(!Number.isFinite(a)||a<=0||s!==o.layer)t.addIssue({code:Vt.custom,path:[n],message:"Tapered wire must lead to a distinct finite next point on the same layer"})}})}).describe("Defines a trace on the PCB");Qt(!0);Qt(!0);Vxt=we({type:he("pcb_trace_warning"),pcb_trace_warning_id:In("pcb_trace_warning"),warning_type:he("pcb_trace_warning").default("pcb_trace_warning"),message:k(),center:Yo.optional(),pcb_trace_id:k(),source_trace_id:k(),pcb_component_ids:it(k()),pcb_port_ids:it(k()),subcircuit_id:k().optional()}).describe("Defines a trace warning on the PCB");Qt(!0);Yxt=we({type:he("pcb_trace_style_warning"),pcb_trace_style_warning_id:In("pcb_trace_style_warning"),warning_type:he("pcb_trace_style_warning").default("pcb_trace_style_warning"),message:k(),styling_issue_type:he("long_segment_at_odd_angle"),pcb_trace_id:k(),source_trace_id:k().optional(),subcircuit_id:k().optional(),layer:Bo,start_route_index:Ae().int().nonnegative(),end_route_index:Ae().int().nonnegative(),segment_start:Yo,segment_end:Yo,center:Yo,segment_length:Ke,minimum_segment_length:Ke,angle_degrees:Ae().min(0).lt(360),nearest_allowed_angle_degrees:Ae().min(0).lt(360).multipleOf(45),angle_deviation_degrees:Ae().min(0).max(22.5),angle_tolerance_degrees:Ae().min(0).lt(22.5)}).describe("Warning for a long PCB trace segment whose direction deviates from a multiple of 45 degrees");Qt(!0);Gxt=we({type:he("pcb_trace_too_long_error"),pcb_trace_too_long_error_id:In("pcb_trace_too_long_error"),error_type:he("pcb_trace_too_long_error").default("pcb_trace_too_long_error"),message:k(),pcb_trace_id:k(),source_net_id:k().optional(),source_trace_id:k().optional(),actual_trace_length:Ke,maximum_trace_length:Ke,subcircuit_id:k().optional()}).describe("Error emitted when a PCB trace is longer than its maximum allowed length");Qt(!0);Uxt=hc.extend({type:he("pcb_bus_length_skew_error"),pcb_bus_length_skew_error_id:In("pcb_bus_length_skew_error"),error_type:he("pcb_bus_length_skew_error").default("pcb_bus_length_skew_error"),source_bus_id:k(),source_trace_ids:it(k()),pcb_trace_ids:it(k()),actual_length_skew:Ae().nonnegative().finite(),maximum_length_skew:Ae().nonnegative().finite(),subcircuit_id:k().optional()});Qt(!0);Wxt=we({type:he("pcb_trace_too_long_warning"),pcb_trace_too_long_warning_id:In("pcb_trace_too_long_warning"),warning_type:he("pcb_trace_too_long_warning").default("pcb_trace_too_long_warning"),message:k(),pcb_trace_id:k(),source_net_id:k().optional(),source_trace_id:k().optional(),actual_trace_length:Ke,maximum_trace_length:Ke,subcircuit_id:k().optional()}).describe("Warning emitted when a PCB trace is longer than its maximum allowed length");Qt(!0);Xxt=we({type:he("pcb_trace_too_many_vias_warning"),pcb_trace_too_many_vias_warning_id:In("pcb_trace_too_many_vias_warning"),warning_type:he("pcb_trace_too_many_vias_warning").default("pcb_trace_too_many_vias_warning"),message:k(),pcb_trace_id:k(),source_net_id:k().optional(),source_trace_id:k().optional(),actual_via_count:Ae().int().nonnegative(),maximum_via_count:Ae().int().nonnegative(),subcircuit_id:k().optional()}).describe("Warning emitted when a PCB trace has more vias than its maximum allowed count");Qt(!0);HF=hc.extend({type:he("pcb_bus_routing_constraint_error"),pcb_bus_routing_constraint_error_id:In("pcb_bus_routing_constraint_error"),error_type:he("pcb_bus_routing_constraint_error").default("pcb_bus_routing_constraint_error"),source_bus_id:k(),source_trace_ids:it(k()).min(1),pcb_trace_ids:it(k()),subcircuit_id:k().optional()}),cAe=ss("routing_rule",[HF.extend({routing_rule:he("length_skew"),actual_length_skew:Ae().nonnegative().finite(),maximum_length_skew:Ae().nonnegative().finite()}),HF.extend({routing_rule:he("min_length"),actual_trace_length:Ae().nonnegative().finite(),minimum_trace_length:Ae().finite()}),HF.extend({routing_rule:he("max_length"),actual_trace_length:Ae().nonnegative().finite(),maximum_trace_length:Ae().finite()}),HF.extend({routing_rule:he("target_length"),actual_trace_length:Ae().nonnegative().finite(),target_trace_length:Ae().finite(),length_tolerance:Ae().nonnegative().finite()}),HF.extend({routing_rule:he("pcb_trace_spacing"),other_pcb_trace_id:k(),other_source_trace_id:k().optional(),actual_centerline_spacing:Ae().nonnegative().finite(),minimum_centerline_spacing:Ae().positive().finite()}),HF.extend({routing_rule:he("pcb_spacing_to_other_signals"),other_pcb_trace_id:k(),other_source_trace_id:k().optional(),actual_centerline_spacing:Ae().nonnegative().finite(),minimum_centerline_spacing:Ae().positive().finite()}),HF.extend({routing_rule:he("impedance_target"),target_impedance:Ae().positive().finite(),minimum_impedance:Ae().positive().finite().optional(),maximum_impedance:Ae().positive().finite().optional()})]).superRefine((e,t)=>{if(e.routing_rule!=="impedance_target")return;if(e.minimum_impedance===void 0&&e.maximum_impedance===void 0)t.addIssue({code:Vt.custom,path:["minimum_impedance"],message:"Provide an impedance bound"});if(e.minimum_impedance!==void 0&&e.maximum_impedance!==void 0&&e.minimum_impedance>e.maximum_impedance)t.addIssue({code:Vt.custom,path:["maximum_impedance"],message:"Impedance bounds must be ordered"})}).describe("A declared bus or differential-pair routing constraint is violated.");Qt(!0);cre=we({type:he("pcb_bus_routing_constraint_warning"),pcb_bus_routing_constraint_warning_id:In("pcb_bus_routing_constraint_warning"),warning_type:he("pcb_bus_routing_constraint_warning").default("pcb_bus_routing_constraint_warning"),source_bus_id:k(),source_trace_ids:it(k()).min(1),pcb_trace_ids:it(k()),message:k(),subcircuit_id:k().optional()}).describe("A declared bus or pair constraint could not be verified; this is not a pass."),lAe=ss("routing_rule",[cre.extend({routing_rule:he("route_geometry")}),cre.extend({routing_rule:he("reference_geometry")}),cre.extend({routing_rule:he("spacing_geometry")}),cre.extend({routing_rule:he("target_length")}),cre.extend({routing_rule:he("physical_impedance")})]);Qt(!0);jxt=hc.extend({type:he("pcb_trace_error"),pcb_trace_error_id:In("pcb_trace_error"),error_type:he("pcb_trace_error").default("pcb_trace_error"),center:Yo.optional(),pcb_trace_id:k(),source_trace_id:k(),pcb_component_ids:it(k()),pcb_port_ids:it(k()),subcircuit_id:k().optional()}).describe("Defines a trace error on the PCB");Qt(!0);Kxt=hc.extend({type:he("pcb_trace_missing_error"),pcb_trace_missing_error_id:In("pcb_trace_missing_error"),error_type:he("pcb_trace_missing_error").default("pcb_trace_missing_error"),center:Yo.optional(),source_trace_id:k(),pcb_component_ids:it(k()),pcb_port_ids:it(k()),subcircuit_id:k().optional()}).describe("Defines an error when a source trace has no corresponding PCB trace");Qt(!0);$xt=hc.extend({type:he("pcb_port_not_matched_error"),pcb_error_id:In("pcb_error"),error_type:he("pcb_port_not_matched_error").default("pcb_port_not_matched_error"),pcb_component_ids:it(k()),subcircuit_id:k().optional()}).describe("Defines a trace error on the PCB where a port is not matched");Qt(!0);qxt=hc.extend({type:he("pcb_port_not_connected_error"),pcb_port_not_connected_error_id:In("pcb_port_not_connected_error"),error_type:he("pcb_port_not_connected_error").default("pcb_port_not_connected_error"),pcb_port_ids:it(k()),pcb_component_ids:it(k()),subcircuit_id:k().optional()}).describe("Defines an error when a pcb port is not connected to any trace");Qt(!0);Jxt=we({type:he("pcb_net"),pcb_net_id:In("pcb_net"),source_net_id:k().optional(),highlight_color:k().optional()}).describe("Defines a net on the PCB");Qt(!0);vN=we({type:he("pcb_via"),pcb_via_id:In("pcb_via"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),subcircuit_connectivity_map_key:k().optional(),x:Ke,y:Ke,outer_diameter:Ke.default("0.6mm"),hole_diameter:Ke.default("0.25mm"),topmost_drill_layer:Bo.optional(),bottommost_drill_layer:Bo.optional(),through_hole:Be().optional(),from_layer:Bo.optional(),to_layer:Bo.optional(),layers:it(Bo),pcb_port_ids:it(k()).optional(),pcb_trace_id:k().optional(),source_trace_id:k().optional(),source_net_id:k().min(1).optional(),net_is_assignable:Be().optional(),net_assigned:Be().optional(),is_tented:Be().optional(),tented_on_top:Be().optional(),tented_on_bottom:Be().optional()}).transform(({is_tented:e,...t})=>{if(e!==void 0)t.tented_on_top??=e,t.tented_on_bottom??=e;return t}).describe("Defines a via on the PCB");Qt(!0);Zxt=we({type:he("pcb_board"),pcb_board_id:In("pcb_board"),pcb_panel_id:k().optional(),carrier_pcb_board_id:k().optional(),is_subcircuit:Be().optional(),subcircuit_id:k().optional(),is_mounted_to_carrier_board:Be().optional(),is_via_in_pad_allowed:Be().optional(),default_via_tented_on_top:Be().optional(),default_via_tented_on_bottom:Be().optional(),default_via_plugged:Be().optional(),width:be.optional(),height:be.optional(),center:Yo,display_offset_x:k().optional().describe("How to display the x offset for this board, usually corresponding with how the user specified it"),display_offset_y:k().optional().describe("How to display the y offset for this board, usually corresponding with how the user specified it"),thickness:be.optional().default(1.4),num_layers:Ae().optional().default(4),allow_blind_and_buried_vias:Be().optional().describe("Whether autorouters may generate blind and buried vias. False restricts newly generated vias to the full board stack."),outline:it(Yo).optional(),shape:Pt(["rect","polygon"]).optional(),material:Pt(["fr4","fr1","flex"]).default("fr4"),solder_mask_color:k().optional(),silkscreen_color:k().optional(),anchor_position:Yo.optional(),anchor_alignment:pM.optional(),position_mode:Pt(["relative_to_panel_anchor","none"]).optional()}).merge(fxt).describe("Defines the board outline of the PCB");Qt(!0);R1t=Yo.extend({x:be.pipe(Ae().finite()),y:be.pipe(Ae().finite())}),e5t=we({type:he("pcb_bend"),pcb_bend_id:In("pcb_bend"),pcb_board_id:k(),pcb_group_id:k().optional(),subcircuit_id:k().optional(),name:k().optional(),start:R1t,end:R1t,bend_angle:ei.pipe(Ae().finite()),bend_radius:be.pipe(Ae().finite().positive()),bend_side:Pt(["left","right"])}).refine(({start:e,end:t})=>e.x!==t.x||e.y!==t.y,{message:"Bend centerline endpoints must be distinct",path:["end"]}).describe("Defines a finite-radius bend on a flat PCB for runtime CAD folding");Qt(!0);WDe=be.pipe(Ae().finite().positive()),t5t=Yo.extend({x:be.pipe(Ae().finite()),y:be.pipe(Ae().finite())}),n5t=we({type:he("pcb_stiffener"),pcb_stiffener_id:In("pcb_stiffener"),pcb_board_id:k(),pcb_group_id:k().optional(),subcircuit_id:k().optional(),name:k().optional(),layer:Pt(["top","bottom"]),material:Pt(["fr4","polyimide","stainless_steel","aluminum"]),thickness:WDe,adhesive_thickness:be.pipe(Ae().finite().nonnegative()).optional()}),o5t=n5t.extend({shape:he("rect"),center:t5t,rotation:ei.pipe(Ae().finite()).optional(),width:WDe,height:WDe,outline:sm().optional()});Qt(!0);r5t=n5t.extend({shape:he("polygon"),outline:it(t5t).min(3).refine((e)=>{let t=e.reduce((n,o,r)=>{let i=e[(r+1)%e.length];return n+o.x*i.y-i.x*o.y},0);return Number.isFinite(t)&&t!==0},"Stiffener outline must enclose a nonzero area"),center:sm().optional(),rotation:sm().optional(),width:sm().optional(),height:sm().optional()});Qt(!0);i5t=ss("shape",[o5t,r5t]).describe("Defines bonded mechanical PCB reinforcement without adding copper layers");Qt(!0);s5t=we({type:he("pcb_panel"),pcb_panel_id:In("pcb_panel"),width:be,height:be,center:Yo,thickness:be.optional().default(1.4),covered_with_solder_mask:Be().optional().default(!0)}).describe("Defines a PCB panel that can contain multiple boards");Qt(!0);a5t=hc.extend({type:he("pcb_placement_error"),pcb_placement_error_id:In("pcb_placement_error"),error_type:he("pcb_placement_error").default("pcb_placement_error"),subcircuit_id:k().optional()}).describe("Defines a placement error on the PCB");Qt(!0);c5t=hc.extend({type:he("pcb_packing_error"),pcb_packing_error_id:In("pcb_packing_error"),error_type:he("pcb_packing_error").default("pcb_packing_error"),pcb_group_id:k().optional(),subcircuit_id:k().optional()}).describe("Defines a failure to pack PCB components within layout bounds");Qt(!0);l5t=hc.extend({type:he("pcb_panelization_placement_error"),pcb_panelization_placement_error_id:In("pcb_panelization_placement_error"),error_type:he("pcb_panelization_placement_error").default("pcb_panelization_placement_error"),pcb_panel_id:k().optional(),pcb_board_id:k().optional(),subcircuit_id:k().optional()}).describe("Defines a panelization placement error on the PCB");Qt(!0);h5t=we({type:he("pcb_trace_hint"),pcb_trace_hint_id:In("pcb_trace_hint"),pcb_port_id:k(),pcb_component_id:k(),route:it(yf),subcircuit_id:k().optional()}).describe("A hint that can be used during generation of a PCB trace");Qt(!0);d5t=we({type:he("pcb_silkscreen_line"),pcb_silkscreen_line_id:In("pcb_silkscreen_line"),pcb_component_id:k(),pcb_group_id:k().optional(),subcircuit_id:k().optional(),stroke_width:Ke.default("0.1mm"),x1:Ke,y1:Ke,x2:Ke,y2:Ke,layer:_p}).describe("Defines a silkscreen line on the PCB");Qt(!0);u5t=we({type:he("pcb_silkscreen_path"),pcb_silkscreen_path_id:In("pcb_silkscreen_path"),pcb_component_id:k(),pcb_group_id:k().optional(),subcircuit_id:k().optional(),layer:_p,route:it(Yo),stroke_width:be}).describe("Defines a silkscreen path on the PCB");Qt(!0);p5t=we({type:he("pcb_silkscreen_text"),pcb_silkscreen_text_id:In("pcb_silkscreen_text"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),font:he("tscircuit2024").default("tscircuit2024"),font_size:Ke.default("0.2mm"),pcb_component_id:k(),text:k(),is_knockout:Be().default(!1).optional(),knockout_padding:we({left:be,top:be,bottom:be,right:be}).default({left:"0.2mm",top:"0.2mm",bottom:"0.2mm",right:"0.2mm"}).optional(),ccw_rotation:Ae().optional(),layer:Bo,is_mirrored:Be().default(!1).optional(),anchor_position:Yo.default({x:0,y:0}),anchor_alignment:pM.default("center")}).describe("Defines silkscreen text on the PCB");Qt(!0);m5t=we({type:he("pcb_copper_text"),pcb_copper_text_id:In("pcb_copper_text"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),font:he("tscircuit2024").default("tscircuit2024"),font_size:Ke.default("0.2mm"),pcb_component_id:k(),text:k(),is_knockout:Be().default(!1).optional(),knockout_padding:we({left:be,top:be,bottom:be,right:be}).default({left:"0.2mm",top:"0.2mm",bottom:"0.2mm",right:"0.2mm"}).optional(),ccw_rotation:Ae().optional(),layer:Bo,is_mirrored:Be().default(!1).optional(),anchor_position:Yo.default({x:0,y:0}),anchor_alignment:pM.default("center")}).describe("Defines copper text on the PCB");Qt(!0);_5t=we({type:he("pcb_silkscreen_rect"),pcb_silkscreen_rect_id:In("pcb_silkscreen_rect"),pcb_component_id:k(),pcb_group_id:k().optional(),subcircuit_id:k().optional(),center:Yo,width:be,height:be,layer:Bo,stroke_width:be.default("1mm"),corner_radius:be.optional(),is_filled:Be().default(!0).optional(),has_stroke:Be().optional(),is_stroke_dashed:Be().optional(),ccw_rotation:Ae().optional()}).describe("Defines a silkscreen rect on the PCB");Qt(!0);g5t=we({type:he("pcb_silkscreen_circle"),pcb_silkscreen_circle_id:In("pcb_silkscreen_circle"),pcb_component_id:k(),pcb_group_id:k().optional(),subcircuit_id:k().optional(),center:Yo,radius:be,layer:_p,stroke_width:be.default("1mm"),is_filled:Be().optional()}).describe("Defines a silkscreen circle on the PCB");Qt(!0);A5t=we({type:he("pcb_silkscreen_oval"),pcb_silkscreen_oval_id:In("pcb_silkscreen_oval"),pcb_component_id:k(),pcb_group_id:k().optional(),subcircuit_id:k().optional(),center:Yo,radius_x:Ke,radius_y:Ke,layer:_p,ccw_rotation:ei.optional()}).describe("Defines a silkscreen oval on the PCB");Qt(!0);b1o=we({type:he("pcb_silkscreen_graphic"),pcb_silkscreen_graphic_id:In("pcb_silkscreen_graphic"),pcb_component_id:k(),pcb_group_id:k().optional(),subcircuit_id:k().optional(),layer:_p,image_asset:ure.optional()}),f5t=b1o.extend({shape:he("brep"),brep_shape:INe}).describe("Defines a BRep silkscreen graphic on the PCB");Qt(!0);y5t=ss("shape",[f5t]).describe("Defines a silkscreen graphic on the PCB");Qt(!0);x5t=we({type:he("pcb_silkscreen_pill"),pcb_silkscreen_pill_id:In("pcb_silkscreen_pill"),pcb_component_id:k(),pcb_group_id:k().optional(),subcircuit_id:k().optional(),center:Yo,width:be,height:be,layer:Bo,ccw_rotation:Ae().optional()}).describe("Defines a silkscreen pill on the PCB");Qt(!0);C5t=we({type:he("pcb_fabrication_note_text"),pcb_fabrication_note_text_id:In("pcb_fabrication_note_text"),subcircuit_id:k().optional(),pcb_group_id:k().optional(),font:he("tscircuit2024").default("tscircuit2024"),font_size:Ke.default("1mm"),pcb_component_id:k(),text:k(),ccw_rotation:Ae().optional(),layer:_p,anchor_position:Yo.default({x:0,y:0}),anchor_alignment:Pt(["center","top_left","top_right","bottom_left","bottom_right"]).default("center"),color:k().optional()}).describe("Defines a fabrication note in text on the PCB, useful for leaving notes for assemblers or fabricators");Qt(!0);b5t=we({type:he("pcb_fabrication_note_path"),pcb_fabrication_note_path_id:In("pcb_fabrication_note_path"),pcb_component_id:k(),subcircuit_id:k().optional(),layer:Bo,route:it(Yo),stroke_width:be,color:k().optional(),is_filled:Be().optional(),has_stroke:Be().optional()}).describe("Defines a fabrication path on the PCB for fabricators or assemblers");Qt(!0);I5t=we({type:he("pcb_fabrication_note_rect"),pcb_fabrication_note_rect_id:In("pcb_fabrication_note_rect"),pcb_component_id:k(),pcb_group_id:k().optional(),subcircuit_id:k().optional(),center:Yo,width:be,height:be,layer:_p,stroke_width:be.default("0.1mm"),corner_radius:be.optional(),is_filled:Be().optional(),has_stroke:Be().optional(),is_stroke_dashed:Be().optional(),color:k().optional()}).describe("Defines a fabrication note rectangle on the PCB");Qt(!0);v5t=we({type:he("pcb_fabrication_note_dimension"),pcb_fabrication_note_dimension_id:In("pcb_fabrication_note_dimension"),pcb_component_id:k(),pcb_group_id:k().optional(),subcircuit_id:k().optional(),layer:_p,from:Yo,to:Yo,text:k().optional(),text_ccw_rotation:Ae().optional(),offset:be.optional(),offset_distance:be.optional(),offset_direction:we({x:Ae(),y:Ae()}).optional(),font:he("tscircuit2024").default("tscircuit2024"),font_size:be.default("1mm"),color:k().optional(),arrow_size:be.default("1mm")}).describe("Defines a measurement annotation within PCB fabrication notes");Qt(!0);S5t=we({type:he("pcb_note_text"),pcb_note_text_id:In("pcb_note_text"),pcb_component_id:k().optional(),pcb_group_id:k().optional(),subcircuit_id:k().optional(),name:k().optional(),font:he("tscircuit2024").default("tscircuit2024"),font_size:Ke.default("1mm"),text:k().optional(),anchor_position:Yo.default({x:0,y:0}),anchor_alignment:Pt(["center","top_left","top_right","bottom_left","bottom_right"]).default("center"),layer:_p.default("top"),is_mirrored_from_top_view:Be().optional(),color:k().optional()}).describe("Defines a documentation note in text on the PCB");Qt(!0);P5t=we({type:he("pcb_note_rect"),pcb_note_rect_id:In("pcb_note_rect"),pcb_component_id:k().optional(),pcb_group_id:k().optional(),subcircuit_id:k().optional(),name:k().optional(),text:k().optional(),center:Yo,width:be,height:be,layer:_p.default("top"),stroke_width:be.default("0.1mm"),corner_radius:be.optional(),is_filled:Be().optional(),has_stroke:Be().optional(),is_stroke_dashed:Be().optional(),color:k().optional()}).describe("Defines a rectangular documentation note on the PCB");Qt(!0);E5t=we({type:he("pcb_note_path"),pcb_note_path_id:In("pcb_note_path"),pcb_component_id:k().optional(),pcb_group_id:k().optional(),subcircuit_id:k().optional(),name:k().optional(),text:k().optional(),route:it(Yo),layer:_p.default("top"),stroke_width:be.default("0.1mm"),color:k().optional()}).describe("Defines a polyline documentation note on the PCB");Qt(!0);M5t=we({type:he("pcb_note_line"),pcb_note_line_id:In("pcb_note_line"),pcb_component_id:k().optional(),pcb_group_id:k().optional(),subcircuit_id:k().optional(),name:k().optional(),text:k().optional(),x1:Ke,y1:Ke,x2:Ke,y2:Ke,layer:_p.default("top"),stroke_width:Ke.default("0.1mm"),color:k().optional(),is_dashed:Be().optional()}).describe("Defines a straight documentation note line on the PCB");Qt(!0);w5t=we({type:he("pcb_note_dimension"),pcb_note_dimension_id:In("pcb_note_dimension"),pcb_component_id:k().optional(),pcb_group_id:k().optional(),subcircuit_id:k().optional(),name:k().optional(),from:Yo,to:Yo,text:k().optional(),text_ccw_rotation:Ae().optional(),offset_distance:be.optional(),offset_direction:we({x:Ae(),y:Ae()}).optional(),font:he("tscircuit2024").default("tscircuit2024"),font_size:be.default("1mm"),layer:_p.default("top"),color:k().optional(),arrow_size:be.default("1mm")}).describe("Defines a measurement annotation within PCB documentation notes");Qt(!0);B5t=hc.extend({type:he("pcb_footprint_overlap_error"),pcb_error_id:In("pcb_error"),error_type:he("pcb_footprint_overlap_error").default("pcb_footprint_overlap_error"),pcb_smtpad_ids:it(k()).optional(),pcb_plated_hole_ids:it(k()).optional(),pcb_hole_ids:it(k()).optional(),pcb_keepout_ids:it(k()).optional()}).describe("Error emitted when a pcb footprint overlaps with another element");Qt(!0);T5t=hc.extend({type:he("pcb_courtyard_overlap_error"),pcb_error_id:In("pcb_error"),error_type:he("pcb_courtyard_overlap_error").default("pcb_courtyard_overlap_error"),pcb_component_ids:kC([k(),k()])}).describe("Error emitted when the courtyard (CrtYd) of one PCB component overlaps with the courtyard of another");Qt(!0);D5t=we({type:he("pcb_keepout"),shape:he("outline"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),outline:it(Yo).min(2),stroke_width:be,pcb_keepout_id:k(),layers:it(k()),description:k().optional(),excluded_pcb_component_ids:it(k()).optional(),warning_only:Be().optional(),allow_traces:Be().optional(),allow_placements:Be().optional()}),N5t=we({type:he("pcb_keepout"),shape:he("rect"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),center:Yo,width:Ke,height:Ke,pcb_keepout_id:k(),layers:it(k()),description:k().optional(),excluded_pcb_component_ids:it(k()).optional(),warning_only:Be().optional(),allow_traces:Be().optional(),allow_placements:Be().optional()}).or(we({type:he("pcb_keepout"),shape:he("circle"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),center:Yo,radius:Ke,pcb_keepout_id:k(),layers:it(k()),description:k().optional(),excluded_pcb_component_ids:it(k()).optional(),warning_only:Be().optional(),allow_traces:Be().optional(),allow_placements:Be().optional()})).or(D5t);Qt(!0);Qt(!0);R5t=we({type:he("pcb_keepout_overlap_warning"),pcb_keepout_overlap_warning_id:In("pcb_keepout_overlap_warning"),warning_type:he("pcb_keepout_overlap_warning").default("pcb_keepout_overlap_warning"),message:k(),pcb_keepout_id:k(),pcb_component_ids:it(k()).optional(),pcb_trace_ids:it(k()).optional(),pcb_smtpad_ids:it(k()).optional(),pcb_plated_hole_ids:it(k()).optional(),pcb_via_ids:it(k()).optional(),center:Yo.optional(),subcircuit_id:k().optional()}).describe("Warning emitted when copper overlaps a PCB keepout with warning_only enabled");Qt(!0);hAe=we({type:he("pcb_cutout"),pcb_cutout_id:In("pcb_cutout"),pcb_component_id:k().optional(),pcb_group_id:k().optional(),subcircuit_id:k().optional(),pcb_board_id:k().optional(),pcb_panel_id:k().optional()}),Q5t=hAe.extend({shape:he("rect"),center:Yo,width:be,height:be,rotation:ei.optional(),corner_radius:be.optional()});Qt(!0);k5t=hAe.extend({shape:he("circle"),center:Yo,radius:be});Qt(!0);L5t=hAe.extend({shape:he("polygon"),points:it(Yo)});Qt(!0);H5t=hAe.extend({shape:he("path"),route:it(Yo),slot_width:be,slot_length:be.optional(),space_between_slots:be.optional(),slot_corner_radius:be.optional()});Qt(!0);F5t=ss("shape",[Q5t,k5t,L5t,H5t]).describe("Defines a cutout on the PCB, removing board material.");Qt(!0);z5t=hc.extend({type:he("pcb_missing_footprint_error"),pcb_missing_footprint_error_id:In("pcb_missing_footprint_error"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),error_type:he("pcb_missing_footprint_error").default("pcb_missing_footprint_error"),source_component_id:k()}).describe("Defines a missing footprint error on the PCB");Qt(!0);dX=hc.extend({type:he("external_footprint_load_error"),external_footprint_load_error_id:In("external_footprint_load_error"),pcb_component_id:k(),source_component_id:k(),pcb_group_id:k().optional(),subcircuit_id:k().optional(),footprinter_string:k().optional(),error_type:he("external_footprint_load_error").default("external_footprint_load_error")}).describe("Defines an error when an external footprint fails to load");Qt(!0);dAe=hc.extend({type:he("circuit_json_footprint_load_error"),circuit_json_footprint_load_error_id:In("circuit_json_footprint_load_error"),pcb_component_id:k(),source_component_id:k(),pcb_group_id:k().optional(),subcircuit_id:k().optional(),error_type:he("circuit_json_footprint_load_error").default("circuit_json_footprint_load_error"),circuit_json:it(Jh()).optional()}).describe("Defines an error when a circuit JSON footprint fails to load");Qt(!0);O5t=we({type:he("pcb_group"),pcb_group_id:In("pcb_group"),source_group_id:k(),is_subcircuit:Be().optional(),subcircuit_id:k().optional(),width:be.optional(),height:be.optional(),center:Yo,display_offset_x:k().optional().describe("How to display the x offset for this group, usually corresponding with how the user specified it"),display_offset_y:k().optional().describe("How to display the y offset for this group, usually corresponding with how the user specified it"),outline:it(Yo).optional(),anchor_position:Yo.optional(),anchor_alignment:pM.default("center"),position_mode:Pt(["packed","relative_to_group_anchor","none"]).optional(),positioned_relative_to_pcb_group_id:k().optional(),positioned_relative_to_pcb_board_id:k().optional(),pcb_component_ids:it(k()),child_layout_mode:Pt(["packed","none"]).optional(),name:k().optional(),description:k().optional(),layout_mode:k().optional(),autorouter_configuration:we({trace_clearance:be}).optional(),autorouter_used_string:k().optional()}).describe("Defines a group of components on the PCB");Qt(!0);V5t=hc.extend({type:he("pcb_autorouting_error"),pcb_error_id:In("pcb_autorouting_error"),error_type:he("pcb_autorouting_error").default("pcb_autorouting_error"),subcircuit_id:k().optional()}).describe("The autorouting has failed to route a portion of the board");Qt(!0);Y5t=hc.extend({type:he("pcb_preflight_routing_error"),pcb_preflight_routing_error_id:In("pcb_preflight_routing_error"),error_type:he("pcb_preflight_routing_error").default("pcb_preflight_routing_error"),error_code:k(),subcircuit_id:k().optional(),pcb_group_id:k().optional(),routing_phase_index:Ae().int().optional(),phase_name:k().optional(),source_trace_ids:it(k()).optional(),pcb_component_ids:it(k()).optional(),pcb_port_ids:it(k()).optional(),related_error_ids:it(k()).optional(),measurements:gs(Ae().finite()).optional()});Qt(!0);uAe=we({type:he("pcb_manual_edit_conflict_warning"),pcb_manual_edit_conflict_warning_id:In("pcb_manual_edit_conflict_warning"),warning_type:he("pcb_manual_edit_conflict_warning").default("pcb_manual_edit_conflict_warning"),message:k(),pcb_component_id:k(),pcb_group_id:k().optional(),subcircuit_id:k().optional(),source_component_id:k()}).describe("Warning emitted when a component has both manual placement and explicit pcbX/pcbY coordinates");Qt(!0);Q1t=Pt(["x-","x+","y+","y-"]),G5t=we({type:he("pcb_connector_not_in_accessible_orientation_warning"),pcb_connector_not_in_accessible_orientation_warning_id:In("pcb_connector_not_in_accessible_orientation_warning"),warning_type:he("pcb_connector_not_in_accessible_orientation_warning").default("pcb_connector_not_in_accessible_orientation_warning"),message:k(),pcb_component_id:k(),source_component_id:k().optional(),pcb_board_id:k().optional(),facing_direction:Q1t,recommended_facing_direction:Q1t,subcircuit_id:k().optional()}).describe("Warning emitted when a connector PCB component is facing inward toward the board and should be reoriented to an outward-facing direction");Qt(!0);U5t=we({type:he("pcb_component_missing_courtyard_warning"),pcb_component_missing_courtyard_warning_id:In("pcb_component_missing_courtyard_warning"),warning_type:he("pcb_component_missing_courtyard_warning").default("pcb_component_missing_courtyard_warning"),message:k(),pcb_component_id:k(),source_component_id:k().optional(),subcircuit_id:k().optional()}).describe("Warning emitted when a PCB component has no courtyard geometry");Qt(!0);pAe=we({type:he("supplier_footprint_mismatch_warning"),supplier_footprint_mismatch_warning_id:In("supplier_footprint_mismatch_warning"),warning_type:he("supplier_footprint_mismatch_warning").default("supplier_footprint_mismatch_warning"),message:k(),source_component_id:k(),pcb_component_id:k().optional(),pcb_group_id:k().optional(),subcircuit_id:k().optional(),supplier_name:K8.optional(),supplier_part_number:k().optional(),supplier_footprint_url:k().optional(),footprint_copper_intersection_over_union:Ae()}).describe("Warning emitted when a supplier part footprint does not match the expected footprint");Qt(!0);W5t=we({type:he("pcb_fabricator_extra_charge_warning"),pcb_fabricator_extra_charge_warning_id:In("pcb_fabricator_extra_charge_warning"),warning_type:he("pcb_fabricator_extra_charge_warning").default("pcb_fabricator_extra_charge_warning"),message:k(),fabricator_preset:k(),pcb_board_id:k().optional(),pcb_via_ids:it(k()).optional(),subcircuit_id:k().optional()}).describe("Warning that a design feature incurs an extra charge for the selected fabricator preset, such as via hole diameters below 0.3 mm with JLCPCB economy or standard presets.");Qt(!0);X5t=we({type:he("pcb_breakout_point"),pcb_breakout_point_id:In("pcb_breakout_point"),pcb_group_id:k(),subcircuit_id:k().optional(),source_trace_id:k().optional(),source_port_id:k().optional(),source_net_id:k().optional(),layer:Bo.optional(),x:Ke,y:Ke}).describe("Defines a routing target within a pcb_group for a source_trace or source_net");Qt(!0);j5t=we({type:he("pcb_ground_plane"),pcb_ground_plane_id:In("pcb_ground_plane"),source_pcb_ground_plane_id:k(),source_net_id:k(),pcb_group_id:k().optional(),subcircuit_id:k().optional()}).describe("Defines a ground plane on the PCB");Qt(!0);K5t=we({type:he("pcb_ground_plane_region"),pcb_ground_plane_region_id:In("pcb_ground_plane_region"),pcb_ground_plane_id:k(),pcb_group_id:k().optional(),subcircuit_id:k().optional(),layer:Bo,points:it(Yo)}).describe("Defines a polygon region of a ground plane");Qt(!0);$5t=we({type:he("pcb_thermal_spoke"),pcb_thermal_spoke_id:In("pcb_thermal_spoke"),pcb_ground_plane_id:k(),shape:k(),spoke_count:Ae(),spoke_thickness:Ke,spoke_inner_diameter:Ke,spoke_outer_diameter:Ke,pcb_plated_hole_id:k().optional(),subcircuit_id:k().optional()}).describe("Pattern for connecting a ground plane to a plated hole");Qt(!0);vNe=we({type:he("pcb_copper_pour"),pcb_copper_pour_id:In("pcb_copper_pour"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),layer:Bo,source_net_id:k().optional(),covered_with_solder_mask:Be().optional().default(!0)}),q5t=vNe.extend({shape:he("rect"),center:Yo,width:be,height:be,rotation:ei.optional()});Qt(!0);J5t=vNe.extend({shape:he("brep"),brep_shape:INe});Qt(!0);Z5t=vNe.extend({shape:he("polygon"),points:it(Yo)});Qt(!0);e4t=ss("shape",[q5t,J5t,Z5t]).describe("Defines a copper pour on the PCB.");Qt(!0);t4t=hc.extend({type:he("pcb_component_outside_board_error"),pcb_component_outside_board_error_id:In("pcb_component_outside_board_error"),error_type:he("pcb_component_outside_board_error").default("pcb_component_outside_board_error"),pcb_component_id:k(),pcb_board_id:k(),component_center:Yo,component_bounds:we({min_x:Ae(),max_x:Ae(),min_y:Ae(),max_y:Ae()}),subcircuit_id:k().optional(),source_component_id:k().optional()}).describe("Error emitted when a PCB component is placed outside the board boundaries");Qt(!0);n4t=hc.extend({type:he("pcb_component_not_on_board_edge_error"),pcb_component_not_on_board_edge_error_id:In("pcb_component_not_on_board_edge_error"),error_type:he("pcb_component_not_on_board_edge_error").default("pcb_component_not_on_board_edge_error"),pcb_component_id:k(),pcb_board_id:k(),component_center:Yo,pad_to_nearest_board_edge_distance:Ae(),source_component_id:k().optional(),subcircuit_id:k().optional()}).describe("Error emitted when a component that must be placed on the board edge is centered away from the edge");Qt(!0);uX=hc.extend({type:he("pcb_component_invalid_layer_error"),pcb_component_invalid_layer_error_id:In("pcb_component_invalid_layer_error"),error_type:he("pcb_component_invalid_layer_error").default("pcb_component_invalid_layer_error"),pcb_component_id:k().optional(),source_component_id:k(),layer:Bo,subcircuit_id:k().optional()}).describe("Error emitted when a component is placed on an invalid layer (components can only be on 'top' or 'bottom' layers)");Qt(!0);o4t=hc.extend({type:he("pcb_via_clearance_error"),pcb_error_id:In("pcb_error"),error_type:he("pcb_via_clearance_error").default("pcb_via_clearance_error"),pcb_via_ids:it(k()).min(2),minimum_clearance:Ke.optional(),actual_clearance:Ke.optional(),pcb_center:we({x:Ae().optional(),y:Ae().optional()}).optional(),subcircuit_id:k().optional()}).describe("Error emitted when vias are closer than the allowed clearance");Qt(!0);r4t=hc.extend({type:he("pcb_via_trace_clearance_error"),pcb_via_trace_clearance_error_id:In("pcb_via_trace_clearance_error"),error_type:he("pcb_via_trace_clearance_error").default("pcb_via_trace_clearance_error"),pcb_via_id:k(),pcb_trace_id:k(),minimum_clearance:Ke.optional(),actual_clearance:Ke.optional(),center:we({x:Ae().optional(),y:Ae().optional()}).optional(),subcircuit_id:k().optional()}).describe("Error emitted when a via and trace are closer than the allowed clearance");Qt(!0);i4t=hc.extend({type:he("pcb_pad_pad_clearance_error"),pcb_pad_pad_clearance_error_id:In("pcb_pad_pad_clearance_error"),error_type:he("pcb_pad_pad_clearance_error").default("pcb_pad_pad_clearance_error"),pcb_pad_ids:it(k()).min(2),minimum_clearance:Ke.optional(),actual_clearance:Ke.optional(),center:we({x:Ae().optional(),y:Ae().optional()}).optional(),subcircuit_id:k().optional()}).describe("Error emitted when pads are closer than the allowed clearance");Qt(!0);s4t=hc.extend({type:he("pcb_pad_trace_clearance_error"),pcb_pad_trace_clearance_error_id:In("pcb_pad_trace_clearance_error"),error_type:he("pcb_pad_trace_clearance_error").default("pcb_pad_trace_clearance_error"),pcb_pad_id:k(),pcb_trace_id:k(),minimum_clearance:Ke.optional(),actual_clearance:Ke.optional(),center:we({x:Ae().optional(),y:Ae().optional()}).optional(),subcircuit_id:k().optional()}).describe("Error emitted when a pad and trace are closer than allowed clearance");Qt(!0);a4t=we({type:he("pcb_courtyard_rect"),pcb_courtyard_rect_id:In("pcb_courtyard_rect"),pcb_component_id:k(),pcb_group_id:k().optional(),subcircuit_id:k().optional(),center:Yo,width:be,height:be,layer:_p,ccw_rotation:ei.optional(),color:k().optional()}).describe("Defines a courtyard rectangle on the PCB");Qt(!0);c4t=we({type:he("pcb_courtyard_outline"),pcb_courtyard_outline_id:In("pcb_courtyard_outline"),pcb_component_id:k(),pcb_group_id:k().optional(),subcircuit_id:k().optional(),layer:_p,outline:it(Yo).min(2)}).describe("Defines a courtyard outline on the PCB");Qt(!0);l4t=we({type:he("pcb_courtyard_polygon"),pcb_courtyard_polygon_id:In("pcb_courtyard_polygon"),pcb_component_id:k(),pcb_group_id:k().optional(),subcircuit_id:k().optional(),layer:_p,points:it(Yo).min(3),color:k().optional()}).describe("Defines a courtyard polygon on the PCB");Qt(!0);h4t=we({type:he("pcb_courtyard_circle"),pcb_courtyard_circle_id:In("pcb_courtyard_circle"),pcb_component_id:k(),pcb_group_id:k().optional(),subcircuit_id:k().optional(),center:Yo,radius:be,layer:_p,color:k().optional()}).describe("Defines a courtyard circle on the PCB");Qt(!0);d4t=we({type:he("pcb_courtyard_pill"),pcb_courtyard_pill_id:In("pcb_courtyard_pill"),pcb_component_id:k(),pcb_group_id:k().optional(),subcircuit_id:k().optional(),center:Yo,width:be,height:be,radius:be,layer:_p,color:k().optional()}).describe("Defines a courtyard pill on the PCB");Qt(!0);I1o=["obj","stl","3mf","gltf","glb","step","wrl"],u4t=["x+","x-","y+","y-","z+","z-"],v1o={obj:"z+",stl:"z+","3mf":"z+",gltf:"y+",glb:"y+",step:"z+",wrl:"y+"},p4t=we({type:he("cad_component"),cad_component_id:k(),pcb_component_id:k().optional().describe("Optional PCB component reference; omit for CAD geometry without a PCB component"),source_component_id:k(),position:px,rotation:px.optional(),is_on_folded_board:Be().optional().describe("True when position and rotation describe the assembled folded board pose. False or omitted means the flat board pose. PCB records remain flat; pcb_component_id identifies the flat mount and owning board for reversible transforms."),size:px.optional(),layer:Bo.optional(),subcircuit_id:k().optional(),footprinter_string:k().optional(),model_obj_url:k().optional(),model_stl_url:k().optional(),model_3mf_url:k().optional(),model_gltf_url:k().optional(),model_glb_url:k().optional(),model_step_url:k().optional(),model_wrl_url:k().optional(),model_asset:ure.optional(),model_unit_to_mm_scale_factor:Ae().optional(),model_board_normal_direction:Pt(u4t).optional().describe(`The direction in the model's coordinate space that is considered "up" or "coming out of the board surface"`),model_origin_position:px.optional(),model_origin_alignment:Pt(["unknown","center","center_of_component_on_board_surface","bottom_center_of_component"]).optional(),model_object_fit:Pt(["contain_within_bounds","fill_bounds"]).optional().default("contain_within_bounds"),model_jscad:Jh().optional(),color:k().trim().min(1).optional().describe("Explicit color override for CAD geometry, including authored JSCAD material colors. Omit to preserve model materials."),show_as_translucent_model:Be().optional(),show_as_bounding_box:Be().optional(),show_hidden_edges:Be().optional(),anchor_alignment:Pt(["center","center_of_component_on_board_surface"]).optional().default("center")}).describe("Defines CAD geometry, optionally associated with a PCB component");Qt(!0);m4t=hc.extend({type:he("cad_collision_error"),cad_collision_error_id:In("cad_collision_error"),error_type:he("cad_collision_error").default("cad_collision_error"),cad_component_ids:it(k()).min(1),pcb_component_ids:it(k()).optional(),source_component_ids:it(k()).min(1),intersection_area_mm2:Ae().finite().nonnegative(),threshold_area_mm2:Ae().finite().nonnegative()}).describe("An aperture-bearing part intersects the finished enclosure. The intersection_area_mm2 is the union silhouette area of the solid intersection projected along the aperture face normal, in the right-handed Circuit JSON world frame (+X right, +Y top, +Z above). It is an area in square millimetres, not intersection volume or surface area. This indicates possible aperture misplacement, insufficient size/depth, or body clearance problems; it does not prove which cause applies.");Qt(!0);k1t=px.refine((e)=>[e.x,e.y,e.z].every(Number.isFinite),"Connector pin 1 positions must be finite").describe("Resolved pin 1 position at the connector mating face, in right-handed circuit world, millimeters: +X right, +Y top, +Z above. An absolute point, not a direction. Computed by the circuit producer from endpoint geometry. Together with the endpoint path tangent, fixes connector roll and identifies its pin 1 side; renderers must not infer it from footprints."),_4t=we({type:he("cad_cable"),cad_cable_id:k(),name:k().min(1),from_source_component_id:k(),to_source_component_id:k(),from_connector_pin1_position:k1t.optional(),to_connector_pin1_position:k1t.optional(),cableprinter_string:k().min(1).describe('Physical cable definition, e.g. "usb_c" or "jst_ph_pins6". Independent of the route.'),path:it(px).min(2).refine((e)=>e.every((t,n)=>[t.x,t.y,t.z].every(Number.isFinite)&&(n===0||Math.hypot(t.x-e[n-1].x,t.y-e[n-1].y,t.z-e[n-1].z)>0.00000001)),"Cable paths require finite, distinct consecutive points").describe("Resolved cable centerline points in right-handed circuit world, millimeters: +X right, +Y top, +Z above. First/last samples are connector wire exits; their tangents point into/out of the cable. Includes routing/slack; renderers must not recompute the path.")}).describe("A physical assembly cable with a resolved 3D route. Several cables are independent cad_cable records, each with its own endpoints, definition and path. Does not imply electrical pin mapping.");Qt(!0);L1t=we({x:Ae().finite(),y:Ae().finite(),z:Ae().finite()}).refine((e)=>Math.abs(Math.hypot(e.x,e.y,e.z)-1)<=g4t,"Reference surface directions must be unit vectors"),H1t=Ke.pipe(Ae().finite().positive()),A4t=we({type:he("cad_reference_surface"),cad_reference_surface_id:k().min(1),source_component_id:k().min(1).describe("Owning assembly part's source component ID. The part may have no CAD geometry."),name:k().trim().min(1).describe("Reference name, unique within the owning part, e.g. shade in STEM.shade."),shape:he("rect"),center:px.refine((e)=>[e.x,e.y,e.z].every(Number.isFinite),"Reference surface centers must be finite").describe("Resolved surface center in right-handed circuit-world XYZ, millimeters: +X right, +Y top, +Z above. An absolute point after assembly placement."),normal:L1t.describe("Outward unit normal in circuit-world XYZ. Dimensionless direction; transform with the part's rotation, without translation."),x_axis:L1t.describe("In-plane unit X direction in circuit-world XYZ, perpendicular to normal. The second tangent is normal cross x_axis, giving a right-handed frame."),width:H1t.optional().describe("Rectangular extent along x_axis in millimeters. Supply together with height. Omission leaves the surface's display size unspecified."),height:H1t.optional().describe("Rectangular extent along normal cross x_axis in millimeters. Supply together with width."),subcircuit_id:k().optional()}).superRefine((e,t)=>{if(e.width===void 0!==(e.height===void 0))t.addIssue({code:Vt.custom,path:["width"],message:"Provide width and height together"});let{normal:n,x_axis:o}=e;if(Math.abs(n.x*o.x+n.y*o.y+n.z*o.z)>g4t)t.addIssue({code:Vt.custom,path:["x_axis"],message:"x_axis must be perpendicular to normal"})}).describe("A named assembly mounting surface with a resolved world-space frame. Reference geometry for optional visualization; does not add solid material or electrical connectivity. The producer resolves part placement independently of CAD-model offsets; renderers consume the world frame without reapplying the owning model's transform.");Qt(!0);SNe=Pt(["sinewave","square","triangle","sawtooth"]),S1o=un([k(),Ae()]).transform((e)=>{if(typeof e==="string"){if(e.endsWith("%"))return parseFloat(e.slice(0,-1))/100;return parseFloat(e)}return e}).pipe(Ae().min(0,"Duty cycle must be non-negative").max(1,"Duty cycle cannot be greater than 100%")),f4t=we({type:he("simulation_voltage_source"),simulation_voltage_source_id:In("simulation_voltage_source"),is_dc_source:he(!0).optional().default(!0),positive_source_port_id:k().optional(),negative_source_port_id:k().optional(),positive_source_net_id:k().optional(),negative_source_net_id:k().optional(),voltage:Xl,ac_magnitude:Xl.optional(),ac_phase:ei.optional()}).describe("Defines a DC voltage source for simulation"),y4t=we({type:he("simulation_voltage_source"),simulation_voltage_source_id:In("simulation_voltage_source"),is_dc_source:he(!1),terminal1_source_port_id:k().optional(),terminal2_source_port_id:k().optional(),terminal1_source_net_id:k().optional(),terminal2_source_net_id:k().optional(),voltage:Xl.optional(),frequency:mp.optional(),peak_to_peak_voltage:Xl.optional(),wave_shape:SNe.optional(),phase:ei.optional(),duty_cycle:S1o.optional(),pulse_delay:lc.optional(),rise_time:lc.optional(),fall_time:lc.optional(),pulse_width:lc.optional(),period:lc.optional(),ac_magnitude:Xl.optional(),ac_phase:ei.optional()}).describe("Defines an AC voltage source for simulation"),x4t=un([f4t,y4t]).describe("Defines a voltage source for simulation");Qt(!0);Qt(!0);Qt(!0);P1o=un([k(),Ae()]).transform((e)=>{if(typeof e==="string"){if(e.endsWith("%"))return parseFloat(e.slice(0,-1))/100;return parseFloat(e)}return e}).pipe(Ae().min(0,"Duty cycle must be non-negative").max(1,"Duty cycle cannot be greater than 100%")),C4t=we({type:he("simulation_current_source"),simulation_current_source_id:In("simulation_current_source"),is_dc_source:he(!0).optional().default(!0),positive_source_port_id:k().optional(),negative_source_port_id:k().optional(),positive_source_net_id:k().optional(),negative_source_net_id:k().optional(),current:C2,ac_magnitude:C2.optional(),ac_phase:ei.optional()}).describe("Defines a DC current source for simulation"),b4t=we({type:he("simulation_current_source"),simulation_current_source_id:In("simulation_current_source"),is_dc_source:he(!1),terminal1_source_port_id:k().optional(),terminal2_source_port_id:k().optional(),terminal1_source_net_id:k().optional(),terminal2_source_net_id:k().optional(),current:C2.optional(),frequency:mp.optional(),peak_to_peak_current:C2.optional(),wave_shape:SNe.optional(),phase:ei.optional(),duty_cycle:P1o.optional(),ac_magnitude:C2.optional(),ac_phase:ei.optional()}).describe("Defines an AC current source for simulation"),I4t=un([C4t,b4t]).describe("Defines a current source for simulation");Qt(!0);Qt(!0);Qt(!0);mAe=Wa((e)=>e==="V"||e==="A"),PNe=Wa((e)=>e==="Ω"||e==="F"||e==="H"||e==="V"||e==="A"),v4t=un([he("spice_dc_sweep"),he("spice_dc_operating_point"),he("spice_transient_analysis"),he("spice_ac_analysis"),he("pcb_return_current")]),S4t=we({method:Pt(["trap","gear"]).optional(),reltol:un([Ae(),k()]).optional(),abstol:un([Ae(),k()]).optional(),vntol:un([Ae(),k()]).optional()}).describe("SPICE solver options for a simulation experiment"),P4t=we({type:he("simulation_experiment"),simulation_experiment_id:In("simulation_experiment"),name:k(),experiment_type:v4t,time_per_step:lX.optional(),start_time_ms:lc.optional(),end_time_ms:lc.optional(),spice_options:S4t.optional(),dc_sweep_voltage_source_id:k().optional(),dc_sweep_current_source_id:k().optional(),dc_sweep_start:Ae().optional(),dc_sweep_stop:Ae().optional(),dc_sweep_step:Ae().refine((e)=>e!==0).optional(),dc_sweep_unit:mAe.optional(),ac_sweep_type:Pt(["linear","decade","octave"]).optional(),ac_samples_per_interval:Ae().int().positive().optional(),ac_sample_count:Ae().int().positive().optional(),ac_start_frequency_hz:Ae().positive().optional(),ac_stop_frequency_hz:Ae().positive().optional()}).superRefine((e,t)=>{if(e.experiment_type==="spice_dc_sweep"){let n=["dc_sweep_start","dc_sweep_stop","dc_sweep_step","dc_sweep_unit"];for(let i of n)if(e[i]===void 0)t.addIssue({code:Vt.custom,path:[i],message:`${i} is required for a DC sweep`});let o=e.dc_sweep_voltage_source_id!==void 0,r=e.dc_sweep_current_source_id!==void 0;if(o===r)t.addIssue({code:Vt.custom,path:["dc_sweep_voltage_source_id"],message:"Exactly one DC sweep voltage or current source ID is required"})}if(e.experiment_type==="spice_ac_analysis"){if(e.ac_sweep_type===void 0)t.addIssue({code:Vt.custom,path:["ac_sweep_type"],message:"ac_sweep_type is required for an AC analysis"});if(e.ac_start_frequency_hz===void 0)t.addIssue({code:Vt.custom,path:["ac_start_frequency_hz"],message:"ac_start_frequency_hz is required for an AC analysis"});if(e.ac_stop_frequency_hz===void 0)t.addIssue({code:Vt.custom,path:["ac_stop_frequency_hz"],message:"ac_stop_frequency_hz is required for an AC analysis"});if(e.ac_sweep_type==="linear"&&e.ac_sample_count===void 0)t.addIssue({code:Vt.custom,path:["ac_sample_count"],message:"ac_sample_count is required for a linear AC analysis"});if((e.ac_sweep_type==="decade"||e.ac_sweep_type==="octave")&&e.ac_samples_per_interval===void 0)t.addIssue({code:Vt.custom,path:["ac_samples_per_interval"],message:"ac_samples_per_interval is required for decade and octave AC analyses"})}}).describe("Defines a simulation experiment configuration");Qt(!0);_M=we({simulation_parameter_sweep_id:k(),sweep_index:Ae().int().nonnegative(),parameter_value:Ae(),parameter_unit:PNe});Qt(!0);E4t=we({type:he("simulation_transient_voltage_graph"),simulation_transient_voltage_graph_id:In("simulation_transient_voltage_graph"),simulation_experiment_id:k(),simulation_parameter_sweep_coordinate:_M.optional(),timestamps_ms:it(Ae()).optional(),voltage_levels:it(Ae()),source_component_id:k().optional(),subcircuit_connectivity_map_key:k().optional(),time_per_step:lX,start_time_ms:lc,end_time_ms:lc,name:k().optional(),color:k().optional()}).describe("Stores voltage measurements over time for a simulation");Qt(!0);M4t=we({type:he("simulation_transient_current_graph"),simulation_transient_current_graph_id:In("simulation_transient_current_graph"),simulation_experiment_id:k(),simulation_parameter_sweep_coordinate:_M.optional(),timestamps_ms:it(Ae()).optional(),current_levels:it(Ae()),source_component_id:k().optional(),subcircuit_connectivity_map_key:k().optional(),time_per_step:lX,start_time_ms:lc,end_time_ms:lc,name:k().optional(),color:k().optional()}).describe("Stores current measurements over time for a simulation");Qt(!0);w4t=we({type:he("simulation_switch"),simulation_switch_id:In("simulation_switch"),source_component_id:k().optional(),closes_at:lc.optional(),opens_at:lc.optional(),starts_closed:Be().optional(),switching_frequency:mp.optional()}).describe("Defines a switch for simulation timing control");Qt(!0);B4t=we({type:he("simulation_voltage_probe"),simulation_voltage_probe_id:In("simulation_voltage_probe"),source_component_id:k().optional(),name:k().optional(),signal_input_source_port_id:k().optional(),signal_input_source_net_id:k().optional(),reference_input_source_port_id:k().optional(),reference_input_source_net_id:k().optional(),subcircuit_id:k().optional(),color:k().optional()}).describe("Defines a voltage probe for simulation. If a reference input is not provided, it measures against ground. If a reference input is provided, it measures the differential voltage between two points.").superRefine((e,t)=>{if(e.reference_input_source_port_id||e.reference_input_source_net_id){let o=!!e.signal_input_source_port_id||!!e.reference_input_source_port_id,r=!!e.signal_input_source_net_id||!!e.reference_input_source_net_id;if(o&&r)t.addIssue({code:Vt.custom,message:"Cannot mix port and net connections in a differential probe."});else if(o){if(!e.signal_input_source_port_id||!e.reference_input_source_port_id)t.addIssue({code:Vt.custom,message:"Differential port probe requires both signal_input_source_port_id and reference_input_source_port_id."})}else if(r){if(!e.signal_input_source_net_id||!e.reference_input_source_net_id)t.addIssue({code:Vt.custom,message:"Differential net probe requires both signal_input_source_net_id and reference_input_source_net_id."})}}else if(!!e.signal_input_source_port_id===!!e.signal_input_source_net_id)t.addIssue({code:Vt.custom,message:"A voltage probe must have exactly one of signal_input_source_port_id or signal_input_source_net_id."})});Qt(!0);T4t=we({type:he("simulation_current_probe"),simulation_current_probe_id:In("simulation_current_probe"),source_component_id:k().optional(),name:k().optional(),positive_source_port_id:k().optional(),negative_source_port_id:k().optional(),positive_source_net_id:k().optional(),negative_source_net_id:k().optional(),subcircuit_id:k().optional(),color:k().optional()}).describe("Defines a current probe for simulation. It measures current flowing from the positive endpoint to the negative endpoint.").superRefine((e,t)=>{let n=!!e.positive_source_port_id,o=!!e.negative_source_port_id,r=!!e.positive_source_net_id,i=!!e.negative_source_net_id,s=n||o,a=r||i;if(s&&a){t.addIssue({code:Vt.custom,message:"Cannot mix port and net connections in a current probe."});return}if(s){if(!n||!o)t.addIssue({code:Vt.custom,message:"Current probe using source ports requires both positive_source_port_id and negative_source_port_id."});return}if(a){if(!r||!i)t.addIssue({code:Vt.custom,message:"Current probe using source nets requires both positive_source_net_id and negative_source_net_id."});return}t.addIssue({code:Vt.custom,message:"A current probe must have either positive/negative source port ids or positive/negative source net ids."})});Qt(!0);D4t=hc.extend({type:he("simulation_unknown_experiment_error"),simulation_unknown_experiment_error_id:In("simulation_unknown_experiment_error"),error_type:he("simulation_unknown_experiment_error").default("simulation_unknown_experiment_error"),simulation_experiment_id:k().optional(),subcircuit_id:k().optional()}).describe("An unknown error occurred during the simulation experiment.");Qt(!0);E1o=Pt(["resistance","capacitance","inductance","voltage","current"]),lre=we({type:he("simulation_parameter_sweep"),simulation_parameter_sweep_id:In("simulation_parameter_sweep"),simulation_experiment_id:k(),name:k().optional(),parameter_values:it(Ae()).min(1),parameter_unit:PNe}),N4t=ss("parameter_type",[lre.extend({parameter_type:he("resistance"),resistor_source_component_id:k()}),lre.extend({parameter_type:he("capacitance"),capacitor_source_component_id:k()}),lre.extend({parameter_type:he("inductance"),inductor_source_component_id:k()}),lre.extend({parameter_type:he("voltage"),source_net_id:k()}),lre.extend({parameter_type:he("current"),current_source_component_id:k()})]).describe("Repeats a simulation experiment over component parameter values");Qt(!0);R4t=we({type:he("simulation_dc_operating_point_voltage"),simulation_dc_operating_point_voltage_id:In("simulation_dc_operating_point_voltage"),simulation_experiment_id:k(),simulation_parameter_sweep_coordinate:_M.optional(),simulation_voltage_probe_id:k(),voltage:Ae(),name:k().optional(),color:k().optional()});Qt(!0);Q4t=we({type:he("simulation_dc_operating_point_current"),simulation_dc_operating_point_current_id:In("simulation_dc_operating_point_current"),simulation_experiment_id:k(),simulation_parameter_sweep_coordinate:_M.optional(),simulation_current_probe_id:k(),current:Ae(),name:k().optional(),color:k().optional()});Qt(!0);k4t=we({type:he("simulation_dc_sweep_voltage_graph"),simulation_dc_sweep_voltage_graph_id:In("simulation_dc_sweep_voltage_graph"),simulation_experiment_id:k(),simulation_parameter_sweep_coordinate:_M.optional(),simulation_voltage_probe_id:k(),sweep_values:it(Ae()),sweep_unit:mAe,voltage_levels:it(Ae()),name:k().optional(),color:k().optional()}).refine((e)=>e.sweep_values.length===e.voltage_levels.length,{message:"sweep_values and voltage_levels must have the same length"});Qt(!0);L4t=we({type:he("simulation_dc_sweep_current_graph"),simulation_dc_sweep_current_graph_id:In("simulation_dc_sweep_current_graph"),simulation_experiment_id:k(),simulation_parameter_sweep_coordinate:_M.optional(),simulation_current_probe_id:k(),sweep_values:it(Ae()),sweep_unit:mAe,current_levels:it(Ae()),name:k().optional(),color:k().optional()}).refine((e)=>e.sweep_values.length===e.current_levels.length,{message:"sweep_values and current_levels must have the same length"});Qt(!0);ENe=we({re:Ae(),im:Ae()});Qt(!0);H4t=we({type:he("simulation_ac_sweep_voltage_graph"),simulation_ac_sweep_voltage_graph_id:In("simulation_ac_sweep_voltage_graph"),simulation_experiment_id:k(),simulation_parameter_sweep_coordinate:_M.optional(),simulation_voltage_probe_id:k(),frequencies_hz:it(Ae()),complex_voltages:it(ENe),name:k().optional(),color:k().optional()}).refine((e)=>e.frequencies_hz.length===e.complex_voltages.length,{message:"frequencies_hz and complex_voltages must have the same length"});Qt(!0);F4t=we({type:he("simulation_ac_sweep_current_graph"),simulation_ac_sweep_current_graph_id:In("simulation_ac_sweep_current_graph"),simulation_experiment_id:k(),simulation_parameter_sweep_coordinate:_M.optional(),simulation_current_probe_id:k(),frequencies_hz:it(Ae()),complex_currents:it(ENe),name:k().optional(),color:k().optional()}).refine((e)=>e.frequencies_hz.length===e.complex_currents.length,{message:"frequencies_hz and complex_currents must have the same length"});Qt(!0);z4t=we({type:he("simulation_op_amp"),simulation_op_amp_id:In("simulation_op_amp"),source_component_id:k().optional(),inverting_input_source_port_id:k(),non_inverting_input_source_port_id:k(),output_source_port_id:k(),positive_supply_source_port_id:k(),negative_supply_source_port_id:k()}).describe("Defines a simple ideal operational amplifier for simulation");Qt(!0);O4t=we({type:he("simulation_spice_subcircuit"),simulation_spice_subcircuit_id:In("simulation_spice_subcircuit"),source_component_id:k(),spice_pin_to_source_port_map:gs(k(),k()),subcircuit_source:k()}).describe("Defines a custom SPICE subcircuit model for simulation");Qt(!0);V4t=we({type:he("simulation_oscilloscope_trace"),simulation_oscilloscope_trace_id:In("simulation_oscilloscope_trace"),simulation_transient_voltage_graph_id:k().optional(),simulation_transient_current_graph_id:k().optional(),simulation_voltage_probe_id:k().optional(),simulation_current_probe_id:k().optional(),display_name:k().optional(),color:k().optional(),display_center_value:Ae().optional(),display_center_offset_divs:Ae().optional(),volts_per_div:Ae().positive().optional(),amps_per_div:Ae().positive().optional()}).describe("Defines how a simulation measurement is rendered as an oscilloscope-style trace.").superRefine((e,t)=>{let n=[e.simulation_transient_voltage_graph_id,e.simulation_voltage_probe_id].filter(F1t).length,o=[e.simulation_transient_current_graph_id,e.simulation_current_probe_id].filter(F1t).length;if(n+o!==1)t.addIssue({code:Vt.custom,message:"An oscilloscope trace must reference exactly one voltage graph, current graph, voltage probe, or current probe."});if(n>0&&e.amps_per_div!==void 0)t.addIssue({code:Vt.custom,message:"Voltage oscilloscope traces must use volts_per_div, not amps_per_div."});if(o>0&&e.volts_per_div!==void 0)t.addIssue({code:Vt.custom,message:"Current oscilloscope traces must use amps_per_div, not volts_per_div."})});Qt(!0);VDe=we({x:Ae().finite(),y:Ae().finite(),layer:Bo}),XDe=ss("contact_type",[VDe.extend({contact_type:he("pcb_port"),pcb_port_id:k().min(1)}),VDe.extend({contact_type:he("pcb_via"),pcb_via_id:k().min(1)}),VDe.extend({contact_type:he("pcb_copper_pour"),pcb_copper_pour_id:k().min(1)})]).describe("Identifies the reference conductor at a return-current contact");Qt(!0);jDe=we({signal_pcb_port_id:k().min(1),reference_pcb_port_id:k().min(1).optional(),reference_layer:Bo,resistance:Ae().finite().positive()}).describe("A two-terminal return-current excitation port with resistance in ohms");Qt(!0);Y4t=we({type:he("simulation_return_current_excitation"),simulation_return_current_excitation_id:In("simulation_return_current_excitation"),simulation_experiment_id:k().min(1),pcb_trace_id:k().min(1),ground_source_net_id:k().min(1),current:Ae().finite(),return_source:XDe,return_sink:XDe,source_port:jDe.optional(),load_port:jDe.optional()}).describe("Excites a signal trace with signed current in amperes, peak for AC; return_source is near the load and return_sink near the driver for positive current");Qt(!0);_Ae=we({type:he("simulation_pcb_return_current_result"),simulation_pcb_return_current_result_id:In("simulation_pcb_return_current_result"),simulation_experiment_id:k().min(1),pcb_board_id:k().min(1),simulation_return_current_excitation_ids:it(k().min(1)).min(1).refine((e)=>new Set(e).size===e.length,"Excitation IDs must be unique"),frequency_hz:Ae().finite().positive().optional()}).describe("A PCB return-current result at one frequency, or a frequency-independent result when frequency_hz is absent");Qt(!0);U4t=G4t(["application/json","application/gzip"]),gAe=G4t(["image/png","image/webp"]),pX=we({type:he("simulation_pcb_return_current_field"),simulation_pcb_return_current_field_id:In("simulation_pcb_return_current_field"),simulation_pcb_return_current_result_id:k().min(1),layer:Bo,source_net_id:k().min(1),field_type:Pt(["real","complex_phasor"]),min_x:Ae().finite(),min_y:Ae().finite(),columns:Ae().int().positive().safe(),rows:Ae().int().positive().safe(),cell_width:Ae().finite().positive(),cell_height:Ae().finite().positive(),copper_thickness:Ae().finite().positive(),data_format:he("simulation_return_current_grid_json_v1"),field_asset:U4t}).superRefine((e,t)=>{if(!Number.isSafeInteger(e.columns*e.rows))t.addIssue({code:Vt.custom,path:["columns"],message:"The grid cell count must be a safe integer"})}).describe("A sampled sheet-current field in A/mm, using plain or gzipped JSON Asset URLs; dimensions are PCB millimeters");Qt(!0);iX=it(Ae().finite().nullable()).min(1),W4t=ss("field_type",[we({field_type:he("real"),sheet_current_x:iX,sheet_current_y:iX}),we({field_type:he("complex_phasor"),sheet_current_x_real:iX,sheet_current_x_imag:iX,sheet_current_y_real:iX,sheet_current_y_imag:iX})]).superRefine((e,t)=>{let n=e.field_type==="real"?[e.sheet_current_x,e.sheet_current_y]:[e.sheet_current_x_real,e.sheet_current_x_imag,e.sheet_current_y_real,e.sheet_current_y_imag],o=n[0];if(n.some((r)=>r.length!==o.length)){t.addIssue({code:Vt.custom,message:"Current channels must have equal lengths"});return}for(let r=0;r<o.length;r++){let i=o[r]===null;if(n.some((s)=>s[r]===null!==i)){t.addIssue({code:Vt.custom,message:`Cell ${r} must be null in every channel or finite in every channel`});return}}}).describe("Decoded real or complex sheet-current arrays with a shared conductor mask");Qt(!0);AAe=we({type:he("simulation_pcb_return_current_heatmap"),simulation_pcb_return_current_heatmap_id:In("simulation_pcb_return_current_heatmap"),simulation_pcb_return_current_result_id:k().min(1),layer:Bo,source_net_id:k().min(1),min_x:Ae().finite(),min_y:Ae().finite(),max_x:Ae().finite(),max_y:Ae().finite(),image_asset:gAe}).superRefine((e,t)=>{for(let n of["x","y"])if(e[`max_${n}`]<=e[`min_${n}`])t.addIssue({code:Vt.custom,path:[`max_${n}`],message:"Heatmap bounds must have positive width and height"})}).describe("A transparent PNG/WebP current-density overlay in A/mm²; the top-left pixel maps to (min_x, max_y)");Qt(!0);z1t=we({type:he("simulation_pcb_return_current_marker"),simulation_pcb_return_current_marker_id:In("simulation_pcb_return_current_marker"),simulation_pcb_return_current_result_id:k().min(1),role:Pt(["signal_source","signal_load","return_source","return_sink","signal_transition","return_transition"]),label:k().optional(),label_x:Ae().finite().optional(),label_y:Ae().finite().optional()}),fAe=ss("target_type",[z1t.extend({target_type:he("pcb_port"),pcb_port_id:k().min(1),layer:Bo}),z1t.extend({target_type:he("pcb_via"),pcb_via_id:k().min(1),from_layer:Bo,to_layer:Bo})]).superRefine((e,t)=>{if(e.label_x===void 0!==(e.label_y===void 0))t.addIssue({code:Vt.custom,path:["label_x"],message:"label_x and label_y must be provided together"});if(e.target_type==="pcb_via"&&e.from_layer===e.to_layer)t.addIssue({code:Vt.custom,path:["to_layer"],message:"A via transition must connect distinct layers"})}).describe("A signal/return port or via highlight; markers do not assert measured via-transfer currents");Qt(!0);yAe=un([Qyt,xyt,Ryt,fyt,yyt,Ayt,byt,Cyt,tNe,JDe,tAe,eNe,ZDe,nNe,oNe,rNe,aNe,cNe,lNe,mNe,hNe,dNe,uNe,pNe,sNe,iNe,Syt,Pyt,Iyt,_Ne,gNe,ANe,fNe,Eyt,Nyt,yNe,pre,xNe,Myt,wyt,Byt,Tyt,Dyt,IN,CNe,mM,vyt,yxt,Ixt,Bxt,z5t,dX,dAe,uAe,G5t,U5t,pAe,W5t,Txt,N5t,R5t,Dxt,Jxt,Lxt,Oxt,Vxt,Yxt,Wxt,Gxt,Uxt,Xxt,vN,Rxt,Qxt,kxt,Zxt,e5t,i5t,s5t,O5t,h5t,d5t,u5t,p5t,x5t,m5t,_5t,g5t,A5t,y5t,cAe,lAe,jxt,Kxt,a5t,c5t,l5t,$xt,qxt,o4t,r4t,i4t,s4t,b5t,C5t,I5t,v5t,S5t,P5t,E5t,M5t,w5t,V5t,Y5t,B5t,T5t,X5t,F5t,j5t,K5t,$5t,e4t,t4t,n4t,uX,a4t,c4t,l4t,h4t,d4t,kyt,Kyt,Gyt,Uyt,Wyt,Xyt,Vyt,Yyt,$yt,jyt,Lyt,Jyt,Zyt,qyt,oxt,rxt,oAe,ixt,sxt,axt,mxt,cxt,lxt,hxt,pxt,dxt,uxt,p4t,_4t,A4t,m4t,x4t,I4t,P4t,Y4t,_Ae,pX,AAe,fAe,E4t,M4t,R4t,Q4t,k4t,L4t,H4t,F4t,N4t,w4t,B4t,T4t,V4t,D4t,z4t,O4t]),SN=yAe;Qt(!0);FF(!0)});var MNe=lt(function(j4t){Object.defineProperty(j4t,"__esModule",{value:!0});j4t.applyToPoint=X4t;j4t.applyToPoints=M1o;function X4t(e,t){return Array.isArray(t)?[e.a*t[0]+e.c*t[1]+e.e,e.b*t[0]+e.d*t[1]+e.f]:{x:e.a*t.x+e.c*t.y+e.e,y:e.b*t.x+e.d*t.y+e.f}}function M1o(e,t){return t.map((n)=>X4t(e,n))}});var wNe=lt(function(K4t){Object.defineProperty(K4t,"__esModule",{value:!0});K4t.fromObject=T1o;function T1o(e){return{a:parseFloat(e.a),b:parseFloat(e.b),c:parseFloat(e.c),d:parseFloat(e.d),e:parseFloat(e.e),f:parseFloat(e.f)}}});var q4t=lt(function($4t){Object.defineProperty($4t,"__esModule",{value:!0});$4t.fromString=R1o;var N1o=/^matrix\(\s*([0-9_+-.e]+)\s*,\s*([0-9_+-.e]+)\s*,\s*([0-9_+-.e]+)\s*,\s*([0-9_+-.e]+)\s*,\s*([0-9_+-.e]+)\s*,\s*([0-9_+-.e]+)\s*\)$/i;function R1o(e){let t=e.match(N1o);if(t===null||t.length<7)throw Error(`'${e}' is not a matrix`);return{a:parseFloat(t[1]),b:parseFloat(t[2]),c:parseFloat(t[3]),d:parseFloat(t[4]),e:parseFloat(t[5]),f:parseFloat(t[6])}}});var Z4t=lt(function(J4t){Object.defineProperty(J4t,"__esModule",{value:!0});J4t.identity=k1o;function k1o(){return{a:1,c:0,e:0,b:0,d:1,f:0}}});var BNe=lt(function(e3t){Object.defineProperty(e3t,"__esModule",{value:!0});e3t.inverse=H1o;function H1o(e){let{a:t,b:n,c:o,d:r,e:i,f:s}=e,a=t*r-n*o;return{a:r/a,b:n/-a,c:o/-a,d:t/a,e:(r*i-o*s)/-a,f:(n*i-t*s)/a}}});var xAe=lt(function(t3t){Object.defineProperty(t3t,"__esModule",{value:!0});t3t.isNumeric=O1o;t3t.isObject=V1o;t3t.isUndefined=z1o;t3t.matchesShape=Y1o;function z1o(e){return typeof e>"u"}function O1o(e){return typeof e==="number"&&!Number.isNaN(e)&&Number.isFinite(e)}function V1o(e){return typeof e==="object"&&e!==null&&!Array.isArray(e)}function Y1o(e,t){return t.every((n)=>(n in e))}});var o3t=lt(function(n3t){Object.defineProperty(n3t,"__esModule",{value:!0});n3t.isAffineMatrix=j1o;var zF=xAe();function j1o(e){return(0,zF.isObject)(e)&&"a"in e&&(0,zF.isNumeric)(e.a)&&"b"in e&&(0,zF.isNumeric)(e.b)&&"c"in e&&(0,zF.isNumeric)(e.c)&&"d"in e&&(0,zF.isNumeric)(e.d)&&"e"in e&&(0,zF.isNumeric)(e.e)&&"f"in e&&(0,zF.isNumeric)(e.f)}});var mX=lt(function(r3t){Object.defineProperty(r3t,"__esModule",{value:!0});r3t.translate=$1o;function $1o(e,t=0){return{a:1,c:0,e,b:0,d:1,f:t}}});var OF=lt(function(i3t){Object.defineProperty(i3t,"__esModule",{value:!0});i3t.compose=J1o;i3t.transform=TNe;function TNe(...e){e=Array.isArray(e[0])?e[0]:e;let t=(n,o)=>({a:n.a*o.a+n.c*o.b,c:n.a*o.c+n.c*o.d,e:n.a*o.e+n.c*o.f+n.e,b:n.b*o.a+n.d*o.b,d:n.b*o.c+n.d*o.d,f:n.b*o.e+n.d*o.f+n.f});switch(e.length){case 0:throw Error("no matrices provided");case 1:return e[0];case 2:return t(e[0],e[1]);default:{let[n,o,...r]=e,i=t(n,o);return TNe(i,...r)}}}function J1o(...e){return TNe(...e)}});var CAe=lt(function(l3t){Object.defineProperty(l3t,"__esModule",{value:!0});l3t.rotate=c3t;l3t.rotateDEG=iyo;var s3t=xAe(),a3t=mX(),tyo=OF(),{cos:nyo,sin:oyo,PI:ryo}=Math;function c3t(e,t,n){let o=nyo(e),r=oyo(e),i={a:o,c:-r,e:0,b:r,d:o,f:0};if((0,s3t.isUndefined)(t)||(0,s3t.isUndefined)(n))return i;return(0,tyo.transform)([(0,a3t.translate)(t,n),i,(0,a3t.translate)(-t,-n)])}function iyo(e,t=void 0,n=void 0){return c3t(e*ryo/180,t,n)}});var _re=lt(function(d3t){Object.defineProperty(d3t,"__esModule",{value:!0});d3t.scale=lyo;var DNe=xAe(),h3t=mX(),cyo=OF();function lyo(e,t=void 0,n=void 0,o=void 0){if((0,DNe.isUndefined)(t))t=e;let r={a:e,c:0,e:0,b:0,d:t,f:0};if((0,DNe.isUndefined)(n)||(0,DNe.isUndefined)(o))return r;return(0,cyo.transform)([(0,h3t.translate)(n,o),r,(0,h3t.translate)(-n,-o)])}});var NNe=lt(function(u3t){Object.defineProperty(u3t,"__esModule",{value:!0});u3t.shear=dyo;function dyo(e,t){return{a:1,c:e,e:0,b:t,d:1,f:0}}});var RNe=lt(function(_3t){Object.defineProperty(_3t,"__esModule",{value:!0});_3t.skew=m3t;_3t.skewDEG=pyo;var{tan:p3t}=Math;function m3t(e,t){return{a:1,c:p3t(e),e:0,b:p3t(t),d:1,f:0}}function pyo(e,t){return m3t(e*Math.PI/180,t*Math.PI/180)}});var A3t=lt(function(g3t){Object.defineProperty(g3t,"__esModule",{value:!0});g3t.toCSS=gyo;g3t.toSVG=Ayo;g3t.toString=QNe;function gyo(e){return QNe(e)}function Ayo(e){return QNe(e)}function QNe(e){return`matrix(${e.a},${e.b},${e.c},${e.d},${e.e},${e.f})`}});var kNe=lt(function(f3t){Object.defineProperty(f3t,"__esModule",{value:!0});f3t.smoothMatrix=Cyo;function Cyo(e,t=10000000000){return{a:Math.round(e.a*t)/t,b:Math.round(e.b*t)/t,c:Math.round(e.c*t)/t,d:Math.round(e.d*t)/t,e:Math.round(e.e*t)/t,f:Math.round(e.f*t)/t}}});var x3t=lt(function(y3t){Object.defineProperty(y3t,"__esModule",{value:!0});y3t.fromTriangles=Pyo;var Iyo=BNe(),vyo=OF(),Syo=kNe();function Pyo(e,t){let n=e[0].x!=null?e[0].x:e[0][0],o=e[0].y!=null?e[0].y:e[0][1],r=t[0].x!=null?t[0].x:t[0][0],i=t[0].y!=null?t[0].y:t[0][1],s=e[1].x!=null?e[1].x:e[1][0],a=e[1].y!=null?e[1].y:e[1][1],c=t[1].x!=null?t[1].x:t[1][0],l=t[1].y!=null?t[1].y:t[1][1],h=e[2].x!=null?e[2].x:e[2][0],d=e[2].y!=null?e[2].y:e[2][1],u=t[2].x!=null?t[2].x:t[2][0],_=t[2].y!=null?t[2].y:t[2][1],p={a:n-h,b:o-d,c:s-h,d:a-d,e:h,f:d},m={a:r-u,b:i-_,c:c-u,d:l-_,e:u,f:_},A=(0,Iyo.inverse)(p),g=(0,vyo.transform)([m,A]);return(0,Syo.smoothMatrix)(g)}});var P3t=lt(function(S3t){Object.defineProperty(S3t,"__esModule",{value:!0});S3t.fromDefinition=Byo;var Myo=wNe(),C3t=mX(),b3t=_re(),I3t=CAe(),v3t=RNe(),wyo=NNe();function Byo(e){return Array.isArray(e)?e.map(t):t(e);function t(n){switch(n.type){case"matrix":if("a"in n&&"b"in n&&"c"in n&&"d"in n&&"e"in n&&"f"in n)return(0,Myo.fromObject)(n);else throw Error("MISSING_MANDATORY_PARAM");case"translate":if(!("tx"in n))throw Error("MISSING_MANDATORY_PARAM");if("ty"in n)return(0,C3t.translate)(n.tx,n.ty);return(0,C3t.translate)(n.tx);case"scale":if(!("sx"in n))throw Error("MISSING_MANDATORY_PARAM");if("sy"in n)return(0,b3t.scale)(n.sx,n.sy);return(0,b3t.scale)(n.sx);case"rotate":if(!("angle"in n))throw Error("MISSING_MANDATORY_PARAM");if("cx"in n&&"cy"in n)return(0,I3t.rotateDEG)(n.angle,n.cx,n.cy);return(0,I3t.rotateDEG)(n.angle);case"skewX":if(!("angle"in n))throw Error("MISSING_MANDATORY_PARAM");return(0,v3t.skewDEG)(n.angle,0);case"skewY":if(!("angle"in n))throw Error("MISSING_MANDATORY_PARAM");return(0,v3t.skewDEG)(0,n.angle);case"shear":if(!(("shx"in n)&&("shy"in n)))throw Error("MISSING_MANDATORY_PARAM");return(0,wyo.shear)(n.shx,n.shy);default:throw Error("UNSUPPORTED_DESCRIPTOR")}}}});var M3t=lt(function(E3t){Object.defineProperty(E3t,"__esModule",{value:!0});E3t.SyntaxError=EN;E3t.parse=Nyo;function Dyo(e,t){function n(){this.constructor=e}n.prototype=t.prototype,e.prototype=new n}function EN(e,t,n,o){var r=Error.call(this,e);if(Object.setPrototypeOf)Object.setPrototypeOf(r,EN.prototype);return r.expected=t,r.found=n,r.location=o,r.name="SyntaxError",r}Dyo(EN,Error);function LNe(e,t,n){if(n=n||" ",e.length>t)return e;return t-=e.length,n+=n.repeat(t),e+n.slice(0,t)}EN.prototype.format=function(e){var t="Error: "+this.message;if(this.location){var n=null,o;for(o=0;o<e.length;o++)if(e[o].source===this.location.source){n=e[o].text.split(/\r\n|\n|\r/g);break}var r=this.location.start,i=this.location.source&&typeof this.location.source.offset==="function"?this.location.source.offset(r):r,s=this.location.source+":"+i.line+":"+i.column;if(n){var a=this.location.end,c=LNe("",i.line.toString().length," "),l=n[r.line-1],h=r.line===a.line?a.column:l.length+1,d=h-r.column||1;t+=`
 --> `+s+`
`+c+` |
`+i.line+" | "+l+`
`+c+" | "+LNe("",r.column-1," ")+LNe("",d,"^")}else t+=`
 at `+s}return t};EN.buildMessage=function(e,t){var n={literal:function(l){return'"'+r(l.text)+'"'},class:function(l){var h=l.parts.map(function(d){return Array.isArray(d)?i(d[0])+"-"+i(d[1]):i(d)});return"["+(l.inverted?"^":"")+h.join("")+"]"},any:function(){return"any character"},end:function(){return"end of input"},other:function(l){return l.description}};function o(l){return l.charCodeAt(0).toString(16).toUpperCase()}function r(l){return l.replace(/\\/g,"\\\\").replace(/"/g,"\\\"").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(h){return"\\x0"+o(h)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(h){return"\\x"+o(h)})}function i(l){return l.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(h){return"\\x0"+o(h)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(h){return"\\x"+o(h)})}function s(l){return n[l.type](l)}function a(l){var h=l.map(s),d,u;if(h.sort(),h.length>0){for(d=1,u=1;d<h.length;d++)if(h[d-1]!==h[d])h[u]=h[d],u++;h.length=u}switch(h.length){case 1:return h[0];case 2:return h[0]+" or "+h[1];default:return h.slice(0,-1).join(", ")+", or "+h[h.length-1]}}function c(l){return l?'"'+r(l)+'"':"end of input"}return"Expected "+a(e)+" but "+c(t)+" found."};function Nyo(e,t){t=t!==void 0?t:{};var n={},o=t.grammarSource,r={transformList:tt},i=tt,s="matrix",a="(",c=")",l="translate",h="scale",d="rotate",u="skewX",_="skewY",p=",",m=".",A=/^[eE]/,g=/^[+\-]/,f=/^[0-9]/,y=/^[ \t\r\n]/,x=ct("matrix",!1),C=ct("(",!1),b=ct(")",!1),I=ct("translate",!1),v=ct("scale",!1),P=ct("rotate",!1),M=ct("skewX",!1),B=ct("skewY",!1),T=ct(",",!1),N=Bt("fractionalConstant"),D=ct(".",!1),L=Ct(["e","E"],!1,!1),H=Ct(["+","-"],!1,!1),V=Ct([["0","9"]],!1,!1),O=Ct([" ","\t","\r",`
`],!1,!1),U=function(Oe){return Oe},j=function(Oe,mt){return Oe.concat(mt)},Y=function(Oe,mt,It,bt,cn,dn){return[{type:"matrix",a:Oe,b:mt,c:It,d:bt,e:cn,f:dn}]},X=function(Oe,mt){var It={type:"translate",tx:Oe};if(mt)It.ty=mt;return[It]},K=function(Oe,mt){var It={type:"scale",sx:Oe};if(mt)It.sy=mt;return[It]},J=function(Oe,mt){var It={type:"rotate",angle:Oe};if(mt)It.cx=mt[0],It.cy=mt[1];return[It]},ee=function(Oe){return[{type:"skewX",angle:Oe}]},se=function(Oe){return[{type:"skewY",angle:Oe}]},ne=function(Oe){return parseFloat(Oe.join(""))},re=function(Oe){return parseInt(Oe.join(""))},Z=function(Oe){return Oe},te=function(Oe,mt){return[Oe,mt]},ie=function(Oe){return Oe.join("")},ce=function(Oe,mt){return[Oe,mt||null].join("")},ue=function(Oe,mt){return[Oe,mt].join("")},de=function(Oe,mt){return[Oe?Oe.join(""):null,".",mt.join("")].join("")},me=function(Oe){return Oe.join("")},ge=function(Oe,mt){return["e",Oe,mt.join("")].join("")},xe=0,Ee=0,Re=[{line:1,column:1}],Me=0,_e=[],ye=0,Se;if("startRule"in t){if(!(t.startRule in r))throw Error(`Can't start parsing from rule "`+t.startRule+'".');i=r[t.startRule]}function Ne(){return e.substring(Ee,xe)}function Le(){return Ee}function nt(){return{source:o,start:Ee,end:xe}}function dt(){return Yt(Ee,xe)}function rt(Oe,mt){throw mt=mt!==void 0?mt:Yt(Ee,xe),Fe([Bt(Oe)],e.substring(Ee,xe),mt)}function pt(Oe,mt){throw mt=mt!==void 0?mt:Yt(Ee,xe),Ze(Oe,mt)}function ct(Oe,mt){return{type:"literal",text:Oe,ignoreCase:mt}}function Ct(Oe,mt,It){return{type:"class",parts:Oe,inverted:mt,ignoreCase:It}}function kt(){return{type:"any"}}function Lt(){return{type:"end"}}function Bt(Oe){return{type:"other",description:Oe}}function xt(Oe){var mt=Re[Oe],It;if(mt)return mt;else{It=Oe-1;while(!Re[It])It--;mt=Re[It],mt={line:mt.line,column:mt.column};while(It<Oe){if(e.charCodeAt(It)===10)mt.line++,mt.column=1;else mt.column++;It++}return Re[Oe]=mt,mt}}function Yt(Oe,mt,It){var bt=xt(Oe),cn=xt(mt),dn={source:o,start:{offset:Oe,line:bt.line,column:bt.column},end:{offset:mt,line:cn.line,column:cn.column}};if(It&&o&&typeof o.offset==="function")dn.start=o.offset(dn.start),dn.end=o.offset(dn.end);return dn}function ut(Oe){if(xe<Me)return;if(xe>Me)Me=xe,_e=[];_e.push(Oe)}function Ze(Oe,mt){return new EN(Oe,null,null,mt)}function Fe(Oe,mt,It){return new EN(EN.buildMessage(Oe,mt),Oe,mt,It)}function tt(){var Oe,mt,It,bt,cn;Oe=xe,mt=[],It=gt();while(It!==n)mt.push(It),It=gt();if(It=Je(),It===n)It=null;bt=[],cn=gt();while(cn!==n)bt.push(cn),cn=gt();return Ee=Oe,Oe=U(It),Oe}function Je(){var Oe,mt,It,bt;if(Oe=xe,mt=$e(),mt!==n){if(It=[],bt=mn(),bt!==n)while(bt!==n)It.push(bt),bt=mn();else It=n;if(It!==n)if(bt=Je(),bt!==n)Ee=Oe,Oe=j(mt,bt);else xe=Oe,Oe=n;else xe=Oe,Oe=n}else xe=Oe,Oe=n;if(Oe===n)Oe=$e();return Oe}function $e(){var Oe=ft();if(Oe===n){if(Oe=vt(),Oe===n){if(Oe=Ye(),Oe===n){if(Oe=je(),Oe===n){if(Oe=st(),Oe===n)Oe=St()}}}}return Oe}function ft(){var Oe,mt,It,bt,cn,dn,wn,eo,_o,$n,qn,Po,To,Tn,lo,fo,oo,Ro;if(Oe=xe,e.substr(xe,6)===s)mt=s,xe+=6;else if(mt=n,ye===0)ut(x);if(mt!==n){It=[],bt=gt();while(bt!==n)It.push(bt),bt=gt();if(e.charCodeAt(xe)===40)bt=a,xe++;else if(bt=n,ye===0)ut(C);if(bt!==n){cn=[],dn=gt();while(dn!==n)cn.push(dn),dn=gt();if(dn=Nt(),dn!==n)if(wn=mn(),wn!==n)if(eo=Nt(),eo!==n)if(_o=mn(),_o!==n)if($n=Nt(),$n!==n)if(qn=mn(),qn!==n)if(Po=Nt(),Po!==n)if(To=mn(),To!==n)if(Tn=Nt(),Tn!==n)if(lo=mn(),lo!==n)if(fo=Nt(),fo!==n){oo=[],Ro=gt();while(Ro!==n)oo.push(Ro),Ro=gt();if(e.charCodeAt(xe)===41)Ro=c,xe++;else if(Ro=n,ye===0)ut(b);if(Ro!==n)Ee=Oe,Oe=Y(dn,eo,$n,Po,Tn,fo);else xe=Oe,Oe=n}else xe=Oe,Oe=n;else xe=Oe,Oe=n;else xe=Oe,Oe=n;else xe=Oe,Oe=n;else xe=Oe,Oe=n;else xe=Oe,Oe=n;else xe=Oe,Oe=n;else xe=Oe,Oe=n;else xe=Oe,Oe=n;else xe=Oe,Oe=n;else xe=Oe,Oe=n}else xe=Oe,Oe=n}else xe=Oe,Oe=n;return Oe}function vt(){var Oe,mt,It,bt,cn,dn,wn,eo,_o;if(Oe=xe,e.substr(xe,9)===l)mt=l,xe+=9;else if(mt=n,ye===0)ut(I);if(mt!==n){It=[],bt=gt();while(bt!==n)It.push(bt),bt=gt();if(e.charCodeAt(xe)===40)bt=a,xe++;else if(bt=n,ye===0)ut(C);if(bt!==n){cn=[],dn=gt();while(dn!==n)cn.push(dn),dn=gt();if(dn=Nt(),dn!==n){if(wn=Ot(),wn===n)wn=null;eo=[],_o=gt();while(_o!==n)eo.push(_o),_o=gt();if(e.charCodeAt(xe)===41)_o=c,xe++;else if(_o=n,ye===0)ut(b);if(_o!==n)Ee=Oe,Oe=X(dn,wn);else xe=Oe,Oe=n}else xe=Oe,Oe=n}else xe=Oe,Oe=n}else xe=Oe,Oe=n;return Oe}function Ye(){var Oe,mt,It,bt,cn,dn,wn,eo,_o;if(Oe=xe,e.substr(xe,5)===h)mt=h,xe+=5;else if(mt=n,ye===0)ut(v);if(mt!==n){It=[],bt=gt();while(bt!==n)It.push(bt),bt=gt();if(e.charCodeAt(xe)===40)bt=a,xe++;else if(bt=n,ye===0)ut(C);if(bt!==n){cn=[],dn=gt();while(dn!==n)cn.push(dn),dn=gt();if(dn=Nt(),dn!==n){if(wn=Ot(),wn===n)wn=null;eo=[],_o=gt();while(_o!==n)eo.push(_o),_o=gt();if(e.charCodeAt(xe)===41)_o=c,xe++;else if(_o=n,ye===0)ut(b);if(_o!==n)Ee=Oe,Oe=K(dn,wn);else xe=Oe,Oe=n}else xe=Oe,Oe=n}else xe=Oe,Oe=n}else xe=Oe,Oe=n;return Oe}function je(){var Oe,mt,It,bt,cn,dn,wn,eo,_o;if(Oe=xe,e.substr(xe,6)===d)mt=d,xe+=6;else if(mt=n,ye===0)ut(P);if(mt!==n){It=[],bt=gt();while(bt!==n)It.push(bt),bt=gt();if(e.charCodeAt(xe)===40)bt=a,xe++;else if(bt=n,ye===0)ut(C);if(bt!==n){cn=[],dn=gt();while(dn!==n)cn.push(dn),dn=gt();if(dn=Nt(),dn!==n){if(wn=Ut(),wn===n)wn=null;eo=[],_o=gt();while(_o!==n)eo.push(_o),_o=gt();if(e.charCodeAt(xe)===41)_o=c,xe++;else if(_o=n,ye===0)ut(b);if(_o!==n)Ee=Oe,Oe=J(dn,wn);else xe=Oe,Oe=n}else xe=Oe,Oe=n}else xe=Oe,Oe=n}else xe=Oe,Oe=n;return Oe}function st(){var Oe,mt,It,bt,cn,dn,wn,eo;if(Oe=xe,e.substr(xe,5)===u)mt=u,xe+=5;else if(mt=n,ye===0)ut(M);if(mt!==n){It=[],bt=gt();while(bt!==n)It.push(bt),bt=gt();if(e.charCodeAt(xe)===40)bt=a,xe++;else if(bt=n,ye===0)ut(C);if(bt!==n){cn=[],dn=gt();while(dn!==n)cn.push(dn),dn=gt();if(dn=Nt(),dn!==n){wn=[],eo=gt();while(eo!==n)wn.push(eo),eo=gt();if(e.charCodeAt(xe)===41)eo=c,xe++;else if(eo=n,ye===0)ut(b);if(eo!==n)Ee=Oe,Oe=ee(dn);else xe=Oe,Oe=n}else xe=Oe,Oe=n}else xe=Oe,Oe=n}else xe=Oe,Oe=n;return Oe}function St(){var Oe,mt,It,bt,cn,dn,wn,eo;if(Oe=xe,e.substr(xe,5)===_)mt=_,xe+=5;else if(mt=n,ye===0)ut(B);if(mt!==n){It=[],bt=gt();while(bt!==n)It.push(bt),bt=gt();if(e.charCodeAt(xe)===40)bt=a,xe++;else if(bt=n,ye===0)ut(C);if(bt!==n){cn=[],dn=gt();while(dn!==n)cn.push(dn),dn=gt();if(dn=Nt(),dn!==n){wn=[],eo=gt();while(eo!==n)wn.push(eo),eo=gt();if(e.charCodeAt(xe)===41)eo=c,xe++;else if(eo=n,ye===0)ut(b);if(eo!==n)Ee=Oe,Oe=se(dn);else xe=Oe,Oe=n}else xe=Oe,Oe=n}else xe=Oe,Oe=n}else xe=Oe,Oe=n;return Oe}function Nt(){var Oe,mt,It,bt;if(Oe=xe,mt=xe,It=Zn(),It===n)It=null;if(bt=Qn(),bt!==n)It=[It,bt],mt=It;else xe=mt,mt=n;if(mt!==n)Ee=Oe,mt=ne(mt);if(Oe=mt,Oe===n){if(Oe=xe,mt=xe,It=Zn(),It===n)It=null;if(bt=En(),bt!==n)It=[It,bt],mt=It;else xe=mt,mt=n;if(mt!==n)Ee=Oe,mt=re(mt);Oe=mt}return Oe}function Ot(){var Oe,mt,It;if(Oe=xe,mt=mn(),mt!==n)if(It=Nt(),It!==n)Ee=Oe,Oe=Z(It);else xe=Oe,Oe=n;else xe=Oe,Oe=n;return Oe}function Ut(){var Oe,mt,It,bt,cn;if(Oe=xe,mt=mn(),mt!==n)if(It=Nt(),It!==n)if(bt=mn(),bt!==n)if(cn=Nt(),cn!==n)Ee=Oe,Oe=te(It,cn);else xe=Oe,Oe=n;else xe=Oe,Oe=n;else xe=Oe,Oe=n;else xe=Oe,Oe=n;return Oe}function mn(){var Oe,mt,It,bt,cn;if(Oe=xe,mt=[],It=gt(),It!==n)while(It!==n)mt.push(It),It=gt();else mt=n;if(mt!==n){if(It=_n(),It===n)It=null;bt=[],cn=gt();while(cn!==n)bt.push(cn),cn=gt();mt=[mt,It,bt],Oe=mt}else xe=Oe,Oe=n;if(Oe===n)if(Oe=xe,mt=_n(),mt!==n){It=[],bt=gt();while(bt!==n)It.push(bt),bt=gt();mt=[mt,It],Oe=mt}else xe=Oe,Oe=n;return Oe}function _n(){var Oe;if(e.charCodeAt(xe)===44)Oe=p,xe++;else if(Oe=n,ye===0)ut(T);return Oe}function En(){var Oe,mt;if(Oe=xe,mt=bo(),mt!==n)Ee=Oe,mt=ie(mt);return Oe=mt,Oe}function Qn(){var Oe,mt,It;if(Oe=xe,mt=ln(),mt!==n){if(It=hn(),It===n)It=null;Ee=Oe,Oe=ce(mt,It)}else xe=Oe,Oe=n;if(Oe===n)if(Oe=xe,mt=bo(),mt!==n)if(It=hn(),It!==n)Ee=Oe,Oe=ue(mt,It);else xe=Oe,Oe=n;else xe=Oe,Oe=n;return Oe}function ln(){var Oe,mt,It,bt;if(ye++,Oe=xe,mt=bo(),mt===n)mt=null;if(e.charCodeAt(xe)===46)It=m,xe++;else if(It=n,ye===0)ut(D);if(It!==n)if(bt=bo(),bt!==n)Ee=Oe,Oe=de(mt,bt);else xe=Oe,Oe=n;else xe=Oe,Oe=n;if(Oe===n)if(Oe=xe,mt=bo(),mt!==n){if(e.charCodeAt(xe)===46)It=m,xe++;else if(It=n,ye===0)ut(D);if(It!==n)Ee=Oe,Oe=me(mt);else xe=Oe,Oe=n}else xe=Oe,Oe=n;if(ye--,Oe===n){if(mt=n,ye===0)ut(N)}return Oe}function hn(){var Oe,mt,It,bt;if(Oe=xe,A.test(e.charAt(xe)))mt=e.charAt(xe),xe++;else if(mt=n,ye===0)ut(L);if(mt!==n){if(It=Zn(),It===n)It=null;if(bt=bo(),bt!==n)Ee=Oe,Oe=ge(It,bt);else xe=Oe,Oe=n}else xe=Oe,Oe=n;return Oe}function Zn(){var Oe;if(g.test(e.charAt(xe)))Oe=e.charAt(xe),xe++;else if(Oe=n,ye===0)ut(H);return Oe}function bo(){var Oe,mt;if(Oe=[],mt=ir(),mt!==n)while(mt!==n)Oe.push(mt),mt=ir();else Oe=n;return Oe}function ir(){var Oe;if(f.test(e.charAt(xe)))Oe=e.charAt(xe),xe++;else if(Oe=n,ye===0)ut(V);return Oe}function gt(){var Oe;if(y.test(e.charAt(xe)))Oe=e.charAt(xe),xe++;else if(Oe=n,ye===0)ut(O);return Oe}if(Se=i(),Se!==n&&xe===e.length)return Se;else{if(Se!==n&&xe<e.length)ut(Lt());throw Fe(_e,Me<e.length?e.charAt(Me):null,Me<e.length?Yt(Me,Me+1):Yt(Me,Me))}}});var B3t=lt(function(w3t){Object.defineProperty(w3t,"__esModule",{value:!0});w3t.fromTransformAttribute=Lyo;var kyo=M3t();function Lyo(e){return(0,kyo.parse)(e)}});var D3t=lt(function(T3t){Object.defineProperty(T3t,"__esModule",{value:!0});T3t.decomposeTSR=Fyo;var HNe=_re(),FNe=OF();function Fyo(e,t=!1,n=!1){if(t)if(n)e=(0,FNe.compose)(e,(0,HNe.scale)(-1,-1));else e=(0,FNe.compose)(e,(0,HNe.scale)(1,-1));else if(n)e=(0,FNe.compose)(e,(0,HNe.scale)(-1,1));let o=e.a,r=e.b,i=e.c,s=e.d,a,c,l;if(o!==0||i!==0){let h=Math.hypot(o,i);a=h,c=(o*s-r*i)/h;let d=Math.acos(o/h);l=i>0?-d:d}else if(r!==0||s!==0){let h=Math.hypot(r,s);a=(o*s-r*i)/h,c=h;let d=Math.acos(r/h);l=Math.PI/2+(s>0?-d:d)}else a=0,c=0,l=0;if(n)a=-a;if(t)c=-c;return{translate:{tx:e.e,ty:e.f},scale:{sx:a,sy:c},rotation:{angle:l}}}});var R3t=lt(function(N3t){Object.defineProperty(N3t,"__esModule",{value:!0});N3t.flipOrigin=Yyo;N3t.flipX=Oyo;N3t.flipY=Vyo;function Oyo(){return{a:1,c:0,e:0,b:0,d:-1,f:0}}function Vyo(){return{a:-1,c:0,e:0,b:0,d:1,f:0}}function Yyo(){return{a:-1,c:0,e:0,b:0,d:-1,f:0}}});var L3t=lt(function(k3t){Object.defineProperty(k3t,"__esModule",{value:!0});k3t.fromOneMovingPoint=Q3t;k3t.fromTwoMovingPoints=Jyo;var Xyo=mX(),jyo=MNe(),Kyo=CAe(),$yo=_re(),qyo=OF();function Q3t(e,t){let n=t.x-e.x,o=t.y-e.y;return(0,Xyo.translate)(n,o)}function Jyo(e,t,n,o){let r=Q3t(e,n),i=(0,jyo.applyToPoint)(r,t),s=n,a=o,c=Math.atan2(a.y-s.y,a.x-s.x)-Math.atan2(i.y-s.y,i.x-s.x),l=(0,Kyo.rotate)(c,s.x,s.y),h=Math.sqrt(Math.pow(i.x-s.x,2)+Math.pow(i.y-s.y,2)),u=Math.sqrt(Math.pow(a.x-s.x,2)+Math.pow(a.y-s.y,2))/h,_=(0,$yo.scale)(u,u,s.x,s.y);return(0,qyo.compose)([r,_,l])}});var wt=lt(function(di){Object.defineProperty(di,"__esModule",{value:!0});var zNe=MNe();Object.keys(zNe).forEach(function(e){if(e==="default"||e==="__esModule")return;if(e in di&&di[e]===zNe[e])return;Object.defineProperty(di,e,{enumerable:!0,get:function(){return zNe[e]}})});var ONe=wNe();Object.keys(ONe).forEach(function(e){if(e==="default"||e==="__esModule")return;if(e in di&&di[e]===ONe[e])return;Object.defineProperty(di,e,{enumerable:!0,get:function(){return ONe[e]}})});var VNe=q4t();Object.keys(VNe).forEach(function(e){if(e==="default"||e==="__esModule")return;if(e in di&&di[e]===VNe[e])return;Object.defineProperty(di,e,{enumerable:!0,get:function(){return VNe[e]}})});var YNe=Z4t();Object.keys(YNe).forEach(function(e){if(e==="default"||e==="__esModule")return;if(e in di&&di[e]===YNe[e])return;Object.defineProperty(di,e,{enumerable:!0,get:function(){return YNe[e]}})});var GNe=BNe();Object.keys(GNe).forEach(function(e){if(e==="default"||e==="__esModule")return;if(e in di&&di[e]===GNe[e])return;Object.defineProperty(di,e,{enumerable:!0,get:function(){return GNe[e]}})});var UNe=o3t();Object.keys(UNe).forEach(function(e){if(e==="default"||e==="__esModule")return;if(e in di&&di[e]===UNe[e])return;Object.defineProperty(di,e,{enumerable:!0,get:function(){return UNe[e]}})});var WNe=CAe();Object.keys(WNe).forEach(function(e){if(e==="default"||e==="__esModule")return;if(e in di&&di[e]===WNe[e])return;Object.defineProperty(di,e,{enumerable:!0,get:function(){return WNe[e]}})});var XNe=_re();Object.keys(XNe).forEach(function(e){if(e==="default"||e==="__esModule")return;if(e in di&&di[e]===XNe[e])return;Object.defineProperty(di,e,{enumerable:!0,get:function(){return XNe[e]}})});var jNe=NNe();Object.keys(jNe).forEach(function(e){if(e==="default"||e==="__esModule")return;if(e in di&&di[e]===jNe[e])return;Object.defineProperty(di,e,{enumerable:!0,get:function(){return jNe[e]}})});var KNe=RNe();Object.keys(KNe).forEach(function(e){if(e==="default"||e==="__esModule")return;if(e in di&&di[e]===KNe[e])return;Object.defineProperty(di,e,{enumerable:!0,get:function(){return KNe[e]}})});var $Ne=A3t();Object.keys($Ne).forEach(function(e){if(e==="default"||e==="__esModule")return;if(e in di&&di[e]===$Ne[e])return;Object.defineProperty(di,e,{enumerable:!0,get:function(){return $Ne[e]}})});var qNe=OF();Object.keys(qNe).forEach(function(e){if(e==="default"||e==="__esModule")return;if(e in di&&di[e]===qNe[e])return;Object.defineProperty(di,e,{enumerable:!0,get:function(){return qNe[e]}})});var JNe=mX();Object.keys(JNe).forEach(function(e){if(e==="default"||e==="__esModule")return;if(e in di&&di[e]===JNe[e])return;Object.defineProperty(di,e,{enumerable:!0,get:function(){return JNe[e]}})});var ZNe=x3t();Object.keys(ZNe).forEach(function(e){if(e==="default"||e==="__esModule")return;if(e in di&&di[e]===ZNe[e])return;Object.defineProperty(di,e,{enumerable:!0,get:function(){return ZNe[e]}})});var eRe=kNe();Object.keys(eRe).forEach(function(e){if(e==="default"||e==="__esModule")return;if(e in di&&di[e]===eRe[e])return;Object.defineProperty(di,e,{enumerable:!0,get:function(){return eRe[e]}})});var tRe=P3t();Object.keys(tRe).forEach(function(e){if(e==="default"||e==="__esModule")return;if(e in di&&di[e]===tRe[e])return;Object.defineProperty(di,e,{enumerable:!0,get:function(){return tRe[e]}})});var nRe=B3t();Object.keys(nRe).forEach(function(e){if(e==="default"||e==="__esModule")return;if(e in di&&di[e]===nRe[e])return;Object.defineProperty(di,e,{enumerable:!0,get:function(){return nRe[e]}})});var oRe=D3t();Object.keys(oRe).forEach(function(e){if(e==="default"||e==="__esModule")return;if(e in di&&di[e]===oRe[e])return;Object.defineProperty(di,e,{enumerable:!0,get:function(){return oRe[e]}})});var rRe=R3t();Object.keys(rRe).forEach(function(e){if(e==="default"||e==="__esModule")return;if(e in di&&di[e]===rRe[e])return;Object.defineProperty(di,e,{enumerable:!0,get:function(){return rRe[e]}})});var iRe=L3t();Object.keys(iRe).forEach(function(e){if(e==="default"||e==="__esModule")return;if(e in di&&di[e]===iRe[e])return;Object.defineProperty(di,e,{enumerable:!0,get:function(){return iRe[e]}})})});var sRe,_X;var H3t=El(()=>{sRe={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};for(let e in sRe)Object.freeze(sRe[e]);_X=Object.freeze(sRe)});function MN(e,t,n){return Math.min(Math.max(t,e),n)}function bAe(e){let t=Math.round(e).toString(16).toUpperCase();return t.length<2?"0"+t:t}var F3t,_x,VF;var z3t=El(()=>{H3t();F3t=Object.create(null);for(let e in _X)if(Object.hasOwn(_X,e))F3t[_X[e]]=e;_x={to:{},get:{}};_x.get=function(e){let t=e.slice(0,3).toLowerCase(),n,o;switch(t){case"hsl":{n=_x.get.hsl(e),o="hsl";break}case"hwb":{n=_x.get.hwb(e),o="hwb";break}default:{n=_x.get.rgb(e),o="rgb";break}}if(!n)return null;return{model:o,value:n}};_x.get.rgb=function(e){if(!e)return null;let t=/^#([a-f\d]{3,4})$/i,n=/^#([a-f\d]{6})([a-f\d]{2})?$/i,o=/^rgba?\(\s*([+-]?(?:\d*\.)?\d+(?:e\d+)?)(?=[\s,])\s*(?:,\s*)?([+-]?(?:\d*\.)?\d+(?:e\d+)?)(?=[\s,])\s*(?:,\s*)?([+-]?(?:\d*\.)?\d+(?:e\d+)?)\s*(?:[\s,|/]\s*([+-]?(?:\d*\.)?\d+(?:e\d+)?)(%?)\s*)?\)$/i,r=/^rgba?\(\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*(?:[\s,|/]\s*([+-]?[\d.]+)(%?)\s*)?\)$/i,i=/^(\w+)$/,s=[0,0,0,1],a,c,l;if(a=e.match(n)){l=a[2],a=a[1];for(c=0;c<3;c++){let h=c*2;s[c]=Number.parseInt(a.slice(h,h+2),16)}if(l)s[3]=Number.parseInt(l,16)/255}else if(a=e.match(t)){a=a[1],l=a[3];for(c=0;c<3;c++)s[c]=Number.parseInt(a[c]+a[c],16);if(l)s[3]=Number.parseInt(l+l,16)/255}else if(a=e.match(o)){for(c=0;c<3;c++)s[c]=Number.parseFloat(a[c+1]);if(a[4])s[3]=a[5]?Number.parseFloat(a[4])*0.01:Number.parseFloat(a[4])}else if(a=e.match(r)){for(c=0;c<3;c++)s[c]=Math.round(Number.parseFloat(a[c+1])*2.55);if(a[4])s[3]=a[5]?Number.parseFloat(a[4])*0.01:Number.parseFloat(a[4])}else if(a=e.toLowerCase().match(i)){if(a[1]==="transparent")return[0,0,0,0];if(!Object.hasOwn(_X,a[1]))return null;return s=_X[a[1]].slice(),s[3]=1,s}else return null;for(c=0;c<3;c++)s[c]=MN(s[c],0,255);return s[3]=MN(s[3],0,1),s};_x.get.hsl=function(e){if(!e)return null;let t=/^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*(?:[,|/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:e[+-]?\d+)?)\s*)?\)$/i,n=e.match(t);if(n){let o=Number.parseFloat(n[4]),r=(Number.parseFloat(n[1])%360+360)%360,i=MN(Number.parseFloat(n[2]),0,100),s=MN(Number.parseFloat(n[3]),0,100),a=MN(Number.isNaN(o)?1:o,0,1);return[r,i,s,a]}return null};_x.get.hwb=function(e){if(!e)return null;let t=/^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*[\s,]\s*([+-]?[\d.]+)%\s*[\s,]\s*([+-]?[\d.]+)%\s*(?:[\s,]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:e[+-]?\d+)?)\s*)?\)$/i,n=e.match(t);if(n){let o=Number.parseFloat(n[4]),r=(Number.parseFloat(n[1])%360+360)%360,i=MN(Number.parseFloat(n[2]),0,100),s=MN(Number.parseFloat(n[3]),0,100),a=MN(Number.isNaN(o)?1:o,0,1);return[r,i,s,a]}return null};_x.to.hex=function(...e){return"#"+bAe(e[0])+bAe(e[1])+bAe(e[2])+(e[3]<1?bAe(Math.round(e[3]*255)):"")};_x.to.rgb=function(...e){return e.length<4||e[3]===1?"rgb("+Math.round(e[0])+", "+Math.round(e[1])+", "+Math.round(e[2])+")":"rgba("+Math.round(e[0])+", "+Math.round(e[1])+", "+Math.round(e[2])+", "+e[3]+")"};_x.to.rgb.percent=function(...e){let t=Math.round(e[0]/255*100),n=Math.round(e[1]/255*100),o=Math.round(e[2]/255*100);return e.length<4||e[3]===1?"rgb("+t+"%, "+n+"%, "+o+"%)":"rgba("+t+"%, "+n+"%, "+o+"%, "+e[3]+")"};_x.to.hsl=function(...e){return e.length<4||e[3]===1?"hsl("+e[0]+", "+e[1]+"%, "+e[2]+"%)":"hsla("+e[0]+", "+e[1]+"%, "+e[2]+"%, "+e[3]+")"};_x.to.hwb=function(...e){let t="";if(e.length>=4&&e[3]!==1)t=", "+e[3];return"hwb("+e[0]+", "+e[1]+"%, "+e[2]+"%"+t+")"};_x.to.keyword=function(...e){return F3t[e.slice(0,3)]};VF=_x});var aRe,gX;var O3t=El(()=>{aRe={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};for(let e in aRe)Object.freeze(aRe[e]);gX=Object.freeze(aRe)});function AX(e){let t=e>0.0031308?1.055*e**0.4166666666666667-0.055:e*12.92;return Math.min(Math.max(0,t),1)}function fX(e){return e>0.04045?((e+0.055)/1.055)**2.4:e/12.92}function txo(e,t){return(e[0]-t[0])**2+(e[1]-t[1])**2+(e[2]-t[2])**2}var V3t,Vr,AM,gM=0.008856451679035631;var cRe=El(()=>{O3t();V3t={};for(let e of Object.keys(gX))V3t[gX[e]]=e;Vr={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},oklab:{channels:3,labels:["okl","oka","okb"]},lch:{channels:3,labels:"lch"},oklch:{channels:3,labels:["okl","okc","okh"]},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}},AM=Vr;for(let e of Object.keys(Vr)){if(!("channels"in Vr[e]))throw Error("missing channels property: "+e);if(!("labels"in Vr[e]))throw Error("missing channel labels property: "+e);if(Vr[e].labels.length!==Vr[e].channels)throw Error("channel and label counts mismatch: "+e);let{channels:t,labels:n}=Vr[e];delete Vr[e].channels,delete Vr[e].labels,Object.defineProperty(Vr[e],"channels",{value:t}),Object.defineProperty(Vr[e],"labels",{value:n})}Vr.rgb.hsl=function(e){let t=e[0]/255,n=e[1]/255,o=e[2]/255,r=Math.min(t,n,o),i=Math.max(t,n,o),s=i-r,a,c;switch(i){case r:{a=0;break}case t:{a=(n-o)/s;break}case n:{a=2+(o-t)/s;break}case o:{a=4+(t-n)/s;break}}if(a=Math.min(a*60,360),a<0)a+=360;let l=(r+i)/2;if(i===r)c=0;else if(l<=0.5)c=s/(i+r);else c=s/(2-i-r);return[a,c*100,l*100]};Vr.rgb.hsv=function(e){let t,n,o,r,i,s=e[0]/255,a=e[1]/255,c=e[2]/255,l=Math.max(s,a,c),h=l-Math.min(s,a,c),d=function(u){return(l-u)/6/h+0.5};if(h===0)r=0,i=0;else{switch(i=h/l,t=d(s),n=d(a),o=d(c),l){case s:{r=o-n;break}case a:{r=0.3333333333333333+t-o;break}case c:{r=0.6666666666666666+n-t;break}}if(r<0)r+=1;else if(r>1)r-=1}return[r*360,i*100,l*100]};Vr.rgb.hwb=function(e){let t=e[0],n=e[1],o=e[2],r=Vr.rgb.hsl(e)[0],i=0.00392156862745098*Math.min(t,Math.min(n,o));return o=1-0.00392156862745098*Math.max(t,Math.max(n,o)),[r,i*100,o*100]};Vr.rgb.oklab=function(e){let t=fX(e[0]/255),n=fX(e[1]/255),o=fX(e[2]/255),r=Math.cbrt(0.4122214708*t+0.5363325363*n+0.0514459929*o),i=Math.cbrt(0.2119034982*t+0.6806995451*n+0.1073969566*o),s=Math.cbrt(0.0883024619*t+0.2817188376*n+0.6299787005*o),a=0.2104542553*r+0.793617785*i-0.0040720468*s,c=1.9779984951*r-2.428592205*i+0.4505937099*s,l=0.0259040371*r+0.7827717662*i-0.808675766*s;return[a*100,c*100,l*100]};Vr.rgb.cmyk=function(e){let t=e[0]/255,n=e[1]/255,o=e[2]/255,r=Math.min(1-t,1-n,1-o),i=(1-t-r)/(1-r)||0,s=(1-n-r)/(1-r)||0,a=(1-o-r)/(1-r)||0;return[i*100,s*100,a*100,r*100]};Vr.rgb.keyword=function(e){let t=V3t[e];if(t)return t;let n=Number.POSITIVE_INFINITY,o;for(let r of Object.keys(gX)){let i=gX[r],s=txo(e,i);if(s<n)n=s,o=r}return o};Vr.keyword.rgb=function(e){return[...gX[e]]};Vr.rgb.xyz=function(e){let t=fX(e[0]/255),n=fX(e[1]/255),o=fX(e[2]/255),r=t*0.4124564+n*0.3575761+o*0.1804375,i=t*0.2126729+n*0.7151522+o*0.072175,s=t*0.0193339+n*0.119192+o*0.9503041;return[r*100,i*100,s*100]};Vr.rgb.lab=function(e){let t=Vr.rgb.xyz(e),n=t[0],o=t[1],r=t[2];n/=95.047,o/=100,r/=108.883,n=n>gM?n**0.3333333333333333:7.787*n+0.13793103448275862,o=o>gM?o**0.3333333333333333:7.787*o+0.13793103448275862,r=r>gM?r**0.3333333333333333:7.787*r+0.13793103448275862;let i=116*o-16,s=500*(n-o),a=200*(o-r);return[i,s,a]};Vr.hsl.rgb=function(e){let t=e[0]/360,n=e[1]/100,o=e[2]/100,r,i;if(n===0)return i=o*255,[i,i,i];let s=o<0.5?o*(1+n):o+n-o*n,a=2*o-s,c=[0,0,0];for(let l=0;l<3;l++){if(r=t+0.3333333333333333*-(l-1),r<0)r++;if(r>1)r--;if(6*r<1)i=a+(s-a)*6*r;else if(2*r<1)i=s;else if(3*r<2)i=a+(s-a)*(0.6666666666666666-r)*6;else i=a;c[l]=i*255}return c};Vr.hsl.hsv=function(e){let t=e[0],n=e[1]/100,o=e[2]/100,r=n,i=Math.max(o,0.01);o*=2,n*=o<=1?o:2-o,r*=i<=1?i:2-i;let s=(o+n)/2,a=o===0?2*r/(i+r):2*n/(o+n);return[t,a*100,s*100]};Vr.hsv.rgb=function(e){let t=e[0]/60,n=e[1]/100,o=e[2]/100,r=Math.floor(t)%6,i=t-Math.floor(t),s=255*o*(1-n),a=255*o*(1-n*i),c=255*o*(1-n*(1-i));switch(o*=255,r){case 0:return[o,c,s];case 1:return[a,o,s];case 2:return[s,o,c];case 3:return[s,a,o];case 4:return[c,s,o];case 5:return[o,s,a]}};Vr.hsv.hsl=function(e){let t=e[0],n=e[1]/100,o=e[2]/100,r=Math.max(o,0.01),i,s;s=(2-n)*o;let a=(2-n)*r;return i=n*r,i/=a<=1?a:2-a,i=i||0,s/=2,[t,i*100,s*100]};Vr.hwb.rgb=function(e){let t=e[0]/360,n=e[1]/100,o=e[2]/100,r=n+o,i;if(r>1)n/=r,o/=r;let s=Math.floor(6*t),a=1-o;if(i=6*t-s,(s&1)!==0)i=1-i;let c=n+i*(a-n),l,h,d;switch(s){default:case 6:case 0:{l=a,h=c,d=n;break}case 1:{l=c,h=a,d=n;break}case 2:{l=n,h=a,d=c;break}case 3:{l=n,h=c,d=a;break}case 4:{l=c,h=n,d=a;break}case 5:{l=a,h=n,d=c;break}}return[l*255,h*255,d*255]};Vr.cmyk.rgb=function(e){let t=e[0]/100,n=e[1]/100,o=e[2]/100,r=e[3]/100,i=1-Math.min(1,t*(1-r)+r),s=1-Math.min(1,n*(1-r)+r),a=1-Math.min(1,o*(1-r)+r);return[i*255,s*255,a*255]};Vr.xyz.rgb=function(e){let t=e[0]/100,n=e[1]/100,o=e[2]/100,r,i,s;return r=t*3.2404542+n*-1.5371385+o*-0.4985314,i=t*-0.969266+n*1.8760108+o*0.041556,s=t*0.0556434+n*-0.2040259+o*1.0572252,r=AX(r),i=AX(i),s=AX(s),[r*255,i*255,s*255]};Vr.xyz.lab=function(e){let t=e[0],n=e[1],o=e[2];t/=95.047,n/=100,o/=108.883,t=t>gM?t**0.3333333333333333:7.787*t+0.13793103448275862,n=n>gM?n**0.3333333333333333:7.787*n+0.13793103448275862,o=o>gM?o**0.3333333333333333:7.787*o+0.13793103448275862;let r=116*n-16,i=500*(t-n),s=200*(n-o);return[r,i,s]};Vr.xyz.oklab=function(e){let t=e[0]/100,n=e[1]/100,o=e[2]/100,r=Math.cbrt(0.8189330101*t+0.3618667424*n-0.1288597137*o),i=Math.cbrt(0.0329845436*t+0.9293118715*n+0.0361456387*o),s=Math.cbrt(0.0482003018*t+0.2643662691*n+0.633851707*o),a=0.2104542553*r+0.793617785*i-0.0040720468*s,c=1.9779984951*r-2.428592205*i+0.4505937099*s,l=0.0259040371*r+0.7827717662*i-0.808675766*s;return[a*100,c*100,l*100]};Vr.oklab.oklch=function(e){return Vr.lab.lch(e)};Vr.oklab.xyz=function(e){let t=e[0]/100,n=e[1]/100,o=e[2]/100,r=(0.999999998*t+0.396337792*n+0.215803758*o)**3,i=(1.000000008*t-0.105561342*n-0.063854175*o)**3,s=(1.000000055*t-0.089484182*n-1.291485538*o)**3,a=1.227013851*r-0.55779998*i+0.281256149*s,c=-0.040580178*r+1.11225687*i-0.071676679*s,l=-0.076381285*r-0.421481978*i+1.58616322*s;return[a*100,c*100,l*100]};Vr.oklab.rgb=function(e){let t=e[0]/100,n=e[1]/100,o=e[2]/100,r=(t+0.3963377774*n+0.2158037573*o)**3,i=(t-0.1055613458*n-0.0638541728*o)**3,s=(t-0.0894841775*n-1.291485548*o)**3,a=AX(4.0767416621*r-3.3077115913*i+0.2309699292*s),c=AX(-1.2684380046*r+2.6097574011*i-0.3413193965*s),l=AX(-0.0041960863*r-0.7034186147*i+1.707614701*s);return[a*255,c*255,l*255]};Vr.oklch.oklab=function(e){return Vr.lch.lab(e)};Vr.lab.xyz=function(e){let t=e[0],n=e[1],o=e[2],r,i,s;i=(t+16)/116,r=n/500+i,s=i-o/200;let a=i**3,c=r**3,l=s**3;return i=a>gM?a:(i-0.13793103448275862)/7.787,r=c>gM?c:(r-0.13793103448275862)/7.787,s=l>gM?l:(s-0.13793103448275862)/7.787,r*=95.047,i*=100,s*=108.883,[r,i,s]};Vr.lab.lch=function(e){let t=e[0],n=e[1],o=e[2],r;if(r=Math.atan2(o,n)*360/2/Math.PI,r<0)r+=360;let s=Math.sqrt(n*n+o*o);return[t,s,r]};Vr.lch.lab=function(e){let t=e[0],n=e[1],r=e[2]/360*2*Math.PI,i=n*Math.cos(r),s=n*Math.sin(r);return[t,i,s]};Vr.rgb.ansi16=function(e,t=null){let[n,o,r]=e,i=t===null?Vr.rgb.hsv(e)[2]:t;if(i=Math.round(i/50),i===0)return 30;let s=30+(Math.round(r/255)<<2|Math.round(o/255)<<1|Math.round(n/255));if(i===2)s+=60;return s};Vr.hsv.ansi16=function(e){return Vr.rgb.ansi16(Vr.hsv.rgb(e),e[2])};Vr.rgb.ansi256=function(e){let t=e[0],n=e[1],o=e[2];if(t>>4===n>>4&&n>>4===o>>4){if(t<8)return 16;if(t>248)return 231;return Math.round((t-8)/247*24)+232}return 16+36*Math.round(t/255*5)+6*Math.round(n/255*5)+Math.round(o/255*5)};Vr.ansi16.rgb=function(e){e=e[0];let t=e%10;if(t===0||t===7){if(e>50)t+=3.5;return t=t/10.5*255,[t,t,t]}let n=(Math.trunc(e>50)+1)*0.5,o=(t&1)*n*255,r=(t>>1&1)*n*255,i=(t>>2&1)*n*255;return[o,r,i]};Vr.ansi256.rgb=function(e){if(e=e[0],e>=232){let i=(e-232)*10+8;return[i,i,i]}e-=16;let t,n=Math.floor(e/36)/5*255,o=Math.floor((t=e%36)/6)/5*255,r=t%6/5*255;return[n,o,r]};Vr.rgb.hex=function(e){let n=(((Math.round(e[0])&255)<<16)+((Math.round(e[1])&255)<<8)+(Math.round(e[2])&255)).toString(16).toUpperCase();return"000000".slice(n.length)+n};Vr.hex.rgb=function(e){let t=e.toString(16).match(/[a-f\d]{6}|[a-f\d]{3}/i);if(!t)return[0,0,0];let n=t[0];if(t[0].length===3)n=[...n].map((a)=>a+a).join("");let o=Number.parseInt(n,16),r=o>>16&255,i=o>>8&255,s=o&255;return[r,i,s]};Vr.rgb.hcg=function(e){let t=e[0]/255,n=e[1]/255,o=e[2]/255,r=Math.max(Math.max(t,n),o),i=Math.min(Math.min(t,n),o),s=r-i,a,c=s<1?i/(1-s):0;if(s<=0)a=0;else if(r===t)a=(n-o)/s%6;else if(r===n)a=2+(o-t)/s;else a=4+(t-n)/s;return a/=6,a%=1,[a*360,s*100,c*100]};Vr.hsl.hcg=function(e){let t=e[1]/100,n=e[2]/100,o=n<0.5?2*t*n:2*t*(1-n),r=0;if(o<1)r=(n-0.5*o)/(1-o);return[e[0],o*100,r*100]};Vr.hsv.hcg=function(e){let t=e[1]/100,n=e[2]/100,o=t*n,r=0;if(o<1)r=(n-o)/(1-o);return[e[0],o*100,r*100]};Vr.hcg.rgb=function(e){let t=e[0]/360,n=e[1]/100,o=e[2]/100;if(n===0)return[o*255,o*255,o*255];let r=[0,0,0],i=t%1*6,s=i%1,a=1-s,c=0;switch(Math.floor(i)){case 0:{r[0]=1,r[1]=s,r[2]=0;break}case 1:{r[0]=a,r[1]=1,r[2]=0;break}case 2:{r[0]=0,r[1]=1,r[2]=s;break}case 3:{r[0]=0,r[1]=a,r[2]=1;break}case 4:{r[0]=s,r[1]=0,r[2]=1;break}default:r[0]=1,r[1]=0,r[2]=a}return c=(1-n)*o,[(n*r[0]+c)*255,(n*r[1]+c)*255,(n*r[2]+c)*255]};Vr.hcg.hsv=function(e){let t=e[1]/100,n=e[2]/100,o=t+n*(1-t),r=0;if(o>0)r=t/o;return[e[0],r*100,o*100]};Vr.hcg.hsl=function(e){let t=e[1]/100,o=e[2]/100*(1-t)+0.5*t,r=0;if(o>0&&o<0.5)r=t/(2*o);else if(o>=0.5&&o<1)r=t/(2*(1-o));return[e[0],r*100,o*100]};Vr.hcg.hwb=function(e){let t=e[1]/100,n=e[2]/100,o=t+n*(1-t);return[e[0],(o-t)*100,(1-o)*100]};Vr.hwb.hcg=function(e){let t=e[1]/100,o=1-e[2]/100,r=o-t,i=0;if(r<1)i=(o-r)/(1-r);return[e[0],r*100,i*100]};Vr.apple.rgb=function(e){return[e[0]/65535*255,e[1]/65535*255,e[2]/65535*255]};Vr.rgb.apple=function(e){return[e[0]/255*65535,e[1]/255*65535,e[2]/255*65535]};Vr.gray.rgb=function(e){return[e[0]/100*255,e[0]/100*255,e[0]/100*255]};Vr.gray.hsl=function(e){return[0,0,e[0]]};Vr.gray.hsv=Vr.gray.hsl;Vr.gray.hwb=function(e){return[0,100,e[0]]};Vr.gray.cmyk=function(e){return[0,0,0,e[0]]};Vr.gray.lab=function(e){return[e[0],0,0]};Vr.gray.hex=function(e){let t=Math.round(e[0]/100*255)&255,o=((t<<16)+(t<<8)+t).toString(16).toUpperCase();return"000000".slice(o.length)+o};Vr.rgb.gray=function(e){return[(e[0]+e[1]+e[2])/3/255*100]}});function nxo(){let e={},t=Object.keys(AM);for(let{length:n}=t,o=0;o<n;o++)e[t[o]]={distance:-1,parent:null};return e}function oxo(e){let t=nxo(),n=[e];t[e].distance=0;while(n.length>0){let o=n.pop(),r=Object.keys(AM[o]);for(let{length:i}=r,s=0;s<i;s++){let a=r[s],c=t[a];if(c.distance===-1)c.distance=t[o].distance+1,c.parent=o,n.unshift(a)}}return t}function rxo(e,t){return function(n){return t(e(n))}}function ixo(e,t){let n=[t[e].parent,e],o=AM[t[e].parent][e],r=t[e].parent;while(t[r].parent)n.unshift(t[r].parent),o=rxo(AM[t[r].parent][r],o),r=t[r].parent;return o.conversion=n,o}function sxo(e){let t=oxo(e),n={},o=Object.keys(t);for(let{length:r}=o,i=0;i<r;i++){let s=o[i];if(t[s].parent===null)continue;n[s]=ixo(s,t)}return n}var Y3t;var G3t=El(()=>{cRe();Y3t=sxo});function cxo(e){let t=function(...n){let o=n[0];if(o===void 0||o===null)return o;if(o.length>1)n=o;return e(n)};if("conversion"in e)t.conversion=e.conversion;return t}function lxo(e){let t=function(...n){let o=n[0];if(o===void 0||o===null)return o;if(o.length>1)n=o;let r=e(n);if(typeof r==="object")for(let{length:i}=r,s=0;s<i;s++)r[s]=Math.round(r[s]);return r};if("conversion"in e)t.conversion=e.conversion;return t}var yX,axo,gx;var U3t=El(()=>{cRe();G3t();yX={},axo=Object.keys(AM);for(let e of axo){yX[e]={},Object.defineProperty(yX[e],"channels",{value:AM[e].channels}),Object.defineProperty(yX[e],"labels",{value:AM[e].labels});let t=Y3t(e),n=Object.keys(t);for(let o of n){let r=t[o];yX[e][o]=lxo(r),yX[e][o].raw=cxo(r)}}gx=yX});function nA(e,t){if(!(this instanceof nA))return new nA(e,t);if(t&&t in W3t)t=null;if(t&&!(t in gx))throw Error("Unknown model: "+t);let n,o;if(e==null)this.model="rgb",this.color=[0,0,0],this.valpha=1;else if(e instanceof nA)this.model=e.model,this.color=[...e.color],this.valpha=e.valpha;else if(typeof e==="string"){let r=VF.get(e);if(r===null)throw Error("Unable to parse color from string: "+e);this.model=r.model,o=gx[this.model].channels,this.color=r.value.slice(0,o),this.valpha=typeof r.value[o]==="number"?r.value[o]:1}else if(e.length>0){this.model=t||"rgb",o=gx[this.model].channels;let r=Array.prototype.slice.call(e,0,o);this.color=dRe(r,o),this.valpha=typeof e[o]==="number"?e[o]:1}else if(typeof e==="number")this.model="rgb",this.color=[e>>16&255,e>>8&255,e&255],this.valpha=1;else{this.valpha=1;let r=Object.keys(e);if("alpha"in e)r.splice(r.indexOf("alpha"),1),this.valpha=typeof e.alpha==="number"?e.alpha:0;let i=r.sort().join("");if(!(i in lRe))throw Error("Unable to parse color from object: "+JSON.stringify(e));this.model=lRe[i];let{labels:s}=gx[this.model],a=[];for(n=0;n<s.length;n++)a.push(e[s[n]]);this.color=dRe(a)}if(hRe[this.model]){o=gx[this.model].channels;for(n=0;n<o;n++){let r=hRe[this.model][n];if(r)this.color[n]=r(this.color[n])}}if(this.valpha=Math.max(0,Math.min(1,this.valpha)),Object.freeze)Object.freeze(this)}function hxo(e,t){return Number(e.toFixed(t))}function dxo(e){return function(t){return hxo(t,e)}}function gp(e,t,n){e=Array.isArray(e)?e:[e];for(let o of e)(hRe[o]||=[])[t]=n;return e=e[0],function(o){let r;if(o!==void 0){if(n)o=n(o);return r=this[e](),r.color[t]=o,r}if(r=this[e]().color[t],n)r=n(r);return r}}function Z_(e){return function(t){return Math.max(0,Math.min(e,t))}}function uxo(e){return Array.isArray(e)?e:[e]}function dRe(e,t){for(let n=0;n<t;n++)if(typeof e[n]!=="number")e[n]=0;return e}var W3t,lRe,hRe,gre;var uRe=El(()=>{z3t();U3t();W3t=["keyword","gray","hex"],lRe={};for(let e of Object.keys(gx))lRe[[...gx[e].labels].sort().join("")]=e;hRe={};nA.prototype={toString(){return this.string()},toJSON(){return this[this.model]()},string(e){let t=this.model in VF.to?this:this.rgb();t=t.round(typeof e==="number"?e:1);let n=t.valpha===1?t.color:[...t.color,this.valpha];return VF.to[t.model](...n)},percentString(e){let t=this.rgb().round(typeof e==="number"?e:1),n=t.valpha===1?t.color:[...t.color,this.valpha];return VF.to.rgb.percent(...n)},array(){return this.valpha===1?[...this.color]:[...this.color,this.valpha]},object(){let e={},{channels:t}=gx[this.model],{labels:n}=gx[this.model];for(let o=0;o<t;o++)e[n[o]]=this.color[o];if(this.valpha!==1)e.alpha=this.valpha;return e},unitArray(){let e=this.rgb().color;if(e[0]/=255,e[1]/=255,e[2]/=255,this.valpha!==1)e.push(this.valpha);return e},unitObject(){let e=this.rgb().object();if(e.r/=255,e.g/=255,e.b/=255,this.valpha!==1)e.alpha=this.valpha;return e},round(e){return e=Math.max(e||0,0),new nA([...this.color.map(dxo(e)),this.valpha],this.model)},alpha(e){if(e!==void 0)return new nA([...this.color,Math.max(0,Math.min(1,e))],this.model);return this.valpha},red:gp("rgb",0,Z_(255)),green:gp("rgb",1,Z_(255)),blue:gp("rgb",2,Z_(255)),hue:gp(["hsl","hsv","hsl","hwb","hcg"],0,(e)=>(e%360+360)%360),saturationl:gp("hsl",1,Z_(100)),lightness:gp("hsl",2,Z_(100)),saturationv:gp("hsv",1,Z_(100)),value:gp("hsv",2,Z_(100)),chroma:gp("hcg",1,Z_(100)),gray:gp("hcg",2,Z_(100)),white:gp("hwb",1,Z_(100)),wblack:gp("hwb",2,Z_(100)),cyan:gp("cmyk",0,Z_(100)),magenta:gp("cmyk",1,Z_(100)),yellow:gp("cmyk",2,Z_(100)),black:gp("cmyk",3,Z_(100)),x:gp("xyz",0,Z_(95.047)),y:gp("xyz",1,Z_(100)),z:gp("xyz",2,Z_(108.833)),l:gp("lab",0,Z_(100)),a:gp("lab",1),b:gp("lab",2),keyword(e){if(e!==void 0)return new nA(e);return gx[this.model].keyword(this.color)},hex(e){if(e!==void 0)return new nA(e);return VF.to.hex(...this.rgb().round().color)},hexa(e){if(e!==void 0)return new nA(e);let t=this.rgb().round().color,n=Math.round(this.valpha*255).toString(16).toUpperCase();if(n.length===1)n="0"+n;return VF.to.hex(...t)+n},rgbNumber(){let e=this.rgb().color;return(e[0]&255)<<16|(e[1]&255)<<8|e[2]&255},luminosity(){let e=this.rgb().color,t=[];for(let[n,o]of e.entries()){let r=o/255;t[n]=r<=0.04045?r/12.92:((r+0.055)/1.055)**2.4}return 0.2126*t[0]+0.7152*t[1]+0.0722*t[2]},contrast(e){let t=this.luminosity(),n=e.luminosity();if(t>n)return(t+0.05)/(n+0.05);return(n+0.05)/(t+0.05)},level(e){let t=this.contrast(e);if(t>=7)return"AAA";return t>=4.5?"AA":""},isDark(){let e=this.rgb().color;return(e[0]*2126+e[1]*7152+e[2]*722)/1e4<128},isLight(){return!this.isDark()},negate(){let e=this.rgb();for(let t=0;t<3;t++)e.color[t]=255-e.color[t];return e},lighten(e){let t=this.hsl();return t.color[2]+=t.color[2]*e,t},darken(e){let t=this.hsl();return t.color[2]-=t.color[2]*e,t},saturate(e){let t=this.hsl();return t.color[1]+=t.color[1]*e,t},desaturate(e){let t=this.hsl();return t.color[1]-=t.color[1]*e,t},whiten(e){let t=this.hwb();return t.color[1]+=t.color[1]*e,t},blacken(e){let t=this.hwb();return t.color[2]+=t.color[2]*e,t},grayscale(){let e=this.rgb().color,t=e[0]*0.3+e[1]*0.59+e[2]*0.11;return nA.rgb(t,t,t)},fade(e){return this.alpha(this.valpha-this.valpha*e)},opaquer(e){return this.alpha(this.valpha+this.valpha*e)},rotate(e){let t=this.hsl(),n=t.color[0];return n=(n+e)%360,n=n<0?360+n:n,t.color[0]=n,t},mix(e,t){if(!e||!e.rgb)throw Error('Argument to "mix" was not a Color instance, but rather an instance of '+typeof e);let n=e.rgb(),o=this.rgb(),r=t===void 0?0.5:t,i=2*r-1,s=n.alpha()-o.alpha(),a=((i*s===-1?i:(i+s)/(1+i*s))+1)/2,c=1-a;return nA.rgb(a*n.red()+c*o.red(),a*n.green()+c*o.green(),a*n.blue()+c*o.blue(),n.alpha()*r+o.alpha()*(1-r))}};for(let e of Object.keys(gx)){if(W3t.includes(e))continue;let{channels:t}=gx[e];nA.prototype[e]=function(...n){if(this.model===e)return new nA(this);if(n.length>0)return new nA(n,e);return new nA([...uxo(gx[this.model][e].raw(this.color)),this.valpha],e)},nA[e]=function(...n){let o=n[0];if(typeof o==="number")o=dRe(n,t);return new nA(o,e)}}gre=nA});var IAe="T1RUTwAJAIAAAwAQQ0ZGIFhQSpcAAAcwAABJ3U9TLzJqmmVhAAABAAAAAGBjbWFwFN0WswAABEwAAALEaGVhZC1P1HwAAACcAAAANmhoZWEDrgI1AAAA1AAAACRobXR44xAAAAAAURAAAAFQbWF4cABUUAAAAAD4AAAABm5hbWUZQ94BAAABYAAAAutwb3N0AAMAAAAABxAAAAAgAAEAAAABAADb+Z65Xw889QADA+gAAAAA5e9IsgAAAADl70iy/9P/PwKHAvkAAAADAAIAAAAAAAAAAQAAA6z/LAAAArQAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAFQAAFAAAFQAAAADArQB9AAFAAACigK7AAAAjAKKArsAAAHfADEBAgAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAABYWFhYAEAAIQB6A6z/LAAAAvkAwQAAAAEAAAAAAiwC1wAAAAAAAAAAACIBngABAAAAAAAAAAEAWQABAAAAAAABABEAAAABAAAAAAACAAcAMwABAAAAAAADABsA/AABAAAAAAAEABkASAABAAAAAAAFAAsA2wABAAAAAAAGABgAkwABAAAAAAAHAAEAWQABAAAAAAAIAAEAWQABAAAAAAAJAAEAWQABAAAAAAAKAAEAWQABAAAAAAALAAEAWQABAAAAAAAMAAEAWQABAAAAAAANAAEAWQABAAAAAAAOAAEAWQABAAAAAAAQABEAAAABAAAAAAARAAcAMwADAAEECQAAAAIAgwADAAEECQABACIAEQADAAEECQACAA4AOgADAAEECQADADYBFwADAAEECQAEADIAYQADAAEECQAFABYA5gADAAEECQAGADAAqwADAAEECQAHAAIAgwADAAEECQAIAAIAgwADAAEECQAJAAIAgwADAAEECQAKAAIAgwADAAEECQALAAIAgwADAAEECQAMAAIAgwADAAEECQANAAIAgwADAAEECQAOAAIAgwADAAEECQAQACIAEQADAAEECQARAA4AOlRzY2lyY3VpdEFscGhhYmV0AFQAcwBjAGkAcgBjAHUAaQB0AEEAbABwAGgAYQBiAGUAdFJlZ3VsYXIAUgBlAGcAdQBsAGEAclRzY2lyY3VpdEFscGhhYmV0IFJlZ3VsYXIAVABzAGMAaQByAGMAdQBpAHQAQQBsAHAAaABhAGIAZQB0ACAAUgBlAGcAdQBsAGEAclRzY2lyY3VpdEFscGhhYmV0UmVndWxhcgBUAHMAYwBpAHIAYwB1AGkAdABBAGwAcABoAGEAYgBlAHQAUgBlAGcAdQBsAGEAclZlcnNpb24gMC4xAFYAZQByAHMAaQBvAG4AIAAwAC4AMSA6VHNjaXJjdWl0QWxwaGFiZXQgUmVndWxhcgAgADoAVABzAGMAaQByAGMAdQBpAHQAQQBsAHAAaABhAGIAZQB0ACAAUgBlAGcAdQBsAGEAcgAAAAABAAMAAQAAAAwABAK4AAAAqgCAAAYAKgAAACEAIgAjACQAJwAoACkAKgArACwALQAuAC8AMAAxADIAMwA0ADUANgA3ADgAOQA8AD0APgBBAEIAQwBEAEUARgBHAEgASQBKAEsATABNAE4ATwBQAFEAUgBTAFQAVQBWAFcAWABZAFoAWwBcAF0AXgBfAGEAYgBjAGQAZQBmAGcAaABpAGoAawBsAG0AbgBvAHAAcQByAHMAdAB1AHYAdwB4AHkAev//AAAAAAAhACIAIwAkACcAKAApACoAKwAsAC0ALgAvADAAMQAyADMANAA1ADYANwA4ADkAPAA9AD4AQQBCAEMARABFAEYARwBIAEkASgBLAEwATQBOAE8AUABRAFIAUwBUAFUAVgBXAFgAWQBaAFsAXABdAF4AXwBhAGIAYwBkAGUAZgBnAGgAaQBqAGsAbABtAG4AbwBwAHEAcgBzAHQAdQB2AHcAeAB5AHr//wAA/+D/4P/g/+D/3v/e/97/3v/e/97/3v/e/97/3v/e/97/3v/e/97/3v/e/97/3v/c/9z/3P/a/9r/2v/a/9r/2v/a/9r/2v/a/9r/2v/a/9r/2v/a/9r/2v/a/9r/2v/a/9r/2v/a/9r/2v/a/9r/2v/a/9n/2f/Z/9n/2f/Z/9n/2f/Z/9n/2f/Z/9n/2f/Z/9n/2f/Z/9n/2f/Z/9n/2f/Z/9n/2QABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEABAEAAQEBGVRzY2lyY3VpdEFscGhhYmV0UmVndWxhcgABAQEo+BsA+BwC+B0D+B4Ei/tV+kD5SAUdAAABOQ8dAAAB4BGLHQAASd0SAFcBAQwlNj0+P0BBQkNERUZHSElKS0xNTk9QUVJTVFVWV1hZWltcXV5fYGFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6e3x9fn+AgYKDhIWGh4iJiouMjY6PkFZlcnNpb24gMC4xVHNjaXJjdWl0QWxwaGFiZXQgUmVndWxhclRzY2lyY3VpdEFscGhhYmV0UmVndWxhciEiIyQnKCkqKywtLi8wMTIzNDU2Nzg5PD0+QUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVpbXF1eX2FiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6AAAAAYsBjAGNAY4BjwGQAZEBkgGTAZQBlQGWAZcBmAGZAZoBmwGcAZ0BngGfAaABoQGiAaMBpAGlAaYBpwGoAakBqgGrAawBrQGuAa8BsAGxAbIBswG0AbUBtgG3AbgBuQG6AbsBvAG9Ab4BvwHAAcEBwgHDAcQBxQHGAccByAHJAcoBywHMAc0BzgHPAdAB0QHSAdMB1AHVAdYB1wHYAdkB2gHbAdwB3QBUAgABAAQAeADuAgwFUgWPBmUHOwffCGMIzwkMCUgJhQq1CzwMhg5ADwwQUBHfEt8U3hYZFqIXFxeiGEIZtBsIHCccsh0sHpIfGh9XIC8gtiEFIjwjJSRTJWUmviftKXQp2CqzK0gsfS0ILW8uPy6iLuAvQy+2L/IxEDItM0A0XjWWNlQ39zjFOTk59zp9Oro76Dy1Pd8+/EAaQJVCDELOQ49EGEVZReRGgUdR+UgO+Uj37vlBFYv8VgWIewWBfQV8ggV6iAV6jgV8lAWBmQWImwWL+FYFjpsFlZkFmpQFnI8FnIcFmoIFlX0FL/z3Fe+LBZyIBZmCBZV9BY97BYd7BYF9BX2CBXqIBSeLBXqOBX2UBYGZBYebBY+bBZWZBZmUBQ75SPdm+UEVi/uBBYh7BYF9BXyCBXqIBXqOBXyUBYGZBYibBYv3gQWOmwWVmQWalAWcjwWchwWaggWVfQX3p3sVi/uBBYh7BYF9BXyCBXqIBXqOBXyUBYGZBYibBYv3gQWOmwWVmQWalAWcjwWchwWaggWVfQUO+Uj3XvcoFYAiBYZ7BYB/BXyDBXmJBXqQBX6VBYOaBYmbBZPgBSR/BXqMBXuSBX+YBYaaBYycBZOaBZiVBZyRBfcPmgWe91QFKH8FeYwFfJIFf5gFhZoFjZwFkpkFmZYFm5EF9wyZBZ33RgWQmgWWmAWakwWdjQWchgWYgQWUfAWMewV7+zIF9zifBZr3JgWQmgWWmAWbkwWcjQWchgWZgQWTfAWNewV++xMF8JcFnIoFm4QFl34FkHwFinoFg30FfoAFeoUF+w19BXj7VQXslwWdigWahAWXfwWRewWKegWDfQV+gAV6hgX7CnwFfvscBYZ7BX9/BXyDBXqJBXqQBX2VBYOaBYmbBZf3CQX7MM0V9zifBZ/3VAX7OHcFDvlI9/T5XhWL/awFiHoFgX4FfIEFeogFeo4FfJUFgpgFh5wFi/msBY+bBZSZBZqUBZyOBZyIBZqCBZV9BfcB+2YVNd0FgpkFiJsFjpsFlZkFmpQFnI4FnIcFmoIF4DkFlX0FjnoFh3sFgX4FfYIFeYgFeo4FQ9sV+z+bBXuQBX2VBYOaBYmbBZCbBZeYBZqTBZ2MBfc+ewWchgWZgAWTfQWMegWGfAWAfgV8gwX7LqUVKjgFe4MFeogFeo8FfZUFgpkFiJwFkJsFlZgF7d4FmpMFnI0FnIcFmYEFlH0FjnsFh3sFLD4VZvsHBYN8BX2BBXqGBXqMBXuTBYCYBYabBY2bBa/3CAWTmQWZlgWckAWciQWbgwWWfwWQewVkIRWkSQWNegWHewWAfgV8gwV6iQV6jwV9lQWCmQVyzQWJmwWPmwWWmQWakwWcjQWchwWZgQWdTxXUWgWXfwWRewWKewWEfAV+fwV7hgV5iwV7kgVCvQV/lwWFmgWLnAWTmgWYlgWbkQWdigXTWhX3fFkFm4QFl38FkXwFi3oFhHwFfoAFe4UFeYwF+3y8BXuSBX+XBYWaBYycBZKaBZeWBZyRBfedUhXVWgWWfwWSewWKewWEfAV+fwV6hgV6iwV7kgVCvAV/mAWFmgWLnAWTmgWXlgWckQWcigX2PBWjOAWMewWGewV/fgV8hAV5igV6kAV+lgWDmQVz3gWKmwWQmwWXmAWakgWdjAWbhgWZgAWp+xAVW/sHBYF9BX2BBXqIBXmOBX2UBYGYBYebBY6cBbz3BwWUmQWalQWcjgWciAWaggWVfQWPewU/+y8V+w5aBXqHBXmOBX2UBYGZBYebBY6bBZWZBZmUBfcOvQWcjgWciAWaggWVfgWPewWIewWBfQX7M00V+zObBXuQBX2WBYOZBYqcBZCaBZaYBZuTBZyMBfczewWchgWYgAWTfAWNewWFewWAfwV7gwX7VqAVNb0Ff5YFg5oFi5sFkZsFl5cFm5IFnIsFnIYF4FkFmIAFknwFjHoFhXwFf38Fe4QFeYoF+wzZFWbuBYmbBY+bBZaYBZqUBZyNBZyHBZmBBZR9BbAnBY17BYd7BYB+BXyDBXmIBXqQBX2VBQ75SPfu+UEVi/uBBYh7BYF9BXyCBXqIBXqOBXyUBYGZBYibBYv3gQWOmwWVmQWalAWcjwWchwWaggWVfQUO+Uj4Ko0VsmUFlX0FjnsFh3sFgX0FfYIFeYgFeo8FfZQFYrMFio0FiYwFY7sFiowFiowFYsMFiowFiowFY8oFio4FiY0FbcoFio4FiY4Fd8oFi44Fio0FgcMFi5IFi5IFlcMFjI0Fi44Fn8oFjY4FjI4FqcoFjY0FjI4Fs8oFjIwFjIwFtMMFjIwFjIwFs7sFjYwFjI0FtLMFmZQFnI8FnYgFmYIFlX0Fj3sFiHsFgX0FZGUFZV4FZFUFZE8Fb1AFeFEFg10Fk10FnlEFp1AFsk8FslUFDvlI95tWFYqJBWJjBX2CBXqHBXmOBX2UBYGZBYebBY6bBZWZBbKxBbG4BbLBBbLHBafGBZ7FBZO5BYO5BXjFBW/GBWTHBWTBBWW4BWSxBYGZBYibBY+bBZWZBZqUBZyOBZyHBZmCBbRjBYyJBY2KBbRbBYuKBY2KBbNTBYyKBYyKBbRMBYuIBY2JBapMBYuIBY2IBZ9MBYuIBYyJBZVTBYuEBYuEBYFTBYqJBYuIBXdMBYmIBYuIBWxMBYmJBYuIBWJMBYqKBYqKBWNTBYmKBYuKBWJbBQ75SPeU+FUV+zRWBXqIBXqPBX2VBYKZBYicBY+bBZaYBZqTBfc5wgUh9yQFhJoFi5sFkZsFmJYFm5IFnIsFm4UFmIAF8fsfBfH3HwWYlgWbkQWciwWchAWXgAWRewWLewWEfAUh+yQF9zlUBZqDBZZ+BY97BYh6BYJ9BX2BBXqHBXqOBfs0wAWL+yoFiHsFgX0FfIIFeogFeo4FfJQFgZkFiJsFDvlI95T39hWL90sFjpwFlZgFmpUFnI4FnIgFmoEFlX4FjnoFi/tLBfdpiwWciAWaggWVfQWOewWIegWBfgV8ggV6hwX7aYsFi/tLBYh7BYF9BXyCBXqIBXqOBXyUBYGZBYibBYv3SwX7aYsFeo8FfJQFgZgFiJwFjpsFlZkFmpQFnI4FDvlI96puFcJVBZV9BY56BYd7BYF+BXyCBXqIBXqOBX2VBTXfBYeRBYaRBYuMBYqMBYqSBYmSBYyMBYqMBY2SBYyTBYyLBYuMBZCRBY+RBfc/9zwFmpUFnI4FnIgFmoMFlX0Fj3sFiHsFgX0FDvlI90L35RX3kosFnIgFmoIFlX0FjnsFiHsFgX0FfIIFeogF+5KLBXqOBXyUBYGZBYibBY6bBZWZBZqUBQ75SPf/7RX7D4sFeY4FfZQFgZkFiJsFjpsFlZkFmZQFnY4F9w+LBZyIBZmCBZV9BY97BYd7BYF9BX2CBQ75SKOAFfhx+WMFl5cFm5EFnYwFm4UFmIAFknwFjHoFhXwF/HH9YwV/fwV7hQV5igV7kQV+lgWEmgWKnAUO+Uj4CfkPFUOeBUN4BUZQBWMvBYH7JQWj+wwFxi0F2F0FyYsF2LkFxukFo/cMBYH3JQVj5wVq9x4VjYoFkYgFkYgFjIoFjYoF4EEFi4sFjIoFj4UFkIUFi4oFjIoFuSEFjIQFjYUFlvsyBYqGBYuGBXH7GQWIhQWJhAVH+wIFiYoFiokFhocFh4YFiYoFiooFKVEFh4kFiIkFhooFh4oFh4sFh4oFM4sFh4wFh4sFh4wFhowFiI0Fh40FKcUFiowFiYwFh5AFho8Fio0FiowFRvcCBYmSBYiRBXH3GQWLkAWKkAWW9zIFjZEFjJIFufUFjIwFi4wFkJEFj5EFjIwFjIsF39UFjYwFjIwFkY4FkY4FjYwFjYsF6aMFjowFjowFkYoFkYwFjooFjooF6XMFDvlI9/v5ZRWQjgWNjAWNjAWSiwWSjQWMigWNiwWSigWSiQWMigWNiwWRhwWQhwWMigWNigWOhQWPhQWMigWLiQWMhQWNhAWL/REFh3sFgX0FfYIFeogFeY4FfZQFgZkFiJsFi/i2BTRFBXuDBXqJBXqPBX2WBYOZBYmbBY+bBZaYBfc19xUFDvlI90rmFffoiwWdiAWZggWVfQWOewWIewWBfQV9ggV5iAX8TosFg4wFg4wFiowFiosFhY8FhI8Fi4sFiowFhpEFh5EFi4wFiowFipIFiZIFi4wFi4wFjJIFjJIFjIwFi4wFj5EFj5EF9zn3PgX3L/dKBcTlBZezBYueBYOqBXeiBV6dBUaQBWaGBVBzBWttBX9mBYN9BX6ABXqGBXmNBXyTBYCYBYaaBYycBZu6BYuMBYyNBY+QBY6RBYyMBYyNBbi2BYuLBYuLBZOQBZKQBYuLBYuLBdWoBZCNBZGMBbqSBZCKBZCMBd2FBZKJBZKKBclxBYyKBY2LBZCHBZGHBYyKBY2JBaxlBYyKBYuKBY+FBY6EBYuKBYyKBZdeBYuFBYyGBYptBYqGBYuGBX1ZBYiFBYmGBUwpBYmJBYqJBfsy+04FiooFiooFDvlI9wqUFYeMBVObBXySBX+YBYabBY2bBZOaBZmVBZuQBZ2KBcB8BdeABeiJBb2WBdGxBbW2BZy5BYOvBWWzBUStBTSiBT2UBYiMBYiLBYWOBYaMBYmNBYiNBYePBYeOBYmOBYmNBYmQBYmQBYuOBYqOBYuQBYuRBYyNBYuOBY2QBY2QBY2NBY2OBY+PBY+PBY6MBY2NBZCNBZGNBY6LBY6MBduVBeKdBdGpBauoBZGqBXWtBV2uBUagBTyPBUp2BVZxBWhxBXyEBXmKBXuQBX2WBYOZBYqcBZCaBZeYBbCnBY+MBY6OBceoBY6MBY6NBdikBZOMBZSMBemGBZCKBZGKBd1yBZKIBZOHBcVeBZCGBZCGBa9UBY2EBY6FBYuKBYyKBYqEBYuDBYBQBYmHBYqHBYmIBYmHBYiIBYiHBVxfBYWGBYSHBUduBdFqBZGGBZKHBcBUBYyIBY6JBY2GBY6HBYuIBY2HBZZQBYuJBYyIBYqFBYuGBYqIBYuJBXNKBYuLBYuLBYeEBYaEBYuLBYuLBVZUBYWHBYaHBTlfBYWJBYWIBU19BYWLBYWKBSeNBYiMBYiLBTmWBQ75SPgF98IVi+oFj5sFlJgFmpUFnI4FnIgFmoEFlX4FjnsFiywF6YsFnIcFmoIFlX0FjnsFiHsFgX0FfIIFeogFLYsFi/s9BYh7BYF9BXyCBXqIBXqOBXyUBYKZBYebBYv3PQX71IsFhIwFhYwFiYwFiYsFhY8FhY0Fio0FiYwFh5AFh5AFi40FiY0FipEFiZEFi40Fi40FjJEFjJEFjI0Fi40Fj5EFjpAF+Ab4PgWYlgWcjwWcigWbgwWWfgWQfAWKegWCfQX7yfv5BQ75SKn5QRWOmwWVmQWalAWcjwX4WIsFnIcFmoIFlX0FjnsFiHsFgX0FfIIFeogF/CuLBYv7dwX3HakFk4sFk4wF9x57BZOIBZOJBcJuBZGGBZGHBbFiBYyJBYyKBY6FBY+FBYuKBYyJBaj7BAWLigWLigWLhAWMhAWKigWLiQV9UQWLiwWLigWHhAWIhAWLiwWKigVnXgWFhQWFhgVFYQWFiQWFiAU5dQWGigWGigU+hwWFjAWGiwVKlwWGjQWGjAVWogWGjgWFjwVUugWAmAWHmwWOmwWUmQWZlQWcjwWciQWaggW9YQW0eQXCgQXNjgXSngXFrgWlqwWUswVz5wVxpwVjoAX7DZkF+01iBYaLBYaKBYeMBYiKBYaNBYaMBYiNBYeMBYePBYeNBYmOBYiNBYmQBYiPBYuOBYmPBYuPBYqQBQ75SPch96QVi4sFi4sFbW4FioMFnlkFm24FtWEFtHIFzoEF2o8FxaMFsqoFnrMFjaoFf7MFeKwFcqQFZ5sFUJcFU44FU4MFU28F+yxcFYqPBYyRBYy5BYuLBYuLBY7cBY2RBYyRBafaBYyNBYuNBbTfBZCSBZCRBcC7BY6NBY2NBdC4BZGOBZCOBdykBYyLBYuLBeKlBZ2NBZuGBZmBBZN8BY17BYZ7BYB+BXyDBTRyBUFzBU9kBV5jBWdABXJEBYp7BZGOBZCPBdGtBZKNBZKOBc6UBZCLBY+LBcuJBY+KBY+LBc58BZCKBZCJBbt2BZKGBZKHBa5oBY6GBY+GBaNhBYyHBY2HBZpZBYyEBYyFBYlbBYuLBYuLBYmDBYmDBYuLBYuLBW9UBYuKBYqKBYaGBYeFBYqKBYqLBVhiBYaIBYaIBUNtBYOJBYOJBS+GBYeMBYaLBTmXBYqLBYqLBYSOBYOOBYuLBYqLBVasBYiPBYaNBVq8BYeQBYeQBXaxBYqOBYqOBXXHBYqSBYmTBQ75SPfP90gVg/saBYd7BYF+BXyCBXmJBXqPBX2VBYKZBYmbBZL3HAWMjQWLjQWc9wcFi4wFjI0Fms0FjI0Fi4wFnsYFjIwFi40FoL4FjIwFi40ForcFjIwFi40Fo7EFjIwFjI0FoqoFjI0FjIwFoqYFjYwF+96LBXmOBX2UBYGZBYibBY6bBZWZBZmUBZ2PBfhfiwWQigWQigWOigWPigWPiAWQiQWOiQWNiQWOhwWPhwWMiAWNiAWMhgWNhgWLiAWMiAWJhgWLhgWKiAWKiAWIhwWJhgWIiQWJiAWHiAWHiAVqeQV9gQVkaAV3dAV2bgV1aAV2YgV4WwV5UwV8TAUO+Uj3pvf2FUR0BUpaBXBZBYleBaZdBcVnBdlzBciJBeCmBb6wBaLEBYLEBWK1BTi2BVKfBdH3sxU4kQVLgAVXcwVrXQWVaQW4ZQW/bAXDeAWwlgXetQWdpgWMwwV1rwVr9wEVi4sFk4gFk4kFi4sFjIsF0GgFjokFj4kFjocFj4gFjYgFjYgFrVIFjIkFjYgFjIYFjYYFiogFjIgFiTwFi4gFi4kFiYUFioYFiYkFiogFbVwFiYkFiYgFh4gFh4cFiIoFiYkFUm4F0mYFkIcFkYcFw1IFjYcFj4gFjIcFjYgFjIYFjIcFmDoFi4kFi4kFioUFi4UFiokFiokFbDwFiYcFiogFh4cFiYgFiIgFiIkFR1sFhYgFhYcFJ2sFg4oFg4oFP40FhY0FhIsFMqcFho4FhY0FQ7gFio0FiYwFho8Fh5AFio0FiYwFZc0Fio4Fio4FipAFiZAFjI4Fio4Fjs0Fi4wFi4sFjZMFjZIFi4wFi4sFr80Fi4wFjIwFkJAFkJEFi4wFjIsF2sYFkY4Fko8FmI8FaZ8FiI4Fh40FUrwFiY0FiI4FiY8FiI8Fio4FiY4FeMsFi40Fi4wFipIFi5IFi4wFi4wFjpIFjZIFjIsFjI0Fu9IFjo4FjY4Fj44Fj44Fjo0Fjo0F0KsFkYwFkY0F15gFkIsFkYwF7YQFDvlI+Fr4mBWVnQV8xwVwqwVfoAVIkwVHgwVTdAVnagV+XwWYYAWvaQXDdAXMhAXMmgW8qgVf/BoVi4oFZ0IFgX4FfIIFeYgFeo8FfZUFgpkFiJsFj5sFr9QFtuoFwPcXBYuLBYuMBZKcBT55BYOKBYKLBTuUBYWNBYWMBUWoBYSPBYSQBVm6BYqNBYmMBYiQBYeQBYuOBYqNBXfNBYqOBYqOBYyQBYqQBYyOBYyPBZ/NBYyNBYuNBY+QBY6QBY2NBYyNBb26BZKPBZKQBdGnBZGMBZGNBduVBZGKBZGMBduBBZKJBZKJBcdvBYyKBYyLBZGGBZGHBYuKBYyKBbNcBYyKBYyKBY6FBY6FBYuJBYyKBZ83BYuFBYyEBYqJBYuJBYmFBYmGBYqHBUH7SAVW+xgFi4oFiooFXysFDvlI9y/3yxX4OvtDBZqBBZR9BY57BYd7BYF9BXyCBXqJBXqOBfyY92oFhI8FhY8FiowFiowFh5EFh5EFi4wFiosFipMFiZIFi4wFi4wFjZIFjJIFjIwFi4wFj5EFj5EFjIwFjIsFkY8Fko8F+Jj3agWcjwWciAWaggWVfgWPewWIegWCfQV8ggUO+Ui2+GkV+JiLBZyIBZqCBZV9BY57BYh7BYF9BXyCBXqIBfyYiwV6jgV8lAWBmQWImwWOmwWVmQWalAWc+4gV+JiLBZyIBZqCBZV9BY57BYh7BYF9BXyCBXqIBfyYiwV6jgV8lAWBmQWImwWOmwWVmQWalAUO+Uj44/fpFYyKBY+FBY+FBYuKBYyKBYyEBY2EBYuKBYuKBYmEBYqDBYqLBYuKBYeFBYeFBYqKBYqKBYWHBYSHBfyY+2oFeogFeo0FfJQFgZkFh5sFjpsFlJkFmpUF+Dv3QwX8O/dDBXyUBYKZBYicBY+bBZWYBZqUBZyOBZyHBfiY+2oFkocFkYcFDvlI+Ev3kxWGigX7q4sFi4sFLPtyBYF9BX2CBXqIBXmOBX2UBYGYBYecBY6bBfek+REFkJIFkJIFi4sFi4sFko8FkpAFi4sFjIsFk40Fk40FjIsFi4sFk4kFlIoFi4sFi4sFkoYFkocFjIsFi4sFkIQFj4QF97r9EQWPewWIegWBfgV9gQV6iAV5jgV9lAWBmAX7IvfIFfsB94AFJvuABQ75SPe++GUV2bYFlMsFTL8F+weeBSmGBYv7VgX32vxEFYSJBYmLBYmLBfv7hwWKiwWLiwWDjAWCjQWLiwWLiwWEjwWEkAWKiwWLiwWGkgWHkQWLjAWKiwWKkwWJkgWLjAWLiwWL+QoFjJIFjZIFi4wFi4wFkJEFjpEFjIwFjIwFkY8FkY8FjYsFjIwFkowFk40F9yWTBZCKBZCLBfcZdQWOigWPigWQiQWQiQWNiQWOiQXlQQWNiAWPiQWNhwWOhwWMhwWNiAWLhgWMhwWLhwWLhwV9+wAFiokFi4gFiIYFiYYFiYkFiogFh4cFh4cFiIoFiYkFSGYF9wJmBY6JBY+KBY+IBY+JBY2IBY6IBdE3BY6GBY6FBYyJBYuKBYyEBYyEBYX7AAWLiQWLiQWJhQWJhQWKiQWKiQVsWwWIiQWKiAWHiAWHhwWIigWIiQU+ZAWJigWJigVu3BXEqAWeqAWP3QVYyQX7JLsF+1CWBYv7nAUO+Uj4ZPclFaDbBZOZBZiXBZuQBZ2KBZuEBZd/BZF7BYp7BXIwBYqIBYqHBYiHBYmHBYiIBYmIBUNLBYiJBYmJBYaJBYaIBYiLBYiJBSl1BYuLBYuLBYOLBYKLBYuLBYuLBfsEnAWJiwWKjAWEjQWEjgWKjAWKiwVRsQWFkQWFkQVU3QWLiwWLiwWIkwWIkgWLiwWLiwVm918Fi5MFi5MFuvdeBYyMBYuNBY+RBY2RBY2MBYyNBc7XBYyMBYuLBZGQBZKQBYuLBYuLBdGsBZKNBZKOBdqVBYyLBYyLBZOKBZKLBYyKBY2LBfVqBYyLBYyLBZKHBZGHBYyLBYyKBcNZBYyLBYuKBZCFBY+FBYyKBYuLBapEBY57BYh7BYF9BXyCBXqIBXqOBXyVBYGYBXDJBWKwBTSlBU6EBVVxBVRNBWD7TAWt+04FuUgFtG8F6H0F2JwFDvlI93uVFYaKBfs1iAWLiwWKiwWDjAWDjQWKiwWLiwWEjwWEjwWLjAWKiwWHkgWGkQWLjAWLiwWJkwWJkgWMjAWKiwWT+QQFjJAFi5EFjY0Fi48Fj48FjY8FjY4FjY0FkI4Fj44Fjo0FjowFkIwFkY0F7pgFj4sFjowF14kFkYoFkIsF9xBrBYuLBYuLBZOHBZKIBYyLBYuKBeZIBYyKBYuLBZCFBZGFBYuLBYuKBb8wBY2FBY6GBaAsBYuHBYyHBY1EBYqHBYuIBYJOBYmHBYqHBXhXBYeFBYmGBUw8BYWGBYWGBTdZBYWJBYWIBfsdaAV53hX3EasF0rUFwM4Fm7UFlMAFicsFeOAFXtoFPsQF+wGnBUiMBVGDBYX8tAUO+Uj3EeUV+CGLBZyIBZqCBZV9BY57BYh7BYF9BXyCBXqIBfxOiwV6jgV8lAWCmQWHmwWL99MFi/fSBY+bBZSZBZqUBZyPBfhOiwWchwWaggWVfQWOewWIewWBfQV8ggV6iAX8IYsFi/t+BfeciwWdiAWZggWVfQWOewWIegWBfgV9ggV5hwX7nIsFDvlI9xf32hWL+6oFiHsFgX0FfYIFeYgFeo4FfZQFgZkFh5sFi/kRBY+bBZWZBZmUBZyPBZ2HBYyKBfgviwWciAWZggWVfQWPewWHewWBfQV9ggV6iAX8FYsFi/t4BffQiwWdiAWZggWVfQWOewWIewWBfQV9ggV5hwUO+Uj4fve0Ffs1iwV6jwV9lAWBmQWImwWOmwWVmQWZlAWdjgX3bIsFj4oFkIsFj4kFj4oFj4kFj4kFjogFj4kFjYgFjocFjYgFjYcFjIcFjYcFi4cFjIcFiocFi4cFXvtaBYqJBYuIBYiGBYiGBYmJBYqJBUtGBYmKBYqJBYWIBYaHBYmKBYmKBTpwBYqLBYuKBYOKBYOKBYqLBYqLBTWSBYSNBYSNBTmuBYWOBYaOBUfCBYaQBYaQBV/QBYuMBYqMBYmRBYiSBYuMBYuMBXf3UgWLkQWLkgWx90IFjIwFi40FjpEFjpEFjIwFjI0FzdsFjIwFi4wFkZAFkY8FjIwFjIsF37QFi4sFi4sFk40Fk44Fi4sFi4sF9xeVBZKKBZGLBfcQcQWbhQWXfwWRfAWLegWEfAV+gAV7hQV5iwX7CKMF+weCBUhrBVZJBWj7MwWe+0IFrlUFxFwF0W4Fz4UFx6AFvL8FDvlI+H74OhWL95sFj5sFlJkFmpQFnI8FnIcFmoIFlX0FjnsFi/0RBYh7BYF9BXyCBXqIBXqOBXyUBYKZBYebBYv3tgX8DosFi/u2BYd7BYJ9BXyCBXqIBXqOBXyUBYGZBYibBYv34AWL98UFjpsFlZkFmpQFnI8FnIcFmoIFlH0Fj3sFi/ubBQ75SPfu+UEVi/0RBYh7BYF9BXyCBXqIBXqOBXyUBYGZBYibBYv5EQWOmwWVmQWalAWcjwWchwWaggWVfQUO+Ui/9z4Vio4Fia8FjpsFlJkFmZUFnY4FnIkFmoIFlX4Fj3sFjGsFkXIFlXYFmXkFnX0FunoFzoQFu5EFwp8FoJkFnJ0Fl6EFk70FivhxBY6bBZWZBZqUBZyPBZyHBZqCBZR+BY96BYz8dAWKiAWLiAWCTgWJhQWJhAV5awWHhgWIhwVycQWHiAWIiAVtdwWGiQWGiAVKcwWGigWFigVRhAWGiwWGiwU8kwWFjAWFjAVRoQWFjwWFjQVvoQWHjwWHjgV2pQWJkAWIjwV+qAWKkAWJjwWEqwUO+Uj3Uff3FfsBOQWL+3UFiHsFgX0FfYIFeYgFeo4FfZQFgZkFh5sFi/kRBY+bBZWZBZmUBZyPBZ2HBZmCBZV9BY57BYv7xAX4Hve7BZuSBZyNBZyGBZiABZR8BYx7BYZ7BX9/Bfui+14F9+b70AWVfQWPewWHewWCfQV8ggV6iAV6jgV8lAUO+Uj3DOUV+CuLBZyIBZmCBZV9BY97BYd7BYF9BX2CBXqIBfxYiwV6jgV9lAWBmQWHmwWL+REFj5sFlZkFmZQFnI8FnYcFmYIFlX0FjnsFDvlI+KH5WxWOjwWNjQWNjQWRjQWPjgWOjAWOjAWRjAWRjAWOigWOiwWQiQWRigWNigWOigWQhwWPiAWNiQWNiQWOhgWOhgWMiQWMiAWLhgWNhQWL/REFh3sFgX0FfYIFeogFeY4FfZQFgZkFiJsFi/h1BftD+6wFiYkFiokFhocFh4cFiYkFiYoFhYkFhYgFiYsFiIoFhYwFhYoFiIwFiYsFhY4FhY0FiYwFiY0Fh48Fho8Fio0FiY0F+0P3rAWL/HUFiHsFgX0FfYIFeYgFeo4FfZQFgZkFh5sFi/kRBY2RBYuQBYyOBYyNBY6QBY6QBY2NBY2NBY+OBZCPBY6MBY2MBZGMBZCNBY6LBY6MBZGKBZGKBY6KBY6KBY+IBZGJBY2JBY2JBY6HBY+HBfdw+/UF93D39QUO+Uj4e/dPFYT4hgWOmwWVmQWZlAWcjwWdiAWZggWVfQWPewWU/REFioYFi4cFiocFiocFiYgFiYcFiIgFiIcFiIkFiIgFh4kFh4kFh4oFh4oFhosFh4oFhosFh4sFh40Fh4wFh40Fh4wFiI4Fh44FiI4FiI4F/BT4oQWL/IkFh3sFgn0FfIIFeogFeo4FfJQFgZkFiJsFi/kRBYyPBYuPBYyPBYyPBY6PBYyOBY6OBY6PBY6NBY6OBZCNBY+NBY+MBY6NBZCLBZCMBY+KBY+LBY+JBZCKBY+JBY6KBY+IBY+IBY2IBY6IBQ75SPgblBWFiAWJiwWJiwUzgAWKiwWKigWEjAWDjAWKiwWKiwUypQWJjAWIjAWGjgWGjgWJjQWJjAU62gWJjgWIjgWJjwWIjwWLjwWJjgVP96AFi40Fi4wFi5IFi5IFjIwFi40FxPddBY2PBYyPBY6OBY2PBY6NBY6PBdHEBYyMBYyMBZKOBZGOBY2LBYyMBfcOqQWPiwWPjAWQigWPjAWPiQWPiwX3B2cFjIoFjYsFkYcFkYgFjIoFjYkFzkoFjYgFjYkFjocFjYYFjIgFjIgFxfuJBYuDBYuDBW/7LgWIhAWJhQVYMgWKiQWLigWGhgWGhgWKigWKigUwTgWJigWKigUg0BXOkwXUvAW11gWl9x8FVvd1BVm8BTCoBShzBVdgBVj7RgXD+4sFy00FDvlI93j3xxWJigX7AooFi/uVBYd7BYF9BX2CBXqIBXmOBX2UBYGZBYibBYv5BQWMkQWMkgWMjAWLjQWPkQWOkAWNjAWMjQWQjwWRjwWNiwWMjAWSjQWRjAX3HZcFjosFj4sF9w6EBY+KBZCLBdp2BY+KBY+KBa96BZCIBZCIBcRbBYuKBYuLBZCFBZCEBYuLBYyLBaRXBY2EBY2EBZA/BYuJBYuJBYqFBYqFBYqJBYuJBXRcBYqJBYqJBYeHBYeFBYmKBYqKBWhxBYWIBYWIBVN2BYeKBYeJBTp8BYiLBYmLBfsCggWF4BX1kwXWmQW5nAWgmwWZpwWGxAV6sAVesQVxlwVEnQX7BpIFL4MFi/uJBQ75SPiTtRXQOQWTfAWNewWFewWAfwV7gwV6igV6kAV+lQVRzwVUYAWIigWJiQWGiQWGiAWHiwWIigU1fgWJjAWJigWEjAWFiwWJjAWIiwU0qQWJjAWIjAWGjgWGjgWJjgWJjAU75AWKjgWJjQWJkAWIkAWLjgWKjQVQ98MFi4sFi4sFi5MFi5MFi4sFi4wFw/d2BY2OBYyPBY2PBY6PBY2OBY2OBdDLBY2MBYyNBZGOBZGOBY2MBY2MBfcLrAWRjAWRjAWNigWOjAWRiQWRigX3BGMFjYoFjooFj4cFkYgFjIkFjYoFzUEFjIkFjYkFjYYFjoYFjIgFjIkFw/uoBYuEBYuEBW/7QgWJhQWJhQX7K0AVMfUFg5oFipsFkJsFlpcFm5MFnIwFnIYFmIEF0zcFmqkFpfc1BVb3lgVZxAU0qgUucQVXWgVY+2IFwvuvBctDBcx2BcmUBQ75SPfz+EoV3JcFrpgFoJsFlqIFjLMFfbkFgZYFd5gFcZUFQZsF+xSQBfsofgWL+10F90g8FftIhQWL+7cFh3oFgn4FfIEFeogFeo4FfJUFgZgFiJwFi/j8BYyRBYyRBYyNBYuNBY+QBY6RBY2MBYyNBZGOBZCPBY2MBY2MBZGMBZKNBfdUmwWOiwWOjAX3G4UFj4oFj4sF3HoFj4kFj4sFrX0Fj4kFj4kFp3kFj4cFkIgFoHQFi4oFjIsFjoQFj4UFi4oFjIoFnU0FjIUFjIUFiVQFi4sFiYMFiYMFi4sFeWQFiooFi4oFhoUFhoUFiosFi4oFaXAFhIgFhYcFXXoFhooFhokFNX8F94H7rQWTfQWNegWGewV/fwV8gwV5igV6kAV+lgX7nPfLBYOaBQ75SOXBFYaOBYqNBYiNBYmQBYeQBVr3AQWHnAWOmwWVmQWZlAWcjgWdiAWZggWVfgW3KgXNaQX3IIcF7bgFq/AFdsUFS68F+4ezBYiNBYiLBYaNBYaNBYmOBYiMBUu+BYiPBYiOBYmOBYiOBYqQBYmOBXrHBYuPBYqOBYuQBYuPBYyPBYyPBbT3DAWOkAWNkAWNjQWMjQWQjwWPjwXvzAWRjgWQjgWOiwWNjAWRiwWRjAX3R4IFjYoFjIwFkogFkooFjIoFjYoFkIcFkYcFjIoFjIoF1zAFknwFjXoFhXwFgH4Fe4QFeYoFe5AFfpYFTNYF+yOTBUBaBWssBZVoBbZoBfeDYwWTiQWTiAXfWgWQhwWQhwWNiQWMigWOhQWOhgWrNgWLhgWNhwWLhwWLiAWKhgWKhgVi+xgFi4oFiooFh4UFiIQFiosFiooFhYYFhYcFiosFiooF+xJRBYmLBYqKBYSKBYSJBYmLBYmLBfs2jwWJjAWJiwWFjQWEjAWJjAWJjAUzuQUO+Uj3yflsFfeiiwWchwWaggWVfQWOewWIewWBfQV8ggV6iAX7dYsFi/znBYh7BYF9BX2CBXmIBXqOBXyUBYKZBYebBYv45wX7hYsFeo4FfJQFgZkFiJsFjpsFlZkFmpQFnI8FDvlI+HT3hxWQ+E4Fj5sFlZkFmZQFnY4FnIcFmYIFlX0FjnsFhvxQBYqIBYyJBYFHBYqHBYqGBXdYBYmIBYmHBX53BYiHBYiIBW1sBYWHBYaHBVhxBYSJBYSJBU2BBYWLBYSLBTOUBYaNBYWMBUWlBYWPBYWOBVyvBYeQBYWQBWjCBYiRBYiRBXnSBYqPBYqOBYTsBYuNBYuMBYr39wWOmwWVmQWalAWcjwWchwWaggWVfgWOegWM+/UFki8Fm00Fp2EFr28FxXYF14IFu5MFsJ4FoqIFk5cFnLYFDvlI99H3NRX3a/ivBZSZBZqVBZyPBZyIBZqCBZV+BY97BYh6BfuS/REFi4sFi4oFhoUFh4QFi4sFiooFhIcFhYYFiosFi4sFg4kFg4oFiosFi4sFg4wFgowFi4wFiosFhI8FhI8Fi4sFi4wFhpEFhpEFi4wFi4sF+7j5EgWHmwWOmwWVmQWZlAWcjwWciAWaggWVfQUO+Uj4dvdYFdf4gwWQmwWXlwWbkgWcjAWchgWYgAWTfAWMegUq/REFiYcFioYFiYgFiocFiIgFiIcFiIkFiIgFh4kFh4kFh4oFh4kFh4sFhooFh4sFh4sFho0Fh4sFh40Fh40FiI4Fh40FiI4FiI4FiY8FiI4F+0b3/wX7Ofv2BYiHBYiGBYmJBYmJBYaIBYeHBYiKBYiKBYaKBYWJBYiLBYiLBYWMBYaLBYiNBYiLBYaOBYaOBYmNBYiNBYiPBYiPBYqOBYmOBYqQBYmQBTv5CQWNnAWTmQWYlgWckAWcigWbhAWWfgWRewXH/G8F9x/3vgWPkAWPkQWMjAWMjAWRjwWRjwWNiwWMjAWSjAWSjQWNiwWMiwWSiQWTigWMiwWMigWRhwWSiAWMigWMigWPhQWPhQUO+Uj3/Pf/FfeZ+7QFlH0FjXsFhnsFgH4FfIMFeYkFeo8FfpYF+5D3qQX7kPupBX6ABXqHBXmNBXyTBYCYBYabBY2bBZSZBfeZ97QF+5/3uwWCmQWJnAWQmwWWlwWalAWdjAWchwWYgQX3lvuxBfeW97EFmZUFm48FnYoFmoIFln8FkHsFiXoFgn0FDvlI9+j4EhWV++EFiHsFgn0FfYEFeogFeY0FfJQFgZkFh5sFgffjBfud96cFgpkFiJsFj5sFlpkFmpMFnI4FnIcFmYEF94n7kQX3k/eQBZqVBZyPBZyIBZqCBZV+BY96BYh7BYJ9BQ75SPci5RX4KosFnYgFmYIFlX0FjnsFiHsFgX0FfYIFeYgF/IKLBYWMBYaLBYiMBYeMBYeOBYaNBYmNBYiNBYiPBYePBYqOBYmOBYqQBYmPBYuPBYuOBYyQBYuQBYyOBYyOBY6PBY2QBfhP+M4F/CqLBXmOBX2UBYGZBYibBY6bBZWZBZmUBZ2PBfiCiwWRigWQigWOigWPigWPiQWQiAWNiQWOiQWOhwWPhwWMiAWNiAWMhwWNhgWLiAWLhwWKhgWLhgWKiAWKiAWIhwWJhgUO+Uj3h3QV9zaLBZyIBZmCBZV9BY97BYd7BYF9BX2CBXqHBftjiwV5jwV9lAWBmQWImwWL+Z8FjpsFlZkFmZQFnY4F92OLBZyIBZmCBZV9BY97BYd7BYF9BX2CBXqIBfs2iwUO+Ujw+VgV+HH9YwWRfAWKegWEfAV+gAV7hQV5jAV7kQV/lwX8cfljBYWaBYycBZKaBZiWBZuRBZ2KBZuFBQ75SPhWShWHewWBfQV9ggV6hwX7Y4sFeY8FfZQFgZkFiJsFjpsFlZkFmZQFnY4F9zaLBYv5SwX7NosFeY4FfZQFgZkFiJsFjpsFlZkFmZQFnY4F92OLBZyIBZmCBZV9BY97BQ75SPeo+WQVko8FjIsFjIwFkowFk40FjIoFjIwFk4kFkooFjIoFjIsFkocFkYcF9577ggWVfgWPewWIegWBfQV9ggV6hwV6jgV8lAX7f/dmBft/+2YFfIIFeogFeo8FfZQFgZkFiJwFj5sFlZgF9573ggUO+UiL+wEV+O6LBZyIBZqCBZV9BY57BYh7BYF9BXyCBXqIBfzuiwV6jgV8lAWBmQWImwWOmwWVmQWalAUO+Uj4POoVxcIFi/eQBVLBBVCnBS+LBVBvBUxQBWsvBYtQBaswBcpPBcdvBeaLBfcIZhWHiAWFhwVAZwWKigWJigWEigWFiQWJjAWJigX7BYsFiYwFiYoFhI0FhYwFiYwFiYwFQK8FhY8FhY8FP9MFiowFiowFiJEFh5EFiowFiowFZvYFipIFipIFi9IFjJIFjJEFsPcABYyNBYyMBY+RBY6RBYyMBYyMBdfTBZGPBZGPBdeuBYyMBY2MBZKMBZKNBYyKBY2MBfcFiwWMigWNjAWSiQWSigWMigWNigXWaAWQhwWQiAWLjwWPnAWUmAWalQWcjgWciAWagQWVfgWOegWL/IoFiHsFgX4FfIEFeogFeo4FfJUFgpgFh5sFDvlI9xOvFYaOBYuKBYd6BYF+BX2CBXqHBXmPBX2UBYGYBYicBYv5OAWOmwWVmQWZlAWdjgWciAWZggWVfQWPewWL+3YFkI4FkY8F1asFjIsFjIsFko0Fk40FjIoFjIwF9wSLBYyLBYuLBZOJBZOJBYyLBYuLBddrBZCHBZKIBdZKBYyKBY2KBY6FBY+GBYyJBYyKBbApBYyEBYyEBYtLBYqEBYqDBWYrBYqKBYqJBYeGBYiFBYmKBYqJBUBLBYWIBYWHBUBqBYqLBYqLBYSJBYOJBYqLBYqLBfsEiwWKjAWKigWDjQWEjQWKiwWKiwVBrAWA9w0VwlwFxnEF54sFx6UFycAFqdoFi70FbdsFTcAFT6QFL4sFUHIFVFwFDvlI+DLqFczNBZqVBZyPBZyIBZqDBZV9BY97BYl7BYF9BUVDBYWHBYWHBUZmBYiLBYmJBYWKBYWJBYiMBYmKBSGLBYmMBYiKBYWNBYWMBYmNBYmLBUSwBYWPBYWPBUXTBYqMBYqMBYeRBYeRBYuMBYqMBWn2BYqRBYqSBYvSBYyRBYySBa33AAWMjAWLjAWPkQWPkQWMjAWMjAXR0wWRjwWRjwXSrwWNiwWNjQWRjAWSjQWNigWNjAX1iwWNigWNjAWSiQWRigWNiQWNiwXRZwWRhwWRhwXRQwWVfQWNewWHewWBfQV8gwV6iAV6jwV8lQVKzQVWpgU3iwVVcAVRUAVtLgWLUAWoLwXGUAXCbwXdiwUO+Uj4PfUVwroFi/dxBVS6BVCkBS+LBU9yBU1WBW07BYtZBak8BclWBcdxBeeLBfcGYhWGiAWFhwVBagWKiwWKiwWEiQWDiQWKjAWKigX7BIsFiosFiosFhI0Fg40FiosFiosFQKwFhY8Fho4FP8sFio0FiYwFiJEFh5AFio0FiowFZusFipMFipIFi8sFjJIFjJIFsO0FjIwFjI0Fj5AFjpEFjYwFjIwF18wFkY4FkI8F16sFi4sFjIsFk40Fk40Fi4sFjIsF9wSLBYyKBYyMBZOJBZKJBYyLBYyLBdVrBZGHBZCIBYv3dgWPmwWVmQWZlAWcjgWdiAWZggWVfQWOewWL/TgFiHoFgX4FfYIFeYcFeo8FfZQFgZgFh5wFDvlI9x74IBV8YQX4GIsFg5QFZs0FbaYFS6cFJosFSm8F93r7/BXXzgWZlAWdjgWchwWZggWVfQWNegWIewWAfgU6QwWGiAWFhwU8ZgWJiwWKigWEigWEiQWJiwWKiwX7DYsFiosFiosFg40FhIwFiowFiosFOrAFhY8FhY4FO9MFiYwFiowFh5EFh5AFi40Fio0FY/YFipIFipIFi9IFjJIFjJIFs/cABYyNBYuNBY+QBY+QBYyNBY2MBdvTBZKOBZCPBdyvBYyLBYyMBZOMBZKNBYyLBYyLBfcNiwWMiwWMiwWTiQWSigWMigWMiwXbZwWQhwWRiAW1ZwWPhQWQhQWyRAWQewWJegWDfQV/ggWUhQWVfgWOegWIewWBfQV9ggV5iAX8SYsFi3UFrDAFz08FzG4F8IsFDvlI97n4VhWL/CQFiHsFgX0FfIIFeogFeo4FfJQFgZkFiJsFi/gkBfsGiwV6jgV8lQWCmAWHmwWPnAWUmAWalQWcjgX3BosFi8AFi40Fi40FjZEFjJEFjY0Fi4wFwOoFkZEFkJEFi4sFi4wFk44Fko8F9asFkowFkowF9YsFnIgFmoIFlX0FjnsFiHsFgX0FfIIFeogFKIsFOXIFZEUFi2EF9zuLBZyIBZqBBZV+BY56BYh7BYF+BXyBBXqIBQ75SPg99yMVwroFi/dxBVS7BVCkBS+LBU9yBU1WBW06BYtaBak7BclWBcdxBeeLBfcGYhWGiAWFhwVBagWKiwWKigWEigWDiQWKiwWKiwX7BIsFiosFiosFg40FhIwFiowFiosFQKwFhY8FhY4FQMwFiowFiYwFiJEFh5AFio0FiowFZuwFipIFipIFi8wFjJIFjJIFsOwFjI0FjI0Fj5AFjpAFjY0FjIwF1swFko4FkI8F16sFi4sFjIwFk4wFk40Fi4sFjIsF9wSLBYyLBYyLBZOJBZKKBYyKBYyLBdVrBZGHBZCIBYuLBY+cBZWYBZmVBZyOBZ2IBZmBBZV+BY56BYv8mAWKhAWKhAVmKgWKigWKiQWHhgWIhQWJigWKiQVlawWFhwWFhwVBbAWKigWKiwWEiQWDigWKiwWKiwX7BIsFiosFi4sFg4wFg40FiosFi4sFP6sFho8FhI8FQMsFio0FiYwFiJAFh5AFio0Fio0FZuwFiZwFj5sFlZgFm5QFnI0FnIcFmYEFlH0FrDQFyVYFx3EF54sFxqUFpKAFqdoFDvlI+L34CRWNhAWL+9AFiHsFgX0FfIIFeogFeo4FfJQFgZkFiJsFi/fIBW7TBVqfBSyLBU1yBS49BYv7vQWIewWBfQV8ggV6iAV6jgV8lAWBmQWImwWL+SwFjpsFlZkFmpQFnI4FnIgFmoIFlX0FjnsFi/uSBbKsBZGOBZGPBdeqBYyLBYuMBZOMBZONBYyLBYuLBfcGiwWMiwWLiwWTiQWTigWMigWLiwXXbAWLiwWLiwWShgWShwWLigWMiwWPhAWQhQWLigWLiwWxLAUO+Uj3mfmIFduLBZyIBZqCBZV9BY57BYh7BYF9BXyCBXqIBTuLBXqOBXyUBYGZBYibBY6bBZWZBZqUBfH7mRWL/E4FiHsFgX0FfIIFeogFeo4FfJQFgZkFiJsFi/hOBY6cBZWYBZqVBZyOBZyIBZqBBZV+BQ75SPgV+YgVyYsFnIgFmoIFlX0FjnsFiHsFgX0FfIIFeogFTYsFeo4FfJQFgpkFh5sFj5sFlJkFmpQF+wn+MhWGigWIjQWHiwUpqQV8kwWAmAWGmwWNmwWUmQWZlgWbjwWdiQXhcQXpoQWhyQWL+I4Fj5sFlJkFmpQFnI8FnIcFmoIFlX0FjnsFi/yVBYqEBYqFBWswBYiGBYmHBYmIBYmIBYeIBYeIBYiJBYiJBYaKBYaJBfsXbQWIiwWHigUO+Uj3f/eMFfsRLwWLIQWIewWBfQV8ggV6iAV6jgV8lAWCmQWHmwWL+SwFj5sFlJkFmpQFnI4FnIgFmoIFlX0FjnsFi/xXBff495sFm5IFnIwFnIYFmIEFk3wFjHoFhnwFgH4F+2v7MgX3mPtwBZV+BZB7BYh7BYJ9BX2BBXqHBXqNBXyTBQ75SPfu+WMVi/0xBYh7BYF9BXyCBXqIBXqOBXyUBYGZBYibBYv5MQWOmwWVmQWalAWcjwWchwWaggWVfQUO+Uj43/iYFZCGBYuKBYyJBYyFBY2EBYuKBYyJBYv8WwWHewWBfQV9ggV6iAV5jgV9lAWBmQWImwWL+EgFfJYFXIsFdHgFVDEFi/vmBYh7BYF9BX2CBXmIBXqOBX2UBYGZBYebBYv36gVo4wV1nAVdiwVzeAVVMQWL++YFh3sFgX0FfYIFeogFeY4FfZQFgZkFiJsFi/h9BY6cBZWYBZmVBZ2OBZyIBZmBBZV+BY2ABa2mBZGOBZGPBY2LBYyMBZKLBZKNBduLBZKJBZKLBYyKBY2LBZGHBZGIBbZoBYyJBY2KBY+GBY+GBYuJBY2JBZN1BZynBZCQBZCRBbWtBZGPBZGPBY2LBYyMBZKLBZKNBdyLBZKJBZKLBYyKBY2LBZGHBZGIBbZoBYyKBYyKBQ75SPi++B0VjIUFi/vyBYh7BYF9BXyCBXqIBXqOBXyUBYGZBYibBYv36wVt3QVaoQUtiwVPcAUsMwWL++AFiHsFgX0FfIIFeogFeo4FfJQFgZkFiJsFi/h9BY6cBZWYBZqVBZyOBZyIBZqBBZV+BY56BYtlBbCtBZKPBZCPBdiuBYyLBYyMBZKMBZONBYyLBYyLBfcGiwWMiwWNiwWSiQWSigWMigWNiwXWaAWMiwWLiwWShgWRhgWMiwWLiwWPhAWPhAWLiwWLiwWyIQUO+Uj37Ph4FTWLBVRwBU9PBWwvBYtQBaowBcdPBcNvBeCLBcKnBcfHBarmBYvGBWznBU/HBWH3AxWNjAWRiQWSigWNiQWNiwXTaAWRhgWRhwXTQwWLigWMiwWPhAWPhQWLigWMigWv+wAFjIUFjIQFi0QFioQFioUFZyAFiooFi4oFh4QFh4UFiosFi4oFQ0MFhYcFhYcFQ2YFiYsFiYkFhYoFhIkFiYwFiYoF+wCLBYmMBYmKBYSNBYWMBYmNBYmLBUOwBYWPBYWPBUPTBYuMBYqLBYeRBYeSBYuMBYqMBWf2BYqRBYqSBYvSBYySBYyRBa/3AAWMjAWLjAWPkQWPkgWMiwWLjAXT0wWSjwWQkAXTrgWNiwWNjQWSjAWRjQWNigWNjAX3AIsFDvlI9xTXFYWPBYv7dQWHewWCfQV8ggV6iAV6jgV8lAWBmQWImwWL+TMFjpwFlZgFmpUFnI4FnIgFmoEFlH4Fj3oFi4sFkY8FkI4F1asFjIsFjIwFk4wFko0FjIsFjIsF9wSLBYyLBYuLBZOJBZOKBYyKBYuLBdZsBZGHBZGHBdZLBY2KBYyJBY+GBY+GBYuJBY2JBa8rBY2EBYyDBYtLBYqEBYmEBWYsBYqJBYuJBYeGBYeFBYqKBYmKBUBLBYWHBYaIBUBqBYqLBYqKBYOKBYSJBYqLBYqLBfsEiwWKiwWKiwWDjQWEjAWKjAWKiwVBrAWA9w0VwlwFxnEF54sFx6UFyb8FqdoFi7wFbdsFTb8FT6QFL4sFUHIFVFwFDvlI+D33JRXCugWL924FVLoFUKQFL4sFT3IFTVcFbTsFi1oFqTwFyVcFx3EF54sF9wZiFYaIBYWHBUFqBYqLBYqLBYSJBYOJBYqMBYqKBfsEiwWKjAWKigWEjQWDjQWKiwWKiwVArAWGjgWFjwVAywWJjAWKjQWHkAWHkAWLjQWKjQVm6gWJkgWKkwWLywWMkgWNkgWw6wWMjQWLjQWPkAWPkQWMjAWNjAXWywWRjwWRjwXWqgWLiwWMjAWTjAWTjQWLiwWMiwX3BIsFjIsFjIsFkokFk4oFjIoFjIsF1WwFkIcFkYgFi4sFj5sFlJkFmpQFnI4FnIgFmoIFlX0FjnsFi/00BYh7BYF9BXyCBXqIBXqOBXyUBYKZBYebBQ75SPfp+MsVk40F9yaLBZyIBZmBBZV+BY96BYd7BYF+BX2BBXqIBfsdiwU4bgU5TwViNAWL+6MFiHsFgX0FfYIFeYgFeo4FfZQFgZkFh5sFi/h9BY+cBZWYBZmVBZyOBZ2IBZmBBZV+BY56BYtWBdTABZGNBZGPBeutBQ75SO6nFYSQBYuLBYuMBYeSBYeSBXLSBYmcBY+bBZaYBZuTBZyNBZyGBZmBBZN9BZ9TBbt0BfWLBeSsBbuhBYuoBVHCBfsBygX7BIsFiYsFiosFhI0FhIwFiowFiYwFQK8FhY8Fho8FiowFiYwFiJEFh5EFi4wFio0FipEFipIFi9IFjJMFjZMFi4sFi4wFkJEFj5IF1tMFjIsFjIwFkY8Fko8FjIsFi4wF764Fk4wFk40F9xGLBYyKBY2MBZKJBZKKBYyKBY2KBdZoBZmBBZN8BY17BYd7BYB+BXyDBXmJBXqPBUqqBSGLBTluBVRWBYtuBbN4BfcGiwWOigWPiwWQiQWQigWOigWPiQX3EEQFj4cFkIgF1kQFj4QFkIQFi4sFi4sFjYMFjIMFi0MFioUFioQFiooFi4kFh4UFiIYFiYoFiokFhYgFhoYFQGgFiYsFiYkFJ2cFg4oFg4kF+xGLBYmMBYmKBYWNBYSMBYmMBYqMBUCvBQ75SPdd+DEV+wyLBXqOBXyUBYGZBYibBY6bBZWZBZqUBZyOBfcMiwWL9zcFjpsFlZkFmpQFnI4FnIgFmoIFlX0FjnsFi/s3BfdDiwWciAWaggWVfQWOewWIewWBfQV8ggV6iAX7Q4sFi/uCBbNMBeF0BfOLBZyHBZqCBZV9BY57BYh7BYF9BXyCBXqIBfsCiwWFjAWFjAX7AqgFg48FhI4Fi4sFiowFhpEFhZAFVOIFio4FiY4FipAFiZAFjI4Fio4FDvlI+GX3SRWL9+AFjpsFlZkFmpQFnI4FnIgFmoIFlX0FjnsFi/x9BYh6BYF+BXyBBXqIBXqOBXyVBYGYBYicBYuyBWZpBYWHBYWHBT9oBYmKBYqKBYSKBYSJBYmMBYqKBfsGiwWJjAWKigWEjQWEjAWJjAWKjAU/rgWEkAWEkAWLiwWLiwWHkgWHkgVk9AWKkgWKkQWL9/IFjpsFlZkFmpQFnI4FnIgFmoIFlX0FjnsFi/vrBak6Bb10BeeLBcinBQ75SPfB9xcV92j4JgWWmAWakwWcjQWchwWZgQWUfQWNegWHewX7kfxyBYiHBYiGBYiJBYqJBYaIBYaIBYiKBYiKBYaKBYWKBYiLBYiLBYWMBYaMBYiMBYiMBYaOBYaOBYqNBYiNBYiQBYiPBfuQ+HIFhpsFjZwFlJkFmZUFnI8FnIkFmoMFln4FDvlI+Fj3TRX29+kFk5oFmZUFm5AFnYoFmoMFl34FkHsFiXsF+yr8cgWIhwWKhwWIiAWKhwWHiQWIhwWHiQWIiQWGiQWHiQWHiwWHigWHiwWGiwWHjAWHiwWHjQWGjQWIjQWHjQWIjwWIjQWJjwWIjgWKjwWIjwUg9+kFIPvpBYiHBYqHBYiIBYmHBYiJBYiHBYeJBYiJBYaJBYeJBYeLBYeKBYeLBYaLBYeMBYeLBYeNBYaNBYiNBYeNBYiPBYiNBYmPBYiOBYqPBYiPBfsq+HIFiZsFkJsFl5gFmpMFnYwFm4YFmYEFk3wF9wD76QX29+kFjY8FjI8Fjo4FjY8Fj44Fjo4Fjo0Fj40Fj40Fj40Fj4sFj4wFkIsFkIsFj4oFj4sFj4kFkIkFjokFjokFjogFj4gFjYcFjogFjIcFjYcFDvlI+AL3pxX3evtlBZV+BY97BYh7BYF9BX2BBXqIBXmOBX2UBft992YF+337ZgV9ggV5iAV6jgV9lQWBmQWImwWPmwWVmAX3evdlBft692UFgZgFh5sFjpwFlZgFmZUFnI4FnYgFmYMF9337ZwX3ffdnBZmTBZ2OBZyIBZmBBZV+BY56BYd7BYF+BQ75SOj7TxWDigWLiwWLiwVjiwV6jgV8lAWBmQWImwWOmwWVmQWalAWcjgWqiwXLpQXOwQXJ7gX7dfg4BYebBY2bBZSaBZiVBZyPBZ2JBZqDBZZ+BfdX/AEF91n4AQWWmAWakwWdjQWbhwWZgQWUfAWNewWGewX7gfxMBYuKBYqJBT37EQWGhQWGhgU9TAWEiAWGhwU8bAWLiwWLiwUO+Uj3UtkV98+LBZ2IBZmCBZV9BY57BYh7BYF9BX2CBXmIBfwsiwWEjAWFiwWJjQWIiwWGjgWGjgWJjQWJjAWHkAWHkAWKjQWKjQWKkQWJkAWLjgWLjQWMkQWLkQWNjQWLjQWPkAWOkQX38vguBfvPiwV5jgV9lAWBmQWImwWOmwWVmQWZlAWdjgX4LIsFkooFkYsFjYoFjooFkIgFkYgFjIkFjYoFj4YFj4YFjIkFjIkFjIUFjYYFi4gFi4kFioUFi4UFiYkFi4kFh4YFiIYFDgAAAAK0AAACtAAAArQAAAK0AAACtAAAArQAAAK0AAACtAAAArQAAAK0AAACtAAAArQAAAK0AAACtAAAArQAAAK0AAACtAAAArQAAAK0AAACtAAAArQAAAK0AAACtAAAArQAAAK0AAACtAAAArQAAAK0AAACtAAAArQAAAK0AAACtAAAArQAAAK0AAACtAAAArQAAAK0AAACtAAAArQAAAK0AAACtAAAArQAAAK0AAACtAAAArQAAAK0AAACtAAAArQAAAK0AAACtAAAArQAAAK0AAACtAAAArQAAAK0AAACtAAAArQAAAK0AAACtAAAArQAAAK0AAACtAAAArQAAAK0AAACtAAAArQAAAK0AAACtAAAArQAAAK0AAACtAAAArQAAAK0AAACtAAAArQAAAK0AAACtAAAArQAAAK0AAACtAAAArQAAAK0AAACtAAAArQAAA==";var u0=lt(function(mRe,_Re){(function(e,t){typeof mRe==="object"&&typeof _Re<"u"?_Re.exports=t():typeof define==="function"&&define.amd?define(t):(e=typeof globalThis<"u"?globalThis:e||self,e.svgson=t())})(mRe,function(){/*!
   * Determine if an object is a Buffer
   *
   * @author   Feross Aboukhadijeh <https://feross.org>
   * @license  MIT
   */var e=function(U){return U!=null&&(t(U)||n(U)||!!U._isBuffer)};function t(U){return!!U.constructor&&typeof U.constructor.isBuffer==="function"&&U.constructor.isBuffer(U)}function n(U){return typeof U.readFloatLE==="function"&&typeof U.slice==="function"&&t(U.slice(0,0))}var o=Object.prototype.toString,r=function(j){if(typeof j>"u")return"undefined";if(j===null)return"null";if(j===!0||j===!1||j instanceof Boolean)return"boolean";if(typeof j==="string"||j instanceof String)return"string";if(typeof j==="number"||j instanceof Number)return"number";if(typeof j==="function"||j instanceof Function)return"function";if(typeof Array.isArray<"u"&&Array.isArray(j))return"array";if(j instanceof RegExp)return"regexp";if(j instanceof Date)return"date";var Y=o.call(j);if(Y==="[object RegExp]")return"regexp";if(Y==="[object Date]")return"date";if(Y==="[object Arguments]")return"arguments";if(Y==="[object Error]")return"error";if(e(j))return"buffer";if(Y==="[object Set]")return"set";if(Y==="[object WeakSet]")return"weakset";if(Y==="[object Map]")return"map";if(Y==="[object WeakMap]")return"weakmap";if(Y==="[object Symbol]")return"symbol";if(Y==="[object Int8Array]")return"int8array";if(Y==="[object Uint8Array]")return"uint8array";if(Y==="[object Uint8ClampedArray]")return"uint8clampedarray";if(Y==="[object Int16Array]")return"int16array";if(Y==="[object Uint16Array]")return"uint16array";if(Y==="[object Int32Array]")return"int32array";if(Y==="[object Uint32Array]")return"uint32array";if(Y==="[object Float32Array]")return"float32array";if(Y==="[object Float64Array]")return"float64array";return"object"};function i(U,j){return j={exports:{}},U(j,j.exports),j.exports}var s=i(function(U){(function(){function j(Y,X){if(typeof X!=="function")return Y;var K={};for(var J in Y)if(Object.prototype.hasOwnProperty.call(Y,J))K[X(J,Y[J])||J]=Y[J];return K}if(U.exports)U.exports=j;else window.rename=j})()}),a=function U(j,Y){var X=r(j);if(X!=="object"&&X!=="array")throw Error("expected an object");var K=[];if(X==="object")j=s(j,Y),K={};for(var J in j)if(j.hasOwnProperty(J)){var ee=j[J];if(r(ee)==="object"||r(ee)==="array")K[J]=U(ee,Y);else K[J]=ee}return K},c=i(function(U){var j=Object.prototype.hasOwnProperty,Y="~";function X(){}if(Object.create){if(X.prototype=Object.create(null),!new X().__proto__)Y=!1}function K(ee,se,ne){this.fn=ee,this.context=se,this.once=ne||!1}function J(){this._events=new X,this._eventsCount=0}J.prototype.eventNames=function(){var se=[],ne,re;if(this._eventsCount===0)return se;for(re in ne=this._events)if(j.call(ne,re))se.push(Y?re.slice(1):re);if(Object.getOwnPropertySymbols)return se.concat(Object.getOwnPropertySymbols(ne));return se},J.prototype.listeners=function(se,ne){var re=Y?Y+se:se,Z=this._events[re];if(ne)return!!Z;if(!Z)return[];if(Z.fn)return[Z.fn];for(var te=0,ie=Z.length,ce=Array(ie);te<ie;te++)ce[te]=Z[te].fn;return ce},J.prototype.emit=function(se,ne,re,Z,te,ie){var ce=Y?Y+se:se;if(!this._events[ce])return!1;var ue=this._events[ce],de=arguments.length,me,ge;if(ue.fn){if(ue.once)this.removeListener(se,ue.fn,void 0,!0);switch(de){case 1:return ue.fn.call(ue.context),!0;case 2:return ue.fn.call(ue.context,ne),!0;case 3:return ue.fn.call(ue.context,ne,re),!0;case 4:return ue.fn.call(ue.context,ne,re,Z),!0;case 5:return ue.fn.call(ue.context,ne,re,Z,te),!0;case 6:return ue.fn.call(ue.context,ne,re,Z,te,ie),!0}for(ge=1,me=Array(de-1);ge<de;ge++)me[ge-1]=arguments[ge];ue.fn.apply(ue.context,me)}else{var xe=ue.length,Ee;for(ge=0;ge<xe;ge++){if(ue[ge].once)this.removeListener(se,ue[ge].fn,void 0,!0);switch(de){case 1:ue[ge].fn.call(ue[ge].context);break;case 2:ue[ge].fn.call(ue[ge].context,ne);break;case 3:ue[ge].fn.call(ue[ge].context,ne,re);break;case 4:ue[ge].fn.call(ue[ge].context,ne,re,Z);break;default:if(!me)for(Ee=1,me=Array(de-1);Ee<de;Ee++)me[Ee-1]=arguments[Ee];ue[ge].fn.apply(ue[ge].context,me)}}}return!0},J.prototype.on=function(se,ne,re){var Z=new K(ne,re||this),te=Y?Y+se:se;if(!this._events[te])this._events[te]=Z,this._eventsCount++;else if(!this._events[te].fn)this._events[te].push(Z);else this._events[te]=[this._events[te],Z];return this},J.prototype.once=function(se,ne,re){var Z=new K(ne,re||this,!0),te=Y?Y+se:se;if(!this._events[te])this._events[te]=Z,this._eventsCount++;else if(!this._events[te].fn)this._events[te].push(Z);else this._events[te]=[this._events[te],Z];return this},J.prototype.removeListener=function(se,ne,re,Z){var te=Y?Y+se:se;if(!this._events[te])return this;if(!ne){if(--this._eventsCount===0)this._events=new X;else delete this._events[te];return this}var ie=this._events[te];if(ie.fn){if(ie.fn===ne&&(!Z||ie.once)&&(!re||ie.context===re))if(--this._eventsCount===0)this._events=new X;else delete this._events[te]}else{for(var ce=0,ue=[],de=ie.length;ce<de;ce++)if(ie[ce].fn!==ne||Z&&!ie[ce].once||re&&ie[ce].context!==re)ue.push(ie[ce]);if(ue.length)this._events[te]=ue.length===1?ue[0]:ue;else if(--this._eventsCount===0)this._events=new X;else delete this._events[te]}return this},J.prototype.removeAllListeners=function(se){var ne;if(se){if(ne=Y?Y+se:se,this._events[ne])if(--this._eventsCount===0)this._events=new X;else delete this._events[ne]}else this._events=new X,this._eventsCount=0;return this},J.prototype.off=J.prototype.removeListener,J.prototype.addListener=J.prototype.on,J.prototype.setMaxListeners=function(){return this},J.prefixed=Y,J.EventEmitter=J,U.exports=J});function l(U,j,Y){if(j in U)Object.defineProperty(U,j,{value:Y,enumerable:!0,configurable:!0,writable:!0});else U[j]=Y;return U}var h=function(){},d={data:"state-data",cdata:"state-cdata",tagBegin:"state-tag-begin",tagName:"state-tag-name",tagEnd:"state-tag-end",attributeNameStart:"state-attribute-name-start",attributeName:"state-attribute-name",attributeNameEnd:"state-attribute-name-end",attributeValueBegin:"state-attribute-value-begin",attributeValue:"state-attribute-value"},u={lt:"action-lt",gt:"action-gt",space:"action-space",equal:"action-equal",quote:"action-quote",slash:"action-slash",char:"action-char",error:"action-error"},_={text:"text",openTag:"open-tag",closeTag:"close-tag",attributeName:"attribute-name",attributeValue:"attribute-value"},p={" ":u.space,"\t":u.space,"\n":u.space,"\r":u.space,"<":u.lt,">":u.gt,'"':u.quote,"'":u.quote,"=":u.equal,"/":u.slash},m=function(j){return p[j]||u.char},A=function(j){var Y,X,K,J,ee,se,ne,re,Z,te;j=Object.assign({debug:!1},j);var ie=new c,ce=d.data,ue="",de="",me="",ge="",xe="",Ee="",Re=function(ye,Se){if(de[0]==="?"||de[0]==="!")return;var Ne={type:ye,value:Se};if(j.debug)console.log("emit:",Ne);ie.emit("data",Ne)};ie.stateMachine=(te={},l(te,d.data,(Y={},l(Y,u.lt,function(){if(ue.trim())Re(_.text,ue);de="",xe=!1,ce=d.tagBegin}),l(Y,u.char,function(_e){ue+=_e}),Y)),l(te,d.cdata,l({},u.char,function(_e){if(ue+=_e,ue.substr(-3)==="]]>")Re(_.text,ue.slice(0,-3)),ue="",ce=d.data})),l(te,d.tagBegin,(X={},l(X,u.space,h),l(X,u.char,function(_e){de=_e,ce=d.tagName}),l(X,u.slash,function(){de="",xe=!0}),X)),l(te,d.tagName,(K={},l(K,u.space,function(){if(xe)ce=d.tagEnd;else ce=d.attributeNameStart,Re(_.openTag,de)}),l(K,u.gt,function(){if(xe)Re(_.closeTag,de);else Re(_.openTag,de);ue="",ce=d.data}),l(K,u.slash,function(){ce=d.tagEnd,Re(_.openTag,de)}),l(K,u.char,function(_e){if(de+=_e,de==="![CDATA[")ce=d.cdata,ue="",de=""}),K)),l(te,d.tagEnd,(J={},l(J,u.gt,function(){Re(_.closeTag,de),ue="",ce=d.data}),l(J,u.char,h),J)),l(te,d.attributeNameStart,(ee={},l(ee,u.char,function(_e){me=_e,ce=d.attributeName}),l(ee,u.gt,function(){ue="",ce=d.data}),l(ee,u.space,h),l(ee,u.slash,function(){xe=!0,ce=d.tagEnd}),ee)),l(te,d.attributeName,(se={},l(se,u.space,function(){ce=d.attributeNameEnd}),l(se,u.equal,function(){Re(_.attributeName,me),ce=d.attributeValueBegin}),l(se,u.gt,function(){ge="",Re(_.attributeName,me),Re(_.attributeValue,ge),ue="",ce=d.data}),l(se,u.slash,function(){xe=!0,ge="",Re(_.attributeName,me),Re(_.attributeValue,ge),ce=d.tagEnd}),l(se,u.char,function(_e){me+=_e}),se)),l(te,d.attributeNameEnd,(ne={},l(ne,u.space,h),l(ne,u.equal,function(){Re(_.attributeName,me),ce=d.attributeValueBegin}),l(ne,u.gt,function(){ge="",Re(_.attributeName,me),Re(_.attributeValue,ge),ue="",ce=d.data}),l(ne,u.char,function(_e){ge="",Re(_.attributeName,me),Re(_.attributeValue,ge),me=_e,ce=d.attributeName}),ne)),l(te,d.attributeValueBegin,(re={},l(re,u.space,h),l(re,u.quote,function(_e){Ee=_e,ge="",ce=d.attributeValue}),l(re,u.gt,function(){ge="",Re(_.attributeValue,ge),ue="",ce=d.data}),l(re,u.char,function(_e){Ee="",ge=_e,ce=d.attributeValue}),re)),l(te,d.attributeValue,(Z={},l(Z,u.space,function(_e){if(Ee)ge+=_e;else Re(_.attributeValue,ge),ce=d.attributeNameStart}),l(Z,u.quote,function(_e){if(Ee===_e)Re(_.attributeValue,ge),ce=d.attributeNameStart;else ge+=_e}),l(Z,u.gt,function(_e){if(Ee)ge+=_e;else Re(_.attributeValue,ge),ue="",ce=d.data}),l(Z,u.slash,function(_e){if(Ee)ge+=_e;else Re(_.attributeValue,ge),xe=!0,ce=d.tagEnd}),l(Z,u.char,function(_e){ge+=_e}),Z)),te);var Me=function(ye){if(j.debug)console.log(ce,ye);var Se=ie.stateMachine[ce],Ne=Se[m(ye)]||Se[u.error]||Se[u.char];Ne(ye)};return ie.write=function(_e){var ye=_e.length;for(var Se=0;Se<ye;Se++)Me(_e[Se])},ie},g={State:d,Action:u,Type:_,create:A},f=g.Type,y={element:"element",text:"text"},x=function(j){return Object.assign({name:"",type:y.element,value:"",parent:null,attributes:{},children:[]},j)},C=function(j){j=Object.assign({stream:!1,parentNodes:!0,doneEvent:"done",tagPrefix:"tag:",emitTopLevelOnly:!1,debug:!1},j);var Y=void 0,X=void 0,K=void 0,J=void 0,ee=new c,se=function(re){switch(re.type){case f.openTag:if(K===null)K=X,K.name=re.value;else{var Z=x({name:re.value,parent:K});K.children.push(Z),K=Z}break;case f.closeTag:var te=K.parent;if(!j.parentNodes)K.parent=null;if(K.name!==re.value)break;if(j.stream&&te===X)X.children=[],K.parent=null;if(!j.emitTopLevelOnly||te===X)ee.emit(j.tagPrefix+K.name,K),ee.emit("tag",K.name,K);if(K===X)Y.removeAllListeners("data"),ee.emit(j.doneEvent,K),X=null;K=te;break;case f.text:if(K)K.children.push(x({type:y.text,value:re.value,parent:j.parentNodes?K:null}));break;case f.attributeName:J=re.value,K.attributes[J]="";break;case f.attributeValue:K.attributes[J]=re.value;break}};return ee.reset=function(){Y=g.create({debug:j.debug}),Y.on("data",se),X=x(),K=null,J="",ee.parse=Y.write},ee.reset(),ee},b=function(j,Y){Y=Object.assign({},Y,{stream:!1,tagPrefix:":"});var X=C(Y),K=void 0;return X.on("done",function(J){K=J}),X.parse(j),K},I={parseSync:b,create:C,NodeType:y},v=I.parseSync,P=function(j){var Y=v("<root>".concat(j,"</root>"),{parentNodes:!1}),X=Y.children&&Y.children.length>0&&Y.children.every(function(K){return K.name==="svg"});if(X)return Y.children.length===1?Y.children[0]:Y.children;else throw Error("nothing to parse")},M=function(j){return a(j,function(Y){if(!T(Y))return B(Y);return Y})},B=function(j){return j.replace(/[-|:]([a-z])/gi,function(Y,X){return X.toUpperCase()})},T=function(j){return/^(data|aria)(-\w+)/.test(j)},N=function(j){if(j){var Y=String(j);return/[&<>]/.test(Y)?"<![CDATA[".concat(Y.replace(/]]>/,"]]]]><![CDATA[>"),"]]>"):Y}return""},D=function(j){return String(j).replace(/&/g,"&amp;").replace(/'/g,"&apos;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")},L=function(j){var Y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},X=Y.transformNode,K=X===void 0?function(ne){return ne}:X,J=Y.camelcase,ee=J===void 0?!1:J,se=function(re){var Z=K(re);if(ee)Z=M(Z);return Z};return se(P(j))};function H(){for(var U=arguments.length,j=Array(U),Y=0;Y<U;Y++)j[Y]=arguments[Y];return new Promise(function(X,K){try{var J=L.apply(void 0,j);X(J)}catch(ee){K(ee)}})}var V=function U(j){var Y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},X=Y.transformAttr,K=X===void 0?function(ce,ue,de){return"".concat(ce,'="').concat(de(ue),'"')}:X,J=Y.transformNode,ee=J===void 0?function(ce){return ce}:J,se=Y.selfClose,ne=se===void 0?!0:se;if(Array.isArray(j))return j.map(function(ce){return U(ce,{transformAttr:K,selfClose:ne,transformNode:ee})}).join("");var re=ee(j);if(re.type==="text")return N(re.value);var Z="";for(var te in re.attributes){var ie=K(te,re.attributes[te],D,re.name);Z+=ie?" ".concat(ie):""}return re.children&&re.children.length>0||!ne?"<".concat(re.name).concat(Z,">").concat(U(re.children,{transformAttr:K,transformNode:ee,selfClose:ne}),"</").concat(re.name,">"):"<".concat(re.name).concat(Z,"/>")},O=Object.assign({},{parse:H,parseSync:L,stringify:V});return O})});var j3t=lt(function(RAs,X3t){var xX=1000,CX=xX*60,bX=CX*60,YF=bX*24,pxo=YF*7,mxo=YF*365.25;X3t.exports=function(e,t){t=t||{};var n=typeof e;if(n==="string"&&e.length>0)return _xo(e);else if(n==="number"&&isFinite(e))return t.long?Axo(e):gxo(e);throw Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function _xo(e){if(e=String(e),e.length>100)return;var t=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(!t)return;var n=parseFloat(t[1]),o=(t[2]||"ms").toLowerCase();switch(o){case"years":case"year":case"yrs":case"yr":case"y":return n*mxo;case"weeks":case"week":case"w":return n*pxo;case"days":case"day":case"d":return n*YF;case"hours":case"hour":case"hrs":case"hr":case"h":return n*bX;case"minutes":case"minute":case"mins":case"min":case"m":return n*CX;case"seconds":case"second":case"secs":case"sec":case"s":return n*xX;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n;default:return}}function gxo(e){var t=Math.abs(e);if(t>=YF)return Math.round(e/YF)+"d";if(t>=bX)return Math.round(e/bX)+"h";if(t>=CX)return Math.round(e/CX)+"m";if(t>=xX)return Math.round(e/xX)+"s";return e+"ms"}function Axo(e){var t=Math.abs(e);if(t>=YF)return vAe(e,t,YF,"day");if(t>=bX)return vAe(e,t,bX,"hour");if(t>=CX)return vAe(e,t,CX,"minute");if(t>=xX)return vAe(e,t,xX,"second");return e+" ms"}function vAe(e,t,n,o){var r=t>=n*1.5;return Math.round(e/n)+" "+o+(r?"s":"")}});var $3t=lt(function(QAs,K3t){function fxo(e){n.debug=n,n.default=n,n.coerce=c,n.disable=s,n.enable=r,n.enabled=a,n.humanize=j3t(),n.destroy=l,Object.keys(e).forEach((h)=>{n[h]=e[h]}),n.names=[],n.skips=[],n.formatters={};function t(h){let d=0;for(let u=0;u<h.length;u++)d=(d<<5)-d+h.charCodeAt(u),d|=0;return n.colors[Math.abs(d)%n.colors.length]}n.selectColor=t;function n(h){let d,u=null,_,p;function m(...A){if(!m.enabled)return;let g=m,f=Number(new Date),y=f-(d||f);if(g.diff=y,g.prev=d,g.curr=f,d=f,A[0]=n.coerce(A[0]),typeof A[0]!=="string")A.unshift("%O");let x=0;A[0]=A[0].replace(/%([a-zA-Z%])/g,(b,I)=>{if(b==="%%")return"%";x++;let v=n.formatters[I];if(typeof v==="function"){let P=A[x];b=v.call(g,P),A.splice(x,1),x--}return b}),n.formatArgs.call(g,A),(g.log||n.log).apply(g,A)}if(m.namespace=h,m.useColors=n.useColors(),m.color=n.selectColor(h),m.extend=o,m.destroy=n.destroy,Object.defineProperty(m,"enabled",{enumerable:!0,configurable:!1,get:()=>{if(u!==null)return u;if(_!==n.namespaces)_=n.namespaces,p=n.enabled(h);return p},set:(A)=>{u=A}}),typeof n.init==="function")n.init(m);return m}function o(h,d){let u=n(this.namespace+(typeof d>"u"?":":d)+h);return u.log=this.log,u}function r(h){n.save(h),n.namespaces=h,n.names=[],n.skips=[];let d=(typeof h==="string"?h:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(let u of d)if(u[0]==="-")n.skips.push(u.slice(1));else n.names.push(u)}function i(h,d){let u=0,_=0,p=-1,m=0;while(u<h.length)if(_<d.length&&(d[_]===h[u]||d[_]==="*"))if(d[_]==="*")p=_,m=u,_++;else u++,_++;else if(p!==-1)_=p+1,m++,u=m;else return!1;while(_<d.length&&d[_]==="*")_++;return _===d.length}function s(){let h=[...n.names,...n.skips.map((d)=>"-"+d)].join(",");return n.enable(""),h}function a(h){for(let d of n.skips)if(i(h,d))return!1;for(let d of n.names)if(i(h,d))return!0;return!1}function c(h){if(h instanceof Error)return h.stack||h.message;return h}function l(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return n.enable(n.load()),n}K3t.exports=fxo});var p0=lt(function(gRe,SAe){gRe.formatArgs=xxo;gRe.save=Cxo;gRe.load=bxo;gRe.useColors=yxo;gRe.storage=Ixo();gRe.destroy=(()=>{let e=!1;return()=>{if(!e)e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}})();gRe.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function yxo(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let e;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(e=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(e[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function xxo(e){if(e[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+e[0]+(this.useColors?"%c ":" ")+"+"+SAe.exports.humanize(this.diff),!this.useColors)return;let t="color: "+this.color;e.splice(1,0,t,"color: inherit");let n=0,o=0;e[0].replace(/%[a-zA-Z%]/g,(r)=>{if(r==="%%")return;if(n++,r==="%c")o=n}),e.splice(o,0,t)}gRe.log=console.debug||console.log||(()=>{});function Cxo(e){try{if(e)gRe.storage.setItem("debug",e);else gRe.storage.removeItem("debug")}catch(t){}}function bxo(){let e;try{e=gRe.storage.getItem("debug")||gRe.storage.getItem("DEBUG")}catch(t){}if(!e&&typeof process<"u"&&"env"in process)e=process.env.DEBUG;return e}function Ixo(){try{return localStorage}catch(e){}}SAe.exports=$3t()(gRe);var{formatters:vxo}=SAe.exports;vxo.j=function(e){try{return JSON.stringify(e)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}}});var ARe,Ax,Dxo=0.09,Nxo=0.692052,Rxo=0.692052,Qxo=1.152,kxo=0,fRe,fre,yRe,LC;var $8=El(()=>{ARe={"0":"M0.301025 0.257813 L0.206593 0.283385 L0.122042 0.361307 L0.075923 0.474441 L0.064942 0.642221 L0.091296 0.78289 L0.159376 0.899463 L0.257104 0.961214 L0.344948 0.961214 L0.442678 0.899463 L0.510757 0.78289 L0.537111 0.642221 L0.526131 0.474441 L0.480012 0.361307 L0.39546 0.283385 L0.301025 0.257813","1":"M0.220426 0.40845 L0.381626 0.270996 L0.381626 0.948966","2":"M0.110409 0.39212 L0.125621 0.342293 L0.170571 0.295823 L0.244237 0.26431 L0.291518 0.257813 L0.373319 0.263799 L0.434683 0.290705 L0.468239 0.331966 L0.480292 0.379913 L0.479492 0.411806 L0.465088 0.465192 L0.402571 0.568988 L0.245134 0.766438 L0.07959 0.948045 L0.522462 0.948045","3":"M0.081606 0.345073 L0.119154 0.315633 L0.178996 0.284091 L0.255265 0.257813 L0.349133 0.263062 L0.43127 0.289348 L0.48994 0.336662 L0.525141 0.394491 L0.513407 0.457577 L0.466472 0.504892 L0.384334 0.541692 L0.290464 0.56272 L0.20833 0.573235 L0.290464 0.583749 L0.384334 0.610035 L0.466472 0.652092 L0.519274 0.709922 L0.531007 0.773007 L0.50754 0.841351 L0.454738 0.899179 L0.3726 0.946494 L0.310412 0.961214 L0.209503 0.959111 L0.127367 0.946494 L0.071046 0.929671","4":"M0.418494 0.270996 L0.048828 0.724199 L0.553224 0.724199 M0.414181 0.578167 L0.414181 0.94897","5":"M0.074951 0.270996 L0.074951 0.614701 L0.267655 0.5695 L0.405247 0.586502 L0.460002 0.617189 L0.498028 0.660731 L0.527101 0.779401 L0.513352 0.841049 L0.477274 0.889568 L0.406378 0.93463 L0.324445 0.958337 L0.247399 0.962139 L0.182516 0.949767 L0.130068 0.925508 L0.074951 0.875607 M0.074951 0.270996 L0.527101 0.270996","6":"M0.428549 0.257813 L0.341433 0.285053 L0.26073 0.312099 L0.192188 0.360182 L0.138902 0.410969 L0.098219 0.500422 L0.070249 0.584267 L0.067264 0.670716 L0.065164 0.756863 L0.087163 0.820973 L0.108168 0.861042 L0.157916 0.913131 L0.210981 0.948192 L0.29279 0.961214 L0.384548 0.956206 L0.456409 0.924151 L0.507262 0.881077 L0.5349 0.821975 L0.537111 0.771889 L0.521634 0.718798 L0.498418 0.67372 L0.463042 0.636657 L0.414398 0.613617 L0.34696 0.598591 L0.28284 0.595587 L0.215403 0.605604 L0.145756 0.641665 L0.109274 0.678729 L0.064942 0.724006","7":"M0.071534 0.270996 L0.530519 0.270996 L0.495935 0.291702 L0.477752 0.305407 L0.435186 0.346112 L0.412067 0.374136 L0.388565 0.40796 L0.365315 0.448098 L0.342943 0.495062 L0.322081 0.549366 L0.303364 0.611524 L0.287416 0.68205 L0.270077 0.80465 L0.26253 0.94897","8":"M0.286761 0.257813 L0.210684 0.27162 L0.1414 0.305622 L0.092494 0.382125 L0.111513 0.450128 L0.16857 0.502193 L0.228345 0.539382 L0.377781 0.594635 L0.470161 0.645637 L0.52586 0.706203 L0.538087 0.792269 L0.506841 0.87621 L0.438915 0.927212 L0.339743 0.961214 L0.263666 0.959089 L0.174004 0.929337 L0.102003 0.881523 L0.063965 0.811395 L0.066682 0.741266 L0.102003 0.671139 L0.180797 0.608448 L0.259591 0.580822 L0.358762 0.548945 L0.456576 0.49688 L0.486463 0.446941 L0.487822 0.362999 L0.453859 0.302434 L0.384574 0.265245 L0.286761 0.257813","9":"M0.511026 0.437812 L0.491026 0.347812 L0.451026 0.297812 L0.391026 0.267812 L0.311026 0.257813 L0.231026 0.267812 L0.161026 0.297812 L0.111026 0.347812 L0.091026 0.417812 L0.111026 0.487812 L0.161026 0.537812 L0.231026 0.567812 L0.311026 0.577812 L0.391026 0.557812 L0.451026 0.517812 L0.491026 0.477812 L0.511026 0.437812 M0.510026 0.438812 L0.434026 0.636812 L0.381026 0.777812 L0.337026 0.879812 L0.301026 0.957812","!":"M0.301026 0.270996 L0.301026 0.749566 M0.251466 0.94897 L0.350587 0.94897",'"':"M0.16504 0.270996 L0.16504 0.523022 M0.437013 0.270996 L0.437013 0.523022","#":"M0.20958 0.282227 L0.146515 0.949754 M0.461844 0.282227 L0.398779 0.949754 M0.032999 0.526969 L0.600587 0.452796 M0.001465 0.82366 L0.569055 0.749486",$:"M0.307121 0.240234 L0.307121 1.083502 M0.490031 0.415915 L0.404676 0.328075 L0.23396 0.310507 L0.136407 0.398347 L0.099828 0.521324 L0.124213 0.591596 L0.197379 0.644299 L0.429061 0.697003 L0.502224 0.749708 L0.526613 0.837547 L0.477836 0.960526 L0.355897 1.013228 L0.197379 0.99566 L0.112021 0.942957 L0.07544 0.837547","'":"M0.301026 0.270996 L0.301026 0.523022","(":"M0.413087 0.241211 L0.372337 0.28347 L0.331589 0.334184 L0.290838 0.393349 L0.25009 0.460965 L0.219528 0.528584 L0.199153 0.5962 L0.188966 0.655364 L0.199153 0.714529 L0.219528 0.782146 L0.25009 0.849764 L0.290838 0.91738 L0.331589 0.976544 L0.372337 1.027258 L0.413087 1.069491",")":"M0.188966 0.241211 L0.229716 0.28347 L0.270466 0.334184 L0.311213 0.393349 L0.351964 0.460965 L0.382526 0.528584 L0.4029 0.5962 L0.413087 0.655364 L0.4029 0.714529 L0.382526 0.782146 L0.351964 0.849764 L0.311213 0.91738 L0.270466 0.976544 L0.229716 1.027258 L0.188966 1.069491","*":"M0.301026 0.458702 L0.301026 0.681942 M0.301026 0.458702 L0.520997 0.536834 M0.301026 0.458702 L0.439954 0.257813 M0.301026 0.458702 L0.162098 0.257813 M0.301026 0.458702 L0.081055 0.536834","+":"M0.042969 0.66845 L0.559083 0.66845 M0.301023 0.428223 L0.301023 0.908661",",":"M0.38672 0.852051 L0.215333 1.030661 L0.301025 1.119971","-":"M0.173829 0.686035 L0.428224 0.686035",".":"M0.362549 0.851074 L0.239503 0.851074","/":"M0.062501 1.035249 L0.539551 0.270996","<":"M0.559083 0.441895 L0.042969 0.66939 L0.042969 0.66939 L0.559083 0.896902","=":"M0.042969 0.545898 L0.559083 0.545898 M0.042969 0.80837 L0.559083 0.80837",">":"M0.042969 0.441895 L0.559083 0.66939 L0.559083 0.66939 L0.042969 0.896902",A:"M0.018067 0.94897 L0.290179 0.270996 L0.583986 0.94897 M0.155303 0.684521 L0.433548 0.684521",B:"M0.063965 0.94897 L0.063965 0.278953 L0.209356 0.270996 L0.342486 0.294394 L0.432179 0.37292 L0.418224 0.48773 L0.312686 0.549166 L0.084728 0.575531 L0.306377 0.589434 L0.468877 0.647456 L0.538087 0.736658 L0.5324 0.85202 L0.501247 0.902983 L0.42355 0.944398 L0.063965 0.94897",C:"M0.529054 0.419847 L0.498425 0.345196 L0.442238 0.292341 L0.33583 0.257813 L0.257199 0.268357 L0.187906 0.303748 L0.120243 0.385432 L0.072998 0.599844 L0.110073 0.815385 L0.165381 0.902183 L0.222883 0.942801 L0.334904 0.961214 L0.43253 0.937679 L0.504816 0.868999 L0.529054 0.772065",D:"M0.064454 0.94897 L0.071838 0.285078 L0.171217 0.270996 L0.247348 0.272633 L0.37101 0.306078 L0.462461 0.378304 L0.514748 0.475555 L0.535591 0.576392 L0.537599 0.652313 L0.528065 0.717381 L0.508562 0.772419 L0.445948 0.855695 L0.362356 0.90871 L0.225203 0.945862 L0.064454 0.94897",E:"M0.080078 0.270996 L0.080078 0.94897 M0.080078 0.270996 L0.521974 0.270996 M0.080078 0.609981 L0.389405 0.609981 M0.080078 0.94897 L0.521974 0.94897",F:"M0.086426 0.270996 L0.086426 0.94897 M0.091304 0.275607 L0.515626 0.275607 M0.091304 0.607677 L0.447344 0.607677",G:"M0.498034 0.284943 L0.374621 0.257813 L0.244219 0.268648 L0.160577 0.311997 L0.094556 0.398116 L0.056397 0.58404 L0.076752 0.785532 L0.120865 0.858197 L0.188947 0.916734 L0.271008 0.953591 L0.357069 0.961214 L0.43715 0.932047 L0.501262 0.858539 L0.545656 0.648611 L0.329595 0.648131",H:"M0.066895 0.270996 L0.066895 0.94897 M0.066895 0.595658 L0.530009 0.595658 M0.535157 0.270996 L0.535157 0.94897",I:"M0.301026 0.270996 L0.301026 0.94897",J:"M0.506839 0.270996 L0.507814 0.782193 L0.498468 0.846168 L0.480733 0.880789 L0.455864 0.90832 L0.426095 0.929408 L0.360746 0.954812 L0.302508 0.962139 L0.223573 0.953638 L0.16538 0.930312 L0.137072 0.907715 L0.116428 0.880312 L0.102822 0.848819 L0.095633 0.813947 L0.094239 0.776413",K:"M0.035401 0.270996 L0.035401 0.94897 M0.502258 0.316194 L0.035401 0.687823 M0.212484 0.582361 L0.566652 0.933903",L:"M0.07544 0.270996 L0.07544 0.94897 L0.526613 0.94897",M:"M0.042481 0.94897 L0.042481 0.270996 L0.301027 0.712492 L0.559571 0.270996 L0.559571 0.94897",N:"M0.067871 0.94897 L0.067871 0.270996 L0.534181 0.94897 L0.525031 0.270996",O:"M0.287293 0.961214 L0.19843 0.933567 L0.1172 0.849451 L0.057129 0.563945 L0.114348 0.350255 L0.18455 0.289392 L0.306101 0.257813 L0.42054 0.29572 L0.487543 0.365003 L0.544923 0.625294 L0.516366 0.789624 L0.465476 0.884596 L0.375084 0.949287 L0.287293 0.961214",P:"M0.070557 0.94897 L0.070557 0.28379 L0.20704 0.270996 L0.329134 0.278993 L0.408525 0.300514 L0.444022 0.317908 L0.500637 0.368929 L0.525796 0.423728 L0.531496 0.50384 L0.508934 0.554205 L0.473724 0.582043 L0.417577 0.604365 L0.336375 0.620372 L0.226014 0.629268 L0.082368 0.630258",Q:"M0.282435 1.050813 L0.195447 1.019646 L0.115933 0.924817 L0.057129 0.602943 L0.113139 0.362034 L0.18186 0.293418 L0.300844 0.257813 L0.412868 0.300553 L0.478457 0.37866 L0.534625 0.672103 L0.506671 0.857367 L0.456855 0.964437 L0.368371 1.037368 L0.282435 1.050813 M0.341225 0.815559 L0.544923 1.070653",R:"M0.034912 0.944112 L0.034912 0.288556 L0.227127 0.270996 L0.362038 0.276867 L0.443423 0.294907 L0.477644 0.309614 L0.505809 0.328757 L0.526616 0.352817 L0.544963 0.418061 L0.543241 0.475921 L0.524463 0.517817 L0.49076 0.546518 L0.444265 0.564799 L0.355195 0.578739 L0.047653 0.589627 M0.303054 0.617306 L0.56714 0.94897",S:"M0.483037 0.364333 L0.407613 0.267477 L0.22883 0.257813 L0.128623 0.327565 L0.087712 0.455539 L0.104656 0.518727 L0.168054 0.573307 L0.41928 0.617318 L0.503796 0.669342 L0.535157 0.759324 L0.493846 0.900055 L0.367668 0.961214 L0.205436 0.956661 L0.116711 0.907038 L0.066895 0.790334",T:"M0.022949 0.270996 L0.579103 0.270996 M0.309284 0.270996 L0.309284 0.94897",U:"M0.072022 0.270996 L0.07308 0.648875 L0.080372 0.75167 L0.099024 0.827813 L0.134786 0.885729 L0.181571 0.924023 L0.251464 0.95168 L0.339655 0.962139 L0.401553 0.951668 L0.45232 0.924086 L0.482701 0.891771 L0.495745 0.870529 L0.515699 0.81637 L0.525014 0.744626 L0.530031 0.272017",V:"M0.027832 0.270996 L0.320083 0.94897 L0.57422 0.270996",W:"M0 0.270996 L0.079799 0.940377 L0.285198 0.472884 L0.505255 0.94897 L0.602052 0.270996",X:"M0.009034 0.270996 L0.586805 0.94897 M0.593019 0.270996 L0.015246 0.94897",Y:"M0.018067 0.270996 L0.293132 0.574135 M0.583986 0.271959 L0.294954 0.57606 L0.305277 0.94897",Z:"M0.053711 0.270996 L0.548341 0.270996 L0.053711 0.94897 L0.548341 0.94897","[":"M0.404542 0.240234 L0.197511 0.240234 L0.197511 1.069424 L0.404542 1.069424","\\":"M0.062501 0.270996 L0.539551 1.035249","]":"M0.19751 0.240234 L0.404542 0.240234 L0.404542 1.069424 L0.19751 1.069424","^":"M0.035156 0.523931 L0.301024 0.270996 L0.566896 0.523931",_:"M0 1.160601 L0.602052 1.160601",a:"M0.527101 0.439941 L0.527101 0.973965 M0.527101 0.553824 L0.451366 0.477535 L0.376759 0.439941 L0.263722 0.439941 L0.187989 0.477535 L0.112255 0.553824 L0.074951 0.66881 L0.074951 0.745099 L0.112255 0.85898 L0.187989 0.93527 L0.263722 0.973965 L0.376759 0.973965 L0.451366 0.93527 L0.527101 0.85898",b:"M0.07666 0.240234 L0.07666 0.959985 M0.07666 0.582737 L0.151822 0.514237 L0.225865 0.480483 L0.338045 0.480483 L0.413211 0.514237 L0.488374 0.582737 L0.525392 0.685983 L0.525392 0.754485 L0.488374 0.856739 L0.413211 0.92524 L0.338045 0.959985 L0.225865 0.959985 L0.151822 0.92524 L0.07666 0.856739",c:"M0.512452 0.553823 L0.441624 0.477535 L0.371854 0.439941 L0.26614 0.439941 L0.195312 0.477535 L0.124486 0.553823 L0.0896 0.668808 L0.0896 0.745099 L0.124486 0.858979 L0.195312 0.93527 L0.26614 0.973965 L0.371854 0.973965 L0.441624 0.93527 L0.512452 0.858979",d:"M0.525392 0.240234 L0.525392 0.959985 M0.525392 0.582737 L0.450232 0.514237 L0.376189 0.480483 L0.264006 0.480483 L0.188844 0.514237 L0.11368 0.582737 L0.076661 0.685983 L0.076661 0.754485 L0.11368 0.856739 L0.188844 0.92524 L0.264006 0.959985 L0.376189 0.959985 L0.450232 0.92524 L0.525392 0.856739",e:"M0.059571 0.668808 L0.542482 0.668808 M0.542482 0.592521 L0.502641 0.516231 L0.461594 0.477535 L0.381914 0.439941 L0.261186 0.439941 L0.180299 0.477535 L0.099412 0.553823 L0.059571 0.668808 L0.059571 0.745099 L0.099412 0.858979 L0.180299 0.93527 L0.261186 0.973965 L0.381914 0.973965 L0.461594 0.93527 L0.542482 0.858979",f:"M0.512941 0.240234 L0.406984 0.240234 L0.301026 0.274346 L0.248047 0.374731 L0.248047 0.946817 M0.089112 0.476088 L0.459965 0.476088",g:"M0.525392 0.439941 L0.525392 0.989395 L0.488373 1.091918 L0.45023 1.126757 L0.376189 1.160601 L0.264004 1.160601 L0.188844 1.126757 L0.113681 1.058075 L0.076661 0.954555 M0.525392 0.542467 L0.45023 0.473786 L0.376189 0.439941 L0.264004 0.439941 L0.188844 0.473786 L0.113681 0.542467 L0.076661 0.645988 L0.076661 0.714669 L0.113681 0.817193 L0.188844 0.885875 L0.264004 0.920713 L0.376189 0.920713 L0.45023 0.885875 L0.525392 0.817193",h:"M0.092041 0.240234 L0.092041 0.946817 M0.092041 0.61058 L0.205937 0.509225 L0.282214 0.476086 L0.396109 0.476086 L0.47187 0.509225 L0.510011 0.61058 L0.510011 0.946817",i:"M0.261026 0.240234 L0.341026 0.240234 M0.300978 0.476089 L0.300978 0.946817",j:"M0.3853 0.240234 L0.447023 0.240234 M0.416159 0.465708 L0.416159 1.011689 L0.383887 1.108586 L0.252832 1.140264 L0.15503 1.108586",k:"M0.065186 0.240234 L0.065186 0.946817 M0.493824 0.476086 L0.065186 0.812323 M0.236758 0.677829 L0.536867 0.946817",l:"M0.301026 0.234863 L0.301026 0.946441",m:"M0.050538 0.439941 L0.050538 0.960796 M0.050538 0.588758 L0.114405 0.476607 L0.157178 0.439941 L0.236864 0.439941 L0.279637 0.476607 L0.32241 0.588758 L0.32241 0.960796 M0.32241 0.588758 L0.386281 0.476607 L0.428467 0.439941 L0.50874 0.439941 L0.551515 0.476607 L0.551515 0.960796",n:"M0.092041 0.439941 L0.092041 0.960796 M0.092041 0.588758 L0.205936 0.476607 L0.282216 0.439941 L0.396113 0.439941 L0.471871 0.476607 L0.510011 0.588758 L0.510011 0.960796",o:"M0.247175 0.439941 L0.175178 0.477535 L0.103186 0.553823 L0.066895 0.668808 L0.066895 0.745099 L0.103186 0.858979 L0.175178 0.93527 L0.247175 0.973965 L0.354874 0.973965 L0.426872 0.93527 L0.498866 0.858979 L0.535157 0.745099 L0.535157 0.668808 L0.498866 0.553823 L0.426872 0.477535 L0.354874 0.439941 L0.247175 0.439941",p:"M0.076904 0.439941 L0.076904 1.154244 M0.076904 0.541563 L0.151986 0.473487 L0.225944 0.439941 L0.338005 0.439941 L0.413087 0.473487 L0.488166 0.541563 L0.525148 0.644169 L0.525148 0.712246 L0.488166 0.813866 L0.413087 0.881942 L0.338005 0.916471 L0.225944 0.916471 L0.151986 0.881942 L0.076904 0.813866",q:"M0.525148 0.441895 L0.525148 1.156195 M0.525148 0.5435 L0.450067 0.47544 L0.376106 0.441895 L0.264042 0.441895 L0.188966 0.47544 L0.113885 0.5435 L0.076905 0.646108 L0.076905 0.714187 L0.113885 0.815809 L0.188966 0.883886 L0.264042 0.918418 L0.376106 0.918418 L0.450067 0.883886 L0.525148 0.815809",r:"M0.107422 0.439941 L0.107422 0.960796 M0.107422 0.663164 L0.155824 0.551014 L0.252626 0.476607 L0.349428 0.439941 L0.49463 0.439941",s:"M0.475556 0.477535 L0.400757 0.439941 L0.276092 0.439941 L0.176361 0.477535 L0.101563 0.553823 L0.101563 0.630112 L0.176361 0.668808 L0.301024 0.668808 L0.425688 0.745099 L0.50049 0.821387 L0.50049 0.897677 L0.425688 0.93527 L0.325956 0.973965 L0.201295 0.973965 L0.126496 0.93527 L0.101563 0.858979",t:"M0.246032 0.297852 L0.246032 0.826549 L0.301023 0.919323 L0.411011 0.950848 L0.520997 0.950848 M0.081055 0.515799 L0.466004 0.515799",u:"M0.092041 0.454102 L0.092041 0.826134 L0.13018 0.937211 L0.205936 0.974954 L0.319832 0.974954 L0.396113 0.937211 L0.510011 0.826134 M0.510011 0.454102 L0.510011 0.974954",v:"M0.048828 0.453125 L0.301026 0.961719 M0.553224 0.453125 L0.301026 0.961719",w:"M0 0.453125 L0.150512 0.961719 M0.301024 0.453125 L0.150512 0.961719 M0.301024 0.453125 L0.451539 0.961719 M0.602052 0.453125 L0.451539 0.961719",x:"M0.03711 0.453125 L0.564943 0.961719 M0.564943 0.453125 L0.03711 0.961719",y:"M0.084618 0.453125 L0.320232 0.921476 M0.55713 0.453125 L0.320232 0.921476 L0.242119 1.055289 L0.163369 1.122196 L0.084618 1.155166 L0.044922 1.155166",z:"M0.505373 0.452148 L0.09668 0.961651 M0.09668 0.452148 L0.505373 0.452148 M0.09668 0.961651 L0.505373 0.961651"},Ax={};for(let e in ARe){Ax[e]=[];let t=ARe[e].split("M").slice(1).map((n)=>n.split("L").map((o)=>o.trim().split(" ").map(parseFloat)));for(let n of t)for(let o=0;o<n.length-1;o++)Ax[e].push({x1:n[o][0],y1:1-n[o][1],x2:n[o+1][0],y2:1-n[o+1][1]})}fRe=Ax,fre={"0":0.692052,"1":0.692052,"2":0.692052,"3":0.692052,"4":0.692052,"5":0.692052,"6":0.692052,"7":0.692052,"8":0.692052,"9":0.692052,"!":0.692052,'"':0.692052,"#":0.692052,$:0.692052,"'":0.692052,"(":0.692052,")":0.692052,"*":0.692052,"+":0.692052,",":0.692052,"-":0.692052,".":0.692052,"/":0.692052,"<":0.692052,"=":0.692052,">":0.692052,A:0.692052,B:0.692052,C:0.692052,D:0.692052,E:0.692052,F:0.692052,G:0.692052,H:0.692052,I:0.692052,J:0.692052,K:0.692052,L:0.692052,M:0.692052,N:0.692052,O:0.692052,P:0.692052,Q:0.692052,R:0.692052,S:0.692052,T:0.692052,U:0.692052,V:0.692052,W:0.692052,X:0.692052,Y:0.692052,Z:0.692052,"[":0.692052,"\\":0.692052,"]":0.692052,"^":0.692052,_:0.692052,a:0.692052,b:0.692052,c:0.692052,d:0.692052,e:0.692052,f:0.692052,g:0.692052,h:0.692052,i:0.692052,j:0.692052,k:0.692052,l:0.692052,m:0.692052,n:0.692052,o:0.692052,p:0.692052,q:0.692052,r:0.692052,s:0.692052,t:0.692052,u:0.692052,v:0.692052,w:0.692052,x:0.692052,y:0.692052,z:0.692052," ":0.692052},yRe={},LC={glyphWidthRatio:Nxo,spaceWidthRatio:Rxo,lineHeightRatio:Qxo,strokeWidthRatio:Dxo,letterSpacingRatio:kxo}});var q3t=()=>{};var J3t=()=>{};function CRe([e,t],[n,o],{lineThickness:r=0}={}){if(r===0)return bRe(e,t,n,o);return Lxo(e,t,n,o)<=r}function bRe(e,t,n,o){let r=yre(e,t,n),i=yre(e,t,o),s=yre(n,o,e),a=yre(n,o,t);if(r!==i&&s!==a)return!0;if(r===0&&xre(e,n,t))return!0;if(i===0&&xre(e,o,t))return!0;if(s===0&&xre(n,e,o))return!0;if(a===0&&xre(n,t,o))return!0;return!1}function yre(e,t,n){let o=(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y);if(o===0)return 0;return o>0?1:2}function xre(e,t,n){return t.x<=Math.max(e.x,n.x)&&t.x>=Math.min(e.x,n.x)&&t.y<=Math.max(e.y,n.y)&&t.y>=Math.min(e.y,n.y)}function Lxo(e,t,n,o){if(e.x===t.x&&e.y===t.y)return GF(e,n,o);if(n.x===o.x&&n.y===o.y)return GF(n,e,t);if(bRe(e,t,n,o))return 0;let r=[GF(e,n,o),GF(t,n,o),GF(n,e,t),GF(o,e,t)];return Math.min(...r)}function GF(e,t,n){let o=(n.x-t.x)**2+(n.y-t.y)**2;if(o===0)return xRe(e,t);let r=((e.x-t.x)*(n.x-t.x)+(e.y-t.y)*(n.y-t.y))/o;r=Math.max(0,Math.min(1,r));let i={x:t.x+r*(n.x-t.x),y:t.y+r*(n.y-t.y)};return xRe(e,i)}function xRe(e,t){let n=e.x-t.x,o=e.y-t.y;return Math.sqrt(n*n+o*o)}var Z3t=()=>{};var eCt=()=>{};var tCt=El(()=>{q3t();J3t();Z3t();eCt()});function nCt(e){let t=e;while(t.parent!==null)t=t.parent;let n=e;while(n.parent!==null&&n.parent!==t){let o=n.parent;n.parent=t,n=o}return t}function Hxo(e,t){let n={nodeId:e,nextMember:null},o={parent:null,networkId:`connectivity_net${t.nextNetworkNumber++}`,firstMember:n,lastMember:n};return t.rootByNodeId.set(e,o),o}function Fxo(e,t){let n=t.rootByNodeId.get(e);return n===void 0?Hxo(e,t):nCt(n)}function zxo({targetRoot:e,sourceRoot:t}){e.lastMember.nextMember=t.firstMember,e.lastMember=t.lastMember,t.parent=e}function Oxo(e){let t=[],n=e.firstMember;while(n!==null)t.push(n.nodeId),n=n.nextMember;return t}function fM(e){let t={rootByNodeId:new Map,nextNetworkNumber:0};for(let o of e){let r=null;for(let i of o){let s=Fxo(i,t);if(r===null){r=s;continue}if(r=nCt(r),s!==r)zxo({targetRoot:r,sourceRoot:s})}}let n={};for(let o of t.rootByNodeId.values()){if(o.parent!==null)continue;n[o.networkId]=Oxo(o)}return n}var fx=class{netMap;idToNetMap;constructor(e){this.netMap=e,this.idToNetMap={};for(let[t,n]of Object.entries(e))for(let o of n)this.idToNetMap[o]=t}addConnections(e){for(let t of e){let n=new Set;for(let r of t){let i=this.idToNetMap[r];if(i)n.add(i)}let o;if(n.size===0)o=`connectivity_net${Object.keys(this.netMap).length}`,this.netMap[o]=[];else if(n.size===1)o=n.values().next().value??`connectivity_net${Object.keys(this.netMap).length}`;else{o=n.values().next().value??`connectivity_net${Object.keys(this.netMap).length}`;for(let r of n)if(r!==o){this.netMap[o].push(...this.netMap[r]),this.netMap[r]=this.netMap[o];for(let i of this.netMap[o])this.idToNetMap[i]=o}}for(let r of t){if(!this.netMap[o].includes(r))this.netMap[o].push(r);this.idToNetMap[r]=o}}}getIdsConnectedToNet(e){return this.netMap[e]||[]}getNetConnectedToId(e){return this.idToNetMap[e]}areIdsConnected(e,t){if(e===t)return!0;let n=this.getNetConnectedToId(e);if(!n)return!1;let o=this.getNetConnectedToId(t);if(!o)return!1;return n===o||o===e||o===e}areAllIdsConnected(e){let t=this.getNetConnectedToId(e[0]);for(let n of e){let o=this.getNetConnectedToId(n);if(o===void 0)return!1;if(o!==t)return!1}return!0}},q8=(e)=>{let t=[];for(let o of e)if(o.type==="source_trace")t.push([...o.connected_source_port_ids??[],...o.connected_source_net_ids??[]]);else if(o.type==="source_component"){if(o.internally_connected_source_port_ids)for(let r of o.internally_connected_source_port_ids)t.push(r)}else if(o.type==="source_component_internal_connection")t.push(o.source_port_ids);let n=fM(t);return new fx(n)},oa=(e)=>{let t=[];for(let o of e)if(o.type==="source_trace")t.push([o.source_trace_id,...o.connected_source_port_ids??[],...o.connected_source_net_ids??[]].filter(Boolean));else if(o.type==="pcb_port"){let{pcb_port_id:r,source_port_id:i}=o;if(i&&r)t.push([i,r])}else if(o.type==="pcb_smtpad"){let{pcb_smtpad_id:r,pcb_port_id:i}=o;if(i&&r)t.push([r,i])}else if(o.type==="pcb_plated_hole"){let{pcb_plated_hole_id:r,pcb_port_id:i}=o;if(i&&r)t.push([r,i])}else if(o.type==="pcb_trace"){let{pcb_trace_id:r,source_trace_id:i}=o,s=Array.isArray(o.route)?o.route.filter((a)=>a&&a.route_type==="wire"):[];if(i&&r)t.push([r,i]);if(Array.isArray(s)){let a=s.find((l)=>l?.start_pcb_port_id)?.start_pcb_port_id,c=s.find((l)=>l?.end_pcb_port_id)?.end_pcb_port_id;if(a&&r)t.push([a,r]);if(r&&c)t.push([r,c])}}else if(o.type==="pcb_via"){let{pcb_via_id:r,pcb_trace_id:i,source_trace_id:s,source_net_id:a}=o,c=[...o.pcb_port_ids??[],i,s,a].filter((l)=>Boolean(l));if(r&&c.length>0)t.push([r,...c])}else if(o.type==="source_component"){if(o.internally_connected_source_port_ids)for(let r of o.internally_connected_source_port_ids)t.push(r)}let n=fM(t);return new fx(n)},IX=class{circuitJson;traceIdToElm;portIdToElm;connMap;constructor(e){if(this.circuitJson=e||[],this.traceIdToElm=new Map,this.portIdToElm=new Map,e)this._buildTraceMap(),this._buildPortMap(),this.connMap=this._buildTraceConnectivityMap();else this.connMap=new fx({})}_buildPortMap(){for(let e of this.circuitJson)if(e.type==="pcb_port")this.portIdToElm.set(e.pcb_port_id,e)}_buildTraceMap(){for(let e of this.circuitJson)if(e.type==="pcb_trace")this.traceIdToElm.set(e.pcb_trace_id,e)}_buildTraceConnectivityMap(){let e=[],t=Array.from(this.traceIdToElm.keys());for(let n=0;n<t.length;n++)for(let o=n+1;o<t.length;o++){let r=this.traceIdToElm.get(t[n]),i=this.traceIdToElm.get(t[o]);if(this._arePcbTracesConnected(r,i))e.push([t[n],t[o]])}for(let n of this.portIdToElm.values())for(let o of this.traceIdToElm.values())for(let r of o.route)if(r.route_type==="wire"){if(r.start_pcb_port_id===n.pcb_port_id)e.push([n.pcb_port_id,o.pcb_trace_id]);else if(r.end_pcb_port_id===n.pcb_port_id)e.push([o.pcb_trace_id,n.pcb_port_id])}return new fx(fM(e))}addTrace(e){this.traceIdToElm.set(e.pcb_trace_id,e);let t=[];for(let n of e.route)if(n.route_type==="wire"){if(n.start_pcb_port_id)t.push([n.start_pcb_port_id,e.pcb_trace_id]);if(n.end_pcb_port_id)t.push([n.end_pcb_port_id,e.pcb_trace_id])}this.connMap.addConnections(t)}_arePcbTracesConnected(e,t){for(let n=0;n<e.route.length-1;n++){let o=e.route[n],r=e.route[n+1];if(o.route_type!=="wire")continue;if(r.route_type!=="wire")continue;if(o.layer!==r.layer)continue;let i=Math.min(o.x,r.x),s=Math.min(o.y,r.y),a=Math.max(o.x,r.x),c=Math.max(o.y,r.y),l=Number.isFinite(i)&&Number.isFinite(s)&&Number.isFinite(a)&&Number.isFinite(c);for(let h=0;h<t.route.length-1;h++){let d=t.route[h],u=t.route[h+1];if(d.route_type!=="wire")continue;if(u.route_type!=="wire")continue;if(d.layer!==u.layer)continue;if(o.layer!==d.layer)continue;let _=(o.width+d.width)/2,p=Math.max(0,_)+0.000000001;if(l&&Number.isFinite(d.x)&&Number.isFinite(d.y)&&Number.isFinite(u.x)&&Number.isFinite(u.y)&&Number.isFinite(_)&&(Math.min(d.x,u.x)>a+p||Math.max(d.x,u.x)<i-p||Math.min(d.y,u.y)>c+p||Math.max(d.y,u.y)<s-p))continue;if(CRe([o,r],[d,u],{lineThickness:_}))return!0}}return!1}areTracesConnected(e,t){return this.connMap.areIdsConnected(e,t)}getAllTracesConnectedToTrace(e){let t=this.connMap.getNetConnectedToId(e);return t?this.connMap.getIdsConnectedToNet(t).filter((n)=>this.traceIdToElm.has(n)).map((n)=>this.traceIdToElm.get(n)):[]}getAllTracesConnectedToPort(e){let t=this.connMap.getNetConnectedToId(e);return t?this.connMap.getIdsConnectedToNet(t).filter((n)=>this.traceIdToElm.has(n)).map((n)=>this.traceIdToElm.get(n)):[]}};var tc=El(()=>{tCt()});var PAe=()=>{};function gCt(e){e7=e}function ACt(){return e7}function PRe(e){return e<e7&&e>-e7}function WF(e,t){return e-t<e7&&e-t>-e7}function fCt(e,t){return e-t>e7}function Gxo(e,t){return e-t>-e7}function yCt(e,t){return e-t<-e7}function Uxo(e,t){return e-t<e7}class tu{static get ILLEGAL_PARAMETERS(){return ReferenceError("Illegal Parameters")}static get ZERO_DIVISION(){return Error("Zero division")}static get UNRESOLVED_BOUNDARY_CONFLICT(){return Error("Unresolved boundary conflict in boolean operation")}static get INFINITE_LOOP(){return Error("Infinite loop")}static get CANNOT_COMPLETE_BOOLEAN_OPERATION(){return Error("Cannot complete boolean operation")}static get CANNOT_INVOKE_ABSTRACT_METHOD(){return Error("Abstract method cannot be invoked")}static get OPERATION_IS_NOT_SUPPORTED(){return Error("Operation is not supported")}static get UNSUPPORTED_SHAPE_TYPE(){return Error("Unsupported shape type")}}class xCt{constructor(e=oCt){for(let t in e)this[t]=e[t];this.stroke=e.stroke??oCt.stroke}toAttributesString(){return Object.keys(this).reduce((e,t)=>e+(this[t]!==void 0?this.toAttrString(t,this[t]):""),"")}toAttrString(e,t){let n=e==="className"?"class":this.convertCamelToKebabCase(e);return t===null?`${n} `:`${n}="${t.toString()}" `}convertCamelToKebabCase(e){return e.match(/[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[0-9]+/g).join("-").toLowerCase()}}function jF(e){return new xCt(e).toAttributesString()}function wX(e,t){let n=[],[o,r,i]=e.standard,[s,a,c]=t.standard,l=o*a-r*s,h=i*a-r*c,d=o*c-i*s;if(!He.Utils.EQ_0(l)){let u,_;if(r===0)u=i/o,_=d/l;else if(a===0)u=c/s,_=d/l;else if(o===0)u=h/l,_=i/r;else if(s===0)u=h/l,_=c/a;else u=h/l,_=d/l;n.push(new He.Point(u,_))}return n}function KF(e,t){let n=[],o=t.pc.projectionOn(e),r=t.pc.distanceTo(o)[0];if(He.Utils.EQ(r,t.r))n.push(o);else if(He.Utils.LT(r,t.r)){let i=Math.sqrt(t.r*t.r-r*r),s,a;s=e.norm.rotate90CCW().multiply(i),a=o.translate(s),n.push(a),s=e.norm.rotate90CW().multiply(i),a=o.translate(s),n.push(a)}return n}function SX(e,t){let n=[];for(let o of t.toSegments()){let r=Pre(o,e);for(let i of r)if(!wCt(i,n))n.push(i)}return n}function TAe(e,t){let n=[];if(SX(e,t.box).length===0)return n;let o=new He.Circle(t.pc,t.r),r=KF(e,o);for(let i of r)if(i.on(t))n.push(i);return n}function Pre(e,t){let n=[];if(e.ps.on(t))n.push(e.ps);if(e.pe.on(t)&&!e.isZeroLength())n.push(e.pe);if(n.length>0)return n;if(e.isZeroLength())return n;if(e.ps.leftTo(t)&&e.pe.leftTo(t)||!e.ps.leftTo(t)&&!e.pe.leftTo(t))return n;let o=new He.Line(e.ps,e.pe);return wX(o,t)}function DAe(e,t){let n=[];if(e.isZeroLength()){if(e.ps.on(t))n.push(e.ps);return n}if(t.isZeroLength()){if(t.ps.on(e))n.push(t.ps);return n}let o=new He.Line(e.ps,e.pe),r=new He.Line(t.ps,t.pe);if(o.incidentTo(r)){if(e.ps.on(t))n.push(e.ps);if(e.pe.on(t))n.push(e.pe);if(t.ps.on(e)&&!t.ps.equalTo(e.ps)&&!t.ps.equalTo(e.pe))n.push(t.ps);if(t.pe.on(e)&&!t.pe.equalTo(e.ps)&&!t.pe.equalTo(e.pe))n.push(t.pe)}else if(o.parallelTo(r)){let i=new He.Vector(e.ps,e.pe),s=new He.Vector(t.ps,t.pe),a=new He.Vector(e.ps,t.ps),c=i.cross(s);if(!He.Utils.EQ_0(c)){let l=a.cross(s)/c,h=a.cross(i)/c;if(He.Utils.GE(l,0)&&He.Utils.LE(l,1)&&He.Utils.GE(h,0)&&He.Utils.LE(h,1))n.push(rCt(e.ps.translate(i.multiply(l)),e,t))}}else{let i=wX(o,r);if(i.length>0){if(iCt(i[0],e)&&iCt(i[0],t))n.push(rCt(i[0],e,t))}}return n}function rCt(e,t,n){for(let o of[t.ps,t.pe,n.ps,n.pe])if(e.equalTo(o))return o;return e}function iCt(e,t){let n=t.box;return He.Utils.LE(e.x,n.xmax)&&He.Utils.GE(e.x,n.xmin)&&He.Utils.LE(e.y,n.ymax)&&He.Utils.GE(e.y,n.ymin)}function NAe(e,t){let n=[];if(e.isZeroLength()){let[i,s]=e.ps.distanceTo(t.pc);if(He.Utils.EQ(i,t.r))n.push(e.ps);return n}let o=new He.Line(e.ps,e.pe),r=KF(o,t);for(let i of r)if(i.on(e))n.push(i);return n}function BX(e,t){let n=[];if(e.isZeroLength()){if(e.ps.on(t))n.push(e.ps);return n}let o=new He.Line(e.ps,e.pe),r=new He.Circle(t.pc,t.r),i=KF(o,r);for(let s of i)if(s.on(e)&&s.on(t))n.push(s);return n}function Wxo(e,t){let n=[];for(let o of t.toSegments()){let r=DAe(o,e);for(let i of r)n.push(i)}return n}function CCt(e,t){let n=[],o=new He.Vector(e.pc,t.pc),r=e.r,i=t.r;if(He.Utils.EQ_0(r)||He.Utils.EQ_0(i))return n;if(He.Utils.EQ_0(o.x)&&He.Utils.EQ_0(o.y)&&He.Utils.EQ(r,i))return n.push(e.pc.translate(-r,0)),n;let s=e.pc.distanceTo(t.pc)[0];if(He.Utils.GT(s,r+i))return n;if(He.Utils.LT(s,Math.abs(r-i)))return n;o.x/=s,o.y/=s;let a;if(He.Utils.EQ(s,r+i)||He.Utils.EQ(s,Math.abs(r-i)))return a=e.pc.translate(r*o.x,r*o.y),n.push(a),n;let c=r*r/(2*s)-i*i/(2*s)+s/2,l=e.pc.translate(c*o.x,c*o.y),h=Math.sqrt(r*r-c*c);return a=l.translate(o.rotate90CCW().multiply(h)),n.push(a),a=l.translate(o.rotate90CW().multiply(h)),n.push(a),n}function Xxo(e,t){let n=[];for(let o of t.toSegments()){let r=NAe(o,e);for(let i of r)n.push(i)}return n}function bCt(e,t){let n=[];if(e.pc.equalTo(t.pc)&&He.Utils.EQ(e.r,t.r)){let s;if(s=e.start,s.on(t))n.push(s);if(s=e.end,s.on(t))n.push(s);if(s=t.start,s.on(e))n.push(s);if(s=t.end,s.on(e))n.push(s);return n}let o=new He.Circle(e.pc,e.r),r=new He.Circle(t.pc,t.r),i=o.intersect(r);for(let s of i)if(s.on(e)&&s.on(t))n.push(s);return n}function RRe(e,t){let n=[];if(t.pc.equalTo(e.pc)&&He.Utils.EQ(t.r,e.r))return n.push(e.start),n.push(e.end),n;let o=t,r=new He.Circle(e.pc,e.r),i=CCt(o,r);for(let s of i)if(s.on(e))n.push(s);return n}function jxo(e,t){let n=[];for(let o of t.toSegments()){let r=BX(o,e);for(let i of r)n.push(i)}return n}function ICt(e,t){return e.isSegment?DAe(e.shape,t):BX(t,e.shape)}function vCt(e,t){return e.isSegment?BX(e.shape,t):bCt(e.shape,t)}function SCt(e,t){return e.isSegment?Pre(e.shape,t):TAe(t,e.shape)}function Kxo(e,t){return e.isSegment?LRe(t,e.shape):HRe(t,e.shape)}function $xo(e,t){return e.isSegment?NAe(e.shape,t):RRe(e.shape,t)}function QRe(e,t){let n=[];for(let o of t.edges)for(let r of ICt(o,e))n.push(r);return n}function kRe(e,t){let n=[];for(let o of t.edges)for(let r of vCt(o,e))n.push(r);return n}function Ere(e,t){let n=[];if(t.isEmpty())return n;for(let o of t.edges)for(let r of SCt(o,e))if(!wCt(r,n))n.push(r);return e.sortPoints(n)}function PCt(e,t){let n=[];if(t.isEmpty())return n;for(let o of t.edges)for(let r of $xo(o,e))n.push(r);return n}function ECt(e,t){if(e.isSegment)return ICt(t,e.shape);else if(e.isArc)return vCt(t,e.shape);else if(e.isLine)return SCt(t,e.shape);else if(e.isRay)return Kxo(t,e.shape);return[]}function MCt(e,t){let n=[];if(t.isEmpty()||e.shape.box.not_intersect(t.box))return n;let o=t.edges.search(e.shape.box);for(let r of o)n=[...n,...ECt(e,r)];return n}function qxo(e,t){let n=[];if(t.isEmpty()||e.size===0)return n;for(let o of e)n=[...n,...MCt(o,t)];return n}function Jxo(e,t){let n=[];if(e.isEmpty()||t.isEmpty())return n;if(e.box.not_intersect(t.box))return n;for(let o of e.edges)n=[...n,...MCt(o,t)];return n}function Zxo(e,t){if(e instanceof He.Line)return Ere(e,t);else if(e instanceof He.Segment)return QRe(e,t);else if(e instanceof He.Arc)return kRe(e,t);else return[]}function wCt(e,t){return t.some((n)=>n.equalTo(e))}function BN(e){return new He.Line(e.start,e.norm)}function LRe(e,t){return Pre(t,BN(e)).filter((n)=>e.contains(n))}function HRe(e,t){return TAe(BN(e),t).filter((n)=>e.contains(n))}function BCt(e,t){return KF(BN(e),t).filter((n)=>e.contains(n))}function e5o(e,t){return SX(BN(e),t).filter((n)=>e.contains(n))}function TCt(e,t){return wX(BN(e),t).filter((n)=>e.contains(n))}function t5o(e,t){return wX(BN(e),BN(t)).filter((n)=>e.contains(n)).filter((n)=>t.contains(n))}function DCt(e,t){return Ere(BN(e),t).filter((n)=>e.contains(n))}function NCt(e,t){if(e.intersect&&e.intersect instanceof Function)return e.intersect(t);throw tu.UNSUPPORTED_SHAPE_TYPE}function TX(e,t){let n=[];for(let o of t)n=[...n,...NCt(e,o.shape)];return n}function n5o(e,t){let n=[];for(let o of e)for(let r of t)n=[...n,...NCt(o.shape,r.shape)];return n}function PX(e,t,n){let o=n.length,r=e.shape.split(t);if(r.length===0)return;let i=0;if(r[0]===null)i=0;else if(r[1]===null)i=e.shape.length;else i=r[0].length;let s=0;if(WF(i,0))s|=1;if(WF(i,e.shape.length))s|=2;let a;if(i===1/0)a=r[0].coord(t);else a=s&2&&e.next&&e.next.arc_length===0?0:e.arc_length+i;n.push({id:o,pt:t,arc_length:a,edge_before:e,edge_after:void 0,face:e.face,is_vertex:s})}function vre(e){e.int_points1_sorted=wN(e.int_points1),e.int_points2_sorted=wN(e.int_points2)}function wN(e){let t=new Map,n=0;for(let r of e)if(!t.has(r.face))t.set(r.face,n),n++;for(let r of e)r.faceId=t.get(r.face);return e.slice().sort(r5o)}function r5o(e,t){if(e.faceId<t.faceId)return-1;if(e.faceId>t.faceId)return 1;if(e.arc_length<t.arc_length)return-1;if(e.arc_length>t.arc_length)return 1;return 0}function FRe(e){if(e.int_points1.length<2)return;let t=!1,n,o,r,i;for(let s=0;s<e.int_points1_sorted.length;s++){if(e.int_points1_sorted[s].id===-1)continue;n=e.int_points1_sorted[s],o=e.int_points2[n.id];for(let a=s+1;a<e.int_points1_sorted.length;a++){if(r=e.int_points1_sorted[a],!WF(r.arc_length,n.arc_length))break;if(r.id===-1)continue;if(i=e.int_points2[r.id],i.id===-1)continue;if(r.edge_before===n.edge_before&&r.edge_after===n.edge_after&&i.edge_before===o.edge_before&&i.edge_after===o.edge_after)r.id=-1,i.id=-1,t=!0}}o=e.int_points2_sorted[0],n=e.int_points1[o.id];for(let s=1;s<e.int_points2_sorted.length;s++){let a=e.int_points2_sorted[s];if(a.id===-1)continue;if(o.id===-1||!WF(a.arc_length,o.arc_length)){o=a,n=e.int_points1[o.id];continue}let c=e.int_points1[a.id];if(c.edge_before===n.edge_before&&c.edge_after===n.edge_after&&a.edge_before===o.edge_before&&a.edge_after===o.edge_after)c.id=-1,a.id=-1,t=!0}if(t)e.int_points1=e.int_points1.filter((s)=>s.id>=0),e.int_points2=e.int_points2.filter((s)=>s.id>=0),e.int_points1.forEach((s,a)=>s.id=a),e.int_points2.forEach((s,a)=>s.id=a)}function ERe(e){for(let t of e){if(t.edge_before)t.edge_before.bvStart=void 0,t.edge_before.bvEnd=void 0,t.edge_before.bv=void 0,t.edge_before.overlap=void 0;if(t.edge_after)t.edge_after.bvStart=void 0,t.edge_after.bvEnd=void 0,t.edge_after.bv=void 0,t.edge_after.overlap=void 0}for(let t of e){if(t.edge_before)t.edge_before.bvEnd=2;if(t.edge_after)t.edge_after.bvStart=2}}function MRe(e,t){for(let n of e){if(n.edge_before)n.edge_before.setInclusion(t);if(n.edge_after)n.edge_after.setInclusion(t)}}function i5o(e){let t=void 0,n=void 0,o=void 0,r=e.int_points1.length;for(let i=0;i<r;i++){let s=e.int_points1_sorted[i];if(s.face!==t)n=i,t=s.face;let a=i,c=EX(e.int_points1_sorted,i,t),l;if(a+c<r&&e.int_points1_sorted[a+c].face===t)l=a+c;else l=n;let h=EX(e.int_points1_sorted,l,t);o=null;for(let g=l;g<l+h;g++){let f=e.int_points1_sorted[g];if(f.face===t&&e.int_points2[f.id].face===e.int_points2[s.id].face){o=f;break}}if(o===null)continue;let d=s.edge_after,u=o.edge_before;if(!(d.bv===2&&u.bv===2))continue;if(d!==u)continue;let _=e.int_points2[s.id],p=e.int_points2[o.id],m=_.edge_after,A=p.edge_before;if(!(m.bv===2&&A.bv===2&&m===A))_=e.int_points2[o.id],p=e.int_points2[s.id],m=_.edge_after,A=p.edge_before;if(!(m.bv===2&&A.bv===2&&m===A))continue;d.setOverlap(m)}}function EX(e,t,n){let o,r,i=1;if(e.length===1)return 1;o=e[t];for(let s=t+1;s<e.length;s++){if(o.face!==n)break;if(r=e[s],!(r.pt.equalTo(o.pt)&&r.edge_before===o.edge_before&&r.edge_after===o.edge_after))break;i++}return i}function MX(e,t){if(!t)return;for(let n of t){let o=n.edge_before;if(n.is_vertex=0,o.shape.start&&o.shape.start.equalTo(n.pt))n.is_vertex|=1;if(o.shape.end&&o.shape.end.equalTo(n.pt))n.is_vertex|=2;if(n.is_vertex&1){if(n.edge_before=o.prev,o.prev)n.is_vertex=2;continue}if(n.is_vertex&2)continue;let r=e.addVertex(n.pt,o);n.edge_before=r}for(let n of t)if(n.edge_before)n.edge_after=n.edge_before.next;else if(e instanceof $F&&n.is_vertex&1)n.edge_after=e.first}function sCt(e,t,n){let o=e.edge_before,r=t.edge_after,i=n.length;o.next=n[0],n[0].prev=o,n[i-1].next=r,r.prev=n[i-1]}function c5o(e,t){let[n,o]=wre(e,t,RAe,!0);return n}function wRe(e,t){let o=t.clone().reverse(),[r,i]=wre(e,o,XF,!0);return r}function RCt(e,t){let[n,o]=wre(e,t,Mre,!0);return n}function QCt(e,t){let[n,o]=wre(e,t,Mre,!1),r=[];for(let s of n.faces)r=[...r,...[...s.edges].map((a)=>a.shape)];let i=[];for(let s of o.faces)i=[...i,...[...s.edges].map((a)=>a.shape)];return[r,i]}function BRe(e,t){let[n,o]=wre(e,t,XF,!1),r=[];for(let i of n.faces)r=[...r,...[...i.edges].map((s)=>s.shape)];return r}function kCt(e,t){let n=e.clone(),o=t.clone(),r=LCt(n,o);vre(r),MX(n,r.int_points1_sorted),MX(o,r.int_points2_sorted),FRe(r),vre(r);let i=r.int_points1_sorted.map((a)=>a.pt),s=r.int_points2_sorted.map((a)=>a.pt);return[i,s]}function l5o(e,t,n,o){let r=lCt(e,n.int_points1),i=lCt(t,n.int_points2);hCt(r,t),hCt(i,e),ERe(n.int_points1),ERe(n.int_points2),MRe(n.int_points1,t),MRe(n.int_points2,e);while(d5o(e,t,n.int_points1,n.int_points1_sorted,n.int_points2,n));i5o(n),TRe(e,o,n.int_points1_sorted,!0),TRe(t,o,n.int_points2_sorted,!1),dCt(e,r,o,!0),dCt(t,i,o,!1)}function h5o(e,t,n,o){u5o(e,t,o,n.int_points2),p5o(e,t,n),DRe(e,n.int_points1),DRe(t,n.int_points2),NRe(e,n.int_points1,n.int_points2),NRe(e,n.int_points2,n.int_points1),uCt(e),uCt(t)}function wre(e,t,n,o){let r=e.clone(),i=t.clone(),s=LCt(r,i);if(vre(s),MX(r,s.int_points1_sorted),MX(i,s.int_points2_sorted),FRe(s),vre(s),l5o(r,i,s,n),o)h5o(r,i,s,n);return[r,i]}function LCt(e,t){let n={int_points1:[],int_points2:[]};for(let o of e.edges){let r=t.edges.search(o.box);for(let i of r){let s=o.shape.intersect(i.shape);for(let a of s)PX(o,a,n.int_points1),PX(i,a,n.int_points2)}}return n}function lCt(e,t){let n=[];for(let o of e.faces)if(!t.find((r)=>r.face===o))n.push(o);return n}function hCt(e,t){for(let n of e)n.first.bv=n.first.bvStart=n.first.bvEnd=void 0,n.first.setInclusion(t)}function d5o(e,t,n,o,r,i){let s,a,c,l=o.length,h=!1;for(let d=0;d<l;d++){let u=o[d];if(u.face!==s)a=d,s=u.face;let _=d,p=EX(o,d,s),m;if(_+p<l&&o[_+p].face===s)m=_+p;else m=a;let A=EX(o,m,s);c=null;for(let y=m;y<m+A;y++){let x=o[y];if(x.face===s&&r[x.id].face===r[u.id].face){c=x;break}}if(c===null)continue;let g=u.edge_after,f=c.edge_before;if(g.bv===oA&&f.bv!=oA){g.bv=f.bv;continue}if(g.bv!=oA&&f.bv===oA){f.bv=g.bv;continue}if(g.bv===oA&&f.bv===oA&&g!=f||(g.bv===J8&&f.bv===Z8||g.bv===Z8&&f.bv===J8)){let y=g.next;while(y!=f)y.bvStart=void 0,y.bvEnd=void 0,y.bv=void 0,y.setInclusion(t),y=y.next}if(g.bv===oA&&f.bv===oA&&g!=f){let y=g.next,x;while(y!=f){if(y.bv!=oA){if(x===void 0)x=y.bv;else if(y.bv!=x)throw tu.UNRESOLVED_BOUNDARY_CONFLICT}y=y.next}if(x!=null)g.bv=x,f.bv=x;continue}if(g.bv===J8&&f.bv===Z8||g.bv===Z8&&f.bv===J8){let y=g;while(y!=f){if(y.bvStart===g.bv&&y.bvEnd===f.bv){let[x,C]=y.shape.distanceTo(t);if(x<10*He.DP_TOL){PX(y,C.ps,n);let b=n[n.length-1];if(b.is_vertex&aCt)b.edge_after=y,b.edge_before=y.prev,y.bvStart=oA,y.bv=void 0,y.setInclusion(t);else if(b.is_vertex&cCt)b.edge_after=y.next,y.bvEnd=oA,y.bv=void 0,y.setInclusion(t);else{let P=t.addVertex(b.pt,y);b.edge_before=P,b.edge_after=P.next,P.setInclusion(t),P.next.bvStart=oA,P.next.bvEnd=void 0,P.next.bv=void 0,P.next.setInclusion(t)}let I=t.findEdgeByPoint(C.pe);PX(I,C.pe,r);let v=r[r.length-1];if(v.is_vertex&aCt)v.edge_after=I,v.edge_before=I.prev;else if(v.is_vertex&cCt)v.edge_after=I.next;else{let P=r.find((B)=>B.edge_after===I),M=t.addVertex(v.pt,I);if(v.edge_before=M,v.edge_after=M.next,P)P.edge_after=M;M.bvStart=void 0,M.bvEnd=oA,M.bv=void 0,M.setInclusion(e),M.next.bvStart=oA,M.next.bvEnd=void 0,M.next.bv=void 0,M.next.setInclusion(e)}vre(i),h=!0;break}}y=y.next}if(h)break;throw tu.UNRESOLVED_BOUNDARY_CONFLICT}}return h}function TRe(e,t,n,o){if(!n)return;let r=void 0,i=void 0,s,a;for(let c=0;c<n.length;c++){if(s=n[c],s.face!==r)i=c,r=s.face;if(r.isEmpty())continue;let l=c,h=EX(n,c,r),d;if(l+h<n.length&&n[l+h].face===s.face)d=l+h;else d=i;a=n[d];let u=d,_=EX(n,u,r),p=s.edge_after,m=a.edge_before;if(p.bv===J8&&m.bv===J8&&t===RAe||p.bv===Z8&&m.bv===Z8&&t===Mre||(p.bv===Z8||m.bv===Z8)&&t===XF&&!o||(p.bv===J8||m.bv===J8)&&t===XF&&o||p.bv===oA&&m.bv===oA&&p.overlap&s5o&&o||p.bv===oA&&m.bv===oA&&p.overlap&a5o){e.removeChain(r,p,m);for(let A=l;A<l+h;A++)n[A].edge_after=void 0;for(let A=u;A<u+_;A++)n[A].edge_before=void 0}c+=h-1}}function u5o(e,t,n,o){for(let r of t.faces){for(let i of r)e.edges.add(i);if(o.find((i)=>i.face===r)===void 0)e.addFace(r.first,r.last)}}function p5o(e,t,n){if(n.int_points1.length===0)return;for(let o=0;o<n.int_points1.length;o++){let r=n.int_points1[o],i=n.int_points2[o];if(r.edge_before!==void 0&&r.edge_after===void 0){if(i.edge_before===void 0&&i.edge_after!==void 0)r.edge_before.next=i.edge_after,i.edge_after.prev=r.edge_before,r.edge_after=i.edge_after,i.edge_before=r.edge_before}if(i.edge_before!==void 0&&i.edge_after===void 0){if(r.edge_before===void 0&&r.edge_after!==void 0)i.edge_before.next=r.edge_after,r.edge_after.prev=i.edge_before,i.edge_after=r.edge_after,r.edge_before=i.edge_before}if(r.edge_before!==void 0&&r.edge_after===void 0)for(let s of n.int_points1_sorted){if(s===r)continue;if(s.edge_before===void 0&&s.edge_after!==void 0){if(s.pt.equalTo(r.pt))r.edge_before.next=s.edge_after,s.edge_after.prev=r.edge_before,r.edge_after=s.edge_after,s.edge_before=r.edge_before}}if(i.edge_before!==void 0&&i.edge_after===void 0)for(let s of n.int_points2_sorted){if(s===i)continue;if(s.edge_before===void 0&&s.edge_after!==void 0){if(s.pt.equalTo(i.pt))i.edge_before.next=s.edge_after,s.edge_after.prev=i.edge_before,i.edge_after=s.edge_after,s.edge_before=i.edge_before}}}}function DRe(e,t){for(let n of t){if(e.faces.delete(n.face),n.face=void 0,n.edge_before)n.edge_before.face=void 0;if(n.edge_after)n.edge_after.face=void 0}}function NRe(e,t,n){for(let o of t){if(o.edge_before===void 0||o.edge_after===void 0)continue;if(o.face)continue;if(o.edge_after.face||o.edge_before.face)continue;let{edge_after:r,edge_before:i}=o;try{BAe.testInfiniteLoop(r)}catch(a){throw tu.CANNOT_COMPLETE_BOOLEAN_OPERATION}let s=e.addFace(r,i);for(let a of t)if(a.edge_before&&a.edge_after&&a.edge_before.face===s&&a.edge_after.face===s)a.face=s;for(let a of n)if(a.edge_before&&a.edge_after&&a.edge_before.face===s&&a.edge_after.face===s)a.face=s}}function dCt(e,t,n,o){for(let r of t){let i=r.first.bv;if(n===RAe&&i===J8||n===XF&&i===J8&&o||n===XF&&i===Z8&&!o||n===Mre&&i===Z8)e.deleteFace(r)}}function uCt(e){let t=[];for(let n of e.edges)if(!n.face||!e.faces.has(n.face))t.push(n);for(let n of t)e.edges.delete(n)}class qF{constructor(){this.m=[,,,,,,,,,].fill(void 0)}get I2I(){return this.m[0]}set I2I(e){this.m[0]=e}get I2B(){return this.m[1]}set I2B(e){this.m[1]=e}get I2E(){return this.m[2]}set I2E(e){this.m[2]=e}get B2I(){return this.m[3]}set B2I(e){this.m[3]=e}get B2B(){return this.m[4]}set B2B(e){this.m[4]=e}get B2E(){return this.m[5]}set B2E(e){this.m[5]=e}get E2I(){return this.m[6]}set E2I(e){this.m[6]=e}get E2B(){return this.m[7]}set E2B(e){this.m[7]=e}get E2E(){return this.m[8]}set E2E(e){this.m[8]=e}toString(){return this.m.map((e)=>{if(e instanceof Array&&e.length>0)return"T";else if(e instanceof Array&&e.length===0)return"F";else return"*"}).join("")}equal(){return m5o.test(this.toString())}intersect(){return _5o.test(this.toString())}touch(){return g5o.test(this.toString())}inside(){return A5o.test(this.toString())}covered(){return f5o.test(this.toString())}}function bre(e,t){let n=void 0,o=new He.Ray(t),r=new He.Line(o.pt,o.norm),i=new He.Box(o.box.xmin-He.DP_TOL,o.box.ymin-He.DP_TOL,o.box.xmax+He.DP_TOL,o.box.ymax+He.DP_TOL);if(e.box.not_intersect(i))return He.OUTSIDE;let s=e.edges.search(i);if(s.length===0)return He.OUTSIDE;for(let h of s)if(h.shape.contains(t))return He.BOUNDARY;let a=[...e.faces],c=[];for(let h of s)for(let d of o.intersect(h.shape)){if(d.equalTo(t))return He.BOUNDARY;c.push({pt:d,edge:h,face_index:a.indexOf(h.face)})}c.sort((h,d)=>{if(yCt(h.pt.x,d.pt.x))return-1;if(fCt(h.pt.x,d.pt.x))return 1;if(h.face_index<d.face_index)return-1;if(h.face_index>d.face_index)return 1;if(h.edge.arc_length<d.edge.arc_length)return-1;if(h.edge.arc_length>d.edge.arc_length)return 1;return 0});let l=0;for(let h=0;h<c.length;h++){let d=c[h];if(d.pt.equalTo(d.edge.shape.start)){if(h>0&&d.pt.equalTo(c[h-1].pt)&&d.face_index===c[h-1].face_index&&d.edge.prev===c[h-1].edge)continue;let u=d.edge.prev;while(PRe(u.length))u=u.prev;let _=u.shape.tangentInEnd(),p=d.pt.translate(_),m=d.edge.shape.tangentInStart(),A=d.pt.translate(m),g=p.leftTo(r),f=A.leftTo(r);if(g&&!f||!g&&f)l++}else if(d.pt.equalTo(d.edge.shape.end)){if(h>0&&d.pt.equalTo(c[h-1].pt)&&d.face_index===c[h-1].face_index&&d.edge.next===c[h-1].edge)continue;let u=d.edge.next;while(PRe(u.length))u=u.next;let _=u.shape.tangentInStart(),p=d.pt.translate(_),m=d.edge.shape.tangentInEnd(),A=d.pt.translate(m),g=p.leftTo(r),f=A.leftTo(r);if(g&&!f||!g&&f)l++}else if(d.edge.shape instanceof He.Segment)l++;else{let u=d.edge.shape.box;if(!(WF(d.pt.y,u.ymin)||WF(d.pt.y,u.ymax)))l++}}return n=l%2===1?1:0,n}function y5o(e,t){return NX(e,t).equal()}function HCt(e,t){return NX(e,t).intersect()}function x5o(e,t){return NX(e,t).touch()}function C5o(e,t){return!HCt(e,t)}function FCt(e,t){return NX(e,t).inside()}function zCt(e,t){return NX(e,t).covered()}function b5o(e,t){return FCt(t,e)}function OCt(e,t){return zCt(t,e)}function NX(e,t){if(e instanceof He.Line&&t instanceof He.Line)return I5o(e,t);else if(e instanceof He.Line&&t instanceof He.Circle)return v5o(e,t);else if(e instanceof He.Line&&t instanceof He.Box)return S5o(e,t);else if(e instanceof He.Line&&t instanceof He.Polygon)return P5o(e,t);else if((e instanceof He.Segment||e instanceof He.Arc)&&t instanceof He.Polygon)return pCt(e,t);else if((e instanceof He.Segment||e instanceof He.Arc)&&(t instanceof He.Circle||t instanceof He.Box))return pCt(e,new He.Polygon(t));else if(e instanceof He.Polygon&&t instanceof He.Polygon)return EAe(e,t);else if((e instanceof He.Circle||e instanceof He.Box)&&(t instanceof He.Circle||t instanceof He.Box))return EAe(new He.Polygon(e),new He.Polygon(t));else if((e instanceof He.Circle||e instanceof He.Box)&&t instanceof He.Polygon)return EAe(new He.Polygon(e),t);else if(e instanceof He.Polygon&&(t instanceof He.Circle||t instanceof He.Box))return EAe(e,new He.Polygon(t))}function I5o(e,t){let n=new qF,o=wX(e,t);if(o.length===0)if(e.contains(t.pt)&&t.contains(e.pt))n.I2I=[e],n.I2E=[],n.E2I=[];else n.I2I=[],n.I2E=[e],n.E2I=[t];else n.I2I=o,n.I2E=e.split(o),n.E2I=t.split(o);return n}function v5o(e,t){let n=new qF,o=KF(e,t);if(o.length===0)n.I2I=[],n.I2B=[],n.I2E=[e],n.E2I=[t];else if(o.length===1)n.I2I=[],n.I2B=o,n.I2E=e.split(o),n.E2I=[t];else{let r=new $F([e]),i=e.sortPoints(o);r.split(i);let s=r.toShapes();n.I2I=[s[1]],n.I2B=i,n.I2E=[s[0],s[2]],n.E2I=new He.Polygon([t.toArc()]).cutWithLine(e)}return n}function S5o(e,t){let n=new qF,o=SX(e,t);if(o.length===0)n.I2I=[],n.I2B=[],n.I2E=[e],n.E2I=[t];else if(o.length===1)n.I2I=[],n.I2B=o,n.I2E=e.split(o),n.E2I=[t];else{let r=new $F([e]),i=e.sortPoints(o);r.split(i);let s=r.toShapes();if(t.toSegments().some((a)=>a.contains(o[0])&&a.contains(o[1])))n.I2I=[],n.I2B=[s[1]],n.I2E=[s[0],s[2]],n.E2I=[t];else n.I2I=[s[1]],n.I2B=i,n.I2E=[s[0],s[2]],n.E2I=new He.Polygon(t.toSegments()).cutWithLine(e)}return n}function P5o(e,t){let n=new qF,o=Ere(e,t),r=new $F([e]),i=o.length>0?o.slice():e.sortPoints(o);return r.split(i),[...r].forEach((s)=>s.setInclusion(t)),n.I2I=[...r].filter((s)=>s.bv===He.INSIDE).map((s)=>s.shape),n.I2B=[...r].slice(1).map((s)=>s.bv===He.BOUNDARY?s.shape:s.shape.start),n.I2E=[...r].filter((s)=>s.bv===He.OUTSIDE).map((s)=>s.shape),n.E2I=t.cutWithLine(e),n}function pCt(e,t){let n=new qF,o=Zxo(e,t),r=o.length>0?o.slice():e.sortPoints(o),i=new $F([e]);i.split(r),[...i].forEach((s)=>s.setInclusion(t)),n.I2I=[...i].filter((s)=>s.bv===He.INSIDE).map((s)=>s.shape),n.I2B=[...i].slice(1).map((s)=>s.bv===He.BOUNDARY?s.shape:s.shape.start),n.I2E=[...i].filter((s)=>s.bv===He.OUTSIDE).map((s)=>s.shape),n.B2I=[],n.B2B=[],n.B2E=[];for(let s of[e.start,e.end])switch(bre(t,s)){case He.INSIDE:n.B2I.push(s);break;case He.BOUNDARY:n.B2B.push(s);break;case He.OUTSIDE:n.B2E.push(s);break}return n}function EAe(e,t){let n=new qF,[o,r]=kCt(e,t),i=RCt(e,t),s=wRe(e,t),a=wRe(t,e),[c,l]=QCt(e,t),h=BRe(e,t),d=BRe(t,e);return n.I2I=i.isEmpty()?[]:[i],n.I2B=l,n.I2E=s.isEmpty()?[]:[s],n.B2I=c,n.B2B=o,n.B2E=h,n.E2I=a.isEmpty()?[]:[a],n.E2B=d,n}class Cf{constructor(e=1,t=0,n=0,o=1,r=0,i=0){this.a=e,this.b=t,this.c=n,this.d=o,this.tx=r,this.ty=i}fromMatrix3x3(e){let[t,n,o]=e[0],[r,i,s]=e[1];return new Cf(t,r,n,i,o,s)}toMatrix3x3(){return[[this.a,this.c,this.tx],[this.b,this.d,this.ty],[0,0,1]]}clone(){return new Cf(this.a,this.b,this.c,this.d,this.tx,this.ty)}transform(e){return[e[0]*this.a+e[1]*this.c+this.tx,e[0]*this.b+e[1]*this.d+this.ty]}multiply(e){return new Cf(this.a*e.a+this.c*e.b,this.b*e.a+this.d*e.b,this.a*e.c+this.c*e.d,this.b*e.c+this.d*e.d,this.a*e.tx+this.c*e.ty+this.tx,this.b*e.tx+this.d*e.ty+this.ty)}translate(...e){let t,n;if(e.length==1&&!isNaN(e[0].x)&&!isNaN(e[0].y))t=e[0].x,n=e[0].y;else if(e.length===2&&typeof e[0]=="number"&&typeof e[1]=="number")t=e[0],n=e[1];else throw tu.ILLEGAL_PARAMETERS;return this.multiply(new Cf(1,0,0,1,t,n))}rotate(e,t=0,n=0){let o=Math.cos(e),r=Math.sin(e);return this.translate(t,n).multiply(new Cf(o,r,-r,o,0,0)).translate(-t,-n)}scale(e,t){return this.multiply(new Cf(e,0,0,t,0,0))}equalTo(e){if(!He.Utils.EQ(this.tx,e.tx))return!1;if(!He.Utils.EQ(this.ty,e.ty))return!1;if(!He.Utils.EQ(this.a,e.a))return!1;if(!He.Utils.EQ(this.b,e.b))return!1;if(!He.Utils.EQ(this.c,e.c))return!1;if(!He.Utils.EQ(this.d,e.d))return!1;return!0}}class VCt{constructor(e,t){this.low=e,this.high=t}get max(){return this.clone()}less_than(e){return this.low<e.low||this.low===e.low&&this.high<e.high}equal_to(e){return this.low===e.low&&this.high===e.high}intersect(e){return!this.not_intersect(e)}not_intersect(e){return this.high<e.low||e.high<this.low}merge(e){let t=this.low===void 0?e.low:this.low<e.low?this.low:e.low,n=this.high===void 0?e.high:this.high>e.high?this.high:e.high,o=this.clone();return o.low=t,o.high=n,o}output(){return[this.low,this.high]}comparable_less_than(e,t){return e<t}}class yM{constructor(e,t,n=null,o=null,r=null,i=wh){if(this.left=n,this.right=o,this.parent=r,this.color=i,this.item={key:void 0,values:[]},t!==void 0)this.item.values.push(t);if(e!==void 0)if(Array.isArray(e)){let[s,a]=e;if(!Number.isNaN(s)&&!Number.isNaN(a)){let c=s,l=a;if(c>l)[c,l]=[l,c];this.item.key=new zRe(c,l)}}else this.item.key=e;this.max=this.item.key?this.item.key.max:void 0}isNil(){return this.item.key===void 0&&this.item.values.length===0&&this.left===null&&this.right===null&&this.color===wh}requireKey(){if(!this.item.key)throw Error("Node key is undefined (nil/sentinel). Operation is not applicable.");return this.item.key}less_than(e){let t=this.requireKey(),n=e.requireKey();return t.less_than(n)}_value_equal(e){let t=this.item.values[0],n=e.item.values[0];return t&&n&&t.equal_to?t.equal_to(n):t===n}equal_to(e){let t=this.requireKey(),n=e.requireKey();return t.equal_to(n)}intersect(e){let t=this.requireKey(),n=e.requireKey();return t.intersect(n)}copy_data(e){this.item.key=e.item.key,this.item.values=e.item.values.slice()}update_max(){if(this.max=this.item.key?this.item.key.max:void 0,this.right&&this.right.max)this.max=this.max?this.max.merge(this.right.max):this.right.max;if(this.left&&this.left.max)this.max=this.max?this.max.merge(this.left.max):this.left.max}not_intersect_left_subtree(e){if(!this.left)return!0;let t=this.left.max?this.left.max.high:this.left.item.key.high,n=this.requireKey(),o=e.requireKey();return n.comparable_less_than(t,o.low)}not_intersect_right_subtree(e){if(!this.right)return!0;let t=this.right.max?this.right.max.low:this.right.item.key.low,n=this.requireKey(),o=e.requireKey();return n.comparable_less_than(o.high,t)}}class Sre{constructor(){this.root=null,this.nil_node=new yM}get size(){let e=0;return this.tree_walk(this.root,(t)=>e+=t.item.values.length),e}get keys(){let e=[];return this.tree_walk(this.root,(t)=>e.push(t.item.key.output())),e}get values(){let e=[];return this.tree_walk(this.root,(t)=>{for(let n of t.item.values)e.push(n)}),e}get items(){let e=[];return this.tree_walk(this.root,(t)=>{let n=t.item.key.output();for(let o of t.item.values)e.push({key:n,value:o})}),e}isEmpty(){return this.root==null||this.root===this.nil_node}clear(){this.root=null}insert(e,t=e){if(e===void 0)return;let n=this.tree_search(this.root,new yM(e));if(n)return n.item.values.push(t),n;let o=new yM(e,t,this.nil_node,this.nil_node,null,xf);return this.tree_insert(o),this.recalc_max(o),o}exist(e,t=e){let n=this.tree_search(this.root,new yM(e));if(!n)return!1;if(arguments.length<2||t===e)return!0;return n.item.values.some((o)=>o&&o.equal_to?o.equal_to(t):o===t)}remove(e,t=e){let n=this.tree_search(this.root,new yM(e));if(!n)return;if(arguments.length<2)return this.tree_delete(n),n;let o=n.item.values.findIndex((r)=>r&&r.equal_to?r.equal_to(t):r===t);if(o>=0){if(n.item.values.splice(o,1),n.item.values.length===0)this.tree_delete(n);return n}return}search(e,t=(n,o)=>n===o?o.output():n){let n=new yM(e),o=[];this.tree_search_interval(this.root,n,o);let r=[];for(let i of o)for(let s of i.item.values)r.push(t(s,i.item.key));return r}intersect_any(e){let t=new yM(e);return this.tree_find_any_interval(this.root,t)}forEach(e){this.tree_walk(this.root,(t)=>{for(let n of t.item.values)e(t.item.key,n)})}map(e){let t=new Sre;return this.tree_walk(this.root,(n)=>{for(let o of n.item.values)t.insert(n.item.key,e(o,n.item.key))}),t}*iterate(e,t=(n,o)=>n===o?o.output():n){let n=null;if(e)n=this.tree_search_nearest_forward(this.root,new yM(e));else if(this.root)n=this.local_minimum(this.root);while(n){for(let o of n.item.values)yield t(o,n.item.key);n=this.tree_successor(n)}}recalc_max(e){let t=e;while(t.parent!=null)t.parent.update_max(),t=t.parent}tree_insert(e){let t=this.root,n=null;if(this.root==null||this.root===this.nil_node)this.root=e;else{while(t!==this.nil_node)if(n=t,e.less_than(t))t=t.left;else t=t.right;if(e.parent=n,e.less_than(n))n.left=e;else n.right=e}this.insert_fixup(e)}insert_fixup(e){let t,n;t=e;while(t!==this.root&&t.parent.color===xf)if(t.parent===t.parent.parent.left)if(n=t.parent.parent.right,n.color===xf)t.parent.color=wh,n.color=wh,t.parent.parent.color=xf,t=t.parent.parent;else{if(t===t.parent.right)t=t.parent,this.rotate_left(t);t.parent.color=wh,t.parent.parent.color=xf,this.rotate_right(t.parent.parent)}else if(n=t.parent.parent.left,n.color===xf)t.parent.color=wh,n.color=wh,t.parent.parent.color=xf,t=t.parent.parent;else{if(t===t.parent.left)t=t.parent,this.rotate_right(t);t.parent.color=wh,t.parent.parent.color=xf,this.rotate_left(t.parent.parent)}this.root.color=wh}tree_delete(e){let t,n;if(e.left===this.nil_node||e.right===this.nil_node)t=e;else t=this.tree_successor(e);if(t.left!==this.nil_node)n=t.left;else n=t.right;if(n.parent=t.parent,t===this.root)this.root=n;else{if(t===t.parent.left)t.parent.left=n;else t.parent.right=n;t.parent.update_max()}if(this.recalc_max(n),t!==e)e.copy_data(t),e.update_max(),this.recalc_max(e);if(t.color===wh)this.delete_fixup(n)}delete_fixup(e){let t=e,n;while(t!==this.root&&t.parent!=null&&t.color===wh)if(t===t.parent.left){if(n=t.parent.right,n.color===xf)n.color=wh,t.parent.color=xf,this.rotate_left(t.parent),n=t.parent.right;if(n.left.color===wh&&n.right.color===wh)n.color=xf,t=t.parent;else{if(n.right.color===wh)n.color=xf,n.left.color=wh,this.rotate_right(n),n=t.parent.right;n.color=t.parent.color,t.parent.color=wh,n.right.color=wh,this.rotate_left(t.parent),t=this.root}}else{if(n=t.parent.left,n.color===xf)n.color=wh,t.parent.color=xf,this.rotate_right(t.parent),n=t.parent.left;if(n.left.color===wh&&n.right.color===wh)n.color=xf,t=t.parent;else{if(n.left.color===wh)n.color=xf,n.right.color=wh,this.rotate_left(n),n=t.parent.left;n.color=t.parent.color,t.parent.color=wh,n.left.color=wh,this.rotate_right(t.parent),t=this.root}}t.color=wh}tree_search(e,t){if(e==null||e===this.nil_node)return;if(t.equal_to(e))return e;if(t.less_than(e))return this.tree_search(e.left,t);else return this.tree_search(e.right,t)}tree_search_nearest_forward(e,t){let n=null,o=e;while(o&&o!==this.nil_node)if(o.less_than(t))if(o.intersect(t))n=o,o=o.left;else o=o.right;else{if(!n||o.less_than(n))n=o;o=o.left}return n||null}tree_search_interval(e,t,n){if(e!=null&&e!==this.nil_node){if(e.left!==this.nil_node&&!e.not_intersect_left_subtree(t))this.tree_search_interval(e.left,t,n);if(e.intersect(t))n.push(e);if(e.right!==this.nil_node&&!e.not_intersect_right_subtree(t))this.tree_search_interval(e.right,t,n)}}tree_find_any_interval(e,t){let n=!1;if(e!=null&&e!==this.nil_node){if(e.left!==this.nil_node&&!e.not_intersect_left_subtree(t))n=this.tree_find_any_interval(e.left,t);if(!n)n=e.intersect(t);if(!n&&e.right!==this.nil_node&&!e.not_intersect_right_subtree(t))n=this.tree_find_any_interval(e.right,t)}return n}local_minimum(e){let t=e;while(t.left!=null&&t.left!==this.nil_node)t=t.left;return t}local_maximum(e){let t=e;while(t.right!=null&&t.right!==this.nil_node)t=t.right;return t}tree_successor(e){let t,n,o;if(e.right!==this.nil_node)t=this.local_minimum(e.right);else{n=e,o=e.parent;while(o!=null&&o.right===n)n=o,o=o.parent;t=o}return t}rotate_left(e){let t=e.right;if(e.right=t.left,t.left!==this.nil_node)t.left.parent=e;if(t.parent=e.parent,e===this.root)this.root=t;else if(e===e.parent.left)e.parent.left=t;else e.parent.right=t;if(t.left=e,e.parent=t,e!==null&&e!==this.nil_node)e.update_max();if(t!=null&&t!==this.nil_node)t.update_max()}rotate_right(e){let t=e.left;if(e.left=t.right,t.right!==this.nil_node)t.right.parent=e;if(t.parent=e.parent,e===this.root)this.root=t;else if(e===e.parent.left)e.parent.left=t;else e.parent.right=t;if(t.right=e,e.parent=t,e!==null&&e!==this.nil_node)e.update_max();if(t!=null&&t!==this.nil_node)t.update_max()}tree_walk(e,t){if(e!=null&&e!==this.nil_node)this.tree_walk(e.left,t),t(e),this.tree_walk(e.right,t)}testRedBlackProperty(){let e=!0;return this.tree_walk(this.root,function(t){if(t.color===xf){if(!(t.left.color===wh&&t.right.color===wh))e=!1}}),e}testBlackHeightProperty(e){let t=0,n=0,o=0;if(e.color===wh)t++;if(e.left!==this.nil_node)n=this.testBlackHeightProperty(e.left);else n=1;if(e.right!==this.nil_node)o=this.testBlackHeightProperty(e.right);else o=1;if(n!==o)throw Error("Red-black height property violated");return t+=n,t}}class xM{get name(){throw tu.CANNOT_INVOKE_ABSTRACT_METHOD}get box(){throw tu.CANNOT_INVOKE_ABSTRACT_METHOD}clone(){throw tu.CANNOT_INVOKE_ABSTRACT_METHOD}translate(...e){return this.transform(new Cf().translate(...e))}rotate(e,t=new He.Point){return this.transform(new Cf().rotate(e,t.x,t.y))}scale(e,t){return this.transform(new Cf().scale(e,t))}transform(...e){throw tu.CANNOT_INVOKE_ABSTRACT_METHOD}toJSON(){return Object.assign({},this,{name:this.name})}svg(e={}){throw tu.CANNOT_INVOKE_ABSTRACT_METHOD}}class kAe{constructor(e){this.shape=e,this.next=void 0,this.prev=void 0,this.face=void 0,this.arc_length=0,this.bvStart=void 0,this.bvEnd=void 0,this.bv=void 0,this.overlap=void 0}get start(){return this.shape.start}get end(){return this.shape.end}get length(){return this.shape.length}get box(){return this.shape.box}get isSegment(){return this.shape instanceof He.Segment}get isArc(){return this.shape instanceof He.Arc}get isLine(){return this.shape instanceof He.Line}get isRay(){return this.shape instanceof He.Ray}middle(){return this.shape.middle()}pointAtLength(e){return this.shape.pointAtLength(e)}contains(e){return this.shape.contains(e)}setInclusion(e){if(this.bv!==void 0)return this.bv;if(this.shape instanceof He.Line||this.shape instanceof He.Ray)return this.bv=He.OUTSIDE,this.bv;if(this.bvStart===void 0)this.bvStart=bre(e,this.start);if(this.bvEnd===void 0)this.bvEnd=bre(e,this.end);if(this.bvStart===He.OUTSIDE||this.bvEnd==He.OUTSIDE)this.bv=He.OUTSIDE;else if(this.bvStart===He.INSIDE||this.bvEnd==He.INSIDE)this.bv=He.INSIDE;else{let t=bre(e,this.middle());this.bv=t}return this.bv}setOverlap(e){let t=void 0,n=this.shape,o=e.shape;if(n instanceof He.Segment&&o instanceof He.Segment){if(n.start.equalTo(o.start)&&n.end.equalTo(o.end))t=He.OVERLAP_SAME;else if(n.start.equalTo(o.end)&&n.end.equalTo(o.start))t=He.OVERLAP_OPPOSITE}else if(n instanceof He.Arc&&o instanceof He.Arc){if(n.start.equalTo(o.start)&&n.end.equalTo(o.end)&&n.middle().equalTo(o.middle()))t=He.OVERLAP_SAME;else if(n.start.equalTo(o.end)&&n.end.equalTo(o.start)&&n.middle().equalTo(o.middle()))t=He.OVERLAP_OPPOSITE}else if(n instanceof He.Segment&&o instanceof He.Arc||n instanceof He.Arc&&o instanceof He.Segment){if(n.start.equalTo(o.start)&&n.end.equalTo(o.end)&&n.middle().equalTo(o.middle()))t=He.OVERLAP_SAME;else if(n.start.equalTo(o.end)&&n.end.equalTo(o.start)&&n.middle().equalTo(o.middle()))t=He.OVERLAP_OPPOSITE}if(this.overlap===void 0)this.overlap=t;if(e.overlap===void 0)e.overlap=t}svg(){if(this.shape instanceof He.Segment)return` L${this.shape.end.x},${this.shape.end.y}`;else if(this.shape instanceof He.Arc){let e=this.shape,t,n=e.counterClockwise?"1":"0";if(He.Utils.EQ(e.sweep,2*Math.PI)){let o=e.counterClockwise?1:-1,r=new He.Arc(e.pc,e.r,e.startAngle,e.startAngle+o*Math.PI,e.counterClockwise),i=new He.Arc(e.pc,e.r,e.startAngle+o*Math.PI,e.endAngle,e.counterClockwise);return t="0",` A${r.r},${r.r} 0 ${t},${n} ${r.end.x},${r.end.y}
                    A${i.r},${i.r} 0 ${t},${n} ${i.end.x},${i.end.y}`}else return t=e.sweep<=Math.PI?"0":"1",` A${e.r},${e.r} 0 ${t},${n} ${e.end.x},${e.end.y}`}}toJSON(){return this.shape.toJSON()}}class Ire{constructor(e){this.circle=e}get inversion_circle(){return this.circle}static inversePoint(e,t){let n=new MAe(e.pc,t),o=e.r*e.r,r=n.dot(n);return SRe.EQ_0(r)?new _Ct(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY):e.pc.translate(n.multiply(o/r))}static inverseCircle(e,t){let n=e.pc.distanceTo(t.pc)[0];if(SRe.EQ(n,t.r)){let o=e.r*e.r/(2*t.r),r=new MAe(e.pc,t.pc);r=r.normalize();let i=e.pc.translate(r.multiply(o));return new mCt(i,r)}else{let o=new MAe(e.pc,t.pc),r=e.r*e.r/(o.dot(o)-t.r*t.r),i=e.pc.translate(o.multiply(r)),s=Math.abs(r)*t.r;return new vRe(i,s)}}static inverseLine(e,t){let[n,o]=e.pc.distanceTo(t);if(SRe.EQ_0(n))return t.clone();else{let r=e.r*e.r/(2*n),i=new MAe(e.pc,o.end);return i=i.multiply(r/n),new vRe(e.pc.translate(i),r)}}inverse(e){if(e instanceof _Ct)return Ire.inversePoint(this.circle,e);else if(e instanceof vRe)return Ire.inverseCircle(this.circle,e);else if(e instanceof mCt)return Ire.inverseLine(this.circle,e)}}class Ur{static point2point(e,t){return e.distanceTo(t)}static point2line(e,t){let n=e.projectionOn(t);return[new He.Vector(e,n).length,new He.Segment(e,n)]}static point2circle(e,t){let[n,o]=e.distanceTo(t.center);if(He.Utils.EQ_0(n))return[t.r,new He.Segment(e,t.toArc().start)];else{let r=Math.abs(n-t.r),i=new He.Vector(t.pc,e).normalize().multiply(t.r),s=t.pc.translate(i);return[r,new He.Segment(e,s)]}}static point2segment(e,t){if(t.start.equalTo(t.end))return Ur.point2point(e,t.start);let n=new He.Vector(t.start,t.end),o=new He.Vector(t.start,e),r=new He.Vector(t.end,e),i=n.dot(o),s=-n.dot(r),a,c;if(He.Utils.GE(i,0)&&He.Utils.GE(s,0)){let l=t.tangentInStart();return a=Math.abs(l.cross(o)),c=t.start.translate(l.multiply(l.dot(o))),[a,new He.Segment(e,c)]}else if(i<0)return e.distanceTo(t.start);else return e.distanceTo(t.end)}static point2arc(e,t){let n=new He.Circle(t.pc,t.r),o=[],r,i;if([r,i]=Ur.point2circle(e,n),i.end.on(t))o.push(Ur.point2circle(e,n));return o.push(Ur.point2point(e,t.start)),o.push(Ur.point2point(e,t.end)),Ur.sort(o),o[0]}static point2edge(e,t){return t.shape instanceof He.Segment?Ur.point2segment(e,t.shape):Ur.point2arc(e,t.shape)}static segment2line(e,t){let n=e.intersect(t);if(n.length>0)return[0,new He.Segment(n[0],n[0])];let o=[];return o.push(Ur.point2line(e.start,t)),o.push(Ur.point2line(e.end,t)),Ur.sort(o),o[0]}static segment2segment(e,t){let n=DAe(e,t);if(n.length>0)return[0,new He.Segment(n[0],n[0])];let o=[],r,i;return[r,i]=Ur.point2segment(t.start,e),o.push([r,i.reverse()]),[r,i]=Ur.point2segment(t.end,e),o.push([r,i.reverse()]),o.push(Ur.point2segment(e.start,t)),o.push(Ur.point2segment(e.end,t)),Ur.sort(o),o[0]}static segment2circle(e,t){let n=e.intersect(t);if(n.length>0)return[0,new He.Segment(n[0],n[0])];let o=new He.Line(e.ps,e.pe),[r,i]=Ur.point2line(t.center,o);if(He.Utils.GE(r,t.r)&&i.end.on(e))return Ur.point2circle(i.end,t);else{let[s,a]=Ur.point2circle(e.start,t),[c,l]=Ur.point2circle(e.end,t);return He.Utils.LT(s,c)?[s,a]:[c,l]}}static segment2arc(e,t){let n=e.intersect(t);if(n.length>0)return[0,new He.Segment(n[0],n[0])];let o=new He.Line(e.ps,e.pe),r=new He.Circle(t.pc,t.r),[i,s]=Ur.point2line(r.center,o);if(He.Utils.GE(i,r.r)&&s.end.on(e)){let[h,d]=Ur.point2circle(s.end,r);if(d.end.on(t))return[h,d]}let a=[];a.push(Ur.point2arc(e.start,t)),a.push(Ur.point2arc(e.end,t));let c,l;return[c,l]=Ur.point2segment(t.start,e),a.push([c,l.reverse()]),[c,l]=Ur.point2segment(t.end,e),a.push([c,l.reverse()]),Ur.sort(a),a[0]}static circle2circle(e,t){let n=e.intersect(t);if(n.length>0)return[0,new He.Segment(n[0],n[0])];if(e.center.equalTo(t.center)){let o=e.toArc(),r=t.toArc();return Ur.point2point(o.start,r.start)}else{let o=new He.Line(e.center,t.center),r=o.intersect(e),i=o.intersect(t),s=[];return s.push(Ur.point2point(r[0],i[0])),s.push(Ur.point2point(r[0],i[1])),s.push(Ur.point2point(r[1],i[0])),s.push(Ur.point2point(r[1],i[1])),Ur.sort(s),s[0]}}static circle2line(e,t){let n=e.intersect(t);if(n.length>0)return[0,new He.Segment(n[0],n[0])];let[o,r]=Ur.point2line(e.center,t),[i,s]=Ur.point2circle(r.end,e);return s=s.reverse(),[i,s]}static arc2line(e,t){let n=t.intersect(e);if(n.length>0)return[0,new He.Segment(n[0],n[0])];let o=new He.Circle(e.center,e.r),[r,i]=Ur.point2line(o.center,t);if(He.Utils.GE(r,o.r)){let[s,a]=Ur.point2circle(i.end,o);if(a.end.on(e))return[s,a]}else{let s=[];return s.push(Ur.point2line(e.start,t)),s.push(Ur.point2line(e.end,t)),Ur.sort(s),s[0]}}static arc2circle(e,t){let n=e.intersect(t);if(n.length>0)return[0,new He.Segment(n[0],n[0])];let o=new He.Circle(e.center,e.r),[r,i]=Ur.circle2circle(o,t);if(i.start.on(e))return[r,i];else{let s=[];return s.push(Ur.point2circle(e.start,t)),s.push(Ur.point2circle(e.end,t)),Ur.sort(s),s[0]}}static arc2arc(e,t){let n=e.intersect(t);if(n.length>0)return[0,new He.Segment(n[0],n[0])];let o=new He.Circle(e.center,e.r),r=new He.Circle(t.center,t.r),[i,s]=Ur.circle2circle(o,r);if(s.start.on(e)&&s.end.on(t))return[i,s];else{let a=[],c,l;if([c,l]=Ur.point2arc(e.start,t),l.end.on(t))a.push([c,l]);if([c,l]=Ur.point2arc(e.end,t),l.end.on(t))a.push([c,l]);if([c,l]=Ur.point2arc(t.start,e),l.end.on(e))a.push([c,l.reverse()]);if([c,l]=Ur.point2arc(t.end,e),l.end.on(e))a.push([c,l.reverse()]);return[c,l]=Ur.point2point(e.start,t.start),a.push([c,l]),[c,l]=Ur.point2point(e.start,t.end),a.push([c,l]),[c,l]=Ur.point2point(e.end,t.start),a.push([c,l]),[c,l]=Ur.point2point(e.end,t.end),a.push([c,l]),Ur.sort(a),a[0]}}static point2polygon(e,t){let n=[Number.POSITIVE_INFINITY,new He.Segment];for(let o of t.edges){let[r,i]=Ur.point2edge(e,o);if(He.Utils.LT(r,n[0]))n=[r,i]}return n}static shape2polygon(e,t){let n=[Number.POSITIVE_INFINITY,new He.Segment];for(let o of t.edges){let[r,i]=e.distanceTo(o.shape);if(He.Utils.LT(r,n[0]))n=[r,i]}return n}static polygon2polygon(e,t){let n=[Number.POSITIVE_INFINITY,new He.Segment];for(let o of e.edges)for(let r of t.edges){let[i,s]=o.shape.distanceTo(r.shape);if(He.Utils.LT(i,n[0]))n=[i,s]}return n}static box2box_minmax(e,t){let n=Math.max(Math.max(e.xmin-t.xmax,0),Math.max(t.xmin-e.xmax,0)),o=Math.max(Math.max(e.ymin-t.ymax,0),Math.max(t.ymin-e.ymax,0)),r=n*n+o*o,i=e.merge(t),s=i.xmax-i.xmin,a=i.ymax-i.ymin,c=s*s+a*a;return[r,c]}static minmax_tree_process_level(e,t,n,o){let r,i;for(let l of t){[r,i]=Ur.box2box_minmax(e.box,l.item.key);for(let h of l.item.values)if(h instanceof He.Edge)o.insert([r,i],h.shape);else o.insert([r,i],h);if(He.Utils.LT(i,n))n=i}if(t.length===0)return n;let s=t.map((l)=>l.left.isNil()?void 0:l.left).filter((l)=>l!==void 0),a=t.map((l)=>l.right.isNil()?void 0:l.right).filter((l)=>l!==void 0),c=[...s,...a].filter((l)=>{let[h,d]=Ur.box2box_minmax(e.box,l.max);return He.Utils.LE(h,n)});return n=Ur.minmax_tree_process_level(e,c,n,o),n}static minmax_tree(e,t,n){let o=new Sre,r=[t.index.root],i=n<Number.POSITIVE_INFINITY?n*n:Number.POSITIVE_INFINITY;return i=Ur.minmax_tree_process_level(e,r,i,o),o}static minmax_tree_calc_distance(e,t,n){let o,r;if(t!=null&&!t.isNil()){if([o,r]=Ur.minmax_tree_calc_distance(e,t.left,n),r)return[o,r];if(He.Utils.LT(o[0],Math.sqrt(t.item.key.low)))return[o,!0];let[i,s]=Ur.distanceToArray(e,t.item.values);if(He.Utils.LT(i,o[0]))o=[i,s];return[o,r]=Ur.minmax_tree_calc_distance(e,t.right,o),[o,r]}return[n,!1]}static shape2planarSet(e,t,n=Number.POSITIVE_INFINITY){let o=[n,new He.Segment],r=!1;if(t instanceof He.PlanarSet){let i=Ur.minmax_tree(e,t,n);[o,r]=Ur.minmax_tree_calc_distance(e,i.root,o)}return o}static sort(e){e.sort((t,n)=>{if(He.Utils.LT(t[0],n[0]))return-1;if(He.Utils.GT(t[0],n[0]))return 1;return 0})}static distance(e,t){return e.distanceTo(t)}static distanceToArray(e,t){let n=[Number.POSITIVE_INFINITY,new He.Segment];for(let o of t){let[r,i]=e.distanceTo(o);if(He.Utils.LT(r,n[0]))n=[r,i]}return n}static shape2multiline(e,t){let n=[Number.POSITIVE_INFINITY,new He.Segment];for(let o of t){let[r,i]=Ur.distance(e,o.shape);if(He.Utils.LT(r,n[0]))n=[r,i]}return n}static multiline2multiline(e,t){let n=[Number.POSITIVE_INFINITY,new He.Segment];for(let o of e)for(let r of t){let[i,s]=Ur.distance(o.shape,r.shape);if(He.Utils.LT(i,n[0]))n=[i,s]}return n}}function VRe(e){return new UCt(e.split(" ").map(Number))}function XCt(e){return e.split(", ").map(VRe)}function YRe(e){let t=XCt(e),n=[];for(let o=0;o<t.length-1;o++)n.push(new H5o(t[o],t[o+1]));return new L5o(n)}function F5o(e){return e.replace(/\(\(/,"").replace(/\)\)$/,"").split("), (").map(YRe)}function jCt(e){let t=e.replace(/\(\(/,"").replace(/\)\)$/,"").split("), ("),n=new WCt,o;return t.forEach((r,i)=>{let s=r.split(", ").map((c)=>new UCt(c.split(" ").map(Number))),a=n.addFace(s);if(i===0)o=a.orientation();else if(a.orientation()===o)a.reverse()}),n}function z5o(e){let n=e.split(/\)\), \(\(/).map((i)=>"(("+i+"))").map(jCt),o=new WCt;return n.reduce((i,s)=>[...i,...s?.faces],[]).forEach((i)=>o.addFace([...i?.shapes])),o}function O5o(e){if(e.startsWith("POLYGON")){let t=e.replace(/^POLYGON /,"");return jCt(t)}else{let t=e.replace(/^MULTIPOLYGON \(\(\((.*)\)\)\)$/,"$1");return z5o(t)}}function V5o(e){return e.split(`
`).map((n)=>n.match(/\(([^)]+)\)/)[1]).map(VRe)}function Y5o(e){return e.split(`
`).map((n)=>n.match(/\(([^)]+)\)/)[1]).map(YRe).reduce((n,o)=>[...n,...o],[])}function KCt(e){if(e.startsWith("POINT")){let t=e.replace(/^POINT \(/,"").replace(/\)$/,"");return VRe(t)}else if(e.startsWith("MULTIPOINT")){let t=e.replace(/^MULTIPOINT \(/,"").replace(/\)$/,"");return XCt(t)}else if(e.startsWith("LINESTRING")){let t=e.replace(/^LINESTRING \(/,"").replace(/\)$/,"");return YRe(t)}else if(e.startsWith("MULTILINESTRING")){let t=e.replace(/^MULTILINESTRING /,"");return F5o(t)}else if(e.startsWith("POLYGON")||e.startsWith("MULTIPOLYGON"))return O5o(e);else if(e.startsWith("GEOMETRYCOLLECTION")){let t=/(?<type>POINT|LINESTRING|POLYGON|MULTIPOINT|MULTILINESTRING|MULTIPOLYGON) \((?:[^\(\)]|\([^\)]*\))*\)/g,n=e.match(t);if(n[0].startsWith("GEOMETRYCOLLECTION"))n[0]=n[0].replace("GEOMETRYCOLLECTION (","");return n.map(KCt).map((r)=>r instanceof Array?r:[r]).reduce((r,i)=>[...r,...i],[])}else if($Ct(e))return V5o(e);else if(qCt(e))return Y5o(e);return[]}function $Ct(e){return e.split(`
`)?.every((t)=>t.includes("POINT"))}function qCt(e){return e.split(`
`)?.every((t)=>t.includes("LINESTRING"))}function G5o(e){return e.startsWith("POINT")||$Ct(e)||e.startsWith("LINESTRING")||qCt(e)||e.startsWith("MULTILINESTRING")||e.startsWith("POLYGON")||e.startsWith("MULTIPOINT")||e.startsWith("MULTIPOLYGON")||e.startsWith("GEOMETRYCOLLECTION")}var UF,Vxo,wAe,e7=0.000001,Yxo=3,p4,He,BAe,oCt,$F,o5o=(...e)=>new He.Multiline(...e),J8,Z8,oA,s5o,a5o,ifs,aCt,cCt,RAe=1,Mre=2,XF=3,DX,m5o,_5o,g5o,A5o,f5o,E5o,M5o=(...e)=>new He.Matrix(...e),zRe,xf=1,wh=0,YCt,Ks,jm=(...e)=>new He.Point(...e),RX,JF=(...e)=>new He.Vector(...e),eg,QAe=(...e)=>new He.Segment(...e),Cre,w5o,B5o=(...e)=>new He.Line(...e),ZF,T5o=(...e)=>new He.Circle(...e),Ap,D5o=(...e)=>new He.Arc(...e),rA,N5o=(...e)=>new He.Box(...e),GCt,vX,ORe,R5o=(...e)=>new He.Ray(...e),tl=class e{constructor(){this.faces=new He.PlanarSet,this.edges=new He.PlanarSet;let t=[...arguments];if(t.length===1&&(t[0]instanceof Array&&t[0].length>0||t[0]instanceof He.Circle||t[0]instanceof He.Box)){let n=t[0];if(t[0]instanceof Array&&t[0].every((o)=>o instanceof Array))if(n.every((o)=>o instanceof Array&&o.length===2&&typeof o[0]==="number"&&typeof o[1]==="number"))this.faces.add(new He.Face(this,n));else for(let o of n)if(o instanceof Array&&o[0]instanceof Array&&o[0].every((r)=>r instanceof Array&&r.length===2&&typeof r[0]==="number"&&typeof r[1]==="number"))for(let r of o)this.faces.add(new He.Face(this,r));else this.faces.add(new He.Face(this,o));else this.faces.add(new He.Face(this,n))}}get box(){return[...this.faces].reduce((t,n)=>t.merge(n.box),new He.Box)}get vertices(){return[...this.faces].flatMap((t)=>t.vertices)}clone(){let t=new e;for(let n of this.faces)t.addFace(n.shapes);return t}createFromArray(t){let n=new e;return t.forEach((o)=>[...o.faces].forEach((r)=>n.addFace(r.shapes))),n}isEmpty(){return this.edges.size===0||this.faces.size===0}isValid(){let t=!0;for(let n of this.faces)if(!n.isSimple(this.edges)){t=!1;break}return t}area(){let t=[...this.faces].reduce((n,o)=>n+o.signedArea(),0);return Math.abs(t)}addFace(...t){let n=new He.Face(this,...t);return this.faces.add(n),n}deleteFace(t){for(let n of t)this.edges.delete(n);return this.faces.delete(t)}recreateFaces(){this.faces.clear();for(let o of this.edges)o.face=null;let t,n=!0;while(n){n=!1;for(let o of this.edges)if(o.face===null){t=o,n=!0;break}if(n){let o=t;do o=o.next;while(o.next!==t);this.addFace(t,o)}}}removeChain(t,n,o){if(o.next===n){this.deleteFace(t);return}for(let r=n;r!==o.next;r=r.next)if(t.remove(r),this.edges.delete(r),t.isEmpty()){this.deleteFace(t);break}}addVertex(t,n){let o=n.shape.split(t);if(o[0]===null)return n.prev;if(o[1]===null)return n;let r=new He.Edge(o[0]),i=n.prev;return n.face.insert(r,i),this.edges.delete(n),this.edges.add(r),n.shape=o[1],this.edges.add(n),r}removeEndVertex(t){let n=t.next;if(n===t)return;t.face.merge_with_next_edge(t),this.edges.delete(n)}cut(t){let o=this.splitToIslands().flatMap((r)=>r._cutSingleIsland(t)).filter((r)=>r.isValid()&&r.isEmpty()===!1);return this.createFromArray(o)}_cutSingleIsland(t){let n=this.clone(),o=t.clone(),r={int_points1:[],int_points2:[],int_points1_sorted:[],int_points2_sorted:[]};for(let a of o.edges)for(let c of n.edges){let l=ECt(a,c);for(let h of l)PX(a,h,r.int_points1),PX(c,h,r.int_points2)}if(r.int_points1.length===0)return n;r.int_points1_sorted=wN(r.int_points1),r.int_points2_sorted=wN(r.int_points2),MX(o,r.int_points1_sorted),MX(n,r.int_points2_sorted),FRe(r),r.int_points1_sorted=wN(r.int_points1),r.int_points2_sorted=wN(r.int_points2),ERe(r.int_points1),MRe(r.int_points1,n);for(let a of r.int_points1_sorted)if(a.edge_before&&a.edge_after&&a.edge_before.bv===a.edge_after.bv)r.int_points2[a.id]=-1,a.id=-1;if(r.int_points1=r.int_points1.filter((a)=>a.id>=0),r.int_points2=r.int_points2.filter((a)=>a.id>=0),r.int_points1.forEach((a,c)=>{a.id=c}),r.int_points2.forEach((a,c)=>{a.id=c}),r.int_points1.length===0)return n;r.int_points1_sorted=wN(r.int_points1),r.int_points2_sorted=wN(r.int_points2);let i,s;for(let a=1;a<r.int_points1_sorted.length;a++)if(s=r.int_points1_sorted[a],i=r.int_points1_sorted[a-1],s.edge_before&&s.edge_before.bv===1){let c=i.edge_after,l=s.edge_before,h=o.getChain(c,l);sCt(r.int_points2[i.id],r.int_points2[s.id],h),h.forEach((d)=>n.edges.add(d)),h=h.reverse().map((d)=>new He.Edge(d.shape.reverse()));for(let d=0;d<h.length-1;d++)h[d].next=h[d+1],h[d+1].prev=h[d];sCt(r.int_points2[s.id],r.int_points2[i.id],h),h.forEach((d)=>n.edges.add(d))}return n.recreateFaces(),n}cutWithLine(t){let n=new $F([t]);return this.cut(n)}findEdgeByPoint(t){let n;for(let o of this.faces)if(n=o.findEdgeByPoint(t),n!==void 0)break;return n}splitToIslands(){if(this.isEmpty())return[];let t=this.toArray();t.sort((r,i)=>i.area()-r.area());let n=[...t[0].faces][0].orientation(),o=t.filter((r)=>[...r.faces][0].orientation()===n);for(let r of t){let i=[...r.faces][0];if(i.orientation()===n)continue;for(let s of o)if(i.shapes.every((a)=>s.contains(a))){s.addFace(i.shapes);break}}return o}rearrange(){if(this.faces.size<=1)return this.clone();let t=this.splitToIslands(),n=new e;return t.forEach((o)=>{o.faces.forEach((r)=>n.addFace(r.shapes))}),n}orientation(){if(this.isEmpty())return UF.NOT_ORIENTABLE;return[...this.faces][0].orientation()}isOuter(t){return t.orientation()===this.orientation()}isMultiPolygon(){let t=0;return this.faces.forEach((n)=>{if(this.isOuter(n))t++}),t>1}reverse(){for(let t of this.faces)t.reverse();return this}contains(t){if(t instanceof He.Point){let n=bre(this,t);return n===1||n===2}else return OCt(this,t)}distanceTo(t){if(t instanceof He.Point){let[n,o]=He.Distance.point2polygon(t,this);return o=o.reverse(),[n,o]}if(t instanceof He.Circle||t instanceof He.Line||t instanceof He.Segment||t instanceof He.Arc){let[n,o]=He.Distance.shape2polygon(t,this);return o=o.reverse(),[n,o]}if(t instanceof He.Box)return this.distanceTo(new He.Polygon(t));if(t instanceof He.Polygon){let n=[Number.POSITIVE_INFINITY,new He.Segment],o,r;for(let i of this.edges){let s=n[0];if([o,r]=He.Distance.shape2planarSet(i.shape,t.edges,s),He.Utils.LT(o,s))n=[o,r]}return n}}intersect(t){if(t instanceof He.Point)return this.contains(t)?[t]:[];if(t instanceof He.Line)return Ere(t,this);if(t instanceof He.Ray)return DCt(t,this);if(t instanceof He.Circle)return PCt(t,this);if(t instanceof He.Segment)return QRe(t,this);if(t instanceof He.Arc)return kRe(t,this);if(t instanceof He.Polygon)return Jxo(t,this);if(t instanceof He.Multiline)return qxo(t,this)}translate(t){let n=new e;for(let o of this.faces)n.addFace(o.shapes.map((r)=>r.translate(t)));return n}rotate(t=0,n=new He.Point){let o=new e;for(let r of this.faces)o.addFace(r.shapes.map((i)=>i.rotate(t,n)));return o}scale(t,n){let o=new e;for(let r of this.faces)o.addFace(r.shapes.map((i)=>i.scale(t,n)));return o}transform(t=new He.Matrix){let n=new e;for(let o of this.faces)n.addFace(o.shapes.map((r)=>r.transform(t)));return n}toJSON(){return[...this.faces].map((t)=>t.toJSON())}toArray(){return[...this.faces].map((t)=>t.toPolygon())}dpath(){return[...this.faces].reduce((t,n)=>t+n.svg(),"")}svg(t={}){let n=`
<path ${jF({fillRule:"evenodd",fill:"lightcyan",...t})} d="`;for(let o of this.faces)n+=`
${o.svg()}`;return n+=`" >
</path>`,n}},Q5o=(...e)=>new He.Polygon(...e),vRe,mCt,_Ct,MAe,SRe,k5o=(e)=>new He.Inversion(e),L5o,UCt,H5o,WCt;var fp=El(()=>{UF={CCW:-1,CW:1,NOT_ORIENTABLE:0},Vxo=2*Math.PI,wAe=Object.freeze({__proto__:null,BOUNDARY:2,CCW:!0,CONTAINS:3,CW:!1,END_VERTEX:2,INSIDE:1,INTERLACE:4,NOT_VERTEX:0,ORIENTATION:UF,OUTSIDE:0,OVERLAP_OPPOSITE:2,OVERLAP_SAME:1,PIx2:Vxo,START_VERTEX:1});p4=Object.freeze({__proto__:null,DECIMALS:Yxo,EQ:WF,EQ_0:PRe,GE:Gxo,GT:fCt,LE:Uxo,LT:yCt,getTolerance:ACt,setTolerance:gCt}),He={Utils:p4,Errors:void 0,Matrix:void 0,Planar_set:void 0,Point:void 0,Vector:void 0,Line:void 0,Circle:void 0,Segment:void 0,Arc:void 0,Box:void 0,Edge:void 0,Face:void 0,Ray:void 0,Ray_shooting:void 0,Multiline:void 0,Polygon:void 0,Distance:void 0,Inversion:void 0};for(let e in wAe)He[e]=wAe[e];Object.defineProperty(He,"DP_TOL",{get:function(){return ACt()},set:function(e){gCt(e)}});He.Errors=tu;BAe=class BAe{constructor(e,t){this.first=e,this.last=t||this.first}[Symbol.iterator](){let e=void 0;return{next:()=>(e=e?e.next:this.first,{value:e,done:e===void 0})}}get size(){let e=0;for(let t of this)e++;return e}toArray(e=void 0,t=void 0){let n=[],o=e||this.first,r=t||this.last,i=o;if(i===void 0)return n;do n.push(i),i=i.next;while(i!==r.next);return n}append(e){if(this.isEmpty())this.first=e;else e.prev=this.last,this.last.next=e;return this.last=e,this.last.next=void 0,this.first.prev=void 0,this}insert(e,t){if(this.isEmpty())this.first=e,this.last=e;else if(t===null||t===void 0)e.next=this.first,this.first.prev=e,this.first=e;else{let n=t.next;if(t.next=e,n)n.prev=e;if(e.prev=t,e.next=n,this.last===t)this.last=e}return this.last.next=void 0,this.first.prev=void 0,this}remove(e){if(e===this.first&&e===this.last)this.first=void 0,this.last=void 0;else{if(e.prev)e.prev.next=e.next;if(e.next)e.next.prev=e.prev;if(e===this.first)this.first=e.next;if(e===this.last)this.last=e.prev}return this}isEmpty(){return this.first===void 0}static testInfiniteLoop(e){let t=e,n=e;do{if(t!=e&&t===n)throw tu.INFINITE_LOOP;t=t.next,n=n.next.next}while(t!=e)}};oCt={stroke:"black"};$F=class e extends BAe{constructor(...t){super();if(this.isInfinite=!1,t.length===1&&t[0]instanceof Array&&t[0].length>0){let n=t[0],o=n.length,r=(c)=>c instanceof He.Segment||c instanceof He.Arc||c instanceof He.Ray||c instanceof He.Line,i=(c)=>c instanceof He.Segment||c instanceof He.Arc||c instanceof He.Ray,s=(c)=>c instanceof He.Segment||c instanceof He.Arc;if(o===1&&r(n[0])||o>1&&i(n[0])&&i(n[o-1])&&n.slice(1,o-1).every(s)){this.isInfinite=n.some((c)=>c instanceof He.Ray||c instanceof He.Line);for(let c of n){let l=new He.Edge(c);this.append(l)}this.setArcLength()}else throw He.Errors.ILLEGAL_PARAMETERS}}get edges(){return[...this]}get box(){return this.edges.reduce((t,n)=>t.merge(n.box),new He.Box)}get vertices(){let t=this.edges.map((n)=>n.start);return t.push(this.last.end),t}get length(){if(this.isEmpty())return 0;if(this.isInfinite)return Number.POSITIVE_INFINITY;let t=0;for(let n of this)t+=n.length;return t}clone(){return new e(this.toShapes())}setArcLength(){for(let t of this)this.setOneEdgeArcLength(t)}setOneEdgeArcLength(t){if(t===this.first)t.arc_length=0;else t.arc_length=t.prev.arc_length+t.prev.length}pointAtLength(t){if(t>this.length||t<0)return null;if(this.isInfinite)return null;let n=null;for(let o of this)if(t>=o.arc_length&&(o===this.last||t<o.next.arc_length)){n=o.pointAtLength(t-o.arc_length);break}return n}addVertex(t,n){let o=n.shape.split(t);if(o[0]===null)return n.prev;if(o[1]===null)return n;let r=new He.Edge(o[0]),i=n.prev;return this.insert(r,i),n.shape=o[1],r}getChain(t,n){let o=[];for(let r=t;r!==n.next;r=r.next)o.push(r);return o}split(t){for(let n of t){let o=this.findEdgeByPoint(n);this.addVertex(n,o)}return this}findEdgeByPoint(t){let n;for(let o of this)if(o.shape.contains(t)){n=o;break}return n}distanceTo(t){if(t instanceof He.Point){let[n,o]=He.Distance.shape2multiline(t,this);return[n,o.reverse()]}if(t instanceof He.Line){let[n,o]=He.Distance.shape2multiline(t,this);return[n,o.reverse()]}if(t instanceof He.Circle){let[n,o]=He.Distance.shape2multiline(t,this);return[n,o.reverse()]}if(t instanceof He.Segment){let[n,o]=He.Distance.shape2multiline(t,this);return[n,o.reverse()]}if(t instanceof He.Arc){let[n,o]=He.Distance.shape2multiline(t,this);return[n,o.reverse()]}if(t instanceof He.Box){let[n,o]=He.Distance.shape2multiline(new He.Polygon(t),this);return[n,o.reverse()]}if(t instanceof He.Multiline)return He.Distance.multiline2multiline(this,t);throw He.Errors.UNSUPPORTED_SHAPE_TYPE}intersect(t){if(t instanceof He.Multiline)return n5o(this,t);else return TX(t,this)}contains(t){if(t instanceof He.Point)return this.edges.some((n)=>n.shape.contains(t));throw He.Errors.UNSUPPORTED_SHAPE_TYPE}translate(t){return new e(this.edges.map((n)=>n.shape.translate(t)))}rotate(t=0,n=new He.Point){return new e(this.edges.map((o)=>o.shape.rotate(t,n)))}transform(t=new He.Matrix){return new e(this.edges.map((n)=>n.shape.transform(t)))}toShapes(){return this.edges.map((t)=>t.shape.clone())}toJSON(){return this.edges.map((t)=>t.toJSON())}svgPoints(){return this.vertices.map((t)=>`${t.x},${t.y}`).join(" ")}dpath(){let t=`M${this.first.start.x},${this.first.start.y}`;for(let n of this)t+=n.svg();return t}svg(t={}){let n=`
<path ${jF({fill:"none",...t})} d="`;n+=`
M${this.first.start.x},${this.first.start.y}`;for(let o of this)n+=o.svg();return n+=`" >
</path>`,n}};He.Multiline=$F;He.multiline=o5o;({INSIDE:J8,OUTSIDE:Z8,BOUNDARY:oA,OVERLAP_SAME:s5o,OVERLAP_OPPOSITE:a5o}=wAe),{NOT_VERTEX:ifs,START_VERTEX:aCt,END_VERTEX:cCt}=wAe;DX=Object.freeze({__proto__:null,BOOLEAN_INTERSECT:Mre,BOOLEAN_SUBTRACT:XF,BOOLEAN_UNION:RAe,calculateIntersections:kCt,innerClip:QCt,intersect:RCt,outerClip:BRe,removeNotRelevantChains:TRe,removeOldFaces:DRe,restoreFaces:NRe,subtract:wRe,unify:c5o}),m5o=RegExp("T.F..FFF.|T.F...F.."),_5o=RegExp("T........|.T.......|...T.....|....T...."),g5o=RegExp("FT.......|F..T.....|F...T...."),A5o=RegExp("T.F..F..."),f5o=RegExp("T.F..F...|.TF..F...|..FT.F...|..F.TF...");E5o=Object.freeze({__proto__:null,contain:b5o,cover:OCt,covered:zCt,disjoint:C5o,equal:y5o,inside:FCt,intersect:HCt,relate:NX,touch:x5o});He.Matrix=Cf;He.matrix=M5o;zRe=class zRe extends VCt{clone(){return new zRe(this.low,this.high)}};YCt=class YCt extends Set{constructor(e){super(e);this.index=new Sre,this.forEach((t)=>this.index.insert(t))}add(e){let t=this.size,{key:n,value:o}=e,r=n||e.box,i=o||e;if(super.add(i),this.size>t)this.index.insert(r,i);return this}delete(e){let{key:t,value:n}=e,o=t||e.box,r=n||e,i=super.delete(r);if(i)this.index.remove(o,r);return i}clear(){super.clear(),this.index=new Sre}search(e){return this.index.search(e)}hit(e){let t=new He.Box(e.x-1,e.y-1,e.x+1,e.y+1);return this.index.search(t).filter((o)=>e.on(o))}svg(){return[...this].reduce((t,n)=>t+n.svg(),"")}};He.PlanarSet=YCt;Ks=class e extends xM{constructor(...t){super();if(this.x=0,this.y=0,t.length===0)return;if(t.length===1&&t[0]instanceof Array&&t[0].length===2){let n=t[0];if(typeof n[0]=="number"&&typeof n[1]=="number"){this.x=n[0],this.y=n[1];return}}if(t.length===1&&t[0]instanceof Object&&t[0].name==="point"){let{x:n,y:o}=t[0];this.x=n,this.y=o;return}if(t.length===2){if(typeof t[0]=="number"&&typeof t[1]=="number"){this.x=t[0],this.y=t[1];return}}throw tu.ILLEGAL_PARAMETERS}get box(){return new He.Box(this.x,this.y,this.x,this.y)}clone(){return new He.Point(this.x,this.y)}get vertices(){return[this.clone()]}equalTo(t){return He.Utils.EQ(this.x,t.x)&&He.Utils.EQ(this.y,t.y)}lessThan(t){if(He.Utils.LT(this.y,t.y))return!0;if(He.Utils.EQ(this.y,t.y)&&He.Utils.LT(this.x,t.x))return!0;return!1}transform(t){return new He.Point(t.transform([this.x,this.y]))}projectionOn(t){if(this.equalTo(t.pt))return this.clone();let n=new He.Vector(this,t.pt);if(He.Utils.EQ_0(n.cross(t.norm)))return t.pt.clone();let o=n.dot(t.norm),r=t.norm.multiply(o);return this.translate(r)}leftTo(t){let n=new He.Vector(t.pt,this);return He.Utils.GT(n.dot(t.norm),0)}distanceTo(t){if(t instanceof e){let n=t.x-this.x,o=t.y-this.y;return[Math.sqrt(n*n+o*o),new He.Segment(this,t)]}if(t instanceof He.Line)return He.Distance.point2line(this,t);if(t instanceof He.Circle)return He.Distance.point2circle(this,t);if(t instanceof He.Segment)return He.Distance.point2segment(this,t);if(t instanceof He.Arc)return He.Distance.point2arc(this,t);if(t instanceof He.Box)return He.Distance.point2polygon(this,new He.Polygon(t));if(t instanceof He.Polygon)return He.Distance.point2polygon(this,t);if(t instanceof He.PlanarSet)return He.Distance.shape2planarSet(this,t);if(t instanceof He.Multiline)return He.Distance.shape2multiline(this,t)}on(t){if(t instanceof He.Point)return this.equalTo(t);if(t.contains&&t.contains instanceof Function)return t.contains(this);throw He.Errors.UNSUPPORTED_SHAPE_TYPE}get name(){return"point"}svg(t={}){let n=t.r??3;return`
<circle cx="${this.x}" cy="${this.y}" r="${n}"
            ${jF({fill:"red",...t})} />`}};He.Point=Ks;He.point=jm;RX=class extends xM{constructor(...t){super();if(this.x=0,this.y=0,t.length===0)return;if(t.length===1&&t[0]instanceof Array&&t[0].length===2){let n=t[0];if(typeof n[0]=="number"&&typeof n[1]=="number"){this.x=n[0],this.y=n[1];return}}if(t.length===1&&t[0]instanceof Object&&t[0].name==="vector"){let{x:n,y:o}=t[0];this.x=n,this.y=o;return}if(t.length===1&&t[0]instanceof Object&&t[0].name==="segment"){let{start:n,end:o}=t[0];this.x=o.x-n.x,this.y=o.y-n.y;return}if(t.length===2){let n=t[0],o=t[1];if(typeof n=="number"&&typeof o=="number"){this.x=n,this.y=o;return}if(n instanceof He.Point&&o instanceof He.Point){this.x=o.x-n.x,this.y=o.y-n.y;return}}throw tu.ILLEGAL_PARAMETERS}clone(){return new He.Vector(this.x,this.y)}get slope(){let t=Math.atan2(this.y,this.x);if(t<0)t=2*Math.PI+t;return t}get length(){return Math.sqrt(this.dot(this))}isZeroLength(){return He.Utils.EQ_0(this.length)}equalTo(t){return He.Utils.EQ(this.x,t.x)&&He.Utils.EQ(this.y,t.y)}multiply(t){return new He.Vector(t*this.x,t*this.y)}dot(t){return this.x*t.x+this.y*t.y}cross(t){return this.x*t.y-this.y*t.x}normalize(){if(this.isZeroLength())throw tu.ZERO_DIVISION;return new He.Vector(this.x/this.length,this.y/this.length)}rotate(t,n=new He.Point){if(n.x===0&&n.y===0)return this.transform(new Cf().rotate(t));throw tu.OPERATION_IS_NOT_SUPPORTED}transform(t){return new He.Vector(t.transform([this.x,this.y]))}rotate90CCW(){return new He.Vector(-this.y,this.x)}rotate90CW(){return new He.Vector(this.y,-this.x)}invert(){return new He.Vector(-this.x,-this.y)}add(t){return new He.Vector(this.x+t.x,this.y+t.y)}subtract(t){return new He.Vector(this.x-t.x,this.y-t.y)}angleTo(t){let n=this.normalize(),o=t.normalize(),r=Math.atan2(n.cross(o),n.dot(o));if(r<0)r+=2*Math.PI;return r}projectionOn(t){let n=t.normalize(),o=this.dot(n);return n.multiply(o)}get name(){return"vector"}};He.Vector=RX;He.vector=JF;eg=class e extends xM{constructor(...t){super();if(this.ps=new He.Point,this.pe=new He.Point,t.length===0)return;if(t.length===1&&t[0]instanceof Array&&t[0].length===4){let n=t[0];this.ps=new He.Point(n[0],n[1]),this.pe=new He.Point(n[2],n[3]);return}if(t.length===1&&t[0]instanceof Object&&t[0].name==="segment"){let{ps:n,pe:o}=t[0];this.ps=new He.Point(n.x,n.y),this.pe=new He.Point(o.x,o.y);return}if(t.length===1&&t[0]instanceof He.Point){this.ps=t[0].clone();return}if(t.length===2&&t[0]instanceof He.Point&&t[1]instanceof He.Point){this.ps=t[0].clone(),this.pe=t[1].clone();return}if(t.length===4){this.ps=new He.Point(t[0],t[1]),this.pe=new He.Point(t[2],t[3]);return}throw tu.ILLEGAL_PARAMETERS}clone(){return new He.Segment(this.start,this.end)}get start(){return this.ps}get end(){return this.pe}get vertices(){return[this.ps.clone(),this.pe.clone()]}get length(){return this.start.distanceTo(this.end)[0]}get slope(){return new He.Vector(this.start,this.end).slope}get box(){return new He.Box(Math.min(this.start.x,this.end.x),Math.min(this.start.y,this.end.y),Math.max(this.start.x,this.end.x),Math.max(this.start.y,this.end.y))}equalTo(t){return this.ps.equalTo(t.ps)&&this.pe.equalTo(t.pe)}contains(t){return He.Utils.EQ_0(this.distanceToPoint(t))}intersect(t){if(t instanceof He.Point)return this.contains(t)?[t]:[];if(t instanceof He.Line)return Pre(this,t);if(t instanceof He.Ray)return LRe(t,this);if(t instanceof He.Segment)return DAe(this,t);if(t instanceof He.Circle)return NAe(this,t);if(t instanceof He.Box)return Wxo(this,t);if(t instanceof He.Arc)return BX(this,t);if(t instanceof He.Polygon)return QRe(this,t);if(t instanceof He.Multiline)return TX(this,t)}distanceTo(t){if(t instanceof He.Point){let[n,o]=He.Distance.point2segment(t,this);return o=o.reverse(),[n,o]}if(t instanceof He.Circle){let[n,o]=He.Distance.segment2circle(this,t);return[n,o]}if(t instanceof He.Line){let[n,o]=He.Distance.segment2line(this,t);return[n,o]}if(t instanceof He.Segment){let[n,o]=He.Distance.segment2segment(this,t);return[n,o]}if(t instanceof He.Arc){let[n,o]=He.Distance.segment2arc(this,t);return[n,o]}if(t instanceof He.Box){let[n,o]=He.Distance.shape2polygon(this,new He.Polygon(t));return[n,o]}if(t instanceof He.Polygon){let[n,o]=He.Distance.shape2polygon(this,t);return[n,o]}if(t instanceof He.PlanarSet){let[n,o]=He.Distance.shape2planarSet(this,t);return[n,o]}if(t instanceof He.Multiline)return He.Distance.shape2multiline(this,t)}tangentInStart(){return new He.Vector(this.start,this.end).normalize()}tangentInEnd(){return new He.Vector(this.end,this.start).normalize()}reverse(){return new e(this.end,this.start)}split(t){if(this.start.equalTo(t))return[null,this.clone()];if(this.end.equalTo(t))return[this.clone(),null];return[new He.Segment(this.start,t),new He.Segment(t,this.end)]}middle(){return new He.Point((this.start.x+this.end.x)/2,(this.start.y+this.end.y)/2)}pointAtLength(t){if(t>this.length||t<0)return null;if(t==0)return this.start;if(t==this.length)return this.end;let n=t/this.length;return new He.Point((this.end.x-this.start.x)*n+this.start.x,(this.end.y-this.start.y)*n+this.start.y)}distanceToPoint(t){let[n,...o]=He.Distance.point2segment(t,this);return n}definiteIntegral(t=0){let n=this.end.x-this.start.x,o=this.start.y-t,r=this.end.y-t;return n*(o+r)/2}transform(t=new He.Matrix){return new e(this.ps.transform(t),this.pe.transform(t))}isZeroLength(){return this.ps.equalTo(this.pe)}sortPoints(t){return new He.Line(this.start,this.end).sortPoints(t)}get name(){return"segment"}svg(t={}){return`
<line x1="${this.start.x}" y1="${this.start.y}" x2="${this.end.x}" y2="${this.end.y}" ${jF(t)} />`}};He.Segment=eg;He.segment=QAe;({vector:Cre}=He),w5o=class e extends xM{constructor(...t){super();if(this.pt=new He.Point,this.norm=new He.Vector(0,1),t.length===0)return;if(t.length===1&&t[0]instanceof Object&&t[0].name==="line"){let{pt:n,norm:o}=t[0];this.pt=new He.Point(n),this.norm=new He.Vector(o);return}if(t.length===2){let n=t[0],o=t[1];if(n instanceof He.Point&&o instanceof He.Point){if(this.pt=n,this.norm=e.points2norm(n,o),this.norm.dot(Cre(this.pt.x,this.pt.y))>=0)this.norm.invert();return}if(n instanceof He.Point&&o instanceof He.Vector){if(He.Utils.EQ_0(o.x)&&He.Utils.EQ_0(o.y))throw tu.ILLEGAL_PARAMETERS;if(this.pt=n.clone(),this.norm=o.clone(),this.norm=this.norm.normalize(),this.norm.dot(Cre(this.pt.x,this.pt.y))>=0)this.norm.invert();return}if(n instanceof He.Vector&&o instanceof He.Point){if(He.Utils.EQ_0(n.x)&&He.Utils.EQ_0(n.y))throw tu.ILLEGAL_PARAMETERS;if(this.pt=o.clone(),this.norm=n.clone(),this.norm=this.norm.normalize(),this.norm.dot(Cre(this.pt.x,this.pt.y))>=0)this.norm.invert();return}}throw tu.ILLEGAL_PARAMETERS}clone(){return new He.Line(this.pt,this.norm)}get start(){return}get end(){return}get length(){return Number.POSITIVE_INFINITY}get box(){return new He.Box(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY)}get middle(){return}get slope(){return new He.Vector(this.norm.y,-this.norm.x).slope}get standard(){let t=this.norm.x,n=this.norm.y,o=this.norm.dot(Cre(this.pt.x,this.pt.y));return[t,n,o]}parallelTo(t){return He.Utils.EQ_0(this.norm.cross(t.norm))}incidentTo(t){return this.parallelTo(t)&&this.pt.on(t)}contains(t){if(this.pt.equalTo(t))return!0;let n=new He.Vector(this.pt,t);return He.Utils.EQ_0(this.norm.dot(n))}coord(t){return Cre(t.x,t.y).cross(this.norm)}intersect(t){if(t instanceof He.Point)return this.contains(t)?[t]:[];if(t instanceof He.Line)return wX(this,t);if(t instanceof He.Ray)return TCt(t,this);if(t instanceof He.Circle)return KF(this,t);if(t instanceof He.Box)return SX(this,t);if(t instanceof He.Segment)return Pre(t,this);if(t instanceof He.Arc)return TAe(this,t);if(t instanceof He.Polygon)return Ere(this,t);if(t instanceof He.Multiline)return TX(this,t)}distanceTo(t){if(t instanceof He.Point){let[n,o]=He.Distance.point2line(t,this);return o=o.reverse(),[n,o]}if(t instanceof He.Circle){let[n,o]=He.Distance.circle2line(t,this);return o=o.reverse(),[n,o]}if(t instanceof He.Segment){let[n,o]=He.Distance.segment2line(t,this);return[n,o.reverse()]}if(t instanceof He.Arc){let[n,o]=He.Distance.arc2line(t,this);return[n,o.reverse()]}if(t instanceof He.Box){let[n,o]=He.Distance.shape2polygon(this,new He.Polygon(t));return[n,o]}if(t instanceof He.Polygon){let[n,o]=He.Distance.shape2polygon(this,t);return[n,o]}}split(t){if(t instanceof He.Point)return[new He.Ray(t,this.norm),new He.Ray(t,this.norm)];else{let n=new He.Multiline([this]),o=this.sortPoints(t);return n.split(o),n.toShapes()}}rotate(t,n=new He.Point){return new He.Line(this.pt.rotate(t,n),this.norm.rotate(t))}transform(t){return new He.Line(this.pt.transform(t),this.norm.clone())}sortPoints(t){return t.slice().sort((n,o)=>{if(this.coord(n)<this.coord(o))return-1;if(this.coord(n)>this.coord(o))return 1;return 0})}get name(){return"line"}svg(t,n={}){let o=SX(this,t);if(o.length===0)return"";let r=o[0],i=o.length===2?o[1]:o.find((a)=>!a.equalTo(r));if(i===void 0)i=r;return new He.Segment(r,i).svg(n)}static points2norm(t,n){if(t.equalTo(n))throw tu.ILLEGAL_PARAMETERS;return new He.Vector(t,n).normalize().rotate90CCW()}};He.Line=w5o;He.line=B5o;ZF=class extends xM{constructor(...t){super();if(this.pc=new He.Point,this.r=1,t.length===1&&t[0]instanceof Object&&t[0].name==="circle"){let{pc:n,r:o}=t[0];this.pc=new He.Point(n),this.r=o}else{let[n,o]=[...t];if(n&&n instanceof He.Point)this.pc=n.clone();if(o!==void 0)this.r=o}}clone(){return new He.Circle(this.pc.clone(),this.r)}get center(){return this.pc}get box(){return new He.Box(this.pc.x-this.r,this.pc.y-this.r,this.pc.x+this.r,this.pc.y+this.r)}contains(t){if(t instanceof He.Point)return He.Utils.LE(t.distanceTo(this.center)[0],this.r);if(t instanceof He.Segment)return He.Utils.LE(t.start.distanceTo(this.center)[0],this.r)&&He.Utils.LE(t.end.distanceTo(this.center)[0],this.r);if(t instanceof He.Arc)return this.intersect(t).length===0&&He.Utils.LE(t.start.distanceTo(this.center)[0],this.r)&&He.Utils.LE(t.end.distanceTo(this.center)[0],this.r);if(t instanceof He.Circle)return this.intersect(t).length===0&&He.Utils.LE(t.r,this.r)&&He.Utils.LE(t.center.distanceTo(this.center)[0],this.r)}toArc(t=!0){return new He.Arc(this.center,this.r,Math.PI,-Math.PI,t)}scale(t,n){if(t!==n)throw tu.OPERATION_IS_NOT_SUPPORTED;if(!(this.pc.x===0&&this.pc.y===0))throw tu.OPERATION_IS_NOT_SUPPORTED;return new He.Circle(this.pc,this.r*t)}transform(t=new He.Matrix){return new He.Circle(this.pc.transform(t),this.r)}intersect(t){if(t instanceof He.Point)return this.contains(t)?[t]:[];if(t instanceof He.Line)return KF(t,this);if(t instanceof He.Ray)return BCt(t,this);if(t instanceof He.Segment)return NAe(t,this);if(t instanceof He.Circle)return CCt(t,this);if(t instanceof He.Box)return Xxo(this,t);if(t instanceof He.Arc)return RRe(t,this);if(t instanceof He.Polygon)return PCt(this,t);if(t instanceof He.Multiline)return TX(this,t)}distanceTo(t){if(t instanceof He.Point){let[n,o]=He.Distance.point2circle(t,this);return o=o.reverse(),[n,o]}if(t instanceof He.Circle){let[n,o]=He.Distance.circle2circle(this,t);return[n,o]}if(t instanceof He.Line){let[n,o]=He.Distance.circle2line(this,t);return[n,o]}if(t instanceof He.Segment){let[n,o]=He.Distance.segment2circle(t,this);return o=o.reverse(),[n,o]}if(t instanceof He.Arc){let[n,o]=He.Distance.arc2circle(t,this);return o=o.reverse(),[n,o]}if(t instanceof He.Box){let[n,o]=He.Distance.shape2polygon(this,new He.Polygon(t));return[n,o]}if(t instanceof He.Polygon){let[n,o]=He.Distance.shape2polygon(this,t);return[n,o]}if(t instanceof He.PlanarSet){let[n,o]=He.Distance.shape2planarSet(this,t);return[n,o]}if(t instanceof He.Multiline){let[n,o]=He.Distance.shape2multiline(this,t);return[n,o]}}get name(){return"circle"}svg(t={}){return`
<circle cx="${this.pc.x}" cy="${this.pc.y}" r="${this.r}"
                ${jF({fill:"none",...t})} />`}};He.Circle=ZF;He.circle=T5o;Ap=class Ap extends xM{constructor(...e){super();if(this.pc=new He.Point,this.r=1,this.startAngle=0,this.endAngle=2*Math.PI,this.counterClockwise=!0,e.length===0)return;if(e.length===1&&e[0]instanceof Object&&e[0].name==="arc"){let{pc:t,r:n,startAngle:o,endAngle:r,counterClockwise:i}=e[0];this.pc=new He.Point(t.x,t.y),this.r=n,this.startAngle=o,this.endAngle=r,this.counterClockwise=i}else{let[t,n,o,r,i]=[...e];if(t&&t instanceof He.Point)this.pc=t.clone();if(n!==void 0)this.r=n;if(o!==void 0)this.startAngle=o;if(r!==void 0)this.endAngle=r;if(i!==void 0)this.counterClockwise=i}}clone(){return new He.Arc(this.pc.clone(),this.r,this.startAngle,this.endAngle,this.counterClockwise)}get sweep(){let e=this.startAngle,t=this.endAngle;if(He.Utils.EQ(Math.abs(e-t),He.PIx2))return He.PIx2;if(Math.abs(e)>He.PIx2)e-=Math.trunc(e/He.PIx2)*He.PIx2;if(e<0)e+=He.PIx2;if(Math.abs(t)>He.PIx2)t-=Math.trunc(t/He.PIx2)*He.PIx2;if(t<0)t+=He.PIx2;let n=this.counterClockwise?t-e:e-t;if(n<0)n+=He.PIx2;return n}get start(){return new He.Point(this.pc.x+this.r,this.pc.y).rotate(this.startAngle,this.pc)}get end(){return new He.Point(this.pc.x+this.r,this.pc.y).rotate(this.endAngle,this.pc)}get center(){return this.pc.clone()}get vertices(){return[this.start.clone(),this.end.clone()]}get length(){return Math.abs(this.sweep*this.r)}get box(){let t=this.breakToFunctional().reduce((n,o)=>n.merge(o.start.box),new He.Box);return t=t.merge(this.end.box),t}contains(e){if(!He.Utils.EQ(this.pc.distanceTo(e)[0],this.r))return!1;if(e.equalTo(this.start))return!0;let t=new He.Vector(this.pc,e).slope,n=new He.Arc(this.pc,this.r,this.startAngle,t,this.counterClockwise);return He.Utils.LE(n.length,this.length)}split(e){if(this.start.equalTo(e))return[null,this.clone()];if(this.end.equalTo(e))return[this.clone(),null];let t=new He.Vector(this.pc,e).slope;return[new He.Arc(this.pc,this.r,this.startAngle,t,this.counterClockwise),new He.Arc(this.pc,this.r,t,this.endAngle,this.counterClockwise)]}middle(){let e=this.counterClockwise?this.startAngle+this.sweep/2:this.startAngle-this.sweep/2;return new He.Arc(this.pc,this.r,this.startAngle,e,this.counterClockwise).end}pointAtLength(e){if(e>this.length||e<0)return null;if(e===0)return this.start;if(e===this.length)return this.end;let t=e/this.length,n=this.counterClockwise?this.startAngle+this.sweep*t:this.startAngle-this.sweep*t;return new He.Arc(this.pc,this.r,this.startAngle,n,this.counterClockwise).end}chordHeight(){return(1-Math.cos(Math.abs(this.sweep/2)))*this.r}intersect(e){if(e instanceof He.Point)return this.contains(e)?[e]:[];if(e instanceof He.Line)return TAe(e,this);if(e instanceof He.Ray)return HRe(e,this);if(e instanceof He.Circle)return RRe(this,e);if(e instanceof He.Segment)return BX(e,this);if(e instanceof He.Box)return jxo(this,e);if(e instanceof He.Arc)return bCt(this,e);if(e instanceof He.Polygon)return kRe(this,e);if(e instanceof He.Multiline)return TX(this,e)}distanceTo(e){if(e instanceof He.Point){let[t,n]=He.Distance.point2arc(e,this);return n=n.reverse(),[t,n]}if(e instanceof He.Circle){let[t,n]=He.Distance.arc2circle(this,e);return[t,n]}if(e instanceof He.Line){let[t,n]=He.Distance.arc2line(this,e);return[t,n]}if(e instanceof He.Segment){let[t,n]=He.Distance.segment2arc(e,this);return n=n.reverse(),[t,n]}if(e instanceof He.Arc){let[t,n]=He.Distance.arc2arc(this,e);return[t,n]}if(e instanceof He.Box){let[t,n]=He.Distance.shape2polygon(this,new He.Polygon(e));return[t,n]}if(e instanceof He.Polygon){let[t,n]=He.Distance.shape2polygon(this,e);return[t,n]}if(e instanceof He.PlanarSet){let[t,n]=He.Distance.shape2planarSet(this,e);return[t,n]}if(e instanceof He.Multiline)return He.Distance.shape2multiline(this,e)}breakToFunctional(){let e=[],t=[0,Math.PI/2,Math.PI,3*Math.PI/2],n=this.startAngle,o=this.endAngle;if(He.Utils.EQ(Math.abs(n-o),He.PIx2))o=n;if(Math.abs(n)>He.PIx2)n-=Math.trunc(n/He.PIx2)*He.PIx2;if(n<0)n+=He.PIx2;if(Math.abs(o)>He.PIx2)o-=Math.trunc(o/He.PIx2)*He.PIx2;if(o<0)o+=He.PIx2;let r=n,i,s,a;if(this.counterClockwise)s=Math.ceil(n/(Math.PI/2))%4,a=1;else s=Math.floor(n/(Math.PI/2))%4,a=-1;for(let c=0,l=s;c<4;c++,l=(l+a+4)%4){if(i=t[l],i===r)continue;let h=this.counterClockwise?i-n:n-i;if(h<0)h+=He.PIx2;if(h>this.sweep)break;e.push(new He.Arc(this.pc,this.r,r,i,this.counterClockwise)),r=i}if(e.length===0)return e.push(this),e;if(i=o,r!==i)e.push(new He.Arc(this.pc,this.r,r,i,this.counterClockwise));return e}tangentInStart(){let e=new He.Vector(this.pc,this.start),t=this.counterClockwise?Math.PI/2:-Math.PI/2;return e.rotate(t).normalize()}tangentInEnd(){let e=new He.Vector(this.pc,this.end),t=this.counterClockwise?-Math.PI/2:Math.PI/2;return e.rotate(t).normalize()}reverse(){return new He.Arc(this.pc,this.r,this.endAngle,this.startAngle,!this.counterClockwise)}transform(e=new He.Matrix){let t=this.start.transform(e),n=this.end.transform(e),o=this.pc.transform(e),r=this.counterClockwise;if(e.a*e.d<0)r=!r;return He.Arc.arcSE(o,t,n,r)}static arcSE(e,t,n,o){let{vector:r}=He,i=r(e,t).slope,s=r(e,n).slope;if(He.Utils.EQ(i,s))s+=2*Math.PI,o=!0;let a=r(e,t).length;return new He.Arc(e,a,i,s,o)}definiteIntegral(e=0){return this.breakToFunctional().reduce((o,r)=>o+r.circularSegmentDefiniteIntegral(e),0)}circularSegmentDefiniteIntegral(e){let n=new He.Segment(this.start,this.end).definiteIntegral(e),o=He.Utils.EQ(this.sweep,He.PIx2)?0:this.circularSegmentArea();return this.counterClockwise?n-o:n+o}circularSegmentArea(){return 0.5*this.r*this.r*(this.sweep-Math.sin(this.sweep))}sortPoints(e){let{vector:t}=He;return e.slice().sort((n,o)=>{let r=t(this.pc,n).slope,i=t(this.pc,o).slope;if(r<i)return-1;if(r>i)return 1;return 0})}get name(){return"arc"}svg(e={}){let t=this.sweep<=Math.PI?"0":"1",n=this.counterClockwise?"1":"0";if(He.Utils.EQ(this.sweep,2*Math.PI))return new He.Circle(this.pc,this.r).svg(e);else return`
<path d="M${this.start.x},${this.start.y}
                             A${this.r},${this.r} 0 ${t},${n} ${this.end.x},${this.end.y}"
                    ${jF({fill:"none",...e})} />`}};He.Arc=Ap;He.arc=D5o;rA=class rA extends xM{constructor(e=void 0,t=void 0,n=void 0,o=void 0){super();this.xmin=e,this.ymin=t,this.xmax=n,this.ymax=o}clone(){return new rA(this.xmin,this.ymin,this.xmax,this.ymax)}get low(){return new He.Point(this.xmin,this.ymin)}get high(){return new He.Point(this.xmax,this.ymax)}get max(){return this.clone()}get center(){return new He.Point((this.xmin+this.xmax)/2,(this.ymin+this.ymax)/2)}get width(){return Math.abs(this.xmax-this.xmin)}get height(){return Math.abs(this.ymax-this.ymin)}get box(){return this.clone()}not_intersect(e){return this.xmax<e.xmin||this.xmin>e.xmax||this.ymax<e.ymin||this.ymin>e.ymax}intersect(e){return!this.not_intersect(e)}merge(e){return new rA(this.xmin===void 0?e.xmin:Math.min(this.xmin,e.xmin),this.ymin===void 0?e.ymin:Math.min(this.ymin,e.ymin),this.xmax===void 0?e.xmax:Math.max(this.xmax,e.xmax),this.ymax===void 0?e.ymax:Math.max(this.ymax,e.ymax))}less_than(e){if(this.low.lessThan(e.low))return!0;if(this.low.equalTo(e.low)&&this.high.lessThan(e.high))return!0;return!1}equal_to(e){return this.low.equalTo(e.low)&&this.high.equalTo(e.high)}output(){return this.clone()}comparable_less_than(e,t){return e.lessThan(t)}set(e,t,n,o){this.xmin=e,this.ymin=t,this.xmax=n,this.ymax=o}extend(e){if(e<=0)return this.clone();return new rA(this.xmin-e,this.ymin-e,this.xmax+e,this.ymax+e)}toPoints(){return[new He.Point(this.xmin,this.ymin),new He.Point(this.xmax,this.ymin),new He.Point(this.xmax,this.ymax),new He.Point(this.xmin,this.ymax)]}toSegments(){let e=this.toPoints();return[new He.Segment(e[0],e[1]),new He.Segment(e[1],e[2]),new He.Segment(e[2],e[3]),new He.Segment(e[3],e[0])]}rotate(e,t=new He.Point){throw tu.OPERATION_IS_NOT_SUPPORTED}transform(e=new He.Matrix){return this.toPoints().map((n)=>n.transform(e)).reduce((n,o)=>n.merge(o.box),new rA)}contains(e){if(e instanceof He.Point)return e.x>=this.xmin&&e.x<=this.xmax&&e.y>=this.ymin&&e.y<=this.ymax;if(e instanceof He.Segment)return e.vertices.every((t)=>this.contains(t));if(e instanceof He.Box)return e.toSegments().every((t)=>this.contains(t));if(e instanceof He.Circle)return this.contains(e.box);if(e instanceof He.Arc)return e.vertices.every((t)=>this.contains(t))&&this.toSegments().every((t)=>BX(t,e).length===0);if(e instanceof He.Line||e instanceof He.Ray)return!1;if(e instanceof He.Multiline)return e.toShapes().every((t)=>this.contains(t));if(e instanceof He.Polygon)return this.contains(e.box)}distanceTo(e){let t=this.toSegments().map((o)=>o.distanceTo(e)),n=[Number.MAX_SAFE_INTEGER,null];return t.forEach((o)=>{if(o[0]<n[0])n=o}),n}get name(){return"box"}svg(e={}){let t=this.xmax-this.xmin,n=this.ymax-this.ymin;return`
<rect x="${this.xmin}" y="${this.ymin}" width="${t}" height="${n}"
                ${jF({fill:"none",...e})} />`}};He.Box=rA;He.box=N5o;He.Edge=kAe;GCt=class GCt extends BAe{constructor(e,t){super(e,t);this.setCircularLinks()}setCircularLinks(){if(this.isEmpty())return;this.last.next=this.first,this.first.prev=this.last}[Symbol.iterator](){let e=void 0;return{next:()=>{let t=e?e:this.first,n=this.first?e?e===this.first:!1:!0;return e=t?t.next:void 0,{value:t,done:n}}}}append(e){return super.append(e),this.setCircularLinks(),this}insert(e,t){return super.insert(e,t),this.setCircularLinks(),this}remove(e){return super.remove(e),this}};vX=class vX extends GCt{constructor(e,...t){super();if(this._box=void 0,this._orientation=void 0,t.length===0)return;if(t.length===1){if(t[0]instanceof Array){let n=t[0];if(n.length===0)return;if(n.every((o)=>o instanceof He.Point)){let o=vX.points2segments(n);this.shapes2face(e.edges,o)}else if(n.every((o)=>o instanceof Array&&o.length===2)){let o=n.map((i)=>new He.Point(i[0],i[1])),r=vX.points2segments(o);this.shapes2face(e.edges,r)}else if(n.every((o)=>o instanceof He.Segment||o instanceof He.Arc))this.shapes2face(e.edges,n);else if(n.every((o)=>o.name==="segment"||o.name==="arc")){let o=[];for(let r of n){let i;if(r.name==="segment")i=new He.Segment(r);else i=new He.Arc(r);o.push(i)}this.shapes2face(e.edges,o)}}else if(t[0]instanceof vX){let n=t[0];this.first=n.first,this.last=n.last;for(let o of n)e.edges.add(o)}else if(t[0]instanceof He.Circle)this.shapes2face(e.edges,[t[0].toArc(!0)]);else if(t[0]instanceof He.Box){let n=t[0];this.shapes2face(e.edges,[new He.Segment(new He.Point(n.xmin,n.ymin),new He.Point(n.xmax,n.ymin)),new He.Segment(new He.Point(n.xmax,n.ymin),new He.Point(n.xmax,n.ymax)),new He.Segment(new He.Point(n.xmax,n.ymax),new He.Point(n.xmin,n.ymax)),new He.Segment(new He.Point(n.xmin,n.ymax),new He.Point(n.xmin,n.ymin))])}}if(t.length===2&&t[0]instanceof He.Edge&&t[1]instanceof He.Edge)this.first=t[0],this.last=t[1],this.last.next=this.first,this.first.prev=this.last,this.setArcLength()}get edges(){return this.toArray()}get vertices(){return this.edges.map((e)=>e.shape.start.clone())}get shapes(){return this.edges.map((e)=>e.shape.clone())}get box(){if(this._box===void 0){let e=new He.Box;for(let t of this)e=e.merge(t.box);this._box=e}return this._box}get perimeter(){return this.last.arc_length+this.last.length}pointAtLength(e){if(e>this.perimeter||e<0)return null;let t=null;for(let n of this)if(e>=n.arc_length&&(n===this.last||e<n.next.arc_length)){t=n.pointAtLength(e-n.arc_length);break}return t}static points2segments(e){let t=[];for(let n=0;n<e.length;n++){if(e[n].equalTo(e[(n+1)%e.length]))continue;t.push(new He.Segment(e[n],e[(n+1)%e.length]))}return t}shapes2face(e,t){for(let n of t){let o=new He.Edge(n);this.append(o),e.add(o)}}append(e){return super.append(e),this.setOneEdgeArcLength(e),e.face=this,this}insert(e,t){return super.insert(e,t),this.setOneEdgeArcLength(e),e.face=this,this}remove(e){return super.remove(e),this.setArcLength(),this}merge_with_next_edge(e){return e.shape.end.x=e.next.shape.end.x,e.shape.end.y=e.next.shape.end.y,this.remove(e.next),this}reverse(){let e=[],t=this.last;do t.shape=t.shape.reverse(),e.push(t),t=t.prev;while(t!==this.last);this.first=void 0,this.last=void 0;for(let n of e){if(this.first===void 0)n.prev=n,n.next=n,this.first=n,this.last=n;else n.prev=this.last,this.last.next=n,this.last=n,this.last.next=this.first,this.first.prev=this.last;this.setOneEdgeArcLength(n)}if(this._orientation!==void 0)this._orientation=void 0,this._orientation=this.orientation()}setArcLength(){for(let e of this)this.setOneEdgeArcLength(e),e.face=this}setOneEdgeArcLength(e){if(e===this.first)e.arc_length=0;else e.arc_length=e.prev.arc_length+e.prev.length}area(){return Math.abs(this.signedArea())}signedArea(){let e=0,t=this.box.ymin;for(let n of this)e+=n.shape.definiteIntegral(t);return e}orientation(){if(this._orientation===void 0){let e=this.signedArea();if(He.Utils.EQ_0(e))this._orientation=UF.NOT_ORIENTABLE;else if(He.Utils.LT(e,0))this._orientation=UF.CCW;else this._orientation=UF.CW}return this._orientation}isSimple(e){return vX.getSelfIntersections(this,e,!0).length===0}static getSelfIntersections(e,t,n=!1){let o=[];for(let r of e){let i=t.search(r.box);for(let s of i){if(r===s)continue;if(s.face!==e)continue;if(r.shape instanceof He.Segment&&s.shape instanceof He.Segment&&(r.next===s||r.prev===s))continue;let a=r.shape.intersect(s.shape);for(let c of a){if(c.equalTo(r.start)&&c.equalTo(s.end)&&s===r.prev)continue;if(c.equalTo(r.end)&&c.equalTo(s.start)&&s===r.next)continue;if(o.push(c),n)break}if(o.length>0&&n)break}if(o.length>0&&n)break}return o}findEdgeByPoint(e){let t;for(let n of this){if(e.equalTo(n.shape.start))continue;if(e.equalTo(n.shape.end)||n.shape.contains(e)){t=n;break}}return t}toPolygon(){return new He.Polygon(this.shapes)}toJSON(){return this.edges.map((e)=>e.toJSON())}svg(){let e=`M${this.first.start.x},${this.first.start.y}`;for(let t of this)e+=t.svg();return e+=" z",e}};He.Face=vX;ORe=class ORe extends xM{constructor(...e){super();if(this.pt=new He.Point,this.norm=new He.Vector(0,1),e.length===0)return;if(e.length>=1&&e[0]instanceof He.Point)this.pt=e[0].clone();if(e.length===1)return;if(e.length===2&&e[1]instanceof He.Vector){this.norm=e[1].clone();return}throw tu.ILLEGAL_PARAMETERS}clone(){return new ORe(this.pt,this.norm)}get slope(){return new He.Vector(this.norm.y,-this.norm.x).slope}get box(){let e=this.slope;return new He.Box(e>Math.PI/2&&e<3*Math.PI/2?Number.NEGATIVE_INFINITY:this.pt.x,e>=0&&e<=Math.PI?this.pt.y:Number.NEGATIVE_INFINITY,e>=Math.PI/2&&e<=3*Math.PI/2?this.pt.x:Number.POSITIVE_INFINITY,e>=Math.PI&&e<=2*Math.PI||e===0?this.pt.y:Number.POSITIVE_INFINITY)}get start(){return this.pt}get end(){return}get length(){return Number.POSITIVE_INFINITY}contains(e){if(this.pt.equalTo(e))return!0;let t=new He.Vector(this.pt,e);return He.Utils.EQ_0(this.norm.dot(t))&&He.Utils.GE(t.cross(this.norm),0)}coord(e){return JF(e.x,e.y).cross(this.norm)}split(e){if(!this.contains(e))return[];if(this.pt.equalTo(e))return[this];return[new He.Segment(this.pt,e),new He.Ray(e,this.norm)]}intersect(e){if(e instanceof He.Point)return this.contains(e)?[e]:[];if(e instanceof He.Segment)return LRe(this,e);if(e instanceof He.Arc)return HRe(this,e);if(e instanceof He.Line)return TCt(this,e);if(e instanceof He.Ray)return t5o(this,e);if(e instanceof He.Circle)return BCt(this,e);if(e instanceof He.Box)return e5o(this,e);if(e instanceof He.Polygon)return DCt(this,e);if(e instanceof He.Multiline)return TX(this,e)}rotate(e,t=new He.Point){return new He.Ray(this.pt.rotate(e,t),this.norm.rotate(e))}transform(e){return new He.Ray(this.pt.transform(e),this.norm.clone())}get name(){return"ray"}svg(e,t={}){let n=new He.Line(this.pt,this.norm),o=SX(n,e);if(o=o.filter((i)=>this.contains(i)),o.length===0||o.length===2)return"";return new He.Segment(this.pt,o[0]).svg(t)}};He.Ray=ORe;He.ray=R5o;He.Polygon=tl;He.polygon=Q5o;({Circle:vRe,Line:mCt,Point:_Ct,Vector:MAe,Utils:SRe}=He);He.Inversion=Ire;He.inversion=k5o;He.Distance=Ur;({Multiline:L5o,Point:UCt,Segment:H5o,Polygon:WCt}=He);He.isWktString=G5o;He.parseWKT=KCt;He.BooleanOperations=DX;He.Relations=E5o});function JCt(e,t,n){if(!t||!n)return;let o=e.get(t);if(!o)o=new Set,e.set(t,o);o.add(n);let r=e.get(n);if(!r)r=new Set,e.set(n,r);r.add(t)}function HX(e,t){if(!t.subcircuit_id&&!t.source_group_id)return[...e];let n=t;if(t.subcircuit_id){let a=new Set([t.subcircuit_id]),c=new Map,l=new Map;for(let d of e)if(d.type==="source_group"){let{source_group_id:u,subcircuit_id:_}=d;if(_)l.set(u,_);let p=d.parent_source_group_id;if(p){if(!c.has(p))c.set(p,[]);c.get(p).push(u)}}let h;for(let[d,u]of l)if(u===t.subcircuit_id){h=d;break}if(h){let d=(u)=>{let _=c.get(u)||[];for(let p of _){let m=l.get(p);if(m)a.add(m);d(p)}};d(h),n={...t,subcircuit_ids:Array.from(a)}}}let o=new Map;for(let a of e){let c=`${a.type}_id`,l=a[c];if(typeof l==="string")o.set(l,a)}let r=new Map;for(let a of e){let c=Object.entries(a);for(let[l,h]of c){if(l==="parent_source_group_id")continue;if(l.endsWith("_id")&&typeof h==="string"){let d=o.get(h);JCt(r,a,d)}else if(l.endsWith("_ids")&&Array.isArray(h)){for(let d of h)if(typeof d==="string"){let u=o.get(d);JCt(r,a,u)}}}}let i=[],s=new Set;for(let a of e){let c=!1;if(n.subcircuit_id&&"subcircuit_id"in a&&a.subcircuit_id===n.subcircuit_id)c=!0;else if(n.subcircuit_ids&&"subcircuit_id"in a&&a.subcircuit_id&&n.subcircuit_ids.includes(a.subcircuit_id))c=!0;else if(n.source_group_id&&"source_group_id"in a&&a.source_group_id===n.source_group_id)c=!0;else if(n.source_group_id&&"member_source_group_ids"in a&&Array.isArray(a.member_source_group_ids)&&a.member_source_group_ids.includes(n.source_group_id))c=!0;if(c)i.push(a),s.add(a)}while(i.length>0){let a=i.shift(),c=r.get(a);if(!c)continue;for(let l of c)if(!s.has(l))s.add(l),i.push(l)}return e.filter((a)=>s.has(a))}function GRe(e){let t=e.type;return`${t}:${e[`${t}_id`]}`}function t4o(e,t){let n=O1(e).pcb_smtpad.get(t);if(!n||!n.pcb_port_id)return`smtpad[${t}]`;return lbt(e,n.pcb_port_id)}function n4o(e,t){let n=O1(e).pcb_trace.get(t);if(!n)return`trace[${t}]`;let o=n.route.flatMap((s)=>[s.start_pcb_port_id,s.end_pcb_port_id]).filter(Boolean);if(o.length===0)return`trace[${t}]`;function r(s){let a=O1(e).pcb_port.get(s);if(!a)return null;let c=a.pcb_component_id?O1(e).pcb_component.get(a.pcb_component_id):void 0;if(!c)return null;let l=O1(e).source_component.get(c.source_component_id);if(!l)return null;let h=O1(e).source_port.get(a.source_port_id),d=h?.port_hints?h.port_hints[1]:"";return{componentName:l.name,portHint:d}}return`trace[${o.map((s)=>{let a=r(s);if(a)return`.${a.componentName} > port.${a.portHint}`;return`port[${s}]`}).join(", ")}]`}function FAe(e){let t=new Map,n=new Map,o=new Map;for(let c of e)switch(c.type){case"pcb_board":o.set(c.pcb_board_id,c);break;case"source_group":{let l=c.parent_subcircuit_id??c.parent_source_group_id;if(n.set(c.source_group_id,c.subcircuit_id??l),c.is_subcircuit&&c.subcircuit_id)n.set(c.subcircuit_id,l);break}case"pcb_group":n.set(c.pcb_group_id,c.subcircuit_id??c.source_group_id);break;case"pcb_component":n.set(c.pcb_component_id,c.subcircuit_id??c.pcb_group_id);break;case"pcb_trace":n.set(c.pcb_trace_id,c.subcircuit_id??c.pcb_group_id??c.pcb_component_id);break;case"pcb_via":n.set(c.pcb_via_id,c.subcircuit_id??c.pcb_group_id??c.pcb_trace_id);break}let r=[...o.values()];for(let c of r)if(t.set(c.pcb_board_id,c),c.subcircuit_id)t.set(c.subcircuit_id,c);let i=r.length===1?r[0]:void 0,s=new Set;function a(c){if(t.has(c))return t.get(c);if(!n.has(c))return;if(s.has(c))return;s.add(c);let l=n.get(c),h=i;if(l)h=a(l);return s.delete(c),t.set(c,h),h}for(let c of n.keys())a(c);return t}function l4o(e){let t=0;if(e.length==0)return t;for(var n=0;n<e.length;n++){var o=e.charCodeAt(n);t=(t<<5)-t+o,t=t&t}return Math.abs(t)}function YAe(e,t={}){if(e.length===0)return{width:0,height:0};let n=t.direction??"row",o=t.columnGap??0,r=t.rowGap??0;if(n==="row"||n==="row-reverse"){let a=e.reduce((l,h)=>l+h.width,0)+o*Math.max(0,e.length-1),c=e.reduce((l,h)=>Math.max(l,h.height),0);return{width:a,height:c}}else{let a=e.reduce((l,h)=>l+h.height,0)+r*Math.max(0,e.length-1);return{width:e.reduce((l,h)=>Math.max(l,h.width),0),height:a}}}function GAe(e){if(e.type==="pcb_smtpad")return[`${e.layer}_copper`];if(e.type==="pcb_trace"){if(!e.route||!Array.isArray(e.route))return[];let t=new Set;for(let n of e.route)if("layer"in n&&n.layer)t.add(`${n.layer}_copper`);return Array.from(t)}if(e.type==="pcb_copper_pour")return[`${e.layer}_copper`];if(e.type==="pcb_copper_text")return[`${e.layer}_copper`];if(e.type==="pcb_silkscreen_text"||e.type==="pcb_silkscreen_rect"||e.type==="pcb_silkscreen_circle"||e.type==="pcb_silkscreen_line"||e.type==="pcb_silkscreen_path")return[`${e.layer}_silkscreen`];if(e.type==="pcb_fabrication_note_text"||e.type==="pcb_fabrication_note_rect"||e.type==="pcb_fabrication_note_path")return[`${e.layer}_fabrication_note`];if(e.type==="pcb_courtyard_circle"||e.type==="pcb_courtyard_polygon"||e.type==="pcb_courtyard_rect"||e.type==="pcb_courtyard_outline")return[`${e.layer}_courtyard`];if(e.type==="pcb_note_rect"||e.type==="pcb_note_path"||e.type==="pcb_note_text"||e.type==="pcb_note_line"||e.type==="pcb_note_dimension")return[`${e.layer}_user_note`];return[]}var ra,ubt,pbt,_bt,Abt,FX,O1=(e,t={})=>{let n=e,o=n._internal_store;if(!o){o={counts:{},editCount:0},n._internal_store=o;for(let i of n){let s=i.type,a=i[`${s}_id`];if(!a)continue;let c=Number.parseInt(a.split("_").pop());if(!Number.isNaN(c))o.counts[s]=Math.max(o.counts[s]??0,c)}}let r=new Proxy({},{get:(i,s)=>{if(s==="toArray")return()=>(n.editCount=o.editCount,n);if(s==="editCount")return o.editCount;if(s==="subtree")return(c)=>O1(HX(n,c),t);if(s==="insert")return(c)=>{let l=c.type;if(!l)throw Error("insert requires an element with a type");o.counts[l]??=-1,o.counts[l]++;let h=o.counts[l],d={...c,type:l,[`${l}_id`]:`${l}_${h}`};if(t.validateInserts)(PN[l]??SN).parse(d);return n.push(d),o.editCount++,d};if(s==="insertAll")return(c)=>c.map((l)=>r.insert(l));let a=s;return{get:(c)=>n.find((l)=>l.type===a&&l[`${a}_id`]===c),getUsing:(c)=>{let l=Object.keys(c);if(l.length!==1)throw Error("getUsing requires exactly one key, e.g. { pcb_component_id }");let h=l[0],d=h.replace("_id",""),u=n.find((_)=>_.type===d&&_[h]===c[h]);if(!u)return null;return n.find((_)=>_.type===a&&_[`${a}_id`]===u[`${a}_id`])},getWhere:(c)=>{let l=Object.keys(c);return n.find((h)=>h.type===a&&l.every((d)=>h[d]===c[d]))},list:(c)=>{let l=!c?[]:Object.keys(c);return n.filter((h)=>h.type===a&&l.every((d)=>h[d]===c[d]))},insert:(c)=>{o.counts[a]??=-1,o.counts[a]++;let l=o.counts[a],h={type:a,[`${a}_id`]:`${a}_${l}`,...c};if(t.validateInserts)(PN[a]??SN).parse(h);return n.push(h),o.editCount++,h},delete:(c)=>{let l=n.find((h)=>h[`${a}_id`]===c);if(!l)return;n.splice(n.indexOf(l),1),o.editCount++},update:(c,l)=>{let h=n.find((d)=>d.type===a&&d[`${a}_id`]===c);if(!h)return null;return Object.assign(h,l),o.editCount++,h},select:(c)=>{if(a==="source_component")return n.find((l)=>l.type==="source_component"&&l.name===c.replace(/\./g,""));else if(a==="pcb_port"||a==="source_port"||a==="schematic_port"){let[l,h]=c.replace(/\./g,"").split(/[\s\>]+/),d=n.find((_)=>_.type==="source_component"&&_.name===l);if(!d)return null;let u=n.find((_)=>_.type==="source_port"&&_.source_component_id===d.source_component_id&&(_.name===h||(_.port_hints??[]).includes(h)));if(!u)return null;if(a==="source_port")return u;if(a==="pcb_port")return n.find((_)=>_.type==="pcb_port"&&_.source_port_id===u.source_port_id);else if(a==="schematic_port")return n.find((_)=>_.type==="schematic_port"&&_.source_port_id===u.source_port_id)}}}}});return r},Ho,As,HAe=(e,t={})=>{let n=e._internal_store_indexed;if(!n){n={counts:{},editCount:0,indexes:{}};for(let s of e){let a=s.type,c=s[`${a}_id`];if(!c)continue;let l=Number.parseInt(c.split("_").pop()||"");if(!Number.isNaN(l))n.counts[a]=Math.max(n.counts[a]??0,l)}let r=t.indexConfig||{},i=n.indexes;if(r.byId)i.byId=new Map;if(r.byType)i.byType=new Map;if(r.byRelation)i.byRelation=new Map;if(r.bySubcircuit)i.bySubcircuit=new Map;if(r.byCustomField&&r.byCustomField.length>0){i.byCustomField=new Map;for(let s of r.byCustomField)i.byCustomField.set(s,new Map)}for(let s of e){if(r.byId){let a=GRe(s);i.byId.set(a,s)}if(r.byType){let a=i.byType.get(s.type)||[];a.push(s),i.byType.set(s.type,a)}if(r.byRelation){let a=Object.entries(s);for(let[c,l]of a)if(c.endsWith("_id")&&c!==`${s.type}_id`&&typeof l==="string"){let h=i.byRelation.get(c)||new Map,d=h.get(l)||[];d.push(s),h.set(l,d),i.byRelation.set(c,h)}}if(r.bySubcircuit&&"subcircuit_id"in s){let a=s.subcircuit_id;if(a&&typeof a==="string"){let c=i.bySubcircuit.get(a)||[];c.push(s),i.bySubcircuit.set(a,c)}}if(r.byCustomField&&i.byCustomField){for(let a of r.byCustomField)if(a in s){let c=s[a];if(c!==void 0&&(typeof c==="string"||typeof c==="number")){let l=String(c),h=i.byCustomField.get(a),d=h.get(l)||[];d.push(s),h.set(l,d)}}}}e._internal_store_indexed=n}let o=new Proxy({},{get:(r,i)=>{if(i==="toArray")return()=>(e.editCount=n.editCount,e);if(i==="editCount")return n.editCount;if(i==="insert")return(a)=>{let{type:c,...l}=a;if(!c)throw Error("insert requires an element with a type");return delete l[`${c}_id`],o[c].insert(l)};if(i==="insertAll")return(a)=>a.map((c)=>o.insert(c));if(i==="subtree")return(a)=>HAe(HX(e,a),t);let s=i;return{get:(a)=>{let c=t.indexConfig||{};if(c.byId&&n.indexes.byId)return n.indexes.byId.get(`${s}:${a}`)||null;if(c.byType&&n.indexes.byType)return(n.indexes.byType.get(s)||[]).find((h)=>h[`${s}_id`]===a)||null;return e.find((l)=>l.type===s&&l[`${s}_id`]===a)||null},getUsing:(a)=>{let c=t.indexConfig||{},l=Object.keys(a);if(l.length!==1)throw Error("getUsing requires exactly one key, e.g. { pcb_component_id }");let h=l[0],d=h.replace("_id","");if(c.byRelation&&n.indexes.byRelation){let _=n.indexes.byRelation.get(h);if(_){let m=(_.get(a[h])||[]).find((g)=>g.type===d);if(!m)return null;let A=m[`${s}_id`];if(c.byId&&n.indexes.byId)return n.indexes.byId.get(`${s}:${A}`)||null;if(c.byType&&n.indexes.byType)return(n.indexes.byType.get(s)||[]).find((f)=>f[`${s}_id`]===A)||null;return e.find((g)=>g.type===s&&g[`${s}_id`]===A)||null}}let u=e.find((_)=>_.type===d&&_[h]===a[h]);if(!u)return null;return e.find((_)=>_.type===s&&_[`${s}_id`]===u[`${s}_id`])||null},getWhere:(a)=>{let c=t.indexConfig||{},l=Object.keys(a);if(l.length===1&&c.byCustomField&&n.indexes.byCustomField){let h=l[0],d=n.indexes.byCustomField.get(h);if(d){let u=String(a[h]);return(d.get(u)||[]).find((p)=>p.type===s)||null}}if("subcircuit_id"in a&&c.bySubcircuit&&n.indexes.bySubcircuit){let h=a.subcircuit_id;return(n.indexes.bySubcircuit.get(h)||[]).find((u)=>u.type===s&&l.every((_)=>u[_]===a[_]))||null}if(c.byType&&n.indexes.byType)return(n.indexes.byType.get(s)||[]).find((d)=>l.every((u)=>d[u]===a[u]))||null;return e.find((h)=>h.type===s&&l.every((d)=>h[d]===a[d]))||null},list:(a)=>{let c=t.indexConfig||{},l=!a?[]:Object.keys(a);if(l.length===0&&c.byType&&n.indexes.byType)return(n.indexes.byType.get(s)||[]).slice();if(l.length===1&&l[0]==="subcircuit_id"&&c.bySubcircuit&&n.indexes.bySubcircuit){let d=a.subcircuit_id;return(n.indexes.bySubcircuit.get(d)||[]).filter((_)=>_.type===s)}let h;if(c.byType&&n.indexes.byType)h=n.indexes.byType.get(s)||[];else h=e.filter((d)=>d.type===s);if(l.length>0)return h.filter((d)=>l.every((u)=>d[u]===a[u]));return h.slice()},insert:(a)=>{n.counts[s]??=-1,n.counts[s]++;let c=n.counts[s],l={type:s,[`${s}_id`]:`${s}_${c}`,...a};if(t.validateInserts)(PN[s]??SN).parse(l);e.push(l),n.editCount++;let h=t.indexConfig||{};if(h.byId&&n.indexes.byId){let d=GRe(l);n.indexes.byId.set(d,l)}if(h.byType&&n.indexes.byType){let d=n.indexes.byType.get(s)||[];d.push(l),n.indexes.byType.set(s,d)}if(h.byRelation&&n.indexes.byRelation){let d=Object.entries(l);for(let[u,_]of d)if(u.endsWith("_id")&&u!==`${l.type}_id`&&typeof _==="string"){let p=n.indexes.byRelation.get(u)||new Map,m=p.get(_)||[];m.push(l),p.set(_,m),n.indexes.byRelation.set(u,p)}}if(h.bySubcircuit&&n.indexes.bySubcircuit&&"subcircuit_id"in l){let d=l.subcircuit_id;if(d&&typeof d==="string"){let u=n.indexes.bySubcircuit.get(d)||[];u.push(l),n.indexes.bySubcircuit.set(d,u)}}if(h.byCustomField&&n.indexes.byCustomField){for(let d of h.byCustomField)if(d in l){let u=l[d];if(u!==void 0&&(typeof u==="string"||typeof u==="number")){let _=String(u),p=n.indexes.byCustomField.get(d),m=p.get(_)||[];m.push(l),p.set(_,m)}}}return l},delete:(a)=>{let c=t.indexConfig||{},l;if(c.byId&&n.indexes.byId)l=n.indexes.byId.get(`${s}:${a}`);else if(c.byType&&n.indexes.byType)l=(n.indexes.byType.get(s)||[]).find((u)=>u[`${s}_id`]===a);else l=e.find((d)=>d[`${s}_id`]===a);if(!l)return;let h=e.indexOf(l);if(h>=0)e.splice(h,1),n.editCount++;if(c.byId&&n.indexes.byId){let d=GRe(l);n.indexes.byId.delete(d)}if(c.byType&&n.indexes.byType){let u=(n.indexes.byType.get(s)||[]).filter((_)=>_[`${s}_id`]!==a);n.indexes.byType.set(s,u)}if(c.byRelation&&n.indexes.byRelation)for(let[d,u]of n.indexes.byRelation.entries())for(let[_,p]of u.entries()){let m=p.filter((A)=>A!==l);if(m.length===0)u.delete(_);else u.set(_,m)}if(c.bySubcircuit&&n.indexes.bySubcircuit&&"subcircuit_id"in l){let d=l.subcircuit_id;if(d){let _=(n.indexes.bySubcircuit.get(d)||[]).filter((p)=>p!==l);if(_.length===0)n.indexes.bySubcircuit.delete(d);else n.indexes.bySubcircuit.set(d,_)}}if(c.byCustomField&&n.indexes.byCustomField)for(let d of n.indexes.byCustomField.values())for(let[u,_]of d.entries()){let p=_.filter((m)=>m!==l);if(p.length===0)d.delete(u);else d.set(u,p)}},update:(a,c)=>{let l=t.indexConfig||{},h;if(l.byId&&n.indexes.byId)h=n.indexes.byId.get(`${s}:${a}`);else if(l.byType&&n.indexes.byType)h=(n.indexes.byType.get(s)||[]).find((u)=>u[`${s}_id`]===a);else h=e.find((d)=>d.type===s&&d[`${s}_id`]===a);if(!h)return null;if(l.byRelation&&n.indexes.byRelation){let d=Object.entries(h);for(let[u,_]of d)if(u.endsWith("_id")&&u!==`${h.type}_id`&&typeof _==="string"){if(u in c&&c[u]!==_){let p=n.indexes.byRelation.get(u);if(p){let A=(p.get(_)||[]).filter((g)=>g!==h);if(A.length===0)p.delete(_);else p.set(_,A)}}}}if(l.bySubcircuit&&n.indexes.bySubcircuit&&"subcircuit_id"in h&&"subcircuit_id"in c){let d=h.subcircuit_id,u=c.subcircuit_id;if(d!==u){let p=(n.indexes.bySubcircuit.get(d)||[]).filter((m)=>m!==h);if(p.length===0)n.indexes.bySubcircuit.delete(d);else n.indexes.bySubcircuit.set(d,p)}}if(l.byCustomField&&n.indexes.byCustomField){for(let d of l.byCustomField)if(d in h&&d in c&&h[d]!==c[d]){let u=n.indexes.byCustomField.get(d);if(u){let _=String(h[d]),m=(u.get(_)||[]).filter((A)=>A!==h);if(m.length===0)u.delete(_);else u.set(_,m)}}}if(Object.assign(h,c),n.editCount++,l.byRelation&&n.indexes.byRelation){let d=Object.entries(h);for(let[u,_]of d)if(u.endsWith("_id")&&u!==`${h.type}_id`&&typeof _==="string"){if(u in c){let p=n.indexes.byRelation.get(u)||new Map,m=p.get(_)||[];if(!m.includes(h))m.push(h),p.set(_,m),n.indexes.byRelation.set(u,p)}}}if(l.bySubcircuit&&n.indexes.bySubcircuit&&"subcircuit_id"in h&&"subcircuit_id"in c){let d=h.subcircuit_id;if(d&&typeof d==="string"){let u=n.indexes.bySubcircuit.get(d)||[];if(!u.includes(h))u.push(h),n.indexes.bySubcircuit.set(d,u)}}if(l.byCustomField&&n.indexes.byCustomField){for(let d of l.byCustomField)if(d in h&&d in c){let u=h[d];if(u!==void 0&&(typeof u==="string"||typeof u==="number")){let _=String(u),p=n.indexes.byCustomField.get(d),m=p.get(_)||[];if(!m.includes(h))m.push(h),p.set(_,m)}}}return h},select:(a)=>{if(s==="source_component")return e.find((c)=>c.type==="source_component"&&c.name===a.replace(/\./g,""))||null;else if(s==="pcb_port"||s==="source_port"||s==="schematic_port"){let[c,l]=a.replace(/\./g,"").split(/[\s\>]+/),h=e.find((u)=>u.type==="source_component"&&u.name===c);if(!h)return null;let d=e.find((u)=>u.type==="source_port"&&u.source_component_id===h.source_component_id&&(u.name===l||(u.port_hints??[]).includes(l)));if(!d)return null;if(s==="source_port")return d;if(s==="pcb_port")return e.find((u)=>u.type==="pcb_port"&&u.source_port_id===d.source_port_id)||null;else if(s==="schematic_port")return e.find((u)=>u.type==="schematic_port"&&u.source_port_id===d.source_port_id)||null}return null}}}});return o},jRe,U5o=(e)=>{if(e==="up")return"right";else if(e==="right")return"down";else if(e==="down")return"left";else if(e==="left")return"up";throw Error(`Invalid direction: ${e}`)},W5o=(e)=>{if(e==="up")return"left";else if(e==="left")return"down";else if(e==="down")return"right";else if(e==="right")return"up";throw Error(`Invalid direction: ${e}`)},X5o=(e,t)=>{while(t>0)e=U5o(e),t--;while(t<0)e=W5o(e),t++;return e},ibt=(e)=>{if(e==="top"||e==="up")return"bottom";else if(e==="bottom"||e==="down")return"top";else if(e==="left")return"right";else if(e==="right")return"left";throw Error(`Invalid sideOrDir: ${e}`)},sbt=(e)=>Math.round(e/(Math.PI/2)),j5o=(e)=>{switch(e){case"from_left":return{x:-1,y:0};case"from_right":return{x:1,y:0};case"from_top":return{x:0,y:1};case"from_bottom":return{x:0,y:-1}}},K5o=({x:e,y:t})=>{if(e>0)return"from_right";if(e<0)return"from_left";if(t>0)return"from_top";return"from_bottom"},$5o=(e,t)=>{if(!e)return e;if(e==="from_above"||e==="from_below"){if(!t.isFlipped)return e;return e==="from_above"?"from_below":"from_above"}let{x:n,y:o}=j5o(e),r=Math.round(t.rotationDegrees/90);while(r>0)[n,o]=[-o,n],r--;while(r<0)[n,o]=[o,-n],r++;if(t.isFlipped)o=-o;return K5o({x:n,y:o})},q5o=(e,t)=>{if(e.type==="schematic_component")e.center=ra.applyToPoint(t,e.center);else if(e.type==="schematic_port"){if(e.center=ra.applyToPoint(t,e.center),e.facing_direction)e.facing_direction=X5o(e.facing_direction,-(Math.atan2(t.b,t.a)/Math.PI)*2)}else if(e.type==="schematic_text")e.position=ra.applyToPoint(t,e.position);else if(e.type==="schematic_trace"){let n=e;if(n.route=(n.route??[]).map((o)=>{let r=ra.applyToPoint(t,o);return o.x=r.x,o.y=r.y,o}),Array.isArray(n.junctions))n.junctions=n.junctions.map((o)=>{let r=ra.applyToPoint(t,o);return o.x=r.x,o.y=r.y,o});if(Array.isArray(n.edges))n.edges=n.edges.map((o)=>(o.from=ra.applyToPoint(t,o.from),o.to=ra.applyToPoint(t,o.to),o))}else if(e.type==="schematic_box"){let{x:n,y:o}=ra.applyToPoint(t,{x:e.x,y:e.y});e.x=n,e.y=o}else if(e.type==="schematic_line"){let{x:n,y:o}=ra.applyToPoint(t,{x:e.x1,y:e.y1}),{x:r,y:i}=ra.applyToPoint(t,{x:e.x2,y:e.y2});e.x1=n,e.y1=o,e.x2=r,e.y2=i}return e},abt=(e,t)=>e.map((n)=>q5o(n,t)),KRe=(e,t)=>{let n=t.a*t.d-t.b*t.c<0;return ra.decomposeTSR(ra.compose(t,ra.rotateDEG(e)),!1,n).rotation.angle*180/Math.PI},J5o=(e,t)=>{let n=ra.applyToPoint(t,{x:e.x,y:e.y});e.x=n.x,e.y=n.y;let o=KRe(e.shape==="rotated_rect"?e.ccw_rotation:0,t),r=Math.round(o/90);if(Math.abs(o-r*90)<0.00000001){if(Math.abs(r)%2===1)[e.width,e.height]=[e.height,e.width];Object.assign(e,{shape:"rect"}),Reflect.deleteProperty(e,"ccw_rotation")}else Object.assign(e,{shape:"rotated_rect",ccw_rotation:o});return e},Z5o=(e,t)=>{if(e.shape==="polygon")return e.points=e.points.map((i)=>ra.applyToPoint(t,i)),e;let n=ra.applyToPoint(t,{x:e.x,y:e.y});if(e.x=n.x,e.y=n.y,e.shape==="circle")return e;let o=e.shape==="rotated_rect"?e.ccw_rotation:0,r=KRe(o,t);if(Math.abs(r)<0.00000001)Object.assign(e,{shape:"rect"}),Reflect.deleteProperty(e,"ccw_rotation");else Object.assign(e,{shape:"rotated_rect",ccw_rotation:r});return e},cbt=(e,t)=>{if(e.type==="pcb_cutout"){if(e.shape==="polygon")e.points=e.points.map((s)=>ra.applyToPoint(t,s));else if(e.shape==="path")e.route=e.route.map((s)=>ra.applyToPoint(t,s));else if(e.center=ra.applyToPoint(t,e.center),e.shape==="rect")e.rotation=KRe(e.rotation??0,t);return e}if(e.type==="pcb_soldermask_opening")return Z5o(e,t);if(e.type==="pcb_solder_paste"&&(e.shape==="rect"||e.shape==="rotated_rect"))return J5o(e,t);if((e.type==="pcb_smtpad"||e.type==="pcb_solder_paste")&&e.shape==="polygon"){if(e.points=e.points.map((s)=>ra.applyToPoint(t,s)),e.type==="pcb_solder_paste"&&e.holes)e.holes=e.holes.map((s)=>s.map((a)=>ra.applyToPoint(t,a)));return e}let n=ra.decomposeTSR(t),o=Math.abs(sbt(n.rotation.angle))%2===1,r=n.rotation.angle/Math.PI*180,i=n.scale.sy<0;if(e.type==="pcb_plated_hole"||e.type==="pcb_hole"||e.type==="pcb_via"||e.type==="pcb_smtpad"||e.type==="pcb_solder_paste"||e.type==="pcb_port"){let{x:s,y:a}=ra.applyToPoint(t,{x:e.x,y:e.y});e.x=s,e.y=a}else if(e.type==="pcb_keepout"&&e.shape==="outline")e.outline=e.outline.map((s)=>ra.applyToPoint(t,s));else if(e.type==="pcb_keepout"||e.type==="pcb_board")e.center=ra.applyToPoint(t,e.center);else if(e.type==="pcb_silkscreen_text"||e.type==="pcb_fabrication_note_text"||e.type==="pcb_note_text")e.anchor_position=ra.applyToPoint(t,e.anchor_position);else if(e.type==="pcb_copper_text"){if(e.anchor_position)e.anchor_position=ra.applyToPoint(t,e.anchor_position)}else if(e.type==="pcb_courtyard_rect")e.center=ra.applyToPoint(t,e.center),e.ccw_rotation=((e.ccw_rotation??0)+r)%360;else if(e.type==="pcb_silkscreen_circle"||e.type==="pcb_silkscreen_rect"||e.type==="pcb_silkscreen_pill"||e.type==="pcb_silkscreen_oval"||e.type==="pcb_note_rect"||e.type==="pcb_courtyard_circle")e.center=ra.applyToPoint(t,e.center);else if(e.type==="pcb_component"){if(e.center=ra.applyToPoint(t,e.center),e.rotation=e.rotation+r,e.rotation=e.rotation%360,e.cable_insertion_center)e.cable_insertion_center=ra.applyToPoint(t,e.cable_insertion_center);if(e.insertion_direction=$5o(e.insertion_direction,{rotationDegrees:r,isFlipped:i}),o)[e.width,e.height]=[e.height,e.width]}else if(e.type==="pcb_courtyard_outline")e.outline=e.outline.map((s)=>{let a=ra.applyToPoint(t,s);return s.x=a.x,s.y=a.y,s});else if(e.type==="pcb_courtyard_polygon")e.points=e.points.map((s)=>{let a=ra.applyToPoint(t,s);return s.x=a.x,s.y=a.y,s});else if(e.type==="pcb_trace")e.route=e.route.map((s)=>{if(!("x"in s))return s.start=ra.applyToPoint(t,s.start),s.end=ra.applyToPoint(t,s.end),s;let a=ra.applyToPoint(t,s);return s.x=a.x,s.y=a.y,s});else if(e.type==="pcb_silkscreen_path"||e.type==="pcb_trace_hint"||e.type==="pcb_fabrication_note_path"||e.type==="pcb_note_path")e.route=e.route.map((s)=>{let a=ra.applyToPoint(t,s);return s.x=a.x,s.y=a.y,s});else if(e.type==="pcb_silkscreen_line"||e.type==="pcb_note_line"){let s={x:e.x1,y:e.y1},a={x:e.x2,y:e.y2},c=ra.applyToPoint(t,s),l=ra.applyToPoint(t,a);e.x1=c.x,e.y1=c.y,e.x2=l.x,e.y2=l.y}else if(e.type==="cad_component"){let s=ra.applyToPoint(t,{x:e.position.x,y:e.position.y});e.position.x=s.x,e.position.y=s.y}return e},NN=(e,t)=>{let n=ra.decomposeTSR(t),o=sbt(n.rotation.angle),r=Math.abs(o)%2===1,i=e.map((s)=>cbt(s,t));if(r)i=i.map((s)=>{if(s.type==="pcb_smtpad"&&(s.shape==="rect"||s.shape==="pill")||s.type==="pcb_solder_paste"&&s.shape==="pill")[s.width,s.height]=[s.height,s.width];return s});return i},tz=(e)=>{let t=e.type;return e[`${t}_id`]},e4o=(e,t)=>e.find((n)=>tz(n)===t)??null,lbt=(e,t)=>{let n=O1(e).pcb_port.get(t);if(!n)return`pcb_port[#${t}]`;let o=n.pcb_component_id?O1(e).pcb_component.get(n.pcb_component_id):void 0;if(!o)return`pcb_port[#${t}]`;let r=O1(e).source_component.get(o.source_component_id);if(!r)return`pcb_port[#${t}]`;let i=O1(e).source_port.get(n.source_port_id);if(!i)return`pcb_port[#${t}]`;let s;if(i?.port_hints&&i.port_hints.length>0)s=i.port_hints[0];else if(i.port_hints&&i.port_hints.length>0)s=i.port_hints[0];else s=t;return`pcb_port[.${r.name} > .${s}]`},$Re=(e,t)=>{if(typeof t==="string"){let n=e4o(e,t);if(!n)`unknown (could not find element with id ${t})`;return $Re(e,n)}switch(t.type){case"pcb_port":return lbt(e,t.pcb_port_id);case"pcb_smtpad":return t4o(e,t.pcb_smtpad_id);case"pcb_trace":return n4o(e,t.pcb_trace_id);case"source_component":return`source_component[${t.name}]`;default:return`${t.type}[#${tz(t)}]`}},WRe=(e,t)=>({minX:Math.min(e.minX,t.minX),minY:Math.min(e.minY,t.minY),maxX:Math.max(e.maxX,t.maxX),maxY:Math.max(e.maxY,t.maxY)}),Bre=(e,t,n)=>{let o=n/2;return{minX:e-o,minY:t-o,maxX:e+o,maxY:t+o}},ZCt=(e,t,n,o,r)=>{let i=n/2,s=o/2,a=r*Math.PI/180,c=Math.cos(a),l=Math.sin(a),h=[{x:-i,y:-s},{x:i,y:-s},{x:i,y:s},{x:-i,y:s}].map((d)=>({x:e+d.x*c-d.y*l,y:t+d.x*l+d.y*c}));return{minX:Math.min(...h.map((d)=>d.x)),minY:Math.min(...h.map((d)=>d.y)),maxX:Math.max(...h.map((d)=>d.x)),maxY:Math.max(...h.map((d)=>d.y))}},o4o=(e,t,n,o,r)=>{let i=n/2,s=o/2,a=r*Math.PI/180,c=Math.cos(a),l=Math.sin(a),h=Math.hypot(i*c,s*l),d=Math.hypot(i*l,s*c);return{minX:e-h,minY:t-d,maxX:e+h,maxY:t+d}},r4o=(e,t,n,o,r)=>{let i=Math.min(n,o)/2,s=Math.max(n,o)/2-i,a=r*Math.PI/180,c=n>=o?{x:s,y:0}:{x:0,y:s},l={x:c.x*Math.cos(a)-c.y*Math.sin(a),y:c.x*Math.sin(a)+c.y*Math.cos(a)},h=Math.abs(l.x)+i,d=Math.abs(l.y)+i;return{minX:e-h,minY:t-d,maxX:e+h,maxY:t+d}},LAe=(e)=>{if(e.length===0)return null;return{minX:Math.min(...e.map((t)=>t.x)),minY:Math.min(...e.map((t)=>t.y)),maxX:Math.max(...e.map((t)=>t.x)),maxY:Math.max(...e.map((t)=>t.y))}},URe=(e)=>{if(!Array.isArray(e))return[];return e.flatMap((t)=>{if(!t||typeof t!=="object")return[];if("x"in t&&"y"in t&&typeof t.x==="number"&&typeof t.y==="number")return[{x:t.x,y:t.y}];if("start"in t&&"end"in t)return[t.start,t.end].filter((o)=>Boolean(o&&typeof o==="object"&&"x"in o&&"y"in o&&typeof o.x==="number"&&typeof o.y==="number"));return[]})},i4o=(e)=>{if(!e.type.startsWith("pcb_"))return null;if(e.type==="pcb_smtpad"&&e.shape==="polygon"&&Array.isArray(e.points))return LAe(e.points);if(e.type==="pcb_hole"&&e.hole_shape==="circle")return Bre(e.x,e.y,e.hole_diameter);if(e.type==="pcb_plated_hole"){let d;if("outer_diameter"in e&&typeof e.outer_diameter==="number")d=Bre(e.x,e.y,e.outer_diameter);else if("hole_diameter"in e&&typeof e.hole_diameter==="number")d=Bre(e.x,e.y,e.hole_diameter);if((e.shape==="oval"||e.shape==="pill")&&typeof e.outer_width==="number"&&typeof e.outer_height==="number")d=(e.shape==="pill"?r4o:o4o)(e.x,e.y,e.outer_width,e.outer_height,e.ccw_rotation??0);if("rect_pad_width"in e&&typeof e.rect_pad_width==="number"&&"rect_pad_height"in e&&typeof e.rect_pad_height==="number"){let u=ZCt(e.x,e.y,e.rect_pad_width,e.rect_pad_height,"rect_ccw_rotation"in e?e.rect_ccw_rotation??0:0);d=d?WRe(d,u):u}if("hole_diameter"in e&&typeof e.hole_diameter==="number"){let u=Bre(e.x+("hole_offset_x"in e?e.hole_offset_x??0:0),e.y+("hole_offset_y"in e?e.hole_offset_y??0:0),e.hole_diameter);d=d?WRe(d,u):u}if(d)return d}let t=e,n=LAe(URe(t.route));if(n)return n;let o=LAe(URe(t.outline));if(o)return o;let r=LAe(URe(t.points));if(r)return r;let i,s,a,c;if("x"in e&&"y"in e)i=Number(e.x),s=Number(e.y);if("outer_diameter"in e)a=Number(e.outer_diameter),c=Number(e.outer_diameter);if("width"in e)a=Number(e.width);if("height"in e)c=Number(e.height);if("center"in e&&e.center&&typeof e.center==="object"&&"x"in e.center&&"y"in e.center)i=Number(e.center.x),s=Number(e.center.y);let l=0;if("rotation"in e&&typeof e.rotation==="number")l=e.rotation;if("ccw_rotation"in e&&typeof e.ccw_rotation==="number")l=e.ccw_rotation;if(i!==void 0&&s!==void 0){if(a!==void 0&&c!==void 0)return l?ZCt(i,s,a,c,l):{minX:i-a/2,minY:s-c/2,maxX:i+a/2,maxY:s+c/2};if("radius"in e&&typeof e.radius==="number")return Bre(i,s,e.radius*2);return{minX:i,minY:s,maxX:i,maxY:s}}let h=[t.anchor_position,t.position].filter((d)=>Boolean(d&&typeof d==="object"&&"x"in d&&"y"in d&&typeof d.x==="number"&&typeof d.y==="number")).at(0);return h?{minX:h.x,minY:h.y,maxX:h.x,maxY:h.y}:null},V1=(e)=>{let t={minX:Number.POSITIVE_INFINITY,minY:Number.POSITIVE_INFINITY,maxX:Number.NEGATIVE_INFINITY,maxY:Number.NEGATIVE_INFINITY};for(let n of e){let o=i4o(n);if(o)t=WRe(t,o)}return t},hbt=(e)=>{if(e.width&&e.height&&e.center){let a=e.width/2,c=e.height/2;return{minX:e.center.x-a,minY:e.center.y-c,maxX:e.center.x+a,maxY:e.center.y+c,width:e.width,height:e.height,center:{x:e.center.x,y:e.center.y}}}if(!e.outline||e.outline.length===0)throw Error("Unable to compute board bounds. pcb_board must include width/height/center or a non-empty outline.");let{POSITIVE_INFINITY:t,POSITIVE_INFINITY:n,NEGATIVE_INFINITY:o,NEGATIVE_INFINITY:r}=Number;for(let a of e.outline)t=Math.min(t,a.x),n=Math.min(n,a.y),o=Math.max(o,a.x),r=Math.max(r,a.y);let i=o-t,s=r-n;return{minX:t,minY:n,maxX:o,maxY:r,width:i,height:s,center:{x:t+i/2,y:n+s/2}}},s4o=0.1,ebt=0.18,t7=0.2,ez=({minX:e,minY:t,maxX:n,maxY:o})=>{let r=n-e,i=o-t;return{minX:e,minY:t,maxX:n,maxY:o,width:r,height:i,center:{x:e+r/2,y:t+i/2}}},a4o=(e)=>{let t=0.12*(ebt/0.18),n=0.12*(ebt/0.18);return e.length*t+n},c4o=(e)=>{let t=a4o(e.text),n=e.anchor_position;if(!n){let o=e.anchor_side==="top"||e.anchor_side==="bottom",r=o?t7:t,i=o?t:t7;return ez({minX:e.center.x-r/2,minY:e.center.y-i/2,maxX:e.center.x+r/2,maxY:e.center.y+i/2})}switch(e.anchor_side){case"left":return ez({minX:n.x,minY:n.y-t7/2,maxX:n.x+t,maxY:n.y+t7/2});case"right":return ez({minX:n.x-t,minY:n.y-t7/2,maxX:n.x,maxY:n.y+t7/2});case"top":return ez({minX:n.x-t7/2,minY:n.y-t,maxX:n.x+t7/2,maxY:n.y});case"bottom":return ez({minX:n.x-t7/2,minY:n.y,maxX:n.x+t7/2,maxY:n.y+t})}},dbt=(e)=>{if(e.type==="schematic_component")return ez({minX:e.center.x-e.size.width/2,minY:e.center.y-e.size.height/2,maxX:e.center.x+e.size.width/2,maxY:e.center.y+e.size.height/2});if(e.type==="schematic_net_label")return c4o(e);let t=[...e.edges.flatMap((o)=>[o.from,o.to]),...e.junctions];if(t.length===0)return null;let n=s4o/2;return ez({minX:Math.min(...t.map((o)=>o.x))-n,minY:Math.min(...t.map((o)=>o.y))-n,maxX:Math.max(...t.map((o)=>o.x))+n,maxY:Math.max(...t.map((o)=>o.y))+n})},tbt,h4o=(e)=>{let{x:t,y:n,width:o,height:r}={...e,...e.size,...e.center,...e.position};if(e.x1!==void 0&&e.x2!==void 0&&e.y1!==void 0&&e.y2!==void 0)t=(e.x1+e.x2)/2,n=(e.y1+e.y2)/2,o=Math.abs(e.x1-e.x2),r=Math.abs(e.y1-e.y2);if(e.points&&Array.isArray(e.points)&&e.points.length>0){let a=e.points.map((_)=>_.x),c=e.points.map((_)=>_.y),l=Math.min(...a),h=Math.max(...a),d=Math.min(...c),u=Math.max(...c);t=(l+h)/2,n=(d+u)/2,o=h-l,r=u-d}let i=e.text||e.name||e.source?.text||e.source?.name||"?",s=e;if(t===void 0||n===void 0)return null;if(o===void 0){if("radius"in e)o=e.radius*2,r=e.radius*2;else if("outer_diameter"in e)o=e.outer_diameter,r=e.outer_diameter;else if("rect_pad_width"in e&&"rect_pad_height"in e){if(o=e.rect_pad_width,r=e.rect_pad_height,"hole_diameter"in e)o=Math.max(o,e.hole_diameter),r=Math.max(r,e.hole_diameter)}else if("hole_diameter"in e)o=e.hole_diameter,r=e.hole_diameter}if(o===void 0||r===void 0)o=0.1,r=0.1;return{x:t,y:n,width:o,height:r,title:i,content:s,bg_color:tbt[l4o(e.type||i)%tbt.length]?.[4]??"#f00"}},d4o=(e)=>Boolean(e),zAe=(e)=>{let t=e.filter((l)=>l.type.startsWith("pcb_")||l.type.startsWith("schematic_")).concat(e.filter((l)=>l.type==="pcb_trace"||l.type==="schematic_trace").flatMap((l)=>l.route)).map((l)=>h4o(l)).filter(d4o);if(t.length===0)return{center:{x:0,y:0},width:0,height:0};let n=t[0].x-t[0].width/2,o=t[0].x+t[0].width/2,r=t[0].y-t[0].height/2,i=t[0].y+t[0].height/2;for(let l of t.slice(1))n=Math.min(n,l.x-l.width/2),o=Math.max(o,l.x+l.width/2),r=Math.min(r,l.y-l.height/2),i=Math.max(i,l.y+l.height/2);let s=o-n,a=i-r;return{center:{x:n+s/2,y:r+a/2},width:s,height:a}},La=(e)=>e[`${e.type}_id`],OAe=(e,t,n)=>{let o=e.find((h)=>h.type==="pcb_component"&&h.pcb_component_id===t);if(!o)return;let r="center"in o?o.center:{x:o.x,y:o.y},i=n.x-r.x,s=n.y-r.y,a=e.filter((h)=>h.type==="pcb_port"&&h.pcb_component_id===t).map((h)=>h.pcb_port_id),c=e.filter((h)=>{if(h===o)return!0;let d=h;if(d.pcb_component_id===t)return!0;if(Array.isArray(d.pcb_component_ids)&&d.pcb_component_ids.includes(t))return!0;if(d.pcb_port_id&&a.includes(d.pcb_port_id))return!0;if(Array.isArray(d.pcb_port_ids)&&d.pcb_port_ids.some((u)=>a.includes(u)))return!0;if(d.start_pcb_port_id&&a.includes(d.start_pcb_port_id))return!0;if(d.end_pcb_port_id&&a.includes(d.end_pcb_port_id))return!0;if(Array.isArray(d.route)&&d.route.some((u)=>u.start_pcb_port_id&&a.includes(u.start_pcb_port_id)||u.end_pcb_port_id&&a.includes(u.end_pcb_port_id)))return!0;return!1}),l=ubt.translate(i,s);NN(c,l)},mbt=(e,t)=>{let n=[],o=e.filter((r)=>r.type==="source_group"&&r.parent_source_group_id===t).map((r)=>r.source_group_id);n.push(...o);for(let r of o)n.push(...mbt(e,r));return n},VAe=(e,t,n)=>{let o=[t,...mbt(e,t)],r=new Set;for(let u of o)HX(e,{source_group_id:u}).forEach((p)=>r.add(p));let i=Array.from(r).filter((u)=>u.type==="pcb_port").map((u)=>u.pcb_port_id);e.filter((u)=>{if(u.type!=="pcb_trace")return!1;if(r.has(u))return!1;let _=u;if(_.start_pcb_port_id&&i.includes(_.start_pcb_port_id))return!0;if(_.end_pcb_port_id&&i.includes(_.end_pcb_port_id))return!0;if(Array.isArray(_.route)&&_.route.some((p)=>p.start_pcb_port_id&&i.includes(p.start_pcb_port_id)||p.end_pcb_port_id&&i.includes(p.end_pcb_port_id)))return!0;return!1}).forEach((u)=>r.add(u));let a=Array.from(r).filter((u)=>u.type.startsWith("pcb_"));if(a.length===0)return;let{center:c}=zAe(a),l=n.x-c.x,h=n.y-c.y,d=pbt.translate(l,h);NN(a,d)},gbt=(e,t,n)=>{let o=e.find((h)=>h.type==="schematic_component"&&h.schematic_component_id===t);if(!o)return;let r="center"in o?o.center:{x:o.x,y:o.y},i=n.x-r.x,s=n.y-r.y,a=e.filter((h)=>h.type==="schematic_port"&&h.schematic_component_id===t).map((h)=>h.schematic_port_id),c=e.filter((h)=>{if(h===o)return!0;let d=h;if(d.schematic_component_id===t)return!0;if(Array.isArray(d.schematic_component_ids)&&d.schematic_component_ids.includes(t))return!0;if(d.schematic_port_id&&a.includes(d.schematic_port_id))return!0;if(Array.isArray(d.schematic_port_ids)&&d.schematic_port_ids.some((u)=>a.includes(u)))return!0;if(d.start_schematic_port_id&&a.includes(d.start_schematic_port_id))return!0;if(d.end_schematic_port_id&&a.includes(d.end_schematic_port_id))return!0;if(Array.isArray(d.route)&&d.route.some((u)=>u.start_schematic_port_id&&a.includes(u.start_schematic_port_id)||u.end_schematic_port_id&&a.includes(u.end_schematic_port_id)))return!0;return!1}),l=_bt.translate(i,s);abt(c,l)},fbt=(e,t)=>{let n=[],o=e.filter((r)=>r.type==="source_group"&&r.parent_source_group_id===t).map((r)=>r.source_group_id);n.push(...o);for(let r of o)n.push(...fbt(e,r));return n},ybt=(e,t,n)=>{let o=[t,...fbt(e,t)],r=new Set;for(let u of o)HX(e,{source_group_id:u}).forEach((p)=>r.add(p));let i=Array.from(r).filter((u)=>u.type==="schematic_port").map((u)=>u.schematic_port_id);e.filter((u)=>{if(u.type!=="schematic_trace")return!1;if(r.has(u))return!1;let _=u;if(_.start_schematic_port_id&&i.includes(_.start_schematic_port_id))return!0;if(_.end_schematic_port_id&&i.includes(_.end_schematic_port_id))return!0;if(Array.isArray(_.route)&&_.route.some((p)=>p.start_schematic_port_id&&i.includes(p.start_schematic_port_id)||p.end_schematic_port_id&&i.includes(p.end_schematic_port_id)))return!0;return!1}).forEach((u)=>r.add(u));let a=Array.from(r).filter((u)=>u.type.startsWith("schematic_"));if(a.length===0)return;let{center:c}=zAe(a),l=n.x-c.x,h=n.y-c.y,d=Abt.translate(l,h);abt(a,d)},CM=(e,t)=>{let n=new Map,o=new Set;for(let l of e)if(l.type==="source_group")o.add(l.source_group_id);let r=[];for(let l of e)if(l.type==="source_group"&&l.parent_source_group_id){let{parent_source_group_id:h,source_group_id:d}=l;if(!o.has(h)){if(r.push(d),!n.has(d))n.set(d,[])}else{let u=n.get(h)??[];if(u.push(d),n.set(h,u),!n.has(d))n.set(d,[])}}for(let l of e)if(l.type==="source_group"&&!n.has(l.source_group_id))n.set(l.source_group_id,[]);let i=new Map,s=()=>{for(let[l,h]of n){if(i.has(l))continue;if(h.every((d)=>i.has(d)))return l}return null},a=null;while(!0){let l=s();if(!l)break;let d={nodeType:"group",sourceGroup:e.find((u)=>u.type==="source_group"&&u.source_group_id===l),otherChildElements:[],childNodes:[...n.get(l)?.map((u)=>i.get(u))??[],...e.filter((u)=>u.type==="source_component"&&u.source_group_id===l).map((u)=>({nodeType:"component",sourceComponent:u,childNodes:[],otherChildElements:[...e.filter((_)=>_.type==="pcb_component"&&_.source_component_id===u.source_component_id)]}))]};i.set(l,d),a=l}if(!a)return console.warn("No groups were processed, returning tree without sourceGroup"),{nodeType:"group",childNodes:[],otherChildElements:e};let c=null;if(t&&t.source_group_id!==void 0)c=t.source_group_id;else if(r.length>0)c=r[0];else c=a;if(!c)return console.warn("No valid root group found, returning tree without sourceGroup"),{nodeType:"group",childNodes:[],otherChildElements:e};return i.get(c)},yx=0.000000001,u4o=(e,t,n)=>Math.max(t,Math.min(n,e)),p4o=(e,t)=>Math.hypot(e.x-t.x,e.y-t.y),Tre=(e,t,n)=>{let o=n.x-t.x,r=n.y-t.y,i=o*o+r*r;if(i<=yx)return p4o(e,t);let s=u4o(((e.x-t.x)*o+(e.y-t.y)*r)/i,0,1);return Math.hypot(e.x-(t.x+s*o),e.y-(t.y+s*r))},Dre=(e,t,n)=>(t.x-e.x)*(n.y-e.y)-(t.y-e.y)*(n.x-e.x),Nre=(e,t,n)=>{if(Math.abs(Dre(t,n,e))>yx)return!1;return e.x>=Math.min(t.x,n.x)-yx&&e.x<=Math.max(t.x,n.x)+yx&&e.y>=Math.min(t.y,n.y)-yx&&e.y<=Math.max(t.y,n.y)+yx},m4o=(e,t,n,o)=>{let r=Dre(e,t,n),i=Dre(e,t,o),s=Dre(n,o,e),a=Dre(n,o,t);if((r>yx&&i<-yx||r<-yx&&i>yx)&&(s>yx&&a<-yx||s<-yx&&a>yx))return!0;return Nre(n,e,t)||Nre(o,e,t)||Nre(e,n,o)||Nre(t,n,o)},kX=(e)=>{let t=[];if(e.points.length<2)return t;for(let n=0;n<e.points.length;n+=1){let o=e.points[n],r=e.points[(n+1)%e.points.length];if(!o||!r)continue;t.push([o,r])}return t},XRe=(e,t)=>{for(let[o,r]of kX(t))if(Nre(e,o,r))return!0;let n=!1;for(let o=0,r=t.points.length-1;o<t.points.length;r=o++){let i=t.points[o],s=t.points[r];if(!i||!s)continue;if(i.y>e.y!==s.y>e.y&&e.x<(s.x-i.x)*(e.y-i.y)/(s.y-i.y)+i.x)n=!n}return n},xbt=(e,t)=>Math.max(0,Math.hypot(e.x-t.x,e.y-t.y)-e.radius-t.radius),Cbt=(e,t)=>{if(e.points.length<3||t.points.length<3)return Number.POSITIVE_INFINITY;for(let[i,s]of kX(e))for(let[a,c]of kX(t))if(m4o(i,s,a,c))return 0;let n=e.points[0],o=t.points[0];if(n&&XRe(n,t)||o&&XRe(o,e))return 0;let r=Number.POSITIVE_INFINITY;for(let[i,s]of kX(e))for(let[a,c]of kX(t))r=Math.min(r,Tre(i,a,c),Tre(s,a,c),Tre(a,i,s),Tre(c,i,s));return r},qRe=(e,t)=>{if(t.points.length<3)return Number.POSITIVE_INFINITY;if(XRe({x:e.x,y:e.y},t))return 0;let n=Number.POSITIVE_INFINITY;for(let[o,r]of kX(t))n=Math.min(n,Tre({x:e.x,y:e.y},o,r));return Math.max(0,n-e.radius)},JRe,_4o,g4o=(e)=>{if(typeof e.x==="number"&&typeof e.y==="number")return{x:e.x,y:e.y};if(e.points&&e.points.length>0){let t=e.points.map((o)=>o.x),n=e.points.map((o)=>o.y);return{x:(Math.min(...t)+Math.max(...t))/2,y:(Math.min(...n)+Math.max(...n))/2}}return null},A4o=(e)=>{for(let t of e.port_hints??[]){let n=String(t).trim().match(/^(?:pin)?(\d+)$/i);if(n)return Number.parseInt(n[1],10)}return null},nbt=(e,t,n)=>{let o=t.x-e.x,r=t.y-e.y;if(Math.abs(r)<=n&&Math.abs(o)>n)return o>0?"topside_left":"bottomside_right";if(Math.abs(o)<=n&&Math.abs(r)>n)return r>0?"leftside_bottom":"rightside_top";return null},f4o=(e,t,n)=>{let o=e.map((f)=>f.x),r=e.map((f)=>f.y),i=Math.min(...o),s=Math.max(...o),a=Math.min(...r),c=Math.max(...r),l=(i+s)/2,h=(a+c)/2,d=s-i,u=c-a,_=Math.max(d,u,1)*0.000001,{side:p,alignment:m}=JRe[n],A=p==="leftside"&&Math.abs(t.x-i)<=_||p==="rightside"&&Math.abs(t.x-s)<=_||p==="topside"&&Math.abs(t.y-c)<=_||p==="bottomside"&&Math.abs(t.y-a)<=_,g=m==="left"&&(d<=_||t.x<l-_)||m==="right"&&(d<=_||t.x>l+_)||m==="top"&&(u<=_||t.y>h+_)||m==="bottom"&&(u<=_||t.y<h-_);return A&&g},ZRe=(e)=>{let n=e.filter((u)=>u.type==="pcb_smtpad"||u.type==="pcb_plated_hole").map((u)=>({center:g4o(u),pinNumber:A4o(u)})),o=n.find((u)=>u.pinNumber===1)?.center,r=n.map((u)=>u.center).filter((u)=>u!==null);if(!o||r.length===0)return null;let i=_4o.filter((u)=>f4o(r,o,u));if(i.length===1)return i[0];if(i.length===0)return null;let s;for(let u of n){if(!u.center||u.pinNumber===null||u.pinNumber<=1)continue;if(!s||u.pinNumber<s.pinNumber)s={center:u.center,pinNumber:u.pinNumber}}if(!s)return null;let a=r.map((u)=>u.x),c=r.map((u)=>u.y),h=Math.max(Math.max(...a)-Math.min(...a),Math.max(...c)-Math.min(...c),1)*0.000001;if(n.length===2&&s.pinNumber===2)return nbt(o,s.center,h);if(n.length>2){let u=[...n].sort((_,p)=>(_.pinNumber??Number.POSITIVE_INFINITY)-(p.pinNumber??Number.POSITIVE_INFINITY));if(u.every(({center:_,pinNumber:p},m)=>p===m+1&&_!==null&&Number.isFinite(_.x)&&Number.isFinite(_.y))){let _=u[0].center,p=u[u.length-1].center,m=p.x-_.x,A=p.y-_.y,g=Math.abs(A)<=h&&Math.abs(m)>h,f=Math.abs(m)<=h&&Math.abs(A)>h;if((g||f)&&u.slice(1).every(({center:y},x)=>{let C=u[x].center;return g?Math.abs(y.y-_.y)<=h&&(y.x-C.x)*Math.sign(m)>h:Math.abs(y.x-_.x)<=h&&(y.y-C.y)*Math.sign(A)>h}))return nbt(_,u[1].center,h)}}let d=i.filter((u)=>{let{side:_}=JRe[u];return _==="leftside"||_==="rightside"?Math.abs(s.center.x-o.x)<=h:Math.abs(s.center.y-o.y)<=h});return d.length===1?d[0]:null},Qre=(e,t,n=0)=>{let{a:o,b:r,c:i,d:s,e:a,f:c}=FX.compose(FX.translate(t.x,t.y),FX.rotate(n*Math.PI/180));return e.transform(new Cf(o,r,i,s,a,c))},TN=(e)=>e.orientation()===UF.CCW?e:e.reverse(),DN=(e,t)=>TN(new tl(new ZF(new Ks(e.x,e.y),t))),LX=(e,t,n,o=0,r=0)=>{let i=t/2,s=n/2,a=Math.max(0,Math.min(o,i,s));if(a===0)return Qre(TN(new tl(new rA(-i,-s,i,s))),e,r);let c=[new Ap(new Ks(i-a,-s+a),a,-Math.PI/2,0,!0),new Ap(new Ks(i-a,s-a),a,0,Math.PI/2,!0),new Ap(new Ks(-i+a,s-a),a,Math.PI/2,Math.PI,!0),new Ap(new Ks(-i+a,-s+a),a,Math.PI,Math.PI*1.5,!0)],l=[];for(let h=0;h<c.length;h++){let d=c[h],u=c[(h+1)%c.length];if(l.push(d),d.end.distanceTo(u.start)[0]>0.000000000001)l.push(new eg(d.end,u.start))}return Qre(TN(new tl(l)),e,r)},obt=(e)=>{let t=[];for(let n=0;n<e.vertices.length;n++){let o=e.vertices[n],r=e.vertices[(n+1)%e.vertices.length],i=r.x-o.x,s=r.y-o.y;if(i===0&&s===0)continue;let a=o.bulge??0;if(a===0)t.push(new eg(new Ks(o.x,o.y),new Ks(r.x,r.y)));else{let c=(1-a*a)/(4*a),l=new Ks((o.x+r.x)/2-s*c,(o.y+r.y)/2+i*c);t.push(new Ap(l,Math.hypot(i,s)*(1+a*a)/(4*Math.abs(a)),Math.atan2(o.y-l.y,o.x-l.x),Math.atan2(r.y-l.y,r.x-l.x),a>0))}}return TN(new tl(t))},Rre=(e,t)=>{for(let n of t.reverse().faces)e.addFace(n.shapes);return e},RN=(e)=>{if(e.shape==="rect")return LX(e.center,e.width,e.height,0,e.rotation);if(e.shape==="polygon")return TN(new tl(e.points.map((n)=>new Ks(n.x,n.y))));let t=obt(e.brep_shape.outer_ring);for(let n of e.brep_shape.inner_rings)Rre(t,obt(n));return t},zX=(e)=>{if(e.shape==="polygon")return TN(new tl(e.points.map((n)=>new Ks(n.x,n.y))));if(e.shape==="circle")return DN(e,e.radius);let t=e.shape==="pill"||e.shape==="rotated_pill"?e.radius:e.corner_radius??e.rect_border_radius??0;return LX(e,e.width,e.height,t,"ccw_rotation"in e?e.ccw_rotation:0)},QN=(e,t,n)=>Rre(DN(e,t/2),DN(e,n/2)),kN=(e,t=0)=>{if(e.shape==="circle")return QN(e,e.outer_diameter,e.hole_diameter);if("outer_width"in e)return Rre(LX(e,e.outer_width,e.outer_height,Math.min(e.outer_width,e.outer_height)/2,e.ccw_rotation),LX(e,e.hole_width,e.hole_height,Math.min(e.hole_width,e.hole_height)/2,e.ccw_rotation));let n={x:e.x+e.hole_offset_x,y:e.y+e.hole_offset_y},o=e.shape==="hole_with_polygon_pad"?Qre(TN(new tl(e.pad_outline.map((r)=>new Ks(r.x,r.y)))),e,e.ccw_rotation??t):LX(e,e.rect_pad_width,e.rect_pad_height,e.rect_border_radius,"rect_ccw_rotation"in e?e.rect_ccw_rotation:0);if(e.shape==="circular_hole_with_rect_pad"||e.shape==="hole_with_polygon_pad"&&e.hole_shape==="circle"){if(e.hole_diameter===void 0)throw Error("Circular plated hole requires hole_diameter");return Rre(o,DN(n,e.hole_diameter/2))}if(!("hole_width"in e)||e.hole_width===void 0||e.hole_height===void 0)throw Error("Slotted plated hole requires hole_width and hole_height");return Rre(o,LX(n,e.hole_width,e.hole_height,Math.min(e.hole_width,e.hole_height)/2,"hole_ccw_rotation"in e?e.hole_ccw_rotation:e.shape==="hole_with_polygon_pad"?e.ccw_rotation??t:0))},nz=(e,t,n,o=n)=>{let r=Math.hypot(t.x-e.x,t.y-e.y),i=n/2,s=o/2;if(p4.EQ_0(r)||r<=Math.abs(s-i))return DN(i>=s?e:t,Math.max(i,s));let a=Math.atan2(t.y-e.y,t.x-e.x),c=Math.acos((i-s)/r),l=new Ap(new Ks(e.x,e.y),i,a+c,a-c,!0),h=new Ap(new Ks(t.x,t.y),s,a-c,a+c,!0);return TN(new tl([l,new eg(l.end,h.start),h,new eg(h.end,l.start)]))},bbt=(e,t,n=0.0000001)=>e.vertices.some((o)=>t.contains(o))||t.vertices.some((o)=>e.contains(o))||e.distanceTo(t)[0]<=n;var Ko=El(()=>{Kt();Kt();PAe();fp();ra=Qe(wt(),1),ubt=Qe(wt(),1),pbt=Qe(wt(),1),_bt=Qe(wt(),1),Abt=Qe(wt(),1),FX=Qe(wt(),1);O1.unparsed=O1;Ho=O1,As=O1;HAe.unparsed=HAe;jRe=HAe;tbt=[["#69d2e7","#a7dbd8","#e0e4cc","#f38630","#fa6900"],["#fe4365","#fc9d9a","#f9cdad","#c8c8a9","#83af9b"],["#ecd078","#d95b43","#c02942","#542437","#53777a"],["#556270","#4ecdc4","#c7f464","#ff6b6b","#c44d58"],["#774f38","#e08e79","#f1d4af","#ece5ce","#c5e0dc"],["#e8ddcb","#cdb380","#036564","#033649","#031634"],["#490a3d","#bd1550","#e97f02","#f8ca00","#8a9b0f"],["#594f4f","#547980","#45ada8","#9de0ad","#e5fcc2"],["#00a0b0","#6a4a3c","#cc333f","#eb6841","#edc951"],["#e94e77","#d68189","#c6a49a","#c6e5d9","#f4ead5"],["#3fb8af","#7fc7af","#dad8a7","#ff9e9d","#ff3d7f"],["#d9ceb2","#948c75","#d5ded9","#7a6a53","#99b2b7"],["#ffffff","#cbe86b","#f2e9e1","#1c140d","#cbe86b"],["#efffcd","#dce9be","#555152","#2e2633","#99173c"],["#343838","#005f6b","#008c9e","#00b4cc","#00dffc"],["#413e4a","#73626e","#b38184","#f0b49e","#f7e4be"],["#ff4e50","#fc913a","#f9d423","#ede574","#e1f5c4"],["#99b898","#fecea8","#ff847c","#e84a5f","#2a363b"],["#655643","#80bca3","#f6f7bd","#e6ac27","#bf4d28"],["#00a8c6","#40c0cb","#f9f2e7","#aee239","#8fbe00"],["#351330","#424254","#64908a","#e8caa4","#cc2a41"],["#554236","#f77825","#d3ce3d","#f1efa5","#60b99a"],["#5d4157","#838689","#a8caba","#cad7b2","#ebe3aa"],["#8c2318","#5e8c6a","#88a65e","#bfb35a","#f2c45a"],["#fad089","#ff9c5b","#f5634a","#ed303c","#3b8183"],["#ff4242","#f4fad2","#d4ee5e","#e1edb9","#f0f2eb"],["#f8b195","#f67280","#c06c84","#6c5b7b","#355c7d"],["#d1e751","#ffffff","#000000","#4dbce9","#26ade4"],["#1b676b","#519548","#88c425","#bef202","#eafde6"],["#5e412f","#fcebb6","#78c0a8","#f07818","#f0a830"],["#bcbdac","#cfbe27","#f27435","#f02475","#3b2d38"],["#452632","#91204d","#e4844a","#e8bf56","#e2f7ce"],["#eee6ab","#c5bc8e","#696758","#45484b","#36393b"],["#f0d8a8","#3d1c00","#86b8b1","#f2d694","#fa2a00"],["#2a044a","#0b2e59","#0d6759","#7ab317","#a0c55f"],["#f04155","#ff823a","#f2f26f","#fff7bd","#95cfb7"],["#b9d7d9","#668284","#2a2829","#493736","#7b3b3b"],["#bbbb88","#ccc68d","#eedd99","#eec290","#eeaa88"],["#b3cc57","#ecf081","#ffbe40","#ef746f","#ab3e5b"],["#a3a948","#edb92e","#f85931","#ce1836","#009989"],["#300030","#480048","#601848","#c04848","#f07241"],["#67917a","#170409","#b8af03","#ccbf82","#e33258"],["#aab3ab","#c4cbb7","#ebefc9","#eee0b7","#e8caaf"],["#e8d5b7","#0e2430","#fc3a51","#f5b349","#e8d5b9"],["#ab526b","#bca297","#c5ceae","#f0e2a4","#f4ebc3"],["#607848","#789048","#c0d860","#f0f0d8","#604848"],["#b6d8c0","#c8d9bf","#dadabd","#ecdbbc","#fedcba"],["#a8e6ce","#dcedc2","#ffd3b5","#ffaaa6","#ff8c94"],["#3e4147","#fffedf","#dfba69","#5a2e2e","#2a2c31"],["#fc354c","#29221f","#13747d","#0abfbc","#fcf7c5"],["#cc0c39","#e6781e","#c8cf02","#f8fcc1","#1693a7"],["#1c2130","#028f76","#b3e099","#ffeaad","#d14334"],["#a7c5bd","#e5ddcb","#eb7b59","#cf4647","#524656"],["#dad6ca","#1bb0ce","#4f8699","#6a5e72","#563444"],["#5c323e","#a82743","#e15e32","#c0d23e","#e5f04c"],["#edebe6","#d6e1c7","#94c7b6","#403b33","#d3643b"],["#fdf1cc","#c6d6b8","#987f69","#e3ad40","#fcd036"],["#230f2b","#f21d41","#ebebbc","#bce3c5","#82b3ae"],["#b9d3b0","#81bda4","#b28774","#f88f79","#f6aa93"],["#3a111c","#574951","#83988e","#bcdea5","#e6f9bc"],["#5e3929","#cd8c52","#b7d1a3","#dee8be","#fcf7d3"],["#1c0113","#6b0103","#a30006","#c21a01","#f03c02"],["#000000","#9f111b","#b11623","#292c37","#cccccc"],["#382f32","#ffeaf2","#fcd9e5","#fbc5d8","#f1396d"],["#e3dfba","#c8d6bf","#93ccc6","#6cbdb5","#1a1f1e"],["#f6f6f6","#e8e8e8","#333333","#990100","#b90504"],["#1b325f","#9cc4e4","#e9f2f9","#3a89c9","#f26c4f"],["#a1dbb2","#fee5ad","#faca66","#f7a541","#f45d4c"],["#c1b398","#605951","#fbeec2","#61a6ab","#accec0"],["#5e9fa3","#dcd1b4","#fab87f","#f87e7b","#b05574"],["#951f2b","#f5f4d7","#e0dfb1","#a5a36c","#535233"],["#8dccad","#988864","#fea6a2","#f9d6ac","#ffe9af"],["#2d2d29","#215a6d","#3ca2a2","#92c7a3","#dfece6"],["#413d3d","#040004","#c8ff00","#fa023c","#4b000f"],["#eff3cd","#b2d5ba","#61ada0","#248f8d","#605063"],["#ffefd3","#fffee4","#d0ecea","#9fd6d2","#8b7a5e"],["#cfffdd","#b4dec1","#5c5863","#a85163","#ff1f4c"],["#9dc9ac","#fffec7","#f56218","#ff9d2e","#919167"],["#4e395d","#827085","#8ebe94","#ccfc8e","#dc5b3e"],["#a8a7a7","#cc527a","#e8175d","#474747","#363636"],["#f8edd1","#d88a8a","#474843","#9d9d93","#c5cfc6"],["#046d8b","#309292","#2fb8ac","#93a42a","#ecbe13"],["#f38a8a","#55443d","#a0cab5","#cde9ca","#f1edd0"],["#a70267","#f10c49","#fb6b41","#f6d86b","#339194"],["#ff003c","#ff8a00","#fabe28","#88c100","#00c176"],["#ffedbf","#f7803c","#f54828","#2e0d23","#f8e4c1"],["#4e4d4a","#353432","#94ba65","#2790b0","#2b4e72"],["#0ca5b0","#4e3f30","#fefeeb","#f8f4e4","#a5b3aa"],["#4d3b3b","#de6262","#ffb88c","#ffd0b3","#f5e0d3"],["#fffbb7","#a6f6af","#66b6ab","#5b7c8d","#4f2958"],["#edf6ee","#d1c089","#b3204d","#412e28","#151101"],["#9d7e79","#ccac95","#9a947c","#748b83","#5b756c"],["#fcfef5","#e9ffe1","#cdcfb7","#d6e6c3","#fafbe3"],["#9cddc8","#bfd8ad","#ddd9ab","#f7af63","#633d2e"],["#30261c","#403831","#36544f","#1f5f61","#0b8185"],["#aaff00","#ffaa00","#ff00aa","#aa00ff","#00aaff"],["#d1313d","#e5625c","#f9bf76","#8eb2c5","#615375"],["#ffe181","#eee9e5","#fad3b2","#ffba7f","#ff9c97"],["#73c8a9","#dee1b6","#e1b866","#bd5532","#373b44"],["#805841","#dcf7f3","#fffcdd","#ffd8d8","#f5a2a2"]];JRe={leftside_top:{side:"leftside",alignment:"top"},leftside_bottom:{side:"leftside",alignment:"bottom"},rightside_top:{side:"rightside",alignment:"top"},rightside_bottom:{side:"rightside",alignment:"bottom"},topside_left:{side:"topside",alignment:"left"},topside_right:{side:"topside",alignment:"right"},bottomside_left:{side:"bottomside",alignment:"left"},bottomside_right:{side:"bottomside",alignment:"right"}},_4o=Object.keys(JRe)});var x4o=(e,t,n)=>{let o=[{x:e.x,y:e.y}],r=(e.x+t.x)/2,i=(e.y+t.y)/2,s={x:t.x,y:t.y};switch(t.facingDirection){case"x+":s.x+=n;break;case"x-":s.x-=n;break;case"y+":s.y+=n;break;case"y-":s.y-=n;break}let a=e.facingDirection??"none",c=t.facingDirection??"none",l=(u)=>{let _=o[o.length-1];if(_.x!==u.x||_.y!==u.y)o.push(u)},h=Math.abs(e.y-t.y)<=Math.max(0.000001,n*0.1),d=Math.abs(e.x-t.x)<=Math.max(0.000001,n*0.1);if(a==="none"&&c==="none")l({x:r,y:e.y}),l({x:r,y:t.y});else if(a==="x+"&&c==="y+")if(e.x>t.x&&e.y<t.y)l({x:e.x+n,y:e.y}),l({x:e.x+n,y:t.y+n}),l({x:t.x,y:t.y+n});else if(!d&&!h&&e.x<t.x&&e.y>t.y)l({x:t.x,y:e.y});else if(d)l({x:e.x+n,y:e.y}),l({x:e.x+n,y:t.y+n}),l({x:t.x,y:t.y+n});else if(e.x<t.x)l({x:r,y:e.y}),l({x:r,y:s.y}),l({x:t.x,y:s.y});else if(e.y<=t.y+n)l({x:e.x+n,y:e.y}),l({x:e.x+n,y:e.y+n}),l({x:t.x,y:e.y+n}),l({x:t.x,y:t.y});else l({x:e.x+n,y:e.y}),l({x:e.x+n,y:(e.y+t.y)/2}),l({x:t.x,y:(e.y+t.y)/2});else if(a==="x+"&&c==="x+"&&!h){let u=Math.max(e.x+n,s.x);l({x:u,y:e.y}),l({x:u,y:t.y})}else if(a==="x+"&&c==="x+"&&h)l({x:e.x+n,y:e.y}),l({x:e.x+n,y:e.y+n}),l({x:t.x+n,y:e.y+n}),l({x:t.x+n,y:t.y});else if(a==="x+"&&c==="y-")if(d&&e.y<=t.y)l({x:e.x+n,y:e.y}),l({x:e.x+n,y:i}),l({x:t.x,y:i});else if(d&&e.y>t.y)l({x:e.x+n,y:e.y}),l({x:e.x+n,y:t.y-n}),l({x:t.x,y:t.y-n});else if(e.x<t.x&&e.y<t.y)l({x:t.x,y:e.y});else if(e.x>t.x&&e.y<t.y){let u=e.x+n;l({x:u,y:e.y}),l({x:u,y:i}),l({x:t.x,y:i})}else if(e.x>t.x&&e.y>t.y){let u=e.x+n;l({x:u,y:e.y}),l({x:u,y:s.y}),l({x:t.x,y:s.y})}else if(e.y===t.y)l({x:e.x+n,y:e.y}),l({x:e.x+n,y:e.y-n}),l({x:t.x,y:e.y-n});else l({x:r,y:e.y}),l({x:r,y:s.y}),l({x:t.x,y:s.y});else if(a==="x+"&&c==="x-"&&e.x+n>=t.x-n&&!h){let u=e.x+n;l({x:u,y:e.y}),l({x:u,y:i}),l({x:s.x,y:i}),l({x:s.x,y:s.y})}else if(a==="x+"&&c==="x-"&&h&&t.x>e.x);else if(a==="x+"&&c==="x-"&&h)l({x:e.x+n,y:e.y}),l({x:e.x+n,y:e.y+n}),l({x:t.x-n,y:e.y+n}),l({x:t.x-n,y:e.y});else{if(a==="x+")l({x:e.x+n,y:e.y});l({x:r,y:o[o.length-1].y}),l({x:r,y:s.y}),l({x:s.x,y:s.y})}return l({x:t.x,y:t.y}),o},oz=(e,t,n={})=>{let o=e,r=t,i=!1;if(o.x>r.x||o.x===r.x&&o.y>r.y)i=!0,[o,r]=[r,o];let s=o.facingDirection==="x-",a=o.facingDirection==="y-",c=(f)=>{let y=s?o.x-(f.x-o.x):f.x,x=a?o.y-(f.y-o.y):f.y,C=f.facingDirection;if(s){if(C==="x+")C="x-";else if(C==="x-")C="x+"}if(a){if(C==="y+")C="y-";else if(C==="y-")C="y+"}return{x:y,y:x,facingDirection:C}},l=(f,y)=>{let x=f.x-y.x,C=f.y-y.y,b=y.x+C,I=y.y-x,v=f.facingDirection;switch(v){case"x+":v="y-";break;case"y-":v="x-";break;case"x-":v="y+";break;case"y+":v="x+";break}return{x:b,y:I,facingDirection:v}},h=(f,y)=>{let x=f.x-y.x,C=f.y-y.y;return{x:y.x-C,y:y.y+x}},d=s||a?c(o):o,u=s||a?c(r):r,_=d,p=u,m=!1;if(d.facingDirection==="y+")m=!0,_={...d,facingDirection:"x+"},p=l(u,d);let A=n?.overshoot??0.1*Math.max(Math.abs(_.x-p.x),Math.abs(_.y-p.y)),g=x4o(_,p,A);if(m)g=g.map((f)=>h(f,_));if(s||a)g=g.map(({x:f,y})=>({x:s?o.x-(f-o.x):f,y:a?o.y-(y-o.y):y}));return i?g.reverse():g};var kre=()=>{};function m4(e,t){return Array.isArray(t)?[e.a*t[0]+e.c*t[1]+e.e,e.b*t[0]+e.d*t[1]+e.f]:{x:e.a*t.x+e.c*t.y+e.e,y:e.b*t.x+e.d*t.y+e.f}}function Ibt(e){return typeof e>"u"}function vbt(e,t=0){return{a:1,c:0,e,b:0,d:1,f:t}}function T2e(...e){e=Array.isArray(e[0])?e[0]:e;let t=(n,o)=>({a:n.a*o.a+n.c*o.b,c:n.a*o.c+n.c*o.d,e:n.a*o.e+n.c*o.f+n.e,b:n.b*o.a+n.d*o.b,d:n.b*o.c+n.d*o.d,f:n.b*o.e+n.d*o.f+n.f});switch(e.length){case 0:throw Error("no matrices provided");case 1:return e[0];case 2:return t(e[0],e[1]);default:{let[n,o,...r]=e,i=t(n,o);return T2e(i,...r)}}}function I4o(e,t,n){let o=C4o(e),r=b4o(e),i={a:o,c:-r,e:0,b:r,d:o,f:0};return Ibt(t)||Ibt(n)?i:T2e([vbt(t,n),i,vbt(-t,-n)])}function v4o(e,t){function n(){this.constructor=e}n.prototype=t.prototype,e.prototype=new n}function D2e(e,t,n,o){var r=Error.call(this,e);return Object.setPrototypeOf&&Object.setPrototypeOf(r,D2e.prototype),r.expected=t,r.found=n,r.location=o,r.name="SyntaxError",r}function eQe(e,t,n){return n=n||" ",e.length>t?e:(t-=e.length,n+=n.repeat(t),e+n.slice(0,t))}function bM(e){if(e.length===0)return{minX:0,maxX:0,minY:0,maxY:0};let t=1/0,n=-1/0,o=1/0,r=-1/0,i=(s)=>{t=Math.min(t,s.x),n=Math.max(n,s.x),o=Math.min(o,s.y),r=Math.max(r,s.y)};return e.forEach((s)=>{switch(s.type){case"path":s.points.forEach(i);break;case"text":i({x:s.x,y:s.y});break;case"circle":{let{x:a,y:c,radius:l}=s;i({x:a-l,y:c-l}),i({x:a+l,y:c+l});break}case"box":{let{x:a,y:c,width:l,height:h}=s,d=l/2,u=h/2;i({x:a-d,y:c-u}),i({x:a+d,y:c+u});break}}}),{minX:t,maxX:n,minY:o,maxY:r}}function yl(e){let t=e.size;if(!t){let n=bM(e.primitives);t={width:n.maxX-n.minX,height:n.maxY-n.minY}}return{...e,size:t}}function YIo(e){return typeof e=="object"}function Ure(e,t){return{width:Math.max(...t.map((n)=>Math.abs(n.x-e.x)))*2,height:Math.max(...t.map((n)=>Math.abs(n.y-e.y)))*2}}function vPo(e){return typeof e=="object"}function gEo(e){return typeof e=="object"}function S1e(e,t){let{width:n,height:o}=e.size,r=1,i=1;t.width!==void 0&&t.height!==void 0?(r=t.width/n,i=t.height/o):t.width!==void 0?r=i=t.width/n:t.height!==void 0&&(r=i=t.height/o);let s=e.primitives.map((a)=>{switch(a.type){case"path":return{...a,points:a.points.map((c)=>({x:c.x*r,y:c.y*i}))};case"text":return{...a,x:a.x*r,y:a.y*i,fontSize:a.fontSize?a.fontSize*r:void 0};case"circle":return{...a,x:a.x*r,y:a.y*i,radius:a.radius*r};case"box":return{...a,x:a.x*r,y:a.y*i,width:a.width*r,height:a.height*i};default:return a}});return{...e,primitives:s,center:{x:e.center.x*r,y:e.center.y*i},ports:e.ports.map((a)=>({...a,x:a.x*r,y:a.y*i})),size:{width:n*r,height:o*i}}}function LEo(e){return typeof e=="object"}function UEo(e){return typeof e=="object"}var C4o,b4o,cfs,lfs,S4o=(e,t="right")=>{switch(t){case"down":switch(e){case"middle_top":return"middle_right";case"middle_bottom":return"middle_left";case"middle_left":return"middle_bottom";case"middle_right":return"middle_top"}break;case"up":switch(e){case"middle_top":return"middle_left";case"middle_bottom":return"middle_right";case"middle_left":return"middle_top";case"middle_right":return"middle_bottom"}break;case"left":switch(e){case"middle_top":return"middle_bottom";case"middle_bottom":return"middle_top";case"middle_left":return"middle_right";case"middle_right":return"middle_left"}break;case"right":return e}return e},UX=(e,t)=>{let{primitives:n,center:o,ports:r,size:i}=e,s=T2e({a:1,b:0,c:0,d:-1,e:0,f:2*o.y}),a=n.map((l)=>{switch(l={...l},l.type){case"path":return{...l,points:l.points.map((_)=>m4(s,_))};case"text":let h=m4(s,{x:l.x,y:l.y}),d={top_left:"bottom_left",top_right:"bottom_right",bottom_left:"top_left",bottom_right:"top_right",center:"center",middle_top:"middle_bottom",middle_bottom:"middle_top",middle_left:"middle_left",middle_right:"middle_right"};return{...l,x:h.x,y:h.y,anchor:d[l.anchor]};case"circle":case"box":let u=m4(s,{x:l.x,y:l.y});return{...l,x:u.x,y:u.y}}}),c=r.map((l)=>({...l,...m4(s,l)}));return{primitives:a,center:o,ports:c,size:i,...t}},wI=(e,t)=>{let{primitives:n,center:o,ports:r,size:i}=e,s=T2e({a:-1,b:0,c:0,d:1,e:0,f:2*o.x}),a=n.map((l)=>{switch(l={...l},l.type){case"path":return{...l,points:l.points.map((_)=>m4(s,_))};case"text":let h=m4(s,{x:l.x,y:l.y}),d={top_left:"top_right",top_right:"top_left",bottom_left:"bottom_right",bottom_right:"bottom_left",center:"center",middle_top:"middle_top",middle_bottom:"middle_bottom",middle_left:"middle_right",middle_right:"middle_left"};return{...l,x:h.x,y:h.y,anchor:d[l.anchor]};case"circle":case"box":let u=m4(s,{x:l.x,y:l.y});return{...l,x:u.x,y:u.y}}}),c=r.map((l)=>({...l,...m4(s,l)}));return{primitives:a,center:o,ports:c,size:i,...t}},Vre=(e,t)=>{let{newOrientation:n,overrides:o}=t,r={up:Math.PI/2,right:0,down:-Math.PI/2,left:-Math.PI},i=I4o(n?r[n]:Math.PI/2,e.center.x,e.center.y),{primitives:s,center:a,size:c,ports:l}=e,h=s.map((_)=>{switch(_={..._},_.type){case"path":return{..._,points:_.points.map((g)=>m4(i,g))};case"text":let p=m4(i,{x:_.x,y:_.y});return _.anchor=S4o(_.anchor,n??"right"),{..._,x:p.x,y:p.y};case"circle":let m=m4(i,{x:_.x,y:_.y});return{..._,x:m.x,y:m.y};case"box":let A=m4(i,{x:_.x,y:_.y});return{..._,x:A.x,y:A.y,width:_.height,height:_.width}}}),d=l.map((_)=>({..._,...m4(i,_)})),u=bM(h);return{primitives:h,center:a,ports:d,size:{width:u.maxX-u.minX,height:u.maxY-u.minY},...o}},Mo=(e,t="down",n={})=>Vre(e,{newOrientation:t,overrides:n}),P4o=class{symbol;constructor(e){this.symbol=JSON.parse(JSON.stringify(e)),this.symbol.size=this.computeSize()}changeTextAnchor(e,t,n){return this.symbol={...this.symbol,primitives:this.symbol.primitives.map((o)=>o.type==="text"&&o.text===e?{...o,anchor:t,...n?{x:o.x+n.x,y:o.y+n.y}:{}}:o)},this}labelPort(e,t){return this.symbol={...this.symbol,ports:this.symbol.ports.map((n)=>n.labels.includes(e)?{...n,labels:t}:n)},this}rotateRightFacingSymbol(e){return this.symbol=Vre(this.symbol,{newOrientation:e}),this}computeSize(){let e=bM(this.symbol.primitives);return{width:e.maxX-e.minX,height:e.maxY-e.minY}}build(){return{...this.symbol,size:this.computeSize()}}},gn=(e)=>{let t=e.primitives??[...Object.values(e.paths??{}),...Object.values(e.texts??{}),...Object.values(e.circles??{}),...Object.values(e.rects??{})],n=e.ports??Object.entries(e.refblocks).flatMap(([r,i])=>[{...i,labels:[r]}]),o=e.center??{x:e.bounds.centerX,y:e.bounds.centerY};return n.length===2&&(o={x:(n[0].x+n[1].x)/2,y:(n[0].y+n[1].y)/2}),new P4o({...e,primitives:t,ports:n,center:o})},WX,E4o,hfs,UAe,Sbt,M4o,w4o,B4o,dfs,WAe,Pbt,T4o,D4o,N4o,ufs,XAe,Ebt,R4o,Q4o,k4o,pfs,jAe,Mbt,L4o,H4o,F4o,mfs,KAe,wbt,z4o,O4o,V4o,_fs,$Ae,Bbt,Y4o,G4o,TQe,U4o,ZIt,W4o,X4o,XX,j4o,gfs,qAe,Tbt,K4o,$4o,q4o,J4o,Afs,JAe,Dbt,Z4o,e3o,t3o,N2e,n3o,Di=(e,{kind:t,orientation:n,pin1Labels:o=["1"],pin2Labels:r=["2"]})=>{let i=n3o[t],s=gn({...e,texts:{}}).rotateRightFacingSymbol(n).labelPort("left1",o).labelPort("right1",r).build(),a=n==="right"||n==="left",c=a?[{type:"text",text:"{REF}",x:0,y:i.horizontalOffset,anchor:"middle_bottom"},{type:"text",text:"{VAL}",x:0,y:-i.horizontalOffset,anchor:"middle_top"}]:[{type:"text",text:"{REF}",x:i.verticalX,y:i.verticalRefY,anchor:"middle_left"},{type:"text",text:"{VAL}",x:i.verticalX,y:i.verticalValY,anchor:"middle_left"}],[l,h]=s.ports,d=Math.hypot(h.x-l.x,h.y-l.y);return{...s,primitives:[...s.primitives,...c],size:a?{width:d,height:i.horizontalHeight}:{width:i.verticalWidth,height:d}}},o3o,r3o,i3o,s3o,a3o,ffs,ZAe,Nbt,c3o,l3o,h3o,yfs,efe,Rbt,d3o,u3o,R2e,p3o,m3o,_3o,g3o,Q2e,A3o,xfs,tfe,Qbt,f3o,y3o,x3o,Cfs,nfe,kbt,C3o,e9t,b3o,bfs,ofe,Lbt,I3o,v3o,Ifs,vfs,Sfs,Pfs,Efs,DQe,NQe,RQe,S3o,Yre,P3o,Hbt,Fbt,E3o,M3o,w3o,B3o,zbt,rfe,Obt,T3o,t9t,D3o,Vbt,Ybt,N3o,R3o,Q3o,k3o,Gbt,Ubt,L3o,H3o,F3o,z3o,Wbt,Xbt,O3o,V3o,Y3o,G3o,k2e,U3o,Mfs,jbt,Kbt,W3o,X3o,j3o,K3o,wfs,$bt,qbt,$3o,q3o,J3o,Z3o,Bfs,Jbt,Zbt,eCo,tCo,nCo,L2e,oCo,rCo,iCo,sCo,H2e,aCo,Tfs,ife,e6t,cCo,lCo,hCo,Dfs,sfe,t6t,dCo,uCo,pCo,Nfs,afe,n6t,mCo,_Co,gCo,Rfs,cfe,o6t,ACo,fCo,yCo,Qfs,r6t,i6t,xCo,CCo,bCo,F2e,ICo,vCo,SCo,PCo,QQe,ECo,kfs,s6t,a6t,MCo,wCo,BCo,Lfs,c6t,l6t,TCo,n9t,DCo,NCo,Hfs,h6t,d6t,RCo,QCo,z2e,kCo,Ffs,lfe,u6t,LCo,HCo,FCo,zCo,OCo,O2e,VCo,YCo,GCo,UCo,WCo,XCo,V2e,jCo,KCo,$Co,qCo,JCo,zfs,hfe,p6t,ZCo,ebo,tbo,Y2e,nbo,obo,rbo,ibo,jX,sbo,Ofs,dfe,m6t,abo,cbo,lbo,hbo,Vfs,ufe,_6t,dbo,ubo,pbo,mbo,Yfs,pfe,g6t,_bo,gbo,Abo,Gfs,mfe,A6t,fbo,ybo,G2e,xbo,Ufs,_fe,gfe,Cbo,bbo,Ibo,vbo,Sbo,Wfs,Afe,ffe,Pbo,Ebo,U2e,Mbo,Xfs,yfe,f6t,wbo,Bbo,Tbo,Dbo,Nbo,jfs,xfe,y6t,Rbo,Qbo,Lre=0.6,tQe=0.3,kbo,Lbo,Hre=0.6,nQe=0.3,Hbo,Fbo,Fre=0.6,oQe=0.3,zbo,Obo,zre=0.6,rQe=0.3,Vbo,Ybo,KX,Gbo,Ubo,Wbo,Xbo,jbo,Kbo,$bo,x6t,Cfe,C6t,qbo,Gre,EQe,b6t,Jbo,Zbo,MQe,e6o,$X,t6o,Kfs,bfe,I6t,n6o,o6o,r6o,$fs,Ife,v6t,i6o,s6o,a6o,qfs,vfe,S6t,c6o,l6o,h6o,Jfs,Sfe,P6t,d6o,u6o,p6o,Zfs,Pfe,E6t,m6o,_6o,g6o,e2s,Efe,M6t,A6o,f6o,qX,y6o,x6o,C6o,b6o,I6o,v6o,W2e,S6o,w6t,P6o,E6o,M6o,B6t,w6o,B6o,T6o,T6t,D6o,N6o,R6o,D6t,Q6o,k6o,L6o,X2e,H6o,F6o,j2e,z6o,O6o,V6o,Y6o,G6o,K2e,U6o,W6o,X6o,j6o,K6o,$2e,kQe,LQe,HQe,$6o,FQe,zQe,OQe,q6o,VQe,YQe,GQe,J6o,Z6o,q2e,UQe,WQe,XQe,eIo,jQe,KQe,$Qe,tIo,qQe,JQe,ZQe,nIo,oIo,J2e,eke,tke,nke,rIo,oke,rke,ike,iIo,ske,ake,cke,sIo,aIo,Z2e,lke,hke,dke,cIo,uke,pke,mke,lIo,_ke,gke,Ake,hIo,Mfe,dIo,fke=(e)=>{let t=dIo[e],n=e==="up"||e==="down";return gn({...Mfe,texts:{...Mfe.texts,top1:{...Mfe.texts.top1,...t.reference},bottom1:{...Mfe.texts.bottom1,...t.value}}}).labelPort("left1",["1","anode"]).labelPort("bottom1",["2","junction","common"]).labelPort("right1",["3","cathode"]).rotateRightFacingSymbol(e).changeTextAnchor("{REF}",n?"middle_left":"middle_bottom").changeTextAnchor("{VAL}",n?"middle_left":"middle_top").build()},uIo,o9t,pIo,mIo,r9t,_Io,t2s,wfe,N6t,gIo,i9t,yke,xke,Cke,AIo,s9t,fIo,JX,yIo,n2s,Bfe,R6t,xIo,CIo,bIo,o2s,Tfe,Q6t,IIo,vIo,SIo,r2s,Dfe,k6t,PIo,EIo,MIo,i2s,Nfe,L6t,wIo,BIo,TIo,s2s,Rfe,H6t,DIo,NIo,RIo,a2s,Qfe,F6t,QIo,kIo,LIo,HIo,FIo,kfe,z6t,zIo,bke,OIo,VIo,O6t,GIo,UIo,WIo,XIo,Lfe,V6t,a9t,jIo,ZX,KIo,$Io,qIo,JIo,ZIo,e9o,Ike,c2s,l2s,h2s,d2s,u2s,t9o,n9o,o9o,e1e,r9o,i9o,vke,Ske,Pke,s9o,a9o,c9t,Eke,Mke,l9t,c9o,l9o,h9t,d9t,u9t,wke,Bke,h9o,t1e,d9o,u9o,p9o,m9o,p9t,n1e,Tke,Dke,Nke,_9o,Rke,Qke,kke,g9o,Lke,Hke,Fke,A9o,f9o,y9o,Y6t,Hfe,G6t,x9o,zke,Oke,Vke,Yke,m9t,Gke,Uke,Wke,C9o,b9o,o1e,I9o,v9o,S9o,P9o,r1e,E9o,M9o,w9o,B9o,T9o,D9o,U6t,Ffe,W6t,N9o,_9t,g9t,A9t,Xke,jke,R9o,Q9o,k9o,X6t,j6t,OX,K6t,f9t,Kke,y9t,$ke,L9o,H9o,F9o,$6t,zfe,q6t,z9o,x9t,qke,Ore,B2e,O9o,Ml=({horizontalSymbol:e,verticalSymbol:t,gateSide:n,drainSide:o})=>{let r=n==="left"||n==="right",i=o==="left"||o==="right";if(r===i)throw Error(`Invalid MOSFET orientation: gate ${n}, drain ${o}. Gate and drain must be perpendicular.`);let s=r?e:t;return(n==="right"||i&&o==="left")&&(s=wI(s)),(n==="bottom"||!i&&o==="bottom")&&(s=UX(s)),s},V9o,Y9o,J6t,Z6t,rz,G9o,C9t,U9o,n7,b9t,I9t,Jke,Zke,IM,W9o,X9o,j9o,K9o,$9o,q9o,J9o,Z9o,evo,tvo,eIt,tIt,VX,nvo,nIt,o7,v9t,S9t,eLe,tLe,vM,ovo,rvo,ivo,svo,avo,cvo,lvo,hvo,dvo,uvo,oIt,Ofe,iQe,pvo,P9t,E9t,M9t,nLe,oLe,mvo,_vo,gvo,rIt,Avo,i1e,fvo,yvo,xvo,ej,Cvo,p2s,Vfe,sQe,bvo,Ivo,vvo,m2s,Yfe,aQe,Svo,Pvo,Evo,_2s,Gfe,cQe,Mvo,wvo,Bvo,g2s,Ufe,lQe,Tvo,Dvo,Nvo,A2s,Wfe,hQe,Rvo,Qvo,kvo,f2s,Xfe,dQe,Lvo,Hvo,Fvo,s1e,zvo,Ovo,Vvo,Yvo,a1e,Gvo,Uvo,Wvo,Xvo,jvo,iIt,sIt,YX,Kvo,aIt,r7,w9t,B9t,rLe,iLe,SM,$vo,qvo,Jvo,Zvo,e8o,t8o,n8o,o8o,r8o,i8o,cIt,lIt,GX,s8o,hIt,i7,T9t,D9t,sLe,aLe,PM,a8o,c8o,l8o,h8o,d8o,u8o,p8o,m8o,_8o,N9t,R9t,g8o,Q9t,A8o,cLe,f8o,k9t,y8o,x8o,C8o,b8o,dIt,jfe,uQe,I8o,L9t,H9t,F9t,lLe,hLe,v8o,iz,S8o,y2s,Kfe,pQe,P8o,E8o,x2s,C2s,b2s,I2s,v2s,M8o,w8o,S2s,$fe,mQe,B8o,T8o,D8o,P2s,qfe,_Qe,N8o,R8o,Q8o,E2s,Jfe,gQe,k8o,L8o,H8o,M2s,Zfe,AQe,F8o,z8o,O8o,V8o,uIt,e2e,pIt,z9t,Y8o,G8o,U8o,W8o,mIt,t2e,_It,c1e,dLe,uLe,pLe,X8o,mLe,_Le,gLe,j8o,ALe,fLe,yLe,K8o,l1e,$8o,w2s,n2e,fQe,q8o,J8o,Z8o,B2s,o2e,yQe,e7o,t7o,n7o,o7o,T2s,r2e,xQe,r7o,i7o,s7o,a7o,D2s,i2e,gIt,c7o,O9t,V9t,xLe,wQe,CLe,BQe,l7o,h7o,d7o,AIt,fIt,yIt,u7o,Y9t,p7o,G9t,m7o,xIt,_7o,CQe,g7o,Wre,bLe,ILe,vLe,A7o,f7o,CIt,y7o,bQe,x7o,C7o,SLe,PLe,ELe,b7o,MLe,wLe,BLe,I7o,TLe,DLe,NLe,v7o,h1e,S7o,N2s,bIt,P7o,E7o,M7o,w7o,R2s,IIt,B7o,T7o,D7o,N7o,Q2s,vIt,R7o,Q7o,k7o,L7o,k2s,SIt,H7o,F7o,z7o,O7o,PIt,s2e,a2e,V7o,U9t,RLe,Y7o,G7o,U7o,d1e,W7o,L2s,c2e,EIt,X7o,j7o,K7o,H2s,l2e,MIt,$7o,q7o,J7o,F2s,h2e,wIt,Z7o,eSo,u1e,tSo,nSo,oSo,rSo,iSo,z2s,d2e,BIt,sSo,aSo,p1e,cSo,lSo,hSo,dSo,W9t,uSo,TIt,u2e,IQe,pSo,m1e,QLe,kLe,LLe,mSo,_So,O2s,p2e,vQe,gSo,X9t,HLe,FLe,zLe,ASo,OLe,VLe,YLe,fSo,ySo,GLe,xSo,j9t,CSo,bSo,ISo,_1e,ULe,WLe,XLe,vSo,jLe,KLe,$Le,SSo,qLe,JLe,ZLe,PSo,K9t,V2s,Y2s,G2s,U2s,W2s,$9t,q9t,ESo,J9t,MSo,Z9t,wSo,eHe,evt,tHe,BSo,tvt,nHe,TSo,nvt,DSo,oHe,ovt,rHe,NSo,rvt,iHe,RSo,ivt,QSo,sHe,svt,aHe,kSo,avt,cHe,LSo,cvt,HSo,lHe,lvt,hHe,FSo,hvt,dHe,zSo,dvt,OSo,uHe,uvt,pHe,VSo,pvt,mHe,YSo,mvt,GSo,_He,_vt,gHe,USo,gvt,AHe,WSo,XSo,g1e,fHe,yHe,xHe,jSo,CHe,bHe,IHe,KSo,vHe,SHe,PHe,$So,qSo,A1e,EHe,MHe,wHe,JSo,BHe,THe,DHe,ZSo,NHe,RHe,QHe,ePo,tj,Avt,m2e,tPo,fvt,_2e,nPo,yvt,g2e,oPo,xvt,A2e,rPo,Cvt,f2e,iPo,bvt,y2e,sPo,f1e,y1e,kHe,LHe,HHe,aPo,FHe,zHe,OHe,cPo,VHe,YHe,GHe,lPo,x1e,C1e,UHe,WHe,XHe,hPo,jHe,KHe,$He,dPo,qHe,JHe,ZHe,uPo,b1e,pPo,mPo,_Po,gPo,Ivt,X2s,j2s,K2s,$2s,q2s,vvt,APo,fPo,yPo,xPo,x2e,DIt,CPo,eFe,bPo,IPo,NIt,SPo,I1e,Svt,RIt,PPo,EPo,Pvt,QIt,MPo,wPo,tFe,nFe,oFe,rFe,Evt,iFe,sFe,aFe,BPo,cFe,lFe,hFe,TPo,dFe,DPo,Mvt,NPo,RPo,wvt,J2s,Z2s,e1s,t1s,n1s,Bvt,Tvt,Dvt,QPo,kPo,LPo,HPo,FPo,kIt,C2e,LIt,zPo,Nvt,uFe,OPo,VPo,YPo,GPo,UPo,HIt,b2e,SQe,WPo,Rvt,Qvt,kvt,XPo,Lvt,jPo,KPo,$Po,qPo,JPo,PQe,I2e,FIt,ZPo,Hvt,eEo,tEo,nEo,zIt,v2e,OIt,oEo,Fvt,pFe,rEo,iEo,sEo,aEo,cEo,VIt,S2e,YIt,zvt,Ovt,Vvt,mFe,_Fe,lEo,hEo,dEo,uEo,P2e,GIt,pEo,gFe,mEo,_Eo,UIt,AEo,v1e,fEo,yEo,xEo,CEo,bEo,IEo,vEo,SEo,AFe,o1s,r1s,i1s,s1s,a1s,PEo,EEo,c1s,WIt,MEo,XIt,wEo,BEo,TEo,DEo,NEo,E2e,jIt,REo,fFe,QEo,kEo,KIt,HEo,FEo,zEo,OEo,M2e,$It,VEo,yFe,YEo,GEo,qIt,WEo,Yvt,XEo,P1e,jEo,KEo,$Eo,qEo,JEo,w2e,JIt,ZEo,eMo,E1e,tMo,nMo,oMo,rMo,Es,l1s;var m0=El(()=>{({cos:C4o,sin:b4o,PI:cfs}=Math);({tan:lfs}=Math);v4o(D2e,Error);D2e.prototype.format=function(e){var t="Error: "+this.message;if(this.location){var n=null,o;for(o=0;o<e.length;o++)if(e[o].source===this.location.source){n=e[o].text.split(/\r\n|\n|\r/g);break}var r=this.location.start,i=this.location.source&&typeof this.location.source.offset=="function"?this.location.source.offset(r):r,s=this.location.source+":"+i.line+":"+i.column;if(n){var a=this.location.end,c=eQe("",i.line.toString().length," "),l=n[r.line-1],h=r.line===a.line?a.column:l.length+1,d=h-r.column||1;t+=`
 --> `+s+`
`+c+` |
`+i.line+" | "+l+`
`+c+" | "+eQe("",r.column-1," ")+eQe("",d,"^")}else t+=`
 at `+s}return t};D2e.buildMessage=function(e,t){var n={literal:function(l){return'"'+r(l.text)+'"'},class:function(l){var h=l.parts.map(function(d){return Array.isArray(d)?i(d[0])+"-"+i(d[1]):i(d)});return"["+(l.inverted?"^":"")+h.join("")+"]"},any:function(){return"any character"},end:function(){return"end of input"},other:function(l){return l.description}};function o(l){return l.charCodeAt(0).toString(16).toUpperCase()}function r(l){return l.replace(/\\/g,"\\\\").replace(/"/g,"\\\"").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(h){return"\\x0"+o(h)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(h){return"\\x"+o(h)})}function i(l){return l.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(h){return"\\x0"+o(h)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(h){return"\\x"+o(h)})}function s(l){return n[l.type](l)}function a(l){var h=l.map(s),d,u;if(h.sort(),h.length>0){for(d=1,u=1;d<h.length;d++)h[d-1]!==h[d]&&(h[u]=h[d],u++);h.length=u}switch(h.length){case 1:return h[0];case 2:return h[0]+" or "+h[1];default:return h.slice(0,-1).join(", ")+", or "+h[h.length-1]}}function c(l){return l?'"'+r(l)+'"':"end of input"}return"Expected "+a(e)+" but "+c(t)+" found."};WX={paths:{path11:{type:"path",points:[{x:-0.54,y:0.03},{x:-0.3,y:0.04}],color:"primary",fill:!1},path12:{type:"path",points:[{x:0.29,y:0.04},{x:0.54,y:0.04}],color:"primary",fill:!1},"path11-5-5":{type:"path",points:[{x:0.1,y:0.13},{x:0,y:-0.06},{x:-0.11,y:0.13}],color:"primary",fill:!1},path17:{type:"path",points:[{x:0,y:-0.13},{x:0.07,y:-0.11}],color:"primary",fill:!1},path18:{type:"path",points:[{x:0.07,y:-0.11},{x:0.14,y:-0.13}],color:"primary",fill:!1},path19:{type:"path",points:[{x:-0.15,y:-0.13},{x:-0.07,y:-0.11}],color:"primary",fill:!1},path20:{type:"path",points:[{x:-0.07,y:-0.11},{x:0,y:-0.13}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-0.17,y:0.4},bottom1:{type:"text",text:"{VAL}",x:-0.01,y:-0.4}},refblocks:{left1:{x:-0.54,y:0.03},right1:{x:0.54,y:0.04}},bounds:{minX:-0.57,maxX:0.57,minY:-0.4,maxY:0.4,width:1.14,height:0.79,centerX:0,centerY:0},circles:{path1:{type:"circle",x:0,y:0.04,radius:0.29,color:"primary",fill:!1}}},{paths:E4o,texts:hfs,bounds:UAe,refblocks:Sbt,circles:M4o}=WX,w4o=gn({primitives:[...Object.values(E4o),...Object.values(M4o),{type:"text",text:"{REF}",x:-0.15,y:0.3894553499999995},{type:"text",text:"{VAL}",x:0.15,y:0.3894553499999995}],ports:[{...Sbt.left1,labels:["1"]},{...Sbt.right1,labels:["2"]}],size:{width:UAe.width,height:UAe.height},center:{x:UAe.centerX,y:UAe.centerY}}).rotateRightFacingSymbol("down").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_left").changeTextAnchor("{VAL}","middle_left").build(),{paths:B4o,texts:dfs,bounds:WAe,refblocks:Pbt,circles:T4o}=WX,D4o=gn({primitives:[...Object.values(B4o),...Object.values(T4o),{type:"text",text:"{REF}",x:-0,y:0.4094553499999995},{type:"text",text:"{VAL}",x:0,y:-0.4094553499999995}],ports:[{...Pbt.left1,labels:["1"]},{...Pbt.right1,labels:["2"]}],size:{width:WAe.width,height:WAe.height},center:{x:WAe.centerX,y:WAe.centerY}}).changeTextAnchor("{VAL}","middle_top").rotateRightFacingSymbol("right").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_bottom").build(),{paths:N4o,texts:ufs,bounds:XAe,refblocks:Ebt,circles:R4o}=WX,Q4o=gn({primitives:[...Object.values(N4o),...Object.values(R4o),{type:"text",text:"{REF}",x:-0,y:-0.3094553499999995},{type:"text",text:"{VAL}",x:0,y:0.4094553499999995}],ports:[{...Ebt.left1,labels:["1"]},{...Ebt.right1,labels:["2"]}],size:{width:XAe.width,height:XAe.height},center:{x:XAe.centerX,y:XAe.centerY}}).changeTextAnchor("{VAL}","middle_bottom").rotateRightFacingSymbol("left").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_bottom").build(),{paths:k4o,texts:pfs,bounds:jAe,refblocks:Mbt,circles:L4o}=WX,H4o=gn({primitives:[...Object.values(k4o),...Object.values(L4o),{type:"text",text:"{REF}",x:-0,y:0.4094553499999995},{type:"text",text:"{VAL}",x:0,y:-0.4094553499999995}],ports:[{...Mbt.left1,labels:["1"]},{...Mbt.right1,labels:["2"]}],size:{width:jAe.width,height:jAe.height},center:{x:jAe.centerX,y:jAe.centerY}}).changeTextAnchor("{VAL}","middle_top").rotateRightFacingSymbol("right").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_bottom").build(),{paths:F4o,texts:mfs,bounds:KAe,refblocks:wbt,circles:z4o}=WX,O4o=gn({primitives:[...Object.values(F4o),...Object.values(z4o),{type:"text",text:"{REF}",x:0.15,y:-0.2894553499999995},{type:"text",text:"{VAL}",x:-0.15,y:-0.2894553499999995}],ports:[{...wbt.left1,labels:["1"]},{...wbt.right1,labels:["2"]}],size:{width:KAe.width,height:KAe.height},center:{x:KAe.centerX,y:KAe.centerY}}).rotateRightFacingSymbol("up").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_left").changeTextAnchor("{VAL}","middle_left").build(),{paths:V4o,texts:_fs,bounds:$Ae,refblocks:Bbt,circles:Y4o}=WX,G4o=gn({primitives:[...Object.values(V4o),...Object.values(Y4o),{type:"text",text:"{REF}",x:0.15,y:-0.2894553499999995},{type:"text",text:"{VAL}",x:-0.15,y:-0.2894553499999995}],ports:[{...Bbt.left1,labels:["1"]},{...Bbt.right1,labels:["2"]}],size:{width:$Ae.width,height:$Ae.height},center:{x:$Ae.centerX,y:$Ae.centerY}}).rotateRightFacingSymbol("up").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_left").changeTextAnchor("{VAL}","middle_left").build(),TQe={paths:{"input-a-lead":{type:"path",points:[{x:-0.6,y:0.16000000000000014},{x:-0.25,y:0.16000000000000014}],color:"primary",fill:!1},"input-b-lead":{type:"path",points:[{x:-0.6,y:-0.1399999999999999},{x:-0.25,y:-0.1399999999999999}],color:"primary",fill:!1},body:{type:"path",points:[{x:-0.25,y:0.3600000000000001},{x:0,y:0.3600000000000001},{x:0,y:0.3600000000000001},{x:0.029662962962962967,y:0.359535925925926},{x:0.05863703703703704,y:0.3581540740740742},{x:0.08690000000000002,y:0.35587000000000013},{x:0.11442962962962966,y:0.3526992592592594},{x:0.14120370370370372,y:0.3486574074074076},{x:0.16720000000000004,y:0.34376000000000023},{x:0.19239629629629632,y:0.3380225925925927},{x:0.21677037037037045,y:0.331460740740741},{x:0.2403,y:0.3240900000000001},{x:0.26296296296296295,y:0.31592592592592605},{x:0.28473703703703696,y:0.30698407407407413},{x:0.30560000000000004,y:0.2972800000000002},{x:0.3255296296296295,y:0.2868292592592593},{x:0.34450370370370376,y:0.2756474074074076},{x:0.36249999999999993,y:0.2637500000000001},{x:0.3794962962962963,y:0.25115259259259276},{x:0.39547037037037036,y:0.2378707407407409},{x:0.41040000000000004,y:0.2239200000000002},{x:0.42426296296296295,y:0.20931592592592613},{x:0.437037037037037,y:0.19407407407407426},{x:0.4487,y:0.1782100000000002},{x:0.4592296296296296,y:0.16173925925925947},{x:0.46860370370370374,y:0.14467740740740764},{x:0.4768,y:0.12704000000000024},{x:0.4837962962962963,y:0.10884259259259285},{x:0.4895703703703703,y:0.09010074074074101},{x:0.4941,y:0.07083000000000027},{x:0.49736296296296295,y:0.05104592592592622},{x:0.49933703703703697,y:0.03076407407407436},{x:0.5,y:0.0100000000000003},{x:0.5,y:0.010000000000000231},{x:0.5,y:0.010000000000000231},{x:0.499337037037037,y:-0.010764074074073858},{x:0.49736296296296295,y:-0.031045925925925727},{x:0.49410000000000004,y:-0.05082999999999982},{x:0.48957037037037043,y:-0.07010074074074057},{x:0.48379629629629634,y:-0.08884259259259243},{x:0.47680000000000006,y:-0.10703999999999986},{x:0.46860370370370374,y:-0.12467740740740728},{x:0.4592296296296297,y:-0.14173925925925915},{x:0.4486999999999999,y:-0.15820999999999985},{x:0.4370370370370371,y:-0.17407407407407394},{x:0.4242629629629629,y:-0.18931592592592578},{x:0.4104000000000001,y:-0.20391999999999988},{x:0.3954703703703703,y:-0.21787074074074056},{x:0.37949629629629644,y:-0.2311525925925925},{x:0.36249999999999993,y:-0.24374999999999986},{x:0.3445037037037037,y:-0.25564740740740727},{x:0.3255296296296296,y:-0.26682925925925916},{x:0.30560000000000004,y:-0.2772799999999999},{x:0.28473703703703707,y:-0.28698407407407395},{x:0.262962962962963,y:-0.29592592592592576},{x:0.24030000000000004,y:-0.30408999999999986},{x:0.21677037037037042,y:-0.3114607407407406},{x:0.19239629629629634,y:-0.31802259259259247},{x:0.16720000000000007,y:-0.3237599999999998},{x:0.14120370370370378,y:-0.32865740740740723},{x:0.11442962962962971,y:-0.33269925925925914},{x:0.08690000000000009,y:-0.33586999999999984},{x:0.058637037037037126,y:-0.33815407407407394},{x:0.029662962962963058,y:-0.33953592592592574},{x:0.00000000000000009992007221626409,y:-0.33999999999999986},{x:0,y:-0.33999999999999986},{x:-0.25,y:-0.33999999999999986},{x:-0.25,y:0.3600000000000001}],color:"primary",fill:!1},"output-lead":{type:"path",points:[{x:0.5,y:0.010000000000000231},{x:0.6000000000000001,y:0.010000000000000231}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:0,y:0.4700000000000002},bottom1:{type:"text",text:"{VAL}",x:0,y:-0.47}},refblocks:{left1:{x:-0.6,y:-0.1399999999999999},left2:{x:-0.6,y:0.16000000000000014},right1:{x:0.6000000000000001,y:0.010000000000000231}},bounds:{minX:-0.6,maxX:0.6000000000000001,minY:-0.47,maxY:0.4700000000000002,width:1.2000000000000002,height:0.9400000000000002,centerX:0.00000000000000005551115123125783,centerY:0.00000000000000011102230246251565},circles:{}},U4o=gn(TQe).labelPort("left1",["2","in2","input2","b"]).labelPort("left2",["1","in1","input1","a"]).labelPort("right1",["3","out","output","y"]).changeTextAnchor("{REF}","middle_bottom").changeTextAnchor("{VAL}","middle_top").rotateRightFacingSymbol("down").build(),ZIt=gn(TQe).labelPort("left1",["2","in2","input2","b"]).labelPort("left2",["1","in1","input1","a"]).labelPort("right1",["3","out","output","y"]).changeTextAnchor("{REF}","middle_bottom").changeTextAnchor("{VAL}","middle_top").rotateRightFacingSymbol("right").build(),W4o=wI(ZIt),X4o=gn(TQe).labelPort("left1",["2","in2","input2","b"]).labelPort("left2",["1","in1","input1","a"]).labelPort("right1",["3","out","output","y"]).changeTextAnchor("{REF}","middle_bottom").changeTextAnchor("{VAL}","middle_top").rotateRightFacingSymbol("up").build(),XX={paths:{path40:{type:"path",points:[{x:0.14,y:0.04},{x:-0.12,y:-0.09}],color:"primary",fill:!1},path41:{type:"path",points:[{x:-0.12,y:0.18},{x:0.14,y:0.04}],color:"primary",fill:!1},path42:{type:"path",points:[{x:-0.12,y:-0.09},{x:-0.12,y:0.18}],color:"primary",fill:!1},path43:{type:"path",points:[{x:0.14,y:0.18},{x:0.14,y:-0.09}],color:"primary",fill:!1},path44:{type:"path",points:[{x:-0.12,y:0.04},{x:-0.52,y:0.04}],color:"primary",fill:!1},"path44-0":{type:"path",points:[{x:0.52,y:0.04},{x:0.15,y:0.04}],color:"primary",fill:!1},"path43-8":{type:"path",points:[{x:0.14,y:0.18},{x:0.08,y:0.2}],color:"primary",fill:!1},"path43-8-3":{type:"path",points:[{x:0.21,y:-0.11},{x:0.15,y:-0.09}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-0.01,y:0.27},bottom1:{type:"text",text:"{VAL}",x:0,y:-0.27}},refblocks:{left1:{x:-0.52,y:0.04},right1:{x:0.52,y:0.04}},bounds:{minX:-0.55,maxX:0.55,minY:-0.27,maxY:0.27,width:1.09,height:0.55,centerX:0,centerY:0},circles:{}},{paths:j4o,texts:gfs,bounds:qAe,refblocks:Tbt,circles:K4o}=XX,$4o=gn({primitives:[...Object.values(j4o),...Object.values(K4o),{type:"text",text:"{REF}",x:-0.15,y:0.3294553499999995},{type:"text",text:"{VAL}",x:0.15,y:0.3294553499999995}],ports:[{...Tbt.left1,labels:["1"]},{...Tbt.right1,labels:["2"]}],size:{width:qAe.width,height:qAe.height},center:{x:qAe.centerX,y:qAe.centerY}}).rotateRightFacingSymbol("down").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_left").changeTextAnchor("{VAL}","middle_left").build(),q4o=gn(XX).changeTextAnchor("{VAL}","middle_top").labelPort("left1",["1","neg"]).labelPort("right1",["2","pos"]).changeTextAnchor("{REF}","middle_bottom").build(),{paths:J4o,texts:Afs,bounds:JAe,refblocks:Dbt,circles:Z4o}=XX,e3o=gn({primitives:[...Object.values(J4o),...Object.values(Z4o),{type:"text",text:"{REF}",x:-0,y:-0.2294553499999995},{type:"text",text:"{VAL}",x:0,y:0.3294553499999995}],ports:[{...Dbt.left1,labels:["1"]},{...Dbt.right1,labels:["2"]}],size:{width:JAe.width,height:JAe.height},center:{x:JAe.centerX,y:JAe.centerY}}).changeTextAnchor("{VAL}","middle_bottom").rotateRightFacingSymbol("left").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_bottom").build(),t3o=gn(XX).changeTextAnchor("{VAL}","middle_top").labelPort("left1",["1","neg"]).labelPort("right1",["2","pos"]).changeTextAnchor("{REF}","middle_bottom").build(),N2e={paths:{"anode-lead":{type:"path",points:[{x:-0.25,y:0},{x:-0.11999999999999988,y:0}],color:"primary",fill:!1},body:{type:"path",points:[{x:-0.11999999999999988,y:0.11999999999999988},{x:0.1200000000000001,y:0},{x:-0.11999999999999988,y:-0.1200000000000001},{x:-0.11999999999999988,y:0.11999999999999988}],color:"primary",fill:!1},"cathode-bar":{type:"path",points:[{x:0.07000000000000006,y:0.1399999999999999},{x:0.1200000000000001,y:0.11999999999999988},{x:0.1200000000000001,y:-0.1200000000000001},{x:0.16999999999999993,y:-0.1399999999999999}],color:"primary",fill:!1},"cathode-lead":{type:"path",points:[{x:0.1200000000000001,y:0},{x:0.25,y:0}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:0,y:0.25},bottom1:{type:"text",text:"{VAL}",x:0,y:-0.25}},refblocks:{left1:{x:-0.25,y:0},right1:{x:0.25,y:0}},bounds:{minX:-0.25,maxX:0.25,minY:-0.25,maxY:0.25,width:0.5,height:0.5,centerX:0,centerY:0},circles:{}},n3o={boxresistor:{horizontalOffset:0.16,horizontalHeight:0.65,verticalX:0.16,verticalRefY:0.16,verticalValY:-0.16,verticalWidth:0.9},capacitor:{horizontalOffset:0.24,horizontalHeight:0.65,verticalX:0.2,verticalRefY:0.095,verticalValY:-0.095,verticalWidth:0.9},led:{horizontalOffset:0.38,horizontalHeight:0.9,verticalX:0.38,verticalRefY:0.14,verticalValY:-0.14,verticalWidth:1.1},diode:{horizontalOffset:0.22,horizontalHeight:0.65,verticalX:0.2,verticalRefY:0.14,verticalValY:-0.14,verticalWidth:0.9},resistor:{horizontalOffset:0.22,horizontalHeight:0.65,verticalX:0.2,verticalRefY:0.14,verticalValY:-0.14,verticalWidth:0.9}},o3o=Di(N2e,{kind:"diode",orientation:"down",pin1Labels:["1","pos","anode"],pin2Labels:["2","neg","cathode"]}),r3o=Di(N2e,{kind:"diode",orientation:"left",pin1Labels:["1","pos","anode"],pin2Labels:["2","neg","cathode"]}),i3o=Di(N2e,{kind:"diode",orientation:"right",pin1Labels:["1","pos","anode"],pin2Labels:["2","neg","cathode"]}),s3o=Di(N2e,{kind:"diode",orientation:"up",pin1Labels:["1","pos","anode"],pin2Labels:["2","neg","cathode"]}),{paths:a3o,texts:ffs,bounds:ZAe,refblocks:Nbt,circles:c3o}=XX,l3o=gn({primitives:[...Object.values(a3o),...Object.values(c3o),{type:"text",text:"{REF}",x:0.15,y:-0.2294553499999995},{type:"text",text:"{VAL}",x:-0.15,y:-0.2294553499999995}],ports:[{...Nbt.left1,labels:["1"]},{...Nbt.right1,labels:["2"]}],size:{width:ZAe.width,height:ZAe.height},center:{x:ZAe.centerX,y:ZAe.centerY}}).rotateRightFacingSymbol("up").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_left").changeTextAnchor("{VAL}","middle_left").build(),{paths:h3o,texts:yfs,bounds:efe,refblocks:Rbt,circles:d3o}=XX,u3o=gn({primitives:[...Object.values(h3o),...Object.values(d3o),{type:"text",text:"{REF}",x:0.15,y:-0.2294553499999995},{type:"text",text:"{VAL}",x:-0.15,y:-0.2294553499999995}],ports:[{...Rbt.left1,labels:["1"]},{...Rbt.right1,labels:["2"]}],size:{width:efe.width,height:efe.height},center:{x:efe.centerX,y:efe.centerY}}).rotateRightFacingSymbol("up").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_left").changeTextAnchor("{VAL}","middle_left").build(),R2e={paths:{"anode-lead":{type:"path",points:[{x:-0.17499999999999982,y:0},{x:-0.09999999999999987,y:0}],color:"primary",fill:!1},body:{type:"path",points:[{x:-0.09999999999999987,y:0.09999999999999987},{x:0.10000000000000009,y:0},{x:-0.09999999999999987,y:-0.10000000000000009},{x:-0.09999999999999987,y:0.09999999999999987}],color:"primary",fill:!1},"cathode-bar":{type:"path",points:[{x:0.050000000000000044,y:0.11999999999999988},{x:0.10000000000000009,y:0.09999999999999987},{x:0.10000000000000009,y:-0.10000000000000009},{x:0.15000000000000013,y:-0.1200000000000001}],color:"primary",fill:!1},"cathode-lead":{type:"path",points:[{x:0.10000000000000009,y:0},{x:0.17500000000000004,y:0}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:0,y:0.25},bottom1:{type:"text",text:"{VAL}",x:0,y:-0.25}},refblocks:{left1:{x:-0.17499999999999982,y:0},right1:{x:0.17500000000000004,y:0}},bounds:{minX:-0.17499999999999982,maxX:0.17500000000000004,minY:-0.25,maxY:0.25,width:0.34999999999999987,height:0.5,centerX:0.00000000000000011102230246251565,centerY:0},circles:{}},p3o=Di(R2e,{kind:"diode",orientation:"down",pin1Labels:["1","pos","anode"],pin2Labels:["2","neg","cathode"]}),m3o=Di(R2e,{kind:"diode",orientation:"left",pin1Labels:["1","pos","anode"],pin2Labels:["2","neg","cathode"]}),_3o=Di(R2e,{kind:"diode",orientation:"right",pin1Labels:["1","pos","anode"],pin2Labels:["2","neg","cathode"]}),g3o=Di(R2e,{kind:"diode",orientation:"up",pin1Labels:["1","pos","anode"],pin2Labels:["2","neg","cathode"]}),Q2e={paths:{path40:{type:"path",points:[{x:0.14,y:0.04},{x:-0.12,y:-0.09}],color:"primary",fill:!1},path41:{type:"path",points:[{x:-0.12,y:0.18},{x:0.14,y:0.04}],color:"primary",fill:!1},path42:{type:"path",points:[{x:-0.12,y:-0.09},{x:-0.12,y:0.18}],color:"primary",fill:!1},path43:{type:"path",points:[{x:0.14,y:0.18},{x:0.14,y:-0.09}],color:"primary",fill:!1},path44:{type:"path",points:[{x:0.14,y:0.04},{x:-0.52,y:0.04}],color:"primary",fill:!1},"path44-0":{type:"path",points:[{x:0.52,y:0.04},{x:0.15,y:0.04}],color:"primary",fill:!1},"path43-8":{type:"path",points:[{x:0.18,y:0.18},{x:0.11,y:0.18}],color:"primary",fill:!1},"path43-8-8":{type:"path",points:[{x:0.18,y:-0.09},{x:0.11,y:-0.09}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-0.01,y:0.27},bottom1:{type:"text",text:"{VAL}",x:0,y:-0.27}},refblocks:{left1:{x:-0.52,y:0.04},right1:{x:0.52,y:0.04}},bounds:{minX:-0.55,maxX:0.55,minY:-0.27,maxY:0.27,width:1.09,height:0.55,centerX:0,centerY:0},circles:{}},{paths:A3o,texts:xfs,bounds:tfe,refblocks:Qbt,circles:f3o}=Q2e,y3o=gn({primitives:[...Object.values(A3o),...Object.values(f3o),{type:"text",text:"{REF}",x:-0.16,y:0.2294553499999995},{type:"text",text:"{VAL}",x:0.16,y:0.2294553499999995}],ports:[{...Qbt.left1,labels:["1"]},{...Qbt.right1,labels:["2"]}],size:{width:tfe.width,height:tfe.height},center:{x:tfe.centerX,y:tfe.centerY}}).changeTextAnchor("{VAL}","middle_bottom").rotateRightFacingSymbol("down").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_left").build(),{paths:x3o,texts:Cfs,bounds:nfe,refblocks:kbt,circles:C3o}=Q2e,e9t=gn({primitives:[...Object.values(x3o),...Object.values(C3o),{type:"text",text:"{REF}",x:-0.0001118,y:-0.18},{type:"text",text:"{VAL}",x:0.0001118,y:0.2738453}],ports:[{...kbt.left1,labels:["1"]},{...kbt.right1,labels:["2"]}],size:{width:nfe.width,height:nfe.height},center:{x:nfe.centerX,y:nfe.centerY}}).changeTextAnchor("{VAL}","middle_bottom").rotateRightFacingSymbol("left").labelPort("left1",["2"]).labelPort("right1",["1"]).changeTextAnchor("{REF}","middle_bottom").build(),{paths:b3o,texts:bfs,bounds:ofe,refblocks:Lbt,circles:I3o}=Q2e,v3o=gn({primitives:[...Object.values(b3o),...Object.values(I3o),{type:"text",text:"{REF}",x:-0.0050250999999996715,y:0.27384529999999985,anchor:"middle_left"},{type:"text",text:"{VAL}",x:-0.00011179999999999524,y:-0.27384530000000007,anchor:"middle_left"}],ports:[{...Lbt.left1,labels:["1"]},{...Lbt.right1,labels:["2"]}],size:{width:ofe.width,height:ofe.height},center:{x:ofe.centerX,y:ofe.centerY}}).changeTextAnchor("{VAL}","middle_top").labelPort("right1",["2"]).labelPort("left1",["1"]).changeTextAnchor("{REF}","middle_bottom").build(),{paths:Ifs,texts:vfs,bounds:Sfs,refblocks:Pfs,circles:Efs}=Q2e,DQe=Mo(e9t,"down"),NQe=DQe.primitives.find((e)=>e.type==="text"&&e.text==="{REF}"),RQe=DQe.primitives.find((e)=>e.type==="text"&&e.text==="{VAL}");NQe.anchor="middle_left";RQe.anchor="middle_left";NQe.x=0.25;NQe.y+=0.21;RQe.y-=0.21;RQe.x=0.25;S3o=DQe,Yre={paths:{path43:{type:"path",points:[{x:-0.06,y:0.19},{x:-0.06,y:-0.12}],color:"primary",fill:!1},"path43-6":{type:"path",points:[{x:0.02,y:0.13},{x:0.02,y:-0.06}],color:"primary",fill:!1},path44:{type:"path",points:[{x:-0.06,y:0.03},{x:-0.5,y:0.03}],color:"primary",fill:!1},"path44-0":{type:"path",points:[{x:0.5,y:0.03},{x:0.03,y:0.03}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-0.03,y:0.27},bottom1:{type:"text",text:"{VAL}",x:-0.03,y:-0.28}},refblocks:{left1:{x:-0.5,y:0.03},right1:{x:0.5,y:0.03}},bounds:{minX:-0.5,maxX:0.5,minY:-0.38,maxY:0.27,width:1,height:0.29,centerX:0,centerY:0.06},circles:{}},{paths:P3o,bounds:Hbt,refblocks:Fbt,circles:E3o}=Yre,M3o=gn({primitives:[...Object.values(P3o),...Object.values(E3o),{type:"text",text:"{REF}",x:-0.2,y:0.31},{type:"text",text:"{VAL}",x:0.2,y:0.31}],ports:[{...Fbt.left1,labels:["1"]},{...Fbt.right1,labels:["2"]}],center:{x:Hbt.centerX,y:Hbt.centerY}}).changeTextAnchor("{VAL}","middle_bottom").rotateRightFacingSymbol("down").changeTextAnchor("{REF}","middle_left").build(),w3o={...M3o,size:{width:1,height:0.9}};({paths:B3o,texts:zbt,bounds:rfe,refblocks:Obt,circles:T3o}=Yre),t9t=yl({primitives:[...Object.values(B3o),...Object.values(T3o),{...zbt.top1,anchor:"middle_bottom"},{...zbt.bottom1,anchor:"middle_top"}],ports:[{...Obt.left1,labels:["1"]},{...Obt.right1,labels:["2"]}],size:{width:rfe.width,height:rfe.height},center:{x:rfe.centerX,y:rfe.centerY}}),{paths:D3o,bounds:Vbt,refblocks:Ybt,circles:N3o}=Yre,R3o=gn({primitives:[...Object.values(D3o),...Object.values(N3o),{type:"text",text:"{REF}",x:0,y:-0.22},{type:"text",text:"{VAL}",x:0,y:0.28}],ports:[{...Ybt.left1,labels:["1"]},{...Ybt.right1,labels:["2"]}],center:{x:Vbt.centerX,y:Vbt.centerY}}).changeTextAnchor("{VAL}","middle_bottom").rotateRightFacingSymbol("left").changeTextAnchor("{REF}","middle_bottom").build(),Q3o={...R3o,size:{width:1,height:0.65}},{paths:k3o,bounds:Gbt,refblocks:Ubt,circles:L3o}=Yre,H3o=gn({primitives:[...Object.values(k3o),...Object.values(L3o),{type:"text",text:"{REF}",x:0,y:0.28},{type:"text",text:"{VAL}",x:0,y:-0.22}],ports:[{...Ubt.left1,labels:["1"]},{...Ubt.right1,labels:["2"]}],center:{x:Gbt.centerX,y:Gbt.centerY}}).changeTextAnchor("{VAL}","middle_top").rotateRightFacingSymbol("right").changeTextAnchor("{REF}","middle_bottom").build(),F3o={...H3o,size:{width:1,height:0.65}},{paths:z3o,bounds:Wbt,refblocks:Xbt,circles:O3o}=Yre,V3o=gn({primitives:[...Object.values(z3o),...Object.values(O3o),{type:"text",text:"{REF}",x:0.2,y:-0.25},{type:"text",text:"{VAL}",x:-0.2,y:-0.25}],ports:[{...Xbt.left1,labels:["1"]},{...Xbt.right1,labels:["2"]}],center:{x:Wbt.centerX,y:Wbt.centerY}}).changeTextAnchor("{VAL}","middle_top").rotateRightFacingSymbol("up").changeTextAnchor("{REF}","middle_left").build(),Y3o={...V3o,size:{width:1,height:0.9}},G3o=Vre(t9t,{newOrientation:"up"}),k2e={paths:{path1:{type:"path",points:[{x:-0.3,y:0},{x:-0.19998,y:0}],color:"primary",fill:!1,strokeWidth:0.012},path2:{type:"path",points:[{x:0.19998,y:0},{x:0.3,y:0}],color:"primary",fill:!1,strokeWidth:0.012},path3:{type:"path",points:[{x:-0.19998,y:0.07998},{x:0.19998,y:0.07998},{x:0.19998,y:-0.07998},{x:-0.19998,y:-0.07998},{x:-0.19998,y:0.07998}],color:"primary",fill:!1,strokeWidth:0.012}},texts:{top1:{type:"text",text:"{REF}",x:0,y:0.3,anchor:"middle_bottom"},bottom1:{type:"text",text:"{VAL}",x:0,y:-0.45,anchor:"middle_bottom"}},refblocks:{left1:{x:-0.3,y:0},right1:{x:0.3,y:0}},bounds:{minX:-0.3,maxX:0.3,minY:-0.45,maxY:0.3,width:0.6,height:0.75,centerX:0,centerY:0},circles:{}},{paths:U3o,texts:Mfs,bounds:jbt,refblocks:Kbt,circles:W3o}=k2e,X3o=gn({primitives:[...Object.values(U3o),...Object.values(W3o),{type:"text",text:"{REF}",x:-0.16,y:0.16},{type:"text",text:"{VAL}",x:0.16,y:0.16}],ports:[{...Kbt.left1,labels:["1"]},{...Kbt.right1,labels:["2"]}],center:{x:jbt.centerX,y:jbt.centerY}}).changeTextAnchor("{VAL}","middle_bottom").rotateRightFacingSymbol("down").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_left").build(),j3o={...X3o,size:{width:0.9,height:0.6}},{paths:K3o,texts:wfs,bounds:$bt,refblocks:qbt,circles:$3o}=k2e,q3o=gn({primitives:[...Object.values(K3o),...Object.values($3o),{type:"text",text:"{REF}",x:0,y:-0.16},{type:"text",text:"{VAL}",x:0,y:0.16}],ports:[{...qbt.left1,labels:["1"]},{...qbt.right1,labels:["2"]}],center:{x:$bt.centerX,y:$bt.centerY}}).changeTextAnchor("{VAL}","middle_bottom").rotateRightFacingSymbol("left").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_bottom").build(),J3o={...q3o,size:{width:0.6,height:0.65}},{paths:Z3o,texts:Bfs,bounds:Jbt,refblocks:Zbt,circles:eCo}=k2e,tCo=gn({primitives:[...Object.values(Z3o),...Object.values(eCo),{type:"text",text:"{REF}",x:0,y:0.16},{type:"text",text:"{VAL}",x:0,y:-0.16}],ports:[{...Zbt.left1,labels:["1"]},{...Zbt.right1,labels:["2"]}],center:{x:Jbt.centerX,y:Jbt.centerY}}).changeTextAnchor("{VAL}","middle_top").rotateRightFacingSymbol("right").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_bottom").build(),nCo={...tCo,size:{width:0.6,height:0.65}},L2e={paths:{"left-lead":{type:"path",points:[{x:-0.25,y:0},{x:-0.175,y:0}],color:"primary",fill:!1,strokeWidth:0.012},body:{type:"path",points:[{x:-0.175,y:0.075},{x:0.175,y:0.075},{x:0.175,y:-0.075},{x:-0.175,y:-0.075},{x:-0.175,y:0.075}],color:"primary",fill:!1,strokeWidth:0.012},"right-lead":{type:"path",points:[{x:0.175,y:0},{x:0.25,y:0}],color:"primary",fill:!1,strokeWidth:0.012}},texts:{top1:{type:"text",text:"{REF}",x:0,y:0.25,anchor:"middle_bottom"},bottom1:{type:"text",text:"{VAL}",x:0,y:-0.25,anchor:"middle_top"}},refblocks:{left1:{x:-0.25,y:0},right1:{x:0.25,y:0}},bounds:{minX:-0.25,maxX:0.25,minY:-0.25,maxY:0.25,width:0.5,height:0.5,centerX:0,centerY:0},circles:{}},oCo=Di(L2e,{kind:"boxresistor",orientation:"down"}),rCo=Di(L2e,{kind:"boxresistor",orientation:"left"}),iCo=Di(L2e,{kind:"boxresistor",orientation:"right"}),sCo=Di(L2e,{kind:"boxresistor",orientation:"up"}),H2e={paths:{path2:{type:"path",points:[{x:0.15,y:-0.01},{x:0.55,y:-0.01}],color:"primary",fill:!0},"path2-5":{type:"path",points:[{x:-0.15,y:0.06},{x:0.14,y:0.06}],color:"primary",fill:!0},"path2-5-1":{type:"path",points:[{x:0.14,y:0.06},{x:0.14,y:-0.08}],color:"primary",fill:!0},"path2-5-1-6":{type:"path",points:[{x:-0.16,y:0.06},{x:-0.16,y:-0.08}],color:"primary",fill:!0},"path2-5-4":{type:"path",points:[{x:-0.15,y:-0.08},{x:0.14,y:-0.08}],color:"primary",fill:!0},"path2-9":{type:"path",points:[{x:-0.55,y:-0.01},{x:-0.17,y:-0.01}],color:"primary",fill:!0}},texts:{top1:{type:"text",text:"{REF}",x:-0.01,y:0.17},bottom1:{type:"text",text:"{VAL}",x:0,y:-0.17}},refblocks:{left1:{x:-0.55,y:-0.01},right1:{x:0.55,y:-0.01}},bounds:{minX:-0.58,maxX:0.58,minY:-0.17,maxY:0.17,width:1.16,height:0.35,centerX:0,centerY:0},circles:{}},{paths:aCo,texts:Tfs,bounds:ife,refblocks:e6t,circles:cCo}=H2e,lCo=gn({primitives:[...Object.values(aCo),...Object.values(cCo),{type:"text",text:"{REF}",x:-0.2,y:0.1404553499999995},{type:"text",text:"{VAL}",x:0.2,y:0.1494553499999995}],ports:[{...e6t.left1,labels:["1"]},{...e6t.right1,labels:["2"]}],size:{width:ife.width,height:ife.height},center:{x:ife.centerX,y:ife.centerY}}).rotateRightFacingSymbol("down").labelPort("left",["1"]).labelPort("right",["2"]).changeTextAnchor("{REF}","middle_left").changeTextAnchor("{VAL}","middle_left").build(),{paths:hCo,texts:Dfs,bounds:sfe,refblocks:t6t,circles:dCo}=H2e,uCo=gn({primitives:[...Object.values(hCo),...Object.values(dCo),{type:"text",text:"{REF}",x:0,y:-0.2294553499999995},{type:"text",text:"{VAL}",x:0,y:0.1704553499999995}],ports:[{...t6t.left1,labels:["1"]},{...t6t.right1,labels:["2"]}],size:{width:sfe.width,height:sfe.height},center:{x:sfe.centerX,y:sfe.centerY}}).rotateRightFacingSymbol("left").labelPort("left",["1"]).labelPort("right",["2"]).changeTextAnchor("{REF}","middle_bottom").changeTextAnchor("{VAL}","middle_top").build(),{paths:pCo,texts:Nfs,bounds:afe,refblocks:n6t,circles:mCo}=H2e,_Co=gn({primitives:[...Object.values(pCo),...Object.values(mCo),{type:"text",text:"{REF}",x:0,y:0.2294553499999995},{type:"text",text:"{VAL}",x:0,y:-0.1704553499999995}],ports:[{...n6t.left1,labels:["1"]},{...n6t.right1,labels:["2"]}],size:{width:afe.width,height:afe.height},center:{x:afe.centerX,y:afe.centerY}}).rotateRightFacingSymbol("right").labelPort("left",["1"]).labelPort("right",["2"]).changeTextAnchor("{REF}","middle_bottom").changeTextAnchor("{VAL}","middle_top").build(),{paths:gCo,texts:Rfs,bounds:cfe,refblocks:o6t,circles:ACo}=H2e,fCo=gn({primitives:[...Object.values(gCo),...Object.values(ACo),{type:"text",text:"{REF}",x:0.2,y:-0.1404553499999995},{type:"text",text:"{VAL}",x:-0.2,y:-0.1494553499999995}],ports:[{...o6t.left1,labels:["1"]},{...o6t.right1,labels:["2"]}],size:{width:cfe.width,height:cfe.height},center:{x:cfe.centerX,y:cfe.centerY}}).rotateRightFacingSymbol("up").labelPort("left",["1"]).labelPort("right",["2"]).changeTextAnchor("{REF}","middle_left").changeTextAnchor("{VAL}","middle_left").build(),{paths:yCo,texts:Qfs,bounds:r6t,refblocks:i6t,circles:xCo}=k2e,CCo=gn({primitives:[...Object.values(yCo),...Object.values(xCo),{type:"text",text:"{REF}",x:0.16,y:-0.16},{type:"text",text:"{VAL}",x:-0.16,y:-0.16}],ports:[{...i6t.left1,labels:["1"]},{...i6t.right1,labels:["2"]}],center:{x:r6t.centerX,y:r6t.centerY}}).changeTextAnchor("{VAL}","middle_top").rotateRightFacingSymbol("up").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_left").build(),bCo={...CCo,size:{width:0.9,height:0.6}},F2e={paths:{"left-lead":{type:"path",points:[{x:-0.175,y:0},{x:-0.14,y:0}],color:"primary",fill:!1,strokeWidth:0.012},body:{type:"path",points:[{x:-0.14,y:0.065},{x:0.14,y:0.065},{x:0.14,y:-0.065},{x:-0.14,y:-0.065},{x:-0.14,y:0.065}],color:"primary",fill:!1,strokeWidth:0.012},"right-lead":{type:"path",points:[{x:0.14,y:0},{x:0.175,y:0}],color:"primary",fill:!1,strokeWidth:0.012}},texts:{top1:{type:"text",text:"{REF}",x:0,y:0.25,anchor:"middle_bottom"},bottom1:{type:"text",text:"{VAL}",x:0,y:-0.25,anchor:"middle_top"}},refblocks:{left1:{x:-0.175,y:0},right1:{x:0.175,y:0}},bounds:{minX:-0.175,maxX:0.175,minY:-0.25,maxY:0.25,width:0.35,height:0.5,centerX:0,centerY:0},circles:{}},ICo=Di(F2e,{kind:"boxresistor",orientation:"down"}),vCo=Di(F2e,{kind:"boxresistor",orientation:"left"}),SCo=Di(F2e,{kind:"boxresistor",orientation:"right"}),PCo=Di(F2e,{kind:"boxresistor",orientation:"up"}),QQe={paths:{"horizontal-bar":{type:"path",points:[{x:-0.4,y:0},{x:0.4,y:0}],color:"primary",fill:!1},"middle-dash-1":{type:"path",points:[{x:0,y:0.2},{x:0,y:0.07}],color:"primary",fill:!1},"middle-dash-2":{type:"path",points:[{x:0,y:0.01},{x:0,y:-0.12}],color:"primary",fill:!1},"middle-dash-3":{type:"path",points:[{x:0,y:-0.18},{x:0,y:-0.31}],color:"primary",fill:!1},"left-vertical":{type:"path",points:[{x:-0.25,y:0},{x:-0.25,y:-0.2}],color:"primary",fill:!1},"right-vertical":{type:"path",points:[{x:0.25,y:0},{x:0.25,y:-0.2}],color:"primary",fill:!1},"left-ground":{type:"path",points:[{x:-0.3,y:-0.2},{x:-0.25,y:-0.3},{x:-0.2,y:-0.2},{x:-0.3,y:-0.2}],color:"primary",fill:!1},"right-ground":{type:"path",points:[{x:0.2,y:-0.2},{x:0.25,y:-0.3},{x:0.3,y:-0.2},{x:0.2,y:-0.2}],color:"primary",fill:!1}},refblocks:{left1:{x:-0.4,y:0},right1:{x:0.4,y:0}},texts:{ref:{type:"text",text:"{REF}",x:0,y:0.35}},bounds:{minX:-0.4,maxX:0.4,minY:-0.4,maxY:0.35,width:0.8,height:0.75,centerX:0,centerY:-0.02},circles:{}},{paths:ECo,texts:kfs,bounds:s6t,refblocks:a6t,circles:MCo}=QQe,wCo=gn({primitives:[...Object.values(ECo),...Object.values(MCo),{type:"text",text:"{REF}",x:0,y:0.2594553499999995}],ports:[{...a6t.left1,labels:["1"]},{...a6t.right1,labels:["2"]}],center:{x:s6t.centerX,y:s6t.centerY}}).changeTextAnchor("{VAL}","middle_bottom").rotateRightFacingSymbol("down").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_left").build(),{paths:BCo,texts:Lfs,bounds:c6t,refblocks:l6t,circles:TCo}=QQe,n9t=gn({primitives:[...Object.values(BCo),...Object.values(TCo),{type:"text",text:"{REF}",x:0,y:0.2594553499999995}],ports:[{...l6t.left1,labels:["1"]},{...l6t.right1,labels:["2"]}],center:{x:c6t.centerX,y:c6t.centerY}}).rotateRightFacingSymbol("right").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_bottom").build(),DCo=wI(n9t),{paths:NCo,texts:Hfs,bounds:h6t,refblocks:d6t,circles:RCo}=QQe,QCo=gn({primitives:[...Object.values(NCo),...Object.values(RCo),{type:"text",text:"{REF}",x:0,y:0.2594553499999995}],ports:[{...d6t.left1,labels:["1"]},{...d6t.right1,labels:["2"]}],center:{x:h6t.centerX,y:h6t.centerY}}).rotateRightFacingSymbol("up").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_right").build(),z2e={paths:{path27:{type:"path",points:[{x:0.3,y:0},{x:0.06,y:0}],color:"primary",fill:!1,strokeWidth:0.012},path28:{type:"path",points:[{x:-0.06,y:0},{x:-0.3,y:0}],color:"primary",fill:!1,strokeWidth:0.012},path29:{type:"path",points:[{x:0.06,y:0.16002},{x:0.06,y:-0.16002}],color:"primary",fill:!1,strokeWidth:0.012},path30:{type:"path",points:[{x:-0.06,y:0.16002},{x:-0.06,y:-0.16002}],color:"primary",fill:!1,strokeWidth:0.012}},texts:{top1:{type:"text",text:"{REF}",x:0,y:0.24,anchor:"middle_bottom"},bottom1:{type:"text",text:"{VAL}",x:0,y:-0.24,anchor:"middle_top"}},refblocks:{left1:{x:-0.3,y:0},right1:{x:0.3,y:0}},bounds:{minX:-0.3,maxX:0.3,minY:-0.24,maxY:0.24,width:0.6,height:0.48,centerX:0,centerY:0},circles:{}},{paths:kCo,texts:Ffs,bounds:lfe,refblocks:u6t,circles:LCo}=z2e,HCo=gn({primitives:[...Object.values(kCo),...Object.values(LCo),{type:"text",text:"{REF}",x:-0.2,y:0.115},{type:"text",text:"{VAL}",x:0.2,y:0.115}],ports:[{...u6t.left1,labels:["1"]},{...u6t.right1,labels:["2"]}],size:{width:lfe.width,height:lfe.height},center:{x:lfe.centerX,y:lfe.centerY}}).changeTextAnchor("{VAL}","top_left").rotateRightFacingSymbol("down").labelPort("left1",["1","pos"]).labelPort("right1",["2","neg"]).changeTextAnchor("{REF}","bottom_left").build(),FCo={...HCo,size:{width:0.9,height:0.6}},zCo=gn(z2e).changeTextAnchor("{VAL}","middle_top").rotateRightFacingSymbol("right").labelPort("left1",["2","neg"]).labelPort("right1",["1","pos"]).changeTextAnchor("{REF}","middle_bottom").build(),OCo={...zCo,size:{width:0.6,height:0.65}},O2e={paths:{path27:{type:"path",points:[{x:0.3,y:0},{x:0.000657,y:0}],color:"primary",fill:!1,strokeWidth:0.012},path28:{type:"path",points:[{x:-0.038683,y:0},{x:-0.3,y:0}],color:"primary",fill:!1,strokeWidth:0.012},path30:{type:"path",points:[{x:-0.074255,y:0.16002},{x:-0.074255,y:0.16002},{x:-0.069544,y:0.149352},{x:-0.065126,y:0.138684},{x:-0.061005,y:0.128016},{x:-0.057182,y:0.117348},{x:-0.053663,y:0.10668},{x:-0.05045,y:0.096012},{x:-0.047547,y:0.085344},{x:-0.044957,y:0.074676},{x:-0.042684,y:0.064008},{x:-0.040732,y:0.05334},{x:-0.039103,y:0.042672},{x:-0.037801,y:0.032004},{x:-0.03683,y:0.021336},{x:-0.036193,y:0.010668},{x:-0.035893,y:0},{x:-0.036193,y:-0.010668},{x:-0.03683,y:-0.021336},{x:-0.037801,y:-0.032004},{x:-0.039103,y:-0.042672},{x:-0.040732,y:-0.05334},{x:-0.042684,y:-0.064008},{x:-0.044957,y:-0.074676},{x:-0.047547,y:-0.085344},{x:-0.05045,y:-0.096012},{x:-0.053663,y:-0.10668},{x:-0.057182,y:-0.117348},{x:-0.061005,y:-0.128016},{x:-0.065126,y:-0.138684},{x:-0.069544,y:-0.149352},{x:-0.074255,y:-0.16002},{x:-0.074255,y:-0.16002}],color:"primary",fill:!1,strokeWidth:0.012},"path30-7":{type:"path",points:[{x:-0.000385,y:0.16002},{x:-0.000385,y:-0.16002}],color:"primary",fill:!1,strokeWidth:0.012},"path30-9-2":{type:"path",points:[{x:0.156026,y:0.2},{x:0.085846,y:0.2}],color:"primary",fill:!1,strokeWidth:0.012},"path30-9-2-9":{type:"path",points:[{x:0.120936,y:0.16491},{x:0.120936,y:0.23509}],color:"primary",fill:!1,strokeWidth:0.012}},texts:{top1:{type:"text",text:"{REF}",x:0,y:0.42,anchor:"middle_bottom"},bottom1:{type:"text",text:"{VAL}",x:0,y:-0.42,anchor:"middle_top"}},refblocks:{left1:{x:-0.3,y:0},right1:{x:0.3,y:0}},bounds:{minX:-0.3,maxX:0.3,minY:-0.55,maxY:0.55,width:0.6,height:1.1,centerX:0,centerY:0},circles:{"viewbox-padding-min":{type:"circle",x:-0.3,y:-0.55,radius:0,fill:!1,color:"transparent"},"viewbox-padding-max":{type:"circle",x:0.3,y:0.55,radius:0,fill:!1,color:"transparent"}}},VCo=gn(O2e).rotateRightFacingSymbol("up").labelPort("left1",["2","neg"]).labelPort("right1",["1","pos"]).changeTextAnchor("{REF}","middle_left",{x:0.7,y:0.3}).changeTextAnchor("{VAL}","middle_left",{x:-0.12,y:-0.3}).build(),YCo=gn(O2e).rotateRightFacingSymbol("right").labelPort("left1",["2","neg"]).labelPort("right1",["1","pos"]).changeTextAnchor("{REF}","middle_bottom").changeTextAnchor("{VAL}","middle_top").build(),GCo=gn(O2e).rotateRightFacingSymbol("left").labelPort("left1",["2","neg"]).labelPort("right1",["1","pos"]).changeTextAnchor("{REF}","middle_bottom",{x:0,y:0.78}).changeTextAnchor("{VAL}","middle_top",{x:0,y:-0.78}).build(),UCo=gn(O2e).rotateRightFacingSymbol("down").labelPort("left1",["2","neg"]).labelPort("right1",["1","pos"]).changeTextAnchor("{REF}","middle_left",{x:-0.12,y:0.3}).changeTextAnchor("{VAL}","middle_left",{x:0.72,y:-0.3}).build(),WCo=gn(z2e).rotateRightFacingSymbol("right").changeTextAnchor("{VAL}","middle_top").labelPort("left1",["1","pos"]).labelPort("right1",["2","neg"]).changeTextAnchor("{REF}","middle_bottom").build(),XCo={...WCo,size:{width:0.6,height:0.65}},V2e={paths:{"left-lead":{type:"path",points:[{x:-0.25,y:0},{x:-0.06,y:0}],color:"primary",fill:!1,strokeWidth:0.012},"left-plate":{type:"path",points:[{x:-0.06,y:0.16},{x:-0.06,y:-0.16}],color:"primary",fill:!1,strokeWidth:0.012},"right-plate":{type:"path",points:[{x:0.06,y:0.16},{x:0.06,y:-0.16}],color:"primary",fill:!1,strokeWidth:0.012},"right-lead":{type:"path",points:[{x:0.06,y:0},{x:0.25,y:0}],color:"primary",fill:!1,strokeWidth:0.012}},texts:{top1:{type:"text",text:"{REF}",x:0,y:0.25,anchor:"middle_bottom"},bottom1:{type:"text",text:"{VAL}",x:0,y:-0.25,anchor:"middle_top"}},refblocks:{left1:{x:-0.25,y:0},right1:{x:0.25,y:0}},bounds:{minX:-0.25,maxX:0.25,minY:-0.25,maxY:0.25,width:0.5,height:0.5,centerX:0,centerY:0},circles:{}},jCo=Di(V2e,{kind:"capacitor",orientation:"down",pin1Labels:["1","pos"],pin2Labels:["2","neg"]}),KCo=Di(V2e,{kind:"capacitor",orientation:"left",pin1Labels:["1","pos"],pin2Labels:["2","neg"]}),$Co=Di(V2e,{kind:"capacitor",orientation:"right",pin1Labels:["1","pos"],pin2Labels:["2","neg"]}),qCo=Di(V2e,{kind:"capacitor",orientation:"up",pin1Labels:["1","pos"],pin2Labels:["2","neg"]}),{paths:JCo,texts:zfs,bounds:hfe,refblocks:p6t,circles:ZCo}=z2e,ebo=gn({primitives:[...Object.values(JCo),...Object.values(ZCo),{type:"text",text:"{REF}",x:0.2,y:-0.095},{type:"text",text:"{VAL}",x:-0.2,y:-0.095}],ports:[{...p6t.left1,labels:["1"]},{...p6t.right1,labels:["2"]}],size:{width:hfe.width,height:hfe.height},center:{x:hfe.centerX,y:hfe.centerY}}).changeTextAnchor("{VAL}","top_left").rotateRightFacingSymbol("up").labelPort("left1",["1","pos"]).labelPort("right1",["2","neg"]).changeTextAnchor("{REF}","bottom_left").build(),tbo={...ebo,size:{width:0.9,height:0.6}},Y2e={paths:{"left-lead":{type:"path",points:[{x:-0.175,y:0},{x:-0.05,y:0}],color:"primary",fill:!1,strokeWidth:0.012},"left-plate":{type:"path",points:[{x:-0.05,y:0.14},{x:-0.05,y:-0.14}],color:"primary",fill:!1,strokeWidth:0.012},"right-plate":{type:"path",points:[{x:0.05,y:0.14},{x:0.05,y:-0.14}],color:"primary",fill:!1,strokeWidth:0.012},"right-lead":{type:"path",points:[{x:0.05,y:0},{x:0.175,y:0}],color:"primary",fill:!1,strokeWidth:0.012}},texts:{top1:{type:"text",text:"{REF}",x:0,y:0.25,anchor:"middle_bottom"},bottom1:{type:"text",text:"{VAL}",x:0,y:-0.25,anchor:"middle_top"}},refblocks:{left1:{x:-0.175,y:0},right1:{x:0.175,y:0}},bounds:{minX:-0.175,maxX:0.175,minY:-0.25,maxY:0.25,width:0.35,height:0.5,centerX:0,centerY:0},circles:{}},nbo=Di(Y2e,{kind:"capacitor",orientation:"down",pin1Labels:["1","pos"],pin2Labels:["2","neg"]}),obo=Di(Y2e,{kind:"capacitor",orientation:"left",pin1Labels:["1","pos"],pin2Labels:["2","neg"]}),rbo=Di(Y2e,{kind:"capacitor",orientation:"right",pin1Labels:["1","pos"],pin2Labels:["2","neg"]}),ibo=Di(Y2e,{kind:"capacitor",orientation:"up",pin1Labels:["1","pos"],pin2Labels:["2","neg"]}),jX={paths:{path11:{type:"path",points:[{x:-0.54,y:0.03},{x:-0.3,y:0.03}],color:"primary",fill:!1},path12:{type:"path",points:[{x:0.29,y:0.03},{x:0.54,y:0.03}],color:"primary",fill:!1},path2:{type:"path",points:[{x:0.29,y:0.29},{x:0.29,y:-0.23}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-0.02,y:0.37},bottom1:{type:"text",text:"{VAL}",x:-0.01,y:-0.37}},refblocks:{left1:{x:-0.54,y:0.03},right1:{x:0.54,y:0.03}},bounds:{minX:-0.57,maxX:0.57,minY:-0.37,maxY:0.37,width:1.14,height:0.74,centerX:0,centerY:0},circles:{path1:{type:"circle",x:0,y:0.04,radius:0.29,color:"primary",fill:!1}}},{paths:sbo,texts:Ofs,bounds:dfe,refblocks:m6t,circles:abo}=jX,cbo=gn({primitives:[...Object.values(sbo),...Object.values(abo),{type:"text",text:"{REF}",x:-0.15,y:0.3894553499999995},{type:"text",text:"{VAL}",x:0.15,y:0.3894553499999995}],ports:[{...m6t.left1,labels:["1"]},{...m6t.right1,labels:["2"]}],size:{width:dfe.width,height:dfe.height},center:{x:dfe.centerX,y:dfe.centerY}}).rotateRightFacingSymbol("down").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_left").changeTextAnchor("{VAL}","middle_left").build(),lbo=gn(jX).changeTextAnchor("{VAL}","middle_top").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_bottom").build(),{paths:hbo,texts:Vfs,bounds:ufe,refblocks:_6t,circles:dbo}=jX,ubo=gn({primitives:[...Object.values(hbo),...Object.values(dbo),{type:"text",text:"{REF}",x:-0,y:-0.2894553499999995},{type:"text",text:"{VAL}",x:0,y:0.3894553499999995}],ports:[{..._6t.left1,labels:["1"]},{..._6t.right1,labels:["2"]}],size:{width:ufe.width,height:ufe.height},center:{x:ufe.centerX,y:ufe.centerY}}).changeTextAnchor("{VAL}","middle_bottom").rotateRightFacingSymbol("left").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_bottom").build(),pbo=gn(jX).changeTextAnchor("{VAL}","middle_top").labelPort("left1",["1","neg"]).labelPort("right1",["2","pos"]).changeTextAnchor("{REF}","middle_bottom").build(),{paths:mbo,texts:Yfs,bounds:pfe,refblocks:g6t,circles:_bo}=jX,gbo=gn({primitives:[...Object.values(mbo),...Object.values(_bo),{type:"text",text:"{REF}",x:0.15,y:-0.2894553499999995},{type:"text",text:"{VAL}",x:-0.15,y:-0.2894553499999995}],ports:[{...g6t.left1,labels:["1"]},{...g6t.right1,labels:["2"]}],size:{width:pfe.width,height:pfe.height},center:{x:pfe.centerX,y:pfe.centerY}}).rotateRightFacingSymbol("up").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_left").changeTextAnchor("{VAL}","middle_left").build(),{paths:Abo,texts:Gfs,bounds:mfe,refblocks:A6t,circles:fbo}=jX,ybo=gn({primitives:[...Object.values(Abo),...Object.values(fbo),{type:"text",text:"{REF}",x:0.15,y:-0.2894553499999995},{type:"text",text:"{VAL}",x:-0.15,y:-0.2894553499999995}],ports:[{...A6t.left1,labels:["1"]},{...A6t.right1,labels:["2"]}],size:{width:mfe.width,height:mfe.height},center:{x:mfe.centerX,y:mfe.centerY}}).rotateRightFacingSymbol("up").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_left").changeTextAnchor("{VAL}","middle_left").build(),G2e={paths:{path27:{type:"path",points:[{x:0.54,y:-0.01},{x:0.13,y:-0.01}],color:"primary",fill:!1},path29:{type:"path",points:[{x:0.13,y:0.25},{x:0.13,y:-0.27}],color:"primary",fill:!1},"path29-2":{type:"path",points:[{x:0.07,y:0.25},{x:0.07,y:-0.28}],color:"primary",fill:!1},path30:{type:"path",points:[{x:-0.14,y:0.25},{x:-0.14,y:-0.27}],color:"primary",fill:!1},"path29-5":{type:"path",points:[{x:-0.08,y:0.26},{x:-0.08,y:-0.27}],color:"primary",fill:!1},"path29-2-7":{type:"path",points:[{x:0.07,y:0.26},{x:-0.08,y:0.26}],color:"primary",fill:!1},"path29-2-7-6":{type:"path",points:[{x:0.07,y:-0.28},{x:-0.08,y:-0.28}],color:"primary",fill:!1},path43:{type:"path",points:[{x:-0.21,y:0.32},{x:0.2,y:0.32}],color:"primary",fill:!1},"path44-0":{type:"path",points:[{x:0,y:0.71},{x:0,y:0.33},{x:0,y:0.32}],color:"primary",fill:!1},"path43-8":{type:"path",points:[{x:-0.21,y:0.32},{x:-0.21,y:0.25}],color:"primary",fill:!1},"path43-8-8":{type:"path",points:[{x:0.2,y:0.32},{x:0.2,y:0.25}],color:"primary",fill:!1},"path43-9":{type:"path",points:[{x:0.19,y:-0.35},{x:-0.22,y:-0.35}],color:"primary",fill:!1},"path44-0-5":{type:"path",points:[{x:-0.02,y:-0.71},{x:-0.02,y:-0.36},{x:-0.02,y:-0.35}],color:"primary",fill:!1},"path43-8-1":{type:"path",points:[{x:0.19,y:-0.35},{x:0.19,y:-0.28}],color:"primary",fill:!1},"path43-8-8-9":{type:"path",points:[{x:-0.22,y:-0.35},{x:-0.22,y:-0.28}],color:"primary",fill:!1},path28:{type:"path",points:[{x:-0.14,y:-0.01},{x:-0.54,y:-0.01}],color:"primary",fill:!1}},texts:{left1:{type:"text",text:"{REF}",x:0.53,y:0.28},right1:{type:"text",text:"{VAL}",x:0.54,y:-0.28}},refblocks:{top1:{x:0,y:0.71},bottom1:{x:-0.02,y:-0.71},left1:{x:-0.54,y:-0.01},right1:{x:0.54,y:-0.01}},bounds:{minX:-0.57,maxX:0.57,minY:-0.74,maxY:0.74,width:1.14,height:1.48,centerX:0,centerY:0},circles:{}},{paths:xbo,texts:Ufs,bounds:_fe,refblocks:gfe,circles:Cbo}=G2e,bbo=gn({primitives:[...Object.values(xbo),...Object.values(Cbo),{type:"text",text:"{REF}",x:-0.4,y:0.4094554499999995},{type:"text",text:"{VAL}",x:0.4,y:0.4094553499999995}],ports:[{...gfe.left1,labels:["1"]},{...gfe.right1,labels:["3"]},{...gfe.bottom1,labels:["2"]},{...gfe.top1,labels:["4"]}],size:{width:_fe.width,height:_fe.height},center:{x:_fe.centerX,y:_fe.centerY}}).rotateRightFacingSymbol("down").changeTextAnchor("{REF}","bottom_left").changeTextAnchor("{VAL}","top_left").build(),Ibo=gn(G2e).labelPort("top1",["2","gnd1"]).labelPort("bottom1",["4","gnd2"]).labelPort("left1",["3"]).labelPort("right1",["1"]).changeTextAnchor("{REF}","bottom_left").changeTextAnchor("{VAL}","top_left").build(),vbo=gn(G2e).labelPort("top1",["4","gnd1"]).labelPort("bottom1",["2","gnd2"]).labelPort("left1",["1"]).labelPort("right1",["3"]).changeTextAnchor("{REF}","bottom_left").changeTextAnchor("{VAL}","top_left").build(),{paths:Sbo,texts:Wfs,bounds:Afe,refblocks:ffe,circles:Pbo}=G2e,Ebo=gn({primitives:[...Object.values(Sbo),...Object.values(Pbo),{type:"text",text:"{VAL}",x:-0.4,y:-0.4094554499999995},{type:"text",text:"{REF}",x:0.4,y:-0.4094553499999995}],ports:[{...ffe.left1,labels:["1"]},{...ffe.right1,labels:["3"]},{...ffe.bottom1,labels:["2"]},{...ffe.top1,labels:["4"]}],size:{width:Afe.width,height:Afe.height},center:{x:Afe.centerX,y:Afe.centerY}}).rotateRightFacingSymbol("up").changeTextAnchor("{REF}","bottom_left").changeTextAnchor("{VAL}","top_left").build(),U2e={paths:{path27:{type:"path",points:[{x:0.55,y:-0.01},{x:0.13,y:-0.01}],color:"primary",fill:!1},path28:{type:"path",points:[{x:-0.14,y:-0.01},{x:-0.55,y:-0.01}],color:"primary",fill:!1},path29:{type:"path",points:[{x:0.13,y:-0.28},{x:0.13,y:0.25}],color:"primary",fill:!1},"path29-2":{type:"path",points:[{x:0.07,y:-0.28},{x:0.07,y:0.25}],color:"primary",fill:!1},path30:{type:"path",points:[{x:-0.14,y:-0.28},{x:-0.14,y:0.25}],color:"primary",fill:!1},"path29-5":{type:"path",points:[{x:-0.08,y:-0.28},{x:-0.08,y:0.25}],color:"primary",fill:!1},"path29-2-7":{type:"path",points:[{x:0.07,y:-0.28},{x:-0.08,y:-0.28}],color:"primary",fill:!1},"path29-2-7-6":{type:"path",points:[{x:0.07,y:0.26},{x:-0.08,y:0.26}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{VAL}",x:-0.01,y:-0.42},bottom1:{type:"text",text:"{REF}",x:0,y:0.43}},refblocks:{left1:{x:-0.55,y:-0.01},right1:{x:0.55,y:-0.01}},bounds:{minX:-0.58,maxX:0.58,minY:-0.52,maxY:0.43,width:1.16,height:1,centerX:0,centerY:-0.04},circles:{}},{paths:Mbo,texts:Xfs,bounds:yfe,refblocks:f6t,circles:wbo}=U2e,Bbo=gn({primitives:[...Object.values(Mbo),...Object.values(wbo),{type:"text",text:"{REF}",x:-0.3,y:0.3094553499999995},{type:"text",text:"{VAL}",x:0.3,y:0.3094553499999995}],ports:[{...f6t.left1,labels:["1"]},{...f6t.right1,labels:["2"]}],size:{width:yfe.width,height:yfe.height},center:{x:yfe.centerX,y:yfe.centerY}}).changeTextAnchor("{VAL}","top_left").rotateRightFacingSymbol("down").labelPort("left1",["1","pos"]).labelPort("right1",["2","neg"]).changeTextAnchor("{REF}","bottom_left").build(),Tbo=gn(U2e).changeTextAnchor("{VAL}","middle_top").rotateRightFacingSymbol("right").labelPort("left1",["2","neg"]).labelPort("right1",["1","pos"]).changeTextAnchor("{REF}","middle_bottom").build(),Dbo=gn(U2e).changeTextAnchor("{VAL}","middle_top").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_bottom").build(),{paths:Nbo,texts:jfs,bounds:xfe,refblocks:y6t,circles:Rbo}=U2e,Qbo=gn({primitives:[...Object.values(Nbo),...Object.values(Rbo),{type:"text",text:"{REF}",x:0.3,y:-0.3094553499999995},{type:"text",text:"{VAL}",x:-0.3,y:-0.3094553499999995}],ports:[{...y6t.left1,labels:["1"]},{...y6t.right1,labels:["2"]}],size:{width:xfe.width,height:xfe.height},center:{x:xfe.centerX,y:xfe.centerY}}).changeTextAnchor("{VAL}","middle_top").rotateRightFacingSymbol("up").labelPort("left1",["1","pos"]).labelPort("right1",["2","neg"]).changeTextAnchor("{REF}","bottom_left").build(),kbo=[{type:"path",points:[{x:-Lre,y:0},{x:-tQe,y:0}],color:"primary",fill:!1},{type:"path",points:[{x:tQe,y:0},{x:Lre,y:0}],color:"primary",fill:!1},{type:"circle",x:0,y:0,radius:tQe,color:"primary",fill:!1},{type:"path",points:[{x:-0.1,y:0},{x:0.15,y:0}],color:"primary",fill:!1},{type:"path",points:[{x:0.15,y:0},{x:0.05,y:0.08}],color:"primary",fill:!1},{type:"path",points:[{x:0.15,y:0},{x:0.05,y:-0.08}],color:"primary",fill:!1}],Lbo=gn({primitives:[...kbo,{type:"text",text:"{REF}",x:-0.2,y:0.35},{type:"text",text:"{VAL}",x:0.2,y:0.35}],ports:[{x:-Lre,y:0,labels:["1"]},{x:Lre,y:0,labels:["2"]}],center:{x:0,y:0},size:{width:Lre*2,height:0.9}}).rotateRightFacingSymbol("down").changeTextAnchor("{REF}","middle_left").changeTextAnchor("{VAL}","middle_left").build(),Hbo=[{type:"path",points:[{x:-Hre,y:0},{x:-nQe,y:0}],color:"primary",fill:!1},{type:"path",points:[{x:nQe,y:0},{x:Hre,y:0}],color:"primary",fill:!1},{type:"circle",x:0,y:0,radius:nQe,color:"primary",fill:!1},{type:"path",points:[{x:-0.1,y:0},{x:0.15,y:0}],color:"primary",fill:!1},{type:"path",points:[{x:0.15,y:0},{x:0.05,y:0.08}],color:"primary",fill:!1},{type:"path",points:[{x:0.15,y:0},{x:0.05,y:-0.08}],color:"primary",fill:!1}],Fbo=gn({primitives:[...Hbo,{type:"text",text:"{REF}",x:0,y:-0.4},{type:"text",text:"{VAL}",x:0,y:0.4}],ports:[{x:-Hre,y:0,labels:["1"]},{x:Hre,y:0,labels:["2"]}],center:{x:0,y:0},size:{width:Hre*2,height:0.9}}).rotateRightFacingSymbol("left").changeTextAnchor("{REF}","middle_bottom").changeTextAnchor("{VAL}","middle_top").build(),zbo=[{type:"path",points:[{x:-Fre,y:0},{x:-oQe,y:0}],color:"primary",fill:!1},{type:"path",points:[{x:oQe,y:0},{x:Fre,y:0}],color:"primary",fill:!1},{type:"circle",x:0,y:0,radius:oQe,color:"primary",fill:!1},{type:"path",points:[{x:-0.1,y:0},{x:0.15,y:0}],color:"primary",fill:!1},{type:"path",points:[{x:0.15,y:0},{x:0.05,y:0.08}],color:"primary",fill:!1},{type:"path",points:[{x:0.15,y:0},{x:0.05,y:-0.08}],color:"primary",fill:!1}],Obo=gn({primitives:[...zbo,{type:"text",text:"{REF}",x:0,y:0.4},{type:"text",text:"{VAL}",x:0,y:-0.4}],ports:[{x:-Fre,y:0,labels:["1"]},{x:Fre,y:0,labels:["2"]}],center:{x:0,y:0},size:{width:Fre*2,height:0.9}}).changeTextAnchor("{REF}","middle_bottom").changeTextAnchor("{VAL}","middle_top").build(),Vbo=[{type:"path",points:[{x:-zre,y:0},{x:-rQe,y:0}],color:"primary",fill:!1},{type:"path",points:[{x:rQe,y:0},{x:zre,y:0}],color:"primary",fill:!1},{type:"circle",x:0,y:0,radius:rQe,color:"primary",fill:!1},{type:"path",points:[{x:-0.1,y:0},{x:0.15,y:0}],color:"primary",fill:!1},{type:"path",points:[{x:0.15,y:0},{x:0.05,y:0.08}],color:"primary",fill:!1},{type:"path",points:[{x:0.15,y:0},{x:0.05,y:-0.08}],color:"primary",fill:!1}],Ybo=gn({primitives:[...Vbo,{type:"text",text:"{REF}",x:0.2,y:-0.35},{type:"text",text:"{VAL}",x:-0.2,y:-0.35}],ports:[{x:-zre,y:0,labels:["1"]},{x:zre,y:0,labels:["2"]}],center:{x:0,y:0},size:{width:zre*2,height:0.9}}).rotateRightFacingSymbol("up").changeTextAnchor("{REF}","middle_left").changeTextAnchor("{VAL}","middle_left").build(),KX={paths:{path11:{type:"path",points:[{x:1.99,y:-1.64},{x:2.1,y:-1.64}],color:"primary",fill:!1},"path40-0":{type:"path",points:[{x:2.1,y:-1.48},{x:2.1,y:-1.8}],color:"primary",fill:!1},"path40-0-5":{type:"path",points:[{x:2.22,y:-1.5},{x:2.11,y:-1.58}],color:"primary",fill:!1},"path40-0-5-0":{type:"path",points:[{x:2.23,y:-1.78},{x:2.11,y:-1.7}],color:"primary",fill:!1},"path12-1-5":{type:"path",points:[{x:2.23,y:-1.49},{x:2.23,y:-1.14}],color:"primary",fill:!1},"path12-1-5-3":{type:"path",points:[{x:2.23,y:-1.97},{x:2.23,y:-1.79}],color:"primary",fill:!1},"arrow-2":{type:"path",points:[{x:2.17,y:-1.7},{x:2.13,y:-1.76},{x:2.19,y:-1.76},{x:2.17,y:-1.7}],color:"primary",fill:!0},path1:{type:"path",points:[{x:1.6,y:-1.5},{x:1.86,y:-1.5}],color:"primary",fill:!1},path2:{type:"path",points:[{x:1.87,y:-1.34},{x:1.87,y:-1.66}],color:"primary",fill:!1},path3:{type:"path",points:[{x:1.99,y:-1.36},{x:1.87,y:-1.44}],color:"primary",fill:!1},path4:{type:"path",points:[{x:1.99,y:-1.64},{x:1.88,y:-1.56}],color:"primary",fill:!1},"arrow-1":{type:"path",points:[{x:1.94,y:-1.56},{x:1.89,y:-1.62},{x:1.96,y:-1.62},{x:1.94,y:-1.56}],color:"primary",fill:!0},path9:{type:"path",points:[{x:1.99,y:-1.35},{x:2.23,y:-1.36}],color:"primary",fill:!1}},texts:{bottom1:{type:"text",text:"{VAL}",x:1.88,y:-1.94},right1:{type:"text",text:"{REF}",x:1.88,y:-1.14}},refblocks:{right1:{x:2.23,y:-1.97},right2:{x:1.6,y:-1.5},right3:{x:2.23,y:-1.14}},bounds:{minX:1.58,maxX:2.35,minY:-1.98,maxY:-1.12,width:0.77,height:0.86,centerX:1.96,centerY:-1.55},circles:{"path1-0":{type:"circle",x:2.05,y:-1.54,radius:0.3,color:"primary",fill:!1}}},Gbo=gn(KX).rotateRightFacingSymbol("down").labelPort("right2",["1"]).labelPort("right1",["2"]).labelPort("right3",["3"]).changeTextAnchor("{VAL}","middle_left",{x:0.8,y:-0.15}).changeTextAnchor("{REF}","middle_left",{x:0,y:0.15}).build(),Ubo=gn(KX).rotateRightFacingSymbol("right").labelPort("right2",["1"]).labelPort("right1",["2"]).labelPort("right3",["3"]).changeTextAnchor("{VAL}","middle_right").changeTextAnchor("{REF}","middle_right").build(),Wbo=gn(KX).rotateRightFacingSymbol("left").labelPort("right2",["1"]).labelPort("right1",["2"]).labelPort("right3",["3"]).changeTextAnchor("{VAL}","middle_left",{x:0,y:-0.8}).changeTextAnchor("{REF}","middle_left",{x:0,y:0.8}).build(),Xbo=gn(KX).rotateRightFacingSymbol("right").labelPort("right2",["1"]).labelPort("right1",["2"]).labelPort("right3",["3"]).changeTextAnchor("{VAL}","middle_right").changeTextAnchor("{REF}","middle_right").build(),jbo=gn(KX).rotateRightFacingSymbol("up").labelPort("right2",["1"]).labelPort("right1",["2"]).labelPort("right3",["3"]).changeTextAnchor("{VAL}","middle_left",{x:0,y:-0.15}).changeTextAnchor("{REF}","middle_left",{x:0.8,y:0.15}).build(),Kbo=gn(KX).rotateRightFacingSymbol("up").labelPort("right2",["1"]).labelPort("right1",["2"]).labelPort("right3",["3"]).changeTextAnchor("{VAL}","middle_left",{x:0,y:-0.15}).changeTextAnchor("{REF}","middle_left",{x:0.8,y:0.15}).build(),$bo={paths:{path11:{type:"path",points:[{x:-0.54,y:0},{x:-0.3,y:0}],color:"primary",fill:!1},path12:{type:"path",points:[{x:0.29,y:0},{x:0.54,y:0}],color:"primary",fill:!1},path2:{type:"path",points:[{x:-0.12,y:0.09},{x:0.12,y:0.09}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-0.18,y:-0.45},bottom1:{type:"text",text:"{VAL}",x:-0.01,y:0.35},left1:{type:"text",text:"A",x:0,y:-0.1}},refblocks:{left1:{x:-0.54,y:0},right1:{x:0.54,y:0}},bounds:{minX:-0.53,maxX:0.53,minY:-0.09,maxY:0.09,width:1.06,height:1,centerX:0,centerY:0},circles:{path1:{type:"circle",x:0,y:0,radius:0.29,color:"primary",fill:!1}}},{paths:x6t,bounds:Cfe,refblocks:C6t,circles:qbo}=$bo,Gre=yl({primitives:[x6t.path11,x6t.path12,{type:"path",points:[{x:-0.12,y:0.14},{x:0.12,y:0.14}],color:"primary",fill:!1},...Object.values(qbo),{type:"text",text:"{REF}",x:0,y:0.3594553499999995,anchor:"middle_bottom"},{type:"text",text:"{VAL}",x:0,y:-0.35,anchor:"middle_top"},{type:"path",points:[{x:-0.095,y:-0.16},{x:0,y:0.09}],color:"primary",fill:!1},{type:"path",points:[{x:0,y:0.09},{x:0.095,y:-0.16}],color:"primary",fill:!1},{type:"path",points:[{x:-0.048,y:-0.045},{x:0.048,y:-0.045}],color:"primary",fill:!1}],ports:[{...C6t.left1,labels:["1"]},{...C6t.right1,labels:["2"]}],size:{width:Cfe.width,height:Cfe.height},center:{x:Cfe.centerX,y:Cfe.centerY}}),EQe=structuredClone(Gre);EQe.primitives=EQe.primitives.map((e)=>e.type!=="text"?e:e.text==="{REF}"?{...e,x:-0.16,y:0.3594553499999995,anchor:"middle_bottom"}:e.text==="{VAL}"?{...e,x:0.16,y:0.35,anchor:"middle_bottom"}:e);b6t=Vre(EQe,{newOrientation:"down"}),Jbo=wI(Gre),Zbo=Gre,MQe=structuredClone(Gre);MQe.primitives=MQe.primitives.map((e)=>e.type!=="text"?e:e.text==="{REF}"?{...e,x:0.16,y:-0.3594553499999995,anchor:"middle_top"}:e.text==="{VAL}"?{...e,x:-0.16,y:-0.35,anchor:"middle_top"}:e);e6o=Vre(MQe,{newOrientation:"up"}),$X={paths:{path11:{type:"path",points:[{x:-0.54,y:0.03},{x:-0.3,y:0.04}],color:"primary",fill:!1},path12:{type:"path",points:[{x:0.29,y:0.04},{x:0.54,y:0.04}],color:"primary",fill:!1},"path11-5-5":{type:"path",points:[{x:0.1,y:0.13},{x:0,y:-0.06},{x:-0.11,y:0.13}],color:"primary",fill:!1},path2:{type:"path",points:[{x:-0.12,y:-0.14},{x:0.12,y:-0.14}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-0.17,y:0.4},bottom1:{type:"text",text:"{VAL}",x:-0.01,y:-0.4}},refblocks:{left1:{x:-0.54,y:0.03},right1:{x:0.54,y:0.04}},bounds:{minX:-0.57,maxX:0.57,minY:-0.4,maxY:0.4,width:1.14,height:0.79,centerX:0,centerY:0},circles:{path1:{type:"circle",x:0,y:0.04,radius:0.29,color:"primary",fill:!1}}},{paths:t6o,texts:Kfs,bounds:bfe,refblocks:I6t,circles:n6o}=$X,o6o=gn({primitives:[...Object.values(t6o),...Object.values(n6o),{type:"text",text:"{REF}",x:-0.15,y:0.3894553499999995},{type:"text",text:"{VAL}",x:0.15,y:0.3894553499999995}],ports:[{...I6t.left1,labels:["1"]},{...I6t.right1,labels:["2"]}],size:{width:bfe.width,height:bfe.height},center:{x:bfe.centerX,y:bfe.centerY}}).rotateRightFacingSymbol("down").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_left").changeTextAnchor("{VAL}","middle_left").build(),{paths:r6o,texts:$fs,bounds:Ife,refblocks:v6t,circles:i6o}=$X,s6o=gn({primitives:[...Object.values(r6o),...Object.values(i6o),{type:"text",text:"{REF}",x:-0,y:0.3894553499999995},{type:"text",text:"{VAL}",x:0,y:-0.3294553499999995}],ports:[{...v6t.left1,labels:["1"]},{...v6t.right1,labels:["2"]}],size:{width:Ife.width,height:Ife.height},center:{x:Ife.centerX,y:Ife.centerY}}).changeTextAnchor("{VAL}","middle_top").rotateRightFacingSymbol("right").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_bottom").build(),{paths:a6o,texts:qfs,bounds:vfe,refblocks:S6t,circles:c6o}=$X,l6o=gn({primitives:[...Object.values(a6o),...Object.values(c6o),{type:"text",text:"{REF}",x:-0,y:-0.3294553499999995},{type:"text",text:"{VAL}",x:0,y:0.4294553499999995}],ports:[{...S6t.left1,labels:["1"]},{...S6t.right1,labels:["2"]}],size:{width:vfe.width,height:vfe.height},center:{x:vfe.centerX,y:vfe.centerY}}).changeTextAnchor("{VAL}","middle_bottom").rotateRightFacingSymbol("left").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_bottom").build(),{paths:h6o,texts:Jfs,bounds:Sfe,refblocks:P6t,circles:d6o}=$X,u6o=gn({primitives:[...Object.values(h6o),...Object.values(d6o),{type:"text",text:"{REF}",x:-0,y:0.3894553499999995},{type:"text",text:"{VAL}",x:0,y:-0.3294553499999995}],ports:[{...P6t.left1,labels:["1"]},{...P6t.right1,labels:["2"]}],size:{width:Sfe.width,height:Sfe.height},center:{x:Sfe.centerX,y:Sfe.centerY}}).changeTextAnchor("{VAL}","middle_top").rotateRightFacingSymbol("right").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_bottom").build(),{paths:p6o,texts:Zfs,bounds:Pfe,refblocks:E6t,circles:m6o}=$X,_6o=gn({primitives:[...Object.values(p6o),...Object.values(m6o),{type:"text",text:"{REF}",x:0.15,y:-0.2894553499999995},{type:"text",text:"{VAL}",x:-0.15,y:-0.2894553499999995}],ports:[{...E6t.left1,labels:["1"]},{...E6t.right1,labels:["2"]}],size:{width:Pfe.width,height:Pfe.height},center:{x:Pfe.centerX,y:Pfe.centerY}}).rotateRightFacingSymbol("up").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_left").changeTextAnchor("{VAL}","middle_left").build(),{paths:g6o,texts:e2s,bounds:Efe,refblocks:M6t,circles:A6o}=$X,f6o=gn({primitives:[...Object.values(g6o),...Object.values(A6o),{type:"text",text:"{REF}",x:0.15,y:-0.2894553499999995},{type:"text",text:"{VAL}",x:-0.15,y:-0.2894553499999995}],ports:[{...M6t.left1,labels:["1"]},{...M6t.right1,labels:["2"]}],size:{width:Efe.width,height:Efe.height},center:{x:Efe.centerX,y:Efe.centerY}}).rotateRightFacingSymbol("up").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_left").changeTextAnchor("{VAL}","middle_left").build(),qX={paths:{path11:{type:"path",points:[{x:-0.54,y:0.04},{x:-0.11,y:0.04}],color:"primary",fill:!1},path12:{type:"path",points:[{x:0.1,y:0.04},{x:0.54,y:0.04}],color:"primary",fill:!1},"path11-0":{type:"path",points:[{x:-0.09,y:-0.15},{x:-0.09,y:0.26}],color:"primary",fill:!1},"path11-0-3":{type:"path",points:[{x:0.09,y:-0.15},{x:0.09,y:0.26}],color:"primary",fill:!1},"path11-0-9":{type:"path",points:[{x:-0.08,y:0.06},{x:-0.08,y:-0.15},{x:0.09,y:-0.05},{x:-0.08,y:0.06}],color:"primary",fill:!0},"path11-0-9-0":{type:"path",points:[{x:0.08,y:0.26},{x:0.08,y:0.05},{x:-0.09,y:0.15},{x:0.07,y:0.26}],color:"primary",fill:!0}},texts:{top1:{type:"text",text:"{REF}",x:-0.03,y:0.42},bottom1:{type:"text",text:"{VAL}",x:-0.03,y:-0.42}},refblocks:{left1:{x:-0.54,y:0.04},right1:{x:0.54,y:0.04}},bounds:{minX:-0.57,maxX:0.57,minY:-0.42,maxY:0.42,width:1.14,height:0.83,centerX:0,centerY:0},circles:{path1:{type:"circle",x:0,y:0.05,radius:0.29,color:"primary",fill:!1}}},y6o=gn(qX).rotateRightFacingSymbol("down").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_left",{x:-0.03,y:0.2}).changeTextAnchor("{VAL}","middle_left",{x:0.8,y:-0.2}).build(),x6o=gn(qX).rotateRightFacingSymbol("right").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_bottom",{x:0,y:0.1}).changeTextAnchor("{VAL}","middle_top").build(),C6o=gn(qX).rotateRightFacingSymbol("left").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_bottom",{x:0,y:0.8}).changeTextAnchor("{VAL}","middle_top",{x:0,y:-0.9}).build(),b6o=gn(qX).rotateRightFacingSymbol("right").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_bottom",{x:0,y:0.1}).changeTextAnchor("{VAL}","middle_top").build(),I6o=gn(qX).rotateRightFacingSymbol("up").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_left",{x:0.7,y:0.2}).changeTextAnchor("{VAL}","middle_left",{x:-0.13,y:-0.2}).build(),v6o=gn(qX).rotateRightFacingSymbol("up").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_left",{x:0.7,y:0.2}).changeTextAnchor("{VAL}","middle_left",{x:-0.13,y:-0.2}).build(),W2e={paths:{triangle:{type:"path",points:[{x:-0.06,y:-0.09},{x:-0.06,y:0.09},{x:0.06,y:0},{x:-0.06,y:-0.09}],color:"primary",fill:!1},stem:{type:"path",points:[{x:-0.11,y:0},{x:-0.06,y:0}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:0,y:0.03}},refblocks:{left1:{x:-0.11,y:0}},bounds:{minX:-0.57,maxX:0.57,minY:-0.37,maxY:0.37,width:1.14,height:0.74,centerX:0,centerY:0},circles:{}},{paths:S6o,bounds:w6t,refblocks:P6o}=W2e,E6o=gn({primitives:[...Object.values(S6o),{type:"text",text:"{REF}",x:-0.13,y:-0}],ports:[{...P6o.left1,labels:["1"]}],center:{x:w6t.centerX,y:w6t.centerY}}).rotateRightFacingSymbol("up").labelPort("left1",["1"]).changeTextAnchor("{REF}","middle_top").build(),{paths:M6o,bounds:B6t,refblocks:w6o}=W2e,B6o=gn({primitives:[...Object.values(M6o),{type:"text",text:"{REF}",x:-0.13,y:0}],ports:[{...w6o.left1,labels:["1"]}],center:{x:B6t.centerX,y:B6t.centerY}}).rotateRightFacingSymbol("right").labelPort("left1",["1"]).changeTextAnchor("{REF}","middle_right").build(),{paths:T6o,bounds:T6t,refblocks:D6o}=W2e,N6o=gn({primitives:[...Object.values(T6o),{type:"text",text:"{REF}",x:-0.13,y:-0}],ports:[{...D6o.left1,labels:["1"]}],center:{x:T6t.centerX,y:T6t.centerY}}).rotateRightFacingSymbol("left").labelPort("left1",["1"]).changeTextAnchor("{REF}","middle_left").build(),{paths:R6o,bounds:D6t,refblocks:Q6o}=W2e,k6o=gn({primitives:[...Object.values(R6o),{type:"text",text:"{REF}",x:-0.13,y:0}],ports:[{...Q6o.left1,labels:["1"]}],center:{x:D6t.centerX,y:D6t.centerY}}).rotateRightFacingSymbol("down").labelPort("left1",["1"]).changeTextAnchor("{REF}","middle_bottom").build(),L6o={paths:{path40:{type:"path",points:[{x:0.14,y:0.04},{x:-0.12,y:-0.09}],color:"primary",fill:!1},path41:{type:"path",points:[{x:-0.12,y:0.18},{x:0.14,y:0.04}],color:"primary",fill:!1},path42:{type:"path",points:[{x:-0.12,y:-0.09},{x:-0.12,y:0.18}],color:"primary",fill:!1},path43:{type:"path",points:[{x:0.14,y:0.18},{x:0.14,y:-0.09}],color:"primary",fill:!1},path44:{type:"path",points:[{x:-0.12,y:0.04},{x:-0.52,y:0.04}],color:"primary",fill:!1},"path44-0":{type:"path",points:[{x:0.52,y:0.04},{x:0.15,y:0.04}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-0.01,y:0.27},bottom1:{type:"text",text:"{VAL}",x:0,y:-0.27}},refblocks:{left1:{x:-0.52,y:0.04},right1:{x:0.52,y:0.04}},bounds:{minX:-0.55,maxX:0.55,minY:-0.27,maxY:0.27,width:1.09,height:0.55,centerX:0,centerY:0},circles:{}},X2e=gn(L6o).labelPort("left1",["1","pos","anode"]).labelPort("right1",["2","neg","cathode"]).changeTextAnchor("{REF}","middle_bottom").changeTextAnchor("{VAL}","middle_top").build(),H6o=Mo(X2e,"down"),F6o=Mo(X2e,"left"),j2e={paths:{"anode-lead":{type:"path",points:[{x:-0.25,y:0},{x:-0.11999999999999988,y:0}],color:"primary",fill:!1},body:{type:"path",points:[{x:-0.11999999999999988,y:0.11999999999999988},{x:0.1200000000000001,y:0},{x:-0.11999999999999988,y:-0.1200000000000001},{x:-0.11999999999999988,y:0.11999999999999988}],color:"primary",fill:!1},"cathode-bar":{type:"path",points:[{x:0.1200000000000001,y:0.11999999999999988},{x:0.1200000000000001,y:-0.1200000000000001}],color:"primary",fill:!1},"cathode-lead":{type:"path",points:[{x:0.1200000000000001,y:0},{x:0.25,y:0}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:0,y:0.25},bottom1:{type:"text",text:"{VAL}",x:0,y:-0.25}},refblocks:{left1:{x:-0.25,y:0},right1:{x:0.25,y:0}},bounds:{minX:-0.25,maxX:0.25,minY:-0.25,maxY:0.25,width:0.5,height:0.5,centerX:0,centerY:0},circles:{}},z6o=Di(j2e,{kind:"diode",orientation:"down",pin1Labels:["1","pos","anode"],pin2Labels:["2","neg","cathode"]}),O6o=Di(j2e,{kind:"diode",orientation:"left",pin1Labels:["1","pos","anode"],pin2Labels:["2","neg","cathode"]}),V6o=Di(j2e,{kind:"diode",orientation:"right",pin1Labels:["1","pos","anode"],pin2Labels:["2","neg","cathode"]}),Y6o=Di(j2e,{kind:"diode",orientation:"up",pin1Labels:["1","pos","anode"],pin2Labels:["2","neg","cathode"]}),G6o=Mo(X2e,"up"),K2e={paths:{"anode-lead":{type:"path",points:[{x:-0.17499999999999982,y:0},{x:-0.09999999999999987,y:0}],color:"primary",fill:!1},body:{type:"path",points:[{x:-0.09999999999999987,y:0.09999999999999987},{x:0.10000000000000009,y:0},{x:-0.09999999999999987,y:-0.10000000000000009},{x:-0.09999999999999987,y:0.09999999999999987}],color:"primary",fill:!1},"cathode-bar":{type:"path",points:[{x:0.10000000000000009,y:0.09999999999999987},{x:0.10000000000000009,y:-0.10000000000000009}],color:"primary",fill:!1},"cathode-lead":{type:"path",points:[{x:0.10000000000000009,y:0},{x:0.17500000000000004,y:0}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:0,y:0.25},bottom1:{type:"text",text:"{VAL}",x:0,y:-0.25}},refblocks:{left1:{x:-0.17499999999999982,y:0},right1:{x:0.17500000000000004,y:0}},bounds:{minX:-0.17499999999999982,maxX:0.17500000000000004,minY:-0.25,maxY:0.25,width:0.34999999999999987,height:0.5,centerX:0.00000000000000011102230246251565,centerY:0},circles:{}},U6o=Di(K2e,{kind:"diode",orientation:"down",pin1Labels:["1","pos","anode"],pin2Labels:["2","neg","cathode"]}),W6o=Di(K2e,{kind:"diode",orientation:"left",pin1Labels:["1","pos","anode"],pin2Labels:["2","neg","cathode"]}),X6o=Di(K2e,{kind:"diode",orientation:"right",pin1Labels:["1","pos","anode"],pin2Labels:["2","neg","cathode"]}),j6o=Di(K2e,{kind:"diode",orientation:"up",pin1Labels:["1","pos","anode"],pin2Labels:["2","neg","cathode"]}),K6o={paths:{path1:{type:"path",points:[{x:-0.37,y:0.22},{x:-0.13,y:0.22}],color:"primary",fill:!1},"path-1-2":{type:"path",points:[{x:-0.07,y:0.22},{x:0.11,y:0.16}],color:"primary",fill:!1},path2:{type:"path",points:[{x:0.1,y:0.13},{x:0.37,y:0.13}],color:"primary",fill:!1},path3:{type:"path",points:[{x:0.12,y:0.36},{x:0.37,y:0.36}],color:"primary",fill:!1},path4:{type:"path",points:[{x:-0.37,y:-0.18},{x:-0.13,y:-0.18}],color:"primary",fill:!1},"path4-5":{type:"path",points:[{x:-0.07,y:-0.19},{x:0.1,y:-0.24}],color:"primary",fill:!1},path5:{type:"path",points:[{x:0.1,y:-0.27},{x:0.37,y:-0.27}],color:"primary",fill:!1},path6:{type:"path",points:[{x:0.12,y:-0.04},{x:0.37,y:-0.04}],color:"primary",fill:!1},"path1-4-join":{type:"path",points:[{x:0,y:-0.2},{x:0,y:0.19}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:0,y:0.56},bottom1:{type:"text",text:"{VAL}",x:0,y:-0.42}},refblocks:{left1:{x:-0.37,y:0.22},left2:{x:-0.37,y:-0.18},right1:{x:0.37,y:0.36},right2:{x:0.37,y:0.13},right3:{x:0.37,y:-0.04},right5:{x:0.37,y:-0.27}},bounds:{minX:-0.4,maxX:0.4,minY:-0.47,maxY:0.56,width:1,height:1.04,centerX:0,centerY:0.05},circles:{"circle-2":{type:"circle",x:0.08,y:0.13,radius:0.02,color:"primary",fill:!1},"circle-5":{type:"circle",x:0.08,y:-0.27,radius:0.02,color:"primary",fill:!1},"circle-3":{type:"circle",x:0.08,y:0.37,radius:0.02,color:"primary",fill:!1},"circle-6":{type:"circle",x:0.08,y:-0.04,radius:0.02,color:"primary",fill:!1},"circle-1":{type:"circle",x:-0.1,y:0.22,radius:0.02,color:"primary",fill:!1},"circle-4":{type:"circle",x:-0.1,y:-0.18,radius:0.02,color:"primary",fill:!1}}},$2e=gn(K6o).labelPort("left1",["1"]).labelPort("right1",["3"]).labelPort("right2",["2"]).labelPort("right3",["6"]).labelPort("left2",["4"]).labelPort("right5",["5"]).changeTextAnchor("{REF}","middle_bottom").changeTextAnchor("{VAL}","middle_top").build(),kQe=Mo($2e,"down"),LQe=kQe.primitives.find((e)=>e.type==="text"&&e.text==="{REF}"),HQe=kQe.primitives.find((e)=>e.type==="text"&&e.text==="{VAL}");LQe.anchor="middle_bottom";HQe.anchor="middle_top";LQe.x=0;LQe.y+=0.537;HQe.y-=0.5375;HQe.x=0;$6o=kQe,FQe=Mo($2e,"left"),zQe=FQe.primitives.find((e)=>e.type==="text"&&e.text==="{REF}"),OQe=FQe.primitives.find((e)=>e.type==="text"&&e.text==="{VAL}");zQe.anchor="middle_bottom";OQe.anchor="middle_top";zQe.x=0;zQe.y+=1;OQe.y-=1;OQe.x=0;q6o=FQe,VQe=Mo($2e,"up"),YQe=VQe.primitives.find((e)=>e.type==="text"&&e.text==="{REF}"),GQe=VQe.primitives.find((e)=>e.type==="text"&&e.text==="{VAL}");YQe.anchor="middle_bottom";GQe.anchor="middle_top";YQe.x=0;YQe.y+=0.537;GQe.y-=0.5375;GQe.x=0;J6o=VQe,Z6o={paths:{path1:{type:"path",points:[{x:-0.37,y:0.22},{x:-0.13,y:0.22}],color:"primary",fill:!1},"path-1-3":{type:"path",points:[{x:-0.07,y:0.23},{x:0.11,y:0.33}],color:"primary",fill:!1},path2:{type:"path",points:[{x:0.1,y:0.13},{x:0.37,y:0.13}],color:"primary",fill:!1},path3:{type:"path",points:[{x:0.12,y:0.36},{x:0.37,y:0.36}],color:"primary",fill:!1},path4:{type:"path",points:[{x:-0.37,y:-0.18},{x:-0.13,y:-0.18}],color:"primary",fill:!1},"path4-6":{type:"path",points:[{x:-0.07,y:-0.18},{x:0.11,y:-0.07}],color:"primary",fill:!1},path5:{type:"path",points:[{x:0.1,y:-0.27},{x:0.37,y:-0.27}],color:"primary",fill:!1},path6:{type:"path",points:[{x:0.12,y:-0.04},{x:0.37,y:-0.04}],color:"primary",fill:!1},"path1-4-join":{type:"path",points:[{x:0,y:-0.12},{x:0,y:0.27}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:0,y:0.61},bottom1:{type:"text",text:"{VAL}",x:0,y:-0.52}},refblocks:{left1:{x:-0.37,y:0.22},left2:{x:-0.37,y:-0.18},right1:{x:0.37,y:0.36},right2:{x:0.37,y:0.13},right3:{x:0.37,y:-0.04},right5:{x:0.37,y:-0.27}},bounds:{minX:-0.4,maxX:0.4,minY:-0.47,maxY:0.56,width:1,height:1.04,centerX:0,centerY:0.05},circles:{"circle-2":{type:"circle",x:0.08,y:0.13,radius:0.02,color:"primary",fill:!1},"circle-5":{type:"circle",x:0.08,y:-0.27,radius:0.02,color:"primary",fill:!1},"circle-3":{type:"circle",x:0.08,y:0.37,radius:0.02,color:"primary",fill:!1},"circle-6":{type:"circle",x:0.08,y:-0.04,radius:0.02,color:"primary",fill:!1},"circle-1":{type:"circle",x:-0.1,y:0.22,radius:0.02,color:"primary",fill:!1},"circle-4":{type:"circle",x:-0.1,y:-0.18,radius:0.02,color:"primary",fill:!1}}},q2e=gn(Z6o).labelPort("left1",["1"]).labelPort("right1",["3"]).labelPort("right2",["2"]).labelPort("right3",["6"]).labelPort("left2",["4"]).labelPort("right5",["5"]).changeTextAnchor("{REF}","middle_bottom").changeTextAnchor("{VAL}","middle_top").build(),UQe=Mo(q2e,"down"),WQe=UQe.primitives.find((e)=>e.type==="text"&&e.text==="{REF}"),XQe=UQe.primitives.find((e)=>e.type==="text"&&e.text==="{VAL}");WQe.anchor="middle_bottom";XQe.anchor="middle_top";WQe.x=0;WQe.y+=0.565;XQe.y-=0.555;XQe.x=0;eIo=UQe,jQe=Mo(q2e,"left"),KQe=jQe.primitives.find((e)=>e.type==="text"&&e.text==="{REF}"),$Qe=jQe.primitives.find((e)=>e.type==="text"&&e.text==="{VAL}");KQe.anchor="middle_bottom";$Qe.anchor="middle_top";KQe.x=0;KQe.y+=1.09;$Qe.y-=1.09;$Qe.x=0;tIo=jQe,qQe=Mo(q2e,"up"),JQe=qQe.primitives.find((e)=>e.type==="text"&&e.text==="{REF}"),ZQe=qQe.primitives.find((e)=>e.type==="text"&&e.text==="{VAL}");JQe.anchor="middle_bottom";ZQe.anchor="middle_top";JQe.x=0;JQe.y+=0.565;ZQe.y-=0.555;ZQe.x=0;nIo=qQe,oIo={paths:{path11:{type:"path",points:[{x:-0.38,y:0.06},{x:-0.14,y:0.06}],color:"primary",fill:!1},"path11-0":{type:"path",points:[{x:-0.09,y:0.07},{x:0.11,y:0.11}],color:"primary",fill:!1},path12:{type:"path",points:[{x:0.13,y:0.06},{x:0.38,y:0.06}],color:"primary",fill:!1},"path11-5":{type:"path",points:[{x:-0.38,y:-0.17},{x:-0.14,y:-0.17}],color:"primary",fill:!1},"path11-0-3":{type:"path",points:[{x:-0.09,y:-0.17},{x:0.11,y:-0.12}],color:"primary",fill:!1},"path12-0":{type:"path",points:[{x:0.13,y:-0.17},{x:0.38,y:-0.17}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:0,y:0.31},bottom1:{type:"text",text:"{VAL}",x:0,y:-0.31}},refblocks:{left1:{x:-0.38,y:-0.17},left3:{x:-0.38,y:0.06},right1:{x:0.38,y:-0.17},right3:{x:0.38,y:0.06}},bounds:{minX:-0.4,maxX:0.4,minY:-0.4,maxY:0.4,width:0.81,height:0.79,centerX:0,centerY:0},circles:{"circle-4":{type:"circle",x:0.1,y:0.06,radius:0.02,color:"primary",fill:!1},"circle-2":{type:"circle",x:0.1,y:-0.17,radius:0.02,color:"primary",fill:!1},"circle-3":{type:"circle",x:-0.11,y:0.06,radius:0.02,color:"primary",fill:!1},"circle-1":{type:"circle",x:-0.11,y:-0.17,radius:0.02,color:"primary",fill:!1}}},J2e=gn(oIo).labelPort("left1",["1"]).labelPort("right1",["2"]).labelPort("right3",["4"]).labelPort("left3",["3"]).changeTextAnchor("{REF}","middle_bottom").changeTextAnchor("{VAL}","middle_top").build(),eke=Mo(J2e,"down"),tke=eke.primitives.find((e)=>e.type==="text"&&e.text==="{REF}"),nke=eke.primitives.find((e)=>e.type==="text"&&e.text==="{VAL}");tke.anchor="middle_bottom";nke.anchor="middle_top";tke.x=0.4;tke.y+=0.265;nke.y-=0.265;nke.x=0.4;rIo=eke,oke=Mo(J2e,"left"),rke=oke.primitives.find((e)=>e.type==="text"&&e.text==="{REF}"),ike=oke.primitives.find((e)=>e.type==="text"&&e.text==="{VAL}");rke.anchor="middle_bottom";ike.anchor="middle_top";rke.x=0;rke.y+=0.67;ike.y-=0.67;ike.x=0;iIo=oke,ske=Mo(J2e,"up"),ake=ske.primitives.find((e)=>e.type==="text"&&e.text==="{REF}"),cke=ske.primitives.find((e)=>e.type==="text"&&e.text==="{VAL}");ake.anchor="middle_bottom";cke.anchor="middle_top";ake.x=0.46;ake.y+=0.265;cke.y-=0.265;cke.x=0.46;sIo=ske,aIo={paths:{path11:{type:"path",points:[{x:-0.38,y:0.06},{x:-0.14,y:0.06}],color:"primary",fill:!1},"path11-0":{type:"path",points:[{x:-0.09,y:0.07},{x:0.1,y:0.2}],color:"primary",fill:!1},path12:{type:"path",points:[{x:0.13,y:0.06},{x:0.38,y:0.06}],color:"primary",fill:!1},"path11-5":{type:"path",points:[{x:-0.38,y:-0.17},{x:-0.14,y:-0.17}],color:"primary",fill:!1},"path11-0-3":{type:"path",points:[{x:-0.09,y:-0.16},{x:0.1,y:-0.03}],color:"primary",fill:!1},"path12-0":{type:"path",points:[{x:0.13,y:-0.17},{x:0.38,y:-0.17}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:0,y:0.42},bottom1:{type:"text",text:"{VAL}",x:0,y:-0.42}},refblocks:{left1:{x:-0.38,y:-0.17},left3:{x:-0.38,y:0.06},right1:{x:0.38,y:-0.17},right3:{x:0.38,y:0.06}},bounds:{minX:-0.4,maxX:0.4,minY:-0.4,maxY:0.4,width:0.81,height:0.79,centerX:0,centerY:0},circles:{"circle-4":{type:"circle",x:0.1,y:0.06,radius:0.02,color:"primary",fill:!1},"circle-2":{type:"circle",x:0.1,y:-0.17,radius:0.02,color:"primary",fill:!1},"circle-3":{type:"circle",x:-0.11,y:0.06,radius:0.02,color:"primary",fill:!1},"circle-1":{type:"circle",x:-0.11,y:-0.17,radius:0.02,color:"primary",fill:!1}}},Z2e=gn(aIo).labelPort("left1",["1"]).labelPort("right1",["2"]).labelPort("right3",["4"]).labelPort("left3",["3"]).changeTextAnchor("{REF}","middle_bottom").changeTextAnchor("{VAL}","middle_top").build(),lke=Mo(Z2e,"down"),hke=lke.primitives.find((e)=>e.type==="text"&&e.text==="{REF}"),dke=lke.primitives.find((e)=>e.type==="text"&&e.text==="{VAL}");hke.anchor="middle_bottom";dke.anchor="middle_top";hke.x=0.4;hke.y+=0.295;dke.y-=0.295;dke.x=0.42;cIo=lke,uke=Mo(Z2e,"left"),pke=uke.primitives.find((e)=>e.type==="text"&&e.text==="{REF}"),mke=uke.primitives.find((e)=>e.type==="text"&&e.text==="{VAL}");pke.anchor="middle_bottom";mke.anchor="middle_top";pke.x=0;pke.y+=0.795;mke.y-=0.795;mke.x=0;lIo=uke,_ke=Mo(Z2e,"up"),gke=_ke.primitives.find((e)=>e.type==="text"&&e.text==="{REF}"),Ake=_ke.primitives.find((e)=>e.type==="text"&&e.text==="{VAL}");gke.anchor="middle_bottom";Ake.anchor="middle_top";gke.x=0.46;gke.y+=0.315;Ake.y-=0.315;Ake.x=0.46;hIo=_ke,Mfe={paths:{"left-terminal-lead":{type:"path",points:[{x:-0.7,y:0.06000000000000005},{x:-0.3938805999999999,y:0.06000000000000005}],color:"primary",fill:!1},"diode-bridge":{type:"path",points:[{x:-0.2763954999999998,y:0.06000000000000005},{x:0.27446270000000017,y:0.06000000000000005}],color:"primary",fill:!1},"right-terminal-lead":{type:"path",points:[{x:0.39193030000000006,y:0.06000000000000005},{x:0.7000000000000002,y:0.06000000000000005}],color:"primary",fill:!1},"junction-lead":{type:"path",points:[{x:0,y:0.06000000000000005},{x:0,y:-0.2200000000000002}],color:"primary",fill:!1},"first-diode-body":{type:"path",points:[{x:-0.3938805999999999,y:0.12609950000000003},{x:-0.2783806,y:0.05897259999999993},{x:-0.3938805999999999,y:-0.007179100000000105},{x:-0.3938805999999999,y:0.12609950000000003}],color:"primary",fill:!1},"first-cathode-bar":{type:"path",points:[{x:-0.2763954999999998,y:0.1754652000000001},{x:-0.2763954999999998,y:-0.05455969999999999},{x:-0.23000749999999992,y:-0.05455969999999999},{x:-0.23000749999999992,y:-0.027900499999999884}],color:"primary",fill:!1},"first-cathode-upper-hook":{type:"path",points:[{x:-0.32379350000000007,y:0.13499749999999988},{x:-0.3228009999999999,y:0.1754652000000001},{x:-0.2763954999999998,y:0.1754652000000001}],color:"primary",fill:!1},"second-diode-body":{type:"path",points:[{x:0.27446270000000017,y:0.12609950000000003},{x:0.3899626999999999,y:0.05897259999999993},{x:0.27446270000000017,y:-0.007179100000000105},{x:0.27446270000000017,y:0.12609950000000003}],color:"primary",fill:!1},"second-cathode-bar":{type:"path",points:[{x:0.39193030000000006,y:0.1754652000000001},{x:0.39193030000000006,y:-0.05455969999999999},{x:0.43931089999999995,y:-0.05455969999999999},{x:0.43931089999999995,y:-0.027900499999999884}],color:"primary",fill:!1},"second-cathode-upper-hook":{type:"path",points:[{x:0.3455249,y:0.13499749999999988},{x:0.3465174000000002,y:0.1754652000000001},{x:0.39193030000000006,y:0.1754652000000001}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:0,y:0.3400000000000001},bottom1:{type:"text",text:"{VAL}",x:0,y:-0.3400000000000001}},refblocks:{bottom1:{x:0,y:-0.2200000000000002},left1:{x:-0.7,y:0.06000000000000005},right1:{x:0.7000000000000002,y:0.06000000000000005}},bounds:{minX:-0.7,maxX:0.7000000000000002,minY:-0.3400000000000001,maxY:0.3400000000000001,width:1.4000000000000001,height:0.6800000000000002,centerX:0.00000000000000011102230246251565,centerY:0},circles:{"junction-dot":{type:"circle",x:0,y:0.06000000000000005,radius:0.024291,color:"primary",fill:!0}}},dIo={right:{reference:{x:0,y:0.34},value:{x:0,y:-0.34}},up:{reference:{x:0.17,y:-0.34},value:{x:-0.17,y:-0.34}},down:{reference:{x:-0.17,y:0.34},value:{x:0.17,y:0.34}}},uIo=fke("down"),o9t=fke("right"),pIo=wI(o9t),mIo=fke("up"),r9t={paths:{path5:{type:"path",points:[{x:-0.44,y:0},{x:-0.16,y:0}],color:"primary",fill:!1},path6:{type:"path",points:[{x:0.17,y:0},{x:0.44,y:0.01}],color:"primary",fill:!1},path9:{type:"path",points:[{x:-0.25,y:-0.16},{x:0.02,y:0.3},{x:0.25,y:0.17},{x:-0.02,y:-0.29},{x:-0.25,y:-0.16}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:0,y:0.37},bottom1:{type:"text",text:"{VAL}",x:0,y:-0.37}},refblocks:{left1:{x:-0.44,y:0},right1:{x:0.44,y:0.01}},bounds:{minX:-0.57,maxX:0.57,minY:-0.25,maxY:0.25,width:1.13,height:0.5,centerX:0,centerY:0},circles:{}},{paths:_Io,texts:t2s,bounds:wfe,refblocks:N6t,circles:gIo}=r9t,i9t=gn({primitives:[...Object.values(_Io),...Object.values(gIo),{type:"text",text:"{REF}",x:0.18,y:-0.3204553499999995},{type:"text",text:"{VAL}",x:-0.25,y:-0.3294553499999995}],ports:[{...N6t.left1,labels:["1"]},{...N6t.right1,labels:["2"]}],size:{width:wfe.width,height:wfe.height},center:{x:wfe.centerX,y:wfe.centerY}}).rotateRightFacingSymbol("up").labelPort("left",["1"]).labelPort("right",["2"]).changeTextAnchor("{REF}","middle_left").changeTextAnchor("{VAL}","middle_left").build(),yke=UX(i9t),xke=yke.primitives.find((e)=>e.type==="text"&&e.text==="{REF}"),Cke=yke.primitives.find((e)=>e.type==="text"&&e.text==="{VAL}");xke.anchor="middle_left";Cke.anchor="middle_left";xke.y+=0.4;xke.x=0.32;Cke.y-=0.45;Cke.x=0.32;AIo=yke,s9t=gn(r9t).labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_bottom").changeTextAnchor("{VAL}","middle_top").build(),fIo=wI(s9t),JX={paths:{path11:{type:"path",points:[{x:-0.56,y:0.04},{x:-0.22,y:0.04}],color:"primary",fill:!1},path12:{type:"path",points:[{x:0.14,y:0.05},{x:0.48,y:0.05}],color:"primary",fill:!1},"path12-6":{type:"path",points:[{x:0.14,y:-0.15},{x:0.14,y:0.25}],color:"primary",fill:!1},"path11-0-9":{type:"path",points:[{x:-0.22,y:0.25},{x:-0.21,y:-0.15},{x:0.14,y:0.05},{x:-0.22,y:0.25}],color:"primary",fill:!0}},texts:{top1:{type:"text",text:"{REF}",x:-0.09,y:0.38},bottom1:{type:"text",text:"{VAL}",x:-0.07,y:-0.38},right1:{type:"text",text:"",x:0.59,y:-0.33}},refblocks:{left1:{x:-0.56,y:0.04},right1:{x:0.48,y:0.05}},bounds:{minX:-0.59,maxX:0.59,minY:-0.38,maxY:0.38,width:1.18,height:0.76,centerX:0,centerY:0},circles:{}},{paths:yIo,texts:n2s,bounds:Bfe,refblocks:R6t,circles:xIo}=JX,CIo=gn({primitives:[...Object.values(yIo),...Object.values(xIo),{type:"text",text:"{REF}",x:-0.15,y:0.3294553499999995},{type:"text",text:"{VAL}",x:0.15,y:0.3294553499999995}],ports:[{...R6t.left1,labels:["1"]},{...R6t.right1,labels:["2"]}],size:{width:Bfe.width,height:Bfe.height},center:{x:Bfe.centerX,y:Bfe.centerY}}).rotateRightFacingSymbol("down").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_left").changeTextAnchor("{VAL}","middle_left").build(),{paths:bIo,texts:o2s,bounds:Tfe,refblocks:Q6t,circles:IIo}=JX,vIo=gn({primitives:[...Object.values(bIo),...Object.values(IIo),{type:"text",text:"{REF}",x:-0,y:0.4094553499999995},{type:"text",text:"{VAL}",x:0,y:-0.4094553499999995}],ports:[{...Q6t.left1,labels:["1"]},{...Q6t.right1,labels:["2"]}],size:{width:Tfe.width,height:Tfe.height},center:{x:Tfe.centerX,y:Tfe.centerY}}).changeTextAnchor("{VAL}","middle_top").rotateRightFacingSymbol("right").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_bottom").build(),{paths:SIo,texts:r2s,bounds:Dfe,refblocks:k6t,circles:PIo}=JX,EIo=gn({primitives:[...Object.values(SIo),...Object.values(PIo),{type:"text",text:"{REF}",x:-0,y:-0.3094553499999995},{type:"text",text:"{VAL}",x:0,y:0.4094553499999995}],ports:[{...k6t.left1,labels:["1"]},{...k6t.right1,labels:["2"]}],size:{width:Dfe.width,height:Dfe.height},center:{x:Dfe.centerX,y:Dfe.centerY}}).changeTextAnchor("{VAL}","middle_bottom").rotateRightFacingSymbol("left").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_bottom").build(),{paths:MIo,texts:i2s,bounds:Nfe,refblocks:L6t,circles:wIo}=JX,BIo=gn({primitives:[...Object.values(MIo),...Object.values(wIo),{type:"text",text:"{REF}",x:-0,y:0.4094553499999995},{type:"text",text:"{VAL}",x:0,y:-0.4094553499999995}],ports:[{...L6t.left1,labels:["1"]},{...L6t.right1,labels:["2"]}],size:{width:Nfe.width,height:Nfe.height},center:{x:Nfe.centerX,y:Nfe.centerY}}).changeTextAnchor("{VAL}","middle_top").rotateRightFacingSymbol("right").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_bottom").build(),{paths:TIo,texts:s2s,bounds:Rfe,refblocks:H6t,circles:DIo}=JX,NIo=gn({primitives:[...Object.values(TIo),...Object.values(DIo),{type:"text",text:"{REF}",x:0.15,y:-0.2894553499999995},{type:"text",text:"{VAL}",x:-0.15,y:-0.2894553499999995}],ports:[{...H6t.left1,labels:["1"]},{...H6t.right1,labels:["2"]}],size:{width:Rfe.width,height:Rfe.height},center:{x:Rfe.centerX,y:Rfe.centerY}}).rotateRightFacingSymbol("up").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_left").changeTextAnchor("{VAL}","middle_left").build(),{paths:RIo,texts:a2s,bounds:Qfe,refblocks:F6t,circles:QIo}=JX,kIo=gn({primitives:[...Object.values(RIo),...Object.values(QIo),{type:"text",text:"{REF}",x:0.15,y:-0.2894553499999995},{type:"text",text:"{VAL}",x:-0.15,y:-0.2894553499999995}],ports:[{...F6t.left1,labels:["1"]},{...F6t.right1,labels:["2"]}],size:{width:Qfe.width,height:Qfe.height},center:{x:Qfe.centerX,y:Qfe.centerY}}).rotateRightFacingSymbol("up").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_left").changeTextAnchor("{VAL}","middle_left").build(),LIo={paths:{path11:{type:"path",points:[{x:-0.54,y:0},{x:-0.3,y:0}],color:"primary",fill:!1},path12:{type:"path",points:[{x:0.29,y:0},{x:0.54,y:0}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-0.18,y:-0.36},bottom1:{type:"text",text:"{VAL}",x:-0.01,y:0.43},left1:{type:"text",text:"Hz",x:0,y:-0.04}},refblocks:{left1:{x:-0.54,y:0},right1:{x:0.54,y:0}},bounds:{minX:-0.53,maxX:0.53,minY:0,maxY:0,width:1.06,height:1,centerX:0,centerY:0},circles:{path1:{type:"circle",x:-0.01,y:-0.01,radius:0.29,color:"primary",fill:!1}}},{paths:HIo,texts:FIo,bounds:kfe,refblocks:z6t,circles:zIo}=LIo,bke=yl({primitives:[...Object.values(HIo),...Object.values(zIo),{type:"text",text:"{REF}",x:0,y:-0.3594553499999995,anchor:"middle_top"},{type:"text",text:"{VAL}",x:0,y:0.35,anchor:"middle_bottom"},{...FIo.left1,x:0,y:0.01,anchor:"center",fontSize:0.2}],ports:[{...z6t.left1,labels:["1"]},{...z6t.right1,labels:["2"]}],size:{width:kfe.width,height:kfe.height},center:{x:kfe.centerX,y:kfe.centerY}}),{5:OIo,...VIo}=bke.primitives;O6t=Mo({...bke,primitives:Object.values(VIo).filter(YIo)}),GIo={...O6t,primitives:[...O6t.primitives,OIo]},UIo={paths:{path10:{type:"path",points:[{x:-0.53,y:0.04},{x:0.53,y:0.04}],color:"primary",fill:!1},path14:{type:"path",points:[{x:0,y:0.17},{x:0.27,y:0.17},{x:0.27,y:-0.1},{x:-0.26,y:-0.1},{x:-0.26,y:0.17},{x:0,y:0.17}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-0.01,y:0.24},bottom1:{type:"text",text:"{VAL}",x:-0.17,y:-0.24}},refblocks:{left1:{x:-0.53,y:0.04},right1:{x:0.53,y:0.04}},bounds:{minX:-0.56,maxX:0.56,minY:-0.24,maxY:0.24,width:1.13,height:0.47,centerX:0,centerY:0},circles:{}},{paths:WIo,texts:XIo,bounds:Lfe,refblocks:V6t}=UIo,a9t=yl({primitives:[...Object.values(WIo),{...XIo.top1,anchor:"middle_bottom"},{type:"text",text:"{VAL}",x:0,y:-0.2,anchor:"middle_top"}],ports:[{...V6t.left1,labels:["1"]},{...V6t.right1,labels:["2"]}],size:{width:Lfe.width,height:Lfe.height},center:{x:Lfe.centerX,y:Lfe.centerY}}),jIo=Mo(a9t),ZX={paths:{path1:{type:"path",points:[{x:-0.29,y:0.01},{x:0.04,y:0}],color:"primary",fill:!0},path2:{type:"path",points:[{x:0.04,y:-0.22},{x:0.04,y:0.22}],color:"primary",fill:!0},path3:{type:"path",points:[{x:0.12,y:-0.17},{x:0.12,y:0.17}],color:"primary",fill:!0},path4:{type:"path",points:[{x:0.19,y:-0.06},{x:0.19,y:0.06}],color:"primary",fill:!0}},texts:{right1:{type:"text",text:"{REF}",x:0.31,y:-0.02}},refblocks:{left1:{x:-0.29,y:0.01}},bounds:{minX:-0.31,maxX:0.31,minY:-0.22,maxY:0.22,width:0.62,height:0.45,centerX:0,centerY:0},circles:{}},KIo=gn(ZX).rotateRightFacingSymbol("down").labelPort("left1",["1"]).changeTextAnchor("{REF}","middle_top").build(),$Io=gn(ZX).rotateRightFacingSymbol("right").labelPort("left1",["1"]).changeTextAnchor("{REF}","middle_left").build(),qIo=gn(ZX).rotateRightFacingSymbol("left").labelPort("left1",["1"]).changeTextAnchor("{REF}","middle_right").build(),JIo=gn(ZX).rotateRightFacingSymbol("right").labelPort("left1",["1"]).changeTextAnchor("{REF}","middle_left").build(),ZIo=gn(ZX).rotateRightFacingSymbol("up").labelPort("left1",["1"]).changeTextAnchor("{REF}","middle_bottom").build(),e9o=gn(ZX).rotateRightFacingSymbol("up").labelPort("left1",["1"]).changeTextAnchor("{REF}","middle_bottom").build(),Ike={paths:{path11:{type:"path",points:[{x:-0.52,y:0.03},{x:-0.18,y:0.04}],color:"primary",fill:!1},path12:{type:"path",points:[{x:0.19,y:0.04},{x:0.52,y:0.04}],color:"primary",fill:!1},"path11-0-9":{type:"path",points:[{x:-0.31,y:0.2},{x:-0.31,y:-0.11},{x:-0.01,y:0.04},{x:-0.3,y:0.2}],color:"primary",fill:!0},"path11-0-9-5":{type:"path",points:[{x:0.33,y:0.2},{x:0.33,y:-0.1},{x:0.04,y:0.04},{x:0.33,y:0.2}],color:"primary",fill:!0}},texts:{top1:{type:"text",text:"{REF}",x:0.04,y:0.32},bottom1:{type:"text",text:"{VAL}",x:0.04,y:-0.32}},refblocks:{left1:{x:-0.52,y:0.03},right1:{x:0.52,y:0.04}},bounds:{minX:-0.55,maxX:0.55,minY:-0.32,maxY:0.32,width:1.09,height:0.63,centerX:0,centerY:0},circles:{}},{paths:c2s,texts:l2s,bounds:h2s,refblocks:d2s,circles:u2s}=Ike,t9o=gn(Ike).changeTextAnchor("{VAL}","middle_top").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_bottom").build(),n9o=gn(Ike).rotateRightFacingSymbol("down").changeTextAnchor("{VAL}","middle_right").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_left").build(),o9o={paths:{path45:{type:"path",points:[{x:0.14,y:0},{x:-0.13,y:-0.14}],color:"primary",fill:!1},"path1-8":{type:"path",points:[{x:0.13,y:0},{x:0.3,y:0}],color:"primary",fill:!1},path46:{type:"path",points:[{x:-0.13,y:0.13},{x:0.14,y:0}],color:"primary",fill:!1},path47:{type:"path",points:[{x:-0.13,y:-0.14},{x:-0.13,y:0.13}],color:"primary",fill:!1},path48:{type:"path",points:[{x:0.14,y:0.13},{x:0.14,y:-0.14}],color:"primary",fill:!1},path49:{type:"path",points:[{x:-0.13,y:0},{x:-0.3,y:0}],color:"primary",fill:!1},path25:{type:"path",points:[{x:0.16,y:0.29},{x:0.25,y:0.3},{x:0.22,y:0.21}],color:"primary",fill:!0},path78:{type:"path",points:[{x:0.08,y:0.17},{x:0.09,y:0.17},{x:0.21,y:0.27},{x:0.21,y:0.27}],color:"primary",fill:!1},"path25-0":{type:"path",points:[{x:-0.02,y:0.31},{x:0.08,y:0.32},{x:0.04,y:0.23}],color:"primary",fill:!0},"path78-6":{type:"path",points:[{x:-0.1,y:0.19},{x:-0.09,y:0.2},{x:0.04,y:0.29},{x:0.04,y:0.29}],color:"primary",fill:!1},box:{type:"path",points:[{x:-0.3,y:-0.4},{x:0.3,y:-0.4},{x:0.3,y:0.4},{x:-0.3,y:0.4},{x:-0.3,y:-0.4},{x:-0.3,y:0.4}],color:"primary",fill:!1},"path48-1":{type:"path",points:[{x:-0.3,y:0.13},{x:-0.54,y:0.13}],color:"primary",fill:!1},"path48-2":{type:"path",points:[{x:-0.3,y:-0.13},{x:-0.54,y:-0.13}],color:"primary",fill:!1},"path48-3":{type:"path",points:[{x:0.3,y:-0.13},{x:0.54,y:-0.13}],color:"primary",fill:!1},"path48-4":{type:"path",points:[{x:0.3,y:0.13},{x:0.54,y:0.13}],color:"primary",fill:!1}},texts:{bottom1:{type:"text",text:"{VAL}",x:0,y:-0.43},right1:{type:"text",text:"{REF}",x:0,y:0.43}},refblocks:{left1:{x:-0.54,y:0.13},left2:{x:-0.54,y:-0.13},right1:{x:0.54,y:-0.13},right2:{x:0.54,y:0.13}},bounds:{minX:-0.56,maxX:0.56,minY:-0.32,maxY:0.32,width:1.13,height:0.65,centerX:0,centerY:0},circles:{}},e1e=gn(o9o).labelPort("left1",["1","DIN"]).labelPort("left2",["2","POWER"]).labelPort("right1",["3","GND"]).labelPort("right2",["4","DOUT"]).changeTextAnchor("{REF}","middle_bottom").changeTextAnchor("{VAL}","middle_top").build(),r9o=Mo(e1e,"down"),i9o=wI(e1e),vke=Mo(e1e,"up"),Ske=vke.primitives.find((e)=>e.type==="text"&&e.text==="{REF}"),Pke=vke.primitives.find((e)=>e.type==="text"&&e.text==="{VAL}");Ske.anchor="middle_left";Pke.anchor="middle_left";Ske.y+=0.21;Ske.x=0.44;Pke.y-=0.21;Pke.x=0.44;s9o=vke,a9o={paths:{path11:{type:"path",points:[{x:-0.4,y:0},{x:-0.01,y:0}],color:"primary",fill:!1},path40:{type:"path",points:[{x:0.07,y:0.19},{x:0.07,y:-0.18}],color:"primary",fill:!1},path42:{type:"path",points:[{x:0.01,y:-0.12},{x:0.01,y:0.14}],color:"primary",fill:!1},path12:{type:"path",points:[{x:0.28,y:-0.25},{x:0.28,y:-0.56}],color:"primary",fill:!1},"path12-1":{type:"path",points:[{x:0.28,y:0.56},{x:0.28,y:0.27}],color:"primary",fill:!1},path15:{type:"path",points:[{x:0.17,y:-0.22},{x:0.28,y:-0.23},{x:0.23,y:-0.14}],color:"primary",fill:!0},path17:{type:"path",points:[{x:0.08,y:-0.09},{x:0.23,y:-0.2}],color:"primary",fill:!1},path2:{type:"path",points:[{x:0.07,y:0.11},{x:0.28,y:0.26}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-0.01,y:0.36},bottom1:{type:"text",text:"{VAL}",x:0.02,y:-0.42}},refblocks:{top1:{x:0.28,y:0.56},bottom1:{x:0.28,y:-0.56},left1:{x:-0.4,y:0}},bounds:{minX:-0.43,maxX:0.43,minY:-0.58,maxY:0.58,width:0.85,height:1.17,centerX:0,centerY:0},circles:{path1:{type:"circle",x:0.14,y:0.01,radius:0.29,color:"primary",fill:!1}}},c9t=gn(a9o).changeTextAnchor("{VAL}","middle_right").labelPort("left1",["3"]).labelPort("top1",["2"]).labelPort("bottom1",["1"]).changeTextAnchor("{REF}","middle_right").build(),Eke=Mo(c9t),Mke=Eke.primitives.find((e)=>e.type==="text"&&e.text==="{REF}"),l9t=Eke.primitives.find((e)=>e.type==="text"&&e.text==="{VAL}");Mke.anchor="middle_left";l9t.anchor="middle_right";Mke.x=0.45;Mke.y+=0.065;l9t.y+=0.065;c9o=Eke,l9o={paths:{"path12-1-8-6-9":{type:"path",points:[{x:0.02,y:-0.02},{x:0.02,y:-0.1}],color:"primary",fill:!1},"path12-1-5-6":{type:"path",points:[{x:-0.47,y:-0.19},{x:-0.17,y:-0.19}],color:"primary",fill:!1},"path12-1-5-6-8":{type:"path",points:[{x:0.02,y:0.17},{x:0.02,y:0.11}],color:"primary",fill:!1},"path12-1-8-0":{type:"path",points:[{x:-0.15,y:-0.03},{x:0.2,y:-0.19}],color:"primary",fill:!1},"path12-1-0":{type:"path",points:[{x:0.2,y:-0.19},{x:0.47,y:-0.19}],color:"primary",fill:!1},"path12-1-8-6-9-4":{type:"path",points:[{x:0.02,y:0.12},{x:0.02,y:0.02}],color:"primary",fill:!1},"path12-1-8-6-9-4-3":{type:"path",points:[{x:0.08,y:0.11},{x:0.08,y:0.05}],color:"primary",fill:!1},"path12-1-8-6-9-4-3-1":{type:"path",points:[{x:-0.04,y:0.11},{x:-0.04,y:0.05}],color:"primary",fill:!1},"path12-1-8-6-9-4-4":{type:"path",points:[{x:0.08,y:0.11},{x:-0.04,y:0.11}],color:"primary",fill:!1},"path14-5":{type:"path",points:[{x:-0.01,y:0.28},{x:0.01,y:0.25},{x:0.04,y:0.23},{x:0.06,y:0.2}],color:"primary",fill:!0},"path14-5-3":{type:"path",points:[{x:-0.01,y:0.2},{x:0.01,y:0.23},{x:0.04,y:0.25},{x:0.06,y:0.28}],color:"primary",fill:!0}},texts:{top1:{type:"text",text:"{REF}",x:0.01,y:0.38},bottom1:{type:"text",text:"{VAL}",x:0.06,y:-0.38}},refblocks:{left1:{x:-0.47,y:-0.19},right1:{x:0.47,y:-0.19}},bounds:{minX:-0.5,maxX:0.5,minY:-0.38,maxY:0.38,width:1,height:0.76,centerX:0,centerY:0},circles:{path9:{type:"circle",x:0.02,y:0.24,radius:0.06,color:"primary",fill:!1}}},h9t=gn(l9o).changeTextAnchor("{VAL}","middle_top").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_bottom").build(),d9t=Mo(h9t),u9t=d9t.primitives.filter((e)=>e.type==="text"),wke=u9t.find((e)=>e.text==="{VAL}");wke.x=-0.35;wke.y=0;wke.anchor="middle_right";Bke=u9t.find((e)=>e.text==="{REF}");Bke.y=0;Bke.x=0.35;Bke.anchor="middle_left";h9o=d9t,t1e={paths:{path8698:{type:"path",points:[{x:-0.19796749999999919,y:-0.023826854587889912},{x:-0.2004570399999992,y:-0.018993393814014044},{x:-0.2029465799999992,y:-0.014174384106555204},{x:-0.20543611999999922,y:-0.009384187436300498},{x:-0.20792565999999923,y:-0.004636988132081332},{x:-0.21041519999999925,y:0.00005329457033053167},{x:-0.21290473999999926,y:0.004673092344940184},{x:-0.21539427999999927,y:0.009209271428771242},{x:-0.21788381999999928,y:0.013649213595881985},{x:-0.2203733599999993,y:0.01798089395292432},{x:-0.2228628999999993,y:0.022192955076609913},{x:-0.22535243999999932,y:0.02627477703600152},{x:-0.22784197999999933,y:0.030216542867918667},{x:-0.23033151999999935,y:0.03400929910178016},{x:-0.23282105999999936,y:0.03764501096072756},{x:-0.23531059999999937,y:0.04111661189869628},{x:-0.23780013999999938,y:0.04441804716802203},{x:-0.2402896799999994,y:0.04754431114897349},{x:-0.2427792199999994,y:0.05049147821106258},{x:-0.24526875999999942,y:0.053256726915861724},{x:-0.24775829999999943,y:0.05583835741211009},{x:-0.25024783999999944,y:0.05823580191586174},{x:-0.25273737999999946,y:0.060449628211062575},{x:-0.25522691999999947,y:0.0624815361489735},{x:-0.2577164599999995,y:0.06433434716802203},{x:-0.2602059999999995,y:0.06601198689869628},{x:-0.2626955399999995,y:0.06751946096072757},{x:-0.2651850799999995,y:0.06886282410178016},{x:-0.26767461999999953,y:0.07004914286791866},{x:-0.27016415999999954,y:0.0710864520360015},{x:-0.27265369999999955,y:0.07198370507660991},{x:-0.27514323999999957,y:0.07275071895292433},{x:-0.2776327799999996,y:0.07339811359588198},{x:-0.2801223199999996,y:0.07393724642877124},{x:-0.2826118599999996,y:0.07438014234494018},{x:-0.2851013999999996,y:0.07473941957033053},{x:-0.28759093999999963,y:0.07502821186791866},{x:-0.29008047999999964,y:0.07526008756369952},{x:-0.29257001999999965,y:0.07544896589344477},{x:-0.29505955999999967,y:0.07560903118598594},{x:-0.2975490999999997,y:0.07575464541211008},{x:-0.30003863749999965,y:0.07560903118598594},{x:-0.3025281749999997,y:0.07544896589344477},{x:-0.30501771249999965,y:0.07526008756369951},{x:-0.3075072499999996,y:0.07502821186791866},{x:-0.30999678749999965,y:0.07473941957033052},{x:-0.3124863249999996,y:0.07438014234494018},{x:-0.3149758624999996,y:0.07393724642877124},{x:-0.31746539999999956,y:0.07339811359588198},{x:-0.3199549374999996,y:0.07275071895292431},{x:-0.32244447499999956,y:0.07198370507660991},{x:-0.32493401249999954,y:0.0710864520360015},{x:-0.32742354999999956,y:0.07004914286791866},{x:-0.32991308749999954,y:0.06886282410178016},{x:-0.3324026249999995,y:0.06751946096072756},{x:-0.33489216249999954,y:0.06601198689869628},{x:-0.3373816999999995,y:0.06433434716802203},{x:-0.3398712374999995,y:0.06248153614897349},{x:-0.3423607749999995,y:0.06044962821106258},{x:-0.3448503124999994,y:0.05823580191586174},{x:-0.34733984999999945,y:0.05583835741211009},{x:-0.3498293874999995,y:0.053256726915861724},{x:-0.35231892499999945,y:0.050491478211062576},{x:-0.3548084624999994,y:0.0475443111489735},{x:-0.3572979999999994,y:0.04441804716802203},{x:-0.35978753749999937,y:0.04111661189869628},{x:-0.3622770749999994,y:0.03764501096072756},{x:-0.36476661249999937,y:0.03400929910178016},{x:-0.36725614999999934,y:0.030216542867918673},{x:-0.36974568749999936,y:0.02627477703600152},{x:-0.37223522499999934,y:0.022192955076609917},{x:-0.3747247624999993,y:0.017980893952924324},{x:-0.37721429999999934,y:0.013649213595881985},{x:-0.3797038374999993,y:0.00920927142877125},{x:-0.3821933749999993,y:0.004673092344940191},{x:-0.3846829124999993,y:0.00005329457033053514},{x:-0.3871724499999993,y:-0.004636988132081328},{x:-0.38966198749999925,y:-0.009384187436300498},{x:-0.3921515249999992,y:-0.014174384106555197},{x:-0.39464106249999925,y:-0.01899339381401404},{x:-0.3971305999999992,y:-0.023826854587889912}],color:"primary",fill:!1},path8700:{type:"path",points:[{x:0.0011955000000007932,y:-0.02382615458789039},{x:-0.00129403749999919,y:-0.01899269131401453},{x:-0.0037835749999991734,y:-0.014173679106555696},{x:-0.006273112499999156,y:-0.009383479936300985},{x:-0.00876264999999914,y:-0.004636278132081827},{x:-0.011252187499999122,y:0.00005400707033003174},{x:-0.013741724999999105,y:0.004673807344939681},{x:-0.016231262499999087,y:0.009209988928770731},{x:-0.018720799999999073,y:0.013649933595881476},{x:-0.021210337499999055,y:0.017981616452923805},{x:-0.023699874999999038,y:0.022193680076609393},{x:-0.026189412499999024,y:0.026275504536001},{x:-0.028678949999999002,y:0.030217272867918137},{x:-0.03116848749999899,y:0.034010031601779636},{x:-0.03365802499999897,y:0.03764574596072702},{x:-0.03614756249999895,y:0.04111734939869574},{x:-0.03863709999999894,y:0.04441878716802149},{x:-0.04112663749999892,y:0.04754505364897295},{x:-0.043616174999998904,y:0.05049222321106203},{x:-0.04610571249999888,y:0.05325747441586117},{x:-0.04859524999999887,y:0.055839107412109526},{x:-0.051084787499998854,y:0.05823655441586117},{x:-0.05357432499999884,y:0.06045038321106201},{x:-0.05606386249999881,y:0.06248229364897292},{x:-0.0585533999999988,y:0.06433510716802145},{x:-0.061042937499998784,y:0.0660127493986957},{x:-0.06353247499999877,y:0.06752022596072697},{x:-0.06602201249999876,y:0.06886359160177957},{x:-0.06851154999999873,y:0.07004991286791806},{x:-0.07100108749999871,y:0.07108722453600091},{x:-0.0734906249999987,y:0.0719844800766093},{x:-0.07598016249999869,y:0.07275149645292371},{x:-0.07846969999999867,y:0.07339889359588138},{x:-0.08095923749999864,y:0.07393802892877062},{x:-0.08344877499999863,y:0.07438092734493956},{x:-0.08593831249999861,y:0.07474020707032991},{x:-0.0884278499999986,y:0.07502900186791804},{x:-0.09091738749999859,y:0.07526088006369888},{x:-0.09340692499999856,y:0.07544976089344414},{x:-0.09589646249999854,y:0.0756098286859853},{x:-0.09838599999999853,y:0.07575544541210943},{x:-0.10087553999999854,y:0.0756098286859853},{x:-0.10336507999999855,y:0.07544976089344414},{x:-0.10585461999999857,y:0.07526088006369887},{x:-0.10834415999999858,y:0.07502900186791804},{x:-0.11083369999999859,y:0.0747402070703299},{x:-0.1133232399999986,y:0.07438092734493956},{x:-0.11581277999999862,y:0.07393802892877062},{x:-0.11830231999999863,y:0.07339889359588138},{x:-0.12079185999999864,y:0.07275149645292371},{x:-0.12328139999999865,y:0.0719844800766093},{x:-0.12577093999999867,y:0.07108722453600091},{x:-0.12826047999999868,y:0.07004991286791806},{x:-0.1307500199999987,y:0.06886359160177957},{x:-0.1332395599999987,y:0.06752022596072697},{x:-0.13572909999999871,y:0.0660127493986957},{x:-0.13821863999999873,y:0.06433510716802145},{x:-0.14070817999999874,y:0.06248229364897291},{x:-0.14319771999999875,y:0.06045038321106202},{x:-0.14568725999999876,y:0.05823655441586117},{x:-0.14817679999999878,y:0.055839107412109526},{x:-0.1506663399999988,y:0.05325747441586117},{x:-0.1531558799999988,y:0.05049222321106202},{x:-0.1556454199999988,y:0.047545053648972956},{x:-0.15813495999999883,y:0.04441878716802149},{x:-0.16062449999999884,y:0.04111734939869574},{x:-0.16311403999999885,y:0.03764574596072702},{x:-0.16560357999999886,y:0.034010031601779636},{x:-0.16809311999999887,y:0.03021727286791814},{x:-0.1705826599999989,y:0.026275504536001},{x:-0.1730721999999989,y:0.022193680076609396},{x:-0.1755617399999989,y:0.017981616452923805},{x:-0.17805127999999892,y:0.013649933595881474},{x:-0.18054081999999894,y:0.00920998892877074},{x:-0.18303035999999895,y:0.0046738073449396865},{x:-0.18551989999999896,y:0.00005400707033003521},{x:-0.18800943999999897,y:-0.004636278132081827},{x:-0.19049897999999899,y:-0.009383479936300985},{x:-0.192988519999999,y:-0.01417367910655569},{x:-0.19547805999999898,y:-0.018992691314014522},{x:-0.19796759999999902,y:-0.02382615458789039}],color:"primary",fill:!1},path8702:{type:"path",points:[{x:0.2003586000000006,y:-0.02382615458789039},{x:0.19786906000000057,y:-0.01899269131401453},{x:0.19537952000000058,y:-0.014173679106555696},{x:0.19288998000000057,y:-0.009383479936300985},{x:0.1904004400000006,y:-0.004636278132081827},{x:0.18791090000000055,y:0.00005400707033003174},{x:0.1854213600000005,y:0.004673807344939681},{x:0.18293182000000052,y:0.009209988928770731},{x:0.1804422800000005,y:0.013649933595881476},{x:0.17795274000000053,y:0.017981616452923805},{x:0.17546320000000049,y:0.022193680076609393},{x:0.17297366000000047,y:0.026275504536001},{x:0.17048412000000046,y:0.030217272867918137},{x:0.16799458000000045,y:0.034010031601779636},{x:0.16550504000000044,y:0.03764574596072702},{x:0.16301550000000042,y:0.04111734939869574},{x:0.1605259600000004,y:0.04441878716802149},{x:0.1580364200000004,y:0.04754505364897295},{x:0.1555468800000004,y:0.05049222321106203},{x:0.15305734000000037,y:0.05325747441586117},{x:0.15056780000000036,y:0.055839107412109526},{x:0.14807826000000035,y:0.05823655441586117},{x:0.14558872000000034,y:0.06045038321106201},{x:0.14309918000000033,y:0.06248229364897292},{x:0.1406096400000003,y:0.06433510716802145},{x:0.1381201000000003,y:0.0660127493986957},{x:0.1356305600000003,y:0.06752022596072697},{x:0.13314102000000028,y:0.06886359160177957},{x:0.13065148000000026,y:0.07004991286791806},{x:0.12816194000000025,y:0.07108722453600091},{x:0.12567240000000024,y:0.0719844800766093},{x:0.12318286000000023,y:0.07275149645292371},{x:0.12069332000000021,y:0.07339889359588138},{x:0.1182037800000002,y:0.07393802892877062},{x:0.11571424000000019,y:0.07438092734493956},{x:0.11322470000000018,y:0.07474020707032991},{x:0.11073516000000017,y:0.07502900186791804},{x:0.10824562000000015,y:0.07526088006369888},{x:0.10575608000000014,y:0.07544976089344414},{x:0.10326654000000013,y:0.0756098286859853},{x:0.10077700000000012,y:0.07575544541210943},{x:0.09828746250000013,y:0.0756098286859853},{x:0.09579792500000014,y:0.07544976089344414},{x:0.09330838750000017,y:0.07526088006369887},{x:0.09081885000000019,y:0.07502900186791804},{x:0.0883293125000002,y:0.0747402070703299},{x:0.08583977500000022,y:0.07438092734493956},{x:0.08335023750000023,y:0.07393802892877062},{x:0.08086070000000026,y:0.07339889359588138},{x:0.07837116250000027,y:0.07275149645292371},{x:0.07588162500000029,y:0.0719844800766093},{x:0.0733920875000003,y:0.07108722453600091},{x:0.07090255000000031,y:0.07004991286791806},{x:0.06841301250000034,y:0.06886359160177957},{x:0.06592347500000036,y:0.06752022596072697},{x:0.06343393750000037,y:0.0660127493986957},{x:0.060944400000000384,y:0.06433510716802145},{x:0.0584548625000004,y:0.06248229364897291},{x:0.05596532500000043,y:0.06045038321106202},{x:0.05347578750000044,y:0.05823655441586117},{x:0.050986250000000455,y:0.055839107412109526},{x:0.04849671250000047,y:0.05325747441586117},{x:0.04600717500000048,y:0.05049222321106202},{x:0.04351763750000051,y:0.047545053648972956},{x:0.041028100000000525,y:0.04441878716802149},{x:0.03853856250000054,y:0.04111734939869574},{x:0.036049025000000554,y:0.03764574596072702},{x:0.03355948750000057,y:0.034010031601779636},{x:0.031069950000000596,y:0.03021727286791814},{x:0.02858041250000061,y:0.026275504536001},{x:0.026090875000000624,y:0.022193680076609396},{x:0.023601337500000638,y:0.017981616452923805},{x:0.021111800000000652,y:0.013649933595881474},{x:0.01862226250000068,y:0.00920998892877074},{x:0.016132725000000694,y:0.0046738073449396865},{x:0.013643187500000709,y:0.00005400707033003521},{x:0.011153650000000723,y:-0.004636278132081827},{x:0.008664112500000737,y:-0.009383479936300985},{x:0.006174575000000764,y:-0.01417367910655569},{x:0.0036850375000007786,y:-0.018992691314014522},{x:0.0011955000000007932,y:-0.02382615458789039}],color:"primary",fill:!1},path8704:{type:"path",points:[{x:0.3995216000000006,y:-0.02382615458789039},{x:0.39703206250000056,y:-0.01899269131401453},{x:0.3945425250000006,y:-0.014173679106555696},{x:0.3920529875000006,y:-0.009383479936300985},{x:0.38956345000000064,y:-0.004636278132081827},{x:0.38707391250000067,y:0.00005400707033003174},{x:0.3845843750000007,y:0.004673807344939681},{x:0.38209483750000073,y:0.009209988928770731},{x:0.37960530000000076,y:0.013649933595881476},{x:0.3771157625000008,y:0.017981616452923805},{x:0.37462622500000076,y:0.022193680076609393},{x:0.37213668750000073,y:0.026275504536001},{x:0.36964715000000076,y:0.030217272867918137},{x:0.3671576125000008,y:0.034010031601779636},{x:0.3646680750000008,y:0.03764574596072702},{x:0.36217853750000084,y:0.04111734939869574},{x:0.3596890000000008,y:0.04441878716802149},{x:0.3571994625000009,y:0.04754505364897295},{x:0.35470992500000087,y:0.05049222321106203},{x:0.35222038750000095,y:0.05325747441586117},{x:0.3497308500000009,y:0.055839107412109526},{x:0.3472413125000009,y:0.05823655441586117},{x:0.344751775000001,y:0.06045038321106201},{x:0.34226223750000095,y:0.06248229364897292},{x:0.33977270000000104,y:0.06433510716802145},{x:0.337283162500001,y:0.0660127493986957},{x:0.334793625000001,y:0.06752022596072697},{x:0.33230408750000107,y:0.06886359160177957},{x:0.3298145500000011,y:0.07004991286791806},{x:0.32732501250000107,y:0.07108722453600091},{x:0.3248354750000011,y:0.0719844800766093},{x:0.3223459375000011,y:0.07275149645292371},{x:0.3198564000000011,y:0.07339889359588138},{x:0.3173668625000012,y:0.07393802892877062},{x:0.31487732500000115,y:0.07438092734493956},{x:0.3123877875000012,y:0.07474020707032991},{x:0.3098982500000012,y:0.07502900186791804},{x:0.30740871250000124,y:0.07526088006369888},{x:0.30491917500000126,y:0.07544976089344414},{x:0.30242963750000124,y:0.0756098286859853},{x:0.29994010000000126,y:0.07575544541210943},{x:0.29745056000000125,y:0.0756098286859853},{x:0.29496102000000124,y:0.07544976089344414},{x:0.2924714800000012,y:0.07526088006369887},{x:0.2899819400000012,y:0.07502900186791804},{x:0.2874924000000012,y:0.0747402070703299},{x:0.2850028600000012,y:0.07438092734493956},{x:0.2825133200000012,y:0.07393802892877062},{x:0.28002378000000117,y:0.07339889359588138},{x:0.27753424000000115,y:0.07275149645292371},{x:0.27504470000000114,y:0.0719844800766093},{x:0.27255516000000113,y:0.07108722453600091},{x:0.2700656200000011,y:0.07004991286791806},{x:0.2675760800000011,y:0.06886359160177957},{x:0.2650865400000011,y:0.06752022596072697},{x:0.2625970000000011,y:0.0660127493986957},{x:0.26010746000000107,y:0.06433510716802145},{x:0.25761792000000105,y:0.06248229364897291},{x:0.25512838000000104,y:0.06045038321106202},{x:0.25263884000000103,y:0.05823655441586117},{x:0.250149300000001,y:0.055839107412109526},{x:0.247659760000001,y:0.05325747441586117},{x:0.245170220000001,y:0.05049222321106202},{x:0.24268068000000098,y:0.047545053648972956},{x:0.24019114000000097,y:0.04441878716802149},{x:0.23770160000000096,y:0.04111734939869574},{x:0.23521206000000094,y:0.03764574596072702},{x:0.23272252000000093,y:0.034010031601779636},{x:0.23023298000000092,y:0.03021727286791814},{x:0.2277434400000009,y:0.026275504536001},{x:0.2252539000000009,y:0.022193680076609396},{x:0.22276436000000088,y:0.017981616452923805},{x:0.22027482000000087,y:0.013649933595881474},{x:0.21778528000000086,y:0.00920998892877074},{x:0.21529574000000085,y:0.0046738073449396865},{x:0.21280620000000083,y:0.00005400707033003521},{x:0.21031666000000082,y:-0.004636278132081827},{x:0.2078271200000008,y:-0.009383479936300985},{x:0.2053375800000008,y:-0.01417367910655569},{x:0.20284804000000078,y:-0.018992691314014522},{x:0.20035850000000077,y:-0.02382615458789039}],color:"primary",fill:!1},path8706:{type:"path",points:[{x:-0.40026109999999937,y:-0.022544054587890106},{x:-0.5272914999999991,y:-0.022544054587890106}],color:"primary",fill:!1},"path8706-5":{type:"path",points:[{x:0.5282280000000006,y:-0.027111054587890093},{x:0.4011975999999997,y:-0.027111054587890093}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-0.0020145999999989783,y:0.22997364541210996},bottom1:{type:"text",text:"{VAL}",x:-0.002185205294839676,y:-0.22997364541210996}},refblocks:{left1:{x:-0.5279125,y:-0.021272154587890446},right1:{x:0.5279125,y:-0.026521254587889898}},bounds:{minX:-0.556070941,maxX:0.556070941,minY:-0.22997364541210996,maxY:0.22997364541210996,width:1.112141882,height:0.4599472908242199,centerX:0,centerY:0},circles:{}},d9o=gn(t1e).rotateRightFacingSymbol("down").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_right",{x:-0.5,y:0}).changeTextAnchor("{VAL}","middle_left",{x:0.5,y:0}).build(),u9o=gn(t1e).rotateRightFacingSymbol("left").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_bottom",{x:0,y:0.5}).changeTextAnchor("{VAL}","middle_top",{x:0,y:-0.5}).build(),p9o=gn(t1e).rotateRightFacingSymbol("right").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_bottom").changeTextAnchor("{VAL}","middle_top").build(),m9o=gn(t1e).rotateRightFacingSymbol("up").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_right").changeTextAnchor("{VAL}","middle_left").build(),p9t={paths:{path11:{type:"path",points:[{x:-0.54,y:-0.06},{x:-0.15,y:-0.06}],color:"primary",fill:!1},path40:{type:"path",points:[{x:0.13,y:-0.05},{x:-0.13,y:-0.18}],color:"primary",fill:!1},path41:{type:"path",points:[{x:-0.13,y:0.08},{x:0.13,y:-0.05}],color:"primary",fill:!1},path42:{type:"path",points:[{x:-0.13,y:-0.18},{x:-0.13,y:0.08}],color:"primary",fill:!1},path43:{type:"path",points:[{x:0.13,y:0.08},{x:0.13,y:-0.18}],color:"primary",fill:!1},path12:{type:"path",points:[{x:0.14,y:-0.05},{x:0.54,y:-0.06}],color:"primary",fill:!1},"path25-0-9-8":{type:"path",points:[{x:-0.03,y:0.39},{x:-0.05,y:0.47},{x:-0.08,y:0.39}],color:"primary",fill:!0},"path78-6-5-5":{type:"path",points:[{x:-0.05,y:0.27},{x:-0.05,y:0.29},{x:-0.05,y:0.41},{x:-0.05,y:0.42}],color:"primary",fill:!1},"path25-0-9-8-2":{type:"path",points:[{x:0.07,y:0.39},{x:0.04,y:0.47},{x:0.02,y:0.39}],color:"primary",fill:!0},"path78-6-5-5-7":{type:"path",points:[{x:0.04,y:0.27},{x:0.04,y:0.29},{x:0.04,y:0.41},{x:0.04,y:0.42}],color:"primary",fill:!1},"path43-1":{type:"path",points:[{x:0.03,y:0.06},{x:0.03,y:-0.16}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:0.38,y:0.38},bottom1:{type:"text",text:"{VAL}",x:0.38,y:-0.47}},refblocks:{left1:{x:-0.54,y:-0.06},right1:{x:0.54,y:-0.06}},bounds:{minX:-0.57,maxX:0.57,minY:-0.47,maxY:0.47,width:1.14,height:0.93,centerX:0,centerY:0},circles:{path1:{type:"circle",x:0,y:-0.05,radius:0.29,color:"primary",fill:!1}}};p9t.bounds.width+=0.2;n1e=gn(p9t).changeTextAnchor("{VAL}","middle_top").labelPort("left1",["1","anode","pos"]).labelPort("right1",["2","cathode","neg"]).changeTextAnchor("{REF}","middle_bottom").build(),Tke=Mo(n1e,"down"),Dke=Tke.primitives.find((e)=>e.type==="text"&&e.text==="{REF}"),Nke=Tke.primitives.find((e)=>e.type==="text"&&e.text==="{VAL}");Dke.anchor="middle_left";Nke.anchor="middle_left";Dke.y+=0.9;Dke.x=0.3;Nke.y-=0.1;Nke.x=0.3;_9o=Tke,Rke=Mo(n1e,"left"),Qke=Rke.primitives.find((e)=>e.type==="text"&&e.text==="{REF}"),kke=Rke.primitives.find((e)=>e.type==="text"&&e.text==="{VAL}");Qke.anchor="middle_left";kke.anchor="middle_left";Qke.y+=0.71;Qke.x=0.44;kke.y-=0.71;kke.x=0.44;g9o=Rke,Lke=Mo(n1e,"up"),Hke=Lke.primitives.find((e)=>e.type==="text"&&e.text==="{REF}"),Fke=Lke.primitives.find((e)=>e.type==="text"&&e.text==="{VAL}");Hke.anchor="middle_left";Fke.anchor="middle_left";Hke.y+=0.1;Hke.x=0.3;Fke.y-=0.71;Fke.x=0.3;A9o=Lke,f9o={paths:{path45:{type:"path",points:[{x:0.14,y:0},{x:-0.13,y:-0.14}],color:"primary",fill:!1},"path1-8":{type:"path",points:[{x:0.13,y:0},{x:0.54,y:0}],color:"primary",fill:!1},path46:{type:"path",points:[{x:-0.13,y:0.13},{x:0.14,y:0}],color:"primary",fill:!1},path47:{type:"path",points:[{x:-0.13,y:-0.14},{x:-0.13,y:0.13}],color:"primary",fill:!1},path48:{type:"path",points:[{x:0.14,y:0.13},{x:0.14,y:-0.14}],color:"primary",fill:!1},path49:{type:"path",points:[{x:-0.13,y:0},{x:-0.54,y:0}],color:"primary",fill:!1},path25:{type:"path",points:[{x:0.16,y:0.29},{x:0.25,y:0.3},{x:0.22,y:0.21}],color:"primary",fill:!0},path78:{type:"path",points:[{x:0.08,y:0.17},{x:0.09,y:0.17},{x:0.21,y:0.27},{x:0.21,y:0.27}],color:"primary",fill:!1},"path25-0":{type:"path",points:[{x:-0.02,y:0.31},{x:0.08,y:0.32},{x:0.04,y:0.23}],color:"primary",fill:!0},"path78-6":{type:"path",points:[{x:-0.1,y:0.19},{x:-0.09,y:0.2},{x:0.04,y:0.29},{x:0.04,y:0.29}],color:"primary",fill:!1}},texts:{bottom1:{type:"text",text:"{VAL}",x:0,y:-0.21},right1:{type:"text",text:"{REF}",x:0,y:0.41}},refblocks:{left1:{x:-0.54,y:0},right1:{x:0.54,y:0}},bounds:{minX:-0.56,maxX:0.56,minY:-0.32,maxY:0.32,width:1.13,height:0.65,centerX:0,centerY:0},circles:{}},{paths:y9o,texts:Y6t,bounds:Hfe,refblocks:G6t,circles:x9o}=f9o,zke=yl({primitives:[...Object.values(y9o),...Object.values(x9o),{...Y6t.bottom1,anchor:"middle_top"},{...Y6t.right1,anchor:"middle_bottom"}],ports:[{...G6t.left1,labels:["1","anode","pos"]},{...G6t.right1,labels:["2","cathode","neg"]}],size:{width:Hfe.width,height:Hfe.height},center:{x:Hfe.centerX,y:Hfe.centerY}}),Oke=Mo(zke,"up"),Vke=Oke.primitives.find((e)=>e.type==="text"&&e.text==="{REF}"),Yke=Oke.primitives.find((e)=>e.type==="text"&&e.text==="{VAL}");Vke.anchor="middle_left";Yke.anchor="middle_left";Vke.y+=0.21;Vke.x=0.21;Yke.y-=0.21;Yke.x=0.21;m9t=Oke,Gke=UX(m9t),Uke=Gke.primitives.find((e)=>e.type==="text"&&e.text==="{REF}"),Wke=Gke.primitives.find((e)=>e.type==="text"&&e.text==="{VAL}");Uke.anchor="middle_left";Wke.anchor="middle_left";Uke.y+=0.4;Uke.x=0.2;Wke.y-=0.41;Wke.x=0.2;C9o=Gke,b9o=wI(zke),o1e={paths:{"anode-lead":{type:"path",points:[{x:-0.25,y:0},{x:-0.11999999999999988,y:0}],color:"primary",fill:!1},body:{type:"path",points:[{x:-0.11999999999999988,y:0.11999999999999988},{x:0.1200000000000001,y:0},{x:-0.11999999999999988,y:-0.1200000000000001},{x:-0.11999999999999988,y:0.11999999999999988}],color:"primary",fill:!1},"cathode-bar":{type:"path",points:[{x:0.1200000000000001,y:0.11999999999999988},{x:0.1200000000000001,y:-0.1200000000000001}],color:"primary",fill:!1},"cathode-lead":{type:"path",points:[{x:0.1200000000000001,y:0},{x:0.25,y:0}],color:"primary",fill:!1},"emission-0-shaft":{type:"path",points:[{x:-0.11999999999999988,y:0.15999999999999992},{x:-0.030000000000000027,y:0.29000000000000004}],color:"primary",fill:!1},"emission-0-head":{type:"path",points:[{x:-0.08499999999999996,y:0.2699999999999998},{x:-0.030000000000000027,y:0.29000000000000004},{x:-0.030000000000000027,y:0.22999999999999998}],color:"primary",fill:!1},"emission-1-shaft":{type:"path",points:[{x:0,y:0.15999999999999992},{x:0.09000000000000008,y:0.29000000000000004}],color:"primary",fill:!1},"emission-1-head":{type:"path",points:[{x:0.03500000000000014,y:0.2699999999999998},{x:0.09000000000000008,y:0.29000000000000004},{x:0.09000000000000008,y:0.22999999999999998}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:0,y:0.3999999999999999},bottom1:{type:"text",text:"{VAL}",x:0,y:-0.40000000000000013}},refblocks:{left1:{x:-0.25,y:0},right1:{x:0.25,y:0}},bounds:{minX:-0.25,maxX:0.25,minY:-0.40000000000000013,maxY:0.3999999999999999,width:0.5,height:0.8,centerX:0,centerY:-0.00000000000000011102230246251565},circles:{}},I9o=Di(o1e,{kind:"led",orientation:"down",pin1Labels:["1","pos","anode"],pin2Labels:["2","neg","cathode"]}),v9o=Di(o1e,{kind:"led",orientation:"left",pin1Labels:["1","pos","anode"],pin2Labels:["2","neg","cathode"]}),S9o=Di(o1e,{kind:"led",orientation:"right",pin1Labels:["1","pos","anode"],pin2Labels:["2","neg","cathode"]}),P9o=Di(o1e,{kind:"led",orientation:"up",pin1Labels:["1","pos","anode"],pin2Labels:["2","neg","cathode"]}),r1e={paths:{"anode-lead":{type:"path",points:[{x:-0.17499999999999982,y:0},{x:-0.09999999999999987,y:0}],color:"primary",fill:!1},body:{type:"path",points:[{x:-0.09999999999999987,y:0.09999999999999987},{x:0.10000000000000009,y:0},{x:-0.09999999999999987,y:-0.10000000000000009},{x:-0.09999999999999987,y:0.09999999999999987}],color:"primary",fill:!1},"cathode-bar":{type:"path",points:[{x:0.10000000000000009,y:0.09999999999999987},{x:0.10000000000000009,y:-0.10000000000000009}],color:"primary",fill:!1},"cathode-lead":{type:"path",points:[{x:0.10000000000000009,y:0},{x:0.17500000000000004,y:0}],color:"primary",fill:!1},"emission-0-shaft":{type:"path",points:[{x:-0.11999999999999988,y:0.15999999999999992},{x:-0.030000000000000027,y:0.29000000000000004}],color:"primary",fill:!1},"emission-0-head":{type:"path",points:[{x:-0.08499999999999996,y:0.2699999999999998},{x:-0.030000000000000027,y:0.29000000000000004},{x:-0.030000000000000027,y:0.22999999999999998}],color:"primary",fill:!1},"emission-1-shaft":{type:"path",points:[{x:0,y:0.15999999999999992},{x:0.09000000000000008,y:0.29000000000000004}],color:"primary",fill:!1},"emission-1-head":{type:"path",points:[{x:0.03500000000000014,y:0.2699999999999998},{x:0.09000000000000008,y:0.29000000000000004},{x:0.09000000000000008,y:0.22999999999999998}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:0,y:0.3999999999999999},bottom1:{type:"text",text:"{VAL}",x:0,y:-0.40000000000000013}},refblocks:{left1:{x:-0.17499999999999982,y:0},right1:{x:0.17500000000000004,y:0}},bounds:{minX:-0.17499999999999982,maxX:0.17500000000000004,minY:-0.40000000000000013,maxY:0.3999999999999999,width:0.34999999999999987,height:0.8,centerX:0.00000000000000011102230246251565,centerY:-0.00000000000000011102230246251565},circles:{}},E9o=Di(r1e,{kind:"led",orientation:"down",pin1Labels:["1","pos","anode"],pin2Labels:["2","neg","cathode"]}),M9o=Di(r1e,{kind:"led",orientation:"left",pin1Labels:["1","pos","anode"],pin2Labels:["2","neg","cathode"]}),w9o=Di(r1e,{kind:"led",orientation:"right",pin1Labels:["1","pos","anode"],pin2Labels:["2","neg","cathode"]}),B9o=Di(r1e,{kind:"led",orientation:"up",pin1Labels:["1","pos","anode"],pin2Labels:["2","neg","cathode"]}),T9o={paths:{path11:{type:"path",points:[{x:-0.52,y:-0.01},{x:-0.18,y:-0.01}],color:"primary",fill:!1},"path11-2":{type:"path",points:[{x:-0.17,y:-0.11},{x:-0.17,y:0.08}],color:"primary",fill:!1},"path11-5":{type:"path",points:[{x:-0.17,y:-0.12},{x:0.16,y:-0.12}],color:"primary",fill:!1},"path11-5-5":{type:"path",points:[{x:-0.17,y:0.08},{x:0.16,y:0.08}],color:"primary",fill:!1},path12:{type:"path",points:[{x:0.17,y:-0.01},{x:0.52,y:-0.01}],color:"primary",fill:!1},"path11-2-1":{type:"path",points:[{x:0.16,y:-0.12},{x:0.16,y:0.08}],color:"primary",fill:!1},"path25-0-9":{type:"path",points:[{x:-0.4,y:-0.21},{x:-0.33,y:-0.18},{x:-0.34,y:-0.27}],color:"primary",fill:!0},"path78-6-5":{type:"path",points:[{x:-0.45,y:-0.34},{x:-0.44,y:-0.32},{x:-0.35,y:-0.22},{x:-0.35,y:-0.22}],color:"primary",fill:!1},"path25-0-9-0":{type:"path",points:[{x:-0.3,y:-0.34},{x:-0.22,y:-0.31},{x:-0.24,y:-0.4}],color:"primary",fill:!0},"path78-6-5-9":{type:"path",points:[{x:-0.35,y:-0.46},{x:-0.34,y:-0.45},{x:-0.25,y:-0.35},{x:-0.25,y:-0.35}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-0.17,y:-0.41},bottom1:{type:"text",text:"{VAL}",x:-0.01,y:0.46}},refblocks:{left1:{x:-0.52,y:-0.01},right1:{x:0.52,y:-0.01}},bounds:{minX:-0.55,maxX:0.55,minY:-0.51,maxY:0.46,width:1.1,height:0.62,centerX:0,centerY:-0.02},circles:{path1:{type:"circle",x:0,y:-0.02,radius:0.28,color:"primary",fill:!1}}},{paths:D9o,texts:U6t,bounds:Ffe,refblocks:W6t,circles:N9o}=T9o,_9t=yl({primitives:[...Object.values(D9o),...Object.values(N9o),{...U6t.top1,anchor:"middle_left",x:0},{...U6t.bottom1,anchor:"middle_left",x:0}],ports:[{...W6t.left1,labels:["1"]},{...W6t.right1,labels:["2"]}],size:{width:Ffe.width,height:Ffe.height},center:{x:Ffe.centerX,y:Ffe.centerY}}),g9t=Mo(_9t),A9t=g9t.primitives.filter((e)=>e.type==="text"),Xke=A9t.find((e)=>e.text==="{VAL}");Xke.x=-0.35;Xke.y=0;Xke.anchor="middle_right";jke=A9t.find((e)=>e.text==="{REF}");jke.y=0;jke.x=0.35;jke.anchor="middle_left";R9o=g9t,Q9o={paths:{path208:{type:"path",points:[{x:0.38,y:0.13},{x:0.52,y:-0.13}],color:"primary",fill:!1},path209:{type:"path",points:[{x:0.25,y:-0.13},{x:0.38,y:0.13}],color:"primary",fill:!1},path210:{type:"path",points:[{x:0.52,y:-0.13},{x:0.25,y:-0.13}],color:"primary",fill:!1},path211:{type:"path",points:[{x:0.25,y:0.13},{x:0.52,y:0.13}],color:"primary",fill:!1},path212:{type:"path",points:[{x:0.12,y:-0.4},{x:0.38,y:-0.4}],color:"primary",fill:!1},path213:{type:"path",points:[{x:0.38,y:0.4},{x:0.12,y:0.4}],color:"primary",fill:!1},path214:{type:"path",points:[{x:0.12,y:0.54},{x:0.12,y:0.18}],color:"primary",fill:!1},path215:{type:"path",points:[{x:0.12,y:-0.54},{x:0.12,y:0}],color:"primary",fill:!1},path216:{type:"path",points:[{x:0.38,y:-0.4},{x:0.38,y:0.4}],color:"primary",fill:!1},path217:{type:"path",points:[{x:-0.14,y:0.26},{x:-0.14,y:-0.27}],color:"primary",fill:!1},path218:{type:"path",points:[{x:-0.22,y:-0.27},{x:-0.22,y:0.26}],color:"primary",fill:!1},path219:{type:"path",points:[{x:-0.54,y:-0.27},{x:-0.22,y:-0.27}],color:"primary",fill:!1},path220:{type:"path",points:[{x:-0.14,y:-0.19},{x:0.12,y:-0.19}],color:"primary",fill:!1},path221:{type:"path",points:[{x:-0.14,y:0.18},{x:0.12,y:0.18}],color:"primary",fill:!1},path222:{type:"path",points:[{x:-0.07,y:0},{x:0.12,y:0}],color:"primary",fill:!1}},texts:{right1:{type:"text",text:"{VAL}",x:0.57,y:0.02},right2:{type:"text",text:"{REF}",x:0.57,y:0.21}},refblocks:{top1:{x:0.12,y:0.54},bottom1:{x:0.12,y:-0.54},left1:{x:-0.54,y:-0.27}},bounds:{minX:-0.57,maxX:0.57,minY:-0.57,maxY:0.57,width:1.14,height:1.14,centerX:0,centerY:0},circles:{}};({paths:k9o,texts:X6t,bounds:j6t,refblocks:OX}=Q9o),K6t={x:j6t.centerX+0.2,y:j6t.centerY},f9t=yl({primitives:[...Object.values(k9o),{...X6t.right1,anchor:"middle_left"},{...X6t.right2,anchor:"middle_left"}],ports:[{...OX.top1,labels:["1"]},{...OX.bottom1,labels:["2"]},{...OX.left1,labels:["3"]}],size:Ure(K6t,[OX.top1,OX.bottom1,OX.left1]),center:K6t}),Kke=Mo(f9t),y9t=Kke.primitives.find((e)=>e.type==="text"&&e.text==="{REF}"),$ke=Kke.primitives.find((e)=>e.type==="text"&&e.text==="{VAL}");y9t.anchor="middle_top";$ke.anchor="middle_top";y9t.x=$ke.x;$ke.y+=0.15;L9o=Kke,H9o={paths:{"path12-1-8-6-9":{type:"path",points:[{x:0.01,y:0.07},{x:0.01,y:-0.01}],color:"primary",fill:!1},"path12-1-5-6":{type:"path",points:[{x:-0.47,y:-0.09},{x:-0.17,y:-0.09}],color:"primary",fill:!1},"path12-1-8-0":{type:"path",points:[{x:-0.16,y:-0.01},{x:0.17,y:-0.01}],color:"primary",fill:!1},"path12-1-0":{type:"path",points:[{x:0.2,y:-0.09},{x:0.47,y:-0.09}],color:"primary",fill:!1},path2:{type:"path",points:[{x:-0.1,y:0.06},{x:-0.1,y:0.06},{x:-0.1,y:0.07},{x:-0.1,y:0.07},{x:-0.1,y:0.07},{x:-0.1,y:0.08},{x:-0.1,y:0.08},{x:-0.1,y:0.08},{x:-0.1,y:0.09},{x:-0.09,y:0.09},{x:-0.09,y:0.09},{x:-0.09,y:0.1},{x:-0.09,y:0.1},{x:-0.09,y:0.1},{x:-0.09,y:0.1},{x:-0.09,y:0.11},{x:-0.09,y:0.11},{x:-0.08,y:0.11},{x:-0.08,y:0.12},{x:-0.08,y:0.12},{x:-0.08,y:0.12},{x:-0.08,y:0.12},{x:-0.07,y:0.13},{x:-0.07,y:0.13},{x:-0.07,y:0.13},{x:-0.07,y:0.13},{x:-0.06,y:0.14},{x:-0.06,y:0.14},{x:-0.06,y:0.14},{x:-0.06,y:0.14},{x:-0.05,y:0.14},{x:-0.05,y:0.15},{x:-0.05,y:0.15},{x:-0.04,y:0.15},{x:-0.04,y:0.15},{x:-0.04,y:0.15},{x:-0.04,y:0.15},{x:-0.03,y:0.16},{x:-0.03,y:0.16},{x:-0.03,y:0.16},{x:-0.02,y:0.16},{x:-0.02,y:0.16},{x:-0.02,y:0.16},{x:-0.01,y:0.16},{x:-0.01,y:0.16},{x:0,y:0.16},{x:0,y:0.16},{x:0,y:0.16},{x:0.01,y:0.16},{x:0.01,y:0.16},{x:0.01,y:0.16},{x:0.02,y:0.16},{x:0.02,y:0.16},{x:0.02,y:0.16},{x:0.03,y:0.16},{x:0.03,y:0.16},{x:0.03,y:0.16},{x:0.04,y:0.16},{x:0.04,y:0.16},{x:0.04,y:0.16},{x:0.05,y:0.15},{x:0.05,y:0.15},{x:0.05,y:0.15},{x:0.06,y:0.15},{x:0.06,y:0.15},{x:0.06,y:0.15},{x:0.06,y:0.14},{x:0.07,y:0.14},{x:0.07,y:0.14},{x:0.07,y:0.14},{x:0.08,y:0.14},{x:0.08,y:0.13},{x:0.08,y:0.13},{x:0.08,y:0.13},{x:0.09,y:0.13},{x:0.09,y:0.12},{x:0.09,y:0.12},{x:0.09,y:0.12},{x:0.09,y:0.12},{x:0.1,y:0.11},{x:0.1,y:0.11},{x:0.1,y:0.1},{x:0.1,y:0.1},{x:0.11,y:0.09},{x:0.11,y:0.09},{x:0.11,y:0.09},{x:0.11,y:0.08},{x:0.11,y:0.08},{x:0.11,y:0.08},{x:0.11,y:0.07},{x:0.11,y:0.07},{x:0.11,y:0.07},{x:0.11,y:0.06},{x:0.11,y:0.06},{x:0.1,y:0.06},{x:0.1,y:0.06},{x:0.09,y:0.06},{x:0.09,y:0.06},{x:0.08,y:0.06},{x:0.07,y:0.06},{x:0.07,y:0.06},{x:0.06,y:0.06},{x:0.05,y:0.06},{x:0.05,y:0.06},{x:0.04,y:0.06},{x:0.03,y:0.06},{x:0.03,y:0.06},{x:0.02,y:0.06},{x:0.01,y:0.06},{x:0.01,y:0.06},{x:0,y:0.06},{x:-0.01,y:0.06},{x:-0.01,y:0.06},{x:-0.02,y:0.06},{x:-0.03,y:0.06},{x:-0.03,y:0.06},{x:-0.04,y:0.06},{x:-0.05,y:0.06},{x:-0.05,y:0.06},{x:-0.06,y:0.06},{x:-0.07,y:0.06},{x:-0.07,y:0.06},{x:-0.08,y:0.06},{x:-0.09,y:0.06},{x:-0.09,y:0.06}],color:"primary",fill:!0}},texts:{top1:{type:"text",text:"{REF}",x:0.01,y:0.27},bottom1:{type:"text",text:"{VAL}",x:-0.16,y:-0.27}},refblocks:{left1:{x:-0.47,y:-0.09},right1:{x:0.47,y:-0.09}},bounds:{minX:-0.5,maxX:0.5,minY:-0.27,maxY:0.27,width:1,height:0.53,centerX:0,centerY:0},circles:{}},{paths:F9o,texts:$6t,bounds:zfe,refblocks:q6t,circles:z9o}=H9o,x9t=yl({primitives:[...Object.values(F9o),...Object.values(z9o),{...$6t.top1,anchor:"middle_bottom",x:0},{...$6t.bottom1,anchor:"middle_top",x:0}],ports:[{...q6t.left1,labels:["1"]},{...q6t.right1,labels:["2"]}],size:{width:zfe.width,height:zfe.height},center:{x:zfe.centerX+0.006,y:zfe.centerY+0.06}}),qke=Mo(x9t),Ore=qke.primitives.find((e)=>e.type==="text"&&e.text==="{REF}"),B2e=qke.primitives.find((e)=>e.type==="text"&&e.text==="{VAL}");Ore.anchor="middle_left";B2e.anchor="middle_right";Ore.x=Ore.x-0.03;Ore.y=Ore.y;B2e.x=B2e.x;B2e.y=0;O9o=qke,V9o={paths:{path11:{type:"path",points:[{x:-0.42,y:-0.1},{x:0.05,y:-0.11}],color:"primary",fill:!1},path40:{type:"path",points:[{x:0.09,y:0.19},{x:0.09,y:-0.18}],color:"primary",fill:!1},"path12-1":{type:"path",points:[{x:0.3,y:0.55},{x:0.3,y:0.11}],color:"primary",fill:!1},"path12-1-5":{type:"path",points:[{x:0.31,y:-0.55},{x:0.31,y:-0.01}],color:"primary",fill:!1},path2:{type:"path",points:[{x:0.09,y:0.11},{x:0.31,y:0.11}],color:"primary",fill:!1},"path2-5":{type:"path",points:[{x:0.09,y:-0.1},{x:0.31,y:-0.1}],color:"primary",fill:!1},path15:{type:"path",points:[{x:0.27,y:-0.04},{x:0.27,y:0.03},{x:0.2,y:0},{x:0.27,y:-0.04}],color:"primary",fill:!0},"path2-0":{type:"path",points:[{x:0.09,y:0},{x:0.31,y:-0.01}],color:"primary",fill:!1},"path12-1-0":{type:"path",points:[{x:0.05,y:0.17},{x:0.05,y:-0.11}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-0.13,y:0.36},bottom1:{type:"text",text:"{VAL}",x:0.06,y:-0.42}},refblocks:{top1:{x:0.3,y:0.55},bottom1:{x:0.31,y:-0.55},left1:{x:-0.42,y:-0.1}},bounds:{minX:-0.45,maxX:0.45,minY:-0.58,maxY:0.58,width:0.89,height:1.16,centerX:0,centerY:0},circles:{path1:{type:"circle",x:0.16,y:0,radius:0.29,color:"primary",fill:!1}}},{paths:Y9o,texts:J6t,bounds:Z6t,refblocks:rz,circles:G9o}=V9o,C9t={x:Z6t.centerX,y:Z6t.centerY},U9o={x:C9t.x,y:rz.left1.y},n7=yl({primitives:[...Object.values(Y9o),...Object.values(G9o),{...J6t.top1,anchor:"middle_right",x:0},{...J6t.bottom1,anchor:"middle_right",x:0}],ports:[{...rz.top1,labels:["1","drain"]},{...rz.bottom1,labels:["2","source"]},{...rz.left1,labels:["3","gate"]}],size:Ure(C9t,[rz.top1,rz.bottom1,rz.left1]),center:U9o}),b9t=Mo(n7),I9t=b9t.primitives.filter((e)=>e.type==="text"),Jke=I9t.find((e)=>e.text==="{VAL}");Jke.x=-0.35;Jke.y=0;Jke.anchor="middle_right";Zke=I9t.find((e)=>e.text==="{REF}");Zke.y=0;Zke.x=0.35;Zke.anchor="middle_left";IM=b9t,W9o=Ml({horizontalSymbol:n7,verticalSymbol:IM,gateSide:"bottom",drainSide:"left"}),X9o=Ml({horizontalSymbol:n7,verticalSymbol:IM,gateSide:"bottom",drainSide:"right"}),j9o=Ml({horizontalSymbol:n7,verticalSymbol:IM,gateSide:"left",drainSide:"bottom"}),K9o=Ml({horizontalSymbol:n7,verticalSymbol:IM,gateSide:"left",drainSide:"top"}),$9o=Ml({horizontalSymbol:n7,verticalSymbol:IM,gateSide:"right",drainSide:"bottom"}),q9o=Ml({horizontalSymbol:n7,verticalSymbol:IM,gateSide:"right",drainSide:"top"}),J9o=Ml({horizontalSymbol:n7,verticalSymbol:IM,gateSide:"top",drainSide:"left"}),Z9o=Ml({horizontalSymbol:n7,verticalSymbol:IM,gateSide:"top",drainSide:"right"}),evo={paths:{path11:{type:"path",points:[{x:-0.42,y:-0.1},{x:0.05,y:-0.11}],color:"primary",fill:!1},"path12-1":{type:"path",points:[{x:0.3,y:0.55},{x:0.3,y:0.11}],color:"primary",fill:!1},"path12-1-5":{type:"path",points:[{x:0.31,y:-0.55},{x:0.31,y:-0.01}],color:"primary",fill:!1},path2:{type:"path",points:[{x:0.09,y:0.11},{x:0.31,y:0.11}],color:"primary",fill:!1},"path2-8-3-7":{type:"path",points:[{x:0.09,y:0.15},{x:0.09,y:0.07}],color:"primary",fill:!1},"path2-5":{type:"path",points:[{x:0.09,y:-0.1},{x:0.31,y:-0.1}],color:"primary",fill:!1},"path2-8-3":{type:"path",points:[{x:0.09,y:-0.08},{x:0.09,y:-0.15}],color:"primary",fill:!1},"path2-8-3-2":{type:"path",points:[{x:0.09,y:0.03},{x:0.09,y:-0.04}],color:"primary",fill:!1},path15:{type:"path",points:[{x:0.27,y:-0.04},{x:0.27,y:0.03},{x:0.2,y:0},{x:0.27,y:-0.04}],color:"primary",fill:!0},"path2-0":{type:"path",points:[{x:0.09,y:0},{x:0.31,y:-0.01}],color:"primary",fill:!1},"path12-1-0":{type:"path",points:[{x:0.05,y:0.11},{x:0.05,y:-0.11}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-0.13,y:0.36},bottom1:{type:"text",text:"{VAL}",x:0.06,y:-0.42}},refblocks:{top1:{x:0.3,y:0.55},bottom1:{x:0.31,y:-0.55},left1:{x:-0.42,y:-0.1}},bounds:{minX:-0.45,maxX:0.45,minY:-0.58,maxY:0.58,width:0.89,height:1.16,centerX:0,centerY:0},circles:{path1:{type:"circle",x:0.16,y:0,radius:0.29,color:"primary",fill:!1}}},{paths:tvo,texts:eIt,bounds:tIt,refblocks:VX,circles:nvo}=evo,nIt={x:tIt.centerX,y:tIt.centerY},o7=yl({primitives:[...Object.values(tvo),...Object.values(nvo),{...eIt.top1,anchor:"middle_right",x:0},{...eIt.bottom1,anchor:"middle_right",x:0}],ports:[{...VX.top1,labels:["1","drain"]},{...VX.bottom1,labels:["2","source"]},{...VX.left1,labels:["3","gate"]}],size:Ure(nIt,[VX.top1,VX.bottom1,VX.left1]),center:nIt}),v9t=Mo(o7),S9t=v9t.primitives.filter((e)=>e.type==="text"),eLe=S9t.find((e)=>e.text==="{VAL}");eLe.x=-0.35;eLe.y=0;eLe.anchor="middle_right";tLe=S9t.find((e)=>e.text==="{REF}");tLe.y=0;tLe.x=0.35;tLe.anchor="middle_left";vM=v9t,ovo=Ml({horizontalSymbol:o7,verticalSymbol:vM,gateSide:"bottom",drainSide:"left"}),rvo=Ml({horizontalSymbol:o7,verticalSymbol:vM,gateSide:"bottom",drainSide:"right"}),ivo=Ml({horizontalSymbol:o7,verticalSymbol:vM,gateSide:"left",drainSide:"bottom"}),svo=Ml({horizontalSymbol:o7,verticalSymbol:vM,gateSide:"left",drainSide:"top"}),avo=Ml({horizontalSymbol:o7,verticalSymbol:vM,gateSide:"right",drainSide:"bottom"}),cvo=Ml({horizontalSymbol:o7,verticalSymbol:vM,gateSide:"right",drainSide:"top"}),lvo=Ml({horizontalSymbol:o7,verticalSymbol:vM,gateSide:"top",drainSide:"left"}),hvo=Ml({horizontalSymbol:o7,verticalSymbol:vM,gateSide:"top",drainSide:"right"}),dvo={paths:{path11:{type:"path",points:[{x:-0.4,y:0},{x:0.06,y:-0.01}],color:"primary",fill:!1},path40:{type:"path",points:[{x:0.07,y:0.19},{x:0.07,y:-0.18}],color:"primary",fill:!1},"path12-1":{type:"path",points:[{x:0.28,y:0.55},{x:0.28,y:0.11}],color:"primary",fill:!1},"path12-1-5":{type:"path",points:[{x:0.29,y:-0.55},{x:0.29,y:-0.1}],color:"primary",fill:!1},path2:{type:"path",points:[{x:0.07,y:0.11},{x:0.29,y:0.11}],color:"primary",fill:!1},"path2-5":{type:"path",points:[{x:0.07,y:-0.1},{x:0.29,y:-0.1}],color:"primary",fill:!1},path15:{type:"path",points:[{x:-0.08,y:0.06},{x:-0.08,y:-0.07},{x:0.01,y:0},{x:-0.08,y:0.06}],color:"primary",fill:!0}},texts:{top1:{type:"text",text:"{REF}",x:-0.15,y:0.36},bottom1:{type:"text",text:"{VAL}",x:0.04,y:-0.42}},refblocks:{top1:{x:0.28,y:0.55},bottom1:{x:0.29,y:-0.55},left1:{x:-0.4,y:0}},bounds:{minX:-0.43,maxX:0.43,minY:-0.58,maxY:0.58,width:0.85,height:1.16,centerX:0,centerY:0},circles:{path1:{type:"circle",x:0.14,y:0,radius:0.29,color:"primary",fill:!1}}},{paths:uvo,texts:oIt,bounds:Ofe,refblocks:iQe,circles:pvo}=dvo,P9t=yl({primitives:[...Object.values(uvo),...Object.values(pvo),{...oIt.top1,anchor:"middle_right",x:0},{...oIt.bottom1,anchor:"middle_right",x:0}],ports:[{...iQe.top1,labels:["1","drain"]},{...iQe.bottom1,labels:["2","source"]},{...iQe.left1,labels:["3","gate"]}],size:{width:Ofe.width,height:Ofe.height},center:{x:Ofe.centerX,y:Ofe.centerY}}),E9t=Mo(P9t),M9t=E9t.primitives.filter((e)=>e.type==="text"),nLe=M9t.find((e)=>e.text==="{VAL}");nLe.x=-0.35;nLe.y=0;nLe.anchor="middle_right";oLe=M9t.find((e)=>e.text==="{REF}");oLe.y=0;oLe.x=0.35;oLe.anchor="middle_left";mvo=E9t,_vo={paths:{diag1:{type:"path",points:[{x:-0.1,y:-0.1},{x:0.1,y:0.1}],color:"primary",fill:!1},diag2:{type:"path",points:[{x:-0.1,y:0.1},{x:0.1,y:-0.1}],color:"primary",fill:!1},stem:{type:"path",points:[{x:-0.2,y:0},{x:0,y:0}],color:"primary",fill:!1}},texts:{},refblocks:{left1:{x:-0.2,y:0}},bounds:{minX:-0.19,maxX:0.2,minY:-0.12,maxY:0.12,width:0.39,height:0.24,centerX:0,centerY:0},circles:{}},{paths:gvo,bounds:rIt,refblocks:Avo}=_vo,i1e=gn({primitives:[...Object.values(gvo)],ports:[{...Avo.left1,labels:["1"]}],center:{x:rIt.centerX,y:rIt.centerY}}).rotateRightFacingSymbol("right").labelPort("left1",["1"]).build(),fvo=Mo(i1e,"down"),yvo=Mo(i1e,"left"),xvo=Mo(i1e,"up"),ej={paths:{path11:{type:"path",points:[{x:-0.4,y:0},{x:0.06,y:-0.01}],color:"primary",fill:!1},"path40-0":{type:"path",points:[{x:0.07,y:0.27},{x:0.07,y:-0.28}],color:"primary",fill:!1},"path40-0-5":{type:"path",points:[{x:0.28,y:0.24},{x:0.08,y:0.11}],color:"primary",fill:!1},"path40-0-5-0":{type:"path",points:[{x:0.29,y:-0.24},{x:0.09,y:-0.11}],color:"primary",fill:!1},"path12-1-5":{type:"path",points:[{x:0.29,y:0.25},{x:0.29,y:0.55}],color:"primary",fill:!1},"path12-1-5-3":{type:"path",points:[{x:0.29,y:-0.55},{x:0.29,y:-0.25}],color:"primary",fill:!1},path15:{type:"path",points:[{x:0.19,y:-0.1},{x:0.12,y:-0.2},{x:0.22,y:-0.2},{x:0.19,y:-0.1}],color:"primary",fill:!0}},texts:{top1:{type:"text",text:"{REF}",x:-0.08,y:0.36},bottom1:{type:"text",text:"{VAL}",x:-0.07,y:-0.41}},refblocks:{top1:{x:0.29,y:0.55},bottom1:{x:0.29,y:-0.55},left1:{x:-0.4,y:0}},bounds:{minX:-0.43,maxX:0.43,minY:-0.58,maxY:0.58,width:0.85,height:1.16,centerX:0,centerY:0},circles:{"path1-0":{type:"circle",x:0.14,y:0,radius:0.29,color:"primary",fill:!1}}},{paths:Cvo,texts:p2s,bounds:Vfe,refblocks:sQe,circles:bvo}=ej,Ivo=gn({primitives:[...Object.values(Cvo),...Object.values(bvo),{type:"text",text:"{REF}",x:-0.3,y:0.5094553499999995},{type:"text",text:"{VAL}",x:-0.3,y:-0.5094553499999995}],ports:[{...sQe.top1,labels:["1","collector"]},{...sQe.bottom1,labels:["3","emitter"]},{...sQe.left1,labels:["2","base"]}],size:{width:Vfe.width,height:Vfe.height},center:{x:Vfe.centerX,y:Vfe.centerY}}).rotateRightFacingSymbol("right").changeTextAnchor("{REF}","middle_right").changeTextAnchor("{VAL}","middle_right").build(),{paths:vvo,texts:m2s,bounds:Yfe,refblocks:aQe,circles:Svo}=ej,Pvo=gn({primitives:[...Object.values(vvo),...Object.values(Svo),{type:"text",text:"{REF}",x:0.55,y:-0.4094553499999995},{type:"text",text:"{VAL}",x:-0.3,y:-0.4094553499999995}],ports:[{...aQe.top1,labels:["1","collector"]},{...aQe.bottom1,labels:["3","emitter"]},{...aQe.left1,labels:["2","base"]}],size:{width:Yfe.width,height:Yfe.height},center:{x:Yfe.centerX,y:Yfe.centerY}}).rotateRightFacingSymbol("up").changeTextAnchor("{REF}","middle_bottom").changeTextAnchor("{VAL}","middle_top").build(),{paths:Evo,texts:_2s,bounds:Gfe,refblocks:cQe,circles:Mvo}=ej,wvo=gn({primitives:[...Object.values(Evo),...Object.values(Mvo),{type:"text",text:"{REF}",x:-0.5,y:0.3094553499999995},{type:"text",text:"{VAL}",x:0.55,y:0.3094553499999995}],ports:[{...cQe.top1,labels:["1","collector"]},{...cQe.bottom1,labels:["3","emitter"]},{...cQe.left1,labels:["2","base"]}],size:{width:Gfe.width,height:Gfe.height},center:{x:Gfe.centerX,y:Gfe.centerY}}).rotateRightFacingSymbol("down").changeTextAnchor("{REF}","middle_bottom").changeTextAnchor("{VAL}","middle_top").build(),{paths:Bvo,texts:g2s,bounds:Ufe,refblocks:lQe,circles:Tvo}=ej,Dvo=gn({primitives:[...Object.values(Bvo),...Object.values(Tvo),{type:"text",text:"{REF}",x:0.55,y:-0.4094553499999995},{type:"text",text:"{VAL}",x:-0.3,y:-0.4094553499999995}],ports:[{...lQe.top1,labels:["1","collector"]},{...lQe.bottom1,labels:["3","emitter"]},{...lQe.left1,labels:["2","base"]}],size:{width:Ufe.width,height:Ufe.height},center:{x:Ufe.centerX,y:Ufe.centerY}}).rotateRightFacingSymbol("up").changeTextAnchor("{REF}","middle_bottom").changeTextAnchor("{VAL}","middle_top").build(),{paths:Nvo,texts:A2s,bounds:Wfe,refblocks:hQe,circles:Rvo}=ej,Qvo=gn({primitives:[...Object.values(Nvo),...Object.values(Rvo),{type:"text",text:"{REF}",x:-0.3,y:-0.4094553499999995},{type:"text",text:"{VAL}",x:-0.3,y:0.4094553499999995}],ports:[{...hQe.top1,labels:["1","collector"]},{...hQe.bottom1,labels:["3","emitter"]},{...hQe.left1,labels:["2","base"]}],size:{width:Wfe.width,height:Wfe.height},center:{x:Wfe.centerX,y:Wfe.centerY}}).rotateRightFacingSymbol("left").changeTextAnchor("{REF}","middle_left").changeTextAnchor("{VAL}","middle_left").build(),{paths:kvo,texts:f2s,bounds:Xfe,refblocks:dQe,circles:Lvo}=ej,Hvo=gn({primitives:[...Object.values(kvo),...Object.values(Lvo),{type:"text",text:"{REF}",x:-0.3,y:-0.4094553499999995},{type:"text",text:"{VAL}",x:-0.3,y:0.4094553499999995}],ports:[{...dQe.top1,labels:["1","collector"]},{...dQe.bottom1,labels:["3","emitter"]},{...dQe.left1,labels:["2","base"]}],size:{width:Xfe.width,height:Xfe.height},center:{x:Xfe.centerX,y:Xfe.centerY}}).rotateRightFacingSymbol("left").changeTextAnchor("{REF}","middle_left").changeTextAnchor("{VAL}","middle_left").build(),Fvo={paths:{path40:{type:"path",points:[{x:0.14,y:0.04},{x:-0.32,y:-0.21}],color:"primary",fill:!1},path41:{type:"path",points:[{x:-0.32,y:0.31},{x:0.14,y:0.04}],color:"primary",fill:!1},path42:{type:"path",points:[{x:-0.32,y:-0.21},{x:-0.32,y:0.31}],color:"primary",fill:!1},path44:{type:"path",points:[{x:-0.32,y:0.18},{x:-0.57,y:0.18}],color:"primary",fill:!1},path45:{type:"path",points:[{x:-0.32,y:-0.09},{x:-0.57,y:-0.09}],color:"primary",fill:!1},"path44-0":{type:"path",points:[{x:0.43,y:0.04},{x:0.15,y:0.04}],color:"primary",fill:!1},"rect1577-3":{type:"path",points:[{x:-0.19,y:-0.09},{x:-0.27,y:-0.09}],color:"primary",fill:!0},"rect1577-4":{type:"path",points:[{x:-0.19,y:0.18},{x:-0.27,y:0.18}],color:"primary",fill:!0},"rect1577-4-7":{type:"path",points:[{x:-0.23,y:0.14},{x:-0.23,y:0.22}],color:"primary",fill:!0}},texts:{top1:{type:"text",text:"{REF}",x:-0.01,y:0.42},bottom1:{type:"text",text:"{VAL}",x:0,y:-0.3}},refblocks:{left1:{x:-0.57,y:0.18},left2:{x:-0.57,y:-0.09},right1:{x:0.43,y:0.04}},bounds:{minX:-0.57,maxX:0.43,minY:-0.38,maxY:0.27,width:1.09,height:0.3,centerX:-0.07,centerY:0.05},circles:{}},s1e=gn(Fvo).labelPort("left1",["1","inp1"]).labelPort("left2",["2","inp2"]).labelPort("right1",["3","out"]).changeTextAnchor("{REF}","middle_bottom").changeTextAnchor("{VAL}","middle_top").build(),zvo=Mo(s1e,"down"),Ovo=UX(Mo(s1e,"left")),Vvo=Mo(s1e,"up"),Yvo={paths:{path40:{type:"path",points:[{x:0.14,y:0.04},{x:-0.32,y:-0.21}],color:"primary",fill:!1},path41:{type:"path",points:[{x:-0.32,y:0.31},{x:0.14,y:0.04}],color:"primary",fill:!1},path42:{type:"path",points:[{x:-0.32,y:-0.21},{x:-0.32,y:0.31}],color:"primary",fill:!1},path44:{type:"path",points:[{x:-0.32,y:0.18},{x:-0.57,y:0.18}],color:"primary",fill:!1},path45:{type:"path",points:[{x:-0.32,y:-0.09},{x:-0.57,y:-0.09}],color:"primary",fill:!1},"path44-0":{type:"path",points:[{x:0.43,y:0.04},{x:0.15,y:0.04}],color:"primary",fill:!1},"path44-1":{type:"path",points:[{x:-0.1,y:0.44},{x:-0.1,y:0.18}],color:"primary",fill:!1},"path44-2":{type:"path",points:[{x:-0.09,y:-0.34},{x:-0.09,y:-0.09}],color:"primary",fill:!1},"rect1577-3":{type:"path",points:[{x:-0.19,y:0.18},{x:-0.27,y:0.18}],color:"primary",fill:!0},"rect1577-4":{type:"path",points:[{x:-0.19,y:-0.09},{x:-0.27,y:-0.09}],color:"primary",fill:!0},"rect1577-4-7":{type:"path",points:[{x:-0.23,y:0.14},{x:-0.23,y:0.22}],color:"primary",fill:!0}},texts:{top1:{type:"text",text:"{REF}",x:0.25,y:0.32},bottom1:{type:"text",text:"{VAL}",x:0.25,y:-0.24}},refblocks:{left1:{x:-0.57,y:0.18},left2:{x:-0.57,y:-0.09},right1:{x:0.43,y:0.04},top2:{x:-0.1,y:0.44},bottom1:{x:-0.09,y:-0.34}},bounds:{minX:-0.57,maxX:0.43,minY:-0.38,maxY:0.27,width:1.09,height:0.3,centerX:-0.07,centerY:0.05},circles:{}},a1e=gn(Yvo).labelPort("left1",["1","inp1"]).labelPort("left2",["2","inp2"]).labelPort("right1",["4","out"]).labelPort("top2",["5","V+"]).labelPort("bottom1",["3","V-"]).changeTextAnchor("{REF}","middle_bottom").changeTextAnchor("{VAL}","middle_top").build(),Gvo=Mo(a1e,"down"),Uvo=UX(Mo(a1e,"left")),Wvo=Mo(a1e,"up"),Xvo={paths:{path11:{type:"path",points:[{x:-0.42,y:-0.1},{x:0.05,y:-0.11}],color:"primary",fill:!1},path40:{type:"path",points:[{x:0.09,y:0.19},{x:0.09,y:-0.18}],color:"primary",fill:!1},"path12-1":{type:"path",points:[{x:0.3,y:0.55},{x:0.3,y:0.11}],color:"primary",fill:!1},"path12-1-5":{type:"path",points:[{x:0.31,y:-0.55},{x:0.31,y:-0.01}],color:"primary",fill:!1},path2:{type:"path",points:[{x:0.09,y:0.11},{x:0.31,y:0.11}],color:"primary",fill:!1},"path2-5":{type:"path",points:[{x:0.09,y:-0.1},{x:0.31,y:-0.1}],color:"primary",fill:!1},path15:{type:"path",points:[{x:0.2,y:0.03},{x:0.2,y:-0.04},{x:0.27,y:-0.01},{x:0.2,y:0.03}],color:"primary",fill:!0},"path2-0":{type:"path",points:[{x:0.09,y:0},{x:0.31,y:-0.01}],color:"primary",fill:!1},"path12-1-0":{type:"path",points:[{x:0.05,y:0.17},{x:0.05,y:-0.11}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-0.13,y:0.36},bottom1:{type:"text",text:"{VAL}",x:0.06,y:-0.42}},refblocks:{top1:{x:0.3,y:0.55},bottom1:{x:0.31,y:-0.55},left1:{x:-0.42,y:-0.1}},bounds:{minX:-0.45,maxX:0.45,minY:-0.58,maxY:0.58,width:0.89,height:1.16,centerX:0,centerY:0},circles:{path1:{type:"circle",x:0.16,y:0,radius:0.29,color:"primary",fill:!1}}},{paths:jvo,texts:iIt,bounds:sIt,refblocks:YX,circles:Kvo}=Xvo,aIt={x:sIt.centerX,y:sIt.centerY},r7=yl({primitives:[...Object.values(jvo),...Object.values(Kvo),{...iIt.top1,anchor:"middle_right",x:0},{...iIt.bottom1,anchor:"middle_right",x:0}],ports:[{...YX.top1,labels:["1","drain"]},{...YX.bottom1,labels:["2","source"]},{...YX.left1,labels:["3","gate"]}],size:Ure(aIt,[YX.top1,YX.bottom1,YX.left1]),center:aIt}),w9t=Mo(r7),B9t=w9t.primitives.filter((e)=>e.type==="text"),rLe=B9t.find((e)=>e.text==="{VAL}");rLe.x=-0.35;rLe.y=0;rLe.anchor="middle_right";iLe=B9t.find((e)=>e.text==="{REF}");iLe.y=0;iLe.x=0.35;iLe.anchor="middle_left";SM=w9t,$vo=Ml({horizontalSymbol:r7,verticalSymbol:SM,gateSide:"bottom",drainSide:"left"}),qvo=Ml({horizontalSymbol:r7,verticalSymbol:SM,gateSide:"bottom",drainSide:"right"}),Jvo=Ml({horizontalSymbol:r7,verticalSymbol:SM,gateSide:"left",drainSide:"bottom"}),Zvo=Ml({horizontalSymbol:r7,verticalSymbol:SM,gateSide:"left",drainSide:"top"}),e8o=Ml({horizontalSymbol:r7,verticalSymbol:SM,gateSide:"right",drainSide:"bottom"}),t8o=Ml({horizontalSymbol:r7,verticalSymbol:SM,gateSide:"right",drainSide:"top"}),n8o=Ml({horizontalSymbol:r7,verticalSymbol:SM,gateSide:"top",drainSide:"left"}),o8o=Ml({horizontalSymbol:r7,verticalSymbol:SM,gateSide:"top",drainSide:"right"}),r8o={paths:{path11:{type:"path",points:[{x:-0.42,y:-0.1},{x:0.05,y:-0.11}],color:"primary",fill:!1},"path12-1":{type:"path",points:[{x:0.3,y:0.55},{x:0.3,y:0.11}],color:"primary",fill:!1},"path12-1-5":{type:"path",points:[{x:0.31,y:-0.55},{x:0.31,y:-0.01}],color:"primary",fill:!1},path2:{type:"path",points:[{x:0.09,y:0.11},{x:0.31,y:0.11}],color:"primary",fill:!1},"path2-8-3-7":{type:"path",points:[{x:0.09,y:0.15},{x:0.09,y:0.07}],color:"primary",fill:!1},"path2-5":{type:"path",points:[{x:0.09,y:-0.1},{x:0.31,y:-0.1}],color:"primary",fill:!1},"path2-8-3":{type:"path",points:[{x:0.09,y:-0.08},{x:0.09,y:-0.15}],color:"primary",fill:!1},"path2-8-3-2":{type:"path",points:[{x:0.09,y:0.03},{x:0.09,y:-0.04}],color:"primary",fill:!1},path15:{type:"path",points:[{x:0.2,y:0.03},{x:0.2,y:-0.04},{x:0.27,y:-0.01},{x:0.2,y:0.03}],color:"primary",fill:!0},"path2-0":{type:"path",points:[{x:0.09,y:0},{x:0.31,y:-0.01}],color:"primary",fill:!1},"path12-1-0":{type:"path",points:[{x:0.05,y:0.11},{x:0.05,y:-0.11}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-0.13,y:0.36},bottom1:{type:"text",text:"{VAL}",x:0.06,y:-0.42}},refblocks:{top1:{x:0.3,y:0.55},bottom1:{x:0.31,y:-0.55},left1:{x:-0.42,y:-0.1}},bounds:{minX:-0.45,maxX:0.45,minY:-0.58,maxY:0.58,width:0.89,height:1.16,centerX:0,centerY:0},circles:{path1:{type:"circle",x:0.16,y:0,radius:0.29,color:"primary",fill:!1}}},{paths:i8o,texts:cIt,bounds:lIt,refblocks:GX,circles:s8o}=r8o,hIt={x:lIt.centerX,y:lIt.centerY},i7=yl({primitives:[...Object.values(i8o),...Object.values(s8o),{...cIt.top1,anchor:"middle_right",x:0},{...cIt.bottom1,anchor:"middle_right",x:0}],ports:[{...GX.top1,labels:["1","drain"]},{...GX.bottom1,labels:["2","source"]},{...GX.left1,labels:["3","gate"]}],size:Ure(hIt,[GX.top1,GX.bottom1,GX.left1]),center:hIt}),T9t=Mo(i7),D9t=T9t.primitives.filter((e)=>e.type==="text"),sLe=D9t.find((e)=>e.text==="{VAL}");sLe.x=-0.35;sLe.y=0;sLe.anchor="middle_right";aLe=D9t.find((e)=>e.text==="{REF}");aLe.y=0;aLe.x=0.35;aLe.anchor="middle_left";PM=T9t,a8o=Ml({horizontalSymbol:i7,verticalSymbol:PM,gateSide:"bottom",drainSide:"left"}),c8o=Ml({horizontalSymbol:i7,verticalSymbol:PM,gateSide:"bottom",drainSide:"right"}),l8o=Ml({horizontalSymbol:i7,verticalSymbol:PM,gateSide:"left",drainSide:"bottom"}),h8o=Ml({horizontalSymbol:i7,verticalSymbol:PM,gateSide:"left",drainSide:"top"}),d8o=Ml({horizontalSymbol:i7,verticalSymbol:PM,gateSide:"right",drainSide:"bottom"}),u8o=Ml({horizontalSymbol:i7,verticalSymbol:PM,gateSide:"right",drainSide:"top"}),p8o=Ml({horizontalSymbol:i7,verticalSymbol:PM,gateSide:"top",drainSide:"left"}),m8o=Ml({horizontalSymbol:i7,verticalSymbol:PM,gateSide:"top",drainSide:"right"}),_8o={paths:{path11:{type:"path",points:[{x:-0.54,y:-0.01},{x:-0.15,y:-0.02}],color:"primary",fill:!1},path40:{type:"path",points:[{x:0.13,y:0},{x:-0.13,y:-0.13}],color:"primary",fill:!1},path41:{type:"path",points:[{x:-0.13,y:0.13},{x:0.13,y:0}],color:"primary",fill:!1},path42:{type:"path",points:[{x:-0.13,y:-0.13},{x:-0.13,y:0.13}],color:"primary",fill:!1},path43:{type:"path",points:[{x:0.13,y:0.13},{x:0.13,y:-0.13}],color:"primary",fill:!1},path12:{type:"path",points:[{x:0.14,y:0},{x:0.54,y:-0.01}],color:"primary",fill:!1},"path25-0":{type:"path",points:[{x:0.2,y:0.38},{x:0.16,y:0.28},{x:0.26,y:0.3}],color:"primary",fill:!0},"path78-6":{type:"path",points:[{x:0.33,y:0.43},{x:0.32,y:0.42},{x:0.21,y:0.31},{x:0.21,y:0.31}],color:"primary",fill:!1},"path25-0-9":{type:"path",points:[{x:0.35,y:0.35},{x:0.31,y:0.26},{x:0.41,y:0.27}],color:"primary",fill:!0},"path78-6-5":{type:"path",points:[{x:0.48,y:0.4},{x:0.47,y:0.39},{x:0.35,y:0.29},{x:0.35,y:0.29}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-0.1,y:0.35},bottom1:{type:"text",text:"{VAL}",x:0,y:-0.43}},refblocks:{left1:{x:-0.54,y:-0.01},right1:{x:0.54,y:-0.01}},bounds:{minX:-0.57,maxX:0.57,minY:-0.43,maxY:0.43,width:1.14,height:0.85,centerX:0,centerY:0},circles:{path1:{type:"circle",x:0,y:-0.01,radius:0.29,color:"primary",fill:!1}}},N9t=gn(_8o).changeTextAnchor("{VAL}","middle_top").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_bottom").build(),R9t=Mo(N9t),g8o=R9t.primitives.filter((e)=>e.type==="text"),Q9t=g8o.find((e)=>e.text==="{REF}");Q9t.y=0;Q9t.anchor="middle_left";A8o=R9t,cLe={paths:{enclosure:{type:"path",points:[{x:-0.5,y:0.2749999999999999},{x:0.5,y:0.2749999999999999},{x:0.5,y:-0.27500000000000013},{x:-0.5,y:-0.27500000000000013},{x:-0.5,y:0.2749999999999999}],color:"primary",fill:!1},"pin-one-lead":{type:"path",points:[{x:-0.6499999999999999,y:0.10833329999999997},{x:-0.5,y:0.10833329999999997}],color:"primary",fill:!1},"pin-two-lead":{type:"path",points:[{x:-0.6499999999999999,y:-0.10833329999999997},{x:-0.5,y:-0.10833329999999997}],color:"primary",fill:!1},"pin-four-lead":{type:"path",points:[{x:0.5,y:0.10833329999999997},{x:0.6499999999999999,y:0.10833329999999997}],color:"primary",fill:!1},"pin-three-lead":{type:"path",points:[{x:0.5,y:-0.10833329999999997},{x:0.6499999999999999,y:-0.10833329999999997}],color:"primary",fill:!1},"led-anode-lead":{type:"path",points:[{x:-0.5,y:0.10833329999999997},{x:-0.2749999999999999,y:0.10833329999999997},{x:-0.2749999999999999,y:0.04999999999999982}],color:"primary",fill:!1},"led-body":{type:"path",points:[{x:-0.32499999999999996,y:0.04999999999999982},{x:-0.22499999999999987,y:0.04999999999999982},{x:-0.2749999999999999,y:-0.050000000000000044},{x:-0.32499999999999996,y:0.04999999999999982}],color:"primary",fill:!1},"led-cathode":{type:"path",points:[{x:-0.32499999999999996,y:-0.050000000000000044},{x:-0.22499999999999987,y:-0.050000000000000044}],color:"primary",fill:!1},"led-cathode-lead":{type:"path",points:[{x:-0.2749999999999999,y:-0.050000000000000044},{x:-0.2749999999999999,y:-0.10833329999999997},{x:-0.5,y:-0.10833329999999997}],color:"primary",fill:!1},collector:{type:"path",points:[{x:0.5,y:0.10833329999999997},{x:0.3700000000000001,y:0.10833329999999997},{x:0.28000000000000025,y:0.05499999999999994}],color:"primary",fill:!1},"transistor-base":{type:"path",points:[{x:0.28000000000000025,y:0.08499999999999996},{x:0.28000000000000025,y:-0.08499999999999996}],color:"primary",fill:!1},emitter:{type:"path",points:[{x:0.28000000000000025,y:-0.05500000000000016},{x:0.375,y:-0.10833329999999997},{x:0.5,y:-0.10833329999999997}],color:"primary",fill:!1},"emitter-arrow":{type:"path",points:[{x:0.31620000000000004,y:-0.09600000000000009},{x:0.365,y:-0.10270000000000024},{x:0.3338000000000001,y:-0.06460000000000021}],color:"primary",fill:!1},"light-ray-one":{type:"path",points:[{x:-0.1299999999999999,y:0.10499999999999998},{x:0.1050000000000002,y:0.009999999999999787}],color:"primary",fill:!1},"light-ray-one-head":{type:"path",points:[{x:0.04700000000000015,y:0.014000000000000012},{x:0.1050000000000002,y:0.009999999999999787},{x:0.06099999999999994,y:0.04699999999999993}],color:"primary",fill:!1},"light-ray-two":{type:"path",points:[{x:-0.1299999999999999,y:-0.0050000000000001155},{x:0.1050000000000002,y:-0.10000000000000009}],color:"primary",fill:!1},"light-ray-two-head":{type:"path",points:[{x:0.04700000000000015,y:-0.09600000000000009},{x:0.1050000000000002,y:-0.10000000000000009},{x:0.06099999999999994,y:-0.06300000000000017}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:0,y:0.3800000000000001},bottom1:{type:"text",text:"{VAL}",x:0,y:-0.3800000000000001}},refblocks:{left1:{x:-0.6499999999999999,y:-0.10833333333330031},left2:{x:-0.6499999999999999,y:0.10833333333329986},right1:{x:0.6499999999999999,y:-0.10833333333330031},right2:{x:0.6499999999999999,y:0.10833333333329986}},bounds:{minX:-0.6499999999999999,maxX:0.6499999999999999,minY:-0.3800000000000001,maxY:0.3800000000000001,width:1.2999999999999998,height:0.7600000000000002,centerX:0,centerY:0},circles:{}},f8o=gn(cLe).labelPort("left1",["2","cathode","input_cathode"]).labelPort("left2",["1","anode","input_anode"]).labelPort("right1",["3","emitter","output_emitter"]).labelPort("right2",["4","collector","output_collector"]).changeTextAnchor("{REF}","middle_bottom").changeTextAnchor("{VAL}","middle_top").rotateRightFacingSymbol("down").build(),k9t=gn(cLe).labelPort("left1",["2","cathode","input_cathode"]).labelPort("left2",["1","anode","input_anode"]).labelPort("right1",["3","emitter","output_emitter"]).labelPort("right2",["4","collector","output_collector"]).changeTextAnchor("{REF}","middle_bottom").changeTextAnchor("{VAL}","middle_top").rotateRightFacingSymbol("right").build(),y8o=wI(k9t),x8o=gn(cLe).labelPort("left1",["2","cathode","input_cathode"]).labelPort("left2",["1","anode","input_anode"]).labelPort("right1",["3","emitter","output_emitter"]).labelPort("right2",["4","collector","output_collector"]).changeTextAnchor("{REF}","middle_bottom").changeTextAnchor("{VAL}","middle_top").rotateRightFacingSymbol("up").build(),C8o={paths:{path11:{type:"path",points:[{x:-0.4,y:0},{x:0.06,y:-0.01}],color:"primary",fill:!1},path40:{type:"path",points:[{x:0.07,y:0.19},{x:0.07,y:-0.18}],color:"primary",fill:!1},"path12-1":{type:"path",points:[{x:0.28,y:0.55},{x:0.28,y:0.11}],color:"primary",fill:!1},"path12-1-5":{type:"path",points:[{x:0.29,y:-0.55},{x:0.29,y:-0.1}],color:"primary",fill:!1},path2:{type:"path",points:[{x:0.07,y:0.11},{x:0.29,y:0.11}],color:"primary",fill:!1},"path2-5":{type:"path",points:[{x:0.07,y:-0.1},{x:0.29,y:-0.1}],color:"primary",fill:!1},path15:{type:"path",points:[{x:0.01,y:-0.07},{x:0.01,y:0.06},{x:-0.08,y:0},{x:0.01,y:-0.07}],color:"primary",fill:!0}},texts:{top1:{type:"text",text:"{REF}",x:-0.15,y:0.36},bottom1:{type:"text",text:"{VAL}",x:0.04,y:-0.42}},refblocks:{top1:{x:0.28,y:0.55},bottom1:{x:0.29,y:-0.55},left1:{x:-0.4,y:0}},bounds:{minX:-0.43,maxX:0.43,minY:-0.58,maxY:0.58,width:0.85,height:1.16,centerX:0,centerY:0},circles:{path1:{type:"circle",x:0.14,y:0,radius:0.29,color:"primary",fill:!1}}},{paths:b8o,texts:dIt,bounds:jfe,refblocks:uQe,circles:I8o}=C8o,L9t=yl({primitives:[...Object.values(b8o),...Object.values(I8o),{...dIt.top1,anchor:"middle_right",x:0},{...dIt.bottom1,anchor:"middle_right"}],ports:[{...uQe.top1,labels:["1","drain"]},{...uQe.bottom1,labels:["2","source"]},{...uQe.left1,labels:["3","gate"]}],size:{width:jfe.width,height:jfe.height},center:{x:jfe.centerX,y:jfe.centerY}}),H9t=Mo(L9t),F9t=H9t.primitives.filter((e)=>e.type==="text"),lLe=F9t.find((e)=>e.text==="{VAL}");lLe.x=-0.35;lLe.y=0;lLe.anchor="middle_right";hLe=F9t.find((e)=>e.text==="{REF}");hLe.y=0;hLe.x=0.35;hLe.anchor="middle_left";v8o=H9t,iz={paths:{path11:{type:"path",points:[{x:-0.4,y:0},{x:0.06,y:-0.01}],color:"primary",fill:!1},"path40-0":{type:"path",points:[{x:0.07,y:0.27},{x:0.07,y:-0.28}],color:"primary",fill:!1},"path40-0-5":{type:"path",points:[{x:0.28,y:0.24},{x:0.08,y:0.11}],color:"primary",fill:!1},"path40-0-5-0":{type:"path",points:[{x:0.29,y:-0.24},{x:0.09,y:-0.11}],color:"primary",fill:!1},"path12-1-5":{type:"path",points:[{x:0.29,y:0.25},{x:0.29,y:0.55}],color:"primary",fill:!1},"path12-1-5-3":{type:"path",points:[{x:0.29,y:-0.55},{x:0.29,y:-0.25}],color:"primary",fill:!1},path15:{type:"path",points:[{x:0.15,y:-0.23},{x:0.22,y:-0.12},{x:0.12,y:-0.12},{x:0.15,y:-0.23}],color:"primary",fill:!0}},texts:{top1:{type:"text",text:"{REF}",x:-0.08,y:0.37},bottom1:{type:"text",text:"{VAL}",x:-0.07,y:-0.41}},refblocks:{top1:{x:0.29,y:0.55},bottom1:{x:0.29,y:-0.55},left1:{x:-0.4,y:0}},bounds:{minX:-0.43,maxX:0.43,minY:-0.58,maxY:0.58,width:0.85,height:1.16,centerX:0,centerY:0},circles:{"path1-0":{type:"circle",x:0.14,y:0,radius:0.29,color:"primary",fill:!1}}},{paths:S8o,texts:y2s,bounds:Kfe,refblocks:pQe,circles:P8o}=iz,E8o=gn({primitives:[...Object.values(S8o),...Object.values(P8o),{type:"text",text:"{REF}",x:-0.1,y:0.3094553499999995},{type:"text",text:"{VAL}",x:-0.1,y:-0.3094553499999995}],ports:[{...pQe.top1,labels:["1","collector"]},{...pQe.bottom1,labels:["3","emitter"]},{...pQe.left1,labels:["2","base"]}],size:{width:Kfe.width,height:Kfe.height},center:{x:Kfe.centerX,y:Kfe.centerY}}).rotateRightFacingSymbol("right").changeTextAnchor("{REF}","middle_right").changeTextAnchor("{VAL}","middle_right").build(),{paths:x2s,texts:C2s,bounds:b2s,refblocks:I2s,circles:v2s}=iz,M8o=gn(iz).rotateRightFacingSymbol("up").changeTextAnchor("{VAL}","middle_left").labelPort("left1",["2","base"]).labelPort("top1",["1","collector"]).labelPort("bottom1",["3","emitter"]).changeTextAnchor("{REF}","middle_right").build(),{paths:w8o,texts:S2s,bounds:$fe,refblocks:mQe,circles:B8o}=iz,T8o=gn({primitives:[...Object.values(w8o),...Object.values(B8o),{type:"text",text:"{REF}",x:-0.1,y:-0.3094553499999995},{type:"text",text:"{VAL}",x:-0.1,y:0.3094553499999995}],ports:[{...mQe.top1,labels:["1","collector"]},{...mQe.bottom1,labels:["3","emitter"]},{...mQe.left1,labels:["2","base"]}],size:{width:$fe.width,height:$fe.height},center:{x:$fe.centerX,y:$fe.centerY}}).rotateRightFacingSymbol("down").changeTextAnchor("{REF}","middle_bottom").changeTextAnchor("{VAL}","middle_bottom").build(),{paths:D8o,texts:P2s,bounds:qfe,refblocks:_Qe,circles:N8o}=iz,R8o=gn({primitives:[...Object.values(D8o),...Object.values(N8o),{type:"text",text:"{REF}",x:-0.1,y:-0.3094553499999995},{type:"text",text:"{VAL}",x:-0.1,y:0.3094553499999995}],ports:[{..._Qe.top1,labels:["1","collector"]},{..._Qe.bottom1,labels:["3","emitter"]},{..._Qe.left1,labels:["2","base"]}],size:{width:qfe.width,height:qfe.height},center:{x:qfe.centerX,y:qfe.centerY}}).rotateRightFacingSymbol("up").changeTextAnchor("{REF}","middle_top").changeTextAnchor("{VAL}","middle_top").build(),{paths:Q8o,texts:E2s,bounds:Jfe,refblocks:gQe,circles:k8o}=iz,L8o=gn({primitives:[...Object.values(Q8o),...Object.values(k8o),{type:"text",text:"{REF}",x:-0.1,y:-0.3094553499999995},{type:"text",text:"{VAL}",x:-0.1,y:0.3094553499999995}],ports:[{...gQe.top1,labels:["1","collector"]},{...gQe.bottom1,labels:["3","emitter"]},{...gQe.left1,labels:["2","base"]}],size:{width:Jfe.width,height:Jfe.height},center:{x:Jfe.centerX,y:Jfe.centerY}}).rotateRightFacingSymbol("left").changeTextAnchor("{REF}","middle_left").changeTextAnchor("{VAL}","middle_left").build(),{paths:H8o,texts:M2s,bounds:Zfe,refblocks:AQe,circles:F8o}=iz,z8o=gn({primitives:[...Object.values(H8o),...Object.values(F8o),{type:"text",text:"{REF}",x:-0.1,y:-0.3094553499999995},{type:"text",text:"{VAL}",x:-0.1,y:0.3094553499999995}],ports:[{...AQe.top1,labels:["1","collector"]},{...AQe.bottom1,labels:["3","emitter"]},{...AQe.left1,labels:["2","base"]}],size:{width:Zfe.width,height:Zfe.height},center:{x:Zfe.centerX,y:Zfe.centerY}}).rotateRightFacingSymbol("left").changeTextAnchor("{REF}","middle_left").changeTextAnchor("{VAL}","middle_left").build(),O8o={paths:{path40:{type:"path",points:[{x:-0.19,y:0.33},{x:-0.26,y:0.14}],color:"primary",fill:!1},path41:{type:"path",points:[{x:-0.38,y:0.26},{x:-0.19,y:0.33}],color:"primary",fill:!1},path42:{type:"path",points:[{x:-0.26,y:0.14},{x:-0.38,y:0.26}],color:"primary",fill:!1},path43:{type:"path",points:[{x:-0.26,y:0.39},{x:-0.13,y:0.26}],color:"primary",fill:!1},path44:{type:"path",points:[{x:-0.32,y:0.2},{x:-0.52,y:0}],color:"primary",fill:!1},"path44-0":{type:"path",points:[{x:0,y:0.52},{x:-0.19,y:0.33}],color:"primary",fill:!1},"path40-4":{type:"path",points:[{x:-0.19,y:-0.32},{x:-0.38,y:-0.26}],color:"primary",fill:!1},"path41-1":{type:"path",points:[{x:-0.26,y:-0.13},{x:-0.19,y:-0.32}],color:"primary",fill:!1},"path42-7":{type:"path",points:[{x:-0.38,y:-0.26},{x:-0.26,y:-0.13}],color:"primary",fill:!1},"path43-1":{type:"path",points:[{x:-0.13,y:-0.26},{x:-0.26,y:-0.39}],color:"primary",fill:!1},"path44-8":{type:"path",points:[{x:-0.32,y:-0.19},{x:-0.51,y:-0.01}],color:"primary",fill:!1},"path44-0-7":{type:"path",points:[{x:-0.01,y:-0.5},{x:-0.19,y:-0.32}],color:"primary",fill:!1},"path40-4-0":{type:"path",points:[{x:0.32,y:0.19},{x:0.13,y:0.26}],color:"primary",fill:!1},"path41-1-2":{type:"path",points:[{x:0.26,y:0.38},{x:0.32,y:0.19}],color:"primary",fill:!1},"path42-7-1":{type:"path",points:[{x:0.13,y:0.26},{x:0.26,y:0.38}],color:"primary",fill:!1},"path43-1-8":{type:"path",points:[{x:0.39,y:0.26},{x:0.26,y:0.13}],color:"primary",fill:!1},"path44-8-7":{type:"path",points:[{x:0.2,y:0.32},{x:0.01,y:0.51}],color:"primary",fill:!1},"path44-0-7-1":{type:"path",points:[{x:0.52,y:0},{x:0.32,y:0.19}],color:"primary",fill:!1},"path40-4-8":{type:"path",points:[{x:0.32,y:-0.19},{x:0.26,y:-0.38}],color:"primary",fill:!1},"path41-1-4":{type:"path",points:[{x:0.13,y:-0.26},{x:0.32,y:-0.19}],color:"primary",fill:!1},"path42-7-0":{type:"path",points:[{x:0.26,y:-0.38},{x:0.13,y:-0.26}],color:"primary",fill:!1},"path43-1-0":{type:"path",points:[{x:0.26,y:-0.13},{x:0.39,y:-0.26}],color:"primary",fill:!1},"path44-8-9":{type:"path",points:[{x:0.19,y:-0.32},{x:0,y:-0.52}],color:"primary",fill:!1},"path44-0-7-3":{type:"path",points:[{x:0.5,y:-0.01},{x:0.32,y:-0.19}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-0.29,y:0.46},bottom1:{type:"text",text:"{VAL}",x:-0.29,y:-0.5}},refblocks:{top1:{x:0,y:0.52},bottom1:{x:0,y:-0.52},left1:{x:-0.52,y:0},right1:{x:0.52,y:0}},bounds:{minX:-0.55,maxX:0.55,minY:-0.55,maxY:0.55,width:1.09,height:1.09,centerX:0,centerY:0},circles:{}},{paths:V8o,texts:uIt,bounds:e2e,refblocks:pIt}=O8o,z9t=yl({primitives:[...Object.values(V8o),{...uIt.bottom1,y:0.35,anchor:"middle_top"},{...uIt.top1,anchor:"middle_left"}],ports:[{...pIt.left1,labels:["1"]},{...pIt.right1,labels:["2"]}],size:{width:e2e.width+0.05,height:e2e.height},center:{x:e2e.centerX,y:e2e.centerY}}),Y8o=Mo(z9t),G8o=Y8o,U8o={paths:{path18:{type:"path",points:[{x:-0.53,y:0},{x:-0.27,y:0}],color:"primary",fill:!1},path19:{type:"path",points:[{x:0.26,y:0},{x:0.53,y:0}],color:"primary",fill:!1},path20:{type:"path",points:[{x:0,y:0.13},{x:0.26,y:0.13},{x:0.26,y:-0.13},{x:-0.27,y:-0.13},{x:-0.27,y:0.13},{x:0,y:0.13}],color:"primary",fill:!1},path24:{type:"path",points:[{x:0.29,y:-0.29},{x:0.26,y:-0.16},{x:0.16,y:-0.26},{x:0.29,y:-0.29}],color:"primary",fill:!0},path26:{type:"path",points:[{x:-0.3,y:0.29},{x:0.2,y:-0.2}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:0.06,y:0.2},bottom1:{type:"text",text:"{VAL}",x:-0.1,y:-0.28}},refblocks:{left1:{x:-0.53,y:0},right1:{x:0.53,y:0}},bounds:{minX:-0.56,maxX:0.56,minY:-0.29,maxY:0.29,width:1.13,height:0.58,centerX:0,centerY:0},circles:{}},{paths:W8o,texts:mIt,bounds:t2e,refblocks:_It}=U8o,c1e=yl({primitives:[...Object.values(W8o),{...mIt.bottom1,x:0,y:-0.35,anchor:"middle_top"},{...mIt.top1,x:0,y:0.35,anchor:"middle_bottom"}],ports:[{..._It.left1,labels:["1"]},{..._It.right1,labels:["2"]}],size:{width:t2e.width+0.05,height:t2e.height},center:{x:t2e.centerX,y:t2e.centerY}}),dLe=Mo(c1e,"down"),uLe=dLe.primitives.find((e)=>e.type==="text"&&e.text==="{REF}"),pLe=dLe.primitives.find((e)=>e.type==="text"&&e.text==="{VAL}");uLe.anchor="middle_left";pLe.anchor="middle_left";uLe.y+=0.31;uLe.x=0.34;pLe.y-=0.31;pLe.x=0.34;X8o=dLe,mLe=Mo(c1e,"left"),_Le=mLe.primitives.find((e)=>e.type==="text"&&e.text==="{REF}"),gLe=mLe.primitives.find((e)=>e.type==="text"&&e.text==="{VAL}");_Le.anchor="middle_bottom";gLe.anchor="middle_top";_Le.y+=0.73;_Le.x=0;gLe.y-=0.7;gLe.x=0;j8o=mLe,ALe=Mo(c1e,"up"),fLe=ALe.primitives.find((e)=>e.type==="text"&&e.text==="{REF}"),yLe=ALe.primitives.find((e)=>e.type==="text"&&e.text==="{VAL}");fLe.anchor="middle_left";yLe.anchor="middle_left";fLe.y+=0.21;fLe.x=0.34;yLe.y-=0.21;yLe.x=0.34;K8o=ALe,l1e={paths:{path1:{type:"path",points:[{x:-0.42,y:0},{x:-0.3,y:0}],color:"primary",fill:!1},"path1-2-1":{type:"path",points:[{x:-0.3,y:0},{x:-0.25,y:0.1},{x:-0.15,y:-0.1},{x:-0.05,y:0.1},{x:0.05,y:-0.1},{x:0.15,y:0.1},{x:0.25,y:-0.1},{x:0.3,y:0}],color:"primary",fill:!1},path2:{type:"path",points:[{x:0.3,y:0},{x:0.42,y:0}],color:"primary",fill:!1},path3:{type:"path",points:[{x:0,y:-0.17},{x:0,y:-0.4}],color:"primary",fill:!1},path15:{type:"path",points:[{x:0,y:-0.12},{x:0.05,y:-0.2},{x:-0.05,y:-0.2},{x:0,y:-0.12}],color:"primary",fill:!0}},texts:{top1:{type:"text",text:"{REF}",x:0.3,y:0.25},bottom1:{type:"text",text:"{VAL}",x:0.3,y:-0.25}},refblocks:{left:{x:-0.42,y:0},right:{x:0.42,y:0},bottom:{x:0,y:-0.4}},bounds:{minX:-0.42,maxX:0.42,minY:-0.2,maxY:0.2,width:0.84,height:0.4,centerX:0,centerY:0},circles:{}},{paths:$8o,texts:w2s,bounds:n2e,refblocks:fQe,circles:q8o}=l1e,J8o=gn({primitives:[...Object.values($8o),...Object.values(q8o),{type:"text",text:"{REF}",x:-0.15,y:0.2394553499999995},{type:"text",text:"{VAL}",x:0.15,y:0.2394553499999995}],ports:[{...fQe.left,labels:["1"]},{...fQe.right,labels:["3"]},{...fQe.bottom,labels:["2"]}],size:{width:n2e.width,height:n2e.height},center:{x:n2e.centerX,y:n2e.centerY}}).rotateRightFacingSymbol("down").labelPort("left",["1"]).labelPort("right",["2"]).labelPort("bottom",["3"]).changeTextAnchor("{REF}","middle_left").changeTextAnchor("{VAL}","middle_left").build(),{paths:Z8o,texts:B2s,bounds:o2e,refblocks:yQe,circles:e7o}=l1e,t7o=gn({primitives:[...Object.values(Z8o),...Object.values(e7o),{type:"text",text:"{REF}",x:-0.3,y:-0.3894553499999995},{type:"text",text:"{VAL}",x:-0.3,y:0.3194553499999995}],ports:[{...yQe.left,labels:["1"]},{...yQe.right,labels:["3"]},{...yQe.bottom,labels:["2"]}],size:{width:o2e.width,height:o2e.height},center:{x:o2e.centerX,y:o2e.centerY}}).rotateRightFacingSymbol("left").labelPort("left",["1"]).labelPort("right",["2"]).labelPort("bottom",["3"]).changeTextAnchor("{REF}","middle_bottom").changeTextAnchor("{VAL}","middle_top").build(),n7o=gn(l1e).labelPort("left",["1"]).labelPort("right",["3"]).labelPort("bottom",["2"]).changeTextAnchor("{REF}","middle_bottom").changeTextAnchor("{VAL}","middle_top").build(),{paths:o7o,texts:T2s,bounds:r2e,refblocks:xQe,circles:r7o}=l1e,i7o=gn({primitives:[...Object.values(o7o),...Object.values(r7o),{type:"text",text:"{REF}",x:0.3,y:-0.2894553499999995},{type:"text",text:"{VAL}",x:-0.3,y:-0.2894553499999995}],ports:[{...xQe.left,labels:["1"]},{...xQe.right,labels:["3"]},{...xQe.bottom,labels:["2"]}],size:{width:r2e.width,height:r2e.height},center:{x:r2e.centerX,y:r2e.centerY}}).rotateRightFacingSymbol("up").labelPort("left",["1"]).labelPort("right",["2"]).labelPort("bottom",["3"]).changeTextAnchor("{REF}","middle_left").changeTextAnchor("{VAL}","middle_left").build(),s7o={paths:{path11:{type:"path",points:[{x:-0.54,y:0.03},{x:-0.3,y:0.03}],color:"primary",fill:!1},path12:{type:"path",points:[{x:0.29,y:0.03},{x:0.54,y:0.03}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-0.16,y:0.4},bottom1:{type:"text",text:"{VAL}",x:0,y:-0.4},left1:{type:"text",text:"COS φ",x:-0.15,y:0.01}},refblocks:{left1:{x:-0.54,y:0.03},right1:{x:0.54,y:0.03}},bounds:{minX:-0.57,maxX:0.57,minY:-0.4,maxY:0.4,width:1.14,height:0.79,centerX:0,centerY:0},circles:{path1:{type:"circle",x:0,y:0.04,radius:0.29,color:"primary",fill:!1}}},{paths:a7o,texts:D2s,bounds:i2e,refblocks:gIt,circles:c7o}=s7o,O9t=yl({primitives:[...Object.values(a7o),...Object.values(c7o),{type:"text",text:"{REF}",x:0,y:0.43330070000000065,anchor:"middle_bottom"},{type:"text",text:"{VAL}",x:0,y:-0.43330070000000065,anchor:"middle_top"},{type:"text",text:"COS φ",x:0,y:0.014279000000000375,anchor:"center"}],ports:[{...gIt.left1,labels:["1"]},{...gIt.right1,labels:["2"]}],size:{width:i2e.width,height:i2e.height},center:{x:i2e.centerX,y:i2e.centerY}}),V9t=Mo(O9t),xLe=V9t.primitives.filter((e)=>e.type==="text"),wQe=xLe.find((e)=>e.text==="{REF}"),CLe=xLe.find((e)=>e.text==="{VAL}"),BQe=xLe.find((e)=>e.text==="COS φ");wQe.x=0.35;wQe.y=0.4279000000000375,wQe.anchor="middle_left";CLe.anchor="middle_left";CLe.x=0.35;CLe.y=-0.4279000000000375,BQe.x=0;BQe.y=0.014279000000000375,BQe.anchor="center";l7o=V9t,h7o={paths:{"path12-1-8-6-9-9":{type:"path",points:[{x:0.01,y:0.03},{x:0.01,y:-0.09}],color:"primary",fill:!1},"path12-1-5-6-4":{type:"path",points:[{x:-0.47,y:-0.05},{x:-0.17,y:-0.05}],color:"primary",fill:!1},"path12-1-8-0-0":{type:"path",points:[{x:-0.16,y:-0.09},{x:0.18,y:-0.09}],color:"primary",fill:!1},"path12-1-0-1":{type:"path",points:[{x:0.2,y:-0.05},{x:0.47,y:-0.05}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:0.01,y:0.22},bottom1:{type:"text",text:"{VAL}",x:-0.16,y:-0.22}},refblocks:{left1:{x:-0.47,y:-0.05},right1:{x:0.47,y:-0.05}},bounds:{minX:-0.5,maxX:0.5,minY:-0.22,maxY:0.22,width:1,height:0.45,centerX:0,centerY:0},circles:{"circle-2":{type:"circle",x:-0.14,y:-0.05,radius:0.02,color:"primary",fill:!1},circle:{type:"circle",x:0.17,y:-0.05,radius:0.02,color:"primary",fill:!1}}},{paths:d7o,texts:AIt,bounds:fIt,refblocks:yIt,circles:u7o}=h7o,Y9t=yl({primitives:[...Object.values(d7o),...Object.values(u7o),{...AIt.top1,anchor:"middle_left"},{...AIt.bottom1,anchor:"middle_left"}],ports:[{...yIt.left1,labels:["1"]},{...yIt.right1,labels:["2"]}],center:{x:fIt.centerX,y:fIt.centerY}}),p7o=Mo(Y9t,"up"),G9t={paths:{"path12-1-8-6-9-9":{type:"path",points:[{x:-0.05,y:0.09},{x:-0.05,y:0.04}],color:"primary",fill:!1},"path12-1-8-7-9-9":{type:"path",points:[{x:-0.05,y:0.09},{x:0.07,y:0.09}],color:"primary",fill:!1},"path12-1-8-6-9-10":{type:"path",points:[{x:0.07,y:0.09},{x:0.07,y:0.04}],color:"primary",fill:!1},"path12-1-5-6-4":{type:"path",points:[{x:-0.47,y:-0.05},{x:-0.17,y:-0.05}],color:"primary",fill:!1},"path12-1-8-0-0":{type:"path",points:[{x:-0.16,y:0.04},{x:0.18,y:0.04}],color:"primary",fill:!1},"path12-1-0-1":{type:"path",points:[{x:0.2,y:-0.05},{x:0.47,y:-0.05}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:0.01,y:0.29},bottom1:{type:"text",text:"{VAL}",x:-0.16,y:-0.22}},refblocks:{left1:{x:-0.47,y:-0.05},right1:{x:0.47,y:-0.05}},bounds:{minX:-0.5,maxX:0.5,minY:-0.22,maxY:0.22,width:1,height:0.45,centerX:0,centerY:0},circles:{"circle-2":{type:"circle",x:-0.14,y:-0.05,radius:0.02,color:"primary",fill:!1},circle:{type:"circle",x:0.17,y:-0.05,radius:0.02,color:"primary",fill:!1}}},{paths:m7o,texts:xIt,bounds:_7o,refblocks:CQe,circles:g7o}=G9t,Wre=yl({primitives:[...Object.values(m7o),...Object.values(g7o),{...xIt.top1,x:0,y:0.3594553499999995,anchor:"middle_bottom"},{...xIt.bottom1,x:0,y:-0.3594553499999995,anchor:"middle_top"}],ports:[{...CQe.left1,labels:["1"]},{...CQe.right1,labels:["2"]}],center:{x:_7o.centerX,y:CQe.left1.y}}),bLe=Mo(Wre,"down"),ILe=bLe.primitives.find((e)=>e.type==="text"&&e.text==="{REF}"),vLe=bLe.primitives.find((e)=>e.type==="text"&&e.text==="{VAL}");ILe.anchor="middle_bottom";vLe.anchor="middle_top";ILe.y=0.4;ILe.x=0.35;vLe.y=-0.4;vLe.x=0.35;A7o=bLe,{paths:f7o,texts:CIt,bounds:y7o,refblocks:bQe,circles:x7o}=G9t,C7o=yl({primitives:[...Object.values(f7o),...Object.values(x7o),{...CIt.top1,x:0,y:0.3594553499999995,anchor:"middle_bottom"},{...CIt.bottom1,x:0,y:-0.3594553499999995,anchor:"middle_top"}],ports:[{...bQe.left1,labels:["1"]},{...bQe.right1,labels:["2"]}],center:{x:y7o.centerX,y:bQe.left1.y}}),SLe=Mo(Wre,"left"),PLe=SLe.primitives.find((e)=>e.type==="text"&&e.text==="{REF}"),ELe=SLe.primitives.find((e)=>e.type==="text"&&e.text==="{VAL}");PLe.anchor="middle_bottom";ELe.anchor="middle_top";PLe.y=0.4;PLe.x=0;ELe.y=-0.4;ELe.x=0;b7o=SLe,MLe=Mo(Wre,"up"),wLe=MLe.primitives.find((e)=>e.type==="text"&&e.text==="{REF}"),BLe=MLe.primitives.find((e)=>e.type==="text"&&e.text==="{VAL}");wLe.anchor="middle_left";BLe.anchor="middle_left";wLe.y+=0.4;wLe.x=0.34;BLe.y-=0.41;BLe.x=0.34;I7o=MLe,TLe=Mo(Wre,"up"),DLe=TLe.primitives.find((e)=>e.type==="text"&&e.text==="{REF}"),NLe=TLe.primitives.find((e)=>e.type==="text"&&e.text==="{VAL}");DLe.anchor="middle_left";NLe.anchor="middle_left";DLe.y+=0.4;DLe.x=0.34;NLe.y-=0.41;NLe.x=0.34;v7o=TLe,h1e={paths:{path12_rotated:{type:"path",points:[{x:-0.09,y:0.12},{x:-0.09,y:-0.12}],color:"primary",fill:!1},path2_rotated:{type:"path",points:[{x:-0.09,y:0},{x:0.09,y:0}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:0,y:0.03}},refblocks:{left1:{x:0.09,y:0}},bounds:{minX:-0.57,maxX:0.57,minY:-0.37,maxY:0.37,width:1.14,height:0.74,centerX:0,centerY:0},circles:{}},{paths:S7o,texts:N2s,bounds:bIt,refblocks:P7o,circles:E7o}=h1e,M7o=gn({primitives:[...Object.values(S7o),...Object.values(E7o),{type:"text",text:"{REF}",x:-0.14,y:-0}],ports:[{...P7o.left1,labels:["1"]}],center:{x:bIt.centerX,y:bIt.centerY}}).rotateRightFacingSymbol("up").labelPort("left1",["1"]).changeTextAnchor("{REF}","middle_top").build(),{paths:w7o,texts:R2s,bounds:IIt,refblocks:B7o,circles:T7o}=h1e,D7o=gn({primitives:[...Object.values(w7o),...Object.values(T7o),{type:"text",text:"{REF}",x:-0.13,y:0}],ports:[{...B7o.left1,labels:["1"]}],center:{x:IIt.centerX,y:IIt.centerY}}).changeTextAnchor("{VAL}","middle_top").rotateRightFacingSymbol("right").labelPort("left1",["1"]).changeTextAnchor("{REF}","middle_right").build(),{paths:N7o,texts:Q2s,bounds:vIt,refblocks:R7o,circles:Q7o}=h1e,k7o=gn({primitives:[...Object.values(N7o),...Object.values(Q7o),{type:"text",text:"{REF}",x:-0.14,y:-0}],ports:[{...R7o.left1,labels:["1"]}],center:{x:vIt.centerX,y:vIt.centerY}}).rotateRightFacingSymbol("left").labelPort("left1",["1"]).changeTextAnchor("{REF}","middle_left").build(),{paths:L7o,texts:k2s,bounds:SIt,refblocks:H7o}=h1e,F7o=gn({primitives:[...Object.values(L7o),{type:"text",text:"{REF}",x:-0.14,y:0}],ports:[{...H7o.left1,labels:["1"]}],center:{x:SIt.centerX,y:SIt.centerY}}).rotateRightFacingSymbol("down").labelPort("left1",["1"]).changeTextAnchor("{REF}","middle_bottom").build(),z7o={paths:{path40:{type:"path",points:[{x:-0.19,y:-0.33},{x:-0.26,y:-0.14}],color:"primary",fill:!1},path41:{type:"path",points:[{x:-0.38,y:-0.26},{x:-0.19,y:-0.33}],color:"primary",fill:!1},path42:{type:"path",points:[{x:-0.26,y:-0.14},{x:-0.38,y:-0.26}],color:"primary",fill:!1},path43:{type:"path",points:[{x:-0.26,y:-0.39},{x:-0.13,y:-0.26}],color:"primary",fill:!1},path44:{type:"path",points:[{x:-0.32,y:-0.2},{x:-0.52,y:0}],color:"primary",fill:!1},"path44-0":{type:"path",points:[{x:0,y:-0.52},{x:-0.19,y:-0.33}],color:"primary",fill:!1},"path40-4":{type:"path",points:[{x:-0.19,y:0.32},{x:-0.38,y:0.26}],color:"primary",fill:!1},"path41-1":{type:"path",points:[{x:-0.26,y:0.13},{x:-0.19,y:0.32}],color:"primary",fill:!1},"path42-7":{type:"path",points:[{x:-0.38,y:0.26},{x:-0.26,y:0.13}],color:"primary",fill:!1},"path43-1":{type:"path",points:[{x:-0.13,y:0.26},{x:-0.26,y:0.39}],color:"primary",fill:!1},"path44-8":{type:"path",points:[{x:-0.32,y:0.19},{x:-0.51,y:0.01}],color:"primary",fill:!1},"path44-0-7":{type:"path",points:[{x:-0.01,y:0.5},{x:-0.19,y:0.32}],color:"primary",fill:!1},"path40-4-0":{type:"path",points:[{x:0.32,y:-0.19},{x:0.13,y:-0.26}],color:"primary",fill:!1},"path41-1-2":{type:"path",points:[{x:0.26,y:-0.38},{x:0.32,y:-0.19}],color:"primary",fill:!1},"path42-7-1":{type:"path",points:[{x:0.13,y:-0.26},{x:0.26,y:-0.38}],color:"primary",fill:!1},"path43-1-8":{type:"path",points:[{x:0.39,y:-0.26},{x:0.26,y:-0.13}],color:"primary",fill:!1},"path44-8-7":{type:"path",points:[{x:0.2,y:-0.32},{x:0.01,y:-0.51}],color:"primary",fill:!1},"path44-0-7-1":{type:"path",points:[{x:0.52,y:0},{x:0.32,y:-0.19}],color:"primary",fill:!1},"path40-4-8":{type:"path",points:[{x:0.32,y:0.19},{x:0.26,y:0.38}],color:"primary",fill:!1},"path41-1-4":{type:"path",points:[{x:0.13,y:0.26},{x:0.32,y:0.19}],color:"primary",fill:!1},"path42-7-0":{type:"path",points:[{x:0.26,y:0.38},{x:0.13,y:0.26}],color:"primary",fill:!1},"path43-1-0":{type:"path",points:[{x:0.26,y:0.13},{x:0.39,y:0.26}],color:"primary",fill:!1},"path44-8-9":{type:"path",points:[{x:0.19,y:0.32},{x:0,y:0.52}],color:"primary",fill:!1},"path44-0-7-3":{type:"path",points:[{x:0.5,y:0.01},{x:0.32,y:0.19}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-0.29,y:-0.46},bottom1:{type:"text",text:"{VAL}",x:-0.29,y:0.5}},refblocks:{top1:{x:0,y:-0.52},bottom1:{x:0,y:0.52},left1:{x:-0.52,y:0},right1:{x:0.52,y:0}},bounds:{minX:-0.55,maxX:0.55,minY:-0.56,maxY:0.55,width:1.09,height:1.1,centerX:0,centerY:0},circles:{}},{paths:O7o,texts:PIt,bounds:s2e,refblocks:a2e,circles:V7o}=z7o,U9t=yl({primitives:[...Object.values(O7o),...Object.values(V7o),{...PIt.top1,anchor:"middle_right"},{...PIt.bottom1,anchor:"middle_right"}],ports:[{...a2e.top1,labels:["1"]},{...a2e.bottom1,labels:["2"]},{...a2e.left1,labels:["3"]},{...a2e.right1,labels:["4"]}],size:{width:s2e.width,height:s2e.height},center:{x:s2e.centerX,y:s2e.centerY}}),RLe=Mo(U9t),Y7o=RLe.primitives.find((e)=>e.type==="text"&&e.text==="{REF}"),G7o=RLe.primitives.find((e)=>e.type==="text"&&e.text==="{VAL}");Y7o.anchor="middle_left";G7o.anchor="middle_right";U7o=RLe,d1e={paths:{path27:{type:"path",points:[{x:0.47,y:0.04},{x:0.21,y:0.04}],color:"primary",fill:!1},"path27-0":{type:"path",points:[{x:-0.21,y:0.04},{x:-0.47,y:0.04}],color:"primary",fill:!1},"path27-8-2-4":{type:"path",points:[{x:0.21,y:0.04},{x:0.19,y:-0.05}],color:"primary",fill:!1},"path27-8-2-4-29":{type:"path",points:[{x:-0.19,y:0.14},{x:-0.21,y:0.04}],color:"primary",fill:!1},"path27-8-2-4-5":{type:"path",points:[{x:0.19,y:-0.05},{x:0.13,y:0.14}],color:"primary",fill:!1},"path27-8-2-4-5-1":{type:"path",points:[{x:0.08,y:-0.05},{x:0.13,y:0.14}],color:"primary",fill:!1},"path27-8-2-4-5-1-9":{type:"path",points:[{x:0.08,y:-0.05},{x:0.03,y:0.14}],color:"primary",fill:!1},"path27-8-2-4-5-1-9-2":{type:"path",points:[{x:-0.03,y:-0.05},{x:0.03,y:0.14}],color:"primary",fill:!1},"path27-8-2-4-5-1-9-2-1":{type:"path",points:[{x:-0.03,y:-0.05},{x:-0.08,y:0.14}],color:"primary",fill:!1},"path27-8-2-4-5-1-9-2-1-2":{type:"path",points:[{x:-0.13,y:-0.05},{x:-0.08,y:0.14}],color:"primary",fill:!1},"path27-8-2-4-5-1-9-2-1-2-2":{type:"path",points:[{x:-0.13,y:-0.05},{x:-0.19,y:0.14}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-0.05,y:0.42},bottom1:{type:"text",text:"{VAL}",x:-0.04,y:-0.42}},refblocks:{left1:{x:-0.47,y:0.04},right1:{x:0.47,y:0.04}},bounds:{minX:-0.49,maxX:0.49,minY:-0.42,maxY:0.42,width:0.99,height:0.84,centerX:0,centerY:0},circles:{}},{paths:W7o,texts:L2s,bounds:c2e,refblocks:EIt,circles:X7o}=d1e,j7o=gn({primitives:[...Object.values(W7o),...Object.values(X7o),{type:"text",text:"{REF}",x:-0.2,y:0.2194553499999995},{type:"text",text:"{VAL}",x:0.2,y:0.2194553499999995}],ports:[{...EIt.left1,labels:["1"]},{...EIt.right1,labels:["2"]}],size:{width:c2e.width,height:c2e.height},center:{x:c2e.centerX,y:c2e.centerY}}).rotateRightFacingSymbol("down").labelPort("left",["1"]).labelPort("right",["2"]).changeTextAnchor("{REF}","middle_left").changeTextAnchor("{VAL}","middle_left").build(),{paths:K7o,texts:H2s,bounds:l2e,refblocks:MIt,circles:$7o}=d1e,q7o=gn({primitives:[...Object.values(K7o),...Object.values($7o),{type:"text",text:"{REF}",x:0,y:-0.1704553499999995},{type:"text",text:"{VAL}",x:0,y:0.2294553499999995}],ports:[{...MIt.left1,labels:["1"]},{...MIt.right1,labels:["2"]}],size:{width:l2e.width,height:l2e.height},center:{x:l2e.centerX,y:l2e.centerY}}).rotateRightFacingSymbol("left").labelPort("left",["1"]).labelPort("right",["2"]).changeTextAnchor("{REF}","middle_bottom").changeTextAnchor("{VAL}","middle_top").build(),{paths:J7o,texts:F2s,bounds:h2e,refblocks:wIt,circles:Z7o}=d1e,eSo=gn({primitives:[...Object.values(J7o),...Object.values(Z7o),{type:"text",text:"{REF}",x:0,y:0.2294553499999995},{type:"text",text:"{VAL}",x:0,y:-0.1704553499999995}],ports:[{...wIt.left1,labels:["1"]},{...wIt.right1,labels:["2"]}],size:{width:h2e.width,height:h2e.height},center:{x:h2e.centerX,y:h2e.centerY}}).rotateRightFacingSymbol("right").labelPort("left",["1"]).labelPort("right",["2"]).changeTextAnchor("{REF}","middle_bottom").changeTextAnchor("{VAL}","middle_top").build(),u1e={paths:{"left-lead":{type:"path",points:[{x:-0.25,y:0},{x:-0.16,y:0}],color:"primary",fill:!1,strokeWidth:0.02},zigzag:{type:"path",points:[{x:-0.16,y:0},{x:-0.12,y:0.095},{x:-0.07,y:-0.095},{x:-0.02,y:0.095},{x:0.02,y:-0.095},{x:0.07,y:0.095},{x:0.12,y:-0.095},{x:0.16,y:0}],color:"primary",fill:!1,strokeWidth:0.02},"right-lead":{type:"path",points:[{x:0.16,y:0},{x:0.25,y:0}],color:"primary",fill:!1,strokeWidth:0.02}},texts:{top1:{type:"text",text:"{REF}",x:0,y:0.25,anchor:"middle_bottom"},bottom1:{type:"text",text:"{VAL}",x:0,y:-0.25,anchor:"middle_top"}},refblocks:{left1:{x:-0.25,y:0},right1:{x:0.25,y:0}},bounds:{minX:-0.25,maxX:0.25,minY:-0.25,maxY:0.25,width:0.5,height:0.5,centerX:0,centerY:0},circles:{}},tSo=Di(u1e,{kind:"resistor",orientation:"down"}),nSo=Di(u1e,{kind:"resistor",orientation:"left"}),oSo=Di(u1e,{kind:"resistor",orientation:"right"}),rSo=Di(u1e,{kind:"resistor",orientation:"up"}),{paths:iSo,texts:z2s,bounds:d2e,refblocks:BIt,circles:sSo}=d1e,aSo=gn({primitives:[...Object.values(iSo),...Object.values(sSo),{type:"text",text:"{REF}",x:0.2,y:-0.1404553499999995},{type:"text",text:"{VAL}",x:-0.2,y:-0.1494553499999995}],ports:[{...BIt.left1,labels:["1"]},{...BIt.right1,labels:["2"]}],size:{width:d2e.width,height:d2e.height},center:{x:d2e.centerX,y:d2e.centerY}}).rotateRightFacingSymbol("up").labelPort("left",["1"]).labelPort("right",["2"]).changeTextAnchor("{REF}","middle_left").changeTextAnchor("{VAL}","middle_left").build(),p1e={paths:{"left-lead":{type:"path",points:[{x:-0.175,y:0},{x:-0.115,y:0}],color:"primary",fill:!1,strokeWidth:0.02},zigzag:{type:"path",points:[{x:-0.115,y:0},{x:-0.07,y:0.095},{x:-0.025,y:-0.095},{x:0.025,y:0.095},{x:0.07,y:-0.095},{x:0.115,y:0}],color:"primary",fill:!1,strokeWidth:0.02},"right-lead":{type:"path",points:[{x:0.115,y:0},{x:0.175,y:0}],color:"primary",fill:!1,strokeWidth:0.02}},texts:{top1:{type:"text",text:"{REF}",x:0,y:0.25,anchor:"middle_bottom"},bottom1:{type:"text",text:"{VAL}",x:0,y:-0.25,anchor:"middle_top"}},refblocks:{left1:{x:-0.175,y:0},right1:{x:0.175,y:0}},bounds:{minX:-0.175,maxX:0.175,minY:-0.25,maxY:0.25,width:0.35,height:0.5,centerX:0,centerY:0},circles:{}},cSo=Di(p1e,{kind:"resistor",orientation:"down"}),lSo=Di(p1e,{kind:"resistor",orientation:"left"}),hSo=Di(p1e,{kind:"resistor",orientation:"right"}),dSo=Di(p1e,{kind:"resistor",orientation:"up"}),W9t={paths:{path27:{type:"path",points:[{x:0.76,y:-0.28},{x:0.31,y:-0.28}],color:"primary",fill:!1},path28:{type:"path",points:[{x:-0.3,y:-0.02},{x:-0.77,y:-0.02}],color:"primary",fill:!1},path30:{type:"path",points:[{x:-0.3,y:0.35},{x:-0.3,y:-0.28}],color:"primary",fill:!1},"path27-3":{type:"path",points:[{x:0.77,y:0.35},{x:0.32,y:0.35}],color:"primary",fill:!1},"path29-5":{type:"path",points:[{x:-0.07,y:-0.28},{x:-0.3,y:-0.28}],color:"primary",fill:!1},"path29-5-7":{type:"path",points:[{x:0.33,y:-0.28},{x:0.11,y:-0.28}],color:"primary",fill:!1},"path29-5-7-6":{type:"path",points:[{x:-0.06,y:-0.17},{x:-0.06,y:-0.39}],color:"primary",fill:!1},"path29-5-7-6-6":{type:"path",points:[{x:0.09,y:-0.17},{x:0.09,y:-0.39}],color:"primary",fill:!1},"path29-5-9":{type:"path",points:[{x:-0.07,y:0.35},{x:-0.3,y:0.35}],color:"primary",fill:!1},"path29-5-7-2":{type:"path",points:[{x:0.33,y:0.35},{x:0.11,y:0.35}],color:"primary",fill:!1},"path29-5-7-6-0":{type:"path",points:[{x:-0.06,y:0.46},{x:-0.06,y:0.24}],color:"primary",fill:!1},"path29-5-7-6-6-2":{type:"path",points:[{x:0.09,y:0.46},{x:0.09,y:0.24}],color:"primary",fill:!1},"path29-5-92":{type:"path",points:[{x:0.33,y:0.13},{x:0.33,y:0.35}],color:"primary",fill:!1},"path29-5-7-28":{type:"path",points:[{x:0.33,y:-0.28},{x:0.33,y:-0.05}],color:"primary",fill:!1},"path29-5-7-6-9":{type:"path",points:[{x:0.44,y:0.11},{x:0.22,y:0.11}],color:"primary",fill:!1},"path29-5-7-6-6-7":{type:"path",points:[{x:0.44,y:-0.04},{x:0.22,y:-0.04}],color:"primary",fill:!1},"path29-5-7-6-9-2":{type:"path",points:[{x:0.44,y:0.07},{x:0.22,y:0.07}],color:"primary",fill:!1},"path29-5-7-6-9-2-4":{type:"path",points:[{x:0.44,y:0},{x:0.44,y:0.07}],color:"primary",fill:!1},"path29-5-7-6-9-2-4-6":{type:"path",points:[{x:0.22,y:0},{x:0.22,y:0.07}],color:"primary",fill:!1},"path29-5-7-6-9-2-9":{type:"path",points:[{x:0.44,y:0},{x:0.22,y:0}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:0.02,y:0.53},bottom1:{type:"text",text:"{VAL}",x:0.01,y:-0.54}},refblocks:{left1:{x:-0.77,y:-0.02},right1:{x:0.76,y:-0.28},right2:{x:0.77,y:0.35}},bounds:{minX:-0.79,maxX:0.79,minY:-0.54,maxY:0.54,width:1.59,height:1.07,centerX:0,centerY:0},circles:{}},{paths:uSo,texts:TIt,bounds:u2e,refblocks:IQe,circles:pSo}=W9t,m1e=yl({primitives:[...Object.values(uSo),...Object.values(pSo),{...TIt.top1,anchor:"middle_bottom"},{...TIt.bottom1,anchor:"middle_top"}],ports:[{...IQe.left1,labels:["1"]},{...IQe.right1,labels:["2"]},{...IQe.right2,labels:["3"]}],size:{width:u2e.width,height:u2e.height},center:{x:u2e.centerX,y:u2e.centerY}}),QLe=Mo(m1e,"down"),kLe=QLe.primitives.find((e)=>e.type==="text"&&e.text==="{REF}"),LLe=QLe.primitives.find((e)=>e.type==="text"&&e.text==="{VAL}");kLe.anchor="middle_bottom";LLe.anchor="middle_top";kLe.y+=0.3;kLe.x+=0.101;LLe.y-=0.49999;LLe.x+=1.19999;mSo=QLe,{paths:_So,texts:O2s,bounds:p2e,refblocks:vQe,circles:gSo}=W9t,X9t=yl({primitives:[...Object.values(_So),...Object.values(gSo),{type:"text",text:"{REF}",x:0.01596175000000022,y:-0.5308501500000009,anchor:"middle_top"},{type:"text",text:"{VAL}",x:0.013116750000000454,y:0.5408501499999989,anchor:"middle_bottom"}],ports:[{...vQe.left1,labels:["1"]},{...vQe.right1,labels:["2"]},{...vQe.right2,labels:["3"]}],size:{width:p2e.width,height:p2e.height},center:{x:p2e.centerX,y:p2e.centerY}}),HLe=Mo(m1e,"left"),FLe=HLe.primitives.find((e)=>e.type==="text"&&e.text==="{REF}"),zLe=HLe.primitives.find((e)=>e.type==="text"&&e.text==="{VAL}");FLe.anchor="middle_bottom";zLe.anchor="middle_top";FLe.y+=0.99;FLe.x-=0;zLe.y-=1.10999;zLe.x=0;ASo=HLe,OLe=Mo(m1e,"up"),VLe=OLe.primitives.find((e)=>e.type==="text"&&e.text==="{REF}"),YLe=OLe.primitives.find((e)=>e.type==="text"&&e.text==="{VAL}");VLe.anchor="middle_bottom";YLe.anchor="middle_top";VLe.y+=0.499;VLe.x=0.62;YLe.y-=0.29999;YLe.x+=0.1;fSo=OLe,ySo=Mo(X9t),GLe={paths:{"input-lead":{type:"path",points:[{x:-0.65,y:0.010000000000000231},{x:-0.30000000000000004,y:0.010000000000000231}],color:"primary",fill:!1},body:{type:"path",points:[{x:-0.30000000000000004,y:0.3600000000000001},{x:0.25,y:0.010000000000000231},{x:-0.30000000000000004,y:-0.33999999999999986},{x:-0.30000000000000004,y:0.3600000000000001}],color:"primary",fill:!1},"schmitt-marker":{type:"path",points:[{x:-0.17999999999999994,y:-0.08999999999999986},{x:-0.09999999999999987,y:-0.08999999999999986},{x:-0.09999999999999987,y:0.1100000000000001},{x:-0.019999999999999796,y:0.1100000000000001}],color:"primary",fill:!1},"output-lead":{type:"path",points:[{x:0.3800000000000001,y:0.010000000000000231},{x:0.6500000000000001,y:0.010000000000000231}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:0,y:0.4700000000000002},bottom1:{type:"text",text:"{VAL}",x:0,y:-0.47}},refblocks:{left1:{x:-0.65,y:0.010000000000000231},right1:{x:0.6500000000000001,y:0.010000000000000231}},bounds:{minX:-0.65,maxX:0.6500000000000001,minY:-0.47,maxY:0.4700000000000002,width:1.3000000000000003,height:0.9400000000000002,centerX:0.00000000000000005551115123125783,centerY:0.00000000000000011102230246251565},circles:{"inversion-bubble":{type:"circle",x:0.31499999999999995,y:0.010000000000000231,radius:0.065,color:"primary",fill:!1}}},xSo=gn(GLe).labelPort("left1",["1","in","input","a"]).labelPort("right1",["2","out","output","y"]).changeTextAnchor("{REF}","middle_bottom").changeTextAnchor("{VAL}","middle_top").rotateRightFacingSymbol("down").build(),j9t=gn(GLe).labelPort("left1",["1","in","input","a"]).labelPort("right1",["2","out","output","y"]).changeTextAnchor("{REF}","middle_bottom").changeTextAnchor("{VAL}","middle_top").rotateRightFacingSymbol("right").build(),CSo=wI(j9t),bSo=gn(GLe).labelPort("left1",["1","in","input","a"]).labelPort("right1",["2","out","output","y"]).changeTextAnchor("{REF}","middle_bottom").changeTextAnchor("{VAL}","middle_top").rotateRightFacingSymbol("up").build(),ISo={paths:{path40:{type:"path",points:[{x:0.14,y:0.04},{x:-0.12,y:-0.09}],color:"primary",fill:!1},path41:{type:"path",points:[{x:-0.12,y:0.18},{x:0.14,y:0.04}],color:"primary",fill:!1},path42:{type:"path",points:[{x:-0.12,y:-0.09},{x:-0.12,y:0.18}],color:"primary",fill:!1},path43:{type:"path",points:[{x:0.14,y:0.18},{x:0.14,y:-0.09}],color:"primary",fill:!1},path44:{type:"path",points:[{x:-0.12,y:0.04},{x:-0.52,y:0.04}],color:"primary",fill:!1},"path44-0":{type:"path",points:[{x:0.52,y:0.04},{x:0.15,y:0.04}],color:"primary",fill:!1},"path43-7":{type:"path",points:[{x:0.21,y:0.18},{x:0.14,y:0.18}],color:"primary",fill:!1},"path43-7-9":{type:"path",points:[{x:0.21,y:0.13},{x:0.21,y:0.18}],color:"primary",fill:!1},"path43-7-2":{type:"path",points:[{x:0.08,y:-0.09},{x:0.14,y:-0.09}],color:"primary",fill:!1},"path43-7-9-3":{type:"path",points:[{x:0.08,y:-0.04},{x:0.08,y:-0.09}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-0.01,y:0.27},bottom1:{type:"text",text:"{VAL}",x:0,y:-0.27}},refblocks:{left1:{x:-0.52,y:0.04},right1:{x:0.52,y:0.04}},bounds:{minX:-0.55,maxX:0.55,minY:-0.27,maxY:0.27,width:1.09,height:0.55,centerX:0,centerY:0},circles:{}},_1e=gn(ISo).labelPort("left1",["1","pos"]).labelPort("right1",["2","neg"]).changeTextAnchor("{VAL}","middle_top").changeTextAnchor("{REF}","middle_bottom").build(),ULe=Mo(_1e,"down"),WLe=ULe.primitives.find((e)=>e.type==="text"&&e.text==="{REF}"),XLe=ULe.primitives.find((e)=>e.type==="text"&&e.text==="{VAL}");WLe.anchor="middle_left";XLe.anchor="middle_left";WLe.y+=0.3;WLe.x=0.3;XLe.y-=0.3;XLe.x=0.3;vSo=ULe,jLe=Mo(_1e,"left"),KLe=jLe.primitives.find((e)=>e.type==="text"&&e.text==="{REF}"),$Le=jLe.primitives.find((e)=>e.type==="text"&&e.text==="{VAL}");KLe.anchor="middle_bottom";$Le.anchor="middle_top";KLe.y+=0.5;KLe.x=0;$Le.y-=0.55;$Le.x=0;SSo=jLe,qLe=Mo(_1e,"up"),JLe=qLe.primitives.find((e)=>e.type==="text"&&e.text==="{REF}"),ZLe=qLe.primitives.find((e)=>e.type==="text"&&e.text==="{VAL}");JLe.anchor="middle_left";ZLe.anchor="middle_left";JLe.y+=0.3;JLe.x=0.3;ZLe.y-=0.3;ZLe.x=0.3;PSo=qLe,K9t={paths:{path11:{type:"path",points:[{x:-0.52,y:0.04},{x:-0.18,y:0.04}],color:"primary",fill:!1},path12:{type:"path",points:[{x:0.19,y:0.05},{x:0.52,y:0.05}],color:"primary",fill:!1},"path12-6":{type:"path",points:[{x:0.18,y:-0.15},{x:0.18,y:0.25}],color:"primary",fill:!1},"path12-2":{type:"path",points:[{x:0.19,y:0},{x:0.35,y:-0.14}],color:"primary",fill:!1},"path12-2-9":{type:"path",points:[{x:0.35,y:-0.14},{x:0.34,y:-0.35}],color:"primary",fill:!1},"path11-0-9":{type:"path",points:[{x:-0.17,y:0.27},{x:-0.17,y:-0.15},{x:0.18,y:0.05},{x:-0.17,y:0.27}],color:"primary",fill:!0}},texts:{top1:{type:"text",text:"{REF}",x:-0.22,y:0.38},bottom1:{type:"text",text:"{VAL}",x:0.11,y:-0.38}},refblocks:{bottom1:{x:0.34,y:-0.35},left1:{x:-0.52,y:0.04},right1:{x:0.52,y:0.05}},bounds:{minX:-0.55,maxX:0.55,minY:-0.38,maxY:0.38,width:1.09,height:0.77,centerX:0,centerY:0},circles:{}},{paths:V2s,texts:Y2s,bounds:G2s,refblocks:U2s,circles:W2s}=K9t,$9t=gn(K9t).changeTextAnchor("{VAL}","middle_top").labelPort("left1",["1"]).labelPort("right1",["2"]).labelPort("bottom1",["3"]).changeTextAnchor("{REF}","middle_bottom").build(),q9t=Mo($9t),ESo=q9t.primitives.filter((e)=>e.type==="text"),J9t=ESo.find((e)=>e.text==="{REF}");J9t.y=0;J9t.anchor="middle_left";MSo=q9t,Z9t={paths:{path44:{type:"path",points:[{x:-0.195,y:-0.025},{x:-0.45,y:-0.025}],color:"primary",fill:!1},"path44-0":{type:"path",points:[{x:0.45,y:-0.025},{x:0.195,y:-0.025}],color:"primary",fill:!1},"path44-0-7":{type:"path",points:[{x:0.07,y:-0.025},{x:-0.07,y:-0.025}],color:"primary",fill:!1},path2:{type:"path",points:[{x:0.07,y:0.1},{x:0.07,y:-0.15}],color:"primary",fill:!0},"path2-8":{type:"path",points:[{x:-0.07,y:0.1},{x:-0.07,y:-0.15}],color:"primary",fill:!0},"path8704-1":{type:"path",points:[{x:-0.07,y:0.1},{x:-0.082252,y:0.099398},{x:-0.094386,y:0.097598},{x:-0.106286,y:0.094618},{x:-0.117835,y:0.090485},{x:-0.128925,y:0.08524},{x:-0.139446,y:0.078934},{x:-0.149299,y:0.071626},{x:-0.158388,y:0.063388},{x:-0.166626,y:0.054299},{x:-0.173934,y:0.044446},{x:-0.18024,y:0.033925},{x:-0.185485,y:0.022835},{x:-0.189618,y:0.011286},{x:-0.192598,y:-0.000614},{x:-0.194398,y:-0.012748},{x:-0.195,y:-0.025},{x:-0.194398,y:-0.037252},{x:-0.192598,y:-0.049386},{x:-0.189618,y:-0.061286},{x:-0.185485,y:-0.072835},{x:-0.18024,y:-0.083925},{x:-0.173934,y:-0.094446},{x:-0.166626,y:-0.104299},{x:-0.158388,y:-0.113388},{x:-0.149299,y:-0.121626},{x:-0.139446,y:-0.128934},{x:-0.128925,y:-0.13524},{x:-0.117835,y:-0.140485},{x:-0.106286,y:-0.144618},{x:-0.094386,y:-0.147598},{x:-0.082252,y:-0.149398},{x:-0.07,y:-0.15}],color:"primary",fill:!1},"path8704-1-7":{type:"path",points:[{x:0.07,y:0.1},{x:0.082252,y:0.099398},{x:0.094386,y:0.097598},{x:0.106286,y:0.094618},{x:0.117835,y:0.090485},{x:0.128925,y:0.08524},{x:0.139446,y:0.078934},{x:0.149299,y:0.071626},{x:0.158388,y:0.063388},{x:0.166626,y:0.054299},{x:0.173934,y:0.044446},{x:0.18024,y:0.033925},{x:0.185485,y:0.022835},{x:0.189618,y:0.011286},{x:0.192598,y:-0.000614},{x:0.194398,y:-0.012748},{x:0.195,y:-0.025},{x:0.194398,y:-0.037252},{x:0.192598,y:-0.049386},{x:0.189618,y:-0.061286},{x:0.185485,y:-0.072835},{x:0.18024,y:-0.083925},{x:0.173934,y:-0.094446},{x:0.166626,y:-0.104299},{x:0.158388,y:-0.113388},{x:0.149299,y:-0.121626},{x:0.139446,y:-0.128934},{x:0.128925,y:-0.13524},{x:0.117835,y:-0.140485},{x:0.106286,y:-0.144618},{x:0.094386,y:-0.147598},{x:0.082252,y:-0.149398},{x:0.07,y:-0.15}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-0.020635199999998965,y:0.15414649999999952}},refblocks:{left1:{x:-0.4458008,y:-0.025023700000000426},right1:{x:0.4458008,y:-0.02514810000000045}},bounds:{minX:-0.45,maxX:0.45,minY:-0.15,maxY:0.1,width:0.9,height:0.25,centerX:0,centerY:-0.025},circles:{}},wSo=gn(Z9t).rotateRightFacingSymbol("down").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_left").build(),eHe=gn(Z9t).rotateRightFacingSymbol("right").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_bottom").build(),evt=Mo(eHe,"left"),tHe=evt.primitives.find((e)=>e.type==="text"&&e.text==="{REF}");tHe.anchor="middle_bottom";tHe.y+=0.4;tHe.x=0;BSo=evt,tvt=Mo(eHe,"up"),nHe=tvt.primitives.find((e)=>e.type==="text"&&e.text==="{REF}");nHe.anchor="middle_left";nHe.y+=0;nHe.x=0.2;TSo=tvt,nvt={paths:{path44:{type:"path",points:[{x:-0.195,y:-0.025},{x:-0.45,y:-0.025}],color:"primary",fill:!1},"path44-0":{type:"path",points:[{x:0.45,y:-0.025},{x:0.195,y:-0.025}],color:"primary",fill:!1},path2:{type:"path",points:[{x:0.07,y:0.1},{x:0.07,y:-0.15}],color:"primary",fill:!0},"path2-8":{type:"path",points:[{x:-0.07,y:0.1},{x:-0.07,y:-0.15}],color:"primary",fill:!0},"path8704-1":{type:"path",points:[{x:-0.07,y:0.1},{x:-0.082252,y:0.099398},{x:-0.094386,y:0.097598},{x:-0.106286,y:0.094618},{x:-0.117835,y:0.090485},{x:-0.128925,y:0.08524},{x:-0.139446,y:0.078934},{x:-0.149299,y:0.071626},{x:-0.158388,y:0.063388},{x:-0.166626,y:0.054299},{x:-0.173934,y:0.044446},{x:-0.18024,y:0.033925},{x:-0.185485,y:0.022835},{x:-0.189618,y:0.011286},{x:-0.192598,y:-0.000614},{x:-0.194398,y:-0.012748},{x:-0.195,y:-0.025},{x:-0.194398,y:-0.037252},{x:-0.192598,y:-0.049386},{x:-0.189618,y:-0.061286},{x:-0.185485,y:-0.072835},{x:-0.18024,y:-0.083925},{x:-0.173934,y:-0.094446},{x:-0.166626,y:-0.104299},{x:-0.158388,y:-0.113388},{x:-0.149299,y:-0.121626},{x:-0.139446,y:-0.128934},{x:-0.128925,y:-0.13524},{x:-0.117835,y:-0.140485},{x:-0.106286,y:-0.144618},{x:-0.094386,y:-0.147598},{x:-0.082252,y:-0.149398},{x:-0.07,y:-0.15}],color:"primary",fill:!1},"path8704-1-7":{type:"path",points:[{x:0.07,y:0.1},{x:0.082252,y:0.099398},{x:0.094386,y:0.097598},{x:0.106286,y:0.094618},{x:0.117835,y:0.090485},{x:0.128925,y:0.08524},{x:0.139446,y:0.078934},{x:0.149299,y:0.071626},{x:0.158388,y:0.063388},{x:0.166626,y:0.054299},{x:0.173934,y:0.044446},{x:0.18024,y:0.033925},{x:0.185485,y:0.022835},{x:0.189618,y:0.011286},{x:0.192598,y:-0.000614},{x:0.194398,y:-0.012748},{x:0.195,y:-0.025},{x:0.194398,y:-0.037252},{x:0.192598,y:-0.049386},{x:0.189618,y:-0.061286},{x:0.185485,y:-0.072835},{x:0.18024,y:-0.083925},{x:0.173934,y:-0.094446},{x:0.166626,y:-0.104299},{x:0.158388,y:-0.113388},{x:0.149299,y:-0.121626},{x:0.139446,y:-0.128934},{x:0.128925,y:-0.13524},{x:0.117835,y:-0.140485},{x:0.106286,y:-0.144618},{x:0.094386,y:-0.147598},{x:0.082252,y:-0.149398},{x:0.07,y:-0.15}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-0.020635199999998965,y:0.15414649999999952}},refblocks:{left1:{x:-0.44,y:-0.02},right1:{x:0.4458008,y:-0.02514810000000045}},bounds:{minX:-0.45,maxX:0.45,minY:-0.15,maxY:0.1,width:0.9,height:0.25,centerX:0,centerY:-0.025},circles:{}},DSo=gn(nvt).rotateRightFacingSymbol("down").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_left").build(),oHe=gn(nvt).rotateRightFacingSymbol("right").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_bottom").build(),ovt=Mo(oHe,"left"),rHe=ovt.primitives.find((e)=>e.type==="text"&&e.text==="{REF}");rHe.anchor="middle_bottom";rHe.y+=0.4;rHe.x=0;NSo=ovt,rvt=Mo(oHe,"up"),iHe=rvt.primitives.find((e)=>e.type==="text"&&e.text==="{REF}");iHe.anchor="middle_left";iHe.y+=0.05;iHe.x=0.2;RSo=rvt,ivt={paths:{path44:{type:"path",points:[{x:-0.25,y:0.1},{x:-0.45,y:0.1}],color:"primary",fill:!1},"path44-0":{type:"path",points:[{x:0.45,y:0.1},{x:0.25,y:0.1}],color:"primary",fill:!1},"path44-5":{type:"path",points:[{x:0,y:-0.025},{x:0,y:-0.275}],color:"primary",fill:!1},path2:{type:"path",points:[{x:0.125,y:0.225},{x:0.125,y:-0.025}],color:"primary",fill:!0},"path2-88":{type:"path",points:[{x:0.045,y:0.225},{x:0.045,y:-0.025}],color:"primary",fill:!0},"path2-88-5":{type:"path",points:[{x:-0.045,y:0.225},{x:-0.045,y:-0.025}],color:"primary",fill:!0},"path2-88-5-1":{type:"path",points:[{x:0.045,y:0.225},{x:-0.045,y:0.225}],color:"primary",fill:!0},"path2-88-5-1-6":{type:"path",points:[{x:0.045,y:-0.025},{x:-0.045,y:-0.025}],color:"primary",fill:!0},"path2-8":{type:"path",points:[{x:-0.125,y:0.225},{x:-0.125,y:-0.025}],color:"primary",fill:!0},"path8704-1":{type:"path",points:[{x:-0.125,y:0.225},{x:-0.137252,y:0.224398},{x:-0.149386,y:0.222598},{x:-0.161286,y:0.219618},{x:-0.172835,y:0.215485},{x:-0.183925,y:0.21024},{x:-0.194446,y:0.203934},{x:-0.204299,y:0.196626},{x:-0.213388,y:0.188388},{x:-0.221626,y:0.179299},{x:-0.228934,y:0.169446},{x:-0.23524,y:0.158925},{x:-0.240485,y:0.147835},{x:-0.244618,y:0.136286},{x:-0.247598,y:0.124386},{x:-0.249398,y:0.112252},{x:-0.25,y:0.1},{x:-0.249398,y:0.087748},{x:-0.247598,y:0.075614},{x:-0.244618,y:0.063714},{x:-0.240485,y:0.052165},{x:-0.23524,y:0.041075},{x:-0.228934,y:0.030554},{x:-0.221626,y:0.020701},{x:-0.213388,y:0.011612},{x:-0.204299,y:0.003374},{x:-0.194446,y:-0.003934},{x:-0.183925,y:-0.01024},{x:-0.172835,y:-0.015485},{x:-0.161286,y:-0.019618},{x:-0.149386,y:-0.022598},{x:-0.137252,y:-0.024398},{x:-0.125,y:-0.025}],color:"primary",fill:!1},"path8704-1-7":{type:"path",points:[{x:0.125,y:0.225},{x:0.137252,y:0.224398},{x:0.149386,y:0.222598},{x:0.161286,y:0.219618},{x:0.172835,y:0.215485},{x:0.183925,y:0.21024},{x:0.194446,y:0.203934},{x:0.204299,y:0.196626},{x:0.213388,y:0.188388},{x:0.221626,y:0.179299},{x:0.228934,y:0.169446},{x:0.23524,y:0.158925},{x:0.240485,y:0.147835},{x:0.244618,y:0.136286},{x:0.247598,y:0.124386},{x:0.249398,y:0.112252},{x:0.25,y:0.1},{x:0.249398,y:0.087748},{x:0.247598,y:0.075614},{x:0.244618,y:0.063714},{x:0.240485,y:0.052165},{x:0.23524,y:0.041075},{x:0.228934,y:0.030554},{x:0.221626,y:0.020701},{x:0.213388,y:0.011612},{x:0.204299,y:0.003374},{x:0.194446,y:-0.003934},{x:0.183925,y:-0.01024},{x:0.172835,y:-0.015485},{x:0.161286,y:-0.019618},{x:0.149386,y:-0.022598},{x:0.137252,y:-0.024398},{x:0.125,y:-0.025}],color:"primary",fill:!1},path1:{type:"path",points:[{x:-0.045,y:0.1},{x:-0.125,y:0.1}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-0.020635199999998965,y:0.28075747049999955}},refblocks:{left1:{x:-0.45,y:0.1},right1:{x:0.45,y:0.1},bottom1:{x:0,y:-0.275}},bounds:{minX:-0.45,maxX:0.45,minY:-0.28,maxY:0.28,width:0.9,height:0.56,centerX:0,centerY:0},circles:{}},QSo=gn(ivt).rotateRightFacingSymbol("down").labelPort("left1",["1"]).labelPort("bottom1",["2"]).labelPort("right1",["3"]).changeTextAnchor("{REF}","middle_left").build(),sHe=gn(ivt).rotateRightFacingSymbol("right").labelPort("left1",["1"]).labelPort("bottom1",["2"]).labelPort("right1",["3"]).changeTextAnchor("{REF}","middle_bottom").build(),svt=Mo(sHe,"left"),aHe=svt.primitives.find((e)=>e.type==="text"&&e.text==="{REF}");aHe.anchor="middle_left";aHe.y+=0.5;aHe.x=0.2;kSo=svt,avt=Mo(sHe,"up"),cHe=avt.primitives.find((e)=>e.type==="text"&&e.text==="{REF}");cHe.anchor="middle_left";cHe.y+=0.3;cHe.x=0.2;LSo=avt,cvt={paths:{path44:{type:"path",points:[{x:-0.25,y:0.1},{x:-0.45,y:0.1}],color:"primary",fill:!1},"path44-0":{type:"path",points:[{x:0.45,y:0.1},{x:0.25,y:0.1}],color:"primary",fill:!1},"path44-5":{type:"path",points:[{x:0,y:-0.025},{x:0,y:-0.275}],color:"primary",fill:!1},path2:{type:"path",points:[{x:0.125,y:0.225},{x:0.125,y:-0.025}],color:"primary",fill:!0},"path2-88":{type:"path",points:[{x:0.045,y:0.225},{x:0.045,y:-0.025}],color:"primary",fill:!0},"path2-88-5":{type:"path",points:[{x:-0.045,y:0.225},{x:-0.045,y:-0.025}],color:"primary",fill:!0},"path2-88-5-1":{type:"path",points:[{x:0.045,y:0.225},{x:-0.045,y:0.225}],color:"primary",fill:!0},"path2-88-5-1-6":{type:"path",points:[{x:0.045,y:-0.025},{x:-0.045,y:-0.025}],color:"primary",fill:!0},"path2-8":{type:"path",points:[{x:-0.125,y:0.225},{x:-0.125,y:-0.025}],color:"primary",fill:!0},"path8704-1":{type:"path",points:[{x:-0.125,y:0.225},{x:-0.137252,y:0.224398},{x:-0.149386,y:0.222598},{x:-0.161286,y:0.219618},{x:-0.172835,y:0.215485},{x:-0.183925,y:0.21024},{x:-0.194446,y:0.203934},{x:-0.204299,y:0.196626},{x:-0.213388,y:0.188388},{x:-0.221626,y:0.179299},{x:-0.228934,y:0.169446},{x:-0.23524,y:0.158925},{x:-0.240485,y:0.147835},{x:-0.244618,y:0.136286},{x:-0.247598,y:0.124386},{x:-0.249398,y:0.112252},{x:-0.25,y:0.1},{x:-0.249398,y:0.087748},{x:-0.247598,y:0.075614},{x:-0.244618,y:0.063714},{x:-0.240485,y:0.052165},{x:-0.23524,y:0.041075},{x:-0.228934,y:0.030554},{x:-0.221626,y:0.020701},{x:-0.213388,y:0.011612},{x:-0.204299,y:0.003374},{x:-0.194446,y:-0.003934},{x:-0.183925,y:-0.01024},{x:-0.172835,y:-0.015485},{x:-0.161286,y:-0.019618},{x:-0.149386,y:-0.022598},{x:-0.137252,y:-0.024398},{x:-0.125,y:-0.025}],color:"primary",fill:!1},"path8704-1-7":{type:"path",points:[{x:0.125,y:0.225},{x:0.137252,y:0.224398},{x:0.149386,y:0.222598},{x:0.161286,y:0.219618},{x:0.172835,y:0.215485},{x:0.183925,y:0.21024},{x:0.194446,y:0.203934},{x:0.204299,y:0.196626},{x:0.213388,y:0.188388},{x:0.221626,y:0.179299},{x:0.228934,y:0.169446},{x:0.23524,y:0.158925},{x:0.240485,y:0.147835},{x:0.244618,y:0.136286},{x:0.247598,y:0.124386},{x:0.249398,y:0.112252},{x:0.25,y:0.1},{x:0.249398,y:0.087748},{x:0.247598,y:0.075614},{x:0.244618,y:0.063714},{x:0.240485,y:0.052165},{x:0.23524,y:0.041075},{x:0.228934,y:0.030554},{x:0.221626,y:0.020701},{x:0.213388,y:0.011612},{x:0.204299,y:0.003374},{x:0.194446,y:-0.003934},{x:0.183925,y:-0.01024},{x:0.172835,y:-0.015485},{x:0.161286,y:-0.019618},{x:0.149386,y:-0.022598},{x:0.137252,y:-0.024398},{x:0.125,y:-0.025}],color:"primary",fill:!1},path1:{type:"path",points:[{x:-0.045,y:0.1},{x:-0.125,y:0.1}],color:"primary",fill:!1},"path44-0-7":{type:"path",points:[{x:0.125,y:0.1},{x:0.045,y:0.1}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:0,y:0.28}},refblocks:{left1:{x:-0.45,y:0.1},right1:{x:0.45,y:0.1},bottom1:{x:0,y:-0.275}},bounds:{minX:-0.45,maxX:0.45,minY:-0.28,maxY:0.28,width:0.9,height:0.56,centerX:0,centerY:0},circles:{}},HSo=gn(cvt).rotateRightFacingSymbol("down").labelPort("left1",["1"]).labelPort("bottom1",["2"]).labelPort("right1",["3"]).changeTextAnchor("{REF}","middle_left").build(),lHe=gn(cvt).rotateRightFacingSymbol("right").labelPort("left1",["1"]).labelPort("bottom1",["2"]).labelPort("right1",["3"]).changeTextAnchor("{REF}","middle_bottom").build(),lvt=Mo(lHe,"left"),hHe=lvt.primitives.find((e)=>e.type==="text"&&e.text==="{REF}");hHe.anchor="middle_left";hHe.y+=0.5;hHe.x=0.2;FSo=lvt,hvt=Mo(lHe,"up"),dHe=hvt.primitives.find((e)=>e.type==="text"&&e.text==="{REF}");dHe.anchor="middle_left";dHe.y+=0.4;dHe.x=0.2;zSo=hvt,dvt={paths:{path44:{type:"path",points:[{x:-0.25,y:0.1},{x:-0.45,y:0.1}],color:"primary",fill:!1},"path44-0":{type:"path",points:[{x:0.45,y:0.1},{x:0.25,y:0.1}],color:"primary",fill:!1},"path44-5":{type:"path",points:[{x:0,y:-0.025},{x:0,y:-0.275}],color:"primary",fill:!1},path2:{type:"path",points:[{x:0.125,y:0.225},{x:0.125,y:-0.025}],color:"primary",fill:!0},"path2-88":{type:"path",points:[{x:0.045,y:0.225},{x:0.045,y:-0.025}],color:"primary",fill:!0},"path2-88-5":{type:"path",points:[{x:-0.045,y:0.225},{x:-0.045,y:-0.025}],color:"primary",fill:!0},"path2-88-5-1":{type:"path",points:[{x:0.045,y:0.225},{x:-0.045,y:0.225}],color:"primary",fill:!0},"path2-88-5-1-6":{type:"path",points:[{x:0.045,y:-0.025},{x:-0.045,y:-0.025}],color:"primary",fill:!0},"path2-8":{type:"path",points:[{x:-0.125,y:0.225},{x:-0.125,y:-0.025}],color:"primary",fill:!0},"path8704-1":{type:"path",points:[{x:-0.125,y:0.225},{x:-0.137252,y:0.224398},{x:-0.149386,y:0.222598},{x:-0.161286,y:0.219618},{x:-0.172835,y:0.215485},{x:-0.183925,y:0.21024},{x:-0.194446,y:0.203934},{x:-0.204299,y:0.196626},{x:-0.213388,y:0.188388},{x:-0.221626,y:0.179299},{x:-0.228934,y:0.169446},{x:-0.23524,y:0.158925},{x:-0.240485,y:0.147835},{x:-0.244618,y:0.136286},{x:-0.247598,y:0.124386},{x:-0.249398,y:0.112252},{x:-0.25,y:0.1},{x:-0.249398,y:0.087748},{x:-0.247598,y:0.075614},{x:-0.244618,y:0.063714},{x:-0.240485,y:0.052165},{x:-0.23524,y:0.041075},{x:-0.228934,y:0.030554},{x:-0.221626,y:0.020701},{x:-0.213388,y:0.011612},{x:-0.204299,y:0.003374},{x:-0.194446,y:-0.003934},{x:-0.183925,y:-0.01024},{x:-0.172835,y:-0.015485},{x:-0.161286,y:-0.019618},{x:-0.149386,y:-0.022598},{x:-0.137252,y:-0.024398},{x:-0.125,y:-0.025}],color:"primary",fill:!1},"path8704-1-7":{type:"path",points:[{x:0.125,y:0.225},{x:0.137252,y:0.224398},{x:0.149386,y:0.222598},{x:0.161286,y:0.219618},{x:0.172835,y:0.215485},{x:0.183925,y:0.21024},{x:0.194446,y:0.203934},{x:0.204299,y:0.196626},{x:0.213388,y:0.188388},{x:0.221626,y:0.179299},{x:0.228934,y:0.169446},{x:0.23524,y:0.158925},{x:0.240485,y:0.147835},{x:0.244618,y:0.136286},{x:0.247598,y:0.124386},{x:0.249398,y:0.112252},{x:0.25,y:0.1},{x:0.249398,y:0.087748},{x:0.247598,y:0.075614},{x:0.244618,y:0.063714},{x:0.240485,y:0.052165},{x:0.23524,y:0.041075},{x:0.228934,y:0.030554},{x:0.221626,y:0.020701},{x:0.213388,y:0.011612},{x:0.204299,y:0.003374},{x:0.194446,y:-0.003934},{x:0.183925,y:-0.01024},{x:0.172835,y:-0.015485},{x:0.161286,y:-0.019618},{x:0.149386,y:-0.022598},{x:0.137252,y:-0.024398},{x:0.125,y:-0.025}],color:"primary",fill:!1},"path44-0-7":{type:"path",points:[{x:0.125,y:0.1},{x:0.045,y:0.1}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:0,y:0.28}},refblocks:{left1:{x:-0.45,y:0.1},right1:{x:0.45,y:0.1},bottom1:{x:0,y:-0.275}},bounds:{minX:-0.45,maxX:0.45,minY:-0.28,maxY:0.28,width:0.9,height:0.56,centerX:0,centerY:0},circles:{}},OSo=gn(dvt).rotateRightFacingSymbol("down").labelPort("left1",["1"]).labelPort("bottom1",["2"]).labelPort("right1",["3"]).changeTextAnchor("{REF}","middle_left").build(),uHe=gn(dvt).rotateRightFacingSymbol("right").labelPort("left1",["1"]).labelPort("bottom1",["2"]).labelPort("right1",["3"]).changeTextAnchor("{REF}","middle_bottom").build(),uvt=Mo(uHe,"left"),pHe=uvt.primitives.find((e)=>e.type==="text"&&e.text==="{REF}");pHe.anchor="middle_left";pHe.y+=0.6;pHe.x=0.3;VSo=uvt,pvt=Mo(uHe,"up"),mHe=pvt.primitives.find((e)=>e.type==="text"&&e.text==="{REF}");mHe.anchor="middle_left";mHe.y+=0.4;mHe.x=0.2;YSo=pvt,mvt={paths:{path44:{type:"path",points:[{x:-0.25,y:0.1},{x:-0.45,y:0.1}],color:"primary",fill:!1},"path44-0":{type:"path",points:[{x:0.45,y:0.1},{x:0.25,y:0.1}],color:"primary",fill:!1},"path44-5":{type:"path",points:[{x:0,y:-0.025},{x:0,y:-0.275}],color:"primary",fill:!1},path2:{type:"path",points:[{x:0.125,y:0.225},{x:0.125,y:-0.025}],color:"primary",fill:!0},"path2-88":{type:"path",points:[{x:0.045,y:0.225},{x:0.045,y:-0.025}],color:"primary",fill:!0},"path2-88-5":{type:"path",points:[{x:-0.045,y:0.225},{x:-0.045,y:-0.025}],color:"primary",fill:!0},"path2-88-5-1":{type:"path",points:[{x:0.045,y:0.225},{x:-0.045,y:0.225}],color:"primary",fill:!0},"path2-88-5-1-6":{type:"path",points:[{x:0.045,y:-0.025},{x:-0.045,y:-0.025}],color:"primary",fill:!0},"path2-8":{type:"path",points:[{x:-0.125,y:0.225},{x:-0.125,y:-0.025}],color:"primary",fill:!0},"path8704-1":{type:"path",points:[{x:-0.125,y:0.225},{x:-0.137252,y:0.224398},{x:-0.149386,y:0.222598},{x:-0.161286,y:0.219618},{x:-0.172835,y:0.215485},{x:-0.183925,y:0.21024},{x:-0.194446,y:0.203934},{x:-0.204299,y:0.196626},{x:-0.213388,y:0.188388},{x:-0.221626,y:0.179299},{x:-0.228934,y:0.169446},{x:-0.23524,y:0.158925},{x:-0.240485,y:0.147835},{x:-0.244618,y:0.136286},{x:-0.247598,y:0.124386},{x:-0.249398,y:0.112252},{x:-0.25,y:0.1},{x:-0.249398,y:0.087748},{x:-0.247598,y:0.075614},{x:-0.244618,y:0.063714},{x:-0.240485,y:0.052165},{x:-0.23524,y:0.041075},{x:-0.228934,y:0.030554},{x:-0.221626,y:0.020701},{x:-0.213388,y:0.011612},{x:-0.204299,y:0.003374},{x:-0.194446,y:-0.003934},{x:-0.183925,y:-0.01024},{x:-0.172835,y:-0.015485},{x:-0.161286,y:-0.019618},{x:-0.149386,y:-0.022598},{x:-0.137252,y:-0.024398},{x:-0.125,y:-0.025}],color:"primary",fill:!1},"path8704-1-7":{type:"path",points:[{x:0.125,y:0.225},{x:0.137252,y:0.224398},{x:0.149386,y:0.222598},{x:0.161286,y:0.219618},{x:0.172835,y:0.215485},{x:0.183925,y:0.21024},{x:0.194446,y:0.203934},{x:0.204299,y:0.196626},{x:0.213388,y:0.188388},{x:0.221626,y:0.179299},{x:0.228934,y:0.169446},{x:0.23524,y:0.158925},{x:0.240485,y:0.147835},{x:0.244618,y:0.136286},{x:0.247598,y:0.124386},{x:0.249398,y:0.112252},{x:0.25,y:0.1},{x:0.249398,y:0.087748},{x:0.247598,y:0.075614},{x:0.244618,y:0.063714},{x:0.240485,y:0.052165},{x:0.23524,y:0.041075},{x:0.228934,y:0.030554},{x:0.221626,y:0.020701},{x:0.213388,y:0.011612},{x:0.204299,y:0.003374},{x:0.194446,y:-0.003934},{x:0.183925,y:-0.01024},{x:0.172835,y:-0.015485},{x:0.161286,y:-0.019618},{x:0.149386,y:-0.022598},{x:0.137252,y:-0.024398},{x:0.125,y:-0.025}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-0.020635199999998965,y:0.28075747049999955}},refblocks:{left1:{x:-0.45,y:0.1},right1:{x:0.45,y:0.1},bottom1:{x:0,y:-0.275}},bounds:{minX:-0.45,maxX:0.45,minY:-0.28,maxY:0.28,width:0.9,height:0.56,centerX:0,centerY:0},circles:{}},GSo=gn(mvt).rotateRightFacingSymbol("down").labelPort("left1",["1"]).labelPort("bottom1",["2"]).labelPort("right1",["3"]).changeTextAnchor("{REF}","middle_left").build(),_He=gn(mvt).rotateRightFacingSymbol("right").labelPort("left1",["1"]).labelPort("bottom1",["2"]).labelPort("right1",["3"]).changeTextAnchor("{REF}","middle_bottom").build(),_vt=Mo(_He,"left"),gHe=_vt.primitives.find((e)=>e.type==="text"&&e.text==="{REF}");gHe.anchor="middle_left";gHe.y+=0.5;gHe.x=0.3;USo=_vt,gvt=Mo(_He,"up"),AHe=gvt.primitives.find((e)=>e.type==="text"&&e.text==="{REF}");AHe.anchor="middle_left";AHe.y+=0.3;AHe.x=0.2;WSo=gvt,XSo={paths:{path1:{type:"path",points:[{x:-0.37,y:0.03},{x:-0.13,y:0.03}],color:"primary",fill:!1},"path-1-3":{type:"path",points:[{x:-0.07,y:0.03},{x:0.11,y:-0.03}],color:"primary",fill:!1},path2:{type:"path",points:[{x:0.1,y:-0.06},{x:0.37,y:-0.06}],color:"primary",fill:!1},path3:{type:"path",points:[{x:0.12,y:0.17},{x:0.37,y:0.17}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:0,y:0.37},bottom1:{type:"text",text:"{VAL}",x:0,y:-0.37}},refblocks:{left1:{x:-0.37,y:0.03},right1:{x:0.37,y:-0.06},right2:{x:0.37,y:0.17}},bounds:{minX:-0.4,maxX:0.4,minY:-0.4,maxY:0.4,width:0.79,height:0.79,centerX:0,centerY:0},circles:{"circle-3":{type:"circle",x:0.08,y:-0.07,radius:0.02,color:"primary",fill:!1},"circle-1":{type:"circle",x:-0.1,y:0.03,radius:0.02,color:"primary",fill:!1},"circle-2":{type:"circle",x:0.08,y:0.17,radius:0.02,color:"primary",fill:!1}}},g1e=gn(XSo).changeTextAnchor("{VAL}","middle_top").labelPort("left1",["1"]).labelPort("right2",["2"]).labelPort("right1",["3"]).changeTextAnchor("{REF}","middle_bottom").build(),fHe=Mo(g1e,"down"),yHe=fHe.primitives.find((e)=>e.type==="text"&&e.text==="{REF}"),xHe=fHe.primitives.find((e)=>e.type==="text"&&e.text==="{VAL}");yHe.anchor="middle_bottom";xHe.anchor="middle_top";yHe.x=0.44;yHe.y+=0.28;xHe.y-=0.28;xHe.x=0.44;jSo=fHe,CHe=Mo(g1e,"left"),bHe=CHe.primitives.find((e)=>e.type==="text"&&e.text==="{REF}"),IHe=CHe.primitives.find((e)=>e.type==="text"&&e.text==="{VAL}");bHe.anchor="middle_bottom";IHe.anchor="middle_top";bHe.x=0;bHe.y+=0.625;IHe.y-=0.695;IHe.x=0;KSo=CHe,vHe=Mo(g1e,"up"),SHe=vHe.primitives.find((e)=>e.type==="text"&&e.text==="{REF}"),PHe=vHe.primitives.find((e)=>e.type==="text"&&e.text==="{VAL}");SHe.anchor="middle_bottom";PHe.anchor="middle_top";SHe.x=0.4;SHe.y+=0.28;PHe.y-=0.28;PHe.x=0.4;$So=vHe,qSo={paths:{path1:{type:"path",points:[{x:-0.37,y:0.03},{x:-0.13,y:0.03}],color:"primary",fill:!1},"path-1-3":{type:"path",points:[{x:-0.07,y:0.03},{x:0.11,y:0.14}],color:"primary",fill:!1},path2:{type:"path",points:[{x:0.1,y:-0.06},{x:0.37,y:-0.06}],color:"primary",fill:!1},path3:{type:"path",points:[{x:0.12,y:0.17},{x:0.37,y:0.17}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:0,y:0.4},bottom1:{type:"text",text:"{VAL}",x:0,y:-0.4}},refblocks:{left1:{x:-0.37,y:0.03},right1:{x:0.37,y:-0.06},right3:{x:0.37,y:0.17}},bounds:{minX:-0.4,maxX:0.4,minY:-0.4,maxY:0.4,width:0.79,height:0.79,centerX:0,centerY:0},circles:{"circle-3":{type:"circle",x:0.08,y:-0.07,radius:0.02,color:"primary",fill:!1},"circle-1":{type:"circle",x:-0.1,y:0.03,radius:0.02,color:"primary",fill:!1},"circle-2":{type:"circle",x:0.08,y:0.17,radius:0.02,color:"primary",fill:!1}}},A1e=gn(qSo).changeTextAnchor("{VAL}","middle_top").labelPort("left1",["1"]).labelPort("right3",["2"]).labelPort("right1",["3"]).changeTextAnchor("{REF}","middle_bottom").build(),EHe=Mo(A1e,"down"),MHe=EHe.primitives.find((e)=>e.type==="text"&&e.text==="{REF}"),wHe=EHe.primitives.find((e)=>e.type==="text"&&e.text==="{VAL}");MHe.anchor="middle_bottom";wHe.anchor="middle_top";MHe.x=0.44;MHe.y+=0.28;wHe.y-=0.28;wHe.x=0.44;JSo=EHe,BHe=Mo(A1e,"left"),THe=BHe.primitives.find((e)=>e.type==="text"&&e.text==="{REF}"),DHe=BHe.primitives.find((e)=>e.type==="text"&&e.text==="{VAL}");THe.anchor="middle_bottom";DHe.anchor="middle_top";THe.x=0;THe.y+=0.625;DHe.y-=0.695;DHe.x=0;ZSo=BHe,NHe=Mo(A1e,"up"),RHe=NHe.primitives.find((e)=>e.type==="text"&&e.text==="{REF}"),QHe=NHe.primitives.find((e)=>e.type==="text"&&e.text==="{VAL}");RHe.anchor="middle_bottom";QHe.anchor="middle_top";RHe.x=0.4;RHe.y+=0.28;QHe.y-=0.28;QHe.x=0.4;ePo=NHe,tj={paths:{"lead-positive":{type:"path",points:[{x:-0.4,y:0.19999999999999996},{x:-0.20000000000000007,y:0.19999999999999996}],color:"primary",fill:!1},"lead-negative":{type:"path",points:[{x:-0.4,y:-0.20000000000000018},{x:-0.20000000000000007,y:-0.20000000000000018}],color:"primary",fill:!1},"voice-coil":{type:"path",points:[{x:-0.20000000000000007,y:0.19999999999999996},{x:0,y:0.19999999999999996},{x:0,y:-0.20000000000000018},{x:-0.20000000000000007,y:-0.20000000000000018},{x:-0.20000000000000007,y:0.19999999999999996}],color:"primary",fill:!1},cone:{type:"path",points:[{x:0,y:0.19999999999999996},{x:0.3999999999999999,y:0.3999999999999999},{x:0.3999999999999999,y:-0.40000000000000013},{x:0,y:-0.20000000000000018},{x:0,y:0.19999999999999996}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:0,y:0.6},bottom1:{type:"text",text:"{VAL}",x:0,y:-0.6000000000000001}},refblocks:{left1:{x:-0.4,y:-0.20000000000000018},left2:{x:-0.4,y:0.19999999999999996}},bounds:{minX:-0.4,maxX:0.3999999999999999,minY:-0.6000000000000001,maxY:0.6,width:0.7999999999999999,height:1.2000000000000002,centerX:-0.00000000000000005551115123125783,centerY:-0.00000000000000005551115123125783},circles:{}},Avt=gn(tj).rotateRightFacingSymbol("down").labelPort("left1",["2","neg"]).labelPort("left2",["1","pos"]).changeTextAnchor("{REF}","middle_bottom").changeTextAnchor("{VAL}","middle_top").build(),m2e=bM(Avt.primitives),tPo={...Avt,center:{x:(m2e.minX+m2e.maxX)/2,y:(m2e.minY+m2e.maxY)/2}},fvt=gn(tj).rotateRightFacingSymbol("right").labelPort("left1",["2","neg"]).labelPort("left2",["1","pos"]).changeTextAnchor("{REF}","middle_bottom").changeTextAnchor("{VAL}","middle_top").build(),_2e=bM(fvt.primitives),nPo={...fvt,center:{x:(_2e.minX+_2e.maxX)/2,y:(_2e.minY+_2e.maxY)/2}},yvt=gn(tj).rotateRightFacingSymbol("left").labelPort("left1",["2","neg"]).labelPort("left2",["1","pos"]).changeTextAnchor("{REF}","middle_bottom").changeTextAnchor("{VAL}","middle_top").build(),g2e=bM(yvt.primitives),oPo={...yvt,center:{x:(g2e.minX+g2e.maxX)/2,y:(g2e.minY+g2e.maxY)/2}},xvt=gn(tj).rotateRightFacingSymbol("right").labelPort("left1",["2","neg"]).labelPort("left2",["1","pos"]).changeTextAnchor("{REF}","middle_bottom").changeTextAnchor("{VAL}","middle_top").build(),A2e=bM(xvt.primitives),rPo={...xvt,center:{x:(A2e.minX+A2e.maxX)/2,y:(A2e.minY+A2e.maxY)/2}},Cvt=gn(tj).rotateRightFacingSymbol("up").labelPort("left1",["2","neg"]).labelPort("left2",["1","pos"]).changeTextAnchor("{REF}","middle_bottom").changeTextAnchor("{VAL}","middle_top").build(),f2e=bM(Cvt.primitives),iPo={...Cvt,center:{x:(f2e.minX+f2e.maxX)/2,y:(f2e.minY+f2e.maxY)/2}},bvt=gn(tj).rotateRightFacingSymbol("up").labelPort("left1",["2","neg"]).labelPort("left2",["1","pos"]).changeTextAnchor("{REF}","middle_bottom").changeTextAnchor("{VAL}","middle_top").build(),y2e=bM(bvt.primitives),sPo={...bvt,center:{x:(y2e.minX+y2e.maxX)/2,y:(y2e.minY+y2e.maxY)/2}},f1e={paths:{path11:{type:"path",points:[{x:-0.38,y:0},{x:-0.12,y:-0.01}],color:"primary",fill:!1},"path11-0":{type:"path",points:[{x:-0.07,y:0},{x:0.11,y:0.05}],color:"primary",fill:!1},path12:{type:"path",points:[{x:0.12,y:-0.01},{x:0.38,y:0}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:0,y:0.31},bottom1:{type:"text",text:"{VAL}",x:0,y:-0.28}},refblocks:{left1:{x:-0.12,y:-0.01},left2:{x:-0.38,y:0},right1:{x:0.12,y:-0.01},right2:{x:0.38,y:0}},bounds:{minX:-0.4,maxX:0.4,minY:-0.25,maxY:0.25,width:0.81,height:0.5,centerX:0,centerY:0},circles:{"circle-2":{type:"circle",x:0.1,y:0,radius:0.02,color:"primary",fill:!1},"circle-1":{type:"circle",x:-0.1,y:0,radius:0.02,color:"primary",fill:!1}}};delete f1e.refblocks.left1;delete f1e.refblocks.right1;f1e.bounds.width+=0.2;y1e=gn(f1e).changeTextAnchor("{VAL}","middle_top").labelPort("left2",["1"]).labelPort("right2",["2"]).changeTextAnchor("{REF}","middle_bottom").build(),kHe=Mo(y1e,"down"),LHe=kHe.primitives.find((e)=>e.type==="text"&&e.text==="{REF}"),HHe=kHe.primitives.find((e)=>e.type==="text"&&e.text==="{VAL}");LHe.anchor="middle_bottom";HHe.anchor="middle_top";LHe.x=0.3;LHe.y+=0.265;HHe.y-=0.265;HHe.x=0.3;aPo=kHe,FHe=Mo(y1e,"left"),zHe=FHe.primitives.find((e)=>e.type==="text"&&e.text==="{REF}"),OHe=FHe.primitives.find((e)=>e.type==="text"&&e.text==="{VAL}");zHe.anchor="middle_bottom";OHe.anchor="middle_top";zHe.x=0;zHe.y+=0.57;OHe.y-=0.57;OHe.x=0;cPo=FHe,VHe=Mo(y1e,"up"),YHe=VHe.primitives.find((e)=>e.type==="text"&&e.text==="{REF}"),GHe=VHe.primitives.find((e)=>e.type==="text"&&e.text==="{VAL}");YHe.anchor="middle_bottom";GHe.anchor="middle_top";YHe.x=0.3;YHe.y+=0.265;GHe.y-=0.265;GHe.x=0.3;lPo=VHe,x1e={paths:{path11:{type:"path",points:[{x:-0.38,y:0},{x:-0.12,y:-0.01}],color:"primary",fill:!1},"path11-0":{type:"path",points:[{x:-0.07,y:0.01},{x:0.1,y:0.14}],color:"primary",fill:!1},path12:{type:"path",points:[{x:0.12,y:-0.01},{x:0.38,y:0}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:0,y:0.25},bottom1:{type:"text",text:"{VAL}",x:0,y:-0.25}},refblocks:{left1:{x:-0.12,y:-0.01},left2:{x:-0.38,y:0},right1:{x:0.12,y:-0.01},right2:{x:0.38,y:0}},bounds:{minX:-0.4,maxX:0.4,minY:-0.25,maxY:0.25,width:0.81,height:0.5,centerX:0,centerY:0},circles:{"circle-2":{type:"circle",x:0.1,y:0,radius:0.02,color:"primary",fill:!1},"circle-1":{type:"circle",x:-0.1,y:0,radius:0.02,color:"primary",fill:!1}}};delete x1e.refblocks.left1;delete x1e.refblocks.right1;x1e.bounds.width+=0.2;C1e=gn(x1e).changeTextAnchor("{VAL}","middle_top").labelPort("left2",["1"]).labelPort("right2",["2"]).changeTextAnchor("{REF}","middle_bottom").build(),UHe=Mo(C1e,"down"),WHe=UHe.primitives.find((e)=>e.type==="text"&&e.text==="{REF}"),XHe=UHe.primitives.find((e)=>e.type==="text"&&e.text==="{VAL}");WHe.anchor="middle_bottom";XHe.anchor="middle_top";WHe.x=0.3;WHe.y+=0.265;XHe.y-=0.265;XHe.x=0.3;hPo=UHe,jHe=Mo(C1e,"left"),KHe=jHe.primitives.find((e)=>e.type==="text"&&e.text==="{REF}"),$He=jHe.primitives.find((e)=>e.type==="text"&&e.text==="{VAL}");KHe.anchor="middle_bottom";$He.anchor="middle_top";KHe.x=0;KHe.y+=0.57;$He.y-=0.57;$He.x=0;dPo=jHe,qHe=Mo(C1e,"up"),JHe=qHe.primitives.find((e)=>e.type==="text"&&e.text==="{REF}"),ZHe=qHe.primitives.find((e)=>e.type==="text"&&e.text==="{VAL}");JHe.anchor="middle_bottom";ZHe.anchor="middle_top";JHe.x=0.3;JHe.y+=0.265;ZHe.y-=0.265;ZHe.x=0.3;uPo=qHe,b1e={paths:{path44:{type:"path",points:[{x:-0.16845120000000047,y:0.02621170000000017},{x:-0.4458008,y:0.02709619999999968}],color:"primary",fill:!1},"path44-0":{type:"path",points:[{x:0.4458008,y:0.026971799999999657},{x:0.1677968999999997,y:0.027926399999999685}],color:"primary",fill:!1},"path8704-1":{type:"path",points:[{x:-0.0040837000000002455,y:-0.13467459999999964},{x:-0.0040837000000002455,y:-0.13467459999999964},{x:-0.017668143940740948,y:-0.1311205263185182},{x:-0.03043520885925943,y:-0.12727072121481456},{x:-0.04240966440000013,y:-0.1231399985999998},{x:-0.05361628020740751,y:-0.11874317238518502},{x:-0.064079825925926,y:-0.11409505648148131},{x:-0.07382507120000005,y:-0.10921046479999987},{x:-0.0828767856740741,y:-0.10410421125185171},{x:-0.0912597389925926,y:-0.09879110974814802},{x:-0.09899870079999995,y:-0.0932859741999998},{x:-0.10611844074074069,y:-0.08760361851851838},{x:-0.11264372845925916,y:-0.0817588566148146},{x:-0.11859933359999993,y:-0.07576650239999982},{x:-0.12401002580740728,y:-0.06964136978518495},{x:-0.12890057472592584,y:-0.06339827268148127},{x:-0.13329574999999985,y:-0.05705202499999972},{x:-0.13722032127407394,y:-0.05061744065185156},{x:-0.14069905819259243,y:-0.04410933354814783},{x:-0.14375673039999987,y:-0.03754251759999966},{x:-0.14641810754074058,y:-0.030931806718518143},{x:-0.1487079592592591,y:-0.0242920148148144},{x:-0.15065105519999983,y:-0.017637955799999563},{x:-0.15227216500740723,y:-0.01098444358518472},{x:-0.15359605832592574,y:-0.004346292081480994},{x:-0.1546475047999998,y:0.00226168480000051},{x:-0.15545127407407386,y:0.008824673148148676},{x:-0.1560321357925924,y:0.015327859051852397},{x:-0.1564148595999998,y:0.02175642860000056},{x:-0.1566242151407405,y:0.028095567881482052},{x:-0.15668497205925902,y:0.03433046298518576},{x:-0.15662189999999976,y:0.04044630000000058},{x:-0.15662189999999976,y:0.0404463000000006},{x:-0.15662189999999976,y:0.0404463000000006},{x:-0.15622857394444417,y:0.04717166472222282},{x:-0.1553217675555553,y:0.05388046444444503},{x:-0.15392183849999977,y:0.060558907500000585},{x:-0.1520491444444442,y:0.0671932022222228},{x:-0.1497240430555553,y:0.07376955694444502},{x:-0.14696689199999974,y:0.08027418000000058},{x:-0.14379804894444415,y:0.0866932797222228},{x:-0.1402378715555553,y:0.09301306444444506},{x:-0.13630671749999965,y:0.09921974250000057},{x:-0.13202494444444415,y:0.10529952222222282},{x:-0.12741291005555522,y:0.11123861194444501},{x:-0.1224909719999997,y:0.1170232200000006},{x:-0.11727948794444407,y:0.12263955472222278},{x:-0.11179881555555524,y:0.12807382444444504},{x:-0.10606931249999965,y:0.13331223750000057},{x:-0.1001113364444441,y:0.13834100222222284},{x:-0.09394524505555521,y:0.14314632694444504},{x:-0.08759139599999967,y:0.14771442000000062},{x:-0.08107014694444413,y:0.15203148972222283},{x:-0.07440185555555523,y:0.15608374444444503},{x:-0.0676068794999997,y:0.15985739250000058},{x:-0.06070557644444415,y:0.16333864222222283},{x:-0.05371830405555529,y:0.16651370194444504},{x:-0.04666541999999976,y:0.1693687800000006},{x:-0.03956728194444424,y:0.1718900847222228},{x:-0.03244424755555539,y:0.17406382444444501},{x:-0.025316674499999876,y:0.17587620750000055},{x:-0.01820492044444437,y:0.17731344222222278},{x:-0.01112934305555553,y:0.178361736944445},{x:-0.004110300000000034,y:0.17900730000000054},{x:-0.004110300000000011,y:0.17900730000000054}],color:"primary",fill:!1},"path8704-1-9":{type:"path",points:[{x:0.004158700000000071,y:-0.1355885000000001},{x:0.004158700000000071,y:-0.1355885000000001},{x:0.017743143940740766,y:-0.1320344263185187},{x:0.03051020885925925,y:-0.12818462121481505},{x:0.042484664399999955,y:-0.12405389860000024},{x:0.053691280207407335,y:-0.11965707238518546},{x:0.0641548259259258,y:-0.11500895648148178},{x:0.07390007119999986,y:-0.1101243648000003},{x:0.0829517856740739,y:-0.10501811125185218},{x:0.0913347389925924,y:-0.09970500974814848},{x:0.09907370079999973,y:-0.09419987420000027},{x:0.10619344074074046,y:-0.08851751851851883},{x:0.11271872845925893,y:-0.08267275661481507},{x:0.11867433359999968,y:-0.07668040240000029},{x:0.12408502580740703,y:-0.0705552697851854},{x:0.12897557472592555,y:-0.06431217268148172},{x:0.13337074999999957,y:-0.05796592500000018},{x:0.13729532127407365,y:-0.05153134065185202},{x:0.14077405819259214,y:-0.045023233548148286},{x:0.14383173039999952,y:-0.038456417600000126},{x:0.14649310754074024,y:-0.03184570671851861},{x:0.14878295925925875,y:-0.02520591481481487},{x:0.1507260551999995,y:-0.01855185580000003},{x:0.15234716500740686,y:-0.011898343585185192},{x:0.15367105832592537,y:-0.005260192081481464},{x:0.15472250479999944,y:0.001347784800000043},{x:0.1555262740740735,y:0.007910773148148207},{x:0.156107135792592,y:0.01441395905185193},{x:0.1564898595999994,y:0.020842528600000094},{x:0.15669921514074014,y:0.02718166788148159},{x:0.15675997205925862,y:0.03341656298518529},{x:0.15669689999999936,y:0.03953240000000011},{x:0.15669689999999936,y:0.039532400000000134},{x:0.15669689999999936,y:0.039532400000000134},{x:0.1563035739444438,y:0.04625776472222235},{x:0.15539676755555493,y:0.05296656444444457},{x:0.15399683849999934,y:0.05964500750000013},{x:0.1521241444444438,y:0.06627930222222234},{x:0.14979904305555491,y:0.07285565694444456},{x:0.14704189199999937,y:0.07936028000000013},{x:0.1438730489444438,y:0.08577937972222234},{x:0.1403128715555549,y:0.09209916444444458},{x:0.13638171749999925,y:0.0983058425000001},{x:0.13209994444444376,y:0.10438562222222235},{x:0.12748791005555482,y:0.11032471194444453},{x:0.12256597199999929,y:0.11610932000000013},{x:0.1173544879444437,y:0.1217256547222223},{x:0.11187381555555485,y:0.12715992444444457},{x:0.10614431249999925,y:0.1323983375000001},{x:0.10018633644444369,y:0.13742710222222235},{x:0.09402024505555481,y:0.14223242694444457},{x:0.08766639599999927,y:0.14680052000000016},{x:0.08114514694444372,y:0.15111758972222236},{x:0.07447685555555483,y:0.15516984444444457},{x:0.06768187949999929,y:0.15894349250000012},{x:0.06078057644444377,y:0.16242474222222236},{x:0.053793304055554894,y:0.16559980194444457},{x:0.046740419999999366,y:0.16845488000000014},{x:0.039642281944443844,y:0.17097618472222234},{x:0.03251924755555499,y:0.17314992444444455},{x:0.02539167449999948,y:0.17496230750000008},{x:0.018279920444443973,y:0.17639954222222232},{x:0.011204343055555134,y:0.17744783694444452},{x:0.004185299999999637,y:0.17809340000000007},{x:0.004185299999999614,y:0.17809340000000007}],color:"primary",fill:!1},path4:{type:"path",points:[{x:-0.08039130000000005,y:0.0179576999999993},{x:-0.08039130000000005,y:0.09650599999999931}],color:"primary",fill:!0},"path4-5":{type:"path",points:[{x:0.01494479999999987,y:-0.055216500000000224},{x:0.01494479999999987,y:0.09691909999999937}],color:"primary",fill:!0},"path4-5-8":{type:"path",points:[{x:0.06871169999999927,y:-0.056870000000000864},{x:0.06871169999999927,y:0.018784499999999538}],color:"primary",fill:!0},"path4-1":{type:"path",points:[{x:-0.08179359999999969,y:0.09650570000000003},{x:0.015771699999999722,y:0.09650570000000003}],color:"primary",fill:!0},"path4-1-6":{type:"path",points:[{x:0.0117995999999998,y:-0.05594970000000088},{x:0.06843709999999925,y:-0.05594970000000088}],color:"primary",fill:!0},"rect1577-4":{type:"path",points:[{x:-0.17162450000000073,y:0.11125030000000025},{x:-0.2688274000000015,y:0.11125030000000025},{x:-0.2688274000000015,y:0.11469129999999961},{x:-0.17162450000000073,y:0.11469129999999961}],color:"primary",fill:!0},"rect1577-4-7":{type:"path",points:[{x:-0.2184661999999995,y:0.16159429999999997},{x:-0.2184661999999995,y:0.06439139999999943},{x:-0.22190719999999908,y:0.06439139999999943},{x:-0.22190719999999908,y:0.16159429999999997}],color:"primary",fill:!0}},texts:{top1:{type:"text",text:"{REF}",x:-0.0024445000000006267,y:0.23933980000000044},bottom1:{type:"text",text:"{VAL}",x:0.00341719999999901,y:-0.23933980000000066}},refblocks:{left1:{x:-0.4458008,y:0.02709619999999968},right1:{x:0.4458008,y:0.026971799999999657}},bounds:{minX:-0.473959241,maxX:0.473959241,minY:-0.23933980000000066,maxY:0.23933980000000044,width:0.947918482,height:0.4786796000000011,centerX:0,centerY:-0.00000000000000011102230246251565},circles:{}},pPo=gn(b1e).rotateRightFacingSymbol("down").labelPort("left1",["1","pos"]).labelPort("right1",["2","neg"]).changeTextAnchor("{REF}","middle_left",{x:0.02,y:0.2}).changeTextAnchor("{VAL}","middle_left",{x:0.5,y:-0.2}).build(),mPo=gn(b1e).rotateRightFacingSymbol("left").labelPort("left1",["1","pos"]).labelPort("right1",["2","neg"]).changeTextAnchor("{REF}","middle_bottom",{x:0,y:0.45}).changeTextAnchor("{VAL}","middle_top",{x:0,y:-0.55}).build(),_Po=gn(b1e).rotateRightFacingSymbol("right").labelPort("left1",["1","pos"]).labelPort("right1",["2","neg"]).changeTextAnchor("{REF}","middle_bottom").changeTextAnchor("{VAL}","middle_top").build(),gPo=gn(b1e).rotateRightFacingSymbol("up").labelPort("left1",["1","pos"]).labelPort("right1",["2","neg"]).changeTextAnchor("{VAL}","middle_left",{x:0.02,y:-0.2}).changeTextAnchor("{REF}","middle_left",{x:0.5,y:0.2}).build(),Ivt={paths:{path40:{type:"path",points:[{x:0.14,y:0.04},{x:-0.12,y:-0.09}],color:"primary",fill:!1},path41:{type:"path",points:[{x:-0.12,y:0.18},{x:0.14,y:0.04}],color:"primary",fill:!1},path42:{type:"path",points:[{x:-0.12,y:-0.09},{x:-0.12,y:0.18}],color:"primary",fill:!1},path43:{type:"path",points:[{x:0.14,y:0.18},{x:0.14,y:-0.09}],color:"primary",fill:!1},path44:{type:"path",points:[{x:-0.12,y:0.04},{x:-0.52,y:0.04}],color:"primary",fill:!1},"path44-0":{type:"path",points:[{x:0.52,y:0.04},{x:0.15,y:0.04}],color:"primary",fill:!1},"path43-5":{type:"path",points:[{x:0.19,y:-0.09},{x:0.15,y:-0.09}],color:"primary",fill:!1},"path43-5-2":{type:"path",points:[{x:0.19,y:-0.14},{x:0.19,y:-0.09}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-0.01,y:0.27},bottom1:{type:"text",text:"{VAL}",x:0,y:-0.27}},refblocks:{left1:{x:-0.52,y:0.04},right1:{x:0.52,y:0.04}},bounds:{minX:-0.55,maxX:0.55,minY:-0.27,maxY:0.27,width:1.09,height:0.55,centerX:0,centerY:0},circles:{}},{paths:X2s,texts:j2s,bounds:K2s,refblocks:$2s,circles:q2s}=Ivt,vvt=gn(Ivt).changeTextAnchor("{VAL}","middle_top").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_bottom").build(),APo=Mo(vvt),fPo={paths:{path11:{type:"path",points:[{x:-0.54,y:0},{x:-0.3,y:0}],color:"primary",fill:!1},path12:{type:"path",points:[{x:0.29,y:0},{x:0.54,y:0}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-0.18,y:-0.36},bottom1:{type:"text",text:"{VAL}",x:-0.01,y:0.43},left1:{type:"text",text:"RPM",x:0,y:-0.02}},refblocks:{left1:{x:-0.54,y:0},right1:{x:0.54,y:0}},bounds:{minX:-0.53,maxX:0.53,minY:0,maxY:0,width:1.06,height:1,centerX:0,centerY:0},circles:{path1:{type:"circle",x:-0.01,y:-0.01,radius:0.29,color:"primary",fill:!1}}},{paths:yPo,texts:xPo,bounds:x2e,refblocks:DIt,circles:CPo}=fPo,eFe=yl({primitives:[...Object.values(yPo),...Object.values(CPo),{type:"text",text:"{REF}",x:0,y:-0.3594553499999995,anchor:"middle_top"},{type:"text",text:"{VAL}",x:0,y:0.35,anchor:"middle_bottom"},{...xPo.left1,y:0.01,anchor:"center",fontSize:0.2}],ports:[{...DIt.left1,labels:["1"]},{...DIt.right1,labels:["2"]}],size:{width:x2e.width,height:x2e.height},center:{x:x2e.centerX,y:x2e.centerY}}),{5:bPo,...IPo}=eFe.primitives;NIt=Mo({...eFe,primitives:Object.values(IPo).filter(vPo)}),SPo={...NIt,primitives:[...NIt.primitives,bPo]},I1e=yl({primitives:[{type:"path",points:[{x:-0.2,y:0},{x:0,y:0}],color:"primary",fill:!1},{type:"path",points:Array.from({length:32},(e,t)=>{let n=Math.PI/2-t*Math.PI/31,o=0.1;return{x:0.1-o*Math.cos(n),y:o*Math.sin(n)}}),color:"primary",fill:!1},{type:"text",text:"{REF}",x:0.125,y:0,anchor:"middle_left"}],ports:[{x:-0.2,y:0,labels:["1"]}],center:{x:0,y:0}}),Svt=Mo(I1e,"down"),RIt=Svt.primitives.find((e)=>e.type==="text"&&e.text==="{REF}");RIt&&(RIt.anchor="middle_top");PPo=Svt,EPo=Mo(I1e,"left"),Pvt=Mo(I1e,"up"),QIt=Pvt.primitives.find((e)=>e.type==="text"&&e.text==="{REF}");QIt&&(QIt.anchor="middle_bottom");MPo=Pvt,wPo={paths:{path40:{type:"path",points:[{x:0.44,y:0.04},{x:0.19,y:-0.09}],color:"primary",fill:!1},path41:{type:"path",points:[{x:0.19,y:0.18},{x:0.44,y:0.04}],color:"primary",fill:!1},path42:{type:"path",points:[{x:0.19,y:-0.09},{x:0.19,y:0.18}],color:"primary",fill:!1},path44:{type:"path",points:[{x:0.19,y:0.04},{x:-0.11,y:0.04}],color:"primary",fill:!1},path45:{type:"path",points:[{x:-0.43,y:0.22},{x:-0.11,y:0.04}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-0.01,y:0.27},bottom1:{type:"text",text:"{VAL}",x:0,y:-0.27}},refblocks:{right1:{x:-0.43,y:0.22}},bounds:{minX:-0.55,maxX:0.55,minY:-0.27,maxY:0.27,width:1.09,height:0.55,centerX:0,centerY:0},circles:{}},tFe=gn(wPo).labelPort("right1",["1"]).changeTextAnchor("{REF}","middle_bottom").changeTextAnchor("{VAL}","middle_top").build(),nFe=Mo(tFe,"up"),oFe=nFe.primitives.find((e)=>e.type==="text"&&e.text==="{REF}"),rFe=nFe.primitives.find((e)=>e.type==="text"&&e.text==="{VAL}");oFe.anchor="middle_bottom";rFe.anchor="middle_top";oFe.x=0.4;oFe.y+=0.2;rFe.y-=0.3;rFe.x=0.4;Evt=nFe,iFe=UX(Evt),sFe=iFe.primitives.find((e)=>e.type==="text"&&e.text==="{REF}"),aFe=iFe.primitives.find((e)=>e.type==="text"&&e.text==="{VAL}");sFe.anchor="middle_bottom";aFe.anchor="middle_top";sFe.x=0.35;sFe.y+=0.4;aFe.y-=0.4;aFe.x=0.35;BPo=iFe,cFe=Mo(tFe,"left"),lFe=cFe.primitives.find((e)=>e.type==="text"&&e.text==="{REF}"),hFe=cFe.primitives.find((e)=>e.type==="text"&&e.text==="{VAL}");lFe.anchor="middle_bottom";hFe.anchor="middle_top";lFe.x=0;lFe.y+=0.5;hFe.y-=0.6;hFe.x=0;TPo=cFe,dFe={paths:{"primary-winding":{type:"path",points:[{x:-0.6666666666666999,y:0.6000000000000001},{x:-0.1419999999999999,y:0.6000000000000001},{x:-0.1419999999999999,y:0.6000000000000001},{x:-0.13426666666666656,y:0.5976565925925927},{x:-0.12706666666666658,y:0.5950394074074075},{x:-0.12039999999999991,y:0.5921680000000001},{x:-0.11426666666666657,y:0.5890619259259261},{x:-0.10866666666666656,y:0.5857407407407409},{x:-0.10359999999999989,y:0.5822240000000002},{x:-0.09906666666666655,y:0.5785312592592594},{x:-0.09506666666666656,y:0.5746820740740743},{x:-0.09159999999999985,y:0.5706959999999999},{x:-0.08866666666666653,y:0.5665925925925928},{x:-0.08626666666666649,y:0.5623914074074075},{x:-0.08439999999999986,y:0.5581120000000002},{x:-0.08306666666666651,y:0.5537739259259259},{x:-0.08226666666666653,y:0.5493967407407409},{x:-0.08199999999999985,y:0.5449999999999999},{x:-0.08226666666666652,y:0.5406032592592593},{x:-0.08306666666666651,y:0.5362260740740741},{x:-0.08439999999999986,y:0.5318880000000001},{x:-0.08626666666666652,y:0.5276085925925926},{x:-0.08866666666666652,y:0.5234074074074074},{x:-0.09159999999999985,y:0.519304},{x:-0.09506666666666652,y:0.515317925925926},{x:-0.09906666666666653,y:0.5114687407407408},{x:-0.10359999999999986,y:0.507776},{x:-0.10866666666666652,y:0.5042592592592593},{x:-0.11426666666666653,y:0.5009380740740741},{x:-0.12039999999999987,y:0.49783200000000005},{x:-0.12706666666666652,y:0.4949605925925927},{x:-0.1342666666666665,y:0.49234340740740745},{x:-0.14199999999999988,y:0.4900000000000001},{x:-0.1419999999999999,y:0.4900000000000001},{x:-0.1419999999999999,y:0.4900000000000001},{x:-0.13426666666666656,y:0.48765659259259264},{x:-0.12706666666666658,y:0.48503940740740753},{x:-0.12039999999999991,y:0.4821680000000002},{x:-0.11426666666666657,y:0.4790619259259261},{x:-0.10866666666666656,y:0.47574074074074085},{x:-0.10359999999999989,y:0.4722240000000002},{x:-0.09906666666666655,y:0.46853125925925937},{x:-0.09506666666666656,y:0.46468207407407425},{x:-0.09159999999999985,y:0.46069599999999994},{x:-0.08866666666666653,y:0.45659259259259266},{x:-0.08626666666666649,y:0.45239140740740735},{x:-0.08439999999999986,y:0.4481120000000001},{x:-0.08306666666666651,y:0.4437739259259259},{x:-0.08226666666666653,y:0.43939674074074087},{x:-0.08199999999999985,y:0.43499999999999994},{x:-0.08226666666666652,y:0.4306032592592593},{x:-0.08306666666666651,y:0.42622607407407415},{x:-0.08439999999999986,y:0.42188800000000015},{x:-0.08626666666666652,y:0.41760859259259264},{x:-0.08866666666666652,y:0.4134074074074075},{x:-0.09159999999999985,y:0.40930400000000006},{x:-0.09506666666666652,y:0.40531792592592597},{x:-0.09906666666666653,y:0.4014687407407408},{x:-0.10359999999999986,y:0.3977760000000001},{x:-0.10866666666666652,y:0.3942592592592593},{x:-0.11426666666666653,y:0.3909380740740741},{x:-0.12039999999999987,y:0.38783200000000007},{x:-0.12706666666666652,y:0.3849605925925927},{x:-0.1342666666666665,y:0.38234340740740747},{x:-0.14199999999999988,y:0.3800000000000001},{x:-0.1419999999999999,y:0.3800000000000001},{x:-0.1419999999999999,y:0.3800000000000001},{x:-0.13426666666666656,y:0.37765659259259265},{x:-0.12706666666666658,y:0.3750394074074076},{x:-0.12039999999999991,y:0.3721680000000001},{x:-0.11426666666666657,y:0.36906192592592607},{x:-0.10866666666666656,y:0.36574074074074087},{x:-0.10359999999999989,y:0.36222400000000016},{x:-0.09906666666666655,y:0.3585312592592594},{x:-0.09506666666666656,y:0.35468207407407426},{x:-0.09159999999999985,y:0.350696},{x:-0.08866666666666653,y:0.34659259259259273},{x:-0.08626666666666649,y:0.3423914074074074},{x:-0.08439999999999986,y:0.33811200000000013},{x:-0.08306666666666651,y:0.3337739259259259},{x:-0.08226666666666653,y:0.3293967407407409},{x:-0.08199999999999985,y:0.325},{x:-0.08226666666666652,y:0.3206032592592593},{x:-0.08306666666666651,y:0.31622607407407416},{x:-0.08439999999999986,y:0.3118880000000001},{x:-0.08626666666666652,y:0.30760859259259266},{x:-0.08866666666666652,y:0.30340740740740746},{x:-0.09159999999999985,y:0.299304},{x:-0.09506666666666652,y:0.29531792592592593},{x:-0.09906666666666653,y:0.2914687407407408},{x:-0.10359999999999986,y:0.28777600000000003},{x:-0.10866666666666652,y:0.28425925925925927},{x:-0.11426666666666653,y:0.2809380740740741},{x:-0.12039999999999987,y:0.277832},{x:-0.12706666666666652,y:0.27496059259259265},{x:-0.1342666666666665,y:0.2723434074074074},{x:-0.14199999999999988,y:0.27},{x:-0.1419999999999999,y:0.27},{x:-0.1419999999999999,y:0.27},{x:-0.13426666666666656,y:0.2676565925925926},{x:-0.12706666666666658,y:0.26503940740740745},{x:-0.12039999999999991,y:0.2621680000000001},{x:-0.11426666666666657,y:0.25906192592592603},{x:-0.10866666666666656,y:0.25574074074074093},{x:-0.10359999999999989,y:0.25222400000000017},{x:-0.09906666666666655,y:0.2485312592592594},{x:-0.09506666666666656,y:0.24468207407407425},{x:-0.09159999999999985,y:0.24069600000000008},{x:-0.08866666666666653,y:0.23659259259259274},{x:-0.08626666666666649,y:0.2323914074074075},{x:-0.08439999999999986,y:0.2281120000000002},{x:-0.08306666666666651,y:0.22377392592592601},{x:-0.08226666666666653,y:0.2193967407407409},{x:-0.08199999999999985,y:0.2150000000000001},{x:-0.08226666666666652,y:0.21060325925925938},{x:-0.08306666666666651,y:0.20622607407407423},{x:-0.08439999999999986,y:0.20188800000000012},{x:-0.08626666666666652,y:0.1976085925925927},{x:-0.08866666666666652,y:0.19340740740740753},{x:-0.09159999999999985,y:0.18930400000000008},{x:-0.09506666666666652,y:0.185317925925926},{x:-0.09906666666666653,y:0.18146874074074082},{x:-0.10359999999999986,y:0.17777600000000005},{x:-0.10866666666666652,y:0.17425925925925928},{x:-0.11426666666666653,y:0.17093807407407408},{x:-0.12039999999999987,y:0.16783199999999998},{x:-0.12706666666666652,y:0.16496059259259258},{x:-0.1342666666666665,y:0.16234340740740733},{x:-0.14199999999999988,y:0.15999999999999992},{x:-0.1419999999999999,y:0.15999999999999992},{x:-0.1419999999999999,y:0.15999999999999992},{x:-0.13426666666666656,y:0.1577116296296296},{x:-0.12706666666666658,y:0.15525451851851865},{x:-0.12039999999999991,y:0.15264066666666695},{x:-0.11426666666666657,y:0.1498820740740747},{x:-0.10866666666666656,y:0.1469907407407417},{x:-0.10359999999999989,y:0.14397866666666803},{x:-0.09906666666666655,y:0.14085785185185365},{x:-0.09506666666666656,y:0.1376402962962987},{x:-0.09159999999999985,y:0.13433800000000298},{x:-0.08866666666666653,y:0.1309629629629667},{x:-0.08626666666666649,y:0.12752718518518963},{x:-0.08439999999999986,y:0.12404266666667203},{x:-0.08306666666666651,y:0.12052140740741364},{x:-0.08226666666666653,y:0.11697540740741469},{x:-0.08199999999999985,y:0.11341666666667499},{x:-0.08226666666666652,y:0.10985718518519466},{x:-0.08306666666666651,y:0.10630896296297365},{x:-0.08439999999999986,y:0.10278400000001198},{x:-0.08626666666666652,y:0.09929429629630965},{x:-0.08866666666666652,y:0.09585185185186663},{x:-0.09159999999999985,y:0.09246866666668296},{x:-0.09506666666666652,y:0.08915674074075862},{x:-0.09906666666666653,y:0.08592807407409363},{x:-0.10359999999999986,y:0.08279466666668796},{x:-0.10866666666666652,y:0.07976851851854162},{x:-0.11426666666666653,y:0.07686162962965462},{x:-0.12039999999999987,y:0.07408600000002696},{x:-0.12706666666666652,y:0.07145362962965862},{x:-0.1342666666666665,y:0.06897651851854962},{x:-0.14199999999999988,y:0.06666666666669996},{x:-0.1419999999999999,y:0.06666666666669996},{x:-0.6666666666666999,y:0.06666666666669996}],color:"primary",fill:!1},"auxiliary-winding":{type:"path",points:[{x:-0.6666666666666999,y:-0.06666666666669996},{x:-0.1419999999999999,y:-0.06666666666669996},{x:-0.1419999999999999,y:-0.06666666666669996},{x:-0.13426666666666656,y:-0.0689765185185496},{x:-0.12706666666666658,y:-0.07145362962965864},{x:-0.12039999999999991,y:-0.07408600000002695},{x:-0.11426666666666657,y:-0.07686162962965463},{x:-0.10866666666666656,y:-0.07976851851854162},{x:-0.10359999999999989,y:-0.08279466666668797},{x:-0.09906666666666655,y:-0.08592807407409363},{x:-0.09506666666666656,y:-0.08915674074075866},{x:-0.09159999999999985,y:-0.09246866666668294},{x:-0.08866666666666653,y:-0.09585185185186663},{x:-0.08626666666666649,y:-0.09929429629630962},{x:-0.08439999999999986,y:-0.10278400000001198},{x:-0.08306666666666651,y:-0.10630896296297361},{x:-0.08226666666666653,y:-0.10985718518519468},{x:-0.08199999999999985,y:-0.11341666666667496},{x:-0.08226666666666652,y:-0.11697540740741467},{x:-0.08306666666666651,y:-0.12052140740741367},{x:-0.08439999999999986,y:-0.124042666666672},{x:-0.08626666666666652,y:-0.12752718518518966},{x:-0.08866666666666652,y:-0.13096296296296667},{x:-0.09159999999999985,y:-0.134338000000003},{x:-0.09506666666666652,y:-0.13764029629629865},{x:-0.09906666666666653,y:-0.14085785185185368},{x:-0.10359999999999986,y:-0.14397866666666798},{x:-0.10866666666666652,y:-0.14699074074074164},{x:-0.11426666666666653,y:-0.1498820740740746},{x:-0.12039999999999987,y:-0.15264066666666695},{x:-0.12706666666666652,y:-0.15525451851851862},{x:-0.1342666666666665,y:-0.1577116296296296},{x:-0.14199999999999988,y:-0.15999999999999992},{x:-0.1419999999999999,y:-0.15999999999999992},{x:-0.1419999999999999,y:-0.15999999999999992},{x:-0.13426666666666656,y:-0.16234340740740733},{x:-0.12706666666666658,y:-0.16496059259259252},{x:-0.12039999999999991,y:-0.16783199999999995},{x:-0.11426666666666657,y:-0.17093807407407402},{x:-0.10866666666666656,y:-0.17425925925925922},{x:-0.10359999999999989,y:-0.17777599999999996},{x:-0.09906666666666655,y:-0.18146874074074068},{x:-0.09506666666666656,y:-0.1853179259259259},{x:-0.09159999999999985,y:-0.18930399999999992},{x:-0.08866666666666653,y:-0.19340740740740736},{x:-0.08626666666666649,y:-0.19760859259259247},{x:-0.08439999999999986,y:-0.20188799999999998},{x:-0.08306666666666651,y:-0.20622607407407395},{x:-0.08226666666666653,y:-0.2106032592592592},{x:-0.08199999999999985,y:-0.21499999999999986},{x:-0.08226666666666652,y:-0.21939674074074067},{x:-0.08306666666666651,y:-0.22377392592592585},{x:-0.08439999999999986,y:-0.22811199999999995},{x:-0.08626666666666652,y:-0.23239140740740732},{x:-0.08866666666666652,y:-0.23659259259259252},{x:-0.09159999999999985,y:-0.2406959999999999},{x:-0.09506666666666652,y:-0.244682074074074},{x:-0.09906666666666653,y:-0.24853125925925917},{x:-0.10359999999999986,y:-0.2522239999999999},{x:-0.10866666666666652,y:-0.2557407407407406},{x:-0.11426666666666653,y:-0.2590619259259258},{x:-0.12039999999999987,y:-0.26216799999999985},{x:-0.12706666666666652,y:-0.2650394074074072},{x:-0.1342666666666665,y:-0.2676565925925924},{x:-0.14199999999999988,y:-0.26999999999999974},{x:-0.1419999999999999,y:-0.2699999999999998},{x:-0.1419999999999999,y:-0.2699999999999998},{x:-0.13426666666666656,y:-0.2723434074074072},{x:-0.12706666666666658,y:-0.2749605925925925},{x:-0.12039999999999991,y:-0.27783199999999986},{x:-0.11426666666666657,y:-0.280938074074074},{x:-0.10866666666666656,y:-0.28425925925925916},{x:-0.10359999999999989,y:-0.2877759999999999},{x:-0.09906666666666655,y:-0.29146874074074064},{x:-0.09506666666666656,y:-0.295317925925926},{x:-0.09159999999999985,y:-0.29930399999999985},{x:-0.08866666666666653,y:-0.30340740740740735},{x:-0.08626666666666649,y:-0.30760859259259243},{x:-0.08439999999999986,y:-0.311888},{x:-0.08306666666666651,y:-0.31622607407407394},{x:-0.08226666666666653,y:-0.32060325925925925},{x:-0.08199999999999985,y:-0.3249999999999999},{x:-0.08226666666666652,y:-0.3293967407407407},{x:-0.08306666666666651,y:-0.33377392592592586},{x:-0.08439999999999986,y:-0.338112},{x:-0.08626666666666652,y:-0.3423914074074074},{x:-0.08866666666666652,y:-0.34659259259259256},{x:-0.09159999999999985,y:-0.35069599999999995},{x:-0.09506666666666652,y:-0.35468207407407404},{x:-0.09906666666666653,y:-0.35853125925925927},{x:-0.10359999999999986,y:-0.362224},{x:-0.10866666666666652,y:-0.3657407407407407},{x:-0.11426666666666653,y:-0.3690619259259259},{x:-0.12039999999999987,y:-0.37216800000000005},{x:-0.12706666666666652,y:-0.37503940740740743},{x:-0.1342666666666665,y:-0.37765659259259265},{x:-0.14199999999999988,y:-0.3800000000000001},{x:-0.1419999999999999,y:-0.3800000000000001},{x:-0.1419999999999999,y:-0.3800000000000001},{x:-0.13426666666666656,y:-0.38234340740740747},{x:-0.12706666666666658,y:-0.38496059259259274},{x:-0.12039999999999991,y:-0.38783200000000007},{x:-0.11426666666666657,y:-0.39093807407407416},{x:-0.10866666666666656,y:-0.3942592592592593},{x:-0.10359999999999989,y:-0.3977760000000001},{x:-0.09906666666666655,y:-0.40146874074074074},{x:-0.09506666666666656,y:-0.40531792592592597},{x:-0.09159999999999985,y:-0.40930399999999995},{x:-0.08866666666666653,y:-0.41340740740740745},{x:-0.08626666666666649,y:-0.4176085925925925},{x:-0.08439999999999986,y:-0.4218880000000001},{x:-0.08306666666666651,y:-0.4262260740740739},{x:-0.08226666666666653,y:-0.43060325925925924},{x:-0.08199999999999985,y:-0.4349999999999999},{x:-0.08226666666666652,y:-0.4393967407407407},{x:-0.08306666666666651,y:-0.4437739259259258},{x:-0.08439999999999986,y:-0.44811199999999995},{x:-0.08626666666666652,y:-0.4523914074074073},{x:-0.08866666666666652,y:-0.45659259259259244},{x:-0.09159999999999985,y:-0.4606959999999999},{x:-0.09506666666666652,y:-0.46468207407407397},{x:-0.09906666666666653,y:-0.4685312592592591},{x:-0.10359999999999986,y:-0.47222399999999987},{x:-0.10866666666666652,y:-0.4757407407407406},{x:-0.11426666666666653,y:-0.4790619259259258},{x:-0.12039999999999987,y:-0.4821679999999998},{x:-0.12706666666666652,y:-0.4850394074074072},{x:-0.1342666666666665,y:-0.4876565925925923},{x:-0.14199999999999988,y:-0.48999999999999977},{x:-0.1419999999999999,y:-0.48999999999999977},{x:-0.1419999999999999,y:-0.48999999999999977},{x:-0.13426666666666656,y:-0.4923434074074071},{x:-0.12706666666666658,y:-0.49496059259259245},{x:-0.12039999999999991,y:-0.4978319999999999},{x:-0.11426666666666657,y:-0.500938074074074},{x:-0.10866666666666656,y:-0.5042592592592593},{x:-0.10359999999999989,y:-0.507776},{x:-0.09906666666666655,y:-0.5114687407407407},{x:-0.09506666666666656,y:-0.5153179259259261},{x:-0.09159999999999985,y:-0.5193039999999998},{x:-0.08866666666666653,y:-0.5234074074074074},{x:-0.08626666666666649,y:-0.5276085925925925},{x:-0.08439999999999986,y:-0.531888},{x:-0.08306666666666651,y:-0.536226074074074},{x:-0.08226666666666653,y:-0.5406032592592593},{x:-0.08199999999999985,y:-0.5449999999999999},{x:-0.08226666666666652,y:-0.5493967407407407},{x:-0.08306666666666651,y:-0.5537739259259259},{x:-0.08439999999999986,y:-0.558112},{x:-0.08626666666666652,y:-0.5623914074074075},{x:-0.08866666666666652,y:-0.5665925925925925},{x:-0.09159999999999985,y:-0.5706959999999999},{x:-0.09506666666666652,y:-0.574682074074074},{x:-0.09906666666666653,y:-0.5785312592592593},{x:-0.10359999999999986,y:-0.582224},{x:-0.10866666666666652,y:-0.5857407407407407},{x:-0.11426666666666653,y:-0.5890619259259259},{x:-0.12039999999999987,y:-0.5921679999999998},{x:-0.12706666666666652,y:-0.5950394074074072},{x:-0.1342666666666665,y:-0.5976565925925924},{x:-0.14199999999999988,y:-0.5999999999999999},{x:-0.1419999999999999,y:-0.5999999999999999},{x:-0.6666666666666999,y:-0.5999999999999999}],color:"primary",fill:!1},"secondary-one-winding":{type:"path",points:[{x:0.6666666666666998,y:0.4666666666667001},{x:0.133,y:0.4666666666667001},{x:0.133,y:0.4666666666667001},{x:0.12449333333333333,y:0.46512612345682036},{x:0.11657333333333333,y:0.4634445432099042},{x:0.10923999999999999,y:0.4616320000000254},{x:0.10249333333333334,y:0.45969856790125796},{x:0.09633333333333331,y:0.45765432098767606},{x:0.09075999999999998,y:0.4555093333333538},{x:0.0857733333333333,y:0.45327367901236504},{x:0.08137333333333331,y:0.450957432098784},{x:0.07755999999999993,y:0.44857066666668444},{x:0.0743333333333333,y:0.4461234567901409},{x:0.07169333333333326,y:0.4436258765432269},{x:0.06963999999999997,y:0.44108800000001697},{x:0.06817333333333327,y:0.4385199012345847},{x:0.06729333333333329,y:0.43593165432100456},{x:0.06699999999999995,y:0.43333333333335006},{x:0.06729333333333329,y:0.4307350123456958},{x:0.06817333333333328,y:0.4281467654321155},{x:0.06963999999999995,y:0.42557866666668337},{x:0.07169333333333328,y:0.4230407901234733},{x:0.07433333333333328,y:0.42054320987655935},{x:0.07755999999999996,y:0.4180960000000157},{x:0.08137333333333328,y:0.4157092345679163},{x:0.08577333333333328,y:0.4133929876543353},{x:0.09075999999999997,y:0.4111573333333466},{x:0.0963333333333333,y:0.4090123456790242},{x:0.10249333333333328,y:0.40696809876544227},{x:0.10923999999999996,y:0.405034666666675},{x:0.1165733333333333,y:0.4032221234567961},{x:0.12449333333333329,y:0.40154054320987975},{x:0.13299999999999998,y:0.40000000000000013},{x:0.133,y:0.40000000000000013},{x:0.133,y:0.40000000000000013},{x:0.12449333333333333,y:0.39845945679012046},{x:0.11657333333333333,y:0.3967778765432042},{x:0.10923999999999999,y:0.39496533333332534},{x:0.10249333333333334,y:0.39303190123455795},{x:0.09633333333333331,y:0.3909876543209761},{x:0.09075999999999998,y:0.3888426666666537},{x:0.0857733333333333,y:0.386607012345665},{x:0.08137333333333331,y:0.38429076543208396},{x:0.07755999999999993,y:0.3819039999999844},{x:0.0743333333333333,y:0.37945679012344086},{x:0.07169333333333326,y:0.37695920987652687},{x:0.06963999999999997,y:0.37442133333331695},{x:0.06817333333333327,y:0.37185323456788455},{x:0.06729333333333329,y:0.36926498765430443},{x:0.06699999999999995,y:0.36666666666665004},{x:0.06729333333333329,y:0.3640683456789958},{x:0.06817333333333328,y:0.3614800987654155},{x:0.06963999999999995,y:0.35891199999998336},{x:0.07169333333333328,y:0.3563741234567732},{x:0.07433333333333328,y:0.35387654320985934},{x:0.07755999999999996,y:0.3514293333333157},{x:0.08137333333333328,y:0.3490425679012163},{x:0.08577333333333328,y:0.34672632098763523},{x:0.09075999999999997,y:0.3444906666666465},{x:0.0963333333333333,y:0.34234567901232416},{x:0.10249333333333328,y:0.3403014320987423},{x:0.10923999999999996,y:0.3383679999999749},{x:0.1165733333333333,y:0.33655545679009613},{x:0.12449333333333329,y:0.3348738765431798},{x:0.13299999999999998,y:0.3333333333333002},{x:0.133,y:0.3333333333333002},{x:0.6666666666666998,y:0.3333333333333002}],color:"primary",fill:!1},"secondary-two-winding":{type:"path",points:[{x:0.6666666666666998,y:-0.19999999999999996},{x:0.133,y:-0.19999999999999996},{x:0.133,y:-0.19999999999999996},{x:0.12449333333333333,y:-0.2015405432098796},{x:0.11657333333333333,y:-0.2032221234567959},{x:0.10923999999999999,y:-0.20503466666667475},{x:0.10249333333333334,y:-0.20696809876544214},{x:0.09633333333333331,y:-0.20901234567902405},{x:0.09075999999999998,y:-0.21115733333334635},{x:0.0857733333333333,y:-0.21339298765433506},{x:0.08137333333333331,y:-0.2157092345679162},{x:0.07755999999999993,y:-0.21809600000001547},{x:0.0743333333333333,y:-0.2205432098765592},{x:0.07169333333333326,y:-0.22304079012347303},{x:0.06963999999999997,y:-0.22557866666668316},{x:0.06817333333333327,y:-0.22814676543211523},{x:0.06729333333333329,y:-0.23073501234569563},{x:0.06699999999999995,y:-0.23333333333334982},{x:0.06729333333333329,y:-0.2359316543210042},{x:0.06817333333333328,y:-0.2385199012345845},{x:0.06963999999999995,y:-0.24108800000001673},{x:0.07169333333333328,y:-0.24362587654322676},{x:0.07433333333333328,y:-0.2461234567901406},{x:0.07755999999999996,y:-0.24857066666668426},{x:0.08137333333333328,y:-0.25095743209878363},{x:0.08577333333333328,y:-0.25327367901236475},{x:0.09075999999999997,y:-0.25550933333335346},{x:0.0963333333333333,y:-0.2576543209876757},{x:0.10249333333333328,y:-0.25969856790125756},{x:0.10923999999999996,y:-0.26163200000002496},{x:0.1165733333333333,y:-0.2634445432099038},{x:0.12449333333333329,y:-0.26512612345682},{x:0.13299999999999998,y:-0.2666666666666997},{x:0.133,y:-0.2666666666666997},{x:0.133,y:-0.2666666666666997},{x:0.12449333333333333,y:-0.26820720987657004},{x:0.11657333333333333,y:-0.2698887901234782},{x:0.10923999999999999,y:-0.27170133333335017},{x:0.10249333333333334,y:-0.2736347654321117},{x:0.09633333333333331,y:-0.2756790123456887},{x:0.09075999999999998,y:-0.27782400000000707},{x:0.0857733333333333,y:-0.2800596543209926},{x:0.08137333333333331,y:-0.2823759012345713},{x:0.07755999999999993,y:-0.28476266666666866},{x:0.0743333333333333,y:-0.28720987654321106},{x:0.07169333333333326,y:-0.28970745679012394},{x:0.06963999999999997,y:-0.2922453333333336},{x:0.06817333333333327,y:-0.29481343209876537},{x:0.06729333333333329,y:-0.29740167901234577},{x:0.06699999999999995,y:-0.3},{x:0.06729333333333329,y:-0.3025983209876544},{x:0.06817333333333328,y:-0.30518656790123455},{x:0.06963999999999995,y:-0.3077546666666665},{x:0.07169333333333328,y:-0.310292543209876},{x:0.07433333333333328,y:-0.31279012345678897},{x:0.07755999999999996,y:-0.31523733333333126},{x:0.08137333333333328,y:-0.31762409876542885},{x:0.08577333333333328,y:-0.3199403456790074},{x:0.09075999999999997,y:-0.32217599999999297},{x:0.0963333333333333,y:-0.3243209876543113},{x:0.10249333333333328,y:-0.32636523456788824},{x:0.10923999999999996,y:-0.32829866666664975},{x:0.1165733333333333,y:-0.33011120987652165},{x:0.12449333333333329,y:-0.3317927901234298},{x:0.13299999999999998,y:-0.3333333333333002},{x:0.133,y:-0.3333333333333002},{x:0.6666666666666998,y:-0.3333333333333002}],color:"primary",fill:!1},"core-left":{type:"path",points:[{x:-0.03599999999999981,y:0.66},{x:-0.03599999999999981,y:-0.6599999999999999}],color:"primary",fill:!1},"core-right":{type:"path",points:[{x:0.028999999999999915,y:0.66},{x:0.028999999999999915,y:-0.6599999999999999}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:0,y:0.7200000000000001},bottom1:{type:"text",text:"{VAL}",x:0,y:-0.72}},refblocks:{left1:{x:-0.6666666666666999,y:-0.5999999999999999},left2:{x:-0.6666666666666999,y:-0.06666666666669996},left3:{x:-0.6666666666666999,y:0.06666666666669996},left4:{x:-0.6666666666666999,y:0.6000000000000001},right1:{x:0.6666666666666998,y:-0.3333333333333002},right2:{x:0.6666666666666998,y:-0.19999999999999996},right3:{x:0.6666666666666998,y:0.3333333333333002},right4:{x:0.6666666666666998,y:0.4666666666667001}},bounds:{minX:-0.6666666666666999,maxX:0.6666666666666998,minY:-0.72,maxY:0.7200000000000001,width:1.3333333333333997,height:1.44,centerX:-0.00000000000000005551115123125783,centerY:0.00000000000000005551115123125783},circles:{"primary-polarity-dot":{type:"circle",x:-0.19599999999999995,y:0.535,radius:0.0172,color:"primary",fill:!0},"auxiliary-polarity-dot":{type:"circle",x:-0.19599999999999995,y:-0.1316666666666999,radius:0.0172,color:"primary",fill:!0},"secondary-one-polarity-dot":{type:"circle",x:0.18999999999999995,y:0.42700000000000005,radius:0.0172,color:"primary",fill:!0},"secondary-two-polarity-dot":{type:"circle",x:0.18999999999999995,y:-0.23999999999999977,radius:0.0172,color:"primary",fill:!0}}},DPo=gn(dFe).labelPort("left1",["1","primary_end"]).labelPort("left2",["2","primary_start"]).labelPort("left3",["3","auxiliary_end"]).labelPort("left4",["4","auxiliary_start"]).labelPort("right1",["8","secondary1_end"]).labelPort("right2",["7","secondary1_start"]).labelPort("right3",["6","secondary2_end"]).labelPort("right4",["5","secondary2_start"]).changeTextAnchor("{REF}","middle_bottom").changeTextAnchor("{VAL}","middle_top").rotateRightFacingSymbol("down").build(),Mvt=gn(dFe).labelPort("left1",["1","primary_end"]).labelPort("left2",["2","primary_start"]).labelPort("left3",["3","auxiliary_end"]).labelPort("left4",["4","auxiliary_start"]).labelPort("right1",["8","secondary1_end"]).labelPort("right2",["7","secondary1_start"]).labelPort("right3",["6","secondary2_end"]).labelPort("right4",["5","secondary2_start"]).changeTextAnchor("{REF}","middle_bottom").changeTextAnchor("{VAL}","middle_top").rotateRightFacingSymbol("right").build(),NPo=wI(Mvt),RPo=gn(dFe).labelPort("left1",["1","primary_end"]).labelPort("left2",["2","primary_start"]).labelPort("left3",["3","auxiliary_end"]).labelPort("left4",["4","auxiliary_start"]).labelPort("right1",["8","secondary1_end"]).labelPort("right2",["7","secondary1_start"]).labelPort("right3",["6","secondary2_end"]).labelPort("right4",["5","secondary2_start"]).changeTextAnchor("{REF}","middle_bottom").changeTextAnchor("{VAL}","middle_top").rotateRightFacingSymbol("up").build(),wvt={paths:{path11:{type:"path",points:[{x:-0.54,y:0.04},{x:-0.11,y:0.04}],color:"primary",fill:!1},path12:{type:"path",points:[{x:0.1,y:0.04},{x:0.54,y:0.04}],color:"primary",fill:!1},"path11-0":{type:"path",points:[{x:-0.09,y:-0.15},{x:-0.09,y:0.26}],color:"primary",fill:!1},"path11-0-3":{type:"path",points:[{x:0.09,y:-0.15},{x:0.09,y:0.26}],color:"primary",fill:!1},"path11-0-9":{type:"path",points:[{x:-0.08,y:0.06},{x:-0.08,y:-0.15},{x:0.09,y:-0.05},{x:-0.08,y:0.06}],color:"primary",fill:!0},"path11-0-9-0":{type:"path",points:[{x:0.08,y:0.26},{x:0.08,y:0.05},{x:-0.09,y:0.15},{x:0.07,y:0.26}],color:"primary",fill:!0},"path12-2":{type:"path",points:[{x:0.09,y:-0.06},{x:0.27,y:-0.17}],color:"primary",fill:!1},"path12-2-9":{type:"path",points:[{x:0.27,y:-0.18},{x:0.27,y:-0.31}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:0.01,y:0.42},bottom1:{type:"text",text:"{VAL}",x:-0.03,y:-0.42}},refblocks:{bottom1:{x:0.27,y:-0.31},left1:{x:-0.54,y:0.04},right1:{x:0.54,y:0.04}},bounds:{minX:-0.57,maxX:0.57,minY:-0.42,maxY:0.42,width:1.14,height:0.83,centerX:0,centerY:0},circles:{path1:{type:"circle",x:0,y:0.05,radius:0.29,color:"primary",fill:!1}}},{paths:J2s,texts:Z2s,bounds:e1s,refblocks:t1s,circles:n1s}=wvt,Bvt=gn(wvt).changeTextAnchor("{VAL}","middle_top").labelPort("left1",["1"]).labelPort("right1",["2"]).labelPort("bottom1",["3"]).changeTextAnchor("{REF}","middle_bottom").build(),Tvt=Mo(Bvt),Dvt=Tvt.primitives.filter((e)=>e.type==="text"),QPo=Dvt.find((e)=>e.text==="{REF}"),kPo=Dvt.find((e)=>e.text==="{VAL}");QPo.y=0;kPo.y=0;LPo=Tvt,HPo={paths:{path40:{type:"path",points:[{x:0.14,y:0.04},{x:-0.12,y:-0.09}],color:"primary",fill:!1},path41:{type:"path",points:[{x:-0.12,y:0.18},{x:0.14,y:0.04}],color:"primary",fill:!1},path42:{type:"path",points:[{x:-0.12,y:-0.09},{x:-0.12,y:0.18}],color:"primary",fill:!1},path43:{type:"path",points:[{x:0.14,y:0.18},{x:0.14,y:-0.09}],color:"primary",fill:!1},path44:{type:"path",points:[{x:-0.12,y:0.04},{x:-0.52,y:0.04}],color:"primary",fill:!1},"path44-0":{type:"path",points:[{x:0.52,y:0.04},{x:0.15,y:0.04}],color:"primary",fill:!1},"path43-8":{type:"path",points:[{x:0.14,y:0.18},{x:0.08,y:0.18}],color:"primary",fill:!1},"path43-8-8":{type:"path",points:[{x:0.14,y:-0.09},{x:0.08,y:-0.09}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-0.01,y:0.27},bottom1:{type:"text",text:"{VAL}",x:0,y:-0.27}},refblocks:{left1:{x:-0.52,y:0.04},right1:{x:0.52,y:0.04}},bounds:{minX:-0.55,maxX:0.55,minY:-0.27,maxY:0.27,width:1.09,height:0.55,centerX:0,centerY:0},circles:{}},{paths:FPo,texts:kIt,bounds:C2e,refblocks:LIt,circles:zPo}=HPo,Nvt=yl({primitives:[...Object.values(FPo),...Object.values(zPo),{...kIt.top1,anchor:"middle_bottom"},{...kIt.bottom1,anchor:"middle_top"}],ports:[{...LIt.left1,labels:["1"]},{...LIt.right1,labels:["2"]}],size:{width:C2e.width,height:C2e.height},center:{x:C2e.centerX,y:C2e.centerY}}),uFe=Mo(Nvt),OPo=uFe.primitives.find((e)=>e.type==="text"&&e.text==="{REF}"),VPo=uFe.primitives.find((e)=>e.type==="text"&&e.text==="{VAL}");OPo.anchor="middle_left";VPo.anchor="middle_right";YPo=uFe,GPo={paths:{path11:{type:"path",points:[{x:-0.34,y:0.22},{x:-0.02,y:0.01}],color:"primary",fill:!1},path12:{type:"path",points:[{x:0.23,y:0.13},{x:0.23,y:0.4}],color:"primary",fill:!1},"path12-2":{type:"path",points:[{x:0.23,y:-0.08},{x:0.23,y:-0.35}],color:"primary",fill:!1},"path11-0":{type:"path",points:[{x:-0.01,y:-0.18},{x:-0.01,y:0.23}],color:"primary",fill:!1},"path11-0-3":{type:"path",points:[{x:0.23,y:0.12},{x:-0.01,y:0.12}],color:"primary",fill:!1},"path11-0-9":{type:"path",points:[{x:-0.11,y:0.13},{x:-0.17,y:0.04},{x:-0.06,y:0.03},{x:-0.11,y:0.13}],color:"primary",fill:!0},"path11-0-3-8":{type:"path",points:[{x:0.23,y:-0.08},{x:-0.01,y:-0.08}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-0.2,y:0.39},bottom1:{type:"text",text:"{VAL}",x:-0.03,y:-0.42}},refblocks:{top1:{x:0.23,y:0.4},bottom1:{x:0.23,y:-0.35},left1:{x:-0.34,y:0.22}},bounds:{minX:-0.37,maxX:0.37,minY:-0.42,maxY:0.42,width:0.74,height:0.85,centerX:0,centerY:0},circles:{path1:{type:"circle",x:0.08,y:0.01,radius:0.29,color:"primary",fill:!1}}},{paths:UPo,texts:HIt,bounds:b2e,refblocks:SQe,circles:WPo}=GPo,Rvt=yl({primitives:[...Object.values(UPo),...Object.values(WPo),{...HIt.top1,anchor:"middle_left"},{...HIt.bottom1,anchor:"middle_right"}],ports:[{...SQe.top1,labels:["1"]},{...SQe.bottom1,labels:["2"]},{...SQe.left1,labels:["3"]}],size:{width:b2e.width,height:b2e.height},center:{x:b2e.centerX,y:b2e.centerY}}),Qvt=Mo(Rvt),kvt=Qvt.primitives.filter((e)=>e.type==="text"),XPo=kvt.find((e)=>e.text==="{REF}");XPo.y=0.1;Lvt=kvt.find((e)=>e.text==="{VAL}");Lvt.y=0.1;Lvt.x=-0.4;jPo=Qvt,KPo={paths:{capsule_outer:{type:"path",points:[{x:-0.44,y:0.34},{x:-0.45,y:0.39},{x:-0.46,y:0.42},{x:-0.49,y:0.44},{x:-0.52,y:0.46},{x:-0.56,y:0.46},{x:-0.6,y:0.46},{x:-0.63,y:0.44},{x:-0.65,y:0.42},{x:-0.67,y:0.39},{x:-0.68,y:0.34},{x:-0.68,y:-0.34},{x:-0.67,y:-0.39},{x:-0.65,y:-0.42},{x:-0.63,y:-0.44},{x:-0.6,y:-0.45},{x:-0.56,y:-0.46},{x:-0.52,y:-0.45},{x:-0.49,y:-0.44},{x:-0.46,y:-0.42},{x:-0.45,y:-0.39},{x:-0.44,y:-0.34},{x:-0.44,y:0.34}],color:"primary",fill:!1},capsule_inner:{type:"path",points:[{x:-0.51,y:0.28},{x:-0.52,y:0.32},{x:-0.53,y:0.34},{x:-0.56,y:0.35},{x:-0.57,y:0.35},{x:-0.58,y:0.34},{x:-0.6,y:0.32},{x:-0.61,y:0.28},{x:-0.61,y:-0.28},{x:-0.6,y:-0.32},{x:-0.58,y:-0.34},{x:-0.57,y:-0.35},{x:-0.56,y:-0.35},{x:-0.53,y:-0.34},{x:-0.52,y:-0.32},{x:-0.51,y:-0.28},{x:-0.51,y:0.28}],color:"primary",fill:!0},usb_vertical:{type:"path",points:[{x:0.1,y:-0.4},{x:0.1,y:0.4}],color:"primary",fill:!1},usb_left_branch:{type:"path",points:[{x:0.1,y:-0.1},{x:-0.03,y:0.05},{x:-0.03,y:0.15}],color:"primary",fill:!1},usb_right_branch:{type:"path",points:[{x:0.1,y:0},{x:0.25,y:0.15},{x:0.25,y:0.25}],color:"primary",fill:!1},usb_arrow:{type:"path",points:[{x:0.05,y:0.4},{x:0.1,y:0.5},{x:0.15,y:0.4},{x:0.05,y:0.4}],color:"primary",fill:!0},usb_square:{type:"path",points:[{x:0.2,y:0.25},{x:0.3,y:0.25},{x:0.3,y:0.35},{x:0.2,y:0.35},{x:0.2,y:0.25}],color:"primary",fill:!0}},circles:{usb_base:{type:"circle",x:0.1,y:-0.4,radius:0.07,color:"primary",fill:!0},usb_tip_circle:{type:"circle",x:-0.03,y:0.15,radius:0.04,color:"primary",fill:!0}},texts:{top1:{type:"text",text:"{REF}",x:-0.25,y:0.7}},refblocks:{},bounds:{minX:-0.75,maxX:0.35,minY:-0.6,maxY:0.75,width:1.1,height:1.35,centerX:-0.2,centerY:0.08}},$Po=gn(KPo).changeTextAnchor("{REF}","middle_bottom").build(),qPo={paths:{path11:{type:"path",points:[{x:-0.54,y:0},{x:-0.3,y:0}],color:"primary",fill:!1},path12:{type:"path",points:[{x:0.29,y:0},{x:0.54,y:0}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-0.18,y:-0.36},bottom1:{type:"text",text:"{VAL}",x:-0.01,y:0.43},left1:{type:"text",text:"Var",x:-0.19,y:0.07}},refblocks:{left1:{x:-0.54,y:0},right1:{x:0.54,y:0}},bounds:{minX:-0.53,maxX:0.53,minY:0,maxY:0,width:1.06,height:1,centerX:0,centerY:0},circles:{path1:{type:"circle",x:-0.01,y:-0.01,radius:0.29,color:"primary",fill:!1}}},{paths:JPo,texts:PQe,bounds:I2e,refblocks:FIt,circles:ZPo}=qPo,Hvt=yl({primitives:[...Object.values(JPo),...Object.values(ZPo),{...PQe.top1,x:0,y:-0.3594553499999995,anchor:"middle_top"},{...PQe.bottom1,x:0,y:0.35,anchor:"middle_bottom"},{...PQe.left1,x:-0.02,y:0.01,fontSize:0.2,anchor:"center"}],ports:[{...FIt.left1,labels:["1"]},{...FIt.right1,labels:["2"]}],size:{width:I2e.width,height:I2e.height},center:{x:I2e.centerX,y:I2e.centerY}}),eEo=Mo(Hvt),tEo={paths:{path40:{type:"path",points:[{x:0.08,y:0.04},{x:-0.18,y:-0.09}],color:"primary",fill:!1},path41:{type:"path",points:[{x:-0.18,y:0.18},{x:0.08,y:0.04}],color:"primary",fill:!1},path42:{type:"path",points:[{x:-0.18,y:-0.09},{x:-0.18,y:0.18}],color:"primary",fill:!1},path43:{type:"path",points:[{x:0.09,y:0.17},{x:0.1,y:-0.09}],color:"primary",fill:!1},path44:{type:"path",points:[{x:-0.2,y:0.04},{x:-0.52,y:0.04}],color:"primary",fill:!1},"path44-0":{type:"path",points:[{x:0.52,y:0.04},{x:0.21,y:0.04}],color:"primary",fill:!1},"path43-6":{type:"path",points:[{x:0.19,y:0.17},{x:0.19,y:-0.09}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-0.01,y:0.27},bottom1:{type:"text",text:"{VAL}",x:0,y:-0.27}},refblocks:{left1:{x:-0.52,y:0.04},right1:{x:0.52,y:0.04}},bounds:{minX:-0.55,maxX:0.55,minY:-0.27,maxY:0.27,width:1.09,height:0.55,centerX:0,centerY:0},circles:{}},{paths:nEo,texts:zIt,bounds:v2e,refblocks:OIt,circles:oEo}=tEo,Fvt=yl({primitives:[...Object.values(nEo),...Object.values(oEo),{...zIt.top1,anchor:"middle_bottom"},{...zIt.bottom1,anchor:"middle_top"}],ports:[{...OIt.left1,labels:["1"]},{...OIt.right1,labels:["2"]}],size:{width:v2e.width,height:v2e.height},center:{x:v2e.centerX,y:v2e.centerY}}),pFe=Mo(Fvt),rEo=pFe.primitives.find((e)=>e.type==="text"&&e.text==="{REF}"),iEo=pFe.primitives.find((e)=>e.type==="text"&&e.text==="{VAL}");rEo.anchor="middle_left";iEo.anchor="middle_right";sEo=pFe,aEo={paths:{path5:{type:"path",points:[{x:-0.54,y:0},{x:-0.26,y:0}],color:"primary",fill:!1},path6:{type:"path",points:[{x:0.27,y:0},{x:0.54,y:0}],color:"primary",fill:!1},path7:{type:"path",points:[{x:0.27,y:-0.23},{x:-0.26,y:0.24}],color:"primary",fill:!1},path8:{type:"path",points:[{x:0.38,y:-0.23},{x:0.27,y:-0.23}],color:"primary",fill:!1},path9:{type:"path",points:[{x:0,y:0.14},{x:0.27,y:0.14},{x:0.27,y:-0.13},{x:-0.26,y:-0.13},{x:-0.26,y:0.14},{x:0,y:0.14}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-0.06,y:0.25},bottom1:{type:"text",text:"{VAL}",x:0.01,y:-0.25}},refblocks:{left1:{x:-0.54,y:0},right1:{x:0.54,y:0}},bounds:{minX:-0.57,maxX:0.57,minY:-0.25,maxY:0.25,width:1.13,height:0.5,centerX:0,centerY:0},circles:{}},{paths:cEo,texts:VIt,bounds:S2e,refblocks:YIt}=aEo,zvt=yl({primitives:[...Object.values(cEo),{...VIt.top1,x:0,anchor:"middle_bottom"},{...VIt.bottom1,x:0,anchor:"middle_top"}],ports:[{...YIt.left1,labels:["1","-"]},{...YIt.right1,labels:["2","+"]}],size:{width:S2e.width,height:S2e.height},center:{x:S2e.centerX,y:S2e.centerY}}),Ovt=Mo(zvt),Vvt=Ovt.primitives.filter((e)=>e.type==="text"),mFe=Vvt.find((e)=>e.text==="{REF}"),_Fe=Vvt.find((e)=>e.text==="{VAL}");mFe.x=0.3;mFe.y=0.15;mFe.anchor="middle_left";_Fe.x=0.3;_Fe.y=-0.15;_Fe.anchor="middle_left";lEo=Ovt,hEo={paths:{path11:{type:"path",points:[{x:-0.54,y:0},{x:-0.3,y:0}],color:"primary",fill:!1},path12:{type:"path",points:[{x:0.29,y:0},{x:0.54,y:0}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-0.18,y:-0.36},bottom1:{type:"text",text:"{VAL}",x:-0.01,y:0.43},left1:{type:"text",text:"Var",x:0,y:-0.02}},refblocks:{left1:{x:-0.54,y:0},right1:{x:0.54,y:0}},bounds:{minX:-0.53,maxX:0.53,minY:0,maxY:0,width:1.06,height:1,centerX:0,centerY:0},circles:{path1:{type:"circle",x:-0.01,y:-0.01,radius:0.29,color:"primary",fill:!1}}},{paths:dEo,texts:uEo,bounds:P2e,refblocks:GIt,circles:pEo}=hEo,gFe=yl({primitives:[...Object.values(dEo),...Object.values(pEo),{type:"text",text:"{REF}",x:0,y:-0.3594553499999995,anchor:"middle_top"},{type:"text",text:"{VAL}",x:0,y:0.35,anchor:"middle_bottom"},{...uEo.left1,anchor:"center",y:0.02,fontSize:0.2}],ports:[{...GIt.left1,labels:["1"]},{...GIt.right1,labels:["2"]}],size:{width:P2e.width,height:P2e.height},center:{x:P2e.centerX,y:P2e.centerY}}),{5:mEo,..._Eo}=gFe.primitives;UIt=Mo({...gFe,primitives:Object.values(_Eo).filter(gEo)}),AEo={...UIt,primitives:[...UIt.primitives,mEo]},v1e={paths:{"path28-2":{type:"path",points:[{x:0.19,y:0},{x:0,y:0.09}],color:"primary",fill:!1},"path28-2-6":{type:"path",points:[{x:0.19,y:0},{x:0,y:-0.09}],color:"primary",fill:!1},"path29-3":{type:"path",points:[{x:0.19,y:0},{x:-0.23,y:0}],color:"primary",fill:!1}},texts:{right1:{type:"text",text:"{REF}",x:0.25,y:0}},refblocks:{left1:{x:-0.23,y:0}},bounds:{minX:-0.25,maxX:0.25,minY:-0.09,maxY:0.09,width:0.5,height:0.19,centerX:0,centerY:0},circles:{}};fEo=gn(v1e).rotateRightFacingSymbol("down").labelPort("left1",["1"]).changeTextAnchor("{REF}","middle_top").build(),yEo=S1e(fEo,{width:0.24,height:0.23}),xEo=gn(v1e).rotateRightFacingSymbol("left").labelPort("left1",["1"]).changeTextAnchor("{REF}","middle_right").build(),CEo=S1e(xEo,{width:0.23,height:0.24}),bEo=gn(v1e).rotateRightFacingSymbol("right").labelPort("left1",["1"]).changeTextAnchor("{REF}","middle_left").build(),IEo=S1e(bEo,{width:0.23,height:0.24}),vEo=gn(v1e).rotateRightFacingSymbol("up").labelPort("left1",["1"]).changeTextAnchor("{REF}","middle_bottom").build(),SEo=S1e(vEo,{width:0.24,height:0.23}),AFe={paths:{path11:{type:"path",points:[{x:-0.54,y:0.03},{x:-0.3,y:0.03}],color:"primary",fill:!1},"path11-5-5":{type:"path",points:[{x:0.1,y:0.13},{x:0,y:-0.06},{x:-0.11,y:0.13}],color:"primary",fill:!1},path12:{type:"path",points:[{x:0.29,y:0.03},{x:0.54,y:0.03}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-0.02,y:0.4},bottom1:{type:"text",text:"{VAL}",x:-0.01,y:-0.4}},refblocks:{left1:{x:-0.54,y:0.03},right1:{x:0.54,y:0.03}},bounds:{minX:-0.57,maxX:0.57,minY:-0.4,maxY:0.4,width:1.14,height:0.8,centerX:0,centerY:0},circles:{path1:{type:"circle",x:0,y:0.04,radius:0.29,color:"primary",fill:!1}}},{paths:o1s,texts:r1s,bounds:i1s,circles:s1s,refblocks:a1s}=AFe,PEo=gn(AFe).changeTextAnchor("{VAL}","middle_top").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_bottom").build(),{paths:EEo,texts:c1s,bounds:WIt,circles:MEo,refblocks:XIt}=AFe,wEo=gn({primitives:[...Object.values(EEo),...Object.values(MEo),{type:"text",text:"{REF}",x:-0.2,y:0.35},{type:"text",text:"{VAL}",x:0.2,y:0.35}],ports:[{...XIt.left1,labels:["left1"]},{...XIt.right1,labels:["right1"]}],center:{x:WIt.centerX,y:WIt.centerY}}).rotateRightFacingSymbol("down").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_left").changeTextAnchor("{VAL}","middle_left").build(),BEo=wEo,TEo={paths:{path11:{type:"path",points:[{x:-0.54,y:0},{x:-0.3,y:0}],color:"primary",fill:!1},path12:{type:"path",points:[{x:0.29,y:0},{x:0.54,y:0}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-0.18,y:-0.36},bottom1:{type:"text",text:"{VAL}",x:-0.01,y:0.43},left1:{type:"text",text:"Wh",x:0,y:-0.02}},refblocks:{left1:{x:-0.54,y:0},right1:{x:0.54,y:0}},bounds:{minX:-0.53,maxX:0.53,minY:0,maxY:0,width:1.06,height:1,centerX:0,centerY:0},circles:{path1:{type:"circle",x:-0.01,y:-0.01,radius:0.29,color:"primary",fill:!1}}},{paths:DEo,texts:NEo,bounds:E2e,refblocks:jIt,circles:REo}=TEo,fFe=yl({primitives:[...Object.values(DEo),...Object.values(REo),{type:"text",text:"{REF}",x:0,y:-0.3594553499999995,anchor:"middle_top"},{type:"text",text:"{VAL}",x:0,y:0.35,anchor:"middle_bottom"},{...NEo.left1,anchor:"center",y:0.01,fontSize:0.2}],ports:[{...jIt.left1,labels:["1"]},{...jIt.right1,labels:["2"]}],size:{width:E2e.width,height:E2e.height},center:{x:E2e.centerX,y:E2e.centerY}}),{5:QEo,...kEo}=fFe.primitives;KIt=Mo({...fFe,primitives:Object.values(kEo).filter(LEo)}),HEo={...KIt,primitives:[...KIt.primitives,QEo]},FEo={paths:{path11:{type:"path",points:[{x:-0.54,y:0},{x:-0.3,y:0}],color:"primary",fill:!1},path12:{type:"path",points:[{x:0.29,y:0},{x:0.54,y:0}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-0.18,y:-0.36},bottom1:{type:"text",text:"{VAL}",x:-0.01,y:0.43},left1:{type:"text",text:"W",x:0,y:-0.02}},refblocks:{left1:{x:-0.54,y:0},right1:{x:0.54,y:0}},bounds:{minX:-0.53,maxX:0.53,minY:0,maxY:0,width:1.06,height:1,centerX:0,centerY:0},circles:{path1:{type:"circle",x:-0.01,y:-0.01,radius:0.29,color:"primary",fill:!1}}},{paths:zEo,texts:OEo,bounds:M2e,refblocks:$It,circles:VEo}=FEo,yFe=yl({primitives:[...Object.values(zEo),...Object.values(VEo),{type:"text",text:"{REF}",x:0,y:-0.3594553499999995,anchor:"middle_top"},{type:"text",text:"{VAL}",x:0,y:0.35,anchor:"middle_bottom"},{...OEo.left1,anchor:"center",y:0.01,fontSize:0.3}],ports:[{...$It.left1,labels:["1"]},{...$It.right1,labels:["2"]}],size:{width:M2e.width,height:M2e.height},center:{x:M2e.centerX,y:M2e.centerY}}),{5:YEo,...GEo}=yFe.primitives;qIt=Mo({...yFe,primitives:Object.values(GEo).filter(UEo)}),WEo={...qIt,primitives:[...qIt.primitives,YEo]},Yvt={paths:{path40:{type:"path",points:[{x:0.14458890000000002,y:0.04403629999999992},{x:-0.1199943999999995,y:-0.08825540000000043}],color:"primary",fill:!1},path41:{type:"path",points:[{x:-0.1199943999999995,y:0.17632800000000026},{x:0.14458890000000002,y:0.04403629999999992}],color:"primary",fill:!1},path42:{type:"path",points:[{x:-0.1199943999999995,y:-0.0882553999999991},{x:-0.1199943999999995,y:0.17632800000000026}],color:"primary",fill:!1},path43:{type:"path",points:[{x:0.14458890000000002,y:0.17632800000000026},{x:0.14458890000000002,y:-0.0882553999999991}],color:"primary",fill:!1},path44:{type:"path",points:[{x:-0.12219909999999956,y:0.04403629999999992},{x:-0.5168693999999996,y:0.04403629999999992}],color:"primary",fill:!1},"path44-0":{type:"path",points:[{x:0.5233797000000002,y:0.043951100000000354},{x:0.1496715999999998,y:0.043951100000000354}],color:"primary",fill:!1},"path43-8":{type:"path",points:[{x:0.14458890000000002,y:0.17632800000000026},{x:0.21069330000000042,y:0.17632800000000026}],color:"primary",fill:!1},"path43-8-8":{type:"path",points:[{x:0.14458890000000002,y:-0.0882553999999991},{x:0.07848449999999962,y:-0.0882553999999991}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-0.0050250999999996715,y:0.27384530000000007},bottom1:{type:"text",text:"{VAL}",x:-0.00011179999999977319,y:-0.27384529999999985}},refblocks:{left1:{x:-0.5191471000000001,y:0.044920700000000924},right1:{x:0.5191470999999999,y:0.04389609999999999}},bounds:{minX:-0.5473055410000001,maxX:0.5473055409999998,minY:-0.27384529999999985,maxY:0.27384530000000007,width:1.094611082,height:0.5476905999999999,centerX:-0.00000000000000011102230246251565,centerY:0.00000000000000011102230246251565},circles:{}},XEo=gn(Yvt).rotateRightFacingSymbol("right").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_left").changeTextAnchor("{VAL}","middle_left").build(),P1e={paths:{"anode-lead":{type:"path",points:[{x:-0.25,y:0},{x:-0.11999999999999988,y:0}],color:"primary",fill:!1},body:{type:"path",points:[{x:-0.11999999999999988,y:0.11999999999999988},{x:0.1200000000000001,y:0},{x:-0.11999999999999988,y:-0.1200000000000001},{x:-0.11999999999999988,y:0.11999999999999988}],color:"primary",fill:!1},"cathode-bar":{type:"path",points:[{x:0.16999999999999993,y:0.11999999999999988},{x:0.1200000000000001,y:0.11999999999999988},{x:0.1200000000000001,y:-0.1200000000000001},{x:0.07000000000000006,y:-0.1200000000000001}],color:"primary",fill:!1},"cathode-lead":{type:"path",points:[{x:0.1200000000000001,y:0},{x:0.25,y:0}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:0,y:0.25},bottom1:{type:"text",text:"{VAL}",x:0,y:-0.25}},refblocks:{left1:{x:-0.25,y:0},right1:{x:0.25,y:0}},bounds:{minX:-0.25,maxX:0.25,minY:-0.25,maxY:0.25,width:0.5,height:0.5,centerX:0,centerY:0},circles:{}},jEo=Di(P1e,{kind:"diode",orientation:"down",pin1Labels:["1","pos","anode"],pin2Labels:["2","neg","cathode"]}),KEo=Di(P1e,{kind:"diode",orientation:"left",pin1Labels:["1","pos","anode"],pin2Labels:["2","neg","cathode"]}),$Eo=Di(P1e,{kind:"diode",orientation:"right",pin1Labels:["1","pos","anode"],pin2Labels:["2","neg","cathode"]}),qEo=Di(P1e,{kind:"diode",orientation:"up",pin1Labels:["1","pos","anode"],pin2Labels:["2","neg","cathode"]}),{paths:JEo,bounds:w2e,refblocks:JIt,circles:ZEo}=Yvt,eMo=gn({primitives:[...Object.values(JEo),...Object.values(ZEo),{type:"text",text:"{REF}",x:0.15,y:-0.2294553499999995},{type:"text",text:"{VAL}",x:-0.15,y:-0.2294553499999995}],ports:[{...JIt.left1,labels:["1"]},{...JIt.right1,labels:["2"]}],size:{width:w2e.width,height:w2e.height},center:{x:w2e.centerX,y:w2e.centerY}}).rotateRightFacingSymbol("up").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_left").changeTextAnchor("{VAL}","middle_left").build(),E1e={paths:{"anode-lead":{type:"path",points:[{x:-0.17499999999999982,y:0},{x:-0.09999999999999987,y:0}],color:"primary",fill:!1},body:{type:"path",points:[{x:-0.09999999999999987,y:0.09999999999999987},{x:0.10000000000000009,y:0},{x:-0.09999999999999987,y:-0.10000000000000009},{x:-0.09999999999999987,y:0.09999999999999987}],color:"primary",fill:!1},"cathode-bar":{type:"path",points:[{x:0.15000000000000013,y:0.09999999999999987},{x:0.10000000000000009,y:0.09999999999999987},{x:0.10000000000000009,y:-0.10000000000000009},{x:0.050000000000000044,y:-0.10000000000000009}],color:"primary",fill:!1},"cathode-lead":{type:"path",points:[{x:0.10000000000000009,y:0},{x:0.17500000000000004,y:0}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:0,y:0.25},bottom1:{type:"text",text:"{VAL}",x:0,y:-0.25}},refblocks:{left1:{x:-0.17499999999999982,y:0},right1:{x:0.17500000000000004,y:0}},bounds:{minX:-0.17499999999999982,maxX:0.17500000000000004,minY:-0.25,maxY:0.25,width:0.34999999999999987,height:0.5,centerX:0.00000000000000011102230246251565,centerY:0},circles:{}},tMo=Di(E1e,{kind:"diode",orientation:"down",pin1Labels:["1","pos","anode"],pin2Labels:["2","neg","cathode"]}),nMo=Di(E1e,{kind:"diode",orientation:"left",pin1Labels:["1","pos","anode"],pin2Labels:["2","neg","cathode"]}),oMo=Di(E1e,{kind:"diode",orientation:"right",pin1Labels:["1","pos","anode"],pin2Labels:["2","neg","cathode"]}),rMo=Di(E1e,{kind:"diode",orientation:"up",pin1Labels:["1","pos","anode"],pin2Labels:["2","neg","cathode"]}),Es={ac_voltmeter_down:w4o,ac_voltmeter_horz:D4o,ac_voltmeter_left:Q4o,ac_voltmeter_right:H4o,ac_voltmeter_up:O4o,ac_voltmeter_vert:G4o,and_gate_down:U4o,and_gate_left:W4o,and_gate_right:ZIt,and_gate_up:X4o,avalanche_diode_down:$4o,avalanche_diode_horz:q4o,avalanche_diode_left:e3o,avalanche_diode_right:t3o,avalanche_diode_sm_down:o3o,avalanche_diode_sm_left:r3o,avalanche_diode_sm_right:i3o,avalanche_diode_sm_up:s3o,avalanche_diode_up:l3o,avalanche_diode_vert:u3o,avalanche_diode_xs_down:p3o,avalanche_diode_xs_left:m3o,avalanche_diode_xs_right:_3o,avalanche_diode_xs_up:g3o,backward_diode_down:y3o,backward_diode_left:e9t,backward_diode_right:v3o,backward_diode_up:S3o,battery_down:w3o,battery_horz:t9t,battery_left:Q3o,battery_right:F3o,battery_up:Y3o,battery_vert:G3o,boxresistor_down:j3o,boxresistor_left:J3o,boxresistor_right:nCo,boxresistor_sm_down:oCo,boxresistor_sm_left:rCo,boxresistor_sm_right:iCo,boxresistor_sm_up:sCo,boxresistor_small_down:lCo,boxresistor_small_left:uCo,boxresistor_small_right:_Co,boxresistor_small_up:fCo,boxresistor_up:bCo,boxresistor_xs_down:ICo,boxresistor_xs_left:vCo,boxresistor_xs_right:SCo,boxresistor_xs_up:PCo,bridged_ground_down:wCo,bridged_ground_left:DCo,bridged_ground_right:n9t,bridged_ground_up:QCo,capacitor_down:FCo,capacitor_left:OCo,capacitor_polarized_down:VCo,capacitor_polarized_left:YCo,capacitor_polarized_right:GCo,capacitor_polarized_up:UCo,capacitor_right:XCo,capacitor_sm_down:jCo,capacitor_sm_left:KCo,capacitor_sm_right:$Co,capacitor_sm_up:qCo,capacitor_up:tbo,capacitor_xs_down:nbo,capacitor_xs_left:obo,capacitor_xs_right:rbo,capacitor_xs_up:ibo,constant_current_diode_down:cbo,constant_current_diode_horz:lbo,constant_current_diode_left:ubo,constant_current_diode_right:pbo,constant_current_diode_up:gbo,constant_current_diode_vert:ybo,crystal_4pin_down:bbo,crystal_4pin_left:Ibo,crystal_4pin_right:vbo,crystal_4pin_up:Ebo,crystal_down:Bbo,crystal_left:Tbo,crystal_right:Dbo,crystal_up:Qbo,current_source_down:Lbo,current_source_left:Fbo,current_source_right:Obo,current_source_up:Ybo,darlington_pair_transistor_down:Gbo,darlington_pair_transistor_horz:Ubo,darlington_pair_transistor_left:Wbo,darlington_pair_transistor_right:Xbo,darlington_pair_transistor_up:jbo,darlington_pair_transistor_vert:Kbo,dc_ammeter_down:b6t,dc_ammeter_horz:Gre,dc_ammeter_left:Jbo,dc_ammeter_right:Zbo,dc_ammeter_up:e6o,dc_ammeter_vert:b6t,dc_voltmeter_down:o6o,dc_voltmeter_horz:s6o,dc_voltmeter_left:l6o,dc_voltmeter_right:u6o,dc_voltmeter_up:_6o,dc_voltmeter_vert:f6o,diac_down:y6o,diac_horz:x6o,diac_left:C6o,diac_right:b6o,diac_up:I6o,diac_vert:v6o,digital_ground_down:E6o,digital_ground_left:B6o,digital_ground_right:N6o,digital_ground_up:k6o,diode_down:H6o,diode_left:F6o,diode_right:X2e,diode_sm_down:z6o,diode_sm_left:O6o,diode_sm_right:V6o,diode_sm_up:Y6o,diode_up:G6o,diode_xs_down:U6o,diode_xs_left:W6o,diode_xs_right:X6o,diode_xs_up:j6o,dpdt_normally_closed_switch_down:$6o,dpdt_normally_closed_switch_left:q6o,dpdt_normally_closed_switch_right:$2e,dpdt_normally_closed_switch_up:J6o,dpdt_switch_down:eIo,dpdt_switch_left:tIo,dpdt_switch_right:q2e,dpdt_switch_up:nIo,dpst_normally_closed_switch_down:rIo,dpst_normally_closed_switch_left:iIo,dpst_normally_closed_switch_right:J2e,dpst_normally_closed_switch_up:sIo,dpst_switch_down:cIo,dpst_switch_left:lIo,dpst_switch_right:Z2e,dpst_switch_up:hIo,dual_series_schottky_diode_down:uIo,dual_series_schottky_diode_left:pIo,dual_series_schottky_diode_right:o9t,dual_series_schottky_diode_up:mIo,ferrite_bead_down:AIo,ferrite_bead_left:fIo,ferrite_bead_right:s9t,ferrite_bead_up:i9t,filled_diode_down:CIo,filled_diode_horz:vIo,filled_diode_left:EIo,filled_diode_right:BIo,filled_diode_up:NIo,filled_diode_vert:kIo,frequency_meter_horz:bke,frequency_meter_vert:GIo,fuse_horz:a9t,fuse_vert:jIo,ground_down:KIo,ground_horz:$Io,ground_left:qIo,ground_right:JIo,ground_up:ZIo,ground_vert:e9o,gunn_diode_horz:t9o,gunn_diode_vert:n9o,icled_down:r9o,icled_left:i9o,icled_right:e1e,icled_up:s9o,igbt_transistor_horz:c9t,igbt_transistor_vert:c9o,illuminated_push_button_normally_open_horz:h9t,illuminated_push_button_normally_open_vert:h9o,inductor_down:d9o,inductor_left:u9o,inductor_right:p9o,inductor_up:m9o,laser_diode_down:_9o,laser_diode_left:g9o,laser_diode_right:n1e,laser_diode_up:A9o,led_down:C9o,led_left:b9o,led_right:zke,led_sm_down:I9o,led_sm_left:v9o,led_sm_right:S9o,led_sm_up:P9o,led_up:m9t,led_xs_down:E9o,led_xs_left:M9o,led_xs_right:w9o,led_xs_up:B9o,light_dependent_resistor_horz:_9t,light_dependent_resistor_vert:R9o,mosfet_depletion_normally_on_horz:f9t,mosfet_depletion_normally_on_vert:L9o,mushroom_head_normally_open_momentary_horz:x9t,mushroom_head_normally_open_momentary_vert:O9o,n_channel_d_mosfet_transistor_gate_bottom_drain_left:W9o,n_channel_d_mosfet_transistor_gate_bottom_drain_right:X9o,n_channel_d_mosfet_transistor_gate_left_drain_bottom:j9o,n_channel_d_mosfet_transistor_gate_left_drain_top:K9o,n_channel_d_mosfet_transistor_gate_right_drain_bottom:$9o,n_channel_d_mosfet_transistor_gate_right_drain_top:q9o,n_channel_d_mosfet_transistor_gate_top_drain_left:J9o,n_channel_d_mosfet_transistor_gate_top_drain_right:Z9o,n_channel_d_mosfet_transistor_horz:n7,n_channel_d_mosfet_transistor_vert:IM,n_channel_e_mosfet_transistor_gate_bottom_drain_left:ovo,n_channel_e_mosfet_transistor_gate_bottom_drain_right:rvo,n_channel_e_mosfet_transistor_gate_left_drain_bottom:ivo,n_channel_e_mosfet_transistor_gate_left_drain_top:svo,n_channel_e_mosfet_transistor_gate_right_drain_bottom:avo,n_channel_e_mosfet_transistor_gate_right_drain_top:cvo,n_channel_e_mosfet_transistor_gate_top_drain_left:lvo,n_channel_e_mosfet_transistor_gate_top_drain_right:hvo,n_channel_e_mosfet_transistor_horz:o7,n_channel_e_mosfet_transistor_vert:vM,njfet_transistor_horz:P9t,njfet_transistor_vert:mvo,not_connected_down:fvo,not_connected_left:yvo,not_connected_right:i1e,not_connected_up:xvo,npn_bipolar_transistor_down:Ivo,npn_bipolar_transistor_horz:Pvo,npn_bipolar_transistor_left:wvo,npn_bipolar_transistor_right:Dvo,npn_bipolar_transistor_up:Qvo,npn_bipolar_transistor_vert:Hvo,opamp_no_power_down:zvo,opamp_no_power_left:Ovo,opamp_no_power_right:s1e,opamp_no_power_up:Vvo,opamp_with_power_down:Gvo,opamp_with_power_left:Uvo,opamp_with_power_right:a1e,opamp_with_power_up:Wvo,p_channel_d_mosfet_transistor_gate_bottom_drain_left:$vo,p_channel_d_mosfet_transistor_gate_bottom_drain_right:qvo,p_channel_d_mosfet_transistor_gate_left_drain_bottom:Jvo,p_channel_d_mosfet_transistor_gate_left_drain_top:Zvo,p_channel_d_mosfet_transistor_gate_right_drain_bottom:e8o,p_channel_d_mosfet_transistor_gate_right_drain_top:t8o,p_channel_d_mosfet_transistor_gate_top_drain_left:n8o,p_channel_d_mosfet_transistor_gate_top_drain_right:o8o,p_channel_d_mosfet_transistor_horz:r7,p_channel_d_mosfet_transistor_vert:SM,p_channel_e_mosfet_transistor_gate_bottom_drain_left:a8o,p_channel_e_mosfet_transistor_gate_bottom_drain_right:c8o,p_channel_e_mosfet_transistor_gate_left_drain_bottom:l8o,p_channel_e_mosfet_transistor_gate_left_drain_top:h8o,p_channel_e_mosfet_transistor_gate_right_drain_bottom:d8o,p_channel_e_mosfet_transistor_gate_right_drain_top:u8o,p_channel_e_mosfet_transistor_gate_top_drain_left:p8o,p_channel_e_mosfet_transistor_gate_top_drain_right:m8o,p_channel_e_mosfet_transistor_horz:i7,p_channel_e_mosfet_transistor_vert:PM,photodiode_horz:N9t,photodiode_vert:A8o,phototransistor_optocoupler_down:f8o,phototransistor_optocoupler_left:y8o,phototransistor_optocoupler_right:k9t,phototransistor_optocoupler_up:x8o,pjfet_transistor_horz:L9t,pjfet_transistor_vert:v8o,pnp_bipolar_transistor_down:E8o,pnp_bipolar_transistor_horz:M8o,pnp_bipolar_transistor_left:T8o,pnp_bipolar_transistor_right:R8o,pnp_bipolar_transistor_up:L8o,pnp_bipolar_transistor_vert:z8o,potentiometer_horz:z9t,potentiometer_vert:G8o,potentiometer2_down:X8o,potentiometer2_left:j8o,potentiometer2_right:c1e,potentiometer2_up:K8o,potentiometer3_down:J8o,potentiometer3_left:t7o,potentiometer3_right:n7o,potentiometer3_up:i7o,power_factor_meter_horz:O9t,power_factor_meter_vert:l7o,push_button_normally_closed_momentary_horz:Y9t,push_button_normally_closed_momentary_vert:p7o,push_button_normally_open_momentary_down:A7o,push_button_normally_open_momentary_horz:C7o,push_button_normally_open_momentary_left:b7o,push_button_normally_open_momentary_right:Wre,push_button_normally_open_momentary_up:I7o,push_button_normally_open_momentary_vert:v7o,rail_down:M7o,rail_left:D7o,rail_right:k7o,rail_up:F7o,rectifier_diode_horz:U9t,rectifier_diode_vert:U7o,resistor_down:j7o,resistor_left:q7o,resistor_right:eSo,resistor_sm_down:tSo,resistor_sm_left:nSo,resistor_sm_right:oSo,resistor_sm_up:rSo,resistor_up:aSo,resistor_xs_down:cSo,resistor_xs_left:lSo,resistor_xs_right:hSo,resistor_xs_up:dSo,resonator_down:mSo,resonator_horz:X9t,resonator_left:ASo,resonator_right:m1e,resonator_up:fSo,resonator_vert:ySo,schmitt_trigger_inverter_down:xSo,schmitt_trigger_inverter_left:CSo,schmitt_trigger_inverter_right:j9t,schmitt_trigger_inverter_up:bSo,schottky_diode_down:vSo,schottky_diode_left:SSo,schottky_diode_right:_1e,schottky_diode_up:PSo,silicon_controlled_rectifier_horz:$9t,silicon_controlled_rectifier_vert:MSo,solderjumper2_bridged12_down:wSo,solderjumper2_bridged12_left:BSo,solderjumper2_bridged12_right:eHe,solderjumper2_bridged12_up:TSo,solderjumper2_down:DSo,solderjumper2_left:NSo,solderjumper2_right:oHe,solderjumper2_up:RSo,solderjumper3_bridged12_down:QSo,solderjumper3_bridged12_left:kSo,solderjumper3_bridged12_right:sHe,solderjumper3_bridged12_up:LSo,solderjumper3_bridged123_down:HSo,solderjumper3_bridged123_left:FSo,solderjumper3_bridged123_right:lHe,solderjumper3_bridged123_up:zSo,solderjumper3_bridged23_down:OSo,solderjumper3_bridged23_left:VSo,solderjumper3_bridged23_right:uHe,solderjumper3_bridged23_up:YSo,solderjumper3_down:GSo,solderjumper3_left:USo,solderjumper3_right:_He,solderjumper3_up:WSo,spdt_normally_closed_switch_down:jSo,spdt_normally_closed_switch_left:KSo,spdt_normally_closed_switch_right:g1e,spdt_normally_closed_switch_up:$So,spdt_switch_down:JSo,spdt_switch_left:ZSo,spdt_switch_right:A1e,spdt_switch_up:ePo,speaker_down:tPo,speaker_horz:nPo,speaker_left:oPo,speaker_right:rPo,speaker_up:iPo,speaker_vert:sPo,spst_normally_closed_switch_down:aPo,spst_normally_closed_switch_left:cPo,spst_normally_closed_switch_right:y1e,spst_normally_closed_switch_up:lPo,spst_switch_down:hPo,spst_switch_left:dPo,spst_switch_right:C1e,spst_switch_up:uPo,square_wave_down:pPo,square_wave_left:mPo,square_wave_right:_Po,square_wave_up:gPo,step_recovery_diode_horz:vvt,step_recovery_diode_vert:APo,tachometer_horz:eFe,tachometer_vert:SPo,testpoint_down:PPo,testpoint_left:EPo,testpoint_right:I1e,testpoint_up:MPo,tilted_ground_down:BPo,tilted_ground_left:TPo,tilted_ground_right:tFe,tilted_ground_up:Evt,transformer_4_winding_down:DPo,transformer_4_winding_left:NPo,transformer_4_winding_right:Mvt,transformer_4_winding_up:RPo,triac_horz:Bvt,triac_vert:LPo,tunnel_diode_horz:Nvt,tunnel_diode_vert:YPo,unijunction_transistor_horz:Rvt,unijunction_transistor_vert:jPo,usbc:$Po,var_meter_horz:Hvt,var_meter_vert:eEo,varactor_diode_horz:Fvt,varactor_diode_vert:sEo,varistor_horz:zvt,varistor_vert:lEo,varmeter_horz:gFe,varmeter_vert:AEo,vcc_down:yEo,vcc_left:CEo,vcc_right:IEo,vcc_up:SEo,volt_meter_horz:PEo,volt_meter_vert:BEo,watt_hour_meter_horz:fFe,watt_hour_meter_vert:HEo,wattmeter_horz:yFe,wattmeter_vert:WEo,zener_diode_horz:XEo,zener_diode_sm_down:jEo,zener_diode_sm_left:KEo,zener_diode_sm_right:$Eo,zener_diode_sm_up:qEo,zener_diode_vert:eMo,zener_diode_xs_down:tMo,zener_diode_xs_left:nMo,zener_diode_xs_right:oMo,zener_diode_xs_up:rMo},l1s=Object.fromEntries(Object.keys(Es).map((e)=>[e,e]))});var OSt={};jW(OSt,{CIRCUIT_TO_SVG_VERSION:()=>GN,circuitJsonToPcbSvg:()=>FBo,circuitJsonToSchematicSvg:()=>MDo,colorMap:()=>Zh,convertCircuitJsonToAssemblySvg:()=>JBo,convertCircuitJsonToPcbSimulationSvg:()=>OBo,convertCircuitJsonToPcbSvg:()=>yie,convertCircuitJsonToPinoutSvg:()=>xTo,convertCircuitJsonToSchematicSimulationSvg:()=>DNo,convertCircuitJsonToSchematicSvg:()=>uz,convertCircuitJsonToSimulationGraphSvg:()=>FSt,convertCircuitJsonToSolderPasteMask:()=>QNo,convertCircuitJsonToStackedSchematicSheetsSvg:()=>RDo,createErrorTextOverlay:()=>fj,createSvgObjectsForSchComponentPortHovers:()=>sSt,getSoftwareUsedString:()=>YN,isSimulationAnalysisResult:()=>xze,isSimulationCurrentProbe:()=>LSt,isSimulationExperiment:()=>Cze,isSimulationOscilloscopeTrace:()=>HSt,isSimulationTransientCurrentGraph:()=>ANo,isSimulationTransientVoltageGraph:()=>fNo,isSimulationVoltageProbe:()=>kSt});function V1e(e,t){return e.flatMap((n)=>{if(n.children.length){let r=V1e(n.children,t);return r.length?[{...n,children:r}]:[]}return n.attributes["data-pcb-layer"]==="drill"===t?[n]:[]})}function O8t(e){let t={...e.attributes};for(let n of["opacity","fill-opacity","stroke-opacity"])if(n in t)t[n]="1";return{...e,attributes:t,children:e.children.map(O8t)}}function zFe(e){return{...e,attributes:{...e.attributes,...e.attributes.fill&&e.attributes.fill!=="none"?{fill:"black"}:{},...e.attributes.stroke&&e.attributes.stroke!=="none"?{stroke:"black"}:{}},children:e.children.map(zFe)}}function sMo({circuitJson:e,ctx:t,selectedIds:n,hiddenOpacity:o,width:r,height:i,create:s}){let a=new Set(n),c=(f)=>f[`${f.type}_id`],l=new Set(["top","bottom"]);for(let f of e){if(f.type==="pcb_board")for(let y=1;y<=(f.num_layers??2)-2;y++)l.add(`inner${y}`);if("layer"in f&&typeof f.layer==="string"&&/^(top|bottom|inner\d+)$/.test(f.layer))l.add(f.layer);if("layers"in f&&Array.isArray(f.layers)){for(let y of f.layers)if(/^(top|bottom|inner\d+)$/.test(y))l.add(y)}if(f.type==="pcb_trace"){for(let y of f.route)if(y.route_type==="wire")l.add(y.layer)}}let h=t.layer??"top",d=(f)=>f===h?100:f==="bottom"?0:f==="top"?50:40-Number(f.slice(5)),u=[...l].sort((f,y)=>d(f)-d(y)),_={...t,showSolderMask:!1,showSolderPaste:!1,showPinNumbers:!1,showAnchorOffsets:!1,circuitJson:e.filter((f)=>f.type!=="pcb_copper_pour")},p=[],m=[],A=[],g=[];for(let f of u){let y={..._,layer:f,colorMap:{...t.colorMap,copper:{...t.colorMap.copper,top:t.colorMap.copper[f]}}},x=[],C=[],b=[];for(let P of e){if(P.type==="pcb_hole"||P.type==="pcb_cutout"){b.push(...s(P,y).map(zFe));continue}if(!iMo.has(P.type))continue;if("layer"in P&&P.layer!==f)continue;if((P.type==="pcb_via"||P.type==="pcb_plated_hole")&&!P.layers.includes(f))continue;let M=P.type==="pcb_plated_hole"?{...P,layers:[f]}:P,B=M.type==="pcb_trace"?{...M,route:M.route.map((D)=>{let{is_inside_copper_pour:L,copper_pour_id:H,...V}=D;return V})}:M,T=s(B,y).map(O8t),N=V1e(T,!0);if(b.push(...N.map(zFe)),x.push(...V1e(T,!1)),a.has(c(P))){if(C.push(...V1e(T,!1)),f===u.filter((D)=>!("layers"in P)||!Array.isArray(P.layers)||P.layers.includes(D)).at(-1))A.push(...N)}}let I=`xray-holes-${f}`;g.push({name:"mask",type:"element",value:"",attributes:{id:I,maskUnits:"userSpaceOnUse",x:"0",y:"0",width:String(r),height:String(i)},children:[{name:"rect",type:"element",value:"",children:[],attributes:{x:"0",y:"0",width:String(r),height:String(i),fill:"white"}},...b]});let v={"data-pcb-layer":f,mask:`url(#${I})`};p.push(Xre({...v,opacity:String(o)},x)),m.push(Xre(v,C))}return[{name:"defs",type:"element",value:"",attributes:{},children:g},Xre({"data-x-ray":"background"},p),Xre({"data-x-ray":"selected"},m),Xre({"data-x-ray":"drills"},A)]}function aMo(e,t){let{startIsInsideCopperPour:n,endIsInsideCopperPour:o,start:r,end:i}=e;if(n===o)return e;let s=hz(r),a=hz(i),c=lMo(t).flatMap((_)=>dMo(_,s,a));if(c.length===0)return e;let l=o?Math.min(...c):Math.max(...c),h=Y8t(s,a,l),d=cMo(e.startWidth,e.endWidth,l),u={...e,start:n?h:r,end:o?h:i,startWidth:n?d:e.startWidth,endWidth:o?d:e.endWidth};return pMo(u.start,u.end)?null:u}function cMo(e,t,n){return e+(t-e)*n}function lMo(e){switch(e.shape){case"rect":return[hMo(e)];case"polygon":return[e.points.map(hz)];case"brep":return[e.brep_shape.outer_ring.vertices.map(Uvt),...e.brep_shape.inner_rings.map((t)=>t.vertices.map(Uvt))]}}function hMo(e){let t=hz(e.center),n=e.width/2,o=e.height/2,r=(e.rotation??0)*Math.PI/180,i=Math.cos(r),s=Math.sin(r);return[{x:-n,y:-o},{x:n,y:-o},{x:n,y:o},{x:-n,y:o}].map((a)=>({x:t.x+a.x*i-a.y*s,y:t.y+a.x*s+a.y*i}))}function dMo(e,t,n){let o=[];for(let r=0;r<e.length;r++){let i=e[r],s=e[(r+1)%e.length];if(!i||!s)continue;if(i.bulge){o.push(...uMo(t,n,i,s,i.bulge));continue}let a=V8t(t,n,i,s);if(a!==null)o.push(a)}return o}function uMo(e,t,n,o,r){let i=o.x-n.x,s=o.y-n.y,a=Math.hypot(i,s);if(a<xx||Math.abs(r)<xx){let x=V8t(e,t,n,o);return x===null?[]:[x]}let c=a*(1-r**2)/(4*r),l={x:(n.x+o.x)/2-s/a*c,y:(n.y+o.y)/2+i/a*c},h=Math.atan2(n.y-l.y,n.x-l.x),d=4*Math.atan(r),u=Math.hypot(n.x-l.x,n.y-l.y),_={x:t.x-e.x,y:t.y-e.y},p={x:e.x-l.x,y:e.y-l.y},m=CFe(_,_);if(m<xx)return[];let A=2*CFe(p,_),g=CFe(p,p)-u**2,f=A**2-4*m*g;if(f<-xx)return[];let y=Math.sqrt(Math.max(0,f));return[(-A-y)/(2*m),(-A+y)/(2*m)].filter((x)=>{if(x<-xx||x>1+xx)return!1;let C=Y8t(e,t,x),b=Math.atan2(C.y-l.y,C.x-l.x);return(d>0?Gvt(b-h):Gvt(h-b))<=Math.abs(d)+xx})}function V8t(e,t,n,o){let r={x:t.x-e.x,y:t.y-e.y},i={x:o.x-n.x,y:o.y-n.y},s=xFe(r,i);if(Math.abs(s)<xx)return null;let a={x:n.x-e.x,y:n.y-e.y},c=xFe(a,i)/s,l=xFe(a,r)/s;if(c<-xx||c>1+xx||l<-xx||l>1+xx)return null;return Math.min(1,Math.max(0,c))}function xFe(e,t){return e.x*t.y-e.y*t.x}function CFe(e,t){return e.x*t.x+e.y*t.y}function Gvt(e){let t=2*Math.PI,n=e%t;return n<0?n+t:n}function Y8t(e,t,n){return{x:e.x+(t.x-e.x)*n,y:e.y+(t.y-e.y)*n}}function hz(e){return{x:Ke.parse(e.x),y:Ke.parse(e.y)}}function Uvt(e){return{...hz(e),bulge:e.bulge}}function pMo(e,t){let n=hz(e),o=hz(t);return Math.abs(n.x-o.x)<xx&&Math.abs(n.y-o.y)<xx}function dze(e){if(!e||typeof e!=="object")return!1;return"route_type"in e&&e.route_type==="wire"&&(("start_width"in e)||("end_width"in e)||("width_interpolation_mode"in e))}function G8t(e){let t=[];for(let n=0;n<e.length-1;n++){let o=e[n];if(!dze(o))continue;let r=e[n+1];if(!r)continue;let i=r.route_type==="through_pad"?r.start:{x:r.x,y:r.y},s=r.route_type==="via"?r.from_layer:r.route_type==="through_pad"?r.start_layer:r.layer;if(!i||s!==o.layer||o.width!==o.start_width)continue;let a={start:{x:o.x,y:o.y},end:i,start_width:o.start_width,end_width:o.end_width,width_interpolation_mode:o.width_interpolation_mode,layer:o.layer,is_inside_copper_pour:Boolean(o.is_inside_copper_pour&&r.is_inside_copper_pour)};if(W8t(a))t.push(a)}return t}function U8t(e){let{start:t,end:n,start_width:o,end_width:r}=e,i=n.x-t.x,s=n.y-t.y,a=Math.hypot(i,s);if(!W8t(e))return[];let c=Math.abs(r-o),l=e.width_interpolation_mode==="linear"?1:Math.max(1,Math.ceil(Math.sqrt(c/(0.001+c*0.000001)*0.375))),h=-s/a,d=i/a,u=[],_=[];for(let p=0;p<=l;p++){let m=p/l,A=o<=r?m:1-m,f=(e.width_interpolation_mode==="quadratic"?Math.min(o,r)+c*A*A:o+(r-o)*m)/2,y=t.x+i*m,x=t.y+s*m;u.push({x:y+h*f,y:x+d*f}),_.push({x:y-h*f,y:x-d*f})}return[...u,..._.reverse()]}function W8t(e){let{start:t,end:n,start_width:o,end_width:r}=e,i=Math.hypot(n.x-t.x,n.y-t.y);if(![t.x,t.y,n.x,n.y,i,o,r].every(Number.isFinite)||i<=0||o<=0||r<=0)return!1;if(e.width_interpolation_mode!=="linear"&&e.width_interpolation_mode!=="quadratic")return!1;return!0}function mMo(e){switch(e.route_type){case"through_pad":return[e.start,e.end];default:return[e]}}function _Mo(e){let t=[];for(let n=0;n<e.length-1;n++){let o=e[n],r=e[n+1];if(!o||!r)continue;if(dze(o))continue;let i=o.route_type==="through_pad"?o.end:o,s=r.route_type==="through_pad"?r.start:r,a=o.route_type==="wire"?o.layer:o.route_type==="through_pad"?o.end_layer:r.route_type==="wire"?r.layer:r.route_type==="through_pad"?r.start_layer:null;if(!a)continue;if(gMo(i,s))continue;let c=Wvt(o),l=Wvt(r),h=bFe(o)??bFe(r)??0,d=bFe(r)??h;t.push({start:i,end:s,layer:a,width:h,startWidth:h,endWidth:d,isInsideCopperPour:c&&l,startIsInsideCopperPour:c,endIsInsideCopperPour:l,copperPourId:c?Xvt(o):l?Xvt(r):void 0})}for(let n of e){if(!n||n.route_type!=="through_pad")continue;for(let o of new Set([n.start_layer,n.end_layer]))t.push({start:n.start,end:n.end,layer:o,width:n.width,startWidth:n.width,endWidth:n.width,isInsideCopperPour:!1,startIsInsideCopperPour:!1,endIsInsideCopperPour:!1})}return t}function bFe(e){return"width"in e?Ke.parse(e.width):void 0}function Wvt(e){return"is_inside_copper_pour"in e&&e.is_inside_copper_pour===!0}function Xvt(e){if(!("copper_pour_id"in e))return;return e.copper_pour_id}function gMo(e,t){let n=Ke.parse(e.x),o=Ke.parse(e.y),r=Ke.parse(t.x),i=Ke.parse(t.y);return n===r&&o===i}function AMo(e){let t=[],n=[];for(let o=0;o<e.length;o++){let r=e[o];if(!r)continue;let i=fMo(e,o),s=uze(-i.y,i.x),a=r.width/2;t.push({x:r.x+s.x*a,y:r.y+s.y*a}),n.push({x:r.x-s.x*a,y:r.y-s.y*a})}return t.concat(n.reverse())}function fMo(e,t){if(e.length<2)return{x:1,y:0};if(t<=0)return M1e(e[0],e[1]);if(t>=e.length-1)return M1e(e[e.length-2],e[e.length-1]);let n=M1e(e[t-1],e[t]),o=M1e(e[t],e[t+1]),r=uze(n.x+o.x,n.y+o.y);if(r.x!==0||r.y!==0)return r;if(n.x!==0||n.y!==0)return n;if(o.x!==0||o.y!==0)return o;return{x:1,y:0}}function M1e(e,t){if(!e||!t)return{x:1,y:0};let n=uze(t.x-e.x,t.y-e.y);return n.x===0&&n.y===0?{x:1,y:0}:n}function uze(e,t){let n=Math.hypot(e,t);if(n<=Number.EPSILON)return{x:0,y:0};return{x:e/n,y:t/n}}function Y1(e,t=_0){return t.copper[e]??"white"}function sz(e){return yMo[e]??"rgb(105, 105, 105)"}function OFe({elementType:e,shapeAttributes:t,layer:n,fillColor:o,fillOpacity:r,className:i,additionalAttributes:s}){let a={class:i,fill:o,"fill-opacity":r,"data-type":"pcb_soldermask","data-pcb-layer":n,...t,...s};return{name:e,type:"element",value:"",children:[],attributes:a}}function pze(e,t){let{transform:n,colorMap:o}=t,r=t.layer??"top",i=t.showSolderMask&&(r==="top"||r==="bottom");if(i&&!e.layers.includes(r))return[];let s=t.boardOwnerMap?.has(e.pcb_via_id)?e.pcb_via_id:e.pcb_trace_id??e.pcb_via_id,a=t.boardOwnerMap?.get(s),c=e,l=(r==="top"?c.tented_on_top:c.tented_on_bottom)??c.is_tented??(r==="top"?a?.default_via_tented_on_top:a?.default_via_tented_on_bottom),[h,d]=X8t.applyToPoint(n,[e.x,e.y]),u=e.outer_diameter*Math.abs(n.a),_=e.outer_diameter*Math.abs(n.a),p=e.hole_diameter*Math.abs(n.a),m=e.hole_diameter*Math.abs(n.a),A=Math.min(u,_)/2,g=Math.min(p,m)/2,f={name:"g",type:"element",value:"",attributes:{"data-type":"pcb_via","data-pcb-layer":i&&l?r:"through"},children:[{name:"circle",type:"element",value:"",children:[],attributes:{class:"pcb-hole-outer",fill:o.copper[i?r:"top"],cx:h.toString(),cy:d.toString(),r:A.toString(),"data-type":"pcb_via","data-pcb-layer":i?r:"top"}},{name:"circle",type:"element",value:"",children:[],attributes:{class:"pcb-hole-inner",fill:o.drill,cx:h.toString(),cy:d.toString(),r:g.toString(),"data-type":"pcb_via","data-pcb-layer":"drill"}}]};if(i&&l){let y=o.soldermaskWithCopperUnderneath[r],x,C=1;try{let I=gre(y);C=I.alpha(),y=I.alpha(1).rgb().string(),x=gre.rgb(I.red()/2,I.green()/2,I.blue()/2).string()}catch{}let b={name:"g",type:"element",value:"",attributes:{class:"pcb-via-tenting","data-type":"pcb_soldermask","data-pcb-layer":r,opacity:C.toString()},children:[OFe({elementType:"circle",shapeAttributes:{cx:h.toString(),cy:d.toString(),r:A.toString()},layer:r,fillColor:y,fillOpacity:"1",className:"pcb-via-tenting-ring"})]};if(x!==void 0)b.children.push(OFe({elementType:"circle",shapeAttributes:{cx:h.toString(),cy:d.toString(),r:g.toString()},layer:r,fillColor:x,fillOpacity:"1",className:"pcb-via-tenting-hole"}));f.children.push(b)}return[f]}function Aj(e,t){if(e.length===0)return"";let n=e.map((r)=>{let[i,s]=j8t.applyToPoint(t,[r.x,r.y]);return{...r,x:i,y:s}}),o=`M ${n[0].x} ${n[0].y}`;for(let r=0;r<n.length;r++){let i=n[r],s=n[(r+1)%n.length];if(i.bulge){if(Math.hypot(s.x-i.x,s.y-i.y)<0.000000001)continue;let a=i.bulge,c=s.x-i.x,l=s.y-i.y,h=Math.hypot(c,l),d=Math.abs(h/4/a*(a*a+1)),u=a<0?1:0,_=Math.abs(a)>1?1:0;o+=` A ${d} ${d} 0 ${_} ${u} ${s.x} ${s.y}`}else o+=` L ${s.x} ${s.y}`}return o+=" Z",o}function K8t(e,t){if(e.shape==="rect"){let[n,o]=DI.applyToPoint(t,[e.center.x,e.center.y]),r=e.width*Math.abs(t.a),i=e.height*Math.abs(t.d),s=-(e.rotation??0);return{elementType:"rect",shapeAttributes:{x:(-r/2).toString(),y:(-i/2).toString(),width:r.toString(),height:i.toString(),transform:DI.toString(DI.compose(DI.translate(n,o),DI.rotate(s*Math.PI/180)))}}}if(e.shape==="polygon"){if(!e.points||e.points.length===0)return null;return{elementType:"polygon",shapeAttributes:{points:e.points.map((o)=>DI.applyToPoint(t,[o.x,o.y])).map((o)=>`${o[0]},${o[1]}`).join(" ")}}}if(e.shape==="brep"){let{brep_shape:n}=e,o=Aj(n.outer_ring.vertices,t);for(let r of n.inner_rings??[])o+=` ${Aj(r.vertices,t)}`;return{elementType:"path",shapeAttributes:{d:o,"fill-rule":"evenodd"}}}return null}function $8t(e){return`copper-pour-trace-mask-${e}`.replace(/[^a-zA-Z0-9_-]/g,"_")}function xMo({layer:e,circuitJson:t}){for(let n of t){if(n.type!=="pcb_copper_pour")continue;if(n.layer!==e)continue;return $8t(e)}return}function CMo({circuitJson:e,transform:t,svgWidth:n,svgHeight:o,usedMaskIds:r}){if(r.size===0)return null;let i=new Map;for(let a of e){if(a.type!=="pcb_copper_pour")continue;let c=a,l=$8t(c.layer);if(!r.has(l))continue;let h=i.get(l);if(h)h.push(c);else i.set(l,[c])}if(i.size===0)return null;let s=[];for(let[a,c]of i){let l=[{name:"rect",type:"element",value:"",children:[],attributes:{x:"0",y:"0",width:n.toString(),height:o.toString(),fill:"#fff"}}];for(let h of c){let d=K8t(h,t);if(!d)continue;l.push({name:d.elementType,type:"element",value:"",children:[],attributes:{...d.shapeAttributes,fill:"#000"}})}s.push({name:"mask",type:"element",value:"",children:l,attributes:{id:a,maskUnits:"userSpaceOnUse",x:"0",y:"0",width:n.toString(),height:o.toString()}})}return{name:"defs",type:"element",value:"",children:s,attributes:{class:"copper-pour-trace-mask-defs"}}}function q8t(e){let t=[],n=new Map;for(let o of e){let r=o.attributes?.["data-type"],i=o.attributes?.mask;if(!(r==="pcb_trace"||r==="pcb_trace_soldermask")||!i?.includes("#copper-pour-trace-mask-")){t.push(o);continue}let a=n.get(i);if(!a){let p={name:"g",type:"element",value:"",children:[],attributes:{class:"pcb-trace-mask-group",mask:i}};a={object:p,pathsByAttributes:new Map},n.set(i,a),t.push(p)}let{mask:c,d:l="",...h}=o.attributes,d=JSON.stringify(h),u=a.pathsByAttributes.get(d);if(u){u.attributes.d+=` ${l}`;continue}let _={...o,attributes:{...h,d:l}};a.pathsByAttributes.set(d,_),a.object.children.push(_)}return t}function J8t(e,t){let{transform:n,layer:o,colorMap:r,showSolderMask:i}=t;if(!e.route||!Array.isArray(e.route)||e.route.length===0)return[];let s=[],a=t.copperPourTraceMaskIdsByLayer??=new Map,c=[];for(let h of _Mo(e.route)){let d=h;if(d.isInsideCopperPour)continue;if(d.copperPourId&&d.startIsInsideCopperPour!==d.endIsInsideCopperPour){let _=t.circuitJson?.find((p)=>p.type==="pcb_copper_pour"&&p.pcb_copper_pour_id===d.copperPourId);if(_){let p=aMo(d,_);if(!p)continue;d=p}}let u=d.layer;if(!u)continue;if(o&&u!==o)continue;c.push(d)}let l=(h)=>{if(!a.has(h))a.set(h,t.circuitJson?xMo({layer:h,circuitJson:t.circuitJson}):void 0);let d=a.get(h);if(d)return t.usedCopperPourTraceMaskIds?.add(d),{mask:`url(#${d})`};return{}};for(let h of G8t(e.route)){if(o&&h.layer!==o)continue;if(h.is_inside_copper_pour)continue;let d=U8t(h).map((_)=>uie.applyToPoint(n,_));if(!d.length)continue;let u=i?r.soldermaskWithCopperUnderneath[h.layer]:Y1(h.layer,r);s.push({name:"path",type:"element",value:"",children:[],attributes:{class:i?"pcb-soldermask":"pcb-trace",fill:u,stroke:"none",d:d.map((_,p)=>`${p===0?"M":"L"} ${_.x} ${_.y}`).join(" ")+" Z","data-type":i?"pcb_trace_soldermask":"pcb_trace","data-route-type":"wire","data-wire-taper":"true","data-width-interpolation-mode":h.width_interpolation_mode,"data-pcb-layer":h.layer,...l(h.layer)}})}if(e.route_thickness_mode==="interpolated")for(let h of bMo(c)){let d=h[0]?.layer;if(!d)continue;let u=IMo(h,n);if(!u)continue;let _=Y1(d,r),p=r.soldermaskWithCopperUnderneath[d];s.push({name:"path",type:"element",value:"",children:[],attributes:{class:i?"pcb-soldermask":"pcb-trace",fill:i?p:_,stroke:"none",d:u,"shape-rendering":"geometricPrecision","data-type":i?"pcb_trace_soldermask":"pcb_trace","data-pcb-layer":d,...l(d)}})}else for(let h of c){let d=uie.applyToPoint(n,[h.start.x,h.start.y]),u=uie.applyToPoint(n,[h.end.x,h.end.y]),_=h.layer,p=Y1(_,r),m=r.soldermaskWithCopperUnderneath[_],A=h.width?(h.width*Math.abs(n.a)).toString():"0.3",g=l(_);if(i){let f={name:"path",type:"element",value:"",children:[],attributes:{class:"pcb-soldermask",stroke:m,fill:"none",d:`M ${d[0]} ${d[1]} L ${u[0]} ${u[1]}`,"stroke-width":A,"stroke-linecap":"round","stroke-linejoin":"round","shape-rendering":"crispEdges","data-type":"pcb_trace_soldermask","data-pcb-layer":_,...g}};s.push(f)}else{let f={name:"path",type:"element",value:"",children:[],attributes:{class:"pcb-trace",stroke:p,fill:"none",d:`M ${d[0]} ${d[1]} L ${u[0]} ${u[1]}`,"stroke-width":A,"stroke-linecap":"round","stroke-linejoin":"round","shape-rendering":"crispEdges","data-type":"pcb_trace","data-pcb-layer":_,...g}};s.push(f)}}for(let[h,d]of e.route.entries()){if(!d||d.route_type!=="via")continue;if(MMo(t).has(Z8t(d)))continue;s.push(...pze(SMo(e,d,h,t),t))}return s}function bMo(e){let t=[];for(let n of e){let o=t[t.length-1],r=o?.[o.length-1];if(o&&r?.layer===n.layer&&vMo(r.end,n.start))o.push(n);else t.push([n])}return t}function IMo(e,t){let n=e[0];if(!n)return"";let o=[{x:Ke.parse(n.start.x),y:Ke.parse(n.start.y),width:n.startWidth},...e.map((c)=>({x:Ke.parse(c.end.x),y:Ke.parse(c.end.y),width:c.endWidth}))],i=AMo(o).map((c)=>uie.applyToPoint(t,[c.x,c.y])),[s,...a]=i;if(!s)return"";return[`M ${s[0]} ${s[1]}`,...a.map((c)=>`L ${c[0]} ${c[1]}`),"Z"].join(" ")}function vMo(e,t){return Ke.parse(e.x)===Ke.parse(t.x)&&Ke.parse(e.y)===Ke.parse(t.y)}function SMo(e,t,n,o){let r=PMo(e.route,n),i=o.boardOwnerMap?.get(e.pcb_trace_id),{holeDiameter:s,outerDiameter:a}=EMo(i,r);return{type:"pcb_via",pcb_via_id:`${e.pcb_trace_id}_route_via_${n}`,pcb_trace_id:e.pcb_trace_id,subcircuit_id:e.subcircuit_id,pcb_group_id:e.pcb_group_id,x:t.x,y:t.y,outer_diameter:a,hole_diameter:s,layers:[t.from_layer,t.to_layer],tented_on_top:t.tented_on_top,tented_on_bottom:t.tented_on_bottom}}function PMo(e,t){let n=jvt(e,t,-1),o=jvt(e,t,1);return Math.max(n??0,o??0)}function jvt(e,t,n){for(let o=t+n;o>=0&&o<e.length;o+=n){let r=e[o];if(dze(r))return n===-1?r.end_width:r.start_width;if(!r||!("width"in r)||typeof r.width!=="number")continue;return r.width}return}function EMo(e,t){let n=X1e(e?.min_via_hole_diameter),o=X1e(e?.min_via_pad_diameter),r=Math.max(t,0.3),i=Math.max(r*2,0.6);return{holeDiameter:n??r,outerDiameter:o??i}}function MMo(e){return e.standaloneViaPositionKeys??=new Set(e.circuitJson?.filter((t)=>t.type==="pcb_via").map((t)=>Z8t(t))??[])}function Z8t(e){let t=X1e(e.x),n=X1e(e.y);if(t!==void 0&&n!==void 0)return`${t}:${n}`;return`${String(e.x)}:${String(e.y)}`}function X1e(e){if(e===null||e===void 0)return;let t=Ke.safeParse(e);return t.success?t.data:void 0}function e7t(e,t){if(!t)return{};let n=t7t(e,t);if(!n)return{};let o=t.find((a)=>a.type==="source_port"&&a.source_port_id===n),r=t.find((a)=>a.type==="source_component"&&a.source_component_id===o?.source_component_id),i={};if(r?.name&&o?.name)i["data-pad-name"]=`${r.name}.${o.name}`;let s=BMo(n,t);if(s)i["data-pad-net-name"]=s;return i}function wMo(e,t){if(t){let r=t7t(e,t),i=t.find((s)=>s.type==="source_port"&&s.source_port_id===r);if(i?.type==="source_port"&&i.pin_number!=null)return i.pin_number.toString()}let n=e.port_hints?.find((r)=>r.trim().length>0);if(!n)return;return n.match(/^pin(\d+)$/i)?.[1]??n}function t7t(e,t){if(e.source_port_id)return e.source_port_id;if(e.pcb_port_id){let r=t.find((i)=>i.type==="pcb_port"&&i.pcb_port_id===e.pcb_port_id);if(r?.source_port_id)return r.source_port_id}let n=e.pcb_smtpad_id??e.pcb_plated_hole_id;if(!n)return;return t.find((r)=>{if(r.type!=="pcb_port")return!1;let i=r;return i.pcb_smtpad_id===n||i.pcb_plated_hole_id===n})?.source_port_id}function BMo(e,t){let o=t.find((i)=>{if(i.type!=="source_trace")return!1;return i.connected_source_port_ids?.includes(e)})?.connected_source_net_ids?.[0];if(!o)return;return t.find((i)=>i.type==="source_net"&&i.source_net_id===o)?.name}function n7t(e,t){let{transform:n,layer:o,colorMap:r,showSolderMask:i}=t;if(o&&e.layer!==o)return[];let s=e7t(e,t.circuitJson),a=Boolean(e?.is_covered_with_solder_mask),c=i&&a,l=r.soldermaskWithCopperUnderneath[e.layer]??r.soldermaskWithCopperUnderneath.top,h=(e.soldermask_margin??0)*Math.abs(n.a);if(e.shape==="rect"||e.shape==="rotated_rect"){let d=e.width*Math.abs(n.a),u=e.height*Math.abs(n.d),[_,p]=oie.applyToPoint(n,[e.x,e.y]),A=(e.corner_radius??e.rect_border_radius??0)*Math.abs(n.a),g={left:(e.soldermask_margin_left??e.soldermask_margin??0)*Math.abs(n.a),right:(e.soldermask_margin_right??e.soldermask_margin??0)*Math.abs(n.a),top:(e.soldermask_margin_top??e.soldermask_margin??0)*Math.abs(n.a),bottom:(e.soldermask_margin_bottom??e.soldermask_margin??0)*Math.abs(n.a)},f=g.left<0||g.right<0||g.top<0||g.bottom<0,y=g.left===0&&g.right===0&&g.top===0&&g.bottom===0;if(e.shape==="rotated_rect"&&e.ccw_rotation){let P={name:"rect",type:"element",value:"",children:[],attributes:{class:"pcb-pad",fill:Y1(e.layer,r),x:(-d/2).toString(),y:(-u/2).toString(),width:d.toString(),height:u.toString(),transform:`translate(${_} ${p}) rotate(${-e.ccw_rotation})`,"data-type":"pcb_smtpad","data-pcb-layer":e.layer,...s,...A?{rx:A.toString(),ry:A.toString()}:{}}};if(!c)return[P];let M=d+g.left+g.right,B=u+g.top+g.bottom,T=A?A+h:0;if(f){let D={name:"rect",type:"element",value:"",children:[],attributes:{class:"pcb-pad-covered",fill:l,x:(-d/2).toString(),y:(-u/2).toString(),width:d.toString(),height:u.toString(),transform:`translate(${_} ${p}) rotate(${-e.ccw_rotation})`,"data-type":"pcb_smtpad","data-pcb-layer":e.layer,...A?{rx:A.toString(),ry:A.toString()}:{}}},L={name:"rect",type:"element",value:"",children:[],attributes:{class:"pcb-pad-exposed",fill:Y1(e.layer,r),x:(-d/2-g.left).toString(),y:(-u/2-g.top).toString(),width:M.toString(),height:B.toString(),transform:`translate(${_} ${p}) rotate(${-e.ccw_rotation})`,"data-type":"pcb_soldermask","data-pcb-layer":e.layer,...T>0?{rx:T.toString(),ry:T.toString()}:{}}};return[D,L]}if(y)return[{name:"rect",type:"element",value:"",children:[],attributes:{class:"pcb-pad-covered",fill:l,x:(-d/2).toString(),y:(-u/2).toString(),width:d.toString(),height:u.toString(),transform:`translate(${_} ${p}) rotate(${-e.ccw_rotation})`,"data-type":"pcb_smtpad","data-pcb-layer":e.layer,...A?{rx:A.toString(),ry:A.toString()}:{}}}];return[{name:"rect",type:"element",value:"",children:[],attributes:{class:"pcb-soldermask-cutout",fill:r.substrate,x:(-d/2-g.left).toString(),y:(-u/2-g.top).toString(),width:M.toString(),height:B.toString(),transform:`translate(${_} ${p}) rotate(${-e.ccw_rotation})`,...T>0?{rx:T.toString(),ry:T.toString()}:{},"data-type":"pcb_soldermask_opening","data-pcb-layer":e.layer}},P]}let x={name:"rect",type:"element",value:"",children:[],attributes:{class:"pcb-pad",fill:Y1(e.layer,r),x:(_-d/2).toString(),y:(p-u/2).toString(),width:d.toString(),height:u.toString(),"data-type":"pcb_smtpad","data-pcb-layer":e.layer,...s,...A?{rx:A.toString(),ry:A.toString()}:{}}};if(!c)return[x];let C=d+g.left+g.right,b=u+g.top+g.bottom,I=A?A+h:0;if(f){let P={name:"rect",type:"element",value:"",children:[],attributes:{class:"pcb-pad-covered",fill:l,x:(_-d/2).toString(),y:(p-u/2).toString(),width:d.toString(),height:u.toString(),"data-type":"pcb_smtpad","data-pcb-layer":e.layer,...A?{rx:A.toString(),ry:A.toString()}:{}}},M={name:"rect",type:"element",value:"",children:[],attributes:{class:"pcb-pad-exposed",fill:Y1(e.layer,r),x:(_-d/2-g.left).toString(),y:(p-u/2-g.top).toString(),width:C.toString(),height:b.toString(),"data-type":"pcb_soldermask","data-pcb-layer":e.layer,...I>0?{rx:I.toString(),ry:I.toString()}:{}}};return[P,M]}if(y)return[{name:"rect",type:"element",value:"",children:[],attributes:{class:"pcb-pad-covered",fill:l,x:(_-d/2).toString(),y:(p-u/2).toString(),width:d.toString(),height:u.toString(),...I>0?{rx:A.toString(),ry:A.toString()}:{},"data-type":"pcb_smtpad","data-pcb-layer":e.layer}}];return[{name:"rect",type:"element",value:"",children:[],attributes:{class:"pcb-soldermask-cutout",fill:r.substrate,x:(_-d/2-g.left).toString(),y:(p-u/2-g.top).toString(),width:C.toString(),height:b.toString(),...I>0?{rx:I.toString(),ry:I.toString()}:{},"data-type":"pcb_soldermask_opening","data-pcb-layer":e.layer}},x]}if(e.shape==="pill"||e.shape==="rotated_pill"){let d=e.shape==="rotated_pill",u=e.width*Math.abs(n.a),_=e.height*Math.abs(n.d),p=e.radius*Math.abs(n.a),[m,A]=oie.applyToPoint(n,[e.x,e.y]),g=d?{transform:`translate(${m} ${A}) rotate(${-(e.ccw_rotation??0)})`}:void 0,f={class:"pcb-pad",fill:Y1(e.layer,r),x:d?(-u/2).toString():(m-u/2).toString(),y:d?(-_/2).toString():(A-_/2).toString(),width:u.toString(),height:_.toString(),rx:p.toString(),ry:p.toString(),"data-type":"pcb_smtpad","data-pcb-layer":e.layer,...s,...g??{}},y={name:"rect",type:"element",value:"",children:[],attributes:f};if(!c)return[y];let x=u+2*h,C=_+2*h,b=p+h;if(h<0){let P={name:"rect",type:"element",value:"",children:[],attributes:{class:"pcb-pad-covered",fill:l,x:d?(-u/2).toString():(m-u/2).toString(),y:d?(-_/2).toString():(A-_/2).toString(),width:u.toString(),height:_.toString(),rx:p.toString(),ry:p.toString(),"data-type":"pcb_smtpad","data-pcb-layer":e.layer,...g??{}}},M={class:"pcb-pad-exposed",fill:Y1(e.layer,r),x:d?(-x/2).toString():(m-x/2).toString(),y:d?(-C/2).toString():(A-C/2).toString(),width:x.toString(),height:C.toString(),rx:b.toString(),ry:b.toString(),"data-type":"pcb_soldermask","data-pcb-layer":e.layer,...g??{}};return[P,{name:"rect",type:"element",value:"",children:[],attributes:M}]}if(h===0)return[{name:"rect",type:"element",value:"",children:[],attributes:{class:"pcb-pad-covered",fill:l,x:d?(-u/2).toString():(m-u/2).toString(),y:d?(-_/2).toString():(A-_/2).toString(),width:u.toString(),height:_.toString(),rx:p.toString(),ry:p.toString(),"data-type":"pcb_smtpad","data-pcb-layer":e.layer,...g??{}}}];let I={class:"pcb-soldermask-cutout",fill:r.substrate,x:d?(-x/2).toString():(m-x/2).toString(),y:d?(-C/2).toString():(A-C/2).toString(),width:x.toString(),height:C.toString(),rx:b.toString(),ry:b.toString(),"data-type":"pcb_soldermask_opening","data-pcb-layer":e.layer,...g??{}};return[{name:"rect",type:"element",value:"",children:[],attributes:I},y]}if(e.shape==="circle"){let d=e.radius*Math.abs(n.a),[u,_]=oie.applyToPoint(n,[e.x,e.y]),p={name:"circle",type:"element",value:"",children:[],attributes:{class:"pcb-pad",fill:Y1(e.layer,r),cx:u.toString(),cy:_.toString(),r:d.toString(),"data-type":"pcb_smtpad","data-pcb-layer":e.layer,...s}};if(!c)return[p];let m=d+h;if(h<0){let g={name:"circle",type:"element",value:"",children:[],attributes:{class:"pcb-pad-covered",fill:l,cx:u.toString(),cy:_.toString(),r:d.toString(),"data-type":"pcb_smtpad","data-pcb-layer":e.layer}},f={name:"circle",type:"element",value:"",children:[],attributes:{class:"pcb-pad-exposed",fill:Y1(e.layer,r),cx:u.toString(),cy:_.toString(),r:m.toString(),"data-type":"pcb_soldermask","data-pcb-layer":e.layer}};return[g,f]}if(h===0)return[{name:"circle",type:"element",value:"",children:[],attributes:{class:"pcb-pad-covered",fill:l,cx:u.toString(),cy:_.toString(),r:d.toString(),"data-type":"pcb_smtpad","data-pcb-layer":e.layer}}];return[{name:"circle",type:"element",value:"",children:[],attributes:{class:"pcb-soldermask-cutout",fill:r.substrate,cx:u.toString(),cy:_.toString(),r:m.toString(),"data-type":"pcb_soldermask_opening","data-pcb-layer":e.layer}},p]}if(e.shape==="polygon"){let d=(e.points??[]).map((m)=>oie.applyToPoint(n,[m.x,m.y])),u={name:"polygon",type:"element",value:"",children:[],attributes:{class:"pcb-pad",fill:Y1(e.layer,r),points:d.map((m)=>m.join(",")).join(" "),"data-type":"pcb_smtpad","data-pcb-layer":e.layer,...s}};if(!c)return[u];let _=d;if(h!==0){let m=d.reduce((g,f)=>g+f[0],0)/d.length,A=d.reduce((g,f)=>g+f[1],0)/d.length;_=d.map(([g,f])=>{let y=g-m,x=f-A,C=Math.sqrt(y*y+x*x);if(C===0)return[g,f];let b=y/C,I=x/C;return[g+b*h,f+I*h]})}if(h<0){let m={name:"polygon",type:"element",value:"",children:[],attributes:{class:"pcb-pad-covered",fill:l,points:d.map((g)=>g.join(",")).join(" "),"data-type":"pcb_smtpad","data-pcb-layer":e.layer}},A={name:"polygon",type:"element",value:"",children:[],attributes:{class:"pcb-pad-exposed",fill:Y1(e.layer,r),points:_.map((g)=>g.join(",")).join(" "),"data-type":"pcb_soldermask","data-pcb-layer":e.layer}};return[m,A]}if(h===0)return[{name:"polygon",type:"element",value:"",children:[],attributes:{class:"pcb-pad-covered",fill:l,points:d.map((A)=>A.join(",")).join(" "),"data-type":"pcb_smtpad","data-pcb-layer":e.layer}}];return[{name:"polygon",type:"element",value:"",children:[],attributes:{class:"pcb-soldermask-cutout",fill:r.substrate,points:_.map((m)=>m.join(",")).join(" "),"data-type":"pcb_soldermask_opening","data-pcb-layer":e.layer}},u]}return[]}function o7t(e,t){let n=e.filter((r)=>r.type==="simulation_pcb_return_current_result"&&r.simulation_pcb_return_current_result_id===t);if(n.length!==1)throw Error(`Expected one return-current result '${t}'`);let o=_Ae.parse(n[0]);if(!e.some((r)=>r.type==="simulation_experiment"&&r.simulation_experiment_id===o.simulation_experiment_id&&r.experiment_type==="pcb_return_current"))throw Error(`Missing PCB return-current experiment '${o.simulation_experiment_id}'`);if(!e.some((r)=>r.type==="pcb_board"&&r.pcb_board_id===o.pcb_board_id))throw Error(`Missing PCB board '${o.pcb_board_id}'`);return o}function Kvt(e,t){if(e.field_type==="real"){let s=e.sheet_current_x[t],a=e.sheet_current_y[t];return s==null||a==null?null:{x:s,y:a,magnitude:Math.hypot(s,a)}}let n=e.sheet_current_x_real[t],o=e.sheet_current_x_imag[t],r=e.sheet_current_y_real[t],i=e.sheet_current_y_imag[t];if(n==null||o==null||r==null||i==null)return null;return{x:n,y:r,magnitude:Math.hypot(n,o,r,i)}}function $vt(e){let t=Math.max(0,Math.min(1,e))*(w1e.length-1),n=Math.floor(t),o=w1e[n],r=w1e[Math.min(n+1,w1e.length-1)];return`rgb(${o.map((i,s)=>Math.round(i+(r[s]-i)*(t-n))).join(",")})`}function TMo({circuitJson:e,resultId:t,ctx:n,options:o={},width:r,height:i}){let s=o7t(e,t),a=o.opacity??0.65;if(!Number.isFinite(a)||a<0||a>1)throw Error("Return-current opacity must be between 0 and 1");let c=o.densityRange;if(c&&(!Number.isFinite(c.min)||!Number.isFinite(c.max)||c.min<0||c.max<=c.min))throw Error("Return-current densityRange requires 0 <= min < max");let l=(C)=>("simulation_pcb_return_current_result_id"in C)&&C.simulation_pcb_return_current_result_id===t,h=e.filter((C)=>C.type==="simulation_pcb_return_current_heatmap"&&l(C)).map((C)=>AAe.parse(C)).filter((C)=>!n.layer||C.layer===n.layer),d=e.filter((C)=>C.type==="simulation_pcb_return_current_field"&&l(C)).map((C)=>pX.parse(C)).filter((C)=>!n.layer||C.layer===n.layer);if(!d.length&&!h.length)throw Error(`No return-current field or heatmap for '${t}' on ${n.layer??"any layer"}`);let u=d.flatMap((C)=>{let b=o.fieldData?.[C.simulation_pcb_return_current_field_id];if(!b)return[];return[{field:C,grid:mre(C).parse(b)}]});if(!h.length&&!u.length)throw Error("Return-current field assets need decoded fieldData; use convertCircuitJsonToPcbSimulationSvg to load assets");let _=0;for(let{field:C,grid:b}of u)for(let I=0;I<C.columns*C.rows;I++)_=Math.max(_,(Kvt(b,I)?.magnitude??0)/C.copper_thickness);let p=c?.min??0,m=c?.max??(_||1),A=[],g=[];for(let C of h){if(c&&u.some(({field:M})=>M.layer===C.layer&&M.source_net_id===C.source_net_id))continue;let[b,I]=az.applyToPoint(n.transform,[C.min_x,C.max_y]),[v,P]=az.applyToPoint(n.transform,[C.max_x,C.min_y]);A.push(BI("image",{x:String(b),y:String(I),width:String(v-b),height:String(P-I),href:C.image_asset.url,preserveAspectRatio:"none",opacity:String(a),"data-type":C.type,"data-pcb-layer":C.layer,"data-source-net-id":C.source_net_id,"data-units":"A/mm²"}))}for(let{field:C,grid:b}of u){let I=!c&&h.some((v)=>v.layer===C.layer&&v.source_net_id===C.source_net_id);f(C,b,I)}function f(C,b,I){let v=Math.max(1,Math.ceil(Math.sqrt(C.columns*C.rows/500)));for(let P=0;P<C.rows;P++)for(let M=0;M<C.columns;M++){let B=P*C.columns+M,T=Kvt(b,B);if(!T)continue;let N=T.magnitude/C.copper_thickness,D=C.min_x+M*C.cell_width,L=C.min_y+P*C.cell_height,[H,V]=az.applyToPoint(n.transform,[D,L+C.cell_height]);if(!I)A.push(BI("rect",{x:String(H),y:String(V),width:String(C.cell_width*Math.abs(n.transform.a)),height:String(C.cell_height*Math.abs(n.transform.d)),fill:$vt((N-p)/(m-p)),opacity:String(a),"data-type":"simulation_pcb_return_current_cell","data-pcb-layer":C.layer,"data-grid-index":String(B),"data-current-density":String(N),"data-units":"A/mm²"}));if(!o.showVectors||P%v||M%v)continue;let O=Math.hypot(T.x,T.y);if(O===0)continue;let[U,j]=az.applyToPoint(n.transform,[D+C.cell_width/2,L+C.cell_height/2]),Y=T.x/O*8,X=-T.y/O*8,K=U+Y,J=j+X;g.push(BI("path",{d:`M ${U-Y} ${j-X} L ${K} ${J} M ${K-Y*0.4-X*0.3} ${J-X*0.4+Y*0.3} L ${K} ${J} L ${K-Y*0.4+X*0.3} ${J-X*0.4-Y*0.3}`,fill:"none",stroke:"#fff","stroke-width":"1.2","data-type":"simulation_pcb_return_current_vector","data-pcb-layer":C.layer,"data-grid-index":String(B),"data-sheet-current-x":String(T.x),"data-sheet-current-y":String(T.y),"data-units":"A/mm","data-arrow-reference":"excitation-current-peak"}))}}let y=[];for(let C of s.simulation_return_current_excitation_ids){let b=e.find((v)=>v.type==="simulation_return_current_excitation"&&v.simulation_return_current_excitation_id===C);if(!b||b.type!=="simulation_return_current_excitation")throw Error(`Missing return-current excitation '${C}'`);if(b.simulation_experiment_id!==s.simulation_experiment_id)throw Error(`Excitation '${C}' belongs to a different experiment`);let I=e.find((v)=>v.type==="pcb_trace"&&v.pcb_trace_id===b.pcb_trace_id);if(!I||I.type!=="pcb_trace")throw Error(`Missing signal trace '${b.pcb_trace_id}'`);y.push(BI("g",{"data-type":"simulation_pcb_return_current_signal","data-pcb-trace-id":I.pcb_trace_id},J8t({...I,route:I.route.map((v)=>{let{is_inside_copper_pour:P,copper_pour_id:M,...B}=v;return B})},{...n,layer:void 0,showSolderMask:!1,circuitJson:e.filter((v)=>v.type!=="pcb_copper_pour"),colorMap:{...n.colorMap,copper:{...n.colorMap.copper,top:"#08d9ef",bottom:"#ff941f"}}})))}for(let C of e){if(C.type!=="simulation_pcb_return_current_marker"||!l(C))continue;let b=fAe.parse(C),I=b.target_type==="pcb_port"?e.find((D)=>D.type==="pcb_port"&&D.pcb_port_id===b.pcb_port_id):e.find((D)=>D.type==="pcb_via"&&D.pcb_via_id===b.pcb_via_id);if(!I||I.type!=="pcb_port"&&I.type!=="pcb_via")throw Error(`Missing ${b.target_type} for return-current marker '${b.simulation_pcb_return_current_marker_id}'`);let[v,P]=az.applyToPoint(n.transform,[Ke.parse(I.x),Ke.parse(I.y)]),M=b.role.startsWith("return_")?"#ed80e6":"#08d9ef",B=b.target_type==="pcb_port"?e.flatMap((D)=>D.type==="pcb_smtpad"&&D.pcb_port_id===b.pcb_port_id?n7t(D,{...n,layer:void 0,showSolderMask:!1,colorMap:{...n.colorMap,copper:{...n.colorMap.copper,[D.layer]:M}}}):[]):[],T=I.type==="pcb_via"?pze(I,{...n,layer:void 0,showSolderMask:!1,colorMap:{...n.colorMap,drill:"#102b29",copper:{...n.colorMap.copper,top:M}}}):[],N=[...B,...T,BI("circle",{cx:String(v),cy:String(P),r:"8",stroke:M,"stroke-width":"3",fill:"none"})];if(b.label){let D=b.label_x!==void 0&&b.label_y!==void 0?az.applyToPoint(n.transform,[b.label_x,b.label_y]):[v+13,P-13];N.push(BI("line",{x1:String(v),y1:String(P),x2:String(D[0]),y2:String(D[1]),stroke:M,"stroke-width":"1"})),N.push(IFe(b.label,{x:String(D[0]),y:String(D[1]-4),fill:"white","font-size":"12","font-family":"sans-serif","paint-order":"stroke",stroke:"#122b29","stroke-width":"4"}))}y.push(BI("g",{"data-type":b.type,"data-role":b.role,"data-target-type":b.target_type,"data-target-id":b.target_type==="pcb_port"?b.pcb_port_id:b.pcb_via_id},N))}let x=[];if(o.showLegend!==!1){let b=`${s.frequency_hz===void 0?"frequency not specified":`${s.frequency_hz/1e6} MHz`} · ${n.layer??"all result layers"} · average density A/mm² · cyan: top signal · orange: bottom signal · magenta: return${o.showVectors?" · arrows: current at excitation peak":""}`;if(x.push(BI("rect",{x:"0",y:String(i-28),width:String(r),height:"28",fill:"#102b29",opacity:"0.95"})),x.push(IFe(b,{x:"10",y:String(i-10),fill:"white","font-family":"sans-serif","font-size":"12"})),u.length&&(h.length===0||c)){for(let I=0;I<80;I++)x.push(BI("rect",{x:String(r-170+I*2),y:"12",width:"2",height:"10",fill:$vt(I/79)}));x.push(IFe(`${p.toPrecision(3)} – ${m.toPrecision(3)} A/mm²`,{x:String(r-170),y:"36",fill:"white","font-family":"sans-serif","font-size":"12"}))}}return[BI("g",{"data-simulation-result-id":t},[...A,...g,...y,...x])]}function r7t(e){return e.map((t,n)=>({object:t,index:n,layerPriority:NMo(t.attributes?.["data-pcb-layer"]??void 0),typePriority:RMo(t.attributes?.["data-type"]??void 0)})).sort((t,n)=>{if(t.layerPriority!==n.layerPriority)return t.layerPriority-n.layerPriority;if(t.typePriority!==n.typePriority)return t.typePriority-n.typePriority;return t.index-n.index}).map(({object:t})=>t)}function NMo(e){if(!e)return 500;let t=e.toLowerCase();if(t==="global")return-100;if(t==="bottom")return 4;if(t==="board")return 2;if(t==="soldermask-top"||t==="soldermask-bottom")return 3;if(t.startsWith("inner")){let n=t.match(/\d+/);return 5+(n?Number.parseInt(n[0],10):0)}if(t==="through")return 18;if(t==="top")return 17;if(t==="drill")return 30;if(t==="overlay")return 40;return 10}function RMo(e){if(!e)return qvt;return DMo[e]??qvt}function kMo({circuitJson:e,ctx:t,create:n}){if(!t.showSolderMask)return[];let o=[];for(let r of["bottom","top"]){if(t.layer&&t.layer!==r)continue;let i=e.filter((h)=>h.type==="pcb_soldermask_opening"&&h.layer===r);if(i.length===0)continue;let s=i.map((h)=>LMo(h,t)),a=`pcb-soldermask-openings-${r}`,c={...t,layer:r,showSolderMask:!1},l=e.flatMap((h)=>QMo.has(h.type)?n(h,c):[]);o.push({name:"g",type:"element",value:"",attributes:{"data-type":"pcb_soldermask_opening_layer","data-pcb-layer":r},children:[{name:"defs",type:"element",value:"",attributes:{},children:[{name:"clipPath",type:"element",value:"",attributes:{id:a,clipPathUnits:"userSpaceOnUse"},children:s}]},...s.map((h,d)=>({...h,attributes:{...h.attributes,fill:t.colorMap.substrate,"data-type":"pcb_soldermask_opening","data-pcb-layer":r,"data-pcb-soldermask-opening-id":i[d].pcb_soldermask_opening_id}})),{name:"g",type:"element",value:"",attributes:{"clip-path":`url(#${a})`},children:q8t(r7t(l))}]})}return o}function LMo(e,t){let{transform:n}=t,o={type:"element",value:"",children:[]};if(e.shape==="polygon")return{...o,name:"polygon",attributes:{points:e.points.map((c)=>VFe.applyToPoint(n,[c.x,c.y]).join(",")).join(" ")}};let[r,i]=VFe.applyToPoint(n,[e.x,e.y]);if(e.shape==="circle")return{...o,name:"circle",attributes:{cx:String(r),cy:String(i),r:String(e.radius*Math.abs(n.a))}};let s=e.width*Math.abs(n.a),a=e.height*Math.abs(n.d);return{...o,name:"rect",attributes:{x:String(r-s/2),y:String(i-a/2),width:String(s),height:String(a),...e.shape==="rotated_rect"?{transform:`rotate(${-e.ccw_rotation} ${r} ${i})`}:{}}}}function ON(e){let t=(o)=>({...o,children:(o.children??[]).filter((r)=>!(Jvt in(r.attributes??{}))).map(t)}),n=t(e);return n.children.push({name:"style",type:"element",value:"",attributes:{[Jvt]:"",type:"text/css"},children:[{name:"",type:"text",value:`@font-face { font-family: '${pz}'; src: url('data:font/ttf;base64,${IAe}') format('truetype'); font-weight: normal; font-style: normal; }`,attributes:{},children:[]}]}),i7t.stringify(n)}function HMo(e,t,n){let{transform:o,shouldDrawErrors:r}=n;if(!r)return[];let{pcb_port_ids:i}=e,s=t.find((u)=>u.type==="pcb_port"&&u.pcb_port_id===i?.[0]),a=t.find((u)=>u.type==="pcb_port"&&u.pcb_port_id===i?.[1]);if(!s||!a){let _=e.message?.match(/pcb_via\[#?(pcb_via_\d+)\]/)?.[1],p=t.find((m)=>m.type==="pcb_via"&&m.pcb_via_id===_);if(p&&p.type==="pcb_via")return FMo(e,p,n);if(e.center){let m=pj.applyToPoint(o,{x:e.center.x,y:e.center.y});return YFe([{name:"rect",type:"element",attributes:{x:(m.x-5).toString(),y:(m.y-5).toString(),width:"10",height:"10",fill:"red",transform:`rotate(45 ${m.x} ${m.y})`},children:[],value:""},{name:"text",type:"element",attributes:{x:m.x.toString(),y:(m.y-15).toString(),fill:"red","font-family":"sans-serif","font-size":"12","text-anchor":"middle"},children:[{type:"text",value:e.message||"Pcb Trace Error",name:"",attributes:{},children:[]}],value:""}])}else return[]}let c=pj.applyToPoint(o,{x:s.x,y:s.y}),l=pj.applyToPoint(o,{x:a.x,y:a.y}),h={x:(c.x+l.x)/2,y:(c.y+l.y)/2};if(isNaN(c.x)||isNaN(c.y)||isNaN(l.x)||isNaN(l.y)||isNaN(h.x)||isNaN(h.y))return[];let d=[{name:"line",type:"element",attributes:{x1:c.x.toString(),y1:c.y.toString(),x2:h.x.toString(),y2:h.y.toString(),stroke:"red","stroke-width":"1.5","stroke-dasharray":"2,2"},children:[],value:""},{name:"line",type:"element",attributes:{x1:h.x.toString(),y1:h.y.toString(),x2:l.x.toString(),y2:l.y.toString(),stroke:"red","stroke-width":"1.5","stroke-dasharray":"2,2"},children:[],value:""},{name:"rect",type:"element",attributes:{x:(h.x-5).toString(),y:(h.y-5).toString(),width:"10",height:"10",fill:"red",transform:`rotate(45 ${h.x} ${h.y})`},children:[],value:""},{name:"text",type:"element",attributes:{x:h.x.toString(),y:(h.y-15).toString(),fill:"red","font-family":"sans-serif","font-size":"12","text-anchor":"middle"},children:[{type:"text",value:e.message||"Pcb Trace Error",name:"",attributes:{},children:[]}],value:""}];return YFe(d)}function FMo(e,t,n){let{transform:o}=n;if(e.center&&t){let r=pj.applyToPoint(o,{x:e.center.x,y:e.center.y}),i=pj.applyToPoint(o,{x:t.x,y:t.y}),s=i.x-r.x,a=i.y-r.y,c=Math.sqrt(s*s+a*a),l=Math.atan2(a,s)*180/Math.PI,h=10,d=c+20,u=20,_=(r.x+i.x)/2,p=(r.y+i.y)/2;return YFe([{name:"rect",type:"element",attributes:{x:(_-d/2).toString(),y:(p-10).toString(),width:d.toString(),height:20 .toString(),fill:"none",stroke:"red","stroke-width":"1","stroke-dasharray":"3,2",transform:`rotate(${l} ${_} ${p})`},children:[],value:""},{name:"rect",type:"element",attributes:{x:(_-5).toString(),y:(p-5).toString(),width:"10",height:"10",fill:"red",transform:`rotate(45 ${_} ${p})`},children:[],value:""},{name:"text",type:"element",attributes:{x:_.toString(),y:(p-10-5).toString(),fill:"red","font-family":"sans-serif","font-size":"12","text-anchor":"middle"},children:[{type:"text",value:e.message||"Pcb Trace Error",name:"",attributes:{},children:[]}],value:""}])}return[]}function YFe(e){return e.map((t)=>({...t,attributes:{...t.attributes??{},"data-type":t.attributes?.["data-type"]??"pcb_trace_error","data-pcb-layer":t.attributes?.["data-pcb-layer"]??"overlay"},children:(t.children??[]).map((n)=>{if(n?.type==="element")return{...n,attributes:{...n.attributes??{},"data-type":n.attributes?.["data-type"]??"pcb_trace_error","data-pcb-layer":n.attributes?.["data-pcb-layer"]??"overlay"}};return n})}))}function zMo(e){return e.map((t)=>({...t,attributes:{...t.attributes??{},"data-type":t.attributes?.["data-type"]??"pcb_footprint_overlap_error","data-pcb-layer":t.attributes?.["data-pcb-layer"]??"overlay"},children:(t.children??[]).map((n)=>{if(n?.type==="element")return{...n,attributes:{...n.attributes??{},"data-type":n.attributes?.["data-type"]??"pcb_footprint_overlap_error","data-pcb-layer":n.attributes?.["data-pcb-layer"]??"overlay"}};return n})}))}function OMo(e,t,n){let{transform:o,shouldDrawErrors:r}=n;if(!r)return[];let i=[],s=[],a=[];if(e.pcb_smtpad_ids)for(let h of e.pcb_smtpad_ids){let d=t.find((u)=>u.type==="pcb_smtpad"&&u.pcb_smtpad_id===h);if(d){if(s.push({x:d.x,y:d.y,type:"pcb_smtpad",id:h,pcb_port_id:d.pcb_port_id}),d.pcb_port_id)a.push(d.pcb_port_id)}}let c=a.length>1&&a.every((h)=>h===a[0]),l=s;if(c)l=s.filter((h)=>h.type!=="pcb_smtpad");if(e.pcb_plated_hole_ids)for(let h of e.pcb_plated_hole_ids){let d=t.find((u)=>u.type==="pcb_plated_hole"&&u.pcb_plated_hole_id===h);if(d)l.push({x:d.x,y:d.y,type:"pcb_plated_hole",id:h})}if(e.pcb_hole_ids)for(let h of e.pcb_hole_ids){let d=t.find((u)=>u.type==="pcb_hole"&&u.pcb_hole_id===h);if(d)l.push({x:d.x,y:d.y,type:"pcb_hole",id:h})}if(l.length>0){let h=l.reduce((_,p)=>_+p.x,0)/l.length,d=l.reduce((_,p)=>_+p.y,0)/l.length,u=GFe.applyToPoint(o,{x:h,y:d});i.push({name:"rect",type:"element",attributes:{x:(u.x-5).toString(),y:(u.y-5).toString(),width:"10",height:"10",fill:"red",transform:`rotate(45 ${u.x} ${u.y})`},children:[],value:""}),i.push({name:"text",type:"element",attributes:{x:u.x.toString(),y:(u.y-15).toString(),fill:"red","font-family":"sans-serif","font-size":"12","text-anchor":"middle"},children:[{type:"text",value:e.message||"PCB Footprint Overlap Error",name:"",attributes:{},children:[]}],value:""});for(let _ of l){let p=GFe.applyToPoint(o,{x:_.x,y:_.y});if(i.push({name:"rect",type:"element",attributes:{x:(p.x-5).toString(),y:(p.y-5).toString(),width:"10",height:"10",fill:"red",transform:`rotate(45 ${p.x} ${p.y})`},children:[],value:""}),l.length>1)i.push({name:"line",type:"element",attributes:{x1:u.x.toString(),y1:u.y.toString(),x2:p.x.toString(),y2:p.y.toString(),stroke:"red","stroke-width":"1.5","stroke-dasharray":"2,2"},children:[],value:""})}}return zMo(i)}function VMo(e,t,n){let{transform:o,shouldDrawErrors:r}=n;if(!r)return[];let i=[],s=[];for(let h of e.pcb_component_ids){let d=t.find((u)=>u.type==="pcb_component"&&u.pcb_component_id===h);if(d)s.push(d.center)}if(s.length===0)return[];let a=s.reduce((h,d)=>h+d.x,0)/s.length,c=s.reduce((h,d)=>h+d.y,0)/s.length,l=Y1e.applyToPoint(o,{x:a,y:c});i.push({name:"rect",type:"element",attributes:{x:(l.x-5).toString(),y:(l.y-5).toString(),width:"10",height:"10",fill:"red",transform:`rotate(45 ${l.x} ${l.y})`,"data-type":"pcb_courtyard_overlap_error","data-pcb-layer":"overlay"},children:[],value:""}),i.push({name:"text",type:"element",attributes:{x:l.x.toString(),y:(l.y-15).toString(),fill:"red","font-family":"sans-serif","font-size":"12","text-anchor":"middle","data-type":"pcb_courtyard_overlap_error","data-pcb-layer":"overlay"},children:[{type:"text",value:e.message||"PCB Courtyard Overlap",name:"",attributes:{},children:[]}],value:""});for(let h of s){let d=Y1e.applyToPoint(o,h);i.push({name:"rect",type:"element",attributes:{x:(d.x-5).toString(),y:(d.y-5).toString(),width:"10",height:"10",fill:"red",transform:`rotate(45 ${d.x} ${d.y})`,"data-type":"pcb_courtyard_overlap_error","data-pcb-layer":"overlay"},children:[],value:""})}if(s.length===2){let h=s.map((_)=>Y1e.applyToPoint(o,_)),d=h[0],u=h[1];i.push({name:"line",type:"element",attributes:{x1:d.x.toString(),y1:d.y.toString(),x2:u.x.toString(),y2:u.y.toString(),stroke:"red","stroke-width":"1.5","stroke-dasharray":"4,3","data-type":"pcb_courtyard_overlap_error","data-pcb-layer":"overlay"},children:[],value:""})}return i}function YMo(e){return e.map((t)=>({...t,attributes:{...t.attributes??{},"data-type":t.attributes?.["data-type"]??"pcb_component_outside_board_error","data-pcb-layer":t.attributes?.["data-pcb-layer"]??"overlay"}}))}function GMo(e,t){let n=e.pcb_component_id;if(!n)return e.component_bounds??null;let o=t.find((r)=>r.type==="pcb_component"&&r.pcb_component_id===n);if(o?.center&&o?.width&&o?.height)return{min_x:o.center.x-o.width/2,max_x:o.center.x+o.width/2,min_y:o.center.y-o.height/2,max_y:o.center.y+o.height/2};return e.component_bounds??null}function UMo(e,t,n){let{shouldDrawErrors:o,transform:r}=n;if(!o)return[];let i=GMo(e,t);if(!i)return[];let s=UFe.applyToPoint(r,{x:i.min_x,y:i.min_y}),a=UFe.applyToPoint(r,{x:i.max_x,y:i.max_y}),c=Math.min(s.x,a.x),l=Math.min(s.y,a.y),h=Math.abs(a.x-s.x),d=Math.abs(a.y-s.y),u=c+h/2,_=l+d/2,p=[{type:"element",name:"rect",value:"",attributes:{x:c.toString(),y:l.toString(),width:h.toString(),height:d.toString(),fill:"none",stroke:"red","stroke-width":"1.5","stroke-dasharray":"4,2"},children:[]},{type:"element",name:"rect",value:"",attributes:{x:(u-5).toString(),y:(_-5).toString(),width:"10",height:"10",fill:"red",transform:`rotate(45 ${u} ${_})`},children:[]},{type:"element",name:"text",value:"",attributes:{x:u.toString(),y:(l-10).toString(),fill:"red","font-family":"sans-serif","font-size":"12","text-anchor":"middle"},children:[{type:"text",name:"",value:e.message??"PCB component extends outside board boundaries",attributes:{},children:[]}]}];return YMo(p)}function pie(e){return e!==void 0&&typeof e.x==="number"&&Number.isFinite(e.x)&&typeof e.y==="number"&&Number.isFinite(e.y)}function WMo(e,t){if(e.type==="pcb_via_trace_clearance_error")return t.find((n)=>n.type==="pcb_via"&&n.pcb_via_id===e.pcb_via_id);return t.find((n)=>n.type==="pcb_smtpad"&&n.pcb_smtpad_id===e.pcb_pad_id||n.type==="pcb_plated_hole"&&n.pcb_plated_hole_id===e.pcb_pad_id)}function XMo(e){if(!e)return;if("x"in e&&"y"in e&&pie(e))return{x:e.x,y:e.y};if(e.type==="pcb_smtpad"&&e.shape==="polygon"&&e.points.length>0){let t=e.points.filter(pie);if(t.length===0)return;let n=t.map((r)=>r.x),o=t.map((r)=>r.y);return{x:(Math.min(...n)+Math.max(...n))/2,y:(Math.min(...o)+Math.max(...o))/2}}return}function jMo(e){if(e.route_type==="through_pad")return[e.start,e.end].filter(pie);let t=e;return pie(t)?[{x:t.x,y:t.y}]:[]}function KMo(e){if(!e)return;let t,n;for(let o of e.route){let r=jMo(o);if(!t&&r[0])t=r[0];if(r.length>0)n=r[r.length-1]}return t&&n?{start:t,end:n}:void 0}function $Mo(e,t){return{x:(e.x+t.x)/2,y:(e.y+t.y)/2}}function vFe(e,t,n){let o=e.x-t.x,r=e.y-t.y;if(o*o+r*r<0.25)return;return{type:"element",name:"line",value:"",attributes:{x1:e.x.toString(),y1:e.y.toString(),x2:t.x.toString(),y2:t.y.toString(),stroke:"red","stroke-width":"1.5","stroke-dasharray":"2,2","data-error-reference":n},children:[]}}function qMo(e,t){return e.map((n)=>({...n,attributes:{...n.attributes??{},"data-type":n.attributes?.["data-type"]??t,"data-pcb-layer":n.attributes?.["data-pcb-layer"]??"overlay"}}))}function JMo(e,t,n){let{shouldDrawErrors:o,transform:r}=n;if(!o)return[];let i=XMo(WMo(e,t)),s=t.find((y)=>y.type==="pcb_trace"&&y.pcb_trace_id===e.pcb_trace_id),a=KMo(s),c=pie(e.center)?e.center:i??(a?$Mo(a.start,a.end):void 0);if(!c)return[];let l=rie.applyToPoint(r,c),h=i?rie.applyToPoint(r,i):void 0,d=a?{start:rie.applyToPoint(r,a.start),end:rie.applyToPoint(r,a.end)}:void 0,u=[d?vFe(d.start,l,"trace-start"):void 0,d?vFe(d.end,l,"trace-end"):void 0,h?vFe(h,l,"obstacle"):void 0].filter((y)=>y!==void 0),_=e.type==="pcb_pad_trace_clearance_error"?"Pad/trace":"Via/trace",{actual_clearance:p,minimum_clearance:m}=e,A=p!==void 0&&m!==void 0?`${_} clearance ${p} is below minimum ${m}`:e.type==="pcb_pad_trace_clearance_error"?"Pad and trace too close":"Via and trace too close",g=e.message??A,f=[...u,{type:"element",name:"rect",value:"",attributes:{x:(l.x-5).toString(),y:(l.y-5).toString(),width:"10",height:"10",fill:"red",transform:`rotate(45 ${l.x} ${l.y})`},children:[]},{type:"element",name:"text",value:"",attributes:{x:l.x.toString(),y:(l.y-15).toString(),fill:"red","font-family":"sans-serif","font-size":"12","text-anchor":"middle"},children:[{type:"text",name:"",value:g,attributes:{},children:[]}]}];return qMo(f,e.type)}function ZMo(e,t){let{transform:n}=t;if(!Array.isArray(e.route)||e.route.length<2)return[];let o=e.route[0],r=e.route[e.route.length-1],i=o.x===r.x&&o.y===r.y,s=e.route.slice(0,i?-1:void 0).map((h,d)=>{let[u,_]=s7t.applyToPoint(n,[h.x,h.y]);return d===0?`M ${u} ${_}`:`L ${u} ${_}`}).join(" ")+(i||e.is_filled?" Z":""),a=e.color||"rgba(255,255,255,0.5)",c=a,l;if(e.is_filled&&e.has_stroke!==!1&&e.stroke_width>0)try{let h=gre(a);if(h.alpha()<1)c=h.alpha(1).rgb().string(),l=h.alpha().toString()}catch{}return[{name:"path",type:"element",attributes:{class:"pcb-fabrication-note-path",stroke:e.has_stroke===!1?"none":c,fill:e.is_filled?c:"none",d:s,...l===void 0?{}:{opacity:l},"stroke-width":(e.stroke_width*Math.abs(n.a)).toString(),"data-pcb-component-id":e.pcb_component_id,"data-pcb-fabrication-note-path-id":e.pcb_fabrication_note_path_id,"data-type":"pcb_fabrication_note_path","data-pcb-layer":"overlay"},value:"",children:[]}]}function h7t(e){switch(e){case"top_left":return{textAnchor:"start",dominantBaseline:"text-before-edge"};case"top_center":return{textAnchor:"middle",dominantBaseline:"text-before-edge"};case"top_right":return{textAnchor:"end",dominantBaseline:"text-before-edge"};case"center_left":return{textAnchor:"start",dominantBaseline:"central"};case"center_right":return{textAnchor:"end",dominantBaseline:"central"};case"bottom_left":return{textAnchor:"start",dominantBaseline:"text-after-edge"};case"bottom_center":return{textAnchor:"middle",dominantBaseline:"text-after-edge"};case"bottom_right":return{textAnchor:"end",dominantBaseline:"text-after-edge"};case"center":default:return{textAnchor:"middle",dominantBaseline:"central"}}}function ewo(e,t){let{transform:n,layer:o}=t,{anchor_position:r,anchor_alignment:i="center",text:s,font_size:a=1,layer:c="top",color:l,ccw_rotation:h=0}=e;if(o&&c!==o)return[];if(!r||typeof r.x!=="number"||typeof r.y!=="number")return lm(`[pcb_fabrication_note_text] Invalid anchor_position for "${e.pcb_fabrication_note_text_id}": expected {x: number, y: number}, got ${JSON.stringify(r)}`),[];let[d,u]=VN.applyToPoint(n,[r.x,r.y]),_=a*Math.abs(n.a),{textAnchor:p,dominantBaseline:m}=h7t(i),A=VN.compose(VN.translate(d,u),VN.rotate(-h*Math.PI/180));return[{name:"text",type:"element",attributes:{x:"0",y:"0","font-family":pz,"font-size":_.toString(),"text-anchor":p,"dominant-baseline":m,transform:l7t.toString(A),class:"pcb-fabrication-note-text",fill:l||"rgba(255,255,255,0.5)","data-type":"pcb_fabrication_note_text","data-pcb-layer":"overlay"},children:[{type:"text",value:s,name:"",attributes:{},children:[]}],value:""}]}function owo(e,t){let{transform:n,layer:o}=t,{center:r,width:i,height:s,stroke_width:a,is_filled:c,has_stroke:l,is_stroke_dashed:h,color:d,layer:u="top",pcb_component_id:_,pcb_fabrication_note_rect_id:p,corner_radius:m}=e;if(o&&u!==o)return[];if(!r||typeof r.x!=="number"||typeof r.y!=="number"||typeof i!=="number"||typeof s!=="number")return lm(`[pcb_fabrication_note_rect] Invalid data for "${p}": expected center {x: number, y: number}, width: number, height: number, got center=${JSON.stringify(r)}, width=${JSON.stringify(i)}, height=${JSON.stringify(s)}`),[];let A=i/2,g=s/2,[f,y]=WFe.applyToPoint(n,[r.x-A,r.y+g]),[x,C]=WFe.applyToPoint(n,[r.x+A,r.y-g]),b=Math.min(f,x),I=Math.min(y,C),v=Math.abs(x-f),P=Math.abs(C-y),B=(typeof a==="number"?a:0)*Math.abs(n.a),T=d??two,N=typeof m==="number"&&m>0?m:0,D=N*Math.abs(n.a),L=N*Math.abs(n.d),H={x:b.toString(),y:I.toString(),width:v.toString(),height:P.toString(),class:"pcb-fabrication-note-rect","data-type":"pcb_fabrication_note_rect","data-pcb-fabrication-note-rect-id":p,"data-pcb-layer":"overlay"};if(_!==void 0)H["data-pcb-component-id"]=_;if(D>0)H.rx=D.toString();if(L>0)H.ry=L.toString();if(c)H.fill=d??nwo;else H.fill="none";if(l??B>0){if(H.stroke=T,H["stroke-width"]=B.toString(),h){let U=0.2*Math.abs(n.a),j=0.1*Math.abs(n.a);H["stroke-dasharray"]=`${U} ${j}`}}else H.stroke="none";return[{name:"rect",type:"element",value:"",attributes:H,children:[]}]}function SFe(e){let t=Math.hypot(e.x,e.y)||1;return{x:e.x/t,y:e.y/t}}function Zvt(e){return e.map((t,n)=>n===0?`M ${t.x} ${t.y}`:`L ${t.x} ${t.y}`).join(" ")}function awo(e,t){let{transform:n,layer:o}=t,{from:r,to:i,text:s,font_size:a=1,color:c,arrow_size:l,layer:h,pcb_component_id:d,pcb_fabrication_note_dimension_id:u,offset_distance:_,offset_direction:p,text_ccw_rotation:m}=e;if(o&&h&&h!==o)return[];if(!r||!i||typeof r!=="object"||typeof i!=="object")return lm(`[pcb_fabrication_note_dimension] Invalid endpoints for "${u}": expected {from: {x, y}, to: {x, y}}, got from=${JSON.stringify(r)}, to=${JSON.stringify(i)}`),[];if(typeof r.x!=="number"||typeof r.y!=="number"||typeof i.x!=="number"||typeof i.y!=="number")return lm(`[pcb_fabrication_note_dimension] Invalid point values for "${u}": x and y must be numbers, got from=${JSON.stringify(r)}, to=${JSON.stringify(i)}`),[];let A=typeof l==="number"?l:void 0;if(A===void 0||!Number.isFinite(A)||A<=0)return lm(`[pcb_fabrication_note_dimension] Invalid arrow_size for "${u}": expected positive number, got ${JSON.stringify(l)}`),[];let g=A,f=SFe({x:i.x-r.x,y:i.y-r.y});if(Number.isNaN(f.x)||Number.isNaN(f.y))return[];let y={x:-f.y,y:f.x},x=p&&typeof p.x==="number"&&typeof p.y==="number",C=x?SFe({x:p.x,y:p.y}):{x:0,y:0},b=typeof _==="number"?_:0,I={x:C.x*b,y:C.y*b},v=(Se)=>({x:Se.x+I.x,y:Se.y+I.y}),P=v(r),M=v(i),B=g/2,T={x:P.x+f.x*g,y:P.y+f.y*g},N={x:M.x-f.x*g,y:M.y-f.y*g},D=[ye(P),ye({x:T.x+y.x*B,y:T.y+y.y*B}),ye({x:T.x-y.x*B,y:T.y-y.y*B})],L=[ye(M),ye({x:N.x+y.x*B,y:N.y+y.y*B}),ye({x:N.x-y.x*B,y:N.y-y.y*B})],[H,V]=EM.applyToPoint(n,[T.x,T.y]),[O,U]=EM.applyToPoint(n,[N.x,N.y]),j=g/5*Math.abs(n.a),Y=c||"rgba(255,255,255,0.5)",X=x&&(Math.abs(C.x)>Number.EPSILON||Math.abs(C.y)>Number.EPSILON)?C:y,K=b+g,J=(Se)=>{let Ne={x:Se.x+X.x*K,y:Se.y+X.y*K},[Le,nt]=EM.applyToPoint(n,[Se.x,Se.y]),[dt,rt]=EM.applyToPoint(n,[Ne.x,Ne.y]);return{name:"path",type:"element",value:"",attributes:{d:`M ${Le} ${nt} L ${dt} ${rt}`,stroke:Y,fill:"none","stroke-width":j.toString(),"stroke-linecap":"round",class:"pcb-fabrication-note-dimension-extension"},children:[]}},ee=[J(r),J(i)],se={x:(r.x+i.x)/2+I.x,y:(r.y+i.y)/2+I.y},[ne,re]=EM.applyToPoint(n,[P.x,P.y]),[Z,te]=EM.applyToPoint(n,[M.x,M.y]),ie=SFe({x:Z-ne,y:te-re}),ce=Math.atan2(ie.y,ie.x)*180/Math.PI;if(ce>90||ce<-90)ce+=180;let ue=typeof m==="number"&&Number.isFinite(m)?ce-m:ce,de=0;if(s&&typeof m==="number"&&Number.isFinite(m)){let Se=s.length*a*iwo,Ne=a,Le=m*Math.PI/180,nt=Math.abs(Math.sin(Le)),dt=Math.abs(Math.cos(Le)),rt=Se/2,pt=Ne/2;de=rt*nt+pt*dt+a*swo}let me=g*rwo+de,ge={x:se.x+y.x*me,y:se.y+y.y*me},[xe,Ee]=EM.applyToPoint(n,[ge.x,ge.y]),Re=a*Math.abs(n.a),Me=[...ee,{name:"path",type:"element",value:"",attributes:{d:`M ${H} ${V} L ${O} ${U}`,stroke:Y,fill:"none","stroke-width":j.toString(),"stroke-linecap":"round",class:"pcb-fabrication-note-dimension-line"},children:[]},{name:"path",type:"element",value:"",attributes:{d:`${Zvt(D)} Z`,fill:Y,class:"pcb-fabrication-note-dimension-arrow"},children:[]},{name:"path",type:"element",value:"",attributes:{d:`${Zvt(L)} Z`,fill:Y,class:"pcb-fabrication-note-dimension-arrow"},children:[]}];if(s)Me.push({name:"text",type:"element",value:"",attributes:{x:xe.toString(),y:Ee.toString(),fill:Y,"font-size":Re.toString(),"font-family":pz,"text-anchor":"middle","dominant-baseline":"central",class:"pcb-fabrication-note-dimension-text",transform:`rotate(${ue} ${xe} ${Ee})`},children:[{type:"text",name:"",value:s,attributes:{},children:[]}]});let _e={class:"pcb-fabrication-note-dimension","data-type":"pcb_fabrication_note_dimension","data-pcb-fabrication-note-dimension-id":u,"data-pcb-layer":h??"overlay"};if(d!==void 0)_e["data-pcb-component-id"]=d;return[{name:"g",type:"element",value:"",attributes:_e,children:Me}];function ye(Se){let[Ne,Le]=EM.applyToPoint(n,[Se.x,Se.y]);return{x:Ne,y:Le}}}function PFe(e){let t=Math.hypot(e.x,e.y)||1;return{x:e.x/t,y:e.y/t}}function e8t(e){return e.map((t,n)=>n===0?`M ${t.x} ${t.y}`:`L ${t.x} ${t.y}`).join(" ")}function cwo(e,t){let{transform:n}=t,{from:o,to:r,text:i,font_size:s=1,color:a,arrow_size:c,offset_distance:l,offset_direction:h,text_ccw_rotation:d}=e;if(!o||!r)return lm(`[pcb_note_dimension] Invalid endpoints for "${e.pcb_note_dimension_id}": expected {from: {x, y}, to: {x, y}}, got from=${JSON.stringify(o)}, to=${JSON.stringify(r)}`),[];if(!Number.isFinite(c)||c<=0)return lm(`[pcb_note_dimension] Invalid arrow_size for "${e.pcb_note_dimension_id}": expected positive number, got ${JSON.stringify(c)}`),[];let u=PFe({x:r.x-o.x,y:r.y-o.y});if(Number.isNaN(u.x)||Number.isNaN(u.y))return[];let _={x:-u.y,y:u.x},p=h&&typeof h.x==="number"&&typeof h.y==="number",m=p?PFe({x:h.x,y:h.y}):{x:0,y:0},A=typeof l==="number"?l:0,g={x:m.x*A,y:m.y*A},f=(ge)=>({x:ge.x+g.x,y:ge.y+g.y}),y=f(o),x=f(r),C=c/2,b={x:y.x+u.x*c,y:y.y+u.y*c},I={x:x.x-u.x*c,y:x.y-u.y*c},v=[me(y),me({x:b.x+_.x*C,y:b.y+_.y*C}),me({x:b.x-_.x*C,y:b.y-_.y*C})],P=[me(x),me({x:I.x+_.x*C,y:I.y+_.y*C}),me({x:I.x-_.x*C,y:I.y-_.y*C})],[M,B]=MM.applyToPoint(n,[b.x,b.y]),[T,N]=MM.applyToPoint(n,[I.x,I.y]),D=c/5*Math.abs(n.a),L=a||Zh.board.user_2,H=p&&(Math.abs(m.x)>Number.EPSILON||Math.abs(m.y)>Number.EPSILON)?m:_,V=A+c,O=(ge)=>{let xe={x:ge.x+H.x*V,y:ge.y+H.y*V},[Ee,Re]=MM.applyToPoint(n,[ge.x,ge.y]),[Me,_e]=MM.applyToPoint(n,[xe.x,xe.y]);return{name:"path",type:"element",value:"",attributes:{d:`M ${Ee} ${Re} L ${Me} ${_e}`,stroke:L,fill:"none","stroke-width":D.toString(),"stroke-linecap":"round",class:"pcb-note-dimension-extension"},children:[]}},U=[O(o),O(r)],j={x:(o.x+r.x)/2+g.x,y:(o.y+r.y)/2+g.y},[Y,X]=MM.applyToPoint(n,[y.x,y.y]),[K,J]=MM.applyToPoint(n,[x.x,x.y]),ee=PFe({x:K-Y,y:J-X}),se=Math.atan2(ee.y,ee.x)*180/Math.PI;if(se>90||se<-90)se+=180;let ne=typeof d==="number"&&Number.isFinite(d)?se-d:se,re=0;if(i&&typeof d==="number"&&Number.isFinite(d)){let ge=i.length*s*0.6,xe=s,Ee=d*Math.PI/180,Re=Math.abs(Math.sin(Ee)),Me=Math.abs(Math.cos(Ee)),_e=ge/2,ye=xe/2;re=_e*Re+ye*Me+s*0.3}let Z=c*1.5+re,te={x:j.x+_.x*Z,y:j.y+_.y*Z},[ie,ce]=MM.applyToPoint(n,[te.x,te.y]),ue=s*Math.abs(n.a),de=[...U,{name:"path",type:"element",value:"",attributes:{d:`M ${M} ${B} L ${T} ${N}`,stroke:L,fill:"none","stroke-width":D.toString(),"stroke-linecap":"round",class:"pcb-note-dimension-line"},children:[]},{name:"path",type:"element",value:"",attributes:{d:`${e8t(v)} Z`,fill:L,class:"pcb-note-dimension-arrow"},children:[]},{name:"path",type:"element",value:"",attributes:{d:`${e8t(P)} Z`,fill:L,class:"pcb-note-dimension-arrow"},children:[]}];if(i)de.push({name:"text",type:"element",value:"",attributes:{x:ie.toString(),y:ce.toString(),fill:L,"font-size":ue.toString(),"font-family":"Arial, sans-serif","text-anchor":"middle","dominant-baseline":"central",class:"pcb-note-dimension-text",transform:`rotate(${ne} ${ie} ${ce})`},children:[{type:"text",name:"",value:i,attributes:{},children:[]}]});return[{name:"g",type:"element",value:"",attributes:{class:"pcb-note-dimension","data-type":"pcb_note_dimension","data-pcb-note-dimension-id":e.pcb_note_dimension_id,"data-pcb-layer":"overlay"},children:de}];function me(ge){let[xe,Ee]=MM.applyToPoint(n,[ge.x,ge.y]);return{x:xe,y:Ee}}}function hwo(e,t){let{transform:n}=t,{anchor_position:o,text:r,font_size:i=1,anchor_alignment:s="center",color:a}=e;if(!o||typeof o.x!=="number"||typeof o.y!=="number")return lm(`[pcb_note_text] Invalid anchor_position for "${e.pcb_note_text_id}": expected {x: number, y: number}, got ${JSON.stringify(o)}`),[];if(typeof r!=="string"||r.length===0)return lm(`[pcb_note_text] Invalid text for "${e.pcb_note_text_id}": expected non-empty string, got ${JSON.stringify(r)}`),[];let[c,l]=d7t.applyToPoint(n,[o.x,o.y]),h=i*Math.abs(n.a),{textAnchor:d,dominantBaseline:u}=h7t(s),_=r.split(`
`),p=_.length===1?[{type:"text",name:"",value:r,attributes:{},children:[]}]:_.map((A,g)=>({type:"element",name:"tspan",value:"",attributes:{x:c.toString(),...g>0?{dy:"1em"}:{}},children:[{type:"text",name:"",value:A,attributes:{},children:[]}]}));return[{name:"text",type:"element",value:"",attributes:{x:c.toString(),y:l.toString(),fill:a??lwo,"font-family":pz,"font-size":h.toString(),"text-anchor":d,"dominant-baseline":u,class:"pcb-note-text","data-type":"pcb_note_text","data-pcb-note-text-id":e.pcb_note_text_id,"data-pcb-layer":"overlay"},children:p}]}function pwo(e,t){let{transform:n}=t,{center:o,width:r,height:i,stroke_width:s,is_filled:a,has_stroke:c,is_stroke_dashed:l,color:h,corner_radius:d}=e;if(!o||typeof o.x!=="number"||typeof o.y!=="number"||typeof r!=="number"||typeof i!=="number")return lm(`[pcb_note_rect] Invalid data for "${e.pcb_note_rect_id}": expected center {x: number, y: number}, width: number, height: number, got center=${JSON.stringify(o)}, width=${JSON.stringify(r)}, height=${JSON.stringify(i)}`),[];let u=r/2,_=i/2,[p,m]=XFe.applyToPoint(n,[o.x-u,o.y+_]),[A,g]=XFe.applyToPoint(n,[o.x+u,o.y-_]),f=Math.min(p,A),y=Math.min(m,g),x=Math.abs(A-p),C=Math.abs(g-m),I=(typeof s==="number"?s:0)*Math.abs(n.a),v=typeof d==="number"&&d>0?d:0,P=v*Math.abs(n.a),M=v*Math.abs(n.d),B=h??dwo,T={x:f.toString(),y:y.toString(),width:x.toString(),height:C.toString(),class:"pcb-note-rect","data-type":"pcb_note_rect","data-pcb-note-rect-id":e.pcb_note_rect_id,"data-pcb-layer":"overlay"};if(P>0)T.rx=P.toString();if(M>0)T.ry=M.toString();if(a)T.fill=h??uwo;else T.fill="none";if(c??I>0){if(T.stroke=B,T["stroke-width"]=I.toString(),l){let L=0.2*Math.abs(n.a),H=0.1*Math.abs(n.a);T["stroke-dasharray"]=`${L} ${H}`}}else T.stroke="none";return[{name:"rect",type:"element",value:"",attributes:T,children:[]}]}function _wo(e,t){let{transform:n}=t;if(!Array.isArray(e.route)||e.route.length===0)return lm(`[pcb_note_path] Invalid route for "${e.pcb_note_path_id}": expected non-empty array of points, got ${JSON.stringify(e.route)}`),[];for(let s of e.route)if(typeof s.x!=="number"||typeof s.y!=="number")return lm(`[pcb_note_path] Invalid point in route for "${e.pcb_note_path_id}": expected {x: number, y: number}, got ${JSON.stringify(s)}`),[];let o=e.route.map((s,a)=>{let[c,l]=u7t.applyToPoint(n,[s.x,s.y]);return a===0?`M ${c} ${l}`:`L ${c} ${l}`}).join(" "),r=e.stroke_width*Math.abs(n.a);return[{name:"path",type:"element",value:"",attributes:{d:o,stroke:e.color??mwo,fill:"none","stroke-width":r.toString(),class:"pcb-note-path","data-type":"pcb_note_path","data-pcb-note-path-id":e.pcb_note_path_id,"data-pcb-layer":"overlay"},children:[]}]}function Awo(e,t){let{transform:n}=t,{x1:o,y1:r,x2:i,y2:s,stroke_width:a,color:c,is_dashed:l}=e;if(typeof o!=="number"||typeof r!=="number"||typeof i!=="number"||typeof s!=="number")return lm(`[pcb_note_line] Invalid coordinates for "${e.pcb_note_line_id}": expected x1, y1, x2, y2 as numbers, got x1=${JSON.stringify(o)}, y1=${JSON.stringify(r)}, x2=${JSON.stringify(i)}, y2=${JSON.stringify(s)}`),[];let[h,d]=jFe.applyToPoint(n,[o,r]),[u,_]=jFe.applyToPoint(n,[i,s]),m=(typeof a==="number"?a:0)*Math.abs(n.a),A={x1:h.toString(),y1:d.toString(),x2:u.toString(),y2:_.toString(),stroke:c??gwo,"stroke-width":m.toString(),"stroke-linecap":"round",class:"pcb-note-line","data-type":"pcb_note_line","data-pcb-note-line-id":e.pcb_note_line_id,"data-pcb-layer":"overlay"};if(l){let f=0.2*Math.abs(n.a),y=0.1*Math.abs(n.a);A["stroke-dasharray"]=`${f} ${y}`}return[{name:"line",type:"element",value:"",attributes:A,children:[]}]}function ywo(e,t){let n=t.boardOwnerMap?.get(e.pcb_board_id);if(!n)return[];let[o,r]=NI.applyToPoint(t.transform,[n.center.x+e.start.x,n.center.y+e.start.y]),[i,s]=NI.applyToPoint(t.transform,[n.center.x+e.end.x,n.center.y+e.end.y]),a=Math.abs(t.transform.a),c=Math.hypot(i-o,s-r),l=Math.min(0.5*a,c*0.8/fwo),h=Math.atan2(s-r,i-o);if(h>=Math.PI/2)h-=Math.PI;if(h<-Math.PI/2)h+=Math.PI;let d=NI.compose(NI.translate((o+i)/2,(r+s)/2),NI.rotate(h));return[{name:"line",type:"element",value:"",attributes:{x1:o.toString(),y1:r.toString(),x2:i.toString(),y2:s.toString(),stroke:"#ffd54f","stroke-width":(0.15*a).toString(),"stroke-dasharray":`${0.75*a} ${0.4*a}`,"stroke-linecap":"butt",class:"pcb-bend-line","data-type":"pcb_bend","data-pcb-bend-id":e.pcb_bend_id,"data-pcb-board-id":e.pcb_board_id,"data-pcb-layer":"overlay"},children:[{name:"title",type:"element",value:"",attributes:{},children:[{name:"",type:"text",value:`${e.name??e.pcb_bend_id}: ${e.bend_angle}°, radius ${e.bend_radius} mm`,attributes:{},children:[]}]}]},...c>0?[{name:"text",type:"element",value:"",attributes:{x:"0",y:(-(l*0.6+0.2*a)).toString(),fill:"#ffd54f","font-family":pz,"font-size":l.toString(),"text-anchor":"middle","dominant-baseline":"central",transform:NI.toString(d),class:"pcb-bend-line-label","data-type":"pcb_bend","data-pcb-bend-id":e.pcb_bend_id,"data-pcb-board-id":e.pcb_board_id,"data-pcb-layer":"overlay"},children:[{name:"",type:"text",value:p7t,attributes:{},children:[]}]}]:[]]}function xwo(e,t){let{transform:n,colorMap:o,showSolderMask:r}=t,[i,s]=cz.applyToPoint(n,[e.x,e.y]),a=e7t(e,t.circuitJson),c=Array.isArray(e.layers)&&e.layers[0]||e.layer||"top",l=c,h=Boolean(e.is_covered_with_solder_mask),d=(e.soldermask_margin??0)*Math.abs(n.a),u=r&&h&&d!==0,_=o.soldermaskWithCopperUnderneath.top;if(e.shape==="pill"){let p=e.outer_width*Math.abs(n.a),m=e.outer_height*Math.abs(n.a),A=e.hole_width*Math.abs(n.a),g=e.hole_height*Math.abs(n.a),f=e.ccw_rotation||0,y=f?`translate(${i} ${s}) rotate(${-f})`:`translate(${i} ${s})`,x=f?`translate(${i} ${s}) rotate(${-f})`:`translate(${i} ${s})`,C=(I,v)=>{if(I>v){let P=v/2,M=I-2*P;return`M${-I/2+P},${-P} h${M} a${P},${P} 0 0 1 0,${v} h${-M} a${P},${P} 0 0 1 0,${-v} z`}else if(v>I){let P=I/2,M=v-2*P;return`M${P},${-v/2+P} v${M} a${P},${P} 0 0 1 ${-I},0 v${-M} a${P},${P} 0 0 1 ${I},0 z`}else{let P=I/2;return`M${-P},0 a${P},${P} 0 0 1 ${I},0 a${P},${P} 0 0 1 ${-I},0 z`}},b=[{name:"path",type:"element",attributes:{class:"pcb-hole-outer",fill:o.copper.top,d:C(p,m),transform:y,"data-type":"pcb_plated_hole","data-pcb-layer":c},value:"",children:[]},{name:"path",type:"element",attributes:{class:"pcb-hole-inner",fill:o.drill,d:C(A,g),transform:x,"data-type":"pcb_plated_hole_drill","data-pcb-layer":"drill"},value:"",children:[]}];if(u){let I=p+2*d,v=m+2*d;if(d<0)b=[{name:"path",type:"element",attributes:{class:"pcb-hole-outer-covered",fill:_,d:C(p,m),transform:y,"data-type":"pcb_plated_hole","data-pcb-layer":c},value:"",children:[]},{name:"path",type:"element",attributes:{class:"pcb-hole-outer-exposed",fill:o.copper.top,d:C(I,v),transform:y,"data-type":"pcb_soldermask","data-pcb-layer":l},value:"",children:[]},b[1]];else b.unshift({name:"path",type:"element",attributes:{class:"pcb-soldermask-cutout",fill:o.substrate,d:C(I,v),transform:y,"data-type":"pcb_soldermask_opening","data-pcb-layer":l},value:"",children:[]})}return[{name:"g",type:"element",attributes:{"data-type":"pcb_plated_hole","data-pcb-layer":"through",...a},children:b,value:""}]}if(e.shape==="oval"){let p=e.outer_width*Math.abs(n.a),m=e.outer_height*Math.abs(n.a),A=e.hole_width*Math.abs(n.a),g=e.hole_height*Math.abs(n.a),f=e.ccw_rotation||0,y=f?`translate(${i} ${s}) rotate(${-f})`:`translate(${i} ${s})`,x=[{name:"ellipse",type:"element",attributes:{class:"pcb-hole-outer",fill:o.copper.top,cx:"0",cy:"0",rx:(p/2).toString(),ry:(m/2).toString(),transform:y,"data-type":"pcb_plated_hole","data-pcb-layer":c},value:"",children:[]},{name:"ellipse",type:"element",attributes:{class:"pcb-hole-inner",fill:o.drill,cx:"0",cy:"0",rx:(A/2).toString(),ry:(g/2).toString(),transform:y,"data-type":"pcb_plated_hole_drill","data-pcb-layer":"drill"},value:"",children:[]}];return[{name:"g",type:"element",attributes:{"data-type":"pcb_plated_hole","data-pcb-layer":"through",...a},children:x,value:""}]}if(e.shape==="circle"){let p=e.outer_diameter*Math.abs(n.a),m=e.outer_diameter*Math.abs(n.a),A=e.hole_diameter*Math.abs(n.a),g=e.hole_diameter*Math.abs(n.a),f=Math.min(p,m)/2,y=Math.min(A,g)/2,x=[{name:"circle",type:"element",attributes:{class:"pcb-hole-outer",fill:o.copper.top,cx:i.toString(),cy:s.toString(),r:f.toString(),"data-type":"pcb_plated_hole","data-pcb-layer":c},value:"",children:[]},{name:"circle",type:"element",attributes:{class:"pcb-hole-inner",fill:o.drill,cx:i.toString(),cy:s.toString(),r:y.toString(),"data-type":"pcb_plated_hole_drill","data-pcb-layer":"drill"},value:"",children:[]}];if(u){let C=f+d;if(d<0)x=[{name:"circle",type:"element",attributes:{class:"pcb-hole-outer-covered",fill:_,cx:i.toString(),cy:s.toString(),r:f.toString(),"data-type":"pcb_plated_hole","data-pcb-layer":c},value:"",children:[]},{name:"circle",type:"element",attributes:{class:"pcb-hole-outer-exposed",fill:o.copper.top,cx:i.toString(),cy:s.toString(),r:C.toString(),"data-type":"pcb_soldermask","data-pcb-layer":l},value:"",children:[]},x[1]];else x.unshift({name:"circle",type:"element",attributes:{class:"pcb-soldermask-cutout",fill:o.substrate,cx:i.toString(),cy:s.toString(),r:C.toString(),"data-type":"pcb_soldermask_opening","data-pcb-layer":l},value:"",children:[]})}return[{name:"g",type:"element",attributes:{"data-type":"pcb_plated_hole","data-pcb-layer":"through",...a},children:x,value:""}]}if(e.shape==="circular_hole_with_rect_pad"){let p=e,m=e.hole_diameter*Math.abs(n.a),A=e.rect_pad_width*Math.abs(n.a),g=e.rect_pad_height*Math.abs(n.a),f=(e.rect_border_radius??0)*Math.abs(n.a),y=e.rect_ccw_rotation??0,x=p.rect_ccw_rotation??0,C=x?`translate(${i} ${s}) rotate(${-x})`:void 0,b=x?(-A/2).toString():(i-A/2).toString(),I=x?(-g/2).toString():(s-g/2).toString(),v=m/2,[P,M]=cz.applyToPoint(n,[p.x+(p.hole_offset_x??0),p.y+(p.hole_offset_y??0)]),B=[{name:"rect",type:"element",attributes:{class:"pcb-hole-outer-pad",fill:o.copper.top,...y?{x:(-A/2).toString(),y:(-g/2).toString(),transform:`translate(${i} ${s}) rotate(${-y})`}:{x:(i-A/2).toString(),y:(s-g/2).toString()},width:A.toString(),height:g.toString(),...C?{transform:C}:{},...f?{rx:f.toString(),ry:f.toString()}:{},"data-type":"pcb_plated_hole","data-pcb-layer":c},value:"",children:[]},{name:"circle",type:"element",attributes:{class:"pcb-hole-inner",fill:o.drill,cx:P.toString(),cy:M.toString(),r:v.toString(),"data-type":"pcb_plated_hole_drill","data-pcb-layer":"drill"},value:"",children:[]}];if(u){let T=A+2*d,N=g+2*d,D=f+d;if(d<0)B=[{name:"rect",type:"element",attributes:{class:"pcb-hole-outer-covered",fill:_,...y?{x:(-A/2).toString(),y:(-g/2).toString(),transform:`translate(${i} ${s}) rotate(${-y})`}:{x:(i-A/2).toString(),y:(s-g/2).toString()},width:A.toString(),height:g.toString(),...C?{transform:C}:{},...f?{rx:f.toString(),ry:f.toString()}:{},"data-type":"pcb_plated_hole","data-pcb-layer":c},value:"",children:[]},{name:"rect",type:"element",attributes:{class:"pcb-hole-outer-exposed",fill:o.copper.top,...y?{x:(-T/2).toString(),y:(-N/2).toString(),transform:`translate(${i} ${s}) rotate(${-y})`}:{x:(i-T/2).toString(),y:(s-N/2).toString()},width:T.toString(),height:N.toString(),...C?{transform:C}:{},...D>0?{rx:D.toString(),ry:D.toString()}:{},"data-type":"pcb_soldermask","data-pcb-layer":l},value:"",children:[]},B[1]];else B.unshift({name:"rect",type:"element",attributes:{class:"pcb-soldermask-cutout",fill:o.substrate,...y?{x:(-T/2).toString(),y:(-N/2).toString(),transform:`translate(${i} ${s}) rotate(${-y})`}:{x:(i-T/2).toString(),y:(s-N/2).toString()},width:T.toString(),height:N.toString(),...C?{transform:C}:{},...f?{rx:D.toString(),ry:D.toString()}:{},"data-type":"pcb_soldermask_opening","data-pcb-layer":l},value:"",children:[]})}return[{name:"g",type:"element",attributes:{"data-type":"pcb_plated_hole","data-pcb-layer":"through",...a},children:B,value:""}]}if(e.shape==="pill_hole_with_rect_pad"){let p=e,m=p.rect_pad_width*Math.abs(n.a),A=p.rect_pad_height*Math.abs(n.a),g=(p.rect_border_radius??0)*Math.abs(n.a),f=p.hole_height*Math.abs(n.a),y=p.hole_width*Math.abs(n.a),x=p,C=x.hole_offset_x??0,b=x.hole_offset_y??0,[I,v]=cz.applyToPoint(n,[p.x+C,p.y+b]),P=Math.min(f,y)/2,M=[{name:"rect",type:"element",attributes:{class:"pcb-hole-outer-pad",fill:o.copper.top,x:(i-m/2).toString(),y:(s-A/2).toString(),width:m.toString(),height:A.toString(),...g?{rx:g.toString(),ry:g.toString()}:{},"data-type":"pcb_plated_hole","data-pcb-layer":c},value:"",children:[]},{name:"rect",type:"element",attributes:{class:"pcb-hole-inner",fill:o.drill,x:(I-y/2).toString(),y:(v-f/2).toString(),width:y.toString(),height:f.toString(),rx:P.toString(),ry:P.toString(),"data-type":"pcb_plated_hole_drill","data-pcb-layer":"drill"},value:"",children:[]}];if(u){let B=m+2*d,T=A+2*d,N=g+d;if(d<0)M=[{name:"rect",type:"element",attributes:{class:"pcb-hole-outer-covered",fill:_,x:(i-m/2).toString(),y:(s-A/2).toString(),width:m.toString(),height:A.toString(),...g?{rx:g.toString(),ry:g.toString()}:{},"data-type":"pcb_plated_hole","data-pcb-layer":c},value:"",children:[]},{name:"rect",type:"element",attributes:{class:"pcb-hole-outer-exposed",fill:o.copper.top,x:(i-B/2).toString(),y:(s-T/2).toString(),width:B.toString(),height:T.toString(),...N>0?{rx:N.toString(),ry:N.toString()}:{},"data-type":"pcb_soldermask","data-pcb-layer":l},value:"",children:[]},M[1]];else M.unshift({name:"rect",type:"element",attributes:{class:"pcb-soldermask-cutout",fill:o.substrate,x:(i-B/2).toString(),y:(s-T/2).toString(),width:B.toString(),height:T.toString(),...g?{rx:N.toString(),ry:N.toString()}:{},"data-type":"pcb_soldermask_opening","data-pcb-layer":l},value:"",children:[]})}return[{name:"g",type:"element",attributes:{"data-type":"pcb_plated_hole","data-pcb-layer":"through",...a},children:M,value:""}]}if(e.shape==="rotated_pill_hole_with_rect_pad"){let p=e,m=p.rect_pad_width*Math.abs(n.a),A=p.rect_pad_height*Math.abs(n.a),g=(p.rect_border_radius??0)*Math.abs(n.a),f=p.hole_height*Math.abs(n.a),y=p.hole_width*Math.abs(n.a),x=p,C=x.hole_offset_x??0,b=x.hole_offset_y??0,[I,v]=cz.applyToPoint(n,[p.x+C,p.y+b]),P=Math.min(f,y)/2,M=[{name:"rect",type:"element",attributes:{class:"pcb-hole-outer-pad",fill:o.copper.top,x:(-m/2).toString(),y:(-A/2).toString(),width:m.toString(),height:A.toString(),transform:`translate(${i} ${s}) rotate(${-p.rect_ccw_rotation})`,...g?{rx:g.toString(),ry:g.toString()}:{},"data-type":"pcb_plated_hole","data-pcb-layer":c},value:"",children:[]},{name:"rect",type:"element",attributes:{class:"pcb-hole-inner",fill:o.drill,x:(-y/2).toString(),y:(-f/2).toString(),width:y.toString(),height:f.toString(),rx:P.toString(),ry:P.toString(),transform:`translate(${I} ${v}) rotate(${-p.hole_ccw_rotation})`,"data-type":"pcb_plated_hole_drill","data-pcb-layer":"drill"},value:"",children:[]}];if(u){let B=m+2*d,T=A+2*d,N=g+d;if(d<0)M=[{name:"rect",type:"element",attributes:{class:"pcb-hole-outer-covered",fill:_,x:(-m/2).toString(),y:(-A/2).toString(),width:m.toString(),height:A.toString(),transform:`translate(${i} ${s}) rotate(${-p.rect_ccw_rotation})`,...g?{rx:g.toString(),ry:g.toString()}:{},"data-type":"pcb_plated_hole","data-pcb-layer":c},value:"",children:[]},{name:"rect",type:"element",attributes:{class:"pcb-hole-outer-exposed",fill:o.copper.top,x:(-B/2).toString(),y:(-T/2).toString(),width:B.toString(),height:T.toString(),transform:`translate(${i} ${s}) rotate(${-p.rect_ccw_rotation})`,...N>0?{rx:N.toString(),ry:N.toString()}:{},"data-type":"pcb_soldermask","data-pcb-layer":l},value:"",children:[]},M[1]];else M.push({name:"rect",type:"element",attributes:{class:"pcb-solder-mask",fill:_,x:(-B/2).toString(),y:(-T/2).toString(),width:B.toString(),height:T.toString(),transform:`translate(${i} ${s}) rotate(${-p.rect_ccw_rotation})`,...g?{rx:N.toString(),ry:N.toString()}:{},"data-type":"pcb_soldermask","data-pcb-layer":l},value:"",children:[]})}return[{name:"g",type:"element",attributes:{"data-type":"pcb_plated_hole","data-pcb-layer":"through",...a},children:M,value:""}]}if(e.shape==="hole_with_polygon_pad"){let p=e,m=p.pad_outline||[],A=p.x??0,g=p.y??0,y=m.map((I)=>cz.applyToPoint(n,[A+I.x,g+I.y])).map((I)=>I.join(",")).join(" "),[x,C]=cz.applyToPoint(n,[A+p.hole_offset_x,g+p.hole_offset_y]),b=()=>{if(p.hole_shape==="circle"){let v=(p.hole_diameter??0)*Math.abs(n.a)/2;return{name:"circle",type:"element",attributes:{class:"pcb-hole-inner",fill:o.drill,cx:x.toString(),cy:C.toString(),r:v.toString(),"data-type":"pcb_plated_hole_drill","data-pcb-layer":"drill"},value:"",children:[]}}if(p.hole_shape==="oval"){let I=(p.hole_width??0)*Math.abs(n.a),v=(p.hole_height??0)*Math.abs(n.a),P=I/2,M=v/2;return{name:"ellipse",type:"element",attributes:{class:"pcb-hole-inner",fill:o.drill,cx:x.toString(),cy:C.toString(),rx:P.toString(),ry:M.toString(),"data-type":"pcb_plated_hole_drill","data-pcb-layer":"drill"},value:"",children:[]}}if(p.hole_shape==="pill"||p.hole_shape==="rotated_pill"){let I=(p.hole_width??0)*Math.abs(n.a),v=(p.hole_height??0)*Math.abs(n.a),P=I>v,M=Math.min(I,v)/2,B=Math.abs(P?I-v:v-I),T=P?`M${-B/2},${-M} h${B} a${M},${M} 0 0 1 0,${v} h-${B} a${M},${M} 0 0 1 0,-${v} z`:`M${-M},${-B/2} v${B} a${M},${M} 0 0 0 ${I},0 v-${B} a${M},${M} 0 0 0 -${I},0 z`;return{name:"path",type:"element",attributes:{class:"pcb-hole-inner",fill:o.drill,d:T,transform:`translate(${x} ${C})`,"data-type":"pcb_plated_hole_drill","data-pcb-layer":"drill"},value:"",children:[]}}return{name:"g",type:"element",attributes:{},value:"",children:[]}};return[{name:"g",type:"element",attributes:{"data-type":"pcb_plated_hole","data-pcb-layer":"through",...a},children:[{name:"polygon",type:"element",attributes:{class:"pcb-hole-outer-pad",fill:o.copper.top,points:y,"data-type":"pcb_plated_hole","data-pcb-layer":c},value:"",children:[]},b()],value:""}]}return[]}function Cwo(e,t){let{transform:n,layer:o,colorMap:r}=t;if(!e.route||!Array.isArray(e.route))return[];let i=e.route.map((h,d)=>{let[u,_]=m7t.applyToPoint(n,[h.x,h.y]);return d===0?`M ${u} ${_}`:`L ${u} ${_}`}).join(" "),s=e.route[0],a=e.route[e.route.length-1];if(s&&a&&s.x===a.x&&s.y===a.y)i+=" Z";let c=e.layer||"top";if(o&&c!==o)return[];let l=c==="bottom"?r.silkscreen.bottom:r.silkscreen.top;return[{name:"path",type:"element",attributes:{class:`pcb-silkscreen pcb-silkscreen-${c}`,d:i,fill:"none",stroke:l,"stroke-width":(e.stroke_width*Math.abs(n.a)).toString(),"stroke-linecap":"round","stroke-linejoin":"round","data-pcb-component-id":e.pcb_component_id,"data-pcb-silkscreen-path-id":e.pcb_silkscreen_path_id,"data-type":"pcb_silkscreen_path","data-pcb-layer":c},value:"",children:[]}]}function bwo(e,t){let{transform:n,layer:o,colorMap:r}=t,{layer:i="top"}=e;if(o&&i!==o)return[];if(e.shape!=="brep")return[];let s=i==="bottom"?r.silkscreen.bottom:r.silkscreen.top,a=Aj(e.brep_shape.outer_ring.vertices,n);for(let c of e.brep_shape.inner_rings??[])a+=` ${Aj(c.vertices,n)}`;return[{name:"path",type:"element",attributes:{class:`pcb-silkscreen pcb-silkscreen-${i}`,d:a,fill:s,"fill-rule":"evenodd",stroke:"none","data-pcb-component-id":e.pcb_component_id,"data-pcb-silkscreen-graphic-id":e.pcb_silkscreen_graphic_id,"data-type":"pcb_silkscreen_graphic","data-pcb-layer":i},value:"",children:[]}]}function t8t(e){let{text:t,anchorAlignment:n,fontSize:o,charAdvance:r,spaceAdvance:i,trailingSpacing:s,lineHeight:a,mapSegment:c}=e,l=t.split(`
`),h=l.length*a,d=l.map((f)=>Iwo(f,r,i,s)),u=[],_=-h/2;for(let f=0;f<l.length;f++){let y=l[f]??"",C=-(d[f]??0)/2;for(let b of y){if(b===" "){C+=i;continue}let I=Ax[b];if(I)for(let v of I)u.push(c(v,C,_,o));C+=r}_+=a}let p=vwo(u);if(!p)return{pathData:"",bounds:null};let m=mze(n,p),A=Ewo(u,m),g=Mwo(p,m);return{pathData:wwo(A),bounds:g}}function Iwo(e,t,n,o){let r=0;for(let i of e)r+=i===" "?n:t;return r>0?r-o:0}function vwo(e){if(e.length===0)return null;let{POSITIVE_INFINITY:t,POSITIVE_INFINITY:n,NEGATIVE_INFINITY:o,NEGATIVE_INFINITY:r}=Number;for(let i of e)t=Math.min(t,i.x1,i.x2),n=Math.min(n,i.y1,i.y2),o=Math.max(o,i.x1,i.x2),r=Math.max(r,i.y1,i.y2);return{minX:t,minY:n,maxX:o,maxY:r}}function mze(e,t){return{x:-Swo(e,t),y:-Pwo(e,t)}}function Swo(e,t){if(e==="top_left"||e==="center_left"||e==="bottom_left")return t.minX;if(e==="top_right"||e==="center_right"||e==="bottom_right")return t.maxX;return(t.minX+t.maxX)/2}function Pwo(e,t){if(e==="top_left"||e==="top_center"||e==="top_right")return t.minY;if(e==="bottom_left"||e==="bottom_center"||e==="bottom_right")return t.maxY;return(t.minY+t.maxY)/2}function Ewo(e,t){if(t.x===0&&t.y===0)return e;return e.map((n)=>({x1:n.x1+t.x,y1:n.y1+t.y,x2:n.x2+t.x,y2:n.y2+t.y}))}function Mwo(e,t){return{minX:e.minX+t.x,minY:e.minY+t.y,maxX:e.maxX+t.x,maxY:e.maxY+t.y}}function wwo(e){return e.map((t)=>`M${t.x1} ${t.y1}L${t.x2} ${t.y2}`).join(" ")}function Bwo(e,t){let n=null,r=e.split(`
`).map((i,s)=>{let a=Array.from(i),c=-(a.length*o8t*t)/2,l=s*t*1.1;return a.forEach((h,d)=>{let u=_7t[h];if(!u)return;let _=c+d*o8t*t,p={minX:_+u.minX*t,maxX:_+u.maxX*t,minY:l+u.minY*t,maxY:l+u.maxY*t};n=n?{minX:Math.min(n.minX,p.minX),maxX:Math.max(n.maxX,p.maxX),minY:Math.min(n.minY,p.minY),maxY:Math.max(n.maxY,p.maxY)}:p}),{name:"tspan",type:"element",value:"",attributes:{x:c.toString(),y:l.toString()},children:[{name:"",type:"text",value:i,attributes:{},children:[]}]}});return{bounds:n,textNode:{name:"text",type:"element",value:"",attributes:{"font-family":pz,"font-size":t.toString(),"text-anchor":"start","dominant-baseline":"alphabetic","xml:space":"preserve",fill:"black",stroke:"none"},children:r}}}function Dwo(e,t){let{transform:n,layer:o,colorMap:r}=t,{anchor_position:i,text:s,font_size:a=1,layer:c="top",ccw_rotation:l=0,anchor_alignment:h="center",is_knockout:d=!1,knockout_padding:u,is_mirrored:_=!1}=e;if(o&&c!==o)return[];if(!i||typeof i.x!=="number"||typeof i.y!=="number")return lm(`[pcb_silkscreen_text] Invalid anchor_position for "${e.pcb_silkscreen_text_id}": expected {x: number, y: number}, got ${JSON.stringify(i)}`),[];if(!s)return[];let[p,m]=iA.applyToPoint(n,[i.x,i.y]),A=Math.abs(n.a),g=c==="bottom"?r.silkscreen.bottom:r.silkscreen.top,y=c==="bottom"?!0:_===!0;if(d){let M=Bwo(s,a);if(!M.bounds)return[];let B=u?.left??a*0.5,T=u?.right??a*0.5,N=u?.top??a*0.3,D=u?.bottom??a*0.3,L=M.bounds.minX-B,H=M.bounds.minY-N,V=M.bounds.maxX-M.bounds.minX+B+T,O=M.bounds.maxY-M.bounds.minY+N+D,U={minX:L,minY:H,maxX:L+V,maxY:H+O},j=mze(h,U),Y=L+j.x,X=H+j.y,K=[{name:"rect",type:"element",value:"",attributes:{x:L.toString(),y:H.toString(),width:V.toString(),height:O.toString(),fill:"white"},children:[]},M.textNode],ee=j.x!==0||j.y!==0?[{name:"g",type:"element",value:"",attributes:{transform:`translate(${j.x} ${j.y})`},children:K}]:K,se=iA.toString(iA.compose(iA.translate(p,m),iA.rotate(-l*Math.PI/180),...y?[iA.scale(-1,1)]:[],iA.scale(A,A))),ne=`silkscreen-knockout-mask-${e.pcb_silkscreen_text_id}-${Two++}`;return[{name:"defs",type:"element",value:"",children:[{name:"mask",type:"element",value:"",attributes:{id:ne},children:ee}],attributes:{}},{name:"rect",type:"element",value:"",children:[],attributes:{x:Y.toString(),y:X.toString(),width:V.toString(),height:O.toString(),fill:g,mask:`url(#${ne})`,transform:se,class:`pcb-silkscreen-text-knockout pcb-silkscreen-${c}`,"data-type":"pcb_silkscreen_text","data-pcb-silkscreen-text-id":e.pcb_silkscreen_text_id,"data-pcb-layer":c}}]}let x=a*A,C="middle",b="central";switch(h){case"top_left":C="start",b="text-before-edge";break;case"top_center":C="middle",b="text-before-edge";break;case"top_right":C="end",b="text-before-edge";break;case"center_left":C="start",b="central";break;case"center_right":C="end",b="central";break;case"bottom_left":C="start",b="text-after-edge";break;case"bottom_center":C="middle",b="text-after-edge";break;case"bottom_right":C="end",b="text-after-edge";break;case"center":default:C="middle",b="central";break}let I=iA.compose(iA.translate(p,m),iA.rotate(-l*Math.PI/180),...y?[iA.scale(-1,1)]:[]),v=s.split(`
`),P=v.length===1?[{type:"text",value:s,name:"",attributes:{},children:[]}]:v.map((M,B)=>({type:"element",name:"tspan",value:"",attributes:{x:"0",...B>0?{dy:x.toString()}:{}},children:[{type:"text",value:M,name:"",attributes:{},children:[]}]}));return[{name:"text",type:"element",attributes:{x:"0",y:"0",dx:"0",dy:"0",fill:g,"font-family":pz,"font-size":x.toString(),"text-anchor":C,"dominant-baseline":b,transform:iA.toString(I),class:`pcb-silkscreen-text pcb-silkscreen-${c}`,"data-pcb-silkscreen-text-id":e.pcb_silkscreen_text_id,stroke:"none","data-type":"pcb_silkscreen_text","data-pcb-layer":c},children:P,value:""}]}function Nwo(e,t){let{transform:n,layer:o,colorMap:r}=t,{center:i,width:s,height:a,layer:c="top",pcb_silkscreen_rect_id:l,stroke_width:h,is_filled:d,has_stroke:u,is_stroke_dashed:_,corner_radius:p,ccw_rotation:m=0}=e;if(o&&c!==o)return[];if(!i||typeof i.x!=="number"||typeof i.y!=="number"||typeof s!=="number"||typeof a!=="number")return lm(`[pcb_silkscreen_rect] Invalid data for "${l}": expected center {x: number, y: number}, width: number, height: number, got center=${JSON.stringify(i)}, width=${JSON.stringify(s)}, height=${JSON.stringify(a)}`),[];let[A,g]=g7t.applyToPoint(n,[i.x,i.y]),f=typeof p==="number"&&p>0?p:0,y=f*Math.abs(n.a),x=f*Math.abs(n.d),C=s*Math.abs(n.a),b=a*Math.abs(n.d),I=h*Math.abs(n.a),v=c==="bottom"?r.silkscreen.bottom:r.silkscreen.top,P={x:(-C/2).toString(),y:(-b/2).toString(),width:C.toString(),height:b.toString(),class:`pcb-silkscreen-rect pcb-silkscreen-${c}`,"data-pcb-silkscreen-rect-id":l,"data-type":"pcb_silkscreen_rect","data-pcb-layer":c};if(typeof m==="number"&&m!==0)P.transform=`translate(${A} ${g}) rotate(${-m})`;else P.x=(A-C/2).toString(),P.y=(g-b/2).toString();if(y>0)P.rx=y.toString();if(x>0)P.ry=x.toString();P.fill=d?v:"none";let M;if(u===void 0)M=I>0;else M=u;if(M){if(P.stroke=v,P["stroke-width"]=I.toString(),_){let T=0.1*Math.abs(n.a),N=0.05*Math.abs(n.a);P["stroke-dasharray"]=`${T} ${N}`}}else P.stroke="none";return[{name:"rect",type:"element",attributes:P,value:"",children:[]}]}function Qwo(e,t){let{transform:n,layer:o,colorMap:r}=t,{anchor_position:i,text:s,font_size:a="0.2mm",layer:c,ccw_rotation:l=0,anchor_alignment:h="center",is_knockout:d=!1,knockout_padding:u,is_mirrored:_=!1}=e,p=c??"top";if(o&&o!==p)return[];if(!i)return[];if(!s)return[];let[m,A]=tg.applyToPoint(n,[i.x,i.y]),g=Ke.parse(a)??0.2,f=Math.abs(n.a),y=Y1(p,r),C=p==="bottom"?!0:_===!0;if(d){let M=g*i8t,B=t8t({text:s,anchorAlignment:h,fontSize:M,charAdvance:(T1e+nj)*M,spaceAdvance:(T1e+nj)*M*0.6,trailingSpacing:nj*M,lineHeight:M*r8t,mapSegment:(te,ie,ce,ue)=>({x1:ie+te.x1*ue,y1:ce+(1-te.y1)*ue,x2:ie+te.x2*ue,y2:ce+(1-te.y2)*ue})});if(!B.bounds||!B.pathData)return[];let T=u?.left??M*0.5,N=u?.right??M*0.5,D=u?.top??M*0.3,L=u?.bottom??M*0.3,H=B.bounds.minX-T,V=B.bounds.minY-D,O=B.bounds.maxX-B.bounds.minX+T+N,U=B.bounds.maxY-B.bounds.minY+D+L,j=M*0.15,Y={minX:H,minY:V,maxX:H+O,maxY:V+U},X=mze(h,Y),K=H+X.x,J=V+X.y,ee=[{name:"rect",type:"element",value:"",attributes:{x:H.toString(),y:V.toString(),width:O.toString(),height:U.toString(),fill:"white"},children:[]},{name:"path",type:"element",value:"",attributes:{d:B.pathData,fill:"none",stroke:"black","stroke-width":j.toString(),"stroke-linecap":"round","stroke-linejoin":"round"},children:[]}],ne=X.x!==0||X.y!==0?[{name:"g",type:"element",value:"",attributes:{transform:`translate(${X.x} ${X.y})`},children:ee}]:ee,re=tg.toString(tg.compose(tg.translate(m,A),tg.rotate(-l*Math.PI/180),...C?[tg.scale(-1,1)]:[],tg.scale(f,f))),Z=`knockout-mask-${e.pcb_copper_text_id}-${Rwo++}`;return[{name:"defs",type:"element",value:"",children:[{name:"mask",type:"element",value:"",attributes:{id:Z},children:ne}],attributes:{}},{name:"rect",type:"element",value:"",children:[],attributes:{x:K.toString(),y:J.toString(),width:O.toString(),height:U.toString(),fill:y,mask:`url(#${Z})`,transform:re,class:`pcb-copper-text-knockout pcb-copper-${p}`,"data-type":"pcb_copper_text","data-pcb-copper-text-id":e.pcb_copper_text_id}}]}let b=g*i8t,I=t8t({text:s,anchorAlignment:h,fontSize:b,charAdvance:(T1e+nj)*b,spaceAdvance:(T1e+nj)*b*0.6,trailingSpacing:nj*b,lineHeight:b*r8t,mapSegment:(M,B,T,N)=>({x1:B+M.x1*N,y1:T+(1-M.y1)*N,x2:B+M.x2*N,y2:T+(1-M.y2)*N})});if(!I.pathData)return[];let v=tg.toString(tg.compose(tg.translate(m,A),tg.rotate(-l*Math.PI/180),...C?[tg.scale(-1,1)]:[],tg.scale(f,f))),P=b*0.15;return[{name:"path",type:"element",attributes:{d:I.pathData,fill:"none",stroke:y,"stroke-width":P.toString(),"stroke-linecap":"round","stroke-linejoin":"round",transform:v,class:`pcb-copper-text pcb-copper-${p}`,"data-type":"pcb_copper_text","data-pcb-copper-text-id":e.pcb_copper_text_id},children:[],value:""}]}function kwo(e,t){let{transform:n,layer:o,colorMap:r}=t,{center:i,radius:s,layer:a="top",pcb_silkscreen_circle_id:c,stroke_width:l=1,is_filled:h}=e;if(o&&a!==o)return[];if(!i||typeof i.x!=="number"||typeof i.y!=="number"||typeof s!=="number")return console.error("Invalid PCB Silkscreen Circle data:",{center:i,radius:s}),[];let[d,u]=A7t.applyToPoint(n,[i.x,i.y]),_=s*Math.abs(n.a),p=l*Math.abs(n.a),m=a==="bottom"?r.silkscreen.bottom:r.silkscreen.top;return[{name:"circle",type:"element",attributes:{cx:d.toString(),cy:u.toString(),r:_.toString(),class:`pcb-silkscreen-circle pcb-silkscreen-${a}`,fill:h?m:"none",stroke:m,"stroke-width":p.toString(),"data-pcb-silkscreen-circle-id":c,"data-type":"pcb_silkscreen_circle","data-pcb-layer":a},value:"",children:[]}]}function Lwo(e,t){let{transform:n,layer:o,colorMap:r}=t,{x1:i,y1:s,x2:a,y2:c,stroke_width:l,layer:h="top",pcb_silkscreen_line_id:d}=e;if(o&&h!==o)return[];if(typeof i!=="number"||typeof s!=="number"||typeof a!=="number"||typeof c!=="number")return lm(`[pcb_silkscreen_line] Invalid coordinates for "${d}": expected x1, y1, x2, y2 as numbers, got x1=${JSON.stringify(i)}, y1=${JSON.stringify(s)}, x2=${JSON.stringify(a)}, y2=${JSON.stringify(c)}`),[];let[u,_]=KFe.applyToPoint(n,[i,s]),[p,m]=KFe.applyToPoint(n,[a,c]),A=l*Math.abs(n.a),g=h==="bottom"?r.silkscreen.bottom:r.silkscreen.top;return[{name:"line",type:"element",attributes:{x1:u.toString(),y1:_.toString(),x2:p.toString(),y2:m.toString(),stroke:g,"stroke-width":A.toString(),class:`pcb-silkscreen-line pcb-silkscreen-${h}`,"data-pcb-silkscreen-line-id":d,"data-type":"pcb_silkscreen_line","data-pcb-layer":h},value:"",children:[]}]}function Hwo(e,t){let{transform:n,layer:o,colorMap:r}=t,{center:i,width:s,height:a,layer:c="top",pcb_silkscreen_pill_id:l,ccw_rotation:h=0}=e;if(o&&c!==o)return[];let[d,u]=f7t.applyToPoint(n,[i.x,i.y]),_=s*Math.abs(n.a),p=a*Math.abs(n.d),A=Math.min(s,a)/2,g=A*Math.abs(n.a),f=A*Math.abs(n.d),y=c==="bottom"?r.silkscreen.bottom:r.silkscreen.top;return[{name:"rect",type:"element",attributes:{x:(d-_/2).toString(),y:(u-p/2).toString(),width:_.toString(),height:p.toString(),rx:g.toString(),ry:f.toString(),fill:"none",stroke:y,"stroke-width":(0.1*Math.abs(n.a)).toString(),class:`pcb-silkscreen-pill pcb-silkscreen-${c}`,"data-pcb-silkscreen-pill-id":l,"data-type":"pcb_silkscreen_pill","data-pcb-layer":c,...h!==0&&{transform:`rotate(${-h} ${d} ${u})`}},value:"",children:[]}]}function Fwo(e,t){let{transform:n,layer:o,colorMap:r}=t,{center:i,radius_x:s,radius_y:a,layer:c="top",pcb_silkscreen_oval_id:l,ccw_rotation:h=0}=e;if(o&&c!==o)return[];if(!i||typeof i.x!=="number"||typeof i.y!=="number"||typeof s!=="number"||typeof a!=="number")return lm(`[pcb_silkscreen_oval] Invalid data for "${l}": expected center {x: number, y: number}, radius_x: number, radius_y: number, got center=${JSON.stringify(i)}, radius_x=${JSON.stringify(s)}, radius_y=${JSON.stringify(a)}`),[];let[d,u]=y7t.applyToPoint(n,[i.x,i.y]),_=s*Math.abs(n.a),p=a*Math.abs(n.d),m=c==="bottom"?r.silkscreen.bottom:r.silkscreen.top;return[{name:"ellipse",type:"element",attributes:{cx:d.toString(),cy:u.toString(),rx:_.toString(),ry:p.toString(),fill:"none",stroke:m,"stroke-width":(0.1*Math.abs(n.a)).toString(),class:`pcb-silkscreen-oval pcb-silkscreen-${c}`,"data-pcb-silkscreen-oval-id":l,"data-type":"pcb_silkscreen_oval","data-pcb-layer":c,...h!==0&&{transform:`rotate(${-h} ${d} ${u})`}},value:"",children:[]}]}function zwo(e,t){let{transform:n,layer:o,colorMap:r}=t,{center:i,width:s,height:a,layer:c="top",pcb_courtyard_rect_id:l,ccw_rotation:h=0}=e;if(o&&c!==o)return[];if(!i||typeof i.x!=="number"||typeof i.y!=="number"||typeof s!=="number"||typeof a!=="number")return lm(`[pcb_courtyard_rect] Invalid data for "${l}": expected center {x: number, y: number}, width: number, height: number, got center=${JSON.stringify(i)}, width=${JSON.stringify(s)}, height=${JSON.stringify(a)}`),[];let[d,u]=x7t.applyToPoint(n,[i.x,i.y]),_=s*Math.abs(n.a),p=a*Math.abs(n.d),m=0.05*Math.abs(n.a),A=c==="bottom"?r.courtyard.bottom:r.courtyard.top,g={x:(-_/2).toString(),y:(-p/2).toString(),width:_.toString(),height:p.toString(),class:`pcb-courtyard-rect pcb-courtyard-${c}`,"data-pcb-courtyard-rect-id":l,"data-type":"pcb_courtyard_rect","data-pcb-layer":c,"stroke-linejoin":"round"};if(typeof h==="number"&&h!==0)g.transform=`translate(${d} ${u}) rotate(${-h})`;else g.x=(d-_/2).toString(),g.y=(u-p/2).toString();return g.fill="none",g.stroke=A,g["stroke-width"]=m.toString(),[{name:"rect",type:"element",attributes:g,value:"",children:[]}]}function Owo(e,t){let{transform:n,layer:o,colorMap:r}=t,{layer:i="top",pcb_courtyard_polygon_id:s,points:a,color:c}=e;if(o&&i!==o)return[];if(!a||a.length===0)return lm(`[pcb_courtyard_polygon] Invalid data for "${s}": expected non-empty array of points, got ${JSON.stringify(a)}`),[];let h=a.map((m)=>C7t.applyToPoint(n,[m.x,m.y])).map((m)=>`${m[0]},${m[1]}`).join(" "),d=0.05*Math.abs(n.a),u=c??(i==="bottom"?r.courtyard.bottom:r.courtyard.top);return[{name:"polygon",type:"element",attributes:{points:h,class:`pcb-courtyard-polygon pcb-courtyard-${i}`,"data-pcb-courtyard-polygon-id":s,"data-type":"pcb_courtyard_polygon","data-pcb-layer":i,fill:"none",stroke:u,"stroke-width":d.toString(),"stroke-linejoin":"round"},value:"",children:[]}]}function Vwo(e,t){let{transform:n,layer:o,colorMap:r}=t,{layer:i,pcb_courtyard_outline_id:s,outline:a}=e;if(o&&i!==o)return[];if(!a||a.length===0)return lm(`[pcb_courtyard_outline] Invalid data for "${s}": expected non-empty array of points, got ${JSON.stringify(a)}`),[];let l=a.map((p)=>b7t.applyToPoint(n,[p.x,p.y])).map((p)=>`${p[0]},${p[1]}`).join(" "),h=0.05*Math.abs(n.a),d=i==="bottom"?r.courtyard.bottom:r.courtyard.top;return[{name:"polygon",type:"element",attributes:{points:l,class:`pcb-courtyard-outline pcb-courtyard-${i}`,"data-pcb-courtyard-outline-id":s,"data-type":"pcb_courtyard_outline","data-pcb-layer":i,fill:"none",stroke:d,"stroke-width":h.toString(),"stroke-linejoin":"round"},value:"",children:[]}]}function Ywo(e,t){let{transform:n,layer:o,colorMap:r}=t,{center:i,radius:s,layer:a="top",pcb_courtyard_circle_id:c}=e;if(o&&a!==o)return[];if(!i||typeof i.x!=="number"||typeof i.y!=="number"||typeof s!=="number")return console.error(`[pcb_courtyard_circle] Invalid data for "${c}": expected center {x: number, y: number}, radius: number, got center=${JSON.stringify(i)}, radius=${JSON.stringify(s)}`),[];let[l,h]=I7t.applyToPoint(n,[i.x,i.y]),d=s*Math.abs(n.a),u=0.05*Math.abs(n.a),_=a==="bottom"?r.courtyard.bottom:r.courtyard.top,p={cx:l.toString(),cy:h.toString(),r:d.toString(),class:`pcb-courtyard-circle pcb-courtyard-${a}`,"data-pcb-courtyard-circle-id":c,"data-type":"pcb_courtyard_circle","data-pcb-layer":a};return p.fill="none",p.stroke=_,p["stroke-width"]=u.toString(),[{name:"circle",type:"element",attributes:p,value:"",children:[]}]}function _ze(e){let{groupAnchorPosition:t,componentPosition:n,transform:o,componentWidth:r=0,componentHeight:i=0,displayXOffset:s,displayYOffset:a}=e,c=[],[l,h]=$Fe.applyToPoint(o,[t.x,t.y]),[d,u]=$Fe.applyToPoint(o,[n.x,n.y]),_=n.x-t.x,p=n.y-t.y,m=Math.abs(o.a),A=r*m,g=i*m;c.push(Kwo(l,h));let f=jwo(l,h,d,u);c.push({name:"line",type:"element",attributes:{x1:f.x1.toString(),y1:f.y1.toString(),x2:f.x2.toString(),y2:f.y2.toString(),stroke:"#ffffff","stroke-width":"0.5","stroke-dasharray":"3,3",opacity:"0.5",class:"anchor-offset-connector"},children:[],value:""}),c.push({name:"circle",type:"element",attributes:{cx:d.toString(),cy:u.toString(),r:S7t.toString(),fill:"#ffffff",opacity:"0.7",class:"anchor-offset-component-marker"},children:[],value:""});let y=Math.abs(u-h),x=Math.abs(d-l),C=Math.sqrt(x*x+y*y),b=g/2+Gwo,I=Math.max(b,Math.min(Xwo,C*Wwo)),v=p>0?u-I:u+I,P=A/2+Uwo,M=_>0?d+P:d-P;if(D1e(v,h)||D1e(v,u)){let B=Math.min(h,u),T=Math.max(h,u),N=B-iie,D=T+iie;v=Math.abs(v-N)<Math.abs(v-D)?N:D}if(D1e(M,l)||D1e(M,d)){let B=Math.min(l,d),T=Math.max(l,d),N=B-iie,D=T+iie;M=Math.abs(M-N)<Math.abs(M-D)?N:D}if(Math.abs(_)>s8t)c.push(...$wo({startX:l,endX:d,y:v,offsetMm:_,offsetY:p,displayOffset:s}));if(Math.abs(p)>s8t)c.push(...qwo({x:M,startY:h,endY:u,offsetMm:p,offsetX:_,displayOffset:a}));return c}function jwo(e,t,n,o){let r=n-e,i=o-t,s=Math.hypot(r,i),a=EFe+MFe;if(!(s>a))return{x1:e,y1:t,x2:n,y2:o};let c=r/s,l=i/s;return{x1:e+c*EFe,y1:t+l*EFe,x2:n-c*MFe,y2:o-l*MFe}}function D1e(e,t){return Math.abs(e-t)<iie}function Kwo(e,t){return{name:"g",type:"element",attributes:{class:"anchor-offset-marker","data-type":"anchor_offset_marker"},children:[{name:"line",type:"element",attributes:{x1:e.toString(),y1:(t-hj).toString(),x2:e.toString(),y2:(t+hj).toString(),stroke:"#ffffff","stroke-width":c8t.toString(),"stroke-linecap":"round"},children:[],value:""},{name:"line",type:"element",attributes:{x1:(e-hj).toString(),y1:t.toString(),x2:(e+hj).toString(),y2:t.toString(),stroke:"#ffffff","stroke-width":c8t.toString(),"stroke-linecap":"round"},children:[],value:""}],value:""}}function $wo({startX:e,endX:t,y:n,offsetMm:o,offsetY:r,displayOffset:i}){let s=[];s.push({name:"line",type:"element",attributes:{x1:e.toString(),y1:n.toString(),x2:t.toString(),y2:n.toString(),stroke:"#ffffff","stroke-width":mj.toString(),class:"anchor-offset-dimension-x"},children:[],value:""}),s.push({name:"line",type:"element",attributes:{x1:e.toString(),y1:(n-_4).toString(),x2:e.toString(),y2:(n+_4).toString(),stroke:"#ffffff","stroke-width":mj.toString()},children:[],value:""}),s.push({name:"line",type:"element",attributes:{x1:t.toString(),y1:(n-_4).toString(),x2:t.toString(),y2:(n+_4).toString(),stroke:"#ffffff","stroke-width":mj.toString()},children:[],value:""});let a=(e+t)/2,c=r>0?n-_4-a8t:n+_4+a8t;return s.push({name:"text",type:"element",attributes:{x:a.toString(),y:c.toString(),fill:"#ffffff","font-size":v7t.toString(),"font-family":"Arial, sans-serif","text-anchor":"middle","dominant-baseline":r>0?"baseline":"hanging",class:"anchor-offset-label"},children:[{type:"text",value:P7t("X",o,i),name:"",attributes:{},children:[]}],value:""}),s}function qwo({x:e,startY:t,endY:n,offsetMm:o,offsetX:r,displayOffset:i}){let s=[];s.push({name:"line",type:"element",attributes:{x1:e.toString(),y1:t.toString(),x2:e.toString(),y2:n.toString(),stroke:"#ffffff","stroke-width":mj.toString(),class:"anchor-offset-dimension-y"},children:[],value:""}),s.push({name:"line",type:"element",attributes:{x1:(e-_4).toString(),y1:t.toString(),x2:(e+_4).toString(),y2:t.toString(),stroke:"#ffffff","stroke-width":mj.toString()},children:[],value:""}),s.push({name:"line",type:"element",attributes:{x1:(e-_4).toString(),y1:n.toString(),x2:(e+_4).toString(),y2:n.toString(),stroke:"#ffffff","stroke-width":mj.toString()},children:[],value:""});let a=(t+n)/2,c=r<0?e-_4-4:e+_4+4;return s.push({name:"text",type:"element",attributes:{x:c.toString(),y:a.toString(),fill:"#ffffff","font-size":v7t.toString(),"font-family":"Arial, sans-serif","text-anchor":r<0?"end":"start","dominant-baseline":"middle",class:"anchor-offset-label"},children:[{type:"text",value:P7t("Y",o,i),name:"",attributes:{},children:[]}],value:""}),s}function P7t(e,t,n){let o=typeof n==="string"?n:t.toFixed(2),i=typeof o==="string"&&o.trim().endsWith("mm")?"":"mm";return`${e}: ${o}${i}`}function mie(e){let t=e?.anchor_position??e?.center;if(t&&typeof t.x==="number"&&typeof t.y==="number")return{x:t.x,y:t.y};return}function E7t(e,t){let{transform:n,colorMap:o,showSolderMask:r,circuitJson:i}=t,{width:s,height:a,center:c,outline:l,position_mode:h,anchor_position:d,display_offset_x:u,display_offset_y:_}=e,p;if(l&&Array.isArray(l)&&l.length>=3)p=l.map((A,g)=>{let[f,y]=rj.applyToPoint(n,[A.x,A.y]);return g===0?`M ${f} ${y}`:`L ${f} ${y}`}).join(" ");else{let A=s/2,g=a/2,f=rj.applyToPoint(n,[c.x-A,c.y-g]),y=rj.applyToPoint(n,[c.x+A,c.y-g]),x=rj.applyToPoint(n,[c.x+A,c.y+g]),C=rj.applyToPoint(n,[c.x-A,c.y+g]);p=`M ${f[0]} ${f[1]} L ${y[0]} ${y[1]} L ${x[0]} ${x[1]} L ${C[0]} ${C[1]}`}p+=" Z";let m=[];if(r){let g=(t.layer??"top")==="bottom"?"soldermask-bottom":"soldermask-top";m.push({name:"path",type:"element",value:"",children:[],attributes:{class:"pcb-board-soldermask",d:p,fill:o.soldermask.top,"fill-opacity":"0.8",stroke:"none","data-type":"pcb_soldermask","data-pcb-layer":g}})}if(m.push({name:"path",type:"element",value:"",children:[],attributes:{class:"pcb-board",d:p,fill:"none",stroke:o.boardOutline,"stroke-width":(0.1*Math.abs(n.a)).toString(),"data-type":"pcb_board","data-pcb-layer":"board"}}),t.showAnchorOffsets&&i&&h==="relative_to_panel_anchor"){let A=i.find((g)=>g.type==="pcb_panel");if(A){let g=mie(A);if(g)m.push(..._ze({groupAnchorPosition:g,componentPosition:d??c,transform:n,componentWidth:s,componentHeight:a,displayXOffset:u,displayYOffset:_}))}}return m}function Jwo(e,t){let{transform:n,colorMap:o,showSolderMask:r}=t,i=Number(e.width),s=Number(e.height),a=e.center??{x:i/2,y:s/2},c=i/2,l=s/2,h=sie.applyToPoint(n,[a.x-c,a.y-l]),d=sie.applyToPoint(n,[a.x+c,a.y-l]),u=sie.applyToPoint(n,[a.x+c,a.y+l]),_=sie.applyToPoint(n,[a.x-c,a.y+l]),p=`M ${h[0]} ${h[1]} L ${d[0]} ${d[1]} L ${u[0]} ${u[1]} L ${_[0]} ${_[1]} Z`,m=e.covered_with_solder_mask!==!1,A=Boolean(r&&m);return[{name:"path",type:"element",value:"",children:[],attributes:{class:"pcb-panel",d:p,fill:"none",stroke:o.boardOutline,"stroke-width":(0.1*Math.abs(n.a)).toString(),"data-type":"pcb_panel","data-pcb-layer":"board"}}]}function Zwo(e,t){let{transform:n,colorMap:o,showSolderMask:r}=t,i=t.layer??"top",[s,a]=M7t.applyToPoint(n,[e.x,e.y]),c=Boolean(e.is_covered_with_solder_mask),l=(e.soldermask_margin??0)*Math.abs(n.a),h=r&&c&&l!==0,d=o.soldermask.top;if(e.hole_shape==="circle"||e.hole_shape==="square"){let u=e.hole_diameter*Math.abs(n.a),_=u/2;if(e.hole_shape==="circle"){let g={name:"circle",type:"element",attributes:{class:"pcb-hole",cx:s.toString(),cy:a.toString(),r:_.toString(),fill:o.drill,"data-type":"pcb_hole","data-pcb-layer":"drill"},children:[],value:""};if(!h)return[g];let f=_+l;if(l<0){let x={name:"circle",type:"element",value:"",children:[],attributes:{class:"pcb-hole-covered",fill:d,cx:s.toString(),cy:a.toString(),r:_.toString(),"data-type":"pcb_hole","data-pcb-layer":"drill"}},C={name:"circle",type:"element",value:"",children:[],attributes:{class:"pcb-hole-exposed",fill:o.drill,cx:s.toString(),cy:a.toString(),r:f.toString(),"data-type":"pcb_soldermask","data-pcb-layer":"drill"}};return[x,C]}return[{name:"circle",type:"element",value:"",children:[],attributes:{class:"pcb-soldermask-cutout",fill:o.substrate,cx:s.toString(),cy:a.toString(),r:f.toString(),"data-type":"pcb_soldermask_opening","data-pcb-layer":i}},g]}let p={name:"rect",type:"element",attributes:{class:"pcb-hole",x:(s-_).toString(),y:(a-_).toString(),width:u.toString(),height:u.toString(),fill:o.drill,"data-type":"pcb_hole","data-pcb-layer":"drill"},children:[],value:""};if(!h)return[p];let m=u+2*l;if(l<0){let g={name:"rect",type:"element",value:"",children:[],attributes:{class:"pcb-hole-covered",fill:d,x:(s-_).toString(),y:(a-_).toString(),width:u.toString(),height:u.toString(),"data-type":"pcb_hole","data-pcb-layer":"drill"}},f={name:"rect",type:"element",value:"",children:[],attributes:{class:"pcb-hole-exposed",fill:o.drill,x:(s-m/2).toString(),y:(a-m/2).toString(),width:m.toString(),height:m.toString(),"data-type":"pcb_soldermask","data-pcb-layer":"drill"}};return[g,f]}return[{name:"rect",type:"element",value:"",children:[],attributes:{class:"pcb-soldermask-cutout",fill:o.substrate,x:(s-m/2).toString(),y:(a-m/2).toString(),width:m.toString(),height:m.toString(),"data-type":"pcb_soldermask_opening","data-pcb-layer":i}},p]}if(e.hole_shape==="oval"){let u=e.hole_width*Math.abs(n.a),_=e.hole_height*Math.abs(n.a),p=u/2,m=_/2,A={name:"ellipse",type:"element",attributes:{class:"pcb-hole",cx:s.toString(),cy:a.toString(),rx:p.toString(),ry:m.toString(),fill:o.drill,"data-type":"pcb_hole","data-pcb-layer":"drill"},children:[],value:""};if(!h)return[A];let g=p+l,f=m+l;if(l<0){let x={name:"ellipse",type:"element",value:"",children:[],attributes:{class:"pcb-hole-covered",fill:d,cx:s.toString(),cy:a.toString(),rx:p.toString(),ry:m.toString(),"data-type":"pcb_hole","data-pcb-layer":"drill"}},C={name:"ellipse",type:"element",value:"",children:[],attributes:{class:"pcb-hole-exposed",fill:o.drill,cx:s.toString(),cy:a.toString(),rx:g.toString(),ry:f.toString(),"data-type":"pcb_soldermask","data-pcb-layer":"drill"}};return[x,C]}return[{name:"ellipse",type:"element",value:"",children:[],attributes:{class:"pcb-soldermask-cutout",fill:o.substrate,cx:s.toString(),cy:a.toString(),rx:g.toString(),ry:f.toString(),"data-type":"pcb_soldermask_opening","data-pcb-layer":i}},A]}if(e.hole_shape==="rect"){let u=e.hole_width*Math.abs(n.a),_=e.hole_height*Math.abs(n.a),p={name:"rect",type:"element",attributes:{class:"pcb-hole",x:(s-u/2).toString(),y:(a-_/2).toString(),width:u.toString(),height:_.toString(),fill:o.drill,"data-type":"pcb_hole","data-pcb-layer":"drill"},children:[],value:""};if(!h)return[p];let m=u+2*l,A=_+2*l;if(l<0){let f={name:"rect",type:"element",value:"",children:[],attributes:{class:"pcb-hole-covered",fill:d,x:(s-u/2).toString(),y:(a-_/2).toString(),width:u.toString(),height:_.toString(),"data-type":"pcb_hole","data-pcb-layer":"drill"}},y={name:"rect",type:"element",value:"",children:[],attributes:{class:"pcb-hole-exposed",fill:o.drill,x:(s-m/2).toString(),y:(a-A/2).toString(),width:m.toString(),height:A.toString(),"data-type":"pcb_soldermask","data-pcb-layer":"drill"}};return[f,y]}return[{name:"rect",type:"element",value:"",children:[],attributes:{class:"pcb-soldermask-cutout",fill:o.substrate,x:(s-m/2).toString(),y:(a-A/2).toString(),width:m.toString(),height:A.toString(),"data-type":"pcb_soldermask_opening","data-pcb-layer":i}},p]}if(e.hole_shape==="pill"){let u=e.hole_width*Math.abs(n.a),_=e.hole_height*Math.abs(n.a),p=u>_,m=Math.min(u,_)/2,A=Math.abs(p?u-_:_-u),g=p?`M${s-A/2},${a-m} h${A} a${m},${m} 0 0 1 0,${_} h-${A} a${m},${m} 0 0 1 0,-${_} z`:`M${s-m},${a-A/2} v${A} a${m},${m} 0 0 0 ${u},0 v-${A} a${m},${m} 0 0 0 -${u},0 z`,f={name:"path",type:"element",attributes:{class:"pcb-hole",fill:o.drill,d:g,"data-type":"pcb_hole","data-pcb-layer":"drill"},children:[],value:""};if(!h)return[f];let y=u+2*l,x=_+2*l,C=y>x,b=Math.min(y,x)/2,I=Math.abs(C?y-x:x-y),v=C?`M${s-I/2},${a-b} h${I} a${b},${b} 0 0 1 0,${x} h-${I} a${b},${b} 0 0 1 0,-${x} z`:`M${s-b},${a-I/2} v${I} a${b},${b} 0 0 0 ${y},0 v-${I} a${b},${b} 0 0 0 -${y},0 z`;if(l<0){let M={name:"path",type:"element",value:"",children:[],attributes:{class:"pcb-hole-covered",fill:d,d:g,"data-type":"pcb_hole","data-pcb-layer":"drill"}},B={name:"path",type:"element",value:"",children:[],attributes:{class:"pcb-hole-exposed",fill:o.drill,d:v,"data-type":"pcb_soldermask","data-pcb-layer":"drill"}};return[M,B]}return[{name:"path",type:"element",value:"",children:[],attributes:{class:"pcb-soldermask-cutout",fill:o.substrate,d:v,"data-type":"pcb_soldermask_opening","data-pcb-layer":i}},f]}if(e.hole_shape==="rotated_pill"){let u=e.hole_width*Math.abs(n.a),_=e.hole_height*Math.abs(n.a),p="ccw_rotation"in e?e.ccw_rotation??0:0,m=u>_,A=Math.min(u,_)/2,g=Math.abs(m?u-_:_-u),f=m?`M${-g/2},${-A} h${g} a${A},${A} 0 0 1 0,${_} h-${g} a${A},${A} 0 0 1 0,-${_} z`:`M${-A},${-g/2} v${g} a${A},${A} 0 0 0 ${u},0 v-${g} a${A},${A} 0 0 0 -${u},0 z`,y={name:"path",type:"element",attributes:{class:"pcb-hole",fill:o.drill,d:f,transform:`translate(${s} ${a}) rotate(${-p})`,"data-type":"pcb_hole","data-pcb-layer":"drill"},children:[],value:""};if(!h)return[y];let x=u+2*l,C=_+2*l,b=x>C,I=Math.min(x,C)/2,v=Math.abs(b?x-C:C-x),P=b?`M${-v/2},${-I} h${v} a${I},${I} 0 0 1 0,${C} h-${v} a${I},${I} 0 0 1 0,-${C} z`:`M${-I},${-v/2} v${v} a${I},${I} 0 0 0 ${x},0 v-${v} a${I},${I} 0 0 0 -${x},0 z`;if(l<0){let B={name:"path",type:"element",value:"",children:[],attributes:{class:"pcb-hole-covered",fill:d,d:f,transform:`translate(${s} ${a}) rotate(${-p})`,"data-type":"pcb_hole","data-pcb-layer":"drill"}},T={name:"path",type:"element",value:"",children:[],attributes:{class:"pcb-hole-exposed",fill:o.drill,d:P,transform:`translate(${s} ${a}) rotate(${-p})`,"data-type":"pcb_soldermask","data-pcb-layer":"drill"}};return[B,T]}return[{name:"path",type:"element",value:"",children:[],attributes:{class:"pcb-soldermask-cutout",fill:o.substrate,d:P,"data-type":"pcb_soldermask_opening","data-pcb-layer":i}},y]}return[]}function nBo(e,t){let{transform:n}=t,o=oa(e),r=e.filter((c)=>c.type==="pcb_port"),i=e.filter((c)=>c.type==="source_trace"),s=[];r.forEach((c,l)=>{let h=c.pcb_port_id;if(!h)return;let d=o.getNetConnectedToId(h);if(!d)return;let u=!1,_=Ho(e).source_port.getWhere({pcb_port_id:h});if(_&&_.source_port_id){let A=_.source_port_id;for(let g of i)if(Array.isArray(g.connected_source_port_ids)&&g.connected_source_port_ids.includes(A)&&Array.isArray(g.connected_source_net_ids)&&g.connected_source_net_ids.length>0){u=!0;break}}let p={x:c.x,y:c.y},m=tBo(p,d,o,e);if(!m)return;s.push({key:`${h}-${l}`,startPoint:p,endPoint:m,isInNet:u})});let a=[];for(let c of s){let l=qFe.applyToPoint(n,[c.startPoint.x,c.startPoint.y]),h=qFe.applyToPoint(n,[c.endPoint.x,c.endPoint.y]),d={x1:l[0].toString(),y1:l[1].toString(),x2:h[0].toString(),y2:h[1].toString(),stroke:"white","stroke-width":"1","stroke-dasharray":"6,6","data-type":"pcb_rats_nest","data-pcb-layer":"overlay"};a.push({name:"line",type:"element",attributes:d,value:"",children:[]})}return a}function oBo(e,t){let{transform:n,colorMap:o}=t;if(e.shape==="rect"){let r=e,[i,s]=HC.applyToPoint(n,[r.center.x,r.center.y]),a=r.width*Math.abs(n.a),c=r.height*Math.abs(n.d),l=-(r.rotation??0),{corner_radius:h}=r,d=typeof h==="number"&&h>0?h:0,u=d*Math.abs(n.a),_=d*Math.abs(n.d),p={class:"pcb-cutout pcb-cutout-rect",x:(-a/2).toString(),y:(-c/2).toString(),width:a.toString(),height:c.toString(),fill:o.drill,transform:HC.toString(HC.compose(HC.translate(i,s),HC.rotate(l*Math.PI/180))),"data-type":"pcb_cutout","data-pcb-layer":"drill"};if(u>0)p.rx=u.toString();if(_>0)p.ry=_.toString();return[{name:"rect",type:"element",attributes:p,children:[],value:""}]}if(e.shape==="circle"){let r=e,[i,s]=HC.applyToPoint(n,[r.center.x,r.center.y]),a=r.radius*Math.abs(n.a);return[{name:"circle",type:"element",attributes:{class:"pcb-cutout pcb-cutout-circle",cx:i.toString(),cy:s.toString(),r:a.toString(),fill:o.drill,"data-type":"pcb_cutout","data-pcb-layer":"drill"},children:[],value:""}]}if(e.shape==="polygon"){let r=e;if(!r.points||r.points.length===0)return[];return[{name:"polygon",type:"element",attributes:{class:"pcb-cutout pcb-cutout-polygon",points:r.points.map((a)=>HC.applyToPoint(n,[a.x,a.y])).map((a)=>`${a[0]},${a[1]}`).join(" "),fill:o.drill,"data-type":"pcb_cutout","data-pcb-layer":"drill"},children:[],value:""}]}return[]}function rBo(e,t){let{transform:n,colorMap:o}=t;if(!e.route||!Array.isArray(e.route))return[];let r=e.route[0],i=e.route[e.route.length-1],s=r&&i&&r.x===i.x&&r.y===i.y;return[{name:"path",type:"element",attributes:{class:"pcb-cutout pcb-cutout-path",d:e.route.slice(0,s?-1:void 0).map((c,l)=>{let[h,d]=w7t.applyToPoint(n,[c.x,c.y]);return l===0?`M ${h} ${d}`:`L ${h} ${d}`}).join(" ")+(s?" Z":""),fill:o.drill,"data-type":"pcb_cutout_path","data-pcb-cutout-id":e.pcb_cutout_id,"data-pcb-layer":"drill"},value:"",children:[]}]}function sBo(e){let t=[];for(let n=-dj;n<=dj;n+=iBo)t.push({name:"line",type:"element",value:"",attributes:{x1:n.toString(),y1:"0",x2:(n+dj).toString(),y2:dj.toString(),stroke:e,"stroke-width":"1"},children:[]});return t}function aBo(e){return{name:"defs",type:"element",value:"",attributes:{},children:[{name:"pattern",type:"element",value:"",attributes:{id:gze,width:dj.toString(),height:dj.toString(),patternUnits:"userSpaceOnUse"},children:sBo(e)}]}}function BFe(e,t,n,o){let r={class:`pcb-keepout ${n} pcb-keepout-background`,"data-type":"pcb_keepout","data-pcb-layer":t,"data-pcb-keepout-id":e,stroke:"none"};if(o)r["data-description"]=o;return r}function TFe(e,t,n,o){let r={class:`pcb-keepout ${n} pcb-keepout-pattern`,fill:`url(#${gze})`,"data-type":"pcb_keepout","data-pcb-layer":t,"data-pcb-keepout-id":e,stroke:"none"};if(o)r["data-description"]=o;return r}function cBo(e,t){let{transform:n,layer:o,colorMap:r}=t;if(o&&!e.layers.includes(o))return[];let i=[],s=r.keepout;for(let a of e.layers){if(o&&a!==o)continue;if(e.shape==="rect"){let c=e,[l,h]=a7.applyToPoint(n,[c.center.x,c.center.y]),d=c.width*Math.abs(n.a),u=c.height*Math.abs(n.d),_=a7.toString(a7.compose(a7.translate(l,h))),p={...BFe(c.pcb_keepout_id,a,"pcb-keepout-rect",c.description),x:(-d/2).toString(),y:(-u/2).toString(),width:d.toString(),height:u.toString(),fill:wFe,transform:_},m={...TFe(c.pcb_keepout_id,a,"pcb-keepout-rect",c.description),x:(-d/2).toString(),y:(-u/2).toString(),width:d.toString(),height:u.toString(),transform:_};i.push({name:"rect",type:"element",attributes:p,children:[],value:""},{name:"rect",type:"element",attributes:m,children:[],value:""})}else if(e.shape==="circle"){let c=e,[l,h]=a7.applyToPoint(n,[c.center.x,c.center.y]),d=c.radius*Math.abs(n.a),u={...BFe(c.pcb_keepout_id,a,"pcb-keepout-circle",c.description),cx:l.toString(),cy:h.toString(),r:d.toString(),fill:wFe},_={...TFe(c.pcb_keepout_id,a,"pcb-keepout-circle",c.description),cx:l.toString(),cy:h.toString(),r:d.toString()};i.push({name:"circle",type:"element",attributes:u,children:[],value:""},{name:"circle",type:"element",attributes:_,children:[],value:""})}else if(e.shape==="outline"){let c=e,l=c.outline.map((_,p)=>{let[m,A]=a7.applyToPoint(n,[_.x,_.y]);return p===0?`M ${m} ${A}`:`L ${m} ${A}`}).join(" "),h=c.stroke_width*Math.abs(n.a),d={...BFe(c.pcb_keepout_id,a,"pcb-keepout-outline",c.description),d:l,fill:"none",stroke:wFe,"stroke-width":h.toString(),"stroke-linecap":"round","stroke-linejoin":"round"},u={...TFe(c.pcb_keepout_id,a,"pcb-keepout-outline",c.description),d:l,fill:"none",stroke:`url(#${gze})`,"stroke-width":h.toString(),"stroke-linecap":"round","stroke-linejoin":"round"};i.push({name:"path",type:"element",attributes:d,children:[],value:""},{name:"path",type:"element",attributes:u,children:[],value:""})}}return i}function lBo({elementType:e,shapeAttributes:t,layer:n,colorMap:o,additionalAttributes:r}){let i={class:"pcb-soldermask-cutout",fill:o.substrate,"data-type":"pcb_soldermask_opening","data-pcb-layer":n,...t,...r};return{name:e,type:"element",value:"",children:[],attributes:i}}function hBo(e,t){let{transform:n,layer:o,colorMap:r,showSolderMask:i}=t,{layer:s}=e;if(o&&s!==o)return[];let a=K8t(e,n);if(!a)return[];let{elementType:c,shapeAttributes:l}=a,h=Y1(s,r),d="0.5",u=e.covered_with_solder_mask!==!1,_=s==="bottom"?r.soldermaskOverCopper.bottom:r.soldermaskOverCopper.top,p="0.9",m={name:c,type:"element",value:"",children:[],attributes:{class:`pcb-copper-pour pcb-copper-pour-${e.shape}`,...l,fill:h,"fill-opacity":d,"data-type":"pcb_copper_pour","data-pcb-layer":s}},A=i?u?OFe({elementType:c,shapeAttributes:l,layer:s,fillColor:_,fillOpacity:p,className:"pcb-soldermask-covered-pour"}):lBo({elementType:c,shapeAttributes:l,layer:s,colorMap:r}):null;if(!A)return[m];if(!u&&e.pcb_copper_pour_id?.includes("substrate_only"))return[A];return[m,A]}function T7t(e,t){let{transform:n,layer:o}=t;if(o&&e.layer!==o)return[];if(e.shape==="polygon"){let s=Aj(e.points,n);for(let a of e.holes??[])s+=` ${Aj(a,n)}`;return[{name:"path",type:"element",value:"",children:[],attributes:{class:"pcb-solder-paste",fill:sz(e.layer),d:s,"fill-rule":"evenodd","data-type":"pcb_solder_paste","data-pcb-layer":e.layer}}]}let[r,i]=B7t.applyToPoint(n,[e.x,e.y]);if(e.shape==="rect"||e.shape==="rotated_rect"){let s=e.width*Math.abs(n.a),a=e.height*Math.abs(n.d);if(e.shape==="rotated_rect"&&e.ccw_rotation)return[{name:"rect",type:"element",attributes:{class:"pcb-solder-paste",fill:sz(e.layer),x:(-s/2).toString(),y:(-a/2).toString(),width:s.toString(),height:a.toString(),transform:`translate(${r} ${i}) rotate(${-e.ccw_rotation})`,"data-type":"pcb_solder_paste","data-pcb-layer":e.layer}}];return[{name:"rect",type:"element",attributes:{class:"pcb-solder-paste",fill:sz(e.layer),x:(r-s/2).toString(),y:(i-a/2).toString(),width:s.toString(),height:a.toString(),"data-type":"pcb_solder_paste","data-pcb-layer":e.layer}}]}if(e.shape==="pill"){let s=e.width*Math.abs(n.a),a=e.height*Math.abs(n.d),c=e.radius*Math.abs(n.a);return[{name:"rect",type:"element",attributes:{class:"pcb-solder-paste",fill:sz(e.layer),x:(r-s/2).toString(),y:(i-a/2).toString(),width:s.toString(),height:a.toString(),rx:c.toString(),"data-type":"pcb_solder_paste","data-pcb-layer":e.layer}}]}if(e.shape==="rotated_pill"){let s=e.width*Math.abs(n.a),a=e.height*Math.abs(n.d),c=e.radius*Math.abs(n.a);return[{name:"rect",type:"element",attributes:{class:"pcb-solder-paste",fill:sz(e.layer),x:(-s/2).toString(),y:(-a/2).toString(),width:s.toString(),height:a.toString(),rx:c.toString(),transform:`translate(${r} ${i}) rotate(${-e.ccw_rotation})`,"data-type":"pcb_solder_paste","data-pcb-layer":e.layer}}]}if(e.shape==="oval"){let s=e.width*Math.abs(n.a),a=e.height*Math.abs(n.d);return[{name:"ellipse",type:"element",attributes:{class:"pcb-solder-paste",fill:sz(e.layer),cx:r.toString(),cy:i.toString(),rx:(s/2).toString(),ry:(a/2).toString(),"data-type":"pcb_solder_paste","data-pcb-layer":e.layer}}]}if(e.shape==="circle"){let s=e.radius*Math.abs(n.a);return[{name:"circle",type:"element",attributes:{class:"pcb-solder-paste",fill:sz(e.layer),cx:r.toString(),cy:i.toString(),r:s.toString(),"data-type":"pcb_solder_paste","data-pcb-layer":e.layer}}]}}function uBo({grid:e,svgWidth:t,svgHeight:n}){if(!e)return{};let o=e.lineColor??dBo,{cellSize:r,majorCellSize:i}=e,s=e.majorLineColor??o;if(i!==void 0){if(!r||r<=0)throw Error("grid.majorCellSize requires a positive grid.cellSize");if(i<=0)throw Error("grid.majorCellSize must be a positive multiple of grid.cellSize");let d=i/r,u=Math.round(d);if(!Number.isFinite(d)||Math.abs(d-u)>0.000001)throw Error("grid.majorCellSize must be a positive multiple of grid.cellSize")}if(!r||r<=0)return{};let a=i!==void 0,c=a?pBo(r,i,o,s):[{name:"path",type:"element",value:"",attributes:{d:`M ${r} 0 L 0 0 0 ${r}`,fill:"none",stroke:o,"stroke-width":"1","shape-rendering":"crispEdges"},children:[]}],l={name:"defs",type:"element",value:"",attributes:{},children:[{name:"pattern",type:"element",value:"",attributes:{id:l8t,width:a?i.toString():r.toString(),height:a?i.toString():r.toString(),patternUnits:"userSpaceOnUse"},children:c}]},h={name:"rect",type:"element",value:"",attributes:{x:"0",y:"0",width:t.toString(),height:n.toString(),fill:`url(#${l8t})`,"pointer-events":"none","data-type":"pcb_grid","data-pcb-layer":"global"},children:[]};return{defs:l,rect:h}}function pBo(e,t,n,o){let r=[],i=Math.round(t/e);for(let s=0;s<i;s+=1){let c=Number((s*e).toFixed(6)).toString(),l=s===0?o:n,h=t.toString();r.push({name:"line",type:"element",value:"",attributes:{x1:c,y1:"0",x2:c,y2:h,stroke:l,"stroke-width":"1","shape-rendering":"crispEdges"},children:[]}),r.push({name:"line",type:"element",value:"",attributes:{x1:"0",y1:c,x2:h,y2:c,stroke:l,"stroke-width":"1","shape-rendering":"crispEdges"},children:[]})}return r}function mBo(e,t){let{transform:n,circuitJson:o}=t,{center:r,width:i,height:s,rotation:a=0}=e,[c,l]=D7t.applyToPoint(n,[r.x,r.y]),h=i*Math.abs(n.a),d=s*Math.abs(n.d),u=`translate(${c}, ${l}) rotate(${-a}) scale(1, -1)`,_=[];if(t.showAnchorOffsets&&o&&e.position_mode==="relative_to_group_anchor"&&(e.positioned_relative_to_pcb_group_id||e.positioned_relative_to_pcb_board_id)){let p=_Bo(e,o);if(p)_.push(..._ze({groupAnchorPosition:p,componentPosition:r,transform:n,componentWidth:i,componentHeight:s,displayXOffset:e.display_offset_x,displayYOffset:e.display_offset_y}))}if(!t.colorMap.debugComponent?.fill&&!t.colorMap.debugComponent?.stroke)return _;return _.push({name:"g",type:"element",attributes:{transform:u,"data-type":"pcb_component","data-pcb-layer":e.layer??"top"},children:[{name:"rect",type:"element",attributes:{class:"pcb-component",x:(-h/2).toString(),y:(-d/2).toString(),width:h.toString(),height:d.toString(),fill:t.colorMap.debugComponent.fill??"transparent",stroke:t.colorMap.debugComponent.stroke??"transparent","data-type":"pcb_component","data-pcb-layer":e.layer??"top"}}],value:""}),_}function _Bo(e,t){if(e.positioned_relative_to_pcb_group_id){let n=t.find((r)=>r.type==="pcb_group"&&r.pcb_group_id===e.positioned_relative_to_pcb_group_id),o=mie(n);if(o)return o}if(e.positioned_relative_to_pcb_board_id){let n=t.find((r)=>r.type==="pcb_board"&&r.pcb_board_id===e.positioned_relative_to_pcb_board_id),o=mie(n);if(o)return o}return}function ABo(e,t){let{transform:n,circuitJson:o}=t,{center:r,width:i,height:s}=e,a=[];if(t.showAnchorOffsets&&e.position_mode==="relative_to_group_anchor"&&o){let v=yBo(e,o);if(v)a.push(..._ze({groupAnchorPosition:v,componentPosition:e.anchor_position??e.center,transform:n,componentWidth:e.width,componentHeight:e.height,displayXOffset:e.display_offset_x,displayYOffset:e.display_offset_y}))}let c=Array.isArray(e.outline)?e.outline:void 0,l=gBo*Math.abs(n.a),h=0.3*Math.abs(n.a),d=0.15*Math.abs(n.a),u={class:"pcb-group",fill:"none",stroke:fBo(e.pcb_group_id),"stroke-width":l.toString(),"stroke-dasharray":`${h} ${d}`,"data-type":"pcb_group","data-pcb-group-id":e.pcb_group_id,"data-pcb-layer":"overlay"};if(e.name)u["data-group-name"]=e.name;if(c&&c.length>=3&&c.every((v)=>v&&typeof v.x==="number"&&typeof v.y==="number")){let v=c.map((P,M)=>{let[B,T]=G1e.applyToPoint(n,[P.x,P.y]);return M===0?`M ${B} ${T}`:`L ${B} ${T}`}).join(" ");return a.push({name:"path",type:"element",value:"",children:[],attributes:{...u,d:`${v} Z`}}),a}if(!r||typeof r.x!=="number"||typeof r.y!=="number"||typeof i!=="number"||typeof s!=="number")return lm(`[pcb_group] Invalid data for "${e.pcb_group_id}"${e.name?` (name: "${e.name}")`:""}: expected center {x: number, y: number}, width: number, height: number, got center=${JSON.stringify(r)}, width=${JSON.stringify(i)}, height=${JSON.stringify(s)}`),a;let _=i/2,p=s/2,[m,A]=G1e.applyToPoint(n,[r.x-_,r.y+p]),[g,f]=G1e.applyToPoint(n,[r.x+_,r.y-p]),y=Math.min(m,g),x=Math.min(A,f),C=Math.abs(g-m),b=Math.abs(f-A),I={name:"rect",type:"element",value:"",attributes:{...u,x:y.toString(),y:x.toString(),width:C.toString(),height:b.toString()},children:[]};return a.push(I),a}function fBo(e){let t=e.match(/(\d+)$/),n=t?Number.parseInt(t[1],10):0;return h8t[n%h8t.length]}function yBo(e,t){if(e.positioned_relative_to_pcb_group_id){let n=t.find((r)=>r.type==="pcb_group"&&r.pcb_group_id===e.positioned_relative_to_pcb_group_id),o=mie(n);if(o)return o}if(e.positioned_relative_to_pcb_board_id){let n=t.find((r)=>r.type==="pcb_board"&&r.pcb_board_id===e.positioned_relative_to_pcb_board_id),o=mie(n);if(o)return o}return}function YN(e){return e.find((n)=>n.type==="project_software_metadata"||n.type==="source_project_metadata")?.software_used_string}function CBo({objects:e,layer:t,width:n,height:o,showSolderMask:r=!1}){let i=e.filter((h)=>h.attributes["data-pcb-layer"]===t&&(h.attributes.class==="pcb-pad"||h.attributes.class==="pcb-pad-exposed"||h.attributes["data-type"]==="pcb_soldermask_opening"));if(i.length===0)return null;let s=e.filter((h)=>h.attributes["data-type"]==="pcb_via").flatMap((h)=>h.children).filter((h)=>h.attributes.class==="pcb-via-tenting"||h.attributes.class==="pcb-via-tenting-hole"),a=e.filter((h)=>r&&h.attributes["data-pcb-layer"]===t&&(h.attributes["data-type"]==="pcb_copper_pour"||h.attributes.class==="pcb-soldermask-covered-pour")),c=i.filter((h)=>h.attributes.class==="pcb-pad"||h.attributes.class==="pcb-pad-exposed"),l=[];for(let{targets:h,cutouts:d,maskId:u}of[{targets:s,cutouts:i,maskId:`via-tenting-mask-${t}`},{targets:a,cutouts:c,maskId:`copper-pour-pad-opening-mask-${t}`}]){if(h.length===0||d.length===0)continue;for(let _ of h)_.attributes.mask=`url(#${u})`;l.push(bBo(u,d,n,o))}if(l.length===0)return null;return{name:"defs",type:"element",value:"",attributes:{},children:l}}function bBo(e,t,n,o){return{name:"mask",type:"element",value:"",attributes:{id:e,maskUnits:"userSpaceOnUse",x:"0",y:"0",width:String(n),height:String(o)},children:[{name:"rect",type:"element",value:"",attributes:{x:"0",y:"0",width:String(n),height:String(o),fill:"white"},children:[]},...t.map((r)=>({...r,attributes:{...r.attributes,fill:"black"}}))]}}function fj(e,t="error_text_overlay"){let n=e.filter((i)=>i.type.endsWith("_error"));if(n.length===0)return null;let o=n.map((i)=>i.message).filter((i)=>!!i);if(o.length===0)return null;return{name:"text",type:"element",value:"",attributes:{x:"10",y:"20",fill:"red","font-family":"monospace","font-size":"12px","data-type":t,"data-layer":"global"},children:o.map((i,s)=>({name:"tspan",type:"element",value:"",attributes:{x:"10",dy:s===0?"0":"1.2em"},children:[{type:"text",value:i,name:"",attributes:{},children:[]}]}))}}function IBo({anchorPosition:e,textWidth:t,textHeight:n,anchorAlignment:o}){switch(o){case"top_left":return{x:e.x+t/2,y:e.y+n/2};case"top_center":return{x:e.x,y:e.y+n/2};case"top_right":return{x:e.x-t/2,y:e.y+n/2};case"center_left":return{x:e.x+t/2,y:e.y};case"center_right":return{x:e.x-t/2,y:e.y};case"bottom_left":return{x:e.x+t/2,y:e.y-n/2};case"bottom_center":return{x:e.x,y:e.y-n/2};case"bottom_right":return{x:e.x-t/2,y:e.y-n/2};case"center":default:return e}}function vBo(e){let{POSITIVE_INFINITY:t,POSITIVE_INFINITY:n,NEGATIVE_INFINITY:o,NEGATIVE_INFINITY:r}=Number,i=!1,{POSITIVE_INFINITY:s,POSITIVE_INFINITY:a,NEGATIVE_INFINITY:c,NEGATIVE_INFINITY:l}=Number,h=!1;for(let y of e)if(y.type==="pcb_panel"){let x=y,C=Ke.parse(x.width),b=Ke.parse(x.height);if(C===void 0||b===void 0)continue;let I=x.center??{x:C/2,y:b/2};d({center:I,width:C,height:b})}else if(y.type==="pcb_board"){if(y.outline&&Array.isArray(y.outline)&&y.outline.length>=3)_(y.outline),p(y.outline);else if("center"in y&&"width"in y&&"height"in y)d({center:y.center,width:y.width,height:y.height}),u({center:y.center,width:y.width,height:y.height})}else if(y.type==="pcb_courtyard_rect")d({center:y.center,width:y.width,height:y.height,ccwRotationDegrees:y.ccw_rotation});else if(y.type==="pcb_soldermask_opening")if(y.shape==="polygon")m(y.points);else if(y.shape==="circle")d({center:{x:y.x,y:y.y},width:y.radius*2,height:y.radius*2});else d({center:{x:y.x,y:y.y},width:y.width,height:y.height,ccwRotationDegrees:y.shape==="rotated_rect"?y.ccw_rotation:0});else if(y.type==="pcb_solder_paste"&&y.shape==="polygon")m(y.points);else if(y.type==="pcb_smtpad"){let x=y;if(x.shape==="rect"||x.shape==="pill")d({center:{x:x.x,y:x.y},width:x.width,height:x.height});else if(x.shape==="rotated_rect"||x.shape==="rotated_pill")d({center:{x:x.x,y:x.y},width:x.width,height:x.height,ccwRotationDegrees:x.ccw_rotation});else if(x.shape==="circle"){let C=Ke.parse(x.radius);if(C!==void 0)d({center:{x:x.x,y:x.y},width:C*2,height:C*2})}else if(x.shape==="polygon")m(x.points)}else if(y.type==="pcb_via"){let x=Ke.parse(y.outer_diameter);d({center:{x:y.x,y:y.y},width:x??0,height:x??0})}else if(y.type==="pcb_plated_hole"){let x=y,C={x:x.x,y:x.y};if(x.shape==="circle"){let b=Ke.parse(x.outer_diameter);d({center:C,width:b??0,height:b??0})}else if(x.shape==="oval"||x.shape==="pill")d({center:C,width:x.outer_width,height:x.outer_height});else if(x.shape==="circular_hole_with_rect_pad"||x.shape==="pill_hole_with_rect_pad")d({center:C,width:x.rect_pad_width,height:x.rect_pad_height});else if(x.shape==="rotated_pill_hole_with_rect_pad")d({center:C,width:x.rect_pad_width,height:x.rect_pad_height,ccwRotationDegrees:x.rect_ccw_rotation});else if(x.shape==="hole_with_polygon_pad")m((x.pad_outline??[]).map((b)=>({x:x.x+b.x,y:x.y+b.y})))}else if(y.type==="pcb_hole"){let x=y,C={x:x.x,y:x.y};if(x.hole_shape==="circle"||x.hole_shape==="square"){let b=Ke.parse(x.hole_diameter);d({center:C,width:b??0,height:b??0})}else if(x.hole_shape==="rotated_pill")d({center:C,width:x.hole_width,height:x.hole_height,ccwRotationDegrees:x.ccw_rotation});else if(x.hole_shape==="oval"||x.hole_shape==="rect"||x.hole_shape==="pill")d({center:C,width:x.hole_width,height:x.hole_height})}else if(y.type==="pcb_note_line")m([{x:y.x1,y:y.y1},{x:y.x2,y:y.y2}]);else if("x"in y&&"y"in y)d({center:{x:y.x,y:y.y},width:0,height:0});else if("route"in y)m(y.route);else if(y.type==="pcb_note_rect"||y.type==="pcb_fabrication_note_rect")d({center:y.center,width:y.width,height:y.height});else if(y.type==="pcb_note_dimension"||y.type==="pcb_fabrication_note_dimension"){let x=y,{from:C,to:b,text:I,font_size:v=1,arrow_size:P,offset_distance:M,offset_direction:B}=x;if(!C||!b||!P)continue;d({center:C,width:0,height:0}),d({center:b,width:0,height:0});let T=(ce)=>{let ue=Math.hypot(ce.x,ce.y)||1;return{x:ce.x/ue,y:ce.y/ue}},N=T({x:b.x-C.x,y:b.y-C.y});if(Number.isNaN(N.x)||Number.isNaN(N.y))continue;let D={x:-N.y,y:N.x},L=B&&typeof B.x==="number"&&typeof B.y==="number",H=L?T(B):{x:0,y:0},V=typeof M==="number"?M:0,O={x:H.x*V,y:H.y*V},U={x:C.x+O.x,y:C.y+O.y},j={x:b.x+O.x,y:b.y+O.y};d({center:U,width:0,height:0}),d({center:j,width:0,height:0});let Y=L&&(Math.abs(H.x)>Number.EPSILON||Math.abs(H.y)>Number.EPSILON)?H:D,X=V+P,K={x:C.x+Y.x*X,y:C.y+Y.y*X},J={x:b.x+Y.x*X,y:b.y+Y.y*X};d({center:K,width:0,height:0}),d({center:J,width:0,height:0});let ee=P/2,se={x:U.x+N.x*P,y:U.y+N.y*P},ne={x:j.x-N.x*P,y:j.y-N.y*P},re={x:se.x+D.x*ee,y:se.y+D.y*ee},Z={x:se.x-D.x*ee,y:se.y-D.y*ee};d({center:re,width:0,height:0}),d({center:Z,width:0,height:0});let te={x:ne.x+D.x*ee,y:ne.y+D.y*ee},ie={x:ne.x-D.x*ee,y:ne.y-D.y*ee};if(d({center:te,width:0,height:0}),d({center:ie,width:0,height:0}),I){let ce={x:(C.x+b.x)/2+O.x,y:(C.y+b.y)/2+O.y},ue=P*1.5,de={x:ce.x+D.x*ue,y:ce.y+D.y*ue},me=I.length*v*0.6;d({center:de,width:me,height:v})}}else if(y.type==="pcb_note_text"||y.type==="pcb_fabrication_note_text")g({text:y.text,anchorPosition:y.anchor_position,fontSize:y.font_size,anchorAlignment:y.anchor_alignment,ccwRotationDegrees:y.type==="pcb_fabrication_note_text"?y.ccw_rotation??1:0});else if(y.type==="pcb_cutout"){let x=y;if(x.shape==="rect")d({center:x.center,width:x.width,height:x.height,ccwRotationDegrees:x.rotation});else if(x.shape==="circle"){let C=Ke.parse(x.radius);if(C!==void 0)d({center:x.center,width:C*2,height:C*2})}else if(x.shape==="polygon")m(x.points);else if(x.shape==="path"){let C=x;if(C.route&&Array.isArray(C.route))m(C.route)}}else if(y.type==="pcb_keepout"){let x=y;if(x.shape==="rect")d({center:x.center,width:x.width,height:x.height});else if(x.shape==="circle"){let C=typeof x.radius==="number"?x.radius:Ke.parse(x.radius)??0;if(C>0)d({center:x.center,width:C*2,height:C*2})}else if(x.shape==="outline")for(let C of x.outline)d({center:C,width:x.stroke_width,height:x.stroke_width})}else if(y.type==="pcb_silkscreen_graphic"||y.type==="pcb_silkscreen_text"||y.type==="pcb_silkscreen_rect"||y.type==="pcb_silkscreen_circle"||y.type==="pcb_silkscreen_line"||y.type==="pcb_silkscreen_oval"||y.type==="pcb_silkscreen_pill")f(y);else if(y.type==="pcb_copper_text")d({center:y.anchor_position,width:0,height:0});else if(y.type==="pcb_copper_pour"){if(y.shape==="rect")d({center:y.center,width:y.width,height:y.height,ccwRotationDegrees:y.rotation});else if(y.shape==="polygon")m(y.points);else if(y.shape==="brep")m(y.brep_shape.outer_ring.vertices)}return{minX:t,minY:n,maxX:o,maxY:r,boardMinX:s,boardMinY:a,boardMaxX:c,boardMaxY:l,hasBounds:i,hasBoardBounds:h};function d({center:y,width:x,height:C,ccwRotationDegrees:b}){if(!y)return;let I=Ke.parse(y.x),v=Ke.parse(y.y);if(I===void 0||v===void 0)return;let P=Ke.parse(x)??0,M=Ke.parse(C)??0,B=P/2,T=M/2;if(typeof b==="number"&&b!==0){let N=b*Math.PI/180,D=Math.abs(Math.cos(N)),L=Math.abs(Math.sin(N)),H=B*D+T*L,V=B*L+T*D;B=H,T=V}t=Math.min(t,I-B),n=Math.min(n,v-T),o=Math.max(o,I+B),r=Math.max(r,v+T),i=!0}function u({center:y,width:x,height:C}){if(!y)return;let b=Ke.parse(y.x),I=Ke.parse(y.y);if(b===void 0||I===void 0)return;let v=Ke.parse(x)??0,P=Ke.parse(C)??0,M=v/2,B=P/2;s=Math.min(s,b-M),a=Math.min(a,I-B),c=Math.max(c,b+M),l=Math.max(l,I+B),i=!0,h=!0}function _(y){let x=!1;for(let C of y){let b=Ke.parse(C.x),I=Ke.parse(C.y);if(b===void 0||I===void 0)continue;t=Math.min(t,b),n=Math.min(n,I),o=Math.max(o,b),r=Math.max(r,I),x=!0}if(x)i=!0}function p(y){let x=!1;for(let C of y){let b=Ke.parse(C.x),I=Ke.parse(C.y);if(b===void 0||I===void 0)continue;s=Math.min(s,b),a=Math.min(a,I),c=Math.max(c,b),l=Math.max(l,I),x=!0}if(x)i=!0,h=!0}function m(y){let x=!1,C=[...y.flatMap(A),...G8t(y).flatMap(U8t)];for(let b of C)for(let I of[b]){let v=Ke.parse(I.x),P=Ke.parse(I.y);if(v===void 0||P===void 0)continue;t=Math.min(t,v),n=Math.min(n,P),o=Math.max(o,v),r=Math.max(r,P),x=!0}if(x)i=!0}function A(y){return"route_type"in y?mMo(y):[y]}function g({text:y,anchorPosition:x,fontSize:C=1,anchorAlignment:b="center",ccwRotationDegrees:I=0}){if(!y||!x)return;let v=y.split(`
`),M=Math.max(...v.map((N)=>N.length),0)*C*0.6,B=Math.max(v.length,1)*C,T=IBo({anchorPosition:x,textWidth:M,textHeight:B,anchorAlignment:b});d({center:T,width:M,height:B,ccwRotationDegrees:I})}function f(y){if(y.type==="pcb_silkscreen_text")d({center:y.anchor_position,width:0,height:0});else if(y.type==="pcb_silkscreen_graphic"){for(let x of y.brep_shape.outer_ring.vertices)d({center:{x:x.x,y:x.y},width:0,height:0});for(let x of y.brep_shape.inner_rings??[])for(let C of x.vertices)d({center:{x:C.x,y:C.y},width:0,height:0})}else if(y.type==="pcb_silkscreen_path")m(y.route);else if(y.type==="pcb_silkscreen_rect")d({center:y.center,width:y.width,height:y.height,ccwRotationDegrees:y.ccw_rotation});else if(y.type==="pcb_silkscreen_circle"){let x=Ke.parse(y.radius);if(x!==void 0)d({center:y.center,width:x*2,height:x*2})}else if(y.type==="pcb_silkscreen_line")d({center:{x:y.x1,y:y.y1},width:0,height:0}),d({center:{x:y.x2,y:y.y2},width:0,height:0});else if(y.type==="pcb_silkscreen_oval"){let x=Ke.parse(y.radius_x),C=Ke.parse(y.radius_y);if(x!==void 0&&C!==void 0)d({center:y.center,width:x*2,height:C*2})}else if(y.type==="pcb_silkscreen_pill")d({center:y.center,width:y.width,height:y.height,ccwRotationDegrees:y.ccw_rotation});else if(y.type==="pcb_cutout"){let x=y;if(x.shape==="rect")d({center:x.center,width:x.width,height:x.height,ccwRotationDegrees:x.rotation});else if(x.shape==="circle"){let C=Ke.parse(x.radius);if(C!==void 0)d({center:x.center,width:C*2,height:C*2})}else if(x.shape==="polygon")m(x.points);else if(x.shape==="path"){let C=x;if(C.route&&Array.isArray(C.route))m(C.route)}}}}function d8t(e,t,n){if(!e||t===void 0||n===void 0)return;let o=Ke.parse(e.x),r=Ke.parse(e.y);if(o===void 0||r===void 0)return;let i=Ke.parse(t),s=Ke.parse(n);if(i===void 0||s===void 0)return;let a=i/2,c=s/2;return{minX:o-a,minY:r-c,maxX:o+a,maxY:r+c}}function PBo(e){if(!e||e.length<3)return;let{POSITIVE_INFINITY:t,POSITIVE_INFINITY:n,NEGATIVE_INFINITY:o,NEGATIVE_INFINITY:r}=Number;for(let i of e){let s=Ke.parse(i.x),a=Ke.parse(i.y);if(s===void 0||a===void 0)continue;t=Math.min(t,s),n=Math.min(n,a),o=Math.max(o,s),r=Math.max(r,a)}if(!Number.isFinite(t)||!Number.isFinite(n))return;if(!Number.isFinite(o)||!Number.isFinite(r))return;return{minX:t,minY:n,maxX:o,maxY:r}}function u8t(e,t){if(!t.showPinNumbers)return[];if(e.type==="pcb_smtpad"){if(t.layer&&e.layer!==t.layer)return[]}else if(t.layer&&!e.layers.includes(t.layer))return[];let n=wMo(e,t.circuitJson);if(!n)return[];let o=TBo(e);if(!o||o.width<=0||o.height<=0)return[];let r=Math.abs(t.transform.a),i=Math.min(EBo,o.height*MBo,o.width*BBo/(n.length*wBo));if(i<=0)return[];let[s,a]=N7t.applyToPoint(t.transform,[o.centerX,o.centerY]),c=e.type==="pcb_smtpad"?e.layer:"through",l=o.ccwRotation?`rotate(${-o.ccwRotation} ${s} ${a})`:void 0;return[{name:"text",type:"element",value:"",attributes:{class:"pcb-pad-pin-number",x:s.toString(),y:a.toString(),fill:"#b0b0b0","font-family":"Arial, sans-serif","font-size":(i*r).toString(),"font-weight":"500","text-anchor":"middle","dominant-baseline":"central","pointer-events":"none","data-type":"pcb_pad_pin_number","data-pcb-layer":c,"data-pin-number":n,...l?{transform:l}:{}},children:[{type:"text",value:n,name:"",attributes:{},children:[]}]}]}function TBo(e){if(e.type==="pcb_smtpad"){if(e.shape==="polygon")return p8t(e.points);if(e.shape==="circle")return{centerX:e.x,centerY:e.y,width:e.radius*2,height:e.radius*2,ccwRotation:0};return{centerX:e.x,centerY:e.y,width:e.width,height:e.height,ccwRotation:e.shape==="rotated_rect"||e.shape==="rotated_pill"?e.ccw_rotation:0}}if(e.shape==="circle")return{centerX:e.x,centerY:e.y,width:e.outer_diameter,height:e.outer_diameter,ccwRotation:0};if(e.shape==="oval"||e.shape==="pill")return{centerX:e.x,centerY:e.y,width:e.outer_width,height:e.outer_height,ccwRotation:e.ccw_rotation};if(e.shape==="hole_with_polygon_pad"){let t=p8t(e.pad_outline);if(!t)return;return{...t,centerX:e.x+t.centerX,centerY:e.y+t.centerY,ccwRotation:0}}if("rect_pad_width"in e)return{centerX:e.x,centerY:e.y,width:e.rect_pad_width,height:e.rect_pad_height,ccwRotation:e.shape==="rotated_pill_hole_with_rect_pad"?e.rect_ccw_rotation:e.shape==="circular_hole_with_rect_pad"?e.rect_ccw_rotation??0:0};return}function p8t(e){if(e.length===0)return;let t=e.map((a)=>a.x),n=e.map((a)=>a.y),o=Math.min(...t),r=Math.max(...t),i=Math.min(...n),s=Math.max(...n);return{centerX:(o+r)/2,centerY:(i+s)/2,width:r-o,height:s-i,ccwRotation:0}}function DBo(e,t){return e.map((n)=>({...n,attributes:{...n.attributes??{},"data-type":t.type,"data-pcb-layer":"overlay"}}))}function NBo(e,t,n){if(!n.shouldDrawWarnings)return[];let o=t.find((g)=>g.type==="pcb_component"&&g.pcb_component_id===e.pcb_component_id);if(!o)return[];let r=(o.rotation??0)*Math.PI/180,i=Math.cos(r),s=Math.sin(r),a=o.width/2,c=o.height/2,l=[{x:-a,y:-c},{x:a,y:-c},{x:a,y:c},{x:-a,y:c}].map((g)=>R7t.applyToPoint(n.transform,{x:o.center.x+g.x*i-g.y*s,y:o.center.y+g.x*s+g.y*i})),h=Math.min(...l.map((g)=>g.x)),d=Math.min(...l.map((g)=>g.y)),u=Math.max(...l.map((g)=>g.x)),_=Math.max(...l.map((g)=>g.y)),p=u-h,m=_-d,A=h+p/2;return DBo([{name:"rect",type:"element",value:"",attributes:{x:h.toString(),y:d.toString(),width:p.toString(),height:m.toString(),fill:"none",stroke:m8t,"stroke-width":"2","stroke-dasharray":"6,3"},children:[]},{name:"text",type:"element",value:"",attributes:{x:A.toString(),y:(d-10).toString(),fill:m8t,"font-family":"sans-serif","font-size":"12","font-weight":"600","text-anchor":"middle"},children:[{type:"text",name:"",value:e.message,attributes:{},children:[]}]}],e)}function kBo({debugObject:e,transform:t,style:n,labelStackIndex:o=0}){let r=QBo(e),i={fill:"none",stroke:Q7t,"stroke-width":n.strokeWidth.toString(),"stroke-dasharray":`${n.dashLength},${n.dashLength}`};if(e.shape==="rect"){let c=ij.applyToPoint(t,[e.center.x-e.size.width/2,e.center.y-e.size.height/2]),l=ij.applyToPoint(t,[e.center.x+e.size.width/2,e.center.y+e.size.height/2]),h=Math.min(c[0],l[0]),d=Math.min(c[1],l[1]),u=Math.abs(l[0]-c[0]),_=Math.abs(l[1]-c[1]);return[{name:"g",type:"element",value:"",attributes:r,children:[{name:"rect",type:"element",value:"",attributes:{x:h.toString(),y:d.toString(),width:u.toString(),height:_.toString(),...i},children:[]},...DFe({label:e.label,x:h,y:d-n.labelGap-o*(n.fontSize+n.labelGap),style:n})]}]}if(e.shape==="line"){let[c,l]=ij.applyToPoint(t,[e.start.x,e.start.y]),[h,d]=ij.applyToPoint(t,[e.end.x,e.end.y]);return[{name:"g",type:"element",value:"",attributes:r,children:[{name:"line",type:"element",value:"",attributes:{x1:c.toString(),y1:l.toString(),x2:h.toString(),y2:d.toString(),...i},children:[]},...DFe({label:e.label,x:(c+h)/2,y:(l+d)/2-n.labelGap,style:n,anchor:"middle"})]}]}let[s,a]=ij.applyToPoint(t,[e.center.x,e.center.y]);return[{name:"g",type:"element",value:"",attributes:r,children:[{name:"circle",type:"element",value:"",attributes:{cx:s.toString(),cy:a.toString(),r:n.pointRadius.toString(),...i},children:[]},...DFe({label:e.label,x:s+n.pointRadius+n.labelGap,y:a-n.pointRadius,style:n})]}]}function LBo(e){let t=new Map,n=new Map,o=e.filter((s)=>s.type==="pcb_board");for(let s of e)switch(s.type){case"source_group":if(n.set(s.source_group_id,s.subcircuit_id??s.parent_subcircuit_id??s.parent_source_group_id),s.is_subcircuit&&s.subcircuit_id)n.set(s.subcircuit_id,s.parent_subcircuit_id??s.parent_source_group_id);break;case"pcb_group":n.set(s.pcb_group_id,s.subcircuit_id??s.source_group_id);break;case"pcb_component":n.set(s.pcb_component_id,s.subcircuit_id??s.pcb_group_id);break;case"pcb_trace":n.set(s.pcb_trace_id,s.subcircuit_id??s.pcb_group_id??s.pcb_component_id);break;case"pcb_via":n.set(s.pcb_via_id,s.subcircuit_id??s.pcb_group_id??s.pcb_trace_id);break}for(let s of o)if(t.set(s.pcb_board_id,s),s.subcircuit_id)t.set(s.subcircuit_id,s);let r=new Set;function i(s){if(t.has(s))return t.get(s);if(r.has(s)||!n.has(s))return;r.add(s);let a=n.get(s),c=a?i(a):o.length===1?o[0]:void 0;return t.set(s,c),r.delete(s),c}for(let s of n.keys())i(s);return t}function yie(e,t){if(t?.showFabricationNotes===!1)e=e.filter((ue)=>!ue.type.startsWith("pcb_fabrication_note_"));let n=Boolean(t?.xRayElementIds?.length);if(n&&t?.hiddenLayerOpacity!==void 0&&(!Number.isFinite(t.hiddenLayerOpacity)||t.hiddenLayerOpacity<0||t.hiddenLayerOpacity>1))throw Error("hiddenLayerOpacity must be between 0 and 1");let o=!n&&(t?.drawPaddingOutsideBoard??!0),r=t?.layer,i=t?.colorOverrides,s={..._0.copper};if(i?.copper){for(let[ue,de]of Object.entries(i.copper))if(de!==void 0)s[ue]=de}let a={copper:s,drill:i?.drill??_0.drill,silkscreen:{top:i?.silkscreen?.top??_0.silkscreen.top,bottom:i?.silkscreen?.bottom??_0.silkscreen.bottom},boardOutline:i?.boardOutline??_0.boardOutline,soldermask:{top:i?.soldermask?.top??_0.soldermask.top,bottom:i?.soldermask?.bottom??_0.soldermask.bottom},soldermaskOverCopper:{top:i?.soldermaskOverCopper?.top??_0.soldermaskOverCopper.top,bottom:i?.soldermaskOverCopper?.bottom??_0.soldermaskOverCopper.bottom},soldermaskWithCopperUnderneath:{top:i?.soldermaskWithCopperUnderneath?.top??_0.soldermaskWithCopperUnderneath.top,bottom:i?.soldermaskWithCopperUnderneath?.bottom??_0.soldermaskWithCopperUnderneath.bottom},substrate:i?.substrate??_0.substrate,courtyard:{top:i?.courtyard?.top??_0.courtyard.top,bottom:i?.courtyard?.bottom??_0.courtyard.bottom},keepout:i?.keepout??_0.keepout,debugComponent:{fill:i?.debugComponent?.fill??_0.debugComponent.fill,stroke:i?.debugComponent?.stroke??_0.debugComponent.stroke}},c=e.filter((ue)=>{if(ue.type==="pcb_courtyard_rect"&&!t?.showCourtyards)return!1;if(ue.type==="pcb_soldermask_opening")return Boolean(t?.showSolderMask)&&(!r||ue.layer===r);return!0}),{minX:l,minY:h,maxX:d,maxY:u,boardMinX:_,boardMinY:p,boardMaxX:m,boardMaxY:A,hasBoardBounds:g}=vBo(c),{boundsMinX:f,boundsMinY:y,boundsMaxX:x,boundsMaxY:C,padding:b}=SBo({circuitJson:e,drawPaddingOutsideBoard:o,baseBounds:{minX:l,minY:h,maxX:d,maxY:u,boardMinX:_,boardMinY:p,boardMaxX:m,boardMaxY:A,hasBoardBounds:g},viewportOptions:{viewport:t?.viewport,viewportTarget:t?.viewportTarget}}),I=x-f+2*b,v=C-y+2*b,P=t?.width??800,M=t?.height??600;if(t?.matchBoardAspectRatio){let ue=x-f,de=C-y;if(ue>0&&de>0){let me=ue/de;if(t?.width&&!t?.height)M=t.width/me;else if(t?.height&&!t?.width)P=t.height*me;else M=P/me}}let B=[];for(let ue of e)if("route"in ue&&ue.route!==void 0)B.push(ue.route);let T=P/I,N=M/v,D=Math.min(T,N),L=(P-I*D)/2,H=(M-v*D)/2,V=BM.compose(BM.translate(L-f*D+b*D,M-H+y*D-b*D),BM.scale(D,-D)),O=Math.min(P,M),U=Math.max(1,Math.min(2,O*0.002)),j=Math.max(10,Math.min(18,O*0.02)),Y={transform:V,layer:r,shouldDrawErrors:t?.shouldDrawErrors,shouldDrawWarnings:t?.shouldDrawWarnings,showCourtyards:t?.showCourtyards,showPcbGroups:t?.showPcbGroups,drawPaddingOutsideBoard:o,colorMap:a,showSolderMask:t?.showSolderMask,showSolderPaste:t?.showSolderPaste,showPcbNotes:t?.showPcbNotes??!0,showBendLines:t?.showBendLines,showDebugObjects:t?.showDebugObjects,debugObjectStyle:{fontSize:j,strokeWidth:U,dashLength:U*4,labelGap:j*0.35,pointRadius:U*3},showAnchorOffsets:t?.showAnchorOffsets,showPinNumbers:t?.showPinNumbers,circuitJson:e,boardOwnerMap:LBo(e),usedCopperPourTraceMaskIds:new Set},X=n?[]:e.flatMap((ue)=>NFe({elm:ue,circuitJson:e,ctx:Y}));if(!n)X.push(...kMo({circuitJson:e,ctx:Y,create:(ue,de)=>NFe({elm:ue,circuitJson:e,ctx:de})}));let K=String(0.05*D);for(let ue of e)if("stroke_width"in ue){K=String(D*ue.stroke_width);break}if(!n&&t?.shouldDrawRatsNest){let ue=nBo(e,Y);X=[...X,...ue]}let J=n?sMo({circuitJson:e,ctx:Y,selectedIds:t.xRayElementIds,hiddenOpacity:t?.hiddenLayerOpacity??0.2,width:P,height:M,create:(ue,de)=>NFe({elm:ue,circuitJson:e,ctx:de})}):q8t(r7t(X)),ee=[{name:"style",type:"element",value:"",attributes:{},children:[{type:"text",value:"",name:"",attributes:{},children:[]}]}],se=uBo({grid:n?void 0:t?.grid,svgWidth:P,svgHeight:M});if(se.defs)ee.push(se.defs);if(e.some((ue)=>ue.type==="pcb_keepout"))ee.push(aBo(a.keepout??_0.keepout));let re=CMo({circuitJson:e,transform:V,svgWidth:P,svgHeight:M,usedMaskIds:Y.usedCopperPourTraceMaskIds});if(re)ee.push(re);let Z=CBo({showSolderMask:Y.showSolderMask,objects:X,layer:r??"top",width:P,height:M});if(Z)ee.push(Z);if(ee.push({name:"rect",type:"element",value:"",attributes:{class:"boundary",x:"0",y:"0",fill:t?.backgroundColor??"#000",width:P.toString(),height:M.toString(),"data-type":"pcb_background","data-pcb-layer":"global"},children:[]}),o)ee.push(HBo(V,l,h,d,u));if(ee.push(...J),t?.simulationResultId)ee.push(...TMo({circuitJson:e,resultId:t.simulationResultId,ctx:Y,options:t.returnCurrent,width:P,height:M}));if(se.rect)ee.push(se.rect);if(!n&&t?.showErrorsInTextOverlay){let ue=fj(e,"pcb_error_text_overlay");if(ue)ee.push(ue)}let te=YN(e),ie=GN,ce={name:"svg",type:"element",attributes:{xmlns:"http://www.w3.org/2000/svg",width:P.toString(),height:M.toString(),...te&&{"data-software-used-string":te},...t?.includeVersion&&{"data-circuit-to-svg-version":ie}},value:"",children:ee.filter((ue)=>ue!==null)};try{return ON(ce)}catch(ue){throw console.error("Error stringifying SVG object:",ue),ue}}function NFe({elm:e,circuitJson:t,ctx:n}){switch(e.type){case"pcb_debug_object":return n.showDebugObjects?kBo({debugObject:e,transform:n.transform,style:n.debugObjectStyle,labelStackIndex:e.shape==="rect"?t.slice(0,t.indexOf(e)).filter((r)=>r.type==="pcb_debug_object"&&r.shape==="rect"&&r.center.x===e.center.x&&r.center.y===e.center.y&&r.size.width===e.size.width&&r.size.height===e.size.height).length:0}):[];case"pcb_trace_error":return HMo(e,t,n).filter(Boolean);case"pcb_footprint_overlap_error":return OMo(e,t,n).filter(Boolean);case"pcb_courtyard_overlap_error":return VMo(e,t,n).filter(Boolean);case"pcb_component_outside_board_error":return UMo(e,t,n).filter(Boolean);case"pcb_pad_trace_clearance_error":case"pcb_via_trace_clearance_error":return JMo(e,t,n).filter(Boolean);case"pcb_connector_not_in_accessible_orientation_warning":case"pcb_manual_edit_conflict_warning":return NBo(e,t,n);case"pcb_component":return mBo(e,n).filter(Boolean);case"pcb_trace":return J8t(e,n);case"pcb_copper_pour":return hBo(e,n);case"pcb_plated_hole":return[...xwo(e,n).filter(Boolean),...u8t(e,n)];case"pcb_hole":return Zwo(e,n);case"pcb_smtpad":return[...n7t(e,n),...u8t(e,n)];case"pcb_solder_paste":return n.showSolderPaste?T7t(e,n):[];case"pcb_silkscreen_text":return Dwo(e,n);case"pcb_silkscreen_rect":return Nwo(e,n);case"pcb_silkscreen_circle":return kwo(e,n);case"pcb_silkscreen_line":return Lwo(e,n);case"pcb_silkscreen_pill":return Hwo(e,n);case"pcb_silkscreen_oval":return Fwo(e,n);case"pcb_copper_text":return Qwo(e,n);case"pcb_courtyard_rect":if(!n.showCourtyards)return[];return zwo(e,n);case"pcb_courtyard_polygon":if(!n.showCourtyards)return[];return Owo(e,n);case"pcb_courtyard_circle":if(!n.showCourtyards)return[];return Ywo(e,n);case"pcb_courtyard_outline":if(!n.showCourtyards)return[];return Vwo(e,n);case"pcb_fabrication_note_path":return ZMo(e,n);case"pcb_fabrication_note_text":return ewo(e,n);case"pcb_fabrication_note_rect":return owo(e,n);case"pcb_fabrication_note_dimension":return awo(e,n);case"pcb_note_dimension":if(!n.showPcbNotes)return[];return cwo(e,n);case"pcb_note_text":if(!n.showPcbNotes)return[];return hwo(e,n);case"pcb_note_rect":if(!n.showPcbNotes)return[];return pwo(e,n);case"pcb_note_path":if(!n.showPcbNotes)return[];return _wo(e,n);case"pcb_note_line":if(!n.showPcbNotes)return[];return Awo(e,n);case"pcb_bend":if(!n.showBendLines)return[];return ywo(e,n);case"pcb_silkscreen_path":return Cwo(e,n);case"pcb_silkscreen_graphic":return bwo(e,n);case"pcb_panel":return n.drawPaddingOutsideBoard?Jwo(e,n):[];case"pcb_board":return n.drawPaddingOutsideBoard?E7t(e,n):[];case"pcb_via":if(n.layer&&!e.layers.includes(n.layer))return[];return pze(e,n);case"pcb_cutout":let o=e;if(o.shape==="path")return rBo(o,n);return oBo(e,n);case"pcb_keepout":return cBo(e,n);case"pcb_group":return n.showPcbGroups?ABo(e,n):[];default:return[]}}function HBo(e,t,n,o,r){let[i,s]=BM.applyToPoint(e,[t,n]),[a,c]=BM.applyToPoint(e,[o,r]),l=Math.abs(a-i),h=Math.abs(c-s),d=Math.min(i,a),u=Math.min(s,c);return{name:"rect",type:"element",value:"",children:[],attributes:{class:"pcb-boundary",fill:"none",stroke:"#fff","stroke-width":"0.3",x:d.toString(),y:u.toString(),width:l.toString(),height:h.toString(),"data-type":"pcb_boundary","data-pcb-layer":"global"}}}function zBo(e){let t=/^data:([^,]*),(.*)$/s.exec(e);if(!t)throw Error("Invalid simulation asset data URL");return t[1].split(";").includes("base64")?Uint8Array.from(atob(t[2]),(n)=>n.charCodeAt(0)):new TextEncoder().encode(decodeURIComponent(t[2]))}async function _8t(e,t){if(e.url.startsWith("data:"))return zBo(e.url);if(!t.resolveAsset)throw Error(`External simulation asset '${e.project_relative_path}' requires resolveAsset`);let n=await t.resolveAsset(e);return typeof n==="string"?new TextEncoder().encode(n):n}async function OBo(e,t){o7t(e,t.simulationResultId);let n={...t.returnCurrent?.fieldData},o=await Promise.all(e.map(async(r)=>{if(!("simulation_pcb_return_current_result_id"in r)||r.simulation_pcb_return_current_result_id!==t.simulationResultId||!("layer"in r)||t.layer&&r.layer!==t.layer)return r;if(r.type==="simulation_pcb_return_current_field"){let i=pX.parse(r),s=i.simulation_pcb_return_current_field_id;if(n[s])return r;let a=await _8t(i.field_asset,t);if(i.field_asset.mimetype==="application/gzip")a=new Uint8Array(await new Response(new Blob([a]).stream().pipeThrough(new DecompressionStream("gzip"))).arrayBuffer());n[s]=mre(i).parse(JSON.parse(new TextDecoder().decode(a)))}if(r.type==="simulation_pcb_return_current_heatmap"&&t.resolveAsset&&!r.image_asset.url.startsWith("data:")){let i=gAe.parse(r.image_asset),s=await _8t(i,t),a="";for(let c of s)a+=String.fromCharCode(c);return{...r,image_asset:{...i,url:`data:${i.mimetype};base64,${btoa(a)}`}}}return r}));return yie(o,{...t,returnCurrent:{...t.returnCurrent,fieldData:n}})}function VBo(e,t,n={}){let{width:o,height:r,center:i,outline:s}=e,a;if(s&&Array.isArray(s)&&s.length>=3)a=s.map((c,l)=>{let[h,d]=sj.applyToPoint(t,[c.x,c.y]);return l===0?`M ${h} ${d}`:`L ${h} ${d}`}).join(" ");else{let c=o/2,l=r/2,h=sj.applyToPoint(t,[i.x-c,i.y-l]),d=sj.applyToPoint(t,[i.x+c,i.y-l]),u=sj.applyToPoint(t,[i.x+c,i.y+l]),_=sj.applyToPoint(t,[i.x-c,i.y+l]);a=`M ${h[0]} ${h[1]} L ${d[0]} ${d[1]} L ${u[0]} ${u[1]} L ${_[0]} ${_[1]}`}return a+=" Z",[{name:"path",type:"element",value:"",children:[],attributes:{class:"pcb-board",d:a,fill:n.fill??N1e.fill,stroke:n.stroke??N1e.stroke,"stroke-opacity":n.strokeOpacity??N1e.strokeOpacity,"stroke-width":((n.strokeWidthFactor??N1e.strokeWidthFactor)*Math.abs(t.a)).toString()}}]}function GBo(e,t){let{elm:n,portPosition:o,name:r,arePinsInterchangeable:i}=e,{transform:s}=t,{center:a,width:c,height:l,rotation:h=0,layer:d="top"}=n;if(!a||typeof c!=="number"||typeof l!=="number")return null;let[u,_]=JFe.applyToPoint(s,[a.x,a.y]),[p,m]=JFe.applyToPoint(s,[o.x,o.y]),A=c*Math.abs(s.a),g=l*Math.abs(s.d),f=d==="top",y=m>_,x=p<u,C=[UBo(A,g,h,d),WBo(A,g,r??"",s)];if(!i)C.push(XBo(A,g,h,d,y,x));return{name:"g",type:"element",value:"",attributes:{transform:`translate(${u}, ${_}) scale(1, -1)`},children:C}}function UBo(e,t,n,o){let r=e/2,i=t/2,s=0.8;return{name:"path",type:"element",attributes:{class:"assembly-component",d:jBo(r,i,n),"stroke-width":0.8 .toFixed(2),transform:`rotate(${-n})`,"stroke-dasharray":o==="bottom"?"2,2":""},value:"",children:[]}}function WBo(e,t,n,o){let r=Math.min(e,t),i=3,s=58,a=0.8,c=Math.min(58,Math.max(3,r*0.8)),l=t>e;return{name:"text",type:"element",attributes:{x:"0",y:"0",class:"assembly-component-label","text-anchor":"middle",dy:".10em",style:"pointer-events: none","font-size":`${c.toFixed(1)}px`,transform:l?"rotate(90) scale(1, -1)":"scale(1, -1)"},children:[{type:"text",value:n||"",name:"",attributes:{},children:[]}],value:""}}function XBo(e,t,n,o,r,i){let s=e/2,a=t/2,c=Math.min(s,a)*0.5,l;if(r&&i)l=[[-s,-a],[-s+c,-a],[-s,-a+c]];else if(r&&!i)l=[[s,-a],[s-c,-a],[s,-a+c]];else if(!r&&i)l=[[-s,a],[-s+c,a],[-s,a-c]];else l=[[s,a],[s-c,a],[s,a-c]];return{name:"polygon",type:"element",attributes:{class:"assembly-pin1-indicator",points:l.map((d)=>d.join(",")).join(" "),fill:"#333",stroke:"none",transform:`rotate(${-n})`},value:"",children:[]}}function jBo(e,t,n){let o=(a,c,l)=>{let h=Math.PI/180*l,d=Math.cos(h),u=Math.sin(h);return[a*d-c*u,a*u+c*d]};return`${[[-e,-t],[e,-t],[e,t],[-e,t]].map(([a,c])=>o(a,c,n)).map(([a,c],l)=>l===0?`M${a},${c}`:`L${a},${c}`).join(" ")} Z`}function KBo(e,t){let{transform:n}=t,[o,r]=k7t.applyToPoint(n,[e.x,e.y]);if(e.hole_shape==="circle"||e.hole_shape==="square"){let i=e.hole_diameter*Math.abs(n.a),s=i/2;if(e.hole_shape==="circle")return[{name:"circle",type:"element",attributes:{class:"assembly-hole",cx:o.toString(),cy:r.toString(),r:s.toString(),fill:RFe},children:[],value:""}];return[{name:"rect",type:"element",attributes:{class:"assembly-hole",x:(o-s).toString(),y:(r-s).toString(),width:i.toString(),height:i.toString(),fill:RFe},children:[],value:""}]}if(e.hole_shape==="oval"){let i=e.hole_width*Math.abs(n.a),s=e.hole_height*Math.abs(n.a),a=i/2,c=s/2;return[{name:"ellipse",type:"element",attributes:{class:"assembly-hole",cx:o.toString(),cy:r.toString(),rx:a.toString(),ry:c.toString(),fill:RFe},children:[],value:""}]}return[]}function $Bo(e,t){let{transform:n}=t,[o,r]=aie.applyToPoint(n,[e.x,e.y]);if(e.shape==="pill"){let i=e.outer_width*Math.abs(n.a),s=e.outer_height*Math.abs(n.a),a=e.hole_width*Math.abs(n.a),c=e.hole_height*Math.abs(n.a),l=i/2,h=s-i,d=a/2;return[{name:"g",type:"element",children:[{name:"path",type:"element",attributes:{class:"assembly-hole-outer",fill:jre,d:`M${o-l},${r-h/2} v${h} a${l},${l} 0 0 0 ${i},0 v-${h} a${l},${l} 0 0 0 -${i},0 z`},value:"",children:[]},{name:"path",type:"element",attributes:{class:"assembly-hole-inner",fill:Kre,d:`M${o-d},${r-(c-a)/2} v${c-a} a${d},${d} 0 0 0 ${a},0 v-${c-a} a${d},${d} 0 0 0 -${a},0 z`},value:"",children:[]}],value:"",attributes:{}}]}if(e.shape==="circle"){let i=e.outer_diameter*Math.abs(n.a),s=e.outer_diameter*Math.abs(n.a),a=e.hole_diameter*Math.abs(n.a),c=e.hole_diameter*Math.abs(n.a),l=Math.min(i,s)/2,h=Math.min(a,c)/2;return[{name:"g",type:"element",children:[{name:"circle",type:"element",attributes:{class:"assembly-hole-outer",fill:jre,cx:o.toString(),cy:r.toString(),r:l.toString()},value:"",children:[]},{name:"circle",type:"element",attributes:{class:"assembly-hole-inner",fill:Kre,cx:o.toString(),cy:r.toString(),r:h.toString()},value:"",children:[]}],value:"",attributes:{}}]}if(e.shape==="circular_hole_with_rect_pad"){let i=e,s=i.hole_diameter*Math.abs(n.a),a=i.rect_pad_width*Math.abs(n.a),c=i.rect_pad_height*Math.abs(n.a),l=(i.rect_border_radius??0)*Math.abs(n.a),h=i.rect_ccw_rotation??0,d=s/2,[u,_]=aie.applyToPoint(n,[i.x+i.hole_offset_x,i.y+i.hole_offset_y]);return[{name:"g",type:"element",children:[{name:"rect",type:"element",attributes:{class:"assembly-hole-outer-pad",fill:jre,...h?{x:(-a/2).toString(),y:(-c/2).toString(),transform:`translate(${o} ${r}) rotate(${-h})`}:{x:(o-a/2).toString(),y:(r-c/2).toString()},width:a.toString(),height:c.toString(),...l?{rx:l.toString(),ry:l.toString()}:{}},value:"",children:[]},{name:"circle",type:"element",attributes:{class:"assembly-hole-inner",fill:Kre,cx:u.toString(),cy:_.toString(),r:d.toString()},value:"",children:[]}],value:"",attributes:{}}]}if(e.shape==="pill_hole_with_rect_pad"){let i=e,s=i.rect_pad_width*Math.abs(n.a),a=i.rect_pad_height*Math.abs(n.a),c=(i.rect_border_radius??0)*Math.abs(n.a),l=i.hole_height*Math.abs(n.a),h=i.hole_width*Math.abs(n.a),d=i,u=d.hole_offset_x??0,_=d.hole_offset_y??0,[p,m]=aie.applyToPoint(n,[i.x+u,i.y+_]),A=Math.min(l,h)/2;return[{name:"g",type:"element",children:[{name:"rect",type:"element",attributes:{class:"assembly-hole-outer-pad",fill:jre,x:(o-s/2).toString(),y:(r-a/2).toString(),width:s.toString(),height:a.toString(),...c?{rx:c.toString(),ry:c.toString()}:{}},value:"",children:[]},{name:"rect",type:"element",attributes:{class:"assembly-hole-inner",fill:Kre,x:(p-h/2).toString(),y:(m-l/2).toString(),width:h.toString(),height:l.toString(),rx:A.toString(),ry:A.toString()},value:"",children:[]}],value:"",attributes:{}}]}if(e.shape==="rotated_pill_hole_with_rect_pad"){let i=e,s=i.rect_pad_width*Math.abs(n.a),a=i.rect_pad_height*Math.abs(n.a),c=(i.rect_border_radius??0)*Math.abs(n.a),l=i.hole_height*Math.abs(n.a),h=i.hole_width*Math.abs(n.a),d=i,u=d.hole_offset_x??0,_=d.hole_offset_y??0,[p,m]=aie.applyToPoint(n,[i.x+u,i.y+_]),A=Math.min(l,h)/2;return[{name:"g",type:"element",children:[{name:"rect",type:"element",attributes:{class:"assembly-hole-outer-pad",fill:jre,x:(-s/2).toString(),y:(-a/2).toString(),width:s.toString(),height:a.toString(),transform:`translate(${o} ${r}) rotate(${-i.rect_ccw_rotation})`,...c?{rx:c.toString(),ry:c.toString()}:{}},value:"",children:[]},{name:"rect",type:"element",attributes:{class:"assembly-hole-inner",fill:Kre,x:(-h/2).toString(),y:(-l/2).toString(),width:h.toString(),height:l.toString(),rx:A.toString(),ry:A.toString(),transform:`translate(${p} ${m}) rotate(${-i.hole_ccw_rotation})`},value:"",children:[]}],value:"",attributes:{}}]}return[]}function qBo(e,t){let{transform:n}=t;if(e.shape==="rect"||e.shape==="rotated_rect"){let o=e.width*Math.abs(n.a),r=e.height*Math.abs(n.d),[i,s]=cie.applyToPoint(n,[e.x,e.y]),a=(e.rect_border_radius??0)*Math.abs(n.a);if(e.shape==="rotated_rect"&&e.ccw_rotation)return[{name:"rect",type:"element",attributes:{class:"assembly-pad",fill:$re,x:(-o/2).toString(),y:(-r/2).toString(),width:o.toString(),height:r.toString(),transform:`translate(${i} ${s}) rotate(${-e.ccw_rotation})`,"data-layer":e.layer,...a?{rx:a.toString(),ry:a.toString()}:{}},value:"",children:[]}];return[{name:"rect",type:"element",attributes:{class:"assembly-pad",fill:$re,x:(i-o/2).toString(),y:(s-r/2).toString(),width:o.toString(),height:r.toString(),"data-layer":e.layer,...a?{rx:a.toString(),ry:a.toString()}:{}},value:"",children:[]}]}if(e.shape==="pill"){let o=e.width*Math.abs(n.a),r=e.height*Math.abs(n.d),i=e.radius*Math.abs(n.a),[s,a]=cie.applyToPoint(n,[e.x,e.y]);return[{name:"rect",type:"element",attributes:{class:"assembly-pad",fill:$re,x:(s-o/2).toString(),y:(a-r/2).toString(),width:o.toString(),height:r.toString(),rx:i.toString(),ry:i.toString(),"data-layer":e.layer},value:"",children:[]}]}if(e.shape==="circle"){let o=e.radius*Math.abs(n.a),[r,i]=cie.applyToPoint(n,[e.x,e.y]);return[{name:"circle",type:"element",attributes:{class:"assembly-pad",fill:$re,cx:r.toString(),cy:i.toString(),r:o.toString(),"data-layer":e.layer},value:"",children:[]}]}if(e.shape==="polygon"){let o=(e.points??[]).map((r)=>cie.applyToPoint(n,[r.x,r.y]));return[{name:"polygon",type:"element",attributes:{class:"assembly-pad",fill:$re,points:o.map((r)=>r.join(",")).join(" "),"data-layer":e.layer},value:"",children:[]}]}return[]}function JBo(e,t){let{POSITIVE_INFINITY:n,POSITIVE_INFINITY:o,NEGATIVE_INFINITY:r,NEGATIVE_INFINITY:i}=Number;for(let I of e)if(I.type==="pcb_board"){let v=I.center,P=I.width||0,M=I.height||0;n=Math.min(n,v.x-P/2),o=Math.min(o,v.y-M/2),r=Math.max(r,v.x+P/2),i=Math.max(i,v.y+M/2)}let s=1,a=r-n+2*s,c=i-o+2*s,l=t?.width??800,h=t?.height??600,d=l/a,u=h/c,_=Math.min(d,u),p=(l-a*_)/2,m=(h-c*_)/2,A=TM.compose(TM.translate(p-n*_+s*_,h-m+o*_-s*_),TM.scale(_,-_)),g={transform:A},f=e.sort((I,v)=>(g8t.indexOf(v.type)??9999)-(g8t.indexOf(I.type)??9999)).flatMap((I)=>ZBo(I,g,e)),y=YN(e),x=GN,C=[{name:"style",type:"element",children:[{type:"text",value:`
              .assembly-component { 
                fill: none; 
                stroke: #000; 
              }
              .assembly-board { 
                fill: #f2f2f2; 
                stroke: rgb(0,0,0); 
                stroke-opacity: 0.8;
              }
              .assembly-component-label { 
                fill: #000; 
                font-family: Arial, serif;
                font-weight: bold;
                dominant-baseline: middle;
                text-anchor: middle;
              }
              .assembly-boundary { 
                fill: none; 
                stroke: #fff;
                stroke-width: 0.2; 
              }
            `,name:"",attributes:{},children:[]}],value:"",attributes:{}},{name:"rect",type:"element",attributes:{fill:"#fff",x:"0",y:"0",width:l.toString(),height:h.toString()},value:"",children:[]},eTo(A,n,o,r,i),...f].filter((I)=>I!==null);if(t?.showErrorsInTextOverlay){let I=fj(e);if(I)C.push(I)}let b={name:"svg",type:"element",attributes:{xmlns:"http://www.w3.org/2000/svg",width:l.toString(),height:h.toString(),...y&&{"data-software-used-string":y},...t?.includeVersion&&{"data-circuit-to-svg-version":x}},value:"",children:C};return ON(b)}function ZBo(e,t,n){let o=Ho(n).source_component.list();switch(e.type){case"pcb_board":return VBo(e,t.transform);case"pcb_component":{let r=o.find((a)=>a.source_component_id===e.source_component_id),s=Ho(n).pcb_port.list().filter((a)=>a.pcb_component_id===e.pcb_component_id)[0];if(r&&s){let a=r.are_pins_interchangeable,c=GBo({elm:e,portPosition:{x:s.x,y:s.y},name:r.name,arePinsInterchangeable:a},t);return c?[c]:[]}return[]}case"pcb_smtpad":return qBo(e,t);case"pcb_hole":return KBo(e,t);case"pcb_plated_hole":return $Bo(e,t);default:return[]}}function eTo(e,t,n,o,r){let[i,s]=TM.applyToPoint(e,[t,n]),[a,c]=TM.applyToPoint(e,[o,r]),l=Math.abs(a-i),h=Math.abs(c-s),d=Math.min(i,a),u=Math.min(s,c);return{name:"rect",type:"element",value:"",children:[],attributes:{class:"assembly-boundary",x:d.toString(),y:u.toString(),width:l.toString(),height:h.toString()}}}function oTo(e,t){let{transform:n,soup:o}=t,{width:r,height:i,center:s,outline:a}=e,l=o.find((_)=>_.type==="source_board"&&_.title)?.title,h;if(a&&Array.isArray(a)&&a.length>=3)h=a.map((_,p)=>{let[m,A]=s7.applyToPoint(n,[_.x,_.y]);return p===0?`M ${m} ${A}`:`L ${m} ${A}`}).join(" ");else{let _=r/2,p=i/2,m=s7.applyToPoint(n,[s.x-_,s.y-p]),A=s7.applyToPoint(n,[s.x+_,s.y-p]),g=s7.applyToPoint(n,[s.x+_,s.y+p]),f=s7.applyToPoint(n,[s.x-_,s.y+p]);h=`M ${m[0]} ${m[1]} L ${A[0]} ${A[1]} L ${g[0]} ${g[1]} L ${f[0]} ${f[1]}`}h+=" Z";let d=Ho(o).pcb_cutout.list();for(let _ of d)if(_.shape==="rect"){let{x:p,y:m,width:A,height:g}=_.center?(()=>{let{x:v,y:P}=_.center,{width:M,height:B}=_;return{x:v,y:P,width:M,height:B}})():{x:0,y:0,width:0,height:0},f=A/2,y=g/2,[x,C,b,I]=[s7.applyToPoint(n,[p-f,m-y]),s7.applyToPoint(n,[p+f,m-y]),s7.applyToPoint(n,[p+f,m+y]),s7.applyToPoint(n,[p-f,m+y])];h+=` M ${x[0]} ${x[1]} L ${C[0]} ${C[1]} L ${b[0]} ${b[1]} L ${I[0]} ${I[1]} Z`}else if(_.shape==="circle");let u=[{name:"path",type:"element",value:"",children:[],attributes:{class:"pinout-board",d:h,fill:tTo,stroke:nTo,"fill-rule":"evenodd","stroke-opacity":"0.8","stroke-width":(0.2*Math.abs(n.a)).toString()}}];if(l){let _=t.svgWidth/2,p=30;u.push({name:"text",type:"element",value:"",children:[{name:"",type:"text",value:l,attributes:{},children:[]}],attributes:{x:_.toString(),y:30 .toString(),"text-anchor":"middle","font-size":"18px","font-weight":"bold","font-family":"Arial, sans-serif",fill:"black",class:"pinout-board-title"}})}return u}function sTo(e,t){let{transform:n,soup:o}=t,{center:r,width:i,height:s,rotation:a=0,source_component_id:c}=e,l=Ho(o).source_component.get(c);if(!r||typeof i!=="number"||typeof s!=="number"||i===0||s===0)return[];let[h,d]=L7t.applyToPoint(n,[r.x,r.y]),u=i*Math.abs(n.a),_=s*Math.abs(n.d),p=`translate(${h}, ${d})`,m=[{name:"rect",type:"element",attributes:{class:"pinout-component-box",x:(-u/2).toString(),y:(-_/2).toString(),width:u.toString(),height:_.toString(),fill:rTo,transform:`rotate(${a}deg)`},value:"",children:[]}];if(l?.name){let A=Math.min(u,_)*0.4;m.push({name:"text",type:"element",attributes:{x:"0",y:"0",fill:iTo,"font-size":`${A}px`,"font-family":"sans-serif","text-anchor":"middle","dominant-baseline":"middle"},children:[{type:"text",value:l.name,name:"",attributes:{},children:[]}],value:""})}return[{name:"g",type:"element",attributes:{transform:p},children:m,value:""}]}function aTo(e,t){let{transform:n}=t,[o,r]=H7t.applyToPoint(n,[e.x,e.y]);if(e.hole_shape==="circle"||e.hole_shape==="square"){let i=e.hole_diameter*Math.abs(n.a),s=i/2;if(e.hole_shape==="circle")return[{name:"circle",type:"element",attributes:{class:"pinout-hole",cx:o.toString(),cy:r.toString(),r:s.toString(),fill:QFe},children:[],value:""}];return[{name:"rect",type:"element",attributes:{class:"pinout-hole",x:(o-s).toString(),y:(r-s).toString(),width:i.toString(),height:i.toString(),fill:QFe},children:[],value:""}]}if(e.hole_shape==="oval"){let i=e.hole_width*Math.abs(n.a),s=e.hole_height*Math.abs(n.a),a=i/2,c=s/2;return[{name:"ellipse",type:"element",attributes:{class:"pinout-hole",cx:o.toString(),cy:r.toString(),rx:a.toString(),ry:c.toString(),fill:QFe},children:[],value:""}]}return[]}function cTo(e,t){let{transform:n}=t,[o,r]=F7t.applyToPoint(n,[e.x,e.y]);if(e.shape==="pill"){let i=e.outer_width*Math.abs(n.a),s=e.outer_height*Math.abs(n.a),a=e.hole_width*Math.abs(n.a),c=e.hole_height*Math.abs(n.a),l=i/2,h=s-i,d=a/2;return[{name:"g",type:"element",children:[{name:"path",type:"element",attributes:{class:"pinout-hole-outer",fill:qre,d:`M${o-l},${r-h/2} v${h} a${l},${l} 0 0 0 ${i},0 v-${h} a${l},${l} 0 0 0 -${i},0 z`},value:"",children:[]},{name:"path",type:"element",attributes:{class:"pinout-hole-inner",fill:Jre,d:`M${o-d},${r-(c-a)/2} v${c-a} a${d},${d} 0 0 0 ${a},0 v-${c-a} a${d},${d} 0 0 0 -${a},0 z`},value:"",children:[]}],value:"",attributes:{}}]}if(e.shape==="circle"){let i=e.outer_diameter*Math.abs(n.a),s=e.outer_diameter*Math.abs(n.a),a=e.hole_diameter*Math.abs(n.a),c=e.hole_diameter*Math.abs(n.a),l=Math.min(i,s)/2,h=Math.min(a,c)/2;return[{name:"g",type:"element",children:[{name:"circle",type:"element",attributes:{class:"pinout-hole-outer",fill:qre,cx:o.toString(),cy:r.toString(),r:l.toString()},value:"",children:[]},{name:"circle",type:"element",attributes:{class:"pinout-hole-inner",fill:Jre,cx:o.toString(),cy:r.toString(),r:h.toString()},value:"",children:[]}],value:"",attributes:{}}]}if(e.shape==="circular_hole_with_rect_pad"){let i=e.hole_diameter*Math.abs(n.a),s=e.rect_pad_width*Math.abs(n.a),a=e.rect_pad_height*Math.abs(n.a),c=i/2;return[{name:"g",type:"element",children:[{name:"rect",type:"element",attributes:{class:"pinout-hole-outer-pad",fill:qre,x:(o-s/2).toString(),y:(r-a/2).toString(),width:s.toString(),height:a.toString()},value:"",children:[]},{name:"circle",type:"element",attributes:{class:"pinout-hole-inner",fill:Jre,cx:o.toString(),cy:r.toString(),r:c.toString()},value:"",children:[]}],value:"",attributes:{}}]}if(e.shape==="pill_hole_with_rect_pad"){let i=e.rect_pad_width*Math.abs(n.a),s=e.rect_pad_height*Math.abs(n.a),a=e.hole_height*Math.abs(n.a),c=e.hole_width*Math.abs(n.a),l=Math.min(a,c)/2;return[{name:"g",type:"element",children:[{name:"rect",type:"element",attributes:{class:"pinout-hole-outer-pad",fill:qre,x:(o-i/2).toString(),y:(r-s/2).toString(),width:i.toString(),height:s.toString()},value:"",children:[]},{name:"rect",type:"element",attributes:{class:"pinout-hole-inner",fill:Jre,x:(o-c/2).toString(),y:(r-a/2).toString(),width:c.toString(),height:a.toString(),rx:l.toString(),ry:l.toString()},value:"",children:[]}],value:"",attributes:{}}]}if(e.shape==="rotated_pill_hole_with_rect_pad"){let i=e.rect_pad_width*Math.abs(n.a),s=e.rect_pad_height*Math.abs(n.a),a=e.hole_height*Math.abs(n.a),c=e.hole_width*Math.abs(n.a),l=Math.min(a,c)/2;return[{name:"g",type:"element",children:[{name:"rect",type:"element",attributes:{class:"pinout-hole-outer-pad",fill:qre,x:(-i/2).toString(),y:(-s/2).toString(),width:i.toString(),height:s.toString(),transform:`translate(${o} ${r}) rotate(${-e.rect_ccw_rotation})`},value:"",children:[]},{name:"rect",type:"element",attributes:{class:"pinout-hole-inner",fill:Jre,x:(-c/2).toString(),y:(-a/2).toString(),width:c.toString(),height:a.toString(),rx:l.toString(),ry:l.toString(),transform:`translate(${o} ${r}) rotate(${-e.hole_ccw_rotation})`},value:"",children:[]}],value:"",attributes:{}}]}return[]}function lTo(e,t){let{transform:n}=t;if(e.shape==="rect"||e.shape==="rotated_rect"){let o=e.width*Math.abs(n.a),r=e.height*Math.abs(n.d),[i,s]=lie.applyToPoint(n,[e.x,e.y]);if(e.shape==="rotated_rect"&&e.ccw_rotation)return[{name:"rect",type:"element",attributes:{class:"pinout-pad",fill:Zre,x:(-o/2).toString(),y:(-r/2).toString(),width:o.toString(),height:r.toString(),transform:`translate(${i} ${s}) rotate(${-e.ccw_rotation})`,"data-layer":e.layer},value:"",children:[]}];return[{name:"rect",type:"element",attributes:{class:"pinout-pad",fill:Zre,x:(i-o/2).toString(),y:(s-r/2).toString(),width:o.toString(),height:r.toString(),"data-layer":e.layer},value:"",children:[]}]}if(e.shape==="pill"){let o=e.width*Math.abs(n.a),r=e.height*Math.abs(n.d),i=e.radius*Math.abs(n.a),[s,a]=lie.applyToPoint(n,[e.x,e.y]);return[{name:"rect",type:"element",attributes:{class:"pinout-pad",fill:Zre,x:(s-o/2).toString(),y:(a-r/2).toString(),width:o.toString(),height:r.toString(),rx:i.toString(),ry:i.toString(),"data-layer":e.layer},value:"",children:[]}]}if(e.shape==="circle"){let o=e.radius*Math.abs(n.a),[r,i]=lie.applyToPoint(n,[e.x,e.y]);return[{name:"circle",type:"element",attributes:{class:"pinout-pad",fill:Zre,cx:r.toString(),cy:i.toString(),r:o.toString(),"data-layer":e.layer},value:"",children:[]}]}if(e.shape==="polygon"){let o=(e.points??[]).map((r)=>lie.applyToPoint(n,[r.x,r.y]));return[{name:"polygon",type:"element",attributes:{class:"pinout-pad",fill:Zre,points:o.map((r)=>r.join(",")).join(" "),"data-layer":e.layer},value:"",children:[]}]}return[]}function kFe(e){let{rectX:t,rectY:n,rectWidth:o,rectHeight:r,textX:i,textY:s,text:a,fontSize:c,labelBackground:l,labelColor:h,rx:d=4,ry:u=4,fontFamily:_="Arial, sans-serif",fontWeight:p="bold",textAnchor:m="middle",dominantBaseline:A="middle"}=e;return[{name:"rect",type:"element",attributes:{x:t.toString(),y:n.toString(),width:o.toString(),height:r.toString(),fill:l,rx:typeof d==="number"?d.toString():d,ry:typeof u==="number"?u.toString():u,stroke:"none"},children:[],value:""},{name:"text",type:"element",attributes:{x:i.toString(),y:s.toString(),fill:h,"font-size":`${c}px`,"font-family":_,"font-weight":p,"text-anchor":m,"dominant-baseline":A},children:[{type:"text",value:a,name:"",attributes:{},children:[]}],value:""}]}function pTo(e,t){let n=t.label_positions.get(e.pcb_port_id);if(!n)return[];let{text:o,aliases:r,elbow_end:i,label_pos:s,edge:a}=n,[c,l]=z7t.applyToPoint(t.transform,[e.x,e.y]),h=a==="left"?"x-":a==="right"?"x+":a==="top"?"y-":"y+",d=a==="left"?"x+":a==="right"?"x-":a==="top"?"y+":"y-",u=oz({x:c,y:l,facingDirection:h},{x:i.x,y:i.y,facingDirection:d},{}),_=/^pin(\d+)$/i.exec(o),p=[{text:_?_[1]:o,bg:_?dTo:f8t,color:_?uTo:A8t},...r.map((L)=>({text:L,bg:f8t,color:A8t}))],m=Math.abs(t.transform.a),A=t.styleScale??1,f=1.6*A*m,y=Math.max(0.08,0.25*A),C=0.3*A*m,b=y*m,I={x:s.x+(a==="left"?-b/2:b/2),y:s.y},v=[...u,I].map((L)=>`${L.x},${L.y}`).join(" "),P=f*0.5238095238095238,M=(f-P)/2,B=M,T=p.map(({text:L,bg:H,color:V})=>{let O=L??"",j=O.length*P*0.6+2*M;return{text:O,rectWidth:j,bg:H,color:V}}),N=s.y,D=[{name:"polyline",type:"element",attributes:{points:v,stroke:hTo,"stroke-width":(y*m).toString(),fill:"none"},children:[],value:""}];if(a==="left"){let L=s.x;for(let{text:H,rectWidth:V,bg:O,color:U}of T){let j=L-V,Y=j+V/2;D.push(...kFe({rectX:j,rectY:N-f/2,rectWidth:V,rectHeight:f,textX:Y,textY:N,text:H,fontSize:P,labelBackground:O,labelColor:U,rx:C,ry:C})),L=j-B}}else if(a==="right"){let L=s.x;for(let{text:H,rectWidth:V,bg:O,color:U}of T){let j=L,Y=j+V/2;D.push(...kFe({rectX:j,rectY:N-f/2,rectWidth:V,rectHeight:f,textX:Y,textY:N,text:H,fontSize:P,labelBackground:O,labelColor:U,rx:C,ry:C})),L=j+V+B}}else{let L=T.reduce((V,O)=>V+O.rectWidth,0)+B*Math.max(0,T.length-1),H=s.x-L/2;for(let{text:V,rectWidth:O,bg:U,color:j}of T){let Y=H,X=Y+O/2;D.push(...kFe({rectX:Y,rectY:N-f/2,rectWidth:O,rectHeight:f,textX:X,textY:N,text:V,fontSize:P,labelBackground:U,labelColor:j,rx:C,ry:C})),H=Y+O+B}}return D}function y8t(e,t,{transform:n,soup:o,board_bounds:r,svgHeight:i,styleScale:s},a){let c=t.map((D)=>D.pcb_port.x),l={};for(let D of c){let L=D.toFixed(1);l[L]=(l[L]||0)+1}let h;if(Object.keys(l).length>1&&t.length>2){let D=Object.entries(l).sort((X,K)=>K[1]-X[1]),L=parseFloat(D[0][0]),H=t.filter((X)=>Math.abs(X.pcb_port.x-L)<0.2),V=t.filter((X)=>Math.abs(X.pcb_port.x-L)>=0.2),O=(X)=>({pcb_port:X.pcb_port,y:U1e.applyToPoint(n,[X.pcb_port.x,X.pcb_port.y])[1],aliases:X.aliases});H.sort((X,K)=>K.pcb_port.y-X.pcb_port.y),V.sort((X,K)=>K.pcb_port.y-X.pcb_port.y);let U=H.length>0?Math.max(...H.map((X)=>X.pcb_port.y)):-1/0;h=((V.length>0?Math.max(...V.map((X)=>X.pcb_port.y)):-1/0)>U?[...V,...H]:[...H,...V]).map(O)}else h=t.map((D)=>({pcb_port:D.pcb_port,y:U1e.applyToPoint(n,[D.pcb_port.x,D.pcb_port.y])[1],aliases:D.aliases})).sort((D,L)=>D.y-L.y);if(h.length===0)return;let d=U1e.applyToPoint(n,[e==="left"?r.minX:r.maxX,0])[0],u=h.length,_={};for(let D of t){let L=D.pcb_port.x.toFixed(1);_[L]=(_[L]||0)+1}let p=new Set;if(Object.keys(_).length>1&&t.length>2){let D=Object.entries(_).sort((V,O)=>O[1]-V[1]),L=parseFloat(D[0][0]),H=t.filter((V)=>Math.abs(V.pcb_port.x-L)<0.2);p=new Set(H.map((V)=>V.pcb_port.pcb_port_id))}let m=h.map((D,L)=>{if(p.has(D.pcb_port.pcb_port_id))return L;return-1}).filter((D)=>D!==-1),A=(u-1)/2,g=Math.abs(n.a),f=O7t*s*g,y=0.3,x=Math.max(0.2*g,y*s*g),C=gTo*s*g,b=(V7t+u*Y7t)*s*g,v=b+A*(ZFe*s*g)+G7t*s*g,P=u-m.length,M=m.length===0?u:P,B=M*f+Math.max(0,M-1)*x,T;if(m.length>0&&P>0){let D=m.map((Y)=>h[Y].y),L=Math.min(...D),H=Math.max(...D),V=L-f/2,O=H+f/2;if(h.map((Y,X)=>X).filter((Y)=>!m.includes(Y))[0]<m[0])T=V-(x*2+C)-B+f/2;else T=O+(x*2+C)+f/2}else T=(i-B)/2+f/2;let N=m.length===u;h.forEach(({pcb_port:D,aliases:L},H)=>{let V;if(m.length>0)if(m.includes(H))V=A;else{let J=Math.min(...m),ee=Math.max(...m),se;if(H<J)se=J-H;else se=H-ee;V=A-se}else{let J=Math.abs(H-A);V=A-J}let O=b+V*(ZFe*s*g),U=e==="left"?-1:1,j=m.includes(H),Y=N?h[H].y:m.length>0&&j?h[H].y:T,X={x:d+U*O,y:Y},K={x:d+U*v,y:Y};if(a.set(D.pcb_port_id,{text:L[0],aliases:L.slice(1),elbow_end:X,label_pos:K,edge:e}),!(m.length>0&&j))T+=f+x})}function fTo(e,t){let n=Ho(t).source_port.get(e.source_port_id);if(!n)return null;let o=n.port_hints?.filter((s)=>!/^\d+$/.test(s)&&!["left","right","top","bottom"].includes(s))??[],r=o[0];if(!r)r=n.name;if(!r)return null;let i=o.filter((s)=>s!==r);return{text:r,aliases:i}}function yTo(e,t){let n={left:e.x-t.minX,right:t.maxX-e.x,top:t.maxY-e.y,bottom:e.y-t.minY},o="left",r=n.left;if(n.right<r)r=n.right,o="right";if(n.top<r)r=n.top,o="top";if(n.bottom<r)r=n.bottom,o="bottom";return o}function xTo(e,t){let{POSITIVE_INFINITY:n,POSITIVE_INFINITY:o,NEGATIVE_INFINITY:r,NEGATIVE_INFINITY:i}=Number;for(let ce of e)if(ce.type==="pcb_board")if("outline"in ce&&ce.outline&&Array.isArray(ce.outline)&&ce.outline.length>0)for(let ue of ce.outline)n=Math.min(n,ue.x),o=Math.min(o,ue.y),r=Math.max(r,ue.x),i=Math.max(i,ue.y);else{let ue=ce.center,de=ce.width||0,me=ce.height||0;n=Math.min(n,ue.x-de/2),o=Math.min(o,ue.y-me/2),r=Math.max(r,ue.x+de/2),i=Math.max(i,ue.y+me/2)}let s=2,a=t?.width??1200,c=t?.height??768,l=e.find((ce)=>ce.type==="source_board"&&!!ce.title)?.title,h={minX:n,minY:o,maxX:r,maxY:i},d=e.filter((ce)=>ce.type==="pcb_port"&&ce.is_board_pinout),u=[];for(let ce of d){let ue=fTo(ce,e);if(!ue)continue;let de=yTo({x:ce.x,y:ce.y},h);u.push({pcb_port:ce,aliases:[ue.text,...ue.aliases],edge:de})}let _=u.filter((ce)=>ce.edge==="left"),p=u.filter((ce)=>ce.edge==="right"),m=u.filter((ce)=>ce.edge==="top"),A=u.filter((ce)=>ce.edge==="bottom"),g=(n+r)/2;if(m.length>0)if(m.filter((ue)=>ue.pcb_port.x<g).length>m.length/2)_.push(...m);else p.push(...m);if(A.length>0)if(A.filter((ue)=>ue.pcb_port.x<g).length>A.length/2)_.push(...A);else p.push(...A);let y=e.filter((ce)=>ce.type==="pcb_smtpad").map((ce)=>{if(typeof ce.height==="number")return ce.height;if(typeof ce.radius==="number")return ce.radius*2;return}).filter((ce)=>Number.isFinite(ce)),x=y.length?y.reduce((ce,ue)=>ce+ue,0)/y.length:void 0,b=x?Math.max(0.5,Math.min(1,x/1)):1,I=O7t*b;function v(ce){let ue=[...ce.aliases??[]];if(ue.length===0)return ue;let de=/^pin(\d+)$/i.exec(ue[0]);if(de)ue[0]=de[1];return ue}function P(ce){if(ce.length===0)return 0;let ue=I,de=ue*mTo,me=(ue-de)/2,ge=me;return ce.map((Re)=>(Re??"").length*de*_To+2*me).reduce((Re,Me)=>Re+Me,0)+ge*Math.max(0,ce.length-1)}function M(ce){if(ce<=0)return 0;let ue=(ce-1)/2;return(V7t+ce*Y7t)*b+ue*(ZFe*b)+G7t*b}let B=Math.max(0,..._.map((ce)=>P(v(ce)))),T=Math.max(0,...p.map((ce)=>P(v(ce)))),N=M(_.length)+B,D=M(p.length)+T,L=n-N,V=r+D-L+2*s,O=i-o+2*s,U=a/V,j=c/O,Y=Math.min(U,j),X=(a-V*Y)/2,K=(c-O*Y)/2,J=yj.compose(yj.translate(X-L*Y+s*Y,c-K+o*Y-s*Y),yj.scale(Y,-Y)),ee=ATo({left_labels:_,right_labels:p,transform:J,soup:e,board_bounds:h,svgWidth:a,svgHeight:c,styleScale:b}),se={transform:J,soup:e,board_bounds:h,styleScale:b,label_positions:ee,svgWidth:a,svgHeight:c},ne=e.sort((ce,ue)=>(x8t.indexOf(ce.type)??9999)-(x8t.indexOf(ue.type)??9999)).flatMap((ce)=>CTo(ce,se,e)),re=YN(e),Z=GN,te=[{name:"rect",type:"element",attributes:{fill:"rgb(255, 255, 255)",x:"0",y:"0",width:a.toString(),height:c.toString()},value:"",children:[]},...ne].filter((ce)=>ce!==null);if(t?.showErrorsInTextOverlay){let ce=fj(e);if(ce)te.push(ce)}let ie={name:"svg",type:"element",attributes:{xmlns:"http://www.w3.org/2000/svg",width:a.toString(),height:c.toString(),...re&&{"data-software-used-string":re},...t?.includeVersion&&{"data-circuit-to-svg-version":Z}},value:"",children:te};return ON(ie)}function CTo(e,t,n){switch(e.type){case"pcb_board":return oTo(e,t);case"pcb_component":return sTo(e,t);case"pcb_smtpad":return lTo(e,t);case"pcb_hole":return aTo(e,t);case"pcb_plated_hole":return cTo(e,t);case"pcb_port":if(e.is_board_pinout)return pTo(e,t);return[];default:return[]}}function bTo(e){let{minX:t,minY:n,maxX:o,maxY:r}=e.bounds,i=e.cellSize??1,s=e.labelCells??!1,a=[],c=(l,h)=>{let[d,u]=U7t.applyToPoint(e.transform,[l,h]);return{x:d,y:u}};for(let l=Math.floor(t);l<=Math.ceil(o);l+=i){let h=c(l,n),d=c(l,r);a.push({name:"line",type:"element",attributes:{x1:h.x.toString(),y1:h.y.toString(),x2:d.x.toString(),y2:d.y.toString(),stroke:Zh.schematic.grid,"stroke-width":(0.01*Math.abs(e.transform.a)).toString(),"stroke-opacity":"0.5"}})}for(let l=Math.floor(n);l<=Math.ceil(r);l+=i){let h=c(t,l),d=c(o,l);a.push({name:"line",type:"element",attributes:{x1:h.x.toString(),y1:h.y.toString(),x2:d.x.toString(),y2:d.y.toString(),stroke:Zh.schematic.grid,"stroke-width":(0.01*Math.abs(e.transform.a)).toString(),"stroke-opacity":"0.5"}})}if(s){let l=(h,d)=>{if(i<=0.1)return`${h.toFixed(1)},${d.toFixed(1)}`;return`${h},${d}`};for(let h=Math.floor(t);h<=Math.ceil(o);h+=i)for(let d=Math.floor(n);d<=Math.ceil(r);d+=i){let u=c(h,d);a.push({name:"text",type:"element",attributes:{x:(u.x-2.5).toString(),y:(u.y-5).toString(),fill:Zh.schematic.grid,"font-size":(i/5*Math.abs(e.transform.a)).toString(),"fill-opacity":"0.5","text-anchor":"middle","dominant-baseline":"middle","font-family":"sans-serif"},children:[{type:"text",value:l(h,d),name:"",attributes:{},children:[]}]})}}return{name:"g",value:"",type:"element",attributes:{class:"grid sch-grid"},children:a}}function ITo(e){let{points:t,transform:n}=e,o=[];for(let r of t){let[i,s]=aj.applyToPoint(n,[r.x-0.1,r.y-0.1]),[a,c]=aj.applyToPoint(n,[r.x+0.1,r.y+0.1]),[l,h]=aj.applyToPoint(n,[r.x-0.1,r.y+0.1]),[d,u]=aj.applyToPoint(n,[r.x+0.1,r.y-0.1]);o.push({name:"path",type:"element",attributes:{d:`M${i},${s} L${a},${c} M${l},${h} L${d},${u}`,stroke:Zh.schematic.grid,"stroke-width":(0.02*Math.abs(n.a)).toString(),"stroke-opacity":"0.7"}});let[_,p]=aj.applyToPoint(n,[r.x+0.15,r.y-0.15]);o.push({name:"text",type:"element",attributes:{x:_.toString(),y:p.toString(),fill:Zh.schematic.grid,"font-size":(0.1*Math.abs(n.a)).toString(),"fill-opacity":"0.7","text-anchor":"start","font-family":"sans-serif","dominant-baseline":"middle"},children:[{type:"text",value:r.label||`(${r.x},${r.y})`,name:"",attributes:{},children:[]}]})}return{name:"g",value:"",type:"element",attributes:{class:"labeled-points sch-labeled-points"},children:o}}function vTo(e){return e.reduce((t,n)=>{if(!t)return n;if(n.sheet_index===void 0)return t;if(t.sheet_index===void 0)return n;return n.sheet_index<t.sheet_index?n:t},void 0)}function j1e(e){return _ie(e.text||"")+(e.display_superscript?X7t+_ie(e.display_superscript)*W7t:0)}function Aze(e,t,n,o="central"){let r=[{type:"text",value:e,name:"",attributes:{},children:[]}];if(t)r.push({type:"element",name:"tspan",value:"",attributes:{class:"sch-net-label-superscript","font-size":`${n*W7t}px`,dx:`${n*X7t}`,dy:`${-n*(o==="ideographic"?0.5:0.25)}`},children:[{type:"text",value:t,name:"",attributes:{},children:[]}]});return r}function PTo(e){return{left:180,top:90,bottom:-90,right:0}[e]??0}function ETo(e,t,n){let o=n+HN*2+gj*e.text.length+_j,r=xj(e.anchor_side);return e.anchor_position??{x:e.center.x-r.x*o*t/2,y:e.center.y-r.y*o*t/2}}function q7t(e,t,n,o){let r=Math.sqrt((n.x-e.x)**2+(n.y-e.y)**2),s=Math.sqrt((o.x-t.x)**2+(o.y-t.y)**2)/r,a=t.x-s*e.x,c=t.y-s*e.y,l=Cj.translate(a,c),h=Cj.scale(s,s);return Cj.compose(l,h)}function wTo(e){let t=[],n=new Map,o=new Map,r=null;for(let i of e)if(i.type==="schematic_component")t.push(i);else if(i.type==="schematic_port"&&i.schematic_component_id){let s=n.get(i.schematic_component_id)??[];s.push(i),n.set(i.schematic_component_id,s)}else if(i.type==="source_component")o.set(i.source_component_id,i);for(let i of t){let s=BTo({component:i,schematicPorts:n.get(i.schematic_component_id)??[],sourceComponent:i.source_component_id?o.get(i.source_component_id):void 0});if(!s)continue;r=r?Z7t(r,s):s}return r}function BTo({component:e,schematicPorts:t,sourceComponent:n}){if(!e.symbol_name)return null;let o=Es[e.symbol_name];if(!o)return null;let r=$7t({schPorts:t,symbol:o,schComponent:e});if(!r[0])return null;let i=q7t(r[1]?.symbolPort??o.center,r[1]?.schPort.center??e.center,r[0].symbolPort,r[0].schPort.center),s=null;for(let a of o.primitives){if(a.type!=="text")continue;let c=TTo({primitive:a,component:e,sourceComponent:n});if(!c)continue;let l=J7t.applyToPoint(i,a),h=FN("reference_designator"),d=DTo({x:l.x,y:l.y,width:_ie(c)*h,height:h,anchor:a.anchor});s=s?Z7t(s,d):d}return s}function TTo({primitive:e,component:t,sourceComponent:n}){if(e.text==="{REF}")return n?.display_name??n?.name??"";if(e.text==="{VAL}")return t.symbol_display_value??"";return""}function DTo({x:e,y:t,width:n,height:o,anchor:r}){let i=e,s=e,a=t-o/2,c=t+o/2;if(r.includes("left"))s=e+n;else if(r.includes("right"))i=e-n;else i=e-n/2,s=e+n/2;if(r.includes("top"))a=t-o,c=t;else if(r.includes("bottom"))a=t,c=t+o;return{minX:i,minY:a,maxX:s,maxY:c}}function Z7t(e,t){return{minX:Math.min(e.minX,t.minX),minY:Math.min(e.minY,t.minY),maxX:Math.max(e.maxX,t.maxX),maxY:Math.max(e.maxY,t.maxY)}}function bj(e={}){let t=e.center??{x:0,y:0},n=e.sheet_width===void 0?QTo:e.sheet_width/zN,o=e.sheet_height===void 0?kTo:e.sheet_height/zN,r=t.x-n/2,i=t.x+n/2,s=t.y-o/2,a=t.y+o/2;return{center:t,width:n,height:o,minX:r,maxX:i,minY:s,maxY:a,innerMinX:r+R1e,innerMaxX:i-R1e,innerMinY:s+R1e,innerMaxY:a-R1e}}function tSt(e,t=0.5){let{POSITIVE_INFINITY:n,POSITIVE_INFINITY:o,NEGATIVE_INFINITY:r,NEGATIVE_INFINITY:i}=Number,s=0.2;for(let l of e)if(l.type==="schematic_sheet"){let h=bj(l);c(h.center,{width:h.width,height:h.height},0)}else if(l.type==="schematic_component")c(l.center,l.size,0);else if(l.type==="schematic_port")c(l.center,{width:s,height:s},0);else if(l.type==="schematic_debug_object"){if(l.shape==="rect")c(l.center,l.size,0);else if(l.shape==="line")c(l.start,{width:0.1,height:0.1},0),c(l.end,{width:0.1,height:0.1},0)}else if(l.type==="schematic_net_label"){let h=FN("net_label"),d=j1e(l),_=(d+HN*2+gj*(l.text?.length||0)+_j)*h,p=j7t,m=PTo(l.anchor_side)/180*Math.PI,A=ETo(l,h,d),g=xj(l.anchor_side),f={x:A.x+g.x*_/2,y:A.y+g.y*_/2};c(f,{width:_,height:p},m)}else if(l.type==="schematic_trace")for(let h of l.edges)c(h.from,{width:0.1,height:0.1},0),c(h.to,{width:0.1,height:0.1},0);else if(l.type==="schematic_text"){let d=FN("reference_designator",l.font_size)??0.18,u=l.text??"",_=l.display_superscript;if(_){let p=u.split(`
`),m=Math.max(...p.map((b,I)=>j1e({text:b,display_superscript:I===p.length-1?_:void 0})))*d,A=l.anchor,g=A==="left"||A.endsWith("_left")?m/2:A==="right"||A.endsWith("_right")?-m/2:0,f=A==="top"||A.startsWith("top_")?0:A==="bottom"||A.startsWith("bottom_")?-d:-d/2,y=(p.length+0.3)*d,x=-(f-0.3*d+y/2),C=-(l.rotation??0)*Math.PI/180;c({x:l.position.x+g*Math.cos(C)-x*Math.sin(C),y:l.position.y+g*Math.sin(C)+x*Math.cos(C)},{width:m,height:y},C)}else{let p=u.length*d,m=d;c(l.position,{width:p,height:m},l.rotation??0)}}else if(l.type==="schematic_voltage_probe"){if(c(l.position,{width:0.2,height:0.4},0),l.name){let h=FN("net_label"),d=_ie(l.name)*h,u=h,_=0.3,p=l.label_alignment??"top_right",m=l.position.x,A=l.position.y;if(p.includes("top"))A+=0.3+u/2;else if(p.includes("bottom"))A-=0.3+u/2;if(p.includes("right"))m+=0.3+d/2;else if(p.includes("left"))m-=0.3+d/2;c({x:m,y:A},{width:d,height:u},0)}}else if(l.type==="schematic_box")c({x:l.x+l.width/2,y:l.y+l.height/2},{width:l.width,height:l.height},0);else if(l.type==="schematic_table"){let{column_widths:h,row_heights:d}=eSt(l,e),u=h.reduce((y,x)=>y+x,0),_=d.reduce((y,x)=>y+x,0),p=l.anchor??"center",m=l.anchor_position.x,A=l.anchor_position.y;if(p.includes("center"))m-=u/2;else if(p.includes("right"))m-=u;if(p.includes("center"))A+=_/2;else if(p.includes("bottom"))A+=_;let g=m+u/2,f=A-_/2;c({x:g,y:f},{width:u,height:_},0)}else if(l.type==="schematic_line")c({x:l.x1,y:l.y1},{width:0.02,height:0.02},0),c({x:l.x2,y:l.y2},{width:0.02,height:0.02},0);else if(l.type==="schematic_circle")c(l.center,{width:l.radius*2,height:l.radius*2},0);else if(l.type==="schematic_rect")c(l.center,{width:l.width,height:l.height},l.rotation);else if(l.type==="schematic_arc")c(l.center,{width:l.radius*2,height:l.radius*2},0);else if(l.type==="schematic_path"){if(l.points&&l.points.length>0)for(let h of l.points)c(h,{width:0.02,height:0.02},0)}if(!Number.isFinite(n))n=-1,o=-1,r=1,i=1;n-=t,o-=t,r+=t,i+=t;let a=wTo(e);if(a){if(a.minX<n)n=a.minX-t;if(a.minY<o)o=a.minY-t;if(a.maxX>r)r=a.maxX+t;if(a.maxY>i)i=a.maxY+t}return{minX:n,minY:o,maxX:r,maxY:i};function c(l,h,d){let u=[{x:-h.width/2,y:-h.height/2},{x:h.width/2,y:-h.height/2},{x:h.width/2,y:h.height/2},{x:-h.width/2,y:h.height/2}];for(let _ of u){let p=_.x*Math.cos(d)-_.y*Math.sin(d)+l.x,m=_.x*Math.sin(d)+_.y*Math.cos(d)+l.y;n=Math.min(n,p),o=Math.min(o,m),r=Math.max(r,p),i=Math.max(i,m)}}}function eze(e){if(e.type!=="element")throw Error("Expected SVG root element to be of type 'element'");return e}function nSt(e){return{...e,attributes:{...e.attributes??{}},children:e.children?.map(nSt)??[]}}function hie(e,t,n,o,r){let i=nSt(e);return i.attributes={...i.attributes,x:am(t),y:am(n),width:am(o),height:am(r)},delete i.attributes.xmlns,i}function am(e){if(!Number.isFinite(e))return"0";return Number.parseFloat(e.toFixed(6)).toString()}function LTo({schematicGraphic:e,viewport:t}){let n=HTo(e);return{name:"g",type:"element",value:"",attributes:{class:"schematic-graphic","pointer-events":"none","data-circuit-json-type":"schematic_graphic","data-schematic-graphic-id":e.schematic_graphic_id,...e.schematic_sheet_id?{"data-schematic-sheet-id":e.schematic_sheet_id}:{}},children:[{name:"image",type:"element",value:"",attributes:{href:n,x:am(t.x),y:am(t.y),width:am(t.width),height:am(t.height),preserveAspectRatio:"xMidYMid meet",overflow:"hidden","pointer-events":"none"},children:[]}]}}function HTo(e){let t=`Unable to render schematic graphic "${e.schematic_graphic_id}"`,{asset:n,svg_content:o}=e;if(!n){if(o!==void 0)return I8t(o);throw Error(`${t}: asset or svg_content is required`)}if(oSt(n.mimetype)!==gie)throw Error(`${t}: asset.mimetype must be "${gie}" (received ${JSON.stringify(n.mimetype)})`);let r=n.url.trim();if(r.toLowerCase().startsWith("data:"))return FTo(r,t),r;if(o!==void 0)return I8t(o);throw Error(`${t}: asset.url must be an inline SVG data URL because circuit-to-svg cannot synchronously load ${JSON.stringify(n.url)}`)}function FTo(e,t){let n=e.match(/^data:([^,]*),(.*)$/is);if(!n)throw Error(`${t}: asset.url is not a valid SVG data URL`);let o=n[1].split(";").map((c)=>c.trim());if(oSt(o.shift()??"")!==gie)throw Error(`${t}: asset.url must use the "${gie}" media type`);let i=n[2],s=o.findIndex((c)=>c.toLowerCase()==="base64"),a=s!==-1;if(a&&s!==o.length-1)throw Error(`${t}: asset.url must place "base64" as its final metadata token`);if(a){let c=i.replace(/\s+/g,"");if(!/^(?:[a-z\d+/]{4})*(?:[a-z\d+/]{2}==|[a-z\d+/]{3}=)?$/i.test(c))throw Error(`${t}: asset.url is not a valid SVG data URL`);return}if(i.includes("#"))throw Error(`${t}: asset.url must percent-encode "#" in a non-base64 SVG data URL`);try{decodeURIComponent(i)}catch(c){throw Error(`${t}: asset.url is not a valid SVG data URL`,{cause:c})}}function I8t(e){let t=new TextEncoder().encode(e),n="",o=32768;for(let r=0;r<t.length;r+=o)n+=String.fromCharCode(...t.subarray(r,r+o));return`data:${gie};base64,${btoa(n)}`}function oSt(e){return(e.split(";",1)[0]??"").trim().toLowerCase()}function hSt({schArc:e,transform:t,colorMap:n}){let o=lSt.applyToPoint(t,e.center),r=Math.abs(t.a)*e.radius,i=e.stroke_width??0.02,s=Math.abs(t.a)*i,a=e.start_angle_degrees*Math.PI/180,c=e.end_angle_degrees*Math.PI/180,l=o.x+r*Math.cos(a),h=o.y+r*Math.sin(a),d=o.x+r*Math.cos(c),u=o.y+r*Math.sin(c),_=e.end_angle_degrees-e.start_angle_degrees;if(e.direction==="clockwise")_=-_;if(_<0)_+=360;let p=_>180?1:0,m=e.direction==="clockwise"?1:0;return[{name:"path",type:"element",attributes:{class:"sch-arc",d:`M ${l} ${h} A ${r} ${r} 0 ${p} ${m} ${d} ${u}`,fill:"none",stroke:e.color,"stroke-width":s.toString(),...e.is_dashed&&{"stroke-dasharray":(s*3).toString()},"data-schematic-arc-id":e.schematic_arc_id,...e.schematic_component_id&&{"data-schematic-component-id":e.schematic_component_id}},children:[],value:""}]}function uSt({schCircle:e,transform:t,colorMap:n}){let o=dSt.applyToPoint(t,e.center),r=Math.abs(t.a)*e.radius,i=e.stroke_width??0.02,s=Math.abs(t.a)*i;return[{name:"circle",type:"element",attributes:{class:"sch-circle",cx:o.x.toString(),cy:o.y.toString(),r:r.toString(),fill:e.is_filled?e.fill_color??e.color:"none",stroke:e.color,"stroke-width":s.toString(),...e.is_dashed&&{"stroke-dasharray":(s*3).toString()},"data-schematic-circle-id":e.schematic_circle_id,...e.schematic_component_id&&{"data-schematic-component-id":e.schematic_component_id}},children:[],value:""}]}function ASt({isDashed:e,dashLength:t,dashGap:n,strokeWidth:o,transform:r}){if(!e)return;let i=Math.abs(r.a),s=o*i*3,a=t!==void 0?t*i:s,c=n!==void 0?n*i:s;return`${a} ${c}`}function fSt({schLine:e,transform:t,colorMap:n}){let o=sze.applyToPoint(t,{x:e.x1,y:e.y1}),r=sze.applyToPoint(t,{x:e.x2,y:e.y2}),i=e.stroke_width??0.02,s=Math.abs(t.a)*i,a=ASt({isDashed:e.is_dashed,dashLength:e.dash_length,dashGap:e.dash_gap,strokeWidth:i,transform:t});return[{name:"line",type:"element",attributes:{class:"sch-line",x1:o.x.toString(),y1:o.y.toString(),x2:r.x.toString(),y2:r.y.toString(),stroke:e.color,"stroke-width":s.toString(),...a&&{"stroke-dasharray":a},"data-schematic-line-id":e.schematic_line_id,...e.schematic_component_id&&{"data-schematic-component-id":e.schematic_component_id}},children:[],value:""}]}function xSt({schRect:e,transform:t,colorMap:n}){let o=ySt.applyToPoint(t,e.center),r=Math.abs(t.a)*e.width,i=Math.abs(t.d)*e.height,s=e.stroke_width??0.02,a=Math.abs(t.a)*s,c=o.x-r/2,l=o.y-i/2;return[{name:"rect",type:"element",attributes:{class:"sch-rect",x:c.toString(),y:l.toString(),width:r.toString(),height:i.toString(),fill:e.is_filled?e.fill_color??e.color:"none",stroke:e.color,"stroke-width":a.toString(),...e.is_dashed&&{"stroke-dasharray":(a*3).toString()},...e.rotation!==0&&{transform:`rotate(${e.rotation} ${o.x} ${o.y})`},"data-schematic-rect-id":e.schematic_rect_id,...e.schematic_component_id&&{"data-schematic-component-id":e.schematic_component_id}},children:[],value:""}]}function bSt({schPath:e,transform:t,colorMap:n}){let o=e.stroke_color??n.schematic.component_outline,r=e.fill_color??"none",i=e.stroke_width??0.02,s=Math.abs(t.a)*i,a=ASt({isDashed:e.is_dashed,dashLength:e.dash_length,dashGap:e.dash_gap,strokeWidth:i,transform:t});if(!e.points||e.points.length<2)return[];return[{name:"path",type:"element",attributes:{class:"sch-path",d:e.points.map((h)=>CSt.applyToPoint(t,{x:h.x,y:h.y})).map((h,d)=>`${d===0?"M":"L"} ${h.x} ${h.y}`).join(" "),stroke:o,"stroke-width":s.toString(),fill:e.is_filled?r:"none","stroke-linecap":"round","stroke-linejoin":"round",...a&&{"stroke-dasharray":a},...e.schematic_component_id&&{"data-schematic-component-id":e.schematic_component_id}},children:[],value:""}]}function E8t(e){if(e.type==="schematic_rect")return 0;if((e.type==="schematic_circle"||e.type==="schematic_path")&&e.is_filled)return 1;if(e.type==="schematic_text")return 3;return 2}function oDo(e){let{component:t}=e,n=[];if(t.is_box_with_pins!==!1)if(t.symbol_name)n=qTo(e);else n=tDo(e);let o=nDo(e),r=[...n,...o];return[{type:"element",name:"g",attributes:{class:"sch-component","data-circuit-json-type":"schematic_component","data-schematic-component-id":t.schematic_component_id,...t.schematic_sheet_id?{"data-schematic-sheet-id":t.schematic_sheet_id}:{}},children:r,value:""}]}function rDo({debugObject:e,transform:t}){if(e.shape==="rect"){let[n,o]=cj.applyToPoint(t,[e.center.x-e.size.width/2,e.center.y-e.size.height/2]),[r,i]=cj.applyToPoint(t,[e.center.x+e.size.width/2,e.center.y+e.size.height/2]);[o,i]=[Math.min(o,i),Math.max(o,i)];let s=Math.abs(r-n),a=Math.abs(i-o),[c,l]=cj.applyToPoint(t,[e.center.x,e.center.y]);return[{name:"rect",type:"element",value:"",attributes:{x:n.toString(),y:o.toString(),width:s.toString(),height:a.toString(),fill:"none",stroke:"red","stroke-width":(0.02*Math.abs(t.a)).toString(),"stroke-dasharray":"5,5"},children:e.label?[{name:"text",type:"element",value:"",attributes:{x:c.toString(),y:(l-10).toString(),"text-anchor":"middle","font-size":(0.2*Math.abs(t.a)).toString(),fill:"red"},children:[{type:"text",value:e.label,name:"",attributes:{},children:[]}]}]:[]}]}if(e.shape==="line"){let[n,o]=cj.applyToPoint(t,[e.start.x,e.start.y]),[r,i]=cj.applyToPoint(t,[e.end.x,e.end.y]),s=(n+r)/2,a=(o+i)/2;return[{name:"line",type:"element",value:"",attributes:{x1:n.toString(),y1:o.toString(),x2:r.toString(),y2:i.toString(),stroke:"red","stroke-width":(0.02*Math.abs(t.a)).toString(),"stroke-dasharray":"5,5"},children:e.label?[{name:"text",type:"element",value:"",attributes:{x:s.toString(),y:(a-10).toString(),"text-anchor":"middle","font-size":(0.2*Math.abs(t.a)).toString(),fill:"red"},children:[{type:"text",value:e.label,name:"",attributes:{},children:[]}]}]:[]}]}return[]}function sDo({schematicSheet:e,transform:t,colorMap:n}){let o=bj(e),r=n.schematic.sheet,i=n.schematic.net_name,s=[M8t({id:`${e.schematic_sheet_id}_outer`,center:o.center,width:o.width,height:o.height,transform:t,color:r}),M8t({id:`${e.schematic_sheet_id}_inner`,center:o.center,width:o.innerMaxX-o.innerMinX,height:o.innerMaxY-o.innerMinY,transform:t,color:r})];for(let a=1;a<Q1e.length;a++){let c=o.innerMinX+(o.innerMaxX-o.innerMinX)*a/Q1e.length;s.push(k1e({id:`${e.schematic_sheet_id}_top_column_${a}`,x1:c,y1:o.maxY,x2:c,y2:o.innerMaxY,transform:t,color:r}),k1e({id:`${e.schematic_sheet_id}_bottom_column_${a}`,x1:c,y1:o.minY,x2:c,y2:o.innerMinY,transform:t,color:r}))}for(let a=1;a<tie.length;a++){let c=o.innerMinY+(o.innerMaxY-o.innerMinY)*a/tie.length;s.push(k1e({id:`${e.schematic_sheet_id}_left_row_${a}`,x1:o.minX,y1:c,x2:o.innerMinX,y2:c,transform:t,color:r}),k1e({id:`${e.schematic_sheet_id}_right_row_${a}`,x1:o.maxX,y1:c,x2:o.innerMaxX,y2:c,transform:t,color:r}))}return Q1e.forEach((a,c)=>{let l=o.innerMinX+(o.innerMaxX-o.innerMinX)*(c+0.5)/Q1e.length;s.push(L1e({text:a,x:l,y:(o.maxY+o.innerMaxY)/2,transform:t,color:i}),L1e({text:a,x:l,y:(o.minY+o.innerMinY)/2,transform:t,color:i}))}),tie.forEach((a,c)=>{let l=o.innerMinY+(o.innerMaxY-o.innerMinY)*(tie.length-c-0.5)/tie.length;s.push(L1e({text:a,x:(o.minX+o.innerMinX)/2,y:l,transform:t,color:i}),L1e({text:a,x:(o.maxX+o.innerMaxX)/2,y:l,transform:t,color:i}))}),[{name:"g",type:"element",value:"",attributes:{class:"schematic-sheet","data-circuit-json-type":"schematic_sheet","data-schematic-sheet-id":e.schematic_sheet_id},children:s}]}function M8t({id:e,center:t,width:n,height:o,transform:r,color:i}){let s=Aie.applyToPoint(r,t),a=Math.abs(r.a)*n,c=Math.abs(r.d)*o;return{name:"rect",type:"element",value:"",attributes:{class:"sch-rect",x:(s.x-a/2).toString(),y:(s.y-c/2).toString(),width:a.toString(),height:c.toString(),fill:"none",stroke:i,"stroke-width":(Math.abs(r.a)*ISt).toString(),"data-schematic-rect-id":e},children:[]}}function k1e({id:e,x1:t,y1:n,x2:o,y2:r,transform:i,color:s}){let a=Aie.applyToPoint(i,{x:t,y:n}),c=Aie.applyToPoint(i,{x:o,y:r});return{name:"line",type:"element",value:"",attributes:{class:"sch-line",x1:a.x.toString(),y1:a.y.toString(),x2:c.x.toString(),y2:c.y.toString(),stroke:s,"stroke-width":(Math.abs(i.a)*ISt).toString(),"data-schematic-line-id":e},children:[]}}function L1e({text:e,x:t,y:n,transform:o,color:r}){let i=Aie.applyToPoint(o,{x:t,y:n});return{type:"element",name:"text",value:"",attributes:{class:"sch-text",x:i.x.toString(),y:i.y.toString(),fill:r,"text-anchor":"middle","dominant-baseline":"middle","font-family":"sans-serif","font-size":`${g4(o,"reference_designator",iDo)}px`,transform:`rotate(0, ${i.x}, ${i.y})`},children:[{type:"text",value:e,name:"",attributes:{},children:[]}]}}function cDo({trace:e,transform:t,colorMap:n}){let o=e.edges;if(o.length===0)return[];let r=[],i=[],s="";for(let a=0;a<o.length;a++){let c=o[a];if(c.is_crossing)continue;let[l,h]=lj.applyToPoint(t,[c.from.x,c.from.y]),[d,u]=lj.applyToPoint(t,[c.to.x,c.to.y]);if(a===0||o[a-1]?.is_crossing)s+=`M ${l} ${h} L ${d} ${u}`;else s+=` L ${d} ${u}`}if(s)r.push({name:"path",type:"element",attributes:{d:s,class:"trace-invisible-hover-outline sch-trace-hitbox",stroke:n.schematic.wire,fill:"none","stroke-width":`${Km(t)*8}px`,"stroke-linecap":"round",opacity:"0","stroke-linejoin":"round"},value:"",children:[]}),r.push({name:"path",type:"element",attributes:{class:"sch-trace-path",d:s,stroke:n.schematic.wire,fill:"none","stroke-width":`${Km(t)}px`,"stroke-linecap":"round","stroke-linejoin":"round"},value:"",children:[]});for(let a of o){if(!a.is_crossing)continue;let[c,l]=lj.applyToPoint(t,[a.from.x,a.from.y]),[h,d]=lj.applyToPoint(t,[a.to.x,a.to.y]),u=(c+h)/2,_=(l+d)/2,p=h-c,m=d-l,A=Math.sqrt(p*p+m*m),g=A*0.7,f=-m/A*g,y=p/A*g,x=u+f,C=_-Math.abs(y);i.push({name:"path",type:"element",attributes:{class:"trace-crossing-outline sch-trace-crossing-outline",d:`M ${c} ${l} Q ${x} ${C} ${h} ${d}`,stroke:n.schematic.background,fill:"none","stroke-width":`${Km(t)*1.5}px`,"stroke-linecap":"butt"},value:"",children:[]}),i.push({name:"path",type:"element",attributes:{class:"sch-trace-crossing-path",d:`M ${c} ${l} Q ${x} ${C} ${h} ${d}`,stroke:n.schematic.wire,fill:"none","stroke-width":`${Km(t)}px`,"stroke-linecap":"round"},value:"",children:[]})}if(e.junctions)for(let a of e.junctions){let[c,l]=lj.applyToPoint(t,[a.x,a.y]);i.push({name:"circle",type:"element",attributes:{cx:c.toString(),cy:l.toString(),r:(Math.abs(t.a)*0.03).toString(),class:"trace-junction sch-trace-junction",fill:n.schematic.junction},value:"",children:[]})}return[{name:"g",type:"element",value:"",attributes:{class:"trace sch-trace","data-layer":"base","data-circuit-json-type":"schematic_trace","data-schematic-trace-id":e.schematic_trace_id,...e.subcircuit_connectivity_map_key&&{"data-subcircuit-connectivity-map-key":e.subcircuit_connectivity_map_key}},children:r},{name:"g",type:"element",value:"",attributes:{class:"trace-overlays sch-trace-overlays","data-layer":"overlay","data-circuit-json-type":"schematic_trace","data-schematic-trace-id":e.schematic_trace_id,...e.subcircuit_connectivity_map_key&&{"data-subcircuit-connectivity-map-key":e.subcircuit_connectivity_map_key}},children:i}]}function lDo({probe:e,transform:t,colorMap:n,fallbackColor:o}){let[r,i]=vSt.applyToPoint(t,[e.position.x,e.position.y]),s=e.color??o??n.schematic.reference,a=Math.abs(t.a)*0.6,c=Math.abs(t.a)*0.28,l=e.label_alignment??"top_right",h,d,u,_;switch(l){case"top_left":h=-135*Math.PI/180,d="end",u=-8,_=-8;break;case"top_center":h=-90*Math.PI/180,d="middle",u=0,_=-8;break;case"top_right":h=-45*Math.PI/180,d="start",u=8,_=-8;break;case"center_left":h=180*Math.PI/180,d="end",u=-8,_=0;break;case"center":h=-90*Math.PI/180,d="middle",u=0,_=-8;break;case"center_right":h=0*Math.PI/180,d="start",u=8,_=0;break;case"bottom_left":h=135*Math.PI/180,d="end",u=-8,_=8;break;case"bottom_center":h=90*Math.PI/180,d="middle",u=0,_=8;break;case"bottom_right":h=45*Math.PI/180,d="start",u=8,_=8;break;default:h=-50*Math.PI/180,d="start",u=8,_=0}let p=r+a*Math.cos(h),m=i+a*Math.sin(h),A=r,g=i,f=[`M ${p},${m}`,`L ${A},${g}`,`M ${A},${g}`,`L ${A-c*Math.cos((h*180/Math.PI+150)*Math.PI/180)},${g-c*Math.sin((h*180/Math.PI+150)*Math.PI/180)}`,`L ${A-c*Math.cos((h*180/Math.PI+210)*Math.PI/180)},${g-c*Math.sin((h*180/Math.PI+210)*Math.PI/180)}`,"Z"].join(" "),y=(p+u).toString(),x=(m+_).toString(),C=[];if(e.name&&e.voltage!==void 0)C.push({type:"element",name:"tspan",value:"",attributes:{x:y},children:[{type:"text",value:e.name,name:"",attributes:{},children:[]}]}),C.push({type:"element",name:"tspan",value:"",attributes:{x:y,dy:"1.2em"},children:[{type:"text",value:`${e.voltage}V`,name:"",attributes:{},children:[]}]});else{let b=[];if(e.name)b.push(e.name);if(e.voltage!==void 0)b.push(`${e.voltage}V`);C.push({type:"text",value:b.join(" "),name:"",attributes:{},children:[]})}return[{name:"path",type:"element",attributes:{class:"sch-voltage-probe",d:f,stroke:s,fill:s,"stroke-width":`${Km(t)}px`},value:"",children:[]},{type:"element",name:"text",value:"",attributes:{class:"sch-voltage-probe-label",x:y,y:x,fill:s,"text-anchor":d,"dominant-baseline":"middle","font-family":"sans-serif","font-size":`${g4(t,"reference_designator")}px`,"font-weight":"bold","data-schematic-voltage-probe-id":e.schematic_voltage_probe_id},children:C}]}function SSt({message:e,targetBounds:t,svgWidth:n,svgHeight:o,occupiedCalloutBounds:r}){let i=Math.max(1,n-bf*2),s=mDo(e,Math.max(12,Math.floor((Math.min(B8t,i)-LFe*2)/(w8t*0.56)))),a=Math.max(...s.map((_)=>_.length)),c=Math.min(B8t,i,Math.max(Math.min(dDo,i),a*w8t*0.56+LFe*2)),l=LFe*2+s.length*hDo,h=uDo({targetBounds:t,calloutWidth:c,calloutHeight:l,svgWidth:n,svgHeight:o,occupiedCalloutBounds:r});r.push(h);let d=PSt(t,die),u=pDo(h,d);return{messageLines:s,calloutWidth:c,calloutHeight:l,placement:h,targetOutline:d,leader:u}}function uDo({targetBounds:e,calloutWidth:t,calloutHeight:n,svgWidth:o,svgHeight:r,occupiedCalloutBounds:i}){let s=(e.minX+e.maxX)/2,a=(e.minY+e.maxY)/2,c=e.minY-die-H1e-n,l=e.maxY+die+H1e,h=e.minX-die-H1e-t,d=e.maxX+die+H1e,u=[];if(c>=bf)u.push(nie({x:oj(s-t/2,bf,o-bf-t),y:c,width:t,height:n,side:"top"}));if(l+n<=r-bf)u.push(nie({x:oj(s-t/2,bf,o-bf-t),y:l,width:t,height:n,side:"bottom"}));if(d+t<=o-bf)u.push(nie({x:d,y:oj(a-n/2,bf,r-bf-n),width:t,height:n,side:"right"}));if(h>=bf)u.push(nie({x:h,y:oj(a-n/2,bf,r-bf-n),width:t,height:n,side:"left"}));let _=u.find((p)=>i.every((m)=>!_Do(PSt(p,4),m)));if(_)return _;if(u[0])return u[0];return nie({x:oj(s-t/2,bf,o-bf-t),y:oj(c,bf,r-bf-n),width:t,height:n,side:"top"})}function pDo(e,t){let n=(t.minX+t.maxX)/2,o=(t.minY+t.maxY)/2,r=(e.minX+e.maxX)/2,i=(e.minY+e.maxY)/2;switch(e.side){case"top":return{from:{x:r,y:e.maxY},to:{x:n,y:t.minY}};case"bottom":return{from:{x:r,y:e.minY},to:{x:n,y:t.maxY}};case"left":return{from:{x:e.maxX,y:i},to:{x:t.minX,y:o}};case"right":return{from:{x:e.minX,y:i},to:{x:t.maxX,y:o}}}}function mDo(e,t){let n=e.trim().split(/\s+/),o=[],r="";for(let i of n){let s=r?`${r} ${i}`:i;if(s.length<=t||r.length===0){r=s;continue}o.push(r),r=i}if(r)o.push(r);return o.length>0?o:["Diagnostic"]}function PSt(e,t){return{minX:e.minX-t,minY:e.minY-t,maxX:e.maxX+t,maxY:e.maxY+t}}function _Do(e,t){return!(e.maxX<=t.minX||e.minX>=t.maxX||e.maxY<=t.minY||e.minY>=t.maxY)}function nie({x:e,y:t,width:n,height:o,side:r}){return{minX:e,minY:t,maxX:e+n,maxY:t+o,side:r}}function oj(e,t,n){if(n<t)return(t+n)/2;return Math.min(Math.max(e,t),n)}function ADo({circuitJson:e,transform:t,svgWidth:n,svgHeight:o,colorMap:r}){let i=r.schematic.erc_warning,s=[];return e.filter(ESt).flatMap((a)=>{let c=fDo(a,e,t);if(!c)return[];let{messageLines:l,calloutWidth:h,calloutHeight:d,placement:u,targetOutline:_,leader:p}=SSt({message:a.message,targetBounds:c,svgWidth:n,svgHeight:o,occupiedCalloutBounds:s}),m=bDo(a);return[{name:"g",type:"element",value:"",attributes:{class:"schematic-warning","data-type":a.type,"data-warning-id":m,role:"note","aria-label":a.message},children:[{name:"rect",type:"element",value:"",attributes:{x:_.minX.toString(),y:_.minY.toString(),width:(_.maxX-_.minX).toString(),height:(_.maxY-_.minY).toString(),rx:"6",fill:"none",stroke:i,"stroke-width":"1","stroke-dasharray":"4,3","data-warning-reference":"target"},children:[]},{name:"line",type:"element",value:"",attributes:{x1:p.from.x.toString(),y1:p.from.y.toString(),x2:p.to.x.toString(),y2:p.to.y.toString(),stroke:i,"stroke-width":"1","data-warning-reference":"leader"},children:[]},{name:"rect",type:"element",value:"",attributes:{x:u.minX.toString(),y:u.minY.toString(),width:h.toString(),height:d.toString(),fill:"rgba(255, 250, 235, 0.97)",stroke:i,"stroke-width":"1","data-warning-reference":"callout"},children:[]},{name:"text",type:"element",value:"",attributes:{x:(u.minX+HFe).toString(),y:(u.minY+HFe+T8t).toString(),fill:"#5c4300","font-family":"sans-serif","font-size":T8t.toString()},children:l.map((g,f)=>({name:"tspan",type:"element",value:"",attributes:{x:(u.minX+HFe).toString(),dy:f===0?"0":gDo.toString()},children:[vDo(g)]}))}]}]})}function fDo(e,t,n){let r=yDo(e).map((i)=>xDo(t,i)).filter((i)=>Boolean(i)).map((i)=>CDo(i,n)).filter((i)=>Boolean(i));if(r.length===0)return null;return r.reduce(IDo)}function yDo(e){switch(e.type){case"schematic_sheet_styling_warning":return[e.schematic_sheet_id];case"schematic_component_overlap_warning":return e.schematic_component_ids;case"schematic_component_styling_warning":return[e.schematic_component_id,...e.schematic_port_ids??[]];case"schematic_manual_edit_conflict_warning":return[e.schematic_component_id];case"schematic_element_outside_sheet_warning":return[e.schematic_element_id]}}function xDo(e,t){return e.find((n)=>{if(!n.type.startsWith("schematic_"))return!1;let o=`${n.type}_id`;return n[o]===t})}function CDo(e,t){if(e.type==="schematic_sheet"){let n=bj(e);return F1e([wM.applyToPoint(t,{x:n.minX,y:n.maxY}),wM.applyToPoint(t,{x:n.maxX,y:n.minY})])}if(e.type==="schematic_component"){let n=wM.applyToPoint(t,{x:e.center.x-e.size.width/2,y:e.center.y+e.size.height/2}),o=wM.applyToPoint(t,{x:e.center.x+e.size.width/2,y:e.center.y-e.size.height/2});return F1e([n,o])}if(e.type==="schematic_port"){let n=wM.applyToPoint(t,e.center);return D8t(F1e([n]),4)}if(e.type==="schematic_net_label"){let n=wM.applyToPoint(t,e.anchor_position??e.center),o=Math.max(28,e.text.length*8);return{minX:n.x-o/2,minY:n.y-10,maxX:n.x+o/2,maxY:n.y+10}}if(e.type==="schematic_trace"){let n=e.edges.flatMap((o)=>[wM.applyToPoint(t,o.from),wM.applyToPoint(t,o.to)]);if(n.length===0)return null;return D8t(F1e(n),4)}return null}function bDo(e){switch(e.type){case"schematic_sheet_styling_warning":return e.schematic_sheet_styling_warning_id;case"schematic_component_overlap_warning":return e.schematic_component_overlap_warning_id;case"schematic_component_styling_warning":return e.schematic_component_styling_warning_id;case"schematic_element_outside_sheet_warning":return e.schematic_element_outside_sheet_warning_id;case"schematic_manual_edit_conflict_warning":return e.schematic_manual_edit_conflict_warning_id}}function F1e(e){return{minX:Math.min(...e.map((t)=>t.x)),minY:Math.min(...e.map((t)=>t.y)),maxX:Math.max(...e.map((t)=>t.x)),maxY:Math.max(...e.map((t)=>t.y))}}function IDo(e,t){return{minX:Math.min(e.minX,t.minX),minY:Math.min(e.minY,t.minY),maxX:Math.max(e.maxX,t.maxX),maxY:Math.max(e.maxY,t.maxY)}}function D8t(e,t){return{minX:e.minX-t,minY:e.minY-t,maxX:e.maxX+t,maxY:e.maxY+t}}function vDo(e){return{name:"",type:"text",value:e,attributes:{},children:[]}}function SDo({circuitJson:e,transform:t,svgWidth:n,svgHeight:o}){let r=PDo(e,t);return e.flatMap((i)=>{let s=EDo(i);if(!s)return[];let a=e.filter((A)=>A.type==="schematic_port"&&s.sourcePortIds.includes(A.source_port_id)),c=a[0];if(!c)return[];let l=a.flatMap((A)=>{let g=K1e.applyToPoint(t,A.center);return[{name:"circle",type:"element",value:"",attributes:{cx:g.x.toString(),cy:g.y.toString(),r:"9",fill:"red","fill-opacity":"0.15",stroke:"red","stroke-width":"2","data-type":i.type,"data-source-port-id":A.source_port_id,"data-error-id":s.errorId,"aria-label":s.message},children:[{name:"title",type:"element",value:"",attributes:{},children:[{name:"",type:"text",value:s.message,attributes:{},children:[]}]}]}]}),h=K1e.applyToPoint(t,c.center),{placement:d,leader:u,messageLines:_,calloutWidth:p,calloutHeight:m}=SSt({message:s.message,targetBounds:{minX:h.x-9,minY:h.y-9,maxX:h.x+9,maxY:h.y+9},svgWidth:n,svgHeight:o,occupiedCalloutBounds:r});return[...l,{name:"g",type:"element",value:"",attributes:{"data-type":"source_port_error_callout","data-error-type":i.type,"data-error-id":s.errorId,"data-source-port-id":c.source_port_id,"aria-label":s.message,role:"note"},children:[{name:"line",type:"element",value:"",children:[],attributes:{x1:u.from.x.toString(),y1:u.from.y.toString(),x2:u.to.x.toString(),y2:u.to.y.toString(),stroke:"red","stroke-width":"1"}},{name:"rect",type:"element",value:"",children:[],attributes:{x:d.minX.toString(),y:d.minY.toString(),width:p.toString(),height:m.toString(),fill:"rgba(255, 245, 245, 0.97)",stroke:"red","stroke-width":"1"}},{name:"text",type:"element",value:"",attributes:{x:(d.minX+6).toString(),y:(d.minY+17).toString(),fill:"#a00000","font-family":"sans-serif","font-size":"11"},children:_.map((A,g)=>({name:"tspan",type:"element",value:"",attributes:{x:(d.minX+6).toString(),dy:g===0?"0":"14"},children:[{name:"",type:"text",value:A,attributes:{},children:[]}]}))}]}]})}function PDo(e,t){return e.flatMap((n)=>{if(n.type!=="schematic_component")return[];let o=tSt(e.filter((i)=>i.type==="source_component"?i.source_component_id===n.source_component_id:("schematic_component_id"in i)&&i.schematic_component_id===n.schematic_component_id),0),r=[{x:o.minX,y:o.minY},{x:o.minX,y:o.maxY},{x:o.maxX,y:o.minY},{x:o.maxX,y:o.maxY}].map((i)=>K1e.applyToPoint(t,i));return[{minX:Math.min(...r.map((i)=>i.x)),minY:Math.min(...r.map((i)=>i.y)),maxX:Math.max(...r.map((i)=>i.x)),maxY:Math.max(...r.map((i)=>i.y))}]})}function EDo(e){switch(e.type){case"source_component_misconfigured_error":return{errorId:e.source_component_misconfigured_error_id,sourcePortIds:e.source_port_ids??[],message:e.message};case"source_pin_must_be_connected_error":return{errorId:e.source_pin_must_be_connected_error_id,sourcePortIds:[e.source_port_id],message:e.message};case"source_i2c_misconfigured_error":return{errorId:e.source_i2c_misconfigured_error_id,sourcePortIds:e.source_port_ids,message:e.message};case"source_trace_not_connected_error":return{errorId:e.source_trace_not_connected_error_id,sourcePortIds:e.connected_source_port_ids??[],message:e.message}}}function uz(e,t){let n=e.filter((K)=>K.type==="schematic_sheet"),o=vTo(n),r=o;if(t?.schematicSheetId!==void 0)r=n.find((K)=>K.schematic_sheet_id===t.schematicSheetId)??o;else if(t?.schematicSheetIndex!==void 0)r=n.find((K)=>K.sheet_index===t.schematicSheetIndex)??o;let i=r?e.filter((K)=>!K.type.startsWith("schematic_")||ESt(K)||("schematic_sheet_id"in K)&&K.schematic_sheet_id===r.schematic_sheet_id):e,s=tSt(r?[r]:i),a=s.maxX-s.minX,c=s.maxY-s.minY,l=t?.width??1200,h=t?.height??600,d=t?.colorOverrides,u={...Zh,schematic:{...Zh.schematic,...d?.schematic??{}}},_=a/c,p=l/h,m;if(_>p){let K=l/_;m={x:0,y:(h-K)/2}}else{let K=h*_;m={x:(l-K)/2,y:0}}let A=dz.fromTriangles([{x:s.minX,y:s.maxY},{x:s.maxX,y:s.maxY},{x:s.maxX,y:s.minY}],[{x:m.x,y:m.y},{x:l-m.x,y:m.y},{x:l-m.x,y:h-m.y}]),g=[];if(g.push({name:"rect",type:"element",attributes:{class:"boundary",x:"0",y:"0",width:l.toString(),height:h.toString()},children:[],value:""}),t?.grid){let K=typeof t.grid==="object"?t.grid:{};g.push(bTo({bounds:s,transform:A,...K}))}let f=[],y=[],x=[],C=[],b=[],I=[],v=[],P=[],M=[],B=[],T=[],N=[],D=[],L=wDo({transform:A,svgWidth:l,svgHeight:h,schematicSheet:r}),H=Array.isArray(u.simulation_palette)?u.simulation_palette:Array.isArray(u.palette)?u.palette:[],V=0;for(let K of i)if(K.type==="schematic_sheet")N.push(...sDo({schematicSheet:K,transform:A,colorMap:u}));else if(K.type==="schematic_graphic")D.push(LTo({schematicGraphic:K,viewport:BDo({availableViewport:L,schematicGraphic:K,transform:A})}));else if(K.type==="schematic_debug_object")f.push(...rDo({debugObject:K,transform:A}));else if(K.type==="schematic_component")y.push(...oDo({component:K,transform:A,circuitJson:i,colorMap:u})),M.push(...sSt({component:K,transform:A,circuitJson:i}));else if(K.type==="schematic_box")v.push(...jTo({schematicBox:K,transform:A,colorMap:u}));else if(K.type==="schematic_trace")x.push(...cDo({trace:K,transform:A,colorMap:u}));else if(K.type==="schematic_net_label")C.push(...OTo({schNetLabel:K,realToScreenTransform:A,colorMap:u}));else if(K.type==="schematic_text"&&!K.schematic_component_id)b.push(fze({elm:K,transform:A,colorMap:u}));else if(K.type==="schematic_voltage_probe"){let J=H.length>0?H[V%H.length]:void 0;V+=1,I.push(...lDo({probe:K,transform:A,colorMap:u,fallbackColor:J}))}else if(K.type==="schematic_table")P.push(...aDo({schematicTable:K,transform:A,colorMap:u,circuitJson:i}));else if(K.type==="schematic_line"){if(K.schematic_component_id)continue;T.push(...fSt({schLine:K,transform:A,colorMap:u}))}else if(K.type==="schematic_circle"){if(K.schematic_component_id)continue;T.push(...uSt({schCircle:K,transform:A,colorMap:u}))}else if(K.type==="schematic_rect"){if(K.schematic_component_id)continue;T.push(...xSt({schRect:K,transform:A,colorMap:u}))}else if(K.type==="schematic_arc"){if(K.schematic_component_id)continue;T.push(...hSt({schArc:K,transform:A,colorMap:u}))}else if(K.type==="schematic_path"){if(K.schematic_component_id)continue;T.push(...bSt({schPath:K,transform:A,colorMap:u}))}else if(K.type==="schematic_port"){let J=i.find((ee)=>ee.type==="source_port"&&ee.source_port_id===K.source_port_id);if(J?.type==="source_port"&&J.do_not_connect===!0)B.push(GTo({schPort:K,transform:A,colorMap:u}));if(t?.drawPorts)B.push(...UTo({schPort:K,transform:A,circuitJson:i,colorMap:u}))}let O=x.filter((K)=>K.attributes?.["data-layer"]!=="overlay"),U=x.filter((K)=>K.attributes?.["data-layer"]==="overlay");if(g.push(...D,...f,...N,...O,...U,...T,...y,...M,...B,...C,...b,...v,...I,...P),t?.labeledPoints)g.push(ITo({points:t.labeledPoints,transform:A}));if(t?.shouldDrawWarnings)g.push(...ADo({circuitJson:i,transform:A,svgWidth:l,svgHeight:h,colorMap:u}));if(t?.shouldDrawErrors)g.push(...SDo({circuitJson:i,transform:A,svgWidth:l,svgHeight:h}));let j=YN(e),Y=GN;if(t?.showErrorsInTextOverlay){let K=fj(e);if(K)g.push(K)}let X={name:"svg",type:"element",attributes:{xmlns:"http://www.w3.org/2000/svg",class:["tscircuit-schematic",t?.className].filter(Boolean).join(" "),width:l.toString(),height:h.toString(),style:`background-color: ${u.schematic.background}`,"data-real-to-screen-transform":dz.toSVG(A),...j&&{"data-software-used-string":j},...t?.includeVersion&&{"data-circuit-to-svg-version":Y}},children:[{name:"style",type:"element",children:[{type:"text",value:`
              .boundary { fill: ${u.schematic.background}; }
              .schematic-boundary { fill: none; stroke: #fff; }
              .component { fill: none; stroke: ${u.schematic.component_outline}; }
              .chip { fill: ${u.schematic.component_body}; stroke: ${u.schematic.component_outline}; }
              .component-pin { fill: none; stroke: ${u.schematic.component_outline}; }
              .text { font-family: sans-serif; fill: ${u.schematic.wire}; }
              .pin-number { fill: ${u.schematic.pin_number}; }
              .port-label { fill: ${u.schematic.reference}; }
              .component-name { fill: ${u.schematic.reference}; }
              ${t?.css??""}
            `,name:"",attributes:{},children:[]}],value:"",attributes:{}},...g],value:""};return ON(X)}function wDo({transform:e,svgWidth:t,svgHeight:n,schematicSheet:o}){if(!o)return{x:0,y:0,width:t,height:n};let r=bj(o),i=dz.applyToPoint(e,{x:r.innerMinX,y:r.innerMaxY}),s=dz.applyToPoint(e,{x:r.innerMaxX,y:r.innerMinY});return{x:Math.min(i.x,s.x),y:Math.min(i.y,s.y),width:Math.abs(s.x-i.x),height:Math.abs(s.y-i.y)}}function BDo({availableViewport:e,schematicGraphic:t,transform:n}){if(t.width===void 0&&t.height===void 0)return e;let o=t.width===void 0?e.width:N8t(t.width*Math.hypot(n.a,n.b),e.width),r=t.height===void 0?e.height:N8t(t.height*Math.hypot(n.c,n.d),e.height);return{x:e.x+(e.width-o)/2,y:e.y+(e.height-r)/2,width:o,height:r}}function N8t(e,t){if(!Number.isFinite(e))return t;return Math.max(0,Math.min(e,t))}function RDo(e,t){let n=e.filter((d)=>d.type==="schematic_sheet").slice().sort((d,u)=>(d.sheet_index??0)-(u.sheet_index??0));if(n.length<=1)return uz(e,t);let o=t?.width??TDo,r=t?.sheetLabelHeight??DDo,i=t?.sheetGap??NDo,s={...Zh,schematic:{...Zh.schematic,...t?.colorOverrides?.schematic??{}}},a=[],c=0;n.forEach((d,u)=>{let _=bj(d),p=t?.height??Math.round(o*_.height/_.width),m=uz(e,{...t,schematicSheetId:d.schematic_sheet_id,schematicSheetIndex:void 0,width:o,height:p}),A=eze(MSt.parseSync(m)),g=c+r,f=d.display_name??d.name??`Sheet ${d.sheet_index??u+1}`,y=QDo({transformStr:A.attributes?.["data-real-to-screen-transform"],panelTop:g,labelHeight:r,schematicSheet:d});a.push({name:"text",type:"element",value:"",attributes:{class:"stacked-sheet-label",x:am(y.x),y:am(y.y),"font-family":"sans-serif","font-size":`${am(r*0.55)}px`,fill:s.schematic.reference,"data-schematic-sheet-id":d.schematic_sheet_id},children:[{name:"",type:"text",value:f,attributes:{},children:[]}]},hie(A,0,g,o,p)),c=g+p+i});let l=Math.max(0,c-i),h={name:"svg",type:"element",value:"",attributes:{xmlns:"http://www.w3.org/2000/svg",class:"tscircuit-stacked-schematic",width:am(o),height:am(l),viewBox:`0 0 ${am(o)} ${am(l)}`,style:`background-color: ${s.schematic.background}`},children:[{name:"rect",type:"element",value:"",attributes:{class:"boundary",x:"0",y:"0",width:am(o),height:am(l),fill:s.schematic.background},children:[]},...a]};return ON(h)}function QDo({transformStr:e,panelTop:t,labelHeight:n,schematicSheet:o}){let r=t-n*0.28;if(!e)return{x:4,y:r};let i=bj(o),s=Z1e.applyToPoint(Z1e.fromString(e),{x:i.minX,y:i.maxY});return{x:Math.max(2,s.x),y:r}}function fie(e){return e?.valuePerDiv!==void 0&&Number.isFinite(e.valuePerDiv)&&Math.abs(e.valuePerDiv)>Number.EPSILON}function Cx(e){return e.type==="simulation_transient_current_graph"}function yze(e){return Cx(e)?e.simulation_transient_current_graph_id:e.simulation_transient_voltage_graph_id}function BSt(e){return Cx(e)?"data-simulation-transient-current-graph-id":"data-simulation-transient-voltage-graph-id"}function TSt(e){return Cx(e)?e.current_levels:e.voltage_levels}function WDo(e){let t=e.some((o)=>Cx(o.graph)),n=e.some((o)=>!Cx(o.graph));if(t&&!n)return"Current (A)";if(n&&!t)return"Voltage (V)";return"Value"}function XDo(e){return`simulation-graph-${e.replace(/[^a-zA-Z0-9_-]+/g,"-")}`}function ur(e){if(!Number.isFinite(e))return"0";let t=Number.parseFloat(e.toFixed(6));if(Number.isInteger(t))return t.toString();return t.toString()}function nc(e,t,n=[]){return{name:e,type:"element",value:"",attributes:t,children:n}}function TI(e){return{name:"",type:"text",value:e,attributes:{},children:[]}}function hze(e,t){if(!Number.isFinite(e))return`0 ${t}`;if(e===0)return`0 ${t}`;let n=Math.abs(e),o=[{threshold:1e6,factor:1e6,prefix:"M"},{threshold:1000,factor:1000,prefix:"k"},{threshold:1,factor:1,prefix:""},{threshold:0.001,factor:0.001,prefix:"m"},{threshold:0.000001,factor:0.000001,prefix:"µ"},{threshold:0.000000001,factor:0.000000001,prefix:"n"}],r=o.find((s)=>n>=s.threshold)??o[o.length-1],i=e/r.factor;return`${DSt(i)} ${r.prefix}${t}`}function jDo(e){return`${DSt(e)} div`}function DSt(e){if(!Number.isFinite(e))return"0";let t=Math.abs(e),n=t>=100?0:t>=10?1:t>=1?2:3;return Number.parseFloat(e.toFixed(n)).toString()}function k8t(e,t){let n=t.tickLabelOverrides?.get(e);if(n!==void 0)return n;let{ticks:o}=t;if(o.length<=1)return ur(e);let r=o[o.length-1]-o[0];if(!Number.isFinite(r)||r===0)return ur(e);let i=KDo(r),s=10**i;return(Math.round(e*s)/s).toFixed(i).replace(/\.0+$/,"").replace(/(\.\d*?)0+$/,"$1").replace(/\.$/,"")}function KDo(e){if(e>=100)return 0;if(e>=10)return 1;if(e>=1)return 2;return 3}function $Do({graphs:e,valueAxis:t,scaleY:n,plotLeft:o,plotWidth:r,plotHeight:i}){let s=cm.top,a=cm.top+i,c=o,l=o+r,h=[],d=e.filter((u)=>fie(u.scopeTraceDisplay));for(let[u,_]of d.entries()){let p=u%2===0?"left":"right",m=Math.floor(u/2),A=p==="left"?c-10-m*lze:l+10+m*lze,g=p==="left"?A-6:A+6,f=p==="left"?"end":"start",y=p==="left"?A+6:A-6,x=_.scopeTraceDisplay;if(!fie(x))continue;h.push(nc("line",{class:"axis axis-y axis-y-scope",x1:ur(A),y1:ur(s),x2:ur(A),y2:ur(a),style:`stroke: ${_.color};`}),nc("text",{class:"axis-title axis-title-y axis-title-y-scope",x:ur(A),y:ur(s-12),"text-anchor":"middle",style:`fill: ${_.color}; font-size: 10px;`},[TI(_.label)]));for(let C of t.ticks){let b=n(C),I=(x.center??0)+(C-(x.offsetDivs??0))*x.valuePerDiv;h.push(nc("line",{class:"axis-tick axis-tick-y axis-tick-y-scope",x1:ur(A),y1:ur(b),x2:ur(y),y2:ur(b),style:`stroke: ${_.color};`}),nc("text",{class:"axis-label axis-label-y axis-label-y-scope",x:ur(g),y:ur(b),"text-anchor":f,"dominant-baseline":"middle",style:`fill: ${_.color}; font-size: 10px;`},[TI(hze(I,Cx(_.graph)?"A":"V"))]))}}return h}function qDo({timeAxis:e,valueAxis:t,graphs:n,scaleX:o,scaleY:r,plotLeft:i,plotWidth:s,plotHeight:a,yAxisTitle:c,xAxisTitle:l,usesScopeTraceDisplay:h}){let d=cm.top+a,u=i,_=i+s,p=[nc("line",{class:"axis axis-x",x1:ur(u),y1:ur(d),x2:ur(_),y2:ur(d)}),...h?[]:[nc("line",{class:"axis axis-y",x1:ur(u),y1:ur(cm.top),x2:ur(u),y2:ur(d)})]];for(let m of e.ticks){let A=ur(o(m));p.push(nc("line",{class:"axis-tick axis-tick-x",x1:A,y1:ur(d),x2:A,y2:ur(d+6)}),nc("text",{class:"axis-label axis-label-x",x:A,y:ur(d+22),"text-anchor":"middle"},[TI(k8t(m,e))]))}if(h)p.push(...$Do({graphs:n,valueAxis:t,scaleY:r,plotLeft:i,plotWidth:s,plotHeight:a}));else{for(let m of t.ticks){let A=ur(r(m));p.push(nc("line",{class:"axis-tick axis-tick-y",x1:ur(u-6),y1:A,x2:ur(u),y2:A}),nc("text",{class:"axis-label axis-label-y",x:ur(u-10),y:A,"text-anchor":"end","dominant-baseline":"middle"},[TI(k8t(m,t))]))}p.push(nc("text",{class:"axis-title axis-title-y",x:ur(u-64),y:ur(cm.top+a/2),transform:`rotate(-90 ${ur(u-64)} ${ur(cm.top+a/2)})`,"text-anchor":"middle"},[TI(c)]))}return p.push(nc("text",{class:"axis-title axis-title-x",x:ur(u+s/2),y:ur(d+48),"text-anchor":"middle"},[TI(l)])),nc("g",{class:"axes"},p)}function $1e(e,t=!1){if(e.length===0)return{domainMin:0,domainMax:1,ticks:[0,1]};let n=Math.min(...e),o=Math.max(...e);if(n===o){let c=n===0?1:Math.abs(n)*0.1||1;return{domainMin:n-c,domainMax:n+c,ticks:[n-c,n,n+c]}}let r=NSt(n,o),i=r.length>0?[...r]:[n,o],s=i[0],a=i[i.length-1];if(t&&i.length>1){let c=Math.abs(i[1]-i[0]),l=0.1;if(n<s+c*0.1)s-=c,i.unshift(s);if(o>a-c*0.1)a+=c,i.push(a)}return{domainMin:s,domainMax:a,ticks:i}}function JDo({values:e,graphs:t,experiment:n}){let o=z1e(n?.start_time_ms),r=z1e(n?.end_time_ms),i=t.map((m)=>z1e(m.start_time_ms)).filter((m)=>m!==void 0),s=t.map((m)=>z1e(m.end_time_ms)).filter((m)=>m!==void 0),a=o??(i.length>0?Math.min(...i):void 0),c=r??(s.length>0?Math.max(...s):void 0);if(a===void 0||c===void 0||a===c)return $1e(e);let l=Math.min(a,c),h=Math.max(a,c),u=(h-l)*0.12,_=NSt(l,h).filter((m)=>m>l+u&&m<h-u),p=ZDo([l,..._,h]);return{domainMin:l,domainMax:h,ticks:p,tickLabelOverrides:new Map([[l,ur(l)],[h,ur(h)]])}}function z1e(e){return typeof e==="number"&&Number.isFinite(e)?e:void 0}function ZDo(e){let t=[...e].sort((o,r)=>o-r),n=[];for(let o of t){let r=n[n.length-1];if(r===void 0||Math.abs(o-r)>0.000000000001)n.push(o)}return n}function NSt(e,t,n=6){let o=t-e;if(!Number.isFinite(o)||o<=Number.EPSILON)return[e,t];let r=eNo(o/Math.max(1,n-1)),i=Math.floor(e/r)*r,s=Math.ceil(t/r)*r,a=[];for(let c=i;c<=s+r/2;c+=r)a.push(Number.parseFloat(c.toPrecision(12)));return a}function eNo(e){if(!Number.isFinite(e)||e<=0)return 1;let t=Math.floor(Math.log10(e)),n=e/10**t,o;if(n<=1)o=1;else if(n<=2)o=2;else if(n<=5)o=5;else o=10;return o*10**t}function tNo(e,t){return nc("rect",{class:"background",x:"0",y:"0",width:ur(e),height:ur(t)})}function nNo(e,t,n,o){return nc("defs",{},[nc("clipPath",{id:e},[nc("rect",{x:ur(t),y:ur(cm.top),width:ur(n),height:ur(o)})])])}function oNo({timeAxis:e,valueAxis:t,scaleX:n,scaleY:o,plotLeft:r,plotWidth:i,plotHeight:s}){let a=cm.top,c=cm.top+s,l=r,h=r+i,d=[];for(let u of e.ticks){let _=ur(n(u));d.push(nc("line",{class:"grid-line grid-line-x",x1:_,y1:ur(a),x2:_,y2:ur(c)}))}for(let u of t.ticks){let _=ur(o(u));d.push(nc("line",{class:"grid-line grid-line-y",x1:ur(l),y1:_,x2:ur(h),y2:_}))}return nc("g",{class:"grid"},d)}function L8t(e,t,n,o){if(!Number.isFinite(e)||!Number.isFinite(t)){let i=(n+o)/2;return()=>i}let r=t-e;if(Math.abs(r)<Number.EPSILON){let i=(n+o)/2;return()=>i}return(i)=>n+(i-e)/r*(o-n)}function rNo(e,t,n){return nc("rect",{class:"plot-background",x:ur(e),y:ur(cm.top),width:ur(t),height:ur(n)})}function iNo(){let e=`
:root { color-scheme: light; }
svg { font-family: 'Inter', 'Helvetica Neue', Arial, sans-serif; }
.background { fill: ${Zh.schematic.background}; }
.plot-background { fill: #ffffff; }
.grid-line { stroke: rgba(0, 0, 0, 0.08); stroke-width: 1; }
.axis { stroke: rgba(0, 0, 0, 0.6); stroke-width: 1.5; }
.axis-tick { stroke: rgba(0, 0, 0, 0.6); stroke-width: 1; }
.axis-label { fill: rgba(0, 0, 0, 0.75); font-size: 12px; }
.axis-title { fill: rgba(0, 0, 0, 0.9); font-size: 14px; font-weight: 600; }
.legend-label { fill: rgba(0, 0, 0, 0.75); font-size: 11px; }
.legend-line { stroke-width: 3; }
.scope-channel-card { fill: #ffffff; stroke: rgba(0, 0, 0, 0.22); stroke-width: 1; }
.scope-channel-header-text { fill: #ffffff; font-size: 14px; font-weight: 700; }
.scope-channel-detail { fill: rgba(0, 0, 0, 0.42); font-size: 14px; }
.simulation-line { fill: none; stroke-width: 2.5; }
.simulation-point { stroke-width: 0; }
.chart-title { fill: rgba(0, 0, 0, 0.85); font-size: 18px; font-weight: 600; }
`;return nc("style",{},[TI(e)])}function H8t(e,t){let n=e[t];if(typeof n!=="string")return;return n}function sNo(e,t,n,o){let i=[4,8],s=i.map((u)=>ur(u)).join(" "),c=i.reduce((u,_)=>u+_,0)/3,l=[];e.forEach((u,_)=>{if(u.points.length===0)return;let p=[];u.points.forEach((y,x)=>{let C=ur(n(y.timeMs)),b=ur(o(y.displayValue));p.push(`${x===0?"M":"L"} ${C} ${b}`)});let m={class:"simulation-line",d:p.join(" "),stroke:u.color,"clip-path":`url(#${t})`,[BSt(u.graph)]:yze(u.graph)};if(u.graph.source_component_id)m["data-source-component-id"]=u.graph.source_component_id;let A=H8t(u.graph,"source_probe_id");if(A)m["data-source-probe-id"]=A;let g=H8t(u.graph,"source_probe_name");if(g)m["data-source-probe-name"]=g;if(u.graph.subcircuit_connectivity_map_key)m["data-subcircuit-connectivity-map-key"]=u.graph.subcircuit_connectivity_map_key;let f=u.points.map((y)=>{let x=ur(n(y.timeMs)),C=ur(o(y.displayValue));return nc("circle",{class:"simulation-point",cx:x,cy:C,r:"2.5",fill:u.color,"clip-path":`url(#${t})`})});l.push({entry:u,graphIndex:_,pathAttributes:m,pointElements:f})});let h=[];for(let u=0;u<3;u++)for(let _ of l){let p=(_.graphIndex+u)%3,m=ur(p*c);h.push(nc("path",{..._.pathAttributes,"stroke-dasharray":s,"stroke-dashoffset":m}))}let d=l.flatMap((u)=>u.pointElements);return nc("g",{class:"data-series"},[...h,...d])}function aNo(e,t){if(!e?.name)return null;return nc("text",{class:"chart-title",x:ur(t/2),y:ur(cm.top-40),"text-anchor":"middle"},[TI(e.name)])}function cNo(e,t,n,o){let r=o.map((i,s)=>nc("tspan",{x:"20",dy:s===0?"0":String(RSt)},[TI(i)]));return nc("g",{class:"legend-item",transform:`translate(${ur(t)} ${ur(n)})`},[nc("line",{class:"legend-line",x1:"0",y1:"0",x2:"16",y2:"0",stroke:e.color}),nc("text",{class:"legend-label",x:"20",y:"0","dominant-baseline":"middle"},r)])}function hNo(e){let t=e.split("_");if(t.length<=1)return[e];let n=[],o=t[0]??"";for(let r=1;r<t.length;r++){let i=t[r]??"",s=`${o}_${i}`;if(s.length>lNo)n.push(o),o=i;else o=s}if(o)n.push(o);return n}function uNo(e,t){let n=cm.top,o=e.map((r)=>{let i=t-cm.right+10,s=hNo(r.label),a=cNo(r,i,n,s),c=s.length*RSt;return n+=Math.max(c,dNo),a});return nc("g",{class:"legend"},o)}function QSt(e,t){let n=Math.floor((t+uj)/(lz+uj)),o=Math.max(1,Math.min(n,e)),r=Math.max(1,Math.ceil(e/o)),i=o*lz+(o-1)*uj,s=r*q1e+(r-1)*uj;return{columns:o,rows:r,x:Math.max(0,(t-i)/2),height:s}}function mNo(e,t,n){let o=QSt(e.length,t),r=[];for(let[i,s]of e.entries()){let a=i%o.columns,c=Math.floor(i/o.columns);r.push(_No(s,i,o.x+a*(lz+uj),n+cze+c*(q1e+uj)))}return nc("g",{class:"scope-legend"},r)}function _No(e,t,n,o){let r=e.scopeTraceDisplay,i=Cx(e.graph)?"A":"V",s=r&&fie(r)?hze(r.valuePerDiv,i):`1 ${i}`,a=hze(r?.center??0,i),c=jDo(r?.offsetDivs??0),l=`Ch${t+1}`,d=[e.label===l?void 0:e.label,`${s}/div`,c,a].filter((_)=>Boolean(_)),u=d.length>1?(q1e-O1e-FFe*2-pNo)/(d.length-1):0;return nc("g",{class:"scope-channel",transform:`translate(${ur(n)} ${ur(o)})`,[BSt(e.graph)]:yze(e.graph)},[nc("rect",{class:"scope-channel-card",x:"0",y:"0",width:ur(lz),height:ur(q1e),rx:"6",ry:"6"}),nc("rect",{x:"0",y:"0",width:ur(lz),height:ur(O1e),rx:"6",ry:"6",fill:e.color}),nc("rect",{x:"0",y:ur(O1e-6),width:ur(lz),height:"6",fill:e.color}),nc("text",{class:"scope-channel-header-text",x:ur(lz/2),y:"14","text-anchor":"middle"},[TI(l)]),...d.map((_,p)=>nc("text",{class:"scope-channel-detail",x:ur(FFe),y:ur(O1e+FFe+p*u),"dominant-baseline":"hanging"},[TI(_)]))])}function gNo(e){let t=Math.ceil(e/2),n=Math.floor(e/2);return{left:F8t(t),right:F8t(n)}}function F8t(e){if(e<=1)return 0;let t=10+(e-1)*lze+6+GDo+UDo;return Math.max(0,t-cm.left)}function xze(e){return e.type==="simulation_transient_voltage_graph"||e.type==="simulation_transient_current_graph"||e.type==="simulation_dc_operating_point_voltage"||e.type==="simulation_dc_operating_point_current"||e.type==="simulation_dc_sweep_voltage_graph"||e.type==="simulation_dc_sweep_current_graph"||e.type==="simulation_ac_sweep_voltage_graph"||e.type==="simulation_ac_sweep_current_graph"}function ANo(e){return e?.type==="simulation_transient_current_graph"}function fNo(e){return e?.type==="simulation_transient_voltage_graph"}function Cze(e){return e?.type==="simulation_experiment"}function kSt(e){return e?.type==="simulation_voltage_probe"}function LSt(e){return e?.type==="simulation_current_probe"}function HSt(e){return e?.type==="simulation_oscilloscope_trace"}function yNo(e,t){let n=CNo(e),o=TSt(e),r=Math.min(n.length,o.length),i=[],s=xNo(t);for(let a=0;a<r;a++){let c=Number(n[a]??Number.NaN),l=Number(o[a]??Number.NaN);if(!Number.isFinite(c)||!Number.isFinite(l))continue;i.push({timeMs:c,rawValue:l,displayValue:s(l)})}return i}function xNo(e){if(!fie(e))return(r)=>r;let t=e.center??0,n=e.offsetDivs??0,o=e.valuePerDiv;return(r)=>n+(r-t)/o}function CNo(e){let t=TSt(e);if(Array.isArray(e.timestamps_ms)&&e.timestamps_ms.length===t.length)return e.timestamps_ms.map((i)=>Number(i));let n=t.length;if(n===0)return[];let o=[];for(let i=0;i<n;i++)o.push(e.start_time_ms+e.time_per_step*i);let r=o.length>0?o[o.length-1]:void 0;if(r!==void 0&&Number.isFinite(e.end_time_ms)&&Number.isFinite(r)&&Math.abs(r-e.end_time_ms)>e.time_per_step/2)o.push(e.end_time_ms);return o}function J1e(e,t){let n=e[t];if(typeof n!=="string")return;return n}function bNo(e,t,n,o){let r=Cx(e)?"I":"V";if(n?.displayName)return n.displayName;if(e.simulation_parameter_sweep_coordinate&&e.name)return e.name;if(t?.name)return`${r}(${t.name})`;let i=J1e(e,"source_probe_name");if(i)return`${r}(${i})`;if(e.source_component_id){let s=o.get(e.source_component_id);if(s)return`${r}(${s})`}if(e.name)return e.name;if(e.source_component_id)return`Probe ${e.source_component_id}`;return yze(e)}function INo(e,t,n,o,r,i){if(Cx(e)){let c=o.get(e.simulation_transient_current_graph_id);if(c)return c;let l=J1e(e,"source_probe_id")??(t?.type==="simulation_current_probe"?t.simulation_current_probe_id:void 0);return l?i.get(l):void 0}let s=n.get(e.simulation_transient_voltage_graph_id);if(s)return s;let a=J1e(e,"source_probe_id")??(t?.type==="simulation_voltage_probe"?t.simulation_voltage_probe_id:void 0);return a?r.get(a):void 0}function vNo(e,t,n,o,r){let i=J1e(e,"source_probe_id");if(i){let s=Cx(e)?n.get(i):t.get(i);if(s)return s}if(!e.source_component_id)return;return Cx(e)?r.get(e.source_component_id):o.get(e.source_component_id)}function SNo(e,t){if(!t)return;return{displayName:t.display_name,color:t.color,center:t.display_center_value,offsetDivs:t.display_center_offset_divs,valuePerDiv:Cx(e)?t.amps_per_div:t.volts_per_div}}function PNo(e,t){let n=Array.isArray(Zh.simulation_palette)?Zh.simulation_palette:Array.isArray(Zh.palette)?Zh.palette:[],o=t.filter(kSt),r=t.filter(LSt),i=t.filter(HSt),s=new Map,a=new Map,c=new Map,l=new Map,h=new Map,d=new Map,u=new Map,_=new Map,p=new Map,m=new Map,A=new Map,g=new Map;for(let f of i){if(f.simulation_transient_voltage_graph_id)p.set(f.simulation_transient_voltage_graph_id,f);if(f.simulation_transient_current_graph_id)m.set(f.simulation_transient_current_graph_id,f);if(f.simulation_voltage_probe_id)A.set(f.simulation_voltage_probe_id,f);if(f.simulation_current_probe_id)g.set(f.simulation_current_probe_id,f)}for(let f of o){if(h.set(f.simulation_voltage_probe_id,f),f.name&&f.source_component_id)s.set(f.source_component_id,f.name);if(f.color&&f.source_component_id)a.set(f.source_component_id,f.color);if(f.source_component_id)u.set(f.source_component_id,f)}for(let f of r){if(d.set(f.simulation_current_probe_id,f),f.name&&f.source_component_id)c.set(f.source_component_id,f.name);if(f.color&&f.source_component_id)l.set(f.source_component_id,f.color);if(f.source_component_id)_.set(f.source_component_id,f)}return e.map((f,y)=>{let x=vNo(f,h,d,u,_),C=INo(f,x,p,m,A,g),b=SNo(f,C),I=yNo(f,b),v=ENo(n,y),P=MNo(f,x,Cx(f)?l:a),M=f.color??b?.color??P??v,B=bNo(f,x,b,Cx(f)?c:s);return{graph:f,points:I,color:M,label:B,scopeTraceDisplay:b,usesScopeTraceDisplay:fie(b)}}).filter((f)=>f.points.length>0)}function ENo(e,t){if(e.length===0)return Q8t;return e[t%e.length]??Q8t}function MNo(e,t,n){if(t?.color)return t.color;if(!e.source_component_id)return;return n.get(e.source_component_id)}function FSt({circuitJson:e,simulation_experiment_id:t,simulation_transient_current_graph_ids:n,simulation_transient_voltage_graph_ids:o,simulation_result_ids:r,ac_sweep_view:i="magnitude",width:s=VDo,height:a=YDo,includeVersion:c}){let l=o?new Set(o):null,h=n?new Set(n):null,d=Boolean(l||h),u=r?new Set(r):null,_=e.find((X)=>Cze(X)&&X.simulation_experiment_id===t),p=e.filter((X)=>xze(X)&&X.simulation_experiment_id===t&&(!u||u.has(wSt(X)))&&(!d||X.type==="simulation_transient_voltage_graph"&&(l?.has(X.simulation_transient_voltage_graph_id)??!1)||X.type==="simulation_transient_current_graph"&&(h?.has(X.simulation_transient_current_graph_id)??!1))),m=ODo({results:p,acSweepView:i,experiment:_}),A=m.graphs;if(A.length===0)throw Error(`No simulation analysis results found for simulation_experiment_id "${t}"`);let g=PNo(A,e),f=g.flatMap((X)=>X.points);if(f.length===0)throw Error(`Simulation results for simulation_experiment_id "${t}" do not contain any datapoints`);let y=f.map((X)=>X.timeMs),x;if(m.usesLogarithmicXValues)x=wNo(y);else if(m.xAxisTitle==="Time (ms)")x=JDo({values:y,graphs:A,experiment:_});else x=$1e(y);let C=$1e(f.map((X)=>X.displayValue),!0),b=g.some((X)=>X.usesScopeTraceDisplay),I=b?gNo(g.length):{left:0,right:0},v=s+I.left+I.right,P=b?QSt(g.length,v):null,M=P?a+cze+P.height+cze:a,B=Math.max(1,s-cm.left-cm.right),T=Math.max(1,a-cm.top-cm.bottom),N=cm.left+I.left,D=L8t(x.domainMin,x.domainMax,N,N+B),L=L8t(C.domainMin,C.domainMax,cm.top+T,cm.top),H=XDo(t),V=YN(e),O=GN,U=aNo(_,v),j=[iNo(),tNo(v,M),nNo(H,N,B,T),rNo(N,B,T),oNo({timeAxis:x,valueAxis:C,scaleX:D,scaleY:L,plotLeft:N,plotWidth:B,plotHeight:T}),sNo(g,H,D,L),qDo({timeAxis:x,valueAxis:C,graphs:g,scaleX:D,scaleY:L,plotLeft:N,plotWidth:B,plotHeight:T,yAxisTitle:m.yAxisTitle??WDo(g),xAxisTitle:m.xAxisTitle,usesScopeTraceDisplay:b}),b?mNo(g,v,a):uNo(g,v),...U?[U]:[]],Y=nc("svg",{xmlns:"http://www.w3.org/2000/svg",width:v.toString(),height:M.toString(),style:`background-color: ${Zh.schematic.background}`,viewBox:`0 0 ${ur(v)} ${ur(M)}`,"data-simulation-experiment-id":t,..._?.name&&{"data-simulation-experiment-name":_.name},...V&&{"data-software-used-string":V},...c&&{"data-circuit-to-svg-version":O}},j);return ON(Y)}function DNo({circuitJson:e,simulation_experiment_id:t,simulation_transient_current_graph_ids:n,simulation_transient_voltage_graph_ids:o,simulation_result_ids:r,ac_sweep_view:i,width:s=BNo,height:a=TNo,schematicHeightRatio:c=zSt,schematicOptions:l,includeVersion:h,graphAboveSchematic:d=!1,showErrorsInTextOverlay:u}){let _=e.filter((L)=>!Cze(L)&&!xze(L)),p=RNo(c),m=Math.max(1,a*p),A=Math.max(1,a-m),g=m+A,f=g===0?1:a/g,y=m*f,x=A*f,C=uz(_,{...l,width:s,height:y,includeVersion:!1,showErrorsInTextOverlay:u}),b=FSt({circuitJson:e,simulation_experiment_id:t,simulation_transient_current_graph_ids:n,simulation_transient_voltage_graph_ids:o,simulation_result_ids:r,ac_sweep_view:i,width:s,height:x,includeVersion:!1}),I=eze(aze.parseSync(C)),v=eze(aze.parseSync(b)),P=NNo(v)??{width:s,height:x},M=P.width>0?s*(P.height/P.width):x,B=y+M,T=[];if(d)T.push(hie(v,0,0,s,M)),T.push(hie(I,0,M,s,y));else T.push(hie(I,0,0,s,y)),T.push(hie(v,0,y,s,M));let N=YN(_),D={name:"svg",type:"element",value:"",attributes:{xmlns:"http://www.w3.org/2000/svg",width:am(s),height:am(B),viewBox:`0 0 ${am(s)} ${am(B)}`,"data-simulation-experiment-id":t,...N&&{"data-software-used-string":N},...h&&{"data-circuit-to-svg-version":GN}},children:T};return ON(D)}function NNo(e){let t=e.attributes?.viewBox;if(typeof t!=="string")return null;let n=t.trim().split(/[\s,]+/).map((i)=>Number.parseFloat(i));if(n.length!==4)return null;let o=n.at(2),r=n.at(3);if(!Number.isFinite(o)||!Number.isFinite(r))return null;if(o===void 0||r===void 0)return null;if(o<=0||r<=0)return null;return{width:o,height:r}}function RNo(e){if(!Number.isFinite(e))return zSt;if(e<=0)return 0;if(e>=1)return 1;return e}function QNo(e,t){let{POSITIVE_INFINITY:n,POSITIVE_INFINITY:o,NEGATIVE_INFINITY:r,NEGATIVE_INFINITY:i}=Number,s=e.filter((M)=>M.type==="pcb_board"||M.type==="pcb_panel"||M.type==="pcb_solder_paste"&&M.layer===t.layer);for(let M of s)if(M.type==="pcb_board"){if(M.outline&&Array.isArray(M.outline)&&M.outline.length>=3)P(M.outline);else if("center"in M&&"width"in M&&"height"in M)v(M.center,M.width,M.height)}else if(M.type==="pcb_panel"){let B=M,T=Ke.parse(B.width),N=Ke.parse(B.height);if(T!==void 0&&N!==void 0){let D=B.center??{x:T/2,y:N/2};v(D,T,N)}}else if(M.type==="pcb_solder_paste"&&M.shape==="polygon")P(M.points);else if(M.type==="pcb_solder_paste"&&"x"in M&&"y"in M)v({x:M.x,y:M.y},0,0);let a=1,c=r-n+2*a,l=i-o+2*a,h=t.width??800,d=t.height??600,u=h/c,_=d/l,p=Math.min(u,_),m=(h-c*p)/2,A=(d-l*p)/2,g=DM.compose(DM.translate(m-n*p+a*p,d-A+o*p-a*p),DM.scale(p,-p)),f={transform:g,layer:t.layer,colorMap:_0},y=s.sort((M,B)=>(z8t.indexOf(B.type)??9999)-(z8t.indexOf(M.type)??9999)).flatMap((M)=>kNo({elm:M,ctx:f})),x=YN(e),C=GN,b=[{name:"style",type:"element",children:[{type:"text",value:""}]},{name:"rect",type:"element",attributes:{class:"boundary",x:"0",y:"0",fill:"#000",width:h.toString(),height:d.toString()}},LNo(g,n,o,r,i),...y].filter((M)=>M!==null);if(t?.showErrorsInTextOverlay){let M=fj(e);if(M)b.push(M)}let I={name:"svg",type:"element",attributes:{xmlns:"http://www.w3.org/2000/svg",width:h.toString(),height:d.toString(),...x&&{"data-software-used-string":x},...t.includeVersion&&{"data-circuit-to-svg-version":C}},value:"",children:b};try{return ON(I)}catch(M){throw console.error("Error stringifying SVG object:",M),M}function v(M,B,T){let N=B/2,D=T/2;n=Math.min(n,M.x-N),o=Math.min(o,M.y-D),r=Math.max(r,M.x+N),i=Math.max(i,M.y+D)}function P(M){for(let B of M)n=Math.min(n,B.x),o=Math.min(o,B.y),r=Math.max(r,B.x),i=Math.max(i,B.y)}}function kNo({elm:e,ctx:t}){let{transform:n}=t;switch(e.type){case"pcb_board":return E7t(e,t);case"pcb_solder_paste":return T7t(e,t);default:return[]}}function LNo(e,t,n,o,r){let[i,s]=DM.applyToPoint(e,[t,n]),[a,c]=DM.applyToPoint(e,[o,r]),l=Math.abs(a-i),h=Math.abs(c-s),d=Math.min(i,a),u=Math.min(s,c);return{name:"rect",type:"element",value:"",children:[],attributes:{class:"pcb-boundary",fill:"none",stroke:"#fff","stroke-width":"0.3",x:d.toString(),y:u.toString(),width:l.toString(),height:h.toString()}}}var az,uie,X8t,DI,j8t,oie,VFe,i7t,I1s,BM,pj,GFe,Y1e,UFe,rie,s7t,a7t,l7t,VN,WFe,EM,MM,d7t,XFe,u7t,jFe,NI,cz,m7t,iA,g7t,tg,A7t,KFe,f7t,y7t,x7t,C7t,b7t,I7t,rj,$Fe,sie,M7t,T1s,qFe,HC,w7t,a7,B7t,Q1s,D7t,G1e,N7t,R7t,ij,F1s,TM,sj,JFe,O1s,k7t,aie,cie,V1s,yj,s7,L7t,H7t,F7t,lie,z7t,U1e,dz,U7t,aj,X1s,Cj,J7t,FC,g0,rSt,iSt,nze,oze,cSt,lSt,rze,dSt,tys,ize,rys,If,iys,W1e,mSt,_St,sze,ySt,CSt,cj,Aie,LN,lj,vSt,wM,K1e,MSt,Z1e,aze,lys,DM,iMo,Xre=(e,t)=>({name:"g",type:"element",value:"",attributes:e,children:t}),xx=0.000000001,_0,g1s,A1s,f1s,y1s,yMo,BI=(e,t,n=[])=>({name:e,type:"element",value:"",attributes:t,children:n}),IFe=(e,t)=>BI("text",t,[{name:"",type:"text",value:e,attributes:{},children:[]}]),w1e,DMo,qvt=100,QMo,pz="TscircuitAlphabet",Jvt="data-tscircuit-alphabet-font",c7t,lm,S1s,two="rgba(255,255,255,0.5)",nwo="rgba(255,255,255,0.2)",rwo=1.5,iwo=0.6,swo=0.3,Zh,lwo,dwo,uwo,mwo,gwo,p7t="BEND LINE",fwo,n8t=0.94,B1e=0.045,_7t,o8t,Two=0,T1e=1,nj=0.2,r8t=1.4,i8t=0.53,Rwo=0,s8t=0.05,_4=4,a8t=8,v7t=11,mj=1,hj=5,c8t=1.5,S7t=2,EFe,MFe,iie,Gwo=15,Uwo=10,Wwo=0.2,Xwo=50,eBo=(e,t)=>{let n=Ho(t).pcb_smtpad.get(e);if(n&&"x"in n&&"y"in n)return{x:n.x,y:n.y};let o=Ho(t).pcb_plated_hole.get(e);if(o&&"x"in o&&"y"in o)return{x:o.x,y:o.y};return null},tBo=(e,t,n,o)=>{let r=n.getIdsConnectedToNet(t),i=null,s=1/0;for(let a of r){let c=eBo(a,o);if(c){let l=e.x-c.x,h=e.y-c.y,d=Math.sqrt(l*l+h*h);if(d>0&&d<s)s=d,i=c}}return i},gze="pcb-keepout-pattern",dj=20,iBo=5,wFe="rgba(255, 107, 107, 0.2)",dBo="rgba(255, 255, 255, 0.5)",l8t="pcb-grid-pattern",h8t,gBo=0.1,xBo,GN,SBo=({circuitJson:e,drawPaddingOutsideBoard:t,baseBounds:n,viewportOptions:o})=>{let r=t?1:0,i=t||!n.hasBoardBounds?n.minX:n.boardMinX,s=t||!n.hasBoardBounds?n.minY:n.boardMinY,a=t||!n.hasBoardBounds?n.maxX:n.boardMaxX,c=t||!n.hasBoardBounds?n.maxY:n.boardMaxY,l=!1,{POSITIVE_INFINITY:h,POSITIVE_INFINITY:d,NEGATIVE_INFINITY:u,NEGATIVE_INFINITY:_}=Number,p=new Map,m=new Map;for(let A of e)if(A.type==="pcb_panel"){let g=A,f=d8t(g.center,g.width,g.height);if(!f)continue;if(h=Math.min(h,f.minX),d=Math.min(d,f.minY),u=Math.max(u,f.maxX),_=Math.max(_,f.maxY),l=!0,g.pcb_panel_id)p.set(g.pcb_panel_id,f)}else if(A.type==="pcb_board"){let g=A,y=PBo(g.outline)??d8t(g.center,g.width,g.height);if(y&&g.pcb_board_id)m.set(g.pcb_board_id,y)}if(o?.viewport){let{minX:A,minY:g,maxX:f,maxY:y}=o.viewport;i=A,s=g,a=f,c=y,r=0}else if(o?.viewportTarget?.pcb_panel_id){let A=p.get(o.viewportTarget.pcb_panel_id);if(!A)throw Error(`Viewport target panel '${o.viewportTarget.pcb_panel_id}' not found`);i=A.minX,s=A.minY,a=A.maxX,c=A.maxY,r=0}else if(o?.viewportTarget?.pcb_board_id){let A=m.get(o.viewportTarget.pcb_board_id);if(!A)throw Error(`Viewport target board '${o.viewportTarget.pcb_board_id}' not found`);i=A.minX,s=A.minY,a=A.maxX,c=A.maxY,r=0}else if(l)i=h,s=d,a=u,c=_;return{boundsMinX:i,boundsMinY:s,boundsMaxX:a,boundsMaxY:c,padding:r}},EBo=0.5,MBo=0.42,wBo=0.58,BBo=0.75,m8t="rgb(255, 208, 66)",Q7t="#ff4d4d",RBo=(e)=>({type:"text",value:e,name:"",attributes:{},children:[]}),DFe=({label:e,x:t,y:n,style:o,anchor:r="start"})=>e?[{name:"text",type:"element",value:"",attributes:{x:t.toString(),y:n.toString(),fill:Q7t,"font-family":"monospace","font-size":o.fontSize.toString(),"font-weight":"600","text-anchor":r},children:[RBo(e)]}]:[],QBo=(e)=>({"data-type":"pcb_debug_object","data-pcb-layer":"overlay","data-pcb-debug-object-id":e.pcb_debug_object_id,"data-debug-shape":e.shape}),FBo,N1e,YBo,FN=(e,t)=>t??YBo[e],g4=(e,t,n)=>Math.abs(e.a)*FN(t,n),RFe="rgb(190, 190, 190)",jre="rgb(210, 210, 210)",Kre="rgb(190, 190, 190)",$re="rgb(210, 210, 210)",g8t,tTo="rgb(26, 115, 143)",nTo="rgba(0,0,0,0.9)",rTo="rgba(120, 120, 120, 0.6)",iTo="rgba(255, 255, 255, 0.9)",QFe="rgb(50, 50, 50)",qre="rgb(218, 165, 32)",Jre="rgb(40, 40, 40)",Zre="rgb(218, 165, 32)",A8t="rgb(255, 255, 255)",f8t="rgb(0, 0, 0)",hTo="rgba(0, 0, 0, 0.6)",dTo="rgb(200, 200, 200)",uTo="rgb(0, 0, 0)",O7t=1.6,mTo=0.5238095238095238,_To=0.6,V7t=0.1,Y7t=0.1,ZFe=3,G7t=0.1,gTo=0.8,ATo=({left_labels:e,right_labels:t,transform:n,soup:o,board_bounds:r,svgWidth:i,svgHeight:s,styleScale:a})=>{let c=new Map,l={transform:n,soup:o,board_bounds:r};return y8t("left",e,{...l,svgHeight:s,styleScale:a},c),y8t("right",t,{...l,svgHeight:s,styleScale:a},c),c},x8t,C8t,_ie=(e)=>{if(!e)return 0;let t=0;for(let n of e){let o=C8t[n];if(o)t+=o.width;else t+=C8t["?"].width}return t/27},W7t=0.65,X7t=0.08,xj=(e)=>{switch(e){case"top":return{x:0,y:-1};case"bottom":return{x:0,y:1};case"left":return{x:1,y:0};case"right":return{x:-1,y:0}}throw Error(`Invalid side: ${e}`)},HN=0.3,_j=0.3,gj=0.06,j7t=0.2,K7t=(e)=>({"data-circuit-json-type":"schematic_net_label","data-schematic-net-label-id":e.schematic_net_label_id}),STo,b8t,MTo=(e,t)=>{let n=e<0?e+2*Math.PI:e,o=t<0?t+2*Math.PI:t,r=Math.abs(n-o);if(r>Math.PI)r=2*Math.PI-r;return r},$7t=({schPorts:e,symbol:t,schComponent:n})=>{let o=e.map((a)=>{let c=a.center.x-n.center.x,l=a.center.y-n.center.y;return{port:a,angle:Math.atan2(l,c)}}),r=t.ports.map((a)=>{let c=a.x-t.center.x,l=a.y-t.center.y;return{port:a,angle:Math.atan2(l,c)}});o.sort((a,c)=>a.angle-c.angle),r.sort((a,c)=>a.angle-c.angle);let i=[],s=new Set;for(let a of o){let c=null;for(let l of r){if(s.has(l.port))continue;let h=MTo(a.angle,l.angle);if(c===null||h<c.angleDiff)c={symbolPort:l.port,angleDiff:h}}if(c&&c.angleDiff<Math.PI/4)i.push({schPort:a.port,symbolPort:c.symbolPort}),s.add(c.symbolPort)}return i},eSt=(e,t)=>{if(e.column_widths&&e.column_widths.length>0&&e.row_heights&&e.row_heights.length>0){let h=(d)=>{if(typeof d==="number")return d;if(d.endsWith("mm"))return parseFloat(d);if(d.endsWith("in"))return parseFloat(d)*25.4;return parseFloat(d)};return{column_widths:e.column_widths.map(h),row_heights:e.row_heights.map(h)}}let n=t.filter((h)=>h.type==="schematic_table_cell"&&h.schematic_table_id===e.schematic_table_id);if(n.length===0)return{column_widths:[],row_heights:[]};let o=n.reduce((h,d)=>Math.max(h,d.end_column_index),-1)+1,r=n.reduce((h,d)=>Math.max(h,d.end_row_index),-1)+1,{cell_padding:i=0.2}=e,s=Array(o).fill(0),a=Array(r).fill(0),c={},l={};for(let h of n){let d=FN("reference_designator",h.font_size),_=_ie(h.text??"")*d+2*i,p=d*1.2+2*i,m=`${h.start_row_index}-${h.start_column_index}`;c[m]=_,l[m]=p}for(let h=0;h<r;h++)for(let d=0;d<o;d++){let u=`${h}-${d}`;if(c[u]&&c[u]>s[d])s[d]=c[u];if(l[u]&&l[u]>a[h])a[h]=l[u]}for(let h of n){if(h.start_column_index===h.end_column_index&&h.start_row_index===h.end_row_index)continue;let d=`${h.start_row_index}-${h.start_column_index}`,u=c[d],_=l[d];if(u===void 0||_===void 0)continue;let p=0;for(let A=h.start_column_index;A<=h.end_column_index;A++)p+=s[A];if(u>p){let g=(u-p)/(h.end_column_index-h.start_column_index+1);for(let f=h.start_column_index;f<=h.end_column_index;f++)s[f]+=g}let m=0;for(let A=h.start_row_index;A<=h.end_row_index;A++)m+=a[A];if(_>m){let g=(_-m)/(h.end_row_index-h.start_row_index+1);for(let f=h.start_row_index;f<=h.end_row_index;f++)a[f]+=g}}return{column_widths:s,row_heights:a}},NTo=10.16,RTo=1.1,zN,QTo,kTo,$1s,R1e,gie="image/svg+xml",Km=(e)=>Math.abs(e.a)*0.02,tze=({text:e,realCenter:t,realToScreenTransform:n})=>{let o=rSt.applyToPoint(n,t);return{type:"element",name:"text",value:"",attributes:{x:o.x.toString(),y:o.y.toString(),fill:"red","text-anchor":"middle","dominant-baseline":"middle","font-family":"sans-serif","font-size":`${g4(n,"error")}px`},children:[{type:"text",value:e,name:"",attributes:{},children:[]}]}},zTo=({schNetLabel:e,realToScreenTransform:t,colorMap:n})=>{if(!e.text)return[];let o=e.text.startsWith("N_"),r=o?e.text.slice(2):e.text,i=K7t(e),s=[],a=Es[e.symbol_name];if(!a){let H=tze({text:`Symbol not found: ${e.symbol_name}`,realCenter:e.center,realToScreenTransform:t});return H.attributes={...H.attributes,...i},s.push(H),s}let c=a.primitives.filter((H)=>H.type==="path"),l=a.primitives.filter((H)=>H.type==="text"),h=a.primitives.filter((H)=>H.type==="circle"),d=a.primitives.filter((H)=>H.type==="box"),u={minX:Math.min(...c.flatMap((H)=>H.points.map((V)=>V.x))),maxX:Math.max(...c.flatMap((H)=>H.points.map((V)=>V.x))),minY:Math.min(...c.flatMap((H)=>H.points.map((V)=>V.y))),maxY:Math.max(...c.flatMap((H)=>H.points.map((V)=>V.y)))},_=FN("net_label"),m=j1e({...e,text:r})+HN*2+gj*r.length+_j,A=xj(e.anchor_side),g=e.anchor_position??{x:e.center.x-A.x*m*_/2,y:e.center.y-A.y*m*_/2},y=g0.rotate(0/180*Math.PI),x={minX:Math.min(...a.primitives.flatMap((H)=>H.type==="path"?H.points.map((V)=>V.x):[])),maxX:Math.max(...a.primitives.flatMap((H)=>H.type==="path"?H.points.map((V)=>V.x):[])),minY:Math.min(...a.primitives.flatMap((H)=>H.type==="path"?H.points.map((V)=>V.y):[])),maxY:Math.max(...a.primitives.flatMap((H)=>H.type==="path"?H.points.map((V)=>V.y):[]))},C=a.ports?.[0]?{x:a.ports[0].x,y:a.ports[0].y}:{x:x.minX,y:(x.minY+x.maxY)/2},b=g0.applyToPoint(y,C),I=g0.compose(g0.translate(g.x-b.x,g.y-b.y),y,g0.scale(1)),[v,P]=g0.applyToPoint(g0.compose(t,I),[u.minX,u.minY]),[M,B]=g0.applyToPoint(g0.compose(t,I),[u.maxX,u.maxY]),T=Math.abs(B-P),N=Math.min(P,B),D=Math.abs(M-v),L=Math.min(v,M);s.push({name:"rect",type:"element",value:"",attributes:{class:"component-overlay sch-component-overlay sch-net-label-overlay",...i,x:L.toString(),y:N.toString(),width:D.toString(),height:T.toString(),fill:"transparent"},children:[]});for(let H of c){let V=H.points.map((O,U)=>{let[j,Y]=g0.applyToPoint(g0.compose(t,I),[O.x,O.y]);return`${U===0?"M":"L"} ${j} ${Y}`}).join(" ");s.push({name:"path",type:"element",attributes:{class:"sch-net-label-symbol-path",...i,d:V+(H.closed?" Z":""),stroke:n.schematic.component_outline,fill:"none","stroke-width":`${Km(t)}px`,"stroke-linecap":"round"},value:"",children:[]})}for(let H of l){let V=g0.applyToPoint(g0.compose(t,I),H),O=H.text;if(O==="{REF}")O=r||"";else if(O==="{VAL}")O="";let j=Math.abs(t.a)*0.1,Y={x:V.x,y:V.y};s.push({name:"text",type:"element",attributes:{class:"sch-net-label-symbol-text",...i,x:Y.x.toString(),y:Y.y.toString(),fill:n.schematic.label_local,"font-family":"sans-serif","text-anchor":STo[H.anchor],"dominant-baseline":b8t[H.anchor],"font-size":`${g4(t,"reference_designator")}px`,...o&&O===r?{style:"text-decoration: overline;"}:{}},children:Aze(O,H.text==="{REF}"?e.display_superscript:void 0,g4(t,"reference_designator"),b8t[H.anchor]),value:""})}for(let H of d){let V=g0.applyToPoint(g0.compose(t,I),H),O=g0.compose(t,I).a;s.push({name:"rect",type:"element",attributes:{class:"sch-net-label-symbol-box",...i,x:V.x.toString(),y:V.y.toString(),width:(H.width*O).toString(),height:(H.height*O).toString(),fill:"red"},value:"",children:[]})}for(let H of h){let V=g0.applyToPoint(g0.compose(t,I),H),O=g0.compose(t,I).a;s.push({name:"circle",type:"element",attributes:{class:"sch-net-label-symbol-circle",...i,cx:V.x.toString(),cy:V.y.toString(),r:(H.radius*O).toString(),fill:"none",stroke:n.schematic.component_outline,"stroke-width":`${Km(t)}px`},value:"",children:[]})}return s},OTo=({schNetLabel:e,realToScreenTransform:t,colorMap:n})=>{if(!e.text)return[];let o=e.text;if(e.symbol_name)return zTo({schNetLabel:e,realToScreenTransform:t,colorMap:n});let r=K7t(e),i=[],s=g4(t,"net_label"),a=FN("net_label"),c=j7t/a/2,l=j1e({...e,text:o}),h=FC.applyToPoint(t,e.center),d=xj(e.anchor_side),u={...d};u.y*=-1;let _=l+HN*2+gj*o.length+_j,p=e.anchor_position?FC.applyToPoint(t,e.anchor_position):{x:h.x-u.x*_*s/2,y:h.y-u.y*_*s/2},m=e.anchor_position??{x:e.center.x-d.x*_*a/2,y:e.center.y-d.y*_*a/2},A={left:0,top:-90,bottom:90,right:180}[e.anchor_side],g=[{x:0,y:0},{x:HN,y:c},{x:HN*2+_j+gj*o.length+l,y:c},{x:HN*2+_j+gj*o.length+l,y:-c},{x:HN,y:-c}].map((b)=>FC.applyToPoint(FC.compose(t,FC.translate(m.x,m.y),FC.scale(a),FC.rotate(A/180*Math.PI)),b)),f=`
    M ${g[0].x},${g[0].y}
    L ${g[1].x},${g[1].y}
    L ${g[2].x},${g[2].y}
    L ${g[3].x},${g[3].y}
    L ${g[4].x},${g[4].y}
    Z
  `;i.push({name:"path",type:"element",attributes:{class:"net-label sch-net-label",...r,d:f,fill:n.schematic.label_background,stroke:n.schematic.label_global,"stroke-width":`${Km(t)}px`},value:"",children:[]});let y={x:p.x+u.x*s*0.5,y:p.y+u.y*s*0.5},x={left:"start",top:"start",bottom:"start",right:"end"}[e.anchor_side],C={left:"",right:"",top:`rotate(90 ${y.x} ${y.y})`,bottom:`rotate(-90 ${y.x} ${y.y})`}[e.anchor_side];return i.push({name:"text",type:"element",attributes:{class:"net-label-text sch-net-label-text",...r,x:y.x.toString(),y:y.y.toString(),fill:n.schematic.label_global,"text-anchor":x,"dominant-baseline":"central","font-family":"sans-serif","font-variant-numeric":"tabular-nums","font-size":`${s}px`,transform:C},children:Aze(o,e.display_superscript,s),value:""}),i},VTo=0.02,YTo=({schPort:e,transform:t})=>{let n=iSt.applyToPoint(t,e.center),o=Math.abs(t.a)*VTo*2;return[{name:"g",type:"element",value:"",attributes:{class:"schematic-port-hover sch-port-hover","data-schematic-port-id":e.source_port_id,...e.schematic_sheet_id?{"data-schematic-sheet-id":e.schematic_sheet_id}:{}},children:[{name:"circle",type:"element",value:"",attributes:{cx:n.x.toString(),cy:n.y.toString(),r:o.toString(),fill:"red",opacity:"0"},children:[]}]}]},sSt=({component:e,transform:t,circuitJson:n})=>{let o=Ho(n).schematic_port.list({schematic_component_id:e.schematic_component_id}),r=[];for(let i of o)r.push(...YTo({schPort:i,transform:t}));return r},GTo=({schPort:e,transform:t,colorMap:n})=>{let{x:r,y:i}=e.center,s=[-1,1].map((a)=>{let c=nze.applyToPoint(t,{x:r-0.05,y:i-a*0.05}),l=nze.applyToPoint(t,{x:r+0.05,y:i+a*0.05});return`M ${c.x} ${c.y} L ${l.x} ${l.y}`}).join(" ");return{name:"path",type:"element",value:"",attributes:{class:"sch-port-no-connect","data-schematic-port-id":e.schematic_port_id,"data-source-port-id":e.source_port_id,d:s,fill:"none",stroke:n.schematic.no_connect,"stroke-width":`${Km(t)}px`,"stroke-linecap":"round"},children:[]}},v8t=0.02,UTo=({schPort:e,transform:t,circuitJson:n,colorMap:o})=>{let r=[],i=Math.abs(t.a)*v8t,s=Math.abs(t.a)*v8t,a=oze.applyToPoint(t,e.center),c=n.find((h)=>h.type==="source_port"&&h.source_port_id===e.source_port_id);if(!c?.do_not_connect)r.push({name:"circle",type:"element",value:"",attributes:{class:"component-pin sch-component-pin sch-port-indicator",cx:a.x.toString(),cy:a.y.toString(),r:i.toString(),fill:"none",stroke:o.schematic.component_outline,"stroke-width":s.toString(),"data-schematic-port-id":e.schematic_port_id},children:[]});let l=e.display_pin_label??c?.name;if(l){let h={...e.center},d=e.distance_from_component_edge??0,u=0.05,_="middle",p="";switch(e.facing_direction){case"left":h.x+=d/2,h.y+=0.05,_="start";break;case"right":h.x-=d/2,h.y+=0.05,_="end";break;case"up":h.y-=d/2,h.x-=0.05,_="middle";break;case"down":h.y+=d/2,h.x-=0.05,_="middle";break}let m=oze.applyToPoint(t,h),A=g4(t,"pin_number");if(e.facing_direction==="up"||e.facing_direction==="down")p=`rotate(-90 ${m.x} ${m.y})`;r.push({name:"text",type:"element",value:"",attributes:{class:"port-indicator-label sch-port-label",x:m.x.toString(),y:m.y.toString(),fill:o.schematic.component_outline,"font-family":"sans-serif","font-size":`${A*0.7}px`,"text-anchor":_,"dominant-baseline":"middle",...p&&{transform:p}},children:[{type:"text",value:l,name:"",attributes:{},children:[]}]})}return r},aSt=(e)=>({type:"element",name:"tspan",value:"",attributes:e.is_overlined?{"text-decoration":"overline"}:{},children:[{type:"text",name:"",value:e.text,attributes:{},children:[]}]}),WTo=(e)=>e.filter((t)=>t.text).map(aSt),XTo=(e)=>{let t=[[]];for(let n of e)n.text.split(`
`).forEach((o,r)=>{if(r>0)t.push([]);if(o)t.at(-1).push(aSt({...n,text:o}))});return t},fze=({elm:e,transform:t,colorMap:n})=>{let o=cSt.applyToPoint(t,e.position),r={center:"middle",center_right:"end",bottom_left:"start",bottom_center:"middle",bottom_right:"end",left:"start",right:"end",top:"middle",bottom:"middle",top_left:"start",top_center:"middle",top_right:"end",center_left:"start"},i={center:"middle",center_right:"middle",bottom_left:"ideographic",bottom_center:"ideographic",bottom_right:"ideographic",left:"middle",right:"middle",top:"hanging",bottom:"ideographic",top_left:"hanging",top_center:"hanging",top_right:"hanging",center_left:"middle"},s=e.text.split(`
`),a=XTo(e.text_parts??[]),c=s.length===1?e.text_parts?.length?a[0]:[{type:"text",value:e.text,name:e.schematic_text_id,attributes:{},children:[]}]:s.map((l,h)=>({type:"element",name:"tspan",value:"",attributes:{x:o.x.toString(),...h>0?{dy:"1em"}:{}},children:e.text_parts?.length?a[h]??[]:[{type:"text",value:l,name:h===0?e.schematic_text_id:"",attributes:{},children:[]}]}));if(e.display_superscript)(s.length===1?c:c[c.length-1].children).push(...Aze("",e.display_superscript,g4(t,"reference_designator",e.font_size),i[e.anchor]).slice(1));return{type:"element",name:"text",value:"",attributes:{class:"sch-text","data-schematic-text-id":e.schematic_text_id,x:o.x.toString(),y:o.y.toString(),fill:e.color??n.schematic.sheet_label,"text-anchor":r[e.anchor],"dominant-baseline":i[e.anchor],"font-family":"sans-serif","font-size":`${g4(t,"reference_designator",e.font_size)}px`,transform:`rotate(${e.rotation}, ${o.x}, ${o.y})`},children:c}},jTo=({schematicBox:e,transform:t,colorMap:n})=>{let o=rze.applyToPoint(t,{x:e.x,y:e.y}),r=rze.applyToPoint(t,{x:e.x+e.width,y:e.y+e.height}),i=Math.min(o.y,r.y),s=Math.max(o.y,r.y),a=Math.min(o.x,r.x),c=Math.max(o.x,r.x),l=Km(t),h={class:"schematic-box sch-box",x:a.toString(),y:i.toString(),width:(c-a).toString(),height:(s-i).toString(),"stroke-width":`${l}px`,stroke:n.schematic.component_outline||"black",fill:"transparent"};if(e.is_dashed){let d=8*l,u=4*l;h["stroke-dasharray"]=`${d} ${u}`}return[{name:"rect",type:"element",value:"",attributes:h,children:[]}]},pSt=(e,t)=>{for(let n of e){if(n.type!=="source_trace")continue;let o=n;if(Array.isArray(o.connected_source_port_ids)&&o.connected_source_port_ids.includes(t))return!0}return!1},KTo,$To,qTo=({component:e,transform:t,circuitJson:n,colorMap:o})=>{let r=[],i=Es[e.symbol_name];if(!i)return[tze({text:`Symbol not found: ${e.symbol_name}`,realCenter:e.center,realToScreenTransform:t})];let s=Ho(n).schematic_port.list({schematic_component_id:e.schematic_component_id}),a=Ho(n).source_component.get(e.source_component_id),c=$7t({schPorts:s,symbol:i,schComponent:e});if(!c[0])return[tze({text:`Could not match ports for symbol ${e.symbol_name}`,realCenter:e.center,realToScreenTransform:t})];let l=q7t(c[1]?.symbolPort??i.center,c[1]?.schPort.center??e.center,c[0].symbolPort,c[0].schPort.center),h=i.primitives.filter((v)=>v.type==="path"),d=i.primitives.filter((v)=>v.type==="text"),u=i.primitives.filter((v)=>v.type==="circle"),_=i.primitives.filter((v)=>v.type==="box"),p=new Set;for(let v of c)if(pSt(n,v.schPort.source_port_id)||Ho(n).source_port.get(v.schPort.source_port_id)?.do_not_connect)p.add(v.symbolPort);let m={minX:Math.min(...h.flatMap((v)=>v.points.map((P)=>P.x))),maxX:Math.max(...h.flatMap((v)=>v.points.map((P)=>P.x))),minY:Math.min(...h.flatMap((v)=>v.points.map((P)=>P.y))),maxY:Math.max(...h.flatMap((v)=>v.points.map((P)=>P.y)))},[A,g]=If.applyToPoint(If.compose(t,l),[m.minX,m.minY]),[f,y]=If.applyToPoint(If.compose(t,l),[m.maxX,m.maxY]),x=Math.abs(y-g),C=Math.min(g,y),b=Math.abs(f-A),I=Math.min(A,f);r.push({name:"rect",type:"element",value:"",attributes:{class:"component-overlay sch-component-overlay",x:I.toString(),y:C.toString(),width:b.toString(),height:x.toString(),fill:"transparent"},children:[]});for(let v of h){let{points:P,color:M,closed:B,fill:T}=v;r.push({type:"element",name:"path",attributes:{class:"sch-component-symbol-path",d:P.map((N,D)=>{let[L,H]=If.applyToPoint(If.compose(t,l),[N.x,N.y]);return`${D===0?"M":"L"} ${L} ${H}`}).join(" ")+(B?" Z":""),stroke:o.schematic.component_outline,fill:"none","stroke-width":`${Km(t)}px`,"stroke-linecap":"round"},value:"",children:[]})}for(let v of d){let P=If.applyToPoint(If.compose(t,l),v),M="",B=v.text==="{REF}";if(B)M=a?.display_name??a?.name??"";else if(v.text==="{VAL}")M=e.symbol_display_value??"";let T=$To[v.anchor];r.push({name:"text",type:"element",attributes:{class:B?"sch-component-name sch-component-text":"sch-component-text",x:P.x.toString(),y:P.y.toString(),...B?{stroke:o.schematic.background,"stroke-width":`${Km(t)}px`,"paint-order":"stroke"}:{},fill:o.schematic.label_local,"font-family":"sans-serif","text-anchor":KTo[v.anchor],"dominant-baseline":T,"font-size":`${g4(t,"reference_designator")}px`},value:"",children:[{type:"text",value:M,name:"",attributes:{},children:[]}]})}for(let v of _){let P=If.applyToPoint(If.compose(t,l),v),M=If.compose(t,l).a;r.push({name:"rect",type:"element",attributes:{class:"sch-component-symbol-box",x:P.x.toString(),y:P.y.toString(),width:(v.width*M).toString(),height:(v.height*M).toString(),fill:"red"},value:"",children:[]})}for(let v of i.ports){if(p.has(v))continue;let P=If.applyToPoint(If.compose(t,l),v);r.push({type:"element",name:"circle",attributes:{class:"component-pin sch-component-pin",cx:P.x.toString(),cy:P.y.toString(),r:`${Math.abs(t.a)*0.02}px`,"stroke-width":`${Km(t)}px`,fill:"none",stroke:o.schematic.component_outline},value:"",children:[]})}for(let v of u){let P=If.applyToPoint(If.compose(t,l),v),M=Math.abs(v.radius*t.a);r.push({type:"element",name:"circle",attributes:{class:"sch-component-symbol-circle",cx:P.x.toString(),cy:P.y.toString(),r:`${M}px`,"stroke-width":`${Km(t)}px`,fill:"none",stroke:o.schematic.component_outline},value:"",children:[]})}return r},eie=0.02,S8t=(e,t,n,o,r)=>{let i=Math.PI/6,s={x:e.x-n*Math.cos(t-i),y:e.y-n*Math.sin(t-i)},a={x:e.x-n*Math.cos(t+i),y:e.y-n*Math.sin(t+i)};return{name:"polygon",type:"element",attributes:{points:`${e.x},${e.y} ${s.x},${s.y} ${a.x},${a.y}`,fill:"white",stroke:o,"stroke-width":`${r}px`},value:"",children:[]}},JTo=({schPort:e,schComponent:t,transform:n,circuitJson:o})=>{let r=[],i=Ho(o).source_port.get(e.source_port_id),s={x:e.center.x,y:e.center.y},a=e.distance_from_component_edge??0.4;switch(e.side_of_component){case"left":s.x+=a;break;case"right":s.x-=a;break;case"top":s.y-=a;break;case"bottom":s.y+=a;break}let c=W1e.applyToPoint(n,e.center),l=W1e.applyToPoint(n,s),h=i!=null&&i.source_component_id==null&&typeof e.is_connected==="boolean"?e.is_connected:pSt(o,e.source_port_id),d=e.is_drawn_with_inversion_circle??!1,u=0.06,_={...e.center};if(!h&&!i?.do_not_connect)switch(e.side_of_component){case"left":_.x+=eie;break;case"right":_.x-=eie;break;case"top":_.y-=eie;break;case"bottom":_.y+=eie;break}let p=W1e.applyToPoint(n,_);if(d){let y=Math.abs(n.a)*u,x={...l};switch(e.side_of_component){case"left":x.x-=y,l.x-=y*2;break;case"right":x.x+=y,l.x+=y*2;break;case"top":x.y-=y,l.y-=y*2;break;case"bottom":x.y+=y,l.y+=y*2;break}r.push({name:"circle",type:"element",attributes:{class:"component-pin sch-component-pin sch-inversion-bubble",cx:x.x.toString(),cy:x.y.toString(),r:y.toString(),fill:"white",stroke:Zh.schematic.component_outline,"stroke-width":`${Km(n)}px`},value:"",children:[]})}r.push({name:"line",type:"element",attributes:{class:"component-pin sch-component-pin sch-port-line",x1:l.x.toString(),y1:l.y.toString(),x2:p.x.toString(),y2:p.y.toString(),"stroke-width":`${Km(n)}px`},value:"",children:[]});let m=Math.abs(n.a)*eie,A=[];if(!h&&!i?.do_not_connect)A.push({name:"circle",type:"element",attributes:{class:"component-pin sch-component-pin sch-port-terminal",cx:c.x.toString(),cy:c.y.toString(),r:m.toString(),"stroke-width":`${Km(n)}px`},value:"",children:[]});A.push({name:"rect",type:"element",attributes:{x:(c.x-m).toString(),y:(c.y-m).toString(),width:(m*2).toString(),height:(m*2).toString(),opacity:"0"},value:"",children:[]}),r.push({name:"g",type:"element",value:"",attributes:{class:"sch-port","data-schematic-port-id":e.source_port_id},children:A});let{has_input_arrow:g,has_output_arrow:f}=e;if((g||f)&&e.side_of_component){let y=Math.abs(n.a)*0.1,x=Zh.schematic.component_outline,C=y*Math.cos(Math.PI/6),b=Km(n)/3,I=0,v=0;if(e.side_of_component==="left")I=0,v=Math.PI;else if(e.side_of_component==="right")I=Math.PI,v=0;else if(e.side_of_component==="top")I=Math.PI/2,v=-Math.PI/2;else if(e.side_of_component==="bottom")I=-Math.PI/2,v=Math.PI/2;let P=g&&f,M={...l},B={...l};if(P){let T=C;if(e.side_of_component==="left")B.x-=T;else if(e.side_of_component==="right")B.x+=T;else if(e.side_of_component==="top")B.y-=T;else if(e.side_of_component==="bottom")B.y+=T}if(g)r.push(S8t(M,I,y,x,b));if(f){let T={x:B.x+y*Math.cos(v),y:B.y+y*Math.sin(v)};r.push(S8t(T,v,y,x,b))}}return r},ZTo=(e)=>{let t=[],{schPort:n,schComponent:o,transform:r,circuitJson:i}=e,s={x:n.center.x,y:n.center.y};if(!n.side_of_component)return[];let a=xj(n.side_of_component),c=n.distance_from_component_edge??0.4;if(s.x+=a.x*c/2,s.y+=a.y*c/2,n.side_of_component==="top"||n.side_of_component==="bottom")s.x-=0.02;else s.y+=0.02;let l=mSt.applyToPoint(r,s);return t.push({name:"text",type:"element",attributes:{class:"pin-number sch-pin-number",x:l.x.toString(),y:l.y.toString(),style:"font-family: sans-serif;",fill:Zh.schematic.pin_number,"text-anchor":"middle","dominant-baseline":"auto","font-size":`${g4(r,"pin_number")}px`,transform:n.side_of_component==="top"||n.side_of_component==="bottom"?`rotate(-90 ${l.x} ${l.y})`:""},children:[{type:"text",value:n.pin_number?.toString()||"",name:"",attributes:{},children:[]}],value:""}),t},P8t=0.1,gSt=(e)=>{let t=[],{schPort:n,schComponent:o,transform:r,labelColor:i=Zh.schematic.pin_number,labelClassName:s="pin-number sch-pin-label"}=e,a={x:n.center.x,y:n.center.y};if(!n.side_of_component)return[];let c=xj(n.side_of_component),l=n.distance_from_component_edge??0.4;a.x+=c.x*(l+P8t),a.y+=c.y*(l+P8t);let h=_St.applyToPoint(r,a),d=n.display_pin_label??o.port_labels?.[`${n.pin_number}`];if(!d)return[];let u=d.startsWith("N_"),_=u?d.slice(2):d,p=n.display_pin_label_text_parts,m=n.is_drawn_with_inversion_circle??!1,A=g4(r,u||m?"negated_pin_number":"pin_number",n.display_pin_label_font_size);return t.push({name:"text",type:"element",attributes:{class:s,x:h.x.toString(),y:h.y.toString(),style:`font-family: sans-serif;${u&&!p?.length?" text-decoration: overline;":""}`,fill:i,"text-anchor":n.side_of_component==="left"||n.side_of_component==="bottom"?"start":"end","dominant-baseline":"middle","font-size":`${A}px`,transform:n.side_of_component==="top"||n.side_of_component==="bottom"?`rotate(-90 ${h.x} ${h.y})`:""},children:p?.length?WTo(p):[{type:"text",value:_||"",name:"",attributes:{},children:[]}],value:""}),t},eDo=(e)=>{let t=[],{schPort:n,schComponent:o,transform:r,circuitJson:i}=e;return t.push(...JTo(e)),t.push(...ZTo(e)),t.push(...gSt(e)),t},tDo=({component:e,transform:t,circuitJson:n,colorMap:o})=>{let r=[],i=ize.applyToPoint(t,{x:e.center.x-e.size.width/2,y:e.center.y+e.size.height/2}),s=ize.applyToPoint(t,{x:e.center.x+e.size.width/2,y:e.center.y-e.size.height/2}),a=s.x-i.x,c=s.y-i.y;r.push({name:"rect",type:"element",value:"",attributes:{class:"component chip sch-component-body",x:i.x.toString(),y:i.y.toString(),width:a.toString(),height:c.toString(),"stroke-width":`${Km(t)}px`,fill:o.schematic.component_body,stroke:o.schematic.component_outline},children:[]}),r.push({name:"rect",type:"element",value:"",attributes:{class:"component-overlay sch-component-overlay",x:i.x.toString(),y:i.y.toString(),width:a.toString(),height:c.toString(),fill:"transparent"},children:[]});let l=Ho(n).schematic_text.list();for(let d of l)if(d.schematic_component_id===e.schematic_component_id)r.push(fze({elm:d,transform:t,colorMap:o}));let h=Ho(n).schematic_port.list({schematic_component_id:e.schematic_component_id});for(let d of h)r.push(...eDo({schPort:d,schComponent:e,transform:t,circuitJson:n}));return r},nDo=({component:e,transform:t,circuitJson:n,colorMap:o})=>{let r=[],i=e.schematic_component_id,s=n.filter((a)=>("schematic_component_id"in a)&&a.schematic_component_id===i).sort((a,c)=>E8t(a)-E8t(c));for(let a of s)if(a.type==="schematic_text"&&e.is_box_with_pins===!1)r.push(fze({elm:a,transform:t,colorMap:o}));else if(a.type==="schematic_line")r.push(...fSt({schLine:a,transform:t,colorMap:o}));else if(a.type==="schematic_circle")r.push(...uSt({schCircle:a,transform:t,colorMap:o}));else if(a.type==="schematic_rect")r.push(...xSt({schRect:a,transform:t,colorMap:o}));else if(a.type==="schematic_arc")r.push(...hSt({schArc:a,transform:t,colorMap:o}));else if(a.type==="schematic_path")r.push(...bSt({schPath:a,transform:t,colorMap:o}));if(e.is_box_with_pins===!1){let a=n.filter((l)=>l.type==="schematic_line"&&l.schematic_component_id===i),c=n.filter((l)=>l.type==="schematic_port"&&l.schematic_component_id===i);for(let l of c){let h=a.find((A)=>A.x1===l.center.x&&A.y1===l.center.y||A.x2===l.center.x&&A.y2===l.center.y);if(!h)continue;let d=h.x1===l.center.x&&h.y1===l.center.y?{x:h.x2,y:h.y2}:{x:h.x1,y:h.y1},u=d.x-l.center.x,_=d.y-l.center.y,p=Math.abs(u)>Math.abs(_)?u>0?"left":"right":_>0?"bottom":"top",m=Math.max(Math.abs(u),Math.abs(_));r.push(...gSt({schPort:{...l,side_of_component:p,distance_from_component_edge:m},schComponent:e,transform:t,circuitJson:n,labelClassName:"port-label sch-pin-label",labelColor:o.schematic.pin_name}))}}return r},ISt,iDo,Q1e,tie,aDo=({schematicTable:e,transform:t,colorMap:n,circuitJson:o})=>{let{anchor_position:r,border_width:i=0.05,anchor:s="center"}=e,{column_widths:a,row_heights:c}=eSt(e,o),l=a.reduce((I,v)=>I+v,0),h=c.reduce((I,v)=>I+v,0),{x:d,y:u}=r;if(s.includes("center"))d-=l/2;else if(s.includes("right"))d-=l;if(s.includes("center"))u+=h/2;else if(s.includes("bottom"))u+=h;let _=[],p=i*Math.abs(t.a),m=Km(t),[A,g]=LN.applyToPoint(t,[d,u]),[f,y]=LN.applyToPoint(t,[d+l,u-h]);_.push({name:"rect",type:"element",attributes:{class:"sch-table-border",x:A.toString(),y:g.toString(),width:(f-A).toString(),height:(y-g).toString(),fill:"none",stroke:n.schematic.table,"stroke-width":p.toString()},children:[],value:""});let x=o.filter((I)=>I.type==="schematic_table_cell"&&I.schematic_table_id===e.schematic_table_id),C=d;for(let I=0;I<a.length-1;I++){C+=a[I];let v=u;for(let P=0;P<c.length;P++){let M=v-c[P];if(!x.some((T)=>T.start_column_index<=I&&T.end_column_index>I&&T.start_row_index<=P&&T.end_row_index>=P)){let T=LN.applyToPoint(t,{x:C,y:v}),N=LN.applyToPoint(t,{x:C,y:M});_.push({name:"line",type:"element",attributes:{class:"sch-table-grid-line",x1:T.x.toString(),y1:T.y.toString(),x2:N.x.toString(),y2:N.y.toString(),stroke:n.schematic.table,"stroke-width":m.toString()},children:[],value:""})}v=M}}let b=u;for(let I=0;I<c.length-1;I++){b-=c[I];let v=d;for(let P=0;P<a.length;P++){let M=v+a[P];if(!x.some((T)=>T.start_row_index<=I&&T.end_row_index>I&&T.start_column_index<=P&&T.end_column_index>=P)){let T=LN.applyToPoint(t,{x:v,y:b}),N=LN.applyToPoint(t,{x:M,y:b});_.push({name:"line",type:"element",attributes:{class:"sch-table-grid-line",x1:T.x.toString(),y1:T.y.toString(),x2:N.x.toString(),y2:N.y.toString(),stroke:n.schematic.table,"stroke-width":m.toString()},children:[],value:""})}v=M}}for(let I of x)if(I.text){let v=a.slice(I.start_column_index,I.end_column_index+1).reduce((j,Y)=>j+Y,0),P=c.slice(I.start_row_index,I.end_row_index+1).reduce((j,Y)=>j+Y,0),M=d+a.slice(0,I.start_column_index).reduce((j,Y)=>j+Y,0),B=u-c.slice(0,I.start_row_index).reduce((j,Y)=>j+Y,0),{cell_padding:T=0.2}=e,N=I.horizontal_align??"center",D=I.vertical_align??"middle",L={x:M+v/2,y:B-P/2};if(N==="left")L.x=M+T;else if(N==="right")L.x=M+v-T;if(D==="top")L.y=B-T;else if(D==="bottom")L.y=B-P+T;let H=LN.applyToPoint(t,L),V=g4(t,"reference_designator",I.font_size),O={left:"start",center:"middle",right:"end"},U={top:"hanging",middle:"middle",bottom:"ideographic"};_.push({name:"text",type:"element",attributes:{class:"sch-table-text",x:H.x.toString(),y:H.y.toString(),"font-size":`${V}px`,"text-anchor":O[N],"dominant-baseline":U[D],fill:n.schematic.table,"font-family":"sans-serif"},children:[{type:"text",value:I.text,name:"",attributes:{},children:[]}],value:""})}return[{name:"g",type:"element",attributes:{class:"sch-table","data-schematic-table-id":e.schematic_table_id},children:_,value:""}]},die=6,H1e=12,bf=12,LFe=6,hDo=14,w8t=11,B8t=280,dDo=140,HFe=6,gDo=14,T8t=11,ESt=(e)=>e.type==="schematic_component_overlap_warning"||e.type==="schematic_component_styling_warning"||e.type==="schematic_sheet_styling_warning"||e.type==="schematic_element_outside_sheet_warning"||e.type==="schematic_manual_edit_conflict_warning",MDo,TDo=1000,DDo=28,NDo=16,R8t=({simulationResult:e,fallbackName:t})=>{let n=e.name??t,o=e.simulation_parameter_sweep_coordinate;if(!o)return n;return`${n} (${o.parameter_value}${o.parameter_unit})`},kDo=(e)=>{let t=e[0]??0,n=e[1];return{timestamps_ms:e,start_time_ms:t,end_time_ms:e.at(-1)??0,time_per_step:n===void 0?1:Math.abs(n-t)}},LDo=(e)=>e.type==="simulation_transient_voltage_graph"?e.simulation_transient_voltage_graph_id:e.simulation_transient_current_graph_id,wSt=(e)=>{switch(e.type){case"simulation_transient_voltage_graph":return e.simulation_transient_voltage_graph_id;case"simulation_transient_current_graph":return e.simulation_transient_current_graph_id;case"simulation_dc_operating_point_voltage":return e.simulation_dc_operating_point_voltage_id;case"simulation_dc_operating_point_current":return e.simulation_dc_operating_point_current_id;case"simulation_dc_sweep_voltage_graph":return e.simulation_dc_sweep_voltage_graph_id;case"simulation_dc_sweep_current_graph":return e.simulation_dc_sweep_current_graph_id;case"simulation_ac_sweep_voltage_graph":return e.simulation_ac_sweep_voltage_graph_id;case"simulation_ac_sweep_current_graph":return e.simulation_ac_sweep_current_graph_id}},HDo=({simulationResult:e,acSweepView:t,usesLogarithmicXValues:n})=>{switch(e.type){case"simulation_dc_operating_point_voltage":return{horizontalCoordinates:[0],measuredLevels:[e.voltage],isCurrent:!1};case"simulation_dc_operating_point_current":return{horizontalCoordinates:[0],measuredLevels:[e.current],isCurrent:!0};case"simulation_dc_sweep_voltage_graph":return{horizontalCoordinates:e.sweep_values,measuredLevels:e.voltage_levels,isCurrent:!1};case"simulation_dc_sweep_current_graph":return{horizontalCoordinates:e.sweep_values,measuredLevels:e.current_levels,isCurrent:!0};case"simulation_ac_sweep_voltage_graph":return{horizontalCoordinates:n?e.frequencies_hz.map(Math.log10):e.frequencies_hz,measuredLevels:e.complex_voltages.map((o)=>t==="phase"?Math.atan2(o.im,o.re)*180/Math.PI:Math.hypot(o.re,o.im)),isCurrent:!1};case"simulation_ac_sweep_current_graph":return{horizontalCoordinates:n?e.frequencies_hz.map(Math.log10):e.frequencies_hz,measuredLevels:e.complex_currents.map((o)=>t==="phase"?Math.atan2(o.im,o.re)*180/Math.PI:Math.hypot(o.re,o.im)),isCurrent:!0}}},FDo=({simulationResult:e,acSweepView:t,usesLogarithmicXValues:n})=>{if(e.type==="simulation_transient_voltage_graph"||e.type==="simulation_transient_current_graph"){if(!e.simulation_parameter_sweep_coordinate)return e;return{...e,name:R8t({simulationResult:e,fallbackName:e.name??LDo(e)})}}let o=wSt(e),{horizontalCoordinates:r,measuredLevels:i,isCurrent:s}=HDo({simulationResult:e,acSweepView:t,usesLogarithmicXValues:n}),a={simulation_experiment_id:e.simulation_experiment_id,simulation_parameter_sweep_coordinate:e.simulation_parameter_sweep_coordinate,name:R8t({simulationResult:e,fallbackName:o}),color:e.color,...kDo(r)};if(s)return{type:"simulation_transient_current_graph",simulation_transient_current_graph_id:o,current_levels:i,...a};return{type:"simulation_transient_voltage_graph",simulation_transient_voltage_graph_id:o,voltage_levels:i,...a}},zDo=({simulationResultType:e,experiment:t})=>{if(e?.startsWith("simulation_ac_sweep_"))return"Frequency (Hz)";if(e?.startsWith("simulation_dc_sweep_"))return t?.dc_sweep_unit?`DC Sweep (${t.dc_sweep_unit})`:"DC Sweep";if(e?.startsWith("simulation_dc_operating_point_"))return"Operating Point";return"Time (ms)"},ODo=({results:e,acSweepView:t,experiment:n})=>{let o=e[0]?.type,r=o?.startsWith("simulation_ac_sweep_")??!1,i=r&&n?.ac_sweep_type!=="linear";return{graphs:e.map((a)=>FDo({simulationResult:a,acSweepView:t,usesLogarithmicXValues:i})),xAxisTitle:zDo({simulationResultType:o,experiment:n}),yAxisTitle:r&&t==="phase"?"Phase (deg)":void 0,usesLogarithmicXValues:i}},VDo=1200,YDo=600,cm,cze=24,lze=56,GDo=56,UDo=8,Q8t="#1f77b4",RSt=16,lNo=15,dNo=24,lz=118,q1e=94,uj=18,O1e=20,FFe=8,pNo=14,wNo=(e)=>{let t=$1e(e);return{...t,tickLabelOverrides:new Map(t.ticks.map((n)=>[n,ur(10**n)]))}},BNo=1200,TNo=1200,zSt=0.55,z8t;var bze=El(()=>{Kt();Kt();Kt();Kt();uRe();Kt();uRe();$8();$8();$8();Kt();tc();Ko();tc();Ko();Kt();Kt();Kt();Ko();Ko();Ko();kre();Ko();m0();m0();m0();Ko();Ko();m0();Ko();m0();Ko();Ko();Kt();az=Qe(wt(),1),uie=Qe(wt(),1),X8t=Qe(wt(),1),DI=Qe(wt(),1),j8t=Qe(wt(),1),oie=Qe(wt(),1),VFe=Qe(wt(),1),i7t=Qe(u0(),1),I1s=Qe(u0(),1),BM=Qe(wt(),1),pj=Qe(wt(),1),GFe=Qe(wt(),1),Y1e=Qe(wt(),1),UFe=Qe(wt(),1),rie=Qe(wt(),1),s7t=Qe(wt(),1),a7t=Qe(p0(),1),l7t=Qe(wt(),1),VN=Qe(wt(),1),WFe=Qe(wt(),1),EM=Qe(wt(),1),MM=Qe(wt(),1),d7t=Qe(wt(),1),XFe=Qe(wt(),1),u7t=Qe(wt(),1),jFe=Qe(wt(),1),NI=Qe(wt(),1),cz=Qe(wt(),1),m7t=Qe(wt(),1),iA=Qe(wt(),1),g7t=Qe(wt(),1),tg=Qe(wt(),1),A7t=Qe(wt(),1),KFe=Qe(wt(),1),f7t=Qe(wt(),1),y7t=Qe(wt(),1),x7t=Qe(wt(),1),C7t=Qe(wt(),1),b7t=Qe(wt(),1),I7t=Qe(wt(),1),rj=Qe(wt(),1),$Fe=Qe(wt(),1),sie=Qe(wt(),1),M7t=Qe(wt(),1),T1s=Qe(u0(),1),qFe=Qe(wt(),1),HC=Qe(wt(),1),w7t=Qe(wt(),1),a7=Qe(wt(),1),B7t=Qe(wt(),1),Q1s=Qe(u0(),1),D7t=Qe(wt(),1),G1e=Qe(wt(),1),N7t=Qe(wt(),1),R7t=Qe(wt(),1),ij=Qe(wt(),1),F1s=Qe(u0(),1),TM=Qe(wt(),1),sj=Qe(wt(),1),JFe=Qe(wt(),1),O1s=Qe(wt(),1),k7t=Qe(wt(),1),aie=Qe(wt(),1),cie=Qe(wt(),1),V1s=Qe(u0(),1),yj=Qe(wt(),1),s7=Qe(wt(),1),L7t=Qe(wt(),1),H7t=Qe(wt(),1),F7t=Qe(wt(),1),lie=Qe(wt(),1),z7t=Qe(wt(),1),U1e=Qe(wt(),1),dz=Qe(wt(),1),U7t=Qe(wt(),1),aj=Qe(wt(),1),X1s=Qe(wt(),1),Cj=Qe(wt(),1),J7t=Qe(wt(),1),FC=Qe(wt(),1),g0=Qe(wt(),1),rSt=Qe(wt(),1),iSt=Qe(wt(),1),nze=Qe(wt(),1),oze=Qe(wt(),1),cSt=Qe(wt(),1),lSt=Qe(wt(),1),rze=Qe(wt(),1),dSt=Qe(wt(),1),tys=Qe(u0(),1),ize=Qe(wt(),1),rys=Qe(u0(),1),If=Qe(wt(),1),iys=Qe(wt(),1),W1e=Qe(wt(),1),mSt=Qe(wt(),1),_St=Qe(wt(),1),sze=Qe(wt(),1),ySt=Qe(wt(),1),CSt=Qe(wt(),1),cj=Qe(wt(),1),Aie=Qe(wt(),1),LN=Qe(wt(),1),lj=Qe(wt(),1),vSt=Qe(wt(),1),wM=Qe(wt(),1),K1e=Qe(wt(),1),MSt=Qe(u0(),1),Z1e=Qe(wt(),1),aze=Qe(u0(),1),lys=Qe(u0(),1),DM=Qe(wt(),1),iMo=new Set(["pcb_trace","pcb_smtpad","pcb_via","pcb_plated_hole","pcb_copper_pour","pcb_copper_text"]);_0={copper:{top:"rgb(200, 52, 52)",inner1:"rgb(255, 140, 0)",inner2:"rgb(255, 215, 0)",inner3:"rgb(50, 205, 50)",inner4:"rgb(64, 224, 208)",inner5:"rgb(138, 43, 226)",inner6:"rgb(255, 105, 180)",inner7:"rgb(0, 191, 255)",inner8:"rgb(160, 82, 45)",bottom:"rgb(77, 127, 196)"},soldermaskWithCopperUnderneath:{top:"rgb(18, 82, 50)",bottom:"rgb(18, 82, 50)"},soldermask:{top:"rgb(12, 55, 33)",bottom:"rgb(12, 55, 33)"},soldermaskOverCopper:{top:"rgb(52, 135, 73)",bottom:"rgb(52, 135, 73)"},substrate:"rgb(201, 162, 110)",drill:"#FF26E2",silkscreen:{top:"#f2eda1",bottom:"#5da9e9"},boardOutline:"rgba(255, 255, 255, 0.5)",courtyard:{top:"#FF00FF",bottom:"rgb(38, 233, 255)"},keepout:"#FF6B6B",debugComponent:{fill:null,stroke:null}},g1s=_0.drill,A1s=_0.silkscreen.top,f1s=_0.silkscreen.bottom,y1s={..._0.copper};yMo={bottom:"rgb(105, 105, 105)",top:"rgb(105, 105, 105)"};w1e=[[30,60,130],[20,170,190],[90,200,140],[245,210,65],[220,65,45]];DMo={pcb_background:0,pcb_boundary:1,pcb_panel:5,pcb_board:10,pcb_cutout:15,pcb_cutout_path:15,pcb_keepout:16,pcb_hole:18,pcb_plated_hole_drill:19,pcb_plated_hole:20,pcb_trace_soldermask:25,pcb_trace:30,pcb_smtpad:30,pcb_copper_pour:35,pcb_via:36,pcb_soldermask:40,pcb_soldermask_opening:25,pcb_soldermask_opening_layer:44,pcb_solder_paste:45,pcb_silkscreen_text:50,pcb_silkscreen_path:50,pcb_silkscreen_graphic:50,pcb_silkscreen_rect:50,pcb_silkscreen_circle:50,pcb_silkscreen_line:50,pcb_silkscreen_oval:50,pcb_silkscreen_pill:50,pcb_component:60,pcb_pad_pin_number:65,pcb_fabrication_note_text:70,pcb_fabrication_note_path:70,pcb_fabrication_note_rect:70,pcb_fabrication_note_dimension:70,pcb_note_dimension:70,pcb_note_text:70,pcb_note_rect:70,pcb_note_path:70,pcb_note_line:70,pcb_bend:70,pcb_trace_error:80,pcb_footprint_overlap_error:80,pcb_component_outside_board_error:80,pcb_pad_trace_clearance_error:80,pcb_via_trace_clearance_error:80,pcb_connector_not_in_accessible_orientation_warning:80,pcb_manual_edit_conflict_warning:80,pcb_rats_nest:85,pcb_debug_object:90};QMo=new Set(["pcb_trace","pcb_copper_pour","pcb_smtpad","pcb_plated_hole","pcb_via","pcb_copper_text"]);c7t=a7t.default("circuit-to-svg"),lm=c7t.extend("pcb"),S1s=c7t.extend("sch");Zh={"3d_viewer":{background_bottom:"rgb(102, 102, 128)",background_top:"rgb(204, 204, 230)",board:"rgb(51, 43, 23)",copper:"rgb(179, 156, 0)",silkscreen_bottom:"rgb(230, 230, 230)",silkscreen_top:"rgb(230, 230, 230)",soldermask:"rgb(20, 51, 36)",solderpaste:"rgb(128, 128, 128)"},board:{anchor:"rgb(255, 38, 226)",aux_items:"rgb(255, 255, 255)",b_adhes:"rgb(0, 0, 132)",b_crtyd:"rgb(255, 38, 226)",b_fab:"rgb(88, 93, 132)",b_mask:"rgba(2, 255, 238, 0.400)",b_paste:"rgb(0, 194, 194)",b_silks:"rgb(232, 178, 167)",background:"rgb(0, 16, 35)",cmts_user:"rgb(89, 148, 220)",copper:{b:"rgb(77, 127, 196)",f:"rgb(200, 52, 52)",in1:"rgb(127, 200, 127)",in10:"rgb(237, 124, 51)",in11:"rgb(91, 195, 235)",in12:"rgb(247, 111, 142)",in13:"rgb(167, 165, 198)",in14:"rgb(40, 204, 217)",in15:"rgb(232, 178, 167)",in16:"rgb(242, 237, 161)",in17:"rgb(237, 124, 51)",in18:"rgb(91, 195, 235)",in19:"rgb(247, 111, 142)",in2:"rgb(206, 125, 44)",in20:"rgb(167, 165, 198)",in21:"rgb(40, 204, 217)",in22:"rgb(232, 178, 167)",in23:"rgb(242, 237, 161)",in24:"rgb(237, 124, 51)",in25:"rgb(91, 195, 235)",in26:"rgb(247, 111, 142)",in27:"rgb(167, 165, 198)",in28:"rgb(40, 204, 217)",in29:"rgb(232, 178, 167)",in3:"rgb(79, 203, 203)",in30:"rgb(242, 237, 161)",in4:"rgb(219, 98, 139)",in5:"rgb(167, 165, 198)",in6:"rgb(40, 204, 217)",in7:"rgb(232, 178, 167)",in8:"rgb(242, 237, 161)",in9:"rgb(141, 203, 129)"},cursor:"rgb(255, 255, 255)",drc:"rgb(194, 194, 194)",drc_error:"rgba(215, 91, 107, 0.800)",drc_exclusion:"rgb(255, 255, 255)",drc_warning:"rgba(255, 208, 66, 0.902)",dwgs_user:"rgb(194, 194, 194)",eco1_user:"rgb(180, 219, 210)",eco2_user:"rgb(216, 200, 82)",edge_cuts:"rgb(208, 210, 205)",f_adhes:"rgb(132, 0, 132)",f_crtyd:"rgb(255, 0, 245)",f_fab:"rgb(175, 175, 175)",f_mask:"rgba(216, 100, 255, 0.400)",f_paste:"rgba(180, 160, 154, 0.902)",f_silks:"rgb(242, 237, 161)",footprint_text_back:"rgb(0, 0, 132)",footprint_text_front:"rgb(194, 194, 194)",footprint_text_invisible:"rgb(132, 132, 132)",grid:"rgb(132, 132, 132)",grid_axes:"rgb(194, 194, 194)",margin:"rgb(255, 38, 226)",microvia:"rgb(0, 132, 132)",no_connect:"rgb(0, 0, 132)",pad_back:"rgb(77, 127, 196)",pad_front:"rgb(200, 52, 52)",pad_plated_hole:"rgb(194, 194, 0)",pad_through_hole:"rgb(227, 183, 46)",plated_hole:"rgb(26, 196, 210)",ratsnest:"rgba(245, 255, 213, 0.702)",select_overlay:"rgb(4, 255, 67)",through_via:"rgb(236, 236, 236)",user_1:"rgb(194, 194, 194)",user_2:"rgb(89, 148, 220)",user_3:"rgb(180, 219, 210)",user_4:"rgb(216, 200, 82)",user_5:"rgb(194, 194, 194)",user_6:"rgb(89, 148, 220)",user_7:"rgb(180, 219, 210)",user_8:"rgb(216, 200, 82)",user_9:"rgb(232, 178, 167)",via_blind_buried:"rgb(187, 151, 38)",via_hole:"rgb(227, 183, 46)",via_micro:"rgb(0, 132, 132)",via_through:"rgb(236, 236, 236)",worksheet:"rgb(200, 114, 171)"},gerbview:{axes:"rgb(0, 0, 132)",background:"rgb(0, 0, 0)",dcodes:"rgb(255, 255, 255)",grid:"rgb(132, 132, 132)",layers:["rgb(132, 0, 0)","rgb(194, 194, 0)","rgb(194, 0, 194)","rgb(194, 0, 0)","rgb(0, 132, 132)","rgb(0, 132, 0)","rgb(0, 0, 132)","rgb(132, 132, 132)","rgb(132, 0, 132)","rgb(194, 194, 194)","rgb(132, 0, 132)","rgb(132, 0, 0)","rgb(132, 132, 0)","rgb(194, 194, 194)","rgb(0, 0, 132)","rgb(0, 132, 0)","rgb(132, 0, 0)","rgb(194, 194, 0)","rgb(194, 0, 194)","rgb(194, 0, 0)","rgb(0, 132, 132)","rgb(0, 132, 0)","rgb(0, 0, 132)","rgb(132, 132, 132)","rgb(132, 0, 132)","rgb(194, 194, 194)","rgb(132, 0, 132)","rgb(132, 0, 0)","rgb(132, 132, 0)","rgb(194, 194, 194)","rgb(0, 0, 132)","rgb(0, 132, 0)","rgb(132, 0, 0)","rgb(194, 194, 0)","rgb(194, 0, 194)","rgb(194, 0, 0)","rgb(0, 132, 132)","rgb(0, 132, 0)","rgb(0, 0, 132)","rgb(132, 132, 132)","rgb(132, 0, 132)","rgb(194, 194, 194)","rgb(132, 0, 132)","rgb(132, 0, 0)","rgb(132, 132, 0)","rgb(194, 194, 194)","rgb(0, 0, 132)","rgb(0, 132, 0)","rgb(132, 0, 0)","rgb(194, 194, 0)","rgb(194, 0, 194)","rgb(194, 0, 0)","rgb(0, 132, 132)","rgb(0, 132, 0)","rgb(0, 0, 132)","rgb(132, 132, 132)","rgb(132, 0, 132)","rgb(194, 194, 194)","rgb(132, 0, 132)","rgb(132, 0, 0)"],negative_objects:"rgb(132, 132, 132)",worksheet:"rgb(0, 0, 132)"},meta:{filename:"kicad_2020",name:"KiCad 2020",version:2},simulation_palette:["#1f77b4","#d62728","#2ca02c","#ff7f0e","#9467bd","#17becf","#8c564b","#e377c2","#7f7f7f","#bcbd22"],palette:["rgb(132, 0, 0)","rgb(194, 194, 0)","rgb(194, 0, 194)","rgb(194, 0, 0)","rgb(0, 132, 132)","rgb(0, 132, 0)","rgb(0, 0, 132)","rgb(132, 132, 132)","rgb(132, 0, 132)","rgb(194, 194, 194)","rgb(132, 0, 132)","rgb(132, 0, 0)","rgb(132, 132, 0)","rgb(194, 194, 194)","rgb(0, 0, 132)","rgb(0, 132, 0)"],schematic:{aux_items:"rgb(46, 46, 46)",background:"rgb(245, 241, 237)",brightened:"rgb(255, 0, 255)",bus:"rgb(0, 0, 132)",bus_junction:"rgb(0, 0, 132)",component_body:"rgb(255, 255, 194)",component_outline:"rgb(132, 0, 0)",cursor:"rgb(15, 15, 15)",erc_error:"rgba(230, 9, 13, 0.800)",erc_warning:"rgba(209, 146, 0, 0.800)",fields:"rgb(132, 0, 132)",grid:"rgb(181, 181, 181)",grid_axes:"rgb(0, 0, 132)",hidden:"rgb(194, 194, 194)",junction:"rgb(0, 150, 0)",label_global:"rgb(132, 0, 0)",label_background:"rgba(255, 255, 255, 0.6)",label_hier:"rgb(114, 86, 0)",label_local:"rgb(15, 15, 15)",net_name:"rgb(132, 132, 132)",no_connect:"rgb(132, 0, 0)",note:"rgb(0, 0, 194)",override_item_colors:!1,pin:"rgb(132, 0, 0)",pin_name:"rgb(0, 100, 100)",pin_number:"rgb(169, 0, 0)",reference:"rgb(0, 100, 100)",shadow:"rgba(102, 179, 255, 0.800)",sheet:"rgb(132, 0, 0)",sheet_background:"rgba(253, 255, 231, 0.000)",sheet_fields:"rgb(132, 0, 132)",sheet_filename:"rgb(114, 86, 0)",sheet_label:"rgb(0, 100, 100)",sheet_name:"rgb(0, 100, 100)",table:"rgb(102, 102, 102)",value:"rgb(0, 100, 100)",wire:"rgb(0, 150, 0)",wire_crossing:"rgb(30, 180, 30)",worksheet:"rgb(132, 0, 0)"}};lwo=Zh.board.user_2;dwo=Zh.board.user_2,uwo=Zh.board.user_2;mwo=Zh.board.user_2;gwo=Zh.board.user_2;fwo=Array.from(p7t).reduce((e,t)=>e+(fre[t]??LC.spaceWidthRatio),0);_7t=Object.fromEntries(Object.entries(Ax).map(([e,t])=>{let n=t.flatMap((r)=>[r.x1,r.x2]),o=t.flatMap((r)=>[r.y1,r.y2]);return[e,t.length?{minX:Math.min(...n)-B1e,maxX:Math.max(...n)+B1e,minY:-(Math.max(...o)+B1e)*n8t,maxY:-(Math.min(...o)-B1e)*n8t}:null]})),o8t=Math.round(Math.max(...Object.values(_7t).map((e)=>e?e.maxX-e.minX:0))*1000)/1000;EFe=hj+2,MFe=S7t+2,iie=hj+_4+6;h8t=["rgba(100, 200, 255, 0.6)","rgba(255, 150, 100, 0.6)","rgba(100, 255, 150, 0.6)","rgba(200, 100, 255, 0.6)","rgba(255, 220, 100, 0.6)","rgba(255, 100, 200, 0.6)","rgba(100, 255, 255, 0.6)","rgba(180, 255, 100, 0.6)"];xBo={name:"circuit-to-svg",type:"module",engines:{node:"24.x"},version:"0.0.449",repository:{type:"git",url:"https://github.com/tscircuit/circuit-to-svg.git"},description:"Convert Circuit JSON to SVG",main:"dist/index.js",files:["dist"],scripts:{start:"cosmos",prepublish:"npm run build",prepare:"node scripts/prepare-git.cjs",build:"tsup-node ./lib/index.ts --format esm --dts --sourcemap --external tscircuit",format:"biome format . --write","format:check":"biome format .",cosmos:"cosmos","cosmos-export":"cosmos-export"},license:"ISC",devDependencies:{"@biomejs/biome":"^1.9.4","@resvg/resvg-js":"^2.6.2","@tscircuit/alphabet":"^0.0.27","@tscircuit/checks-latest":"npm:@tscircuit/checks@0.0.179","@tscircuit/circuit-json-util":"^0.0.115","@types/bun":"^1.2.8","@types/color":"^4.2.1","@types/debug":"^4.1.12","@vitejs/plugin-react":"5.0.0",biome:"^0.3.3","bun-match-svg":"^0.0.12","circuit-json":"^0.0.522","circuit-json-to-connectivity-map":"^0.0.23",esbuild:"^0.20.2","format-si-unit":"^0.0.12","performance-now":"^2.1.0",react:"19.1.0","react-cosmos":"7.0.0","react-cosmos-plugin-vite":"7.0.0","react-dom":"19.1.0","schematic-symbols":"^0.0.246",tscircuit:"^0.0.2629",tsup:"^8.0.2",typescript:"^5.4.5","vite-tsconfig-paths":"^5.0.1"},peerDependencies:{"@tscircuit/alphabet":"*","@tscircuit/circuit-json-util":"*","circuit-json":"*","circuit-json-to-connectivity-map":"*","schematic-symbols":"*"},dependencies:{"@types/node":"^22.5.5","bun-types":"^1.1.40","calculate-elbow":"0.0.12",color:"^5.0.3",debug:"^4.4.3","svg-path-commander":"^2.1.11",svgson:"^5.3.1","transformation-matrix":"^2.16.1"}},GN=xBo.version;FBo=yie;N1e={fill:"none",stroke:"rgb(0,0,0)",strokeOpacity:"0.8",strokeWidthFactor:0.2};YBo={pin_number:0.15,negated_pin_number:0.12,reference_designator:0.18,manufacturer_number:0.18,net_label:0.18,error:0.05};g8t=["pcb_component","pcb_smtpad","pcb_hole","pcb_plated_hole","pcb_board"];x8t=["pcb_board","pcb_smtpad","pcb_hole","pcb_plated_hole","pcb_component","pcb_port"];C8t={"0":{width:13,height:27,ascent:22,descent:5,left:-1,right:12},"1":{width:13,height:27,ascent:22,descent:5,left:-3,right:9},"2":{width:13,height:27,ascent:22,descent:5,left:-1,right:12},"3":{width:13,height:27,ascent:22,descent:5,left:-1,right:12},"4":{width:13,height:27,ascent:22,descent:5,left:0,right:12},"5":{width:13,height:27,ascent:22,descent:5,left:-1,right:12},"6":{width:13,height:27,ascent:22,descent:5,left:-1,right:12},"7":{width:13,height:27,ascent:22,descent:5,left:-1,right:12},"8":{width:13,height:27,ascent:22,descent:5,left:-1,right:12},"9":{width:13,height:27,ascent:22,descent:5,left:-1,right:12}," ":{width:7,height:27,ascent:22,descent:5,left:0,right:0},"!":{width:7,height:27,ascent:22,descent:5,left:-2,right:5},'"':{width:9,height:27,ascent:22,descent:5,left:-1,right:7},"#":{width:13,height:27,ascent:22,descent:5,left:0,right:13},$:{width:13,height:27,ascent:22,descent:5,left:-1,right:12},"%":{width:21,height:27,ascent:22,descent:5,left:-1,right:20},"&":{width:16,height:27,ascent:22,descent:5,left:-1,right:15},"'":{width:5,height:27,ascent:22,descent:5,left:-1,right:3},"(":{width:8,height:27,ascent:22,descent:5,left:-1,right:7},")":{width:8,height:27,ascent:22,descent:5,left:-1,right:7},"*":{width:9,height:27,ascent:22,descent:5,left:-1,right:8},"+":{width:14,height:27,ascent:22,descent:5,left:-1,right:13},",":{width:7,height:27,ascent:22,descent:5,left:-2,right:5},"-":{width:8,height:27,ascent:22,descent:5,left:-1,right:7},".":{width:7,height:27,ascent:22,descent:5,left:-2,right:5},"/":{width:7,height:27,ascent:22,descent:5,left:0,right:7},":":{width:7,height:27,ascent:22,descent:5,left:-2,right:5},";":{width:7,height:27,ascent:22,descent:5,left:-2,right:5},"<":{width:14,height:27,ascent:22,descent:5,left:-1,right:13},"=":{width:14,height:27,ascent:22,descent:5,left:-1,right:13},">":{width:14,height:27,ascent:22,descent:5,left:-1,right:13},"?":{width:13,height:27,ascent:22,descent:5,left:-1,right:12},"@":{width:24,height:27,ascent:22,descent:5,left:-1,right:23},A:{width:16,height:27,ascent:22,descent:5,left:0,right:16},B:{width:16,height:27,ascent:22,descent:5,left:-2,right:15},C:{width:17,height:27,ascent:22,descent:5,left:-1,right:16},D:{width:17,height:27,ascent:22,descent:5,left:-2,right:16},E:{width:16,height:27,ascent:22,descent:5,left:-2,right:15},F:{width:15,height:27,ascent:22,descent:5,left:-2,right:14},G:{width:19,height:27,ascent:22,descent:5,left:-1,right:17},H:{width:17,height:27,ascent:22,descent:5,left:-2,right:15},I:{width:7,height:27,ascent:22,descent:5,left:-2,right:5},J:{width:12,height:27,ascent:22,descent:5,left:-1,right:10},K:{width:16,height:27,ascent:22,descent:5,left:-2,right:16},L:{width:13,height:27,ascent:22,descent:5,left:-2,right:12},M:{width:20,height:27,ascent:22,descent:5,left:-2,right:18},N:{width:17,height:27,ascent:22,descent:5,left:-2,right:15},O:{width:19,height:27,ascent:22,descent:5,left:-1,right:18},P:{width:16,height:27,ascent:22,descent:5,left:-2,right:15},Q:{width:19,height:27,ascent:22,descent:5,left:-1,right:18},R:{width:17,height:27,ascent:22,descent:5,left:-2,right:17},S:{width:16,height:27,ascent:22,descent:5,left:-1,right:15},T:{width:15,height:27,ascent:22,descent:5,left:-1,right:14},U:{width:17,height:27,ascent:22,descent:5,left:-2,right:15},V:{width:16,height:27,ascent:22,descent:5,left:0,right:16},W:{width:23,height:27,ascent:22,descent:5,left:0,right:22},X:{width:16,height:27,ascent:22,descent:5,left:0,right:16},Y:{width:16,height:27,ascent:22,descent:5,left:0,right:16},Z:{width:15,height:27,ascent:22,descent:5,left:0,right:14},"[":{width:7,height:27,ascent:22,descent:5,left:-2,right:6},"\\":{width:7,height:27,ascent:22,descent:5,left:0,right:7},"]":{width:7,height:27,ascent:22,descent:5,left:0,right:5},"^":{width:11,height:27,ascent:22,descent:5,left:-1,right:11},_:{width:13,height:27,ascent:22,descent:5,left:0,right:14},"`":{width:8,height:27,ascent:22,descent:5,left:-1,right:5},a:{width:13,height:27,ascent:22,descent:5,left:-1,right:12},b:{width:13,height:27,ascent:22,descent:5,left:-2,right:12},c:{width:12,height:27,ascent:22,descent:5,left:-1,right:12},d:{width:13,height:27,ascent:22,descent:5,left:-1,right:12},e:{width:13,height:27,ascent:22,descent:5,left:-1,right:12},f:{width:7,height:27,ascent:22,descent:5,left:0,right:8},g:{width:13,height:27,ascent:22,descent:5,left:-1,right:12},h:{width:13,height:27,ascent:22,descent:5,left:-2,right:12},i:{width:5,height:27,ascent:22,descent:5,left:-2,right:4},j:{width:5,height:27,ascent:22,descent:5,left:1,right:4},k:{width:12,height:27,ascent:22,descent:5,left:-2,right:12},l:{width:5,height:27,ascent:22,descent:5,left:-2,right:4},m:{width:20,height:27,ascent:22,descent:5,left:-2,right:18},n:{width:13,height:27,ascent:22,descent:5,left:-2,right:12},o:{width:13,height:27,ascent:22,descent:5,left:-1,right:12},p:{width:13,height:27,ascent:22,descent:5,left:-2,right:12},q:{width:13,height:27,ascent:22,descent:5,left:-1,right:12},r:{width:8,height:27,ascent:22,descent:5,left:-2,right:8},s:{width:12,height:27,ascent:22,descent:5,left:-1,right:11},t:{width:7,height:27,ascent:22,descent:5,left:0,right:6},u:{width:13,height:27,ascent:22,descent:5,left:-2,right:12},v:{width:12,height:27,ascent:22,descent:5,left:0,right:12},w:{width:17,height:27,ascent:22,descent:5,left:0,right:17},x:{width:12,height:27,ascent:22,descent:5,left:0,right:12},y:{width:12,height:27,ascent:22,descent:5,left:0,right:12},z:{width:12,height:27,ascent:22,descent:5,left:0,right:11},"{":{width:8,height:27,ascent:22,descent:5,left:-1,right:7},"|":{width:6,height:27,ascent:22,descent:5,left:-2,right:4},"}":{width:8,height:27,ascent:22,descent:5,left:-1,right:7},"~":{width:14,height:27,ascent:22,descent:5,left:-1,right:13}};STo={top_left:"start",top_right:"end",middle_left:"start",middle_right:"end",bottom_left:"start",bottom_right:"end",center:"middle",middle_top:"middle",middle_bottom:"middle"},b8t={top_left:"hanging",top_right:"hanging",bottom_left:"ideographic",bottom_right:"ideographic",center:"middle",middle_left:"middle",middle_right:"middle",middle_top:"hanging",middle_bottom:"ideographic"};zN=NTo/RTo,QTo=297/zN,kTo=210/zN,$1s=20/zN,R1e=5/zN;KTo={top_left:"start",top_right:"end",middle_left:"start",middle_right:"end",bottom_left:"start",bottom_right:"end",center:"middle",middle_top:"middle",middle_bottom:"middle"},$To={top_left:"hanging",top_right:"hanging",bottom_left:"ideographic",bottom_right:"ideographic",center:"middle",middle_left:"middle",middle_right:"middle",middle_top:"hanging",middle_bottom:"ideographic"};ISt=0.2/zN,iDo=3/zN,Q1e=["1","2","3","4","5","6"],tie=["A","B","C","D"];MDo=uz;cm={top:64,right:100,bottom:80,left:100};z8t=["pcb_board","pcb_solder_paste"]});var so=lt(function(NFo){var Tz=Qe(rn());(function(){function e(Y){if(Y==null)return null;if(typeof Y==="function")return Y.$$typeof===B?null:Y.displayName||Y.name||null;if(typeof Y==="string")return Y;switch(Y){case m:return"Fragment";case g:return"Profiler";case A:return"StrictMode";case C:return"Suspense";case b:return"SuspenseList";case P:return"Activity";case M:return"ViewTransition"}if(typeof Y==="object")switch(typeof Y.tag==="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),Y.$$typeof){case p:return"Portal";case y:return Y.displayName||"Context";case f:return(Y._context.displayName||"Context")+".Consumer";case x:var X=Y.render;return Y=Y.displayName,Y||(Y=X.displayName||X.name||"",Y=Y!==""?"ForwardRef("+Y+")":"ForwardRef"),Y;case I:return X=Y.displayName||null,X!==null?X:e(Y.type)||"Memo";case v:X=Y._payload,Y=Y._init;try{return e(Y(X))}catch(K){}}return null}function t(Y){return""+Y}function n(Y){try{t(Y);var X=!1}catch(ee){X=!0}if(X){X=console;var K=X.error,J=typeof Symbol==="function"&&Symbol.toStringTag&&Y[Symbol.toStringTag]||Y.constructor.name||"Object";return K.call(X,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",J),t(Y)}}function o(Y){if(Y===m)return"<>";if(typeof Y==="object"&&Y!==null&&Y.$$typeof===v)return"<...>";try{var X=e(Y);return X?"<"+X+">":"<...>"}catch(K){return"<...>"}}function r(){var Y=T.A;return Y===null?null:Y.getOwner()}function i(){return Error("react-stack-top-frame")}function s(Y){if(N.call(Y,"key")){var X=Object.getOwnPropertyDescriptor(Y,"key").get;if(X&&X.isReactWarning)return!1}return Y.key!==void 0}function a(Y,X){function K(){H||(H=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",X))}K.isReactWarning=!0,Object.defineProperty(Y,"key",{get:K,configurable:!0})}function c(){var Y=e(this.type);return V[Y]||(V[Y]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),Y=this.props.ref,Y!==void 0?Y:null}function l(Y,X,K,J,ee,se){var ne=K.ref;return Y={$$typeof:_,type:Y,key:X,props:K,_owner:J},(ne!==void 0?ne:null)!==null?Object.defineProperty(Y,"ref",{enumerable:!1,get:c}):Object.defineProperty(Y,"ref",{enumerable:!1,value:null}),Y._store={},Object.defineProperty(Y._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(Y,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(Y,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:ee}),Object.defineProperty(Y,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:se}),Object.freeze&&(Object.freeze(Y.props),Object.freeze(Y)),Y}function h(Y,X,K,J,ee,se){var ne=X.children;if(ne!==void 0)if(J)if(D(ne)){for(J=0;J<ne.length;J++)d(ne[J]);Object.freeze&&Object.freeze(ne)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else d(ne);if(N.call(X,"key")){ne=e(Y);var re=Object.keys(X).filter(function(te){return te!=="key"});J=0<re.length?"{key: someKey, "+re.join(": ..., ")+": ...}":"{key: someKey}",j[ne+J]||(re=0<re.length?"{"+re.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
  let props = %s;
  <%s {...props} />
React keys must be passed directly to JSX without using spread:
  let props = %s;
  <%s key={someKey} {...props} />`,J,ne,re,ne),j[ne+J]=!0)}if(ne=null,K!==void 0&&(n(K),ne=""+K),s(X)&&(n(X.key),ne=""+X.key),"key"in X){K={};for(var Z in X)Z!=="key"&&(K[Z]=X[Z])}else K=X;return ne&&a(K,typeof Y==="function"?Y.displayName||Y.name||"Unknown":Y),l(Y,ne,K,r(),ee,se)}function d(Y){u(Y)?Y._store&&(Y._store.validated=1):typeof Y==="object"&&Y!==null&&Y.$$typeof===v&&(Y._payload.status==="fulfilled"?u(Y._payload.value)&&Y._payload.value._store&&(Y._payload.value._store.validated=1):Y._store&&(Y._store.validated=1))}function u(Y){return typeof Y==="object"&&Y!==null&&Y.$$typeof===_}var _=Symbol.for("react.transitional.element"),p=Symbol.for("react.portal"),m=Symbol.for("react.fragment"),A=Symbol.for("react.strict_mode"),g=Symbol.for("react.profiler"),f=Symbol.for("react.consumer"),y=Symbol.for("react.context"),x=Symbol.for("react.forward_ref"),C=Symbol.for("react.suspense"),b=Symbol.for("react.suspense_list"),I=Symbol.for("react.memo"),v=Symbol.for("react.lazy"),P=Symbol.for("react.activity"),M=Symbol.for("react.view_transition"),B=Symbol.for("react.client.reference"),T=Tz.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,N=Object.prototype.hasOwnProperty,D=Array.isArray,L=console.createTask?console.createTask:function(){return null};Tz={react_stack_bottom_frame:function(Y){return Y()}};var H,V={},O=Tz.react_stack_bottom_frame.bind(Tz,i)(),U=L(o(i)),j={};NFo.Fragment=m,NFo.jsx=function(Y,X,K){var J=1e4>T.recentlyCreatedOwnerStacks++;if(J){var ee=Error.stackTraceLimit;Error.stackTraceLimit=10;var se=Error("react-stack-top-frame");Error.stackTraceLimit=ee}else se=O;return h(Y,X,K,!1,se,J?L(o(Y)):U)},NFo.jsxs=function(Y,X,K){var J=1e4>T.recentlyCreatedOwnerStacks++;if(J){var ee=Error.stackTraceLimit;Error.stackTraceLimit=10;var se=Error("react-stack-top-frame");Error.stackTraceLimit=ee}else se=O;return h(Y,X,K,!0,se,J?L(o(Y)):U)}})()});var TRt=lt(function(BRt,Gse){(function(){var e,t,n,o,r,i;if(typeof performance<"u"&&performance!==null&&performance.now)Gse.exports=function(){return performance.now()};else if(typeof process<"u"&&process!==null&&process.hrtime)Gse.exports=function(){return(e()-r)/1e6},t=process.hrtime,e=function(){var s=t();return s[0]*1e9+s[1]},o=e(),i=process.uptime()*1e9,r=o-i;else if(Date.now)Gse.exports=function(){return Date.now()-n},n=Date.now();else Gse.exports=function(){return new Date().getTime()-n},n=new Date().getTime()}).call(BRt)});var tO=lt(function(xBs,vQt){vQt.exports={trueFunc:function(){return!0},falseFunc:function(){return!1}}});var YQt=lt(function(PK){(function(){function e(){if(x=!1,v){var L=PK.unstable_now();B=L;var H=!0;try{e:{f=!1,y&&(y=!1,b(P),P=-1),g=!0;var V=A;try{t:{i(L);for(m=n(u);m!==null&&!(m.expirationTime>L&&a());){var O=m.callback;if(typeof O==="function"){m.callback=null,A=m.priorityLevel;var U=O(m.expirationTime<=L);if(L=PK.unstable_now(),typeof U==="function"){m.callback=U,i(L),H=!0;break t}m===n(u)&&o(u),i(L)}else o(u);m=n(u)}if(m!==null)H=!0;else{var j=n(_);j!==null&&c(s,j.startTime-L),H=!1}}break e}finally{m=null,A=V,g=!1}H=void 0}}finally{H?T():v=!1}}}function t(L,H){var V=L.length;L.push(H);e:for(;0<V;){var O=V-1>>>1,U=L[O];if(0<r(U,H))L[O]=H,L[V]=U,V=O;else break e}}function n(L){return L.length===0?null:L[0]}function o(L){if(L.length===0)return null;var H=L[0],V=L.pop();if(V!==H){L[0]=V;e:for(var O=0,U=L.length,j=U>>>1;O<j;){var Y=2*(O+1)-1,X=L[Y],K=Y+1,J=L[K];if(0>r(X,V))K<U&&0>r(J,X)?(L[O]=J,L[K]=V,O=K):(L[O]=X,L[Y]=V,O=Y);else if(K<U&&0>r(J,V))L[O]=J,L[K]=V,O=K;else break e}}return H}function r(L,H){var V=L.sortIndex-H.sortIndex;return V!==0?V:L.id-H.id}function i(L){for(var H=n(_);H!==null;){if(H.callback===null)o(_);else if(H.startTime<=L)o(_),H.sortIndex=H.expirationTime,t(u,H);else break;H=n(_)}}function s(L){if(y=!1,i(L),!f)if(n(u)!==null)f=!0,v||(v=!0,T());else{var H=n(_);H!==null&&c(s,H.startTime-L)}}function a(){return x?!0:PK.unstable_now()-B<M?!1:!0}function c(L,H){P=C(function(){L(PK.unstable_now())},H)}if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart==="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error()),PK.unstable_now=void 0,typeof performance==="object"&&typeof performance.now==="function"){var l=performance;PK.unstable_now=function(){return l.now()}}else{var h=Date,d=h.now();PK.unstable_now=function(){return h.now()-d}}var u=[],_=[],p=1,m=null,A=3,g=!1,f=!1,y=!1,x=!1,C=typeof setTimeout==="function"?setTimeout:null,b=typeof clearTimeout==="function"?clearTimeout:null,I=typeof setImmediate<"u"?setImmediate:null,v=!1,P=-1,M=5,B=-1;if(typeof I==="function")var T=function(){I(e)};else if(typeof MessageChannel<"u"){var N=new MessageChannel,D=N.port2;N.port1.onmessage=e,T=function(){D.postMessage(null)}}else T=function(){C(e,0)};PK.unstable_IdlePriority=5,PK.unstable_ImmediatePriority=1,PK.unstable_LowPriority=4,PK.unstable_NormalPriority=3,PK.unstable_Profiling=null,PK.unstable_UserBlockingPriority=2,PK.unstable_cancelCallback=function(L){L.callback=null},PK.unstable_forceFrameRate=function(L){0>L||125<L?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):M=0<L?Math.floor(1000/L):5},PK.unstable_getCurrentPriorityLevel=function(){return A},PK.unstable_next=function(L){switch(A){case 1:case 2:case 3:var H=3;break;default:H=A}var V=A;A=H;try{return L()}finally{A=V}},PK.unstable_requestPaint=function(){x=!0},PK.unstable_runWithPriority=function(L,H){switch(L){case 1:case 2:case 3:case 4:case 5:break;default:L=3}var V=A;A=L;try{return H()}finally{A=V}},PK.unstable_scheduleCallback=function(L,H,V){var O=PK.unstable_now();switch(typeof V==="object"&&V!==null?(V=V.delay,V=typeof V==="number"&&0<V?O+V:O):V=O,L){case 1:var U=-1;break;case 2:U=250;break;case 5:U=1073741823;break;case 4:U=1e4;break;default:U=5000}return U=V+U,L={id:p++,callback:H,priorityLevel:L,startTime:V,expirationTime:U,sortIndex:-1},V>O?(L.sortIndex=V,t(_,L),n(u)===null&&L===n(_)&&(y?(b(P),P=-1):y=!0,c(s,V-O))):(L.sortIndex=U,t(u,L),f||g||(f=!0,v||(v=!0,T()))),L},PK.unstable_shouldYield=a,PK.unstable_wrapCallback=function(L){var H=A;return function(){var V=A;A=H;try{return L.apply(this,arguments)}finally{A=V}}},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop==="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()});var GQt=lt(function(wTs,Zse){var UGe=Qe(rn()),iu=Qe(YQt());Zse.exports=function(e){function t(R,z){for(R=R.memoizedState;R!==null&&0<z;)R=R.next,z--;return R}function n(R,z,q,pe){if(q>=z.length)return pe;var Ce=z[q],Te=wc(R)?R.slice():Q0({},R);return Te[Ce]=n(R[Ce],z,q+1,pe),Te}function o(R,z,q){if(z.length!==q.length)console.warn("copyWithRename() expects paths of the same length");else{for(var pe=0;pe<q.length-1;pe++)if(z[pe]!==q[pe]){console.warn("copyWithRename() expects paths to be the same except for the deepest key");return}return r(R,z,q,0)}}function r(R,z,q,pe){var Ce=z[pe],Te=wc(R)?R.slice():Q0({},R);return pe+1===z.length?(Te[q[pe]]=Te[Ce],wc(Te)?Te.splice(Ce,1):delete Te[Ce]):Te[Ce]=r(R[Ce],z,q,pe+1),Te}function i(R,z,q){var pe=z[q],Ce=wc(R)?R.slice():Q0({},R);if(q+1===z.length)return wc(Ce)?Ce.splice(pe,1):delete Ce[pe],Ce;return Ce[pe]=i(R[pe],z,q+1),Ce}function s(){return!1}function a(){return null}function c(R,z,q,pe){return new bE(R,z,q,pe)}function l(R,z){R.context===ex&&(D6(z,R,null,null),B6())}function h(R,z){if(R1!==null){var q=z.staleFamilies;z=z.updatedFamilies,J3(),CE(R.current,z,q),B6()}}function d(R){R1=R}function u(){}function _(){console.error("Do not call Hooks inside useEffect(...), useMemo(...), or other built-in Hooks. You can only call Hooks at the top level of your React function. For more information, see https://react.dev/link/rules-of-hooks")}function p(){console.error("Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo().")}function m(){}function A(R){var z=[];return R.forEach(function(q){z.push(q)}),z.sort().join(", ")}function g(R){var z=R,q=R;if(R.alternate)for(;z.return;)z=z.return;else{R=z;do z=R,(z.flags&4098)!==0&&(q=z.return),R=z.return;while(R)}return z.tag===3?q:null}function f(R){if(g(R)!==R)throw Error("Unable to find node on an unmounted component.")}function y(R){var z=R.alternate;if(!z){if(z=g(R),z===null)throw Error("Unable to find node on an unmounted component.");return z!==R?null:R}for(var q=R,pe=z;;){var Ce=q.return;if(Ce===null)break;var Te=Ce.alternate;if(Te===null){if(pe=Ce.return,pe!==null){q=pe;continue}break}if(Ce.child===Te.child){for(Te=Ce.child;Te;){if(Te===q)return f(Ce),R;if(Te===pe)return f(Ce),z;Te=Te.sibling}throw Error("Unable to find node on an unmounted component.")}if(q.return!==pe.return)q=Ce,pe=Te;else{for(var ht=!1,Et=Ce.child;Et;){if(Et===q){ht=!0,q=Ce,pe=Te;break}if(Et===pe){ht=!0,pe=Ce,q=Te;break}Et=Et.sibling}if(!ht){for(Et=Te.child;Et;){if(Et===q){ht=!0,q=Te,pe=Ce;break}if(Et===pe){ht=!0,pe=Te,q=Ce;break}Et=Et.sibling}if(!ht)throw Error("Child was not found in either parent set. This indicates a bug in React related to the return pointer. Please file an issue.")}}if(q.alternate!==pe)throw Error("Return fibers should always be each others' alternates. This error is likely caused by a bug in React. Please file an issue.")}if(q.tag!==3)throw Error("Unable to find node on an unmounted component.");return q.stateNode.current===q?R:z}function x(R){return R=y(R),R!==null?C(R):null}function C(R){var z=R.tag;if(z===5||z===26||z===27||z===6)return R;for(R=R.child;R!==null;){if(z=C(R),z!==null)return z;R=R.sibling}return null}function b(R){var z=R.tag;if(z===5||z===26||z===27||z===6)return R;for(R=R.child;R!==null;){if(R.tag!==4&&(z=b(R),z!==null))return z;R=R.sibling}return null}function I(R){if(R===null||typeof R!=="object")return null;return R=Wd&&R[Wd]||R["@@iterator"],typeof R==="function"?R:null}function v(R){if(R==null)return null;if(typeof R==="function")return R.$$typeof===kU?null:R.displayName||R.name||null;if(typeof R==="string")return R;switch(R){case Or:return"Fragment";case pD:return"Profiler";case O_:return"StrictMode";case mD:return"Suspense";case C1:return"SuspenseList";case lp:return"Activity"}if(typeof R==="object")switch(typeof R.tag==="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),R.$$typeof){case $y:return"Portal";case x1:return(R.displayName||"Context")+".Provider";case Vv:return(R._context.displayName||"Context")+".Consumer";case R6:var z=R.render;return R=R.displayName,R||(R=z.displayName||z.name||"",R=R!==""?"ForwardRef("+R+")":"ForwardRef"),R;case Ai:return z=R.displayName||null,z!==null?z:v(R.type)||"Memo";case af:z=R._payload,R=R._init;try{return v(R(z))}catch(q){}}return null}function P(R){var z=R.type;switch(R.tag){case 31:return"Activity";case 24:return"Cache";case 9:return(z._context.displayName||"Context")+".Consumer";case 10:return(z.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return R=z.render,R=R.displayName||R.name||"",z.displayName||(R!==""?"ForwardRef("+R+")":"ForwardRef");case 7:return"Fragment";case 26:case 27:case 5:return z;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return v(z);case 8:return z===O_?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 14:case 15:if(typeof z==="function")return z.displayName||z.name||null;if(typeof z==="string")return z;break;case 29:if(z=R._debugInfo,z!=null){for(var q=z.length-1;0<=q;q--)if(typeof z[q].name==="string")return z[q].name}if(R.return!==null)return P(R.return)}return null}function M(R){return{current:R}}function B(R,z){0>S1?console.error("Unexpected pop."):(z!==qv[S1]&&console.error("Unexpected Fiber popped."),R.current=cC[S1],cC[S1]=null,qv[S1]=null,S1--)}function T(R,z,q){S1++,cC[S1]=R.current,qv[S1]=q,R.current=z}function N(R){return R>>>=0,R===0?32:31-(HH(R)/TE|0)|0}function D(R){if(R&1)return"SyncHydrationLane";if(R&2)return"Sync";if(R&4)return"InputContinuousHydration";if(R&8)return"InputContinuous";if(R&16)return"DefaultHydration";if(R&32)return"Default";if(R&128)return"TransitionHydration";if(R&4194048)return"Transition";if(R&62914560)return"Retry";if(R&67108864)return"SelectiveHydration";if(R&134217728)return"IdleHydration";if(R&268435456)return"Idle";if(R&536870912)return"Offscreen";if(R&1073741824)return"Deferred"}function L(R){var z=R&42;if(z!==0)return z;switch(R&-R){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return R&4194048;case 4194304:case 8388608:case 16777216:case 33554432:return R&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return console.error("Should have found matching lanes. This is a bug in React."),R}}function H(R,z,q){var pe=R.pendingLanes;if(pe===0)return 0;var Ce=0,Te=R.suspendedLanes,ht=R.pingedLanes;R=R.warmLanes;var Et=pe&134217727;return Et!==0?(pe=Et&~Te,pe!==0?Ce=L(pe):(ht&=Et,ht!==0?Ce=L(ht):q||(q=Et&~R,q!==0&&(Ce=L(q))))):(Et=pe&~Te,Et!==0?Ce=L(Et):ht!==0?Ce=L(ht):q||(q=pe&~R,q!==0&&(Ce=L(q)))),Ce===0?0:z!==0&&z!==Ce&&(z&Te)===0&&(Te=Ce&-Ce,q=z&-z,Te>=q||Te===32&&(q&4194048)!==0)?z:Ce}function V(R,z){return(R.pendingLanes&~(R.suspendedLanes&~R.pingedLanes)&z)===0}function O(R,z){switch(R){case 1:case 2:case 4:case 8:case 64:return z+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return z+5000;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return console.error("Should have found matching lanes. This is a bug in React."),-1}}function U(){var R=j6;return j6<<=1,(j6&4194048)===0&&(j6=256),R}function j(){var R=P1;return P1<<=1,(P1&62914560)===0&&(P1=4194304),R}function Y(R){for(var z=[],q=0;31>q;q++)z.push(R);return z}function X(R,z){R.pendingLanes|=z,z!==268435456&&(R.suspendedLanes=0,R.pingedLanes=0,R.warmLanes=0)}function K(R,z,q,pe,Ce,Te){var ht=R.pendingLanes;R.pendingLanes=q,R.suspendedLanes=0,R.pingedLanes=0,R.warmLanes=0,R.expiredLanes&=q,R.entangledLanes&=q,R.errorRecoveryDisabledLanes&=q,R.shellSuspendCounter=0;var{entanglements:Et,expirationTimes:Cn,hiddenUpdates:Kn}=R;for(q=ht&~q;0<q;){var Vo=31-Fm(q),jo=1<<Vo;Et[Vo]=0,Cn[Vo]=-1;var yr=Kn[Vo];if(yr!==null)for(Kn[Vo]=null,Vo=0;Vo<yr.length;Vo++){var $i=yr[Vo];$i!==null&&($i.lane&=-536870913)}q&=~jo}pe!==0&&J(R,pe,0),Te!==0&&Ce===0&&R.tag!==0&&(R.suspendedLanes|=Te&~(ht&~z))}function J(R,z,q){R.pendingLanes|=z,R.suspendedLanes&=~z;var pe=31-Fm(z);R.entangledLanes|=z,R.entanglements[pe]=R.entanglements[pe]|1073741824|q&4194090}function ee(R,z){var q=R.entangledLanes|=z;for(R=R.entanglements;q;){var pe=31-Fm(q),Ce=1<<pe;Ce&z|R[pe]&z&&(R[pe]|=z),q&=~Ce}}function se(R){switch(R){case 2:R=1;break;case 8:R=4;break;case 32:R=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:R=128;break;case 268435456:R=134217728;break;default:R=0}return R}function ne(R,z,q){if(l2)for(R=R.pendingUpdatersLaneMap;0<q;){var pe=31-Fm(q),Ce=1<<pe;R[pe].add(z),q&=~Ce}}function re(R,z){if(l2)for(var q=R.pendingUpdatersLaneMap,pe=R.memoizedUpdaters;0<z;){var Ce=31-Fm(z);R=1<<Ce,Ce=q[Ce],0<Ce.size&&(Ce.forEach(function(Te){var ht=Te.alternate;ht!==null&&pe.has(ht)||pe.add(Te)}),Ce.clear()),z&=~R}}function Z(R){return R&=-R,2<R?8<R?(R&134217727)!==0?32:268435456:8:2}function te(R){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")return!1;var z=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(z.isDisabled)return!0;if(!z.supportsFiber)return console.error("The installed version of React DevTools is too old and will not work with the current version of React. Please update React DevTools. https://react.dev/link/react-devtools"),!0;try{lC=z.inject(R),jp=z}catch(q){console.error("React instrumentation encountered an error: %s.",q)}return z.checkDCE?!0:!1}function ie(R){if(typeof zH==="function"&&ZU(R),jp&&typeof jp.setStrictMode==="function")try{jp.setStrictMode(lC,R)}catch(z){c2||(c2=!0,console.error("React instrumentation encountered an error: %s",z))}}function ce(R){gr=R}function ue(){gr!==null&&typeof gr.markCommitStopped==="function"&&gr.markCommitStopped()}function de(R){gr!==null&&typeof gr.markComponentRenderStarted==="function"&&gr.markComponentRenderStarted(R)}function me(){gr!==null&&typeof gr.markComponentRenderStopped==="function"&&gr.markComponentRenderStopped()}function ge(R){gr!==null&&typeof gr.markRenderStarted==="function"&&gr.markRenderStarted(R)}function xe(){gr!==null&&typeof gr.markRenderStopped==="function"&&gr.markRenderStopped()}function Ee(R,z){gr!==null&&typeof gr.markStateUpdateScheduled==="function"&&gr.markStateUpdateScheduled(R,z)}function Re(){}function Me(){if(t8===0){jh=console.log,tx=console.info,G_=console.warn,n8=console.error,h2=console.group,o8=console.groupCollapsed,OH=console.groupEnd;var R={configurable:!0,enumerable:!0,value:Re,writable:!0};Object.defineProperties(console,{info:R,log:R,warn:R,error:R,group:R,groupCollapsed:R,groupEnd:R})}t8++}function _e(){if(t8--,t8===0){var R={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:Q0({},R,{value:jh}),info:Q0({},R,{value:tx}),warn:Q0({},R,{value:G_}),error:Q0({},R,{value:n8}),group:Q0({},R,{value:h2}),groupCollapsed:Q0({},R,{value:o8}),groupEnd:Q0({},R,{value:OH})})}0>t8&&console.error("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}function ye(R){if(r8===void 0)try{throw Error()}catch(q){var z=q.stack.trim().match(/\n( *(at )?)/);r8=z&&z[1]||"",ED=-1<q.stack.indexOf(`
    at`)?" (<anonymous>)":-1<q.stack.indexOf("@")?"@unknown:0:0":""}return`
`+r8+R+ED}function Se(R,z){if(!R||DE)return"";var q=NE.get(R);if(q!==void 0)return q;DE=!0,q=Error.prepareStackTrace,Error.prepareStackTrace=void 0;var pe=null;pe=kn.H,kn.H=null,Me();try{var Ce={DetermineComponentFrameRoot:function(){try{if(z){var yr=function(){throw Error()};if(Object.defineProperty(yr.prototype,"props",{set:function(){throw Error()}}),typeof Reflect==="object"&&Reflect.construct){try{Reflect.construct(yr,[])}catch(Zc){var $i=Zc}Reflect.construct(R,[],yr)}else{try{yr.call()}catch(Zc){$i=Zc}R.call(yr.prototype)}}else{try{throw Error()}catch(Zc){$i=Zc}(yr=R())&&typeof yr.catch==="function"&&yr.catch(function(){})}}catch(Zc){if(Zc&&$i&&typeof Zc.stack==="string")return[Zc.stack,$i.stack]}return[null,null]}};Ce.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var Te=Object.getOwnPropertyDescriptor(Ce.DetermineComponentFrameRoot,"name");Te&&Te.configurable&&Object.defineProperty(Ce.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var ht=Ce.DetermineComponentFrameRoot(),Et=ht[0],Cn=ht[1];if(Et&&Cn){var Kn=Et.split(`
`),Vo=Cn.split(`
`);for(ht=Te=0;Te<Kn.length&&!Kn[Te].includes("DetermineComponentFrameRoot");)Te++;for(;ht<Vo.length&&!Vo[ht].includes("DetermineComponentFrameRoot");)ht++;if(Te===Kn.length||ht===Vo.length)for(Te=Kn.length-1,ht=Vo.length-1;1<=Te&&0<=ht&&Kn[Te]!==Vo[ht];)ht--;for(;1<=Te&&0<=ht;Te--,ht--)if(Kn[Te]!==Vo[ht]){if(Te!==1||ht!==1)do if(Te--,ht--,0>ht||Kn[Te]!==Vo[ht]){var jo=`
`+Kn[Te].replace(" at new "," at ");return R.displayName&&jo.includes("<anonymous>")&&(jo=jo.replace("<anonymous>",R.displayName)),typeof R==="function"&&NE.set(R,jo),jo}while(1<=Te&&0<=ht);break}}}finally{DE=!1,kn.H=pe,_e(),Error.prepareStackTrace=q}return Kn=(Kn=R?R.displayName||R.name:"")?ye(Kn):"",typeof R==="function"&&NE.set(R,Kn),Kn}function Ne(R){var z=Error.prepareStackTrace;if(Error.prepareStackTrace=void 0,R=R.stack,Error.prepareStackTrace=z,R.startsWith(`Error: react-stack-top-frame
`)&&(R=R.slice(29)),z=R.indexOf(`
`),z!==-1&&(R=R.slice(z+1)),z=R.indexOf("react-stack-bottom-frame"),z!==-1&&(z=R.lastIndexOf(`
`,z)),z!==-1)R=R.slice(0,z);else return"";return R}function Le(R){switch(R.tag){case 26:case 27:case 5:return ye(R.type);case 16:return ye("Lazy");case 13:return ye("Suspense");case 19:return ye("SuspenseList");case 0:case 15:return Se(R.type,!1);case 11:return Se(R.type.render,!1);case 1:return Se(R.type,!0);case 31:return ye("Activity");default:return""}}function nt(R){try{var z="";do{z+=Le(R);var q=R._debugInfo;if(q)for(var pe=q.length-1;0<=pe;pe--){var Ce=q[pe];if(typeof Ce.name==="string"){var Te=z,ht=Ce.env,Et=ye(Ce.name+(ht?" ["+ht+"]":""));z=Te+Et}}R=R.return}while(R);return z}catch(Cn){return`
Error generating stack: `+Cn.message+`
`+Cn.stack}}function dt(R){return(R=R?R.displayName||R.name:"")?ye(R):""}function rt(R,z){if(typeof R==="object"&&R!==null){var q=i8.get(R);if(q!==void 0)return q;return z={value:R,source:z,stack:nt(z)},i8.set(R,z),z}return{value:R,source:z,stack:nt(z)}}function pt(R,z){Lt(),hC[Y5++]=MD,hC[Y5++]=$6,$6=R,MD=z}function ct(R,z,q){Lt(),Tu[U_++]=d2,Tu[U_++]=M1,Tu[U_++]=ks,ks=R;var pe=d2;R=M1;var Ce=32-Fm(pe)-1;pe&=~(1<<Ce),q+=1;var Te=32-Fm(z)+Ce;if(30<Te){var ht=Ce-Ce%5;Te=(pe&(1<<ht)-1).toString(32),pe>>=ht,Ce-=ht,d2=1<<32-Fm(z)+Ce|q<<Ce|pe,M1=Te+R}else d2=1<<Te|q<<Ce|pe,M1=R}function Ct(R){Lt(),R.return!==null&&(pt(R,1),ct(R,1,0))}function kt(R){for(;R===$6;)$6=hC[--Y5],hC[Y5]=null,MD=hC[--Y5],hC[Y5]=null;for(;R===ks;)ks=Tu[--U_],Tu[U_]=null,M1=Tu[--U_],Tu[U_]=null,d2=Tu[--U_],Tu[U_]=null}function Lt(){Ra||console.error("Expected to be hydrating. This is a bug in React. Please file an issue.")}function Bt(R){return R===null&&console.error("Expected host context to exist. This error is likely caused by a bug in React. Please file an issue."),R}function xt(R,z){T(uf,z,R),T(q6,R,R),T(W_,null,R),z=qy(z),B(W_,R),T(W_,z,R)}function Yt(R){B(W_,R),B(q6,R),B(uf,R)}function ut(){return Bt(W_.current)}function Ze(R){R.memoizedState!==null&&T(dC,R,R);var z=Bt(W_.current),q=Yl(z,R.type);z!==q&&(T(q6,R,R),T(W_,q,R))}function Fe(R){q6.current===R&&(B(W_,R),B(q6,R)),dC.current===R&&(B(dC,R),Pl?tC._currentValue=H6:tC._currentValue2=H6)}function tt(R,z){return R.serverProps===void 0&&R.serverTail.length===0&&R.children.length===1&&3<R.distanceFromLeaf&&R.distanceFromLeaf>15-z?tt(R.children[0],z):R}function Je(R){return"  "+"  ".repeat(R)}function $e(R){return"+ "+"  ".repeat(R)}function ft(R){return"- "+"  ".repeat(R)}function vt(R){switch(R.tag){case 26:case 27:case 5:return R.type;case 16:return"Lazy";case 13:return"Suspense";case 19:return"SuspenseList";case 0:case 15:return R=R.type,R.displayName||R.name||null;case 11:return R=R.type.render,R.displayName||R.name||null;case 1:return R=R.type,R.displayName||R.name||null;default:return null}}function Ye(R,z){return VH.test(R)?(R=JSON.stringify(R),R.length>z-2?8>z?'{"..."}':"{"+R.slice(0,z-7)+'..."}':"{"+R+"}"):R.length>z?5>z?'{"..."}':R.slice(0,z-3)+"...":R}function je(R,z,q){var pe=120-2*q;if(z===null)return $e(q)+Ye(R,pe)+`
`;if(typeof z==="string"){for(var Ce=0;Ce<z.length&&Ce<R.length&&z.charCodeAt(Ce)===R.charCodeAt(Ce);Ce++);return Ce>pe-8&&10<Ce&&(R="..."+R.slice(Ce-8),z="..."+z.slice(Ce-8)),$e(q)+Ye(R,pe)+`
`+ft(q)+Ye(z,pe)+`
`}return Je(q)+Ye(R,pe)+`
`}function st(R){return Object.prototype.toString.call(R).replace(/^\[object (.*)\]$/,function(z,q){return q})}function St(R,z){switch(typeof R){case"string":return R=JSON.stringify(R),R.length>z?5>z?'"..."':R.slice(0,z-4)+'..."':R;case"object":if(R===null)return"null";if(wc(R))return"[...]";if(R.$$typeof===k0)return(z=v(R.type))?"<"+z+">":"<...>";var q=st(R);if(q==="Object"){q="",z-=2;for(var pe in R)if(R.hasOwnProperty(pe)){var Ce=JSON.stringify(pe);if(Ce!=='"'+pe+'"'&&(pe=Ce),z-=pe.length-2,Ce=St(R[pe],15>z?z:15),z-=Ce.length,0>z){q+=q===""?"...":", ...";break}q+=(q===""?"":",")+pe+":"+Ce}return"{"+q+"}"}return q;case"function":return(z=R.displayName||R.name)?"function "+z:"function";default:return String(R)}}function Nt(R,z){return typeof R!=="string"||VH.test(R)?"{"+St(R,z-2)+"}":R.length>z-2?5>z?'"..."':'"'+R.slice(0,z-5)+'..."':'"'+R+'"'}function Ot(R,z,q){var pe=120-q.length-R.length,Ce=[],Te;for(Te in z)if(z.hasOwnProperty(Te)&&Te!=="children"){var ht=Nt(z[Te],120-q.length-Te.length-1);pe-=Te.length+ht.length+2,Ce.push(Te+"="+ht)}return Ce.length===0?q+"<"+R+`>
`:0<pe?q+"<"+R+" "+Ce.join(" ")+`>
`:q+"<"+R+`
`+q+"  "+Ce.join(`
`+q+"  ")+`
`+q+`>
`}function Ut(R,z,q){var pe="",Ce=Q0({},z),Te;for(Te in R)if(R.hasOwnProperty(Te)){delete Ce[Te];var ht=120-2*q-Te.length-2,Et=St(R[Te],ht);z.hasOwnProperty(Te)?(ht=St(z[Te],ht),pe+=$e(q)+Te+": "+Et+`
`,pe+=ft(q)+Te+": "+ht+`
`):pe+=$e(q)+Te+": "+Et+`
`}for(var Cn in Ce)Ce.hasOwnProperty(Cn)&&(R=St(Ce[Cn],120-2*q-Cn.length-2),pe+=ft(q)+Cn+": "+R+`
`);return pe}function mn(R,z,q,pe){var Ce="",Te=new Map;for(Kn in q)q.hasOwnProperty(Kn)&&Te.set(Kn.toLowerCase(),Kn);if(Te.size===1&&Te.has("children"))Ce+=Ot(R,z,Je(pe));else{for(var ht in z)if(z.hasOwnProperty(ht)&&ht!=="children"){var Et=120-2*(pe+1)-ht.length-1,Cn=Te.get(ht.toLowerCase());if(Cn!==void 0){Te.delete(ht.toLowerCase());var Kn=z[ht];Cn=q[Cn];var Vo=Nt(Kn,Et);Et=Nt(Cn,Et),typeof Kn==="object"&&Kn!==null&&typeof Cn==="object"&&Cn!==null&&st(Kn)==="Object"&&st(Cn)==="Object"&&(2<Object.keys(Kn).length||2<Object.keys(Cn).length||-1<Vo.indexOf("...")||-1<Et.indexOf("..."))?Ce+=Je(pe+1)+ht+`={{
`+Ut(Kn,Cn,pe+2)+Je(pe+1)+`}}
`:(Ce+=$e(pe+1)+ht+"="+Vo+`
`,Ce+=ft(pe+1)+ht+"="+Et+`
`)}else Ce+=Je(pe+1)+ht+"="+Nt(z[ht],Et)+`
`}Te.forEach(function(jo){if(jo!=="children"){var yr=120-2*(pe+1)-jo.length-1;Ce+=ft(pe+1)+jo+"="+Nt(q[jo],yr)+`
`}}),Ce=Ce===""?Je(pe)+"<"+R+`>
`:Je(pe)+"<"+R+`
`+Ce+Je(pe)+`>
`}if(R=q.children,z=z.children,typeof R==="string"||typeof R==="number"||typeof R==="bigint"){if(Te="",typeof z==="string"||typeof z==="number"||typeof z==="bigint")Te=""+z;Ce+=je(Te,""+R,pe+1)}else if(typeof z==="string"||typeof z==="number"||typeof z==="bigint")Ce=R==null?Ce+je(""+z,null,pe+1):Ce+je(""+z,void 0,pe+1);return Ce}function _n(R,z){var q=vt(R);if(q===null){q="";for(R=R.child;R;)q+=_n(R,z),R=R.sibling;return q}return Je(z)+"<"+q+`>
`}function En(R,z){var q=tt(R,z);if(q!==R&&(R.children.length!==1||R.children[0]!==q))return Je(z)+`...
`+En(q,z+1);q="";var pe=R.fiber._debugInfo;if(pe)for(var Ce=0;Ce<pe.length;Ce++){var Te=pe[Ce].name;typeof Te==="string"&&(q+=Je(z)+"<"+Te+`>
`,z++)}if(pe="",Ce=R.fiber.pendingProps,R.fiber.tag===6)pe=je(Ce,R.serverProps,z),z++;else if(Te=vt(R.fiber),Te!==null)if(R.serverProps===void 0){pe=z;var ht=120-2*pe-Te.length-2,Et="";for(Kn in Ce)if(Ce.hasOwnProperty(Kn)&&Kn!=="children"){var Cn=Nt(Ce[Kn],15);if(ht-=Kn.length+Cn.length+2,0>ht){Et+=" ...";break}Et+=" "+Kn+"="+Cn}pe=Je(pe)+"<"+Te+Et+`>
`,z++}else R.serverProps===null?(pe=Ot(Te,Ce,$e(z)),z++):typeof R.serverProps==="string"?console.error("Should not have matched a non HostText fiber to a Text node. This is a bug in React."):(pe=mn(Te,Ce,R.serverProps,z),z++);var Kn="";Ce=R.fiber.child;for(Te=0;Ce&&Te<R.children.length;)ht=R.children[Te],ht.fiber===Ce?(Kn+=En(ht,z),Te++):Kn+=_n(Ce,z),Ce=Ce.sibling;Ce&&0<R.children.length&&(Kn+=Je(z)+`...
`),Ce=R.serverTail,R.serverProps===null&&z--;for(R=0;R<Ce.length;R++)Te=Ce[R],Kn=typeof Te==="string"?Kn+(ft(z)+Ye(Te,120-2*z)+`
`):Kn+Ot(Te.type,Te.props,ft(z));return q+pe+Kn}function Qn(R){try{return`

`+En(R,0)}catch(z){return""}}function ln(){if(Yg===null)return"";var R=Yg;try{var z="";switch(R.tag===6&&(R=R.return),R.tag){case 26:case 27:case 5:z+=ye(R.type);break;case 13:z+=ye("Suspense");break;case 19:z+=ye("SuspenseList");break;case 31:z+=ye("Activity");break;case 30:case 0:case 15:case 1:R._debugOwner||z!==""||(z+=dt(R.type));break;case 11:R._debugOwner||z!==""||(z+=dt(R.type.render))}for(;R;)if(typeof R.tag==="number"){var q=R;R=q._debugOwner;var pe=q._debugStack;R&&pe&&(typeof pe!=="string"&&(q._debugStack=pe=Ne(pe)),pe!==""&&(z+=`
`+pe))}else if(R.debugStack!=null){var Ce=R.debugStack;(R=R.owner)&&Ce&&(z+=`
`+Ne(Ce))}else break;var Te=z}catch(ht){Te=`
Error generating stack: `+ht.message+`
`+ht.stack}return Te}function hn(R,z,q,pe,Ce,Te,ht){var Et=Yg;Zn(R);try{return R!==null&&R._debugTask?R._debugTask.run(z.bind(null,q,pe,Ce,Te,ht)):z(q,pe,Ce,Te,ht)}finally{Zn(Et)}throw Error("runWithFiberInDEV should never be called in production. This is a bug in React.")}function Zn(R){kn.getCurrentStack=R===null?null:ln,pf=!1,Yg=R}function bo(R,z){if(R.return===null){if($d===null)$d={fiber:R,children:[],serverProps:void 0,serverTail:[],distanceFromLeaf:z};else{if($d.fiber!==R)throw Error("Saw multiple hydration diff roots in a pass. This is a bug in React.");$d.distanceFromLeaf>z&&($d.distanceFromLeaf=z)}return $d}var q=bo(R.return,z+1).children;if(0<q.length&&q[q.length-1].fiber===R)return q=q[q.length-1],q.distanceFromLeaf>z&&(q.distanceFromLeaf=z),q;return z={fiber:R,children:[],serverProps:void 0,serverTail:[],distanceFromLeaf:z},q.push(z),z}function ir(R,z){w1||(R=bo(R,0),R.serverProps=null,z!==null&&(z=U6(z),R.serverTail.push(z)))}function gt(R){var z="",q=$d;throw q!==null&&($d=null,z=Qn(q)),wn(rt(Error(`Hydration failed because the server rendered HTML didn't match the client. As a result this tree will be regenerated on the client. This can happen if a SSR-ed Client Component used:

- A server/client branch \`if (typeof window !== 'undefined')\`.
- Variable input such as \`Date.now()\` or \`Math.random()\` which changes each time it's called.
- Date formatting in a user's locale which doesn't match the server.
- External changing data without sending a snapshot of it along with the HTML.
- Invalid HTML tag nesting.

It can also happen if the client has a browser extension installed which messes with the HTML before React loaded.

https://react.dev/link/hydration-mismatch`+z),R)),RE}function Oe(R,z){if(!V_)throw Error("Expected prepareToHydrateHostInstance() to never be called. This error is likely caused by a bug in React. Please file an issue.");xD(R.stateNode,R.type,R.memoizedProps,z,R)||gt(R)}function mt(R){for(ac=R.return;ac;)switch(ac.tag){case 5:case 13:ba=!1;return;case 27:case 3:ba=!0;return;default:ac=ac.return}}function It(R){if(!V_||R!==ac)return!1;if(!Ra)return mt(R),Ra=!0,!1;var z=R.tag;if(Bu?z!==3&&z!==27&&(z!==5||G6(R.type)&&!cf(R.type,R.memoizedProps))&&Kd&&(bt(R),gt(R)):z!==3&&(z!==5||G6(R.type)&&!cf(R.type,R.memoizedProps))&&Kd&&(bt(R),gt(R)),mt(R),z===13){if(!V_)throw Error("Expected skipPastDehydratedSuspenseInstance() to never be called. This error is likely caused by a bug in React. Please file an issue.");if(R=R.memoizedState,R=R!==null?R.dehydrated:null,!R)throw Error("Expected to have a hydrated suspense instance. This error is likely caused by a bug in React. Please file an issue.");Kd=CD(R)}else Kd=Bu&&z===27?Wv(R.type,Kd):ac?Y_(R.stateNode):null;return!0}function bt(R){for(var z=Kd;z;){var q=bo(R,0),pe=U6(z);q.serverTail.push(pe),z=pe.type==="Suspense"?CD(z):Y_(z)}}function cn(){V_&&(Kd=ac=null,w1=Ra=!1)}function dn(){var R=uC;return R!==null&&(Wl===null?Wl=R:Wl.push.apply(Wl,R),uC=null),R}function wn(R){uC===null?uC=[R]:uC.push(R)}function eo(){var R=$d;if(R!==null){$d=null;for(var z=Qn(R);0<R.children.length;)R=R.children[0];hn(R.fiber,function(){console.error(`A tree hydrated but some attributes of the server rendered HTML didn't match the client properties. This won't be patched up. This can happen if a SSR-ed Client Component used:

- A server/client branch \`if (typeof window !== 'undefined')\`.
- Variable input such as \`Date.now()\` or \`Math.random()\` which changes each time it's called.
- Date formatting in a user's locale which doesn't match the server.
- External changing data without sending a snapshot of it along with the HTML.
- Invalid HTML tag nesting.

It can also happen if the client has a browser extension installed which messes with the HTML before React loaded.

%s%s`,"https://react.dev/link/hydration-mismatch",z)})}}function _o(R,z){return R===z&&(R!==0||1/R===1/z)||R!==R&&z!==z}function $n(){nx=Z6=null,G5=!1}function qn(R,z,q){Pl?(T(s8,z._currentValue,R),z._currentValue=q,T(zm,z._currentRenderer,R),z._currentRenderer!==void 0&&z._currentRenderer!==null&&z._currentRenderer!==J6&&console.error("Detected multiple renderers concurrently rendering the same context provider. This is currently unsupported."),z._currentRenderer=J6):(T(s8,z._currentValue2,R),z._currentValue2=q,T(wD,z._currentRenderer2,R),z._currentRenderer2!==void 0&&z._currentRenderer2!==null&&z._currentRenderer2!==J6&&console.error("Detected multiple renderers concurrently rendering the same context provider. This is currently unsupported."),z._currentRenderer2=J6)}function Po(R,z){var q=s8.current;Pl?(R._currentValue=q,q=zm.current,B(zm,z),R._currentRenderer=q):(R._currentValue2=q,q=wD.current,B(wD,z),R._currentRenderer2=q),B(s8,z)}function To(R,z,q){for(;R!==null;){var pe=R.alternate;if((R.childLanes&z)!==z?(R.childLanes|=z,pe!==null&&(pe.childLanes|=z)):pe!==null&&(pe.childLanes&z)!==z&&(pe.childLanes|=z),R===q)break;R=R.return}R!==q&&console.error("Expected to find the propagation root when scheduling context work. This error is likely caused by a bug in React. Please file an issue.")}function Tn(R,z,q,pe){var Ce=R.child;Ce!==null&&(Ce.return=R);for(;Ce!==null;){var Te=Ce.dependencies;if(Te!==null){var ht=Ce.child;Te=Te.firstContext;e:for(;Te!==null;){var Et=Te;Te=Ce;for(var Cn=0;Cn<z.length;Cn++)if(Et.context===z[Cn]){Te.lanes|=q,Et=Te.alternate,Et!==null&&(Et.lanes|=q),To(Te.return,q,R),pe||(ht=null);break e}Te=Et.next}}else if(Ce.tag===18){if(ht=Ce.return,ht===null)throw Error("We just came from a parent so we must have had a parent. This is a bug in React.");ht.lanes|=q,Te=ht.alternate,Te!==null&&(Te.lanes|=q),To(ht,q,R),ht=null}else ht=Ce.child;if(ht!==null)ht.return=Ce;else for(ht=Ce;ht!==null;){if(ht===R){ht=null;break}if(Ce=ht.sibling,Ce!==null){Ce.return=ht.return,ht=Ce;break}ht=ht.return}Ce=ht}}function lo(R,z,q,pe){R=null;for(var Ce=z,Te=!1;Ce!==null;){if(!Te){if((Ce.flags&524288)!==0)Te=!0;else if((Ce.flags&262144)!==0)break}if(Ce.tag===10){var ht=Ce.alternate;if(ht===null)throw Error("Should have a current fiber. This is a bug in React.");if(ht=ht.memoizedProps,ht!==null){var Et=Ce.type;Kp(Ce.pendingProps.value,ht.value)||(R!==null?R.push(Et):R=[Et])}}else if(Ce===dC.current){if(ht=Ce.alternate,ht===null)throw Error("Should have a current fiber. This is a bug in React.");ht.memoizedState.memoizedState!==Ce.memoizedState.memoizedState&&(R!==null?R.push(tC):R=[tC])}Ce=Ce.return}R!==null&&Tn(z,R,q,pe),z.flags|=262144}function fo(R){for(R=R.firstContext;R!==null;){var z=R.context;if(!Kp(Pl?z._currentValue:z._currentValue2,R.memoizedValue))return!0;R=R.next}return!1}function oo(R){Z6=R,nx=null,R=R.dependencies,R!==null&&(R.firstContext=null)}function Ro(R){return G5&&console.error("Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo()."),Er(Z6,R)}function or(R,z){return Z6===null&&oo(R),Er(R,z)}function Er(R,z){var q=Pl?z._currentValue:z._currentValue2;if(z={context:z,memoizedValue:q,next:null},nx===null){if(R===null)throw Error("Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo().");nx=z,R.dependencies={lanes:0,firstContext:z,_debugThenableState:null},R.flags|=524288}else nx=nx.next=z;return q}function Xi(){return{controller:new Fne,data:new Map,refCount:0}}function Ys(R){R.controller.signal.aborted&&console.warn("A cache instance was retained after it was already freed. This likely indicates a bug in React."),R.refCount++}function aa(R){R.refCount--,0>R.refCount&&console.warn("A cache instance was released after it was already freed. This likely indicates a bug in React."),R.refCount===0&&GH(zne,function(){R.controller.abort()})}function Lo(){var R=pC;return pC=0,R}function Gi(R){var z=pC;return pC=R,z}function bi(R){var z=pC;return pC+=R,z}function os(R){Om=eI(),0>R.actualStartTime&&(R.actualStartTime=Om)}function Lc(R){if(0<=Om){var z=eI()-Om;R.actualDuration+=z,R.selfBaseDuration=z,Om=-1}}function dl(R){if(0<=Om){var z=eI()-Om;R.actualDuration+=z,Om=-1}}function Ec(){if(0<=Om){var R=eI()-Om;Om=-1,pC+=R}}function _d(){Om=eI()}function B0(R){for(var z=R.child;z;)R.actualDuration+=z.actualDuration,z=z.sibling}function Jo(R){R!==mf&&R.next===null&&(mf===null?U5=mf=R:mf=mf.next=R),TD=!0,kn.actQueue!==null?UH||(UH=!0,ca()):c8||(c8=!0,ca())}function zr(R,z){if(!DD&&TD){DD=!0;do{var q=!1;for(var pe=U5;pe!==null;){if(!z)if(R!==0){var Ce=pe.pendingLanes;if(Ce===0)var Te=0;else{var ht=pe.suspendedLanes,Et=pe.pingedLanes;Te=(1<<31-Fm(42|R)+1)-1,Te&=Ce&~(ht&~Et),Te=Te&201326741?Te&201326741|1:Te?Te|2:0}Te!==0&&(q=!0,i1(pe,Te))}else Te=va,Te=H(pe,pe===uh?Te:0,pe.cancelPendingCommit!==null||pe.timeoutHandle!==L6),(Te&3)===0||V(pe,Te)||(q=!0,i1(pe,Te));pe=pe.next}}while(q);DD=!1}}function $r(){Sl()}function Sl(){TD=UH=c8=!1;var R=0;tI!==0&&(vH()&&(R=tI),tI=0);for(var z=df(),q=null,pe=U5;pe!==null;){var Ce=pe.next,Te=ul(pe,z);if(Te===0)pe.next=null,q===null?U5=Ce:q.next=Ce,Ce===null&&(mf=q);else if(q=pe,R!==0||(Te&3)!==0)TD=!0;pe=Ce}zr(R,!1)}function ul(R,z){for(var{suspendedLanes:q,pingedLanes:pe,expirationTimes:Ce}=R,Te=R.pendingLanes&-62914561;0<Te;){var ht=31-Fm(Te),Et=1<<ht,Cn=Ce[ht];if(Cn===-1){if((Et&q)===0||(Et&pe)!==0)Ce[ht]=O(Et,z)}else Cn<=z&&(R.expiredLanes|=Et);Te&=~Et}if(z=uh,q=va,q=H(R,R===z?q:0,R.cancelPendingCommit!==null||R.timeoutHandle!==L6),pe=R.callbackNode,q===0||R===z&&(Ki===pI||Ki===UE)||R.cancelPendingCommit!==null)return pe!==null&&Fp(pe),R.callbackNode=null,R.callbackPriority=0;if((q&3)===0||V(R,q)){if(z=q&-q,z!==R.callbackPriority||kn.actQueue!==null&&pe!==WH)Fp(pe);else return z;switch(Z(q)){case 2:case 8:q=PD;break;case 32:q=e8;break;case 268435456:q=Tc;break;default:q=e8}return pe=gd.bind(null,R),kn.actQueue!==null?(kn.actQueue.push(pe),q=WH):q=Jv(q,pe),R.callbackPriority=z,R.callbackNode=q,z}return pe!==null&&Fp(pe),R.callbackPriority=2,R.callbackNode=null,2}function gd(R,z){if(BD=a8=!1,Gm!==ku&&Gm!==Wne)return R.callbackNode=null,R.callbackPriority=0,null;var q=R.callbackNode;if(J3(!0)&&R.callbackNode!==q)return null;var pe=va;if(pe=H(R,R===uh?pe:0,R.cancelPendingCommit!==null||R.timeoutHandle!==L6),pe===0)return null;return j3(R,pe,z),ul(R,df()),R.callbackNode!=null&&R.callbackNode===q?gd.bind(null,R):null}function i1(R,z){if(J3())return null;a8=BD,BD=!1,j3(R,z,!0)}function Fp(R){R!==WH&&R!==null&&K6(R)}function ca(){kn.actQueue!==null&&kn.actQueue.push(function(){return Sl(),null}),nC?Xh(function(){(Za&(Qu|Wg))!==Ru?Jv(E1,$r):Sl()}):Jv(E1,$r)}function n0(){return tI===0&&(tI=U()),tI}function zp(R,z){if(l8===null){var q=l8=[];ox=0,nI=n0(),h8={status:"pending",value:void 0,then:function(pe){q.push(pe)}}}return ox++,z.then(Yd,Yd),z}function Yd(){if(--ox===0&&l8!==null){h8!==null&&(h8.status="fulfilled");var R=l8;l8=null,nI=0,h8=null;for(var z=0;z<R.length;z++)(0,R[z])()}}function vu(R,z){var q=[],pe={status:"pending",value:null,reason:null,then:function(Ce){q.push(Ce)}};return R.then(function(){pe.status="fulfilled",pe.value=z;for(var Ce=0;Ce<q.length;Ce++)(0,q[Ce])(z)},function(Ce){pe.status="rejected",pe.reason=Ce;for(Ce=0;Ce<q.length;Ce++)(0,q[Ce])(void 0)}),pe}function ji(){var R=W5.current;return R!==null?R:uh.pooledCache}function pl(R,z){z===null?T(W5,W5.current,R):T(W5,z.pool,R)}function Zs(){var R=ji();return R===null?null:{parent:Pl?lh._currentValue:lh._currentValue2,pool:R}}function Cc(R,z){if(Kp(R,z))return!0;if(typeof R!=="object"||R===null||typeof z!=="object"||z===null)return!1;var q=Object.keys(R),pe=Object.keys(z);if(q.length!==pe.length)return!1;for(pe=0;pe<q.length;pe++){var Ce=q[pe];if(!eW.call(z,Ce)||!Kp(R[Ce],z[Ce]))return!1}return!0}function ea(){return{didWarnAboutUncachedPromise:!1,thenables:[]}}function Zr(R){return R=R.status,R==="fulfilled"||R==="rejected"}function Ya(){}function sh(R,z,q){kn.actQueue!==null&&(kn.didUsePromise=!0);var pe=R.thenables;switch(q=pe[q],q===void 0?pe.push(z):q!==z&&(R.didWarnAboutUncachedPromise||(R.didWarnAboutUncachedPromise=!0,console.error("A component was suspended by an uncached promise. Creating promises inside a Client Component or hook is not yet supported, except via a Suspense-compatible library or framework.")),z.then(Ya,Ya),z=q),z.status){case"fulfilled":return z.value;case"rejected":throw R=z.reason,Ad(R),R;default:if(typeof z.status==="string")z.then(Ya,Ya);else{if(R=uh,R!==null&&100<R.shellSuspendCounter)throw Error("An unknown Component is an async Client Component. Only Server Components can be async at the moment. This error is often caused by accidentally adding `'use client'` to a module that was originally written for the server.");R=z,R.status="pending",R.then(function(Ce){if(z.status==="pending"){var Te=z;Te.status="fulfilled",Te.value=Ce}},function(Ce){if(z.status==="pending"){var Te=z;Te.status="rejected",Te.reason=Ce}})}switch(z.status){case"fulfilled":return z.value;case"rejected":throw R=z.reason,Ad(R),R}throw g8=z,$p=!0,_8}}function vs(){if(g8===null)throw Error("Expected a suspended thenable. This is a bug in React. Please file an issue.");var R=g8;return g8=null,$p=!1,R}function Ad(R){if(R===_8||R===kE)throw Error("Hooks are not supported inside an async component. This error is often caused by accidentally adding `'use client'` to a module that was originally written for the server.")}function ah(){for(var R=K5,z=LE=K5=0;z<R;){var q=Vm[z];Vm[z++]=null;var pe=Vm[z];Vm[z++]=null;var Ce=Vm[z];Vm[z++]=null;var Te=Vm[z];if(Vm[z++]=null,pe!==null&&Ce!==null){var ht=pe.pending;ht===null?Ce.next=Ce:(Ce.next=ht.next,ht.next=Ce),pe.pending=Ce}Te!==0&&s1(q,Ce,Te)}}function fd(R,z,q,pe){Vm[K5++]=R,Vm[K5++]=z,Vm[K5++]=q,Vm[K5++]=pe,LE|=pe,R.lanes|=pe,R=R.alternate,R!==null&&(R.lanes|=pe)}function Rg(R,z,q,pe){return fd(R,z,q,pe),KA(R)}function Su(R,z){return fd(R,null,null,z),KA(R)}function s1(R,z,q){R.lanes|=q;var pe=R.alternate;pe!==null&&(pe.lanes|=q);for(var Ce=!1,Te=R.return;Te!==null;)Te.childLanes|=q,pe=Te.alternate,pe!==null&&(pe.childLanes|=q),Te.tag===22&&(R=Te.stateNode,R===null||R._visibility&1||(Ce=!0)),R=Te,Te=Te.return;return R.tag===3?(Te=R.stateNode,Ce&&z!==null&&(Ce=31-Fm(q),R=Te.hiddenUpdates,pe=R[Ce],pe===null?R[Ce]=[z]:pe.push(z),z.lane=q|536870912),Te):null}function KA(R){if(WD>mTe)throw N8=WD=0,XD=uW=null,Error("Maximum update depth exceeded. This can happen when a component repeatedly calls setState inside componentWillUpdate or componentDidUpdate. React limits the number of nested updates to prevent infinite loops.");N8>D_e&&(N8=0,XD=null,console.error("Maximum update depth exceeded. This can happen when a component calls setState inside useEffect, but useEffect either doesn't have a dependency array, or one of the dependencies changes on every render.")),R.alternate===null&&(R.flags&4098)!==0&&fH(R);for(var z=R,q=z.return;q!==null;)z.alternate===null&&(z.flags&4098)!==0&&fH(R),z=q,q=z.return;return z.tag===3?z.stateNode:null}function T0(R){R.updateQueue={baseState:R.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Q_(R,z){R=R.updateQueue,z.updateQueue===R&&(z.updateQueue={baseState:R.baseState,firstBaseUpdate:R.firstBaseUpdate,lastBaseUpdate:R.lastBaseUpdate,shared:R.shared,callbacks:null})}function Gd(R){return{lane:R,tag:HE,payload:null,callback:null,next:null}}function Dm(R,z,q){var pe=R.updateQueue;if(pe===null)return null;if(pe=pe.shared,qH===pe&&!$H){var Ce=P(R);console.error(`An update (setState, replaceState, or forceUpdate) was scheduled from inside an update function. Update functions should be pure, with zero side-effects. Consider using componentDidUpdate or a callback.

Please update the following component: %s`,Ce),$H=!0}if((Za&Qu)!==Ru)return Ce=pe.pending,Ce===null?z.next=z:(z.next=Ce.next,Ce.next=z),pe.pending=z,z=KA(R),s1(R,null,q),z;return fd(R,pe,z,q),KA(R)}function Ph(R,z,q){if(z=z.updateQueue,z!==null&&(z=z.shared,(q&4194048)!==0)){var pe=z.lanes;pe&=R.pendingLanes,q|=pe,z.lanes=q,ee(R,q)}}function Yy(R,z){var q=R.updateQueue,pe=R.alternate;if(pe!==null&&(pe=pe.updateQueue,q===pe)){var Ce=null,Te=null;if(q=q.firstBaseUpdate,q!==null){do{var ht={lane:q.lane,tag:q.tag,payload:q.payload,callback:null,next:null};Te===null?Ce=Te=ht:Te=Te.next=ht,q=q.next}while(q!==null);Te===null?Ce=Te=z:Te=Te.next=z}else Ce=Te=z;q={baseState:pe.baseState,firstBaseUpdate:Ce,lastBaseUpdate:Te,shared:pe.shared,callbacks:pe.callbacks},R.updateQueue=q;return}R=q.lastBaseUpdate,R===null?q.firstBaseUpdate=z:R.next=z,q.lastBaseUpdate=z}function Nm(){if(QD){var R=h8;if(R!==null)throw R}}function $f(R,z,q,pe){QD=!1;var Ce=R.updateQueue;$5=!1,qH=Ce.shared;var{firstBaseUpdate:Te,lastBaseUpdate:ht}=Ce,Et=Ce.shared.pending;if(Et!==null){Ce.shared.pending=null;var Cn=Et,Kn=Cn.next;Cn.next=null,ht===null?Te=Kn:ht.next=Kn,ht=Cn;var Vo=R.alternate;Vo!==null&&(Vo=Vo.updateQueue,Et=Vo.lastBaseUpdate,Et!==ht&&(Et===null?Vo.firstBaseUpdate=Kn:Et.next=Kn,Vo.lastBaseUpdate=Cn))}if(Te!==null){var jo=Ce.baseState;ht=0,Vo=Kn=Cn=null,Et=Te;do{var yr=Et.lane&-536870913,$i=yr!==Et.lane;if($i?(va&yr)===yr:(pe&yr)===yr){yr!==0&&yr===nI&&(QD=!0),Vo!==null&&(Vo=Vo.next={lane:0,tag:Et.tag,payload:Et.payload,callback:null,next:null});e:{yr=R;var Zc=Et,KD=z,$D=q;switch(Zc.tag){case jH:if(Zc=Zc.payload,typeof Zc==="function"){G5=!0;var s4=Zc.call($D,jo,KD);if(yr.mode&8){ie(!0);try{Zc.call($D,jo,KD)}finally{ie(!1)}}G5=!1,jo=s4;break e}jo=Zc;break e;case KH:yr.flags=yr.flags&-65537|128;case HE:if(s4=Zc.payload,typeof s4==="function"){if(G5=!0,Zc=s4.call($D,jo,KD),yr.mode&8){ie(!0);try{s4.call($D,jo,KD)}finally{ie(!1)}}G5=!1}else Zc=s4;if(Zc===null||Zc===void 0)break e;jo=Q0({},jo,Zc);break e;case FE:$5=!0}}yr=Et.callback,yr!==null&&(R.flags|=64,$i&&(R.flags|=8192),$i=Ce.callbacks,$i===null?Ce.callbacks=[yr]:$i.push(yr))}else $i={lane:yr,tag:Et.tag,payload:Et.payload,callback:Et.callback,next:null},Vo===null?(Kn=Vo=$i,Cn=jo):Vo=Vo.next=$i,ht|=yr;if(Et=Et.next,Et===null)if(Et=Ce.shared.pending,Et===null)break;else $i=Et,Et=$i.next,$i.next=null,Ce.lastBaseUpdate=$i,Ce.shared.pending=null}while(1);Vo===null&&(Cn=jo),Ce.baseState=Cn,Ce.firstBaseUpdate=Kn,Ce.lastBaseUpdate=Vo,Te===null&&(Ce.shared.lanes=0),w8|=ht,R.lanes=ht,R.memoizedState=jo}qH=null}function a1(R,z){if(typeof R!=="function")throw Error("Invalid argument passed as callback. Expected a function. Instead received: "+R);R.call(z)}function u6(R,z){var q=R.shared.hiddenCallbacks;if(q!==null)for(R.shared.hiddenCallbacks=null,R=0;R<q.length;R++)a1(q[R],z)}function o0(R,z){var q=R.callbacks;if(q!==null)for(R.callbacks=null,R=0;R<q.length;R++)a1(q[R],z)}function p6(R,z){var q=vC;T(f8,q,R),T(A8,z,R),vC=q|z.baseLanes}function c1(R){T(f8,vC,R),T(A8,A8.current,R)}function yd(R){vC=f8.current,B(A8,R),B(f8,R)}function Rs(){var R=Un;_f===null?_f=[R]:_f.push(R)}function So(){var R=Un;if(_f!==null&&(Ug++,_f[Ug]!==R)){var z=P(Wi);if(!tW.has(z)&&(tW.add(z),_f!==null)){for(var q="",pe=0;pe<=Ug;pe++){var Ce=_f[pe],Te=pe===Ug?R:Ce;for(Ce=pe+1+". "+Ce;30>Ce.length;)Ce+=" ";Ce+=Te+`
`,q+=Ce}console.error(`React has detected a change in the order of Hooks called by %s. This will lead to bugs and errors if not fixed. For more information, read the Rules of Hooks: https://react.dev/link/rules-of-hooks

   Previous render            Next render
   ------------------------------------------------------
%s   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
`,z,q)}}}function Gh(R){R===void 0||R===null||wc(R)||console.error("%s received a final argument that is not an array (instead, received `%s`). When specified, the final argument must be an array.",Un,typeof R)}function Hc(){var R=P(Wi);nW.has(R)||(nW.add(R),console.error("ReactDOM.useFormState has been renamed to React.useActionState. Please update %s to use React.useActionState.",R))}function ua(){throw Error(`Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
1. You might have mismatching versions of React and the renderer (such as React DOM)
2. You might be breaking the Rules of Hooks
3. You might have more than one copy of React in the same app
See https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem.`)}function Qg(R,z){if(OE)return!1;if(z===null)return console.error("%s received a final argument during this render, but not during the previous render. Even though the final argument is optional, its type cannot change between renders.",Un),!1;R.length!==z.length&&console.error(`The final argument passed to %s changed size between renders. The order and size of this array must remain constant.

Previous: %s
Incoming: %s`,Un,"["+z.join(", ")+"]","["+R.join(", ")+"]");for(var q=0;q<z.length&&q<R.length;q++)if(!Kp(R[q],z[q]))return!1;return!0}function L3(R,z,q,pe,Ce,Te){if(q5=Te,Wi=z,_f=R!==null?R._debugHookTypes:null,Ug=-1,OE=R!==null&&R.type!==z.type,Object.prototype.toString.call(q)==="[object AsyncFunction]"||Object.prototype.toString.call(q)==="[object AsyncGeneratorFunction]")Te=P(Wi),zE.has(Te)||(zE.add(Te),console.error("%s is an async Client Component. Only Server Components can be async at the moment. This error is often caused by accidentally adding `'use client'` to a module that was originally written for the server.",Te===null?"An unknown Component":"<"+Te+">"));z.memoizedState=null,z.updateQueue=null,z.lanes=0,kn.H=R!==null&&R.memoizedState!==null?LD:_f!==null?aI:gC,J5=Te=(z.mode&8)!==Jc;var ht=HD(q,pe,Ce);if(J5=!1,_C&&(ht=H3(z,q,pe,Ce)),Te){ie(!0);try{ht=H3(z,q,pe,Ce)}finally{ie(!1)}}return vT(R,z),ht}function vT(R,z){z._debugHookTypes=_f,z.dependencies===null?rx!==null&&(z.dependencies={lanes:0,firstContext:null,_debugThenableState:rx}):z.dependencies._debugThenableState=rx,kn.H=y8;var q=Oc!==null&&Oc.next!==null;if(q5=0,_f=Un=Du=Oc=Wi=null,Ug=-1,R!==null&&(R.flags&65011712)!==(z.flags&65011712)&&console.error("Internal React error: Expected static flag was missing. Please notify the React team."),Jp=!1,sI=0,rx=null,q)throw Error("Rendered fewer hooks than expected. This may be caused by an accidental early return statement.");R===null||Al||(R=R.dependencies,R!==null&&fo(R)&&(Al=!0)),$p?($p=!1,R=!0):R=!1,R&&(z=P(z)||"Unknown",kD.has(z)||zE.has(z)||(kD.add(z),console.error("`use` was called from inside a try/catch block. This is not allowed and can lead to unexpected behavior. To handle errors triggered by `use`, wrap your component in a error boundary.")))}function H3(R,z,q,pe){Wi=R;var Ce=0;do{if(_C&&(rx=null),sI=0,_C=!1,Ce>=rW)throw Error("Too many re-renders. React limits the number of renders to prevent an infinite loop.");if(Ce+=1,OE=!1,Du=Oc=null,R.updateQueue!=null){var Te=R.updateQueue;Te.lastEffect=null,Te.events=null,Te.stores=null,Te.memoCache!=null&&(Te.memoCache.index=0)}Ug=-1,kn.H=x8,Te=HD(z,q,pe)}while(_C);return Te}function nH(){var R=kn.H,z=R.useState()[0];return z=typeof z.then==="function"?k_(z):z,R=R.useState()[0],(Oc!==null?Oc.memoizedState:null)!==R&&(Wi.flags|=1024),z}function M5(){var R=Z5!==0;return Z5=0,R}function w5(R,z,q){z.updateQueue=R.updateQueue,z.flags=(z.mode&16)!==Jc?z.flags&-402655237:z.flags&-2053,R.lanes&=~q}function xv(R){if(Jp){for(R=R.memoizedState;R!==null;){var z=R.queue;z!==null&&(z.pending=null),R=R.next}Jp=!1}q5=0,_f=Du=Oc=Wi=null,Ug=-1,Un=null,_C=!1,sI=Z5=0,rx=null}function Pu(){var R={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Du===null?Wi.memoizedState=Du=R:Du=Du.next=R,Du}function Mc(){if(Oc===null){var R=Wi.alternate;R=R!==null?R.memoizedState:null}else R=Oc.next;var z=Du===null?Wi.memoizedState:Du.next;if(z!==null)Du=z,Oc=R;else{if(R===null){if(Wi.alternate===null)throw Error("Update hook called on initial render. This is likely a bug in React. Please file an issue.");throw Error("Rendered more hooks than during the previous render.")}Oc=R,R={memoizedState:Oc.memoizedState,baseState:Oc.baseState,baseQueue:Oc.baseQueue,queue:Oc.queue,next:null},Du===null?Wi.memoizedState=Du=R:Du=Du.next=R}return Du}function Cv(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function k_(R){var z=sI;return sI+=1,rx===null&&(rx=ea()),R=sh(rx,R,z),z=Wi,(Du===null?z.memoizedState:Du.next)===null&&(z=z.alternate,kn.H=z!==null&&z.memoizedState!==null?LD:gC),R}function l1(R){if(R!==null&&typeof R==="object"){if(typeof R.then==="function")return k_(R);if(R.$$typeof===x1)return Ro(R)}throw Error("An unsupported type was passed to use(): "+String(R))}function Op(R){var z=null,q=Wi.updateQueue;if(q!==null&&(z=q.memoCache),z==null){var pe=Wi.alternate;pe!==null&&(pe=pe.updateQueue,pe!==null&&(pe=pe.memoCache,pe!=null&&(z={data:pe.data.map(function(Ce){return Ce.slice()}),index:0})))}if(z==null&&(z={data:[],index:0}),q===null&&(q=Cv(),Wi.updateQueue=q),q.memoCache=z,q=z.data[z.index],q===void 0||OE)for(q=z.data[z.index]=Array(R),pe=0;pe<R;pe++)q[pe]=V5;else q.length!==R&&console.error("Expected a constant size argument for each invocation of useMemoCache. The previous cache was allocated with size %s but size %s was requested.",q.length,R);return z.index++,q}function D0(R,z){return typeof z==="function"?z(R):z}function Vp(R,z,q){var pe=Pu();if(q!==void 0){var Ce=q(z);if(J5){ie(!0);try{q(z)}finally{ie(!1)}}}else Ce=z;return pe.memoizedState=pe.baseState=Ce,R={pending:null,lanes:0,dispatch:null,lastRenderedReducer:R,lastRenderedState:Ce},pe.queue=R,R=R.dispatch=z3.bind(null,Wi,R),[pe.memoizedState,R]}function Yp(R){var z=Mc();return bv(z,Oc,R)}function bv(R,z,q){var pe=R.queue;if(pe===null)throw Error("Should have a queue. You are likely calling Hooks conditionally, which is not allowed. (https://react.dev/link/invalid-hook-call)");pe.lastRenderedReducer=q;var Ce=R.baseQueue,Te=pe.pending;if(Te!==null){if(Ce!==null){var ht=Ce.next;Ce.next=Te.next,Te.next=ht}z.baseQueue!==Ce&&console.error("Internal error: Expected work-in-progress queue to be a clone. This is a bug in React."),z.baseQueue=Ce=Te,pe.pending=null}if(Te=R.baseState,Ce===null)R.memoizedState=Te;else{z=Ce.next;var Et=ht=null,Cn=null,Kn=z,Vo=!1;do{var jo=Kn.lane&-536870913;if(jo!==Kn.lane?(va&jo)===jo:(q5&jo)===jo){var yr=Kn.revertLane;if(yr===0)Cn!==null&&(Cn=Cn.next={lane:0,revertLane:0,action:Kn.action,hasEagerState:Kn.hasEagerState,eagerState:Kn.eagerState,next:null}),jo===nI&&(Vo=!0);else if((q5&yr)===yr){Kn=Kn.next,yr===nI&&(Vo=!0);continue}else jo={lane:0,revertLane:Kn.revertLane,action:Kn.action,hasEagerState:Kn.hasEagerState,eagerState:Kn.eagerState,next:null},Cn===null?(Et=Cn=jo,ht=Te):Cn=Cn.next=jo,Wi.lanes|=yr,w8|=yr;jo=Kn.action,J5&&q(Te,jo),Te=Kn.hasEagerState?Kn.eagerState:q(Te,jo)}else yr={lane:jo,revertLane:Kn.revertLane,action:Kn.action,hasEagerState:Kn.hasEagerState,eagerState:Kn.eagerState,next:null},Cn===null?(Et=Cn=yr,ht=Te):Cn=Cn.next=yr,Wi.lanes|=jo,w8|=jo;Kn=Kn.next}while(Kn!==null&&Kn!==z);if(Cn===null?ht=Te:Cn.next=Et,!Kp(Te,R.memoizedState)&&(Al=!0,Vo&&(q=h8,q!==null)))throw q;R.memoizedState=Te,R.baseState=ht,R.baseQueue=Cn,pe.lastRenderedState=Te}return Ce===null&&(pe.lanes=0),[R.memoizedState,pe.dispatch]}function Rm(R){var z=Mc(),q=z.queue;if(q===null)throw Error("Should have a queue. You are likely calling Hooks conditionally, which is not allowed. (https://react.dev/link/invalid-hook-call)");q.lastRenderedReducer=R;var{dispatch:pe,pending:Ce}=q,Te=z.memoizedState;if(Ce!==null){q.pending=null;var ht=Ce=Ce.next;do Te=R(Te,ht.action),ht=ht.next;while(ht!==Ce);Kp(Te,z.memoizedState)||(Al=!0),z.memoizedState=Te,z.baseQueue===null&&(z.baseState=Te),q.lastRenderedState=Te}return[Te,pe]}function JP(R,z,q){var pe=Wi,Ce=Pu();if(Ra){if(q===void 0)throw Error("Missing getServerSnapshot, which is required for server-rendered content. Will revert to client rendering.");var Te=q();iI||Te===q()||(console.error("The result of getServerSnapshot should be cached to avoid an infinite loop"),iI=!0)}else{if(Te=z(),iI||(q=z(),Kp(Te,q)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),iI=!0)),uh===null)throw Error("Expected a work-in-progress root. This is a bug in React. Please file an issue.");(va&124)!==0||$A(pe,z,Te)}return Ce.memoizedState=Te,q={value:Te,getSnapshot:z},Ce.queue=q,sc(m6.bind(null,pe,q,R),[R]),pe.flags|=2048,Mr(Eh|hh,Gs(),ap.bind(null,pe,q,Te,z),null),Te}function r0(R,z,q){var pe=Wi,Ce=Mc(),Te=Ra;if(Te){if(q===void 0)throw Error("Missing getServerSnapshot, which is required for server-rendered content. Will revert to client rendering.");q=q()}else if(q=z(),!iI){var ht=z();Kp(q,ht)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),iI=!0)}if(ht=!Kp((Oc||Ce).memoizedState,q))Ce.memoizedState=q,Al=!0;Ce=Ce.queue;var Et=m6.bind(null,pe,Ce,R);if(Us(2048,hh,Et,[R]),Ce.getSnapshot!==z||ht||Du!==null&&Du.memoizedState.tag&Eh){if(pe.flags|=2048,Mr(Eh|hh,Gs(),ap.bind(null,pe,Ce,q,z),null),uh===null)throw Error("Expected a work-in-progress root. This is a bug in React. Please file an issue.");Te||(q5&124)!==0||$A(pe,z,q)}return q}function $A(R,z,q){R.flags|=16384,R={getSnapshot:z,value:q},z=Wi.updateQueue,z===null?(z=Cv(),Wi.updateQueue=z,z.stores=[R]):(q=z.stores,q===null?z.stores=[R]:q.push(R))}function ap(R,z,q,pe){z.value=q,z.getSnapshot=pe,Ol(z)&&qA(R)}function m6(R,z,q){return q(function(){Ol(z)&&qA(R)})}function Ol(R){var z=R.getSnapshot;R=R.value;try{var q=z();return!Kp(R,q)}catch(pe){return!0}}function qA(R){var z=Su(R,2);z!==null&&xd(z,R,2)}function F3(R){var z=Pu();if(typeof R==="function"){var q=R;if(R=q(),J5){ie(!0);try{q()}finally{ie(!1)}}}return z.memoizedState=z.baseState=R,z.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:D0,lastRenderedState:R},z}function h1(R){R=F3(R);var z=R.queue,q=oE.bind(null,Wi,z);return z.dispatch=q,[R.memoizedState,q]}function d1(R){var z=Pu();z.memoizedState=z.baseState=R;var q={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return z.queue=q,z=Sv.bind(null,Wi,!0,q),q.dispatch=z,[R,z]}function Eu(R,z){var q=Mc();return ZP(q,Oc,R,z)}function ZP(R,z,q,pe){return R.baseState=q,bv(R,Oc,typeof pe==="function"?pe:D0)}function B5(R,z){var q=Mc();if(Oc!==null)return ZP(q,Oc,R,z);return q.baseState=R,[R,q.queue.dispatch]}function eE(R,z,q,pe,Ce){if(O3(R))throw Error("Cannot update form state while rendering.");if(R=z.action,R!==null){var Te={payload:Ce,action:R,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(ht){Te.listeners.push(ht)}};kn.T!==null?q(!0):Te.isTransition=!1,pe(Te),q=z.pending,q===null?(Te.next=z.pending=Te,T5(z,Te)):(Te.next=q.next,z.pending=q.next=Te)}}function T5(R,z){var{action:q,payload:pe}=z,Ce=R.state;if(z.isTransition){var Te=kn.T,ht={};kn.T=ht,kn.T._updatedFibers=new Set;try{var Et=q(Ce,pe),Cn=kn.S;Cn!==null&&Cn(ht,Et),qe(R,z,Et)}catch(Kn){Tt(R,z,Kn)}finally{kn.T=Te,Te===null&&ht._updatedFibers&&(R=ht._updatedFibers.size,ht._updatedFibers.clear(),10<R&&console.warn("Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table."))}}else try{ht=q(Ce,pe),qe(R,z,ht)}catch(Kn){Tt(R,z,Kn)}}function qe(R,z,q){q!==null&&typeof q==="object"&&typeof q.then==="function"?(q.then(function(pe){at(R,z,pe)},function(pe){return Tt(R,z,pe)}),z.isTransition||console.error("An async function with useActionState was called outside of a transition. This is likely not what you intended (for example, isPending will not update correctly). Either call the returned function inside startTransition, or pass it to an `action` or `formAction` prop.")):at(R,z,q)}function at(R,z,q){z.status="fulfilled",z.value=q,Jt(z),R.state=q,z=R.pending,z!==null&&(q=z.next,q===z?R.pending=null:(q=q.next,z.next=q,T5(R,q)))}function Tt(R,z,q){var pe=R.pending;if(R.pending=null,pe!==null){pe=pe.next;do z.status="rejected",z.reason=q,Jt(z),z=z.next;while(z!==pe)}R.action=null}function Jt(R){R=R.listeners;for(var z=0;z<R.length;z++)(0,R[z])()}function yn(R,z){return z}function Pn(R,z){if(Ra){var q=uh.formState;if(q!==null){e:{var pe=Wi;if(Ra){if(Kd){var Ce=v1(Kd,ba);if(Ce){Kd=Y_(Ce),pe=jU(Ce);break e}}gt(pe)}pe=!1}pe&&(z=q[0])}}q=Pu(),q.memoizedState=q.baseState=z,pe={pending:null,lanes:0,dispatch:null,lastRenderedReducer:yn,lastRenderedState:z},q.queue=pe,q=oE.bind(null,Wi,pe),pe.dispatch=q,pe=F3(!1);var Te=Sv.bind(null,Wi,!1,pe.queue);return pe=Pu(),Ce={state:z,dispatch:null,action:R,pending:null},pe.queue=Ce,q=eE.bind(null,Wi,Ce,Te,q),Ce.dispatch=q,pe.memoizedState=R,[z,q,!1]}function Nn(R){var z=Mc();return ao(z,Oc,R)}function ao(R,z,q){if(z=bv(R,z,yn)[0],R=Yp(D0)[0],typeof z==="object"&&z!==null&&typeof z.then==="function")try{var pe=k_(z)}catch(ht){if(ht===_8)throw kE;throw ht}else pe=z;z=Mc();var Ce=z.queue,Te=Ce.dispatch;return q!==z.memoizedState&&(Wi.flags|=2048,Mr(Eh|hh,Gs(),wo.bind(null,Ce,q),null)),[pe,Te,R]}function wo(R,z){R.action=z}function $o(R){var z=Mc(),q=Oc;if(q!==null)return ao(z,q,R);Mc(),z=z.memoizedState,q=Mc();var pe=q.queue.dispatch;return q.memoizedState=R,[z,pe,!1]}function Mr(R,z,q,pe){return R={tag:R,create:q,deps:pe,inst:z,next:null},z=Wi.updateQueue,z===null&&(z=Cv(),Wi.updateQueue=z),q=z.lastEffect,q===null?z.lastEffect=R.next=R:(pe=q.next,q.next=R,R.next=pe,z.lastEffect=R),R}function Gs(){return{destroy:void 0,resource:void 0}}function pa(R){var z=Pu();return R={current:R},z.memoizedState=R}function Qs(R,z,q,pe){var Ce=Pu();pe=pe===void 0?null:pe,Wi.flags|=R,Ce.memoizedState=Mr(Eh|z,Gs(),q,pe)}function Us(R,z,q,pe){var Ce=Mc();pe=pe===void 0?null:pe;var Te=Ce.memoizedState.inst;Oc!==null&&pe!==null&&Qg(pe,Oc.memoizedState.deps)?Ce.memoizedState=Mr(z,Te,q,pe):(Wi.flags|=R,Ce.memoizedState=Mr(Eh|z,Te,q,pe))}function sc(R,z){(Wi.mode&16)!==Jc&&(Wi.mode&64)===Jc?Qs(276826112,hh,R,z):Qs(8390656,hh,R,z)}function cp(R,z){var q=4194308;return(Wi.mode&16)!==Jc&&(q|=134217728),Qs(q,F0,R,z)}function Xt(R,z){if(typeof z==="function"){R=R();var q=z(R);return function(){typeof q==="function"?q():z(null)}}if(z!==null&&z!==void 0)return z.hasOwnProperty("current")||console.error("Expected useImperativeHandle() first argument to either be a ref callback or React.createRef() object. Instead received: %s.","an object with keys {"+Object.keys(z).join(", ")+"}"),R=R(),z.current=R,function(){z.current=null}}function bn(R,z,q){typeof z!=="function"&&console.error("Expected useImperativeHandle() second argument to be a function that creates a handle. Instead received: %s.",z!==null?typeof z:"null"),q=q!==null&&q!==void 0?q.concat([R]):null;var pe=4194308;(Wi.mode&16)!==Jc&&(pe|=134217728),Qs(pe,F0,Xt.bind(null,z,R),q)}function to(R,z,q){typeof z!=="function"&&console.error("Expected useImperativeHandle() second argument to be a function that creates a handle. Instead received: %s.",z!==null?typeof z:"null"),q=q!==null&&q!==void 0?q.concat([R]):null,Us(4,F0,Xt.bind(null,z,R),q)}function yo(R,z){return Pu().memoizedState=[R,z===void 0?null:z],R}function ci(R,z){var q=Mc();z=z===void 0?null:z;var pe=q.memoizedState;if(z!==null&&Qg(z,pe[1]))return pe[0];return q.memoizedState=[R,z],R}function Ws(R,z){var q=Pu();z=z===void 0?null:z;var pe=R();if(J5){ie(!0);try{R()}finally{ie(!1)}}return q.memoizedState=[pe,z],pe}function rs(R,z){var q=Mc();z=z===void 0?null:z;var pe=q.memoizedState;if(z!==null&&Qg(z,pe[1]))return pe[0];if(pe=R(),J5){ie(!0);try{R()}finally{ie(!1)}}return q.memoizedState=[pe,z],pe}function ma(R,z){var q=Pu();return H_(q,R,z)}function ch(R,z){var q=Mc();return ml(q,Oc.memoizedState,R,z)}function L_(R,z){var q=Mc();return Oc===null?H_(q,R,z):ml(q,Oc.memoizedState,R,z)}function H_(R,z,q){if(q===void 0||(q5&1073741824)!==0)return R.memoizedState=z;return R.memoizedState=q,R=w6(),Wi.lanes|=R,w8|=R,q}function ml(R,z,q,pe){if(Kp(q,z))return q;if(A8.current!==null)return R=H_(R,q,pe),Kp(R,z)||(Al=!0),R;if((q5&42)===0)return Al=!0,R.memoizedState=q;return R=w6(),Wi.lanes|=R,w8|=R,z}function tE(R,z,q,pe,Ce){var Te=b1();Xd(Te!==0&&8>Te?Te:8);var ht=kn.T,Et={};kn.T=Et,Sv(R,!1,z,q),Et._updatedFibers=new Set;try{var Cn=Ce(),Kn=kn.S;if(Kn!==null&&Kn(Et,Cn),Cn!==null&&typeof Cn==="object"&&typeof Cn.then==="function"){var Vo=vu(Cn,pe);R5(R,z,Vo,Lm(R))}else R5(R,z,pe,Lm(R))}catch(jo){R5(R,z,{then:function(){},status:"rejected",reason:jo},Lm(R))}finally{Xd(Te),kn.T=ht,ht===null&&Et._updatedFibers&&(R=Et._updatedFibers.size,Et._updatedFibers.clear(),10<R&&console.warn("Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table."))}}function D5(R){var z=R.memoizedState;if(z!==null)return z;z={memoizedState:H6,baseState:H6,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:D0,lastRenderedState:H6},next:null};var q={};return z.next={memoizedState:q,baseState:q,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:D0,lastRenderedState:q},next:null},R.memoizedState=z,R=R.alternate,R!==null&&(R.memoizedState=z),z}function N5(){var R=F3(!1);return R=tE.bind(null,Wi,R.queue,!0,!1),Pu().memoizedState=R,[!1,R]}function oH(){var R=Yp(D0)[0],z=Mc().memoizedState;return[typeof R==="boolean"?R:k_(R),z]}function nE(){var R=Rm(D0)[0],z=Mc().memoizedState;return[typeof R==="boolean"?R:k_(R),z]}function kg(){return Ro(tC)}function JA(){var R=Pu(),z=uh.identifierPrefix;if(Ra){var q=M1,pe=d2;q=(pe&~(1<<32-Fm(pe)-1)).toString(32)+q,z="«"+z+"R"+q,q=Z5++,0<q&&(z+="H"+q.toString(32)),z+="»"}else q=oW++,z="«"+z+"r"+q.toString(32)+"»";return R.memoizedState=z}function Iv(){return Pu().memoizedState=vv.bind(null,Wi)}function vv(R,z){for(var q=R.return;q!==null;){switch(q.tag){case 24:case 3:var pe=Lm(q);R=Gd(pe);var Ce=Dm(q,R,pe);Ce!==null&&(xd(Ce,q,pe),Ph(Ce,q,pe)),q=Xi(),z!==null&&z!==void 0&&Ce!==null&&console.error("The seed argument is not enabled outside experimental channels."),R.payload={cache:q};return}q=q.return}}function z3(R,z,q){var pe=arguments;typeof pe[3]==="function"&&console.error("State updates from the useState() and useReducer() Hooks don't support the second callback argument. To execute a side effect after rendering, declare it in the component body with useEffect()."),pe=Lm(R);var Ce={lane:pe,revertLane:0,action:q,hasEagerState:!1,eagerState:null,next:null};O3(R)?Q5(z,Ce):(Ce=Rg(R,z,Ce,pe),Ce!==null&&(xd(Ce,R,pe),qf(Ce,z,pe))),Ee(R,pe)}function oE(R,z,q){var pe=arguments;typeof pe[3]==="function"&&console.error("State updates from the useState() and useReducer() Hooks don't support the second callback argument. To execute a side effect after rendering, declare it in the component body with useEffect()."),pe=Lm(R),R5(R,z,q,pe),Ee(R,pe)}function R5(R,z,q,pe){var Ce={lane:pe,revertLane:0,action:q,hasEagerState:!1,eagerState:null,next:null};if(O3(R))Q5(z,Ce);else{var Te=R.alternate;if(R.lanes===0&&(Te===null||Te.lanes===0)&&(Te=z.lastRenderedReducer,Te!==null)){var ht=kn.H;kn.H=z0;try{var Et=z.lastRenderedState,Cn=Te(Et,q);if(Ce.hasEagerState=!0,Ce.eagerState=Cn,Kp(Cn,Et))return fd(R,z,Ce,0),uh===null&&ah(),!1}catch(Kn){}finally{kn.H=ht}}if(q=Rg(R,z,Ce,pe),q!==null)return xd(q,R,pe),qf(q,z,pe),!0}return!1}function Sv(R,z,q,pe){if(kn.T===null&&nI===0&&console.error("An optimistic state update occurred outside a transition or action. To fix, move the update to an action, or wrap with startTransition."),pe={lane:2,revertLane:n0(),action:pe,hasEagerState:!1,eagerState:null,next:null},O3(R)){if(z)throw Error("Cannot update optimistic state while rendering.");console.error("Cannot call startTransition while rendering.")}else z=Rg(R,q,pe,2),z!==null&&xd(z,R,2);Ee(R,2)}function O3(R){var z=R.alternate;return R===Wi||z!==null&&z===Wi}function Q5(R,z){_C=Jp=!0;var q=R.pending;q===null?z.next=z:(z.next=q.next,q.next=z),R.pending=z}function qf(R,z,q){if((q&4194048)!==0){var pe=z.lanes;pe&=R.pendingLanes,q|=pe,z.lanes=q,ee(R,q)}}function Mu(R){var z=Io;return R!=null&&(Io=z===null?R:z.concat(R)),z}function Pv(R,z,q){for(var pe=Object.keys(R.props),Ce=0;Ce<pe.length;Ce++){var Te=pe[Ce];if(Te!=="children"&&Te!=="key"){z===null&&(z=IE(R,q.mode,0),z._debugInfo=Io,z.return=q),hn(z,function(ht){console.error("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",ht)},Te);break}}}function Gy(R){var z=Cr;return Cr+=1,kr===null&&(kr=ea()),sh(kr,R,z)}function k5(R,z){z=z.props.ref,R.ref=z!==void 0?z:null}function Uy(R,z){if(z.$$typeof===N6)throw Error(`A React Element from an older version of React was rendered. This is not supported. It can happen if:
- Multiple copies of the "react" package is used.
- A library pre-bundled an old copy of "react" or "react/jsx-runtime".
- A compiler tries to "inline" JSX instead of using the runtime.`);throw R=Object.prototype.toString.call(z),Error("Objects are not valid as a React child (found: "+(R==="[object Object]"?"object with keys {"+Object.keys(z).join(", ")+"}":R)+"). If you meant to render a collection of children, use an array instead.")}function Kc(R,z){var q=P(R)||"Component";dp[q]||(dp[q]=!0,z=z.displayName||z.name||"Component",R.tag===3?console.error(`Functions are not valid as a React child. This may happen if you return %s instead of <%s /> from render. Or maybe you meant to call this function rather than return it.
  root.render(%s)`,z,z,z):console.error(`Functions are not valid as a React child. This may happen if you return %s instead of <%s /> from render. Or maybe you meant to call this function rather than return it.
  <%s>{%s}</%s>`,z,z,q,z,q))}function _6(R,z){var q=P(R)||"Component";AC[q]||(AC[q]=!0,z=String(z),R.tag===3?console.error(`Symbols are not valid as a React child.
  root.render(%s)`,z):console.error(`Symbols are not valid as a React child.
  <%s>%s</%s>`,q,z,q))}function rH(R){function z(on,nn){if(R){var An=on.deletions;An===null?(on.deletions=[nn],on.flags|=16):An.push(nn)}}function q(on,nn){if(!R)return null;for(;nn!==null;)z(on,nn),nn=nn.sibling;return null}function pe(on){for(var nn=new Map;on!==null;)on.key!==null?nn.set(on.key,on):nn.set(on.index,on),on=on.sibling;return nn}function Ce(on,nn){return on=Ky(on,nn),on.index=0,on.sibling=null,on}function Te(on,nn,An){if(on.index=An,!R)return on.flags|=1048576,nn;if(An=on.alternate,An!==null)return An=An.index,An<nn?(on.flags|=67108866,nn):An;return on.flags|=67108866,nn}function ht(on){return R&&on.alternate===null&&(on.flags|=67108866),on}function Et(on,nn,An,io){if(nn===null||nn.tag!==6)return nn=O5(An,on.mode,io),nn.return=on,nn._debugOwner=on,nn._debugTask=on._debugTask,nn._debugInfo=Io,nn;return nn=Ce(nn,An),nn.return=on,nn._debugInfo=Io,nn}function Cn(on,nn,An,io){var wr=An.type;if(wr===Or)return nn=Vo(on,nn,An.props.children,io,An.key),Pv(An,nn,on),nn;if(nn!==null&&(nn.elementType===wr||Fv(nn,An)||typeof wr==="object"&&wr!==null&&wr.$$typeof===af&&ri(wr)===nn.type))return nn=Ce(nn,An.props),k5(nn,An),nn.return=on,nn._debugOwner=An._owner,nn._debugInfo=Io,nn;return nn=IE(An,on.mode,io),k5(nn,An),nn.return=on,nn._debugInfo=Io,nn}function Kn(on,nn,An,io){if(nn===null||nn.tag!==4||nn.stateNode.containerInfo!==An.containerInfo||nn.stateNode.implementation!==An.implementation)return nn=Cd(An,on.mode,io),nn.return=on,nn._debugInfo=Io,nn;return nn=Ce(nn,An.children||[]),nn.return=on,nn._debugInfo=Io,nn}function Vo(on,nn,An,io,wr){if(nn===null||nn.tag!==7)return nn=y1(An,on.mode,io,wr),nn.return=on,nn._debugOwner=on,nn._debugTask=on._debugTask,nn._debugInfo=Io,nn;return nn=Ce(nn,An),nn.return=on,nn._debugInfo=Io,nn}function jo(on,nn,An){if(typeof nn==="string"&&nn!==""||typeof nn==="number"||typeof nn==="bigint")return nn=O5(""+nn,on.mode,An),nn.return=on,nn._debugOwner=on,nn._debugTask=on._debugTask,nn._debugInfo=Io,nn;if(typeof nn==="object"&&nn!==null){switch(nn.$$typeof){case k0:return An=IE(nn,on.mode,An),k5(An,nn),An.return=on,on=Mu(nn._debugInfo),An._debugInfo=Io,Io=on,An;case $y:return nn=Cd(nn,on.mode,An),nn.return=on,nn._debugInfo=Io,nn;case af:var io=Mu(nn._debugInfo);return nn=ri(nn),on=jo(on,nn,An),Io=io,on}if(wc(nn)||I(nn))return An=y1(nn,on.mode,An,null),An.return=on,An._debugOwner=on,An._debugTask=on._debugTask,on=Mu(nn._debugInfo),An._debugInfo=Io,Io=on,An;if(typeof nn.then==="function")return io=Mu(nn._debugInfo),on=jo(on,Gy(nn),An),Io=io,on;if(nn.$$typeof===x1)return jo(on,or(on,nn),An);Uy(on,nn)}return typeof nn==="function"&&Kc(on,nn),typeof nn==="symbol"&&_6(on,nn),null}function yr(on,nn,An,io){var wr=nn!==null?nn.key:null;if(typeof An==="string"&&An!==""||typeof An==="number"||typeof An==="bigint")return wr!==null?null:Et(on,nn,""+An,io);if(typeof An==="object"&&An!==null){switch(An.$$typeof){case k0:return An.key===wr?(wr=Mu(An._debugInfo),on=Cn(on,nn,An,io),Io=wr,on):null;case $y:return An.key===wr?Kn(on,nn,An,io):null;case af:return wr=Mu(An._debugInfo),An=ri(An),on=yr(on,nn,An,io),Io=wr,on}if(wc(An)||I(An)){if(wr!==null)return null;return wr=Mu(An._debugInfo),on=Vo(on,nn,An,io,null),Io=wr,on}if(typeof An.then==="function")return wr=Mu(An._debugInfo),on=yr(on,nn,Gy(An),io),Io=wr,on;if(An.$$typeof===x1)return yr(on,nn,or(on,An),io);Uy(on,An)}return typeof An==="function"&&Kc(on,An),typeof An==="symbol"&&_6(on,An),null}function $i(on,nn,An,io,wr){if(typeof io==="string"&&io!==""||typeof io==="number"||typeof io==="bigint")return on=on.get(An)||null,Et(nn,on,""+io,wr);if(typeof io==="object"&&io!==null){switch(io.$$typeof){case k0:return An=on.get(io.key===null?An:io.key)||null,on=Mu(io._debugInfo),nn=Cn(nn,An,io,wr),Io=on,nn;case $y:return on=on.get(io.key===null?An:io.key)||null,Kn(nn,on,io,wr);case af:var js=Mu(io._debugInfo);return io=ri(io),nn=$i(on,nn,An,io,wr),Io=js,nn}if(wc(io)||I(io))return An=on.get(An)||null,on=Mu(io._debugInfo),nn=Vo(nn,An,io,wr,null),Io=on,nn;if(typeof io.then==="function")return js=Mu(io._debugInfo),nn=$i(on,nn,An,Gy(io),wr),Io=js,nn;if(io.$$typeof===x1)return $i(on,nn,An,or(nn,io),wr);Uy(nn,io)}return typeof io==="function"&&Kc(nn,io),typeof io==="symbol"&&_6(nn,io),null}function Zc(on,nn,An,io){if(typeof An!=="object"||An===null)return io;switch(An.$$typeof){case k0:case $y:u(on,nn,An);var wr=An.key;if(typeof wr!=="string")break;if(io===null){io=new Set,io.add(wr);break}if(!io.has(wr)){io.add(wr);break}hn(nn,function(){console.error("Encountered two children with the same key, `%s`. Keys should be unique so that components maintain their identity across updates. Non-unique keys may cause children to be duplicated and/or omitted — the behavior is unsupported and could change in a future version.",wr)});break;case af:An=ri(An),Zc(on,nn,An,io)}return io}function KD(on,nn,An,io){for(var wr=null,js=null,qi=null,ls=nn,Ji=nn=0,mh=null;ls!==null&&Ji<An.length;Ji++){ls.index>Ji?(mh=ls,ls=null):mh=ls.sibling;var Zd=yr(on,ls,An[Ji],io);if(Zd===null){ls===null&&(ls=mh);break}wr=Zc(on,Zd,An[Ji],wr),R&&ls&&Zd.alternate===null&&z(on,ls),nn=Te(Zd,nn,Ji),qi===null?js=Zd:qi.sibling=Zd,qi=Zd,ls=mh}if(Ji===An.length)return q(on,ls),Ra&&pt(on,Ji),js;if(ls===null){for(;Ji<An.length;Ji++)ls=jo(on,An[Ji],io),ls!==null&&(wr=Zc(on,ls,An[Ji],wr),nn=Te(ls,nn,Ji),qi===null?js=ls:qi.sibling=ls,qi=ls);return Ra&&pt(on,Ji),js}for(ls=pe(ls);Ji<An.length;Ji++)mh=$i(ls,on,Ji,An[Ji],io),mh!==null&&(wr=Zc(on,mh,An[Ji],wr),R&&mh.alternate!==null&&ls.delete(mh.key===null?Ji:mh.key),nn=Te(mh,nn,Ji),qi===null?js=mh:qi.sibling=mh,qi=mh);return R&&ls.forEach(function($g){return z(on,$g)}),Ra&&pt(on,Ji),js}function $D(on,nn,An,io){if(An==null)throw Error("An iterable object provided no iterator.");for(var wr=null,js=null,qi=nn,ls=nn=0,Ji=null,mh=null,Zd=An.next();qi!==null&&!Zd.done;ls++,Zd=An.next()){qi.index>ls?(Ji=qi,qi=null):Ji=qi.sibling;var $g=yr(on,qi,Zd.value,io);if($g===null){qi===null&&(qi=Ji);break}mh=Zc(on,$g,Zd.value,mh),R&&qi&&$g.alternate===null&&z(on,qi),nn=Te($g,nn,ls),js===null?wr=$g:js.sibling=$g,js=$g,qi=Ji}if(Zd.done)return q(on,qi),Ra&&pt(on,ls),wr;if(qi===null){for(;!Zd.done;ls++,Zd=An.next())qi=jo(on,Zd.value,io),qi!==null&&(mh=Zc(on,qi,Zd.value,mh),nn=Te(qi,nn,ls),js===null?wr=qi:js.sibling=qi,js=qi);return Ra&&pt(on,ls),wr}for(qi=pe(qi);!Zd.done;ls++,Zd=An.next())Ji=$i(qi,on,ls,Zd.value,io),Ji!==null&&(mh=Zc(on,Ji,Zd.value,mh),R&&Ji.alternate!==null&&qi.delete(Ji.key===null?ls:Ji.key),nn=Te(Ji,nn,ls),js===null?wr=Ji:js.sibling=Ji,js=Ji);return R&&qi.forEach(function(_W){return z(on,_W)}),Ra&&pt(on,ls),wr}function s4(on,nn,An,io){if(typeof An==="object"&&An!==null&&An.type===Or&&An.key===null&&(Pv(An,null,on),An=An.props.children),typeof An==="object"&&An!==null){switch(An.$$typeof){case k0:var wr=Mu(An._debugInfo);e:{for(var js=An.key;nn!==null;){if(nn.key===js){if(js=An.type,js===Or){if(nn.tag===7){q(on,nn.sibling),io=Ce(nn,An.props.children),io.return=on,io._debugOwner=An._owner,io._debugInfo=Io,Pv(An,io,on),on=io;break e}}else if(nn.elementType===js||Fv(nn,An)||typeof js==="object"&&js!==null&&js.$$typeof===af&&ri(js)===nn.type){q(on,nn.sibling),io=Ce(nn,An.props),k5(io,An),io.return=on,io._debugOwner=An._owner,io._debugInfo=Io,on=io;break e}q(on,nn);break}else z(on,nn);nn=nn.sibling}An.type===Or?(io=y1(An.props.children,on.mode,io,An.key),io.return=on,io._debugOwner=on,io._debugTask=on._debugTask,io._debugInfo=Io,Pv(An,io,on),on=io):(io=IE(An,on.mode,io),k5(io,An),io.return=on,io._debugInfo=Io,on=io)}return on=ht(on),Io=wr,on;case $y:e:{wr=An;for(An=wr.key;nn!==null;){if(nn.key===An)if(nn.tag===4&&nn.stateNode.containerInfo===wr.containerInfo&&nn.stateNode.implementation===wr.implementation){q(on,nn.sibling),io=Ce(nn,wr.children||[]),io.return=on,on=io;break e}else{q(on,nn);break}else z(on,nn);nn=nn.sibling}io=Cd(wr,on.mode,io),io.return=on,on=io}return ht(on);case af:return wr=Mu(An._debugInfo),An=ri(An),on=s4(on,nn,An,io),Io=wr,on}if(wc(An))return wr=Mu(An._debugInfo),on=KD(on,nn,An,io),Io=wr,on;if(I(An)){if(wr=Mu(An._debugInfo),js=I(An),typeof js!=="function")throw Error("An object is not an iterable. This error is likely caused by a bug in React. Please file an issue.");var qi=js.call(An);if(qi===An){if(on.tag!==0||Object.prototype.toString.call(on.type)!=="[object GeneratorFunction]"||Object.prototype.toString.call(qi)!=="[object Generator]")Ss||console.error("Using Iterators as children is unsupported and will likely yield unexpected results because enumerating a generator mutates it. You may convert it to an array with `Array.from()` or the `[...spread]` operator before rendering. You can also use an Iterable that can iterate multiple times over the same items."),Ss=!0}else An.entries!==js||No||(console.error("Using Maps as children is not supported. Use an array of keyed ReactElements instead."),No=!0);return on=$D(on,nn,qi,io),Io=wr,on}if(typeof An.then==="function")return wr=Mu(An._debugInfo),on=s4(on,nn,Gy(An),io),Io=wr,on;if(An.$$typeof===x1)return s4(on,nn,or(on,An),io);Uy(on,An)}if(typeof An==="string"&&An!==""||typeof An==="number"||typeof An==="bigint")return wr=""+An,nn!==null&&nn.tag===6?(q(on,nn.sibling),io=Ce(nn,wr),io.return=on,on=io):(q(on,nn),io=O5(wr,on.mode,io),io.return=on,io._debugOwner=on,io._debugTask=on._debugTask,io._debugInfo=Io,on=io),ht(on);return typeof An==="function"&&Kc(on,An),typeof An==="symbol"&&_6(on,An),q(on,nn)}return function(on,nn,An,io){var wr=Io;Io=null;try{Cr=0;var js=s4(on,nn,An,io);return kr=null,js}catch(mh){if(mh===_8||mh===kE)throw mh;var qi=c(29,mh,null,on.mode);qi.lanes=io,qi.return=on;var ls=qi._debugInfo=Io;if(qi._debugOwner=on._debugOwner,qi._debugTask=on._debugTask,ls!=null){for(var Ji=ls.length-1;0<=Ji;Ji--)if(typeof ls[Ji].stack==="string"){qi._debugOwner=ls[Ji],qi._debugTask=ls[Ji].debugTask;break}}return qi}finally{Io=wr}}}function Wy(R){var z=R.alternate;T(dh,dh.current&fC,R),T(Zp,R,R),T1===null&&(z===null||A8.current!==null?T1=R:z.memoizedState!==null&&(T1=R))}function L5(R){if(R.tag===22){if(T(dh,dh.current,R),T(Zp,R,R),T1===null){var z=R.alternate;z!==null&&z.memoizedState!==null&&(T1=R)}}else Jf(R)}function Jf(R){T(dh,dh.current,R),T(Zp,Zp.current,R)}function u1(R){B(Zp,R),T1===R&&(T1=null),B(dh,R)}function Ev(R){for(var z=R;z!==null;){if(z.tag===13){var q=z.memoizedState;if(q!==null&&(q=q.dehydrated,q===null||I1(q)||O6(q)))return z}else if(z.tag===19&&z.memoizedProps.revealOrder!==void 0){if((z.flags&128)!==0)return z}else if(z.child!==null){z.child.return=z,z=z.child;continue}if(z===R)break;for(;z.sibling===null;){if(z.return===null||z.return===R)return null;z=z.return}z.sibling.return=z.return,z=z.sibling}return null}function ZA(R){if(R!==null&&typeof R!=="function"){var z=String(R);em.has(z)||(em.add(z),console.error("Expected the last optional `callback` argument to be a function. Instead received: %s.",R))}}function iH(R,z,q,pe){var Ce=R.memoizedState,Te=q(pe,Ce);if(R.mode&8){ie(!0);try{Te=q(pe,Ce)}finally{ie(!1)}}Te===void 0&&(z=v(z)||"Component",iW.has(z)||(iW.add(z),console.error("%s.getDerivedStateFromProps(): A valid state object (or null) must be returned. You have returned undefined.",z))),Ce=Te===null||Te===void 0?Ce:Q0({},Ce,Te),R.memoizedState=Ce,R.lanes===0&&(R.updateQueue.baseState=Ce)}function Zf(R,z,q,pe,Ce,Te,ht){var Et=R.stateNode;if(typeof Et.shouldComponentUpdate==="function"){if(q=Et.shouldComponentUpdate(pe,Te,ht),R.mode&8){ie(!0);try{q=Et.shouldComponentUpdate(pe,Te,ht)}finally{ie(!1)}}return q===void 0&&console.error("%s.shouldComponentUpdate(): Returned undefined instead of a boolean value. Make sure to return true or false.",v(z)||"Component"),q}return z.prototype&&z.prototype.isPureReactComponent?!Cc(q,pe)||!Cc(Ce,Te):!0}function rE(R,z,q,pe){var Ce=z.state;typeof z.componentWillReceiveProps==="function"&&z.componentWillReceiveProps(q,pe),typeof z.UNSAFE_componentWillReceiveProps==="function"&&z.UNSAFE_componentWillReceiveProps(q,pe),z.state!==Ce&&(R=P(R)||"Component",lI.has(R)||(lI.add(R),console.error("%s.componentWillReceiveProps(): Assigning directly to this.state is deprecated (except inside a component's constructor). Use setState instead.",R)),tm.enqueueReplaceState(z,z.state,null))}function ef(R,z){var q=z;if("ref"in z){q={};for(var pe in z)pe!=="ref"&&(q[pe]=z[pe])}if(R=R.defaultProps){q===z&&(q=Q0({},q));for(var Ce in R)q[Ce]===void 0&&(q[Ce]=R[Ce])}return q}function g6(R,z){try{vd=z.source?P(z.source):null,p2=null;var q=z.value;if(kn.actQueue!==null)kn.thrownErrors.push(q);else{var pe=R.onUncaughtError;pe(q,{componentStack:z.stack})}}catch(Ce){setTimeout(function(){throw Ce})}}function N0(R,z,q){try{vd=q.source?P(q.source):null,p2=P(z);var pe=R.onCaughtError;pe(q.value,{componentStack:q.stack,errorBoundary:z.tag===1?z.stateNode:null})}catch(Ce){setTimeout(function(){throw Ce})}}function Qm(R,z,q){return q=Gd(q),q.tag=KH,q.payload={element:null},q.callback=function(){hn(z.source,g6,R,z)},q}function e2(R){return R=Gd(R),R.tag=KH,R}function tf(R,z,q,pe){var Ce=q.type.getDerivedStateFromError;if(typeof Ce==="function"){var Te=pe.value;R.payload=function(){return Ce(Te)},R.callback=function(){yH(q),hn(pe.source,N0,z,q,pe)}}var ht=q.stateNode;ht!==null&&typeof ht.componentDidCatch==="function"&&(R.callback=function(){yH(q),hn(pe.source,N0,z,q,pe),typeof Ce!=="function"&&(Ym===null?Ym=new Set([this]):Ym.add(this)),Rt(this,pe),typeof Ce==="function"||(q.lanes&2)===0&&console.error("%s: Error boundaries should implement getDerivedStateFromError(). In that method, return a state update to display an error message or fallback UI.",P(q)||"Unknown")})}function p1(R,z,q,pe,Ce){if(q.flags|=32768,l2&&Hv(R,Ce),pe!==null&&typeof pe==="object"&&typeof pe.then==="function"){if(z=q.alternate,z!==null&&lo(z,q,Ce,!0),Ra&&(w1=!0),q=Zp.current,q!==null){switch(q.tag){case 13:return T1===null?Rv():q.alternate===null&&Jd===Xg&&(Jd=lW),q.flags&=-257,q.flags|=65536,q.lanes=Ce,pe===RD?q.flags|=16384:(z=q.updateQueue,z===null?q.updateQueue=new Set([pe]):z.add(pe),iD(R,pe,Ce)),!1;case 22:return q.flags|=65536,pe===RD?q.flags|=16384:(z=q.updateQueue,z===null?(z={transitions:null,markerInstances:null,retryQueue:new Set([pe])},q.updateQueue=z):(q=z.retryQueue,q===null?z.retryQueue=new Set([pe]):q.add(pe)),iD(R,pe,Ce)),!1}throw Error("Unexpected Suspense handler tag ("+q.tag+"). This is a bug in React.")}return iD(R,pe,Ce),Rv(),!1}if(Ra)return w1=!0,z=Zp.current,z!==null?((z.flags&65536)===0&&(z.flags|=256),z.flags|=65536,z.lanes=Ce,pe!==RE&&wn(rt(Error("There was an error while hydrating but React was able to recover by instead client rendering from the nearest Suspense boundary.",{cause:pe}),q))):(pe!==RE&&wn(rt(Error("There was an error while hydrating but React was able to recover by instead client rendering the entire root.",{cause:pe}),q)),R=R.current.alternate,R.flags|=65536,Ce&=-Ce,R.lanes|=Ce,pe=rt(pe,q),Ce=Qm(R.stateNode,pe,Ce),Yy(R,Ce),Jd!==S8&&(Jd=bC)),!1;var Te=rt(Error("There was an error during concurrent rendering but React was able to recover by instead synchronously rendering the entire root.",{cause:pe}),q);if(g2===null?g2=[Te]:g2.push(Te),Jd!==S8&&(Jd=bC),z===null)return!0;pe=rt(pe,q),q=z;do{switch(q.tag){case 3:return q.flags|=65536,R=Ce&-Ce,q.lanes|=R,R=Qm(q.stateNode,pe,R),Yy(q,R),!1;case 1:if(z=q.type,Te=q.stateNode,(q.flags&128)===0&&(typeof z.getDerivedStateFromError==="function"||Te!==null&&typeof Te.componentDidCatch==="function"&&(Ym===null||!Ym.has(Te))))return q.flags|=65536,Ce&=-Ce,q.lanes|=Ce,Ce=e2(Ce),tf(Ce,R,q,pe),Yy(q,Ce),!1}q=q.return}while(q!==null);return!1}function Vl(R,z,q,pe){z.child=R===null?B1(z,null,q,pe):X_(z,R.child,q,pe)}function iE(R,z,q,pe,Ce){q=q.render;var Te=z.ref;if("ref"in pe){var ht={};for(var Et in pe)Et!=="ref"&&(ht[Et]=pe[Et])}else ht=pe;if(oo(z),de(z),pe=L3(R,z,q,ht,Te,Ce),Et=M5(),me(),R!==null&&!Al)return w5(R,z,Ce),_1(R,z,Ce);return Ra&&Et&&Ct(z),z.flags|=1,Vl(R,z,pe,Ce),z.child}function ST(R,z,q,pe,Ce){if(R===null){var Te=q.type;if(typeof Te==="function"&&!zv(Te)&&Te.defaultProps===void 0&&q.compare===null)return q=eC(Te),z.tag=15,z.type=q,sE(z,Te),sH(R,z,q,pe,Ce);return R=dD(q.type,null,pe,z,z.mode,Ce),R.ref=z.ref,R.return=z,z.child=R}if(Te=R.child,!wv(R,Ce)){var ht=Te.memoizedProps;if(q=q.compare,q=q!==null?q:Cc,q(ht,pe)&&R.ref===z.ref)return _1(R,z,Ce)}return z.flags|=1,R=Ky(Te,pe),R.ref=z.ref,R.return=z,z.child=R}function sH(R,z,q,pe,Ce){if(R!==null){var Te=R.memoizedProps;if(Cc(Te,pe)&&R.ref===z.ref&&z.type===R.type)if(Al=!1,z.pendingProps=pe=Te,wv(R,Ce))(R.flags&131072)!==0&&(Al=!0);else return z.lanes=R.lanes,_1(R,z,Ce)}return of(R,z,q,pe,Ce)}function m1(R,z,q){var pe=z.pendingProps,Ce=pe.children,Te=R!==null?R.memoizedState:null;if(pe.mode==="hidden"){if((z.flags&128)!==0){if(pe=Te!==null?Te.baseLanes|q:q,R!==null){Ce=z.child=R.child;for(Te=0;Ce!==null;)Te=Te|Ce.lanes|Ce.childLanes,Ce=Ce.sibling;z.childLanes=Te&~pe}else z.childLanes=0,z.child=null;return aH(R,z,pe,q)}if((q&536870912)!==0)z.memoizedState={baseLanes:0,cachePool:null},R!==null&&pl(z,Te!==null?Te.cachePool:null),Te!==null?p6(z,Te):c1(z),L5(z);else return z.lanes=z.childLanes=536870912,aH(R,z,Te!==null?Te.baseLanes|q:q,q)}else Te!==null?(pl(z,Te.cachePool),p6(z,Te),Jf(z),z.memoizedState=null):(R!==null&&pl(z,null),c1(z),Jf(z));return Vl(R,z,Ce,q),z.child}function aH(R,z,q,pe){var Ce=ji();return Ce=Ce===null?null:{parent:Pl?lh._currentValue:lh._currentValue2,pool:Ce},z.memoizedState={baseLanes:q,cachePool:Ce},R!==null&&pl(z,null),c1(z),L5(z),R!==null&&lo(R,z,pe,!0),null}function nf(R,z){var q=z.ref;if(q===null)R!==null&&R.ref!==null&&(z.flags|=4194816);else{if(typeof q!=="function"&&typeof q!=="object")throw Error("Expected ref to be a function, an object returned by React.createRef(), or undefined/null.");if(R===null||R.ref!==q)z.flags|=4194816}}function of(R,z,q,pe,Ce){if(q.prototype&&typeof q.prototype.render==="function"){var Te=v(q)||"Unknown";e4[Te]||(console.error("The <%s /> component appears to have a render method, but doesn't extend React.Component. This is likely to cause errors. Change %s to extend React.Component instead.",Te,Te),e4[Te]=!0)}if(z.mode&8&&u2.recordLegacyContextWarning(z,null),R===null&&(sE(z,z.type),q.contextTypes&&(Te=v(q)||"Unknown",YE[Te]||(YE[Te]=!0,console.error("%s uses the legacy contextTypes API which was removed in React 19. Use React.createContext() with React.useContext() instead. (https://react.dev/link/legacy-context)",Te)))),oo(z),de(z),q=L3(R,z,q,pe,void 0,Ce),pe=M5(),me(),R!==null&&!Al)return w5(R,z,Ce),_1(R,z,Ce);return Ra&&pe&&Ct(z),z.flags|=1,Vl(R,z,q,Ce),z.child}function A6(R,z,q,pe,Ce,Te){if(oo(z),de(z),Ug=-1,OE=R!==null&&R.type!==z.type,z.updateQueue=null,q=H3(z,pe,q,Ce),vT(R,z),pe=M5(),me(),R!==null&&!Al)return w5(R,z,Te),_1(R,z,Te);return Ra&&pe&&Ct(z),z.flags|=1,Vl(R,z,q,Te),z.child}function cH(R,z,q,pe,Ce){switch(a(z)){case!1:var Te=z.stateNode,ht=new z.type(z.memoizedProps,Te.context).state;Te.updater.enqueueSetState(Te,ht,null);break;case!0:z.flags|=128,z.flags|=65536,Te=Error("Simulated error coming from DevTools");var Et=Ce&-Ce;if(z.lanes|=Et,ht=uh,ht===null)throw Error("Expected a work-in-progress root. This is a bug in React. Please file an issue.");Et=e2(Et),tf(Et,ht,z,rt(Te,z)),Yy(z,Et)}if(oo(z),z.stateNode===null){if(ht=ex,Te=q.contextType,"contextType"in q&&Te!==null&&(Te===void 0||Te.$$typeof!==x1)&&!OD.has(q)&&(OD.add(q),Et=Te===void 0?" However, it is set to undefined. This can be caused by a typo or by mixing up named and default imports. This can also happen due to a circular dependency, so try moving the createContext() call to a separate file.":typeof Te!=="object"?" However, it is set to a "+typeof Te+".":Te.$$typeof===Vv?" Did you accidentally pass the Context.Consumer instead?":" However, it is set to an object with keys {"+Object.keys(Te).join(", ")+"}.",console.error("%s defines an invalid contextType. contextType should point to the Context object returned by React.createContext().%s",v(q)||"Component",Et)),typeof Te==="object"&&Te!==null&&(ht=Ro(Te)),Te=new q(pe,ht),z.mode&8){ie(!0);try{Te=new q(pe,ht)}finally{ie(!1)}}if(ht=z.memoizedState=Te.state!==null&&Te.state!==void 0?Te.state:null,Te.updater=tm,z.stateNode=Te,Te._reactInternals=z,Te._reactInternalInstance=xC,typeof q.getDerivedStateFromProps==="function"&&ht===null&&(ht=v(q)||"Component",VE.has(ht)||(VE.add(ht),console.error("`%s` uses `getDerivedStateFromProps` but its initial state is %s. This is not recommended. Instead, define the initial state by assigning an object to `this.state` in the constructor of `%s`. This ensures that `getDerivedStateFromProps` arguments have a consistent shape.",ht,Te.state===null?"null":"undefined",ht))),typeof q.getDerivedStateFromProps==="function"||typeof Te.getSnapshotBeforeUpdate==="function"){var Cn=Et=ht=null;if(typeof Te.componentWillMount==="function"&&Te.componentWillMount.__suppressDeprecationWarning!==!0?ht="componentWillMount":typeof Te.UNSAFE_componentWillMount==="function"&&(ht="UNSAFE_componentWillMount"),typeof Te.componentWillReceiveProps==="function"&&Te.componentWillReceiveProps.__suppressDeprecationWarning!==!0?Et="componentWillReceiveProps":typeof Te.UNSAFE_componentWillReceiveProps==="function"&&(Et="UNSAFE_componentWillReceiveProps"),typeof Te.componentWillUpdate==="function"&&Te.componentWillUpdate.__suppressDeprecationWarning!==!0?Cn="componentWillUpdate":typeof Te.UNSAFE_componentWillUpdate==="function"&&(Cn="UNSAFE_componentWillUpdate"),ht!==null||Et!==null||Cn!==null){Te=v(q)||"Component";var Kn=typeof q.getDerivedStateFromProps==="function"?"getDerivedStateFromProps()":"getSnapshotBeforeUpdate()";FD.has(Te)||(FD.add(Te),console.error(`Unsafe legacy lifecycles will not be called for components using new component APIs.

%s uses %s but also contains the following legacy lifecycles:%s%s%s

The above lifecycles should be removed. Learn more about this warning here:
https://react.dev/link/unsafe-component-lifecycles`,Te,Kn,ht!==null?`
  `+ht:"",Et!==null?`
  `+Et:"",Cn!==null?`
  `+Cn:""))}}Te=z.stateNode,ht=v(q)||"Component",Te.render||(q.prototype&&typeof q.prototype.render==="function"?console.error("No `render` method found on the %s instance: did you accidentally return an object from the constructor?",ht):console.error("No `render` method found on the %s instance: you may have forgotten to define `render`.",ht)),!Te.getInitialState||Te.getInitialState.isReactClassApproved||Te.state||console.error("getInitialState was defined on %s, a plain JavaScript class. This is only supported for classes created using React.createClass. Did you mean to define a state property instead?",ht),Te.getDefaultProps&&!Te.getDefaultProps.isReactClassApproved&&console.error("getDefaultProps was defined on %s, a plain JavaScript class. This is only supported for classes created using React.createClass. Use a static property to define defaultProps instead.",ht),Te.contextType&&console.error("contextType was defined as an instance property on %s. Use a static property to define contextType instead.",ht),q.childContextTypes&&!j_.has(q)&&(j_.add(q),console.error("%s uses the legacy childContextTypes API which was removed in React 19. Use React.createContext() instead. (https://react.dev/link/legacy-context)",ht)),q.contextTypes&&!zD.has(q)&&(zD.add(q),console.error("%s uses the legacy contextTypes API which was removed in React 19. Use React.createContext() with static contextType instead. (https://react.dev/link/legacy-context)",ht)),typeof Te.componentShouldUpdate==="function"&&console.error("%s has a method called componentShouldUpdate(). Did you mean shouldComponentUpdate()? The name is phrased as a question because the function is expected to return a value.",ht),q.prototype&&q.prototype.isPureReactComponent&&typeof Te.shouldComponentUpdate<"u"&&console.error("%s has a method called shouldComponentUpdate(). shouldComponentUpdate should not be used when extending React.PureComponent. Please extend React.Component if shouldComponentUpdate is used.",v(q)||"A pure component"),typeof Te.componentDidUnmount==="function"&&console.error("%s has a method called componentDidUnmount(). But there is no such lifecycle method. Did you mean componentWillUnmount()?",ht),typeof Te.componentDidReceiveProps==="function"&&console.error("%s has a method called componentDidReceiveProps(). But there is no such lifecycle method. If you meant to update the state in response to changing props, use componentWillReceiveProps(). If you meant to fetch data or run side-effects or mutations after React has updated the UI, use componentDidUpdate().",ht),typeof Te.componentWillRecieveProps==="function"&&console.error("%s has a method called componentWillRecieveProps(). Did you mean componentWillReceiveProps()?",ht),typeof Te.UNSAFE_componentWillRecieveProps==="function"&&console.error("%s has a method called UNSAFE_componentWillRecieveProps(). Did you mean UNSAFE_componentWillReceiveProps()?",ht),Et=Te.props!==pe,Te.props!==void 0&&Et&&console.error("When calling super() in `%s`, make sure to pass up the same props that your component's constructor was passed.",ht),Te.defaultProps&&console.error("Setting defaultProps as an instance property on %s is not supported and will be ignored. Instead, define defaultProps as a static property on %s.",ht,ht),typeof Te.getSnapshotBeforeUpdate!=="function"||typeof Te.componentDidUpdate==="function"||hI.has(q)||(hI.add(q),console.error("%s: getSnapshotBeforeUpdate() should be used with componentDidUpdate(). This component defines getSnapshotBeforeUpdate() only.",v(q))),typeof Te.getDerivedStateFromProps==="function"&&console.error("%s: getDerivedStateFromProps() is defined as an instance method and will be ignored. Instead, declare it as a static method.",ht),typeof Te.getDerivedStateFromError==="function"&&console.error("%s: getDerivedStateFromError() is defined as an instance method and will be ignored. Instead, declare it as a static method.",ht),typeof q.getSnapshotBeforeUpdate==="function"&&console.error("%s: getSnapshotBeforeUpdate() is defined as a static method and will be ignored. Instead, declare it as an instance method.",ht),(Et=Te.state)&&(typeof Et!=="object"||wc(Et))&&console.error("%s.state: must be set to an object or null",ht),typeof Te.getChildContext==="function"&&typeof q.childContextTypes!=="object"&&console.error("%s.getChildContext(): childContextTypes must be defined in order to use getChildContext().",ht),Te=z.stateNode,Te.props=pe,Te.state=z.memoizedState,Te.refs={},T0(z),ht=q.contextType,Te.context=typeof ht==="object"&&ht!==null?Ro(ht):ex,Te.state===pe&&(ht=v(q)||"Component",dI.has(ht)||(dI.add(ht),console.error("%s: It is not recommended to assign props directly to state because updates to props won't be reflected in state. In most cases, it is better to use props directly.",ht))),z.mode&8&&u2.recordLegacyContextWarning(z,Te),u2.recordUnsafeLifecycleWarnings(z,Te),Te.state=z.memoizedState,ht=q.getDerivedStateFromProps,typeof ht==="function"&&(iH(z,q,ht,pe),Te.state=z.memoizedState),typeof q.getDerivedStateFromProps==="function"||typeof Te.getSnapshotBeforeUpdate==="function"||typeof Te.UNSAFE_componentWillMount!=="function"&&typeof Te.componentWillMount!=="function"||(ht=Te.state,typeof Te.componentWillMount==="function"&&Te.componentWillMount(),typeof Te.UNSAFE_componentWillMount==="function"&&Te.UNSAFE_componentWillMount(),ht!==Te.state&&(console.error("%s.componentWillMount(): Assigning directly to this.state is deprecated (except inside a component's constructor). Use setState instead.",P(z)||"Component"),tm.enqueueReplaceState(Te,Te.state,null)),$f(z,pe,Te,Ce),Nm(),Te.state=z.memoizedState),typeof Te.componentDidMount==="function"&&(z.flags|=4194308),(z.mode&16)!==Jc&&(z.flags|=134217728),Te=!0}else if(R===null){Te=z.stateNode;var Vo=z.memoizedProps;Et=ef(q,Vo),Te.props=Et;var jo=Te.context;Cn=q.contextType,ht=ex,typeof Cn==="object"&&Cn!==null&&(ht=Ro(Cn)),Kn=q.getDerivedStateFromProps,Cn=typeof Kn==="function"||typeof Te.getSnapshotBeforeUpdate==="function",Vo=z.pendingProps!==Vo,Cn||typeof Te.UNSAFE_componentWillReceiveProps!=="function"&&typeof Te.componentWillReceiveProps!=="function"||(Vo||jo!==ht)&&rE(z,Te,pe,ht),$5=!1;var yr=z.memoizedState;Te.state=yr,$f(z,pe,Te,Ce),Nm(),jo=z.memoizedState,Vo||yr!==jo||$5?(typeof Kn==="function"&&(iH(z,q,Kn,pe),jo=z.memoizedState),(Et=$5||Zf(z,q,Et,pe,yr,jo,ht))?(Cn||typeof Te.UNSAFE_componentWillMount!=="function"&&typeof Te.componentWillMount!=="function"||(typeof Te.componentWillMount==="function"&&Te.componentWillMount(),typeof Te.UNSAFE_componentWillMount==="function"&&Te.UNSAFE_componentWillMount()),typeof Te.componentDidMount==="function"&&(z.flags|=4194308),(z.mode&16)!==Jc&&(z.flags|=134217728)):(typeof Te.componentDidMount==="function"&&(z.flags|=4194308),(z.mode&16)!==Jc&&(z.flags|=134217728),z.memoizedProps=pe,z.memoizedState=jo),Te.props=pe,Te.state=jo,Te.context=ht,Te=Et):(typeof Te.componentDidMount==="function"&&(z.flags|=4194308),(z.mode&16)!==Jc&&(z.flags|=134217728),Te=!1)}else{Te=z.stateNode,Q_(R,z),ht=z.memoizedProps,Cn=ef(q,ht),Te.props=Cn,Kn=z.pendingProps,yr=Te.context,jo=q.contextType,Et=ex,typeof jo==="object"&&jo!==null&&(Et=Ro(jo)),Vo=q.getDerivedStateFromProps,(jo=typeof Vo==="function"||typeof Te.getSnapshotBeforeUpdate==="function")||typeof Te.UNSAFE_componentWillReceiveProps!=="function"&&typeof Te.componentWillReceiveProps!=="function"||(ht!==Kn||yr!==Et)&&rE(z,Te,pe,Et),$5=!1,yr=z.memoizedState,Te.state=yr,$f(z,pe,Te,Ce),Nm();var $i=z.memoizedState;ht!==Kn||yr!==$i||$5||R!==null&&R.dependencies!==null&&fo(R.dependencies)?(typeof Vo==="function"&&(iH(z,q,Vo,pe),$i=z.memoizedState),(Cn=$5||Zf(z,q,Cn,pe,yr,$i,Et)||R!==null&&R.dependencies!==null&&fo(R.dependencies))?(jo||typeof Te.UNSAFE_componentWillUpdate!=="function"&&typeof Te.componentWillUpdate!=="function"||(typeof Te.componentWillUpdate==="function"&&Te.componentWillUpdate(pe,$i,Et),typeof Te.UNSAFE_componentWillUpdate==="function"&&Te.UNSAFE_componentWillUpdate(pe,$i,Et)),typeof Te.componentDidUpdate==="function"&&(z.flags|=4),typeof Te.getSnapshotBeforeUpdate==="function"&&(z.flags|=1024)):(typeof Te.componentDidUpdate!=="function"||ht===R.memoizedProps&&yr===R.memoizedState||(z.flags|=4),typeof Te.getSnapshotBeforeUpdate!=="function"||ht===R.memoizedProps&&yr===R.memoizedState||(z.flags|=1024),z.memoizedProps=pe,z.memoizedState=$i),Te.props=pe,Te.state=$i,Te.context=Et,Te=Cn):(typeof Te.componentDidUpdate!=="function"||ht===R.memoizedProps&&yr===R.memoizedState||(z.flags|=4),typeof Te.getSnapshotBeforeUpdate!=="function"||ht===R.memoizedProps&&yr===R.memoizedState||(z.flags|=1024),Te=!1)}if(Et=Te,nf(R,z),ht=(z.flags&128)!==0,Et||ht){if(Et=z.stateNode,Zn(z),ht&&typeof q.getDerivedStateFromError!=="function")q=null,Om=-1;else{if(de(z),q=le(Et),z.mode&8){ie(!0);try{le(Et)}finally{ie(!1)}}me()}z.flags|=1,R!==null&&ht?(z.child=X_(z,R.child,null,Ce),z.child=X_(z,null,q,Ce)):Vl(R,z,q,Ce),z.memoizedState=Et.state,R=z.child}else R=_1(R,z,Ce);return Ce=z.stateNode,Te&&Ce.props!==pe&&(VD||console.error("It looks like %s is reassigning its own `this.props` while rendering. This is not supported and can lead to confusing bugs.",P(z)||"a component"),VD=!0),R}function vU(R,z,q,pe){return cn(),z.flags|=256,Vl(R,z,q,pe),z.child}function sE(R,z){z&&z.childContextTypes&&console.error(`childContextTypes cannot be defined on a function component.
  %s.childContextTypes = ...`,z.displayName||z.name||"Component"),typeof z.getDerivedStateFromProps==="function"&&(R=v(z)||"Unknown",ta[R]||(console.error("%s: Function components do not support getDerivedStateFromProps.",R),ta[R]=!0)),typeof z.contextType==="object"&&z.contextType!==null&&(z=v(z)||"Unknown",t4[z]||(console.error("%s: Function components do not support contextType.",z),t4[z]=!0))}function Mv(R){return{baseLanes:R,cachePool:Zs()}}function f6(R,z,q){return R=R!==null?R.childLanes&~q:0,z&&(R|=ph),R}function aE(R,z,q){var pe=z.pendingProps;s(z)&&(z.flags|=128);var Ce=!1,Te=(z.flags&128)!==0,ht;if((ht=Te)||(ht=R!==null&&R.memoizedState===null?!1:(dh.current&yC)!==0),ht&&(Ce=!0,z.flags&=-129),ht=(z.flags&32)!==0,z.flags&=-33,R===null){if(Ra){if(Ce?Wy(z):Jf(z),Ra){var Et=Kd,Cn;(Cn=!Et)||(Cn=V6(Et,ba),Cn!==null?(Lt(),z.memoizedState={dehydrated:Cn,treeContext:ks!==null?{id:d2,overflow:M1}:null,retryLane:536870912,hydrationErrors:null},Te=c(18,null,null,Jc),Te.stateNode=Cn,Te.return=z,z.child=Te,ac=z,Kd=null,Cn=!0):Cn=!1,Cn=!Cn),Cn&&(ir(z,Et),gt(z))}if(Et=z.memoizedState,Et!==null&&(Et=Et.dehydrated,Et!==null))return O6(Et)?z.lanes=32:z.lanes=536870912,null;u1(z)}if(Et=pe.children,pe=pe.fallback,Ce)return Jf(z),Ce=z.mode,Et=cE({mode:"hidden",children:Et},Ce),pe=y1(pe,Ce,q,null),Et.return=z,pe.return=z,Et.sibling=pe,z.child=Et,Ce=z.child,Ce.memoizedState=Mv(q),Ce.childLanes=f6(R,ht,q),z.memoizedState=b8,pe;return Wy(z),PT(z,Et)}if(Cn=R.memoizedState,Cn!==null&&(Et=Cn.dehydrated,Et!==null)){if(Te)z.flags&256?(Wy(z),z.flags&=-257,z=Xy(R,z,q)):z.memoizedState!==null?(Jf(z),z.child=R.child,z.flags|=128,z=null):(Jf(z),Ce=pe.fallback,Et=z.mode,pe=cE({mode:"visible",children:pe.children},Et),Ce=y1(Ce,Et,q,null),Ce.flags|=2,pe.return=z,Ce.return=z,pe.sibling=Ce,z.child=pe,X_(z,R.child,null,q),pe=z.child,pe.memoizedState=Mv(q),pe.childLanes=f6(R,ht,q),z.memoizedState=b8,z=Ce);else if(Wy(z),Ra&&console.error("We should not be hydrating here. This is a bug in React. Please file a bug."),O6(Et))Et=i2(Et),ht=Et.digest,Ce=Et.message,pe=Et.stack,Et=Et.componentStack,Ce=Ce?Error(Ce):Error("The server could not finish this Suspense boundary, likely due to an error during server rendering. Switched to client rendering."),Ce.stack=pe||"",Ce.digest=ht,ht=Et===void 0?null:Et,pe={value:Ce,source:null,stack:ht},typeof ht==="string"&&i8.set(Ce,pe),wn(pe),z=Xy(R,z,q);else if(Al||lo(R,z,q,!1),ht=(q&R.childLanes)!==0,Al||ht){if(ht=uh,ht!==null&&(pe=q&-q,pe=(pe&42)!==0?1:se(pe),pe=(pe&(ht.suspendedLanes|q))!==0?0:pe,pe!==0&&pe!==Cn.retryLane))throw Cn.retryLane=pe,Su(R,pe),xd(ht,R,pe),D1;I1(Et)||Rv(),z=Xy(R,z,q)}else I1(Et)?(z.flags|=192,z.child=R.child,z=null):(R=Cn.treeContext,V_&&(Kd=EE(Et),ac=z,Ra=!0,uC=null,w1=!1,$d=null,ba=!1,R!==null&&(Lt(),Tu[U_++]=d2,Tu[U_++]=M1,Tu[U_++]=ks,d2=R.id,M1=R.overflow,ks=z)),z=PT(z,pe.children),z.flags|=4096);return z}if(Ce)return Jf(z),Ce=pe.fallback,Et=z.mode,Cn=R.child,Te=Cn.sibling,pe=Ky(Cn,{mode:"hidden",children:pe.children}),pe.subtreeFlags=Cn.subtreeFlags&65011712,Te!==null?Ce=Ky(Te,Ce):(Ce=y1(Ce,Et,q,null),Ce.flags|=2),Ce.return=z,pe.return=z,pe.sibling=Ce,z.child=pe,pe=Ce,Ce=z.child,Et=R.child.memoizedState,Et===null?Et=Mv(q):(Cn=Et.cachePool,Cn!==null?(Te=Pl?lh._currentValue:lh._currentValue2,Cn=Cn.parent!==Te?{parent:Te,pool:Te}:Cn):Cn=Zs(),Et={baseLanes:Et.baseLanes|q,cachePool:Cn}),Ce.memoizedState=Et,Ce.childLanes=f6(R,ht,q),z.memoizedState=b8,pe;return Wy(z),q=R.child,R=q.sibling,q=Ky(q,{mode:"visible",children:pe.children}),q.return=z,q.sibling=null,R!==null&&(ht=z.deletions,ht===null?(z.deletions=[R],z.flags|=16):ht.push(R)),z.child=q,z.memoizedState=null,q}function PT(R,z){return z=cE({mode:"visible",children:z},R.mode),z.return=R,R.child=z}function cE(R,z){return R=c(22,R,null,z),R.lanes=0,R.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null},R}function Xy(R,z,q){return X_(z,R.child,null,q),R=PT(z,z.pendingProps.children),R.flags|=2,z.memoizedState=null,R}function ET(R,z,q){R.lanes|=z;var pe=R.alternate;pe!==null&&(pe.lanes|=z),To(R.return,z,q)}function MT(R,z){var q=wc(R);return R=!q&&typeof I(R)==="function",q||R?(q=q?"array":"iterable",console.error("A nested %s was passed to row #%s in <SuspenseList />. Wrap it in an additional SuspenseList to configure its revealOrder: <SuspenseList revealOrder=...> ... <SuspenseList revealOrder=...>{%s}</SuspenseList> ... </SuspenseList>",q,z,q),!1):!0}function wT(R,z,q,pe,Ce){var Te=R.memoizedState;Te===null?R.memoizedState={isBackwards:z,rendering:null,renderingStartTime:0,last:pe,tail:q,tailMode:Ce}:(Te.isBackwards=z,Te.rendering=null,Te.renderingStartTime=0,Te.last=pe,Te.tail=q,Te.tailMode=Ce)}function km(R,z,q){var pe=z.pendingProps,Ce=pe.revealOrder,Te=pe.tail;if(pe=pe.children,Ce!==void 0&&Ce!=="forwards"&&Ce!=="backwards"&&Ce!=="together"&&!n4[Ce])if(n4[Ce]=!0,typeof Ce==="string")switch(Ce.toLowerCase()){case"together":case"forwards":case"backwards":console.error('"%s" is not a valid value for revealOrder on <SuspenseList />. Use lowercase "%s" instead.',Ce,Ce.toLowerCase());break;case"forward":case"backward":console.error('"%s" is not a valid value for revealOrder on <SuspenseList />. React uses the -s suffix in the spelling. Use "%ss" instead.',Ce,Ce.toLowerCase());break;default:console.error('"%s" is not a supported revealOrder on <SuspenseList />. Did you mean "together", "forwards" or "backwards"?',Ce)}else console.error('%s is not a supported value for revealOrder on <SuspenseList />. Did you mean "together", "forwards" or "backwards"?',Ce);Te===void 0||C8[Te]||(Te!=="collapsed"&&Te!=="hidden"?(C8[Te]=!0,console.error('"%s" is not a supported value for tail on <SuspenseList />. Did you mean "collapsed" or "hidden"?',Te)):Ce!=="forwards"&&Ce!=="backwards"&&(C8[Te]=!0,console.error('<SuspenseList tail="%s" /> is only valid if revealOrder is "forwards" or "backwards". Did you mean to specify revealOrder="forwards"?',Te)));e:if((Ce==="forwards"||Ce==="backwards")&&pe!==void 0&&pe!==null&&pe!==!1)if(wc(pe)){for(var ht=0;ht<pe.length;ht++)if(!MT(pe[ht],ht))break e}else if(ht=I(pe),typeof ht==="function"){if(ht=ht.call(pe))for(var Et=ht.next(),Cn=0;!Et.done;Et=ht.next()){if(!MT(Et.value,Cn))break e;Cn++}}else console.error('A single row was passed to a <SuspenseList revealOrder="%s" />. This is not useful since it needs multiple rows. Did you mean to pass multiple children or an array?',Ce);if(Vl(R,z,pe,q),pe=dh.current,(pe&yC)!==0)pe=pe&fC|yC,z.flags|=128;else{if(R!==null&&(R.flags&128)!==0)e:for(R=z.child;R!==null;){if(R.tag===13)R.memoizedState!==null&&ET(R,q,z);else if(R.tag===19)ET(R,q,z);else if(R.child!==null){R.child.return=R,R=R.child;continue}if(R===z)break e;for(;R.sibling===null;){if(R.return===null||R.return===z)break e;R=R.return}R.sibling.return=R.return,R=R.sibling}pe&=fC}switch(T(dh,pe,z),Ce){case"forwards":q=z.child;for(Ce=null;q!==null;)R=q.alternate,R!==null&&Ev(R)===null&&(Ce=q),q=q.sibling;q=Ce,q===null?(Ce=z.child,z.child=null):(Ce=q.sibling,q.sibling=null),wT(z,!1,Ce,q,Te);break;case"backwards":q=null,Ce=z.child;for(z.child=null;Ce!==null;){if(R=Ce.alternate,R!==null&&Ev(R)===null){z.child=Ce;break}R=Ce.sibling,Ce.sibling=q,q=Ce,Ce=R}wT(z,!0,q,null,Te);break;case"together":wT(z,!1,null,null,void 0);break;default:z.memoizedState=null}return z.child}function _1(R,z,q){if(R!==null&&(z.dependencies=R.dependencies),Om=-1,w8|=z.lanes,(q&z.childLanes)===0)if(R!==null){if(lo(R,z,q,!1),(q&z.childLanes)===0)return null}else return null;if(R!==null&&z.child!==R.child)throw Error("Resuming work not yet implemented.");if(z.child!==null){R=z.child,q=Ky(R,R.pendingProps),z.child=q;for(q.return=z;R.sibling!==null;)R=R.sibling,q=q.sibling=Ky(R,R.pendingProps),q.return=z;q.sibling=null}return z.child}function wv(R,z){if((R.lanes&z)!==0)return!0;return R=R.dependencies,R!==null&&fo(R)?!0:!1}function BT(R,z,q){switch(z.tag){case 3:xt(z,z.stateNode.containerInfo),qn(z,lh,R.memoizedState.cache),cn();break;case 27:case 5:Ze(z);break;case 4:xt(z,z.stateNode.containerInfo);break;case 10:qn(z,z.type,z.memoizedProps.value);break;case 12:(q&z.childLanes)!==0&&(z.flags|=4),z.flags|=2048;var pe=z.stateNode;pe.effectDuration=-0,pe.passiveEffectDuration=-0;break;case 13:if(pe=z.memoizedState,pe!==null){if(pe.dehydrated!==null)return Wy(z),z.flags|=128,null;if((q&z.child.childLanes)!==0)return aE(R,z,q);return Wy(z),R=_1(R,z,q),R!==null?R.sibling:null}Wy(z);break;case 19:var Ce=(R.flags&128)!==0;if(pe=(q&z.childLanes)!==0,pe||(lo(R,z,q,!1),pe=(q&z.childLanes)!==0),Ce){if(pe)return km(R,z,q);z.flags|=128}if(Ce=z.memoizedState,Ce!==null&&(Ce.rendering=null,Ce.tail=null,Ce.lastEffect=null),T(dh,dh.current,z),pe)break;else return null;case 22:case 23:return z.lanes=0,m1(R,z,q);case 24:qn(z,lh,R.memoizedState.cache)}return _1(R,z,q)}function jy(R,z,q){if(z._debugNeedsRemount&&R!==null){q=dD(z.type,z.key,z.pendingProps,z._debugOwner||null,z.mode,z.lanes),q._debugStack=z._debugStack,q._debugTask=z._debugTask;var pe=z.return;if(pe===null)throw Error("Cannot swap the root fiber.");if(R.alternate=null,z.alternate=null,q.index=z.index,q.sibling=z.sibling,q.return=z.return,q.ref=z.ref,q._debugInfo=z._debugInfo,z===pe.child)pe.child=q;else{var Ce=pe.child;if(Ce===null)throw Error("Expected parent to have a child.");for(;Ce.sibling!==z;)if(Ce=Ce.sibling,Ce===null)throw Error("Expected to find the previous sibling.");Ce.sibling=q}return z=pe.deletions,z===null?(pe.deletions=[R],pe.flags|=16):z.push(R),q.flags|=2,q}if(R!==null)if(R.memoizedProps!==z.pendingProps||z.type!==R.type)Al=!0;else{if(!wv(R,q)&&(z.flags&128)===0)return Al=!1,BT(R,z,q);Al=(R.flags&131072)!==0?!0:!1}else{if(Al=!1,pe=Ra)Lt(),pe=(z.flags&1048576)!==0;pe&&(pe=z.index,Lt(),ct(z,MD,pe))}switch(z.lanes=0,z.tag){case 16:e:if(pe=z.pendingProps,R=ri(z.elementType),z.type=R,typeof R==="function")zv(R)?(pe=ef(R,pe),z.tag=1,z.type=R=eC(R),z=cH(null,z,R,pe,q)):(z.tag=0,sE(z,R),z.type=R=eC(R),z=of(null,z,R,pe,q));else{if(R!==void 0&&R!==null){if(Ce=R.$$typeof,Ce===R6){z.tag=11,z.type=R=hD(R),z=iE(null,z,R,pe,q);break e}else if(Ce===Ai){z.tag=14,z=ST(null,z,R,pe,q);break e}}throw z="",R!==null&&typeof R==="object"&&R.$$typeof===af&&(z=" Did you wrap a component in React.lazy() more than once?"),R=v(R)||R,Error("Element type is invalid. Received a promise that resolves to: "+R+". Lazy element type must resolve to a class or function."+z)}return z;case 0:return of(R,z,z.type,z.pendingProps,q);case 1:return pe=z.type,Ce=ef(pe,z.pendingProps),cH(R,z,pe,Ce,q);case 3:e:{if(xt(z,z.stateNode.containerInfo),R===null)throw Error("Should have a current fiber. This is a bug in React.");var Te=z.pendingProps;Ce=z.memoizedState,pe=Ce.element,Q_(R,z),$f(z,Te,null,q);var ht=z.memoizedState;if(Te=ht.cache,qn(z,lh,Te),Te!==Ce.cache&&Tn(z,[lh],q,!0),Nm(),Te=ht.element,V_&&Ce.isDehydrated)if(Ce={element:Te,isDehydrated:!1,cache:ht.cache},z.updateQueue.baseState=Ce,z.memoizedState=Ce,z.flags&256){z=vU(R,z,Te,q);break e}else if(Te!==pe){pe=rt(Error("This root received an early update, before anything was able hydrate. Switched the entire root to client rendering."),z),wn(pe),z=vU(R,z,Te,q);break e}else for(V_&&(Kd=s2(z.stateNode.containerInfo),ac=z,Ra=!0,uC=null,w1=!1,$d=null,ba=!0),R=B1(z,null,Te,q),z.child=R;R;)R.flags=R.flags&-3|4096,R=R.sibling;else{if(cn(),Te===pe){z=_1(R,z,q);break e}Vl(R,z,Te,q)}z=z.child}return z;case 26:if(a2)return nf(R,z),R===null?(R=W6(z.type,null,z.pendingProps,null))?z.memoizedState=R:Ra||(z.stateNode=qU(z.type,z.pendingProps,Bt(uf.current),z)):z.memoizedState=W6(z.type,R.memoizedProps,z.pendingProps,R.memoizedState),null;case 27:if(Bu)return Ze(z),R===null&&Bu&&Ra&&(Ce=Bt(uf.current),pe=ut(),Ce=z.stateNode=QH(z.type,z.pendingProps,Ce,pe,!1),w1||(pe=Xp(Ce,z.type,z.pendingProps,pe),pe!==null&&(bo(z,0).serverProps=pe)),ac=z,ba=!0,Kd=jv(z.type,Ce,Kd)),Vl(R,z,z.pendingProps.children,q),nf(R,z),R===null&&(z.flags|=4194304),z.child;case 5:return R===null&&Ra&&(Te=ut(),pe=Id(z.type,z.pendingProps,Te),Ce=Kd,(ht=!Ce)||(ht=BH(Ce,z.type,z.pendingProps,ba),ht!==null?(z.stateNode=ht,w1||(Te=Xp(ht,z.type,z.pendingProps,Te),Te!==null&&(bo(z,0).serverProps=Te)),ac=z,Kd=Xv(ht),ba=!1,Te=!0):Te=!1,ht=!Te),ht&&(pe&&ir(z,Ce),gt(z))),Ze(z),Ce=z.type,Te=z.pendingProps,ht=R!==null?R.memoizedProps:null,pe=Te.children,cf(Ce,Te)?pe=null:ht!==null&&cf(Ce,ht)&&(z.flags|=32),z.memoizedState!==null&&(Ce=L3(R,z,nH,null,null,q),Pl?tC._currentValue=Ce:tC._currentValue2=Ce),nf(R,z),Vl(R,z,pe,q),z.child;case 6:return R===null&&Ra&&(R=z.pendingProps,q=ut(),R=KU(R,q),q=Kd,(pe=!q)||(pe=sC(q,z.pendingProps,ba),pe!==null?(z.stateNode=pe,ac=z,Kd=null,pe=!0):pe=!1,pe=!pe),pe&&(R&&ir(z,q),gt(z))),null;case 13:return aE(R,z,q);case 4:return xt(z,z.stateNode.containerInfo),pe=z.pendingProps,R===null?z.child=X_(z,null,pe,q):Vl(R,z,pe,q),z.child;case 11:return iE(R,z,z.type,z.pendingProps,q);case 7:return Vl(R,z,z.pendingProps,q),z.child;case 8:return Vl(R,z,z.pendingProps.children,q),z.child;case 12:return z.flags|=4,z.flags|=2048,pe=z.stateNode,pe.effectDuration=-0,pe.passiveEffectDuration=-0,Vl(R,z,z.pendingProps.children,q),z.child;case 10:return pe=z.type,Ce=z.pendingProps,Te=Ce.value,"value"in Ce||JH||(JH=!0,console.error("The `value` prop is required for the `<Context.Provider>`. Did you misspell it or forget to pass it?")),qn(z,pe,Te),Vl(R,z,Ce.children,q),z.child;case 9:return Ce=z.type._context,pe=z.pendingProps.children,typeof pe!=="function"&&console.error("A context consumer was rendered with multiple children, or a child that isn't a function. A context consumer expects a single child that is a function. If you did pass a function, make sure there is no trailing or leading whitespace around it."),oo(z),Ce=Ro(Ce),de(z),pe=HD(pe,Ce,void 0),me(),z.flags|=1,Vl(R,z,pe,q),z.child;case 14:return ST(R,z,z.type,z.pendingProps,q);case 15:return sH(R,z,z.type,z.pendingProps,q);case 19:return km(R,z,q);case 31:return pe=z.pendingProps,q=z.mode,pe={mode:pe.mode,children:pe.children},R===null?(R=cE(pe,q),R.ref=z.ref,z.child=R,R.return=z,z=R):(R=Ky(R.child,pe),R.ref=z.ref,z.child=R,R.return=z,z=R),z;case 22:return m1(R,z,q);case 24:return oo(z),pe=Ro(lh),R===null?(Ce=ji(),Ce===null&&(Ce=uh,Te=Xi(),Ce.pooledCache=Te,Ys(Te),Te!==null&&(Ce.pooledCacheLanes|=q),Ce=Te),z.memoizedState={parent:pe,cache:Ce},T0(z),qn(z,lh,Ce)):((R.lanes&q)!==0&&(Q_(R,z),$f(z,null,null,q),Nm()),Ce=R.memoizedState,Te=z.memoizedState,Ce.parent!==pe?(Ce={parent:pe,cache:pe},z.memoizedState=Ce,z.lanes===0&&(z.memoizedState=z.updateQueue.baseState=Ce),qn(z,lh,pe)):(pe=Te.cache,qn(z,lh,pe),pe!==Ce.cache&&Tn(z,[lh],q,!0))),Vl(R,z,z.pendingProps.children,q),z.child;case 29:throw z.pendingProps}throw Error("Unknown unit of work tag ("+z.tag+"). This error is likely caused by a bug in React. Please file an issue.")}function Lg(R){R.flags|=4}function lE(R,z){if(R!==null&&R.child===z.child)return!1;if((z.flags&16)!==0)return!0;for(R=z.child;R!==null;){if((R.flags&13878)!==0||(R.subtreeFlags&13878)!==0)return!0;R=R.sibling}return!1}function TT(R,z,q,pe){if(Bc)for(q=z.child;q!==null;){if(q.tag===5||q.tag===6)_D(R,q.stateNode);else if(!(q.tag===4||Bu&&q.tag===27)&&q.child!==null){q.child.return=q,q=q.child;continue}if(q===z)break;for(;q.sibling===null;){if(q.return===null||q.return===z)return;q=q.return}q.sibling.return=q.return,q=q.sibling}else if(wu)for(var Ce=z.child;Ce!==null;){if(Ce.tag===5){var Te=Ce.stateNode;q&&pe&&(Te=Hm(Te,Ce.type,Ce.memoizedProps)),_D(R,Te)}else if(Ce.tag===6)Te=Ce.stateNode,q&&pe&&(Te=yD(Te,Ce.memoizedProps)),_D(R,Te);else if(Ce.tag!==4){if(Ce.tag===22&&Ce.memoizedState!==null)Te=Ce.child,Te!==null&&(Te.return=Ce),TT(R,Ce,!0,!0);else if(Ce.child!==null){Ce.child.return=Ce,Ce=Ce.child;continue}}if(Ce===z)break;for(;Ce.sibling===null;){if(Ce.return===null||Ce.return===z)return;Ce=Ce.return}Ce.sibling.return=Ce.return,Ce=Ce.sibling}}function hE(R,z,q,pe){var Ce=!1;if(wu)for(var Te=z.child;Te!==null;){if(Te.tag===5){var ht=Te.stateNode;q&&pe&&(ht=Hm(ht,Te.type,Te.memoizedProps)),z6(R,ht)}else if(Te.tag===6)ht=Te.stateNode,q&&pe&&(ht=yD(ht,Te.memoizedProps)),z6(R,ht);else if(Te.tag!==4){if(Te.tag===22&&Te.memoizedState!==null)Ce=Te.child,Ce!==null&&(Ce.return=Te),hE(R,Te,!0,!0),Ce=!0;else if(Te.child!==null){Te.child.return=Te,Te=Te.child;continue}}if(Te===z)break;for(;Te.sibling===null;){if(Te.return===null||Te.return===z)return Ce;Te=Te.return}Te.sibling.return=Te.return,Te=Te.sibling}return Ce}function lH(R,z){if(wu&&lE(R,z)){R=z.stateNode;var q=R.containerInfo,pe=Ui();hE(pe,z,!1,!1),R.pendingChildren=pe,Lg(z),H0(q,pe)}}function Bv(R,z,q,pe){if(Bc)R.memoizedProps!==pe&&Lg(z);else if(wu){var Ce=R.stateNode,Te=R.memoizedProps;if((R=lE(R,z))||Te!==pe){var ht=ut();Te=WU(Ce,q,Te,pe,!R,null),Te===Ce?z.stateNode=Ce:(n2(Te,q,pe,ht)&&Lg(z),z.stateNode=Te,R?TT(Te,z,!1,!1):Lg(z))}else z.stateNode=Ce}}function DT(R,z,q){if(AD(z,q)){if(R.flags|=16777216,!Yv(z,q))if(JT())R.flags|=8192;else throw g8=RD,ND}else R.flags&=-16777217}function hH(R,z){if(SD(z)){if(R.flags|=16777216,!BE(z))if(JT())R.flags|=8192;else throw g8=RD,ND}else R.flags&=-16777217}function Tv(R,z){z!==null&&(R.flags|=4),R.flags&16384&&(z=R.tag!==22?j():536870912,R.lanes|=z,jg|=z)}function y6(R,z){if(!Ra)switch(R.tailMode){case"hidden":z=R.tail;for(var q=null;z!==null;)z.alternate!==null&&(q=z),z=z.sibling;q===null?R.tail=null:q.sibling=null;break;case"collapsed":q=R.tail;for(var pe=null;q!==null;)q.alternate!==null&&(pe=q),q=q.sibling;pe===null?z||R.tail===null?R.tail=null:R.tail.sibling=null:pe.sibling=null}}function Fc(R){var z=R.alternate!==null&&R.alternate.child===R.child,q=0,pe=0;if(z)if((R.mode&2)!==Jc){for(var{selfBaseDuration:Ce,child:Te}=R;Te!==null;)q|=Te.lanes|Te.childLanes,pe|=Te.subtreeFlags&65011712,pe|=Te.flags&65011712,Ce+=Te.treeBaseDuration,Te=Te.sibling;R.treeBaseDuration=Ce}else for(Ce=R.child;Ce!==null;)q|=Ce.lanes|Ce.childLanes,pe|=Ce.subtreeFlags&65011712,pe|=Ce.flags&65011712,Ce.return=R,Ce=Ce.sibling;else if((R.mode&2)!==Jc){Ce=R.actualDuration,Te=R.selfBaseDuration;for(var ht=R.child;ht!==null;)q|=ht.lanes|ht.childLanes,pe|=ht.subtreeFlags,pe|=ht.flags,Ce+=ht.actualDuration,Te+=ht.treeBaseDuration,ht=ht.sibling;R.actualDuration=Ce,R.treeBaseDuration=Te}else for(Ce=R.child;Ce!==null;)q|=Ce.lanes|Ce.childLanes,pe|=Ce.subtreeFlags,pe|=Ce.flags,Ce.return=R,Ce=Ce.sibling;return R.subtreeFlags|=pe,R.childLanes=q,z}function V3(R,z,q){var pe=z.pendingProps;switch(kt(z),z.tag){case 31:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Fc(z),null;case 1:return Fc(z),null;case 3:if(q=z.stateNode,pe=null,R!==null&&(pe=R.memoizedState.cache),z.memoizedState.cache!==pe&&(z.flags|=2048),Po(lh,z),Yt(z),q.pendingContext&&(q.context=q.pendingContext,q.pendingContext=null),R===null||R.child===null)It(z)?(eo(),Lg(z)):R===null||R.memoizedState.isDehydrated&&(z.flags&256)===0||(z.flags|=1024,dn());return lH(R,z),Fc(z),null;case 26:if(a2){q=z.type;var Ce=z.memoizedState;return R===null?(Lg(z),Ce!==null?(Fc(z),hH(z,Ce)):(Fc(z),DT(z,q,pe))):Ce?Ce!==R.memoizedState?(Lg(z),Fc(z),hH(z,Ce)):(Fc(z),z.flags&=-16777217):(Bc?R.memoizedProps!==pe&&Lg(z):Bv(R,z,q,pe),Fc(z),DT(z,q,pe)),null}case 27:if(Bu){if(Fe(z),q=Bt(uf.current),Ce=z.type,R!==null&&z.stateNode!=null)Bc?R.memoizedProps!==pe&&Lg(z):Bv(R,z,Ce,pe);else{if(!pe){if(z.stateNode===null)throw Error("We must have new props for new mounts. This error is likely caused by a bug in React. Please file an issue.");return Fc(z),null}R=ut(),It(z)?Oe(z,R):(R=QH(Ce,pe,q,R,!0),z.stateNode=R,Lg(z))}return Fc(z),null}case 5:if(Fe(z),q=z.type,R!==null&&z.stateNode!=null)Bv(R,z,q,pe);else{if(!pe){if(z.stateNode===null)throw Error("We must have new props for new mounts. This error is likely caused by a bug in React. Please file an issue.");return Fc(z),null}R=ut(),It(z)?Oe(z,R):(Ce=Bt(uf.current),Ce=k6(q,pe,Ce,R,z),TT(Ce,z,!1,!1),z.stateNode=Ce,n2(Ce,q,pe,R)&&Lg(z))}return Fc(z),DT(z,z.type,z.pendingProps),null;case 6:if(R&&z.stateNode!=null)q=R.memoizedProps,Bc?q!==pe&&Lg(z):wu&&(q!==pe?(R=Bt(uf.current),q=ut(),z.stateNode=HU(pe,R,q,z),Lg(z)):z.stateNode=R.stateNode);else{if(typeof pe!=="string"&&z.stateNode===null)throw Error("We must have new props for new mounts. This error is likely caused by a bug in React. Please file an issue.");if(R=Bt(uf.current),q=ut(),It(z)){if(!V_)throw Error("Expected prepareToHydrateHostTextInstance() to never be called. This error is likely caused by a bug in React. Please file an issue.");R=z.stateNode,q=z.memoizedProps,Ce=!w1,pe=null;var Te=ac;if(Te!==null)switch(Te.tag){case 3:Ce&&(Ce=ID(R,q,pe),Ce!==null&&(bo(z,0).serverProps=Ce));break;case 27:case 5:pe=Te.memoizedProps,Ce&&(Ce=ID(R,q,pe),Ce!==null&&(bo(z,0).serverProps=Ce))}ME(R,q,z,pe)||gt(z)}else z.stateNode=HU(pe,R,q,z)}return Fc(z),null;case 13:if(pe=z.memoizedState,R===null||R.memoizedState!==null&&R.memoizedState.dehydrated!==null){if(Ce=It(z),pe!==null&&pe.dehydrated!==null){if(R===null){if(!Ce)throw Error("A dehydrated suspense component was completed without a hydrated node. This is probably a bug in React.");if(!V_)throw Error("Expected prepareToHydrateHostSuspenseInstance() to never be called. This error is likely caused by a bug in React. Please file an issue.");if(Ce=z.memoizedState,Ce=Ce!==null?Ce.dehydrated:null,!Ce)throw Error("Expected to have a hydrated suspense instance. This error is likely caused by a bug in React. Please file an issue.");wE(Ce,z),Fc(z),(z.mode&2)!==Jc&&pe!==null&&(Ce=z.child,Ce!==null&&(z.treeBaseDuration-=Ce.treeBaseDuration))}else eo(),cn(),(z.flags&128)===0&&(z.memoizedState=null),z.flags|=4,Fc(z),(z.mode&2)!==Jc&&pe!==null&&(Ce=z.child,Ce!==null&&(z.treeBaseDuration-=Ce.treeBaseDuration));Ce=!1}else Ce=dn(),R!==null&&R.memoizedState!==null&&(R.memoizedState.hydrationErrors=Ce),Ce=!0;if(!Ce){if(z.flags&256)return u1(z),z;return u1(z),null}}if(u1(z),(z.flags&128)!==0)return z.lanes=q,(z.mode&2)!==Jc&&B0(z),z;return q=pe!==null,R=R!==null&&R.memoizedState!==null,q&&(pe=z.child,Ce=null,pe.alternate!==null&&pe.alternate.memoizedState!==null&&pe.alternate.memoizedState.cachePool!==null&&(Ce=pe.alternate.memoizedState.cachePool.pool),Te=null,pe.memoizedState!==null&&pe.memoizedState.cachePool!==null&&(Te=pe.memoizedState.cachePool.pool),Te!==Ce&&(pe.flags|=2048)),q!==R&&q&&(z.child.flags|=8192),Tv(z,z.updateQueue),Fc(z),(z.mode&2)!==Jc&&q&&(R=z.child,R!==null&&(z.treeBaseDuration-=R.treeBaseDuration)),null;case 4:return Yt(z),lH(R,z),R===null&&bH(z.stateNode.containerInfo),Fc(z),null;case 10:return Po(z.type,z),Fc(z),null;case 19:if(B(dh,z),Ce=z.memoizedState,Ce===null)return Fc(z),null;if(pe=(z.flags&128)!==0,Te=Ce.rendering,Te===null)if(pe)y6(Ce,!1);else{if(Jd!==Xg||R!==null&&(R.flags&128)!==0)for(R=z.child;R!==null;){if(Te=Ev(R),Te!==null){z.flags|=128,y6(Ce,!1),R=Te.updateQueue,z.updateQueue=R,Tv(z,R),z.subtreeFlags=0,R=q;for(q=z.child;q!==null;)i0(q,R),q=q.sibling;return T(dh,dh.current&fC|yC,z),z.child}R=R.sibling}Ce.tail!==null&&df()>D8&&(z.flags|=128,pe=!0,y6(Ce,!1),z.lanes=4194304)}else{if(!pe)if(R=Ev(Te),R!==null){if(z.flags|=128,pe=!0,R=R.updateQueue,z.updateQueue=R,Tv(z,R),y6(Ce,!0),Ce.tail===null&&Ce.tailMode==="hidden"&&!Te.alternate&&!Ra)return Fc(z),null}else 2*df()-Ce.renderingStartTime>D8&&q!==536870912&&(z.flags|=128,pe=!0,y6(Ce,!1),z.lanes=4194304);Ce.isBackwards?(Te.sibling=z.child,z.child=Te):(R=Ce.last,R!==null?R.sibling=Te:z.child=Te,Ce.last=Te)}if(Ce.tail!==null)return R=Ce.tail,Ce.rendering=R,Ce.tail=R.sibling,Ce.renderingStartTime=df(),R.sibling=null,q=dh.current,q=pe?q&fC|yC:q&fC,T(dh,q,z),R;return Fc(z),null;case 22:case 23:return u1(z),yd(z),pe=z.memoizedState!==null,R!==null?R.memoizedState!==null!==pe&&(z.flags|=8192):pe&&(z.flags|=8192),pe?(q&536870912)!==0&&(z.flags&128)===0&&(Fc(z),z.subtreeFlags&6&&(z.flags|=8192)):Fc(z),q=z.updateQueue,q!==null&&Tv(z,q.retryQueue),q=null,R!==null&&R.memoizedState!==null&&R.memoizedState.cachePool!==null&&(q=R.memoizedState.cachePool.pool),pe=null,z.memoizedState!==null&&z.memoizedState.cachePool!==null&&(pe=z.memoizedState.cachePool.pool),pe!==q&&(z.flags|=2048),R!==null&&B(W5,z),null;case 24:return q=null,R!==null&&(q=R.memoizedState.cache),z.memoizedState.cache!==q&&(z.flags|=2048),Po(lh,z),Fc(z),null;case 25:return null;case 30:return null}throw Error("Unknown unit of work tag ("+z.tag+"). This error is likely caused by a bug in React. Please file an issue.")}function dE(R,z){switch(kt(z),z.tag){case 1:return R=z.flags,R&65536?(z.flags=R&-65537|128,(z.mode&2)!==Jc&&B0(z),z):null;case 3:return Po(lh,z),Yt(z),R=z.flags,(R&65536)!==0&&(R&128)===0?(z.flags=R&-65537|128,z):null;case 26:case 27:case 5:return Fe(z),null;case 13:if(u1(z),R=z.memoizedState,R!==null&&R.dehydrated!==null){if(z.alternate===null)throw Error("Threw in newly mounted dehydrated component. This is likely a bug in React. Please file an issue.");cn()}return R=z.flags,R&65536?(z.flags=R&-65537|128,(z.mode&2)!==Jc&&B0(z),z):null;case 19:return B(dh,z),null;case 4:return Yt(z),null;case 10:return Po(z.type,z),null;case 22:case 23:return u1(z),yd(z),R!==null&&B(W5,z),R=z.flags,R&65536?(z.flags=R&-65537|128,(z.mode&2)!==Jc&&B0(z),z):null;case 24:return Po(lh,z),null;case 25:return null;default:return null}}function uE(R,z){switch(kt(z),z.tag){case 3:Po(lh,z),Yt(z);break;case 26:case 27:case 5:Fe(z);break;case 4:Yt(z);break;case 13:u1(z);break;case 19:B(dh,z);break;case 10:Po(z.type,z);break;case 22:case 23:u1(z),yd(z),R!==null&&B(W5,z);break;case 24:Po(lh,z)}}function Hg(R){return(R.mode&2)!==Jc}function Dv(R,z){Hg(R)?(_d(),pE(z,R),Ec()):pE(z,R)}function NT(R,z,q){Hg(R)?(_d(),x6(q,R,z),Ec()):x6(q,R,z)}function pE(R,z){try{var q=z.updateQueue,pe=q!==null?q.lastEffect:null;if(pe!==null){var Ce=pe.next;q=Ce;do{if((q.tag&R)===R&&((R&hh)!==Gg?gr!==null&&typeof gr.markComponentPassiveEffectMountStarted==="function"&&gr.markComponentPassiveEffectMountStarted(z):(R&F0)!==Gg&&gr!==null&&typeof gr.markComponentLayoutEffectMountStarted==="function"&&gr.markComponentLayoutEffectMountStarted(z),pe=void 0,(R&qp)!==Gg&&(WE=!0),pe=hn(z,xo,q),(R&qp)!==Gg&&(WE=!1),(R&hh)!==Gg?gr!==null&&typeof gr.markComponentPassiveEffectMountStopped==="function"&&gr.markComponentPassiveEffectMountStopped():(R&F0)!==Gg&&gr!==null&&typeof gr.markComponentLayoutEffectMountStopped==="function"&&gr.markComponentLayoutEffectMountStopped(),pe!==void 0&&typeof pe!=="function")){var Te=void 0;Te=(q.tag&F0)!==0?"useLayoutEffect":(q.tag&qp)!==0?"useInsertionEffect":"useEffect";var ht=void 0;ht=pe===null?" You returned null. If your effect does not require clean up, return undefined (or nothing).":typeof pe.then==="function"?`

It looks like you wrote `+Te+`(async () => ...) or returned a Promise. Instead, write the async function inside your effect and call it immediately:

`+Te+`(() => {
  async function fetchData() {
    // You can await here
    const response = await MyAPI.getData(someId);
    // ...
  }
  fetchData();
}, [someId]); // Or [] if effect doesn't need props or state

Learn more about data fetching with Hooks: https://react.dev/link/hooks-data-fetching`:" You returned: "+pe,hn(z,function(Et,Cn){console.error("%s must not return anything besides a function, which is used for clean-up.%s",Et,Cn)},Te,ht)}q=q.next}while(q!==Ce)}}catch(Et){$c(z,z.return,Et)}}function x6(R,z,q){try{var pe=z.updateQueue,Ce=pe!==null?pe.lastEffect:null;if(Ce!==null){var Te=Ce.next;pe=Te;do{if((pe.tag&R)===R){var ht=pe.inst,Et=ht.destroy;Et!==void 0&&(ht.destroy=void 0,(R&hh)!==Gg?gr!==null&&typeof gr.markComponentPassiveEffectUnmountStarted==="function"&&gr.markComponentPassiveEffectUnmountStarted(z):(R&F0)!==Gg&&gr!==null&&typeof gr.markComponentLayoutEffectUnmountStarted==="function"&&gr.markComponentLayoutEffectUnmountStarted(z),(R&qp)!==Gg&&(WE=!0),Ce=z,hn(Ce,Br,Ce,q,Et),(R&qp)!==Gg&&(WE=!1),(R&hh)!==Gg?gr!==null&&typeof gr.markComponentPassiveEffectUnmountStopped==="function"&&gr.markComponentPassiveEffectUnmountStopped():(R&F0)!==Gg&&gr!==null&&typeof gr.markComponentLayoutEffectUnmountStopped==="function"&&gr.markComponentLayoutEffectUnmountStopped())}pe=pe.next}while(pe!==Te)}}catch(Cn){$c(z,z.return,Cn)}}function RT(R,z){Hg(R)?(_d(),pE(z,R),Ec()):pE(z,R)}function mE(R,z,q){Hg(R)?(_d(),x6(q,R,z),Ec()):x6(q,R,z)}function QT(R){var z=R.updateQueue;if(z!==null){var q=R.stateNode;R.type.defaultProps||"ref"in R.memoizedProps||VD||(q.props!==R.memoizedProps&&console.error("Expected %s props to match memoized props before processing the update queue. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.",P(R)||"instance"),q.state!==R.memoizedState&&console.error("Expected %s state to match memoized state before processing the update queue. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.",P(R)||"instance"));try{hn(R,o0,z,q)}catch(pe){$c(R,R.return,pe)}}}function Y3(R,z,q){return R.getSnapshotBeforeUpdate(z,q)}function dH(R,z){var q=z.memoizedProps,pe=z.memoizedState;z=R.stateNode,R.type.defaultProps||"ref"in R.memoizedProps||VD||(z.props!==R.memoizedProps&&console.error("Expected %s props to match memoized props before getSnapshotBeforeUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.",P(R)||"instance"),z.state!==R.memoizedState&&console.error("Expected %s state to match memoized state before getSnapshotBeforeUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.",P(R)||"instance"));try{var Ce=ef(R.type,q,R.elementType===R.type),Te=hn(R,Y3,z,Ce,pe);q=sW,Te!==void 0||q.has(R.type)||(q.add(R.type),hn(R,function(){console.error("%s.getSnapshotBeforeUpdate(): A snapshot value (or null) must be returned. You have returned undefined.",P(R))})),z.__reactInternalSnapshotBeforeUpdate=Te}catch(ht){$c(R,R.return,ht)}}function kT(R,z,q){q.props=ef(R.type,R.memoizedProps),q.state=R.memoizedState,Hg(R)?(_d(),hn(R,Rn,R,z,q),Ec()):hn(R,Rn,R,z,q)}function G3(R){var z=R.ref;if(z!==null){switch(R.tag){case 26:case 27:case 5:var q=Q6(R.stateNode);break;case 30:q=R.stateNode;break;default:q=R.stateNode}if(typeof z==="function")if(Hg(R))try{_d(),R.refCleanup=z(q)}finally{Ec()}else R.refCleanup=z(q);else typeof z==="string"?console.error("String refs are no longer supported."):z.hasOwnProperty("current")||console.error("Unexpected ref object provided for %s. Use either a ref-setter function or React.createRef().",P(R)),z.current=q}}function Gp(R,z){try{hn(R,G3,R)}catch(q){$c(R,z,q)}}function Fg(R,z){var q=R.ref,pe=R.refCleanup;if(q!==null)if(typeof pe==="function")try{if(Hg(R))try{_d(),hn(R,pe)}finally{Ec(R)}else hn(R,pe)}catch(Ce){$c(R,z,Ce)}finally{R.refCleanup=null,R=R.alternate,R!=null&&(R.refCleanup=null)}else if(typeof q==="function")try{if(Hg(R))try{_d(),hn(R,q,null)}finally{Ec(R)}else hn(R,q,null)}catch(Ce){$c(R,z,Ce)}else q.current=null}function LT(R,z,q,pe){var Ce=R.memoizedProps,Te=Ce.id,ht=Ce.onCommit;Ce=Ce.onRender,z=z===null?"mount":"update",a8&&(z="nested-update"),typeof Ce==="function"&&Ce(Te,z,R.actualDuration,R.treeBaseDuration,R.actualStartTime,q),typeof ht==="function"&&ht(R.memoizedProps.id,z,pe,q)}function HT(R,z,q,pe){var Ce=R.memoizedProps;R=Ce.id,Ce=Ce.onPostCommit,z=z===null?"mount":"update",a8&&(z="nested-update"),typeof Ce==="function"&&Ce(R,z,pe,q)}function Xs(R){var{type:z,memoizedProps:q,stateNode:pe}=R;try{hn(R,PE,pe,z,q,R)}catch(Ce){$c(R,R.return,Ce)}}function Eo(R,z,q){try{hn(R,YU,R.stateNode,R.type,q,z,R)}catch(pe){$c(R,R.return,pe)}}function C6(R){return R.tag===5||R.tag===3||(a2?R.tag===26:!1)||(Bu?R.tag===27&&X6(R.type):!1)||R.tag===4}function Nv(R){e:for(;;){for(;R.sibling===null;){if(R.return===null||C6(R.return))return null;R=R.return}R.sibling.return=R.return;for(R=R.sibling;R.tag!==5&&R.tag!==6&&R.tag!==18;){if(Bu&&R.tag===27&&X6(R.type))continue e;if(R.flags&2)continue e;if(R.child===null||R.tag===4)continue e;else R.child.return=R,R=R.child}if(!(R.flags&2))return R.stateNode}}function Uh(R,z,q){var pe=R.tag;if(pe===5||pe===6)R=R.stateNode,z?rC(q,R,z):oC(q,R);else if(pe!==4&&(Bu&&pe===27&&X6(R.type)&&(q=R.stateNode,z=null),R=R.child,R!==null))for(Uh(R,z,q),R=R.sibling;R!==null;)Uh(R,z,q),R=R.sibling}function b6(R,z,q){var pe=R.tag;if(pe===5||pe===6)R=R.stateNode,z?Jy(q,R,z):Uv(q,R);else if(pe!==4&&(Bu&&pe===27&&X6(R.type)&&(q=R.stateNode),R=R.child,R!==null))for(b6(R,z,q),R=R.sibling;R!==null;)b6(R,z,q),R=R.sibling}function uH(R){if(Bc){for(var z,q=R.return;q!==null;){if(C6(q)){z=q;break}q=q.return}if(z==null)throw Error("Expected to find a host parent. This error is likely caused by a bug in React. Please file an issue.");switch(z.tag){case 27:if(Bu){z=z.stateNode,q=Nv(R),b6(R,q,z);break}case 5:q=z.stateNode,z.flags&32&&(EH(q),z.flags&=-33),z=Nv(R),b6(R,z,q);break;case 3:case 4:z=z.stateNode.containerInfo,q=Nv(R),Uh(R,q,z);break;default:throw Error("Invalid host parent fiber. This error is likely caused by a bug in React. Please file an issue.")}}}function pH(R,z,q){R=R.containerInfo;try{hn(z,iC,R,q)}catch(pe){$c(z,z.return,pe)}}function FT(R){var{stateNode:z,memoizedProps:q}=R;try{hn(R,Lne,R.type,q,z,R)}catch(pe){$c(R,R.return,pe)}}function SU(R,z){CH(R.containerInfo);for(up=z;up!==null;)if(R=up,z=R.child,(R.subtreeFlags&1024)!==0&&z!==null)z.return=R,up=z;else for(;up!==null;){z=R=up;var q=z.alternate,pe=z.flags;switch(z.tag){case 0:break;case 11:case 15:break;case 1:(pe&1024)!==0&&q!==null&&dH(z,q);break;case 3:(pe&1024)!==0&&Bc&&UU(z.stateNode.containerInfo);break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((pe&1024)!==0)throw Error("This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue.")}if(z=R.sibling,z!==null){z.return=R.return,up=z;break}up=R.return}}function zT(R,z,q){var pe=q.flags;switch(q.tag){case 0:case 11:case 15:zg(R,q),pe&4&&Dv(q,F0|Eh);break;case 1:if(zg(R,q),pe&4)if(R=q.stateNode,z===null)q.type.defaultProps||"ref"in q.memoizedProps||VD||(R.props!==q.memoizedProps&&console.error("Expected %s props to match memoized props before componentDidMount. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.",P(q)||"instance"),R.state!==q.memoizedState&&console.error("Expected %s state to match memoized state before componentDidMount. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.",P(q)||"instance")),Hg(q)?(_d(),hn(q,ze,q,R),Ec()):hn(q,ze,q,R);else{var Ce=ef(q.type,z.memoizedProps);z=z.memoizedState,q.type.defaultProps||"ref"in q.memoizedProps||VD||(R.props!==q.memoizedProps&&console.error("Expected %s props to match memoized props before componentDidUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.",P(q)||"instance"),R.state!==q.memoizedState&&console.error("Expected %s state to match memoized state before componentDidUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.",P(q)||"instance")),Hg(q)?(_d(),hn(q,yt,q,R,Ce,z,R.__reactInternalSnapshotBeforeUpdate),Ec()):hn(q,yt,q,R,Ce,z,R.__reactInternalSnapshotBeforeUpdate)}pe&64&&QT(q),pe&512&&Gp(q,q.return);break;case 3:if(z=Lo(),zg(R,q),pe&64&&(pe=q.updateQueue,pe!==null)){if(Ce=null,q.child!==null)switch(q.child.tag){case 27:case 5:Ce=Q6(q.child.stateNode);break;case 1:Ce=q.child.stateNode}try{hn(q,o0,pe,Ce)}catch(ht){$c(q,q.return,ht)}}R.effectDuration+=Gi(z);break;case 27:Bu&&z===null&&pe&4&&FT(q);case 26:case 5:zg(R,q),z===null&&pe&4&&Xs(q),pe&512&&Gp(q,q.return);break;case 12:if(pe&4){pe=Lo(),zg(R,q),R=q.stateNode,R.effectDuration+=bi(pe);try{hn(q,LT,q,z,QE,R.effectDuration)}catch(ht){$c(q,q.return,ht)}}else zg(R,q);break;case 13:zg(R,q),pe&4&&zc(R,q),pe&64&&(R=q.memoizedState,R!==null&&(R=R.dehydrated,R!==null&&(q=sf.bind(null,q),XU(R,q))));break;case 22:if(pe=q.memoizedState!==null||o4,!pe){z=z!==null&&z.memoizedState!==null||fl,Ce=o4;var Te=fl;o4=pe,(fl=z)&&!Te?t2(R,q,(q.subtreeFlags&8772)!==0):zg(R,q),o4=Ce,fl=Te}break;case 30:break;default:zg(R,q)}}function OT(R){var z=R.alternate;z!==null&&(R.alternate=null,OT(z)),R.child=null,R.deletions=null,R.sibling=null,R.tag===5&&(z=R.stateNode,z!==null&&SH(z)),R.stateNode=null,R._debugOwner=null,R.return=null,R.dependencies=null,R.memoizedProps=null,R.memoizedState=null,R.pendingProps=null,R.stateNode=null,R.updateQueue=null}function rf(R,z,q){for(q=q.child;q!==null;)Up(R,z,q),q=q.sibling}function Up(R,z,q){if(jp&&typeof jp.onCommitFiberUnmount==="function")try{jp.onCommitFiberUnmount(lC,q)}catch(Te){c2||(c2=!0,console.error("React instrumentation encountered an error: %s",Te))}switch(q.tag){case 26:if(a2){fl||Fg(q,z),rf(R,z,q),q.memoizedState?aC(q.memoizedState):q.stateNode&&NH(q.stateNode);break}case 27:if(Bu){fl||Fg(q,z);var pe=s0,Ce=m2;X6(q.type)&&(s0=q.stateNode,m2=!1),rf(R,z,q),hn(q,kH,q.stateNode),s0=pe,m2=Ce;break}case 5:fl||Fg(q,z);case 6:if(Bc){if(pe=s0,Ce=m2,s0=null,rf(R,z,q),s0=pe,m2=Ce,s0!==null)if(m2)try{hn(q,F6,s0,q.stateNode)}catch(Te){$c(q,z,Te)}else try{hn(q,PH,s0,q.stateNode)}catch(Te){$c(q,z,Te)}}else rf(R,z,q);break;case 18:Bc&&s0!==null&&(m2?Y6(s0,q.stateNode):bD(s0,q.stateNode));break;case 4:Bc?(pe=s0,Ce=m2,s0=q.stateNode.containerInfo,m2=!0,rf(R,z,q),s0=pe,m2=Ce):(wu&&pH(q.stateNode,q,Ui()),rf(R,z,q));break;case 0:case 11:case 14:case 15:fl||x6(qp,q,z),fl||NT(q,z,F0),rf(R,z,q);break;case 1:fl||(Fg(q,z),pe=q.stateNode,typeof pe.componentWillUnmount==="function"&&kT(q,z,pe)),rf(R,z,q);break;case 21:rf(R,z,q);break;case 22:fl=(pe=fl)||q.memoizedState!==null,rf(R,z,q),fl=pe;break;default:rf(R,z,q)}}function zc(R,z){if(V_&&z.memoizedState===null&&(R=z.alternate,R!==null&&(R=R.memoizedState,R!==null&&(R=R.dehydrated,R!==null))))try{hn(z,TH,R)}catch(q){$c(z,z.return,q)}}function VT(R){switch(R.tag){case 13:case 19:var z=R.stateNode;return z===null&&(z=R.stateNode=new aW),z;case 22:return R=R.stateNode,z=R._retryCache,z===null&&(z=R._retryCache=new aW),z;default:throw Error("Unexpected Suspense handler tag ("+R.tag+"). This is a bug in React.")}}function I6(R,z){var q=VT(R);z.forEach(function(pe){var Ce=DU.bind(null,R,pe);if(!q.has(pe)){if(q.add(pe),l2)if(uI!==null&&nm!==null)Hv(nm,uI);else throw Error("Expected finished root and lanes to be set. This is a bug in React.");pe.then(Ce,Ce)}})}function Ud(R,z){var q=z.deletions;if(q!==null)for(var pe=0;pe<q.length;pe++){var Ce=R,Te=z,ht=q[pe];if(Bc){var Et=Te;e:for(;Et!==null;){switch(Et.tag){case 27:if(Bu){if(X6(Et.type)){s0=Et.stateNode,m2=!1;break e}break}case 5:s0=Et.stateNode,m2=!1;break e;case 3:case 4:s0=Et.stateNode.containerInfo,m2=!0;break e}Et=Et.return}if(s0===null)throw Error("Expected to find a host parent. This error is likely caused by a bug in React. Please file an issue.");Up(Ce,Te,ht),s0=null,m2=!1}else Up(Ce,Te,ht);Ce=ht,Te=Ce.alternate,Te!==null&&(Te.return=null),Ce.return=null}if(z.subtreeFlags&13878)for(z=z.child;z!==null;)U3(z,R),z=z.sibling}function U3(R,z){var q=R.alternate,pe=R.flags;switch(R.tag){case 0:case 11:case 14:case 15:Ud(z,R),Wh(R),pe&4&&(x6(qp|Eh,R,R.return),pE(qp|Eh,R),NT(R,R.return,F0|Eh));break;case 1:Ud(z,R),Wh(R),pe&512&&(fl||q===null||Fg(q,q.return)),pe&64&&o4&&(R=R.updateQueue,R!==null&&(pe=R.callbacks,pe!==null&&(q=R.shared.hiddenCallbacks,R.shared.hiddenCallbacks=q===null?pe:q.concat(pe))));break;case 26:if(a2){var Ce=r4;Ud(z,R),Wh(R),pe&512&&(fl||q===null||Fg(q,q.return)),pe&4&&(pe=q!==null?q.memoizedState:null,z=R.memoizedState,q===null?z===null?R.stateNode===null?R.stateNode=$v(Ce,R.type,R.memoizedProps,R):DH(Ce,R.type,R.stateNode):R.stateNode=vD(Ce,z,R.memoizedProps):pe!==z?(pe===null?q.stateNode!==null&&NH(q.stateNode):aC(pe),z===null?DH(Ce,R.type,R.stateNode):vD(Ce,z,R.memoizedProps)):z===null&&R.stateNode!==null&&Eo(R,R.memoizedProps,q.memoizedProps));break}case 27:if(Bu){Ud(z,R),Wh(R),pe&512&&(fl||q===null||Fg(q,q.return)),q!==null&&pe&4&&Eo(R,R.memoizedProps,q.memoizedProps);break}case 5:if(Ud(z,R),Wh(R),pe&512&&(fl||q===null||Fg(q,q.return)),Bc){if(R.flags&32){z=R.stateNode;try{hn(R,EH,z)}catch(Vo){$c(R,R.return,Vo)}}pe&4&&R.stateNode!=null&&(z=R.memoizedProps,Eo(R,z,q!==null?q.memoizedProps:z)),pe&1024&&(YD=!0,R.type!=="form"&&console.error("Unexpected host component type. Expected a form. This is a bug in React."))}break;case 6:if(Ud(z,R),Wh(R),pe&4&&Bc){if(R.stateNode===null)throw Error("This should have a text node initialized. This error is likely caused by a bug in React. Please file an issue.");pe=R.memoizedProps,q=q!==null?q.memoizedProps:pe,z=R.stateNode;try{hn(R,VU,z,q,pe)}catch(Vo){$c(R,R.return,Vo)}}break;case 3:if(Ce=Lo(),a2){JU();var Te=r4;r4=Zy(z.containerInfo),Ud(z,R),r4=Te}else Ud(z,R);if(Wh(R),pe&4){if(Bc&&V_&&q!==null&&q.memoizedState.isDehydrated)try{hn(R,Kv,z.containerInfo)}catch(Vo){$c(R,R.return,Vo)}if(wu){pe=z.containerInfo,q=z.pendingChildren;try{hn(R,iC,pe,q)}catch(Vo){$c(R,R.return,Vo)}}}YD&&(YD=!1,YT(R)),z.effectDuration+=Gi(Ce);break;case 4:a2?(q=r4,r4=Zy(R.stateNode.containerInfo),Ud(z,R),Wh(R),r4=q):(Ud(z,R),Wh(R)),pe&4&&wu&&pH(R.stateNode,R,R.stateNode.pendingChildren);break;case 12:pe=Lo(),Ud(z,R),Wh(R),R.stateNode.effectDuration+=bi(pe);break;case 13:Ud(z,R),Wh(R),R.child.flags&8192&&R.memoizedState!==null!==(q!==null&&q.memoizedState!==null)&&(Gne=df()),pe&4&&(pe=R.updateQueue,pe!==null&&(R.updateQueue=null,I6(R,pe)));break;case 22:Ce=R.memoizedState!==null;var ht=q!==null&&q.memoizedState!==null,Et=o4,Cn=fl;if(o4=Et||Ce,fl=Cn||ht,Ud(z,R),fl=Cn,o4=Et,Wh(R),pe&8192&&(z=R.stateNode,z._visibility=Ce?z._visibility&-2:z._visibility|1,Ce&&(q===null||ht||o4||fl||g1(R)),Bc)){e:if(q=null,Bc)for(z=R;;){if(z.tag===5||a2&&z.tag===26){if(q===null){ht=q=z;try{Te=ht.stateNode,Ce?hn(ht,MH,Te):hn(ht,r2,ht.stateNode,ht.memoizedProps)}catch(Vo){$c(ht,ht.return,Vo)}}}else if(z.tag===6){if(q===null){ht=z;try{var Kn=ht.stateNode;Ce?hn(ht,GU,Kn):hn(ht,wH,Kn,ht.memoizedProps)}catch(Vo){$c(ht,ht.return,Vo)}}}else if((z.tag!==22&&z.tag!==23||z.memoizedState===null||z===R)&&z.child!==null){z.child.return=z,z=z.child;continue}if(z===R)break e;for(;z.sibling===null;){if(z.return===null||z.return===R)break e;q===z&&(q=null),z=z.return}q===z&&(q=null),z.sibling.return=z.return,z=z.sibling}}pe&4&&(pe=R.updateQueue,pe!==null&&(q=pe.retryQueue,q!==null&&(pe.retryQueue=null,I6(R,q))));break;case 19:Ud(z,R),Wh(R),pe&4&&(pe=R.updateQueue,pe!==null&&(R.updateQueue=null,I6(R,pe)));break;case 30:break;case 21:break;default:Ud(z,R),Wh(R)}}function Wh(R){var z=R.flags;if(z&2){try{hn(R,uH,R)}catch(q){$c(R,R.return,q)}R.flags&=-3}z&4096&&(R.flags&=-4097)}function YT(R){if(R.subtreeFlags&1024)for(R=R.child;R!==null;){var z=R;YT(z),z.tag===5&&z.flags&1024&&o2(z.stateNode),R=R.sibling}}function zg(R,z){if(z.subtreeFlags&8772)for(z=z.child;z!==null;)zT(R,z.alternate,z),z=z.sibling}function GT(R){switch(R.tag){case 0:case 11:case 14:case 15:NT(R,R.return,F0),g1(R);break;case 1:Fg(R,R.return);var z=R.stateNode;typeof z.componentWillUnmount==="function"&&kT(R,R.return,z),g1(R);break;case 27:Bu&&hn(R,kH,R.stateNode);case 26:case 5:Fg(R,R.return),g1(R);break;case 22:R.memoizedState===null&&g1(R);break;case 30:g1(R);break;default:g1(R)}}function g1(R){for(R=R.child;R!==null;)GT(R),R=R.sibling}function UT(R,z,q,pe){var Ce=q.flags;switch(q.tag){case 0:case 11:case 15:t2(R,q,pe),Dv(q,F0);break;case 1:if(t2(R,q,pe),z=q.stateNode,typeof z.componentDidMount==="function"&&hn(q,ze,q,z),z=q.updateQueue,z!==null){R=q.stateNode;try{hn(q,u6,z,R)}catch(Te){$c(q,q.return,Te)}}pe&&Ce&64&&QT(q),Gp(q,q.return);break;case 27:Bu&&FT(q);case 26:case 5:t2(R,q,pe),pe&&z===null&&Ce&4&&Xs(q),Gp(q,q.return);break;case 12:if(pe&&Ce&4){Ce=Lo(),t2(R,q,pe),pe=q.stateNode,pe.effectDuration+=bi(Ce);try{hn(q,LT,q,z,QE,pe.effectDuration)}catch(Te){$c(q,q.return,Te)}}else t2(R,q,pe);break;case 13:t2(R,q,pe),pe&&Ce&4&&zc(R,q);break;case 22:q.memoizedState===null&&t2(R,q,pe),Gp(q,q.return);break;case 30:break;default:t2(R,q,pe)}}function t2(R,z,q){q=q&&(z.subtreeFlags&8772)!==0;for(z=z.child;z!==null;)UT(R,z.alternate,z,q),z=z.sibling}function _l(R,z){var q=null;R!==null&&R.memoizedState!==null&&R.memoizedState.cachePool!==null&&(q=R.memoizedState.cachePool.pool),R=null,z.memoizedState!==null&&z.memoizedState.cachePool!==null&&(R=z.memoizedState.cachePool.pool),R!==q&&(R!=null&&Ys(R),q!=null&&aa(q))}function v6(R,z){R=null,z.alternate!==null&&(R=z.alternate.memoizedState.cache),z=z.memoizedState.cache,z!==R&&(Ys(z),R!=null&&aa(R))}function A1(R,z,q,pe){if(z.subtreeFlags&10256)for(z=z.child;z!==null;)R0(R,z,q,pe),z=z.sibling}function R0(R,z,q,pe){var Ce=z.flags;switch(z.tag){case 0:case 11:case 15:A1(R,z,q,pe),Ce&2048&&RT(z,hh|Eh);break;case 1:A1(R,z,q,pe);break;case 3:var Te=Lo();A1(R,z,q,pe),Ce&2048&&(q=null,z.alternate!==null&&(q=z.alternate.memoizedState.cache),z=z.memoizedState.cache,z!==q&&(Ys(z),q!=null&&aa(q))),R.passiveEffectDuration+=Gi(Te);break;case 12:if(Ce&2048){Ce=Lo(),A1(R,z,q,pe),R=z.stateNode,R.passiveEffectDuration+=bi(Ce);try{hn(z,HT,z,z.alternate,QE,R.passiveEffectDuration)}catch(Et){$c(z,z.return,Et)}}else A1(R,z,q,pe);break;case 13:A1(R,z,q,pe);break;case 23:break;case 22:Te=z.stateNode;var ht=z.alternate;z.memoizedState!==null?Te._visibility&2?A1(R,z,q,pe):S6(R,z):Te._visibility&2?A1(R,z,q,pe):(Te._visibility|=2,f1(R,z,q,pe,(z.subtreeFlags&10256)!==0)),Ce&2048&&_l(ht,z);break;case 24:A1(R,z,q,pe),Ce&2048&&v6(z.alternate,z);break;default:A1(R,z,q,pe)}}function f1(R,z,q,pe,Ce){Ce=Ce&&(z.subtreeFlags&10256)!==0;for(z=z.child;z!==null;)WT(R,z,q,pe,Ce),z=z.sibling}function WT(R,z,q,pe,Ce){var Te=z.flags;switch(z.tag){case 0:case 11:case 15:f1(R,z,q,pe,Ce),RT(z,hh);break;case 23:break;case 22:var ht=z.stateNode;z.memoizedState!==null?ht._visibility&2?f1(R,z,q,pe,Ce):S6(R,z):(ht._visibility|=2,f1(R,z,q,pe,Ce)),Ce&&Te&2048&&_l(z.alternate,z);break;case 24:f1(R,z,q,pe,Ce),Ce&&Te&2048&&v6(z.alternate,z);break;default:f1(R,z,q,pe,Ce)}}function S6(R,z){if(z.subtreeFlags&10256)for(z=z.child;z!==null;){var q=R,pe=z,Ce=pe.flags;switch(pe.tag){case 22:S6(q,pe),Ce&2048&&_l(pe.alternate,pe);break;case 24:S6(q,pe),Ce&2048&&v6(pe.alternate,pe);break;default:S6(q,pe)}z=z.sibling}}function H5(R){if(R.subtreeFlags&I8)for(R=R.child;R!==null;)W3(R),R=R.sibling}function W3(R){switch(R.tag){case 26:H5(R),R.flags&I8&&(R.memoizedState!==null?RH(r4,R.memoizedState,R.memoizedProps):Gv(R.type,R.memoizedProps));break;case 5:H5(R),R.flags&I8&&Gv(R.type,R.memoizedProps);break;case 3:case 4:if(a2){var z=r4;r4=Zy(R.stateNode.containerInfo),H5(R),r4=z}else H5(R);break;case 22:R.memoizedState===null&&(z=R.alternate,z!==null&&z.memoizedState!==null?(z=I8,I8=16777216,H5(R),I8=z):H5(R));break;default:H5(R)}}function XT(R){var z=R.alternate;if(z!==null&&(R=z.child,R!==null)){z.child=null;do z=R.sibling,R.sibling=null,R=z;while(R!==null)}}function X3(R){var z=R.deletions;if((R.flags&16)!==0){if(z!==null)for(var q=0;q<z.length;q++){var pe=z[q];up=pe,mH(pe,R)}XT(R)}if(R.subtreeFlags&10256)for(R=R.child;R!==null;)PU(R),R=R.sibling}function PU(R){switch(R.tag){case 0:case 11:case 15:X3(R),R.flags&2048&&mE(R,R.return,hh|Eh);break;case 3:var z=Lo();X3(R),R.stateNode.passiveEffectDuration+=Gi(z);break;case 12:z=Lo(),X3(R),R.stateNode.passiveEffectDuration+=bi(z);break;case 22:z=R.stateNode,R.memoizedState!==null&&z._visibility&2&&(R.return===null||R.return.tag!==13)?(z._visibility&=-3,_E(R)):X3(R);break;default:X3(R)}}function _E(R){var z=R.deletions;if((R.flags&16)!==0){if(z!==null)for(var q=0;q<z.length;q++){var pe=z[q];up=pe,mH(pe,R)}XT(R)}for(R=R.child;R!==null;)jT(R),R=R.sibling}function jT(R){switch(R.tag){case 0:case 11:case 15:mE(R,R.return,hh),_E(R);break;case 22:var z=R.stateNode;z._visibility&2&&(z._visibility&=-3,_E(R));break;default:_E(R)}}function mH(R,z){for(;up!==null;){var q=up,pe=q;switch(pe.tag){case 0:case 11:case 15:mE(pe,z,hh);break;case 23:case 22:pe.memoizedState!==null&&pe.memoizedState.cachePool!==null&&(pe=pe.memoizedState.cachePool.pool,pe!=null&&Ys(pe));break;case 24:aa(pe.memoizedState.cache)}if(pe=q.child,pe!==null)pe.return=q,up=pe;else e:for(q=R;up!==null;){pe=up;var Ce=pe.sibling,Te=pe.return;if(OT(pe),pe===q){up=null;break e}if(Ce!==null){Ce.return=Te,up=Ce;break e}up=Te}}}function P6(R){var z=gD(R);if(z!=null){if(typeof z.memoizedProps["data-testname"]!=="string")throw Error("Invalid host root specified. Should be either a React container or a node with a testname attribute.");return z}if(R=lf(R),R===null)throw Error("Could not find React container within specified host subtree.");return R.stateNode.current}function KT(R,z){var q=R.tag;switch(z.$$typeof){case ZH:if(R.type===z.value)return!0;break;case cW:e:{z=z.value,R=[R,0];for(q=0;q<R.length;){var pe=R[q++],Ce=pe.tag,Te=R[q++],ht=z[Te];if(Ce!==5&&Ce!==26&&Ce!==27||!Wp(pe)){for(;ht!=null&&KT(pe,ht);)Te++,ht=z[Te];if(Te===z.length){z=!0;break e}else for(pe=pe.child;pe!==null;)R.push(pe,Te),pe=pe.sibling}}z=!1}return z;case a0:if((q===5||q===26||q===27)&&Vg(R.stateNode,z.value))return!0;break;case Dc:if(q===5||q===6||q===26||q===27){if(R=jd(R),R!==null&&0<=R.indexOf(z.value))return!0}break;case Vn:if(q===5||q===26||q===27){if(R=R.memoizedProps["data-testname"],typeof R==="string"&&R.toLowerCase()===z.value.toLowerCase())return!0}break;default:throw Error("Invalid selector type specified.")}return!1}function $T(R){switch(R.$$typeof){case ZH:return"<"+(v(R.value)||"Unknown")+">";case cW:return":has("+($T(R)||"")+")";case a0:return'[role="'+R.value+'"]';case Dc:return'"'+R.value+'"';case Vn:return'[data-testname="'+R.value+'"]';default:throw Error("Invalid selector type specified.")}}function E6(R,z){var q=[];R=[R,0];for(var pe=0;pe<R.length;){var Ce=R[pe++],Te=Ce.tag,ht=R[pe++],Et=z[ht];if(Te!==5&&Te!==26&&Te!==27||!Wp(Ce)){for(;Et!=null&&KT(Ce,Et);)ht++,Et=z[ht];if(ht===z.length)q.push(Ce);else for(Ce=Ce.child;Ce!==null;)R.push(Ce,ht),Ce=Ce.sibling}}return q}function M6(R,z){if(!bd)throw Error("Test selector API is not supported by this renderer.");R=P6(R),R=E6(R,z),z=[],R=Array.from(R);for(var q=0;q<R.length;){var pe=R[q++],Ce=pe.tag;if(Ce===5||Ce===26||Ce===27)Wp(pe)||z.push(pe.stateNode);else for(pe=pe.child;pe!==null;)R.push(pe),pe=pe.sibling}return z}function EU(){bd&&GD.forEach(function(R){return R()})}function MU(){var R=typeof IS_REACT_ACT_ENVIRONMENT<"u"?IS_REACT_ACT_ENVIRONMENT:void 0;return R||kn.actQueue===null||console.error("The current testing environment is not configured to support act(...)"),R}function Lm(R){if((Za&Qu)!==Ru&&va!==0)return va&-va;var z=kn.T;return z!==null?(z._updatedFibers||(z._updatedFibers=new Set),z._updatedFibers.add(R),R=nI,R!==0?R:n0()):IH()}function w6(){ph===0&&(ph=(va&536870912)===0||Ra?U():536870912);var R=Zp.current;return R!==null&&(R.flags|=32),ph}function xd(R,z,q){if(WE&&console.error("useInsertionEffect must not schedule updates."),Nc&&(pW=!0),R===uh&&(Ki===pI||Ki===UE)||R.cancelPendingCommit!==null)q3(R,0),K3(R,va,ph,!1);if(X(R,q),(Za&Qu)!==0&&R===uh){if(pf)switch(z.tag){case 0:case 11:case 15:R=Ia&&P(Ia)||"Unknown",jne.has(R)||(jne.add(R),z=P(z)||"Unknown",console.error("Cannot update a component (`%s`) while rendering a different component (`%s`). To locate the bad setState() call inside `%s`, follow the stack trace as described in https://react.dev/link/setstate-in-render",z,R,R));break;case 1:Xne||(console.error("Cannot update during an existing state transition (such as within `render`). Render methods should be a pure function of props and state."),Xne=!0)}}else l2&&ne(R,z,q),Z3(z),R===uh&&((Za&Qu)===Ru&&(B8|=q),Jd===S8&&K3(R,va,ph,!1)),Jo(R)}function j3(R,z,q){if((Za&(Qu|Wg))!==Ru)throw Error("Should not already be working.");var pe=!q&&(z&124)===0&&(z&R.expiredLanes)===0||V(R,z),Ce=pe?Lv(R,z):Qv(R,z,!0),Te=pe;do{if(Ce===Xg){E8&&!pe&&K3(R,z,0,!1);break}else{if(q=R.current.alternate,Te&&!qT(q)){Ce=Qv(R,z,!1),Te=!1;continue}if(Ce===bC){if(Te=z,R.errorRecoveryDisabledLanes&Te)var ht=0;else ht=R.pendingLanes&-536870913,ht=ht!==0?ht:ht&536870912?536870912:0;if(ht!==0){z=ht;e:{Ce=R;var Et=ht;ht=g2;var Cn=V_&&Ce.current.memoizedState.isDehydrated;if(Cn&&(q3(Ce,Et).flags|=256),Et=Qv(Ce,Et,!1),Et!==bC){if(M8&&!Cn){Ce.errorRecoveryDisabledLanes|=Te,B8|=Te,Ce=S8;break e}Ce=Wl,Wl=ht,Ce!==null&&(Wl===null?Wl=Ce:Wl.push.apply(Wl,Ce))}Ce=Et}if(Te=!1,Ce!==bC)continue}}if(Ce===v8){q3(R,0),K3(R,z,0,!0);break}e:{switch(pe=R,Ce){case Xg:case v8:throw Error("Root did not complete. This is a bug in React.");case S8:if((z&4194048)!==z)break;case tF:K3(pe,z,ph,!IC);break e;case bC:Wl=null;break;case lW:case Vne:break;default:throw Error("Unknown root exit status.")}if(kn.actQueue!==null)fE(pe,q,z,Wl,om,hW,ph,B8,jg);else{if((z&62914560)===z&&(Te=Gne+oF-df(),10<Te)){if(K3(pe,z,ph,!IC),H(pe,0,!0)!==0)break e;pe.timeoutHandle=kne(F_.bind(null,pe,q,Wl,om,hW,z,ph,B8,jg,IC,Ce,mI,-0,0),Te);break e}F_(pe,q,Wl,om,hW,z,ph,B8,jg,IC,Ce,SC,-0,0)}}}break}while(1);Jo(R)}function F_(R,z,q,pe,Ce,Te,ht,Et,Cn,Kn,Vo,jo,yr,$i){if(R.timeoutHandle=L6,jo=z.subtreeFlags,jo&8192||(jo&16785408)===16785408){if(fD(),W3(z),jo=zU(),jo!==null){R.cancelPendingCommit=jo(fE.bind(null,R,z,Te,q,pe,Ce,ht,Et,Cn,Vo,dW,yr,$i)),K3(R,Te,ht,!Kn);return}}fE(R,z,Te,q,pe,Ce,ht,Et,Cn)}function qT(R){for(var z=R;;){var q=z.tag;if((q===0||q===11||q===15)&&z.flags&16384&&(q=z.updateQueue,q!==null&&(q=q.stores,q!==null)))for(var pe=0;pe<q.length;pe++){var Ce=q[pe],Te=Ce.getSnapshot;Ce=Ce.value;try{if(!Kp(Te(),Ce))return!1}catch(ht){return!1}}if(q=z.child,z.subtreeFlags&16384&&q!==null)q.return=z,z=q;else{if(z===R)break;for(;z.sibling===null;){if(z.return===null||z.return===R)return!0;z=z.return}z.sibling.return=z.return,z=z.sibling}}return!0}function K3(R,z,q,pe){z&=~T8,z&=~B8,R.suspendedLanes|=z,R.pingedLanes&=~z,pe&&(R.warmLanes|=z),pe=R.expirationTimes;for(var Ce=z;0<Ce;){var Te=31-Fm(Ce),ht=1<<Te;pe[Te]=-1,Ce&=~ht}q!==0&&J(R,q,z)}function B6(){return(Za&(Qu|Wg))===Ru?(zr(0,!1),!1):!0}function $3(){if(Ia!==null){if(Ki===gf)var R=Ia.return;else R=Ia,$n(),xv(R),kr=null,Cr=0,R=Ia;for(;R!==null;)uE(R.alternate,R),R=R.return;Ia=null}}function q3(R,z){var q=R.timeoutHandle;q!==L6&&(R.timeoutHandle=L6,FU(q)),q=R.cancelPendingCommit,q!==null&&(R.cancelPendingCommit=null,q()),$3(),uh=R,Ia=q=Ky(R.current,null),va=z,Ki=gf,N1=null,IC=!1,E8=V(R,z),M8=!1,Jd=Xg,jg=ph=T8=B8=w8=0,Wl=g2=null,hW=!1,(z&8)!==0&&(z|=z&32);var pe=R.entangledLanes;if(pe!==0)for(R=R.entanglements,pe&=z;0<pe;){var Ce=31-Fm(pe),Te=1<<Ce;z|=R[Ce],pe&=~Te}return vC=z,ah(),z=hp(),1000<z-qc&&(kn.recentlyCreatedOwnerStacks=0,qc=z),u2.discardPendingWarnings(),q}function _H(R,z){Wi=null,kn.H=y8,kn.getCurrentStack=null,pf=!1,Yg=null,z===_8||z===kE?(z=vs(),Ki=K_):z===ND?(z=vs(),Ki=i4):Ki=z===D1?Yne:z!==null&&typeof z==="object"&&typeof z.then==="function"?P8:GE,N1=z;var q=Ia;if(q===null)Jd=v8,g6(R,rt(z,R.current));else switch(q.mode&2&&Lc(q),me(),Ki){case GE:gr!==null&&typeof gr.markComponentErrored==="function"&&gr.markComponentErrored(q,z,va);break;case pI:case UE:case K_:case P8:case nF:gr!==null&&typeof gr.markComponentSuspended==="function"&&gr.markComponentSuspended(q,z,va)}}function JT(){var R=Zp.current;return R===null?!0:(va&4194048)===va?T1===null?!0:!1:(va&62914560)===va||(va&536870912)!==0?R===T1:!1}function gE(){var R=kn.H;return kn.H=y8,R===null?y8:R}function ZT(){var R=kn.A;return kn.A=uTe,R}function Rv(){Jd=S8,IC||(va&4194048)!==va&&Zp.current!==null||(E8=!0),(w8&134217727)===0&&(B8&134217727)===0||uh===null||K3(uh,va,ph,!1)}function Qv(R,z,q){var pe=Za;Za|=Qu;var Ce=gE(),Te=ZT();if(uh!==R||va!==z){if(l2){var ht=R.memoizedUpdaters;0<ht.size&&(Hv(R,va),ht.clear()),re(R,z)}om=null,q3(R,z)}ge(z),z=!1,ht=Jd;e:do try{if(Ki!==gf&&Ia!==null){var Et=Ia,Cn=N1;switch(Ki){case Yne:$3(),ht=tF;break e;case K_:case pI:case UE:case P8:Zp.current===null&&(z=!0);var Kn=Ki;if(Ki=gf,N1=null,F5(R,Et,Cn,Kn),q&&E8){ht=Xg;break e}break;default:Kn=Ki,Ki=gf,N1=null,F5(R,Et,Cn,Kn)}}kv(),ht=Jd;break}catch(Vo){_H(R,Vo)}while(1);return z&&R.shellSuspendCounter++,$n(),Za=pe,kn.H=Ce,kn.A=Te,xe(),Ia===null&&(uh=null,va=0,ah()),ht}function kv(){for(;Ia!==null;)eD(Ia)}function Lv(R,z){var q=Za;Za|=Qu;var pe=gE(),Ce=ZT();if(uh!==R||va!==z){if(l2){var Te=R.memoizedUpdaters;0<Te.size&&(Hv(R,va),Te.clear()),re(R,z)}om=null,D8=df()+UD,q3(R,z)}else E8=V(R,z);ge(z);e:do try{if(Ki!==gf&&Ia!==null)t:switch(z=Ia,Te=N1,Ki){case GE:Ki=gf,N1=null,F5(R,z,Te,GE);break;case pI:case UE:if(Zr(Te)){Ki=gf,N1=null,tD(z);break}z=function(){Ki!==pI&&Ki!==UE||uh!==R||(Ki=nF),Jo(R)},Te.then(z,z);break e;case K_:Ki=nF;break e;case i4:Ki=_2;break e;case nF:Zr(Te)?(Ki=gf,N1=null,tD(z)):(Ki=gf,N1=null,F5(R,z,Te,nF));break;case _2:var ht=null;switch(Ia.tag){case 26:ht=Ia.memoizedState;case 5:case 27:var Et=Ia,{type:Cn,pendingProps:Kn}=Et;if(ht?BE(ht):Yv(Cn,Kn)){Ki=gf,N1=null;var Vo=Et.sibling;if(Vo!==null)Ia=Vo;else{var jo=Et.return;jo!==null?(Ia=jo,AE(jo)):Ia=null}break t}break;default:console.error("Unexpected type of fiber triggered a suspensey commit. This is a bug in React.")}Ki=gf,N1=null,F5(R,z,Te,_2);break;case P8:Ki=gf,N1=null,F5(R,z,Te,P8);break;case Yne:$3(),Jd=tF;break e;default:throw Error("Unexpected SuspendedReason. This is a bug in React.")}kn.actQueue!==null?kv():wU();break}catch(yr){_H(R,yr)}while(1);if($n(),kn.H=pe,kn.A=Ce,Za=q,Ia!==null)return gr!==null&&typeof gr.markRenderYielded==="function"&&gr.markRenderYielded(),Xg;return xe(),uh=null,va=0,ah(),Jd}function wU(){for(;Ia!==null&&!Zv();)eD(Ia)}function eD(R){var z=R.alternate;(R.mode&2)!==Jc?(os(R),z=hn(R,jy,z,R,vC),Lc(R)):z=hn(R,jy,z,R,vC),R.memoizedProps=R.pendingProps,z===null?AE(R):Ia=z}function tD(R){var z=hn(R,nD,R);R.memoizedProps=R.pendingProps,z===null?AE(R):Ia=z}function nD(R){var z=R.alternate,q=(R.mode&2)!==Jc;switch(q&&os(R),R.tag){case 15:case 0:z=A6(z,R,R.pendingProps,R.type,void 0,va);break;case 11:z=A6(z,R,R.pendingProps,R.type.render,R.ref,va);break;case 5:xv(R);default:uE(z,R),R=Ia=i0(R,vC),z=jy(z,R,vC)}return q&&Lc(R),z}function F5(R,z,q,pe){$n(),xv(z),kr=null,Cr=0;var Ce=z.return;try{if(p1(R,Ce,z,q,va)){Jd=v8,g6(R,rt(q,R.current)),Ia=null;return}}catch(Te){if(Ce!==null)throw Ia=Ce,Te;Jd=v8,g6(R,rt(q,R.current)),Ia=null;return}if(z.flags&32768){if(Ra||pe===GE)R=!0;else if(E8||(va&536870912)!==0)R=!1;else if(IC=R=!0,pe===pI||pe===UE||pe===K_||pe===P8)pe=Zp.current,pe!==null&&pe.tag===13&&(pe.flags|=16384);oD(z,R)}else AE(z)}function AE(R){var z=R;do{if((z.flags&32768)!==0){oD(z,IC);return}var q=z.alternate;if(R=z.return,os(z),q=hn(z,V3,q,z,vC),(z.mode&2)!==Jc&&dl(z),q!==null){Ia=q;return}if(z=z.sibling,z!==null){Ia=z;return}Ia=z=R}while(z!==null);Jd===Xg&&(Jd=Vne)}function oD(R,z){do{var q=dE(R.alternate,R);if(q!==null){q.flags&=32767,Ia=q;return}if((R.mode&2)!==Jc){dl(R),q=R.actualDuration;for(var pe=R.child;pe!==null;)q+=pe.actualDuration,pe=pe.sibling;R.actualDuration=q}if(q=R.return,q!==null&&(q.flags|=32768,q.subtreeFlags=0,q.deletions=null),!z&&(R=R.sibling,R!==null)){Ia=R;return}Ia=R=q}while(R!==null);Jd=tF,Ia=null}function fE(R,z,q,pe,Ce,Te,ht,Et,Cn){R.cancelPendingCommit=null;do J3();while(Gm!==ku);if(u2.flushLegacyContextWarning(),u2.flushPendingUnsafeLifecycleWarnings(),(Za&(Qu|Wg))!==Ru)throw Error("Should not already be working.");if(gr!==null&&typeof gr.markCommitStarted==="function"&&gr.markCommitStarted(q),z===null)ue();else{if(q===0&&console.error("finishedLanes should not be empty during a commit. This is a bug in React."),z===R.current)throw Error("Cannot commit the same tree as before. This error is likely caused by a bug in React. Please file an issue.");if(Te=z.lanes|z.childLanes,Te|=LE,K(R,q,Te,ht,Et,Cn),R===uh&&(Ia=uh=null,va=0),gI=z,ix=R,AI=q,fI=Te,rF=Ce,T_e=pe,(z.subtreeFlags&10256)!==0||(z.flags&10256)!==0?(R.callbackNode=null,R.callbackPriority=0,T6(e8,function(){return rD(!0),null})):(R.callbackNode=null,R.callbackPriority=0),QE=eI(),pe=(z.flags&13878)!==0,(z.subtreeFlags&13878)!==0||pe){pe=kn.T,kn.T=null,Ce=b1(),Xd(2),ht=Za,Za|=Wg;try{SU(R,z,q)}finally{Za=ht,Xd(Ce),kn.T=pe}}Gm=Kg,gH(),yE(),AH()}}function gH(){if(Gm===Kg){Gm=ku;var R=ix,z=gI,q=AI,pe=(z.flags&13878)!==0;if((z.subtreeFlags&13878)!==0||pe){pe=kn.T,kn.T=null;var Ce=b1();Xd(2);var Te=Za;Za|=Wg;try{uI=q,nm=R,U3(z,R),nm=uI=null,SE(R.containerInfo)}finally{Za=Te,Xd(Ce),kn.T=pe}}R.current=z,Gm=_I}}function yE(){if(Gm===_I){Gm=ku;var R=ix,z=gI,q=AI,pe=(z.flags&8772)!==0;if((z.subtreeFlags&8772)!==0||pe){pe=kn.T,kn.T=null;var Ce=b1();Xd(2);var Te=Za;Za|=Wg;try{gr!==null&&typeof gr.markLayoutEffectsStarted==="function"&&gr.markLayoutEffectsStarted(q),uI=q,nm=R,zT(R,z.alternate,z),nm=uI=null,gr!==null&&typeof gr.markLayoutEffectsStopped==="function"&&gr.markLayoutEffectsStopped()}finally{Za=Te,Xd(Ce),kn.T=pe}}Gm=Une}}function AH(){if(Gm===pTe||Gm===Une){Gm=ku,FH();var R=ix,z=gI,q=AI,pe=T_e,Ce=(z.subtreeFlags&10256)!==0||(z.flags&10256)!==0;Ce?Gm=Wne:(Gm=ku,gI=ix=null,z5(R,R.pendingLanes),N8=0,XD=null);var Te=R.pendingLanes;if(Te===0&&(Ym=null),Ce||lD(R),Ce=Z(q),z=z.stateNode,jp&&typeof jp.onCommitFiberRoot==="function")try{var ht=(z.current.flags&128)===128;switch(Ce){case 2:var Et=E1;break;case 8:Et=PD;break;case 32:Et=e8;break;case 268435456:Et=Tc;break;default:Et=e8}jp.onCommitFiberRoot(lC,z,Et,ht)}catch(jo){c2||(c2=!0,console.error("React instrumentation encountered an error: %s",jo))}if(l2&&R.memoizedUpdaters.clear(),EU(),pe!==null){ht=kn.T,Et=b1(),Xd(2),kn.T=null;try{var Cn=R.onRecoverableError;for(z=0;z<pe.length;z++){var Kn=pe[z],Vo=BU(Kn.stack);hn(Kn.source,Cn,Kn.value,Vo)}}finally{kn.T=ht,Xd(Et)}}(AI&3)!==0&&J3(),Jo(R),Te=R.pendingLanes,(q&4194090)!==0&&(Te&42)!==0?(BD=!0,R===uW?WD++:(WD=0,uW=R)):WD=0,zr(0,!1),ue()}}function BU(R){return R={componentStack:R},Object.defineProperty(R,"digest",{get:function(){console.error('You are accessing "digest" from the errorInfo object passed to onRecoverableError. This property is no longer provided as part of errorInfo but can be accessed as a property of the Error instance itself.')}}),R}function z5(R,z){(R.pooledCacheLanes&=z)===0&&(z=R.pooledCache,z!=null&&(R.pooledCache=null,aa(z)))}function J3(R){return gH(),yE(),AH(),rD(R)}function rD(){if(Gm!==Wne)return!1;var R=ix,z=fI;fI=0;var q=Z(AI),pe=32>q?32:q;q=kn.T;var Ce=b1();try{Xd(pe),kn.T=null,pe=rF,rF=null;var Te=ix,ht=AI;if(Gm=ku,gI=ix=null,AI=0,(Za&(Qu|Wg))!==Ru)throw Error("Cannot flush passive effects while already rendering.");Nc=!0,pW=!1,gr!==null&&typeof gr.markPassiveEffectsStarted==="function"&&gr.markPassiveEffectsStarted(ht);var Et=Za;if(Za|=Wg,PU(Te.current),R0(Te,Te.current,ht,pe),gr!==null&&typeof gr.markPassiveEffectsStopped==="function"&&gr.markPassiveEffectsStopped(),lD(Te),Za=Et,zr(0,!1),pW?Te===XD?N8++:(N8=0,XD=Te):N8=0,pW=Nc=!1,jp&&typeof jp.onPostCommitFiberRoot==="function")try{jp.onPostCommitFiberRoot(lC,Te)}catch(Kn){c2||(c2=!0,console.error("React instrumentation encountered an error: %s",Kn))}var Cn=Te.current.stateNode;return Cn.effectDuration=0,Cn.passiveEffectDuration=0,!0}finally{Xd(Ce),kn.T=q,z5(R,z)}}function TU(R,z,q){z=rt(q,z),z=Qm(R.stateNode,z,2),R=Dm(R,z,2),R!==null&&(X(R,2),Jo(R))}function $c(R,z,q){if(WE=!1,R.tag===3)TU(R,R,q);else{for(;z!==null;){if(z.tag===3){TU(z,R,q);return}if(z.tag===1){var pe=z.stateNode;if(typeof z.type.getDerivedStateFromError==="function"||typeof pe.componentDidCatch==="function"&&(Ym===null||!Ym.has(pe))){R=rt(q,R),q=e2(2),pe=Dm(z,q,2),pe!==null&&(tf(q,pe,z,R),X(pe,2),Jo(pe));return}}z=z.return}console.error(`Internal React error: Attempted to capture a commit phase error inside a detached tree. This indicates a bug in React. Potential causes include deleting the same fiber more than once, committing an already-finished tree, or an inconsistent return pointer.

Error message:

%s`,q)}}function iD(R,z,q){var pe=R.pingCache;if(pe===null){pe=R.pingCache=new One;var Ce=new Set;pe.set(z,Ce)}else Ce=pe.get(z),Ce===void 0&&(Ce=new Set,pe.set(z,Ce));Ce.has(q)||(M8=!0,Ce.add(q),pe=xE.bind(null,R,z,q),l2&&Hv(R,q),z.then(pe,pe))}function xE(R,z,q){var pe=R.pingCache;pe!==null&&pe.delete(z),R.pingedLanes|=R.suspendedLanes&q,R.warmLanes&=~q,MU()&&kn.actQueue===null&&console.error(`A suspended resource finished loading inside a test, but the event was not wrapped in act(...).

When testing, code that resolves suspended data should be wrapped into act(...):

act(() => {
  /* finish loading suspended data */
});
/* assert on the output */

This ensures that you're testing the behavior the user would see in the browser. Learn more at https://react.dev/link/wrap-tests-with-act`),uh===R&&(va&q)===q&&(Jd===S8||Jd===lW&&(va&62914560)===va&&df()-Gne<oF?(Za&Qu)===Ru&&q3(R,0):T8|=q,jg===va&&(jg=0)),Jo(R)}function sD(R,z){z===0&&(z=j()),R=Su(R,z),R!==null&&(X(R,z),Jo(R))}function sf(R){var z=R.memoizedState,q=0;z!==null&&(q=z.retryLane),sD(R,q)}function DU(R,z){var q=0;switch(R.tag){case 13:var{stateNode:pe,memoizedState:Ce}=R;Ce!==null&&(q=Ce.retryLane);break;case 19:pe=R.stateNode;break;case 22:pe=R.stateNode._retryCache;break;default:throw Error("Pinged unknown suspense boundary type. This is probably a bug in React.")}pe!==null&&pe.delete(z),sD(R,q)}function aD(R,z,q){if((z.subtreeFlags&67117056)!==0)for(z=z.child;z!==null;){var pe=R,Ce=z,Te=Ce.type===O_;Te=q||Te,Ce.tag!==22?Ce.flags&67108864?Te&&hn(Ce,cD,pe,Ce,(Ce.mode&64)===Jc):aD(pe,Ce,Te):Ce.memoizedState===null&&(Te&&Ce.flags&8192?hn(Ce,cD,pe,Ce):Ce.subtreeFlags&67108864&&hn(Ce,aD,pe,Ce,Te)),z=z.sibling}}function cD(R,z){var q=2<arguments.length&&arguments[2]!==void 0?arguments[2]:!0;ie(!0);try{GT(z),q&&jT(z),UT(R,z.alternate,z,!1),q&&WT(R,z,0,null,!1,0)}finally{ie(!1)}}function lD(R){var z=!0;R.current.mode&24||(z=!1),aD(R,R.current,z)}function fH(R){if((Za&Qu)===Ru){var z=R.tag;if(z===3||z===1||z===0||z===11||z===14||z===15){if(z=P(R)||"ReactComponent",iF!==null){if(iF.has(z))return;iF.add(z)}else iF=new Set([z]);hn(R,function(){console.error("Can't perform a React state update on a component that hasn't mounted yet. This indicates that you have a side-effect in your render function that asynchronously later calls tries to update the component. Move this work to useEffect instead.")})}}}function Hv(R,z){l2&&R.memoizedUpdaters.forEach(function(q){ne(R,q,z)})}function T6(R,z){var q=kn.actQueue;return q!==null?(q.push(z),N_e):Jv(R,z)}function Z3(R){MU()&&kn.actQueue===null&&hn(R,function(){console.error(`An update to %s inside a test was not wrapped in act(...).

When testing, code that causes React state updates should be wrapped into act(...):

act(() => {
  /* fire events that update state */
});
/* assert on the output */

This ensures that you're testing the behavior the user would see in the browser. Learn more at https://react.dev/link/wrap-tests-with-act`,P(R))})}function eC(R){if(R1===null)return R;var z=R1(R);return z===void 0?R:z.current}function hD(R){if(R1===null)return R;var z=R1(R);return z===void 0?R!==null&&R!==void 0&&typeof R.render==="function"&&(z=eC(R.render),R.render!==z)?(z={$$typeof:R6,render:z},R.displayName!==void 0&&(z.displayName=R.displayName),z):R:z.current}function Fv(R,z){if(R1===null)return!1;var q=R.elementType;z=z.type;var pe=!1,Ce=typeof z==="object"&&z!==null?z.$$typeof:null;switch(R.tag){case 1:typeof z==="function"&&(pe=!0);break;case 0:typeof z==="function"?pe=!0:Ce===af&&(pe=!0);break;case 11:Ce===R6?pe=!0:Ce===af&&(pe=!0);break;case 14:case 15:Ce===Ai?pe=!0:Ce===af&&(pe=!0);break;default:return!1}return pe&&(R=R1(q),R!==void 0&&R===R1(z))?!0:!1}function yH(R){R1!==null&&typeof WeakSet==="function"&&(jD===null&&(jD=new WeakSet),jD.add(R))}function CE(R,z,q){var{alternate:pe,child:Ce,sibling:Te,tag:ht,type:Et}=R,Cn=null;switch(ht){case 0:case 15:case 1:Cn=Et;break;case 11:Cn=Et.render}if(R1===null)throw Error("Expected resolveFamily to be set during hot reload.");var Kn=!1;if(Et=!1,Cn!==null&&(Cn=R1(Cn),Cn!==void 0&&(q.has(Cn)?Et=!0:z.has(Cn)&&(ht===1?Et=!0:Kn=!0))),jD!==null&&(jD.has(R)||pe!==null&&jD.has(pe))&&(Et=!0),Et&&(R._debugNeedsRemount=!0),Et||Kn)pe=Su(R,2),pe!==null&&xd(pe,R,2);Ce===null||Et||CE(Ce,z,q),Te!==null&&CE(Te,z,q)}function bE(R,z,q,pe){this.tag=R,this.key=q,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=z,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=pe,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null,this.actualDuration=-0,this.actualStartTime=-1.1,this.treeBaseDuration=this.selfBaseDuration=-0,this._debugTask=this._debugStack=this._debugOwner=this._debugInfo=null,this._debugNeedsRemount=!1,this._debugHookTypes=null,Kne||typeof Object.preventExtensions!=="function"||Object.preventExtensions(this)}function zv(R){return R=R.prototype,!(!R||!R.isReactComponent)}function Ky(R,z){var q=R.alternate;switch(q===null?(q=c(R.tag,z,R.key,R.mode),q.elementType=R.elementType,q.type=R.type,q.stateNode=R.stateNode,q._debugOwner=R._debugOwner,q._debugStack=R._debugStack,q._debugTask=R._debugTask,q._debugHookTypes=R._debugHookTypes,q.alternate=R,R.alternate=q):(q.pendingProps=z,q.type=R.type,q.flags=0,q.subtreeFlags=0,q.deletions=null,q.actualDuration=-0,q.actualStartTime=-1.1),q.flags=R.flags&65011712,q.childLanes=R.childLanes,q.lanes=R.lanes,q.child=R.child,q.memoizedProps=R.memoizedProps,q.memoizedState=R.memoizedState,q.updateQueue=R.updateQueue,z=R.dependencies,q.dependencies=z===null?null:{lanes:z.lanes,firstContext:z.firstContext,_debugThenableState:z._debugThenableState},q.sibling=R.sibling,q.index=R.index,q.ref=R.ref,q.refCleanup=R.refCleanup,q.selfBaseDuration=R.selfBaseDuration,q.treeBaseDuration=R.treeBaseDuration,q._debugInfo=R._debugInfo,q._debugNeedsRemount=R._debugNeedsRemount,q.tag){case 0:case 15:q.type=eC(R.type);break;case 1:q.type=eC(R.type);break;case 11:q.type=hD(R.type)}return q}function i0(R,z){R.flags&=65011714;var q=R.alternate;return q===null?(R.childLanes=0,R.lanes=z,R.child=null,R.subtreeFlags=0,R.memoizedProps=null,R.memoizedState=null,R.updateQueue=null,R.dependencies=null,R.stateNode=null,R.selfBaseDuration=0,R.treeBaseDuration=0):(R.childLanes=q.childLanes,R.lanes=q.lanes,R.child=q.child,R.subtreeFlags=0,R.deletions=null,R.memoizedProps=q.memoizedProps,R.memoizedState=q.memoizedState,R.updateQueue=q.updateQueue,R.type=q.type,z=q.dependencies,R.dependencies=z===null?null:{lanes:z.lanes,firstContext:z.firstContext,_debugThenableState:z._debugThenableState},R.selfBaseDuration=q.selfBaseDuration,R.treeBaseDuration=q.treeBaseDuration),R}function dD(R,z,q,pe,Ce,Te){var ht=0,Et=R;if(typeof R==="function")zv(R)&&(ht=1),Et=eC(Et);else if(typeof R==="string")a2&&Bu?(ht=ut(),ht=$U(R,q,ht)?26:LH(R)?27:5):a2?(ht=ut(),ht=$U(R,q,ht)?26:5):ht=Bu?LH(R)?27:5:5;else e:switch(R){case lp:return z=c(31,q,z,Ce),z.elementType=lp,z.lanes=Te,z;case Or:return y1(q.children,Ce,Te,z);case O_:ht=8,Ce|=24;break;case pD:return R=q,pe=Ce,typeof R.id!=="string"&&console.error('Profiler must specify an "id" of type `string` as a prop. Received the type `%s` instead.',typeof R.id),z=c(12,R,z,pe|2),z.elementType=pD,z.lanes=Te,z.stateNode={effectDuration:0,passiveEffectDuration:0},z;case mD:return z=c(13,q,z,Ce),z.elementType=mD,z.lanes=Te,z;case C1:return z=c(19,q,z,Ce),z.elementType=C1,z.lanes=Te,z;default:if(typeof R==="object"&&R!==null)switch(R.$$typeof){case QU:case x1:ht=10;break e;case Vv:ht=9;break e;case R6:ht=11,Et=hD(Et);break e;case Ai:ht=14;break e;case af:ht=16,Et=null;break e}if(Et="",R===void 0||typeof R==="object"&&R!==null&&Object.keys(R).length===0)Et+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.";R===null?q="null":wc(R)?q="array":R!==void 0&&R.$$typeof===k0?(q="<"+(v(R.type)||"Unknown")+" />",Et=" Did you accidentally export a JSX literal instead of a component?"):q=typeof R,ht=pe?typeof pe.tag==="number"?P(pe):typeof pe.name==="string"?pe.name:null:null,ht&&(Et+=`

Check the render method of \``+ht+"`."),ht=29,q=Error("Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: "+(q+"."+Et)),Et=null}return z=c(ht,q,z,Ce),z.elementType=R,z.type=Et,z.lanes=Te,z._debugOwner=pe,z}function IE(R,z,q){return z=dD(R.type,R.key,R.props,R._owner,z,q),z._debugOwner=R._owner,z._debugStack=R._debugStack,z._debugTask=R._debugTask,z}function y1(R,z,q,pe){return R=c(7,R,pe,z),R.lanes=q,R}function O5(R,z,q){return R=c(6,R,null,z),R.lanes=q,R}function Cd(R,z,q){return z=c(4,R.children!==null?R.children:[],R.key,z),z.lanes=q,z.stateNode={containerInfo:R.containerInfo,pendingChildren:null,implementation:R.implementation},z}function Ov(R,z,q,pe,Ce,Te,ht,Et){this.tag=1,this.containerInfo=R,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=L6,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Y(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Y(0),this.hiddenUpdates=Y(null),this.identifierPrefix=pe,this.onUncaughtError=Ce,this.onCaughtError=Te,this.onRecoverableError=ht,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=Et,this.incompleteTransitions=new Map,this.passiveEffectDuration=this.effectDuration=-0,this.memoizedUpdaters=new Set,R=this.pendingUpdatersLaneMap=[];for(z=0;31>z;z++)R.push(new Set);this._debugRootType=q?"hydrateRoot()":"createRoot()"}function vE(R,z,q,pe,Ce,Te,ht,Et,Cn,Kn,Vo,jo){return R=new Ov(R,z,q,ht,Et,Cn,Kn,jo),z=1,Te===!0&&(z|=24),l2&&(z|=2),Te=c(3,null,null,z),R.current=Te,Te.stateNode=R,z=Xi(),Ys(z),R.pooledCache=z,Ys(z),Te.memoizedState={element:pe,isDehydrated:q,cache:z},T0(Te),R}function Li(R){return""+R}function NU(R){if(!R)return ex;return R=ex,R}function D6(R,z,q,pe){return Og(z.current,2,R,z,q,pe),2}function Og(R,z,q,pe,Ce,Te){if(jp&&typeof jp.onScheduleFiberRoot==="function")try{jp.onScheduleFiberRoot(lC,pe,q)}catch(ht){c2||(c2=!0,console.error("React instrumentation encountered an error: %s",ht))}gr!==null&&typeof gr.markRenderScheduled==="function"&&gr.markRenderScheduled(z),Ce=NU(Ce),pe.context===null?pe.context=Ce:pe.pendingContext=Ce,pf&&Yg!==null&&!Q_e&&(Q_e=!0,console.error(`Render methods should be a pure function of props and state; triggering nested component updates from render is not allowed. If necessary, trigger nested updates in componentDidUpdate.

Check the render method of %s.`,P(Yg)||"Unknown")),pe=Gd(z),pe.payload={element:q},Te=Te===void 0?null:Te,Te!==null&&(typeof Te!=="function"&&console.error("Expected the last optional `callback` argument to be a function. Instead received: %s.",Te),pe.callback=Te),q=Dm(R,pe,z),q!==null&&(xd(q,R,z),Ph(q,R,z))}function uD(R,z){if(R=R.memoizedState,R!==null&&R.dehydrated!==null){var q=R.retryLane;R.retryLane=q!==0&&q<z?q:z}}function z_(R,z){uD(R,z),(R=R.alternate)&&uD(R,z)}function RU(){return Yg}function xH(){for(var R=new Map,z=1,q=0;31>q;q++){var pe=D(z);R.set(z,pe),z*=2}return R}var _a={},Q0=Object.assign,N6=Symbol.for("react.element"),k0=Symbol.for("react.transitional.element"),$y=Symbol.for("react.portal"),Or=Symbol.for("react.fragment"),O_=Symbol.for("react.strict_mode"),pD=Symbol.for("react.profiler"),QU=Symbol.for("react.provider"),Vv=Symbol.for("react.consumer"),x1=Symbol.for("react.context"),R6=Symbol.for("react.forward_ref"),mD=Symbol.for("react.suspense"),C1=Symbol.for("react.suspense_list"),Ai=Symbol.for("react.memo"),af=Symbol.for("react.lazy"),lp=Symbol.for("react.activity"),V5=Symbol.for("react.memo_cache_sentinel"),Wd=Symbol.iterator,kU=Symbol.for("react.client.reference"),wc=Array.isArray,kn=UGe.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,{rendererVersion:gl,rendererPackageName:Qne,extraDevToolsConfig:LU,getPublicInstance:Q6,getRootHostContext:qy,getChildHostContext:Yl,prepareForCommit:CH,resetAfterCommit:SE,createInstance:k6}=e;e.cloneMutableInstance;var{appendInitialChild:_D,finalizeInitialChildren:n2,shouldSetTextContent:cf,createTextInstance:HU}=e;e.cloneMutableTextInstance;var{scheduleTimeout:kne,cancelTimeout:FU,noTimeout:L6,isPrimaryRenderer:Pl}=e;e.warnsIfNotActing;var{supportsMutation:Bc,supportsPersistence:wu,supportsHydration:V_,getInstanceFromNode:gD}=e;e.beforeActiveInstanceBlur;var bH=e.preparePortalMount;e.prepareScopeUpdate,e.getInstanceFromScope;var{setCurrentUpdatePriority:Xd,getCurrentUpdatePriority:b1,resolveUpdatePriority:IH}=e;e.trackSchedulerEvent,e.resolveEventType,e.resolveEventTimeStamp;var{shouldAttemptEagerTransition:vH,detachDeletedInstance:SH}=e;e.requestPostPaintCallback;var{maySuspendCommit:AD,preloadInstance:Yv,startSuspendingCommit:fD,suspendInstance:Gv}=e;e.suspendOnActiveViewTransition;var{waitForCommitToBeReady:zU,NotPendingTransition:H6,HostTransitionContext:tC,resetFormInstance:o2,bindToConsole:L0,supportsMicrotasks:nC,scheduleMicrotask:Xh,supportsTestSelectors:bd,findFiberRoot:lf,getBoundingRect:hf,getTextContent:jd,isHiddenSubtree:Wp,matchAccessibilityRole:Vg,setFocusIfFocusable:Gl,setupIntersectionObserver:OU,appendChild:Uv,appendChildToContainer:oC,commitTextUpdate:VU,commitMount:PE,commitUpdate:YU,insertBefore:Jy,insertInContainerBefore:rC,removeChild:PH,removeChildFromContainer:F6,resetTextContent:EH,hideInstance:MH,hideTextInstance:GU,unhideInstance:r2,unhideTextInstance:wH}=e;e.cancelViewTransitionName,e.cancelRootViewTransitionName,e.restoreRootViewTransitionName,e.cloneRootViewTransitionContainer,e.removeRootViewTransitionClone,e.measureClonedInstance,e.hasInstanceChanged,e.hasInstanceAffectedParent,e.startViewTransition,e.startGestureTransition,e.stopGestureTransition,e.getCurrentGestureOffset,e.subscribeToGestureDirection,e.createViewTransitionInstance;var UU=e.clearContainer;e.createFragmentInstance,e.updateFragmentInstanceFiber,e.commitNewChildToFragmentInstance,e.deleteChildFromFragmentInstance;var{cloneInstance:WU,createContainerChildSet:Ui,appendChildToContainerChildSet:z6,finalizeContainerChildren:H0,replaceContainerChildren:iC,cloneHiddenInstance:Hm,cloneHiddenTextInstance:yD,isSuspenseInstancePending:I1,isSuspenseInstanceFallback:O6,getSuspenseInstanceFallbackErrorDetails:i2,registerSuspenseInstanceRetry:XU,canHydrateFormStateMarker:v1,isFormStateMarkerMatching:jU,getNextHydratableSibling:Y_,getNextHydratableSiblingAfterSingleton:Wv,getFirstHydratableChild:Xv,getFirstHydratableChildWithinContainer:s2,getFirstHydratableChildWithinSuspenseInstance:EE,getFirstHydratableChildWithinSingleton:jv,canHydrateInstance:BH,canHydrateTextInstance:sC,canHydrateSuspenseInstance:V6,hydrateInstance:xD,hydrateTextInstance:ME,hydrateSuspenseInstance:wE,getNextHydratableInstanceAfterSuspenseInstance:CD,commitHydratedContainer:Kv,commitHydratedSuspenseInstance:TH,clearSuspenseBoundary:bD,clearSuspenseBoundaryFromContainer:Y6,shouldDeleteUnhydratedTailInstances:G6,diffHydratedPropsForDevWarnings:Xp,diffHydratedTextForDevWarnings:ID,describeHydratableInstanceForDevWarnings:U6,validateHydratableInstance:Id,validateHydratableTextInstance:KU,supportsResources:a2,isHostHoistableType:$U,getHoistableRoot:Zy,getResource:W6,acquireResource:vD,releaseResource:aC,hydrateHoistable:$v,mountHoistable:DH,unmountHoistable:NH,createHoistableInstance:qU,prepareToCommitHoistables:JU,mayResourceSuspendCommit:SD,preloadResource:BE,suspendResource:RH,supportsSingletons:Bu,resolveSingletonInstance:QH,acquireSingletonInstance:Lne,releaseSingletonInstance:kH,isHostSingletonType:LH,isSingletonScope:X6}=e,cC=[],qv=[],S1=-1,ex={};Object.freeze(ex);var Fm=Math.clz32?Math.clz32:N,{log:HH,LN2:TE}=Math,j6=256,P1=4194304,Jv=iu.unstable_scheduleCallback,K6=iu.unstable_cancelCallback,Zv=iu.unstable_shouldYield,FH=iu.unstable_requestPaint,df=iu.unstable_now,E1=iu.unstable_ImmediatePriority,PD=iu.unstable_UserBlockingPriority,e8=iu.unstable_NormalPriority,Tc=iu.unstable_IdlePriority,zH=iu.log,ZU=iu.unstable_setDisableYieldValue,lC=null,jp=null,gr=null,c2=!1,l2=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u",t8=0,jh,tx,G_,n8,h2,o8,OH;Re.__reactDisabledLog=!0;var r8,ED,DE=!1,NE=new(typeof WeakMap==="function"?WeakMap:Map),i8=new WeakMap,hC=[],Y5=0,$6=null,MD=0,Tu=[],U_=0,ks=null,d2=1,M1="",W_=M(null),q6=M(null),uf=M(null),dC=M(null),VH=/["'&<>\n\t]|^\s|\s$/,Yg=null,pf=!1,ac=null,Kd=null,Ra=!1,w1=!1,$d=null,uC=null,ba=!1,RE=Error("Hydration Mismatch Exception: This is not a real error, and should not leak into userspace. If you're seeing this, it's likely a bug in React."),qc=0;if(typeof performance==="object"&&typeof performance.now==="function")var YH=performance,hp=function(){return YH.now()};else{var Hne=Date;hp=function(){return Hne.now()}}var Kp=typeof Object.is==="function"?Object.is:_o,Jc=0,s8=M(null),zm=M(null),wD=M(null),J6={},Z6=null,nx=null,G5=!1,Fne=typeof AbortController<"u"?AbortController:function(){var R=[],z=this.signal={aborted:!1,addEventListener:function(q,pe){R.push(pe)}};this.abort=function(){z.aborted=!0,R.forEach(function(q){return q()})}},GH=iu.unstable_scheduleCallback,zne=iu.unstable_NormalPriority,lh={$$typeof:x1,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0,_currentRenderer:null,_currentRenderer2:null},eI=iu.unstable_now,QE=-0,Om=-1.1,pC=-0,a8=!1,BD=!1,U5=null,mf=null,c8=!1,UH=!1,TD=!1,DD=!1,tI=0,WH={},l8=null,ox=0,nI=0,h8=null,XH=kn.S;kn.S=function(R,z){typeof z==="object"&&z!==null&&typeof z.then==="function"&&zp(R,z),XH!==null&&XH(R,z)};var W5=M(null),eW=Object.prototype.hasOwnProperty,u2={recordUnsafeLifecycleWarnings:function(){},flushPendingUnsafeLifecycleWarnings:function(){},recordLegacyContextWarning:function(){},flushLegacyContextWarning:function(){},discardPendingWarnings:function(){}},d8=[],u8=[],mC=[],X5=[],oI=[],rI=[],j5=new Set;u2.recordUnsafeLifecycleWarnings=function(R,z){j5.has(R.type)||(typeof z.componentWillMount==="function"&&z.componentWillMount.__suppressDeprecationWarning!==!0&&d8.push(R),R.mode&8&&typeof z.UNSAFE_componentWillMount==="function"&&u8.push(R),typeof z.componentWillReceiveProps==="function"&&z.componentWillReceiveProps.__suppressDeprecationWarning!==!0&&mC.push(R),R.mode&8&&typeof z.UNSAFE_componentWillReceiveProps==="function"&&X5.push(R),typeof z.componentWillUpdate==="function"&&z.componentWillUpdate.__suppressDeprecationWarning!==!0&&oI.push(R),R.mode&8&&typeof z.UNSAFE_componentWillUpdate==="function"&&rI.push(R))},u2.flushPendingUnsafeLifecycleWarnings=function(){var R=new Set;0<d8.length&&(d8.forEach(function(Et){R.add(P(Et)||"Component"),j5.add(Et.type)}),d8=[]);var z=new Set;0<u8.length&&(u8.forEach(function(Et){z.add(P(Et)||"Component"),j5.add(Et.type)}),u8=[]);var q=new Set;0<mC.length&&(mC.forEach(function(Et){q.add(P(Et)||"Component"),j5.add(Et.type)}),mC=[]);var pe=new Set;0<X5.length&&(X5.forEach(function(Et){pe.add(P(Et)||"Component"),j5.add(Et.type)}),X5=[]);var Ce=new Set;0<oI.length&&(oI.forEach(function(Et){Ce.add(P(Et)||"Component"),j5.add(Et.type)}),oI=[]);var Te=new Set;if(0<rI.length&&(rI.forEach(function(Et){Te.add(P(Et)||"Component"),j5.add(Et.type)}),rI=[]),0<z.size){var ht=A(z);console.error(`Using UNSAFE_componentWillMount in strict mode is not recommended and may indicate bugs in your code. See https://react.dev/link/unsafe-component-lifecycles for details.

* Move code with side effects to componentDidMount, and set initial state in the constructor.

Please update the following components: %s`,ht)}0<pe.size&&(ht=A(pe),console.error(`Using UNSAFE_componentWillReceiveProps in strict mode is not recommended and may indicate bugs in your code. See https://react.dev/link/unsafe-component-lifecycles for details.

* Move data fetching code or side effects to componentDidUpdate.
* If you're updating state whenever props change, refactor your code to use memoization techniques or move it to static getDerivedStateFromProps. Learn more at: https://react.dev/link/derived-state

Please update the following components: %s`,ht)),0<Te.size&&(ht=A(Te),console.error(`Using UNSAFE_componentWillUpdate in strict mode is not recommended and may indicate bugs in your code. See https://react.dev/link/unsafe-component-lifecycles for details.

* Move data fetching code or side effects to componentDidUpdate.

Please update the following components: %s`,ht)),0<R.size&&(ht=A(R),console.warn(`componentWillMount has been renamed, and is not recommended for use. See https://react.dev/link/unsafe-component-lifecycles for details.

* Move code with side effects to componentDidMount, and set initial state in the constructor.
* Rename componentWillMount to UNSAFE_componentWillMount to suppress this warning in non-strict mode. In React 18.x, only the UNSAFE_ name will work. To rename all deprecated lifecycles to their new names, you can run \`npx react-codemod rename-unsafe-lifecycles\` in your project source folder.

Please update the following components: %s`,ht)),0<q.size&&(ht=A(q),console.warn(`componentWillReceiveProps has been renamed, and is not recommended for use. See https://react.dev/link/unsafe-component-lifecycles for details.

* Move data fetching code or side effects to componentDidUpdate.
* If you're updating state whenever props change, refactor your code to use memoization techniques or move it to static getDerivedStateFromProps. Learn more at: https://react.dev/link/derived-state
* Rename componentWillReceiveProps to UNSAFE_componentWillReceiveProps to suppress this warning in non-strict mode. In React 18.x, only the UNSAFE_ name will work. To rename all deprecated lifecycles to their new names, you can run \`npx react-codemod rename-unsafe-lifecycles\` in your project source folder.

Please update the following components: %s`,ht)),0<Ce.size&&(ht=A(Ce),console.warn(`componentWillUpdate has been renamed, and is not recommended for use. See https://react.dev/link/unsafe-component-lifecycles for details.

* Move data fetching code or side effects to componentDidUpdate.
* Rename componentWillUpdate to UNSAFE_componentWillUpdate to suppress this warning in non-strict mode. In React 18.x, only the UNSAFE_ name will work. To rename all deprecated lifecycles to their new names, you can run \`npx react-codemod rename-unsafe-lifecycles\` in your project source folder.

Please update the following components: %s`,ht))};var p8=new Map,m8=new Set;u2.recordLegacyContextWarning=function(R,z){var q=null;for(var pe=R;pe!==null;)pe.mode&8&&(q=pe),pe=pe.return;q===null?console.error("Expected to find a StrictMode component in a strict mode tree. This error is likely caused by a bug in React. Please file an issue."):!m8.has(R.type)&&(pe=p8.get(q),R.type.contextTypes!=null||R.type.childContextTypes!=null||z!==null&&typeof z.getChildContext==="function")&&(pe===void 0&&(pe=[],p8.set(q,pe)),pe.push(R))},u2.flushLegacyContextWarning=function(){p8.forEach(function(R){if(R.length!==0){var z=R[0],q=new Set;R.forEach(function(Ce){q.add(P(Ce)||"Component"),m8.add(Ce.type)});var pe=A(q);hn(z,function(){console.error(`Legacy context API has been detected within a strict-mode tree.

The old API will be supported in all 16.x releases, but applications using it should migrate to the new version.

Please update the following components: %s

Learn more about this warning here: https://react.dev/link/legacy-context`,pe)})}})},u2.discardPendingWarnings=function(){d8=[],u8=[],mC=[],X5=[],oI=[],rI=[],p8=new Map};var _8=Error("Suspense Exception: This is not a real error! It's an implementation detail of `use` to interrupt the current render. You must either rethrow it immediately, or move the `use` call outside of the `try/catch` block. Capturing without rethrowing will lead to unexpected behavior.\n\nTo handle async errors, wrap your component in an error boundary, or call the promise's `.catch` method and pass the result to `use`."),ND=Error("Suspense Exception: This is not a real error, and should not leak into userspace. If you're seeing this, it's likely a bug in React."),kE=Error("Suspense Exception: This is not a real error! It's an implementation detail of `useActionState` to interrupt the current render. You must either rethrow it immediately, or move the `useActionState` call outside of the `try/catch` block. Capturing without rethrowing will lead to unexpected behavior.\n\nTo handle async errors, wrap your component in an error boundary."),RD={then:function(){console.error('Internal React error: A listener was unexpectedly attached to a "noop" thenable. This is a bug in React. Please file an issue.')}},g8=null,$p=!1,Gg=0,Eh=1,qp=2,F0=4,hh=8,Vm=[],K5=0,LE=0,HE=0,jH=1,FE=2,KH=3,$5=!1,$H=!1,qH=null,QD=!1,A8=M(null),f8=M(0),iI,tW=new Set,kD=new Set,zE=new Set,nW=new Set,q5=0,Wi=null,Oc=null,Du=null,Jp=!1,_C=!1,J5=!1,Z5=0,sI=0,rx=null,oW=0,rW=25,Un=null,_f=null,Ug=-1,OE=!1,y8={readContext:Ro,use:l1,useCallback:ua,useContext:ua,useEffect:ua,useImperativeHandle:ua,useLayoutEffect:ua,useInsertionEffect:ua,useMemo:ua,useReducer:ua,useRef:ua,useState:ua,useDebugValue:ua,useDeferredValue:ua,useTransition:ua,useSyncExternalStore:ua,useId:ua,useHostTransitionStatus:ua,useFormState:ua,useActionState:ua,useOptimistic:ua,useMemoCache:ua,useCacheRefresh:ua},gC=null,aI=null,LD=null,x8=null,Nu=null,z0=null,qd=null;gC={readContext:function(R){return Ro(R)},use:l1,useCallback:function(R,z){return Un="useCallback",Rs(),Gh(z),yo(R,z)},useContext:function(R){return Un="useContext",Rs(),Ro(R)},useEffect:function(R,z){return Un="useEffect",Rs(),Gh(z),sc(R,z)},useImperativeHandle:function(R,z,q){return Un="useImperativeHandle",Rs(),Gh(q),bn(R,z,q)},useInsertionEffect:function(R,z){Un="useInsertionEffect",Rs(),Gh(z),Qs(4,qp,R,z)},useLayoutEffect:function(R,z){return Un="useLayoutEffect",Rs(),Gh(z),cp(R,z)},useMemo:function(R,z){Un="useMemo",Rs(),Gh(z);var q=kn.H;kn.H=Nu;try{return Ws(R,z)}finally{kn.H=q}},useReducer:function(R,z,q){Un="useReducer",Rs();var pe=kn.H;kn.H=Nu;try{return Vp(R,z,q)}finally{kn.H=pe}},useRef:function(R){return Un="useRef",Rs(),pa(R)},useState:function(R){Un="useState",Rs();var z=kn.H;kn.H=Nu;try{return h1(R)}finally{kn.H=z}},useDebugValue:function(){Un="useDebugValue",Rs()},useDeferredValue:function(R,z){return Un="useDeferredValue",Rs(),ma(R,z)},useTransition:function(){return Un="useTransition",Rs(),N5()},useSyncExternalStore:function(R,z,q){return Un="useSyncExternalStore",Rs(),JP(R,z,q)},useId:function(){return Un="useId",Rs(),JA()},useFormState:function(R,z){return Un="useFormState",Rs(),Hc(),Pn(R,z)},useActionState:function(R,z){return Un="useActionState",Rs(),Pn(R,z)},useOptimistic:function(R){return Un="useOptimistic",Rs(),d1(R)},useHostTransitionStatus:kg,useMemoCache:Op,useCacheRefresh:function(){return Un="useCacheRefresh",Rs(),Iv()}},aI={readContext:function(R){return Ro(R)},use:l1,useCallback:function(R,z){return Un="useCallback",So(),yo(R,z)},useContext:function(R){return Un="useContext",So(),Ro(R)},useEffect:function(R,z){return Un="useEffect",So(),sc(R,z)},useImperativeHandle:function(R,z,q){return Un="useImperativeHandle",So(),bn(R,z,q)},useInsertionEffect:function(R,z){Un="useInsertionEffect",So(),Qs(4,qp,R,z)},useLayoutEffect:function(R,z){return Un="useLayoutEffect",So(),cp(R,z)},useMemo:function(R,z){Un="useMemo",So();var q=kn.H;kn.H=Nu;try{return Ws(R,z)}finally{kn.H=q}},useReducer:function(R,z,q){Un="useReducer",So();var pe=kn.H;kn.H=Nu;try{return Vp(R,z,q)}finally{kn.H=pe}},useRef:function(R){return Un="useRef",So(),pa(R)},useState:function(R){Un="useState",So();var z=kn.H;kn.H=Nu;try{return h1(R)}finally{kn.H=z}},useDebugValue:function(){Un="useDebugValue",So()},useDeferredValue:function(R,z){return Un="useDeferredValue",So(),ma(R,z)},useTransition:function(){return Un="useTransition",So(),N5()},useSyncExternalStore:function(R,z,q){return Un="useSyncExternalStore",So(),JP(R,z,q)},useId:function(){return Un="useId",So(),JA()},useActionState:function(R,z){return Un="useActionState",So(),Pn(R,z)},useFormState:function(R,z){return Un="useFormState",So(),Hc(),Pn(R,z)},useOptimistic:function(R){return Un="useOptimistic",So(),d1(R)},useHostTransitionStatus:kg,useMemoCache:Op,useCacheRefresh:function(){return Un="useCacheRefresh",So(),Iv()}},LD={readContext:function(R){return Ro(R)},use:l1,useCallback:function(R,z){return Un="useCallback",So(),ci(R,z)},useContext:function(R){return Un="useContext",So(),Ro(R)},useEffect:function(R,z){Un="useEffect",So(),Us(2048,hh,R,z)},useImperativeHandle:function(R,z,q){return Un="useImperativeHandle",So(),to(R,z,q)},useInsertionEffect:function(R,z){return Un="useInsertionEffect",So(),Us(4,qp,R,z)},useLayoutEffect:function(R,z){return Un="useLayoutEffect",So(),Us(4,F0,R,z)},useMemo:function(R,z){Un="useMemo",So();var q=kn.H;kn.H=z0;try{return rs(R,z)}finally{kn.H=q}},useReducer:function(R,z,q){Un="useReducer",So();var pe=kn.H;kn.H=z0;try{return Yp(R,z,q)}finally{kn.H=pe}},useRef:function(){return Un="useRef",So(),Mc().memoizedState},useState:function(){Un="useState",So();var R=kn.H;kn.H=z0;try{return Yp(D0)}finally{kn.H=R}},useDebugValue:function(){Un="useDebugValue",So()},useDeferredValue:function(R,z){return Un="useDeferredValue",So(),ch(R,z)},useTransition:function(){return Un="useTransition",So(),oH()},useSyncExternalStore:function(R,z,q){return Un="useSyncExternalStore",So(),r0(R,z,q)},useId:function(){return Un="useId",So(),Mc().memoizedState},useFormState:function(R){return Un="useFormState",So(),Hc(),Nn(R)},useActionState:function(R){return Un="useActionState",So(),Nn(R)},useOptimistic:function(R,z){return Un="useOptimistic",So(),Eu(R,z)},useHostTransitionStatus:kg,useMemoCache:Op,useCacheRefresh:function(){return Un="useCacheRefresh",So(),Mc().memoizedState}},x8={readContext:function(R){return Ro(R)},use:l1,useCallback:function(R,z){return Un="useCallback",So(),ci(R,z)},useContext:function(R){return Un="useContext",So(),Ro(R)},useEffect:function(R,z){Un="useEffect",So(),Us(2048,hh,R,z)},useImperativeHandle:function(R,z,q){return Un="useImperativeHandle",So(),to(R,z,q)},useInsertionEffect:function(R,z){return Un="useInsertionEffect",So(),Us(4,qp,R,z)},useLayoutEffect:function(R,z){return Un="useLayoutEffect",So(),Us(4,F0,R,z)},useMemo:function(R,z){Un="useMemo",So();var q=kn.H;kn.H=qd;try{return rs(R,z)}finally{kn.H=q}},useReducer:function(R,z,q){Un="useReducer",So();var pe=kn.H;kn.H=qd;try{return Rm(R,z,q)}finally{kn.H=pe}},useRef:function(){return Un="useRef",So(),Mc().memoizedState},useState:function(){Un="useState",So();var R=kn.H;kn.H=qd;try{return Rm(D0)}finally{kn.H=R}},useDebugValue:function(){Un="useDebugValue",So()},useDeferredValue:function(R,z){return Un="useDeferredValue",So(),L_(R,z)},useTransition:function(){return Un="useTransition",So(),nE()},useSyncExternalStore:function(R,z,q){return Un="useSyncExternalStore",So(),r0(R,z,q)},useId:function(){return Un="useId",So(),Mc().memoizedState},useFormState:function(R){return Un="useFormState",So(),Hc(),$o(R)},useActionState:function(R){return Un="useActionState",So(),$o(R)},useOptimistic:function(R,z){return Un="useOptimistic",So(),B5(R,z)},useHostTransitionStatus:kg,useMemoCache:Op,useCacheRefresh:function(){return Un="useCacheRefresh",So(),Mc().memoizedState}},Nu={readContext:function(R){return p(),Ro(R)},use:function(R){return _(),l1(R)},useCallback:function(R,z){return Un="useCallback",_(),Rs(),yo(R,z)},useContext:function(R){return Un="useContext",_(),Rs(),Ro(R)},useEffect:function(R,z){return Un="useEffect",_(),Rs(),sc(R,z)},useImperativeHandle:function(R,z,q){return Un="useImperativeHandle",_(),Rs(),bn(R,z,q)},useInsertionEffect:function(R,z){Un="useInsertionEffect",_(),Rs(),Qs(4,qp,R,z)},useLayoutEffect:function(R,z){return Un="useLayoutEffect",_(),Rs(),cp(R,z)},useMemo:function(R,z){Un="useMemo",_(),Rs();var q=kn.H;kn.H=Nu;try{return Ws(R,z)}finally{kn.H=q}},useReducer:function(R,z,q){Un="useReducer",_(),Rs();var pe=kn.H;kn.H=Nu;try{return Vp(R,z,q)}finally{kn.H=pe}},useRef:function(R){return Un="useRef",_(),Rs(),pa(R)},useState:function(R){Un="useState",_(),Rs();var z=kn.H;kn.H=Nu;try{return h1(R)}finally{kn.H=z}},useDebugValue:function(){Un="useDebugValue",_(),Rs()},useDeferredValue:function(R,z){return Un="useDeferredValue",_(),Rs(),ma(R,z)},useTransition:function(){return Un="useTransition",_(),Rs(),N5()},useSyncExternalStore:function(R,z,q){return Un="useSyncExternalStore",_(),Rs(),JP(R,z,q)},useId:function(){return Un="useId",_(),Rs(),JA()},useFormState:function(R,z){return Un="useFormState",_(),Rs(),Pn(R,z)},useActionState:function(R,z){return Un="useActionState",_(),Rs(),Pn(R,z)},useOptimistic:function(R){return Un="useOptimistic",_(),Rs(),d1(R)},useMemoCache:function(R){return _(),Op(R)},useHostTransitionStatus:kg,useCacheRefresh:function(){return Un="useCacheRefresh",Rs(),Iv()}},z0={readContext:function(R){return p(),Ro(R)},use:function(R){return _(),l1(R)},useCallback:function(R,z){return Un="useCallback",_(),So(),ci(R,z)},useContext:function(R){return Un="useContext",_(),So(),Ro(R)},useEffect:function(R,z){Un="useEffect",_(),So(),Us(2048,hh,R,z)},useImperativeHandle:function(R,z,q){return Un="useImperativeHandle",_(),So(),to(R,z,q)},useInsertionEffect:function(R,z){return Un="useInsertionEffect",_(),So(),Us(4,qp,R,z)},useLayoutEffect:function(R,z){return Un="useLayoutEffect",_(),So(),Us(4,F0,R,z)},useMemo:function(R,z){Un="useMemo",_(),So();var q=kn.H;kn.H=z0;try{return rs(R,z)}finally{kn.H=q}},useReducer:function(R,z,q){Un="useReducer",_(),So();var pe=kn.H;kn.H=z0;try{return Yp(R,z,q)}finally{kn.H=pe}},useRef:function(){return Un="useRef",_(),So(),Mc().memoizedState},useState:function(){Un="useState",_(),So();var R=kn.H;kn.H=z0;try{return Yp(D0)}finally{kn.H=R}},useDebugValue:function(){Un="useDebugValue",_(),So()},useDeferredValue:function(R,z){return Un="useDeferredValue",_(),So(),ch(R,z)},useTransition:function(){return Un="useTransition",_(),So(),oH()},useSyncExternalStore:function(R,z,q){return Un="useSyncExternalStore",_(),So(),r0(R,z,q)},useId:function(){return Un="useId",_(),So(),Mc().memoizedState},useFormState:function(R){return Un="useFormState",_(),So(),Nn(R)},useActionState:function(R){return Un="useActionState",_(),So(),Nn(R)},useOptimistic:function(R,z){return Un="useOptimistic",_(),So(),Eu(R,z)},useMemoCache:function(R){return _(),Op(R)},useHostTransitionStatus:kg,useCacheRefresh:function(){return Un="useCacheRefresh",So(),Mc().memoizedState}},qd={readContext:function(R){return p(),Ro(R)},use:function(R){return _(),l1(R)},useCallback:function(R,z){return Un="useCallback",_(),So(),ci(R,z)},useContext:function(R){return Un="useContext",_(),So(),Ro(R)},useEffect:function(R,z){Un="useEffect",_(),So(),Us(2048,hh,R,z)},useImperativeHandle:function(R,z,q){return Un="useImperativeHandle",_(),So(),to(R,z,q)},useInsertionEffect:function(R,z){return Un="useInsertionEffect",_(),So(),Us(4,qp,R,z)},useLayoutEffect:function(R,z){return Un="useLayoutEffect",_(),So(),Us(4,F0,R,z)},useMemo:function(R,z){Un="useMemo",_(),So();var q=kn.H;kn.H=z0;try{return rs(R,z)}finally{kn.H=q}},useReducer:function(R,z,q){Un="useReducer",_(),So();var pe=kn.H;kn.H=z0;try{return Rm(R,z,q)}finally{kn.H=pe}},useRef:function(){return Un="useRef",_(),So(),Mc().memoizedState},useState:function(){Un="useState",_(),So();var R=kn.H;kn.H=z0;try{return Rm(D0)}finally{kn.H=R}},useDebugValue:function(){Un="useDebugValue",_(),So()},useDeferredValue:function(R,z){return Un="useDeferredValue",_(),So(),L_(R,z)},useTransition:function(){return Un="useTransition",_(),So(),nE()},useSyncExternalStore:function(R,z,q){return Un="useSyncExternalStore",_(),So(),r0(R,z,q)},useId:function(){return Un="useId",_(),So(),Mc().memoizedState},useFormState:function(R){return Un="useFormState",_(),So(),$o(R)},useActionState:function(R){return Un="useActionState",_(),So(),$o(R)},useOptimistic:function(R,z){return Un="useOptimistic",_(),So(),B5(R,z)},useMemoCache:function(R){return _(),Op(R)},useHostTransitionStatus:kg,useCacheRefresh:function(){return Un="useCacheRefresh",So(),Mc().memoizedState}};var cI={"react-stack-bottom-frame":function(R,z,q){var pe=pf;pf=!0;try{return R(z,q)}finally{pf=pe}}},HD=cI["react-stack-bottom-frame"].bind(cI),G={"react-stack-bottom-frame":function(R){var z=pf;pf=!0;try{return R.render()}finally{pf=z}}},le=G["react-stack-bottom-frame"].bind(G),fe={"react-stack-bottom-frame":function(R,z){try{z.componentDidMount()}catch(q){$c(R,R.return,q)}}},ze=fe["react-stack-bottom-frame"].bind(fe),et={"react-stack-bottom-frame":function(R,z,q,pe,Ce){try{z.componentDidUpdate(q,pe,Ce)}catch(Te){$c(R,R.return,Te)}}},yt=et["react-stack-bottom-frame"].bind(et),Mt={"react-stack-bottom-frame":function(R,z){var q=z.stack;R.componentDidCatch(z.value,{componentStack:q!==null?q:""})}},Rt=Mt["react-stack-bottom-frame"].bind(Mt),Wt={"react-stack-bottom-frame":function(R,z,q){try{q.componentWillUnmount()}catch(pe){$c(R,z,pe)}}},Rn=Wt["react-stack-bottom-frame"].bind(Wt),no={"react-stack-bottom-frame":function(R){R.resourceKind!=null&&console.error("Expected only SimpleEffects when enableUseEffectCRUDOverload is disabled, got %s",R.resourceKind);var z=R.create;return R=R.inst,z=z(),R.destroy=z}},xo=no["react-stack-bottom-frame"].bind(no),qo={"react-stack-bottom-frame":function(R,z,q){try{q()}catch(pe){$c(R,z,pe)}}},Br=qo["react-stack-bottom-frame"].bind(qo),Hi={"react-stack-bottom-frame":function(R){var z=R._init;return z(R._payload)}},ri=Hi["react-stack-bottom-frame"].bind(Hi),kr=null,Cr=0,Io=null,No,Ss=No=!1,Ul={},dp={},AC={};u=function(R,z,q){if(q!==null&&typeof q==="object"&&q._store&&(!q._store.validated&&q.key==null||q._store.validated===2)){if(typeof q._store!=="object")throw Error("React Component in warnForMissingKey should have a _store. This error is likely caused by a bug in React. Please file an issue.");q._store.validated=1;var pe=P(R),Ce=pe||"null";if(!Ul[Ce]){Ul[Ce]=!0,q=q._owner,R=R._debugOwner;var Te="";R&&typeof R.tag==="number"&&(Ce=P(R))&&(Te=`

Check the render method of \``+Ce+"`."),Te||pe&&(Te=`

Check the top-level render call using <`+pe+">.");var ht="";q!=null&&R!==q&&(pe=null,typeof q.tag==="number"?pe=P(q):typeof q.name==="string"&&(pe=q.name),pe&&(ht=" It was passed a child from "+pe+".")),hn(z,function(){console.error('Each child in a list should have a unique "key" prop.%s%s See https://react.dev/link/warning-keys for more information.',Te,ht)})}}};var X_=rH(!0),B1=rH(!1),Zp=M(null),T1=null,fC=1,yC=2,dh=M(0),xC={},lI=new Set,VE=new Set,hI=new Set,FD=new Set,dI=new Set,iW=new Set,zD=new Set,j_=new Set,OD=new Set,em=new Set;Object.freeze(xC);var tm={enqueueSetState:function(R,z,q){R=R._reactInternals;var pe=Lm(R),Ce=Gd(pe);Ce.payload=z,q!==void 0&&q!==null&&(ZA(q),Ce.callback=q),z=Dm(R,Ce,pe),z!==null&&(xd(z,R,pe),Ph(z,R,pe)),Ee(R,pe)},enqueueReplaceState:function(R,z,q){R=R._reactInternals;var pe=Lm(R),Ce=Gd(pe);Ce.tag=jH,Ce.payload=z,q!==void 0&&q!==null&&(ZA(q),Ce.callback=q),z=Dm(R,Ce,pe),z!==null&&(xd(z,R,pe),Ph(z,R,pe)),Ee(R,pe)},enqueueForceUpdate:function(R,z){R=R._reactInternals;var q=Lm(R),pe=Gd(q);pe.tag=FE,z!==void 0&&z!==null&&(ZA(z),pe.callback=z),z=Dm(R,pe,q),z!==null&&(xd(z,R,q),Ph(z,R,q)),gr!==null&&typeof gr.markForceUpdateScheduled==="function"&&gr.markForceUpdateScheduled(R,q)}},CC=typeof reportError==="function"?reportError:function(R){if(typeof window==="object"&&typeof window.ErrorEvent==="function"){var z=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof R==="object"&&R!==null&&typeof R.message==="string"?String(R.message):String(R),error:R});if(!window.dispatchEvent(z))return}else if(typeof process==="object"&&typeof process.emit==="function"){process.emit("uncaughtException",R);return}console.error(R)},vd=null,p2=null,D1=Error("This is not a real error. It's an implementation detail of React's selective hydration feature. If this leaks into userspace, it's a bug in React. Please file an issue."),Al=!1,e4={},t4={},YE={},ta={},VD=!1,n4={},C8={},b8={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null},JH=!1,sW=null;sW=new Set;var o4=!1,fl=!1,YD=!1,aW=typeof WeakSet==="function"?WeakSet:Set,up=null,uI=null,nm=null,s0=null,m2=!1,r4=null,I8=8192,uTe={getCacheForType:function(R){var z=Ro(lh),q=z.data.get(R);return q===void 0&&(q=R(),z.data.set(R,q)),q},getOwner:function(){return Yg}},ZH=0,cW=1,a0=2,Vn=3,Dc=4;if(typeof Symbol==="function"&&Symbol.for){var eF=Symbol.for;ZH=eF("selector.component"),cW=eF("selector.has_pseudo_class"),a0=eF("selector.role"),Vn=eF("selector.test_id"),Dc=eF("selector.text")}var GD=[],One=typeof WeakMap==="function"?WeakMap:Map,Ru=0,Qu=2,Wg=4,Xg=0,v8=1,bC=2,lW=3,S8=4,tF=6,Vne=5,Za=Ru,uh=null,Ia=null,va=0,gf=0,GE=1,pI=2,K_=3,i4=4,_2=5,P8=6,nF=7,Yne=8,UE=9,Ki=gf,N1=null,IC=!1,E8=!1,M8=!1,vC=0,Jd=Xg,w8=0,B8=0,T8=0,ph=0,jg=0,g2=null,Wl=null,hW=!1,Gne=0,oF=300,D8=1/0,UD=500,om=null,Ym=null,SC=0,dW=1,mI=2,ku=0,Kg=1,_I=2,Une=3,pTe=4,Wne=5,Gm=0,ix=null,gI=null,AI=0,fI=0,rF=null,T_e=null,mTe=50,WD=0,uW=null,Nc=!1,pW=!1,D_e=50,N8=0,XD=null,WE=!1,iF=null,Xne=!1,jne=new Set,N_e={},R1=null,jD=null,Kne=!1;try{var R_e=Object.preventExtensions({})}catch(R){Kne=!0}var Q_e=!1,$ne={},sF=null,mW=null,qne=null,Jne=null,k_e=null,L_e=null,H_e=null,Zne=null,XE=null;return sF=function(R,z,q,pe){z=t(R,z),z!==null&&(q=n(z.memoizedState,q,0,pe),z.memoizedState=q,z.baseState=q,R.memoizedProps=Q0({},R.memoizedProps),q=Su(R,2),q!==null&&xd(q,R,2))},mW=function(R,z,q){z=t(R,z),z!==null&&(q=i(z.memoizedState,q,0),z.memoizedState=q,z.baseState=q,R.memoizedProps=Q0({},R.memoizedProps),q=Su(R,2),q!==null&&xd(q,R,2))},qne=function(R,z,q,pe){z=t(R,z),z!==null&&(q=o(z.memoizedState,q,pe),z.memoizedState=q,z.baseState=q,R.memoizedProps=Q0({},R.memoizedProps),q=Su(R,2),q!==null&&xd(q,R,2))},Jne=function(R,z,q){R.pendingProps=n(R.memoizedProps,z,0,q),R.alternate&&(R.alternate.pendingProps=R.pendingProps),z=Su(R,2),z!==null&&xd(z,R,2)},k_e=function(R,z){R.pendingProps=i(R.memoizedProps,z,0),R.alternate&&(R.alternate.pendingProps=R.pendingProps),z=Su(R,2),z!==null&&xd(z,R,2)},L_e=function(R,z,q){R.pendingProps=o(R.memoizedProps,z,q),R.alternate&&(R.alternate.pendingProps=R.pendingProps),z=Su(R,2),z!==null&&xd(z,R,2)},H_e=function(R){var z=Su(R,2);z!==null&&xd(z,R,2)},Zne=function(R){a=R},XE=function(R){s=R},_a.attemptContinuousHydration=function(R){if(R.tag===13){var z=Su(R,67108864);z!==null&&xd(z,R,67108864),z_(R,67108864)}},_a.attemptHydrationAtCurrentPriority=function(R){if(R.tag===13){var z=Lm(R);z=se(z);var q=Su(R,z);q!==null&&xd(q,R,z),z_(R,z)}},_a.attemptSynchronousHydration=function(R){switch(R.tag){case 3:if(R=R.stateNode,R.current.memoizedState.isDehydrated){var z=L(R.pendingLanes);if(z!==0){R.pendingLanes|=2;for(R.entangledLanes|=2;z;){var q=1<<31-Fm(z);R.entanglements[1]|=q,z&=~q}Jo(R),(Za&(Qu|Wg))===Ru&&(D8=df()+UD,zr(0,!1))}}break;case 13:z=Su(R,2),z!==null&&xd(z,R,2),B6(),z_(R,2)}},_a.batchedUpdates=function(R,z){return R(z)},_a.createComponentSelector=function(R){return{$$typeof:ZH,value:R}},_a.createContainer=function(R,z,q,pe,Ce,Te,ht,Et,Cn,Kn){return vE(R,z,!1,null,q,pe,Te,ht,Et,Cn,Kn,null)},_a.createHasPseudoClassSelector=function(R){return{$$typeof:cW,value:R}},_a.createHydrationContainer=function(R,z,q,pe,Ce,Te,ht,Et,Cn,Kn,Vo,jo,yr){return R=vE(q,pe,!0,R,Ce,Te,Et,Cn,Kn,Vo,jo,yr),R.context=NU(null),q=R.current,pe=Lm(q),pe=se(pe),Ce=Gd(pe),Ce.callback=z!==void 0&&z!==null?z:null,Dm(q,Ce,pe),z=pe,R.current.lanes=z,X(R,z),Jo(R),R},_a.createPortal=function(R,z,q){var pe=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;try{Li(pe);var Ce=!1}catch(Te){Ce=!0}return Ce&&(console.error("The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",typeof Symbol==="function"&&Symbol.toStringTag&&pe[Symbol.toStringTag]||pe.constructor.name||"Object"),Li(pe)),{$$typeof:$y,key:pe==null?null:""+pe,children:R,containerInfo:z,implementation:q}},_a.createRoleSelector=function(R){return{$$typeof:a0,value:R}},_a.createTestNameSelector=function(R){return{$$typeof:Vn,value:R}},_a.createTextSelector=function(R){return{$$typeof:Dc,value:R}},_a.defaultOnCaughtError=function(R){var z=vd?"The above error occurred in the <"+vd+"> component.":"The above error occurred in one of your React components.",q="React will try to recreate this component tree from scratch using the error boundary you provided, "+((p2||"Anonymous")+".");typeof R==="object"&&R!==null&&typeof R.environmentName==="string"?L0("error",[`%o

%s

%s
`,R,z,q],R.environmentName)():console.error(`%o

%s

%s
`,R,z,q)},_a.defaultOnRecoverableError=function(R){CC(R)},_a.defaultOnUncaughtError=function(R){CC(R),console.warn(`%s

%s
`,vd?"An error occurred in the <"+vd+"> component.":"An error occurred in one of your React components.",`Consider adding an error boundary to your tree to customize error handling behavior.
Visit https://react.dev/link/error-boundaries to learn more about error boundaries.`)},_a.deferredUpdates=function(R){var z=kn.T,q=b1();try{return Xd(32),kn.T=null,R()}finally{Xd(q),kn.T=z}},_a.discreteUpdates=function(R,z,q,pe,Ce){var Te=kn.T,ht=b1();try{return Xd(2),kn.T=null,R(z,q,pe,Ce)}finally{Xd(ht),kn.T=Te,Za===Ru&&(D8=df()+UD)}},_a.findAllNodes=M6,_a.findBoundingRects=function(R,z){if(!bd)throw Error("Test selector API is not supported by this renderer.");z=M6(R,z),R=[];for(var q=0;q<z.length;q++)R.push(hf(z[q]));for(z=R.length-1;0<z;z--){q=R[z];for(var pe=q.x,Ce=pe+q.width,Te=q.y,ht=Te+q.height,Et=z-1;0<=Et;Et--)if(z!==Et){var Cn=R[Et],Kn=Cn.x,Vo=Kn+Cn.width,jo=Cn.y,yr=jo+Cn.height;if(pe>=Kn&&Te>=jo&&Ce<=Vo&&ht<=yr){R.splice(z,1);break}else if(!(pe!==Kn||q.width!==Cn.width||yr<Te||jo>ht)){jo>Te&&(Cn.height+=jo-Te,Cn.y=Te),yr<ht&&(Cn.height=ht-jo),R.splice(z,1);break}else if(!(Te!==jo||q.height!==Cn.height||Vo<pe||Kn>Ce)){Kn>pe&&(Cn.width+=Kn-pe,Cn.x=pe),Vo<Ce&&(Cn.width=Ce-Kn),R.splice(z,1);break}}}return R},_a.findHostInstance=function(R){var z=R._reactInternals;if(z===void 0){if(typeof R.render==="function")throw Error("Unable to find node on an unmounted component.");throw R=Object.keys(R).join(","),Error("Argument appears to not be a ReactComponent. Keys: "+R)}return R=x(z),R===null?null:Q6(R.stateNode)},_a.findHostInstanceWithNoPortals=function(R){return R=y(R),R=R!==null?b(R):null,R===null?null:Q6(R.stateNode)},_a.findHostInstanceWithWarning=function(R,z){var q=R._reactInternals;if(q===void 0){if(typeof R.render==="function")throw Error("Unable to find node on an unmounted component.");throw R=Object.keys(R).join(","),Error("Argument appears to not be a ReactComponent. Keys: "+R)}if(R=x(q),R===null)return null;if(R.mode&8){var pe=P(q)||"Component";$ne[pe]||($ne[pe]=!0,hn(R,function(){q.mode&8?console.error("%s is deprecated in StrictMode. %s was passed an instance of %s which is inside StrictMode. Instead, add a ref directly to the element you want to reference. Learn more about using refs safely here: https://react.dev/link/strict-mode-find-node",z,z,pe):console.error("%s is deprecated in StrictMode. %s was passed an instance of %s which renders StrictMode children. Instead, add a ref directly to the element you want to reference. Learn more about using refs safely here: https://react.dev/link/strict-mode-find-node",z,z,pe)}))}return Q6(R.stateNode)},_a.flushPassiveEffects=J3,_a.flushSyncFromReconciler=function(R){var z=Za;Za|=1;var q=kn.T,pe=b1();try{if(Xd(2),kn.T=null,R)return R()}finally{Xd(pe),kn.T=q,Za=z,(Za&(Qu|Wg))===Ru&&zr(0,!1)}},_a.flushSyncWork=B6,_a.focusWithin=function(R,z){if(!bd)throw Error("Test selector API is not supported by this renderer.");R=P6(R),z=E6(R,z),z=Array.from(z);for(R=0;R<z.length;){var q=z[R++],pe=q.tag;if(!Wp(q)){if((pe===5||pe===26||pe===27)&&Gl(q.stateNode))return!0;for(q=q.child;q!==null;)z.push(q),q=q.sibling}}return!1},_a.getFindAllNodesFailureDescription=function(R,z){if(!bd)throw Error("Test selector API is not supported by this renderer.");var q=0,pe=[];R=[P6(R),0];for(var Ce=0;Ce<R.length;){var Te=R[Ce++],ht=Te.tag,Et=R[Ce++],Cn=z[Et];if(ht!==5&&ht!==26&&ht!==27||!Wp(Te)){if(KT(Te,Cn)&&(pe.push($T(Cn)),Et++,Et>q&&(q=Et)),Et<z.length)for(Te=Te.child;Te!==null;)R.push(Te,Et),Te=Te.sibling}}if(q<z.length){for(R=[];q<z.length;q++)R.push($T(z[q]));return`findAllNodes was able to match part of the selector:
  `+(pe.join(" > ")+`

No matching component was found for:
  `)+R.join(" > ")}return null},_a.getPublicRootInstance=function(R){if(R=R.current,!R.child)return null;switch(R.child.tag){case 27:case 5:return Q6(R.child.stateNode);default:return R.child.stateNode}},_a.injectIntoDevTools=function(){var R={bundleType:1,version:gl,rendererPackageName:Qne,currentDispatcherRef:kn,reconcilerVersion:"19.1.0"};return LU!==null&&(R.rendererConfig=LU),R.overrideHookState=sF,R.overrideHookStateDeletePath=mW,R.overrideHookStateRenamePath=qne,R.overrideProps=Jne,R.overridePropsDeletePath=k_e,R.overridePropsRenamePath=L_e,R.scheduleUpdate=H_e,R.setErrorHandler=Zne,R.setSuspenseHandler=XE,R.scheduleRefresh=h,R.scheduleRoot=l,R.setRefreshHandler=d,R.getCurrentFiber=RU,R.getLaneLabelMap=xH,R.injectProfilingHooks=ce,te(R)},_a.isAlreadyRendering=function(){return(Za&(Qu|Wg))!==Ru},_a.observeVisibleRects=function(R,z,q,pe){function Ce(){var Kn=M6(R,z);Te.forEach(function(Vo){0>Kn.indexOf(Vo)&&Cn(Vo)}),Kn.forEach(function(Vo){0>Te.indexOf(Vo)&&Et(Vo)})}if(!bd)throw Error("Test selector API is not supported by this renderer.");var Te=M6(R,z);q=OU(Te,q,pe);var ht=q.disconnect,Et=q.observe,Cn=q.unobserve;return GD.push(Ce),{disconnect:function(){var Kn=GD.indexOf(Ce);0<=Kn&&GD.splice(Kn,1),ht()}}},_a.shouldError=function(R){return a(R)},_a.shouldSuspend=function(R){return s(R)},_a.startHostTransition=function(R,z,q,pe){if(R.tag!==5)throw Error("Expected the form instance to be a HostComponent. This is a bug in React.");var Ce=D5(R).queue;tE(R,Ce,z,H6,q===null?m:function(){kn.T===null&&console.error("requestFormReset was called outside a transition or action. To fix, move to an action, or wrap with startTransition.");var Te=D5(R).next.queue;return R5(R,Te,{},Lm(R)),q(pe)})},_a.updateContainer=function(R,z,q,pe){var Ce=z.current,Te=Lm(Ce);return Og(Ce,Te,R,z,q,pe),Te},_a.updateContainerSync=D6,_a},Zse.exports.default=Zse.exports,Object.defineProperty(Zse.exports,"__esModule",{value:!0})});var WGe=lt(function(rnr){rnr.ConcurrentRoot=1,rnr.ContinuousEventPriority=8,rnr.DefaultEventPriority=32,rnr.DiscreteEventPriority=2,rnr.IdleEventPriority=268435456,rnr.LegacyRoot=0,rnr.NoEventPriority=0});var qI=lt(function(wkt){Object.defineProperty(wkt,"__esModule",{value:!0});wkt.RANDOM=wkt.EPSILON=wkt.ARRAY_TYPE=wkt.ANGLE_ORDER=void 0;wkt.equals=aor;wkt.round=tor;wkt.setMatrixArrayType=nor;wkt.toDegree=sor;wkt.toRadian=ior;var Znr=wkt.EPSILON=0.000001,eor=wkt.ARRAY_TYPE=typeof Float32Array<"u"?Float32Array:Array,WTs=wkt.RANDOM=Math.random,XTs=wkt.ANGLE_ORDER="zyx";function tor(e){if(e>=0)return Math.round(e);return e%0.5===0?Math.floor(e):Math.round(e)}function nor(e){wkt.ARRAY_TYPE=eor=e}var oor=Math.PI/180,ror=180/Math.PI;function ior(e){return e*oor}function sor(e){return e*ror}function aor(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Znr;return Math.abs(e-t)<=n*Math.max(1,Math.abs(e),Math.abs(t))}});var Hkt=lt(function(Qkt){function CUe(e){return CUe=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},CUe(e)}Object.defineProperty(Qkt,"__esModule",{value:!0});Qkt.LDU=Dor;Qkt.add=Nor;Qkt.adjoint=vor;Qkt.clone=gor;Qkt.copy=Aor;Qkt.create=_or;Qkt.determinant=Sor;Qkt.equals=Qor;Qkt.exactEquals=Ror;Qkt.frob=Tor;Qkt.fromRotation=Mor;Qkt.fromScaling=wor;Qkt.fromValues=xor;Qkt.identity=yor;Qkt.invert=Ior;Qkt.mul=void 0;Qkt.multiply=Nkt;Qkt.multiplyScalar=kor;Qkt.multiplyScalarAndAdd=Lor;Qkt.rotate=Por;Qkt.scale=Eor;Qkt.set=Cor;Qkt.str=Bor;Qkt.sub=void 0;Qkt.subtract=Rkt;Qkt.transpose=bor;var ER=Dkt(qI());function Dkt(e,t){if(typeof WeakMap=="function")var n=new WeakMap,o=new WeakMap;return(Dkt=function(i,s){if(!s&&i&&i.__esModule)return i;var a,c,l={__proto__:null,default:i};if(i===null||CUe(i)!="object"&&typeof i!="function")return l;if(a=s?o:n){if(a.has(i))return a.get(i);a.set(i,l)}for(var h in i)h!=="default"&&{}.hasOwnProperty.call(i,h)&&((c=(a=Object.defineProperty)&&Object.getOwnPropertyDescriptor(i,h))&&(c.get||c.set)?a(l,h,c):l[h]=i[h]);return l})(e,t)}function _or(){var e=new ER.ARRAY_TYPE(4);if(ER.ARRAY_TYPE!=Float32Array)e[1]=0,e[2]=0;return e[0]=1,e[3]=1,e}function gor(e){var t=new ER.ARRAY_TYPE(4);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}function Aor(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}function yor(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e}function xor(e,t,n,o){var r=new ER.ARRAY_TYPE(4);return r[0]=e,r[1]=t,r[2]=n,r[3]=o,r}function Cor(e,t,n,o,r){return e[0]=t,e[1]=n,e[2]=o,e[3]=r,e}function bor(e,t){if(e===t){var n=t[1];e[1]=t[2],e[2]=n}else e[0]=t[0],e[1]=t[2],e[2]=t[1],e[3]=t[3];return e}function Ior(e,t){var n=t[0],o=t[1],r=t[2],i=t[3],s=n*i-r*o;if(!s)return null;return s=1/s,e[0]=i*s,e[1]=-o*s,e[2]=-r*s,e[3]=n*s,e}function vor(e,t){var n=t[0];return e[0]=t[3],e[1]=-t[1],e[2]=-t[2],e[3]=n,e}function Sor(e){return e[0]*e[3]-e[2]*e[1]}function Nkt(e,t,n){var o=t[0],r=t[1],i=t[2],s=t[3],a=n[0],c=n[1],l=n[2],h=n[3];return e[0]=o*a+i*c,e[1]=r*a+s*c,e[2]=o*l+i*h,e[3]=r*l+s*h,e}function Por(e,t,n){var o=t[0],r=t[1],i=t[2],s=t[3],a=Math.sin(n),c=Math.cos(n);return e[0]=o*c+i*a,e[1]=r*c+s*a,e[2]=o*-a+i*c,e[3]=r*-a+s*c,e}function Eor(e,t,n){var o=t[0],r=t[1],i=t[2],s=t[3],a=n[0],c=n[1];return e[0]=o*a,e[1]=r*a,e[2]=i*c,e[3]=s*c,e}function Mor(e,t){var n=Math.sin(t),o=Math.cos(t);return e[0]=o,e[1]=n,e[2]=-n,e[3]=o,e}function wor(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=t[1],e}function Bor(e){return"mat2("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+")"}function Tor(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]+e[3]*e[3])}function Dor(e,t,n,o){return e[2]=o[2]/o[0],n[0]=o[0],n[1]=o[1],n[3]=o[3]-e[2]*n[1],[e,t,n]}function Nor(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e}function Rkt(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e}function Ror(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]}function Qor(e,t){var n=e[0],o=e[1],r=e[2],i=e[3],s=t[0],a=t[1],c=t[2],l=t[3];return Math.abs(n-s)<=ER.EPSILON*Math.max(1,Math.abs(n),Math.abs(s))&&Math.abs(o-a)<=ER.EPSILON*Math.max(1,Math.abs(o),Math.abs(a))&&Math.abs(r-c)<=ER.EPSILON*Math.max(1,Math.abs(r),Math.abs(c))&&Math.abs(i-l)<=ER.EPSILON*Math.max(1,Math.abs(i),Math.abs(l))}function kor(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e}function Lor(e,t,n,o){return e[0]=t[0]+n[0]*o,e[1]=t[1]+n[1]*o,e[2]=t[2]+n[2]*o,e[3]=t[3]+n[3]*o,e}var KTs=Qkt.mul=Nkt,$Ts=Qkt.sub=Rkt});var Ukt=lt(function(Vkt){function bUe(e){return bUe=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},bUe(e)}Object.defineProperty(Vkt,"__esModule",{value:!0});Vkt.add=vrr;Vkt.clone=lrr;Vkt.copy=hrr;Vkt.create=crr;Vkt.determinant=_rr;Vkt.equals=Mrr;Vkt.exactEquals=Err;Vkt.frob=Irr;Vkt.fromRotation=yrr;Vkt.fromScaling=xrr;Vkt.fromTranslation=Crr;Vkt.fromValues=urr;Vkt.identity=drr;Vkt.invert=mrr;Vkt.mul=void 0;Vkt.multiply=zkt;Vkt.multiplyScalar=Srr;Vkt.multiplyScalarAndAdd=Prr;Vkt.rotate=grr;Vkt.scale=Arr;Vkt.set=prr;Vkt.str=brr;Vkt.sub=void 0;Vkt.subtract=Okt;Vkt.translate=frr;var E7=Fkt(qI());function Fkt(e,t){if(typeof WeakMap=="function")var n=new WeakMap,o=new WeakMap;return(Fkt=function(i,s){if(!s&&i&&i.__esModule)return i;var a,c,l={__proto__:null,default:i};if(i===null||bUe(i)!="object"&&typeof i!="function")return l;if(a=s?o:n){if(a.has(i))return a.get(i);a.set(i,l)}for(var h in i)h!=="default"&&{}.hasOwnProperty.call(i,h)&&((c=(a=Object.defineProperty)&&Object.getOwnPropertyDescriptor(i,h))&&(c.get||c.set)?a(l,h,c):l[h]=i[h]);return l})(e,t)}function crr(){var e=new E7.ARRAY_TYPE(6);if(E7.ARRAY_TYPE!=Float32Array)e[1]=0,e[2]=0,e[4]=0,e[5]=0;return e[0]=1,e[3]=1,e}function lrr(e){var t=new E7.ARRAY_TYPE(6);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t}function hrr(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e}function drr(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e[4]=0,e[5]=0,e}function urr(e,t,n,o,r,i){var s=new E7.ARRAY_TYPE(6);return s[0]=e,s[1]=t,s[2]=n,s[3]=o,s[4]=r,s[5]=i,s}function prr(e,t,n,o,r,i,s){return e[0]=t,e[1]=n,e[2]=o,e[3]=r,e[4]=i,e[5]=s,e}function mrr(e,t){var n=t[0],o=t[1],r=t[2],i=t[3],s=t[4],a=t[5],c=n*i-o*r;if(!c)return null;return c=1/c,e[0]=i*c,e[1]=-o*c,e[2]=-r*c,e[3]=n*c,e[4]=(r*a-i*s)*c,e[5]=(o*s-n*a)*c,e}function _rr(e){return e[0]*e[3]-e[1]*e[2]}function zkt(e,t,n){var o=t[0],r=t[1],i=t[2],s=t[3],a=t[4],c=t[5],l=n[0],h=n[1],d=n[2],u=n[3],_=n[4],p=n[5];return e[0]=o*l+i*h,e[1]=r*l+s*h,e[2]=o*d+i*u,e[3]=r*d+s*u,e[4]=o*_+i*p+a,e[5]=r*_+s*p+c,e}function grr(e,t,n){var o=t[0],r=t[1],i=t[2],s=t[3],a=t[4],c=t[5],l=Math.sin(n),h=Math.cos(n);return e[0]=o*h+i*l,e[1]=r*h+s*l,e[2]=o*-l+i*h,e[3]=r*-l+s*h,e[4]=a,e[5]=c,e}function Arr(e,t,n){var o=t[0],r=t[1],i=t[2],s=t[3],a=t[4],c=t[5],l=n[0],h=n[1];return e[0]=o*l,e[1]=r*l,e[2]=i*h,e[3]=s*h,e[4]=a,e[5]=c,e}function frr(e,t,n){var o=t[0],r=t[1],i=t[2],s=t[3],a=t[4],c=t[5],l=n[0],h=n[1];return e[0]=o,e[1]=r,e[2]=i,e[3]=s,e[4]=o*l+i*h+a,e[5]=r*l+s*h+c,e}function yrr(e,t){var n=Math.sin(t),o=Math.cos(t);return e[0]=o,e[1]=n,e[2]=-n,e[3]=o,e[4]=0,e[5]=0,e}function xrr(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=t[1],e[4]=0,e[5]=0,e}function Crr(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e[4]=t[0],e[5]=t[1],e}function brr(e){return"mat2d("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+", "+e[4]+", "+e[5]+")"}function Irr(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]+e[3]*e[3]+e[4]*e[4]+e[5]*e[5]+1)}function vrr(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e[4]=t[4]+n[4],e[5]=t[5]+n[5],e}function Okt(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e[4]=t[4]-n[4],e[5]=t[5]-n[5],e}function Srr(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*n,e[5]=t[5]*n,e}function Prr(e,t,n,o){return e[0]=t[0]+n[0]*o,e[1]=t[1]+n[1]*o,e[2]=t[2]+n[2]*o,e[3]=t[3]+n[3]*o,e[4]=t[4]+n[4]*o,e[5]=t[5]+n[5]*o,e}function Err(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]}function Mrr(e,t){var n=e[0],o=e[1],r=e[2],i=e[3],s=e[4],a=e[5],c=t[0],l=t[1],h=t[2],d=t[3],u=t[4],_=t[5];return Math.abs(n-c)<=E7.EPSILON*Math.max(1,Math.abs(n),Math.abs(c))&&Math.abs(o-l)<=E7.EPSILON*Math.max(1,Math.abs(o),Math.abs(l))&&Math.abs(r-h)<=E7.EPSILON*Math.max(1,Math.abs(r),Math.abs(h))&&Math.abs(i-d)<=E7.EPSILON*Math.max(1,Math.abs(i),Math.abs(d))&&Math.abs(s-u)<=E7.EPSILON*Math.max(1,Math.abs(s),Math.abs(u))&&Math.abs(a-_)<=E7.EPSILON*Math.max(1,Math.abs(a),Math.abs(_))}var JTs=Vkt.mul=zkt,ZTs=Vkt.sub=Okt});var vUe=lt(function(Kkt){function IUe(e){return IUe=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},IUe(e)}Object.defineProperty(Kkt,"__esModule",{value:!0});Kkt.add=Cir;Kkt.adjoint=air;Kkt.clone=eir;Kkt.copy=tir;Kkt.create=Jrr;Kkt.determinant=cir;Kkt.equals=Sir;Kkt.exactEquals=vir;Kkt.frob=xir;Kkt.fromMat2d=_ir;Kkt.fromMat4=Zrr;Kkt.fromQuat=gir;Kkt.fromRotation=pir;Kkt.fromScaling=mir;Kkt.fromTranslation=uir;Kkt.fromValues=nir;Kkt.identity=rir;Kkt.invert=sir;Kkt.mul=void 0;Kkt.multiply=Xkt;Kkt.multiplyScalar=bir;Kkt.multiplyScalarAndAdd=Iir;Kkt.normalFromMat4=Air;Kkt.projection=fir;Kkt.rotate=hir;Kkt.scale=dir;Kkt.set=oir;Kkt.str=yir;Kkt.sub=void 0;Kkt.subtract=jkt;Kkt.translate=lir;Kkt.transpose=iir;var T4=Wkt(qI());function Wkt(e,t){if(typeof WeakMap=="function")var n=new WeakMap,o=new WeakMap;return(Wkt=function(i,s){if(!s&&i&&i.__esModule)return i;var a,c,l={__proto__:null,default:i};if(i===null||IUe(i)!="object"&&typeof i!="function")return l;if(a=s?o:n){if(a.has(i))return a.get(i);a.set(i,l)}for(var h in i)h!=="default"&&{}.hasOwnProperty.call(i,h)&&((c=(a=Object.defineProperty)&&Object.getOwnPropertyDescriptor(i,h))&&(c.get||c.set)?a(l,h,c):l[h]=i[h]);return l})(e,t)}function Jrr(){var e=new T4.ARRAY_TYPE(9);if(T4.ARRAY_TYPE!=Float32Array)e[1]=0,e[2]=0,e[3]=0,e[5]=0,e[6]=0,e[7]=0;return e[0]=1,e[4]=1,e[8]=1,e}function Zrr(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[4],e[4]=t[5],e[5]=t[6],e[6]=t[8],e[7]=t[9],e[8]=t[10],e}function eir(e){var t=new T4.ARRAY_TYPE(9);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t}function tir(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}function nir(e,t,n,o,r,i,s,a,c){var l=new T4.ARRAY_TYPE(9);return l[0]=e,l[1]=t,l[2]=n,l[3]=o,l[4]=r,l[5]=i,l[6]=s,l[7]=a,l[8]=c,l}function oir(e,t,n,o,r,i,s,a,c,l){return e[0]=t,e[1]=n,e[2]=o,e[3]=r,e[4]=i,e[5]=s,e[6]=a,e[7]=c,e[8]=l,e}function rir(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}function iir(e,t){if(e===t){var n=t[1],o=t[2],r=t[5];e[1]=t[3],e[2]=t[6],e[3]=n,e[5]=t[7],e[6]=o,e[7]=r}else e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8];return e}function sir(e,t){var n=t[0],o=t[1],r=t[2],i=t[3],s=t[4],a=t[5],c=t[6],l=t[7],h=t[8],d=h*s-a*l,u=-h*i+a*c,_=l*i-s*c,p=n*d+o*u+r*_;if(!p)return null;return p=1/p,e[0]=d*p,e[1]=(-h*o+r*l)*p,e[2]=(a*o-r*s)*p,e[3]=u*p,e[4]=(h*n-r*c)*p,e[5]=(-a*n+r*i)*p,e[6]=_*p,e[7]=(-l*n+o*c)*p,e[8]=(s*n-o*i)*p,e}function air(e,t){var n=t[0],o=t[1],r=t[2],i=t[3],s=t[4],a=t[5],c=t[6],l=t[7],h=t[8];return e[0]=s*h-a*l,e[1]=r*l-o*h,e[2]=o*a-r*s,e[3]=a*c-i*h,e[4]=n*h-r*c,e[5]=r*i-n*a,e[6]=i*l-s*c,e[7]=o*c-n*l,e[8]=n*s-o*i,e}function cir(e){var t=e[0],n=e[1],o=e[2],r=e[3],i=e[4],s=e[5],a=e[6],c=e[7],l=e[8];return t*(l*i-s*c)+n*(-l*r+s*a)+o*(c*r-i*a)}function Xkt(e,t,n){var o=t[0],r=t[1],i=t[2],s=t[3],a=t[4],c=t[5],l=t[6],h=t[7],d=t[8],u=n[0],_=n[1],p=n[2],m=n[3],A=n[4],g=n[5],f=n[6],y=n[7],x=n[8];return e[0]=u*o+_*s+p*l,e[1]=u*r+_*a+p*h,e[2]=u*i+_*c+p*d,e[3]=m*o+A*s+g*l,e[4]=m*r+A*a+g*h,e[5]=m*i+A*c+g*d,e[6]=f*o+y*s+x*l,e[7]=f*r+y*a+x*h,e[8]=f*i+y*c+x*d,e}function lir(e,t,n){var o=t[0],r=t[1],i=t[2],s=t[3],a=t[4],c=t[5],l=t[6],h=t[7],d=t[8],u=n[0],_=n[1];return e[0]=o,e[1]=r,e[2]=i,e[3]=s,e[4]=a,e[5]=c,e[6]=u*o+_*s+l,e[7]=u*r+_*a+h,e[8]=u*i+_*c+d,e}function hir(e,t,n){var o=t[0],r=t[1],i=t[2],s=t[3],a=t[4],c=t[5],l=t[6],h=t[7],d=t[8],u=Math.sin(n),_=Math.cos(n);return e[0]=_*o+u*s,e[1]=_*r+u*a,e[2]=_*i+u*c,e[3]=_*s-u*o,e[4]=_*a-u*r,e[5]=_*c-u*i,e[6]=l,e[7]=h,e[8]=d,e}function dir(e,t,n){var o=n[0],r=n[1];return e[0]=o*t[0],e[1]=o*t[1],e[2]=o*t[2],e[3]=r*t[3],e[4]=r*t[4],e[5]=r*t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}function uir(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=t[0],e[7]=t[1],e[8]=1,e}function pir(e,t){var n=Math.sin(t),o=Math.cos(t);return e[0]=o,e[1]=n,e[2]=0,e[3]=-n,e[4]=o,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}function mir(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=0,e[4]=t[1],e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}function _ir(e,t){return e[0]=t[0],e[1]=t[1],e[2]=0,e[3]=t[2],e[4]=t[3],e[5]=0,e[6]=t[4],e[7]=t[5],e[8]=1,e}function gir(e,t){var n=t[0],o=t[1],r=t[2],i=t[3],s=n+n,a=o+o,c=r+r,l=n*s,h=o*s,d=o*a,u=r*s,_=r*a,p=r*c,m=i*s,A=i*a,g=i*c;return e[0]=1-d-p,e[3]=h-g,e[6]=u+A,e[1]=h+g,e[4]=1-l-p,e[7]=_-m,e[2]=u-A,e[5]=_+m,e[8]=1-l-d,e}function Air(e,t){var n=t[0],o=t[1],r=t[2],i=t[3],s=t[4],a=t[5],c=t[6],l=t[7],h=t[8],d=t[9],u=t[10],_=t[11],p=t[12],m=t[13],A=t[14],g=t[15],f=n*a-o*s,y=n*c-r*s,x=n*l-i*s,C=o*c-r*a,b=o*l-i*a,I=r*l-i*c,v=h*m-d*p,P=h*A-u*p,M=h*g-_*p,B=d*A-u*m,T=d*g-_*m,N=u*g-_*A,D=f*N-y*T+x*B+C*M-b*P+I*v;if(!D)return null;return D=1/D,e[0]=(a*N-c*T+l*B)*D,e[1]=(c*M-s*N-l*P)*D,e[2]=(s*T-a*M+l*v)*D,e[3]=(r*T-o*N-i*B)*D,e[4]=(n*N-r*M+i*P)*D,e[5]=(o*M-n*T-i*v)*D,e[6]=(m*I-A*b+g*C)*D,e[7]=(A*x-p*I-g*y)*D,e[8]=(p*b-m*x+g*f)*D,e}function fir(e,t,n){return e[0]=2/t,e[1]=0,e[2]=0,e[3]=0,e[4]=-2/n,e[5]=0,e[6]=-1,e[7]=1,e[8]=1,e}function yir(e){return"mat3("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+", "+e[4]+", "+e[5]+", "+e[6]+", "+e[7]+", "+e[8]+")"}function xir(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]+e[3]*e[3]+e[4]*e[4]+e[5]*e[5]+e[6]*e[6]+e[7]*e[7]+e[8]*e[8])}function Cir(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e[4]=t[4]+n[4],e[5]=t[5]+n[5],e[6]=t[6]+n[6],e[7]=t[7]+n[7],e[8]=t[8]+n[8],e}function jkt(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e[4]=t[4]-n[4],e[5]=t[5]-n[5],e[6]=t[6]-n[6],e[7]=t[7]-n[7],e[8]=t[8]-n[8],e}function bir(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*n,e[5]=t[5]*n,e[6]=t[6]*n,e[7]=t[7]*n,e[8]=t[8]*n,e}function Iir(e,t,n,o){return e[0]=t[0]+n[0]*o,e[1]=t[1]+n[1]*o,e[2]=t[2]+n[2]*o,e[3]=t[3]+n[3]*o,e[4]=t[4]+n[4]*o,e[5]=t[5]+n[5]*o,e[6]=t[6]+n[6]*o,e[7]=t[7]+n[7]*o,e[8]=t[8]+n[8]*o,e}function vir(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]}function Sir(e,t){var n=e[0],o=e[1],r=e[2],i=e[3],s=e[4],a=e[5],c=e[6],l=e[7],h=e[8],d=t[0],u=t[1],_=t[2],p=t[3],m=t[4],A=t[5],g=t[6],f=t[7],y=t[8];return Math.abs(n-d)<=T4.EPSILON*Math.max(1,Math.abs(n),Math.abs(d))&&Math.abs(o-u)<=T4.EPSILON*Math.max(1,Math.abs(o),Math.abs(u))&&Math.abs(r-_)<=T4.EPSILON*Math.max(1,Math.abs(r),Math.abs(_))&&Math.abs(i-p)<=T4.EPSILON*Math.max(1,Math.abs(i),Math.abs(p))&&Math.abs(s-m)<=T4.EPSILON*Math.max(1,Math.abs(s),Math.abs(m))&&Math.abs(a-A)<=T4.EPSILON*Math.max(1,Math.abs(a),Math.abs(A))&&Math.abs(c-g)<=T4.EPSILON*Math.max(1,Math.abs(c),Math.abs(g))&&Math.abs(l-f)<=T4.EPSILON*Math.max(1,Math.abs(l),Math.abs(f))&&Math.abs(h-y)<=T4.EPSILON*Math.max(1,Math.abs(h),Math.abs(y))}var tDs=Kkt.mul=Xkt,nDs=Kkt.sub=jkt});var PUe=lt(function(sLt){function SUe(e){return SUe=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},SUe(e)}Object.defineProperty(sLt,"__esModule",{value:!0});sLt.add=Hsr;sLt.adjoint=lsr;sLt.clone=osr;sLt.copy=rsr;sLt.create=nsr;sLt.decompose=Psr;sLt.determinant=hsr;sLt.equals=Vsr;sLt.exactEquals=Osr;sLt.frob=Lsr;sLt.fromQuat=wsr;sLt.fromQuat2=Isr;sLt.fromRotation=ysr;sLt.fromRotationTranslation=tLt;sLt.fromRotationTranslationScale=Esr;sLt.fromRotationTranslationScaleOrigin=Msr;sLt.fromScaling=fsr;sLt.fromTranslation=Asr;sLt.fromValues=isr;sLt.fromXRotation=xsr;sLt.fromYRotation=Csr;sLt.fromZRotation=bsr;sLt.frustum=Bsr;sLt.getRotation=Ssr;sLt.getScaling=nLt;sLt.getTranslation=vsr;sLt.identity=Zkt;sLt.invert=csr;sLt.lookAt=Rsr;sLt.mul=void 0;sLt.multiply=eLt;sLt.multiplyScalar=Fsr;sLt.multiplyScalarAndAdd=zsr;sLt.ortho=void 0;sLt.orthoNO=rLt;sLt.orthoZO=Nsr;sLt.perspective=void 0;sLt.perspectiveFromFieldOfView=Dsr;sLt.perspectiveNO=oLt;sLt.perspectiveZO=Tsr;sLt.rotate=psr;sLt.rotateX=msr;sLt.rotateY=_sr;sLt.rotateZ=gsr;sLt.scale=usr;sLt.set=ssr;sLt.str=ksr;sLt.sub=void 0;sLt.subtract=iLt;sLt.targetTo=Qsr;sLt.translate=dsr;sLt.transpose=asr;var Ed=Jkt(qI());function Jkt(e,t){if(typeof WeakMap=="function")var n=new WeakMap,o=new WeakMap;return(Jkt=function(i,s){if(!s&&i&&i.__esModule)return i;var a,c,l={__proto__:null,default:i};if(i===null||SUe(i)!="object"&&typeof i!="function")return l;if(a=s?o:n){if(a.has(i))return a.get(i);a.set(i,l)}for(var h in i)h!=="default"&&{}.hasOwnProperty.call(i,h)&&((c=(a=Object.defineProperty)&&Object.getOwnPropertyDescriptor(i,h))&&(c.get||c.set)?a(l,h,c):l[h]=i[h]);return l})(e,t)}function nsr(){var e=new Ed.ARRAY_TYPE(16);if(Ed.ARRAY_TYPE!=Float32Array)e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0;return e[0]=1,e[5]=1,e[10]=1,e[15]=1,e}function osr(e){var t=new Ed.ARRAY_TYPE(16);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function rsr(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function isr(e,t,n,o,r,i,s,a,c,l,h,d,u,_,p,m){var A=new Ed.ARRAY_TYPE(16);return A[0]=e,A[1]=t,A[2]=n,A[3]=o,A[4]=r,A[5]=i,A[6]=s,A[7]=a,A[8]=c,A[9]=l,A[10]=h,A[11]=d,A[12]=u,A[13]=_,A[14]=p,A[15]=m,A}function ssr(e,t,n,o,r,i,s,a,c,l,h,d,u,_,p,m,A){return e[0]=t,e[1]=n,e[2]=o,e[3]=r,e[4]=i,e[5]=s,e[6]=a,e[7]=c,e[8]=l,e[9]=h,e[10]=d,e[11]=u,e[12]=_,e[13]=p,e[14]=m,e[15]=A,e}function Zkt(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function asr(e,t){if(e===t){var n=t[1],o=t[2],r=t[3],i=t[6],s=t[7],a=t[11];e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=n,e[6]=t[9],e[7]=t[13],e[8]=o,e[9]=i,e[11]=t[14],e[12]=r,e[13]=s,e[14]=a}else e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=t[1],e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=t[2],e[9]=t[6],e[10]=t[10],e[11]=t[14],e[12]=t[3],e[13]=t[7],e[14]=t[11],e[15]=t[15];return e}function csr(e,t){var n=t[0],o=t[1],r=t[2],i=t[3],s=t[4],a=t[5],c=t[6],l=t[7],h=t[8],d=t[9],u=t[10],_=t[11],p=t[12],m=t[13],A=t[14],g=t[15],f=n*a-o*s,y=n*c-r*s,x=n*l-i*s,C=o*c-r*a,b=o*l-i*a,I=r*l-i*c,v=h*m-d*p,P=h*A-u*p,M=h*g-_*p,B=d*A-u*m,T=d*g-_*m,N=u*g-_*A,D=f*N-y*T+x*B+C*M-b*P+I*v;if(!D)return null;return D=1/D,e[0]=(a*N-c*T+l*B)*D,e[1]=(r*T-o*N-i*B)*D,e[2]=(m*I-A*b+g*C)*D,e[3]=(u*b-d*I-_*C)*D,e[4]=(c*M-s*N-l*P)*D,e[5]=(n*N-r*M+i*P)*D,e[6]=(A*x-p*I-g*y)*D,e[7]=(h*I-u*x+_*y)*D,e[8]=(s*T-a*M+l*v)*D,e[9]=(o*M-n*T-i*v)*D,e[10]=(p*b-m*x+g*f)*D,e[11]=(d*x-h*b-_*f)*D,e[12]=(a*P-s*B-c*v)*D,e[13]=(n*B-o*P+r*v)*D,e[14]=(m*y-p*C-A*f)*D,e[15]=(h*C-d*y+u*f)*D,e}function lsr(e,t){var n=t[0],o=t[1],r=t[2],i=t[3],s=t[4],a=t[5],c=t[6],l=t[7],h=t[8],d=t[9],u=t[10],_=t[11],p=t[12],m=t[13],A=t[14],g=t[15],f=n*a-o*s,y=n*c-r*s,x=n*l-i*s,C=o*c-r*a,b=o*l-i*a,I=r*l-i*c,v=h*m-d*p,P=h*A-u*p,M=h*g-_*p,B=d*A-u*m,T=d*g-_*m,N=u*g-_*A;return e[0]=a*N-c*T+l*B,e[1]=r*T-o*N-i*B,e[2]=m*I-A*b+g*C,e[3]=u*b-d*I-_*C,e[4]=c*M-s*N-l*P,e[5]=n*N-r*M+i*P,e[6]=A*x-p*I-g*y,e[7]=h*I-u*x+_*y,e[8]=s*T-a*M+l*v,e[9]=o*M-n*T-i*v,e[10]=p*b-m*x+g*f,e[11]=d*x-h*b-_*f,e[12]=a*P-s*B-c*v,e[13]=n*B-o*P+r*v,e[14]=m*y-p*C-A*f,e[15]=h*C-d*y+u*f,e}function hsr(e){var t=e[0],n=e[1],o=e[2],r=e[3],i=e[4],s=e[5],a=e[6],c=e[7],l=e[8],h=e[9],d=e[10],u=e[11],_=e[12],p=e[13],m=e[14],A=e[15],g=t*s-n*i,f=t*a-o*i,y=n*a-o*s,x=l*p-h*_,C=l*m-d*_,b=h*m-d*p,I=t*b-n*C+o*x,v=i*b-s*C+a*x,P=l*y-h*f+d*g,M=_*y-p*f+m*g;return c*I-r*v+A*P-u*M}function eLt(e,t,n){var o=t[0],r=t[1],i=t[2],s=t[3],a=t[4],c=t[5],l=t[6],h=t[7],d=t[8],u=t[9],_=t[10],p=t[11],m=t[12],A=t[13],g=t[14],f=t[15],y=n[0],x=n[1],C=n[2],b=n[3];return e[0]=y*o+x*a+C*d+b*m,e[1]=y*r+x*c+C*u+b*A,e[2]=y*i+x*l+C*_+b*g,e[3]=y*s+x*h+C*p+b*f,y=n[4],x=n[5],C=n[6],b=n[7],e[4]=y*o+x*a+C*d+b*m,e[5]=y*r+x*c+C*u+b*A,e[6]=y*i+x*l+C*_+b*g,e[7]=y*s+x*h+C*p+b*f,y=n[8],x=n[9],C=n[10],b=n[11],e[8]=y*o+x*a+C*d+b*m,e[9]=y*r+x*c+C*u+b*A,e[10]=y*i+x*l+C*_+b*g,e[11]=y*s+x*h+C*p+b*f,y=n[12],x=n[13],C=n[14],b=n[15],e[12]=y*o+x*a+C*d+b*m,e[13]=y*r+x*c+C*u+b*A,e[14]=y*i+x*l+C*_+b*g,e[15]=y*s+x*h+C*p+b*f,e}function dsr(e,t,n){var o=n[0],r=n[1],i=n[2],s,a,c,l,h,d,u,_,p,m,A,g;if(t===e)e[12]=t[0]*o+t[4]*r+t[8]*i+t[12],e[13]=t[1]*o+t[5]*r+t[9]*i+t[13],e[14]=t[2]*o+t[6]*r+t[10]*i+t[14],e[15]=t[3]*o+t[7]*r+t[11]*i+t[15];else s=t[0],a=t[1],c=t[2],l=t[3],h=t[4],d=t[5],u=t[6],_=t[7],p=t[8],m=t[9],A=t[10],g=t[11],e[0]=s,e[1]=a,e[2]=c,e[3]=l,e[4]=h,e[5]=d,e[6]=u,e[7]=_,e[8]=p,e[9]=m,e[10]=A,e[11]=g,e[12]=s*o+h*r+p*i+t[12],e[13]=a*o+d*r+m*i+t[13],e[14]=c*o+u*r+A*i+t[14],e[15]=l*o+_*r+g*i+t[15];return e}function usr(e,t,n){var o=n[0],r=n[1],i=n[2];return e[0]=t[0]*o,e[1]=t[1]*o,e[2]=t[2]*o,e[3]=t[3]*o,e[4]=t[4]*r,e[5]=t[5]*r,e[6]=t[6]*r,e[7]=t[7]*r,e[8]=t[8]*i,e[9]=t[9]*i,e[10]=t[10]*i,e[11]=t[11]*i,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function psr(e,t,n,o){var r=o[0],i=o[1],s=o[2],a=Math.sqrt(r*r+i*i+s*s),c,l,h,d,u,_,p,m,A,g,f,y,x,C,b,I,v,P,M,B,T,N,D,L;if(a<Ed.EPSILON)return null;if(a=1/a,r*=a,i*=a,s*=a,c=Math.sin(n),l=Math.cos(n),h=1-l,d=t[0],u=t[1],_=t[2],p=t[3],m=t[4],A=t[5],g=t[6],f=t[7],y=t[8],x=t[9],C=t[10],b=t[11],I=r*r*h+l,v=i*r*h+s*c,P=s*r*h-i*c,M=r*i*h-s*c,B=i*i*h+l,T=s*i*h+r*c,N=r*s*h+i*c,D=i*s*h-r*c,L=s*s*h+l,e[0]=d*I+m*v+y*P,e[1]=u*I+A*v+x*P,e[2]=_*I+g*v+C*P,e[3]=p*I+f*v+b*P,e[4]=d*M+m*B+y*T,e[5]=u*M+A*B+x*T,e[6]=_*M+g*B+C*T,e[7]=p*M+f*B+b*T,e[8]=d*N+m*D+y*L,e[9]=u*N+A*D+x*L,e[10]=_*N+g*D+C*L,e[11]=p*N+f*D+b*L,t!==e)e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15];return e}function msr(e,t,n){var o=Math.sin(n),r=Math.cos(n),i=t[4],s=t[5],a=t[6],c=t[7],l=t[8],h=t[9],d=t[10],u=t[11];if(t!==e)e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15];return e[4]=i*r+l*o,e[5]=s*r+h*o,e[6]=a*r+d*o,e[7]=c*r+u*o,e[8]=l*r-i*o,e[9]=h*r-s*o,e[10]=d*r-a*o,e[11]=u*r-c*o,e}function _sr(e,t,n){var o=Math.sin(n),r=Math.cos(n),i=t[0],s=t[1],a=t[2],c=t[3],l=t[8],h=t[9],d=t[10],u=t[11];if(t!==e)e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15];return e[0]=i*r-l*o,e[1]=s*r-h*o,e[2]=a*r-d*o,e[3]=c*r-u*o,e[8]=i*o+l*r,e[9]=s*o+h*r,e[10]=a*o+d*r,e[11]=c*o+u*r,e}function gsr(e,t,n){var o=Math.sin(n),r=Math.cos(n),i=t[0],s=t[1],a=t[2],c=t[3],l=t[4],h=t[5],d=t[6],u=t[7];if(t!==e)e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15];return e[0]=i*r+l*o,e[1]=s*r+h*o,e[2]=a*r+d*o,e[3]=c*r+u*o,e[4]=l*r-i*o,e[5]=h*r-s*o,e[6]=d*r-a*o,e[7]=u*r-c*o,e}function Asr(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=t[0],e[13]=t[1],e[14]=t[2],e[15]=1,e}function fsr(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=t[1],e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=t[2],e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function ysr(e,t,n){var o=n[0],r=n[1],i=n[2],s=Math.sqrt(o*o+r*r+i*i),a,c,l;if(s<Ed.EPSILON)return null;return s=1/s,o*=s,r*=s,i*=s,a=Math.sin(t),c=Math.cos(t),l=1-c,e[0]=o*o*l+c,e[1]=r*o*l+i*a,e[2]=i*o*l-r*a,e[3]=0,e[4]=o*r*l-i*a,e[5]=r*r*l+c,e[6]=i*r*l+o*a,e[7]=0,e[8]=o*i*l+r*a,e[9]=r*i*l-o*a,e[10]=i*i*l+c,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function xsr(e,t){var n=Math.sin(t),o=Math.cos(t);return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=o,e[6]=n,e[7]=0,e[8]=0,e[9]=-n,e[10]=o,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function Csr(e,t){var n=Math.sin(t),o=Math.cos(t);return e[0]=o,e[1]=0,e[2]=-n,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=n,e[9]=0,e[10]=o,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function bsr(e,t){var n=Math.sin(t),o=Math.cos(t);return e[0]=o,e[1]=n,e[2]=0,e[3]=0,e[4]=-n,e[5]=o,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function tLt(e,t,n){var o=t[0],r=t[1],i=t[2],s=t[3],a=o+o,c=r+r,l=i+i,h=o*a,d=o*c,u=o*l,_=r*c,p=r*l,m=i*l,A=s*a,g=s*c,f=s*l;return e[0]=1-(_+m),e[1]=d+f,e[2]=u-g,e[3]=0,e[4]=d-f,e[5]=1-(h+m),e[6]=p+A,e[7]=0,e[8]=u+g,e[9]=p-A,e[10]=1-(h+_),e[11]=0,e[12]=n[0],e[13]=n[1],e[14]=n[2],e[15]=1,e}function Isr(e,t){var n=new Ed.ARRAY_TYPE(3),o=-t[0],r=-t[1],i=-t[2],s=t[3],a=t[4],c=t[5],l=t[6],h=t[7],d=o*o+r*r+i*i+s*s;if(d>0)n[0]=(a*s+h*o+c*i-l*r)*2/d,n[1]=(c*s+h*r+l*o-a*i)*2/d,n[2]=(l*s+h*i+a*r-c*o)*2/d;else n[0]=(a*s+h*o+c*i-l*r)*2,n[1]=(c*s+h*r+l*o-a*i)*2,n[2]=(l*s+h*i+a*r-c*o)*2;return tLt(e,t,n),e}function vsr(e,t){return e[0]=t[12],e[1]=t[13],e[2]=t[14],e}function nLt(e,t){var n=t[0],o=t[1],r=t[2],i=t[4],s=t[5],a=t[6],c=t[8],l=t[9],h=t[10];return e[0]=Math.sqrt(n*n+o*o+r*r),e[1]=Math.sqrt(i*i+s*s+a*a),e[2]=Math.sqrt(c*c+l*l+h*h),e}function Ssr(e,t){var n=new Ed.ARRAY_TYPE(3);nLt(n,t);var o=1/n[0],r=1/n[1],i=1/n[2],s=t[0]*o,a=t[1]*r,c=t[2]*i,l=t[4]*o,h=t[5]*r,d=t[6]*i,u=t[8]*o,_=t[9]*r,p=t[10]*i,m=s+h+p,A=0;if(m>0)A=Math.sqrt(m+1)*2,e[3]=0.25*A,e[0]=(d-_)/A,e[1]=(u-c)/A,e[2]=(a-l)/A;else if(s>h&&s>p)A=Math.sqrt(1+s-h-p)*2,e[3]=(d-_)/A,e[0]=0.25*A,e[1]=(a+l)/A,e[2]=(u+c)/A;else if(h>p)A=Math.sqrt(1+h-s-p)*2,e[3]=(u-c)/A,e[0]=(a+l)/A,e[1]=0.25*A,e[2]=(d+_)/A;else A=Math.sqrt(1+p-s-h)*2,e[3]=(a-l)/A,e[0]=(u+c)/A,e[1]=(d+_)/A,e[2]=0.25*A;return e}function Psr(e,t,n,o){t[0]=o[12],t[1]=o[13],t[2]=o[14];var r=o[0],i=o[1],s=o[2],a=o[4],c=o[5],l=o[6],h=o[8],d=o[9],u=o[10];n[0]=Math.sqrt(r*r+i*i+s*s),n[1]=Math.sqrt(a*a+c*c+l*l),n[2]=Math.sqrt(h*h+d*d+u*u);var _=1/n[0],p=1/n[1],m=1/n[2],A=r*_,g=i*p,f=s*m,y=a*_,x=c*p,C=l*m,b=h*_,I=d*p,v=u*m,P=A+x+v,M=0;if(P>0)M=Math.sqrt(P+1)*2,e[3]=0.25*M,e[0]=(C-I)/M,e[1]=(b-f)/M,e[2]=(g-y)/M;else if(A>x&&A>v)M=Math.sqrt(1+A-x-v)*2,e[3]=(C-I)/M,e[0]=0.25*M,e[1]=(g+y)/M,e[2]=(b+f)/M;else if(x>v)M=Math.sqrt(1+x-A-v)*2,e[3]=(b-f)/M,e[0]=(g+y)/M,e[1]=0.25*M,e[2]=(C+I)/M;else M=Math.sqrt(1+v-A-x)*2,e[3]=(g-y)/M,e[0]=(b+f)/M,e[1]=(C+I)/M,e[2]=0.25*M;return e}function Esr(e,t,n,o){var r=t[0],i=t[1],s=t[2],a=t[3],c=r+r,l=i+i,h=s+s,d=r*c,u=r*l,_=r*h,p=i*l,m=i*h,A=s*h,g=a*c,f=a*l,y=a*h,x=o[0],C=o[1],b=o[2];return e[0]=(1-(p+A))*x,e[1]=(u+y)*x,e[2]=(_-f)*x,e[3]=0,e[4]=(u-y)*C,e[5]=(1-(d+A))*C,e[6]=(m+g)*C,e[7]=0,e[8]=(_+f)*b,e[9]=(m-g)*b,e[10]=(1-(d+p))*b,e[11]=0,e[12]=n[0],e[13]=n[1],e[14]=n[2],e[15]=1,e}function Msr(e,t,n,o,r){var i=t[0],s=t[1],a=t[2],c=t[3],l=i+i,h=s+s,d=a+a,u=i*l,_=i*h,p=i*d,m=s*h,A=s*d,g=a*d,f=c*l,y=c*h,x=c*d,C=o[0],b=o[1],I=o[2],v=r[0],P=r[1],M=r[2],B=(1-(m+g))*C,T=(_+x)*C,N=(p-y)*C,D=(_-x)*b,L=(1-(u+g))*b,H=(A+f)*b,V=(p+y)*I,O=(A-f)*I,U=(1-(u+m))*I;return e[0]=B,e[1]=T,e[2]=N,e[3]=0,e[4]=D,e[5]=L,e[6]=H,e[7]=0,e[8]=V,e[9]=O,e[10]=U,e[11]=0,e[12]=n[0]+v-(B*v+D*P+V*M),e[13]=n[1]+P-(T*v+L*P+O*M),e[14]=n[2]+M-(N*v+H*P+U*M),e[15]=1,e}function wsr(e,t){var n=t[0],o=t[1],r=t[2],i=t[3],s=n+n,a=o+o,c=r+r,l=n*s,h=o*s,d=o*a,u=r*s,_=r*a,p=r*c,m=i*s,A=i*a,g=i*c;return e[0]=1-d-p,e[1]=h+g,e[2]=u-A,e[3]=0,e[4]=h-g,e[5]=1-l-p,e[6]=_+m,e[7]=0,e[8]=u+A,e[9]=_-m,e[10]=1-l-d,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function Bsr(e,t,n,o,r,i,s){var a=1/(n-t),c=1/(r-o),l=1/(i-s);return e[0]=i*2*a,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=i*2*c,e[6]=0,e[7]=0,e[8]=(n+t)*a,e[9]=(r+o)*c,e[10]=(s+i)*l,e[11]=-1,e[12]=0,e[13]=0,e[14]=s*i*2*l,e[15]=0,e}function oLt(e,t,n,o,r){var i=1/Math.tan(t/2);if(e[0]=i/n,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=i,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,r!=null&&r!==1/0){var s=1/(o-r);e[10]=(r+o)*s,e[14]=2*r*o*s}else e[10]=-1,e[14]=-2*o;return e}var rDs=sLt.perspective=oLt;function Tsr(e,t,n,o,r){var i=1/Math.tan(t/2);if(e[0]=i/n,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=i,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,r!=null&&r!==1/0){var s=1/(o-r);e[10]=r*s,e[14]=r*o*s}else e[10]=-1,e[14]=-o;return e}function Dsr(e,t,n,o){var r=Math.tan(t.upDegrees*Math.PI/180),i=Math.tan(t.downDegrees*Math.PI/180),s=Math.tan(t.leftDegrees*Math.PI/180),a=Math.tan(t.rightDegrees*Math.PI/180),c=2/(s+a),l=2/(r+i);return e[0]=c,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=l,e[6]=0,e[7]=0,e[8]=-((s-a)*c*0.5),e[9]=(r-i)*l*0.5,e[10]=o/(n-o),e[11]=-1,e[12]=0,e[13]=0,e[14]=o*n/(n-o),e[15]=0,e}function rLt(e,t,n,o,r,i,s){var a=1/(t-n),c=1/(o-r),l=1/(i-s);return e[0]=-2*a,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*c,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*l,e[11]=0,e[12]=(t+n)*a,e[13]=(r+o)*c,e[14]=(s+i)*l,e[15]=1,e}var iDs=sLt.ortho=rLt;function Nsr(e,t,n,o,r,i,s){var a=1/(t-n),c=1/(o-r),l=1/(i-s);return e[0]=-2*a,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*c,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=l,e[11]=0,e[12]=(t+n)*a,e[13]=(r+o)*c,e[14]=i*l,e[15]=1,e}function Rsr(e,t,n,o){var r,i,s,a,c,l,h,d,u,_,p=t[0],m=t[1],A=t[2],g=o[0],f=o[1],y=o[2],x=n[0],C=n[1],b=n[2];if(Math.abs(p-x)<Ed.EPSILON&&Math.abs(m-C)<Ed.EPSILON&&Math.abs(A-b)<Ed.EPSILON)return Zkt(e);if(h=p-x,d=m-C,u=A-b,_=1/Math.sqrt(h*h+d*d+u*u),h*=_,d*=_,u*=_,r=f*u-y*d,i=y*h-g*u,s=g*d-f*h,_=Math.sqrt(r*r+i*i+s*s),!_)r=0,i=0,s=0;else _=1/_,r*=_,i*=_,s*=_;if(a=d*s-u*i,c=u*r-h*s,l=h*i-d*r,_=Math.sqrt(a*a+c*c+l*l),!_)a=0,c=0,l=0;else _=1/_,a*=_,c*=_,l*=_;return e[0]=r,e[1]=a,e[2]=h,e[3]=0,e[4]=i,e[5]=c,e[6]=d,e[7]=0,e[8]=s,e[9]=l,e[10]=u,e[11]=0,e[12]=-(r*p+i*m+s*A),e[13]=-(a*p+c*m+l*A),e[14]=-(h*p+d*m+u*A),e[15]=1,e}function Qsr(e,t,n,o){var r=t[0],i=t[1],s=t[2],a=o[0],c=o[1],l=o[2],h=r-n[0],d=i-n[1],u=s-n[2],_=h*h+d*d+u*u;if(_>0)_=1/Math.sqrt(_),h*=_,d*=_,u*=_;var p=c*u-l*d,m=l*h-a*u,A=a*d-c*h;if(_=p*p+m*m+A*A,_>0)_=1/Math.sqrt(_),p*=_,m*=_,A*=_;return e[0]=p,e[1]=m,e[2]=A,e[3]=0,e[4]=d*A-u*m,e[5]=u*p-h*A,e[6]=h*m-d*p,e[7]=0,e[8]=h,e[9]=d,e[10]=u,e[11]=0,e[12]=r,e[13]=i,e[14]=s,e[15]=1,e}function ksr(e){return"mat4("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+", "+e[4]+", "+e[5]+", "+e[6]+", "+e[7]+", "+e[8]+", "+e[9]+", "+e[10]+", "+e[11]+", "+e[12]+", "+e[13]+", "+e[14]+", "+e[15]+")"}function Lsr(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]+e[3]*e[3]+e[4]*e[4]+e[5]*e[5]+e[6]*e[6]+e[7]*e[7]+e[8]*e[8]+e[9]*e[9]+e[10]*e[10]+e[11]*e[11]+e[12]*e[12]+e[13]*e[13]+e[14]*e[14]+e[15]*e[15])}function Hsr(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e[4]=t[4]+n[4],e[5]=t[5]+n[5],e[6]=t[6]+n[6],e[7]=t[7]+n[7],e[8]=t[8]+n[8],e[9]=t[9]+n[9],e[10]=t[10]+n[10],e[11]=t[11]+n[11],e[12]=t[12]+n[12],e[13]=t[13]+n[13],e[14]=t[14]+n[14],e[15]=t[15]+n[15],e}function iLt(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e[4]=t[4]-n[4],e[5]=t[5]-n[5],e[6]=t[6]-n[6],e[7]=t[7]-n[7],e[8]=t[8]-n[8],e[9]=t[9]-n[9],e[10]=t[10]-n[10],e[11]=t[11]-n[11],e[12]=t[12]-n[12],e[13]=t[13]-n[13],e[14]=t[14]-n[14],e[15]=t[15]-n[15],e}function Fsr(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*n,e[5]=t[5]*n,e[6]=t[6]*n,e[7]=t[7]*n,e[8]=t[8]*n,e[9]=t[9]*n,e[10]=t[10]*n,e[11]=t[11]*n,e[12]=t[12]*n,e[13]=t[13]*n,e[14]=t[14]*n,e[15]=t[15]*n,e}function zsr(e,t,n,o){return e[0]=t[0]+n[0]*o,e[1]=t[1]+n[1]*o,e[2]=t[2]+n[2]*o,e[3]=t[3]+n[3]*o,e[4]=t[4]+n[4]*o,e[5]=t[5]+n[5]*o,e[6]=t[6]+n[6]*o,e[7]=t[7]+n[7]*o,e[8]=t[8]+n[8]*o,e[9]=t[9]+n[9]*o,e[10]=t[10]+n[10]*o,e[11]=t[11]+n[11]*o,e[12]=t[12]+n[12]*o,e[13]=t[13]+n[13]*o,e[14]=t[14]+n[14]*o,e[15]=t[15]+n[15]*o,e}function Osr(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[11]===t[11]&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[15]===t[15]}function Vsr(e,t){var n=e[0],o=e[1],r=e[2],i=e[3],s=e[4],a=e[5],c=e[6],l=e[7],h=e[8],d=e[9],u=e[10],_=e[11],p=e[12],m=e[13],A=e[14],g=e[15],f=t[0],y=t[1],x=t[2],C=t[3],b=t[4],I=t[5],v=t[6],P=t[7],M=t[8],B=t[9],T=t[10],N=t[11],D=t[12],L=t[13],H=t[14],V=t[15];return Math.abs(n-f)<=Ed.EPSILON*Math.max(1,Math.abs(n),Math.abs(f))&&Math.abs(o-y)<=Ed.EPSILON*Math.max(1,Math.abs(o),Math.abs(y))&&Math.abs(r-x)<=Ed.EPSILON*Math.max(1,Math.abs(r),Math.abs(x))&&Math.abs(i-C)<=Ed.EPSILON*Math.max(1,Math.abs(i),Math.abs(C))&&Math.abs(s-b)<=Ed.EPSILON*Math.max(1,Math.abs(s),Math.abs(b))&&Math.abs(a-I)<=Ed.EPSILON*Math.max(1,Math.abs(a),Math.abs(I))&&Math.abs(c-v)<=Ed.EPSILON*Math.max(1,Math.abs(c),Math.abs(v))&&Math.abs(l-P)<=Ed.EPSILON*Math.max(1,Math.abs(l),Math.abs(P))&&Math.abs(h-M)<=Ed.EPSILON*Math.max(1,Math.abs(h),Math.abs(M))&&Math.abs(d-B)<=Ed.EPSILON*Math.max(1,Math.abs(d),Math.abs(B))&&Math.abs(u-T)<=Ed.EPSILON*Math.max(1,Math.abs(u),Math.abs(T))&&Math.abs(_-N)<=Ed.EPSILON*Math.max(1,Math.abs(_),Math.abs(N))&&Math.abs(p-D)<=Ed.EPSILON*Math.max(1,Math.abs(p),Math.abs(D))&&Math.abs(m-L)<=Ed.EPSILON*Math.max(1,Math.abs(m),Math.abs(L))&&Math.abs(A-H)<=Ed.EPSILON*Math.max(1,Math.abs(A),Math.abs(H))&&Math.abs(g-V)<=Ed.EPSILON*Math.max(1,Math.abs(g),Math.abs(V))}var sDs=sLt.mul=eLt,aDs=sLt.sub=iLt});var wUe=lt(function(xLt){function EUe(e){return EUe=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},EUe(e)}Object.defineProperty(xLt,"__esModule",{value:!0});xLt.add=Var;xLt.angle=dcr;xLt.bezier=ocr;xLt.ceil=Yar;xLt.clone=Har;xLt.copy=zar;xLt.create=uLt;xLt.cross=Zar;xLt.dist=void 0;xLt.distance=ALt;xLt.div=void 0;xLt.divide=gLt;xLt.dot=MUe;xLt.equals=_cr;xLt.exactEquals=mcr;xLt.floor=Gar;xLt.forEach=void 0;xLt.fromValues=Far;xLt.hermite=ncr;xLt.inverse=qar;xLt.len=void 0;xLt.length=pLt;xLt.lerp=ecr;xLt.max=War;xLt.min=Uar;xLt.mul=void 0;xLt.multiply=_Lt;xLt.negate=$ar;xLt.normalize=Jar;xLt.random=rcr;xLt.rotateX=ccr;xLt.rotateY=lcr;xLt.rotateZ=hcr;xLt.round=Xar;xLt.scale=jar;xLt.scaleAndAdd=Kar;xLt.set=Oar;xLt.slerp=tcr;xLt.sqrLen=xLt.sqrDist=void 0;xLt.squaredDistance=fLt;xLt.squaredLength=yLt;xLt.str=pcr;xLt.sub=void 0;xLt.subtract=mLt;xLt.transformMat3=scr;xLt.transformMat4=icr;xLt.transformQuat=acr;xLt.zero=ucr;var qC=dLt(qI());function dLt(e,t){if(typeof WeakMap=="function")var n=new WeakMap,o=new WeakMap;return(dLt=function(i,s){if(!s&&i&&i.__esModule)return i;var a,c,l={__proto__:null,default:i};if(i===null||EUe(i)!="object"&&typeof i!="function")return l;if(a=s?o:n){if(a.has(i))return a.get(i);a.set(i,l)}for(var h in i)h!=="default"&&{}.hasOwnProperty.call(i,h)&&((c=(a=Object.defineProperty)&&Object.getOwnPropertyDescriptor(i,h))&&(c.get||c.set)?a(l,h,c):l[h]=i[h]);return l})(e,t)}function uLt(){var e=new qC.ARRAY_TYPE(3);if(qC.ARRAY_TYPE!=Float32Array)e[0]=0,e[1]=0,e[2]=0;return e}function Har(e){var t=new qC.ARRAY_TYPE(3);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function pLt(e){var t=e[0],n=e[1],o=e[2];return Math.sqrt(t*t+n*n+o*o)}function Far(e,t,n){var o=new qC.ARRAY_TYPE(3);return o[0]=e,o[1]=t,o[2]=n,o}function zar(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function Oar(e,t,n,o){return e[0]=t,e[1]=n,e[2]=o,e}function Var(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e}function mLt(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e}function _Lt(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e[2]=t[2]*n[2],e}function gLt(e,t,n){return e[0]=t[0]/n[0],e[1]=t[1]/n[1],e[2]=t[2]/n[2],e}function Yar(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e[2]=Math.ceil(t[2]),e}function Gar(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e[2]=Math.floor(t[2]),e}function Uar(e,t,n){return e[0]=Math.min(t[0],n[0]),e[1]=Math.min(t[1],n[1]),e[2]=Math.min(t[2],n[2]),e}function War(e,t,n){return e[0]=Math.max(t[0],n[0]),e[1]=Math.max(t[1],n[1]),e[2]=Math.max(t[2],n[2]),e}function Xar(e,t){return e[0]=qC.round(t[0]),e[1]=qC.round(t[1]),e[2]=qC.round(t[2]),e}function jar(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e}function Kar(e,t,n,o){return e[0]=t[0]+n[0]*o,e[1]=t[1]+n[1]*o,e[2]=t[2]+n[2]*o,e}function ALt(e,t){var n=t[0]-e[0],o=t[1]-e[1],r=t[2]-e[2];return Math.sqrt(n*n+o*o+r*r)}function fLt(e,t){var n=t[0]-e[0],o=t[1]-e[1],r=t[2]-e[2];return n*n+o*o+r*r}function yLt(e){var t=e[0],n=e[1],o=e[2];return t*t+n*n+o*o}function $ar(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e}function qar(e,t){return e[0]=1/t[0],e[1]=1/t[1],e[2]=1/t[2],e}function Jar(e,t){var n=t[0],o=t[1],r=t[2],i=n*n+o*o+r*r;if(i>0)i=1/Math.sqrt(i);return e[0]=t[0]*i,e[1]=t[1]*i,e[2]=t[2]*i,e}function MUe(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function Zar(e,t,n){var o=t[0],r=t[1],i=t[2],s=n[0],a=n[1],c=n[2];return e[0]=r*c-i*a,e[1]=i*s-o*c,e[2]=o*a-r*s,e}function ecr(e,t,n,o){var r=t[0],i=t[1],s=t[2];return e[0]=r+o*(n[0]-r),e[1]=i+o*(n[1]-i),e[2]=s+o*(n[2]-s),e}function tcr(e,t,n,o){var r=Math.acos(Math.min(Math.max(MUe(t,n),-1),1)),i=Math.sin(r),s=Math.sin((1-o)*r)/i,a=Math.sin(o*r)/i;return e[0]=s*t[0]+a*n[0],e[1]=s*t[1]+a*n[1],e[2]=s*t[2]+a*n[2],e}function ncr(e,t,n,o,r,i){var s=i*i,a=s*(2*i-3)+1,c=s*(i-2)+i,l=s*(i-1),h=s*(3-2*i);return e[0]=t[0]*a+n[0]*c+o[0]*l+r[0]*h,e[1]=t[1]*a+n[1]*c+o[1]*l+r[1]*h,e[2]=t[2]*a+n[2]*c+o[2]*l+r[2]*h,e}function ocr(e,t,n,o,r,i){var s=1-i,a=s*s,c=i*i,l=a*s,h=3*i*a,d=3*c*s,u=c*i;return e[0]=t[0]*l+n[0]*h+o[0]*d+r[0]*u,e[1]=t[1]*l+n[1]*h+o[1]*d+r[1]*u,e[2]=t[2]*l+n[2]*h+o[2]*d+r[2]*u,e}function rcr(e,t){t=t===void 0?1:t;var n=qC.RANDOM()*2*Math.PI,o=qC.RANDOM()*2-1,r=Math.sqrt(1-o*o)*t;return e[0]=Math.cos(n)*r,e[1]=Math.sin(n)*r,e[2]=o*t,e}function icr(e,t,n){var o=t[0],r=t[1],i=t[2],s=n[3]*o+n[7]*r+n[11]*i+n[15];return s=s||1,e[0]=(n[0]*o+n[4]*r+n[8]*i+n[12])/s,e[1]=(n[1]*o+n[5]*r+n[9]*i+n[13])/s,e[2]=(n[2]*o+n[6]*r+n[10]*i+n[14])/s,e}function scr(e,t,n){var o=t[0],r=t[1],i=t[2];return e[0]=o*n[0]+r*n[3]+i*n[6],e[1]=o*n[1]+r*n[4]+i*n[7],e[2]=o*n[2]+r*n[5]+i*n[8],e}function acr(e,t,n){var o=n[0],r=n[1],i=n[2],s=n[3],a=t[0],c=t[1],l=t[2],h=r*l-i*c,d=i*a-o*l,u=o*c-r*a;return h=h+h,d=d+d,u=u+u,e[0]=a+s*h+r*u-i*d,e[1]=c+s*d+i*h-o*u,e[2]=l+s*u+o*d-r*h,e}function ccr(e,t,n,o){var r=[],i=[];return r[0]=t[0]-n[0],r[1]=t[1]-n[1],r[2]=t[2]-n[2],i[0]=r[0],i[1]=r[1]*Math.cos(o)-r[2]*Math.sin(o),i[2]=r[1]*Math.sin(o)+r[2]*Math.cos(o),e[0]=i[0]+n[0],e[1]=i[1]+n[1],e[2]=i[2]+n[2],e}function lcr(e,t,n,o){var r=[],i=[];return r[0]=t[0]-n[0],r[1]=t[1]-n[1],r[2]=t[2]-n[2],i[0]=r[2]*Math.sin(o)+r[0]*Math.cos(o),i[1]=r[1],i[2]=r[2]*Math.cos(o)-r[0]*Math.sin(o),e[0]=i[0]+n[0],e[1]=i[1]+n[1],e[2]=i[2]+n[2],e}function hcr(e,t,n,o){var r=[],i=[];return r[0]=t[0]-n[0],r[1]=t[1]-n[1],r[2]=t[2]-n[2],i[0]=r[0]*Math.cos(o)-r[1]*Math.sin(o),i[1]=r[0]*Math.sin(o)+r[1]*Math.cos(o),i[2]=r[2],e[0]=i[0]+n[0],e[1]=i[1]+n[1],e[2]=i[2]+n[2],e}function dcr(e,t){var n=e[0],o=e[1],r=e[2],i=t[0],s=t[1],a=t[2],c=Math.sqrt((n*n+o*o+r*r)*(i*i+s*s+a*a)),l=c&&MUe(e,t)/c;return Math.acos(Math.min(Math.max(l,-1),1))}function ucr(e){return e[0]=0,e[1]=0,e[2]=0,e}function pcr(e){return"vec3("+e[0]+", "+e[1]+", "+e[2]+")"}function mcr(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]}function _cr(e,t){var n=e[0],o=e[1],r=e[2],i=t[0],s=t[1],a=t[2];return Math.abs(n-i)<=qC.EPSILON*Math.max(1,Math.abs(n),Math.abs(i))&&Math.abs(o-s)<=qC.EPSILON*Math.max(1,Math.abs(o),Math.abs(s))&&Math.abs(r-a)<=qC.EPSILON*Math.max(1,Math.abs(r),Math.abs(a))}var lDs=xLt.sub=mLt,hDs=xLt.mul=_Lt,dDs=xLt.div=gLt,uDs=xLt.dist=ALt,pDs=xLt.sqrDist=fLt,mDs=xLt.len=pLt,_Ds=xLt.sqrLen=yLt,gDs=xLt.forEach=function(){var e=uLt();return function(t,n,o,r,i,s){var a,c;if(!n)n=3;if(!o)o=0;if(r)c=Math.min(r*n+o,t.length);else c=t.length;for(a=o;a<c;a+=n)e[0]=t[a],e[1]=t[a+1],e[2]=t[a+2],i(e,e,s),t[a]=e[0],t[a+1]=e[1],t[a+2]=e[2];return t}}()});var TUe=lt(function(LLt){function BUe(e){return BUe=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},BUe(e)}Object.defineProperty(LLt,"__esModule",{value:!0});LLt.add=clr;LLt.ceil=llr;LLt.clone=rlr;LLt.copy=slr;LLt.create=wLt;LLt.cross=xlr;LLt.dist=void 0;LLt.distance=NLt;LLt.div=void 0;LLt.divide=DLt;LLt.dot=ylr;LLt.equals=Mlr;LLt.exactEquals=Elr;LLt.floor=hlr;LLt.forEach=void 0;LLt.fromValues=ilr;LLt.inverse=Alr;LLt.len=void 0;LLt.length=QLt;LLt.lerp=Clr;LLt.max=ulr;LLt.min=dlr;LLt.mul=void 0;LLt.multiply=TLt;LLt.negate=glr;LLt.normalize=flr;LLt.random=blr;LLt.round=plr;LLt.scale=mlr;LLt.scaleAndAdd=_lr;LLt.set=alr;LLt.sqrLen=LLt.sqrDist=void 0;LLt.squaredDistance=RLt;LLt.squaredLength=kLt;LLt.str=Plr;LLt.sub=void 0;LLt.subtract=BLt;LLt.transformMat4=Ilr;LLt.transformQuat=vlr;LLt.zero=Slr;var T2=MLt(qI());function MLt(e,t){if(typeof WeakMap=="function")var n=new WeakMap,o=new WeakMap;return(MLt=function(i,s){if(!s&&i&&i.__esModule)return i;var a,c,l={__proto__:null,default:i};if(i===null||BUe(i)!="object"&&typeof i!="function")return l;if(a=s?o:n){if(a.has(i))return a.get(i);a.set(i,l)}for(var h in i)h!=="default"&&{}.hasOwnProperty.call(i,h)&&((c=(a=Object.defineProperty)&&Object.getOwnPropertyDescriptor(i,h))&&(c.get||c.set)?a(l,h,c):l[h]=i[h]);return l})(e,t)}function wLt(){var e=new T2.ARRAY_TYPE(4);if(T2.ARRAY_TYPE!=Float32Array)e[0]=0,e[1]=0,e[2]=0,e[3]=0;return e}function rlr(e){var t=new T2.ARRAY_TYPE(4);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}function ilr(e,t,n,o){var r=new T2.ARRAY_TYPE(4);return r[0]=e,r[1]=t,r[2]=n,r[3]=o,r}function slr(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}function alr(e,t,n,o,r){return e[0]=t,e[1]=n,e[2]=o,e[3]=r,e}function clr(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e}function BLt(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e}function TLt(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e[2]=t[2]*n[2],e[3]=t[3]*n[3],e}function DLt(e,t,n){return e[0]=t[0]/n[0],e[1]=t[1]/n[1],e[2]=t[2]/n[2],e[3]=t[3]/n[3],e}function llr(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e[2]=Math.ceil(t[2]),e[3]=Math.ceil(t[3]),e}function hlr(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e[2]=Math.floor(t[2]),e[3]=Math.floor(t[3]),e}function dlr(e,t,n){return e[0]=Math.min(t[0],n[0]),e[1]=Math.min(t[1],n[1]),e[2]=Math.min(t[2],n[2]),e[3]=Math.min(t[3],n[3]),e}function ulr(e,t,n){return e[0]=Math.max(t[0],n[0]),e[1]=Math.max(t[1],n[1]),e[2]=Math.max(t[2],n[2]),e[3]=Math.max(t[3],n[3]),e}function plr(e,t){return e[0]=T2.round(t[0]),e[1]=T2.round(t[1]),e[2]=T2.round(t[2]),e[3]=T2.round(t[3]),e}function mlr(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e}function _lr(e,t,n,o){return e[0]=t[0]+n[0]*o,e[1]=t[1]+n[1]*o,e[2]=t[2]+n[2]*o,e[3]=t[3]+n[3]*o,e}function NLt(e,t){var n=t[0]-e[0],o=t[1]-e[1],r=t[2]-e[2],i=t[3]-e[3];return Math.sqrt(n*n+o*o+r*r+i*i)}function RLt(e,t){var n=t[0]-e[0],o=t[1]-e[1],r=t[2]-e[2],i=t[3]-e[3];return n*n+o*o+r*r+i*i}function QLt(e){var t=e[0],n=e[1],o=e[2],r=e[3];return Math.sqrt(t*t+n*n+o*o+r*r)}function kLt(e){var t=e[0],n=e[1],o=e[2],r=e[3];return t*t+n*n+o*o+r*r}function glr(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=-t[3],e}function Alr(e,t){return e[0]=1/t[0],e[1]=1/t[1],e[2]=1/t[2],e[3]=1/t[3],e}function flr(e,t){var n=t[0],o=t[1],r=t[2],i=t[3],s=n*n+o*o+r*r+i*i;if(s>0)s=1/Math.sqrt(s);return e[0]=n*s,e[1]=o*s,e[2]=r*s,e[3]=i*s,e}function ylr(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]}function xlr(e,t,n,o){var r=n[0]*o[1]-n[1]*o[0],i=n[0]*o[2]-n[2]*o[0],s=n[0]*o[3]-n[3]*o[0],a=n[1]*o[2]-n[2]*o[1],c=n[1]*o[3]-n[3]*o[1],l=n[2]*o[3]-n[3]*o[2],h=t[0],d=t[1],u=t[2],_=t[3];return e[0]=d*l-u*c+_*a,e[1]=-(h*l)+u*s-_*i,e[2]=h*c-d*s+_*r,e[3]=-(h*a)+d*i-u*r,e}function Clr(e,t,n,o){var r=t[0],i=t[1],s=t[2],a=t[3];return e[0]=r+o*(n[0]-r),e[1]=i+o*(n[1]-i),e[2]=s+o*(n[2]-s),e[3]=a+o*(n[3]-a),e}function blr(e,t){t=t===void 0?1:t;var n,o,r,i,s,a,c;c=T2.RANDOM(),n=c*2-1,o=(4*T2.RANDOM()-2)*Math.sqrt(c*-c+c),s=n*n+o*o,c=T2.RANDOM(),r=c*2-1,i=(4*T2.RANDOM()-2)*Math.sqrt(c*-c+c),a=r*r+i*i;var l=Math.sqrt((1-s)/a);return e[0]=t*n,e[1]=t*o,e[2]=t*r*l,e[3]=t*i*l,e}function Ilr(e,t,n){var o=t[0],r=t[1],i=t[2],s=t[3];return e[0]=n[0]*o+n[4]*r+n[8]*i+n[12]*s,e[1]=n[1]*o+n[5]*r+n[9]*i+n[13]*s,e[2]=n[2]*o+n[6]*r+n[10]*i+n[14]*s,e[3]=n[3]*o+n[7]*r+n[11]*i+n[15]*s,e}function vlr(e,t,n){var o=n[0],r=n[1],i=n[2],s=n[3],a=t[0],c=t[1],l=t[2],h=r*l-i*c,d=i*a-o*l,u=o*c-r*a;return h=h+h,d=d+d,u=u+u,e[0]=a+s*h+r*u-i*d,e[1]=c+s*d+i*h-o*u,e[2]=l+s*u+o*d-r*h,e[3]=t[3],e}function Slr(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=0,e}function Plr(e){return"vec4("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+")"}function Elr(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]}function Mlr(e,t){var n=e[0],o=e[1],r=e[2],i=e[3],s=t[0],a=t[1],c=t[2],l=t[3];return Math.abs(n-s)<=T2.EPSILON*Math.max(1,Math.abs(n),Math.abs(s))&&Math.abs(o-a)<=T2.EPSILON*Math.max(1,Math.abs(o),Math.abs(a))&&Math.abs(r-c)<=T2.EPSILON*Math.max(1,Math.abs(r),Math.abs(c))&&Math.abs(i-l)<=T2.EPSILON*Math.max(1,Math.abs(i),Math.abs(l))}var fDs=LLt.sub=BLt,yDs=LLt.mul=TLt,xDs=LLt.div=DLt,CDs=LLt.dist=NLt,bDs=LLt.sqrDist=RLt,IDs=LLt.len=QLt,vDs=LLt.sqrLen=kLt,SDs=LLt.forEach=function(){var e=wLt();return function(t,n,o,r,i,s){var a,c;if(!n)n=4;if(!o)o=0;if(r)c=Math.min(r*n+o,t.length);else c=t.length;for(a=o;a<c;a+=n)e[0]=t[a],e[1]=t[a+1],e[2]=t[a+2],e[3]=t[a+3],i(e,e,s),t[a]=e[0],t[a+1]=e[1],t[a+2]=e[2],t[a+3]=e[3];return t}}()});var RUe=lt(function(qLt){function DUe(e){return DUe=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},DUe(e)}Object.defineProperty(qLt,"__esModule",{value:!0});qLt.add=void 0;qLt.calculateW=ghr;qLt.clone=void 0;qLt.conjugate=xhr;qLt.copy=void 0;qLt.create=NUe;qLt.dot=void 0;qLt.equals=Ehr;qLt.exactEquals=void 0;qLt.exp=XLt;qLt.fromEuler=Chr;qLt.fromMat3=KLt;qLt.fromValues=void 0;qLt.getAngle=uhr;qLt.getAxisAngle=dhr;qLt.identity=hhr;qLt.invert=yhr;qLt.lerp=qLt.length=qLt.len=void 0;qLt.ln=jLt;qLt.mul=void 0;qLt.multiply=WLt;qLt.normalize=void 0;qLt.pow=Ahr;qLt.random=fhr;qLt.rotateX=phr;qLt.rotateY=mhr;qLt.rotateZ=_hr;qLt.setAxes=qLt.set=qLt.scale=qLt.rotationTo=void 0;qLt.setAxisAngle=ULt;qLt.slerp=y4e;qLt.squaredLength=qLt.sqrLen=qLt.sqlerp=void 0;qLt.str=bhr;var rw=dae(qI()),lhr=dae(vUe()),ow=dae(wUe()),D4=dae(TUe());function dae(e,t){if(typeof WeakMap=="function")var n=new WeakMap,o=new WeakMap;return(dae=function(i,s){if(!s&&i&&i.__esModule)return i;var a,c,l={__proto__:null,default:i};if(i===null||DUe(i)!="object"&&typeof i!="function")return l;if(a=s?o:n){if(a.has(i))return a.get(i);a.set(i,l)}for(var h in i)h!=="default"&&{}.hasOwnProperty.call(i,h)&&((c=(a=Object.defineProperty)&&Object.getOwnPropertyDescriptor(i,h))&&(c.get||c.set)?a(l,h,c):l[h]=i[h]);return l})(e,t)}function NUe(){var e=new rw.ARRAY_TYPE(4);if(rw.ARRAY_TYPE!=Float32Array)e[0]=0,e[1]=0,e[2]=0;return e[3]=1,e}function hhr(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e}function ULt(e,t,n){n=n*0.5;var o=Math.sin(n);return e[0]=o*t[0],e[1]=o*t[1],e[2]=o*t[2],e[3]=Math.cos(n),e}function dhr(e,t){var n=Math.acos(t[3])*2,o=Math.sin(n/2);if(o>rw.EPSILON)e[0]=t[0]/o,e[1]=t[1]/o,e[2]=t[2]/o;else e[0]=1,e[1]=0,e[2]=0;return n}function uhr(e,t){var n=vhr(e,t);return Math.acos(2*n*n-1)}function WLt(e,t,n){var o=t[0],r=t[1],i=t[2],s=t[3],a=n[0],c=n[1],l=n[2],h=n[3];return e[0]=o*h+s*a+r*l-i*c,e[1]=r*h+s*c+i*a-o*l,e[2]=i*h+s*l+o*c-r*a,e[3]=s*h-o*a-r*c-i*l,e}function phr(e,t,n){n*=0.5;var o=t[0],r=t[1],i=t[2],s=t[3],a=Math.sin(n),c=Math.cos(n);return e[0]=o*c+s*a,e[1]=r*c+i*a,e[2]=i*c-r*a,e[3]=s*c-o*a,e}function mhr(e,t,n){n*=0.5;var o=t[0],r=t[1],i=t[2],s=t[3],a=Math.sin(n),c=Math.cos(n);return e[0]=o*c-i*a,e[1]=r*c+s*a,e[2]=i*c+o*a,e[3]=s*c-r*a,e}function _hr(e,t,n){n*=0.5;var o=t[0],r=t[1],i=t[2],s=t[3],a=Math.sin(n),c=Math.cos(n);return e[0]=o*c+r*a,e[1]=r*c-o*a,e[2]=i*c+s*a,e[3]=s*c-i*a,e}function ghr(e,t){var n=t[0],o=t[1],r=t[2];return e[0]=n,e[1]=o,e[2]=r,e[3]=Math.sqrt(Math.abs(1-n*n-o*o-r*r)),e}function XLt(e,t){var n=t[0],o=t[1],r=t[2],i=t[3],s=Math.sqrt(n*n+o*o+r*r),a=Math.exp(i),c=s>0?a*Math.sin(s)/s:0;return e[0]=n*c,e[1]=o*c,e[2]=r*c,e[3]=a*Math.cos(s),e}function jLt(e,t){var n=t[0],o=t[1],r=t[2],i=t[3],s=Math.sqrt(n*n+o*o+r*r),a=s>0?Math.atan2(s,i)/s:0;return e[0]=n*a,e[1]=o*a,e[2]=r*a,e[3]=0.5*Math.log(n*n+o*o+r*r+i*i),e}function Ahr(e,t,n){return jLt(e,t),Ihr(e,e,n),XLt(e,e),e}function y4e(e,t,n,o){var r=t[0],i=t[1],s=t[2],a=t[3],c=n[0],l=n[1],h=n[2],d=n[3],u,_,p,m,A;if(_=r*c+i*l+s*h+a*d,_<0)_=-_,c=-c,l=-l,h=-h,d=-d;if(1-_>rw.EPSILON)u=Math.acos(_),p=Math.sin(u),m=Math.sin((1-o)*u)/p,A=Math.sin(o*u)/p;else m=1-o,A=o;return e[0]=m*r+A*c,e[1]=m*i+A*l,e[2]=m*s+A*h,e[3]=m*a+A*d,e}function fhr(e){var t=rw.RANDOM(),n=rw.RANDOM(),o=rw.RANDOM(),r=Math.sqrt(1-t),i=Math.sqrt(t);return e[0]=r*Math.sin(2*Math.PI*n),e[1]=r*Math.cos(2*Math.PI*n),e[2]=i*Math.sin(2*Math.PI*o),e[3]=i*Math.cos(2*Math.PI*o),e}function yhr(e,t){var n=t[0],o=t[1],r=t[2],i=t[3],s=n*n+o*o+r*r+i*i,a=s?1/s:0;return e[0]=-n*a,e[1]=-o*a,e[2]=-r*a,e[3]=i*a,e}function xhr(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],e}function KLt(e,t){var n=t[0]+t[4]+t[8],o;if(n>0)o=Math.sqrt(n+1),e[3]=0.5*o,o=0.5/o,e[0]=(t[5]-t[7])*o,e[1]=(t[6]-t[2])*o,e[2]=(t[1]-t[3])*o;else{var r=0;if(t[4]>t[0])r=1;if(t[8]>t[r*3+r])r=2;var i=(r+1)%3,s=(r+2)%3;o=Math.sqrt(t[r*3+r]-t[i*3+i]-t[s*3+s]+1),e[r]=0.5*o,o=0.5/o,e[3]=(t[i*3+s]-t[s*3+i])*o,e[i]=(t[i*3+r]+t[r*3+i])*o,e[s]=(t[s*3+r]+t[r*3+s])*o}return e}function Chr(e,t,n,o){var r=arguments.length>4&&arguments[4]!==void 0?arguments[4]:rw.ANGLE_ORDER,i=Math.PI/360;t*=i,o*=i,n*=i;var s=Math.sin(t),a=Math.cos(t),c=Math.sin(n),l=Math.cos(n),h=Math.sin(o),d=Math.cos(o);switch(r){case"xyz":e[0]=s*l*d+a*c*h,e[1]=a*c*d-s*l*h,e[2]=a*l*h+s*c*d,e[3]=a*l*d-s*c*h;break;case"xzy":e[0]=s*l*d-a*c*h,e[1]=a*c*d-s*l*h,e[2]=a*l*h+s*c*d,e[3]=a*l*d+s*c*h;break;case"yxz":e[0]=s*l*d+a*c*h,e[1]=a*c*d-s*l*h,e[2]=a*l*h-s*c*d,e[3]=a*l*d+s*c*h;break;case"yzx":e[0]=s*l*d+a*c*h,e[1]=a*c*d+s*l*h,e[2]=a*l*h-s*c*d,e[3]=a*l*d-s*c*h;break;case"zxy":e[0]=s*l*d-a*c*h,e[1]=a*c*d+s*l*h,e[2]=a*l*h+s*c*d,e[3]=a*l*d-s*c*h;break;case"zyx":e[0]=s*l*d-a*c*h,e[1]=a*c*d+s*l*h,e[2]=a*l*h-s*c*d,e[3]=a*l*d+s*c*h;break;default:throw Error("Unknown angle order "+r)}return e}function bhr(e){return"quat("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+")"}var EDs=qLt.clone=D4.clone,MDs=qLt.fromValues=D4.fromValues,wDs=qLt.copy=D4.copy,BDs=qLt.set=D4.set,TDs=qLt.add=D4.add,DDs=qLt.mul=WLt,Ihr=qLt.scale=D4.scale,vhr=qLt.dot=D4.dot,NDs=qLt.lerp=D4.lerp,Shr=qLt.length=D4.length,RDs=qLt.len=Shr,Phr=qLt.squaredLength=D4.squaredLength,QDs=qLt.sqrLen=Phr,$Lt=qLt.normalize=D4.normalize,kDs=qLt.exactEquals=D4.exactEquals;function Ehr(e,t){return Math.abs(D4.dot(e,t))>=1-rw.EPSILON}var LDs=qLt.rotationTo=function(){var e=ow.create(),t=ow.fromValues(1,0,0),n=ow.fromValues(0,1,0);return function(o,r,i){var s=ow.dot(r,i);if(s<-0.999999){if(ow.cross(e,t,r),ow.len(e)<0.000001)ow.cross(e,n,r);return ow.normalize(e,e),ULt(o,e,Math.PI),o}else if(s>0.999999)return o[0]=0,o[1]=0,o[2]=0,o[3]=1,o;else return ow.cross(e,r,i),o[0]=e[0],o[1]=e[1],o[2]=e[2],o[3]=1+s,$Lt(o,o)}}(),HDs=qLt.sqlerp=function(){var e=NUe(),t=NUe();return function(n,o,r,i,s,a){return y4e(e,o,s,a),y4e(t,r,i,a),y4e(n,e,t,2*a*(1-a)),n}}(),FDs=qLt.setAxes=function(){var e=lhr.create();return function(t,n,o,r){return e[0]=o[0],e[3]=o[1],e[6]=o[2],e[1]=r[0],e[4]=r[1],e[7]=r[2],e[2]=-n[0],e[5]=-n[1],e[8]=-n[2],$Lt(t,KLt(t,e))}}()});var yHt=lt(function(pHt){function QUe(e){return QUe=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},QUe(e)}Object.defineProperty(pHt,"__esModule",{value:!0});pHt.add=Cdr;pHt.clone=odr;pHt.conjugate=Pdr;pHt.copy=dHt;pHt.create=ndr;pHt.dot=void 0;pHt.equals=Tdr;pHt.exactEquals=Bdr;pHt.fromMat4=cdr;pHt.fromRotation=adr;pHt.fromRotationTranslation=hHt;pHt.fromRotationTranslationValues=idr;pHt.fromTranslation=sdr;pHt.fromValues=rdr;pHt.getDual=ddr;pHt.getReal=void 0;pHt.getTranslation=pdr;pHt.identity=ldr;pHt.invert=Sdr;pHt.length=pHt.len=void 0;pHt.lerp=vdr;pHt.mul=void 0;pHt.multiply=uHt;pHt.normalize=Mdr;pHt.rotateAroundAxis=xdr;pHt.rotateByQuatAppend=fdr;pHt.rotateByQuatPrepend=ydr;pHt.rotateX=_dr;pHt.rotateY=gdr;pHt.rotateZ=Adr;pHt.scale=bdr;pHt.set=hdr;pHt.setDual=udr;pHt.squaredLength=pHt.sqrLen=pHt.setReal=void 0;pHt.str=wdr;pHt.translate=mdr;var ny=x4e(qI()),iw=x4e(RUe()),lHt=x4e(PUe());function x4e(e,t){if(typeof WeakMap=="function")var n=new WeakMap,o=new WeakMap;return(x4e=function(i,s){if(!s&&i&&i.__esModule)return i;var a,c,l={__proto__:null,default:i};if(i===null||QUe(i)!="object"&&typeof i!="function")return l;if(a=s?o:n){if(a.has(i))return a.get(i);a.set(i,l)}for(var h in i)h!=="default"&&{}.hasOwnProperty.call(i,h)&&((c=(a=Object.defineProperty)&&Object.getOwnPropertyDescriptor(i,h))&&(c.get||c.set)?a(l,h,c):l[h]=i[h]);return l})(e,t)}function ndr(){var e=new ny.ARRAY_TYPE(8);if(ny.ARRAY_TYPE!=Float32Array)e[0]=0,e[1]=0,e[2]=0,e[4]=0,e[5]=0,e[6]=0,e[7]=0;return e[3]=1,e}function odr(e){var t=new ny.ARRAY_TYPE(8);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t}function rdr(e,t,n,o,r,i,s,a){var c=new ny.ARRAY_TYPE(8);return c[0]=e,c[1]=t,c[2]=n,c[3]=o,c[4]=r,c[5]=i,c[6]=s,c[7]=a,c}function idr(e,t,n,o,r,i,s){var a=new ny.ARRAY_TYPE(8);a[0]=e,a[1]=t,a[2]=n,a[3]=o;var c=r*0.5,l=i*0.5,h=s*0.5;return a[4]=c*o+l*n-h*t,a[5]=l*o+h*e-c*n,a[6]=h*o+c*t-l*e,a[7]=-c*e-l*t-h*n,a}function hHt(e,t,n){var o=n[0]*0.5,r=n[1]*0.5,i=n[2]*0.5,s=t[0],a=t[1],c=t[2],l=t[3];return e[0]=s,e[1]=a,e[2]=c,e[3]=l,e[4]=o*l+r*c-i*a,e[5]=r*l+i*s-o*c,e[6]=i*l+o*a-r*s,e[7]=-o*s-r*a-i*c,e}function sdr(e,t){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e[4]=t[0]*0.5,e[5]=t[1]*0.5,e[6]=t[2]*0.5,e[7]=0,e}function adr(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=0,e[5]=0,e[6]=0,e[7]=0,e}function cdr(e,t){var n=iw.create();lHt.getRotation(n,t);var o=new ny.ARRAY_TYPE(3);return lHt.getTranslation(o,t),hHt(e,n,o),e}function dHt(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e}function ldr(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e[4]=0,e[5]=0,e[6]=0,e[7]=0,e}function hdr(e,t,n,o,r,i,s,a,c){return e[0]=t,e[1]=n,e[2]=o,e[3]=r,e[4]=i,e[5]=s,e[6]=a,e[7]=c,e}var ODs=pHt.getReal=iw.copy;function ddr(e,t){return e[0]=t[4],e[1]=t[5],e[2]=t[6],e[3]=t[7],e}var VDs=pHt.setReal=iw.copy;function udr(e,t){return e[4]=t[0],e[5]=t[1],e[6]=t[2],e[7]=t[3],e}function pdr(e,t){var n=t[4],o=t[5],r=t[6],i=t[7],s=-t[0],a=-t[1],c=-t[2],l=t[3];return e[0]=(n*l+i*s+o*c-r*a)*2,e[1]=(o*l+i*a+r*s-n*c)*2,e[2]=(r*l+i*c+n*a-o*s)*2,e}function mdr(e,t,n){var o=t[0],r=t[1],i=t[2],s=t[3],a=n[0]*0.5,c=n[1]*0.5,l=n[2]*0.5,h=t[4],d=t[5],u=t[6],_=t[7];return e[0]=o,e[1]=r,e[2]=i,e[3]=s,e[4]=s*a+r*l-i*c+h,e[5]=s*c+i*a-o*l+d,e[6]=s*l+o*c-r*a+u,e[7]=-o*a-r*c-i*l+_,e}function _dr(e,t,n){var o=-t[0],r=-t[1],i=-t[2],s=t[3],a=t[4],c=t[5],l=t[6],h=t[7],d=a*s+h*o+c*i-l*r,u=c*s+h*r+l*o-a*i,_=l*s+h*i+a*r-c*o,p=h*s-a*o-c*r-l*i;return iw.rotateX(e,t,n),o=e[0],r=e[1],i=e[2],s=e[3],e[4]=d*s+p*o+u*i-_*r,e[5]=u*s+p*r+_*o-d*i,e[6]=_*s+p*i+d*r-u*o,e[7]=p*s-d*o-u*r-_*i,e}function gdr(e,t,n){var o=-t[0],r=-t[1],i=-t[2],s=t[3],a=t[4],c=t[5],l=t[6],h=t[7],d=a*s+h*o+c*i-l*r,u=c*s+h*r+l*o-a*i,_=l*s+h*i+a*r-c*o,p=h*s-a*o-c*r-l*i;return iw.rotateY(e,t,n),o=e[0],r=e[1],i=e[2],s=e[3],e[4]=d*s+p*o+u*i-_*r,e[5]=u*s+p*r+_*o-d*i,e[6]=_*s+p*i+d*r-u*o,e[7]=p*s-d*o-u*r-_*i,e}function Adr(e,t,n){var o=-t[0],r=-t[1],i=-t[2],s=t[3],a=t[4],c=t[5],l=t[6],h=t[7],d=a*s+h*o+c*i-l*r,u=c*s+h*r+l*o-a*i,_=l*s+h*i+a*r-c*o,p=h*s-a*o-c*r-l*i;return iw.rotateZ(e,t,n),o=e[0],r=e[1],i=e[2],s=e[3],e[4]=d*s+p*o+u*i-_*r,e[5]=u*s+p*r+_*o-d*i,e[6]=_*s+p*i+d*r-u*o,e[7]=p*s-d*o-u*r-_*i,e}function fdr(e,t,n){var o=n[0],r=n[1],i=n[2],s=n[3],a=t[0],c=t[1],l=t[2],h=t[3];return e[0]=a*s+h*o+c*i-l*r,e[1]=c*s+h*r+l*o-a*i,e[2]=l*s+h*i+a*r-c*o,e[3]=h*s-a*o-c*r-l*i,a=t[4],c=t[5],l=t[6],h=t[7],e[4]=a*s+h*o+c*i-l*r,e[5]=c*s+h*r+l*o-a*i,e[6]=l*s+h*i+a*r-c*o,e[7]=h*s-a*o-c*r-l*i,e}function ydr(e,t,n){var o=t[0],r=t[1],i=t[2],s=t[3],a=n[0],c=n[1],l=n[2],h=n[3];return e[0]=o*h+s*a+r*l-i*c,e[1]=r*h+s*c+i*a-o*l,e[2]=i*h+s*l+o*c-r*a,e[3]=s*h-o*a-r*c-i*l,a=n[4],c=n[5],l=n[6],h=n[7],e[4]=o*h+s*a+r*l-i*c,e[5]=r*h+s*c+i*a-o*l,e[6]=i*h+s*l+o*c-r*a,e[7]=s*h-o*a-r*c-i*l,e}function xdr(e,t,n,o){if(Math.abs(o)<ny.EPSILON)return dHt(e,t);var r=Math.sqrt(n[0]*n[0]+n[1]*n[1]+n[2]*n[2]);o=o*0.5;var i=Math.sin(o),s=i*n[0]/r,a=i*n[1]/r,c=i*n[2]/r,l=Math.cos(o),h=t[0],d=t[1],u=t[2],_=t[3];e[0]=h*l+_*s+d*c-u*a,e[1]=d*l+_*a+u*s-h*c,e[2]=u*l+_*c+h*a-d*s,e[3]=_*l-h*s-d*a-u*c;var p=t[4],m=t[5],A=t[6],g=t[7];return e[4]=p*l+g*s+m*c-A*a,e[5]=m*l+g*a+A*s-p*c,e[6]=A*l+g*c+p*a-m*s,e[7]=g*l-p*s-m*a-A*c,e}function Cdr(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e[4]=t[4]+n[4],e[5]=t[5]+n[5],e[6]=t[6]+n[6],e[7]=t[7]+n[7],e}function uHt(e,t,n){var o=t[0],r=t[1],i=t[2],s=t[3],a=n[4],c=n[5],l=n[6],h=n[7],d=t[4],u=t[5],_=t[6],p=t[7],m=n[0],A=n[1],g=n[2],f=n[3];return e[0]=o*f+s*m+r*g-i*A,e[1]=r*f+s*A+i*m-o*g,e[2]=i*f+s*g+o*A-r*m,e[3]=s*f-o*m-r*A-i*g,e[4]=o*h+s*a+r*l-i*c+d*f+p*m+u*g-_*A,e[5]=r*h+s*c+i*a-o*l+u*f+p*A+_*m-d*g,e[6]=i*h+s*l+o*c-r*a+_*f+p*g+d*A-u*m,e[7]=s*h-o*a-r*c-i*l+p*f-d*m-u*A-_*g,e}var YDs=pHt.mul=uHt;function bdr(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*n,e[5]=t[5]*n,e[6]=t[6]*n,e[7]=t[7]*n,e}var Idr=pHt.dot=iw.dot;function vdr(e,t,n,o){var r=1-o;if(Idr(t,n)<0)o=-o;return e[0]=t[0]*r+n[0]*o,e[1]=t[1]*r+n[1]*o,e[2]=t[2]*r+n[2]*o,e[3]=t[3]*r+n[3]*o,e[4]=t[4]*r+n[4]*o,e[5]=t[5]*r+n[5]*o,e[6]=t[6]*r+n[6]*o,e[7]=t[7]*r+n[7]*o,e}function Sdr(e,t){var n=kUe(t);return e[0]=-t[0]/n,e[1]=-t[1]/n,e[2]=-t[2]/n,e[3]=t[3]/n,e[4]=-t[4]/n,e[5]=-t[5]/n,e[6]=-t[6]/n,e[7]=t[7]/n,e}function Pdr(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],e[4]=-t[4],e[5]=-t[5],e[6]=-t[6],e[7]=t[7],e}var Edr=pHt.length=iw.length,GDs=pHt.len=Edr,kUe=pHt.squaredLength=iw.squaredLength,UDs=pHt.sqrLen=kUe;function Mdr(e,t){var n=kUe(t);if(n>0){n=Math.sqrt(n);var o=t[0]/n,r=t[1]/n,i=t[2]/n,s=t[3]/n,a=t[4],c=t[5],l=t[6],h=t[7],d=o*a+r*c+i*l+s*h;e[0]=o,e[1]=r,e[2]=i,e[3]=s,e[4]=(a-o*d)/n,e[5]=(c-r*d)/n,e[6]=(l-i*d)/n,e[7]=(h-s*d)/n}return e}function wdr(e){return"quat2("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+", "+e[4]+", "+e[5]+", "+e[6]+", "+e[7]+")"}function Bdr(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]}function Tdr(e,t){var n=e[0],o=e[1],r=e[2],i=e[3],s=e[4],a=e[5],c=e[6],l=e[7],h=t[0],d=t[1],u=t[2],_=t[3],p=t[4],m=t[5],A=t[6],g=t[7];return Math.abs(n-h)<=ny.EPSILON*Math.max(1,Math.abs(n),Math.abs(h))&&Math.abs(o-d)<=ny.EPSILON*Math.max(1,Math.abs(o),Math.abs(d))&&Math.abs(r-u)<=ny.EPSILON*Math.max(1,Math.abs(r),Math.abs(u))&&Math.abs(i-_)<=ny.EPSILON*Math.max(1,Math.abs(i),Math.abs(_))&&Math.abs(s-p)<=ny.EPSILON*Math.max(1,Math.abs(s),Math.abs(p))&&Math.abs(a-m)<=ny.EPSILON*Math.max(1,Math.abs(a),Math.abs(m))&&Math.abs(c-A)<=ny.EPSILON*Math.max(1,Math.abs(c),Math.abs(A))&&Math.abs(l-g)<=ny.EPSILON*Math.max(1,Math.abs(l),Math.abs(g))}});var LHt=lt(function(wHt){function LUe(e){return LUe=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},LUe(e)}Object.defineProperty(wHt,"__esModule",{value:!0});wHt.add=gur;wHt.angle=kur;wHt.ceil=Aur;wHt.clone=uur;wHt.copy=mur;wHt.create=CHt;wHt.cross=Mur;wHt.dist=void 0;wHt.distance=SHt;wHt.div=void 0;wHt.divide=vHt;wHt.dot=Eur;wHt.equals=Our;wHt.exactEquals=zur;wHt.floor=fur;wHt.forEach=void 0;wHt.fromValues=pur;wHt.inverse=Sur;wHt.len=void 0;wHt.length=EHt;wHt.lerp=wur;wHt.max=xur;wHt.min=yur;wHt.mul=void 0;wHt.multiply=IHt;wHt.negate=vur;wHt.normalize=Pur;wHt.random=Bur;wHt.rotate=Qur;wHt.round=Cur;wHt.scale=bur;wHt.scaleAndAdd=Iur;wHt.set=_ur;wHt.signedAngle=Lur;wHt.sqrLen=wHt.sqrDist=void 0;wHt.squaredDistance=PHt;wHt.squaredLength=MHt;wHt.str=Fur;wHt.sub=void 0;wHt.subtract=bHt;wHt.transformMat2=Tur;wHt.transformMat2d=Dur;wHt.transformMat3=Nur;wHt.transformMat4=Rur;wHt.zero=Hur;var sw=xHt(qI());function xHt(e,t){if(typeof WeakMap=="function")var n=new WeakMap,o=new WeakMap;return(xHt=function(i,s){if(!s&&i&&i.__esModule)return i;var a,c,l={__proto__:null,default:i};if(i===null||LUe(i)!="object"&&typeof i!="function")return l;if(a=s?o:n){if(a.has(i))return a.get(i);a.set(i,l)}for(var h in i)h!=="default"&&{}.hasOwnProperty.call(i,h)&&((c=(a=Object.defineProperty)&&Object.getOwnPropertyDescriptor(i,h))&&(c.get||c.set)?a(l,h,c):l[h]=i[h]);return l})(e,t)}function CHt(){var e=new sw.ARRAY_TYPE(2);if(sw.ARRAY_TYPE!=Float32Array)e[0]=0,e[1]=0;return e}function uur(e){var t=new sw.ARRAY_TYPE(2);return t[0]=e[0],t[1]=e[1],t}function pur(e,t){var n=new sw.ARRAY_TYPE(2);return n[0]=e,n[1]=t,n}function mur(e,t){return e[0]=t[0],e[1]=t[1],e}function _ur(e,t,n){return e[0]=t,e[1]=n,e}function gur(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e}function bHt(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e}function IHt(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e}function vHt(e,t,n){return e[0]=t[0]/n[0],e[1]=t[1]/n[1],e}function Aur(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e}function fur(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e}function yur(e,t,n){return e[0]=Math.min(t[0],n[0]),e[1]=Math.min(t[1],n[1]),e}function xur(e,t,n){return e[0]=Math.max(t[0],n[0]),e[1]=Math.max(t[1],n[1]),e}function Cur(e,t){return e[0]=sw.round(t[0]),e[1]=sw.round(t[1]),e}function bur(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e}function Iur(e,t,n,o){return e[0]=t[0]+n[0]*o,e[1]=t[1]+n[1]*o,e}function SHt(e,t){var n=t[0]-e[0],o=t[1]-e[1];return Math.sqrt(n*n+o*o)}function PHt(e,t){var n=t[0]-e[0],o=t[1]-e[1];return n*n+o*o}function EHt(e){var t=e[0],n=e[1];return Math.sqrt(t*t+n*n)}function MHt(e){var t=e[0],n=e[1];return t*t+n*n}function vur(e,t){return e[0]=-t[0],e[1]=-t[1],e}function Sur(e,t){return e[0]=1/t[0],e[1]=1/t[1],e}function Pur(e,t){var n=t[0],o=t[1],r=n*n+o*o;if(r>0)r=1/Math.sqrt(r);return e[0]=t[0]*r,e[1]=t[1]*r,e}function Eur(e,t){return e[0]*t[0]+e[1]*t[1]}function Mur(e,t,n){var o=t[0]*n[1]-t[1]*n[0];return e[0]=e[1]=0,e[2]=o,e}function wur(e,t,n,o){var r=t[0],i=t[1];return e[0]=r+o*(n[0]-r),e[1]=i+o*(n[1]-i),e}function Bur(e,t){t=t===void 0?1:t;var n=sw.RANDOM()*2*Math.PI;return e[0]=Math.cos(n)*t,e[1]=Math.sin(n)*t,e}function Tur(e,t,n){var o=t[0],r=t[1];return e[0]=n[0]*o+n[2]*r,e[1]=n[1]*o+n[3]*r,e}function Dur(e,t,n){var o=t[0],r=t[1];return e[0]=n[0]*o+n[2]*r+n[4],e[1]=n[1]*o+n[3]*r+n[5],e}function Nur(e,t,n){var o=t[0],r=t[1];return e[0]=n[0]*o+n[3]*r+n[6],e[1]=n[1]*o+n[4]*r+n[7],e}function Rur(e,t,n){var o=t[0],r=t[1];return e[0]=n[0]*o+n[4]*r+n[12],e[1]=n[1]*o+n[5]*r+n[13],e}function Qur(e,t,n,o){var r=t[0]-n[0],i=t[1]-n[1],s=Math.sin(o),a=Math.cos(o);return e[0]=r*a-i*s+n[0],e[1]=r*s+i*a+n[1],e}function kur(e,t){var n=e[0],o=e[1],r=t[0],i=t[1];return Math.abs(Math.atan2(o*r-n*i,n*r+o*i))}function Lur(e,t){var n=e[0],o=e[1],r=t[0],i=t[1];return Math.atan2(n*i-o*r,n*r+o*i)}function Hur(e){return e[0]=0,e[1]=0,e}function Fur(e){return"vec2("+e[0]+", "+e[1]+")"}function zur(e,t){return e[0]===t[0]&&e[1]===t[1]}function Our(e,t){var n=e[0],o=e[1],r=t[0],i=t[1];return Math.abs(n-r)<=sw.EPSILON*Math.max(1,Math.abs(n),Math.abs(r))&&Math.abs(o-i)<=sw.EPSILON*Math.max(1,Math.abs(o),Math.abs(i))}var XDs=wHt.len=EHt,jDs=wHt.sub=bHt,KDs=wHt.mul=IHt,$Ds=wHt.div=vHt,qDs=wHt.dist=SHt,JDs=wHt.sqrDist=PHt,ZDs=wHt.sqrLen=MHt,eNs=wHt.forEach=function(){var e=CHt();return function(t,n,o,r,i,s){var a,c;if(!n)n=2;if(!o)o=0;if(r)c=Math.min(r*n+o,t.length);else c=t.length;for(a=o;a<c;a+=n)e[0]=t[a],e[1]=t[a+1],i(e,e,s),t[a]=e[0],t[a+1]=e[1];return t}}()});var M7=lt(function(HHt){function HUe(e){return HUe=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},HUe(e)}Object.defineProperty(HHt,"__esModule",{value:!0});HHt.vec4=HHt.vec3=HHt.vec2=HHt.quat2=HHt.quat=HHt.mat4=HHt.mat3=HHt.mat2d=HHt.mat2=HHt.glMatrix=void 0;var E0r=JI(qI());HHt.glMatrix=E0r;var M0r=JI(Hkt());HHt.mat2=M0r;var w0r=JI(Ukt());HHt.mat2d=w0r;var B0r=JI(vUe());HHt.mat3=B0r;var T0r=JI(PUe());HHt.mat4=T0r;var D0r=JI(RUe());HHt.quat=D0r;var N0r=JI(yHt());HHt.quat2=N0r;var R0r=JI(LHt());HHt.vec2=R0r;var Q0r=JI(wUe());HHt.vec3=Q0r;var k0r=JI(TUe());HHt.vec4=k0r;function JI(e,t){if(typeof WeakMap=="function")var n=new WeakMap,o=new WeakMap;return(JI=function(i,s){if(!s&&i&&i.__esModule)return i;var a,c,l={__proto__:null,default:i};if(i===null||HUe(i)!="object"&&typeof i!="function")return l;if(a=s?o:n){if(a.has(i))return a.get(i);a.set(i,l)}for(var h in i)h!=="default"&&{}.hasOwnProperty.call(i,h)&&((c=(a=Object.defineProperty)&&Object.getOwnPropertyDescriptor(i,h))&&(c.get||c.set)?a(l,h,c):l[h]=i[h]);return l})(e,t)}});var OUe=lt(function(oNs,UHt){var{defineProperty:zUe,getOwnPropertyDescriptor:W0r,getOwnPropertyNames:X0r}=Object,j0r=Object.prototype.hasOwnProperty,K0r=(e,t)=>{for(var n in t)zUe(e,n,{get:t[n],enumerable:!0})},$0r=(e,t,n,o)=>{if(t&&typeof t==="object"||typeof t==="function"){for(let r of X0r(t))if(!j0r.call(e,r)&&r!==n)zUe(e,r,{get:()=>t[r],enumerable:!(o=W0r(t,r))||o.enumerable})}return e},q0r=(e)=>$0r(zUe({},"__esModule",{value:!0}),e),zHt={};K0r(zHt,{assertTransformMatrix:()=>RK,executeJscadOperations:()=>YHt,jscadPlanner:()=>J0r,resolveReferencePlanes:()=>VHt,toTransformMatrix:()=>cO});UHt.exports=q0r(zHt);var OHt="Transform matrix must be a column-major array of exactly 16 finite numbers";function RK(e){if(!Array.isArray(e)||e.length!==16||!Array.from(e).every(Number.isFinite))throw Error(OHt)}function cO(e){if(e==null||e.length!==16)throw Error(OHt);let t=Array.from(e);return RK(t),t}var J0r={booleans:{intersect:(...e)=>({type:"intersect",shapes:e}),subtract:(...e)=>({type:"subtract",shapes:e}),union:(...e)=>({type:"union",shapes:e})},hulls:{hull:(...e)=>({type:"hull",shapes:e.flat()}),hullChain:(...e)=>({type:"hullChain",shapes:e.flat()})},colors:{colorize:(e,t)=>({type:"colorize",color:e,shape:t})},primitives:{rectangle:(e)=>({...e,type:"rectangle"}),cube:(e)=>({type:"cube",...e}),sphere:(e)=>({type:"sphere",...e}),cylinder:(e)=>({type:"cylinder",...e}),polygon:(e)=>({type:"polygon",...e}),cuboid:(e)=>({type:"cuboid",...e}),roundedCuboid:(e)=>({type:"roundedCuboid",...e})},transforms:{transform:(e,t)=>(RK(e),{type:"transform",matrix:e,shape:t}),rotate:(e,t)=>({type:"rotate",angles:e,shape:t}),rotateX:(e,t)=>({type:"rotateX",angle:e,shape:t}),rotateY:(e,t)=>({type:"rotateY",angle:e,shape:t}),rotateZ:(e,t)=>({type:"rotateZ",angle:e,shape:t}),scale:(e,t)=>({type:"scale",factors:e,shape:t}),translate:(e,t)=>({type:"translate",vector:e,shape:t})},extrusions:{extrudeLinear:(e,t)=>({type:"extrudeLinear",options:e,shape:t}),extrudeRotate:(e,t)=>({type:"extrudeRotate",options:e,shape:t})},maths:{vec2:{create:(e,t)=>[e,t],fromValues:(e,t)=>[e,t]},vec3:{create:(e,t,n)=>[e,t,n],fromValues:(e,t,n)=>[e,t,n]}},geometries:{geom2:{create:(e)=>({type:"createGeom2",points:e}),fromPoints:(e)=>({type:"fromPointsGeom2",points:e})},geom3:{create:(e)=>({type:"createGeom3",polygons:e})},path2:{create:(e)=>({type:"createPath2",points:e})}},measurements:{measureBoundingBox:(e)=>({type:"measureBoundingBox",shape:e}),measureArea:(e)=>({type:"measureArea",shape:e}),measureVolume:(e)=>({type:"measureVolume",shape:e})},utils:{degToRad:(e)=>e*Math.PI/180,radToDeg:(e)=>e*180/Math.PI}},D2=M7(),FUe=()=>cO(D2.mat4.create());function Z0r(e){let t=FUe();switch(e.type){case"transform":return RK(e.matrix),[...e.matrix];case"translate":return cO(D2.mat4.fromTranslation(t,e.vector));case"scale":return cO(D2.mat4.fromScaling(t,e.factors));case"rotate":return D2.mat4.rotateZ(t,t,e.angles[2]),D2.mat4.rotateY(t,t,e.angles[1]),D2.mat4.rotateX(t,t,e.angles[0]),t;case"rotateX":return cO(D2.mat4.fromXRotation(t,e.angle));case"rotateY":return cO(D2.mat4.fromYRotation(t,e.angle));case"rotateZ":return cO(D2.mat4.fromZRotation(t,e.angle));default:throw Error(`Cannot use ${e.type} as a reference transform`)}}function epr(e,t){let n=e.name;if(!n?.trim())throw Error("Reference rectangles require a nonblank name");let o;if(e.type==="rectangle"){if(e.size.length!==2||!e.size.every((l)=>Number.isFinite(l)&&l>0))throw Error(`Reference rectangle "${n}" requires two positive finite dimensions`);o=e.center??[0,0]}else{let l=e.points;if(e.paths||l.length!==4||!l.every((_)=>_.length===2&&_.every((p)=>typeof p==="number"&&Number.isFinite(p))))throw Error(`Reference polygon "${n}" must be an axis-aligned rectangle`);let h=l,d=[...new Set(h.map((_)=>_[0]))],u=[...new Set(h.map((_)=>_[1]))];if(d.length!==2||u.length!==2||new Set(h.map((_)=>JSON.stringify(_))).size!==4)throw Error(`Reference polygon "${n}" must be an axis-aligned rectangle`);o=[(d[0]+d[1])/2,(u[0]+u[1])/2]}if(o.length!==2||!o.every(Number.isFinite))throw Error(`Reference rectangle "${n}" has an invalid center`);let r=FUe();for(let l of t)D2.mat4.multiply(r,r,Z0r(l));if(RK(r),r[3]!==0||r[7]!==0||r[11]!==0||r[15]!==1)throw Error(`Reference rectangle "${n}" requires affine transforms`);let i=D2.mat4.invert(FUe(),r);if(!i)throw Error(`Reference rectangle "${n}" has a singular transform`);let s=[0,0,0];D2.vec3.transformMat4(s,[o[0],o[1],0],r);let a=[i[2],i[6],i[10]],c=[r[0],r[1],r[2]];if(![...s,...a,...c].every(Number.isFinite)||!D2.vec3.length(a)||!D2.vec3.length(c))throw Error(`Reference rectangle "${n}" has an invalid frame`);return D2.vec3.normalize(a,a),D2.vec3.normalize(c,c),{name:n,origin:s,normal:a,xAxis:c}}function VHt(e){let t=[],n=new Set;function o(s,a,c=!1){if(s.reference){if(s.type!=="rectangle"&&s.type!=="polygon")throw Error("Only rectangles can be reference geometry");if(c)throw Error("Reference rectangles must be outside extrusion and measurement inputs");let l=epr(s,a);if(n.has(l.name))throw Error(`Duplicate reference plane "${l.name}"`);n.add(l.name),t.push(l);return}switch(s.type){case"translate":case"rotate":case"rotateX":case"rotateY":case"rotateZ":case"scale":case"transform":{let l=o(s.shape,[...a,s],c);return l?{...s,shape:l}:void 0}case"colorize":{let l=o(s.shape,a,c);return l?{...s,shape:l}:void 0}case"extrudeLinear":case"extrudeRotate":case"measureArea":case"measureVolume":case"measureBoundingBox":{let l=o(s.shape,a,!0);return l?{...s,shape:l}:void 0}case"union":case"subtract":case"intersect":case"hull":case"hullChain":{let l=s.shapes.map((d)=>o(d,a,c));if(s.type==="subtract"&&s.shapes.length&&!l[0])throw Error("A subtraction base cannot be reference geometry");let h=l.filter((d)=>d!==void 0);if(!h.length)return;if(h.length===1)return h[0];return{...s,shapes:h}}default:return{...s}}}let r=(Array.isArray(e)?e:[e]).map((s)=>o(s,[])).filter((s)=>s!==void 0);return{geometry:r.length>1?{type:"union",shapes:r}:r[0],referencePlanes:t}}var YHt=(e,t)=>{if(Array.isArray(t)&&t.length===1)return YHt(e,t[0]);if(Array.isArray(t))throw Error("executeJscadOperations currently doesn't support Array<JscadOperation>, try adding a root union or or executing each element individually");let{geometry:n}=VHt(t);if(!n)throw Error("JSCAD plan contains only reference geometry");return GHt(e,n)},GHt=(e,t)=>{let n=(i)=>GHt(e,i),{type:o,...r}=t;switch(o){case"rectangle":if(!e.primitives.rectangle)throw Error("JSCAD adapter does not support primitives.rectangle");return e.primitives.rectangle({size:t.size,center:t.center??[0,0]});case"intersect":return e.booleans.intersect(...t.shapes.map(n));case"subtract":return e.booleans.subtract(...t.shapes.map(n));case"union":return e.booleans.union(...t.shapes.map(n));case"hull":return e.hulls.hull(...t.shapes.map(n));case"hullChain":return e.hulls.hullChain(...t.shapes.map(n));case"colorize":return e.colors.colorize(t.color,n(t.shape));case"cube":return e.primitives.cube(r);case"sphere":return e.primitives.sphere(r);case"cylinder":return e.primitives.cylinder(r);case"polygon":return e.primitives.polygon(r);case"cuboid":return e.primitives.cuboid(r);case"roundedCuboid":return e.primitives.roundedCuboid(r);case"transform":if(RK(t.matrix),!e.transforms.transform)throw Error('Cannot execute "transform" operation: this JSCAD adapter does not support transforms.transform');return e.transforms.transform(t.matrix,n(t.shape));case"rotate":return e.transforms.rotate(t.angles,n(t.shape));case"rotateX":return e.transforms.rotateX(t.angle,n(t.shape));case"rotateY":return e.transforms.rotateY(t.angle,n(t.shape));case"rotateZ":return e.transforms.rotateZ(t.angle,n(t.shape));case"scale":return e.transforms.scale(t.factors,n(t.shape));case"translate":return e.transforms.translate(t.vector,n(t.shape));case"extrudeLinear":return e.extrusions.extrudeLinear(t.options,n(t.shape));case"extrudeRotate":return e.extrusions.extrudeRotate(t.options,n(t.shape));case"createGeom2":return e.geometries.geom2.create(t.points);case"fromPointsGeom2":return e.geometries.geom2.fromPoints(t.points);case"createGeom3":return e.geometries.geom3.create(t.polygons);case"createPath2":return e.geometries.path2.create(t.points);case"measureBoundingBox":return e.measurements.measureBoundingBox(n(t.shape));case"measureArea":return e.measurements.measureArea(n(t.shape));case"measureVolume":return e.measurements.measureVolume(n(t.shape));case"degToRad":return e.utils.degToRad(t.degrees);case"radToDeg":return e.utils.radToDeg(t.radians);default:if(t.type===void 0)throw Error(`Operation type is undefined. This usually means the operation object is malformed or not properly initialized. Operation: ${JSON.stringify(t,null,2).slice(0,200)}...`);throw Error(`Unsupported operation type: ${t.type}. Operation: ${JSON.stringify(t,null,2)}`)}}});var v4e=lt(function($Ht,qHt){(function(e){var t;typeof $Ht=="object"?qHt.exports=e():typeof define=="function"&&define.amd?define(e):(typeof window<"u"?t=window:typeof global<"u"?t=global:typeof self<"u"&&(t=self),t.objectHash=e())})(function(){return function e(t,n,o){function r(a,c){if(!n[a]){if(!t[a]){var l=KW;if(!c&&l)return l(a,!0);if(i)return i(a,!0);throw Error("Cannot find module '"+a+"'")}c=n[a]={exports:{}},t[a][0].call(c.exports,function(h){var d=t[a][1][h];return r(d||h)},c,c.exports,e,t,n,o)}return n[a].exports}for(var i=KW,s=0;s<o.length;s++)r(o[s]);return r}({1:[function(e,t,n){(function(o,r,i,s,a,c,l,h,d){var u=e("crypto");function _(x,C){C=A(x,C);var b;return(b=C.algorithm!=="passthrough"?u.createHash(C.algorithm):new y).write===void 0&&(b.write=b.update,b.end=b.update),f(C,b).dispatch(x),b.update||b.end(""),b.digest?b.digest(C.encoding==="buffer"?void 0:C.encoding):(x=b.read(),C.encoding!=="buffer"?x.toString(C.encoding):x)}(n=t.exports=_).sha1=function(x){return _(x)},n.keys=function(x){return _(x,{excludeValues:!0,algorithm:"sha1",encoding:"hex"})},n.MD5=function(x){return _(x,{algorithm:"md5",encoding:"hex"})},n.keysMD5=function(x){return _(x,{algorithm:"md5",encoding:"hex",excludeValues:!0})};var p=u.getHashes?u.getHashes().slice():["sha1","md5"],m=(p.push("passthrough"),["buffer","hex","binary","base64"]);function A(x,C){var b={};if(b.algorithm=(C=C||{}).algorithm||"sha1",b.encoding=C.encoding||"hex",b.excludeValues=!!C.excludeValues,b.algorithm=b.algorithm.toLowerCase(),b.encoding=b.encoding.toLowerCase(),b.ignoreUnknown=C.ignoreUnknown===!0,b.respectType=C.respectType!==!1,b.respectFunctionNames=C.respectFunctionNames!==!1,b.respectFunctionProperties=C.respectFunctionProperties!==!1,b.unorderedArrays=C.unorderedArrays===!0,b.unorderedSets=C.unorderedSets!==!1,b.unorderedObjects=C.unorderedObjects!==!1,b.replacer=C.replacer||void 0,b.excludeKeys=C.excludeKeys||void 0,x===void 0)throw Error("Object argument required.");for(var I=0;I<p.length;++I)p[I].toLowerCase()===b.algorithm.toLowerCase()&&(b.algorithm=p[I]);if(p.indexOf(b.algorithm)===-1)throw Error('Algorithm "'+b.algorithm+'"  not supported. supported values: '+p.join(", "));if(m.indexOf(b.encoding)===-1&&b.algorithm!=="passthrough")throw Error('Encoding "'+b.encoding+'"  not supported. supported values: '+m.join(", "));return b}function g(x){if(typeof x=="function")return/^function\s+\w*\s*\(\s*\)\s*{\s+\[native code\]\s+}$/i.exec(Function.prototype.toString.call(x))!=null}function f(x,C,b){b=b||[];function I(v){return C.update?C.update(v,"utf8"):C.write(v,"utf8")}return{dispatch:function(v){return this["_"+((v=x.replacer?x.replacer(v):v)===null?"null":typeof v)](v)},_object:function(v){var P,M=Object.prototype.toString.call(v),B=/\[object (.*)\]/i.exec(M);if(B=(B=B?B[1]:"unknown:["+M+"]").toLowerCase(),0<=(M=b.indexOf(v)))return this.dispatch("[CIRCULAR:"+M+"]");if(b.push(v),i!==void 0&&i.isBuffer&&i.isBuffer(v))return I("buffer:"),I(v);if(B==="object"||B==="function"||B==="asyncfunction")return M=Object.keys(v),x.unorderedObjects&&(M=M.sort()),x.respectType===!1||g(v)||M.splice(0,0,"prototype","__proto__","constructor"),x.excludeKeys&&(M=M.filter(function(T){return!x.excludeKeys(T)})),I("object:"+M.length+":"),P=this,M.forEach(function(T){P.dispatch(T),I(":"),x.excludeValues||P.dispatch(v[T]),I(",")});if(!this["_"+B]){if(x.ignoreUnknown)return I("["+B+"]");throw Error('Unknown object type "'+B+'"')}this["_"+B](v)},_array:function(v,T){T=T!==void 0?T:x.unorderedArrays!==!1;var M=this;if(I("array:"+v.length+":"),!T||v.length<=1)return v.forEach(function(N){return M.dispatch(N)});var B=[],T=v.map(function(N){var D=new y,L=b.slice();return f(x,D,L).dispatch(N),B=B.concat(L.slice(b.length)),D.read().toString()});return b=b.concat(B),T.sort(),this._array(T,!1)},_date:function(v){return I("date:"+v.toJSON())},_symbol:function(v){return I("symbol:"+v.toString())},_error:function(v){return I("error:"+v.toString())},_boolean:function(v){return I("bool:"+v.toString())},_string:function(v){I("string:"+v.length+":"),I(v.toString())},_function:function(v){I("fn:"),g(v)?this.dispatch("[native]"):this.dispatch(v.toString()),x.respectFunctionNames!==!1&&this.dispatch("function-name:"+String(v.name)),x.respectFunctionProperties&&this._object(v)},_number:function(v){return I("number:"+v.toString())},_xml:function(v){return I("xml:"+v.toString())},_null:function(){return I("Null")},_undefined:function(){return I("Undefined")},_regexp:function(v){return I("regex:"+v.toString())},_uint8array:function(v){return I("uint8array:"),this.dispatch(Array.prototype.slice.call(v))},_uint8clampedarray:function(v){return I("uint8clampedarray:"),this.dispatch(Array.prototype.slice.call(v))},_int8array:function(v){return I("int8array:"),this.dispatch(Array.prototype.slice.call(v))},_uint16array:function(v){return I("uint16array:"),this.dispatch(Array.prototype.slice.call(v))},_int16array:function(v){return I("int16array:"),this.dispatch(Array.prototype.slice.call(v))},_uint32array:function(v){return I("uint32array:"),this.dispatch(Array.prototype.slice.call(v))},_int32array:function(v){return I("int32array:"),this.dispatch(Array.prototype.slice.call(v))},_float32array:function(v){return I("float32array:"),this.dispatch(Array.prototype.slice.call(v))},_float64array:function(v){return I("float64array:"),this.dispatch(Array.prototype.slice.call(v))},_arraybuffer:function(v){return I("arraybuffer:"),this.dispatch(new Uint8Array(v))},_url:function(v){return I("url:"+v.toString())},_map:function(v){return I("map:"),v=Array.from(v),this._array(v,x.unorderedSets!==!1)},_set:function(v){return I("set:"),v=Array.from(v),this._array(v,x.unorderedSets!==!1)},_file:function(v){return I("file:"),this.dispatch([v.name,v.size,v.type,v.lastModfied])},_blob:function(){if(x.ignoreUnknown)return I("[blob]");throw Error(`Hashing Blob objects is currently not supported
(see https://github.com/puleos/object-hash/issues/26)
Use "options.replacer" or "options.ignoreUnknown"
`)},_domwindow:function(){return I("domwindow")},_bigint:function(v){return I("bigint:"+v.toString())},_process:function(){return I("process")},_timer:function(){return I("timer")},_pipe:function(){return I("pipe")},_tcp:function(){return I("tcp")},_udp:function(){return I("udp")},_tty:function(){return I("tty")},_statwatcher:function(){return I("statwatcher")},_securecontext:function(){return I("securecontext")},_connection:function(){return I("connection")},_zlib:function(){return I("zlib")},_context:function(){return I("context")},_nodescript:function(){return I("nodescript")},_httpparser:function(){return I("httpparser")},_dataview:function(){return I("dataview")},_signal:function(){return I("signal")},_fsevent:function(){return I("fsevent")},_tlswrap:function(){return I("tlswrap")}}}function y(){return{buf:"",write:function(x){this.buf+=x},end:function(x){this.buf+=x},read:function(){return this.buf}}}n.writeToStream=function(x,C,b){return b===void 0&&(b=C,C={}),f(C=A(x,C),b).dispatch(x)}}).call(this,e("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},e("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/fake_9a5aa49d.js","/")},{buffer:3,crypto:5,lYpoI2:11}],2:[function(e,t,n){(function(o,r,i,s,a,c,l,h,d){(function(u){var _=typeof Uint8Array<"u"?Uint8Array:Array,p=43,m=47,A=48,g=97,f=65,y=45,x=95;function C(b){return b=b.charCodeAt(0),b===p||b===y?62:b===m||b===x?63:b<A?-1:b<A+10?b-A+26+26:b<f+26?b-f:b<g+26?b-g+26:void 0}u.toByteArray=function(b){var I,v;if(0<b.length%4)throw Error("Invalid string. Length must be a multiple of 4");var P=b.length,P=b.charAt(P-2)==="="?2:b.charAt(P-1)==="="?1:0,M=new _(3*b.length/4-P),B=0<P?b.length-4:b.length,T=0;function N(D){M[T++]=D}for(I=0;I<B;I+=4,0)N((16711680&(v=C(b.charAt(I))<<18|C(b.charAt(I+1))<<12|C(b.charAt(I+2))<<6|C(b.charAt(I+3))))>>16),N((65280&v)>>8),N(255&v);return P==2?N(255&(v=C(b.charAt(I))<<2|C(b.charAt(I+1))>>4)):P==1&&(N((v=C(b.charAt(I))<<10|C(b.charAt(I+1))<<4|C(b.charAt(I+2))>>2)>>8&255),N(255&v)),M},u.fromByteArray=function(b){var I,v,P,M,B=b.length%3,T="";function N(D){return"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(D)}for(I=0,P=b.length-B;I<P;I+=3)v=(b[I]<<16)+(b[I+1]<<8)+b[I+2],T+=N((M=v)>>18&63)+N(M>>12&63)+N(M>>6&63)+N(63&M);switch(B){case 1:T=(T+=N((v=b[b.length-1])>>2))+N(v<<4&63)+"==";break;case 2:T=(T=(T+=N((v=(b[b.length-2]<<8)+b[b.length-1])>>10))+N(v>>4&63))+N(v<<2&63)+"="}return T}})(n===void 0?this.base64js={}:n)}).call(this,e("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},e("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/base64-js/lib/b64.js","/node_modules/gulp-browserify/node_modules/base64-js/lib")},{buffer:3,lYpoI2:11}],3:[function(e,t,n){(function(o,r,p,s,a,c,l,h,d){var u=e("base64-js"),_=e("ieee754");function p(ne,re,Z){if(!(this instanceof p))return new p(ne,re,Z);var te,ie,ce,ue,de=typeof ne;if(re==="base64"&&de=="string")for(ne=(ue=ne).trim?ue.trim():ue.replace(/^\s+|\s+$/g,"");ne.length%4!=0;)ne+="=";if(de=="number")te=H(ne);else if(de=="string")te=p.byteLength(ne,re);else{if(de!="object")throw Error("First argument needs to be a number, array or string.");te=H(ne.length)}if(p._useTypedArrays?ie=p._augment(new Uint8Array(te)):((ie=this).length=te,ie._isBuffer=!0),p._useTypedArrays&&typeof ne.byteLength=="number")ie._set(ne);else if(V(ue=ne)||p.isBuffer(ue)||ue&&typeof ue=="object"&&typeof ue.length=="number")for(ce=0;ce<te;ce++)p.isBuffer(ne)?ie[ce]=ne.readUInt8(ce):ie[ce]=ne[ce];else if(de=="string")ie.write(ne,0,re);else if(de=="number"&&!p._useTypedArrays&&!Z)for(ce=0;ce<te;ce++)ie[ce]=0;return ie}function m(ne,re,Z,te){return p._charsWritten=Y(function(ie){for(var ce=[],ue=0;ue<ie.length;ue++)ce.push(255&ie.charCodeAt(ue));return ce}(re),ne,Z,te)}function A(ne,re,Z,te){return p._charsWritten=Y(function(ie){for(var ce,ue,de=[],me=0;me<ie.length;me++)ue=ie.charCodeAt(me),ce=ue>>8,ue=ue%256,de.push(ue),de.push(ce);return de}(re),ne,Z,te)}function g(ne,re,Z){var te="";Z=Math.min(ne.length,Z);for(var ie=re;ie<Z;ie++)te+=String.fromCharCode(ne[ie]);return te}function f(ne,re,Z,ce){ce||(se(typeof Z=="boolean","missing or invalid endian"),se(re!=null,"missing offset"),se(re+1<ne.length,"Trying to read beyond buffer length"));var ie,ce=ne.length;if(!(ce<=re))return Z?(ie=ne[re],re+1<ce&&(ie|=ne[re+1]<<8)):(ie=ne[re]<<8,re+1<ce&&(ie|=ne[re+1])),ie}function y(ne,re,Z,ce){ce||(se(typeof Z=="boolean","missing or invalid endian"),se(re!=null,"missing offset"),se(re+3<ne.length,"Trying to read beyond buffer length"));var ie,ce=ne.length;if(!(ce<=re))return Z?(re+2<ce&&(ie=ne[re+2]<<16),re+1<ce&&(ie|=ne[re+1]<<8),ie|=ne[re],re+3<ce&&(ie+=ne[re+3]<<24>>>0)):(re+1<ce&&(ie=ne[re+1]<<16),re+2<ce&&(ie|=ne[re+2]<<8),re+3<ce&&(ie|=ne[re+3]),ie+=ne[re]<<24>>>0),ie}function x(ne,re,Z,te){if(te||(se(typeof Z=="boolean","missing or invalid endian"),se(re!=null,"missing offset"),se(re+1<ne.length,"Trying to read beyond buffer length")),!(ne.length<=re))return te=f(ne,re,Z,!0),32768&te?-1*(65535-te+1):te}function C(ne,re,Z,te){if(te||(se(typeof Z=="boolean","missing or invalid endian"),se(re!=null,"missing offset"),se(re+3<ne.length,"Trying to read beyond buffer length")),!(ne.length<=re))return te=y(ne,re,Z,!0),2147483648&te?-1*(4294967295-te+1):te}function b(ne,re,Z,te){return te||(se(typeof Z=="boolean","missing or invalid endian"),se(re+3<ne.length,"Trying to read beyond buffer length")),_.read(ne,re,Z,23,4)}function I(ne,re,Z,te){return te||(se(typeof Z=="boolean","missing or invalid endian"),se(re+7<ne.length,"Trying to read beyond buffer length")),_.read(ne,re,Z,52,8)}function v(ne,re,Z,te,ie){if(ie||(se(re!=null,"missing value"),se(typeof te=="boolean","missing or invalid endian"),se(Z!=null,"missing offset"),se(Z+1<ne.length,"trying to write beyond buffer length"),K(re,65535)),ie=ne.length,!(ie<=Z))for(var ce=0,ue=Math.min(ie-Z,2);ce<ue;ce++)ne[Z+ce]=(re&255<<8*(te?ce:1-ce))>>>8*(te?ce:1-ce)}function P(ne,re,Z,te,ie){if(ie||(se(re!=null,"missing value"),se(typeof te=="boolean","missing or invalid endian"),se(Z!=null,"missing offset"),se(Z+3<ne.length,"trying to write beyond buffer length"),K(re,4294967295)),ie=ne.length,!(ie<=Z))for(var ce=0,ue=Math.min(ie-Z,4);ce<ue;ce++)ne[Z+ce]=re>>>8*(te?ce:3-ce)&255}function M(ne,re,Z,te,ie){ie||(se(re!=null,"missing value"),se(typeof te=="boolean","missing or invalid endian"),se(Z!=null,"missing offset"),se(Z+1<ne.length,"Trying to write beyond buffer length"),J(re,32767,-32768)),ne.length<=Z||v(ne,0<=re?re:65535+re+1,Z,te,ie)}function B(ne,re,Z,te,ie){ie||(se(re!=null,"missing value"),se(typeof te=="boolean","missing or invalid endian"),se(Z!=null,"missing offset"),se(Z+3<ne.length,"Trying to write beyond buffer length"),J(re,2147483647,-2147483648)),ne.length<=Z||P(ne,0<=re?re:4294967295+re+1,Z,te,ie)}function T(ne,re,Z,te,ie){ie||(se(re!=null,"missing value"),se(typeof te=="boolean","missing or invalid endian"),se(Z!=null,"missing offset"),se(Z+3<ne.length,"Trying to write beyond buffer length"),ee(re,340282346638528860000000000000000000000,-340282346638528860000000000000000000000)),ne.length<=Z||_.write(ne,re,Z,te,23,4)}function N(ne,re,Z,te,ie){ie||(se(re!=null,"missing value"),se(typeof te=="boolean","missing or invalid endian"),se(Z!=null,"missing offset"),se(Z+7<ne.length,"Trying to write beyond buffer length"),ee(re,179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000,-179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),ne.length<=Z||_.write(ne,re,Z,te,52,8)}n.Buffer=p,n.SlowBuffer=p,n.INSPECT_MAX_BYTES=50,p.poolSize=8192,p._useTypedArrays=function(){try{var ne=new ArrayBuffer(0),re=new Uint8Array(ne);return re.foo=function(){return 42},re.foo()===42&&typeof re.subarray=="function"}catch(Z){return!1}}(),p.isEncoding=function(ne){switch(String(ne).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"raw":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},p.isBuffer=function(ne){return!(ne==null||!ne._isBuffer)},p.byteLength=function(ne,re){var Z;switch(ne+="",re||"utf8"){case"hex":Z=ne.length/2;break;case"utf8":case"utf-8":Z=U(ne).length;break;case"ascii":case"binary":case"raw":Z=ne.length;break;case"base64":Z=j(ne).length;break;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":Z=2*ne.length;break;default:throw Error("Unknown encoding")}return Z},p.concat=function(ne,re){if(se(V(ne),`Usage: Buffer.concat(list, [totalLength])
list should be an Array.`),ne.length===0)return new p(0);if(ne.length===1)return ne[0];if(typeof re!="number")for(ie=re=0;ie<ne.length;ie++)re+=ne[ie].length;for(var Z=new p(re),te=0,ie=0;ie<ne.length;ie++){var ce=ne[ie];ce.copy(Z,te),te+=ce.length}return Z},p.prototype.write=function(ne,re,Z,te){isFinite(re)?isFinite(Z)||(te=Z,Z=void 0):(me=te,te=re,re=Z,Z=me),re=Number(re)||0;var ie,ce,ue,de,me=this.length-re;switch((!Z||me<(Z=Number(Z)))&&(Z=me),te=String(te||"utf8").toLowerCase()){case"hex":ie=function(ge,xe,Ee,Re){Ee=Number(Ee)||0;var Me=ge.length-Ee;(!Re||Me<(Re=Number(Re)))&&(Re=Me),se((Me=xe.length)%2==0,"Invalid hex string"),Me/2<Re&&(Re=Me/2);for(var _e=0;_e<Re;_e++){var ye=parseInt(xe.substr(2*_e,2),16);se(!isNaN(ye),"Invalid hex string"),ge[Ee+_e]=ye}return p._charsWritten=2*_e,_e}(this,ne,re,Z);break;case"utf8":case"utf-8":ce=this,ue=re,de=Z,ie=p._charsWritten=Y(U(ne),ce,ue,de);break;case"ascii":case"binary":ie=m(this,ne,re,Z);break;case"base64":ce=this,ue=re,de=Z,ie=p._charsWritten=Y(j(ne),ce,ue,de);break;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":ie=A(this,ne,re,Z);break;default:throw Error("Unknown encoding")}return ie},p.prototype.toString=function(ne,re,Z){var te,ie,ce,ue,de=this;if(ne=String(ne||"utf8").toLowerCase(),re=Number(re)||0,(Z=Z!==void 0?Number(Z):de.length)===re)return"";switch(ne){case"hex":te=function(me,ge,xe){var Ee=me.length;(!ge||ge<0)&&(ge=0),(!xe||xe<0||Ee<xe)&&(xe=Ee);for(var Re="",Me=ge;Me<xe;Me++)Re+=O(me[Me]);return Re}(de,re,Z);break;case"utf8":case"utf-8":te=function(me,ge,xe){var Ee="",Re="";xe=Math.min(me.length,xe);for(var Me=ge;Me<xe;Me++)me[Me]<=127?(Ee+=X(Re)+String.fromCharCode(me[Me]),Re=""):Re+="%"+me[Me].toString(16);return Ee+X(Re)}(de,re,Z);break;case"ascii":case"binary":te=g(de,re,Z);break;case"base64":ie=de,ue=Z,te=(ce=re)===0&&ue===ie.length?u.fromByteArray(ie):u.fromByteArray(ie.slice(ce,ue));break;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":te=function(me,ge,xe){for(var Ee=me.slice(ge,xe),Re="",Me=0;Me<Ee.length;Me+=2)Re+=String.fromCharCode(Ee[Me]+256*Ee[Me+1]);return Re}(de,re,Z);break;default:throw Error("Unknown encoding")}return te},p.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},p.prototype.copy=function(ne,re,Z,te){if(re=re||0,(te=te||te===0?te:this.length)!==(Z=Z||0)&&ne.length!==0&&this.length!==0){se(Z<=te,"sourceEnd < sourceStart"),se(0<=re&&re<ne.length,"targetStart out of bounds"),se(0<=Z&&Z<this.length,"sourceStart out of bounds"),se(0<=te&&te<=this.length,"sourceEnd out of bounds"),te>this.length&&(te=this.length);var ie=(te=ne.length-re<te-Z?ne.length-re+Z:te)-Z;if(ie<100||!p._useTypedArrays)for(var ce=0;ce<ie;ce++)ne[ce+re]=this[ce+Z];else ne._set(this.subarray(Z,Z+ie),re)}},p.prototype.slice=function(ne,re){var Z=this.length;if(ne=L(ne,Z,0),re=L(re,Z,Z),p._useTypedArrays)return p._augment(this.subarray(ne,re));for(var te=re-ne,ie=new p(te,void 0,!0),ce=0;ce<te;ce++)ie[ce]=this[ce+ne];return ie},p.prototype.get=function(ne){return console.log(".get() is deprecated. Access using array indexes instead."),this.readUInt8(ne)},p.prototype.set=function(ne,re){return console.log(".set() is deprecated. Access using array indexes instead."),this.writeUInt8(ne,re)},p.prototype.readUInt8=function(ne,re){if(re||(se(ne!=null,"missing offset"),se(ne<this.length,"Trying to read beyond buffer length")),!(ne>=this.length))return this[ne]},p.prototype.readUInt16LE=function(ne,re){return f(this,ne,!0,re)},p.prototype.readUInt16BE=function(ne,re){return f(this,ne,!1,re)},p.prototype.readUInt32LE=function(ne,re){return y(this,ne,!0,re)},p.prototype.readUInt32BE=function(ne,re){return y(this,ne,!1,re)},p.prototype.readInt8=function(ne,re){if(re||(se(ne!=null,"missing offset"),se(ne<this.length,"Trying to read beyond buffer length")),!(ne>=this.length))return 128&this[ne]?-1*(255-this[ne]+1):this[ne]},p.prototype.readInt16LE=function(ne,re){return x(this,ne,!0,re)},p.prototype.readInt16BE=function(ne,re){return x(this,ne,!1,re)},p.prototype.readInt32LE=function(ne,re){return C(this,ne,!0,re)},p.prototype.readInt32BE=function(ne,re){return C(this,ne,!1,re)},p.prototype.readFloatLE=function(ne,re){return b(this,ne,!0,re)},p.prototype.readFloatBE=function(ne,re){return b(this,ne,!1,re)},p.prototype.readDoubleLE=function(ne,re){return I(this,ne,!0,re)},p.prototype.readDoubleBE=function(ne,re){return I(this,ne,!1,re)},p.prototype.writeUInt8=function(ne,re,Z){Z||(se(ne!=null,"missing value"),se(re!=null,"missing offset"),se(re<this.length,"trying to write beyond buffer length"),K(ne,255)),re>=this.length||(this[re]=ne)},p.prototype.writeUInt16LE=function(ne,re,Z){v(this,ne,re,!0,Z)},p.prototype.writeUInt16BE=function(ne,re,Z){v(this,ne,re,!1,Z)},p.prototype.writeUInt32LE=function(ne,re,Z){P(this,ne,re,!0,Z)},p.prototype.writeUInt32BE=function(ne,re,Z){P(this,ne,re,!1,Z)},p.prototype.writeInt8=function(ne,re,Z){Z||(se(ne!=null,"missing value"),se(re!=null,"missing offset"),se(re<this.length,"Trying to write beyond buffer length"),J(ne,127,-128)),re>=this.length||(0<=ne?this.writeUInt8(ne,re,Z):this.writeUInt8(255+ne+1,re,Z))},p.prototype.writeInt16LE=function(ne,re,Z){M(this,ne,re,!0,Z)},p.prototype.writeInt16BE=function(ne,re,Z){M(this,ne,re,!1,Z)},p.prototype.writeInt32LE=function(ne,re,Z){B(this,ne,re,!0,Z)},p.prototype.writeInt32BE=function(ne,re,Z){B(this,ne,re,!1,Z)},p.prototype.writeFloatLE=function(ne,re,Z){T(this,ne,re,!0,Z)},p.prototype.writeFloatBE=function(ne,re,Z){T(this,ne,re,!1,Z)},p.prototype.writeDoubleLE=function(ne,re,Z){N(this,ne,re,!0,Z)},p.prototype.writeDoubleBE=function(ne,re,Z){N(this,ne,re,!1,Z)},p.prototype.fill=function(ne,re,Z){if(re=re||0,Z=Z||this.length,se(typeof(ne=typeof(ne=ne||0)=="string"?ne.charCodeAt(0):ne)=="number"&&!isNaN(ne),"value is not a number"),se(re<=Z,"end < start"),Z!==re&&this.length!==0){se(0<=re&&re<this.length,"start out of bounds"),se(0<=Z&&Z<=this.length,"end out of bounds");for(var te=re;te<Z;te++)this[te]=ne}},p.prototype.inspect=function(){for(var ne=[],re=this.length,Z=0;Z<re;Z++)if(ne[Z]=O(this[Z]),Z===n.INSPECT_MAX_BYTES){ne[Z+1]="...";break}return"<Buffer "+ne.join(" ")+">"},p.prototype.toArrayBuffer=function(){if(typeof Uint8Array>"u")throw Error("Buffer.toArrayBuffer not supported in this browser");if(p._useTypedArrays)return new p(this).buffer;for(var ne=new Uint8Array(this.length),re=0,Z=ne.length;re<Z;re+=1)ne[re]=this[re];return ne.buffer};var D=p.prototype;function L(ne,re,Z){return typeof ne!="number"?Z:re<=(ne=~~ne)?re:0<=ne||0<=(ne+=re)?ne:0}function H(ne){return(ne=~~Math.ceil(+ne))<0?0:ne}function V(ne){return(Array.isArray||function(re){return Object.prototype.toString.call(re)==="[object Array]"})(ne)}function O(ne){return ne<16?"0"+ne.toString(16):ne.toString(16)}function U(ne){for(var re=[],Z=0;Z<ne.length;Z++){var te=ne.charCodeAt(Z);if(te<=127)re.push(ne.charCodeAt(Z));else for(var ie=Z,ce=(55296<=te&&te<=57343&&Z++,encodeURIComponent(ne.slice(ie,Z+1)).substr(1).split("%")),ue=0;ue<ce.length;ue++)re.push(parseInt(ce[ue],16))}return re}function j(ne){return u.toByteArray(ne)}function Y(ne,re,Z,te){for(var ie=0;ie<te&&!(ie+Z>=re.length||ie>=ne.length);ie++)re[ie+Z]=ne[ie];return ie}function X(ne){try{return decodeURIComponent(ne)}catch(re){return String.fromCharCode(65533)}}function K(ne,re){se(typeof ne=="number","cannot write a non-number as a number"),se(0<=ne,"specified a negative value for writing an unsigned value"),se(ne<=re,"value is larger than maximum value for type"),se(Math.floor(ne)===ne,"value has a fractional component")}function J(ne,re,Z){se(typeof ne=="number","cannot write a non-number as a number"),se(ne<=re,"value larger than maximum allowed value"),se(Z<=ne,"value smaller than minimum allowed value"),se(Math.floor(ne)===ne,"value has a fractional component")}function ee(ne,re,Z){se(typeof ne=="number","cannot write a non-number as a number"),se(ne<=re,"value larger than maximum allowed value"),se(Z<=ne,"value smaller than minimum allowed value")}function se(ne,re){if(!ne)throw Error(re||"Failed assertion")}p._augment=function(ne){return ne._isBuffer=!0,ne._get=ne.get,ne._set=ne.set,ne.get=D.get,ne.set=D.set,ne.write=D.write,ne.toString=D.toString,ne.toLocaleString=D.toString,ne.toJSON=D.toJSON,ne.copy=D.copy,ne.slice=D.slice,ne.readUInt8=D.readUInt8,ne.readUInt16LE=D.readUInt16LE,ne.readUInt16BE=D.readUInt16BE,ne.readUInt32LE=D.readUInt32LE,ne.readUInt32BE=D.readUInt32BE,ne.readInt8=D.readInt8,ne.readInt16LE=D.readInt16LE,ne.readInt16BE=D.readInt16BE,ne.readInt32LE=D.readInt32LE,ne.readInt32BE=D.readInt32BE,ne.readFloatLE=D.readFloatLE,ne.readFloatBE=D.readFloatBE,ne.readDoubleLE=D.readDoubleLE,ne.readDoubleBE=D.readDoubleBE,ne.writeUInt8=D.writeUInt8,ne.writeUInt16LE=D.writeUInt16LE,ne.writeUInt16BE=D.writeUInt16BE,ne.writeUInt32LE=D.writeUInt32LE,ne.writeUInt32BE=D.writeUInt32BE,ne.writeInt8=D.writeInt8,ne.writeInt16LE=D.writeInt16LE,ne.writeInt16BE=D.writeInt16BE,ne.writeInt32LE=D.writeInt32LE,ne.writeInt32BE=D.writeInt32BE,ne.writeFloatLE=D.writeFloatLE,ne.writeFloatBE=D.writeFloatBE,ne.writeDoubleLE=D.writeDoubleLE,ne.writeDoubleBE=D.writeDoubleBE,ne.fill=D.fill,ne.inspect=D.inspect,ne.toArrayBuffer=D.toArrayBuffer,ne}}).call(this,e("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},e("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/buffer/index.js","/node_modules/gulp-browserify/node_modules/buffer")},{"base64-js":2,buffer:3,ieee754:10,lYpoI2:11}],4:[function(e,t,n){(function(o,r,u,s,a,c,l,h,d){var u=e("buffer").Buffer,_=4,p=new u(_);p.fill(0),t.exports={hash:function(m,A,g,f){for(var y=A(function(v,P){v.length%_!=0&&(M=v.length+(_-v.length%_),v=u.concat([v,p],M));for(var M,B=[],T=P?v.readInt32BE:v.readInt32LE,N=0;N<v.length;N+=_)B.push(T.call(v,N));return B}(m=u.isBuffer(m)?m:new u(m),f),8*m.length),A=f,x=new u(g),C=A?x.writeInt32BE:x.writeInt32LE,b=0;b<y.length;b++)C.call(x,y[b],4*b,!0);return x}}}).call(this,e("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},e("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/helpers.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{buffer:3,lYpoI2:11}],5:[function(e,t,n){(function(o,r,u,s,a,c,l,h,d){var u=e("buffer").Buffer,_=e("./sha"),p=e("./sha256"),m=e("./rng"),A={sha1:_,sha256:p,md5:e("./md5")},g=64,f=new u(g);function y(v,P){var M=A[v=v||"sha1"],B=[];return M||x("algorithm:",v,"is not yet supported"),{update:function(T){return u.isBuffer(T)||(T=new u(T)),B.push(T),T.length,this},digest:function(T){var N=u.concat(B),N=P?function(D,L,H){u.isBuffer(L)||(L=new u(L)),u.isBuffer(H)||(H=new u(H)),L.length>g?L=D(L):L.length<g&&(L=u.concat([L,f],g));for(var V=new u(g),O=new u(g),U=0;U<g;U++)V[U]=54^L[U],O[U]=92^L[U];return H=D(u.concat([V,H])),D(u.concat([O,H]))}(M,P,N):M(N);return B=null,T?N.toString(T):N}}}function x(){var v=[].slice.call(arguments).join(" ");throw Error([v,"we accept pull requests","http://github.com/dominictarr/crypto-browserify"].join(`
`))}f.fill(0),n.createHash=function(v){return y(v)},n.createHmac=y,n.randomBytes=function(v,P){if(!P||!P.call)return new u(m(v));try{P.call(this,void 0,new u(m(v)))}catch(M){P(M)}};var C,b=["createCredentials","createCipher","createCipheriv","createDecipher","createDecipheriv","createSign","createVerify","createDiffieHellman","pbkdf2"],I=function(v){n[v]=function(){x("sorry,",v,"is not implemented yet")}};for(C in b)I(b[C],C)}).call(this,e("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},e("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/index.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{"./md5":6,"./rng":7,"./sha":8,"./sha256":9,buffer:3,lYpoI2:11}],6:[function(e,t,n){(function(o,r,i,s,a,c,l,h,d){var u=e("./helpers");function _(x,C){x[C>>5]|=128<<C%32,x[14+(C+64>>>9<<4)]=C;for(var b=1732584193,I=-271733879,v=-1732584194,P=271733878,M=0;M<x.length;M+=16){var B=b,T=I,N=v,D=P,b=m(b,I,v,P,x[M+0],7,-680876936),P=m(P,b,I,v,x[M+1],12,-389564586),v=m(v,P,b,I,x[M+2],17,606105819),I=m(I,v,P,b,x[M+3],22,-1044525330);b=m(b,I,v,P,x[M+4],7,-176418897),P=m(P,b,I,v,x[M+5],12,1200080426),v=m(v,P,b,I,x[M+6],17,-1473231341),I=m(I,v,P,b,x[M+7],22,-45705983),b=m(b,I,v,P,x[M+8],7,1770035416),P=m(P,b,I,v,x[M+9],12,-1958414417),v=m(v,P,b,I,x[M+10],17,-42063),I=m(I,v,P,b,x[M+11],22,-1990404162),b=m(b,I,v,P,x[M+12],7,1804603682),P=m(P,b,I,v,x[M+13],12,-40341101),v=m(v,P,b,I,x[M+14],17,-1502002290),b=A(b,I=m(I,v,P,b,x[M+15],22,1236535329),v,P,x[M+1],5,-165796510),P=A(P,b,I,v,x[M+6],9,-1069501632),v=A(v,P,b,I,x[M+11],14,643717713),I=A(I,v,P,b,x[M+0],20,-373897302),b=A(b,I,v,P,x[M+5],5,-701558691),P=A(P,b,I,v,x[M+10],9,38016083),v=A(v,P,b,I,x[M+15],14,-660478335),I=A(I,v,P,b,x[M+4],20,-405537848),b=A(b,I,v,P,x[M+9],5,568446438),P=A(P,b,I,v,x[M+14],9,-1019803690),v=A(v,P,b,I,x[M+3],14,-187363961),I=A(I,v,P,b,x[M+8],20,1163531501),b=A(b,I,v,P,x[M+13],5,-1444681467),P=A(P,b,I,v,x[M+2],9,-51403784),v=A(v,P,b,I,x[M+7],14,1735328473),b=g(b,I=A(I,v,P,b,x[M+12],20,-1926607734),v,P,x[M+5],4,-378558),P=g(P,b,I,v,x[M+8],11,-2022574463),v=g(v,P,b,I,x[M+11],16,1839030562),I=g(I,v,P,b,x[M+14],23,-35309556),b=g(b,I,v,P,x[M+1],4,-1530992060),P=g(P,b,I,v,x[M+4],11,1272893353),v=g(v,P,b,I,x[M+7],16,-155497632),I=g(I,v,P,b,x[M+10],23,-1094730640),b=g(b,I,v,P,x[M+13],4,681279174),P=g(P,b,I,v,x[M+0],11,-358537222),v=g(v,P,b,I,x[M+3],16,-722521979),I=g(I,v,P,b,x[M+6],23,76029189),b=g(b,I,v,P,x[M+9],4,-640364487),P=g(P,b,I,v,x[M+12],11,-421815835),v=g(v,P,b,I,x[M+15],16,530742520),b=f(b,I=g(I,v,P,b,x[M+2],23,-995338651),v,P,x[M+0],6,-198630844),P=f(P,b,I,v,x[M+7],10,1126891415),v=f(v,P,b,I,x[M+14],15,-1416354905),I=f(I,v,P,b,x[M+5],21,-57434055),b=f(b,I,v,P,x[M+12],6,1700485571),P=f(P,b,I,v,x[M+3],10,-1894986606),v=f(v,P,b,I,x[M+10],15,-1051523),I=f(I,v,P,b,x[M+1],21,-2054922799),b=f(b,I,v,P,x[M+8],6,1873313359),P=f(P,b,I,v,x[M+15],10,-30611744),v=f(v,P,b,I,x[M+6],15,-1560198380),I=f(I,v,P,b,x[M+13],21,1309151649),b=f(b,I,v,P,x[M+4],6,-145523070),P=f(P,b,I,v,x[M+11],10,-1120210379),v=f(v,P,b,I,x[M+2],15,718787259),I=f(I,v,P,b,x[M+9],21,-343485551),b=y(b,B),I=y(I,T),v=y(v,N),P=y(P,D)}return Array(b,I,v,P)}function p(x,C,b,I,v,P){return y((C=y(y(C,x),y(I,P)))<<v|C>>>32-v,b)}function m(x,C,b,I,v,P,M){return p(C&b|~C&I,x,C,v,P,M)}function A(x,C,b,I,v,P,M){return p(C&I|b&~I,x,C,v,P,M)}function g(x,C,b,I,v,P,M){return p(C^b^I,x,C,v,P,M)}function f(x,C,b,I,v,P,M){return p(b^(C|~I),x,C,v,P,M)}function y(x,C){var b=(65535&x)+(65535&C);return(x>>16)+(C>>16)+(b>>16)<<16|65535&b}t.exports=function(x){return u.hash(x,_,16)}}).call(this,e("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},e("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/md5.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{"./helpers":4,buffer:3,lYpoI2:11}],7:[function(e,t,n){(function(o,r,i,s,a,c,l,h,d){var u;t.exports=u||function(_){for(var p,m=Array(_),A=0;A<_;A++)(3&A)==0&&(p=4294967296*Math.random()),m[A]=p>>>((3&A)<<3)&255;return m}}).call(this,e("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},e("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/rng.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{buffer:3,lYpoI2:11}],8:[function(e,t,n){(function(o,r,i,s,a,c,l,h,d){var u=e("./helpers");function _(A,g){A[g>>5]|=128<<24-g%32,A[15+(g+64>>9<<4)]=g;for(var f,y,x,C=Array(80),b=1732584193,I=-271733879,v=-1732584194,P=271733878,M=-1009589776,B=0;B<A.length;B+=16){for(var T=b,N=I,D=v,L=P,H=M,V=0;V<80;V++){C[V]=V<16?A[B+V]:m(C[V-3]^C[V-8]^C[V-14]^C[V-16],1);var O=p(p(m(b,5),(O=I,y=v,x=P,(f=V)<20?O&y|~O&x:!(f<40)&&f<60?O&y|O&x|y&x:O^y^x)),p(p(M,C[V]),(f=V)<20?1518500249:f<40?1859775393:f<60?-1894007588:-899497514)),M=P,P=v,v=m(I,30),I=b,b=O}b=p(b,T),I=p(I,N),v=p(v,D),P=p(P,L),M=p(M,H)}return Array(b,I,v,P,M)}function p(A,g){var f=(65535&A)+(65535&g);return(A>>16)+(g>>16)+(f>>16)<<16|65535&f}function m(A,g){return A<<g|A>>>32-g}t.exports=function(A){return u.hash(A,_,20,!0)}}).call(this,e("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},e("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/sha.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{"./helpers":4,buffer:3,lYpoI2:11}],9:[function(e,t,n){(function(o,r,i,s,a,c,l,h,d){function u(g,f){var y=(65535&g)+(65535&f);return(g>>16)+(f>>16)+(y>>16)<<16|65535&y}function _(g,f){var y,x=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],C=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],b=Array(64);g[f>>5]|=128<<24-f%32,g[15+(f+64>>9<<4)]=f;for(var I,v,P=0;P<g.length;P+=16){for(var M=C[0],B=C[1],T=C[2],N=C[3],D=C[4],L=C[5],H=C[6],V=C[7],O=0;O<64;O++)b[O]=O<16?g[O+P]:u(u(u((v=b[O-2],m(v,17)^m(v,19)^A(v,10)),b[O-7]),(v=b[O-15],m(v,7)^m(v,18)^A(v,3))),b[O-16]),y=u(u(u(u(V,m(v=D,6)^m(v,11)^m(v,25)),D&L^~D&H),x[O]),b[O]),I=u(m(I=M,2)^m(I,13)^m(I,22),M&B^M&T^B&T),V=H,H=L,L=D,D=u(N,y),N=T,T=B,B=M,M=u(y,I);C[0]=u(M,C[0]),C[1]=u(B,C[1]),C[2]=u(T,C[2]),C[3]=u(N,C[3]),C[4]=u(D,C[4]),C[5]=u(L,C[5]),C[6]=u(H,C[6]),C[7]=u(V,C[7])}return C}var p=e("./helpers"),m=function(g,f){return g>>>f|g<<32-f},A=function(g,f){return g>>>f};t.exports=function(g){return p.hash(g,_,32,!0)}}).call(this,e("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},e("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/sha256.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{"./helpers":4,buffer:3,lYpoI2:11}],10:[function(e,t,n){(function(o,r,i,s,a,c,l,h,d){n.read=function(u,_,p,m,P){var g,f,y=8*P-m-1,x=(1<<y)-1,C=x>>1,b=-7,I=p?P-1:0,v=p?-1:1,P=u[_+I];for(I+=v,g=P&(1<<-b)-1,P>>=-b,b+=y;0<b;g=256*g+u[_+I],I+=v,b-=8);for(f=g&(1<<-b)-1,g>>=-b,b+=m;0<b;f=256*f+u[_+I],I+=v,b-=8);if(g===0)g=1-C;else{if(g===x)return f?NaN:1/0*(P?-1:1);f+=Math.pow(2,m),g-=C}return(P?-1:1)*f*Math.pow(2,g-m)},n.write=function(u,_,p,m,A,M){var f,y,x=8*M-A-1,C=(1<<x)-1,b=C>>1,I=A===23?Math.pow(2,-24)-Math.pow(2,-77):0,v=m?0:M-1,P=m?1:-1,M=_<0||_===0&&1/_<0?1:0;for(_=Math.abs(_),isNaN(_)||_===1/0?(y=isNaN(_)?1:0,f=C):(f=Math.floor(Math.log(_)/Math.LN2),_*(m=Math.pow(2,-f))<1&&(f--,m*=2),2<=(_+=1<=f+b?I/m:I*Math.pow(2,1-b))*m&&(f++,m/=2),C<=f+b?(y=0,f=C):1<=f+b?(y=(_*m-1)*Math.pow(2,A),f+=b):(y=_*Math.pow(2,b-1)*Math.pow(2,A),f=0));8<=A;u[p+v]=255&y,v+=P,y/=256,A-=8);for(f=f<<A|y,x+=A;0<x;u[p+v]=255&f,v+=P,f/=256,x-=8);u[p+v-P]|=128*M}}).call(this,e("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},e("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/ieee754/index.js","/node_modules/gulp-browserify/node_modules/ieee754")},{buffer:3,lYpoI2:11}],11:[function(e,t,n){(function(o,r,i,s,a,c,l,h,d){var u,_,p;function m(){}(o=t.exports={}).nextTick=(_=typeof window<"u"&&window.setImmediate,p=typeof window<"u"&&window.postMessage&&window.addEventListener,_?function(A){return window.setImmediate(A)}:p?(u=[],window.addEventListener("message",function(A){var g=A.source;g!==window&&g!==null||A.data!=="process-tick"||(A.stopPropagation(),0<u.length&&u.shift()())},!0),function(A){u.push(A),window.postMessage("process-tick","*")}):function(A){setTimeout(A,0)}),o.title="browser",o.browser=!0,o.env={},o.argv=[],o.on=m,o.addListener=m,o.once=m,o.off=m,o.removeListener=m,o.removeAllListeners=m,o.emit=m,o.binding=function(A){throw Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(A){throw Error("process.chdir is not supported")}}).call(this,e("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},e("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/process/browser.js","/node_modules/gulp-browserify/node_modules/process")},{buffer:3,lYpoI2:11}]},{},[1])(1)})});var jmn=lt(function(GYs,Xmn){Xmn.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}});var $mn=lt(function(UYs,Kmn){Kmn.exports=function(t){if(!t||typeof t==="string")return!1;return t instanceof Array||Array.isArray(t)||t.length>=0&&(t.splice instanceof Function||Object.getOwnPropertyDescriptor(t,t.length-1)&&t.constructor.name!=="String")}});var itt=lt(function(WYs,Jmn){var tDr=$mn(),nDr=Array.prototype.concat,oDr=Array.prototype.slice,qmn=Jmn.exports=function(t){var n=[];for(var o=0,r=t.length;o<r;o++){var i=t[o];if(tDr(i))n=nDr.call(n,oDr.call(i));else n.push(i)}return n};qmn.wrap=function(e){return function(){return e(qmn(arguments))}}});var n_n=lt(function(XYs,t_n){var Ehe=jmn(),Mhe=itt(),Zmn=Object.hasOwnProperty,e_n=Object.create(null);for(Phe in Ehe)if(Zmn.call(Ehe,Phe))e_n[Ehe[Phe]]=Phe;var Phe,U4=t_n.exports={to:{},get:{}};U4.get=function(e){var t=e.substring(0,3).toLowerCase(),n,o;switch(t){case"hsl":n=U4.get.hsl(e),o="hsl";break;case"hwb":n=U4.get.hwb(e),o="hwb";break;default:n=U4.get.rgb(e),o="rgb";break}if(!n)return null;return{model:o,value:n}};U4.get.rgb=function(e){if(!e)return null;var t=/^#([a-f0-9]{3,4})$/i,n=/^#([a-f0-9]{6})([a-f0-9]{2})?$/i,o=/^rgba?\(\s*([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/,r=/^rgba?\(\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/,i=/^(\w+)$/,s=[0,0,0,1],a,c,l;if(a=e.match(n)){l=a[2],a=a[1];for(c=0;c<3;c++){var h=c*2;s[c]=parseInt(a.slice(h,h+2),16)}if(l)s[3]=parseInt(l,16)/255}else if(a=e.match(t)){a=a[1],l=a[3];for(c=0;c<3;c++)s[c]=parseInt(a[c]+a[c],16);if(l)s[3]=parseInt(l+l,16)/255}else if(a=e.match(o)){for(c=0;c<3;c++)s[c]=parseInt(a[c+1],0);if(a[4])if(a[5])s[3]=parseFloat(a[4])*0.01;else s[3]=parseFloat(a[4])}else if(a=e.match(r)){for(c=0;c<3;c++)s[c]=Math.round(parseFloat(a[c+1])*2.55);if(a[4])if(a[5])s[3]=parseFloat(a[4])*0.01;else s[3]=parseFloat(a[4])}else if(a=e.match(i)){if(a[1]==="transparent")return[0,0,0,0];if(!Zmn.call(Ehe,a[1]))return null;return s=Ehe[a[1]],s[3]=1,s}else return null;for(c=0;c<3;c++)s[c]=OQ(s[c],0,255);return s[3]=OQ(s[3],0,1),s};U4.get.hsl=function(e){if(!e)return null;var t=/^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d\.]+)%\s*,?\s*([+-]?[\d\.]+)%\s*(?:[,|\/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/,n=e.match(t);if(n){var o=parseFloat(n[4]),r=(parseFloat(n[1])%360+360)%360,i=OQ(parseFloat(n[2]),0,100),s=OQ(parseFloat(n[3]),0,100),a=OQ(isNaN(o)?1:o,0,1);return[r,i,s,a]}return null};U4.get.hwb=function(e){if(!e)return null;var t=/^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/,n=e.match(t);if(n){var o=parseFloat(n[4]),r=(parseFloat(n[1])%360+360)%360,i=OQ(parseFloat(n[2]),0,100),s=OQ(parseFloat(n[3]),0,100),a=OQ(isNaN(o)?1:o,0,1);return[r,i,s,a]}return null};U4.to.hex=function(){var e=Mhe(arguments);return"#"+c9e(e[0])+c9e(e[1])+c9e(e[2])+(e[3]<1?c9e(Math.round(e[3]*255)):"")};U4.to.rgb=function(){var e=Mhe(arguments);return e.length<4||e[3]===1?"rgb("+Math.round(e[0])+", "+Math.round(e[1])+", "+Math.round(e[2])+")":"rgba("+Math.round(e[0])+", "+Math.round(e[1])+", "+Math.round(e[2])+", "+e[3]+")"};U4.to.rgb.percent=function(){var e=Mhe(arguments),t=Math.round(e[0]/255*100),n=Math.round(e[1]/255*100),o=Math.round(e[2]/255*100);return e.length<4||e[3]===1?"rgb("+t+"%, "+n+"%, "+o+"%)":"rgba("+t+"%, "+n+"%, "+o+"%, "+e[3]+")"};U4.to.hsl=function(){var e=Mhe(arguments);return e.length<4||e[3]===1?"hsl("+e[0]+", "+e[1]+"%, "+e[2]+"%)":"hsla("+e[0]+", "+e[1]+"%, "+e[2]+"%, "+e[3]+")"};U4.to.hwb=function(){var e=Mhe(arguments),t="";if(e.length>=4&&e[3]!==1)t=", "+e[3];return"hwb("+e[0]+", "+e[1]+"%, "+e[2]+"%"+t+")"};U4.to.keyword=function(e){return e_n[e.slice(0,3)]};function OQ(e,t,n){return Math.min(Math.max(t,e),n)}function c9e(e){var t=Math.round(e).toString(16).toUpperCase();return t.length<2?"0"+t:t}});var r_n=lt(function(jYs,o_n){o_n.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}});var stt=lt(function(KYs,s_n){var whe=r_n(),i_n={};for(let e of Object.keys(whe))i_n[whe[e]]=e;var mi={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};s_n.exports=mi;for(let e of Object.keys(mi)){if(!("channels"in mi[e]))throw Error("missing channels property: "+e);if(!("labels"in mi[e]))throw Error("missing channel labels property: "+e);if(mi[e].labels.length!==mi[e].channels)throw Error("channel and label counts mismatch: "+e);let{channels:t,labels:n}=mi[e];delete mi[e].channels,delete mi[e].labels,Object.defineProperty(mi[e],"channels",{value:t}),Object.defineProperty(mi[e],"labels",{value:n})}mi.rgb.hsl=function(e){let t=e[0]/255,n=e[1]/255,o=e[2]/255,r=Math.min(t,n,o),i=Math.max(t,n,o),s=i-r,a,c;if(i===r)a=0;else if(t===i)a=(n-o)/s;else if(n===i)a=2+(o-t)/s;else if(o===i)a=4+(t-n)/s;if(a=Math.min(a*60,360),a<0)a+=360;let l=(r+i)/2;if(i===r)c=0;else if(l<=0.5)c=s/(i+r);else c=s/(2-i-r);return[a,c*100,l*100]};mi.rgb.hsv=function(e){let t,n,o,r,i,s=e[0]/255,a=e[1]/255,c=e[2]/255,l=Math.max(s,a,c),h=l-Math.min(s,a,c),d=function(u){return(l-u)/6/h+0.5};if(h===0)r=0,i=0;else{if(i=h/l,t=d(s),n=d(a),o=d(c),s===l)r=o-n;else if(a===l)r=0.3333333333333333+t-o;else if(c===l)r=0.6666666666666666+n-t;if(r<0)r+=1;else if(r>1)r-=1}return[r*360,i*100,l*100]};mi.rgb.hwb=function(e){let t=e[0],n=e[1],o=e[2],r=mi.rgb.hsl(e)[0],i=0.00392156862745098*Math.min(t,Math.min(n,o));return o=1-0.00392156862745098*Math.max(t,Math.max(n,o)),[r,i*100,o*100]};mi.rgb.cmyk=function(e){let t=e[0]/255,n=e[1]/255,o=e[2]/255,r=Math.min(1-t,1-n,1-o),i=(1-t-r)/(1-r)||0,s=(1-n-r)/(1-r)||0,a=(1-o-r)/(1-r)||0;return[i*100,s*100,a*100,r*100]};function rDr(e,t){return(e[0]-t[0])**2+(e[1]-t[1])**2+(e[2]-t[2])**2}mi.rgb.keyword=function(e){let t=i_n[e];if(t)return t;let n=1/0,o;for(let r of Object.keys(whe)){let i=whe[r],s=rDr(e,i);if(s<n)n=s,o=r}return o};mi.keyword.rgb=function(e){return whe[e]};mi.rgb.xyz=function(e){let t=e[0]/255,n=e[1]/255,o=e[2]/255;t=t>0.04045?((t+0.055)/1.055)**2.4:t/12.92,n=n>0.04045?((n+0.055)/1.055)**2.4:n/12.92,o=o>0.04045?((o+0.055)/1.055)**2.4:o/12.92;let r=t*0.4124+n*0.3576+o*0.1805,i=t*0.2126+n*0.7152+o*0.0722,s=t*0.0193+n*0.1192+o*0.9505;return[r*100,i*100,s*100]};mi.rgb.lab=function(e){let t=mi.rgb.xyz(e),n=t[0],o=t[1],r=t[2];n/=95.047,o/=100,r/=108.883,n=n>0.008856?n**0.3333333333333333:7.787*n+0.13793103448275862,o=o>0.008856?o**0.3333333333333333:7.787*o+0.13793103448275862,r=r>0.008856?r**0.3333333333333333:7.787*r+0.13793103448275862;let i=116*o-16,s=500*(n-o),a=200*(o-r);return[i,s,a]};mi.hsl.rgb=function(e){let t=e[0]/360,n=e[1]/100,o=e[2]/100,r,i,s;if(n===0)return s=o*255,[s,s,s];if(o<0.5)r=o*(1+n);else r=o+n-o*n;let a=2*o-r,c=[0,0,0];for(let l=0;l<3;l++){if(i=t+0.3333333333333333*-(l-1),i<0)i++;if(i>1)i--;if(6*i<1)s=a+(r-a)*6*i;else if(2*i<1)s=r;else if(3*i<2)s=a+(r-a)*(0.6666666666666666-i)*6;else s=a;c[l]=s*255}return c};mi.hsl.hsv=function(e){let t=e[0],n=e[1]/100,o=e[2]/100,r=n,i=Math.max(o,0.01);o*=2,n*=o<=1?o:2-o,r*=i<=1?i:2-i;let s=(o+n)/2,a=o===0?2*r/(i+r):2*n/(o+n);return[t,a*100,s*100]};mi.hsv.rgb=function(e){let t=e[0]/60,n=e[1]/100,o=e[2]/100,r=Math.floor(t)%6,i=t-Math.floor(t),s=255*o*(1-n),a=255*o*(1-n*i),c=255*o*(1-n*(1-i));switch(o*=255,r){case 0:return[o,c,s];case 1:return[a,o,s];case 2:return[s,o,c];case 3:return[s,a,o];case 4:return[c,s,o];case 5:return[o,s,a]}};mi.hsv.hsl=function(e){let t=e[0],n=e[1]/100,o=e[2]/100,r=Math.max(o,0.01),i,s;s=(2-n)*o;let a=(2-n)*r;return i=n*r,i/=a<=1?a:2-a,i=i||0,s/=2,[t,i*100,s*100]};mi.hwb.rgb=function(e){let t=e[0]/360,n=e[1]/100,o=e[2]/100,r=n+o,i;if(r>1)n/=r,o/=r;let s=Math.floor(6*t),a=1-o;if(i=6*t-s,(s&1)!==0)i=1-i;let c=n+i*(a-n),l,h,d;switch(s){default:case 6:case 0:l=a,h=c,d=n;break;case 1:l=c,h=a,d=n;break;case 2:l=n,h=a,d=c;break;case 3:l=n,h=c,d=a;break;case 4:l=c,h=n,d=a;break;case 5:l=a,h=n,d=c;break}return[l*255,h*255,d*255]};mi.cmyk.rgb=function(e){let t=e[0]/100,n=e[1]/100,o=e[2]/100,r=e[3]/100,i=1-Math.min(1,t*(1-r)+r),s=1-Math.min(1,n*(1-r)+r),a=1-Math.min(1,o*(1-r)+r);return[i*255,s*255,a*255]};mi.xyz.rgb=function(e){let t=e[0]/100,n=e[1]/100,o=e[2]/100,r,i,s;return r=t*3.2406+n*-1.5372+o*-0.4986,i=t*-0.9689+n*1.8758+o*0.0415,s=t*0.0557+n*-0.204+o*1.057,r=r>0.0031308?1.055*r**0.4166666666666667-0.055:r*12.92,i=i>0.0031308?1.055*i**0.4166666666666667-0.055:i*12.92,s=s>0.0031308?1.055*s**0.4166666666666667-0.055:s*12.92,r=Math.min(Math.max(0,r),1),i=Math.min(Math.max(0,i),1),s=Math.min(Math.max(0,s),1),[r*255,i*255,s*255]};mi.xyz.lab=function(e){let t=e[0],n=e[1],o=e[2];t/=95.047,n/=100,o/=108.883,t=t>0.008856?t**0.3333333333333333:7.787*t+0.13793103448275862,n=n>0.008856?n**0.3333333333333333:7.787*n+0.13793103448275862,o=o>0.008856?o**0.3333333333333333:7.787*o+0.13793103448275862;let r=116*n-16,i=500*(t-n),s=200*(n-o);return[r,i,s]};mi.lab.xyz=function(e){let t=e[0],n=e[1],o=e[2],r,i,s;i=(t+16)/116,r=n/500+i,s=i-o/200;let a=i**3,c=r**3,l=s**3;return i=a>0.008856?a:(i-0.13793103448275862)/7.787,r=c>0.008856?c:(r-0.13793103448275862)/7.787,s=l>0.008856?l:(s-0.13793103448275862)/7.787,r*=95.047,i*=100,s*=108.883,[r,i,s]};mi.lab.lch=function(e){let t=e[0],n=e[1],o=e[2],r;if(r=Math.atan2(o,n)*360/2/Math.PI,r<0)r+=360;let s=Math.sqrt(n*n+o*o);return[t,s,r]};mi.lch.lab=function(e){let t=e[0],n=e[1],r=e[2]/360*2*Math.PI,i=n*Math.cos(r),s=n*Math.sin(r);return[t,i,s]};mi.rgb.ansi16=function(e,t=null){let[n,o,r]=e,i=t===null?mi.rgb.hsv(e)[2]:t;if(i=Math.round(i/50),i===0)return 30;let s=30+(Math.round(r/255)<<2|Math.round(o/255)<<1|Math.round(n/255));if(i===2)s+=60;return s};mi.hsv.ansi16=function(e){return mi.rgb.ansi16(mi.hsv.rgb(e),e[2])};mi.rgb.ansi256=function(e){let t=e[0],n=e[1],o=e[2];if(t===n&&n===o){if(t<8)return 16;if(t>248)return 231;return Math.round((t-8)/247*24)+232}return 16+36*Math.round(t/255*5)+6*Math.round(n/255*5)+Math.round(o/255*5)};mi.ansi16.rgb=function(e){let t=e%10;if(t===0||t===7){if(e>50)t+=3.5;return t=t/10.5*255,[t,t,t]}let n=(~~(e>50)+1)*0.5,o=(t&1)*n*255,r=(t>>1&1)*n*255,i=(t>>2&1)*n*255;return[o,r,i]};mi.ansi256.rgb=function(e){if(e>=232){let i=(e-232)*10+8;return[i,i,i]}e-=16;let t,n=Math.floor(e/36)/5*255,o=Math.floor((t=e%36)/6)/5*255,r=t%6/5*255;return[n,o,r]};mi.rgb.hex=function(e){let n=(((Math.round(e[0])&255)<<16)+((Math.round(e[1])&255)<<8)+(Math.round(e[2])&255)).toString(16).toUpperCase();return"000000".substring(n.length)+n};mi.hex.rgb=function(e){let t=e.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!t)return[0,0,0];let n=t[0];if(t[0].length===3)n=n.split("").map((a)=>a+a).join("");let o=parseInt(n,16),r=o>>16&255,i=o>>8&255,s=o&255;return[r,i,s]};mi.rgb.hcg=function(e){let t=e[0]/255,n=e[1]/255,o=e[2]/255,r=Math.max(Math.max(t,n),o),i=Math.min(Math.min(t,n),o),s=r-i,a,c;if(s<1)a=i/(1-s);else a=0;if(s<=0)c=0;else if(r===t)c=(n-o)/s%6;else if(r===n)c=2+(o-t)/s;else c=4+(t-n)/s;return c/=6,c%=1,[c*360,s*100,a*100]};mi.hsl.hcg=function(e){let t=e[1]/100,n=e[2]/100,o=n<0.5?2*t*n:2*t*(1-n),r=0;if(o<1)r=(n-0.5*o)/(1-o);return[e[0],o*100,r*100]};mi.hsv.hcg=function(e){let t=e[1]/100,n=e[2]/100,o=t*n,r=0;if(o<1)r=(n-o)/(1-o);return[e[0],o*100,r*100]};mi.hcg.rgb=function(e){let t=e[0]/360,n=e[1]/100,o=e[2]/100;if(n===0)return[o*255,o*255,o*255];let r=[0,0,0],i=t%1*6,s=i%1,a=1-s,c=0;switch(Math.floor(i)){case 0:r[0]=1,r[1]=s,r[2]=0;break;case 1:r[0]=a,r[1]=1,r[2]=0;break;case 2:r[0]=0,r[1]=1,r[2]=s;break;case 3:r[0]=0,r[1]=a,r[2]=1;break;case 4:r[0]=s,r[1]=0,r[2]=1;break;default:r[0]=1,r[1]=0,r[2]=a}return c=(1-n)*o,[(n*r[0]+c)*255,(n*r[1]+c)*255,(n*r[2]+c)*255]};mi.hcg.hsv=function(e){let t=e[1]/100,n=e[2]/100,o=t+n*(1-t),r=0;if(o>0)r=t/o;return[e[0],r*100,o*100]};mi.hcg.hsl=function(e){let t=e[1]/100,o=e[2]/100*(1-t)+0.5*t,r=0;if(o>0&&o<0.5)r=t/(2*o);else if(o>=0.5&&o<1)r=t/(2*(1-o));return[e[0],r*100,o*100]};mi.hcg.hwb=function(e){let t=e[1]/100,n=e[2]/100,o=t+n*(1-t);return[e[0],(o-t)*100,(1-o)*100]};mi.hwb.hcg=function(e){let t=e[1]/100,o=1-e[2]/100,r=o-t,i=0;if(r<1)i=(o-r)/(1-r);return[e[0],r*100,i*100]};mi.apple.rgb=function(e){return[e[0]/65535*255,e[1]/65535*255,e[2]/65535*255]};mi.rgb.apple=function(e){return[e[0]/255*65535,e[1]/255*65535,e[2]/255*65535]};mi.gray.rgb=function(e){return[e[0]/100*255,e[0]/100*255,e[0]/100*255]};mi.gray.hsl=function(e){return[0,0,e[0]]};mi.gray.hsv=mi.gray.hsl;mi.gray.hwb=function(e){return[0,100,e[0]]};mi.gray.cmyk=function(e){return[0,0,0,e[0]]};mi.gray.lab=function(e){return[e[0],0,0]};mi.gray.hex=function(e){let t=Math.round(e[0]/100*255)&255,o=((t<<16)+(t<<8)+t).toString(16).toUpperCase();return"000000".substring(o.length)+o};mi.rgb.gray=function(e){return[(e[0]+e[1]+e[2])/3/255*100]}});var c_n=lt(function($Ys,a_n){var l9e=stt();function iDr(){let e={},t=Object.keys(l9e);for(let n=t.length,o=0;o<n;o++)e[t[o]]={distance:-1,parent:null};return e}function sDr(e){let t=iDr(),n=[e];t[e].distance=0;while(n.length){let o=n.pop(),r=Object.keys(l9e[o]);for(let i=r.length,s=0;s<i;s++){let a=r[s],c=t[a];if(c.distance===-1)c.distance=t[o].distance+1,c.parent=o,n.unshift(a)}}return t}function aDr(e,t){return function(n){return t(e(n))}}function cDr(e,t){let n=[t[e].parent,e],o=l9e[t[e].parent][e],r=t[e].parent;while(t[r].parent)n.unshift(t[r].parent),o=aDr(l9e[t[r].parent][r],o),r=t[r].parent;return o.conversion=n,o}a_n.exports=function(e){let t=sDr(e),n={},o=Object.keys(t);for(let r=o.length,i=0;i<r;i++){let s=o[i];if(t[s].parent===null)continue;n[s]=cDr(s,t)}return n}});var h_n=lt(function(qYs,l_n){var att=stt(),lDr=c_n(),lJ={},hDr=Object.keys(att);function dDr(e){let t=function(...n){let o=n[0];if(o===void 0||o===null)return o;if(o.length>1)n=o;return e(n)};if("conversion"in e)t.conversion=e.conversion;return t}function uDr(e){let t=function(...n){let o=n[0];if(o===void 0||o===null)return o;if(o.length>1)n=o;let r=e(n);if(typeof r==="object")for(let i=r.length,s=0;s<i;s++)r[s]=Math.round(r[s]);return r};if("conversion"in e)t.conversion=e.conversion;return t}hDr.forEach((e)=>{lJ[e]={},Object.defineProperty(lJ[e],"channels",{value:att[e].channels}),Object.defineProperty(lJ[e],"labels",{value:att[e].labels});let t=lDr(e);Object.keys(t).forEach((o)=>{let r=t[o];lJ[e][o]=uDr(r),lJ[e][o].raw=dDr(r)})});l_n.exports=lJ});var p_n=lt(function(JYs,u_n){var hJ=n_n(),W4=h_n(),d_n=["keyword","gray","hex"],ctt={};for(let e of Object.keys(W4))ctt[[...W4[e].labels].sort().join("")]=e;var h9e={};function bA(e,t){if(!(this instanceof bA))return new bA(e,t);if(t&&t in d_n)t=null;if(t&&!(t in W4))throw Error("Unknown model: "+t);let n,o;if(e==null)this.model="rgb",this.color=[0,0,0],this.valpha=1;else if(e instanceof bA)this.model=e.model,this.color=[...e.color],this.valpha=e.valpha;else if(typeof e==="string"){let r=hJ.get(e);if(r===null)throw Error("Unable to parse color from string: "+e);this.model=r.model,o=W4[this.model].channels,this.color=r.value.slice(0,o),this.valpha=typeof r.value[o]==="number"?r.value[o]:1}else if(e.length>0){this.model=t||"rgb",o=W4[this.model].channels;let r=Array.prototype.slice.call(e,0,o);this.color=ltt(r,o),this.valpha=typeof e[o]==="number"?e[o]:1}else if(typeof e==="number")this.model="rgb",this.color=[e>>16&255,e>>8&255,e&255],this.valpha=1;else{this.valpha=1;let r=Object.keys(e);if("alpha"in e)r.splice(r.indexOf("alpha"),1),this.valpha=typeof e.alpha==="number"?e.alpha:0;let i=r.sort().join("");if(!(i in ctt))throw Error("Unable to parse color from object: "+JSON.stringify(e));this.model=ctt[i];let{labels:s}=W4[this.model],a=[];for(n=0;n<s.length;n++)a.push(e[s[n]]);this.color=ltt(a)}if(h9e[this.model]){o=W4[this.model].channels;for(n=0;n<o;n++){let r=h9e[this.model][n];if(r)this.color[n]=r(this.color[n])}}if(this.valpha=Math.max(0,Math.min(1,this.valpha)),Object.freeze)Object.freeze(this)}bA.prototype={toString(){return this.string()},toJSON(){return this[this.model]()},string(e){let t=this.model in hJ.to?this:this.rgb();t=t.round(typeof e==="number"?e:1);let n=t.valpha===1?t.color:[...t.color,this.valpha];return hJ.to[t.model](n)},percentString(e){let t=this.rgb().round(typeof e==="number"?e:1),n=t.valpha===1?t.color:[...t.color,this.valpha];return hJ.to.rgb.percent(n)},array(){return this.valpha===1?[...this.color]:[...this.color,this.valpha]},object(){let e={},{channels:t}=W4[this.model],{labels:n}=W4[this.model];for(let o=0;o<t;o++)e[n[o]]=this.color[o];if(this.valpha!==1)e.alpha=this.valpha;return e},unitArray(){let e=this.rgb().color;if(e[0]/=255,e[1]/=255,e[2]/=255,this.valpha!==1)e.push(this.valpha);return e},unitObject(){let e=this.rgb().object();if(e.r/=255,e.g/=255,e.b/=255,this.valpha!==1)e.alpha=this.valpha;return e},round(e){return e=Math.max(e||0,0),new bA([...this.color.map(mDr(e)),this.valpha],this.model)},alpha(e){if(e!==void 0)return new bA([...this.color,Math.max(0,Math.min(1,e))],this.model);return this.valpha},red:Bp("rgb",0,ug(255)),green:Bp("rgb",1,ug(255)),blue:Bp("rgb",2,ug(255)),hue:Bp(["hsl","hsv","hsl","hwb","hcg"],0,(e)=>(e%360+360)%360),saturationl:Bp("hsl",1,ug(100)),lightness:Bp("hsl",2,ug(100)),saturationv:Bp("hsv",1,ug(100)),value:Bp("hsv",2,ug(100)),chroma:Bp("hcg",1,ug(100)),gray:Bp("hcg",2,ug(100)),white:Bp("hwb",1,ug(100)),wblack:Bp("hwb",2,ug(100)),cyan:Bp("cmyk",0,ug(100)),magenta:Bp("cmyk",1,ug(100)),yellow:Bp("cmyk",2,ug(100)),black:Bp("cmyk",3,ug(100)),x:Bp("xyz",0,ug(95.047)),y:Bp("xyz",1,ug(100)),z:Bp("xyz",2,ug(108.833)),l:Bp("lab",0,ug(100)),a:Bp("lab",1),b:Bp("lab",2),keyword(e){if(e!==void 0)return new bA(e);return W4[this.model].keyword(this.color)},hex(e){if(e!==void 0)return new bA(e);return hJ.to.hex(this.rgb().round().color)},hexa(e){if(e!==void 0)return new bA(e);let t=this.rgb().round().color,n=Math.round(this.valpha*255).toString(16).toUpperCase();if(n.length===1)n="0"+n;return hJ.to.hex(t)+n},rgbNumber(){let e=this.rgb().color;return(e[0]&255)<<16|(e[1]&255)<<8|e[2]&255},luminosity(){let e=this.rgb().color,t=[];for(let[n,o]of e.entries()){let r=o/255;t[n]=r<=0.04045?r/12.92:((r+0.055)/1.055)**2.4}return 0.2126*t[0]+0.7152*t[1]+0.0722*t[2]},contrast(e){let t=this.luminosity(),n=e.luminosity();if(t>n)return(t+0.05)/(n+0.05);return(n+0.05)/(t+0.05)},level(e){let t=this.contrast(e);if(t>=7)return"AAA";return t>=4.5?"AA":""},isDark(){let e=this.rgb().color;return(e[0]*2126+e[1]*7152+e[2]*722)/1e4<128},isLight(){return!this.isDark()},negate(){let e=this.rgb();for(let t=0;t<3;t++)e.color[t]=255-e.color[t];return e},lighten(e){let t=this.hsl();return t.color[2]+=t.color[2]*e,t},darken(e){let t=this.hsl();return t.color[2]-=t.color[2]*e,t},saturate(e){let t=this.hsl();return t.color[1]+=t.color[1]*e,t},desaturate(e){let t=this.hsl();return t.color[1]-=t.color[1]*e,t},whiten(e){let t=this.hwb();return t.color[1]+=t.color[1]*e,t},blacken(e){let t=this.hwb();return t.color[2]+=t.color[2]*e,t},grayscale(){let e=this.rgb().color,t=e[0]*0.3+e[1]*0.59+e[2]*0.11;return bA.rgb(t,t,t)},fade(e){return this.alpha(this.valpha-this.valpha*e)},opaquer(e){return this.alpha(this.valpha+this.valpha*e)},rotate(e){let t=this.hsl(),n=t.color[0];return n=(n+e)%360,n=n<0?360+n:n,t.color[0]=n,t},mix(e,t){if(!e||!e.rgb)throw Error('Argument to "mix" was not a Color instance, but rather an instance of '+typeof e);let n=e.rgb(),o=this.rgb(),r=t===void 0?0.5:t,i=2*r-1,s=n.alpha()-o.alpha(),a=((i*s===-1?i:(i+s)/(1+i*s))+1)/2,c=1-a;return bA.rgb(a*n.red()+c*o.red(),a*n.green()+c*o.green(),a*n.blue()+c*o.blue(),n.alpha()*r+o.alpha()*(1-r))}};for(let e of Object.keys(W4)){if(d_n.includes(e))continue;let{channels:t}=W4[e];bA.prototype[e]=function(...n){if(this.model===e)return new bA(this);if(n.length>0)return new bA(n,e);return new bA([..._Dr(W4[this.model][e].raw(this.color)),this.valpha],e)},bA[e]=function(...n){let o=n[0];if(typeof o==="number")o=ltt(n,t);return new bA(o,e)}}function pDr(e,t){return Number(e.toFixed(t))}function mDr(e){return function(t){return pDr(t,e)}}function Bp(e,t,n){e=Array.isArray(e)?e:[e];for(let o of e)(h9e[o]||(h9e[o]=[]))[t]=n;return e=e[0],function(o){let r;if(o!==void 0){if(n)o=n(o);return r=this[e](),r.color[t]=o,r}if(r=this[e]().color[t],n)r=n(r);return r}}function ug(e){return function(t){return Math.max(0,Math.min(e,t))}}function _Dr(e){return Array.isArray(e)?e:[e]}function ltt(e,t){for(let n=0;n<t;n++)if(typeof e[n]!=="number")e[n]=0;return e}u_n.exports=bA});var g_n=lt(function(ZYs,__n){var{defineProperty:dtt,getOwnPropertyDescriptor:gDr,getOwnPropertyNames:ADr}=Object,fDr=Object.prototype.hasOwnProperty,yDr=(e,t)=>{for(var n in t)dtt(e,n,{get:t[n],enumerable:!0})},xDr=(e,t,n,o)=>{if(t&&typeof t==="object"||typeof t==="function"){for(let r of ADr(t))if(!fDr.call(e,r)&&r!==n)dtt(e,r,{get:()=>t[r],enumerable:!(o=gDr(t,r))||o.enumerable})}return e},CDr=(e)=>xDr(dtt({},"__esModule",{value:!0}),e),m_n={};yDr(m_n,{executeJscadOperations:()=>htt,jscadPlanner:()=>bDr});__n.exports=CDr(m_n);var bDr={booleans:{intersect:(...e)=>({type:"intersect",shapes:e}),subtract:(...e)=>({type:"subtract",shapes:e}),union:(...e)=>({type:"union",shapes:e})},hulls:{hull:(...e)=>({type:"hull",shapes:e.flat()}),hullChain:(...e)=>({type:"hullChain",shapes:e.flat()})},colors:{colorize:(e,t)=>({type:"colorize",color:e,shape:t})},primitives:{cube:(e)=>({type:"cube",...e}),sphere:(e)=>({type:"sphere",...e}),cylinder:(e)=>({type:"cylinder",...e}),polygon:(e)=>({type:"polygon",...e}),cuboid:(e)=>({type:"cuboid",...e}),roundedCuboid:(e)=>({type:"roundedCuboid",...e})},transforms:{rotate:(e,t)=>({type:"rotate",angles:e,shape:t}),rotateX:(e,t)=>({type:"rotateX",angle:e,shape:t}),rotateY:(e,t)=>({type:"rotateY",angle:e,shape:t}),rotateZ:(e,t)=>({type:"rotateZ",angle:e,shape:t}),scale:(e,t)=>({type:"scale",factors:e,shape:t}),translate:(e,t)=>({type:"translate",vector:e,shape:t})},extrusions:{extrudeLinear:(e,t)=>({type:"extrudeLinear",options:e,shape:t}),extrudeRotate:(e,t)=>({type:"extrudeRotate",options:e,shape:t})},maths:{vec2:{create:(e,t)=>[e,t],fromValues:(e,t)=>[e,t]},vec3:{create:(e,t,n)=>[e,t,n],fromValues:(e,t,n)=>[e,t,n]}},geometries:{geom2:{create:(e)=>({type:"createGeom2",points:e}),fromPoints:(e)=>({type:"fromPointsGeom2",points:e})},geom3:{create:(e)=>({type:"createGeom3",polygons:e})},path2:{create:(e)=>({type:"createPath2",points:e})}},measurements:{measureBoundingBox:(e)=>({type:"measureBoundingBox",shape:e}),measureArea:(e)=>({type:"measureArea",shape:e}),measureVolume:(e)=>({type:"measureVolume",shape:e})},utils:{degToRad:(e)=>e*Math.PI/180,radToDeg:(e)=>e*180/Math.PI}},htt=(e,t)=>{if(Array.isArray(t)&&t.length===1)return htt(e,t[0]);if(Array.isArray(t))throw Error("executeJscadOperations currently doesn't support Array<JscadOperation>, try adding a root union or or executing each element individually");let n=(i)=>htt(e,i),{type:o,...r}=t;switch(o){case"intersect":return e.booleans.intersect(...t.shapes.map(n));case"subtract":return e.booleans.subtract(...t.shapes.map(n));case"union":return e.booleans.union(...t.shapes.map(n));case"hull":return e.hulls.hull(...t.shapes.map(n));case"hullChain":return e.hulls.hullChain(...t.shapes.map(n));case"colorize":return e.colors.colorize(t.color,n(t.shape));case"cube":return e.primitives.cube(r);case"sphere":return e.primitives.sphere(r);case"cylinder":return e.primitives.cylinder(r);case"polygon":return e.primitives.polygon(r);case"cuboid":return e.primitives.cuboid(r);case"roundedCuboid":return e.primitives.roundedCuboid(r);case"rotate":return e.transforms.rotate(t.angles,n(t.shape));case"rotateX":return e.transforms.rotateX(t.angle,n(t.shape));case"rotateY":return e.transforms.rotateY(t.angle,n(t.shape));case"rotateZ":return e.transforms.rotateZ(t.angle,n(t.shape));case"scale":return e.transforms.scale(t.factors,n(t.shape));case"translate":return e.transforms.translate(t.vector,n(t.shape));case"extrudeLinear":return e.extrusions.extrudeLinear(t.options,n(t.shape));case"extrudeRotate":return e.extrusions.extrudeRotate(t.options,n(t.shape));case"createGeom2":return e.geometries.geom2.create(t.points);case"fromPointsGeom2":return e.geometries.geom2.fromPoints(t.points);case"createGeom3":return e.geometries.geom3.create(t.polygons);case"createPath2":return e.geometries.path2.create(t.points);case"measureBoundingBox":return e.measurements.measureBoundingBox(n(t.shape));case"measureArea":return e.measurements.measureArea(n(t.shape));case"measureVolume":return e.measurements.measureVolume(n(t.shape));case"degToRad":return e.utils.degToRad(t.degrees);case"radToDeg":return e.utils.radToDeg(t.radians);default:if(t.type===void 0)throw Error(`Operation type is undefined. This usually means the operation object is malformed or not properly initialized. Operation: ${JSON.stringify(t,null,2).slice(0,200)}...`);throw Error(`Unsupported operation type: ${t.type}. Operation: ${JSON.stringify(t,null,2)}`)}}});var ms=lt(function(Qoa,uPn){var h0i=(e)=>e.flat(1/0);uPn.exports=h0i});var mPn=lt(function(koa,pPn){var d0i=(e)=>Object.assign({},e);pPn.exports=d0i});var gPn=lt(function(Loa,_Pn){var u0i=(e,t,n)=>(e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e[4]=t[4]+n[4],e[5]=t[5]+n[5],e[6]=t[6]+n[6],e[7]=t[7]+n[7],e[8]=t[8]+n[8],e[9]=t[9]+n[9],e[10]=t[10]+n[10],e[11]=t[11]+n[11],e[12]=t[12]+n[12],e[13]=t[13]+n[13],e[14]=t[14]+n[14],e[15]=t[15]+n[15],e);_Pn.exports=u0i});var j7e=lt(function(Hoa,APn){var p0i=()=>[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];APn.exports=p0i});var yPn=lt(function(Foa,fPn){var m0i=j7e(),_0i=(e)=>{let t=m0i();return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t};fPn.exports=_0i});var zat=lt(function(zoa,xPn){var g0i=(e,t)=>(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e);xPn.exports=g0i});var bPn=lt(function(Ooa,CPn){var A0i=(e,t)=>{let n=t[0],o=t[1],r=t[2],i=t[3],s=t[4],a=t[5],c=t[6],l=t[7],h=t[8],d=t[9],u=t[10],_=t[11],p=t[12],m=t[13],A=t[14],g=t[15],f=n*a-o*s,y=n*c-r*s,x=n*l-i*s,C=o*c-r*a,b=o*l-i*a,I=r*l-i*c,v=h*m-d*p,P=h*A-u*p,M=h*g-_*p,B=d*A-u*m,T=d*g-_*m,N=u*g-_*A,D=f*N-y*T+x*B+C*M-b*P+I*v;if(!D)return null;return D=1/D,e[0]=(a*N-c*T+l*B)*D,e[1]=(r*T-o*N-i*B)*D,e[2]=(m*I-A*b+g*C)*D,e[3]=(u*b-d*I-_*C)*D,e[4]=(c*M-s*N-l*P)*D,e[5]=(n*N-r*M+i*P)*D,e[6]=(A*x-p*I-g*y)*D,e[7]=(h*I-u*x+_*y)*D,e[8]=(s*T-a*M+l*v)*D,e[9]=(o*M-n*T-i*v)*D,e[10]=(p*b-m*x+g*f)*D,e[11]=(d*x-h*b-_*f)*D,e[12]=(a*P-s*B-c*v)*D,e[13]=(n*B-o*P+r*v)*D,e[14]=(m*y-p*C-A*f)*D,e[15]=(h*C-d*y+u*f)*D,e};CPn.exports=A0i});var vPn=lt(function(Voa,IPn){var f0i=(e,t)=>e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[11]===t[11]&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[15]===t[15];IPn.exports=f0i});var rc=lt(function(Yoa,SPn){var y0i=Math.PI*2;SPn.exports={EPS:0.00001,NEPS:0.0000000000001,TAU:y0i,spatialResolution:1e5}});var BA=lt(function(Goa,EPn){var{NEPS:x0i}=rc(),PPn=(e)=>Math.abs(e)<x0i?0:e,C0i=(e)=>PPn(Math.sin(e)),b0i=(e)=>PPn(Math.cos(e));EPn.exports={sin:C0i,cos:b0i}});var Oat=lt(function(Uoa,MPn){var I0i=(e)=>(e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e);MPn.exports=I0i});var Vat=lt(function(Woa,wPn){var{EPS:v0i}=rc(),{sin:S0i,cos:P0i}=BA(),E0i=Oat(),M0i=(e,t,n)=>{let[o,r,i]=n,s=o*o+r*r+i*i;if(Math.abs(s)<v0i)return E0i(e);let a=1/Math.sqrt(s);o*=a,r*=a,i*=a;let c=S0i(t),l=P0i(t),h=1-l;return e[0]=o*o*h+l,e[1]=r*o*h+i*c,e[2]=i*o*h-r*c,e[3]=0,e[4]=o*r*h-i*c,e[5]=r*r*h+l,e[6]=i*r*h+o*c,e[7]=0,e[8]=o*i*h+r*c,e[9]=r*i*h-o*c,e[10]=i*i*h+l,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e};wPn.exports=M0i});var TPn=lt(function(Xoa,BPn){var w0i=(e,t)=>(e[0]=t[0],e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=t[1],e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=t[2],e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e);BPn.exports=w0i});var NPn=lt(function(joa,DPn){var{sin:Yat,cos:Gat}=BA(),B0i=(e,t,n,o)=>{let r=Yat(t),i=Gat(t),s=Yat(n),a=Gat(n),c=Yat(o),l=Gat(o);return e[0]=a*i,e[1]=a*r,e[2]=-s,e[3]=0,e[4]=c*s*i-l*r,e[5]=l*i+c*s*r,e[6]=c*a,e[7]=0,e[8]=c*r+l*s*i,e[9]=l*s*r-c*i,e[10]=l*a,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e};DPn.exports=B0i});var QPn=lt(function(Koa,RPn){var T0i=(e,t)=>(e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=t[0],e[13]=t[1],e[14]=t[2],e[15]=1,e);RPn.exports=T0i});var LPn=lt(function($oa,kPn){var D0i=j7e(),N0i=(e,t,n,o,r,i,s,a,c,l,h,d,u,_,p,m)=>{let A=D0i();return A[0]=e,A[1]=t,A[2]=n,A[3]=o,A[4]=r,A[5]=i,A[6]=s,A[7]=a,A[8]=c,A[9]=l,A[10]=h,A[11]=d,A[12]=u,A[13]=_,A[14]=p,A[15]=m,A};kPn.exports=N0i});var Uat=lt(function(qoa,HPn){var R0i=(e,t)=>(e[0]=Math.abs(t[0]),e[1]=Math.abs(t[1]),e[2]=Math.abs(t[2]),e);HPn.exports=R0i});var Wat=lt(function(Joa,FPn){var Q0i=(e,t,n)=>(e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e);FPn.exports=Q0i});var Xue=lt(function(Zoa,zPn){var k0i=(e,t)=>e[0]*t[0]+e[1]*t[1]+e[2]*t[2];zPn.exports=k0i});var VPn=lt(function(era,OPn){var L0i=Xue(),H0i=(e,t)=>{let n=e[0],o=e[1],r=e[2],i=t[0],s=t[1],a=t[2],c=Math.sqrt(n*n+o*o+r*r),l=Math.sqrt(i*i+s*s+a*a),h=c*l,d=h&&L0i(e,t)/h;return Math.acos(Math.min(Math.max(d,-1),1))};OPn.exports=H0i});var jue=lt(function(tra,YPn){var F0i=()=>[0,0,0];YPn.exports=F0i});var UPn=lt(function(nra,GPn){var z0i=jue(),O0i=(e)=>{let t=z0i();return t[0]=e[0],t[1]=e[1],t[2]=e[2],t};GPn.exports=O0i});var Xat=lt(function(ora,WPn){var V0i=(e,t)=>(e[0]=t[0],e[1]=t[1],e[2]=t[2],e);WPn.exports=V0i});var FZ=lt(function(rra,XPn){var Y0i=(e,t,n)=>{let o=t[0],r=t[1],i=t[2],s=n[0],a=n[1],c=n[2];return e[0]=r*c-i*a,e[1]=i*s-o*c,e[2]=o*a-r*s,e};XPn.exports=Y0i});var jat=lt(function(ira,jPn){var G0i=(e,t)=>{let n=t[0]-e[0],o=t[1]-e[1],r=t[2]-e[2];return Math.sqrt(n*n+o*o+r*r)};jPn.exports=G0i});var $Pn=lt(function(sra,KPn){var U0i=(e,t,n)=>(e[0]=t[0]/n[0],e[1]=t[1]/n[1],e[2]=t[2]/n[2],e);KPn.exports=U0i});var JPn=lt(function(ara,qPn){var W0i=(e,t)=>e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2];qPn.exports=W0i});var eEn=lt(function(cra,ZPn){var X0i=(e,t)=>(e[0]=t,e[1]=t,e[2]=t,e);ZPn.exports=X0i});var nEn=lt(function(lra,tEn){var j0i=jue(),K0i=(e,t,n)=>{let o=j0i();return o[0]=e,o[1]=t,o[2]=n,o};tEn.exports=K0i});var rEn=lt(function(hra,oEn){var $0i=(e,t,n=0)=>(e[0]=t[0],e[1]=t[1],e[2]=n,e);oEn.exports=$0i});var Kat=lt(function(dra,iEn){var q0i=(e)=>{let t=e[0],n=e[1],o=e[2];return Math.sqrt(t*t+n*n+o*o)};iEn.exports=q0i});var aEn=lt(function(ura,sEn){var J0i=(e,t,n,o)=>(e[0]=t[0]+o*(n[0]-t[0]),e[1]=t[1]+o*(n[1]-t[1]),e[2]=t[2]+o*(n[2]-t[2]),e);sEn.exports=J0i});var $at=lt(function(pra,cEn){var Z0i=(e,t,n)=>(e[0]=Math.max(t[0],n[0]),e[1]=Math.max(t[1],n[1]),e[2]=Math.max(t[2],n[2]),e);cEn.exports=Z0i});var qat=lt(function(mra,lEn){var epi=(e,t,n)=>(e[0]=Math.min(t[0],n[0]),e[1]=Math.min(t[1],n[1]),e[2]=Math.min(t[2],n[2]),e);lEn.exports=epi});var dEn=lt(function(_ra,hEn){var tpi=(e,t,n)=>(e[0]=t[0]*n[0],e[1]=t[1]*n[1],e[2]=t[2]*n[2],e);hEn.exports=tpi});var pEn=lt(function(gra,uEn){var npi=(e,t)=>(e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e);uEn.exports=npi});var K7e=lt(function(Ara,mEn){var opi=(e,t)=>{let n=t[0],o=t[1],r=t[2],i=n*n+o*o+r*r;if(i>0)i=1/Math.sqrt(i);return e[0]=n*i,e[1]=o*i,e[2]=r*i,e};mEn.exports=opi});var gEn=lt(function(fra,_En){var rpi=Uat(),ipi=jue(),spi=FZ(),api=(e,t)=>{let n=rpi(ipi(),t),o=0+(n[0]<n[1]&&n[0]<n[2]),r=0+(n[1]<=n[0]&&n[1]<n[2]),i=0+(n[2]<=n[0]&&n[2]<=n[1]);return spi(e,t,[o,r,i])};_En.exports=api});var fEn=lt(function(yra,AEn){var cpi=(e,t,n,o)=>{let r=[],i=[];return r[0]=t[0]-n[0],r[1]=t[1]-n[1],r[2]=t[2]-n[2],i[0]=r[0],i[1]=r[1]*Math.cos(o)-r[2]*Math.sin(o),i[2]=r[1]*Math.sin(o)+r[2]*Math.cos(o),e[0]=i[0]+n[0],e[1]=i[1]+n[1],e[2]=i[2]+n[2],e};AEn.exports=cpi});var xEn=lt(function(xra,yEn){var lpi=(e,t,n,o)=>{let r=[],i=[];return r[0]=t[0]-n[0],r[1]=t[1]-n[1],r[2]=t[2]-n[2],i[0]=r[2]*Math.sin(o)+r[0]*Math.cos(o),i[1]=r[1],i[2]=r[2]*Math.cos(o)-r[0]*Math.sin(o),e[0]=i[0]+n[0],e[1]=i[1]+n[1],e[2]=i[2]+n[2],e};yEn.exports=lpi});var bEn=lt(function(Cra,CEn){var hpi=(e,t,n,o)=>{let r=[],i=[];return r[0]=t[0]-n[0],r[1]=t[1]-n[1],i[0]=r[0]*Math.cos(o)-r[1]*Math.sin(o),i[1]=r[0]*Math.sin(o)+r[1]*Math.cos(o),e[0]=i[0]+n[0],e[1]=i[1]+n[1],e[2]=t[2],e};CEn.exports=hpi});var Jat=lt(function(bra,IEn){var dpi=(e,t,n)=>(e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e);IEn.exports=dpi});var SEn=lt(function(Ira,vEn){var upi=(e,t,n)=>(e[0]=Math.round(t[0]/n)*n+0,e[1]=Math.round(t[1]/n)*n+0,e[2]=Math.round(t[2]/n)*n+0,e);vEn.exports=upi});var Zat=lt(function(vra,PEn){var ppi=(e,t)=>{let n=t[0]-e[0],o=t[1]-e[1],r=t[2]-e[2];return n*n+o*o+r*r};PEn.exports=ppi});var ect=lt(function(Sra,EEn){var mpi=(e)=>{let t=e[0],n=e[1],o=e[2];return t*t+n*n+o*o};EEn.exports=mpi});var Kue=lt(function(Pra,MEn){var _pi=(e,t,n)=>(e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e);MEn.exports=_pi});var BEn=lt(function(Era,wEn){var gpi=(e)=>`[${e[0].toFixed(7)}, ${e[1].toFixed(7)}, ${e[2].toFixed(7)}]`;wEn.exports=gpi});var DEn=lt(function(Mra,TEn){var Api=(e,t,n)=>{let o=t[0],r=t[1],i=t[2],s=n[3]*o+n[7]*r+n[11]*i+n[15];return s=s||1,e[0]=(n[0]*o+n[4]*r+n[8]*i+n[12])/s,e[1]=(n[1]*o+n[5]*r+n[9]*i+n[13])/s,e[2]=(n[2]*o+n[6]*r+n[10]*i+n[14])/s,e};TEn.exports=Api});var si=lt(function(wra,NEn){NEn.exports={abs:Uat(),add:Wat(),angle:VPn(),clone:UPn(),copy:Xat(),create:jue(),cross:FZ(),distance:jat(),divide:$Pn(),dot:Xue(),equals:JPn(),fromScalar:eEn(),fromValues:nEn(),fromVec2:rEn(),length:Kat(),lerp:aEn(),max:$at(),min:qat(),multiply:dEn(),negate:pEn(),normalize:K7e(),orthogonal:gEn(),rotateX:fEn(),rotateY:xEn(),rotateZ:bEn(),scale:Jat(),snap:SEn(),squaredDistance:Zat(),squaredLength:ect(),subtract:Kue(),toString:BEn(),transform:DEn()}});var QEn=lt(function(Bra,REn){var Kk=si(),fpi=Vat(),ypi=(e,t,n)=>{let o=Kk.normalize(Kk.create(),t),r=Kk.normalize(Kk.create(),n),i=Kk.cross(Kk.create(),r,o),s=Kk.dot(r,o);if(s===-1)return fpi(e,Math.PI,Kk.orthogonal(i,o));let a=1/(1+s);return e[0]=i[0]*i[0]*a+s,e[1]=i[1]*i[0]*a-i[2],e[2]=i[2]*i[0]*a+i[1],e[3]=0,e[4]=i[0]*i[1]*a+i[2],e[5]=i[1]*i[1]*a+s,e[6]=i[2]*i[1]*a-i[0],e[7]=0,e[8]=i[0]*i[2]*a-i[1],e[9]=i[1]*i[2]*a+i[0],e[10]=i[2]*i[2]*a+s,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e};REn.exports=ypi});var LEn=lt(function(Tra,kEn){var{sin:xpi,cos:Cpi}=BA(),bpi=(e,t)=>{let n=xpi(t),o=Cpi(t);return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=o,e[6]=n,e[7]=0,e[8]=0,e[9]=-n,e[10]=o,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e};kEn.exports=bpi});var FEn=lt(function(Dra,HEn){var{sin:Ipi,cos:vpi}=BA(),Spi=(e,t)=>{let n=Ipi(t),o=vpi(t);return e[0]=o,e[1]=0,e[2]=-n,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=n,e[9]=0,e[10]=o,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e};HEn.exports=Spi});var OEn=lt(function(Nra,zEn){var{sin:Ppi,cos:Epi}=BA(),Mpi=(e,t)=>{let n=Ppi(t),o=Epi(t);return e[0]=o,e[1]=n,e[2]=0,e[3]=0,e[4]=-n,e[5]=o,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e};zEn.exports=Mpi});var YEn=lt(function(Rra,VEn){var wpi=(e)=>e[0]===1&&e[1]===0&&e[2]===0&&e[3]===0&&e[4]===0&&e[5]===1&&e[6]===0&&e[7]===0&&e[8]===0&&e[9]===0&&e[10]===1&&e[11]===0&&e[12]===0&&e[13]===0&&e[14]===0&&e[15]===1;VEn.exports=wpi});var UEn=lt(function(Qra,GEn){var Bpi=(e)=>SB(e[1])&&SB(e[2])&&SB(e[3])&&SB(e[4])&&SB(e[6])&&SB(e[7])&&SB(e[8])&&SB(e[9])&&SB(e[11])&&e[15]===1,SB=(e)=>Math.abs(e)<Number.EPSILON;GEn.exports=Bpi});var XEn=lt(function(kra,WEn){var Tpi=(e)=>{let t=e[4]*e[9]-e[8]*e[5],n=e[8]*e[1]-e[0]*e[9],o=e[0]*e[5]-e[4]*e[1];return t*e[2]+n*e[6]+o*e[10]<0};WEn.exports=Tpi});var KEn=lt(function(Lra,jEn){var Dpi=(e,t)=>{let[n,o,r,i]=t;return e[0]=1-2*n*n,e[1]=-2*o*n,e[2]=-2*r*n,e[3]=0,e[4]=-2*n*o,e[5]=1-2*o*o,e[6]=-2*r*o,e[7]=0,e[8]=-2*n*r,e[9]=-2*o*r,e[10]=1-2*r*r,e[11]=0,e[12]=2*n*i,e[13]=2*o*i,e[14]=2*r*i,e[15]=1,e};jEn.exports=Dpi});var qEn=lt(function(Hra,$En){var Npi=(e,t,n)=>{let o=t[0],r=t[1],i=t[2],s=t[3],a=t[4],c=t[5],l=t[6],h=t[7],d=t[8],u=t[9],_=t[10],p=t[11],m=t[12],A=t[13],g=t[14],f=t[15],y=n[0],x=n[1],C=n[2],b=n[3];return e[0]=y*o+x*a+C*d+b*m,e[1]=y*r+x*c+C*u+b*A,e[2]=y*i+x*l+C*_+b*g,e[3]=y*s+x*h+C*p+b*f,y=n[4],x=n[5],C=n[6],b=n[7],e[4]=y*o+x*a+C*d+b*m,e[5]=y*r+x*c+C*u+b*A,e[6]=y*i+x*l+C*_+b*g,e[7]=y*s+x*h+C*p+b*f,y=n[8],x=n[9],C=n[10],b=n[11],e[8]=y*o+x*a+C*d+b*m,e[9]=y*r+x*c+C*u+b*A,e[10]=y*i+x*l+C*_+b*g,e[11]=y*s+x*h+C*p+b*f,y=n[12],x=n[13],C=n[14],b=n[15],e[12]=y*o+x*a+C*d+b*m,e[13]=y*r+x*c+C*u+b*A,e[14]=y*i+x*l+C*_+b*g,e[15]=y*s+x*h+C*p+b*f,e};$En.exports=Npi});var ZEn=lt(function(Fra,JEn){var{EPS:Rpi}=rc(),{sin:Qpi,cos:kpi}=BA(),Lpi=zat(),Hpi=(e,t,n,o)=>{let[r,i,s]=o,a=r*r+i*i+s*s;if(Math.abs(a)<Rpi)return Lpi(e,t);let c=1/Math.sqrt(a);r*=c,i*=c,s*=c;let l=Qpi(n),h=kpi(n),d=1-h,u=t[0],_=t[1],p=t[2],m=t[3],A=t[4],g=t[5],f=t[6],y=t[7],x=t[8],C=t[9],b=t[10],I=t[11],v=r*r*d+h,P=i*r*d+s*l,M=s*r*d-i*l,B=r*i*d-s*l,T=i*i*d+h,N=s*i*d+r*l,D=r*s*d+i*l,L=i*s*d-r*l,H=s*s*d+h;if(e[0]=u*v+A*P+x*M,e[1]=_*v+g*P+C*M,e[2]=p*v+f*P+b*M,e[3]=m*v+y*P+I*M,e[4]=u*B+A*T+x*N,e[5]=_*B+g*T+C*N,e[6]=p*B+f*T+b*N,e[7]=m*B+y*T+I*N,e[8]=u*D+A*L+x*H,e[9]=_*D+g*L+C*H,e[10]=p*D+f*L+b*H,e[11]=m*D+y*L+I*H,t!==e)e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15];return e};JEn.exports=Hpi});var tMn=lt(function(zra,eMn){var{sin:Fpi,cos:zpi}=BA(),Opi=(e,t,n)=>{let o=Fpi(n),r=zpi(n),i=t[4],s=t[5],a=t[6],c=t[7],l=t[8],h=t[9],d=t[10],u=t[11];if(t!==e)e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15];return e[4]=i*r+l*o,e[5]=s*r+h*o,e[6]=a*r+d*o,e[7]=c*r+u*o,e[8]=l*r-i*o,e[9]=h*r-s*o,e[10]=d*r-a*o,e[11]=u*r-c*o,e};eMn.exports=Opi});var oMn=lt(function(Ora,nMn){var{sin:Vpi,cos:Ypi}=BA(),Gpi=(e,t,n)=>{let o=Vpi(n),r=Ypi(n),i=t[0],s=t[1],a=t[2],c=t[3],l=t[8],h=t[9],d=t[10],u=t[11];if(t!==e)e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15];return e[0]=i*r-l*o,e[1]=s*r-h*o,e[2]=a*r-d*o,e[3]=c*r-u*o,e[8]=i*o+l*r,e[9]=s*o+h*r,e[10]=a*o+d*r,e[11]=c*o+u*r,e};nMn.exports=Gpi});var iMn=lt(function(Vra,rMn){var{sin:Upi,cos:Wpi}=BA(),Xpi=(e,t,n)=>{let o=Upi(n),r=Wpi(n),i=t[0],s=t[1],a=t[2],c=t[3],l=t[4],h=t[5],d=t[6],u=t[7];if(t!==e)e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15];return e[0]=i*r+l*o,e[1]=s*r+h*o,e[2]=a*r+d*o,e[3]=c*r+u*o,e[4]=l*r-i*o,e[5]=h*r-s*o,e[6]=d*r-a*o,e[7]=u*r-c*o,e};rMn.exports=Xpi});var aMn=lt(function(Yra,sMn){var jpi=(e,t,n)=>{let o=n[0],r=n[1],i=n[2];return e[0]=t[0]*o,e[1]=t[1]*o,e[2]=t[2]*o,e[3]=t[3]*o,e[4]=t[4]*r,e[5]=t[5]*r,e[6]=t[6]*r,e[7]=t[7]*r,e[8]=t[8]*i,e[9]=t[9]*i,e[10]=t[10]*i,e[11]=t[11]*i,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e};sMn.exports=jpi});var lMn=lt(function(Gra,cMn){var Kpi=(e,t,n)=>(e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e[4]=t[4]-n[4],e[5]=t[5]-n[5],e[6]=t[6]-n[6],e[7]=t[7]-n[7],e[8]=t[8]-n[8],e[9]=t[9]-n[9],e[10]=t[10]-n[10],e[11]=t[11]-n[11],e[12]=t[12]-n[12],e[13]=t[13]-n[13],e[14]=t[14]-n[14],e[15]=t[15]-n[15],e);cMn.exports=Kpi});var dMn=lt(function(Ura,hMn){var $pi=(e)=>e.map((t)=>t.toFixed(7)).toString();hMn.exports=$pi});var pMn=lt(function(Wra,uMn){var qpi=(e,t,n)=>{let o=n[0],r=n[1],i=n[2],s,a,c,l,h,d,u,_,p,m,A,g;if(t===e)e[12]=t[0]*o+t[4]*r+t[8]*i+t[12],e[13]=t[1]*o+t[5]*r+t[9]*i+t[13],e[14]=t[2]*o+t[6]*r+t[10]*i+t[14],e[15]=t[3]*o+t[7]*r+t[11]*i+t[15];else s=t[0],a=t[1],c=t[2],l=t[3],h=t[4],d=t[5],u=t[6],_=t[7],p=t[8],m=t[9],A=t[10],g=t[11],e[0]=s,e[1]=a,e[2]=c,e[3]=l,e[4]=h,e[5]=d,e[6]=u,e[7]=_,e[8]=p,e[9]=m,e[10]=A,e[11]=g,e[12]=s*o+h*r+p*i+t[12],e[13]=a*o+d*r+m*i+t[13],e[14]=c*o+u*r+A*i+t[14],e[15]=l*o+_*r+g*i+t[15];return e};uMn.exports=qpi});var Fh=lt(function(Xra,mMn){mMn.exports={add:gPn(),clone:yPn(),copy:zat(),create:j7e(),invert:bPn(),equals:vPn(),fromRotation:Vat(),fromScaling:TPn(),fromTaitBryanRotation:NPn(),fromTranslation:QPn(),fromValues:LPn(),fromVectorRotation:QEn(),fromXRotation:LEn(),fromYRotation:FEn(),fromZRotation:OEn(),identity:Oat(),isIdentity:YEn(),isOnlyTransformScale:UEn(),isMirroring:XEn(),mirrorByPlane:KEn(),multiply:qEn(),rotate:ZEn(),rotateX:tMn(),rotateY:oMn(),rotateZ:iMn(),scale:aMn(),subtract:lMn(),toString:dMn(),translate:pMn()}});var $ue=lt(function(jra,_Mn){var Jpi=Fh(),Zpi=(e)=>{if(e===void 0)e=[];return{sides:e,transforms:Jpi.create()}};_Mn.exports=Zpi});var AMn=lt(function(Kra,gMn){var emi=(e,t)=>(e[0]=Math.abs(t[0]),e[1]=Math.abs(t[1]),e);gMn.exports=emi});var yMn=lt(function($ra,fMn){var tmi=(e,t,n)=>(e[0]=t[0]+n[0],e[1]=t[1]+n[1],e);fMn.exports=tmi});var $7e=lt(function(qra,xMn){var nmi=(e)=>Math.atan2(e[1],e[0]);xMn.exports=nmi});var bMn=lt(function(Jra,CMn){var omi=$7e(),rmi=(e)=>omi(e)*57.29577951308232;CMn.exports=rmi});var que=lt(function(Zra,IMn){var imi=()=>[0,0];IMn.exports=imi});var SMn=lt(function(eia,vMn){var smi=que(),ami=(e)=>{let t=smi();return t[0]=e[0],t[1]=e[1],t};vMn.exports=ami});var EMn=lt(function(tia,PMn){var cmi=(e,t)=>(e[0]=t[0],e[1]=t[1],e);PMn.exports=cmi});var wMn=lt(function(nia,MMn){var lmi=(e,t,n)=>(e[0]=0,e[1]=0,e[2]=t[0]*n[1]-t[1]*n[0],e);MMn.exports=lmi});var TMn=lt(function(oia,BMn){var hmi=(e,t)=>{let n=t[0]-e[0],o=t[1]-e[1];return Math.sqrt(n*n+o*o)};BMn.exports=hmi});var NMn=lt(function(ria,DMn){var dmi=(e,t,n)=>(e[0]=t[0]/n[0],e[1]=t[1]/n[1],e);DMn.exports=dmi});var QMn=lt(function(iia,RMn){var umi=(e,t)=>e[0]*t[0]+e[1]*t[1];RMn.exports=umi});var LMn=lt(function(sia,kMn){var pmi=(e,t)=>e[0]===t[0]&&e[1]===t[1];kMn.exports=pmi});var tct=lt(function(aia,HMn){var{sin:mmi,cos:_mi}=BA(),gmi=(e,t)=>(e[0]=_mi(t),e[1]=mmi(t),e);HMn.exports=gmi});var zMn=lt(function(cia,FMn){var Ami=tct(),fmi=(e,t)=>Ami(e,t*0.017453292519943295);FMn.exports=fmi});var VMn=lt(function(lia,OMn){var ymi=(e,t)=>(e[0]=t,e[1]=t,e);OMn.exports=ymi});var GMn=lt(function(hia,YMn){var xmi=que(),Cmi=(e,t)=>{let n=xmi();return n[0]=e,n[1]=t,n};YMn.exports=Cmi});var WMn=lt(function(dia,UMn){var bmi=(e)=>Math.sqrt(e[0]*e[0]+e[1]*e[1]);UMn.exports=bmi});var jMn=lt(function(uia,XMn){var Imi=(e,t,n,o)=>{let r=t[0],i=t[1];return e[0]=r+o*(n[0]-r),e[1]=i+o*(n[1]-i),e};XMn.exports=Imi});var $Mn=lt(function(pia,KMn){var vmi=(e,t,n)=>(e[0]=Math.max(t[0],n[0]),e[1]=Math.max(t[1],n[1]),e);KMn.exports=vmi});var JMn=lt(function(mia,qMn){var Smi=(e,t,n)=>(e[0]=Math.min(t[0],n[0]),e[1]=Math.min(t[1],n[1]),e);qMn.exports=Smi});var ewn=lt(function(_ia,ZMn){var Pmi=(e,t,n)=>(e[0]=t[0]*n[0],e[1]=t[1]*n[1],e);ZMn.exports=Pmi});var nwn=lt(function(gia,twn){var Emi=(e,t)=>(e[0]=-t[0],e[1]=-t[1],e);twn.exports=Emi});var nct=lt(function(Aia,own){var Mmi=(e,t,n,o)=>{let r=t[0]-n[0],i=t[1]-n[1],s=Math.cos(o),a=Math.sin(o);return e[0]=r*s-i*a+n[0],e[1]=r*a+i*s+n[1],e};own.exports=Mmi});var iwn=lt(function(fia,rwn){var{TAU:wmi}=rc(),Bmi=que(),Tmi=nct(),Dmi=(e,t)=>Tmi(e,t,Bmi(),wmi/4);rwn.exports=Dmi});var awn=lt(function(yia,swn){var Nmi=(e,t)=>{let n=t[0],o=t[1],r=n*n+o*o;if(r>0)r=1/Math.sqrt(r);return e[0]=n*r,e[1]=o*r,e};swn.exports=Nmi});var lwn=lt(function(xia,cwn){var Rmi=(e,t,n)=>(e[0]=t[0]*n,e[1]=t[1]*n,e);cwn.exports=Rmi});var dwn=lt(function(Cia,hwn){var Qmi=(e,t,n)=>(e[0]=Math.round(t[0]/n)*n+0,e[1]=Math.round(t[1]/n)*n+0,e);hwn.exports=Qmi});var pwn=lt(function(bia,uwn){var kmi=(e,t)=>{let n=t[0]-e[0],o=t[1]-e[1];return n*n+o*o};uwn.exports=kmi});var _wn=lt(function(Iia,mwn){var Lmi=(e)=>{let t=e[0],n=e[1];return t*t+n*n};mwn.exports=Lmi});var Awn=lt(function(via,gwn){var Hmi=(e,t,n)=>(e[0]=t[0]-n[0],e[1]=t[1]-n[1],e);gwn.exports=Hmi});var ywn=lt(function(Sia,fwn){var Fmi=(e)=>`[${e[0].toFixed(7)}, ${e[1].toFixed(7)}]`;fwn.exports=Fmi});var Cwn=lt(function(Pia,xwn){var zmi=(e,t,n)=>{let o=t[0],r=t[1];return e[0]=n[0]*o+n[4]*r+n[12],e[1]=n[1]*o+n[5]*r+n[13],e};xwn.exports=zmi});var da=lt(function(Eia,bwn){bwn.exports={abs:AMn(),add:yMn(),angle:$7e(),angleDegrees:bMn(),angleRadians:$7e(),clone:SMn(),copy:EMn(),create:que(),cross:wMn(),distance:TMn(),divide:NMn(),dot:QMn(),equals:LMn(),fromAngleDegrees:zMn(),fromAngleRadians:tct(),fromScalar:VMn(),fromValues:GMn(),length:WMn(),lerp:jMn(),max:$Mn(),min:JMn(),multiply:ewn(),negate:nwn(),normal:iwn(),normalize:awn(),rotate:nct(),scale:lwn(),snap:dwn(),squaredDistance:pwn(),squaredLength:_wn(),subtract:Awn(),toString:ywn(),transform:Cwn()}});var vwn=lt(function(Mia,Iwn){var oct=da(),Omi=$ue(),Vmi=(e)=>{if(!Array.isArray(e))throw Error("the given points must be an array");let t=e.length;if(t<3)throw Error("the given points must define a closed geometry with three or more points");if(oct.equals(e[0],e[t-1]))--t;let n=[],o=e[t-1];for(let r=0;r<t;r++){let i=e[r];n.push([oct.clone(o),oct.clone(i)]),o=i}return Omi(n)};Iwn.exports=Vmi});var Ewn=lt(function(wia,Pwn){var Ymi=Fh(),Swn=da(),Gmi=$ue(),Umi=(e)=>{if(e[0]!==0)throw Error("invalid compact binary data");let t=Gmi();t.transforms=Ymi.clone(e.slice(1,17));for(let n=21;n<e.length;n+=4){let o=Swn.fromValues(e[n+0],e[n+1]),r=Swn.fromValues(e[n+2],e[n+3]);t.sides.push([o,r])}if(e[17]>=0)t.color=[e[17],e[18],e[19],e[20]];return t};Pwn.exports=Umi});var rct=lt(function(Bia,Mwn){var Wmi=(e)=>{if(e&&typeof e==="object"){if("sides"in e&&"transforms"in e){if(Array.isArray(e.sides)&&"length"in e.transforms)return!0}}return!1};Mwn.exports=Wmi});var Twn=lt(function(Tia,Bwn){var wwn=Fh(),q7e=da(),Xmi=(e)=>{if(wwn.isIdentity(e.transforms))return e;return e.sides=e.sides.map((t)=>{let n=q7e.transform(q7e.create(),t[0],e.transforms),o=q7e.transform(q7e.create(),t[1],e.transforms);return[n,o]}),e.transforms=wwn.create(),e};Bwn.exports=Xmi});var zZ=lt(function(Dia,Dwn){var jmi=Twn(),Kmi=(e)=>jmi(e).sides;Dwn.exports=Kmi});var ict=lt(function(Nia,Nwn){var $mi=$ue(),qmi=zZ(),Jmi=(e)=>{let n=qmi(e).map((o)=>[o[1],o[0]]);return n.reverse(),$mi(n)};Nwn.exports=Jmi});var sct=lt(function(Ria,Rwn){var Jue=da(),Zmi=zZ(),e_i=(e)=>{let t=new Map,n=(o)=>{let r=o.toString();if(t.has(r))return t.get(r);else return t.set(r,o),o};return e.map((o)=>o.map(n))},t_i=(e)=>{let t=new Map;return e_i(e).forEach((o)=>{if(t.has(o[0]))t.get(o[0]).push(o);else t.set(o[0],[o])}),t},n_i=(e)=>{let t=t_i(Zmi(e)),n=[];while(!0){let o;for(let[s,a]of t){if(o=a.shift(),!o){t.delete(s);continue}break}if(o===void 0)break;let r=[],i=o[0];while(!0){r.push(o[0]);let s=o[1];if(s===i)break;let a=t.get(s);if(!a)throw Error(`geometry is not closed at vertex ${s}`);let c=o_i(o,a);if(a.length===0)t.delete(s);o=c}if(r.length>0)r.push(r.shift());n.push(r)}return t.clear(),n},o_i=(e,t)=>{if(t.length===1)return t.pop();let n=Jue.create(),o=Jue.angleDegrees(Jue.subtract(n,e[1],e[0])),r,i;t.forEach((a,c)=>{let h=Jue.angleDegrees(Jue.subtract(n,a[1],a[0]))-o;if(h<-180)h+=360;if(h>=180)h-=360;if(i===void 0||h>r)i=c,r=h});let s=t[i];return t.splice(i,1),s};Rwn.exports=n_i});var kwn=lt(function(Qia,Qwn){var r_i=zZ(),i_i=(e)=>{let n=r_i(e).map((o)=>o[0]);if(n.length>0)n.push(n.shift());return n};Qwn.exports=i_i});var Fwn=lt(function(kia,Hwn){var Lwn=da(),s_i=zZ(),a_i=(e)=>{let t=s_i(e),n="geom2 ("+t.length+` sides):
[
`;return t.forEach((o)=>{n+="  ["+Lwn.toString(o[0])+", "+Lwn.toString(o[1])+`]
`}),n+=`]
`,n};Hwn.exports=a_i});var Own=lt(function(Lia,zwn){var c_i=(e)=>{let{sides:t,transforms:n}=e,o=[-1,-1,-1,-1];if(e.color)o=e.color;let r=new Float32Array(21+t.length*4);r[0]=0,r[1]=n[0],r[2]=n[1],r[3]=n[2],r[4]=n[3],r[5]=n[4],r[6]=n[5],r[7]=n[6],r[8]=n[7],r[9]=n[8],r[10]=n[9],r[11]=n[10],r[12]=n[11],r[13]=n[12],r[14]=n[13],r[15]=n[14],r[16]=n[15],r[17]=o[0],r[18]=o[1],r[19]=o[2],r[20]=o[3];for(let i=0;i<t.length;i++){let s=i*4+21,a=t[i][0],c=t[i][1];r[s+0]=a[0],r[s+1]=a[1],r[s+2]=c[0],r[s+3]=c[1]}return r};zwn.exports=c_i});var Gwn=lt(function(Hia,Ywn){var Vwn=Fh(),l_i=ict(),h_i=(e,t)=>{let n=Vwn.multiply(Vwn.create(),e,t.transforms),o=Object.assign({},t,{transforms:n});if(e[0]*e[5]-e[4]*e[1]<0)return l_i(o);return o};Ywn.exports=h_i});var Wwn=lt(function(Fia,Uwn){var d_i=da(),u_i=rct(),p_i=sct(),m_i=(e)=>{if(!u_i(e))throw Error("invalid geom2 structure");if(p_i(e),e.sides.forEach((t)=>{if(d_i.equals(t[0],t[1]))throw Error(`geom2 self-edge ${t[0]}`)}),!e.transforms.every(Number.isFinite))throw Error(`geom2 invalid transforms ${e.transforms}`)};Uwn.exports=m_i});var zs=lt(function(zia,Xwn){Xwn.exports={clone:mPn(),create:$ue(),fromPoints:vwn(),fromCompactBinary:Ewn(),isA:rct(),reverse:ict(),toOutlines:sct(),toPoints:kwn(),toSides:zZ(),toString:Fwn(),toCompactBinary:Own(),transform:Gwn(),validate:Wwn()}});var Kwn=lt(function(Oia,jwn){var __i=(e)=>Object.assign({},e);jwn.exports=__i});var OZ=lt(function(Via,$wn){var g_i=Fh(),A_i=(e)=>{if(e===void 0)e=[];return{polygons:e,transforms:g_i.create()}};$wn.exports=A_i});var eBn=lt(function(Yia,Zwn){var f_i=FZ(),qwn=Kue(),Jwn=ect(),y_i=(e,t,n)=>{let o=[],r=[],i=[];qwn(o,n,t),qwn(r,e,t);let s=Jwn(f_i(i,r,o)),a=Jwn(o);if(a===0)throw Error("a and b are the same point");return s/a},x_i=(e,t,n)=>Math.sqrt(y_i(e,t,n));Zwn.exports=x_i});var oBn=lt(function(Gia,nBn){var C_i=FZ(),b_i=K7e(),tBn=Kue(),I_i=(e,t,n,o)=>{let r=[0,0,0];return tBn(e,t,n),tBn(r,n,o),C_i(e,e,r),b_i(e,e)};nBn.exports=I_i});var sBn=lt(function(Uia,iBn){class rBn{constructor(){this.head=null,this.tail=null}clear(){this.head=this.tail=null}insertBefore(e,t){if(t.prev=e.prev,t.next=e,!t.prev)this.head=t;else t.prev.next=t;e.prev=t}insertAfter(e,t){if(t.prev=e,t.next=e.next,!t.next)this.tail=t;else t.next.prev=t;e.next=t}add(e){if(!this.head)this.head=e;else this.tail.next=e;e.prev=this.tail,e.next=null,this.tail=e}addAll(e){if(!this.head)this.head=e;else this.tail.next=e;e.prev=this.tail;while(e.next)e=e.next;this.tail=e}remove(e){if(!e.prev)this.head=e.next;else e.prev.next=e.next;if(!e.next)this.tail=e.prev;else e.next.prev=e.prev}removeChain(e,t){if(!e.prev)this.head=t.next;else e.prev.next=t.next;if(!t.next)this.tail=e.prev;else t.next.prev=e.prev}first(){return this.head}isEmpty(){return!this.head}}iBn.exports=rBn});var lBn=lt(function(Wia,cBn){class aBn{constructor(e,t){this.point=e,this.index=t,this.next=null,this.prev=null,this.face=null}}cBn.exports=aBn});var uBn=lt(function(Xia,dBn){var v_i=jat(),S_i=Zat();class hBn{constructor(e,t){this.vertex=e,this.face=t,this.next=null,this.prev=null,this.opposite=null}head(){return this.vertex}tail(){return this.prev?this.prev.vertex:null}length(){if(this.tail())return v_i(this.tail().point,this.head().point);return-1}lengthSquared(){if(this.tail())return S_i(this.tail().point,this.head().point);return-1}setOpposite(e){this.opposite=e,e.opposite=this}}dBn.exports=hBn});var mBn=lt(function(jia,pBn){var act=Wat(),P_i=Xat(),E_i=FZ(),cct=Xue(),M_i=Kat(),w_i=K7e(),J7e=Jat(),lct=Kue(),hct=uBn();class dct{constructor(){this.normal=[],this.centroid=[],this.offset=0,this.outside=null,this.mark=0,this.edge=null,this.nVertices=0}getEdge(e){if(typeof e!=="number")throw Error("requires a number");let t=this.edge;while(e>0)t=t.next,e-=1;while(e<0)t=t.prev,e+=1;return t}computeNormal(){let e=this.edge,t=e.next,n=t.next,o=lct([],t.head().point,e.head().point),r=[],i=[];this.nVertices=2,this.normal=[0,0,0];while(n!==e)P_i(i,o),lct(o,n.head().point,e.head().point),act(this.normal,this.normal,E_i(r,i,o)),n=n.next,this.nVertices+=1;this.area=M_i(this.normal),this.normal=J7e(this.normal,this.normal,1/this.area)}computeNormalMinArea(e){if(this.computeNormal(),this.area<e){let t,n=0,o=this.edge;do{let l=o.lengthSquared();if(l>n)t=o,n=l;o=o.next}while(o!==this.edge);let r=t.tail().point,i=t.head().point,s=lct([],i,r),a=Math.sqrt(n);J7e(s,s,1/a);let c=cct(this.normal,s);J7e(s,s,-c),act(this.normal,this.normal,s),w_i(this.normal,this.normal)}}computeCentroid(){this.centroid=[0,0,0];let e=this.edge;do act(this.centroid,this.centroid,e.head().point),e=e.next;while(e!==this.edge);J7e(this.centroid,this.centroid,1/this.nVertices)}computeNormalAndCentroid(e){if(typeof e<"u")this.computeNormalMinArea(e);else this.computeNormal();this.computeCentroid(),this.offset=cct(this.normal,this.centroid)}distanceToPlane(e){return cct(this.normal,e)-this.offset}connectHalfEdges(e,t){let n;if(e.opposite.face===t.opposite.face){let o=t.opposite.face,r;if(e===this.edge)this.edge=t;if(o.nVertices===3)r=t.opposite.prev.opposite,o.mark=2,n=o;else{if(r=t.opposite.next,o.edge===r.prev)o.edge=r;r.prev=r.prev.prev,r.prev.next=r}t.prev=e.prev,t.prev.next=t,t.setOpposite(r),o.computeNormalAndCentroid()}else e.next=t,t.prev=e;return n}mergeAdjacentFaces(e,t){let n=e.opposite,o=n.face;t.push(o),o.mark=2;let{prev:r,next:i}=e,{prev:s,next:a}=n;while(r.opposite.face===o)r=r.prev,a=a.next;while(i.opposite.face===o)i=i.next,s=s.prev;let c;for(c=a;c!==s.next;c=c.next)c.face=this;this.edge=i;let l;if(l=this.connectHalfEdges(s,i),l)t.push(l);if(l=this.connectHalfEdges(r,a),l)t.push(l);return this.computeNormalAndCentroid(),t}collectIndices(){let e=[],t=this.edge;do e.push(t.head().index),t=t.next;while(t!==this.edge);return e}static createTriangle(e,t,n,o=0){let r=new dct,i=new hct(e,r),s=new hct(t,r),a=new hct(n,r);return i.next=a.prev=s,s.next=i.prev=a,a.next=s.prev=i,r.edge=i,r.computeNormalAndCentroid(o),r}}pBn.exports={VISIBLE:0,NON_CONVEX:1,DELETED:2,Face:dct}});var yBn=lt(function(Kia,fBn){var uct=Xue(),B_i=eBn(),T_i=oBn(),_Bn=sBn(),D_i=lBn(),{Face:PB,VISIBLE:VZ,NON_CONVEX:gBn,DELETED:N_i}=mBn();class ABn{constructor(e){if(!Array.isArray(e))throw TypeError("input is not a valid array");if(e.length<4)throw Error("cannot build a simplex out of <4 points");this.tolerance=-1,this.nFaces=0,this.nPoints=e.length,this.faces=[],this.newFaces=[],this.claimed=new _Bn,this.unclaimed=new _Bn,this.vertices=[];for(let t=0;t<e.length;t+=1)this.vertices.push(new D_i(e[t],t));this.discardedFaces=[],this.vertexPointIndices=[]}addVertexToFace(e,t){if(e.face=t,!t.outside)this.claimed.add(e);else this.claimed.insertBefore(t.outside,e);t.outside=e}removeVertexFromFace(e,t){if(e===t.outside)if(e.next&&e.next.face===t)t.outside=e.next;else t.outside=null;this.claimed.remove(e)}removeAllVerticesFromFace(e){if(e.outside){let t=e.outside;while(t.next&&t.next.face===e)t=t.next;return this.claimed.removeChain(e.outside,t),t.next=null,e.outside}}deleteFaceVertices(e,t){let n=this.removeAllVerticesFromFace(e);if(n)if(!t)this.unclaimed.addAll(n);else{let o;for(let r=n;r;r=o)if(o=r.next,t.distanceToPlane(r.point)>this.tolerance)this.addVertexToFace(r,t);else this.unclaimed.add(r)}}resolveUnclaimedPoints(e){let t=this.unclaimed.first();for(let n=t;n;n=t){t=n.next;let o=this.tolerance,r;for(let i=0;i<e.length;i+=1){let s=e[i];if(s.mark===VZ){let a=s.distanceToPlane(n.point);if(a>o)o=a,r=s;if(o>1000*this.tolerance)break}}if(r)this.addVertexToFace(n,r)}}computeExtremes(){let e=[],t=[],n=[],o=[],r,i;for(r=0;r<3;r+=1)n[r]=o[r]=this.vertices[0];for(r=0;r<3;r+=1)e[r]=t[r]=this.vertices[0].point[r];for(r=1;r<this.vertices.length;r+=1){let s=this.vertices[r],a=s.point;for(i=0;i<3;i+=1)if(a[i]<e[i])e[i]=a[i],n[i]=s;for(i=0;i<3;i+=1)if(a[i]>t[i])t[i]=a[i],o[i]=s}return this.tolerance=3*Number.EPSILON*(Math.max(Math.abs(e[0]),Math.abs(t[0]))+Math.max(Math.abs(e[1]),Math.abs(t[1]))+Math.max(Math.abs(e[2]),Math.abs(t[2]))),[n,o]}createInitialSimplex(){let e=this.vertices,[t,n]=this.computeExtremes(),o,r,i,s,a=0,c=0;for(i=0;i<3;i+=1){let p=n[i].point[i]-t[i].point[i];if(p>a)a=p,c=i}let l=t[c],h=n[c];a=0;for(i=0;i<this.vertices.length;i+=1){let p=this.vertices[i];if(p!==l&&p!==h){let m=B_i(p.point,l.point,h.point);if(m>a)a=m,o=p}}let d=T_i([],l.point,h.point,o.point),u=uct(l.point,d);a=-1;for(i=0;i<this.vertices.length;i+=1){let p=this.vertices[i];if(p!==l&&p!==h&&p!==o){let m=Math.abs(uct(d,p.point)-u);if(m>a)a=m,r=p}}let _=[];if(uct(r.point,d)-u<0){_.push(PB.createTriangle(l,h,o),PB.createTriangle(r,h,l),PB.createTriangle(r,o,h),PB.createTriangle(r,l,o));for(i=0;i<3;i+=1){let p=(i+1)%3;_[i+1].getEdge(2).setOpposite(_[0].getEdge(p)),_[i+1].getEdge(1).setOpposite(_[p+1].getEdge(0))}}else{_.push(PB.createTriangle(l,o,h),PB.createTriangle(r,l,h),PB.createTriangle(r,h,o),PB.createTriangle(r,o,l));for(i=0;i<3;i+=1){let p=(i+1)%3;_[i+1].getEdge(2).setOpposite(_[0].getEdge((3-i)%3)),_[i+1].getEdge(0).setOpposite(_[p+1].getEdge(1))}}for(i=0;i<4;i+=1)this.faces.push(_[i]);for(i=0;i<e.length;i+=1){let p=e[i];if(p!==l&&p!==h&&p!==o&&p!==r){a=this.tolerance;let m;for(s=0;s<4;s+=1){let A=_[s].distanceToPlane(p.point);if(A>a)a=A,m=_[s]}if(m)this.addVertexToFace(p,m)}}}reindexFaceAndVertices(){let e=[];for(let t=0;t<this.faces.length;t+=1){let n=this.faces[t];if(n.mark===VZ)e.push(n)}this.faces=e}collectFaces(e){let t=[];for(let n=0;n<this.faces.length;n+=1){if(this.faces[n].mark!==VZ)throw Error("attempt to include a destroyed face in the hull");let o=this.faces[n].collectIndices();if(e)t.push(o);else for(let r=0;r<o.length-2;r+=1)t.push([o[0],o[r+1],o[r+2]])}return t}nextVertexToAdd(){if(!this.claimed.isEmpty()){let e,t,n=0,o=this.claimed.first().face;for(t=o.outside;t&&t.face===o;t=t.next){let r=o.distanceToPlane(t.point);if(r>n)n=r,e=t}return e}}computeHorizon(e,t,n,o){this.deleteFaceVertices(n),n.mark=N_i;let r;if(!t)r=t=n.getEdge(0);else r=t.next;do{let i=r.opposite,s=i.face;if(s.mark===VZ)if(s.distanceToPlane(e)>this.tolerance)this.computeHorizon(e,i,s,o);else o.push(r);r=r.next}while(r!==t)}addAdjoiningFace(e,t){let n=PB.createTriangle(e,t.tail(),t.head());return this.faces.push(n),n.getEdge(-1).setOpposite(t.opposite),n.getEdge(0)}addNewFaces(e,t){this.newFaces=[];let n,o;for(let r=0;r<t.length;r+=1){let i=t[r],s=this.addAdjoiningFace(e,i);if(!n)n=s;else s.next.setOpposite(o);this.newFaces.push(s.face),o=s}n.next.setOpposite(o)}oppositeFaceDistance(e){return e.face.distanceToPlane(e.opposite.face.centroid)}doAdjacentMerge(e,t){let n=e.edge,o=!0,r=0;do{if(r>=e.nVertices)throw Error("merge recursion limit exceeded");let i=n.opposite.face,s=!1;if(t===2){if(this.oppositeFaceDistance(n)>-this.tolerance||this.oppositeFaceDistance(n.opposite)>-this.tolerance)s=!0}else if(e.area>i.area){if(this.oppositeFaceDistance(n)>-this.tolerance)s=!0;else if(this.oppositeFaceDistance(n.opposite)>-this.tolerance)o=!1}else if(this.oppositeFaceDistance(n.opposite)>-this.tolerance)s=!0;else if(this.oppositeFaceDistance(n)>-this.tolerance)o=!1;if(s){let a=e.mergeAdjacentFaces(n,[]);for(let c=0;c<a.length;c+=1)this.deleteFaceVertices(a[c],e);return!0}n=n.next,r+=1}while(n!==e.edge);if(!o)e.mark=gBn;return!1}addVertexToHull(e){let t=[];this.unclaimed.clear(),this.removeVertexFromFace(e,e.face),this.computeHorizon(e.point,null,e.face,t),this.addNewFaces(e,t);for(let n=0;n<this.newFaces.length;n+=1){let o=this.newFaces[n];if(o.mark===VZ)while(this.doAdjacentMerge(o,1));}for(let n=0;n<this.newFaces.length;n+=1){let o=this.newFaces[n];if(o.mark===gBn){o.mark=VZ;while(this.doAdjacentMerge(o,2));}}this.resolveUnclaimedPoints(this.newFaces)}build(){let e;this.createInitialSimplex();while(e=this.nextVertexToAdd())this.addVertexToHull(e);this.reindexFaceAndVertices()}}fBn.exports=ABn});var pct=lt(function($ia,xBn){var R_i=yBn(),Q_i=(e,t={})=>{let n=new R_i(e);return n.build(),n.collectFaces(t.skipTriangulation)};xBn.exports=Q_i});var JY=lt(function(qia,CBn){var k_i=(e)=>{if(e===void 0||e.length<3)e=[];return{vertices:e}};CBn.exports=k_i});var IBn=lt(function(Jia,bBn){var L_i=JY(),H_i=si(),F_i=(...e)=>{let t,n;if(e.length===1)t=L_i(),n=e[0];else t=e[0],n=e[1];return t.vertices=n.vertices.map((o)=>H_i.clone(o)),t};bBn.exports=F_i});var SBn=lt(function(Zia,vBn){var z_i=si(),O_i=JY(),V_i=(e)=>{let t=e.map((n)=>z_i.clone(n));return O_i(t)};vBn.exports=V_i});var EBn=lt(function(esa,PBn){var Y_i=JY(),G_i=(e,t)=>{let n=Y_i(e);return n.plane=t,n};PBn.exports=G_i});var Zue=lt(function(tsa,MBn){var U_i=()=>[0,0,0,0];MBn.exports=U_i});var mct=lt(function(nsa,wBn){var W_i=Zue(),X_i=(e)=>{let t=W_i();return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t};wBn.exports=X_i});var _ct=lt(function(osa,BBn){var j_i=(e,t)=>(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e);BBn.exports=j_i});var gct=lt(function(rsa,TBn){var K_i=(e,t)=>e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3];TBn.exports=K_i});var Act=lt(function(isa,DBn){var $_i=(e,t)=>(e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=-t[3],e);DBn.exports=$_i});var yct=lt(function(ssa,NBn){var fct=si(),q_i=(e,t,n)=>{let o=fct.normalize(fct.create(),t),r=fct.dot(n,o);return e[0]=o[0],e[1]=o[1],e[2]=o[2],e[3]=r,e};NBn.exports=q_i});var xct=lt(function(asa,RBn){var J_i=Zue(),Z_i=(e,t,n,o)=>{let r=J_i();return r[0]=e,r[1]=t,r[2]=n,r[3]=o,r};RBn.exports=Z_i});var kBn=lt(function(csa,QBn){var s3=si(),egi=yct(),tgi=(e,...t)=>{e[0]=0,e[1]=0,e[2]=0,e[3]=0;let n=t.length;t.forEach((_)=>{s3.add(e,e,_)}),s3.scale(e,e,1/n);let o=0,r=0,i=0,s=0,a=0,c=0,l=s3.create();t.forEach((_)=>{s3.subtract(l,_,e),o+=l[0]*l[0],r+=l[0]*l[1],i+=l[0]*l[2],s+=l[1]*l[1],a+=l[1]*l[2],c+=l[2]*l[2]}),o/=n,r/=n,i/=n,s/=n,a/=n,c/=n,l[0]=0,l[1]=0,l[2]=0;let h=s3.create(),d=s*c-a*a;h[0]=d,h[1]=i*a-r*c,h[2]=r*a-i*s;let u=d*d;if(s3.add(l,l,s3.scale(h,h,u)),d=o*c-i*i,h[0]=i*a-r*c,h[1]=d,h[2]=r*i-a*o,u=d*d,s3.dot(l,h)<0)u=-u;if(s3.add(l,l,s3.scale(h,h,u)),d=o*s-r*r,h[0]=r*a-i*s,h[1]=r*i-a*o,h[2]=d,u=d*d,s3.dot(l,h)<0)u=-u;return s3.add(l,l,s3.scale(h,h,u)),egi(e,l,e)};QBn.exports=tgi});var Cct=lt(function(lsa,LBn){var iP=si(),ngi=(e,...t)=>{let n=t.length,o=iP.create(),r=iP.create(),i=(s)=>{let a=t[s],c=t[(s+1)%n],l=t[(s+2)%n];return iP.subtract(o,c,a),iP.subtract(r,l,a),iP.cross(o,o,r),iP.normalize(o,o),o};if(e[0]=0,e[1]=0,e[2]=0,n===3)iP.copy(e,i(0));else t.forEach((s,a)=>{iP.add(e,e,i(a))}),iP.normalize(e,e);return e[3]=iP.dot(e,t[0]),e};LBn.exports=ngi});var FBn=lt(function(hsa,HBn){var{EPS:bct}=rc(),By=si(),ogi=(e,t,n,o)=>{let r=By.subtract(By.create(),n,t),i=By.subtract(By.create(),o,t);if(By.length(r)<bct)r=By.orthogonal(r,i);if(By.length(i)<bct)i=By.orthogonal(i,r);let s=By.cross(By.create(),r,i);if(By.length(s)<bct)i=By.orthogonal(i,r),s=By.cross(s,r,i);s=By.normalize(s,s);let a=By.dot(s,t);return e[0]=s[0],e[1]=s[1],e[2]=s[2],e[3]=a,e};HBn.exports=ogi});var OBn=lt(function(dsa,zBn){var rgi=si(),igi=(e,t)=>{let n=t[0]*e[0]+t[1]*e[1]+t[2]*e[2]-e[3],o=t[0]-n*e[0],r=t[1]-n*e[1],i=t[2]-n*e[2];return rgi.fromValues(o,r,i)};zBn.exports=igi});var Ict=lt(function(usa,VBn){var sgi=si(),agi=(e,t)=>sgi.dot(e,t)-e[3];VBn.exports=agi});var vct=lt(function(psa,YBn){var cgi=(e)=>`(${e[0].toFixed(9)}, ${e[1].toFixed(9)}, ${e[2].toFixed(9)}, ${e[3].toFixed(9)})`;YBn.exports=cgi});var UBn=lt(function(msa,GBn){var lgi=Fh(),Ty=si(),hgi=Cct(),dgi=Act(),ugi=(e,t,n)=>{let o=lgi.isMirroring(n),r=Ty.orthogonal(Ty.create(),t),i=Ty.cross(r,t,r),s=Ty.cross(Ty.create(),t,i),a=Ty.fromScalar(Ty.create(),t[3]);Ty.multiply(a,a,t);let c=Ty.add(Ty.create(),a,i),l=Ty.add(Ty.create(),a,s);if(a=Ty.transform(a,a,n),c=Ty.transform(c,c,n),l=Ty.transform(l,l,n),hgi(e,a,c,l),o)dgi(e,e);return e};GBn.exports=ugi});var z9=lt(function(_sa,WBn){WBn.exports={clone:mct(),copy:_ct(),create:Zue(),equals:gct(),flip:Act(),fromNormalAndPoint:yct(),fromValues:xct(),fromNoisyPoints:kBn(),fromPoints:Cct(),fromPointsRandom:FBn(),projectionOfPoint:OBn(),signedDistanceToPoint:Ict(),toString:vct(),transform:UBn()}});var KBn=lt(function(gsa,jBn){var XBn=z9(),pgi=JY(),mgi=(e)=>{let t=e.vertices.slice().reverse(),n=pgi(t);if(e.plane)n.plane=XBn.flip(XBn.create(),e.plane);return n};jBn.exports=mgi});var Sct=lt(function(Asa,$Bn){var _gi=(e)=>{if(e&&typeof e==="object"){if("vertices"in e){if(Array.isArray(e.vertices))return!0}}return!1};$Bn.exports=_gi});var Pct=lt(function(fsa,JBn){var qBn=z9(),ZY=si(),ggi=(e)=>Agi(e.vertices),Agi=(e)=>{let t=e.length;if(t>2){let n=qBn.fromPoints(qBn.create(),...e),o=e[t-2],r=e[t-1];for(let i=0;i<t;i++){let s=e[i];if(!fgi(o,r,s,n))return!1;o=r,r=s}}return!0},fgi=(e,t,n,o)=>{let r=ZY.cross(ZY.create(),ZY.subtract(ZY.create(),t,e),ZY.subtract(ZY.create(),n,t));return ZY.dot(r,o)>=0};JBn.exports=ggi});var Z7e=lt(function(ysa,eTn){var ZBn=z9(),ygi=(e)=>{if(!e.plane)e.plane=ZBn.fromPoints(ZBn.create(),...e.vertices);return e.plane};eTn.exports=ygi});var Ect=lt(function(xsa,tTn){var xgi=Z7e(),Cgi=(e)=>{let t=e.vertices.length;if(t<3)return 0;let n=e.vertices,o=xgi(e),r=Math.abs(o[0]),i=Math.abs(o[1]),s=Math.abs(o[2]);if(r+i+s===0)return 0;let a=3;if(r>i&&r>s)a=1;else if(i>s)a=2;let c=0,l=0,h=1,d=2;switch(a){case 1:for(h=1;h<t;h++)l=h-1,d=(h+1)%t,c+=n[h][1]*(n[d][2]-n[l][2]);c+=n[0][1]*(n[1][2]-n[t-1][2]),c/=2*o[0];break;case 2:for(h=1;h<t;h++)l=h-1,d=(h+1)%t,c+=n[h][2]*(n[d][0]-n[l][0]);c+=n[0][2]*(n[1][0]-n[t-1][0]),c/=2*o[1];break;case 3:default:for(h=1;h<t;h++)l=h-1,d=(h+1)%t,c+=n[h][0]*(n[d][1]-n[l][1]);c+=n[0][0]*(n[1][1]-n[t-1][1]),c/=2*o[2];break}return c};tTn.exports=Cgi});var oTn=lt(function(Csa,nTn){var e0e=si(),bgi=(e)=>{let t=e.vertices,n=t.length,o=n===0?e0e.create():e0e.clone(t[0]),r=e0e.clone(o);for(let i=1;i<n;i++)e0e.min(o,o,t[i]),e0e.max(r,r,t[i]);return[o,r]};nTn.exports=bgi});var iTn=lt(function(bsa,rTn){var Igi=(e,t)=>e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3];rTn.exports=Igi});var aTn=lt(function(Isa,sTn){var vgi=(e,t)=>(e[0]=t,e[1]=t,e[2]=t,e[3]=t,e);sTn.exports=vgi});var lTn=lt(function(vsa,cTn){var Sgi=(e,t,n)=>{let[o,r,i,s]=t;return e[0]=n[0]*o+n[4]*r+n[8]*i+n[12]*s,e[1]=n[1]*o+n[5]*r+n[9]*i+n[13]*s,e[2]=n[2]*o+n[6]*r+n[10]*i+n[14]*s,e[3]=n[3]*o+n[7]*r+n[11]*i+n[15]*s,e};cTn.exports=Sgi});var Mct=lt(function(Ssa,hTn){hTn.exports={clone:mct(),copy:_ct(),create:Zue(),dot:iTn(),equals:gct(),fromScalar:aTn(),fromValues:xct(),toString:vct(),transform:lTn()}});var pTn=lt(function(Psa,uTn){var Pgi=Mct(),dTn=new WeakMap,Egi=(e)=>{let t=dTn.get(e);if(t)return t;let n=e.vertices,o=Pgi.create();if(n.length===0)return o[0]=0,o[1]=0,o[2]=0,o[3]=0,o;let r=n[0],i=r,s=r,a=r,c=r,l=r;n.forEach((_)=>{if(r[0]>_[0])r=_;if(i[1]>_[1])i=_;if(s[2]>_[2])s=_;if(a[0]<_[0])a=_;if(c[1]<_[1])c=_;if(l[2]<_[2])l=_}),o[0]=(r[0]+a[0])*0.5,o[1]=(i[1]+c[1])*0.5,o[2]=(s[2]+l[2])*0.5;let h=o[0]-a[0],d=o[1]-c[1],u=o[2]-l[2];return o[3]=Math.sqrt(h*h+d*d+u*u),dTn.set(e,o),o};uTn.exports=Egi});var _Tn=lt(function(Esa,mTn){var wct=si(),Mgi=(e)=>{let t=0,n=e.vertices,o=wct.create();for(let r=0;r<n.length-2;r++)wct.cross(o,n[r+1],n[r+2]),t+=wct.dot(n[0],o);return t/=6,t};mTn.exports=Mgi});var ATn=lt(function(Msa,gTn){var wgi=(e)=>e.vertices;gTn.exports=wgi});var yTn=lt(function(wsa,fTn){var Bgi=si(),Tgi=(e)=>{let t="poly3: vertices: [";return e.vertices.forEach((n)=>{t+=`${Bgi.toString(n)}, `}),t+="]",t};fTn.exports=Tgi});var bTn=lt(function(Bsa,CTn){var Dgi=Fh(),xTn=si(),Ngi=JY(),Rgi=(e,t)=>{let n=t.vertices.map((o)=>xTn.transform(xTn.create(),o,e));if(Dgi.isMirroring(e))n.reverse();return Ngi(n)};CTn.exports=Rgi});var vTn=lt(function(Tsa,ITn){var Qgi=Ict(),{NEPS:kgi}=rc(),Lgi=si(),Hgi=Sct(),Fgi=Pct(),zgi=Ect(),Ogi=Z7e(),Vgi=(e)=>{if(!Hgi(e))throw Error("invalid poly3 structure");if(e.vertices.length<3)throw Error(`poly3 not enough vertices ${e.vertices.length}`);if(zgi(e)<=0)throw Error("poly3 area must be greater than zero");for(let t=0;t<e.vertices.length;t++)if(Lgi.equals(e.vertices[t],e.vertices[(t+1)%e.vertices.length]))throw Error(`poly3 duplicate vertex ${e.vertices[t]}`);if(!Fgi(e))throw Error("poly3 must be convex");if(e.vertices.forEach((t)=>{if(!t.every(Number.isFinite))throw Error(`poly3 invalid vertex ${t}`)}),e.vertices.length>3){let t=Ogi(e);e.vertices.forEach((n)=>{let o=Math.abs(Qgi(t,n));if(o>kgi)throw Error(`poly3 must be coplanar: vertex ${n} distance ${o}`)})}};ITn.exports=Vgi});var za=lt(function(Dsa,STn){STn.exports={clone:IBn(),create:JY(),fromPoints:SBn(),fromPointsAndPlane:EBn(),invert:KBn(),isA:Sct(),isConvex:Pct(),measureArea:Ect(),measureBoundingBox:oTn(),measureBoundingSphere:pTn(),measureSignedVolume:_Tn(),plane:Z7e(),toPoints:ATn(),toString:yTn(),transform:bTn(),validate:vTn()}});var ETn=lt(function(Nsa,PTn){var Ygi=pct(),Ggi=OZ(),Ugi=za(),Wgi=(e)=>{if(!Array.isArray(e))throw Error("the given points must be an array");let n=Ygi(e,{skipTriangulation:!0}).map((o)=>{let r=o.map((i)=>e[i]);return Ugi.create(r)});return Ggi(n)};PTn.exports=Wgi});var wTn=lt(function(Rsa,MTn){var Xgi=za(),jgi=OZ(),Kgi=(e)=>{if(!Array.isArray(e))throw Error("the given points must be an array");let t=e.map((o,r)=>Xgi.create(o));return jgi(t)};MTn.exports=Kgi});var TTn=lt(function(Qsa,BTn){var $gi=si(),qgi=Fh(),Jgi=za(),Zgi=OZ(),eAi=(e)=>{if(e[0]!==1)throw Error("invalid compact binary data");let t=Zgi();t.transforms=qgi.clone(e.slice(1,17));let n=e[21],o=22,r=e.length-n*3;while(r<e.length){let i=e[o];o++;let s=[];for(let a=0;a<i;a++)s.push($gi.fromValues(e[r],e[r+1],e[r+2])),r+=3;t.polygons.push(Jgi.create(s))}if(e[17]>=0)t.color=[e[17],e[18],e[19],e[20]];return t};BTn.exports=eAi});var RTn=lt(function(ksa,NTn){var DTn=Fh(),tAi=za(),nAi=(e)=>{if(DTn.isIdentity(e.transforms))return e;return e.polygons=e.polygons.map((t)=>tAi.transform(e.transforms,t)),e.transforms=DTn.create(),e};NTn.exports=nAi});var YZ=lt(function(Lsa,QTn){var oAi=RTn(),rAi=(e)=>oAi(e).polygons;QTn.exports=rAi});var LTn=lt(function(Hsa,kTn){var iAi=za(),sAi=OZ(),aAi=YZ(),cAi=(e)=>{let n=aAi(e).map((o)=>iAi.invert(o));return sAi(n)};kTn.exports=cAi});var eSe=lt(function(Fsa,HTn){var lAi=(e)=>{if(e&&typeof e==="object"){if("polygons"in e&&"transforms"in e){if(Array.isArray(e.polygons)&&"length"in e.transforms)return!0}}return!1};HTn.exports=lAi});var zTn=lt(function(zsa,FTn){var{EPS:hAi}=rc(),dAi=si(),uAi=eSe(),pAi=YZ(),mAi=za(),_Ai=(e)=>{if(!uAi(e))throw Error("isConvex requires a geom3 geometry");let t=pAi(e);if(t.length===0)return!0;let n=[],o=new Set;for(let r=0;r<t.length;r++){let i=t[r].vertices;for(let s=0;s<i.length;s++){let a=i[s],c=`${a[0]},${a[1]},${a[2]}`;if(!o.has(c))o.add(c),n.push(a)}}for(let r=0;r<t.length;r++){let i=mAi.plane(t[r]);for(let s=0;s<n.length;s++){let a=n[s];if(dAi.dot(i,a)-i[3]>hAi)return!1}}return!0};FTn.exports=_Ai});var VTn=lt(function(Osa,OTn){var gAi=za(),AAi=YZ(),fAi=(e)=>AAi(e).map((o)=>gAi.toPoints(o));OTn.exports=fAi});var GTn=lt(function(Vsa,YTn){var yAi=za(),xAi=YZ(),CAi=(e)=>{let t=xAi(e),n="geom3 ("+t.length+` polygons):
`;return t.forEach((o)=>{n+="  "+yAi.toString(o)+`
`}),n};YTn.exports=CAi});var WTn=lt(function(Ysa,UTn){var bAi=za(),IAi=(e)=>{let{polygons:t,transforms:n}=e,o=t.length,r=t.reduce((l,h)=>l+h.vertices.length,0),i=[-1,-1,-1,-1];if(e.color)i=e.color;let s=new Float32Array(22+o+r*3);s[0]=1,s[1]=n[0],s[2]=n[1],s[3]=n[2],s[4]=n[3],s[5]=n[4],s[6]=n[5],s[7]=n[6],s[8]=n[7],s[9]=n[8],s[10]=n[9],s[11]=n[10],s[12]=n[11],s[13]=n[12],s[14]=n[13],s[15]=n[14],s[16]=n[15],s[17]=i[0],s[18]=i[1],s[19]=i[2],s[20]=i[3],s[21]=r;let a=22,c=a+o;return t.forEach((l)=>{let h=bAi.toPoints(l);s[a]=h.length,a++;for(let d=0;d<h.length;d++){let u=h[d];s[c+0]=u[0],s[c+1]=u[1],s[c+2]=u[2],c+=3}}),s};UTn.exports=IAi});var KTn=lt(function(Gsa,jTn){var XTn=Fh(),vAi=(e,t)=>{let n=XTn.multiply(XTn.create(),e,t.transforms);return Object.assign({},t,{transforms:n})};jTn.exports=vAi});var qTn=lt(function(Usa,$Tn){var SAi=za(),PAi=eSe(),EAi=(e)=>{if(!PAi(e))throw Error("invalid geom3 structure");if(e.polygons.forEach(SAi.validate),MAi(e),!e.transforms.every(Number.isFinite))throw Error(`geom3 invalid transforms ${e.transforms}`)},MAi=(e)=>{let t=new Map;e.polygons.forEach(({vertices:o})=>{o.forEach((r,i)=>{let s=`${r}`,a=`${o[(i+1)%o.length]}`,c=`${s}/${a}`,l=t.has(c)?t.get(c):0;t.set(c,l+1)})});let n=[];if(t.forEach((o,r)=>{let i=r.split("/").reverse().join("/"),s=t.get(i);if(o!==s)n.push(r.replace("/"," -> "))}),n.length>0)throw Error(`non-manifold edges ${n.length}
${n.join(`
`)}`)};$Tn.exports=EAi});var Ds=lt(function(Wsa,JTn){JTn.exports={clone:Kwn(),create:OZ(),fromPointsConvex:ETn(),fromPoints:wTn(),fromCompactBinary:TTn(),invert:LTn(),isA:eSe(),isConvex:zTn(),toPoints:VTn(),toPolygons:YZ(),toString:GTn(),toCompactBinary:WTn(),transform:KTn(),validate:qTn()}});var tSe=lt(function(Xsa,ZTn){var wAi=(e)=>Object.assign({},e);ZTn.exports=wAi});var Bct=lt(function(jsa,tDn){var{EPS:eDn}=rc(),BAi=da(),TAi=tSe(),DAi=(e)=>{if(e.isClosed)return e;let t=TAi(e);if(t.isClosed=!0,t.points.length>1){let n=t.points,o=n[0],r=n[n.length-1];while(BAi.distance(o,r)<eDn*eDn){if(n.pop(),n.length===1)break;r=n[n.length-1]}}return t};tDn.exports=DAi});var t0e=lt(function(Ksa,nDn){var NAi=Fh(),RAi=(e)=>{if(e===void 0)e=[];return{points:e,isClosed:!1,transforms:NAi.create()}};nDn.exports=RAi});var nSe=lt(function($sa,iDn){var{EPS:oDn}=rc(),rDn=da(),QAi=Bct(),kAi=t0e(),LAi=(e,t)=>{let n={closed:!1},{closed:o}=Object.assign({},n,e),r=kAi();if(r.points=t.map((i)=>rDn.clone(i)),r.points.length>1){let i=r.points[0],s=r.points[r.points.length-1];if(rDn.distance(i,s)<oDn*oDn)o=!0}if(o===!0)r=QAi(r);return r};iDn.exports=LAi});var lDn=lt(function(qsa,cDn){var sDn=Fh(),aDn=da(),HAi=(e)=>{if(sDn.isIdentity(e.transforms))return e;return e.points=e.points.map((t)=>aDn.transform(aDn.create(),t,e.transforms)),e.transforms=sDn.create(),e};cDn.exports=HAi});var eG=lt(function(Jsa,hDn){var FAi=lDn(),zAi=(e)=>FAi(e).points;hDn.exports=zAi});var uDn=lt(function(Zsa,dDn){var{TAU:oSe}=rc(),m_=da(),OAi=nSe(),VAi=eG(),YAi=(e,t)=>{let n={radius:[0,0],xaxisrotation:0,clockwise:!1,large:!1,segments:16},{endpoint:o,radius:r,xaxisrotation:i,clockwise:s,large:a,segments:c}=Object.assign({},n,e);if(!Array.isArray(o))throw Error("endpoint must be an array of X and Y values");if(o.length<2)throw Error("endpoint must contain X and Y values");if(o=m_.clone(o),!Array.isArray(r))throw Error("radius must be an array of X and Y values");if(r.length<2)throw Error("radius must contain X and Y values");if(c<4)throw Error("segments must be four or more");let l=1e5;if(t.isClosed)throw Error("the given path cannot be closed");let h=VAi(t);if(h.length<1)throw Error("the given path must contain one or more points (as the starting point for the arc)");let d=r[0],u=r[1],_=h[h.length-1];d=Math.round(d*l)/l,u=Math.round(u*l)/l,o=m_.fromValues(Math.round(o[0]*l)/l,Math.round(o[1]*l)/l);let p=!s,m=[];if(d===0||u===0)m.push(o);else{d=Math.abs(d),u=Math.abs(u);let g=i,f=Math.cos(g),y=Math.sin(g),x=m_.subtract(m_.create(),_,o);m_.scale(x,x,0.5);let C=Math.round((f*x[0]+y*x[1])*l)/l,b=Math.round((-y*x[0]+f*x[1])*l)/l,I=m_.fromValues(C,b),v=I[0]*I[0]/(d*d)+I[1]*I[1]/(u*u);if(v>1){let O=Math.sqrt(v);d*=O,u*=O,d=Math.round(d*l)/l,u=Math.round(u*l)/l}let P=Math.sqrt((d*d*u*u-d*d*I[1]*I[1]-u*u*I[0]*I[0])/(d*d*I[1]*I[1]+u*u*I[0]*I[0]));if(p===a)P=-P;let M=m_.fromValues(d*I[1]/u,-u*I[0]/d);m_.scale(M,M,P);let B=m_.fromValues(f*M[0]-y*M[1],y*M[0]+f*M[1]);B=m_.add(B,B,m_.scale(m_.create(),m_.add(m_.create(),_,o),0.5));let T=m_.fromValues((I[0]-M[0])/d,(I[1]-M[1])/u),N=m_.fromValues((-I[0]-M[0])/d,(-I[1]-M[1])/u),D=m_.angleRadians(T),H=m_.angleRadians(N)-D;if(H=H%oSe,!p&&H>0)H-=oSe;else if(p&&H<0)H+=oSe;let V=Math.floor(c*(Math.abs(H)/oSe));if(V<1)V=1;for(let O=1;O<V;O++){let U=D+O/V*H,j=Math.cos(U),Y=Math.sin(U),X=m_.fromValues(f*d*j-y*u*Y,y*d*j+f*u*Y);m_.add(X,X,B),m.push(X)}if(V)m.push(e.endpoint)}return m=h.concat(m),OAi({},m)};dDn.exports=YAi});var Tct=lt(function(eaa,pDn){var GAi=nSe(),UAi=eG(),{equals:WAi}=da(),XAi=(...e)=>{let t=!1,n=[];return e.forEach((o,r)=>{let i=UAi(o).slice();if(n.length>0&&i.length>0&&WAi(i[0],n[n.length-1]))i.shift();if(i.length>0&&t)throw Error(`Cannot concatenate to a closed path; check the ${r}th path`);t=o.isClosed,n=n.concat(i)}),GAi({closed:t},n)};pDn.exports=XAi});var Dct=lt(function(taa,mDn){var jAi=Tct(),KAi=t0e(),$Ai=(e,t)=>jAi(t,KAi(e));mDn.exports=$Ai});var gDn=lt(function(naa,_Dn){var{TAU:qAi}=rc(),a3=da(),JAi=da(),ZAi=Dct(),efi=eG(),tfi=(e,t)=>{let n={segments:16},{controlPoints:o,segments:r}=Object.assign({},n,e);if(!Array.isArray(o))throw Error("controlPoints must be an array of one or more points");if(o.length<1)throw Error("controlPoints must be an array of one or more points");if(r<4)throw Error("segments must be four or more");if(t.isClosed)throw Error("the given geometry cannot be closed");let i=efi(t);if(i.length<1)throw Error("the given path must contain one or more points (as the starting point for the bezier curve)");if(o=o.slice(),o[0]===null){if(o.length<2)throw Error("a null control point must be passed with one more control points");let b=i[i.length-2];if("lastBezierControlPoint"in t)b=t.lastBezierControlPoint;if(!Array.isArray(b))throw Error("the given path must contain TWO or more points if given a null control point");let I=a3.scale(a3.create(),i[i.length-1],2);a3.subtract(I,I,b),o[0]=I}o.unshift(i[i.length-1]);let a=o.length-1,c=[],l=1;for(let b=0;b<=a;++b){if(b>0)l*=b;c.push(l)}let h=[];for(let b=0;b<=a;++b){let I=c[a]/(c[b]*c[a-b]);h.push(I)}let d=a3.create(),u=a3.create(),_=JAi.create(),p=(b)=>{let I=1,v=Math.pow(1-b,a),P=b!==1?1/(1-b):1,M=a3.create();for(let B=0;B<=a;++B){if(B===a)v=1;let T=h[B]*I*v,N=a3.scale(d,o[B],T);a3.add(M,M,N),I*=b,v*=P}return M},m=[],A=[],g=a+1;for(let b=0;b<g;++b){let I=b/(g-1),v=p(I);m.push(v),A.push(I)}let f=1,y=qAi/r,x=Math.sin(y);while(f<m.length-1){let b=a3.subtract(d,m[f],m[f-1]);a3.normalize(b,b);let I=a3.subtract(u,m[f+1],m[f]);a3.normalize(I,I);let v=a3.cross(_,b,I);if(Math.abs(v[2])>x){let P=A[f-1],M=A[f+1],B=P+(M-P)*1/3,T=P+(M-P)*2/3,N=p(B),D=p(T);if(m.splice(f,1,N,D),A.splice(f,1,B,T),f--,f<1)f=1}else++f}m.shift();let C=ZAi(m,t);return C.lastBezierControlPoint=o[o.length-2],C};_Dn.exports=tfi});var yDn=lt(function(oaa,fDn){var nfi=da(),ADn=eG(),ofi=(e,t)=>{if(e.isClosed!==t.isClosed)return!1;if(e.points.length!==t.points.length)return!1;let n=ADn(e),o=ADn(t),r=n.length,i=0;do{let s=!1;for(let a=0;a<r;a++)if(!nfi.equals(n[a],o[(a+i)%r])){s=!0;break}if(s===!1)return!0;if(!e.isClosed)return!1}while(++i<r);return!1};fDn.exports=ofi});var CDn=lt(function(raa,xDn){var rfi=Fh(),ifi=da(),sfi=t0e(),afi=(e)=>{if(e[0]!==2)throw Error("invalid compact binary data");let t=sfi();t.transforms=rfi.clone(e.slice(1,17)),t.isClosed=!!e[17];for(let n=22;n<e.length;n+=2){let o=ifi.fromValues(e[n],e[n+1]);t.points.push(o)}if(e[18]>=0)t.color=[e[18],e[19],e[20],e[21]];return t};xDn.exports=afi});var Nct=lt(function(iaa,bDn){var cfi=(e)=>{if(e&&typeof e==="object"){if("points"in e&&"transforms"in e&&"isClosed"in e){if(Array.isArray(e.points)&&"length"in e.transforms)return!0}}return!1};bDn.exports=cfi});var vDn=lt(function(saa,IDn){var lfi=tSe(),hfi=(e)=>{let t=lfi(e);return t.points=e.points.slice().reverse(),t};IDn.exports=hfi});var PDn=lt(function(aaa,SDn){var dfi=da(),ufi=eG(),pfi=(e)=>{let t=ufi(e),n="path ("+t.length+" points, "+e.isClosed+`):
[
`;return t.forEach((o)=>{n+="  "+dfi.toString(o)+`,
`}),n+=`]
`,n};SDn.exports=pfi});var MDn=lt(function(caa,EDn){var mfi=(e)=>{let{points:t,transforms:n}=e,o=[-1,-1,-1,-1];if(e.color)o=e.color;let r=new Float32Array(22+t.length*2);r[0]=2,r[1]=n[0],r[2]=n[1],r[3]=n[2],r[4]=n[3],r[5]=n[4],r[6]=n[5],r[7]=n[6],r[8]=n[7],r[9]=n[8],r[10]=n[9],r[11]=n[10],r[12]=n[11],r[13]=n[12],r[14]=n[13],r[15]=n[14],r[16]=n[15],r[17]=e.isClosed?1:0,r[18]=o[0],r[19]=o[1],r[20]=o[2],r[21]=o[3];for(let i=0;i<t.length;i++){let s=i*2+22,a=t[i];r[s]=a[0],r[s+1]=a[1]}return r};EDn.exports=mfi});var TDn=lt(function(laa,BDn){var wDn=Fh(),_fi=(e,t)=>{let n=wDn.multiply(wDn.create(),e,t.transforms);return Object.assign({},t,{transforms:n})};BDn.exports=_fi});var NDn=lt(function(haa,DDn){var gfi=da(),Afi=Nct(),ffi=(e)=>{if(!Afi(e))throw Error("invalid path2 structure");if(e.points.length>1){for(let t=0;t<e.points.length;t++)if(gfi.equals(e.points[t],e.points[(t+1)%e.points.length]))throw Error(`path2 duplicate points ${e.points[t]}`)}if(e.points.forEach((t)=>{if(!t.every(Number.isFinite))throw Error(`path2 invalid point ${t}`)}),!e.transforms.every(Number.isFinite))throw Error(`path2 invalid transforms ${e.transforms}`)};DDn.exports=ffi});var bh=lt(function(daa,RDn){RDn.exports={appendArc:uDn(),appendBezier:gDn(),appendPoints:Dct(),clone:tSe(),close:Bct(),concat:Tct(),create:t0e(),equals:yDn(),fromPoints:nSe(),fromCompactBinary:CDn(),isA:Nct(),reverse:vDn(),toPoints:eG(),toString:PDn(),toCompactBinary:MDn(),transform:TDn(),validate:NDn()}});var zDn=lt(function(uaa,FDn){var yfi=ms(),QDn=zs(),kDn=Ds(),LDn=bh(),HDn=za(),xfi=(e,t)=>{let n=QDn.clone(t);return n.color=e,n},Cfi=(e,t)=>{let n=kDn.clone(t);return n.color=e,n},bfi=(e,t)=>{let n=LDn.clone(t);return n.color=e,n},Ifi=(e,t)=>{let n=HDn.clone(t);return n.color=e,n},vfi=(e,...t)=>{if(!Array.isArray(e))throw Error("color must be an array");if(e.length<3)throw Error("color must contain R, G and B values");if(e.length===3)e=[e[0],e[1],e[2],1];if(t=yfi(t),t.length===0)throw Error("wrong number of arguments");let n=t.map((o)=>{if(QDn.isA(o))return xfi(e,o);if(kDn.isA(o))return Cfi(e,o);if(LDn.isA(o))return bfi(e,o);if(HDn.isA(o))return Ifi(e,o);return o.color=e,o});return n.length===1?n[0]:n};FDn.exports=vfi});var Rct=lt(function(paa,ODn){var Sfi={black:[0,0,0],silver:[0.7529411764705882,0.7529411764705882,0.7529411764705882],gray:[0.5019607843137255,0.5019607843137255,0.5019607843137255],white:[1,1,1],maroon:[0.5019607843137255,0,0],red:[1,0,0],purple:[0.5019607843137255,0,0.5019607843137255],fuchsia:[1,0,1],green:[0,0.5019607843137255,0],lime:[0,1,0],olive:[0.5019607843137255,0.5019607843137255,0],yellow:[1,1,0],navy:[0,0,0.5019607843137255],blue:[0,0,1],teal:[0,0.5019607843137255,0.5019607843137255],aqua:[0,1,1],aliceblue:[0.9411764705882353,0.9725490196078431,1],antiquewhite:[0.9803921568627451,0.9215686274509803,0.8431372549019608],aquamarine:[0.4980392156862745,1,0.8313725490196079],azure:[0.9411764705882353,1,1],beige:[0.9607843137254902,0.9607843137254902,0.8627450980392157],bisque:[1,0.8941176470588236,0.7686274509803922],blanchedalmond:[1,0.9215686274509803,0.803921568627451],blueviolet:[0.5411764705882353,0.16862745098039217,0.8862745098039215],brown:[0.6470588235294118,0.16470588235294117,0.16470588235294117],burlywood:[0.8705882352941177,0.7215686274509804,0.5294117647058824],cadetblue:[0.37254901960784315,0.6196078431372549,0.6274509803921569],chartreuse:[0.4980392156862745,1,0],chocolate:[0.8235294117647058,0.4117647058823529,0.11764705882352941],coral:[1,0.4980392156862745,0.3137254901960784],cornflowerblue:[0.39215686274509803,0.5843137254901961,0.9294117647058824],cornsilk:[1,0.9725490196078431,0.8627450980392157],crimson:[0.8627450980392157,0.0784313725490196,0.23529411764705882],cyan:[0,1,1],darkblue:[0,0,0.5450980392156862],darkcyan:[0,0.5450980392156862,0.5450980392156862],darkgoldenrod:[0.7215686274509804,0.5254901960784314,0.043137254901960784],darkgray:[0.6627450980392157,0.6627450980392157,0.6627450980392157],darkgreen:[0,0.39215686274509803,0],darkgrey:[0.6627450980392157,0.6627450980392157,0.6627450980392157],darkkhaki:[0.7411764705882353,0.7176470588235294,0.4196078431372549],darkmagenta:[0.5450980392156862,0,0.5450980392156862],darkolivegreen:[0.3333333333333333,0.4196078431372549,0.1843137254901961],darkorange:[1,0.5490196078431373,0],darkorchid:[0.6,0.19607843137254902,0.8],darkred:[0.5450980392156862,0,0],darksalmon:[0.9137254901960784,0.5882352941176471,0.47843137254901963],darkseagreen:[0.5607843137254902,0.7372549019607844,0.5607843137254902],darkslateblue:[0.2823529411764706,0.23921568627450981,0.5450980392156862],darkslategray:[0.1843137254901961,0.30980392156862746,0.30980392156862746],darkslategrey:[0.1843137254901961,0.30980392156862746,0.30980392156862746],darkturquoise:[0,0.807843137254902,0.8196078431372549],darkviolet:[0.5803921568627451,0,0.8274509803921568],deeppink:[1,0.0784313725490196,0.5764705882352941],deepskyblue:[0,0.7490196078431373,1],dimgray:[0.4117647058823529,0.4117647058823529,0.4117647058823529],dimgrey:[0.4117647058823529,0.4117647058823529,0.4117647058823529],dodgerblue:[0.11764705882352941,0.5647058823529412,1],firebrick:[0.6980392156862745,0.13333333333333333,0.13333333333333333],floralwhite:[1,0.9803921568627451,0.9411764705882353],forestgreen:[0.13333333333333333,0.5450980392156862,0.13333333333333333],gainsboro:[0.8627450980392157,0.8627450980392157,0.8627450980392157],ghostwhite:[0.9725490196078431,0.9725490196078431,1],gold:[1,0.8431372549019608,0],goldenrod:[0.8549019607843137,0.6470588235294118,0.12549019607843137],greenyellow:[0.6784313725490196,1,0.1843137254901961],grey:[0.5019607843137255,0.5019607843137255,0.5019607843137255],honeydew:[0.9411764705882353,1,0.9411764705882353],hotpink:[1,0.4117647058823529,0.7058823529411765],indianred:[0.803921568627451,0.3607843137254902,0.3607843137254902],indigo:[0.29411764705882354,0,0.5098039215686274],ivory:[1,1,0.9411764705882353],khaki:[0.9411764705882353,0.9019607843137255,0.5490196078431373],lavender:[0.9019607843137255,0.9019607843137255,0.9803921568627451],lavenderblush:[1,0.9411764705882353,0.9607843137254902],lawngreen:[0.48627450980392156,0.9882352941176471,0],lemonchiffon:[1,0.9803921568627451,0.803921568627451],lightblue:[0.6784313725490196,0.8470588235294118,0.9019607843137255],lightcoral:[0.9411764705882353,0.5019607843137255,0.5019607843137255],lightcyan:[0.8784313725490196,1,1],lightgoldenrodyellow:[0.9803921568627451,0.9803921568627451,0.8235294117647058],lightgray:[0.8274509803921568,0.8274509803921568,0.8274509803921568],lightgreen:[0.5647058823529412,0.9333333333333333,0.5647058823529412],lightgrey:[0.8274509803921568,0.8274509803921568,0.8274509803921568],lightpink:[1,0.7137254901960784,0.7568627450980392],lightsalmon:[1,0.6274509803921569,0.47843137254901963],lightseagreen:[0.12549019607843137,0.6980392156862745,0.6666666666666666],lightskyblue:[0.5294117647058824,0.807843137254902,0.9803921568627451],lightslategray:[0.4666666666666667,0.5333333333333333,0.6],lightslategrey:[0.4666666666666667,0.5333333333333333,0.6],lightsteelblue:[0.6901960784313725,0.7686274509803922,0.8705882352941177],lightyellow:[1,1,0.8784313725490196],limegreen:[0.19607843137254902,0.803921568627451,0.19607843137254902],linen:[0.9803921568627451,0.9411764705882353,0.9019607843137255],magenta:[1,0,1],mediumaquamarine:[0.4,0.803921568627451,0.6666666666666666],mediumblue:[0,0,0.803921568627451],mediumorchid:[0.7294117647058823,0.3333333333333333,0.8274509803921568],mediumpurple:[0.5764705882352941,0.4392156862745098,0.8588235294117647],mediumseagreen:[0.23529411764705882,0.7019607843137254,0.44313725490196076],mediumslateblue:[0.4823529411764706,0.40784313725490196,0.9333333333333333],mediumspringgreen:[0,0.9803921568627451,0.6039215686274509],mediumturquoise:[0.2823529411764706,0.8196078431372549,0.8],mediumvioletred:[0.7803921568627451,0.08235294117647059,0.5215686274509804],midnightblue:[0.09803921568627451,0.09803921568627451,0.4392156862745098],mintcream:[0.9607843137254902,1,0.9803921568627451],mistyrose:[1,0.8941176470588236,0.8823529411764706],moccasin:[1,0.8941176470588236,0.7098039215686275],navajowhite:[1,0.8705882352941177,0.6784313725490196],oldlace:[0.9921568627450981,0.9607843137254902,0.9019607843137255],olivedrab:[0.4196078431372549,0.5568627450980392,0.13725490196078433],orange:[1,0.6470588235294118,0],orangered:[1,0.27058823529411763,0],orchid:[0.8549019607843137,0.4392156862745098,0.8392156862745098],palegoldenrod:[0.9333333333333333,0.9098039215686274,0.6666666666666666],palegreen:[0.596078431372549,0.984313725490196,0.596078431372549],paleturquoise:[0.6862745098039216,0.9333333333333333,0.9333333333333333],palevioletred:[0.8588235294117647,0.4392156862745098,0.5764705882352941],papayawhip:[1,0.9372549019607843,0.8352941176470589],peachpuff:[1,0.8549019607843137,0.7254901960784313],peru:[0.803921568627451,0.5215686274509804,0.24705882352941178],pink:[1,0.7529411764705882,0.796078431372549],plum:[0.8666666666666667,0.6274509803921569,0.8666666666666667],powderblue:[0.6901960784313725,0.8784313725490196,0.9019607843137255],rosybrown:[0.7372549019607844,0.5607843137254902,0.5607843137254902],royalblue:[0.2549019607843137,0.4117647058823529,0.8823529411764706],saddlebrown:[0.5450980392156862,0.27058823529411763,0.07450980392156863],salmon:[0.9803921568627451,0.5019607843137255,0.4470588235294118],sandybrown:[0.9568627450980393,0.6431372549019608,0.3764705882352941],seagreen:[0.1803921568627451,0.5450980392156862,0.3411764705882353],seashell:[1,0.9607843137254902,0.9333333333333333],sienna:[0.6274509803921569,0.3215686274509804,0.17647058823529413],skyblue:[0.5294117647058824,0.807843137254902,0.9215686274509803],slateblue:[0.41568627450980394,0.35294117647058826,0.803921568627451],slategray:[0.4392156862745098,0.5019607843137255,0.5647058823529412],slategrey:[0.4392156862745098,0.5019607843137255,0.5647058823529412],snow:[1,0.9803921568627451,0.9803921568627451],springgreen:[0,1,0.4980392156862745],steelblue:[0.27450980392156865,0.5098039215686274,0.7058823529411765],tan:[0.8235294117647058,0.7058823529411765,0.5490196078431373],thistle:[0.8470588235294118,0.7490196078431373,0.8470588235294118],tomato:[1,0.38823529411764707,0.2784313725490196],turquoise:[0.25098039215686274,0.8784313725490196,0.8156862745098039],violet:[0.9333333333333333,0.5098039215686274,0.9333333333333333],wheat:[0.9607843137254902,0.8705882352941177,0.7019607843137254],whitesmoke:[0.9607843137254902,0.9607843137254902,0.9607843137254902],yellowgreen:[0.6039215686274509,0.803921568627451,0.19607843137254902]};ODn.exports=Sfi});var YDn=lt(function(maa,VDn){var Pfi=Rct(),Efi=(e)=>Pfi[e.toLowerCase()];VDn.exports=Efi});var UDn=lt(function(_aa,GDn){var Mfi=(e)=>{if(e=e.replace("#",""),e.length<6)throw Error("the given notation must contain 3 or more hex values");let t=parseInt(e.substring(0,2),16)/255,n=parseInt(e.substring(2,4),16)/255,o=parseInt(e.substring(4,6),16)/255;if(e.length>=8){let r=parseInt(e.substring(6,8),16)/255;return[t,n,o,r]}return[t,n,o]};GDn.exports=Mfi});var Qct=lt(function(gaa,WDn){var wfi=(e,t,n)=>{if(n<0)n+=1;if(n>1)n-=1;if(n<0.16666666666666666)return e+(t-e)*6*n;if(n<0.5)return t;if(n<0.6666666666666666)return e+(t-e)*(0.6666666666666666-n)*6;return e};WDn.exports=wfi});var jDn=lt(function(Aaa,XDn){var Bfi=ms(),kct=Qct(),Tfi=(...e)=>{if(e=Bfi(e),e.length<3)throw Error("values must contain H, S and L values");let t=e[0],n=e[1],o=e[2],r=o,i=o,s=o;if(n!==0){let a=o<0.5?o*(1+n):o+n-o*n,c=2*o-a;r=kct(c,a,t+0.3333333333333333),i=kct(c,a,t),s=kct(c,a,t-0.3333333333333333)}if(e.length>3){let a=e[3];return[r,i,s,a]}return[r,i,s]};XDn.exports=Tfi});var $Dn=lt(function(faa,KDn){var Dfi=ms(),Nfi=(...e)=>{if(e=Dfi(e),e.length<3)throw Error("values must contain H, S and V values");let t=e[0],n=e[1],o=e[2],r=0,i=0,s=0,a=Math.floor(t*6),c=t*6-a,l=o*(1-n),h=o*(1-c*n),d=o*(1-(1-c)*n);switch(a%6){case 0:r=o,i=d,s=l;break;case 1:r=h,i=o,s=l;break;case 2:r=l,i=o,s=d;break;case 3:r=l,i=h,s=o;break;case 4:r=d,i=l,s=o;break;case 5:r=o,i=l,s=h;break}if(e.length>3){let u=e[3];return[r,i,s,u]}return[r,i,s]};KDn.exports=Nfi});var JDn=lt(function(yaa,qDn){var Rfi=ms(),Qfi=(...e)=>{if(e=Rfi(e),e.length<3)throw Error("values must contain R, G and B values");let t=e[0]*255,n=e[1]*255,o=e[2]*255,r=`#${Number(16777216+t*65536+n*256+o).toString(16).substring(1,7)}`;if(e.length>3)r=r+Number(e[3]*255).toString(16);return r};qDn.exports=Qfi});var eNn=lt(function(xaa,ZDn){var kfi=ms(),Lfi=(...e)=>{if(e=kfi(e),e.length<3)throw Error("values must contain R, G and B values");let t=e[0],n=e[1],o=e[2],r=Math.max(t,n,o),i=Math.min(t,n,o),s,a,c=(r+i)/2;if(r===i)s=a=0;else{let l=r-i;switch(a=c>0.5?l/(2-r-i):l/(r+i),r){case t:s=(n-o)/l+(n<o?6:0);break;case n:s=(o-t)/l+2;break;case o:s=(t-n)/l+4;break}s/=6}if(e.length>3){let l=e[3];return[s,a,c,l]}return[s,a,c]};ZDn.exports=Lfi});var nNn=lt(function(Caa,tNn){var Hfi=ms(),Ffi=(...e)=>{if(e=Hfi(e),e.length<3)throw Error("values must contain R, G and B values");let t=e[0],n=e[1],o=e[2],r=Math.max(t,n,o),i=Math.min(t,n,o),s,a=r,c=r-i,l=r===0?0:c/r;if(r===i)s=0;else{switch(r){case t:s=(n-o)/c+(n<o?6:0);break;case n:s=(o-t)/c+2;break;case o:s=(t-n)/c+4;break}s/=6}if(e.length>3){let h=e[3];return[s,l,a,h]}return[s,l,a]};tNn.exports=Ffi});var rNn=lt(function(baa,oNn){oNn.exports={colorize:zDn(),colorNameToRgb:YDn(),cssColors:Rct(),hexToRgb:UDn(),hslToRgb:jDn(),hsvToRgb:$Dn(),hueToColorComponent:Qct(),rgbToHex:JDn(),rgbToHsl:eNn(),rgbToHsv:nNn()}});var aNn=lt(function(Iaa,sNn){var zfi=(e)=>{if(!Array.isArray(e))throw Error("Bezier points must be a valid array/");if(e.length<2)throw Error("Bezier points must contain at least 2 values.");let t=Ofi(e);return{points:e,pointType:t,dimensions:t==="float_single"?0:e[0].length,permutations:iNn(e.length-1),tangentPermutations:iNn(e.length-2)}},Ofi=function(e){let t=null;return e.forEach((n)=>{let o="";if(Number.isFinite(n))o="float_single";else if(Array.isArray(n))n.forEach((r)=>{if(!Number.isFinite(r))throw Error("Bezier point values must all be numbers.")}),o="float_"+n.length;else throw Error("Bezier points must all be numbers or arrays of number.");if(t==null)t=o;else if(t!==o)throw Error("Bezier points must be either all numbers or all arrays of numbers of the same size.")}),t},iNn=function(e){let t=[];for(let n=0;n<=e;n++)t.push(Lct(e)/(Lct(n)*Lct(e-n)));return t},Lct=function(e){let t=1;for(let n=2;n<=e;n++)t*=n;return t};sNn.exports=zfi});var Hct=lt(function(vaa,lNn){var Vfi=(e,t)=>{if(e<0||e>1)throw Error("Bezier valueAt() input must be between 0 and 1");if(t.pointType==="float_single")return cNn(t,t.points,e);else{let n=[];for(let o=0;o<t.dimensions;o++){let r=[];for(let i=0;i<t.points.length;i++)r.push(t.points[i][o]);n.push(cNn(t,r,e))}return n}},cNn=function(e,t,n){let o=t.length-1,r=0;for(let i=0;i<=o;i++)r+=e.permutations[i]*Math.pow(1-n,o-i)*Math.pow(n,i)*t[i];return r};lNn.exports=Vfi});var uNn=lt(function(Saa,dNn){var Yfi=(e,t)=>{if(e<0||e>1)throw Error("Bezier tangentAt() input must be between 0 and 1");if(t.pointType==="float_single")return hNn(t,t.points,e);else{let n=[];for(let o=0;o<t.dimensions;o++){let r=[];for(let i=0;i<t.points.length;i++)r.push(t.points[i][o]);n.push(hNn(t,r,e))}return n}},hNn=function(e,t,n){let o=t.length-1,r=0;for(let i=0;i<o;i++){let s=o*(t[i+1]-t[i]);r+=e.tangentPermutations[i]*Math.pow(1-n,o-1-i)*Math.pow(n,i)*s}return r};dNn.exports=Yfi});var rSe=lt(function(Paa,mNn){var pNn=Hct(),Gfi=(e,t)=>{let n=0,o=[0],r=pNn(0,t);for(let i=1;i<=e;i++){let s=pNn(i/e,t);n+=Ufi(s,r),o.push(n),r=s}return o},Ufi=(e,t)=>{if(Number.isFinite(e)&&Number.isFinite(t))return Math.abs(e-t);else if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)throw Error("The operands must have the same number of dimensions.");let n=0;for(let o=0;o<e.length;o++)n+=(t[o]-e[o])*(t[o]-e[o]);return Math.sqrt(n)}else throw Error("The operands must be of the same type, either number or array.")};mNn.exports=Gfi});var gNn=lt(function(Eaa,_Nn){var Wfi=rSe(),Xfi=(e,t)=>Wfi(e,t)[e];_Nn.exports=Xfi});var fNn=lt(function(Maa,ANn){var jfi=rSe(),Kfi=(e,t)=>{let n={distance:0,segments:100},{distance:o,segments:r}=Object.assign({},n,e),i=jfi(r,t),s=0,a=r;while(s<=a){let _=Math.floor(s+(a-s)/2),p=i[_]-o;if(p<0)s=_+1;else if(p>0)a=_-1;else{a=_;break}}let c=a;if(i[c]===o)return c/r;let l=i[c],d=i[c+1]-l,u=(o-l)/d;return(c+u)/r};ANn.exports=Kfi});var xNn=lt(function(waa,yNn){yNn.exports={create:aNn(),valueAt:Hct(),tangentAt:uNn(),lengths:rSe(),length:gNn(),arcLengthToT:fNn()}});var bNn=lt(function(Baa,CNn){CNn.exports={bezier:xNn()}});var n0e=lt(function(Taa,INn){var $fi=(e)=>{let t=0;for(let n=0;n<e.length;n++){let o=(n+1)%e.length;t+=e[n][0]*e[o][1],t-=e[o][0]*e[n][1]}return t/2};INn.exports=$fi});var Fct=lt(function(Daa,vNn){var qfi=n0e(),Jfi=(e)=>qfi(e.vertices);vNn.exports=Jfi});var zct=lt(function(Naa,SNn){var Zfi=(e)=>{if(e===void 0||e.length<3)e=[];return{vertices:e}};SNn.exports=Zfi});var Oct=lt(function(Raa,PNn){var e2i=zct(),t2i=(e)=>{let t=e.vertices.slice().reverse();return e2i(t)};PNn.exports=t2i});var MNn=lt(function(Qaa,ENn){var n2i=Fct(),o2i=Oct(),r2i=(e,t)=>{if(e.length===0)return 0;let n=t.vertices;if(n.length<3)return 0;if(n2i(t)<0)t=o2i(t);return e.reduce((r,i)=>r+i2i(i,n),0)===e.length?1:0},i2i=(e,t)=>{let n=t.length,o=e[0],r=e[1],i=t[n-1],s=t[0],a=i[1]>r,c=0,l=0;for(let h=n+1;--h;){let d=s[1]>r;if(a!==d){let u=i[0]>o,_=s[0]>o;if(u&&_)c=!c;else if(s[0]-(s[1]-r)*(i[0]-s[0])/(i[1]-s[1])>=o)c=!c}a=d,i=s,s=t[++l]}return c};ENn.exports=r2i});var iSe=lt(function(kaa,wNn){wNn.exports={arePointsInside:MNn(),create:zct(),flip:Oct(),measureArea:Fct()}});var sSe=lt(function(Laa,BNn){BNn.exports={geom2:zs(),geom3:Ds(),path2:bh(),poly2:iSe(),poly3:za()}});var aSe=lt(function(Haa,TNn){var s2i=()=>[0,1,0];TNn.exports=s2i});var NNn=lt(function(Faa,DNn){var a2i=aSe(),c2i=(e)=>{let t=a2i();return t[0]=e[0],t[1]=e[1],t[2]=e[2],t};DNn.exports=c2i});var cSe=lt(function(zaa,RNn){var Vct=da(),l2i=(e)=>{let t=Vct.normal(Vct.create(),e);return Vct.negate(t,t),t};RNn.exports=l2i});var o0e=lt(function(Oaa,kNn){var QNn=da(),h2i=(e)=>QNn.scale(QNn.create(),e,e[2]);kNn.exports=h2i});var HNn=lt(function(Vaa,LNn){var r0e=da(),d2i=cSe(),u2i=o0e(),p2i=(e,t)=>{let n=u2i(e),o=d2i(e),r=r0e.subtract(r0e.create(),t,n),i=r0e.dot(r,o);return r0e.scale(r,o,i),r0e.add(r,r,n),r};LNn.exports=p2i});var Yct=lt(function(Yaa,FNn){var m2i=(e,t)=>(e[0]=t[0],e[1]=t[1],e[2]=t[2],e);FNn.exports=m2i});var ONn=lt(function(Gaa,zNn){var _2i=da(),g2i=(e,t)=>{let n=_2i.dot(t,e);return n=Math.abs(n-e[2]),n};zNn.exports=g2i});var YNn=lt(function(Uaa,VNn){var A2i=(e,t)=>e[0]===t[0]&&(e[1]===t[1]&&e[2]===t[2]);VNn.exports=A2i});var Gct=lt(function(Waa,GNn){var i0e=da(),f2i=(e,t,n)=>{let o=i0e.subtract(i0e.create(),n,t);i0e.normal(o,o),i0e.normalize(o,o);let r=i0e.dot(t,o);return e[0]=o[0],e[1]=o[1],e[2]=r,e};GNn.exports=f2i});var Uct=lt(function(Xaa,UNn){var y2i=aSe(),x2i=(e,t,n)=>{let o=y2i();return o[0]=e,o[1]=t,o[2]=n,o};UNn.exports=x2i});var lSe=lt(function(jaa,WNn){var{NEPS:Wct}=rc(),C2i=(e,t)=>Math.abs(e[0]-t[0])<=Wct&&Math.abs(e[1]-t[1])<=Wct&&Math.abs(e[2]-t[2])<=Wct;WNn.exports=C2i});var Xct=lt(function(Kaa,XNn){var b2i=(e,t,n)=>{let o=n-e[1],r=t[1]-e[1];if(r<0)o=-o,r=-r;let i;if(o<=0)i=0;else if(o>=r)i=1;else if(r<0.0000000001)i=0.5;else i=o/r;return e[0]+i*(t[0]-e[0])};XNn.exports=b2i});var jct=lt(function($aa,jNn){var I2i=(e,t,n,o)=>{if(e[0]===t[0]&&e[1]===t[1]||n[0]===o[0]&&n[1]===o[1])return;let r=(o[1]-n[1])*(t[0]-e[0])-(o[0]-n[0])*(t[1]-e[1]);if(Math.abs(r)<Number.MIN_VALUE)return;let i=((o[0]-n[0])*(e[1]-n[1])-(o[1]-n[1])*(e[0]-n[0]))/r,s=((t[0]-e[0])*(e[1]-n[1])-(t[1]-e[1])*(e[0]-n[0]))/r;if(i<0||i>1||s<0||s>1)return;let a=e[0]+i*(t[0]-e[0]),c=e[1]+i*(t[1]-e[1]);return[a,c]};jNn.exports=I2i});var $Nn=lt(function(qaa,KNn){var v2i=(e,t,n,o,r,i)=>{let a=1/(e*o-t*n),c=r*o-t*i,l=-r*n+e*i;return c*=a,l*=a,[c,l]};KNn.exports=v2i});var GZ=lt(function(Jaa,qNn){qNn.exports={aboutEqualNormals:lSe(),area:n0e(),cos:BA().cos,interpolateBetween2DPointsForY:Xct(),intersect:jct(),sin:BA().sin,solve2Linear:$Nn()}});var ZNn=lt(function(Zaa,JNn){var S2i=da(),{solve2Linear:P2i}=GZ(),E2i=(e,t)=>{let n=P2i(e[0],e[1],t[0],t[1],e[2],t[2]);return S2i.clone(n)};JNn.exports=E2i});var nRn=lt(function(eca,tRn){var eRn=da(),M2i=Yct(),w2i=Uct(),B2i=(e,t)=>{let n=eRn.negate(eRn.create(),t),o=-t[2];return M2i(e,w2i(n[0],n[1],o))};tRn.exports=B2i});var rRn=lt(function(tca,oRn){var T2i=(e)=>`line2: (${e[0].toFixed(7)}, ${e[1].toFixed(7)}, ${e[2].toFixed(7)})`;oRn.exports=T2i});var aRn=lt(function(nca,sRn){var iRn=da(),D2i=Gct(),N2i=o0e(),R2i=cSe(),Q2i=(e,t,n)=>{let o=N2i(t),r=R2i(t);return iRn.transform(o,o,n),iRn.transform(r,r,n),D2i(e,o,r)};sRn.exports=Q2i});var lRn=lt(function(oca,cRn){var k2i=o0e(),L2i=(e,t)=>{let n=(e[2]-e[1]*t)/e[0];if(Number.isNaN(n))n=k2i(e)[0];return n};cRn.exports=L2i});var hSe=lt(function(rca,hRn){hRn.exports={clone:NNn(),closestPoint:HNn(),copy:Yct(),create:aSe(),direction:cSe(),distanceToPoint:ONn(),equals:YNn(),fromPoints:Gct(),fromValues:Uct(),intersectPointOfLines:ZNn(),origin:o0e(),reverse:nRn(),toString:rRn(),transform:aRn(),xAtY:lRn()}});var Kct=lt(function(ica,uRn){var dRn=si(),H2i=()=>[dRn.fromValues(0,0,0),dRn.fromValues(0,0,1)];uRn.exports=H2i});var _Rn=lt(function(sca,mRn){var pRn=si(),F2i=Kct(),z2i=(e)=>{let t=F2i();return pRn.copy(t[0],e[0]),pRn.copy(t[1],e[1]),t};mRn.exports=z2i});var $ct=lt(function(aca,gRn){var tG=si(),O2i=(e,t)=>{let n=e[0],o=e[1],r=tG.dot(tG.subtract(tG.create(),t,n),o),i=tG.dot(o,o),s=r/i,a=tG.scale(tG.create(),o,s);return tG.add(a,a,n),a};gRn.exports=O2i});var yRn=lt(function(cca,fRn){var ARn=si(),V2i=(e,t)=>(ARn.copy(e[0],t[0]),ARn.copy(e[1],t[1]),e);fRn.exports=V2i});var CRn=lt(function(lca,xRn){var Y2i=(e)=>e[1];xRn.exports=Y2i});var IRn=lt(function(hca,bRn){var qct=si(),G2i=$ct(),U2i=(e,t)=>{let n=G2i(e,t),o=qct.subtract(qct.create(),t,n);return qct.length(o)};bRn.exports=U2i});var PRn=lt(function(dca,SRn){var vRn=si(),W2i=(e,t)=>{if(!vRn.equals(e[1],t[1]))return!1;if(!vRn.equals(e[0],t[0]))return!1;return!0};SRn.exports=W2i});var UZ=lt(function(uca,ERn){var dSe=si(),X2i=(e,t,n)=>{let o=dSe.normalize(dSe.create(),n);return dSe.copy(e[0],t),dSe.copy(e[1],o),e};ERn.exports=X2i});var wRn=lt(function(pca,MRn){var nG=si(),{solve2Linear:Jct}=GZ(),{EPS:j2i}=rc(),K2i=UZ(),$2i=(e,t,n)=>{let o=nG.cross(nG.create(),t,n),r=nG.length(o);if(r<j2i)throw Error("parallel planes do not intersect");r=1/r,o=nG.scale(o,o,r);let i=Math.abs(o[0]),s=Math.abs(o[1]),a=Math.abs(o[2]),c,l;if(i>=s&&i>=a)l=Jct(t[1],t[2],n[1],n[2],t[3],n[3]),c=nG.fromValues(0,l[0],l[1]);else if(s>=i&&s>=a)l=Jct(t[0],t[2],n[0],n[2],t[3],n[3]),c=nG.fromValues(l[0],0,l[1]);else l=Jct(t[0],t[1],n[0],n[1],t[3],n[3]),c=nG.fromValues(l[0],l[1],0);return K2i(e,c,o)};MRn.exports=$2i});var DRn=lt(function(mca,TRn){var BRn=si(),q2i=UZ(),J2i=(e,t,n)=>{let o=BRn.subtract(BRn.create(),n,t);return q2i(e,t,o)};TRn.exports=J2i});var RRn=lt(function(_ca,NRn){var WZ=si(),Z2i=(e,t)=>{let n=t,o=t[3],r=e[0],i=e[1],s=(o-WZ.dot(n,r))/WZ.dot(n,i);return WZ.add(WZ.create(),r,WZ.scale(WZ.create(),i,s))};NRn.exports=Z2i});var kRn=lt(function(gca,QRn){var e1i=(e)=>e[0];QRn.exports=e1i});var HRn=lt(function(Aca,LRn){var Zct=si(),t1i=UZ(),n1i=(e,t)=>{let n=Zct.clone(t[0]),o=Zct.negate(Zct.create(),t[1]);return t1i(e,n,o)};LRn.exports=n1i});var zRn=lt(function(fca,FRn){var o1i=(e)=>{let t=e[0],n=e[1];return`line3: point: (${t[0].toFixed(7)}, ${t[1].toFixed(7)}, ${t[2].toFixed(7)}) direction: (${n[0].toFixed(7)}, ${n[1].toFixed(7)}, ${n[2].toFixed(7)})`};FRn.exports=o1i});var VRn=lt(function(yca,ORn){var XZ=si(),r1i=UZ(),i1i=(e,t,n)=>{let o=t[0],r=t[1],i=XZ.add(XZ.create(),o,r),s=XZ.transform(XZ.create(),o,n),a=XZ.transform(i,i,n),c=XZ.subtract(a,a,s);return r1i(e,s,c)};ORn.exports=i1i});var GRn=lt(function(xca,YRn){YRn.exports={clone:_Rn(),closestPoint:$ct(),copy:yRn(),create:Kct(),direction:CRn(),distanceToPoint:IRn(),equals:PRn(),fromPlanes:wRn(),fromPointAndDirection:UZ(),fromPoints:DRn(),intersectPointOfLineAndPlane:RRn(),origin:kRn(),reverse:HRn(),toString:zRn(),transform:VRn()}});var WRn=lt(function(Cca,URn){URn.exports={constants:rc(),line2:hSe(),line3:GRn(),mat4:Fh(),plane:z9(),utils:GZ(),vec2:da(),vec3:si(),vec4:Mct()}});var elt=lt(function(bca,KRn){var s1i=ms(),XRn=zs(),jRn=Ds(),a1i=bh(),c1i=za(),uSe=new WeakMap,l1i=()=>0,h1i=(e)=>{let t=uSe.get(e);if(t)return t;return t=XRn.toSides(e).reduce((o,r)=>o+(r[0][0]*r[1][1]-r[0][1]*r[1][0]),0),t*=0.5,uSe.set(e,t),t},d1i=(e)=>{let t=uSe.get(e);if(t)return t;return t=jRn.toPolygons(e).reduce((o,r)=>o+c1i.measureArea(r),0),uSe.set(e,t),t},u1i=(...e)=>{if(e=s1i(e),e.length===0)throw Error("wrong number of arguments");let t=e.map((n)=>{if(a1i.isA(n))return l1i(n);if(XRn.isA(n))return h1i(n);if(jRn.isA(n))return d1i(n);return 0});return t.length===1?t[0]:t};KRn.exports=u1i});var qRn=lt(function(Ica,$Rn){var p1i=ms(),m1i=elt(),_1i=(...e)=>{if(e=p1i(e),e.length===0)throw Error("measureAggregateArea: no geometries supplied");let t=m1i(e);if(e.length===1)return t;let n=0;return t.reduce((o,r)=>o+r,n)};$Rn.exports=_1i});var $k=lt(function(vca,nQn){var g1i=ms(),sP=da(),s0e=si(),ZRn=zs(),eQn=Ds(),tQn=bh(),JRn=za(),jZ=new WeakMap,A1i=(e)=>{let t=jZ.get(e);if(t)return t;let n=tQn.toPoints(e),o;if(n.length===0)o=sP.create();else o=sP.clone(n[0]);let r=sP.clone(o);return n.forEach((i)=>{sP.min(o,o,i),sP.max(r,r,i)}),o=[o[0],o[1],0],r=[r[0],r[1],0],t=[o,r],jZ.set(e,t),t},f1i=(e)=>{let t=jZ.get(e);if(t)return t;let n=ZRn.toPoints(e),o;if(n.length===0)o=sP.create();else o=sP.clone(n[0]);let r=sP.clone(o);return n.forEach((i)=>{sP.min(o,o,i),sP.max(r,r,i)}),o=[o[0],o[1],0],r=[r[0],r[1],0],t=[o,r],jZ.set(e,t),t},y1i=(e)=>{let t=jZ.get(e);if(t)return t;let n=eQn.toPolygons(e),o=s0e.create();if(n.length>0){let i=JRn.toPoints(n[0]);s0e.copy(o,i[0])}let r=s0e.clone(o);return n.forEach((i)=>{JRn.toPoints(i).forEach((s)=>{s0e.min(o,o,s),s0e.max(r,r,s)})}),o=[o[0],o[1],o[2]],r=[r[0],r[1],r[2]],t=[o,r],jZ.set(e,t),t},x1i=(...e)=>{if(e=g1i(e),e.length===0)throw Error("wrong number of arguments");let t=e.map((n)=>{if(tQn.isA(n))return A1i(n);if(ZRn.isA(n))return f1i(n);if(eQn.isA(n))return y1i(n);return[[0,0,0],[0,0,0]]});return t.length===1?t[0]:t};nQn.exports=x1i});var pSe=lt(function(Sca,oQn){var C1i=ms(),b1i=qat(),I1i=$at(),v1i=$k(),S1i=(...e)=>{if(e=C1i(e),e.length===0)throw Error("measureAggregateBoundingBox: no geometries supplied");let t=v1i(e);if(e.length===1)return t;let n=[[Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE],[-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE]];return t.reduce((o,r)=>(o=[b1i(o[0],o[0],r[0]),I1i(o[1],o[1],r[1])],o),n)};oQn.exports=S1i});var tlt=lt(function(Pca,rQn){var{EPS:P1i}=rc(),E1i=(e,t)=>{let n=0;for(let o=0;o<t;o++)n+=e[1][o]-e[0][o];return P1i*n/t};rQn.exports=E1i});var sQn=lt(function(Eca,iQn){var M1i=ms(),w1i=pSe(),B1i=tlt(),{geom2:T1i,geom3:D1i,path2:N1i}=sSe(),R1i=(...e)=>{if(e=M1i(e),e.length===0)throw Error("measureAggregateEpsilon: no geometries supplied");let t=w1i(e),n=0;return n=e.reduce((o,r)=>{if(N1i.isA(r)||T1i.isA(r))return Math.max(o,2);if(D1i.isA(r))return Math.max(o,3);return 0},n),B1i(t,n)};iQn.exports=R1i});var nlt=lt(function(Mca,lQn){var Q1i=ms(),k1i=zs(),cQn=Ds(),L1i=bh(),H1i=za(),aQn=new WeakMap,F1i=()=>0,z1i=()=>0,O1i=(e)=>{let t=aQn.get(e);if(t)return t;return t=cQn.toPolygons(e).reduce((o,r)=>o+H1i.measureSignedVolume(r),0),aQn.set(e,t),t},V1i=(...e)=>{if(e=Q1i(e),e.length===0)throw Error("wrong number of arguments");let t=e.map((n)=>{if(L1i.isA(n))return F1i(n);if(k1i.isA(n))return z1i(n);if(cQn.isA(n))return O1i(n);return 0});return t.length===1?t[0]:t};lQn.exports=V1i});var dQn=lt(function(wca,hQn){var Y1i=ms(),G1i=nlt(),U1i=(...e)=>{if(e=Y1i(e),e.length===0)throw Error("measureAggregateVolume: no geometries supplied");let t=G1i(e);if(e.length===1)return t;let n=0;return t.reduce((o,r)=>o+r,n)};hQn.exports=U1i});var fQn=lt(function(Bca,AQn){var W1i=ms(),pQn=da(),i5=si(),mQn=zs(),_Qn=Ds(),gQn=bh(),uQn=za(),KZ=new WeakMap,X1i=(e)=>{let t=KZ.get(e);if(t!==void 0)return t;let n=i5.create(),o=0,r=gQn.toPoints(e);if(r.length>0){let i=0,s=i5.create();r.forEach((a)=>{i5.add(n,n,i5.fromVec2(s,a,0)),i++}),i5.scale(n,n,1/i),r.forEach((a)=>{o=Math.max(o,pQn.squaredDistance(n,a))}),o=Math.sqrt(o)}return t=[n,o],KZ.set(e,t),t},j1i=(e)=>{let t=KZ.get(e);if(t!==void 0)return t;let n=i5.create(),o=0,r=mQn.toSides(e);if(r.length>0){let i=0,s=i5.create();r.forEach((a)=>{i5.add(n,n,i5.fromVec2(s,a[0],0)),i++}),i5.scale(n,n,1/i),r.forEach((a)=>{o=Math.max(o,pQn.squaredDistance(n,a[0]))}),o=Math.sqrt(o)}return t=[n,o],KZ.set(e,t),t},K1i=(e)=>{let t=KZ.get(e);if(t!==void 0)return t;let n=i5.create(),o=0,r=_Qn.toPolygons(e);if(r.length>0){let i=0;r.forEach((s)=>{uQn.toPoints(s).forEach((a)=>{i5.add(n,n,a),i++})}),i5.scale(n,n,1/i),r.forEach((s)=>{uQn.toPoints(s).forEach((a)=>{o=Math.max(o,i5.squaredDistance(n,a))})}),o=Math.sqrt(o)}return t=[n,o],KZ.set(e,t),t},$1i=(...e)=>{e=W1i(e);let t=e.map((n)=>{if(gQn.isA(n))return X1i(n);if(mQn.isA(n))return j1i(n);if(_Qn.isA(n))return K1i(n);return[[0,0,0],0]});return t.length===1?t[0]:t};AQn.exports=$1i});var xQn=lt(function(Tca,yQn){var q1i=ms(),J1i=$k(),Z1i=(...e)=>{e=q1i(e);let t=e.map((n)=>{let o=J1i(n);return[o[0][0]+(o[1][0]-o[0][0])/2,o[0][1]+(o[1][1]-o[0][1])/2,o[0][2]+(o[1][2]-o[0][2])/2]});return t.length===1?t[0]:t};yQn.exports=Z1i});var vQn=lt(function(Dca,IQn){var eyi=ms(),aP=si(),CQn=zs(),bQn=Ds(),mSe=new WeakMap,tyi=(e)=>{let t=mSe.get(e);if(t!==void 0)return t;let n=CQn.toSides(e),o=0,r=0,i=0;if(n.length>0){for(let a=0;a<n.length;a++){let c=n[a][0],l=n[a][1],h=c[0]*l[1]-c[1]*l[0];o+=h,r+=(c[0]+l[0])*h,i+=(c[1]+l[1])*h}o/=2;let s=1/(o*6);r*=s,i*=s}return t=aP.fromValues(r,i,0),mSe.set(e,t),t},nyi=(e)=>{let t=mSe.get(e);if(t!==void 0)return t;t=aP.create();let n=bQn.toPolygons(e);if(n.length===0)return t;let o=0,r=aP.create();return n.forEach((i)=>{let s=i.vertices;for(let a=0;a<s.length-2;a++){aP.cross(r,s[a+1],s[a+2]);let c=aP.dot(s[0],r)/6;o+=c,aP.add(r,s[0],s[a+1]),aP.add(r,r,s[a+2]);let l=aP.scale(r,r,0.25*c);aP.add(t,t,l)}}),aP.scale(t,t,1/o),mSe.set(e,t),t},oyi=(...e)=>{e=eyi(e);let t=e.map((n)=>{if(CQn.isA(n))return tyi(n);if(bQn.isA(n))return nyi(n);return[0,0,0]});return t.length===1?t[0]:t};IQn.exports=oyi});var PQn=lt(function(Nca,SQn){var ryi=ms(),iyi=$k(),syi=(...e)=>{e=ryi(e);let t=e.map((n)=>{let o=iyi(n);return[o[1][0]-o[0][0],o[1][1]-o[0][1],o[1][2]-o[0][2]]});return t.length===1?t[0]:t};SQn.exports=syi});var EB=lt(function(Rca,EQn){var ayi=ms(),{geom2:cyi,geom3:lyi,path2:hyi}=sSe(),olt=tlt(),rlt=$k(),dyi=(e)=>olt(rlt(e),2),uyi=(e)=>olt(rlt(e),2),pyi=(e)=>olt(rlt(e),3),myi=(...e)=>{if(e=ayi(e),e.length===0)throw Error("wrong number of arguments");let t=e.map((n)=>{if(hyi.isA(n))return dyi(n);if(cyi.isA(n))return uyi(n);if(lyi.isA(n))return pyi(n);return 0});return t.length===1?t[0]:t};EQn.exports=myi});var wQn=lt(function(Qca,MQn){MQn.exports={measureAggregateArea:qRn(),measureAggregateBoundingBox:pSe(),measureAggregateEpsilon:sQn(),measureAggregateVolume:dQn(),measureArea:elt(),measureBoundingBox:$k(),measureBoundingSphere:fQn(),measureCenter:xQn(),measureCenterOfMass:vQn(),measureDimensions:PQn(),measureEpsilon:EB(),measureVolume:nlt()}});var __=lt(function(kca,BQn){var _yi=(e,t)=>{if(Array.isArray(e)&&e.length>=t)return e.every((n)=>Number.isFinite(n));return!1},gyi=(e,t)=>Number.isFinite(e)&&e>t,Ayi=(e,t)=>Number.isFinite(e)&&e>=t;BQn.exports={isNumberArray:_yi,isGT:gyi,isGTE:Ayi}});var NQn=lt(function(Lca,DQn){var{EPS:TQn,TAU:$Z}=rc(),MB=da(),fyi=bh(),{isGT:yyi,isGTE:ilt,isNumberArray:xyi}=__(),Cyi=(e)=>{let t={center:[0,0],radius:1,startAngle:0,endAngle:$Z,makeTangent:!1,segments:32},{center:n,radius:o,startAngle:r,endAngle:i,makeTangent:s,segments:a}=Object.assign({},t,e);if(!xyi(n,2))throw Error("center must be an array of X and Y values");if(!yyi(o,0))throw Error("radius must be greater than zero");if(!ilt(r,0))throw Error("startAngle must be positive");if(!ilt(i,0))throw Error("endAngle must be positive");if(!ilt(a,4))throw Error("segments must be four or more");r=r%$Z,i=i%$Z;let c=$Z;if(r<i)c=i-r;if(r>i)c=i+($Z-r);let l=Math.acos((o*o+o*o-TQn*TQn)/(2*o*o)),h=MB.clone(n),d,u=[];if(c<l)d=MB.fromAngleRadians(MB.create(),r),MB.scale(d,d,o),MB.add(d,d,h),u.push(d);else{let _=Math.floor(a*(Math.abs(c)/$Z)),p=_*0.5/c;if(p>0.25)p=0.25;let m=s?_+2:_;for(let A=0;A<=m;A++){let g=A;if(s){if(g=(A-1)*(_-2*p)/_+p,g<0)g=0;if(g>_)g=_}let f=r+g*(c/_);d=MB.fromAngleRadians(MB.create(),f),MB.scale(d,d,o),MB.add(d,d,h),u.push(d)}}return fyi.fromPoints({closed:!1},u)};DQn.exports=Cyi});var clt=lt(function(Hca,LQn){var{EPS:RQn,TAU:qk}=rc(),alt=da(),kQn=zs(),{sin:byi,cos:Iyi}=BA(),{isGTE:slt,isNumberArray:QQn}=__(),vyi=(e)=>{let t={center:[0,0],radius:[1,1],startAngle:0,endAngle:qk,segments:32},{center:n,radius:o,startAngle:r,endAngle:i,segments:s}=Object.assign({},t,e);if(!QQn(n,2))throw Error("center must be an array of X and Y values");if(!QQn(o,2))throw Error("radius must be an array of X and Y values");if(!o.every((_)=>_>=0))throw Error("radius values must be positive");if(!slt(r,0))throw Error("startAngle must be positive");if(!slt(i,0))throw Error("endAngle must be positive");if(!slt(s,3))throw Error("segments must be three or more");if(o[0]===0||o[1]===0)return kQn.create();r=r%qk,i=i%qk;let a=qk;if(r<i)a=i-r;if(r>i)a=i+(qk-r);let c=Math.min(o[0],o[1]),l=Math.acos((c*c+c*c-RQn*RQn)/(2*c*c));if(a<l)throw Error("startAngle and endAngle do not define a significant rotation");s=Math.floor(s*(a/qk));let h=alt.clone(n),d=a/s,u=[];s=a<qk?s+1:s;for(let _=0;_<s;_++){let p=d*_+r,m=alt.fromValues(o[0]*Iyi(p),o[1]*byi(p));alt.add(m,h,m),u.push(m)}if(a<qk)u.push(h);return kQn.fromPoints(u)};LQn.exports=vyi});var llt=lt(function(Fca,HQn){var{TAU:Syi}=rc(),Pyi=clt(),{isGTE:Eyi}=__(),Myi=(e)=>{let t={center:[0,0],radius:1,startAngle:0,endAngle:Syi,segments:32},{center:n,radius:o,startAngle:r,endAngle:i,segments:s}=Object.assign({},t,e);if(!Eyi(o,0))throw Error("radius must be positive");return o=[o,o],Pyi({center:n,radius:o,startAngle:r,endAngle:i,segments:s})};HQn.exports=Myi});var _Se=lt(function(zca,OQn){var FQn=Ds(),wyi=za(),{isNumberArray:zQn}=__(),Byi=(e)=>{let t={center:[0,0,0],size:[2,2,2]},{center:n,size:o}=Object.assign({},t,e);if(!zQn(n,3))throw Error("center must be an array of X, Y and Z values");if(!zQn(o,3))throw Error("size must be an array of width, depth and height values");if(!o.every((i)=>i>=0))throw Error("size values must be positive");if(o[0]===0||o[1]===0||o[2]===0)return FQn.create();return FQn.create([[[0,4,6,2],[-1,0,0]],[[1,3,7,5],[1,0,0]],[[0,1,5,4],[0,-1,0]],[[2,6,7,3],[0,1,0]],[[0,2,3,1],[0,0,-1]],[[4,5,7,6],[0,0,1]]].map((i)=>{let s=i[0].map((a)=>[n[0]+o[0]/2*(2*!!(a&1)-1),n[1]+o[1]/2*(2*!!(a&2)-1),n[2]+o[2]/2*(2*!!(a&4)-1)]);return wyi.create(s)}))};OQn.exports=Byi});var YQn=lt(function(Oca,VQn){var Tyi=_Se(),{isGTE:Dyi}=__(),Nyi=(e)=>{let t={center:[0,0,0],size:2},{center:n,size:o}=Object.assign({},t,e);if(!Dyi(o,0))throw Error("size must be positive");return o=[o,o,o],Tyi({center:n,size:o})};VQn.exports=Nyi});var ult=lt(function(Vca,UQn){var{EPS:GQn,TAU:Jk}=rc(),TA=si(),Ryi=Ds(),Qyi=za(),{sin:kyi,cos:Lyi}=BA(),{isGT:Hyi,isGTE:hlt,isNumberArray:dlt}=__(),Fyi=(e)=>{let t={center:[0,0,0],height:2,startRadius:[1,1],startAngle:0,endRadius:[1,1],endAngle:Jk,segments:32},{center:n,height:o,startRadius:r,startAngle:i,endRadius:s,endAngle:a,segments:c}=Object.assign({},t,e);if(!dlt(n,3))throw Error("center must be an array of X, Y and Z values");if(!Hyi(o,0))throw Error("height must be greater then zero");if(!dlt(r,2))throw Error("startRadius must be an array of X and Y values");if(!r.every((P)=>P>=0))throw Error("startRadius values must be positive");if(!dlt(s,2))throw Error("endRadius must be an array of X and Y values");if(!s.every((P)=>P>=0))throw Error("endRadius values must be positive");if(s.every((P)=>P===0)&&r.every((P)=>P===0))throw Error("at least one radius must be positive");if(!hlt(i,0))throw Error("startAngle must be positive");if(!hlt(a,0))throw Error("endAngle must be positive");if(!hlt(c,4))throw Error("segments must be four or more");i=i%Jk,a=a%Jk;let l=Jk;if(i<a)l=a-i;if(i>a)l=a+(Jk-i);let h=Math.min(r[0],r[1],s[0],s[1]),d=Math.acos((h*h+h*h-GQn*GQn)/(2*h*h));if(l<d)throw Error("startAngle and endAngle do not define a significant rotation");let u=Math.floor(c*(l/Jk)),_=TA.fromValues(0,0,-(o/2)),p=TA.fromValues(0,0,o/2),m=TA.subtract(TA.create(),p,_),A=TA.fromValues(1,0,0),g=TA.fromValues(0,1,0),f=TA.create(),y=TA.create(),x=TA.create(),C=(P,M,B)=>{let T=M*l+i;return TA.scale(f,A,B[0]*Lyi(T)),TA.scale(y,g,B[1]*kyi(T)),TA.add(f,f,y),TA.scale(x,m,P),TA.add(x,x,_),TA.add(TA.create(),f,x)},b=(...P)=>{let M=P.map((B)=>TA.add(TA.create(),B,n));return Qyi.create(M)},I=[];for(let P=0;P<u;P++){let M=P/u,B=(P+1)/u;if(l===Jk&&P===u-1)B=0;if(s[0]===r[0]&&s[1]===r[1])I.push(b(_,C(0,B,s),C(0,M,s))),I.push(b(C(0,B,s),C(1,B,s),C(1,M,s),C(0,M,s))),I.push(b(p,C(1,M,s),C(1,B,s)));else{if(r[0]>0&&r[1]>0)I.push(b(_,C(0,B,r),C(0,M,r)));if(r[0]>0||r[1]>0)I.push(b(C(0,M,r),C(0,B,r),C(1,M,s)));if(s[0]>0&&s[1]>0)I.push(b(p,C(1,M,s),C(1,B,s)));if(s[0]>0||s[1]>0)I.push(b(C(1,M,s),C(0,B,r),C(1,B,s)))}}if(l<Jk)I.push(b(_,C(0,0,r),p)),I.push(b(C(0,0,r),C(1,0,s),p)),I.push(b(_,p,C(0,1,r))),I.push(b(C(0,1,r),p,C(1,1,s)));return Ryi.create(I)};UQn.exports=Fyi});var plt=lt(function(Yca,WQn){var zyi=Ds(),Oyi=ult(),{isGTE:Vyi}=__(),Yyi=(e)=>{let t={center:[0,0,0],height:2,radius:1,segments:32},{center:n,height:o,radius:r,segments:i}=Object.assign({},t,e);if(!Vyi(r,0))throw Error("radius must be positive");if(o===0||r===0)return zyi.create();return Oyi({center:n,height:o,startRadius:[r,r],endRadius:[r,r],segments:i})};WQn.exports=Yyi});var mlt=lt(function(Gca,ZQn){var{TAU:XQn}=rc(),Ci=si(),jQn=Ds(),KQn=za(),{sin:$Qn,cos:qQn}=BA(),{isGTE:Gyi,isNumberArray:JQn}=__(),Uyi=(e)=>{let t={center:[0,0,0],radius:[1,1,1],segments:32,axes:[[1,0,0],[0,-1,0],[0,0,1]]},{center:n,radius:o,segments:r,axes:i}=Object.assign({},t,e);if(!JQn(n,3))throw Error("center must be an array of X, Y and Z values");if(!JQn(o,3))throw Error("radius must be an array of X, Y and Z values");if(!o.every((p)=>p>=0))throw Error("radius values must be positive");if(!Gyi(r,4))throw Error("segments must be four or more");if(o[0]===0||o[1]===0||o[2]===0)return jQn.create();let s=Ci.scale(Ci.create(),Ci.normalize(Ci.create(),i[0]),o[0]),a=Ci.scale(Ci.create(),Ci.normalize(Ci.create(),i[1]),o[1]),c=Ci.scale(Ci.create(),Ci.normalize(Ci.create(),i[2]),o[2]),l=Math.round(r/4),h,d=[],u=Ci.create(),_=Ci.create();for(let p=0;p<=r;p++){let m=XQn*p/r,A=Ci.add(Ci.create(),Ci.scale(u,s,qQn(m)),Ci.scale(_,a,$Qn(m)));if(p>0){let g,f;for(let y=0;y<=l;y++){let x=XQn/4*y/l,C=qQn(x),b=$Qn(x);if(y>0){let I=[],v;if(v=Ci.subtract(Ci.create(),Ci.scale(u,h,g),Ci.scale(_,c,f)),I.push(Ci.add(v,v,n)),v=Ci.subtract(Ci.create(),Ci.scale(u,A,g),Ci.scale(_,c,f)),I.push(Ci.add(v,v,n)),y<l)v=Ci.subtract(Ci.create(),Ci.scale(u,A,C),Ci.scale(_,c,b)),I.push(Ci.add(v,v,n));if(v=Ci.subtract(Ci.create(),Ci.scale(u,h,C),Ci.scale(_,c,b)),I.push(Ci.add(v,v,n)),d.push(KQn.create(I)),I=[],v=Ci.add(Ci.create(),Ci.scale(u,h,g),Ci.scale(_,c,f)),I.push(Ci.add(Ci.create(),n,v)),v=Ci.add(v,Ci.scale(u,A,g),Ci.scale(_,c,f)),I.push(Ci.add(Ci.create(),n,v)),y<l)v=Ci.add(v,Ci.scale(u,A,C),Ci.scale(_,c,b)),I.push(Ci.add(Ci.create(),n,v));v=Ci.add(v,Ci.scale(u,h,C),Ci.scale(_,c,b)),I.push(Ci.add(Ci.create(),n,v)),I.reverse(),d.push(KQn.create(I))}g=C,f=b}}h=A}return jQn.create(d)};ZQn.exports=Uyi});var _lt=lt(function(Uca,tkn){var Wyi=Ds(),Xyi=za(),{isNumberArray:ekn}=__(),jyi=(e)=>{let t={points:[],faces:[],colors:void 0,orientation:"outward"},{points:n,faces:o,colors:r,orientation:i}=Object.assign({},t,e);if(!(Array.isArray(n)&&Array.isArray(o)))throw Error("points and faces must be arrays");if(n.length<3)throw Error("three or more points are required");if(o.length<1)throw Error("one or more faces are required");if(r){if(!Array.isArray(r))throw Error("colors must be an array");if(r.length!==o.length)throw Error("faces and colors must have the same length")}if(n.forEach((a,c)=>{if(!ekn(a,3))throw Error(`point ${c} must be an array of X, Y, Z values`)}),o.forEach((a,c)=>{if(a.length<3)throw Error(`face ${c} must contain 3 or more indexes`);if(!ekn(a,a.length))throw Error(`face ${c} must be an array of numbers`)}),i!=="outward")o.forEach((a)=>a.reverse());let s=o.map((a,c)=>{let l=Xyi.create(a.map((h)=>n[h]));if(r&&r[c])l.color=r[c];return l});return Wyi.create(s)};tkn.exports=jyi});var akn=lt(function(Wca,skn){var rkn=Fh(),nkn=si(),ikn=Ds(),Kyi=_lt(),{isGTE:okn}=__(),$yi=(e)=>{let t={radius:1,frequency:6},{radius:n,frequency:o}=Object.assign({},t,e);if(!okn(n,0))throw Error("radius must be positive");if(!okn(o,6))throw Error("frequency must be six or more");if(n===0)return ikn.create();o=Math.floor(o/6);let r=[[0.850651,0,-0.525731],[0.850651,-0,0.525731],[-0.850651,-0,0.525731],[-0.850651,0,-0.525731],[0,-0.525731,0.850651],[0,0.525731,0.850651],[0,0.525731,-0.850651],[0,-0.525731,-0.850651],[-0.525731,-0.850651,-0],[0.525731,-0.850651,-0],[0.525731,0.850651,0],[-0.525731,0.850651,0]],i=[[0,9,1],[1,10,0],[6,7,0],[10,6,0],[7,9,0],[5,1,4],[4,1,9],[5,10,1],[2,8,3],[3,11,2],[2,5,4],[4,8,2],[2,11,5],[3,7,6],[6,11,3],[8,7,3],[9,8,4],[11,10,5],[10,11,6],[8,9,7]],s=(u,_,p)=>{let m=u[0],A=u[1],g=u[2],f=p,y=[],x=[];for(let C=0;C<_;C++)for(let b=0;b<_-C;b++){let I=C/_,v=(C+1)/_,P=b/(_-C),M=(b+1)/(_-C),B=_-C-1?b/(_-C-1):1,T=[];T[0]=a(a(m,A,P),g,I),T[1]=a(a(m,A,M),g,I),T[2]=a(a(m,A,B),g,v);for(let N=0;N<3;N++){let D=nkn.length(T[N]);for(let L=0;L<3;L++)T[N][L]/=D}if(y.push(T[0],T[1],T[2]),x.push([f,f+1,f+2]),f+=3,b<_-C-1){let N=_-C-1?(b+1)/(_-C-1):1;T[0]=a(a(m,A,M),g,I),T[1]=a(a(m,A,N),g,v),T[2]=a(a(m,A,B),g,v);for(let D=0;D<3;D++){let L=nkn.length(T[D]);for(let H=0;H<3;H++)T[D][H]/=L}y.push(T[0],T[1],T[2]),x.push([f,f+1,f+2]),f+=3}}return{points:y,triangles:x,offset:f}},a=(u,_,p)=>{let m=1-p,A=[];for(let g=0;g<3;g++)A[g]=u[g]*m+_[g]*p;return A},c=[],l=[],h=0;for(let u=0;u<i.length;u++){let _=s([r[i[u][0]],r[i[u][1]],r[i[u][2]]],o,h);c=c.concat(_.points),l=l.concat(_.triangles),h=_.offset}let d=Kyi({points:c,faces:l,orientation:"inward"});if(n!==1)d=ikn.transform(rkn.fromScaling(rkn.create(),[n,n,n]),d);return d};skn.exports=$yi});var lkn=lt(function(Xca,ckn){var qyi=bh(),Jyi=(e)=>{if(!Array.isArray(e))throw Error("points must be an array");return qyi.fromPoints({},e)};ckn.exports=Jyi});var dkn=lt(function(jca,hkn){var gSe=zs(),Zyi=(e)=>{let t={points:[],paths:[],orientation:"counterclockwise"},{points:n,paths:o,orientation:r}=Object.assign({},t,e);if(!(Array.isArray(n)&&Array.isArray(o)))throw Error("points and paths must be arrays");let i=n;if(Array.isArray(n[0])){if(!Array.isArray(n[0][0]))i=[n]}i.forEach((h,d)=>{if(!Array.isArray(h))throw Error("list of points "+d+" must be an array");if(h.length<3)throw Error("list of points "+d+" must contain three or more points");h.forEach((u,_)=>{if(!Array.isArray(u))throw Error("list of points "+d+", point "+_+" must be an array");if(u.length<2)throw Error("list of points "+d+", point "+_+" must contain by X and Y values")})});let s=o;if(o.length===0){let h=0;s=i.map((d)=>d.map((u)=>h++))}let a=[];i.forEach((h)=>h.forEach((d)=>a.push(d)));let c=[];s.forEach((h)=>{let d=h.map((_)=>a[_]),u=gSe.fromPoints(d);c=c.concat(gSe.toSides(u))});let l=gSe.create(c);if(r==="clockwise")l=gSe.reverse(l);return l};hkn.exports=Zyi});var ASe=lt(function(Kca,mkn){var Zk=da(),pkn=zs(),{isNumberArray:ukn}=__(),exi=(e)=>{let t={center:[0,0],size:[2,2]},{center:n,size:o}=Object.assign({},t,e);if(!ukn(n,2))throw Error("center must be an array of X and Y values");if(!ukn(o,2))throw Error("size must be an array of X and Y values");if(!o.every((a)=>a>=0))throw Error("size values must be positive");if(o[0]===0||o[1]===0)return pkn.create();let r=[o[0]/2,o[1]/2],i=[r[0],-r[1]],s=[Zk.subtract(Zk.create(),n,r),Zk.add(Zk.create(),n,i),Zk.add(Zk.create(),n,r),Zk.subtract(Zk.create(),n,i)];return pkn.fromPoints(s)};mkn.exports=exi});var bkn=lt(function($ca,Ckn){var{EPS:fSe,TAU:a0e}=rc(),glt=da(),Sm=si(),_kn=Ds(),qZ=za(),{sin:txi,cos:nxi}=BA(),{isGTE:gkn,isNumberArray:Akn}=__(),oxi=_Se(),fkn=(e,t,n,o,r,i)=>{let s=a0e/4*r/o,a=nxi(s),c=txi(s),l=o-r,h=n*a,d=t[2]-(n-n*c);if(!i)d=n-n*c-t[2];h=h>fSe?h:0;let u=Sm.add(Sm.create(),e,[t[0]-n,t[1]-n,d]),_=Sm.add(Sm.create(),e,[n-t[0],t[1]-n,d]),p=Sm.add(Sm.create(),e,[n-t[0],n-t[1],d]),m=Sm.add(Sm.create(),e,[t[0]-n,n-t[1],d]),A=[],g=[],f=[],y=[];for(let x=0;x<=l;x++){let C=l>0?a0e/4*x/l:0,b=glt.fromAngleRadians(glt.create(),C);glt.scale(b,b,h);let I=Sm.fromVec2(Sm.create(),b);A.push(Sm.add(Sm.create(),u,I)),Sm.rotateZ(I,I,[0,0,0],a0e/4),g.push(Sm.add(Sm.create(),_,I)),Sm.rotateZ(I,I,[0,0,0],a0e/4),f.push(Sm.add(Sm.create(),p,I)),Sm.rotateZ(I,I,[0,0,0],a0e/4),y.push(Sm.add(Sm.create(),m,I))}if(!i)return A.reverse(),g.reverse(),f.reverse(),y.reverse(),[y,f,g,A];return[A,g,f,y]},ykn=(e,t)=>{let n=[];for(let o=0;o<e.length;o++){let r=e[o],i=t[o];for(let s=0;s<r.length-1;s++)if(n.push(qZ.create([r[s],r[s+1],i[s]])),s<i.length-1)n.push(qZ.create([i[s],r[s+1],i[s+1]]))}return n},xkn=(e,t)=>{let n=[];for(let o=0;o<e.length;o++){let r=e[o],i=t[o],s=r[r.length-1],a=i[i.length-1],c=(o+1)%e.length;r=e[c],i=t[c];let l=r[0],h=i[0];n.push(qZ.create([s,l,h,a]))}return n},rxi=(e,t)=>{e=[e[3],e[2],e[1],e[0]],e=e.map((i)=>i.slice().reverse());let n=[];e.forEach((i)=>{i.forEach((s)=>n.push(s))});let o=[];t.forEach((i)=>{i.forEach((s)=>o.push(s))});let r=[];for(let i=0;i<o.length;i++){let s=(i+1)%o.length;r.push(qZ.create([n[i],n[s],o[s],o[i]]))}return r},ixi=(e)=>{let t={center:[0,0,0],size:[2,2,2],roundRadius:0.2,segments:32},{center:n,size:o,roundRadius:r,segments:i}=Object.assign({},t,e);if(!Akn(n,3))throw Error("center must be an array of X, Y and Z values");if(!Akn(o,3))throw Error("size must be an array of X, Y and Z values");if(!o.every((l)=>l>=0))throw Error("size values must be positive");if(!gkn(r,0))throw Error("roundRadius must be positive");if(!gkn(i,4))throw Error("segments must be four or more");if(o[0]===0||o[1]===0||o[2]===0)return _kn.create();if(r===0)return oxi({center:n,size:o});if(o=o.map((l)=>l/2),r>o[0]-fSe||r>o[1]-fSe||r>o[2]-fSe)throw Error("roundRadius must be smaller than the radius of all dimensions");i=Math.floor(i/4);let s=null,a=null,c=[];for(let l=0;l<=i;l++){let h=fkn(n,o,r,i,l,!0),d=fkn(n,o,r,i,l,!1);if(l===0)c=c.concat(rxi(d,h));if(s)c=c.concat(ykn(s,h),xkn(s,h));if(a)c=c.concat(ykn(a,d),xkn(a,d));if(l===i){let u=h.map((_)=>_[0]);c.push(qZ.create(u)),u=d.map((_)=>_[0]),c.push(qZ.create(u))}s=h,a=d}return _kn.create(c)};Ckn.exports=ixi});var Mkn=lt(function(qca,Ekn){var{EPS:sxi,TAU:Ikn}=rc(),_r=si(),vkn=Ds(),axi=za(),{sin:Skn,cos:Pkn}=BA(),{isGTE:ySe,isNumberArray:cxi}=__(),lxi=plt(),hxi=(e)=>{let t={center:[0,0,0],height:2,radius:1,roundRadius:0.2,segments:32},{center:n,height:o,radius:r,roundRadius:i,segments:s}=Object.assign({},t,e);if(!cxi(n,3))throw Error("center must be an array of X, Y and Z values");if(!ySe(o,0))throw Error("height must be positive");if(!ySe(r,0))throw Error("radius must be positive");if(!ySe(i,0))throw Error("roundRadius must be positive");if(i>r)throw Error("roundRadius must be smaller than the radius");if(!ySe(s,4))throw Error("segments must be four or more");if(o===0||r===0)return vkn.create();if(i===0)return lxi({center:n,height:o,radius:r});let a=[0,0,-(o/2)],c=[0,0,o/2],l=_r.subtract(_r.create(),c,a),h=_r.length(l);if(2*i>h-sxi)throw Error("height must be larger than twice roundRadius");let d;if(Math.abs(l[0])>Math.abs(l[1]))d=_r.fromValues(0,1,0);else d=_r.fromValues(1,0,0);let u=_r.scale(_r.create(),_r.normalize(_r.create(),l),i),_=_r.scale(_r.create(),_r.normalize(_r.create(),_r.cross(_r.create(),u,d)),r),p=_r.scale(_r.create(),_r.normalize(_r.create(),_r.cross(_r.create(),_,u)),r);_r.add(a,a,u),_r.subtract(c,c,u);let m=Math.floor(0.25*s),A=(b)=>{let I=b.map((v)=>_r.add(v,v,n));return axi.create(I)},g=[],f=_r.create(),y=_r.create(),x;for(let b=0;b<=s;b++){let I=Ikn*b/s,v=_r.add(_r.create(),_r.scale(f,_,Pkn(I)),_r.scale(y,p,Skn(I)));if(b>0){let P=[];P.push(_r.add(_r.create(),a,v)),P.push(_r.add(_r.create(),a,x)),P.push(_r.add(_r.create(),c,x)),P.push(_r.add(_r.create(),c,v)),g.push(A(P));let M,B;for(let T=0;T<=m;T++){let N=Ikn/4*T/m,D=Pkn(N),L=Skn(N);if(T>0){P=[];let H;if(H=_r.add(_r.create(),a,_r.subtract(f,_r.scale(f,x,M),_r.scale(y,u,B))),P.push(H),H=_r.add(_r.create(),a,_r.subtract(f,_r.scale(f,v,M),_r.scale(y,u,B))),P.push(H),T<m)H=_r.add(_r.create(),a,_r.subtract(f,_r.scale(f,v,D),_r.scale(y,u,L))),P.push(H);if(H=_r.add(_r.create(),a,_r.subtract(f,_r.scale(f,x,D),_r.scale(y,u,L))),P.push(H),g.push(A(P)),P=[],H=_r.add(_r.create(),_r.scale(f,x,M),_r.scale(y,u,B)),_r.add(H,H,c),P.push(H),H=_r.add(_r.create(),_r.scale(f,v,M),_r.scale(y,u,B)),_r.add(H,H,c),P.push(H),T<m)H=_r.add(_r.create(),_r.scale(f,v,D),_r.scale(y,u,L)),_r.add(H,H,c),P.push(H);H=_r.add(_r.create(),_r.scale(f,x,D),_r.scale(y,u,L)),_r.add(H,H,c),P.push(H),P.reverse(),g.push(A(P))}M=D,B=L}}x=v}return vkn.create(g)};Ekn.exports=hxi});var Rkn=lt(function(Jca,Nkn){var{EPS:wkn,TAU:xSe}=rc(),Ku=da(),Dkn=zs(),{isGTE:Bkn,isNumberArray:Tkn}=__(),dxi=ASe(),uxi=(e)=>{let t={center:[0,0],size:[2,2],roundRadius:0.2,segments:32},{center:n,size:o,roundRadius:r,segments:i}=Object.assign({},t,e);if(!Tkn(n,2))throw Error("center must be an array of X and Y values");if(!Tkn(o,2))throw Error("size must be an array of X and Y values");if(!o.every((m)=>m>=0))throw Error("size values must be positive");if(!Bkn(r,0))throw Error("roundRadius must be positive");if(!Bkn(i,4))throw Error("segments must be four or more");if(o[0]===0||o[1]===0)return Dkn.create();if(r===0)return dxi({center:n,size:o});if(o=o.map((m)=>m/2),r>o[0]-wkn||r>o[1]-wkn)throw Error("roundRadius must be smaller than the radius of all dimensions");let s=Math.floor(i/4),a=Ku.add(Ku.create(),n,[o[0]-r,o[1]-r]),c=Ku.add(Ku.create(),n,[r-o[0],o[1]-r]),l=Ku.add(Ku.create(),n,[r-o[0],r-o[1]]),h=Ku.add(Ku.create(),n,[o[0]-r,r-o[1]]),d=[],u=[],_=[],p=[];for(let m=0;m<=s;m++){let A=xSe/4*m/s,g=Ku.fromAngleRadians(Ku.create(),A);Ku.scale(g,g,r),d.push(Ku.add(Ku.create(),a,g)),Ku.rotate(g,g,Ku.create(),xSe/4),u.push(Ku.add(Ku.create(),c,g)),Ku.rotate(g,g,Ku.create(),xSe/4),_.push(Ku.add(Ku.create(),l,g)),Ku.rotate(g,g,Ku.create(),xSe/4),p.push(Ku.add(Ku.create(),h,g))}return Dkn.fromPoints(d.concat(u,_,p))};Nkn.exports=uxi});var Alt=lt(function(Zca,Qkn){var pxi=mlt(),{isGTE:mxi}=__(),_xi=(e)=>{let t={center:[0,0,0],radius:1,segments:32,axes:[[1,0,0],[0,-1,0],[0,0,1]]},{center:n,radius:o,segments:r,axes:i}=Object.assign({},t,e);if(!mxi(o,0))throw Error("radius must be positive");return o=[o,o,o],pxi({center:n,radius:o,segments:r,axes:i})};Qkn.exports=_xi});var Lkn=lt(function(ela,kkn){var gxi=ASe(),{isGTE:Axi}=__(),fxi=(e)=>{let t={center:[0,0],size:2},{center:n,size:o}=Object.assign({},t,e);if(!Axi(o,0))throw Error("size must be positive");return o=[o,o],gxi({center:n,size:o})};kkn.exports=fxi});var Okn=lt(function(tla,zkn){var{TAU:Fkn}=rc(),c0e=da(),yxi=zs(),{isGT:xxi,isGTE:CSe,isNumberArray:Cxi}=__(),bxi=(e,t)=>{if(e>0&&t>1&&t<e/2)return Math.cos(Math.PI*t/e)/Math.cos(Math.PI*(t-1)/e);return 0},Hkn=(e,t,n,o)=>{let r=Fkn/e,i=[];for(let s=0;s<e;s++){let a=c0e.fromAngleRadians(c0e.create(),r*s+n);c0e.scale(a,a,t),c0e.add(a,o,a),i.push(a)}return i},Ixi=(e)=>{let t={center:[0,0],vertices:5,outerRadius:1,innerRadius:0,density:2,startAngle:0},{center:n,vertices:o,outerRadius:r,innerRadius:i,density:s,startAngle:a}=Object.assign({},t,e);if(!Cxi(n,2))throw Error("center must be an array of X and Y values");if(!CSe(o,2))throw Error("vertices must be two or more");if(!xxi(r,0))throw Error("outerRadius must be greater than zero");if(!CSe(i,0))throw Error("innerRadius must be greater than zero");if(!CSe(a,0))throw Error("startAngle must be greater than zero");if(o=Math.floor(o),s=Math.floor(s),a=a%Fkn,i===0){if(!CSe(s,2))throw Error("density must be two or more");i=r*bxi(o,s)}let c=c0e.clone(n),l=Hkn(o,r,a,c),h=Hkn(o,i,a+Math.PI/o,c),d=[];for(let u=0;u<o;u++)d.push(l[u]),d.push(h[u]);return yxi.fromPoints(d)};zkn.exports=Ixi});var JZ=lt(function(nla,Xkn){var vxi=ms(),Vkn=Fh(),Ykn=z9(),Gkn=zs(),Ukn=Ds(),Wkn=bh(),bSe=(e,...t)=>{let n={origin:[0,0,0],normal:[0,0,1]},{origin:o,normal:r}=Object.assign({},n,e);if(t=vxi(t),t.length===0)throw Error("wrong number of arguments");let i=Ykn.fromNormalAndPoint(Ykn.create(),r,o);if(Number.isNaN(i[0]))throw Error("the given origin and normal do not define a proper plane");let s=Vkn.mirrorByPlane(Vkn.create(),i),a=t.map((c)=>{if(Wkn.isA(c))return Wkn.transform(s,c);if(Gkn.isA(c))return Gkn.transform(s,c);if(Ukn.isA(c))return Ukn.transform(s,c);return c});return a.length===1?a[0]:a},Sxi=(...e)=>bSe({normal:[1,0,0]},e),Pxi=(...e)=>bSe({normal:[0,1,0]},e),Exi=(...e)=>bSe({normal:[0,0,1]},e);Xkn.exports={mirror:bSe,mirrorX:Sxi,mirrorY:Pxi,mirrorZ:Exi}});var flt=lt(function(ola,Kkn){var jkn=z9(),oG=si(),Mxi=(e)=>{let t=e.edges;if(t.length<3)throw Error("slices must have 3 or more edges to calculate a plane");let n=t.reduce((s,a)=>oG.add(oG.create(),s,a[0]),oG.create());oG.scale(n,n,1/t.length);let o,r=0;t.forEach((s)=>{if(!oG.equals(s[0],s[1])){let a=oG.squaredDistance(n,s[0]);if(a>r)o=s,r=a}});let i=t.find((s)=>oG.equals(s[1],o[0]));return jkn.fromPoints(jkn.create(),i[0],o[0],o[1])};Kkn.exports=Mxi});var eL=lt(function(rla,$kn){var wxi=(e)=>{if(!e)e=[];return{edges:e}};$kn.exports=wxi});var Zkn=lt(function(ila,Jkn){var Bxi=eL(),qkn=si(),Txi=(...e)=>{let t,n;if(e.length===1)t=Bxi(),n=e[0];else t=e[0],n=e[1];return t.edges=n.edges.map((o)=>[qkn.clone(o[0]),qkn.clone(o[1])]),t};Jkn.exports=Txi});var tLn=lt(function(sla,eLn){var Dxi=si(),Nxi=(e,t)=>{let n=e.edges,o=t.edges;if(n.length!==o.length)return!1;return n.reduce((i,s,a)=>{let c=o[a],l=Dxi.squaredDistance(s[0],c[0]);return i&&l<Number.EPSILON},!0)};eLn.exports=Nxi});var oLn=lt(function(ala,nLn){var ISe=si(),Rxi=eL(),Qxi=(e)=>{if(!Array.isArray(e))throw Error("the given points must be an array");if(e.length<3)throw Error("the given points must contain THREE or more points");let t=[],n=e[e.length-1];return e.forEach((o)=>{if(o.length===2)t.push([ISe.fromVec2(ISe.create(),n),ISe.fromVec2(ISe.create(),o)]);if(o.length===3)t.push([n,o]);n=o}),Rxi(t)};nLn.exports=Qxi});var iLn=lt(function(cla,rLn){var vSe=si(),kxi=eL(),Lxi=(e)=>{if(!Array.isArray(e))throw Error("the given sides must be an array");let t=[];return e.forEach((n)=>{t.push([vSe.fromVec2(vSe.create(),n[0]),vSe.fromVec2(vSe.create(),n[1])])}),kxi(t)};rLn.exports=Lxi});var aLn=lt(function(lla,sLn){var Hxi=(e)=>{if(e&&typeof e==="object"){if("edges"in e){if(Array.isArray(e.edges))return!0}}return!1};sLn.exports=Hxi});var lLn=lt(function(hla,cLn){var Fxi=eL(),zxi=(...e)=>{let t,n;if(e.length===1)t=Fxi(),n=e[0];else t=e[0],n=e[1];return t.edges=n.edges.map((o)=>[o[1],o[0]]),t};cLn.exports=zxi});var dLn=lt(function(dla,hLn){var Oxi=(e)=>e.edges;hLn.exports=Oxi});var pLn=lt(function(ula,uLn){var Vxi=(e,t)=>{let n,o,r,i,s,a=1;do{o=e,e=null;let c=null;s=0;while(o){s++,r=o;let l=0;for(n=0;n<a;n++)if(l++,r=r.nextZ,!r)break;let h=a;while(l>0||h>0&&r){if(l!==0&&(h===0||!r||t(o)<=t(r)))i=o,o=o.nextZ,l--;else i=r,r=r.nextZ,h--;if(c)c.nextZ=i;else e=i;i.prevZ=c,c=i}o=r}c.nextZ=null,a*=2}while(s>1);return e};uLn.exports=Vxi});var xlt=lt(function(pla,mLn){var Yxi=pLn();class ylt{constructor(e,t,n){this.i=e,this.x=t,this.y=n,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}}var Gxi=(e,t,n,o)=>{let r=new ylt(e,t,n);if(!o)r.prev=r,r.next=r;else r.next=o.next,r.prev=o,o.next.prev=r,o.next=r;return r},Uxi=(e)=>{if(e.next.prev=e.prev,e.prev.next=e.next,e.prevZ)e.prevZ.nextZ=e.nextZ;if(e.nextZ)e.nextZ.prevZ=e.prevZ};mLn.exports={Node:ylt,insertNode:Gxi,removeNode:Uxi,sortLinked:Yxi}});var SSe=lt(function(mla,_Ln){var Wxi=(e,t,n,o,r,i,s,a)=>(r-s)*(t-a)-(e-s)*(i-a)>=0&&(e-s)*(o-a)-(n-s)*(t-a)>=0&&(n-s)*(i-a)-(r-s)*(o-a)>=0,Xxi=(e,t,n)=>(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y);_Ln.exports={area:Xxi,pointInTriangle:Wxi}});var Clt=lt(function(_la,xLn){var{Node:gLn,insertNode:ALn,removeNode:ESe}=xlt(),{area:s5}=SSe(),jxi=(e,t,n,o,r)=>{let i;if(r===e5i(e,t,n,o)>0)for(let s=t;s<n;s+=o)i=ALn(s,e[s],e[s+1],i);else for(let s=n-o;s>=t;s-=o)i=ALn(s,e[s],e[s+1],i);if(i&&MSe(i,i.next))ESe(i),i=i.next;return i},fLn=(e,t)=>{if(!e)return e;if(!t)t=e;let n=e,o;do if(o=!1,!n.steiner&&(MSe(n,n.next)||s5(n.prev,n,n.next)===0)){if(ESe(n),n=t=n.prev,n===n.next)break;o=!0}else n=n.next;while(o||n!==t);return t},Kxi=(e,t,n)=>{let o=e;do{let r=o.prev,i=o.next.next;if(!MSe(r,i)&&yLn(r,o,o.next,i)&&l0e(r,i)&&l0e(i,r))t.push(r.i/n),t.push(o.i/n),t.push(i.i/n),ESe(o),ESe(o.next),o=e=i;o=o.next}while(o!==e);return fLn(o)},$xi=(e,t)=>{let n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&yLn(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1},l0e=(e,t)=>s5(e.prev,e,e.next)<0?s5(e,t,e.next)>=0&&s5(e,e.prev,t)>=0:s5(e,t,e.prev)<0||s5(e,e.next,t)<0,qxi=(e,t)=>{let n=e,o=!1,r=(e.x+t.x)/2,i=(e.y+t.y)/2;do{if(n.y>i!==n.next.y>i&&n.next.y!==n.y&&r<(n.next.x-n.x)*(i-n.y)/(n.next.y-n.y)+n.x)o=!o;n=n.next}while(n!==e);return o},Jxi=(e,t)=>{let n=new gLn(e.i,e.x,e.y),o=new gLn(t.i,t.x,t.y),r=e.next,i=t.prev;return e.next=t,t.prev=e,n.next=r,r.prev=n,o.next=n,n.prev=o,i.next=o,o.prev=i,o},Zxi=(e,t)=>e.next.i!==t.i&&e.prev.i!==t.i&&!$xi(e,t)&&(l0e(e,t)&&l0e(t,e)&&qxi(e,t)&&(s5(e.prev,e,t.prev)||s5(e,t.prev,t))||MSe(e,t)&&s5(e.prev,e,e.next)>0&&s5(t.prev,t,t.next)>0),yLn=(e,t,n,o)=>{let r=Math.sign(s5(e,t,n)),i=Math.sign(s5(e,t,o)),s=Math.sign(s5(n,o,e)),a=Math.sign(s5(n,o,t));if(r!==i&&s!==a)return!0;if(r===0&&PSe(e,n,t))return!0;if(i===0&&PSe(e,o,t))return!0;if(s===0&&PSe(n,e,o))return!0;if(a===0&&PSe(n,t,o))return!0;return!1},PSe=(e,t,n)=>t.x<=Math.max(e.x,n.x)&&t.x>=Math.min(e.x,n.x)&&t.y<=Math.max(e.y,n.y)&&t.y>=Math.min(e.y,n.y),e5i=(e,t,n,o)=>{let r=0;for(let i=t,s=n-o;i<n;i+=o)r+=(e[s]-e[i])*(e[i+1]+e[s+1]),s=i;return r},MSe=(e,t)=>e.x===t.x&&e.y===t.y;xLn.exports={cureLocalIntersections:Kxi,filterPoints:fLn,isValidDiagonal:Zxi,linkedPolygon:jxi,locallyInside:l0e,splitPolygon:Jxi}});var ILn=lt(function(gla,bLn){var{filterPoints:blt,linkedPolygon:t5i,locallyInside:n5i,splitPolygon:o5i}=Clt(),{area:CLn,pointInTriangle:r5i}=SSe(),i5i=(e,t,n,o)=>{let r=[];for(let i=0,s=t.length;i<s;i++){let a=t[i]*o,c=i<s-1?t[i+1]*o:e.length,l=t5i(e,a,c,o,!1);if(l===l.next)l.steiner=!0;r.push(l5i(l))}r.sort((i,s)=>i.x-s.x);for(let i=0;i<r.length;i++)n=s5i(r[i],n),n=blt(n,n.next);return n},s5i=(e,t)=>{let n=a5i(e,t);if(!n)return t;let o=o5i(n,e),r=blt(n,n.next);return blt(o,o.next),t===n?r:t},a5i=(e,t)=>{let n=t,{x:o,y:r}=e,i=-1/0,s;do{if(r<=n.y&&r>=n.next.y&&n.next.y!==n.y){let d=n.x+(r-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(d<=o&&d>i){if(i=d,d===o){if(r===n.y)return n;if(r===n.next.y)return n.next}s=n.x<n.next.x?n:n.next}}n=n.next}while(n!==t);if(!s)return null;if(o===i)return s;let a=s,c=s.x,l=s.y,h=1/0;n=s;do{if(o>=n.x&&n.x>=c&&o!==n.x&&r5i(r<l?o:i,r,c,l,r<l?i:o,r,n.x,n.y)){let d=Math.abs(r-n.y)/(o-n.x);if(n5i(n,e)&&(d<h||d===h&&(n.x>s.x||n.x===s.x&&c5i(s,n))))s=n,h=d}n=n.next}while(n!==a);return s},c5i=(e,t)=>CLn(e.prev,e,t.prev)<0&&CLn(t.next,e,e.next)<0,l5i=(e)=>{let t=e,n=e;do{if(t.x<n.x||t.x===n.x&&t.y<n.y)n=t;t=t.next}while(t!==e);return n};bLn.exports=i5i});var SLn=lt(function(Ala,vLn){var h5i=ILn(),{removeNode:d5i,sortLinked:u5i}=xlt(),{cureLocalIntersections:p5i,filterPoints:wSe,isValidDiagonal:m5i,linkedPolygon:_5i,splitPolygon:g5i}=Clt(),{area:rG,pointInTriangle:h0e}=SSe(),A5i=(e,t,n=2)=>{let o=t&&t.length,r=o?t[0]*n:e.length,i=_5i(e,0,r,n,!0),s=[];if(!i||i.next===i.prev)return s;let a,c,l,h,d;if(o)i=h5i(e,t,i,n);if(e.length>80*n){a=l=e[0],c=h=e[1];for(let u=n;u<r;u+=n){let _=e[u],p=e[u+1];if(_<a)a=_;if(p<c)c=p;if(_>l)l=_;if(p>h)h=p}d=Math.max(l-a,h-c),d=d!==0?1/d:0}return d0e(i,s,n,a,c,d),s},d0e=(e,t,n,o,r,i,s)=>{if(!e)return;if(!s&&i)C5i(e,o,r,i);let a=e,c,l;while(e.prev!==e.next){if(c=e.prev,l=e.next,i?y5i(e,o,r,i):f5i(e)){t.push(c.i/n),t.push(e.i/n),t.push(l.i/n),d5i(e),e=l.next,a=l.next;continue}if(e=l,e===a){if(!s)d0e(wSe(e),t,n,o,r,i,1);else if(s===1)e=p5i(wSe(e),t,n),d0e(e,t,n,o,r,i,2);else if(s===2)x5i(e,t,n,o,r,i);break}}},f5i=(e)=>{let t=e.prev,n=e,o=e.next;if(rG(t,n,o)>=0)return!1;let r=e.next.next;while(r!==e.prev){if(h0e(t.x,t.y,n.x,n.y,o.x,o.y,r.x,r.y)&&rG(r.prev,r,r.next)>=0)return!1;r=r.next}return!0},y5i=(e,t,n,o)=>{let r=e.prev,i=e,s=e.next;if(rG(r,i,s)>=0)return!1;let a=r.x<i.x?r.x<s.x?r.x:s.x:i.x<s.x?i.x:s.x,c=r.y<i.y?r.y<s.y?r.y:s.y:i.y<s.y?i.y:s.y,l=r.x>i.x?r.x>s.x?r.x:s.x:i.x>s.x?i.x:s.x,h=r.y>i.y?r.y>s.y?r.y:s.y:i.y>s.y?i.y:s.y,d=Ilt(a,c,t,n,o),u=Ilt(l,h,t,n,o),{prevZ:_,nextZ:p}=e;while(_&&_.z>=d&&p&&p.z<=u){if(_!==e.prev&&_!==e.next&&h0e(r.x,r.y,i.x,i.y,s.x,s.y,_.x,_.y)&&rG(_.prev,_,_.next)>=0)return!1;if(_=_.prevZ,p!==e.prev&&p!==e.next&&h0e(r.x,r.y,i.x,i.y,s.x,s.y,p.x,p.y)&&rG(p.prev,p,p.next)>=0)return!1;p=p.nextZ}while(_&&_.z>=d){if(_!==e.prev&&_!==e.next&&h0e(r.x,r.y,i.x,i.y,s.x,s.y,_.x,_.y)&&rG(_.prev,_,_.next)>=0)return!1;_=_.prevZ}while(p&&p.z<=u){if(p!==e.prev&&p!==e.next&&h0e(r.x,r.y,i.x,i.y,s.x,s.y,p.x,p.y)&&rG(p.prev,p,p.next)>=0)return!1;p=p.nextZ}return!0},x5i=(e,t,n,o,r,i)=>{let s=e;do{let a=s.next.next;while(a!==s.prev){if(s.i!==a.i&&m5i(s,a)){let c=g5i(s,a);s=wSe(s,s.next),c=wSe(c,c.next),d0e(s,t,n,o,r,i),d0e(c,t,n,o,r,i);return}a=a.next}s=s.next}while(s!==e)},C5i=(e,t,n,o)=>{let r=e;do{if(r.z===null)r.z=Ilt(r.x,r.y,t,n,o);r.prevZ=r.prev,r.nextZ=r.next,r=r.next}while(r!==e);r.prevZ.nextZ=null,r.prevZ=null,u5i(r,(i)=>i.z)},Ilt=(e,t,n,o,r)=>(e=32767*(e-n)*r,t=32767*(t-o)*r,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,e|t<<1);vLn.exports=A5i});var ELn=lt(function(fla,PLn){var{area:b5i}=GZ(),{toOutlines:I5i}=zs(),{arePointsInside:v5i}=iSe(),S5i=(e)=>{let t=I5i(e),n=[],o=[];t.forEach((s,a)=>{let c=b5i(s);if(c<0)o.push(a);else if(c>0)n.push(a)});let r=[],i=[];return n.forEach((s,a)=>{let c=t[s];r[a]=[],o.forEach((l,h)=>{let d=t[l];if(v5i([d[0]],{vertices:c})){if(r[a].push(l),!i[h])i[h]=[];i[h].push(a)}})}),o.forEach((s,a)=>{if(i[a]&&i[a].length>1){let c=P5i(i[a],(l)=>r[l].length);i[a].forEach((l,h)=>{if(h!==c)r[l]=r[l].filter((d)=>d!==s)})}}),r.map((s,a)=>({solid:t[n[a]],holes:s.map((c)=>t[c])}))},P5i=(e,t)=>{let n,o;return e.forEach((r,i)=>{let s=t(r);if(o===void 0||s<o)n=i,o=s}),n};PLn.exports=S5i});var TLn=lt(function(yla,BLn){var E5i=zs(),MLn=z9(),M5i=da(),Ff=si(),w5i=flt(),B5i=ELn();class wLn{constructor(e){this.plane=w5i(e);let t=Ff.orthogonal(Ff.create(),this.plane),n=Ff.cross(Ff.create(),this.plane,t);this.v=Ff.normalize(n,n),this.u=Ff.cross(Ff.create(),this.v,this.plane),this.basisMap=new Map;let o=e.edges.map((i)=>i.map((s)=>this.to2D(s))),r=E5i.create(o);this.roots=B5i(r)}to2D(e){let t=M5i.fromValues(Ff.dot(e,this.u),Ff.dot(e,this.v));return this.basisMap.set(t,e),t}to3D(e){let t=this.basisMap.get(e);if(t)return t;else{console.log("Warning: point not in original slice");let n=Ff.scale(Ff.create(),this.u,e[0]),o=Ff.scale(Ff.create(),this.v,e[1]),r=Ff.scale(Ff.create(),MLn,MLn[3]),i=Ff.add(n,n,r);return Ff.add(o,o,i)}}}BLn.exports=wLn});var NLn=lt(function(xla,DLn){var T5i=za(),D5i=SLn(),N5i=TLn(),R5i=(e)=>{let t=new N5i(e),n=[];return t.roots.forEach(({solid:o,holes:r})=>{let i=o.length,s=[];r.forEach((d,u)=>{s.push(i),i+=d.length});let a=[o,...r].flat(),c=a.flat(),l=(d)=>t.to3D(a[d]),h=D5i(c,s);for(let d=0;d<h.length;d+=3){let u=h.slice(d,d+3).map(l);n.push(T5i.fromPointsAndPlane(u,t.plane))}}),n};DLn.exports=R5i});var kLn=lt(function(Cla,QLn){var RLn=si(),Q5i=(e)=>e.reduce((t,n)=>t+=`[${RLn.toString(n[0])}, ${RLn.toString(n[1])}], `,""),k5i=(e)=>`[${Q5i(e.edges)}]`;QLn.exports=k5i});var HLn=lt(function(bla,LLn){var BSe=si(),L5i=eL(),H5i=(e,t)=>{let n=t.edges.map((o)=>[BSe.transform(BSe.create(),o[0],e),BSe.transform(BSe.create(),o[1],e)]);return L5i(n)};LLn.exports=H5i});var iG=lt(function(Ila,FLn){FLn.exports={calculatePlane:flt(),clone:Zkn(),create:eL(),equals:tLn(),fromPoints:oLn(),fromSides:iLn(),isA:aLn(),reverse:lLn(),toEdges:dLn(),toPolygons:NLn(),toString:kLn(),transform:HLn()}});var VLn=lt(function(vla,OLn){var zLn=si(),F5i=eL(),z5i=(e)=>{if(!e.edges)return e;let t=e.edges,n=new Map,o=new Map;t=t.filter((s)=>!zLn.equals(s[0],s[1])),t.forEach((s)=>{let a=s[0].toString(),c=s[1].toString();n.set(a,s[0]),n.set(c,s[1]),o.set(a,(o.get(a)||0)+1),o.set(c,(o.get(c)||0)-1)});let r=[],i=[];return o.forEach((s,a)=>{if(s<0)r.push(a);if(s>0)i.push(a)}),r.forEach((s)=>{let a=n.get(s),c=1/0,l;i.forEach((h)=>{let d=n.get(h),u=zLn.distance(a,d);if(u<c)c=u,l=d}),console.warn(`slice.repair: repairing vertex gap ${a} to ${l} distance ${c}`),t=t.map((h)=>{if(h[0].toString()===s)return[l,h[1]];if(h[1].toString()===s)return[h[0],l];return h})}),F5i(t)};OLn.exports=z5i});var jLn=lt(function(Sla,XLn){var{EPS:YLn}=rc(),ZZ=si(),TSe=za(),GLn=iG(),vlt=(e,t)=>{if(e===t)return e;if(e<t)return vlt(t,e);if(t===1)return 1;if(t===0)return e;return vlt(t,e%t)},O5i=(e,t)=>e*t/vlt(e,t),ULn=(e,t)=>{let n=e/t.length;if(n===1)return t;let o=ZZ.fromValues(n,n,n),r=ZZ.create(),i=[];return t.forEach((s)=>{ZZ.subtract(r,s[1],s[0]),ZZ.divide(r,r,o);let a=s[0];for(let c=1;c<=n;++c){let l=ZZ.add(ZZ.create(),a,r);i.push([a,l]),a=l}}),i},WLn=YLn*YLn/2*Math.sin(Math.PI/3),V5i=(e,t)=>{let n=GLn.toEdges(e),o=GLn.toEdges(t);if(n.length!==o.length){let i=O5i(n.length,o.length);if(i!==n.length)n=ULn(i,n);if(i!==o.length)o=ULn(i,o)}let r=[];return n.forEach((i,s)=>{let a=o[s],c=TSe.create([i[0],i[1],a[1]]),l=TSe.measureArea(c);if(Number.isFinite(l)&&l>WLn)r.push(c);let h=TSe.create([i[0],a[1],a[0]]),d=TSe.measureArea(h);if(Number.isFinite(d)&&d>WLn)r.push(h)}),r};XLn.exports=V5i});var u0e=lt(function(Pla,JLn){var $Ln=Fh(),qLn=zs(),Y5i=Ds(),Slt=za(),tL=iG(),G5i=VLn(),KLn=jLn(),U5i=(e,t,n)=>{let o=null;if(qLn.isA(n))o=tL.fromSides(qLn.toSides(n));if(Slt.isA(n))o=tL.fromPoints(Slt.toPoints(n));return e===0||e===1?tL.transform($Ln.fromTranslation($Ln.create(),[0,0,e]),o):null},W5i=(e,t)=>{let n={numberOfSlices:2,capStart:!0,capEnd:!0,close:!1,repair:!0,callback:U5i},{numberOfSlices:o,capStart:r,capEnd:i,close:s,repair:a,callback:c}=Object.assign({},n,e);if(o<2)throw Error("numberOfSlices must be 2 or more");if(a)t=G5i(t);let l=o-1,h=null,d=null,u=null,_=[];for(let p=0;p<o;p++){let m=c(p/l,p,t);if(m){if(!tL.isA(m))throw Error("the callback function must return slice objects");if(tL.toEdges(m).length===0)throw Error("the callback function must return slices with one or more edges");if(u){let g=KLn(u,m);for(let f=0;f<g.length;f++)_.push(g[f])}if(p===0)h=m;if(p===o-1)d=m;u=m}}if(i){let p=tL.toPolygons(d);for(let m=0;m<p.length;m++)_.push(p[m])}if(r){let p=tL.toPolygons(h).map(Slt.invert);for(let m=0;m<p.length;m++)_.push(p[m])}if(!r&&!i){if(s&&!tL.equals(d,h)){let p=KLn(d,h);for(let m=0;m<p.length;m++)_.push(p[m])}}return Y5i.create(_)};JLn.exports=W5i});var Elt=lt(function(Ela,ZLn){var{TAU:c3}=rc(),eee=Fh(),{mirrorX:X5i}=JZ(),DSe=zs(),Plt=iG(),j5i=u0e(),K5i=(e,t)=>{let n={segments:12,startAngle:0,angle:c3,overflow:"cap"},{segments:o,startAngle:r,angle:i,overflow:s}=Object.assign({},n,e);if(o<3)throw Error("segments must be greater then 3");r=Math.abs(r)>c3?r%c3:r,i=Math.abs(i)>c3?i%c3:i;let a=r+i;if(a=Math.abs(a)>c3?a%c3:a,a<r){let x=r;r=a,a=x}let c=a-r;if(c<=0)c=c3;if(Math.abs(c)<c3){let x=c3/o;if(o=Math.floor(Math.abs(c)/x),Math.abs(c)>o*x)o++}let l=DSe.toSides(t);if(l.length===0)throw Error("the given geometry cannot be empty");let h=l.filter((x)=>x[0][0]<0),d=l.filter((x)=>x[0][0]>=0);if(h.length>0&&d.length>0&&s==="cap"){if(h.length>d.length)l=l.map((x)=>{let C=x[0],b=x[1];return C=[Math.min(C[0],0),C[1]],b=[Math.min(b[0],0),b[1]],[C,b]}),t=DSe.create(l),t=X5i(t);else if(d.length>=h.length)l=l.map((x)=>{let C=x[0],b=x[1];return C=[Math.max(C[0],0),C[1]],b=[Math.max(b[0],0),b[1]],[C,b]}),t=DSe.create(l)}let _=c/o,p=Math.abs(c)<c3,m=Plt.fromSides(DSe.toSides(t));Plt.reverse(m,m);let A=eee.create(),g=eee.fromXRotation(eee.create(),c3/4),f=eee.create(),y=(x,C,b)=>{let I=_*C+r;if(c===c3&&C===o)I=r;return eee.fromZRotation(f,I),eee.multiply(A,f,g),Plt.transform(A,b)};return e={numberOfSlices:o+1,capStart:p,capEnd:p,close:!p,callback:y},j5i(e,m)};ZLn.exports=K5i});var tee=lt(function(Mla,rHn){var $5i=ms(),eHn=Fh(),tHn=zs(),nHn=Ds(),oHn=bh(),NSe=(e,...t)=>{if(!Array.isArray(e))throw Error("angles must be an array");if(t=$5i(t),t.length===0)throw Error("wrong number of arguments");e=e.slice();while(e.length<3)e.push(0);let n=e[2],o=e[1],r=e[0],i=eHn.fromTaitBryanRotation(eHn.create(),n,o,r),s=t.map((a)=>{if(oHn.isA(a))return oHn.transform(i,a);if(tHn.isA(a))return tHn.transform(i,a);if(nHn.isA(a))return nHn.transform(i,a);return a});return s.length===1?s[0]:s},q5i=(e,...t)=>NSe([e,0,0],t),J5i=(e,...t)=>NSe([0,e,0],t),Z5i=(e,...t)=>NSe([0,0,e],t);rHn.exports={rotate:NSe,rotateX:q5i,rotateY:J5i,rotateZ:Z5i}});var nL=lt(function(wla,lHn){var e4i=ms(),iHn=Fh(),sHn=zs(),aHn=Ds(),cHn=bh(),RSe=(e,...t)=>{if(!Array.isArray(e))throw Error("offset must be an array");if(t=e4i(t),t.length===0)throw Error("wrong number of arguments");e=e.slice();while(e.length<3)e.push(0);let n=iHn.fromTranslation(iHn.create(),e),o=t.map((r)=>{if(cHn.isA(r))return cHn.transform(n,r);if(sHn.isA(r))return sHn.transform(n,r);if(aHn.isA(r))return aHn.transform(n,r);return r});return o.length===1?o[0]:o},t4i=(e,...t)=>RSe([e,0,0],t),n4i=(e,...t)=>RSe([0,e,0],t),o4i=(e,...t)=>RSe([0,0,e],t);lHn.exports={translate:RSe,translateX:t4i,translateY:n4i,translateZ:o4i}});var dHn=lt(function(Bla,hHn){var{TAU:r4i}=rc(),i4i=Elt(),{rotate:s4i}=tee(),{translate:a4i}=nL(),c4i=llt(),{isGT:Mlt,isGTE:wlt}=__(),l4i=(e)=>{let t={innerRadius:1,innerSegments:32,outerRadius:4,outerSegments:32,innerRotation:0,startAngle:0,outerRotation:r4i},{innerRadius:n,innerSegments:o,outerRadius:r,outerSegments:i,innerRotation:s,startAngle:a,outerRotation:c}=Object.assign({},t,e);if(!Mlt(n,0))throw Error("innerRadius must be greater than zero");if(!wlt(o,3))throw Error("innerSegments must be three or more");if(!Mlt(r,0))throw Error("outerRadius must be greater than zero");if(!wlt(i,3))throw Error("outerSegments must be three or more");if(!wlt(a,0))throw Error("startAngle must be positive");if(!Mlt(c,0))throw Error("outerRotation must be greater than zero");if(n>=r)throw Error("inner circle is too large to rotate about the outer circle");let l=c4i({radius:n,segments:o});if(s!==0)l=s4i([0,0,s],l);return l=a4i([r,0],l),i4i({startAngle:a,angle:c,segments:i},l)};hHn.exports=l4i});var pHn=lt(function(Tla,uHn){var{NEPS:nee}=rc(),p0e=da(),h4i=zs(),{isNumberArray:d4i}=__(),Blt=(e,t,n)=>Math.acos((e*e+t*t-n*n)/(2*e*t)),u4i=(e,t,n)=>{if(t>nee)return Math.sqrt(e*e+n*n-2*e*n*Math.cos(t));return Math.sqrt((e-n)*(e-n)+e*n*t*t*(1-t*t/12))},p4i=(e)=>{if(Math.abs(e[0]+e[1]+e[2]-Math.PI)>nee)throw Error("AAA triangles require angles that sum to PI");let n=e[0],o=e[1],r=Math.PI-n-o,i=1,s=i/Math.sin(r)*Math.sin(n),a=i/Math.sin(r)*Math.sin(o);return oee(n,o,r,s,a,i)},m4i=(e)=>{let t=e[0],n=e[1],o=Math.PI+nee-t-n;if(o<nee)throw Error("AAS triangles require angles that sum to PI");let r=e[2],i=r/Math.sin(t)*Math.sin(n),s=r/Math.sin(t)*Math.sin(o);return oee(t,n,o,r,i,s)},_4i=(e)=>{let t=e[0],n=e[2],o=Math.PI+nee-t-n;if(o<nee)throw Error("ASA triangles require angles that sum to PI");let r=e[1],i=r/Math.sin(o)*Math.sin(t),s=r/Math.sin(o)*Math.sin(n);return oee(t,n,o,i,s,r)},g4i=(e)=>{let t=e[0],n=e[1],o=e[2],r=u4i(t,n,o),i=Blt(r,t,o),s=Math.PI-i-n;return oee(i,n,s,o,r,t)},A4i=(e)=>{let t=e[0],n=e[1],o=e[2],r=Math.asin(n*Math.sin(o)/t),i=Math.PI-r-o,s=t/Math.sin(o)*Math.sin(i);return oee(r,i,o,n,s,t)},f4i=(e)=>{let t=e[1],n=e[2],o=e[0];if(t+n<=o||n+o<=t||o+t<=n)throw Error("SSS triangle is incorrect, as the longest side is longer than the sum of the other sides");let r=Blt(n,o,t),i=Blt(o,t,n),s=Math.PI-r-i;return oee(r,i,s,t,n,o)},oee=(e,t,n,o,r,i)=>{let s=p0e.fromValues(0,0),a=p0e.fromValues(i,0),c=p0e.fromValues(o,0);return p0e.add(c,p0e.rotate(c,c,[0,0],Math.PI-t),a),h4i.fromPoints([s,a,c])},y4i=(e)=>{let t={type:"SSS",values:[1,1,1]},{type:n,values:o}=Object.assign({},t,e);if(typeof n!=="string")throw Error("triangle type must be a string");if(n=n.toUpperCase(),!((n[0]==="A"||n[0]==="S")&&(n[1]==="A"||n[1]==="S")&&(n[2]==="A"||n[2]==="S")))throw Error("triangle type must contain three letters; A or S");if(!d4i(o,3))throw Error("triangle values must contain three values");if(!o.every((r)=>r>0))throw Error("triangle values must be greater than zero");switch(n){case"AAA":return p4i(o);case"AAS":return m4i(o);case"ASA":return _4i(o);case"SAS":return g4i(o);case"SSA":return A4i(o);case"SSS":return f4i(o);default:throw Error("invalid triangle type, try again")}};uHn.exports=y4i});var _Hn=lt(function(Dla,mHn){mHn.exports={arc:NQn(),circle:llt(),cube:YQn(),cuboid:_Se(),cylinder:plt(),cylinderElliptic:ult(),ellipse:clt(),ellipsoid:mlt(),geodesicSphere:akn(),line:lkn(),polygon:dkn(),polyhedron:_lt(),rectangle:ASe(),roundedCuboid:bkn(),roundedCylinder:Mkn(),roundedRectangle:Rkn(),sphere:Alt(),square:Lkn(),star:Okn(),torus:dHn(),triangle:pHn()}});var AHn=lt(function(Nla,gHn){gHn.exports={height:14,32:[16],33:[10,5,21,5,7,void 0,5,2,4,1,5,0,6,1,5,2],34:[16,4,21,4,14,void 0,12,21,12,14],35:[21,11,25,4,-7,void 0,17,25,10,-7,void 0,4,12,18,12,void 0,3,6,17,6],36:[20,8,25,8,-4,void 0,12,25,12,-4,void 0,17,18,15,20,12,21,8,21,5,20,3,18,3,16,4,14,5,13,7,12,13,10,15,9,16,8,17,6,17,3,15,1,12,0,8,0,5,1,3,3],37:[24,21,21,3,0,void 0,8,21,10,19,10,17,9,15,7,14,5,14,3,16,3,18,4,20,6,21,8,21,10,20,13,19,16,19,19,20,21,21,void 0,17,7,15,6,14,4,14,2,16,0,18,0,20,1,21,3,21,5,19,7,17,7],38:[26,23,12,23,13,22,14,21,14,20,13,19,11,17,6,15,3,13,1,11,0,7,0,5,1,4,2,3,4,3,6,4,8,5,9,12,13,13,14,14,16,14,18,13,20,11,21,9,20,8,18,8,16,9,13,11,10,16,3,18,1,20,0,22,0,23,1,23,2],39:[10,5,19,4,20,5,21,6,20,6,18,5,16,4,15],40:[14,11,25,9,23,7,20,5,16,4,11,4,7,5,2,7,-2,9,-5,11,-7],41:[14,3,25,5,23,7,20,9,16,10,11,10,7,9,2,7,-2,5,-5,3,-7],42:[16,8,21,8,9,void 0,3,18,13,12,void 0,13,18,3,12],43:[26,13,18,13,0,void 0,4,9,22,9],44:[10,6,1,5,0,4,1,5,2,6,1,6,-1,5,-3,4,-4],45:[26,4,9,22,9],46:[10,5,2,4,1,5,0,6,1,5,2],47:[22,20,25,2,-7],48:[20,9,21,6,20,4,17,3,12,3,9,4,4,6,1,9,0,11,0,14,1,16,4,17,9,17,12,16,17,14,20,11,21,9,21],49:[20,6,17,8,18,11,21,11,0],50:[20,4,16,4,17,5,19,6,20,8,21,12,21,14,20,15,19,16,17,16,15,15,13,13,10,3,0,17,0],51:[20,5,21,16,21,10,13,13,13,15,12,16,11,17,8,17,6,16,3,14,1,11,0,8,0,5,1,4,2,3,4],52:[20,13,21,3,7,18,7,void 0,13,21,13,0],53:[20,15,21,5,21,4,12,5,13,8,14,11,14,14,13,16,11,17,8,17,6,16,3,14,1,11,0,8,0,5,1,4,2,3,4],54:[20,16,18,15,20,12,21,10,21,7,20,5,17,4,12,4,7,5,3,7,1,10,0,11,0,14,1,16,3,17,6,17,7,16,10,14,12,11,13,10,13,7,12,5,10,4,7],55:[20,17,21,7,0,void 0,3,21,17,21],56:[20,8,21,5,20,4,18,4,16,5,14,7,13,11,12,14,11,16,9,17,7,17,4,16,2,15,1,12,0,8,0,5,1,4,2,3,4,3,7,4,9,6,11,9,12,13,13,15,14,16,16,16,18,15,20,12,21,8,21],57:[20,16,14,15,11,13,9,10,8,9,8,6,9,4,11,3,14,3,15,4,18,6,20,9,21,10,21,13,20,15,18,16,14,16,9,15,4,13,1,10,0,8,0,5,1,4,3],58:[10,5,14,4,13,5,12,6,13,5,14,void 0,5,2,4,1,5,0,6,1,5,2],59:[10,5,14,4,13,5,12,6,13,5,14,void 0,6,1,5,0,4,1,5,2,6,1,6,-1,5,-3,4,-4],60:[24,20,18,4,9,20,0],61:[26,4,12,22,12,void 0,4,6,22,6],62:[24,4,18,20,9,4,0],63:[18,3,16,3,17,4,19,5,20,7,21,11,21,13,20,14,19,15,17,15,15,14,13,13,12,9,10,9,7,void 0,9,2,8,1,9,0,10,1,9,2],64:[27,18,13,17,15,15,16,12,16,10,15,9,14,8,11,8,8,9,6,11,5,14,5,16,6,17,8,void 0,12,16,10,14,9,11,9,8,10,6,11,5,void 0,18,16,17,8,17,6,19,5,21,5,23,7,24,10,24,12,23,15,22,17,20,19,18,20,15,21,12,21,9,20,7,19,5,17,4,15,3,12,3,9,4,6,5,4,7,2,9,1,12,0,15,0,18,1,20,2,21,3,void 0,19,16,18,8,18,6,19,5],65:[18,9,21,1,0,void 0,9,21,17,0,void 0,4,7,14,7],66:[21,4,21,4,0,void 0,4,21,13,21,16,20,17,19,18,17,18,15,17,13,16,12,13,11,void 0,4,11,13,11,16,10,17,9,18,7,18,4,17,2,16,1,13,0,4,0],67:[21,18,16,17,18,15,20,13,21,9,21,7,20,5,18,4,16,3,13,3,8,4,5,5,3,7,1,9,0,13,0,15,1,17,3,18,5],68:[21,4,21,4,0,void 0,4,21,11,21,14,20,16,18,17,16,18,13,18,8,17,5,16,3,14,1,11,0,4,0],69:[19,4,21,4,0,void 0,4,21,17,21,void 0,4,11,12,11,void 0,4,0,17,0],70:[18,4,21,4,0,void 0,4,21,17,21,void 0,4,11,12,11],71:[21,18,16,17,18,15,20,13,21,9,21,7,20,5,18,4,16,3,13,3,8,4,5,5,3,7,1,9,0,13,0,15,1,17,3,18,5,18,8,void 0,13,8,18,8],72:[22,4,21,4,0,void 0,18,21,18,0,void 0,4,11,18,11],73:[8,4,21,4,0],74:[16,12,21,12,5,11,2,10,1,8,0,6,0,4,1,3,2,2,5,2,7],75:[21,4,21,4,0,void 0,18,21,4,7,void 0,9,12,18,0],76:[17,4,21,4,0,void 0,4,0,16,0],77:[24,4,21,4,0,void 0,4,21,12,0,void 0,20,21,12,0,void 0,20,21,20,0],78:[22,4,21,4,0,void 0,4,21,18,0,void 0,18,21,18,0],79:[22,9,21,7,20,5,18,4,16,3,13,3,8,4,5,5,3,7,1,9,0,13,0,15,1,17,3,18,5,19,8,19,13,18,16,17,18,15,20,13,21,9,21],80:[21,4,21,4,0,void 0,4,21,13,21,16,20,17,19,18,17,18,14,17,12,16,11,13,10,4,10],81:[22,9,21,7,20,5,18,4,16,3,13,3,8,4,5,5,3,7,1,9,0,13,0,15,1,17,3,18,5,19,8,19,13,18,16,17,18,15,20,13,21,9,21,void 0,12,4,18,-2],82:[21,4,21,4,0,void 0,4,21,13,21,16,20,17,19,18,17,18,15,17,13,16,12,13,11,4,11,void 0,11,11,18,0],83:[20,17,18,15,20,12,21,8,21,5,20,3,18,3,16,4,14,5,13,7,12,13,10,15,9,16,8,17,6,17,3,15,1,12,0,8,0,5,1,3,3],84:[16,8,21,8,0,void 0,1,21,15,21],85:[22,4,21,4,6,5,3,7,1,10,0,12,0,15,1,17,3,18,6,18,21],86:[18,1,21,9,0,void 0,17,21,9,0],87:[24,2,21,7,0,void 0,12,21,7,0,void 0,12,21,17,0,void 0,22,21,17,0],88:[20,3,21,17,0,void 0,17,21,3,0],89:[18,1,21,9,11,9,0,void 0,17,21,9,11],90:[20,17,21,3,0,void 0,3,21,17,21,void 0,3,0,17,0],91:[14,4,25,4,-7,void 0,5,25,5,-7,void 0,4,25,11,25,void 0,4,-7,11,-7],92:[14,0,21,14,-3],93:[14,9,25,9,-7,void 0,10,25,10,-7,void 0,3,25,10,25,void 0,3,-7,10,-7],94:[16,6,15,8,18,10,15,void 0,3,12,8,17,13,12,void 0,8,17,8,0],95:[16,0,-2,16,-2],96:[10,6,21,5,20,4,18,4,16,5,15,6,16,5,17],97:[19,15,14,15,0,void 0,15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3],98:[19,4,21,4,0,void 0,4,11,6,13,8,14,11,14,13,13,15,11,16,8,16,6,15,3,13,1,11,0,8,0,6,1,4,3],99:[18,15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3],100:[19,15,21,15,0,void 0,15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3],101:[18,3,8,15,8,15,10,14,12,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3],102:[12,10,21,8,21,6,20,5,17,5,0,void 0,2,14,9,14],103:[19,15,14,15,-2,14,-5,13,-6,11,-7,8,-7,6,-6,void 0,15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3],104:[19,4,21,4,0,void 0,4,10,7,13,9,14,12,14,14,13,15,10,15,0],105:[8,3,21,4,20,5,21,4,22,3,21,void 0,4,14,4,0],106:[10,5,21,6,20,7,21,6,22,5,21,void 0,6,14,6,-3,5,-6,3,-7,1,-7],107:[17,4,21,4,0,void 0,14,14,4,4,void 0,8,8,15,0],108:[8,4,21,4,0],109:[30,4,14,4,0,void 0,4,10,7,13,9,14,12,14,14,13,15,10,15,0,void 0,15,10,18,13,20,14,23,14,25,13,26,10,26,0],110:[19,4,14,4,0,void 0,4,10,7,13,9,14,12,14,14,13,15,10,15,0],111:[19,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3,16,6,16,8,15,11,13,13,11,14,8,14],112:[19,4,14,4,-7,void 0,4,11,6,13,8,14,11,14,13,13,15,11,16,8,16,6,15,3,13,1,11,0,8,0,6,1,4,3],113:[19,15,14,15,-7,void 0,15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3],114:[13,4,14,4,0,void 0,4,8,5,11,7,13,9,14,12,14],115:[17,14,11,13,13,10,14,7,14,4,13,3,11,4,9,6,8,11,7,13,6,14,4,14,3,13,1,10,0,7,0,4,1,3,3],116:[12,5,21,5,4,6,1,8,0,10,0,void 0,2,14,9,14],117:[19,4,14,4,4,5,1,7,0,10,0,12,1,15,4,void 0,15,14,15,0],118:[16,2,14,8,0,void 0,14,14,8,0],119:[22,3,14,7,0,void 0,11,14,7,0,void 0,11,14,15,0,void 0,19,14,15,0],120:[17,3,14,14,0,void 0,14,14,3,0],121:[16,2,14,8,0,void 0,14,14,8,0,6,-4,4,-6,2,-7,1,-7],122:[17,14,14,3,0,void 0,3,14,14,14,void 0,3,0,14,0],123:[14,9,25,7,24,6,23,5,21,5,19,6,17,7,16,8,14,8,12,6,10,void 0,7,24,6,22,6,20,7,18,8,17,9,15,9,13,8,11,4,9,8,7,9,5,9,3,8,1,7,0,6,-2,6,-4,7,-6,void 0,6,8,8,6,8,4,7,2,6,1,5,-1,5,-3,6,-5,7,-6,9,-7],124:[8,4,25,4,-7],125:[14,5,25,7,24,8,23,9,21,9,19,8,17,7,16,6,14,6,12,8,10,void 0,7,24,8,22,8,20,7,18,6,17,5,15,5,13,6,11,10,9,6,7,5,5,5,3,6,1,7,0,8,-2,8,-4,7,-6,void 0,8,8,6,6,6,4,7,2,8,1,9,-1,9,-3,8,-5,7,-6,5,-7],126:[24,3,6,3,8,4,11,6,12,8,12,10,11,14,8,16,7,18,7,20,8,21,10,void 0,3,8,4,10,6,11,8,11,10,10,14,7,16,6,18,6,20,7,21,10,21,12]}});var Tlt=lt(function(Rla,fHn){var x4i=AHn(),C4i={xOffset:0,yOffset:0,input:"?",align:"left",font:x4i,height:14,lineSpacing:2.142857142857143,letterSpacing:1,extrudeOffset:0},b4i=(e,t)=>{if(!t&&typeof e==="string")e={input:e};e=e||{};let n=Object.assign({},C4i,e);return n.input=t||n.input,n};fHn.exports=b4i});var Dlt=lt(function(Qla,yHn){var I4i=Tlt(),v4i=(e,t)=>{let{xOffset:n,yOffset:o,input:r,font:i,height:s,extrudeOffset:a}=I4i(e,t),c=r.charCodeAt(0);if(!c||!i[c])c=63;let l=[].concat(i[c]),h=(s-a)/i.height,d=a/2,u=l.shift()*h,_=[],p=[];for(let m=0,A=l.length;m<A;m+=2){let g=h*l[m]+n,f=h*l[m+1]+o+d;if(l[m]!==void 0){p.push([g,f]);continue}_.push(p),p=[],m--}if(p.length)_.push(p);return{width:u,height:s,segments:_}};yHn.exports=v4i});var bHn=lt(function(kla,CHn){var S4i=Dlt(),P4i=Tlt(),xHn=(e,t)=>{let{x:n,y:o}=Object.assign({x:0,y:0},e||{}),r=t.segments,i=null,s=null;for(let a=0,c=r.length;a<c;a++){i=r[a];for(let l=0,h=i.length;l<h;l++)s=i[l],i[l]=[s[0]+n,s[1]+o]}return t},E4i=(e,t)=>{let{xOffset:n,yOffset:o,input:r,font:i,height:s,align:a,extrudeOffset:c,lineSpacing:l,letterSpacing:h}=P4i(e,t),[d,u]=[n,o],_,p,m,A,g,f,y={width:0,segments:[]},x=[],C=[],b=0,I=d,v=()=>{x.push(y),b=Math.max(b,y.width),y={width:0,segments:[]}};for(_=0,p=r.length;_<p;_++){if(m=r[_],A=S4i({xOffset:d,yOffset:u,font:i,height:s,extrudeOffset:c},m),m===`
`){d=I,u-=A.height*l,v();continue}if(g=A.width*h,y.width+=g,d+=g,m!==" ")y.segments=y.segments.concat(A.segments)}if(y.segments.length)v();for(_=0,p=x.length;_<p;_++){if(y=x[_],b>y.width){if(f=b-y.width,a==="right")y=xHn({x:f},y);else if(a==="center")y=xHn({x:f/2},y)}C=C.concat(y.segments)}return C};CHn.exports=E4i});var vHn=lt(function(Lla,IHn){IHn.exports={vectorChar:Dlt(),vectorText:bHn()}});var ree=lt(function(Hla,SHn){var M4i=zs(),w4i=Ds(),B4i=bh(),T4i=(e)=>{let t;for(let n of e){let o=0;if(M4i.isA(n))o=1;if(w4i.isA(n))o=2;if(B4i.isA(n))o=3;if(t&&o!==t)return!1;t=o}return!0};SHn.exports=T4i});var EHn=lt(function(Fla,PHn){var D4i=(e)=>e*0.017453292519943295;PHn.exports=D4i});var Nlt=lt(function(zla,MHn){var N4i=(e,t)=>e-t;MHn.exports=N4i});var BHn=lt(function(Ola,wHn){var R4i=(e,t,n)=>{let o=0,r=e.length;while(r>o){let i=Math.floor((o+r)/2),s=e[i];if(n(t,s)>0)o=i+1;else r=i}e.splice(o,0,t)};wHn.exports=R4i});var NHn=lt(function(Vla,DHn){var{TAU:THn}=rc(),Q4i=(e,t,n)=>{let o=t>0?e*THn/t:0,r=n>0?THn/n:0;return Math.ceil(Math.max(o,r,4))};DHn.exports=Q4i});var QHn=lt(function(Yla,RHn){var k4i=(e)=>e*57.29577951308232;RHn.exports=k4i});var Rlt=lt(function(Gla,kHn){kHn.exports={areAllShapesTheSameType:ree(),degToRad:EHn(),flatten:ms(),fnNumberSort:Nlt(),insertSorted:BHn(),radiusToSegments:NHn(),radToDeg:QHn()}});var QSe=lt(function(Ula,HHn){var LHn=da(),L4i=zs(),H4i=(e,t)=>{if(t.vertices.length<4)return null;let n=[],o=t.vertices.filter((s,a)=>{if(s[2]>0)return n.push(a),!0;return!1});if(o.length!==2)throw Error("Assertion failed: fromFakePolygon: not enough points found");let r=o.map((s)=>{let a=Math.round(s[0]/e)*e+0,c=Math.round(s[1]/e)*e+0;return LHn.fromValues(a,c)});if(LHn.equals(r[0],r[1]))return null;let i=n[1]-n[0];if(i===1||i===3){if(i===1)r.reverse()}else throw Error("Assertion failed: fromFakePolygon: unknown index ordering");return r},F4i=(e,t)=>{let n=t.map((o)=>H4i(e,o)).filter((o)=>o!==null);return L4i.create(n)};HHn.exports=F4i});var kSe=lt(function(Wla,FHn){var oL=si(),z4i=zs(),O4i=Ds(),V4i=za(),Y4i=(e,t,n)=>{let o=[oL.fromVec2(oL.create(),n[0],e),oL.fromVec2(oL.create(),n[1],e),oL.fromVec2(oL.create(),n[1],t),oL.fromVec2(oL.create(),n[0],t)];return V4i.create(o)},G4i=(e,t)=>{let o=z4i.toSides(t).map((i)=>Y4i(e.z0,e.z1,i));return O4i.create(o)};FHn.exports=G4i});var YHn=lt(function(Xla,VHn){var zHn=Fh(),U4i=da(),g_=si(),OHn=function(e,t){if(arguments.length<2)t=g_.orthogonal(g_.create(),e);this.v=g_.normalize(g_.create(),g_.cross(g_.create(),e,t)),this.u=g_.cross(g_.create(),this.v,e),this.plane=e,this.planeorigin=g_.scale(g_.create(),e,e[3])};OHn.prototype={getProjectionMatrix:function(){return zHn.fromValues(this.u[0],this.v[0],this.plane[0],0,this.u[1],this.v[1],this.plane[1],0,this.u[2],this.v[2],this.plane[2],0,0,0,-this.plane[3],1)},getInverseProjectionMatrix:function(){let e=g_.scale(g_.create(),this.plane,this.plane[3]);return zHn.fromValues(this.u[0],this.u[1],this.u[2],0,this.v[0],this.v[1],this.v[2],0,this.plane[0],this.plane[1],this.plane[2],0,e[0],e[1],e[2],1)},to2D:function(e){return U4i.fromValues(g_.dot(e,this.u),g_.dot(e,this.v))},to3D:function(e){let t=g_.scale(g_.create(),this.u,e[0]),n=g_.scale(g_.create(),this.v,e[1]),o=g_.add(t,t,this.planeorigin);return g_.add(n,n,o)}};VHn.exports=OHn});var WHn=lt(function(jla,UHn){var{EPS:wB}=rc(),rL=hSe(),O9=da(),W4i=YHn(),iee=Xct(),{insertSorted:X4i,fnNumberSort:j4i}=Rlt(),GHn=za(),K4i=(e)=>{if(e.length<2)return e;let t=[],n=e.length,o=GHn.plane(e[0]),r=new W4i(o),i=[],s=[],a=new Map,c=new Map,l=new Map,h=10/wB;for(let p=0;p<n;p++){let m=e[p],A=[],g=m.vertices.length,f=-1;if(g>0){let y,x;for(let C=0;C<g;C++){let b=r.to2D(m.vertices[C]),I=Math.floor(b[1]*h),v;if(l.has(I))v=l.get(I);else if(l.has(I+1))v=l.get(I+1);else if(l.has(I-1))v=l.get(I-1);else v=b[1],l.set(I,b[1]);b=O9.fromValues(b[0],v),A.push(b);let P=b[1];if(C===0||P<y)y=P,f=C;if(C===0||P>x)x=P;let M=c.get(P);if(!M)M={},c.set(P,M);M[p]=!0}if(y>=x)A=[],g=0,f=-1;else{let C=a.get(y);if(!C)C=[],a.set(y,C);C.push(p)}}A.reverse(),f=g-f-1,i.push(A),s.push(f)}let d=[];c.forEach((p,m)=>d.push(m)),d.sort(j4i);let u=[],_=[];for(let p=0;p<d.length;p++){let m=[],A=d[p],g=c.get(A),f=0;for(let x=0;x<u.length;++x){let C=u[x],b=C.polygonindex;if(g[b]){let I=i[b],v=I.length,{leftvertexindex:P,rightvertexindex:M}=C;while(!0){let T=P+1;if(T>=v)T=0;if(I[T][1]!==A)break;P=T}let B=M-1;if(B<0)B=v-1;if(I[B][1]===A)M=B;if(P!==C.leftvertexindex&&P===M)C._remove=!0,f++;else{C.leftvertexindex=P,C.rightvertexindex=M,C.topleft=I[P],C.topright=I[M];let T=P+1;if(T>=v)T=0;C.bottomleft=I[T];let N=M-1;if(N<0)N=v-1;C.bottomright=I[N]}}}if(f>0)u=u.filter((x)=>!x._remove);let y;if(p>=d.length-1)u=[],y=null;else{y=Number(d[p+1]);let x=0.5*(A+y),C=a.get(A);for(let b in C){let I=C[b],v=i[I],P=v.length,M=s[I],B=M;while(!0){let H=B+1;if(H>=P)H=0;if(v[H][1]!==A)break;if(H===M)break;B=H}let T=M;while(!0){let H=T-1;if(H<0)H=P-1;if(v[H][1]!==A)break;if(H===B)break;T=H}let N=B+1;if(N>=P)N=0;let D=T-1;if(D<0)D=P-1;let L={polygonindex:I,leftvertexindex:B,rightvertexindex:T,topleft:v[B],topright:v[T],bottomleft:v[N],bottomright:v[D]};X4i(u,L,(H,V)=>{let O=iee(H.topleft,H.bottomleft,x),U=iee(V.topleft,V.bottomleft,x);if(O>U)return 1;if(O<U)return-1;return 0})}}for(let x in u){let C=u[x],b=iee(C.topleft,C.bottomleft,A),I=O9.fromValues(b,A);b=iee(C.topright,C.bottomright,A);let v=O9.fromValues(b,A);b=iee(C.topleft,C.bottomleft,y);let P=O9.fromValues(b,y);b=iee(C.topright,C.bottomright,y);let M=O9.fromValues(b,y),B={topleft:I,topright:v,bottomleft:P,bottomright:M,leftline:rL.fromPoints(rL.create(),I,P),rightline:rL.fromPoints(rL.create(),M,v)};if(m.length>0){let T=m[m.length-1],N=O9.distance(B.topleft,T.topright),D=O9.distance(B.bottomleft,T.bottomright);if(N<wB&&D<wB)B.topleft=T.topleft,B.leftline=T.leftline,B.bottomleft=T.bottomleft,m.splice(m.length-1,1)}m.push(B)}if(p>0){let x=new Set,C=new Set;for(let b=0;b<m.length;b++){let I=m[b];for(let v=0;v<_.length;v++)if(!C.has(v)){let P=_[v];if(O9.distance(P.bottomleft,I.topleft)<wB){if(O9.distance(P.bottomright,I.topright)<wB){C.add(v);let M=rL.direction(I.leftline),B=rL.direction(P.leftline),T=M[0]-B[0],N=rL.direction(I.rightline),D=rL.direction(P.rightline),L=N[0]-D[0],H=Math.abs(T)<wB,V=Math.abs(L)<wB,O=H||T>=0,U=V||L>=0;if(O&&U)I.outpolygon=P.outpolygon,I.leftlinecontinues=H,I.rightlinecontinues=V,x.add(v);break}}}}for(let b=0;b<_.length;b++)if(!x.has(b)){let I=_[b];if(I.outpolygon.rightpoints.push(I.bottomright),O9.distance(I.bottomright,I.bottomleft)>wB)I.outpolygon.leftpoints.push(I.bottomleft);I.outpolygon.leftpoints.reverse();let P=I.outpolygon.rightpoints.concat(I.outpolygon.leftpoints).map((B)=>r.to3D(B)),M=GHn.fromPointsAndPlane(P,o);if(M.vertices.length)t.push(M)}}for(let x=0;x<m.length;x++){let C=m[x];if(!C.outpolygon){if(C.outpolygon={leftpoints:[],rightpoints:[]},C.outpolygon.leftpoints.push(C.topleft),O9.distance(C.topleft,C.topright)>wB)C.outpolygon.rightpoints.push(C.topright)}else{if(!C.leftlinecontinues)C.outpolygon.leftpoints.push(C.topleft);if(!C.rightlinecontinues)C.outpolygon.rightpoints.push(C.topright)}}_=m}return t};UHn.exports=K4i});var see=lt(function(Kla,jHn){var XHn=Ds(),$4i=za(),{NEPS:q4i}=rc(),J4i=WHn(),Z4i=(e)=>{if(e.isRetesselated)return e;let t=XHn.toPolygons(e).map((i,s)=>({vertices:i.vertices,plane:$4i.plane(i),index:s})),n=e3i(t),o=[];n.forEach((i)=>{if(Array.isArray(i)){let s=J4i(i);for(let a=0;a<s.length;a++)o.push(s[a])}else o.push(i)});let r=XHn.create(o);return r.isRetesselated=!0,r},e3i=(e)=>{let t=[e],n=[];for(let r=3;r>=0;r--){let i=[],s=r===3?0.000000015:q4i;t.forEach((a)=>{a.sort(t3i(r,s));let c=0;for(let l=1;l<a.length;l++)if(a[l].plane[r]-a[c].plane[r]>s){if(l-c===1)n.push(a[c]);else i.push(a.slice(c,l));c=l}if(a.length-c===1)n.push(a[c]);else i.push(a.slice(c))}),t=i}let o=[];return t.forEach((r)=>{if(r[0])o[r[0].index]=r}),n.forEach((r)=>{o[r.index]=r}),o},t3i=(e,t)=>(n,o)=>{if(n.plane[e]-o.plane[e]>t)return 1;else if(o.plane[e]-n.plane[e]>t)return-1;return 0};jHn.exports=Z4i});var LSe=lt(function($la,$Hn){var{EPS:aee}=rc(),KHn=$k(),n3i=(e,t)=>{if(e.polygons.length===0||t.polygons.length===0)return!1;let n=KHn(e),o=n[0],r=n[1],i=KHn(t),s=i[0],a=i[1];if(s[0]-r[0]>aee)return!1;if(o[0]-a[0]>aee)return!1;if(s[1]-r[1]>aee)return!1;if(o[1]-a[1]>aee)return!1;if(s[2]-r[2]>aee)return!1;if(o[2]-a[2]>aee)return!1;return!0};$Hn.exports=n3i});var ZHn=lt(function(qla,JHn){var qHn=z9(),o3i=za();class HSe{constructor(e){this.plane=null,this.front=null,this.back=null,this.polygontreenodes=[],this.parent=e}invert(){let e=[this],t;for(let n=0;n<e.length;n++){if(t=e[n],t.plane)t.plane=qHn.flip(qHn.create(),t.plane);if(t.front)e.push(t.front);if(t.back)e.push(t.back);let o=t.front;t.front=t.back,t.back=o}}clipPolygons(e,t){let n={node:this,polygontreenodes:e},o,r=[];do{if(o=n.node,e=n.polygontreenodes,o.plane){let i=o.plane,s=[],a=[],c=t?s:a,l=e.length;for(let d=0;d<l;d++){let u=e[d];if(!u.isRemoved())u.splitByPlane(i,c,s,a,s)}if(o.front&&a.length>0)r.push({node:o.front,polygontreenodes:a});let h=s.length;if(o.back&&h>0)r.push({node:o.back,polygontreenodes:s});else for(let d=0;d<h;d++)s[d].remove()}n=r.pop()}while(n!==void 0)}clipTo(e,t){let n=this,o=[];do{if(n.polygontreenodes.length>0)e.rootnode.clipPolygons(n.polygontreenodes,t);if(n.front)o.push(n.front);if(n.back)o.push(n.back);n=o.pop()}while(n!==void 0)}addPolygonTreeNodes(e){let t={node:this,polygontreenodes:e},n=[];do{let o=t.node,r=t.polygontreenodes;if(r.length===0){t=n.pop();continue}if(!o.plane){let c=0;c=Math.floor(r.length/2);let l=r[c].getPolygon();o.plane=o3i.plane(l)}let i=[],s=[],a=r.length;for(let c=0;c<a;++c)r[c].splitByPlane(o.plane,o.polygontreenodes,s,i,s);if(i.length>0){if(!o.front)o.front=new HSe(o);if(a===i.length&&s.length===0)o.front.polygontreenodes=i;else n.push({node:o.front,polygontreenodes:i})}if(s.length>0){if(!o.back)o.back=new HSe(o);if(a===s.length&&i.length===0)o.back.polygontreenodes=s;else n.push({node:o.back,polygontreenodes:s})}t=n.pop()}while(t!==void 0)}}JHn.exports=HSe});var tFn=lt(function(Jla,eFn){var cee=si(),r3i=(e,t,n)=>{let o=cee.subtract(cee.create(),n,t),r=(e[3]-cee.dot(e,t))/cee.dot(e,o);if(Number.isNaN(r))r=0;if(r>1)r=1;if(r<0)r=0;return cee.scale(o,o,r),cee.add(o,t,o),o};eFn.exports=r3i});var rFn=lt(function(Zla,oFn){var{EPS:FSe}=rc(),i3i=z9(),Qlt=si(),klt=za(),s3i=tFn(),a3i=FSe*FSe,nFn=(e)=>{let t=[],n=e[e.length-1];for(let o=0;o<e.length;o++){let r=e[o];if(Qlt.squaredDistance(r,n)>=a3i)t.push(r);n=r}return t},c3i=(e,t)=>{let n={type:null,front:null,back:null},o=t.vertices,r=o.length,i=klt.plane(t);if(i3i.equals(i,e))n.type=0;else{let s=!1,a=!1,c=[],l=-FSe;for(let h=0;h<r;h++){let d=Qlt.dot(e,o[h])-e[3],u=d<l;if(c.push(u),d>FSe)s=!0;if(d<l)a=!0}if(!s&&!a){let h=Qlt.dot(e,i);n.type=h>=0?0:1}else if(!a)n.type=2;else if(!s)n.type=3;else{n.type=4;let h=[],d=[],u=c[0];for(let _=0;_<r;_++){let p=o[_],m=_+1;if(m>=r)m=0;let A=c[m];if(u===A)if(u)d.push(p);else h.push(p);else{let g=o[m],f=s3i(e,p,g);if(u)d.push(p),d.push(f),h.push(f);else h.push(p),h.push(f),d.push(f)}u=A}if(h.length>=3){let _=nFn(h);if(_.length>=3)n.front=klt.fromPointsAndPlane(_,i)}if(d.length>=3){let _=nFn(d);if(_.length>=3)n.back=klt.fromPointsAndPlane(_,i)}}}return n};oFn.exports=c3i});var aFn=lt(function(eha,sFn){var{EPS:l3i}=rc(),h3i=si(),iFn=za(),d3i=rFn();class Llt{constructor(e,t){this.parent=e,this.children=[],this.polygon=t,this.removed=!1}addPolygons(e){if(!this.isRootNode())throw Error("Assertion failed");let t=this;e.forEach((n)=>{t.addChild(n)})}remove(){if(!this.removed)this.removed=!0,this.polygon=null,this.parent.recursivelyInvalidatePolygon()}isRemoved(){return this.removed}isRootNode(){return!this.parent}invert(){if(!this.isRootNode())throw Error("Assertion failed");this.invertSub()}getPolygon(){if(!this.polygon)throw Error("Assertion failed");return this.polygon}getPolygons(e){if(this.isRootNode()&&this.children.length>0){let a=[];for(let c=0;c<this.children.length;c++)if(!this.children[c].removed)a.push(this.children[c]);this.children=a}let t=[this],n=[t],o,r,i,s;for(o=0;o<n.length;++o){t=n[o];for(r=0,i=t.length;r<i;r++)if(s=t[r],s.polygon)e.push(s.polygon);else if(s.children.length>0)n.push(s.children)}}splitByPlane(e,t,n,o,r){if(this.children.length){let i=[this.children],s,a,c,l,h;for(s=0;s<i.length;s++){h=i[s];for(a=0,c=h.length;a<c;a++)if(l=h[a],l.children.length>0)i.push(l.children);else l._splitByPlane(e,t,n,o,r)}}else this._splitByPlane(e,t,n,o,r)}_splitByPlane(e,t,n,o,r){let i=this.polygon;if(i){let s=iFn.measureBoundingSphere(i),a=s[3]+l3i,l=h3i.dot(e,s)-e[3];if(l>a)o.push(this);else if(l<-a)r.push(this);else{let h=d3i(e,i);switch(h.type){case 0:t.push(this);break;case 1:n.push(this);break;case 2:o.push(this);break;case 3:r.push(this);break;case 4:if(h.front){let d=this.addChild(h.front);o.push(d)}if(h.back){let d=this.addChild(h.back);r.push(d)}break}}}}addChild(e){let t=new Llt(this,e);return this.children.push(t),t}invertSub(){let e=[this],t=[e],n,o,r,i;for(n=0;n<t.length;n++){e=t[n];for(o=0,r=e.length;o<r;o++){if(i=e[o],i.polygon)i.polygon=iFn.invert(i.polygon);if(i.children.length>0)t.push(i.children)}}}recursivelyInvalidatePolygon(){if(this.polygon=null,this.parent)this.parent.recursivelyInvalidatePolygon()}clear(){let e=[this],t=[e];for(let n=0;n<t.length;++n){e=t[n];let o=e.length;for(let r=0;r<o;r++){let i=e[r];if(i.polygon)i.polygon=null;if(i.parent)i.parent=null;if(i.children.length>0)t.push(i.children);i.children=[]}}}toString(){let e="",t=[this],n=[t],o,r,i,s;for(o=0;o<n.length;++o){t=n[o];let a=" ".repeat(o);for(r=0,i=t.length;r<i;r++){if(s=t[r],e+=`${a}PolygonTreeNode (${s.isRootNode()}): ${s.children.length}`,s.polygon)e+=`
 ${a}polygon: ${s.polygon.vertices}
`;else e+=`
`;if(s.children.length>0)n.push(s.children)}}return e}}sFn.exports=Llt});var hFn=lt(function(tha,lFn){var u3i=ZHn(),p3i=aFn();class cFn{constructor(e){if(this.polygonTree=new p3i,this.rootnode=new u3i(null),e)this.addPolygons(e)}invert(){this.polygonTree.invert(),this.rootnode.invert()}clipTo(e,t=!1){this.rootnode.clipTo(e,t)}allPolygons(){let e=[];return this.polygonTree.getPolygons(e),e}addPolygons(e){let t=Array(e.length);for(let n=0;n<e.length;n++)t[n]=this.polygonTree.addChild(e[n]);this.rootnode.addPolygonTreeNodes(t)}clear(){this.polygonTree.clear()}toString(){return"Tree: "+this.polygonTree.toString("")}}lFn.exports=cFn});var zSe=lt(function(nha,dFn){dFn.exports={Tree:hFn()}});var mFn=lt(function(oha,pFn){var OSe=Ds(),m3i=LSe(),{Tree:uFn}=zSe(),_3i=(e,t)=>{if(!m3i(e,t))return OSe.create();let n=new uFn(OSe.toPolygons(e)),o=new uFn(OSe.toPolygons(t));n.invert(),o.clipTo(n),o.invert(),n.clipTo(o),o.clipTo(n),n.addPolygons(o.allPolygons()),n.invert();let r=n.allPolygons();return OSe.create(r)};pFn.exports=_3i});var Hlt=lt(function(rha,_Fn){var g3i=ms(),A3i=see(),f3i=mFn(),y3i=(...e)=>{e=g3i(e);let t=e.shift();return e.forEach((n)=>{t=f3i(t,n)}),t=A3i(t),t};_Fn.exports=y3i});var AFn=lt(function(iha,gFn){var x3i=ms(),C3i=Ds(),b3i=EB(),I3i=QSe(),v3i=kSe(),S3i=Hlt(),P3i=(...e)=>{e=x3i(e);let t=e.map((r)=>v3i({z0:-1,z1:1},r)),n=S3i(t),o=b3i(n);return I3i(o,C3i.toPolygons(n))};gFn.exports=P3i});var yFn=lt(function(sha,fFn){var E3i=ms(),M3i=ree(),w3i=zs(),B3i=Ds(),T3i=AFn(),D3i=Hlt(),N3i=(...e)=>{if(e=E3i(e),e.length===0)throw Error("wrong number of arguments");if(!M3i(e))throw Error("only intersect of the types are supported");let t=e[0];if(w3i.isA(t))return T3i(e);if(B3i.isA(t))return D3i(e);return t};fFn.exports=N3i});var VSe=lt(function(aha,xFn){var R3i=za(),Q3i=pct(),k3i=(e)=>Q3i(e,{skipTriangulation:!0}).map((o)=>{let r=o.map((i)=>e[i]);return R3i.create(r)});xFn.exports=k3i});var Flt=lt(function(cha,bFn){var lee=Ds(),L3i=LSe(),{Tree:CFn}=zSe(),H3i=(e,t)=>{if(!L3i(e,t))return F3i(e,t);let n=new CFn(lee.toPolygons(e)),o=new CFn(lee.toPolygons(t));n.clipTo(o,!1),o.clipTo(n),o.invert(),o.clipTo(n),o.invert();let r=n.allPolygons().concat(o.allPolygons());return lee.create(r)},F3i=(e,t)=>{let n=lee.toPolygons(e);return n=n.concat(lee.toPolygons(t)),lee.create(n)};bFn.exports=H3i});var YSe=lt(function(lha,IFn){var z3i=ms(),O3i=see(),V3i=Flt(),Y3i=(...e)=>{e=z3i(e);let t;for(t=1;t<e.length;t+=2)e.push(V3i(e[t-1],e[t]));let n=e[t-1];return n=O3i(n),n};IFn.exports=Y3i});var zlt=lt(function(hha,EFn){var G3i=ms(),cP=Ds(),m0e=za(),U3i=VSe(),W3i=YSe(),X3i=(...e)=>{if(e=G3i(e),e.length!==2)throw Error("minkowskiSum requires exactly two geometries");let[t,n]=e;if(!cP.isA(t)||!cP.isA(n))throw Error("minkowskiSum requires geom3 geometries");let o=cP.isConvex(t),r=cP.isConvex(n);if(o&&r)return PFn(t,n);if(!o&&r)return vFn(t,n);if(o&&!r)return vFn(n,t);throw Error("minkowskiSum of two non-convex geometries is not yet supported")},vFn=(e,t)=>{let n=j3i(e);if(n.length===0)return cP.create();let o=n.map((r)=>PFn(r,t));if(o.length===1)return o[0];return W3i(o)},j3i=(e)=>{let t=cP.toPolygons(e);if(t.length===0)return[];let n=[];for(let o=0;o<t.length;o++){let r=t[o],i=r.vertices,s=0,a=0,c=0;for(let m=0;m<i.length;m++)s+=i[m][0],a+=i[m][1],c+=i[m][2];s/=i.length,a/=i.length,c/=i.length;let l=m0e.plane(r),h=l[0],d=l[1],u=l[2],_=0.1,p=[s-h*_,a-d*_,c-u*_];for(let m=1;m<i.length-1;m++){let A=i[0],g=i[m],f=i[m+1],y=K3i(p,A,g,f);n.push(cP.create(y))}}return n},K3i=(e,t,n,o)=>[m0e.create([e,n,t]),m0e.create([e,t,o]),m0e.create([t,n,o]),m0e.create([n,e,o])],PFn=(e,t)=>{let n=SFn(e),o=SFn(t);if(n.length===0||o.length===0)return cP.create();let r=[];for(let s=0;s<n.length;s++){let a=n[s];for(let c=0;c<o.length;c++){let l=o[c];r.push([a[0]+l[0],a[1]+l[1],a[2]+l[2]])}}let i=U3i(r);return cP.create(i)},SFn=(e)=>{let t=new Set,n=[],o=cP.toPolygons(e);for(let r=0;r<o.length;r++){let i=o[r].vertices;for(let s=0;s<i.length;s++){let a=i[s],c=`${a[0]},${a[1]},${a[2]}`;if(!t.has(c))t.add(c),n.push(a)}}return n};EFn.exports=X3i});var BFn=lt(function(dha,wFn){var Olt=si(),$3i=EB(),MFn=Ds(),q3i=(e)=>e.sort((t,n)=>t-n).filter((t,n,o)=>!n||t!==o[n-1]),J3i=(e,t,n)=>{let o=`${t}`,r=e.get(o);if(r===void 0)e.set(o,[n]);else r.push(n)},Z3i=(e,t)=>{let n=`${t}`;return e.get(n)},eCi=(e)=>{let t=$3i(e),n=MFn.toPolygons(e),o=n.length,r=new Map,i=Olt.create();n.forEach((h,d)=>{h.vertices.forEach((u)=>{J3i(r,Olt.snap(i,u,t),d)})});let s=n.map((h)=>{let d=[];return h.vertices.forEach((u)=>{d=d.concat(Z3i(r,Olt.snap(i,u,t)))}),{e:1,d:q3i(d)}});r.clear();let a=0,c=s.length;for(let h=0;h<c;h++){let d=s[h];if(d.e>0){let u=Array(o);u[h]=!0;do a=0,u.forEach((_,p)=>{let m=s[p];if(m.e>0){m.e=-1;for(let A=0;A<m.d.length;A++)u[m.d[A]]=!0;a++}});while(a>0);d.indexes=u}}let l=[];for(let h=0;h<c;h++)if(s[h].indexes){let d=[];s[h].indexes.forEach((u,_)=>d.push(n[_])),l.push(MFn.create(d))}return l};wFn.exports=eCi});var DFn=lt(function(uha,TFn){var tCi=ms(),nCi=Ds(),oCi=BFn(),rCi=(...e)=>{if(e=tCi(e),e.length===0)throw Error("wrong number of arguments");let t=e.map((n)=>{if(nCi.isA(n))return oCi(n);return n});return t.length===1?t[0]:t};TFn.exports=rCi});var QFn=lt(function(pha,RFn){var GSe=Ds(),iCi=LSe(),{Tree:NFn}=zSe(),sCi=(e,t)=>{if(!iCi(e,t))return GSe.clone(e);let n=new NFn(GSe.toPolygons(e)),o=new NFn(GSe.toPolygons(t));n.invert(),n.clipTo(o),o.clipTo(n,!0),n.addPolygons(o.allPolygons()),n.invert();let r=n.allPolygons();return GSe.create(r)};RFn.exports=sCi});var Vlt=lt(function(mha,kFn){var aCi=ms(),cCi=see(),lCi=QFn(),hCi=(...e)=>{e=aCi(e);let t=e.shift();return e.forEach((n)=>{t=lCi(t,n)}),t=cCi(t),t};kFn.exports=hCi});var HFn=lt(function(_ha,LFn){var dCi=ms(),uCi=Ds(),pCi=EB(),mCi=QSe(),_Ci=kSe(),gCi=Vlt(),ACi=(...e)=>{e=dCi(e);let t=e.map((r)=>_Ci({z0:-1,z1:1},r)),n=gCi(t),o=pCi(n);return mCi(o,uCi.toPolygons(n))};LFn.exports=ACi});var zFn=lt(function(gha,FFn){var fCi=ms(),yCi=ree(),xCi=zs(),CCi=Ds(),bCi=HFn(),ICi=Vlt(),vCi=(...e)=>{if(e=fCi(e),e.length===0)throw Error("wrong number of arguments");if(!yCi(e))throw Error("only subtract of the types are supported");let t=e[0];if(xCi.isA(t))return bCi(e);if(CCi.isA(t))return ICi(e);return t};FFn.exports=vCi});var Ylt=lt(function(Aha,OFn){var SCi=ms(),PCi=Ds(),ECi=EB(),MCi=QSe(),wCi=kSe(),BCi=YSe(),TCi=(...e)=>{e=SCi(e);let t=e.map((r)=>wCi({z0:-1,z1:1},r)),n=BCi(t),o=ECi(n);return MCi(o,PCi.toPolygons(n))};OFn.exports=TCi});var USe=lt(function(fha,VFn){var DCi=ms(),NCi=ree(),RCi=zs(),QCi=Ds(),kCi=Ylt(),LCi=YSe(),HCi=(...e)=>{if(e=DCi(e),e.length===0)throw Error("wrong number of arguments");if(!NCi(e))throw Error("only unions of the same type are supported");let t=e[0];if(RCi.isA(t))return kCi(e);if(QCi.isA(t))return LCi(e);return t};VFn.exports=HCi});var GFn=lt(function(yha,YFn){YFn.exports={intersect:yFn(),minkowski:zlt(),scission:DFn(),subtract:zFn(),union:USe()}});var g0e=lt(function(xha,WFn){var{EPS:FCi,TAU:zCi}=rc(),UFn=jct(),_0e=hSe(),Z0=da(),OCi=n0e(),VCi=(e,t)=>{let n={delta:1,corners:"edge",closed:!1,segments:16},{delta:o,corners:r,closed:i,segments:s}=Object.assign({},n,e);if(Math.abs(o)<FCi)return t;let a=e.closed?OCi(t):1;if(a===0)a=1;let c=a>0&&o>=0||a<0&&o<0;o=Math.abs(o);let l=null,h=[],d=[],u=Z0.create(),_=t.length;for(let p=0;p<_;p++){let m=(p+1)%_,A=t[p],g=t[m];c?Z0.subtract(u,A,g):Z0.subtract(u,g,A),Z0.normal(u,u),Z0.normalize(u,u),Z0.scale(u,u,o);let f=Z0.add(Z0.create(),A,u),y=Z0.add(Z0.create(),g,u),x=[f,y];if(l!=null){if(i||!i&&m!==0){let C=UFn(l[0],l[1],x[0],x[1]);if(C)h.pop(),x[0]=C;else d.push({c:A,s0:l,s1:x})}}if(l=[f,y],m===0&&!i)continue;h.push(x[0]),h.push(x[1])}if(i&&l!=null){let p=h[0],m=h[1],A=UFn(l[0],l[1],p,m);if(A)h[0]=A,h.pop();else{let g=t[0],f=[p,m];d.push({c:g,s0:l,s1:f})}}if(r==="edge"){let p=new Map;h.forEach((g,f)=>p.set(g,f));let m=_0e.create(),A=_0e.create();d.forEach((g)=>{_0e.fromPoints(m,g.s0[0],g.s0[1]),_0e.fromPoints(A,g.s1[0],g.s1[1]);let f=_0e.intersectPointOfLines(m,A);if(Number.isFinite(f[0])&&Number.isFinite(f[1])){let y=g.s0[1],x=p.get(y);h[x]=f,h[(x+1)%h.length]=void 0}else{let y=g.s1[0],x=p.get(y);h[x]=void 0}}),h=h.filter((g)=>g!==void 0)}if(r==="round"){let p=Math.floor(s/4),m=Z0.create();d.forEach((A)=>{let g=Z0.angle(Z0.subtract(m,A.s1[0],A.c));if(g-=Z0.angle(Z0.subtract(m,A.s0[1],A.c)),c&&g<0){if(g=g+Math.PI,g<0)g=g+Math.PI}if(!c&&g>0){if(g=g-Math.PI,g>0)g=g-Math.PI}if(g!==0){p=Math.floor(s*(Math.abs(g)/zCi));let f=g/p,y=Z0.angle(Z0.subtract(m,A.s0[1],A.c)),x=[];for(let C=1;C<p;C++){let b=y+f*C,I=Z0.fromAngleRadians(Z0.create(),b);Z0.scale(I,I,o),Z0.add(I,I,A.c),x.push(I)}if(x.length>0){let C=A.s0[1],b=h.findIndex((I)=>Z0.equals(C,I));b=(b+1)%h.length,h.splice(b,0,...x)}}else{let f=A.s1[0],y=h.findIndex((x)=>Z0.equals(f,x));h.splice(y,1)}})}return h};WFn.exports=VCi});var jFn=lt(function(Cha,XFn){var WSe=zs(),YCi=g0e(),GCi=(e,t)=>{let n={delta:1,corners:"edge",segments:16},{delta:o,corners:r,segments:i}=Object.assign({},n,e);if(!(r==="edge"||r==="chamfer"||r==="round"))throw Error('corners must be "edge", "chamfer", or "round"');let c=WSe.toOutlines(t).map((l)=>(e={delta:o,corners:r,closed:!0,segments:i},YCi(e,l))).reduce((l,h)=>l.concat(WSe.toSides(WSe.fromPoints(h))),[]);return WSe.create(c)};XFn.exports=GCi});var qFn=lt(function(bha,$Fn){var KFn=Fh(),UCi=si(),WCi=Ds(),A0e=za(),XCi=(e,t)=>{if(UCi.dot(A0e.plane(t),e)>0)t=A0e.invert(t);let o=[t],r=A0e.transform(KFn.fromTranslation(KFn.create(),e),t),i=t.vertices.length;for(let s=0;s<i;s++){let a=s<i-1?s+1:0,c=A0e.create([t.vertices[s],r.vertices[s],r.vertices[a],t.vertices[a]]);o.push(c)}return o.push(A0e.invert(r)),WCi.create(o)};$Fn.exports=XCi});var ezn=lt(function(Iha,ZFn){var{EPS:jCi,TAU:Glt}=rc(),JFn=Fh(),Ld=si(),KCi=Nlt(),Xlt=Ds(),sG=za(),$Ci=Alt(),qCi=see(),Ult=Flt(),JCi=qFn(),ZCi=(e,t,n)=>{let o=t.toString();if(!e.has(o)){let r=[t,[n]];e.set(o,r)}else e.get(o)[1].push(n)},ebi=(e,t,n)=>{let o=t[0].toString(),r=t[1].toString(),i=o<r?`${o},${r}`:`${r},${o}`;if(!e.has(i)){let s=[t,[n]];e.set(i,s)}else e.get(i)[1].push(n)},Wlt=(e,t)=>{if(e.findIndex((o)=>o===t)<0)e.push(t)},tbi=(e,t)=>{let n={delta:1,segments:12},{delta:o,segments:r}=Object.assign({},n,e),i=Xlt.create(),s=new Map,a=new Map,c=Ld.create(),l=Ld.create();return Xlt.toPolygons(t).forEach((d,u)=>{let _=Ld.scale(Ld.create(),sG.plane(d),2*o),p=sG.transform(JFn.fromTranslation(JFn.create(),Ld.scale(Ld.create(),_,-0.5)),d),m=JCi(_,p);i=Ult(i,m);let A=d.vertices;for(let g=0;g<A.length;g++){ZCi(s,A[g],sG.plane(d));let f=(g+1)%A.length,y=[A[g],A[f]];ebi(a,y,sG.plane(d))}}),a.forEach((d)=>{let u=d[0],_=d[1],p=u[0],m=u[1],A=Ld.subtract(Ld.create(),m,p);Ld.normalize(A,A);let g=_[0],f=Ld.cross(Ld.create(),g,A),y=[];for(let B=0;B<r;B++)Wlt(y,B*Glt/r);for(let B=0,T=_.length;B<T;B++){let N=_[B],D=Ld.dot(f,N),L=Ld.dot(g,N),H=Math.atan2(D,L);if(H<0)H+=Glt;if(Wlt(y,H),H=Math.atan2(-D,-L),H<0)H+=Glt;Wlt(y,H)}y=y.sort(KCi);let x=y.length,C,b,I=[],v=[],P=[];for(let B=-1;B<x;B++){let T=y[B<0?B+x:B],N=Math.sin(T),D=Math.cos(T);Ld.scale(c,g,D*o),Ld.scale(l,f,N*o),Ld.add(c,c,l);let L=Ld.add(Ld.create(),p,c),H=Ld.add(Ld.create(),m,c),V=!1;if(B>=0){if(Ld.distance(L,C)<jCi)V=!0}if(!V){if(B>=0){I.push(L),v.push(H);let U=sG.create([b,H,L,C]);P.push(U)}C=L,b=H}}v.reverse(),P.push(sG.create(I)),P.push(sG.create(v));let M=Xlt.create(P);i=Ult(i,M)}),s.forEach((d)=>{let u=d[0],_=d[1],p=_[0],m=null,A=0;for(let x=1;x<_.length;x++){let C=_[x],b=Ld.cross(c,p,C),I=Ld.length(b);if(I>0.05){if(I>A)A=I,m=C}}if(!m)m=Ld.orthogonal(c,p);let g=Ld.cross(c,p,m);Ld.normalize(g,g);let f=Ld.cross(l,g,p),y=$Ci({center:[u[0],u[1],u[2]],radius:o,segments:r,axes:[p,g,f]});i=Ult(i,y)}),qCi(i)};ZFn.exports=tbi});var nzn=lt(function(vha,tzn){var nbi=Ds(),obi=USe(),rbi=ezn(),ibi=(e,t)=>{let n={delta:1,corners:"round",segments:12},{delta:o,corners:r,segments:i}=Object.assign({},n,e);if(r!=="round")throw Error('corners must be "round" for 3D geometries');if(nbi.toPolygons(t).length===0)throw Error("the given geometry cannot be empty");e={delta:o,corners:r,segments:i};let a=rbi(e,t);return obi(t,a)};tzn.exports=ibi});var izn=lt(function(Sha,rzn){var sbi=n0e(),a5=da(),hee=zs(),f0e=bh(),ozn=g0e(),abi=(e)=>{let{external:t,internal:n}=e;if(sbi(t)<0)t=t.reverse();else n=n.reverse();let o=f0e.fromPoints({closed:!0},t),r=f0e.fromPoints({closed:!0},n),i=hee.toSides(hee.fromPoints(f0e.toPoints(o))),s=hee.toSides(hee.fromPoints(f0e.toPoints(r)));return i.push(...s),hee.create(i)},cbi=(e,t,n,o)=>{let{points:r,external:i,internal:s}=e,a=Math.floor(t/2),c=[],l=[];if(n==="round"&&a>0){let d=Math.PI/a,u=r[r.length-1],_=a5.angle(a5.subtract(a5.create(),i[i.length-1],u)),p=r[0],m=a5.angle(a5.subtract(a5.create(),s[0],p));for(let A=1;A<a;A++){let g=_+d*A,f=a5.fromAngleRadians(a5.create(),g);a5.scale(f,f,o),a5.add(f,f,u),c.push(f),g=m+d*A,f=a5.fromAngleRadians(a5.create(),g),a5.scale(f,f,o),a5.add(f,f,p),l.push(f)}}let h=[];return h.push(...i,...c,...s.reverse(),...l),hee.fromPoints(h)},lbi=(e,t)=>{e=Object.assign({},{delta:1,corners:"edge",segments:16},e);let{delta:o,corners:r,segments:i}=e;if(o<=0)throw Error("the given delta must be positive for paths");if(!(r==="edge"||r==="chamfer"||r==="round"))throw Error('corners must be "edge", "chamfer", or "round"');let s=t.isClosed,a=f0e.toPoints(t);if(a.length===0)throw Error("the given geometry cannot be empty");let c={points:a,external:ozn({delta:o,corners:r,segments:i,closed:s},a),internal:ozn({delta:-o,corners:r,segments:i,closed:s},a)};if(t.isClosed)return abi(c);else return cbi(c,i,r,o)};rzn.exports=lbi});var XSe=lt(function(Pha,szn){var hbi=ms(),dbi=zs(),ubi=Ds(),pbi=bh(),mbi=jFn(),_bi=nzn(),gbi=izn(),Abi=(e,...t)=>{if(t=hbi(t),t.length===0)throw Error("wrong number of arguments");let n=t.map((o)=>{if(pbi.isA(o))return gbi(e,o);if(dbi.isA(o))return mbi(e,o);if(ubi.isA(o))return _bi(e,o);return o});return n.length===1?n[0]:n};szn.exports=Abi});var lzn=lt(function(Eha,czn){var jSe=zs(),azn=iSe(),fbi=g0e(),ybi=(e,t)=>{let n={delta:1,corners:"edge",segments:0},{delta:o,corners:r,segments:i}=Object.assign({},n,e);if(!(r==="edge"||r==="chamfer"||r==="round"))throw Error('corners must be "edge", "chamfer", or "round"');let s=jSe.toOutlines(t),c=s.map((l)=>(e={delta:s.reduce((u,_)=>u+azn.arePointsInside(l,azn.create(_)),0)%2===0?o:-o,corners:r,closed:!0,segments:i},fbi(e,l))).reduce((l,h)=>l.concat(jSe.toSides(jSe.fromPoints(h))),[]);return jSe.create(c)};czn.exports=ybi});var uzn=lt(function(Mha,dzn){var hzn=bh(),xbi=g0e(),Cbi=(e,t)=>{let n={delta:1,corners:"edge",closed:t.isClosed,segments:16},{delta:o,corners:r,closed:i,segments:s}=Object.assign({},n,e);if(!(r==="edge"||r==="chamfer"||r==="round"))throw Error('corners must be "edge", "chamfer", or "round"');e={delta:o,corners:r,closed:i,segments:s};let a=xbi(e,hzn.toPoints(t));return hzn.fromPoints({closed:i},a)};dzn.exports=Cbi});var mzn=lt(function(wha,pzn){var bbi=ms(),Ibi=zs(),vbi=bh(),Sbi=lzn(),Pbi=uzn(),Ebi=(e,...t)=>{if(t=bbi(t),t.length===0)throw Error("wrong number of arguments");let n=t.map((o)=>{if(vbi.isA(o))return Pbi(e,o);if(Ibi.isA(o))return Sbi(e,o);return o});return n.length===1?n[0]:n};pzn.exports=Ebi});var gzn=lt(function(Bha,_zn){_zn.exports={expand:XSe(),offset:mzn()}});var x0e=lt(function(Tha,Azn){var y0e=Fh(),jlt=si(),Mbi=zs(),Klt=iG(),wbi=u0e(),Bbi=(e,t)=>{let n={offset:[0,0,1],twistAngle:0,twistSteps:12,repair:!0},{offset:o,twistAngle:r,twistSteps:i,repair:s}=Object.assign({},n,e);if(i<1)throw Error("twistSteps must be 1 or more");if(r===0)i=1;let a=jlt.clone(o),c=Mbi.toSides(t);if(c.length===0)throw Error("the given geometry cannot be empty");let l=Klt.fromSides(c);if(a[2]<0)Klt.reverse(l,l);let h=y0e.create(),d=(u,_,p)=>{let m=_/i*r,A=jlt.scale(jlt.create(),a,_/i);return y0e.multiply(h,y0e.fromZRotation(h,m),y0e.fromTranslation(y0e.create(),A)),Klt.transform(h,p)};return e={numberOfSlices:i+1,capStart:!0,capEnd:!0,repair:s,callback:d},wbi(e,l)};Azn.exports=Bbi});var yzn=lt(function(Dha,fzn){var Tbi=zs(),Dbi=bh(),Nbi=x0e(),Rbi=(e,t)=>{if(!t.isClosed)throw Error("extruded path must be closed");let n=Dbi.toPoints(t),o=Tbi.fromPoints(n);return Nbi(e,o)};fzn.exports=Rbi});var Czn=lt(function(Nha,xzn){var Qbi=ms(),kbi=zs(),Lbi=bh(),Hbi=x0e(),Fbi=yzn(),zbi=(e,...t)=>{let n={height:1,twistAngle:0,twistSteps:1,repair:!0},{height:o,twistAngle:r,twistSteps:i,repair:s}=Object.assign({},n,e);if(t=Qbi(t),t.length===0)throw Error("wrong number of arguments");e={offset:[0,0,o],twistAngle:r,twistSteps:i,repair:s};let a=t.map((c)=>{if(Lbi.isA(c))return Fbi(e,c);if(kbi.isA(c))return Hbi(e,c);return c});return a.length===1?a[0]:a};xzn.exports=zbi});var Izn=lt(function(Rha,bzn){var Obi=bh(),Vbi=XSe(),Ybi=x0e(),Gbi=(e,t)=>{let n={size:1,height:1},{size:o,height:r}=Object.assign({},n,e);if(e.delta=o,e.offset=[0,0,r],Obi.toPoints(t).length===0)throw Error("the given geometry cannot be empty");let s=Vbi(e,t);return Ybi(e,s)};bzn.exports=Gbi});var Szn=lt(function(Qha,vzn){var{area:Ubi}=GZ(),$lt=zs(),Wbi=bh(),Xbi=XSe(),jbi=x0e(),Kbi=(e,t)=>{let n={size:1,height:1},{size:o,height:r}=Object.assign({},n,e);e.delta=o,e.offset=[0,0,r];let i=$lt.toOutlines(t);if(i.length===0)throw Error("the given geometry cannot be empty");let a=i.map((l)=>{if(Ubi(l)<0)l.reverse();return Xbi(e,Wbi.fromPoints({closed:!0},l))}).reduce((l,h)=>l.concat($lt.toSides(h)),[]),c=$lt.create(a);return jbi(e,c)};vzn.exports=Kbi});var Ezn=lt(function(kha,Pzn){var $bi=ms(),qbi=zs(),Jbi=bh(),Zbi=Izn(),e6i=Szn(),t6i=(e,...t)=>{let n={size:1,height:1},{size:o,height:r}=Object.assign({},n,e);if(t=$bi(t),t.length===0)throw Error("wrong number of arguments");if(o<=0)throw Error("size must be positive");if(r<=0)throw Error("height must be positive");let i=t.map((s)=>{if(Jbi.isA(s))return Zbi(e,s);if(qbi.isA(s))return e6i(e,s);return s});return i.length===1?i[0]:i};Pzn.exports=t6i});var wzn=lt(function(Lha,Mzn){var{TAU:C0e}=rc(),lP=Fh(),n6i=zs(),o6i=u0e(),qlt=iG(),r6i=(e,t)=>{let n={angle:C0e,startAngle:0,pitch:10,height:0,endOffset:0,segmentsPerRotation:32},{angle:o,startAngle:r,pitch:i,height:s,endOffset:a,segmentsPerRotation:c}=Object.assign({},n,e);if(s!=0)i=s/(o/C0e);if(c<3)throw Error("The number of segments per rotation needs to be at least 3.");let h=n6i.toSides(t);if(h.length===0)throw Error("The given geometry cannot be empty");let d=h.filter((f)=>f[0][0]>=0),u=qlt.fromSides(h);if(d.length===0)u=qlt.reverse(u);let _=Math.round(c/C0e*Math.abs(o)),p=_>=2?_:2,m=lP.create(),A=lP.create(),g=(f,y,x)=>{let C=r+o/p*y,b=a/p*y,I=(C-r)/C0e*i;return lP.multiply(m,lP.fromTranslation(lP.create(),[b,0,I*Math.sign(o)]),lP.fromXRotation(lP.create(),-C0e/4*Math.sign(o))),lP.multiply(A,lP.fromZRotation(lP.create(),C),m),qlt.transform(A,x)};return o6i({numberOfSlices:p+1,callback:g},u)};Mzn.exports=r6i});var Qzn=lt(function(Hha,Rzn){var i6i=ms(),Bzn=lSe(),Jlt=z9(),Tzn=Fh(),Dzn=zs(),Nzn=Ds(),dee=za(),s6i=EB(),a6i=Ylt(),c6i=(e,t)=>{let n=Jlt.fromNormalAndPoint(Jlt.create(),e.axis,e.origin);if(Number.isNaN(n[0])||Number.isNaN(n[1])||Number.isNaN(n[2])||Number.isNaN(n[3]))throw Error("project: invalid axis or origin");let o=s6i(t),r=o*o*Math.sqrt(3)/4;if(o===0)return Dzn.create();let i=Nzn.toPolygons(t),s=[];for(let c=0;c<i.length;c++){let l=i[c].vertices.map((u)=>Jlt.projectionOfPoint(n,u)),h=dee.create(l),d=dee.plane(h);if(!Bzn(n,d))continue;if(dee.measureArea(h)<r)continue;s.push(h)}if(!Bzn(n,[0,0,1])){let c=Tzn.fromVectorRotation(Tzn.create(),n,[0,0,1]);s=s.map((l)=>dee.transform(c,l))}s=s.sort((c,l)=>dee.measureArea(l)-dee.measureArea(c));let a=s.map((c)=>Dzn.fromPoints(c.vertices));return a6i(a)},l6i=(e,...t)=>{let n={axis:[0,0,1],origin:[0,0,0]},{axis:o,origin:r}=Object.assign({},n,e);if(t=i6i(t),t.length===0)throw Error("wrong number of arguments");e={axis:o,origin:r};let i=t.map((s)=>{if(Nzn.isA(s))return c6i(e,s);return s});return i.length===1?i[0]:i};Rzn.exports=l6i});var Lzn=lt(function(Fha,kzn){kzn.exports={extrudeFromSlices:u0e(),extrudeLinear:Czn(),extrudeRectangular:Ezn(),extrudeRotate:Elt(),extrudeHelical:wzn(),project:Qzn(),slice:iG()}});var KSe=lt(function(zha,Fzn){var Hzn=da(),h6i=(e)=>{let t=Hzn.fromValues(1/0,1/0);e.forEach((r)=>{if(r[1]<t[1]||r[1]===t[1]&&r[0]<t[0])t=r});let n=[];e.forEach((r)=>{let i=u6i(r[1]-t[1],r[0]-t[0]),s=Hzn.squaredDistance(r,t);n.push({point:r,angle:i,distSq:s})}),n.sort((r,i)=>r.angle!==i.angle?r.angle-i.angle:r.distSq-i.distSq);let o=[];return n.forEach((r)=>{let i=o.length;while(i>1&&d6i(o[i-2],o[i-1],r.point)<=Number.EPSILON)o.pop(),i=o.length;o.push(r.point)}),o},d6i=(e,t,n)=>(t[0]-e[0])*(n[1]-e[1])-(t[1]-e[1])*(n[0]-e[0]),u6i=(e,t)=>{if(e===0&&t===0)return-1/0;else return-t/e};Fzn.exports=h6i});var $Se=lt(function(Oha,Yzn){var zzn=zs(),Ozn=Ds(),Vzn=bh(),p6i=(e)=>{let t=new Set,n=[],o=(r)=>{let i=r.toString();if(!t.has(i))n.push(r),t.add(i)};return e.forEach((r)=>{if(zzn.isA(r))zzn.toPoints(r).forEach(o);else if(Ozn.isA(r))Ozn.toPoints(r).forEach((i)=>i.forEach(o));else if(Vzn.isA(r))Vzn.toPoints(r).forEach(o)}),n};Yzn.exports=p6i});var Uzn=lt(function(Vha,Gzn){var m6i=ms(),_6i=bh(),g6i=KSe(),A6i=$Se(),f6i=(...e)=>{e=m6i(e);let t=A6i(e),n=g6i(t);return _6i.fromPoints({closed:!0},n)};Gzn.exports=f6i});var jzn=lt(function(Yha,Xzn){var y6i=ms(),Wzn=zs(),x6i=KSe(),C6i=$Se(),b6i=(...e)=>{e=y6i(e);let t=C6i(e),n=x6i(t);if(n.length<3)return Wzn.create();return Wzn.fromPoints(n)};Xzn.exports=b6i});var qzn=lt(function(Gha,$zn){var I6i=ms(),Kzn=Ds(),v6i=$Se(),S6i=VSe(),P6i=(...e)=>{e=I6i(e);let t=v6i(e);if(t.length===0)return Kzn.create();return Kzn.create(S6i(t))};$zn.exports=P6i});var Zlt=lt(function(Uha,Jzn){var E6i=ms(),M6i=ree(),w6i=zs(),B6i=Ds(),T6i=bh(),D6i=Uzn(),N6i=jzn(),R6i=qzn(),Q6i=(...e)=>{if(e=E6i(e),e.length===0)throw Error("wrong number of arguments");if(!M6i(e))throw Error("only hulls of the same type are supported");let t=e[0];if(T6i.isA(t))return D6i(e);if(w6i.isA(t))return N6i(e);if(B6i.isA(t))return R6i(e);return t};Jzn.exports=Q6i});var eOn=lt(function(Wha,Zzn){var k6i=ms(),L6i=USe(),H6i=Zlt(),F6i=(...e)=>{if(e=k6i(e),e.length<2)throw Error("wrong number of arguments");let t=[];for(let n=1;n<e.length;n++)t.push(H6i(e[n-1],e[n]));return L6i(t)};Zzn.exports=F6i});var nOn=lt(function(Xha,tOn){tOn.exports={hull:Zlt(),hullChain:eOn(),hullPoints2:KSe(),hullPoints3:VSe()}});var rOn=lt(function(jha,oOn){oOn.exports={minkowskiSum:zlt()}});var tht=lt(function(Kha,sOn){var eht=si(),iOn=za(),z6i=(e,t)=>{let n=Math.abs(iOn.measureArea(t));return Number.isFinite(n)&&n>e},O6i=(e,t)=>{let n=t.map((r)=>{let i=r.vertices.map((c)=>eht.snap(eht.create(),c,e)),s=[];for(let c=0;c<i.length;c++){let l=(c+1)%i.length;if(!eht.equals(i[c],i[l]))s.push(i[c])}let a=iOn.create(s);if(r.color)a.color=r.color;return a}),o=e*e*Math.sqrt(3)/4;return n=n.filter((r)=>z6i(o,r)),n};sOn.exports=O6i});var lOn=lt(function($ha,cOn){var V6i=lSe(),uee=si(),qSe=za(),Y6i=(e)=>{let t=qSe.toPoints(e),n=[];for(let o=0;o<t.length;o++){let r=(o+1)%t.length,i={v1:t[o],v2:t[r]};n.push(i)}for(let o=0;o<n.length;o++){let r=(o+1)%t.length;n[o].next=n[r],n[r].prev=n[o]}return n},G6i=(e,t)=>{let n=`${t.v1}:${t.v2}`;e.set(n,t)},nht=(e,t)=>{let n=`${t.v1}:${t.v2}`;e.delete(n)},U6i=(e,t)=>{let n=`${t.v2}:${t.v1}`;return e.get(n)},W6i=(e,t,n)=>{let o=e.prev.v1,r=e.prev.v2,i=t.next.v2,s=aOn(o,r,i,n);o=t.prev.v1,r=t.prev.v2,i=e.next.v2;let a=aOn(o,r,i,n);return[s,a]},X6i=uee.create(),j6i=uee.create(),aOn=(e,t,n,o)=>{let r=uee.subtract(X6i,t,e),i=uee.subtract(j6i,n,t);return uee.cross(r,r,i),uee.dot(r,o)},K6i=(e)=>{let t,n=[];while(e.next){let o=e.next;n.push(e.v1),e.v1=null,e.v2=null,e.next=null,e.prev=null,e=o}if(n.length>0)t=qSe.create(n);return t},$6i=(e)=>{if(e.length<2)return e;let t=e[0].plane,n=e.slice(),o=new Map;while(n.length>0){let i=n.shift(),s=Y6i(i);for(let a=0;a<s.length;a++){let c=s[a],l=U6i(o,c);if(l){let h=W6i(c,l,t);if(h[0]>=0&&h[1]>=0){let d=l.next,u=c.next;c.prev.next=l.next,c.next.prev=l.prev,l.prev.next=c.next,l.next.prev=c.prev,c.v1=null,c.v2=null,c.next=null,c.prev=null,nht(o,l),l.v1=null,l.v2=null,l.next=null,l.prev=null;let _=(p,m,A)=>{let g={v1:A.v1,v2:m.v2,next:m.next,prev:A.prev};A.prev.next=g,m.next.prev=g,nht(p,m),m.v1=null,m.v2=null,m.next=null,m.prev=null,nht(p,A),A.v1=null,A.v2=null,A.next=null,A.prev=null};if(h[0]===0)_(o,d,d.prev);if(h[1]===0)_(o,u,u.prev)}}else if(c.next)G6i(o,c)}}let r=[];return o.forEach((i)=>{let s=K6i(i);if(s)r.push(s)}),o.clear(),r},q6i=(e,t)=>{if(Math.abs(e[3]-t[3])<0.00000015)return V6i(e,t);return!1},J6i=(e,t)=>{let n=[];t.forEach((r)=>{let i=n.find((s)=>q6i(s[0],qSe.plane(r)));if(i)i[1].push(r);else n.push([qSe.plane(r),[r]])});let o=[];return n.forEach((r)=>{let i=r[1],s=$6i(i);o=o.concat(s)}),o};cOn.exports=J6i});var pOn=lt(function(qha,uOn){var hOn=rc(),hP=si(),Z6i=za(),K2=(e)=>`${e}`,dOn=(e,t,n,o,r,i)=>{let s=K2(o),a=K2(r),c=`${s}/${a}`,l=`${a}/${s}`;if(e.has(l))return JSe(e,t,n,r,o,null),null;let h={vertex0:o,vertex1:r,polygonindex:i};if(!e.has(c))e.set(c,[h]);else e.get(c).push(h);if(t.has(s))t.get(s).push(c);else t.set(s,[c]);if(n.has(a))n.get(a).push(c);else n.set(a,[c]);return c},JSe=(e,t,n,o,r,i)=>{let s=K2(o),a=K2(r),c=`${s}/${a}`,l=-1,h=e.get(c);for(let d=0;d<h.length;d++){let u=h[d],_=K2(u.vertex0);if(_!==s)continue;if(_=K2(u.vertex1),_!==a)continue;if(i!==null){if(u.polygonindex!==i)continue}l=d;break}if(h.splice(l,1),h.length===0)e.delete(c);if(l=t.get(s).indexOf(c),t.get(s).splice(l,1),t.get(s).length===0)t.delete(s);if(l=n.get(a).indexOf(c),n.get(a).splice(l,1),n.get(a).length===0)n.delete(a)},eIi=(e)=>{let t=new Map;for(let n=0;n<e.length;n++){let o=e[n],r=o.vertices.length;if(r>=3){let i=o.vertices[0],s=K2(i);for(let a=0;a<r;a++){let c=a+1;if(c===r)c=0;let l=o.vertices[c],h=K2(l),d=`${s}/${h}`,u=`${h}/${s}`;if(t.has(u)){let _=t.get(u);if(_.splice(-1,1),_.length===0)t.delete(u)}else{let _={vertex0:i,vertex1:l,polygonindex:n};if(!t.has(d))t.set(d,[_]);else t.get(d).push(_)}i=l,s=h}}else console.warn("warning: invalid polygon found during insertTjunctions")}if(t.size>0){let n=new Map,o=new Map,r=new Map;for(let[s,a]of t)r.set(s,!0),a.forEach((c)=>{let l=K2(c.vertex0),h=K2(c.vertex1);if(n.has(l))n.get(l).push(s);else n.set(l,[s]);if(o.has(h))o.get(h).push(s);else o.set(h,[s])});let i=e.slice(0);while(!0){if(t.size===0)break;for(let a of t.keys())r.set(a,!0);let s=!1;while(!0){let a=Array.from(r.keys());if(a.length===0)break;let c=a[0],l=!0;if(t.has(c)){let d=t.get(c)[0];for(let u=0;u<2;u++){let _=u===0?d.vertex0:d.vertex1,p=u===0?d.vertex1:d.vertex0,m=K2(_),A=K2(p),g=[];if(u===0){if(o.has(m))g=o.get(m)}else if(n.has(m))g=n.get(m);for(let f=0;f<g.length;f++){let y=g[f],x=t.get(y)[0],C=u===0?x.vertex0:x.vertex1,b=u===0?x.vertex1:x.vertex0,I=K2(C),v=K2(b);if(I===A){JSe(t,n,o,_,p,null),JSe(t,n,o,p,_,null),l=!1,u=2,s=!0;break}else{let P=_,M=p,B=C,T=hP.subtract(hP.create(),B,P),N=hP.dot(hP.subtract(hP.create(),M,P),T)/hP.dot(T,T);if(N>0&&N<1){let D=hP.scale(hP.create(),T,N);if(hP.add(D,D,P),hP.squaredDistance(D,M)<hOn.EPS*hOn.EPS){let H=x.polygonindex,V=i[H],O=K2(x.vertex1),U=-1;for(let J=0;J<V.vertices.length;J++)if(K2(V.vertices[J])===O){U=J;break}let j=V.vertices.slice(0);j.splice(U,0,p);let Y=Z6i.create(j);i[H]=Y,JSe(t,n,o,x.vertex0,x.vertex1,H);let X=dOn(t,n,o,x.vertex0,p,H),K=dOn(t,n,o,p,x.vertex1,H);if(X!==null)r.set(X,!0);if(K!==null)r.set(K,!0);l=!1,u=2,s=!0;break}}}}}}if(l)r.delete(c)}if(!s)break}e=i}return t.clear(),e};uOn.exports=eIi});var _On=lt(function(Jha,mOn){var rht=si(),oht=za(),tIi=(e,t,n)=>{let o=t.vertices.length;if(o>3){if(o>4){let s=[0,0,0];t.vertices.forEach((a)=>rht.add(s,s,a)),rht.snap(s,rht.divide(s,s,[o,o,o]),e);for(let a=0;a<o;a++){let c=oht.create([s,t.vertices[a],t.vertices[(a+1)%o]]);if(t.color)c.color=t.color;n.push(c)}return}let r=oht.create([t.vertices[0],t.vertices[1],t.vertices[2]]),i=oht.create([t.vertices[0],t.vertices[2],t.vertices[3]]);if(t.color)r.color=t.color,i.color=t.color;n.push(r,i);return}n.push(t)},nIi=(e,t)=>{let n=[];return t.forEach((o)=>{tIi(e,o,n)}),n};mOn.exports=nIi});var fOn=lt(function(Zha,AOn){var oIi=ms(),rIi=EB(),iIi=zs(),gOn=Ds(),sIi=bh(),aIi=tht(),cIi=lOn(),lIi=pOn(),hIi=_On(),dIi=(e,t)=>t,uIi=(e,t)=>t,pIi=(e,t)=>{let n={snap:!1,simplify:!1,triangulate:!1},{snap:o,simplify:r,triangulate:i}=Object.assign({},n,e),s=rIi(t),a=gOn.toPolygons(t);if(o)a=aIi(s,a);if(r)a=cIi(s,a);if(i)a=lIi(a),a=hIi(s,a);let c=Object.assign({},t);return c.polygons=a,c},mIi=(e,...t)=>{if(t=oIi(t),t.length===0)throw Error("wrong number of arguments");let n=t.map((o)=>{if(sIi.isA(o))return dIi(e,o);if(iIi.isA(o))return uIi(e,o);if(gOn.isA(o))return pIi(e,o);throw Error("invalid geometry")});return n.length===1?n[0]:n};AOn.exports=mIi});var xOn=lt(function(eda,yOn){var _Ii=ms(),aG=da(),iht=zs(),sht=Ds(),aht=bh(),cht=EB(),gIi=tht(),AIi=(e)=>{let t=cht(e),o=aht.toPoints(e).map((r)=>aG.snap(aG.create(),r,t));return aht.create(o)},fIi=(e)=>{let t=cht(e),o=iht.toSides(e).map((r)=>[aG.snap(aG.create(),r[0],t),aG.snap(aG.create(),r[1],t)]);return o=o.filter((r)=>!aG.equals(r[0],r[1])),iht.create(o)},yIi=(e)=>{let t=cht(e),n=sht.toPolygons(e),o=gIi(t,n);return sht.create(o)},xIi=(...e)=>{if(e=_Ii(e),e.length===0)throw Error("wrong number of arguments");let t=e.map((n)=>{if(aht.isA(n))return AIi(n);if(iht.isA(n))return fIi(n);if(sht.isA(n))return yIi(n);return n});return t.length===1?t[0]:t};yOn.exports=xIi});var bOn=lt(function(tda,COn){COn.exports={generalize:fOn(),snap:xOn(),retessellate:see()}});var vOn=lt(function(nda,IOn){var CIi=(e,t,n)=>{e=e.slice();while(e.length<n)e.push(t);return e};IOn.exports=CIi});var wOn=lt(function(oda,MOn){var bIi=ms(),SOn=vOn(),EOn=pSe(),{translate:IIi}=nL(),vIi=(e)=>{if(!Array.isArray(e.modes)||e.modes.length>3)throw Error("align(): modes must be an array of length <= 3");if(e.modes=SOn(e.modes,"none",3),e.modes.filter((t)=>["center","max","min","none"].includes(t)).length!==3)throw Error('align(): all modes must be one of "center", "max" or "min"');if(!Array.isArray(e.relativeTo)||e.relativeTo.length>3)throw Error("align(): relativeTo must be an array of length <= 3");if(e.relativeTo=SOn(e.relativeTo,0,3),e.relativeTo.filter((t)=>Number.isFinite(t)||t==null).length!==3)throw Error("align(): all relativeTo values must be a number, or null.");if(typeof e.grouped!=="boolean")throw Error("align(): grouped must be a boolean value.");return e},SIi=(e,t,n)=>{for(let o=0;o<3;o++)if(e[o]==null){if(t[o]==="center")e[o]=(n[0][o]+n[1][o])/2;else if(t[o]==="max")e[o]=n[1][o];else if(t[o]==="min")e[o]=n[0][o]}return e},POn=(e,t,n)=>{let o=EOn(e),r=[0,0,0];for(let i=0;i<3;i++)if(t[i]==="center")r[i]=n[i]-(o[0][i]+o[1][i])/2;else if(t[i]==="max")r[i]=n[i]-o[1][i];else if(t[i]==="min")r[i]=n[i]-o[0][i];return IIi(r,e)},PIi=(e,...t)=>{e=Object.assign({},{modes:["center","center","min"],relativeTo:[0,0,0],grouped:!1},e),e=vIi(e);let{modes:o,relativeTo:r,grouped:i}=e;if(t=bIi(t),t.length===0)throw Error("align(): No geometries were provided to act upon");if(r.filter((s)=>s==null).length){let s=EOn(t);r=SIi(r,o,s)}if(i)t=POn(t,o,r);else t=t.map((s)=>POn(s,o,r));return t.length===1?t[0]:t};MOn.exports=PIi});var b0e=lt(function(rda,BOn){var EIi=ms(),MIi=zs(),wIi=Ds(),BIi=bh(),TIi=$k(),{translate:DIi}=nL(),lht=(e,t)=>{let n={axes:[!0,!0,!0],relativeTo:[0,0,0]},{axes:o,relativeTo:r}=Object.assign({},n,e),i=TIi(t),s=[0,0,0];if(o[0])s[0]=r[0]-(i[0][0]+(i[1][0]-i[0][0])/2);if(o[1])s[1]=r[1]-(i[0][1]+(i[1][1]-i[0][1])/2);if(o[2])s[2]=r[2]-(i[0][2]+(i[1][2]-i[0][2])/2);return DIi(s,t)},ZSe=(e,...t)=>{let n={axes:[!0,!0,!0],relativeTo:[0,0,0]},{axes:o,relativeTo:r}=Object.assign({},n,e);if(t=EIi(t),t.length===0)throw Error("wrong number of arguments");if(r.length!==3)throw Error("relativeTo must be an array of length 3");e={axes:o,relativeTo:r};let i=t.map((s)=>{if(BIi.isA(s))return lht(e,s);if(MIi.isA(s))return lht(e,s);if(wIi.isA(s))return lht(e,s);return s});return i.length===1?i[0]:i},NIi=(...e)=>ZSe({axes:[!0,!1,!1]},e),RIi=(...e)=>ZSe({axes:[!1,!0,!1]},e),QIi=(...e)=>ZSe({axes:[!1,!1,!0]},e);BOn.exports={center:ZSe,centerX:NIi,centerY:RIi,centerZ:QIi}});var I0e=lt(function(ida,QOn){var kIi=ms(),TOn=Fh(),DOn=zs(),NOn=Ds(),ROn=bh(),ePe=(e,...t)=>{if(!Array.isArray(e))throw Error("factors must be an array");if(t=kIi(t),t.length===0)throw Error("wrong number of arguments");e=e.slice();while(e.length<3)e.push(1);if(e[0]<=0||e[1]<=0||e[2]<=0)throw Error("factors must be positive");let n=TOn.fromScaling(TOn.create(),e),o=t.map((r)=>{if(ROn.isA(r))return ROn.transform(n,r);if(DOn.isA(r))return DOn.transform(n,r);if(NOn.isA(r))return NOn.transform(n,r);return r});return o.length===1?o[0]:o},LIi=(e,...t)=>ePe([e,1,1],t),HIi=(e,...t)=>ePe([1,e,1],t),FIi=(e,...t)=>ePe([1,1,e],t);QOn.exports={scale:ePe,scaleX:LIi,scaleY:HIi,scaleZ:FIi}});var zOn=lt(function(sda,FOn){var zIi=ms(),kOn=zs(),LOn=Ds(),HOn=bh(),OIi=(e,...t)=>{if(t=zIi(t),t.length===0)throw Error("wrong number of arguments");let n=t.map((o)=>{if(HOn.isA(o))return HOn.transform(e,o);if(kOn.isA(o))return kOn.transform(e,o);if(LOn.isA(o))return LOn.transform(e,o);return o});return n.length===1?n[0]:n};FOn.exports=OIi});var VOn=lt(function(ada,OOn){OOn.exports={align:wOn(),center:b0e().center,centerX:b0e().centerX,centerY:b0e().centerY,centerZ:b0e().centerZ,mirror:JZ().mirror,mirrorX:JZ().mirrorX,mirrorY:JZ().mirrorY,mirrorZ:JZ().mirrorZ,rotate:tee().rotate,rotateX:tee().rotateX,rotateY:tee().rotateY,rotateZ:tee().rotateZ,scale:I0e().scale,scaleX:I0e().scaleX,scaleY:I0e().scaleY,scaleZ:I0e().scaleZ,transform:zOn(),translate:nL().translate,translateX:nL().translateX,translateY:nL().translateY,translateZ:nL().translateZ}});var c5=lt(function(cda,YOn){YOn.exports={colors:rNn(),curves:bNn(),geometries:sSe(),maths:WRn(),measurements:wQn(),primitives:_Hn(),text:vHn(),utils:Rlt(),booleans:GFn(),expansions:gzn(),extrusions:Lzn(),hulls:nOn(),minkowski:rOn(),modifiers:bOn(),transforms:VOn()}});var UYn=lt(function(A5a,GYn){var YYn=(e)=>e.reduce((t,n)=>Array.isArray(n)?t.concat(YYn(n)):t.concat(n),[]);GYn.exports=YYn});var XYn=lt(function(f5a,WYn){var aPi=(e,t)=>e-t;WYn.exports=aPi});var KYn=lt(function(y5a,jYn){var cPi=(e)=>{if(!Array.isArray(e)||e.length===0)return;return e[0]};jYn.exports=cPi});var qYn=lt(function(x5a,$Yn){var lPi=(e,t,n)=>{let o=0,r=e.length;while(r>o){let i=Math.floor((o+r)/2),s=e[i];if(n(t,s)>0)o=i+1;else r=i}return e.splice(o,0,t),e};$Yn.exports=lPi});var ZYn=lt(function(C5a,JYn){var hPi=(e,t)=>{if(!Array.isArray(e)||e.length<t)return;return e[t]};JYn.exports=hPi});var tGn=lt(function(b5a,eGn){var dPi=(e,t,n)=>{e=e.slice();while(e.length<n)e.push(t);return e};eGn.exports=dPi});var oGn=lt(function(I5a,nGn){var uPi=(e)=>{if(Array.isArray(e))return e;if(e===void 0||e===null)return[];return[e]};nGn.exports=uPi});var iGn=lt(function(v5a,rGn){rGn.exports={flatten:UYn(),fnNumberSort:XYn(),head:KYn(),insertSorted:qYn(),nth:ZYn(),padToLength:tGn(),toArray:oGn()}});var aGn=lt(function(S5a,sGn){var{geometries:ndt}=c5(),pPi=(e,t)=>{t.statusCallback&&t.statusCallback({progress:0});let n=new ArrayBuffer(4),o=new Int32Array(n,0,1),r=new Int8Array(n,0,4);if(o[0]=287454020,r[0]!==68)throw Error("Binary STL output is currently only supported on little-endian (Intel) processors");let i=0,s=0;e.forEach((A,g)=>{ndt.geom3.toPolygons(A).forEach((y)=>{let x=y.vertices.length,C=x>=3?x-2:0;i+=C,s+=1})});let a=new Uint8Array(80);for(let A=0;A<80;A++)a[A]=65;let c=new Uint32Array(1);c[0]=i;let l=new ArrayBuffer(50*i),h=new Int8Array(l),d=new ArrayBuffer(50),u=new Int8Array(d),_=new Float32Array(d,0,12),p=new Uint16Array(d,48,1),m=0;return e.forEach((A)=>{ndt.geom3.toPolygons(A).forEach((f,y)=>{let x=f.vertices,C=x.length,b=ndt.poly3.plane(f);for(let I=0;I<C-2;I++){_[0]=b[0],_[1]=b[1],_[2]=b[2];let v=3;for(let P=0;P<3;P++){let M=P+(P>0?I:0),B=x[M];_[v++]=B[0],_[v++]=B[1],_[v++]=B[2]}p[0]=0,h.set(u,m),m+=50}t.statusCallback&&t.statusCallback({progress:100*y/s})})}),t.statusCallback&&t.statusCallback({progress:100}),[a.buffer,c.buffer,l]};sGn.exports={serializeBinary:pPi}});var dGn=lt(function(P5a,hGn){var{geometries:cGn}=c5(),mPi=(e,t)=>{t.statusCallback&&t.statusCallback({progress:0});let n=`solid JSCAD
${_Pi(e,t)}
endsolid JSCAD
`;return t.statusCallback&&t.statusCallback({progress:100}),[n]},_Pi=(e,t)=>{let n=[];return e.forEach((o,r)=>{n.push(gPi(o,t)),t.statusCallback&&t.statusCallback({progress:100*r/e.length})}),n.join(`
`)},gPi=(e,t)=>{let n=[];return cGn.geom3.toPolygons(e).forEach((r,i)=>{n.push(APi(r))}),n.join(`
`)},lGn=(e)=>`${e[0]} ${e[1]} ${e[2]}`,odt=(e)=>`vertex ${lGn(e)}`,APi=(e)=>{let t=[];if(e.vertices.length>=3){let n=odt(e.vertices[0]);for(let o=0;o<e.vertices.length-2;o++){let r=`facet normal ${lGn(cGn.poly3.plane(e))}
outer loop
${n}
${odt(e.vertices[o+1])}
${odt(e.vertices[o+2])}
endloop
endfacet`;t.push(r)}}return t.join(`
`)};hGn.exports={serializeText:mPi}});var pGn=lt(function(E5a,uGn){var{geometries:fPi,modifiers:yPi}=c5(),{flatten:xPi,toArray:CPi}=iGn(),{serializeBinary:bPi}=aGn(),{serializeText:IPi}=dGn(),vPi=(e,...t)=>{e=Object.assign({},{binary:!0,statusCallback:null},e),t=xPi(t);let o=t.filter((r)=>fPi.geom3.isA(r));if(o.length===0)throw Error("only 3D geometries can be serialized to STL");if(t.length!==o.length)console.warn("some objects could not be serialized to STL");return o=CPi(yPi.generalize({snap:!0,triangulate:!0},o)),e.binary?bPi(o,e):IPi(o,e)};uGn.exports={mimeType:"application/sla",serialize:vPi}});var sro=lt(function(mji){var I3=Qe(rn());(function(){function e(u,_){return u===_&&(u!==0||1/u===1/_)||u!==u&&_!==_}function t(u,_){l||I3.startTransition===void 0||(l=!0,console.error("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var p=_();if(!h){var m=_();r(p,m)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),h=!0)}m=i({inst:{value:p,getSnapshot:_}});var A=m[0].inst,g=m[1];return a(function(){A.value=p,A.getSnapshot=_,n(A)&&g({inst:A})},[u,p,_]),s(function(){return n(A)&&g({inst:A}),u(function(){n(A)&&g({inst:A})})},[u]),c(p),p}function n(u){var _=u.getSnapshot;u=u.value;try{var p=_();return!r(u,p)}catch(m){return!0}}function o(u,_){return _()}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart==="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var r=typeof Object.is==="function"?Object.is:e,i=I3.useState,s=I3.useEffect,a=I3.useLayoutEffect,c=I3.useDebugValue,l=!1,h=!1,d=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?o:t;mji.useSyncExternalStore=I3.useSyncExternalStore!==void 0?I3.useSyncExternalStore:d,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop==="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()});var aro=lt(function(_ji){var nT=Qe(rn());(function(){function e(c,l){return c===l&&(c!==0||1/c===1/l)||c!==c&&l!==l}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart==="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var t=sro(),n=typeof Object.is==="function"?Object.is:e,o=t.useSyncExternalStore,r=nT.useRef,i=nT.useEffect,s=nT.useMemo,a=nT.useDebugValue;_ji.useSyncExternalStoreWithSelector=function(c,l,h,d,u){var _=r(null);if(_.current===null){var p={hasValue:!1,value:null};_.current=p}else p=_.current;_=s(function(){function A(C){if(!g){if(g=!0,f=C,C=d(C),u!==void 0&&p.hasValue){var b=p.value;if(u(b,C))return y=b}return y=C}if(b=y,n(f,C))return b;var I=d(C);if(u!==void 0&&u(b,I))return f=C,b;return f=C,y=I}var g=!1,f,y,x=h===void 0?null:h;return[function(){return A(l())},x===null?void 0:function(){return A(x())}]},[l,h,d,u]);var m=o(c,_[0],_[1]);return i(function(){p.hasValue=!0,p.value=m},[m]),a(m),m},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop==="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()});var Fpt=lt(function(Dva,Cro){Cro.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}});var Sro=lt(function(Nva,vro){var qpe=Fpt(),Jpe=itt(),bro=Object.hasOwnProperty,Iro=Object.create(null);for($pe in qpe)if(bro.call(qpe,$pe))Iro[qpe[$pe]]=$pe;var $pe,S3=vro.exports={to:{},get:{}};S3.get=function(e){var t=e.substring(0,3).toLowerCase(),n,o;switch(t){case"hsl":n=S3.get.hsl(e),o="hsl";break;case"hwb":n=S3.get.hwb(e),o="hwb";break;default:n=S3.get.rgb(e),o="rgb";break}if(!n)return null;return{model:o,value:n}};S3.get.rgb=function(e){if(!e)return null;var t=/^#([a-f0-9]{3,4})$/i,n=/^#([a-f0-9]{6})([a-f0-9]{2})?$/i,o=/^rgba?\(\s*([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/,r=/^rgba?\(\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/,i=/^(\w+)$/,s=[0,0,0,1],a,c,l;if(a=e.match(n)){l=a[2],a=a[1];for(c=0;c<3;c++){var h=c*2;s[c]=parseInt(a.slice(h,h+2),16)}if(l)s[3]=parseInt(l,16)/255}else if(a=e.match(t)){a=a[1],l=a[3];for(c=0;c<3;c++)s[c]=parseInt(a[c]+a[c],16);if(l)s[3]=parseInt(l+l,16)/255}else if(a=e.match(o)){for(c=0;c<3;c++)s[c]=parseInt(a[c+1],0);if(a[4])if(a[5])s[3]=parseFloat(a[4])*0.01;else s[3]=parseFloat(a[4])}else if(a=e.match(r)){for(c=0;c<3;c++)s[c]=Math.round(parseFloat(a[c+1])*2.55);if(a[4])if(a[5])s[3]=parseFloat(a[4])*0.01;else s[3]=parseFloat(a[4])}else if(a=e.match(i)){if(a[1]==="transparent")return[0,0,0,0];if(!bro.call(qpe,a[1]))return null;return s=qpe[a[1]],s[3]=1,s}else return null;for(c=0;c<3;c++)s[c]=ML(s[c],0,255);return s[3]=ML(s[3],0,1),s};S3.get.hsl=function(e){if(!e)return null;var t=/^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d\.]+)%\s*,?\s*([+-]?[\d\.]+)%\s*(?:[,|\/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/,n=e.match(t);if(n){var o=parseFloat(n[4]),r=(parseFloat(n[1])%360+360)%360,i=ML(parseFloat(n[2]),0,100),s=ML(parseFloat(n[3]),0,100),a=ML(isNaN(o)?1:o,0,1);return[r,i,s,a]}return null};S3.get.hwb=function(e){if(!e)return null;var t=/^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/,n=e.match(t);if(n){var o=parseFloat(n[4]),r=(parseFloat(n[1])%360+360)%360,i=ML(parseFloat(n[2]),0,100),s=ML(parseFloat(n[3]),0,100),a=ML(isNaN(o)?1:o,0,1);return[r,i,s,a]}return null};S3.to.hex=function(){var e=Jpe(arguments);return"#"+zMe(e[0])+zMe(e[1])+zMe(e[2])+(e[3]<1?zMe(Math.round(e[3]*255)):"")};S3.to.rgb=function(){var e=Jpe(arguments);return e.length<4||e[3]===1?"rgb("+Math.round(e[0])+", "+Math.round(e[1])+", "+Math.round(e[2])+")":"rgba("+Math.round(e[0])+", "+Math.round(e[1])+", "+Math.round(e[2])+", "+e[3]+")"};S3.to.rgb.percent=function(){var e=Jpe(arguments),t=Math.round(e[0]/255*100),n=Math.round(e[1]/255*100),o=Math.round(e[2]/255*100);return e.length<4||e[3]===1?"rgb("+t+"%, "+n+"%, "+o+"%)":"rgba("+t+"%, "+n+"%, "+o+"%, "+e[3]+")"};S3.to.hsl=function(){var e=Jpe(arguments);return e.length<4||e[3]===1?"hsl("+e[0]+", "+e[1]+"%, "+e[2]+"%)":"hsla("+e[0]+", "+e[1]+"%, "+e[2]+"%, "+e[3]+")"};S3.to.hwb=function(){var e=Jpe(arguments),t="";if(e.length>=4&&e[3]!==1)t=", "+e[3];return"hwb("+e[0]+", "+e[1]+"%, "+e[2]+"%"+t+")"};S3.to.keyword=function(e){return Iro[e.slice(0,3)]};function ML(e,t,n){return Math.min(Math.max(t,e),n)}function zMe(e){var t=Math.round(e).toString(16).toUpperCase();return t.length<2?"0"+t:t}});var zpt=lt(function(Rva,Ero){var Zpe=Fpt(),Pro={};for(let e of Object.keys(Zpe))Pro[Zpe[e]]=e;var gi={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};Ero.exports=gi;for(let e of Object.keys(gi)){if(!("channels"in gi[e]))throw Error("missing channels property: "+e);if(!("labels"in gi[e]))throw Error("missing channel labels property: "+e);if(gi[e].labels.length!==gi[e].channels)throw Error("channel and label counts mismatch: "+e);let{channels:t,labels:n}=gi[e];delete gi[e].channels,delete gi[e].labels,Object.defineProperty(gi[e],"channels",{value:t}),Object.defineProperty(gi[e],"labels",{value:n})}gi.rgb.hsl=function(e){let t=e[0]/255,n=e[1]/255,o=e[2]/255,r=Math.min(t,n,o),i=Math.max(t,n,o),s=i-r,a,c;if(i===r)a=0;else if(t===i)a=(n-o)/s;else if(n===i)a=2+(o-t)/s;else if(o===i)a=4+(t-n)/s;if(a=Math.min(a*60,360),a<0)a+=360;let l=(r+i)/2;if(i===r)c=0;else if(l<=0.5)c=s/(i+r);else c=s/(2-i-r);return[a,c*100,l*100]};gi.rgb.hsv=function(e){let t,n,o,r,i,s=e[0]/255,a=e[1]/255,c=e[2]/255,l=Math.max(s,a,c),h=l-Math.min(s,a,c),d=function(u){return(l-u)/6/h+0.5};if(h===0)r=0,i=0;else{if(i=h/l,t=d(s),n=d(a),o=d(c),s===l)r=o-n;else if(a===l)r=0.3333333333333333+t-o;else if(c===l)r=0.6666666666666666+n-t;if(r<0)r+=1;else if(r>1)r-=1}return[r*360,i*100,l*100]};gi.rgb.hwb=function(e){let t=e[0],n=e[1],o=e[2],r=gi.rgb.hsl(e)[0],i=0.00392156862745098*Math.min(t,Math.min(n,o));return o=1-0.00392156862745098*Math.max(t,Math.max(n,o)),[r,i*100,o*100]};gi.rgb.cmyk=function(e){let t=e[0]/255,n=e[1]/255,o=e[2]/255,r=Math.min(1-t,1-n,1-o),i=(1-t-r)/(1-r)||0,s=(1-n-r)/(1-r)||0,a=(1-o-r)/(1-r)||0;return[i*100,s*100,a*100,r*100]};function Tji(e,t){return(e[0]-t[0])**2+(e[1]-t[1])**2+(e[2]-t[2])**2}gi.rgb.keyword=function(e){let t=Pro[e];if(t)return t;let n=1/0,o;for(let r of Object.keys(Zpe)){let i=Zpe[r],s=Tji(e,i);if(s<n)n=s,o=r}return o};gi.keyword.rgb=function(e){return Zpe[e]};gi.rgb.xyz=function(e){let t=e[0]/255,n=e[1]/255,o=e[2]/255;t=t>0.04045?((t+0.055)/1.055)**2.4:t/12.92,n=n>0.04045?((n+0.055)/1.055)**2.4:n/12.92,o=o>0.04045?((o+0.055)/1.055)**2.4:o/12.92;let r=t*0.4124+n*0.3576+o*0.1805,i=t*0.2126+n*0.7152+o*0.0722,s=t*0.0193+n*0.1192+o*0.9505;return[r*100,i*100,s*100]};gi.rgb.lab=function(e){let t=gi.rgb.xyz(e),n=t[0],o=t[1],r=t[2];n/=95.047,o/=100,r/=108.883,n=n>0.008856?n**0.3333333333333333:7.787*n+0.13793103448275862,o=o>0.008856?o**0.3333333333333333:7.787*o+0.13793103448275862,r=r>0.008856?r**0.3333333333333333:7.787*r+0.13793103448275862;let i=116*o-16,s=500*(n-o),a=200*(o-r);return[i,s,a]};gi.hsl.rgb=function(e){let t=e[0]/360,n=e[1]/100,o=e[2]/100,r,i,s;if(n===0)return s=o*255,[s,s,s];if(o<0.5)r=o*(1+n);else r=o+n-o*n;let a=2*o-r,c=[0,0,0];for(let l=0;l<3;l++){if(i=t+0.3333333333333333*-(l-1),i<0)i++;if(i>1)i--;if(6*i<1)s=a+(r-a)*6*i;else if(2*i<1)s=r;else if(3*i<2)s=a+(r-a)*(0.6666666666666666-i)*6;else s=a;c[l]=s*255}return c};gi.hsl.hsv=function(e){let t=e[0],n=e[1]/100,o=e[2]/100,r=n,i=Math.max(o,0.01);o*=2,n*=o<=1?o:2-o,r*=i<=1?i:2-i;let s=(o+n)/2,a=o===0?2*r/(i+r):2*n/(o+n);return[t,a*100,s*100]};gi.hsv.rgb=function(e){let t=e[0]/60,n=e[1]/100,o=e[2]/100,r=Math.floor(t)%6,i=t-Math.floor(t),s=255*o*(1-n),a=255*o*(1-n*i),c=255*o*(1-n*(1-i));switch(o*=255,r){case 0:return[o,c,s];case 1:return[a,o,s];case 2:return[s,o,c];case 3:return[s,a,o];case 4:return[c,s,o];case 5:return[o,s,a]}};gi.hsv.hsl=function(e){let t=e[0],n=e[1]/100,o=e[2]/100,r=Math.max(o,0.01),i,s;s=(2-n)*o;let a=(2-n)*r;return i=n*r,i/=a<=1?a:2-a,i=i||0,s/=2,[t,i*100,s*100]};gi.hwb.rgb=function(e){let t=e[0]/360,n=e[1]/100,o=e[2]/100,r=n+o,i;if(r>1)n/=r,o/=r;let s=Math.floor(6*t),a=1-o;if(i=6*t-s,(s&1)!==0)i=1-i;let c=n+i*(a-n),l,h,d;switch(s){default:case 6:case 0:l=a,h=c,d=n;break;case 1:l=c,h=a,d=n;break;case 2:l=n,h=a,d=c;break;case 3:l=n,h=c,d=a;break;case 4:l=c,h=n,d=a;break;case 5:l=a,h=n,d=c;break}return[l*255,h*255,d*255]};gi.cmyk.rgb=function(e){let t=e[0]/100,n=e[1]/100,o=e[2]/100,r=e[3]/100,i=1-Math.min(1,t*(1-r)+r),s=1-Math.min(1,n*(1-r)+r),a=1-Math.min(1,o*(1-r)+r);return[i*255,s*255,a*255]};gi.xyz.rgb=function(e){let t=e[0]/100,n=e[1]/100,o=e[2]/100,r,i,s;return r=t*3.2406+n*-1.5372+o*-0.4986,i=t*-0.9689+n*1.8758+o*0.0415,s=t*0.0557+n*-0.204+o*1.057,r=r>0.0031308?1.055*r**0.4166666666666667-0.055:r*12.92,i=i>0.0031308?1.055*i**0.4166666666666667-0.055:i*12.92,s=s>0.0031308?1.055*s**0.4166666666666667-0.055:s*12.92,r=Math.min(Math.max(0,r),1),i=Math.min(Math.max(0,i),1),s=Math.min(Math.max(0,s),1),[r*255,i*255,s*255]};gi.xyz.lab=function(e){let t=e[0],n=e[1],o=e[2];t/=95.047,n/=100,o/=108.883,t=t>0.008856?t**0.3333333333333333:7.787*t+0.13793103448275862,n=n>0.008856?n**0.3333333333333333:7.787*n+0.13793103448275862,o=o>0.008856?o**0.3333333333333333:7.787*o+0.13793103448275862;let r=116*n-16,i=500*(t-n),s=200*(n-o);return[r,i,s]};gi.lab.xyz=function(e){let t=e[0],n=e[1],o=e[2],r,i,s;i=(t+16)/116,r=n/500+i,s=i-o/200;let a=i**3,c=r**3,l=s**3;return i=a>0.008856?a:(i-0.13793103448275862)/7.787,r=c>0.008856?c:(r-0.13793103448275862)/7.787,s=l>0.008856?l:(s-0.13793103448275862)/7.787,r*=95.047,i*=100,s*=108.883,[r,i,s]};gi.lab.lch=function(e){let t=e[0],n=e[1],o=e[2],r;if(r=Math.atan2(o,n)*360/2/Math.PI,r<0)r+=360;let s=Math.sqrt(n*n+o*o);return[t,s,r]};gi.lch.lab=function(e){let t=e[0],n=e[1],r=e[2]/360*2*Math.PI,i=n*Math.cos(r),s=n*Math.sin(r);return[t,i,s]};gi.rgb.ansi16=function(e,t=null){let[n,o,r]=e,i=t===null?gi.rgb.hsv(e)[2]:t;if(i=Math.round(i/50),i===0)return 30;let s=30+(Math.round(r/255)<<2|Math.round(o/255)<<1|Math.round(n/255));if(i===2)s+=60;return s};gi.hsv.ansi16=function(e){return gi.rgb.ansi16(gi.hsv.rgb(e),e[2])};gi.rgb.ansi256=function(e){let t=e[0],n=e[1],o=e[2];if(t===n&&n===o){if(t<8)return 16;if(t>248)return 231;return Math.round((t-8)/247*24)+232}return 16+36*Math.round(t/255*5)+6*Math.round(n/255*5)+Math.round(o/255*5)};gi.ansi16.rgb=function(e){let t=e%10;if(t===0||t===7){if(e>50)t+=3.5;return t=t/10.5*255,[t,t,t]}let n=(~~(e>50)+1)*0.5,o=(t&1)*n*255,r=(t>>1&1)*n*255,i=(t>>2&1)*n*255;return[o,r,i]};gi.ansi256.rgb=function(e){if(e>=232){let i=(e-232)*10+8;return[i,i,i]}e-=16;let t,n=Math.floor(e/36)/5*255,o=Math.floor((t=e%36)/6)/5*255,r=t%6/5*255;return[n,o,r]};gi.rgb.hex=function(e){let n=(((Math.round(e[0])&255)<<16)+((Math.round(e[1])&255)<<8)+(Math.round(e[2])&255)).toString(16).toUpperCase();return"000000".substring(n.length)+n};gi.hex.rgb=function(e){let t=e.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!t)return[0,0,0];let n=t[0];if(t[0].length===3)n=n.split("").map((a)=>a+a).join("");let o=parseInt(n,16),r=o>>16&255,i=o>>8&255,s=o&255;return[r,i,s]};gi.rgb.hcg=function(e){let t=e[0]/255,n=e[1]/255,o=e[2]/255,r=Math.max(Math.max(t,n),o),i=Math.min(Math.min(t,n),o),s=r-i,a,c;if(s<1)a=i/(1-s);else a=0;if(s<=0)c=0;else if(r===t)c=(n-o)/s%6;else if(r===n)c=2+(o-t)/s;else c=4+(t-n)/s;return c/=6,c%=1,[c*360,s*100,a*100]};gi.hsl.hcg=function(e){let t=e[1]/100,n=e[2]/100,o=n<0.5?2*t*n:2*t*(1-n),r=0;if(o<1)r=(n-0.5*o)/(1-o);return[e[0],o*100,r*100]};gi.hsv.hcg=function(e){let t=e[1]/100,n=e[2]/100,o=t*n,r=0;if(o<1)r=(n-o)/(1-o);return[e[0],o*100,r*100]};gi.hcg.rgb=function(e){let t=e[0]/360,n=e[1]/100,o=e[2]/100;if(n===0)return[o*255,o*255,o*255];let r=[0,0,0],i=t%1*6,s=i%1,a=1-s,c=0;switch(Math.floor(i)){case 0:r[0]=1,r[1]=s,r[2]=0;break;case 1:r[0]=a,r[1]=1,r[2]=0;break;case 2:r[0]=0,r[1]=1,r[2]=s;break;case 3:r[0]=0,r[1]=a,r[2]=1;break;case 4:r[0]=s,r[1]=0,r[2]=1;break;default:r[0]=1,r[1]=0,r[2]=a}return c=(1-n)*o,[(n*r[0]+c)*255,(n*r[1]+c)*255,(n*r[2]+c)*255]};gi.hcg.hsv=function(e){let t=e[1]/100,n=e[2]/100,o=t+n*(1-t),r=0;if(o>0)r=t/o;return[e[0],r*100,o*100]};gi.hcg.hsl=function(e){let t=e[1]/100,o=e[2]/100*(1-t)+0.5*t,r=0;if(o>0&&o<0.5)r=t/(2*o);else if(o>=0.5&&o<1)r=t/(2*(1-o));return[e[0],r*100,o*100]};gi.hcg.hwb=function(e){let t=e[1]/100,n=e[2]/100,o=t+n*(1-t);return[e[0],(o-t)*100,(1-o)*100]};gi.hwb.hcg=function(e){let t=e[1]/100,o=1-e[2]/100,r=o-t,i=0;if(r<1)i=(o-r)/(1-r);return[e[0],r*100,i*100]};gi.apple.rgb=function(e){return[e[0]/65535*255,e[1]/65535*255,e[2]/65535*255]};gi.rgb.apple=function(e){return[e[0]/255*65535,e[1]/255*65535,e[2]/255*65535]};gi.gray.rgb=function(e){return[e[0]/100*255,e[0]/100*255,e[0]/100*255]};gi.gray.hsl=function(e){return[0,0,e[0]]};gi.gray.hsv=gi.gray.hsl;gi.gray.hwb=function(e){return[0,100,e[0]]};gi.gray.cmyk=function(e){return[0,0,0,e[0]]};gi.gray.lab=function(e){return[e[0],0,0]};gi.gray.hex=function(e){let t=Math.round(e[0]/100*255)&255,o=((t<<16)+(t<<8)+t).toString(16).toUpperCase();return"000000".substring(o.length)+o};gi.rgb.gray=function(e){return[(e[0]+e[1]+e[2])/3/255*100]}});var wro=lt(function(Qva,Mro){var OMe=zpt();function Dji(){let e={},t=Object.keys(OMe);for(let n=t.length,o=0;o<n;o++)e[t[o]]={distance:-1,parent:null};return e}function Nji(e){let t=Dji(),n=[e];t[e].distance=0;while(n.length){let o=n.pop(),r=Object.keys(OMe[o]);for(let i=r.length,s=0;s<i;s++){let a=r[s],c=t[a];if(c.distance===-1)c.distance=t[o].distance+1,c.parent=o,n.unshift(a)}}return t}function Rji(e,t){return function(n){return t(e(n))}}function Qji(e,t){let n=[t[e].parent,e],o=OMe[t[e].parent][e],r=t[e].parent;while(t[r].parent)n.unshift(t[r].parent),o=Rji(OMe[t[r].parent][r],o),r=t[r].parent;return o.conversion=n,o}Mro.exports=function(e){let t=Nji(e),n={},o=Object.keys(t);for(let r=o.length,i=0;i<r;i++){let s=o[i];if(t[s].parent===null)continue;n[s]=Qji(s,t)}return n}});var Tro=lt(function(kva,Bro){var Opt=zpt(),kji=wro(),Ate={},Lji=Object.keys(Opt);function Hji(e){let t=function(...n){let o=n[0];if(o===void 0||o===null)return o;if(o.length>1)n=o;return e(n)};if("conversion"in e)t.conversion=e.conversion;return t}function Fji(e){let t=function(...n){let o=n[0];if(o===void 0||o===null)return o;if(o.length>1)n=o;let r=e(n);if(typeof r==="object")for(let i=r.length,s=0;s<i;s++)r[s]=Math.round(r[s]);return r};if("conversion"in e)t.conversion=e.conversion;return t}Lji.forEach((e)=>{Ate[e]={},Object.defineProperty(Ate[e],"channels",{value:Opt[e].channels}),Object.defineProperty(Ate[e],"labels",{value:Opt[e].labels});let t=kji(e);Object.keys(t).forEach((o)=>{let r=t[o];Ate[e][o]=Fji(r),Ate[e][o].raw=Hji(r)})});Bro.exports=Ate});var NP=lt(function(Lva,Nro){var fte=Sro(),P3=Tro(),Dro=["keyword","gray","hex"],Vpt={};for(let e of Object.keys(P3))Vpt[[...P3[e].labels].sort().join("")]=e;var VMe={};function FA(e,t){if(!(this instanceof FA))return new FA(e,t);if(t&&t in Dro)t=null;if(t&&!(t in P3))throw Error("Unknown model: "+t);let n,o;if(e==null)this.model="rgb",this.color=[0,0,0],this.valpha=1;else if(e instanceof FA)this.model=e.model,this.color=[...e.color],this.valpha=e.valpha;else if(typeof e==="string"){let r=fte.get(e);if(r===null)throw Error("Unable to parse color from string: "+e);this.model=r.model,o=P3[this.model].channels,this.color=r.value.slice(0,o),this.valpha=typeof r.value[o]==="number"?r.value[o]:1}else if(e.length>0){this.model=t||"rgb",o=P3[this.model].channels;let r=Array.prototype.slice.call(e,0,o);this.color=Ypt(r,o),this.valpha=typeof e[o]==="number"?e[o]:1}else if(typeof e==="number")this.model="rgb",this.color=[e>>16&255,e>>8&255,e&255],this.valpha=1;else{this.valpha=1;let r=Object.keys(e);if("alpha"in e)r.splice(r.indexOf("alpha"),1),this.valpha=typeof e.alpha==="number"?e.alpha:0;let i=r.sort().join("");if(!(i in Vpt))throw Error("Unable to parse color from object: "+JSON.stringify(e));this.model=Vpt[i];let{labels:s}=P3[this.model],a=[];for(n=0;n<s.length;n++)a.push(e[s[n]]);this.color=Ypt(a)}if(VMe[this.model]){o=P3[this.model].channels;for(n=0;n<o;n++){let r=VMe[this.model][n];if(r)this.color[n]=r(this.color[n])}}if(this.valpha=Math.max(0,Math.min(1,this.valpha)),Object.freeze)Object.freeze(this)}FA.prototype={toString(){return this.string()},toJSON(){return this[this.model]()},string(e){let t=this.model in fte.to?this:this.rgb();t=t.round(typeof e==="number"?e:1);let n=t.valpha===1?t.color:[...t.color,this.valpha];return fte.to[t.model](n)},percentString(e){let t=this.rgb().round(typeof e==="number"?e:1),n=t.valpha===1?t.color:[...t.color,this.valpha];return fte.to.rgb.percent(n)},array(){return this.valpha===1?[...this.color]:[...this.color,this.valpha]},object(){let e={},{channels:t}=P3[this.model],{labels:n}=P3[this.model];for(let o=0;o<t;o++)e[n[o]]=this.color[o];if(this.valpha!==1)e.alpha=this.valpha;return e},unitArray(){let e=this.rgb().color;if(e[0]/=255,e[1]/=255,e[2]/=255,this.valpha!==1)e.push(this.valpha);return e},unitObject(){let e=this.rgb().object();if(e.r/=255,e.g/=255,e.b/=255,this.valpha!==1)e.alpha=this.valpha;return e},round(e){return e=Math.max(e||0,0),new FA([...this.color.map(Oji(e)),this.valpha],this.model)},alpha(e){if(e!==void 0)return new FA([...this.color,Math.max(0,Math.min(1,e))],this.model);return this.valpha},red:kp("rgb",0,Eg(255)),green:kp("rgb",1,Eg(255)),blue:kp("rgb",2,Eg(255)),hue:kp(["hsl","hsv","hsl","hwb","hcg"],0,(e)=>(e%360+360)%360),saturationl:kp("hsl",1,Eg(100)),lightness:kp("hsl",2,Eg(100)),saturationv:kp("hsv",1,Eg(100)),value:kp("hsv",2,Eg(100)),chroma:kp("hcg",1,Eg(100)),gray:kp("hcg",2,Eg(100)),white:kp("hwb",1,Eg(100)),wblack:kp("hwb",2,Eg(100)),cyan:kp("cmyk",0,Eg(100)),magenta:kp("cmyk",1,Eg(100)),yellow:kp("cmyk",2,Eg(100)),black:kp("cmyk",3,Eg(100)),x:kp("xyz",0,Eg(95.047)),y:kp("xyz",1,Eg(100)),z:kp("xyz",2,Eg(108.833)),l:kp("lab",0,Eg(100)),a:kp("lab",1),b:kp("lab",2),keyword(e){if(e!==void 0)return new FA(e);return P3[this.model].keyword(this.color)},hex(e){if(e!==void 0)return new FA(e);return fte.to.hex(this.rgb().round().color)},hexa(e){if(e!==void 0)return new FA(e);let t=this.rgb().round().color,n=Math.round(this.valpha*255).toString(16).toUpperCase();if(n.length===1)n="0"+n;return fte.to.hex(t)+n},rgbNumber(){let e=this.rgb().color;return(e[0]&255)<<16|(e[1]&255)<<8|e[2]&255},luminosity(){let e=this.rgb().color,t=[];for(let[n,o]of e.entries()){let r=o/255;t[n]=r<=0.04045?r/12.92:((r+0.055)/1.055)**2.4}return 0.2126*t[0]+0.7152*t[1]+0.0722*t[2]},contrast(e){let t=this.luminosity(),n=e.luminosity();if(t>n)return(t+0.05)/(n+0.05);return(n+0.05)/(t+0.05)},level(e){let t=this.contrast(e);if(t>=7)return"AAA";return t>=4.5?"AA":""},isDark(){let e=this.rgb().color;return(e[0]*2126+e[1]*7152+e[2]*722)/1e4<128},isLight(){return!this.isDark()},negate(){let e=this.rgb();for(let t=0;t<3;t++)e.color[t]=255-e.color[t];return e},lighten(e){let t=this.hsl();return t.color[2]+=t.color[2]*e,t},darken(e){let t=this.hsl();return t.color[2]-=t.color[2]*e,t},saturate(e){let t=this.hsl();return t.color[1]+=t.color[1]*e,t},desaturate(e){let t=this.hsl();return t.color[1]-=t.color[1]*e,t},whiten(e){let t=this.hwb();return t.color[1]+=t.color[1]*e,t},blacken(e){let t=this.hwb();return t.color[2]+=t.color[2]*e,t},grayscale(){let e=this.rgb().color,t=e[0]*0.3+e[1]*0.59+e[2]*0.11;return FA.rgb(t,t,t)},fade(e){return this.alpha(this.valpha-this.valpha*e)},opaquer(e){return this.alpha(this.valpha+this.valpha*e)},rotate(e){let t=this.hsl(),n=t.color[0];return n=(n+e)%360,n=n<0?360+n:n,t.color[0]=n,t},mix(e,t){if(!e||!e.rgb)throw Error('Argument to "mix" was not a Color instance, but rather an instance of '+typeof e);let n=e.rgb(),o=this.rgb(),r=t===void 0?0.5:t,i=2*r-1,s=n.alpha()-o.alpha(),a=((i*s===-1?i:(i+s)/(1+i*s))+1)/2,c=1-a;return FA.rgb(a*n.red()+c*o.red(),a*n.green()+c*o.green(),a*n.blue()+c*o.blue(),n.alpha()*r+o.alpha()*(1-r))}};for(let e of Object.keys(P3)){if(Dro.includes(e))continue;let{channels:t}=P3[e];FA.prototype[e]=function(...n){if(this.model===e)return new FA(this);if(n.length>0)return new FA(n,e);return new FA([...Vji(P3[this.model][e].raw(this.color)),this.valpha],e)},FA[e]=function(...n){let o=n[0];if(typeof o==="number")o=Ypt(n,t);return new FA(o,e)}}function zji(e,t){return Number(e.toFixed(t))}function Oji(e){return function(t){return zji(t,e)}}function kp(e,t,n){e=Array.isArray(e)?e:[e];for(let o of e)(VMe[o]||(VMe[o]=[]))[t]=n;return e=e[0],function(o){let r;if(o!==void 0){if(n)o=n(o);return r=this[e](),r.color[t]=o,r}if(r=this[e]().color[t],n)r=n(r);return r}}function Eg(e){return function(t){return Math.max(0,Math.min(e,t))}}function Vji(e){return Array.isArray(e)?e:[e]}function Ypt(e,t){for(let n=0;n<t;n++)if(typeof e[n]!=="number")e[n]=0;return e}Nro.exports=FA});var Upt=lt(function(Hva,Lro){var yte=Qe(rn()),kro=Qe(so()),{defineProperty:Gpt,getOwnPropertyDescriptor:Yji,getOwnPropertyNames:Gji}=Object,Uji=Object.prototype.hasOwnProperty,Wji=(e,t)=>{for(var n in t)Gpt(e,n,{get:t[n],enumerable:!0})},Xji=(e,t,n,o)=>{if(t&&typeof t==="object"||typeof t==="function"){for(let r of Gji(t))if(!Uji.call(e,r)&&r!==n)Gpt(e,r,{get:()=>t[r],enumerable:!(o=Yji(t,r))||o.enumerable})}return e},jji=(e)=>Xji(Gpt({},"__esModule",{value:!0}),e),Qro={};Wji(Qro,{SuperGrid:()=>qji,toMMSI:()=>$ji,toMeterSI:()=>eme});Lro.exports=jji(Qro);var RP=wt(),Rro=(e,t,n)=>{let o=[];if(t<e)for(let r=e;r>=t;r-=Math.abs(n))o.push(r);else for(let r=e;r<=t;r+=Math.abs(n))o.push(r);return o};function Kji(e,t){return{x:Math.round(t.x/e)*e,y:Math.round(t.y/e)*e}}function eme(e,t=1){if(e<0)return"-"+eme(-e);if(e<0.000001)return"0m";if(e>1000)return Math.floor(e/1000)+"km";if(e>1&&t>1)return Math.round(e)+"m";if(e>1&&t<=1)return e.toFixed(Math.ceil(-Math.log10(t)))+"m";if(e<1&&t>=0.001)return Math.round(e*1000)+"mm";if(e<1&&t<0.001)return(e*1000).toFixed(Math.ceil(-Math.log10(t*1000)))+"mm";return""}function $ji(e,t=1){return eme(e/1000,t/1000)}var qji=(e)=>{var t;let n=yte.useRef(null),[o,r]=yte.useState({x:0,y:0}),{majorColor:i="rgba(0,0,0,0.2)",minorColor:s="rgba(0,0,0,0.1)",textColor:a=(t=e.majorColor)!=null?t:"rgba(0,0,0,0.5)",width:c,height:l,screenSpaceCellSize:h=200,stringifyCoord:d=(m,A,g)=>`${eme(m,g)}, ${eme(A,g)}`}=e,u=Math.ceil(c/h)+2,_=Math.ceil(l/h)+2;yte.useEffect(()=>{if(!n.current)return;let m=n.current.getContext("2d");if(!m)return;let A=h/10**Math.floor(Math.log10(e.transform.a)),g=e.transform.d<0?-1:1,y=h/10**Math.log10(e.transform.a)/A;function x(D,L,H){let V=D,O,U,j,Y;for(O=L.x;O<=H.x;O+=V)j=(0,RP.applyToPoint)(e.transform,{x:O,y:L.y}),Y=(0,RP.applyToPoint)(e.transform,{x:O,y:H.y}),m.beginPath(),m.moveTo(j.x,j.y),m.lineTo(Y.x,Y.y),m.stroke();let X=Rro(L.y,H.y,V*g);for(let K of X)j=(0,RP.applyToPoint)(e.transform,{x:L.x,y:K}),Y=(0,RP.applyToPoint)(e.transform,{x:H.x,y:K}),m.beginPath(),m.moveTo(j.x,j.y),m.lineTo(Y.x,Y.y),m.stroke()}function C(D,L,H){let V=D,O,U;for(O=L.x;O<=H.x;O+=V)for(let j of Rro(L.y,H.y,V*g)){let Y=(0,RP.applyToPoint)(e.transform,{x:O,y:j});m.fillStyle=a,m.font="12px sans-serif",m.fillText(d(O,j,D),Y.x+2,Y.y-2)}}m.clearRect(0,0,c,l);let b=(0,RP.applyToPoint)((0,RP.inverse)(e.transform),{x:0,y:0}),I={x:Math.floor((b.x-A)/A)*A,y:Math.floor((b.y-A)/A+(g==-1?2:0))*A},v={x:I.x+A*u,y:I.y+A*_*g},M=A*5,B={x:Math.floor((b.x-M)/M)*M,y:Math.floor((b.y-M)/M+(g==-1?2:0))*M},T={x:B.x+M*u,y:B.y+M*_*g};m.globalAlpha=1,m.strokeStyle=i,x(A,I,v),C(M,B,T),m.globalAlpha=1-y,x(M/10,B,T),m.globalAlpha=1-y,m.strokeStyle=s,x(A/10,I,v),m.globalAlpha=Math.max(((1-y)*10-5)/5,0),C(M/10,B,T),m.globalAlpha=1;let N=(0,RP.applyToPoint)(e.transform,o);m.font="12px sans-serif",m.fillStyle=a,m.fillText(d(o.x,o.y,A),N.x+2,N.y-2),m.strokeStyle=i,m.strokeRect(N.x-5,N.y-5,10,10)},[n,e.transform,o,c,l]);let p=(m)=>{if(!n.current)return;let A=h/10/10**Math.floor(Math.log10(e.transform.a)),g=n.current.getBoundingClientRect(),f=(0,RP.applyToPoint)((0,RP.inverse)(e.transform),{x:m.clientX-g.left,y:m.clientY-g.top}),y=Kji(A,f);r(y)};return kro.jsx("canvas",{onMouseUp:(m)=>{if(m.button!==1)return;p(m)},onDoubleClick:p,ref:n,width:e.width,height:e.height})}});bze();var dTe=Qe(rn()),IU=Qe(g1t());var IP=Qe(rn(),1),nte=Qe(rn(),1);var eEt="165",l7={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},Sz={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3};var tEt=2;var h7=0,Fie=1,A0=2;var nEt=4;var oEt=303;var x4=1000,VC=1001,Lye=1002,Hye=1003,Fye=1004;var zye=1005;var uc=1006,Oye=1007;var Pd=1008;var cOe=1023;var Vye=2300,zie=2301;var rEt=0,Yye=1,Oie=2;var iEt=3201;var Gye="",tR="srgb";class FM{addEventListener(e,t){if(this._listeners===void 0)this._listeners={};let n=this._listeners;if(n[e]===void 0)n[e]=[];if(n[e].indexOf(t)===-1)n[e].push(t)}hasEventListener(e,t){if(this._listeners===void 0)return!1;let n=this._listeners;return n[e]!==void 0&&n[e].indexOf(t)!==-1}removeEventListener(e,t){if(this._listeners===void 0)return;let o=this._listeners[e];if(o!==void 0){let r=o.indexOf(t);if(r!==-1)o.splice(r,1)}}dispatchEvent(e){if(this._listeners===void 0)return;let n=this._listeners[e.type];if(n!==void 0){e.target=this;let o=n.slice(0);for(let r=0,i=o.length;r<i;r++)o[r].call(this,e);e.target=null}}}var b2=["00","01","02","03","04","05","06","07","08","09","0a","0b","0c","0d","0e","0f","10","11","12","13","14","15","16","17","18","19","1a","1b","1c","1d","1e","1f","20","21","22","23","24","25","26","27","28","29","2a","2b","2c","2d","2e","2f","30","31","32","33","34","35","36","37","38","39","3a","3b","3c","3d","3e","3f","40","41","42","43","44","45","46","47","48","49","4a","4b","4c","4d","4e","4f","50","51","52","53","54","55","56","57","58","59","5a","5b","5c","5d","5e","5f","60","61","62","63","64","65","66","67","68","69","6a","6b","6c","6d","6e","6f","70","71","72","73","74","75","76","77","78","79","7a","7b","7c","7d","7e","7f","80","81","82","83","84","85","86","87","88","89","8a","8b","8c","8d","8e","8f","90","91","92","93","94","95","96","97","98","99","9a","9b","9c","9d","9e","9f","a0","a1","a2","a3","a4","a5","a6","a7","a8","a9","aa","ab","ac","ad","ae","af","b0","b1","b2","b3","b4","b5","b6","b7","b8","b9","ba","bb","bc","bd","be","bf","c0","c1","c2","c3","c4","c5","c6","c7","c8","c9","ca","cb","cc","cd","ce","cf","d0","d1","d2","d3","d4","d5","d6","d7","d8","d9","da","db","dc","dd","de","df","e0","e1","e2","e3","e4","e5","e6","e7","e8","e9","ea","eb","ec","ed","ee","ef","f0","f1","f2","f3","f4","f5","f6","f7","f8","f9","fa","fb","fc","fd","fe","ff"],VSt=1234567,Vj=Math.PI/180,Gj=180/Math.PI;function OC(){let e=Math.random()*4294967295|0,t=Math.random()*4294967295|0,n=Math.random()*4294967295|0,o=Math.random()*4294967295|0;return(b2[e&255]+b2[e>>8&255]+b2[e>>16&255]+b2[e>>24&255]+"-"+b2[t&255]+b2[t>>8&255]+"-"+b2[t>>16&15|64]+b2[t>>24&255]+"-"+b2[n&63|128]+b2[n>>8&255]+"-"+b2[n>>16&255]+b2[n>>24&255]+b2[o&255]+b2[o>>8&255]+b2[o>>16&255]+b2[o>>24&255]).toLowerCase()}function ng(e,t,n){return Math.max(t,Math.min(n,e))}function lOe(e,t){return(e%t+t)%t}function HNo(e,t,n,o,r){return o+(e-t)*(r-o)/(n-t)}function FNo(e,t,n){if(e!==t)return(n-e)/(t-e);else return 0}function wie(e,t,n){return(1-n)*e+n*t}function zNo(e,t,n,o){return wie(e,t,1-Math.exp(-n*o))}function ONo(e,t=1){return t-Math.abs(lOe(e,t*2)-t)}function VNo(e,t,n){if(e<=t)return 0;if(e>=n)return 1;return e=(e-t)/(n-t),e*e*(3-2*e)}function YNo(e,t,n){if(e<=t)return 0;if(e>=n)return 1;return e=(e-t)/(n-t),e*e*e*(e*(e*6-15)+10)}function GNo(e,t){return e+Math.floor(Math.random()*(t-e+1))}function UNo(e,t){return e+Math.random()*(t-e)}function WNo(e){return e*(0.5-Math.random())}function XNo(e){if(e!==void 0)VSt=e;let t=VSt+=1831565813;return t=Math.imul(t^t>>>15,t|1),t^=t+Math.imul(t^t>>>7,t|61),((t^t>>>14)>>>0)/4294967296}function jNo(e){return e*Vj}function KNo(e){return e*Gj}function $No(e){return(e&e-1)===0&&e!==0}function qNo(e){return Math.pow(2,Math.ceil(Math.log(e)/Math.LN2))}function JNo(e){return Math.pow(2,Math.floor(Math.log(e)/Math.LN2))}function ZNo(e,t,n,o,r){let{cos:i,sin:s}=Math,a=i(n/2),c=s(n/2),l=i((t+o)/2),h=s((t+o)/2),d=i((t-o)/2),u=s((t-o)/2),_=i((o-t)/2),p=s((o-t)/2);switch(r){case"XYX":e.set(a*h,c*d,c*u,a*l);break;case"YZY":e.set(c*u,a*h,c*d,a*l);break;case"ZXZ":e.set(c*d,c*u,a*h,a*l);break;case"XZX":e.set(a*h,c*p,c*_,a*l);break;case"YXY":e.set(c*_,a*h,c*p,a*l);break;case"ZYZ":e.set(c*p,c*_,a*h,a*l);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+r)}}function HI(e,t){switch(t.constructor){case Float32Array:return e;case Uint32Array:return e/4294967295;case Uint16Array:return e/65535;case Uint8Array:return e/255;case Int32Array:return Math.max(e/2147483647,-1);case Int16Array:return Math.max(e/32767,-1);case Int8Array:return Math.max(e/127,-1);default:throw Error("Invalid component type.")}}function Bh(e,t){switch(t.constructor){case Float32Array:return e;case Uint32Array:return Math.round(e*4294967295);case Uint16Array:return Math.round(e*65535);case Uint8Array:return Math.round(e*255);case Int32Array:return Math.round(e*2147483647);case Int16Array:return Math.round(e*32767);case Int8Array:return Math.round(e*127);default:throw Error("Invalid component type.")}}var d7={DEG2RAD:Vj,RAD2DEG:Gj,generateUUID:OC,clamp:ng,euclideanModulo:lOe,mapLinear:HNo,inverseLerp:FNo,lerp:wie,damp:zNo,pingpong:ONo,smoothstep:VNo,smootherstep:YNo,randInt:GNo,randFloat:UNo,randFloatSpread:WNo,seededRandom:XNo,degToRad:jNo,radToDeg:KNo,isPowerOfTwo:$No,ceilPowerOfTwo:qNo,floorPowerOfTwo:JNo,setQuaternionFromProperEuler:ZNo,normalize:Bh,denormalize:HI};class go{constructor(e=0,t=0){go.prototype.isVector2=!0,this.x=e,this.y=t}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,t){return this.x=e,this.y=t,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e){return this.x+=e.x,this.y+=e.y,this}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){let t=this.x,n=this.y,o=e.elements;return this.x=o[0]*t+o[3]*n+o[6],this.y=o[1]*t+o[4]*n+o[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this}clampLength(e,t){let n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(e){let t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;let n=this.dot(e)/t;return Math.acos(ng(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){let t=this.x-e.x,n=this.y-e.y;return t*t+n*n}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this}rotateAround(e,t){let n=Math.cos(t),o=Math.sin(t),r=this.x-e.x,i=this.y-e.y;return this.x=r*n-i*o+e.x,this.y=r*o+i*n+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class wa{constructor(e,t,n,o,r,i,s,a,c){if(wa.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],e!==void 0)this.set(e,t,n,o,r,i,s,a,c)}set(e,t,n,o,r,i,s,a,c){let l=this.elements;return l[0]=e,l[1]=o,l[2]=s,l[3]=t,l[4]=r,l[5]=a,l[6]=n,l[7]=i,l[8]=c,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){let t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],this}extractBasis(e,t,n){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),n.setFromMatrix3Column(this,2),this}setFromMatrix4(e){let t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){let n=e.elements,o=t.elements,r=this.elements,i=n[0],s=n[3],a=n[6],c=n[1],l=n[4],h=n[7],d=n[2],u=n[5],_=n[8],p=o[0],m=o[3],A=o[6],g=o[1],f=o[4],y=o[7],x=o[2],C=o[5],b=o[8];return r[0]=i*p+s*g+a*x,r[3]=i*m+s*f+a*C,r[6]=i*A+s*y+a*b,r[1]=c*p+l*g+h*x,r[4]=c*m+l*f+h*C,r[7]=c*A+l*y+h*b,r[2]=d*p+u*g+_*x,r[5]=d*m+u*f+_*C,r[8]=d*A+u*y+_*b,this}multiplyScalar(e){let t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this}determinant(){let e=this.elements,t=e[0],n=e[1],o=e[2],r=e[3],i=e[4],s=e[5],a=e[6],c=e[7],l=e[8];return t*i*l-t*s*c-n*r*l+n*s*a+o*r*c-o*i*a}invert(){let e=this.elements,t=e[0],n=e[1],o=e[2],r=e[3],i=e[4],s=e[5],a=e[6],c=e[7],l=e[8],h=l*i-s*c,d=s*a-l*r,u=c*r-i*a,_=t*h+n*d+o*u;if(_===0)return this.set(0,0,0,0,0,0,0,0,0);let p=1/_;return e[0]=h*p,e[1]=(o*c-l*n)*p,e[2]=(s*n-o*i)*p,e[3]=d*p,e[4]=(l*t-o*a)*p,e[5]=(o*r-s*t)*p,e[6]=u*p,e[7]=(n*a-c*t)*p,e[8]=(i*t-n*r)*p,this}transpose(){let e,t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){let t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this}setUvTransform(e,t,n,o,r,i,s){let a=Math.cos(r),c=Math.sin(r);return this.set(n*a,n*c,-n*(a*i+c*s)+i+e,-o*c,o*a,-o*(-c*i+a*s)+s+t,0,0,1),this}scale(e,t){return this.premultiply(Ize.makeScale(e,t)),this}rotate(e){return this.premultiply(Ize.makeRotation(-e)),this}translate(e,t){return this.premultiply(Ize.makeTranslation(e,t)),this}makeTranslation(e,t){if(e.isVector2)this.set(1,0,e.x,0,1,e.y,0,0,1);else this.set(1,0,e,0,1,t,0,0,1);return this}makeRotation(e){let t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,n,t,0,0,0,1),this}makeScale(e,t){return this.set(e,0,0,0,t,0,0,0,1),this}equals(e){let t=this.elements,n=e.elements;for(let o=0;o<9;o++)if(t[o]!==n[o])return!1;return!0}fromArray(e,t=0){for(let n=0;n<9;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){let n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e}clone(){return new this.constructor().fromArray(this.elements)}}var Ize=new wa;function sEt(e){for(let t=e.length-1;t>=0;--t)if(e[t]>=65535)return!0;return!1}function Nie(e){return document.createElementNS("http://www.w3.org/1999/xhtml",e)}function eRo(){let e=Nie("canvas");return e.style.display="block",e}var YSt={};function hOe(e){if(e in YSt)return;YSt[e]=!0,console.warn(e)}function tRo(e,t,n){return new Promise(function(o,r){function i(){switch(e.clientWaitSync(t,e.SYNC_FLUSH_COMMANDS_BIT,0)){case e.WAIT_FAILED:r();break;case e.TIMEOUT_EXPIRED:setTimeout(i,n);break;default:o()}}setTimeout(i,n)})}var GSt=new wa().set(0.8224621,0.177538,0,0.0331941,0.9668058,0,0.0170827,0.0723974,0.9105199),USt=new wa().set(1.2249401,-0.2249404,0,-0.0420569,1.0420571,0,-0.0196376,-0.0786361,1.0982735),eye={["srgb-linear"]:{transfer:"linear",primaries:"rec709",toReference:(e)=>e,fromReference:(e)=>e},["srgb"]:{transfer:"srgb",primaries:"rec709",toReference:(e)=>e.convertSRGBToLinear(),fromReference:(e)=>e.convertLinearToSRGB()},["display-p3-linear"]:{transfer:"linear",primaries:"p3",toReference:(e)=>e.applyMatrix3(USt),fromReference:(e)=>e.applyMatrix3(GSt)},["display-p3"]:{transfer:"srgb",primaries:"p3",toReference:(e)=>e.convertSRGBToLinear().applyMatrix3(USt),fromReference:(e)=>e.applyMatrix3(GSt).convertLinearToSRGB()}},nRo=new Set(["srgb-linear","display-p3-linear"]),Th={enabled:!0,_workingColorSpace:"srgb-linear",get workingColorSpace(){return this._workingColorSpace},set workingColorSpace(e){if(!nRo.has(e))throw Error(`Unsupported working color space, "${e}".`);this._workingColorSpace=e},convert:function(e,t,n){if(this.enabled===!1||t===n||!t||!n)return e;let o=eye[t].toReference,r=eye[n].fromReference;return r(o(e))},fromWorkingColorSpace:function(e,t){return this.convert(e,this._workingColorSpace,t)},toWorkingColorSpace:function(e,t){return this.convert(e,t,this._workingColorSpace)},getPrimaries:function(e){return eye[e].primaries},getTransfer:function(e){if(e==="")return"linear";return eye[e].transfer}};function Yj(e){return e<0.04045?e*0.0773993808:Math.pow(e*0.9478672986+0.0521327014,2.4)}function vze(e){return e<0.0031308?e*12.92:1.055*Math.pow(e,0.41666)-0.055}var Ij;class aEt{static getDataURL(e){if(/^data:/i.test(e.src))return e.src;if(typeof HTMLCanvasElement>"u")return e.src;let t;if(e instanceof HTMLCanvasElement)t=e;else{if(Ij===void 0)Ij=Nie("canvas");Ij.width=e.width,Ij.height=e.height;let n=Ij.getContext("2d");if(e instanceof ImageData)n.putImageData(e,0,0);else n.drawImage(e,0,0,e.width,e.height);t=Ij}if(t.width>2048||t.height>2048)return console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",e),t.toDataURL("image/jpeg",0.6);else return t.toDataURL("image/png")}static sRGBToLinear(e){if(typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&e instanceof ImageBitmap){let t=Nie("canvas");t.width=e.width,t.height=e.height;let n=t.getContext("2d");n.drawImage(e,0,0,e.width,e.height);let o=n.getImageData(0,0,e.width,e.height),r=o.data;for(let i=0;i<r.length;i++)r[i]=Yj(r[i]/255)*255;return n.putImageData(o,0,0),t}else if(e.data){let t=e.data.slice(0);for(let n=0;n<t.length;n++)if(t instanceof Uint8Array||t instanceof Uint8ClampedArray)t[n]=Math.floor(Yj(t[n]/255)*255);else t[n]=Yj(t[n]);return{data:t,width:e.width,height:e.height}}else return console.warn("THREE.ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied."),e}}var oRo=0;class dOe{constructor(e=null){this.isSource=!0,Object.defineProperty(this,"id",{value:oRo++}),this.uuid=OC(),this.data=e,this.dataReady=!0,this.version=0}set needsUpdate(e){if(e===!0)this.version++}toJSON(e){let t=e===void 0||typeof e==="string";if(!t&&e.images[this.uuid]!==void 0)return e.images[this.uuid];let n={uuid:this.uuid,url:""},o=this.data;if(o!==null){let r;if(Array.isArray(o)){r=[];for(let i=0,s=o.length;i<s;i++)if(o[i].isDataTexture)r.push(Sze(o[i].image));else r.push(Sze(o[i]))}else r=Sze(o);n.url=r}if(!t)e.images[this.uuid]=n;return n}}function Sze(e){if(typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&e instanceof ImageBitmap)return aEt.getDataURL(e);else if(e.data)return{data:Array.from(e.data),width:e.width,height:e.height,type:e.data.constructor.name};else return console.warn("THREE.Texture: Unable to serialize Texture."),{}}var rRo=0;class Bl extends FM{constructor(e=Bl.DEFAULT_IMAGE,t=Bl.DEFAULT_MAPPING,n=1001,o=1001,r=1006,i=1008,s=1023,a=1009,c=Bl.DEFAULT_ANISOTROPY,l=""){super();this.isTexture=!0,Object.defineProperty(this,"id",{value:rRo++}),this.uuid=OC(),this.name="",this.source=new dOe(e),this.mipmaps=[],this.mapping=t,this.channel=0,this.wrapS=n,this.wrapT=o,this.magFilter=r,this.minFilter=i,this.anisotropy=c,this.format=s,this.internalFormat=null,this.type=a,this.offset=new go(0,0),this.repeat=new go(1,1),this.center=new go(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new wa,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.colorSpace=l,this.userData={},this.version=0,this.onUpdate=null,this.isRenderTargetTexture=!1,this.pmremVersion=0}get image(){return this.source.data}set image(e=null){this.source.data=e}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}clone(){return new this.constructor().copy(this)}copy(e){return this.name=e.name,this.source=e.source,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,this.channel=e.channel,this.wrapS=e.wrapS,this.wrapT=e.wrapT,this.magFilter=e.magFilter,this.minFilter=e.minFilter,this.anisotropy=e.anisotropy,this.format=e.format,this.internalFormat=e.internalFormat,this.type=e.type,this.offset.copy(e.offset),this.repeat.copy(e.repeat),this.center.copy(e.center),this.rotation=e.rotation,this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrix.copy(e.matrix),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.colorSpace=e.colorSpace,this.userData=JSON.parse(JSON.stringify(e.userData)),this.needsUpdate=!0,this}toJSON(e){let t=e===void 0||typeof e==="string";if(!t&&e.textures[this.uuid]!==void 0)return e.textures[this.uuid];let n={metadata:{version:4.6,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(e).uuid,mapping:this.mapping,channel:this.channel,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,internalFormat:this.internalFormat,type:this.type,colorSpace:this.colorSpace,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,generateMipmaps:this.generateMipmaps,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};if(Object.keys(this.userData).length>0)n.userData=this.userData;if(!t)e.textures[this.uuid]=n;return n}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(this.mapping!==300)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case 1000:e.x=e.x-Math.floor(e.x);break;case 1001:e.x=e.x<0?0:1;break;case 1002:if(Math.abs(Math.floor(e.x)%2)===1)e.x=Math.ceil(e.x)-e.x;else e.x=e.x-Math.floor(e.x);break}if(e.y<0||e.y>1)switch(this.wrapT){case 1000:e.y=e.y-Math.floor(e.y);break;case 1001:e.y=e.y<0?0:1;break;case 1002:if(Math.abs(Math.floor(e.y)%2)===1)e.y=Math.ceil(e.y)-e.y;else e.y=e.y-Math.floor(e.y);break}if(this.flipY)e.y=1-e.y;return e}set needsUpdate(e){if(e===!0)this.version++,this.source.needsUpdate=!0}set needsPMREMUpdate(e){if(e===!0)this.pmremVersion++}}Bl.DEFAULT_IMAGE=null;Bl.DEFAULT_MAPPING=300;Bl.DEFAULT_ANISOTROPY=1;class Ah{constructor(e=0,t=0,n=0,o=1){Ah.prototype.isVector4=!0,this.x=e,this.y=t,this.z=n,this.w=o}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,t,n,o){return this.x=e,this.y=t,this.z=n,this.w=o,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w!==void 0?e.w:1,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){let t=this.x,n=this.y,o=this.z,r=this.w,i=e.elements;return this.x=i[0]*t+i[4]*n+i[8]*o+i[12]*r,this.y=i[1]*t+i[5]*n+i[9]*o+i[13]*r,this.z=i[2]*t+i[6]*n+i[10]*o+i[14]*r,this.w=i[3]*t+i[7]*n+i[11]*o+i[15]*r,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);let t=Math.sqrt(1-e.w*e.w);if(t<0.0001)this.x=1,this.y=0,this.z=0;else this.x=e.x/t,this.y=e.y/t,this.z=e.z/t;return this}setAxisAngleFromRotationMatrix(e){let t,n,o,r,i=0.01,s=0.1,a=e.elements,c=a[0],l=a[4],h=a[8],d=a[1],u=a[5],_=a[9],p=a[2],m=a[6],A=a[10];if(Math.abs(l-d)<0.01&&Math.abs(h-p)<0.01&&Math.abs(_-m)<0.01){if(Math.abs(l+d)<0.1&&Math.abs(h+p)<0.1&&Math.abs(_+m)<0.1&&Math.abs(c+u+A-3)<0.1)return this.set(1,0,0,0),this;t=Math.PI;let f=(c+1)/2,y=(u+1)/2,x=(A+1)/2,C=(l+d)/4,b=(h+p)/4,I=(_+m)/4;if(f>y&&f>x)if(f<0.01)n=0,o=0.707106781,r=0.707106781;else n=Math.sqrt(f),o=C/n,r=b/n;else if(y>x)if(y<0.01)n=0.707106781,o=0,r=0.707106781;else o=Math.sqrt(y),n=C/o,r=I/o;else if(x<0.01)n=0.707106781,o=0.707106781,r=0;else r=Math.sqrt(x),n=b/r,o=I/r;return this.set(n,o,r,t),this}let g=Math.sqrt((m-_)*(m-_)+(h-p)*(h-p)+(d-l)*(d-l));if(Math.abs(g)<0.001)g=1;return this.x=(m-_)/g,this.y=(h-p)/g,this.z=(d-l)/g,this.w=Math.acos((c+u+A-1)/2),this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this.w=Math.max(e.w,Math.min(t.w,this.w)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this.w=Math.max(e,Math.min(t,this.w)),this}clampLength(e,t){let n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this.w+=(e.w-this.w)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this.w=e.w+(t.w-e.w)*n,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this.w=e.getW(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}}class cEt extends FM{constructor(e=1,t=1,n={}){super();this.isRenderTarget=!0,this.width=e,this.height=t,this.depth=1,this.scissor=new Ah(0,0,e,t),this.scissorTest=!1,this.viewport=new Ah(0,0,e,t);let o={width:e,height:t,depth:1};n=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:1006,depthBuffer:!0,stencilBuffer:!1,resolveDepthBuffer:!0,resolveStencilBuffer:!0,depthTexture:null,samples:0,count:1},n);let r=new Bl(o,n.mapping,n.wrapS,n.wrapT,n.magFilter,n.minFilter,n.format,n.type,n.anisotropy,n.colorSpace);r.flipY=!1,r.generateMipmaps=n.generateMipmaps,r.internalFormat=n.internalFormat,this.textures=[];let i=n.count;for(let s=0;s<i;s++)this.textures[s]=r.clone(),this.textures[s].isRenderTargetTexture=!0;this.depthBuffer=n.depthBuffer,this.stencilBuffer=n.stencilBuffer,this.resolveDepthBuffer=n.resolveDepthBuffer,this.resolveStencilBuffer=n.resolveStencilBuffer,this.depthTexture=n.depthTexture,this.samples=n.samples}get texture(){return this.textures[0]}set texture(e){this.textures[0]=e}setSize(e,t,n=1){if(this.width!==e||this.height!==t||this.depth!==n){this.width=e,this.height=t,this.depth=n;for(let o=0,r=this.textures.length;o<r;o++)this.textures[o].image.width=e,this.textures[o].image.height=t,this.textures[o].image.depth=n;this.dispose()}this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t)}clone(){return new this.constructor().copy(this)}copy(e){this.width=e.width,this.height=e.height,this.depth=e.depth,this.scissor.copy(e.scissor),this.scissorTest=e.scissorTest,this.viewport.copy(e.viewport),this.textures.length=0;for(let n=0,o=e.textures.length;n<o;n++)this.textures[n]=e.textures[n].clone(),this.textures[n].isRenderTargetTexture=!0;let t=Object.assign({},e.texture.image);if(this.texture.source=new dOe(t),this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,this.resolveDepthBuffer=e.resolveDepthBuffer,this.resolveStencilBuffer=e.resolveStencilBuffer,e.depthTexture!==null)this.depthTexture=e.depthTexture.clone();return this.samples=e.samples,this}dispose(){this.dispatchEvent({type:"dispose"})}}class JN extends cEt{constructor(e=1,t=1,n={}){super(e,t,n);this.isWebGLRenderTarget=!0}}class uOe extends Bl{constructor(e=null,t=1,n=1,o=1){super(null);this.isDataArrayTexture=!0,this.image={data:e,width:t,height:n,depth:o},this.magFilter=1003,this.minFilter=1003,this.wrapR=1001,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.layerUpdates=new Set}addLayerUpdate(e){this.layerUpdates.add(e)}clearLayerUpdates(){this.layerUpdates.clear()}}class lEt extends Bl{constructor(e=null,t=1,n=1,o=1){super(null);this.isData3DTexture=!0,this.image={data:e,width:t,height:n,depth:o},this.magFilter=1003,this.minFilter=1003,this.wrapR=1001,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class hm{constructor(e=0,t=0,n=0,o=1){this.isQuaternion=!0,this._x=e,this._y=t,this._z=n,this._w=o}static slerpFlat(e,t,n,o,r,i,s){let a=n[o+0],c=n[o+1],l=n[o+2],h=n[o+3],d=r[i+0],u=r[i+1],_=r[i+2],p=r[i+3];if(s===0){e[t+0]=a,e[t+1]=c,e[t+2]=l,e[t+3]=h;return}if(s===1){e[t+0]=d,e[t+1]=u,e[t+2]=_,e[t+3]=p;return}if(h!==p||a!==d||c!==u||l!==_){let m=1-s,A=a*d+c*u+l*_+h*p,g=A>=0?1:-1,f=1-A*A;if(f>Number.EPSILON){let x=Math.sqrt(f),C=Math.atan2(x,A*g);m=Math.sin(m*C)/x,s=Math.sin(s*C)/x}let y=s*g;if(a=a*m+d*y,c=c*m+u*y,l=l*m+_*y,h=h*m+p*y,m===1-s){let x=1/Math.sqrt(a*a+c*c+l*l+h*h);a*=x,c*=x,l*=x,h*=x}}e[t]=a,e[t+1]=c,e[t+2]=l,e[t+3]=h}static multiplyQuaternionsFlat(e,t,n,o,r,i){let s=n[o],a=n[o+1],c=n[o+2],l=n[o+3],h=r[i],d=r[i+1],u=r[i+2],_=r[i+3];return e[t]=s*_+l*h+a*u-c*d,e[t+1]=a*_+l*d+c*h-s*u,e[t+2]=c*_+l*u+s*d-a*h,e[t+3]=l*_-s*h-a*d-c*u,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,t,n,o){return this._x=e,this._y=t,this._z=n,this._w=o,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,t=!0){let{_x:n,_y:o,_z:r,_order:i}=e,{cos:s,sin:a}=Math,c=s(n/2),l=s(o/2),h=s(r/2),d=a(n/2),u=a(o/2),_=a(r/2);switch(i){case"XYZ":this._x=d*l*h+c*u*_,this._y=c*u*h-d*l*_,this._z=c*l*_+d*u*h,this._w=c*l*h-d*u*_;break;case"YXZ":this._x=d*l*h+c*u*_,this._y=c*u*h-d*l*_,this._z=c*l*_-d*u*h,this._w=c*l*h+d*u*_;break;case"ZXY":this._x=d*l*h-c*u*_,this._y=c*u*h+d*l*_,this._z=c*l*_+d*u*h,this._w=c*l*h-d*u*_;break;case"ZYX":this._x=d*l*h-c*u*_,this._y=c*u*h+d*l*_,this._z=c*l*_-d*u*h,this._w=c*l*h+d*u*_;break;case"YZX":this._x=d*l*h+c*u*_,this._y=c*u*h+d*l*_,this._z=c*l*_-d*u*h,this._w=c*l*h-d*u*_;break;case"XZY":this._x=d*l*h-c*u*_,this._y=c*u*h-d*l*_,this._z=c*l*_+d*u*h,this._w=c*l*h+d*u*_;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+i)}if(t===!0)this._onChangeCallback();return this}setFromAxisAngle(e,t){let n=t/2,o=Math.sin(n);return this._x=e.x*o,this._y=e.y*o,this._z=e.z*o,this._w=Math.cos(n),this._onChangeCallback(),this}setFromRotationMatrix(e){let t=e.elements,n=t[0],o=t[4],r=t[8],i=t[1],s=t[5],a=t[9],c=t[2],l=t[6],h=t[10],d=n+s+h;if(d>0){let u=0.5/Math.sqrt(d+1);this._w=0.25/u,this._x=(l-a)*u,this._y=(r-c)*u,this._z=(i-o)*u}else if(n>s&&n>h){let u=2*Math.sqrt(1+n-s-h);this._w=(l-a)/u,this._x=0.25*u,this._y=(o+i)/u,this._z=(r+c)/u}else if(s>h){let u=2*Math.sqrt(1+s-n-h);this._w=(r-c)/u,this._x=(o+i)/u,this._y=0.25*u,this._z=(a+l)/u}else{let u=2*Math.sqrt(1+h-n-s);this._w=(i-o)/u,this._x=(r+c)/u,this._y=(a+l)/u,this._z=0.25*u}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let n=e.dot(t)+1;if(n<Number.EPSILON)if(n=0,Math.abs(e.x)>Math.abs(e.z))this._x=-e.y,this._y=e.x,this._z=0,this._w=n;else this._x=0,this._y=-e.z,this._z=e.y,this._w=n;else this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this._w=n;return this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(ng(this.dot(e),-1,1)))}rotateTowards(e,t){let n=this.angleTo(e);if(n===0)return this;let o=Math.min(1,t/n);return this.slerp(e,o),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();if(e===0)this._x=0,this._y=0,this._z=0,this._w=1;else e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e;return this._onChangeCallback(),this}multiply(e){return this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){let{_x:n,_y:o,_z:r,_w:i}=e,{_x:s,_y:a,_z:c,_w:l}=t;return this._x=n*l+i*s+o*c-r*a,this._y=o*l+i*a+r*s-n*c,this._z=r*l+i*c+n*a-o*s,this._w=i*l-n*s-o*a-r*c,this._onChangeCallback(),this}slerp(e,t){if(t===0)return this;if(t===1)return this.copy(e);let n=this._x,o=this._y,r=this._z,i=this._w,s=i*e._w+n*e._x+o*e._y+r*e._z;if(s<0)this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,s=-s;else this.copy(e);if(s>=1)return this._w=i,this._x=n,this._y=o,this._z=r,this;let a=1-s*s;if(a<=Number.EPSILON){let u=1-t;return this._w=u*i+t*this._w,this._x=u*n+t*this._x,this._y=u*o+t*this._y,this._z=u*r+t*this._z,this.normalize(),this}let c=Math.sqrt(a),l=Math.atan2(c,s),h=Math.sin((1-t)*l)/c,d=Math.sin(t*l)/c;return this._w=i*h+this._w*d,this._x=n*h+this._x*d,this._y=o*h+this._y*d,this._z=r*h+this._z*d,this._onChangeCallback(),this}slerpQuaternions(e,t,n){return this.copy(e).slerp(t,n)}random(){let e=2*Math.PI*Math.random(),t=2*Math.PI*Math.random(),n=Math.random(),o=Math.sqrt(1-n),r=Math.sqrt(n);return this.set(o*Math.sin(e),o*Math.cos(e),r*Math.sin(t),r*Math.cos(t))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,t=0){return this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e}fromBufferAttribute(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class Dt{constructor(e=0,t=0,n=0){Dt.prototype.isVector3=!0,this.x=e,this.y=t,this.z=n}set(e,t,n){if(n===void 0)n=this.z;return this.x=e,this.y=t,this.z=n,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}applyEuler(e){return this.applyQuaternion(WSt.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(WSt.setFromAxisAngle(e,t))}applyMatrix3(e){let t=this.x,n=this.y,o=this.z,r=e.elements;return this.x=r[0]*t+r[3]*n+r[6]*o,this.y=r[1]*t+r[4]*n+r[7]*o,this.z=r[2]*t+r[5]*n+r[8]*o,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){let t=this.x,n=this.y,o=this.z,r=e.elements,i=1/(r[3]*t+r[7]*n+r[11]*o+r[15]);return this.x=(r[0]*t+r[4]*n+r[8]*o+r[12])*i,this.y=(r[1]*t+r[5]*n+r[9]*o+r[13])*i,this.z=(r[2]*t+r[6]*n+r[10]*o+r[14])*i,this}applyQuaternion(e){let t=this.x,n=this.y,o=this.z,{x:r,y:i,z:s,w:a}=e,c=2*(i*o-s*n),l=2*(s*t-r*o),h=2*(r*n-i*t);return this.x=t+a*c+i*h-s*l,this.y=n+a*l+s*c-r*h,this.z=o+a*h+r*l-i*c,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){let t=this.x,n=this.y,o=this.z,r=e.elements;return this.x=r[0]*t+r[4]*n+r[8]*o,this.y=r[1]*t+r[5]*n+r[9]*o,this.z=r[2]*t+r[6]*n+r[10]*o,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this}clampLength(e,t){let n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,t){let{x:n,y:o,z:r}=e,{x:i,y:s,z:a}=t;return this.x=o*a-r*s,this.y=r*i-n*a,this.z=n*s-o*i,this}projectOnVector(e){let t=e.lengthSq();if(t===0)return this.set(0,0,0);let n=e.dot(this)/t;return this.copy(e).multiplyScalar(n)}projectOnPlane(e){return Pze.copy(this).projectOnVector(e),this.sub(Pze)}reflect(e){return this.sub(Pze.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){let t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;let n=this.dot(e)/t;return Math.acos(ng(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){let t=this.x-e.x,n=this.y-e.y,o=this.z-e.z;return t*t+n*n+o*o}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,t,n){let o=Math.sin(t)*e;return this.x=o*Math.sin(n),this.y=Math.cos(t)*e,this.z=o*Math.cos(n),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,n){return this.x=e*Math.sin(t),this.y=n,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){let t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){let t=this.setFromMatrixColumn(e,0).length(),n=this.setFromMatrixColumn(e,1).length(),o=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=n,this.z=o,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,t*4)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,t*3)}setFromEuler(e){return this.x=e._x,this.y=e._y,this.z=e._z,this}setFromColor(e){return this.x=e.r,this.y=e.g,this.z=e.b,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){let e=Math.random()*Math.PI*2,t=Math.random()*2-1,n=Math.sqrt(1-t*t);return this.x=n*Math.cos(e),this.y=t,this.z=n*Math.sin(e),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}var Pze=new Dt,WSt=new hm;class dm{constructor(e=new Dt(1/0,1/0,1/0),t=new Dt(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromArray(e){this.makeEmpty();for(let t=0,n=e.length;t<n;t+=3)this.expandByPoint(RI.fromArray(e,t));return this}setFromBufferAttribute(e){this.makeEmpty();for(let t=0,n=e.count;t<n;t++)this.expandByPoint(RI.fromBufferAttribute(e,t));return this}setFromPoints(e){this.makeEmpty();for(let t=0,n=e.length;t<n;t++)this.expandByPoint(e[t]);return this}setFromCenterAndSize(e,t){let n=RI.copy(t).multiplyScalar(0.5);return this.min.copy(e).sub(n),this.max.copy(e).add(n),this}setFromObject(e,t=!1){return this.makeEmpty(),this.expandByObject(e,t)}clone(){return new this.constructor().copy(this)}copy(e){return this.min.copy(e.min),this.max.copy(e.max),this}makeEmpty(){return this.min.x=this.min.y=this.min.z=1/0,this.max.x=this.max.y=this.max.z=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z}getCenter(e){return this.isEmpty()?e.set(0,0,0):e.addVectors(this.min,this.max).multiplyScalar(0.5)}getSize(e){return this.isEmpty()?e.set(0,0,0):e.subVectors(this.max,this.min)}expandByPoint(e){return this.min.min(e),this.max.max(e),this}expandByVector(e){return this.min.sub(e),this.max.add(e),this}expandByScalar(e){return this.min.addScalar(-e),this.max.addScalar(e),this}expandByObject(e,t=!1){e.updateWorldMatrix(!1,!1);let n=e.geometry;if(n!==void 0){let r=n.getAttribute("position");if(t===!0&&r!==void 0&&e.isInstancedMesh!==!0)for(let i=0,s=r.count;i<s;i++){if(e.isMesh===!0)e.getVertexPosition(i,RI);else RI.fromBufferAttribute(r,i);RI.applyMatrix4(e.matrixWorld),this.expandByPoint(RI)}else{if(e.boundingBox!==void 0){if(e.boundingBox===null)e.computeBoundingBox();tye.copy(e.boundingBox)}else{if(n.boundingBox===null)n.computeBoundingBox();tye.copy(n.boundingBox)}tye.applyMatrix4(e.matrixWorld),this.union(tye)}}let o=e.children;for(let r=0,i=o.length;r<i;r++)this.expandByObject(o[r],t);return this}containsPoint(e){return e.x<this.min.x||e.x>this.max.x||e.y<this.min.y||e.y>this.max.y||e.z<this.min.z||e.z>this.max.z?!1:!0}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return e.max.x<this.min.x||e.min.x>this.max.x||e.max.y<this.min.y||e.min.y>this.max.y||e.max.z<this.min.z||e.min.z>this.max.z?!1:!0}intersectsSphere(e){return this.clampPoint(e.center,RI),RI.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let t,n;if(e.normal.x>0)t=e.normal.x*this.min.x,n=e.normal.x*this.max.x;else t=e.normal.x*this.max.x,n=e.normal.x*this.min.x;if(e.normal.y>0)t+=e.normal.y*this.min.y,n+=e.normal.y*this.max.y;else t+=e.normal.y*this.max.y,n+=e.normal.y*this.min.y;if(e.normal.z>0)t+=e.normal.z*this.min.z,n+=e.normal.z*this.max.z;else t+=e.normal.z*this.max.z,n+=e.normal.z*this.min.z;return t<=-e.constant&&n>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(xie),nye.subVectors(this.max,xie),vj.subVectors(e.a,xie),Sj.subVectors(e.b,xie),Pj.subVectors(e.c,xie),UN.subVectors(Sj,vj),WN.subVectors(Pj,Sj),mz.subVectors(vj,Pj);let t=[0,-UN.z,UN.y,0,-WN.z,WN.y,0,-mz.z,mz.y,UN.z,0,-UN.x,WN.z,0,-WN.x,mz.z,0,-mz.x,-UN.y,UN.x,0,-WN.y,WN.x,0,-mz.y,mz.x,0];if(!Eze(t,vj,Sj,Pj,nye))return!1;if(t=[1,0,0,0,1,0,0,0,1],!Eze(t,vj,Sj,Pj,nye))return!1;return oye.crossVectors(UN,WN),t=[oye.x,oye.y,oye.z],Eze(t,vj,Sj,Pj,nye)}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,RI).distanceTo(e)}getBoundingSphere(e){if(this.isEmpty())e.makeEmpty();else this.getCenter(e.center),e.radius=this.getSize(RI).length()*0.5;return e}intersect(e){if(this.min.max(e.min),this.max.min(e.max),this.isEmpty())this.makeEmpty();return this}union(e){return this.min.min(e.min),this.max.max(e.max),this}applyMatrix4(e){if(this.isEmpty())return this;return NM[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),NM[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),NM[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),NM[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),NM[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),NM[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),NM[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),NM[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(NM),this}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}var NM=[new Dt,new Dt,new Dt,new Dt,new Dt,new Dt,new Dt,new Dt],RI=new Dt,tye=new dm,vj=new Dt,Sj=new Dt,Pj=new Dt,UN=new Dt,WN=new Dt,mz=new Dt,xie=new Dt,nye=new Dt,oye=new Dt,_z=new Dt;function Eze(e,t,n,o,r){for(let i=0,s=e.length-3;i<=s;i+=3){_z.fromArray(e,i);let a=r.x*Math.abs(_z.x)+r.y*Math.abs(_z.y)+r.z*Math.abs(_z.z),c=t.dot(_z),l=n.dot(_z),h=o.dot(_z);if(Math.max(-Math.max(c,l,h),Math.min(c,l,h))>a)return!1}return!0}var iRo=new dm,Cie=new Dt,Mze=new Dt;class bx{constructor(e=new Dt,t=-1){this.isSphere=!0,this.center=e,this.radius=t}set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(e,t){let n=this.center;if(t!==void 0)n.copy(t);else iRo.setFromPoints(e).getCenter(n);let o=0;for(let r=0,i=e.length;r<i;r++)o=Math.max(o,n.distanceToSquared(e[r]));return this.radius=Math.sqrt(o),this}copy(e){return this.center.copy(e.center),this.radius=e.radius,this}isEmpty(){return this.radius<0}makeEmpty(){return this.center.set(0,0,0),this.radius=-1,this}containsPoint(e){return e.distanceToSquared(this.center)<=this.radius*this.radius}distanceToPoint(e){return e.distanceTo(this.center)-this.radius}intersectsSphere(e){let t=this.radius+e.radius;return e.center.distanceToSquared(this.center)<=t*t}intersectsBox(e){return e.intersectsSphere(this)}intersectsPlane(e){return Math.abs(e.distanceToPoint(this.center))<=this.radius}clampPoint(e,t){let n=this.center.distanceToSquared(e);if(t.copy(e),n>this.radius*this.radius)t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center);return t}getBoundingBox(e){if(this.isEmpty())return e.makeEmpty(),e;return e.set(this.center,this.center),e.expandByScalar(this.radius),e}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){if(this.isEmpty())return this.center.copy(e),this.radius=0,this;Cie.subVectors(e,this.center);let t=Cie.lengthSq();if(t>this.radius*this.radius){let n=Math.sqrt(t),o=(n-this.radius)*0.5;this.center.addScaledVector(Cie,o/n),this.radius+=o}return this}union(e){if(e.isEmpty())return this;if(this.isEmpty())return this.copy(e),this;if(this.center.equals(e.center)===!0)this.radius=Math.max(this.radius,e.radius);else Mze.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(Cie.copy(e.center).add(Mze)),this.expandByPoint(Cie.copy(e.center).sub(Mze));return this}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}}var RM=new Dt,wze=new Dt,rye=new Dt,XN=new Dt,Bze=new Dt,iye=new Dt,Tze=new Dt;class nR{constructor(e=new Dt,t=new Dt(0,0,-1)){this.origin=e,this.direction=t}set(e,t){return this.origin.copy(e),this.direction.copy(t),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,t){return t.copy(this.origin).addScaledVector(this.direction,e)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,RM)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);let n=t.dot(this.direction);if(n<0)return t.copy(this.origin);return t.copy(this.origin).addScaledVector(this.direction,n)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){let t=RM.subVectors(e,this.origin).dot(this.direction);if(t<0)return this.origin.distanceToSquared(e);return RM.copy(this.origin).addScaledVector(this.direction,t),RM.distanceToSquared(e)}distanceSqToSegment(e,t,n,o){wze.copy(e).add(t).multiplyScalar(0.5),rye.copy(t).sub(e).normalize(),XN.copy(this.origin).sub(wze);let r=e.distanceTo(t)*0.5,i=-this.direction.dot(rye),s=XN.dot(this.direction),a=-XN.dot(rye),c=XN.lengthSq(),l=Math.abs(1-i*i),h,d,u,_;if(l>0)if(h=i*a-s,d=i*s-a,_=r*l,h>=0)if(d>=-_)if(d<=_){let p=1/l;h*=p,d*=p,u=h*(h+i*d+2*s)+d*(i*h+d+2*a)+c}else d=r,h=Math.max(0,-(i*d+s)),u=-h*h+d*(d+2*a)+c;else d=-r,h=Math.max(0,-(i*d+s)),u=-h*h+d*(d+2*a)+c;else if(d<=-_)h=Math.max(0,-(-i*r+s)),d=h>0?-r:Math.min(Math.max(-r,-a),r),u=-h*h+d*(d+2*a)+c;else if(d<=_)h=0,d=Math.min(Math.max(-r,-a),r),u=d*(d+2*a)+c;else h=Math.max(0,-(i*r+s)),d=h>0?r:Math.min(Math.max(-r,-a),r),u=-h*h+d*(d+2*a)+c;else d=i>0?-r:r,h=Math.max(0,-(i*d+s)),u=-h*h+d*(d+2*a)+c;if(n)n.copy(this.origin).addScaledVector(this.direction,h);if(o)o.copy(wze).addScaledVector(rye,d);return u}intersectSphere(e,t){RM.subVectors(e.center,this.origin);let n=RM.dot(this.direction),o=RM.dot(RM)-n*n,r=e.radius*e.radius;if(o>r)return null;let i=Math.sqrt(r-o),s=n-i,a=n+i;if(a<0)return null;if(s<0)return this.at(a,t);return this.at(s,t)}intersectsSphere(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){let t=e.normal.dot(this.direction);if(t===0){if(e.distanceToPoint(this.origin)===0)return 0;return null}let n=-(this.origin.dot(e.normal)+e.constant)/t;return n>=0?n:null}intersectPlane(e,t){let n=this.distanceToPlane(e);if(n===null)return null;return this.at(n,t)}intersectsPlane(e){let t=e.distanceToPoint(this.origin);if(t===0)return!0;if(e.normal.dot(this.direction)*t<0)return!0;return!1}intersectBox(e,t){let n,o,r,i,s,a,c=1/this.direction.x,l=1/this.direction.y,h=1/this.direction.z,d=this.origin;if(c>=0)n=(e.min.x-d.x)*c,o=(e.max.x-d.x)*c;else n=(e.max.x-d.x)*c,o=(e.min.x-d.x)*c;if(l>=0)r=(e.min.y-d.y)*l,i=(e.max.y-d.y)*l;else r=(e.max.y-d.y)*l,i=(e.min.y-d.y)*l;if(n>i||r>o)return null;if(r>n||isNaN(n))n=r;if(i<o||isNaN(o))o=i;if(h>=0)s=(e.min.z-d.z)*h,a=(e.max.z-d.z)*h;else s=(e.max.z-d.z)*h,a=(e.min.z-d.z)*h;if(n>a||s>o)return null;if(s>n||n!==n)n=s;if(a<o||o!==o)o=a;if(o<0)return null;return this.at(n>=0?n:o,t)}intersectsBox(e){return this.intersectBox(e,RM)!==null}intersectTriangle(e,t,n,o,r){Bze.subVectors(t,e),iye.subVectors(n,e),Tze.crossVectors(Bze,iye);let i=this.direction.dot(Tze),s;if(i>0){if(o)return null;s=1}else if(i<0)s=-1,i=-i;else return null;XN.subVectors(this.origin,e);let a=s*this.direction.dot(iye.crossVectors(XN,iye));if(a<0)return null;let c=s*this.direction.dot(Bze.cross(XN));if(c<0)return null;if(a+c>i)return null;let l=-s*XN.dot(Tze);if(l<0)return null;return this.at(l/i,r)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}}class Fi{constructor(e,t,n,o,r,i,s,a,c,l,h,d,u,_,p,m){if(Fi.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],e!==void 0)this.set(e,t,n,o,r,i,s,a,c,l,h,d,u,_,p,m)}set(e,t,n,o,r,i,s,a,c,l,h,d,u,_,p,m){let A=this.elements;return A[0]=e,A[4]=t,A[8]=n,A[12]=o,A[1]=r,A[5]=i,A[9]=s,A[13]=a,A[2]=c,A[6]=l,A[10]=h,A[14]=d,A[3]=u,A[7]=_,A[11]=p,A[15]=m,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return new Fi().fromArray(this.elements)}copy(e){let t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],t[9]=n[9],t[10]=n[10],t[11]=n[11],t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15],this}copyPosition(e){let t=this.elements,n=e.elements;return t[12]=n[12],t[13]=n[13],t[14]=n[14],this}setFromMatrix3(e){let t=e.elements;return this.set(t[0],t[3],t[6],0,t[1],t[4],t[7],0,t[2],t[5],t[8],0,0,0,0,1),this}extractBasis(e,t,n){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this}makeBasis(e,t,n){return this.set(e.x,t.x,n.x,0,e.y,t.y,n.y,0,e.z,t.z,n.z,0,0,0,0,1),this}extractRotation(e){let t=this.elements,n=e.elements,o=1/Ej.setFromMatrixColumn(e,0).length(),r=1/Ej.setFromMatrixColumn(e,1).length(),i=1/Ej.setFromMatrixColumn(e,2).length();return t[0]=n[0]*o,t[1]=n[1]*o,t[2]=n[2]*o,t[3]=0,t[4]=n[4]*r,t[5]=n[5]*r,t[6]=n[6]*r,t[7]=0,t[8]=n[8]*i,t[9]=n[9]*i,t[10]=n[10]*i,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){let t=this.elements,{x:n,y:o,z:r}=e,i=Math.cos(n),s=Math.sin(n),a=Math.cos(o),c=Math.sin(o),l=Math.cos(r),h=Math.sin(r);if(e.order==="XYZ"){let d=i*l,u=i*h,_=s*l,p=s*h;t[0]=a*l,t[4]=-a*h,t[8]=c,t[1]=u+_*c,t[5]=d-p*c,t[9]=-s*a,t[2]=p-d*c,t[6]=_+u*c,t[10]=i*a}else if(e.order==="YXZ"){let d=a*l,u=a*h,_=c*l,p=c*h;t[0]=d+p*s,t[4]=_*s-u,t[8]=i*c,t[1]=i*h,t[5]=i*l,t[9]=-s,t[2]=u*s-_,t[6]=p+d*s,t[10]=i*a}else if(e.order==="ZXY"){let d=a*l,u=a*h,_=c*l,p=c*h;t[0]=d-p*s,t[4]=-i*h,t[8]=_+u*s,t[1]=u+_*s,t[5]=i*l,t[9]=p-d*s,t[2]=-i*c,t[6]=s,t[10]=i*a}else if(e.order==="ZYX"){let d=i*l,u=i*h,_=s*l,p=s*h;t[0]=a*l,t[4]=_*c-u,t[8]=d*c+p,t[1]=a*h,t[5]=p*c+d,t[9]=u*c-_,t[2]=-c,t[6]=s*a,t[10]=i*a}else if(e.order==="YZX"){let d=i*a,u=i*c,_=s*a,p=s*c;t[0]=a*l,t[4]=p-d*h,t[8]=_*h+u,t[1]=h,t[5]=i*l,t[9]=-s*l,t[2]=-c*l,t[6]=u*h+_,t[10]=d-p*h}else if(e.order==="XZY"){let d=i*a,u=i*c,_=s*a,p=s*c;t[0]=a*l,t[4]=-h,t[8]=c*l,t[1]=d*h+p,t[5]=i*l,t[9]=u*h-_,t[2]=_*h-u,t[6]=s*l,t[10]=p*h+d}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromQuaternion(e){return this.compose(sRo,e,aRo)}lookAt(e,t,n){let o=this.elements;if(A4.subVectors(e,t),A4.lengthSq()===0)A4.z=1;if(A4.normalize(),jN.crossVectors(n,A4),jN.lengthSq()===0){if(Math.abs(n.z)===1)A4.x+=0.0001;else A4.z+=0.0001;A4.normalize(),jN.crossVectors(n,A4)}return jN.normalize(),sye.crossVectors(A4,jN),o[0]=jN.x,o[4]=sye.x,o[8]=A4.x,o[1]=jN.y,o[5]=sye.y,o[9]=A4.y,o[2]=jN.z,o[6]=sye.z,o[10]=A4.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){let n=e.elements,o=t.elements,r=this.elements,i=n[0],s=n[4],a=n[8],c=n[12],l=n[1],h=n[5],d=n[9],u=n[13],_=n[2],p=n[6],m=n[10],A=n[14],g=n[3],f=n[7],y=n[11],x=n[15],C=o[0],b=o[4],I=o[8],v=o[12],P=o[1],M=o[5],B=o[9],T=o[13],N=o[2],D=o[6],L=o[10],H=o[14],V=o[3],O=o[7],U=o[11],j=o[15];return r[0]=i*C+s*P+a*N+c*V,r[4]=i*b+s*M+a*D+c*O,r[8]=i*I+s*B+a*L+c*U,r[12]=i*v+s*T+a*H+c*j,r[1]=l*C+h*P+d*N+u*V,r[5]=l*b+h*M+d*D+u*O,r[9]=l*I+h*B+d*L+u*U,r[13]=l*v+h*T+d*H+u*j,r[2]=_*C+p*P+m*N+A*V,r[6]=_*b+p*M+m*D+A*O,r[10]=_*I+p*B+m*L+A*U,r[14]=_*v+p*T+m*H+A*j,r[3]=g*C+f*P+y*N+x*V,r[7]=g*b+f*M+y*D+x*O,r[11]=g*I+f*B+y*L+x*U,r[15]=g*v+f*T+y*H+x*j,this}multiplyScalar(e){let t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this}determinant(){let e=this.elements,t=e[0],n=e[4],o=e[8],r=e[12],i=e[1],s=e[5],a=e[9],c=e[13],l=e[2],h=e[6],d=e[10],u=e[14],_=e[3],p=e[7],m=e[11],A=e[15];return _*(+r*a*h-o*c*h-r*s*d+n*c*d+o*s*u-n*a*u)+p*(+t*a*u-t*c*d+r*i*d-o*i*u+o*c*l-r*a*l)+m*(+t*c*h-t*s*u-r*i*h+n*i*u+r*s*l-n*c*l)+A*(-o*s*l-t*a*h+t*s*d+o*i*h-n*i*d+n*a*l)}transpose(){let e=this.elements,t;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this}setPosition(e,t,n){let o=this.elements;if(e.isVector3)o[12]=e.x,o[13]=e.y,o[14]=e.z;else o[12]=e,o[13]=t,o[14]=n;return this}invert(){let e=this.elements,t=e[0],n=e[1],o=e[2],r=e[3],i=e[4],s=e[5],a=e[6],c=e[7],l=e[8],h=e[9],d=e[10],u=e[11],_=e[12],p=e[13],m=e[14],A=e[15],g=h*m*c-p*d*c+p*a*u-s*m*u-h*a*A+s*d*A,f=_*d*c-l*m*c-_*a*u+i*m*u+l*a*A-i*d*A,y=l*p*c-_*h*c+_*s*u-i*p*u-l*s*A+i*h*A,x=_*h*a-l*p*a-_*s*d+i*p*d+l*s*m-i*h*m,C=t*g+n*f+o*y+r*x;if(C===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);let b=1/C;return e[0]=g*b,e[1]=(p*d*r-h*m*r-p*o*u+n*m*u+h*o*A-n*d*A)*b,e[2]=(s*m*r-p*a*r+p*o*c-n*m*c-s*o*A+n*a*A)*b,e[3]=(h*a*r-s*d*r-h*o*c+n*d*c+s*o*u-n*a*u)*b,e[4]=f*b,e[5]=(l*m*r-_*d*r+_*o*u-t*m*u-l*o*A+t*d*A)*b,e[6]=(_*a*r-i*m*r-_*o*c+t*m*c+i*o*A-t*a*A)*b,e[7]=(i*d*r-l*a*r+l*o*c-t*d*c-i*o*u+t*a*u)*b,e[8]=y*b,e[9]=(_*h*r-l*p*r-_*n*u+t*p*u+l*n*A-t*h*A)*b,e[10]=(i*p*r-_*s*r+_*n*c-t*p*c-i*n*A+t*s*A)*b,e[11]=(l*s*r-i*h*r-l*n*c+t*h*c+i*n*u-t*s*u)*b,e[12]=x*b,e[13]=(l*p*o-_*h*o+_*n*d-t*p*d-l*n*m+t*h*m)*b,e[14]=(_*s*o-i*p*o-_*n*a+t*p*a+i*n*m-t*s*m)*b,e[15]=(i*h*o-l*s*o+l*n*a-t*h*a-i*n*d+t*s*d)*b,this}scale(e){let t=this.elements,{x:n,y:o,z:r}=e;return t[0]*=n,t[4]*=o,t[8]*=r,t[1]*=n,t[5]*=o,t[9]*=r,t[2]*=n,t[6]*=o,t[10]*=r,t[3]*=n,t[7]*=o,t[11]*=r,this}getMaxScaleOnAxis(){let e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],n=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],o=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,n,o))}makeTranslation(e,t,n){if(e.isVector3)this.set(1,0,0,e.x,0,1,0,e.y,0,0,1,e.z,0,0,0,1);else this.set(1,0,0,e,0,1,0,t,0,0,1,n,0,0,0,1);return this}makeRotationX(e){let t=Math.cos(e),n=Math.sin(e);return this.set(1,0,0,0,0,t,-n,0,0,n,t,0,0,0,0,1),this}makeRotationY(e){let t=Math.cos(e),n=Math.sin(e);return this.set(t,0,n,0,0,1,0,0,-n,0,t,0,0,0,0,1),this}makeRotationZ(e){let t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,0,n,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){let n=Math.cos(t),o=Math.sin(t),r=1-n,{x:i,y:s,z:a}=e,c=r*i,l=r*s;return this.set(c*i+n,c*s-o*a,c*a+o*s,0,c*s+o*a,l*s+n,l*a-o*i,0,c*a-o*s,l*a+o*i,r*a*a+n,0,0,0,0,1),this}makeScale(e,t,n){return this.set(e,0,0,0,0,t,0,0,0,0,n,0,0,0,0,1),this}makeShear(e,t,n,o,r,i){return this.set(1,n,r,0,e,1,i,0,t,o,1,0,0,0,0,1),this}compose(e,t,n){let o=this.elements,{_x:r,_y:i,_z:s,_w:a}=t,c=r+r,l=i+i,h=s+s,d=r*c,u=r*l,_=r*h,p=i*l,m=i*h,A=s*h,g=a*c,f=a*l,y=a*h,{x,y:C,z:b}=n;return o[0]=(1-(p+A))*x,o[1]=(u+y)*x,o[2]=(_-f)*x,o[3]=0,o[4]=(u-y)*C,o[5]=(1-(d+A))*C,o[6]=(m+g)*C,o[7]=0,o[8]=(_+f)*b,o[9]=(m-g)*b,o[10]=(1-(d+p))*b,o[11]=0,o[12]=e.x,o[13]=e.y,o[14]=e.z,o[15]=1,this}decompose(e,t,n){let o=this.elements,r=Ej.set(o[0],o[1],o[2]).length(),i=Ej.set(o[4],o[5],o[6]).length(),s=Ej.set(o[8],o[9],o[10]).length();if(this.determinant()<0)r=-r;e.x=o[12],e.y=o[13],e.z=o[14],QI.copy(this);let c=1/r,l=1/i,h=1/s;return QI.elements[0]*=c,QI.elements[1]*=c,QI.elements[2]*=c,QI.elements[4]*=l,QI.elements[5]*=l,QI.elements[6]*=l,QI.elements[8]*=h,QI.elements[9]*=h,QI.elements[10]*=h,t.setFromRotationMatrix(QI),n.x=r,n.y=i,n.z=s,this}makePerspective(e,t,n,o,r,i,s=2000){let a=this.elements,c=2*r/(t-e),l=2*r/(n-o),h=(t+e)/(t-e),d=(n+o)/(n-o),u,_;if(s===2000)u=-(i+r)/(i-r),_=-2*i*r/(i-r);else if(s===2001)u=-i/(i-r),_=-i*r/(i-r);else throw Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+s);return a[0]=c,a[4]=0,a[8]=h,a[12]=0,a[1]=0,a[5]=l,a[9]=d,a[13]=0,a[2]=0,a[6]=0,a[10]=u,a[14]=_,a[3]=0,a[7]=0,a[11]=-1,a[15]=0,this}makeOrthographic(e,t,n,o,r,i,s=2000){let a=this.elements,c=1/(t-e),l=1/(n-o),h=1/(i-r),d=(t+e)*c,u=(n+o)*l,_,p;if(s===2000)_=(i+r)*h,p=-2*h;else if(s===2001)_=r*h,p=-1*h;else throw Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+s);return a[0]=2*c,a[4]=0,a[8]=0,a[12]=-d,a[1]=0,a[5]=2*l,a[9]=0,a[13]=-u,a[2]=0,a[6]=0,a[10]=p,a[14]=-_,a[3]=0,a[7]=0,a[11]=0,a[15]=1,this}equals(e){let t=this.elements,n=e.elements;for(let o=0;o<16;o++)if(t[o]!==n[o])return!1;return!0}fromArray(e,t=0){for(let n=0;n<16;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){let n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e[t+9]=n[9],e[t+10]=n[10],e[t+11]=n[11],e[t+12]=n[12],e[t+13]=n[13],e[t+14]=n[14],e[t+15]=n[15],e}}var Ej=new Dt,QI=new Fi,sRo=new Dt(0,0,0),aRo=new Dt(1,1,1),jN=new Dt,sye=new Dt,A4=new Dt,XSt=new Fi,jSt=new hm;class aA{constructor(e=0,t=0,n=0,o=aA.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=t,this._z=n,this._order=o}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,t,n,o=this._order){return this._x=e,this._y=t,this._z=n,this._order=o,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,t=this._order,n=!0){let o=e.elements,r=o[0],i=o[4],s=o[8],a=o[1],c=o[5],l=o[9],h=o[2],d=o[6],u=o[10];switch(t){case"XYZ":if(this._y=Math.asin(ng(s,-1,1)),Math.abs(s)<0.9999999)this._x=Math.atan2(-l,u),this._z=Math.atan2(-i,r);else this._x=Math.atan2(d,c),this._z=0;break;case"YXZ":if(this._x=Math.asin(-ng(l,-1,1)),Math.abs(l)<0.9999999)this._y=Math.atan2(s,u),this._z=Math.atan2(a,c);else this._y=Math.atan2(-h,r),this._z=0;break;case"ZXY":if(this._x=Math.asin(ng(d,-1,1)),Math.abs(d)<0.9999999)this._y=Math.atan2(-h,u),this._z=Math.atan2(-i,c);else this._y=0,this._z=Math.atan2(a,r);break;case"ZYX":if(this._y=Math.asin(-ng(h,-1,1)),Math.abs(h)<0.9999999)this._x=Math.atan2(d,u),this._z=Math.atan2(a,r);else this._x=0,this._z=Math.atan2(-i,c);break;case"YZX":if(this._z=Math.asin(ng(a,-1,1)),Math.abs(a)<0.9999999)this._x=Math.atan2(-l,c),this._y=Math.atan2(-h,r);else this._x=0,this._y=Math.atan2(s,u);break;case"XZY":if(this._z=Math.asin(-ng(i,-1,1)),Math.abs(i)<0.9999999)this._x=Math.atan2(d,c),this._y=Math.atan2(s,r);else this._x=Math.atan2(-l,u),this._y=0;break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}if(this._order=t,n===!0)this._onChangeCallback();return this}setFromQuaternion(e,t,n){return XSt.makeRotationFromQuaternion(e),this.setFromRotationMatrix(XSt,t,n)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return jSt.setFromEuler(this),this.setFromQuaternion(jSt,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromArray(e){if(this._x=e[0],this._y=e[1],this._z=e[2],e[3]!==void 0)this._order=e[3];return this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}}aA.DEFAULT_ORDER="XYZ";class Uye{constructor(){this.mask=1}set(e){this.mask=(1<<e|0)>>>0}enable(e){this.mask|=1<<e|0}enableAll(){this.mask=-1}toggle(e){this.mask^=1<<e|0}disable(e){this.mask&=~(1<<e|0)}disableAll(){this.mask=0}test(e){return(this.mask&e.mask)!==0}isEnabled(e){return(this.mask&(1<<e|0))!==0}}var cRo=0,KSt=new Dt,Mj=new hm,QM=new Fi,aye=new Dt,bie=new Dt,lRo=new Dt,hRo=new hm,$St=new Dt(1,0,0),qSt=new Dt(0,1,0),JSt=new Dt(0,0,1),ZSt={type:"added"},dRo={type:"removed"},wj={type:"childadded",child:null},Dze={type:"childremoved",child:null};class nl extends FM{constructor(){super();this.isObject3D=!0,Object.defineProperty(this,"id",{value:cRo++}),this.uuid=OC(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=nl.DEFAULT_UP.clone();let e=new Dt,t=new aA,n=new hm,o=new Dt(1,1,1);function r(){n.setFromEuler(t,!1)}function i(){t.setFromQuaternion(n,void 0,!1)}t._onChange(r),n._onChange(i),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:e},rotation:{configurable:!0,enumerable:!0,value:t},quaternion:{configurable:!0,enumerable:!0,value:n},scale:{configurable:!0,enumerable:!0,value:o},modelViewMatrix:{value:new Fi},normalMatrix:{value:new wa}}),this.matrix=new Fi,this.matrixWorld=new Fi,this.matrixAutoUpdate=nl.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldAutoUpdate=nl.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.layers=new Uye,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],this.userData={}}onBeforeShadow(){}onAfterShadow(){}onBeforeRender(){}onAfterRender(){}applyMatrix4(e){if(this.matrixAutoUpdate)this.updateMatrix();this.matrix.premultiply(e),this.matrix.decompose(this.position,this.quaternion,this.scale)}applyQuaternion(e){return this.quaternion.premultiply(e),this}setRotationFromAxisAngle(e,t){this.quaternion.setFromAxisAngle(e,t)}setRotationFromEuler(e){this.quaternion.setFromEuler(e,!0)}setRotationFromMatrix(e){this.quaternion.setFromRotationMatrix(e)}setRotationFromQuaternion(e){this.quaternion.copy(e)}rotateOnAxis(e,t){return Mj.setFromAxisAngle(e,t),this.quaternion.multiply(Mj),this}rotateOnWorldAxis(e,t){return Mj.setFromAxisAngle(e,t),this.quaternion.premultiply(Mj),this}rotateX(e){return this.rotateOnAxis($St,e)}rotateY(e){return this.rotateOnAxis(qSt,e)}rotateZ(e){return this.rotateOnAxis(JSt,e)}translateOnAxis(e,t){return KSt.copy(e).applyQuaternion(this.quaternion),this.position.add(KSt.multiplyScalar(t)),this}translateX(e){return this.translateOnAxis($St,e)}translateY(e){return this.translateOnAxis(qSt,e)}translateZ(e){return this.translateOnAxis(JSt,e)}localToWorld(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(this.matrixWorld)}worldToLocal(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(QM.copy(this.matrixWorld).invert())}lookAt(e,t,n){if(e.isVector3)aye.copy(e);else aye.set(e,t,n);let o=this.parent;if(this.updateWorldMatrix(!0,!1),bie.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight)QM.lookAt(bie,aye,this.up);else QM.lookAt(aye,bie,this.up);if(this.quaternion.setFromRotationMatrix(QM),o)QM.extractRotation(o.matrixWorld),Mj.setFromRotationMatrix(QM),this.quaternion.premultiply(Mj.invert())}add(e){if(arguments.length>1){for(let t=0;t<arguments.length;t++)this.add(arguments[t]);return this}if(e===this)return console.error("THREE.Object3D.add: object can't be added as a child of itself.",e),this;if(e&&e.isObject3D)e.removeFromParent(),e.parent=this,this.children.push(e),e.dispatchEvent(ZSt),wj.child=e,this.dispatchEvent(wj),wj.child=null;else console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",e);return this}remove(e){if(arguments.length>1){for(let n=0;n<arguments.length;n++)this.remove(arguments[n]);return this}let t=this.children.indexOf(e);if(t!==-1)e.parent=null,this.children.splice(t,1),e.dispatchEvent(dRo),Dze.child=e,this.dispatchEvent(Dze),Dze.child=null;return this}removeFromParent(){let e=this.parent;if(e!==null)e.remove(this);return this}clear(){return this.remove(...this.children)}attach(e){if(this.updateWorldMatrix(!0,!1),QM.copy(this.matrixWorld).invert(),e.parent!==null)e.parent.updateWorldMatrix(!0,!1),QM.multiply(e.parent.matrixWorld);return e.applyMatrix4(QM),e.removeFromParent(),e.parent=this,this.children.push(e),e.updateWorldMatrix(!1,!0),e.dispatchEvent(ZSt),wj.child=e,this.dispatchEvent(wj),wj.child=null,this}getObjectById(e){return this.getObjectByProperty("id",e)}getObjectByName(e){return this.getObjectByProperty("name",e)}getObjectByProperty(e,t){if(this[e]===t)return this;for(let n=0,o=this.children.length;n<o;n++){let i=this.children[n].getObjectByProperty(e,t);if(i!==void 0)return i}return}getObjectsByProperty(e,t,n=[]){if(this[e]===t)n.push(this);let o=this.children;for(let r=0,i=o.length;r<i;r++)o[r].getObjectsByProperty(e,t,n);return n}getWorldPosition(e){return this.updateWorldMatrix(!0,!1),e.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(bie,e,lRo),e}getWorldScale(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(bie,hRo,e),e}getWorldDirection(e){this.updateWorldMatrix(!0,!1);let t=this.matrixWorld.elements;return e.set(t[8],t[9],t[10]).normalize()}raycast(){}traverse(e){e(this);let t=this.children;for(let n=0,o=t.length;n<o;n++)t[n].traverse(e)}traverseVisible(e){if(this.visible===!1)return;e(this);let t=this.children;for(let n=0,o=t.length;n<o;n++)t[n].traverseVisible(e)}traverseAncestors(e){let t=this.parent;if(t!==null)e(t),t.traverseAncestors(e)}updateMatrix(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0}updateMatrixWorld(e){if(this.matrixAutoUpdate)this.updateMatrix();if(this.matrixWorldNeedsUpdate||e){if(this.parent===null)this.matrixWorld.copy(this.matrix);else this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix);this.matrixWorldNeedsUpdate=!1,e=!0}let t=this.children;for(let n=0,o=t.length;n<o;n++){let r=t[n];if(r.matrixWorldAutoUpdate===!0||e===!0)r.updateMatrixWorld(e)}}updateWorldMatrix(e,t){let n=this.parent;if(e===!0&&n!==null&&n.matrixWorldAutoUpdate===!0)n.updateWorldMatrix(!0,!1);if(this.matrixAutoUpdate)this.updateMatrix();if(this.parent===null)this.matrixWorld.copy(this.matrix);else this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix);if(t===!0){let o=this.children;for(let r=0,i=o.length;r<i;r++){let s=o[r];if(s.matrixWorldAutoUpdate===!0)s.updateWorldMatrix(!1,!0)}}}toJSON(e){let t=e===void 0||typeof e==="string",n={};if(t)e={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{}},n.metadata={version:4.6,type:"Object",generator:"Object3D.toJSON"};let o={};if(o.uuid=this.uuid,o.type=this.type,this.name!=="")o.name=this.name;if(this.castShadow===!0)o.castShadow=!0;if(this.receiveShadow===!0)o.receiveShadow=!0;if(this.visible===!1)o.visible=!1;if(this.frustumCulled===!1)o.frustumCulled=!1;if(this.renderOrder!==0)o.renderOrder=this.renderOrder;if(Object.keys(this.userData).length>0)o.userData=this.userData;if(o.layers=this.layers.mask,o.matrix=this.matrix.toArray(),o.up=this.up.toArray(),this.matrixAutoUpdate===!1)o.matrixAutoUpdate=!1;if(this.isInstancedMesh){if(o.type="InstancedMesh",o.count=this.count,o.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null)o.instanceColor=this.instanceColor.toJSON()}if(this.isBatchedMesh){if(o.type="BatchedMesh",o.perObjectFrustumCulled=this.perObjectFrustumCulled,o.sortObjects=this.sortObjects,o.drawRanges=this._drawRanges,o.reservedRanges=this._reservedRanges,o.visibility=this._visibility,o.active=this._active,o.bounds=this._bounds.map((s)=>({boxInitialized:s.boxInitialized,boxMin:s.box.min.toArray(),boxMax:s.box.max.toArray(),sphereInitialized:s.sphereInitialized,sphereRadius:s.sphere.radius,sphereCenter:s.sphere.center.toArray()})),o.maxGeometryCount=this._maxGeometryCount,o.maxVertexCount=this._maxVertexCount,o.maxIndexCount=this._maxIndexCount,o.geometryInitialized=this._geometryInitialized,o.geometryCount=this._geometryCount,o.matricesTexture=this._matricesTexture.toJSON(e),this._colorsTexture!==null)o.colorsTexture=this._colorsTexture.toJSON(e);if(this.boundingSphere!==null)o.boundingSphere={center:o.boundingSphere.center.toArray(),radius:o.boundingSphere.radius};if(this.boundingBox!==null)o.boundingBox={min:o.boundingBox.min.toArray(),max:o.boundingBox.max.toArray()}}function r(s,a){if(s[a.uuid]===void 0)s[a.uuid]=a.toJSON(e);return a.uuid}if(this.isScene){if(this.background){if(this.background.isColor)o.background=this.background.toJSON();else if(this.background.isTexture)o.background=this.background.toJSON(e).uuid}if(this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0)o.environment=this.environment.toJSON(e).uuid}else if(this.isMesh||this.isLine||this.isPoints){o.geometry=r(e.geometries,this.geometry);let s=this.geometry.parameters;if(s!==void 0&&s.shapes!==void 0){let a=s.shapes;if(Array.isArray(a))for(let c=0,l=a.length;c<l;c++){let h=a[c];r(e.shapes,h)}else r(e.shapes,a)}}if(this.isSkinnedMesh){if(o.bindMode=this.bindMode,o.bindMatrix=this.bindMatrix.toArray(),this.skeleton!==void 0)r(e.skeletons,this.skeleton),o.skeleton=this.skeleton.uuid}if(this.material!==void 0)if(Array.isArray(this.material)){let s=[];for(let a=0,c=this.material.length;a<c;a++)s.push(r(e.materials,this.material[a]));o.material=s}else o.material=r(e.materials,this.material);if(this.children.length>0){o.children=[];for(let s=0;s<this.children.length;s++)o.children.push(this.children[s].toJSON(e).object)}if(this.animations.length>0){o.animations=[];for(let s=0;s<this.animations.length;s++){let a=this.animations[s];o.animations.push(r(e.animations,a))}}if(t){let s=i(e.geometries),a=i(e.materials),c=i(e.textures),l=i(e.images),h=i(e.shapes),d=i(e.skeletons),u=i(e.animations),_=i(e.nodes);if(s.length>0)n.geometries=s;if(a.length>0)n.materials=a;if(c.length>0)n.textures=c;if(l.length>0)n.images=l;if(h.length>0)n.shapes=h;if(d.length>0)n.skeletons=d;if(u.length>0)n.animations=u;if(_.length>0)n.nodes=_}return n.object=o,n;function i(s){let a=[];for(let c in s){let l=s[c];delete l.metadata,a.push(l)}return a}}clone(e){return new this.constructor().copy(this,e)}copy(e,t=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldAutoUpdate=e.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.animations=e.animations.slice(),this.userData=JSON.parse(JSON.stringify(e.userData)),t===!0)for(let n=0;n<e.children.length;n++){let o=e.children[n];this.add(o.clone())}return this}}nl.DEFAULT_UP=new Dt(0,1,0);nl.DEFAULT_MATRIX_AUTO_UPDATE=!0;nl.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0;var kI=new Dt,kM=new Dt,Nze=new Dt,LM=new Dt,Bj=new Dt,Tj=new Dt,ePt=new Dt,Rze=new Dt,Qze=new Dt,kze=new Dt;class FI{constructor(e=new Dt,t=new Dt,n=new Dt){this.a=e,this.b=t,this.c=n}static getNormal(e,t,n,o){o.subVectors(n,t),kI.subVectors(e,t),o.cross(kI);let r=o.lengthSq();if(r>0)return o.multiplyScalar(1/Math.sqrt(r));return o.set(0,0,0)}static getBarycoord(e,t,n,o,r){kI.subVectors(o,t),kM.subVectors(n,t),Nze.subVectors(e,t);let i=kI.dot(kI),s=kI.dot(kM),a=kI.dot(Nze),c=kM.dot(kM),l=kM.dot(Nze),h=i*c-s*s;if(h===0)return r.set(0,0,0),null;let d=1/h,u=(c*a-s*l)*d,_=(i*l-s*a)*d;return r.set(1-u-_,_,u)}static containsPoint(e,t,n,o){if(this.getBarycoord(e,t,n,o,LM)===null)return!1;return LM.x>=0&&LM.y>=0&&LM.x+LM.y<=1}static getInterpolation(e,t,n,o,r,i,s,a){if(this.getBarycoord(e,t,n,o,LM)===null){if(a.x=0,a.y=0,"z"in a)a.z=0;if("w"in a)a.w=0;return null}return a.setScalar(0),a.addScaledVector(r,LM.x),a.addScaledVector(i,LM.y),a.addScaledVector(s,LM.z),a}static isFrontFacing(e,t,n,o){return kI.subVectors(n,t),kM.subVectors(e,t),kI.cross(kM).dot(o)<0?!0:!1}set(e,t,n){return this.a.copy(e),this.b.copy(t),this.c.copy(n),this}setFromPointsAndIndices(e,t,n,o){return this.a.copy(e[t]),this.b.copy(e[n]),this.c.copy(e[o]),this}setFromAttributeAndIndices(e,t,n,o){return this.a.fromBufferAttribute(e,t),this.b.fromBufferAttribute(e,n),this.c.fromBufferAttribute(e,o),this}clone(){return new this.constructor().copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return kI.subVectors(this.c,this.b),kM.subVectors(this.a,this.b),kI.cross(kM).length()*0.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(0.3333333333333333)}getNormal(e){return FI.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return FI.getBarycoord(e,this.a,this.b,this.c,t)}getInterpolation(e,t,n,o,r){return FI.getInterpolation(e,this.a,this.b,this.c,t,n,o,r)}containsPoint(e){return FI.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return FI.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){let n=this.a,o=this.b,r=this.c,i,s;Bj.subVectors(o,n),Tj.subVectors(r,n),Rze.subVectors(e,n);let a=Bj.dot(Rze),c=Tj.dot(Rze);if(a<=0&&c<=0)return t.copy(n);Qze.subVectors(e,o);let l=Bj.dot(Qze),h=Tj.dot(Qze);if(l>=0&&h<=l)return t.copy(o);let d=a*h-l*c;if(d<=0&&a>=0&&l<=0)return i=a/(a-l),t.copy(n).addScaledVector(Bj,i);kze.subVectors(e,r);let u=Bj.dot(kze),_=Tj.dot(kze);if(_>=0&&u<=_)return t.copy(r);let p=u*c-a*_;if(p<=0&&c>=0&&_<=0)return s=c/(c-_),t.copy(n).addScaledVector(Tj,s);let m=l*_-u*h;if(m<=0&&h-l>=0&&u-_>=0)return ePt.subVectors(r,o),s=(h-l)/(h-l+(u-_)),t.copy(o).addScaledVector(ePt,s);let A=1/(m+p+d);return i=p*A,s=d*A,t.copy(n).addScaledVector(Bj,i).addScaledVector(Tj,s)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}var hEt={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},KN={h:0,s:0,l:0},cye={h:0,s:0,l:0};function Lze(e,t,n){if(n<0)n+=1;if(n>1)n-=1;if(n<0.16666666666666666)return e+(t-e)*6*n;if(n<0.5)return t;if(n<0.6666666666666666)return e+(t-e)*6*(0.6666666666666666-n);return e}class Do{constructor(e,t,n){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(e,t,n)}set(e,t,n){if(t===void 0&&n===void 0){let o=e;if(o&&o.isColor)this.copy(o);else if(typeof o==="number")this.setHex(o);else if(typeof o==="string")this.setStyle(o)}else this.setRGB(e,t,n);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,t="srgb"){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,Th.toWorkingColorSpace(this,t),this}setRGB(e,t,n,o=Th.workingColorSpace){return this.r=e,this.g=t,this.b=n,Th.toWorkingColorSpace(this,o),this}setHSL(e,t,n,o=Th.workingColorSpace){if(e=lOe(e,1),t=ng(t,0,1),n=ng(n,0,1),t===0)this.r=this.g=this.b=n;else{let r=n<=0.5?n*(1+t):n+t-n*t,i=2*n-r;this.r=Lze(i,r,e+0.3333333333333333),this.g=Lze(i,r,e),this.b=Lze(i,r,e-0.3333333333333333)}return Th.toWorkingColorSpace(this,o),this}setStyle(e,t="srgb"){function n(r){if(r===void 0)return;if(parseFloat(r)<1)console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}let o;if(o=/^(\w+)\(([^\)]*)\)/.exec(e)){let r,i=o[1],s=o[2];switch(i){case"rgb":case"rgba":if(r=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s))return n(r[4]),this.setRGB(Math.min(255,parseInt(r[1],10))/255,Math.min(255,parseInt(r[2],10))/255,Math.min(255,parseInt(r[3],10))/255,t);if(r=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s))return n(r[4]),this.setRGB(Math.min(100,parseInt(r[1],10))/100,Math.min(100,parseInt(r[2],10))/100,Math.min(100,parseInt(r[3],10))/100,t);break;case"hsl":case"hsla":if(r=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s))return n(r[4]),this.setHSL(parseFloat(r[1])/360,parseFloat(r[2])/100,parseFloat(r[3])/100,t);break;default:console.warn("THREE.Color: Unknown color model "+e)}}else if(o=/^\#([A-Fa-f\d]+)$/.exec(e)){let r=o[1],i=r.length;if(i===3)return this.setRGB(parseInt(r.charAt(0),16)/15,parseInt(r.charAt(1),16)/15,parseInt(r.charAt(2),16)/15,t);else if(i===6)return this.setHex(parseInt(r,16),t);else console.warn("THREE.Color: Invalid hex color "+e)}else if(e&&e.length>0)return this.setColorName(e,t);return this}setColorName(e,t="srgb"){let n=hEt[e.toLowerCase()];if(n!==void 0)this.setHex(n,t);else console.warn("THREE.Color: Unknown color "+e);return this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copySRGBToLinear(e){return this.r=Yj(e.r),this.g=Yj(e.g),this.b=Yj(e.b),this}copyLinearToSRGB(e){return this.r=vze(e.r),this.g=vze(e.g),this.b=vze(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e="srgb"){return Th.fromWorkingColorSpace(I2.copy(this),e),Math.round(ng(I2.r*255,0,255))*65536+Math.round(ng(I2.g*255,0,255))*256+Math.round(ng(I2.b*255,0,255))}getHexString(e="srgb"){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,t=Th.workingColorSpace){Th.fromWorkingColorSpace(I2.copy(this),t);let{r:n,g:o,b:r}=I2,i=Math.max(n,o,r),s=Math.min(n,o,r),a,c,l=(s+i)/2;if(s===i)a=0,c=0;else{let h=i-s;switch(c=l<=0.5?h/(i+s):h/(2-i-s),i){case n:a=(o-r)/h+(o<r?6:0);break;case o:a=(r-n)/h+2;break;case r:a=(n-o)/h+4;break}a/=6}return e.h=a,e.s=c,e.l=l,e}getRGB(e,t=Th.workingColorSpace){return Th.fromWorkingColorSpace(I2.copy(this),t),e.r=I2.r,e.g=I2.g,e.b=I2.b,e}getStyle(e="srgb"){Th.fromWorkingColorSpace(I2.copy(this),e);let{r:t,g:n,b:o}=I2;if(e!=="srgb")return`color(${e} ${t.toFixed(3)} ${n.toFixed(3)} ${o.toFixed(3)})`;return`rgb(${Math.round(t*255)},${Math.round(n*255)},${Math.round(o*255)})`}offsetHSL(e,t,n){return this.getHSL(KN),this.setHSL(KN.h+e,KN.s+t,KN.l+n)}add(e){return this.r+=e.r,this.g+=e.g,this.b+=e.b,this}addColors(e,t){return this.r=e.r+t.r,this.g=e.g+t.g,this.b=e.b+t.b,this}addScalar(e){return this.r+=e,this.g+=e,this.b+=e,this}sub(e){return this.r=Math.max(0,this.r-e.r),this.g=Math.max(0,this.g-e.g),this.b=Math.max(0,this.b-e.b),this}multiply(e){return this.r*=e.r,this.g*=e.g,this.b*=e.b,this}multiplyScalar(e){return this.r*=e,this.g*=e,this.b*=e,this}lerp(e,t){return this.r+=(e.r-this.r)*t,this.g+=(e.g-this.g)*t,this.b+=(e.b-this.b)*t,this}lerpColors(e,t,n){return this.r=e.r+(t.r-e.r)*n,this.g=e.g+(t.g-e.g)*n,this.b=e.b+(t.b-e.b)*n,this}lerpHSL(e,t){this.getHSL(KN),e.getHSL(cye);let n=wie(KN.h,cye.h,t),o=wie(KN.s,cye.s,t),r=wie(KN.l,cye.l,t);return this.setHSL(n,o,r),this}setFromVector3(e){return this.r=e.x,this.g=e.y,this.b=e.z,this}applyMatrix3(e){let t=this.r,n=this.g,o=this.b,r=e.elements;return this.r=r[0]*t+r[3]*n+r[6]*o,this.g=r[1]*t+r[4]*n+r[7]*o,this.b=r[2]*t+r[5]*n+r[8]*o,this}equals(e){return e.r===this.r&&e.g===this.g&&e.b===this.b}fromArray(e,t=0){return this.r=e[t],this.g=e[t+1],this.b=e[t+2],this}toArray(e=[],t=0){return e[t]=this.r,e[t+1]=this.g,e[t+2]=this.b,e}fromBufferAttribute(e,t){return this.r=e.getX(t),this.g=e.getY(t),this.b=e.getZ(t),this}toJSON(){return this.getHex()}*[Symbol.iterator](){yield this.r,yield this.g,yield this.b}}var I2=new Do;Do.NAMES=hEt;var uRo=0;class cA extends FM{constructor(){super();this.isMaterial=!0,Object.defineProperty(this,"id",{value:uRo++}),this.uuid=OC(),this.name="",this.type="Material",this.blending=1,this.side=0,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.alphaHash=!1,this.blendSrc=204,this.blendDst=205,this.blendEquation=100,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.blendColor=new Do(0,0,0),this.blendAlpha=0,this.depthFunc=3,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=519,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=7680,this.stencilZFail=7680,this.stencilZPass=7680,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaToCoverage=!1,this.premultipliedAlpha=!1,this.forceSinglePass=!1,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0,this._alphaTest=0}get alphaTest(){return this._alphaTest}set alphaTest(e){if(this._alphaTest>0!==e>0)this.version++;this._alphaTest=e}onBuild(){}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(e===void 0)return;for(let t in e){let n=e[t];if(n===void 0){console.warn(`THREE.Material: parameter '${t}' has value of undefined.`);continue}let o=this[t];if(o===void 0){console.warn(`THREE.Material: '${t}' is not a property of THREE.${this.type}.`);continue}if(o&&o.isColor)o.set(n);else if(o&&o.isVector3&&(n&&n.isVector3))o.copy(n);else this[t]=n}}toJSON(e){let t=e===void 0||typeof e==="string";if(t)e={textures:{},images:{}};let n={metadata:{version:4.6,type:"Material",generator:"Material.toJSON"}};if(n.uuid=this.uuid,n.type=this.type,this.name!=="")n.name=this.name;if(this.color&&this.color.isColor)n.color=this.color.getHex();if(this.roughness!==void 0)n.roughness=this.roughness;if(this.metalness!==void 0)n.metalness=this.metalness;if(this.sheen!==void 0)n.sheen=this.sheen;if(this.sheenColor&&this.sheenColor.isColor)n.sheenColor=this.sheenColor.getHex();if(this.sheenRoughness!==void 0)n.sheenRoughness=this.sheenRoughness;if(this.emissive&&this.emissive.isColor)n.emissive=this.emissive.getHex();if(this.emissiveIntensity!==void 0&&this.emissiveIntensity!==1)n.emissiveIntensity=this.emissiveIntensity;if(this.specular&&this.specular.isColor)n.specular=this.specular.getHex();if(this.specularIntensity!==void 0)n.specularIntensity=this.specularIntensity;if(this.specularColor&&this.specularColor.isColor)n.specularColor=this.specularColor.getHex();if(this.shininess!==void 0)n.shininess=this.shininess;if(this.clearcoat!==void 0)n.clearcoat=this.clearcoat;if(this.clearcoatRoughness!==void 0)n.clearcoatRoughness=this.clearcoatRoughness;if(this.clearcoatMap&&this.clearcoatMap.isTexture)n.clearcoatMap=this.clearcoatMap.toJSON(e).uuid;if(this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture)n.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid;if(this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture)n.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,n.clearcoatNormalScale=this.clearcoatNormalScale.toArray();if(this.dispersion!==void 0)n.dispersion=this.dispersion;if(this.iridescence!==void 0)n.iridescence=this.iridescence;if(this.iridescenceIOR!==void 0)n.iridescenceIOR=this.iridescenceIOR;if(this.iridescenceThicknessRange!==void 0)n.iridescenceThicknessRange=this.iridescenceThicknessRange;if(this.iridescenceMap&&this.iridescenceMap.isTexture)n.iridescenceMap=this.iridescenceMap.toJSON(e).uuid;if(this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture)n.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).uuid;if(this.anisotropy!==void 0)n.anisotropy=this.anisotropy;if(this.anisotropyRotation!==void 0)n.anisotropyRotation=this.anisotropyRotation;if(this.anisotropyMap&&this.anisotropyMap.isTexture)n.anisotropyMap=this.anisotropyMap.toJSON(e).uuid;if(this.map&&this.map.isTexture)n.map=this.map.toJSON(e).uuid;if(this.matcap&&this.matcap.isTexture)n.matcap=this.matcap.toJSON(e).uuid;if(this.alphaMap&&this.alphaMap.isTexture)n.alphaMap=this.alphaMap.toJSON(e).uuid;if(this.lightMap&&this.lightMap.isTexture)n.lightMap=this.lightMap.toJSON(e).uuid,n.lightMapIntensity=this.lightMapIntensity;if(this.aoMap&&this.aoMap.isTexture)n.aoMap=this.aoMap.toJSON(e).uuid,n.aoMapIntensity=this.aoMapIntensity;if(this.bumpMap&&this.bumpMap.isTexture)n.bumpMap=this.bumpMap.toJSON(e).uuid,n.bumpScale=this.bumpScale;if(this.normalMap&&this.normalMap.isTexture)n.normalMap=this.normalMap.toJSON(e).uuid,n.normalMapType=this.normalMapType,n.normalScale=this.normalScale.toArray();if(this.displacementMap&&this.displacementMap.isTexture)n.displacementMap=this.displacementMap.toJSON(e).uuid,n.displacementScale=this.displacementScale,n.displacementBias=this.displacementBias;if(this.roughnessMap&&this.roughnessMap.isTexture)n.roughnessMap=this.roughnessMap.toJSON(e).uuid;if(this.metalnessMap&&this.metalnessMap.isTexture)n.metalnessMap=this.metalnessMap.toJSON(e).uuid;if(this.emissiveMap&&this.emissiveMap.isTexture)n.emissiveMap=this.emissiveMap.toJSON(e).uuid;if(this.specularMap&&this.specularMap.isTexture)n.specularMap=this.specularMap.toJSON(e).uuid;if(this.specularIntensityMap&&this.specularIntensityMap.isTexture)n.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid;if(this.specularColorMap&&this.specularColorMap.isTexture)n.specularColorMap=this.specularColorMap.toJSON(e).uuid;if(this.envMap&&this.envMap.isTexture){if(n.envMap=this.envMap.toJSON(e).uuid,this.combine!==void 0)n.combine=this.combine}if(this.envMapRotation!==void 0)n.envMapRotation=this.envMapRotation.toArray();if(this.envMapIntensity!==void 0)n.envMapIntensity=this.envMapIntensity;if(this.reflectivity!==void 0)n.reflectivity=this.reflectivity;if(this.refractionRatio!==void 0)n.refractionRatio=this.refractionRatio;if(this.gradientMap&&this.gradientMap.isTexture)n.gradientMap=this.gradientMap.toJSON(e).uuid;if(this.transmission!==void 0)n.transmission=this.transmission;if(this.transmissionMap&&this.transmissionMap.isTexture)n.transmissionMap=this.transmissionMap.toJSON(e).uuid;if(this.thickness!==void 0)n.thickness=this.thickness;if(this.thicknessMap&&this.thicknessMap.isTexture)n.thicknessMap=this.thicknessMap.toJSON(e).uuid;if(this.attenuationDistance!==void 0&&this.attenuationDistance!==1/0)n.attenuationDistance=this.attenuationDistance;if(this.attenuationColor!==void 0)n.attenuationColor=this.attenuationColor.getHex();if(this.size!==void 0)n.size=this.size;if(this.shadowSide!==null)n.shadowSide=this.shadowSide;if(this.sizeAttenuation!==void 0)n.sizeAttenuation=this.sizeAttenuation;if(this.blending!==1)n.blending=this.blending;if(this.side!==0)n.side=this.side;if(this.vertexColors===!0)n.vertexColors=!0;if(this.opacity<1)n.opacity=this.opacity;if(this.transparent===!0)n.transparent=!0;if(this.blendSrc!==204)n.blendSrc=this.blendSrc;if(this.blendDst!==205)n.blendDst=this.blendDst;if(this.blendEquation!==100)n.blendEquation=this.blendEquation;if(this.blendSrcAlpha!==null)n.blendSrcAlpha=this.blendSrcAlpha;if(this.blendDstAlpha!==null)n.blendDstAlpha=this.blendDstAlpha;if(this.blendEquationAlpha!==null)n.blendEquationAlpha=this.blendEquationAlpha;if(this.blendColor&&this.blendColor.isColor)n.blendColor=this.blendColor.getHex();if(this.blendAlpha!==0)n.blendAlpha=this.blendAlpha;if(this.depthFunc!==3)n.depthFunc=this.depthFunc;if(this.depthTest===!1)n.depthTest=this.depthTest;if(this.depthWrite===!1)n.depthWrite=this.depthWrite;if(this.colorWrite===!1)n.colorWrite=this.colorWrite;if(this.stencilWriteMask!==255)n.stencilWriteMask=this.stencilWriteMask;if(this.stencilFunc!==519)n.stencilFunc=this.stencilFunc;if(this.stencilRef!==0)n.stencilRef=this.stencilRef;if(this.stencilFuncMask!==255)n.stencilFuncMask=this.stencilFuncMask;if(this.stencilFail!==7680)n.stencilFail=this.stencilFail;if(this.stencilZFail!==7680)n.stencilZFail=this.stencilZFail;if(this.stencilZPass!==7680)n.stencilZPass=this.stencilZPass;if(this.stencilWrite===!0)n.stencilWrite=this.stencilWrite;if(this.rotation!==void 0&&this.rotation!==0)n.rotation=this.rotation;if(this.polygonOffset===!0)n.polygonOffset=!0;if(this.polygonOffsetFactor!==0)n.polygonOffsetFactor=this.polygonOffsetFactor;if(this.polygonOffsetUnits!==0)n.polygonOffsetUnits=this.polygonOffsetUnits;if(this.linewidth!==void 0&&this.linewidth!==1)n.linewidth=this.linewidth;if(this.dashSize!==void 0)n.dashSize=this.dashSize;if(this.gapSize!==void 0)n.gapSize=this.gapSize;if(this.scale!==void 0)n.scale=this.scale;if(this.dithering===!0)n.dithering=!0;if(this.alphaTest>0)n.alphaTest=this.alphaTest;if(this.alphaHash===!0)n.alphaHash=!0;if(this.alphaToCoverage===!0)n.alphaToCoverage=!0;if(this.premultipliedAlpha===!0)n.premultipliedAlpha=!0;if(this.forceSinglePass===!0)n.forceSinglePass=!0;if(this.wireframe===!0)n.wireframe=!0;if(this.wireframeLinewidth>1)n.wireframeLinewidth=this.wireframeLinewidth;if(this.wireframeLinecap!=="round")n.wireframeLinecap=this.wireframeLinecap;if(this.wireframeLinejoin!=="round")n.wireframeLinejoin=this.wireframeLinejoin;if(this.flatShading===!0)n.flatShading=!0;if(this.visible===!1)n.visible=!1;if(this.toneMapped===!1)n.toneMapped=!1;if(this.fog===!1)n.fog=!1;if(Object.keys(this.userData).length>0)n.userData=this.userData;function o(r){let i=[];for(let s in r){let a=r[s];delete a.metadata,i.push(a)}return i}if(t){let r=o(e.textures),i=o(e.images);if(r.length>0)n.textures=r;if(i.length>0)n.images=i}return n}clone(){return new this.constructor().copy(this)}copy(e){this.name=e.name,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.blendColor.copy(e.blendColor),this.blendAlpha=e.blendAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;let t=e.clippingPlanes,n=null;if(t!==null){let o=t.length;n=Array(o);for(let r=0;r!==o;++r)n[r]=t[r].clone()}return this.clippingPlanes=n,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaHash=e.alphaHash,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.forceSinglePass=e.forceSinglePass,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){if(e===!0)this.version++}}class lA extends cA{constructor(e){super();this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new Do(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new aA,this.combine=0,this.reflectivity=1,this.refractionRatio=0.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}}var $m=new Dt,lye=new go;class ol{constructor(e,t,n=!1){if(Array.isArray(e))throw TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,this.name="",this.array=e,this.itemSize=t,this.count=e!==void 0?e.length/t:0,this.normalized=n,this.usage=35044,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.gpuType=1015,this.version=0}onUploadCallback(){}set needsUpdate(e){if(e===!0)this.version++}get updateRange(){return hOe("THREE.BufferAttribute: updateRange() is deprecated and will be removed in r169. Use addUpdateRange() instead."),this._updateRange}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this.gpuType=e.gpuType,this}copyAt(e,t,n){e*=this.itemSize,n*=t.itemSize;for(let o=0,r=this.itemSize;o<r;o++)this.array[e+o]=t.array[n+o];return this}copyArray(e){return this.array.set(e),this}applyMatrix3(e){if(this.itemSize===2)for(let t=0,n=this.count;t<n;t++)lye.fromBufferAttribute(this,t),lye.applyMatrix3(e),this.setXY(t,lye.x,lye.y);else if(this.itemSize===3)for(let t=0,n=this.count;t<n;t++)$m.fromBufferAttribute(this,t),$m.applyMatrix3(e),this.setXYZ(t,$m.x,$m.y,$m.z);return this}applyMatrix4(e){for(let t=0,n=this.count;t<n;t++)$m.fromBufferAttribute(this,t),$m.applyMatrix4(e),this.setXYZ(t,$m.x,$m.y,$m.z);return this}applyNormalMatrix(e){for(let t=0,n=this.count;t<n;t++)$m.fromBufferAttribute(this,t),$m.applyNormalMatrix(e),this.setXYZ(t,$m.x,$m.y,$m.z);return this}transformDirection(e){for(let t=0,n=this.count;t<n;t++)$m.fromBufferAttribute(this,t),$m.transformDirection(e),this.setXYZ(t,$m.x,$m.y,$m.z);return this}set(e,t=0){return this.array.set(e,t),this}getComponent(e,t){let n=this.array[e*this.itemSize+t];if(this.normalized)n=HI(n,this.array);return n}setComponent(e,t,n){if(this.normalized)n=Bh(n,this.array);return this.array[e*this.itemSize+t]=n,this}getX(e){let t=this.array[e*this.itemSize];if(this.normalized)t=HI(t,this.array);return t}setX(e,t){if(this.normalized)t=Bh(t,this.array);return this.array[e*this.itemSize]=t,this}getY(e){let t=this.array[e*this.itemSize+1];if(this.normalized)t=HI(t,this.array);return t}setY(e,t){if(this.normalized)t=Bh(t,this.array);return this.array[e*this.itemSize+1]=t,this}getZ(e){let t=this.array[e*this.itemSize+2];if(this.normalized)t=HI(t,this.array);return t}setZ(e,t){if(this.normalized)t=Bh(t,this.array);return this.array[e*this.itemSize+2]=t,this}getW(e){let t=this.array[e*this.itemSize+3];if(this.normalized)t=HI(t,this.array);return t}setW(e,t){if(this.normalized)t=Bh(t,this.array);return this.array[e*this.itemSize+3]=t,this}setXY(e,t,n){if(e*=this.itemSize,this.normalized)t=Bh(t,this.array),n=Bh(n,this.array);return this.array[e+0]=t,this.array[e+1]=n,this}setXYZ(e,t,n,o){if(e*=this.itemSize,this.normalized)t=Bh(t,this.array),n=Bh(n,this.array),o=Bh(o,this.array);return this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=o,this}setXYZW(e,t,n,o,r){if(e*=this.itemSize,this.normalized)t=Bh(t,this.array),n=Bh(n,this.array),o=Bh(o,this.array),r=Bh(r,this.array);return this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=o,this.array[e+3]=r,this}onUpload(e){return this.onUploadCallback=e,this}clone(){return new this.constructor(this.array,this.itemSize).copy(this)}toJSON(){let e={itemSize:this.itemSize,type:this.array.constructor.name,array:Array.from(this.array),normalized:this.normalized};if(this.name!=="")e.name=this.name;if(this.usage!==35044)e.usage=this.usage;return e}}class pOe extends ol{constructor(e,t,n){super(new Uint16Array(e),t,n)}}class Vie extends ol{constructor(e,t,n){super(new Uint32Array(e),t,n)}}class jr extends ol{constructor(e,t,n){super(new Float32Array(e),t,n)}}var pRo=0,zC=new Fi,Hze=new nl,Dj=new Dt,f4=new dm,Iie=new dm,sA=new Dt;class ha extends FM{constructor(){super();this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:pRo++}),this.uuid=OC(),this.name="",this.type="BufferGeometry",this.index=null,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=!1,this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={}}getIndex(){return this.index}setIndex(e){if(Array.isArray(e))this.index=new((sEt(e))?Vie:pOe)(e,1);else this.index=e;return this}getAttribute(e){return this.attributes[e]}setAttribute(e,t){return this.attributes[e]=t,this}deleteAttribute(e){return delete this.attributes[e],this}hasAttribute(e){return this.attributes[e]!==void 0}addGroup(e,t,n=0){this.groups.push({start:e,count:t,materialIndex:n})}clearGroups(){this.groups=[]}setDrawRange(e,t){this.drawRange.start=e,this.drawRange.count=t}applyMatrix4(e){let t=this.attributes.position;if(t!==void 0)t.applyMatrix4(e),t.needsUpdate=!0;let n=this.attributes.normal;if(n!==void 0){let r=new wa().getNormalMatrix(e);n.applyNormalMatrix(r),n.needsUpdate=!0}let o=this.attributes.tangent;if(o!==void 0)o.transformDirection(e),o.needsUpdate=!0;if(this.boundingBox!==null)this.computeBoundingBox();if(this.boundingSphere!==null)this.computeBoundingSphere();return this}applyQuaternion(e){return zC.makeRotationFromQuaternion(e),this.applyMatrix4(zC),this}rotateX(e){return zC.makeRotationX(e),this.applyMatrix4(zC),this}rotateY(e){return zC.makeRotationY(e),this.applyMatrix4(zC),this}rotateZ(e){return zC.makeRotationZ(e),this.applyMatrix4(zC),this}translate(e,t,n){return zC.makeTranslation(e,t,n),this.applyMatrix4(zC),this}scale(e,t,n){return zC.makeScale(e,t,n),this.applyMatrix4(zC),this}lookAt(e){return Hze.lookAt(e),Hze.updateMatrix(),this.applyMatrix4(Hze.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(Dj).negate(),this.translate(Dj.x,Dj.y,Dj.z),this}setFromPoints(e){let t=[];for(let n=0,o=e.length;n<o;n++){let r=e[n];t.push(r.x,r.y,r.z||0)}return this.setAttribute("position",new jr(t,3)),this}computeBoundingBox(){if(this.boundingBox===null)this.boundingBox=new dm;let e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){console.error("THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.",this),this.boundingBox.set(new Dt(-1/0,-1/0,-1/0),new Dt(1/0,1/0,1/0));return}if(e!==void 0){if(this.boundingBox.setFromBufferAttribute(e),t)for(let n=0,o=t.length;n<o;n++){let r=t[n];if(f4.setFromBufferAttribute(r),this.morphTargetsRelative)sA.addVectors(this.boundingBox.min,f4.min),this.boundingBox.expandByPoint(sA),sA.addVectors(this.boundingBox.max,f4.max),this.boundingBox.expandByPoint(sA);else this.boundingBox.expandByPoint(f4.min),this.boundingBox.expandByPoint(f4.max)}}else this.boundingBox.makeEmpty();if(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))console.error('THREE.BufferGeometry.computeBoundingBox(): Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',this)}computeBoundingSphere(){if(this.boundingSphere===null)this.boundingSphere=new bx;let e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){console.error("THREE.BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere.",this),this.boundingSphere.set(new Dt,1/0);return}if(e){let n=this.boundingSphere.center;if(f4.setFromBufferAttribute(e),t)for(let r=0,i=t.length;r<i;r++){let s=t[r];if(Iie.setFromBufferAttribute(s),this.morphTargetsRelative)sA.addVectors(f4.min,Iie.min),f4.expandByPoint(sA),sA.addVectors(f4.max,Iie.max),f4.expandByPoint(sA);else f4.expandByPoint(Iie.min),f4.expandByPoint(Iie.max)}f4.getCenter(n);let o=0;for(let r=0,i=e.count;r<i;r++)sA.fromBufferAttribute(e,r),o=Math.max(o,n.distanceToSquared(sA));if(t)for(let r=0,i=t.length;r<i;r++){let s=t[r],a=this.morphTargetsRelative;for(let c=0,l=s.count;c<l;c++){if(sA.fromBufferAttribute(s,c),a)Dj.fromBufferAttribute(e,c),sA.add(Dj);o=Math.max(o,n.distanceToSquared(sA))}}if(this.boundingSphere.radius=Math.sqrt(o),isNaN(this.boundingSphere.radius))console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}computeTangents(){let e=this.index,t=this.attributes;if(e===null||t.position===void 0||t.normal===void 0||t.uv===void 0){console.error("THREE.BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");return}let{position:n,normal:o,uv:r}=t;if(this.hasAttribute("tangent")===!1)this.setAttribute("tangent",new ol(new Float32Array(4*n.count),4));let i=this.getAttribute("tangent"),s=[],a=[];for(let I=0;I<n.count;I++)s[I]=new Dt,a[I]=new Dt;let c=new Dt,l=new Dt,h=new Dt,d=new go,u=new go,_=new go,p=new Dt,m=new Dt;function A(I,v,P){c.fromBufferAttribute(n,I),l.fromBufferAttribute(n,v),h.fromBufferAttribute(n,P),d.fromBufferAttribute(r,I),u.fromBufferAttribute(r,v),_.fromBufferAttribute(r,P),l.sub(c),h.sub(c),u.sub(d),_.sub(d);let M=1/(u.x*_.y-_.x*u.y);if(!isFinite(M))return;p.copy(l).multiplyScalar(_.y).addScaledVector(h,-u.y).multiplyScalar(M),m.copy(h).multiplyScalar(u.x).addScaledVector(l,-_.x).multiplyScalar(M),s[I].add(p),s[v].add(p),s[P].add(p),a[I].add(m),a[v].add(m),a[P].add(m)}let g=this.groups;if(g.length===0)g=[{start:0,count:e.count}];for(let I=0,v=g.length;I<v;++I){let P=g[I],{start:M,count:B}=P;for(let T=M,N=M+B;T<N;T+=3)A(e.getX(T+0),e.getX(T+1),e.getX(T+2))}let f=new Dt,y=new Dt,x=new Dt,C=new Dt;function b(I){x.fromBufferAttribute(o,I),C.copy(x);let v=s[I];f.copy(v),f.sub(x.multiplyScalar(x.dot(v))).normalize(),y.crossVectors(C,v);let M=y.dot(a[I])<0?-1:1;i.setXYZW(I,f.x,f.y,f.z,M)}for(let I=0,v=g.length;I<v;++I){let P=g[I],{start:M,count:B}=P;for(let T=M,N=M+B;T<N;T+=3)b(e.getX(T+0)),b(e.getX(T+1)),b(e.getX(T+2))}}computeVertexNormals(){let e=this.index,t=this.getAttribute("position");if(t!==void 0){let n=this.getAttribute("normal");if(n===void 0)n=new ol(new Float32Array(t.count*3),3),this.setAttribute("normal",n);else for(let d=0,u=n.count;d<u;d++)n.setXYZ(d,0,0,0);let o=new Dt,r=new Dt,i=new Dt,s=new Dt,a=new Dt,c=new Dt,l=new Dt,h=new Dt;if(e)for(let d=0,u=e.count;d<u;d+=3){let _=e.getX(d+0),p=e.getX(d+1),m=e.getX(d+2);o.fromBufferAttribute(t,_),r.fromBufferAttribute(t,p),i.fromBufferAttribute(t,m),l.subVectors(i,r),h.subVectors(o,r),l.cross(h),s.fromBufferAttribute(n,_),a.fromBufferAttribute(n,p),c.fromBufferAttribute(n,m),s.add(l),a.add(l),c.add(l),n.setXYZ(_,s.x,s.y,s.z),n.setXYZ(p,a.x,a.y,a.z),n.setXYZ(m,c.x,c.y,c.z)}else for(let d=0,u=t.count;d<u;d+=3)o.fromBufferAttribute(t,d+0),r.fromBufferAttribute(t,d+1),i.fromBufferAttribute(t,d+2),l.subVectors(i,r),h.subVectors(o,r),l.cross(h),n.setXYZ(d+0,l.x,l.y,l.z),n.setXYZ(d+1,l.x,l.y,l.z),n.setXYZ(d+2,l.x,l.y,l.z);this.normalizeNormals(),n.needsUpdate=!0}}normalizeNormals(){let e=this.attributes.normal;for(let t=0,n=e.count;t<n;t++)sA.fromBufferAttribute(e,t),sA.normalize(),e.setXYZ(t,sA.x,sA.y,sA.z)}toNonIndexed(){function e(s,a){let{array:c,itemSize:l,normalized:h}=s,d=new c.constructor(a.length*l),u=0,_=0;for(let p=0,m=a.length;p<m;p++){if(s.isInterleavedBufferAttribute)u=a[p]*s.data.stride+s.offset;else u=a[p]*l;for(let A=0;A<l;A++)d[_++]=c[u++]}return new ol(d,l,h)}if(this.index===null)return console.warn("THREE.BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;let t=new ha,n=this.index.array,o=this.attributes;for(let s in o){let a=o[s],c=e(a,n);t.setAttribute(s,c)}let r=this.morphAttributes;for(let s in r){let a=[],c=r[s];for(let l=0,h=c.length;l<h;l++){let d=c[l],u=e(d,n);a.push(u)}t.morphAttributes[s]=a}t.morphTargetsRelative=this.morphTargetsRelative;let i=this.groups;for(let s=0,a=i.length;s<a;s++){let c=i[s];t.addGroup(c.start,c.count,c.materialIndex)}return t}toJSON(){let e={metadata:{version:4.6,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(e.uuid=this.uuid,e.type=this.type,this.name!=="")e.name=this.name;if(Object.keys(this.userData).length>0)e.userData=this.userData;if(this.parameters!==void 0){let a=this.parameters;for(let c in a)if(a[c]!==void 0)e[c]=a[c];return e}e.data={attributes:{}};let t=this.index;if(t!==null)e.data.index={type:t.array.constructor.name,array:Array.prototype.slice.call(t.array)};let n=this.attributes;for(let a in n){let c=n[a];e.data.attributes[a]=c.toJSON(e.data)}let o={},r=!1;for(let a in this.morphAttributes){let c=this.morphAttributes[a],l=[];for(let h=0,d=c.length;h<d;h++){let u=c[h];l.push(u.toJSON(e.data))}if(l.length>0)o[a]=l,r=!0}if(r)e.data.morphAttributes=o,e.data.morphTargetsRelative=this.morphTargetsRelative;let i=this.groups;if(i.length>0)e.data.groups=JSON.parse(JSON.stringify(i));let s=this.boundingSphere;if(s!==null)e.data.boundingSphere={center:s.center.toArray(),radius:s.radius};return e}clone(){return new this.constructor().copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;let t={};this.name=e.name;let n=e.index;if(n!==null)this.setIndex(n.clone(t));let o=e.attributes;for(let c in o){let l=o[c];this.setAttribute(c,l.clone(t))}let r=e.morphAttributes;for(let c in r){let l=[],h=r[c];for(let d=0,u=h.length;d<u;d++)l.push(h[d].clone(t));this.morphAttributes[c]=l}this.morphTargetsRelative=e.morphTargetsRelative;let i=e.groups;for(let c=0,l=i.length;c<l;c++){let h=i[c];this.addGroup(h.start,h.count,h.materialIndex)}let s=e.boundingBox;if(s!==null)this.boundingBox=s.clone();let a=e.boundingSphere;if(a!==null)this.boundingSphere=a.clone();return this.drawRange.start=e.drawRange.start,this.drawRange.count=e.drawRange.count,this.userData=e.userData,this}dispose(){this.dispatchEvent({type:"dispose"})}}var tPt=new Fi,gz=new nR,hye=new bx,nPt=new Dt,Nj=new Dt,Rj=new Dt,Qj=new Dt,Fze=new Dt,dye=new Dt,uye=new go,pye=new go,mye=new go,oPt=new Dt,rPt=new Dt,iPt=new Dt,_ye=new Dt,gye=new Dt;class Qo extends nl{constructor(e=new ha,t=new lA){super();this.isMesh=!0,this.type="Mesh",this.geometry=e,this.material=t,this.updateMorphTargets()}copy(e,t){if(super.copy(e,t),e.morphTargetInfluences!==void 0)this.morphTargetInfluences=e.morphTargetInfluences.slice();if(e.morphTargetDictionary!==void 0)this.morphTargetDictionary=Object.assign({},e.morphTargetDictionary);return this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}updateMorphTargets(){let t=this.geometry.morphAttributes,n=Object.keys(t);if(n.length>0){let o=t[n[0]];if(o!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let r=0,i=o.length;r<i;r++){let s=o[r].name||String(r);this.morphTargetInfluences.push(0),this.morphTargetDictionary[s]=r}}}}getVertexPosition(e,t){let n=this.geometry,o=n.attributes.position,r=n.morphAttributes.position,i=n.morphTargetsRelative;t.fromBufferAttribute(o,e);let s=this.morphTargetInfluences;if(r&&s){dye.set(0,0,0);for(let a=0,c=r.length;a<c;a++){let l=s[a],h=r[a];if(l===0)continue;if(Fze.fromBufferAttribute(h,e),i)dye.addScaledVector(Fze,l);else dye.addScaledVector(Fze.sub(t),l)}t.add(dye)}return t}raycast(e,t){let n=this.geometry,o=this.material,r=this.matrixWorld;if(o===void 0)return;if(n.boundingSphere===null)n.computeBoundingSphere();if(hye.copy(n.boundingSphere),hye.applyMatrix4(r),gz.copy(e.ray).recast(e.near),hye.containsPoint(gz.origin)===!1){if(gz.intersectSphere(hye,nPt)===null)return;if(gz.origin.distanceToSquared(nPt)>(e.far-e.near)**2)return}if(tPt.copy(r).invert(),gz.copy(e.ray).applyMatrix4(tPt),n.boundingBox!==null){if(gz.intersectsBox(n.boundingBox)===!1)return}this._computeIntersections(e,t,gz)}_computeIntersections(e,t,n){let o,r=this.geometry,i=this.material,s=r.index,a=r.attributes.position,c=r.attributes.uv,l=r.attributes.uv1,h=r.attributes.normal,{groups:d,drawRange:u}=r;if(s!==null)if(Array.isArray(i))for(let _=0,p=d.length;_<p;_++){let m=d[_],A=i[m.materialIndex],g=Math.max(m.start,u.start),f=Math.min(s.count,Math.min(m.start+m.count,u.start+u.count));for(let y=g,x=f;y<x;y+=3){let C=s.getX(y),b=s.getX(y+1),I=s.getX(y+2);if(o=Aye(this,A,e,n,c,l,h,C,b,I),o)o.faceIndex=Math.floor(y/3),o.face.materialIndex=m.materialIndex,t.push(o)}}else{let _=Math.max(0,u.start),p=Math.min(s.count,u.start+u.count);for(let m=_,A=p;m<A;m+=3){let g=s.getX(m),f=s.getX(m+1),y=s.getX(m+2);if(o=Aye(this,i,e,n,c,l,h,g,f,y),o)o.faceIndex=Math.floor(m/3),t.push(o)}}else if(a!==void 0)if(Array.isArray(i))for(let _=0,p=d.length;_<p;_++){let m=d[_],A=i[m.materialIndex],g=Math.max(m.start,u.start),f=Math.min(a.count,Math.min(m.start+m.count,u.start+u.count));for(let y=g,x=f;y<x;y+=3){let C=y,b=y+1,I=y+2;if(o=Aye(this,A,e,n,c,l,h,C,b,I),o)o.faceIndex=Math.floor(y/3),o.face.materialIndex=m.materialIndex,t.push(o)}}else{let _=Math.max(0,u.start),p=Math.min(a.count,u.start+u.count);for(let m=_,A=p;m<A;m+=3){let g=m,f=m+1,y=m+2;if(o=Aye(this,i,e,n,c,l,h,g,f,y),o)o.faceIndex=Math.floor(m/3),t.push(o)}}}}function mRo(e,t,n,o,r,i,s,a){let c;if(t.side===1)c=o.intersectTriangle(s,i,r,!0,a);else c=o.intersectTriangle(r,i,s,t.side===0,a);if(c===null)return null;gye.copy(a),gye.applyMatrix4(e.matrixWorld);let l=n.ray.origin.distanceTo(gye);if(l<n.near||l>n.far)return null;return{distance:l,point:gye.clone(),object:e}}function Aye(e,t,n,o,r,i,s,a,c,l){e.getVertexPosition(a,Nj),e.getVertexPosition(c,Rj),e.getVertexPosition(l,Qj);let h=mRo(e,t,n,o,Nj,Rj,Qj,_ye);if(h){if(r)uye.fromBufferAttribute(r,a),pye.fromBufferAttribute(r,c),mye.fromBufferAttribute(r,l),h.uv=FI.getInterpolation(_ye,Nj,Rj,Qj,uye,pye,mye,new go);if(i)uye.fromBufferAttribute(i,a),pye.fromBufferAttribute(i,c),mye.fromBufferAttribute(i,l),h.uv1=FI.getInterpolation(_ye,Nj,Rj,Qj,uye,pye,mye,new go);if(s){if(oPt.fromBufferAttribute(s,a),rPt.fromBufferAttribute(s,c),iPt.fromBufferAttribute(s,l),h.normal=FI.getInterpolation(_ye,Nj,Rj,Qj,oPt,rPt,iPt,new Dt),h.normal.dot(o.direction)>0)h.normal.multiplyScalar(-1)}let d={a,b:c,c:l,normal:new Dt,materialIndex:0};FI.getNormal(Nj,Rj,Qj,d.normal),h.face=d}return h}class qm extends ha{constructor(e=1,t=1,n=1,o=1,r=1,i=1){super();this.type="BoxGeometry",this.parameters={width:e,height:t,depth:n,widthSegments:o,heightSegments:r,depthSegments:i};let s=this;o=Math.floor(o),r=Math.floor(r),i=Math.floor(i);let a=[],c=[],l=[],h=[],d=0,u=0;_("z","y","x",-1,-1,n,t,e,i,r,0),_("z","y","x",1,-1,n,t,-e,i,r,1),_("x","z","y",1,1,e,n,t,o,i,2),_("x","z","y",1,-1,e,n,-t,o,i,3),_("x","y","z",1,-1,e,t,n,o,r,4),_("x","y","z",-1,-1,e,t,-n,o,r,5),this.setIndex(a),this.setAttribute("position",new jr(c,3)),this.setAttribute("normal",new jr(l,3)),this.setAttribute("uv",new jr(h,2));function _(p,m,A,g,f,y,x,C,b,I,v){let P=y/b,M=x/I,B=y/2,T=x/2,N=C/2,D=b+1,L=I+1,H=0,V=0,O=new Dt;for(let U=0;U<L;U++){let j=U*M-T;for(let Y=0;Y<D;Y++){let X=Y*P-B;O[p]=X*g,O[m]=j*f,O[A]=N,c.push(O.x,O.y,O.z),O[p]=0,O[m]=0,O[A]=C>0?1:-1,l.push(O.x,O.y,O.z),h.push(Y/b),h.push(1-U/I),H+=1}}for(let U=0;U<I;U++)for(let j=0;j<b;j++){let Y=d+j+D*U,X=d+j+D*(U+1),K=d+(j+1)+D*(U+1),J=d+(j+1)+D*U;a.push(Y,X,J),a.push(X,K,J),V+=6}s.addGroup(u,V,v),u+=V,d+=H}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new qm(e.width,e.height,e.depth,e.widthSegments,e.heightSegments,e.depthSegments)}}function Uj(e){let t={};for(let n in e){t[n]={};for(let o in e[n]){let r=e[n][o];if(r&&(r.isColor||r.isMatrix3||r.isMatrix4||r.isVector2||r.isVector3||r.isVector4||r.isTexture||r.isQuaternion))if(r.isRenderTargetTexture)console.warn("UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms()."),t[n][o]=null;else t[n][o]=r.clone();else if(Array.isArray(r))t[n][o]=r.slice();else t[n][o]=r}}return t}function U1(e){let t={};for(let n=0;n<e.length;n++){let o=Uj(e[n]);for(let r in o)t[r]=o[r]}return t}function _Ro(e){let t=[];for(let n=0;n<e.length;n++)t.push(e[n].clone());return t}function dEt(e){let t=e.getRenderTarget();if(t===null)return e.outputColorSpace;if(t.isXRRenderTarget===!0)return t.texture.colorSpace;return Th.workingColorSpace}var mOe={clone:Uj,merge:U1},gRo=`void main() {
	gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
}`,ARo=`void main() {
	gl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );
}`;class y4 extends cA{constructor(e){super();if(this.isShaderMaterial=!0,this.type="ShaderMaterial",this.defines={},this.uniforms={},this.uniformsGroups=[],this.vertexShader=gRo,this.fragmentShader=ARo,this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!1,this.forceSinglePass=!0,this.extensions={clipCullDistance:!1,multiDraw:!1},this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv1:[0,0]},this.index0AttributeName=void 0,this.uniformsNeedUpdate=!1,this.glslVersion=null,e!==void 0)this.setValues(e)}copy(e){return super.copy(e),this.fragmentShader=e.fragmentShader,this.vertexShader=e.vertexShader,this.uniforms=Uj(e.uniforms),this.uniformsGroups=_Ro(e.uniformsGroups),this.defines=Object.assign({},e.defines),this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.fog=e.fog,this.lights=e.lights,this.clipping=e.clipping,this.extensions=Object.assign({},e.extensions),this.glslVersion=e.glslVersion,this}toJSON(e){let t=super.toJSON(e);t.glslVersion=this.glslVersion,t.uniforms={};for(let o in this.uniforms){let i=this.uniforms[o].value;if(i&&i.isTexture)t.uniforms[o]={type:"t",value:i.toJSON(e).uuid};else if(i&&i.isColor)t.uniforms[o]={type:"c",value:i.getHex()};else if(i&&i.isVector2)t.uniforms[o]={type:"v2",value:i.toArray()};else if(i&&i.isVector3)t.uniforms[o]={type:"v3",value:i.toArray()};else if(i&&i.isVector4)t.uniforms[o]={type:"v4",value:i.toArray()};else if(i&&i.isMatrix3)t.uniforms[o]={type:"m3",value:i.toArray()};else if(i&&i.isMatrix4)t.uniforms[o]={type:"m4",value:i.toArray()};else t.uniforms[o]={value:i}}if(Object.keys(this.defines).length>0)t.defines=this.defines;t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader,t.lights=this.lights,t.clipping=this.clipping;let n={};for(let o in this.extensions)if(this.extensions[o]===!0)n[o]=!0;if(Object.keys(n).length>0)t.extensions=n;return t}}class _Oe extends nl{constructor(){super();this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new Fi,this.projectionMatrix=new Fi,this.projectionMatrixInverse=new Fi,this.coordinateSystem=2000}copy(e,t){return super.copy(e,t),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this.coordinateSystem=e.coordinateSystem,this}getWorldDirection(e){return super.getWorldDirection(e).negate()}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(e,t){super.updateWorldMatrix(e,t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return new this.constructor().copy(this)}}var $N=new Dt,sPt=new go,aPt=new go;class wl extends _Oe{constructor(e=50,t=1,n=0.1,o=2000){super();this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=n,this.far=o,this.focus=10,this.aspect=t,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=e.view===null?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this}setFocalLength(e){let t=0.5*this.getFilmHeight()/e;this.fov=Gj*2*Math.atan(t),this.updateProjectionMatrix()}getFocalLength(){let e=Math.tan(Vj*0.5*this.fov);return 0.5*this.getFilmHeight()/e}getEffectiveFOV(){return Gj*2*Math.atan(Math.tan(Vj*0.5*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}getViewBounds(e,t,n){$N.set(-1,-1,0.5).applyMatrix4(this.projectionMatrixInverse),t.set($N.x,$N.y).multiplyScalar(-e/$N.z),$N.set(1,1,0.5).applyMatrix4(this.projectionMatrixInverse),n.set($N.x,$N.y).multiplyScalar(-e/$N.z)}getViewSize(e,t){return this.getViewBounds(e,sPt,aPt),t.subVectors(aPt,sPt)}setViewOffset(e,t,n,o,r,i){if(this.aspect=e/t,this.view===null)this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1};this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=n,this.view.offsetY=o,this.view.width=r,this.view.height=i,this.updateProjectionMatrix()}clearViewOffset(){if(this.view!==null)this.view.enabled=!1;this.updateProjectionMatrix()}updateProjectionMatrix(){let e=this.near,t=e*Math.tan(Vj*0.5*this.fov)/this.zoom,n=2*t,o=this.aspect*n,r=-0.5*o,i=this.view;if(this.view!==null&&this.view.enabled){let{fullWidth:a,fullHeight:c}=i;r+=i.offsetX*o/a,t-=i.offsetY*n/c,o*=i.width/a,n*=i.height/c}let s=this.filmOffset;if(s!==0)r+=e*s/this.getFilmWidth();this.projectionMatrix.makePerspective(r,r+o,t,t-n,e,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){let t=super.toJSON(e);if(t.object.fov=this.fov,t.object.zoom=this.zoom,t.object.near=this.near,t.object.far=this.far,t.object.focus=this.focus,t.object.aspect=this.aspect,this.view!==null)t.object.view=Object.assign({},this.view);return t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}}var kj=-90,Lj=1;class uEt extends nl{constructor(e,t,n){super();this.type="CubeCamera",this.renderTarget=n,this.coordinateSystem=null,this.activeMipmapLevel=0;let o=new wl(kj,Lj,e,t);o.layers=this.layers,this.add(o);let r=new wl(kj,Lj,e,t);r.layers=this.layers,this.add(r);let i=new wl(kj,Lj,e,t);i.layers=this.layers,this.add(i);let s=new wl(kj,Lj,e,t);s.layers=this.layers,this.add(s);let a=new wl(kj,Lj,e,t);a.layers=this.layers,this.add(a);let c=new wl(kj,Lj,e,t);c.layers=this.layers,this.add(c)}updateCoordinateSystem(){let e=this.coordinateSystem,t=this.children.concat(),[n,o,r,i,s,a]=t;for(let c of t)this.remove(c);if(e===2000)n.up.set(0,1,0),n.lookAt(1,0,0),o.up.set(0,1,0),o.lookAt(-1,0,0),r.up.set(0,0,-1),r.lookAt(0,1,0),i.up.set(0,0,1),i.lookAt(0,-1,0),s.up.set(0,1,0),s.lookAt(0,0,1),a.up.set(0,1,0),a.lookAt(0,0,-1);else if(e===2001)n.up.set(0,-1,0),n.lookAt(-1,0,0),o.up.set(0,-1,0),o.lookAt(1,0,0),r.up.set(0,0,1),r.lookAt(0,1,0),i.up.set(0,0,-1),i.lookAt(0,-1,0),s.up.set(0,-1,0),s.lookAt(0,0,1),a.up.set(0,-1,0),a.lookAt(0,0,-1);else throw Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: "+e);for(let c of t)this.add(c),c.updateMatrixWorld()}update(e,t){if(this.parent===null)this.updateMatrixWorld();let{renderTarget:n,activeMipmapLevel:o}=this;if(this.coordinateSystem!==e.coordinateSystem)this.coordinateSystem=e.coordinateSystem,this.updateCoordinateSystem();let[r,i,s,a,c,l]=this.children,h=e.getRenderTarget(),d=e.getActiveCubeFace(),u=e.getActiveMipmapLevel(),_=e.xr.enabled;e.xr.enabled=!1;let p=n.texture.generateMipmaps;n.texture.generateMipmaps=!1,e.setRenderTarget(n,0,o),e.render(t,r),e.setRenderTarget(n,1,o),e.render(t,i),e.setRenderTarget(n,2,o),e.render(t,s),e.setRenderTarget(n,3,o),e.render(t,a),e.setRenderTarget(n,4,o),e.render(t,c),n.texture.generateMipmaps=p,e.setRenderTarget(n,5,o),e.render(t,l),e.setRenderTarget(h,d,u),e.xr.enabled=_,n.texture.needsPMREMUpdate=!0}}class gOe extends Bl{constructor(e,t,n,o,r,i,s,a,c,l){e=e!==void 0?e:[],t=t!==void 0?t:301;super(e,t,n,o,r,i,s,a,c,l);this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}}class pEt extends JN{constructor(e=1,t={}){super(e,e,t);this.isWebGLCubeRenderTarget=!0;let n={width:e,height:e,depth:1},o=[n,n,n,n,n,n];this.texture=new gOe(o,t.mapping,t.wrapS,t.wrapT,t.magFilter,t.minFilter,t.format,t.type,t.anisotropy,t.colorSpace),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=t.generateMipmaps!==void 0?t.generateMipmaps:!1,this.texture.minFilter=t.minFilter!==void 0?t.minFilter:1006}fromEquirectangularTexture(e,t){this.texture.type=t.type,this.texture.colorSpace=t.colorSpace,this.texture.generateMipmaps=t.generateMipmaps,this.texture.minFilter=t.minFilter,this.texture.magFilter=t.magFilter;let n={uniforms:{tEquirect:{value:null}},vertexShader:`

				varying vec3 vWorldDirection;

				vec3 transformDirection( in vec3 dir, in mat4 matrix ) {

					return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );

				}

				void main() {

					vWorldDirection = transformDirection( position, modelMatrix );

					#include <begin_vertex>
					#include <project_vertex>

				}
			`,fragmentShader:`

				uniform sampler2D tEquirect;

				varying vec3 vWorldDirection;

				#include <common>

				void main() {

					vec3 direction = normalize( vWorldDirection );

					vec2 sampleUV = equirectUv( direction );

					gl_FragColor = texture2D( tEquirect, sampleUV );

				}
			`},o=new qm(5,5,5),r=new y4({name:"CubemapFromEquirect",uniforms:Uj(n.uniforms),vertexShader:n.vertexShader,fragmentShader:n.fragmentShader,side:1,blending:0});r.uniforms.tEquirect.value=t;let i=new Qo(o,r),s=t.minFilter;if(t.minFilter===1008)t.minFilter=1006;return new uEt(1,10,this).update(e,i),t.minFilter=s,i.geometry.dispose(),i.material.dispose(),this}clear(e,t,n,o){let r=e.getRenderTarget();for(let i=0;i<6;i++)e.setRenderTarget(this,i),e.clear(t,n,o);e.setRenderTarget(r)}}var zze=new Dt,fRo=new Dt,yRo=new wa;class c7{constructor(e=new Dt(1,0,0),t=0){this.isPlane=!0,this.normal=e,this.constant=t}set(e,t){return this.normal.copy(e),this.constant=t,this}setComponents(e,t,n,o){return this.normal.set(e,t,n),this.constant=o,this}setFromNormalAndCoplanarPoint(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this}setFromCoplanarPoints(e,t,n){let o=zze.subVectors(n,t).cross(fRo.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(o,e),this}copy(e){return this.normal.copy(e.normal),this.constant=e.constant,this}normalize(){let e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(e){return this.normal.dot(e)+this.constant}distanceToSphere(e){return this.distanceToPoint(e.center)-e.radius}projectPoint(e,t){return t.copy(e).addScaledVector(this.normal,-this.distanceToPoint(e))}intersectLine(e,t){let n=e.delta(zze),o=this.normal.dot(n);if(o===0){if(this.distanceToPoint(e.start)===0)return t.copy(e.start);return null}let r=-(e.start.dot(this.normal)+this.constant)/o;if(r<0||r>1)return null;return t.copy(e.start).addScaledVector(n,r)}intersectsLine(e){let t=this.distanceToPoint(e.start),n=this.distanceToPoint(e.end);return t<0&&n>0||n<0&&t>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,t){let n=t||yRo.getNormalMatrix(e),o=this.coplanarPoint(zze).applyMatrix4(e),r=this.normal.applyMatrix3(n).normalize();return this.constant=-o.dot(r),this}translate(e){return this.constant-=e.dot(this.normal),this}equals(e){return e.normal.equals(this.normal)&&e.constant===this.constant}clone(){return new this.constructor().copy(this)}}var Az=new bx,fye=new Dt;class Wye{constructor(e=new c7,t=new c7,n=new c7,o=new c7,r=new c7,i=new c7){this.planes=[e,t,n,o,r,i]}set(e,t,n,o,r,i){let s=this.planes;return s[0].copy(e),s[1].copy(t),s[2].copy(n),s[3].copy(o),s[4].copy(r),s[5].copy(i),this}copy(e){let t=this.planes;for(let n=0;n<6;n++)t[n].copy(e.planes[n]);return this}setFromProjectionMatrix(e,t=2000){let n=this.planes,o=e.elements,r=o[0],i=o[1],s=o[2],a=o[3],c=o[4],l=o[5],h=o[6],d=o[7],u=o[8],_=o[9],p=o[10],m=o[11],A=o[12],g=o[13],f=o[14],y=o[15];if(n[0].setComponents(a-r,d-c,m-u,y-A).normalize(),n[1].setComponents(a+r,d+c,m+u,y+A).normalize(),n[2].setComponents(a+i,d+l,m+_,y+g).normalize(),n[3].setComponents(a-i,d-l,m-_,y-g).normalize(),n[4].setComponents(a-s,d-h,m-p,y-f).normalize(),t===2000)n[5].setComponents(a+s,d+h,m+p,y+f).normalize();else if(t===2001)n[5].setComponents(s,h,p,f).normalize();else throw Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+t);return this}intersectsObject(e){if(e.boundingSphere!==void 0){if(e.boundingSphere===null)e.computeBoundingSphere();Az.copy(e.boundingSphere).applyMatrix4(e.matrixWorld)}else{let t=e.geometry;if(t.boundingSphere===null)t.computeBoundingSphere();Az.copy(t.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(Az)}intersectsSprite(e){return Az.center.set(0,0,0),Az.radius=0.7071067811865476,Az.applyMatrix4(e.matrixWorld),this.intersectsSphere(Az)}intersectsSphere(e){let t=this.planes,n=e.center,o=-e.radius;for(let r=0;r<6;r++)if(t[r].distanceToPoint(n)<o)return!1;return!0}intersectsBox(e){let t=this.planes;for(let n=0;n<6;n++){let o=t[n];if(fye.x=o.normal.x>0?e.max.x:e.min.x,fye.y=o.normal.y>0?e.max.y:e.min.y,fye.z=o.normal.z>0?e.max.z:e.min.z,o.distanceToPoint(fye)<0)return!1}return!0}containsPoint(e){let t=this.planes;for(let n=0;n<6;n++)if(t[n].distanceToPoint(e)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}}function mEt(){let e=null,t=!1,n=null,o=null;function r(i,s){n(i,s),o=e.requestAnimationFrame(r)}return{start:function(){if(t===!0)return;if(n===null)return;o=e.requestAnimationFrame(r),t=!0},stop:function(){e.cancelAnimationFrame(o),t=!1},setAnimationLoop:function(i){n=i},setContext:function(i){e=i}}}function xRo(e){let t=new WeakMap;function n(a,c){let{array:l,usage:h}=a,d=l.byteLength,u=e.createBuffer();e.bindBuffer(c,u),e.bufferData(c,l,h),a.onUploadCallback();let _;if(l instanceof Float32Array)_=e.FLOAT;else if(l instanceof Uint16Array)if(a.isFloat16BufferAttribute)_=e.HALF_FLOAT;else _=e.UNSIGNED_SHORT;else if(l instanceof Int16Array)_=e.SHORT;else if(l instanceof Uint32Array)_=e.UNSIGNED_INT;else if(l instanceof Int32Array)_=e.INT;else if(l instanceof Int8Array)_=e.BYTE;else if(l instanceof Uint8Array)_=e.UNSIGNED_BYTE;else if(l instanceof Uint8ClampedArray)_=e.UNSIGNED_BYTE;else throw Error("THREE.WebGLAttributes: Unsupported buffer data format: "+l);return{buffer:u,type:_,bytesPerElement:l.BYTES_PER_ELEMENT,version:a.version,size:d}}function o(a,c,l){let{array:h,_updateRange:d,updateRanges:u}=c;if(e.bindBuffer(l,a),d.count===-1&&u.length===0)e.bufferSubData(l,0,h);if(u.length!==0){for(let _=0,p=u.length;_<p;_++){let m=u[_];e.bufferSubData(l,m.start*h.BYTES_PER_ELEMENT,h,m.start,m.count)}c.clearUpdateRanges()}if(d.count!==-1)e.bufferSubData(l,d.offset*h.BYTES_PER_ELEMENT,h,d.offset,d.count),d.count=-1;c.onUploadCallback()}function r(a){if(a.isInterleavedBufferAttribute)a=a.data;return t.get(a)}function i(a){if(a.isInterleavedBufferAttribute)a=a.data;let c=t.get(a);if(c)e.deleteBuffer(c.buffer),t.delete(a)}function s(a,c){if(a.isGLBufferAttribute){let h=t.get(a);if(!h||h.version<a.version)t.set(a,{buffer:a.buffer,type:a.type,bytesPerElement:a.elementSize,version:a.version});return}if(a.isInterleavedBufferAttribute)a=a.data;let l=t.get(a);if(l===void 0)t.set(a,n(a,c));else if(l.version<a.version){if(l.size!==a.array.byteLength)throw Error("THREE.WebGLAttributes: The size of the buffer attribute's array buffer does not match the original size. Resizing buffer attributes is not supported.");o(l.buffer,a,c),l.version=a.version}}return{get:r,remove:i,update:s}}class v2 extends ha{constructor(e=1,t=1,n=1,o=1){super();this.type="PlaneGeometry",this.parameters={width:e,height:t,widthSegments:n,heightSegments:o};let r=e/2,i=t/2,s=Math.floor(n),a=Math.floor(o),c=s+1,l=a+1,h=e/s,d=t/a,u=[],_=[],p=[],m=[];for(let A=0;A<l;A++){let g=A*d-i;for(let f=0;f<c;f++){let y=f*h-r;_.push(y,-g,0),p.push(0,0,1),m.push(f/s),m.push(1-A/a)}}for(let A=0;A<a;A++)for(let g=0;g<s;g++){let f=g+c*A,y=g+c*(A+1),x=g+1+c*(A+1),C=g+1+c*A;u.push(f,y,C),u.push(y,x,C)}this.setIndex(u),this.setAttribute("position",new jr(_,3)),this.setAttribute("normal",new jr(p,3)),this.setAttribute("uv",new jr(m,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new v2(e.width,e.height,e.widthSegments,e.heightSegments)}}var CRo=`#ifdef USE_ALPHAHASH
	if ( diffuseColor.a < getAlphaHashThreshold( vPosition ) ) discard;
#endif`,bRo=`#ifdef USE_ALPHAHASH
	const float ALPHA_HASH_SCALE = 0.05;
	float hash2D( vec2 value ) {
		return fract( 1.0e4 * sin( 17.0 * value.x + 0.1 * value.y ) * ( 0.1 + abs( sin( 13.0 * value.y + value.x ) ) ) );
	}
	float hash3D( vec3 value ) {
		return hash2D( vec2( hash2D( value.xy ), value.z ) );
	}
	float getAlphaHashThreshold( vec3 position ) {
		float maxDeriv = max(
			length( dFdx( position.xyz ) ),
			length( dFdy( position.xyz ) )
		);
		float pixScale = 1.0 / ( ALPHA_HASH_SCALE * maxDeriv );
		vec2 pixScales = vec2(
			exp2( floor( log2( pixScale ) ) ),
			exp2( ceil( log2( pixScale ) ) )
		);
		vec2 alpha = vec2(
			hash3D( floor( pixScales.x * position.xyz ) ),
			hash3D( floor( pixScales.y * position.xyz ) )
		);
		float lerpFactor = fract( log2( pixScale ) );
		float x = ( 1.0 - lerpFactor ) * alpha.x + lerpFactor * alpha.y;
		float a = min( lerpFactor, 1.0 - lerpFactor );
		vec3 cases = vec3(
			x * x / ( 2.0 * a * ( 1.0 - a ) ),
			( x - 0.5 * a ) / ( 1.0 - a ),
			1.0 - ( ( 1.0 - x ) * ( 1.0 - x ) / ( 2.0 * a * ( 1.0 - a ) ) )
		);
		float threshold = ( x < ( 1.0 - a ) )
			? ( ( x < a ) ? cases.x : cases.y )
			: cases.z;
		return clamp( threshold , 1.0e-6, 1.0 );
	}
#endif`,IRo=`#ifdef USE_ALPHAMAP
	diffuseColor.a *= texture2D( alphaMap, vAlphaMapUv ).g;
#endif`,vRo=`#ifdef USE_ALPHAMAP
	uniform sampler2D alphaMap;
#endif`,SRo=`#ifdef USE_ALPHATEST
	#ifdef ALPHA_TO_COVERAGE
	diffuseColor.a = smoothstep( alphaTest, alphaTest + fwidth( diffuseColor.a ), diffuseColor.a );
	if ( diffuseColor.a == 0.0 ) discard;
	#else
	if ( diffuseColor.a < alphaTest ) discard;
	#endif
#endif`,PRo=`#ifdef USE_ALPHATEST
	uniform float alphaTest;
#endif`,ERo=`#ifdef USE_AOMAP
	float ambientOcclusion = ( texture2D( aoMap, vAoMapUv ).r - 1.0 ) * aoMapIntensity + 1.0;
	reflectedLight.indirectDiffuse *= ambientOcclusion;
	#if defined( USE_CLEARCOAT ) 
		clearcoatSpecularIndirect *= ambientOcclusion;
	#endif
	#if defined( USE_SHEEN ) 
		sheenSpecularIndirect *= ambientOcclusion;
	#endif
	#if defined( USE_ENVMAP ) && defined( STANDARD )
		float dotNV = saturate( dot( geometryNormal, geometryViewDir ) );
		reflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.roughness );
	#endif
#endif`,MRo=`#ifdef USE_AOMAP
	uniform sampler2D aoMap;
	uniform float aoMapIntensity;
#endif`,wRo=`#ifdef USE_BATCHING
	attribute float batchId;
	uniform highp sampler2D batchingTexture;
	mat4 getBatchingMatrix( const in float i ) {
		int size = textureSize( batchingTexture, 0 ).x;
		int j = int( i ) * 4;
		int x = j % size;
		int y = j / size;
		vec4 v1 = texelFetch( batchingTexture, ivec2( x, y ), 0 );
		vec4 v2 = texelFetch( batchingTexture, ivec2( x + 1, y ), 0 );
		vec4 v3 = texelFetch( batchingTexture, ivec2( x + 2, y ), 0 );
		vec4 v4 = texelFetch( batchingTexture, ivec2( x + 3, y ), 0 );
		return mat4( v1, v2, v3, v4 );
	}
#endif
#ifdef USE_BATCHING_COLOR
	uniform sampler2D batchingColorTexture;
	vec3 getBatchingColor( const in float i ) {
		int size = textureSize( batchingColorTexture, 0 ).x;
		int j = int( i );
		int x = j % size;
		int y = j / size;
		return texelFetch( batchingColorTexture, ivec2( x, y ), 0 ).rgb;
	}
#endif`,BRo=`#ifdef USE_BATCHING
	mat4 batchingMatrix = getBatchingMatrix( batchId );
#endif`,TRo=`vec3 transformed = vec3( position );
#ifdef USE_ALPHAHASH
	vPosition = vec3( position );
#endif`,DRo=`vec3 objectNormal = vec3( normal );
#ifdef USE_TANGENT
	vec3 objectTangent = vec3( tangent.xyz );
#endif`,NRo=`float G_BlinnPhong_Implicit( ) {
	return 0.25;
}
float D_BlinnPhong( const in float shininess, const in float dotNH ) {
	return RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );
}
vec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float shininess ) {
	vec3 halfDir = normalize( lightDir + viewDir );
	float dotNH = saturate( dot( normal, halfDir ) );
	float dotVH = saturate( dot( viewDir, halfDir ) );
	vec3 F = F_Schlick( specularColor, 1.0, dotVH );
	float G = G_BlinnPhong_Implicit( );
	float D = D_BlinnPhong( shininess, dotNH );
	return F * ( G * D );
} // validated`,RRo=`#ifdef USE_IRIDESCENCE
	const mat3 XYZ_TO_REC709 = mat3(
		 3.2404542, -0.9692660,  0.0556434,
		-1.5371385,  1.8760108, -0.2040259,
		-0.4985314,  0.0415560,  1.0572252
	);
	vec3 Fresnel0ToIor( vec3 fresnel0 ) {
		vec3 sqrtF0 = sqrt( fresnel0 );
		return ( vec3( 1.0 ) + sqrtF0 ) / ( vec3( 1.0 ) - sqrtF0 );
	}
	vec3 IorToFresnel0( vec3 transmittedIor, float incidentIor ) {
		return pow2( ( transmittedIor - vec3( incidentIor ) ) / ( transmittedIor + vec3( incidentIor ) ) );
	}
	float IorToFresnel0( float transmittedIor, float incidentIor ) {
		return pow2( ( transmittedIor - incidentIor ) / ( transmittedIor + incidentIor ));
	}
	vec3 evalSensitivity( float OPD, vec3 shift ) {
		float phase = 2.0 * PI * OPD * 1.0e-9;
		vec3 val = vec3( 5.4856e-13, 4.4201e-13, 5.2481e-13 );
		vec3 pos = vec3( 1.6810e+06, 1.7953e+06, 2.2084e+06 );
		vec3 var = vec3( 4.3278e+09, 9.3046e+09, 6.6121e+09 );
		vec3 xyz = val * sqrt( 2.0 * PI * var ) * cos( pos * phase + shift ) * exp( - pow2( phase ) * var );
		xyz.x += 9.7470e-14 * sqrt( 2.0 * PI * 4.5282e+09 ) * cos( 2.2399e+06 * phase + shift[ 0 ] ) * exp( - 4.5282e+09 * pow2( phase ) );
		xyz /= 1.0685e-7;
		vec3 rgb = XYZ_TO_REC709 * xyz;
		return rgb;
	}
	vec3 evalIridescence( float outsideIOR, float eta2, float cosTheta1, float thinFilmThickness, vec3 baseF0 ) {
		vec3 I;
		float iridescenceIOR = mix( outsideIOR, eta2, smoothstep( 0.0, 0.03, thinFilmThickness ) );
		float sinTheta2Sq = pow2( outsideIOR / iridescenceIOR ) * ( 1.0 - pow2( cosTheta1 ) );
		float cosTheta2Sq = 1.0 - sinTheta2Sq;
		if ( cosTheta2Sq < 0.0 ) {
			return vec3( 1.0 );
		}
		float cosTheta2 = sqrt( cosTheta2Sq );
		float R0 = IorToFresnel0( iridescenceIOR, outsideIOR );
		float R12 = F_Schlick( R0, 1.0, cosTheta1 );
		float T121 = 1.0 - R12;
		float phi12 = 0.0;
		if ( iridescenceIOR < outsideIOR ) phi12 = PI;
		float phi21 = PI - phi12;
		vec3 baseIOR = Fresnel0ToIor( clamp( baseF0, 0.0, 0.9999 ) );		vec3 R1 = IorToFresnel0( baseIOR, iridescenceIOR );
		vec3 R23 = F_Schlick( R1, 1.0, cosTheta2 );
		vec3 phi23 = vec3( 0.0 );
		if ( baseIOR[ 0 ] < iridescenceIOR ) phi23[ 0 ] = PI;
		if ( baseIOR[ 1 ] < iridescenceIOR ) phi23[ 1 ] = PI;
		if ( baseIOR[ 2 ] < iridescenceIOR ) phi23[ 2 ] = PI;
		float OPD = 2.0 * iridescenceIOR * thinFilmThickness * cosTheta2;
		vec3 phi = vec3( phi21 ) + phi23;
		vec3 R123 = clamp( R12 * R23, 1e-5, 0.9999 );
		vec3 r123 = sqrt( R123 );
		vec3 Rs = pow2( T121 ) * R23 / ( vec3( 1.0 ) - R123 );
		vec3 C0 = R12 + Rs;
		I = C0;
		vec3 Cm = Rs - T121;
		for ( int m = 1; m <= 2; ++ m ) {
			Cm *= r123;
			vec3 Sm = 2.0 * evalSensitivity( float( m ) * OPD, float( m ) * phi );
			I += Cm * Sm;
		}
		return max( I, vec3( 0.0 ) );
	}
#endif`,QRo=`#ifdef USE_BUMPMAP
	uniform sampler2D bumpMap;
	uniform float bumpScale;
	vec2 dHdxy_fwd() {
		vec2 dSTdx = dFdx( vBumpMapUv );
		vec2 dSTdy = dFdy( vBumpMapUv );
		float Hll = bumpScale * texture2D( bumpMap, vBumpMapUv ).x;
		float dBx = bumpScale * texture2D( bumpMap, vBumpMapUv + dSTdx ).x - Hll;
		float dBy = bumpScale * texture2D( bumpMap, vBumpMapUv + dSTdy ).x - Hll;
		return vec2( dBx, dBy );
	}
	vec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy, float faceDirection ) {
		vec3 vSigmaX = normalize( dFdx( surf_pos.xyz ) );
		vec3 vSigmaY = normalize( dFdy( surf_pos.xyz ) );
		vec3 vN = surf_norm;
		vec3 R1 = cross( vSigmaY, vN );
		vec3 R2 = cross( vN, vSigmaX );
		float fDet = dot( vSigmaX, R1 ) * faceDirection;
		vec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );
		return normalize( abs( fDet ) * surf_norm - vGrad );
	}
#endif`,kRo=`#if NUM_CLIPPING_PLANES > 0
	vec4 plane;
	#ifdef ALPHA_TO_COVERAGE
		float distanceToPlane, distanceGradient;
		float clipOpacity = 1.0;
		#pragma unroll_loop_start
		for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {
			plane = clippingPlanes[ i ];
			distanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w;
			distanceGradient = fwidth( distanceToPlane ) / 2.0;
			clipOpacity *= smoothstep( - distanceGradient, distanceGradient, distanceToPlane );
			if ( clipOpacity == 0.0 ) discard;
		}
		#pragma unroll_loop_end
		#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES
			float unionClipOpacity = 1.0;
			#pragma unroll_loop_start
			for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {
				plane = clippingPlanes[ i ];
				distanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w;
				distanceGradient = fwidth( distanceToPlane ) / 2.0;
				unionClipOpacity *= 1.0 - smoothstep( - distanceGradient, distanceGradient, distanceToPlane );
			}
			#pragma unroll_loop_end
			clipOpacity *= 1.0 - unionClipOpacity;
		#endif
		diffuseColor.a *= clipOpacity;
		if ( diffuseColor.a == 0.0 ) discard;
	#else
		#pragma unroll_loop_start
		for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {
			plane = clippingPlanes[ i ];
			if ( dot( vClipPosition, plane.xyz ) > plane.w ) discard;
		}
		#pragma unroll_loop_end
		#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES
			bool clipped = true;
			#pragma unroll_loop_start
			for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {
				plane = clippingPlanes[ i ];
				clipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped;
			}
			#pragma unroll_loop_end
			if ( clipped ) discard;
		#endif
	#endif
#endif`,LRo=`#if NUM_CLIPPING_PLANES > 0
	varying vec3 vClipPosition;
	uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];
#endif`,HRo=`#if NUM_CLIPPING_PLANES > 0
	varying vec3 vClipPosition;
#endif`,FRo=`#if NUM_CLIPPING_PLANES > 0
	vClipPosition = - mvPosition.xyz;
#endif`,zRo=`#if defined( USE_COLOR_ALPHA )
	diffuseColor *= vColor;
#elif defined( USE_COLOR )
	diffuseColor.rgb *= vColor;
#endif`,ORo=`#if defined( USE_COLOR_ALPHA )
	varying vec4 vColor;
#elif defined( USE_COLOR )
	varying vec3 vColor;
#endif`,VRo=`#if defined( USE_COLOR_ALPHA )
	varying vec4 vColor;
#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR )
	varying vec3 vColor;
#endif`,YRo=`#if defined( USE_COLOR_ALPHA )
	vColor = vec4( 1.0 );
#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR )
	vColor = vec3( 1.0 );
#endif
#ifdef USE_COLOR
	vColor *= color;
#endif
#ifdef USE_INSTANCING_COLOR
	vColor.xyz *= instanceColor.xyz;
#endif
#ifdef USE_BATCHING_COLOR
	vec3 batchingColor = getBatchingColor( batchId );
	vColor.xyz *= batchingColor.xyz;
#endif`,GRo=`#define PI 3.141592653589793
#define PI2 6.283185307179586
#define PI_HALF 1.5707963267948966
#define RECIPROCAL_PI 0.3183098861837907
#define RECIPROCAL_PI2 0.15915494309189535
#define EPSILON 1e-6
#ifndef saturate
#define saturate( a ) clamp( a, 0.0, 1.0 )
#endif
#define whiteComplement( a ) ( 1.0 - saturate( a ) )
float pow2( const in float x ) { return x*x; }
vec3 pow2( const in vec3 x ) { return x*x; }
float pow3( const in float x ) { return x*x*x; }
float pow4( const in float x ) { float x2 = x*x; return x2*x2; }
float max3( const in vec3 v ) { return max( max( v.x, v.y ), v.z ); }
float average( const in vec3 v ) { return dot( v, vec3( 0.3333333 ) ); }
highp float rand( const in vec2 uv ) {
	const highp float a = 12.9898, b = 78.233, c = 43758.5453;
	highp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );
	return fract( sin( sn ) * c );
}
#ifdef HIGH_PRECISION
	float precisionSafeLength( vec3 v ) { return length( v ); }
#else
	float precisionSafeLength( vec3 v ) {
		float maxComponent = max3( abs( v ) );
		return length( v / maxComponent ) * maxComponent;
	}
#endif
struct IncidentLight {
	vec3 color;
	vec3 direction;
	bool visible;
};
struct ReflectedLight {
	vec3 directDiffuse;
	vec3 directSpecular;
	vec3 indirectDiffuse;
	vec3 indirectSpecular;
};
#ifdef USE_ALPHAHASH
	varying vec3 vPosition;
#endif
vec3 transformDirection( in vec3 dir, in mat4 matrix ) {
	return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );
}
vec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {
	return normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );
}
mat3 transposeMat3( const in mat3 m ) {
	mat3 tmp;
	tmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x );
	tmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y );
	tmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z );
	return tmp;
}
float luminance( const in vec3 rgb ) {
	const vec3 weights = vec3( 0.2126729, 0.7151522, 0.0721750 );
	return dot( weights, rgb );
}
bool isPerspectiveMatrix( mat4 m ) {
	return m[ 2 ][ 3 ] == - 1.0;
}
vec2 equirectUv( in vec3 dir ) {
	float u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5;
	float v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;
	return vec2( u, v );
}
vec3 BRDF_Lambert( const in vec3 diffuseColor ) {
	return RECIPROCAL_PI * diffuseColor;
}
vec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) {
	float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );
	return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );
}
float F_Schlick( const in float f0, const in float f90, const in float dotVH ) {
	float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );
	return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );
} // validated`,URo=`#ifdef ENVMAP_TYPE_CUBE_UV
	#define cubeUV_minMipLevel 4.0
	#define cubeUV_minTileSize 16.0
	float getFace( vec3 direction ) {
		vec3 absDirection = abs( direction );
		float face = - 1.0;
		if ( absDirection.x > absDirection.z ) {
			if ( absDirection.x > absDirection.y )
				face = direction.x > 0.0 ? 0.0 : 3.0;
			else
				face = direction.y > 0.0 ? 1.0 : 4.0;
		} else {
			if ( absDirection.z > absDirection.y )
				face = direction.z > 0.0 ? 2.0 : 5.0;
			else
				face = direction.y > 0.0 ? 1.0 : 4.0;
		}
		return face;
	}
	vec2 getUV( vec3 direction, float face ) {
		vec2 uv;
		if ( face == 0.0 ) {
			uv = vec2( direction.z, direction.y ) / abs( direction.x );
		} else if ( face == 1.0 ) {
			uv = vec2( - direction.x, - direction.z ) / abs( direction.y );
		} else if ( face == 2.0 ) {
			uv = vec2( - direction.x, direction.y ) / abs( direction.z );
		} else if ( face == 3.0 ) {
			uv = vec2( - direction.z, direction.y ) / abs( direction.x );
		} else if ( face == 4.0 ) {
			uv = vec2( - direction.x, direction.z ) / abs( direction.y );
		} else {
			uv = vec2( direction.x, direction.y ) / abs( direction.z );
		}
		return 0.5 * ( uv + 1.0 );
	}
	vec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) {
		float face = getFace( direction );
		float filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 );
		mipInt = max( mipInt, cubeUV_minMipLevel );
		float faceSize = exp2( mipInt );
		highp vec2 uv = getUV( direction, face ) * ( faceSize - 2.0 ) + 1.0;
		if ( face > 2.0 ) {
			uv.y += faceSize;
			face -= 3.0;
		}
		uv.x += face * faceSize;
		uv.x += filterInt * 3.0 * cubeUV_minTileSize;
		uv.y += 4.0 * ( exp2( CUBEUV_MAX_MIP ) - faceSize );
		uv.x *= CUBEUV_TEXEL_WIDTH;
		uv.y *= CUBEUV_TEXEL_HEIGHT;
		#ifdef texture2DGradEXT
			return texture2DGradEXT( envMap, uv, vec2( 0.0 ), vec2( 0.0 ) ).rgb;
		#else
			return texture2D( envMap, uv ).rgb;
		#endif
	}
	#define cubeUV_r0 1.0
	#define cubeUV_m0 - 2.0
	#define cubeUV_r1 0.8
	#define cubeUV_m1 - 1.0
	#define cubeUV_r4 0.4
	#define cubeUV_m4 2.0
	#define cubeUV_r5 0.305
	#define cubeUV_m5 3.0
	#define cubeUV_r6 0.21
	#define cubeUV_m6 4.0
	float roughnessToMip( float roughness ) {
		float mip = 0.0;
		if ( roughness >= cubeUV_r1 ) {
			mip = ( cubeUV_r0 - roughness ) * ( cubeUV_m1 - cubeUV_m0 ) / ( cubeUV_r0 - cubeUV_r1 ) + cubeUV_m0;
		} else if ( roughness >= cubeUV_r4 ) {
			mip = ( cubeUV_r1 - roughness ) * ( cubeUV_m4 - cubeUV_m1 ) / ( cubeUV_r1 - cubeUV_r4 ) + cubeUV_m1;
		} else if ( roughness >= cubeUV_r5 ) {
			mip = ( cubeUV_r4 - roughness ) * ( cubeUV_m5 - cubeUV_m4 ) / ( cubeUV_r4 - cubeUV_r5 ) + cubeUV_m4;
		} else if ( roughness >= cubeUV_r6 ) {
			mip = ( cubeUV_r5 - roughness ) * ( cubeUV_m6 - cubeUV_m5 ) / ( cubeUV_r5 - cubeUV_r6 ) + cubeUV_m5;
		} else {
			mip = - 2.0 * log2( 1.16 * roughness );		}
		return mip;
	}
	vec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) {
		float mip = clamp( roughnessToMip( roughness ), cubeUV_m0, CUBEUV_MAX_MIP );
		float mipF = fract( mip );
		float mipInt = floor( mip );
		vec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt );
		if ( mipF == 0.0 ) {
			return vec4( color0, 1.0 );
		} else {
			vec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 );
			return vec4( mix( color0, color1, mipF ), 1.0 );
		}
	}
#endif`,WRo=`vec3 transformedNormal = objectNormal;
#ifdef USE_TANGENT
	vec3 transformedTangent = objectTangent;
#endif
#ifdef USE_BATCHING
	mat3 bm = mat3( batchingMatrix );
	transformedNormal /= vec3( dot( bm[ 0 ], bm[ 0 ] ), dot( bm[ 1 ], bm[ 1 ] ), dot( bm[ 2 ], bm[ 2 ] ) );
	transformedNormal = bm * transformedNormal;
	#ifdef USE_TANGENT
		transformedTangent = bm * transformedTangent;
	#endif
#endif
#ifdef USE_INSTANCING
	mat3 im = mat3( instanceMatrix );
	transformedNormal /= vec3( dot( im[ 0 ], im[ 0 ] ), dot( im[ 1 ], im[ 1 ] ), dot( im[ 2 ], im[ 2 ] ) );
	transformedNormal = im * transformedNormal;
	#ifdef USE_TANGENT
		transformedTangent = im * transformedTangent;
	#endif
#endif
transformedNormal = normalMatrix * transformedNormal;
#ifdef FLIP_SIDED
	transformedNormal = - transformedNormal;
#endif
#ifdef USE_TANGENT
	transformedTangent = ( modelViewMatrix * vec4( transformedTangent, 0.0 ) ).xyz;
	#ifdef FLIP_SIDED
		transformedTangent = - transformedTangent;
	#endif
#endif`,XRo=`#ifdef USE_DISPLACEMENTMAP
	uniform sampler2D displacementMap;
	uniform float displacementScale;
	uniform float displacementBias;
#endif`,jRo=`#ifdef USE_DISPLACEMENTMAP
	transformed += normalize( objectNormal ) * ( texture2D( displacementMap, vDisplacementMapUv ).x * displacementScale + displacementBias );
#endif`,KRo=`#ifdef USE_EMISSIVEMAP
	vec4 emissiveColor = texture2D( emissiveMap, vEmissiveMapUv );
	totalEmissiveRadiance *= emissiveColor.rgb;
#endif`,$Ro=`#ifdef USE_EMISSIVEMAP
	uniform sampler2D emissiveMap;
#endif`,qRo="gl_FragColor = linearToOutputTexel( gl_FragColor );",JRo=`
const mat3 LINEAR_SRGB_TO_LINEAR_DISPLAY_P3 = mat3(
	vec3( 0.8224621, 0.177538, 0.0 ),
	vec3( 0.0331941, 0.9668058, 0.0 ),
	vec3( 0.0170827, 0.0723974, 0.9105199 )
);
const mat3 LINEAR_DISPLAY_P3_TO_LINEAR_SRGB = mat3(
	vec3( 1.2249401, - 0.2249404, 0.0 ),
	vec3( - 0.0420569, 1.0420571, 0.0 ),
	vec3( - 0.0196376, - 0.0786361, 1.0982735 )
);
vec4 LinearSRGBToLinearDisplayP3( in vec4 value ) {
	return vec4( value.rgb * LINEAR_SRGB_TO_LINEAR_DISPLAY_P3, value.a );
}
vec4 LinearDisplayP3ToLinearSRGB( in vec4 value ) {
	return vec4( value.rgb * LINEAR_DISPLAY_P3_TO_LINEAR_SRGB, value.a );
}
vec4 LinearTransferOETF( in vec4 value ) {
	return value;
}
vec4 sRGBTransferOETF( in vec4 value ) {
	return vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a );
}
vec4 LinearToLinear( in vec4 value ) {
	return value;
}
vec4 LinearTosRGB( in vec4 value ) {
	return sRGBTransferOETF( value );
}`,ZRo=`#ifdef USE_ENVMAP
	#ifdef ENV_WORLDPOS
		vec3 cameraToFrag;
		if ( isOrthographic ) {
			cameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );
		} else {
			cameraToFrag = normalize( vWorldPosition - cameraPosition );
		}
		vec3 worldNormal = inverseTransformDirection( normal, viewMatrix );
		#ifdef ENVMAP_MODE_REFLECTION
			vec3 reflectVec = reflect( cameraToFrag, worldNormal );
		#else
			vec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio );
		#endif
	#else
		vec3 reflectVec = vReflect;
	#endif
	#ifdef ENVMAP_TYPE_CUBE
		vec4 envColor = textureCube( envMap, envMapRotation * vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );
	#else
		vec4 envColor = vec4( 0.0 );
	#endif
	#ifdef ENVMAP_BLENDING_MULTIPLY
		outgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );
	#elif defined( ENVMAP_BLENDING_MIX )
		outgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );
	#elif defined( ENVMAP_BLENDING_ADD )
		outgoingLight += envColor.xyz * specularStrength * reflectivity;
	#endif
#endif`,eQo=`#ifdef USE_ENVMAP
	uniform float envMapIntensity;
	uniform float flipEnvMap;
	uniform mat3 envMapRotation;
	#ifdef ENVMAP_TYPE_CUBE
		uniform samplerCube envMap;
	#else
		uniform sampler2D envMap;
	#endif
	
#endif`,tQo=`#ifdef USE_ENVMAP
	uniform float reflectivity;
	#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )
		#define ENV_WORLDPOS
	#endif
	#ifdef ENV_WORLDPOS
		varying vec3 vWorldPosition;
		uniform float refractionRatio;
	#else
		varying vec3 vReflect;
	#endif
#endif`,nQo=`#ifdef USE_ENVMAP
	#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )
		#define ENV_WORLDPOS
	#endif
	#ifdef ENV_WORLDPOS
		
		varying vec3 vWorldPosition;
	#else
		varying vec3 vReflect;
		uniform float refractionRatio;
	#endif
#endif`,oQo=`#ifdef USE_ENVMAP
	#ifdef ENV_WORLDPOS
		vWorldPosition = worldPosition.xyz;
	#else
		vec3 cameraToVertex;
		if ( isOrthographic ) {
			cameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );
		} else {
			cameraToVertex = normalize( worldPosition.xyz - cameraPosition );
		}
		vec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );
		#ifdef ENVMAP_MODE_REFLECTION
			vReflect = reflect( cameraToVertex, worldNormal );
		#else
			vReflect = refract( cameraToVertex, worldNormal, refractionRatio );
		#endif
	#endif
#endif`,rQo=`#ifdef USE_FOG
	vFogDepth = - mvPosition.z;
#endif`,iQo=`#ifdef USE_FOG
	varying float vFogDepth;
#endif`,sQo=`#ifdef USE_FOG
	#ifdef FOG_EXP2
		float fogFactor = 1.0 - exp( - fogDensity * fogDensity * vFogDepth * vFogDepth );
	#else
		float fogFactor = smoothstep( fogNear, fogFar, vFogDepth );
	#endif
	gl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );
#endif`,aQo=`#ifdef USE_FOG
	uniform vec3 fogColor;
	varying float vFogDepth;
	#ifdef FOG_EXP2
		uniform float fogDensity;
	#else
		uniform float fogNear;
		uniform float fogFar;
	#endif
#endif`,cQo=`#ifdef USE_GRADIENTMAP
	uniform sampler2D gradientMap;
#endif
vec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {
	float dotNL = dot( normal, lightDirection );
	vec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );
	#ifdef USE_GRADIENTMAP
		return vec3( texture2D( gradientMap, coord ).r );
	#else
		vec2 fw = fwidth( coord ) * 0.5;
		return mix( vec3( 0.7 ), vec3( 1.0 ), smoothstep( 0.7 - fw.x, 0.7 + fw.x, coord.x ) );
	#endif
}`,lQo=`#ifdef USE_LIGHTMAP
	uniform sampler2D lightMap;
	uniform float lightMapIntensity;
#endif`,hQo=`LambertMaterial material;
material.diffuseColor = diffuseColor.rgb;
material.specularStrength = specularStrength;`,dQo=`varying vec3 vViewPosition;
struct LambertMaterial {
	vec3 diffuseColor;
	float specularStrength;
};
void RE_Direct_Lambert( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) {
	float dotNL = saturate( dot( geometryNormal, directLight.direction ) );
	vec3 irradiance = dotNL * directLight.color;
	reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
}
void RE_IndirectDiffuse_Lambert( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) {
	reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
}
#define RE_Direct				RE_Direct_Lambert
#define RE_IndirectDiffuse		RE_IndirectDiffuse_Lambert`,uQo=`uniform bool receiveShadow;
uniform vec3 ambientLightColor;
#if defined( USE_LIGHT_PROBES )
	uniform vec3 lightProbe[ 9 ];
#endif
vec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {
	float x = normal.x, y = normal.y, z = normal.z;
	vec3 result = shCoefficients[ 0 ] * 0.886227;
	result += shCoefficients[ 1 ] * 2.0 * 0.511664 * y;
	result += shCoefficients[ 2 ] * 2.0 * 0.511664 * z;
	result += shCoefficients[ 3 ] * 2.0 * 0.511664 * x;
	result += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y;
	result += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z;
	result += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 );
	result += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z;
	result += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y );
	return result;
}
vec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in vec3 normal ) {
	vec3 worldNormal = inverseTransformDirection( normal, viewMatrix );
	vec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe );
	return irradiance;
}
vec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {
	vec3 irradiance = ambientLightColor;
	return irradiance;
}
float getDistanceAttenuation( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {
	float distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );
	if ( cutoffDistance > 0.0 ) {
		distanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );
	}
	return distanceFalloff;
}
float getSpotAttenuation( const in float coneCosine, const in float penumbraCosine, const in float angleCosine ) {
	return smoothstep( coneCosine, penumbraCosine, angleCosine );
}
#if NUM_DIR_LIGHTS > 0
	struct DirectionalLight {
		vec3 direction;
		vec3 color;
	};
	uniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];
	void getDirectionalLightInfo( const in DirectionalLight directionalLight, out IncidentLight light ) {
		light.color = directionalLight.color;
		light.direction = directionalLight.direction;
		light.visible = true;
	}
#endif
#if NUM_POINT_LIGHTS > 0
	struct PointLight {
		vec3 position;
		vec3 color;
		float distance;
		float decay;
	};
	uniform PointLight pointLights[ NUM_POINT_LIGHTS ];
	void getPointLightInfo( const in PointLight pointLight, const in vec3 geometryPosition, out IncidentLight light ) {
		vec3 lVector = pointLight.position - geometryPosition;
		light.direction = normalize( lVector );
		float lightDistance = length( lVector );
		light.color = pointLight.color;
		light.color *= getDistanceAttenuation( lightDistance, pointLight.distance, pointLight.decay );
		light.visible = ( light.color != vec3( 0.0 ) );
	}
#endif
#if NUM_SPOT_LIGHTS > 0
	struct SpotLight {
		vec3 position;
		vec3 direction;
		vec3 color;
		float distance;
		float decay;
		float coneCos;
		float penumbraCos;
	};
	uniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];
	void getSpotLightInfo( const in SpotLight spotLight, const in vec3 geometryPosition, out IncidentLight light ) {
		vec3 lVector = spotLight.position - geometryPosition;
		light.direction = normalize( lVector );
		float angleCos = dot( light.direction, spotLight.direction );
		float spotAttenuation = getSpotAttenuation( spotLight.coneCos, spotLight.penumbraCos, angleCos );
		if ( spotAttenuation > 0.0 ) {
			float lightDistance = length( lVector );
			light.color = spotLight.color * spotAttenuation;
			light.color *= getDistanceAttenuation( lightDistance, spotLight.distance, spotLight.decay );
			light.visible = ( light.color != vec3( 0.0 ) );
		} else {
			light.color = vec3( 0.0 );
			light.visible = false;
		}
	}
#endif
#if NUM_RECT_AREA_LIGHTS > 0
	struct RectAreaLight {
		vec3 color;
		vec3 position;
		vec3 halfWidth;
		vec3 halfHeight;
	};
	uniform sampler2D ltc_1;	uniform sampler2D ltc_2;
	uniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];
#endif
#if NUM_HEMI_LIGHTS > 0
	struct HemisphereLight {
		vec3 direction;
		vec3 skyColor;
		vec3 groundColor;
	};
	uniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];
	vec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in vec3 normal ) {
		float dotNL = dot( normal, hemiLight.direction );
		float hemiDiffuseWeight = 0.5 * dotNL + 0.5;
		vec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );
		return irradiance;
	}
#endif`,pQo=`#ifdef USE_ENVMAP
	vec3 getIBLIrradiance( const in vec3 normal ) {
		#ifdef ENVMAP_TYPE_CUBE_UV
			vec3 worldNormal = inverseTransformDirection( normal, viewMatrix );
			vec4 envMapColor = textureCubeUV( envMap, envMapRotation * worldNormal, 1.0 );
			return PI * envMapColor.rgb * envMapIntensity;
		#else
			return vec3( 0.0 );
		#endif
	}
	vec3 getIBLRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness ) {
		#ifdef ENVMAP_TYPE_CUBE_UV
			vec3 reflectVec = reflect( - viewDir, normal );
			reflectVec = normalize( mix( reflectVec, normal, roughness * roughness) );
			reflectVec = inverseTransformDirection( reflectVec, viewMatrix );
			vec4 envMapColor = textureCubeUV( envMap, envMapRotation * reflectVec, roughness );
			return envMapColor.rgb * envMapIntensity;
		#else
			return vec3( 0.0 );
		#endif
	}
	#ifdef USE_ANISOTROPY
		vec3 getIBLAnisotropyRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in vec3 bitangent, const in float anisotropy ) {
			#ifdef ENVMAP_TYPE_CUBE_UV
				vec3 bentNormal = cross( bitangent, viewDir );
				bentNormal = normalize( cross( bentNormal, bitangent ) );
				bentNormal = normalize( mix( bentNormal, normal, pow2( pow2( 1.0 - anisotropy * ( 1.0 - roughness ) ) ) ) );
				return getIBLRadiance( viewDir, bentNormal, roughness );
			#else
				return vec3( 0.0 );
			#endif
		}
	#endif
#endif`,mQo=`ToonMaterial material;
material.diffuseColor = diffuseColor.rgb;`,_Qo=`varying vec3 vViewPosition;
struct ToonMaterial {
	vec3 diffuseColor;
};
void RE_Direct_Toon( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {
	vec3 irradiance = getGradientIrradiance( geometryNormal, directLight.direction ) * directLight.color;
	reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
}
void RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {
	reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
}
#define RE_Direct				RE_Direct_Toon
#define RE_IndirectDiffuse		RE_IndirectDiffuse_Toon`,gQo=`BlinnPhongMaterial material;
material.diffuseColor = diffuseColor.rgb;
material.specularColor = specular;
material.specularShininess = shininess;
material.specularStrength = specularStrength;`,AQo=`varying vec3 vViewPosition;
struct BlinnPhongMaterial {
	vec3 diffuseColor;
	vec3 specularColor;
	float specularShininess;
	float specularStrength;
};
void RE_Direct_BlinnPhong( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {
	float dotNL = saturate( dot( geometryNormal, directLight.direction ) );
	vec3 irradiance = dotNL * directLight.color;
	reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
	reflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometryViewDir, geometryNormal, material.specularColor, material.specularShininess ) * material.specularStrength;
}
void RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {
	reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
}
#define RE_Direct				RE_Direct_BlinnPhong
#define RE_IndirectDiffuse		RE_IndirectDiffuse_BlinnPhong`,fQo=`PhysicalMaterial material;
material.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );
vec3 dxy = max( abs( dFdx( nonPerturbedNormal ) ), abs( dFdy( nonPerturbedNormal ) ) );
float geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );
material.roughness = max( roughnessFactor, 0.0525 );material.roughness += geometryRoughness;
material.roughness = min( material.roughness, 1.0 );
#ifdef IOR
	material.ior = ior;
	#ifdef USE_SPECULAR
		float specularIntensityFactor = specularIntensity;
		vec3 specularColorFactor = specularColor;
		#ifdef USE_SPECULAR_COLORMAP
			specularColorFactor *= texture2D( specularColorMap, vSpecularColorMapUv ).rgb;
		#endif
		#ifdef USE_SPECULAR_INTENSITYMAP
			specularIntensityFactor *= texture2D( specularIntensityMap, vSpecularIntensityMapUv ).a;
		#endif
		material.specularF90 = mix( specularIntensityFactor, 1.0, metalnessFactor );
	#else
		float specularIntensityFactor = 1.0;
		vec3 specularColorFactor = vec3( 1.0 );
		material.specularF90 = 1.0;
	#endif
	material.specularColor = mix( min( pow2( ( material.ior - 1.0 ) / ( material.ior + 1.0 ) ) * specularColorFactor, vec3( 1.0 ) ) * specularIntensityFactor, diffuseColor.rgb, metalnessFactor );
#else
	material.specularColor = mix( vec3( 0.04 ), diffuseColor.rgb, metalnessFactor );
	material.specularF90 = 1.0;
#endif
#ifdef USE_CLEARCOAT
	material.clearcoat = clearcoat;
	material.clearcoatRoughness = clearcoatRoughness;
	material.clearcoatF0 = vec3( 0.04 );
	material.clearcoatF90 = 1.0;
	#ifdef USE_CLEARCOATMAP
		material.clearcoat *= texture2D( clearcoatMap, vClearcoatMapUv ).x;
	#endif
	#ifdef USE_CLEARCOAT_ROUGHNESSMAP
		material.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vClearcoatRoughnessMapUv ).y;
	#endif
	material.clearcoat = saturate( material.clearcoat );	material.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 );
	material.clearcoatRoughness += geometryRoughness;
	material.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 );
#endif
#ifdef USE_DISPERSION
	material.dispersion = dispersion;
#endif
#ifdef USE_IRIDESCENCE
	material.iridescence = iridescence;
	material.iridescenceIOR = iridescenceIOR;
	#ifdef USE_IRIDESCENCEMAP
		material.iridescence *= texture2D( iridescenceMap, vIridescenceMapUv ).r;
	#endif
	#ifdef USE_IRIDESCENCE_THICKNESSMAP
		material.iridescenceThickness = (iridescenceThicknessMaximum - iridescenceThicknessMinimum) * texture2D( iridescenceThicknessMap, vIridescenceThicknessMapUv ).g + iridescenceThicknessMinimum;
	#else
		material.iridescenceThickness = iridescenceThicknessMaximum;
	#endif
#endif
#ifdef USE_SHEEN
	material.sheenColor = sheenColor;
	#ifdef USE_SHEEN_COLORMAP
		material.sheenColor *= texture2D( sheenColorMap, vSheenColorMapUv ).rgb;
	#endif
	material.sheenRoughness = clamp( sheenRoughness, 0.07, 1.0 );
	#ifdef USE_SHEEN_ROUGHNESSMAP
		material.sheenRoughness *= texture2D( sheenRoughnessMap, vSheenRoughnessMapUv ).a;
	#endif
#endif
#ifdef USE_ANISOTROPY
	#ifdef USE_ANISOTROPYMAP
		mat2 anisotropyMat = mat2( anisotropyVector.x, anisotropyVector.y, - anisotropyVector.y, anisotropyVector.x );
		vec3 anisotropyPolar = texture2D( anisotropyMap, vAnisotropyMapUv ).rgb;
		vec2 anisotropyV = anisotropyMat * normalize( 2.0 * anisotropyPolar.rg - vec2( 1.0 ) ) * anisotropyPolar.b;
	#else
		vec2 anisotropyV = anisotropyVector;
	#endif
	material.anisotropy = length( anisotropyV );
	if( material.anisotropy == 0.0 ) {
		anisotropyV = vec2( 1.0, 0.0 );
	} else {
		anisotropyV /= material.anisotropy;
		material.anisotropy = saturate( material.anisotropy );
	}
	material.alphaT = mix( pow2( material.roughness ), 1.0, pow2( material.anisotropy ) );
	material.anisotropyT = tbn[ 0 ] * anisotropyV.x + tbn[ 1 ] * anisotropyV.y;
	material.anisotropyB = tbn[ 1 ] * anisotropyV.x - tbn[ 0 ] * anisotropyV.y;
#endif`,yQo=`struct PhysicalMaterial {
	vec3 diffuseColor;
	float roughness;
	vec3 specularColor;
	float specularF90;
	float dispersion;
	#ifdef USE_CLEARCOAT
		float clearcoat;
		float clearcoatRoughness;
		vec3 clearcoatF0;
		float clearcoatF90;
	#endif
	#ifdef USE_IRIDESCENCE
		float iridescence;
		float iridescenceIOR;
		float iridescenceThickness;
		vec3 iridescenceFresnel;
		vec3 iridescenceF0;
	#endif
	#ifdef USE_SHEEN
		vec3 sheenColor;
		float sheenRoughness;
	#endif
	#ifdef IOR
		float ior;
	#endif
	#ifdef USE_TRANSMISSION
		float transmission;
		float transmissionAlpha;
		float thickness;
		float attenuationDistance;
		vec3 attenuationColor;
	#endif
	#ifdef USE_ANISOTROPY
		float anisotropy;
		float alphaT;
		vec3 anisotropyT;
		vec3 anisotropyB;
	#endif
};
vec3 clearcoatSpecularDirect = vec3( 0.0 );
vec3 clearcoatSpecularIndirect = vec3( 0.0 );
vec3 sheenSpecularDirect = vec3( 0.0 );
vec3 sheenSpecularIndirect = vec3(0.0 );
vec3 Schlick_to_F0( const in vec3 f, const in float f90, const in float dotVH ) {
    float x = clamp( 1.0 - dotVH, 0.0, 1.0 );
    float x2 = x * x;
    float x5 = clamp( x * x2 * x2, 0.0, 0.9999 );
    return ( f - vec3( f90 ) * x5 ) / ( 1.0 - x5 );
}
float V_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {
	float a2 = pow2( alpha );
	float gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );
	float gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );
	return 0.5 / max( gv + gl, EPSILON );
}
float D_GGX( const in float alpha, const in float dotNH ) {
	float a2 = pow2( alpha );
	float denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;
	return RECIPROCAL_PI * a2 / pow2( denom );
}
#ifdef USE_ANISOTROPY
	float V_GGX_SmithCorrelated_Anisotropic( const in float alphaT, const in float alphaB, const in float dotTV, const in float dotBV, const in float dotTL, const in float dotBL, const in float dotNV, const in float dotNL ) {
		float gv = dotNL * length( vec3( alphaT * dotTV, alphaB * dotBV, dotNV ) );
		float gl = dotNV * length( vec3( alphaT * dotTL, alphaB * dotBL, dotNL ) );
		float v = 0.5 / ( gv + gl );
		return saturate(v);
	}
	float D_GGX_Anisotropic( const in float alphaT, const in float alphaB, const in float dotNH, const in float dotTH, const in float dotBH ) {
		float a2 = alphaT * alphaB;
		highp vec3 v = vec3( alphaB * dotTH, alphaT * dotBH, a2 * dotNH );
		highp float v2 = dot( v, v );
		float w2 = a2 / v2;
		return RECIPROCAL_PI * a2 * pow2 ( w2 );
	}
#endif
#ifdef USE_CLEARCOAT
	vec3 BRDF_GGX_Clearcoat( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material) {
		vec3 f0 = material.clearcoatF0;
		float f90 = material.clearcoatF90;
		float roughness = material.clearcoatRoughness;
		float alpha = pow2( roughness );
		vec3 halfDir = normalize( lightDir + viewDir );
		float dotNL = saturate( dot( normal, lightDir ) );
		float dotNV = saturate( dot( normal, viewDir ) );
		float dotNH = saturate( dot( normal, halfDir ) );
		float dotVH = saturate( dot( viewDir, halfDir ) );
		vec3 F = F_Schlick( f0, f90, dotVH );
		float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );
		float D = D_GGX( alpha, dotNH );
		return F * ( V * D );
	}
#endif
vec3 BRDF_GGX( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material ) {
	vec3 f0 = material.specularColor;
	float f90 = material.specularF90;
	float roughness = material.roughness;
	float alpha = pow2( roughness );
	vec3 halfDir = normalize( lightDir + viewDir );
	float dotNL = saturate( dot( normal, lightDir ) );
	float dotNV = saturate( dot( normal, viewDir ) );
	float dotNH = saturate( dot( normal, halfDir ) );
	float dotVH = saturate( dot( viewDir, halfDir ) );
	vec3 F = F_Schlick( f0, f90, dotVH );
	#ifdef USE_IRIDESCENCE
		F = mix( F, material.iridescenceFresnel, material.iridescence );
	#endif
	#ifdef USE_ANISOTROPY
		float dotTL = dot( material.anisotropyT, lightDir );
		float dotTV = dot( material.anisotropyT, viewDir );
		float dotTH = dot( material.anisotropyT, halfDir );
		float dotBL = dot( material.anisotropyB, lightDir );
		float dotBV = dot( material.anisotropyB, viewDir );
		float dotBH = dot( material.anisotropyB, halfDir );
		float V = V_GGX_SmithCorrelated_Anisotropic( material.alphaT, alpha, dotTV, dotBV, dotTL, dotBL, dotNV, dotNL );
		float D = D_GGX_Anisotropic( material.alphaT, alpha, dotNH, dotTH, dotBH );
	#else
		float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );
		float D = D_GGX( alpha, dotNH );
	#endif
	return F * ( V * D );
}
vec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {
	const float LUT_SIZE = 64.0;
	const float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;
	const float LUT_BIAS = 0.5 / LUT_SIZE;
	float dotNV = saturate( dot( N, V ) );
	vec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );
	uv = uv * LUT_SCALE + LUT_BIAS;
	return uv;
}
float LTC_ClippedSphereFormFactor( const in vec3 f ) {
	float l = length( f );
	return max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );
}
vec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {
	float x = dot( v1, v2 );
	float y = abs( x );
	float a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y;
	float b = 3.4175940 + ( 4.1616724 + y ) * y;
	float v = a / b;
	float theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;
	return cross( v1, v2 ) * theta_sintheta;
}
vec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) {
	vec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];
	vec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];
	vec3 lightNormal = cross( v1, v2 );
	if( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );
	vec3 T1, T2;
	T1 = normalize( V - N * dot( V, N ) );
	T2 = - cross( N, T1 );
	mat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) );
	vec3 coords[ 4 ];
	coords[ 0 ] = mat * ( rectCoords[ 0 ] - P );
	coords[ 1 ] = mat * ( rectCoords[ 1 ] - P );
	coords[ 2 ] = mat * ( rectCoords[ 2 ] - P );
	coords[ 3 ] = mat * ( rectCoords[ 3 ] - P );
	coords[ 0 ] = normalize( coords[ 0 ] );
	coords[ 1 ] = normalize( coords[ 1 ] );
	coords[ 2 ] = normalize( coords[ 2 ] );
	coords[ 3 ] = normalize( coords[ 3 ] );
	vec3 vectorFormFactor = vec3( 0.0 );
	vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );
	vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );
	vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );
	vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );
	float result = LTC_ClippedSphereFormFactor( vectorFormFactor );
	return vec3( result );
}
#if defined( USE_SHEEN )
float D_Charlie( float roughness, float dotNH ) {
	float alpha = pow2( roughness );
	float invAlpha = 1.0 / alpha;
	float cos2h = dotNH * dotNH;
	float sin2h = max( 1.0 - cos2h, 0.0078125 );
	return ( 2.0 + invAlpha ) * pow( sin2h, invAlpha * 0.5 ) / ( 2.0 * PI );
}
float V_Neubelt( float dotNV, float dotNL ) {
	return saturate( 1.0 / ( 4.0 * ( dotNL + dotNV - dotNL * dotNV ) ) );
}
vec3 BRDF_Sheen( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, vec3 sheenColor, const in float sheenRoughness ) {
	vec3 halfDir = normalize( lightDir + viewDir );
	float dotNL = saturate( dot( normal, lightDir ) );
	float dotNV = saturate( dot( normal, viewDir ) );
	float dotNH = saturate( dot( normal, halfDir ) );
	float D = D_Charlie( sheenRoughness, dotNH );
	float V = V_Neubelt( dotNV, dotNL );
	return sheenColor * ( D * V );
}
#endif
float IBLSheenBRDF( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {
	float dotNV = saturate( dot( normal, viewDir ) );
	float r2 = roughness * roughness;
	float a = roughness < 0.25 ? -339.2 * r2 + 161.4 * roughness - 25.9 : -8.48 * r2 + 14.3 * roughness - 9.95;
	float b = roughness < 0.25 ? 44.0 * r2 - 23.7 * roughness + 3.26 : 1.97 * r2 - 3.27 * roughness + 0.72;
	float DG = exp( a * dotNV + b ) + ( roughness < 0.25 ? 0.0 : 0.1 * ( roughness - 0.25 ) );
	return saturate( DG * RECIPROCAL_PI );
}
vec2 DFGApprox( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {
	float dotNV = saturate( dot( normal, viewDir ) );
	const vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );
	const vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );
	vec4 r = roughness * c0 + c1;
	float a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y;
	vec2 fab = vec2( - 1.04, 1.04 ) * a004 + r.zw;
	return fab;
}
vec3 EnvironmentBRDF( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness ) {
	vec2 fab = DFGApprox( normal, viewDir, roughness );
	return specularColor * fab.x + specularF90 * fab.y;
}
#ifdef USE_IRIDESCENCE
void computeMultiscatteringIridescence( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float iridescence, const in vec3 iridescenceF0, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {
#else
void computeMultiscattering( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {
#endif
	vec2 fab = DFGApprox( normal, viewDir, roughness );
	#ifdef USE_IRIDESCENCE
		vec3 Fr = mix( specularColor, iridescenceF0, iridescence );
	#else
		vec3 Fr = specularColor;
	#endif
	vec3 FssEss = Fr * fab.x + specularF90 * fab.y;
	float Ess = fab.x + fab.y;
	float Ems = 1.0 - Ess;
	vec3 Favg = Fr + ( 1.0 - Fr ) * 0.047619;	vec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg );
	singleScatter += FssEss;
	multiScatter += Fms * Ems;
}
#if NUM_RECT_AREA_LIGHTS > 0
	void RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {
		vec3 normal = geometryNormal;
		vec3 viewDir = geometryViewDir;
		vec3 position = geometryPosition;
		vec3 lightPos = rectAreaLight.position;
		vec3 halfWidth = rectAreaLight.halfWidth;
		vec3 halfHeight = rectAreaLight.halfHeight;
		vec3 lightColor = rectAreaLight.color;
		float roughness = material.roughness;
		vec3 rectCoords[ 4 ];
		rectCoords[ 0 ] = lightPos + halfWidth - halfHeight;		rectCoords[ 1 ] = lightPos - halfWidth - halfHeight;
		rectCoords[ 2 ] = lightPos - halfWidth + halfHeight;
		rectCoords[ 3 ] = lightPos + halfWidth + halfHeight;
		vec2 uv = LTC_Uv( normal, viewDir, roughness );
		vec4 t1 = texture2D( ltc_1, uv );
		vec4 t2 = texture2D( ltc_2, uv );
		mat3 mInv = mat3(
			vec3( t1.x, 0, t1.y ),
			vec3(    0, 1,    0 ),
			vec3( t1.z, 0, t1.w )
		);
		vec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y );
		reflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );
		reflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );
	}
#endif
void RE_Direct_Physical( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {
	float dotNL = saturate( dot( geometryNormal, directLight.direction ) );
	vec3 irradiance = dotNL * directLight.color;
	#ifdef USE_CLEARCOAT
		float dotNLcc = saturate( dot( geometryClearcoatNormal, directLight.direction ) );
		vec3 ccIrradiance = dotNLcc * directLight.color;
		clearcoatSpecularDirect += ccIrradiance * BRDF_GGX_Clearcoat( directLight.direction, geometryViewDir, geometryClearcoatNormal, material );
	#endif
	#ifdef USE_SHEEN
		sheenSpecularDirect += irradiance * BRDF_Sheen( directLight.direction, geometryViewDir, geometryNormal, material.sheenColor, material.sheenRoughness );
	#endif
	reflectedLight.directSpecular += irradiance * BRDF_GGX( directLight.direction, geometryViewDir, geometryNormal, material );
	reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
}
void RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {
	reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
}
void RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) {
	#ifdef USE_CLEARCOAT
		clearcoatSpecularIndirect += clearcoatRadiance * EnvironmentBRDF( geometryClearcoatNormal, geometryViewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness );
	#endif
	#ifdef USE_SHEEN
		sheenSpecularIndirect += irradiance * material.sheenColor * IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness );
	#endif
	vec3 singleScattering = vec3( 0.0 );
	vec3 multiScattering = vec3( 0.0 );
	vec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;
	#ifdef USE_IRIDESCENCE
		computeMultiscatteringIridescence( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnel, material.roughness, singleScattering, multiScattering );
	#else
		computeMultiscattering( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.roughness, singleScattering, multiScattering );
	#endif
	vec3 totalScattering = singleScattering + multiScattering;
	vec3 diffuse = material.diffuseColor * ( 1.0 - max( max( totalScattering.r, totalScattering.g ), totalScattering.b ) );
	reflectedLight.indirectSpecular += radiance * singleScattering;
	reflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance;
	reflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance;
}
#define RE_Direct				RE_Direct_Physical
#define RE_Direct_RectArea		RE_Direct_RectArea_Physical
#define RE_IndirectDiffuse		RE_IndirectDiffuse_Physical
#define RE_IndirectSpecular		RE_IndirectSpecular_Physical
float computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {
	return saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );
}`,xQo=`
vec3 geometryPosition = - vViewPosition;
vec3 geometryNormal = normal;
vec3 geometryViewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );
vec3 geometryClearcoatNormal = vec3( 0.0 );
#ifdef USE_CLEARCOAT
	geometryClearcoatNormal = clearcoatNormal;
#endif
#ifdef USE_IRIDESCENCE
	float dotNVi = saturate( dot( normal, geometryViewDir ) );
	if ( material.iridescenceThickness == 0.0 ) {
		material.iridescence = 0.0;
	} else {
		material.iridescence = saturate( material.iridescence );
	}
	if ( material.iridescence > 0.0 ) {
		material.iridescenceFresnel = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.specularColor );
		material.iridescenceF0 = Schlick_to_F0( material.iridescenceFresnel, 1.0, dotNVi );
	}
#endif
IncidentLight directLight;
#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )
	PointLight pointLight;
	#if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0
	PointLightShadow pointLightShadow;
	#endif
	#pragma unroll_loop_start
	for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {
		pointLight = pointLights[ i ];
		getPointLightInfo( pointLight, geometryPosition, directLight );
		#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS )
		pointLightShadow = pointLightShadows[ i ];
		directLight.color *= ( directLight.visible && receiveShadow ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0;
		#endif
		RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );
	}
	#pragma unroll_loop_end
#endif
#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )
	SpotLight spotLight;
	vec4 spotColor;
	vec3 spotLightCoord;
	bool inSpotLightMap;
	#if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0
	SpotLightShadow spotLightShadow;
	#endif
	#pragma unroll_loop_start
	for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {
		spotLight = spotLights[ i ];
		getSpotLightInfo( spotLight, geometryPosition, directLight );
		#if ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )
		#define SPOT_LIGHT_MAP_INDEX UNROLLED_LOOP_INDEX
		#elif ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )
		#define SPOT_LIGHT_MAP_INDEX NUM_SPOT_LIGHT_MAPS
		#else
		#define SPOT_LIGHT_MAP_INDEX ( UNROLLED_LOOP_INDEX - NUM_SPOT_LIGHT_SHADOWS + NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )
		#endif
		#if ( SPOT_LIGHT_MAP_INDEX < NUM_SPOT_LIGHT_MAPS )
			spotLightCoord = vSpotLightCoord[ i ].xyz / vSpotLightCoord[ i ].w;
			inSpotLightMap = all( lessThan( abs( spotLightCoord * 2. - 1. ), vec3( 1.0 ) ) );
			spotColor = texture2D( spotLightMap[ SPOT_LIGHT_MAP_INDEX ], spotLightCoord.xy );
			directLight.color = inSpotLightMap ? directLight.color * spotColor.rgb : directLight.color;
		#endif
		#undef SPOT_LIGHT_MAP_INDEX
		#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )
		spotLightShadow = spotLightShadows[ i ];
		directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;
		#endif
		RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );
	}
	#pragma unroll_loop_end
#endif
#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )
	DirectionalLight directionalLight;
	#if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0
	DirectionalLightShadow directionalLightShadow;
	#endif
	#pragma unroll_loop_start
	for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {
		directionalLight = directionalLights[ i ];
		getDirectionalLightInfo( directionalLight, directLight );
		#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )
		directionalLightShadow = directionalLightShadows[ i ];
		directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;
		#endif
		RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );
	}
	#pragma unroll_loop_end
#endif
#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )
	RectAreaLight rectAreaLight;
	#pragma unroll_loop_start
	for ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {
		rectAreaLight = rectAreaLights[ i ];
		RE_Direct_RectArea( rectAreaLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );
	}
	#pragma unroll_loop_end
#endif
#if defined( RE_IndirectDiffuse )
	vec3 iblIrradiance = vec3( 0.0 );
	vec3 irradiance = getAmbientLightIrradiance( ambientLightColor );
	#if defined( USE_LIGHT_PROBES )
		irradiance += getLightProbeIrradiance( lightProbe, geometryNormal );
	#endif
	#if ( NUM_HEMI_LIGHTS > 0 )
		#pragma unroll_loop_start
		for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {
			irradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometryNormal );
		}
		#pragma unroll_loop_end
	#endif
#endif
#if defined( RE_IndirectSpecular )
	vec3 radiance = vec3( 0.0 );
	vec3 clearcoatRadiance = vec3( 0.0 );
#endif`,CQo=`#if defined( RE_IndirectDiffuse )
	#ifdef USE_LIGHTMAP
		vec4 lightMapTexel = texture2D( lightMap, vLightMapUv );
		vec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity;
		irradiance += lightMapIrradiance;
	#endif
	#if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV )
		iblIrradiance += getIBLIrradiance( geometryNormal );
	#endif
#endif
#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )
	#ifdef USE_ANISOTROPY
		radiance += getIBLAnisotropyRadiance( geometryViewDir, geometryNormal, material.roughness, material.anisotropyB, material.anisotropy );
	#else
		radiance += getIBLRadiance( geometryViewDir, geometryNormal, material.roughness );
	#endif
	#ifdef USE_CLEARCOAT
		clearcoatRadiance += getIBLRadiance( geometryViewDir, geometryClearcoatNormal, material.clearcoatRoughness );
	#endif
#endif`,bQo=`#if defined( RE_IndirectDiffuse )
	RE_IndirectDiffuse( irradiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );
#endif
#if defined( RE_IndirectSpecular )
	RE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );
#endif`;var IQo=`#if defined( USE_LOGDEPTHBUF )
	gl_FragDepth = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;
#endif`,vQo=`#if defined( USE_LOGDEPTHBUF )
	uniform float logDepthBufFC;
	varying float vFragDepth;
	varying float vIsPerspective;
#endif`,SQo=`#ifdef USE_LOGDEPTHBUF
	varying float vFragDepth;
	varying float vIsPerspective;
#endif`,PQo=`#ifdef USE_LOGDEPTHBUF
	vFragDepth = 1.0 + gl_Position.w;
	vIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );
#endif`,EQo=`#ifdef USE_MAP
	vec4 sampledDiffuseColor = texture2D( map, vMapUv );
	#ifdef DECODE_VIDEO_TEXTURE
		sampledDiffuseColor = vec4( mix( pow( sampledDiffuseColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), sampledDiffuseColor.rgb * 0.0773993808, vec3( lessThanEqual( sampledDiffuseColor.rgb, vec3( 0.04045 ) ) ) ), sampledDiffuseColor.w );
	
	#endif
	diffuseColor *= sampledDiffuseColor;
#endif`,MQo=`#ifdef USE_MAP
	uniform sampler2D map;
#endif`,wQo=`#if defined( USE_MAP ) || defined( USE_ALPHAMAP )
	#if defined( USE_POINTS_UV )
		vec2 uv = vUv;
	#else
		vec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;
	#endif
#endif
#ifdef USE_MAP
	diffuseColor *= texture2D( map, uv );
#endif
#ifdef USE_ALPHAMAP
	diffuseColor.a *= texture2D( alphaMap, uv ).g;
#endif`,BQo=`#if defined( USE_POINTS_UV )
	varying vec2 vUv;
#else
	#if defined( USE_MAP ) || defined( USE_ALPHAMAP )
		uniform mat3 uvTransform;
	#endif
#endif
#ifdef USE_MAP
	uniform sampler2D map;
#endif
#ifdef USE_ALPHAMAP
	uniform sampler2D alphaMap;
#endif`,TQo=`float metalnessFactor = metalness;
#ifdef USE_METALNESSMAP
	vec4 texelMetalness = texture2D( metalnessMap, vMetalnessMapUv );
	metalnessFactor *= texelMetalness.b;
#endif`,DQo=`#ifdef USE_METALNESSMAP
	uniform sampler2D metalnessMap;
#endif`,NQo=`#ifdef USE_INSTANCING_MORPH
	float morphTargetInfluences[ MORPHTARGETS_COUNT ];
	float morphTargetBaseInfluence = texelFetch( morphTexture, ivec2( 0, gl_InstanceID ), 0 ).r;
	for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {
		morphTargetInfluences[i] =  texelFetch( morphTexture, ivec2( i + 1, gl_InstanceID ), 0 ).r;
	}
#endif`,RQo=`#if defined( USE_MORPHCOLORS )
	vColor *= morphTargetBaseInfluence;
	for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {
		#if defined( USE_COLOR_ALPHA )
			if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ) * morphTargetInfluences[ i ];
		#elif defined( USE_COLOR )
			if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ];
		#endif
	}
#endif`,QQo=`#ifdef USE_MORPHNORMALS
	objectNormal *= morphTargetBaseInfluence;
	for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {
		if ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1 ).xyz * morphTargetInfluences[ i ];
	}
#endif`,kQo=`#ifdef USE_MORPHTARGETS
	#ifndef USE_INSTANCING_MORPH
		uniform float morphTargetBaseInfluence;
		uniform float morphTargetInfluences[ MORPHTARGETS_COUNT ];
	#endif
	uniform sampler2DArray morphTargetsTexture;
	uniform ivec2 morphTargetsTextureSize;
	vec4 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in int offset ) {
		int texelIndex = vertexIndex * MORPHTARGETS_TEXTURE_STRIDE + offset;
		int y = texelIndex / morphTargetsTextureSize.x;
		int x = texelIndex - y * morphTargetsTextureSize.x;
		ivec3 morphUV = ivec3( x, y, morphTargetIndex );
		return texelFetch( morphTargetsTexture, morphUV, 0 );
	}
#endif`,LQo=`#ifdef USE_MORPHTARGETS
	transformed *= morphTargetBaseInfluence;
	for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {
		if ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ];
	}
#endif`,HQo=`float faceDirection = gl_FrontFacing ? 1.0 : - 1.0;
#ifdef FLAT_SHADED
	vec3 fdx = dFdx( vViewPosition );
	vec3 fdy = dFdy( vViewPosition );
	vec3 normal = normalize( cross( fdx, fdy ) );
#else
	vec3 normal = normalize( vNormal );
	#ifdef DOUBLE_SIDED
		normal *= faceDirection;
	#endif
#endif
#if defined( USE_NORMALMAP_TANGENTSPACE ) || defined( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY )
	#ifdef USE_TANGENT
		mat3 tbn = mat3( normalize( vTangent ), normalize( vBitangent ), normal );
	#else
		mat3 tbn = getTangentFrame( - vViewPosition, normal,
		#if defined( USE_NORMALMAP )
			vNormalMapUv
		#elif defined( USE_CLEARCOAT_NORMALMAP )
			vClearcoatNormalMapUv
		#else
			vUv
		#endif
		);
	#endif
	#if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED )
		tbn[0] *= faceDirection;
		tbn[1] *= faceDirection;
	#endif
#endif
#ifdef USE_CLEARCOAT_NORMALMAP
	#ifdef USE_TANGENT
		mat3 tbn2 = mat3( normalize( vTangent ), normalize( vBitangent ), normal );
	#else
		mat3 tbn2 = getTangentFrame( - vViewPosition, normal, vClearcoatNormalMapUv );
	#endif
	#if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED )
		tbn2[0] *= faceDirection;
		tbn2[1] *= faceDirection;
	#endif
#endif
vec3 nonPerturbedNormal = normal;`,FQo=`#ifdef USE_NORMALMAP_OBJECTSPACE
	normal = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0;
	#ifdef FLIP_SIDED
		normal = - normal;
	#endif
	#ifdef DOUBLE_SIDED
		normal = normal * faceDirection;
	#endif
	normal = normalize( normalMatrix * normal );
#elif defined( USE_NORMALMAP_TANGENTSPACE )
	vec3 mapN = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0;
	mapN.xy *= normalScale;
	normal = normalize( tbn * mapN );
#elif defined( USE_BUMPMAP )
	normal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection );
#endif`,zQo=`#ifndef FLAT_SHADED
	varying vec3 vNormal;
	#ifdef USE_TANGENT
		varying vec3 vTangent;
		varying vec3 vBitangent;
	#endif
#endif`,OQo=`#ifndef FLAT_SHADED
	varying vec3 vNormal;
	#ifdef USE_TANGENT
		varying vec3 vTangent;
		varying vec3 vBitangent;
	#endif
#endif`,VQo=`#ifndef FLAT_SHADED
	vNormal = normalize( transformedNormal );
	#ifdef USE_TANGENT
		vTangent = normalize( transformedTangent );
		vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );
	#endif
#endif`,YQo=`#ifdef USE_NORMALMAP
	uniform sampler2D normalMap;
	uniform vec2 normalScale;
#endif
#ifdef USE_NORMALMAP_OBJECTSPACE
	uniform mat3 normalMatrix;
#endif
#if ! defined ( USE_TANGENT ) && ( defined ( USE_NORMALMAP_TANGENTSPACE ) || defined ( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY ) )
	mat3 getTangentFrame( vec3 eye_pos, vec3 surf_norm, vec2 uv ) {
		vec3 q0 = dFdx( eye_pos.xyz );
		vec3 q1 = dFdy( eye_pos.xyz );
		vec2 st0 = dFdx( uv.st );
		vec2 st1 = dFdy( uv.st );
		vec3 N = surf_norm;
		vec3 q1perp = cross( q1, N );
		vec3 q0perp = cross( N, q0 );
		vec3 T = q1perp * st0.x + q0perp * st1.x;
		vec3 B = q1perp * st0.y + q0perp * st1.y;
		float det = max( dot( T, T ), dot( B, B ) );
		float scale = ( det == 0.0 ) ? 0.0 : inversesqrt( det );
		return mat3( T * scale, B * scale, N );
	}
#endif`,GQo=`#ifdef USE_CLEARCOAT
	vec3 clearcoatNormal = nonPerturbedNormal;
#endif`,UQo=`#ifdef USE_CLEARCOAT_NORMALMAP
	vec3 clearcoatMapN = texture2D( clearcoatNormalMap, vClearcoatNormalMapUv ).xyz * 2.0 - 1.0;
	clearcoatMapN.xy *= clearcoatNormalScale;
	clearcoatNormal = normalize( tbn2 * clearcoatMapN );
#endif`,WQo=`#ifdef USE_CLEARCOATMAP
	uniform sampler2D clearcoatMap;
#endif
#ifdef USE_CLEARCOAT_NORMALMAP
	uniform sampler2D clearcoatNormalMap;
	uniform vec2 clearcoatNormalScale;
#endif
#ifdef USE_CLEARCOAT_ROUGHNESSMAP
	uniform sampler2D clearcoatRoughnessMap;
#endif`,XQo=`#ifdef USE_IRIDESCENCEMAP
	uniform sampler2D iridescenceMap;
#endif
#ifdef USE_IRIDESCENCE_THICKNESSMAP
	uniform sampler2D iridescenceThicknessMap;
#endif`,jQo=`#ifdef OPAQUE
diffuseColor.a = 1.0;
#endif
#ifdef USE_TRANSMISSION
diffuseColor.a *= material.transmissionAlpha;
#endif
gl_FragColor = vec4( outgoingLight, diffuseColor.a );`,KQo=`vec3 packNormalToRGB( const in vec3 normal ) {
	return normalize( normal ) * 0.5 + 0.5;
}
vec3 unpackRGBToNormal( const in vec3 rgb ) {
	return 2.0 * rgb.xyz - 1.0;
}
const float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;
const vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. );
const vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. );
const float ShiftRight8 = 1. / 256.;
vec4 packDepthToRGBA( const in float v ) {
	vec4 r = vec4( fract( v * PackFactors ), v );
	r.yzw -= r.xyz * ShiftRight8;	return r * PackUpscale;
}
float unpackRGBAToDepth( const in vec4 v ) {
	return dot( v, UnpackFactors );
}
vec2 packDepthToRG( in highp float v ) {
	return packDepthToRGBA( v ).yx;
}
float unpackRGToDepth( const in highp vec2 v ) {
	return unpackRGBAToDepth( vec4( v.xy, 0.0, 0.0 ) );
}
vec4 pack2HalfToRGBA( vec2 v ) {
	vec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ) );
	return vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w );
}
vec2 unpackRGBATo2Half( vec4 v ) {
	return vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) );
}
float viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {
	return ( viewZ + near ) / ( near - far );
}
float orthographicDepthToViewZ( const in float depth, const in float near, const in float far ) {
	return depth * ( near - far ) - near;
}
float viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {
	return ( ( near + viewZ ) * far ) / ( ( far - near ) * viewZ );
}
float perspectiveDepthToViewZ( const in float depth, const in float near, const in float far ) {
	return ( near * far ) / ( ( far - near ) * depth - far );
}`,$Qo=`#ifdef PREMULTIPLIED_ALPHA
	gl_FragColor.rgb *= gl_FragColor.a;
#endif`,qQo=`vec4 mvPosition = vec4( transformed, 1.0 );
#ifdef USE_BATCHING
	mvPosition = batchingMatrix * mvPosition;
#endif
#ifdef USE_INSTANCING
	mvPosition = instanceMatrix * mvPosition;
#endif
mvPosition = modelViewMatrix * mvPosition;
gl_Position = projectionMatrix * mvPosition;`,JQo=`#ifdef DITHERING
	gl_FragColor.rgb = dithering( gl_FragColor.rgb );
#endif`,ZQo=`#ifdef DITHERING
	vec3 dithering( vec3 color ) {
		float grid_position = rand( gl_FragCoord.xy );
		vec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );
		dither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );
		return color + dither_shift_RGB;
	}
#endif`,eko=`float roughnessFactor = roughness;
#ifdef USE_ROUGHNESSMAP
	vec4 texelRoughness = texture2D( roughnessMap, vRoughnessMapUv );
	roughnessFactor *= texelRoughness.g;
#endif`,tko=`#ifdef USE_ROUGHNESSMAP
	uniform sampler2D roughnessMap;
#endif`,nko=`#if NUM_SPOT_LIGHT_COORDS > 0
	varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];
#endif
#if NUM_SPOT_LIGHT_MAPS > 0
	uniform sampler2D spotLightMap[ NUM_SPOT_LIGHT_MAPS ];
#endif
#ifdef USE_SHADOWMAP
	#if NUM_DIR_LIGHT_SHADOWS > 0
		uniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];
		varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];
		struct DirectionalLightShadow {
			float shadowBias;
			float shadowNormalBias;
			float shadowRadius;
			vec2 shadowMapSize;
		};
		uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];
	#endif
	#if NUM_SPOT_LIGHT_SHADOWS > 0
		uniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];
		struct SpotLightShadow {
			float shadowBias;
			float shadowNormalBias;
			float shadowRadius;
			vec2 shadowMapSize;
		};
		uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];
	#endif
	#if NUM_POINT_LIGHT_SHADOWS > 0
		uniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];
		varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];
		struct PointLightShadow {
			float shadowBias;
			float shadowNormalBias;
			float shadowRadius;
			vec2 shadowMapSize;
			float shadowCameraNear;
			float shadowCameraFar;
		};
		uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];
	#endif
	float texture2DCompare( sampler2D depths, vec2 uv, float compare ) {
		return step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );
	}
	vec2 texture2DDistribution( sampler2D shadow, vec2 uv ) {
		return unpackRGBATo2Half( texture2D( shadow, uv ) );
	}
	float VSMShadow (sampler2D shadow, vec2 uv, float compare ){
		float occlusion = 1.0;
		vec2 distribution = texture2DDistribution( shadow, uv );
		float hard_shadow = step( compare , distribution.x );
		if (hard_shadow != 1.0 ) {
			float distance = compare - distribution.x ;
			float variance = max( 0.00000, distribution.y * distribution.y );
			float softness_probability = variance / (variance + distance * distance );			softness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 );			occlusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 );
		}
		return occlusion;
	}
	float getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {
		float shadow = 1.0;
		shadowCoord.xyz /= shadowCoord.w;
		shadowCoord.z += shadowBias;
		bool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0;
		bool frustumTest = inFrustum && shadowCoord.z <= 1.0;
		if ( frustumTest ) {
		#if defined( SHADOWMAP_TYPE_PCF )
			vec2 texelSize = vec2( 1.0 ) / shadowMapSize;
			float dx0 = - texelSize.x * shadowRadius;
			float dy0 = - texelSize.y * shadowRadius;
			float dx1 = + texelSize.x * shadowRadius;
			float dy1 = + texelSize.y * shadowRadius;
			float dx2 = dx0 / 2.0;
			float dy2 = dy0 / 2.0;
			float dx3 = dx1 / 2.0;
			float dy3 = dy1 / 2.0;
			shadow = (
				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +
				texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +
				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +
				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) +
				texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) +
				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) +
				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +
				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) +
				texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +
				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) +
				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +
				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) +
				texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) +
				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) +
				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +
				texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +
				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )
			) * ( 1.0 / 17.0 );
		#elif defined( SHADOWMAP_TYPE_PCF_SOFT )
			vec2 texelSize = vec2( 1.0 ) / shadowMapSize;
			float dx = texelSize.x;
			float dy = texelSize.y;
			vec2 uv = shadowCoord.xy;
			vec2 f = fract( uv * shadowMapSize + 0.5 );
			uv -= f * texelSize;
			shadow = (
				texture2DCompare( shadowMap, uv, shadowCoord.z ) +
				texture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) +
				texture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) +
				texture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) +
				mix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ),
					 texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ),
					 f.x ) +
				mix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ),
					 texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ),
					 f.x ) +
				mix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ),
					 texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ),
					 f.y ) +
				mix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ),
					 texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ),
					 f.y ) +
				mix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ),
						  texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ),
						  f.x ),
					 mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ),
						  texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ),
						  f.x ),
					 f.y )
			) * ( 1.0 / 9.0 );
		#elif defined( SHADOWMAP_TYPE_VSM )
			shadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z );
		#else
			shadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );
		#endif
		}
		return shadow;
	}
	vec2 cubeToUV( vec3 v, float texelSizeY ) {
		vec3 absV = abs( v );
		float scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );
		absV *= scaleToCube;
		v *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );
		vec2 planar = v.xy;
		float almostATexel = 1.5 * texelSizeY;
		float almostOne = 1.0 - almostATexel;
		if ( absV.z >= almostOne ) {
			if ( v.z > 0.0 )
				planar.x = 4.0 - v.x;
		} else if ( absV.x >= almostOne ) {
			float signX = sign( v.x );
			planar.x = v.z * signX + 2.0 * signX;
		} else if ( absV.y >= almostOne ) {
			float signY = sign( v.y );
			planar.x = v.x + 2.0 * signY + 2.0;
			planar.y = v.z * signY - 2.0;
		}
		return vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );
	}
	float getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {
		float shadow = 1.0;
		vec3 lightToPosition = shadowCoord.xyz;
		
		float lightToPositionLength = length( lightToPosition );
		if ( lightToPositionLength - shadowCameraFar <= 0.0 && lightToPositionLength - shadowCameraNear >= 0.0 ) {
			float dp = ( lightToPositionLength - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear );			dp += shadowBias;
			vec3 bd3D = normalize( lightToPosition );
			vec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );
			#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM )
				vec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;
				shadow = (
					texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +
					texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +
					texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +
					texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +
					texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +
					texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +
					texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +
					texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +
					texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )
				) * ( 1.0 / 9.0 );
			#else
				shadow = texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );
			#endif
		}
		return shadow;
	}
#endif`,oko=`#if NUM_SPOT_LIGHT_COORDS > 0
	uniform mat4 spotLightMatrix[ NUM_SPOT_LIGHT_COORDS ];
	varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];
#endif
#ifdef USE_SHADOWMAP
	#if NUM_DIR_LIGHT_SHADOWS > 0
		uniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ];
		varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];
		struct DirectionalLightShadow {
			float shadowBias;
			float shadowNormalBias;
			float shadowRadius;
			vec2 shadowMapSize;
		};
		uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];
	#endif
	#if NUM_SPOT_LIGHT_SHADOWS > 0
		struct SpotLightShadow {
			float shadowBias;
			float shadowNormalBias;
			float shadowRadius;
			vec2 shadowMapSize;
		};
		uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];
	#endif
	#if NUM_POINT_LIGHT_SHADOWS > 0
		uniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ];
		varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];
		struct PointLightShadow {
			float shadowBias;
			float shadowNormalBias;
			float shadowRadius;
			vec2 shadowMapSize;
			float shadowCameraNear;
			float shadowCameraFar;
		};
		uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];
	#endif
#endif`,rko=`#if ( defined( USE_SHADOWMAP ) && ( NUM_DIR_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 ) ) || ( NUM_SPOT_LIGHT_COORDS > 0 )
	vec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix );
	vec4 shadowWorldPosition;
#endif
#if defined( USE_SHADOWMAP )
	#if NUM_DIR_LIGHT_SHADOWS > 0
		#pragma unroll_loop_start
		for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {
			shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 );
			vDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition;
		}
		#pragma unroll_loop_end
	#endif
	#if NUM_POINT_LIGHT_SHADOWS > 0
		#pragma unroll_loop_start
		for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {
			shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 );
			vPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition;
		}
		#pragma unroll_loop_end
	#endif
#endif
#if NUM_SPOT_LIGHT_COORDS > 0
	#pragma unroll_loop_start
	for ( int i = 0; i < NUM_SPOT_LIGHT_COORDS; i ++ ) {
		shadowWorldPosition = worldPosition;
		#if ( defined( USE_SHADOWMAP ) && UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )
			shadowWorldPosition.xyz += shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias;
		#endif
		vSpotLightCoord[ i ] = spotLightMatrix[ i ] * shadowWorldPosition;
	}
	#pragma unroll_loop_end
#endif`,iko=`float getShadowMask() {
	float shadow = 1.0;
	#ifdef USE_SHADOWMAP
	#if NUM_DIR_LIGHT_SHADOWS > 0
	DirectionalLightShadow directionalLight;
	#pragma unroll_loop_start
	for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {
		directionalLight = directionalLightShadows[ i ];
		shadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;
	}
	#pragma unroll_loop_end
	#endif
	#if NUM_SPOT_LIGHT_SHADOWS > 0
	SpotLightShadow spotLight;
	#pragma unroll_loop_start
	for ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {
		spotLight = spotLightShadows[ i ];
		shadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;
	}
	#pragma unroll_loop_end
	#endif
	#if NUM_POINT_LIGHT_SHADOWS > 0
	PointLightShadow pointLight;
	#pragma unroll_loop_start
	for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {
		pointLight = pointLightShadows[ i ];
		shadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;
	}
	#pragma unroll_loop_end
	#endif
	#endif
	return shadow;
}`,sko=`#ifdef USE_SKINNING
	mat4 boneMatX = getBoneMatrix( skinIndex.x );
	mat4 boneMatY = getBoneMatrix( skinIndex.y );
	mat4 boneMatZ = getBoneMatrix( skinIndex.z );
	mat4 boneMatW = getBoneMatrix( skinIndex.w );
#endif`,ako=`#ifdef USE_SKINNING
	uniform mat4 bindMatrix;
	uniform mat4 bindMatrixInverse;
	uniform highp sampler2D boneTexture;
	mat4 getBoneMatrix( const in float i ) {
		int size = textureSize( boneTexture, 0 ).x;
		int j = int( i ) * 4;
		int x = j % size;
		int y = j / size;
		vec4 v1 = texelFetch( boneTexture, ivec2( x, y ), 0 );
		vec4 v2 = texelFetch( boneTexture, ivec2( x + 1, y ), 0 );
		vec4 v3 = texelFetch( boneTexture, ivec2( x + 2, y ), 0 );
		vec4 v4 = texelFetch( boneTexture, ivec2( x + 3, y ), 0 );
		return mat4( v1, v2, v3, v4 );
	}
#endif`,cko=`#ifdef USE_SKINNING
	vec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );
	vec4 skinned = vec4( 0.0 );
	skinned += boneMatX * skinVertex * skinWeight.x;
	skinned += boneMatY * skinVertex * skinWeight.y;
	skinned += boneMatZ * skinVertex * skinWeight.z;
	skinned += boneMatW * skinVertex * skinWeight.w;
	transformed = ( bindMatrixInverse * skinned ).xyz;
#endif`,lko=`#ifdef USE_SKINNING
	mat4 skinMatrix = mat4( 0.0 );
	skinMatrix += skinWeight.x * boneMatX;
	skinMatrix += skinWeight.y * boneMatY;
	skinMatrix += skinWeight.z * boneMatZ;
	skinMatrix += skinWeight.w * boneMatW;
	skinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;
	objectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;
	#ifdef USE_TANGENT
		objectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz;
	#endif
#endif`,hko=`float specularStrength;
#ifdef USE_SPECULARMAP
	vec4 texelSpecular = texture2D( specularMap, vSpecularMapUv );
	specularStrength = texelSpecular.r;
#else
	specularStrength = 1.0;
#endif`,dko=`#ifdef USE_SPECULARMAP
	uniform sampler2D specularMap;
#endif`,uko=`#if defined( TONE_MAPPING )
	gl_FragColor.rgb = toneMapping( gl_FragColor.rgb );
#endif`,pko=`#ifndef saturate
#define saturate( a ) clamp( a, 0.0, 1.0 )
#endif
uniform float toneMappingExposure;
vec3 LinearToneMapping( vec3 color ) {
	return saturate( toneMappingExposure * color );
}
vec3 ReinhardToneMapping( vec3 color ) {
	color *= toneMappingExposure;
	return saturate( color / ( vec3( 1.0 ) + color ) );
}
vec3 OptimizedCineonToneMapping( vec3 color ) {
	color *= toneMappingExposure;
	color = max( vec3( 0.0 ), color - 0.004 );
	return pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );
}
vec3 RRTAndODTFit( vec3 v ) {
	vec3 a = v * ( v + 0.0245786 ) - 0.000090537;
	vec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081;
	return a / b;
}
vec3 ACESFilmicToneMapping( vec3 color ) {
	const mat3 ACESInputMat = mat3(
		vec3( 0.59719, 0.07600, 0.02840 ),		vec3( 0.35458, 0.90834, 0.13383 ),
		vec3( 0.04823, 0.01566, 0.83777 )
	);
	const mat3 ACESOutputMat = mat3(
		vec3(  1.60475, -0.10208, -0.00327 ),		vec3( -0.53108,  1.10813, -0.07276 ),
		vec3( -0.07367, -0.00605,  1.07602 )
	);
	color *= toneMappingExposure / 0.6;
	color = ACESInputMat * color;
	color = RRTAndODTFit( color );
	color = ACESOutputMat * color;
	return saturate( color );
}
const mat3 LINEAR_REC2020_TO_LINEAR_SRGB = mat3(
	vec3( 1.6605, - 0.1246, - 0.0182 ),
	vec3( - 0.5876, 1.1329, - 0.1006 ),
	vec3( - 0.0728, - 0.0083, 1.1187 )
);
const mat3 LINEAR_SRGB_TO_LINEAR_REC2020 = mat3(
	vec3( 0.6274, 0.0691, 0.0164 ),
	vec3( 0.3293, 0.9195, 0.0880 ),
	vec3( 0.0433, 0.0113, 0.8956 )
);
vec3 agxDefaultContrastApprox( vec3 x ) {
	vec3 x2 = x * x;
	vec3 x4 = x2 * x2;
	return + 15.5 * x4 * x2
		- 40.14 * x4 * x
		+ 31.96 * x4
		- 6.868 * x2 * x
		+ 0.4298 * x2
		+ 0.1191 * x
		- 0.00232;
}
vec3 AgXToneMapping( vec3 color ) {
	const mat3 AgXInsetMatrix = mat3(
		vec3( 0.856627153315983, 0.137318972929847, 0.11189821299995 ),
		vec3( 0.0951212405381588, 0.761241990602591, 0.0767994186031903 ),
		vec3( 0.0482516061458583, 0.101439036467562, 0.811302368396859 )
	);
	const mat3 AgXOutsetMatrix = mat3(
		vec3( 1.1271005818144368, - 0.1413297634984383, - 0.14132976349843826 ),
		vec3( - 0.11060664309660323, 1.157823702216272, - 0.11060664309660294 ),
		vec3( - 0.016493938717834573, - 0.016493938717834257, 1.2519364065950405 )
	);
	const float AgxMinEv = - 12.47393;	const float AgxMaxEv = 4.026069;
	color *= toneMappingExposure;
	color = LINEAR_SRGB_TO_LINEAR_REC2020 * color;
	color = AgXInsetMatrix * color;
	color = max( color, 1e-10 );	color = log2( color );
	color = ( color - AgxMinEv ) / ( AgxMaxEv - AgxMinEv );
	color = clamp( color, 0.0, 1.0 );
	color = agxDefaultContrastApprox( color );
	color = AgXOutsetMatrix * color;
	color = pow( max( vec3( 0.0 ), color ), vec3( 2.2 ) );
	color = LINEAR_REC2020_TO_LINEAR_SRGB * color;
	color = clamp( color, 0.0, 1.0 );
	return color;
}
vec3 NeutralToneMapping( vec3 color ) {
	const float StartCompression = 0.8 - 0.04;
	const float Desaturation = 0.15;
	color *= toneMappingExposure;
	float x = min( color.r, min( color.g, color.b ) );
	float offset = x < 0.08 ? x - 6.25 * x * x : 0.04;
	color -= offset;
	float peak = max( color.r, max( color.g, color.b ) );
	if ( peak < StartCompression ) return color;
	float d = 1. - StartCompression;
	float newPeak = 1. - d * d / ( peak + d - StartCompression );
	color *= newPeak / peak;
	float g = 1. - 1. / ( Desaturation * ( peak - newPeak ) + 1. );
	return mix( color, vec3( newPeak ), g );
}
vec3 CustomToneMapping( vec3 color ) { return color; }`,mko=`#ifdef USE_TRANSMISSION
	material.transmission = transmission;
	material.transmissionAlpha = 1.0;
	material.thickness = thickness;
	material.attenuationDistance = attenuationDistance;
	material.attenuationColor = attenuationColor;
	#ifdef USE_TRANSMISSIONMAP
		material.transmission *= texture2D( transmissionMap, vTransmissionMapUv ).r;
	#endif
	#ifdef USE_THICKNESSMAP
		material.thickness *= texture2D( thicknessMap, vThicknessMapUv ).g;
	#endif
	vec3 pos = vWorldPosition;
	vec3 v = normalize( cameraPosition - pos );
	vec3 n = inverseTransformDirection( normal, viewMatrix );
	vec4 transmitted = getIBLVolumeRefraction(
		n, v, material.roughness, material.diffuseColor, material.specularColor, material.specularF90,
		pos, modelMatrix, viewMatrix, projectionMatrix, material.dispersion, material.ior, material.thickness,
		material.attenuationColor, material.attenuationDistance );
	material.transmissionAlpha = mix( material.transmissionAlpha, transmitted.a, material.transmission );
	totalDiffuse = mix( totalDiffuse, transmitted.rgb, material.transmission );
#endif`,_ko=`#ifdef USE_TRANSMISSION
	uniform float transmission;
	uniform float thickness;
	uniform float attenuationDistance;
	uniform vec3 attenuationColor;
	#ifdef USE_TRANSMISSIONMAP
		uniform sampler2D transmissionMap;
	#endif
	#ifdef USE_THICKNESSMAP
		uniform sampler2D thicknessMap;
	#endif
	uniform vec2 transmissionSamplerSize;
	uniform sampler2D transmissionSamplerMap;
	uniform mat4 modelMatrix;
	uniform mat4 projectionMatrix;
	varying vec3 vWorldPosition;
	float w0( float a ) {
		return ( 1.0 / 6.0 ) * ( a * ( a * ( - a + 3.0 ) - 3.0 ) + 1.0 );
	}
	float w1( float a ) {
		return ( 1.0 / 6.0 ) * ( a *  a * ( 3.0 * a - 6.0 ) + 4.0 );
	}
	float w2( float a ){
		return ( 1.0 / 6.0 ) * ( a * ( a * ( - 3.0 * a + 3.0 ) + 3.0 ) + 1.0 );
	}
	float w3( float a ) {
		return ( 1.0 / 6.0 ) * ( a * a * a );
	}
	float g0( float a ) {
		return w0( a ) + w1( a );
	}
	float g1( float a ) {
		return w2( a ) + w3( a );
	}
	float h0( float a ) {
		return - 1.0 + w1( a ) / ( w0( a ) + w1( a ) );
	}
	float h1( float a ) {
		return 1.0 + w3( a ) / ( w2( a ) + w3( a ) );
	}
	vec4 bicubic( sampler2D tex, vec2 uv, vec4 texelSize, float lod ) {
		uv = uv * texelSize.zw + 0.5;
		vec2 iuv = floor( uv );
		vec2 fuv = fract( uv );
		float g0x = g0( fuv.x );
		float g1x = g1( fuv.x );
		float h0x = h0( fuv.x );
		float h1x = h1( fuv.x );
		float h0y = h0( fuv.y );
		float h1y = h1( fuv.y );
		vec2 p0 = ( vec2( iuv.x + h0x, iuv.y + h0y ) - 0.5 ) * texelSize.xy;
		vec2 p1 = ( vec2( iuv.x + h1x, iuv.y + h0y ) - 0.5 ) * texelSize.xy;
		vec2 p2 = ( vec2( iuv.x + h0x, iuv.y + h1y ) - 0.5 ) * texelSize.xy;
		vec2 p3 = ( vec2( iuv.x + h1x, iuv.y + h1y ) - 0.5 ) * texelSize.xy;
		return g0( fuv.y ) * ( g0x * textureLod( tex, p0, lod ) + g1x * textureLod( tex, p1, lod ) ) +
			g1( fuv.y ) * ( g0x * textureLod( tex, p2, lod ) + g1x * textureLod( tex, p3, lod ) );
	}
	vec4 textureBicubic( sampler2D sampler, vec2 uv, float lod ) {
		vec2 fLodSize = vec2( textureSize( sampler, int( lod ) ) );
		vec2 cLodSize = vec2( textureSize( sampler, int( lod + 1.0 ) ) );
		vec2 fLodSizeInv = 1.0 / fLodSize;
		vec2 cLodSizeInv = 1.0 / cLodSize;
		vec4 fSample = bicubic( sampler, uv, vec4( fLodSizeInv, fLodSize ), floor( lod ) );
		vec4 cSample = bicubic( sampler, uv, vec4( cLodSizeInv, cLodSize ), ceil( lod ) );
		return mix( fSample, cSample, fract( lod ) );
	}
	vec3 getVolumeTransmissionRay( const in vec3 n, const in vec3 v, const in float thickness, const in float ior, const in mat4 modelMatrix ) {
		vec3 refractionVector = refract( - v, normalize( n ), 1.0 / ior );
		vec3 modelScale;
		modelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) );
		modelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) );
		modelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) );
		return normalize( refractionVector ) * thickness * modelScale;
	}
	float applyIorToRoughness( const in float roughness, const in float ior ) {
		return roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 );
	}
	vec4 getTransmissionSample( const in vec2 fragCoord, const in float roughness, const in float ior ) {
		float lod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior );
		return textureBicubic( transmissionSamplerMap, fragCoord.xy, lod );
	}
	vec3 volumeAttenuation( const in float transmissionDistance, const in vec3 attenuationColor, const in float attenuationDistance ) {
		if ( isinf( attenuationDistance ) ) {
			return vec3( 1.0 );
		} else {
			vec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance;
			vec3 transmittance = exp( - attenuationCoefficient * transmissionDistance );			return transmittance;
		}
	}
	vec4 getIBLVolumeRefraction( const in vec3 n, const in vec3 v, const in float roughness, const in vec3 diffuseColor,
		const in vec3 specularColor, const in float specularF90, const in vec3 position, const in mat4 modelMatrix,
		const in mat4 viewMatrix, const in mat4 projMatrix, const in float dispersion, const in float ior, const in float thickness,
		const in vec3 attenuationColor, const in float attenuationDistance ) {
		vec4 transmittedLight;
		vec3 transmittance;
		#ifdef USE_DISPERSION
			float halfSpread = ( ior - 1.0 ) * 0.025 * dispersion;
			vec3 iors = vec3( ior - halfSpread, ior, ior + halfSpread );
			for ( int i = 0; i < 3; i ++ ) {
				vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, iors[ i ], modelMatrix );
				vec3 refractedRayExit = position + transmissionRay;
		
				vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );
				vec2 refractionCoords = ndcPos.xy / ndcPos.w;
				refractionCoords += 1.0;
				refractionCoords /= 2.0;
		
				vec4 transmissionSample = getTransmissionSample( refractionCoords, roughness, iors[ i ] );
				transmittedLight[ i ] = transmissionSample[ i ];
				transmittedLight.a += transmissionSample.a;
				transmittance[ i ] = diffuseColor[ i ] * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance )[ i ];
			}
			transmittedLight.a /= 3.0;
		
		#else
		
			vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix );
			vec3 refractedRayExit = position + transmissionRay;
			vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );
			vec2 refractionCoords = ndcPos.xy / ndcPos.w;
			refractionCoords += 1.0;
			refractionCoords /= 2.0;
			transmittedLight = getTransmissionSample( refractionCoords, roughness, ior );
			transmittance = diffuseColor * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance );
		
		#endif
		vec3 attenuatedColor = transmittance * transmittedLight.rgb;
		vec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness );
		float transmittanceFactor = ( transmittance.r + transmittance.g + transmittance.b ) / 3.0;
		return vec4( ( 1.0 - F ) * attenuatedColor, 1.0 - ( 1.0 - transmittedLight.a ) * transmittanceFactor );
	}
#endif`,gko=`#if defined( USE_UV ) || defined( USE_ANISOTROPY )
	varying vec2 vUv;
#endif
#ifdef USE_MAP
	varying vec2 vMapUv;
#endif
#ifdef USE_ALPHAMAP
	varying vec2 vAlphaMapUv;
#endif
#ifdef USE_LIGHTMAP
	varying vec2 vLightMapUv;
#endif
#ifdef USE_AOMAP
	varying vec2 vAoMapUv;
#endif
#ifdef USE_BUMPMAP
	varying vec2 vBumpMapUv;
#endif
#ifdef USE_NORMALMAP
	varying vec2 vNormalMapUv;
#endif
#ifdef USE_EMISSIVEMAP
	varying vec2 vEmissiveMapUv;
#endif
#ifdef USE_METALNESSMAP
	varying vec2 vMetalnessMapUv;
#endif
#ifdef USE_ROUGHNESSMAP
	varying vec2 vRoughnessMapUv;
#endif
#ifdef USE_ANISOTROPYMAP
	varying vec2 vAnisotropyMapUv;
#endif
#ifdef USE_CLEARCOATMAP
	varying vec2 vClearcoatMapUv;
#endif
#ifdef USE_CLEARCOAT_NORMALMAP
	varying vec2 vClearcoatNormalMapUv;
#endif
#ifdef USE_CLEARCOAT_ROUGHNESSMAP
	varying vec2 vClearcoatRoughnessMapUv;
#endif
#ifdef USE_IRIDESCENCEMAP
	varying vec2 vIridescenceMapUv;
#endif
#ifdef USE_IRIDESCENCE_THICKNESSMAP
	varying vec2 vIridescenceThicknessMapUv;
#endif
#ifdef USE_SHEEN_COLORMAP
	varying vec2 vSheenColorMapUv;
#endif
#ifdef USE_SHEEN_ROUGHNESSMAP
	varying vec2 vSheenRoughnessMapUv;
#endif
#ifdef USE_SPECULARMAP
	varying vec2 vSpecularMapUv;
#endif
#ifdef USE_SPECULAR_COLORMAP
	varying vec2 vSpecularColorMapUv;
#endif
#ifdef USE_SPECULAR_INTENSITYMAP
	varying vec2 vSpecularIntensityMapUv;
#endif
#ifdef USE_TRANSMISSIONMAP
	uniform mat3 transmissionMapTransform;
	varying vec2 vTransmissionMapUv;
#endif
#ifdef USE_THICKNESSMAP
	uniform mat3 thicknessMapTransform;
	varying vec2 vThicknessMapUv;
#endif`,Ako=`#if defined( USE_UV ) || defined( USE_ANISOTROPY )
	varying vec2 vUv;
#endif
#ifdef USE_MAP
	uniform mat3 mapTransform;
	varying vec2 vMapUv;
#endif
#ifdef USE_ALPHAMAP
	uniform mat3 alphaMapTransform;
	varying vec2 vAlphaMapUv;
#endif
#ifdef USE_LIGHTMAP
	uniform mat3 lightMapTransform;
	varying vec2 vLightMapUv;
#endif
#ifdef USE_AOMAP
	uniform mat3 aoMapTransform;
	varying vec2 vAoMapUv;
#endif
#ifdef USE_BUMPMAP
	uniform mat3 bumpMapTransform;
	varying vec2 vBumpMapUv;
#endif
#ifdef USE_NORMALMAP
	uniform mat3 normalMapTransform;
	varying vec2 vNormalMapUv;
#endif
#ifdef USE_DISPLACEMENTMAP
	uniform mat3 displacementMapTransform;
	varying vec2 vDisplacementMapUv;
#endif
#ifdef USE_EMISSIVEMAP
	uniform mat3 emissiveMapTransform;
	varying vec2 vEmissiveMapUv;
#endif
#ifdef USE_METALNESSMAP
	uniform mat3 metalnessMapTransform;
	varying vec2 vMetalnessMapUv;
#endif
#ifdef USE_ROUGHNESSMAP
	uniform mat3 roughnessMapTransform;
	varying vec2 vRoughnessMapUv;
#endif
#ifdef USE_ANISOTROPYMAP
	uniform mat3 anisotropyMapTransform;
	varying vec2 vAnisotropyMapUv;
#endif
#ifdef USE_CLEARCOATMAP
	uniform mat3 clearcoatMapTransform;
	varying vec2 vClearcoatMapUv;
#endif
#ifdef USE_CLEARCOAT_NORMALMAP
	uniform mat3 clearcoatNormalMapTransform;
	varying vec2 vClearcoatNormalMapUv;
#endif
#ifdef USE_CLEARCOAT_ROUGHNESSMAP
	uniform mat3 clearcoatRoughnessMapTransform;
	varying vec2 vClearcoatRoughnessMapUv;
#endif
#ifdef USE_SHEEN_COLORMAP
	uniform mat3 sheenColorMapTransform;
	varying vec2 vSheenColorMapUv;
#endif
#ifdef USE_SHEEN_ROUGHNESSMAP
	uniform mat3 sheenRoughnessMapTransform;
	varying vec2 vSheenRoughnessMapUv;
#endif
#ifdef USE_IRIDESCENCEMAP
	uniform mat3 iridescenceMapTransform;
	varying vec2 vIridescenceMapUv;
#endif
#ifdef USE_IRIDESCENCE_THICKNESSMAP
	uniform mat3 iridescenceThicknessMapTransform;
	varying vec2 vIridescenceThicknessMapUv;
#endif
#ifdef USE_SPECULARMAP
	uniform mat3 specularMapTransform;
	varying vec2 vSpecularMapUv;
#endif
#ifdef USE_SPECULAR_COLORMAP
	uniform mat3 specularColorMapTransform;
	varying vec2 vSpecularColorMapUv;
#endif
#ifdef USE_SPECULAR_INTENSITYMAP
	uniform mat3 specularIntensityMapTransform;
	varying vec2 vSpecularIntensityMapUv;
#endif
#ifdef USE_TRANSMISSIONMAP
	uniform mat3 transmissionMapTransform;
	varying vec2 vTransmissionMapUv;
#endif
#ifdef USE_THICKNESSMAP
	uniform mat3 thicknessMapTransform;
	varying vec2 vThicknessMapUv;
#endif`,fko=`#if defined( USE_UV ) || defined( USE_ANISOTROPY )
	vUv = vec3( uv, 1 ).xy;
#endif
#ifdef USE_MAP
	vMapUv = ( mapTransform * vec3( MAP_UV, 1 ) ).xy;
#endif
#ifdef USE_ALPHAMAP
	vAlphaMapUv = ( alphaMapTransform * vec3( ALPHAMAP_UV, 1 ) ).xy;
#endif
#ifdef USE_LIGHTMAP
	vLightMapUv = ( lightMapTransform * vec3( LIGHTMAP_UV, 1 ) ).xy;
#endif
#ifdef USE_AOMAP
	vAoMapUv = ( aoMapTransform * vec3( AOMAP_UV, 1 ) ).xy;
#endif
#ifdef USE_BUMPMAP
	vBumpMapUv = ( bumpMapTransform * vec3( BUMPMAP_UV, 1 ) ).xy;
#endif
#ifdef USE_NORMALMAP
	vNormalMapUv = ( normalMapTransform * vec3( NORMALMAP_UV, 1 ) ).xy;
#endif
#ifdef USE_DISPLACEMENTMAP
	vDisplacementMapUv = ( displacementMapTransform * vec3( DISPLACEMENTMAP_UV, 1 ) ).xy;
#endif
#ifdef USE_EMISSIVEMAP
	vEmissiveMapUv = ( emissiveMapTransform * vec3( EMISSIVEMAP_UV, 1 ) ).xy;
#endif
#ifdef USE_METALNESSMAP
	vMetalnessMapUv = ( metalnessMapTransform * vec3( METALNESSMAP_UV, 1 ) ).xy;
#endif
#ifdef USE_ROUGHNESSMAP
	vRoughnessMapUv = ( roughnessMapTransform * vec3( ROUGHNESSMAP_UV, 1 ) ).xy;
#endif
#ifdef USE_ANISOTROPYMAP
	vAnisotropyMapUv = ( anisotropyMapTransform * vec3( ANISOTROPYMAP_UV, 1 ) ).xy;
#endif
#ifdef USE_CLEARCOATMAP
	vClearcoatMapUv = ( clearcoatMapTransform * vec3( CLEARCOATMAP_UV, 1 ) ).xy;
#endif
#ifdef USE_CLEARCOAT_NORMALMAP
	vClearcoatNormalMapUv = ( clearcoatNormalMapTransform * vec3( CLEARCOAT_NORMALMAP_UV, 1 ) ).xy;
#endif
#ifdef USE_CLEARCOAT_ROUGHNESSMAP
	vClearcoatRoughnessMapUv = ( clearcoatRoughnessMapTransform * vec3( CLEARCOAT_ROUGHNESSMAP_UV, 1 ) ).xy;
#endif
#ifdef USE_IRIDESCENCEMAP
	vIridescenceMapUv = ( iridescenceMapTransform * vec3( IRIDESCENCEMAP_UV, 1 ) ).xy;
#endif
#ifdef USE_IRIDESCENCE_THICKNESSMAP
	vIridescenceThicknessMapUv = ( iridescenceThicknessMapTransform * vec3( IRIDESCENCE_THICKNESSMAP_UV, 1 ) ).xy;
#endif
#ifdef USE_SHEEN_COLORMAP
	vSheenColorMapUv = ( sheenColorMapTransform * vec3( SHEEN_COLORMAP_UV, 1 ) ).xy;
#endif
#ifdef USE_SHEEN_ROUGHNESSMAP
	vSheenRoughnessMapUv = ( sheenRoughnessMapTransform * vec3( SHEEN_ROUGHNESSMAP_UV, 1 ) ).xy;
#endif
#ifdef USE_SPECULARMAP
	vSpecularMapUv = ( specularMapTransform * vec3( SPECULARMAP_UV, 1 ) ).xy;
#endif
#ifdef USE_SPECULAR_COLORMAP
	vSpecularColorMapUv = ( specularColorMapTransform * vec3( SPECULAR_COLORMAP_UV, 1 ) ).xy;
#endif
#ifdef USE_SPECULAR_INTENSITYMAP
	vSpecularIntensityMapUv = ( specularIntensityMapTransform * vec3( SPECULAR_INTENSITYMAP_UV, 1 ) ).xy;
#endif
#ifdef USE_TRANSMISSIONMAP
	vTransmissionMapUv = ( transmissionMapTransform * vec3( TRANSMISSIONMAP_UV, 1 ) ).xy;
#endif
#ifdef USE_THICKNESSMAP
	vThicknessMapUv = ( thicknessMapTransform * vec3( THICKNESSMAP_UV, 1 ) ).xy;
#endif`,yko=`#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0
	vec4 worldPosition = vec4( transformed, 1.0 );
	#ifdef USE_BATCHING
		worldPosition = batchingMatrix * worldPosition;
	#endif
	#ifdef USE_INSTANCING
		worldPosition = instanceMatrix * worldPosition;
	#endif
	worldPosition = modelMatrix * worldPosition;
#endif`,xko=`varying vec2 vUv;
uniform mat3 uvTransform;
void main() {
	vUv = ( uvTransform * vec3( uv, 1 ) ).xy;
	gl_Position = vec4( position.xy, 1.0, 1.0 );
}`,Cko=`uniform sampler2D t2D;
uniform float backgroundIntensity;
varying vec2 vUv;
void main() {
	vec4 texColor = texture2D( t2D, vUv );
	#ifdef DECODE_VIDEO_TEXTURE
		texColor = vec4( mix( pow( texColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), texColor.rgb * 0.0773993808, vec3( lessThanEqual( texColor.rgb, vec3( 0.04045 ) ) ) ), texColor.w );
	#endif
	texColor.rgb *= backgroundIntensity;
	gl_FragColor = texColor;
	#include <tonemapping_fragment>
	#include <colorspace_fragment>
}`,bko=`varying vec3 vWorldDirection;
#include <common>
void main() {
	vWorldDirection = transformDirection( position, modelMatrix );
	#include <begin_vertex>
	#include <project_vertex>
	gl_Position.z = gl_Position.w;
}`,Iko=`#ifdef ENVMAP_TYPE_CUBE
	uniform samplerCube envMap;
#elif defined( ENVMAP_TYPE_CUBE_UV )
	uniform sampler2D envMap;
#endif
uniform float flipEnvMap;
uniform float backgroundBlurriness;
uniform float backgroundIntensity;
uniform mat3 backgroundRotation;
varying vec3 vWorldDirection;
#include <cube_uv_reflection_fragment>
void main() {
	#ifdef ENVMAP_TYPE_CUBE
		vec4 texColor = textureCube( envMap, backgroundRotation * vec3( flipEnvMap * vWorldDirection.x, vWorldDirection.yz ) );
	#elif defined( ENVMAP_TYPE_CUBE_UV )
		vec4 texColor = textureCubeUV( envMap, backgroundRotation * vWorldDirection, backgroundBlurriness );
	#else
		vec4 texColor = vec4( 0.0, 0.0, 0.0, 1.0 );
	#endif
	texColor.rgb *= backgroundIntensity;
	gl_FragColor = texColor;
	#include <tonemapping_fragment>
	#include <colorspace_fragment>
}`,vko=`varying vec3 vWorldDirection;
#include <common>
void main() {
	vWorldDirection = transformDirection( position, modelMatrix );
	#include <begin_vertex>
	#include <project_vertex>
	gl_Position.z = gl_Position.w;
}`,Sko=`uniform samplerCube tCube;
uniform float tFlip;
uniform float opacity;
varying vec3 vWorldDirection;
void main() {
	vec4 texColor = textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) );
	gl_FragColor = texColor;
	gl_FragColor.a *= opacity;
	#include <tonemapping_fragment>
	#include <colorspace_fragment>
}`,Pko=`#include <common>
#include <batching_pars_vertex>
#include <uv_pars_vertex>
#include <displacementmap_pars_vertex>
#include <morphtarget_pars_vertex>
#include <skinning_pars_vertex>
#include <logdepthbuf_pars_vertex>
#include <clipping_planes_pars_vertex>
varying vec2 vHighPrecisionZW;
void main() {
	#include <uv_vertex>
	#include <batching_vertex>
	#include <skinbase_vertex>
	#include <morphinstance_vertex>
	#ifdef USE_DISPLACEMENTMAP
		#include <beginnormal_vertex>
		#include <morphnormal_vertex>
		#include <skinnormal_vertex>
	#endif
	#include <begin_vertex>
	#include <morphtarget_vertex>
	#include <skinning_vertex>
	#include <displacementmap_vertex>
	#include <project_vertex>
	#include <logdepthbuf_vertex>
	#include <clipping_planes_vertex>
	vHighPrecisionZW = gl_Position.zw;
}`,Eko=`#if DEPTH_PACKING == 3200
	uniform float opacity;
#endif
#include <common>
#include <packing>
#include <uv_pars_fragment>
#include <map_pars_fragment>
#include <alphamap_pars_fragment>
#include <alphatest_pars_fragment>
#include <alphahash_pars_fragment>
#include <logdepthbuf_pars_fragment>
#include <clipping_planes_pars_fragment>
varying vec2 vHighPrecisionZW;
void main() {
	vec4 diffuseColor = vec4( 1.0 );
	#include <clipping_planes_fragment>
	#if DEPTH_PACKING == 3200
		diffuseColor.a = opacity;
	#endif
	#include <map_fragment>
	#include <alphamap_fragment>
	#include <alphatest_fragment>
	#include <alphahash_fragment>
	#include <logdepthbuf_fragment>
	float fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5;
	#if DEPTH_PACKING == 3200
		gl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );
	#elif DEPTH_PACKING == 3201
		gl_FragColor = packDepthToRGBA( fragCoordZ );
	#endif
}`,Mko=`#define DISTANCE
varying vec3 vWorldPosition;
#include <common>
#include <batching_pars_vertex>
#include <uv_pars_vertex>
#include <displacementmap_pars_vertex>
#include <morphtarget_pars_vertex>
#include <skinning_pars_vertex>
#include <clipping_planes_pars_vertex>
void main() {
	#include <uv_vertex>
	#include <batching_vertex>
	#include <skinbase_vertex>
	#include <morphinstance_vertex>
	#ifdef USE_DISPLACEMENTMAP
		#include <beginnormal_vertex>
		#include <morphnormal_vertex>
		#include <skinnormal_vertex>
	#endif
	#include <begin_vertex>
	#include <morphtarget_vertex>
	#include <skinning_vertex>
	#include <displacementmap_vertex>
	#include <project_vertex>
	#include <worldpos_vertex>
	#include <clipping_planes_vertex>
	vWorldPosition = worldPosition.xyz;
}`,wko=`#define DISTANCE
uniform vec3 referencePosition;
uniform float nearDistance;
uniform float farDistance;
varying vec3 vWorldPosition;
#include <common>
#include <packing>
#include <uv_pars_fragment>
#include <map_pars_fragment>
#include <alphamap_pars_fragment>
#include <alphatest_pars_fragment>
#include <alphahash_pars_fragment>
#include <clipping_planes_pars_fragment>
void main () {
	vec4 diffuseColor = vec4( 1.0 );
	#include <clipping_planes_fragment>
	#include <map_fragment>
	#include <alphamap_fragment>
	#include <alphatest_fragment>
	#include <alphahash_fragment>
	float dist = length( vWorldPosition - referencePosition );
	dist = ( dist - nearDistance ) / ( farDistance - nearDistance );
	dist = saturate( dist );
	gl_FragColor = packDepthToRGBA( dist );
}`,Bko=`varying vec3 vWorldDirection;
#include <common>
void main() {
	vWorldDirection = transformDirection( position, modelMatrix );
	#include <begin_vertex>
	#include <project_vertex>
}`,Tko=`uniform sampler2D tEquirect;
varying vec3 vWorldDirection;
#include <common>
void main() {
	vec3 direction = normalize( vWorldDirection );
	vec2 sampleUV = equirectUv( direction );
	gl_FragColor = texture2D( tEquirect, sampleUV );
	#include <tonemapping_fragment>
	#include <colorspace_fragment>
}`,Dko=`uniform float scale;
attribute float lineDistance;
varying float vLineDistance;
#include <common>
#include <uv_pars_vertex>
#include <color_pars_vertex>
#include <fog_pars_vertex>
#include <morphtarget_pars_vertex>
#include <logdepthbuf_pars_vertex>
#include <clipping_planes_pars_vertex>
void main() {
	vLineDistance = scale * lineDistance;
	#include <uv_vertex>
	#include <color_vertex>
	#include <morphinstance_vertex>
	#include <morphcolor_vertex>
	#include <begin_vertex>
	#include <morphtarget_vertex>
	#include <project_vertex>
	#include <logdepthbuf_vertex>
	#include <clipping_planes_vertex>
	#include <fog_vertex>
}`,Nko=`uniform vec3 diffuse;
uniform float opacity;
uniform float dashSize;
uniform float totalSize;
varying float vLineDistance;
#include <common>
#include <color_pars_fragment>
#include <uv_pars_fragment>
#include <map_pars_fragment>
#include <fog_pars_fragment>
#include <logdepthbuf_pars_fragment>
#include <clipping_planes_pars_fragment>
void main() {
	vec4 diffuseColor = vec4( diffuse, opacity );
	#include <clipping_planes_fragment>
	if ( mod( vLineDistance, totalSize ) > dashSize ) {
		discard;
	}
	vec3 outgoingLight = vec3( 0.0 );
	#include <logdepthbuf_fragment>
	#include <map_fragment>
	#include <color_fragment>
	outgoingLight = diffuseColor.rgb;
	#include <opaque_fragment>
	#include <tonemapping_fragment>
	#include <colorspace_fragment>
	#include <fog_fragment>
	#include <premultiplied_alpha_fragment>
}`,Rko=`#include <common>
#include <batching_pars_vertex>
#include <uv_pars_vertex>
#include <envmap_pars_vertex>
#include <color_pars_vertex>
#include <fog_pars_vertex>
#include <morphtarget_pars_vertex>
#include <skinning_pars_vertex>
#include <logdepthbuf_pars_vertex>
#include <clipping_planes_pars_vertex>
void main() {
	#include <uv_vertex>
	#include <color_vertex>
	#include <morphinstance_vertex>
	#include <morphcolor_vertex>
	#include <batching_vertex>
	#if defined ( USE_ENVMAP ) || defined ( USE_SKINNING )
		#include <beginnormal_vertex>
		#include <morphnormal_vertex>
		#include <skinbase_vertex>
		#include <skinnormal_vertex>
		#include <defaultnormal_vertex>
	#endif
	#include <begin_vertex>
	#include <morphtarget_vertex>
	#include <skinning_vertex>
	#include <project_vertex>
	#include <logdepthbuf_vertex>
	#include <clipping_planes_vertex>
	#include <worldpos_vertex>
	#include <envmap_vertex>
	#include <fog_vertex>
}`,Qko=`uniform vec3 diffuse;
uniform float opacity;
#ifndef FLAT_SHADED
	varying vec3 vNormal;
#endif
#include <common>
#include <dithering_pars_fragment>
#include <color_pars_fragment>
#include <uv_pars_fragment>
#include <map_pars_fragment>
#include <alphamap_pars_fragment>
#include <alphatest_pars_fragment>
#include <alphahash_pars_fragment>
#include <aomap_pars_fragment>
#include <lightmap_pars_fragment>
#include <envmap_common_pars_fragment>
#include <envmap_pars_fragment>
#include <fog_pars_fragment>
#include <specularmap_pars_fragment>
#include <logdepthbuf_pars_fragment>
#include <clipping_planes_pars_fragment>
void main() {
	vec4 diffuseColor = vec4( diffuse, opacity );
	#include <clipping_planes_fragment>
	#include <logdepthbuf_fragment>
	#include <map_fragment>
	#include <color_fragment>
	#include <alphamap_fragment>
	#include <alphatest_fragment>
	#include <alphahash_fragment>
	#include <specularmap_fragment>
	ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );
	#ifdef USE_LIGHTMAP
		vec4 lightMapTexel = texture2D( lightMap, vLightMapUv );
		reflectedLight.indirectDiffuse += lightMapTexel.rgb * lightMapIntensity * RECIPROCAL_PI;
	#else
		reflectedLight.indirectDiffuse += vec3( 1.0 );
	#endif
	#include <aomap_fragment>
	reflectedLight.indirectDiffuse *= diffuseColor.rgb;
	vec3 outgoingLight = reflectedLight.indirectDiffuse;
	#include <envmap_fragment>
	#include <opaque_fragment>
	#include <tonemapping_fragment>
	#include <colorspace_fragment>
	#include <fog_fragment>
	#include <premultiplied_alpha_fragment>
	#include <dithering_fragment>
}`,kko=`#define LAMBERT
varying vec3 vViewPosition;
#include <common>
#include <batching_pars_vertex>
#include <uv_pars_vertex>
#include <displacementmap_pars_vertex>
#include <envmap_pars_vertex>
#include <color_pars_vertex>
#include <fog_pars_vertex>
#include <normal_pars_vertex>
#include <morphtarget_pars_vertex>
#include <skinning_pars_vertex>
#include <shadowmap_pars_vertex>
#include <logdepthbuf_pars_vertex>
#include <clipping_planes_pars_vertex>
void main() {
	#include <uv_vertex>
	#include <color_vertex>
	#include <morphinstance_vertex>
	#include <morphcolor_vertex>
	#include <batching_vertex>
	#include <beginnormal_vertex>
	#include <morphnormal_vertex>
	#include <skinbase_vertex>
	#include <skinnormal_vertex>
	#include <defaultnormal_vertex>
	#include <normal_vertex>
	#include <begin_vertex>
	#include <morphtarget_vertex>
	#include <skinning_vertex>
	#include <displacementmap_vertex>
	#include <project_vertex>
	#include <logdepthbuf_vertex>
	#include <clipping_planes_vertex>
	vViewPosition = - mvPosition.xyz;
	#include <worldpos_vertex>
	#include <envmap_vertex>
	#include <shadowmap_vertex>
	#include <fog_vertex>
}`,Lko=`#define LAMBERT
uniform vec3 diffuse;
uniform vec3 emissive;
uniform float opacity;
#include <common>
#include <packing>
#include <dithering_pars_fragment>
#include <color_pars_fragment>
#include <uv_pars_fragment>
#include <map_pars_fragment>
#include <alphamap_pars_fragment>
#include <alphatest_pars_fragment>
#include <alphahash_pars_fragment>
#include <aomap_pars_fragment>
#include <lightmap_pars_fragment>
#include <emissivemap_pars_fragment>
#include <envmap_common_pars_fragment>
#include <envmap_pars_fragment>
#include <fog_pars_fragment>
#include <bsdfs>
#include <lights_pars_begin>
#include <normal_pars_fragment>
#include <lights_lambert_pars_fragment>
#include <shadowmap_pars_fragment>
#include <bumpmap_pars_fragment>
#include <normalmap_pars_fragment>
#include <specularmap_pars_fragment>
#include <logdepthbuf_pars_fragment>
#include <clipping_planes_pars_fragment>
void main() {
	vec4 diffuseColor = vec4( diffuse, opacity );
	#include <clipping_planes_fragment>
	ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );
	vec3 totalEmissiveRadiance = emissive;
	#include <logdepthbuf_fragment>
	#include <map_fragment>
	#include <color_fragment>
	#include <alphamap_fragment>
	#include <alphatest_fragment>
	#include <alphahash_fragment>
	#include <specularmap_fragment>
	#include <normal_fragment_begin>
	#include <normal_fragment_maps>
	#include <emissivemap_fragment>
	#include <lights_lambert_fragment>
	#include <lights_fragment_begin>
	#include <lights_fragment_maps>
	#include <lights_fragment_end>
	#include <aomap_fragment>
	vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;
	#include <envmap_fragment>
	#include <opaque_fragment>
	#include <tonemapping_fragment>
	#include <colorspace_fragment>
	#include <fog_fragment>
	#include <premultiplied_alpha_fragment>
	#include <dithering_fragment>
}`,Hko=`#define MATCAP
varying vec3 vViewPosition;
#include <common>
#include <batching_pars_vertex>
#include <uv_pars_vertex>
#include <color_pars_vertex>
#include <displacementmap_pars_vertex>
#include <fog_pars_vertex>
#include <normal_pars_vertex>
#include <morphtarget_pars_vertex>
#include <skinning_pars_vertex>
#include <logdepthbuf_pars_vertex>
#include <clipping_planes_pars_vertex>
void main() {
	#include <uv_vertex>
	#include <color_vertex>
	#include <morphinstance_vertex>
	#include <morphcolor_vertex>
	#include <batching_vertex>
	#include <beginnormal_vertex>
	#include <morphnormal_vertex>
	#include <skinbase_vertex>
	#include <skinnormal_vertex>
	#include <defaultnormal_vertex>
	#include <normal_vertex>
	#include <begin_vertex>
	#include <morphtarget_vertex>
	#include <skinning_vertex>
	#include <displacementmap_vertex>
	#include <project_vertex>
	#include <logdepthbuf_vertex>
	#include <clipping_planes_vertex>
	#include <fog_vertex>
	vViewPosition = - mvPosition.xyz;
}`,Fko=`#define MATCAP
uniform vec3 diffuse;
uniform float opacity;
uniform sampler2D matcap;
varying vec3 vViewPosition;
#include <common>
#include <dithering_pars_fragment>
#include <color_pars_fragment>
#include <uv_pars_fragment>
#include <map_pars_fragment>
#include <alphamap_pars_fragment>
#include <alphatest_pars_fragment>
#include <alphahash_pars_fragment>
#include <fog_pars_fragment>
#include <normal_pars_fragment>
#include <bumpmap_pars_fragment>
#include <normalmap_pars_fragment>
#include <logdepthbuf_pars_fragment>
#include <clipping_planes_pars_fragment>
void main() {
	vec4 diffuseColor = vec4( diffuse, opacity );
	#include <clipping_planes_fragment>
	#include <logdepthbuf_fragment>
	#include <map_fragment>
	#include <color_fragment>
	#include <alphamap_fragment>
	#include <alphatest_fragment>
	#include <alphahash_fragment>
	#include <normal_fragment_begin>
	#include <normal_fragment_maps>
	vec3 viewDir = normalize( vViewPosition );
	vec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) );
	vec3 y = cross( viewDir, x );
	vec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5;
	#ifdef USE_MATCAP
		vec4 matcapColor = texture2D( matcap, uv );
	#else
		vec4 matcapColor = vec4( vec3( mix( 0.2, 0.8, uv.y ) ), 1.0 );
	#endif
	vec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb;
	#include <opaque_fragment>
	#include <tonemapping_fragment>
	#include <colorspace_fragment>
	#include <fog_fragment>
	#include <premultiplied_alpha_fragment>
	#include <dithering_fragment>
}`,zko=`#define NORMAL
#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )
	varying vec3 vViewPosition;
#endif
#include <common>
#include <batching_pars_vertex>
#include <uv_pars_vertex>
#include <displacementmap_pars_vertex>
#include <normal_pars_vertex>
#include <morphtarget_pars_vertex>
#include <skinning_pars_vertex>
#include <logdepthbuf_pars_vertex>
#include <clipping_planes_pars_vertex>
void main() {
	#include <uv_vertex>
	#include <batching_vertex>
	#include <beginnormal_vertex>
	#include <morphinstance_vertex>
	#include <morphnormal_vertex>
	#include <skinbase_vertex>
	#include <skinnormal_vertex>
	#include <defaultnormal_vertex>
	#include <normal_vertex>
	#include <begin_vertex>
	#include <morphtarget_vertex>
	#include <skinning_vertex>
	#include <displacementmap_vertex>
	#include <project_vertex>
	#include <logdepthbuf_vertex>
	#include <clipping_planes_vertex>
#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )
	vViewPosition = - mvPosition.xyz;
#endif
}`,Oko=`#define NORMAL
uniform float opacity;
#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )
	varying vec3 vViewPosition;
#endif
#include <packing>
#include <uv_pars_fragment>
#include <normal_pars_fragment>
#include <bumpmap_pars_fragment>
#include <normalmap_pars_fragment>
#include <logdepthbuf_pars_fragment>
#include <clipping_planes_pars_fragment>
void main() {
	vec4 diffuseColor = vec4( 0.0, 0.0, 0.0, opacity );
	#include <clipping_planes_fragment>
	#include <logdepthbuf_fragment>
	#include <normal_fragment_begin>
	#include <normal_fragment_maps>
	gl_FragColor = vec4( packNormalToRGB( normal ), diffuseColor.a );
	#ifdef OPAQUE
		gl_FragColor.a = 1.0;
	#endif
}`,Vko=`#define PHONG
varying vec3 vViewPosition;
#include <common>
#include <batching_pars_vertex>
#include <uv_pars_vertex>
#include <displacementmap_pars_vertex>
#include <envmap_pars_vertex>
#include <color_pars_vertex>
#include <fog_pars_vertex>
#include <normal_pars_vertex>
#include <morphtarget_pars_vertex>
#include <skinning_pars_vertex>
#include <shadowmap_pars_vertex>
#include <logdepthbuf_pars_vertex>
#include <clipping_planes_pars_vertex>
void main() {
	#include <uv_vertex>
	#include <color_vertex>
	#include <morphcolor_vertex>
	#include <batching_vertex>
	#include <beginnormal_vertex>
	#include <morphinstance_vertex>
	#include <morphnormal_vertex>
	#include <skinbase_vertex>
	#include <skinnormal_vertex>
	#include <defaultnormal_vertex>
	#include <normal_vertex>
	#include <begin_vertex>
	#include <morphtarget_vertex>
	#include <skinning_vertex>
	#include <displacementmap_vertex>
	#include <project_vertex>
	#include <logdepthbuf_vertex>
	#include <clipping_planes_vertex>
	vViewPosition = - mvPosition.xyz;
	#include <worldpos_vertex>
	#include <envmap_vertex>
	#include <shadowmap_vertex>
	#include <fog_vertex>
}`,Yko=`#define PHONG
uniform vec3 diffuse;
uniform vec3 emissive;
uniform vec3 specular;
uniform float shininess;
uniform float opacity;
#include <common>
#include <packing>
#include <dithering_pars_fragment>
#include <color_pars_fragment>
#include <uv_pars_fragment>
#include <map_pars_fragment>
#include <alphamap_pars_fragment>
#include <alphatest_pars_fragment>
#include <alphahash_pars_fragment>
#include <aomap_pars_fragment>
#include <lightmap_pars_fragment>
#include <emissivemap_pars_fragment>
#include <envmap_common_pars_fragment>
#include <envmap_pars_fragment>
#include <fog_pars_fragment>
#include <bsdfs>
#include <lights_pars_begin>
#include <normal_pars_fragment>
#include <lights_phong_pars_fragment>
#include <shadowmap_pars_fragment>
#include <bumpmap_pars_fragment>
#include <normalmap_pars_fragment>
#include <specularmap_pars_fragment>
#include <logdepthbuf_pars_fragment>
#include <clipping_planes_pars_fragment>
void main() {
	vec4 diffuseColor = vec4( diffuse, opacity );
	#include <clipping_planes_fragment>
	ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );
	vec3 totalEmissiveRadiance = emissive;
	#include <logdepthbuf_fragment>
	#include <map_fragment>
	#include <color_fragment>
	#include <alphamap_fragment>
	#include <alphatest_fragment>
	#include <alphahash_fragment>
	#include <specularmap_fragment>
	#include <normal_fragment_begin>
	#include <normal_fragment_maps>
	#include <emissivemap_fragment>
	#include <lights_phong_fragment>
	#include <lights_fragment_begin>
	#include <lights_fragment_maps>
	#include <lights_fragment_end>
	#include <aomap_fragment>
	vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;
	#include <envmap_fragment>
	#include <opaque_fragment>
	#include <tonemapping_fragment>
	#include <colorspace_fragment>
	#include <fog_fragment>
	#include <premultiplied_alpha_fragment>
	#include <dithering_fragment>
}`,Gko=`#define STANDARD
varying vec3 vViewPosition;
#ifdef USE_TRANSMISSION
	varying vec3 vWorldPosition;
#endif
#include <common>
#include <batching_pars_vertex>
#include <uv_pars_vertex>
#include <displacementmap_pars_vertex>
#include <color_pars_vertex>
#include <fog_pars_vertex>
#include <normal_pars_vertex>
#include <morphtarget_pars_vertex>
#include <skinning_pars_vertex>
#include <shadowmap_pars_vertex>
#include <logdepthbuf_pars_vertex>
#include <clipping_planes_pars_vertex>
void main() {
	#include <uv_vertex>
	#include <color_vertex>
	#include <morphinstance_vertex>
	#include <morphcolor_vertex>
	#include <batching_vertex>
	#include <beginnormal_vertex>
	#include <morphnormal_vertex>
	#include <skinbase_vertex>
	#include <skinnormal_vertex>
	#include <defaultnormal_vertex>
	#include <normal_vertex>
	#include <begin_vertex>
	#include <morphtarget_vertex>
	#include <skinning_vertex>
	#include <displacementmap_vertex>
	#include <project_vertex>
	#include <logdepthbuf_vertex>
	#include <clipping_planes_vertex>
	vViewPosition = - mvPosition.xyz;
	#include <worldpos_vertex>
	#include <shadowmap_vertex>
	#include <fog_vertex>
#ifdef USE_TRANSMISSION
	vWorldPosition = worldPosition.xyz;
#endif
}`,Uko=`#define STANDARD
#ifdef PHYSICAL
	#define IOR
	#define USE_SPECULAR
#endif
uniform vec3 diffuse;
uniform vec3 emissive;
uniform float roughness;
uniform float metalness;
uniform float opacity;
#ifdef IOR
	uniform float ior;
#endif
#ifdef USE_SPECULAR
	uniform float specularIntensity;
	uniform vec3 specularColor;
	#ifdef USE_SPECULAR_COLORMAP
		uniform sampler2D specularColorMap;
	#endif
	#ifdef USE_SPECULAR_INTENSITYMAP
		uniform sampler2D specularIntensityMap;
	#endif
#endif
#ifdef USE_CLEARCOAT
	uniform float clearcoat;
	uniform float clearcoatRoughness;
#endif
#ifdef USE_DISPERSION
	uniform float dispersion;
#endif
#ifdef USE_IRIDESCENCE
	uniform float iridescence;
	uniform float iridescenceIOR;
	uniform float iridescenceThicknessMinimum;
	uniform float iridescenceThicknessMaximum;
#endif
#ifdef USE_SHEEN
	uniform vec3 sheenColor;
	uniform float sheenRoughness;
	#ifdef USE_SHEEN_COLORMAP
		uniform sampler2D sheenColorMap;
	#endif
	#ifdef USE_SHEEN_ROUGHNESSMAP
		uniform sampler2D sheenRoughnessMap;
	#endif
#endif
#ifdef USE_ANISOTROPY
	uniform vec2 anisotropyVector;
	#ifdef USE_ANISOTROPYMAP
		uniform sampler2D anisotropyMap;
	#endif
#endif
varying vec3 vViewPosition;
#include <common>
#include <packing>
#include <dithering_pars_fragment>
#include <color_pars_fragment>
#include <uv_pars_fragment>
#include <map_pars_fragment>
#include <alphamap_pars_fragment>
#include <alphatest_pars_fragment>
#include <alphahash_pars_fragment>
#include <aomap_pars_fragment>
#include <lightmap_pars_fragment>
#include <emissivemap_pars_fragment>
#include <iridescence_fragment>
#include <cube_uv_reflection_fragment>
#include <envmap_common_pars_fragment>
#include <envmap_physical_pars_fragment>
#include <fog_pars_fragment>
#include <lights_pars_begin>
#include <normal_pars_fragment>
#include <lights_physical_pars_fragment>
#include <transmission_pars_fragment>
#include <shadowmap_pars_fragment>
#include <bumpmap_pars_fragment>
#include <normalmap_pars_fragment>
#include <clearcoat_pars_fragment>
#include <iridescence_pars_fragment>
#include <roughnessmap_pars_fragment>
#include <metalnessmap_pars_fragment>
#include <logdepthbuf_pars_fragment>
#include <clipping_planes_pars_fragment>
void main() {
	vec4 diffuseColor = vec4( diffuse, opacity );
	#include <clipping_planes_fragment>
	ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );
	vec3 totalEmissiveRadiance = emissive;
	#include <logdepthbuf_fragment>
	#include <map_fragment>
	#include <color_fragment>
	#include <alphamap_fragment>
	#include <alphatest_fragment>
	#include <alphahash_fragment>
	#include <roughnessmap_fragment>
	#include <metalnessmap_fragment>
	#include <normal_fragment_begin>
	#include <normal_fragment_maps>
	#include <clearcoat_normal_fragment_begin>
	#include <clearcoat_normal_fragment_maps>
	#include <emissivemap_fragment>
	#include <lights_physical_fragment>
	#include <lights_fragment_begin>
	#include <lights_fragment_maps>
	#include <lights_fragment_end>
	#include <aomap_fragment>
	vec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse;
	vec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular;
	#include <transmission_fragment>
	vec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance;
	#ifdef USE_SHEEN
		float sheenEnergyComp = 1.0 - 0.157 * max3( material.sheenColor );
		outgoingLight = outgoingLight * sheenEnergyComp + sheenSpecularDirect + sheenSpecularIndirect;
	#endif
	#ifdef USE_CLEARCOAT
		float dotNVcc = saturate( dot( geometryClearcoatNormal, geometryViewDir ) );
		vec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc );
		outgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + ( clearcoatSpecularDirect + clearcoatSpecularIndirect ) * material.clearcoat;
	#endif
	#include <opaque_fragment>
	#include <tonemapping_fragment>
	#include <colorspace_fragment>
	#include <fog_fragment>
	#include <premultiplied_alpha_fragment>
	#include <dithering_fragment>
}`,Wko=`#define TOON
varying vec3 vViewPosition;
#include <common>
#include <batching_pars_vertex>
#include <uv_pars_vertex>
#include <displacementmap_pars_vertex>
#include <color_pars_vertex>
#include <fog_pars_vertex>
#include <normal_pars_vertex>
#include <morphtarget_pars_vertex>
#include <skinning_pars_vertex>
#include <shadowmap_pars_vertex>
#include <logdepthbuf_pars_vertex>
#include <clipping_planes_pars_vertex>
void main() {
	#include <uv_vertex>
	#include <color_vertex>
	#include <morphinstance_vertex>
	#include <morphcolor_vertex>
	#include <batching_vertex>
	#include <beginnormal_vertex>
	#include <morphnormal_vertex>
	#include <skinbase_vertex>
	#include <skinnormal_vertex>
	#include <defaultnormal_vertex>
	#include <normal_vertex>
	#include <begin_vertex>
	#include <morphtarget_vertex>
	#include <skinning_vertex>
	#include <displacementmap_vertex>
	#include <project_vertex>
	#include <logdepthbuf_vertex>
	#include <clipping_planes_vertex>
	vViewPosition = - mvPosition.xyz;
	#include <worldpos_vertex>
	#include <shadowmap_vertex>
	#include <fog_vertex>
}`,Xko=`#define TOON
uniform vec3 diffuse;
uniform vec3 emissive;
uniform float opacity;
#include <common>
#include <packing>
#include <dithering_pars_fragment>
#include <color_pars_fragment>
#include <uv_pars_fragment>
#include <map_pars_fragment>
#include <alphamap_pars_fragment>
#include <alphatest_pars_fragment>
#include <alphahash_pars_fragment>
#include <aomap_pars_fragment>
#include <lightmap_pars_fragment>
#include <emissivemap_pars_fragment>
#include <gradientmap_pars_fragment>
#include <fog_pars_fragment>
#include <bsdfs>
#include <lights_pars_begin>
#include <normal_pars_fragment>
#include <lights_toon_pars_fragment>
#include <shadowmap_pars_fragment>
#include <bumpmap_pars_fragment>
#include <normalmap_pars_fragment>
#include <logdepthbuf_pars_fragment>
#include <clipping_planes_pars_fragment>
void main() {
	vec4 diffuseColor = vec4( diffuse, opacity );
	#include <clipping_planes_fragment>
	ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );
	vec3 totalEmissiveRadiance = emissive;
	#include <logdepthbuf_fragment>
	#include <map_fragment>
	#include <color_fragment>
	#include <alphamap_fragment>
	#include <alphatest_fragment>
	#include <alphahash_fragment>
	#include <normal_fragment_begin>
	#include <normal_fragment_maps>
	#include <emissivemap_fragment>
	#include <lights_toon_fragment>
	#include <lights_fragment_begin>
	#include <lights_fragment_maps>
	#include <lights_fragment_end>
	#include <aomap_fragment>
	vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;
	#include <opaque_fragment>
	#include <tonemapping_fragment>
	#include <colorspace_fragment>
	#include <fog_fragment>
	#include <premultiplied_alpha_fragment>
	#include <dithering_fragment>
}`,jko=`uniform float size;
uniform float scale;
#include <common>
#include <color_pars_vertex>
#include <fog_pars_vertex>
#include <morphtarget_pars_vertex>
#include <logdepthbuf_pars_vertex>
#include <clipping_planes_pars_vertex>
#ifdef USE_POINTS_UV
	varying vec2 vUv;
	uniform mat3 uvTransform;
#endif
void main() {
	#ifdef USE_POINTS_UV
		vUv = ( uvTransform * vec3( uv, 1 ) ).xy;
	#endif
	#include <color_vertex>
	#include <morphinstance_vertex>
	#include <morphcolor_vertex>
	#include <begin_vertex>
	#include <morphtarget_vertex>
	#include <project_vertex>
	gl_PointSize = size;
	#ifdef USE_SIZEATTENUATION
		bool isPerspective = isPerspectiveMatrix( projectionMatrix );
		if ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );
	#endif
	#include <logdepthbuf_vertex>
	#include <clipping_planes_vertex>
	#include <worldpos_vertex>
	#include <fog_vertex>
}`,Kko=`uniform vec3 diffuse;
uniform float opacity;
#include <common>
#include <color_pars_fragment>
#include <map_particle_pars_fragment>
#include <alphatest_pars_fragment>
#include <alphahash_pars_fragment>
#include <fog_pars_fragment>
#include <logdepthbuf_pars_fragment>
#include <clipping_planes_pars_fragment>
void main() {
	vec4 diffuseColor = vec4( diffuse, opacity );
	#include <clipping_planes_fragment>
	vec3 outgoingLight = vec3( 0.0 );
	#include <logdepthbuf_fragment>
	#include <map_particle_fragment>
	#include <color_fragment>
	#include <alphatest_fragment>
	#include <alphahash_fragment>
	outgoingLight = diffuseColor.rgb;
	#include <opaque_fragment>
	#include <tonemapping_fragment>
	#include <colorspace_fragment>
	#include <fog_fragment>
	#include <premultiplied_alpha_fragment>
}`,$ko=`#include <common>
#include <batching_pars_vertex>
#include <fog_pars_vertex>
#include <morphtarget_pars_vertex>
#include <skinning_pars_vertex>
#include <logdepthbuf_pars_vertex>
#include <shadowmap_pars_vertex>
void main() {
	#include <batching_vertex>
	#include <beginnormal_vertex>
	#include <morphinstance_vertex>
	#include <morphnormal_vertex>
	#include <skinbase_vertex>
	#include <skinnormal_vertex>
	#include <defaultnormal_vertex>
	#include <begin_vertex>
	#include <morphtarget_vertex>
	#include <skinning_vertex>
	#include <project_vertex>
	#include <logdepthbuf_vertex>
	#include <worldpos_vertex>
	#include <shadowmap_vertex>
	#include <fog_vertex>
}`,qko=`uniform vec3 color;
uniform float opacity;
#include <common>
#include <packing>
#include <fog_pars_fragment>
#include <bsdfs>
#include <lights_pars_begin>
#include <logdepthbuf_pars_fragment>
#include <shadowmap_pars_fragment>
#include <shadowmask_pars_fragment>
void main() {
	#include <logdepthbuf_fragment>
	gl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );
	#include <tonemapping_fragment>
	#include <colorspace_fragment>
	#include <fog_fragment>
}`,Jko=`uniform float rotation;
uniform vec2 center;
#include <common>
#include <uv_pars_vertex>
#include <fog_pars_vertex>
#include <logdepthbuf_pars_vertex>
#include <clipping_planes_pars_vertex>
void main() {
	#include <uv_vertex>
	vec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );
	vec2 scale;
	scale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) );
	scale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) );
	#ifndef USE_SIZEATTENUATION
		bool isPerspective = isPerspectiveMatrix( projectionMatrix );
		if ( isPerspective ) scale *= - mvPosition.z;
	#endif
	vec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale;
	vec2 rotatedPosition;
	rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;
	rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;
	mvPosition.xy += rotatedPosition;
	gl_Position = projectionMatrix * mvPosition;
	#include <logdepthbuf_vertex>
	#include <clipping_planes_vertex>
	#include <fog_vertex>
}`,Zko=`uniform vec3 diffuse;
uniform float opacity;
#include <common>
#include <uv_pars_fragment>
#include <map_pars_fragment>
#include <alphamap_pars_fragment>
#include <alphatest_pars_fragment>
#include <alphahash_pars_fragment>
#include <fog_pars_fragment>
#include <logdepthbuf_pars_fragment>
#include <clipping_planes_pars_fragment>
void main() {
	vec4 diffuseColor = vec4( diffuse, opacity );
	#include <clipping_planes_fragment>
	vec3 outgoingLight = vec3( 0.0 );
	#include <logdepthbuf_fragment>
	#include <map_fragment>
	#include <alphamap_fragment>
	#include <alphatest_fragment>
	#include <alphahash_fragment>
	outgoingLight = diffuseColor.rgb;
	#include <opaque_fragment>
	#include <tonemapping_fragment>
	#include <colorspace_fragment>
	#include <fog_fragment>
}`,Ma={alphahash_fragment:CRo,alphahash_pars_fragment:bRo,alphamap_fragment:IRo,alphamap_pars_fragment:vRo,alphatest_fragment:SRo,alphatest_pars_fragment:PRo,aomap_fragment:ERo,aomap_pars_fragment:MRo,batching_pars_vertex:wRo,batching_vertex:BRo,begin_vertex:TRo,beginnormal_vertex:DRo,bsdfs:NRo,iridescence_fragment:RRo,bumpmap_pars_fragment:QRo,clipping_planes_fragment:kRo,clipping_planes_pars_fragment:LRo,clipping_planes_pars_vertex:HRo,clipping_planes_vertex:FRo,color_fragment:zRo,color_pars_fragment:ORo,color_pars_vertex:VRo,color_vertex:YRo,common:GRo,cube_uv_reflection_fragment:URo,defaultnormal_vertex:WRo,displacementmap_pars_vertex:XRo,displacementmap_vertex:jRo,emissivemap_fragment:KRo,emissivemap_pars_fragment:$Ro,colorspace_fragment:qRo,colorspace_pars_fragment:JRo,envmap_fragment:ZRo,envmap_common_pars_fragment:eQo,envmap_pars_fragment:tQo,envmap_pars_vertex:nQo,envmap_physical_pars_fragment:pQo,envmap_vertex:oQo,fog_vertex:rQo,fog_pars_vertex:iQo,fog_fragment:sQo,fog_pars_fragment:aQo,gradientmap_pars_fragment:cQo,lightmap_pars_fragment:lQo,lights_lambert_fragment:hQo,lights_lambert_pars_fragment:dQo,lights_pars_begin:uQo,lights_toon_fragment:mQo,lights_toon_pars_fragment:_Qo,lights_phong_fragment:gQo,lights_phong_pars_fragment:AQo,lights_physical_fragment:fQo,lights_physical_pars_fragment:yQo,lights_fragment_begin:xQo,lights_fragment_maps:CQo,lights_fragment_end:bQo,logdepthbuf_fragment:IQo,logdepthbuf_pars_fragment:vQo,logdepthbuf_pars_vertex:SQo,logdepthbuf_vertex:PQo,map_fragment:EQo,map_pars_fragment:MQo,map_particle_fragment:wQo,map_particle_pars_fragment:BQo,metalnessmap_fragment:TQo,metalnessmap_pars_fragment:DQo,morphinstance_vertex:NQo,morphcolor_vertex:RQo,morphnormal_vertex:QQo,morphtarget_pars_vertex:kQo,morphtarget_vertex:LQo,normal_fragment_begin:HQo,normal_fragment_maps:FQo,normal_pars_fragment:zQo,normal_pars_vertex:OQo,normal_vertex:VQo,normalmap_pars_fragment:YQo,clearcoat_normal_fragment_begin:GQo,clearcoat_normal_fragment_maps:UQo,clearcoat_pars_fragment:WQo,iridescence_pars_fragment:XQo,opaque_fragment:jQo,packing:KQo,premultiplied_alpha_fragment:$Qo,project_vertex:qQo,dithering_fragment:JQo,dithering_pars_fragment:ZQo,roughnessmap_fragment:eko,roughnessmap_pars_fragment:tko,shadowmap_pars_fragment:nko,shadowmap_pars_vertex:oko,shadowmap_vertex:rko,shadowmask_pars_fragment:iko,skinbase_vertex:sko,skinning_pars_vertex:ako,skinning_vertex:cko,skinnormal_vertex:lko,specularmap_fragment:hko,specularmap_pars_fragment:dko,tonemapping_fragment:uko,tonemapping_pars_fragment:pko,transmission_fragment:mko,transmission_pars_fragment:_ko,uv_pars_fragment:gko,uv_pars_vertex:Ako,uv_vertex:fko,worldpos_vertex:yko,background_vert:xko,background_frag:Cko,backgroundCube_vert:bko,backgroundCube_frag:Iko,cube_vert:vko,cube_frag:Sko,depth_vert:Pko,depth_frag:Eko,distanceRGBA_vert:Mko,distanceRGBA_frag:wko,equirect_vert:Bko,equirect_frag:Tko,linedashed_vert:Dko,linedashed_frag:Nko,meshbasic_vert:Rko,meshbasic_frag:Qko,meshlambert_vert:kko,meshlambert_frag:Lko,meshmatcap_vert:Hko,meshmatcap_frag:Fko,meshnormal_vert:zko,meshnormal_frag:Oko,meshphong_vert:Vko,meshphong_frag:Yko,meshphysical_vert:Gko,meshphysical_frag:Uko,meshtoon_vert:Wko,meshtoon_frag:Xko,points_vert:jko,points_frag:Kko,shadow_vert:$ko,shadow_frag:qko,sprite_vert:Jko,sprite_frag:Zko},Ir={common:{diffuse:{value:new Do(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new wa},alphaMap:{value:null},alphaMapTransform:{value:new wa},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new wa}},envmap:{envMap:{value:null},envMapRotation:{value:new wa},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:0.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new wa}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new wa}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new wa},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new wa},normalScale:{value:new go(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new wa},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new wa}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new wa}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new wa}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:0.00025},fogNear:{value:1},fogFar:{value:2000},fogColor:{value:new Do(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotShadowMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new Do(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new wa},alphaTest:{value:0},uvTransform:{value:new wa}},sprite:{diffuse:{value:new Do(16777215)},opacity:{value:1},center:{value:new go(0.5,0.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new wa},alphaMap:{value:null},alphaMapTransform:{value:new wa},alphaTest:{value:0}}},LI={basic:{uniforms:U1([Ir.common,Ir.specularmap,Ir.envmap,Ir.aomap,Ir.lightmap,Ir.fog]),vertexShader:Ma.meshbasic_vert,fragmentShader:Ma.meshbasic_frag},lambert:{uniforms:U1([Ir.common,Ir.specularmap,Ir.envmap,Ir.aomap,Ir.lightmap,Ir.emissivemap,Ir.bumpmap,Ir.normalmap,Ir.displacementmap,Ir.fog,Ir.lights,{emissive:{value:new Do(0)}}]),vertexShader:Ma.meshlambert_vert,fragmentShader:Ma.meshlambert_frag},phong:{uniforms:U1([Ir.common,Ir.specularmap,Ir.envmap,Ir.aomap,Ir.lightmap,Ir.emissivemap,Ir.bumpmap,Ir.normalmap,Ir.displacementmap,Ir.fog,Ir.lights,{emissive:{value:new Do(0)},specular:{value:new Do(1118481)},shininess:{value:30}}]),vertexShader:Ma.meshphong_vert,fragmentShader:Ma.meshphong_frag},standard:{uniforms:U1([Ir.common,Ir.envmap,Ir.aomap,Ir.lightmap,Ir.emissivemap,Ir.bumpmap,Ir.normalmap,Ir.displacementmap,Ir.roughnessmap,Ir.metalnessmap,Ir.fog,Ir.lights,{emissive:{value:new Do(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:Ma.meshphysical_vert,fragmentShader:Ma.meshphysical_frag},toon:{uniforms:U1([Ir.common,Ir.aomap,Ir.lightmap,Ir.emissivemap,Ir.bumpmap,Ir.normalmap,Ir.displacementmap,Ir.gradientmap,Ir.fog,Ir.lights,{emissive:{value:new Do(0)}}]),vertexShader:Ma.meshtoon_vert,fragmentShader:Ma.meshtoon_frag},matcap:{uniforms:U1([Ir.common,Ir.bumpmap,Ir.normalmap,Ir.displacementmap,Ir.fog,{matcap:{value:null}}]),vertexShader:Ma.meshmatcap_vert,fragmentShader:Ma.meshmatcap_frag},points:{uniforms:U1([Ir.points,Ir.fog]),vertexShader:Ma.points_vert,fragmentShader:Ma.points_frag},dashed:{uniforms:U1([Ir.common,Ir.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:Ma.linedashed_vert,fragmentShader:Ma.linedashed_frag},depth:{uniforms:U1([Ir.common,Ir.displacementmap]),vertexShader:Ma.depth_vert,fragmentShader:Ma.depth_frag},normal:{uniforms:U1([Ir.common,Ir.bumpmap,Ir.normalmap,Ir.displacementmap,{opacity:{value:1}}]),vertexShader:Ma.meshnormal_vert,fragmentShader:Ma.meshnormal_frag},sprite:{uniforms:U1([Ir.sprite,Ir.fog]),vertexShader:Ma.sprite_vert,fragmentShader:Ma.sprite_frag},background:{uniforms:{uvTransform:{value:new wa},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:Ma.background_vert,fragmentShader:Ma.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new wa}},vertexShader:Ma.backgroundCube_vert,fragmentShader:Ma.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:Ma.cube_vert,fragmentShader:Ma.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:Ma.equirect_vert,fragmentShader:Ma.equirect_frag},distanceRGBA:{uniforms:U1([Ir.common,Ir.displacementmap,{referencePosition:{value:new Dt},nearDistance:{value:1},farDistance:{value:1000}}]),vertexShader:Ma.distanceRGBA_vert,fragmentShader:Ma.distanceRGBA_frag},shadow:{uniforms:U1([Ir.lights,Ir.fog,{color:{value:new Do(0)},opacity:{value:1}}]),vertexShader:Ma.shadow_vert,fragmentShader:Ma.shadow_frag}};LI.physical={uniforms:U1([LI.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new wa},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new wa},clearcoatNormalScale:{value:new go(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new wa},dispersion:{value:0},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new wa},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new wa},sheen:{value:0},sheenColor:{value:new Do(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new wa},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new wa},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new wa},transmissionSamplerSize:{value:new go},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new wa},attenuationDistance:{value:0},attenuationColor:{value:new Do(0)},specularColor:{value:new Do(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new wa},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new wa},anisotropyVector:{value:new go},anisotropyMap:{value:null},anisotropyMapTransform:{value:new wa}}]),vertexShader:Ma.meshphysical_vert,fragmentShader:Ma.meshphysical_frag};var yye={r:0,b:0,g:0},fz=new aA,eLo=new Fi;function tLo(e,t,n,o,r,i,s){let a=new Do(0),c=i===!0?0:1,l,h,d=null,u=0,_=null;function p(f){let y=f.isScene===!0?f.background:null;if(y&&y.isTexture)y=(f.backgroundBlurriness>0?n:t).get(y);return y}function m(f){let y=!1,x=p(f);if(x===null)g(a,c);else if(x&&x.isColor)g(x,1),y=!0;let C=e.xr.getEnvironmentBlendMode();if(C==="additive")o.buffers.color.setClear(0,0,0,1,s);else if(C==="alpha-blend")o.buffers.color.setClear(0,0,0,0,s);if(e.autoClear||y)o.buffers.depth.setTest(!0),o.buffers.depth.setMask(!0),o.buffers.color.setMask(!0),e.clear(e.autoClearColor,e.autoClearDepth,e.autoClearStencil)}function A(f,y){let x=p(y);if(x&&(x.isCubeTexture||x.mapping===306)){if(h===void 0)h=new Qo(new qm(1,1,1),new y4({name:"BackgroundCubeMaterial",uniforms:Uj(LI.backgroundCube.uniforms),vertexShader:LI.backgroundCube.vertexShader,fragmentShader:LI.backgroundCube.fragmentShader,side:1,depthTest:!1,depthWrite:!1,fog:!1})),h.geometry.deleteAttribute("normal"),h.geometry.deleteAttribute("uv"),h.onBeforeRender=function(C,b,I){this.matrixWorld.copyPosition(I.matrixWorld)},Object.defineProperty(h.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),r.update(h);if(fz.copy(y.backgroundRotation),fz.x*=-1,fz.y*=-1,fz.z*=-1,x.isCubeTexture&&x.isRenderTargetTexture===!1)fz.y*=-1,fz.z*=-1;if(h.material.uniforms.envMap.value=x,h.material.uniforms.flipEnvMap.value=x.isCubeTexture&&x.isRenderTargetTexture===!1?-1:1,h.material.uniforms.backgroundBlurriness.value=y.backgroundBlurriness,h.material.uniforms.backgroundIntensity.value=y.backgroundIntensity,h.material.uniforms.backgroundRotation.value.setFromMatrix4(eLo.makeRotationFromEuler(fz)),h.material.toneMapped=Th.getTransfer(x.colorSpace)!=="srgb",d!==x||u!==x.version||_!==e.toneMapping)h.material.needsUpdate=!0,d=x,u=x.version,_=e.toneMapping;h.layers.enableAll(),f.unshift(h,h.geometry,h.material,0,0,null)}else if(x&&x.isTexture){if(l===void 0)l=new Qo(new v2(2,2),new y4({name:"BackgroundMaterial",uniforms:Uj(LI.background.uniforms),vertexShader:LI.background.vertexShader,fragmentShader:LI.background.fragmentShader,side:0,depthTest:!1,depthWrite:!1,fog:!1})),l.geometry.deleteAttribute("normal"),Object.defineProperty(l.material,"map",{get:function(){return this.uniforms.t2D.value}}),r.update(l);if(l.material.uniforms.t2D.value=x,l.material.uniforms.backgroundIntensity.value=y.backgroundIntensity,l.material.toneMapped=Th.getTransfer(x.colorSpace)!=="srgb",x.matrixAutoUpdate===!0)x.updateMatrix();if(l.material.uniforms.uvTransform.value.copy(x.matrix),d!==x||u!==x.version||_!==e.toneMapping)l.material.needsUpdate=!0,d=x,u=x.version,_=e.toneMapping;l.layers.enableAll(),f.unshift(l,l.geometry,l.material,0,0,null)}}function g(f,y){f.getRGB(yye,dEt(e)),o.buffers.color.setClear(yye.r,yye.g,yye.b,y,s)}return{getClearColor:function(){return a},setClearColor:function(f,y=1){a.set(f),c=y,g(a,c)},getClearAlpha:function(){return c},setClearAlpha:function(f){c=f,g(a,c)},render:m,addToRenderList:A}}function nLo(e,t){let n=e.getParameter(e.MAX_VERTEX_ATTRIBS),o={},r=u(null),i=r,s=!1;function a(M,B,T,N,D){let L=!1,H=d(N,T,B);if(i!==H)i=H,l(i.object);if(L=_(M,N,T,D),L)p(M,N,T,D);if(D!==null)t.update(D,e.ELEMENT_ARRAY_BUFFER);if(L||s){if(s=!1,x(M,B,T,N),D!==null)e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,t.get(D).buffer)}}function c(){return e.createVertexArray()}function l(M){return e.bindVertexArray(M)}function h(M){return e.deleteVertexArray(M)}function d(M,B,T){let N=T.wireframe===!0,D=o[M.id];if(D===void 0)D={},o[M.id]=D;let L=D[B.id];if(L===void 0)L={},D[B.id]=L;let H=L[N];if(H===void 0)H=u(c()),L[N]=H;return H}function u(M){let B=[],T=[],N=[];for(let D=0;D<n;D++)B[D]=0,T[D]=0,N[D]=0;return{geometry:null,program:null,wireframe:!1,newAttributes:B,enabledAttributes:T,attributeDivisors:N,object:M,attributes:{},index:null}}function _(M,B,T,N){let D=i.attributes,L=B.attributes,H=0,V=T.getAttributes();for(let O in V)if(V[O].location>=0){let j=D[O],Y=L[O];if(Y===void 0){if(O==="instanceMatrix"&&M.instanceMatrix)Y=M.instanceMatrix;if(O==="instanceColor"&&M.instanceColor)Y=M.instanceColor}if(j===void 0)return!0;if(j.attribute!==Y)return!0;if(Y&&j.data!==Y.data)return!0;H++}if(i.attributesNum!==H)return!0;if(i.index!==N)return!0;return!1}function p(M,B,T,N){let D={},L=B.attributes,H=0,V=T.getAttributes();for(let O in V)if(V[O].location>=0){let j=L[O];if(j===void 0){if(O==="instanceMatrix"&&M.instanceMatrix)j=M.instanceMatrix;if(O==="instanceColor"&&M.instanceColor)j=M.instanceColor}let Y={};if(Y.attribute=j,j&&j.data)Y.data=j.data;D[O]=Y,H++}i.attributes=D,i.attributesNum=H,i.index=N}function m(){let M=i.newAttributes;for(let B=0,T=M.length;B<T;B++)M[B]=0}function A(M){g(M,0)}function g(M,B){let T=i.newAttributes,N=i.enabledAttributes,D=i.attributeDivisors;if(T[M]=1,N[M]===0)e.enableVertexAttribArray(M),N[M]=1;if(D[M]!==B)e.vertexAttribDivisor(M,B),D[M]=B}function f(){let M=i.newAttributes,B=i.enabledAttributes;for(let T=0,N=B.length;T<N;T++)if(B[T]!==M[T])e.disableVertexAttribArray(T),B[T]=0}function y(M,B,T,N,D,L,H){if(H===!0)e.vertexAttribIPointer(M,B,T,D,L);else e.vertexAttribPointer(M,B,T,N,D,L)}function x(M,B,T,N){m();let D=N.attributes,L=T.getAttributes(),H=B.defaultAttributeValues;for(let V in L){let O=L[V];if(O.location>=0){let U=D[V];if(U===void 0){if(V==="instanceMatrix"&&M.instanceMatrix)U=M.instanceMatrix;if(V==="instanceColor"&&M.instanceColor)U=M.instanceColor}if(U!==void 0){let j=U.normalized,Y=U.itemSize,X=t.get(U);if(X===void 0)continue;let{buffer:K,type:J,bytesPerElement:ee}=X,se=J===e.INT||J===e.UNSIGNED_INT||U.gpuType===1013;if(U.isInterleavedBufferAttribute){let ne=U.data,re=ne.stride,Z=U.offset;if(ne.isInstancedInterleavedBuffer){for(let te=0;te<O.locationSize;te++)g(O.location+te,ne.meshPerAttribute);if(M.isInstancedMesh!==!0&&N._maxInstanceCount===void 0)N._maxInstanceCount=ne.meshPerAttribute*ne.count}else for(let te=0;te<O.locationSize;te++)A(O.location+te);e.bindBuffer(e.ARRAY_BUFFER,K);for(let te=0;te<O.locationSize;te++)y(O.location+te,Y/O.locationSize,J,j,re*ee,(Z+Y/O.locationSize*te)*ee,se)}else{if(U.isInstancedBufferAttribute){for(let ne=0;ne<O.locationSize;ne++)g(O.location+ne,U.meshPerAttribute);if(M.isInstancedMesh!==!0&&N._maxInstanceCount===void 0)N._maxInstanceCount=U.meshPerAttribute*U.count}else for(let ne=0;ne<O.locationSize;ne++)A(O.location+ne);e.bindBuffer(e.ARRAY_BUFFER,K);for(let ne=0;ne<O.locationSize;ne++)y(O.location+ne,Y/O.locationSize,J,j,Y*ee,Y/O.locationSize*ne*ee,se)}}else if(H!==void 0){let j=H[V];if(j!==void 0)switch(j.length){case 2:e.vertexAttrib2fv(O.location,j);break;case 3:e.vertexAttrib3fv(O.location,j);break;case 4:e.vertexAttrib4fv(O.location,j);break;default:e.vertexAttrib1fv(O.location,j)}}}}f()}function C(){v();for(let M in o){let B=o[M];for(let T in B){let N=B[T];for(let D in N)h(N[D].object),delete N[D];delete B[T]}delete o[M]}}function b(M){if(o[M.id]===void 0)return;let B=o[M.id];for(let T in B){let N=B[T];for(let D in N)h(N[D].object),delete N[D];delete B[T]}delete o[M.id]}function I(M){for(let B in o){let T=o[B];if(T[M.id]===void 0)continue;let N=T[M.id];for(let D in N)h(N[D].object),delete N[D];delete T[M.id]}}function v(){if(P(),s=!0,i===r)return;i=r,l(i.object)}function P(){r.geometry=null,r.program=null,r.wireframe=!1}return{setup:a,reset:v,resetDefaultState:P,dispose:C,releaseStatesOfGeometry:b,releaseStatesOfProgram:I,initAttributes:m,enableAttribute:A,disableUnusedAttributes:f}}function oLo(e,t,n){let o;function r(l){o=l}function i(l,h){e.drawArrays(o,l,h),n.update(h,o,1)}function s(l,h,d){if(d===0)return;e.drawArraysInstanced(o,l,h,d),n.update(h,o,d)}function a(l,h,d){if(d===0)return;let u=t.get("WEBGL_multi_draw");if(u===null)for(let _=0;_<d;_++)this.render(l[_],h[_]);else{u.multiDrawArraysWEBGL(o,l,0,h,0,d);let _=0;for(let p=0;p<d;p++)_+=h[p];n.update(_,o,1)}}function c(l,h,d,u){if(d===0)return;let _=t.get("WEBGL_multi_draw");if(_===null)for(let p=0;p<l.length;p++)s(l[p],h[p],u[p]);else{_.multiDrawArraysInstancedWEBGL(o,l,0,h,0,u,0,d);let p=0;for(let m=0;m<d;m++)p+=h[m];for(let m=0;m<u.length;m++)n.update(p,o,u[m])}}this.setMode=r,this.render=i,this.renderInstances=s,this.renderMultiDraw=a,this.renderMultiDrawInstances=c}function rLo(e,t,n,o){let r;function i(){if(r!==void 0)return r;if(t.has("EXT_texture_filter_anisotropic")===!0){let b=t.get("EXT_texture_filter_anisotropic");r=e.getParameter(b.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else r=0;return r}function s(b){if(b!==1023&&o.convert(b)!==e.getParameter(e.IMPLEMENTATION_COLOR_READ_FORMAT))return!1;return!0}function a(b){let I=b===1016&&(t.has("EXT_color_buffer_half_float")||t.has("EXT_color_buffer_float"));if(b!==1009&&o.convert(b)!==e.getParameter(e.IMPLEMENTATION_COLOR_READ_TYPE)&&b!==1015&&!I)return!1;return!0}function c(b){if(b==="highp"){if(e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.HIGH_FLOAT).precision>0&&e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.HIGH_FLOAT).precision>0)return"highp";b="mediump"}if(b==="mediump"){if(e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.MEDIUM_FLOAT).precision>0&&e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.MEDIUM_FLOAT).precision>0)return"mediump"}return"lowp"}let l=n.precision!==void 0?n.precision:"highp",h=c(l);if(h!==l)console.warn("THREE.WebGLRenderer:",l,"not supported, using",h,"instead."),l=h;let d=n.logarithmicDepthBuffer===!0,u=e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS),_=e.getParameter(e.MAX_VERTEX_TEXTURE_IMAGE_UNITS),p=e.getParameter(e.MAX_TEXTURE_SIZE),m=e.getParameter(e.MAX_CUBE_MAP_TEXTURE_SIZE),A=e.getParameter(e.MAX_VERTEX_ATTRIBS),g=e.getParameter(e.MAX_VERTEX_UNIFORM_VECTORS),f=e.getParameter(e.MAX_VARYING_VECTORS),y=e.getParameter(e.MAX_FRAGMENT_UNIFORM_VECTORS),x=_>0,C=e.getParameter(e.MAX_SAMPLES);return{isWebGL2:!0,getMaxAnisotropy:i,getMaxPrecision:c,textureFormatReadable:s,textureTypeReadable:a,precision:l,logarithmicDepthBuffer:d,maxTextures:u,maxVertexTextures:_,maxTextureSize:p,maxCubemapSize:m,maxAttributes:A,maxVertexUniforms:g,maxVaryings:f,maxFragmentUniforms:y,vertexTextures:x,maxSamples:C}}function iLo(e){let t=this,n=null,o=0,r=!1,i=!1,s=new c7,a=new wa,c={value:null,needsUpdate:!1};this.uniform=c,this.numPlanes=0,this.numIntersection=0,this.init=function(d,u){let _=d.length!==0||u||o!==0||r;return r=u,o=d.length,_},this.beginShadows=function(){i=!0,h(null)},this.endShadows=function(){i=!1},this.setGlobalState=function(d,u){n=h(d,u,0)},this.setState=function(d,u,_){let{clippingPlanes:p,clipIntersection:m,clipShadows:A}=d,g=e.get(d);if(!r||p===null||p.length===0||i&&!A)if(i)h(null);else l();else{let f=i?0:o,y=f*4,x=g.clippingState||null;c.value=x,x=h(p,u,y,_);for(let C=0;C!==y;++C)x[C]=n[C];g.clippingState=x,this.numIntersection=m?this.numPlanes:0,this.numPlanes+=f}};function l(){if(c.value!==n)c.value=n,c.needsUpdate=o>0;t.numPlanes=o,t.numIntersection=0}function h(d,u,_,p){let m=d!==null?d.length:0,A=null;if(m!==0){if(A=c.value,p!==!0||A===null){let g=_+m*4,f=u.matrixWorldInverse;if(a.getNormalMatrix(f),A===null||A.length<g)A=new Float32Array(g);for(let y=0,x=_;y!==m;++y,x+=4)s.copy(d[y]).applyMatrix4(f,a),s.normal.toArray(A,x),A[x+3]=s.constant}c.value=A,c.needsUpdate=!0}return t.numPlanes=m,t.numIntersection=0,A}}function sLo(e){let t=new WeakMap;function n(s,a){if(a===303)s.mapping=301;else if(a===304)s.mapping=302;return s}function o(s){if(s&&s.isTexture){let a=s.mapping;if(a===303||a===304)if(t.has(s)){let c=t.get(s).texture;return n(c,s.mapping)}else{let c=s.image;if(c&&c.height>0){let l=new pEt(c.height);return l.fromEquirectangularTexture(e,s),t.set(s,l),s.addEventListener("dispose",r),n(l.texture,s.mapping)}else return null}}return s}function r(s){let a=s.target;a.removeEventListener("dispose",r);let c=t.get(a);if(c!==void 0)t.delete(a),c.dispose()}function i(){t=new WeakMap}return{get:o,dispose:i}}class u7 extends _Oe{constructor(e=-1,t=1,n=1,o=-1,r=0.1,i=2000){super();this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e,this.right=t,this.top=n,this.bottom=o,this.near=r,this.far=i,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.near=e.near,this.far=e.far,this.zoom=e.zoom,this.view=e.view===null?null:Object.assign({},e.view),this}setViewOffset(e,t,n,o,r,i){if(this.view===null)this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1};this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=n,this.view.offsetY=o,this.view.width=r,this.view.height=i,this.updateProjectionMatrix()}clearViewOffset(){if(this.view!==null)this.view.enabled=!1;this.updateProjectionMatrix()}updateProjectionMatrix(){let e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),n=(this.right+this.left)/2,o=(this.top+this.bottom)/2,r=n-e,i=n+e,s=o+t,a=o-t;if(this.view!==null&&this.view.enabled){let c=(this.right-this.left)/this.view.fullWidth/this.zoom,l=(this.top-this.bottom)/this.view.fullHeight/this.zoom;r+=c*this.view.offsetX,i=r+c*this.view.width,s-=l*this.view.offsetY,a=s-l*this.view.height}this.projectionMatrix.makeOrthographic(r,i,s,a,this.near,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){let t=super.toJSON(e);if(t.object.zoom=this.zoom,t.object.left=this.left,t.object.right=this.right,t.object.top=this.top,t.object.bottom=this.bottom,t.object.near=this.near,t.object.far=this.far,this.view!==null)t.object.view=Object.assign({},this.view);return t}}var zj=4,cPt=[0.125,0.215,0.35,0.446,0.526,0.582],Cz=20,Oze=new u7,lPt=new Do,Vze=null,Yze=0,Gze=0,Uze=!1,xz=(1+Math.sqrt(5))/2,Hj=1/xz,hPt=[new Dt(-xz,Hj,0),new Dt(xz,Hj,0),new Dt(-Hj,0,xz),new Dt(Hj,0,xz),new Dt(0,xz,-Hj),new Dt(0,xz,Hj),new Dt(-1,1,-1),new Dt(1,1,-1),new Dt(-1,1,1),new Dt(1,1,1)];class Rie{constructor(e){this._renderer=e,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._lodPlanes=[],this._sizeLods=[],this._sigmas=[],this._blurMaterial=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._compileMaterial(this._blurMaterial)}fromScene(e,t=0,n=0.1,o=100){Vze=this._renderer.getRenderTarget(),Yze=this._renderer.getActiveCubeFace(),Gze=this._renderer.getActiveMipmapLevel(),Uze=this._renderer.xr.enabled,this._renderer.xr.enabled=!1,this._setSize(256);let r=this._allocateTargets();if(r.depthBuffer=!0,this._sceneToCubeUV(e,n,o,r),t>0)this._blur(r,0,0,t);return this._applyPMREM(r),this._cleanup(r),r}fromEquirectangular(e,t=null){return this._fromTexture(e,t)}fromCubemap(e,t=null){return this._fromTexture(e,t)}compileCubemapShader(){if(this._cubemapMaterial===null)this._cubemapMaterial=pPt(),this._compileMaterial(this._cubemapMaterial)}compileEquirectangularShader(){if(this._equirectMaterial===null)this._equirectMaterial=uPt(),this._compileMaterial(this._equirectMaterial)}dispose(){if(this._dispose(),this._cubemapMaterial!==null)this._cubemapMaterial.dispose();if(this._equirectMaterial!==null)this._equirectMaterial.dispose()}_setSize(e){this._lodMax=Math.floor(Math.log2(e)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){if(this._blurMaterial!==null)this._blurMaterial.dispose();if(this._pingPongRenderTarget!==null)this._pingPongRenderTarget.dispose();for(let e=0;e<this._lodPlanes.length;e++)this._lodPlanes[e].dispose()}_cleanup(e){this._renderer.setRenderTarget(Vze,Yze,Gze),this._renderer.xr.enabled=Uze,e.scissorTest=!1,xye(e,0,0,e.width,e.height)}_fromTexture(e,t){if(e.mapping===301||e.mapping===302)this._setSize(e.image.length===0?16:e.image[0].width||e.image[0].image.width);else this._setSize(e.image.width/4);Vze=this._renderer.getRenderTarget(),Yze=this._renderer.getActiveCubeFace(),Gze=this._renderer.getActiveMipmapLevel(),Uze=this._renderer.xr.enabled,this._renderer.xr.enabled=!1;let n=t||this._allocateTargets();return this._textureToCubeUV(e,n),this._applyPMREM(n),this._cleanup(n),n}_allocateTargets(){let e=3*Math.max(this._cubeSize,112),t=4*this._cubeSize,n={magFilter:1006,minFilter:1006,generateMipmaps:!1,type:1016,format:1023,colorSpace:"srgb-linear",depthBuffer:!1},o=dPt(e,t,n);if(this._pingPongRenderTarget===null||this._pingPongRenderTarget.width!==e||this._pingPongRenderTarget.height!==t){if(this._pingPongRenderTarget!==null)this._dispose();this._pingPongRenderTarget=dPt(e,t,n);let{_lodMax:r}=this;({sizeLods:this._sizeLods,lodPlanes:this._lodPlanes,sigmas:this._sigmas}=aLo(r)),this._blurMaterial=cLo(r,e,t)}return o}_compileMaterial(e){let t=new Qo(this._lodPlanes[0],e);this._renderer.compile(t,Oze)}_sceneToCubeUV(e,t,n,o){let s=new wl(90,1,t,n),a=[1,-1,1,1,1,1],c=[1,1,1,-1,-1,-1],l=this._renderer,{autoClear:h,toneMapping:d}=l;l.getClearColor(lPt),l.toneMapping=0,l.autoClear=!1;let u=new lA({name:"PMREM.Background",side:1,depthWrite:!1,depthTest:!1}),_=new Qo(new qm,u),p=!1,m=e.background;if(m){if(m.isColor)u.color.copy(m),e.background=null,p=!0}else u.color.copy(lPt),p=!0;for(let A=0;A<6;A++){let g=A%3;if(g===0)s.up.set(0,a[A],0),s.lookAt(c[A],0,0);else if(g===1)s.up.set(0,0,a[A]),s.lookAt(0,c[A],0);else s.up.set(0,a[A],0),s.lookAt(0,0,c[A]);let f=this._cubeSize;if(xye(o,g*f,A>2?f:0,f,f),l.setRenderTarget(o),p)l.render(_,s);l.render(e,s)}_.geometry.dispose(),_.material.dispose(),l.toneMapping=d,l.autoClear=h,e.background=m}_textureToCubeUV(e,t){let n=this._renderer,o=e.mapping===301||e.mapping===302;if(o){if(this._cubemapMaterial===null)this._cubemapMaterial=pPt();this._cubemapMaterial.uniforms.flipEnvMap.value=e.isRenderTargetTexture===!1?-1:1}else if(this._equirectMaterial===null)this._equirectMaterial=uPt();let r=o?this._cubemapMaterial:this._equirectMaterial,i=new Qo(this._lodPlanes[0],r),s=r.uniforms;s.envMap.value=e;let a=this._cubeSize;xye(t,0,0,3*a,2*a),n.setRenderTarget(t),n.render(i,Oze)}_applyPMREM(e){let t=this._renderer,n=t.autoClear;t.autoClear=!1;let o=this._lodPlanes.length;for(let r=1;r<o;r++){let i=Math.sqrt(this._sigmas[r]*this._sigmas[r]-this._sigmas[r-1]*this._sigmas[r-1]),s=hPt[(o-r-1)%hPt.length];this._blur(e,r-1,r,i,s)}t.autoClear=n}_blur(e,t,n,o,r){let i=this._pingPongRenderTarget;this._halfBlur(e,i,t,n,o,"latitudinal",r),this._halfBlur(i,e,n,n,o,"longitudinal",r)}_halfBlur(e,t,n,o,r,i,s){let a=this._renderer,c=this._blurMaterial;if(i!=="latitudinal"&&i!=="longitudinal")console.error("blur direction must be either latitudinal or longitudinal!");let l=3,h=new Qo(this._lodPlanes[o],c),d=c.uniforms,u=this._sizeLods[n]-1,_=isFinite(r)?Math.PI/(2*u):2*Math.PI/(2*Cz-1),p=r/_,m=isFinite(r)?1+Math.floor(l*p):Cz;if(m>Cz)console.warn(`sigmaRadians, ${r}, is too large and will clip, as it requested ${m} samples when the maximum is set to ${Cz}`);let A=[],g=0;for(let b=0;b<Cz;++b){let I=b/p,v=Math.exp(-I*I/2);if(A.push(v),b===0)g+=v;else if(b<m)g+=2*v}for(let b=0;b<A.length;b++)A[b]=A[b]/g;if(d.envMap.value=e.texture,d.samples.value=m,d.weights.value=A,d.latitudinal.value=i==="latitudinal",s)d.poleAxis.value=s;let{_lodMax:f}=this;d.dTheta.value=_,d.mipInt.value=f-n;let y=this._sizeLods[o],x=3*y*(o>f-zj?o-f+zj:0),C=4*(this._cubeSize-y);xye(t,x,C,3*y,2*y),a.setRenderTarget(t),a.render(h,Oze)}}function aLo(e){let t=[],n=[],o=[],r=e,i=e-zj+1+cPt.length;for(let s=0;s<i;s++){let a=Math.pow(2,r);n.push(a);let c=1/a;if(s>e-zj)c=cPt[s-e+zj-1];else if(s===0)c=0;o.push(c);let l=1/(a-2),h=-l,d=1+l,u=[h,h,d,h,d,d,h,h,d,d,h,d],_=6,p=6,m=3,A=2,g=1,f=new Float32Array(m*p*_),y=new Float32Array(A*p*_),x=new Float32Array(g*p*_);for(let b=0;b<_;b++){let I=b%3*2/3-1,v=b>2?0:-1,P=[I,v,0,I+0.6666666666666666,v,0,I+0.6666666666666666,v+1,0,I,v,0,I+0.6666666666666666,v+1,0,I,v+1,0];f.set(P,m*p*b),y.set(u,A*p*b);let M=[b,b,b,b,b,b];x.set(M,g*p*b)}let C=new ha;if(C.setAttribute("position",new ol(f,m)),C.setAttribute("uv",new ol(y,A)),C.setAttribute("faceIndex",new ol(x,g)),t.push(C),r>zj)r--}return{lodPlanes:t,sizeLods:n,sigmas:o}}function dPt(e,t,n){let o=new JN(e,t,n);return o.texture.mapping=306,o.texture.name="PMREM.cubeUv",o.scissorTest=!0,o}function xye(e,t,n,o,r){e.viewport.set(t,n,o,r),e.scissor.set(t,n,o,r)}function cLo(e,t,n){let o=new Float32Array(Cz),r=new Dt(0,1,0);return new y4({name:"SphericalGaussianBlur",defines:{n:Cz,CUBEUV_TEXEL_WIDTH:1/t,CUBEUV_TEXEL_HEIGHT:1/n,CUBEUV_MAX_MIP:`${e}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:o},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:r}},vertexShader:AOe(),fragmentShader:`

			precision mediump float;
			precision mediump int;

			varying vec3 vOutputDirection;

			uniform sampler2D envMap;
			uniform int samples;
			uniform float weights[ n ];
			uniform bool latitudinal;
			uniform float dTheta;
			uniform float mipInt;
			uniform vec3 poleAxis;

			#define ENVMAP_TYPE_CUBE_UV
			#include <cube_uv_reflection_fragment>

			vec3 getSample( float theta, vec3 axis ) {

				float cosTheta = cos( theta );
				// Rodrigues' axis-angle rotation
				vec3 sampleDirection = vOutputDirection * cosTheta
					+ cross( axis, vOutputDirection ) * sin( theta )
					+ axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta );

				return bilinearCubeUV( envMap, sampleDirection, mipInt );

			}

			void main() {

				vec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection );

				if ( all( equal( axis, vec3( 0.0 ) ) ) ) {

					axis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x );

				}

				axis = normalize( axis );

				gl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 );
				gl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis );

				for ( int i = 1; i < n; i++ ) {

					if ( i >= samples ) {

						break;

					}

					float theta = dTheta * float( i );
					gl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis );
					gl_FragColor.rgb += weights[ i ] * getSample( theta, axis );

				}

			}
		`,blending:0,depthTest:!1,depthWrite:!1})}function uPt(){return new y4({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:AOe(),fragmentShader:`

			precision mediump float;
			precision mediump int;

			varying vec3 vOutputDirection;

			uniform sampler2D envMap;

			#include <common>

			void main() {

				vec3 outputDirection = normalize( vOutputDirection );
				vec2 uv = equirectUv( outputDirection );

				gl_FragColor = vec4( texture2D ( envMap, uv ).rgb, 1.0 );

			}
		`,blending:0,depthTest:!1,depthWrite:!1})}function pPt(){return new y4({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:AOe(),fragmentShader:`

			precision mediump float;
			precision mediump int;

			uniform float flipEnvMap;

			varying vec3 vOutputDirection;

			uniform samplerCube envMap;

			void main() {

				gl_FragColor = textureCube( envMap, vec3( flipEnvMap * vOutputDirection.x, vOutputDirection.yz ) );

			}
		`,blending:0,depthTest:!1,depthWrite:!1})}function AOe(){return`

		precision mediump float;
		precision mediump int;

		attribute float faceIndex;

		varying vec3 vOutputDirection;

		// RH coordinate system; PMREM face-indexing convention
		vec3 getDirection( vec2 uv, float face ) {

			uv = 2.0 * uv - 1.0;

			vec3 direction = vec3( uv, 1.0 );

			if ( face == 0.0 ) {

				direction = direction.zyx; // ( 1, v, u ) pos x

			} else if ( face == 1.0 ) {

				direction = direction.xzy;
				direction.xz *= -1.0; // ( -u, 1, -v ) pos y

			} else if ( face == 2.0 ) {

				direction.x *= -1.0; // ( -u, v, 1 ) pos z

			} else if ( face == 3.0 ) {

				direction = direction.zyx;
				direction.xz *= -1.0; // ( -1, v, -u ) neg x

			} else if ( face == 4.0 ) {

				direction = direction.xzy;
				direction.xy *= -1.0; // ( -u, -1, v ) neg y

			} else if ( face == 5.0 ) {

				direction.z *= -1.0; // ( u, v, -1 ) neg z

			}

			return direction;

		}

		void main() {

			vOutputDirection = getDirection( uv, faceIndex );
			gl_Position = vec4( position, 1.0 );

		}
	`}function lLo(e){let t=new WeakMap,n=null;function o(a){if(a&&a.isTexture){let c=a.mapping,l=c===303||c===304,h=c===301||c===302;if(l||h){let d=t.get(a),u=d!==void 0?d.texture.pmremVersion:0;if(a.isRenderTargetTexture&&a.pmremVersion!==u){if(n===null)n=new Rie(e);return d=l?n.fromEquirectangular(a,d):n.fromCubemap(a,d),d.texture.pmremVersion=a.pmremVersion,t.set(a,d),d.texture}else if(d!==void 0)return d.texture;else{let _=a.image;if(l&&_&&_.height>0||h&&_&&r(_)){if(n===null)n=new Rie(e);return d=l?n.fromEquirectangular(a):n.fromCubemap(a),d.texture.pmremVersion=a.pmremVersion,t.set(a,d),a.addEventListener("dispose",i),d.texture}else return null}}}return a}function r(a){let c=0,l=6;for(let h=0;h<l;h++)if(a[h]!==void 0)c++;return c===l}function i(a){let c=a.target;c.removeEventListener("dispose",i);let l=t.get(c);if(l!==void 0)t.delete(c),l.dispose()}function s(){if(t=new WeakMap,n!==null)n.dispose(),n=null}return{get:o,dispose:s}}function hLo(e){let t={};function n(o){if(t[o]!==void 0)return t[o];let r;switch(o){case"WEBGL_depth_texture":r=e.getExtension("WEBGL_depth_texture")||e.getExtension("MOZ_WEBGL_depth_texture")||e.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":r=e.getExtension("EXT_texture_filter_anisotropic")||e.getExtension("MOZ_EXT_texture_filter_anisotropic")||e.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":r=e.getExtension("WEBGL_compressed_texture_s3tc")||e.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":r=e.getExtension("WEBGL_compressed_texture_pvrtc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:r=e.getExtension(o)}return t[o]=r,r}return{has:function(o){return n(o)!==null},init:function(){n("EXT_color_buffer_float"),n("WEBGL_clip_cull_distance"),n("OES_texture_float_linear"),n("EXT_color_buffer_half_float"),n("WEBGL_multisampled_render_to_texture"),n("WEBGL_render_shared_exponent")},get:function(o){let r=n(o);if(r===null)hOe("THREE.WebGLRenderer: "+o+" extension not supported.");return r}}}function dLo(e,t,n,o){let r={},i=new WeakMap;function s(d){let u=d.target;if(u.index!==null)t.remove(u.index);for(let p in u.attributes)t.remove(u.attributes[p]);for(let p in u.morphAttributes){let m=u.morphAttributes[p];for(let A=0,g=m.length;A<g;A++)t.remove(m[A])}u.removeEventListener("dispose",s),delete r[u.id];let _=i.get(u);if(_)t.remove(_),i.delete(u);if(o.releaseStatesOfGeometry(u),u.isInstancedBufferGeometry===!0)delete u._maxInstanceCount;n.memory.geometries--}function a(d,u){if(r[u.id]===!0)return u;return u.addEventListener("dispose",s),r[u.id]=!0,n.memory.geometries++,u}function c(d){let u=d.attributes;for(let p in u)t.update(u[p],e.ARRAY_BUFFER);let _=d.morphAttributes;for(let p in _){let m=_[p];for(let A=0,g=m.length;A<g;A++)t.update(m[A],e.ARRAY_BUFFER)}}function l(d){let u=[],_=d.index,p=d.attributes.position,m=0;if(_!==null){let f=_.array;m=_.version;for(let y=0,x=f.length;y<x;y+=3){let C=f[y+0],b=f[y+1],I=f[y+2];u.push(C,b,b,I,I,C)}}else if(p!==void 0){let f=p.array;m=p.version;for(let y=0,x=f.length/3-1;y<x;y+=3){let C=y+0,b=y+1,I=y+2;u.push(C,b,b,I,I,C)}}else return;let A=new((sEt(u))?Vie:pOe)(u,1);A.version=m;let g=i.get(d);if(g)t.remove(g);i.set(d,A)}function h(d){let u=i.get(d);if(u){let _=d.index;if(_!==null){if(u.version<_.version)l(d)}}else l(d);return i.get(d)}return{get:a,update:c,getWireframeAttribute:h}}function uLo(e,t,n){let o;function r(u){o=u}let i,s;function a(u){i=u.type,s=u.bytesPerElement}function c(u,_){e.drawElements(o,_,i,u*s),n.update(_,o,1)}function l(u,_,p){if(p===0)return;e.drawElementsInstanced(o,_,i,u*s,p),n.update(_,o,p)}function h(u,_,p){if(p===0)return;let m=t.get("WEBGL_multi_draw");if(m===null)for(let A=0;A<p;A++)this.render(u[A]/s,_[A]);else{m.multiDrawElementsWEBGL(o,_,0,i,u,0,p);let A=0;for(let g=0;g<p;g++)A+=_[g];n.update(A,o,1)}}function d(u,_,p,m){if(p===0)return;let A=t.get("WEBGL_multi_draw");if(A===null)for(let g=0;g<u.length;g++)l(u[g]/s,_[g],m[g]);else{A.multiDrawElementsInstancedWEBGL(o,_,0,i,u,0,m,0,p);let g=0;for(let f=0;f<p;f++)g+=_[f];for(let f=0;f<m.length;f++)n.update(g,o,m[f])}}this.setMode=r,this.setIndex=a,this.render=c,this.renderInstances=l,this.renderMultiDraw=h,this.renderMultiDrawInstances=d}function pLo(e){let t={geometries:0,textures:0},n={frame:0,calls:0,triangles:0,points:0,lines:0};function o(i,s,a){switch(n.calls++,s){case e.TRIANGLES:n.triangles+=a*(i/3);break;case e.LINES:n.lines+=a*(i/2);break;case e.LINE_STRIP:n.lines+=a*(i-1);break;case e.LINE_LOOP:n.lines+=a*i;break;case e.POINTS:n.points+=a*i;break;default:console.error("THREE.WebGLInfo: Unknown draw mode:",s);break}}function r(){n.calls=0,n.triangles=0,n.points=0,n.lines=0}return{memory:t,render:n,programs:null,autoReset:!0,reset:r,update:o}}function mLo(e,t,n){let o=new WeakMap,r=new Ah;function i(s,a,c){let l=s.morphTargetInfluences,h=a.morphAttributes.position||a.morphAttributes.normal||a.morphAttributes.color,d=h!==void 0?h.length:0,u=o.get(a);if(u===void 0||u.count!==d){let P=function(){I.dispose(),o.delete(a),a.removeEventListener("dispose",P)};if(u!==void 0)u.texture.dispose();let _=a.morphAttributes.position!==void 0,p=a.morphAttributes.normal!==void 0,m=a.morphAttributes.color!==void 0,A=a.morphAttributes.position||[],g=a.morphAttributes.normal||[],f=a.morphAttributes.color||[],y=0;if(_===!0)y=1;if(p===!0)y=2;if(m===!0)y=3;let x=a.attributes.position.count*y,C=1;if(x>t.maxTextureSize)C=Math.ceil(x/t.maxTextureSize),x=t.maxTextureSize;let b=new Float32Array(x*C*4*d),I=new uOe(b,x,C,d);I.type=1015,I.needsUpdate=!0;let v=y*4;for(let M=0;M<d;M++){let B=A[M],T=g[M],N=f[M],D=x*C*4*M;for(let L=0;L<B.count;L++){let H=L*v;if(_===!0)r.fromBufferAttribute(B,L),b[D+H+0]=r.x,b[D+H+1]=r.y,b[D+H+2]=r.z,b[D+H+3]=0;if(p===!0)r.fromBufferAttribute(T,L),b[D+H+4]=r.x,b[D+H+5]=r.y,b[D+H+6]=r.z,b[D+H+7]=0;if(m===!0)r.fromBufferAttribute(N,L),b[D+H+8]=r.x,b[D+H+9]=r.y,b[D+H+10]=r.z,b[D+H+11]=N.itemSize===4?r.w:1}}u={count:d,texture:I,size:new go(x,C)},o.set(a,u),a.addEventListener("dispose",P)}if(s.isInstancedMesh===!0&&s.morphTexture!==null)c.getUniforms().setValue(e,"morphTexture",s.morphTexture,n);else{let _=0;for(let m=0;m<l.length;m++)_+=l[m];let p=a.morphTargetsRelative?1:1-_;c.getUniforms().setValue(e,"morphTargetBaseInfluence",p),c.getUniforms().setValue(e,"morphTargetInfluences",l)}c.getUniforms().setValue(e,"morphTargetsTexture",u.texture,n),c.getUniforms().setValue(e,"morphTargetsTextureSize",u.size)}return{update:i}}function _Lo(e,t,n,o){let r=new WeakMap;function i(c){let l=o.render.frame,h=c.geometry,d=t.get(c,h);if(r.get(d)!==l)t.update(d),r.set(d,l);if(c.isInstancedMesh){if(c.hasEventListener("dispose",a)===!1)c.addEventListener("dispose",a);if(r.get(c)!==l){if(n.update(c.instanceMatrix,e.ARRAY_BUFFER),c.instanceColor!==null)n.update(c.instanceColor,e.ARRAY_BUFFER);r.set(c,l)}}if(c.isSkinnedMesh){let u=c.skeleton;if(r.get(u)!==l)u.update(),r.set(u,l)}return d}function s(){r=new WeakMap}function a(c){let l=c.target;if(l.removeEventListener("dispose",a),n.remove(l.instanceMatrix),l.instanceColor!==null)n.remove(l.instanceColor)}return{update:i,dispose:s}}class fOe extends Bl{constructor(e,t,n,o,r,i,s,a,c,l=1026){if(l!==1026&&l!==1027)throw Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");if(n===void 0&&l===1026)n=1014;if(n===void 0&&l===1027)n=1020;super(null,o,r,i,s,a,l,n,c);this.isDepthTexture=!0,this.image={width:e,height:t},this.magFilter=s!==void 0?s:1003,this.minFilter=a!==void 0?a:1003,this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}copy(e){return super.copy(e),this.compareFunction=e.compareFunction,this}toJSON(e){let t=super.toJSON(e);if(this.compareFunction!==null)t.compareFunction=this.compareFunction;return t}}var _Et=new Bl,gEt=new fOe(1,1);gEt.compareFunction=515;var AEt=new uOe,fEt=new lEt,yEt=new gOe,mPt=[],_Pt=[],gPt=new Float32Array(16),APt=new Float32Array(9),fPt=new Float32Array(4);function Wj(e,t,n){let o=e[0];if(o<=0||o>0)return e;let r=t*n,i=mPt[r];if(i===void 0)i=new Float32Array(r),mPt[r]=i;if(t!==0){o.toArray(i,0);for(let s=1,a=0;s!==t;++s)a+=n,e[s].toArray(i,a)}return i}function og(e,t){if(e.length!==t.length)return!1;for(let n=0,o=e.length;n<o;n++)if(e[n]!==t[n])return!1;return!0}function rg(e,t){for(let n=0,o=t.length;n<o;n++)e[n]=t[n]}function Xye(e,t){let n=_Pt[t];if(n===void 0)n=new Int32Array(t),_Pt[t]=n;for(let o=0;o!==t;++o)n[o]=e.allocateTextureUnit();return n}function gLo(e,t){let n=this.cache;if(n[0]===t)return;e.uniform1f(this.addr,t),n[0]=t}function ALo(e,t){let n=this.cache;if(t.x!==void 0){if(n[0]!==t.x||n[1]!==t.y)e.uniform2f(this.addr,t.x,t.y),n[0]=t.x,n[1]=t.y}else{if(og(n,t))return;e.uniform2fv(this.addr,t),rg(n,t)}}function fLo(e,t){let n=this.cache;if(t.x!==void 0){if(n[0]!==t.x||n[1]!==t.y||n[2]!==t.z)e.uniform3f(this.addr,t.x,t.y,t.z),n[0]=t.x,n[1]=t.y,n[2]=t.z}else if(t.r!==void 0){if(n[0]!==t.r||n[1]!==t.g||n[2]!==t.b)e.uniform3f(this.addr,t.r,t.g,t.b),n[0]=t.r,n[1]=t.g,n[2]=t.b}else{if(og(n,t))return;e.uniform3fv(this.addr,t),rg(n,t)}}function yLo(e,t){let n=this.cache;if(t.x!==void 0){if(n[0]!==t.x||n[1]!==t.y||n[2]!==t.z||n[3]!==t.w)e.uniform4f(this.addr,t.x,t.y,t.z,t.w),n[0]=t.x,n[1]=t.y,n[2]=t.z,n[3]=t.w}else{if(og(n,t))return;e.uniform4fv(this.addr,t),rg(n,t)}}function xLo(e,t){let n=this.cache,o=t.elements;if(o===void 0){if(og(n,t))return;e.uniformMatrix2fv(this.addr,!1,t),rg(n,t)}else{if(og(n,o))return;fPt.set(o),e.uniformMatrix2fv(this.addr,!1,fPt),rg(n,o)}}function CLo(e,t){let n=this.cache,o=t.elements;if(o===void 0){if(og(n,t))return;e.uniformMatrix3fv(this.addr,!1,t),rg(n,t)}else{if(og(n,o))return;APt.set(o),e.uniformMatrix3fv(this.addr,!1,APt),rg(n,o)}}function bLo(e,t){let n=this.cache,o=t.elements;if(o===void 0){if(og(n,t))return;e.uniformMatrix4fv(this.addr,!1,t),rg(n,t)}else{if(og(n,o))return;gPt.set(o),e.uniformMatrix4fv(this.addr,!1,gPt),rg(n,o)}}function ILo(e,t){let n=this.cache;if(n[0]===t)return;e.uniform1i(this.addr,t),n[0]=t}function vLo(e,t){let n=this.cache;if(t.x!==void 0){if(n[0]!==t.x||n[1]!==t.y)e.uniform2i(this.addr,t.x,t.y),n[0]=t.x,n[1]=t.y}else{if(og(n,t))return;e.uniform2iv(this.addr,t),rg(n,t)}}function SLo(e,t){let n=this.cache;if(t.x!==void 0){if(n[0]!==t.x||n[1]!==t.y||n[2]!==t.z)e.uniform3i(this.addr,t.x,t.y,t.z),n[0]=t.x,n[1]=t.y,n[2]=t.z}else{if(og(n,t))return;e.uniform3iv(this.addr,t),rg(n,t)}}function PLo(e,t){let n=this.cache;if(t.x!==void 0){if(n[0]!==t.x||n[1]!==t.y||n[2]!==t.z||n[3]!==t.w)e.uniform4i(this.addr,t.x,t.y,t.z,t.w),n[0]=t.x,n[1]=t.y,n[2]=t.z,n[3]=t.w}else{if(og(n,t))return;e.uniform4iv(this.addr,t),rg(n,t)}}function ELo(e,t){let n=this.cache;if(n[0]===t)return;e.uniform1ui(this.addr,t),n[0]=t}function MLo(e,t){let n=this.cache;if(t.x!==void 0){if(n[0]!==t.x||n[1]!==t.y)e.uniform2ui(this.addr,t.x,t.y),n[0]=t.x,n[1]=t.y}else{if(og(n,t))return;e.uniform2uiv(this.addr,t),rg(n,t)}}function wLo(e,t){let n=this.cache;if(t.x!==void 0){if(n[0]!==t.x||n[1]!==t.y||n[2]!==t.z)e.uniform3ui(this.addr,t.x,t.y,t.z),n[0]=t.x,n[1]=t.y,n[2]=t.z}else{if(og(n,t))return;e.uniform3uiv(this.addr,t),rg(n,t)}}function BLo(e,t){let n=this.cache;if(t.x!==void 0){if(n[0]!==t.x||n[1]!==t.y||n[2]!==t.z||n[3]!==t.w)e.uniform4ui(this.addr,t.x,t.y,t.z,t.w),n[0]=t.x,n[1]=t.y,n[2]=t.z,n[3]=t.w}else{if(og(n,t))return;e.uniform4uiv(this.addr,t),rg(n,t)}}function TLo(e,t,n){let o=this.cache,r=n.allocateTextureUnit();if(o[0]!==r)e.uniform1i(this.addr,r),o[0]=r;let i=this.type===e.SAMPLER_2D_SHADOW?gEt:_Et;n.setTexture2D(t||i,r)}function DLo(e,t,n){let o=this.cache,r=n.allocateTextureUnit();if(o[0]!==r)e.uniform1i(this.addr,r),o[0]=r;n.setTexture3D(t||fEt,r)}function NLo(e,t,n){let o=this.cache,r=n.allocateTextureUnit();if(o[0]!==r)e.uniform1i(this.addr,r),o[0]=r;n.setTextureCube(t||yEt,r)}function RLo(e,t,n){let o=this.cache,r=n.allocateTextureUnit();if(o[0]!==r)e.uniform1i(this.addr,r),o[0]=r;n.setTexture2DArray(t||AEt,r)}function QLo(e){switch(e){case 5126:return gLo;case 35664:return ALo;case 35665:return fLo;case 35666:return yLo;case 35674:return xLo;case 35675:return CLo;case 35676:return bLo;case 5124:case 35670:return ILo;case 35667:case 35671:return vLo;case 35668:case 35672:return SLo;case 35669:case 35673:return PLo;case 5125:return ELo;case 36294:return MLo;case 36295:return wLo;case 36296:return BLo;case 35678:case 36198:case 36298:case 36306:case 35682:return TLo;case 35679:case 36299:case 36307:return DLo;case 35680:case 36300:case 36308:case 36293:return NLo;case 36289:case 36303:case 36311:case 36292:return RLo}}function kLo(e,t){e.uniform1fv(this.addr,t)}function LLo(e,t){let n=Wj(t,this.size,2);e.uniform2fv(this.addr,n)}function HLo(e,t){let n=Wj(t,this.size,3);e.uniform3fv(this.addr,n)}function FLo(e,t){let n=Wj(t,this.size,4);e.uniform4fv(this.addr,n)}function zLo(e,t){let n=Wj(t,this.size,4);e.uniformMatrix2fv(this.addr,!1,n)}function OLo(e,t){let n=Wj(t,this.size,9);e.uniformMatrix3fv(this.addr,!1,n)}function VLo(e,t){let n=Wj(t,this.size,16);e.uniformMatrix4fv(this.addr,!1,n)}function YLo(e,t){e.uniform1iv(this.addr,t)}function GLo(e,t){e.uniform2iv(this.addr,t)}function ULo(e,t){e.uniform3iv(this.addr,t)}function WLo(e,t){e.uniform4iv(this.addr,t)}function XLo(e,t){e.uniform1uiv(this.addr,t)}function jLo(e,t){e.uniform2uiv(this.addr,t)}function KLo(e,t){e.uniform3uiv(this.addr,t)}function $Lo(e,t){e.uniform4uiv(this.addr,t)}function qLo(e,t,n){let o=this.cache,r=t.length,i=Xye(n,r);if(!og(o,i))e.uniform1iv(this.addr,i),rg(o,i);for(let s=0;s!==r;++s)n.setTexture2D(t[s]||_Et,i[s])}function JLo(e,t,n){let o=this.cache,r=t.length,i=Xye(n,r);if(!og(o,i))e.uniform1iv(this.addr,i),rg(o,i);for(let s=0;s!==r;++s)n.setTexture3D(t[s]||fEt,i[s])}function ZLo(e,t,n){let o=this.cache,r=t.length,i=Xye(n,r);if(!og(o,i))e.uniform1iv(this.addr,i),rg(o,i);for(let s=0;s!==r;++s)n.setTextureCube(t[s]||yEt,i[s])}function eHo(e,t,n){let o=this.cache,r=t.length,i=Xye(n,r);if(!og(o,i))e.uniform1iv(this.addr,i),rg(o,i);for(let s=0;s!==r;++s)n.setTexture2DArray(t[s]||AEt,i[s])}function tHo(e){switch(e){case 5126:return kLo;case 35664:return LLo;case 35665:return HLo;case 35666:return FLo;case 35674:return zLo;case 35675:return OLo;case 35676:return VLo;case 5124:case 35670:return YLo;case 35667:case 35671:return GLo;case 35668:case 35672:return ULo;case 35669:case 35673:return WLo;case 5125:return XLo;case 36294:return jLo;case 36295:return KLo;case 36296:return $Lo;case 35678:case 36198:case 36298:case 36306:case 35682:return qLo;case 35679:case 36299:case 36307:return JLo;case 35680:case 36300:case 36308:case 36293:return ZLo;case 36289:case 36303:case 36311:case 36292:return eHo}}class xEt{constructor(e,t,n){this.id=e,this.addr=n,this.cache=[],this.type=t.type,this.setValue=QLo(t.type)}}class CEt{constructor(e,t,n){this.id=e,this.addr=n,this.cache=[],this.type=t.type,this.size=t.size,this.setValue=tHo(t.type)}}class bEt{constructor(e){this.id=e,this.seq=[],this.map={}}setValue(e,t,n){let o=this.seq;for(let r=0,i=o.length;r!==i;++r){let s=o[r];s.setValue(e,t[s.id],n)}}}var Wze=/(\w+)(\])?(\[|\.)?/g;function yPt(e,t){e.seq.push(t),e.map[t.id]=t}function nHo(e,t,n){let o=e.name,r=o.length;Wze.lastIndex=0;while(!0){let i=Wze.exec(o),s=Wze.lastIndex,a=i[1],c=i[2]==="]",l=i[3];if(c)a=a|0;if(l===void 0||l==="["&&s+2===r){yPt(n,l===void 0?new xEt(a,e,t):new CEt(a,e,t));break}else{let d=n.map[a];if(d===void 0)d=new bEt(a),yPt(n,d);n=d}}}class Bie{constructor(e,t){this.seq=[],this.map={};let n=e.getProgramParameter(t,e.ACTIVE_UNIFORMS);for(let o=0;o<n;++o){let r=e.getActiveUniform(t,o),i=e.getUniformLocation(t,r.name);nHo(r,i,this)}}setValue(e,t,n,o){let r=this.map[t];if(r!==void 0)r.setValue(e,n,o)}setOptional(e,t,n){let o=t[n];if(o!==void 0)this.setValue(e,n,o)}static upload(e,t,n,o){for(let r=0,i=t.length;r!==i;++r){let s=t[r],a=n[s.id];if(a.needsUpdate!==!1)s.setValue(e,a.value,o)}}static seqWithValue(e,t){let n=[];for(let o=0,r=e.length;o!==r;++o){let i=e[o];if(i.id in t)n.push(i)}return n}}function xPt(e,t,n){let o=e.createShader(t);return e.shaderSource(o,n),e.compileShader(o),o}var oHo=37297,rHo=0;function iHo(e,t){let n=e.split(`
`),o=[],r=Math.max(t-6,0),i=Math.min(t+6,n.length);for(let s=r;s<i;s++){let a=s+1;o.push(`${a===t?">":" "} ${a}: ${n[s]}`)}return o.join(`
`)}function sHo(e){let t=Th.getPrimaries(Th.workingColorSpace),n=Th.getPrimaries(e),o;if(t===n)o="";else if(t==="p3"&&n==="rec709")o="LinearDisplayP3ToLinearSRGB";else if(t==="rec709"&&n==="p3")o="LinearSRGBToLinearDisplayP3";switch(e){case"srgb-linear":case"display-p3-linear":return[o,"LinearTransferOETF"];case"srgb":case"display-p3":return[o,"sRGBTransferOETF"];default:return console.warn("THREE.WebGLProgram: Unsupported color space:",e),[o,"LinearTransferOETF"]}}function CPt(e,t,n){let o=e.getShaderParameter(t,e.COMPILE_STATUS),r=e.getShaderInfoLog(t).trim();if(o&&r==="")return"";let i=/ERROR: 0:(\d+)/.exec(r);if(i){let s=parseInt(i[1]);return n.toUpperCase()+`

`+r+`

`+iHo(e.getShaderSource(t),s)}else return r}function aHo(e,t){let n=sHo(t);return`vec4 ${e}( vec4 value ) { return ${n[0]}( ${n[1]}( value ) ); }`}function cHo(e,t){let n;switch(t){case 1:n="Linear";break;case 2:n="Reinhard";break;case 3:n="OptimizedCineon";break;case 4:n="ACESFilmic";break;case 6:n="AgX";break;case 7:n="Neutral";break;case 5:n="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",t),n="Linear"}return"vec3 "+e+"( vec3 color ) { return "+n+"ToneMapping( color ); }"}function lHo(e){return[e.extensionClipCullDistance?"#extension GL_ANGLE_clip_cull_distance : require":"",e.extensionMultiDraw?"#extension GL_ANGLE_multi_draw : require":""].filter(Mie).join(`
`)}function hHo(e){let t=[];for(let n in e){let o=e[n];if(o===!1)continue;t.push("#define "+n+" "+o)}return t.join(`
`)}function dHo(e,t){let n={},o=e.getProgramParameter(t,e.ACTIVE_ATTRIBUTES);for(let r=0;r<o;r++){let i=e.getActiveAttrib(t,r),s=i.name,a=1;if(i.type===e.FLOAT_MAT2)a=2;if(i.type===e.FLOAT_MAT3)a=3;if(i.type===e.FLOAT_MAT4)a=4;n[s]={type:i.type,location:e.getAttribLocation(t,s),locationSize:a}}return n}function Mie(e){return e!==""}function bPt(e,t){let n=t.numSpotLightShadows+t.numSpotLightMaps-t.numSpotLightShadowsWithMaps;return e.replace(/NUM_DIR_LIGHTS/g,t.numDirLights).replace(/NUM_SPOT_LIGHTS/g,t.numSpotLights).replace(/NUM_SPOT_LIGHT_MAPS/g,t.numSpotLightMaps).replace(/NUM_SPOT_LIGHT_COORDS/g,n).replace(/NUM_RECT_AREA_LIGHTS/g,t.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g,t.numPointLights).replace(/NUM_HEMI_LIGHTS/g,t.numHemiLights).replace(/NUM_DIR_LIGHT_SHADOWS/g,t.numDirLightShadows).replace(/NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS/g,t.numSpotLightShadowsWithMaps).replace(/NUM_SPOT_LIGHT_SHADOWS/g,t.numSpotLightShadows).replace(/NUM_POINT_LIGHT_SHADOWS/g,t.numPointLightShadows)}function IPt(e,t){return e.replace(/NUM_CLIPPING_PLANES/g,t.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,t.numClippingPlanes-t.numClipIntersection)}var uHo=/^[ \t]*#include +<([\w\d./]+)>/gm;function nOe(e){return e.replace(uHo,mHo)}var pHo=new Map;function mHo(e,t){let n=Ma[t];if(n===void 0){let o=pHo.get(t);if(o!==void 0)n=Ma[o],console.warn('THREE.WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.',t,o);else throw Error("Can not resolve #include <"+t+">")}return nOe(n)}var _Ho=/#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*i\s*\+\+\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g;function vPt(e){return e.replace(_Ho,gHo)}function gHo(e,t,n,o){let r="";for(let i=parseInt(t);i<parseInt(n);i++)r+=o.replace(/\[\s*i\s*\]/g,"[ "+i+" ]").replace(/UNROLLED_LOOP_INDEX/g,i);return r}function SPt(e){let t=`precision ${e.precision} float;
	precision ${e.precision} int;
	precision ${e.precision} sampler2D;
	precision ${e.precision} samplerCube;
	precision ${e.precision} sampler3D;
	precision ${e.precision} sampler2DArray;
	precision ${e.precision} sampler2DShadow;
	precision ${e.precision} samplerCubeShadow;
	precision ${e.precision} sampler2DArrayShadow;
	precision ${e.precision} isampler2D;
	precision ${e.precision} isampler3D;
	precision ${e.precision} isamplerCube;
	precision ${e.precision} isampler2DArray;
	precision ${e.precision} usampler2D;
	precision ${e.precision} usampler3D;
	precision ${e.precision} usamplerCube;
	precision ${e.precision} usampler2DArray;
	`;if(e.precision==="highp")t+=`
#define HIGH_PRECISION`;else if(e.precision==="mediump")t+=`
#define MEDIUM_PRECISION`;else if(e.precision==="lowp")t+=`
#define LOW_PRECISION`;return t}function AHo(e){let t="SHADOWMAP_TYPE_BASIC";if(e.shadowMapType===1)t="SHADOWMAP_TYPE_PCF";else if(e.shadowMapType===2)t="SHADOWMAP_TYPE_PCF_SOFT";else if(e.shadowMapType===3)t="SHADOWMAP_TYPE_VSM";return t}function fHo(e){let t="ENVMAP_TYPE_CUBE";if(e.envMap)switch(e.envMapMode){case 301:case 302:t="ENVMAP_TYPE_CUBE";break;case 306:t="ENVMAP_TYPE_CUBE_UV";break}return t}function yHo(e){let t="ENVMAP_MODE_REFLECTION";if(e.envMap)switch(e.envMapMode){case 302:t="ENVMAP_MODE_REFRACTION";break}return t}function xHo(e){let t="ENVMAP_BLENDING_NONE";if(e.envMap)switch(e.combine){case 0:t="ENVMAP_BLENDING_MULTIPLY";break;case 1:t="ENVMAP_BLENDING_MIX";break;case 2:t="ENVMAP_BLENDING_ADD";break}return t}function CHo(e){let t=e.envMapCubeUVHeight;if(t===null)return null;let n=Math.log2(t)-2,o=1/t;return{texelWidth:1/(3*Math.max(Math.pow(2,n),112)),texelHeight:o,maxMip:n}}function bHo(e,t,n,o){let r=e.getContext(),{defines:i,vertexShader:s,fragmentShader:a}=n,c=AHo(n),l=fHo(n),h=yHo(n),d=xHo(n),u=CHo(n),_=lHo(n),p=hHo(i),m=r.createProgram(),A,g,f=n.glslVersion?"#version "+n.glslVersion+`
`:"";if(n.isRawShaderMaterial){if(A=["#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,p].filter(Mie).join(`
`),A.length>0)A+=`
`;if(g=["#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,p].filter(Mie).join(`
`),g.length>0)g+=`
`}else A=[SPt(n),"#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,p,n.extensionClipCullDistance?"#define USE_CLIP_DISTANCE":"",n.batching?"#define USE_BATCHING":"",n.batchingColor?"#define USE_BATCHING_COLOR":"",n.instancing?"#define USE_INSTANCING":"",n.instancingColor?"#define USE_INSTANCING_COLOR":"",n.instancingMorph?"#define USE_INSTANCING_MORPH":"",n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.map?"#define USE_MAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+h:"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",n.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",n.displacementMap?"#define USE_DISPLACEMENTMAP":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.anisotropy?"#define USE_ANISOTROPY":"",n.anisotropyMap?"#define USE_ANISOTROPYMAP":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",n.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",n.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.alphaHash?"#define USE_ALPHAHASH":"",n.transmission?"#define USE_TRANSMISSION":"",n.transmissionMap?"#define USE_TRANSMISSIONMAP":"",n.thicknessMap?"#define USE_THICKNESSMAP":"",n.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",n.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",n.mapUv?"#define MAP_UV "+n.mapUv:"",n.alphaMapUv?"#define ALPHAMAP_UV "+n.alphaMapUv:"",n.lightMapUv?"#define LIGHTMAP_UV "+n.lightMapUv:"",n.aoMapUv?"#define AOMAP_UV "+n.aoMapUv:"",n.emissiveMapUv?"#define EMISSIVEMAP_UV "+n.emissiveMapUv:"",n.bumpMapUv?"#define BUMPMAP_UV "+n.bumpMapUv:"",n.normalMapUv?"#define NORMALMAP_UV "+n.normalMapUv:"",n.displacementMapUv?"#define DISPLACEMENTMAP_UV "+n.displacementMapUv:"",n.metalnessMapUv?"#define METALNESSMAP_UV "+n.metalnessMapUv:"",n.roughnessMapUv?"#define ROUGHNESSMAP_UV "+n.roughnessMapUv:"",n.anisotropyMapUv?"#define ANISOTROPYMAP_UV "+n.anisotropyMapUv:"",n.clearcoatMapUv?"#define CLEARCOATMAP_UV "+n.clearcoatMapUv:"",n.clearcoatNormalMapUv?"#define CLEARCOAT_NORMALMAP_UV "+n.clearcoatNormalMapUv:"",n.clearcoatRoughnessMapUv?"#define CLEARCOAT_ROUGHNESSMAP_UV "+n.clearcoatRoughnessMapUv:"",n.iridescenceMapUv?"#define IRIDESCENCEMAP_UV "+n.iridescenceMapUv:"",n.iridescenceThicknessMapUv?"#define IRIDESCENCE_THICKNESSMAP_UV "+n.iridescenceThicknessMapUv:"",n.sheenColorMapUv?"#define SHEEN_COLORMAP_UV "+n.sheenColorMapUv:"",n.sheenRoughnessMapUv?"#define SHEEN_ROUGHNESSMAP_UV "+n.sheenRoughnessMapUv:"",n.specularMapUv?"#define SPECULARMAP_UV "+n.specularMapUv:"",n.specularColorMapUv?"#define SPECULAR_COLORMAP_UV "+n.specularColorMapUv:"",n.specularIntensityMapUv?"#define SPECULAR_INTENSITYMAP_UV "+n.specularIntensityMapUv:"",n.transmissionMapUv?"#define TRANSMISSIONMAP_UV "+n.transmissionMapUv:"",n.thicknessMapUv?"#define THICKNESSMAP_UV "+n.thicknessMapUv:"",n.vertexTangents&&n.flatShading===!1?"#define USE_TANGENT":"",n.vertexColors?"#define USE_COLOR":"",n.vertexAlphas?"#define USE_COLOR_ALPHA":"",n.vertexUv1s?"#define USE_UV1":"",n.vertexUv2s?"#define USE_UV2":"",n.vertexUv3s?"#define USE_UV3":"",n.pointsUvs?"#define USE_POINTS_UV":"",n.flatShading?"#define FLAT_SHADED":"",n.skinning?"#define USE_SKINNING":"",n.morphTargets?"#define USE_MORPHTARGETS":"",n.morphNormals&&n.flatShading===!1?"#define USE_MORPHNORMALS":"",n.morphColors?"#define USE_MORPHCOLORS":"",n.morphTargetsCount>0?"#define MORPHTARGETS_TEXTURE_STRIDE "+n.morphTextureStride:"",n.morphTargetsCount>0?"#define MORPHTARGETS_COUNT "+n.morphTargetsCount:"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+c:"",n.sizeAttenuation?"#define USE_SIZEATTENUATION":"",n.numLightProbes>0?"#define USE_LIGHT_PROBES":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING","\tattribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR","\tattribute vec3 instanceColor;","#endif","#ifdef USE_INSTANCING_MORPH","\tuniform sampler2D morphTexture;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_UV1","\tattribute vec2 uv1;","#endif","#ifdef USE_UV2","\tattribute vec2 uv2;","#endif","#ifdef USE_UV3","\tattribute vec2 uv3;","#endif","#ifdef USE_TANGENT","\tattribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )","\tattribute vec4 color;","#elif defined( USE_COLOR )","\tattribute vec3 color;","#endif","#ifdef USE_SKINNING","\tattribute vec4 skinIndex;","\tattribute vec4 skinWeight;","#endif",`
`].filter(Mie).join(`
`),g=[SPt(n),"#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,p,n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.alphaToCoverage?"#define ALPHA_TO_COVERAGE":"",n.map?"#define USE_MAP":"",n.matcap?"#define USE_MATCAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+l:"",n.envMap?"#define "+h:"",n.envMap?"#define "+d:"",u?"#define CUBEUV_TEXEL_WIDTH "+u.texelWidth:"",u?"#define CUBEUV_TEXEL_HEIGHT "+u.texelHeight:"",u?"#define CUBEUV_MAX_MIP "+u.maxMip+".0":"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",n.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.anisotropy?"#define USE_ANISOTROPY":"",n.anisotropyMap?"#define USE_ANISOTROPYMAP":"",n.clearcoat?"#define USE_CLEARCOAT":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.dispersion?"#define USE_DISPERSION":"",n.iridescence?"#define USE_IRIDESCENCE":"",n.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",n.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",n.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.alphaTest?"#define USE_ALPHATEST":"",n.alphaHash?"#define USE_ALPHAHASH":"",n.sheen?"#define USE_SHEEN":"",n.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",n.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",n.transmission?"#define USE_TRANSMISSION":"",n.transmissionMap?"#define USE_TRANSMISSIONMAP":"",n.thicknessMap?"#define USE_THICKNESSMAP":"",n.vertexTangents&&n.flatShading===!1?"#define USE_TANGENT":"",n.vertexColors||n.instancingColor||n.batchingColor?"#define USE_COLOR":"",n.vertexAlphas?"#define USE_COLOR_ALPHA":"",n.vertexUv1s?"#define USE_UV1":"",n.vertexUv2s?"#define USE_UV2":"",n.vertexUv3s?"#define USE_UV3":"",n.pointsUvs?"#define USE_POINTS_UV":"",n.gradientMap?"#define USE_GRADIENTMAP":"",n.flatShading?"#define FLAT_SHADED":"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+c:"",n.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",n.numLightProbes>0?"#define USE_LIGHT_PROBES":"",n.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",n.toneMapping!==0?"#define TONE_MAPPING":"",n.toneMapping!==0?Ma.tonemapping_pars_fragment:"",n.toneMapping!==0?cHo("toneMapping",n.toneMapping):"",n.dithering?"#define DITHERING":"",n.opaque?"#define OPAQUE":"",Ma.colorspace_pars_fragment,aHo("linearToOutputTexel",n.outputColorSpace),n.useDepthPacking?"#define DEPTH_PACKING "+n.depthPacking:"",`
`].filter(Mie).join(`
`);if(s=nOe(s),s=bPt(s,n),s=IPt(s,n),a=nOe(a),a=bPt(a,n),a=IPt(a,n),s=vPt(s),a=vPt(a),n.isRawShaderMaterial!==!0)f=`#version 300 es
`,A=[_,"#define attribute in","#define varying out","#define texture2D texture"].join(`
`)+`
`+A,g=["#define varying in",n.glslVersion==="300 es"?"":"layout(location = 0) out highp vec4 pc_fragColor;",n.glslVersion==="300 es"?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth","#define texture2D texture","#define textureCube texture","#define texture2DProj textureProj","#define texture2DLodEXT textureLod","#define texture2DProjLodEXT textureProjLod","#define textureCubeLodEXT textureLod","#define texture2DGradEXT textureGrad","#define texture2DProjGradEXT textureProjGrad","#define textureCubeGradEXT textureGrad"].join(`
`)+`
`+g;let y=f+A+s,x=f+g+a,C=xPt(r,r.VERTEX_SHADER,y),b=xPt(r,r.FRAGMENT_SHADER,x);if(r.attachShader(m,C),r.attachShader(m,b),n.index0AttributeName!==void 0)r.bindAttribLocation(m,0,n.index0AttributeName);else if(n.morphTargets===!0)r.bindAttribLocation(m,0,"position");r.linkProgram(m);function I(B){if(e.debug.checkShaderErrors){let T=r.getProgramInfoLog(m).trim(),N=r.getShaderInfoLog(C).trim(),D=r.getShaderInfoLog(b).trim(),L=!0,H=!0;if(r.getProgramParameter(m,r.LINK_STATUS)===!1)if(L=!1,typeof e.debug.onShaderError==="function")e.debug.onShaderError(r,m,C,b);else{let V=CPt(r,C,"vertex"),O=CPt(r,b,"fragment");console.error("THREE.WebGLProgram: Shader Error "+r.getError()+" - VALIDATE_STATUS "+r.getProgramParameter(m,r.VALIDATE_STATUS)+`

Material Name: `+B.name+`
Material Type: `+B.type+`

Program Info Log: `+T+`
`+V+`
`+O)}else if(T!=="")console.warn("THREE.WebGLProgram: Program Info Log:",T);else if(N===""||D==="")H=!1;if(H)B.diagnostics={runnable:L,programLog:T,vertexShader:{log:N,prefix:A},fragmentShader:{log:D,prefix:g}}}r.deleteShader(C),r.deleteShader(b),v=new Bie(r,m),P=dHo(r,m)}let v;this.getUniforms=function(){if(v===void 0)I(this);return v};let P;this.getAttributes=function(){if(P===void 0)I(this);return P};let M=n.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){if(M===!1)M=r.getProgramParameter(m,oHo);return M},this.destroy=function(){o.releaseStatesOfProgram(this),r.deleteProgram(m),this.program=void 0},this.type=n.shaderType,this.name=n.shaderName,this.id=rHo++,this.cacheKey=t,this.usedTimes=1,this.program=m,this.vertexShader=C,this.fragmentShader=b,this}var IHo=0;class IEt{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e){let{vertexShader:t,fragmentShader:n}=e,o=this._getShaderStage(t),r=this._getShaderStage(n),i=this._getShaderCacheForMaterial(e);if(i.has(o)===!1)i.add(o),o.usedTimes++;if(i.has(r)===!1)i.add(r),r.usedTimes++;return this}remove(e){let t=this.materialCache.get(e);for(let n of t)if(n.usedTimes--,n.usedTimes===0)this.shaderCache.delete(n.code);return this.materialCache.delete(e),this}getVertexShaderID(e){return this._getShaderStage(e.vertexShader).id}getFragmentShaderID(e){return this._getShaderStage(e.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(e){let t=this.materialCache,n=t.get(e);if(n===void 0)n=new Set,t.set(e,n);return n}_getShaderStage(e){let t=this.shaderCache,n=t.get(e);if(n===void 0)n=new vEt(e),t.set(e,n);return n}}class vEt{constructor(e){this.id=IHo++,this.code=e,this.usedTimes=0}}function vHo(e,t,n,o,r,i,s){let a=new Uye,c=new IEt,l=new Set,h=[],{logarithmicDepthBuffer:d,vertexTextures:u,precision:_}=r,p={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"};function m(P){if(l.add(P),P===0)return"uv";return`uv${P}`}function A(P,M,B,T,N){let D=T.fog,L=N.geometry,H=P.isMeshStandardMaterial?T.environment:null,V=(P.isMeshStandardMaterial?n:t).get(P.envMap||H),O=!!V&&V.mapping===306?V.image.height:null,U=p[P.type];if(P.precision!==null){if(_=r.getMaxPrecision(P.precision),_!==P.precision)console.warn("THREE.WebGLProgram.getParameters:",P.precision,"not supported, using",_,"instead.")}let j=L.morphAttributes.position||L.morphAttributes.normal||L.morphAttributes.color,Y=j!==void 0?j.length:0,X=0;if(L.morphAttributes.position!==void 0)X=1;if(L.morphAttributes.normal!==void 0)X=2;if(L.morphAttributes.color!==void 0)X=3;let K,J,ee,se;if(U){let st=LI[U];K=st.vertexShader,J=st.fragmentShader}else K=P.vertexShader,J=P.fragmentShader,c.update(P),ee=c.getVertexShaderID(P),se=c.getFragmentShaderID(P);let ne=e.getRenderTarget(),re=N.isInstancedMesh===!0,Z=N.isBatchedMesh===!0,te=!!P.map,ie=!!P.matcap,ce=!!V,ue=!!P.aoMap,de=!!P.lightMap,me=!!P.bumpMap,ge=!!P.normalMap,xe=!!P.displacementMap,Ee=!!P.emissiveMap,Re=!!P.metalnessMap,Me=!!P.roughnessMap,_e=P.anisotropy>0,ye=P.clearcoat>0,Se=P.dispersion>0,Ne=P.iridescence>0,Le=P.sheen>0,nt=P.transmission>0,dt=_e&&!!P.anisotropyMap,rt=ye&&!!P.clearcoatMap,pt=ye&&!!P.clearcoatNormalMap,ct=ye&&!!P.clearcoatRoughnessMap,Ct=Ne&&!!P.iridescenceMap,kt=Ne&&!!P.iridescenceThicknessMap,Lt=Le&&!!P.sheenColorMap,Bt=Le&&!!P.sheenRoughnessMap,xt=!!P.specularMap,Yt=!!P.specularColorMap,ut=!!P.specularIntensityMap,Ze=nt&&!!P.transmissionMap,Fe=nt&&!!P.thicknessMap,tt=!!P.gradientMap,Je=!!P.alphaMap,$e=P.alphaTest>0,ft=!!P.alphaHash,vt=!!P.extensions,Ye=0;if(P.toneMapped){if(ne===null||ne.isXRRenderTarget===!0)Ye=e.toneMapping}let je={shaderID:U,shaderType:P.type,shaderName:P.name,vertexShader:K,fragmentShader:J,defines:P.defines,customVertexShaderID:ee,customFragmentShaderID:se,isRawShaderMaterial:P.isRawShaderMaterial===!0,glslVersion:P.glslVersion,precision:_,batching:Z,batchingColor:Z&&N._colorsTexture!==null,instancing:re,instancingColor:re&&N.instanceColor!==null,instancingMorph:re&&N.morphTexture!==null,supportsVertexTextures:u,outputColorSpace:ne===null?e.outputColorSpace:ne.isXRRenderTarget===!0?ne.texture.colorSpace:"srgb-linear",alphaToCoverage:!!P.alphaToCoverage,map:te,matcap:ie,envMap:ce,envMapMode:ce&&V.mapping,envMapCubeUVHeight:O,aoMap:ue,lightMap:de,bumpMap:me,normalMap:ge,displacementMap:u&&xe,emissiveMap:Ee,normalMapObjectSpace:ge&&P.normalMapType===1,normalMapTangentSpace:ge&&P.normalMapType===0,metalnessMap:Re,roughnessMap:Me,anisotropy:_e,anisotropyMap:dt,clearcoat:ye,clearcoatMap:rt,clearcoatNormalMap:pt,clearcoatRoughnessMap:ct,dispersion:Se,iridescence:Ne,iridescenceMap:Ct,iridescenceThicknessMap:kt,sheen:Le,sheenColorMap:Lt,sheenRoughnessMap:Bt,specularMap:xt,specularColorMap:Yt,specularIntensityMap:ut,transmission:nt,transmissionMap:Ze,thicknessMap:Fe,gradientMap:tt,opaque:P.transparent===!1&&P.blending===1&&P.alphaToCoverage===!1,alphaMap:Je,alphaTest:$e,alphaHash:ft,combine:P.combine,mapUv:te&&m(P.map.channel),aoMapUv:ue&&m(P.aoMap.channel),lightMapUv:de&&m(P.lightMap.channel),bumpMapUv:me&&m(P.bumpMap.channel),normalMapUv:ge&&m(P.normalMap.channel),displacementMapUv:xe&&m(P.displacementMap.channel),emissiveMapUv:Ee&&m(P.emissiveMap.channel),metalnessMapUv:Re&&m(P.metalnessMap.channel),roughnessMapUv:Me&&m(P.roughnessMap.channel),anisotropyMapUv:dt&&m(P.anisotropyMap.channel),clearcoatMapUv:rt&&m(P.clearcoatMap.channel),clearcoatNormalMapUv:pt&&m(P.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:ct&&m(P.clearcoatRoughnessMap.channel),iridescenceMapUv:Ct&&m(P.iridescenceMap.channel),iridescenceThicknessMapUv:kt&&m(P.iridescenceThicknessMap.channel),sheenColorMapUv:Lt&&m(P.sheenColorMap.channel),sheenRoughnessMapUv:Bt&&m(P.sheenRoughnessMap.channel),specularMapUv:xt&&m(P.specularMap.channel),specularColorMapUv:Yt&&m(P.specularColorMap.channel),specularIntensityMapUv:ut&&m(P.specularIntensityMap.channel),transmissionMapUv:Ze&&m(P.transmissionMap.channel),thicknessMapUv:Fe&&m(P.thicknessMap.channel),alphaMapUv:Je&&m(P.alphaMap.channel),vertexTangents:!!L.attributes.tangent&&(ge||_e),vertexColors:P.vertexColors,vertexAlphas:P.vertexColors===!0&&!!L.attributes.color&&L.attributes.color.itemSize===4,pointsUvs:N.isPoints===!0&&!!L.attributes.uv&&(te||Je),fog:!!D,useFog:P.fog===!0,fogExp2:!!D&&D.isFogExp2,flatShading:P.flatShading===!0,sizeAttenuation:P.sizeAttenuation===!0,logarithmicDepthBuffer:d,skinning:N.isSkinnedMesh===!0,morphTargets:L.morphAttributes.position!==void 0,morphNormals:L.morphAttributes.normal!==void 0,morphColors:L.morphAttributes.color!==void 0,morphTargetsCount:Y,morphTextureStride:X,numDirLights:M.directional.length,numPointLights:M.point.length,numSpotLights:M.spot.length,numSpotLightMaps:M.spotLightMap.length,numRectAreaLights:M.rectArea.length,numHemiLights:M.hemi.length,numDirLightShadows:M.directionalShadowMap.length,numPointLightShadows:M.pointShadowMap.length,numSpotLightShadows:M.spotShadowMap.length,numSpotLightShadowsWithMaps:M.numSpotLightShadowsWithMaps,numLightProbes:M.numLightProbes,numClippingPlanes:s.numPlanes,numClipIntersection:s.numIntersection,dithering:P.dithering,shadowMapEnabled:e.shadowMap.enabled&&B.length>0,shadowMapType:e.shadowMap.type,toneMapping:Ye,decodeVideoTexture:te&&P.map.isVideoTexture===!0&&Th.getTransfer(P.map.colorSpace)==="srgb",premultipliedAlpha:P.premultipliedAlpha,doubleSided:P.side===2,flipSided:P.side===1,useDepthPacking:P.depthPacking>=0,depthPacking:P.depthPacking||0,index0AttributeName:P.index0AttributeName,extensionClipCullDistance:vt&&P.extensions.clipCullDistance===!0&&o.has("WEBGL_clip_cull_distance"),extensionMultiDraw:vt&&P.extensions.multiDraw===!0&&o.has("WEBGL_multi_draw"),rendererExtensionParallelShaderCompile:o.has("KHR_parallel_shader_compile"),customProgramCacheKey:P.customProgramCacheKey()};return je.vertexUv1s=l.has(1),je.vertexUv2s=l.has(2),je.vertexUv3s=l.has(3),l.clear(),je}function g(P){let M=[];if(P.shaderID)M.push(P.shaderID);else M.push(P.customVertexShaderID),M.push(P.customFragmentShaderID);if(P.defines!==void 0)for(let B in P.defines)M.push(B),M.push(P.defines[B]);if(P.isRawShaderMaterial===!1)f(M,P),y(M,P),M.push(e.outputColorSpace);return M.push(P.customProgramCacheKey),M.join()}function f(P,M){P.push(M.precision),P.push(M.outputColorSpace),P.push(M.envMapMode),P.push(M.envMapCubeUVHeight),P.push(M.mapUv),P.push(M.alphaMapUv),P.push(M.lightMapUv),P.push(M.aoMapUv),P.push(M.bumpMapUv),P.push(M.normalMapUv),P.push(M.displacementMapUv),P.push(M.emissiveMapUv),P.push(M.metalnessMapUv),P.push(M.roughnessMapUv),P.push(M.anisotropyMapUv),P.push(M.clearcoatMapUv),P.push(M.clearcoatNormalMapUv),P.push(M.clearcoatRoughnessMapUv),P.push(M.iridescenceMapUv),P.push(M.iridescenceThicknessMapUv),P.push(M.sheenColorMapUv),P.push(M.sheenRoughnessMapUv),P.push(M.specularMapUv),P.push(M.specularColorMapUv),P.push(M.specularIntensityMapUv),P.push(M.transmissionMapUv),P.push(M.thicknessMapUv),P.push(M.combine),P.push(M.fogExp2),P.push(M.sizeAttenuation),P.push(M.morphTargetsCount),P.push(M.morphAttributeCount),P.push(M.numDirLights),P.push(M.numPointLights),P.push(M.numSpotLights),P.push(M.numSpotLightMaps),P.push(M.numHemiLights),P.push(M.numRectAreaLights),P.push(M.numDirLightShadows),P.push(M.numPointLightShadows),P.push(M.numSpotLightShadows),P.push(M.numSpotLightShadowsWithMaps),P.push(M.numLightProbes),P.push(M.shadowMapType),P.push(M.toneMapping),P.push(M.numClippingPlanes),P.push(M.numClipIntersection),P.push(M.depthPacking)}function y(P,M){if(a.disableAll(),M.supportsVertexTextures)a.enable(0);if(M.instancing)a.enable(1);if(M.instancingColor)a.enable(2);if(M.instancingMorph)a.enable(3);if(M.matcap)a.enable(4);if(M.envMap)a.enable(5);if(M.normalMapObjectSpace)a.enable(6);if(M.normalMapTangentSpace)a.enable(7);if(M.clearcoat)a.enable(8);if(M.iridescence)a.enable(9);if(M.alphaTest)a.enable(10);if(M.vertexColors)a.enable(11);if(M.vertexAlphas)a.enable(12);if(M.vertexUv1s)a.enable(13);if(M.vertexUv2s)a.enable(14);if(M.vertexUv3s)a.enable(15);if(M.vertexTangents)a.enable(16);if(M.anisotropy)a.enable(17);if(M.alphaHash)a.enable(18);if(M.batching)a.enable(19);if(M.dispersion)a.enable(20);if(M.batchingColor)a.enable(21);if(P.push(a.mask),a.disableAll(),M.fog)a.enable(0);if(M.useFog)a.enable(1);if(M.flatShading)a.enable(2);if(M.logarithmicDepthBuffer)a.enable(3);if(M.skinning)a.enable(4);if(M.morphTargets)a.enable(5);if(M.morphNormals)a.enable(6);if(M.morphColors)a.enable(7);if(M.premultipliedAlpha)a.enable(8);if(M.shadowMapEnabled)a.enable(9);if(M.doubleSided)a.enable(10);if(M.flipSided)a.enable(11);if(M.useDepthPacking)a.enable(12);if(M.dithering)a.enable(13);if(M.transmission)a.enable(14);if(M.sheen)a.enable(15);if(M.opaque)a.enable(16);if(M.pointsUvs)a.enable(17);if(M.decodeVideoTexture)a.enable(18);if(M.alphaToCoverage)a.enable(19);P.push(a.mask)}function x(P){let M=p[P.type],B;if(M){let T=LI[M];B=mOe.clone(T.uniforms)}else B=P.uniforms;return B}function C(P,M){let B;for(let T=0,N=h.length;T<N;T++){let D=h[T];if(D.cacheKey===M){B=D,++B.usedTimes;break}}if(B===void 0)B=new bHo(e,M,P,i),h.push(B);return B}function b(P){if(--P.usedTimes===0){let M=h.indexOf(P);h[M]=h[h.length-1],h.pop(),P.destroy()}}function I(P){c.remove(P)}function v(){c.dispose()}return{getParameters:A,getProgramCacheKey:g,getUniforms:x,acquireProgram:C,releaseProgram:b,releaseShaderCache:I,programs:h,dispose:v}}function SHo(){let e=new WeakMap;function t(i){let s=e.get(i);if(s===void 0)s={},e.set(i,s);return s}function n(i){e.delete(i)}function o(i,s,a){e.get(i)[s]=a}function r(){e=new WeakMap}return{get:t,remove:n,update:o,dispose:r}}function PHo(e,t){if(e.groupOrder!==t.groupOrder)return e.groupOrder-t.groupOrder;else if(e.renderOrder!==t.renderOrder)return e.renderOrder-t.renderOrder;else if(e.material.id!==t.material.id)return e.material.id-t.material.id;else if(e.z!==t.z)return e.z-t.z;else return e.id-t.id}function PPt(e,t){if(e.groupOrder!==t.groupOrder)return e.groupOrder-t.groupOrder;else if(e.renderOrder!==t.renderOrder)return e.renderOrder-t.renderOrder;else if(e.z!==t.z)return t.z-e.z;else return e.id-t.id}function EPt(){let e=[],t=0,n=[],o=[],r=[];function i(){t=0,n.length=0,o.length=0,r.length=0}function s(d,u,_,p,m,A){let g=e[t];if(g===void 0)g={id:d.id,object:d,geometry:u,material:_,groupOrder:p,renderOrder:d.renderOrder,z:m,group:A},e[t]=g;else g.id=d.id,g.object=d,g.geometry=u,g.material=_,g.groupOrder=p,g.renderOrder=d.renderOrder,g.z=m,g.group=A;return t++,g}function a(d,u,_,p,m,A){let g=s(d,u,_,p,m,A);if(_.transmission>0)o.push(g);else if(_.transparent===!0)r.push(g);else n.push(g)}function c(d,u,_,p,m,A){let g=s(d,u,_,p,m,A);if(_.transmission>0)o.unshift(g);else if(_.transparent===!0)r.unshift(g);else n.unshift(g)}function l(d,u){if(n.length>1)n.sort(d||PHo);if(o.length>1)o.sort(u||PPt);if(r.length>1)r.sort(u||PPt)}function h(){for(let d=t,u=e.length;d<u;d++){let _=e[d];if(_.id===null)break;_.id=null,_.object=null,_.geometry=null,_.material=null,_.group=null}}return{opaque:n,transmissive:o,transparent:r,init:i,push:a,unshift:c,finish:h,sort:l}}function EHo(){let e=new WeakMap;function t(o,r){let i=e.get(o),s;if(i===void 0)s=new EPt,e.set(o,[s]);else if(r>=i.length)s=new EPt,i.push(s);else s=i[r];return s}function n(){e=new WeakMap}return{get:t,dispose:n}}function MHo(){let e={};return{get:function(t){if(e[t.id]!==void 0)return e[t.id];let n;switch(t.type){case"DirectionalLight":n={direction:new Dt,color:new Do};break;case"SpotLight":n={position:new Dt,direction:new Dt,color:new Do,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":n={position:new Dt,color:new Do,distance:0,decay:0};break;case"HemisphereLight":n={direction:new Dt,skyColor:new Do,groundColor:new Do};break;case"RectAreaLight":n={color:new Do,position:new Dt,halfWidth:new Dt,halfHeight:new Dt};break}return e[t.id]=n,n}}}function wHo(){let e={};return{get:function(t){if(e[t.id]!==void 0)return e[t.id];let n;switch(t.type){case"DirectionalLight":n={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new go};break;case"SpotLight":n={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new go};break;case"PointLight":n={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new go,shadowCameraNear:1,shadowCameraFar:1000};break}return e[t.id]=n,n}}}var BHo=0;function THo(e,t){return(t.castShadow?2:0)-(e.castShadow?2:0)+(t.map?1:0)-(e.map?1:0)}function DHo(e){let t=new MHo,n=wHo(),o={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1,numSpotMaps:-1,numLightProbes:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotLightMap:[],spotShadow:[],spotShadowMap:[],spotLightMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],numSpotLightShadowsWithMaps:0,numLightProbes:0};for(let l=0;l<9;l++)o.probe.push(new Dt);let r=new Dt,i=new Fi,s=new Fi;function a(l){let h=0,d=0,u=0;for(let P=0;P<9;P++)o.probe[P].set(0,0,0);let _=0,p=0,m=0,A=0,g=0,f=0,y=0,x=0,C=0,b=0,I=0;l.sort(THo);for(let P=0,M=l.length;P<M;P++){let B=l[P],{color:T,intensity:N,distance:D}=B,L=B.shadow&&B.shadow.map?B.shadow.map.texture:null;if(B.isAmbientLight)h+=T.r*N,d+=T.g*N,u+=T.b*N;else if(B.isLightProbe){for(let H=0;H<9;H++)o.probe[H].addScaledVector(B.sh.coefficients[H],N);I++}else if(B.isDirectionalLight){let H=t.get(B);if(H.color.copy(B.color).multiplyScalar(B.intensity),B.castShadow){let V=B.shadow,O=n.get(B);O.shadowBias=V.bias,O.shadowNormalBias=V.normalBias,O.shadowRadius=V.radius,O.shadowMapSize=V.mapSize,o.directionalShadow[_]=O,o.directionalShadowMap[_]=L,o.directionalShadowMatrix[_]=B.shadow.matrix,f++}o.directional[_]=H,_++}else if(B.isSpotLight){let H=t.get(B);H.position.setFromMatrixPosition(B.matrixWorld),H.color.copy(T).multiplyScalar(N),H.distance=D,H.coneCos=Math.cos(B.angle),H.penumbraCos=Math.cos(B.angle*(1-B.penumbra)),H.decay=B.decay,o.spot[m]=H;let V=B.shadow;if(B.map){if(o.spotLightMap[C]=B.map,C++,V.updateMatrices(B),B.castShadow)b++}if(o.spotLightMatrix[m]=V.matrix,B.castShadow){let O=n.get(B);O.shadowBias=V.bias,O.shadowNormalBias=V.normalBias,O.shadowRadius=V.radius,O.shadowMapSize=V.mapSize,o.spotShadow[m]=O,o.spotShadowMap[m]=L,x++}m++}else if(B.isRectAreaLight){let H=t.get(B);H.color.copy(T).multiplyScalar(N),H.halfWidth.set(B.width*0.5,0,0),H.halfHeight.set(0,B.height*0.5,0),o.rectArea[A]=H,A++}else if(B.isPointLight){let H=t.get(B);if(H.color.copy(B.color).multiplyScalar(B.intensity),H.distance=B.distance,H.decay=B.decay,B.castShadow){let V=B.shadow,O=n.get(B);O.shadowBias=V.bias,O.shadowNormalBias=V.normalBias,O.shadowRadius=V.radius,O.shadowMapSize=V.mapSize,O.shadowCameraNear=V.camera.near,O.shadowCameraFar=V.camera.far,o.pointShadow[p]=O,o.pointShadowMap[p]=L,o.pointShadowMatrix[p]=B.shadow.matrix,y++}o.point[p]=H,p++}else if(B.isHemisphereLight){let H=t.get(B);H.skyColor.copy(B.color).multiplyScalar(N),H.groundColor.copy(B.groundColor).multiplyScalar(N),o.hemi[g]=H,g++}}if(A>0)if(e.has("OES_texture_float_linear")===!0)o.rectAreaLTC1=Ir.LTC_FLOAT_1,o.rectAreaLTC2=Ir.LTC_FLOAT_2;else o.rectAreaLTC1=Ir.LTC_HALF_1,o.rectAreaLTC2=Ir.LTC_HALF_2;o.ambient[0]=h,o.ambient[1]=d,o.ambient[2]=u;let v=o.hash;if(v.directionalLength!==_||v.pointLength!==p||v.spotLength!==m||v.rectAreaLength!==A||v.hemiLength!==g||v.numDirectionalShadows!==f||v.numPointShadows!==y||v.numSpotShadows!==x||v.numSpotMaps!==C||v.numLightProbes!==I)o.directional.length=_,o.spot.length=m,o.rectArea.length=A,o.point.length=p,o.hemi.length=g,o.directionalShadow.length=f,o.directionalShadowMap.length=f,o.pointShadow.length=y,o.pointShadowMap.length=y,o.spotShadow.length=x,o.spotShadowMap.length=x,o.directionalShadowMatrix.length=f,o.pointShadowMatrix.length=y,o.spotLightMatrix.length=x+C-b,o.spotLightMap.length=C,o.numSpotLightShadowsWithMaps=b,o.numLightProbes=I,v.directionalLength=_,v.pointLength=p,v.spotLength=m,v.rectAreaLength=A,v.hemiLength=g,v.numDirectionalShadows=f,v.numPointShadows=y,v.numSpotShadows=x,v.numSpotMaps=C,v.numLightProbes=I,o.version=BHo++}function c(l,h){let d=0,u=0,_=0,p=0,m=0,A=h.matrixWorldInverse;for(let g=0,f=l.length;g<f;g++){let y=l[g];if(y.isDirectionalLight){let x=o.directional[d];x.direction.setFromMatrixPosition(y.matrixWorld),r.setFromMatrixPosition(y.target.matrixWorld),x.direction.sub(r),x.direction.transformDirection(A),d++}else if(y.isSpotLight){let x=o.spot[_];x.position.setFromMatrixPosition(y.matrixWorld),x.position.applyMatrix4(A),x.direction.setFromMatrixPosition(y.matrixWorld),r.setFromMatrixPosition(y.target.matrixWorld),x.direction.sub(r),x.direction.transformDirection(A),_++}else if(y.isRectAreaLight){let x=o.rectArea[p];x.position.setFromMatrixPosition(y.matrixWorld),x.position.applyMatrix4(A),s.identity(),i.copy(y.matrixWorld),i.premultiply(A),s.extractRotation(i),x.halfWidth.set(y.width*0.5,0,0),x.halfHeight.set(0,y.height*0.5,0),x.halfWidth.applyMatrix4(s),x.halfHeight.applyMatrix4(s),p++}else if(y.isPointLight){let x=o.point[u];x.position.setFromMatrixPosition(y.matrixWorld),x.position.applyMatrix4(A),u++}else if(y.isHemisphereLight){let x=o.hemi[m];x.direction.setFromMatrixPosition(y.matrixWorld),x.direction.transformDirection(A),m++}}}return{setup:a,setupView:c,state:o}}function MPt(e){let t=new DHo(e),n=[],o=[];function r(h){l.camera=h,n.length=0,o.length=0}function i(h){n.push(h)}function s(h){o.push(h)}function a(){t.setup(n)}function c(h){t.setupView(n,h)}let l={lightsArray:n,shadowsArray:o,camera:null,lights:t,transmissionRenderTarget:{}};return{init:r,state:l,setupLights:a,setupLightsView:c,pushLight:i,pushShadow:s}}function NHo(e){let t=new WeakMap;function n(r,i=0){let s=t.get(r),a;if(s===void 0)a=new MPt(e),t.set(r,[a]);else if(i>=s.length)a=new MPt(e),s.push(a);else a=s[i];return a}function o(){t=new WeakMap}return{get:n,dispose:o}}class jye extends cA{constructor(e){super();this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=3200,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.setValues(e)}copy(e){return super.copy(e),this.depthPacking=e.depthPacking,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this}}class Kye extends cA{constructor(e){super();this.isMeshDistanceMaterial=!0,this.type="MeshDistanceMaterial",this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(e)}copy(e){return super.copy(e),this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this}}var RHo=`void main() {
	gl_Position = vec4( position, 1.0 );
}`,QHo=`uniform sampler2D shadow_pass;
uniform vec2 resolution;
uniform float radius;
#include <packing>
void main() {
	const float samples = float( VSM_SAMPLES );
	float mean = 0.0;
	float squared_mean = 0.0;
	float uvStride = samples <= 1.0 ? 0.0 : 2.0 / ( samples - 1.0 );
	float uvStart = samples <= 1.0 ? 0.0 : - 1.0;
	for ( float i = 0.0; i < samples; i ++ ) {
		float uvOffset = uvStart + i * uvStride;
		#ifdef HORIZONTAL_PASS
			vec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( uvOffset, 0.0 ) * radius ) / resolution ) );
			mean += distribution.x;
			squared_mean += distribution.y * distribution.y + distribution.x * distribution.x;
		#else
			float depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, uvOffset ) * radius ) / resolution ) );
			mean += depth;
			squared_mean += depth * depth;
		#endif
	}
	mean = mean / samples;
	squared_mean = squared_mean / samples;
	float std_dev = sqrt( squared_mean - mean * mean );
	gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) );
}`;function kHo(e,t,n){let o=new Wye,r=new go,i=new go,s=new Ah,a=new jye({depthPacking:3201}),c=new Kye,l={},h=n.maxTextureSize,d={[0]:1,[1]:0,[2]:2},u=new y4({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new go},radius:{value:4}},vertexShader:RHo,fragmentShader:QHo}),_=u.clone();_.defines.HORIZONTAL_PASS=1;let p=new ha;p.setAttribute("position",new ol(new Float32Array([-1,-1,0.5,3,-1,0.5,-1,3,0.5]),3));let m=new Qo(p,u),A=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=1;let g=this.type;this.render=function(b,I,v){if(A.enabled===!1)return;if(A.autoUpdate===!1&&A.needsUpdate===!1)return;if(b.length===0)return;let P=e.getRenderTarget(),M=e.getActiveCubeFace(),B=e.getActiveMipmapLevel(),T=e.state;T.setBlending(0),T.buffers.color.setClear(1,1,1,1),T.buffers.depth.setTest(!0),T.setScissorTest(!1);let N=g!==3&&this.type===3,D=g===3&&this.type!==3;for(let L=0,H=b.length;L<H;L++){let V=b[L],O=V.shadow;if(O===void 0){console.warn("THREE.WebGLShadowMap:",V,"has no shadow.");continue}if(O.autoUpdate===!1&&O.needsUpdate===!1)continue;r.copy(O.mapSize);let U=O.getFrameExtents();if(r.multiply(U),i.copy(O.mapSize),r.x>h||r.y>h){if(r.x>h)i.x=Math.floor(h/U.x),r.x=i.x*U.x,O.mapSize.x=i.x;if(r.y>h)i.y=Math.floor(h/U.y),r.y=i.y*U.y,O.mapSize.y=i.y}if(O.map===null||N===!0||D===!0){let Y=this.type!==3?{minFilter:1003,magFilter:1003}:{};if(O.map!==null)O.map.dispose();O.map=new JN(r.x,r.y,Y),O.map.texture.name=V.name+".shadowMap",O.camera.updateProjectionMatrix()}e.setRenderTarget(O.map),e.clear();let j=O.getViewportCount();for(let Y=0;Y<j;Y++){let X=O.getViewport(Y);s.set(i.x*X.x,i.y*X.y,i.x*X.z,i.y*X.w),T.viewport(s),O.updateMatrices(V,Y),o=O.getFrustum(),x(I,v,O.camera,V,this.type)}if(O.isPointLightShadow!==!0&&this.type===3)f(O,v);O.needsUpdate=!1}g=this.type,A.needsUpdate=!1,e.setRenderTarget(P,M,B)};function f(b,I){let v=t.update(m);if(u.defines.VSM_SAMPLES!==b.blurSamples)u.defines.VSM_SAMPLES=b.blurSamples,_.defines.VSM_SAMPLES=b.blurSamples,u.needsUpdate=!0,_.needsUpdate=!0;if(b.mapPass===null)b.mapPass=new JN(r.x,r.y);u.uniforms.shadow_pass.value=b.map.texture,u.uniforms.resolution.value=b.mapSize,u.uniforms.radius.value=b.radius,e.setRenderTarget(b.mapPass),e.clear(),e.renderBufferDirect(I,null,v,u,m,null),_.uniforms.shadow_pass.value=b.mapPass.texture,_.uniforms.resolution.value=b.mapSize,_.uniforms.radius.value=b.radius,e.setRenderTarget(b.map),e.clear(),e.renderBufferDirect(I,null,v,_,m,null)}function y(b,I,v,P){let M=null,B=v.isPointLight===!0?b.customDistanceMaterial:b.customDepthMaterial;if(B!==void 0)M=B;else if(M=v.isPointLight===!0?c:a,e.localClippingEnabled&&I.clipShadows===!0&&Array.isArray(I.clippingPlanes)&&I.clippingPlanes.length!==0||I.displacementMap&&I.displacementScale!==0||I.alphaMap&&I.alphaTest>0||I.map&&I.alphaTest>0){let T=M.uuid,N=I.uuid,D=l[T];if(D===void 0)D={},l[T]=D;let L=D[N];if(L===void 0)L=M.clone(),D[N]=L,I.addEventListener("dispose",C);M=L}if(M.visible=I.visible,M.wireframe=I.wireframe,P===3)M.side=I.shadowSide!==null?I.shadowSide:I.side;else M.side=I.shadowSide!==null?I.shadowSide:d[I.side];if(M.alphaMap=I.alphaMap,M.alphaTest=I.alphaTest,M.map=I.map,M.clipShadows=I.clipShadows,M.clippingPlanes=I.clippingPlanes,M.clipIntersection=I.clipIntersection,M.displacementMap=I.displacementMap,M.displacementScale=I.displacementScale,M.displacementBias=I.displacementBias,M.wireframeLinewidth=I.wireframeLinewidth,M.linewidth=I.linewidth,v.isPointLight===!0&&M.isMeshDistanceMaterial===!0){let T=e.properties.get(M);T.light=v}return M}function x(b,I,v,P,M){if(b.visible===!1)return;if(b.layers.test(I.layers)&&(b.isMesh||b.isLine||b.isPoints)){if((b.castShadow||b.receiveShadow&&M===3)&&(!b.frustumCulled||o.intersectsObject(b))){b.modelViewMatrix.multiplyMatrices(v.matrixWorldInverse,b.matrixWorld);let N=t.update(b),D=b.material;if(Array.isArray(D)){let L=N.groups;for(let H=0,V=L.length;H<V;H++){let O=L[H],U=D[O.materialIndex];if(U&&U.visible){let j=y(b,U,P,M);b.onBeforeShadow(e,b,I,v,N,j,O),e.renderBufferDirect(v,null,N,j,b,O),b.onAfterShadow(e,b,I,v,N,j,O)}}}else if(D.visible){let L=y(b,D,P,M);b.onBeforeShadow(e,b,I,v,N,L,null),e.renderBufferDirect(v,null,N,L,b,null),b.onAfterShadow(e,b,I,v,N,L,null)}}}let T=b.children;for(let N=0,D=T.length;N<D;N++)x(T[N],I,v,P,M)}function C(b){b.target.removeEventListener("dispose",C);for(let v in l){let P=l[v],M=b.target.uuid;if(M in P)P[M].dispose(),delete P[M]}}}function LHo(e){function t(){let Ze=!1,Fe=new Ah,tt=null,Je=new Ah(0,0,0,0);return{setMask:function($e){if(tt!==$e&&!Ze)e.colorMask($e,$e,$e,$e),tt=$e},setLocked:function($e){Ze=$e},setClear:function($e,ft,vt,Ye,je){if(je===!0)$e*=Ye,ft*=Ye,vt*=Ye;if(Fe.set($e,ft,vt,Ye),Je.equals(Fe)===!1)e.clearColor($e,ft,vt,Ye),Je.copy(Fe)},reset:function(){Ze=!1,tt=null,Je.set(-1,0,0,0)}}}function n(){let Ze=!1,Fe=null,tt=null,Je=null;return{setTest:function($e){if($e)se(e.DEPTH_TEST);else ne(e.DEPTH_TEST)},setMask:function($e){if(Fe!==$e&&!Ze)e.depthMask($e),Fe=$e},setFunc:function($e){if(tt!==$e){switch($e){case 0:e.depthFunc(e.NEVER);break;case 1:e.depthFunc(e.ALWAYS);break;case 2:e.depthFunc(e.LESS);break;case 3:e.depthFunc(e.LEQUAL);break;case 4:e.depthFunc(e.EQUAL);break;case 5:e.depthFunc(e.GEQUAL);break;case 6:e.depthFunc(e.GREATER);break;case 7:e.depthFunc(e.NOTEQUAL);break;default:e.depthFunc(e.LEQUAL)}tt=$e}},setLocked:function($e){Ze=$e},setClear:function($e){if(Je!==$e)e.clearDepth($e),Je=$e},reset:function(){Ze=!1,Fe=null,tt=null,Je=null}}}function o(){let Ze=!1,Fe=null,tt=null,Je=null,$e=null,ft=null,vt=null,Ye=null,je=null;return{setTest:function(st){if(!Ze)if(st)se(e.STENCIL_TEST);else ne(e.STENCIL_TEST)},setMask:function(st){if(Fe!==st&&!Ze)e.stencilMask(st),Fe=st},setFunc:function(st,St,Nt){if(tt!==st||Je!==St||$e!==Nt)e.stencilFunc(st,St,Nt),tt=st,Je=St,$e=Nt},setOp:function(st,St,Nt){if(ft!==st||vt!==St||Ye!==Nt)e.stencilOp(st,St,Nt),ft=st,vt=St,Ye=Nt},setLocked:function(st){Ze=st},setClear:function(st){if(je!==st)e.clearStencil(st),je=st},reset:function(){Ze=!1,Fe=null,tt=null,Je=null,$e=null,ft=null,vt=null,Ye=null,je=null}}}let r=new t,i=new n,s=new o,a=new WeakMap,c=new WeakMap,l={},h={},d=new WeakMap,u=[],_=null,p=!1,m=null,A=null,g=null,f=null,y=null,x=null,C=null,b=new Do(0,0,0),I=0,v=!1,P=null,M=null,B=null,T=null,N=null,D=e.getParameter(e.MAX_COMBINED_TEXTURE_IMAGE_UNITS),L=!1,H=0,V=e.getParameter(e.VERSION);if(V.indexOf("WebGL")!==-1)H=parseFloat(/^WebGL (\d)/.exec(V)[1]),L=H>=1;else if(V.indexOf("OpenGL ES")!==-1)H=parseFloat(/^OpenGL ES (\d)/.exec(V)[1]),L=H>=2;let O=null,U={},j=e.getParameter(e.SCISSOR_BOX),Y=e.getParameter(e.VIEWPORT),X=new Ah().fromArray(j),K=new Ah().fromArray(Y);function J(Ze,Fe,tt,Je){let $e=new Uint8Array(4),ft=e.createTexture();e.bindTexture(Ze,ft),e.texParameteri(Ze,e.TEXTURE_MIN_FILTER,e.NEAREST),e.texParameteri(Ze,e.TEXTURE_MAG_FILTER,e.NEAREST);for(let vt=0;vt<tt;vt++)if(Ze===e.TEXTURE_3D||Ze===e.TEXTURE_2D_ARRAY)e.texImage3D(Fe,0,e.RGBA,1,1,Je,0,e.RGBA,e.UNSIGNED_BYTE,$e);else e.texImage2D(Fe+vt,0,e.RGBA,1,1,0,e.RGBA,e.UNSIGNED_BYTE,$e);return ft}let ee={};ee[e.TEXTURE_2D]=J(e.TEXTURE_2D,e.TEXTURE_2D,1),ee[e.TEXTURE_CUBE_MAP]=J(e.TEXTURE_CUBE_MAP,e.TEXTURE_CUBE_MAP_POSITIVE_X,6),ee[e.TEXTURE_2D_ARRAY]=J(e.TEXTURE_2D_ARRAY,e.TEXTURE_2D_ARRAY,1,1),ee[e.TEXTURE_3D]=J(e.TEXTURE_3D,e.TEXTURE_3D,1,1),r.setClear(0,0,0,1),i.setClear(1),s.setClear(0),se(e.DEPTH_TEST),i.setFunc(3),me(!1),ge(1),se(e.CULL_FACE),ue(0);function se(Ze){if(l[Ze]!==!0)e.enable(Ze),l[Ze]=!0}function ne(Ze){if(l[Ze]!==!1)e.disable(Ze),l[Ze]=!1}function re(Ze,Fe){if(h[Ze]!==Fe){if(e.bindFramebuffer(Ze,Fe),h[Ze]=Fe,Ze===e.DRAW_FRAMEBUFFER)h[e.FRAMEBUFFER]=Fe;if(Ze===e.FRAMEBUFFER)h[e.DRAW_FRAMEBUFFER]=Fe;return!0}return!1}function Z(Ze,Fe){let tt=u,Je=!1;if(Ze){if(tt=d.get(Fe),tt===void 0)tt=[],d.set(Fe,tt);let $e=Ze.textures;if(tt.length!==$e.length||tt[0]!==e.COLOR_ATTACHMENT0){for(let ft=0,vt=$e.length;ft<vt;ft++)tt[ft]=e.COLOR_ATTACHMENT0+ft;tt.length=$e.length,Je=!0}}else if(tt[0]!==e.BACK)tt[0]=e.BACK,Je=!0;if(Je)e.drawBuffers(tt)}function te(Ze){if(_!==Ze)return e.useProgram(Ze),_=Ze,!0;return!1}let ie={[100]:e.FUNC_ADD,[101]:e.FUNC_SUBTRACT,[102]:e.FUNC_REVERSE_SUBTRACT};ie[103]=e.MIN,ie[104]=e.MAX;let ce={[200]:e.ZERO,[201]:e.ONE,[202]:e.SRC_COLOR,[204]:e.SRC_ALPHA,[210]:e.SRC_ALPHA_SATURATE,[208]:e.DST_COLOR,[206]:e.DST_ALPHA,[203]:e.ONE_MINUS_SRC_COLOR,[205]:e.ONE_MINUS_SRC_ALPHA,[209]:e.ONE_MINUS_DST_COLOR,[207]:e.ONE_MINUS_DST_ALPHA,[211]:e.CONSTANT_COLOR,[212]:e.ONE_MINUS_CONSTANT_COLOR,[213]:e.CONSTANT_ALPHA,[214]:e.ONE_MINUS_CONSTANT_ALPHA};function ue(Ze,Fe,tt,Je,$e,ft,vt,Ye,je,st){if(Ze===0){if(p===!0)ne(e.BLEND),p=!1;return}if(p===!1)se(e.BLEND),p=!0;if(Ze!==5){if(Ze!==m||st!==v){if(A!==100||y!==100)e.blendEquation(e.FUNC_ADD),A=100,y=100;if(st)switch(Ze){case 1:e.blendFuncSeparate(e.ONE,e.ONE_MINUS_SRC_ALPHA,e.ONE,e.ONE_MINUS_SRC_ALPHA);break;case 2:e.blendFunc(e.ONE,e.ONE);break;case 3:e.blendFuncSeparate(e.ZERO,e.ONE_MINUS_SRC_COLOR,e.ZERO,e.ONE);break;case 4:e.blendFuncSeparate(e.ZERO,e.SRC_COLOR,e.ZERO,e.SRC_ALPHA);break;default:console.error("THREE.WebGLState: Invalid blending: ",Ze);break}else switch(Ze){case 1:e.blendFuncSeparate(e.SRC_ALPHA,e.ONE_MINUS_SRC_ALPHA,e.ONE,e.ONE_MINUS_SRC_ALPHA);break;case 2:e.blendFunc(e.SRC_ALPHA,e.ONE);break;case 3:e.blendFuncSeparate(e.ZERO,e.ONE_MINUS_SRC_COLOR,e.ZERO,e.ONE);break;case 4:e.blendFunc(e.ZERO,e.SRC_COLOR);break;default:console.error("THREE.WebGLState: Invalid blending: ",Ze);break}g=null,f=null,x=null,C=null,b.set(0,0,0),I=0,m=Ze,v=st}return}if($e=$e||Fe,ft=ft||tt,vt=vt||Je,Fe!==A||$e!==y)e.blendEquationSeparate(ie[Fe],ie[$e]),A=Fe,y=$e;if(tt!==g||Je!==f||ft!==x||vt!==C)e.blendFuncSeparate(ce[tt],ce[Je],ce[ft],ce[vt]),g=tt,f=Je,x=ft,C=vt;if(Ye.equals(b)===!1||je!==I)e.blendColor(Ye.r,Ye.g,Ye.b,je),b.copy(Ye),I=je;m=Ze,v=!1}function de(Ze,Fe){Ze.side===2?ne(e.CULL_FACE):se(e.CULL_FACE);let tt=Ze.side===1;if(Fe)tt=!tt;me(tt),Ze.blending===1&&Ze.transparent===!1?ue(0):ue(Ze.blending,Ze.blendEquation,Ze.blendSrc,Ze.blendDst,Ze.blendEquationAlpha,Ze.blendSrcAlpha,Ze.blendDstAlpha,Ze.blendColor,Ze.blendAlpha,Ze.premultipliedAlpha),i.setFunc(Ze.depthFunc),i.setTest(Ze.depthTest),i.setMask(Ze.depthWrite),r.setMask(Ze.colorWrite);let Je=Ze.stencilWrite;if(s.setTest(Je),Je)s.setMask(Ze.stencilWriteMask),s.setFunc(Ze.stencilFunc,Ze.stencilRef,Ze.stencilFuncMask),s.setOp(Ze.stencilFail,Ze.stencilZFail,Ze.stencilZPass);Ee(Ze.polygonOffset,Ze.polygonOffsetFactor,Ze.polygonOffsetUnits),Ze.alphaToCoverage===!0?se(e.SAMPLE_ALPHA_TO_COVERAGE):ne(e.SAMPLE_ALPHA_TO_COVERAGE)}function me(Ze){if(P!==Ze){if(Ze)e.frontFace(e.CW);else e.frontFace(e.CCW);P=Ze}}function ge(Ze){if(Ze!==0){if(se(e.CULL_FACE),Ze!==M)if(Ze===1)e.cullFace(e.BACK);else if(Ze===2)e.cullFace(e.FRONT);else e.cullFace(e.FRONT_AND_BACK)}else ne(e.CULL_FACE);M=Ze}function xe(Ze){if(Ze!==B){if(L)e.lineWidth(Ze);B=Ze}}function Ee(Ze,Fe,tt){if(Ze){if(se(e.POLYGON_OFFSET_FILL),T!==Fe||N!==tt)e.polygonOffset(Fe,tt),T=Fe,N=tt}else ne(e.POLYGON_OFFSET_FILL)}function Re(Ze){if(Ze)se(e.SCISSOR_TEST);else ne(e.SCISSOR_TEST)}function Me(Ze){if(Ze===void 0)Ze=e.TEXTURE0+D-1;if(O!==Ze)e.activeTexture(Ze),O=Ze}function _e(Ze,Fe,tt){if(tt===void 0)if(O===null)tt=e.TEXTURE0+D-1;else tt=O;let Je=U[tt];if(Je===void 0)Je={type:void 0,texture:void 0},U[tt]=Je;if(Je.type!==Ze||Je.texture!==Fe){if(O!==tt)e.activeTexture(tt),O=tt;e.bindTexture(Ze,Fe||ee[Ze]),Je.type=Ze,Je.texture=Fe}}function ye(){let Ze=U[O];if(Ze!==void 0&&Ze.type!==void 0)e.bindTexture(Ze.type,null),Ze.type=void 0,Ze.texture=void 0}function Se(){try{e.compressedTexImage2D.apply(e,arguments)}catch(Ze){console.error("THREE.WebGLState:",Ze)}}function Ne(){try{e.compressedTexImage3D.apply(e,arguments)}catch(Ze){console.error("THREE.WebGLState:",Ze)}}function Le(){try{e.texSubImage2D.apply(e,arguments)}catch(Ze){console.error("THREE.WebGLState:",Ze)}}function nt(){try{e.texSubImage3D.apply(e,arguments)}catch(Ze){console.error("THREE.WebGLState:",Ze)}}function dt(){try{e.compressedTexSubImage2D.apply(e,arguments)}catch(Ze){console.error("THREE.WebGLState:",Ze)}}function rt(){try{e.compressedTexSubImage3D.apply(e,arguments)}catch(Ze){console.error("THREE.WebGLState:",Ze)}}function pt(){try{e.texStorage2D.apply(e,arguments)}catch(Ze){console.error("THREE.WebGLState:",Ze)}}function ct(){try{e.texStorage3D.apply(e,arguments)}catch(Ze){console.error("THREE.WebGLState:",Ze)}}function Ct(){try{e.texImage2D.apply(e,arguments)}catch(Ze){console.error("THREE.WebGLState:",Ze)}}function kt(){try{e.texImage3D.apply(e,arguments)}catch(Ze){console.error("THREE.WebGLState:",Ze)}}function Lt(Ze){if(X.equals(Ze)===!1)e.scissor(Ze.x,Ze.y,Ze.z,Ze.w),X.copy(Ze)}function Bt(Ze){if(K.equals(Ze)===!1)e.viewport(Ze.x,Ze.y,Ze.z,Ze.w),K.copy(Ze)}function xt(Ze,Fe){let tt=c.get(Fe);if(tt===void 0)tt=new WeakMap,c.set(Fe,tt);let Je=tt.get(Ze);if(Je===void 0)Je=e.getUniformBlockIndex(Fe,Ze.name),tt.set(Ze,Je)}function Yt(Ze,Fe){let Je=c.get(Fe).get(Ze);if(a.get(Fe)!==Je)e.uniformBlockBinding(Fe,Je,Ze.__bindingPointIndex),a.set(Fe,Je)}function ut(){e.disable(e.BLEND),e.disable(e.CULL_FACE),e.disable(e.DEPTH_TEST),e.disable(e.POLYGON_OFFSET_FILL),e.disable(e.SCISSOR_TEST),e.disable(e.STENCIL_TEST),e.disable(e.SAMPLE_ALPHA_TO_COVERAGE),e.blendEquation(e.FUNC_ADD),e.blendFunc(e.ONE,e.ZERO),e.blendFuncSeparate(e.ONE,e.ZERO,e.ONE,e.ZERO),e.blendColor(0,0,0,0),e.colorMask(!0,!0,!0,!0),e.clearColor(0,0,0,0),e.depthMask(!0),e.depthFunc(e.LESS),e.clearDepth(1),e.stencilMask(4294967295),e.stencilFunc(e.ALWAYS,0,4294967295),e.stencilOp(e.KEEP,e.KEEP,e.KEEP),e.clearStencil(0),e.cullFace(e.BACK),e.frontFace(e.CCW),e.polygonOffset(0,0),e.activeTexture(e.TEXTURE0),e.bindFramebuffer(e.FRAMEBUFFER,null),e.bindFramebuffer(e.DRAW_FRAMEBUFFER,null),e.bindFramebuffer(e.READ_FRAMEBUFFER,null),e.useProgram(null),e.lineWidth(1),e.scissor(0,0,e.canvas.width,e.canvas.height),e.viewport(0,0,e.canvas.width,e.canvas.height),l={},O=null,U={},h={},d=new WeakMap,u=[],_=null,p=!1,m=null,A=null,g=null,f=null,y=null,x=null,C=null,b=new Do(0,0,0),I=0,v=!1,P=null,M=null,B=null,T=null,N=null,X.set(0,0,e.canvas.width,e.canvas.height),K.set(0,0,e.canvas.width,e.canvas.height),r.reset(),i.reset(),s.reset()}return{buffers:{color:r,depth:i,stencil:s},enable:se,disable:ne,bindFramebuffer:re,drawBuffers:Z,useProgram:te,setBlending:ue,setMaterial:de,setFlipSided:me,setCullFace:ge,setLineWidth:xe,setPolygonOffset:Ee,setScissorTest:Re,activeTexture:Me,bindTexture:_e,unbindTexture:ye,compressedTexImage2D:Se,compressedTexImage3D:Ne,texImage2D:Ct,texImage3D:kt,updateUBOMapping:xt,uniformBlockBinding:Yt,texStorage2D:pt,texStorage3D:ct,texSubImage2D:Le,texSubImage3D:nt,compressedTexSubImage2D:dt,compressedTexSubImage3D:rt,scissor:Lt,viewport:Bt,reset:ut}}function HHo(e,t,n,o,r,i,s){let a=t.has("WEBGL_multisampled_render_to_texture")?t.get("WEBGL_multisampled_render_to_texture"):null,c=typeof navigator>"u"?!1:/OculusBrowser/g.test(navigator.userAgent),l=new go,h=new WeakMap,d,u=new WeakMap,_=!1;try{_=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch(Me){}function p(Me,_e){return _?new OffscreenCanvas(Me,_e):Nie("canvas")}function m(Me,_e,ye){let Se=1,Ne=Re(Me);if(Ne.width>ye||Ne.height>ye)Se=ye/Math.max(Ne.width,Ne.height);if(Se<1)if(typeof HTMLImageElement<"u"&&Me instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&Me instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&Me instanceof ImageBitmap||typeof VideoFrame<"u"&&Me instanceof VideoFrame){let Le=Math.floor(Se*Ne.width),nt=Math.floor(Se*Ne.height);if(d===void 0)d=p(Le,nt);let dt=_e?p(Le,nt):d;return dt.width=Le,dt.height=nt,dt.getContext("2d").drawImage(Me,0,0,Le,nt),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+Ne.width+"x"+Ne.height+") to ("+Le+"x"+nt+")."),dt}else{if("data"in Me)console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+Ne.width+"x"+Ne.height+").");return Me}return Me}function A(Me){return Me.generateMipmaps&&Me.minFilter!==1003&&Me.minFilter!==1006}function g(Me){e.generateMipmap(Me)}function f(Me,_e,ye,Se,Ne=!1){if(Me!==null){if(e[Me]!==void 0)return e[Me];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+Me+"'")}let Le=_e;if(_e===e.RED){if(ye===e.FLOAT)Le=e.R32F;if(ye===e.HALF_FLOAT)Le=e.R16F;if(ye===e.UNSIGNED_BYTE)Le=e.R8}if(_e===e.RED_INTEGER){if(ye===e.UNSIGNED_BYTE)Le=e.R8UI;if(ye===e.UNSIGNED_SHORT)Le=e.R16UI;if(ye===e.UNSIGNED_INT)Le=e.R32UI;if(ye===e.BYTE)Le=e.R8I;if(ye===e.SHORT)Le=e.R16I;if(ye===e.INT)Le=e.R32I}if(_e===e.RG){if(ye===e.FLOAT)Le=e.RG32F;if(ye===e.HALF_FLOAT)Le=e.RG16F;if(ye===e.UNSIGNED_BYTE)Le=e.RG8}if(_e===e.RG_INTEGER){if(ye===e.UNSIGNED_BYTE)Le=e.RG8UI;if(ye===e.UNSIGNED_SHORT)Le=e.RG16UI;if(ye===e.UNSIGNED_INT)Le=e.RG32UI;if(ye===e.BYTE)Le=e.RG8I;if(ye===e.SHORT)Le=e.RG16I;if(ye===e.INT)Le=e.RG32I}if(_e===e.RGB){if(ye===e.UNSIGNED_INT_5_9_9_9_REV)Le=e.RGB9_E5}if(_e===e.RGBA){let nt=Ne?"linear":Th.getTransfer(Se);if(ye===e.FLOAT)Le=e.RGBA32F;if(ye===e.HALF_FLOAT)Le=e.RGBA16F;if(ye===e.UNSIGNED_BYTE)Le=nt==="srgb"?e.SRGB8_ALPHA8:e.RGBA8;if(ye===e.UNSIGNED_SHORT_4_4_4_4)Le=e.RGBA4;if(ye===e.UNSIGNED_SHORT_5_5_5_1)Le=e.RGB5_A1}if(Le===e.R16F||Le===e.R32F||Le===e.RG16F||Le===e.RG32F||Le===e.RGBA16F||Le===e.RGBA32F)t.get("EXT_color_buffer_float");return Le}function y(Me,_e){let ye;if(Me){if(_e===null||_e===1014||_e===1020)ye=e.DEPTH24_STENCIL8;else if(_e===1015)ye=e.DEPTH32F_STENCIL8;else if(_e===1012)ye=e.DEPTH24_STENCIL8,console.warn("DepthTexture: 16 bit depth attachment is not supported with stencil. Using 24-bit attachment.")}else if(_e===null||_e===1014||_e===1020)ye=e.DEPTH_COMPONENT24;else if(_e===1015)ye=e.DEPTH_COMPONENT32F;else if(_e===1012)ye=e.DEPTH_COMPONENT16;return ye}function x(Me,_e){if(A(Me)===!0||Me.isFramebufferTexture&&Me.minFilter!==1003&&Me.minFilter!==1006)return Math.log2(Math.max(_e.width,_e.height))+1;else if(Me.mipmaps!==void 0&&Me.mipmaps.length>0)return Me.mipmaps.length;else if(Me.isCompressedTexture&&Array.isArray(Me.image))return _e.mipmaps.length;else return 1}function C(Me){let _e=Me.target;if(_e.removeEventListener("dispose",C),I(_e),_e.isVideoTexture)h.delete(_e)}function b(Me){let _e=Me.target;_e.removeEventListener("dispose",b),P(_e)}function I(Me){let _e=o.get(Me);if(_e.__webglInit===void 0)return;let ye=Me.source,Se=u.get(ye);if(Se){let Ne=Se[_e.__cacheKey];if(Ne.usedTimes--,Ne.usedTimes===0)v(Me);if(Object.keys(Se).length===0)u.delete(ye)}o.remove(Me)}function v(Me){let _e=o.get(Me);e.deleteTexture(_e.__webglTexture);let ye=Me.source,Se=u.get(ye);delete Se[_e.__cacheKey],s.memory.textures--}function P(Me){let _e=o.get(Me);if(Me.depthTexture)Me.depthTexture.dispose();if(Me.isWebGLCubeRenderTarget)for(let Se=0;Se<6;Se++){if(Array.isArray(_e.__webglFramebuffer[Se]))for(let Ne=0;Ne<_e.__webglFramebuffer[Se].length;Ne++)e.deleteFramebuffer(_e.__webglFramebuffer[Se][Ne]);else e.deleteFramebuffer(_e.__webglFramebuffer[Se]);if(_e.__webglDepthbuffer)e.deleteRenderbuffer(_e.__webglDepthbuffer[Se])}else{if(Array.isArray(_e.__webglFramebuffer))for(let Se=0;Se<_e.__webglFramebuffer.length;Se++)e.deleteFramebuffer(_e.__webglFramebuffer[Se]);else e.deleteFramebuffer(_e.__webglFramebuffer);if(_e.__webglDepthbuffer)e.deleteRenderbuffer(_e.__webglDepthbuffer);if(_e.__webglMultisampledFramebuffer)e.deleteFramebuffer(_e.__webglMultisampledFramebuffer);if(_e.__webglColorRenderbuffer){for(let Se=0;Se<_e.__webglColorRenderbuffer.length;Se++)if(_e.__webglColorRenderbuffer[Se])e.deleteRenderbuffer(_e.__webglColorRenderbuffer[Se])}if(_e.__webglDepthRenderbuffer)e.deleteRenderbuffer(_e.__webglDepthRenderbuffer)}let ye=Me.textures;for(let Se=0,Ne=ye.length;Se<Ne;Se++){let Le=o.get(ye[Se]);if(Le.__webglTexture)e.deleteTexture(Le.__webglTexture),s.memory.textures--;o.remove(ye[Se])}o.remove(Me)}let M=0;function B(){M=0}function T(){let Me=M;if(Me>=r.maxTextures)console.warn("THREE.WebGLTextures: Trying to use "+Me+" texture units while this GPU supports only "+r.maxTextures);return M+=1,Me}function N(Me){let _e=[];return _e.push(Me.wrapS),_e.push(Me.wrapT),_e.push(Me.wrapR||0),_e.push(Me.magFilter),_e.push(Me.minFilter),_e.push(Me.anisotropy),_e.push(Me.internalFormat),_e.push(Me.format),_e.push(Me.type),_e.push(Me.generateMipmaps),_e.push(Me.premultiplyAlpha),_e.push(Me.flipY),_e.push(Me.unpackAlignment),_e.push(Me.colorSpace),_e.join()}function D(Me,_e){let ye=o.get(Me);if(Me.isVideoTexture)xe(Me);if(Me.isRenderTargetTexture===!1&&Me.version>0&&ye.__version!==Me.version){let Se=Me.image;if(Se===null)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else if(Se.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{K(ye,Me,_e);return}}n.bindTexture(e.TEXTURE_2D,ye.__webglTexture,e.TEXTURE0+_e)}function L(Me,_e){let ye=o.get(Me);if(Me.version>0&&ye.__version!==Me.version){K(ye,Me,_e);return}n.bindTexture(e.TEXTURE_2D_ARRAY,ye.__webglTexture,e.TEXTURE0+_e)}function H(Me,_e){let ye=o.get(Me);if(Me.version>0&&ye.__version!==Me.version){K(ye,Me,_e);return}n.bindTexture(e.TEXTURE_3D,ye.__webglTexture,e.TEXTURE0+_e)}function V(Me,_e){let ye=o.get(Me);if(Me.version>0&&ye.__version!==Me.version){J(ye,Me,_e);return}n.bindTexture(e.TEXTURE_CUBE_MAP,ye.__webglTexture,e.TEXTURE0+_e)}let O={[1000]:e.REPEAT,[1001]:e.CLAMP_TO_EDGE,[1002]:e.MIRRORED_REPEAT},U={[1003]:e.NEAREST,[1004]:e.NEAREST_MIPMAP_NEAREST,[1005]:e.NEAREST_MIPMAP_LINEAR,[1006]:e.LINEAR,[1007]:e.LINEAR_MIPMAP_NEAREST,[1008]:e.LINEAR_MIPMAP_LINEAR},j={[512]:e.NEVER,[519]:e.ALWAYS,[513]:e.LESS,[515]:e.LEQUAL,[514]:e.EQUAL,[518]:e.GEQUAL,[516]:e.GREATER,[517]:e.NOTEQUAL};function Y(Me,_e){if(_e.type===1015&&t.has("OES_texture_float_linear")===!1&&(_e.magFilter===1006||_e.magFilter===1007||_e.magFilter===1005||_e.magFilter===1008||_e.minFilter===1006||_e.minFilter===1007||_e.minFilter===1005||_e.minFilter===1008))console.warn("THREE.WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device.");if(e.texParameteri(Me,e.TEXTURE_WRAP_S,O[_e.wrapS]),e.texParameteri(Me,e.TEXTURE_WRAP_T,O[_e.wrapT]),Me===e.TEXTURE_3D||Me===e.TEXTURE_2D_ARRAY)e.texParameteri(Me,e.TEXTURE_WRAP_R,O[_e.wrapR]);if(e.texParameteri(Me,e.TEXTURE_MAG_FILTER,U[_e.magFilter]),e.texParameteri(Me,e.TEXTURE_MIN_FILTER,U[_e.minFilter]),_e.compareFunction)e.texParameteri(Me,e.TEXTURE_COMPARE_MODE,e.COMPARE_REF_TO_TEXTURE),e.texParameteri(Me,e.TEXTURE_COMPARE_FUNC,j[_e.compareFunction]);if(t.has("EXT_texture_filter_anisotropic")===!0){if(_e.magFilter===1003)return;if(_e.minFilter!==1005&&_e.minFilter!==1008)return;if(_e.type===1015&&t.has("OES_texture_float_linear")===!1)return;if(_e.anisotropy>1||o.get(_e).__currentAnisotropy){let ye=t.get("EXT_texture_filter_anisotropic");e.texParameterf(Me,ye.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(_e.anisotropy,r.getMaxAnisotropy())),o.get(_e).__currentAnisotropy=_e.anisotropy}}}function X(Me,_e){let ye=!1;if(Me.__webglInit===void 0)Me.__webglInit=!0,_e.addEventListener("dispose",C);let Se=_e.source,Ne=u.get(Se);if(Ne===void 0)Ne={},u.set(Se,Ne);let Le=N(_e);if(Le!==Me.__cacheKey){if(Ne[Le]===void 0)Ne[Le]={texture:e.createTexture(),usedTimes:0},s.memory.textures++,ye=!0;Ne[Le].usedTimes++;let nt=Ne[Me.__cacheKey];if(nt!==void 0){if(Ne[Me.__cacheKey].usedTimes--,nt.usedTimes===0)v(_e)}Me.__cacheKey=Le,Me.__webglTexture=Ne[Le].texture}return ye}function K(Me,_e,ye){let Se=e.TEXTURE_2D;if(_e.isDataArrayTexture||_e.isCompressedArrayTexture)Se=e.TEXTURE_2D_ARRAY;if(_e.isData3DTexture)Se=e.TEXTURE_3D;let Ne=X(Me,_e),Le=_e.source;n.bindTexture(Se,Me.__webglTexture,e.TEXTURE0+ye);let nt=o.get(Le);if(Le.version!==nt.__version||Ne===!0){n.activeTexture(e.TEXTURE0+ye);let dt=Th.getPrimaries(Th.workingColorSpace),rt=_e.colorSpace===""?null:Th.getPrimaries(_e.colorSpace),pt=_e.colorSpace===""||dt===rt?e.NONE:e.BROWSER_DEFAULT_WEBGL;e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,_e.flipY),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,_e.premultiplyAlpha),e.pixelStorei(e.UNPACK_ALIGNMENT,_e.unpackAlignment),e.pixelStorei(e.UNPACK_COLORSPACE_CONVERSION_WEBGL,pt);let ct=m(_e.image,!1,r.maxTextureSize);ct=Ee(_e,ct);let Ct=i.convert(_e.format,_e.colorSpace),kt=i.convert(_e.type),Lt=f(_e.internalFormat,Ct,kt,_e.colorSpace,_e.isVideoTexture);Y(Se,_e);let Bt,xt=_e.mipmaps,Yt=_e.isVideoTexture!==!0,ut=nt.__version===void 0||Ne===!0,Ze=Le.dataReady,Fe=x(_e,ct);if(_e.isDepthTexture){if(Lt=y(_e.format===1027,_e.type),ut)if(Yt)n.texStorage2D(e.TEXTURE_2D,1,Lt,ct.width,ct.height);else n.texImage2D(e.TEXTURE_2D,0,Lt,ct.width,ct.height,0,Ct,kt,null)}else if(_e.isDataTexture)if(xt.length>0){if(Yt&&ut)n.texStorage2D(e.TEXTURE_2D,Fe,Lt,xt[0].width,xt[0].height);for(let tt=0,Je=xt.length;tt<Je;tt++)if(Bt=xt[tt],Yt){if(Ze)n.texSubImage2D(e.TEXTURE_2D,tt,0,0,Bt.width,Bt.height,Ct,kt,Bt.data)}else n.texImage2D(e.TEXTURE_2D,tt,Lt,Bt.width,Bt.height,0,Ct,kt,Bt.data);_e.generateMipmaps=!1}else if(Yt){if(ut)n.texStorage2D(e.TEXTURE_2D,Fe,Lt,ct.width,ct.height);if(Ze)n.texSubImage2D(e.TEXTURE_2D,0,0,0,ct.width,ct.height,Ct,kt,ct.data)}else n.texImage2D(e.TEXTURE_2D,0,Lt,ct.width,ct.height,0,Ct,kt,ct.data);else if(_e.isCompressedTexture)if(_e.isCompressedArrayTexture){if(Yt&&ut)n.texStorage3D(e.TEXTURE_2D_ARRAY,Fe,Lt,xt[0].width,xt[0].height,ct.depth);for(let tt=0,Je=xt.length;tt<Je;tt++)if(Bt=xt[tt],_e.format!==1023)if(Ct!==null)if(Yt){if(Ze)if(_e.layerUpdates.size>0){for(let $e of _e.layerUpdates){let ft=Bt.width*Bt.height;n.compressedTexSubImage3D(e.TEXTURE_2D_ARRAY,tt,0,0,$e,Bt.width,Bt.height,1,Ct,Bt.data.slice(ft*$e,ft*($e+1)),0,0)}_e.clearLayerUpdates()}else n.compressedTexSubImage3D(e.TEXTURE_2D_ARRAY,tt,0,0,0,Bt.width,Bt.height,ct.depth,Ct,Bt.data,0,0)}else n.compressedTexImage3D(e.TEXTURE_2D_ARRAY,tt,Lt,Bt.width,Bt.height,ct.depth,0,Bt.data,0,0);else console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()");else if(Yt){if(Ze)n.texSubImage3D(e.TEXTURE_2D_ARRAY,tt,0,0,0,Bt.width,Bt.height,ct.depth,Ct,kt,Bt.data)}else n.texImage3D(e.TEXTURE_2D_ARRAY,tt,Lt,Bt.width,Bt.height,ct.depth,0,Ct,kt,Bt.data)}else{if(Yt&&ut)n.texStorage2D(e.TEXTURE_2D,Fe,Lt,xt[0].width,xt[0].height);for(let tt=0,Je=xt.length;tt<Je;tt++)if(Bt=xt[tt],_e.format!==1023)if(Ct!==null)if(Yt){if(Ze)n.compressedTexSubImage2D(e.TEXTURE_2D,tt,0,0,Bt.width,Bt.height,Ct,Bt.data)}else n.compressedTexImage2D(e.TEXTURE_2D,tt,Lt,Bt.width,Bt.height,0,Bt.data);else console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()");else if(Yt){if(Ze)n.texSubImage2D(e.TEXTURE_2D,tt,0,0,Bt.width,Bt.height,Ct,kt,Bt.data)}else n.texImage2D(e.TEXTURE_2D,tt,Lt,Bt.width,Bt.height,0,Ct,kt,Bt.data)}else if(_e.isDataArrayTexture)if(Yt){if(ut)n.texStorage3D(e.TEXTURE_2D_ARRAY,Fe,Lt,ct.width,ct.height,ct.depth);if(Ze)if(_e.layerUpdates.size>0){let tt;switch(kt){case e.UNSIGNED_BYTE:switch(Ct){case e.ALPHA:tt=1;break;case e.LUMINANCE:tt=1;break;case e.LUMINANCE_ALPHA:tt=2;break;case e.RGB:tt=3;break;case e.RGBA:tt=4;break;default:throw Error(`Unknown texel size for format ${Ct}.`)}break;case e.UNSIGNED_SHORT_4_4_4_4:case e.UNSIGNED_SHORT_5_5_5_1:case e.UNSIGNED_SHORT_5_6_5:tt=1;break;default:throw Error(`Unknown texel size for type ${kt}.`)}let Je=ct.width*ct.height*tt;for(let $e of _e.layerUpdates)n.texSubImage3D(e.TEXTURE_2D_ARRAY,0,0,0,$e,ct.width,ct.height,1,Ct,kt,ct.data.slice(Je*$e,Je*($e+1)));_e.clearLayerUpdates()}else n.texSubImage3D(e.TEXTURE_2D_ARRAY,0,0,0,0,ct.width,ct.height,ct.depth,Ct,kt,ct.data)}else n.texImage3D(e.TEXTURE_2D_ARRAY,0,Lt,ct.width,ct.height,ct.depth,0,Ct,kt,ct.data);else if(_e.isData3DTexture)if(Yt){if(ut)n.texStorage3D(e.TEXTURE_3D,Fe,Lt,ct.width,ct.height,ct.depth);if(Ze)n.texSubImage3D(e.TEXTURE_3D,0,0,0,0,ct.width,ct.height,ct.depth,Ct,kt,ct.data)}else n.texImage3D(e.TEXTURE_3D,0,Lt,ct.width,ct.height,ct.depth,0,Ct,kt,ct.data);else if(_e.isFramebufferTexture){if(ut)if(Yt)n.texStorage2D(e.TEXTURE_2D,Fe,Lt,ct.width,ct.height);else{let tt=ct.width,Je=ct.height;for(let $e=0;$e<Fe;$e++)n.texImage2D(e.TEXTURE_2D,$e,Lt,tt,Je,0,Ct,kt,null),tt>>=1,Je>>=1}}else if(xt.length>0){if(Yt&&ut){let tt=Re(xt[0]);n.texStorage2D(e.TEXTURE_2D,Fe,Lt,tt.width,tt.height)}for(let tt=0,Je=xt.length;tt<Je;tt++)if(Bt=xt[tt],Yt){if(Ze)n.texSubImage2D(e.TEXTURE_2D,tt,0,0,Ct,kt,Bt)}else n.texImage2D(e.TEXTURE_2D,tt,Lt,Ct,kt,Bt);_e.generateMipmaps=!1}else if(Yt){if(ut){let tt=Re(ct);n.texStorage2D(e.TEXTURE_2D,Fe,Lt,tt.width,tt.height)}if(Ze)n.texSubImage2D(e.TEXTURE_2D,0,0,0,Ct,kt,ct)}else n.texImage2D(e.TEXTURE_2D,0,Lt,Ct,kt,ct);if(A(_e))g(Se);if(nt.__version=Le.version,_e.onUpdate)_e.onUpdate(_e)}Me.__version=_e.version}function J(Me,_e,ye){if(_e.image.length!==6)return;let Se=X(Me,_e),Ne=_e.source;n.bindTexture(e.TEXTURE_CUBE_MAP,Me.__webglTexture,e.TEXTURE0+ye);let Le=o.get(Ne);if(Ne.version!==Le.__version||Se===!0){n.activeTexture(e.TEXTURE0+ye);let nt=Th.getPrimaries(Th.workingColorSpace),dt=_e.colorSpace===""?null:Th.getPrimaries(_e.colorSpace),rt=_e.colorSpace===""||nt===dt?e.NONE:e.BROWSER_DEFAULT_WEBGL;e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,_e.flipY),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,_e.premultiplyAlpha),e.pixelStorei(e.UNPACK_ALIGNMENT,_e.unpackAlignment),e.pixelStorei(e.UNPACK_COLORSPACE_CONVERSION_WEBGL,rt);let pt=_e.isCompressedTexture||_e.image[0].isCompressedTexture,ct=_e.image[0]&&_e.image[0].isDataTexture,Ct=[];for(let Je=0;Je<6;Je++){if(!pt&&!ct)Ct[Je]=m(_e.image[Je],!0,r.maxCubemapSize);else Ct[Je]=ct?_e.image[Je].image:_e.image[Je];Ct[Je]=Ee(_e,Ct[Je])}let kt=Ct[0],Lt=i.convert(_e.format,_e.colorSpace),Bt=i.convert(_e.type),xt=f(_e.internalFormat,Lt,Bt,_e.colorSpace),Yt=_e.isVideoTexture!==!0,ut=Le.__version===void 0||Se===!0,Ze=Ne.dataReady,Fe=x(_e,kt);Y(e.TEXTURE_CUBE_MAP,_e);let tt;if(pt){if(Yt&&ut)n.texStorage2D(e.TEXTURE_CUBE_MAP,Fe,xt,kt.width,kt.height);for(let Je=0;Je<6;Je++){tt=Ct[Je].mipmaps;for(let $e=0;$e<tt.length;$e++){let ft=tt[$e];if(_e.format!==1023)if(Lt!==null)if(Yt){if(Ze)n.compressedTexSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+Je,$e,0,0,ft.width,ft.height,Lt,ft.data)}else n.compressedTexImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+Je,$e,xt,ft.width,ft.height,0,ft.data);else console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()");else if(Yt){if(Ze)n.texSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+Je,$e,0,0,ft.width,ft.height,Lt,Bt,ft.data)}else n.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+Je,$e,xt,ft.width,ft.height,0,Lt,Bt,ft.data)}}}else{if(tt=_e.mipmaps,Yt&&ut){if(tt.length>0)Fe++;let Je=Re(Ct[0]);n.texStorage2D(e.TEXTURE_CUBE_MAP,Fe,xt,Je.width,Je.height)}for(let Je=0;Je<6;Je++)if(ct){if(Yt){if(Ze)n.texSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+Je,0,0,0,Ct[Je].width,Ct[Je].height,Lt,Bt,Ct[Je].data)}else n.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+Je,0,xt,Ct[Je].width,Ct[Je].height,0,Lt,Bt,Ct[Je].data);for(let $e=0;$e<tt.length;$e++){let vt=tt[$e].image[Je].image;if(Yt){if(Ze)n.texSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+Je,$e+1,0,0,vt.width,vt.height,Lt,Bt,vt.data)}else n.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+Je,$e+1,xt,vt.width,vt.height,0,Lt,Bt,vt.data)}}else{if(Yt){if(Ze)n.texSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+Je,0,0,0,Lt,Bt,Ct[Je])}else n.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+Je,0,xt,Lt,Bt,Ct[Je]);for(let $e=0;$e<tt.length;$e++){let ft=tt[$e];if(Yt){if(Ze)n.texSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+Je,$e+1,0,0,Lt,Bt,ft.image[Je])}else n.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+Je,$e+1,xt,Lt,Bt,ft.image[Je])}}}if(A(_e))g(e.TEXTURE_CUBE_MAP);if(Le.__version=Ne.version,_e.onUpdate)_e.onUpdate(_e)}Me.__version=_e.version}function ee(Me,_e,ye,Se,Ne,Le){let nt=i.convert(ye.format,ye.colorSpace),dt=i.convert(ye.type),rt=f(ye.internalFormat,nt,dt,ye.colorSpace);if(!o.get(_e).__hasExternalTextures){let ct=Math.max(1,_e.width>>Le),Ct=Math.max(1,_e.height>>Le);if(Ne===e.TEXTURE_3D||Ne===e.TEXTURE_2D_ARRAY)n.texImage3D(Ne,Le,rt,ct,Ct,_e.depth,0,nt,dt,null);else n.texImage2D(Ne,Le,rt,ct,Ct,0,nt,dt,null)}if(n.bindFramebuffer(e.FRAMEBUFFER,Me),ge(_e))a.framebufferTexture2DMultisampleEXT(e.FRAMEBUFFER,Se,Ne,o.get(ye).__webglTexture,0,me(_e));else if(Ne===e.TEXTURE_2D||Ne>=e.TEXTURE_CUBE_MAP_POSITIVE_X&&Ne<=e.TEXTURE_CUBE_MAP_NEGATIVE_Z)e.framebufferTexture2D(e.FRAMEBUFFER,Se,Ne,o.get(ye).__webglTexture,Le);n.bindFramebuffer(e.FRAMEBUFFER,null)}function se(Me,_e,ye){if(e.bindRenderbuffer(e.RENDERBUFFER,Me),_e.depthBuffer){let Se=_e.depthTexture,Ne=Se&&Se.isDepthTexture?Se.type:null,Le=y(_e.stencilBuffer,Ne),nt=_e.stencilBuffer?e.DEPTH_STENCIL_ATTACHMENT:e.DEPTH_ATTACHMENT,dt=me(_e);if(ge(_e))a.renderbufferStorageMultisampleEXT(e.RENDERBUFFER,dt,Le,_e.width,_e.height);else if(ye)e.renderbufferStorageMultisample(e.RENDERBUFFER,dt,Le,_e.width,_e.height);else e.renderbufferStorage(e.RENDERBUFFER,Le,_e.width,_e.height);e.framebufferRenderbuffer(e.FRAMEBUFFER,nt,e.RENDERBUFFER,Me)}else{let Se=_e.textures;for(let Ne=0;Ne<Se.length;Ne++){let Le=Se[Ne],nt=i.convert(Le.format,Le.colorSpace),dt=i.convert(Le.type),rt=f(Le.internalFormat,nt,dt,Le.colorSpace),pt=me(_e);if(ye&&ge(_e)===!1)e.renderbufferStorageMultisample(e.RENDERBUFFER,pt,rt,_e.width,_e.height);else if(ge(_e))a.renderbufferStorageMultisampleEXT(e.RENDERBUFFER,pt,rt,_e.width,_e.height);else e.renderbufferStorage(e.RENDERBUFFER,rt,_e.width,_e.height)}}e.bindRenderbuffer(e.RENDERBUFFER,null)}function ne(Me,_e){if(_e&&_e.isWebGLCubeRenderTarget)throw Error("Depth Texture with cube render targets is not supported");if(n.bindFramebuffer(e.FRAMEBUFFER,Me),!(_e.depthTexture&&_e.depthTexture.isDepthTexture))throw Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");if(!o.get(_e.depthTexture).__webglTexture||_e.depthTexture.image.width!==_e.width||_e.depthTexture.image.height!==_e.height)_e.depthTexture.image.width=_e.width,_e.depthTexture.image.height=_e.height,_e.depthTexture.needsUpdate=!0;D(_e.depthTexture,0);let Se=o.get(_e.depthTexture).__webglTexture,Ne=me(_e);if(_e.depthTexture.format===1026)if(ge(_e))a.framebufferTexture2DMultisampleEXT(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.TEXTURE_2D,Se,0,Ne);else e.framebufferTexture2D(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.TEXTURE_2D,Se,0);else if(_e.depthTexture.format===1027)if(ge(_e))a.framebufferTexture2DMultisampleEXT(e.FRAMEBUFFER,e.DEPTH_STENCIL_ATTACHMENT,e.TEXTURE_2D,Se,0,Ne);else e.framebufferTexture2D(e.FRAMEBUFFER,e.DEPTH_STENCIL_ATTACHMENT,e.TEXTURE_2D,Se,0);else throw Error("Unknown depthTexture format")}function re(Me){let _e=o.get(Me),ye=Me.isWebGLCubeRenderTarget===!0;if(Me.depthTexture&&!_e.__autoAllocateDepthBuffer){if(ye)throw Error("target.depthTexture not supported in Cube render targets");ne(_e.__webglFramebuffer,Me)}else if(ye){_e.__webglDepthbuffer=[];for(let Se=0;Se<6;Se++)n.bindFramebuffer(e.FRAMEBUFFER,_e.__webglFramebuffer[Se]),_e.__webglDepthbuffer[Se]=e.createRenderbuffer(),se(_e.__webglDepthbuffer[Se],Me,!1)}else n.bindFramebuffer(e.FRAMEBUFFER,_e.__webglFramebuffer),_e.__webglDepthbuffer=e.createRenderbuffer(),se(_e.__webglDepthbuffer,Me,!1);n.bindFramebuffer(e.FRAMEBUFFER,null)}function Z(Me,_e,ye){let Se=o.get(Me);if(_e!==void 0)ee(Se.__webglFramebuffer,Me,Me.texture,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,0);if(ye!==void 0)re(Me)}function te(Me){let _e=Me.texture,ye=o.get(Me),Se=o.get(_e);Me.addEventListener("dispose",b);let Ne=Me.textures,Le=Me.isWebGLCubeRenderTarget===!0,nt=Ne.length>1;if(!nt){if(Se.__webglTexture===void 0)Se.__webglTexture=e.createTexture();Se.__version=_e.version,s.memory.textures++}if(Le){ye.__webglFramebuffer=[];for(let dt=0;dt<6;dt++)if(_e.mipmaps&&_e.mipmaps.length>0){ye.__webglFramebuffer[dt]=[];for(let rt=0;rt<_e.mipmaps.length;rt++)ye.__webglFramebuffer[dt][rt]=e.createFramebuffer()}else ye.__webglFramebuffer[dt]=e.createFramebuffer()}else{if(_e.mipmaps&&_e.mipmaps.length>0){ye.__webglFramebuffer=[];for(let dt=0;dt<_e.mipmaps.length;dt++)ye.__webglFramebuffer[dt]=e.createFramebuffer()}else ye.__webglFramebuffer=e.createFramebuffer();if(nt)for(let dt=0,rt=Ne.length;dt<rt;dt++){let pt=o.get(Ne[dt]);if(pt.__webglTexture===void 0)pt.__webglTexture=e.createTexture(),s.memory.textures++}if(Me.samples>0&&ge(Me)===!1){ye.__webglMultisampledFramebuffer=e.createFramebuffer(),ye.__webglColorRenderbuffer=[],n.bindFramebuffer(e.FRAMEBUFFER,ye.__webglMultisampledFramebuffer);for(let dt=0;dt<Ne.length;dt++){let rt=Ne[dt];ye.__webglColorRenderbuffer[dt]=e.createRenderbuffer(),e.bindRenderbuffer(e.RENDERBUFFER,ye.__webglColorRenderbuffer[dt]);let pt=i.convert(rt.format,rt.colorSpace),ct=i.convert(rt.type),Ct=f(rt.internalFormat,pt,ct,rt.colorSpace,Me.isXRRenderTarget===!0),kt=me(Me);e.renderbufferStorageMultisample(e.RENDERBUFFER,kt,Ct,Me.width,Me.height),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0+dt,e.RENDERBUFFER,ye.__webglColorRenderbuffer[dt])}if(e.bindRenderbuffer(e.RENDERBUFFER,null),Me.depthBuffer)ye.__webglDepthRenderbuffer=e.createRenderbuffer(),se(ye.__webglDepthRenderbuffer,Me,!0);n.bindFramebuffer(e.FRAMEBUFFER,null)}}if(Le){n.bindTexture(e.TEXTURE_CUBE_MAP,Se.__webglTexture),Y(e.TEXTURE_CUBE_MAP,_e);for(let dt=0;dt<6;dt++)if(_e.mipmaps&&_e.mipmaps.length>0)for(let rt=0;rt<_e.mipmaps.length;rt++)ee(ye.__webglFramebuffer[dt][rt],Me,_e,e.COLOR_ATTACHMENT0,e.TEXTURE_CUBE_MAP_POSITIVE_X+dt,rt);else ee(ye.__webglFramebuffer[dt],Me,_e,e.COLOR_ATTACHMENT0,e.TEXTURE_CUBE_MAP_POSITIVE_X+dt,0);if(A(_e))g(e.TEXTURE_CUBE_MAP);n.unbindTexture()}else if(nt){for(let dt=0,rt=Ne.length;dt<rt;dt++){let pt=Ne[dt],ct=o.get(pt);if(n.bindTexture(e.TEXTURE_2D,ct.__webglTexture),Y(e.TEXTURE_2D,pt),ee(ye.__webglFramebuffer,Me,pt,e.COLOR_ATTACHMENT0+dt,e.TEXTURE_2D,0),A(pt))g(e.TEXTURE_2D)}n.unbindTexture()}else{let dt=e.TEXTURE_2D;if(Me.isWebGL3DRenderTarget||Me.isWebGLArrayRenderTarget)dt=Me.isWebGL3DRenderTarget?e.TEXTURE_3D:e.TEXTURE_2D_ARRAY;if(n.bindTexture(dt,Se.__webglTexture),Y(dt,_e),_e.mipmaps&&_e.mipmaps.length>0)for(let rt=0;rt<_e.mipmaps.length;rt++)ee(ye.__webglFramebuffer[rt],Me,_e,e.COLOR_ATTACHMENT0,dt,rt);else ee(ye.__webglFramebuffer,Me,_e,e.COLOR_ATTACHMENT0,dt,0);if(A(_e))g(dt);n.unbindTexture()}if(Me.depthBuffer)re(Me)}function ie(Me){let _e=Me.textures;for(let ye=0,Se=_e.length;ye<Se;ye++){let Ne=_e[ye];if(A(Ne)){let Le=Me.isWebGLCubeRenderTarget?e.TEXTURE_CUBE_MAP:e.TEXTURE_2D,nt=o.get(Ne).__webglTexture;n.bindTexture(Le,nt),g(Le),n.unbindTexture()}}}let ce=[],ue=[];function de(Me){if(Me.samples>0){if(ge(Me)===!1){let{textures:_e,width:ye,height:Se}=Me,Ne=e.COLOR_BUFFER_BIT,Le=Me.stencilBuffer?e.DEPTH_STENCIL_ATTACHMENT:e.DEPTH_ATTACHMENT,nt=o.get(Me),dt=_e.length>1;if(dt)for(let rt=0;rt<_e.length;rt++)n.bindFramebuffer(e.FRAMEBUFFER,nt.__webglMultisampledFramebuffer),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0+rt,e.RENDERBUFFER,null),n.bindFramebuffer(e.FRAMEBUFFER,nt.__webglFramebuffer),e.framebufferTexture2D(e.DRAW_FRAMEBUFFER,e.COLOR_ATTACHMENT0+rt,e.TEXTURE_2D,null,0);n.bindFramebuffer(e.READ_FRAMEBUFFER,nt.__webglMultisampledFramebuffer),n.bindFramebuffer(e.DRAW_FRAMEBUFFER,nt.__webglFramebuffer);for(let rt=0;rt<_e.length;rt++){if(Me.resolveDepthBuffer){if(Me.depthBuffer)Ne|=e.DEPTH_BUFFER_BIT;if(Me.stencilBuffer&&Me.resolveStencilBuffer)Ne|=e.STENCIL_BUFFER_BIT}if(dt){e.framebufferRenderbuffer(e.READ_FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.RENDERBUFFER,nt.__webglColorRenderbuffer[rt]);let pt=o.get(_e[rt]).__webglTexture;e.framebufferTexture2D(e.DRAW_FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,pt,0)}if(e.blitFramebuffer(0,0,ye,Se,0,0,ye,Se,Ne,e.NEAREST),c===!0){if(ce.length=0,ue.length=0,ce.push(e.COLOR_ATTACHMENT0+rt),Me.depthBuffer&&Me.resolveDepthBuffer===!1)ce.push(Le),ue.push(Le),e.invalidateFramebuffer(e.DRAW_FRAMEBUFFER,ue);e.invalidateFramebuffer(e.READ_FRAMEBUFFER,ce)}}if(n.bindFramebuffer(e.READ_FRAMEBUFFER,null),n.bindFramebuffer(e.DRAW_FRAMEBUFFER,null),dt)for(let rt=0;rt<_e.length;rt++){n.bindFramebuffer(e.FRAMEBUFFER,nt.__webglMultisampledFramebuffer),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0+rt,e.RENDERBUFFER,nt.__webglColorRenderbuffer[rt]);let pt=o.get(_e[rt]).__webglTexture;n.bindFramebuffer(e.FRAMEBUFFER,nt.__webglFramebuffer),e.framebufferTexture2D(e.DRAW_FRAMEBUFFER,e.COLOR_ATTACHMENT0+rt,e.TEXTURE_2D,pt,0)}n.bindFramebuffer(e.DRAW_FRAMEBUFFER,nt.__webglMultisampledFramebuffer)}else if(Me.depthBuffer&&Me.resolveDepthBuffer===!1&&c){let _e=Me.stencilBuffer?e.DEPTH_STENCIL_ATTACHMENT:e.DEPTH_ATTACHMENT;e.invalidateFramebuffer(e.DRAW_FRAMEBUFFER,[_e])}}}function me(Me){return Math.min(r.maxSamples,Me.samples)}function ge(Me){let _e=o.get(Me);return Me.samples>0&&t.has("WEBGL_multisampled_render_to_texture")===!0&&_e.__useRenderToTexture!==!1}function xe(Me){let _e=s.render.frame;if(h.get(Me)!==_e)h.set(Me,_e),Me.update()}function Ee(Me,_e){let{colorSpace:ye,format:Se,type:Ne}=Me;if(Me.isCompressedTexture===!0||Me.isVideoTexture===!0)return _e;if(ye!=="srgb-linear"&&ye!=="")if(Th.getTransfer(ye)==="srgb"){if(Se!==1023||Ne!==1009)console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType.")}else console.error("THREE.WebGLTextures: Unsupported texture color space:",ye);return _e}function Re(Me){if(typeof HTMLImageElement<"u"&&Me instanceof HTMLImageElement)l.width=Me.naturalWidth||Me.width,l.height=Me.naturalHeight||Me.height;else if(typeof VideoFrame<"u"&&Me instanceof VideoFrame)l.width=Me.displayWidth,l.height=Me.displayHeight;else l.width=Me.width,l.height=Me.height;return l}this.allocateTextureUnit=T,this.resetTextureUnits=B,this.setTexture2D=D,this.setTexture2DArray=L,this.setTexture3D=H,this.setTextureCube=V,this.rebindTextures=Z,this.setupRenderTarget=te,this.updateRenderTargetMipmap=ie,this.updateMultisampleRenderTarget=de,this.setupDepthRenderbuffer=re,this.setupFrameBufferTexture=ee,this.useMultisampledRTT=ge}function FHo(e,t){function n(o,r=""){let i,s=Th.getTransfer(r);if(o===1009)return e.UNSIGNED_BYTE;if(o===1017)return e.UNSIGNED_SHORT_4_4_4_4;if(o===1018)return e.UNSIGNED_SHORT_5_5_5_1;if(o===35902)return e.UNSIGNED_INT_5_9_9_9_REV;if(o===1010)return e.BYTE;if(o===1011)return e.SHORT;if(o===1012)return e.UNSIGNED_SHORT;if(o===1013)return e.INT;if(o===1014)return e.UNSIGNED_INT;if(o===1015)return e.FLOAT;if(o===1016)return e.HALF_FLOAT;if(o===1021)return e.ALPHA;if(o===1022)return e.RGB;if(o===1023)return e.RGBA;if(o===1024)return e.LUMINANCE;if(o===1025)return e.LUMINANCE_ALPHA;if(o===1026)return e.DEPTH_COMPONENT;if(o===1027)return e.DEPTH_STENCIL;if(o===1028)return e.RED;if(o===1029)return e.RED_INTEGER;if(o===1030)return e.RG;if(o===1031)return e.RG_INTEGER;if(o===1033)return e.RGBA_INTEGER;if(o===33776||o===33777||o===33778||o===33779)if(s==="srgb")if(i=t.get("WEBGL_compressed_texture_s3tc_srgb"),i!==null){if(o===33776)return i.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(o===33777)return i.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(o===33778)return i.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(o===33779)return i.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(i=t.get("WEBGL_compressed_texture_s3tc"),i!==null){if(o===33776)return i.COMPRESSED_RGB_S3TC_DXT1_EXT;if(o===33777)return i.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(o===33778)return i.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(o===33779)return i.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(o===35840||o===35841||o===35842||o===35843)if(i=t.get("WEBGL_compressed_texture_pvrtc"),i!==null){if(o===35840)return i.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(o===35841)return i.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(o===35842)return i.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(o===35843)return i.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(o===36196||o===37492||o===37496)if(i=t.get("WEBGL_compressed_texture_etc"),i!==null){if(o===36196||o===37492)return s==="srgb"?i.COMPRESSED_SRGB8_ETC2:i.COMPRESSED_RGB8_ETC2;if(o===37496)return s==="srgb"?i.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:i.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(o===37808||o===37809||o===37810||o===37811||o===37812||o===37813||o===37814||o===37815||o===37816||o===37817||o===37818||o===37819||o===37820||o===37821)if(i=t.get("WEBGL_compressed_texture_astc"),i!==null){if(o===37808)return s==="srgb"?i.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:i.COMPRESSED_RGBA_ASTC_4x4_KHR;if(o===37809)return s==="srgb"?i.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:i.COMPRESSED_RGBA_ASTC_5x4_KHR;if(o===37810)return s==="srgb"?i.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:i.COMPRESSED_RGBA_ASTC_5x5_KHR;if(o===37811)return s==="srgb"?i.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:i.COMPRESSED_RGBA_ASTC_6x5_KHR;if(o===37812)return s==="srgb"?i.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:i.COMPRESSED_RGBA_ASTC_6x6_KHR;if(o===37813)return s==="srgb"?i.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:i.COMPRESSED_RGBA_ASTC_8x5_KHR;if(o===37814)return s==="srgb"?i.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:i.COMPRESSED_RGBA_ASTC_8x6_KHR;if(o===37815)return s==="srgb"?i.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:i.COMPRESSED_RGBA_ASTC_8x8_KHR;if(o===37816)return s==="srgb"?i.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:i.COMPRESSED_RGBA_ASTC_10x5_KHR;if(o===37817)return s==="srgb"?i.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:i.COMPRESSED_RGBA_ASTC_10x6_KHR;if(o===37818)return s==="srgb"?i.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:i.COMPRESSED_RGBA_ASTC_10x8_KHR;if(o===37819)return s==="srgb"?i.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:i.COMPRESSED_RGBA_ASTC_10x10_KHR;if(o===37820)return s==="srgb"?i.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:i.COMPRESSED_RGBA_ASTC_12x10_KHR;if(o===37821)return s==="srgb"?i.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:i.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(o===36492||o===36494||o===36495)if(i=t.get("EXT_texture_compression_bptc"),i!==null){if(o===36492)return s==="srgb"?i.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:i.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(o===36494)return i.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(o===36495)return i.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(o===36283||o===36284||o===36285||o===36286)if(i=t.get("EXT_texture_compression_rgtc"),i!==null){if(o===36492)return i.COMPRESSED_RED_RGTC1_EXT;if(o===36284)return i.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(o===36285)return i.COMPRESSED_RED_GREEN_RGTC2_EXT;if(o===36286)return i.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;if(o===1020)return e.UNSIGNED_INT_24_8;return e[o]!==void 0?e[o]:null}return{convert:n}}class SEt extends wl{constructor(e=[]){super();this.isArrayCamera=!0,this.cameras=e}}class dc extends nl{constructor(){super();this.isGroup=!0,this.type="Group"}}var zHo={type:"move"};class Rye{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){if(this._hand===null)this._hand=new dc,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1};return this._hand}getTargetRaySpace(){if(this._targetRay===null)this._targetRay=new dc,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new Dt,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new Dt;return this._targetRay}getGripSpace(){if(this._grip===null)this._grip=new dc,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new Dt,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new Dt;return this._grip}dispatchEvent(e){if(this._targetRay!==null)this._targetRay.dispatchEvent(e);if(this._grip!==null)this._grip.dispatchEvent(e);if(this._hand!==null)this._hand.dispatchEvent(e);return this}connect(e){if(e&&e.hand){let t=this._hand;if(t)for(let n of e.hand.values())this._getHandJoint(t,n)}return this.dispatchEvent({type:"connected",data:e}),this}disconnect(e){if(this.dispatchEvent({type:"disconnected",data:e}),this._targetRay!==null)this._targetRay.visible=!1;if(this._grip!==null)this._grip.visible=!1;if(this._hand!==null)this._hand.visible=!1;return this}update(e,t,n){let o=null,r=null,i=null,s=this._targetRay,a=this._grip,c=this._hand;if(e&&t.session.visibilityState!=="visible-blurred"){if(c&&e.hand){i=!0;for(let p of e.hand.values()){let m=t.getJointPose(p,n),A=this._getHandJoint(c,p);if(m!==null)A.matrix.fromArray(m.transform.matrix),A.matrix.decompose(A.position,A.rotation,A.scale),A.matrixWorldNeedsUpdate=!0,A.jointRadius=m.radius;A.visible=m!==null}let l=c.joints["index-finger-tip"],h=c.joints["thumb-tip"],d=l.position.distanceTo(h.position),u=0.02,_=0.005;if(c.inputState.pinching&&d>u+_)c.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this});else if(!c.inputState.pinching&&d<=u-_)c.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this})}else if(a!==null&&e.gripSpace){if(r=t.getPose(e.gripSpace,n),r!==null){if(a.matrix.fromArray(r.transform.matrix),a.matrix.decompose(a.position,a.rotation,a.scale),a.matrixWorldNeedsUpdate=!0,r.linearVelocity)a.hasLinearVelocity=!0,a.linearVelocity.copy(r.linearVelocity);else a.hasLinearVelocity=!1;if(r.angularVelocity)a.hasAngularVelocity=!0,a.angularVelocity.copy(r.angularVelocity);else a.hasAngularVelocity=!1}}if(s!==null){if(o=t.getPose(e.targetRaySpace,n),o===null&&r!==null)o=r;if(o!==null){if(s.matrix.fromArray(o.transform.matrix),s.matrix.decompose(s.position,s.rotation,s.scale),s.matrixWorldNeedsUpdate=!0,o.linearVelocity)s.hasLinearVelocity=!0,s.linearVelocity.copy(o.linearVelocity);else s.hasLinearVelocity=!1;if(o.angularVelocity)s.hasAngularVelocity=!0,s.angularVelocity.copy(o.angularVelocity);else s.hasAngularVelocity=!1;this.dispatchEvent(zHo)}}}if(s!==null)s.visible=o!==null;if(a!==null)a.visible=r!==null;if(c!==null)c.visible=i!==null;return this}_getHandJoint(e,t){if(e.joints[t.jointName]===void 0){let n=new dc;n.matrixAutoUpdate=!1,n.visible=!1,e.joints[t.jointName]=n,e.add(n)}return e.joints[t.jointName]}}var OHo=`
void main() {

	gl_Position = vec4( position, 1.0 );

}`,VHo=`
uniform sampler2DArray depthColor;
uniform float depthWidth;
uniform float depthHeight;

void main() {

	vec2 coord = vec2( gl_FragCoord.x / depthWidth, gl_FragCoord.y / depthHeight );

	if ( coord.x >= 1.0 ) {

		gl_FragDepth = texture( depthColor, vec3( coord.x - 1.0, coord.y, 1 ) ).r;

	} else {

		gl_FragDepth = texture( depthColor, vec3( coord.x, coord.y, 0 ) ).r;

	}

}`;class PEt{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(e,t,n){if(this.texture===null){let o=new Bl,r=e.properties.get(o);if(r.__webglTexture=t.texture,t.depthNear!=n.depthNear||t.depthFar!=n.depthFar)this.depthNear=t.depthNear,this.depthFar=t.depthFar;this.texture=o}}getMesh(e){if(this.texture!==null){if(this.mesh===null){let t=e.cameras[0].viewport,n=new y4({vertexShader:OHo,fragmentShader:VHo,uniforms:{depthColor:{value:this.texture},depthWidth:{value:t.z},depthHeight:{value:t.w}}});this.mesh=new Qo(new v2(20,20),n)}}return this.mesh}reset(){this.texture=null,this.mesh=null}}class EEt extends FM{constructor(e,t){super();let n=this,o=null,r=1,i=null,s="local-floor",a=1,c=null,l=null,h=null,d=null,u=null,_=null,p=new PEt,m=t.getContextAttributes(),A=null,g=null,f=[],y=[],x=new go,C=null,b=new wl;b.layers.enable(1),b.viewport=new Ah;let I=new wl;I.layers.enable(2),I.viewport=new Ah;let v=[b,I],P=new SEt;P.layers.enable(1),P.layers.enable(2);let M=null,B=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(K){let J=f[K];if(J===void 0)J=new Rye,f[K]=J;return J.getTargetRaySpace()},this.getControllerGrip=function(K){let J=f[K];if(J===void 0)J=new Rye,f[K]=J;return J.getGripSpace()},this.getHand=function(K){let J=f[K];if(J===void 0)J=new Rye,f[K]=J;return J.getHandSpace()};function T(K){let J=y.indexOf(K.inputSource);if(J===-1)return;let ee=f[J];if(ee!==void 0)ee.update(K.inputSource,K.frame,c||i),ee.dispatchEvent({type:K.type,data:K.inputSource})}function N(){o.removeEventListener("select",T),o.removeEventListener("selectstart",T),o.removeEventListener("selectend",T),o.removeEventListener("squeeze",T),o.removeEventListener("squeezestart",T),o.removeEventListener("squeezeend",T),o.removeEventListener("end",N),o.removeEventListener("inputsourceschange",D);for(let K=0;K<f.length;K++){let J=y[K];if(J===null)continue;y[K]=null,f[K].disconnect(J)}M=null,B=null,p.reset(),e.setRenderTarget(A),u=null,d=null,h=null,o=null,g=null,X.stop(),n.isPresenting=!1,e.setPixelRatio(C),e.setSize(x.width,x.height,!1),n.dispatchEvent({type:"sessionend"})}this.setFramebufferScaleFactor=function(K){if(r=K,n.isPresenting===!0)console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(K){if(s=K,n.isPresenting===!0)console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return c||i},this.setReferenceSpace=function(K){c=K},this.getBaseLayer=function(){return d!==null?d:u},this.getBinding=function(){return h},this.getFrame=function(){return _},this.getSession=function(){return o},this.setSession=async function(K){if(o=K,o!==null){if(A=e.getRenderTarget(),o.addEventListener("select",T),o.addEventListener("selectstart",T),o.addEventListener("selectend",T),o.addEventListener("squeeze",T),o.addEventListener("squeezestart",T),o.addEventListener("squeezeend",T),o.addEventListener("end",N),o.addEventListener("inputsourceschange",D),m.xrCompatible!==!0)await t.makeXRCompatible();if(C=e.getPixelRatio(),e.getSize(x),o.renderState.layers===void 0){let J={antialias:m.antialias,alpha:!0,depth:m.depth,stencil:m.stencil,framebufferScaleFactor:r};u=new XRWebGLLayer(o,t,J),o.updateRenderState({baseLayer:u}),e.setPixelRatio(1),e.setSize(u.framebufferWidth,u.framebufferHeight,!1),g=new JN(u.framebufferWidth,u.framebufferHeight,{format:1023,type:1009,colorSpace:e.outputColorSpace,stencilBuffer:m.stencil})}else{let J=null,ee=null,se=null;if(m.depth)se=m.stencil?t.DEPTH24_STENCIL8:t.DEPTH_COMPONENT24,J=m.stencil?1027:1026,ee=m.stencil?1020:1014;let ne={colorFormat:t.RGBA8,depthFormat:se,scaleFactor:r};h=new XRWebGLBinding(o,t),d=h.createProjectionLayer(ne),o.updateRenderState({layers:[d]}),e.setPixelRatio(1),e.setSize(d.textureWidth,d.textureHeight,!1),g=new JN(d.textureWidth,d.textureHeight,{format:1023,type:1009,depthTexture:new fOe(d.textureWidth,d.textureHeight,ee,void 0,void 0,void 0,void 0,void 0,void 0,J),stencilBuffer:m.stencil,colorSpace:e.outputColorSpace,samples:m.antialias?4:0,resolveDepthBuffer:d.ignoreDepthValues===!1})}g.isXRRenderTarget=!0,this.setFoveation(a),c=null,i=await o.requestReferenceSpace(s),X.setContext(o),X.start(),n.isPresenting=!0,n.dispatchEvent({type:"sessionstart"})}},this.getEnvironmentBlendMode=function(){if(o!==null)return o.environmentBlendMode};function D(K){for(let J=0;J<K.removed.length;J++){let ee=K.removed[J],se=y.indexOf(ee);if(se>=0)y[se]=null,f[se].disconnect(ee)}for(let J=0;J<K.added.length;J++){let ee=K.added[J],se=y.indexOf(ee);if(se===-1){for(let re=0;re<f.length;re++)if(re>=y.length){y.push(ee),se=re;break}else if(y[re]===null){y[re]=ee,se=re;break}if(se===-1)break}let ne=f[se];if(ne)ne.connect(ee)}}let L=new Dt,H=new Dt;function V(K,J,ee){L.setFromMatrixPosition(J.matrixWorld),H.setFromMatrixPosition(ee.matrixWorld);let se=L.distanceTo(H),ne=J.projectionMatrix.elements,re=ee.projectionMatrix.elements,Z=ne[14]/(ne[10]-1),te=ne[14]/(ne[10]+1),ie=(ne[9]+1)/ne[5],ce=(ne[9]-1)/ne[5],ue=(ne[8]-1)/ne[0],de=(re[8]+1)/re[0],me=Z*ue,ge=Z*de,xe=se/(-ue+de),Ee=xe*-ue;J.matrixWorld.decompose(K.position,K.quaternion,K.scale),K.translateX(Ee),K.translateZ(xe),K.matrixWorld.compose(K.position,K.quaternion,K.scale),K.matrixWorldInverse.copy(K.matrixWorld).invert();let Re=Z+xe,Me=te+xe,_e=me-Ee,ye=ge+(se-Ee),Se=ie*te/Me*Re,Ne=ce*te/Me*Re;K.projectionMatrix.makePerspective(_e,ye,Se,Ne,Re,Me),K.projectionMatrixInverse.copy(K.projectionMatrix).invert()}function O(K,J){if(J===null)K.matrixWorld.copy(K.matrix);else K.matrixWorld.multiplyMatrices(J.matrixWorld,K.matrix);K.matrixWorldInverse.copy(K.matrixWorld).invert()}this.updateCamera=function(K){if(o===null)return;if(p.texture!==null)K.near=p.depthNear,K.far=p.depthFar;if(P.near=I.near=b.near=K.near,P.far=I.far=b.far=K.far,M!==P.near||B!==P.far)o.updateRenderState({depthNear:P.near,depthFar:P.far}),M=P.near,B=P.far,b.near=M,b.far=B,I.near=M,I.far=B,b.updateProjectionMatrix(),I.updateProjectionMatrix(),K.updateProjectionMatrix();let J=K.parent,ee=P.cameras;O(P,J);for(let se=0;se<ee.length;se++)O(ee[se],J);if(ee.length===2)V(P,b,I);else P.projectionMatrix.copy(b.projectionMatrix);U(K,P,J)};function U(K,J,ee){if(ee===null)K.matrix.copy(J.matrixWorld);else K.matrix.copy(ee.matrixWorld),K.matrix.invert(),K.matrix.multiply(J.matrixWorld);if(K.matrix.decompose(K.position,K.quaternion,K.scale),K.updateMatrixWorld(!0),K.projectionMatrix.copy(J.projectionMatrix),K.projectionMatrixInverse.copy(J.projectionMatrixInverse),K.isPerspectiveCamera)K.fov=Gj*2*Math.atan(1/K.projectionMatrix.elements[5]),K.zoom=1}this.getCamera=function(){return P},this.getFoveation=function(){if(d===null&&u===null)return;return a},this.setFoveation=function(K){if(a=K,d!==null)d.fixedFoveation=K;if(u!==null&&u.fixedFoveation!==void 0)u.fixedFoveation=K},this.hasDepthSensing=function(){return p.texture!==null},this.getDepthSensingMesh=function(){return p.getMesh(P)};let j=null;function Y(K,J){if(l=J.getViewerPose(c||i),_=J,l!==null){let ee=l.views;if(u!==null)e.setRenderTargetFramebuffer(g,u.framebuffer),e.setRenderTarget(g);let se=!1;if(ee.length!==P.cameras.length)P.cameras.length=0,se=!0;for(let re=0;re<ee.length;re++){let Z=ee[re],te=null;if(u!==null)te=u.getViewport(Z);else{let ce=h.getViewSubImage(d,Z);if(te=ce.viewport,re===0)e.setRenderTargetTextures(g,ce.colorTexture,d.ignoreDepthValues?void 0:ce.depthStencilTexture),e.setRenderTarget(g)}let ie=v[re];if(ie===void 0)ie=new wl,ie.layers.enable(re),ie.viewport=new Ah,v[re]=ie;if(ie.matrix.fromArray(Z.transform.matrix),ie.matrix.decompose(ie.position,ie.quaternion,ie.scale),ie.projectionMatrix.fromArray(Z.projectionMatrix),ie.projectionMatrixInverse.copy(ie.projectionMatrix).invert(),ie.viewport.set(te.x,te.y,te.width,te.height),re===0)P.matrix.copy(ie.matrix),P.matrix.decompose(P.position,P.quaternion,P.scale);if(se===!0)P.cameras.push(ie)}let ne=o.enabledFeatures;if(ne&&ne.includes("depth-sensing")){let re=h.getDepthInformation(ee[0]);if(re&&re.isValid&&re.texture)p.init(e,re,o.renderState)}}for(let ee=0;ee<f.length;ee++){let se=y[ee],ne=f[ee];if(se!==null&&ne!==void 0)ne.update(se,J,c||i)}if(j)j(K,J);if(J.detectedPlanes)n.dispatchEvent({type:"planesdetected",data:J});_=null}let X=new mEt;X.setAnimationLoop(Y),this.setAnimationLoop=function(K){j=K},this.dispose=function(){}}}var yz=new aA,YHo=new Fi;function GHo(e,t){function n(A,g){if(A.matrixAutoUpdate===!0)A.updateMatrix();g.value.copy(A.matrix)}function o(A,g){if(g.color.getRGB(A.fogColor.value,dEt(e)),g.isFog)A.fogNear.value=g.near,A.fogFar.value=g.far;else if(g.isFogExp2)A.fogDensity.value=g.density}function r(A,g,f,y,x){if(g.isMeshBasicMaterial)i(A,g);else if(g.isMeshLambertMaterial)i(A,g);else if(g.isMeshToonMaterial)i(A,g),d(A,g);else if(g.isMeshPhongMaterial)i(A,g),h(A,g);else if(g.isMeshStandardMaterial){if(i(A,g),u(A,g),g.isMeshPhysicalMaterial)_(A,g,x)}else if(g.isMeshMatcapMaterial)i(A,g),p(A,g);else if(g.isMeshDepthMaterial)i(A,g);else if(g.isMeshDistanceMaterial)i(A,g),m(A,g);else if(g.isMeshNormalMaterial)i(A,g);else if(g.isLineBasicMaterial){if(s(A,g),g.isLineDashedMaterial)a(A,g)}else if(g.isPointsMaterial)c(A,g,f,y);else if(g.isSpriteMaterial)l(A,g);else if(g.isShadowMaterial)A.color.value.copy(g.color),A.opacity.value=g.opacity;else if(g.isShaderMaterial)g.uniformsNeedUpdate=!1}function i(A,g){if(A.opacity.value=g.opacity,g.color)A.diffuse.value.copy(g.color);if(g.emissive)A.emissive.value.copy(g.emissive).multiplyScalar(g.emissiveIntensity);if(g.map)A.map.value=g.map,n(g.map,A.mapTransform);if(g.alphaMap)A.alphaMap.value=g.alphaMap,n(g.alphaMap,A.alphaMapTransform);if(g.bumpMap){if(A.bumpMap.value=g.bumpMap,n(g.bumpMap,A.bumpMapTransform),A.bumpScale.value=g.bumpScale,g.side===1)A.bumpScale.value*=-1}if(g.normalMap){if(A.normalMap.value=g.normalMap,n(g.normalMap,A.normalMapTransform),A.normalScale.value.copy(g.normalScale),g.side===1)A.normalScale.value.negate()}if(g.displacementMap)A.displacementMap.value=g.displacementMap,n(g.displacementMap,A.displacementMapTransform),A.displacementScale.value=g.displacementScale,A.displacementBias.value=g.displacementBias;if(g.emissiveMap)A.emissiveMap.value=g.emissiveMap,n(g.emissiveMap,A.emissiveMapTransform);if(g.specularMap)A.specularMap.value=g.specularMap,n(g.specularMap,A.specularMapTransform);if(g.alphaTest>0)A.alphaTest.value=g.alphaTest;let f=t.get(g),{envMap:y,envMapRotation:x}=f;if(y){if(A.envMap.value=y,yz.copy(x),yz.x*=-1,yz.y*=-1,yz.z*=-1,y.isCubeTexture&&y.isRenderTargetTexture===!1)yz.y*=-1,yz.z*=-1;A.envMapRotation.value.setFromMatrix4(YHo.makeRotationFromEuler(yz)),A.flipEnvMap.value=y.isCubeTexture&&y.isRenderTargetTexture===!1?-1:1,A.reflectivity.value=g.reflectivity,A.ior.value=g.ior,A.refractionRatio.value=g.refractionRatio}if(g.lightMap)A.lightMap.value=g.lightMap,A.lightMapIntensity.value=g.lightMapIntensity,n(g.lightMap,A.lightMapTransform);if(g.aoMap)A.aoMap.value=g.aoMap,A.aoMapIntensity.value=g.aoMapIntensity,n(g.aoMap,A.aoMapTransform)}function s(A,g){if(A.diffuse.value.copy(g.color),A.opacity.value=g.opacity,g.map)A.map.value=g.map,n(g.map,A.mapTransform)}function a(A,g){A.dashSize.value=g.dashSize,A.totalSize.value=g.dashSize+g.gapSize,A.scale.value=g.scale}function c(A,g,f,y){if(A.diffuse.value.copy(g.color),A.opacity.value=g.opacity,A.size.value=g.size*f,A.scale.value=y*0.5,g.map)A.map.value=g.map,n(g.map,A.uvTransform);if(g.alphaMap)A.alphaMap.value=g.alphaMap,n(g.alphaMap,A.alphaMapTransform);if(g.alphaTest>0)A.alphaTest.value=g.alphaTest}function l(A,g){if(A.diffuse.value.copy(g.color),A.opacity.value=g.opacity,A.rotation.value=g.rotation,g.map)A.map.value=g.map,n(g.map,A.mapTransform);if(g.alphaMap)A.alphaMap.value=g.alphaMap,n(g.alphaMap,A.alphaMapTransform);if(g.alphaTest>0)A.alphaTest.value=g.alphaTest}function h(A,g){A.specular.value.copy(g.specular),A.shininess.value=Math.max(g.shininess,0.0001)}function d(A,g){if(g.gradientMap)A.gradientMap.value=g.gradientMap}function u(A,g){if(A.metalness.value=g.metalness,g.metalnessMap)A.metalnessMap.value=g.metalnessMap,n(g.metalnessMap,A.metalnessMapTransform);if(A.roughness.value=g.roughness,g.roughnessMap)A.roughnessMap.value=g.roughnessMap,n(g.roughnessMap,A.roughnessMapTransform);if(g.envMap)A.envMapIntensity.value=g.envMapIntensity}function _(A,g,f){if(A.ior.value=g.ior,g.sheen>0){if(A.sheenColor.value.copy(g.sheenColor).multiplyScalar(g.sheen),A.sheenRoughness.value=g.sheenRoughness,g.sheenColorMap)A.sheenColorMap.value=g.sheenColorMap,n(g.sheenColorMap,A.sheenColorMapTransform);if(g.sheenRoughnessMap)A.sheenRoughnessMap.value=g.sheenRoughnessMap,n(g.sheenRoughnessMap,A.sheenRoughnessMapTransform)}if(g.clearcoat>0){if(A.clearcoat.value=g.clearcoat,A.clearcoatRoughness.value=g.clearcoatRoughness,g.clearcoatMap)A.clearcoatMap.value=g.clearcoatMap,n(g.clearcoatMap,A.clearcoatMapTransform);if(g.clearcoatRoughnessMap)A.clearcoatRoughnessMap.value=g.clearcoatRoughnessMap,n(g.clearcoatRoughnessMap,A.clearcoatRoughnessMapTransform);if(g.clearcoatNormalMap){if(A.clearcoatNormalMap.value=g.clearcoatNormalMap,n(g.clearcoatNormalMap,A.clearcoatNormalMapTransform),A.clearcoatNormalScale.value.copy(g.clearcoatNormalScale),g.side===1)A.clearcoatNormalScale.value.negate()}}if(g.dispersion>0)A.dispersion.value=g.dispersion;if(g.iridescence>0){if(A.iridescence.value=g.iridescence,A.iridescenceIOR.value=g.iridescenceIOR,A.iridescenceThicknessMinimum.value=g.iridescenceThicknessRange[0],A.iridescenceThicknessMaximum.value=g.iridescenceThicknessRange[1],g.iridescenceMap)A.iridescenceMap.value=g.iridescenceMap,n(g.iridescenceMap,A.iridescenceMapTransform);if(g.iridescenceThicknessMap)A.iridescenceThicknessMap.value=g.iridescenceThicknessMap,n(g.iridescenceThicknessMap,A.iridescenceThicknessMapTransform)}if(g.transmission>0){if(A.transmission.value=g.transmission,A.transmissionSamplerMap.value=f.texture,A.transmissionSamplerSize.value.set(f.width,f.height),g.transmissionMap)A.transmissionMap.value=g.transmissionMap,n(g.transmissionMap,A.transmissionMapTransform);if(A.thickness.value=g.thickness,g.thicknessMap)A.thicknessMap.value=g.thicknessMap,n(g.thicknessMap,A.thicknessMapTransform);A.attenuationDistance.value=g.attenuationDistance,A.attenuationColor.value.copy(g.attenuationColor)}if(g.anisotropy>0){if(A.anisotropyVector.value.set(g.anisotropy*Math.cos(g.anisotropyRotation),g.anisotropy*Math.sin(g.anisotropyRotation)),g.anisotropyMap)A.anisotropyMap.value=g.anisotropyMap,n(g.anisotropyMap,A.anisotropyMapTransform)}if(A.specularIntensity.value=g.specularIntensity,A.specularColor.value.copy(g.specularColor),g.specularColorMap)A.specularColorMap.value=g.specularColorMap,n(g.specularColorMap,A.specularColorMapTransform);if(g.specularIntensityMap)A.specularIntensityMap.value=g.specularIntensityMap,n(g.specularIntensityMap,A.specularIntensityMapTransform)}function p(A,g){if(g.matcap)A.matcap.value=g.matcap}function m(A,g){let f=t.get(g).light;A.referencePosition.value.setFromMatrixPosition(f.matrixWorld),A.nearDistance.value=f.shadow.camera.near,A.farDistance.value=f.shadow.camera.far}return{refreshFogUniforms:o,refreshMaterialUniforms:r}}function UHo(e,t,n,o){let r={},i={},s=[],a=e.getParameter(e.MAX_UNIFORM_BUFFER_BINDINGS);function c(f,y){let x=y.program;o.uniformBlockBinding(f,x)}function l(f,y){let x=r[f.id];if(x===void 0)p(f),x=h(f),r[f.id]=x,f.addEventListener("dispose",A);let C=y.program;o.updateUBOMapping(f,C);let b=t.render.frame;if(i[f.id]!==b)u(f),i[f.id]=b}function h(f){let y=d();f.__bindingPointIndex=y;let x=e.createBuffer(),{__size:C,usage:b}=f;return e.bindBuffer(e.UNIFORM_BUFFER,x),e.bufferData(e.UNIFORM_BUFFER,C,b),e.bindBuffer(e.UNIFORM_BUFFER,null),e.bindBufferBase(e.UNIFORM_BUFFER,y,x),x}function d(){for(let f=0;f<a;f++)if(s.indexOf(f)===-1)return s.push(f),f;return console.error("THREE.WebGLRenderer: Maximum number of simultaneously usable uniforms groups reached."),0}function u(f){let y=r[f.id],{uniforms:x,__cache:C}=f;e.bindBuffer(e.UNIFORM_BUFFER,y);for(let b=0,I=x.length;b<I;b++){let v=Array.isArray(x[b])?x[b]:[x[b]];for(let P=0,M=v.length;P<M;P++){let B=v[P];if(_(B,b,P,C)===!0){let T=B.__offset,N=Array.isArray(B.value)?B.value:[B.value],D=0;for(let L=0;L<N.length;L++){let H=N[L],V=m(H);if(typeof H==="number"||typeof H==="boolean")B.__data[0]=H,e.bufferSubData(e.UNIFORM_BUFFER,T+D,B.__data);else if(H.isMatrix3)B.__data[0]=H.elements[0],B.__data[1]=H.elements[1],B.__data[2]=H.elements[2],B.__data[3]=0,B.__data[4]=H.elements[3],B.__data[5]=H.elements[4],B.__data[6]=H.elements[5],B.__data[7]=0,B.__data[8]=H.elements[6],B.__data[9]=H.elements[7],B.__data[10]=H.elements[8],B.__data[11]=0;else H.toArray(B.__data,D),D+=V.storage/Float32Array.BYTES_PER_ELEMENT}e.bufferSubData(e.UNIFORM_BUFFER,T,B.__data)}}}e.bindBuffer(e.UNIFORM_BUFFER,null)}function _(f,y,x,C){let b=f.value,I=y+"_"+x;if(C[I]===void 0){if(typeof b==="number"||typeof b==="boolean")C[I]=b;else C[I]=b.clone();return!0}else{let v=C[I];if(typeof b==="number"||typeof b==="boolean"){if(v!==b)return C[I]=b,!0}else if(v.equals(b)===!1)return v.copy(b),!0}return!1}function p(f){let y=f.uniforms,x=0,C=16;for(let I=0,v=y.length;I<v;I++){let P=Array.isArray(y[I])?y[I]:[y[I]];for(let M=0,B=P.length;M<B;M++){let T=P[M],N=Array.isArray(T.value)?T.value:[T.value];for(let D=0,L=N.length;D<L;D++){let H=N[D],V=m(H),O=x%C;if(O!==0&&C-O<V.boundary)x+=C-O;T.__data=new Float32Array(V.storage/Float32Array.BYTES_PER_ELEMENT),T.__offset=x,x+=V.storage}}}let b=x%C;if(b>0)x+=C-b;return f.__size=x,f.__cache={},this}function m(f){let y={boundary:0,storage:0};if(typeof f==="number"||typeof f==="boolean")y.boundary=4,y.storage=4;else if(f.isVector2)y.boundary=8,y.storage=8;else if(f.isVector3||f.isColor)y.boundary=16,y.storage=12;else if(f.isVector4)y.boundary=16,y.storage=16;else if(f.isMatrix3)y.boundary=48,y.storage=48;else if(f.isMatrix4)y.boundary=64,y.storage=64;else if(f.isTexture)console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group.");else console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",f);return y}function A(f){let y=f.target;y.removeEventListener("dispose",A);let x=s.indexOf(y.__bindingPointIndex);s.splice(x,1),e.deleteBuffer(r[y.id]),delete r[y.id],delete i[y.id]}function g(){for(let f in r)e.deleteBuffer(r[f]);s=[],r={},i={}}return{bind:c,update:l,dispose:g}}class zM{constructor(e={}){let{canvas:t=eRo(),context:n=null,depth:o=!0,stencil:r=!1,alpha:i=!1,antialias:s=!1,premultipliedAlpha:a=!0,preserveDrawingBuffer:c=!1,powerPreference:l="default",failIfMajorPerformanceCaveat:h=!1}=e;this.isWebGLRenderer=!0;let d;if(n!==null){if(typeof WebGLRenderingContext<"u"&&n instanceof WebGLRenderingContext)throw Error("THREE.WebGLRenderer: WebGL 1 is not supported since r163.");d=n.getContextAttributes().alpha}else d=i;let u=new Uint32Array(4),_=new Int32Array(4),p=null,m=null,A=[],g=[];this.domElement=t,this.debug={checkShaderErrors:!0,onShaderError:null},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this._outputColorSpace="srgb",this.toneMapping=0,this.toneMappingExposure=1;let f=this,y=!1,x=0,C=0,b=null,I=-1,v=null,P=new Ah,M=new Ah,B=null,T=new Do(0),N=0,{width:D,height:L}=t,H=1,V=null,O=null,U=new Ah(0,0,D,L),j=new Ah(0,0,D,L),Y=!1,X=new Wye,K=!1,J=!1,ee=new Fi,se=new Dt,ne={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0},re=!1;function Z(){return b===null?H:1}let te=n;function ie(gt,Oe){return t.getContext(gt,Oe)}try{let gt={alpha:!0,depth:o,stencil:r,antialias:s,premultipliedAlpha:a,preserveDrawingBuffer:c,powerPreference:l,failIfMajorPerformanceCaveat:h};if("setAttribute"in t)t.setAttribute("data-engine","three.js r165");if(t.addEventListener("webglcontextlost",Ze,!1),t.addEventListener("webglcontextrestored",Fe,!1),t.addEventListener("webglcontextcreationerror",tt,!1),te===null){if(te=ie("webgl2",gt),te===null)if(ie("webgl2"))throw Error("Error creating WebGL context with your selected attributes.");else throw Error("Error creating WebGL context.")}}catch(gt){throw console.error("THREE.WebGLRenderer: "+gt.message),gt}let ce,ue,de,me,ge,xe,Ee,Re,Me,_e,ye,Se,Ne,Le,nt,dt,rt,pt,ct,Ct,kt,Lt,Bt,xt;function Yt(){ce=new hLo(te),ce.init(),Lt=new FHo(te,ce),ue=new rLo(te,ce,e,Lt),de=new LHo(te),me=new pLo(te),ge=new SHo,xe=new HHo(te,ce,de,ge,ue,Lt,me),Ee=new sLo(f),Re=new lLo(f),Me=new xRo(te),Bt=new nLo(te,Me),_e=new dLo(te,Me,me,Bt),ye=new _Lo(te,_e,Me,me),ct=new mLo(te,ue,xe),dt=new iLo(ge),Se=new vHo(f,Ee,Re,ce,ue,Bt,dt),Ne=new GHo(f,ge),Le=new EHo,nt=new NHo(ce),pt=new tLo(f,Ee,Re,de,ye,d,a),rt=new kHo(f,ye,ue),xt=new UHo(te,me,ue,de),Ct=new oLo(te,ce,me),kt=new uLo(te,ce,me),me.programs=Se.programs,f.capabilities=ue,f.extensions=ce,f.properties=ge,f.renderLists=Le,f.shadowMap=rt,f.state=de,f.info=me}Yt();let ut=new EEt(f,te);this.xr=ut,this.getContext=function(){return te},this.getContextAttributes=function(){return te.getContextAttributes()},this.forceContextLoss=function(){let gt=ce.get("WEBGL_lose_context");if(gt)gt.loseContext()},this.forceContextRestore=function(){let gt=ce.get("WEBGL_lose_context");if(gt)gt.restoreContext()},this.getPixelRatio=function(){return H},this.setPixelRatio=function(gt){if(gt===void 0)return;H=gt,this.setSize(D,L,!1)},this.getSize=function(gt){return gt.set(D,L)},this.setSize=function(gt,Oe,mt=!0){if(ut.isPresenting){console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting.");return}if(D=gt,L=Oe,t.width=Math.floor(gt*H),t.height=Math.floor(Oe*H),mt===!0)t.style.width=gt+"px",t.style.height=Oe+"px";this.setViewport(0,0,gt,Oe)},this.getDrawingBufferSize=function(gt){return gt.set(D*H,L*H).floor()},this.setDrawingBufferSize=function(gt,Oe,mt){D=gt,L=Oe,H=mt,t.width=Math.floor(gt*mt),t.height=Math.floor(Oe*mt),this.setViewport(0,0,gt,Oe)},this.getCurrentViewport=function(gt){return gt.copy(P)},this.getViewport=function(gt){return gt.copy(U)},this.setViewport=function(gt,Oe,mt,It){if(gt.isVector4)U.set(gt.x,gt.y,gt.z,gt.w);else U.set(gt,Oe,mt,It);de.viewport(P.copy(U).multiplyScalar(H).round())},this.getScissor=function(gt){return gt.copy(j)},this.setScissor=function(gt,Oe,mt,It){if(gt.isVector4)j.set(gt.x,gt.y,gt.z,gt.w);else j.set(gt,Oe,mt,It);de.scissor(M.copy(j).multiplyScalar(H).round())},this.getScissorTest=function(){return Y},this.setScissorTest=function(gt){de.setScissorTest(Y=gt)},this.setOpaqueSort=function(gt){V=gt},this.setTransparentSort=function(gt){O=gt},this.getClearColor=function(gt){return gt.copy(pt.getClearColor())},this.setClearColor=function(){pt.setClearColor.apply(pt,arguments)},this.getClearAlpha=function(){return pt.getClearAlpha()},this.setClearAlpha=function(){pt.setClearAlpha.apply(pt,arguments)},this.clear=function(gt=!0,Oe=!0,mt=!0){let It=0;if(gt){let bt=!1;if(b!==null){let cn=b.texture.format;bt=cn===1033||cn===1031||cn===1029}if(bt){let cn=b.texture.type,dn=cn===1009||cn===1014||cn===1012||cn===1020||cn===1017||cn===1018,wn=pt.getClearColor(),eo=pt.getClearAlpha(),{r:_o,g:$n,b:qn}=wn;if(dn)u[0]=_o,u[1]=$n,u[2]=qn,u[3]=eo,te.clearBufferuiv(te.COLOR,0,u);else _[0]=_o,_[1]=$n,_[2]=qn,_[3]=eo,te.clearBufferiv(te.COLOR,0,_)}else It|=te.COLOR_BUFFER_BIT}if(Oe)It|=te.DEPTH_BUFFER_BIT;if(mt)It|=te.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295);te.clear(It)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.dispose=function(){t.removeEventListener("webglcontextlost",Ze,!1),t.removeEventListener("webglcontextrestored",Fe,!1),t.removeEventListener("webglcontextcreationerror",tt,!1),Le.dispose(),nt.dispose(),ge.dispose(),Ee.dispose(),Re.dispose(),ye.dispose(),Bt.dispose(),xt.dispose(),Se.dispose(),ut.dispose(),ut.removeEventListener("sessionstart",st),ut.removeEventListener("sessionend",St),Nt.stop()};function Ze(gt){gt.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),y=!0}function Fe(){console.log("THREE.WebGLRenderer: Context Restored."),y=!1;let gt=me.autoReset,Oe=rt.enabled,mt=rt.autoUpdate,It=rt.needsUpdate,bt=rt.type;Yt(),me.autoReset=gt,rt.enabled=Oe,rt.autoUpdate=mt,rt.needsUpdate=It,rt.type=bt}function tt(gt){console.error("THREE.WebGLRenderer: A WebGL context could not be created. Reason: ",gt.statusMessage)}function Je(gt){let Oe=gt.target;Oe.removeEventListener("dispose",Je),$e(Oe)}function $e(gt){ft(gt),ge.remove(gt)}function ft(gt){let Oe=ge.get(gt).programs;if(Oe!==void 0){if(Oe.forEach(function(mt){Se.releaseProgram(mt)}),gt.isShaderMaterial)Se.releaseShaderCache(gt)}}this.renderBufferDirect=function(gt,Oe,mt,It,bt,cn){if(Oe===null)Oe=ne;let dn=bt.isMesh&&bt.matrixWorld.determinant()<0,wn=Zn(gt,Oe,mt,It,bt);de.setMaterial(It,dn);let eo=mt.index,_o=1;if(It.wireframe===!0){if(eo=_e.getWireframeAttribute(mt),eo===void 0)return;_o=2}let $n=mt.drawRange,qn=mt.attributes.position,Po=$n.start*_o,To=($n.start+$n.count)*_o;if(cn!==null)Po=Math.max(Po,cn.start*_o),To=Math.min(To,(cn.start+cn.count)*_o);if(eo!==null)Po=Math.max(Po,0),To=Math.min(To,eo.count);else if(qn!==void 0&&qn!==null)Po=Math.max(Po,0),To=Math.min(To,qn.count);let Tn=To-Po;if(Tn<0||Tn===1/0)return;Bt.setup(bt,It,wn,mt,eo);let lo,fo=Ct;if(eo!==null)lo=Me.get(eo),fo=kt,fo.setIndex(lo);if(bt.isMesh)if(It.wireframe===!0)de.setLineWidth(It.wireframeLinewidth*Z()),fo.setMode(te.LINES);else fo.setMode(te.TRIANGLES);else if(bt.isLine){let oo=It.linewidth;if(oo===void 0)oo=1;if(de.setLineWidth(oo*Z()),bt.isLineSegments)fo.setMode(te.LINES);else if(bt.isLineLoop)fo.setMode(te.LINE_LOOP);else fo.setMode(te.LINE_STRIP)}else if(bt.isPoints)fo.setMode(te.POINTS);else if(bt.isSprite)fo.setMode(te.TRIANGLES);if(bt.isBatchedMesh)if(bt._multiDrawInstances!==null)fo.renderMultiDrawInstances(bt._multiDrawStarts,bt._multiDrawCounts,bt._multiDrawCount,bt._multiDrawInstances);else fo.renderMultiDraw(bt._multiDrawStarts,bt._multiDrawCounts,bt._multiDrawCount);else if(bt.isInstancedMesh)fo.renderInstances(Po,Tn,bt.count);else if(mt.isInstancedBufferGeometry){let oo=mt._maxInstanceCount!==void 0?mt._maxInstanceCount:1/0,Ro=Math.min(mt.instanceCount,oo);fo.renderInstances(Po,Tn,Ro)}else fo.render(Po,Tn)};function vt(gt,Oe,mt){if(gt.transparent===!0&&gt.side===2&&gt.forceSinglePass===!1)gt.side=1,gt.needsUpdate=!0,Qn(gt,Oe,mt),gt.side=0,gt.needsUpdate=!0,Qn(gt,Oe,mt),gt.side=2;else Qn(gt,Oe,mt)}this.compile=function(gt,Oe,mt=null){if(mt===null)mt=gt;if(m=nt.get(mt),m.init(Oe),g.push(m),mt.traverseVisible(function(bt){if(bt.isLight&&bt.layers.test(Oe.layers)){if(m.pushLight(bt),bt.castShadow)m.pushShadow(bt)}}),gt!==mt)gt.traverseVisible(function(bt){if(bt.isLight&&bt.layers.test(Oe.layers)){if(m.pushLight(bt),bt.castShadow)m.pushShadow(bt)}});m.setupLights();let It=new Set;return gt.traverse(function(bt){let cn=bt.material;if(cn)if(Array.isArray(cn))for(let dn=0;dn<cn.length;dn++){let wn=cn[dn];vt(wn,mt,bt),It.add(wn)}else vt(cn,mt,bt),It.add(cn)}),g.pop(),m=null,It},this.compileAsync=function(gt,Oe,mt=null){let It=this.compile(gt,Oe,mt);return new Promise((bt)=>{function cn(){if(It.forEach(function(dn){if(ge.get(dn).currentProgram.isReady())It.delete(dn)}),It.size===0){bt(gt);return}setTimeout(cn,10)}if(ce.get("KHR_parallel_shader_compile")!==null)cn();else setTimeout(cn,10)})};let Ye=null;function je(gt){if(Ye)Ye(gt)}function st(){Nt.stop()}function St(){Nt.start()}let Nt=new mEt;if(Nt.setAnimationLoop(je),typeof self<"u")Nt.setContext(self);this.setAnimationLoop=function(gt){Ye=gt,ut.setAnimationLoop(gt),gt===null?Nt.stop():Nt.start()},ut.addEventListener("sessionstart",st),ut.addEventListener("sessionend",St),this.render=function(gt,Oe){if(Oe!==void 0&&Oe.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(y===!0)return;if(gt.matrixWorldAutoUpdate===!0)gt.updateMatrixWorld();if(Oe.parent===null&&Oe.matrixWorldAutoUpdate===!0)Oe.updateMatrixWorld();if(ut.enabled===!0&&ut.isPresenting===!0){if(ut.cameraAutoUpdate===!0)ut.updateCamera(Oe);Oe=ut.getCamera()}if(gt.isScene===!0)gt.onBeforeRender(f,gt,Oe,b);if(m=nt.get(gt,g.length),m.init(Oe),g.push(m),ee.multiplyMatrices(Oe.projectionMatrix,Oe.matrixWorldInverse),X.setFromProjectionMatrix(ee),J=this.localClippingEnabled,K=dt.init(this.clippingPlanes,J),p=Le.get(gt,A.length),p.init(),A.push(p),ut.enabled===!0&&ut.isPresenting===!0){let cn=f.xr.getDepthSensingMesh();if(cn!==null)Ot(cn,Oe,-1/0,f.sortObjects)}if(Ot(gt,Oe,0,f.sortObjects),p.finish(),f.sortObjects===!0)p.sort(V,O);if(re=ut.enabled===!1||ut.isPresenting===!1||ut.hasDepthSensing()===!1,re)pt.addToRenderList(p,gt);if(this.info.render.frame++,K===!0)dt.beginShadows();let mt=m.state.shadowsArray;if(rt.render(mt,gt,Oe),K===!0)dt.endShadows();if(this.info.autoReset===!0)this.info.reset();let It=p.opaque,bt=p.transmissive;if(m.setupLights(),Oe.isArrayCamera){let cn=Oe.cameras;if(bt.length>0)for(let dn=0,wn=cn.length;dn<wn;dn++){let eo=cn[dn];mn(It,bt,gt,eo)}if(re)pt.render(gt);for(let dn=0,wn=cn.length;dn<wn;dn++){let eo=cn[dn];Ut(p,gt,eo,eo.viewport)}}else{if(bt.length>0)mn(It,bt,gt,Oe);if(re)pt.render(gt);Ut(p,gt,Oe)}if(b!==null)xe.updateMultisampleRenderTarget(b),xe.updateRenderTargetMipmap(b);if(gt.isScene===!0)gt.onAfterRender(f,gt,Oe);if(Bt.resetDefaultState(),I=-1,v=null,g.pop(),g.length>0){if(m=g[g.length-1],K===!0)dt.setGlobalState(f.clippingPlanes,m.state.camera)}else m=null;if(A.pop(),A.length>0)p=A[A.length-1];else p=null};function Ot(gt,Oe,mt,It){if(gt.visible===!1)return;if(gt.layers.test(Oe.layers)){if(gt.isGroup)mt=gt.renderOrder;else if(gt.isLOD){if(gt.autoUpdate===!0)gt.update(Oe)}else if(gt.isLight){if(m.pushLight(gt),gt.castShadow)m.pushShadow(gt)}else if(gt.isSprite){if(!gt.frustumCulled||X.intersectsSprite(gt)){if(It)se.setFromMatrixPosition(gt.matrixWorld).applyMatrix4(ee);let dn=ye.update(gt),wn=gt.material;if(wn.visible)p.push(gt,dn,wn,mt,se.z,null)}}else if(gt.isMesh||gt.isLine||gt.isPoints){if(!gt.frustumCulled||X.intersectsObject(gt)){let dn=ye.update(gt),wn=gt.material;if(It){if(gt.boundingSphere!==void 0){if(gt.boundingSphere===null)gt.computeBoundingSphere();se.copy(gt.boundingSphere.center)}else{if(dn.boundingSphere===null)dn.computeBoundingSphere();se.copy(dn.boundingSphere.center)}se.applyMatrix4(gt.matrixWorld).applyMatrix4(ee)}if(Array.isArray(wn)){let eo=dn.groups;for(let _o=0,$n=eo.length;_o<$n;_o++){let qn=eo[_o],Po=wn[qn.materialIndex];if(Po&&Po.visible)p.push(gt,dn,Po,mt,se.z,qn)}}else if(wn.visible)p.push(gt,dn,wn,mt,se.z,null)}}}let cn=gt.children;for(let dn=0,wn=cn.length;dn<wn;dn++)Ot(cn[dn],Oe,mt,It)}function Ut(gt,Oe,mt,It){let{opaque:bt,transmissive:cn,transparent:dn}=gt;if(m.setupLightsView(mt),K===!0)dt.setGlobalState(f.clippingPlanes,mt);if(It)de.viewport(P.copy(It));if(bt.length>0)_n(bt,Oe,mt);if(cn.length>0)_n(cn,Oe,mt);if(dn.length>0)_n(dn,Oe,mt);de.buffers.depth.setTest(!0),de.buffers.depth.setMask(!0),de.buffers.color.setMask(!0),de.setPolygonOffset(!1)}function mn(gt,Oe,mt,It){if((mt.isScene===!0?mt.overrideMaterial:null)!==null)return;if(m.state.transmissionRenderTarget[It.id]===void 0)m.state.transmissionRenderTarget[It.id]=new JN(1,1,{generateMipmaps:!0,type:ce.has("EXT_color_buffer_half_float")||ce.has("EXT_color_buffer_float")?1016:1009,minFilter:1008,samples:4,stencilBuffer:r,resolveDepthBuffer:!1,resolveStencilBuffer:!1,colorSpace:Th.workingColorSpace});let cn=m.state.transmissionRenderTarget[It.id],dn=It.viewport||P;cn.setSize(dn.z,dn.w);let wn=f.getRenderTarget();if(f.setRenderTarget(cn),f.getClearColor(T),N=f.getClearAlpha(),N<1)f.setClearColor(16777215,0.5);if(re)pt.render(mt);else f.clear();let eo=f.toneMapping;f.toneMapping=0;let _o=It.viewport;if(It.viewport!==void 0)It.viewport=void 0;if(m.setupLightsView(It),K===!0)dt.setGlobalState(f.clippingPlanes,It);if(_n(gt,mt,It),xe.updateMultisampleRenderTarget(cn),xe.updateRenderTargetMipmap(cn),ce.has("WEBGL_multisampled_render_to_texture")===!1){let $n=!1;for(let qn=0,Po=Oe.length;qn<Po;qn++){let To=Oe[qn],{object:Tn,geometry:lo,material:fo,group:oo}=To;if(fo.side===2&&Tn.layers.test(It.layers)){let Ro=fo.side;fo.side=1,fo.needsUpdate=!0,En(Tn,mt,It,lo,fo,oo),fo.side=Ro,fo.needsUpdate=!0,$n=!0}}if($n===!0)xe.updateMultisampleRenderTarget(cn),xe.updateRenderTargetMipmap(cn)}if(f.setRenderTarget(wn),f.setClearColor(T,N),_o!==void 0)It.viewport=_o;f.toneMapping=eo}function _n(gt,Oe,mt){let It=Oe.isScene===!0?Oe.overrideMaterial:null;for(let bt=0,cn=gt.length;bt<cn;bt++){let dn=gt[bt],{object:wn,geometry:eo}=dn,_o=It===null?dn.material:It,$n=dn.group;if(wn.layers.test(mt.layers))En(wn,Oe,mt,eo,_o,$n)}}function En(gt,Oe,mt,It,bt,cn){if(gt.onBeforeRender(f,Oe,mt,It,bt,cn),gt.modelViewMatrix.multiplyMatrices(mt.matrixWorldInverse,gt.matrixWorld),gt.normalMatrix.getNormalMatrix(gt.modelViewMatrix),bt.onBeforeRender(f,Oe,mt,It,gt,cn),bt.transparent===!0&&bt.side===2&&bt.forceSinglePass===!1)bt.side=1,bt.needsUpdate=!0,f.renderBufferDirect(mt,Oe,It,bt,gt,cn),bt.side=0,bt.needsUpdate=!0,f.renderBufferDirect(mt,Oe,It,bt,gt,cn),bt.side=2;else f.renderBufferDirect(mt,Oe,It,bt,gt,cn);gt.onAfterRender(f,Oe,mt,It,bt,cn)}function Qn(gt,Oe,mt){if(Oe.isScene!==!0)Oe=ne;let It=ge.get(gt),bt=m.state.lights,cn=m.state.shadowsArray,dn=bt.state.version,wn=Se.getParameters(gt,bt.state,cn,Oe,mt),eo=Se.getProgramCacheKey(wn),_o=It.programs;if(It.environment=gt.isMeshStandardMaterial?Oe.environment:null,It.fog=Oe.fog,It.envMap=(gt.isMeshStandardMaterial?Re:Ee).get(gt.envMap||It.environment),It.envMapRotation=It.environment!==null&&gt.envMap===null?Oe.environmentRotation:gt.envMapRotation,_o===void 0)gt.addEventListener("dispose",Je),_o=new Map,It.programs=_o;let $n=_o.get(eo);if($n!==void 0){if(It.currentProgram===$n&&It.lightsStateVersion===dn)return hn(gt,wn),$n}else wn.uniforms=Se.getUniforms(gt),gt.onBuild(mt,wn,f),gt.onBeforeCompile(wn,f),$n=Se.acquireProgram(wn,eo),_o.set(eo,$n),It.uniforms=wn.uniforms;let qn=It.uniforms;if(!gt.isShaderMaterial&&!gt.isRawShaderMaterial||gt.clipping===!0)qn.clippingPlanes=dt.uniform;if(hn(gt,wn),It.needsLights=ir(gt),It.lightsStateVersion=dn,It.needsLights)qn.ambientLightColor.value=bt.state.ambient,qn.lightProbe.value=bt.state.probe,qn.directionalLights.value=bt.state.directional,qn.directionalLightShadows.value=bt.state.directionalShadow,qn.spotLights.value=bt.state.spot,qn.spotLightShadows.value=bt.state.spotShadow,qn.rectAreaLights.value=bt.state.rectArea,qn.ltc_1.value=bt.state.rectAreaLTC1,qn.ltc_2.value=bt.state.rectAreaLTC2,qn.pointLights.value=bt.state.point,qn.pointLightShadows.value=bt.state.pointShadow,qn.hemisphereLights.value=bt.state.hemi,qn.directionalShadowMap.value=bt.state.directionalShadowMap,qn.directionalShadowMatrix.value=bt.state.directionalShadowMatrix,qn.spotShadowMap.value=bt.state.spotShadowMap,qn.spotLightMatrix.value=bt.state.spotLightMatrix,qn.spotLightMap.value=bt.state.spotLightMap,qn.pointShadowMap.value=bt.state.pointShadowMap,qn.pointShadowMatrix.value=bt.state.pointShadowMatrix;return It.currentProgram=$n,It.uniformsList=null,$n}function ln(gt){if(gt.uniformsList===null){let Oe=gt.currentProgram.getUniforms();gt.uniformsList=Bie.seqWithValue(Oe.seq,gt.uniforms)}return gt.uniformsList}function hn(gt,Oe){let mt=ge.get(gt);mt.outputColorSpace=Oe.outputColorSpace,mt.batching=Oe.batching,mt.batchingColor=Oe.batchingColor,mt.instancing=Oe.instancing,mt.instancingColor=Oe.instancingColor,mt.instancingMorph=Oe.instancingMorph,mt.skinning=Oe.skinning,mt.morphTargets=Oe.morphTargets,mt.morphNormals=Oe.morphNormals,mt.morphColors=Oe.morphColors,mt.morphTargetsCount=Oe.morphTargetsCount,mt.numClippingPlanes=Oe.numClippingPlanes,mt.numIntersection=Oe.numClipIntersection,mt.vertexAlphas=Oe.vertexAlphas,mt.vertexTangents=Oe.vertexTangents,mt.toneMapping=Oe.toneMapping}function Zn(gt,Oe,mt,It,bt){if(Oe.isScene!==!0)Oe=ne;xe.resetTextureUnits();let cn=Oe.fog,dn=It.isMeshStandardMaterial?Oe.environment:null,wn=b===null?f.outputColorSpace:b.isXRRenderTarget===!0?b.texture.colorSpace:"srgb-linear",eo=(It.isMeshStandardMaterial?Re:Ee).get(It.envMap||dn),_o=It.vertexColors===!0&&!!mt.attributes.color&&mt.attributes.color.itemSize===4,$n=!!mt.attributes.tangent&&(!!It.normalMap||It.anisotropy>0),qn=!!mt.morphAttributes.position,Po=!!mt.morphAttributes.normal,To=!!mt.morphAttributes.color,Tn=0;if(It.toneMapped){if(b===null||b.isXRRenderTarget===!0)Tn=f.toneMapping}let lo=mt.morphAttributes.position||mt.morphAttributes.normal||mt.morphAttributes.color,fo=lo!==void 0?lo.length:0,oo=ge.get(It),Ro=m.state.lights;if(K===!0){if(J===!0||gt!==v){let os=gt===v&&It.id===I;dt.setState(It,gt,os)}}let or=!1;if(It.version===oo.__version){if(oo.needsLights&&oo.lightsStateVersion!==Ro.state.version)or=!0;else if(oo.outputColorSpace!==wn)or=!0;else if(bt.isBatchedMesh&&oo.batching===!1)or=!0;else if(!bt.isBatchedMesh&&oo.batching===!0)or=!0;else if(bt.isBatchedMesh&&oo.batchingColor===!0&&bt.colorTexture===null)or=!0;else if(bt.isBatchedMesh&&oo.batchingColor===!1&&bt.colorTexture!==null)or=!0;else if(bt.isInstancedMesh&&oo.instancing===!1)or=!0;else if(!bt.isInstancedMesh&&oo.instancing===!0)or=!0;else if(bt.isSkinnedMesh&&oo.skinning===!1)or=!0;else if(!bt.isSkinnedMesh&&oo.skinning===!0)or=!0;else if(bt.isInstancedMesh&&oo.instancingColor===!0&&bt.instanceColor===null)or=!0;else if(bt.isInstancedMesh&&oo.instancingColor===!1&&bt.instanceColor!==null)or=!0;else if(bt.isInstancedMesh&&oo.instancingMorph===!0&&bt.morphTexture===null)or=!0;else if(bt.isInstancedMesh&&oo.instancingMorph===!1&&bt.morphTexture!==null)or=!0;else if(oo.envMap!==eo)or=!0;else if(It.fog===!0&&oo.fog!==cn)or=!0;else if(oo.numClippingPlanes!==void 0&&(oo.numClippingPlanes!==dt.numPlanes||oo.numIntersection!==dt.numIntersection))or=!0;else if(oo.vertexAlphas!==_o)or=!0;else if(oo.vertexTangents!==$n)or=!0;else if(oo.morphTargets!==qn)or=!0;else if(oo.morphNormals!==Po)or=!0;else if(oo.morphColors!==To)or=!0;else if(oo.toneMapping!==Tn)or=!0;else if(oo.morphTargetsCount!==fo)or=!0}else or=!0,oo.__version=It.version;let Er=oo.currentProgram;if(or===!0)Er=Qn(It,Oe,bt);let Xi=!1,Ys=!1,aa=!1,Lo=Er.getUniforms(),Gi=oo.uniforms;if(de.useProgram(Er.program))Xi=!0,Ys=!0,aa=!0;if(It.id!==I)I=It.id,Ys=!0;if(Xi||v!==gt){Lo.setValue(te,"projectionMatrix",gt.projectionMatrix),Lo.setValue(te,"viewMatrix",gt.matrixWorldInverse);let os=Lo.map.cameraPosition;if(os!==void 0)os.setValue(te,se.setFromMatrixPosition(gt.matrixWorld));if(ue.logarithmicDepthBuffer)Lo.setValue(te,"logDepthBufFC",2/(Math.log(gt.far+1)/Math.LN2));if(It.isMeshPhongMaterial||It.isMeshToonMaterial||It.isMeshLambertMaterial||It.isMeshBasicMaterial||It.isMeshStandardMaterial||It.isShaderMaterial)Lo.setValue(te,"isOrthographic",gt.isOrthographicCamera===!0);if(v!==gt)v=gt,Ys=!0,aa=!0}if(bt.isSkinnedMesh){Lo.setOptional(te,bt,"bindMatrix"),Lo.setOptional(te,bt,"bindMatrixInverse");let os=bt.skeleton;if(os){if(os.boneTexture===null)os.computeBoneTexture();Lo.setValue(te,"boneTexture",os.boneTexture,xe)}}if(bt.isBatchedMesh){if(Lo.setOptional(te,bt,"batchingTexture"),Lo.setValue(te,"batchingTexture",bt._matricesTexture,xe),Lo.setOptional(te,bt,"batchingColorTexture"),bt._colorsTexture!==null)Lo.setValue(te,"batchingColorTexture",bt._colorsTexture,xe)}let bi=mt.morphAttributes;if(bi.position!==void 0||bi.normal!==void 0||bi.color!==void 0)ct.update(bt,mt,Er);if(Ys||oo.receiveShadow!==bt.receiveShadow)oo.receiveShadow=bt.receiveShadow,Lo.setValue(te,"receiveShadow",bt.receiveShadow);if(It.isMeshGouraudMaterial&&It.envMap!==null)Gi.envMap.value=eo,Gi.flipEnvMap.value=eo.isCubeTexture&&eo.isRenderTargetTexture===!1?-1:1;if(It.isMeshStandardMaterial&&It.envMap===null&&Oe.environment!==null)Gi.envMapIntensity.value=Oe.environmentIntensity;if(Ys){if(Lo.setValue(te,"toneMappingExposure",f.toneMappingExposure),oo.needsLights)bo(Gi,aa);if(cn&&It.fog===!0)Ne.refreshFogUniforms(Gi,cn);Ne.refreshMaterialUniforms(Gi,It,H,L,m.state.transmissionRenderTarget[gt.id]),Bie.upload(te,ln(oo),Gi,xe)}if(It.isShaderMaterial&&It.uniformsNeedUpdate===!0)Bie.upload(te,ln(oo),Gi,xe),It.uniformsNeedUpdate=!1;if(It.isSpriteMaterial)Lo.setValue(te,"center",bt.center);if(Lo.setValue(te,"modelViewMatrix",bt.modelViewMatrix),Lo.setValue(te,"normalMatrix",bt.normalMatrix),Lo.setValue(te,"modelMatrix",bt.matrixWorld),It.isShaderMaterial||It.isRawShaderMaterial){let os=It.uniformsGroups;for(let Lc=0,dl=os.length;Lc<dl;Lc++){let Ec=os[Lc];xt.update(Ec,Er),xt.bind(Ec,Er)}}return Er}function bo(gt,Oe){gt.ambientLightColor.needsUpdate=Oe,gt.lightProbe.needsUpdate=Oe,gt.directionalLights.needsUpdate=Oe,gt.directionalLightShadows.needsUpdate=Oe,gt.pointLights.needsUpdate=Oe,gt.pointLightShadows.needsUpdate=Oe,gt.spotLights.needsUpdate=Oe,gt.spotLightShadows.needsUpdate=Oe,gt.rectAreaLights.needsUpdate=Oe,gt.hemisphereLights.needsUpdate=Oe}function ir(gt){return gt.isMeshLambertMaterial||gt.isMeshToonMaterial||gt.isMeshPhongMaterial||gt.isMeshStandardMaterial||gt.isShadowMaterial||gt.isShaderMaterial&&gt.lights===!0}if(this.getActiveCubeFace=function(){return x},this.getActiveMipmapLevel=function(){return C},this.getRenderTarget=function(){return b},this.setRenderTargetTextures=function(gt,Oe,mt){ge.get(gt.texture).__webglTexture=Oe,ge.get(gt.depthTexture).__webglTexture=mt;let It=ge.get(gt);if(It.__hasExternalTextures=!0,It.__autoAllocateDepthBuffer=mt===void 0,!It.__autoAllocateDepthBuffer){if(ce.has("WEBGL_multisampled_render_to_texture")===!0)console.warn("THREE.WebGLRenderer: Render-to-texture extension was disabled because an external texture was provided"),It.__useRenderToTexture=!1}},this.setRenderTargetFramebuffer=function(gt,Oe){let mt=ge.get(gt);mt.__webglFramebuffer=Oe,mt.__useDefaultFramebuffer=Oe===void 0},this.setRenderTarget=function(gt,Oe=0,mt=0){b=gt,x=Oe,C=mt;let It=!0,bt=null,cn=!1,dn=!1;if(gt){let eo=ge.get(gt);if(eo.__useDefaultFramebuffer!==void 0)de.bindFramebuffer(te.FRAMEBUFFER,null),It=!1;else if(eo.__webglFramebuffer===void 0)xe.setupRenderTarget(gt);else if(eo.__hasExternalTextures)xe.rebindTextures(gt,ge.get(gt.texture).__webglTexture,ge.get(gt.depthTexture).__webglTexture);let _o=gt.texture;if(_o.isData3DTexture||_o.isDataArrayTexture||_o.isCompressedArrayTexture)dn=!0;let $n=ge.get(gt).__webglFramebuffer;if(gt.isWebGLCubeRenderTarget){if(Array.isArray($n[Oe]))bt=$n[Oe][mt];else bt=$n[Oe];cn=!0}else if(gt.samples>0&&xe.useMultisampledRTT(gt)===!1)bt=ge.get(gt).__webglMultisampledFramebuffer;else if(Array.isArray($n))bt=$n[mt];else bt=$n;P.copy(gt.viewport),M.copy(gt.scissor),B=gt.scissorTest}else P.copy(U).multiplyScalar(H).floor(),M.copy(j).multiplyScalar(H).floor(),B=Y;if(de.bindFramebuffer(te.FRAMEBUFFER,bt)&&It)de.drawBuffers(gt,bt);if(de.viewport(P),de.scissor(M),de.setScissorTest(B),cn){let eo=ge.get(gt.texture);te.framebufferTexture2D(te.FRAMEBUFFER,te.COLOR_ATTACHMENT0,te.TEXTURE_CUBE_MAP_POSITIVE_X+Oe,eo.__webglTexture,mt)}else if(dn){let eo=ge.get(gt.texture),_o=Oe||0;te.framebufferTextureLayer(te.FRAMEBUFFER,te.COLOR_ATTACHMENT0,eo.__webglTexture,mt||0,_o)}I=-1},this.readRenderTargetPixels=function(gt,Oe,mt,It,bt,cn,dn){if(!(gt&&gt.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let wn=ge.get(gt).__webglFramebuffer;if(gt.isWebGLCubeRenderTarget&&dn!==void 0)wn=wn[dn];if(wn){de.bindFramebuffer(te.FRAMEBUFFER,wn);try{let eo=gt.texture,{format:_o,type:$n}=eo;if(!ue.textureFormatReadable(_o)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}if(!ue.textureTypeReadable($n)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}if(Oe>=0&&Oe<=gt.width-It&&(mt>=0&&mt<=gt.height-bt))te.readPixels(Oe,mt,It,bt,Lt.convert(_o),Lt.convert($n),cn)}finally{let eo=b!==null?ge.get(b).__webglFramebuffer:null;de.bindFramebuffer(te.FRAMEBUFFER,eo)}}},this.readRenderTargetPixelsAsync=async function(gt,Oe,mt,It,bt,cn,dn){if(!(gt&&gt.isWebGLRenderTarget))throw Error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let wn=ge.get(gt).__webglFramebuffer;if(gt.isWebGLCubeRenderTarget&&dn!==void 0)wn=wn[dn];if(wn){de.bindFramebuffer(te.FRAMEBUFFER,wn);try{let eo=gt.texture,{format:_o,type:$n}=eo;if(!ue.textureFormatReadable(_o))throw Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in RGBA or implementation defined format.");if(!ue.textureTypeReadable($n))throw Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in UnsignedByteType or implementation defined type.");if(Oe>=0&&Oe<=gt.width-It&&(mt>=0&&mt<=gt.height-bt)){let qn=te.createBuffer();te.bindBuffer(te.PIXEL_PACK_BUFFER,qn),te.bufferData(te.PIXEL_PACK_BUFFER,cn.byteLength,te.STREAM_READ),te.readPixels(Oe,mt,It,bt,Lt.convert(_o),Lt.convert($n),0),te.flush();let Po=te.fenceSync(te.SYNC_GPU_COMMANDS_COMPLETE,0);await tRo(te,Po,4);try{te.bindBuffer(te.PIXEL_PACK_BUFFER,qn),te.getBufferSubData(te.PIXEL_PACK_BUFFER,0,cn)}finally{te.deleteBuffer(qn),te.deleteSync(Po)}return cn}}finally{let eo=b!==null?ge.get(b).__webglFramebuffer:null;de.bindFramebuffer(te.FRAMEBUFFER,eo)}}},this.copyFramebufferToTexture=function(gt,Oe=null,mt=0){if(gt.isTexture!==!0)console.warn("WebGLRenderer: copyFramebufferToTexture function signature has changed."),Oe=arguments[0]||null,gt=arguments[1];let It=Math.pow(2,-mt),bt=Math.floor(gt.image.width*It),cn=Math.floor(gt.image.height*It),dn=Oe!==null?Oe.x:0,wn=Oe!==null?Oe.y:0;xe.setTexture2D(gt,0),te.copyTexSubImage2D(te.TEXTURE_2D,mt,0,0,dn,wn,bt,cn),de.unbindTexture()},this.copyTextureToTexture=function(gt,Oe,mt=null,It=null,bt=0){if(gt.isTexture!==!0)console.warn("WebGLRenderer: copyTextureToTexture function signature has changed."),It=arguments[0]||null,gt=arguments[1],Oe=arguments[2],bt=arguments[3]||0,mt=null;let cn,dn,wn,eo,_o,$n;if(mt!==null)cn=mt.max.x-mt.min.x,dn=mt.max.y-mt.min.y,wn=mt.min.x,eo=mt.min.y;else cn=gt.image.width,dn=gt.image.height,wn=0,eo=0;if(It!==null)_o=It.x,$n=It.y;else _o=0,$n=0;let qn=Lt.convert(Oe.format),Po=Lt.convert(Oe.type);xe.setTexture2D(Oe,0),te.pixelStorei(te.UNPACK_FLIP_Y_WEBGL,Oe.flipY),te.pixelStorei(te.UNPACK_PREMULTIPLY_ALPHA_WEBGL,Oe.premultiplyAlpha),te.pixelStorei(te.UNPACK_ALIGNMENT,Oe.unpackAlignment);let To=te.getParameter(te.UNPACK_ROW_LENGTH),Tn=te.getParameter(te.UNPACK_IMAGE_HEIGHT),lo=te.getParameter(te.UNPACK_SKIP_PIXELS),fo=te.getParameter(te.UNPACK_SKIP_ROWS),oo=te.getParameter(te.UNPACK_SKIP_IMAGES),Ro=gt.isCompressedTexture?gt.mipmaps[bt]:gt.image;if(te.pixelStorei(te.UNPACK_ROW_LENGTH,Ro.width),te.pixelStorei(te.UNPACK_IMAGE_HEIGHT,Ro.height),te.pixelStorei(te.UNPACK_SKIP_PIXELS,wn),te.pixelStorei(te.UNPACK_SKIP_ROWS,eo),gt.isDataTexture)te.texSubImage2D(te.TEXTURE_2D,bt,_o,$n,cn,dn,qn,Po,Ro.data);else if(gt.isCompressedTexture)te.compressedTexSubImage2D(te.TEXTURE_2D,bt,_o,$n,Ro.width,Ro.height,qn,Ro.data);else te.texSubImage2D(te.TEXTURE_2D,bt,_o,$n,qn,Po,Ro);if(te.pixelStorei(te.UNPACK_ROW_LENGTH,To),te.pixelStorei(te.UNPACK_IMAGE_HEIGHT,Tn),te.pixelStorei(te.UNPACK_SKIP_PIXELS,lo),te.pixelStorei(te.UNPACK_SKIP_ROWS,fo),te.pixelStorei(te.UNPACK_SKIP_IMAGES,oo),bt===0&&Oe.generateMipmaps)te.generateMipmap(te.TEXTURE_2D);de.unbindTexture()},this.copyTextureToTexture3D=function(gt,Oe,mt=null,It=null,bt=0){if(gt.isTexture!==!0)console.warn("WebGLRenderer: copyTextureToTexture3D function signature has changed."),mt=arguments[0]||null,It=arguments[1]||null,gt=arguments[2],Oe=arguments[3],bt=arguments[4]||0;let cn,dn,wn,eo,_o,$n,qn,Po,To,Tn=gt.isCompressedTexture?gt.mipmaps[bt]:gt.image;if(mt!==null)cn=mt.max.x-mt.min.x,dn=mt.max.y-mt.min.y,wn=mt.max.z-mt.min.z,eo=mt.min.x,_o=mt.min.y,$n=mt.min.z;else cn=Tn.width,dn=Tn.height,wn=Tn.depth,eo=0,_o=0,$n=0;if(It!==null)qn=It.x,Po=It.y,To=It.z;else qn=0,Po=0,To=0;let lo=Lt.convert(Oe.format),fo=Lt.convert(Oe.type),oo;if(Oe.isData3DTexture)xe.setTexture3D(Oe,0),oo=te.TEXTURE_3D;else if(Oe.isDataArrayTexture||Oe.isCompressedArrayTexture)xe.setTexture2DArray(Oe,0),oo=te.TEXTURE_2D_ARRAY;else{console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");return}te.pixelStorei(te.UNPACK_FLIP_Y_WEBGL,Oe.flipY),te.pixelStorei(te.UNPACK_PREMULTIPLY_ALPHA_WEBGL,Oe.premultiplyAlpha),te.pixelStorei(te.UNPACK_ALIGNMENT,Oe.unpackAlignment);let Ro=te.getParameter(te.UNPACK_ROW_LENGTH),or=te.getParameter(te.UNPACK_IMAGE_HEIGHT),Er=te.getParameter(te.UNPACK_SKIP_PIXELS),Xi=te.getParameter(te.UNPACK_SKIP_ROWS),Ys=te.getParameter(te.UNPACK_SKIP_IMAGES);if(te.pixelStorei(te.UNPACK_ROW_LENGTH,Tn.width),te.pixelStorei(te.UNPACK_IMAGE_HEIGHT,Tn.height),te.pixelStorei(te.UNPACK_SKIP_PIXELS,eo),te.pixelStorei(te.UNPACK_SKIP_ROWS,_o),te.pixelStorei(te.UNPACK_SKIP_IMAGES,$n),gt.isDataTexture||gt.isData3DTexture)te.texSubImage3D(oo,bt,qn,Po,To,cn,dn,wn,lo,fo,Tn.data);else if(Oe.isCompressedArrayTexture)te.compressedTexSubImage3D(oo,bt,qn,Po,To,cn,dn,wn,lo,Tn.data);else te.texSubImage3D(oo,bt,qn,Po,To,cn,dn,wn,lo,fo,Tn);if(te.pixelStorei(te.UNPACK_ROW_LENGTH,Ro),te.pixelStorei(te.UNPACK_IMAGE_HEIGHT,or),te.pixelStorei(te.UNPACK_SKIP_PIXELS,Er),te.pixelStorei(te.UNPACK_SKIP_ROWS,Xi),te.pixelStorei(te.UNPACK_SKIP_IMAGES,Ys),bt===0&&Oe.generateMipmaps)te.generateMipmap(oo);de.unbindTexture()},this.initRenderTarget=function(gt){if(ge.get(gt).__webglFramebuffer===void 0)xe.setupRenderTarget(gt)},this.initTexture=function(gt){if(gt.isCubeTexture)xe.setTextureCube(gt,0);else if(gt.isData3DTexture)xe.setTexture3D(gt,0);else if(gt.isDataArrayTexture||gt.isCompressedArrayTexture)xe.setTexture2DArray(gt,0);else xe.setTexture2D(gt,0);de.unbindTexture()},this.resetState=function(){x=0,C=0,b=null,de.reset(),Bt.reset()},typeof __THREE_DEVTOOLS__<"u")__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return 2000}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(e){this._outputColorSpace=e;let t=this.getContext();t.drawingBufferColorSpace=e==="display-p3"?"display-p3":"srgb",t.unpackColorSpace=Th.workingColorSpace==="display-p3-linear"?"display-p3":"srgb"}}class C4 extends nl{constructor(){super();if(this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.backgroundBlurriness=0,this.backgroundIntensity=1,this.backgroundRotation=new aA,this.environmentIntensity=1,this.environmentRotation=new aA,this.overrideMaterial=null,typeof __THREE_DEVTOOLS__<"u")__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,t){if(super.copy(e,t),e.background!==null)this.background=e.background.clone();if(e.environment!==null)this.environment=e.environment.clone();if(e.fog!==null)this.fog=e.fog.clone();if(this.backgroundBlurriness=e.backgroundBlurriness,this.backgroundIntensity=e.backgroundIntensity,this.backgroundRotation.copy(e.backgroundRotation),this.environmentIntensity=e.environmentIntensity,this.environmentRotation.copy(e.environmentRotation),e.overrideMaterial!==null)this.overrideMaterial=e.overrideMaterial.clone();return this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){let t=super.toJSON(e);if(this.fog!==null)t.object.fog=this.fog.toJSON();if(this.backgroundBlurriness>0)t.object.backgroundBlurriness=this.backgroundBlurriness;if(this.backgroundIntensity!==1)t.object.backgroundIntensity=this.backgroundIntensity;if(t.object.backgroundRotation=this.backgroundRotation.toArray(),this.environmentIntensity!==1)t.object.environmentIntensity=this.environmentIntensity;return t.object.environmentRotation=this.environmentRotation.toArray(),t}}class $ye{constructor(e,t){this.isInterleavedBuffer=!0,this.array=e,this.stride=t,this.count=e!==void 0?e.length/t:0,this.usage=35044,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.version=0,this.uuid=OC()}onUploadCallback(){}set needsUpdate(e){if(e===!0)this.version++}get updateRange(){return hOe("THREE.InterleavedBuffer: updateRange() is deprecated and will be removed in r169. Use addUpdateRange() instead."),this._updateRange}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this}copyAt(e,t,n){e*=this.stride,n*=t.stride;for(let o=0,r=this.stride;o<r;o++)this.array[e+o]=t.array[n+o];return this}set(e,t=0){return this.array.set(e,t),this}clone(e){if(e.arrayBuffers===void 0)e.arrayBuffers={};if(this.array.buffer._uuid===void 0)this.array.buffer._uuid=OC();if(e.arrayBuffers[this.array.buffer._uuid]===void 0)e.arrayBuffers[this.array.buffer._uuid]=this.array.slice(0).buffer;let t=new this.array.constructor(e.arrayBuffers[this.array.buffer._uuid]),n=new this.constructor(t,this.stride);return n.setUsage(this.usage),n}onUpload(e){return this.onUploadCallback=e,this}toJSON(e){if(e.arrayBuffers===void 0)e.arrayBuffers={};if(this.array.buffer._uuid===void 0)this.array.buffer._uuid=OC();if(e.arrayBuffers[this.array.buffer._uuid]===void 0)e.arrayBuffers[this.array.buffer._uuid]=Array.from(new Uint32Array(this.array.buffer));return{uuid:this.uuid,buffer:this.array.buffer._uuid,type:this.array.constructor.name,stride:this.stride}}}var G1=new Dt;class Yie{constructor(e,t,n,o=!1){this.isInterleavedBufferAttribute=!0,this.name="",this.data=e,this.itemSize=t,this.offset=n,this.normalized=o}get count(){return this.data.count}get array(){return this.data.array}set needsUpdate(e){this.data.needsUpdate=e}applyMatrix4(e){for(let t=0,n=this.data.count;t<n;t++)G1.fromBufferAttribute(this,t),G1.applyMatrix4(e),this.setXYZ(t,G1.x,G1.y,G1.z);return this}applyNormalMatrix(e){for(let t=0,n=this.count;t<n;t++)G1.fromBufferAttribute(this,t),G1.applyNormalMatrix(e),this.setXYZ(t,G1.x,G1.y,G1.z);return this}transformDirection(e){for(let t=0,n=this.count;t<n;t++)G1.fromBufferAttribute(this,t),G1.transformDirection(e),this.setXYZ(t,G1.x,G1.y,G1.z);return this}getComponent(e,t){let n=this.array[e*this.data.stride+this.offset+t];if(this.normalized)n=HI(n,this.array);return n}setComponent(e,t,n){if(this.normalized)n=Bh(n,this.array);return this.data.array[e*this.data.stride+this.offset+t]=n,this}setX(e,t){if(this.normalized)t=Bh(t,this.array);return this.data.array[e*this.data.stride+this.offset]=t,this}setY(e,t){if(this.normalized)t=Bh(t,this.array);return this.data.array[e*this.data.stride+this.offset+1]=t,this}setZ(e,t){if(this.normalized)t=Bh(t,this.array);return this.data.array[e*this.data.stride+this.offset+2]=t,this}setW(e,t){if(this.normalized)t=Bh(t,this.array);return this.data.array[e*this.data.stride+this.offset+3]=t,this}getX(e){let t=this.data.array[e*this.data.stride+this.offset];if(this.normalized)t=HI(t,this.array);return t}getY(e){let t=this.data.array[e*this.data.stride+this.offset+1];if(this.normalized)t=HI(t,this.array);return t}getZ(e){let t=this.data.array[e*this.data.stride+this.offset+2];if(this.normalized)t=HI(t,this.array);return t}getW(e){let t=this.data.array[e*this.data.stride+this.offset+3];if(this.normalized)t=HI(t,this.array);return t}setXY(e,t,n){if(e=e*this.data.stride+this.offset,this.normalized)t=Bh(t,this.array),n=Bh(n,this.array);return this.data.array[e+0]=t,this.data.array[e+1]=n,this}setXYZ(e,t,n,o){if(e=e*this.data.stride+this.offset,this.normalized)t=Bh(t,this.array),n=Bh(n,this.array),o=Bh(o,this.array);return this.data.array[e+0]=t,this.data.array[e+1]=n,this.data.array[e+2]=o,this}setXYZW(e,t,n,o,r){if(e=e*this.data.stride+this.offset,this.normalized)t=Bh(t,this.array),n=Bh(n,this.array),o=Bh(o,this.array),r=Bh(r,this.array);return this.data.array[e+0]=t,this.data.array[e+1]=n,this.data.array[e+2]=o,this.data.array[e+3]=r,this}clone(e){if(e===void 0){console.log("THREE.InterleavedBufferAttribute.clone(): Cloning an interleaved buffer attribute will de-interleave buffer data.");let t=[];for(let n=0;n<this.count;n++){let o=n*this.data.stride+this.offset;for(let r=0;r<this.itemSize;r++)t.push(this.data.array[o+r])}return new ol(new this.array.constructor(t),this.itemSize,this.normalized)}else{if(e.interleavedBuffers===void 0)e.interleavedBuffers={};if(e.interleavedBuffers[this.data.uuid]===void 0)e.interleavedBuffers[this.data.uuid]=this.data.clone(e);return new Yie(e.interleavedBuffers[this.data.uuid],this.itemSize,this.offset,this.normalized)}}toJSON(e){if(e===void 0){console.log("THREE.InterleavedBufferAttribute.toJSON(): Serializing an interleaved buffer attribute will de-interleave buffer data.");let t=[];for(let n=0;n<this.count;n++){let o=n*this.data.stride+this.offset;for(let r=0;r<this.itemSize;r++)t.push(this.data.array[o+r])}return{itemSize:this.itemSize,type:this.array.constructor.name,array:t,normalized:this.normalized}}else{if(e.interleavedBuffers===void 0)e.interleavedBuffers={};if(e.interleavedBuffers[this.data.uuid]===void 0)e.interleavedBuffers[this.data.uuid]=this.data.toJSON(e);return{isInterleavedBufferAttribute:!0,itemSize:this.itemSize,data:this.data.uuid,offset:this.offset,normalized:this.normalized}}}}var wPt=new Dt,BPt=new Ah,TPt=new Ah,WHo=new Dt,DPt=new Fi,Cye=new Dt,Xze=new bx,NPt=new Fi,jze=new nR;class yOe extends Qo{constructor(e,t){super(e,t);this.isSkinnedMesh=!0,this.type="SkinnedMesh",this.bindMode="attached",this.bindMatrix=new Fi,this.bindMatrixInverse=new Fi,this.boundingBox=null,this.boundingSphere=null}computeBoundingBox(){let e=this.geometry;if(this.boundingBox===null)this.boundingBox=new dm;this.boundingBox.makeEmpty();let t=e.getAttribute("position");for(let n=0;n<t.count;n++)this.getVertexPosition(n,Cye),this.boundingBox.expandByPoint(Cye)}computeBoundingSphere(){let e=this.geometry;if(this.boundingSphere===null)this.boundingSphere=new bx;this.boundingSphere.makeEmpty();let t=e.getAttribute("position");for(let n=0;n<t.count;n++)this.getVertexPosition(n,Cye),this.boundingSphere.expandByPoint(Cye)}copy(e,t){if(super.copy(e,t),this.bindMode=e.bindMode,this.bindMatrix.copy(e.bindMatrix),this.bindMatrixInverse.copy(e.bindMatrixInverse),this.skeleton=e.skeleton,e.boundingBox!==null)this.boundingBox=e.boundingBox.clone();if(e.boundingSphere!==null)this.boundingSphere=e.boundingSphere.clone();return this}raycast(e,t){let n=this.material,o=this.matrixWorld;if(n===void 0)return;if(this.boundingSphere===null)this.computeBoundingSphere();if(Xze.copy(this.boundingSphere),Xze.applyMatrix4(o),e.ray.intersectsSphere(Xze)===!1)return;if(NPt.copy(o).invert(),jze.copy(e.ray).applyMatrix4(NPt),this.boundingBox!==null){if(jze.intersectsBox(this.boundingBox)===!1)return}this._computeIntersections(e,t,jze)}getVertexPosition(e,t){return super.getVertexPosition(e,t),this.applyBoneTransform(e,t),t}bind(e,t){if(this.skeleton=e,t===void 0)this.updateMatrixWorld(!0),this.skeleton.calculateInverses(),t=this.matrixWorld;this.bindMatrix.copy(t),this.bindMatrixInverse.copy(t).invert()}pose(){this.skeleton.pose()}normalizeSkinWeights(){let e=new Ah,t=this.geometry.attributes.skinWeight;for(let n=0,o=t.count;n<o;n++){e.fromBufferAttribute(t,n);let r=1/e.manhattanLength();if(r!==1/0)e.multiplyScalar(r);else e.set(1,0,0,0);t.setXYZW(n,e.x,e.y,e.z,e.w)}}updateMatrixWorld(e){if(super.updateMatrixWorld(e),this.bindMode==="attached")this.bindMatrixInverse.copy(this.matrixWorld).invert();else if(this.bindMode==="detached")this.bindMatrixInverse.copy(this.bindMatrix).invert();else console.warn("THREE.SkinnedMesh: Unrecognized bindMode: "+this.bindMode)}applyBoneTransform(e,t){let n=this.skeleton,o=this.geometry;BPt.fromBufferAttribute(o.attributes.skinIndex,e),TPt.fromBufferAttribute(o.attributes.skinWeight,e),wPt.copy(t).applyMatrix4(this.bindMatrix),t.set(0,0,0);for(let r=0;r<4;r++){let i=TPt.getComponent(r);if(i!==0){let s=BPt.getComponent(r);DPt.multiplyMatrices(n.bones[s].matrixWorld,n.boneInverses[s]),t.addScaledVector(WHo.copy(wPt).applyMatrix4(DPt),i)}}return t.applyMatrix4(this.bindMatrixInverse)}}class qye extends nl{constructor(){super();this.isBone=!0,this.type="Bone"}}class Xj extends Bl{constructor(e=null,t=1,n=1,o,r,i,s,a,c=1003,l=1003,h,d){super(null,i,s,a,c,l,o,r,h,d);this.isDataTexture=!0,this.image={data:e,width:t,height:n},this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}var RPt=new Fi,XHo=new Fi;class Jye{constructor(e=[],t=[]){this.uuid=OC(),this.bones=e.slice(0),this.boneInverses=t,this.boneMatrices=null,this.boneTexture=null,this.init()}init(){let e=this.bones,t=this.boneInverses;if(this.boneMatrices=new Float32Array(e.length*16),t.length===0)this.calculateInverses();else if(e.length!==t.length){console.warn("THREE.Skeleton: Number of inverse bone matrices does not match amount of bones."),this.boneInverses=[];for(let n=0,o=this.bones.length;n<o;n++)this.boneInverses.push(new Fi)}}calculateInverses(){this.boneInverses.length=0;for(let e=0,t=this.bones.length;e<t;e++){let n=new Fi;if(this.bones[e])n.copy(this.bones[e].matrixWorld).invert();this.boneInverses.push(n)}}pose(){for(let e=0,t=this.bones.length;e<t;e++){let n=this.bones[e];if(n)n.matrixWorld.copy(this.boneInverses[e]).invert()}for(let e=0,t=this.bones.length;e<t;e++){let n=this.bones[e];if(n){if(n.parent&&n.parent.isBone)n.matrix.copy(n.parent.matrixWorld).invert(),n.matrix.multiply(n.matrixWorld);else n.matrix.copy(n.matrixWorld);n.matrix.decompose(n.position,n.quaternion,n.scale)}}}update(){let e=this.bones,t=this.boneInverses,n=this.boneMatrices,o=this.boneTexture;for(let r=0,i=e.length;r<i;r++){let s=e[r]?e[r].matrixWorld:XHo;RPt.multiplyMatrices(s,t[r]),RPt.toArray(n,r*16)}if(o!==null)o.needsUpdate=!0}clone(){return new Jye(this.bones,this.boneInverses)}computeBoneTexture(){let e=Math.sqrt(this.bones.length*4);e=Math.ceil(e/4)*4,e=Math.max(e,4);let t=new Float32Array(e*e*4);t.set(this.boneMatrices);let n=new Xj(t,e,e,1023,1015);return n.needsUpdate=!0,this.boneMatrices=t,this.boneTexture=n,this}getBoneByName(e){for(let t=0,n=this.bones.length;t<n;t++){let o=this.bones[t];if(o.name===e)return o}return}dispose(){if(this.boneTexture!==null)this.boneTexture.dispose(),this.boneTexture=null}fromJSON(e,t){this.uuid=e.uuid;for(let n=0,o=e.bones.length;n<o;n++){let r=e.bones[n],i=t[r];if(i===void 0)console.warn("THREE.Skeleton: No bone found with UUID:",r),i=new qye;this.bones.push(i),this.boneInverses.push(new Fi().fromArray(e.boneInverses[n]))}return this.init(),this}toJSON(){let e={metadata:{version:4.6,type:"Skeleton",generator:"Skeleton.toJSON"},bones:[],boneInverses:[]};e.uuid=this.uuid;let t=this.bones,n=this.boneInverses;for(let o=0,r=t.length;o<r;o++){let i=t[o];e.bones.push(i.uuid);let s=n[o];e.boneInverses.push(s.toArray())}return e}}class Iz extends ol{constructor(e,t,n,o=1){super(e,t,n);this.isInstancedBufferAttribute=!0,this.meshPerAttribute=o}copy(e){return super.copy(e),this.meshPerAttribute=e.meshPerAttribute,this}toJSON(){let e=super.toJSON();return e.meshPerAttribute=this.meshPerAttribute,e.isInstancedBufferAttribute=!0,e}}var Fj=new Fi,QPt=new Fi,bye=[],kPt=new dm,jHo=new Fi,vie=new Qo,Sie=new bx;class xOe extends Qo{constructor(e,t,n){super(e,t);this.isInstancedMesh=!0,this.instanceMatrix=new Iz(new Float32Array(n*16),16),this.instanceColor=null,this.morphTexture=null,this.count=n,this.boundingBox=null,this.boundingSphere=null;for(let o=0;o<n;o++)this.setMatrixAt(o,jHo)}computeBoundingBox(){let e=this.geometry,t=this.count;if(this.boundingBox===null)this.boundingBox=new dm;if(e.boundingBox===null)e.computeBoundingBox();this.boundingBox.makeEmpty();for(let n=0;n<t;n++)this.getMatrixAt(n,Fj),kPt.copy(e.boundingBox).applyMatrix4(Fj),this.boundingBox.union(kPt)}computeBoundingSphere(){let e=this.geometry,t=this.count;if(this.boundingSphere===null)this.boundingSphere=new bx;if(e.boundingSphere===null)e.computeBoundingSphere();this.boundingSphere.makeEmpty();for(let n=0;n<t;n++)this.getMatrixAt(n,Fj),Sie.copy(e.boundingSphere).applyMatrix4(Fj),this.boundingSphere.union(Sie)}copy(e,t){if(super.copy(e,t),this.instanceMatrix.copy(e.instanceMatrix),e.morphTexture!==null)this.morphTexture=e.morphTexture.clone();if(e.instanceColor!==null)this.instanceColor=e.instanceColor.clone();if(this.count=e.count,e.boundingBox!==null)this.boundingBox=e.boundingBox.clone();if(e.boundingSphere!==null)this.boundingSphere=e.boundingSphere.clone();return this}getColorAt(e,t){t.fromArray(this.instanceColor.array,e*3)}getMatrixAt(e,t){t.fromArray(this.instanceMatrix.array,e*16)}getMorphAt(e,t){let n=t.morphTargetInfluences,o=this.morphTexture.source.data.data,r=n.length+1,i=e*r+1;for(let s=0;s<n.length;s++)n[s]=o[i+s]}raycast(e,t){let n=this.matrixWorld,o=this.count;if(vie.geometry=this.geometry,vie.material=this.material,vie.material===void 0)return;if(this.boundingSphere===null)this.computeBoundingSphere();if(Sie.copy(this.boundingSphere),Sie.applyMatrix4(n),e.ray.intersectsSphere(Sie)===!1)return;for(let r=0;r<o;r++){this.getMatrixAt(r,Fj),QPt.multiplyMatrices(n,Fj),vie.matrixWorld=QPt,vie.raycast(e,bye);for(let i=0,s=bye.length;i<s;i++){let a=bye[i];a.instanceId=r,a.object=this,t.push(a)}bye.length=0}}setColorAt(e,t){if(this.instanceColor===null)this.instanceColor=new Iz(new Float32Array(this.instanceMatrix.count*3),3);t.toArray(this.instanceColor.array,e*3)}setMatrixAt(e,t){t.toArray(this.instanceMatrix.array,e*16)}setMorphAt(e,t){let n=t.morphTargetInfluences,o=n.length+1;if(this.morphTexture===null)this.morphTexture=new Xj(new Float32Array(o*this.count),o,this.count,1028,1015);let r=this.morphTexture.source.data.data,i=0;for(let c=0;c<n.length;c++)i+=n[c];let s=this.geometry.morphTargetsRelative?1:1-i,a=o*e;r[a]=s,r.set(n,a+1)}updateMorphTargets(){}dispose(){if(this.dispatchEvent({type:"dispose"}),this.morphTexture!==null)this.morphTexture.dispose(),this.morphTexture=null;return this}}class YC extends cA{constructor(e){super();this.isLineBasicMaterial=!0,this.type="LineBasicMaterial",this.color=new Do(16777215),this.map=null,this.linewidth=1,this.linecap="round",this.linejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.linewidth=e.linewidth,this.linecap=e.linecap,this.linejoin=e.linejoin,this.fog=e.fog,this}}var Qye=new Dt,kye=new Dt,LPt=new Fi,Pie=new nR,Iye=new bx,Kze=new Dt,HPt=new Dt;class Gie extends nl{constructor(e=new ha,t=new YC){super();this.isLine=!0,this.type="Line",this.geometry=e,this.material=t,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}computeLineDistances(){let e=this.geometry;if(e.index===null){let t=e.attributes.position,n=[0];for(let o=1,r=t.count;o<r;o++)Qye.fromBufferAttribute(t,o-1),kye.fromBufferAttribute(t,o),n[o]=n[o-1],n[o]+=Qye.distanceTo(kye);e.setAttribute("lineDistance",new jr(n,1))}else console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}raycast(e,t){let n=this.geometry,o=this.matrixWorld,r=e.params.Line.threshold,i=n.drawRange;if(n.boundingSphere===null)n.computeBoundingSphere();if(Iye.copy(n.boundingSphere),Iye.applyMatrix4(o),Iye.radius+=r,e.ray.intersectsSphere(Iye)===!1)return;LPt.copy(o).invert(),Pie.copy(e.ray).applyMatrix4(LPt);let s=r/((this.scale.x+this.scale.y+this.scale.z)/3),a=s*s,c=this.isLineSegments?2:1,l=n.index,d=n.attributes.position;if(l!==null){let u=Math.max(0,i.start),_=Math.min(l.count,i.start+i.count);for(let p=u,m=_-1;p<m;p+=c){let A=l.getX(p),g=l.getX(p+1),f=vye(this,e,Pie,a,A,g);if(f)t.push(f)}if(this.isLineLoop){let p=l.getX(_-1),m=l.getX(u),A=vye(this,e,Pie,a,p,m);if(A)t.push(A)}}else{let u=Math.max(0,i.start),_=Math.min(d.count,i.start+i.count);for(let p=u,m=_-1;p<m;p+=c){let A=vye(this,e,Pie,a,p,p+1);if(A)t.push(A)}if(this.isLineLoop){let p=vye(this,e,Pie,a,_-1,u);if(p)t.push(p)}}}updateMorphTargets(){let t=this.geometry.morphAttributes,n=Object.keys(t);if(n.length>0){let o=t[n[0]];if(o!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let r=0,i=o.length;r<i;r++){let s=o[r].name||String(r);this.morphTargetInfluences.push(0),this.morphTargetDictionary[s]=r}}}}}function vye(e,t,n,o,r,i){let s=e.geometry.attributes.position;if(Qye.fromBufferAttribute(s,r),kye.fromBufferAttribute(s,i),n.distanceSqToSegment(Qye,kye,Kze,HPt)>o)return;Kze.applyMatrix4(e.matrixWorld);let c=t.ray.origin.distanceTo(Kze);if(c<t.near||c>t.far)return;return{distance:c,point:HPt.clone().applyMatrix4(e.matrixWorld),index:r,face:null,faceIndex:null,object:e}}var FPt=new Dt,zPt=new Dt;class p7 extends Gie{constructor(e,t){super(e,t);this.isLineSegments=!0,this.type="LineSegments"}computeLineDistances(){let e=this.geometry;if(e.index===null){let t=e.attributes.position,n=[];for(let o=0,r=t.count;o<r;o+=2)FPt.fromBufferAttribute(t,o),zPt.fromBufferAttribute(t,o+1),n[o]=o===0?0:n[o-1],n[o+1]=n[o]+FPt.distanceTo(zPt);e.setAttribute("lineDistance",new jr(n,1))}else console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}}class COe extends Gie{constructor(e,t){super(e,t);this.isLineLoop=!0,this.type="LineLoop"}}class zI extends cA{constructor(e){super();this.isPointsMaterial=!0,this.type="PointsMaterial",this.color=new Do(16777215),this.map=null,this.alphaMap=null,this.size=1,this.sizeAttenuation=!0,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.alphaMap=e.alphaMap,this.size=e.size,this.sizeAttenuation=e.sizeAttenuation,this.fog=e.fog,this}}var OPt=new Fi,oOe=new nR,Sye=new bx,Pye=new Dt;class OM extends nl{constructor(e=new ha,t=new zI){super();this.isPoints=!0,this.type="Points",this.geometry=e,this.material=t,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}raycast(e,t){let n=this.geometry,o=this.matrixWorld,r=e.params.Points.threshold,i=n.drawRange;if(n.boundingSphere===null)n.computeBoundingSphere();if(Sye.copy(n.boundingSphere),Sye.applyMatrix4(o),Sye.radius+=r,e.ray.intersectsSphere(Sye)===!1)return;OPt.copy(o).invert(),oOe.copy(e.ray).applyMatrix4(OPt);let s=r/((this.scale.x+this.scale.y+this.scale.z)/3),a=s*s,c=n.index,h=n.attributes.position;if(c!==null){let d=Math.max(0,i.start),u=Math.min(c.count,i.start+i.count);for(let _=d,p=u;_<p;_++){let m=c.getX(_);Pye.fromBufferAttribute(h,m),VPt(Pye,m,a,o,e,t,this)}}else{let d=Math.max(0,i.start),u=Math.min(h.count,i.start+i.count);for(let _=d,p=u;_<p;_++)Pye.fromBufferAttribute(h,_),VPt(Pye,_,a,o,e,t,this)}}updateMorphTargets(){let t=this.geometry.morphAttributes,n=Object.keys(t);if(n.length>0){let o=t[n[0]];if(o!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let r=0,i=o.length;r<i;r++){let s=o[r].name||String(r);this.morphTargetInfluences.push(0),this.morphTargetDictionary[s]=r}}}}}function VPt(e,t,n,o,r,i,s){let a=oOe.distanceSqToPoint(e);if(a<n){let c=new Dt;oOe.closestPointToPoint(e,c),c.applyMatrix4(o);let l=r.ray.origin.distanceTo(c);if(l<r.near||l>r.far)return;i.push({distance:l,distanceToRay:Math.sqrt(a),point:c,index:t,face:null,object:s})}}class Uie extends Bl{constructor(e,t,n,o,r,i,s,a,c,l,h,d){super(null,i,s,a,c,l,o,r,h,d);this.isCompressedTexture=!0,this.image={width:t,height:n},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}}class ed extends Bl{constructor(e,t,n,o,r,i,s,a,c){super(e,t,n,o,r,i,s,a,c);this.isCanvasTexture=!0,this.needsUpdate=!0}}class OI{constructor(){this.type="Curve",this.arcLengthDivisions=200}getPoint(){return console.warn("THREE.Curve: .getPoint() not implemented."),null}getPointAt(e,t){let n=this.getUtoTmapping(e);return this.getPoint(n,t)}getPoints(e=5){let t=[];for(let n=0;n<=e;n++)t.push(this.getPoint(n/e));return t}getSpacedPoints(e=5){let t=[];for(let n=0;n<=e;n++)t.push(this.getPointAt(n/e));return t}getLength(){let e=this.getLengths();return e[e.length-1]}getLengths(e=this.arcLengthDivisions){if(this.cacheArcLengths&&this.cacheArcLengths.length===e+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;let t=[],n,o=this.getPoint(0),r=0;t.push(0);for(let i=1;i<=e;i++)n=this.getPoint(i/e),r+=n.distanceTo(o),t.push(r),o=n;return this.cacheArcLengths=t,t}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(e,t){let n=this.getLengths(),o=0,r=n.length,i;if(t)i=t;else i=e*n[r-1];let s=0,a=r-1,c;while(s<=a)if(o=Math.floor(s+(a-s)/2),c=n[o]-i,c<0)s=o+1;else if(c>0)a=o-1;else{a=o;break}if(o=a,n[o]===i)return o/(r-1);let l=n[o],d=n[o+1]-l,u=(i-l)/d;return(o+u)/(r-1)}getTangent(e,t){let o=e-0.0001,r=e+0.0001;if(o<0)o=0;if(r>1)r=1;let i=this.getPoint(o),s=this.getPoint(r),a=t||(i.isVector2?new go:new Dt);return a.copy(s).sub(i).normalize(),a}getTangentAt(e,t){let n=this.getUtoTmapping(e);return this.getTangent(n,t)}computeFrenetFrames(e,t){let n=new Dt,o=[],r=[],i=[],s=new Dt,a=new Fi;for(let u=0;u<=e;u++){let _=u/e;o[u]=this.getTangentAt(_,new Dt)}r[0]=new Dt,i[0]=new Dt;let c=Number.MAX_VALUE,l=Math.abs(o[0].x),h=Math.abs(o[0].y),d=Math.abs(o[0].z);if(l<=c)c=l,n.set(1,0,0);if(h<=c)c=h,n.set(0,1,0);if(d<=c)n.set(0,0,1);s.crossVectors(o[0],n).normalize(),r[0].crossVectors(o[0],s),i[0].crossVectors(o[0],r[0]);for(let u=1;u<=e;u++){if(r[u]=r[u-1].clone(),i[u]=i[u-1].clone(),s.crossVectors(o[u-1],o[u]),s.length()>Number.EPSILON){s.normalize();let _=Math.acos(ng(o[u-1].dot(o[u]),-1,1));r[u].applyMatrix4(a.makeRotationAxis(s,_))}i[u].crossVectors(o[u],r[u])}if(t===!0){let u=Math.acos(ng(r[0].dot(r[e]),-1,1));if(u/=e,o[0].dot(s.crossVectors(r[0],r[e]))>0)u=-u;for(let _=1;_<=e;_++)r[_].applyMatrix4(a.makeRotationAxis(o[_],u*_)),i[_].crossVectors(o[_],r[_])}return{tangents:o,normals:r,binormals:i}}clone(){return new this.constructor().copy(this)}copy(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}toJSON(){let e={metadata:{version:4.6,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e}fromJSON(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}}class Zye extends OI{constructor(e=0,t=0,n=1,o=1,r=0,i=Math.PI*2,s=!1,a=0){super();this.isEllipseCurve=!0,this.type="EllipseCurve",this.aX=e,this.aY=t,this.xRadius=n,this.yRadius=o,this.aStartAngle=r,this.aEndAngle=i,this.aClockwise=s,this.aRotation=a}getPoint(e,t=new go){let n=t,o=Math.PI*2,r=this.aEndAngle-this.aStartAngle,i=Math.abs(r)<Number.EPSILON;while(r<0)r+=o;while(r>o)r-=o;if(r<Number.EPSILON)if(i)r=0;else r=o;if(this.aClockwise===!0&&!i)if(r===o)r=-o;else r=r-o;let s=this.aStartAngle+e*r,a=this.aX+this.xRadius*Math.cos(s),c=this.aY+this.yRadius*Math.sin(s);if(this.aRotation!==0){let l=Math.cos(this.aRotation),h=Math.sin(this.aRotation),d=a-this.aX,u=c-this.aY;a=d*l-u*h+this.aX,c=d*h+u*l+this.aY}return n.set(a,c)}copy(e){return super.copy(e),this.aX=e.aX,this.aY=e.aY,this.xRadius=e.xRadius,this.yRadius=e.yRadius,this.aStartAngle=e.aStartAngle,this.aEndAngle=e.aEndAngle,this.aClockwise=e.aClockwise,this.aRotation=e.aRotation,this}toJSON(){let e=super.toJSON();return e.aX=this.aX,e.aY=this.aY,e.xRadius=this.xRadius,e.yRadius=this.yRadius,e.aStartAngle=this.aStartAngle,e.aEndAngle=this.aEndAngle,e.aClockwise=this.aClockwise,e.aRotation=this.aRotation,e}fromJSON(e){return super.fromJSON(e),this.aX=e.aX,this.aY=e.aY,this.xRadius=e.xRadius,this.yRadius=e.yRadius,this.aStartAngle=e.aStartAngle,this.aEndAngle=e.aEndAngle,this.aClockwise=e.aClockwise,this.aRotation=e.aRotation,this}}class MEt extends Zye{constructor(e,t,n,o,r,i){super(e,t,n,n,o,r,i);this.isArcCurve=!0,this.type="ArcCurve"}}function bOe(){let e=0,t=0,n=0,o=0;function r(i,s,a,c){e=i,t=a,n=-3*i+3*s-2*a-c,o=2*i-2*s+a+c}return{initCatmullRom:function(i,s,a,c,l){r(s,a,l*(a-i),l*(c-s))},initNonuniformCatmullRom:function(i,s,a,c,l,h,d){let u=(s-i)/l-(a-i)/(l+h)+(a-s)/h,_=(a-s)/h-(c-s)/(h+d)+(c-a)/d;u*=h,_*=h,r(s,a,u,_)},calc:function(i){let s=i*i,a=s*i;return e+t*i+n*s+o*a}}}var Eye=new Dt,$ze=new bOe,qze=new bOe,Jze=new bOe;class exe extends OI{constructor(e=[],t=!1,n="centripetal",o=0.5){super();this.isCatmullRomCurve3=!0,this.type="CatmullRomCurve3",this.points=e,this.closed=t,this.curveType=n,this.tension=o}getPoint(e,t=new Dt){let n=t,o=this.points,r=o.length,i=(r-(this.closed?0:1))*e,s=Math.floor(i),a=i-s;if(this.closed)s+=s>0?0:(Math.floor(Math.abs(s)/r)+1)*r;else if(a===0&&s===r-1)s=r-2,a=1;let c,l;if(this.closed||s>0)c=o[(s-1)%r];else Eye.subVectors(o[0],o[1]).add(o[0]),c=Eye;let h=o[s%r],d=o[(s+1)%r];if(this.closed||s+2<r)l=o[(s+2)%r];else Eye.subVectors(o[r-1],o[r-2]).add(o[r-1]),l=Eye;if(this.curveType==="centripetal"||this.curveType==="chordal"){let u=this.curveType==="chordal"?0.5:0.25,_=Math.pow(c.distanceToSquared(h),u),p=Math.pow(h.distanceToSquared(d),u),m=Math.pow(d.distanceToSquared(l),u);if(p<0.0001)p=1;if(_<0.0001)_=p;if(m<0.0001)m=p;$ze.initNonuniformCatmullRom(c.x,h.x,d.x,l.x,_,p,m),qze.initNonuniformCatmullRom(c.y,h.y,d.y,l.y,_,p,m),Jze.initNonuniformCatmullRom(c.z,h.z,d.z,l.z,_,p,m)}else if(this.curveType==="catmullrom")$ze.initCatmullRom(c.x,h.x,d.x,l.x,this.tension),qze.initCatmullRom(c.y,h.y,d.y,l.y,this.tension),Jze.initCatmullRom(c.z,h.z,d.z,l.z,this.tension);return n.set($ze.calc(a),qze.calc(a),Jze.calc(a)),n}copy(e){super.copy(e),this.points=[];for(let t=0,n=e.points.length;t<n;t++){let o=e.points[t];this.points.push(o.clone())}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this}toJSON(){let e=super.toJSON();e.points=[];for(let t=0,n=this.points.length;t<n;t++){let o=this.points[t];e.points.push(o.toArray())}return e.closed=this.closed,e.curveType=this.curveType,e.tension=this.tension,e}fromJSON(e){super.fromJSON(e),this.points=[];for(let t=0,n=e.points.length;t<n;t++){let o=e.points[t];this.points.push(new Dt().fromArray(o))}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this}}function YPt(e,t,n,o,r){let i=(o-t)*0.5,s=(r-n)*0.5,a=e*e,c=e*a;return(2*n-2*o+i+s)*c+(-3*n+3*o-2*i-s)*a+i*e+n}function KHo(e,t){let n=1-e;return n*n*t}function $Ho(e,t){return 2*(1-e)*e*t}function qHo(e,t){return e*e*t}function Tie(e,t,n,o){return KHo(e,t)+$Ho(e,n)+qHo(e,o)}function JHo(e,t){let n=1-e;return n*n*n*t}function ZHo(e,t){let n=1-e;return 3*n*n*e*t}function eFo(e,t){return 3*(1-e)*e*e*t}function tFo(e,t){return e*e*e*t}function Die(e,t,n,o,r){return JHo(e,t)+ZHo(e,n)+eFo(e,o)+tFo(e,r)}class IOe extends OI{constructor(e=new go,t=new go,n=new go,o=new go){super();this.isCubicBezierCurve=!0,this.type="CubicBezierCurve",this.v0=e,this.v1=t,this.v2=n,this.v3=o}getPoint(e,t=new go){let n=t,o=this.v0,r=this.v1,i=this.v2,s=this.v3;return n.set(Die(e,o.x,r.x,i.x,s.x),Die(e,o.y,r.y,i.y,s.y)),n}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this}toJSON(){let e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this}}class wEt extends OI{constructor(e=new Dt,t=new Dt,n=new Dt,o=new Dt){super();this.isCubicBezierCurve3=!0,this.type="CubicBezierCurve3",this.v0=e,this.v1=t,this.v2=n,this.v3=o}getPoint(e,t=new Dt){let n=t,o=this.v0,r=this.v1,i=this.v2,s=this.v3;return n.set(Die(e,o.x,r.x,i.x,s.x),Die(e,o.y,r.y,i.y,s.y),Die(e,o.z,r.z,i.z,s.z)),n}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this}toJSON(){let e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this}}class vOe extends OI{constructor(e=new go,t=new go){super();this.isLineCurve=!0,this.type="LineCurve",this.v1=e,this.v2=t}getPoint(e,t=new go){let n=t;if(e===1)n.copy(this.v2);else n.copy(this.v2).sub(this.v1),n.multiplyScalar(e).add(this.v1);return n}getPointAt(e,t){return this.getPoint(e,t)}getTangent(e,t=new go){return t.subVectors(this.v2,this.v1).normalize()}getTangentAt(e,t){return this.getTangent(e,t)}copy(e){return super.copy(e),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){let e=super.toJSON();return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}class BEt extends OI{constructor(e=new Dt,t=new Dt){super();this.isLineCurve3=!0,this.type="LineCurve3",this.v1=e,this.v2=t}getPoint(e,t=new Dt){let n=t;if(e===1)n.copy(this.v2);else n.copy(this.v2).sub(this.v1),n.multiplyScalar(e).add(this.v1);return n}getPointAt(e,t){return this.getPoint(e,t)}getTangent(e,t=new Dt){return t.subVectors(this.v2,this.v1).normalize()}getTangentAt(e,t){return this.getTangent(e,t)}copy(e){return super.copy(e),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){let e=super.toJSON();return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}class SOe extends OI{constructor(e=new go,t=new go,n=new go){super();this.isQuadraticBezierCurve=!0,this.type="QuadraticBezierCurve",this.v0=e,this.v1=t,this.v2=n}getPoint(e,t=new go){let n=t,o=this.v0,r=this.v1,i=this.v2;return n.set(Tie(e,o.x,r.x,i.x),Tie(e,o.y,r.y,i.y)),n}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){let e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}class TEt extends OI{constructor(e=new Dt,t=new Dt,n=new Dt){super();this.isQuadraticBezierCurve3=!0,this.type="QuadraticBezierCurve3",this.v0=e,this.v1=t,this.v2=n}getPoint(e,t=new Dt){let n=t,o=this.v0,r=this.v1,i=this.v2;return n.set(Tie(e,o.x,r.x,i.x),Tie(e,o.y,r.y,i.y),Tie(e,o.z,r.z,i.z)),n}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){let e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}class POe extends OI{constructor(e=[]){super();this.isSplineCurve=!0,this.type="SplineCurve",this.points=e}getPoint(e,t=new go){let n=t,o=this.points,r=(o.length-1)*e,i=Math.floor(r),s=r-i,a=o[i===0?i:i-1],c=o[i],l=o[i>o.length-2?o.length-1:i+1],h=o[i>o.length-3?o.length-1:i+2];return n.set(YPt(s,a.x,c.x,l.x,h.x),YPt(s,a.y,c.y,l.y,h.y)),n}copy(e){super.copy(e),this.points=[];for(let t=0,n=e.points.length;t<n;t++){let o=e.points[t];this.points.push(o.clone())}return this}toJSON(){let e=super.toJSON();e.points=[];for(let t=0,n=this.points.length;t<n;t++){let o=this.points[t];e.points.push(o.toArray())}return e}fromJSON(e){super.fromJSON(e),this.points=[];for(let t=0,n=e.points.length;t<n;t++){let o=e.points[t];this.points.push(new go().fromArray(o))}return this}}var rOe=Object.freeze({__proto__:null,ArcCurve:MEt,CatmullRomCurve3:exe,CubicBezierCurve:IOe,CubicBezierCurve3:wEt,EllipseCurve:Zye,LineCurve:vOe,LineCurve3:BEt,QuadraticBezierCurve:SOe,QuadraticBezierCurve3:TEt,SplineCurve:POe});class DEt extends OI{constructor(){super();this.type="CurvePath",this.curves=[],this.autoClose=!1}add(e){this.curves.push(e)}closePath(){let e=this.curves[0].getPoint(0),t=this.curves[this.curves.length-1].getPoint(1);if(!e.equals(t)){let n=e.isVector2===!0?"LineCurve":"LineCurve3";this.curves.push(new rOe[n](t,e))}return this}getPoint(e,t){let n=e*this.getLength(),o=this.getCurveLengths(),r=0;while(r<o.length){if(o[r]>=n){let i=o[r]-n,s=this.curves[r],a=s.getLength(),c=a===0?0:1-i/a;return s.getPointAt(c,t)}r++}return null}getLength(){let e=this.getCurveLengths();return e[e.length-1]}updateArcLengths(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()}getCurveLengths(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;let e=[],t=0;for(let n=0,o=this.curves.length;n<o;n++)t+=this.curves[n].getLength(),e.push(t);return this.cacheLengths=e,e}getSpacedPoints(e=40){let t=[];for(let n=0;n<=e;n++)t.push(this.getPoint(n/e));if(this.autoClose)t.push(t[0]);return t}getPoints(e=12){let t=[],n;for(let o=0,r=this.curves;o<r.length;o++){let i=r[o],s=i.isEllipseCurve?e*2:i.isLineCurve||i.isLineCurve3?1:i.isSplineCurve?e*i.points.length:e,a=i.getPoints(s);for(let c=0;c<a.length;c++){let l=a[c];if(n&&n.equals(l))continue;t.push(l),n=l}}if(this.autoClose&&t.length>1&&!t[t.length-1].equals(t[0]))t.push(t[0]);return t}copy(e){super.copy(e),this.curves=[];for(let t=0,n=e.curves.length;t<n;t++){let o=e.curves[t];this.curves.push(o.clone())}return this.autoClose=e.autoClose,this}toJSON(){let e=super.toJSON();e.autoClose=this.autoClose,e.curves=[];for(let t=0,n=this.curves.length;t<n;t++){let o=this.curves[t];e.curves.push(o.toJSON())}return e}fromJSON(e){super.fromJSON(e),this.autoClose=e.autoClose,this.curves=[];for(let t=0,n=e.curves.length;t<n;t++){let o=e.curves[t];this.curves.push(new rOe[o.type]().fromJSON(o))}return this}}class Qie extends DEt{constructor(e){super();if(this.type="Path",this.currentPoint=new go,e)this.setFromPoints(e)}setFromPoints(e){this.moveTo(e[0].x,e[0].y);for(let t=1,n=e.length;t<n;t++)this.lineTo(e[t].x,e[t].y);return this}moveTo(e,t){return this.currentPoint.set(e,t),this}lineTo(e,t){let n=new vOe(this.currentPoint.clone(),new go(e,t));return this.curves.push(n),this.currentPoint.set(e,t),this}quadraticCurveTo(e,t,n,o){let r=new SOe(this.currentPoint.clone(),new go(e,t),new go(n,o));return this.curves.push(r),this.currentPoint.set(n,o),this}bezierCurveTo(e,t,n,o,r,i){let s=new IOe(this.currentPoint.clone(),new go(e,t),new go(n,o),new go(r,i));return this.curves.push(s),this.currentPoint.set(r,i),this}splineThru(e){let t=[this.currentPoint.clone()].concat(e),n=new POe(t);return this.curves.push(n),this.currentPoint.copy(e[e.length-1]),this}arc(e,t,n,o,r,i){let s=this.currentPoint.x,a=this.currentPoint.y;return this.absarc(e+s,t+a,n,o,r,i),this}absarc(e,t,n,o,r,i){return this.absellipse(e,t,n,n,o,r,i),this}ellipse(e,t,n,o,r,i,s,a){let c=this.currentPoint.x,l=this.currentPoint.y;return this.absellipse(e+c,t+l,n,o,r,i,s,a),this}absellipse(e,t,n,o,r,i,s,a){let c=new Zye(e,t,n,o,r,i,s,a);if(this.curves.length>0){let h=c.getPoint(0);if(!h.equals(this.currentPoint))this.lineTo(h.x,h.y)}this.curves.push(c);let l=c.getPoint(1);return this.currentPoint.copy(l),this}copy(e){return super.copy(e),this.currentPoint.copy(e.currentPoint),this}toJSON(){let e=super.toJSON();return e.currentPoint=this.currentPoint.toArray(),e}fromJSON(e){return super.fromJSON(e),this.currentPoint.fromArray(e.currentPoint),this}}class VM extends ha{constructor(e=1,t=1,n=1,o=32,r=1,i=!1,s=0,a=Math.PI*2){super();this.type="CylinderGeometry",this.parameters={radiusTop:e,radiusBottom:t,height:n,radialSegments:o,heightSegments:r,openEnded:i,thetaStart:s,thetaLength:a};let c=this;o=Math.floor(o),r=Math.floor(r);let l=[],h=[],d=[],u=[],_=0,p=[],m=n/2,A=0;if(g(),i===!1){if(e>0)f(!0);if(t>0)f(!1)}this.setIndex(l),this.setAttribute("position",new jr(h,3)),this.setAttribute("normal",new jr(d,3)),this.setAttribute("uv",new jr(u,2));function g(){let y=new Dt,x=new Dt,C=0,b=(t-e)/n;for(let I=0;I<=r;I++){let v=[],P=I/r,M=P*(t-e)+e;for(let B=0;B<=o;B++){let T=B/o,N=T*a+s,D=Math.sin(N),L=Math.cos(N);x.x=M*D,x.y=-P*n+m,x.z=M*L,h.push(x.x,x.y,x.z),y.set(D,b,L).normalize(),d.push(y.x,y.y,y.z),u.push(T,1-P),v.push(_++)}p.push(v)}for(let I=0;I<o;I++)for(let v=0;v<r;v++){let P=p[v][I],M=p[v+1][I],B=p[v+1][I+1],T=p[v][I+1];l.push(P,M,T),l.push(M,B,T),C+=6}c.addGroup(A,C,0),A+=C}function f(y){let x=_,C=new go,b=new Dt,I=0,v=y===!0?e:t,P=y===!0?1:-1;for(let B=1;B<=o;B++)h.push(0,m*P,0),d.push(0,P,0),u.push(0.5,0.5),_++;let M=_;for(let B=0;B<=o;B++){let N=B/o*a+s,D=Math.cos(N),L=Math.sin(N);b.x=v*L,b.y=m*P,b.z=v*D,h.push(b.x,b.y,b.z),d.push(0,P,0),C.x=D*0.5+0.5,C.y=L*0.5*P+0.5,u.push(C.x,C.y),_++}for(let B=0;B<o;B++){let T=x+B,N=M+B;if(y===!0)l.push(N,N+1,T);else l.push(N+1,N,T);I+=3}c.addGroup(A,I,y===!0?1:2),A+=I}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new VM(e.radiusTop,e.radiusBottom,e.height,e.radialSegments,e.heightSegments,e.openEnded,e.thetaStart,e.thetaLength)}}class txe extends VM{constructor(e=1,t=1,n=32,o=1,r=!1,i=0,s=Math.PI*2){super(0,e,t,n,o,r,i,s);this.type="ConeGeometry",this.parameters={radius:e,height:t,radialSegments:n,heightSegments:o,openEnded:r,thetaStart:i,thetaLength:s}}static fromJSON(e){return new txe(e.radius,e.height,e.radialSegments,e.heightSegments,e.openEnded,e.thetaStart,e.thetaLength)}}var Mye=new Dt,wye=new Dt,Zze=new Dt,Bye=new FI;class EOe extends ha{constructor(e=null,t=1){super();if(this.type="EdgesGeometry",this.parameters={geometry:e,thresholdAngle:t},e!==null){let o=Math.pow(10,4),r=Math.cos(Vj*t),i=e.getIndex(),s=e.getAttribute("position"),a=i?i.count:s.count,c=[0,0,0],l=["a","b","c"],h=[,,,],d={},u=[];for(let _=0;_<a;_+=3){if(i)c[0]=i.getX(_),c[1]=i.getX(_+1),c[2]=i.getX(_+2);else c[0]=_,c[1]=_+1,c[2]=_+2;let{a:p,b:m,c:A}=Bye;if(p.fromBufferAttribute(s,c[0]),m.fromBufferAttribute(s,c[1]),A.fromBufferAttribute(s,c[2]),Bye.getNormal(Zze),h[0]=`${Math.round(p.x*o)},${Math.round(p.y*o)},${Math.round(p.z*o)}`,h[1]=`${Math.round(m.x*o)},${Math.round(m.y*o)},${Math.round(m.z*o)}`,h[2]=`${Math.round(A.x*o)},${Math.round(A.y*o)},${Math.round(A.z*o)}`,h[0]===h[1]||h[1]===h[2]||h[2]===h[0])continue;for(let g=0;g<3;g++){let f=(g+1)%3,y=h[g],x=h[f],C=Bye[l[g]],b=Bye[l[f]],I=`${y}_${x}`,v=`${x}_${y}`;if(v in d&&d[v]){if(Zze.dot(d[v].normal)<=r)u.push(C.x,C.y,C.z),u.push(b.x,b.y,b.z);d[v]=null}else if(!(I in d))d[I]={index0:c[g],index1:c[f],normal:Zze.clone()}}}for(let _ in d)if(d[_]){let{index0:p,index1:m}=d[_];Mye.fromBufferAttribute(s,p),wye.fromBufferAttribute(s,m),u.push(Mye.x,Mye.y,Mye.z),u.push(wye.x,wye.y,wye.z)}this.setAttribute("position",new jr(u,3))}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}}class nxe extends Qie{constructor(e){super(e);this.uuid=OC(),this.type="Shape",this.holes=[]}getPointsHoles(e){let t=[];for(let n=0,o=this.holes.length;n<o;n++)t[n]=this.holes[n].getPoints(e);return t}extractPoints(e){return{shape:this.getPoints(e),holes:this.getPointsHoles(e)}}copy(e){super.copy(e),this.holes=[];for(let t=0,n=e.holes.length;t<n;t++){let o=e.holes[t];this.holes.push(o.clone())}return this}toJSON(){let e=super.toJSON();e.uuid=this.uuid,e.holes=[];for(let t=0,n=this.holes.length;t<n;t++){let o=this.holes[t];e.holes.push(o.toJSON())}return e}fromJSON(e){super.fromJSON(e),this.uuid=e.uuid,this.holes=[];for(let t=0,n=e.holes.length;t<n;t++){let o=e.holes[t];this.holes.push(new Qie().fromJSON(o))}return this}}var nFo={triangulate:function(e,t,n=2){let o=t&&t.length,r=o?t[0]*n:e.length,i=NEt(e,0,r,n,!0),s=[];if(!i||i.next===i.prev)return s;let a,c,l,h,d,u,_;if(o)i=aFo(e,t,i,n);if(e.length>80*n){a=l=e[0],c=h=e[1];for(let p=n;p<r;p+=n){if(d=e[p],u=e[p+1],d<a)a=d;if(u<c)c=u;if(d>l)l=d;if(u>h)h=u}_=Math.max(l-a,h-c),_=_!==0?32767/_:0}return kie(i,s,n,a,c,_,0),s}};function NEt(e,t,n,o,r){let i,s;if(r===fFo(e,t,n,o)>0)for(i=t;i<n;i+=o)s=GPt(i,e[i],e[i+1],s);else for(i=n-o;i>=t;i-=o)s=GPt(i,e[i],e[i+1],s);if(s&&oxe(s,s.next))Hie(s),s=s.next;return s}function vz(e,t){if(!e)return e;if(!t)t=e;let n=e,o;do if(o=!1,!n.steiner&&(oxe(n,n.next)||G0(n.prev,n,n.next)===0)){if(Hie(n),n=t=n.prev,n===n.next)break;o=!0}else n=n.next;while(o||n!==t);return t}function kie(e,t,n,o,r,i,s){if(!e)return;if(!s&&i)uFo(e,o,r,i);let a=e,c,l;while(e.prev!==e.next){if(c=e.prev,l=e.next,i?rFo(e,o,r,i):oFo(e)){t.push(c.i/n|0),t.push(e.i/n|0),t.push(l.i/n|0),Hie(e),e=l.next,a=l.next;continue}if(e=l,e===a){if(!s)kie(vz(e),t,n,o,r,i,1);else if(s===1)e=iFo(vz(e),t,n),kie(e,t,n,o,r,i,2);else if(s===2)sFo(e,t,n,o,r,i);break}}}function oFo(e){let t=e.prev,n=e,o=e.next;if(G0(t,n,o)>=0)return!1;let r=t.x,i=n.x,s=o.x,a=t.y,c=n.y,l=o.y,h=r<i?r<s?r:s:i<s?i:s,d=a<c?a<l?a:l:c<l?c:l,u=r>i?r>s?r:s:i>s?i:s,_=a>c?a>l?a:l:c>l?c:l,p=o.next;while(p!==t){if(p.x>=h&&p.x<=u&&p.y>=d&&p.y<=_&&Oj(r,a,i,c,s,l,p.x,p.y)&&G0(p.prev,p,p.next)>=0)return!1;p=p.next}return!0}function rFo(e,t,n,o){let r=e.prev,i=e,s=e.next;if(G0(r,i,s)>=0)return!1;let a=r.x,c=i.x,l=s.x,h=r.y,d=i.y,u=s.y,_=a<c?a<l?a:l:c<l?c:l,p=h<d?h<u?h:u:d<u?d:u,m=a>c?a>l?a:l:c>l?c:l,A=h>d?h>u?h:u:d>u?d:u,g=iOe(_,p,t,n,o),f=iOe(m,A,t,n,o),{prevZ:y,nextZ:x}=e;while(y&&y.z>=g&&x&&x.z<=f){if(y.x>=_&&y.x<=m&&y.y>=p&&y.y<=A&&y!==r&&y!==s&&Oj(a,h,c,d,l,u,y.x,y.y)&&G0(y.prev,y,y.next)>=0)return!1;if(y=y.prevZ,x.x>=_&&x.x<=m&&x.y>=p&&x.y<=A&&x!==r&&x!==s&&Oj(a,h,c,d,l,u,x.x,x.y)&&G0(x.prev,x,x.next)>=0)return!1;x=x.nextZ}while(y&&y.z>=g){if(y.x>=_&&y.x<=m&&y.y>=p&&y.y<=A&&y!==r&&y!==s&&Oj(a,h,c,d,l,u,y.x,y.y)&&G0(y.prev,y,y.next)>=0)return!1;y=y.prevZ}while(x&&x.z<=f){if(x.x>=_&&x.x<=m&&x.y>=p&&x.y<=A&&x!==r&&x!==s&&Oj(a,h,c,d,l,u,x.x,x.y)&&G0(x.prev,x,x.next)>=0)return!1;x=x.nextZ}return!0}function iFo(e,t,n){let o=e;do{let r=o.prev,i=o.next.next;if(!oxe(r,i)&&REt(r,o,o.next,i)&&Lie(r,i)&&Lie(i,r))t.push(r.i/n|0),t.push(o.i/n|0),t.push(i.i/n|0),Hie(o),Hie(o.next),o=e=i;o=o.next}while(o!==e);return vz(o)}function sFo(e,t,n,o,r,i){let s=e;do{let a=s.next.next;while(a!==s.prev){if(s.i!==a.i&&_Fo(s,a)){let c=QEt(s,a);s=vz(s,s.next),c=vz(c,c.next),kie(s,t,n,o,r,i,0),kie(c,t,n,o,r,i,0);return}a=a.next}s=s.next}while(s!==e)}function aFo(e,t,n,o){let r=[],i,s,a,c,l;for(i=0,s=t.length;i<s;i++){if(a=t[i]*o,c=i<s-1?t[i+1]*o:e.length,l=NEt(e,a,c,o,!1),l===l.next)l.steiner=!0;r.push(mFo(l))}r.sort(cFo);for(i=0;i<r.length;i++)n=lFo(r[i],n);return n}function cFo(e,t){return e.x-t.x}function lFo(e,t){let n=hFo(e,t);if(!n)return t;let o=QEt(n,e);return vz(o,o.next),vz(n,n.next)}function hFo(e,t){let n=t,o=-1/0,r,{x:i,y:s}=e;do{if(s<=n.y&&s>=n.next.y&&n.next.y!==n.y){let u=n.x+(s-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(u<=i&&u>o){if(o=u,r=n.x<n.next.x?n:n.next,u===i)return r}}n=n.next}while(n!==t);if(!r)return null;let a=r,c=r.x,l=r.y,h=1/0,d;n=r;do{if(i>=n.x&&n.x>=c&&i!==n.x&&Oj(s<l?i:o,s,c,l,s<l?o:i,s,n.x,n.y)){if(d=Math.abs(s-n.y)/(i-n.x),Lie(n,e)&&(d<h||d===h&&(n.x>r.x||n.x===r.x&&dFo(r,n))))r=n,h=d}n=n.next}while(n!==a);return r}function dFo(e,t){return G0(e.prev,e,t.prev)<0&&G0(t.next,e,e.next)<0}function uFo(e,t,n,o){let r=e;do{if(r.z===0)r.z=iOe(r.x,r.y,t,n,o);r.prevZ=r.prev,r.nextZ=r.next,r=r.next}while(r!==e);r.prevZ.nextZ=null,r.prevZ=null,pFo(r)}function pFo(e){let t,n,o,r,i,s,a,c,l=1;do{n=e,e=null,i=null,s=0;while(n){s++,o=n,a=0;for(t=0;t<l;t++)if(a++,o=o.nextZ,!o)break;c=l;while(a>0||c>0&&o){if(a!==0&&(c===0||!o||n.z<=o.z))r=n,n=n.nextZ,a--;else r=o,o=o.nextZ,c--;if(i)i.nextZ=r;else e=r;r.prevZ=i,i=r}n=o}i.nextZ=null,l*=2}while(s>1);return e}function iOe(e,t,n,o,r){return e=(e-n)*r|0,t=(t-o)*r|0,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,e|t<<1}function mFo(e){let t=e,n=e;do{if(t.x<n.x||t.x===n.x&&t.y<n.y)n=t;t=t.next}while(t!==e);return n}function Oj(e,t,n,o,r,i,s,a){return(r-s)*(t-a)>=(e-s)*(i-a)&&(e-s)*(o-a)>=(n-s)*(t-a)&&(n-s)*(i-a)>=(r-s)*(o-a)}function _Fo(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!gFo(e,t)&&(Lie(e,t)&&Lie(t,e)&&AFo(e,t)&&(G0(e.prev,e,t.prev)||G0(e,t.prev,t))||oxe(e,t)&&G0(e.prev,e,e.next)>0&&G0(t.prev,t,t.next)>0)}function G0(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function oxe(e,t){return e.x===t.x&&e.y===t.y}function REt(e,t,n,o){let r=Dye(G0(e,t,n)),i=Dye(G0(e,t,o)),s=Dye(G0(n,o,e)),a=Dye(G0(n,o,t));if(r!==i&&s!==a)return!0;if(r===0&&Tye(e,n,t))return!0;if(i===0&&Tye(e,o,t))return!0;if(s===0&&Tye(n,e,o))return!0;if(a===0&&Tye(n,t,o))return!0;return!1}function Tye(e,t,n){return t.x<=Math.max(e.x,n.x)&&t.x>=Math.min(e.x,n.x)&&t.y<=Math.max(e.y,n.y)&&t.y>=Math.min(e.y,n.y)}function Dye(e){return e>0?1:e<0?-1:0}function gFo(e,t){let n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&REt(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}function Lie(e,t){return G0(e.prev,e,e.next)<0?G0(e,t,e.next)>=0&&G0(e,e.prev,t)>=0:G0(e,t,e.prev)<0||G0(e,e.next,t)<0}function AFo(e,t){let n=e,o=!1,r=(e.x+t.x)/2,i=(e.y+t.y)/2;do{if(n.y>i!==n.next.y>i&&n.next.y!==n.y&&r<(n.next.x-n.x)*(i-n.y)/(n.next.y-n.y)+n.x)o=!o;n=n.next}while(n!==e);return o}function QEt(e,t){let n=new sOe(e.i,e.x,e.y),o=new sOe(t.i,t.x,t.y),r=e.next,i=t.prev;return e.next=t,t.prev=e,n.next=r,r.prev=n,o.next=n,n.prev=o,i.next=o,o.prev=i,o}function GPt(e,t,n,o){let r=new sOe(e,t,n);if(!o)r.prev=r,r.next=r;else r.next=o.next,r.prev=o,o.next.prev=r,o.next=r;return r}function Hie(e){if(e.next.prev=e.prev,e.prev.next=e.next,e.prevZ)e.prevZ.nextZ=e.nextZ;if(e.nextZ)e.nextZ.prevZ=e.prevZ}function sOe(e,t,n){this.i=e,this.x=t,this.y=n,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function fFo(e,t,n,o){let r=0;for(let i=t,s=n-o;i<n;i+=o)r+=(e[s]-e[i])*(e[i+1]+e[s+1]),s=i;return r}class bz{static area(e){let t=e.length,n=0;for(let o=t-1,r=0;r<t;o=r++)n+=e[o].x*e[r].y-e[r].x*e[o].y;return n*0.5}static isClockWise(e){return bz.area(e)<0}static triangulateShape(e,t){let n=[],o=[],r=[];UPt(e),WPt(n,e);let i=e.length;t.forEach(UPt);for(let a=0;a<t.length;a++)o.push(i),i+=t[a].length,WPt(n,t[a]);let s=nFo.triangulate(n,o);for(let a=0;a<s.length;a+=3)r.push(s.slice(a,a+3));return r}}function UPt(e){let t=e.length;if(t>2&&e[t-1].equals(e[0]))e.pop()}function WPt(e,t){for(let n=0;n<t.length;n++)e.push(t[n].x),e.push(t[n].y)}class rxe extends ha{constructor(e=new nxe([new go(0.5,0.5),new go(-0.5,0.5),new go(-0.5,-0.5),new go(0.5,-0.5)]),t={}){super();this.type="ExtrudeGeometry",this.parameters={shapes:e,options:t},e=Array.isArray(e)?e:[e];let n=this,o=[],r=[];for(let s=0,a=e.length;s<a;s++){let c=e[s];i(c)}this.setAttribute("position",new jr(o,3)),this.setAttribute("uv",new jr(r,2)),this.computeVertexNormals();function i(s){let a=[],c=t.curveSegments!==void 0?t.curveSegments:12,l=t.steps!==void 0?t.steps:1,h=t.depth!==void 0?t.depth:1,d=t.bevelEnabled!==void 0?t.bevelEnabled:!0,u=t.bevelThickness!==void 0?t.bevelThickness:0.2,_=t.bevelSize!==void 0?t.bevelSize:u-0.1,p=t.bevelOffset!==void 0?t.bevelOffset:0,m=t.bevelSegments!==void 0?t.bevelSegments:3,A=t.extrudePath,g=t.UVGenerator!==void 0?t.UVGenerator:yFo,f,y=!1,x,C,b,I;if(A)f=A.getSpacedPoints(l),y=!0,d=!1,x=A.computeFrenetFrames(l,!1),C=new Dt,b=new Dt,I=new Dt;if(!d)m=0,u=0,_=0,p=0;let v=s.extractPoints(c),{shape:P,holes:M}=v;if(!bz.isClockWise(P)){P=P.reverse();for(let ie=0,ce=M.length;ie<ce;ie++){let ue=M[ie];if(bz.isClockWise(ue))M[ie]=ue.reverse()}}let T=bz.triangulateShape(P,M),N=P;for(let ie=0,ce=M.length;ie<ce;ie++){let ue=M[ie];P=P.concat(ue)}function D(ie,ce,ue){if(!ce)console.error("THREE.ExtrudeGeometry: vec does not exist");return ie.clone().addScaledVector(ce,ue)}let L=P.length,H=T.length;function V(ie,ce,ue){let de,me,ge,xe=ie.x-ce.x,Ee=ie.y-ce.y,Re=ue.x-ie.x,Me=ue.y-ie.y,_e=xe*xe+Ee*Ee,ye=xe*Me-Ee*Re;if(Math.abs(ye)>Number.EPSILON){let Se=Math.sqrt(_e),Ne=Math.sqrt(Re*Re+Me*Me),Le=ce.x-Ee/Se,nt=ce.y+xe/Se,dt=ue.x-Me/Ne,rt=ue.y+Re/Ne,pt=((dt-Le)*Me-(rt-nt)*Re)/(xe*Me-Ee*Re);de=Le+xe*pt-ie.x,me=nt+Ee*pt-ie.y;let ct=de*de+me*me;if(ct<=2)return new go(de,me);else ge=Math.sqrt(ct/2)}else{let Se=!1;if(xe>Number.EPSILON){if(Re>Number.EPSILON)Se=!0}else if(xe<-Number.EPSILON){if(Re<-Number.EPSILON)Se=!0}else if(Math.sign(Ee)===Math.sign(Me))Se=!0;if(Se)de=-Ee,me=xe,ge=Math.sqrt(_e);else de=xe,me=Ee,ge=Math.sqrt(_e/2)}return new go(de/ge,me/ge)}let O=[];for(let ie=0,ce=N.length,ue=ce-1,de=ie+1;ie<ce;ie++,ue++,de++){if(ue===ce)ue=0;if(de===ce)de=0;O[ie]=V(N[ie],N[ue],N[de])}let U=[],j,Y=O.concat();for(let ie=0,ce=M.length;ie<ce;ie++){let ue=M[ie];j=[];for(let de=0,me=ue.length,ge=me-1,xe=de+1;de<me;de++,ge++,xe++){if(ge===me)ge=0;if(xe===me)xe=0;j[de]=V(ue[de],ue[ge],ue[xe])}U.push(j),Y=Y.concat(j)}for(let ie=0;ie<m;ie++){let ce=ie/m,ue=u*Math.cos(ce*Math.PI/2),de=_*Math.sin(ce*Math.PI/2)+p;for(let me=0,ge=N.length;me<ge;me++){let xe=D(N[me],O[me],de);se(xe.x,xe.y,-ue)}for(let me=0,ge=M.length;me<ge;me++){let xe=M[me];j=U[me];for(let Ee=0,Re=xe.length;Ee<Re;Ee++){let Me=D(xe[Ee],j[Ee],de);se(Me.x,Me.y,-ue)}}}let X=_+p;for(let ie=0;ie<L;ie++){let ce=d?D(P[ie],Y[ie],X):P[ie];if(!y)se(ce.x,ce.y,0);else b.copy(x.normals[0]).multiplyScalar(ce.x),C.copy(x.binormals[0]).multiplyScalar(ce.y),I.copy(f[0]).add(b).add(C),se(I.x,I.y,I.z)}for(let ie=1;ie<=l;ie++)for(let ce=0;ce<L;ce++){let ue=d?D(P[ce],Y[ce],X):P[ce];if(!y)se(ue.x,ue.y,h/l*ie);else b.copy(x.normals[ie]).multiplyScalar(ue.x),C.copy(x.binormals[ie]).multiplyScalar(ue.y),I.copy(f[ie]).add(b).add(C),se(I.x,I.y,I.z)}for(let ie=m-1;ie>=0;ie--){let ce=ie/m,ue=u*Math.cos(ce*Math.PI/2),de=_*Math.sin(ce*Math.PI/2)+p;for(let me=0,ge=N.length;me<ge;me++){let xe=D(N[me],O[me],de);se(xe.x,xe.y,h+ue)}for(let me=0,ge=M.length;me<ge;me++){let xe=M[me];j=U[me];for(let Ee=0,Re=xe.length;Ee<Re;Ee++){let Me=D(xe[Ee],j[Ee],de);if(!y)se(Me.x,Me.y,h+ue);else se(Me.x,Me.y+f[l-1].y,f[l-1].x+ue)}}}K(),J();function K(){let ie=o.length/3;if(d){let ce=0,ue=L*ce;for(let de=0;de<H;de++){let me=T[de];ne(me[2]+ue,me[1]+ue,me[0]+ue)}ce=l+m*2,ue=L*ce;for(let de=0;de<H;de++){let me=T[de];ne(me[0]+ue,me[1]+ue,me[2]+ue)}}else{for(let ce=0;ce<H;ce++){let ue=T[ce];ne(ue[2],ue[1],ue[0])}for(let ce=0;ce<H;ce++){let ue=T[ce];ne(ue[0]+L*l,ue[1]+L*l,ue[2]+L*l)}}n.addGroup(ie,o.length/3-ie,0)}function J(){let ie=o.length/3,ce=0;ee(N,ce),ce+=N.length;for(let ue=0,de=M.length;ue<de;ue++){let me=M[ue];ee(me,ce),ce+=me.length}n.addGroup(ie,o.length/3-ie,1)}function ee(ie,ce){let ue=ie.length;while(--ue>=0){let de=ue,me=ue-1;if(me<0)me=ie.length-1;for(let ge=0,xe=l+m*2;ge<xe;ge++){let Ee=L*ge,Re=L*(ge+1),Me=ce+de+Ee,_e=ce+me+Ee,ye=ce+me+Re,Se=ce+de+Re;re(Me,_e,ye,Se)}}}function se(ie,ce,ue){a.push(ie),a.push(ce),a.push(ue)}function ne(ie,ce,ue){Z(ie),Z(ce),Z(ue);let de=o.length/3,me=g.generateTopUV(n,o,de-3,de-2,de-1);te(me[0]),te(me[1]),te(me[2])}function re(ie,ce,ue,de){Z(ie),Z(ce),Z(de),Z(ce),Z(ue),Z(de);let me=o.length/3,ge=g.generateSideWallUV(n,o,me-6,me-3,me-2,me-1);te(ge[0]),te(ge[1]),te(ge[3]),te(ge[1]),te(ge[2]),te(ge[3])}function Z(ie){o.push(a[ie*3+0]),o.push(a[ie*3+1]),o.push(a[ie*3+2])}function te(ie){r.push(ie.x),r.push(ie.y)}}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}toJSON(){let e=super.toJSON(),t=this.parameters.shapes,n=this.parameters.options;return xFo(t,n,e)}static fromJSON(e,t){let n=[];for(let r=0,i=e.shapes.length;r<i;r++){let s=t[e.shapes[r]];n.push(s)}let o=e.options.extrudePath;if(o!==void 0)e.options.extrudePath=new rOe[o.type]().fromJSON(o);return new rxe(n,e.options)}}var yFo={generateTopUV:function(e,t,n,o,r){let i=t[n*3],s=t[n*3+1],a=t[o*3],c=t[o*3+1],l=t[r*3],h=t[r*3+1];return[new go(i,s),new go(a,c),new go(l,h)]},generateSideWallUV:function(e,t,n,o,r,i){let s=t[n*3],a=t[n*3+1],c=t[n*3+2],l=t[o*3],h=t[o*3+1],d=t[o*3+2],u=t[r*3],_=t[r*3+1],p=t[r*3+2],m=t[i*3],A=t[i*3+1],g=t[i*3+2];if(Math.abs(a-h)<Math.abs(s-l))return[new go(s,1-c),new go(l,1-d),new go(u,1-p),new go(m,1-g)];else return[new go(a,1-c),new go(h,1-d),new go(_,1-p),new go(A,1-g)]}};function xFo(e,t,n){if(n.shapes=[],Array.isArray(e))for(let o=0,r=e.length;o<r;o++){let i=e[o];n.shapes.push(i.uuid)}else n.shapes.push(e.uuid);if(n.options=Object.assign({},t),t.extrudePath!==void 0)n.options.extrudePath=t.extrudePath.toJSON();return n}class YM extends ha{constructor(e=1,t=32,n=16,o=0,r=Math.PI*2,i=0,s=Math.PI){super();this.type="SphereGeometry",this.parameters={radius:e,widthSegments:t,heightSegments:n,phiStart:o,phiLength:r,thetaStart:i,thetaLength:s},t=Math.max(3,Math.floor(t)),n=Math.max(2,Math.floor(n));let a=Math.min(i+s,Math.PI),c=0,l=[],h=new Dt,d=new Dt,u=[],_=[],p=[],m=[];for(let A=0;A<=n;A++){let g=[],f=A/n,y=0;if(A===0&&i===0)y=0.5/t;else if(A===n&&a===Math.PI)y=-0.5/t;for(let x=0;x<=t;x++){let C=x/t;h.x=-e*Math.cos(o+C*r)*Math.sin(i+f*s),h.y=e*Math.cos(i+f*s),h.z=e*Math.sin(o+C*r)*Math.sin(i+f*s),_.push(h.x,h.y,h.z),d.copy(h).normalize(),p.push(d.x,d.y,d.z),m.push(C+y,1-f),g.push(c++)}l.push(g)}for(let A=0;A<n;A++)for(let g=0;g<t;g++){let f=l[A][g+1],y=l[A][g],x=l[A+1][g],C=l[A+1][g+1];if(A!==0||i>0)u.push(f,y,C);if(A!==n-1||a<Math.PI)u.push(y,x,C)}this.setIndex(u),this.setAttribute("position",new jr(_,3)),this.setAttribute("normal",new jr(p,3)),this.setAttribute("uv",new jr(m,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new YM(e.radius,e.widthSegments,e.heightSegments,e.phiStart,e.phiLength,e.thetaStart,e.thetaLength)}}class Ls extends cA{constructor(e){super();this.isMeshStandardMaterial=!0,this.defines={STANDARD:""},this.type="MeshStandardMaterial",this.color=new Do(16777215),this.roughness=1,this.metalness=0,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Do(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new go(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.roughnessMap=null,this.metalnessMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new aA,this.envMapIntensity=1,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.defines={STANDARD:""},this.color.copy(e.color),this.roughness=e.roughness,this.metalness=e.metalness,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.roughnessMap=e.roughnessMap,this.metalnessMap=e.metalnessMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.envMapIntensity=e.envMapIntensity,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class hA extends Ls{constructor(e){super();this.isMeshPhysicalMaterial=!0,this.defines={STANDARD:"",PHYSICAL:""},this.type="MeshPhysicalMaterial",this.anisotropyRotation=0,this.anisotropyMap=null,this.clearcoatMap=null,this.clearcoatRoughness=0,this.clearcoatRoughnessMap=null,this.clearcoatNormalScale=new go(1,1),this.clearcoatNormalMap=null,this.ior=1.5,Object.defineProperty(this,"reflectivity",{get:function(){return ng(2.5*(this.ior-1)/(this.ior+1),0,1)},set:function(t){this.ior=(1+0.4*t)/(1-0.4*t)}}),this.iridescenceMap=null,this.iridescenceIOR=1.3,this.iridescenceThicknessRange=[100,400],this.iridescenceThicknessMap=null,this.sheenColor=new Do(0),this.sheenColorMap=null,this.sheenRoughness=1,this.sheenRoughnessMap=null,this.transmissionMap=null,this.thickness=0,this.thicknessMap=null,this.attenuationDistance=1/0,this.attenuationColor=new Do(1,1,1),this.specularIntensity=1,this.specularIntensityMap=null,this.specularColor=new Do(1,1,1),this.specularColorMap=null,this._anisotropy=0,this._clearcoat=0,this._dispersion=0,this._iridescence=0,this._sheen=0,this._transmission=0,this.setValues(e)}get anisotropy(){return this._anisotropy}set anisotropy(e){if(this._anisotropy>0!==e>0)this.version++;this._anisotropy=e}get clearcoat(){return this._clearcoat}set clearcoat(e){if(this._clearcoat>0!==e>0)this.version++;this._clearcoat=e}get iridescence(){return this._iridescence}set iridescence(e){if(this._iridescence>0!==e>0)this.version++;this._iridescence=e}get dispersion(){return this._dispersion}set dispersion(e){if(this._dispersion>0!==e>0)this.version++;this._dispersion=e}get sheen(){return this._sheen}set sheen(e){if(this._sheen>0!==e>0)this.version++;this._sheen=e}get transmission(){return this._transmission}set transmission(e){if(this._transmission>0!==e>0)this.version++;this._transmission=e}copy(e){return super.copy(e),this.defines={STANDARD:"",PHYSICAL:""},this.anisotropy=e.anisotropy,this.anisotropyRotation=e.anisotropyRotation,this.anisotropyMap=e.anisotropyMap,this.clearcoat=e.clearcoat,this.clearcoatMap=e.clearcoatMap,this.clearcoatRoughness=e.clearcoatRoughness,this.clearcoatRoughnessMap=e.clearcoatRoughnessMap,this.clearcoatNormalMap=e.clearcoatNormalMap,this.clearcoatNormalScale.copy(e.clearcoatNormalScale),this.dispersion=e.dispersion,this.ior=e.ior,this.iridescence=e.iridescence,this.iridescenceMap=e.iridescenceMap,this.iridescenceIOR=e.iridescenceIOR,this.iridescenceThicknessRange=[...e.iridescenceThicknessRange],this.iridescenceThicknessMap=e.iridescenceThicknessMap,this.sheen=e.sheen,this.sheenColor.copy(e.sheenColor),this.sheenColorMap=e.sheenColorMap,this.sheenRoughness=e.sheenRoughness,this.sheenRoughnessMap=e.sheenRoughnessMap,this.transmission=e.transmission,this.transmissionMap=e.transmissionMap,this.thickness=e.thickness,this.thicknessMap=e.thicknessMap,this.attenuationDistance=e.attenuationDistance,this.attenuationColor.copy(e.attenuationColor),this.specularIntensity=e.specularIntensity,this.specularIntensityMap=e.specularIntensityMap,this.specularColor.copy(e.specularColor),this.specularColorMap=e.specularColorMap,this}}class Pz extends cA{constructor(e){super();this.isMeshPhongMaterial=!0,this.type="MeshPhongMaterial",this.color=new Do(16777215),this.specular=new Do(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Do(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new go(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new aA,this.combine=0,this.reflectivity=1,this.refractionRatio=0.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.specular.copy(e.specular),this.shininess=e.shininess,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}function Nye(e,t,n){if(!e||!n&&e.constructor===t)return e;if(typeof t.BYTES_PER_ELEMENT==="number")return new t(e);return Array.prototype.slice.call(e)}function CFo(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function bFo(e){function t(r,i){return e[r]-e[i]}let n=e.length,o=Array(n);for(let r=0;r!==n;++r)o[r]=r;return o.sort(t),o}function XPt(e,t,n){let o=e.length,r=new e.constructor(o);for(let i=0,s=0;s!==o;++i){let a=n[i]*t;for(let c=0;c!==t;++c)r[s++]=e[a+c]}return r}function kEt(e,t,n,o){let r=1,i=e[0];while(i!==void 0&&i[o]===void 0)i=e[r++];if(i===void 0)return;let s=i[o];if(s===void 0)return;if(Array.isArray(s))do{if(s=i[o],s!==void 0)t.push(i.time),n.push.apply(n,s);i=e[r++]}while(i!==void 0);else if(s.toArray!==void 0)do{if(s=i[o],s!==void 0)t.push(i.time),s.toArray(n,n.length);i=e[r++]}while(i!==void 0);else do{if(s=i[o],s!==void 0)t.push(i.time),n.push(s);i=e[r++]}while(i!==void 0)}class Ez{constructor(e,t,n,o){this.parameterPositions=e,this._cachedIndex=0,this.resultBuffer=o!==void 0?o:new t.constructor(n),this.sampleValues=t,this.valueSize=n,this.settings=null,this.DefaultSettings_={}}evaluate(e){let t=this.parameterPositions,n=this._cachedIndex,o=t[n],r=t[n-1];e:{t:{let i;n:{o:if(!(e<o)){for(let s=n+2;;){if(o===void 0){if(e<r)break o;return n=t.length,this._cachedIndex=n,this.copySampleValue_(n-1)}if(n===s)break;if(r=o,o=t[++n],e<o)break t}i=t.length;break n}if(!(e>=r)){let s=t[1];if(e<s)n=2,r=s;for(let a=n-2;;){if(r===void 0)return this._cachedIndex=0,this.copySampleValue_(0);if(n===a)break;if(o=r,r=t[--n-1],e>=r)break t}i=n,n=0;break n}break e}while(n<i){let s=n+i>>>1;if(e<t[s])i=s;else n=s+1}if(o=t[n],r=t[n-1],r===void 0)return this._cachedIndex=0,this.copySampleValue_(0);if(o===void 0)return n=t.length,this._cachedIndex=n,this.copySampleValue_(n-1)}this._cachedIndex=n,this.intervalChanged_(n,r,o)}return this.interpolate_(n,r,e,o)}getSettings_(){return this.settings||this.DefaultSettings_}copySampleValue_(e){let t=this.resultBuffer,n=this.sampleValues,o=this.valueSize,r=e*o;for(let i=0;i!==o;++i)t[i]=n[r+i];return t}interpolate_(){throw Error("call to abstract method")}intervalChanged_(){}}class LEt extends Ez{constructor(e,t,n,o){super(e,t,n,o);this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0,this.DefaultSettings_={endingStart:2400,endingEnd:2400}}intervalChanged_(e,t,n){let o=this.parameterPositions,r=e-2,i=e+1,s=o[r],a=o[i];if(s===void 0)switch(this.getSettings_().endingStart){case 2401:r=e,s=2*t-n;break;case 2402:r=o.length-2,s=t+o[r]-o[r+1];break;default:r=e,s=n}if(a===void 0)switch(this.getSettings_().endingEnd){case 2401:i=e,a=2*n-t;break;case 2402:i=1,a=n+o[1]-o[0];break;default:i=e-1,a=t}let c=(n-t)*0.5,l=this.valueSize;this._weightPrev=c/(t-s),this._weightNext=c/(a-n),this._offsetPrev=r*l,this._offsetNext=i*l}interpolate_(e,t,n,o){let r=this.resultBuffer,i=this.sampleValues,s=this.valueSize,a=e*s,c=a-s,l=this._offsetPrev,h=this._offsetNext,d=this._weightPrev,u=this._weightNext,_=(n-t)/(o-t),p=_*_,m=p*_,A=-d*m+2*d*p-d*_,g=(1+d)*m+(-1.5-2*d)*p+(-0.5+d)*_+1,f=(-1-u)*m+(1.5+u)*p+0.5*_,y=u*m-u*p;for(let x=0;x!==s;++x)r[x]=A*i[l+x]+g*i[c+x]+f*i[a+x]+y*i[h+x];return r}}class HEt extends Ez{constructor(e,t,n,o){super(e,t,n,o)}interpolate_(e,t,n,o){let r=this.resultBuffer,i=this.sampleValues,s=this.valueSize,a=e*s,c=a-s,l=(n-t)/(o-t),h=1-l;for(let d=0;d!==s;++d)r[d]=i[c+d]*h+i[a+d]*l;return r}}class FEt extends Ez{constructor(e,t,n,o){super(e,t,n,o)}interpolate_(e){return this.copySampleValue_(e-1)}}class VI{constructor(e,t,n,o){if(e===void 0)throw Error("THREE.KeyframeTrack: track name is undefined");if(t===void 0||t.length===0)throw Error("THREE.KeyframeTrack: no keyframes in track named "+e);this.name=e,this.times=Nye(t,this.TimeBufferType),this.values=Nye(n,this.ValueBufferType),this.setInterpolation(o||this.DefaultInterpolation)}static toJSON(e){let t=e.constructor,n;if(t.toJSON!==this.toJSON)n=t.toJSON(e);else{n={name:e.name,times:Nye(e.times,Array),values:Nye(e.values,Array)};let o=e.getInterpolation();if(o!==e.DefaultInterpolation)n.interpolation=o}return n.type=e.ValueTypeName,n}InterpolantFactoryMethodDiscrete(e){return new FEt(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodLinear(e){return new HEt(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodSmooth(e){return new LEt(this.times,this.values,this.getValueSize(),e)}setInterpolation(e){let t;switch(e){case 2300:t=this.InterpolantFactoryMethodDiscrete;break;case 2301:t=this.InterpolantFactoryMethodLinear;break;case 2302:t=this.InterpolantFactoryMethodSmooth;break}if(t===void 0){let n="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(this.createInterpolant===void 0)if(e!==this.DefaultInterpolation)this.setInterpolation(this.DefaultInterpolation);else throw Error(n);return console.warn("THREE.KeyframeTrack:",n),this}return this.createInterpolant=t,this}getInterpolation(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return 2300;case this.InterpolantFactoryMethodLinear:return 2301;case this.InterpolantFactoryMethodSmooth:return 2302}}getValueSize(){return this.values.length/this.times.length}shift(e){if(e!==0){let t=this.times;for(let n=0,o=t.length;n!==o;++n)t[n]+=e}return this}scale(e){if(e!==1){let t=this.times;for(let n=0,o=t.length;n!==o;++n)t[n]*=e}return this}trim(e,t){let n=this.times,o=n.length,r=0,i=o-1;while(r!==o&&n[r]<e)++r;while(i!==-1&&n[i]>t)--i;if(++i,r!==0||i!==o){if(r>=i)i=Math.max(i,1),r=i-1;let s=this.getValueSize();this.times=n.slice(r,i),this.values=this.values.slice(r*s,i*s)}return this}validate(){let e=!0,t=this.getValueSize();if(t-Math.floor(t)!==0)console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1;let n=this.times,o=this.values,r=n.length;if(r===0)console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1;let i=null;for(let s=0;s!==r;s++){let a=n[s];if(typeof a==="number"&&isNaN(a)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,s,a),e=!1;break}if(i!==null&&i>a){console.error("THREE.KeyframeTrack: Out of order keys.",this,s,a,i),e=!1;break}i=a}if(o!==void 0){if(CFo(o))for(let s=0,a=o.length;s!==a;++s){let c=o[s];if(isNaN(c)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,s,c),e=!1;break}}}return e}optimize(){let e=this.times.slice(),t=this.values.slice(),n=this.getValueSize(),o=this.getInterpolation()===2302,r=e.length-1,i=1;for(let s=1;s<r;++s){let a=!1,c=e[s],l=e[s+1];if(c!==l&&(s!==1||c!==e[0]))if(!o){let h=s*n,d=h-n,u=h+n;for(let _=0;_!==n;++_){let p=t[h+_];if(p!==t[d+_]||p!==t[u+_]){a=!0;break}}}else a=!0;if(a){if(s!==i){e[i]=e[s];let h=s*n,d=i*n;for(let u=0;u!==n;++u)t[d+u]=t[h+u]}++i}}if(r>0){e[i]=e[r];for(let s=r*n,a=i*n,c=0;c!==n;++c)t[a+c]=t[s+c];++i}if(i!==e.length)this.times=e.slice(0,i),this.values=t.slice(0,i*n);else this.times=e,this.values=t;return this}clone(){let e=this.times.slice(),t=this.values.slice(),o=new this.constructor(this.name,e,t);return o.createInterpolant=this.createInterpolant,o}}VI.prototype.TimeBufferType=Float32Array;VI.prototype.ValueBufferType=Float32Array;VI.prototype.DefaultInterpolation=2301;class Mz extends VI{constructor(e,t,n){super(e,t,n)}}Mz.prototype.ValueTypeName="bool";Mz.prototype.ValueBufferType=Array;Mz.prototype.DefaultInterpolation=2300;Mz.prototype.InterpolantFactoryMethodLinear=void 0;Mz.prototype.InterpolantFactoryMethodSmooth=void 0;class MOe extends VI{}MOe.prototype.ValueTypeName="color";class ZN extends VI{}ZN.prototype.ValueTypeName="number";class zEt extends Ez{constructor(e,t,n,o){super(e,t,n,o)}interpolate_(e,t,n,o){let r=this.resultBuffer,i=this.sampleValues,s=this.valueSize,a=(n-t)/(o-t),c=e*s;for(let l=c+s;c!==l;c+=4)hm.slerpFlat(r,0,i,c-s,i,c,a);return r}}class oR extends VI{InterpolantFactoryMethodLinear(e){return new zEt(this.times,this.values,this.getValueSize(),e)}}oR.prototype.ValueTypeName="quaternion";oR.prototype.InterpolantFactoryMethodSmooth=void 0;class wz extends VI{constructor(e,t,n){super(e,t,n)}}wz.prototype.ValueTypeName="string";wz.prototype.ValueBufferType=Array;wz.prototype.DefaultInterpolation=2300;wz.prototype.InterpolantFactoryMethodLinear=void 0;wz.prototype.InterpolantFactoryMethodSmooth=void 0;class eR extends VI{}eR.prototype.ValueTypeName="vector";class wOe{constructor(e="",t=-1,n=[],o=2500){if(this.name=e,this.tracks=n,this.duration=t,this.blendMode=o,this.uuid=OC(),this.duration<0)this.resetDuration()}static parse(e){let t=[],n=e.tracks,o=1/(e.fps||1);for(let i=0,s=n.length;i!==s;++i)t.push(vFo(n[i]).scale(o));let r=new this(e.name,e.duration,t,e.blendMode);return r.uuid=e.uuid,r}static toJSON(e){let t=[],n=e.tracks,o={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid,blendMode:e.blendMode};for(let r=0,i=n.length;r!==i;++r)t.push(VI.toJSON(n[r]));return o}static CreateFromMorphTargetSequence(e,t,n,o){let r=t.length,i=[];for(let s=0;s<r;s++){let a=[],c=[];a.push((s+r-1)%r,s,(s+1)%r),c.push(0,1,0);let l=bFo(a);if(a=XPt(a,1,l),c=XPt(c,1,l),!o&&a[0]===0)a.push(r),c.push(c[0]);i.push(new ZN(".morphTargetInfluences["+t[s].name+"]",a,c).scale(1/n))}return new this(e,-1,i)}static findByName(e,t){let n=e;if(!Array.isArray(e)){let o=e;n=o.geometry&&o.geometry.animations||o.animations}for(let o=0;o<n.length;o++)if(n[o].name===t)return n[o];return null}static CreateClipsFromMorphTargetSequences(e,t,n){let o={},r=/^([\w-]*?)([\d]+)$/;for(let s=0,a=e.length;s<a;s++){let c=e[s],l=c.name.match(r);if(l&&l.length>1){let h=l[1],d=o[h];if(!d)o[h]=d=[];d.push(c)}}let i=[];for(let s in o)i.push(this.CreateFromMorphTargetSequence(s,o[s],t,n));return i}static parseAnimation(e,t){if(!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;let n=function(h,d,u,_,p){if(u.length!==0){let m=[],A=[];if(kEt(u,m,A,_),m.length!==0)p.push(new h(d,m,A))}},o=[],r=e.name||"default",i=e.fps||30,s=e.blendMode,a=e.length||-1,c=e.hierarchy||[];for(let h=0;h<c.length;h++){let d=c[h].keys;if(!d||d.length===0)continue;if(d[0].morphTargets){let u={},_;for(_=0;_<d.length;_++)if(d[_].morphTargets)for(let p=0;p<d[_].morphTargets.length;p++)u[d[_].morphTargets[p]]=-1;for(let p in u){let m=[],A=[];for(let g=0;g!==d[_].morphTargets.length;++g){let f=d[_];m.push(f.time),A.push(f.morphTarget===p?1:0)}o.push(new ZN(".morphTargetInfluence["+p+"]",m,A))}a=u.length*i}else{let u=".bones["+t[h].name+"]";n(eR,u+".position",d,"pos",o),n(oR,u+".quaternion",d,"rot",o),n(eR,u+".scale",d,"scl",o)}}if(o.length===0)return null;return new this(r,a,o,s)}resetDuration(){let e=this.tracks,t=0;for(let n=0,o=e.length;n!==o;++n){let r=this.tracks[n];t=Math.max(t,r.times[r.times.length-1])}return this.duration=t,this}trim(){for(let e=0;e<this.tracks.length;e++)this.tracks[e].trim(0,this.duration);return this}validate(){let e=!0;for(let t=0;t<this.tracks.length;t++)e=e&&this.tracks[t].validate();return e}optimize(){for(let e=0;e<this.tracks.length;e++)this.tracks[e].optimize();return this}clone(){let e=[];for(let t=0;t<this.tracks.length;t++)e.push(this.tracks[t].clone());return new this.constructor(this.name,this.duration,e,this.blendMode)}toJSON(){return this.constructor.toJSON(this)}}function IFo(e){switch(e.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return ZN;case"vector":case"vector2":case"vector3":case"vector4":return eR;case"color":return MOe;case"quaternion":return oR;case"bool":case"boolean":return Mz;case"string":return wz}throw Error("THREE.KeyframeTrack: Unsupported typeName: "+e)}function vFo(e){if(e.type===void 0)throw Error("THREE.KeyframeTrack: track type undefined, can not parse");let t=IFo(e.type);if(e.times===void 0){let n=[],o=[];kEt(e.keys,n,o,"value"),e.times=n,e.values=o}if(t.parse!==void 0)return t.parse(e);else return new t(e.name,e.times,e.values,e.interpolation)}var qN={enabled:!1,files:{},add:function(e,t){if(this.enabled===!1)return;this.files[e]=t},get:function(e){if(this.enabled===!1)return;return this.files[e]},remove:function(e){delete this.files[e]},clear:function(){this.files={}}};class OEt{constructor(e,t,n){let o=this,r=!1,i=0,s=0,a=void 0,c=[];this.onStart=void 0,this.onLoad=e,this.onProgress=t,this.onError=n,this.itemStart=function(l){if(s++,r===!1){if(o.onStart!==void 0)o.onStart(l,i,s)}r=!0},this.itemEnd=function(l){if(i++,o.onProgress!==void 0)o.onProgress(l,i,s);if(i===s){if(r=!1,o.onLoad!==void 0)o.onLoad()}},this.itemError=function(l){if(o.onError!==void 0)o.onError(l)},this.resolveURL=function(l){if(a)return a(l);return l},this.setURLModifier=function(l){return a=l,this},this.addHandler=function(l,h){return c.push(l,h),this},this.removeHandler=function(l){let h=c.indexOf(l);if(h!==-1)c.splice(h,2);return this},this.getHandler=function(l){for(let h=0,d=c.length;h<d;h+=2){let u=c[h],_=c[h+1];if(u.global)u.lastIndex=0;if(u.test(l))return _}return null}}}var BOe=new OEt;class S2{constructor(e){this.manager=e!==void 0?e:BOe,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={}}load(){}loadAsync(e,t){let n=this;return new Promise(function(o,r){n.load(e,o,t,r)})}parse(){}setCrossOrigin(e){return this.crossOrigin=e,this}setWithCredentials(e){return this.withCredentials=e,this}setPath(e){return this.path=e,this}setResourcePath(e){return this.resourcePath=e,this}setRequestHeader(e){return this.requestHeader=e,this}}S2.DEFAULT_MATERIAL_NAME="__DEFAULT";var HM={};class VEt extends Error{constructor(e,t){super(e);this.response=t}}class GC extends S2{constructor(e){super(e)}load(e,t,n,o){if(e===void 0)e="";if(this.path!==void 0)e=this.path+e;e=this.manager.resolveURL(e);let r=qN.get(e);if(r!==void 0)return this.manager.itemStart(e),setTimeout(()=>{if(t)t(r);this.manager.itemEnd(e)},0),r;if(HM[e]!==void 0){HM[e].push({onLoad:t,onProgress:n,onError:o});return}HM[e]=[],HM[e].push({onLoad:t,onProgress:n,onError:o});let i=new Request(e,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),s=this.mimeType,a=this.responseType;fetch(i).then((c)=>{if(c.status===200||c.status===0){if(c.status===0)console.warn("THREE.FileLoader: HTTP Status 0 received.");if(typeof ReadableStream>"u"||c.body===void 0||c.body.getReader===void 0)return c;let l=HM[e],h=c.body.getReader(),d=c.headers.get("X-File-Size")||c.headers.get("Content-Length"),u=d?parseInt(d):0,_=u!==0,p=0,m=new ReadableStream({start(A){g();function g(){h.read().then(({done:f,value:y})=>{if(f)A.close();else{p+=y.byteLength;let x=new ProgressEvent("progress",{lengthComputable:_,loaded:p,total:u});for(let C=0,b=l.length;C<b;C++){let I=l[C];if(I.onProgress)I.onProgress(x)}A.enqueue(y),g()}},(f)=>{A.error(f)})}}});return new Response(m)}else throw new VEt(`fetch for "${c.url}" responded with ${c.status}: ${c.statusText}`,c)}).then((c)=>{switch(a){case"arraybuffer":return c.arrayBuffer();case"blob":return c.blob();case"document":return c.text().then((l)=>new DOMParser().parseFromString(l,s));case"json":return c.json();default:if(s===void 0)return c.text();else{let h=/charset="?([^;"\s]*)"?/i.exec(s),d=h&&h[1]?h[1].toLowerCase():void 0,u=new TextDecoder(d);return c.arrayBuffer().then((_)=>u.decode(_))}}}).then((c)=>{qN.add(e,c);let l=HM[e];delete HM[e];for(let h=0,d=l.length;h<d;h++){let u=l[h];if(u.onLoad)u.onLoad(c)}}).catch((c)=>{let l=HM[e];if(l===void 0)throw this.manager.itemError(e),c;delete HM[e];for(let h=0,d=l.length;h<d;h++){let u=l[h];if(u.onError)u.onError(c)}this.manager.itemError(e)}).finally(()=>{this.manager.itemEnd(e)}),this.manager.itemStart(e)}setResponseType(e){return this.responseType=e,this}setMimeType(e){return this.mimeType=e,this}}class YEt extends S2{constructor(e){super(e)}load(e,t,n,o){if(this.path!==void 0)e=this.path+e;e=this.manager.resolveURL(e);let r=this,i=qN.get(e);if(i!==void 0)return r.manager.itemStart(e),setTimeout(function(){if(t)t(i);r.manager.itemEnd(e)},0),i;let s=Nie("img");function a(){if(l(),qN.add(e,this),t)t(this);r.manager.itemEnd(e)}function c(h){if(l(),o)o(h);r.manager.itemError(e),r.manager.itemEnd(e)}function l(){s.removeEventListener("load",a,!1),s.removeEventListener("error",c,!1)}if(s.addEventListener("load",a,!1),s.addEventListener("error",c,!1),e.slice(0,5)!=="data:"){if(this.crossOrigin!==void 0)s.crossOrigin=this.crossOrigin}return r.manager.itemStart(e),s.src=e,s}}class Bz extends S2{constructor(e){super(e)}load(e,t,n,o){let r=new Bl,i=new YEt(this.manager);return i.setCrossOrigin(this.crossOrigin),i.setPath(this.path),i.load(e,function(s){if(r.image=s,r.needsUpdate=!0,t!==void 0)t(r)},n,o),r}}class jj extends nl{constructor(e,t=1){super();this.isLight=!0,this.type="Light",this.color=new Do(e),this.intensity=t}dispose(){}copy(e,t){return super.copy(e,t),this.color.copy(e.color),this.intensity=e.intensity,this}toJSON(e){let t=super.toJSON(e);if(t.object.color=this.color.getHex(),t.object.intensity=this.intensity,this.groundColor!==void 0)t.object.groundColor=this.groundColor.getHex();if(this.distance!==void 0)t.object.distance=this.distance;if(this.angle!==void 0)t.object.angle=this.angle;if(this.decay!==void 0)t.object.decay=this.decay;if(this.penumbra!==void 0)t.object.penumbra=this.penumbra;if(this.shadow!==void 0)t.object.shadow=this.shadow.toJSON();return t}}class TOe extends jj{constructor(e,t,n){super(e,n);this.isHemisphereLight=!0,this.type="HemisphereLight",this.position.copy(nl.DEFAULT_UP),this.updateMatrix(),this.groundColor=new Do(t)}copy(e,t){return super.copy(e,t),this.groundColor.copy(e.groundColor),this}}var eOe=new Fi,jPt=new Dt,KPt=new Dt;class ixe{constructor(e){this.camera=e,this.bias=0,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new go(512,512),this.map=null,this.mapPass=null,this.matrix=new Fi,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new Wye,this._frameExtents=new go(1,1),this._viewportCount=1,this._viewports=[new Ah(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(e){let t=this.camera,n=this.matrix;jPt.setFromMatrixPosition(e.matrixWorld),t.position.copy(jPt),KPt.setFromMatrixPosition(e.target.matrixWorld),t.lookAt(KPt),t.updateMatrixWorld(),eOe.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),this._frustum.setFromProjectionMatrix(eOe),n.set(0.5,0,0,0.5,0,0.5,0,0.5,0,0,0.5,0.5,0,0,0,1),n.multiply(eOe)}getViewport(e){return this._viewports[e]}getFrameExtents(){return this._frameExtents}dispose(){if(this.map)this.map.dispose();if(this.mapPass)this.mapPass.dispose()}copy(e){return this.camera=e.camera.clone(),this.bias=e.bias,this.radius=e.radius,this.mapSize.copy(e.mapSize),this}clone(){return new this.constructor().copy(this)}toJSON(){let e={};if(this.bias!==0)e.bias=this.bias;if(this.normalBias!==0)e.normalBias=this.normalBias;if(this.radius!==1)e.radius=this.radius;if(this.mapSize.x!==512||this.mapSize.y!==512)e.mapSize=this.mapSize.toArray();return e.camera=this.camera.toJSON(!1).object,delete e.camera.matrix,e}}class GEt extends ixe{constructor(){super(new wl(50,1,0.5,500));this.isSpotLightShadow=!0,this.focus=1}updateMatrices(e){let t=this.camera,n=Gj*2*e.angle*this.focus,o=this.mapSize.width/this.mapSize.height,r=e.distance||t.far;if(n!==t.fov||o!==t.aspect||r!==t.far)t.fov=n,t.aspect=o,t.far=r,t.updateProjectionMatrix();super.updateMatrices(e)}copy(e){return super.copy(e),this.focus=e.focus,this}}class DOe extends jj{constructor(e,t,n=0,o=Math.PI/3,r=0,i=2){super(e,t);this.isSpotLight=!0,this.type="SpotLight",this.position.copy(nl.DEFAULT_UP),this.updateMatrix(),this.target=new nl,this.distance=n,this.angle=o,this.penumbra=r,this.decay=i,this.map=null,this.shadow=new GEt}get power(){return this.intensity*Math.PI}set power(e){this.intensity=e/Math.PI}dispose(){this.shadow.dispose()}copy(e,t){return super.copy(e,t),this.distance=e.distance,this.angle=e.angle,this.penumbra=e.penumbra,this.decay=e.decay,this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}var $Pt=new Fi,Eie=new Dt,tOe=new Dt;class UEt extends ixe{constructor(){super(new wl(90,1,0.5,500));this.isPointLightShadow=!0,this._frameExtents=new go(4,2),this._viewportCount=6,this._viewports=[new Ah(2,1,1,1),new Ah(0,1,1,1),new Ah(3,1,1,1),new Ah(1,1,1,1),new Ah(3,0,1,1),new Ah(1,0,1,1)],this._cubeDirections=[new Dt(1,0,0),new Dt(-1,0,0),new Dt(0,0,1),new Dt(0,0,-1),new Dt(0,1,0),new Dt(0,-1,0)],this._cubeUps=[new Dt(0,1,0),new Dt(0,1,0),new Dt(0,1,0),new Dt(0,1,0),new Dt(0,0,1),new Dt(0,0,-1)]}updateMatrices(e,t=0){let n=this.camera,o=this.matrix,r=e.distance||n.far;if(r!==n.far)n.far=r,n.updateProjectionMatrix();Eie.setFromMatrixPosition(e.matrixWorld),n.position.copy(Eie),tOe.copy(n.position),tOe.add(this._cubeDirections[t]),n.up.copy(this._cubeUps[t]),n.lookAt(tOe),n.updateMatrixWorld(),o.makeTranslation(-Eie.x,-Eie.y,-Eie.z),$Pt.multiplyMatrices(n.projectionMatrix,n.matrixWorldInverse),this._frustum.setFromProjectionMatrix($Pt)}}class Wie extends jj{constructor(e,t,n=0,o=2){super(e,t);this.isPointLight=!0,this.type="PointLight",this.distance=n,this.decay=o,this.shadow=new UEt}get power(){return this.intensity*4*Math.PI}set power(e){this.intensity=e/(4*Math.PI)}dispose(){this.shadow.dispose()}copy(e,t){return super.copy(e,t),this.distance=e.distance,this.decay=e.decay,this.shadow=e.shadow.clone(),this}}class WEt extends ixe{constructor(){super(new u7(-5,5,5,-5,0.5,500));this.isDirectionalLightShadow=!0}}class Xie extends jj{constructor(e,t){super(e,t);this.isDirectionalLight=!0,this.type="DirectionalLight",this.position.copy(nl.DEFAULT_UP),this.updateMatrix(),this.target=new nl,this.shadow=new WEt}dispose(){this.shadow.dispose()}copy(e){return super.copy(e),this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}class jie extends jj{constructor(e,t){super(e,t);this.isAmbientLight=!0,this.type="AmbientLight"}}class YI{static decodeText(e){if(console.warn("THREE.LoaderUtils: decodeText() has been deprecated with r165 and will be removed with r175. Use TextDecoder instead."),typeof TextDecoder<"u")return new TextDecoder().decode(e);let t="";for(let n=0,o=e.length;n<o;n++)t+=String.fromCharCode(e[n]);try{return decodeURIComponent(escape(t))}catch(n){return t}}static extractUrlBase(e){let t=e.lastIndexOf("/");if(t===-1)return"./";return e.slice(0,t+1)}static resolveURL(e,t){if(typeof e!=="string"||e==="")return"";if(/^https?:\/\//i.test(t)&&/^\//.test(e))t=t.replace(/(^https?:\/\/[^\/]+).*/i,"$1");if(/^(https?:)?\/\//i.test(e))return e;if(/^data:.*,.*$/i.test(e))return e;if(/^blob:.*$/i.test(e))return e;return t+e}}class NOe extends ha{constructor(){super();this.isInstancedBufferGeometry=!0,this.type="InstancedBufferGeometry",this.instanceCount=1/0}copy(e){return super.copy(e),this.instanceCount=e.instanceCount,this}toJSON(){let e=super.toJSON();return e.instanceCount=this.instanceCount,e.isInstancedBufferGeometry=!0,e}}class ROe extends S2{constructor(e){super(e);if(this.isImageBitmapLoader=!0,typeof createImageBitmap>"u")console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported.");if(typeof fetch>"u")console.warn("THREE.ImageBitmapLoader: fetch() not supported.");this.options={premultiplyAlpha:"none"}}setOptions(e){return this.options=e,this}load(e,t,n,o){if(e===void 0)e="";if(this.path!==void 0)e=this.path+e;e=this.manager.resolveURL(e);let r=this,i=qN.get(e);if(i!==void 0){if(r.manager.itemStart(e),i.then){i.then((c)=>{if(t)t(c);r.manager.itemEnd(e)}).catch((c)=>{if(o)o(c)});return}return setTimeout(function(){if(t)t(i);r.manager.itemEnd(e)},0),i}let s={};s.credentials=this.crossOrigin==="anonymous"?"same-origin":"include",s.headers=this.requestHeader;let a=fetch(e,s).then(function(c){return c.blob()}).then(function(c){return createImageBitmap(c,Object.assign(r.options,{colorSpaceConversion:"none"}))}).then(function(c){if(qN.add(e,c),t)t(c);return r.manager.itemEnd(e),c}).catch(function(c){if(o)o(c);qN.remove(e),r.manager.itemError(e),r.manager.itemEnd(e)});qN.add(e,a),r.manager.itemStart(e)}}class QOe{constructor(e=!0){this.autoStart=e,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}start(){this.startTime=qPt(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0}stop(){this.getElapsedTime(),this.running=!1,this.autoStart=!1}getElapsedTime(){return this.getDelta(),this.elapsedTime}getDelta(){let e=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){let t=qPt();e=(t-this.oldTime)/1000,this.oldTime=t,this.elapsedTime+=e}return e}}function qPt(){return(typeof performance>"u"?Date:performance).now()}var kOe="\\[\\]\\.:\\/",SFo=new RegExp("["+kOe+"]","g"),LOe="[^"+kOe+"]",PFo="[^"+kOe.replace("\\.","")+"]",EFo=/((?:WC+[\/:])*)/.source.replace("WC",LOe),MFo=/(WCOD+)?/.source.replace("WCOD",PFo),wFo=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",LOe),BFo=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",LOe),TFo=new RegExp("^"+EFo+MFo+wFo+BFo+"$"),DFo=["material","materials","bones","map"];class XEt{constructor(e,t,n){let o=n||Gc.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,o)}getValue(e,t){this.bind();let n=this._targetGroup.nCachedObjects_,o=this._bindings[n];if(o!==void 0)o.getValue(e,t)}setValue(e,t){let n=this._bindings;for(let o=this._targetGroup.nCachedObjects_,r=n.length;o!==r;++o)n[o].setValue(e,t)}bind(){let e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].bind()}unbind(){let e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].unbind()}}class Gc{constructor(e,t,n){this.path=t,this.parsedPath=n||Gc.parseTrackName(t),this.node=Gc.findNode(e,this.parsedPath.nodeName),this.rootNode=e,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(e,t,n){if(!(e&&e.isAnimationObjectGroup))return new Gc(e,t,n);else return new Gc.Composite(e,t,n)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(SFo,"")}static parseTrackName(e){let t=TFo.exec(e);if(t===null)throw Error("PropertyBinding: Cannot parse trackName: "+e);let n={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},o=n.nodeName&&n.nodeName.lastIndexOf(".");if(o!==void 0&&o!==-1){let r=n.nodeName.substring(o+1);if(DFo.indexOf(r)!==-1)n.nodeName=n.nodeName.substring(0,o),n.objectName=r}if(n.propertyName===null||n.propertyName.length===0)throw Error("PropertyBinding: can not parse propertyName from trackName: "+e);return n}static findNode(e,t){if(t===void 0||t===""||t==="."||t===-1||t===e.name||t===e.uuid)return e;if(e.skeleton){let n=e.skeleton.getBoneByName(t);if(n!==void 0)return n}if(e.children){let n=function(r){for(let i=0;i<r.length;i++){let s=r[i];if(s.name===t||s.uuid===t)return s;let a=n(s.children);if(a)return a}return null},o=n(e.children);if(o)return o}return null}_getValue_unavailable(){}_setValue_unavailable(){}_getValue_direct(e,t){e[t]=this.targetObject[this.propertyName]}_getValue_array(e,t){let n=this.resolvedProperty;for(let o=0,r=n.length;o!==r;++o)e[t++]=n[o]}_getValue_arrayElement(e,t){e[t]=this.resolvedProperty[this.propertyIndex]}_getValue_toArray(e,t){this.resolvedProperty.toArray(e,t)}_setValue_direct(e,t){this.targetObject[this.propertyName]=e[t]}_setValue_direct_setNeedsUpdate(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.needsUpdate=!0}_setValue_direct_setMatrixWorldNeedsUpdate(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_array(e,t){let n=this.resolvedProperty;for(let o=0,r=n.length;o!==r;++o)n[o]=e[t++]}_setValue_array_setNeedsUpdate(e,t){let n=this.resolvedProperty;for(let o=0,r=n.length;o!==r;++o)n[o]=e[t++];this.targetObject.needsUpdate=!0}_setValue_array_setMatrixWorldNeedsUpdate(e,t){let n=this.resolvedProperty;for(let o=0,r=n.length;o!==r;++o)n[o]=e[t++];this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_arrayElement(e,t){this.resolvedProperty[this.propertyIndex]=e[t]}_setValue_arrayElement_setNeedsUpdate(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.needsUpdate=!0}_setValue_arrayElement_setMatrixWorldNeedsUpdate(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_fromArray(e,t){this.resolvedProperty.fromArray(e,t)}_setValue_fromArray_setNeedsUpdate(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.needsUpdate=!0}_setValue_fromArray_setMatrixWorldNeedsUpdate(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.matrixWorldNeedsUpdate=!0}_getValue_unbound(e,t){this.bind(),this.getValue(e,t)}_setValue_unbound(e,t){this.bind(),this.setValue(e,t)}bind(){let e=this.node,t=this.parsedPath,{objectName:n,propertyName:o,propertyIndex:r}=t;if(!e)e=Gc.findNode(this.rootNode,t.nodeName),this.node=e;if(this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,!e){console.warn("THREE.PropertyBinding: No target node found for track: "+this.path+".");return}if(n){let c=t.objectIndex;switch(n){case"materials":if(!e.material){console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);return}if(!e.material.materials){console.error("THREE.PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.",this);return}e=e.material.materials;break;case"bones":if(!e.skeleton){console.error("THREE.PropertyBinding: Can not bind to bones as node does not have a skeleton.",this);return}e=e.skeleton.bones;for(let l=0;l<e.length;l++)if(e[l].name===c){c=l;break}break;case"map":if("map"in e){e=e.map;break}if(!e.material){console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);return}if(!e.material.map){console.error("THREE.PropertyBinding: Can not bind to material.map as node.material does not have a map.",this);return}e=e.material.map;break;default:if(e[n]===void 0){console.error("THREE.PropertyBinding: Can not bind to objectName of node undefined.",this);return}e=e[n]}if(c!==void 0){if(e[c]===void 0){console.error("THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,e);return}e=e[c]}}let i=e[o];if(i===void 0){let c=t.nodeName;console.error("THREE.PropertyBinding: Trying to update property for track: "+c+"."+o+" but it wasn't found.",e);return}let s=this.Versioning.None;if(this.targetObject=e,e.needsUpdate!==void 0)s=this.Versioning.NeedsUpdate;else if(e.matrixWorldNeedsUpdate!==void 0)s=this.Versioning.MatrixWorldNeedsUpdate;let a=this.BindingType.Direct;if(r!==void 0){if(o==="morphTargetInfluences"){if(!e.geometry){console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.",this);return}if(!e.geometry.morphAttributes){console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.",this);return}if(e.morphTargetDictionary[r]!==void 0)r=e.morphTargetDictionary[r]}a=this.BindingType.ArrayElement,this.resolvedProperty=i,this.propertyIndex=r}else if(i.fromArray!==void 0&&i.toArray!==void 0)a=this.BindingType.HasFromToArray,this.resolvedProperty=i;else if(Array.isArray(i))a=this.BindingType.EntireArray,this.resolvedProperty=i;else this.propertyName=o;this.getValue=this.GetterByBindingType[a],this.setValue=this.SetterByBindingTypeAndVersioning[a][s]}unbind(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}}Gc.Composite=XEt;Gc.prototype.BindingType={Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3};Gc.prototype.Versioning={None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2};Gc.prototype.GetterByBindingType=[Gc.prototype._getValue_direct,Gc.prototype._getValue_array,Gc.prototype._getValue_arrayElement,Gc.prototype._getValue_toArray];Gc.prototype.SetterByBindingTypeAndVersioning=[[Gc.prototype._setValue_direct,Gc.prototype._setValue_direct_setNeedsUpdate,Gc.prototype._setValue_direct_setMatrixWorldNeedsUpdate],[Gc.prototype._setValue_array,Gc.prototype._setValue_array_setNeedsUpdate,Gc.prototype._setValue_array_setMatrixWorldNeedsUpdate],[Gc.prototype._setValue_arrayElement,Gc.prototype._setValue_arrayElement_setNeedsUpdate,Gc.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate],[Gc.prototype._setValue_fromArray,Gc.prototype._setValue_fromArray_setNeedsUpdate,Gc.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate]];var hys=new Float32Array(1);class sxe{constructor(e){this.value=e}clone(){return new sxe(this.value.clone===void 0?this.value:this.value.clone())}}var JPt=new Fi;class Kie{constructor(e,t,n=0,o=1/0){this.ray=new nR(e,t),this.near=n,this.far=o,this.camera=null,this.layers=new Uye,this.params={Mesh:{},Line:{threshold:1},LOD:{},Points:{threshold:1},Sprite:{}}}set(e,t){this.ray.set(e,t)}setFromCamera(e,t){if(t.isPerspectiveCamera)this.ray.origin.setFromMatrixPosition(t.matrixWorld),this.ray.direction.set(e.x,e.y,0.5).unproject(t).sub(this.ray.origin).normalize(),this.camera=t;else if(t.isOrthographicCamera)this.ray.origin.set(e.x,e.y,(t.near+t.far)/(t.near-t.far)).unproject(t),this.ray.direction.set(0,0,-1).transformDirection(t.matrixWorld),this.camera=t;else console.error("THREE.Raycaster: Unsupported camera type: "+t.type)}setFromXRController(e){return JPt.identity().extractRotation(e.matrixWorld),this.ray.origin.setFromMatrixPosition(e.matrixWorld),this.ray.direction.set(0,0,-1).applyMatrix4(JPt),this}intersectObject(e,t=!0,n=[]){return aOe(e,this,n,t),n.sort(ZPt),n}intersectObjects(e,t=!0,n=[]){for(let o=0,r=e.length;o<r;o++)aOe(e[o],this,n,t);return n.sort(ZPt),n}}function ZPt(e,t){return e.distance-t.distance}function aOe(e,t,n,o){let r=!0;if(e.layers.test(t.layers)){if(e.raycast(t,n)===!1)r=!1}if(r===!0&&o===!0){let i=e.children;for(let s=0,a=i.length;s<a;s++)aOe(i[s],t,n,!0)}}class axe{constructor(e=1,t=0,n=0){return this.radius=e,this.phi=t,this.theta=n,this}set(e,t,n){return this.radius=e,this.phi=t,this.theta=n,this}copy(e){return this.radius=e.radius,this.phi=e.phi,this.theta=e.theta,this}makeSafe(){return this.phi=Math.max(0.000001,Math.min(Math.PI-0.000001,this.phi)),this}setFromVector3(e){return this.setFromCartesianCoords(e.x,e.y,e.z)}setFromCartesianCoords(e,t,n){if(this.radius=Math.sqrt(e*e+t*t+n*n),this.radius===0)this.theta=0,this.phi=0;else this.theta=Math.atan2(e,n),this.phi=Math.acos(ng(t/this.radius,-1,1));return this}clone(){return new this.constructor().copy(this)}}if(typeof __THREE_DEVTOOLS__<"u")__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:"165"}}));if(typeof window<"u")if(window.__THREE__)console.warn("WARNING: Multiple instances of Three.js being imported.");else window.__THREE__="165";var f$n=Qe(so(),1);var C$n=Qe(rn(),1);function RFo(){var e=Object.create(null);function t(r,i){var{id:s,name:a,dependencies:c}=r;if(c===void 0)c=[];var l=r.init;if(l===void 0)l=function(){};var h=r.getTransferables;if(h===void 0)h=null;if(e[s])return;try{if(c=c.map(function(u){if(u&&u.isWorkerModule)t(u,function(_){if(_ instanceof Error)throw _}),u=e[u.id].value;return u}),l=o("<"+a+">.init",l),h)h=o("<"+a+">.getTransferables",h);var d=null;if(typeof l==="function")d=l.apply(void 0,c);else console.error("worker module init function failed to rehydrate");e[s]={id:s,value:d,getTransferables:h},i(d)}catch(u){if(!(u&&u.noLog))console.error(u);i(u)}}function n(r,i){var s,{id:a,args:c}=r;if(!e[a]||typeof e[a].value!=="function")i(Error("Worker module "+a+": not found or its 'init' did not return a function"));try{var l=(s=e[a]).value.apply(s,c);if(l&&typeof l.then==="function")l.then(h,function(d){return i(d instanceof Error?d:Error(""+d))});else h(l)}catch(d){i(d)}function h(d){try{var u=e[a].getTransferables&&e[a].getTransferables(d);if(!u||!Array.isArray(u)||!u.length)u=void 0;i(d,u)}catch(_){console.error(_),i(_)}}}function o(r,i){var s=void 0;self.troikaDefine=function(c){return s=c};var a=URL.createObjectURL(new Blob(["/** "+r.replace(/\*/g,"")+` **/

troikaDefine(
`+i+`
)`],{type:"application/javascript"}));try{importScripts(a)}catch(c){console.error(c)}return URL.revokeObjectURL(a),delete self.troikaDefine,s}self.addEventListener("message",function(r){var i=r.data,{messageId:s,action:a,data:c}=i;try{if(a==="registerModule")t(c,function(l){if(l instanceof Error)postMessage({messageId:s,success:!1,error:l.message});else postMessage({messageId:s,success:!0,result:{isCallable:typeof l==="function"}})});if(a==="callModule")n(c,function(l,h){if(l instanceof Error)postMessage({messageId:s,success:!1,error:l.message});else postMessage({messageId:s,success:!0,result:l},h||void 0)})}catch(l){postMessage({messageId:s,success:!1,error:l.stack})}})}function QFo(e){var t=function(){var n=[],o=arguments.length;while(o--)n[o]=arguments[o];return t._getInitResult().then(function(r){if(typeof r==="function")return r.apply(void 0,n);else throw Error("Worker module function was called but `init` did not return a callable function")})};return t._getInitResult=function(){var{dependencies:n,init:o}=e;n=Array.isArray(n)?n.map(function(i){if(i){if(i=i.onMainThread||i,i._getInitResult)i=i._getInitResult()}return i}):[];var r=Promise.all(n).then(function(i){return o.apply(null,i)});return t._getInitResult=function(){return r},r},t}var KEt=function(){var e=!1;if(typeof window<"u"&&typeof window.document<"u")try{var t=new Worker(URL.createObjectURL(new Blob([""],{type:"application/javascript"})));t.terminate(),e=!0}catch(n){console.log("Troika createWorkerModule: web workers not allowed; falling back to main thread execution. Cause: ["+n.message+"]")}return KEt=function(){return e},e},kFo=0,LFo=0,HOe=!1,$ie=Object.create(null),qie=Object.create(null),FOe=Object.create(null);function Dz(e){if((!e||typeof e.init!=="function")&&!HOe)throw Error("requires `options.init` function");var{dependencies:t,init:n,getTransferables:o,workerId:r}=e,i=QFo(e);if(r==null)r="#default";var s="workerModule"+ ++kFo,a=e.name||s,c=null;t=t&&t.map(function(h){if(typeof h==="function"&&!h.workerModuleData)HOe=!0,h=Dz({workerId:r,name:"<"+a+"> function dependency: "+h.name,init:`function(){return (
`+cxe(h)+`
)}`}),HOe=!1;if(h&&h.workerModuleData)h=h.workerModuleData;return h});function l(){var h=[],d=arguments.length;while(d--)h[d]=arguments[d];if(!KEt())return i.apply(void 0,h);if(!c){c=jEt(r,"registerModule",l.workerModuleData);var u=function(){c=null,qie[r].delete(u)};(qie[r]||(qie[r]=new Set)).add(u)}return c.then(function(_){var p=_.isCallable;if(p)return jEt(r,"callModule",{id:s,args:h});else throw Error("Worker module function was called but `init` did not return a callable function")})}return l.workerModuleData={isWorkerModule:!0,id:s,name:a,dependencies:t,init:cxe(n),getTransferables:o&&cxe(o)},l.onMainThread=i,l}function $Et(e){if(qie[e])qie[e].forEach(function(t){t()});if($ie[e])$ie[e].terminate(),delete $ie[e]}function cxe(e){var t=e.toString();if(!/^function/.test(t)&&/^\w+\s*\(/.test(t))t="function "+t;return t}function HFo(e){var t=$ie[e];if(!t){var n=cxe(RFo);t=$ie[e]=new Worker(URL.createObjectURL(new Blob(["/** Worker Module Bootstrap: "+e.replace(/\*/g,"")+` **/

;(`+n+")()"],{type:"application/javascript"}))),t.onmessage=function(o){var r=o.data,i=r.messageId,s=FOe[i];if(!s)throw Error("WorkerModule response with empty or unknown messageId");delete FOe[i],s(r)}}return t}function jEt(e,t,n){return new Promise(function(o,r){var i=++LFo;FOe[i]=function(s){if(s.success)o(s.result);else r(Error("Error in worker "+t+" call: "+s.error))},HFo(e).postMessage({messageId:i,action:t,data:n})})}function zOe(){var e=function(t){function n(U,j,Y,X,K,J,ee,se){var ne=1-ee;se.x=ne*ne*U+2*ne*ee*Y+ee*ee*K,se.y=ne*ne*j+2*ne*ee*X+ee*ee*J}function o(U,j,Y,X,K,J,ee,se,ne,re){var Z=1-ne;re.x=Z*Z*Z*U+3*Z*Z*ne*Y+3*Z*ne*ne*K+ne*ne*ne*ee,re.y=Z*Z*Z*j+3*Z*Z*ne*X+3*Z*ne*ne*J+ne*ne*ne*se}function r(U,j){var Y=/([MLQCZ])([^MLQCZ]*)/g,X,K,J,ee,se;while(X=Y.exec(U)){var ne=X[2].replace(/^\s*|\s*$/g,"").split(/[,\s]+/).map(function(re){return parseFloat(re)});switch(X[1]){case"M":ee=K=ne[0],se=J=ne[1];break;case"L":if(ne[0]!==ee||ne[1]!==se)j("L",ee,se,ee=ne[0],se=ne[1]);break;case"Q":{j("Q",ee,se,ee=ne[2],se=ne[3],ne[0],ne[1]);break}case"C":{j("C",ee,se,ee=ne[4],se=ne[5],ne[0],ne[1],ne[2],ne[3]);break}case"Z":if(ee!==K||se!==J)j("L",ee,se,K,J);break}}}function i(U,j,Y){if(Y===void 0)Y=16;var X={x:0,y:0};r(U,function(K,J,ee,se,ne,re,Z,te,ie){switch(K){case"L":j(J,ee,se,ne);break;case"Q":{var ce=J,ue=ee;for(var de=1;de<Y;de++)n(J,ee,re,Z,se,ne,de/(Y-1),X),j(ce,ue,X.x,X.y),ce=X.x,ue=X.y;break}case"C":{var me=J,ge=ee;for(var xe=1;xe<Y;xe++)o(J,ee,re,Z,te,ie,se,ne,xe/(Y-1),X),j(me,ge,X.x,X.y),me=X.x,ge=X.y;break}}})}var s="precision highp float;attribute vec2 aUV;varying vec2 vUV;void main(){vUV=aUV;gl_Position=vec4(mix(vec2(-1.0),vec2(1.0),aUV),0.0,1.0);}",a="precision highp float;uniform sampler2D tex;varying vec2 vUV;void main(){gl_FragColor=texture2D(tex,vUV);}",c=new WeakMap,l={premultipliedAlpha:!1,preserveDrawingBuffer:!0,antialias:!1,depth:!1};function h(U,j){var Y=U.getContext?U.getContext("webgl",l):U,X=c.get(Y);if(!X){let Z=function(me){var ge=J[me];if(!ge){if(ge=J[me]=Y.getExtension(me),!ge)throw Error(me+" not supported")}return ge},te=function(me,ge){var xe=Y.createShader(ge);return Y.shaderSource(xe,me),Y.compileShader(xe),xe},ie=function(me,ge,xe,Ee){if(!ee[me]){var Re={},Me={},_e=Y.createProgram();Y.attachShader(_e,te(ge,Y.VERTEX_SHADER)),Y.attachShader(_e,te(xe,Y.FRAGMENT_SHADER)),Y.linkProgram(_e),ee[me]={program:_e,transaction:function(Se){Y.useProgram(_e),Se({setUniform:function(Le,nt){var dt=[],rt=arguments.length-2;while(rt-- >0)dt[rt]=arguments[rt+2];var pt=Me[nt]||(Me[nt]=Y.getUniformLocation(_e,nt));Y["uniform"+Le].apply(Y,[pt].concat(dt))},setAttribute:function(Le,nt,dt,rt,pt){var ct=Re[Le];if(!ct)ct=Re[Le]={buf:Y.createBuffer(),loc:Y.getAttribLocation(_e,Le),data:null};if(Y.bindBuffer(Y.ARRAY_BUFFER,ct.buf),Y.vertexAttribPointer(ct.loc,nt,Y.FLOAT,!1,0,0),Y.enableVertexAttribArray(ct.loc),K)Y.vertexAttribDivisor(ct.loc,rt);else Z("ANGLE_instanced_arrays").vertexAttribDivisorANGLE(ct.loc,rt);if(pt!==ct.data)Y.bufferData(Y.ARRAY_BUFFER,pt,dt),ct.data=pt}})}}}ee[me].transaction(Ee)},ce=function(me,ge){ne++;try{Y.activeTexture(Y.TEXTURE0+ne);var xe=se[me];if(!xe)xe=se[me]=Y.createTexture(),Y.bindTexture(Y.TEXTURE_2D,xe),Y.texParameteri(Y.TEXTURE_2D,Y.TEXTURE_MIN_FILTER,Y.NEAREST),Y.texParameteri(Y.TEXTURE_2D,Y.TEXTURE_MAG_FILTER,Y.NEAREST);Y.bindTexture(Y.TEXTURE_2D,xe),ge(xe,ne)}finally{ne--}},ue=function(me,ge,xe){var Ee=Y.createFramebuffer();re.push(Ee),Y.bindFramebuffer(Y.FRAMEBUFFER,Ee),Y.activeTexture(Y.TEXTURE0+ge),Y.bindTexture(Y.TEXTURE_2D,me),Y.framebufferTexture2D(Y.FRAMEBUFFER,Y.COLOR_ATTACHMENT0,Y.TEXTURE_2D,me,0);try{xe(Ee)}finally{Y.deleteFramebuffer(Ee),Y.bindFramebuffer(Y.FRAMEBUFFER,re[--re.length-1]||null)}},de=function(){J={},ee={},se={},ne=-1,re.length=0};var K=typeof WebGL2RenderingContext<"u"&&Y instanceof WebGL2RenderingContext,J={},ee={},se={},ne=-1,re=[];Y.canvas.addEventListener("webglcontextlost",function(me){de(),me.preventDefault()},!1),c.set(Y,X={gl:Y,isWebGL2:K,getExtension:Z,withProgram:ie,withTexture:ce,withTextureFramebuffer:ue,handleContextLoss:de})}j(X)}function d(U,j,Y,X,K,J,ee,se){if(ee===void 0)ee=15;if(se===void 0)se=null;h(U,function(ne){var{gl:re,withProgram:Z,withTexture:te}=ne;te("copy",function(ie,ce){re.texImage2D(re.TEXTURE_2D,0,re.RGBA,K,J,0,re.RGBA,re.UNSIGNED_BYTE,j),Z("copy",s,a,function(ue){var{setUniform:de,setAttribute:me}=ue;me("aUV",2,re.STATIC_DRAW,0,new Float32Array([0,0,2,0,0,2])),de("1i","image",ce),re.bindFramebuffer(re.FRAMEBUFFER,se||null),re.disable(re.BLEND),re.colorMask(ee&8,ee&4,ee&2,ee&1),re.viewport(Y,X,K,J),re.scissor(Y,X,K,J),re.drawArrays(re.TRIANGLES,0,3)})})})}function u(U,j,Y){var{width:X,height:K}=U;h(U,function(J){var ee=J.gl,se=new Uint8Array(X*K*4);ee.readPixels(0,0,X,K,ee.RGBA,ee.UNSIGNED_BYTE,se),U.width=j,U.height=Y,d(ee,se,0,0,X,K)})}var _=Object.freeze({__proto__:null,withWebGLContext:h,renderImageData:d,resizeWebGLCanvasWithoutClearing:u});function p(U,j,Y,X,K,J){if(J===void 0)J=1;var ee=new Uint8Array(U*j),se=X[2]-X[0],ne=X[3]-X[1],re=[];i(Y,function(me,ge,xe,Ee){re.push({x1:me,y1:ge,x2:xe,y2:Ee,minX:Math.min(me,xe),minY:Math.min(ge,Ee),maxX:Math.max(me,xe),maxY:Math.max(ge,Ee)})}),re.sort(function(me,ge){return me.maxX-ge.maxX});for(var Z=0;Z<U;Z++)for(var te=0;te<j;te++){var ie=ue(X[0]+se*(Z+0.5)/U,X[1]+ne*(te+0.5)/j),ce=Math.pow(1-Math.abs(ie)/K,J)/2;if(ie<0)ce=1-ce;ce=Math.max(0,Math.min(255,Math.round(ce*255))),ee[te*U+Z]=ce}return ee;function ue(me,ge){var xe=1/0,Ee=1/0;for(var Re=re.length;Re--;){var Me=re[Re];if(Me.maxX+Ee<=me)break;if(me+Ee>Me.minX&&ge-Ee<Me.maxY&&ge+Ee>Me.minY){var _e=g(me,ge,Me.x1,Me.y1,Me.x2,Me.y2);if(_e<xe)xe=_e,Ee=Math.sqrt(xe)}}if(de(me,ge))Ee=-Ee;return Ee}function de(me,ge){var xe=0;for(var Ee=re.length;Ee--;){var Re=re[Ee];if(Re.maxX<=me)break;var Me=Re.y1>ge!==Re.y2>ge&&me<(Re.x2-Re.x1)*(ge-Re.y1)/(Re.y2-Re.y1)+Re.x1;if(Me)xe+=Re.y1<Re.y2?1:-1}return xe!==0}}function m(U,j,Y,X,K,J,ee,se,ne,re){if(J===void 0)J=1;if(se===void 0)se=0;if(ne===void 0)ne=0;if(re===void 0)re=0;A(U,j,Y,X,K,J,ee,null,se,ne,re)}function A(U,j,Y,X,K,J,ee,se,ne,re,Z){if(J===void 0)J=1;if(ne===void 0)ne=0;if(re===void 0)re=0;if(Z===void 0)Z=0;var te=p(U,j,Y,X,K,J),ie=new Uint8Array(te.length*4);for(var ce=0;ce<te.length;ce++)ie[ce*4+Z]=te[ce];d(ee,ie,ne,re,U,j,1<<3-Z,se)}function g(U,j,Y,X,K,J){var ee=K-Y,se=J-X,ne=ee*ee+se*se,re=ne?Math.max(0,Math.min(1,((U-Y)*ee+(j-X)*se)/ne)):0,Z=U-(Y+re*ee),te=j-(X+re*se);return Z*Z+te*te}var f=Object.freeze({__proto__:null,generate:p,generateIntoCanvas:m,generateIntoFramebuffer:A}),y="precision highp float;uniform vec4 uGlyphBounds;attribute vec2 aUV;attribute vec4 aLineSegment;varying vec4 vLineSegment;varying vec2 vGlyphXY;void main(){vLineSegment=aLineSegment;vGlyphXY=mix(uGlyphBounds.xy,uGlyphBounds.zw,aUV);gl_Position=vec4(mix(vec2(-1.0),vec2(1.0),aUV),0.0,1.0);}",x="precision highp float;uniform vec4 uGlyphBounds;uniform float uMaxDistance;uniform float uExponent;varying vec4 vLineSegment;varying vec2 vGlyphXY;float absDistToSegment(vec2 point,vec2 lineA,vec2 lineB){vec2 lineDir=lineB-lineA;float lenSq=dot(lineDir,lineDir);float t=lenSq==0.0 ? 0.0 : clamp(dot(point-lineA,lineDir)/lenSq,0.0,1.0);vec2 linePt=lineA+t*lineDir;return distance(point,linePt);}void main(){vec4 seg=vLineSegment;vec2 p=vGlyphXY;float dist=absDistToSegment(p,seg.xy,seg.zw);float val=pow(1.0-clamp(dist/uMaxDistance,0.0,1.0),uExponent)*0.5;bool crossing=(seg.y>p.y!=seg.w>p.y)&&(p.x<(seg.z-seg.x)*(p.y-seg.y)/(seg.w-seg.y)+seg.x);bool crossingUp=crossing&&vLineSegment.y<vLineSegment.w;gl_FragColor=vec4(crossingUp ? 1.0/255.0 : 0.0,crossing&&!crossingUp ? 1.0/255.0 : 0.0,0.0,val);}",C="precision highp float;uniform sampler2D tex;varying vec2 vUV;void main(){vec4 color=texture2D(tex,vUV);bool inside=color.r!=color.g;float val=inside ? 1.0-color.a : color.a;gl_FragColor=vec4(val);}",b=new Float32Array([0,0,2,0,0,2]),I=null,v=!1,P={},M=new WeakMap;function B(U){if(!v&&!L(U))throw Error("WebGL generation not supported")}function T(U,j,Y,X,K,J,ee){if(J===void 0)J=1;if(ee===void 0)ee=null;if(!ee){if(ee=I,!ee){var se=typeof OffscreenCanvas==="function"?new OffscreenCanvas(1,1):typeof document<"u"?document.createElement("canvas"):null;if(!se)throw Error("OffscreenCanvas or DOM canvas not supported");ee=I=se.getContext("webgl",{depth:!1})}}B(ee);var ne=new Uint8Array(U*j*4);h(ee,function(ie){var{gl:ce,withTexture:ue,withTextureFramebuffer:de}=ie;ue("readable",function(me,ge){ce.texImage2D(ce.TEXTURE_2D,0,ce.RGBA,U,j,0,ce.RGBA,ce.UNSIGNED_BYTE,null),de(me,ge,function(xe){D(U,j,Y,X,K,J,ce,xe,0,0,0),ce.readPixels(0,0,U,j,ce.RGBA,ce.UNSIGNED_BYTE,ne)})})});var re=new Uint8Array(U*j);for(var Z=0,te=0;Z<ne.length;Z+=4)re[te++]=ne[Z];return re}function N(U,j,Y,X,K,J,ee,se,ne,re){if(J===void 0)J=1;if(se===void 0)se=0;if(ne===void 0)ne=0;if(re===void 0)re=0;D(U,j,Y,X,K,J,ee,null,se,ne,re)}function D(U,j,Y,X,K,J,ee,se,ne,re,Z){if(J===void 0)J=1;if(ne===void 0)ne=0;if(re===void 0)re=0;if(Z===void 0)Z=0;B(ee);var te=[];i(Y,function(ie,ce,ue,de){te.push(ie,ce,ue,de)}),te=new Float32Array(te),h(ee,function(ie){var{gl:ce,isWebGL2:ue,getExtension:de,withProgram:me,withTexture:ge,withTextureFramebuffer:xe,handleContextLoss:Ee}=ie;if(ge("rawDistances",function(Re,Me){if(U!==Re._lastWidth||j!==Re._lastHeight)ce.texImage2D(ce.TEXTURE_2D,0,ce.RGBA,Re._lastWidth=U,Re._lastHeight=j,0,ce.RGBA,ce.UNSIGNED_BYTE,null);me("main",y,x,function(_e){var{setAttribute:ye,setUniform:Se}=_e,Ne=!ue&&de("ANGLE_instanced_arrays"),Le=!ue&&de("EXT_blend_minmax");ye("aUV",2,ce.STATIC_DRAW,0,b),ye("aLineSegment",4,ce.DYNAMIC_DRAW,1,te),Se.apply(void 0,["4f","uGlyphBounds"].concat(X)),Se("1f","uMaxDistance",K),Se("1f","uExponent",J),xe(Re,Me,function(nt){if(ce.enable(ce.BLEND),ce.colorMask(!0,!0,!0,!0),ce.viewport(0,0,U,j),ce.scissor(0,0,U,j),ce.blendFunc(ce.ONE,ce.ONE),ce.blendEquationSeparate(ce.FUNC_ADD,ue?ce.MAX:Le.MAX_EXT),ce.clear(ce.COLOR_BUFFER_BIT),ue)ce.drawArraysInstanced(ce.TRIANGLES,0,3,te.length/4);else Ne.drawArraysInstancedANGLE(ce.TRIANGLES,0,3,te.length/4)})}),me("post",s,C,function(_e){_e.setAttribute("aUV",2,ce.STATIC_DRAW,0,b),_e.setUniform("1i","tex",Me),ce.bindFramebuffer(ce.FRAMEBUFFER,se),ce.disable(ce.BLEND),ce.colorMask(Z===0,Z===1,Z===2,Z===3),ce.viewport(ne,re,U,j),ce.scissor(ne,re,U,j),ce.drawArrays(ce.TRIANGLES,0,3)})}),ce.isContextLost())throw Ee(),Error("webgl context lost")})}function L(U){var j=!U||U===I?P:U.canvas||U,Y=M.get(j);if(Y===void 0){v=!0;var X=null;try{var K=[97,106,97,61,99,137,118,80,80,118,137,99,61,97,106,97],J=T(4,4,"M8,8L16,8L24,24L16,24Z",[0,0,32,32],24,1,U);if(Y=J&&K.length===J.length&&J.every(function(ee,se){return ee===K[se]}),!Y)X="bad trial run results",console.info(K,J)}catch(ee){Y=!1,X=ee.message}if(X)console.warn("WebGL SDF generation not supported:",X);v=!1,M.set(j,Y)}return Y}var H=Object.freeze({__proto__:null,generate:T,generateIntoCanvas:N,generateIntoFramebuffer:D,isSupported:L});function V(U,j,Y,X,K,J){if(K===void 0)K=Math.max(X[2]-X[0],X[3]-X[1])/2;if(J===void 0)J=1;try{return T.apply(H,arguments)}catch(ee){return console.info("WebGL SDF generation failed, falling back to JS",ee),p.apply(f,arguments)}}function O(U,j,Y,X,K,J,ee,se,ne,re){if(K===void 0)K=Math.max(X[2]-X[0],X[3]-X[1])/2;if(J===void 0)J=1;if(se===void 0)se=0;if(ne===void 0)ne=0;if(re===void 0)re=0;try{return N.apply(H,arguments)}catch(Z){return console.info("WebGL SDF generation failed, falling back to JS",Z),m.apply(f,arguments)}}return t.forEachPathCommand=r,t.generate=V,t.generateIntoCanvas=O,t.javascript=f,t.pathToLineSegments=i,t.webgl=H,t.webglUtils=_,Object.defineProperty(t,"__esModule",{value:!0}),t}({});return e}function qEt(){var e=function(t){var n={R:"13k,1a,2,3,3,2+1j,ch+16,a+1,5+2,2+n,5,a,4,6+16,4+3,h+1b,4mo,179q,2+9,2+11,2i9+7y,2+68,4,3+4,5+13,4+3,2+4k,3+29,8+cf,1t+7z,w+17,3+3m,1t+3z,16o1+5r,8+30,8+mc,29+1r,29+4v,75+73",EN:"1c+9,3d+1,6,187+9,513,4+5,7+9,sf+j,175h+9,qw+q,161f+1d,4xt+a,25i+9",ES:"17,2,6dp+1,f+1,av,16vr,mx+1,4o,2",ET:"z+2,3h+3,b+1,ym,3e+1,2o,p4+1,8,6u,7c,g6,1wc,1n9+4,30+1b,2n,6d,qhx+1,h0m,a+1,49+2,63+1,4+1,6bb+3,12jj",AN:"16o+5,2j+9,2+1,35,ed,1ff2+9,87+u",CS:"18,2+1,b,2u,12k,55v,l,17v0,2,3,53,2+1,b",B:"a,3,f+2,2v,690",S:"9,2,k",WS:"c,k,4f4,1vk+a,u,1j,335",ON:"x+1,4+4,h+5,r+5,r+3,z,5+3,2+1,2+1,5,2+2,3+4,o,w,ci+1,8+d,3+d,6+8,2+g,39+1,9,6+1,2,33,b8,3+1,3c+1,7+1,5r,b,7h+3,sa+5,2,3i+6,jg+3,ur+9,2v,ij+1,9g+9,7+a,8m,4+1,49+x,14u,2+2,c+2,e+2,e+2,e+1,i+n,e+e,2+p,u+2,e+2,36+1,2+3,2+1,b,2+2,6+5,2,2,2,h+1,5+4,6+3,3+f,16+2,5+3l,3+81,1y+p,2+40,q+a,m+13,2r+ch,2+9e,75+hf,3+v,2+2w,6e+5,f+6,75+2a,1a+p,2+2g,d+5x,r+b,6+3,4+o,g,6+1,6+2,2k+1,4,2j,5h+z,1m+1,1e+f,t+2,1f+e,d+3,4o+3,2s+1,w,535+1r,h3l+1i,93+2,2s,b+1,3l+x,2v,4g+3,21+3,kz+1,g5v+1,5a,j+9,n+v,2,3,2+8,2+1,3+2,2,3,46+1,4+4,h+5,r+5,r+a,3h+2,4+6,b+4,78,1r+24,4+c,4,1hb,ey+6,103+j,16j+c,1ux+7,5+g,fsh,jdq+1t,4,57+2e,p1,1m,1m,1m,1m,4kt+1,7j+17,5+2r,d+e,3+e,2+e,2+10,m+4,w,1n+5,1q,4z+5,4b+rb,9+c,4+c,4+37,d+2g,8+b,l+b,5+1j,9+9,7+13,9+t,3+1,27+3c,2+29,2+3q,d+d,3+4,4+2,6+6,a+o,8+6,a+2,e+6,16+42,2+1i",BN:"0+8,6+d,2s+5,2+p,e,4m9,1kt+2,2b+5,5+5,17q9+v,7k,6p+8,6+1,119d+3,440+7,96s+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+75,6p+2rz,1ben+1,1ekf+1,1ekf+1",NSM:"lc+33,7o+6,7c+18,2,2+1,2+1,2,21+a,1d+k,h,2u+6,3+5,3+1,2+3,10,v+q,2k+a,1n+8,a,p+3,2+8,2+2,2+4,18+2,3c+e,2+v,1k,2,5+7,5,4+6,b+1,u,1n,5+3,9,l+1,r,3+1,1m,5+1,5+1,3+2,4,v+1,4,c+1,1m,5+4,2+1,5,l+1,n+5,2,1n,3,2+3,9,8+1,c+1,v,1q,d,1f,4,1m+2,6+2,2+3,8+1,c+1,u,1n,g+1,l+1,t+1,1m+1,5+3,9,l+1,u,21,8+2,2,2j,3+6,d+7,2r,3+8,c+5,23+1,s,2,2,1k+d,2+4,2+1,6+a,2+z,a,2v+3,2+5,2+1,3+1,q+1,5+2,h+3,e,3+1,7,g,jk+2,qb+2,u+2,u+1,v+1,1t+1,2+6,9,3+a,a,1a+2,3c+1,z,3b+2,5+1,a,7+2,64+1,3,1n,2+6,2,2,3+7,7+9,3,1d+g,1s+3,1d,2+4,2,6,15+8,d+1,x+3,3+1,2+2,1l,2+1,4,2+2,1n+7,3+1,49+2,2+c,2+6,5,7,4+1,5j+1l,2+4,k1+w,2db+2,3y,2p+v,ff+3,30+1,n9x+3,2+9,x+1,29+1,7l,4,5,q+1,6,48+1,r+h,e,13+7,q+a,1b+2,1d,3+3,3+1,14,1w+5,3+1,3+1,d,9,1c,1g,2+2,3+1,6+1,2,17+1,9,6n,3,5,fn5,ki+f,h+f,r2,6b,46+4,1af+2,2+1,6+3,15+2,5,4m+1,fy+3,as+1,4a+a,4x,1j+e,1l+2,1e+3,3+1,1y+2,11+4,2+7,1r,d+1,1h+8,b+3,3,2o+2,3,2+1,7,4h,4+7,m+1,1m+1,4,12+6,4+4,5g+7,3+2,2,o,2d+5,2,5+1,2+1,6n+3,7+1,2+1,s+1,2e+7,3,2+1,2z,2,3+5,2,2u+2,3+3,2+4,78+8,2+1,75+1,2,5,41+3,3+1,5,x+5,3+1,15+5,3+3,9,a+5,3+2,1b+c,2+1,bb+6,2+5,2d+l,3+6,2+1,2+1,3f+5,4,2+1,2+6,2,21+1,4,2,9o+1,f0c+4,1o+6,t5,1s+3,2a,f5l+1,43t+2,i+7,3+6,v+3,45+2,1j0+1i,5+1d,9,f,n+4,2+e,11t+6,2+g,3+6,2+1,2+4,7a+6,c6+3,15t+6,32+6,gzhy+6n",AL:"16w,3,2,e+1b,z+2,2+2s,g+1,8+1,b+m,2+t,s+2i,c+e,4h+f,1d+1e,1bwe+dp,3+3z,x+c,2+1,35+3y,2rm+z,5+7,b+5,dt+l,c+u,17nl+27,1t+27,4x+6n,3+d",LRO:"6ct",RLO:"6cu",LRE:"6cq",RLE:"6cr",PDF:"6cs",LRI:"6ee",RLI:"6ef",FSI:"6eg",PDI:"6eh"},o={},r={};o.L=1,r[1]="L",Object.keys(n).forEach(function(Ee,Re){o[Ee]=1<<Re+1,r[o[Ee]]=Ee}),Object.freeze(o);var i=o.LRI|o.RLI|o.FSI,s=o.L|o.R|o.AL,a=o.B|o.S|o.WS|o.ON|o.FSI|o.LRI|o.RLI|o.PDI,c=o.BN|o.RLE|o.LRE|o.RLO|o.LRO|o.PDF,l=o.S|o.WS|o.B|i|o.PDI|c,h=null;function d(){if(!h){h=new Map;var Ee=0;for(var Re in n)if(n.hasOwnProperty(Re)){var Me=n[Re],_e="",ye=void 0,Se=!1,Ne=0;for(var Le=0;Le<=Me.length+1;Le+=1){var nt=Me[Le];if(nt!==","&&Le!==Me.length)if(nt==="+")Se=!0,Ne=Ee=Ne+parseInt(_e,36),_e="";else _e+=nt;else{if(!Se)Ne=Ee=Ne+parseInt(_e,36),ye=Ee;else ye=Ee+parseInt(_e,36);Se=!1,_e="",Ne=ye;for(var dt=Ee;dt<ye+1;dt+=1)h.set(dt,o[Re])}}}}}function u(Ee){return d(),h.get(Ee.codePointAt(0))||o.L}function _(Ee){return r[u(Ee)]}var p={pairs:"14>1,1e>2,u>2,2wt>1,1>1,1ge>1,1wp>1,1j>1,f>1,hm>1,1>1,u>1,u6>1,1>1,+5,28>1,w>1,1>1,+3,b8>1,1>1,+3,1>3,-1>-1,3>1,1>1,+2,1s>1,1>1,x>1,th>1,1>1,+2,db>1,1>1,+3,3>1,1>1,+2,14qm>1,1>1,+1,4q>1,1e>2,u>2,2>1,+1",canonical:"6f1>-6dx,6dy>-6dx,6ec>-6ed,6ee>-6ed,6ww>2jj,-2ji>2jj,14r4>-1e7l,1e7m>-1e7l,1e7m>-1e5c,1e5d>-1e5b,1e5c>-14qx,14qy>-14qx,14vn>-1ecg,1ech>-1ecg,1edu>-1ecg,1eci>-1ecg,1eda>-1ecg,1eci>-1ecg,1eci>-168q,168r>-168q,168s>-14ye,14yf>-14ye"};function m(Ee,Re){var Me=36,_e=0,ye=new Map,Se=Re&&new Map,Ne;return Ee.split(",").forEach(function Le(nt){if(nt.indexOf("+")!==-1)for(var dt=+nt;dt--;)Le(Ne);else{Ne=nt;var rt=nt.split(">"),pt=rt[0],ct=rt[1];pt=String.fromCodePoint(_e+=parseInt(pt,Me)),ct=String.fromCodePoint(_e+=parseInt(ct,Me)),ye.set(pt,ct),Re&&Se.set(ct,pt)}}),{map:ye,reverseMap:Se}}var A,g,f;function y(){if(!A){var Ee=m(p.pairs,!0),{map:Re,reverseMap:Me}=Ee;A=Re,g=Me,f=m(p.canonical,!1).map}}function x(Ee){return y(),A.get(Ee)||null}function C(Ee){return y(),g.get(Ee)||null}function b(Ee){return y(),f.get(Ee)||null}var{L:I,R:v,EN:P,ES:M,ET:B,AN:T,CS:N,B:D,S:L,ON:H,BN:V,NSM:O,AL:U,LRO:j,RLO:Y,LRE:X,RLE:K,PDF:J,LRI:ee,RLI:se,FSI:ne,PDI:re}=o;function Z(Ee,Re){var Me=125,_e=new Uint32Array(Ee.length);for(var ye=0;ye<Ee.length;ye++)_e[ye]=u(Ee[ye]);var Se=new Map;function Ne(Gh,Hc){var ua=_e[Gh];if(_e[Gh]=Hc,Se.set(ua,Se.get(ua)-1),ua&a)Se.set(a,Se.get(a)-1);if(Se.set(Hc,(Se.get(Hc)||0)+1),Hc&a)Se.set(a,(Se.get(a)||0)+1)}var Le=new Uint8Array(Ee.length),nt=new Map,dt=[],rt=null;for(var pt=0;pt<Ee.length;pt++){if(!rt)dt.push(rt={start:pt,end:Ee.length-1,level:Re==="rtl"?1:Re==="ltr"?0:Rs(pt,!1)});if(_e[pt]&D)rt.end=pt,rt=null}var ct=K|X|Y|j|i|re|J|D,Ct=function(Gh){return Gh+(Gh&1?1:2)},kt=function(Gh){return Gh+(Gh&1?2:1)};for(var Lt=0;Lt<dt.length;Lt++){rt=dt[Lt];var Bt=[{_level:rt.level,_override:0,_isolate:0}],xt=void 0,Yt=0,ut=0,Ze=0;Se.clear();for(var Fe=rt.start;Fe<=rt.end;Fe++){var tt=_e[Fe];if(xt=Bt[Bt.length-1],Se.set(tt,(Se.get(tt)||0)+1),tt&a)Se.set(a,(Se.get(a)||0)+1);if(tt&ct){if(tt&(K|X)){Le[Fe]=xt._level;var Je=(tt===K?kt:Ct)(xt._level);if(Je<=Me&&!Yt&&!ut)Bt.push({_level:Je,_override:0,_isolate:0});else if(!Yt)ut++}else if(tt&(Y|j)){Le[Fe]=xt._level;var $e=(tt===Y?kt:Ct)(xt._level);if($e<=Me&&!Yt&&!ut)Bt.push({_level:$e,_override:tt&Y?v:I,_isolate:0});else if(!Yt)ut++}else if(tt&i){if(tt&ne)tt=Rs(Fe+1,!0)===1?se:ee;if(Le[Fe]=xt._level,xt._override)Ne(Fe,xt._override);var ft=(tt===se?kt:Ct)(xt._level);if(ft<=Me&&Yt===0&&ut===0)Ze++,Bt.push({_level:ft,_override:0,_isolate:1,_isolInitIndex:Fe});else Yt++}else if(tt&re){if(Yt>0)Yt--;else if(Ze>0){ut=0;while(!Bt[Bt.length-1]._isolate)Bt.pop();var vt=Bt[Bt.length-1]._isolInitIndex;if(vt!=null)nt.set(vt,Fe),nt.set(Fe,vt);Bt.pop(),Ze--}if(xt=Bt[Bt.length-1],Le[Fe]=xt._level,xt._override)Ne(Fe,xt._override)}else if(tt&J){if(Yt===0){if(ut>0)ut--;else if(!xt._isolate&&Bt.length>1)Bt.pop(),xt=Bt[Bt.length-1]}Le[Fe]=xt._level}else if(tt&D)Le[Fe]=rt.level}else if(Le[Fe]=xt._level,xt._override&&tt!==V)Ne(Fe,xt._override)}var Ye=[],je=null;for(var st=rt.start;st<=rt.end;st++){var St=_e[st];if(!(St&c)){var Nt=Le[st],Ot=St&i,Ut=St===re;if(je&&Nt===je._level)je._end=st,je._endsWithIsolInit=Ot;else Ye.push(je={_start:st,_end:st,_level:Nt,_startsWithPDI:Ut,_endsWithIsolInit:Ot})}}var mn=[];for(var _n=0;_n<Ye.length;_n++){var En=Ye[_n];if(!En._startsWithPDI||En._startsWithPDI&&!nt.has(En._start)){var Qn=[je=En];for(var ln=void 0;je&&je._endsWithIsolInit&&(ln=nt.get(je._end))!=null;)for(var hn=_n+1;hn<Ye.length;hn++)if(Ye[hn]._start===ln){Qn.push(je=Ye[hn]);break}var Zn=[];for(var bo=0;bo<Qn.length;bo++){var ir=Qn[bo];for(var gt=ir._start;gt<=ir._end;gt++)Zn.push(gt)}var Oe=Le[Zn[0]],mt=rt.level;for(var It=Zn[0]-1;It>=0;It--)if(!(_e[It]&c)){mt=Le[It];break}var bt=Zn[Zn.length-1],cn=Le[bt],dn=rt.level;if(!(_e[bt]&i)){for(var wn=bt+1;wn<=rt.end;wn++)if(!(_e[wn]&c)){dn=Le[wn];break}}mn.push({_seqIndices:Zn,_sosType:Math.max(mt,Oe)%2?v:I,_eosType:Math.max(dn,cn)%2?v:I})}}for(var eo=0;eo<mn.length;eo++){var _o=mn[eo],{_seqIndices:$n,_sosType:qn,_eosType:Po}=_o,To=Le[$n[0]]&1?v:I;if(Se.get(O))for(var Tn=0;Tn<$n.length;Tn++){var lo=$n[Tn];if(_e[lo]&O){var fo=qn;for(var oo=Tn-1;oo>=0;oo--)if(!(_e[$n[oo]]&c)){fo=_e[$n[oo]];break}Ne(lo,fo&(i|re)?H:fo)}}if(Se.get(P))for(var Ro=0;Ro<$n.length;Ro++){var or=$n[Ro];if(_e[or]&P)for(var Er=Ro-1;Er>=-1;Er--){var Xi=Er===-1?qn:_e[$n[Er]];if(Xi&s){if(Xi===U)Ne(or,T);break}}}if(Se.get(U))for(var Ys=0;Ys<$n.length;Ys++){var aa=$n[Ys];if(_e[aa]&U)Ne(aa,v)}if(Se.get(M)||Se.get(N))for(var Lo=1;Lo<$n.length-1;Lo++){var Gi=$n[Lo];if(_e[Gi]&(M|N)){var bi=0,os=0;for(var Lc=Lo-1;Lc>=0;Lc--)if(bi=_e[$n[Lc]],!(bi&c))break;for(var dl=Lo+1;dl<$n.length;dl++)if(os=_e[$n[dl]],!(os&c))break;if(bi===os&&(_e[Gi]===M?bi===P:bi&(P|T)))Ne(Gi,bi)}}if(Se.get(P))for(var Ec=0;Ec<$n.length;Ec++){var _d=$n[Ec];if(_e[_d]&P){for(var B0=Ec-1;B0>=0&&_e[$n[B0]]&(B|c);B0--)Ne($n[B0],P);for(Ec++;Ec<$n.length&&_e[$n[Ec]]&(B|c|P);Ec++)if(_e[$n[Ec]]!==P)Ne($n[Ec],P)}}if(Se.get(B)||Se.get(M)||Se.get(N))for(var Jo=0;Jo<$n.length;Jo++){var zr=$n[Jo];if(_e[zr]&(B|M|N)){Ne(zr,H);for(var $r=Jo-1;$r>=0&&_e[$n[$r]]&c;$r--)Ne($n[$r],H);for(var Sl=Jo+1;Sl<$n.length&&_e[$n[Sl]]&c;Sl++)Ne($n[Sl],H)}}if(Se.get(P))for(var ul=0,gd=qn;ul<$n.length;ul++){var i1=$n[ul],Fp=_e[i1];if(Fp&P){if(gd===I)Ne(i1,I)}else if(Fp&s)gd=Fp}if(Se.get(a)){var ca=v|P|T,n0=ca|I,zp=[];{var Yd=[];for(var vu=0;vu<$n.length;vu++)if(_e[$n[vu]]&a){var ji=Ee[$n[vu]],pl=void 0;if(x(ji)!==null)if(Yd.length<63)Yd.push({char:ji,seqIndex:vu});else break;else if((pl=C(ji))!==null)for(var Zs=Yd.length-1;Zs>=0;Zs--){var Cc=Yd[Zs].char;if(Cc===pl||Cc===C(b(ji))||x(b(Cc))===ji){zp.push([Yd[Zs].seqIndex,vu]),Yd.length=Zs;break}}}zp.sort(function(Gh,Hc){return Gh[0]-Hc[0]})}for(var ea=0;ea<zp.length;ea++){var Zr=zp[ea],Ya=Zr[0],sh=Zr[1],vs=!1,Ad=0;for(var ah=Ya+1;ah<sh;ah++){var fd=$n[ah];if(_e[fd]&n0){vs=!0;var Rg=_e[fd]&ca?v:I;if(Rg===To){Ad=Rg;break}}}if(vs&&!Ad){Ad=qn;for(var Su=Ya-1;Su>=0;Su--){var s1=$n[Su];if(_e[s1]&n0){var KA=_e[s1]&ca?v:I;if(KA!==To)Ad=KA;else Ad=To;break}}}if(Ad){if(_e[$n[Ya]]=_e[$n[sh]]=Ad,Ad!==To){for(var T0=Ya+1;T0<$n.length;T0++)if(!(_e[$n[T0]]&c)){if(u(Ee[$n[T0]])&O)_e[$n[T0]]=Ad;break}}if(Ad!==To){for(var Q_=sh+1;Q_<$n.length;Q_++)if(!(_e[$n[Q_]]&c)){if(u(Ee[$n[Q_]])&O)_e[$n[Q_]]=Ad;break}}}}for(var Gd=0;Gd<$n.length;Gd++)if(_e[$n[Gd]]&a){var Dm=Gd,Ph=Gd,Yy=qn;for(var Nm=Gd-1;Nm>=0;Nm--)if(_e[$n[Nm]]&c)Dm=Nm;else{Yy=_e[$n[Nm]]&ca?v:I;break}var $f=Po;for(var a1=Gd+1;a1<$n.length;a1++)if(_e[$n[a1]]&(a|c))Ph=a1;else{$f=_e[$n[a1]]&ca?v:I;break}for(var u6=Dm;u6<=Ph;u6++)_e[$n[u6]]=Yy===$f?Yy:To;Gd=Ph}}}for(var o0=rt.start;o0<=rt.end;o0++){var p6=Le[o0],c1=_e[o0];if(p6&1){if(c1&(I|P|T))Le[o0]++}else if(c1&v)Le[o0]++;else if(c1&(T|P))Le[o0]+=2;if(c1&c)Le[o0]=o0===0?rt.level:Le[o0-1];if(o0===rt.end||u(Ee[o0])&(L|D))for(var yd=o0;yd>=0&&u(Ee[yd])&l;yd--)Le[yd]=rt.level}}return{levels:Le,paragraphs:dt};function Rs(Gh,Hc){for(var ua=Gh;ua<Ee.length;ua++){var Qg=_e[ua];if(Qg&(v|U))return 1;if(Qg&(D|I)||Hc&&Qg===re)return 0;if(Qg&i){var L3=So(ua);ua=L3===-1?Ee.length:L3}}return 0}function So(Gh){var Hc=1;for(var ua=Gh+1;ua<Ee.length;ua++){var Qg=_e[ua];if(Qg&D)break;if(Qg&re){if(--Hc===0)return ua}else if(Qg&i)Hc++}return-1}}var te="14>1,j>2,t>2,u>2,1a>g,2v3>1,1>1,1ge>1,1wd>1,b>1,1j>1,f>1,ai>3,-2>3,+1,8>1k0,-1jq>1y7,-1y6>1hf,-1he>1h6,-1h5>1ha,-1h8>1qi,-1pu>1,6>3u,-3s>7,6>1,1>1,f>1,1>1,+2,3>1,1>1,+13,4>1,1>1,6>1eo,-1ee>1,3>1mg,-1me>1mk,-1mj>1mi,-1mg>1mi,-1md>1,1>1,+2,1>10k,-103>1,1>1,4>1,5>1,1>1,+10,3>1,1>8,-7>8,+1,-6>7,+1,a>1,1>1,u>1,u6>1,1>1,+5,26>1,1>1,2>1,2>2,8>1,7>1,4>1,1>1,+5,b8>1,1>1,+3,1>3,-2>1,2>1,1>1,+2,c>1,3>1,1>1,+2,h>1,3>1,a>1,1>1,2>1,3>1,1>1,d>1,f>1,3>1,1a>1,1>1,6>1,7>1,13>1,k>1,1>1,+19,4>1,1>1,+2,2>1,1>1,+18,m>1,a>1,1>1,lk>1,1>1,4>1,2>1,f>1,3>1,1>1,+3,db>1,1>1,+3,3>1,1>1,+2,14qm>1,1>1,+1,6>1,4j>1,j>2,t>2,u>2,2>1,+1",ie;function ce(){if(!ie){var Ee=m(te,!0),{map:Re,reverseMap:Me}=Ee;Me.forEach(function(_e,ye){Re.set(ye,_e)}),ie=Re}}function ue(Ee){return ce(),ie.get(Ee)||null}function de(Ee,Re,Me,_e){var ye=Ee.length;Me=Math.max(0,Me==null?0:+Me),_e=Math.min(ye-1,_e==null?ye-1:+_e);var Se=new Map;for(var Ne=Me;Ne<=_e;Ne++)if(Re[Ne]&1){var Le=ue(Ee[Ne]);if(Le!==null)Se.set(Ne,Le)}return Se}function me(Ee,Re,Me,_e){var ye=Ee.length;Me=Math.max(0,Me==null?0:+Me),_e=Math.min(ye-1,_e==null?ye-1:+_e);var Se=[];return Re.paragraphs.forEach(function(Ne){var Le=Math.max(Me,Ne.start),nt=Math.min(_e,Ne.end);if(Le<nt){var dt=Re.levels.slice(Le,nt+1);for(var rt=nt;rt>=Le&&u(Ee[rt])&l;rt--)dt[rt]=Ne.level;var pt=Ne.level,ct=1/0;for(var Ct=0;Ct<dt.length;Ct++){var kt=dt[Ct];if(kt>pt)pt=kt;if(kt<ct)ct=kt|1}for(var Lt=pt;Lt>=ct;Lt--)for(var Bt=0;Bt<dt.length;Bt++)if(dt[Bt]>=Lt){var xt=Bt;while(Bt+1<dt.length&&dt[Bt+1]>=Lt)Bt++;if(Bt>xt)Se.push([xt+Le,Bt+Le])}}}),Se}function ge(Ee,Re,Me,_e){var ye=xe(Ee,Re,Me,_e),Se=[].concat(Ee);return ye.forEach(function(Ne,Le){Se[Le]=(Re.levels[Ne]&1?ue(Ee[Ne]):null)||Ee[Ne]}),Se.join("")}function xe(Ee,Re,Me,_e){var ye=me(Ee,Re,Me,_e),Se=[];for(var Ne=0;Ne<Ee.length;Ne++)Se[Ne]=Ne;return ye.forEach(function(Le){var nt=Le[0],dt=Le[1],rt=Se.slice(nt,dt+1);for(var pt=rt.length;pt--;)Se[dt-pt]=rt[pt]}),Se}return t.closingToOpeningBracket=C,t.getBidiCharType=u,t.getBidiCharTypeName=_,t.getCanonicalBracket=b,t.getEmbeddingLevels=Z,t.getMirroredCharacter=ue,t.getMirroredCharactersMap=de,t.getReorderSegments=me,t.getReorderedIndices=xe,t.getReorderedString=ge,t.openingToClosingBracket=x,Object.defineProperty(t,"__esModule",{value:!0}),t}({});return e}var VOe=/\bvoid\s+main\s*\(\s*\)\s*{/g;function OOe(e){let t=/^[ \t]*#include +<([\w\d./]+)>/gm;function n(o,r){let i=Ma[r];return i?OOe(i):o}return e.replace(t,n)}var vf=[];for(let e=0;e<256;e++)vf[e]=(e<16?"0":"")+e.toString(16);function FFo(){let e=Math.random()*4294967295|0,t=Math.random()*4294967295|0,n=Math.random()*4294967295|0,o=Math.random()*4294967295|0;return(vf[e&255]+vf[e>>8&255]+vf[e>>16&255]+vf[e>>24&255]+"-"+vf[t&255]+vf[t>>8&255]+"-"+vf[t>>16&15|64]+vf[t>>24&255]+"-"+vf[n&63|128]+vf[n>>8&255]+"-"+vf[n>>16&255]+vf[n>>24&255]+vf[o&255]+vf[o>>8&255]+vf[o>>16&255]+vf[o>>24&255]).toUpperCase()}var Nz=Object.assign||function(){let e=arguments[0];for(let t=1,n=arguments.length;t<n;t++){let o=arguments[t];if(o){for(let r in o)if(Object.prototype.hasOwnProperty.call(o,r))e[r]=o[r]}}return e},zFo=Date.now(),JEt=new WeakMap,ZEt=new Map,OFo=10000000000;function lxe(e,t){let n=UFo(t),o=JEt.get(e);if(!o)JEt.set(e,o=Object.create(null));if(o[n])return new o[n];let r=`_onBeforeCompile${n}`,i=function(l,h){e.onBeforeCompile.call(this,l,h);let d=this.customProgramCacheKey()+"|"+l.vertexShader+"|"+l.fragmentShader,u=ZEt[d];if(!u){let _=VFo(this,l,t,n);u=ZEt[d]=_}if(l.vertexShader=u.vertexShader,l.fragmentShader=u.fragmentShader,Nz(l.uniforms,this.uniforms),t.timeUniform)l.uniforms[t.timeUniform]={get value(){return Date.now()-zFo}};if(this[r])this[r](l)},s=function(){return a(t.chained?e:e.clone())},a=function(l){let h=Object.create(l,c);return Object.defineProperty(h,"baseMaterial",{value:e}),Object.defineProperty(h,"id",{value:OFo++}),h.uuid=FFo(),h.uniforms=Nz({},l.uniforms,t.uniforms),h.defines=Nz({},l.defines,t.defines),h.defines[`TROIKA_DERIVED_MATERIAL_${n}`]="",h.extensions=Nz({},l.extensions,t.extensions),h._listeners=void 0,h},c={constructor:{value:s},isDerivedMaterial:{value:!0},type:{get:()=>e.type,set:(l)=>{e.type=l}},isDerivedFrom:{writable:!0,configurable:!0,value:function(l){let h=this.baseMaterial;return l===h||h.isDerivedMaterial&&h.isDerivedFrom(l)||!1}},customProgramCacheKey:{writable:!0,configurable:!0,value:function(){return e.customProgramCacheKey()+"|"+n}},onBeforeCompile:{get(){return i},set(l){this[r]=l}},copy:{writable:!0,configurable:!0,value:function(l){if(e.copy.call(this,l),!e.isShaderMaterial&&!e.isDerivedMaterial)Nz(this.extensions,l.extensions),Nz(this.defines,l.defines),Nz(this.uniforms,mOe.clone(l.uniforms));return this}},clone:{writable:!0,configurable:!0,value:function(){let l=new e.constructor;return a(l).copy(this)}},getDepthMaterial:{writable:!0,configurable:!0,value:function(){let l=this._depthMaterial;if(!l)l=this._depthMaterial=lxe(e.isDerivedMaterial?e.getDepthMaterial():new jye({depthPacking:iEt}),t),l.defines.IS_DEPTH_MATERIAL="",l.uniforms=this.uniforms;return l}},getDistanceMaterial:{writable:!0,configurable:!0,value:function(){let l=this._distanceMaterial;if(!l)l=this._distanceMaterial=lxe(e.isDerivedMaterial?e.getDistanceMaterial():new Kye,t),l.defines.IS_DISTANCE_MATERIAL="",l.uniforms=this.uniforms;return l}},dispose:{writable:!0,configurable:!0,value(){let{_depthMaterial:l,_distanceMaterial:h}=this;if(l)l.dispose();if(h)h.dispose();e.dispose.call(this)}}};return o[n]=s,new s}function VFo(e,{vertexShader:t,fragmentShader:n},o,r){let{vertexDefs:i,vertexMainIntro:s,vertexMainOutro:a,vertexTransform:c,fragmentDefs:l,fragmentMainIntro:h,fragmentMainOutro:d,fragmentColorTransform:u,customRewriter:_,timeUniform:p}=o;if(i=i||"",s=s||"",a=a||"",l=l||"",h=h||"",d=d||"",c||_)t=OOe(t);if(u||_)n=n.replace(/^[ \t]*#include <((?:tonemapping|encodings|colorspace|fog|premultiplied_alpha|dithering)_fragment)>/gm,`
//!BEGIN_POST_CHUNK $1
$&
//!END_POST_CHUNK
`),n=OOe(n);if(_){let m=_({vertexShader:t,fragmentShader:n});t=m.vertexShader,n=m.fragmentShader}if(u){let m=[];n=n.replace(/^\/\/!BEGIN_POST_CHUNK[^]+?^\/\/!END_POST_CHUNK/gm,(A)=>(m.push(A),"")),d=`${u}
${m.join(`
`)}
${d}`}if(p){let m=`
uniform float ${p};
`;i=m+i,l=m+l}if(c){if(t=`vec3 troika_position_${r};
vec3 troika_normal_${r};
vec2 troika_uv_${r};
${t}
`,i=`${i}
void troikaVertexTransform${r}() {
  vec3 position = troika_position_${r};
  vec3 normal = troika_normal_${r};
  vec2 uv = troika_uv_${r};
  ${c}
  troika_position_${r} = position;
  troika_normal_${r} = normal;
  troika_uv_${r} = uv;
}
`,s=`
troika_position_${r} = vec3(position);
troika_normal_${r} = vec3(normal);
troika_uv_${r} = vec2(uv);
troikaVertexTransform${r}();
${s}
`,t=t.replace(/\b(position|normal|uv)\b/g,(m,A,g,f)=>/\battribute\s+vec[23]\s+$/.test(f.substr(0,g))?A:`troika_${A}_${r}`),!(e.map&&e.map.channel>0))t=t.replace(/\bMAP_UV\b/g,`troika_uv_${r}`)}return t=eMt(t,r,i,s,a),n=eMt(n,r,l,h,d),{vertexShader:t,fragmentShader:n}}function eMt(e,t,n,o,r){if(o||r||n)e=e.replace(VOe,`
${n}
void troikaOrigMain${t}() {`),e+=`
void main() {
  ${o}
  troikaOrigMain${t}();
  ${r}
}`;return e}function YFo(e,t){return e==="uniforms"?void 0:typeof t==="function"?t.toString():t}var GFo=0,tMt=new Map;function UFo(e){let t=JSON.stringify(e,YFo),n=tMt.get(t);if(n==null)tMt.set(t,n=++GFo);return n}/*!
Custom build of Typr.ts (https://github.com/fredli74/Typr.ts) for use in Troika text rendering.
Original MIT license applies: https://github.com/fredli74/Typr.ts/blob/master/LICENSE
*/function WFo(){return typeof window>"u"&&(self.window=self),function(e){var t={parse:function(r){var i=t._bin,s=new Uint8Array(r);if(i.readASCII(s,0,4)=="ttcf"){var a=4;i.readUshort(s,a),a+=2,i.readUshort(s,a),a+=2;var c=i.readUint(s,a);a+=4;for(var l=[],h=0;h<c;h++){var d=i.readUint(s,a);a+=4,l.push(t._readFont(s,d))}return l}return[t._readFont(s,0)]},_readFont:function(r,i){var s=t._bin,a=i;s.readFixed(r,i),i+=4;var c=s.readUshort(r,i);i+=2,s.readUshort(r,i),i+=2,s.readUshort(r,i),i+=2,s.readUshort(r,i),i+=2;for(var l=["cmap","head","hhea","maxp","hmtx","name","OS/2","post","loca","glyf","kern","CFF ","GDEF","GPOS","GSUB","SVG "],h={_data:r,_offset:a},d={},u=0;u<c;u++){var _=s.readASCII(r,i,4);i+=4,s.readUint(r,i),i+=4;var p=s.readUint(r,i);i+=4;var m=s.readUint(r,i);i+=4,d[_]={offset:p,length:m}}for(u=0;u<l.length;u++){var A=l[u];d[A]&&(h[A.trim()]=t[A.trim()].parse(r,d[A].offset,d[A].length,h))}return h},_tabOffset:function(r,i,s){for(var a=t._bin,c=a.readUshort(r,s+4),l=s+12,h=0;h<c;h++){var d=a.readASCII(r,l,4);l+=4,a.readUint(r,l),l+=4;var u=a.readUint(r,l);if(l+=4,a.readUint(r,l),l+=4,d==i)return u}return 0}};t._bin={readFixed:function(r,i){return(r[i]<<8|r[i+1])+(r[i+2]<<8|r[i+3])/65540},readF2dot14:function(r,i){return t._bin.readShort(r,i)/16384},readInt:function(r,i){return t._bin._view(r).getInt32(i)},readInt8:function(r,i){return t._bin._view(r).getInt8(i)},readShort:function(r,i){return t._bin._view(r).getInt16(i)},readUshort:function(r,i){return t._bin._view(r).getUint16(i)},readUshorts:function(r,i,s){for(var a=[],c=0;c<s;c++)a.push(t._bin.readUshort(r,i+2*c));return a},readUint:function(r,i){return t._bin._view(r).getUint32(i)},readUint64:function(r,i){return 4294967296*t._bin.readUint(r,i)+t._bin.readUint(r,i+4)},readASCII:function(r,i,s){for(var a="",c=0;c<s;c++)a+=String.fromCharCode(r[i+c]);return a},readUnicode:function(r,i,s){for(var a="",c=0;c<s;c++){var l=r[i++]<<8|r[i++];a+=String.fromCharCode(l)}return a},_tdec:typeof window<"u"&&window.TextDecoder?new window.TextDecoder:null,readUTF8:function(r,i,s){var a=t._bin._tdec;return a&&i==0&&s==r.length?a.decode(r):t._bin.readASCII(r,i,s)},readBytes:function(r,i,s){for(var a=[],c=0;c<s;c++)a.push(r[i+c]);return a},readASCIIArray:function(r,i,s){for(var a=[],c=0;c<s;c++)a.push(String.fromCharCode(r[i+c]));return a},_view:function(r){return r._dataView||(r._dataView=r.buffer?new DataView(r.buffer,r.byteOffset,r.byteLength):new DataView(new Uint8Array(r).buffer))}},t._lctf={},t._lctf.parse=function(r,i,s,a,c){var l=t._bin,h={},d=i;l.readFixed(r,i),i+=4;var u=l.readUshort(r,i);i+=2;var _=l.readUshort(r,i);i+=2;var p=l.readUshort(r,i);return i+=2,h.scriptList=t._lctf.readScriptList(r,d+u),h.featureList=t._lctf.readFeatureList(r,d+_),h.lookupList=t._lctf.readLookupList(r,d+p,c),h},t._lctf.readLookupList=function(r,i,s){var a=t._bin,c=i,l=[],h=a.readUshort(r,i);i+=2;for(var d=0;d<h;d++){var u=a.readUshort(r,i);i+=2;var _=t._lctf.readLookupTable(r,c+u,s);l.push(_)}return l},t._lctf.readLookupTable=function(r,i,s){var a=t._bin,c=i,l={tabs:[]};l.ltype=a.readUshort(r,i),i+=2,l.flag=a.readUshort(r,i),i+=2;var h=a.readUshort(r,i);i+=2;for(var d=l.ltype,u=0;u<h;u++){var _=a.readUshort(r,i);i+=2;var p=s(r,d,c+_,l);l.tabs.push(p)}return l},t._lctf.numOfOnes=function(r){for(var i=0,s=0;s<32;s++)(r>>>s&1)!=0&&i++;return i},t._lctf.readClassDef=function(r,i){var s=t._bin,a=[],c=s.readUshort(r,i);if(i+=2,c==1){var l=s.readUshort(r,i);i+=2;var h=s.readUshort(r,i);i+=2;for(var d=0;d<h;d++)a.push(l+d),a.push(l+d),a.push(s.readUshort(r,i)),i+=2}if(c==2){var u=s.readUshort(r,i);i+=2;for(d=0;d<u;d++)a.push(s.readUshort(r,i)),i+=2,a.push(s.readUshort(r,i)),i+=2,a.push(s.readUshort(r,i)),i+=2}return a},t._lctf.getInterval=function(r,i){for(var s=0;s<r.length;s+=3){var a=r[s],c=r[s+1];if(r[s+2],a<=i&&i<=c)return s}return-1},t._lctf.readCoverage=function(r,i){var s=t._bin,a={};a.fmt=s.readUshort(r,i),i+=2;var c=s.readUshort(r,i);return i+=2,a.fmt==1&&(a.tab=s.readUshorts(r,i,c)),a.fmt==2&&(a.tab=s.readUshorts(r,i,3*c)),a},t._lctf.coverageIndex=function(r,i){var s=r.tab;if(r.fmt==1)return s.indexOf(i);if(r.fmt==2){var a=t._lctf.getInterval(s,i);if(a!=-1)return s[a+2]+(i-s[a])}return-1},t._lctf.readFeatureList=function(r,i){var s=t._bin,a=i,c=[],l=s.readUshort(r,i);i+=2;for(var h=0;h<l;h++){var d=s.readASCII(r,i,4);i+=4;var u=s.readUshort(r,i);i+=2;var _=t._lctf.readFeatureTable(r,a+u);_.tag=d.trim(),c.push(_)}return c},t._lctf.readFeatureTable=function(r,i){var s=t._bin,a=i,c={},l=s.readUshort(r,i);i+=2,l>0&&(c.featureParams=a+l);var h=s.readUshort(r,i);i+=2,c.tab=[];for(var d=0;d<h;d++)c.tab.push(s.readUshort(r,i+2*d));return c},t._lctf.readScriptList=function(r,i){var s=t._bin,a=i,c={},l=s.readUshort(r,i);i+=2;for(var h=0;h<l;h++){var d=s.readASCII(r,i,4);i+=4;var u=s.readUshort(r,i);i+=2,c[d.trim()]=t._lctf.readScriptTable(r,a+u)}return c},t._lctf.readScriptTable=function(r,i){var s=t._bin,a=i,c={},l=s.readUshort(r,i);i+=2,l>0&&(c.default=t._lctf.readLangSysTable(r,a+l));var h=s.readUshort(r,i);i+=2;for(var d=0;d<h;d++){var u=s.readASCII(r,i,4);i+=4;var _=s.readUshort(r,i);i+=2,c[u.trim()]=t._lctf.readLangSysTable(r,a+_)}return c},t._lctf.readLangSysTable=function(r,i){var s=t._bin,a={};s.readUshort(r,i),i+=2,a.reqFeature=s.readUshort(r,i),i+=2;var c=s.readUshort(r,i);return i+=2,a.features=s.readUshorts(r,i,c),a},t.CFF={},t.CFF.parse=function(r,i,s){var a=t._bin;(r=new Uint8Array(r.buffer,i,s))[i=0],r[++i],r[++i],r[++i],i++;var c=[];i=t.CFF.readIndex(r,i,c);for(var l=[],h=0;h<c.length-1;h++)l.push(a.readASCII(r,i+c[h],c[h+1]-c[h]));i+=c[c.length-1];var d=[];i=t.CFF.readIndex(r,i,d);var u=[];for(h=0;h<d.length-1;h++)u.push(t.CFF.readDict(r,i+d[h],i+d[h+1]));i+=d[d.length-1];var _=u[0],p=[];i=t.CFF.readIndex(r,i,p);var m=[];for(h=0;h<p.length-1;h++)m.push(a.readASCII(r,i+p[h],p[h+1]-p[h]));if(i+=p[p.length-1],t.CFF.readSubrs(r,i,_),_.CharStrings){i=_.CharStrings,p=[],i=t.CFF.readIndex(r,i,p);var A=[];for(h=0;h<p.length-1;h++)A.push(a.readBytes(r,i+p[h],p[h+1]-p[h]));_.CharStrings=A}if(_.ROS){i=_.FDArray;var g=[];i=t.CFF.readIndex(r,i,g),_.FDArray=[];for(h=0;h<g.length-1;h++){var f=t.CFF.readDict(r,i+g[h],i+g[h+1]);t.CFF._readFDict(r,f,m),_.FDArray.push(f)}i+=g[g.length-1],i=_.FDSelect,_.FDSelect=[];var y=r[i];if(i++,y!=3)throw y;var x=a.readUshort(r,i);i+=2;for(h=0;h<x+1;h++)_.FDSelect.push(a.readUshort(r,i),r[i+2]),i+=3}return _.Encoding&&(_.Encoding=t.CFF.readEncoding(r,_.Encoding,_.CharStrings.length)),_.charset&&(_.charset=t.CFF.readCharset(r,_.charset,_.CharStrings.length)),t.CFF._readFDict(r,_,m),_},t.CFF._readFDict=function(r,i,s){var a;for(var c in i.Private&&(a=i.Private[1],i.Private=t.CFF.readDict(r,a,a+i.Private[0]),i.Private.Subrs&&t.CFF.readSubrs(r,a+i.Private.Subrs,i.Private)),i)["FamilyName","FontName","FullName","Notice","version","Copyright"].indexOf(c)!=-1&&(i[c]=s[i[c]-426+35])},t.CFF.readSubrs=function(r,i,s){var a=t._bin,c=[];i=t.CFF.readIndex(r,i,c);var l,h=c.length;l=h<1240?107:h<33900?1131:32768,s.Bias=l,s.Subrs=[];for(var d=0;d<c.length-1;d++)s.Subrs.push(a.readBytes(r,i+c[d],c[d+1]-c[d]))},t.CFF.tableSE=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,0,111,112,113,114,0,115,116,117,118,119,120,121,122,0,123,0,124,125,126,127,128,129,130,131,0,132,133,0,134,135,136,137,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,138,0,139,0,0,0,0,140,141,142,143,0,0,0,0,0,144,0,0,0,145,0,0,146,147,148,149,0,0,0,0],t.CFF.glyphByUnicode=function(r,i){for(var s=0;s<r.charset.length;s++)if(r.charset[s]==i)return s;return-1},t.CFF.glyphBySE=function(r,i){return i<0||i>255?-1:t.CFF.glyphByUnicode(r,t.CFF.tableSE[i])},t.CFF.readEncoding=function(r,i,s){t._bin;var a=[".notdef"],c=r[i];if(i++,c!=0)throw"error: unknown encoding format: "+c;var l=r[i];i++;for(var h=0;h<l;h++)a.push(r[i+h]);return a},t.CFF.readCharset=function(r,i,s){var a=t._bin,c=[".notdef"],l=r[i];if(i++,l==0)for(var h=0;h<s;h++){var d=a.readUshort(r,i);i+=2,c.push(d)}else{if(l!=1&&l!=2)throw"error: format: "+l;for(;c.length<s;){d=a.readUshort(r,i),i+=2;var u=0;l==1?(u=r[i],i++):(u=a.readUshort(r,i),i+=2);for(h=0;h<=u;h++)c.push(d),d++}}return c},t.CFF.readIndex=function(r,i,s){var a=t._bin,c=a.readUshort(r,i)+1,l=r[i+=2];if(i++,l==1)for(var h=0;h<c;h++)s.push(r[i+h]);else if(l==2)for(h=0;h<c;h++)s.push(a.readUshort(r,i+2*h));else if(l==3)for(h=0;h<c;h++)s.push(16777215&a.readUint(r,i+3*h-1));else if(c!=1)throw"unsupported offset size: "+l+", count: "+c;return(i+=c*l)-1},t.CFF.getCharString=function(r,i,s){var a=t._bin,c=r[i],l=r[i+1];r[i+2],r[i+3],r[i+4];var h=1,d=null,u=null;c<=20&&(d=c,h=1),c==12&&(d=100*c+l,h=2),21<=c&&c<=27&&(d=c,h=1),c==28&&(u=a.readShort(r,i+1),h=3),29<=c&&c<=31&&(d=c,h=1),32<=c&&c<=246&&(u=c-139,h=1),247<=c&&c<=250&&(u=256*(c-247)+l+108,h=2),251<=c&&c<=254&&(u=256*-(c-251)-l-108,h=2),c==255&&(u=a.readInt(r,i+1)/65535,h=5),s.val=u!=null?u:"o"+d,s.size=h},t.CFF.readCharString=function(r,i,s){for(var a=i+s,c=t._bin,l=[];i<a;){var h=r[i],d=r[i+1];r[i+2],r[i+3],r[i+4];var u=1,_=null,p=null;h<=20&&(_=h,u=1),h==12&&(_=100*h+d,u=2),h!=19&&h!=20||(_=h,u=2),21<=h&&h<=27&&(_=h,u=1),h==28&&(p=c.readShort(r,i+1),u=3),29<=h&&h<=31&&(_=h,u=1),32<=h&&h<=246&&(p=h-139,u=1),247<=h&&h<=250&&(p=256*(h-247)+d+108,u=2),251<=h&&h<=254&&(p=256*-(h-251)-d-108,u=2),h==255&&(p=c.readInt(r,i+1)/65535,u=5),l.push(p!=null?p:"o"+_),i+=u}return l},t.CFF.readDict=function(r,i,s){for(var a=t._bin,c={},l=[];i<s;){var h=r[i],d=r[i+1];r[i+2],r[i+3],r[i+4];var u=1,_=null,p=null;if(h==28&&(p=a.readShort(r,i+1),u=3),h==29&&(p=a.readInt(r,i+1),u=5),32<=h&&h<=246&&(p=h-139,u=1),247<=h&&h<=250&&(p=256*(h-247)+d+108,u=2),251<=h&&h<=254&&(p=256*-(h-251)-d-108,u=2),h==255)throw p=a.readInt(r,i+1)/65535,u=5,"unknown number";if(h==30){var m=[];for(u=1;;){var A=r[i+u];u++;var g=A>>4,f=15&A;if(g!=15&&m.push(g),f!=15&&m.push(f),f==15)break}for(var y="",x=[0,1,2,3,4,5,6,7,8,9,".","e","e-","reserved","-","endOfNumber"],C=0;C<m.length;C++)y+=x[m[C]];p=parseFloat(y)}if(h<=21){if(_=["version","Notice","FullName","FamilyName","Weight","FontBBox","BlueValues","OtherBlues","FamilyBlues","FamilyOtherBlues","StdHW","StdVW","escape","UniqueID","XUID","charset","Encoding","CharStrings","Private","Subrs","defaultWidthX","nominalWidthX"][h],u=1,h==12)_=["Copyright","isFixedPitch","ItalicAngle","UnderlinePosition","UnderlineThickness","PaintType","CharstringType","FontMatrix","StrokeWidth","BlueScale","BlueShift","BlueFuzz","StemSnapH","StemSnapV","ForceBold",0,0,"LanguageGroup","ExpansionFactor","initialRandomSeed","SyntheticBase","PostScript","BaseFontName","BaseFontBlend",0,0,0,0,0,0,"ROS","CIDFontVersion","CIDFontRevision","CIDFontType","CIDCount","UIDBase","FDArray","FDSelect","FontName"][d],u=2}_!=null?(c[_]=l.length==1?l[0]:l,l=[]):l.push(p),i+=u}return c},t.cmap={},t.cmap.parse=function(r,i,s){r=new Uint8Array(r.buffer,i,s),i=0;var a=t._bin,c={};a.readUshort(r,i),i+=2;var l=a.readUshort(r,i);i+=2;var h=[];c.tables=[];for(var d=0;d<l;d++){var u=a.readUshort(r,i);i+=2;var _=a.readUshort(r,i);i+=2;var p=a.readUint(r,i);i+=4;var m="p"+u+"e"+_,A=h.indexOf(p);if(A==-1){var g;A=c.tables.length,h.push(p);var f=a.readUshort(r,p);f==0?g=t.cmap.parse0(r,p):f==4?g=t.cmap.parse4(r,p):f==6?g=t.cmap.parse6(r,p):f==12?g=t.cmap.parse12(r,p):console.debug("unknown format: "+f,u,_,p),c.tables.push(g)}if(c[m]!=null)throw"multiple tables for one platform+encoding";c[m]=A}return c},t.cmap.parse0=function(r,i){var s=t._bin,a={};a.format=s.readUshort(r,i),i+=2;var c=s.readUshort(r,i);i+=2,s.readUshort(r,i),i+=2,a.map=[];for(var l=0;l<c-6;l++)a.map.push(r[i+l]);return a},t.cmap.parse4=function(r,i){var s=t._bin,a=i,c={};c.format=s.readUshort(r,i),i+=2;var l=s.readUshort(r,i);i+=2,s.readUshort(r,i),i+=2;var h=s.readUshort(r,i);i+=2;var d=h/2;c.searchRange=s.readUshort(r,i),i+=2,c.entrySelector=s.readUshort(r,i),i+=2,c.rangeShift=s.readUshort(r,i),i+=2,c.endCount=s.readUshorts(r,i,d),i+=2*d,i+=2,c.startCount=s.readUshorts(r,i,d),i+=2*d,c.idDelta=[];for(var u=0;u<d;u++)c.idDelta.push(s.readShort(r,i)),i+=2;for(c.idRangeOffset=s.readUshorts(r,i,d),i+=2*d,c.glyphIdArray=[];i<a+l;)c.glyphIdArray.push(s.readUshort(r,i)),i+=2;return c},t.cmap.parse6=function(r,i){var s=t._bin,a={};a.format=s.readUshort(r,i),i+=2,s.readUshort(r,i),i+=2,s.readUshort(r,i),i+=2,a.firstCode=s.readUshort(r,i),i+=2;var c=s.readUshort(r,i);i+=2,a.glyphIdArray=[];for(var l=0;l<c;l++)a.glyphIdArray.push(s.readUshort(r,i)),i+=2;return a},t.cmap.parse12=function(r,i){var s=t._bin,a={};a.format=s.readUshort(r,i),i+=2,i+=2,s.readUint(r,i),i+=4,s.readUint(r,i),i+=4;var c=s.readUint(r,i);i+=4,a.groups=[];for(var l=0;l<c;l++){var h=i+12*l,d=s.readUint(r,h+0),u=s.readUint(r,h+4),_=s.readUint(r,h+8);a.groups.push([d,u,_])}return a},t.glyf={},t.glyf.parse=function(r,i,s,a){for(var c=[],l=0;l<a.maxp.numGlyphs;l++)c.push(null);return c},t.glyf._parseGlyf=function(r,i){var s=t._bin,a=r._data,c=t._tabOffset(a,"glyf",r._offset)+r.loca[i];if(r.loca[i]==r.loca[i+1])return null;var l={};if(l.noc=s.readShort(a,c),c+=2,l.xMin=s.readShort(a,c),c+=2,l.yMin=s.readShort(a,c),c+=2,l.xMax=s.readShort(a,c),c+=2,l.yMax=s.readShort(a,c),c+=2,l.xMin>=l.xMax||l.yMin>=l.yMax)return null;if(l.noc>0){l.endPts=[];for(var h=0;h<l.noc;h++)l.endPts.push(s.readUshort(a,c)),c+=2;var d=s.readUshort(a,c);if(c+=2,a.length-c<d)return null;l.instructions=s.readBytes(a,c,d),c+=d;var u=l.endPts[l.noc-1]+1;l.flags=[];for(h=0;h<u;h++){var _=a[c];if(c++,l.flags.push(_),(8&_)!=0){var p=a[c];c++;for(var m=0;m<p;m++)l.flags.push(_),h++}}l.xs=[];for(h=0;h<u;h++){var A=(2&l.flags[h])!=0,g=(16&l.flags[h])!=0;A?(l.xs.push(g?a[c]:-a[c]),c++):g?l.xs.push(0):(l.xs.push(s.readShort(a,c)),c+=2)}l.ys=[];for(h=0;h<u;h++)A=(4&l.flags[h])!=0,g=(32&l.flags[h])!=0,A?(l.ys.push(g?a[c]:-a[c]),c++):g?l.ys.push(0):(l.ys.push(s.readShort(a,c)),c+=2);var f=0,y=0;for(h=0;h<u;h++)f+=l.xs[h],y+=l.ys[h],l.xs[h]=f,l.ys[h]=y}else{var x;l.parts=[];do{x=s.readUshort(a,c),c+=2;var C={m:{a:1,b:0,c:0,d:1,tx:0,ty:0},p1:-1,p2:-1};if(l.parts.push(C),C.glyphIndex=s.readUshort(a,c),c+=2,1&x){var b=s.readShort(a,c);c+=2;var I=s.readShort(a,c);c+=2}else b=s.readInt8(a,c),c++,I=s.readInt8(a,c),c++;2&x?(C.m.tx=b,C.m.ty=I):(C.p1=b,C.p2=I),8&x?(C.m.a=C.m.d=s.readF2dot14(a,c),c+=2):64&x?(C.m.a=s.readF2dot14(a,c),c+=2,C.m.d=s.readF2dot14(a,c),c+=2):128&x&&(C.m.a=s.readF2dot14(a,c),c+=2,C.m.b=s.readF2dot14(a,c),c+=2,C.m.c=s.readF2dot14(a,c),c+=2,C.m.d=s.readF2dot14(a,c),c+=2)}while(32&x);if(256&x){var v=s.readUshort(a,c);c+=2,l.instr=[];for(h=0;h<v;h++)l.instr.push(a[c]),c++}}return l},t.GDEF={},t.GDEF.parse=function(r,i,s,a){var c=i;i+=4;var l=t._bin.readUshort(r,i);return{glyphClassDef:l===0?null:t._lctf.readClassDef(r,c+l)}},t.GPOS={},t.GPOS.parse=function(r,i,s,a){return t._lctf.parse(r,i,s,a,t.GPOS.subt)},t.GPOS.subt=function(r,i,s,a){var c=t._bin,l=s,h={};if(h.fmt=c.readUshort(r,s),s+=2,i==1||i==2||i==3||i==7||i==8&&h.fmt<=2){var d=c.readUshort(r,s);s+=2,h.coverage=t._lctf.readCoverage(r,d+l)}if(i==1&&h.fmt==1){var u=c.readUshort(r,s);s+=2,u!=0&&(h.pos=t.GPOS.readValueRecord(r,s,u))}else if(i==2&&h.fmt>=1&&h.fmt<=2){u=c.readUshort(r,s),s+=2;var _=c.readUshort(r,s);s+=2;var p=t._lctf.numOfOnes(u),m=t._lctf.numOfOnes(_);if(h.fmt==1){h.pairsets=[];var A=c.readUshort(r,s);s+=2;for(var g=0;g<A;g++){var f=l+c.readUshort(r,s);s+=2;var y=c.readUshort(r,f);f+=2;for(var x=[],C=0;C<y;C++){var b=c.readUshort(r,f);f+=2,u!=0&&(T=t.GPOS.readValueRecord(r,f,u),f+=2*p),_!=0&&(N=t.GPOS.readValueRecord(r,f,_),f+=2*m),x.push({gid2:b,val1:T,val2:N})}h.pairsets.push(x)}}if(h.fmt==2){var I=c.readUshort(r,s);s+=2;var v=c.readUshort(r,s);s+=2;var P=c.readUshort(r,s);s+=2;var M=c.readUshort(r,s);s+=2,h.classDef1=t._lctf.readClassDef(r,l+I),h.classDef2=t._lctf.readClassDef(r,l+v),h.matrix=[];for(g=0;g<P;g++){var B=[];for(C=0;C<M;C++){var T=null,N=null;u!=0&&(T=t.GPOS.readValueRecord(r,s,u),s+=2*p),_!=0&&(N=t.GPOS.readValueRecord(r,s,_),s+=2*m),B.push({val1:T,val2:N})}h.matrix.push(B)}}}else if(i==4&&h.fmt==1)h.markCoverage=t._lctf.readCoverage(r,c.readUshort(r,s)+l),h.baseCoverage=t._lctf.readCoverage(r,c.readUshort(r,s+2)+l),h.markClassCount=c.readUshort(r,s+4),h.markArray=t.GPOS.readMarkArray(r,c.readUshort(r,s+6)+l),h.baseArray=t.GPOS.readBaseArray(r,c.readUshort(r,s+8)+l,h.markClassCount);else if(i==6&&h.fmt==1)h.mark1Coverage=t._lctf.readCoverage(r,c.readUshort(r,s)+l),h.mark2Coverage=t._lctf.readCoverage(r,c.readUshort(r,s+2)+l),h.markClassCount=c.readUshort(r,s+4),h.mark1Array=t.GPOS.readMarkArray(r,c.readUshort(r,s+6)+l),h.mark2Array=t.GPOS.readBaseArray(r,c.readUshort(r,s+8)+l,h.markClassCount);else{if(i==9&&h.fmt==1){var D=c.readUshort(r,s);s+=2;var L=c.readUint(r,s);if(s+=4,a.ltype==9)a.ltype=D;else if(a.ltype!=D)throw"invalid extension substitution";return t.GPOS.subt(r,a.ltype,l+L)}console.debug("unsupported GPOS table LookupType",i,"format",h.fmt)}return h},t.GPOS.readValueRecord=function(r,i,s){var a=t._bin,c=[];return c.push(1&s?a.readShort(r,i):0),i+=1&s?2:0,c.push(2&s?a.readShort(r,i):0),i+=2&s?2:0,c.push(4&s?a.readShort(r,i):0),i+=4&s?2:0,c.push(8&s?a.readShort(r,i):0),i+=8&s?2:0,c},t.GPOS.readBaseArray=function(r,i,s){var a=t._bin,c=[],l=i,h=a.readUshort(r,i);i+=2;for(var d=0;d<h;d++){for(var u=[],_=0;_<s;_++)u.push(t.GPOS.readAnchorRecord(r,l+a.readUshort(r,i))),i+=2;c.push(u)}return c},t.GPOS.readMarkArray=function(r,i){var s=t._bin,a=[],c=i,l=s.readUshort(r,i);i+=2;for(var h=0;h<l;h++){var d=t.GPOS.readAnchorRecord(r,s.readUshort(r,i+2)+c);d.markClass=s.readUshort(r,i),a.push(d),i+=4}return a},t.GPOS.readAnchorRecord=function(r,i){var s=t._bin,a={};return a.fmt=s.readUshort(r,i),a.x=s.readShort(r,i+2),a.y=s.readShort(r,i+4),a},t.GSUB={},t.GSUB.parse=function(r,i,s,a){return t._lctf.parse(r,i,s,a,t.GSUB.subt)},t.GSUB.subt=function(r,i,s,a){var c=t._bin,l=s,h={};if(h.fmt=c.readUshort(r,s),s+=2,i!=1&&i!=2&&i!=4&&i!=5&&i!=6)return null;if(i==1||i==2||i==4||i==5&&h.fmt<=2||i==6&&h.fmt<=2){var d=c.readUshort(r,s);s+=2,h.coverage=t._lctf.readCoverage(r,l+d)}if(i==1&&h.fmt>=1&&h.fmt<=2){if(h.fmt==1)h.delta=c.readShort(r,s),s+=2;else if(h.fmt==2){var u=c.readUshort(r,s);s+=2,h.newg=c.readUshorts(r,s,u),s+=2*h.newg.length}}else if(i==2&&h.fmt==1){u=c.readUshort(r,s),s+=2,h.seqs=[];for(var _=0;_<u;_++){var p=c.readUshort(r,s)+l;s+=2;var m=c.readUshort(r,p);h.seqs.push(c.readUshorts(r,p+2,m))}}else if(i==4){h.vals=[],u=c.readUshort(r,s),s+=2;for(_=0;_<u;_++){var A=c.readUshort(r,s);s+=2,h.vals.push(t.GSUB.readLigatureSet(r,l+A))}}else if(i==5&&h.fmt==2){if(h.fmt==2){var g=c.readUshort(r,s);s+=2,h.cDef=t._lctf.readClassDef(r,l+g),h.scset=[];var f=c.readUshort(r,s);s+=2;for(_=0;_<f;_++){var y=c.readUshort(r,s);s+=2,h.scset.push(y==0?null:t.GSUB.readSubClassSet(r,l+y))}}}else if(i==6&&h.fmt==3){if(h.fmt==3){for(_=0;_<3;_++){u=c.readUshort(r,s),s+=2;for(var x=[],C=0;C<u;C++)x.push(t._lctf.readCoverage(r,l+c.readUshort(r,s+2*C)));s+=2*u,_==0&&(h.backCvg=x),_==1&&(h.inptCvg=x),_==2&&(h.ahedCvg=x)}u=c.readUshort(r,s),s+=2,h.lookupRec=t.GSUB.readSubstLookupRecords(r,s,u)}}else{if(i==7&&h.fmt==1){var b=c.readUshort(r,s);s+=2;var I=c.readUint(r,s);if(s+=4,a.ltype==9)a.ltype=b;else if(a.ltype!=b)throw"invalid extension substitution";return t.GSUB.subt(r,a.ltype,l+I)}console.debug("unsupported GSUB table LookupType",i,"format",h.fmt)}return h},t.GSUB.readSubClassSet=function(r,i){var s=t._bin.readUshort,a=i,c=[],l=s(r,i);i+=2;for(var h=0;h<l;h++){var d=s(r,i);i+=2,c.push(t.GSUB.readSubClassRule(r,a+d))}return c},t.GSUB.readSubClassRule=function(r,i){var s=t._bin.readUshort,a={},c=s(r,i),l=s(r,i+=2);i+=2,a.input=[];for(var h=0;h<c-1;h++)a.input.push(s(r,i)),i+=2;return a.substLookupRecords=t.GSUB.readSubstLookupRecords(r,i,l),a},t.GSUB.readSubstLookupRecords=function(r,i,s){for(var a=t._bin.readUshort,c=[],l=0;l<s;l++)c.push(a(r,i),a(r,i+2)),i+=4;return c},t.GSUB.readChainSubClassSet=function(r,i){var s=t._bin,a=i,c=[],l=s.readUshort(r,i);i+=2;for(var h=0;h<l;h++){var d=s.readUshort(r,i);i+=2,c.push(t.GSUB.readChainSubClassRule(r,a+d))}return c},t.GSUB.readChainSubClassRule=function(r,i){for(var s=t._bin,a={},c=["backtrack","input","lookahead"],l=0;l<c.length;l++){var h=s.readUshort(r,i);i+=2,l==1&&h--,a[c[l]]=s.readUshorts(r,i,h),i+=2*a[c[l]].length}return h=s.readUshort(r,i),i+=2,a.subst=s.readUshorts(r,i,2*h),i+=2*a.subst.length,a},t.GSUB.readLigatureSet=function(r,i){var s=t._bin,a=i,c=[],l=s.readUshort(r,i);i+=2;for(var h=0;h<l;h++){var d=s.readUshort(r,i);i+=2,c.push(t.GSUB.readLigature(r,a+d))}return c},t.GSUB.readLigature=function(r,i){var s=t._bin,a={chain:[]};a.nglyph=s.readUshort(r,i),i+=2;var c=s.readUshort(r,i);i+=2;for(var l=0;l<c-1;l++)a.chain.push(s.readUshort(r,i)),i+=2;return a},t.head={},t.head.parse=function(r,i,s){var a=t._bin,c={};return a.readFixed(r,i),i+=4,c.fontRevision=a.readFixed(r,i),i+=4,a.readUint(r,i),i+=4,a.readUint(r,i),i+=4,c.flags=a.readUshort(r,i),i+=2,c.unitsPerEm=a.readUshort(r,i),i+=2,c.created=a.readUint64(r,i),i+=8,c.modified=a.readUint64(r,i),i+=8,c.xMin=a.readShort(r,i),i+=2,c.yMin=a.readShort(r,i),i+=2,c.xMax=a.readShort(r,i),i+=2,c.yMax=a.readShort(r,i),i+=2,c.macStyle=a.readUshort(r,i),i+=2,c.lowestRecPPEM=a.readUshort(r,i),i+=2,c.fontDirectionHint=a.readShort(r,i),i+=2,c.indexToLocFormat=a.readShort(r,i),i+=2,c.glyphDataFormat=a.readShort(r,i),i+=2,c},t.hhea={},t.hhea.parse=function(r,i,s){var a=t._bin,c={};return a.readFixed(r,i),i+=4,c.ascender=a.readShort(r,i),i+=2,c.descender=a.readShort(r,i),i+=2,c.lineGap=a.readShort(r,i),i+=2,c.advanceWidthMax=a.readUshort(r,i),i+=2,c.minLeftSideBearing=a.readShort(r,i),i+=2,c.minRightSideBearing=a.readShort(r,i),i+=2,c.xMaxExtent=a.readShort(r,i),i+=2,c.caretSlopeRise=a.readShort(r,i),i+=2,c.caretSlopeRun=a.readShort(r,i),i+=2,c.caretOffset=a.readShort(r,i),i+=2,i+=8,c.metricDataFormat=a.readShort(r,i),i+=2,c.numberOfHMetrics=a.readUshort(r,i),i+=2,c},t.hmtx={},t.hmtx.parse=function(r,i,s,a){for(var c=t._bin,l={aWidth:[],lsBearing:[]},h=0,d=0,u=0;u<a.maxp.numGlyphs;u++)u<a.hhea.numberOfHMetrics&&(h=c.readUshort(r,i),i+=2,d=c.readShort(r,i),i+=2),l.aWidth.push(h),l.lsBearing.push(d);return l},t.kern={},t.kern.parse=function(r,i,s,a){var c=t._bin,l=c.readUshort(r,i);if(i+=2,l==1)return t.kern.parseV1(r,i-2,s,a);var h=c.readUshort(r,i);i+=2;for(var d={glyph1:[],rval:[]},u=0;u<h;u++){i+=2,s=c.readUshort(r,i),i+=2;var _=c.readUshort(r,i);i+=2;var p=_>>>8;if((p&=15)!=0)throw"unknown kern table format: "+p;i=t.kern.readFormat0(r,i,d)}return d},t.kern.parseV1=function(r,i,s,a){var c=t._bin;c.readFixed(r,i),i+=4;var l=c.readUint(r,i);i+=4;for(var h={glyph1:[],rval:[]},d=0;d<l;d++){c.readUint(r,i),i+=4;var u=c.readUshort(r,i);i+=2,c.readUshort(r,i),i+=2;var _=u>>>8;if((_&=15)!=0)throw"unknown kern table format: "+_;i=t.kern.readFormat0(r,i,h)}return h},t.kern.readFormat0=function(r,i,s){var a=t._bin,c=-1,l=a.readUshort(r,i);i+=2,a.readUshort(r,i),i+=2,a.readUshort(r,i),i+=2,a.readUshort(r,i),i+=2;for(var h=0;h<l;h++){var d=a.readUshort(r,i);i+=2;var u=a.readUshort(r,i);i+=2;var _=a.readShort(r,i);i+=2,d!=c&&(s.glyph1.push(d),s.rval.push({glyph2:[],vals:[]}));var p=s.rval[s.rval.length-1];p.glyph2.push(u),p.vals.push(_),c=d}return i},t.loca={},t.loca.parse=function(r,i,s,a){var c=t._bin,l=[],h=a.head.indexToLocFormat,d=a.maxp.numGlyphs+1;if(h==0)for(var u=0;u<d;u++)l.push(c.readUshort(r,i+(u<<1))<<1);if(h==1)for(u=0;u<d;u++)l.push(c.readUint(r,i+(u<<2)));return l},t.maxp={},t.maxp.parse=function(r,i,s){var a=t._bin,c={},l=a.readUint(r,i);return i+=4,c.numGlyphs=a.readUshort(r,i),i+=2,l==65536&&(c.maxPoints=a.readUshort(r,i),i+=2,c.maxContours=a.readUshort(r,i),i+=2,c.maxCompositePoints=a.readUshort(r,i),i+=2,c.maxCompositeContours=a.readUshort(r,i),i+=2,c.maxZones=a.readUshort(r,i),i+=2,c.maxTwilightPoints=a.readUshort(r,i),i+=2,c.maxStorage=a.readUshort(r,i),i+=2,c.maxFunctionDefs=a.readUshort(r,i),i+=2,c.maxInstructionDefs=a.readUshort(r,i),i+=2,c.maxStackElements=a.readUshort(r,i),i+=2,c.maxSizeOfInstructions=a.readUshort(r,i),i+=2,c.maxComponentElements=a.readUshort(r,i),i+=2,c.maxComponentDepth=a.readUshort(r,i),i+=2),c},t.name={},t.name.parse=function(r,i,s){var a=t._bin,c={};a.readUshort(r,i),i+=2;var l=a.readUshort(r,i);i+=2,a.readUshort(r,i);for(var h,d=["copyright","fontFamily","fontSubfamily","ID","fullName","version","postScriptName","trademark","manufacturer","designer","description","urlVendor","urlDesigner","licence","licenceURL","---","typoFamilyName","typoSubfamilyName","compatibleFull","sampleText","postScriptCID","wwsFamilyName","wwsSubfamilyName","lightPalette","darkPalette"],u=i+=2,_=0;_<l;_++){var p=a.readUshort(r,i);i+=2;var m=a.readUshort(r,i);i+=2;var A=a.readUshort(r,i);i+=2;var g=a.readUshort(r,i);i+=2;var f=a.readUshort(r,i);i+=2;var y=a.readUshort(r,i);i+=2;var x,C=d[g],b=u+12*l+y;if(p==0)x=a.readUnicode(r,b,f/2);else if(p==3&&m==0)x=a.readUnicode(r,b,f/2);else if(m==0)x=a.readASCII(r,b,f);else if(m==1)x=a.readUnicode(r,b,f/2);else if(m==3)x=a.readUnicode(r,b,f/2);else{if(p!=1)throw"unknown encoding "+m+", platformID: "+p;x=a.readASCII(r,b,f),console.debug("reading unknown MAC encoding "+m+" as ASCII")}var I="p"+p+","+A.toString(16);c[I]==null&&(c[I]={}),c[I][C!==void 0?C:g]=x,c[I]._lang=A}for(var v in c)if(c[v].postScriptName!=null&&c[v]._lang==1033)return c[v];for(var v in c)if(c[v].postScriptName!=null&&c[v]._lang==0)return c[v];for(var v in c)if(c[v].postScriptName!=null&&c[v]._lang==3084)return c[v];for(var v in c)if(c[v].postScriptName!=null)return c[v];for(var v in c){h=v;break}return console.debug("returning name table with languageID "+c[h]._lang),c[h]},t["OS/2"]={},t["OS/2"].parse=function(r,i,s){var a=t._bin.readUshort(r,i);i+=2;var c={};if(a==0)t["OS/2"].version0(r,i,c);else if(a==1)t["OS/2"].version1(r,i,c);else if(a==2||a==3||a==4)t["OS/2"].version2(r,i,c);else{if(a!=5)throw"unknown OS/2 table version: "+a;t["OS/2"].version5(r,i,c)}return c},t["OS/2"].version0=function(r,i,s){var a=t._bin;return s.xAvgCharWidth=a.readShort(r,i),i+=2,s.usWeightClass=a.readUshort(r,i),i+=2,s.usWidthClass=a.readUshort(r,i),i+=2,s.fsType=a.readUshort(r,i),i+=2,s.ySubscriptXSize=a.readShort(r,i),i+=2,s.ySubscriptYSize=a.readShort(r,i),i+=2,s.ySubscriptXOffset=a.readShort(r,i),i+=2,s.ySubscriptYOffset=a.readShort(r,i),i+=2,s.ySuperscriptXSize=a.readShort(r,i),i+=2,s.ySuperscriptYSize=a.readShort(r,i),i+=2,s.ySuperscriptXOffset=a.readShort(r,i),i+=2,s.ySuperscriptYOffset=a.readShort(r,i),i+=2,s.yStrikeoutSize=a.readShort(r,i),i+=2,s.yStrikeoutPosition=a.readShort(r,i),i+=2,s.sFamilyClass=a.readShort(r,i),i+=2,s.panose=a.readBytes(r,i,10),i+=10,s.ulUnicodeRange1=a.readUint(r,i),i+=4,s.ulUnicodeRange2=a.readUint(r,i),i+=4,s.ulUnicodeRange3=a.readUint(r,i),i+=4,s.ulUnicodeRange4=a.readUint(r,i),i+=4,s.achVendID=[a.readInt8(r,i),a.readInt8(r,i+1),a.readInt8(r,i+2),a.readInt8(r,i+3)],i+=4,s.fsSelection=a.readUshort(r,i),i+=2,s.usFirstCharIndex=a.readUshort(r,i),i+=2,s.usLastCharIndex=a.readUshort(r,i),i+=2,s.sTypoAscender=a.readShort(r,i),i+=2,s.sTypoDescender=a.readShort(r,i),i+=2,s.sTypoLineGap=a.readShort(r,i),i+=2,s.usWinAscent=a.readUshort(r,i),i+=2,s.usWinDescent=a.readUshort(r,i),i+=2},t["OS/2"].version1=function(r,i,s){var a=t._bin;return i=t["OS/2"].version0(r,i,s),s.ulCodePageRange1=a.readUint(r,i),i+=4,s.ulCodePageRange2=a.readUint(r,i),i+=4},t["OS/2"].version2=function(r,i,s){var a=t._bin;return i=t["OS/2"].version1(r,i,s),s.sxHeight=a.readShort(r,i),i+=2,s.sCapHeight=a.readShort(r,i),i+=2,s.usDefault=a.readUshort(r,i),i+=2,s.usBreak=a.readUshort(r,i),i+=2,s.usMaxContext=a.readUshort(r,i),i+=2},t["OS/2"].version5=function(r,i,s){var a=t._bin;return i=t["OS/2"].version2(r,i,s),s.usLowerOpticalPointSize=a.readUshort(r,i),i+=2,s.usUpperOpticalPointSize=a.readUshort(r,i),i+=2},t.post={},t.post.parse=function(r,i,s){var a=t._bin,c={};return c.version=a.readFixed(r,i),i+=4,c.italicAngle=a.readFixed(r,i),i+=4,c.underlinePosition=a.readShort(r,i),i+=2,c.underlineThickness=a.readShort(r,i),i+=2,c},t==null&&(t={}),t.U==null&&(t.U={}),t.U.codeToGlyph=function(r,i){var s=r.cmap,a=-1;if(s.p0e4!=null?a=s.p0e4:s.p3e1!=null?a=s.p3e1:s.p1e0!=null?a=s.p1e0:s.p0e3!=null&&(a=s.p0e3),a==-1)throw"no familiar platform and encoding!";var c=s.tables[a];if(c.format==0)return i>=c.map.length?0:c.map[i];if(c.format==4){for(var l=-1,h=0;h<c.endCount.length;h++)if(i<=c.endCount[h]){l=h;break}if(l==-1)return 0;if(c.startCount[l]>i)return 0;return 65535&(c.idRangeOffset[l]!=0?c.glyphIdArray[i-c.startCount[l]+(c.idRangeOffset[l]>>1)-(c.idRangeOffset.length-l)]:i+c.idDelta[l])}if(c.format==12){if(i>c.groups[c.groups.length-1][1])return 0;for(h=0;h<c.groups.length;h++){var d=c.groups[h];if(d[0]<=i&&i<=d[1])return d[2]+(i-d[0])}return 0}throw"unknown cmap table format "+c.format},t.U.glyphToPath=function(r,i){var s={cmds:[],crds:[]};if(r.SVG&&r.SVG.entries[i]){var a=r.SVG.entries[i];return a==null?s:(typeof a=="string"&&(a=t.SVG.toPath(a),r.SVG.entries[i]=a),a)}if(r.CFF){var c={x:0,y:0,stack:[],nStems:0,haveWidth:!1,width:r.CFF.Private?r.CFF.Private.defaultWidthX:0,open:!1},l=r.CFF,h=r.CFF.Private;if(l.ROS){for(var d=0;l.FDSelect[d+2]<=i;)d+=2;h=l.FDArray[l.FDSelect[d+1]].Private}t.U._drawCFF(r.CFF.CharStrings[i],c,l,h,s)}else r.glyf&&t.U._drawGlyf(i,r,s);return s},t.U._drawGlyf=function(r,i,s){var a=i.glyf[r];a==null&&(a=i.glyf[r]=t.glyf._parseGlyf(i,r)),a!=null&&(a.noc>-1?t.U._simpleGlyph(a,s):t.U._compoGlyph(a,i,s))},t.U._simpleGlyph=function(r,i){for(var s=0;s<r.noc;s++){for(var a=s==0?0:r.endPts[s-1]+1,c=r.endPts[s],l=a;l<=c;l++){var h=l==a?c:l-1,d=l==c?a:l+1,u=1&r.flags[l],_=1&r.flags[h],p=1&r.flags[d],m=r.xs[l],A=r.ys[l];if(l==a)if(u){if(!_){t.U.P.moveTo(i,m,A);continue}t.U.P.moveTo(i,r.xs[h],r.ys[h])}else _?t.U.P.moveTo(i,r.xs[h],r.ys[h]):t.U.P.moveTo(i,(r.xs[h]+m)/2,(r.ys[h]+A)/2);u?_&&t.U.P.lineTo(i,m,A):p?t.U.P.qcurveTo(i,m,A,r.xs[d],r.ys[d]):t.U.P.qcurveTo(i,m,A,(m+r.xs[d])/2,(A+r.ys[d])/2)}t.U.P.closePath(i)}},t.U._compoGlyph=function(r,i,s){for(var a=0;a<r.parts.length;a++){var c={cmds:[],crds:[]},l=r.parts[a];t.U._drawGlyf(l.glyphIndex,i,c);for(var h=l.m,d=0;d<c.crds.length;d+=2){var u=c.crds[d],_=c.crds[d+1];s.crds.push(u*h.a+_*h.b+h.tx),s.crds.push(u*h.c+_*h.d+h.ty)}for(d=0;d<c.cmds.length;d++)s.cmds.push(c.cmds[d])}},t.U._getGlyphClass=function(r,i){var s=t._lctf.getInterval(i,r);return s==-1?0:i[s+2]},t.U._applySubs=function(r,i,s,a){for(var c=r.length-i-1,l=0;l<s.tabs.length;l++)if(s.tabs[l]!=null){var h,d=s.tabs[l];if(!d.coverage||(h=t._lctf.coverageIndex(d.coverage,r[i]))!=-1){if(s.ltype==1)r[i],d.fmt==1?r[i]=r[i]+d.delta:r[i]=d.newg[h];else if(s.ltype==4)for(var u=d.vals[h],_=0;_<u.length;_++){var p=u[_],m=p.chain.length;if(!(m>c)){for(var A=!0,g=0,f=0;f<m;f++){for(;r[i+g+(1+f)]==-1;)g++;p.chain[f]!=r[i+g+(1+f)]&&(A=!1)}if(A){r[i]=p.nglyph;for(f=0;f<m+g;f++)r[i+f+1]=-1;break}}}else if(s.ltype==5&&d.fmt==2)for(var y=t._lctf.getInterval(d.cDef,r[i]),x=d.cDef[y+2],C=d.scset[x],b=0;b<C.length;b++){var I=C[b],v=I.input;if(!(v.length>c)){for(A=!0,f=0;f<v.length;f++){var P=t._lctf.getInterval(d.cDef,r[i+1+f]);if(y==-1&&d.cDef[P+2]!=v[f]){A=!1;break}}if(A){var M=I.substLookupRecords;for(_=0;_<M.length;_+=2)M[_],M[_+1]}}}else if(s.ltype==6&&d.fmt==3){if(!t.U._glsCovered(r,d.backCvg,i-d.backCvg.length))continue;if(!t.U._glsCovered(r,d.inptCvg,i))continue;if(!t.U._glsCovered(r,d.ahedCvg,i+d.inptCvg.length))continue;var B=d.lookupRec;for(b=0;b<B.length;b+=2){y=B[b];var T=a[B[b+1]];t.U._applySubs(r,i+y,T,a)}}}}},t.U._glsCovered=function(r,i,s){for(var a=0;a<i.length;a++)if(t._lctf.coverageIndex(i[a],r[s+a])==-1)return!1;return!0},t.U.glyphsToPath=function(r,i,s){for(var a={cmds:[],crds:[]},c=0,l=0;l<i.length;l++){var h=i[l];if(h!=-1){for(var d=l<i.length-1&&i[l+1]!=-1?i[l+1]:0,u=t.U.glyphToPath(r,h),_=0;_<u.crds.length;_+=2)a.crds.push(u.crds[_]+c),a.crds.push(u.crds[_+1]);s&&a.cmds.push(s);for(_=0;_<u.cmds.length;_++)a.cmds.push(u.cmds[_]);s&&a.cmds.push("X"),c+=r.hmtx.aWidth[h],l<i.length-1&&(c+=t.U.getPairAdjustment(r,h,d))}}return a},t.U.P={},t.U.P.moveTo=function(r,i,s){r.cmds.push("M"),r.crds.push(i,s)},t.U.P.lineTo=function(r,i,s){r.cmds.push("L"),r.crds.push(i,s)},t.U.P.curveTo=function(r,i,s,a,c,l,h){r.cmds.push("C"),r.crds.push(i,s,a,c,l,h)},t.U.P.qcurveTo=function(r,i,s,a,c){r.cmds.push("Q"),r.crds.push(i,s,a,c)},t.U.P.closePath=function(r){r.cmds.push("Z")},t.U._drawCFF=function(r,i,s,a,c){for(var{stack:l,nStems:h,haveWidth:d,width:u,open:_}=i,p=0,{x:m,y:A}=i,g=0,f=0,y=0,x=0,C=0,b=0,I=0,v=0,P=0,M=0,B={val:0,size:0};p<r.length;){t.CFF.getCharString(r,p,B);var T=B.val;if(p+=B.size,T=="o1"||T=="o18")l.length%2!=0&&!d&&(u=l.shift()+a.nominalWidthX),h+=l.length>>1,l.length=0,d=!0;else if(T=="o3"||T=="o23")l.length%2!=0&&!d&&(u=l.shift()+a.nominalWidthX),h+=l.length>>1,l.length=0,d=!0;else if(T=="o4")l.length>1&&!d&&(u=l.shift()+a.nominalWidthX,d=!0),_&&t.U.P.closePath(c),A+=l.pop(),t.U.P.moveTo(c,m,A),_=!0;else if(T=="o5")for(;l.length>0;)m+=l.shift(),A+=l.shift(),t.U.P.lineTo(c,m,A);else if(T=="o6"||T=="o7")for(var N=l.length,D=T=="o6",L=0;L<N;L++){var H=l.shift();D?m+=H:A+=H,D=!D,t.U.P.lineTo(c,m,A)}else if(T=="o8"||T=="o24"){N=l.length;for(var V=0;V+6<=N;)g=m+l.shift(),f=A+l.shift(),y=g+l.shift(),x=f+l.shift(),m=y+l.shift(),A=x+l.shift(),t.U.P.curveTo(c,g,f,y,x,m,A),V+=6;T=="o24"&&(m+=l.shift(),A+=l.shift(),t.U.P.lineTo(c,m,A))}else{if(T=="o11")break;if(T=="o1234"||T=="o1235"||T=="o1236"||T=="o1237")T=="o1234"&&(f=A,y=(g=m+l.shift())+l.shift(),M=x=f+l.shift(),b=x,v=A,m=(I=(C=(P=y+l.shift())+l.shift())+l.shift())+l.shift(),t.U.P.curveTo(c,g,f,y,x,P,M),t.U.P.curveTo(c,C,b,I,v,m,A)),T=="o1235"&&(g=m+l.shift(),f=A+l.shift(),y=g+l.shift(),x=f+l.shift(),P=y+l.shift(),M=x+l.shift(),C=P+l.shift(),b=M+l.shift(),I=C+l.shift(),v=b+l.shift(),m=I+l.shift(),A=v+l.shift(),l.shift(),t.U.P.curveTo(c,g,f,y,x,P,M),t.U.P.curveTo(c,C,b,I,v,m,A)),T=="o1236"&&(g=m+l.shift(),f=A+l.shift(),y=g+l.shift(),M=x=f+l.shift(),b=x,I=(C=(P=y+l.shift())+l.shift())+l.shift(),v=b+l.shift(),m=I+l.shift(),t.U.P.curveTo(c,g,f,y,x,P,M),t.U.P.curveTo(c,C,b,I,v,m,A)),T=="o1237"&&(g=m+l.shift(),f=A+l.shift(),y=g+l.shift(),x=f+l.shift(),P=y+l.shift(),M=x+l.shift(),C=P+l.shift(),b=M+l.shift(),I=C+l.shift(),v=b+l.shift(),Math.abs(I-m)>Math.abs(v-A)?m=I+l.shift():A=v+l.shift(),t.U.P.curveTo(c,g,f,y,x,P,M),t.U.P.curveTo(c,C,b,I,v,m,A));else if(T=="o14"){if(l.length>0&&!d&&(u=l.shift()+s.nominalWidthX,d=!0),l.length==4){var O=l.shift(),U=l.shift(),j=l.shift(),Y=l.shift(),X=t.CFF.glyphBySE(s,j),K=t.CFF.glyphBySE(s,Y);t.U._drawCFF(s.CharStrings[X],i,s,a,c),i.x=O,i.y=U,t.U._drawCFF(s.CharStrings[K],i,s,a,c)}_&&(t.U.P.closePath(c),_=!1)}else if(T=="o19"||T=="o20")l.length%2!=0&&!d&&(u=l.shift()+a.nominalWidthX),h+=l.length>>1,l.length=0,d=!0,p+=h+7>>3;else if(T=="o21")l.length>2&&!d&&(u=l.shift()+a.nominalWidthX,d=!0),A+=l.pop(),m+=l.pop(),_&&t.U.P.closePath(c),t.U.P.moveTo(c,m,A),_=!0;else if(T=="o22")l.length>1&&!d&&(u=l.shift()+a.nominalWidthX,d=!0),m+=l.pop(),_&&t.U.P.closePath(c),t.U.P.moveTo(c,m,A),_=!0;else if(T=="o25"){for(;l.length>6;)m+=l.shift(),A+=l.shift(),t.U.P.lineTo(c,m,A);g=m+l.shift(),f=A+l.shift(),y=g+l.shift(),x=f+l.shift(),m=y+l.shift(),A=x+l.shift(),t.U.P.curveTo(c,g,f,y,x,m,A)}else if(T=="o26")for(l.length%2&&(m+=l.shift());l.length>0;)g=m,f=A+l.shift(),m=y=g+l.shift(),A=(x=f+l.shift())+l.shift(),t.U.P.curveTo(c,g,f,y,x,m,A);else if(T=="o27")for(l.length%2&&(A+=l.shift());l.length>0;)f=A,y=(g=m+l.shift())+l.shift(),x=f+l.shift(),m=y+l.shift(),A=x,t.U.P.curveTo(c,g,f,y,x,m,A);else if(T=="o10"||T=="o29"){var J=T=="o10"?a:s;if(l.length==0)console.debug("error: empty stack");else{var ee=l.pop(),se=J.Subrs[ee+J.Bias];i.x=m,i.y=A,i.nStems=h,i.haveWidth=d,i.width=u,i.open=_,t.U._drawCFF(se,i,s,a,c),m=i.x,A=i.y,h=i.nStems,d=i.haveWidth,u=i.width,_=i.open}}else if(T=="o30"||T=="o31"){var ne=l.length,re=(V=0,T=="o31");for(V+=ne-(N=-3&ne);V<N;)re?(f=A,y=(g=m+l.shift())+l.shift(),A=(x=f+l.shift())+l.shift(),N-V==5?(m=y+l.shift(),V++):m=y,re=!1):(g=m,f=A+l.shift(),y=g+l.shift(),x=f+l.shift(),m=y+l.shift(),N-V==5?(A=x+l.shift(),V++):A=x,re=!0),t.U.P.curveTo(c,g,f,y,x,m,A),V+=4}else{if((T+"").charAt(0)=="o")throw console.debug("Unknown operation: "+T,r),T;l.push(T)}}}i.x=m,i.y=A,i.nStems=h,i.haveWidth=d,i.width=u,i.open=_};var n=t,o={Typr:n};return e.Typr=n,e.default=o,Object.defineProperty(e,"__esModule",{value:!0}),e}({}).Typr}/*!
Custom bundle of woff2otf (https://github.com/arty-name/woff2otf) with fflate
(https://github.com/101arrowz/fflate) for use in Troika text rendering. 
Original licenses apply: 
- fflate: https://github.com/101arrowz/fflate/blob/master/LICENSE (MIT)
- woff2otf.js: https://github.com/arty-name/woff2otf/blob/master/woff2otf.js (Apache2)
*/function XFo(){return function(e){var t=Uint8Array,n=Uint16Array,o=Uint32Array,r=new t([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),i=new t([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),s=new t([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),a=function(T,N){for(var D=new n(31),L=0;L<31;++L)D[L]=N+=1<<T[L-1];var H=new o(D[30]);for(L=1;L<30;++L)for(var V=D[L];V<D[L+1];++V)H[V]=V-D[L]<<5|L;return[D,H]},c=a(r,2),l=c[0],h=c[1];l[28]=258,h[258]=28;for(var d=a(i,0)[0],u=new n(32768),_=0;_<32768;++_){var p=(43690&_)>>>1|(21845&_)<<1;p=(61680&(p=(52428&p)>>>2|(13107&p)<<2))>>>4|(3855&p)<<4,u[_]=((65280&p)>>>8|(255&p)<<8)>>>1}var m=function(T,N,D){for(var L=T.length,H=0,V=new n(N);H<L;++H)++V[T[H]-1];var O,U=new n(N);for(H=0;H<N;++H)U[H]=U[H-1]+V[H-1]<<1;if(D){O=new n(1<<N);var j=15-N;for(H=0;H<L;++H)if(T[H])for(var Y=H<<4|T[H],X=N-T[H],K=U[T[H]-1]++<<X,J=K|(1<<X)-1;K<=J;++K)O[u[K]>>>j]=Y}else for(O=new n(L),H=0;H<L;++H)T[H]&&(O[H]=u[U[T[H]-1]++]>>>15-T[H]);return O},A=new t(288);for(_=0;_<144;++_)A[_]=8;for(_=144;_<256;++_)A[_]=9;for(_=256;_<280;++_)A[_]=7;for(_=280;_<288;++_)A[_]=8;var g=new t(32);for(_=0;_<32;++_)g[_]=5;var f=m(A,9,1),y=m(g,5,1),x=function(T){for(var N=T[0],D=1;D<T.length;++D)T[D]>N&&(N=T[D]);return N},C=function(T,N,D){var L=N/8|0;return(T[L]|T[L+1]<<8)>>(7&N)&D},b=function(T,N){var D=N/8|0;return(T[D]|T[D+1]<<8|T[D+2]<<16)>>(7&N)},I=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],v=function(T,N,D){var L=Error(N||I[T]);if(L.code=T,Error.captureStackTrace&&Error.captureStackTrace(L,v),!D)throw L;return L},P=function(T,N,D){var L=T.length;if(!L||D&&!D.l&&L<5)return N||new t(0);var H=!N||D,V=!D||D.i;D||(D={}),N||(N=new t(3*L));var O,U=function(xt){var Yt=N.length;if(xt>Yt){var ut=new t(Math.max(2*Yt,xt));ut.set(N),N=ut}},j=D.f||0,Y=D.p||0,X=D.b||0,K=D.l,J=D.d,ee=D.m,se=D.n,ne=8*L;do{if(!K){D.f=j=C(T,Y,1);var re=C(T,Y+1,3);if(Y+=3,!re){var Z=T[(Me=((O=Y)/8|0)+(7&O&&1)+4)-4]|T[Me-3]<<8,te=Me+Z;if(te>L){V&&v(0);break}H&&U(X+Z),N.set(T.subarray(Me,te),X),D.b=X+=Z,D.p=Y=8*te;continue}if(re==1)K=f,J=y,ee=9,se=5;else if(re==2){var ie=C(T,Y,31)+257,ce=C(T,Y+10,15)+4,ue=ie+C(T,Y+5,31)+1;Y+=14;for(var de=new t(ue),me=new t(19),ge=0;ge<ce;++ge)me[s[ge]]=C(T,Y+3*ge,7);Y+=3*ce;var xe=x(me),Ee=(1<<xe)-1,Re=m(me,xe,1);for(ge=0;ge<ue;){var Me,_e=Re[C(T,Y,Ee)];if(Y+=15&_e,(Me=_e>>>4)<16)de[ge++]=Me;else{var ye=0,Se=0;for(Me==16?(Se=3+C(T,Y,3),Y+=2,ye=de[ge-1]):Me==17?(Se=3+C(T,Y,7),Y+=3):Me==18&&(Se=11+C(T,Y,127),Y+=7);Se--;)de[ge++]=ye}}var Ne=de.subarray(0,ie),Le=de.subarray(ie);ee=x(Ne),se=x(Le),K=m(Ne,ee,1),J=m(Le,se,1)}else v(1);if(Y>ne){V&&v(0);break}}H&&U(X+131072);for(var nt=(1<<ee)-1,dt=(1<<se)-1,rt=Y;;rt=Y){var pt=(ye=K[b(T,Y)&nt])>>>4;if((Y+=15&ye)>ne){V&&v(0);break}if(ye||v(2),pt<256)N[X++]=pt;else{if(pt==256){rt=Y,K=null;break}var ct=pt-254;if(pt>264){var Ct=r[ge=pt-257];ct=C(T,Y,(1<<Ct)-1)+l[ge],Y+=Ct}var kt=J[b(T,Y)&dt],Lt=kt>>>4;if(kt||v(3),Y+=15&kt,Le=d[Lt],Lt>3)Ct=i[Lt],Le+=b(T,Y)&(1<<Ct)-1,Y+=Ct;if(Y>ne){V&&v(0);break}H&&U(X+131072);for(var Bt=X+ct;X<Bt;X+=4)N[X]=N[X-Le],N[X+1]=N[X+1-Le],N[X+2]=N[X+2-Le],N[X+3]=N[X+3-Le];X=Bt}}D.l=K,D.p=rt,D.b=X,K&&(j=1,D.m=ee,D.d=J,D.n=se)}while(!j);return X==N.length?N:function(xt,Yt,ut){(Yt==null||Yt<0)&&(Yt=0),(ut==null||ut>xt.length)&&(ut=xt.length);var Ze=new(xt instanceof n?n:xt instanceof o?o:t)(ut-Yt);return Ze.set(xt.subarray(Yt,ut)),Ze}(N,0,X)},M=new t(0),B=typeof TextDecoder<"u"&&new TextDecoder;try{B.decode(M,{stream:!0})}catch(T){}return e.convert_streams=function(T){var N=new DataView(T),D=0;function L(){var ie=N.getUint16(D);return D+=2,ie}function H(){var ie=N.getUint32(D);return D+=4,ie}function V(ie){Z.setUint16(te,ie),te+=2}function O(ie){Z.setUint32(te,ie),te+=4}for(var U={signature:H(),flavor:H(),length:H(),numTables:L(),reserved:L(),totalSfntSize:H(),majorVersion:L(),minorVersion:L(),metaOffset:H(),metaLength:H(),metaOrigLength:H(),privOffset:H(),privLength:H()},j=0;Math.pow(2,j)<=U.numTables;)j++;j--;for(var Y=16*Math.pow(2,j),X=16*U.numTables-Y,K=12,J=[],ee=0;ee<U.numTables;ee++)J.push({tag:H(),offset:H(),compLength:H(),origLength:H(),origChecksum:H()}),K+=16;var se,ne=new Uint8Array(12+16*J.length+J.reduce(function(ie,ce){return ie+ce.origLength+4},0)),re=ne.buffer,Z=new DataView(re),te=0;return O(U.flavor),V(U.numTables),V(Y),V(j),V(X),J.forEach(function(ie){O(ie.tag),O(ie.origChecksum),O(K),O(ie.origLength),ie.outOffset=K,(K+=ie.origLength)%4!=0&&(K+=4-K%4)}),J.forEach(function(ie){var ce,ue=T.slice(ie.offset,ie.offset+ie.compLength);if(ie.compLength!=ie.origLength){var de=new Uint8Array(ie.origLength);ce=new Uint8Array(ue,2),P(ce,de)}else de=new Uint8Array(ue);ne.set(de,ie.outOffset);var me=0;(K=ie.outOffset+ie.origLength)%4!=0&&(me=4-K%4),ne.set(new Uint8Array(me).buffer,ie.outOffset+ie.origLength),se=K+me}),re.slice(0,se)},Object.defineProperty(e,"__esModule",{value:!0}),e}({}).convert_streams}function jFo(e,t){let n={M:2,L:2,Q:4,C:6,Z:0},o={C:"18g,ca,368,1kz",D:"17k,6,2,2+4,5+c,2+6,2+1,10+1,9+f,j+11,2+1,a,2,2+1,15+2,3,j+2,6+3,2+8,2,2,2+1,w+a,4+e,3+3,2,3+2,3+5,23+w,2f+4,3,2+9,2,b,2+3,3,1k+9,6+1,3+1,2+2,2+d,30g,p+y,1,1+1g,f+x,2,sd2+1d,jf3+4,f+3,2+4,2+2,b+3,42,2,4+2,2+1,2,3,t+1,9f+w,2,el+2,2+g,d+2,2l,2+1,5,3+1,2+1,2,3,6,16wm+1v",R:"17m+3,2,2,6+3,m,15+2,2+2,h+h,13,3+8,2,2,3+1,2,p+1,x,5+4,5,a,2,2,3,u,c+2,g+1,5,2+1,4+1,5j,6+1,2,b,2+2,f,2+1,1s+2,2,3+1,7,1ez0,2,2+1,4+4,b,4,3,b,42,2+2,4,3,2+1,2,o+3,ae,ep,x,2o+2,3+1,3,5+1,6",L:"x9u,jff,a,fd,jv",T:"4t,gj+33,7o+4,1+1,7c+18,2,2+1,2+1,2,21+a,2,1b+k,h,2u+6,3+5,3+1,2+3,y,2,v+q,2k+a,1n+8,a,p+3,2+8,2+2,2+4,18+2,3c+e,2+v,1k,2,5+7,5,4+6,b+1,u,1n,5+3,9,l+1,r,3+1,1m,5+1,5+1,3+2,4,v+1,4,c+1,1m,5+4,2+1,5,l+1,n+5,2,1n,3,2+3,9,8+1,c+1,v,1q,d,1f,4,1m+2,6+2,2+3,8+1,c+1,u,1n,3,7,6+1,l+1,t+1,1m+1,5+3,9,l+1,u,21,8+2,2,2j,3+6,d+7,2r,3+8,c+5,23+1,s,2,2,1k+d,2+4,2+1,6+a,2+z,a,2v+3,2+5,2+1,3+1,q+1,5+2,h+3,e,3+1,7,g,jk+2,qb+2,u+2,u+1,v+1,1t+1,2+6,9,3+a,a,1a+2,3c+1,z,3b+2,5+1,a,7+2,64+1,3,1n,2+6,2,2,3+7,7+9,3,1d+d,1,1+1,1s+3,1d,2+4,2,6,15+8,d+1,x+3,3+1,2+2,1l,2+1,4,2+2,1n+7,3+1,49+2,2+c,2+6,5,7,4+1,5j+1l,2+4,ek,3+1,r+4,1e+4,6+5,2p+c,1+3,1,1+2,1+b,2db+2,3y,2p+v,ff+3,30+1,n9x,1+2,2+9,x+1,29+1,7l,4,5,q+1,6,48+1,r+h,e,13+7,q+a,1b+2,1d,3+3,3+1,14,1w+5,3+1,3+1,d,9,1c,1g,2+2,3+1,6+1,2,17+1,9,6n,3,5,fn5,ki+f,h+f,5s,6y+2,ea,6b,46+4,1af+2,2+1,6+3,15+2,5,4m+1,fy+3,as+1,4a+a,4x,1j+e,1l+2,1e+3,3+1,1y+2,11+4,2+7,1r,d+1,1h+8,b+3,3,2o+2,3,2+1,7,4h,4+7,m+1,1m+1,4,12+6,4+4,5g+7,3+2,2,o,2d+5,2,5+1,2+1,6n+3,7+1,2+1,s+1,2e+7,3,2+1,2z,2,3+5,2,2u+2,3+3,2+4,78+8,2+1,75+1,2,5,41+3,3+1,5,x+9,15+5,3+3,9,a+5,3+2,1b+c,2+1,bb+6,2+5,2,2b+l,3+6,2+1,2+1,3f+5,4,2+1,2+6,2,21+1,4,2,9o+1,470+8,at4+4,1o+6,t5,1s+3,2a,f5l+1,2+3,43o+2,a+7,1+7,3+6,v+3,45+2,1j0+1i,5+1d,9,f,n+4,2+e,11t+6,2+g,3+6,2+1,2+4,7a+6,c6+3,15t+6,32+6,1,gzau,v+2n,3l+6n"},r=1,i=2,s=4,a=8,c=16,l=32,h;function d(I){if(!h){let v={R:2,L:1,D:4,C:16,U:32,T:8};h=new Map;for(let P in o){let M=0;o[P].split(",").forEach((B)=>{let[T,N]=B.split("+");T=parseInt(T,36),N=N?parseInt(N,36):0,h.set(M+=T,v[P]);for(let D=N;D--;)h.set(++M,v[P])})}}return h.get(I)||32}let u=1,_=2,p=3,m=4,A=[null,"isol","init","fina","medi"];function g(I){let v=new Uint8Array(I.length),P=32,M=u,B=-1;for(let T=0;T<I.length;T++){let N=I.codePointAt(T),D=d(N)|0,L=u;if(D&8)continue;if(P&21){if(D&22){if(L=p,M===u||M===p)v[B]++}else if(D&33){if(M===_||M===m)v[B]--}}else if(P&34){if(M===_||M===m)v[B]--}if(M=v[T]=L,P=D,B=T,N>65535)T++}return v}function f(I,v){let P=[];for(let B=0;B<v.length;B++){let T=v.codePointAt(B);if(T>65535)B++;P.push(e.U.codeToGlyph(I,T))}let M=I.GSUB;if(M){let{lookupList:B,featureList:T}=M,N,D=/^(rlig|liga|mset|isol|init|fina|medi|half|pres|blws|ccmp)$/,L=[];T.forEach((H)=>{if(D.test(H.tag))for(let V=0;V<H.tab.length;V++){if(L[H.tab[V]])continue;L[H.tab[V]]=!0;let O=B[H.tab[V]],U=/^(isol|init|fina|medi)$/.test(H.tag);if(U&&!N)N=g(v);for(let j=0;j<P.length;j++)if(!N||!U||A[N[j]]===H.tag)e.U._applySubs(P,j,O,B)}})}return P}function y(I,v){let P=new Int16Array(v.length*3),M=0;for(;M<v.length;M++){let D=v[M];if(D===-1)continue;P[M*3+2]=I.hmtx.aWidth[D];let L=I.GPOS;if(L){let H=L.lookupList;for(let V=0;V<H.length;V++){let O=H[V];for(let U=0;U<O.tabs.length;U++){let j=O.tabs[U];if(O.ltype===1){if(e._lctf.coverageIndex(j.coverage,D)!==-1&&j.pos){N(j.pos,M);break}}else if(O.ltype===2){let Y=null,X=B();if(X!==-1){let K=e._lctf.coverageIndex(j.coverage,v[X]);if(K!==-1){if(j.fmt===1){let J=j.pairsets[K];for(let ee=0;ee<J.length;ee++)if(J[ee].gid2===D)Y=J[ee]}else if(j.fmt===2){let J=e.U._getGlyphClass(v[X],j.classDef1),ee=e.U._getGlyphClass(D,j.classDef2);Y=j.matrix[J][ee]}if(Y){if(Y.val1)N(Y.val1,X);if(Y.val2)N(Y.val2,M);break}}}}else if(O.ltype===4){let Y=e._lctf.coverageIndex(j.markCoverage,D);if(Y!==-1){let X=B(T),K=X===-1?-1:e._lctf.coverageIndex(j.baseCoverage,v[X]);if(K!==-1){let J=j.markArray[Y],ee=j.baseArray[K][J.markClass];P[M*3]=ee.x-J.x+P[X*3]-P[X*3+2],P[M*3+1]=ee.y-J.y+P[X*3+1];break}}}else if(O.ltype===6){let Y=e._lctf.coverageIndex(j.mark1Coverage,D);if(Y!==-1){let X=B();if(X!==-1){let K=v[X];if(x(I,K)===3){let J=e._lctf.coverageIndex(j.mark2Coverage,K);if(J!==-1){let ee=j.mark1Array[Y],se=j.mark2Array[J][ee.markClass];P[M*3]=se.x-ee.x+P[X*3]-P[X*3+2],P[M*3+1]=se.y-ee.y+P[X*3+1];break}}}}}}}}else if(I.kern&&!I.cff){let H=B();if(H!==-1){let V=I.kern.glyph1.indexOf(v[H]);if(V!==-1){let O=I.kern.rval[V].glyph2.indexOf(D);if(O!==-1)P[H*3+2]+=I.kern.rval[V].vals[O]}}}}return P;function B(D){for(let L=M-1;L>=0;L--)if(v[L]!==-1&&(!D||D(v[L])))return L;return-1}function T(D){return x(I,D)===1}function N(D,L){for(let H=0;H<3;H++)P[L*3+H]+=D[H]||0}}function x(I,v){let P=I.GDEF&&I.GDEF.glyphClassDef;return P?e.U._getGlyphClass(v,P):0}function C(...I){for(let v=0;v<I.length;v++)if(typeof I[v]==="number")return I[v]}function b(I){let v=Object.create(null),P=I["OS/2"],M=I.hhea,B=I.head.unitsPerEm,T=C(P&&P.sTypoAscender,M&&M.ascender,B),N={unitsPerEm:B,ascender:T,descender:C(P&&P.sTypoDescender,M&&M.descender,0),capHeight:C(P&&P.sCapHeight,T),xHeight:C(P&&P.sxHeight,T),lineGap:C(P&&P.sTypoLineGap,M&&M.lineGap),supportsCodePoint(D){return e.U.codeToGlyph(I,D)>0},forEachGlyph(D,L,H,V){let O=0,U=1/N.unitsPerEm*L,j=f(I,D),Y=0,X=y(I,j);return j.forEach((K,J)=>{if(K!==-1){let ee=v[K];if(!ee){let{cmds:se,crds:ne}=e.U.glyphToPath(I,K),re="",Z=0;for(let de=0,me=se.length;de<me;de++){let ge=n[se[de]];re+=se[de];for(let xe=1;xe<=ge;xe++)re+=(xe>1?",":"")+ne[Z++]}let te,ie,ce,ue;if(ne.length){te=ie=1/0,ce=ue=-1/0;for(let de=0,me=ne.length;de<me;de+=2){let ge=ne[de],xe=ne[de+1];if(ge<te)te=ge;if(xe<ie)ie=xe;if(ge>ce)ce=ge;if(xe>ue)ue=xe}}else te=ce=ie=ue=0;ee=v[K]={index:K,advanceWidth:I.hmtx.aWidth[K],xMin:te,yMin:ie,xMax:ce,yMax:ue,path:re}}if(V.call(null,ee,O+X[J*3]*U,X[J*3+1]*U,Y),O+=X[J*3+2]*U,H)O+=H*L}Y+=D.codePointAt(Y)>65535?2:1}),O}};return N}return function(v){let P=new Uint8Array(v,0,4),M=e._bin.readASCII(P,0,4);if(M==="wOFF")v=t(v);else if(M==="wOF2")throw Error("woff2 fonts not supported");return b(e.parse(v)[0])}}var KFo=Dz({name:"Typr Font Parser",dependencies:[WFo,XFo,jFo],init(e,t,n){let o=e(),r=t();return n(o,r)}});/*!
Custom bundle of @unicode-font-resolver/client v1.0.2 (https://github.com/lojjic/unicode-font-resolver)
for use in Troika text rendering. 
Original MIT license applies
*/function $Fo(){return function(e){var t=function(){this.buckets=new Map};t.prototype.add=function(y){var x=y>>5;this.buckets.set(x,(this.buckets.get(x)||0)|1<<(31&y))},t.prototype.has=function(y){var x=this.buckets.get(y>>5);return x!==void 0&&(x&1<<(31&y))!=0},t.prototype.serialize=function(){var y=[];return this.buckets.forEach(function(x,C){y.push((+C).toString(36)+":"+x.toString(36))}),y.join(",")},t.prototype.deserialize=function(y){var x=this;this.buckets.clear(),y.split(",").forEach(function(C){var b=C.split(":");x.buckets.set(parseInt(b[0],36),parseInt(b[1],36))})};var n=Math.pow(2,8),o=n-1,r=~o;function i(y){var x=function(b){return b&r}(y).toString(16),C=function(b){return(b&r)+n-1}(y).toString(16);return"codepoint-index/plane"+(y>>16)+"/"+x+"-"+C+".json"}function s(y,x){var C=y&o,b=x.codePointAt(C/6|0);return((b=(b||48)-48)&1<<C%6)!=0}function a(y,x){var C;(C=y,C.replace(/U\+/gi,"").replace(/^,+|,+$/g,"").split(/,+/).map(function(b){return b.split("-").map(function(I){return parseInt(I.trim(),16)})})).forEach(function(b){var I=b[0],v=b[1];v===void 0&&(v=I),x(I,v)})}function c(y,x){a(y,function(C,b){for(var I=C;I<=b;I++)x(I)})}var l={},h={},d=new WeakMap,u="https://cdn.jsdelivr.net/gh/lojjic/unicode-font-resolver@v1.0.1/packages/data";function _(y){var x=d.get(y);return x||(x=new t,c(y.ranges,function(C){return x.add(C)}),d.set(y,x)),x}var p,m=new Map;function A(y,x,C){return y[x]?x:y[C]?C:function(b){for(var I in b)return I}(y)}function g(y,x){var C=x;if(!y.includes(C)){C=1/0;for(var b=0;b<y.length;b++)Math.abs(y[b]-x)<Math.abs(C-x)&&(C=y[b])}return C}function f(y){return p||(p=new Set,c("9-D,20,85,A0,1680,2000-200A,2028-202F,205F,3000",function(x){p.add(x)})),p.has(y)}return e.CodePointSet=t,e.clearCache=function(){l={},h={}},e.getFontsForString=function(y,x){x===void 0&&(x={});var C,b=x.lang;b===void 0&&(b=/\p{Script=Hangul}/u.test(C=y)?"ko":/\p{Script=Hiragana}|\p{Script=Katakana}/u.test(C)?"ja":"en");var I=x.category;I===void 0&&(I="sans-serif");var v=x.style;v===void 0&&(v="normal");var P=x.weight;P===void 0&&(P=400);var M=(x.dataUrl||u).replace(/\/$/g,""),B=new Map,T=new Uint8Array(y.length),N={},D={},L=Array(y.length),H=new Map,V=!1;function O(Y){var X=m.get(Y);return X||(X=fetch(M+"/"+Y).then(function(K){if(!K.ok)throw Error(K.statusText);return K.json().then(function(J){if(!Array.isArray(J)||J[0]!==1)throw Error("Incorrect schema version; need 1, got "+J[0]);return J[1]})}).catch(function(K){if(M!==u)return V||(console.error('unicode-font-resolver: Failed loading from dataUrl "'+M+'", trying default CDN. '+K.message),V=!0),M=u,m.delete(Y),O(Y);throw K}),m.set(Y,X)),X}for(var U=function(Y){var X=y.codePointAt(Y),K=i(X);L[Y]=K,l[K]||H.has(K)||H.set(K,O(K).then(function(J){l[K]=J})),X>65535&&(Y++,j=Y)},j=0;j<y.length;j++)U(j);return Promise.all(H.values()).then(function(){H.clear();for(var Y=function(K){var J=y.codePointAt(K),ee=null,se=l[L[K]],ne=void 0;for(var re in se){var Z=D[re];if(Z===void 0&&(Z=D[re]=new RegExp(re).test(b||"en")),Z){for(var te in ne=re,se[re])if(s(J,se[re][te])){ee=te;break}break}}if(!ee){e:for(var ie in se)if(ie!==ne){for(var ce in se[ie])if(s(J,se[ie][ce])){ee=ce;break e}}}ee||(console.debug("No font coverage for U+"+J.toString(16)),ee="latin"),L[K]=ee,h[ee]||H.has(ee)||H.set(ee,O("font-meta/"+ee+".json").then(function(ue){h[ee]=ue})),J>65535&&(K++,X=K)},X=0;X<y.length;X++)Y(X);return Promise.all(H.values())}).then(function(){for(var Y,X=null,K=0;K<y.length;K++){var J=y.codePointAt(K);if(X&&(f(J)||_(X).has(J)))T[K]=T[K-1];else{X=h[L[K]];var ee=N[X.id];if(!ee){var se=X.typeforms,ne=A(se,I,"sans-serif"),re=A(se[ne],v,"normal"),Z=g((Y=se[ne])===null||Y===void 0?void 0:Y[re],P);ee=N[X.id]=M+"/font-files/"+X.id+"/"+ne+"."+re+"."+Z+".woff"}var te=B.get(ee);te==null&&(te=B.size,B.set(ee,te)),T[K]=te}J>65535&&(K++,T[K]=T[K-1])}return{fontUrls:Array.from(B.keys()),chars:T}})},Object.defineProperty(e,"__esModule",{value:!0}),e}({})}function qFo(e,t){let n=Object.create(null),o=Object.create(null);function r(s,a){let c=(l)=>{console.error(`Failure loading font ${s}`,l)};try{let l=new XMLHttpRequest;l.open("get",s,!0),l.responseType="arraybuffer",l.onload=function(){if(l.status>=400)c(Error(l.statusText));else if(l.status>0)try{let h=e(l.response);h.src=s,a(h)}catch(h){c(h)}},l.onerror=c,l.send()}catch(l){c(l)}}function i(s,a){let c=n[s];if(c)a(c);else if(o[s])o[s].push(a);else o[s]=[a],r(s,(l)=>{l.src=s,n[s]=l,o[s].forEach((h)=>h(l)),delete o[s]})}return function(s,a,{lang:c,fonts:l=[],style:h="normal",weight:d="normal",unicodeFontsURL:u}={}){let _=new Uint8Array(s.length),p=[];if(!s.length)f();let m=new Map,A=[];if(h!=="italic")h="normal";if(typeof d!=="number")d=d==="bold"?700:400;if(l&&!Array.isArray(l))l=[l];if(l=l.slice().filter((x)=>!x.lang||x.lang.test(c)).reverse(),l.length){let I=0;(function v(P=0){for(let M=P,B=s.length;M<B;M++){let T=s.codePointAt(M);if(I===1&&p[_[M-1]].supportsCodePoint(T)||M>0&&/\s/.test(s[M])){if(_[M]=_[M-1],I===2)A[A.length-1][1]=M}else for(let N=_[M],D=l.length;N<=D;N++)if(N===D){let L=I===2?A[A.length-1]:A[A.length]=[M,M];L[1]=M,I=2}else{_[M]=N;let{src:L,unicodeRange:H}=l[N];if(!H||y(T,H)){let V=n[L];if(!V){i(L,()=>{v(M)});return}if(V.supportsCodePoint(T)){let O=m.get(V);if(typeof O!=="number")O=p.length,p.push(V),m.set(V,O);_[M]=O,I=1;break}}}if(T>65535&&M+1<B){if(_[M+1]=_[M],M++,I===2)A[A.length-1][1]=M}}g()})()}else A.push([0,s.length-1]),g();function g(){if(A.length){let x=A.map((C)=>s.substring(C[0],C[1]+1)).join(`
`);t.getFontsForString(x,{lang:c||void 0,style:h,weight:d,dataUrl:u}).then(({fontUrls:C,chars:b})=>{let I=p.length,v=0;A.forEach((M)=>{for(let B=0,T=M[1]-M[0];B<=T;B++)_[M[0]+B]=b[v++]+I;v++});let P=0;C.forEach((M,B)=>{i(M,(T)=>{if(p[B+I]=T,++P===C.length)f()})})})}else f()}function f(){a({chars:_,fonts:p})}function y(x,C){for(let b=0;b<C.length;b++){let[I,v=I]=C[b];if(I<=x&&x<=v)return!0}return!1}}}var JFo=Dz({name:"FontResolver",dependencies:[qFo,KFo,$Fo],init(e,t,n){return e(t,n())}});function ZFo(e,t){let o=/[\u00AD\u034F\u061C\u115F-\u1160\u17B4-\u17B5\u180B-\u180E\u200B-\u200F\u202A-\u202E\u2060-\u206F\u3164\uFE00-\uFE0F\uFEFF\uFFA0\uFFF0-\uFFF8]/,r="[^\\S\\u00A0]",i=new RegExp("[^\\S\\u00A0]|[\\-\\u007C\\u00AD\\u2010\\u2012-\\u2014\\u2027\\u2056\\u2E17\\u2E40]");function s({text:p,lang:m,fonts:A,style:g,weight:f,preResolvedFonts:y,unicodeFontsURL:x},C){let b=({chars:I,fonts:v})=>{let P,M,B=[];for(let T=0;T<I.length;T++)if(I[T]!==M)M=I[T],B.push(P={start:T,end:T,fontObj:v[I[T]]});else P.end=T;C(B)};if(y)b(y);else e(p,b,{lang:m,fonts:A,style:g,weight:f,unicodeFontsURL:x})}function a({text:p="",font:m,lang:A,sdfGlyphSize:g=64,fontSize:f=400,fontWeight:y=1,fontStyle:x="normal",letterSpacing:C=0,lineHeight:b="normal",maxWidth:I=1/0,direction:v,textAlign:P="left",textIndent:M=0,whiteSpace:B="normal",overflowWrap:T="normal",anchorX:N=0,anchorY:D=0,metricsOnly:L=!1,unicodeFontsURL:H,preResolvedFonts:V=null,includeCaretPositions:O=!1,chunkedBoundsSize:U=8192,colorRanges:j=null},Y){let X=d(),K={fontLoad:0,typesetting:0};if(p.indexOf("\r")>-1)console.info("Typesetter: got text with \\r chars; normalizing to \\n"),p=p.replace(/\r\n/g,`
`).replace(/\r/g,`
`);f=+f,C=+C,I=+I,b=b||"normal",M=+M,s({text:p,lang:A,style:x,weight:y,fonts:typeof m==="string"?[{src:m}]:m,unicodeFontsURL:H,preResolvedFonts:V},(J)=>{K.fontLoad=d()-X;let ee=isFinite(I),se=null,ne=null,re=null,Z=null,te=null,ie=null,ce=null,ue=null,de=0,me=0,ge=B!=="nowrap",xe=new Map,Ee=d(),Re=M,Me=0,_e=new u,ye=[_e];J.forEach((dt)=>{let{fontObj:rt}=dt,{ascender:pt,descender:ct,unitsPerEm:Ct,lineGap:kt,capHeight:Lt,xHeight:Bt}=rt,xt=xe.get(rt);if(!xt){let tt=f/Ct,Je=b==="normal"?(pt-ct+kt)*tt:b*f,$e=(Je-(pt-ct)*tt)/2,ft=Math.min(Je,(pt-ct)*tt),vt=(pt+ct)/2*tt+ft/2;xt={index:xe.size,src:rt.src,fontObj:rt,fontSizeMult:tt,unitsPerEm:Ct,ascender:pt*tt,descender:ct*tt,capHeight:Lt*tt,xHeight:Bt*tt,lineHeight:Je,baseline:-$e-pt*tt,caretTop:vt,caretBottom:vt-ft},xe.set(rt,xt)}let{fontSizeMult:Yt}=xt,ut=p.slice(dt.start,dt.end+1),Ze,Fe;rt.forEachGlyph(ut,f,C,(tt,Je,$e,ft)=>{Je+=Me,ft+=dt.start,Ze=Je,Fe=tt;let vt=p.charAt(ft),Ye=tt.advanceWidth*Yt,je=_e.count,st;if(!("isEmpty"in tt))tt.isWhitespace=!!vt&&new RegExp("[^\\S\\u00A0]").test(vt),tt.canBreakAfter=!!vt&&i.test(vt),tt.isEmpty=tt.xMin===tt.xMax||tt.yMin===tt.yMax||o.test(vt);if(!tt.isWhitespace&&!tt.isEmpty)me++;if(ge&&ee&&!tt.isWhitespace&&Je+Ye+Re>I&&je){if(_e.glyphAt(je-1).glyphObj.canBreakAfter)st=new u,Re=-Je;else for(let Nt=je;Nt--;)if(Nt===0&&T==="break-word"){st=new u,Re=-Je;break}else if(_e.glyphAt(Nt).glyphObj.canBreakAfter){st=_e.splitAt(Nt+1);let Ot=st.glyphAt(0).x;Re-=Ot;for(let Ut=st.count;Ut--;)st.glyphAt(Ut).x-=Ot;break}if(st)_e.isSoftWrapped=!0,_e=st,ye.push(_e),de=I}let St=_e.glyphAt(_e.count);if(St.glyphObj=tt,St.x=Je+Re,St.y=$e,St.width=Ye,St.charIndex=ft,St.fontData=xt,vt===`
`)_e=new u,ye.push(_e),Re=-(Je+Ye+C*f)+M}),Me=Ze+Fe.advanceWidth*Yt+C*f});let Se=0;ye.forEach((dt)=>{let rt=!0;for(let pt=dt.count;pt--;){let ct=dt.glyphAt(pt);if(rt&&!ct.glyphObj.isWhitespace){if(dt.width=ct.x+ct.width,dt.width>de)de=dt.width;rt=!1}let{lineHeight:Ct,capHeight:kt,xHeight:Lt,baseline:Bt}=ct.fontData;if(Ct>dt.lineHeight)dt.lineHeight=Ct;let xt=Bt-dt.baseline;if(xt<0)dt.baseline+=xt,dt.cap+=xt,dt.ex+=xt;dt.cap=Math.max(dt.cap,dt.baseline+kt),dt.ex=Math.max(dt.ex,dt.baseline+Lt)}dt.baseline-=Se,dt.cap-=Se,dt.ex-=Se,Se+=dt.lineHeight});let Ne=0,Le=0;if(N){if(typeof N==="number")Ne=-N;else if(typeof N==="string")Ne=-de*(N==="left"?0:N==="center"?0.5:N==="right"?1:l(N))}if(D){if(typeof D==="number")Le=-D;else if(typeof D==="string")Le=D==="top"?0:D==="top-baseline"?-ye[0].baseline:D==="top-cap"?-ye[0].cap:D==="top-ex"?-ye[0].ex:D==="middle"?Se/2:D==="bottom"?Se:D==="bottom-baseline"?-ye[ye.length-1].baseline:l(D)*Se}if(!L){let dt=t.getEmbeddingLevels(p,v);if(se=new Uint16Array(me),ne=new Uint8Array(me),re=new Float32Array(me*2),Z={},ce=[1/0,1/0,-1/0,-1/0],ue=[],O)ie=new Float32Array(p.length*4);if(j)te=new Uint8Array(me*3);let rt=0,pt=-1,ct=-1,Ct,kt;if(ye.forEach((Lt,Bt)=>{let{count:xt,width:Yt}=Lt;if(xt>0){let ut=0;for(let ft=xt;ft--&&Lt.glyphAt(ft).glyphObj.isWhitespace;)ut++;let Ze=0,Fe=0;if(P==="center")Ze=(de-Yt)/2;else if(P==="right")Ze=de-Yt;else if(P==="justify"&&Lt.isSoftWrapped){let ft=0;for(let vt=xt-ut;vt--;)if(Lt.glyphAt(vt).glyphObj.isWhitespace)ft++;Fe=(de-Yt)/ft}if(Fe||Ze){let ft=0;for(let vt=0;vt<xt;vt++){let Ye=Lt.glyphAt(vt),je=Ye.glyphObj;if(Ye.x+=Ze+ft,Fe!==0&&je.isWhitespace&&vt<xt-ut)ft+=Fe,Ye.width+=Fe}}let tt=t.getReorderSegments(p,dt,Lt.glyphAt(0).charIndex,Lt.glyphAt(Lt.count-1).charIndex);for(let ft=0;ft<tt.length;ft++){let[vt,Ye]=tt[ft],je=1/0,st=-1/0;for(let St=0;St<xt;St++)if(Lt.glyphAt(St).charIndex>=vt){let Nt=St,Ot=St;for(;Ot<xt;Ot++){let Ut=Lt.glyphAt(Ot);if(Ut.charIndex>Ye)break;if(Ot<xt-ut)je=Math.min(je,Ut.x),st=Math.max(st,Ut.x+Ut.width)}for(let Ut=Nt;Ut<Ot;Ut++){let mn=Lt.glyphAt(Ut);mn.x=st-(mn.x+mn.width-je)}break}}let Je,$e=(ft)=>Je=ft;for(let ft=0;ft<xt;ft++){let vt=Lt.glyphAt(ft);Je=vt.glyphObj;let Ye=Je.index,je=dt.levels[vt.charIndex]&1;if(je){let st=t.getMirroredCharacter(p[vt.charIndex]);if(st)vt.fontData.fontObj.forEachGlyph(st,0,0,$e)}if(O){let{charIndex:st,fontData:St}=vt,Nt=vt.x+Ne,Ot=vt.x+vt.width+Ne;ie[st*4]=je?Ot:Nt,ie[st*4+1]=je?Nt:Ot,ie[st*4+2]=Lt.baseline+St.caretBottom+Le,ie[st*4+3]=Lt.baseline+St.caretTop+Le;let Ut=st-pt;if(Ut>1)h(ie,pt,Ut);pt=st}if(j){let{charIndex:st}=vt;while(st>ct)if(ct++,j.hasOwnProperty(ct))kt=j[ct]}if(!Je.isWhitespace&&!Je.isEmpty){let st=rt++,{fontSizeMult:St,src:Nt,index:Ot}=vt.fontData,Ut=Z[Nt]||(Z[Nt]={});if(!Ut[Ye])Ut[Ye]={path:Je.path,pathBounds:[Je.xMin,Je.yMin,Je.xMax,Je.yMax]};let mn=vt.x+Ne,_n=vt.y+Lt.baseline+Le;re[st*2]=mn,re[st*2+1]=_n;let En=mn+Je.xMin*St,Qn=_n+Je.yMin*St,ln=mn+Je.xMax*St,hn=_n+Je.yMax*St;if(En<ce[0])ce[0]=En;if(Qn<ce[1])ce[1]=Qn;if(ln>ce[2])ce[2]=ln;if(hn>ce[3])ce[3]=hn;if(st%U===0)Ct={start:st,end:st,rect:[1/0,1/0,-1/0,-1/0]},ue.push(Ct);Ct.end++;let Zn=Ct.rect;if(En<Zn[0])Zn[0]=En;if(Qn<Zn[1])Zn[1]=Qn;if(ln>Zn[2])Zn[2]=ln;if(hn>Zn[3])Zn[3]=hn;if(se[st]=Ye,ne[st]=Ot,j){let bo=st*3;te[bo]=kt>>16&255,te[bo+1]=kt>>8&255,te[bo+2]=kt&255}}}}}),ie){let Lt=p.length-pt;if(Lt>1)h(ie,pt,Lt)}}let nt=[];xe.forEach(({index:dt,src:rt,unitsPerEm:pt,ascender:ct,descender:Ct,lineHeight:kt,capHeight:Lt,xHeight:Bt})=>{nt[dt]={src:rt,unitsPerEm:pt,ascender:ct,descender:Ct,lineHeight:kt,capHeight:Lt,xHeight:Bt}}),K.typesetting=d()-Ee,Y({glyphIds:se,glyphFontIndices:ne,glyphPositions:re,glyphData:Z,fontData:nt,caretPositions:ie,glyphColors:te,chunkedBounds:ue,fontSize:f,topBaseline:Le+ye[0].baseline,blockBounds:[Ne,Le-Se,Ne+de,Le],visibleBounds:ce,timings:K})})}function c(p,m){a({...p,metricsOnly:!0},(A)=>{let[g,f,y,x]=A.blockBounds;m({width:y-g,height:x-f})})}function l(p){let m=p.match(/^([\d.]+)%$/),A=m?parseFloat(m[1]):NaN;return isNaN(A)?0:A/100}function h(p,m,A){let g=p[m*4],f=p[m*4+1],y=p[m*4+2],x=p[m*4+3],C=(f-g)/A;for(let b=0;b<A;b++){let I=(m+b)*4;p[I]=g+C*b,p[I+1]=g+C*(b+1),p[I+2]=y,p[I+3]=x}}function d(){return(self.performance||Date).now()}function u(){this.data=[]}let _=["glyphObj","x","y","width","charIndex","fontData"];return u.prototype={width:0,lineHeight:0,baseline:0,cap:0,ex:0,isSoftWrapped:!1,get count(){return Math.ceil(this.data.length/_.length)},glyphAt(p){let m=u.flyweight;return m.data=this.data,m.index=p,m},splitAt(p){let m=new u;return m.data=this.data.splice(p*_.length),m}},u.flyweight=_.reduce((p,m,A,g)=>(Object.defineProperty(p,m,{get(){return this.data[this.index*_.length+A]},set(f){this.data[this.index*_.length+A]=f}}),p),{data:null,index:0}),{typeset:a,measure:c}}var Rz=()=>(self.performance||Date).now(),pxe=zOe(),nMt;function ezo(e,t,n,o,r,i,s,a,c,l,h=!0){if(!h)return rMt(e,t,n,o,r,i,s,a,c,l);return nzo(e,t,n,o,r,i,s,a,c,l).then(null,(d)=>{if(!nMt)console.warn("WebGL SDF generation failed, falling back to JS",d),nMt=!0;return rMt(e,t,n,o,r,i,s,a,c,l)})}var uxe=[],tzo=5,UOe=0;function uMt(){let e=Rz();while(uxe.length&&Rz()-e<tzo)uxe.shift()();UOe=uxe.length?setTimeout(uMt,0):0}var nzo=(...e)=>new Promise((t,n)=>{if(uxe.push(()=>{let o=Rz();try{pxe.webgl.generateIntoCanvas(...e),t({timing:Rz()-o})}catch(r){n(r)}}),!UOe)UOe=setTimeout(uMt,0)}),ozo=4,rzo=2000,oMt={},izo=0;function rMt(e,t,n,o,r,i,s,a,c,l){let h="TroikaTextSDFGenerator_JS_"+izo++%ozo,d=oMt[h];if(!d)d=oMt[h]={workerModule:Dz({name:h,workerId:h,dependencies:[zOe,Rz],init(u,_){let p=u().javascript.generate;return function(...m){let A=_();return{textureData:p(...m),timing:_()-A}}},getTransferables(u){return[u.textureData.buffer]}}),requests:0,idleTimer:null};return d.requests++,clearTimeout(d.idleTimer),d.workerModule(e,t,n,o,r,i).then(({textureData:u,timing:_})=>{let p=Rz(),m=new Uint8Array(u.length*4);for(let A=0;A<u.length;A++)m[A*4+l]=u[A];if(pxe.webglUtils.renderImageData(s,m,a,c,e,t,1<<3-l),_+=Rz()-p,--d.requests===0)d.idleTimer=setTimeout(()=>{$Et(h)},rzo);return{timing:_}})}function szo(e){if(!e._warm)pxe.webgl.isSupported(e),e._warm=!0}var azo=pxe.webglUtils.resizeWebGLCanvasWithoutClearing,rR={defaultFontURL:null,unicodeFontsURL:null,sdfGlyphSize:64,sdfMargin:0.0625,sdfExponent:9,textureWidth:2048,useWorker:!0},czo=new Do,pMt=!1;function Kj(){return(self.performance||Date).now()}function mMt(e){if(pMt)console.warn("configureTextBuilder called after first font request; will be ignored.");else gMt(rR,e)}var iMt=Object.create(null);function lzo(e,t){pMt=!0,e=gMt({},e);let n=Kj(),{defaultFontURL:o}=rR,r=[];if(o)r.push({label:"default",src:sMt(o)});if(e.font)r.push({label:"user",src:sMt(e.font)});if(e.font=r,e.text=""+e.text,e.sdfGlyphSize=e.sdfGlyphSize||rR.sdfGlyphSize,e.unicodeFontsURL=e.unicodeFontsURL||rR.unicodeFontsURL,e.colorRanges!=null){let _={};for(let p in e.colorRanges)if(e.colorRanges.hasOwnProperty(p)){let m=e.colorRanges[p];if(typeof m!=="number")m=czo.set(m).getHex();_[p]=m}e.colorRanges=_}Object.freeze(e);let{textureWidth:i,sdfExponent:s}=rR,{sdfGlyphSize:a}=e,c=i/a*4,l=iMt[a];if(!l){let _=document.createElement("canvas");_.width=i,_.height=a*256/c,l=iMt[a]={glyphCount:0,sdfGlyphSize:a,sdfCanvas:_,sdfTexture:new Bl(_,void 0,void 0,void 0,uc,uc),contextLost:!1,glyphsByFont:new Map},l.sdfTexture.generateMipmaps=!1,hzo(l)}let{sdfTexture:h,sdfCanvas:d}=l;(rR.useWorker?fMt:uzo)(e).then((_)=>{let{glyphIds:p,glyphFontIndices:m,fontData:A,glyphPositions:g,fontSize:f,timings:y}=_,x=[],C=new Float32Array(p.length*4),b=0,I=0,v=Kj(),P=A.map((D)=>{let L=l.glyphsByFont.get(D.src);if(!L)l.glyphsByFont.set(D.src,L=new Map);return L});p.forEach((D,L)=>{let H=m[L],{src:V,unitsPerEm:O}=A[H],U=P[H].get(D);if(!U){let{path:J,pathBounds:ee}=_.glyphData[V][D],se=Math.max(ee[2]-ee[0],ee[3]-ee[1])/a*(rR.sdfMargin*a+0.5),ne=l.glyphCount++,re=[ee[0]-se,ee[1]-se,ee[2]+se,ee[3]+se];P[H].set(D,U={path:J,atlasIndex:ne,sdfViewBox:re}),x.push(U)}let{sdfViewBox:j}=U,Y=g[I++],X=g[I++],K=f/O;C[b++]=Y+j[0]*K,C[b++]=X+j[1]*K,C[b++]=Y+j[2]*K,C[b++]=X+j[3]*K,p[L]=U.atlasIndex}),y.quads=(y.quads||0)+(Kj()-v);let M=Kj();y.sdf={};let B=d.height,T=Math.ceil(l.glyphCount/c),N=Math.pow(2,Math.ceil(Math.log2(T*a)));if(N>B)console.info(`Increasing SDF texture size ${B}->${N}`),azo(d,i,N),h.dispose();Promise.all(x.map((D)=>_Mt(D,l,e.gpuAccelerateSDF).then(({timing:L})=>{y.sdf[D.atlasIndex]=L}))).then(()=>{if(x.length&&!l.contextLost)AMt(l),h.needsUpdate=!0;y.sdfTotal=Kj()-M,y.total=Kj()-n,t(Object.freeze({parameters:e,sdfTexture:h,sdfGlyphSize:a,sdfExponent:s,glyphBounds:C,glyphAtlasIndices:p,glyphColors:_.glyphColors,caretPositions:_.caretPositions,chunkedBounds:_.chunkedBounds,ascender:_.ascender,descender:_.descender,lineHeight:_.lineHeight,capHeight:_.capHeight,xHeight:_.xHeight,topBaseline:_.topBaseline,blockBounds:_.blockBounds,visibleBounds:_.visibleBounds,timings:_.timings}))})}),Promise.resolve().then(()=>{if(!l.contextLost)szo(d)})}function _Mt({path:e,atlasIndex:t,sdfViewBox:n},{sdfGlyphSize:o,sdfCanvas:r,contextLost:i},s){if(i)return Promise.resolve({timing:-1});let{textureWidth:a,sdfExponent:c}=rR,l=Math.max(n[2]-n[0],n[3]-n[1]),h=Math.floor(t/4),d=h%(a/o)*o,u=Math.floor(h/(a/o))*o,_=t%4;return ezo(o,o,e,n,l,c,r,d,u,_,s)}function hzo(e){let t=e.sdfCanvas;t.addEventListener("webglcontextlost",(n)=>{console.log("Context Lost",n),n.preventDefault(),e.contextLost=!0}),t.addEventListener("webglcontextrestored",(n)=>{console.log("Context Restored",n),e.contextLost=!1;let o=[];e.glyphsByFont.forEach((r)=>{r.forEach((i)=>{o.push(_Mt(i,e,!0))})}),Promise.all(o).then(()=>{AMt(e),e.sdfTexture.needsUpdate=!0})})}function gMt(e,t){for(let n in t)if(t.hasOwnProperty(n))e[n]=t[n];return e}var hxe;function sMt(e){if(!hxe)hxe=typeof document>"u"?{}:document.createElement("a");return hxe.href=e,hxe.href}function AMt(e){if(typeof createImageBitmap!=="function"){console.info("Safari<15: applying SDF canvas workaround");let{sdfCanvas:t,sdfTexture:n}=e,{width:o,height:r}=t,i=e.sdfCanvas.getContext("webgl"),s=n.image.data;if(!s||s.length!==o*r*4)s=new Uint8Array(o*r*4),n.image={width:o,height:r,data:s},n.flipY=!1,n.isDataTexture=!0;i.readPixels(0,0,o,r,i.RGBA,i.UNSIGNED_BYTE,s)}}var dzo=Dz({name:"Typesetter",dependencies:[ZFo,JFo,qEt],init(e,t,n){return e(t,n())}}),fMt=Dz({name:"Typesetter",dependencies:[dzo],init(e){return function(t){return new Promise((n)=>{e.typeset(t,n)})}},getTransferables(e){let t=[];for(let n in e)if(e[n]&&e[n].buffer)t.push(e[n].buffer);return t}}),uzo=fMt.onMainThread;var aMt={};function pzo(e){let t=aMt[e];if(!t)t=aMt[e]=new v2(1,1,e,e).translate(0.5,0.5,0);return t}var mzo="aTroikaGlyphBounds",cMt="aTroikaGlyphIndex",_zo="aTroikaGlyphColor";class yMt extends NOe{constructor(){super();this.detail=1,this.curveRadius=0,this.groups=[{start:0,count:1/0,materialIndex:0},{start:0,count:1/0,materialIndex:1}],this.boundingSphere=new bx,this.boundingBox=new dm}computeBoundingSphere(){}computeBoundingBox(){}set detail(e){if(e!==this._detail){if(this._detail=e,typeof e!=="number"||e<1)e=1;let t=pzo(e);["position","normal","uv"].forEach((n)=>{this.attributes[n]=t.attributes[n].clone()}),this.setIndex(t.getIndex().clone())}}get detail(){return this._detail}set curveRadius(e){if(e!==this._curveRadius)this._curveRadius=e,this._updateBounds()}get curveRadius(){return this._curveRadius}updateGlyphs(e,t,n,o,r){this.updateAttributeData(mzo,e,4),this.updateAttributeData(cMt,t,1),this.updateAttributeData(_zo,r,3),this._blockBounds=n,this._chunkedBounds=o,this.instanceCount=t.length,this._updateBounds()}_updateBounds(){let e=this._blockBounds;if(e){let{curveRadius:t,boundingBox:n}=this;if(t){let{PI:o,floor:r,min:i,max:s,sin:a,cos:c}=Math,l=o/2,h=o*2,d=Math.abs(t),u=e[0]/d,_=e[2]/d,p=r((u+l)/h)!==r((_+l)/h)?-d:i(a(u)*d,a(_)*d),m=r((u-l)/h)!==r((_-l)/h)?d:s(a(u)*d,a(_)*d),A=r((u+o)/h)!==r((_+o)/h)?d*2:s(d-c(u)*d,d-c(_)*d);n.min.set(p,e[1],t<0?-A:0),n.max.set(m,e[3],t<0?0:A)}else n.min.set(e[0],e[1],0),n.max.set(e[2],e[3],0);n.getBoundingSphere(this.boundingSphere)}}applyClipRect(e){let t=this.getAttribute(cMt).count,n=this._chunkedBounds;if(n)for(let o=n.length;o--;){t=n[o].end;let r=n[o].rect;if(r[1]<e.w&&r[3]>e.y&&r[0]<e.z&&r[2]>e.x)break}this.instanceCount=t}updateAttributeData(e,t,n){let o=this.getAttribute(e);if(t)if(o&&o.array.length===t.length)o.array.set(t),o.needsUpdate=!0;else this.setAttribute(e,new Iz(t,n)),delete this._maxInstanceCount,this.dispose();else if(o)this.deleteAttribute(e)}}var gzo=`
uniform vec2 uTroikaSDFTextureSize;
uniform float uTroikaSDFGlyphSize;
uniform vec4 uTroikaTotalBounds;
uniform vec4 uTroikaClipRect;
uniform mat3 uTroikaOrient;
uniform bool uTroikaUseGlyphColors;
uniform float uTroikaEdgeOffset;
uniform float uTroikaBlurRadius;
uniform vec2 uTroikaPositionOffset;
uniform float uTroikaCurveRadius;
attribute vec4 aTroikaGlyphBounds;
attribute float aTroikaGlyphIndex;
attribute vec3 aTroikaGlyphColor;
varying vec2 vTroikaGlyphUV;
varying vec4 vTroikaTextureUVBounds;
varying float vTroikaTextureChannel;
varying vec3 vTroikaGlyphColor;
varying vec2 vTroikaGlyphDimensions;
`,Azo=`
vec4 bounds = aTroikaGlyphBounds;
bounds.xz += uTroikaPositionOffset.x;
bounds.yw -= uTroikaPositionOffset.y;

vec4 outlineBounds = vec4(
  bounds.xy - uTroikaEdgeOffset - uTroikaBlurRadius,
  bounds.zw + uTroikaEdgeOffset + uTroikaBlurRadius
);
vec4 clippedBounds = vec4(
  clamp(outlineBounds.xy, uTroikaClipRect.xy, uTroikaClipRect.zw),
  clamp(outlineBounds.zw, uTroikaClipRect.xy, uTroikaClipRect.zw)
);

vec2 clippedXY = (mix(clippedBounds.xy, clippedBounds.zw, position.xy) - bounds.xy) / (bounds.zw - bounds.xy);

position.xy = mix(bounds.xy, bounds.zw, clippedXY);

uv = (position.xy - uTroikaTotalBounds.xy) / (uTroikaTotalBounds.zw - uTroikaTotalBounds.xy);

float rad = uTroikaCurveRadius;
if (rad != 0.0) {
  float angle = position.x / rad;
  position.xz = vec2(sin(angle) * rad, rad - cos(angle) * rad);
  normal.xz = vec2(sin(angle), cos(angle));
}
  
position = uTroikaOrient * position;
normal = uTroikaOrient * normal;

vTroikaGlyphUV = clippedXY.xy;
vTroikaGlyphDimensions = vec2(bounds[2] - bounds[0], bounds[3] - bounds[1]);


float txCols = uTroikaSDFTextureSize.x / uTroikaSDFGlyphSize;
vec2 txUvPerSquare = uTroikaSDFGlyphSize / uTroikaSDFTextureSize;
vec2 txStartUV = txUvPerSquare * vec2(
  mod(floor(aTroikaGlyphIndex / 4.0), txCols),
  floor(floor(aTroikaGlyphIndex / 4.0) / txCols)
);
vTroikaTextureUVBounds = vec4(txStartUV, vec2(txStartUV) + txUvPerSquare);
vTroikaTextureChannel = mod(aTroikaGlyphIndex, 4.0);
`,fzo=`
uniform sampler2D uTroikaSDFTexture;
uniform vec2 uTroikaSDFTextureSize;
uniform float uTroikaSDFGlyphSize;
uniform float uTroikaSDFExponent;
uniform float uTroikaEdgeOffset;
uniform float uTroikaFillOpacity;
uniform float uTroikaBlurRadius;
uniform vec3 uTroikaStrokeColor;
uniform float uTroikaStrokeWidth;
uniform float uTroikaStrokeOpacity;
uniform bool uTroikaSDFDebug;
varying vec2 vTroikaGlyphUV;
varying vec4 vTroikaTextureUVBounds;
varying float vTroikaTextureChannel;
varying vec2 vTroikaGlyphDimensions;

float troikaSdfValueToSignedDistance(float alpha) {
  // Inverse of exponential encoding in webgl-sdf-generator
  
  float maxDimension = max(vTroikaGlyphDimensions.x, vTroikaGlyphDimensions.y);
  float absDist = (1.0 - pow(2.0 * (alpha > 0.5 ? 1.0 - alpha : alpha), 1.0 / uTroikaSDFExponent)) * maxDimension;
  float signedDist = absDist * (alpha > 0.5 ? -1.0 : 1.0);
  return signedDist;
}

float troikaGlyphUvToSdfValue(vec2 glyphUV) {
  vec2 textureUV = mix(vTroikaTextureUVBounds.xy, vTroikaTextureUVBounds.zw, glyphUV);
  vec4 rgba = texture2D(uTroikaSDFTexture, textureUV);
  float ch = floor(vTroikaTextureChannel + 0.5); //NOTE: can't use round() in WebGL1
  return ch == 0.0 ? rgba.r : ch == 1.0 ? rgba.g : ch == 2.0 ? rgba.b : rgba.a;
}

float troikaGlyphUvToDistance(vec2 uv) {
  return troikaSdfValueToSignedDistance(troikaGlyphUvToSdfValue(uv));
}

float troikaGetAADist() {
  
  #if defined(GL_OES_standard_derivatives) || __VERSION__ >= 300
  return length(fwidth(vTroikaGlyphUV * vTroikaGlyphDimensions)) * 0.5;
  #else
  return vTroikaGlyphDimensions.x / 64.0;
  #endif
}

float troikaGetFragDistValue() {
  vec2 clampedGlyphUV = clamp(vTroikaGlyphUV, 0.5 / uTroikaSDFGlyphSize, 1.0 - 0.5 / uTroikaSDFGlyphSize);
  float distance = troikaGlyphUvToDistance(clampedGlyphUV);
 
  // Extrapolate distance when outside bounds:
  distance += clampedGlyphUV == vTroikaGlyphUV ? 0.0 : 
    length((vTroikaGlyphUV - clampedGlyphUV) * vTroikaGlyphDimensions);

  

  return distance;
}

float troikaGetEdgeAlpha(float distance, float distanceOffset, float aaDist) {
  #if defined(IS_DEPTH_MATERIAL) || defined(IS_DISTANCE_MATERIAL)
  float alpha = step(-distanceOffset, -distance);
  #else

  float alpha = smoothstep(
    distanceOffset + aaDist,
    distanceOffset - aaDist,
    distance
  );
  #endif

  return alpha;
}
`,yzo=`
float aaDist = troikaGetAADist();
float fragDistance = troikaGetFragDistValue();
float edgeAlpha = uTroikaSDFDebug ?
  troikaGlyphUvToSdfValue(vTroikaGlyphUV) :
  troikaGetEdgeAlpha(fragDistance, uTroikaEdgeOffset, max(aaDist, uTroikaBlurRadius));

#if !defined(IS_DEPTH_MATERIAL) && !defined(IS_DISTANCE_MATERIAL)
vec4 fillRGBA = gl_FragColor;
fillRGBA.a *= uTroikaFillOpacity;
vec4 strokeRGBA = uTroikaStrokeWidth == 0.0 ? fillRGBA : vec4(uTroikaStrokeColor, uTroikaStrokeOpacity);
if (fillRGBA.a == 0.0) fillRGBA.rgb = strokeRGBA.rgb;
gl_FragColor = mix(fillRGBA, strokeRGBA, smoothstep(
  -uTroikaStrokeWidth - aaDist,
  -uTroikaStrokeWidth + aaDist,
  fragDistance
));
gl_FragColor.a *= edgeAlpha;
#endif

if (edgeAlpha == 0.0) {
  discard;
}
`;function xzo(e){let t=lxe(e,{chained:!0,extensions:{derivatives:!0},uniforms:{uTroikaSDFTexture:{value:null},uTroikaSDFTextureSize:{value:new go},uTroikaSDFGlyphSize:{value:0},uTroikaSDFExponent:{value:0},uTroikaTotalBounds:{value:new Ah(0,0,0,0)},uTroikaClipRect:{value:new Ah(0,0,0,0)},uTroikaEdgeOffset:{value:0},uTroikaFillOpacity:{value:1},uTroikaPositionOffset:{value:new go},uTroikaCurveRadius:{value:0},uTroikaBlurRadius:{value:0},uTroikaStrokeWidth:{value:0},uTroikaStrokeColor:{value:new Do},uTroikaStrokeOpacity:{value:1},uTroikaOrient:{value:new wa},uTroikaUseGlyphColors:{value:!0},uTroikaSDFDebug:{value:!1}},vertexDefs:gzo,vertexTransform:Azo,fragmentDefs:fzo,fragmentColorTransform:yzo,customRewriter({vertexShader:n,fragmentShader:o}){let r=/\buniform\s+vec3\s+diffuse\b/;if(r.test(o)){if(o=o.replace(r,"varying vec3 vTroikaGlyphColor").replace(/\bdiffuse\b/g,"vTroikaGlyphColor"),!r.test(n))n=n.replace(VOe,`uniform vec3 diffuse;
$&
vTroikaGlyphColor = uTroikaUseGlyphColors ? aTroikaGlyphColor / 255.0 : diffuse;
`)}return{vertexShader:n,fragmentShader:o}}});return t.transparent=!0,t.forceSinglePass=!0,Object.defineProperties(t,{isTroikaTextMaterial:{value:!0},shadowSide:{get(){return this.side},set(){}}}),t}var WOe=new lA({color:16777215,side:A0,transparent:!0}),lMt=8421504,hMt=new Fi,dxe=new Dt,YOe=new Dt,Jie=[],Czo=new Dt,GOe="+x+y";function dMt(e){return Array.isArray(e)?e[0]:e}var xMt=()=>{let e=new Qo(new v2(1,1),WOe);return xMt=()=>e,e},CMt=()=>{let e=new Qo(new v2(1,1,32,1),WOe);return CMt=()=>e,e},bzo={type:"syncstart"},Izo={type:"synccomplete"},bMt=["font","fontSize","fontStyle","fontWeight","lang","letterSpacing","lineHeight","maxWidth","overflowWrap","text","direction","textAlign","textIndent","whiteSpace","anchorX","anchorY","colorRanges","sdfGlyphSize"],vzo=bMt.concat("material","color","depthOffset","clipRect","curveRadius","orientation","glyphGeometryDetail");class $j extends Qo{constructor(){let e=new yMt;super(e,null);this.text="",this.anchorX=0,this.anchorY=0,this.curveRadius=0,this.direction="auto",this.font=null,this.unicodeFontsURL=null,this.fontSize=0.1,this.fontWeight="normal",this.fontStyle="normal",this.lang=null,this.letterSpacing=0,this.lineHeight="normal",this.maxWidth=1/0,this.overflowWrap="normal",this.textAlign="left",this.textIndent=0,this.whiteSpace="normal",this.material=null,this.color=null,this.colorRanges=null,this.outlineWidth=0,this.outlineColor=0,this.outlineOpacity=1,this.outlineBlur=0,this.outlineOffsetX=0,this.outlineOffsetY=0,this.strokeWidth=0,this.strokeColor=lMt,this.strokeOpacity=1,this.fillOpacity=1,this.depthOffset=0,this.clipRect=null,this.orientation=GOe,this.glyphGeometryDetail=1,this.sdfGlyphSize=null,this.gpuAccelerateSDF=!0,this.debugSDF=!1}sync(e){if(this._needsSync)if(this._needsSync=!1,this._isSyncing)(this._queuedSyncs||(this._queuedSyncs=[])).push(e);else this._isSyncing=!0,this.dispatchEvent(bzo),lzo({text:this.text,font:this.font,lang:this.lang,fontSize:this.fontSize||0.1,fontWeight:this.fontWeight||"normal",fontStyle:this.fontStyle||"normal",letterSpacing:this.letterSpacing||0,lineHeight:this.lineHeight||"normal",maxWidth:this.maxWidth,direction:this.direction||"auto",textAlign:this.textAlign,textIndent:this.textIndent,whiteSpace:this.whiteSpace,overflowWrap:this.overflowWrap,anchorX:this.anchorX,anchorY:this.anchorY,colorRanges:this.colorRanges,includeCaretPositions:!0,sdfGlyphSize:this.sdfGlyphSize,gpuAccelerateSDF:this.gpuAccelerateSDF,unicodeFontsURL:this.unicodeFontsURL},(t)=>{this._isSyncing=!1,this._textRenderInfo=t,this.geometry.updateGlyphs(t.glyphBounds,t.glyphAtlasIndices,t.blockBounds,t.chunkedBounds,t.glyphColors);let n=this._queuedSyncs;if(n)this._queuedSyncs=null,this._needsSync=!0,this.sync(()=>{n.forEach((o)=>o&&o())});if(this.dispatchEvent(Izo),e)e()})}onBeforeRender(e,t,n,o,r,i){if(this.sync(),r.isTroikaTextMaterial)this._prepareForRender(r)}dispose(){this.geometry.dispose()}get textRenderInfo(){return this._textRenderInfo||null}createDerivedMaterial(e){return xzo(e)}get material(){let e=this._derivedMaterial,t=this._baseMaterial||this._defaultMaterial||(this._defaultMaterial=WOe.clone());if(!e||!e.isDerivedFrom(t))e=this._derivedMaterial=this.createDerivedMaterial(t),t.addEventListener("dispose",function n(){t.removeEventListener("dispose",n),e.dispose()});if(this.hasOutline()){let n=e._outlineMtl;if(!n)n=e._outlineMtl=Object.create(e,{id:{value:e.id+0.1}}),n.isTextOutlineMaterial=!0,n.depthWrite=!1,n.map=null,e.addEventListener("dispose",function o(){e.removeEventListener("dispose",o),n.dispose()});return[n,e]}else return e}set material(e){if(e&&e.isTroikaTextMaterial)this._derivedMaterial=e,this._baseMaterial=e.baseMaterial;else this._baseMaterial=e}hasOutline(){return!!(this.outlineWidth||this.outlineBlur||this.outlineOffsetX||this.outlineOffsetY)}get glyphGeometryDetail(){return this.geometry.detail}set glyphGeometryDetail(e){this.geometry.detail=e}get curveRadius(){return this.geometry.curveRadius}set curveRadius(e){this.geometry.curveRadius=e}get customDepthMaterial(){return dMt(this.material).getDepthMaterial()}set customDepthMaterial(e){}get customDistanceMaterial(){return dMt(this.material).getDistanceMaterial()}set customDistanceMaterial(e){}_prepareForRender(e){let{isTextOutlineMaterial:t,uniforms:n}=e,o=this.textRenderInfo;if(o){let{sdfTexture:s,blockBounds:a}=o;n.uTroikaSDFTexture.value=s,n.uTroikaSDFTextureSize.value.set(s.image.width,s.image.height),n.uTroikaSDFGlyphSize.value=o.sdfGlyphSize,n.uTroikaSDFExponent.value=o.sdfExponent,n.uTroikaTotalBounds.value.fromArray(a),n.uTroikaUseGlyphColors.value=!t&&!!o.glyphColors;let c=0,l=0,h=0,d,u,_,p=0,m=0;if(t){let{outlineWidth:g,outlineOffsetX:f,outlineOffsetY:y,outlineBlur:x,outlineOpacity:C}=this;c=this._parsePercent(g)||0,l=Math.max(0,this._parsePercent(x)||0),d=C,p=this._parsePercent(f)||0,m=this._parsePercent(y)||0}else{if(h=Math.max(0,this._parsePercent(this.strokeWidth)||0),h){if(_=this.strokeColor,n.uTroikaStrokeColor.value.set(_==null?lMt:_),u=this.strokeOpacity,u==null)u=1}d=this.fillOpacity}n.uTroikaEdgeOffset.value=c,n.uTroikaPositionOffset.value.set(p,m),n.uTroikaBlurRadius.value=l,n.uTroikaStrokeWidth.value=h,n.uTroikaStrokeOpacity.value=u,n.uTroikaFillOpacity.value=d==null?1:d,n.uTroikaCurveRadius.value=this.curveRadius||0;let A=this.clipRect;if(A&&Array.isArray(A)&&A.length===4)n.uTroikaClipRect.value.fromArray(A);else{let g=(this.fontSize||0.1)*100;n.uTroikaClipRect.value.set(a[0]-g,a[1]-g,a[2]+g,a[3]+g)}this.geometry.applyClipRect(n.uTroikaClipRect.value)}n.uTroikaSDFDebug.value=!!this.debugSDF,e.polygonOffset=!!this.depthOffset,e.polygonOffsetFactor=e.polygonOffsetUnits=this.depthOffset||0;let r=t?this.outlineColor||0:this.color;if(r==null)delete e.color;else{let s=e.hasOwnProperty("color")?e.color:e.color=new Do;if(r!==s._input||typeof r==="object")s.set(s._input=r)}let i=this.orientation||GOe;if(i!==e._orientation){let s=n.uTroikaOrient.value;i=i.replace(/[^-+xyz]/g,"");let a=i!==GOe&&i.match(/^([-+])([xyz])([-+])([xyz])$/);if(a){let[,c,l,h,d]=a;dxe.set(0,0,0)[l]=c==="-"?1:-1,YOe.set(0,0,0)[d]=h==="-"?-1:1,hMt.lookAt(Czo,dxe.cross(YOe),YOe),s.setFromMatrix4(hMt)}else s.identity();e._orientation=i}}_parsePercent(e){if(typeof e==="string"){let t=e.match(/^(-?[\d.]+)%$/),n=t?parseFloat(t[1]):NaN;e=(isNaN(n)?0:n/100)*this.fontSize}return e}localPositionToTextCoords(e,t=new go){t.copy(e);let n=this.curveRadius;if(n)t.x=Math.atan2(e.x,Math.abs(n)-Math.abs(e.z))*Math.abs(n);return t}worldPositionToTextCoords(e,t=new go){return dxe.copy(e),this.localPositionToTextCoords(this.worldToLocal(dxe),t)}raycast(e,t){let{textRenderInfo:n,curveRadius:o}=this;if(n){let r=n.blockBounds,i=o?CMt():xMt(),s=i.geometry,{position:a,uv:c}=s.attributes;for(let l=0;l<c.count;l++){let h=r[0]+c.getX(l)*(r[2]-r[0]),d=r[1]+c.getY(l)*(r[3]-r[1]),u=0;if(o)u=o-Math.cos(h/o)*o,h=Math.sin(h/o)*o;a.setXYZ(l,h,d,u)}s.boundingSphere=this.geometry.boundingSphere,s.boundingBox=this.geometry.boundingBox,i.matrixWorld=this.matrixWorld,i.material.side=this.material.side,Jie.length=0,i.raycast(e,Jie);for(let l=0;l<Jie.length;l++)Jie[l].object=this,t.push(Jie[l])}}copy(e){let t=this.geometry;return super.copy(e),this.geometry=t,vzo.forEach((n)=>{this[n]=e[n]}),this}clone(){return new this.constructor().copy(this)}}bMt.forEach((e)=>{let t="_private_"+e;Object.defineProperty($j.prototype,e,{get(){return this[t]},set(n){if(n!==this[t])this[t]=n,this._needsSync=!0}})});var Mys=new dm,wys=new Do;var nh=Qe(rn(),1);Ko();function iR([e,t],[n,o],{lineThickness:r=0}={}){if(r===0)return dA(e,t,n,o);return Szo(e,t,n,o)<=r}function dA(e,t,n,o){let r=Zie(e,t,n),i=Zie(e,t,o),s=Zie(n,o,e),a=Zie(n,o,t);if(r!==i&&s!==a)return!0;if(r===0&&Qz(e,n,t))return!0;if(i===0&&Qz(e,o,t))return!0;if(s===0&&Qz(n,e,o))return!0;if(a===0&&Qz(n,t,o))return!0;return!1}function Zie(e,t,n){let o=(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y);if(o===0)return 0;return o>0?1:2}function Qz(e,t,n){return t.x<=Math.max(e.x,n.x)&&t.x>=Math.min(e.x,n.x)&&t.y<=Math.max(e.y,n.y)&&t.y>=Math.min(e.y,n.y)}function Szo(e,t,n,o){if(e.x===t.x&&e.y===t.y)return ia(e,n,o);if(n.x===o.x&&n.y===o.y)return ia(n,e,t);if(dA(e,t,n,o))return 0;let r=[ia(e,n,o),ia(t,n,o),ia(n,e,t),ia(o,e,t)];return Math.min(...r)}function ia(e,t,n){let o=(n.x-t.x)**2+(n.y-t.y)**2;if(o===0)return Tl(e,t);let r=((e.x-t.x)*(n.x-t.x)+(e.y-t.y)*(n.y-t.y))/o;r=Math.max(0,Math.min(1,r));let i={x:t.x+r*(n.x-t.x),y:t.y+r*(n.y-t.y)};return Tl(e,i)}function Tl(e,t){let n=e.x-t.x,o=e.y-t.y;return Math.sqrt(n*n+o*o)}function mxe(e,t,n,o){let r=t.x-e.x,i=t.y-e.y,s=o.x-n.x,a=o.y-n.y,c=e.x-n.x,l=e.y-n.y,h=r*a-i*s;if(Math.abs(h)<0.0000000001)return null;let d=(l*s-c*a)/h,u=(r*l-i*c)/h,_=0.000000001;if(d>=-_&&d<=1+_&&u>=-_&&u<=1+_){let p=e.x+d*r,m=e.y+d*i;return{x:p,y:m}}return null}function ese(e,t,n){let o=(c)=>c.x>=n.minX&&c.x<=n.maxX&&c.y>=n.minY&&c.y<=n.maxY;if(o(e)||o(t))return!0;let r={x:n.minX,y:n.minY},i={x:n.maxX,y:n.minY},s={x:n.minX,y:n.maxY},a={x:n.maxX,y:n.maxY};return dA(e,t,r,i)||dA(e,t,i,a)||dA(e,t,a,s)||dA(e,t,s,r)}var Pzo=(e)=>{let t=[];for(let n=0;n<e.length;n++){let o=e[n],r=e[(n+1)%e.length];t.push([o,r])}return t},Ezo=(e,t,n)=>{let o=(e.y-t.y)*(n.x-t.x)-(e.x-t.x)*(n.y-t.y);if(Math.abs(o)>0.000000001)return!1;let r=(e.x-t.x)*(n.x-t.x)+(e.y-t.y)*(n.y-t.y);if(r<0)return!1;let i=(n.x-t.x)**2+(n.y-t.y)**2;if(i===0)return!1;if(r>i)return!1;return!0};var UC=(e,t)=>{if(t.length<3)return!1;let n=Pzo(t);for(let[r,i]of n)if(Ezo(e,r,i))return!0;let o=!1;for(let r=0,i=t.length-1;r<t.length;i=r++){let s=t[r].x,a=t[r].y,c=t[i].x,l=t[i].y;if(a>e.y!==l>e.y&&e.x<(c-s)*(e.y-a)/(l-a)+s)o=!o}return o};function sR(e){let t=e.width/2,n=e.height/2;return{minX:e.center.x-t,maxX:e.center.x+t,minY:e.center.y-n,maxY:e.center.y+n}}function _xe(e,t){let n=sR(e),o=sR(t),r=Math.max(n.minX-o.maxX,o.minX-n.maxX,0),i=Math.max(n.minY-o.maxY,o.minY-n.maxY,0),s={x:0,y:0},a={x:0,y:0};if(r===0&&i===0)return{distance:0,pointA:e.center,pointB:t.center};return s.x=Dh(e.center.x,o.minX,o.maxX),s.y=Dh(e.center.y,o.minY,o.maxY),a.x=Dh(t.center.x,n.minX,n.maxX),a.y=Dh(t.center.y,n.minY,n.maxY),{distance:Math.hypot(s.x-a.x,s.y-a.y),pointA:s,pointB:a}}function GM(e,t){return _xe(e,t)}function Dh(e,t,n){return Math.max(t,Math.min(n,e))}function gxe(e,t){let n=Number.POSITIVE_INFINITY,o={x:0,y:0},r={x:0,y:0};for(let i of e)for(let s of t){let{distance:a,pointA:c,pointB:l}=_xe(i,s);if(a<n)n=a,o=c,r=l}return{pointA:o,pointB:r,distance:n}}function Ix(e,t,n,o){if(e.x===t.x&&e.y===t.y)return ia(e,n,o);if(n.x===o.x&&n.y===o.y)return ia(n,e,t);if(dA(e,t,n,o))return 0;let r=[ia(e,n,o),ia(t,n,o),ia(n,e,t),ia(o,e,t)];return Math.min(...r)}function XOe(e,t,n){let o={x:n.minX,y:n.minY},r={x:n.maxX,y:n.minY},i={x:n.minX,y:n.maxY},s={x:n.maxX,y:n.maxY};if(dA(e,t,o,r)||dA(e,t,r,s)||dA(e,t,s,i)||dA(e,t,i,o))return 0;if(e.x>=n.minX&&e.x<=n.maxX&&e.y>=n.minY&&e.y<=n.maxY&&t.x>=n.minX&&t.x<=n.maxX&&t.y>=n.minY&&t.y<=n.maxY)return 0;let a=[ia(o,e,t),ia(r,e,t),ia(i,e,t),ia(s,e,t)];if(e.x>=n.minX&&e.x<=n.maxX&&e.y>=n.minY&&e.y<=n.maxY)return 0;if(t.x>=n.minX&&t.x<=n.maxX&&t.y>=n.minY&&t.y<=n.maxY)return 0;if(e.x<n.minX||e.x>n.maxX||e.y<n.minY||e.y>n.maxY){let c=Dh(e.x,n.minX,n.maxX),l=Dh(e.y,n.minY,n.maxY);a.push(Tl(e,{x:c,y:l}))}if(t.x<n.minX||t.x>n.maxX||t.y<n.minY||t.y>n.maxY){let c=Dh(t.x,n.minX,n.maxX),l=Dh(t.y,n.minY,n.maxY);a.push(Tl(t,{x:c,y:l}))}return Math.min(...a)}function tse(e,t,n){let o={x:n.x,y:n.y};if(e.x===t.x&&e.y===t.y)return Math.max(0,Tl(e,o)-n.radius);let r={x:t.x-e.x,y:t.y-e.y},i={x:o.x-e.x,y:o.y-e.y},s=r.x*r.x+r.y*r.y,a=Math.max(0,Math.min(1,(r.x*i.x+r.y*i.y)/s)),c={x:e.x+a*r.x,y:e.y+a*r.y},l=Tl(c,o);return Math.max(0,l-n.radius)}function W1(e,t,n){let o=n.x-t.x,r=n.y-t.y,i=o*o+r*r;if(i===0)return{x:t.x,y:t.y};let s=((e.x-t.x)*o+(e.y-t.y)*r)/i;return s=Math.max(0,Math.min(1,s)),{x:t.x+s*o,y:t.y+s*r}}var qj=(e,t)=>{let n={x:t.x-e.x,y:t.y-e.y},o=Math.sqrt(n.x**2+n.y**2);return{x:n.x/o,y:n.y/o}},m7=(e)=>{switch(e){case"up":return{x:0,y:1};case"down":return{x:0,y:-1};case"left":return{x:-1,y:0};case"right":return{x:1,y:0}}};function jOe({rows:e,cols:t,xSpacing:n,ySpacing:o,width:r,height:i,offsetX:s=0,offsetY:a=0,yDirection:c="cartesian",centered:l=!0}){let h=n??1,d=o??1,u=r??t*h,_=i??e*d,p=l?-u/2:0,m=l?-_/2:0,A=r?r/t:h,g=i?i/e:d,f=[];for(let y=0;y<e;y++)for(let x=0;x<t;x++){let C=y*t+x,b=s+p+x*A+A/2,I=a+y*g+g/2,v=c==="cartesian"?a+m+(e-1-y)*g+g/2:a+m+y*g+g/2;f.push({index:C,center:{x:b,y:v},topLeft:{x:b-A/2,y:v+g/2},bottomRight:{x:b+A/2,y:v-g/2},row:y,col:x})}return f}function nu(e){return(e%360+360)%360}function KOe(e,t){let n=t.width/2,o=t.height/2,r=t.center.x-n,i=t.center.x+n,s=t.center.y-o,a=t.center.y+o;if(e.x>=r&&e.x<=i&&e.y>=s&&e.y<=a)return 0;let c=Dh(e.x,r,i),l=Dh(e.y,s,a);return Tl(e,{x:c,y:l})}function $Oe(e,t){if(e.x>=t.minX&&e.x<=t.maxX&&e.y>=t.minY&&e.y<=t.maxY)return 0;let n=Dh(e.x,t.minX,t.maxX),o=Dh(e.y,t.minY,t.maxY);return Tl(e,{x:n,y:o})}function kz(e,t){return{x:(e.x+t.x)/2,y:(e.y+t.y)/2}}function Jj(e,t){let n=e.x-t.x,o=e.y-t.y;return n*n+o*o}var qOe=(e,t)=>{let n=Math.max(0,Math.min(e.maxX,t.maxX)-Math.max(e.minX,t.minX)),o=Math.max(0,Math.min(e.maxY,t.maxY)-Math.max(e.minY,t.minY));return n*o};var aR=(e,t)=>{let n=e.maxX<t.minX?t.minX-e.maxX:t.maxX<e.minX?e.minX-t.maxX:0,o=e.maxY<t.minY?t.minY-e.maxY:t.maxY<e.minY?e.minY-t.maxY:0;return Math.sqrt(n*n+o*o)};var yp=(e,t)=>!(e.maxX<t.minX||t.maxX<e.minX||e.maxY<t.minY||t.maxY<e.minY);var td=(e)=>{let{center:t,width:n,height:o}=e,r=n/2,i=o/2;return{minX:t.x-r,maxX:t.x+r,minY:t.y-i,maxY:t.y+i}};var b4=(e)=>({x:(e.minX+e.maxX)/2,y:(e.minY+e.maxY)/2});var Ms=(e)=>{if(e.length===0)return null;let t=e[0].x,n=e[0].y,o=e[0].x,r=e[0].y;for(let i=1;i<e.length;i++){let s=e[i];if(s.x<t)t=s.x;if(s.y<n)n=s.y;if(s.x>o)o=s.x;if(s.y>r)r=s.y}return{minX:t,minY:n,maxX:o,maxY:r}};Kt();tc();fp();Ko();fp();Kt();Ko();Ko();Ko();Kt();class Axe{constructor(e=1/0,t=Float64Array,n=Uint32Array){let o=e!==1/0;this.ids=o?new n(e):[],this.values=o?new t(e):[],this.capacity=e,this.length=0}clear(){this.length=0}push(e,t){if(this.length===this.capacity)throw RangeError("Queue is at capacity.");let n=this.length++;while(n>0){let o=n-1>>1,r=this.values[o];if(t>=r)break;this.ids[n]=this.ids[o],this.values[n]=r,n=o}this.ids[n]=e,this.values[n]=t}pop(){if(this.length===0)return;let e=this.ids,t=this.values,n=e[0],o=--this.length;if(o>0){let r=e[o],i=t[o],s=0,a=o>>1;while(s<a){let c=(s<<1)+1,l=c+1,h=c+(+(l<o)&+(t[l]<t[c]));if(t[h]>=i)break;e[s]=e[h],t[s]=t[h],s=h}e[s]=r,t[s]=i}return n}peek(){return this.length>0?this.ids[0]:void 0}peekValue(){return this.length>0?this.values[0]:void 0}shrink(){if(Array.isArray(this.ids))this.ids.length=this.length;if(Array.isArray(this.values))this.values.length=this.length}}var IMt=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],JOe=3;class I4{static from(e,t=0){if(t%8!==0)throw Error("byteOffset must be 8-byte aligned.");if(!e||e.byteLength===void 0||"buffer"in e)throw Error("Data must be an instance of ArrayBuffer or SharedArrayBuffer.");let[n,o]=new Uint8Array(e,t+0,2);if(n!==251)throw Error("Data does not appear to be in a Flatbush format.");let r=o>>4;if(r!==JOe)throw Error(`Got v${r} data when expected v${JOe}.`);let i=IMt[o&15];if(!i)throw Error("Unrecognized array type.");let[s]=new Uint16Array(e,t+2,1),[a]=new Uint32Array(e,t+4,1);return new I4(a,s,i,void 0,e,t)}constructor(e,t=16,n=Float64Array,o=ArrayBuffer,r,i=0){if(e===void 0)throw Error("Missing required argument: numItems.");if(isNaN(e)||e<=0)throw Error(`Unexpected numItems value: ${e}.`);this.numItems=+e,this.nodeSize=Math.min(Math.max(+t,2),65535),this.byteOffset=i;let s=e,a=s;this._levelBounds=[s*4];do s=Math.ceil(s/this.nodeSize),a+=s,this._levelBounds.push(a*4);while(s!==1);this.ArrayType=n,this.IndexArrayType=a<16384?Uint16Array:Uint32Array;let c=IMt.indexOf(n),l=a*4*n.BYTES_PER_ELEMENT;if(c<0)throw Error(`Unexpected typed array class: ${n}.`);let h=n,d=this.IndexArrayType;if(r)this.data=r,this._boxes=new h(r,i+8,a*4),this._indices=new d(r,i+8+l,a),this._pos=a*4,this.minX=this._boxes[this._pos-4],this.minY=this._boxes[this._pos-3],this.maxX=this._boxes[this._pos-2],this.maxY=this._boxes[this._pos-1];else{let u=this.data=new o(8+l+a*this.IndexArrayType.BYTES_PER_ELEMENT);this._boxes=new h(u,8,a*4),this._indices=new d(u,8+l,a),this._pos=0,this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0,new Uint8Array(u,0,2).set([251,(JOe<<4)+c]),new Uint16Array(u,2,1)[0]=t,new Uint32Array(u,4,1)[0]=e}this._queue=new Axe}add(e,t,n=e,o=t){let r=this._pos,i=r>>2,s=this._boxes;if(this._indices[i]=i,s[r]=e,s[r+1]=t,s[r+2]=n,s[r+3]=o,this._pos=r+4,e<this.minX)this.minX=e;if(t<this.minY)this.minY=t;if(n>this.maxX)this.maxX=n;if(o>this.maxY)this.maxY=o;return i}finish(){if(this._pos>>2!==this.numItems)throw Error(`Added ${this._pos>>2} items when expected ${this.numItems}.`);let e=this._boxes;if(this.numItems<=this.nodeSize){e[this._pos++]=this.minX,e[this._pos++]=this.minY,e[this._pos++]=this.maxX,e[this._pos++]=this.maxY;return}let{numItems:t,minX:n,minY:o,nodeSize:r,_indices:i,_levelBounds:s}=this,a=this.maxX-n||1,c=this.maxY-o||1,l=new Int32Array(t),h=65535,d=h/a,u=h/c;for(let p=0,m=0;p<t;p++){let A=e[m++],g=e[m++],f=e[m++],y=e[m++],x=d*((A+f)/2-n)|0,C=u*((g+y)/2-o)|0;l[p]=Dzo(x,C)}Bzo(l,e,i,0,t-1,r);let _=t*4;for(let p=0,m=0;p<s.length-1;p++){let A=s[p];while(m<A){let g=m,f=e[m++],y=e[m++],x=e[m++],C=e[m++];for(let b=1;b<r&&m<A;b++)f=Math.min(f,e[m++]),y=Math.min(y,e[m++]),x=Math.max(x,e[m++]),C=Math.max(C,e[m++]);i[_>>2]=g,e[_++]=f,e[_++]=y,e[_++]=x,e[_++]=C}}this._pos=_}search(e,t,n,o,r){if(this._pos!==this._boxes.length)throw Error("Data not yet indexed - call index.finish().");let{_boxes:i,_levelBounds:s,_indices:a,nodeSize:c}=this,l=this.numItems*4,h=i.length-4,d=s.length-1,u=[],_=[],p=!1;while(h!==void 0){let m=Math.min(h+c*4,s[d]),A=h>=l;if(p)this._collectContained(h,m,d,l,_,r);else for(let g=h;g<m;g+=4){let f=i[g];if(n<f)continue;let y=i[g+1];if(o<y)continue;let x=i[g+2];if(e>x)continue;let C=i[g+3];if(t>C)continue;let b=a[g>>2]|0;if(A){let I=+(e<=f&&t<=y&&n>=x&&o>=C);u.push(b|I,d-1)}else if(r===void 0||r(b,f,y,x,C))_.push(b)}if(d=u.pop(),h=u.pop(),h!==void 0)p=(h&1)===1,h&=-2}return _}_collectContained(e,t,n,o,r,i){let s=this._boxes,a=this._indices,c=e;for(let h=n;h>0;h--)c=a[c>>2];let l=Math.min(c+(t-e)*this.nodeSize**n,o);if(i===void 0)for(;c<l;c+=4)r.push(a[c>>2]|0);else for(;c<l;c+=4){let h=a[c>>2]|0;if(i(h,s[c],s[c+1],s[c+2],s[c+3]))r.push(h)}}neighbors(e,t,n=1/0,o=1/0,r){if(this._pos!==this._boxes.length)throw Error("Data not yet indexed - call index.finish().");let{_boxes:i,_levelBounds:s,_indices:a,_queue:c,nodeSize:l}=this,h=this.numItems*4,d=l*4,u=[],_=o*o,p=n===1,m=_;c.push(i.length-4<<1,0);while(c.length){let A=c.ids[0];if(A&1){if(c.pop(),u.push(A>>1),u.length===n)break;continue}c.pop();let g=A>>1,f=g<h,y=Math.min(g+d,wzo(g,s));for(let x=g;x<y;x+=4){let C=i[x],b=i[x+1],I=i[x+2],v=i[x+3],P=Math.max(Math.max(C-e,e-I),0),M=Math.max(Math.max(b-t,t-v),0),B=P*P+M*M;if(B>m)continue;let T=a[x>>2]|0;if(f){if(r===void 0||r(T)){if(c.push(T<<1|1,B),p&&B<m)m=B}}else c.push(T<<1,B)}}return c.clear(),u}}function wzo(e,t){let n=0,o=t.length-1;while(n<o){let r=n+o>>1;if(t[r]>e)o=r;else n=r+1}return t[n]}function Bzo(e,t,n,o,r,i){let s=[o,r];while(s.length){let a=s.pop()||0,c=s.pop()||0;if(a-c<=i&&Math.floor(c/i)>=Math.floor(a/i))continue;let l=e[c],h=e[c+a>>1],d=e[a],u=l>h!==l>d?l:h<l!==h<d?h:d,_=c-1,p=a+1;while(!0){do _++;while(e[_]<u);do p--;while(e[p]>u);if(_>=p)break;Tzo(e,t,n,_,p)}s.push(c,p,p+1,a)}}function Tzo(e,t,n,o,r){let i=e[o];e[o]=e[r],e[r]=i;let s=4*o,a=4*r,c=t[s],l=t[s+1],h=t[s+2],d=t[s+3];t[s]=t[a],t[s+1]=t[a+1],t[s+2]=t[a+2],t[s+3]=t[a+3],t[a]=c,t[a+1]=l,t[a+2]=h,t[a+3]=d;let u=n[o];n[o]=n[r],n[r]=u}function Dzo(e,t){let n=e^t,o=65535^n,r=65535^(e|t),i=e&(t^65535),s=n|o>>1,a=n>>1^n,c=r^(r>>1^o&i>>1),l=i^(n&r>>1^i>>1);return n=s&s>>2^a&a>>2,o=s&a>>2^a&(s^a)>>2,r=c^(s&c>>2^a&l>>2),i=l^(a&c>>2^(s^a)&l>>2),s=n&n>>4^o&o>>4,a=n&o>>4^o&(n^o)>>4,c=r^(n&r>>4^o&i>>4),l=i^(o&r>>4^(n^o)&i>>4),r=c^(s&c>>8^a&l>>8),i=l^(a&c>>8^(s^a)&l>>8),r^=r>>1,i^=i>>1,n=e^t,o=i|65535^(n|r),n=(n|n<<8)&16711935,n=(n|n<<4)&252645135,n=(n|n<<2)&858993459,n=(n|n<<1)&1431655765,o=(o|o<<8)&16711935,o=(o|o<<4)&252645135,o=(o|o<<2)&858993459,o=(o|o<<1)&1431655765,((o<<1|n)>>>0)-2147483648}fp();fp();fp();fp();fp();fp();tc();Kt();tc();Kt();Ko();tc();Ko();fp();Ko();Ko();tc();Ko();fp();var qxe=Qe(wt(),1);fp();Ko();Ko();tc();tc();fp();Ko();tc();tc();var Jxe=Qe(wt(),1);tc();Kt();Ko();Kt();Ko();Ko();tc();Ko();Ko();Y0();tc();Ko();Y0();tc();Y0();tc();Ko();Y0();tc();Ko();Kt();tc();Kt();Ko();Ko();Ko();var{cos:Yxs,sin:Gxs,PI:Uxs}=Math;var{tan:Jxs}=Math;var yxe=0.6,xxe=1;var Qzo=(e)=>(e.ccwRotationDegrees??0)*Math.PI/180;var kzo=(e,t)=>{let n=Math.cos(t),o=Math.sin(t);return{x:e.x*n-e.y*o,y:e.x*o+e.y*n}},eVe=(e)=>Lzo(e,Qzo(e));var Lzo=(e,t)=>{let n=e.width/2,o=e.height/2;return[{x:-n,y:-o},{x:n,y:-o},{x:n,y:o},{x:-n,y:o}].map((r)=>{let i=kzo(r,t);return{x:e.center.x+i.x,y:e.center.y+i.y}})};var Hzo=2,Fzo=12,zzo=12,Cxe=(e)=>({tip:{...e},base:{...e},leftWing:{...e},rightWing:{...e}}),SMt=(e,t,n)=>{let o=e.x-t.x,r=e.y-t.y,i=Math.hypot(o,r);if(i===0)return Cxe(e);let s=o/i,c=-(r/i)*(n/2),l=s*(n/2);return{tip:{...e},base:{...t},leftWing:{x:t.x+c,y:t.y+l},rightWing:{x:t.x-c,y:t.y-l}}};function bxe(e){let{start:t,end:n}=e,o=n.x-t.x,r=n.y-t.y,i=Math.hypot(o,r),s=Hzo,a=Fzo;if(i===0){let f=e.doubleSided?[Cxe(t),Cxe(t)]:[Cxe(t)];return{shaftStart:{...t},shaftEnd:{...t},heads:f,shaftWidth:s,headLength:0,headWidth:a,length:i}}let c=o/i,l=r/i,h=Math.min(zzo,i*0.5),d=Math.max(h,s*2),u=e.doubleSided?i/2:i,_=Math.min(d,u),p={x:n.x-c*_,y:n.y-l*_},m=[SMt(n,p,a)],A={...t},g={...p};if(e.doubleSided){let f={x:t.x+c*_,y:t.y+l*_};m.unshift(SMt(t,f,a)),A=f}return{shaftStart:A,shaftEnd:g,heads:m,shaftWidth:s,headLength:_,headWidth:a,length:i}}function tVe(e){let t=bxe(e);return[t.shaftStart,t.shaftEnd,...t.heads.flatMap((o)=>[o.tip,o.base,o.leftWing,o.rightWing])].reduce((o,r)=>({minX:Math.min(o.minX,r.x),maxX:Math.max(o.maxX,r.x),minY:Math.min(o.minY,r.y),maxY:Math.max(o.maxY,r.y)}),{minX:1/0,maxX:-1/0,minY:1/0,maxY:-1/0})}var Ozo=Qe(u0(),1);var ig=Uint8Array,v4=Uint16Array,hVe=Int32Array,Ixe=new ig([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),vxe=new ig([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),sVe=new ig([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),DMt=function(e,t){var n=new v4(31);for(var o=0;o<31;++o)n[o]=t+=1<<e[o-1];var r=new hVe(n[30]);for(var o=1;o<30;++o)for(var i=n[o];i<n[o+1];++i)r[i]=i-n[o]<<5|o;return{b:n,r}},NMt=DMt(Ixe,2),{b:RMt,r:aVe}=NMt;RMt[28]=258,aVe[258]=28;var QMt=DMt(vxe,0),{b:Vzo,r:wMt}=QMt,cVe=new v4(32768);for(bc=0;bc<32768;++bc)_7=(bc&43690)>>1|(bc&21845)<<1,_7=(_7&52428)>>2|(_7&13107)<<2,_7=(_7&61680)>>4|(_7&3855)<<4,cVe[bc]=((_7&65280)>>8|(_7&255)<<8)>>1;var _7,bc,g7=function(e,t,n){var o=e.length,r=0,i=new v4(t);for(;r<o;++r)if(e[r])++i[e[r]-1];var s=new v4(t);for(r=1;r<t;++r)s[r]=s[r-1]+i[r-1]<<1;var a;if(n){a=new v4(1<<t);var c=15-t;for(r=0;r<o;++r)if(e[r]){var l=r<<4|e[r],h=t-e[r],d=s[e[r]-1]++<<h;for(var u=d|(1<<h)-1;d<=u;++d)a[cVe[d]>>c]=l}}else{a=new v4(o);for(r=0;r<o;++r)if(e[r])a[r]=cVe[s[e[r]-1]++]>>15-e[r]}return a},cR=new ig(288);for(bc=0;bc<144;++bc)cR[bc]=8;var bc;for(bc=144;bc<256;++bc)cR[bc]=9;var bc;for(bc=256;bc<280;++bc)cR[bc]=7;var bc;for(bc=280;bc<288;++bc)cR[bc]=8;var bc,ase=new ig(32);for(bc=0;bc<32;++bc)ase[bc]=5;var bc,Yzo=g7(cR,9,0),Gzo=g7(cR,9,1),Uzo=g7(ase,5,0),Wzo=g7(ase,5,1),nVe=function(e){var t=e[0];for(var n=1;n<e.length;++n)if(e[n]>t)t=e[n];return t},GI=function(e,t,n){var o=t/8|0;return(e[o]|e[o+1]<<8)>>(t&7)&n},oVe=function(e,t){var n=t/8|0;return(e[n]|e[n+1]<<8|e[n+2]<<16)>>(t&7)},dVe=function(e){return(e+7)/8|0},sse=function(e,t,n){if(t==null||t<0)t=0;if(n==null||n>e.length)n=e.length;return new ig(e.subarray(t,n))};var Xzo=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],vx=function(e,t,n){var o=Error(t||Xzo[e]);if(o.code=e,Error.captureStackTrace)Error.captureStackTrace(o,vx);if(!n)throw o;return o},kMt=function(e,t,n,o){var r=e.length,i=o?o.length:0;if(!r||t.f&&!t.l)return n||new ig(0);var s=!n,a=s||t.i!=2,c=t.i;if(s)n=new ig(r*3);var l=function(ie){var ce=n.length;if(ie>ce){var ue=new ig(Math.max(ce*2,ie));ue.set(n),n=ue}},h=t.f||0,d=t.p||0,u=t.b||0,{l:_,d:p,m,n:A}=t,g=r*8;do{if(!_){h=GI(e,d,1);var f=GI(e,d+1,3);if(d+=3,!f){var y=dVe(d)+4,x=e[y-4]|e[y-3]<<8,C=y+x;if(C>r){if(c)vx(0);break}if(a)l(u+x);n.set(e.subarray(y,C),u),t.b=u+=x,t.p=d=C*8,t.f=h;continue}else if(f==1)_=Gzo,p=Wzo,m=9,A=5;else if(f==2){var b=GI(e,d,31)+257,I=GI(e,d+10,15)+4,v=b+GI(e,d+5,31)+1;d+=14;var P=new ig(v),M=new ig(19);for(var B=0;B<I;++B)M[sVe[B]]=GI(e,d+B*3,7);d+=I*3;var T=nVe(M),N=(1<<T)-1,D=g7(M,T,1);for(var B=0;B<v;){var L=D[GI(e,d,N)];d+=L&15;var y=L>>4;if(y<16)P[B++]=y;else{var H=0,V=0;if(y==16)V=3+GI(e,d,3),d+=2,H=P[B-1];else if(y==17)V=3+GI(e,d,7),d+=3;else if(y==18)V=11+GI(e,d,127),d+=7;while(V--)P[B++]=H}}var O=P.subarray(0,b),U=P.subarray(b);m=nVe(O),A=nVe(U),_=g7(O,m,1),p=g7(U,A,1)}else vx(1);if(d>g){if(c)vx(0);break}}if(a)l(u+131072);var j=(1<<m)-1,Y=(1<<A)-1,X=d;for(;;X=d){var H=_[oVe(e,d)&j],K=H>>4;if(d+=H&15,d>g){if(c)vx(0);break}if(!H)vx(2);if(K<256)n[u++]=K;else if(K==256){X=d,_=null;break}else{var J=K-254;if(K>264){var B=K-257,ee=Ixe[B];J=GI(e,d,(1<<ee)-1)+RMt[B],d+=ee}var se=p[oVe(e,d)&Y],ne=se>>4;if(!se)vx(3);d+=se&15;var U=Vzo[ne];if(ne>3){var ee=vxe[ne];U+=oVe(e,d)&(1<<ee)-1,d+=ee}if(d>g){if(c)vx(0);break}if(a)l(u+131072);var re=u+J;if(u<U){var Z=i-U,te=Math.min(U,re);if(Z+u<0)vx(3);for(;u<te;++u)n[u]=o[Z+u]}for(;u<re;++u)n[u]=n[u-U]}}if(t.l=_,t.p=X,t.b=u,t.f=h,_)h=1,t.m=m,t.d=p,t.n=A}while(!h);return u!=n.length&&s?sse(n,0,u):n.subarray(0,u)},UM=function(e,t,n){n<<=t&7;var o=t/8|0;e[o]|=n,e[o+1]|=n>>8},rse=function(e,t,n){n<<=t&7;var o=t/8|0;e[o]|=n,e[o+1]|=n>>8,e[o+2]|=n>>16},rVe=function(e,t){var n=[];for(var o=0;o<e.length;++o)if(e[o])n.push({s:o,f:e[o]});var r=n.length,i=n.slice();if(!r)return{t:HMt,l:0};if(r==1){var s=new ig(n[0].s+1);return s[n[0].s]=1,{t:s,l:1}}n.sort(function(C,b){return C.f-b.f}),n.push({s:-1,f:25001});var a=n[0],c=n[1],l=0,h=1,d=2;n[0]={s:-1,f:a.f+c.f,l:a,r:c};while(h!=r-1)a=n[n[l].f<n[d].f?l++:d++],c=n[l!=h&&n[l].f<n[d].f?l++:d++],n[h++]={s:-1,f:a.f+c.f,l:a,r:c};var u=i[0].s;for(var o=1;o<r;++o)if(i[o].s>u)u=i[o].s;var _=new v4(u+1),p=lVe(n[h-1],_,0);if(p>t){var o=0,m=0,A=p-t,g=1<<A;i.sort(function(b,I){return _[I.s]-_[b.s]||b.f-I.f});for(;o<r;++o){var f=i[o].s;if(_[f]>t)m+=g-(1<<p-_[f]),_[f]=t;else break}m>>=A;while(m>0){var y=i[o].s;if(_[y]<t)m-=1<<t-_[y]++-1;else++o}for(;o>=0&&m;--o){var x=i[o].s;if(_[x]==t)--_[x],++m}p=t}return{t:new ig(_),l:p}},lVe=function(e,t,n){return e.s==-1?Math.max(lVe(e.l,t,n+1),lVe(e.r,t,n+1)):t[e.s]=n},BMt=function(e){var t=e.length;while(t&&!e[--t]);var n=new v4(++t),o=0,r=e[0],i=1,s=function(c){n[o++]=c};for(var a=1;a<=t;++a)if(e[a]==r&&a!=t)++i;else{if(!r&&i>2){for(;i>138;i-=138)s(32754);if(i>2)s(i>10?i-11<<5|28690:i-3<<5|12305),i=0}else if(i>3){s(r),--i;for(;i>6;i-=6)s(8304);if(i>2)s(i-3<<5|8208),i=0}while(i--)s(r);i=1,r=e[a]}return{c:n.subarray(0,o),n:t}},ise=function(e,t){var n=0;for(var o=0;o<t.length;++o)n+=e[o]*t[o];return n},LMt=function(e,t,n){var o=n.length,r=dVe(t+2);e[r]=o&255,e[r+1]=o>>8,e[r+2]=e[r]^255,e[r+3]=e[r+1]^255;for(var i=0;i<o;++i)e[r+i+4]=n[i];return(r+4+o)*8},TMt=function(e,t,n,o,r,i,s,a,c,l,h){UM(t,h++,n),++r[256];var d=rVe(r,15),{t:u,l:_}=d,p=rVe(i,15),{t:m,l:A}=p,g=BMt(u),{c:f,n:y}=g,x=BMt(m),{c:C,n:b}=x,I=new v4(19);for(var v=0;v<f.length;++v)++I[f[v]&31];for(var v=0;v<C.length;++v)++I[C[v]&31];var P=rVe(I,7),{t:M,l:B}=P,T=19;for(;T>4&&!M[sVe[T-1]];--T);var N=l+5<<3,D=ise(r,cR)+ise(i,ase)+s,L=ise(r,u)+ise(i,m)+s+14+3*T+ise(I,M)+2*I[16]+3*I[17]+7*I[18];if(c>=0&&N<=D&&N<=L)return LMt(t,h,e.subarray(c,c+l));var H,V,O,U;if(UM(t,h,1+(L<D)),h+=2,L<D){H=g7(u,_,0),V=u,O=g7(m,A,0),U=m;var j=g7(M,B,0);UM(t,h,y-257),UM(t,h+5,b-1),UM(t,h+10,T-4),h+=14;for(var v=0;v<T;++v)UM(t,h+3*v,M[sVe[v]]);h+=3*T;var Y=[f,C];for(var X=0;X<2;++X){var K=Y[X];for(var v=0;v<K.length;++v){var J=K[v]&31;if(UM(t,h,j[J]),h+=M[J],J>15)UM(t,h,K[v]>>5&127),h+=K[v]>>12}}}else H=Yzo,V=cR,O=Uzo,U=ase;for(var v=0;v<a;++v){var ee=o[v];if(ee>255){var J=ee>>18&31;if(rse(t,h,H[J+257]),h+=V[J+257],J>7)UM(t,h,ee>>23&31),h+=Ixe[J];var se=ee&31;if(rse(t,h,O[se]),h+=U[se],se>3)rse(t,h,ee>>5&8191),h+=vxe[se]}else rse(t,h,H[ee]),h+=V[ee]}return rse(t,h,H[256]),h+V[256]},jzo=new hVe([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),HMt=new ig(0),Kzo=function(e,t,n,o,r,i){var s=i.z||e.length,a=new ig(o+s+5*(1+Math.ceil(s/7000))+r),c=a.subarray(o,a.length-r),l=i.l,h=(i.r||0)&7;if(t){if(h)c[0]=i.r>>3;var d=jzo[t-1],u=d>>13,_=d&8191,p=(1<<n)-1,m=i.p||new v4(32768),A=i.h||new v4(p+1),g=Math.ceil(n/3),f=2*g,y=function(de){return(e[de]^e[de+1]<<g^e[de+2]<<f)&p},x=new hVe(25000),C=new v4(288),b=new v4(32),I=0,v=0,P=i.i||0,M=0,B=i.w||0,T=0;for(;P+2<s;++P){var N=y(P),D=P&32767,L=A[N];if(m[D]=L,A[N]=D,B<=P){var H=s-P;if((I>7000||M>24576)&&(H>423||!l)){h=TMt(e,c,0,x,C,b,v,M,T,P-T,h),M=I=v=0,T=P;for(var V=0;V<286;++V)C[V]=0;for(var V=0;V<30;++V)b[V]=0}var O=2,U=0,j=_,Y=D-L&32767;if(H>2&&N==y(P-Y)){var X=Math.min(u,H)-1,K=Math.min(32767,P),J=Math.min(258,H);while(Y<=K&&--j&&D!=L){if(e[P+O]==e[P+O-Y]){var ee=0;for(;ee<J&&e[P+ee]==e[P+ee-Y];++ee);if(ee>O){if(O=ee,U=Y,ee>X)break;var se=Math.min(Y,ee-2),ne=0;for(var V=0;V<se;++V){var re=P-Y+V&32767,Z=m[re],te=re-Z&32767;if(te>ne)ne=te,L=re}}}D=L,L=m[D],Y+=D-L&32767}}if(U){x[M++]=268435456|aVe[O]<<18|wMt[U];var ie=aVe[O]&31,ce=wMt[U]&31;v+=Ixe[ie]+vxe[ce],++C[257+ie],++b[ce],B=P+O,++I}else x[M++]=e[P],++C[e[P]]}}for(P=Math.max(P,B);P<s;++P)x[M++]=e[P],++C[e[P]];if(h=TMt(e,c,l,x,C,b,v,M,T,P-T,h),!l)i.r=h&7|c[h/8|0]<<3,h-=7,i.h=A,i.p=m,i.i=P,i.w=B}else{for(var P=i.w||0;P<s+l;P+=65535){var ue=P+65535;if(ue>=s)c[h/8|0]=l,ue=s;h=LMt(c,h+1,e.subarray(P,ue))}i.i=s}return sse(a,0,o+dVe(h)+r)};var FMt=function(){var e=1,t=0;return{p:function(n){var o=e,r=t,i=n.length|0;for(var s=0;s!=i;){var a=Math.min(s+2655,i);for(;s<a;++s)r+=o+=n[s];o=(o&65535)+15*(o>>16),r=(r&65535)+15*(r>>16)}e=o,t=r},d:function(){return e%=65521,t%=65521,(e&255)<<24|(e&65280)<<8|(t&255)<<8|t>>8}}},$zo=function(e,t,n,o,r){if(!r){if(r={l:1},t.dictionary){var i=t.dictionary.subarray(-32768),s=new ig(i.length+e.length);s.set(i),s.set(e,i.length),e=s,r.w=i.length}}return Kzo(e,t.level==null?6:t.level,t.mem==null?r.l?Math.ceil(Math.max(8,Math.min(13,Math.log(e.length)))*1.5):20:12+t.mem,n,o,r)};var zMt=function(e,t,n){for(;n;++t)e[t]=n,n>>>=8};var qzo=function(e,t){var n=t.level,o=n==0?0:n<6?1:n==9?3:2;if(e[0]=120,e[1]=o<<6|(t.dictionary&&32),e[1]|=31-(e[0]<<8|e[1])%31,t.dictionary){var r=FMt();r.p(t.dictionary),zMt(e,2,r.d())}},OMt=function(e,t){if((e[0]&15)!=8||e[0]>>4>7||(e[0]<<8|e[1])%31)vx(6,"invalid zlib data");if((e[1]>>5&1)==+!t)vx(6,"invalid zlib data: "+(e[1]&32?"need":"unexpected")+" dictionary");return(e[1]>>3&4)+2};var iVe=function(){function e(t,n){if(typeof t=="function")n=t,t={};this.ondata=n;var o=t&&t.dictionary&&t.dictionary.subarray(-32768);if(this.s={i:0,b:o?o.length:0},this.o=new ig(32768),this.p=new ig(0),o)this.o.set(o)}return e.prototype.e=function(t){if(!this.ondata)vx(5);if(this.d)vx(4);if(!this.p.length)this.p=t;else if(t.length){var n=new ig(this.p.length+t.length);n.set(this.p),n.set(t,this.p.length),this.p=n}},e.prototype.c=function(t){this.s.i=+(this.d=t||!1);var n=this.s.b,o=kMt(this.p,this.s,this.o);this.ondata(sse(o,n,this.s.b),this.d),this.o=sse(o,this.s.b-32768),this.s.b=this.o.length,this.p=sse(this.p,this.s.p/8|0),this.s.p&=7},e.prototype.push=function(t,n){this.e(t),this.c(n)},e}();function VMt(e,t){if(!t)t={};var n=FMt();n.p(e);var o=$zo(e,t,t.dictionary?6:2,4);return qzo(o,t),zMt(o,o.length-4,n.d()),o}var uVe=function(){function e(t,n){iVe.call(this,t,n),this.v=t&&t.dictionary?2:1}return e.prototype.push=function(t,n){if(iVe.prototype.e.call(this,t),this.v){if(this.p.length<6&&!n)return;this.p=this.p.subarray(OMt(this.p,this.v-1)),this.v=0}if(n){if(this.p.length<4)vx(6,"invalid zlib data");this.p=this.p.subarray(0,-4)}iVe.prototype.c.call(this,n)},e}();function YMt(e,t){return kMt(e.subarray(OMt(e,t&&t.dictionary),-4),{i:2},t&&t.out,t&&t.dictionary)}var Jzo=typeof TextDecoder<"u"&&new TextDecoder,Zzo=0;try{Jzo.decode(HMt,{stream:!0}),Zzo=1}catch(e){}function pVe(e,t="utf8"){return new TextDecoder(t).decode(e)}var eOo=new TextEncoder;function GMt(e){return eOo.encode(e)}var tOo=8192,nOo=(()=>{let e=new Uint8Array(4),t=new Uint32Array(e.buffer);return!((t[0]=1)&e[0])})(),mVe={int8:globalThis.Int8Array,uint8:globalThis.Uint8Array,int16:globalThis.Int16Array,uint16:globalThis.Uint16Array,int32:globalThis.Int32Array,uint32:globalThis.Uint32Array,uint64:globalThis.BigUint64Array,int64:globalThis.BigInt64Array,float32:globalThis.Float32Array,float64:globalThis.Float64Array};class Lz{buffer;byteLength;byteOffset;length;offset;lastWrittenByte;littleEndian;_data;_mark;_marks;constructor(e=tOo,t={}){let n=!1;if(typeof e==="number")e=new ArrayBuffer(e);else n=!0,this.lastWrittenByte=e.byteLength;let o=t.offset?t.offset>>>0:0,r=e.byteLength-o,i=o;if(ArrayBuffer.isView(e)||e instanceof Lz){if(e.byteLength!==e.buffer.byteLength)i=e.byteOffset+o;e=e.buffer}if(n)this.lastWrittenByte=r;else this.lastWrittenByte=0;this.buffer=e,this.length=r,this.byteLength=r,this.byteOffset=i,this.offset=0,this.littleEndian=!0,this._data=new DataView(this.buffer,i,r),this._mark=0,this._marks=[]}available(e=1){return this.offset+e<=this.length}isLittleEndian(){return this.littleEndian}setLittleEndian(){return this.littleEndian=!0,this}isBigEndian(){return!this.littleEndian}setBigEndian(){return this.littleEndian=!1,this}skip(e=1){return this.offset+=e,this}back(e=1){return this.offset-=e,this}seek(e){return this.offset=e,this}mark(){return this._mark=this.offset,this}reset(){return this.offset=this._mark,this}pushMark(){return this._marks.push(this.offset),this}popMark(){let e=this._marks.pop();if(e===void 0)throw Error("Mark stack empty");return this.seek(e),this}rewind(){return this.offset=0,this}ensureAvailable(e=1){if(!this.available(e)){let n=(this.offset+e)*2,o=new Uint8Array(n);o.set(new Uint8Array(this.buffer)),this.buffer=o.buffer,this.length=n,this.byteLength=n,this._data=new DataView(this.buffer)}return this}readBoolean(){return this.readUint8()!==0}readInt8(){return this._data.getInt8(this.offset++)}readUint8(){return this._data.getUint8(this.offset++)}readByte(){return this.readUint8()}readBytes(e=1){return this.readArray(e,"uint8")}readArray(e,t){let n=mVe[t].BYTES_PER_ELEMENT*e,o=this.byteOffset+this.offset,r=this.buffer.slice(o,o+n);if(this.littleEndian===nOo&&t!=="uint8"&&t!=="int8"){let s=new Uint8Array(this.buffer.slice(o,o+n));s.reverse();let a=new mVe[t](s.buffer);return this.offset+=n,a.reverse(),a}let i=new mVe[t](r);return this.offset+=n,i}readInt16(){let e=this._data.getInt16(this.offset,this.littleEndian);return this.offset+=2,e}readUint16(){let e=this._data.getUint16(this.offset,this.littleEndian);return this.offset+=2,e}readInt32(){let e=this._data.getInt32(this.offset,this.littleEndian);return this.offset+=4,e}readUint32(){let e=this._data.getUint32(this.offset,this.littleEndian);return this.offset+=4,e}readFloat32(){let e=this._data.getFloat32(this.offset,this.littleEndian);return this.offset+=4,e}readFloat64(){let e=this._data.getFloat64(this.offset,this.littleEndian);return this.offset+=8,e}readBigInt64(){let e=this._data.getBigInt64(this.offset,this.littleEndian);return this.offset+=8,e}readBigUint64(){let e=this._data.getBigUint64(this.offset,this.littleEndian);return this.offset+=8,e}readChar(){return String.fromCharCode(this.readInt8())}readChars(e=1){let t="";for(let n=0;n<e;n++)t+=this.readChar();return t}readUtf8(e=1){return pVe(this.readBytes(e))}decodeText(e=1,t="utf8"){return pVe(this.readBytes(e),t)}writeBoolean(e){return this.writeUint8(e?255:0),this}writeInt8(e){return this.ensureAvailable(1),this._data.setInt8(this.offset++,e),this._updateLastWrittenByte(),this}writeUint8(e){return this.ensureAvailable(1),this._data.setUint8(this.offset++,e),this._updateLastWrittenByte(),this}writeByte(e){return this.writeUint8(e)}writeBytes(e){this.ensureAvailable(e.length);for(let t=0;t<e.length;t++)this._data.setUint8(this.offset++,e[t]);return this._updateLastWrittenByte(),this}writeInt16(e){return this.ensureAvailable(2),this._data.setInt16(this.offset,e,this.littleEndian),this.offset+=2,this._updateLastWrittenByte(),this}writeUint16(e){return this.ensureAvailable(2),this._data.setUint16(this.offset,e,this.littleEndian),this.offset+=2,this._updateLastWrittenByte(),this}writeInt32(e){return this.ensureAvailable(4),this._data.setInt32(this.offset,e,this.littleEndian),this.offset+=4,this._updateLastWrittenByte(),this}writeUint32(e){return this.ensureAvailable(4),this._data.setUint32(this.offset,e,this.littleEndian),this.offset+=4,this._updateLastWrittenByte(),this}writeFloat32(e){return this.ensureAvailable(4),this._data.setFloat32(this.offset,e,this.littleEndian),this.offset+=4,this._updateLastWrittenByte(),this}writeFloat64(e){return this.ensureAvailable(8),this._data.setFloat64(this.offset,e,this.littleEndian),this.offset+=8,this._updateLastWrittenByte(),this}writeBigInt64(e){return this.ensureAvailable(8),this._data.setBigInt64(this.offset,e,this.littleEndian),this.offset+=8,this._updateLastWrittenByte(),this}writeBigUint64(e){return this.ensureAvailable(8),this._data.setBigUint64(this.offset,e,this.littleEndian),this.offset+=8,this._updateLastWrittenByte(),this}writeChar(e){return this.writeUint8(e.charCodeAt(0))}writeChars(e){for(let t=0;t<e.length;t++)this.writeUint8(e.charCodeAt(t));return this}writeUtf8(e){return this.writeBytes(GMt(e))}toArray(){return new Uint8Array(this.buffer,this.byteOffset,this.lastWrittenByte)}getWrittenByteLength(){return this.lastWrittenByte-this.byteOffset}_updateLastWrittenByte(){if(this.offset>this.lastWrittenByte)this.lastWrittenByte=this.offset}}var WMt=[];for(let e=0;e<256;e++){let t=e;for(let n=0;n<8;n++)if(t&1)t=3988292384^t>>>1;else t=t>>>1;WMt[e]=t}var UMt=4294967295;function oOo(e,t,n){let o=e;for(let r=0;r<n;r++)o=WMt[(o^t[r])&255]^o>>>8;return o}function XMt(e,t){return(oOo(UMt,e,t)^UMt)>>>0}function _Ve(e,t,n){let o=e.readUint32(),r=XMt(new Uint8Array(e.buffer,e.byteOffset+e.offset-t-4,t),t);if(r!==o)throw Error(`CRC mismatch for chunk ${n}. Expected ${o}, found ${r}`)}function lR(e,t){e.writeUint32(XMt(new Uint8Array(e.buffer,e.byteOffset+e.offset-t,t),t))}function Sxe(e,t,n){for(let o=0;o<n;o++)t[o]=e[o]}function Pxe(e,t,n,o){let r=0;for(;r<o;r++)t[r]=e[r];for(;r<n;r++)t[r]=e[r]+t[r-o]&255}function Exe(e,t,n,o){let r=0;if(n.length===0)for(;r<o;r++)t[r]=e[r];else for(;r<o;r++)t[r]=e[r]+n[r]&255}function Mxe(e,t,n,o,r){let i=0;if(n.length===0){for(;i<r;i++)t[i]=e[i];for(;i<o;i++)t[i]=e[i]+(t[i-r]>>1)&255}else{for(;i<r;i++)t[i]=e[i]+(n[i]>>1)&255;for(;i<o;i++)t[i]=e[i]+(t[i-r]+n[i]>>1)&255}}function wxe(e,t,n,o,r){let i=0;if(n.length===0){for(;i<r;i++)t[i]=e[i];for(;i<o;i++)t[i]=e[i]+t[i-r]&255}else{for(;i<r;i++)t[i]=e[i]+n[i]&255;for(;i<o;i++)t[i]=e[i]+rOo(t[i-r],n[i],n[i-r])&255}}function rOo(e,t,n){let o=e+t-n,r=Math.abs(o-e),i=Math.abs(o-t),s=Math.abs(o-n);if(r<=i&&r<=s)return e;else if(i<=s)return t;else return n}function jMt(e,t,n,o,r,i){switch(e){case 0:Sxe(t,n,r);break;case 1:Pxe(t,n,r,i);break;case 2:Exe(t,n,o,r);break;case 3:Mxe(t,n,o,r,i);break;case 4:wxe(t,n,o,r,i);break;default:throw Error(`Unsupported filter: ${e}`)}}var iOo=new Uint16Array([255]),sOo=new Uint8Array(iOo.buffer),aOo=sOo[0]===255;function KMt(e){let{data:t,width:n,height:o,channels:r,depth:i}=e,s=[{x:0,y:0,xStep:8,yStep:8},{x:4,y:0,xStep:8,yStep:8},{x:0,y:4,xStep:4,yStep:8},{x:2,y:0,xStep:4,yStep:4},{x:0,y:2,xStep:2,yStep:4},{x:1,y:0,xStep:2,yStep:2},{x:0,y:1,xStep:1,yStep:2}],a=Math.ceil(i/8)*r,c=new Uint8Array(o*n*a),l=0;for(let h=0;h<7;h++){let d=s[h],u=Math.ceil((n-d.x)/d.xStep),_=Math.ceil((o-d.y)/d.yStep);if(u<=0||_<=0)continue;let p=u*a,m=new Uint8Array(p);for(let A=0;A<_;A++){let g=t[l++],f=t.subarray(l,l+p);l+=p;let y=new Uint8Array(p);jMt(g,f,y,m,p,a),m.set(y);for(let x=0;x<u;x++){let C=d.x+x*d.xStep,b=d.y+A*d.yStep;if(C>=n||b>=o)continue;for(let I=0;I<a;I++)c[(b*n+C)*a+I]=y[x*a+I]}}}if(i===16){let h=new Uint16Array(c.buffer);if(aOo)for(let d=0;d<h.length;d++)h[d]=cOo(h[d]);return h}else return c}function cOo(e){return(e&255)<<8|e>>8&255}var lOo=new Uint16Array([255]),hOo=new Uint8Array(lOo.buffer),dOo=hOo[0]===255,uOo=new Uint8Array(0);function gVe(e){let{data:t,width:n,height:o,channels:r,depth:i}=e,s=Math.ceil(i/8)*r,a=Math.ceil(i/8*r*n),c=new Uint8Array(o*a),l=uOo,h=0,d,u;for(let _=0;_<o;_++){switch(d=t.subarray(h+1,h+1+a),u=c.subarray(_*a,(_+1)*a),t[h]){case 0:Sxe(d,u,a);break;case 1:Pxe(d,u,a,s);break;case 2:Exe(d,u,l,a);break;case 3:Mxe(d,u,l,a,s);break;case 4:wxe(d,u,l,a,s);break;default:throw Error(`Unsupported filter: ${t[h]}`)}l=u,h+=a+1}if(i===16){let _=new Uint16Array(c.buffer);if(dOo)for(let p=0;p<_.length;p++)_[p]=pOo(_[p]);return _}else return c}function pOo(e){return(e&255)<<8|e>>8&255}var cse=Uint8Array.of(137,80,78,71,13,10,26,10);function $Mt(e){e.writeBytes(cse)}function AVe(e){if(!qMt(e.readBytes(cse.length)))throw Error("wrong PNG signature")}function qMt(e){if(e.length<cse.length)return!1;for(let t=0;t<cse.length;t++)if(e[t]!==cse[t])return!1;return!0}var fVe="tEXt",JMt=0,ZMt=new TextDecoder("latin1");function ewt(e){if(twt(e),e.length===0||e.length>79)throw Error("keyword length must be between 1 and 79")}var mOo=/^[\u0000-\u00FF]*$/;function twt(e){if(!mOo.test(e))throw Error("invalid latin1 text")}function nwt(e,t,n){let o=yVe(t);e[o]=_Oo(t,n-o.length-1)}function owt(e,t,n){ewt(t),twt(n);let o=t.length+1+n.length;e.writeUint32(o),e.writeChars(fVe),e.writeChars(t),e.writeByte(JMt),e.writeChars(n),lR(e,o+4)}function yVe(e){e.mark();while(e.readByte()!==JMt);let t=e.offset;e.reset();let n=ZMt.decode(e.readBytes(t-e.offset-1));return e.skip(1),ewt(n),n}function _Oo(e,t){return ZMt.decode(e.readBytes(t))}var xp={UNKNOWN:-1,GREYSCALE:0,TRUECOLOUR:2,INDEXED_COLOUR:3,GREYSCALE_ALPHA:4,TRUECOLOUR_ALPHA:6},Zj={UNKNOWN:-1,DEFLATE:0},lse={UNKNOWN:-1,ADAPTIVE:0},A7={UNKNOWN:-1,NO_INTERLACE:0,ADAM7:1},hse={NONE:0,BACKGROUND:1,PREVIOUS:2},Bxe={SOURCE:0,OVER:1};class Txe extends Lz{_checkCrc;_inflator;_png;_apng;_end;_hasPalette;_palette;_hasTransparency;_transparency;_compressionMethod;_filterMethod;_interlaceMethod;_colorType;_isAnimated;_numberOfFrames;_numberOfPlays;_frames;_writingDataChunks;_chunks;_inflatorResult;constructor(e,t={}){super(e);let{checkCrc:n=!1}=t;this._checkCrc=n,this._inflator=new uVe((o,r)=>{if(this._chunks.push(o),r){let i=this._chunks.reduce((a,c)=>a+c.length,0);this._inflatorResult=new Uint8Array(i);let s=0;for(let a of this._chunks)this._inflatorResult.set(a,s),s+=a.length;this._chunks=[]}}),this._chunks=[],this._png={width:-1,height:-1,channels:-1,data:new Uint8Array(0),depth:1,text:{}},this._apng={width:-1,height:-1,channels:-1,depth:1,numberOfFrames:1,numberOfPlays:0,text:{},frames:[]},this._end=!1,this._hasPalette=!1,this._palette=[],this._hasTransparency=!1,this._transparency=new Uint16Array(0),this._compressionMethod=Zj.UNKNOWN,this._filterMethod=lse.UNKNOWN,this._interlaceMethod=A7.UNKNOWN,this._colorType=xp.UNKNOWN,this._isAnimated=!1,this._numberOfFrames=1,this._numberOfPlays=0,this._frames=[],this._writingDataChunks=!1,this._inflatorResult=new Uint8Array(0),this.setBigEndian()}decode(){AVe(this);while(!this._end){let e=this.readUint32(),t=this.readChars(4);this.decodeChunk(e,t)}return this._inflator.push(new Uint8Array(0),!0),this.decodeImage(),this._png}decodeApng(){AVe(this);while(!this._end){let e=this.readUint32(),t=this.readChars(4);this.decodeApngChunk(e,t)}return this.decodeApngImage(),this._apng}decodeChunk(e,t){let n=this.offset;switch(t){case"IHDR":this.decodeIHDR();break;case"PLTE":this.decodePLTE(e);break;case"IDAT":this.decodeIDAT(e);break;case"IEND":this._end=!0;break;case"tRNS":this.decodetRNS(e);break;case"iCCP":this.decodeiCCP(e);break;case fVe:nwt(this._png.text,this,e);break;case"pHYs":this.decodepHYs();break;default:this.skip(e);break}if(this.offset-n!==e)throw Error(`Length mismatch while decoding chunk ${t}`);if(this._checkCrc)_Ve(this,e+4,t);else this.skip(4)}decodeApngChunk(e,t){let n=this.offset;if(t!=="fdAT"&&t!=="IDAT"&&this._writingDataChunks)this.pushDataToFrame();switch(t){case"acTL":this.decodeACTL();break;case"fcTL":this.decodeFCTL();break;case"fdAT":this.decodeFDAT(e);break;default:this.decodeChunk(e,t),this.offset=n+e;break}if(this.offset-n!==e)throw Error(`Length mismatch while decoding chunk ${t}`);if(this._checkCrc)_Ve(this,e+4,t);else this.skip(4)}decodeIHDR(){let e=this._png;e.width=this.readUint32(),e.height=this.readUint32(),e.depth=gOo(this.readUint8());let t=this.readUint8();this._colorType=t;let n;switch(t){case xp.GREYSCALE:n=1;break;case xp.TRUECOLOUR:n=3;break;case xp.INDEXED_COLOUR:n=1;break;case xp.GREYSCALE_ALPHA:n=2;break;case xp.TRUECOLOUR_ALPHA:n=4;break;case xp.UNKNOWN:default:throw Error(`Unknown color type: ${t}`)}if(this._png.channels=n,this._compressionMethod=this.readUint8(),this._compressionMethod!==Zj.DEFLATE)throw Error(`Unsupported compression method: ${this._compressionMethod}`);this._filterMethod=this.readUint8(),this._interlaceMethod=this.readUint8()}decodeACTL(){this._numberOfFrames=this.readUint32(),this._numberOfPlays=this.readUint32(),this._isAnimated=!0}decodeFCTL(){let e={sequenceNumber:this.readUint32(),width:this.readUint32(),height:this.readUint32(),xOffset:this.readUint32(),yOffset:this.readUint32(),delayNumber:this.readUint16(),delayDenominator:this.readUint16(),disposeOp:this.readUint8(),blendOp:this.readUint8(),data:new Uint8Array(0)};this._frames.push(e)}decodePLTE(e){if(e%3!==0)throw RangeError(`PLTE field length must be a multiple of 3. Got ${e}`);let t=e/3;this._hasPalette=!0;let n=[];this._palette=n;for(let o=0;o<t;o++)n.push([this.readUint8(),this.readUint8(),this.readUint8()])}decodeIDAT(e){this._writingDataChunks=!0;let t=e,n=this.offset+this.byteOffset;try{this._inflator.push(new Uint8Array(this.buffer,n,t),!1)}catch(o){throw Error("Error while decompressing the data:",{cause:o})}this.skip(e)}decodeFDAT(e){this._writingDataChunks=!0;let t=e,n=this.offset+this.byteOffset;n+=4,t-=4;try{this._inflator.push(new Uint8Array(this.buffer,n,t),!1)}catch(o){throw Error("Error while decompressing the data:",{cause:o})}this.skip(e)}decodetRNS(e){switch(this._colorType){case xp.GREYSCALE:case xp.TRUECOLOUR:{if(e%2!==0)throw RangeError(`tRNS chunk length must be a multiple of 2. Got ${e}`);if(e/2>this._png.width*this._png.height)throw Error(`tRNS chunk contains more alpha values than there are pixels (${e/2} vs ${this._png.width*this._png.height})`);this._hasTransparency=!0,this._transparency=new Uint16Array(e/2);for(let t=0;t<e/2;t++)this._transparency[t]=this.readUint16();break}case xp.INDEXED_COLOUR:{if(e>this._palette.length)throw Error(`tRNS chunk contains more alpha values than there are palette colors (${e} vs ${this._palette.length})`);let t=0;for(;t<e;t++){let n=this.readByte();this._palette[t].push(n)}for(;t<this._palette.length;t++)this._palette[t].push(255);break}case xp.UNKNOWN:case xp.GREYSCALE_ALPHA:case xp.TRUECOLOUR_ALPHA:default:throw Error(`tRNS chunk is not supported for color type ${this._colorType}`)}}decodeiCCP(e){let t=yVe(this),n=this.readUint8();if(n!==Zj.DEFLATE)throw Error(`Unsupported iCCP compression method: ${n}`);let o=this.readBytes(e-t.length-2);this._png.iccEmbeddedProfile={name:t,profile:YMt(o)}}decodepHYs(){let e=this.readUint32(),t=this.readUint32(),n=this.readByte();this._png.resolution={x:e,y:t,unit:n}}decodeApngImage(){this._apng.width=this._png.width,this._apng.height=this._png.height,this._apng.channels=this._png.channels,this._apng.depth=this._png.depth,this._apng.numberOfFrames=this._numberOfFrames,this._apng.numberOfPlays=this._numberOfPlays,this._apng.text=this._png.text,this._apng.resolution=this._png.resolution;for(let e=0;e<this._numberOfFrames;e++){let t={sequenceNumber:this._frames[e].sequenceNumber,delayNumber:this._frames[e].delayNumber,delayDenominator:this._frames[e].delayDenominator,data:this._apng.depth===8?new Uint8Array(this._apng.width*this._apng.height*this._apng.channels):new Uint16Array(this._apng.width*this._apng.height*this._apng.channels)},n=this._frames.at(e);if(n){if(n.data=gVe({data:n.data,width:n.width,height:n.height,channels:this._apng.channels,depth:this._apng.depth}),this._hasPalette)this._apng.palette=this._palette;if(this._hasTransparency)this._apng.transparency=this._transparency;if(e===0||n.xOffset===0&&n.yOffset===0&&n.width===this._png.width&&n.height===this._png.height)t.data=n.data;else{let o=this._apng.frames.at(e-1);this.disposeFrame(n,o,t),this.addFrameDataToCanvas(t,n)}this._apng.frames.push(t)}}return this._apng}disposeFrame(e,t,n){switch(e.disposeOp){case hse.NONE:break;case hse.BACKGROUND:for(let o=0;o<this._png.height;o++)for(let r=0;r<this._png.width;r++){let i=(o*e.width+r)*this._png.channels;for(let s=0;s<this._png.channels;s++)n.data[i+s]=0}break;case hse.PREVIOUS:n.data.set(t.data);break;default:throw Error("Unknown disposeOp")}}addFrameDataToCanvas(e,t){let n=1<<this._png.depth,o=(r,i)=>{let s=((r+t.yOffset)*this._png.width+t.xOffset+i)*this._png.channels,a=(r*t.width+i)*this._png.channels;return{index:s,frameIndex:a}};switch(t.blendOp){case Bxe.SOURCE:for(let r=0;r<t.height;r++)for(let i=0;i<t.width;i++){let{index:s,frameIndex:a}=o(r,i);for(let c=0;c<this._png.channels;c++)e.data[s+c]=t.data[a+c]}break;case Bxe.OVER:for(let r=0;r<t.height;r++)for(let i=0;i<t.width;i++){let{index:s,frameIndex:a}=o(r,i);for(let c=0;c<this._png.channels;c++){let l=t.data[a+this._png.channels-1]/n,h=c%(this._png.channels-1)===0?1:t.data[a+c],d=Math.floor(l*h+(1-l)*e.data[s+c]);e.data[s+c]+=d}}break;default:throw Error("Unknown blendOp")}}decodeImage(){let e=this._inflatorResult;if(this._filterMethod!==lse.ADAPTIVE)throw Error(`Filter method ${this._filterMethod} not supported`);if(this._interlaceMethod===A7.NO_INTERLACE)this._png.data=gVe({data:e,width:this._png.width,height:this._png.height,channels:this._png.channels,depth:this._png.depth});else if(this._interlaceMethod===A7.ADAM7)this._png.data=KMt({data:e,width:this._png.width,height:this._png.height,channels:this._png.channels,depth:this._png.depth});else throw Error(`Interlace method ${this._interlaceMethod} not supported`);if(this._hasPalette)this._png.palette=this._palette;if(this._hasTransparency)this._png.transparency=this._transparency}pushDataToFrame(){this._inflator.push(new Uint8Array(0),!0);let e=this._inflatorResult,t=this._frames.at(-1);if(t)t.data=e;else this._frames.push({sequenceNumber:0,width:this._png.width,height:this._png.height,xOffset:0,yOffset:0,delayNumber:0,delayDenominator:0,disposeOp:hse.NONE,blendOp:Bxe.SOURCE,data:e});this._inflator=new uVe((n,o)=>{if(this._chunks.push(n),o){let r=this._chunks.reduce((s,a)=>s+a.length,0);this._inflatorResult=new Uint8Array(r);let i=0;for(let s of this._chunks)this._inflatorResult.set(s,i),i+=s.length;this._chunks=[]}}),this._chunks=[],this._writingDataChunks=!1}}function gOo(e){if(e!==1&&e!==2&&e!==4&&e!==8&&e!==16)throw Error(`invalid bit depth: ${e}`);return e}var AOo={level:3};class Dxe extends Lz{_png;_zlibOptions;_colorType;_interlaceMethod;constructor(e,t={}){super();this._colorType=xp.UNKNOWN,this._zlibOptions={...AOo,...t.zlib},this._png=this._checkData(e),this._interlaceMethod=(t.interlace==="Adam7"?A7.ADAM7:A7.NO_INTERLACE)??A7.NO_INTERLACE,this.setBigEndian()}encode(){if($Mt(this),this.encodeIHDR(),this._png.palette){if(this.encodePLTE(),this._png.palette[0].length===4)this.encodeTRNS()}if(this.encodeData(),this._png.text)for(let[e,t]of Object.entries(this._png.text))owt(this,e,t);return this.encodeIEND(),this.toArray()}encodeIHDR(){this.writeUint32(13),this.writeChars("IHDR"),this.writeUint32(this._png.width),this.writeUint32(this._png.height),this.writeByte(this._png.depth),this.writeByte(this._colorType),this.writeByte(Zj.DEFLATE),this.writeByte(lse.ADAPTIVE),this.writeByte(this._interlaceMethod),lR(this,17)}encodeIEND(){this.writeUint32(0),this.writeChars("IEND"),lR(this,4)}encodePLTE(){let e=this._png.palette?.length*3;this.writeUint32(e),this.writeChars("PLTE");for(let t of this._png.palette)this.writeByte(t[0]),this.writeByte(t[1]),this.writeByte(t[2]);lR(this,4+e)}encodeTRNS(){let e=this._png.palette.filter((t)=>t.at(-1)!==255);this.writeUint32(e.length),this.writeChars("tRNS");for(let t of e)this.writeByte(t.at(-1));lR(this,4+e.length)}encodeIDAT(e){this.writeUint32(e.length),this.writeChars("IDAT"),this.writeBytes(e),lR(this,e.length+4)}encodeData(){let{width:e,height:t,channels:n,depth:o,data:r}=this._png,i=o<=8?Math.ceil(e*o/8)*n:Math.ceil(e*o/8*n/2),s=new Lz().setBigEndian(),a=0;if(this._interlaceMethod===A7.NO_INTERLACE)for(let h=0;h<t;h++)if(s.writeByte(0),o===16)a=COo(r,s,i,a);else a=yOo(r,s,i,a);else if(this._interlaceMethod===A7.ADAM7)a=xOo(this._png,r,s,a);let c=s.toArray(),l=VMt(c,this._zlibOptions);this.encodeIDAT(l)}_checkData(e){let{colorType:t,channels:n,depth:o}=fOo(e,e.palette),r={width:rwt(e.width,"width"),height:rwt(e.height,"height"),channels:n,data:e.data,depth:o,text:e.text,palette:e.palette};this._colorType=t;let i=o<8?Math.ceil(r.width*o/8)*r.height*n:r.width*r.height*n;if(r.data.length!==i)throw RangeError(`wrong data size. Found ${r.data.length}, expected ${i}`);return r}}function rwt(e,t){if(Number.isInteger(e)&&e>0)return e;throw TypeError(`${t} must be a positive integer`)}function fOo(e,t){let{channels:n=4,depth:o=8}=e;if(n!==4&&n!==3&&n!==2&&n!==1)throw RangeError(`unsupported number of channels: ${n}`);let r={channels:n,depth:o,colorType:xp.UNKNOWN};switch(n){case 4:r.colorType=xp.TRUECOLOUR_ALPHA;break;case 3:r.colorType=xp.TRUECOLOUR;break;case 1:if(t)r.colorType=xp.INDEXED_COLOUR;else r.colorType=xp.GREYSCALE;break;case 2:r.colorType=xp.GREYSCALE_ALPHA;break;default:throw Error("unsupported number of channels")}return r}function yOo(e,t,n,o){for(let r=0;r<n;r++)t.writeByte(e[o++]);return o}function xOo(e,t,n,o){let r=[{x:0,y:0,xStep:8,yStep:8},{x:4,y:0,xStep:8,yStep:8},{x:0,y:4,xStep:4,yStep:8},{x:2,y:0,xStep:4,yStep:4},{x:0,y:2,xStep:2,yStep:4},{x:1,y:0,xStep:2,yStep:2},{x:0,y:1,xStep:1,yStep:2}],{width:i,height:s,channels:a,depth:c}=e,l;if(c===16)l=a*c/8/2;else l=a*c/8;for(let h=0;h<7;h++){let d=r[h],u=Math.floor((i-d.x+d.xStep-1)/d.xStep),_=Math.floor((s-d.y+d.yStep-1)/d.yStep);if(u<=0||_<=0)continue;let p=u*l;for(let m=0;m<_;m++){let A=d.y+m*d.yStep,g=c<=8?new Uint8Array(p):new Uint16Array(p),f=0;for(let y=0;y<u;y++){let x=d.x+y*d.xStep;if(x<i&&A<s){let C=(A*i+x)*l;for(let b=0;b<l;b++)g[f++]=t[C+b]}}if(n.writeByte(0),c===8)n.writeBytes(g);else if(c===16)for(let y of g)n.writeByte(y>>8&255),n.writeByte(y&255)}}return o}function COo(e,t,n,o){for(let r=0;r<n;r++)t.writeUint16(e[o++]);return o}function iwt(e,t){return new Txe(e,t).decode()}function xVe(e,t){return new Dxe(e,t).encode()}var swt={"0":"M0.301025 0.257813 L0.206593 0.283385 L0.122042 0.361307 L0.075923 0.474441 L0.064942 0.642221 L0.091296 0.78289 L0.159376 0.899463 L0.257104 0.961214 L0.344948 0.961214 L0.442678 0.899463 L0.510757 0.78289 L0.537111 0.642221 L0.526131 0.474441 L0.480012 0.361307 L0.39546 0.283385 L0.301025 0.257813","1":"M0.220426 0.40845 L0.381626 0.270996 L0.381626 0.948966","2":"M0.110409 0.39212 L0.125621 0.342293 L0.170571 0.295823 L0.244237 0.26431 L0.291518 0.257813 L0.373319 0.263799 L0.434683 0.290705 L0.468239 0.331966 L0.480292 0.379913 L0.479492 0.411806 L0.465088 0.465192 L0.402571 0.568988 L0.245134 0.766438 L0.07959 0.948045 L0.522462 0.948045","3":"M0.081606 0.345073 L0.119154 0.315633 L0.178996 0.284091 L0.255265 0.257813 L0.349133 0.263062 L0.43127 0.289348 L0.48994 0.336662 L0.525141 0.394491 L0.513407 0.457577 L0.466472 0.504892 L0.384334 0.541692 L0.290464 0.56272 L0.20833 0.573235 L0.290464 0.583749 L0.384334 0.610035 L0.466472 0.652092 L0.519274 0.709922 L0.531007 0.773007 L0.50754 0.841351 L0.454738 0.899179 L0.3726 0.946494 L0.310412 0.961214 L0.209503 0.959111 L0.127367 0.946494 L0.071046 0.929671","4":"M0.418494 0.270996 L0.048828 0.724199 L0.553224 0.724199 M0.414181 0.578167 L0.414181 0.94897","5":"M0.074951 0.270996 L0.074951 0.614701 L0.267655 0.5695 L0.405247 0.586502 L0.460002 0.617189 L0.498028 0.660731 L0.527101 0.779401 L0.513352 0.841049 L0.477274 0.889568 L0.406378 0.93463 L0.324445 0.958337 L0.247399 0.962139 L0.182516 0.949767 L0.130068 0.925508 L0.074951 0.875607 M0.074951 0.270996 L0.527101 0.270996","6":"M0.428549 0.257813 L0.341433 0.285053 L0.26073 0.312099 L0.192188 0.360182 L0.138902 0.410969 L0.098219 0.500422 L0.070249 0.584267 L0.067264 0.670716 L0.065164 0.756863 L0.087163 0.820973 L0.108168 0.861042 L0.157916 0.913131 L0.210981 0.948192 L0.29279 0.961214 L0.384548 0.956206 L0.456409 0.924151 L0.507262 0.881077 L0.5349 0.821975 L0.537111 0.771889 L0.521634 0.718798 L0.498418 0.67372 L0.463042 0.636657 L0.414398 0.613617 L0.34696 0.598591 L0.28284 0.595587 L0.215403 0.605604 L0.145756 0.641665 L0.109274 0.678729 L0.064942 0.724006","7":"M0.071534 0.270996 L0.530519 0.270996 L0.495935 0.291702 L0.477752 0.305407 L0.435186 0.346112 L0.412067 0.374136 L0.388565 0.40796 L0.365315 0.448098 L0.342943 0.495062 L0.322081 0.549366 L0.303364 0.611524 L0.287416 0.68205 L0.270077 0.80465 L0.26253 0.94897","8":"M0.286761 0.257813 L0.210684 0.27162 L0.1414 0.305622 L0.092494 0.382125 L0.111513 0.450128 L0.16857 0.502193 L0.228345 0.539382 L0.377781 0.594635 L0.470161 0.645637 L0.52586 0.706203 L0.538087 0.792269 L0.506841 0.87621 L0.438915 0.927212 L0.339743 0.961214 L0.263666 0.959089 L0.174004 0.929337 L0.102003 0.881523 L0.063965 0.811395 L0.066682 0.741266 L0.102003 0.671139 L0.180797 0.608448 L0.259591 0.580822 L0.358762 0.548945 L0.456576 0.49688 L0.486463 0.446941 L0.487822 0.362999 L0.453859 0.302434 L0.384574 0.265245 L0.286761 0.257813","9":"M0.511026 0.437812 L0.491026 0.347812 L0.451026 0.297812 L0.391026 0.267812 L0.311026 0.257813 L0.231026 0.267812 L0.161026 0.297812 L0.111026 0.347812 L0.091026 0.417812 L0.111026 0.487812 L0.161026 0.537812 L0.231026 0.567812 L0.311026 0.577812 L0.391026 0.557812 L0.451026 0.517812 L0.491026 0.477812 L0.511026 0.437812 M0.510026 0.438812 L0.434026 0.636812 L0.381026 0.777812 L0.337026 0.879812 L0.301026 0.957812","!":"M0.301026 0.270996 L0.301026 0.749566 M0.251466 0.94897 L0.350587 0.94897",'"':"M0.16504 0.270996 L0.16504 0.523022 M0.437013 0.270996 L0.437013 0.523022","#":"M0.20958 0.282227 L0.146515 0.949754 M0.461844 0.282227 L0.398779 0.949754 M0.032999 0.526969 L0.600587 0.452796 M0.001465 0.82366 L0.569055 0.749486",$:"M0.307121 0.240234 L0.307121 1.083502 M0.490031 0.415915 L0.404676 0.328075 L0.23396 0.310507 L0.136407 0.398347 L0.099828 0.521324 L0.124213 0.591596 L0.197379 0.644299 L0.429061 0.697003 L0.502224 0.749708 L0.526613 0.837547 L0.477836 0.960526 L0.355897 1.013228 L0.197379 0.99566 L0.112021 0.942957 L0.07544 0.837547","'":"M0.301026 0.270996 L0.301026 0.523022","(":"M0.413087 0.241211 L0.372337 0.28347 L0.331589 0.334184 L0.290838 0.393349 L0.25009 0.460965 L0.219528 0.528584 L0.199153 0.5962 L0.188966 0.655364 L0.199153 0.714529 L0.219528 0.782146 L0.25009 0.849764 L0.290838 0.91738 L0.331589 0.976544 L0.372337 1.027258 L0.413087 1.069491",")":"M0.188966 0.241211 L0.229716 0.28347 L0.270466 0.334184 L0.311213 0.393349 L0.351964 0.460965 L0.382526 0.528584 L0.4029 0.5962 L0.413087 0.655364 L0.4029 0.714529 L0.382526 0.782146 L0.351964 0.849764 L0.311213 0.91738 L0.270466 0.976544 L0.229716 1.027258 L0.188966 1.069491","*":"M0.301026 0.458702 L0.301026 0.681942 M0.301026 0.458702 L0.520997 0.536834 M0.301026 0.458702 L0.439954 0.257813 M0.301026 0.458702 L0.162098 0.257813 M0.301026 0.458702 L0.081055 0.536834","+":"M0.042969 0.66845 L0.559083 0.66845 M0.301023 0.428223 L0.301023 0.908661",",":"M0.38672 0.852051 L0.215333 1.030661 L0.301025 1.119971","-":"M0.173829 0.686035 L0.428224 0.686035",".":"M0.362549 0.851074 L0.239503 0.851074","/":"M0.062501 1.035249 L0.539551 0.270996","<":"M0.559083 0.441895 L0.042969 0.66939 L0.042969 0.66939 L0.559083 0.896902","=":"M0.042969 0.545898 L0.559083 0.545898 M0.042969 0.80837 L0.559083 0.80837",">":"M0.042969 0.441895 L0.559083 0.66939 L0.559083 0.66939 L0.042969 0.896902",A:"M0.018067 0.94897 L0.290179 0.270996 L0.583986 0.94897 M0.155303 0.684521 L0.433548 0.684521",B:"M0.063965 0.94897 L0.063965 0.278953 L0.209356 0.270996 L0.342486 0.294394 L0.432179 0.37292 L0.418224 0.48773 L0.312686 0.549166 L0.084728 0.575531 L0.306377 0.589434 L0.468877 0.647456 L0.538087 0.736658 L0.5324 0.85202 L0.501247 0.902983 L0.42355 0.944398 L0.063965 0.94897",C:"M0.529054 0.419847 L0.498425 0.345196 L0.442238 0.292341 L0.33583 0.257813 L0.257199 0.268357 L0.187906 0.303748 L0.120243 0.385432 L0.072998 0.599844 L0.110073 0.815385 L0.165381 0.902183 L0.222883 0.942801 L0.334904 0.961214 L0.43253 0.937679 L0.504816 0.868999 L0.529054 0.772065",D:"M0.064454 0.94897 L0.071838 0.285078 L0.171217 0.270996 L0.247348 0.272633 L0.37101 0.306078 L0.462461 0.378304 L0.514748 0.475555 L0.535591 0.576392 L0.537599 0.652313 L0.528065 0.717381 L0.508562 0.772419 L0.445948 0.855695 L0.362356 0.90871 L0.225203 0.945862 L0.064454 0.94897",E:"M0.080078 0.270996 L0.080078 0.94897 M0.080078 0.270996 L0.521974 0.270996 M0.080078 0.609981 L0.389405 0.609981 M0.080078 0.94897 L0.521974 0.94897",F:"M0.086426 0.270996 L0.086426 0.94897 M0.091304 0.275607 L0.515626 0.275607 M0.091304 0.607677 L0.447344 0.607677",G:"M0.498034 0.284943 L0.374621 0.257813 L0.244219 0.268648 L0.160577 0.311997 L0.094556 0.398116 L0.056397 0.58404 L0.076752 0.785532 L0.120865 0.858197 L0.188947 0.916734 L0.271008 0.953591 L0.357069 0.961214 L0.43715 0.932047 L0.501262 0.858539 L0.545656 0.648611 L0.329595 0.648131",H:"M0.066895 0.270996 L0.066895 0.94897 M0.066895 0.595658 L0.530009 0.595658 M0.535157 0.270996 L0.535157 0.94897",I:"M0.301026 0.270996 L0.301026 0.94897",J:"M0.506839 0.270996 L0.507814 0.782193 L0.498468 0.846168 L0.480733 0.880789 L0.455864 0.90832 L0.426095 0.929408 L0.360746 0.954812 L0.302508 0.962139 L0.223573 0.953638 L0.16538 0.930312 L0.137072 0.907715 L0.116428 0.880312 L0.102822 0.848819 L0.095633 0.813947 L0.094239 0.776413",K:"M0.035401 0.270996 L0.035401 0.94897 M0.502258 0.316194 L0.035401 0.687823 M0.212484 0.582361 L0.566652 0.933903",L:"M0.07544 0.270996 L0.07544 0.94897 L0.526613 0.94897",M:"M0.042481 0.94897 L0.042481 0.270996 L0.301027 0.712492 L0.559571 0.270996 L0.559571 0.94897",N:"M0.067871 0.94897 L0.067871 0.270996 L0.534181 0.94897 L0.525031 0.270996",O:"M0.287293 0.961214 L0.19843 0.933567 L0.1172 0.849451 L0.057129 0.563945 L0.114348 0.350255 L0.18455 0.289392 L0.306101 0.257813 L0.42054 0.29572 L0.487543 0.365003 L0.544923 0.625294 L0.516366 0.789624 L0.465476 0.884596 L0.375084 0.949287 L0.287293 0.961214",P:"M0.070557 0.94897 L0.070557 0.28379 L0.20704 0.270996 L0.329134 0.278993 L0.408525 0.300514 L0.444022 0.317908 L0.500637 0.368929 L0.525796 0.423728 L0.531496 0.50384 L0.508934 0.554205 L0.473724 0.582043 L0.417577 0.604365 L0.336375 0.620372 L0.226014 0.629268 L0.082368 0.630258",Q:"M0.282435 1.050813 L0.195447 1.019646 L0.115933 0.924817 L0.057129 0.602943 L0.113139 0.362034 L0.18186 0.293418 L0.300844 0.257813 L0.412868 0.300553 L0.478457 0.37866 L0.534625 0.672103 L0.506671 0.857367 L0.456855 0.964437 L0.368371 1.037368 L0.282435 1.050813 M0.341225 0.815559 L0.544923 1.070653",R:"M0.034912 0.944112 L0.034912 0.288556 L0.227127 0.270996 L0.362038 0.276867 L0.443423 0.294907 L0.477644 0.309614 L0.505809 0.328757 L0.526616 0.352817 L0.544963 0.418061 L0.543241 0.475921 L0.524463 0.517817 L0.49076 0.546518 L0.444265 0.564799 L0.355195 0.578739 L0.047653 0.589627 M0.303054 0.617306 L0.56714 0.94897",S:"M0.483037 0.364333 L0.407613 0.267477 L0.22883 0.257813 L0.128623 0.327565 L0.087712 0.455539 L0.104656 0.518727 L0.168054 0.573307 L0.41928 0.617318 L0.503796 0.669342 L0.535157 0.759324 L0.493846 0.900055 L0.367668 0.961214 L0.205436 0.956661 L0.116711 0.907038 L0.066895 0.790334",T:"M0.022949 0.270996 L0.579103 0.270996 M0.309284 0.270996 L0.309284 0.94897",U:"M0.072022 0.270996 L0.07308 0.648875 L0.080372 0.75167 L0.099024 0.827813 L0.134786 0.885729 L0.181571 0.924023 L0.251464 0.95168 L0.339655 0.962139 L0.401553 0.951668 L0.45232 0.924086 L0.482701 0.891771 L0.495745 0.870529 L0.515699 0.81637 L0.525014 0.744626 L0.530031 0.272017",V:"M0.027832 0.270996 L0.320083 0.94897 L0.57422 0.270996",W:"M0 0.270996 L0.079799 0.940377 L0.285198 0.472884 L0.505255 0.94897 L0.602052 0.270996",X:"M0.009034 0.270996 L0.586805 0.94897 M0.593019 0.270996 L0.015246 0.94897",Y:"M0.018067 0.270996 L0.293132 0.574135 M0.583986 0.271959 L0.294954 0.57606 L0.305277 0.94897",Z:"M0.053711 0.270996 L0.548341 0.270996 L0.053711 0.94897 L0.548341 0.94897","[":"M0.404542 0.240234 L0.197511 0.240234 L0.197511 1.069424 L0.404542 1.069424","\\":"M0.062501 0.270996 L0.539551 1.035249","]":"M0.19751 0.240234 L0.404542 0.240234 L0.404542 1.069424 L0.19751 1.069424","^":"M0.035156 0.523931 L0.301024 0.270996 L0.566896 0.523931",_:"M0 1.160601 L0.602052 1.160601",a:"M0.527101 0.439941 L0.527101 0.973965 M0.527101 0.553824 L0.451366 0.477535 L0.376759 0.439941 L0.263722 0.439941 L0.187989 0.477535 L0.112255 0.553824 L0.074951 0.66881 L0.074951 0.745099 L0.112255 0.85898 L0.187989 0.93527 L0.263722 0.973965 L0.376759 0.973965 L0.451366 0.93527 L0.527101 0.85898",b:"M0.07666 0.240234 L0.07666 0.959985 M0.07666 0.582737 L0.151822 0.514237 L0.225865 0.480483 L0.338045 0.480483 L0.413211 0.514237 L0.488374 0.582737 L0.525392 0.685983 L0.525392 0.754485 L0.488374 0.856739 L0.413211 0.92524 L0.338045 0.959985 L0.225865 0.959985 L0.151822 0.92524 L0.07666 0.856739",c:"M0.512452 0.553823 L0.441624 0.477535 L0.371854 0.439941 L0.26614 0.439941 L0.195312 0.477535 L0.124486 0.553823 L0.0896 0.668808 L0.0896 0.745099 L0.124486 0.858979 L0.195312 0.93527 L0.26614 0.973965 L0.371854 0.973965 L0.441624 0.93527 L0.512452 0.858979",d:"M0.525392 0.240234 L0.525392 0.959985 M0.525392 0.582737 L0.450232 0.514237 L0.376189 0.480483 L0.264006 0.480483 L0.188844 0.514237 L0.11368 0.582737 L0.076661 0.685983 L0.076661 0.754485 L0.11368 0.856739 L0.188844 0.92524 L0.264006 0.959985 L0.376189 0.959985 L0.450232 0.92524 L0.525392 0.856739",e:"M0.059571 0.668808 L0.542482 0.668808 M0.542482 0.592521 L0.502641 0.516231 L0.461594 0.477535 L0.381914 0.439941 L0.261186 0.439941 L0.180299 0.477535 L0.099412 0.553823 L0.059571 0.668808 L0.059571 0.745099 L0.099412 0.858979 L0.180299 0.93527 L0.261186 0.973965 L0.381914 0.973965 L0.461594 0.93527 L0.542482 0.858979",f:"M0.512941 0.240234 L0.406984 0.240234 L0.301026 0.274346 L0.248047 0.374731 L0.248047 0.946817 M0.089112 0.476088 L0.459965 0.476088",g:"M0.525392 0.439941 L0.525392 0.989395 L0.488373 1.091918 L0.45023 1.126757 L0.376189 1.160601 L0.264004 1.160601 L0.188844 1.126757 L0.113681 1.058075 L0.076661 0.954555 M0.525392 0.542467 L0.45023 0.473786 L0.376189 0.439941 L0.264004 0.439941 L0.188844 0.473786 L0.113681 0.542467 L0.076661 0.645988 L0.076661 0.714669 L0.113681 0.817193 L0.188844 0.885875 L0.264004 0.920713 L0.376189 0.920713 L0.45023 0.885875 L0.525392 0.817193",h:"M0.092041 0.240234 L0.092041 0.946817 M0.092041 0.61058 L0.205937 0.509225 L0.282214 0.476086 L0.396109 0.476086 L0.47187 0.509225 L0.510011 0.61058 L0.510011 0.946817",i:"M0.261026 0.240234 L0.341026 0.240234 M0.300978 0.476089 L0.300978 0.946817",j:"M0.3853 0.240234 L0.447023 0.240234 M0.416159 0.465708 L0.416159 1.011689 L0.383887 1.108586 L0.252832 1.140264 L0.15503 1.108586",k:"M0.065186 0.240234 L0.065186 0.946817 M0.493824 0.476086 L0.065186 0.812323 M0.236758 0.677829 L0.536867 0.946817",l:"M0.301026 0.234863 L0.301026 0.946441",m:"M0.050538 0.439941 L0.050538 0.960796 M0.050538 0.588758 L0.114405 0.476607 L0.157178 0.439941 L0.236864 0.439941 L0.279637 0.476607 L0.32241 0.588758 L0.32241 0.960796 M0.32241 0.588758 L0.386281 0.476607 L0.428467 0.439941 L0.50874 0.439941 L0.551515 0.476607 L0.551515 0.960796",n:"M0.092041 0.439941 L0.092041 0.960796 M0.092041 0.588758 L0.205936 0.476607 L0.282216 0.439941 L0.396113 0.439941 L0.471871 0.476607 L0.510011 0.588758 L0.510011 0.960796",o:"M0.247175 0.439941 L0.175178 0.477535 L0.103186 0.553823 L0.066895 0.668808 L0.066895 0.745099 L0.103186 0.858979 L0.175178 0.93527 L0.247175 0.973965 L0.354874 0.973965 L0.426872 0.93527 L0.498866 0.858979 L0.535157 0.745099 L0.535157 0.668808 L0.498866 0.553823 L0.426872 0.477535 L0.354874 0.439941 L0.247175 0.439941",p:"M0.076904 0.439941 L0.076904 1.154244 M0.076904 0.541563 L0.151986 0.473487 L0.225944 0.439941 L0.338005 0.439941 L0.413087 0.473487 L0.488166 0.541563 L0.525148 0.644169 L0.525148 0.712246 L0.488166 0.813866 L0.413087 0.881942 L0.338005 0.916471 L0.225944 0.916471 L0.151986 0.881942 L0.076904 0.813866",q:"M0.525148 0.441895 L0.525148 1.156195 M0.525148 0.5435 L0.450067 0.47544 L0.376106 0.441895 L0.264042 0.441895 L0.188966 0.47544 L0.113885 0.5435 L0.076905 0.646108 L0.076905 0.714187 L0.113885 0.815809 L0.188966 0.883886 L0.264042 0.918418 L0.376106 0.918418 L0.450067 0.883886 L0.525148 0.815809",r:"M0.107422 0.439941 L0.107422 0.960796 M0.107422 0.663164 L0.155824 0.551014 L0.252626 0.476607 L0.349428 0.439941 L0.49463 0.439941",s:"M0.475556 0.477535 L0.400757 0.439941 L0.276092 0.439941 L0.176361 0.477535 L0.101563 0.553823 L0.101563 0.630112 L0.176361 0.668808 L0.301024 0.668808 L0.425688 0.745099 L0.50049 0.821387 L0.50049 0.897677 L0.425688 0.93527 L0.325956 0.973965 L0.201295 0.973965 L0.126496 0.93527 L0.101563 0.858979",t:"M0.246032 0.297852 L0.246032 0.826549 L0.301023 0.919323 L0.411011 0.950848 L0.520997 0.950848 M0.081055 0.515799 L0.466004 0.515799",u:"M0.092041 0.454102 L0.092041 0.826134 L0.13018 0.937211 L0.205936 0.974954 L0.319832 0.974954 L0.396113 0.937211 L0.510011 0.826134 M0.510011 0.454102 L0.510011 0.974954",v:"M0.048828 0.453125 L0.301026 0.961719 M0.553224 0.453125 L0.301026 0.961719",w:"M0 0.453125 L0.150512 0.961719 M0.301024 0.453125 L0.150512 0.961719 M0.301024 0.453125 L0.451539 0.961719 M0.602052 0.453125 L0.451539 0.961719",x:"M0.03711 0.453125 L0.564943 0.961719 M0.564943 0.453125 L0.03711 0.961719",y:"M0.084618 0.453125 L0.320232 0.921476 M0.55713 0.453125 L0.320232 0.921476 L0.242119 1.055289 L0.163369 1.122196 L0.084618 1.155166 L0.044922 1.155166",z:"M0.505373 0.452148 L0.09668 0.961651 M0.09668 0.452148 L0.505373 0.452148 M0.09668 0.961651 L0.505373 0.961651"},awt={};for(let e in swt){awt[e]=[];let t=swt[e].split("M").slice(1).map((n)=>n.split("L").map((o)=>o.trim().split(" ").map(parseFloat)));for(let n of t)for(let o=0;o<n.length-1;o++)awt[e].push({x1:n[o][0],y1:1-n[o][1],x2:n[o+1][0],y2:1-n[o+1][1]})}function X1(e){let t=[...e.points||[],...(e.lines||[]).flatMap((n)=>n.points),...(e.polygons||[]).flatMap((n)=>n.points),...(e.rects||[]).flatMap((n)=>eVe(n)),...(e.circles||[]).flatMap((n)=>[{x:n.center.x-n.radius,y:n.center.y},{x:n.center.x+n.radius,y:n.center.y},{x:n.center.x,y:n.center.y-n.radius},{x:n.center.x,y:n.center.y+n.radius}]),...(e.arrows||[]).flatMap((n)=>{let o=tVe(n);return[{x:o.minX,y:o.minY},{x:o.maxX,y:o.maxY}]}),...(e.texts||[]).flatMap((n)=>{let o=n.fontSize??12,r=n.text.length*o*yxe,i=o*xxe,s=n.anchorSide??"center",a={top_left:{dx:0,dy:0},top_center:{dx:-r/2,dy:0},top_right:{dx:-r,dy:0},center_left:{dx:0,dy:-i/2},center:{dx:-r/2,dy:-i/2},center_right:{dx:-r,dy:-i/2},bottom_left:{dx:0,dy:-i},bottom_center:{dx:-r/2,dy:-i},bottom_right:{dx:-r,dy:-i}},{dx:c,dy:l}=a[s],h=n.x+c,d=n.y+l;return[{x:h,y:d},{x:h+r,y:d+i}]})];if(t.length===0)return{minX:-1,maxX:1,minY:-1,maxY:1};return t.reduce((n,o)=>({minX:Math.min(n.minX,o.x),maxX:Math.max(n.maxX,o.x),minY:Math.min(n.minY,o.y),maxY:Math.max(n.maxY,o.y)}),{minX:1/0,maxX:-1/0,minY:1/0,maxY:-1/0})}function Nxe(e,t,n){return{...e,points:e.points?.map((o)=>({...o,x:o.x+t,y:o.y+n})),lines:e.lines?.map((o)=>({...o,points:o.points.map((r)=>({x:r.x+t,y:r.y+n}))})),infiniteLines:e.infiniteLines?.map((o)=>({...o,origin:{x:o.origin.x+t,y:o.origin.y+n}})),polygons:e.polygons?.map((o)=>({...o,points:o.points.map((r)=>({x:r.x+t,y:r.y+n}))})),rects:e.rects?.map((o)=>({...o,center:{x:o.center.x+t,y:o.center.y+n}})),circles:e.circles?.map((o)=>({...o,center:{x:o.center.x+t,y:o.center.y+n}})),arrows:e.arrows?.map((o)=>({...o,start:{x:o.start.x+t,y:o.start.y+n},end:{x:o.end.x+t,y:o.end.y+n}})),texts:e.texts?.map((o)=>({...o,x:o.x+t,y:o.y+n}))}}var WC=(e,t)=>({...e,rects:[...e.rects??[],...t.rects??[]],points:[...e.points??[],...t.points??[]],lines:[...e.lines??[],...t.lines??[]],infiniteLines:[...e.infiniteLines??[],...t.infiniteLines??[]],polygons:[...e.polygons??[],...t.polygons??[]],circles:[...e.circles??[],...t.circles??[]],arrows:[...e.arrows??[],...t.arrows??[]],texts:[...e.texts??[],...t.texts??[]]});function hR(e,t={}){if(e.length===0)return{};let n=e[0],o=X1(n),r=o.minY,i=[o];for(let s=1;s<e.length;s++){let a=e[s],c=X1(a),l=o.maxX-o.minX,h=c.maxX-c.minX,d=(l+h)/8,u=o.maxX+d-c.minX,_=r-c.minY,p=Nxe(a,u,_);n=WC(n,p),o=X1(p),i.push(o)}if(t.titles&&t.titles.length>0){let s=X1(n),c=(s.maxX-s.minX)*0.025,l=t.titles.slice(0,i.length).map((h,d)=>{let u=i[d];return{x:(u.minX+u.maxX)/2,y:u.maxY+c,text:h,fontSize:c,anchorSide:"bottom_center"}});n=WC(n,{texts:l})}return n}function dse(e,t={}){if(e.length===0)return{};let n=e[0],o=X1(n),r=o.minX,i=[o];for(let s=1;s<e.length;s++){let a=e[s],c=X1(a),l=o.maxY-o.minY,h=c.maxY-c.minY,d=(l+h)/8,u=r-c.minX,_=o.minY-d-c.maxY,p=Nxe(a,u,_);n=WC(n,p),o=X1(p),i.push(o)}if(t.titles&&t.titles.length>0){let s=X1(n),c=(s.maxY-s.minY)*0.025,l=t.titles.slice(0,i.length).map((h,d)=>{let u=i[d];return{x:u.minX-c,y:u.maxY,text:h,fontSize:c,anchorSide:"top_right"}});n=WC(n,{texts:l})}return n}function use(e,t){if(e.points)for(let n of e.points)n.step=t;if(e.lines)for(let n of e.lines)n.step=t;if(e.infiniteLines)for(let n of e.infiniteLines)n.step=t;if(e.polygons)for(let n of e.polygons)n.step=t;if(e.rects)for(let n of e.rects)n.step=t;if(e.circles)for(let n of e.circles)n.step=t;if(e.texts)for(let n of e.texts)n.step=t;if(e.arrows)for(let n of e.arrows)n.step=t;return e}var co=class{MAX_ITERATIONS=1e5;solved=!1;failed=!1;iterations=0;progress=0;error=null;activeSubSolver;failedSubSolvers;timeToSolve;stats={};_setupDone=!1;getSolverName(){return this.constructor.name}setup(){if(this._setupDone)return;this._setup(),this._setupDone=!0}_setup(){}step(){if(!this._setupDone)this.setup();if(this.solved)return;if(this.failed)return;this.iterations++;try{this._step()}catch(e){throw this.error=`${this.getSolverName()} error: ${e}`,this.failed=!0,e}if(!this.solved&&this.iterations>=this.MAX_ITERATIONS)this.tryFinalAcceptance();if(!this.solved&&this.iterations>=this.MAX_ITERATIONS)this.error=`${this.getSolverName()} ran out of iterations`,this.failed=!0;if("computeProgress"in this)this.progress=this.computeProgress()}_step(){}getConstructorParams(){throw Error("getConstructorParams not implemented")}getOutput(){return null}solve(){let e=Date.now();while(!this.solved&&!this.failed)this.step();let t=Date.now();this.timeToSolve=t-e}visualize(){return{lines:[],points:[],rects:[],circles:[]}}tryFinalAcceptance(){}preview(){return{lines:[],points:[],rects:[],circles:[]}}};function xi(e,t,n,o={}){return{solverName:e,solverClass:t,getConstructorParams:n,onSolved:o.onSolved}}var XC=class extends co{startTimeOfStage={};endTimeOfStage={};timeSpentOnStage={};firstIterationOfStage={};currentPipelineStageIndex=0;inputProblem;pipelineOutputs={};constructor(e){super();this.inputProblem=e,this.MAX_ITERATIONS=1e6}_step(){let e=this.pipelineDef[this.currentPipelineStageIndex];if(!e){this.solved=!0;return}if(this.activeSubSolver){if(this.activeSubSolver.step(),this.activeSubSolver.solved){this.endTimeOfStage[e.solverName]=performance.now(),this.timeSpentOnStage[e.solverName]=this.endTimeOfStage[e.solverName]-this.startTimeOfStage[e.solverName];let n=this.activeSubSolver.getOutput();if(n!==null)this.pipelineOutputs[e.solverName]=n;e.onSolved?.(this),this.activeSubSolver=null,this.currentPipelineStageIndex++}else if(this.activeSubSolver.failed)this.error=this.activeSubSolver?.error,this.failed=!0,this.activeSubSolver=null;return}let t=e.getConstructorParams(this);this.activeSubSolver=new e.solverClass(...t),this[e.solverName]=this.activeSubSolver,this.timeSpentOnStage[e.solverName]=0,this.startTimeOfStage[e.solverName]=performance.now(),this.firstIterationOfStage[e.solverName]=this.iterations}solveUntilStage(e){while(this.getCurrentStageName().toLowerCase()!==e.toLowerCase())if(this.step(),this.failed||this.solved)break}getCurrentStageName(){return this.pipelineDef[this.currentPipelineStageIndex]?.solverName??"none"}getStageProgress(){let e=this.pipelineDef.length;if(e===0)return 1;let t=this.activeSubSolver?.progress??0;return(this.currentPipelineStageIndex+t)/e}getStageStats(){let e={};for(let t of this.pipelineDef){let n=this.timeSpentOnStage[t.solverName]||0,o=this.firstIterationOfStage[t.solverName]||0,r=this.iterations,i=t.solverName===this.getCurrentStageName()?r-o:0,s=this.currentPipelineStageIndex>this.pipelineDef.findIndex((a)=>a.solverName===t.solverName);e[t.solverName]={timeSpent:n,iterations:i,completed:s}}return e}initialVisualize(){return null}finalVisualize(){return null}visualize(){if(!this.solved&&this.activeSubSolver)return this.activeSubSolver.visualize();let e=0,t=this.initialVisualize();if(t)use(t,0),e=1;let n=null;if(this.solved)n=this.finalVisualize();let o=[t].filter(Boolean).concat(this.pipelineDef.map((r,i)=>{let a=this[r.solverName]?.visualize();if(!a)return null;return use(a,i+e),a}).filter(Boolean));if(o.length===0)return{points:[],rects:[],lines:[],circles:[],texts:[]};if(this.solved&&n)use(n,o.length+e+1),o.push(n);if(o.length===1)return o[0];return{points:o.flatMap((r)=>r.points||[]),rects:o.flatMap((r)=>r.rects||[]),lines:o.flatMap((r)=>r.lines||[]),circles:o.flatMap((r)=>r.circles||[]),texts:o.flatMap((r)=>r.texts||[])}}preview(){if(this.activeSubSolver)return this.activeSubSolver.preview();return super.preview()}computeProgress(){return this.getStageProgress()}getStageOutput(e){return this.pipelineOutputs[e]}getAllOutputs(){return{...this.pipelineOutputs}}hasStageOutput(e){return e in this.pipelineOutputs}getSolver(e){return this[e]}};tc();Ko();tc();Ko();Kt();tc();Ko();Ko();var EOo=/\b(?:pcb|source|schematic|subcircuit)_[a-z0-9_]+\b/i,Uxe=(e,t,n)=>{if(!e||e===t||t.length>0&&e.includes(t)||EOo.test(e))return n;return e},lK=(e,t)=>{for(let n of e){let o=Uxe(n,t,"");if(o)return o}return""},Yz=(e,t)=>Hs(e,t),cwt=(e,t)=>{let n=e.find((i)=>i.type==="source_component"&&i.source_component_id===t.source_component_id),o=n?.type==="source_component"?lK([n.name],n.source_component_id):"",r=lK([t.name,t.pin_number?.toString(),t.port_hints?.[0]],t.source_port_id);return`${o||"unnamed component"}.${r||"unnamed pin"}`},C7=(e,t)=>{let n=e.find((o)=>o.type==="pcb_port"&&o.pcb_port_id===t);if(n?.type==="pcb_port"){let o=e.find((a)=>a.type==="source_port"&&a.source_port_id===n.source_port_id),r=o?.type==="source_port"?e.find((a)=>a.type==="source_component"&&a.source_component_id===o.source_component_id):null,i=lK([r?.type==="source_component"?r.name:null],r?.type==="source_component"?r.source_component_id:""),s=lK([o?.type==="source_port"?o.name:null,o?.type==="source_port"?o.pin_number?.toString():null,o?.type==="source_port"?o.port_hints?.[0]:null],o?.type==="source_port"?o.source_port_id:"");if(i&&s)return`${i}.${s}`;if(s)return s}return"unnamed port"},WVe=(e,t)=>{let n=Uxe(t.display_name,t.source_trace_id,"");if(n)return n;let o=(t.connected_source_port_ids??[]).map((r)=>{let i=e.find((h)=>h.type==="pcb_port"&&h.source_port_id===r);if(i?.type==="pcb_port"){let h=C7(e,i.pcb_port_id);return h==="unnamed port"?null:h}let s=e.find((h)=>h.type==="source_port"&&h.source_port_id===r);if(s?.type!=="source_port")return null;let a=e.find((h)=>h.type==="source_component"&&h.source_component_id===s.source_component_id),c=a?.type==="source_component"?Uxe(a.name,a.source_component_id,""):"",l=lK([s.name,s.pin_number?.toString(),s.port_hints?.[0]],s.source_port_id);if(c&&l)return`${c}.${l}`;return l||null}).filter((r)=>Boolean(r));if(o.length>=2)return`${o[0]} to ${o[1]}`;if(o.length===1)return`trace connected to ${o[0]}`;return"unnamed trace"},Hs=(e,t)=>{let n=e.find((a)=>La(a)===t);if(!n)return"unnamed element";if(n.type==="pcb_component"||n.type==="schematic_component"){let a=e.find((c)=>c.type==="source_component"&&c.source_component_id===n.source_component_id);if(a?.type==="source_component")return Uxe(a.name,a.source_component_id,"unnamed component")}if((n.type==="pcb_smtpad"||n.type==="pcb_plated_hole")&&n.pcb_port_id){let a=C7(e,n.pcb_port_id);if(a!=="unnamed port")return a}if(n.type==="pcb_trace")return jM(e,t);let r={pcb_smtpad:"SMD pad",pcb_plated_hole:"through-hole pad",pcb_via:"via",pcb_hole:"hole",pcb_bend:"bend",pcb_stiffener:"stiffener",pcb_keepout:"keepout",pcb_cutout:"cutout",pcb_copper_pour:"copper pour"}[n.type]??n.type.replace(/^(pcb|source|schematic)_/,"").replaceAll("_"," "),i="name"in n?n.name:void 0,s="description"in n?n.description:void 0;return lK([i,s,$Re(e,t)],t)||`unnamed ${r}`},jM=(e,t)=>{let n=e.find((i)=>i.type==="pcb_trace"&&i.pcb_trace_id===t);if(n?.type==="pcb_trace"&&n.source_trace_id){let i=e.find((s)=>s.type==="source_trace"&&s.source_trace_id===n.source_trace_id);if(i?.type==="source_trace")return WVe(e,i)}if(n?.type!=="pcb_trace")return"unnamed trace";let r=[...new Set(n.route.flatMap((i)=>i.route_type==="wire"?[i.start_pcb_port_id,i.end_pcb_port_id]:[]).filter((i)=>Boolean(i)))].map((i)=>C7(e,i)).filter((i)=>i!=="unnamed port");if(r.length>=2)return`${r[0]} to ${r[1]}`;if(r.length===1)return`trace connected to ${r[0]}`;return"unnamed trace"};function MOo(e,t,n){let o=t.type==="pcb_smtpad"?"SMD pad":"through-hole pad",r=t.pcb_port_id?C7(e,t.pcb_port_id):null,i=V1([t]),s=(i.minX+i.maxX)/2,a=(i.minY+i.maxY)/2,c=`(${s.toFixed(2)}mm, ${a.toFixed(2)}mm)`;if(r)return`${o} ${r} at ${c}`;return`${o} #${n+1} at ${c}`}var eBt=(e,t)=>{let n=t*Math.PI/180;return{x:e.x*Math.cos(n)-e.y*Math.sin(n),y:e.x*Math.sin(n)+e.y*Math.cos(n)}},Wxe=({x:e,y:t,width:n,height:o,ccwRotation:r})=>{let i=n/2,s=o/2;return[{x:-i,y:-s},{x:i,y:-s},{x:i,y:s},{x:-i,y:s}].map((a)=>{let c=eBt(a,r);return{x:e+c.x,y:t+c.y}})},WM=(e)=>{let t,n,o,r=0;if(e.type==="pcb_hole"){if(t=e.hole_width,n=e.hole_height,o=Math.min(t,n)/2,e.hole_shape==="rotated_pill")r=e.ccw_rotation}else if(e.type==="pcb_plated_hole")t=e.outer_width,n=e.outer_height,o=Math.min(t,n)/2,r=e.ccw_rotation;else if(t=e.width,n=e.height,o=e.radius,e.shape==="rotated_pill")r=e.ccw_rotation;let i=Math.max(Math.max(t,n)/2-o,0),s=t>=n?{x:i,y:0}:{x:0,y:i},a=eBt(s,r);return{start:{x:e.x-a.x,y:e.y-a.y},end:{x:e.x+a.x,y:e.y+a.y},radius:o}},Ise=(e)=>{if(e.type==="pcb_smtpad"){if(e.shape==="polygon")return e.points;if(e.shape==="rotated_rect")return Wxe({x:e.x,y:e.y,width:e.width,height:e.height,ccwRotation:e.ccw_rotation})}if(e.type==="pcb_plated_hole"&&"rect_pad_width"in e&&"rect_pad_height"in e)return Wxe({x:e.x,y:e.y,width:e.rect_pad_width,height:e.rect_pad_height,ccwRotation:"rect_ccw_rotation"in e&&typeof e.rect_ccw_rotation==="number"?e.rect_ccw_rotation:0});throw Error(`Expected polygonal pad geometry, got ${e.type} with shape "${e.shape}"`)},lwt=(e)=>e.map((t,n)=>[t,e[(n+1)%e.length]]),DVe=(e,t,n,o)=>{let r=mxe(e,t,n,o);if(r)return{distance:0,pointOnA:r,pointOnB:r,center:r};let i=[{pointOnA:e,pointOnB:W1(e,n,o)},{pointOnA:t,pointOnB:W1(t,n,o)},{pointOnA:W1(n,e,t),pointOnB:n},{pointOnA:W1(o,e,t),pointOnB:o}],s=i[0],a=Jj(s.pointOnA,s.pointOnB);for(let c of i.slice(1)){let l=Jj(c.pointOnA,c.pointOnB);if(l<a)s=c,a=l}return{distance:Ix(e,t,n,o),pointOnA:s.pointOnA,pointOnB:s.pointOnB,center:{x:(s.pointOnA.x+s.pointOnB.x)/2,y:(s.pointOnA.y+s.pointOnB.y)/2}}},vse=(e,t,n)=>{if(n.length<3)return{distance:Number.POSITIVE_INFINITY,center:e,tracePoint:e,obstaclePoint:e};let o=lwt(n).map(([i,s])=>mxe(e,t,i,s)).filter((i)=>i!==null);if(o.length>0){let i=t.x-e.x,s=t.y-e.y,a=i*i+s*s;return o.sort((c,l)=>{let h=((c.x-e.x)*i+(c.y-e.y)*s)/a,d=((l.x-e.x)*i+(l.y-e.y)*s)/a;return h-d}),{distance:0,center:o[0],tracePoint:o[0],obstaclePoint:o[0]}}if(UC(e,n)||UC(t,n)){let i={x:(e.x+t.x)/2,y:(e.y+t.y)/2};return{distance:0,center:i,tracePoint:i,obstaclePoint:i}}let r=DVe(e,t,n[0],n[1]);for(let[i,s]of lwt(n).slice(1)){let a=DVe(e,t,i,s);if(a.distance<r.distance)r=a}return{distance:r.distance,center:r.center,tracePoint:r.pointOnA,obstaclePoint:r.pointOnB}},wOo=(e,t)=>{let n=WM(t),o=DVe({x:e.x1,y:e.y1},{x:e.x2,y:e.y2},n.start,n.end);return{distance:o.distance,center:o.center,radius:n.radius,tracePoint:o.pointOnA,obstaclePoint:o.pointOnB}};function hwt(e,t){return Math.sqrt((t.x-e.x)**2+(t.y-e.y)**2)}var CVe=0.000000001,f7=0.000000001;function BOo(e,t){let n=(e.y-t.start.y)*(t.end.x-t.start.x)-(e.x-t.start.x)*(t.end.y-t.start.y);if(Math.abs(n)>CVe)return!1;let o=(e.x-t.start.x)*(t.end.x-t.start.x)+(e.y-t.start.y)*(t.end.y-t.start.y);if(o<-CVe)return!1;let r=(t.end.x-t.start.x)**2+(t.end.y-t.start.y)**2;return o<=r+CVe}function bVe(e,t){let n=!1;for(let o=0,r=t.length-1;o<t.length;r=o++){let i=t[o],s=t[r];if(BOo(e,{start:i,end:s}))return!0;if(i.y>e.y!==s.y>e.y&&e.x<(s.x-i.x)*(e.y-i.y)/(s.y-i.y)+i.x)n=!n}return n}function pK(e,t){if(t.type==="pcb_smtpad"){if(t.shape==="circle")return hwt(e,t)<=t.radius+f7;if(t.shape==="rect"){let n=t.width/2,o=t.height/2;return Math.abs(e.x-t.x)<=n+f7&&Math.abs(e.y-t.y)<=o+f7}if(t.shape==="rotated_rect")return bVe(e,Ise(t));if(t.shape==="pill"||t.shape==="rotated_pill"){if(t.shape==="rotated_pill"){let c=WM(t);return ia(e,c.start,c.end)<=c.radius+f7}let n=t.width/2,o=t.height/2,r=t.radius;if(Math.abs(e.x-t.x)<=n-r+f7&&Math.abs(e.y-t.y)<=o+f7)return!0;let i=Math.max(Math.abs(e.x-t.x)-(n-r),0),s=Math.max(Math.abs(e.y-t.y)-(o-r),0),a=r+f7;return i*i+s*s<=a*a}if(t.shape==="polygon")return bVe(e,t.points)}if(t.type==="pcb_plated_hole"){if(t.shape==="circle")return hwt(e,t)<=t.outer_diameter/2+f7;if("rect_pad_width"in t&&"rect_pad_height"in t)return bVe(e,Ise(t));if(t.shape==="oval"||t.shape==="pill")return Math.abs(e.x-t.x)<=t.outer_width/2+f7&&Math.abs(e.y-t.y)<=t.outer_height/2+f7}return!1}function ag(e){if(e.type==="pcb_trace_segment")return[e.layer];if(e.type==="pcb_smtpad")return[e.layer];if(e.type==="pcb_plated_hole")return Array.isArray(e.layers)?e.layers:[...J_];if(e.type==="pcb_hole")return[...J_];if(e.type==="pcb_via")return Array.isArray(e.layers)?e.layers:[...J_];if(e.type==="pcb_keepout")return Array.isArray(e.layers)?e.layers:[];return[]}function TOo(e,t){return e.route_type==="wire"&&ag(t).includes(e.layer)&&pK(e,t)}var K1=0.000000001;function XVe(e){let t=new WeakMap,n=(o)=>{let r=t.get(o);if(!r)r={box:o.box,facePoints:[...o.faces].map((i)=>i.first.start),edges:[...o.edges].map((i)=>i.shape),edgeIndex:o.edges},t.set(o,r);return r};return(o,r)=>{if(o.isEmpty()||r.isEmpty())return!1;let i=n(o),s=n(r);if(i.box.xmin>s.box.xmax+e||i.box.xmax<s.box.xmin-e||i.box.ymin>s.box.ymax+e||i.box.ymax<s.box.ymin-e)return!1;if(i.facePoints.some((l)=>s.box.contains(l)&&r.contains(l))||s.facePoints.some((l)=>i.box.contains(l)&&o.contains(l)))return!0;let[a,c]=i.edges.length<=s.edges.length?[i,s]:[s,i];for(let l of a.edges){let h=l.box,d=new rA(h.xmin-e,h.ymin-e,h.xmax+e,h.ymax+e),u=c.edgeIndex.search(d);for(let _ of u)if(l.distanceTo(_.shape)[0]<=e)return!0}return!1}}var x7=1e6;function DOo({center:e,radius:t,holeRadius:n=0}){if(n>0)return QN(e,t*2,n*2).scale(x7,x7);return new tl(new ZF(new Ks(e.x*x7,e.y*x7),t*x7))}function NOo(e,t){let n=new Map;for(let r of e){if(r.type!=="pcb_copper_pour"||!r.source_net_id)continue;let i=t.getNetConnectedToId(r.source_net_id);if(!i)continue;let s=n.get(i)??[];s.push({layer:r.layer,polygon:RN(r).scale(x7,x7)}),n.set(i,s)}let o=XVe(K1*x7);return(r)=>{let i=(n.get(r.netId)??[]).filter((a)=>r.layers.includes(a.layer));if(r.radius===0){let a=new Ks(r.center.x*x7,r.center.y*x7);return i.some((c)=>c.polygon.contains(a))}if(i.length===0)return!1;let s=DOo(r);return i.some((a)=>o(s,a.polygon))}}var E2={min_trace_width:0.1,min_via_hole_edge_to_via_hole_edge_clearance:0.1,min_plated_hole_drill_edge_to_drill_edge_clearance:0.15,min_trace_to_hole_edge_clearance:0.2,min_trace_to_pad_edge_clearance:0.1,min_pad_edge_to_pad_edge_clearance:0.1,min_board_edge_clearance:0.2,min_via_hole_diameter:0.2,min_via_pad_diameter:0.3},ROo=0.1,{min_trace_width:NVe,min_via_pad_diameter:bCs,min_board_edge_clearance:ICs,min_via_hole_edge_to_via_hole_edge_clearance:vCs,min_via_hole_edge_to_via_hole_edge_clearance:SCs,min_pad_edge_to_pad_edge_clearance:PCs}=E2,E4=0.005,XI=(e)=>e.find((t)=>t.type==="pcb_board"),WI=(e,t)=>e?.[t],b7=(e)=>{if(e.type==="pcb_keepout"){if(e.shape==="outline")return{minX:Math.min(...e.outline.map((t)=>t.x)),minY:Math.min(...e.outline.map((t)=>t.y)),maxX:Math.max(...e.outline.map((t)=>t.x)),maxY:Math.max(...e.outline.map((t)=>t.y))};if(e.shape==="circle")return{minX:e.center.x-e.radius,minY:e.center.y-e.radius,maxX:e.center.x+e.radius,maxY:e.center.y+e.radius};return{minX:e.center.x-e.width/2,minY:e.center.y-e.height/2,maxX:e.center.x+e.width/2,maxY:e.center.y+e.height/2}}return V1([e])},RVe=(e)=>{if(e.type==="pcb_keepout"&&e.shape!=="outline")return e.center;let t=b7(e);return kz({x:t.minX,y:t.minY},{x:t.maxX,y:t.maxY})},QOo=(e)=>{if(e.type==="pcb_keepout"&&e.shape==="circle")return e.radius;let t=b7(e);return Math.min(t.maxX-t.minX,t.maxY-t.minY)/2},Fz=(e)=>e.type==="pcb_via"||e.shape==="circle",zz=(e)=>e.type==="pcb_smtpad"&&(e.shape==="pill"||e.shape==="rotated_pill")||e.type==="pcb_plated_hole"&&(e.shape==="oval"||e.shape==="pill"),Oz=(e)=>{let t=RVe(e);return{kind:"circle",x:t.x,y:t.y,radius:QOo(e)}},Vz=(e)=>{if(e.type==="pcb_keepout"){if(e.shape==="outline")return{kind:"polygon",points:e.outline};if(e.shape!=="rect")throw Error(`Expected rectangular keepout, got ${e.shape}`);return{kind:"polygon",points:[{x:e.center.x-e.width/2,y:e.center.y-e.height/2},{x:e.center.x+e.width/2,y:e.center.y-e.height/2},{x:e.center.x+e.width/2,y:e.center.y+e.height/2},{x:e.center.x-e.width/2,y:e.center.y+e.height/2}]}}if(e.type==="pcb_smtpad"&&(e.shape==="polygon"||e.shape==="rotated_rect"))return{kind:"polygon",points:Ise(e)};if(e.type==="pcb_plated_hole"&&"rect_pad_width"in e&&"rect_pad_height"in e)return{kind:"polygon",points:Ise(e)};let t=b7(e);return{kind:"polygon",points:[{x:t.minX,y:t.minY},{x:t.maxX,y:t.minY},{x:t.maxX,y:t.maxY},{x:t.minX,y:t.maxY}]}},QVe=(e)=>{if(e.type!=="pcb_smtpad"||e.shape!=="rect"&&e.shape!=="rotated_rect"||!e.corner_radius||e.corner_radius<=0)return null;let t=Math.min(e.corner_radius,e.width/2,e.height/2);if(t===Math.min(e.width,e.height)/2)return{core:{...e,shape:"rotated_pill",radius:t,ccw_rotation:e.shape==="rotated_rect"?e.ccw_rotation:0},radius:0};return{core:{...e,width:e.width-2*t,height:e.height-2*t,corner_radius:0},radius:t}},P4=(e,t)=>{let n=QVe(e),o=QVe(t);if(n||o)return P4(n?.core??e,o?.core??t)-(n?.radius??0)-(o?.radius??0);if(zz(e)&&zz(t)){let r=WM(e),i=WM(t);return Ix(r.start,r.end,i.start,i.end)-r.radius-i.radius}if(zz(e)&&Fz(t)){let r=WM(e);return tse(r.start,r.end,Oz(t))-r.radius}if(Fz(e)&&zz(t)){let r=WM(t);return tse(r.start,r.end,Oz(e))-r.radius}if(zz(e)){let r=WM(e);return vse(r.start,r.end,Vz(t).points).distance-r.radius}if(zz(t)){let r=WM(t);return vse(r.start,r.end,Vz(e).points).distance-r.radius}if(Fz(e)&&Fz(t))return xbt(Oz(e),Oz(t));if(Fz(e))return qRe(Oz(e),Vz(t));if(Fz(t))return qRe(Oz(t),Vz(e));return Cbt(Vz(e),Vz(t))},_R=(e)=>[...As(e).pcb_smtpad.list(),...As(e).pcb_plated_hole.list()],tBt=(e)=>As(e).pcb_trace.list().flatMap((n)=>{let o=[];for(let r=0;r<n.route.length-1;r++){let i=n.route[r],s=n.route[r+1];if(i.route_type!=="wire")continue;if(s.route_type!=="wire")continue;if(i.layer!==s.layer)continue;o.push({type:"pcb_trace_segment",pcb_trace_id:n.pcb_trace_id,_pcbTrace:n,thickness:"width"in i?i.width:("width"in s)?s.width:NVe,layer:i.layer,x1:i.x,y1:i.y,x2:s.x,y2:s.y})}return o}),IVe=({tracePoint:e,obstaclePoint:t,traceRadius:n,obstacleRadius:o})=>{let r=t.x-e.x,i=t.y-e.y,s=Math.hypot(r,i);if(s===0)return kz(e,t);let a=r/s,c=i/s;if(s<=n+o){let d=Math.max(-n,s-o),u=Math.min(n,s+o),_=(d+u)/2;return{x:e.x+a*_,y:e.y+c*_}}let l={x:e.x+a*n,y:e.y+c*n},h={x:t.x-a*o,y:t.y-c*o};return kz(l,h)},Ese=(e,t)=>{let n=QVe(t);if(n)t=n.core;let o=n?.radius??0,r={x:e.x1,y:e.y1},i={x:e.x2,y:e.y2},s=e.thickness/2;if(t.type==="pcb_via"||Fz(t)){let c=t.type==="pcb_via"?{x:t.x,y:t.y,radius:t.outer_diameter/2}:Oz(t),l=W1(c,r,i);return{gap:tse(r,i,c)-s,center:IVe({tracePoint:l,obstaclePoint:c,traceRadius:s,obstacleRadius:c.radius})}}if(zz(t)){let c=wOo(e,t);return{gap:c.distance-s-c.radius,center:IVe({tracePoint:c.tracePoint,obstaclePoint:c.obstaclePoint,traceRadius:s,obstacleRadius:c.radius})}}let a=vse(r,i,Vz(t).points);return{gap:a.distance-s-o,center:IVe({tracePoint:a.tracePoint,obstaclePoint:a.obstaclePoint,traceRadius:s,obstacleRadius:o})}},cK=(e)=>e<=0,kOo=(e,t)=>Ese({x1:e.x,y1:e.y,x2:e.x,y2:e.y,thickness:e.outer_diameter},t).center;function LOo(e){let t=e.find((r)=>r.type==="pcb_board")?.num_layers,n=J_.filter((r)=>r.startsWith("inner"));if(t!==void 0)n=n.slice(0,Math.max(0,t-2));let o=["top",...n];if(t!==1)o.push("bottom");return o}function HOo(e){return e.filter((t)=>Number.isFinite(t.outer_diameter)&&t.outer_diameter>0).map((t)=>({id:t.pcb_via_id,layers:ag(t),x:t.x,y:t.y,radius:t.outer_diameter/2,holeRadius:t.hole_diameter/2}))}function FOo({traces:e,vias:t},{circuitJson:n,connMap:o}){let r=LOo(n),i=[];for(let s of e)for(let a of s.route){if(a.route_type!=="via")continue;if(t.some((_)=>Math.hypot(_.x-a.x,_.y-a.y)<=K1&&(_.pcb_trace_id===s.pcb_trace_id||!_.pcb_trace_id&&o.areIdsConnected(_.pcb_via_id,s.pcb_trace_id))))continue;let l=r.indexOf(a.from_layer),h=r.indexOf(a.to_layer);if(l<0||h<0)continue;let d=a.outer_diameter,u;if(d!==void 0){if(!Number.isFinite(d)||d<=0)continue;u=d/2}i.push({id:s.pcb_trace_id,layers:r.slice(Math.min(l,h),Math.max(l,h)+1),x:a.x,y:a.y,radius:u})}return i}function zOo({viaCopper:e,pad:t}){if(e.radius===void 0)return pK(e,t);let n={type:"pcb_via",pcb_via_id:e.id,x:e.x,y:e.y,outer_diameter:e.radius*2,hole_diameter:0,layers:J_.filter((o)=>e.layers.includes(o))};return P4(n,t)<=K1}function OOo({trace:e,viaCopper:t}){if(e.route_thickness_mode==="interpolated")return!1;for(let n=1;n<e.route.length;n++){let o=e.route[n-1],r=e.route[n];if(o.route_type!=="wire"||r.route_type!=="wire"||o.layer!==r.layer||!t.layers.includes(o.layer)||!Number.isFinite(o.width)||o.width<=0||Math.hypot(o.x-r.x,o.y-r.y)<=K1)continue;let i=0;if(t.radius!==void 0)i=t.radius+o.width/2;if(ia(t,o,r)<=i+K1)return!0}return!1}function VOo(e){let{circuitJson:t,connMap:n,touchesPour:o}=e,r=_R(t),i=t.filter((l)=>l.type==="pcb_trace"),s=t.filter((l)=>l.type==="pcb_via"),a=[...HOo(s),...FOo({traces:i,vias:s},e)],c=new Map;for(let l of a){if(!Number.isFinite(l.x)||!Number.isFinite(l.y))continue;let h=n.getNetConnectedToId(l.id);if(!h)continue;let d=o({netId:h,layers:l.layers,center:l,radius:l.radius??0,holeRadius:l.holeRadius})||r.some((m)=>n.getNetConnectedToId(La(m))===h&&ag(m).some((A)=>l.layers.includes(A))&&zOo({viaCopper:l,pad:m})),u=new Set;for(let m of i)if(n.getNetConnectedToId(m.pcb_trace_id)===h&&OOo({trace:m,viaCopper:l}))u.add(m.pcb_trace_id);let _={viaCopper:l,touchesPadOrPour:d,touchingTraceIds:u},p=c.get(h)??new Map;for(let m of l.layers){let A=p.get(m)??[];A.push(_),p.set(m,A)}c.set(h,p)}return c}function YOo({trace:e,point:t,width:n},{connMap:o,viaContactIndex:r}){if(!Number.isFinite(n)||n<=0)return!1;let i=o.getNetConnectedToId(e.pcb_trace_id);if(!i)return!1;return(r.get(i)?.get(t.layer)??[]).some(({viaCopper:a,touchesPadOrPour:c,touchingTraceIds:l})=>{if(!(c||[...l].some((u)=>u!==e.pcb_trace_id)))return!1;let d=0;if(a.radius!==void 0)d=a.radius+n/2;return Math.hypot(t.x-a.x,t.y-a.y)<=d+K1})}function nBt({route:e,anchorPoint:t,fromIndex:n,step:o}){let r=t;for(let i=n;i>=0&&i<e.length;i+=o){let s=e[i];if(s.route_type!=="wire"||s.layer!==t.layer||ia(r,t,s)>K1)break;r=s}return r}function GOo(e,t){if(e.route_thickness_mode==="interpolated")return;let{route:n}=e,o=0,r=1;if(t==="end")o=n.length-1,r=-1;let i=o+r;while(i>=0&&i<n.length){let s=n[o],a=n[i];if(s.route_type!=="wire"||a.route_type!=="wire"||s.layer!==a.layer)return;if(!(Math.hypot(s.x-a.x,s.y-a.y)<=K1)){let l=s.width;if(t==="end")l=a.width;let h=nBt({route:n,anchorPoint:s,fromIndex:i,step:r});return{width:l,inwardPoint:h}}o=i,i+=r}return}function UOo({route:e,startIndex:t,start:n,end:o}){let r=n;for(let i=t-1;i>=0;i--){let s=e[i];if(s.route_type!=="wire"||s.layer!==o.layer||ia(r,s,o)>K1)break;r=s}return r}function WOo(e,t){let n=new Map;for(let o of e){if(o.type!=="pcb_trace")continue;if(o.route_thickness_mode==="interpolated")continue;let r=t.getNetConnectedToId(o.pcb_trace_id);if(!r)continue;for(let i=0;i<o.route.length-1;i++){let s=o.route[i],a=o.route[i+1];if(s.route_type!=="wire"||a.route_type!=="wire")continue;if(s.layer!==a.layer)continue;if(Math.hypot(s.x-a.x,s.y-a.y)<=K1)continue;let c=UOo({route:o.route,startIndex:i,start:s,end:a}),l=nBt({route:o.route,anchorPoint:c,fromIndex:i+1,step:1}),h=n.get(r)??new Map,d=h.get(s.layer)??[];d.push({trace:o,start:s,end:a,centerlineStart:c,centerlineEnd:l}),h.set(s.layer,d),n.set(r,h)}}return n}function XOo({point:e,terminalSegment:t,segment:n}){let o=ia(e,n.start,n.end),r=t.width/2,i=n.start.width/2;if(o+r<=i+K1)return!0;if(ia(t.inwardPoint,n.centerlineStart,n.centerlineEnd)<=K1&&ia(e,n.centerlineStart,n.centerlineEnd)>K1)return!1;return o<=r+i+K1}function jOo(e,t){let n=e.filter((o)=>o.type==="pcb_smtpad"||o.type==="pcb_plated_hole").filter((o)=>o.pcb_port_id);return{circuitJson:e,portPads:n,connMap:t}}function $xe(e){return e.connMap??=oa(e.circuitJson),e.connMap}function oBt(e){return e.touchesPour??=NOo(e.circuitJson,$xe(e)),e.touchesPour}function KOo(e){return e.traceWireSegmentsByNetAndLayer??=WOo(e.circuitJson,$xe(e)),e.traceWireSegmentsByNetAndLayer}function $Oo(e){return e.viaContactIndex??=VOo({circuitJson:e.circuitJson,connMap:$xe(e),touchesPour:oBt(e)}),e.viaContactIndex}function qOo({trace:e,point:t,terminalSegment:n},o){let r=$xe(o),i=r.getNetConnectedToId(e.pcb_trace_id),s=oBt(o);if(i&&s({netId:i,layers:[t.layer],center:t,radius:n.width/2}))return!0;let a=KOo(o);if(i){if((a.get(i)?.get(t.layer)??[]).some((h)=>h.trace.pcb_trace_id!==e.pcb_trace_id&&XOo({point:t,terminalSegment:n,segment:h})))return!0}return YOo({trace:e,point:t,width:n.width},{connMap:r,viaContactIndex:$Oo(o)})}function JOo({trace:e,endpoint:t,point:n,hasExpectedPorts:o},r){if(r.portPads.some((s)=>TOo(n,s)))return!1;let i=GOo(e,t);if(!i)return!o;return!qOo({trace:e,point:n,terminalSegment:i},r)}function ZOo({trace:e,hasExpectedPorts:t},n){let o=[{endpoint:"start",point:e.route[0]},{endpoint:"end",point:e.route[e.route.length-1]}],r=[];for(let{endpoint:a,point:c}of o){if(c.route_type!=="wire")continue;if(JOo({trace:e,endpoint:a,point:c,hasExpectedPorts:t},n))r.push({endpoint:a,point:c})}let[i,s]=r;if(i&&s&&i.point.layer===s.point.layer&&Math.hypot(i.point.x-s.point.x,i.point.y-s.point.y)<=K1)r.pop();return r}function eVo(e,t={}){let n=jOo(e,t.connMap),o=new Map,r=new Set;for(let s of e){if(s.type==="source_trace")o.set(s.source_trace_id,s);if(s.type==="pcb_port")r.add(s.source_port_id)}let i=[];for(let s of e){if(s.type!=="pcb_trace"||s.route.length===0)continue;if(s.is_antenna_trace===!0)continue;let a=!1;if(s.source_trace_id){let c=o.get(s.source_trace_id);a=Boolean(c?.connected_source_port_ids.some((l)=>r.has(l)))}for(let{endpoint:c,point:l}of ZOo({trace:s,hasExpectedPorts:a},n)){let h=jM(e,s.pcb_trace_id);i.push({type:"pcb_trace_error",error_type:"pcb_trace_error",pcb_trace_error_id:`disconnected_endpoint_${s.pcb_trace_id}_${c}`,message:`Trace [${h}] has dangling endpoint at (${l.x.toFixed(2)}, ${l.y.toFixed(2)})`,source_trace_id:s.source_trace_id||`!${s.pcb_trace_id}`,pcb_trace_id:s.pcb_trace_id,center:{x:l.x,y:l.y},pcb_component_ids:[],pcb_port_ids:[]})}}return i}var kVe=(e,t)=>{let n={x:e.x1,y:e.y1},o={x:e.x2,y:e.y2},r={x:t.x1,y:t.y1},i={x:t.x2,y:t.y2},s={x:o.x-n.x,y:o.y-n.y},a={x:i.x-r.x,y:i.y-r.y},c=s.x*s.x+s.y*s.y,l=a.x*a.x+a.y*a.y;if(c===0||l===0){if(c===0&&l===0)return{x:(n.x+r.x)/2,y:(n.y+r.y)/2};if(c===0){let B=y7(((n.x-r.x)*a.x+(n.y-r.y)*a.y)/l,0,1),T={x:r.x+B*a.x,y:r.y+B*a.y};return{x:(n.x+T.x)/2,y:(n.y+T.y)/2}}let P=y7(((r.x-n.x)*s.x+(r.y-n.y)*s.y)/c,0,1),M={x:n.x+P*s.x,y:n.y+P*s.y};return{x:(M.x+r.x)/2,y:(M.y+r.y)/2}}let h={x:n.x-r.x,y:n.y-r.y},d=s.x*s.x+s.y*s.y,u=s.x*a.x+s.y*a.y,_=s.x*h.x+s.y*h.y,p=a.x*a.x+a.y*a.y,m=a.x*h.x+a.y*h.y,A=d*p-u*u;if(A<0.0000000001)return tVo(n,o,r,i,s,a,c,l);let g=(u*m-p*_)/A,f=(d*m-u*_)/A;g=y7(g,0,1),f=y7(f,0,1),f=(g*u+m)/p,f=y7(f,0,1),g=(f*u-_)/d,g=y7(g,0,1);let y={x:n.x+g*s.x,y:n.y+g*s.y},x={x:r.x+f*a.x,y:r.y+f*a.y},C=y.x-x.x,b=y.y-x.y,I=Math.sqrt(C*C+b*b);return{x:(y.x+x.x)/2,y:(y.y+x.y)/2}},tVo=(e,t,n,o,r,i,s,a)=>{let c=((n.x-e.x)*r.x+(n.y-e.y)*r.y)/s;c=y7(c,0,1);let l={x:e.x+c*r.x,y:e.y+c*r.y},h=((o.x-e.x)*r.x+(o.y-e.y)*r.y)/s;h=y7(h,0,1);let d={x:e.x+h*r.x,y:e.y+h*r.y},u=((e.x-n.x)*i.x+(e.y-n.y)*i.y)/a;u=y7(u,0,1);let _={x:n.x+u*i.x,y:n.y+u*i.y},p=((t.x-n.x)*i.x+(t.y-n.y)*i.y)/a;p=y7(p,0,1);let m={x:n.x+p*i.x,y:n.y+p*i.y},g=[{pointA:l,pointB:n,distance:Math.sqrt((l.x-n.x)**2+(l.y-n.y)**2)},{pointA:d,pointB:o,distance:Math.sqrt((d.x-o.x)**2+(d.y-o.y)**2)},{pointA:e,pointB:_,distance:Math.sqrt((e.x-_.x)**2+(e.y-_.y)**2)},{pointA:t,pointB:m,distance:Math.sqrt((t.x-m.x)**2+(t.y-m.y)**2)}].reduce((f,y)=>y.distance<f.distance?y:f);return{x:(g.pointA.x+g.pointB.x)/2,y:(g.pointA.y+g.pointB.y)/2}},y7=(e,t,n)=>Math.max(t,Math.min(n,e));function LVe(e){if(e.route_type!=="wire")return[];return[e.start_pcb_port_id,e.end_pcb_port_id].filter((t)=>Boolean(t))}function nVo(e){let t=new Set;for(let n of e.route)for(let o of LVe(n))t.add(o);return Array.from(t)}function _se(e){let t=new Set;for(let n of e)for(let o of nVo(n))t.add(o);return Array.from(t)}function oVo(e){let t=new Set(e.flatMap((r)=>r.type==="source_bus"&&r.max_length_skew!==void 0?r.source_trace_ids:[])),n=As(e),o=[];for(let r of e){if(r.type!=="pcb_trace")continue;if(!r.source_trace_id||!t.has(r.source_trace_id))continue;let i=[],s=[],a=0,c=0;for(let h=0;h<r.route.length-1;h++){s[h]=a;let d=r.route[h],u=r.route[h+1];if(d.route_type!=="wire"||u.route_type!=="wire"||d.layer!==u.layer){c++;continue}let _=Math.hypot(u.x-d.x,u.y-d.y);if(_===0)continue;i.push({type:"pcb_trace_segment",_pcbTrace:r,pcb_trace_id:r.pcb_trace_id,thickness:d.width,layer:d.layer,x1:d.x,y1:d.y,x2:u.x,y2:u.y,run:c,startDistance:a,endDistance:a+_}),a+=_}s[r.route.length-1]=a;let l;e:for(let h=0;h<i.length;h++){let d=i[h];for(let u=h+1;u<i.length;u++){let _=i[u];if(d.layer!==_.layer)continue;let p=(d.thickness+_.thickness)/2,m=(d.x2-d.x1)*(_.x2-_.x1)+(d.y2-d.y1)*(_.y2-_.y1),A=(d.x2-d.x1)*(_.y2-_.y1)-(d.y2-d.y1)*(_.x2-_.x1),g=Math.hypot(d.x2-d.x1,d.y2-d.y1)*Math.hypot(_.x2-_.x1,_.y2-_.y1),f=m>=-0.000000001*g,y=d.run===_.run&&_.startDistance===d.endDistance;if(y&&!(m<0&&Math.abs(A)<0.000000001))continue;if(!y&&d.run===_.run&&_.startDistance-d.endDistance<=Math.SQRT2*p&&f)continue;if(Ix({x:d.x1,y:d.y1},{x:d.x2,y:d.y2},{x:_.x1,y:_.y1},{x:_.x2,y:_.y2})-p>0.000000001)continue;l=kVe(d,_);break e}}if(!l){let h=e.find((u)=>u.type==="pcb_board"),d=["top",...J_.filter((u)=>u.startsWith("inner")).slice(0,h?Math.max(0,h.num_layers-2):void 0),...h?.num_layers===1?[]:["bottom"]];e:for(let u=0;u<r.route.length;u++){let _=r.route[u];if(_.route_type!=="via")continue;let p=n.pcb_via.list().find((y)=>(y.pcb_trace_id===r.pcb_trace_id||!y.pcb_trace_id&&y.source_trace_id===r.source_trace_id)&&Math.hypot(y.x-_.x,y.y-_.y)<=0.000000001),m=p?.outer_diameter??_.outer_diameter;if(m===void 0||!Number.isFinite(m)||m<=0)continue;let A=d.indexOf(_.from_layer),g=d.indexOf(_.to_layer),f=p?.layers??(A>=0&&g>=0?d.slice(Math.min(A,g),Math.max(A,g)+1):[]);for(let y of i){if(!f.includes(y.layer))continue;let x=(m+y.thickness)/2;if(Math.max(y.startDistance-s[u],s[u]-y.endDistance,0)<=x+0.000000001)continue;let b={...y,x1:_.x,y1:_.y,x2:_.x,y2:_.y};if(Ix(_,_,{x:y.x1,y:y.y1},{x:y.x2,y:y.y2})-x>0.000000001)continue;l=kVe(y,b);break e}}}if(l){let h=n.source_trace.get(r.source_trace_id),d=(h?.connected_source_port_ids??[]).map((_)=>{let p=n.source_port.get(_),m=p?.source_component_id?n.source_component.get(p.source_component_id):void 0;return m?.name&&p?.name?`${m.name}.${p.name}`:void 0}).filter((_)=>Boolean(_)),u=h?.name||h?.display_name||d.join(" → ")||"unnamed";o.push({type:"pcb_trace_error",error_type:"pcb_trace_error",pcb_trace_error_id:`self_short_${r.pcb_trace_id}`,pcb_trace_id:r.pcb_trace_id,source_trace_id:r.source_trace_id,message:`PCB trace "${u}" shorts to itself, bypassing part of its length-matched route`,center:l,pcb_component_ids:[],pcb_port_ids:_se([r]),subcircuit_id:r.subcircuit_id})}}return o}function dwt(e,t){let n=p4.getTolerance(),o=e.edges.search(new rA(t.x-n,t.y-n,1/0,t.y+n)),r=!1;for(let i of o){if(!(i instanceof kAe))throw Error("Expected a polygon edge in the spatial index");let s=i.shape;if(!(s instanceof eg||s instanceof Ap))throw Error("Expected a segment or arc in the polygon");if(s.contains(t))return!0;if(s instanceof eg){let{start:a,end:c}=s;if(a.y>t.y===c.y>t.y)continue;if(a.x+(t.y-a.y)*(c.x-a.x)/(c.y-a.y)>t.x)r=!r}else{let a=2*Math.PI,c=(s.startAngle%a+a)%a,l=new Ap(s.pc,s.r,c,c+(s.counterClockwise?s.sweep:-s.sweep),s.counterClockwise).breakToFunctional(),h=i.prev.shape instanceof eg?i.prev.end.y:s.start.y,d=i.next.start.y;for(let[u,_]of l.entries()){let p=u===0?h:_.start.y,m=u===l.length-1?d:_.end.y;if(p>t.y===m>t.y)continue;let A=t.y-_.pc.y;if(Math.abs(A)>_.r)continue;let g=Math.sqrt((_.r-A)*(_.r+A));if(_.pc.x+(_.middle().x>=_.pc.x?g:-g)>t.x)r=!r}}}return r}var pR=0.000000001,UI=(e)=>new Ks(e.x,e.y);function KM(e,t){if(!Number.isFinite(e)||e<=0)throw Error(`${t} must be finite and positive`);return e}function $1(e,t){return KM(t,"radius"),new tl(new ZF(UI(e),t))}function S4(e){let t=e.filter((r,i)=>i===0||UI(r).distanceTo(UI(e[i-1]))[0]>pR);if(t.length>1&&UI(t[0]).distanceTo(UI(t.at(-1)))[0]<=pR)t.pop();if(t.length<2)throw Error("A ring needs at least two distinct vertices");let n=t.map((r,i)=>{let s=t[(i+1)%t.length];if(![r.x,r.y,r.bulge??0].every(Number.isFinite))throw Error("Non-finite ring vertex");let a=r.bulge??0;if(Math.abs(a)<=pR)return new eg(UI(r),UI(s));let c=s.x-r.x,l=s.y-r.y,h=Math.hypot(c,l),d=h*(1-a*a)/(4*a),u=new Ks((r.x+s.x)/2-l/h*d,(r.y+s.y)/2+c/h*d);return new Ap(u,h*(1+a*a)/(4*Math.abs(a)),Math.atan2(r.y-u.y,r.x-u.x),Math.atan2(s.y-u.y,s.x-u.x),a>0)}),o=new tl;if(o.addFace(n),o.area()<=pR)throw Error("A ring must enclose a non-zero area");return o}function P2(e,t,n,o=0,r=0){if(KM(t,"width"),KM(n,"height"),!Number.isFinite(o)||!Number.isFinite(r)||r<0)throw Error("Invalid rectangle rotation or corner radius");let i=Math.min(r,t/2,n/2),s=t/2,a=n/2,c;if(i<=pR)c=S4([{x:-s,y:-a},{x:s,y:-a},{x:s,y:a},{x:-s,y:a}]);else{let l=[new Ks(s-i,-a+i),new Ks(s-i,a-i),new Ks(-s+i,a-i),new Ks(-s+i,-a+i)],h=[];for(let d=0;d<4;d++){let u=-Math.PI/2+d*Math.PI/2,_=new Ap(l[d],i,u,u+Math.PI/2,!0),p=l[(d+1)%4],m=new Ks(p.x+i*Math.cos(u+Math.PI/2),p.y+i*Math.sin(u+Math.PI/2));if(h.push(_),_.end.distanceTo(m)[0]>pR)h.push(new eg(_.end,m))}c=new tl,c.addFace(h)}return c.rotate(o*Math.PI/180).translate(new RX(e.x,e.y))}function HVe(e,t,n,o=n){let r=KM(n,"trace width")/2,i=KM(o,"trace width")/2,s=UI(e).distanceTo(UI(t))[0];if(s<=Math.abs(r-i)+pR)return $1(r>=i?e:t,Math.max(r,i));let a=Math.atan2(t.y-e.y,t.x-e.x),c=Math.acos((r-i)/s),l=a-c,h=a+c,d=(_,p,m)=>new Ks(_.x+p*Math.cos(m),_.y+p*Math.sin(m)),u=new tl;return u.addFace([new eg(d(e,r,l),d(t,i,l)),new Ap(UI(t),i,l,h,!0),new eg(d(t,i,h),d(e,r,h)),new Ap(UI(e),r,h,l,!0)]),u}function Xxe(e,t){let n=e.clone(),o=[...n.faces][0].orientation();for(let r of t){let i=r.clone();if([...i.faces][0].orientation()===o)i.reverse();for(let s of i.faces)n.addFace(s.shapes)}return n}function Oxe(e,t,n,o=0,r=0.001){if(KM(t,"ellipse width"),KM(n,"ellipse height"),KM(r,"curveTolerance"),Math.abs(t-n)<pR)return $1(e,t/2);let i=Math.max(t,n)/2,s=Math.max(16,Math.ceil(Math.PI/Math.acos(Math.max(-1,1-r/i))));if(s>1e5)throw Error("curveTolerance requires more than 100000 ellipse segments");return S4(Array.from({length:s},(a,c)=>({x:t/2*Math.cos(c*2*Math.PI/s),y:n/2*Math.sin(c*2*Math.PI/s)}))).rotate(o*Math.PI/180).translate(new RX(e.x,e.y))}function rVo(e,t){if(t.copperLayers){if(!t.copperLayers.length||new Set(t.copperLayers).size!==t.copperLayers.length)throw Error("copperLayers must be a non-empty list without duplicates");return[...t.copperLayers]}let o=e.find((r)=>r.type==="pcb_board")?.num_layers??2;for(let r of e){let i="layers"in r?r.layers:("layer"in r)?[r.layer]:[];if(Array.isArray(i))for(let s of i){let a=typeof s==="string"&&/^inner(\d+)$/.exec(s);if(a)o=Math.max(o,Number(a[1])+2)}if(r.type==="pcb_trace")for(let s of r.route)for(let a of s.route_type==="wire"?[s.layer]:s.route_type==="via"?[s.from_layer,s.to_layer]:[s.start_layer,s.end_layer]){let c=/^inner(\d+)$/.exec(a);if(c)o=Math.max(o,Number(c[1])+2)}}if(!Number.isInteger(o)||o<1||o>10)throw Error("Supported copper layer count is 1–10");return o===1?["top"]:["top",...Array.from({length:o-2},(r,i)=>`inner${i+1}`),"bottom"]}function fse(e,t){if(!e.length)return[];let n=e.map((o)=>t.indexOf(o));if(n.some((o)=>o<0))throw Error(`Layer is missing from copperLayers: ${e.join(", ")}`);return t.slice(Math.min(...n),Math.max(...n)+1)}function iVo(e){switch(e.shape){case"circle":return $1(e,e.radius);case"polygon":return S4(e.points);case"rect":case"rotated_rect":return P2(e,e.width,e.height,"ccw_rotation"in e?e.ccw_rotation:0,e.rect_border_radius??e.corner_radius??0);case"pill":case"rotated_pill":return P2(e,e.width,e.height,"ccw_rotation"in e?e.ccw_rotation:0,e.radius)}}function sVo(e,t){switch(e.hole_shape){case"circle":return $1(e,e.hole_diameter/2);case"square":return P2(e,e.hole_diameter,e.hole_diameter);case"rect":return P2(e,e.hole_width,e.hole_height);case"oval":return Oxe(e,e.hole_width,e.hole_height,0,t);case"pill":case"rotated_pill":return P2(e,e.hole_width,e.hole_height,"ccw_rotation"in e?e.ccw_rotation:0,Math.min(e.hole_width,e.hole_height)/2)}}function aVo(e,t,n,o){let r,i,s={x:e.x+("hole_offset_x"in e?e.hole_offset_x??0:0),y:e.y+("hole_offset_y"in e?e.hole_offset_y??0:0)};switch(e.shape){case"circle":r=$1(e,e.outer_diameter/2),i=$1(e,e.hole_diameter/2);break;case"oval":r=Oxe(e,e.outer_width,e.outer_height,e.ccw_rotation,o),i=Oxe(e,e.hole_width,e.hole_height,e.ccw_rotation,o);break;case"pill":r=P2(e,e.outer_width,e.outer_height,e.ccw_rotation,Math.min(e.outer_width,e.outer_height)/2),i=P2(e,e.hole_width,e.hole_height,e.ccw_rotation,Math.min(e.hole_width,e.hole_height)/2);break;case"circular_hole_with_rect_pad":case"pill_hole_with_rect_pad":case"rotated_pill_hole_with_rect_pad":r=P2(e,e.rect_pad_width,e.rect_pad_height,"rect_ccw_rotation"in e?e.rect_ccw_rotation:0,e.rect_border_radius??0),i=e.shape==="circular_hole_with_rect_pad"?$1(s,e.hole_diameter/2):P2(s,e.hole_width,e.hole_height,"hole_ccw_rotation"in e?e.hole_ccw_rotation:0,Math.min(e.hole_width,e.hole_height)/2);break;case"hole_with_polygon_pad":{let a=e.ccw_rotation??t;r=S4(e.pad_outline).rotate(a*Math.PI/180).translate(new RX(e.x,e.y)),i=e.hole_shape==="circle"?$1(s,e.hole_diameter/2):e.hole_shape==="oval"?Oxe(s,e.hole_width,e.hole_height,a,o):P2(s,e.hole_width,e.hole_height,a,Math.min(e.hole_width,e.hole_height)/2);break}}return n?Xxe(r,[i]):r}var vVe=(e,t)=>e.x===t.x&&e.y===t.y,uwt=(e,t)=>{let n=Math.hypot(e,t);return n?{x:e/n,y:t/n}:{x:1,y:0}};function cVo(e){let t=[{...e[0].start,width:e[0].startWidth},...e.map((i)=>({...i.end,width:i.endWidth}))],n=e.map((i)=>uwt(i.end.x-i.start.x,i.end.y-i.start.y)),o=[],r=[];for(let i=0;i<t.length;i++){let s=t[i];KM(s.width,"interpolated trace width");let a=n[Math.max(0,i-1)],c=n[Math.min(i,n.length-1)],l=uwt(a.x+c.x,a.y+c.y),h=-l.y*s.width/2,d=l.x*s.width/2;o.push({x:s.x+h,y:s.y+d}),r.push({x:s.x-h,y:s.y-d})}return S4([...o,...r.reverse()])}function lVo(e,t){try{return DX.subtract(e,t)}catch(n){if(!(n instanceof Error)||n.message!=="Unresolved boundary conflict in boolean operation")throw n;let o=new Cf(1000,0,0,1000,0,0),r=new Cf(0.001,0,0,0.001,0,0);return DX.subtract(e.transform(o),t.transform(o)).transform(r)}}function hVo(e,t,n){let o=new Map,r=new Map,i=[],s=(a,c)=>o.set(a,[...o.get(a)??[],c]);for(let a of e.route){if(a.route_type==="via"){let c=a,l=a.outer_diameter??c.via_diameter;if(l===void 0)continue;let h=a.hole_diameter??c.via_hole_diameter,d=$1(a,l/2),u=n&&h?$1(a,h/2):void 0;for(let _ of fse([a.from_layer,a.to_layer],t))if(s(_,u?Xxe(d,[u]):d),u)r.set(_,[...r.get(_)??[],u])}if(a.route_type==="through_pad")for(let c of new Set([a.start_layer,a.end_layer]))s(c,HVe(a.start,a.end,a.width))}for(let a=0;a<e.route.length-1;a++){let c=e.route[a],l=e.route[a+1],h=c.route_type==="through_pad"?c.end:c,d=l.route_type==="through_pad"?l.start:l;if(vVe(h,d))continue;let u=c.route_type==="wire"?[c.layer]:c.route_type==="via"?fse([c.from_layer,c.to_layer],t):[c.end_layer],_=l.route_type==="wire"?[l.layer]:l.route_type==="via"?fse([l.from_layer,l.to_layer],t):[l.start_layer],p=u.filter((g)=>_.includes(g));if(p.length!==1)throw Error(`Cannot determine one wire layer between route points ${a} and ${a+1}`);let m=p[0],A="width"in c?c.width:("width"in l)?l.width:void 0;if(A===void 0||vVe(h,d))continue;i.push({start:h,end:d,layer:m,startWidth:A,endWidth:"width"in l?l.width:A})}if(e.route_thickness_mode==="interpolated"){let a=[],c=()=>{if(a.length)s(a[0].layer,cVo(a)),a=[]};for(let l of i){let h=a.at(-1);if(h&&(h.layer!==l.layer||!vVe(h.end,l.start)||h.endWidth!==l.startWidth))c();a.push(l)}c()}else for(let a of i)s(a.layer,HVe(a.start,a.end,a.startWidth));for(let[a,c]of r)o.set(a,o.get(a).map((l)=>c.reduce((h,d)=>lVo(h,d),l)).filter((l)=>l.faces.size>0));return o}var dVo=["pcb_board","pcb_smtpad","pcb_plated_hole","pcb_hole","pcb_via","pcb_trace","pcb_copper_pour","pcb_cutout","pcb_keepout","pcb_courtyard_rect","pcb_courtyard_circle","pcb_courtyard_pill","pcb_courtyard_polygon","pcb_courtyard_outline"];function uVo(e){switch(e.shape){case"circle":return[$1(e.center,e.radius)];case"rect":return[P2(e.center,e.width,e.height,e.rotation,e.corner_radius)];case"polygon":return[S4(e.points)];case"path":{if(e.slot_length!==void 0||e.space_between_slots!==void 0||e.slot_corner_radius!==void 0)throw Error("Patterned/custom-corner path cutouts are not supported; use explicit rect/polygon cutouts");return e.route.slice(1).map((t,n)=>HVe(e.route[n],t,e.slot_width))}}}function hK(e,t={}){if(t.layer&&t.layers)throw Error("Specify layer or layers, not both");let n=t.layer?[t.layer]:t.layers,o=rVo(e,t),r={elements:[],warnings:[],bounds:void 0,copperLayers:o},i=new Map(e.filter((c)=>c.type==="pcb_component").map((c)=>[c.pcb_component_id,c.rotation])),s=t.curveTolerance??0.001;if(!Number.isFinite(s)||s<=0)throw Error("curveTolerance must be finite and positive");let a=t.includeDrillHoles!==!1;for(let c of e){if(!dVo.includes(c.type))continue;let l=c[`${c.type}_id`];if(t.elementTypes&&!t.elementTypes.includes(c.type))continue;if(t.elementIds&&!t.elementIds.includes(l))continue;let h="copper",d=[null],u=[],_;try{switch(c.type){case"pcb_smtpad":d=[c.layer],u=[iVo(c)];break;case"pcb_plated_hole":d=fse(c.layers,o),u=[aVo(c,i.get(c.pcb_component_id??"")??0,a,s)];break;case"pcb_via":{d=fse(c.layers,o);let m=$1(c,c.outer_diameter/2);u=[a?Xxe(m,[$1(c,c.hole_diameter/2)]):m];break}case"pcb_trace":_=hVo(c,o,a),d=[..._.keys()];break;case"pcb_copper_pour":d=[c.layer],u=[c.shape==="rect"?P2(c.center,c.width,c.height,c.rotation):c.shape==="polygon"?S4(c.points):Xxe(S4(c.brep_shape.outer_ring.vertices),c.brep_shape.inner_rings.map((m)=>S4(m.vertices)))];break;case"pcb_board":h="board",u=[c.outline?.length?S4(c.outline):P2(c.center,c.width,c.height)];break;case"pcb_hole":h="drill",u=[sVo(c,s)];break;case"pcb_cutout":h="cutout",u=uVo(c);break;case"pcb_keepout":h="keepout",d=c.layers,u=[c.shape==="circle"?$1(c.center,c.radius):c.shape==="rect"?P2(c.center,c.width,c.height):S4(c.outline)];break;case"pcb_courtyard_rect":h="courtyard",d=[c.layer],u=[P2(c.center,c.width,c.height,c.ccw_rotation)];break;case"pcb_courtyard_circle":h="courtyard",d=[c.layer],u=[$1(c.center,c.radius)];break;case"pcb_courtyard_pill":h="courtyard",d=[c.layer],u=[P2(c.center,c.width,c.height,0,c.radius)];break;case"pcb_courtyard_polygon":h="courtyard",d=[c.layer],u=[S4(c.points)];break;case"pcb_courtyard_outline":h="courtyard",d=[c.layer],u=[S4(c.outline)];break}if(t.roles&&!t.roles.includes(h))continue;let p=[];for(let m of new Set(d)){if(m===null?t.includeLayerless===!1:n&&!n.includes(m))continue;let A=_?.get(m)??u;if(!A.length)continue;let g=A.reduce((y,x)=>y.merge(x.box),A[0].box);if(![g.xmin,g.ymin,g.xmax,g.ymax].every(Number.isFinite))throw Error("Non-finite geometry bounds");let f={elementId:l,elementType:c.type,sourceElement:c,role:h,layer:m,shapes:A,bounds:g};p.push(f)}for(let m of p)r.elements.push(m),r.bounds=r.bounds?r.bounds.merge(m.bounds):m.bounds}catch(p){let m=p instanceof Error?p.message:String(p);if(t.strict)throw Error(`${l}: ${m}`);r.warnings.push({elementId:l,elementType:c.type,message:m})}}return r}function pVo(e,t){if(!e.box.intersect(t.box))return!1;return e.intersect(t).some((o)=>pwt(e,o)&&pwt(t,o))||[...t.faces].some((o)=>dwt(e,o.first.start))||[...e.faces].some((o)=>dwt(t,o.first.start))}function pwt(e,t){let n=p4.getTolerance();return e.edges.search(new rA(t.x-n,t.y-n,t.x+n,t.y+n)).length>0}function mVo(e,{connMap:t}={}){if(!e.some((s)=>s.type==="pcb_copper_pour"))return[];t??=oa(e);let{elements:n}=hK(e,{elementTypes:["pcb_smtpad","pcb_plated_hole","pcb_via","pcb_trace","pcb_copper_pour"],strict:!0}),o=new Map;for(let s of n){let a=o.get(s.layer)??[];for(let c of s.shapes)a.push({element:s,shape:c});o.set(s.layer,a)}let r=new Map([...o].map(([s,a])=>{let c=new I4(a.length);for(let{shape:l}of a){let h=l.box;c.add(h.xmin,h.ymin,h.xmax,h.ymax)}return c.finish(),[s,{index:c,entries:a}]})),i=new Map;for(let s of n){let a=s.sourceElement;if(a.type!=="pcb_copper_pour")continue;let c=a.source_net_id,{index:l,entries:h}=r.get(s.layer),d=new Set;for(let u of s.shapes){let _=u.box;for(let p of l.search(_.xmin,_.ymin,_.xmax,_.ymax))d.add(p)}for(let u of[...d].sort((_,p)=>_-p)){let{element:_,shape:p}=h[u];if(s.elementId===_.elementId)continue;let m=_.sourceElement.type==="pcb_copper_pour"?_.sourceElement.source_net_id:_.elementId;if(c&&m&&(c===m||t.areIdsConnected(c,m)))continue;let A=`copper_pour_short_${[s.elementId,_.elementId].sort().join("_")}`;if(i.has(A)||!s.shapes.some((g)=>pVo(g,p)))continue;i.set(A,{type:"pcb_placement_error",pcb_placement_error_id:A,error_type:"pcb_placement_error",message:`Copper pour ${Hs(e,s.elementId)} (${c?Hs(e,c):"unassigned net"}) shorts to ${Hs(e,_.elementId)} on ${s.layer} (accidental copper contact)`,subcircuit_id:a.subcircuit_id})}}return[...i.values()]}var Rxe=0.000000001;function rBt(e){let t=new Map(e.filter((l)=>l.type==="pcb_port").map((l)=>[l.pcb_port_id,l])),n=e.filter((l)=>l.type==="pcb_smtpad"||l.type==="pcb_plated_hole"),o=new Map;for(let l of n){if(!l.pcb_port_id)continue;let h=o.get(l.pcb_port_id)??[];h.push(l),o.set(l.pcb_port_id,h)}let r=e.filter((l)=>l.type==="pcb_via"),i,s=()=>{if(i)return i;i=r.map((d)=>({...d,diameter:d.outer_diameter}));let l=e.find((d)=>d.type==="pcb_board"),h=["top",...J_.filter((d)=>d.startsWith("inner")).slice(0,l?Math.max(0,l.num_layers-2):void 0),...l?.num_layers===1?[]:["bottom"]];for(let d of e){if(d.type!=="pcb_trace")continue;for(let u of d.route){if(u.route_type!=="via")continue;if(r.some((m)=>Math.hypot(m.x-u.x,m.y-u.y)<=Rxe))continue;let _=h.indexOf(u.from_layer),p=h.indexOf(u.to_layer);if(_<0||p<0)continue;i.push({...u,layers:h.slice(Math.min(_,p),Math.max(_,p)+1),diameter:u.outer_diameter})}}return i},a=(l)=>{let h=o.get(l.pcb_port_id);return h?.length?[...new Set(h.flatMap(ag))]:l.layers};return{ports:t,layersForPort:a,canConnect:(l,h)=>{let d=t.get(h);if(!d)return!0;let u=a(d);if(u.includes(l.layer))return!0;let _=o.get(h)??[];return s().some((p)=>{if(!p.layers.includes(l.layer)||!u.some((A)=>p.layers.includes(A)))return!1;if(p.diameter!==void 0&&(!Number.isFinite(p.diameter)||p.diameter<=0))return!1;let m=p.diameter===void 0?0:p.diameter/2+l.width/2;if(Math.hypot(l.x-p.x,l.y-p.y)>m+Rxe)return!1;if(_.length===0)return Math.hypot(d.x-p.x,d.y-p.y)<=Rxe;return _.some((A)=>{if(!ag(A).some((g)=>p.layers.includes(g)))return!1;if(p.diameter===void 0)return pK(p,A);return P4({type:"pcb_via",pcb_via_id:"layer-contact",x:p.x,y:p.y,outer_diameter:p.diameter,hole_diameter:0,layers:p.layers},A)<=Rxe})})}}}function iBt(e){let t=rBt(e);return e.flatMap((n)=>{if(n.type!=="pcb_trace")return[];return n.route.flatMap((o,r)=>{if(o.route_type!=="wire")return[];return[...new Set([o.start_pcb_port_id,o.end_pcb_port_id])].flatMap((i)=>{if(!i||t.canConnect(o,i))return[];let s=t.ports.get(i);return[{trace:n,point:o,index:r,port:s,padLayers:t.layersForPort(s)}]})})})}function _Vo(e){if(!e.some((p)=>p.type==="pcb_via"||p.type==="pcb_plated_hole"||p.type==="pcb_copper_pour"||p.type==="pcb_trace"&&p.route.some((m)=>m.route_type==="via")))return[];let t=[],n=[],o=1e6,r=0.0000001*o,i=XVe(r),s=(p,m,A,g=!1,f=!1)=>{if(!A.isEmpty()){let y=A.scale(o,o);t.push({id:p,layers:m,geometry:{polygon:y},box:y.box,bridges:g,platedPort:f})}},a=new Map,c=(p)=>{if("polygon"in p.geometry)return p.geometry.polygon;let m=a.get(p);if(!m){let{start:A,end:g}=p.geometry;m=nz(A,g,A.width).scale(o,o),a.set(p,m)}return m},l=e.filter((p)=>p.type==="pcb_via"),h=new Map(e.filter((p)=>p.type==="pcb_component").map((p)=>[p.pcb_component_id,p])),d=e.find((p)=>p.type==="pcb_board"),u=["top",...J_.filter((p)=>p.startsWith("inner")).slice(0,d?Math.max(0,d.num_layers-2):void 0),...d?.num_layers===1?[]:["bottom"]];for(let p of e)if(p.type==="pcb_via"){if(s(p.pcb_via_id,p.layers,DN(p,p.outer_diameter/2),!0),p.pcb_trace_id)n.push([p.pcb_via_id,p.pcb_trace_id])}else if(p.type==="pcb_plated_hole"){if(!p.pcb_port_id)continue;let m={...p,hole_offset_x:"hole_offset_x"in p?p.hole_offset_x??0:0,hole_offset_y:"hole_offset_y"in p?p.hole_offset_y??0:0};s(p.pcb_port_id,p.layers,kN(m,p.pcb_component_id?h.get(p.pcb_component_id)?.rotation:0),!0,!0)}else if(p.type==="pcb_copper_pour")s(p.pcb_copper_pour_id,[p.layer],RN(p),!0);else if(p.type==="pcb_trace"){if(p.route_thickness_mode==="interpolated")continue;for(let m=0;m<p.route.length;m++){let A=p.route[m],g=p.route[m+1];if(A.route_type==="wire"&&g?.route_type==="wire"&&A.layer===g.layer&&(A.x!==g.x||A.y!==g.y))if(A.width>0){let f=A.width/2;t.push({id:p.pcb_trace_id,layers:[A.layer],geometry:{start:A,end:g},box:{xmin:(Math.min(A.x,g.x)-f)*o,ymin:(Math.min(A.y,g.y)-f)*o,xmax:(Math.max(A.x,g.x)+f)*o,ymax:(Math.max(A.y,g.y)+f)*o},bridges:!1,platedPort:!1})}else s(p.pcb_trace_id,[A.layer],nz(A,g,A.width));else if(A.route_type==="via"){if(l.some((C)=>C.pcb_trace_id===p.pcb_trace_id&&Math.hypot(C.x-A.x,C.y-A.y)<0.000000001))continue;let f=u.indexOf(A.from_layer),y=u.indexOf(A.to_layer);if(f<0||y<0||!A.outer_diameter)continue;let x={type:"pcb_via",pcb_via_id:`${p.pcb_trace_id}_via_${m}`,x:A.x,y:A.y,outer_diameter:A.outer_diameter,hole_diameter:0,layers:u.slice(Math.min(f,y),Math.max(f,y)+1)};s(p.pcb_trace_id,x.layers,DN(x,x.outer_diameter/2),!0)}}}if(!t.length)return n;let _=new I4(t.length);for(let{box:p}of t)_.add(p.xmin,p.ymin,p.xmax,p.ymax);_.finish();for(let[p,m]of t.entries()){if(!m.bridges)continue;let A=m.box;for(let g of _.search(A.xmin-r,A.ymin-r,A.xmax+r,A.ymax+r)){let f=t[g];if(m.platedPort&&f.bridges||f.platedPort&&m.bridges||p===g||m.id===f.id||f.bridges&&g<p||!m.layers.some((y)=>f.layers.includes(y)))continue;if(i(c(m),c(f)))n.push([m.id,f.id])}}return n}function jVe(e){let t=new IX;t.circuitJson=e;for(let c of e)if(c.type==="pcb_trace")t.traceIdToElm.set(c.pcb_trace_id,c);else if(c.type==="pcb_port")t.portIdToElm.set(c.pcb_port_id,c);let n=[...t.traceIdToElm.values()],o=new Map;for(let[c,l]of n.entries())for(let h=0;h<l.route.length-1;h++){let d=l.route[h],u=l.route[h+1];if(d.route_type!=="wire"||u.route_type!=="wire"||d.layer!==u.layer)continue;let _=d.width/2+0.000000001,p=o.get(d.layer)??[];p.push({traceIndex:c,segmentTrace:{...l,route:[d,u]},minX:Math.min(d.x,u.x)-_,minY:Math.min(d.y,u.y)-_,maxX:Math.max(d.x,u.x)+_,maxY:Math.max(d.y,u.y)+_}),o.set(d.layer,p)}let r=n.map(()=>new Set);for(let c of o.values()){let l=new I4(c.length);for(let h of c)l.add(h.minX,h.minY,h.maxX,h.maxY);l.finish();for(let h of c)for(let d of l.search(h.minX,h.minY,h.maxX,h.maxY)){let u=c[d],_=u.traceIndex,p=r[h.traceIndex];if(_>h.traceIndex&&!p.has(_)&&t._arePcbTracesConnected(h.segmentTrace,u.segmentTrace))p.add(_)}}let i=[];for(let[c,l]of r.entries())for(let h of[...l].sort((d,u)=>d-u))i.push([n[c].pcb_trace_id,n[h].pcb_trace_id]);let s=rBt(e),a=new Map;for(let c of n)for(let l of c.route){if(l.route_type!=="wire")continue;for(let h of new Set([l.start_pcb_port_id,l.end_pcb_port_id])){if(!h||!t.portIdToElm.has(h))continue;if(!s.canConnect(l,h))continue;let d=a.get(h)??[];d.push(l.start_pcb_port_id===h?[h,c.pcb_trace_id]:[c.pcb_trace_id,h]),a.set(h,d)}}for(let c of t.portIdToElm.keys())for(let l of a.get(c)??[])i.push(l);return i.push(..._Vo(e)),t.connMap=new fx(fM(i)),t}function mwt(e,t,n,o){return Math.sqrt((n-e)**2+(o-t)**2)}var KVe=(e)=>{let t=e.filter((i)=>i.type==="pcb_port"),n=e.filter((i)=>i.type==="pcb_smtpad"),o=e.filter((i)=>i.type==="pcb_trace");function r(i,s={}){let a=s.traceWidth||0,c=t.find((l)=>l.layers.includes(i.layer)&&mwt(l.x,l.y,i.x,i.y)<0.01);if(c)return c.pcb_port_id;if(s.isFirstOrLastPoint){let l=n.find((h)=>{if(h.layer!==i.layer)return!1;if(h.shape==="rect")return Math.abs(i.x-h.x)<h.width/2+a/2&&Math.abs(i.y-h.y)<h.height/2+a/2;else if(h.shape==="circle")return mwt(i.x,i.y,h.x,h.y)<h.radius;else if(h.shape==="pill"||h.shape==="rotated_pill")return pK(i,h)});if(l)return l.pcb_port_id??null}return null}for(let i of o)for(let s=0;s<i.route.length;s++){let a=i.route[s],c=s===0||s===i.route.length-1;if(a.route_type==="wire"){if(!a.start_pcb_port_id&&s===0){let l=r(a,{isFirstOrLastPoint:c,traceWidth:a.width});if(l)a.start_pcb_port_id=l}if(!a.end_pcb_port_id&&s===i.route.length-1){let l=r(a,{isFirstOrLastPoint:c,traceWidth:a.width});if(l)a.end_pcb_port_id=l}}}};function sBt(e,t){let r=XVe(0.09999999999999999),i=[],s=new Set,a=(g)=>t.getNetConnectedToId(g),c=(g)=>{if(!g.polygon.isEmpty())i.push({...g,polygon:g.polygon.scale(1e6,1e6)})};for(let g of e){if(g.type!=="pcb_copper_pour"||!g.source_net_id)continue;let f=a(g.source_net_id);if(!f)continue;s.add(f),c({polygon:RN(g),layers:[g.layer],netId:f,isPour:!0})}let l=new Map(e.filter((g)=>g.type==="pcb_component").map((g)=>[g.pcb_component_id,g]));if(s.size>0)for(let g of e){if(g.type==="pcb_trace"){let y=a(g.pcb_trace_id);if(!y||!s.has(y)||g.route_thickness_mode==="interpolated")continue;for(let x=0;x<g.route.length-1;x++){let C=g.route[x],b=g.route[x+1];if(C.route_type!=="wire"||b.route_type!=="wire"||C.layer!==b.layer)continue;c({polygon:nz(C,b,C.width),layers:[C.layer],netId:y})}continue}if(g.type!=="pcb_smtpad"&&g.type!=="pcb_plated_hole"&&g.type!=="pcb_via")continue;let f=a(La(g));if(!f||!s.has(f))continue;if(g.type==="pcb_smtpad")c({polygon:zX(g),layers:[g.layer],netId:f,portIds:g.pcb_port_id?[g.pcb_port_id]:[]});else if(g.type==="pcb_plated_hole")c({polygon:kN(g,g.pcb_component_id?l.get(g.pcb_component_id)?.rotation:0),layers:g.layers,netId:f,portIds:g.pcb_port_id?[g.pcb_port_id]:[]});else c({polygon:QN(g,g.outer_diameter,g.hole_diameter),layers:g.layers,netId:f,portIds:g.pcb_port_ids})}let h=i.map((g,f)=>f),d=(g)=>{while(h[g]!==g)h[g]=h[h[g]],g=h[g];return g},u=i.map((g)=>g.polygon.box),_=i.map((g,f)=>f).sort((g,f)=>u[g].xmin-u[f].xmin);for(let g=0;g<_.length;g++){let f=_[g];for(let y=g+1;y<_.length;y++){let x=_[y];if(u[x].xmin>u[f].xmax+0.09999999999999999)break;if(d(f)===d(x)||i[f].netId!==i[x].netId)continue;if(u[x].ymin>u[f].ymax+0.09999999999999999||u[x].ymax<u[f].ymin-0.09999999999999999)continue;if(!i[f].layers.some((C)=>i[x].layers.includes(C)))continue;if(r(i[f].polygon,i[x].polygon))h[d(x)]=d(f)}}let p=new Set(i.flatMap((g,f)=>g.isPour?[d(f)]:[])),m=new Map;for(let[g,f]of i.entries()){if(!p.has(d(g)))continue;for(let y of f.portIds??[]){let x=m.get(y)??new Set;x.add(d(g)),m.set(y,x)}}let A=new Map;for(let g of e){if(g.type!=="pcb_port")continue;let f=a(g.pcb_port_id);if(!f||!s.has(f))continue;let y=A.get(f)??[];y.push(g.pcb_port_id),A.set(f,y)}return{isPortConnectedToNet(g,f){let y=m.get(g);return f.every((x)=>[...y??[]].some((C)=>i[C].netId===a(x)&&(A.get(i[C].netId)??[]).every((b)=>m.get(b)?.has(C))))},arePortsConnected(g){if(g.length<2)return!1;return[...m.get(g[0])??[]].some((f)=>g.every((y)=>m.get(y)?.has(f)))}}}function gVo(e,{connMap:t,pcbConnectivityMap:n}={}){KVe(e);let o=e.filter((u)=>u.type==="source_trace"),r=e.filter((u)=>u.type==="pcb_port"),i=e.filter((u)=>u.type==="source_net"),s=iBt(e).map(({trace:u,point:_,index:p,port:m,padLayers:A})=>({type:"pcb_port_not_connected_error",error_type:"pcb_port_not_connected_error",pcb_port_not_connected_error_id:`missing_layer_connection_${u.pcb_trace_id}_${p}_${m.pcb_port_id}`,pcb_port_ids:[m.pcb_port_id],pcb_component_ids:m.pcb_component_id?[m.pcb_component_id]:[],center:{x:_.x,y:_.y},message:`Port [${C7(e,m.pcb_port_id)}] on ${A.join(", ")} is not connected to trace [${jM(e,u.pcb_trace_id)}] on ${_.layer}: missing via connection.`})),a=t??oa(e);n??=jVe(e);let c,l=()=>c??=sBt(e,a),h=new Map;for(let u of r)h.set(u.source_port_id,u);let d=new Map(i.map((u)=>[u.source_net_id,u.name]));for(let u of o){let _=u.connected_source_port_ids;if(_.length===1&&u.connected_source_net_ids.length>0){let x=h.get(_[0]);if(!x)continue;if(n.getAllTracesConnectedToPort(x.pcb_port_id).length===0&&!l().isPortConnectedToNet(x.pcb_port_id,u.connected_source_net_ids)){let b=u.connected_source_net_ids.map((v)=>d.get(v)).filter((v)=>Boolean(v)),I=b.length>0?`net [${b.join(", ")}]`:"its connected net";s.push({type:"pcb_port_not_connected_error",message:`Port [${C7(e,x.pcb_port_id)}] is not connected to ${I} by a PCB trace.`,error_type:"pcb_port_not_connected_error",pcb_port_ids:[x.pcb_port_id],pcb_component_ids:x.pcb_component_id?[x.pcb_component_id]:[],pcb_port_not_connected_error_id:`pcb_port_not_connected_error_trace_${u.source_trace_id}`})}continue}if(_.length<2)continue;let p=[],m=[];for(let x of _){let C=h.get(x);if(C)p.push(C);else m.push(x)}if(p.length<2)continue;let A=p[0],g=a.getNetConnectedToId(A.pcb_port_id);if(a.getIdsConnectedToNet(g).filter((x)=>e.some((C)=>C.type==="pcb_trace"&&(("pcb_trace_id"in C)&&C.pcb_trace_id===x||("route_id"in C)&&C.route_id===x))).length===0&&!l().arePortsConnected(p.map((x)=>x.pcb_port_id))){if(new Set(p.map((C)=>C.pcb_component_id)).size>1)s.push({type:"pcb_port_not_connected_error",message:`Ports [${p.map((C)=>C7(e,C.pcb_port_id)).join(", ")}] are not connected together through the same net.`,error_type:"pcb_port_not_connected_error",pcb_port_ids:p.map((C)=>C.pcb_port_id),pcb_component_ids:p.map((C)=>C.pcb_component_id).filter((C)=>C!==void 0),pcb_port_not_connected_error_id:`pcb_port_not_connected_error_trace_${u.source_trace_id}`})}}return s}var aBt=(e)=>hK(e.filter((t)=>t.type==="pcb_hole"),{elementTypes:["pcb_hole"],strict:!0,curveTolerance:0.000001}).elements,cBt=(e,t)=>{let n=t.sourceElement;if(n.type!=="pcb_hole")throw Error("Expected hole geometry");let o=new Ks(e.x1,e.y1),r=new Ks(e.x2,e.y2),i=1/0,s=W1(n,o,r);if(n.hole_shape==="circle")i=ia(n,o,r)-n.hole_diameter/2;else{let a=new eg(o,r);for(let c of t.shapes){let[l,h]=c.distanceTo(a),d=c.contains(o)||c.contains(r)?0:l;if(d<i)i=d,s=h.end}}return{gap:i-e.thickness/2,center:s}},mK=class{buckets;objectsById;getBounds;getId;CELL_SIZE=0.4;constructor({objects:e,getBounds:t,getId:n,CELL_SIZE:o}){this.buckets=new Map,this.objectsById=new Map,this.getBounds=t,this.getId=n??(()=>this._getNextId()),this.CELL_SIZE=o??this.CELL_SIZE;for(let r of e)this.addObject(r)}_idCounter=0;_getNextId(){return`${this._idCounter++}`}addObject(e){let t=this.getBounds(e),n=this.getId(e),o={...e,spatialIndexId:n};this.objectsById.set(n,o);let r=Math.floor(t.minX/this.CELL_SIZE),i=Math.floor(t.minY/this.CELL_SIZE),s=Math.floor(t.maxX/this.CELL_SIZE),a=Math.floor(t.maxY/this.CELL_SIZE);for(let c=r;c<=s;c++)for(let l=i;l<=a;l++){let h=`${c}x${l}`,d=this.buckets.get(h);if(!d)this.buckets.set(h,[o]);else d.push(o)}}removeObject(e){let t=this.objectsById.get(e);if(!t)return!1;this.objectsById.delete(e);let n=this.getBounds(t),o=Math.floor(n.minX/this.CELL_SIZE),r=Math.floor(n.minY/this.CELL_SIZE),i=Math.floor(n.maxX/this.CELL_SIZE),s=Math.floor(n.maxY/this.CELL_SIZE);for(let a=o;a<=i;a++)for(let c=r;c<=s;c++){let l=`${a}x${c}`,h=this.buckets.get(l);if(h){let d=h.findIndex((u)=>u.spatialIndexId===e);if(d!==-1){if(h.splice(d,1),h.length===0)this.buckets.delete(l)}}}return!0}getBucketKey(e,t){return`${Math.floor(e/this.CELL_SIZE)}x${Math.floor(t/this.CELL_SIZE)}`}getObjectsInBounds(e,t=0){let n=[],o=new Set,r=Math.floor((e.minX-t)/this.CELL_SIZE),i=Math.floor((e.minY-t)/this.CELL_SIZE),s=Math.floor((e.maxX+t)/this.CELL_SIZE),a=Math.floor((e.maxY+t)/this.CELL_SIZE);for(let c=r;c<=s;c++)for(let l=i;l<=a;l++){let h=`${c}x${l}`,d=this.buckets.get(h)||[];for(let u of d){let _=u.spatialIndexId;if(o.has(_))continue;o.add(_),n.push(u)}}return n}},_wt=(e,t)=>{let n={x:e.x1,y:e.y1},o={x:e.x2,y:e.y2},{minX:r,minY:i,maxX:s,maxY:a}=t;if(n.x===o.x&&n.y===o.y){let v=Math.max(r,Math.min(s,n.x)),P=Math.max(i,Math.min(a,n.y));if(v===n.x&&P===n.y)return{x:n.x,y:n.y};return{x:v,y:P}}let c=o.x-n.x,l=o.y-n.y,h=c!==0?(r-n.x)/c:Number.NEGATIVE_INFINITY,d=c!==0?(s-n.x)/c:Number.POSITIVE_INFINITY,u=l!==0?(i-n.y)/l:Number.NEGATIVE_INFINITY,_=l!==0?(a-n.y)/l:Number.POSITIVE_INFINITY,p=Math.max(Math.min(h,d),Math.min(u,_)),m=Math.min(Math.max(h,d),Math.max(u,_));if(p<=m&&m>=0&&p<=1){let v=Math.max(0,Math.min(1,p));return{x:n.x+v*c,y:n.y+v*l}}let A={x:Math.max(r,Math.min(s,n.x)),y:Math.max(i,Math.min(a,n.y))},g={x:Math.max(r,Math.min(s,o.x)),y:Math.max(i,Math.min(a,o.y))},f=(A.x-n.x)**2+(A.y-n.y)**2,y=(g.x-o.x)**2+(g.y-o.y)**2,x=[{start:{x:r,y:i},end:{x:s,y:i}},{start:{x:s,y:i},end:{x:s,y:a}},{start:{x:s,y:a},end:{x:r,y:a}},{start:{x:r,y:a},end:{x:r,y:i}}],C=Math.min(f,y),b=f<=y?A:g,I=(v,P,M)=>Math.max(P,Math.min(M,v));for(let v of x){let P={x:o.x-n.x,y:o.y-n.y},M={x:v.end.x-v.start.x,y:v.end.y-v.start.y},B={x:n.x-v.start.x,y:n.y-v.start.y},T=P.x*P.x+P.y*P.y,N=P.x*M.x+P.y*M.y,D=P.x*B.x+P.y*B.y,L=M.x*M.x+M.y*M.y,H=M.x*B.x+M.y*B.y,V=T*L-N*N;if(Math.abs(V)<0.0000000001)continue;let O=(N*H-L*D)/V,U=(T*H-N*D)/V;O=I(O,0,1),U=I(U,0,1);let j={x:n.x+O*P.x,y:n.y+O*P.y},Y={x:v.start.x+U*M.x,y:v.start.y+U*M.y},X=j.x-Y.x,K=j.y-Y.y,J=X*X+K*K;if(J<C)C=J,b={x:(j.x+Y.x)/2,y:(j.y+Y.y)/2}}return b},rK=(e)=>{if(e.type==="pcb_hole"&&(e.hole_shape==="pill"||e.hole_shape==="rotated_pill")||e.type==="pcb_smtpad"&&e.shape==="rotated_pill"){let t=WM(e);return{minX:Math.min(t.start.x,t.end.x)-t.radius,minY:Math.min(t.start.y,t.end.y)-t.radius,maxX:Math.max(t.start.x,t.end.x)+t.radius,maxY:Math.max(t.start.y,t.end.y)+t.radius}}if(e.type==="pcb_trace_segment")return{minX:Math.min(e.x1,e.x2),minY:Math.min(e.y1,e.y2),maxX:Math.max(e.x1,e.x2),maxY:Math.max(e.y1,e.y2)};if(e.type==="pcb_smtpad"||e.type==="pcb_plated_hole"){if(e.type==="pcb_smtpad"&&(e.shape==="rotated_rect"||e.shape==="polygon")||e.type==="pcb_plated_hole"&&"rect_pad_width"in e&&"rect_pad_height"in e){let n=Ise(e);return{minX:Math.min(...n.map((o)=>o.x)),minY:Math.min(...n.map((o)=>o.y)),maxX:Math.max(...n.map((o)=>o.x)),maxY:Math.max(...n.map((o)=>o.y))}}}return V1([e])},AVo=(e)=>{if(e.type==="pcb_port")return e.pcb_port_id;if(e.type==="pcb_smtpad")return e.pcb_smtpad_id;return e.pcb_plated_hole_id};function fVo(e,{connMap:t,minClearance:n}={}){let o=oVo(e);KVe(e),t??=oa(e);let r=XI(e);n??=WI(r,"min_trace_to_pad_edge_clearance")??ROo;let s=As(e).pcb_trace.list().flatMap((C)=>{let b=[];for(let I=0;I<C.route.length-1;I++){let v=C.route[I],P=C.route[I+1];if(v.route_type!=="wire"&&v.route_type!=="via"||P.route_type!=="wire"&&P.route_type!=="via")continue;let M=v.route_type==="wire"?v:P;if(M.route_type!=="wire")continue;if(v.route_type==="wire"&&P.route_type==="wire"&&v.layer!==P.layer)continue;b.push({type:"pcb_trace_segment",pcb_trace_id:C.pcb_trace_id,_pcbTrace:C,thickness:Math.max(v.route_type==="wire"?v.width??NVe:0,P.route_type==="wire"?P.width??NVe:0),layer:M.layer,x1:v.x,y1:v.y,x2:P.x,y2:P.y})}return b}),a=As(e).pcb_smtpad.list(),c=As(e).pcb_plated_hole.list(),l=As(e).pcb_port.list(),h=As(e).pcb_hole.list(),d=new Map(aBt(e).map((C)=>[C.elementId,C])),u=As(e).pcb_via.list(),_=As(e).pcb_keepout.list().filter((C)=>!C.allow_traces),p=[...l,...a,...c],m=new Map;for(let C of _){let b=new Set(C.excluded_pcb_component_ids??[]);if(b.size===0)continue;m.set(C.pcb_keepout_id,p.filter((I)=>I.pcb_component_id&&b.has(I.pcb_component_id)).map(AVo))}let A=[...s,...a,...c,...h,...u,..._],g=new mK({objects:A,getBounds:rK}),f=(C)=>Hs(e,C),y=(C,b,I)=>{if(cK(I))return`PCB trace ${C} overlaps with ${b} (accidental contact)`;return`PCB trace ${C} is too close to ${b} (gap: ${I.toFixed(3)}mm)`},x=new Set;for(let C of s){let b=n,I=rK(C),v=g.getObjectsInBounds(I,b+C.thickness/2);if(C.x1===C.x2&&C.y1===C.y2)continue;for(let P of v){if(!ag(P).includes(C.layer))continue;if(P.type==="pcb_keepout"&&(m.get(P.pcb_keepout_id)??[]).some((T)=>t.areIdsConnected(C.pcb_trace_id,T)))continue;if(P.type==="pcb_trace_segment"){let T=P;if(C.layer!==T.layer)continue;if(t.areIdsConnected(C.pcb_trace_id,T.pcb_trace_id))continue;let N=Ix({x:C.x1,y:C.y1},{x:C.x2,y:C.y2},{x:T.x1,y:T.y1},{x:T.x2,y:T.y2})-C.thickness/2-T.thickness/2;if(N>n-E4)continue;let D=`overlap_${C.pcb_trace_id}_${T.pcb_trace_id}`,L=`overlap_${T.pcb_trace_id}_${C.pcb_trace_id}`;if(x.has(D))continue;if(x.has(L))continue;x.add(D),o.push({type:"pcb_trace_error",error_type:"pcb_trace_error",message:y(f(C.pcb_trace_id),f(T.pcb_trace_id),N),pcb_trace_id:C.pcb_trace_id,source_trace_id:"",pcb_trace_error_id:D,pcb_component_ids:[],center:kVe(C,T),pcb_port_ids:_se([C._pcbTrace,T._pcbTrace])});continue}let M=La(P);if(t.areIdsConnected(C.pcb_trace_id,"pcb_trace_id"in P?P.pcb_trace_id:M))continue;if(P.type==="pcb_smtpad"||P.type==="pcb_plated_hole"||P.type==="pcb_via"){let{gap:T,center:N}=Ese(C,P);if(!cK(T))continue;let D=`overlap_${C.pcb_trace_id}_${M}`;if(x.has(D))continue;x.add(D),o.push({type:"pcb_trace_error",error_type:"pcb_trace_error",message:y(f(C.pcb_trace_id),`${P.type} "${f(M)}"`,T),pcb_trace_id:C.pcb_trace_id,center:N,source_trace_id:"",pcb_trace_error_id:D,pcb_component_ids:["pcb_component_id"in P?P.pcb_component_id:void 0].filter(Boolean),pcb_port_ids:[..._se([C._pcbTrace]),"pcb_port_id"in P?P.pcb_port_id:void 0].filter(Boolean)});continue}if(P.type==="pcb_hole"){let{gap:T,center:N}=cBt(C,d.get(P.pcb_hole_id));if(!cK(T))continue;let D=`overlap_${C.pcb_trace_id}_${M}`;if(x.has(D))continue;x.add(D),o.push({type:"pcb_trace_error",error_type:"pcb_trace_error",message:y(f(C.pcb_trace_id),`${P.type} "${f(M)}"`,T),pcb_trace_id:C.pcb_trace_id,source_trace_id:C._pcbTrace.source_trace_id??"",pcb_trace_error_id:D,pcb_component_ids:P.pcb_component_id?[P.pcb_component_id]:[],pcb_port_ids:_se([C._pcbTrace]),center:N});continue}let B=XOe({x:C.x1,y:C.y1},{x:C.x2,y:C.y2},rK(P))-C.thickness/2;if(B+E4<b){let T=`overlap_${C.pcb_trace_id}_${M}`;if(x.has(T))continue;if(x.add(T),P.type==="pcb_keepout"&&P.warning_only){o.push({type:"pcb_keepout_overlap_warning",warning_type:"pcb_keepout_overlap_warning",pcb_keepout_overlap_warning_id:`pcb_keepout_overlap_warning_${T}`,pcb_keepout_id:P.pcb_keepout_id,pcb_trace_ids:[C.pcb_trace_id],message:`PCB trace ${f(C.pcb_trace_id)} violates advisory PCB keepout "${Hs(e,P.pcb_keepout_id)}"`,center:_wt(C,rK(P)),subcircuit_id:C._pcbTrace.subcircuit_id??P.subcircuit_id});continue}o.push({type:"pcb_trace_error",error_type:"pcb_trace_error",message:y(f(C.pcb_trace_id),`${P.type} "${f(La(P))}"`,B),pcb_trace_id:C.pcb_trace_id,source_trace_id:"",pcb_trace_error_id:T,pcb_component_ids:["pcb_component_id"in P?P.pcb_component_id:void 0].filter(Boolean),center:_wt(C,rK(P)),pcb_port_ids:[..._se([C._pcbTrace]),"pcb_port_id"in P?P.pcb_port_id:void 0].filter(Boolean)})}}}return o}var yVo=0.000000001,xVo=(e)=>{if(e.type==="pcb_via")return"Via";if(e.type==="pcb_smtpad")return"SMT pad";if(e.type==="pcb_plated_hole")return"Plated hole";return"Copper pour"};function CVo(e){let t=XI(e);if(!t)return[];if(!e.some((c)=>c.type==="pcb_via"||c.type==="pcb_smtpad"||c.type==="pcb_plated_hole"||c.type==="pcb_copper_pour"))return[];let n=hK([t],{strict:!0}).elements[0]?.shapes[0];if(!n)return[];let o=WI(t,"min_board_edge_clearance")??E2.min_board_edge_clearance;if(o===void 0)return[];let r=new Set(e.filter((c)=>c.type==="pcb_component").filter((c)=>c.is_allowed_to_be_off_board).map((c)=>c.pcb_component_id)),{elements:i}=hK(e,{elementTypes:["pcb_via","pcb_smtpad","pcb_plated_hole","pcb_copper_pour"],includeDrillHoles:!1,strict:!0}),s=[],a=new Set;for(let c of i){if(a.has(c.elementId))continue;a.add(c.elementId);let l=c.sourceElement;if((l.type==="pcb_smtpad"||l.type==="pcb_plated_hole")&&l.pcb_component_id&&r.has(l.pcb_component_id))continue;let h=c.shapes.every((p)=>n.contains(p)),d=h?Math.min(...c.shapes.map((p)=>n.distanceTo(p)[0])):0;if(h&&d+yVo>=o)continue;let u=c.elementId,_=xVo(l);s.push({type:"pcb_placement_error",pcb_placement_error_id:`copper_too_close_to_board_edge_${u}`,error_type:"pcb_placement_error",message:`${_} ${Hs(e,u)} violates copper-to-board-edge clearance (measured ${d.toFixed(3)}mm, required ${o.toFixed(3)}mm)`})}return s}function lBt(e){return e.area()>=0}function hBt({center:e,size:t,rotationDeg:n=0}){let{x:o,y:r}=e,i=t.width/2,s=t.height/2,a=[new Ks(o-i,r-s),new Ks(o+i,r-s),new Ks(o+i,r+s),new Ks(o-i,r+s)],c=new tl(a);if(n){let l=qxe.rotateDEG(n,o,r),h=a.map((d)=>{let u=qxe.applyToPoint(l,{x:d.x,y:d.y});return new Ks(u.x,u.y)});c=new tl(h)}if(!lBt(c))c.reverse();return c}function bVo({board:e}){if(e.outline&&e.outline.length>0){let t=e.outline.map((o)=>new Ks(o.x,o.y)),n=new tl(t);if(!lBt(n))n.reverse();return n}if(e.center&&typeof e.width==="number"&&typeof e.height==="number")return hBt({center:e.center,size:{width:e.width,height:e.height},rotationDeg:0});return null}function IVo({circuitJson:e,component:t}){if(t.source_component_id){let n=e.find((o)=>o.type==="source_component"&&o.source_component_id===t.source_component_id);if(n&&"name"in n&&n.name)return n.name}return Yz(e,t.pcb_component_id)}function vVo(e,t){let n=[...e.edges],o=n[0]?.shape;if(n.length===1&&o instanceof Ap&&p4.EQ(o.sweep,2*Math.PI)){let[i]=t.distanceTo(o.pc);return t.contains(o.pc)?o.r-i:o.r+i}let r=0;for(let i of n){let s=i.shape instanceof Ap?Math.ceil(i.shape.sweep/(Math.PI/32)):2;for(let a=0;a<=s;a++){let c=i.pointAtLength(i.length*a/s);if(!t.contains(c))r=Math.max(r,t.distanceTo(c)[0])}}return r||0.1}function SVo({componentBox:e,boardPoly:t}){let n=t.box,o=0,r=0;if(e.xmin<n.xmin)o=n.xmin-e.xmin;else if(e.xmax>n.xmax)o=n.xmax-e.xmax;if(e.ymin<n.ymin)r=n.ymin-e.ymin;else if(e.ymax>n.ymax)r=n.ymax-e.ymax;if(o===0&&r===0)return null;let i=o>=0?"right":"left",s=r>=0?"up":"down",a=Math.abs(Math.round(o*100)/100),c=Math.abs(Math.round(r*100)/100);if(a>0&&c>0)return`Try moving it ${a}mm ${i} and ${c}mm ${s} to fit within the board edge.`;if(a>0)return`Try moving it ${a}mm ${i} to fit within the board edge.`;return`Try moving it ${c}mm ${s} to fit within the board edge.`}function PVo(e){let t=e.find((s)=>s.type==="pcb_board");if(!t)return[];let n=bVo({board:t});if(!n)return[];let o=e.filter((s)=>s.type==="pcb_component");if(o.length===0)return[];let r=hK(e,{elementTypes:["pcb_smtpad","pcb_plated_hole","pcb_hole","pcb_courtyard_circle","pcb_courtyard_rect","pcb_courtyard_pill","pcb_courtyard_polygon","pcb_courtyard_outline"],includeDrillHoles:!1,strict:!0}).elements,i=[];for(let s of o){if(s.is_allowed_to_be_off_board)continue;if(!s.center||typeof s.width!=="number"||typeof s.height!=="number")continue;if(s.width<=0||s.height<=0)continue;let a=hBt({center:s.center,size:{width:s.width,height:s.height},rotationDeg:0}),c=r.filter(({sourceElement:g})=>("pcb_component_id"in g)&&g.pcb_component_id===s.pcb_component_id),l=c.filter(({role:g})=>g!=="courtyard").reduce((g,f)=>g?g.merge(f.bounds):f.bounds,void 0),h=c.flatMap(({shapes:g})=>g);if(!l||!p4.EQ(l.xmin,a.box.xmin)||!p4.EQ(l.xmax,a.box.xmax)||!p4.EQ(l.ymin,a.box.ymin)||!p4.EQ(l.ymax,a.box.ymax))h.push(a);let d=h.filter((g)=>g.area()>0&&!n.contains(g));if(d.length===0)continue;let u=h.reduce((g,f)=>g.merge(f.box),h[0].box),_=Math.max(...d.map((g)=>vVo(g,n))),p=IVo({circuitJson:e,component:s}),m=Math.round(_*100)/100,A=SVo({componentBox:u,boardPoly:n});i.push({type:"pcb_component_outside_board_error",error_type:"pcb_component_outside_board_error",pcb_component_outside_board_error_id:`pcb_component_outside_board_${s.pcb_component_id}`,message:`Component ${p} extends outside board boundaries by ${m}mm.${A?` ${A}`:""}`,pcb_component_id:s.pcb_component_id,pcb_board_id:t.pcb_board_id,component_center:s.center,component_bounds:{min_x:u.xmin,max_x:u.xmax,min_y:u.ymin,max_y:u.ymax},subcircuit_id:s.subcircuit_id,source_component_id:s.source_component_id})}return i}var gwt=32;function dBt({center:e,width:t,height:n,rotation:o=0}){let r=t/2,i=n/2,s=[{x:e.x-r,y:e.y-i},{x:e.x+r,y:e.y-i},{x:e.x+r,y:e.y+i},{x:e.x-r,y:e.y+i}],a=Jxe.rotateDEG(o,e.x,e.y);return new tl(s.map((c)=>{let l=o?Jxe.applyToPoint(a,c):c;return new Ks(l.x,l.y)}))}function EVo({center:e,radius:t}){return new tl(Array.from({length:gwt},(n,o)=>{let r=2*Math.PI*o/gwt;return new Ks(e.x+Math.cos(r)*t,e.y+Math.sin(r)*t)}))}function MVo(e){if(e.shape==="rect")return dBt({center:e.center,width:e.width,height:e.height,rotation:e.rotation??0});if(e.shape==="circle")return EVo({center:e.center,radius:e.radius});if(e.shape==="polygon")return new tl(e.points.map((t)=>new Ks(t.x,t.y)));return null}function Awt(e){return{minX:e.box.xmin,minY:e.box.ymin,maxX:e.box.xmax,maxY:e.box.ymax}}function wVo(e,t){if(!yp(Awt(e),Awt(t)))return!1;if(e.contains(t)||t.contains(e))return!0;try{let n=DX.intersect(e,t);if(Array.isArray(n))return n.some((o)=>o.area()>0);return n.area()>0}catch{return!1}}function BVo(e){let t=e.filter((i)=>i.type==="pcb_cutout"),n=e.filter((i)=>i.type==="pcb_component");if(t.length===0||n.length===0)return[];let o=t.map((i)=>({cutout:i,polygon:MVo(i)})).filter((i)=>i.polygon!==null&&i.polygon.area()>0),r=[];for(let i of n){if(i.do_not_place)continue;if(!i.center||i.width<=0||i.height<=0)continue;let s=dBt({center:i.center,width:i.width,height:i.height});for(let{cutout:a,polygon:c}of o){if(a.pcb_component_id===i.pcb_component_id)continue;if(!wVo(s,c))continue;let l=Yz(e,i.pcb_component_id),h=a.pcb_cutout_id;r.push({type:"pcb_placement_error",pcb_placement_error_id:`component_over_cutout_${i.pcb_component_id}_${h}`,error_type:"pcb_placement_error",message:`Component ${l} overlaps with cutout [${Hs(e,h)}]`,subcircuit_id:i.subcircuit_id})}}return r}var TVo=(e)=>{switch(e.type){case"pcb_courtyard_circle":return e.pcb_courtyard_circle_id;case"pcb_courtyard_outline":return e.pcb_courtyard_outline_id;case"pcb_courtyard_polygon":return e.pcb_courtyard_polygon_id;case"pcb_courtyard_rect":return e.pcb_courtyard_rect_id}},FVe=(e)=>{let t={type:"pcb_keepout",pcb_keepout_id:TVo(e),layers:[e.layer]};if(e.type==="pcb_courtyard_circle")return{...t,shape:"circle",center:e.center,radius:e.radius};let n=e.type==="pcb_courtyard_rect"?Wxe({x:e.center.x,y:e.center.y,width:e.width,height:e.height,ccwRotation:e.ccw_rotation??0}):e.type==="pcb_courtyard_polygon"?e.points:e.outline;return{...t,shape:"outline",outline:n,stroke_width:0}};function DVo(e){let t=e.filter((i)=>i.type==="pcb_keepout"&&!i.allow_placements),n=new Map(e.flatMap((i)=>i.type==="pcb_component"?[[i.pcb_component_id,i]]:[])),o=e.filter((i)=>i.type==="pcb_courtyard_rect"||i.type==="pcb_courtyard_circle"||i.type==="pcb_courtyard_outline"||i.type==="pcb_courtyard_polygon"),r=new Map;for(let i of o){let s=i.pcb_component_id,a=n.get(s);if(a?.do_not_place)continue;let c=FVe(i);for(let l of t){if(!l.layers.includes(i.layer))continue;if(l.excluded_pcb_component_ids?.includes(s))continue;let h=`courtyard_over_keepout_${s}_${l.pcb_keepout_id}`;if(r.has(h))continue;if(P4(c,l)>E4)continue;let d=Hs(e,s),u=Hs(e,l.pcb_keepout_id),_=a?.subcircuit_id??l.subcircuit_id;if(l.warning_only)r.set(h,{type:"pcb_keepout_overlap_warning",warning_type:"pcb_keepout_overlap_warning",pcb_keepout_overlap_warning_id:`pcb_keepout_overlap_warning_${h}`,pcb_keepout_id:l.pcb_keepout_id,pcb_component_ids:[s],message:`Courtyard of ${d} overlaps advisory PCB keepout "${u}"`,subcircuit_id:_});else r.set(h,{type:"pcb_placement_error",error_type:"pcb_placement_error",pcb_placement_error_id:h,message:`Courtyard of ${d} overlaps PCB keepout "${u}"`,subcircuit_id:_})}}return[...r.values()]}var NVo=(e)=>("pcb_component_id"in e)&&e.pcb_component_id?e.pcb_component_id:La(e),fwt=(e,t)=>{if("pcb_component_id"in t&&t.pcb_component_id){let n=e.find((i)=>i.type==="pcb_component"&&i.pcb_component_id===t.pcb_component_id),o=n?.type==="pcb_component"?e.find((i)=>i.type==="source_component"&&i.source_component_id===n.source_component_id):void 0;return`component ${o?.type==="source_component"&&o.name?o.name:Yz(e,t.pcb_component_id)}`}return t.type==="pcb_via"?`via ${Hs(e,t.pcb_via_id)}`:Hs(e,La(t))};function RVo(e){let t=As(e).pcb_keepout.list();if(t.length===0)return[];let n=[..._R(e),...As(e).pcb_via.list()],o=new Map;for(let r of t){let i=new Set(r.excluded_pcb_component_ids??[]);for(let s of n){if(r.allow_placements&&s.type!=="pcb_via")continue;let a="pcb_component_id"in s?s.pcb_component_id:void 0;if(a&&i.has(a))continue;if(!ag(s).some((d)=>r.layers.includes(d)))continue;if(P4(s,r)>E4)continue;let h=`copper_over_keepout_${NVo(s)}_${r.pcb_keepout_id}`;if(r.warning_only){let d=s.type==="pcb_smtpad"?"pcb_smtpad_ids":s.type==="pcb_plated_hole"?"pcb_plated_hole_ids":"pcb_via_ids",u=o.get(h);if(u?.type==="pcb_keepout_overlap_warning")u[d]=Array.from(new Set([...u[d]??[],La(s)]));else o.set(h,{type:"pcb_keepout_overlap_warning",warning_type:"pcb_keepout_overlap_warning",pcb_keepout_overlap_warning_id:`pcb_keepout_overlap_warning_${h}`,pcb_keepout_id:r.pcb_keepout_id,message:`Copper for ${fwt(e,s)} overlaps advisory PCB keepout "${Hs(e,r.pcb_keepout_id)}"`,...a?{pcb_component_ids:[a]}:{},[d]:[La(s)],subcircuit_id:s.subcircuit_id??r.subcircuit_id});continue}if(o.has(h))continue;o.set(h,{type:"pcb_placement_error",pcb_placement_error_id:h,error_type:"pcb_placement_error",message:`Copper for ${fwt(e,s)} overlaps ${r.description?`PCB keepout "${r.description}"`:"a PCB keepout"}`,subcircuit_id:s.subcircuit_id??r.subcircuit_id})}}return[...o.values()]}var j1=0.000000001;function uBt(e){let t=new Map(e.flatMap((r)=>r.type==="pcb_board"&&r.subcircuit_id?[[r.subcircuit_id,r.pcb_board_id]]:[])),n=new Map(e.flatMap((r)=>r.type==="source_group"&&r.is_subcircuit&&r.subcircuit_id?[[r.subcircuit_id,r.parent_subcircuit_id]]:[])),o=new Map(e.flatMap((r)=>r.type==="pcb_component"?[[r.pcb_component_id,r]]:[]));return(r)=>{if("pcb_board_id"in r&&r.pcb_board_id)return r.pcb_board_id;if("positioned_relative_to_pcb_board_id"in r&&r.positioned_relative_to_pcb_board_id)return r.positioned_relative_to_pcb_board_id;let i="pcb_component_id"in r&&r.pcb_component_id?o.get(r.pcb_component_id):void 0;if(i?.positioned_relative_to_pcb_board_id)return i.positioned_relative_to_pcb_board_id;let s=("subcircuit_id"in r?r.subcircuit_id:void 0)??i?.subcircuit_id,a=new Set;while(s&&!a.has(s)){let c=t.get(s);if(c)return c;a.add(s),s=n.get(s)}}}function pBt(e){let t=new Map(e.filter((n)=>n.type==="pcb_board").map((n)=>[n.pcb_board_id,n]));return e.flatMap((n)=>{if(n.type!=="pcb_bend")return[];let o=t.get(n.pcb_board_id);if(!o)return[];let r=n.end.x-n.start.x,i=n.end.y-n.start.y,s=Math.hypot(r,i),a=n.bend_radius*Math.abs(n.bend_angle*Math.PI/180);if(!Number.isFinite(s)||!Number.isFinite(a)||s<=j1||a<=j1)return[];let c={x:r/s,y:i/s},l={x:-c.y*a/2,y:c.x*a/2},h={x:o.center.x+n.start.x,y:o.center.y+n.start.y},d={x:o.center.x+n.end.x,y:o.center.y+n.end.y},u=[{x:h.x+l.x,y:h.y+l.y},{x:d.x+l.x,y:d.y+l.y},{x:d.x-l.x,y:d.y-l.y},{x:h.x-l.x,y:h.y-l.y}],_={type:"pcb_keepout",pcb_keepout_id:n.pcb_bend_id,shape:"outline",outline:u,stroke_width:0,layers:["top","bottom"]};return[{bend:n,board:o,tangent:c,keepout:_}]})}function QVo(e,t){return(e.shape==="polygon"?e.outline:Wxe({x:e.center.x,y:e.center.y,width:e.width,height:e.height,ccwRotation:e.rotation??0})).map((o)=>({x:o.x+t.center.x,y:o.y+t.center.y}))}function kVo(e){let t=pBt(e);if(t.length===0)return[];let n=uBt(e),o=[..._R(e),...e.filter((a)=>a.type==="pcb_via")].map((a)=>({element:a,boardId:n(a)}));for(let a of e){if(a.type!=="pcb_trace")continue;let c=n(a);for(let[l,h]of a.route.entries()){if(h.route_type!=="via")continue;let d=h.outer_diameter??h.hole_diameter??0;if(o.some(({element:p,boardId:m})=>p.type==="pcb_via"&&!(c&&m&&c!==m)&&Math.hypot(p.x-h.x,p.y-h.y)<=j1&&p.layers.includes(h.from_layer)&&p.layers.includes(h.to_layer)&&(h.outer_diameter===void 0||Math.abs(p.outer_diameter-d)<=j1)&&(h.hole_diameter===void 0||Math.abs(p.hole_diameter-h.hole_diameter)<=j1)))continue;let _={type:"pcb_via",pcb_via_id:`${a.pcb_trace_id}_route_via_${l}`,pcb_trace_id:a.pcb_trace_id,x:h.x,y:h.y,outer_diameter:d,hole_diameter:h.hole_diameter??0,layers:[h.from_layer,h.to_layer],subcircuit_id:a.subcircuit_id};o.push({element:_,boardId:c})}}let r=e.filter((a)=>a.type==="pcb_stiffener"),i=[],s=(a,c,l)=>{i.push({type:"pcb_placement_error",pcb_placement_error_id:`bend_zone_${c.pcb_bend_id}_${a}`,error_type:"pcb_placement_error",message:`${Hs(e,a)} overlaps PCB bend zone ${Hs(e,c.pcb_bend_id)}`,subcircuit_id:l??c.subcircuit_id})};for(let{bend:a,board:c,keepout:l}of t){for(let{element:h,boardId:d}of o){if(d&&d!==c.pcb_board_id)continue;if(P4(h,l)<=j1)s(La(h),a,h.subcircuit_id)}for(let h of r){if(h.pcb_board_id!==c.pcb_board_id)continue;let d=QVo(h,c);if(d.length<3)continue;if(P4({...l,outline:d,pcb_keepout_id:h.pcb_stiffener_id},l)<=j1)s(h.pcb_stiffener_id,a,h.subcircuit_id)}}return i}function LVo(e){let t=pBt(e);if(t.length===0)return[];let n=uBt(e),o=[];for(let r of e){if(r.type!=="pcb_trace")continue;let i=n(r);for(let{bend:s,tangent:a,keepout:c}of t){if(i&&i!==s.pcb_board_id)continue;let l;for(let h=1;h<r.route.length;h++){let d=r.route[h-1],u=r.route[h],_=d.route_type==="wire"?d:u.route_type==="wire"?u:void 0;if(!_)continue;let p=d.route_type==="through_pad"?d.end_layer===_.layer?d.end:d.start_layer===_.layer?d.start:void 0:d.route_type==="wire"?d.layer===_.layer?d:void 0:d.to_layer===_.layer?d:void 0,m=u.route_type==="through_pad"?u.start_layer===_.layer?u.start:u.end_layer===_.layer?u.end:void 0:u.route_type==="wire"?u.layer===_.layer?u:void 0:u.from_layer===_.layer?u:void 0;if(!p||!m)continue;let A=m.x-p.x,g=m.y-p.y,f=Math.hypot(A,g);if(f<=j1)continue;if(Math.abs(A*a.x+g*a.y)/f<=j1)continue;let x=Math.max(_.width,_.start_width??0,_.end_width??0)/2,C=vse(p,m,c.outline);if(C.distance>x+j1)continue;l={center:C.center,reason:"Non-perpendicular trace copper"};break}for(let h=1;!l&&h<r.route.length-1;h++){let d=r.route[h];if(d.route_type!=="wire")continue;let u=h-1,_=h+1;while(u>=0){let I=r.route[u];if(I.route_type!=="wire"||I.layer!==d.layer||Math.hypot(I.x-d.x,I.y-d.y)>j1)break;u--}while(_<r.route.length){let I=r.route[_];if(I.route_type!=="wire"||I.layer!==d.layer||Math.hypot(I.x-d.x,I.y-d.y)>j1)break;_++}let p=r.route[u],m=r.route[_];if(p?.route_type!=="wire"||m?.route_type!=="wire"||p.layer!==d.layer||m.layer!==d.layer)continue;let A={x:d.x-p.x,y:d.y-p.y},g={x:m.x-d.x,y:m.y-d.y},f=Math.hypot(A.x,A.y)*Math.hypot(g.x,g.y);if(f<=j1)continue;let y=(A.x*g.x+A.y*g.y)/f,x=(A.x*g.y-A.y*g.x)/f;if(y>0&&Math.abs(x)<=j1)continue;let C=Math.max(p.width,p.end_width??0,d.width,d.start_width??0)/2;if(vse(d,d,c.outline).distance>C+j1)continue;l={center:d,reason:"Trace corner"}}if(!l)continue;o.push({type:"pcb_trace_error",pcb_trace_error_id:`bend_zone_${s.pcb_bend_id}_${r.pcb_trace_id}`,error_type:"pcb_trace_error",message:`${l.reason} for ${jM(e,r.pcb_trace_id)} overlaps PCB bend zone ${Hs(e,s.pcb_bend_id)}`,center:l.center,pcb_trace_id:r.pcb_trace_id,source_trace_id:r.source_trace_id??"",pcb_component_ids:r.pcb_component_id?[r.pcb_component_id]:[],pcb_port_ids:[],subcircuit_id:r.subcircuit_id??s.subcircuit_id})}}return o}function Sse(e,t){return Math.hypot(e.x-t.x,e.y-t.y)}function HVo(e,t){return Sse(e,t)<=E4}function FVo(e,{connMap:t,minClearance:n}={}){let o=e.filter((a)=>a.type==="pcb_via");if(o.length<2)return[];let r=XI(e);n??=WI(r,"min_via_hole_edge_to_via_hole_edge_clearance")??E2.min_via_hole_edge_to_via_hole_edge_clearance,t??=oa(e);let i=[],s=new Set;for(let a=0;a<o.length;a++)for(let c=a+1;c<o.length;c++){let l=o[a],h=o[c];if(HVo(l,h))continue;if(!t.areIdsConnected(l.pcb_via_id,h.pcb_via_id))continue;let d=Sse(l,h)-l.hole_diameter/2-h.hole_diameter/2;if(d+E4>=n)continue;let u=[l.pcb_via_id,h.pcb_via_id].sort().join("_");if(s.has(u))continue;s.add(u),i.push({type:"pcb_via_clearance_error",pcb_error_id:`same_net_vias_close_${u}`,message:`Vias ${Hs(e,l.pcb_via_id)} and ${Hs(e,h.pcb_via_id)} are too close together (gap: ${d.toFixed(3)}mm)`,error_type:"pcb_via_clearance_error",pcb_via_ids:[l.pcb_via_id,h.pcb_via_id],minimum_clearance:n,actual_clearance:d,pcb_center:{x:(l.x+h.x)/2,y:(l.y+h.y)/2}})}return i}function zVo(e,{connMap:t,minClearance:n}={}){let o=e.filter((c)=>c.type==="pcb_via");if(o.length<2)return[];let r=XI(e);n??=WI(r,"min_via_hole_edge_to_via_hole_edge_clearance")??E2.min_via_hole_edge_to_via_hole_edge_clearance;let i=WI(r,"min_pad_edge_to_pad_edge_clearance")??E2.min_pad_edge_to_pad_edge_clearance;t??=oa(e);let s=[],a=new Set;for(let c=0;c<o.length;c++)for(let l=c+1;l<o.length;l++){let h=o[c],d=o[l];if(t.areIdsConnected(h.pcb_via_id,d.pcb_via_id))continue;let u=Sse(h,d),_=u-h.hole_diameter/2-d.hole_diameter/2,p=n;if(_+E4>=p){if(!h.layers.some((A)=>d.layers.includes(A)))continue;if(_=u-h.outer_diameter/2-d.outer_diameter/2,p=i,_>=0&&_+E4>=p)continue}let m=[h.pcb_via_id,d.pcb_via_id].sort().join("_");if(a.has(m))continue;a.add(m),s.push({type:"pcb_via_clearance_error",pcb_error_id:`different_net_vias_close_${m}`,message:`Vias ${Hs(e,h.pcb_via_id)} and ${Hs(e,d.pcb_via_id)} from different nets are too close together (gap: ${_.toFixed(3)}mm)`,error_type:"pcb_via_clearance_error",pcb_via_ids:[h.pcb_via_id,d.pcb_via_id],minimum_clearance:p,actual_clearance:_,pcb_center:{x:(h.x+d.x)/2,y:(h.y+d.y)/2}})}return s}function OVo(e,t,n){let o=new Map,r=new Map;for(let i of[!1,!0]){let s=e.route[i?e.route.length-1:0];if(s?.route_type!=="wire")continue;let a=i?s.end_pcb_port_id:s.start_pcb_port_id;if(!a)continue;let c=t.filter((m)=>(m.type==="pcb_smtpad"||m.type==="pcb_plated_hole")&&m.pcb_port_id===a);if(!c.length)continue;let l=hK(t,{elementIds:c.map((m)=>m.type==="pcb_smtpad"?m.pcb_smtpad_id:m.pcb_plated_hole_id),layers:[s.layer],roles:["copper"],includeDrillHoles:!1});if(l.warnings.length)continue;let h=l.elements.flatMap((m)=>m.shapes),d=(m)=>h.some((A)=>A.contains(m));if(!d(new Ks(s.x,s.y)))continue;let u=!0,_=n,p=i?r:o;for(let m=i?e.route.length-2:0;m>=0&&m<e.route.length-1;m+=i?-1:1){let A=e.route[i?m+1:m],g=e.route[i?m:m+1];if(A.route_type!=="wire"||g.route_type!=="wire"||A.layer!==s.layer||g.layer!==s.layer)break;let f=new Ks(A.x,A.y),y=new Ks(g.x,g.y),x=new eg(f,y),C=x.length;if(C===0)continue;let b=0;if(u){let v=[0,C,...h.flatMap((P)=>P.intersect(x).map((M)=>f.distanceTo(M)[0]))].sort((P,M)=>P-M);for(let P=0;P<v.length-1;P++){if(v[P+1]-v[P]<0.000000001)continue;let M=(v[P]+v[P+1])/(2*C);if(!d(new Ks(A.x+(g.x-A.x)*M,A.y+(g.y-A.y)*M))){u=!1;break}b=v[P+1]}}let I=Math.min(C-b,_);if(b+=I,_-=I,p.set(m,b),b<C)break}}return{fromStart:o,fromEnd:r}}function VVo(e,{maxPadNeckdownLength:t}={}){if(t!==void 0&&(!Number.isFinite(t)||t<0))throw Error("maxPadNeckdownLength must be finite and nonnegative");let n=[],o=As(e),r=o.source_trace.list(),i=o.pcb_trace.list(),s=o.pcb_port.list(),a=oa(e);for(let c of r){let l=c.min_trace_thickness;if(l===void 0)continue;let h=s.filter((m)=>c.connected_source_port_ids?.includes(m.source_port_id));if(h.length<2)continue;let d=a.getNetConnectedToId(h[0].pcb_port_id);if(!d)continue;let u=a.getIdsConnectedToNet(d),_=i.filter((m)=>u.includes(m.pcb_trace_id));if(_.length===0)continue;let p;for(let m of _){let A=OVo(m,e,t??l);for(let g=0;g<m.route.length-1;g++){let f=m.route[g],y=m.route[g+1];if(f.route_type!=="wire"||y.route_type!=="wire")continue;if(f.layer!==y.layer)continue;if(f.x===y.x&&f.y===y.y)continue;let x=m.route_thickness_mode==="interpolated";if(Math.min(f.width,x?y.width:f.width)>=l)continue;let C=0,b=1;if(x&&f.width!==y.width){let M=(l-f.width)/(y.width-f.width);if(f.width>=l)C=M;if(y.width>=l)b=M}let I=Math.hypot(y.x-f.x,y.y-f.y);if(C=Math.max(C,(A.fromStart.get(g)??0)/I),b=Math.min(b,1-(A.fromEnd.get(g)??0)/I),b-C<0.000000001)continue;let v=x?Math.min(f.width+(y.width-f.width)*C,f.width+(y.width-f.width)*b):f.width;if(p&&v>=p.width)continue;let P=(C+b)/2;p={pcb_trace_id:m.pcb_trace_id,center:{x:f.x+(y.x-f.x)*P,y:f.y+(y.y-f.y)*P},width:v}}}if(!p)continue;n.push({type:"pcb_trace_warning",pcb_trace_warning_id:`pcb_trace_warning_${c.source_trace_id}`,warning_type:"pcb_trace_warning",message:`Trace [${WVe(e,c)}] is routed thinner than requested (requested: ${l}mm, actual: ${p.width}mm).`,center:p.center,source_trace_id:c.source_trace_id,pcb_trace_id:p.pcb_trace_id,pcb_component_ids:Array.from(new Set(h.map((m)=>m.pcb_component_id).filter((m)=>m!==void 0))),pcb_port_ids:h.map((m)=>m.pcb_port_id)})}return n}function YVo(e,{connMap:t}={}){let n=[],o=e.filter((h)=>h.type==="source_trace"),r=e.filter((h)=>h.type==="pcb_trace"),i=e.filter((h)=>h.type==="pcb_port"),s=new Map(i.map((h)=>[h.source_port_id,h])),a=t??oa(e),c,l=()=>c??=sBt(e,a);for(let h of o){if(!h.connected_source_port_ids?.length)continue;if((h.connected_source_net_ids?.length??0)>0)continue;if(h.connected_source_port_ids.length<2)continue;if(!r.some((u)=>a.areIdsConnected(h.source_trace_id,u.pcb_trace_id))){let u=h.connected_source_port_ids.map((p)=>s.get(p)).filter((p)=>p!==void 0);if(u.length===h.connected_source_port_ids.length&&l().arePortsConnected(u.map((p)=>p.pcb_port_id)))continue;let _=Array.from(new Set(u.map((p)=>p.pcb_component_id).filter((p)=>p!==void 0)));n.push({type:"pcb_trace_missing_error",pcb_trace_missing_error_id:`pcb_trace_missing_${h.source_trace_id}`,error_type:"pcb_trace_missing_error",message:`Trace [${WVe(e,h)}] is not connected (it has no PCB trace)`,source_trace_id:h.source_trace_id,pcb_component_ids:_,pcb_port_ids:u.map((p)=>p.pcb_port_id)})}}return n}var gse=0.000000001;function GVo(e,t){let n=new Map,o=_R(e),r=e.filter((d)=>d.type==="pcb_trace"),i=e.filter((d)=>d.type==="pcb_via"),a=e.find((d)=>d.type==="pcb_board")?.num_layers,l=["top",...J_.filter((d)=>d.startsWith("inner")).slice(0,a===void 0?void 0:Math.max(0,a-2)),...a===1?[]:["bottom"]],h=(d,u,_)=>{if(![_.x,_.y].every(Number.isFinite))return;let p=t.getNetConnectedToId(d);if(!p)return;let m=o.some((y)=>{if(t.getNetConnectedToId(La(y))!==p||!ag(y).some((C)=>u.includes(C)))return!1;if(_.radius===void 0)return pK(_,y);let x={type:"pcb_via",pcb_via_id:d,x:_.x,y:_.y,outer_diameter:_.radius*2,hole_diameter:0,layers:u};return P4(x,y)<=gse}),A=new Set;for(let y of r){if(y.route_thickness_mode==="interpolated"||t.getNetConnectedToId(y.pcb_trace_id)!==p)continue;for(let x=1;x<y.route.length;x++){let C=y.route[x-1],b=y.route[x];if(C.route_type!=="wire"||b.route_type!=="wire"||C.layer!==b.layer||!u.includes(C.layer)||!Number.isFinite(C.width)||C.width<=0||Math.hypot(C.x-b.x,C.y-b.y)<=gse)continue;let I=_.radius===void 0?0:_.radius+C.width/2;if(ia(_,C,b)<=I+gse){A.add(y.pcb_trace_id);break}}}let g={..._,touchesPad:m,touchingTraceIds:A},f=n.get(p)??new Map;for(let y of u){let x=f.get(y)??[];x.push(g),f.set(y,x)}n.set(p,f)};for(let d of i){if(!Number.isFinite(d.outer_diameter)||d.outer_diameter<=0)continue;h(d.pcb_via_id,ag(d),{x:d.x,y:d.y,ownerTraceId:d.pcb_trace_id,radius:d.outer_diameter/2})}for(let d of e){if(d.type!=="pcb_trace")continue;for(let u of d.route){if(u.route_type!=="via")continue;if(i.some((A)=>Math.hypot(A.x-u.x,A.y-u.y)<=gse&&(A.pcb_trace_id===d.pcb_trace_id||!A.pcb_trace_id&&t.areIdsConnected(A.pcb_via_id,d.pcb_trace_id))))continue;let _=l.indexOf(u.from_layer),p=l.indexOf(u.to_layer);if(_<0||p<0)continue;let m=u.outer_diameter;if(m!==void 0&&(!Number.isFinite(m)||m<=0))continue;h(d.pcb_trace_id,l.slice(Math.min(_,p),Math.max(_,p)+1),{x:u.x,y:u.y,ownerTraceId:d.pcb_trace_id,radius:m===void 0?void 0:m/2})}}return n}function ywt({point:e,width:t,ownerTrace:n,index:o,connectivity:r}){if(e.route_type!=="wire"||!Number.isFinite(t)||t<=0)return!1;let i=r.getNetConnectedToId(n.pcb_trace_id);if(!i)return!1;return(o.get(i)?.get(e.layer)??[]).some((s)=>{if(s.ownerTraceId===n.pcb_trace_id)return!1;if(!s.touchesPad&&![...s.touchingTraceIds].some((c)=>c!==n.pcb_trace_id))return!1;let a=s.radius===void 0?0:s.radius+t/2;return Math.hypot(e.x-s.x,e.y-s.y)<=a+gse})}var eK=0.01;function UVo(e){let t=e.find((i)=>i.type==="pcb_board"),o=["top",...J_.filter((i)=>i.startsWith("inner")).slice(0,t?Math.max(0,t.num_layers-2):void 0),...t?.num_layers===1?[]:["bottom"]],r=new Map;for(let i of e){if(i.type!=="pcb_via"||!i.pcb_trace_id)continue;let s=r.get(i.pcb_trace_id);if(s)s.push(i);else r.set(i.pcb_trace_id,[i])}return{stack:o,ownedViasByTrace:r}}function WVo({via:e,incoming:t,outgoing:n,traceId:o,context:{stack:r,ownedViasByTrace:i}}){let s=r.indexOf(e.from_layer),a=r.indexOf(e.to_layer);if(s<0||a<0)return!1;let c=i.get(o)?.filter((u)=>Math.abs(u.x-e.x)<eK&&Math.abs(u.y-e.y)<eK)??[],l=c.length>0?c.map((u)=>u.layers):[r.slice(Math.min(s,a),Math.max(s,a)+1)],h=Math.abs(t.x-e.x)<eK&&Math.abs(t.y-e.y)<eK,d=Math.abs(n.x-e.x)<eK&&Math.abs(n.y-e.y)<eK;return r.includes(t.layer)&&r.includes(n.layer)&&l.some((u)=>u.includes(t.layer)&&u.includes(n.layer))&&(h||t.layer===e.from_layer)&&(d||n.layer===e.to_layer)}var mBt=0.000000001,_Bt=0.000000001;function iK(e,t){return e.route_type==="wire"&&ag(t).includes(e.layer)&&pK(e,t)}function XVo(e,t){let n=new Map;for(let o of e){if(o.route_thickness_mode==="interpolated")continue;let r=t.getNetConnectedToId(o.pcb_trace_id);if(!r)continue;for(let i=0;i<o.route.length-1;i++){let s=o.route[i],a=o.route[i+1];if(s.route_type!=="wire"||a.route_type!=="wire")continue;if(s.layer!==a.layer)continue;if(Math.hypot(s.x-a.x,s.y-a.y)<=_Bt)continue;let c=n.get(r)??new Map,l=c.get(s.layer)??[];l.push({trace:o,start:s,end:a}),c.set(s.layer,l),n.set(r,c)}}return n}function xwt(e,t){if(e.route_thickness_mode==="interpolated")return;let n=t==="start"?0:e.route.length-2,o=t==="start"?1:-1;while(n>=0&&n<e.route.length-1){let r=e.route[n],i=e.route[n+1];if(r?.route_type!=="wire"||i?.route_type!=="wire"||r.layer!==i.layer)return;if(Math.hypot(r.x-i.x,r.y-i.y)>_Bt)return r.width;n+=o}return}function Cwt({point:e,endpointTraceCopperWidth:t,ownerTrace:n,traceWireSegmentsByNetAndLayer:o,fullConnectivityMap:r}){if(e.route_type!=="wire")return!1;let i=r.getNetConnectedToId(n.pcb_trace_id);if(!i)return!1;let s=o.get(i)?.get(e.layer)??[];for(let a of s){if(a.trace.pcb_trace_id===n.pcb_trace_id)continue;let c=t/2+a.start.width/2+mBt;if(ia(e,a.start,a.end)<=c)return!0}return!1}function bwt(e){if(e.route_type==="through_pad")return{x:(e.start.x+e.end.x)/2,y:(e.start.y+e.end.y)/2};return{x:e.x,y:e.y}}function Iwt(e,t,n,o){return t.some((r)=>{if(!r.pcb_port_id||r.pcb_port_id===n)return!1;return o.get(r.pcb_port_id)?.some((s)=>iK(e,s))??!1})}function jVo({firstPoint:e,lastPoint:t,port:n,expectedPorts:o,padMap:r}){let i,s=e.route_type==="wire"?e:void 0,a=t.route_type==="wire"?t:void 0,c=LVe(e).includes(n.pcb_port_id),l=LVe(t).includes(n.pcb_port_id);if(c&&s)i=s;else if(l&&a)i=a;else if(Iwt(e,o,n.pcb_port_id,r)&&a)i=a;else if(Iwt(t,o,n.pcb_port_id,r)&&s)i=s;else if(s&&a)i=Sse(s,n)<=Sse(a,n)?s:a;else if(s)i=s;else if(a)i=a;let h=bwt(e),d=bwt(t);return i?{x:i.x,y:i.y}:{x:(h.x+d.x)/2,y:(h.y+d.y)/2}}function KVo(e,{connMap:t,pcbConnectivityMap:n}={}){let o=UVo(e),r=iBt(e).map(({trace:b,point:I,index:v,port:P,padLayers:M})=>({type:"pcb_trace_error",error_type:"pcb_trace_error",pcb_trace_error_id:`missing_layer_connection_${b.pcb_trace_id}_${v}_${P.pcb_port_id}`,pcb_trace_id:b.pcb_trace_id,source_trace_id:b.source_trace_id??`!${b.pcb_trace_id}`,pcb_port_ids:[P.pcb_port_id],pcb_component_ids:P.pcb_component_id?[P.pcb_component_id]:[],center:{x:I.x,y:I.y},message:`Trace [${jM(e,b.pcb_trace_id)}] on ${I.layer} is missing a via connection to port [${C7(e,P.pcb_port_id)}] on ${M.join(", ")}.`})),i=e.filter((b)=>b.type==="pcb_port"),s=e.filter((b)=>b.type==="pcb_trace"),a=e.filter((b)=>b.type==="source_trace"),c=e.filter((b)=>b.type==="pcb_smtpad"),l=e.filter((b)=>b.type==="pcb_plated_hole"),h=new Map,d=t,u,_=()=>(d??=oa(e),d),p=()=>(u??=XVo(s,_()),u),m,A=()=>(m??=GVo(e,_()),m),g=new Set;for(let b of c)if(b.pcb_port_id)h.set(b.pcb_port_id,[...h.get(b.pcb_port_id)??[],b]);for(let b of l)if(b.pcb_port_id)h.set(b.pcb_port_id,[...h.get(b.pcb_port_id)??[],b]);let f=new Map,y=new Map;for(let b of s){let I=new Set,v=b.route[0],P=b.route.at(-1);for(let M of[v,P]){if(!M)continue;for(let[B,T]of h)if(T.some((N)=>iK(M,N)))I.add(B)}f.set(b.pcb_trace_id,I);for(let M of I){let B=y.get(M)??new Set;B.add(b.pcb_trace_id),y.set(M,B)}}let x=new Map,C=(b)=>{let I=x.get(b.pcb_trace_id);if(I)return I;n??=jVe(e);let v=new Set,P=[b.pcb_trace_id];while(P.length>0){let B=P.pop();if(v.has(B))continue;v.add(B);for(let T of n.getAllTracesConnectedToTrace(B))if(!v.has(T.pcb_trace_id))P.push(T.pcb_trace_id);for(let T of f.get(B)??[])for(let N of y.get(T)??[])if(!v.has(N))P.push(N)}let M=s.filter((B)=>v.has(B.pcb_trace_id));for(let B of M)x.set(B.pcb_trace_id,M);return M};for(let b of s){if(b.route.length===0)continue;let I=b.route[0],v=b.route[b.route.length-1],P=a.find((T)=>T.source_trace_id===b.source_trace_id),M=P?i.filter((T)=>P.connected_source_port_ids?.includes(T.source_port_id)):[];for(let T=1;T<b.route.length-1;T++){let N=b.route[T-1],D=b.route[T],L=b.route[T+1];if(D.route_type==="via"){let H=N.route_type==="wire",V=L.route_type==="wire";if(H&&V){if(!WVo({via:D,incoming:N,outgoing:L,traceId:b.pcb_trace_id,context:o})){let O=jM(e,b.pcb_trace_id);r.push({type:"pcb_trace_error",message:`Via in trace [${O}] does not connect its adjacent wire layers at position {x: ${D.x}, y: ${D.y}}.`,source_trace_id:P?.source_trace_id||b.source_trace_id||`!${b.pcb_trace_id}`,error_type:"pcb_trace_error",pcb_trace_id:b.pcb_trace_id,pcb_trace_error_id:`misaligned_via_${b.pcb_trace_id}_${T}`,pcb_component_ids:[],pcb_port_ids:[]})}}}}let B=jM(e,b.pcb_trace_id);if(P&&M.length>0){if(g.has(P.source_trace_id))continue;g.add(P.source_trace_id)}for(let T of M){if(!T.pcb_port_id)continue;let N=h.get(T.pcb_port_id);if(!N?.length)continue;let D=N.some((V)=>iK(I,V)),L=N.some((V)=>iK(v,V));if(D||L)continue;if(C(b).some((V)=>f.get(V.pcb_trace_id)?.has(T.pcb_port_id)))continue;if(!D&&!L){let V=C7(e,T.pcb_port_id),O=N[0].type==="pcb_smtpad"?"SMD pad":"through-hole pad",U=jVo({firstPoint:I,lastPoint:v,port:T,expectedPorts:M,padMap:h});r.push({type:"pcb_trace_error",message:`Trace [${B}] is missing a connection to ${O} ${V}`,source_trace_id:P?.source_trace_id||b.source_trace_id||`!${b.pcb_trace_id}`,error_type:"pcb_trace_error",pcb_trace_id:b.pcb_trace_id,pcb_trace_error_id:`missing_connection_${b.pcb_trace_id}_${T.pcb_port_id}`,center:U,pcb_component_ids:[],pcb_port_ids:[T.pcb_port_id]})}}if(M.length===0){let T=!1,N=!1;for(let Y of h.values()){if(Y.some((X)=>iK(I,X)))T=!0;if(Y.some((X)=>iK(v,X)))N=!0}let D=!T?xwt(b,"start"):void 0,L=!N?xwt(b,"end"):void 0,H=D!==void 0&&Cwt({point:I,endpointTraceCopperWidth:D,ownerTrace:b,traceWireSegmentsByNetAndLayer:p(),fullConnectivityMap:_()}),V=L!==void 0&&Cwt({point:v,endpointTraceCopperWidth:L,ownerTrace:b,traceWireSegmentsByNetAndLayer:p(),fullConnectivityMap:_()}),O=T||H||D!==void 0&&ywt({point:I,width:D,ownerTrace:b,index:A(),connectivity:_()}),U=N||V||L!==void 0&&ywt({point:v,width:L,ownerTrace:b,index:A(),connectivity:_()}),j=I.route_type==="wire"&&v.route_type==="wire"&&I.layer===v.layer&&Math.hypot(I.x-v.x,I.y-v.y)<=mBt;if(!O&&I.route_type==="wire")r.push({type:"pcb_trace_error",message:`Trace [${B}] has disconnected endpoint at (${I.x.toFixed(2)}, ${I.y.toFixed(2)})`,source_trace_id:P?.source_trace_id||b.source_trace_id||`!${b.pcb_trace_id}`,error_type:"pcb_trace_error",pcb_trace_id:b.pcb_trace_id,pcb_trace_error_id:`disconnected_endpoint_${b.pcb_trace_id}_start`,center:{x:I.x,y:I.y},pcb_component_ids:[],pcb_port_ids:[]});if(!U&&v.route_type==="wire"&&!(j&&!O))r.push({type:"pcb_trace_error",message:`Trace [${B}] has disconnected endpoint at (${v.x.toFixed(2)}, ${v.y.toFixed(2)})`,source_trace_id:P?.source_trace_id||b.source_trace_id||`!${b.pcb_trace_id}`,error_type:"pcb_trace_error",pcb_trace_id:b.pcb_trace_id,pcb_trace_error_id:`disconnected_endpoint_${b.pcb_trace_id}_end`,center:{x:v.x,y:v.y},pcb_component_ids:[],pcb_port_ids:[]})}}return r}function $Vo(e){if(e.outline&&e.outline.length>0)return e.outline.map((t)=>({x:t.x,y:t.y}));if(e.center&&typeof e.width==="number"&&typeof e.height==="number"){let t=e.center.x,n=e.center.y,o=e.width/2,r=e.height/2;return[{x:t-o,y:n-r},{x:t+o,y:n-r},{x:t+o,y:n+r},{x:t-o,y:n+r}]}return null}function qVo(e,t={}){let n=[],o=XI(e);if(!o)return n;let r=t.margin??WI(o,"min_board_edge_clearance")??E2.min_board_edge_clearance,i=$Vo(o);if(!i)return n;let s=As(e).pcb_trace.list();for(let a of s){if(a.route.length<2)continue;for(let c=0;c<a.route.length-1;c++){let l=a.route[c],h=a.route[c+1];if(l.route_type!=="wire"||h.route_type!=="wire")continue;let d="width"in l?l.width:("width"in h)?h.width:0.1,u={x:l.x,y:l.y},_={x:h.x,y:h.y},p=Number.POSITIVE_INFINITY;for(let A=0;A<i.length;A++){let g=i[A],f=i[(A+1)%i.length],y=Ix(u,_,g,f);if(y<p)p=y}let m=d/2+r;if(p<m){let A={type:"pcb_trace_error",error_type:"pcb_trace_error",pcb_trace_error_id:`trace_too_close_to_board_${a.pcb_trace_id}_segment_${c}`,message:`Trace too close to board edge (${p.toFixed(3)}mm < ${m.toFixed(3)}mm required, margin: ${r}mm)`,pcb_trace_id:a.pcb_trace_id,source_trace_id:a.source_trace_id||"",center:{x:(u.x+_.x)/2,y:(u.y+_.y)/2},pcb_component_ids:[],pcb_port_ids:[]};n.push(A)}}}return n}var zVe=(e)=>e.type==="pcb_courtyard_circle"||e.type==="pcb_courtyard_outline"||e.type==="pcb_courtyard_polygon"||e.type==="pcb_courtyard_rect";function vwt(e){if(zVe(e))return[e.layer];return ag(e)}function JVo(e,t){if(e.length===0||t.length===0)return!0;return e.some((n)=>t.includes(n))}function ZVo(e,t){let n=vwt(e),o=vwt(t);if(!JVo(n,o))return!1;if(e.type==="pcb_smtpad"&&t.type==="pcb_smtpad")return P4(e,t)<=0;if(e.type==="pcb_plated_hole"&&zVe(t))return P4(e,FVe(t))<=0;if(zVe(e)&&t.type==="pcb_plated_hole")return P4(t,FVe(e))<=0;let r=V1([e]),i=V1([t]);return yp(r,i)}var pse=(e)=>e.type==="pcb_courtyard_circle"||e.type==="pcb_courtyard_outline"||e.type==="pcb_courtyard_polygon"||e.type==="pcb_courtyard_rect",Swt=(e)=>e.type==="pcb_hole"||e.type==="pcb_plated_hole",Pwt=(e,t)=>{if("pcb_port_id"in t&&t.pcb_port_id)return C7(e,t.pcb_port_id);let n=La(t);return Hs(e,n)};function eYo(e){let t=[],n=new Set(e.flatMap((h)=>h.type==="pcb_component"&&h.do_not_place?[h.pcb_component_id]:[])),o=oa(e),r=As(e).pcb_smtpad.list(),i=As(e).pcb_plated_hole.list(),s=As(e).pcb_hole.list(),a=e.filter(pse),c=new Map;for(let h of r){let d=h.pcb_component_id||`standalone_pad_${La(h)}`;if(!c.has(d))c.set(d,{component_id:d,elements:[]});c.get(d).elements.push(h)}for(let h of i){let d=h.pcb_component_id||`standalone_plated_hole_${La(h)}`;if(!c.has(d))c.set(d,{component_id:d,elements:[]});c.get(d).elements.push(h)}for(let h of s){let d=h.pcb_component_id||`standalone_hole_${La(h)}`;if(!c.has(d))c.set(d,{component_id:d,elements:[h]})}for(let h of a){let d=h.pcb_component_id;if(!c.has(d))c.set(d,{component_id:d,elements:[]});c.get(d).elements.push(h)}for(let[h,d]of c)if(d.elements.length>0)d.bounds=V1(d.elements);let l=Array.from(c.values());for(let h=0;h<l.length;h++)for(let d=h+1;d<l.length;d++){let u=l[h],_=l[d],p=n.has(u.component_id)||n.has(_.component_id);if(!u.bounds||!_.bounds)continue;if(!yp(u.bounds,_.bounds))continue;for(let m of u.elements)for(let A of _.elements){let g=La(m),f=La(A);if(p&&(pse(m)||pse(A)))continue;if((pse(m)||pse(A))&&!Swt(m)&&!Swt(A))continue;if(m.type==="pcb_smtpad"&&A.type==="pcb_smtpad"&&o.areIdsConnected(g,f))continue;if(ZVo(m,A)){let y=Pwt(e,m),x=Pwt(e,A),C={type:"pcb_footprint_overlap_error",pcb_error_id:`pcb_footprint_overlap_${g}_${f}`,error_type:"pcb_footprint_overlap_error",message:`${m.type} ${y} overlaps with ${A.type} ${x}`,pcb_component_ids:[m.pcb_component_id,A.pcb_component_id].filter((b)=>Boolean(b))};if(m.type==="pcb_smtpad"||A.type==="pcb_smtpad"){if(C.pcb_smtpad_ids=[],m.type==="pcb_smtpad")C.pcb_smtpad_ids.push(g);if(A.type==="pcb_smtpad")C.pcb_smtpad_ids.push(f)}if(m.type==="pcb_plated_hole"||A.type==="pcb_plated_hole"){if(C.pcb_plated_hole_ids=[],m.type==="pcb_plated_hole")C.pcb_plated_hole_ids.push(g);if(A.type==="pcb_plated_hole")C.pcb_plated_hole_ids.push(f)}if(m.type==="pcb_hole"||A.type==="pcb_hole"){if(C.pcb_hole_ids=[],m.type==="pcb_hole")C.pcb_hole_ids.push(g);if(A.type==="pcb_hole")C.pcb_hole_ids.push(f)}t.push(C)}}}return t}var tYo=new Set(["pcb_courtyard_circle","pcb_courtyard_outline","pcb_courtyard_polygon","pcb_courtyard_pill","pcb_courtyard_rect"]);function nYo(e){let t=new Set(e.flatMap((o)=>{if(o.type==="source_manually_placed_via")return[o.source_manually_placed_via_id];if(o.type==="source_component"&&o.ftype==="simple_test_point")return[o.source_component_id];return[]})),n=new Set(e.filter((o)=>tYo.has(o.type)).flatMap((o)=>("pcb_component_id"in o)&&o.pcb_component_id?[o.pcb_component_id]:[]));return e.filter((o)=>o.type==="pcb_component").filter((o)=>!n.has(o.pcb_component_id)&&(!o.source_component_id||!t.has(o.source_component_id))).map((o)=>{let r=o.source_component_id?e.find((s)=>s.type==="source_component"&&s.source_component_id===o.source_component_id):void 0,i=r?.type==="source_component"?r.name:Yz(e,o.pcb_component_id);return{type:"pcb_component_missing_courtyard_warning",pcb_component_missing_courtyard_warning_id:`pcb_component_missing_courtyard_warning_${o.pcb_component_id}`,warning_type:"pcb_component_missing_courtyard_warning",message:`${i} has no courtyard`,pcb_component_id:o.pcb_component_id,source_component_id:o.source_component_id,subcircuit_id:o.subcircuit_id}})}var gBt=(e)=>{if(e.trace_length!==void 0)return e.trace_length;let t=0,n;for(let o of e.route){let r=o.route_type==="through_pad"?o.start:o;if(n)t+=Math.hypot(r.x-n.x,r.y-n.y);if(o.route_type==="via")t+=1.6;if(o.route_type==="through_pad")t+=Math.hypot(o.end.x-o.start.x,o.end.y-o.start.y),n=o.end;else n=o}return t},oYo=(e)=>{let t=new Set;for(let n of e.route){if(n.route_type!=="wire")continue;if(n.start_pcb_port_id)t.add(n.start_pcb_port_id);if(n.end_pcb_port_id)t.add(n.end_pcb_port_id)}return t},ABt=(e)=>{let t=e.filter((a)=>a.type==="source_trace"),n=e.filter((a)=>a.type==="pcb_trace"),o=e.filter((a)=>a.type==="pcb_port"),r=new Map;for(let a of o){if(!a.source_port_id)continue;let c=r.get(a.source_port_id)??new Set;c.add(a.pcb_port_id),r.set(a.source_port_id,c)}let i=new Map;for(let a of n){if(!a.source_trace_id)continue;let c=i.get(a.source_trace_id)??[];c.push(a),i.set(a.source_trace_id,c)}let s=new Map;for(let a of t){if(a.connected_source_port_ids.length!==2)continue;let c=a.connected_source_port_ids.map((h)=>r.get(h));if(c.some((h)=>!h?.size))continue;let l=new Set((i.get(a.source_trace_id)??[]).filter((h)=>{let d=oYo(h);return c.every((u)=>[...u].some((_)=>d.has(_)))}).map((h)=>h.pcb_trace_id));if(l.size>0)s.set(a.source_trace_id,l)}for(let[a,c]of s)i.set(a,i.get(a).filter((l)=>c.has(l.pcb_trace_id)));return i},rYo=(e)=>{let t=new Map(e.filter((r)=>r.type==="source_trace").map((r)=>[r.source_trace_id,r])),n=ABt(e),o=[];for(let[r,i]of n){let s=i[0],a=t.get(r);if(!a)continue;let c=a.max_length;if(typeof c!=="number")continue;let l=i.reduce((h,d)=>h+gBt(d),0);if(l<=c+0.000000001)continue;o.push({type:"pcb_trace_too_long_error",pcb_trace_too_long_error_id:`pcb_trace_too_long_error_${s.pcb_trace_id}`,error_type:"pcb_trace_too_long_error",message:`PCB trace is ${l.toFixed(2)}mm long, exceeding the ${c}mm maximum`,pcb_trace_id:s.pcb_trace_id,source_trace_id:a.source_trace_id,source_net_id:a.connected_source_net_ids[0],actual_trace_length:l,maximum_trace_length:c,subcircuit_id:s.subcircuit_id??a.subcircuit_id})}return o},iYo=(e)=>{let t=e.filter((i)=>i.type==="source_trace"),n=e.filter((i)=>i.type==="pcb_trace"),o=e.filter((i)=>i.type==="pcb_port"),r=[];for(let i of t){let s=i.max_via_count;if(typeof s!=="number")continue;let a=n.filter((h)=>h.source_trace_id===i.source_trace_id);if(a.length===0)continue;let c=a.reduce((h,d)=>h+d.route.filter((u)=>u.route_type==="via").length,0);if(c<=s)continue;let l=o.filter((h)=>h.source_port_id!==void 0&&i.connected_source_port_ids.includes(h.source_port_id));r.push({type:"pcb_trace_error",pcb_trace_error_id:`max_via_count_exceeded_${i.source_trace_id}`,error_type:"pcb_trace_error",message:`PCB trace uses ${c} vias, exceeding the ${s} maximum`,pcb_trace_id:a[0].pcb_trace_id,source_trace_id:i.source_trace_id,pcb_component_ids:[...new Set(l.map((h)=>h.pcb_component_id).filter((h)=>h!==void 0))],pcb_port_ids:l.map((h)=>h.pcb_port_id),subcircuit_id:a[0].subcircuit_id??i.subcircuit_id})}return r};function sYo(e,{connMap:t,minClearance:n}={}){let o=_R(e);if(o.length<2)return[];let r=XI(e);n??=WI(r,"min_pad_edge_to_pad_edge_clearance")??E2.min_pad_edge_to_pad_edge_clearance,t??=oa(e);let i=new mK({objects:o,getBounds:b7,getId:(a)=>La(a)}),s=new Map;for(let a of o){let c=La(a),l=i.getObjectsInBounds(b7(a),n);for(let h of l){let d=La(h);if(c===d)continue;if(!ag(a).some((g)=>ag(h).includes(g)))continue;if(t.areIdsConnected(c,d))continue;let u=[c,d].sort().join("_"),_=P4(a,h);if(_+E4>=n)continue;let p=RVe(a),m=RVe(h),A={type:"pcb_pad_pad_clearance_error",pcb_pad_pad_clearance_error_id:`pad_pad_clearance_${u}`,error_type:"pcb_pad_pad_clearance_error",message:`Pads ${Hs(e,c)} and ${Hs(e,d)} are too close (clearance: ${Yc(_)}, minimum: ${Yc(n)})`,pcb_pad_ids:[c,d],minimum_clearance:n,actual_clearance:_,center:{x:(p.x+m.x)/2,y:(p.y+m.y)/2}};if(!s.has(u))s.set(u,A)}}return Array.from(s.values())}function aYo(e,{connMap:t,minClearance:n}={}){let o=_R(e),r=tBt(e);if(o.length===0||r.length===0)return[];let i=XI(e);n??=WI(i,"min_trace_to_pad_edge_clearance")??E2.min_trace_to_pad_edge_clearance,t??=oa(e);let s=new mK({objects:o,getBounds:b7,getId:(l)=>La(l)}),a=new Map,c=new Set;for(let l of r){let h=s.getObjectsInBounds(rK(l),n+l.thickness/2);for(let d of h){let u=La(d);if(!ag(d).includes(l.layer))continue;if(t.areIdsConnected(l.pcb_trace_id,u))continue;let _=`${u}_${l.pcb_trace_id}`,{gap:p,center:m}=Ese(l,d);if(cK(p)){a.delete(_),c.add(_);continue}if(c.has(_))continue;if(p+E4>=n)continue;let A={type:"pcb_pad_trace_clearance_error",pcb_pad_trace_clearance_error_id:`pad_trace_clearance_${_}`,error_type:"pcb_pad_trace_clearance_error",message:`Pad ${Hs(e,u)} and trace ${Hs(e,l.pcb_trace_id)} are too close (clearance: ${Yc(p)}, minimum: ${Yc(n)})`,pcb_pad_id:u,pcb_trace_id:l.pcb_trace_id,minimum_clearance:n,actual_clearance:p,center:m},g=a.get(_);if(!g||p<g.gap)a.set(_,{error:A,gap:p})}}return Array.from(a.values()).map(({error:l})=>l)}function cYo(e,{connMap:t,minClearance:n}={}){let o=e.filter((c)=>c.type==="pcb_via"),r=tBt(e).map((c)=>({...c,minX:Math.min(c.x1,c.x2),maxX:Math.max(c.x1,c.x2),minY:Math.min(c.y1,c.y2),maxY:Math.max(c.y1,c.y2),radius:Math.max(0,c.thickness/2),finiteBounds:Number.isFinite(c.x1)&&Number.isFinite(c.x2)&&Number.isFinite(c.y1)&&Number.isFinite(c.y2)&&Number.isFinite(c.thickness)}));if(o.length===0||r.length===0)return[];let i=XI(e);n??=WI(i,"min_trace_to_pad_edge_clearance")??E2.min_trace_to_pad_edge_clearance,t??=oa(e);let s=new Map,a=new Set;for(let c of o){let l=ag(c),h=Number.isFinite(c.x)&&Number.isFinite(c.y)&&Number.isFinite(c.outer_diameter)&&Number.isFinite(n),d=Math.max(0,c.outer_diameter/2)+Math.max(0,n)+E4;for(let u of r){let _=d+u.radius;if(h&&u.finiteBounds&&(c.x<u.minX-_||c.x>u.maxX+_||c.y<u.minY-_||c.y>u.maxY+_))continue;if(!l.includes(u.layer))continue;if(t.areIdsConnected(u.pcb_trace_id,c.pcb_via_id))continue;let p=`${c.pcb_via_id}_${u.pcb_trace_id}`,{gap:m,center:A}=Ese(u,c);if(cK(m)){s.delete(p),a.add(p);continue}if(a.has(p))continue;if(m+E4>=n)continue;let g={type:"pcb_via_trace_clearance_error",pcb_via_trace_clearance_error_id:`via_trace_clearance_${p}`,error_type:"pcb_via_trace_clearance_error",message:`Via ${Hs(e,c.pcb_via_id)} and trace ${Hs(e,u.pcb_trace_id)} are too close (clearance: ${Yc(m)}, minimum: ${Yc(n)})`,pcb_via_id:c.pcb_via_id,pcb_trace_id:u.pcb_trace_id,minimum_clearance:n,actual_clearance:m,center:A},f=s.get(p);if(!f||m<f.gap)s.set(p,{error:g,gap:m})}}return Array.from(s.values()).map(({error:c})=>c)}function lYo(e,{connMap:t,minClearance:n}={}){let o=e.filter((l)=>l.type==="pcb_via"),r=_R(e);if(o.length===0||r.length===0)return[];let i=XI(e),s=n??WI(i,"min_pad_edge_to_pad_edge_clearance")??E2.min_pad_edge_to_pad_edge_clearance;t??=oa(e);let a=new mK({objects:r,getBounds:b7,getId:La}),c=[];for(let l of o){let h=a.getObjectsInBounds(b7(l),s);for(let d of h){let u=La(d);if(!ag(l).some((p)=>ag(d).includes(p)))continue;if(t.areIdsConnected(l.pcb_via_id,u))continue;let _=P4(l,d);if(_+E4>=s)continue;c.push({type:"pcb_pad_pad_clearance_error",pcb_pad_pad_clearance_error_id:`via_pad_clearance_${l.pcb_via_id}_${u}`,error_type:"pcb_pad_pad_clearance_error",message:`Via ${Hs(e,l.pcb_via_id)} and pad ${Hs(e,u)} are too close (clearance: ${Yc(_)}, minimum: ${Yc(s)})`,pcb_pad_ids:[l.pcb_via_id,u],minimum_clearance:s,actual_clearance:_,center:kOo(l,d)})}}return c}var hYo=0.000000001;function dYo(e,t){let{gap:n}=Ese({x1:e.x,y1:e.y,x2:e.x,y2:e.y,thickness:e.hole_diameter},t);return n<-hYo}function uYo(e){let t=XI(e);if(t&&"is_via_in_pad_allowed"in t&&t.is_via_in_pad_allowed===!0)return[];let n=e.filter((a)=>a.type==="pcb_via"),o=_R(e);if(n.length===0||o.length===0)return[];let r=new Map(o.map((a,c)=>[La(a),c])),i=new mK({objects:o,getBounds:b7,getId:La}),s=[];for(let a of n){let c=i.getObjectsInBounds(b7(a));for(let l of c){let h=La(l),d=ag(a),u=ag(l);if(!d.some((m)=>u.includes(m)))continue;if(!dYo(a,l))continue;let _=r.get(h)??0,p=MOo(e,l,_);s.push({type:"pcb_placement_error",pcb_placement_error_id:`via_in_pad_${a.pcb_via_id}_${h}`,error_type:"pcb_placement_error",message:`Via hole at (${a.x.toFixed(2)}mm, ${a.y.toFixed(2)}mm) overlaps ${p}`,subcircuit_id:a.subcircuit_id??l.subcircuit_id})}}return s}var Zxe=(e)=>{let t=new Set;for(let n of e){if(n.type==="pcb_pad_trace_clearance_error"&&typeof n.pcb_trace_id==="string"&&typeof n.pcb_pad_id==="string")t.add(`overlap_${n.pcb_trace_id}_${n.pcb_pad_id}`);if(n.type==="pcb_via_trace_clearance_error"&&typeof n.pcb_trace_id==="string"&&typeof n.pcb_via_id==="string")t.add(`overlap_${n.pcb_trace_id}_${n.pcb_via_id}`)}return e.filter((n)=>{let o=n;return!(o.type==="pcb_trace_error"&&typeof o.pcb_trace_error_id==="string"&&t.has(o.pcb_trace_error_id))})};function pYo(e){let t=[],n=e.filter((a)=>("source_component_id"in a)&&(a.type==="source_component"||a.type.startsWith("source_simple_"))),o=e.filter((a)=>a.type==="source_port"),r=e.filter((a)=>a.type==="source_trace"),i=new Set;for(let a of r)for(let c of a.connected_source_port_ids??[])i.add(c);let s=new Map;for(let a of n)if("internally_connected_source_port_ids"in a&&a.internally_connected_source_port_ids)s.set(a.source_component_id,a.internally_connected_source_port_ids);for(let a of s.values())for(let c of a)if(c.some((l)=>i.has(l)))for(let l of c)i.add(l);for(let a of o)if(a.must_be_connected===!0){if(!i.has(a.source_port_id)){let l=n.find((h)=>h.source_component_id===a.source_component_id)?.name??"Unknown";t.push({type:"source_pin_must_be_connected_error",source_pin_must_be_connected_error_id:`source_pin_must_be_connected_error_${a.source_port_id}`,error_type:"source_pin_must_be_connected_error",message:`Port ${a.name} on ${l} must be connected but is floating`,source_component_id:a.source_component_id??"",source_port_id:a.source_port_id,subcircuit_id:a.subcircuit_id})}}return t}var Ewt=(e)=>{if(e===void 0)return;if(typeof e==="string"&&!/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?\s*(?:[pnumkKMGTµμ]?V)?$/i.test(e.trim()))return;try{let t=Xl.parse(e);return Number.isFinite(t)?t:void 0}catch{return}};function mYo(e){let t=q8(e),n=e.filter((i)=>i.type==="source_port"),o=new Map;for(let i of n){let s=Ewt(i.provides_voltage);if(s===void 0)continue;let a=t.getNetConnectedToId(i.source_port_id);if(a===void 0)continue;let c=o.get(a)??[];c.push({sourcePort:i,volts:s}),o.set(a,c)}let r=[];for(let i of n){let s=Ewt(i.requires_voltage);if(s===void 0)continue;let a=t.getNetConnectedToId(i.source_port_id);if(a===void 0)continue;for(let c of o.get(a)??[]){if(c.sourcePort.source_port_id===i.source_port_id)continue;if(Math.abs(c.volts-s)<=0.000000001*Math.max(1,Math.abs(c.volts),Math.abs(s)))continue;r.push(mM.parse({type:"source_component_misconfigured_error",message:`${cwt(e,i)} requires ${s} V, but is connected to ${cwt(e,c.sourcePort)}, which provides ${c.volts} V.`,source_component_ids:[...new Set([i.source_component_id,c.sourcePort.source_component_id].filter((l)=>l!==void 0))],source_port_ids:[i.source_port_id,c.sourcePort.source_port_id],is_fatal:!0}))}}return r}function _Yo(e){let t=e.filter((i)=>i.type==="source_component"&&(i.ftype==="simple_push_button"||i.ftype==="simple_switch")),n=e.filter((i)=>i.type==="source_port"),o=e.filter((i)=>i.type==="schematic_port"),r=[];for(let i of t){let s=o.flatMap((l)=>{let h=n.find((d)=>d.source_port_id===l.source_port_id&&d.source_component_id===i.source_component_id);if(!h)return[];return[h]});if(s.length!==2)continue;let a=s[0].subcircuit_connectivity_map_key,c=s[1].subcircuit_connectivity_map_key;if(!a)continue;if(a!==c)continue;r.push(mM.parse({type:"source_component_misconfigured_error",message:`Switch ${i.name} has both schematic contacts connected to the same net. Check internallyConnectedPins and the footprint pin mapping.`,source_component_ids:[i.source_component_id],source_port_ids:s.map((l)=>l.source_port_id),is_fatal:!0}))}return r}var gYo=["must_be_connected","provides_power","requires_power","provides_ground","requires_ground","provides_voltage","requires_voltage","do_not_connect","include_in_board_pinout","can_use_internal_pullup","is_using_internal_pullup","needs_external_pullup","can_use_internal_pulldown","is_using_internal_pulldown","needs_external_pulldown","can_use_open_drain","is_using_open_drain","can_use_push_pull","is_using_push_pull","should_have_decoupling_capacitor","recommended_decoupling_capacitor_capacitance","is_configured_for_i2c_sda","is_configured_for_i2c_scl","is_configured_for_spi_mosi","is_configured_for_spi_miso","is_configured_for_spi_sck","is_configured_for_spi_cs","is_configured_for_uart_tx","is_configured_for_uart_rx","supports_i2c_sda","supports_i2c_scl","supports_spi_mosi","supports_spi_miso","supports_spi_sck","supports_spi_cs","supports_uart_tx","supports_uart_rx"];function AYo(e){return gYo.some((t)=>e[t]!==void 0)}function fBt(e){let t=[],n=As(e),o=n.source_component.list(),r=n.source_port.list(),i=new Map;for(let s of r){if(!s.source_component_id)continue;let a=i.get(s.source_component_id)??[];a.push(s),i.set(s.source_component_id,a)}for(let s of o){if(s.ftype!=="simple_chip")continue;let a=i.get(s.source_component_id)??[];if(a.length===0)continue;if(a.some((l)=>AYo(l)))continue;t.push({type:"source_component_pins_underspecified_warning",source_component_pins_underspecified_warning_id:`source_component_pins_underspecified_warning_${s.source_component_id}`,warning_type:"source_component_pins_underspecified_warning",message:`All pins on ${s.name} are underspecified (no pinAttributes set)`,source_component_id:s.source_component_id,source_port_ids:a.map((l)=>l.source_port_id),subcircuit_id:a[0]?.subcircuit_id})}return t}var yBt=(e,t)=>e.ftype==="simple_chip"&&t.filter((n)=>n.do_not_connect!==!0).length>=2;function xBt(e){let t=[],n=As(e),o=n.source_component.list(),r=n.source_port.list(),i=new Map;for(let s of r){if(!s.source_component_id)continue;let a=i.get(s.source_component_id)??[];a.push(s),i.set(s.source_component_id,a)}for(let s of o){let a=i.get(s.source_component_id)??[];if(!yBt(s,a))continue;if(a.some((l)=>l.requires_power===!0))continue;t.push({type:"source_no_power_pin_defined_warning",source_no_power_pin_defined_warning_id:`source_no_power_pin_defined_warning_${s.source_component_id}`,warning_type:"source_no_power_pin_defined_warning",message:`${s.name} has no pin with requires_power=true`,source_component_id:s.source_component_id,source_port_ids:a.map((l)=>l.source_port_id),subcircuit_id:a[0]?.subcircuit_id})}return t}function CBt(e){let t=[],n=As(e),o=n.source_component.list(),r=n.source_port.list(),i=new Map;for(let s of r){if(!s.source_component_id)continue;let a=i.get(s.source_component_id)??[];a.push(s),i.set(s.source_component_id,a)}for(let s of o){let a=i.get(s.source_component_id)??[];if(!yBt(s,a))continue;if(a.some((l)=>l.requires_ground===!0))continue;t.push({type:"source_no_ground_pin_defined_warning",source_no_ground_pin_defined_warning_id:`source_no_ground_pin_defined_warning_${s.source_component_id}`,warning_type:"source_no_ground_pin_defined_warning",message:`${s.name} has no pin with requires_ground=true`,source_component_id:s.source_component_id,source_port_ids:a.map((l)=>l.source_port_id),subcircuit_id:a[0]?.subcircuit_id})}return t}var fYo=0.2,Mwt=3,yYo=0.000000001;function xYo(e){let t=e.filter((i)=>i.type==="schematic_component"),n=e.filter((i)=>i.type==="schematic_port"),o=new Map;for(let i of n){if(!i.schematic_component_id)continue;let s=o.get(i.schematic_component_id)??[];s.push(i),o.set(i.schematic_component_id,s)}let r=[];for(let i of t){if(!i.is_box_with_pins||i.size.height<=0)continue;let s=(o.get(i.schematic_component_id)??[]).filter((A)=>A.side_of_component==="left"||A.side_of_component==="right");if(s.length<2)continue;let a=s.map((A)=>A.center.y),c=Math.max(...a),l=Math.min(...a),h=i.center.y+i.size.height/2,d=i.center.y-i.size.height/2,_=(i.pin_spacing??fYo)*Mwt,p={top:h-c,bottom:l-d},m=Hs(e,i.schematic_component_id);for(let A of["top","bottom"]){let g=p[A];if(g<=_+yYo||g<=0)continue;let f=A==="top"?"above":"below",y=`excessive_${A}_padding`;r.push({type:"schematic_component_styling_warning",schematic_component_styling_warning_id:`schematic_component_styling_warning_${i.schematic_component_id}_${y}`,warning_type:"schematic_component_styling_warning",message:`${m} has excessive empty space ${f} its pins (${g.toFixed(2)}mm, more than ${Mwt} pin spacings)`,schematic_component_id:i.schematic_component_id,styling_issue_type:y,schematic_port_ids:s.map((x)=>x.schematic_port_id),source_component_id:i.source_component_id,schematic_sheet_id:i.schematic_sheet_id,subcircuit_id:i.subcircuit_id})}}return r}var CYo=(e)=>/^unnamed_[a-z0-9_-]+\d+$/i.test(e),bYo=(e,t)=>{let{center:n,size:o}=t,r=0.000000001;return e.position.x>=n.x-o.width/2-0.000000001&&e.position.x<=n.x+o.width/2+0.000000001&&e.position.y>=n.y-o.height/2-0.000000001&&e.position.y<=n.y+o.height/2+0.000000001};function IYo(e){let t=e.filter((c)=>c.type==="schematic_component"),n=e.filter((c)=>c.type==="source_component"),o=e.filter((c)=>c.type==="schematic_text"),r=new Map(n.map((c)=>[c.source_component_id,c])),i=new Map,s=[];for(let c of o){if(!c.schematic_component_id){if(c.schematic_symbol_id)s.push(c);continue}let l=i.get(c.schematic_component_id)??new Set;l.add(c.text.trim()),i.set(c.schematic_component_id,l)}let a=[];for(let c of t){if(c.symbol_name)continue;if(c.is_box_with_pins)continue;if(!c.source_component_id)continue;let l=r.get(c.source_component_id);if(!l)continue;let h=new Set([l.name,l.display_name].map((m)=>m?.trim()).filter((m)=>Boolean(m))),d=[...h].find((m)=>!CYo(m)),u=i.get(c.schematic_component_id),_=[...h].some((m)=>u?.has(m))||s.some((m)=>h.has(m.text.trim())&&bYo(m,c));if(d&&_)continue;let p=d??"Schematic component";a.push({type:"schematic_component_styling_warning",schematic_component_styling_warning_id:`schematic_component_styling_warning_${c.schematic_component_id}_missing_reference_designator_text`,warning_type:"schematic_component_styling_warning",message:`${p} is missing schematic reference designator text. For a custom symbol, add name="{REFDES}" inside the symbol.`,schematic_component_id:c.schematic_component_id,styling_issue_type:"missing_reference_designator_text",source_component_id:c.source_component_id,schematic_sheet_id:c.schematic_sheet_id,subcircuit_id:c.subcircuit_id})}return a}var tK=0.000000001,vYo=(e)=>e.display_pin_label??`pin ${e.pin_number}`;function SYo(e){let t=e.filter((i)=>i.type==="schematic_component"),n=e.filter((i)=>i.type==="schematic_port"),o=new Map;for(let i of n){if(!i.schematic_component_id)continue;let s=o.get(i.schematic_component_id)??[];s.push(i),o.set(i.schematic_component_id,s)}let r=[];for(let i of t){if(i.is_box_with_pins===!1||i.size.width<=0||i.size.height<=0)continue;let s=i.center.x-i.size.width/2,a=i.center.x+i.size.width/2,c=i.center.y-i.size.height/2,l=i.center.y+i.size.height/2,d=(o.get(i.schematic_component_id)??[]).filter((g)=>{if(g.side_of_component==="left"||g.side_of_component==="right")return g.center.y<c-tK||g.center.y>l+tK;if(g.side_of_component==="top"||g.side_of_component==="bottom")return g.center.x<s-tK||g.center.x>a+tK;return!1}).sort((g,f)=>{let y=g.side_of_component==="left"||g.side_of_component==="right",x=f.side_of_component==="left"||f.side_of_component==="right";if(y&&x)return f.center.y-g.center.y;if(!y&&!x)return g.center.x-f.center.x;return y?-1:1});if(d.length===0)continue;let u=Math.max(i.size.height,...d.filter((g)=>g.side_of_component==="left"||g.side_of_component==="right").map((g)=>2*Math.abs(g.center.y-i.center.y))),_=Math.max(i.size.width,...d.filter((g)=>g.side_of_component==="top"||g.side_of_component==="bottom").map((g)=>2*Math.abs(g.center.x-i.center.x))),p=[];if(u>i.size.height+tK)p.push(`increase schHeight to at least ${u.toFixed(2)}mm`);if(_>i.size.width+tK)p.push(`increase schWidth to at least ${_.toFixed(2)}mm`);let m=Hs(e,i.schematic_component_id),A=d.map(vYo).join(", ");r.push({type:"schematic_component_styling_warning",schematic_component_styling_warning_id:`schematic_component_styling_warning_${i.schematic_component_id}_ports_outside_body`,warning_type:"schematic_component_styling_warning",message:`${m} has schematic pins outside its body (${A}); ${p.join(" and ")}`,schematic_component_id:i.schematic_component_id,styling_issue_type:"ports_outside_body",schematic_port_ids:d.map((g)=>g.schematic_port_id),source_component_id:i.source_component_id,schematic_sheet_id:i.schematic_sheet_id,subcircuit_id:i.subcircuit_id})}return r}var yse=(e)=>{if(Number.isInteger(e))return String(e);return e.toFixed(3).replace(/\.0+$/,"").replace(/(\.\d*?)0+$/,"$1")},bBt=(e)=>{let t=yse(e);return e>0?`+${t}`:t},PYo=(e)=>e.replaceAll("&","&amp;").replaceAll('"',"&quot;").replaceAll("<","&lt;").replaceAll(">","&gt;"),sn=(e,t,n,o)=>{if(n===void 0)return;let r=typeof n==="number"?o?.formatDelta?bBt(n):yse(n):PYo(n);e.push(`${t}="${r}"`)};function IBt(e){let t=new Map,n=(r)=>{let i=t.get(r);if(i===void 0||i===r)return r;let s=n(i);return t.set(r,s),s},o=(r)=>{let i=r[0];if(!i)return;let s=n(i);for(let a of r.slice(1))t.set(n(a),s)};for(let r of e){if(r.type==="source_port"||r.type==="source_net"){let i=r.type==="source_port"?r.source_port_id:r.source_net_id;if(r.subcircuit_connectivity_map_key)o([i,`connectivity:${r.subcircuit_connectivity_map_key}`])}if(r.type==="source_trace")o([...r.connected_source_port_ids,...r.connected_source_net_ids,...r.subcircuit_connectivity_map_key?[`connectivity:${r.subcircuit_connectivity_map_key}`]:[]]);if(r.type==="source_component_internal_connection")o(r.source_port_ids);if(r.type==="source_component")for(let i of r.internally_connected_source_port_ids??[])o(i)}return n}var Cp=class{connected;components=new Map;portsByComponent=new Map;portsByNet=new Map;powerNets=new Set;groundNets=new Set;placements=new Map;schematicComponents=new Map;schematicPorts=new Map;constructor(e){this.connected=IBt(e.circuitJson);for(let t of e.componentPlacements)if(t.sourceComponentId)Qxe(this.placements,t.sourceComponentId,t);for(let t of e.circuitJson){if(t.type==="source_component")this.components.set(t.source_component_id,t);if(t.type==="source_port"&&t.source_component_id)Qxe(this.portsByComponent,t.source_component_id,t),Qxe(this.portsByNet,this.connected(t.source_port_id),t);if(t.type==="source_net"){let n=this.connected(t.source_net_id);if(t.is_power||t.is_positive_voltage_source)this.powerNets.add(n);if(t.is_ground)this.groundNets.add(n)}if(t.type==="schematic_component")this.schematicComponents.set(t.schematic_component_id,t);if(t.type==="schematic_port"&&t.source_port_id)Qxe(this.schematicPorts,t.source_port_id,t)}}placement(e){let t=this.placements.get(e);return t?.length===1?t[0]:void 0}port(e){let t=this.placement(e.source_component_id),n=this.schematicPorts.get(e.source_port_id)?.filter((o)=>o.schematic_component_id===t?.schematicComponentId);return n?.length===1?n[0]:void 0}namedPort(e,t){let n=this.portsByComponent.get(e)?.filter((o)=>o.name===t||o.port_hints?.includes(t));return n?.length===1?n[0]:void 0}twoTerminalNets(e){let t=this.portsByComponent.get(e);if(t?.length!==2)return;let n=this.connected(t[0].source_port_id),o=this.connected(t[1].source_port_id);if(n!==o)return[n,o]}isRail(e){return this.powerNets.has(e)||this.groundNets.has(e)}isDirectOpAmpFeedback(e){let t=this.twoTerminalNets(e);if(!t||t.some((n)=>this.isRail(n)))return!1;return t.some((n)=>(this.portsByNet.get(n)??[]).some((o)=>{let r=o.source_component_id;if(this.components.get(r)?.ftype!=="simple_op_amp")return!1;if(this.namedPort(r,"output")?.source_port_id!==o.source_port_id)return!1;return["inverting_input","non_inverting_input"].some((s)=>{let a=this.namedPort(r,s);if(!a)return!1;let c=this.connected(a.source_port_id);return c!==n&&t.includes(c)})}))}sameLocalScope(e,t){if(e.schematicSheetId!==t.schematicSheetId||e.subcircuitId!==t.subcircuitId)return!1;let n=this.schematicComponents.get(e.schematicComponentId??""),o=this.schematicComponents.get(t.schematicComponentId??"");if(!n||!o||n.schematic_group_id!==o.schematic_group_id)return!1;let r=this.components.get(e.sourceComponentId??""),i=this.components.get(t.sourceComponentId??"");return r?.source_group_id===i?.source_group_id&&r?.subcircuit_id===i?.subcircuit_id}};function Qxe(e,t,n){let o=e.get(t);if(o)o.push(n);else e.set(t,[n])}var $Ve=class extends co{constructor(e){super();this.params=e,this.index=new Cp(e.ctx);for(let t of e.ctx.circuitJson){if(t.type==="pcb_component"&&t.do_not_place)this.unpopulated.add(t.source_component_id);if(t.type==="source_port"){let n=this.index.connected(t.source_port_id);if(t.requires_ground||t.provides_ground)this.index.groundNets.add(n);if(t.requires_power||t.provides_power)this.index.powerNets.add(n)}}this.nets=[...this.index.portsByNet.keys()],this.solved=this.nets.length===0}params;index;nets;unpopulated=new Set;currentIndex=0;_step(){let e=this.nets[this.currentIndex++];if(this.solved=this.currentIndex>=this.nets.length,!e||this.index.isRail(e))return;let t=this.index,n=t.portsByNet.get(e);if(n.length!==3||new Set(n.map((b)=>b.source_component_id)).size!==3)return;let o=n.map((b)=>this.localPart(b.source_component_id));if(o.some((b)=>!b))return;let r=o.filter((b)=>b.component.ftype==="simple_diode"),i=o.filter((b)=>b.component.ftype==="simple_capacitor");if(r.length!==2||i.length!==1)return;let s=i[0],a=r[0],c=r[1];if(![a,c].every((b)=>t.sameLocalScope(s.placement,b.placement)))return;let l=(b)=>b.nets.find((I)=>I!==e),h=[l(a),l(c)],d=h.filter((b)=>t.groundNets.has(b));if(d.length!==1)return;let u=d[0],_=h.find((b)=>b!==u),p=l(s);if(p===_||p===u||t.isRail(p))return;let A=[...new Set((t.portsByNet.get(_)??[]).filter((b)=>t.components.get(b.source_component_id)?.ftype==="simple_capacitor").map((b)=>b.source_component_id))].filter((b)=>t.twoTerminalNets(b)?.includes(u));if(!A.length||A.some((b)=>{let I=this.localPart(b);return!I||!t.sameLocalScope(s.placement,I.placement)}))return;let g=[s.placement,a.placement,c.placement],f=n.map((b)=>t.port(b)),y=Math.max(...f.flatMap((b,I)=>f.slice(I+1).map((v)=>Math.hypot(b.center.x-v.center.x,b.center.y-v.center.y)))),x=Math.max(4,...g.map((b)=>3*Math.max(b.width,b.height)));if(y<=x)return;let C=g.map((b)=>b.sourceComponentName||"component");this.params.issues.push({lineItemType:"DiodeCapacitorJunctionTooSpreadOut",capacitorSchematicBox:s.placement,diodeSchematicBoxes:[a.placement,c.placement],maxJunctionPinDistance:y,maxRecommendedJunctionPinDistance:x,message:`Bring ${C.join(", ")} closer together so their shared junction can be read as one local diode-capacitor stage. Preserve pin connections, leave room for labels, and reroute affected traces.`})}localPart(e){let t=this.index.components.get(e),n=this.index.placement(e),o=this.index.portsByComponent.get(e),r=this.index.twoTerminalNets(e);if(!t||!n||!r||this.unpopulated.has(e)||o?.length!==2||![n.width,n.height].every((i)=>Number.isFinite(i)&&i>0)||t.ftype==="simple_capacitor"&&(!Number.isFinite(t.capacitance)||t.capacitance<=0)||o.some((i)=>{let s=this.index.port(i);return i.do_not_connect||!s||s.schematic_sheet_id!==n.schematicSheetId||!Number.isFinite(s.center.x)||!Number.isFinite(s.center.y)}))return;return{component:t,placement:n,ports:o,nets:r}}static issueToString(e){let t=[];return sn(t,"capacitorName",e.capacitorSchematicBox.sourceComponentName),sn(t,"diodeNames",e.diodeSchematicBoxes.map((n)=>n.sourceComponentName).join(",")),sn(t,"maxJunctionPinDistance",e.maxJunctionPinDistance),sn(t,"maxRecommendedJunctionPinDistance",e.maxRecommendedJunctionPinDistance),sn(t,"message",e.message),`<DiodeCapacitorJunctionTooSpreadOut ${t.join(" ")} />`}},qVe=class extends co{constructor(e){super();this.params=e,this.index=new Cp(e.ctx),this.ledIds=new Set([...this.index.components.values()].filter((t)=>t.ftype==="simple_led").map((t)=>t.source_component_id));for(let t of e.ctx.circuitJson)if(t.type==="pcb_component"&&t.do_not_place)this.unpopulated.add(t.source_component_id);this.solved=this.ledIds.size===0}params;index;ledIds;visited=new Set;unpopulated=new Set;_step(){let e=[...this.ledIds].find((l)=>!this.visited.has(l));if(!e){this.solved=!0;return}let t=[e];this.visited.add(e);let n=new Map;for(let l=0;l<t.length;l++){let h=t[l],d=new Set;for(let u of this.index.portsByComponent.get(h)??[])for(let _ of this.index.portsByNet.get(this.index.connected(u.source_port_id))??[]){let p=_.source_component_id;if(p===h||!this.ledIds.has(p))continue;if(d.add(p),!this.visited.has(p))this.visited.add(p),t.push(p)}n.set(h,d)}if(this.solved=this.visited.size===this.ledIds.size,t.length<3)return;let o=t.filter((l)=>n.get(l).size===1);if(o.length!==2||t.some((l)=>n.get(l).size>2))return;let r=[o.sort()[0]];while(r.length<t.length){let l=r.at(-1),h=r.at(-2),d=[...n.get(l)].find((u)=>u!==h);if(!d||r.includes(d))return;r.push(d)}let i=r.map((l)=>this.index.placement(l));if(i.some((l)=>!l))return;let s=i.filter((l)=>l!==void 0);if(s.some((l)=>!this.index.sameLocalScope(s[0],l)||![l.schX,l.schY,l.width,l.height].every(Number.isFinite)||l.width<=0||l.height<=0))return;for(let l of r){let h=this.index.portsByComponent.get(l)??[];if(this.unpopulated.has(l)||!this.index.twoTerminalNets(l)||h.some((u)=>u.do_not_connect))return;let d=this.index.placement(l);for(let u of h){let _=this.index.port(u);if(!_||_.schematic_sheet_id!==d.schematicSheetId||!Number.isFinite(_.center.x)||!Number.isFinite(_.center.y)||!_.facing_direction)return}}let a=[];for(let l=1;l<r.length;l++){let h=r[l-1],d=r[l],u=this.index.twoTerminalNets(h),_=this.index.twoTerminalNets(d).filter((I)=>u.includes(I));if(_.length!==1||this.index.isRail(_[0]))return;let p=this.index.portsByNet.get(_[0])??[];if(p.length!==2)return;let m=p.find((I)=>I.source_component_id===h),A=p.find((I)=>I.source_component_id===d),g=this.index.port(m),f=this.index.port(A),y=f.center.x-g.center.x,x=f.center.y-g.center.y,C=Math.hypot(y,x),b=Math.max(s[l-1].width,s[l-1].height,s[l].width,s[l].height);if(C>Math.max(4,3*b)&&(wwt(g,y,x)<-b||wwt(f,-y,-x)<-b))a.push({firstSourcePortId:m.source_port_id,secondSourcePortId:A.source_port_id,pinDistance:C})}if(!a.length)return;let c=s.map((l)=>l.sourceComponentName||"LED").join(", ");this.params.issues.push({lineItemType:"SeriesLedChainNotOrdered",ledSchematicBoxes:s,backtrackingConnections:a,message:`Arrange ${c} in their connected series order so adjacent LEDs do not require long connections behind their pins. Move or rotate the symbols while preserving anode/cathode connections; allow space for labels and reroute affected traces. A horizontal, vertical, or clearly connected folded chain is acceptable.`})}static issueToString(e){let t=[];return sn(t,"ledComponents",e.ledSchematicBoxes.map((n)=>n.sourceComponentName).join(",")),sn(t,"backtrackingConnections",e.backtrackingConnections.length),sn(t,"maxPinDistance",Math.max(...e.backtrackingConnections.map((n)=>n.pinDistance))),sn(t,"message",e.message),`<SeriesLedChainNotOrdered ${t.join(" ")} />`}};function wwt(e,t,n){switch(e.facing_direction){case"left":return-t;case"right":return t;case"up":return n;case"down":return-n;default:return 0}}var JVe=class extends co{constructor(e){super();this.params=e,this.index=new Cp(e.ctx);for(let t of e.ctx.circuitJson){if(t.type==="pcb_component"&&t.do_not_place)this.unpopulated.add(t.source_component_id);if(t.type==="source_port"){let n=this.index.connected(t.source_port_id);if(t.requires_ground||t.provides_ground)this.index.groundNets.add(n);if(t.requires_power||t.provides_power||t.requires_voltage!==void 0||t.provides_voltage!==void 0)this.index.powerNets.add(n)}}this.resistorIds=[...this.index.components.values()].filter((t)=>t.ftype==="simple_resistor").map((t)=>t.source_component_id),this.solved=this.resistorIds.length===0}params;index;resistorIds;unpopulated=new Set;currentIndex=0;_step(){let e=this.resistorIds[this.currentIndex++];this.solved=this.currentIndex>=this.resistorIds.length;let t=this.index,n=t.components.get(e),o=t.twoTerminalNets(e);if(n?.ftype!=="simple_resistor"||!Number.isFinite(n.resistance)||n.resistance<=0||!o)return;let r=o.filter((b)=>t.groundNets.has(b)&&!t.powerNets.has(b));if(r.length!==1)return;let i=r[0],s=o.find((b)=>b!==i);if(t.isRail(s))return;let a=t.portsByNet.get(s)??[];if(a.length!==3||a.some((b)=>b.do_not_connect))return;let c=a.find((b)=>t.components.get(b.source_component_id)?.ftype==="simple_capacitor"),l=a.find((b)=>t.components.get(b.source_component_id)?.ftype==="simple_chip");if(!c||!l)return;let h=c.source_component_id,d=t.components.get(h);if(d?.ftype!=="simple_capacitor"||!Number.isFinite(d.capacitance)||d.capacitance<=0||!t.twoTerminalNets(h)?.includes(i))return;let u=l.source_component_id;if((t.portsByComponent.get(u)?.length??0)<3)return;let _=t.placement(e),p=t.placement(h),m=t.placement(u);if(!_||!p||!m||[e,h,u].some((b)=>this.unpopulated.has(b)))return;if([_,p].some((b)=>b.schematicSheetId!==m.schematicSheetId||b.subcircuitId!==m.subcircuitId))return;if([_,p,m].some((b)=>![b.schX,b.schY,b.width,b.height].every(Number.isFinite)||b.width<=0||b.height<=0))return;let A=t.port(l);if(!A||A.schematic_sheet_id!==m.schematicSheetId)return;let g=this.pins(e,s,i,_),f=this.pins(h,s,i,p);if(!g||!f)return;let y=Bwt(...g),x=Bwt(...f);if(!y||!x)return;if(Math.abs(_.schX-p.schX)<(_.width+p.width)/2&&Math.abs(_.schY-p.schY)<(_.height+p.height)/2)return;let C;if(y!==x)C="different_axes";else{let b=y==="horizontal"?"x":"y",I=g.map((P)=>P.center[b]),v=f.map((P)=>P.center[b]);if((I[1]-I[0])*(v[1]-v[0])<0)C="crossed_connections";else{if(Math.min(Math.max(...I),Math.max(...v))-Math.max(Math.min(...I),Math.min(...v))>0.01)return;C="staggered"}}this.params.issues.push({lineItemType:"ParallelRcNotAligned",resistorSchematicBox:_,capacitorSchematicBox:p,chipSourcePortId:l.source_port_id,reason:C,message:`Draw ${_.sourceComponentName||"the resistor"} and ${p.sourceComponentName||"the capacitor"} as adjacent parallel branches with their shared nets at matching ends. Preserve all pin connections and capacitor polarity, leave room for labels, and reroute affected wires.`})}pins(e,t,n,o){let r=this.index.portsByComponent.get(e)??[];if(r.length!==2||r.some((c)=>c.do_not_connect))return;let i=[t,n].map((c)=>{let l=r.find((h)=>this.index.connected(h.source_port_id)===c);return l&&this.index.port(l)}),[s,a]=i;if(!s||!a||i.some((c)=>c.schematic_sheet_id!==o.schematicSheetId||!Number.isFinite(c.center.x)||!Number.isFinite(c.center.y)))return;return[s,a]}static issueToString(e){let t=[];return sn(t,"resistorComponentName",e.resistorSchematicBox.sourceComponentName),sn(t,"capacitorComponentName",e.capacitorSchematicBox.sourceComponentName),sn(t,"reason",e.reason),sn(t,"message",e.message),`<ParallelRcNotAligned ${t.join(" ")} />`}};function Bwt(e,t){let n=new Set([e.facing_direction,t.facing_direction]);if(n.has("left")&&n.has("right")&&Math.abs(e.center.y-t.center.y)<0.01&&Math.abs(e.center.x-t.center.x)>0.01)return"horizontal";if(n.has("up")&&n.has("down")&&Math.abs(e.center.x-t.center.x)<0.01&&Math.abs(e.center.y-t.center.y)>0.01)return"vertical"}var ZVe=class extends co{constructor(e){super();this.params=e,this.index=new Cp(e.ctx);for(let t of e.ctx.circuitJson)if(t.type==="pcb_component"&&t.do_not_place)this.unpopulated.add(t.source_component_id);this.resistorIds=[...this.index.components.values()].filter((t)=>t.ftype==="simple_resistor").map((t)=>t.source_component_id),this.solved=this.resistorIds.length===0}params;index;resistorIds;unpopulated=new Set;currentIndex=0;_step(){let e=this.resistorIds[this.currentIndex++];if(this.solved=this.currentIndex>=this.resistorIds.length,!e||this.unpopulated.has(e))return;let t=this.index,n=t.components.get(e),o=t.placement(e),r=t.twoTerminalNets(e),i=t.portsByComponent.get(e)??[];if(n?.ftype!=="simple_resistor"||!Number.isFinite(n.resistance)||n.resistance<=0||!o||!r||i.some((b)=>b.do_not_connect))return;let s=r.filter((b)=>t.groundNets.has(b)&&!t.powerNets.has(b));if(s.length!==1)return;let a=r.find((b)=>b!==s[0]);if(t.isRail(a))return;let c=t.portsByNet.get(a)??[];if(c.length!==2)return;let l=c.find((b)=>b.source_component_id!==e),h=c.find((b)=>b.source_component_id===e);if(!l||!h||l.do_not_connect||EYo(l))return;let d=l.source_component_id,u=t.placement(d);if(t.components.get(d)?.ftype!=="simple_chip"||(t.portsByComponent.get(d)?.length??0)<3||this.unpopulated.has(d)||!u||!t.sameLocalScope(u,o))return;let _=t.port(l),p=t.port(h);if(!_||!p||[_,p].some((b)=>b.schematic_sheet_id!==u.schematicSheetId||!Number.isFinite(b.center.x)||!Number.isFinite(b.center.y))||[u,o].some((b)=>![b.schX,b.schY,b.width,b.height].every(Number.isFinite)||b.width<=0||b.height<=0))return;let m=_.facing_direction;if(!m)return;let A=m==="left"||m==="right",f=-(m==="left"||m==="down"?-1:1)*(A?o.schX-u.schX:o.schY-u.schY),y=A?(u.width+o.width)/2:(u.height+o.height)/2;if(f<=y+0.2)return;let x=Math.hypot(_.center.x-p.center.x,_.center.y-p.center.y),C=Math.max(4,3*Math.max(o.width,o.height));if(x<=C)return;this.params.issues.push({lineItemType:"ResistorSeparatedFromChipPin",hostSchematicBox:u,resistorSchematicBox:o,chipSourcePortId:l.source_port_id,resistorSourcePortId:h.source_port_id,pinDistance:x,maxRecommendedPinDistance:C,message:`Place ${o.sourceComponentName||"resistor"} beside its connected pin on the ${m} side of ${u.sourceComponentName||"chip"} so the resistor-to-ground branch can be read together. Preserve pin connections, leave room for labels, and reroute affected traces; exact alignment is not required.`})}static issueToString(e){let t=[];return sn(t,"hostComponentName",e.hostSchematicBox.sourceComponentName),sn(t,"resistorName",e.resistorSchematicBox.sourceComponentName),sn(t,"pinDistance",e.pinDistance),sn(t,"maxRecommendedPinDistance",e.maxRecommendedPinDistance),sn(t,"message",e.message),`<ResistorSeparatedFromChipPin ${t.join(" ")} />`}};function EYo(e){return Boolean(e.requires_power||e.provides_power||e.requires_ground||e.provides_ground||e.requires_voltage!==void 0||e.provides_voltage!==void 0)}var eYe=class extends co{constructor(e){super();this.params=e;let t=new Cp(e.ctx),n=new Map;for(let o of t.components.values()){let r=o.ftype==="simple_diode"||o.ftype==="simple_led";if(!r&&o.ftype!=="simple_resistor")continue;let i=o.source_component_id,s=t.placement(i),a=t.twoTerminalNets(i)?.sort(),c=t.portsByComponent.get(i);if(!s||!a||!c)continue;let l=a.map((A)=>{let g=c.find((f)=>t.connected(f.source_port_id)===A);return g&&t.port(g)}),[h,d]=l,u={diode:r,box:s};if(h&&d&&!c.some((A)=>A.do_not_connect)&&l.every((A)=>A?.schematic_sheet_id===s.schematicSheetId))u.pins=[h,d],u.axis=MYo(h,d);let _=JSON.stringify(a),p=n.get(_)??[],m=p.find((A)=>t.sameLocalScope(A[0].box,s));if(m)m.push(u);else{let A=[u];p.push(A),this.banks.push(A)}n.set(_,p)}this.solved=this.banks.length===0}params;banks=[];bankIndex=0;_step(){let e=this.banks[this.bankIndex++];if(this.solved=this.bankIndex>=this.banks.length,e.length!==2)return;let t=e.find((s)=>s.diode),n=e.find((s)=>!s.diode);if(!t?.pins||!t.axis||!n?.pins||!n.axis)return;let o=t.box,r=n.box;if(Math.abs(o.schX-r.schX)<(o.width+r.width)/2&&Math.abs(o.schY-r.schY)<(o.height+r.height)/2)return;let i;if(t.axis!==n.axis)i="different_axes";else{let s=t.axis==="horizontal"?"x":"y",a=t.pins.map((l)=>l.center[s]),c=n.pins.map((l)=>l.center[s]);if((a[1]-a[0])*(c[1]-c[0])<0)i="crossed_connections";else{if(Math.min(Math.max(...a),Math.max(...c))-Math.max(Math.min(...a),Math.min(...c))>0.01)return;i="staggered"}}this.params.issues.push({lineItemType:"ParallelDiodeResistorNotAligned",diodeSchematicBox:o,resistorSchematicBox:r,reason:i,message:`Draw ${o.sourceComponentName||"the diode"} and ${r.sourceComponentName||"the resistor"} as adjacent parallel rows or columns with their shared nets at matching ends. Preserve every pin connection and diode polarity, leave room for labels, and reroute the affected wires.`})}static issueToString(e){let t=[];return sn(t,"diodeComponentName",e.diodeSchematicBox.sourceComponentName),sn(t,"resistorComponentName",e.resistorSchematicBox.sourceComponentName),sn(t,"reason",e.reason),sn(t,"message",e.message),`<ParallelDiodeResistorNotAligned ${t.join(" ")} />`}};function MYo(e,t){let n=new Set([e.facing_direction,t.facing_direction]);if(n.has("left")&&n.has("right")&&Math.abs(e.center.y-t.center.y)<0.01&&Math.abs(e.center.x-t.center.x)>0.01)return"horizontal";if(n.has("up")&&n.has("down")&&Math.abs(e.center.x-t.center.x)<0.01&&Math.abs(e.center.y-t.center.y)>0.01)return"vertical"}var sK=(e,t)=>Math.hypot(e.x-t.x,e.y-t.y),dR=0.001,tYe=class extends co{index;nodes=new Map;starts=[];currentIndex=0;issues;maxSpan;maxLength;constructor({ctx:e,issues:t,maxSpan:n=8,maxLength:o=16}){super();if(this.index=new Cp(e),this.issues=t,!Number.isFinite(n)||n<0||!Number.isFinite(o)||o<0)throw Error("Rail visibility thresholds must be finite and nonnegative");this.maxSpan=n,this.maxLength=o;let r=this.index,i=(l,h,d)=>{let u=JSON.stringify([d,h,Math.round(l.x/dR),Math.round(l.y/dR)]);if(!this.nodes.has(u))this.nodes.set(u,{point:l,net:h,sheet:d,links:[]});return u},s=(l,h,d)=>{let u=this.nodes.get(l),_=this.nodes.get(h),p=sK(u.point,_.point);u.links.push({to:h,length:p,...d}),_.links.push({to:l,length:p,...d})},a=new Map;for(let[l,h]of r.portsByComponent)for(let d of h){let u=r.port(d);if(!u)continue;let _=i(u.center,r.connected(d.source_port_id),u.schematic_sheet_id);if(a.set(d.source_port_id,_),h.length>2)this.starts.push({portId:d.source_port_id,componentId:l,nodeId:_})}for(let l of e.circuitJson){if(l.type!=="schematic_net_label"||!l.source_net_id||!l.anchor_position)continue;let h=r.connected(l.source_net_id);if(!r.isRail(h)||r.powerNets.has(h)&&r.groundNets.has(h))continue;let d=i(l.anchor_position,h,l.schematic_sheet_id);this.nodes.get(d).terminal=r.groundNets.has(h)?"ground":"power"}let c=[];for(let l of e.circuitJson){if(l.type!=="schematic_trace")continue;let h=wYo(l,e.circuitJson,r);if(!h)continue;for(let d of l.edges)c.push({from:i(d.from,h,l.schematic_sheet_id),to:i(d.to,h,l.schematic_sheet_id),traceId:l.schematic_trace_id})}for(let l of c){let h=this.nodes.get(l.from),d=this.nodes.get(l.to);if(sK(h.point,d.point)<dR)continue;let _=[...this.nodes].filter(([,p])=>p.net===h.net&&p.sheet===h.sheet&&BYo(p.point,h.point,d.point)).sort(([,p],[,m])=>sK(h.point,p.point)-sK(h.point,m.point));for(let p=1;p<_.length;p++)s(_[p-1][0],_[p][0],{traceId:l.traceId})}for(let[l,h]of r.components){if(!["simple_resistor","simple_capacitor","simple_inductor"].includes(h.ftype))continue;let d=r.portsByComponent.get(l);if(d?.length!==2||!r.twoTerminalNets(l))continue;let u=a.get(d[0].source_port_id),_=a.get(d[1].source_port_id);if(u&&_)s(u,_,{componentId:l})}this.solved=this.starts.length===0}_step(){let e=this.starts[this.currentIndex++];if(this.solved=this.currentIndex>=this.starts.length,!e)return;let t=this.index.portsByComponent.get(e.componentId)?.find((a)=>a.source_port_id===e.portId),n=t?this.index.port(t):void 0,o=n?.display_pin_label||t?.name||(n?.pin_number!==void 0?`pin${n.pin_number}`:"connected pin"),r=this.index.placement(e.componentId);if(!r)return;let i=[{id:e.nodeId,length:0,hops:0,path:[e.nodeId],links:[]}],s=new Map([[`${e.nodeId}:0`,0]]);while(i.length){i.sort((h,d)=>h.length-d.length);let a=i.shift(),c=`${a.id}:${a.hops}`;if(a.length!==s.get(c))continue;let l=this.nodes.get(a.id);if(l.terminal){let h=a.path.map((A)=>this.nodes.get(A).point),d=h.map((A)=>A.x),u=h.map((A)=>A.y),_={left:Math.min(...d),right:Math.max(...d),bottom:Math.min(...u),top:Math.max(...u)},p=Math.max(_.right-_.left,_.top-_.bottom);if(p<=this.maxSpan&&a.length<=this.maxLength)return;let m=[...new Set(a.links.flatMap((A)=>A.componentId?[A.componentId]:[]))];this.issues.push({lineItemType:"RailPathTooSpreadOut",hostSchematicBox:r,sourcePortId:e.portId,sourcePortName:o,railType:l.terminal,supportSchematicBoxes:m.flatMap((A)=>{let g=this.index.placement(A);return g?[g]:[]}),schematicTraceIds:[...new Set(a.links.flatMap((A)=>A.traceId?[A.traceId]:[]))],pathPoints:h,pathBounds:_,pathLength:a.length,pathSpan:p,maxRecommendedSpan:this.maxSpan,maxRecommendedPathLength:this.maxLength,message:`Visible path from ${r.sourceComponentName||"component"}.${o} to ${l.terminal} spans ${p.toFixed(2)} schematic units; move the connected support elements closer together near the pin and recompute their schematic traces.`});return}for(let h of l.links){if(a.path.includes(h.to))continue;if(h.componentId){let p=this.index.placement(h.componentId);if(a.hops>=3||!p||!this.index.sameLocalScope(r,p))continue}let d=a.length+h.length,u=a.hops+(h.componentId?1:0),_=`${h.to}:${u}`;if(d>=(s.get(_)??1/0))continue;s.set(_,d),i.push({id:h.to,length:d,hops:u,path:[...a.path,h.to],links:[...a.links,h]})}}}static issueToString(e){let t=[];return sn(t,"hostName",e.hostSchematicBox.sourceComponentName),sn(t,"pinName",e.sourcePortName),sn(t,"railType",e.railType),sn(t,"pathSpan",e.pathSpan),sn(t,"pathLength",e.pathLength),sn(t,"message",e.message),`<RailPathTooSpreadOut ${t.join(" ")} />`}};function wYo(e,t,n){if(e.subcircuit_connectivity_map_key)return n.connected(`connectivity:${e.subcircuit_connectivity_map_key}`);let o=t.find((i)=>i.type==="source_trace"&&i.source_trace_id===e.source_trace_id);if(o?.type!=="source_trace")return;let r=[...o.connected_source_port_ids,...o.connected_source_net_ids];return r[0]?n.connected(r[0]):void 0}function BYo(e,t,n){let o=n.x-t.x,r=n.y-t.y,i=sK(t,n);if(i<dR)return sK(t,e)<dR;let s=((e.x-t.x)*o+(e.y-t.y)*r)/i;return Math.abs((e.x-t.x)*r-(e.y-t.y)*o)/i<dR&&s>=-dR&&s<=i+dR}var nYe=class extends co{constructor(e){super();this.params=e,this.index=new Cp(e.ctx);for(let t of e.ctx.circuitJson)if(t.type==="pcb_component"&&t.do_not_place)this.unpopulated.add(t.source_component_id);this.capacitorIds=[...this.index.components.values()].filter((t)=>t.ftype==="simple_capacitor").map((t)=>t.source_component_id),this.solved=this.capacitorIds.length===0}params;index;capacitorIds;unpopulated=new Set;currentIndex=0;_step(){let e=this.capacitorIds[this.currentIndex++];if(this.solved=this.currentIndex>=this.capacitorIds.length,!e||this.unpopulated.has(e))return;let t=this.index,n=t.components.get(e),o=t.placement(e),r=t.portsByComponent.get(e)??[],i=t.twoTerminalNets(e);if(n?.ftype!=="simple_capacitor"||!Number.isFinite(n.capacitance)||n.capacitance<=0||!o||!i||i.some((v)=>t.isRail(v))||r.some((v)=>v.do_not_connect||SVe(v)))return;let s=i.map((v)=>{let P=t.portsByNet.get(v)??[];if(P.length!==2)return;return P.find((M)=>M.source_component_id!==e)}),[a,c]=s;if(!a||!c||a.source_component_id!==c.source_component_id||a.do_not_connect||c.do_not_connect||SVe(a)||SVe(c))return;let l=a.source_component_id,h=t.placement(l);if(t.components.get(l)?.ftype!=="simple_chip"||this.unpopulated.has(l)||!h||!t.sameLocalScope(h,o))return;let d=[a,c],u=d.map((v)=>t.port(v)),_=r.map((v)=>t.port(v));if([...u,..._].some((v)=>!v||v.schematic_sheet_id!==h.schematicSheetId||!Number.isFinite(v.center.x)||!Number.isFinite(v.center.y))||[h,o].some((v)=>![v.schX,v.schY,v.width,v.height].every(Number.isFinite)||v.width<=0||v.height<=0))return;let p=u[0],m=u[1],A=p.facing_direction;if(!A||A!==m.facing_direction)return;let g=A==="left"||A==="right",f=A==="left"||A==="down"?-1:1,y=Math.hypot(p.center.x-m.center.x,p.center.y-m.center.y);if(y<0.01)return;let x=-f*(g?o.schX-h.schX:o.schY-h.schY),C=g?(h.width+o.width)/2:(h.height+o.height)/2;if(x<=C+0.2)return;let b=Math.max(...u.map((v,P)=>Math.hypot(v.center.x-_[P].center.x,v.center.y-_[P].center.y))),I=Math.max(4,3*Math.max(o.width,o.height),2*y);if(b<=I)return;this.params.issues.push({lineItemType:"CapacitorSeparatedFromChipPins",hostSchematicBox:h,capacitorSchematicBox:o,chipSourcePortIds:[d[0].source_port_id,d[1].source_port_id],maxPinDistance:b,maxRecommendedPinDistance:I,message:`Place ${o.sourceComponentName||"component"} beside its two connected pins on the ${A} side of ${h.sourceComponentName||"component"} so their connections can be read together. Preserve pin connections, leave room for labels, and reroute affected traces; exact alignment is not required.`})}static issueToString(e){let t=[];return sn(t,"hostComponentName",e.hostSchematicBox.sourceComponentName),sn(t,"capacitorName",e.capacitorSchematicBox.sourceComponentName),sn(t,"maxPinDistance",e.maxPinDistance),sn(t,"maxRecommendedPinDistance",e.maxRecommendedPinDistance),sn(t,"message",e.message),`<CapacitorSeparatedFromChipPins ${t.join(" ")} />`}};function SVe(e){return Boolean(e.requires_power||e.provides_power||e.requires_ground||e.provides_ground||e.requires_voltage!==void 0||e.provides_voltage!==void 0)}var oYe=class extends co{constructor(e){super();this.params=e,this.index=new Cp(e.ctx);for(let t of e.ctx.circuitJson)if(t.type==="pcb_component"&&t.do_not_place)this.unpopulated.add(t.source_component_id);for(let t of e.ctx.circuitJson)if(t.type==="pcb_component"&&!t.do_not_place)this.unpopulated.delete(t.source_component_id);this.inductorIds=[...this.index.components.values()].filter((t)=>t.ftype==="simple_inductor"&&!this.unpopulated.has(t.source_component_id)).map((t)=>t.source_component_id),this.solved=this.inductorIds.length===0}params;index;inductorIds;unpopulated=new Set;currentIndex=0;_step(){let e=this.inductorIds[this.currentIndex++];if(this.solved=this.currentIndex>=this.inductorIds.length,!e)return;let t=this.index,n=this.localPart(e),o=t.twoTerminalNets(e);if(!n||!o||o.some((d)=>t.isRail(d)))return;let r=o.map((d)=>{let u=t.portsByNet.get(d)??[];if(u.some((y)=>y.source_component_id!==e&&!this.unpopulated.has(y.source_component_id)&&t.components.get(y.source_component_id)?.ftype==="simple_inductor"))return;let _=u.filter((y)=>{let x=t.components.get(y.source_component_id),C=t.twoTerminalNets(y.source_component_id);return x?.ftype==="simple_capacitor"&&!this.unpopulated.has(y.source_component_id)&&C?.some((b)=>b!==d&&t.groundNets.has(b))});if(_.length!==1)return;let p=_[0],m=t.components.get(p.source_component_id);if(m.ftype!=="simple_capacitor"||!Number.isFinite(m.capacitance)||m.capacitance<=0)return;let A=this.localPart(p.source_component_id);if(!A||!t.sameLocalScope(n.placement,A.placement))return;let g=t.port(p),f=t.port(n.ports.find((y)=>t.connected(y.source_port_id)===d));return{placement:A.placement,ground:t.twoTerminalNets(p.source_component_id).find((y)=>y!==d),distance:Math.hypot(g.center.x-f.center.x,g.center.y-f.center.y)}}),[i,s]=r;if(!i||!s||i.ground!==s.ground)return;let a=[n.placement,i.placement,s.placement],c=Math.max(4,...a.map((d)=>3*Math.max(d.width,d.height))),l=Math.max(i.distance,s.distance);if(l<=c)return;let h=(d)=>d.sourceComponentName||"component";this.params.issues.push({lineItemType:"PiFilterComponentsNotGrouped",inductorSchematicBox:n.placement,firstCapacitorSchematicBox:i.placement,secondCapacitorSchematicBox:s.placement,maxSignalPinDistance:l,maxRecommendedSignalPinDistance:c,message:`Group ${h(i.placement)} and ${h(s.placement)} beside the connected ends of ${h(n.placement)} so the series path and both grounded branches of the pi filter can be read together. Preserve pin connections, allow room for labels, and reroute affected traces.`})}localPart(e){let t=this.index.placement(e),n=this.index.portsByComponent.get(e);if(!t||n?.length!==2||n.some((o)=>{let r=this.index.port(o);return o.do_not_connect||!r||r.schematic_sheet_id!==t.schematicSheetId||!Number.isFinite(r.center.x)||!Number.isFinite(r.center.y)}))return;return{placement:t,ports:n}}static issueToString(e){let t=[];return sn(t,"inductorName",e.inductorSchematicBox.sourceComponentName),sn(t,"firstCapacitorName",e.firstCapacitorSchematicBox.sourceComponentName),sn(t,"secondCapacitorName",e.secondCapacitorSchematicBox.sourceComponentName),sn(t,"maxSignalPinDistance",e.maxSignalPinDistance),sn(t,"maxRecommendedSignalPinDistance",e.maxRecommendedSignalPinDistance),sn(t,"message",e.message),`<PiFilterComponentsNotGrouped ${t.join(" ")} />`}},rYe=class extends co{constructor(e){super();this.params=e,this.index=new Cp(e.ctx),this.mosfetIds=[...this.index.components.keys()].filter((t)=>this.mosfetPorts(t)),this.solved=this.mosfetIds.length===0}params;index;mosfetIds;currentIndex=0;_step(){let e=this.mosfetIds[this.currentIndex++];if(this.solved=this.currentIndex>=this.mosfetIds.length,!e)return;let t=this.index,n=t.placement(e),o=this.mosfetPorts(e);if(!n)return;let r=t.connected(o.gate.source_port_id),i=t.connected(o.sources[0].source_port_id),s=t.connected(o.drains[0].source_port_id);if(new Set([r,i,s]).size!==3||t.isRail(r))return;if([o.gate,...o.sources,...o.drains].some((m)=>{let A=t.port(m);return!A||A.schematic_sheet_id!==n.schematicSheetId}))return;let a=(t.portsByNet.get(r)??[]).filter((m)=>m.source_component_id!==e);if(a.length!==2)return;let c=a.map((m)=>{let A=m.source_component_id,g=t.components.get(A),f=t.placement(A),y=t.twoTerminalNets(A);if(g?.ftype!=="simple_resistor"||!Number.isFinite(g.resistance)||g.resistance<=0||!f||!y||!t.sameLocalScope(n,f)||t.portsByComponent.get(A).some((x)=>{let C=t.port(x);return x.do_not_connect||!C||C.schematic_sheet_id!==n.schematicSheetId}))return;return{placement:f,otherNet:y.find((x)=>x!==r)}});if(c.some((m)=>!m))return;let l=c.filter((m)=>m.otherNet===i),h=c.filter((m)=>m.otherNet!==i);if(l.length!==1||h.length!==1)return;let d=l[0].placement,u=h[0].placement;if(h[0].otherNet===s||t.isRail(h[0].otherNet))return;let _=Math.max(6,3*Math.max(n.width,n.height)),p=Math.max(Twt(n,u),Twt(n,d));if(p<=_)return;this.params.issues.push({lineItemType:"MosfetGateNetworkNotGrouped",mosfetSchematicBox:n,seriesGateResistorSchematicBox:u,gateSourceResistorSchematicBox:d,maxBodyGap:p,maxRecommendedBodyGap:_,message:`Group ${u.sourceComponentName||"component"} and ${d.sourceComponentName||"component"} beside ${n.sourceComponentName||"component"}'s gate/source pins so the gate-drive branch can be read together. Preserve all pin connections, leave room for labels, and reroute affected traces.`})}mosfetPorts(e){let t=this.index.components.get(e)?.ftype;if(t!=="simple_mosfet"&&t!=="simple_chip")return;let n=this.index.portsByComponent.get(e)??[],o=n.filter((s)=>PVe(s,/^(G|GATE)$/)),r=n.filter((s)=>PVe(s,/^(S|SOURCE)[0-9]*$/)),i=n.filter((s)=>PVe(s,/^(D|DRAIN)[0-9]*$/));if(o.length!==1||!r.length||!i.length||o.length+r.length+i.length!==n.length||new Set([...o,...r,...i]).size!==n.length||n.some((s)=>s.do_not_connect))return;for(let s of[r,i])if(new Set(s.map((a)=>this.index.connected(a.source_port_id))).size!==1)return;return{gate:o[0],sources:r,drains:i}}static issueToString(e){let t=[];return sn(t,"mosfetName",e.mosfetSchematicBox.sourceComponentName),sn(t,"seriesGateResistorName",e.seriesGateResistorSchematicBox.sourceComponentName),sn(t,"gateSourceResistorName",e.gateSourceResistorSchematicBox.sourceComponentName),sn(t,"maxBodyGap",e.maxBodyGap),sn(t,"maxRecommendedBodyGap",e.maxRecommendedBodyGap),sn(t,"message",e.message),`<MosfetGateNetworkNotGrouped ${t.join(" ")} />`}};function PVe(e,t){return[e.name,...e.port_hints??[]].some((n)=>t.test(n.toUpperCase().replace(/[\s_]/g,"")))}function Twt(e,t){return Math.hypot(Math.max(0,Math.abs(e.schX-t.schX)-(e.width+t.width)/2),Math.max(0,Math.abs(e.schY-t.schY)-(e.height+t.height)/2))}var iYe=class extends co{constructor(e){super();this.params=e,this.index=new Cp(e.ctx),this.relayIds=[...this.index.components.keys()].filter((t)=>this.coilPorts(t)),this.solved=this.relayIds.length===0}params;index;relayIds;currentIndex=0;_step(){let e=this.relayIds[this.currentIndex++];if(this.solved=this.currentIndex>=this.relayIds.length,!e)return;let t=this.index,n=t.placement(e),o=this.coilPorts(e);if(!n||o.some((v)=>v.do_not_connect))return;let r=o.map((v)=>t.connected(v.source_port_id));if(r[0]===r[1])return;if(this.relayIds.some((v)=>v!==e&&this.coilPorts(v).every((P)=>r.includes(t.connected(P.source_port_id)))))return;let i=new Set((t.portsByNet.get(r[0])??[]).filter((v)=>t.components.get(v.source_component_id)?.ftype==="simple_diode").map((v)=>v.source_component_id).filter((v)=>t.twoTerminalNets(v)?.includes(r[1])));if(i.size!==1)return;let s=[...i][0],a=t.placement(s),c=this.uniquePort(s,/^(?:ANODE|A)$/),l=this.uniquePort(s,/^(?:CATHODE|K)$/);if(!a||!t.sameLocalScope(n,a)||!c||!l||c===l||c.do_not_connect||l.do_not_connect)return;let h=t.connected(c.source_port_id),d=t.connected(l.source_port_id);if(t.isRail(h)||t.groundNets.has(d)||!this.hasGroundedDriver(h,d))return;let u=o.map((v)=>t.port(v)),_=[c,l].map((v)=>t.port(v));if([...u,..._].some((v)=>!v||v.schematic_sheet_id!==n.schematicSheetId))return;let[p,m]=u,A=Math.min(p.center.x,m.center.x),g=Math.max(p.center.x,m.center.x),f=Math.min(p.center.y,m.center.y),y=Math.max(p.center.y,m.center.y),x=Math.max(A-(a.schX+a.width/2),a.schX-a.width/2-g,0),C=Math.max(f-(a.schY+a.height/2),a.schY-a.height/2-y,0),b=Math.hypot(x,C),I=Math.hypot(g-A,y-f);if(b<=Math.max(1.5,2*I)||b>Math.max(8,4*Math.max(n.width,n.height)))return;if(!this.params.ctx.circuitJson.some((v)=>v.type==="schematic_net_label"&&v.schematic_sheet_id===n.schematicSheetId&&v.anchor_position&&_.some((P)=>Math.hypot(P.center.x-v.anchor_position.x,P.center.y-v.anchor_position.y)<0.01&&!this.hasWireAtPin(P))))return;this.params.issues.push({lineItemType:"FlybackDiodeSeparatedFromRelayCoil",relaySchematicBox:n,diodeSchematicBox:a,coilSourcePortIds:[o[0].source_port_id,o[1].source_port_id],distanceFromCoilPins:b,message:`Place ${a.sourceComponentName||"component"} beside ${n.sourceComponentName||"component"}'s coil pins so the flyback protection loop can be read together. Preserve diode polarity and all pin connections; leave room for labels and reroute affected traces.`})}hasWireAtPin(e){return this.params.ctx.circuitJson.some((t)=>t.type==="schematic_trace"&&t.schematic_sheet_id===e.schematic_sheet_id&&t.edges.some(({from:n,to:o})=>{let r=o.x-n.x,i=o.y-n.y,s=r*r+i*i,a=s?Math.max(0,Math.min(1,((e.center.x-n.x)*r+(e.center.y-n.y)*i)/s)):0;return Math.hypot(e.center.x-n.x-a*r,e.center.y-n.y-a*i)<0.01}))}uniquePort(e,t){let n=this.index.portsByComponent.get(e)?.filter((o)=>mse(o,t));return n?.length===1?n[0]:void 0}coilPorts(e){if(this.index.components.get(e)?.ftype!=="simple_chip")return;let t=this.index.portsByComponent.get(e)??[];if(!this.uniquePort(e,/^(?:COM|COMMON)$/)||!t.some((o)=>mse(o,/^(?:NO|NC|NORMALLYOPEN|NORMALLYCLOSED)$/)))return;if(t.filter((o)=>mse(o,/^(?:COIL[A-B12]|A[12])$/)).length!==2)return;for(let[o,r]of[["COILA","COILB"],["COIL1","COIL2"],["A1","A2"]]){let i=this.uniquePort(e,new RegExp(`^${o}$`)),s=this.uniquePort(e,new RegExp(`^${r}$`));if(i&&s&&i!==s&&!mse(i,new RegExp(`^${r}$`))&&!mse(s,new RegExp(`^${o}$`)))return[i,s]}}hasGroundedDriver(e,t){return(this.index.portsByNet.get(e)??[]).some((n)=>{let o=n.source_component_id,r=this.index.components.get(o);if(r?.ftype!=="simple_chip"&&!(r?.ftype==="simple_transistor"&&r.transistor_type==="npn"))return!1;if(this.index.portsByComponent.get(o)?.length!==3)return!1;let i=this.uniquePort(o,/^(?:C|COLLECTOR)$/),s=this.uniquePort(o,/^(?:E|EMITTER)$/),a=this.uniquePort(o,/^(?:B|BASE)$/);if(!i||!s||!a||new Set([i,s,a]).size!==3||[i,s,a].some((h)=>h.do_not_connect)||i.source_port_id!==n.source_port_id)return!1;let c=this.index.connected(s.source_port_id),l=this.index.connected(a.source_port_id);return this.index.groundNets.has(c)&&!this.index.powerNets.has(c)&&new Set([e,t,c,l]).size===4})}static issueToString(e){let t=[];return sn(t,"relayName",e.relaySchematicBox.sourceComponentName),sn(t,"diodeName",e.diodeSchematicBox.sourceComponentName),sn(t,"distanceFromCoilPins",e.distanceFromCoilPins),sn(t,"message",e.message),`<FlybackDiodeSeparatedFromRelayCoil ${t.join(" ")} />`}};function mse(e,t){return[e.name,...e.port_hints??[]].some((n)=>t.test(n.toUpperCase().replace(/[\s_]/g,"")))}var uR=0.01,sYe=class extends co{constructor(e){super();this.params=e,this.index=new Cp(e.ctx),this.hostIds=[...this.index.components.values()].filter((t)=>t.ftype==="simple_chip").map((t)=>t.source_component_id),this.traces=e.ctx.circuitJson.filter((t)=>t.type==="schematic_trace"),this.solved=this.hostIds.length===0}params;index;hostIds;traces;currentIndex=0;_step(){let e=this.hostIds[this.currentIndex++];if(this.solved=this.currentIndex>=this.hostIds.length,!e)return;let t=this.index,n=t.placement(e),o=t.portsByComponent.get(e)??[],r=o.filter((N)=>EVe(N)==="positive"),i=o.filter((N)=>EVe(N)==="negative"),s=o.filter((N)=>xse(N,/^(?:OUT|VOUT|OUTPUT)$/));if(!n||r.length!==1||i.length!==1||s.length!==1||!o.some((N)=>xse(N,/^(?:VS|VCC|VDD)$/))||!o.some((N)=>xse(N,/^(?:GND|GROUND|VSS)$/)))return;let a=[r[0],i[0]],c=a.map((N)=>t.connected(N.source_port_id));if(a.some((N)=>N.do_not_connect)||c[0]===c[1]||c.includes(t.connected(s[0].source_port_id)))return;let l=a.map((N)=>t.port(N)),[h,d]=l;if(!h||!d||!h.facing_direction||h.facing_direction!==d.facing_direction||l.some((N)=>N.schematic_sheet_id!==n.schematicSheetId))return;let u=new Set((t.portsByNet.get(c[0])??[]).filter((N)=>t.components.get(N.source_component_id)?.ftype==="simple_resistor").map((N)=>N.source_component_id).filter((N)=>t.twoTerminalNets(N)?.includes(c[1])));if(u.size!==1)return;let _=[...u][0],p=t.components.get(_);if(p?.ftype!=="simple_resistor"||!Number.isFinite(p.resistance)||p.resistance<=0||p.resistance>1)return;if(c.some((N)=>(t.portsByNet.get(N)??[]).some((D)=>D.source_component_id!==e&&EVe(D)!==void 0&&t.components.get(D.source_component_id)?.ftype==="simple_chip")))return;let m=t.placement(_);if(!m||!t.sameLocalScope(n,m))return;let A=t.portsByComponent.get(_);if(A.some((N)=>N.do_not_connect))return;let g=c.map((N)=>t.port(A.find((D)=>t.connected(D.source_port_id)===N)));if(g.some((N)=>!N||N.schematic_sheet_id!==n.schematicSheetId))return;let f=h.facing_direction==="left"||h.facing_direction==="right",y=(N)=>f?N.y:N.x,x=y(h.center),C=y(d.center),b=Math.abs(x-C);if(b<uR)return;let I=f?m.schY:m.schX,v=(f?m.height:m.width)/2,P=Math.max(Math.min(x,C)-(I+v),I-v-Math.max(x,C));if(P<=Math.max(1.5,2*b)||Math.hypot(m.schX-n.schX,m.schY-n.schY)>Math.max(8,4*Math.max(n.width,n.height)))return;let M=l.map((N,D)=>this.hasVisibleConnection(g[D],N,c[D]));if(M[0]===M[1])return;let B=M[0]?1:0,T=c[B];if(!this.params.ctx.circuitJson.some((N)=>{if(N.type!=="schematic_net_label"||N.schematic_sheet_id!==n.schematicSheetId)return!1;if(N.source_net_id&&(t.connected(N.source_net_id)===T||t.connected(`connectivity:${N.source_net_id}`)===T))return!0;let D=g[B].center;if(N.anchor_position&&Math.hypot(N.anchor_position.x-D.x,N.anchor_position.y-D.y)<uR)return!0;return N.source_trace_id!==void 0&&this.sourceTraceTouchesNet(N.source_trace_id,T)}))return;this.params.issues.push({lineItemType:"CurrentSenseShuntSeparatedFromInputs",amplifierSchematicBox:n,shuntSchematicBox:m,positiveInputSourcePortId:a[0].source_port_id,negativeInputSourcePortId:a[1].source_port_id,inputBandGap:P,message:`Place ${m.sourceComponentName||"component"} near ${n.sourceComponentName||"component"}.${a[0].name}/${a[1].name}, so both sense connections can be read together. Move or rotate the shunt as needed; preserve all pin connections and leave room for labels.`})}hasVisibleConnection(e,t,n){let o=this.traces.filter((s)=>{if(s.schematic_sheet_id!==e.schematic_sheet_id)return!1;if(s.subcircuit_connectivity_map_key)return this.index.connected(`connectivity:${s.subcircuit_connectivity_map_key}`)===n;if(this.sourceTraceTouchesNet(s.source_trace_id,n))return!0;let a=[s.edges[0]?.from,s.edges.at(-1)?.to],c=new Set(this.params.ctx.circuitJson.flatMap((l)=>l.type==="schematic_port"&&l.source_port_id&&l.schematic_sheet_id===s.schematic_sheet_id&&a.some((h)=>h&&Math.hypot(h.x-l.center.x,h.y-l.center.y)<uR)?[this.index.connected(l.source_port_id)]:[]));return c.size===1&&c.has(n)}).flatMap((s)=>s.edges),r=o.filter((s)=>kxe(e.center,s.from,s.to)),i=new Set;for(let s=0;s<r.length;s++){let a=r[s];if(kxe(t.center,a.from,a.to))return!0;for(let[c,l]of o.entries()){if(i.has(c)||![a.from,a.to].some((h)=>kxe(h,l.from,l.to))&&![l.from,l.to].some((h)=>kxe(h,a.from,a.to)))continue;i.add(c),r.push(l)}}return!1}sourceTraceTouchesNet(e,t){if(!e)return!1;let n=this.params.ctx.circuitJson.find((o)=>o.type==="source_trace"&&o.source_trace_id===e);return n?.type==="source_trace"&&n.connected_source_port_ids.some((o)=>this.index.connected(o)===t)}static issueToString(e){let t=[];return sn(t,"amplifierName",e.amplifierSchematicBox.sourceComponentName),sn(t,"shuntName",e.shuntSchematicBox.sourceComponentName),sn(t,"inputBandGap",e.inputBandGap),sn(t,"message",e.message),`<CurrentSenseShuntSeparatedFromInputs ${t.join(" ")} />`}};function xse(e,t){return[e.name,...e.port_hints??[]].some((n)=>t.test(n.toUpperCase().replace(/[\s_]/g,"")))}function EVe(e){let t=xse(e,/^(?:IN\+|VIN\+|INPOS|VINPOS)$/),n=xse(e,/^(?:IN-|VIN-|INNEG|VINNEG)$/);return t===n?void 0:t?"positive":"negative"}function kxe(e,t,n){let o=n.x-t.x,r=n.y-t.y,i=Math.hypot(o,r);if(i<uR)return Math.hypot(e.x-t.x,e.y-t.y)<uR;let s=((e.x-t.x)*o+(e.y-t.y)*r)/i;return s>=-uR&&s<=i+uR&&Math.abs((e.x-t.x)*r-(e.y-t.y)*o)/i<uR}var aYe=class extends co{constructor(e){super();this.params=e,this.index=new Cp(e.ctx),this.resistorIds=[...this.index.components.values()].filter((t)=>t.ftype==="simple_resistor").map((t)=>t.source_component_id);for(let t of e.ctx.circuitJson)if(t.type==="source_net"&&t.is_positive_voltage_source)this.positiveNets.add(this.index.connected(t.source_net_id));this.solved=this.resistorIds.length===0}params;index;positiveNets=new Set;resistorIds;currentIndex=0;_step(){let e=this.resistorIds[this.currentIndex++];if(this.solved=this.currentIndex>=this.resistorIds.length,!e||!this.isResistor(e))return;let t=this.index,n=t.twoTerminalNets(e);if(!n)return;let o=n.filter((A)=>t.isRail(A));if(o.length!==1)return;let r=o[0];if(!this.positiveNets.has(r)||t.groundNets.has(r))return;let i=n.find((A)=>A!==r),s=t.portsByNet.get(i)??[],a=new Set(s.filter((A)=>t.components.get(A.source_component_id)?.ftype==="simple_resistor").map((A)=>A.source_component_id));if(a.size!==2)return;let c=[...a].find((A)=>A!==e);if(!this.isResistor(c))return;let l=t.twoTerminalNets(c),h=l?.find((A)=>A!==i);if(!l?.includes(i)||!h||!t.groundNets.has(h)||t.powerNets.has(h)||!s.some((A)=>!a.has(A.source_component_id)))return;let d=t.placement(e),u=t.placement(c);if(!d||!u||!t.sameLocalScope(d,u))return;let _=this.getDownwardResistorPorts(e,r,i),p=this.getDownwardResistorPorts(c,i,h);if(!_||!p)return;let m=u.schY-u.height/2-(d.schY+d.height/2);if(m<=1.5)return;this.params.issues.push({lineItemType:"VoltageDividerSupplyResistorBelowGroundResistor",supplyResistorSchematicBox:d,groundResistorSchematicBox:u,supplyTapSourcePortId:_.bottom.source_port_id,groundTapSourcePortId:p.top.source_port_id,reversedBodyGap:m,message:`Place ${d.sourceComponentName||"component"} above ${u.sourceComponentName||"component"}, close enough to read their shared divider tap. Preserve all connections and leave room for labels; exact alignment is not required.`})}isResistor(e){let t=this.index.components.get(e);return t?.ftype==="simple_resistor"&&Number.isFinite(t.resistance)&&t.resistance>0}getDownwardResistorPorts(e,t,n){let o=this.index,r=o.placement(e),i=o.portsByComponent.get(e);if(i.some((h)=>h.do_not_connect))return;let s=i.find((h)=>o.connected(h.source_port_id)===t),a=i.find((h)=>o.connected(h.source_port_id)===n);if(!s||!a)return;let c=o.port(s),l=o.port(a);if(!c||!l||c.schematic_sheet_id!==r.schematicSheetId||l.schematic_sheet_id!==r.schematicSheetId||c.facing_direction!=="up"||l.facing_direction!=="down"||c.center.y<=l.center.y)return;return{top:s,bottom:a}}static issueToString(e){let t=[];return sn(t,"supplyResistorName",e.supplyResistorSchematicBox.sourceComponentName),sn(t,"groundResistorName",e.groundResistorSchematicBox.sourceComponentName),sn(t,"reversedBodyGap",e.reversedBodyGap),sn(t,"message",e.message),`<VoltageDividerSupplyResistorBelowGroundResistor ${t.join(" ")} />`}},cYe=class extends co{constructor(e){super();this.params=e,this.index=new Cp(e.ctx),this.hostIds=[...this.index.components.values()].filter((t)=>t.ftype==="simple_chip").map((t)=>t.source_component_id),this.solved=this.hostIds.length===0}params;index;hostIds;currentIndex=0;_step(){let e=this.hostIds[this.currentIndex++];if(this.solved=this.currentIndex>=this.hostIds.length,!e)return;let t=this.index,n=t.placement(e),o=t.portsByComponent.get(e)??[];if(!n||o.some((I)=>!Lxe(I)))return;let r=o.filter((I)=>Lxe(I)==="input"),i=o.filter((I)=>Lxe(I)==="output"),s=o.filter((I)=>Lxe(I)==="ground");if(r.length!==1||i.length!==1||!s.length)return;let a=r[0],c=i[0];if([a,c,...s].some((I)=>I.do_not_connect))return;let l=t.connected(a.source_port_id),h=t.connected(c.source_port_id),d=new Set(s.map((I)=>t.connected(I.source_port_id)));if(d.size!==1)return;let u=[...d][0];if(new Set([l,h,u]).size!==3||!(t.groundNets.has(u)||s.some((I)=>I.requires_ground||I.provides_ground))||!(t.powerNets.has(l)||a.requires_power)||!(t.powerNets.has(h)||c.provides_power))return;let _=t.port(a),p=t.port(c);if(!_||!p||_.schematic_sheet_id!==n.schematicSheetId||p.schematic_sheet_id!==n.schematicSheetId)return;let m=_.facing_direction==="left"&&p.facing_direction==="right"||_.facing_direction==="right"&&p.facing_direction==="left",A=_.facing_direction==="up"&&p.facing_direction==="down"||_.facing_direction==="down"&&p.facing_direction==="up";if(!m&&!A)return;let g=p.facing_direction==="right"||p.facing_direction==="up"?1:-1;if(g*(m?p.center.x-_.center.x:p.center.y-_.center.y)<=0.01)return;let y=this.localCapacitor(n,l,u),x=this.localCapacitor(n,h,u);if(!y||!x)return;let C=(I,v)=>{let P=v*g*(m?I.schX-n.schX:I.schY-n.schY),M=m?(n.width+I.width)/2:(n.height+I.height)/2;return P>M+0.2};if(!C(y,1)||!C(x,-1))return;let b=n.sourceComponentName||"component";this.params.issues.push({lineItemType:"RegulatorCapacitorsOnWrongSides",regulatorSchematicBox:n,inputCapacitorSchematicBox:y,outputCapacitorSchematicBox:x,inputSourcePortId:a.source_port_id,outputSourcePortId:c.source_port_id,message:`Place ${y.sourceComponentName} near ${b}.${a.name} on the ${_.facing_direction} side and ${x.sourceComponentName} near ${b}.${c.name} on the ${p.facing_direction} side. Preserve all connections and leave room for labels; exact alignment is not required.`})}localCapacitor(e,t,n){let o=this.index,r=[],i=Math.max(6,4*Math.max(e.width,e.height)),s=new Set((o.portsByNet.get(t)??[]).map((a)=>a.source_component_id));for(let a of s){if(o.components.get(a)?.ftype!=="simple_capacitor")continue;let c=o.twoTerminalNets(a),l=o.placement(a);if(!c?.includes(n)||!l||!o.sameLocalScope(e,l))continue;if(Math.hypot(l.schX-e.schX,l.schY-e.schY)>i)continue;if(o.portsByComponent.get(a).some((d)=>d.do_not_connect||!o.port(d)||o.port(d).schematic_sheet_id!==e.schematicSheetId))continue;r.push(l)}return r.length===1?r[0]:void 0}static issueToString(e){let t=[];return sn(t,"regulatorName",e.regulatorSchematicBox.sourceComponentName),sn(t,"inputCapacitorName",e.inputCapacitorSchematicBox.sourceComponentName),sn(t,"outputCapacitorName",e.outputCapacitorSchematicBox.sourceComponentName),sn(t,"message",e.message),`<RegulatorCapacitorsOnWrongSides ${t.join(" ")} />`}};function Lxe(e){let t=new Set;for(let n of[e.name,...e.port_hints??[]]){let o=n.toUpperCase().replace(/[ _-]/g,"");if(/^(?:VIN|IN|INPUT)$/.test(o))t.add("input");else if(/^(?:VOUT|OUT|OUTPUT)$/.test(o))t.add("output");else if(/^(?:GND\d*|VSS)$/.test(o))t.add("ground");else if(/^(?:EN|ENABLE|CE|SHDN|NC\d*|EP|PAD|ADJ|FB|BYP|BYPASS|NR|PG|PGOOD)$/.test(o))t.add("control")}return t.size===1?[...t][0]:void 0}function XM(e,t,n,o){return{left:e-n/2,right:e+n/2,top:t+o/2,bottom:t-o/2}}function jxe(e,t){let n=Math.min(e.right,t.right)-Math.max(e.left,t.left),o=Math.min(e.top,t.top)-Math.max(e.bottom,t.bottom);return n>0&&o>0?{ow:n,oh:o}:null}var Pse=0.01,Dwt={right:{x:1,y:0},left:{x:-1,y:0},up:{x:0,y:1},down:{x:0,y:-1}},sg=(e,t)=>e.x*t.x+e.y*t.y,Ase=(e,t)=>Math.abs(e.x-t.x)+Math.abs(e.y-t.y),mR=(e,t)=>Ase(e,t)<=Pse,nK=(e)=>Math.round(e*100)/100,lYe=class extends co{constructor(e){super();this.params=e}params;_step(){let{ctx:e,issues:t}=this.params,n=new Cp(e);for(let r of n.portsByComponent.values())for(let i of r){let s=n.connected(i.source_port_id);if(i.requires_ground||i.provides_ground)n.groundNets.add(s);if(i.requires_power||i.provides_power)n.powerNets.add(s)}let o=e.circuitJson.filter((r)=>r.type==="schematic_trace");for(let[r,i]of n.components){if(i.ftype!=="simple_pin_header"&&i.ftype!=="simple_connector")continue;let s=n.placement(r),a=n.portsByComponent.get(r)??[];if(!s||a.length<2)continue;let c=a.map((V)=>n.port(V)),l=c[0]?.facing_direction;if(!l||c.some((V)=>!V||V.facing_direction!==l))continue;let h=Dwt[l],d={x:-h.y,y:h.x},u=o.filter((V)=>V.schematic_sheet_id===s.schematicSheetId),_=e.circuitJson.filter((V)=>V.type==="schematic_net_label"&&V.schematic_sheet_id===s.schematicSheetId),p=[],m=!1;for(let V of a){let O=n.port(V),U=n.connected(V.source_port_id),j=(n.portsByNet.get(U)??[]).filter((J)=>J.source_port_id!==V.source_port_id),Y=u.filter((J)=>J.edges.some((ee)=>mR(ee.from,O.center)||mR(ee.to,O.center)));if(n.isRail(U)){if(Y.some((J)=>!_.some((ee)=>ee.anchor_position&&Nwt(J,O.center,ee.anchor_position))))m=!0;continue}if(j.length===0){if(Y.length>0)m=!0;continue}let X=j.length===1?n.port(j[0]):void 0,K=j.length===1?n.placement(j[0].source_component_id):void 0;if(!X?.facing_direction||!K||!n.sameLocalScope(s,K)||sg(Dwt[X.facing_direction],h)!==-1){m=!0;break}p.push({pin:O,peer:X,component:K})}if(m||p.length<2)continue;if(p.some((V)=>sg(V.peer.center,h)>=sg(V.pin.center,h)-2))continue;let A=p.map((V)=>u.filter((O)=>Nwt(O,V.pin.center,V.peer.center)&&TYo(O)>=3)).filter((V)=>V.length>0);if(A.length<2)continue;let g=A.flat(),f=[...p].sort((V,O)=>sg(V.pin.center,d)-sg(O.pin.center,d));if(f.some((V,O)=>O>0&&sg(V.peer.center,d)<=sg(f[O-1].peer.center,d)+Pse))continue;let y={x:s.schX,y:s.schY},x=Math.max(...p.map((V)=>sg(V.pin.center,h)-sg(y,h))),C=Math.min(...p.map((V)=>sg(V.peer.center,h)))-2-x,b=p.map((V)=>sg(V.peer.center,d)-sg(V.pin.center,d)+sg(y,d)).sort((V,O)=>V-O),I=b[Math.floor(b.length/2)],v={x:nK(h.x*C+d.x*I),y:nK(h.y*C+d.y*I)},P={x:v.x-y.x,y:v.y-y.y},M=(V)=>({x:V.center.x+P.x,y:V.center.y+P.y});if(p.some((V)=>Ase(M(V.pin),V.peer.center)>Ase(V.pin.center,V.peer.center)+Pse))continue;let B=p.reduce((V,O)=>V+Ase(O.pin.center,O.peer.center),0),T=p.reduce((V,O)=>V+Ase(M(O.pin),O.peer.center),0);if(B-T<4||T>B*0.75)continue;let N=e.componentPlacements.filter((V)=>V.schematicSheetId===s.schematicSheetId&&V.schematicComponentId!==s.schematicComponentId),D=XM(v.x,v.y,s.width+0.4,s.height+0.4);if(N.some((V)=>jxe(D,XM(V.schX,V.schY,V.width,V.height))))continue;if(p.some((V)=>{let O=M(V.pin),U=V.peer.center,j=(sg(O,h)+sg(U,h))/2,Y=[O,{x:h.x*j+d.x*sg(O,d),y:h.y*j+d.y*sg(O,d)},{x:h.x*j+d.x*sg(U,d),y:h.y*j+d.y*sg(U,d)},U];return N.some((X)=>X.schematicComponentId!==V.component.schematicComponentId&&Y.slice(1).some((K,J)=>DYo(Y[J],K,X)))}))continue;let L=[...new Map(p.map((V)=>[V.component.schematicComponentId,V.component])).values()],H=s.sourceComponentName||"component";t.push({lineItemType:"ConnectorPositionCausesTraceDetours",connectorSchematicBox:s,connectedComponents:L,schematicTraceIds:[...new Set(g.map((V)=>V.schematic_trace_id))],evaluatedSignalCount:p.length,newSchX:v.x,newSchY:v.y,deltaSchX:nK(P.x),deltaSchY:nK(P.y),currentTotalSignalDistance:nK(B),suggestedTotalSignalDistance:nK(T),message:`Move ${H} to schX=${v.x}, schY=${v.y} so its signal pins face ${L.map((V)=>V.sourceComponentName||"component").join(", ")}. Preserve rotation and pin assignments; reroute the connections and attached rail labels.`})}this.solved=!0}static issueToString(e){let t=[];sn(t,"connectorComponentName",e.connectorSchematicBox.sourceComponentName),sn(t,"connectedComponents",e.connectedComponents.map((n)=>n.sourceComponentName||"component").join(","));for(let n of["evaluatedSignalCount","newSchX","newSchY","deltaSchX","deltaSchY","currentTotalSignalDistance","suggestedTotalSignalDistance"])sn(t,n,e[n]);return sn(t,"message",e.message),`<ConnectorPositionCausesTraceDetours ${t.join(" ")} />`}};function Nwt(e,t,n){let o=e.edges[0]?.from,r=e.edges.at(-1)?.to;return!!o&&!!r&&(mR(o,t)&&mR(r,n)||mR(o,n)&&mR(r,t))}function TYo(e){let t,n=0;for(let o=0;o<e.edges.length;o++){let r=e.edges[o];if(o>0&&!mR(e.edges[o-1].to,r.from))return 0;if(mR(r.from,r.to))continue;let i=Math.abs(r.from.y-r.to.y)<Pse?"x":Math.abs(r.from.x-r.to.x)<Pse?"y":void 0;if(!i)return 0;if(t&&t!==i)n++;t=i}return n}function DYo(e,t,n){let o=XM(n.schX,n.schY,n.width+0.2,n.height+0.2);return Math.max(e.x,t.x)>o.left&&Math.min(e.x,t.x)<o.right&&Math.max(e.y,t.y)>o.bottom&&Math.min(e.y,t.y)<o.top}var hYe=class extends co{index;positiveNets=new Set;transistorIds;issues;currentIndex=0;constructor({ctx:e,issues:t}){super();this.issues=t,this.index=new Cp(e);for(let n of e.circuitJson)if(n.type==="source_net"&&n.is_positive_voltage_source)this.positiveNets.add(this.index.connected(n.source_net_id));this.transistorIds=[...this.index.components.values()].filter((n)=>n.ftype==="simple_transistor"&&n.transistor_type==="npn").map((n)=>n.source_component_id),this.solved=this.transistorIds.length===0}_step(){let e=this.transistorIds[this.currentIndex++];if(this.solved=this.currentIndex>=this.transistorIds.length,!e)return;let t=this.index,n=t.placement(e);if(!n||t.portsByComponent.get(e)?.length!==3)return;let o=t.namedPort(e,"base"),r=t.namedPort(e,"collector"),i=t.namedPort(e,"emitter");if(!o||!r||!i)return;let s=t.connected(o.source_port_id),a=t.connected(r.source_port_id),c=t.connected(i.source_port_id);if(new Set([s,a,c]).size!==3||!t.groundNets.has(c)||t.powerNets.has(c)||t.isRail(s)||t.isRail(a))return;let l=(t.portsByNet.get(s)??[]).filter((O)=>O.source_component_id!==e);if(l.length!==1)return;let h=l[0].source_component_id,d=t.components.get(h),u=t.placement(h),p=t.twoTerminalNets(h)?.find((O)=>O!==s);if(d?.ftype!=="simple_resistor"||d.resistance<=0||!u||!t.sameLocalScope(n,u)||!p||t.isRail(p)||p===a)return;let m=(t.portsByNet.get(a)??[]).filter((O)=>O.source_component_id!==e),A=m.filter((O)=>t.components.get(O.source_component_id)?.ftype==="simple_chip");if(A.length!==1)return;let g=A[0].source_component_id,f=t.placement(g),x=t.twoTerminalNets(g)?.find((O)=>O!==a);if(!f||!t.sameLocalScope(n,f)||!x||!this.positiveNets.has(x)||t.groundNets.has(x))return;let C=m.filter((O)=>O.source_component_id!==g);if(C.length!==1)return;let b=C[0].source_component_id,I=t.placement(b),v=t.namedPort(b,"anode"),P=t.namedPort(b,"cathode");if(t.components.get(b)?.ftype!=="simple_diode"||!t.twoTerminalNets(b)||!v||!P||t.connected(v.source_port_id)!==a||t.connected(P.source_port_id)!==x||!I||!t.sameLocalScope(n,I))return;let M=t.port(r),B=t.port(i),T=t.port(o);if(!M||!B||!T)return;let N=M.facing_direction,D=B.facing_direction;if(!N||!D)return;let L=[];if(n.schY>=f.schY)L.push("transistor_not_below_load");if(N!=="up")L.push("collector_not_up");if(D!=="down")L.push("emitter_not_down");if(L.length===0)return;let H=n.sourceComponentName||"component",V=f.sourceComponentName||"component";this.issues.push({lineItemType:"LowSideTransistorNotAlignedWithLoad",transistorSchematicBox:n,loadSchematicBox:f,baseResistorSchematicBox:u,clampDiodeSchematicBox:I,collectorSourcePortId:r.source_port_id,emitterSourcePortId:i.source_port_id,collectorFacingDirection:N,emitterFacingDirection:D,placementProblems:L,message:`Arrange ${H} below ${V}, with its collector facing up toward the load and emitter facing down toward ground; place ${u.sourceComponentName||"component"} beside the base. Preserve all pin connections and reroute affected traces.`})}static issueToString(e){let t=[];return sn(t,"transistorName",e.transistorSchematicBox.sourceComponentName),sn(t,"loadName",e.loadSchematicBox.sourceComponentName),sn(t,"baseResistorName",e.baseResistorSchematicBox.sourceComponentName),sn(t,"clampDiodeName",e.clampDiodeSchematicBox.sourceComponentName),sn(t,"placementProblems",e.placementProblems.join(",")),sn(t,"collectorFacingDirection",e.collectorFacingDirection),sn(t,"emitterFacingDirection",e.emitterFacingDirection),sn(t,"message",e.message),`<LowSideTransistorNotAlignedWithLoad ${t.join(" ")} />`}},dYe=class extends co{constructor(e){super();this.params=e,this.index=new Cp(e.ctx),this.hostIds=[...this.index.components.values()].filter((t)=>t.ftype==="simple_chip").map((t)=>t.source_component_id),this.solved=this.hostIds.length===0}params;index;hostIds;reportedPairs=new Set;currentIndex=0;_step(){let e=this.hostIds[this.currentIndex++];if(this.solved=this.currentIndex>=this.hostIds.length,!e)return;let t=this.index.portsByComponent.get(e)??[],n=t.filter((C)=>Rwt(C)==="positive"),o=t.filter((C)=>Rwt(C)==="negative");if(n.length!==1||o.length!==1)return;let r=n[0],i=o[0],s=this.seriesResistor(r),a=this.seriesResistor(i);if(!s||!a||s.axis!==a.axis||!this.index.sameLocalScope(s.placement,a.placement)||new Set([s.hostNet,a.hostNet,s.interfaceNet,a.interfaceNet]).size!==4||!this.shareInterface(s,a,e))return;let c=[s.id,a.id].sort().join("\x00");if(this.reportedPairs.has(c))return;let l=s.placement,h=a.placement,d=s.axis==="horizontal",u=Math.abs(d?l.schX-h.schX:l.schY-h.schY),_=Math.abs(d?l.schY-h.schY:l.schX-h.schX),p=d?l.width:l.height,m=d?h.width:h.height,A=d?l.height:l.width,g=d?h.height:h.width;if(u-(p+m)/2<Math.max(p,m)||_>=(A+g)/2-0.01)return;this.reportedPairs.add(c);let y=l.sourceComponentName||"component",x=h.sourceComponentName||"component";this.params.issues.push({lineItemType:"UsbSeriesResistorsNotAligned",positiveResistorSchematicBox:l,negativeResistorSchematicBox:h,hostSourceComponentId:e,positiveSourcePortId:r.source_port_id,negativeSourcePortId:i.source_port_id,signalAxis:s.axis,message:`Place ${y} (D+) and ${x} (D−) near each other and draw clear traces to their corresponding USB ports. Exact alignment is not required; preserve pin assignments and leave space for labels.`})}seriesResistor(e){let t=this.index,n=t.connected(e.source_port_id);if(t.isRail(n))return;let o=new Set((t.portsByNet.get(n)??[]).filter((_)=>t.components.get(_.source_component_id)?.ftype==="simple_resistor").map((_)=>_.source_component_id));if(o.size!==1)return;let r=[...o][0],s=t.twoTerminalNets(r)?.find((_)=>_!==n),a=t.placement(r);if(!s||t.isRail(s)||!a)return;if((t.portsByNet.get(s)??[]).some((_)=>_.source_component_id!==r&&t.components.get(_.source_component_id)?.ftype==="simple_resistor"))return;let c=t.portsByComponent.get(r).map((_)=>t.port(_)),[l,h]=c;if(!l||!h)return;let d=new Set([l.facing_direction,h.facing_direction]),u;if(d.has("left")&&d.has("right")&&Math.abs(l.center.y-h.center.y)<0.01)u="horizontal";else if(d.has("up")&&d.has("down")&&Math.abs(l.center.x-h.center.x)<0.01)u="vertical";else return;return{id:r,placement:a,hostNet:n,interfaceNet:s,axis:u}}shareInterface(e,t,n){let o=(i)=>new Set((this.index.portsByNet.get(i)??[]).map((s)=>s.source_component_id).filter((s)=>s!==n&&s!==e.id&&s!==t.id&&(this.index.portsByComponent.get(s)?.length??0)>2)),r=o(e.interfaceNet);return[...o(t.interfaceNet)].some((i)=>r.has(i))}static issueToString(e){let t=[];return sn(t,"positiveResistorName",e.positiveResistorSchematicBox.sourceComponentName),sn(t,"negativeResistorName",e.negativeResistorSchematicBox.sourceComponentName),sn(t,"signalAxis",e.signalAxis),sn(t,"message",e.message),`<UsbSeriesResistorsNotAligned ${t.join(" ")} />`}};function Rwt(e){let t=new Set;for(let n of[e.name,...e.port_hints??[]]){let o=n.toUpperCase();if(/^(?:USB_?)?D(?:P|\+|_POS)$/.test(o))t.add("positive");if(/^(?:USB_?)?D(?:M|N|-|_NEG)$/.test(o))t.add("negative")}return t.size===1?[...t][0]:void 0}function NYo(e){return e.filter((t)=>t!==void 0).reduce((t,n)=>WC(t,n),{})}function RYo(e,t,n){return{rects:[{center:{x:e.schX,y:e.schY},width:e.width,height:e.height,stroke:t,fill:t.replace("0.95","0.15"),label:n}]}}function QYo(e){return{rects:e.filter((n)=>n.type==="schematic_box").map((n)=>{let o=n;return{center:{x:o.x,y:o.y},width:o.width,height:o.height,stroke:"hsl(0,0%,60%)"}})}}var uYe=class e extends co{static EPSILON=0.01;static ORIENTATION_MESSAGE='Use schOrientation="vertical" on this capacitor to fix the symbol orientation';ctx;out;schematicComponentById;sourceComponentById;capacitorPlacements;feedbackCapacitorIds;currentPlacementIndex=0;horizontalSymbolNames=new Set(["capacitor_left","capacitor_right"]);constructor({ctx:t,issues:n}){super();this.ctx=t,this.out=n,this.schematicComponentById=this.buildSchematicComponentById(t.circuitJson),this.sourceComponentById=this.buildSourceComponentById(t.circuitJson),this.capacitorPlacements=this.getCapacitorPlacements();let o=new Cp(t);this.feedbackCapacitorIds=new Set(this.capacitorPlacements.flatMap((r)=>r.sourceComponentId&&o.isDirectOpAmpFeedback(r.sourceComponentId)?[r.sourceComponentId]:[])),this.solved=this.capacitorPlacements.length===0}getCapacitorPlacements(){return this.ctx.componentPlacements.filter((t)=>t.sourceComponentId!==void 0&&this.sourceComponentById.get(t.sourceComponentId)?.ftype==="simple_capacitor").map((t)=>({schX:t.schX,schY:t.schY,width:t.width,height:t.height,sourceComponentId:t.sourceComponentId,sourceComponentName:t.sourceComponentName,schematicComponentId:t.schematicComponentId,schematicSheetId:t.schematicSheetId,schematicSheetName:t.schematicSheetName}))}_step(){let t=this.capacitorPlacements[this.currentPlacementIndex];if(!t){this.solved=!0;return}this.currentPlacementIndex+=1,this.solved=this.currentPlacementIndex>=this.capacitorPlacements.length;let n=this.getIssueForPlacement(t);if(n)this.out.push(n)}visualize(){let t=this.getFocusedPlacement();return NYo([QYo(this.ctx.circuitJson),t?RYo(t,"hsl(210, 100%, 50%, 0.95)","capacitorOrientation"):void 0])}getFocusedPlacement(){if(this.capacitorPlacements.length===0)return;let t=this.iterations===0?this.currentPlacementIndex:Math.max(0,this.currentPlacementIndex-1);return this.capacitorPlacements[t]}buildSchematicComponentById(t){return new Map(t.filter((n)=>n.type==="schematic_component").map((n)=>[n.schematic_component_id,n]))}buildSourceComponentById(t){return new Map(t.flatMap((n)=>{if(n.type!=="source_component"||!("source_component_id"in n)||typeof n.source_component_id!=="string")return[];return[{type:"source_component",source_component_id:n.source_component_id,ftype:"ftype"in n&&typeof n.ftype==="string"?n.ftype:void 0}]}).map((n)=>[n.source_component_id,n]))}createIssuePlacement(t){return{positionAnchor:"center",schX:t.schX,schY:t.schY,width:t.width,height:t.height,sourceComponentId:t.sourceComponentId,sourceComponentName:t.sourceComponentName,schematicComponentId:t.schematicComponentId,schematicSheetId:t.schematicSheetId,schematicSheetName:t.schematicSheetName}}getIssueForPlacement(t){if(!t.schematicComponentId||!t.sourceComponentId)return;let n=this.schematicComponentById.get(t.schematicComponentId);if(!n)return;if(!this.horizontalSymbolNames.has(n.symbol_name??""))return;if(this.feedbackCapacitorIds.has(t.sourceComponentId))return;if(this.isInlineWithHorizontalTraces(t.schematicComponentId))return;return{lineItemType:"CapacitorSymbolHorizontal",schematicBox:this.createIssuePlacement(t),message:e.ORIENTATION_MESSAGE}}isInlineWithHorizontalTraces(t){let n=this.ctx.circuitJson.filter((r)=>r.type==="schematic_port"&&r.schematic_component_id===t);if(n.length!==2)return!1;let o=n.map((r)=>this.getOutwardHorizontalTrace(r));return o.every((r)=>r!==void 0)&&o.some((r)=>r!==void 0&&r.edges.every((i)=>Math.abs(i.from.y-i.to.y)<=e.EPSILON))}getOutwardHorizontalTrace(t){if(t.facing_direction!=="left"&&t.facing_direction!=="right")return;return this.ctx.circuitJson.find((n)=>n.type==="schematic_trace"&&n.schematic_sheet_id===t.schematic_sheet_id&&n.edges.some((o)=>{let r=this.pointsEqual(o.from,t.center)?o.to:this.pointsEqual(o.to,t.center)?o.from:void 0;return r!==void 0&&Math.abs(r.y-t.center.y)<=e.EPSILON&&(t.facing_direction==="left"?r.x<t.center.x-e.EPSILON:r.x>t.center.x+e.EPSILON)}))}pointsEqual(t,n){return Math.abs(t.x-n.x)<=e.EPSILON&&Math.abs(t.y-n.y)<=e.EPSILON}static issueToString(t){let n=[];return sn(n,"componentName",t.schematicBox.sourceComponentName),sn(n,"schX",t.schematicBox.schX),sn(n,"schY",t.schematicBox.schY),sn(n,"width",t.schematicBox.width),sn(n,"height",t.schematicBox.height),sn(n,"message",t.message),`<CapacitorSymbolHorizontal ${n.join(" ")} />`}},pYe=class e extends co{constructor(t){super();this.params=t;let n=new Cp(t.ctx),o=new Set(n.powerNets),r=new Set(n.groundNets);for(let i of t.ctx.circuitJson)if(i.type==="source_net"){let s=n.connected(i.source_net_id);if(!this.netNames.has(s))this.netNames.set(s,i.name)}for(let i of n.portsByComponent.values())for(let s of i){if(s.do_not_connect)continue;let a=n.connected(s.source_port_id);if(s.provides_power||s.requires_power)o.add(a);if(s.provides_ground||s.requires_ground)r.add(a);if((o.has(a)||r.has(a))&&!this.netNames.has(a))this.netNames.set(a,s.name)}for(let i of n.components.values()){if(i.ftype!=="simple_capacitor")continue;let s=i.source_component_id,a=n.placement(s),c=n.twoTerminalNets(s),l=n.portsByComponent.get(s);if(!a||!c||!l||l.some((_)=>{let p=n.port(_);return _.do_not_connect||!p||p.schematic_sheet_id!==a.schematicSheetId}))continue;let h=c.find((_)=>o.has(_)&&!r.has(_)),d=c.find((_)=>r.has(_)&&!o.has(_));if(!h||!d)continue;let u=this.banks.find((_)=>_.power===h&&_.ground===d&&n.sameLocalScope(_.capacitors[0],a));if(u)u.capacitors.push(a);else this.banks.push({power:h,ground:d,capacitors:[a]})}this.solved=this.banks.length===0}params;static MIN_BODY_GAP=1;banks=[];netNames=new Map;bankIndex=0;_step(){let t=this.banks[this.bankIndex++];if(this.solved=this.bankIndex>=this.banks.length,t.capacitors.length<2)return;let n=Math.max(e.MIN_BODY_GAP,...t.capacitors.map((a)=>Math.max(a.width,a.height))),o=0,r=t.capacitors.slice(1).map((a)=>({box:a,gap:e.bodyGap(t.capacitors[0],a)}));while(r.length>0){let a=0;for(let l=1;l<r.length;l++)if(r[l].gap<r[a].gap)a=l;let c=r.splice(a,1)[0];o=Math.max(o,c.gap);for(let l of r)l.gap=Math.min(l.gap,e.bodyGap(c.box,l.box))}if(o<=n+0.000001)return;let i=this.netNames.get(t.power)??"power",s=this.netNames.get(t.ground)??"ground";this.params.issues.push({lineItemType:"DecouplingCapacitorsNotCloseTogether",railName:i,groundName:s,capacitorSchematicBoxes:t.capacitors,maxBodyGap:o,maxRecommendedBodyGap:n,message:`Group the decoupling capacitors between ${i} and ${s} closer together in this schematic block. Preserve their net connections.`})}static bodyGap(t,n){return Math.hypot(Math.max(0,Math.abs(t.schX-n.schX)-(t.width+n.width)/2),Math.max(0,Math.abs(t.schY-n.schY)-(t.height+n.height)/2))}static issueToString(t){let n=[];return sn(n,"rail",t.railName),sn(n,"ground",t.groundName),sn(n,"capacitorNames",t.capacitorSchematicBoxes.map((o)=>o.sourceComponentName||"component").join(", ")),sn(n,"maxBodyGap",t.maxBodyGap),sn(n,"maxRecommendedBodyGap",t.maxRecommendedBodyGap),sn(n,"message",t.message),`<DecouplingCapacitorsNotCloseTogether ${n.join(" ")} />`}};function Vxe(e){let t=e.anchor_side;if(t==="top"||t==="bottom"){let c=e.anchor_position?.y??e.center.y,l=(e.text?.length??8)*0.13/2+0.1,h=e.center.x-0.1,d=e.center.x+0.1;if(t==="top")return{left:h,right:d,top:c,bottom:c-l*2};return{left:h,right:d,top:c+l*2,bottom:c}}let o=e.anchor_position?.x??e.center.x,i=Math.abs(e.center.x-o)+0.1,s=e.center.y+0.1,a=e.center.y-0.1;if(e.center.x>=o)return{left:o,right:e.center.x+i,top:s,bottom:a};return{left:e.center.x-i,right:o,top:s,bottom:a}}var Cse=class extends co{constructor(e){super();this.params=e,this.placements=e.ctx.componentPlacements,this.netLabelsByComponentId=this.buildNetLabelsByComponentId(e.ctx.circuitJson),this.solved=this.placements.length<2}params;placements;netLabelsByComponentId;rawCollisions=[];firstIndex=0;secondIndex=1;_step(){if(this.firstIndex>=this.placements.length-1){this.buildAndPushIssues(),this.solved=!0;return}let e=this.placements[this.firstIndex],t=this.placements[this.secondIndex];if(this.detectPair(e,t),this.secondIndex++,this.secondIndex>=this.placements.length)this.firstIndex++,this.secondIndex=this.firstIndex+1}detectPair(e,t){if(e.schematicSheetId!==t.schematicSheetId)return;this.rawCollisions.push(...this.detectLabelLabel(e,t)),this.rawCollisions.push(...this.detectBoxLabel(e,t)),this.rawCollisions.push(...this.detectBoxLabel(t,e))}detectLabelLabel(e,t){let n=e,o=t;if(e.schX>t.schX)n=t,o=e;let r=n.schematicComponentId,i=o.schematicComponentId;if(!r||!i)return[];let s=this.netLabelsByComponentId.get(r)??[],a=this.netLabelsByComponentId.get(i)??[];if(s.length===0||a.length===0)return[];let c=[];for(let l of s)for(let h of a){let d=Vxe(l),u=Vxe(h);if(jxe(d,u))c.push({type:"label-label",bounds:{left:Math.max(d.left,u.left),right:Math.min(d.right,u.right),top:Math.min(d.top,u.top),bottom:Math.max(d.bottom,u.bottom)},leftComp:n,rightComp:o,leftId:r,rightId:i,xSeparation:d.right-u.left+0.1})}return c}detectBoxLabel(e,t){let n=e.schematicComponentId,o=t.schematicComponentId;if(!n||!o)return[];let r=this.netLabelsByComponentId.get(o)??[];if(r.length===0)return[];let i=XM(e.schX,e.schY,e.width,e.height),s=e.schX<=t.schX,a=[];for(let c of r){let l=Vxe(c);if(!jxe(i,l))continue;let h;if(s)h=i.right-l.left+0.1;else h=l.right-i.left+0.1;a.push({type:"box-label",bounds:{left:Math.max(i.left,l.left),right:Math.min(i.right,l.right),top:Math.min(i.top,l.top),bottom:Math.max(i.bottom,l.bottom)},boxComp:e,labelComp:t,boxId:n,labelId:o,xSeparation:h})}return a}buildAndPushIssues(){if(this.rawCollisions.length===0)return;let e=new Map;for(let t of this.rawCollisions){let o=(t.type==="label-label"?t.leftComp:t.boxComp).schematicSheetId??"",r=e.get(o);if(r)r.push(t);else e.set(o,[t])}for(let t of e.values())this.buildAndPushIssueForSheet(t)}buildAndPushIssueForSheet(e){let t=this.computeGlobalFixes(e);if(t.size===0)return;let n=new Set,o=[];for(let s of e){let a,c;if(s.type==="label-label")a=s.leftComp.sourceComponentName??"",c=s.rightComp.sourceComponentName??"";else a=s.boxComp.sourceComponentName??"",c=s.labelComp.sourceComponentName??"";let l=`${a}/${c}`;if(!n.has(l))n.add(l),o.push({comp1Name:a,comp2Name:c})}let r=e[0],i=r.type==="label-label"?r.leftComp:r.boxComp;this.params.issues.push({lineItemType:"NetLabelCollision",schematicSheetId:i.schematicSheetId,schematicSheetName:i.schematicSheetName,pairs:o,collisionBounds:e.map((s)=>s.bounds),moves:Array.from(t.values())})}computeGlobalFixes(e){let t=new Map;for(let l of this.placements)if(l.schematicComponentId)t.set(l.schematicComponentId,l);let n=new Map,o=(l,h,d)=>{let u=t.get(l),_=t.get(h);if(!u||!_)return;let p=_.schX-u.schX+d,m=`${l}|${h}`;n.set(m,Math.max(n.get(m)??0,p))};for(let l of e)if(l.type==="label-label")o(l.leftId,l.rightId,l.xSeparation);else if(l.boxComp.schX<=l.labelComp.schX)o(l.boxId,l.labelId,l.xSeparation);else o(l.labelId,l.boxId,l.xSeparation);let r=[...n.entries()].map(([l,h])=>{let d=l.indexOf("|");return{leftId:l.slice(0,d),rightId:l.slice(d+1),minSep:h}}),i=new Set,s=new Map;for(let{leftId:l,rightId:h}of r){if(i.add(l),i.add(h),!s.has(l))s.set(l,new Set);if(!s.has(h))s.set(h,new Set);s.get(l).add(h),s.get(h).add(l)}let a=new Set,c=new Map;for(let l of i){if(a.has(l))continue;let h=[],d=[l];a.add(l);while(d.length){let A=d.shift();h.push(A);for(let g of s.get(A)??[])if(!a.has(g))a.add(g),d.push(g)}h.sort((A,g)=>(t.get(A)?.schX??0)-(t.get(g)?.schX??0));let u=new Set(h),_=r.filter((A)=>u.has(A.leftId)&&u.has(A.rightId)),p=new Map;for(let A of h){let g=t.get(A)?.schX??0;for(let{leftId:f,rightId:y,minSep:x}of _)if(y===A&&p.has(f))g=Math.max(g,p.get(f)+x);p.set(A,g)}let m=[...p.entries()].reduce((A,[g,f])=>A+(f-(t.get(g)?.schX??0)),0);if(m>0.000000001){let A=m/h.length,g=new Map;for(let y of h){let x=(t.get(y)?.schX??0)-A;for(let{leftId:C,rightId:b,minSep:I}of _)if(b===y&&g.has(C))x=Math.max(x,g.get(C)+I);g.set(y,x)}let f=(y)=>[...y.entries()].reduce((x,[C,b])=>Math.max(x,Math.abs(b-(t.get(C)?.schX??0))),0);if(f(g)<f(p))for(let[y,x]of g)p.set(y,x)}for(let[A,g]of p){let f=t.get(A);if(!f||Math.abs(g-f.schX)<0.000000001)continue;c.set(A,{componentName:f.sourceComponentName||"component",newSchX:Math.round(g*100)/100,newSchY:Math.round(f.schY*100)/100})}}return c}buildNetLabelsByComponentId(e){let n=[];for(let r of e){if(r.type!=="schematic_port")continue;let i=r;if(!i.schematic_component_id)continue;n.push({componentId:i.schematic_component_id,cx:i.center.x,cy:i.center.y,schematicSheetId:i.schematic_sheet_id})}let o=new Map;for(let r of e){if(r.type!=="schematic_net_label")continue;let i=r;if(!i.anchor_position)continue;let{x:s,y:a}=i.anchor_position,c=n.filter((u)=>u.schematicSheetId===i.schematic_sheet_id&&Math.hypot(u.cx-s,u.cy-a)<0.0001);if(c.length===0)continue;if(new Set(c.map((u)=>u.componentId)).size!==1)continue;let h=c[0].componentId,d=o.get(h)??[];d.push(i),o.set(h,d)}return o}static netLabelCollisionToString(e){let t=e.pairs.map((o,r)=>`pair${r+1}="${o.comp1Name}/${o.comp2Name}"`).join(" "),n=e.moves.map((o)=>`    <Move componentName="${o.componentName}" newSchX="${o.newSchX}" newSchY="${o.newSchY}" />`);return[`<ComponentNetLabelCollision ${t}>`,'  <SuggestedFix note="Apply all moves simultaneously. Set schAutoLayoutEnabled on your circuit.">',...n,"  </SuggestedFix>","</ComponentNetLabelCollision>"].join(`
`)}};var mYe=class e extends co{static ALIGNMENT_EPSILON=0.01;ctx;out;constructor({ctx:t,issues:n}){super();this.ctx=t,this.out=n}_step(){let t=new Map(this.ctx.circuitJson.filter((r)=>r.type==="schematic_port").map((r)=>[r.schematic_port_id,r])),n=new Map(this.ctx.componentPlacements.flatMap((r)=>r.schematicComponentId?[[r.schematicComponentId,r]]:[])),o=new Map;for(let r of this.ctx.circuitJson.filter((i)=>i.type==="schematic_trace")){let i=this.getTracePinPair(r,t);if(!i)continue;let s=i.firstPort.schematic_component_id,a=i.secondPort.schematic_component_id;if(!s||!a||s===a)continue;let c=s<a?i:{firstPort:i.secondPort,secondPort:i.firstPort},l=[s,a].sort().join("\x00"),h=o.get(l)??[];if(!h.some((u)=>u.firstPort.schematic_port_id===c.firstPort.schematic_port_id&&u.secondPort.schematic_port_id===c.secondPort.schematic_port_id))h.push(c);o.set(l,h)}for(let r of o.values()){let i=this.findVerticalShiftIssue(r,n);if(i)this.out.push(i)}this.solved=!0}getTracePinPair(t,n){let o=t.edges?.[0],r=t.edges?.at(-1);if(!o||!r)return;let i=o.from_schematic_port_id??o.to_schematic_port_id,s=r.to_schematic_port_id??r.from_schematic_port_id,a=[...n.values()],c=i?n.get(i):this.findPortAtPoint(a,o.from,t.schematic_sheet_id),l=s?n.get(s):this.findPortAtPoint(a,r.to,t.schematic_sheet_id);if(!c||!l)return;if(c.schematic_port_id===l.schematic_port_id)return;if(c.schematic_sheet_id!==l.schematic_sheet_id)return;return{firstPort:c,secondPort:l}}findPortAtPoint(t,n,o){let{ALIGNMENT_EPSILON:r}=e;return t.find((i)=>i.schematic_sheet_id===o&&Math.abs(i.center.x-n.x)<=r&&Math.abs(i.center.y-n.y)<=r)}findVerticalShiftIssue(t,n){let o=t[0];if(!o)return;let r=n.get(o.firstPort.schematic_component_id),i=n.get(o.secondPort.schematic_component_id);if(!r||!i)return;let[s,a]=r.schX<=i.schX?[r,i]:[i,r],c=t.flatMap((A)=>{let[g,f]=A.firstPort.center.x<=A.secondPort.center.x?[A.firstPort,A.secondPort]:[A.secondPort,A.firstPort];return g.facing_direction==="right"&&f.facing_direction==="left"?[{leftPort:g,rightPort:f}]:[]});if(c.length<2)return;let{ALIGNMENT_EPSILON:l}=e,h=c.filter(({leftPort:A,rightPort:g})=>Math.abs(A.center.y-g.center.y)<=l).length,d=[];for(let A of c){let g=A.leftPort.center.y-A.rightPort.center.y;if(Math.abs(g)<=l)continue;let f=d.find((y)=>Math.abs(y.deltaSchY-g)<=l);if(f)f.pairs.push(A);else d.push({deltaSchY:g,pairs:[A]})}let u=d.sort((A,g)=>g.pairs.length-A.pairs.length||Math.abs(A.deltaSchY)-Math.abs(g.deltaSchY))[0];if(!u||u.pairs.length<2||u.pairs.length<=h)return;let _=a.sourceComponentName||"component",p=u.deltaSchY,m=a.schY+p;return{lineItemType:"ComponentPinsWouldAlignWithVerticalShift",firstComponent:s,secondComponent:a,targetComponent:a,deltaSchY:p,newSchY:m,currentlyAlignedPinCount:h,alignedPinCount:u.pairs.length,alignedPinPairs:u.pairs.map(({leftPort:A,rightPort:g})=>({firstPin:this.getPinLabel(A),secondPin:this.getPinLabel(g)})),message:`shift ${_} vertically by ${bBt(p)} to align ${u.pairs.length} connected pin pairs`}}getPinLabel(t){return t.display_pin_label??t.pin_number?.toString()}static issueToString(t){let n=[];return sn(n,"firstComponentName",t.firstComponent.sourceComponentName),sn(n,"secondComponentName",t.secondComponent.sourceComponentName),sn(n,"targetComponentName",t.targetComponent.sourceComponentName),sn(n,"deltaSchY",t.deltaSchY),sn(n,"newSchY",t.newSchY),sn(n,"currentlyAlignedPinCount",t.currentlyAlignedPinCount),sn(n,"alignedPinCount",t.alignedPinCount),sn(n,"message",t.message),`<ComponentPinsWouldAlignWithVerticalShift ${n.join(" ")} />`}},_Ye=class e extends co{static ALIGNMENT_TOLERANCE=0.1;issues;networks;currentNetworkIndex=0;constructor({ctx:t,issues:n}){super();this.issues=n,this.networks=this.findCrystalLoadNetworks(t),this.solved=this.networks.length===0}_step(){let t=this.networks[this.currentNetworkIndex];if(!t){this.solved=!0;return}this.currentNetworkIndex+=1,this.solved=this.currentNetworkIndex>=this.networks.length;let n=Hxe(t.newSchX-t.crystal.schX),o=Hxe(t.newSchY-t.crystal.schY);if(Math.abs(n)<=e.ALIGNMENT_TOLERANCE&&Math.abs(o)<=e.ALIGNMENT_TOLERANCE)return;let r=t.crystal.sourceComponentName??"the crystal",i=t.firstLoadCapacitor.sourceComponentName??"the first load capacitor",s=t.secondLoadCapacitor.sourceComponentName??"the second load capacitor";this.issues.push({lineItemType:"CrystalNotCenteredOverLoadCapacitors",crystalSchematicBox:t.crystal,firstLoadCapacitorSchematicBox:t.firstLoadCapacitor,secondLoadCapacitorSchematicBox:t.secondLoadCapacitor,deltaSchX:n,deltaSchY:o,newSchX:t.newSchX,newSchY:t.newSchY,message:`move ${r} to schX=${t.newSchX}, schY=${t.newSchY} so it is centered between ${i} and ${s} and aligned with their load-side pins`})}findCrystalLoadNetworks(t){let n=new Map,o=new Map,r=new Map,i=new Map(t.componentPlacements.flatMap((c)=>c.sourceComponentId?[[c.sourceComponentId,c]]:[]));for(let c of t.circuitJson){if(c.type==="source_component")n.set(c.source_component_id,{sourceComponentId:c.source_component_id,ftype:"ftype"in c&&typeof c.ftype==="string"?c.ftype:void 0});if(c.type==="source_port"&&typeof c.source_component_id==="string"&&typeof c.subcircuit_connectivity_map_key==="string"){let l={sourcePortId:c.source_port_id,sourceComponentId:c.source_component_id,connectivityKey:c.subcircuit_connectivity_map_key},h=o.get(c.source_component_id)??[];h.push(l),o.set(c.source_component_id,h)}if(c.type==="schematic_port"&&c.source_port_id)r.set(c.source_port_id,c)}let s=new Map;for(let c of n.values()){if(c.ftype!=="simple_capacitor")continue;let l=o.get(c.sourceComponentId)??[];if(l.length!==2)continue;let h=l[0],d=l[1],u=i.get(c.sourceComponentId);if(!u)continue;for(let[_,p]of[[h,d],[d,h]]){let m=r.get(_.sourcePortId);if(!m)continue;let A=s.get(_.connectivityKey)??[];A.push({capacitor:u,loadPort:m,returnConnectivityKey:p.connectivityKey}),s.set(_.connectivityKey,A)}}let a=[];for(let c of n.values()){if(c.ftype!=="simple_crystal"&&c.ftype!=="simple_chip")continue;let l=o.get(c.sourceComponentId)??[];if(l.length!==2||l[0].connectivityKey===l[1].connectivityKey)continue;let h=l[0].connectivityKey,d=l[1].connectivityKey;if(![...o.entries()].some(([x,C])=>x!==c.sourceComponentId&&C.length>2&&C.some((b)=>b.connectivityKey===h)&&C.some((b)=>b.connectivityKey===d)))continue;let _=i.get(c.sourceComponentId);if(!_)continue;let p=s.get(l[0].connectivityKey)??[],m=s.get(l[1].connectivityKey)??[],A=p.flatMap((x)=>m.flatMap((C)=>{if(x.capacitor.sourceComponentId===C.capacitor.sourceComponentId||x.returnConnectivityKey!==C.returnConnectivityKey||x.returnConnectivityKey===h||x.returnConnectivityKey===d||x.capacitor.schematicSheetId!==_.schematicSheetId||C.capacitor.schematicSheetId!==_.schematicSheetId)return[];return[{firstConnection:x,secondConnection:C}]}));if(A.length===0)continue;let g=A.toSorted((x,C)=>Qwt(x,_)-Qwt(C,_))[0],f=[g.firstConnection.loadPort,g.secondConnection.loadPort],y=[g.firstConnection.capacitor,g.secondConnection.capacitor].toSorted((x,C)=>x.schX-C.schX);a.push({crystal:_,firstLoadCapacitor:y[0],secondLoadCapacitor:y[1],newSchX:Hxe((f[0].center.x+f[1].center.x)/2),newSchY:Hxe((f[0].center.y+f[1].center.y)/2)})}return a}static issueToString(t){let n=[];return sn(n,"crystalName",t.crystalSchematicBox.sourceComponentName),sn(n,"firstLoadCapacitorName",t.firstLoadCapacitorSchematicBox.sourceComponentName),sn(n,"secondLoadCapacitorName",t.secondLoadCapacitorSchematicBox.sourceComponentName),sn(n,"newSchX",t.newSchX),sn(n,"newSchY",t.newSchY),sn(n,"deltaSchX",t.deltaSchX,{formatDelta:!0}),sn(n,"deltaSchY",t.deltaSchY,{formatDelta:!0}),sn(n,"message",t.message),`<CrystalNotCenteredOverLoadCapacitors ${n.join(" ")} />`}},Qwt=(e,t)=>kwt(e.firstConnection.capacitor,t)+kwt(e.secondConnection.capacitor,t),kwt=(e,t)=>Math.hypot(e.schX-t.schX,e.schY-t.schY),Hxe=(e)=>Math.round(e*100)/100,gYe=class e extends co{static DIODE_FTYPES=new Set(["simple_led","simple_diode"]);ctx;out;schematicTraces;currentIndex=0;sourceConnectivity;sourceComponentFtypeById;sourceComponentIdBySourcePortId;schematicPorts;schematicBoxBySourceComponentId;constructor({ctx:t,issues:n}){super();this.ctx=t,this.out=n;let{circuitJson:o}=t;this.sourceConnectivity=q8(o),this.sourceComponentFtypeById=this.buildSourceComponentFtypeById(o),this.sourceComponentIdBySourcePortId=this.buildSourceComponentIdBySourcePortId(o),this.schematicPorts=o.filter((r)=>r.type==="schematic_port"),this.schematicBoxBySourceComponentId=this.buildSchematicBoxBySourceComponentId(),this.schematicTraces=o.filter((r)=>r.type==="schematic_trace"),this.solved=this.schematicTraces.length===0}_step(){let t=this.schematicTraces[this.currentIndex];if(!t){this.solved=!0;return}if(this.currentIndex++,this.solved=this.currentIndex>=this.schematicTraces.length,!t.edges||t.edges.length===0)return;let n=t.edges[0],o=t.edges[t.edges.length-1];if(!n||!o)return;let r=n.from,i=o.to,s=t.schematic_sheet_id,a=this.findSourceComponentIdNearPoint(r,s),c=this.findSourceComponentIdNearPoint(i,s);if(!a||!c)return;let l=this.sourceComponentFtypeById.get(a),h=this.sourceComponentFtypeById.get(c),{DIODE_FTYPES:d}=e;if(!(d.has(l)&&h==="simple_resistor"||l==="simple_resistor"&&d.has(h)))return;let _=d.has(l)?a:c,p=l==="simple_resistor"?a:c,m=this.schematicBoxBySourceComponentId.get(_),A=this.schematicBoxBySourceComponentId.get(p);if(!m||!A)return;let g=this.findNearestPort(d.has(l)?r:i,s),f=this.findNearestPort(l==="simple_resistor"?r:i,s);if(!g?.center||!f?.center)return;if(!this.sourceConnectivity.areIdsConnected(g.source_port_id,f.source_port_id))return;let y=m.sourceComponentName||"component",x=A.sourceComponentName||"component",C=g?.display_pin_label??g?.pin_number?.toString(),b=f?.display_pin_label??f?.pin_number?.toString(),I=g?.facing_direction,v=f?.facing_direction,P=C?`${y}.${C}`:y,M=b?`${x}.${b}`:x,B=(T)=>({lineItemType:"DiodeResistorNotAligned",diodeSchematicBox:m,resistorSchematicBox:A,diodePin:C,resistorPin:b,diodePinFacingDirection:I,resistorPinFacingDirection:v,message:T});if(!e.isCoLinear(g.center,f.center)){this.out.push(B(`trace has corners — align ${y} and ${x} on same axis and rotate so ${P} faces ${M}`));return}if(I&&v&&!e.pinsFacingEachOther(g.center,I,f.center,v))this.out.push(B(`${P} and ${M} face away from each other — rotate ${y} so ${P} faces ${M}`))}static isCoLinear(t,n,o=0.01){return Math.abs(t.x-n.x)<o||Math.abs(t.y-n.y)<o}static pinsFacingEachOther(t,n,o,r){let i=o.x-t.x,s=o.y-t.y,a=n==="right"&&i>0||n==="left"&&i<0||n==="up"&&s>0||n==="down"&&s<0,c=r==="right"&&i<0||r==="left"&&i>0||r==="up"&&s<0||r==="down"&&s>0;return a&&c}static dist(t,n){return Math.sqrt((t.x-n.x)**2+(t.y-n.y)**2)}findNearestPort(t,n){let o,r=1/0;for(let i of this.schematicPorts){if(i.schematic_sheet_id!==n)continue;if(!i.center)continue;let s=e.dist(t,i.center);if(s<r)r=s,o=i}return o}findSourceComponentIdNearPoint(t,n){let o=this.findNearestPort(t,n);if(!o||!o.source_port_id)return;return this.sourceComponentIdBySourcePortId.get(o.source_port_id)}buildSourceComponentFtypeById(t){let n=new Map;for(let o of t)if(o.type==="source_component"&&"source_component_id"in o&&"ftype"in o&&typeof o.ftype==="string")n.set(o.source_component_id,o.ftype);return n}buildSourceComponentIdBySourcePortId(t){let n=new Map;for(let o of t)if(o.type==="source_port"&&"source_port_id"in o&&"source_component_id"in o&&typeof o.source_port_id==="string"&&typeof o.source_component_id==="string")n.set(o.source_port_id,o.source_component_id);return n}buildSchematicBoxBySourceComponentId(){let t=new Map;for(let n of this.ctx.componentPlacements)if(n.sourceComponentId)t.set(n.sourceComponentId,n);return t}static issueToString(t){let n=[];return sn(n,"diodeComponentName",t.diodeSchematicBox.sourceComponentName),sn(n,"diodePin",t.diodePin),sn(n,"resistorComponentName",t.resistorSchematicBox.sourceComponentName),sn(n,"resistorPin",t.resistorPin),sn(n,"message",t.message),`<DiodeResistorNotAligned ${n.join(" ")} />`}},AYe=class e extends co{static MIN_BODY_GAP=4;index;amplifierIds;issues;currentIndex=0;constructor({ctx:t,issues:n}){super();this.issues=n,this.index=new Cp(t),this.amplifierIds=[...this.index.components.values()].filter((o)=>o.ftype==="simple_op_amp").map((o)=>o.source_component_id),this.solved=this.amplifierIds.length===0}_step(){let t=this.amplifierIds[this.currentIndex++];if(this.solved=this.currentIndex>=this.amplifierIds.length,!t)return;let n=this.index,o=n.placement(t),r=n.namedPort(t,"output"),i=n.namedPort(t,"inverting_input");if(!o||!r||!i||!n.port(r)||!n.port(i))return;let s=n.connected(r.source_port_id),a=n.connected(i.source_port_id);if(s===a||n.isRail(s)||n.isRail(a))return;if((n.portsByNet.get(a)??[]).some((u)=>u.source_component_id!==t&&n.components.get(u.source_component_id)?.ftype==="simple_op_amp"))return;let c=[],l=new Set;for(let u of n.portsByNet.get(s)??[]){let _=u.source_component_id;if(l.has(_))continue;l.add(_);let p=n.components.get(_);if(p?.ftype!=="simple_resistor"&&p?.ftype!=="simple_capacitor")continue;if(p.ftype==="simple_resistor"&&!(p.resistance>0))continue;let m=n.twoTerminalNets(_);if(!m?.includes(a)||!m.includes(s))continue;let A=n.placement(_);if(!A||!n.sameLocalScope(o,A))return;c.push(A)}let h=c.flatMap((u)=>{let _=kYo(o,u),p=Math.max(e.MIN_BODY_GAP,3*Math.max(u.width,u.height));return _>p?[{schematicBox:u,bodyGap:_,maxRecommendedBodyGap:p}]:[]});if(h.length===0)return;let d=h.map(({schematicBox:u})=>u.sourceComponentName||"component").join(", ");this.issues.push({lineItemType:"FeedbackNetworkNotCompact",amplifierSchematicBox:o,feedbackComponents:c,distantComponents:h,outputSourcePortId:r.source_port_id,invertingInputSourcePortId:i.source_port_id,message:`consider grouping ${d} closer to ${o.sourceComponentName||"component"}, with a compact feedback return path above or below the amplifier`})}static issueToString(t){let n=[];return sn(n,"amplifierName",t.amplifierSchematicBox.sourceComponentName),sn(n,"feedbackComponentNames",t.feedbackComponents.map((o)=>o.sourceComponentName||"component").join(", ")),sn(n,"distantComponentNames",t.distantComponents.map(({schematicBox:o})=>o.sourceComponentName||"component").join(", ")),sn(n,"message",t.message),`<FeedbackNetworkNotCompact ${n.join(" ")} />`}};function kYo(e,t){return Math.hypot(Math.max(0,Math.abs(e.schX-t.schX)-(e.width+t.width)/2),Math.max(0,Math.abs(e.schY-t.schY)-(e.height+t.height)/2))}function vBt(e){let t=[],n=(o)=>{let r=e.portsByComponent.get(o);if(r?.length!==2)return!1;let i=e.port(r[0]),s=e.port(r[1]);return!!i&&!!s&&Math.abs(i.center.y-s.center.y)<0.01&&Math.abs(i.center.x-s.center.x)>0.01};for(let o of e.components.values()){if(o.ftype!=="simple_resistor"||o.resistance<=0)continue;let r=o.source_component_id,i=e.twoTerminalNets(r);if(!i||i.filter((y)=>e.isRail(y)).length!==1)continue;let s=i.find((y)=>e.isRail(y));if(e.powerNets.has(s)&&e.groundNets.has(s))continue;let a=i.find((y)=>y!==s),c=e.portsByNet.get(a)??[],l=c.filter((y)=>{let x=e.components.get(y.source_component_id)?.ftype;return x==="simple_switch"||x==="simple_push_button"});if(l.length!==1||c.filter((y)=>e.components.get(y.source_component_id)?.ftype==="simple_resistor").length!==1)continue;let h=l[0],d=h.source_component_id,u=e.components.get(d)?.ftype,p=e.twoTerminalNets(d)?.find((y)=>y!==a);if(!p)continue;let m=e.powerNets.has(s)?"up":"down";if(m==="up"?!e.groundNets.has(p)||e.powerNets.has(p):!e.powerNets.has(p)||e.groundNets.has(p))continue;if([r,d].some((y)=>e.portsByComponent.get(y)?.some((x)=>x.do_not_connect)))continue;let A=e.placement(r),g=e.placement(d),f=e.port(h);if(!A||!g||!f||!e.sameLocalScope(A,g))continue;t.push({resistor:A,switchBox:g,signalPort:h,signalSchY:f.center.y,pullDirection:m,horizontalPushbutton:u==="simple_push_button"&&n(r)&&n(d)})}return t}function SBt(e){return new Set(vBt(e).flatMap((t)=>t.horizontalPushbutton?[t.resistor.sourceComponentId,t.switchBox.sourceComponentId]:[]))}var fYe=class e extends co{static MIN_WRONG_SIDE_GAP=1.5;index;resistorIds;horizontalPushbuttonComponentIds;issues;currentIndex=0;constructor({ctx:t,issues:n}){super();this.issues=n,this.index=new Cp(t),this.horizontalPushbuttonComponentIds=SBt(this.index),this.resistorIds=[...this.index.components.values()].filter((o)=>o.ftype==="simple_resistor"&&o.resistance>0).map((o)=>o.source_component_id),this.solved=this.resistorIds.length===0}_step(){let t=this.resistorIds[this.currentIndex++];if(this.solved=this.currentIndex>=this.resistorIds.length,!t)return;if(this.horizontalPushbuttonComponentIds.has(t))return;let n=this.index,o=n.placement(t),r=n.twoTerminalNets(t);if(!o||!r)return;let i=r.filter((g)=>n.isRail(g));if(i.length!==1)return;let s=i[0];if(n.powerNets.has(s)&&n.groundNets.has(s))return;let a=n.groundNets.has(s)?"down":"up",c=r.find((g)=>g!==s),l=n.portsByNet.get(c)??[],h=l.filter((g)=>g.needs_external_pullup||g.needs_external_pulldown);if(h.length!==1)return;let d=h[0];if(d.needs_external_pullup&&d.needs_external_pulldown)return;if(a==="up"?!d.needs_external_pullup:!d.needs_external_pulldown)return;let u=n.placement(d.source_component_id),_=n.port(d);if(!u||!_||!n.sameLocalScope(u,o))return;if(l.some((g)=>{let f=g.source_component_id;if(f===t||f===d.source_component_id)return!1;if(n.components.get(f)?.ftype!=="simple_capacitor")return!0;let C=n.twoTerminalNets(f)?.find((I)=>I!==c);if(!C||!n.groundNets.has(C)||n.powerNets.has(C))return!0;let b=n.placement(f);return!b||!n.sameLocalScope(u,b)}))return;let p=_.center.y,m=a==="up"?p-(o.schY+o.height/2):o.schY-o.height/2-p;if(m<=e.MIN_WRONG_SIDE_GAP)return;let A=a==="up"?"above":"below";this.issues.push({lineItemType:"PullResistorOnWrongSide",resistorSchematicBox:o,hostSchematicBox:u,signalSourcePortId:d.source_port_id,signalPinName:d.name,signalSchY:p,pullDirection:a,preferredSide:A,wrongSideGap:m,maxRecommendedWrongSideGap:e.MIN_WRONG_SIDE_GAP,message:`consider placing ${o.sourceComponentName||"component"} ${A} ${u.sourceComponentName||"component"}.${d.name} so the pull-${a} branch reads toward ${a==="up"?"power":"ground"}`})}static issueToString(t){let n=[];return sn(n,"resistorName",t.resistorSchematicBox.sourceComponentName),sn(n,"hostName",t.hostSchematicBox.sourceComponentName),sn(n,"signalPin",t.signalPinName),sn(n,"pullDirection",t.pullDirection),sn(n,"preferredSide",t.preferredSide),sn(n,"signalSchY",t.signalSchY),sn(n,"wrongSideGap",t.wrongSideGap),sn(n,"message",t.message),`<PullResistorOnWrongSide ${n.join(" ")} />`}},bse=class e extends co{static EPSILON=0.01;index;powerNets;groundNets;positiveVoltageNets=new Set;componentIds;horizontalPushbuttonComponentIds;issues;currentIndex=0;constructor({ctx:t,issues:n}){super();this.issues=n,this.index=new Cp(t),this.horizontalPushbuttonComponentIds=SBt(this.index),this.powerNets=new Set(this.index.powerNets),this.groundNets=new Set(this.index.groundNets);for(let o of t.circuitJson){if(o.type==="source_net"&&o.is_positive_voltage_source)this.positiveVoltageNets.add(this.index.connected(o.source_net_id));if(o.type!=="source_port")continue;let r=this.index.connected(o.source_port_id);if(o.provides_power||o.requires_power)this.powerNets.add(r);if(o.provides_ground||o.requires_ground)this.groundNets.add(r)}this.componentIds=[...this.index.components.keys()].filter((o)=>this.index.portsByComponent.get(o)?.length===2),this.solved=this.componentIds.length===0}_step(){let t=this.componentIds[this.currentIndex++];if(this.solved=this.currentIndex>=this.componentIds.length,!t)return;let n=this.index,o=n.placement(t),r=n.components.get(t),i=n.twoTerminalNets(t);if(!o||!i)return;if(r?.ftype==="simple_inductor"&&!i.some((I)=>this.groundNets.has(I)))return;if(r?.ftype==="simple_diode"&&i.every((I)=>this.powerNets.has(I)))return;if(i.some((I)=>this.powerNets.has(I)&&this.groundNets.has(I)))return;let s=i.map((I)=>this.powerNets.has(I)?"power":this.groundNets.has(I)?"ground":void 0);if(s.every((I)=>I===void 0))return;let a=s.includes("power")?"power":"ground",c=i.flatMap((I,v)=>s[v]===a?[{net:I,index:v}]:[]),l=(c.find(({net:I})=>n.portsByNet.get(I)?.some((v)=>a==="power"?v.provides_power:v.provides_ground))??c.find(({net:I})=>(a==="power"?n.powerNets:n.groundNets).has(I))??c[0]).index,h=i[l],d=n.portsByComponent.get(t),u=d.find((I)=>n.connected(I.source_port_id)===h),_=d.find((I)=>I!==u),p=n.port(u),m=n.port(_);if(!p||!m)return;let A=n.connected(_.source_port_id),g=this.groundNets.has(A),f=r?.ftype==="simple_resistor"&&!this.powerNets.has(A)&&!g;if(this.positiveVoltageNets.has(h)&&(g||f)&&Math.abs(p.center.x-m.center.x)<=e.EPSILON&&p.center.y<m.center.y-e.EPSILON&&p.facing_direction==="down"&&m.facing_direction==="up"){this.issues.push({lineItemType:"TwoPinComponentHasInvertedRails",schematicBox:o,railSourcePortId:u.source_port_id,railPinName:u.name,railType:"power",deltaSchRotation:180,suggestedRailFacingDirection:"up",message:`rotate ${o.sourceComponentName||"component"} by 180° so its positive-supply pin faces up and its ${g?"ground":"signal"} pin faces down; preserve pin connections and reroute attached traces`});return}if(!(Math.abs(p.center.y-m.center.y)<=e.EPSILON&&Math.abs(p.center.x-m.center.x)>e.EPSILON&&(p.facing_direction==="left"&&m.facing_direction==="right"||p.facing_direction==="right"&&m.facing_direction==="left")))return;if(this.horizontalPushbuttonComponentIds.has(t))return;let C=a==="power"?"up":"down",b=p.facing_direction==="left"===(a==="power")?-90:90;this.issues.push({lineItemType:"TwoPinComponentShouldBeVertical",schematicBox:o,railSourcePortId:u.source_port_id,railPinName:u.name,railType:a,deltaSchRotation:b,suggestedRailFacingDirection:C,message:`rotate ${o.sourceComponentName||"component"} by ${b}° so its ${a}-connected pin faces ${C} and the component is vertical`})}static issueToString(t){let n=[];return sn(n,"componentName",t.schematicBox.sourceComponentName),sn(n,"railPin",t.railPinName),sn(n,"railType",t.railType),sn(n,"deltaSchRotation",t.deltaSchRotation),sn(n,"suggestedRailFacingDirection",t.suggestedRailFacingDirection),sn(n,"message",t.message),`<${t.lineItemType} ${n.join(" ")} />`}},Fxe=0.1,LYo=0.15,dK=0.02,HYo=0.000000001;function yYe(e,t,n){let o={left:e.schX-e.width/2,right:e.schX+e.width/2,top:e.schY+e.height/2,bottom:e.schY-e.height/2},r=[];for(let i of t){if(!i.side_of_component)continue;if(!i.display_pin_label)continue;let s=n(i),a=LYo/2;switch(i.side_of_component){case"left":{let c=o.left+Fxe;r.push({side:i.side_of_component,xMin:c,xMax:c+s,yMin:i.center.y-a,yMax:i.center.y+a});break}case"right":{let c=o.right-Fxe;r.push({side:i.side_of_component,xMin:c-s,xMax:c,yMin:i.center.y-a,yMax:i.center.y+a});break}case"top":{let c=o.top-Fxe;r.push({side:i.side_of_component,xMin:i.center.x-a,xMax:i.center.x+a,yMin:c-s,yMax:c});break}case"bottom":{let c=o.bottom+Fxe;r.push({side:i.side_of_component,xMin:i.center.x-a,xMax:i.center.x+a,yMin:c,yMax:c+s});break}}}return r}function PBt(e,t,n=dK){return OVe(e.xMin,e.xMax,t.xMin,t.xMax,n)&&OVe(e.yMin,e.yMax,t.yMin,t.yMax,n)}function OVe(e,t,n,o,r=dK){return Math.min(t,o)-Math.max(e,n)+r>HYo}function xYe(e){return new Set(e.flatMap((t)=>t.type==="schematic_component"&&t.is_box_with_pins!==!1&&!t.symbol_name&&!t.schematic_symbol_id?[t.schematic_component_id]:[]))}var aK=(e)=>[{x:e.left,y:e.bottom},{x:e.right,y:e.bottom},{x:e.right,y:e.top},{x:e.left,y:e.top}],FYo=(e)=>{if(/\s/.test(e))return 0.28;if(/[ilI.,:;!'|]/.test(e))return 0.25;if(/[MW@%]/.test(e))return 0.9;if(/[mw]/.test(e))return 0.8;if(/[A-Z]/.test(e))return 0.67;return 0.56},Yxe=(e)=>Array.from(e).reduce((t,n)=>t+FYo(n),0),zYo=(e,t)=>Yxe(e)*t;function VVe(e){let t=e.font_size;if(!Number.isFinite(t)||t<=0||!Number.isFinite(e.rotation)||!Number.isFinite(e.position.x)||!Number.isFinite(e.position.y))return[];let n=e.anchor,o=n.includes("left")?0:n.includes("right")?1:0.5,r=n.includes("top")?0:n.includes("bottom")?t:t/2,i=-e.rotation*Math.PI/180,s=Math.cos(i),a=Math.sin(i);return e.text.split(`
`).flatMap((c,l)=>{let h=c.trim();if(!h)return[];let d=c.length-c.trimStart().length,u=(Yxe(c.slice(0,d))-Yxe(c)*o)*t;return[aK({left:u,right:u+Yxe(h)*t,top:r-l*t-t*0.05,bottom:r-(l+1)*t+t*0.05}).map(({x:p,y:m})=>({x:e.position.x+p*s-m*a,y:e.position.y+p*a+m*s}))]})}function YVe(e,t){for(let n of[e,t])for(let o=0;o<n.length;o++){let r=n[o],i=n[(o+1)%n.length],s=Math.hypot(i.x-r.x,i.y-r.y);if(s<0.000000001)continue;let a=-(i.y-r.y)/s,c=(i.x-r.x)/s,l=(u)=>u.map(({x:_,y:p})=>_*a+p*c),h=l(e),d=l(t);if(Math.min(Math.max(...h),Math.max(...d))-Math.max(Math.min(...h),Math.min(...d))<=0.000001)return!1}return!0}function GVe(e,t){let n=Math.hypot(t.x-e.x,t.y-e.y);if(n<0.000000001)return;let o=-(t.y-e.y)/n*0.01,r=(t.x-e.x)/n*0.01;return[{x:e.x+o,y:e.y+r},{x:t.x+o,y:t.y+r},{x:t.x-o,y:t.y-r},{x:e.x-o,y:e.y-r}]}function Gxe(e,t,n){if(Math.hypot(t.x-e.x,t.y-e.y)<0.000000001)return!1;let o=0,r=1;for(let i=0;i<n.length;i++){let s=n[i],a=n[(i+1)%n.length],c=Math.hypot(a.x-s.x,a.y-s.y);if(c<0.000000001)continue;let l=-(a.y-s.y)/c,h=(a.x-s.x)/c,d=(e.x-s.x)*l+(e.y-s.y)*h-0.000001,u=(t.x-s.x)*l+(t.y-s.y)*h-0.000001;if(d<=0&&u<=0)return!1;if(d<=0)o=Math.max(o,-d/(u-d));if(u<=0)r=Math.min(r,-d/(u-d));if(r<=o)return!1}return r>o}var Lwt=(e)=>{let t=e.flat();return{left:Math.min(...t.map((n)=>n.x)),right:Math.max(...t.map((n)=>n.x)),top:Math.max(...t.map((n)=>n.y)),bottom:Math.min(...t.map((n)=>n.y))}},CYe=class extends co{constructor(e){super();this.params=e;let{circuitJson:t,componentPlacements:n}=e.ctx;this.placementById=this.getPlacementBySchematicComponentId(n);let o=xYe(t);this.entries=Array.from(this.getPortsBySchematicComponentId(t)).filter(([r])=>o.has(r)),this.solved=this.entries.length===0}params;entries;placementById;currentIndex=0;_step(){let e=this.entries[this.currentIndex++];if(!e){this.solved=!0;return}this.solved=this.currentIndex>=this.entries.length;let[t,n]=e,o=this.placementById.get(t);if(!o)return;let r=yYe(o,n,(s)=>zYo(s.display_pin_label,0.15));if(r.length===0)return;let i=this.getCollisionSummary(r);if(i.overlappingSides.length===0)return;this.params.issues.push({lineItemType:"SchematicBoxInnerLabelCollision",schematicBox:o,overlappingSides:i.overlappingSides,message:this.getMessage(i.overlappingSides)})}static issueToString(e){let t=[];return sn(t,"message",e.message),sn(t,"componentName",e.schematicBox.sourceComponentName),sn(t,"currentSchWidth",e.schematicBox.width),sn(t,"currentSchHeight",e.schematicBox.height),sn(t,"overlappingSides",e.overlappingSides.join(",")),`<SchematicBoxInnerLabelCollision ${t.join(" ")} />`}getMessage(e){return`Inner labels are colliding. Increase the ${e.every((n)=>n==="left"||n==="right")?"schWidth":e.every((n)=>n==="top"||n==="bottom")?"schHeight":"schWidth or schHeight"}.`}isSchematicPort(e){return e.type==="schematic_port"}isSchematicSide(e){return e==="left"||e==="right"||e==="top"||e==="bottom"}getPlacementBySchematicComponentId(e){return new Map(e.filter((t)=>t.schematicComponentId).map((t)=>[t.schematicComponentId,t]))}getPortsBySchematicComponentId(e){let t=new Map;for(let n of e.filter((o)=>this.isSchematicPort(o))){if(!n.schematic_component_id)continue;if(!this.isSchematicSide(n.side_of_component))continue;let o=t.get(n.schematic_component_id);if(o)o.push(n);else t.set(n.schematic_component_id,[n])}return t}getCollisionSummary(e){let t=new Set;for(let n=0;n<e.length;n++)for(let o=n+1;o<e.length;o++){let r=e[n],i=e[o];if(r.side===i.side)continue;if(!PBt(r,i))continue;t.add(r.side),t.add(i.side)}return{overlappingSides:this.sortSides(Array.from(t))}}sortSides(e){let t={left:0,right:1,top:2,bottom:3};return e.sort((n,o)=>t[n]-t[o])}},bYe=class e extends co{constructor(t){super();this.params=t,this.placements=t.ctx.componentPlacements,this.solved=this.placements.length<2}params;placements;firstIndex=0;secondIndex=1;_step(){if(this.firstIndex>=this.placements.length-1){this.solved=!0;return}let t=this.getComponentOverlap(this.placements[this.firstIndex],this.placements[this.secondIndex]);if(t)this.params.issues.push(t);if(this.secondIndex++,this.secondIndex>=this.placements.length)this.firstIndex++,this.secondIndex=this.firstIndex+1;this.solved=this.firstIndex>=this.placements.length-1}getCenteredRectBounds(t){return{left:t.schX-t.width/2,right:t.schX+t.width/2,top:t.schY-t.height/2,bottom:t.schY+t.height/2}}getOverlapCorrectionSuggestions({firstComponent:t,secondComponent:n,overlapWidth:o,overlapHeight:r}){let i=t.width*t.height,s=n.width*n.height,a=i<=s?t:n,c=a===t?n:t,l=a.schX<=c.schX?-o:o,h=a.schY<=c.schY?-r:r;return[{targetComponentName:a.sourceComponentName,deltaSchX:l,deltaSchY:0,newSchX:a.schX+l,newSchY:a.schY},{targetComponentName:a.sourceComponentName,deltaSchX:0,deltaSchY:h,newSchX:a.schX,newSchY:a.schY+h}]}static issueToString(t){let n=[];return sn(n,"component1Name",t.firstComponent.sourceComponentName),sn(n,"component2Name",t.secondComponent.sourceComponentName),sn(n,"component1SchX",t.firstComponent.schX),sn(n,"component1SchY",t.firstComponent.schY),sn(n,"component2SchX",t.secondComponent.schX),sn(n,"component2SchY",t.secondComponent.schY),sn(n,"overlapWidth",t.overlapWidth),sn(n,"overlapHeight",t.overlapHeight),[`<ComponentOverlap ${n.join(" ")}>`,...t.correctionSuggestions.map(e.correctionSuggestionToString),"</ComponentOverlap>"].join(`
`)}static correctionSuggestionToString(t){let n=[];if(sn(n,"target",t.targetComponentName),t.deltaSchX!==0)sn(n,"newSchX",t.newSchX),sn(n,"deltaSchX",t.deltaSchX,{formatDelta:!0});if(t.deltaSchY!==0)sn(n,"newSchY",t.newSchY),sn(n,"deltaSchY",t.deltaSchY,{formatDelta:!0});return`<OverlapCorrectionSuggestion ${n.join(" ")} />`}getComponentOverlap(t,n){if(t.schematicSheetId!==n.schematicSheetId)return null;let o=this.getCenteredRectBounds(t),r=this.getCenteredRectBounds(n),i=Math.min(o.right,r.right)-Math.max(o.left,r.left),s=Math.min(o.bottom,r.bottom)-Math.max(o.top,r.top);if(i<=0||s<=0)return null;return{lineItemType:"ComponentOverlap",firstComponent:t,secondComponent:n,overlapWidth:i,overlapHeight:s,correctionSuggestions:this.getOverlapCorrectionSuggestions({firstComponent:t,secondComponent:n,overlapWidth:i,overlapHeight:s})}}};function EBt(e,t){let n;for(let o of e){if(o.type!=="schematic_path"&&o.type!=="schematic_circle"&&o.type!=="schematic_rect"||o.schematic_component_id!==t)continue;let r=(o.stroke_width??0.02)/2,i;if(o.type==="schematic_path"){if(!o.points.length)continue;i={xMin:Math.min(...o.points.map((s)=>s.x)),xMax:Math.max(...o.points.map((s)=>s.x)),yMin:Math.min(...o.points.map((s)=>s.y)),yMax:Math.max(...o.points.map((s)=>s.y))}}else{let s=o.type==="schematic_rect"?(o.rotation??0)*Math.PI/180:0,a=o.type==="schematic_circle"?2*o.radius:o.width,c=o.type==="schematic_circle"?2*o.radius:o.height,l=(Math.abs(a*Math.cos(s))+Math.abs(c*Math.sin(s)))/2,h=(Math.abs(a*Math.sin(s))+Math.abs(c*Math.cos(s)))/2;i={xMin:o.center.x-l,xMax:o.center.x+l,yMin:o.center.y-h,yMax:o.center.y+h}}i.xMin-=r,i.xMax+=r,i.yMin-=r,i.yMax+=r,n=n?{xMin:Math.min(n.xMin,i.xMin),xMax:Math.max(n.xMax,i.xMax),yMin:Math.min(n.yMin,i.yMin),yMax:Math.max(n.yMax,i.yMax)}:i}return n}var MBt=0.2,e5e=(e)=>Array.from(e.display_pin_label??"").length*0.095;function wBt(e,t,n,o,r=0,i){if(!Number.isFinite(n)||n<=0)return;if(t.some((m)=>!m.side_of_component))return;if(!Fwt(e,t,dK,i))return;let s=0,a=0;for(let m of t)if(m.side_of_component==="left"||m.side_of_component==="right")a=Math.max(a,2*(Math.abs(m.center.y-e.schY)+n));else s=Math.max(s,2*(Math.abs(m.center.x-e.schX)+n));let c=o.width===void 0?e.width:Math.max(o.width,s,Hwt(e,t,"width",i)),l=o.height===void 0?e.height:Math.max(o.height,a,Hwt(e,t,"height",i)),h=(m)=>m>0.000000001&&m>=r-0.000000001,d=h(e.width-c)?c:void 0,u=h(e.height-l)?l:void 0;if(d===void 0&&u===void 0)return;let _=[{width:d,height:u}];if(d!==void 0&&u!==void 0)_.push({width:d},{height:u});let p=(m)=>(m.width??e.width)*(m.height??e.height);return _.sort((m,A)=>p(m)-p(A)),_.find((m)=>Fwt({...e,width:m.width??e.width,height:m.height??e.height},t,MBt,i))}function Hwt(e,t,n,o){let r=e[n],i=n==="width"?e.schX:e.schY,s=n==="width"?"xMin":"yMin",a=n==="width"?"xMax":"yMax",c=n==="width"?"yMin":"xMin",l=n==="width"?"yMax":"xMax",h=(p)=>{if(n==="width")return p.side==="left"?-0.5:p.side==="right"?0.5:0;return p.side==="bottom"?-0.5:p.side==="top"?0.5:0},d=0,u=(p,m,A=0)=>{if(m>0)d=Math.max(d,r+(A-p)/m)},_=yYe(e,t,e5e);if(o)_.push(o);for(let p=0;p<_.length;p++){let m=_[p];u(m[s]-(i-r/2),h(m)+0.5),u(i+r/2-m[a],0.5-h(m));for(let A=p+1;A<_.length;A++){let g=_[A],f=m.side&&g.side&&m.side!==g.side?MBt:dK;if(!OVe(m[c],m[l],g[c],g[l],f))continue;let[y,x]=m[a]<=g[s]?[m,g]:[g,m];u(x[s]-y[a],h(x)-h(y),f)}}return d}function Fwt(e,t,n=dK,o){if(!Number.isFinite(e.width)||!Number.isFinite(e.height))return!1;let r=yYe(e,t,e5e);if(o)r.push(o);for(let i=0;i<r.length;i++){let s=r[i];if(s.xMin<e.schX-e.width/2-0.000000001||s.xMax>e.schX+e.width/2+0.000000001||s.yMin<e.schY-e.height/2-0.000000001||s.yMax>e.schY+e.height/2+0.000000001)return!1;for(let a=i+1;a<r.length;a++){let c=r[a],l=s.side&&c.side&&s.side!==c.side?n:dK;if(PBt(s,c,l))return!1}}return!0}var Kxe=class extends co{constructor(e){super();this.params=e;let{circuitJson:t,componentPlacements:n}=e.ctx;this.placementById=this.getPlacementBySchematicComponentId(n),this.schematicComponentById=new Map(t.filter((r)=>r.type==="schematic_component").map((r)=>[r.schematic_component_id,r])),this.sourceComponentById=this.getSourceComponentById(t);let o=xYe(t);this.entries=Array.from(this.getPortsBySchematicComponentId(t)).filter(([r])=>o.has(r)),this.solved=this.entries.length===0}params;SCHEMATIC_BOX_TOO_WIDE_MESSAGE="Shrink schematic box width";PIN_HEADER_MAX_ALLOWED_GAP=0.1;GENERIC_MAX_ALLOWED_GAP=1;PIN_LABEL_EDGE_PADDING=0.1;GAP_COMPARISON_EPSILON=0.000000001;entries;placementById;schematicComponentById;sourceComponentById;currentIndex=0;_step(){let e=this.entries[this.currentIndex++];if(!e){this.solved=!0;return}this.solved=this.currentIndex>=this.entries.length;let[t,n]=e,o=this.placementById.get(t);if(!o)return;let r=this.getCenteredRectBounds(o),i=this.getLabelColumn("left",n),s=this.getLabelColumn("right",n),a=this.getSourceComponentFtype(o,this.sourceComponentById),c;if(i&&s)c=this.getInnerLabelEdge(r,s)-this.getInnerLabelEdge(r,i);else if(i&&i.labelCount>=4)c=r.right-this.getInnerLabelEdge(r,i);else if(s&&s.labelCount>=4)c=this.getInnerLabelEdge(r,s)-r.left;if(c===void 0)return;let l=a==="simple_pin_header"?this.PIN_HEADER_MAX_ALLOWED_GAP:this.GENERIC_MAX_ALLOWED_GAP;if(!this.exceedsMaxAllowedGap(c,l))return;let h=this.getSuggestedWidth({measuredInnerLabelHorizontalEmptySpace:c,maxAllowedInnerLabelHorizontalEmptySpace:l,currentWidth:o.width}),d=this.schematicComponentById.get(t)?.pin_spacing;if(d===void 0)return;let u=wBt(o,n,d,{width:h},0,EBt(this.params.ctx.circuitJson,t));if(u?.width===void 0)return;let _=u.width;if(a==="simple_pin_header")this.params.issues.push({lineItemType:"PinHeaderSchematicBoxTooWide",schematicBox:o,measuredInnerLabelHorizontalEmptySpace:c,maxAllowedInnerLabelHorizontalEmptySpace:l,suggestedSchWidth:_,message:this.SCHEMATIC_BOX_TOO_WIDE_MESSAGE});else this.params.issues.push({lineItemType:"GenericSchematicBoxTooWide",schematicBox:o,measuredInnerLabelHorizontalEmptySpace:c,maxAllowedInnerLabelHorizontalEmptySpace:l,suggestedSchWidth:_,message:this.SCHEMATIC_BOX_TOO_WIDE_MESSAGE})}static issueToString(e){let t=[];return sn(t,"message",e.message),sn(t,"componentName",e.schematicBox.sourceComponentName),sn(t,"currentSchWidth",e.schematicBox.width),sn(t,"measuredInnerLabelHorizontalEmptySpace",e.measuredInnerLabelHorizontalEmptySpace),sn(t,"maxAllowedInnerLabelHorizontalEmptySpace",e.maxAllowedInnerLabelHorizontalEmptySpace),sn(t,"suggestedSchWidth",e.suggestedSchWidth),`<${e.lineItemType} ${t.join(" ")} />`}isSchematicPort(e){return e.type==="schematic_port"}getSourceComponentWithFtype(e){if(e.type!=="source_component"||!("source_component_id"in e)||typeof e.source_component_id!=="string")return null;return{type:"source_component",source_component_id:e.source_component_id,ftype:"ftype"in e&&typeof e.ftype==="string"?e.ftype:void 0}}exceedsMaxAllowedGap(e,t){return e-t>this.GAP_COMPARISON_EPSILON}getCenteredRectBounds(e){return{left:e.schX-e.width/2,right:e.schX+e.width/2,top:e.schY+e.height/2,bottom:e.schY-e.height/2}}getSourceComponentById(e){return new Map(e.flatMap((t)=>{let n=this.getSourceComponentWithFtype(t);return n?[n]:[]}).map((t)=>[t.source_component_id,t]))}getPlacementBySchematicComponentId(e){return new Map(e.filter((t)=>t.schematicComponentId).map((t)=>[t.schematicComponentId,t]))}getPortsBySchematicComponentId(e){let t=new Map;for(let n of e.filter((o)=>this.isSchematicPort(o))){if(!n.schematic_component_id)continue;let o=t.get(n.schematic_component_id);if(o)o.push(n);else t.set(n.schematic_component_id,[n])}return t}getSourceComponentFtype(e,t){return e.sourceComponentId?t.get(e.sourceComponentId)?.ftype:void 0}getLabelColumn(e,t){let n=t.filter((o)=>o.side_of_component===e).flatMap((o)=>o.display_pin_label?[e5e(o)]:[]);if(n.length===0)return null;return{side:e,labelCount:n.length,maxLabelWidth:Math.max(...n)}}getInnerLabelEdge(e,t){return t.side==="left"?e.left+this.PIN_LABEL_EDGE_PADDING+t.maxLabelWidth:e.right-this.PIN_LABEL_EDGE_PADDING-t.maxLabelWidth}getSuggestedWidth(e){return e.currentWidth-e.measuredInnerLabelHorizontalEmptySpace+e.maxAllowedInnerLabelHorizontalEmptySpace}},IYe=class extends co{constructor(e){super();this.params=e;let{circuitJson:t,componentPlacements:n}=e.ctx;this.placementById=this.getPlacementBySchematicComponentId(n),this.schematicComponentById=this.getSchematicComponentById(t),this.sourcePortById=this.getSourcePortById(t);let o=xYe(t);this.entries=Array.from(this.getPortsBySchematicComponentId(t)).filter(([r])=>o.has(r)),this.solved=this.entries.length===0}params;MESSAGE="Move schematic pins closer to the box edge or change the schematic box";GAP_COMPARISON_EPSILON=0.000000001;entries;placementById;schematicComponentById;sourcePortById;currentIndex=0;_step(){let e=this.entries[this.currentIndex++];if(!e){this.solved=!0;return}this.solved=this.currentIndex>=this.entries.length;let[t,n]=e,o=this.placementById.get(t);if(!o)return;let r=this.getPinSpacing(o,this.schematicComponentById);if(r===null)return;let i=this.getMaxLabelLengthBySide(n),s=new Map;for(let m of n){if(!this.isSchematicSide(m.side_of_component))continue;let A=s.get(m.side_of_component)??[];A.push(m),s.set(m.side_of_component,A)}let a=[];for(let[m,A]of s){if(A.length===1)continue;for(let g of this.getBoxEdgeSidesForPinSide(m)){let f=this.getOuterPinBySide(g,A);if(!f)continue;let y=this.getPinPaddingToEdge(o,f,g),x=Math.max(r,this.getMaxAllowedPinPadding(r,g,i));if(!this.exceedsMaxAllowedGap(y,x+r))continue;a.push({schematicBox:o,pinSide:m,edgeSide:g,pinName:this.getPinName(f,this.sourcePortById),measuredPadding:y,maxAllowedPadding:x})}}if(!a.length)return;let c=a.map((m)=>this.createIssue(m)),l=c.flatMap((m)=>m.suggestedSchWidth===void 0?[]:[m.suggestedSchWidth]),h=c.flatMap((m)=>m.suggestedSchHeight===void 0?[]:[m.suggestedSchHeight]),d=wBt(o,n,r,{width:l.length?Math.max(...l):void 0,height:h.length?Math.max(...h):void 0},2*r,EBt(this.params.ctx.circuitJson,t));if(!d)return;let u=c.filter((m)=>d.width!==void 0&&m.suggestedSchWidth!==void 0||d.height!==void 0&&m.suggestedSchHeight!==void 0),_=u.reduce((m,A)=>A.excessPadding>m.excessPadding?A:m),p=[d.width===void 0?"":"width",d.height===void 0?"":"height"].filter(Boolean).join(" and ");this.params.issues.push({..._,paddingDetails:u.map(({pinSide:m,edgeSide:A,pinName:g,measuredPadding:f,maxAllowedPadding:y,excessPadding:x})=>({pinSide:m,edgeSide:A,pinName:g,measuredPadding:f,maxAllowedPadding:y,excessPadding:x})),suggestedSchWidth:d.width,suggestedSchHeight:d.height,message:`${this.MESSAGE} ${p}`})}static issueToString(e){let t=[];if(sn(t,"message",e.message),sn(t,"componentName",e.schematicBox.sourceComponentName),e.paddingDetails)sn(t,"pinSides",[...new Set(e.paddingDetails.map((n)=>n.pinSide))].join(",")),sn(t,"edgeSides",[...new Set(e.paddingDetails.map((n)=>n.edgeSide))].join(","));else sn(t,"pinSide",e.pinSide),sn(t,"edgeSide",e.edgeSide),sn(t,"pinName",e.pinName),sn(t,"measuredPadding",e.measuredPadding),sn(t,"maxAllowedPadding",e.maxAllowedPadding),sn(t,"excessPadding",e.excessPadding);return sn(t,"suggestedSchWidth",e.suggestedSchWidth),sn(t,"suggestedSchHeight",e.suggestedSchHeight),`<SchematicPinPaddingToEdgeTooLarge ${t.join(" ")} />`}isSchematicPort(e){return e.type==="schematic_port"}isSourcePort(e){return e.type==="source_port"}isSchematicComponent(e){return e.type==="schematic_component"}isHorizontalSide(e){return e==="left"||e==="right"}isVerticalSide(e){return e==="top"||e==="bottom"}isSchematicSide(e){return this.isHorizontalSide(e)||this.isVerticalSide(e)}exceedsMaxAllowedGap(e,t){return e-t>this.GAP_COMPARISON_EPSILON}getCenteredRectBounds(e){return{left:e.schX-e.width/2,right:e.schX+e.width/2,top:e.schY+e.height/2,bottom:e.schY-e.height/2}}getSourcePortById(e){return new Map(e.filter((t)=>this.isSourcePort(t)).map((t)=>[t.source_port_id,t]))}getSchematicComponentById(e){return new Map(e.filter((t)=>this.isSchematicComponent(t)).map((t)=>[t.schematic_component_id,t]))}getPlacementBySchematicComponentId(e){return new Map(e.filter((t)=>t.schematicComponentId).map((t)=>[t.schematicComponentId,t]))}getPortsBySchematicComponentId(e){let t=new Map;for(let n of e.filter((o)=>this.isSchematicPort(o))){if(!n.schematic_component_id)continue;let o=t.get(n.schematic_component_id);if(o)o.push(n);else t.set(n.schematic_component_id,[n])}return t}getPinSpacing(e,t){if(!e.schematicComponentId)return null;let n=t.get(e.schematicComponentId);return typeof n?.pin_spacing==="number"?n.pin_spacing:null}getPinName(e,t){let n=t.get(e.source_port_id);if(n?.name)return n.name;if(e.display_pin_label)return e.display_pin_label;if(n?.pin_number!==void 0)return String(n.pin_number);return}getMaxLabelLengthBySide(e){let t={left:0,right:0,top:0,bottom:0};for(let n of e){if(!this.isSchematicSide(n.side_of_component))continue;if(!n.display_pin_label)continue;t[n.side_of_component]=Math.max(t[n.side_of_component],e5e(n))}return t}getOuterPinBySide(e,t){if(t.length===0)return null;switch(e){case"top":return t.reduce((n,o)=>o.center.y>n.center.y?o:n);case"bottom":return t.reduce((n,o)=>o.center.y<n.center.y?o:n);case"left":return t.reduce((n,o)=>o.center.x<n.center.x?o:n);case"right":return t.reduce((n,o)=>o.center.x>n.center.x?o:n)}}getPinPaddingToEdge(e,t,n){let o=this.getCenteredRectBounds(e);switch(n){case"top":return Math.max(0,o.top-t.center.y);case"bottom":return Math.max(0,t.center.y-o.bottom);case"left":return Math.max(0,t.center.x-o.left);case"right":return Math.max(0,o.right-t.center.x)}}getBoxEdgeSidesForPinSide(e){return this.isHorizontalSide(e)?["top","bottom"]:["left","right"]}getMaxAllowedPinPadding(e,t,n){let o=this.isHorizontalSide(t)?["left","right"]:["top","bottom"];return(n[o[0]]+n[o[1]]+e)/2}createIssue(e){let t=Math.max(0,e.measuredPadding-e.maxAllowedPadding),n=t*2;return{lineItemType:"SchematicPinPaddingToEdgeTooLarge",pinSide:e.pinSide,edgeSide:e.edgeSide,pinName:e.pinName,schematicBox:e.schematicBox,measuredPadding:e.measuredPadding,maxAllowedPadding:e.maxAllowedPadding,excessPadding:t,suggestedSchWidth:this.isHorizontalSide(e.pinSide)?void 0:Math.max(0,e.schematicBox.width-n),suggestedSchHeight:this.isHorizontalSide(e.pinSide)?Math.max(0,e.schematicBox.height-n):void 0,message:this.isHorizontalSide(e.pinSide)?`${this.MESSAGE} height`:`${this.MESSAGE} width`}}},vYe=(e)=>{let t=new Map;for(let n of e)if(n.type==="schematic_sheet"&&n.name)t.set(n.schematic_sheet_id,n.name);return t},OYo=(e)=>e.type==="schematic_box",zwt=(e)=>e.type==="schematic_component",UVe=(e)=>e.schematic_sheet_id,VYo=(e,t)=>{if(!t)return;return As(e).source_component.get(t)?.name},YYo=(e,t)=>{if(!e.schematic_component_id)return{};let n=As(t),o=n.schematic_component.get(e.schematic_component_id);if(!o?.source_component_id)return{};let r=n.source_component.get(o.source_component_id);return{sourceComponentId:o.source_component_id,sourceComponentName:r?.name}},GYo=(e,t,n,o)=>{let r=UVe(e);if(r===void 0&&o)r=UVe(o);let i;if(r)i=n.get(r);let s={lineItemType:"SchematicBoxPlacement",positionAnchor:"center",schX:e.center.x,schY:e.center.y,width:o?.width??e.size.width,height:o?.height??e.size.height,sourceComponentId:e.source_component_id,sourceComponentName:VYo(t,e.source_component_id),schematicComponentId:e.schematic_component_id,schematicSymbolId:o?.schematic_symbol_id??e.schematic_symbol_id,subcircuitId:e.subcircuit_id??o?.subcircuit_id};if(r)s.schematicSheetId=r;if(i)s.schematicSheetName=i;return s},UYo=(e,t,n)=>{let o=UVe(e),r;if(o)r=n.get(o);let i={lineItemType:"SchematicBoxPlacement",positionAnchor:"center",schX:e.x+e.width/2,schY:e.y+e.height/2,width:e.width,height:e.height,...YYo(e,t),schematicComponentId:e.schematic_component_id,schematicSymbolId:e.schematic_symbol_id,subcircuitId:e.subcircuit_id};if(o)i.schematicSheetId=o;if(r)i.schematicSheetName=r;return i},WYo=(e)=>{let t=e.filter(OYo).filter((i)=>i.schematic_component_id||i.schematic_symbol_id),n=vYe(e),o=new Set(e.filter(zwt).map((i)=>i.schematic_component_id)),r=[...e.filter(zwt).map((i)=>GYo(i,e,n,t.find((s)=>s.schematic_component_id===i.schematic_component_id))),...t.filter((i)=>!i.schematic_component_id||!o.has(i.schematic_component_id)).map((i)=>UYo(i,e,n))];return{circuitJson:e,componentPlacements:r}},BBt=class extends co{constructor(e){super();this.params=e}params;_step(){let e=new Cp(this.params.ctx);for(let t of vBt(e)){let{resistor:n,switchBox:o,signalPort:r,signalSchY:i,pullDirection:s}=t;if(t.horizontalPushbutton)continue;let a=e.connected(r.source_port_id);if(e.portsByNet.get(a)?.length!==2)continue;if(r.needs_external_pullup||r.needs_external_pulldown)continue;let c=s==="up"?i-(n.schY+n.height/2):n.schY-n.height/2-i;if(c<=1.5)continue;let l=s==="up"?"above":"below";this.params.issues.push({lineItemType:"PullResistorOnWrongSide",resistorSchematicBox:n,hostSchematicBox:o,signalSourcePortId:r.source_port_id,signalPinName:r.name,signalSchY:i,pullDirection:s,preferredSide:l,wrongSideGap:c,maxRecommendedWrongSideGap:1.5,message:`place ${n.sourceComponentName} ${l} ${o.sourceComponentName} so the pull-${s} branch reads toward ${s==="up"?"power":"ground"}`})}this.solved=!0}};function TBt(e,t){let n=e.find((c)=>c.type==="source_trace"&&c.source_trace_id===t.source_trace_id);if(n?.type==="source_trace"&&n.name)return n.name;let o=t.edges[0],r=t.edges.at(-1),i=(c,l)=>{let h=e.filter((g)=>g.type==="schematic_port"&&g.schematic_sheet_id===t.schematic_sheet_id&&(l?g.schematic_port_id===l:Math.hypot(g.center.x-c.x,g.center.y-c.y)<=0.01));if(h.length!==1||h[0]?.type!=="schematic_port")return;let d=h[0],u=e.find((g)=>g.type==="source_port"&&g.source_port_id===d.source_port_id),_=e.find((g)=>g.type==="schematic_component"&&g.schematic_component_id===d.schematic_component_id),p=u?.type==="source_port"?u.source_component_id:_?.type==="schematic_component"?_.source_component_id:void 0,m=e.find((g)=>g.type==="source_component"&&g.source_component_id===p);if(m?.type!=="source_component"||!m.name)return;let A=u?.type==="source_port"&&u.name?u.name:d.pin_number!==void 0?`pin${d.pin_number}`:d.display_pin_label;return A?`${m.name}.${A}`:m.name},s=o&&i(o.from,o.from_schematic_port_id),a=r&&i(r.to,r.to_schematic_port_id);if(s&&a)return`${s} to ${a}`;return n?.type==="source_trace"&&n.display_name||s||a||"trace"}var XYo=(e,t,n)=>{let o=[{x:e.x,y:e.y}],r=(e.x+t.x)/2,i=(e.y+t.y)/2,s={x:t.x,y:t.y};switch(t.facingDirection){case"x+":s.x+=n;break;case"x-":s.x-=n;break;case"y+":s.y+=n;break;case"y-":s.y-=n;break}let a=e.facingDirection??"none",c=t.facingDirection??"none",l=(u)=>{let _=o[o.length-1];if(_.x!==u.x||_.y!==u.y)o.push(u)},h=Math.abs(e.y-t.y)<=Math.max(0.000001,n*0.1),d=Math.abs(e.x-t.x)<=Math.max(0.000001,n*0.1);if(a==="none"&&c==="none")globalThis.__DEBUG_CALCULATE_ELBOW_CASE=1,l({x:r,y:e.y}),l({x:r,y:t.y});else if(a==="x+"&&c==="y+")if(globalThis.__DEBUG_CALCULATE_ELBOW_CASE=2,e.x>t.x&&e.y<t.y)globalThis.__DEBUG_CALCULATE_ELBOW_CASE=2.1,l({x:e.x+n,y:e.y}),l({x:e.x+n,y:t.y+n}),l({x:t.x,y:t.y+n});else if(!d&&!h&&e.x<t.x&&e.y>t.y)globalThis.__DEBUG_CALCULATE_ELBOW_CASE=2.2,l({x:t.x,y:e.y});else if(d)globalThis.__DEBUG_CALCULATE_ELBOW_CASE=2.3,l({x:e.x+n,y:e.y}),l({x:e.x+n,y:t.y+n}),l({x:t.x,y:t.y+n});else if(e.x<t.x)globalThis.__DEBUG_CALCULATE_ELBOW_CASE=2.4,l({x:r,y:e.y}),l({x:r,y:s.y}),l({x:t.x,y:s.y});else if(e.y<=t.y+n)globalThis.__DEBUG_CALCULATE_ELBOW_CASE=2.5,l({x:e.x+n,y:e.y}),l({x:e.x+n,y:e.y+n}),l({x:t.x,y:e.y+n}),l({x:t.x,y:t.y});else globalThis.__DEBUG_CALCULATE_ELBOW_CASE=2.6,l({x:e.x+n,y:e.y}),l({x:e.x+n,y:(e.y+t.y)/2}),l({x:t.x,y:(e.y+t.y)/2});else if(a==="x+"&&c==="x+"&&!h){globalThis.__DEBUG_CALCULATE_ELBOW_CASE=3;let u=Math.max(e.x+n,s.x);l({x:u,y:e.y}),l({x:u,y:t.y})}else if(a==="x+"&&c==="x+"&&h)globalThis.__DEBUG_CALCULATE_ELBOW_CASE=3.1,l({x:e.x+n,y:e.y}),l({x:e.x+n,y:e.y+n}),l({x:t.x+n,y:e.y+n}),l({x:t.x+n,y:t.y});else if(a==="x+"&&c==="y-")if(d&&e.y<=t.y)globalThis.__DEBUG_CALCULATE_ELBOW_CASE=4.11,l({x:e.x+n,y:e.y}),l({x:e.x+n,y:i}),l({x:t.x,y:i});else if(d&&e.y>t.y)globalThis.__DEBUG_CALCULATE_ELBOW_CASE=4.12,l({x:e.x+n,y:e.y}),l({x:e.x+n,y:t.y-n}),l({x:t.x,y:t.y-n});else if(e.x<t.x&&e.y<t.y)globalThis.__DEBUG_CALCULATE_ELBOW_CASE=4.2,l({x:t.x,y:e.y});else if(e.x>t.x&&e.y<t.y){globalThis.__DEBUG_CALCULATE_ELBOW_CASE=4.3;let u=e.x+n;l({x:u,y:e.y}),l({x:u,y:i}),l({x:t.x,y:i})}else if(e.x>t.x&&e.y>t.y){globalThis.__DEBUG_CALCULATE_ELBOW_CASE=4.4;let u=e.x+n;l({x:u,y:e.y}),l({x:u,y:s.y}),l({x:t.x,y:s.y})}else if(e.y===t.y)globalThis.__DEBUG_CALCULATE_ELBOW_CASE=4.5,l({x:e.x+n,y:e.y}),l({x:e.x+n,y:e.y-n}),l({x:t.x,y:e.y-n});else globalThis.__DEBUG_CALCULATE_ELBOW_CASE=4.6,l({x:r,y:e.y}),l({x:r,y:s.y}),l({x:t.x,y:s.y});else if(a==="x+"&&c==="x-"&&e.x+n>=t.x-n&&!h){globalThis.__DEBUG_CALCULATE_ELBOW_CASE=5;let u=e.x+n;l({x:u,y:e.y}),l({x:u,y:i}),l({x:s.x,y:i}),l({x:s.x,y:s.y})}else if(a==="x+"&&c==="x-"&&h&&t.x>e.x);else if(a==="x+"&&c==="x-"&&h)globalThis.__DEBUG_CALCULATE_ELBOW_CASE=7,l({x:e.x+n,y:e.y}),l({x:e.x+n,y:e.y+n}),l({x:t.x-n,y:e.y+n}),l({x:t.x-n,y:e.y});else{if(globalThis.__DEBUG_CALCULATE_ELBOW_CASE=8,a==="x+")l({x:e.x+n,y:e.y});l({x:r,y:o[o.length-1].y}),l({x:r,y:s.y}),l({x:s.x,y:s.y})}return l({x:t.x,y:t.y}),o},Owt=(e,t,n={})=>{let o=e,r=t,i=!1;if(o.x>r.x||o.x===r.x&&o.y>r.y)i=!0,[o,r]=[r,o];let s=o.facingDirection==="x-",a=o.facingDirection==="y-",c=(f)=>{let y=s?o.x-(f.x-o.x):f.x,x=a?o.y-(f.y-o.y):f.y,C=f.facingDirection;if(s){if(C==="x+")C="x-";else if(C==="x-")C="x+"}if(a){if(C==="y+")C="y-";else if(C==="y-")C="y+"}return{x:y,y:x,facingDirection:C}},l=(f,y)=>{let x=f.x-y.x,C=f.y-y.y,b=y.x+C,I=y.y-x,v=f.facingDirection;switch(v){case"x+":v="y-";break;case"y-":v="x-";break;case"x-":v="y+";break;case"y+":v="x+";break}return{x:b,y:I,facingDirection:v}},h=(f,y)=>{let x=f.x-y.x,C=f.y-y.y;return{x:y.x-C,y:y.y+x}},d=s||a?c(o):o,u=s||a?c(r):r,_=d,p=u,m=!1;if(d.facingDirection==="y+")m=!0,_={...d,facingDirection:"x+"},p=l(u,d);let A=n?.overshoot??0.1*Math.max(Math.abs(_.x-p.x),Math.abs(_.y-p.y)),g=XYo(_,p,A);if(m)g=g.map((f)=>h(f,_));if(s||a)g=g.map(({x:f,y})=>({x:s?o.x-(f-o.x):f,y:a?o.y-(y-o.y):y}));return i?g.reverse():g},SYe=class e extends co{static EPSILON=0.01;ctx;out;constructor({ctx:t,issues:n}){super();this.ctx=t,this.out=n}_step(){let t=this.ctx.circuitJson.filter((i)=>i.type==="schematic_port"),n=new Map(t.map((i)=>[i.schematic_port_id,i])),o=new Map(this.ctx.componentPlacements.flatMap((i)=>i.schematicComponentId?[[i.schematicComponentId,i]]:[])),r=new Set;for(let i of this.ctx.circuitJson.filter((s)=>s.type==="schematic_trace")){let s=this.getTracePoints(i),a=this.countTurns(s);if(a!==3)continue;let c=[this.getCandidate({trace:i,points:s,atStart:!0,currentTurnCount:a,ports:t,portsById:n,placementsByComponentId:o}),this.getCandidate({trace:i,points:s,atStart:!1,currentTurnCount:a,ports:t,portsById:n,placementsByComponentId:o})].filter((h)=>Boolean(h));for(let h of[...c]){if(!h.target.sourceComponentName?.startsWith("U"))continue;for(let d of[s[0],s.at(-1)]){let u=this.findPortAtPoint(t,d,i.schematic_sheet_id),_=u?.schematic_component_id?o.get(u.schematic_component_id):void 0;if(!_||!/^[CR]/.test(_.sourceComponentName??""))continue;c.push({target:_,deltaSchX:-h.deltaSchX,deltaSchY:-h.deltaSchY,currentTurnCount:a,suggestedTurnCount:h.suggestedTurnCount})}}let l=(h)=>/^[CR]/.test(h.target.sourceComponentName??"")?0:h.target.sourceComponentName?.startsWith("U")?2:1;c.sort((h,d)=>l(h)-l(d));for(let h of c){if(this.wouldOverlapAnotherComponent(h))continue;if(!this.validateMove(i,h,t))continue;let d=[h.target.schematicComponentId,h.deltaSchX.toFixed(3),h.deltaSchY.toFixed(3)].join("\x00");if(r.has(d))break;r.add(d),this.out.push(this.makeIssue(i,h));break}}this.solved=!0}getCandidate({trace:t,points:n,atStart:o,currentTurnCount:r,ports:i,portsById:s,placementsByComponentId:a}){if(n.length<4)return;let c=o?0:n.length-1,l=o?1:n.length-2,h=o?2:n.length-3,d=o?3:n.length-4,u=n[c],_=n[l],p=n[h],m=n[d],A=o?t.edges[0]:t.edges.at(-1);if(!A)return;let g=o?A.from_schematic_port_id:A.to_schematic_port_id,f=g?s.get(g):this.findPortAtPoint(i,u,t.schematic_sheet_id);if(!f?.schematic_component_id||!f.facing_direction)return;let y=this.getAxis(u,_),x=this.getAxis(_,p),C=this.getAxis(p,m),b=f.facing_direction==="left"||f.facing_direction==="right"?"horizontal":"vertical";if(!y||!x||!C)return;if(y!==b||x===b||C!==b)return;if(!this.isPointInFacingDirection(u,_,f.facing_direction)||!this.isPointInFacingDirection(p,m,f.facing_direction))return;let I=a.get(f.schematic_component_id);if(!I)return;let v=p.x-_.x,P=p.y-_.y;if(Math.abs(v)<=e.EPSILON&&Math.abs(P)<=e.EPSILON)return;let M={x:u.x+v,y:u.y+P},B=o?[M,...n.slice(2)]:[...n.slice(0,-2),M],T=this.countTurns(B);if(T===void 0||T!==1||T>=r)return;return{target:I,deltaSchX:v,deltaSchY:P,currentTurnCount:r,suggestedTurnCount:T}}validateMove(t,n,o){let r=n.target.schematicComponentId,i=n.target.schematicSheetId,s=o.filter((x)=>x.schematic_sheet_id===i),a=s.filter((x)=>x.schematic_component_id===r),c=this.ctx.circuitJson.filter((x)=>x.type==="schematic_trace"&&x.schematic_sheet_id===i),l=(x,C)=>x.edges.some((b)=>b.from_schematic_port_id===C.schematic_port_id||b.to_schematic_port_id===C.schematic_port_id||this.pointsEqual(b.from,C.center)||this.pointsEqual(b.to,C.center)),h=c.filter((x)=>a.some((C)=>l(x,C)));if(!h.includes(t))return!1;if(this.ctx.circuitJson.some((x)=>x.type==="schematic_net_label"&&x.schematic_sheet_id===i&&a.some((C)=>this.pointsEqual(x.anchor_position??x.center,C.center))))return!1;let d=(x)=>({x:x.x+n.deltaSchX,y:x.y+n.deltaSchY}),u={left:"x-",right:"x+",up:"y+",down:"y-"},_=(x,C)=>({...C&&x.schematic_component_id===r?d(x.center):x.center,facingDirection:u[x.facing_direction]}),p=(x)=>x.slice(1).reduce((C,b,I)=>C+Math.abs(b.x-x[I].x)+Math.abs(b.y-x[I].y),0),m=(x)=>x.slice(1).map((C,b)=>({from:x[b],to:C})),A=XM(n.target.schX+n.deltaSchX,n.target.schY+n.deltaSchY,n.target.width,n.target.height),g=c.filter((x)=>!h.includes(x));if(g.some((x)=>x.edges.some((C)=>Gxe(C.from,C.to,aK(A)))))return!1;let f=this.ctx.circuitJson.flatMap((x)=>{if(x.type==="schematic_net_label"&&x.schematic_sheet_id===i)return[aK(Vxe(x))];if(x.type!=="schematic_text"||x.schematic_sheet_id!==i)return[];return VVe(x.schematic_component_id===r?{...x,position:d(x.position)}:x)});if(f.some((x)=>YVe(x,aK(A))))return!1;let y=[];for(let x of h){let C=this.getTracePoints(x);if(C.length<2||x.junctions?.length)return!1;let b=(N,D)=>{let L=s.filter((H)=>D?H.schematic_port_id===D:this.pointsEqual(H.center,N));return L.length===1&&this.pointsEqual(L[0].center,N)?L[0]:void 0},I=b(C[0],x.edges[0].from_schematic_port_id),v=b(C.at(-1),x.edges.at(-1).to_schematic_port_id);if(!I?.facing_direction||!v?.facing_direction)return!1;if(a.some((N)=>l(x,N)&&N!==I&&N!==v))return!1;let P=(N)=>!this.pointsEqual(N,I.center)&&!this.pointsEqual(N,v.center)&&m(C).some(({from:D,to:L})=>Math.abs(Math.hypot(N.x-D.x,N.y-D.y)+Math.hypot(N.x-L.x,N.y-L.y)-Math.hypot(L.x-D.x,L.y-D.y))<0.000001);if(c.some((N)=>N!==x&&N.edges.some((D)=>P(D.from)||P(D.to))))return!1;if(this.ctx.circuitJson.some((N)=>N.type==="schematic_net_label"&&N.schematic_sheet_id===i&&P(N.anchor_position??N.center)))return!1;let M=Owt(_(I,!0),_(v,!0)).filter((N,D,L)=>D===0||!this.pointsEqual(N,L[D-1])),B=this.countTurns(M),T=this.countTurns(C);if(M.length<2||B===void 0||T===void 0||B>T||p(M)>p(C)+0.000001)return!1;if(!this.isPointInFacingDirection(M[0],M[1],I.facing_direction)||!this.isPointInFacingDirection(M.at(-1),M.at(-2),v.facing_direction))return!1;if(x===t){let N=this.countTurns(Owt(_(I,!1),_(v,!1)));if(B>=T||N===void 0||B>=N)return!1;n.suggestedTurnCount=B}for(let N of m(M)){if(f.some((H)=>Gxe(N.from,N.to,H)))return!1;if(this.ctx.componentPlacements.some((H)=>{if(H.schematicSheetId!==i)return!1;let V=H.schematicComponentId===r?A:XM(H.schX,H.schY,H.width,H.height);return Gxe(N.from,N.to,aK(V))}))return!1;let D=GVe(N.from,N.to);if(!D)continue;if([...g.flatMap((H)=>H.edges),...y.flatMap((H)=>m(H.points))].some((H)=>{if([I,v].some((O)=>O.schematic_component_id!==r&&[N.from,N.to].some((U)=>this.pointsEqual(U,O.center))&&[H.from,H.to].some((U)=>this.pointsEqual(U,O.center)))&&this.getAxis(N.from,N.to)!==this.getAxis(H.from,H.to))return!1;let V=GVe(H.from,H.to);return V&&YVe(D,V)}))return!1}y.push({schematicTraceId:x.schematic_trace_id,points:M})}return n.suggestedTraces=y,!0}getTracePoints(t){let n=t.edges[0];if(!n)return[];let o=[n.from];for(let r of t.edges){let i=o.at(-1);if(!this.pointsEqual(i,r.from))return[];o.push(r.to)}return o}countTurns(t){let n=[];for(let[o,r]of t.slice(1).entries()){let i=t[o];if(this.pointsEqual(i,r))continue;let s=this.getAxis(i,r);if(!s)return;n.push(s)}return n.slice(1).filter((o,r)=>o!==n[r]).length}pointsEqual(t,n){let{EPSILON:o}=e;return Math.abs(t.x-n.x)<=o&&Math.abs(t.y-n.y)<=o}getAxis(t,n){let o=Math.abs(n.x-t.x),r=Math.abs(n.y-t.y),{EPSILON:i}=e;if(o<=i&&r>i)return"vertical";if(r<=i&&o>i)return"horizontal";return}isPointInFacingDirection(t,n,o){let{EPSILON:r}=e;switch(o){case"left":return n.x<t.x-r;case"right":return n.x>t.x+r;case"up":return n.y>t.y+r;case"down":return n.y<t.y-r}}findPortAtPoint(t,n,o){let{EPSILON:r}=e;return t.find((i)=>i.schematic_sheet_id===o&&Math.abs(i.center.x-n.x)<=r&&Math.abs(i.center.y-n.y)<=r)}wouldOverlapAnotherComponent(t){let n=XM(t.target.schX+t.deltaSchX,t.target.schY+t.deltaSchY,t.target.width,t.target.height);return this.ctx.componentPlacements.some((o)=>{if(o===t.target)return!1;if(o.schematicSheetId!==t.target.schematicSheetId)return!1;return Boolean(jxe(n,XM(o.schX,o.schY,o.width,o.height)))})}makeIssue(t,n){let o=n.target.sourceComponentName||"component",r=this.getMoveDirection(n.deltaSchX,n.deltaSchY),i=Math.abs(n.deltaSchX||n.deltaSchY),s=n.target.schX+n.deltaSchX,a=n.target.schY+n.deltaSchY;return{lineItemType:"TraceCanBeSimplifiedByMovingComponent",schematicTraceId:t.schematic_trace_id,traceName:TBt(this.ctx.circuitJson,t),targetComponent:n.target,deltaSchX:n.deltaSchX,deltaSchY:n.deltaSchY,newSchX:s,newSchY:a,currentTurnCount:n.currentTurnCount,suggestedTurnCount:n.suggestedTurnCount,suggestedTraces:n.suggestedTraces,message:`move ${o} ${r} by ${yse(i)} (to schX=${yse(s)}, schY=${yse(a)}) to reduce this trace from ${n.currentTurnCount} turns to ${n.suggestedTurnCount}`}}getMoveDirection(t,n){if(Math.abs(t)>e.EPSILON)return t>0?"right":"left";return n>0?"up":"down"}static issueToString(t){let n=[];return sn(n,"traceName",t.traceName),sn(n,"targetComponentName",t.targetComponent.sourceComponentName),sn(n,"deltaSchX",t.deltaSchX,{formatDelta:!0}),sn(n,"deltaSchY",t.deltaSchY,{formatDelta:!0}),sn(n,"newSchX",t.newSchX),sn(n,"newSchY",t.newSchY),sn(n,"currentTurnCount",t.currentTurnCount),sn(n,"suggestedTurnCount",t.suggestedTurnCount),sn(n,"message",t.message),`<TraceCanBeSimplifiedByMovingComponent ${n.join(" ")} />`}};function jYo(e){let t=new Set,n=new Map;for(let i of e){if(i.type!=="source_net"&&i.type!=="source_port")continue;let s=i.type==="source_net"?i.source_net_id:i.source_port_id;if(i.type==="source_net"?i.is_power||i.is_ground||i.is_positive_voltage_source:i.provides_power||i.requires_power||i.provides_ground||i.requires_ground)t.add(s);let c=i.subcircuit_connectivity_map_key;if(c!==void 0){let l=n.get(c)??[];l.push(s),n.set(c,l)}}let o=q8(e),r=fM([...Object.values(o.netMap),...n.values()]);for(let i of Object.values(r))if(i.some((s)=>t.has(s)))for(let s of i)t.add(s);return t}var PYe=class e extends co{static EPSILON=0.01;ctx;out;powerOrGroundConnectionIds;constructor({ctx:t,issues:n}){super();this.ctx=t,this.out=n,this.powerOrGroundConnectionIds=jYo(t.circuitJson)}_step(){let t=this.ctx.circuitJson.filter((s)=>s.type==="schematic_port"),n=new Map(t.map((s)=>[s.schematic_port_id,s])),o=new Map;for(let s of t){if(!s.schematic_component_id)continue;let a=o.get(s.schematic_component_id)??[];a.push(s),o.set(s.schematic_component_id,a)}let r=new Map(this.ctx.componentPlacements.flatMap((s)=>s.schematicComponentId?[[s.schematicComponentId,s]]:[])),i=new Map;for(let s of this.ctx.circuitJson.filter((a)=>a.type==="schematic_trace")){let a=this.getTracePoints(s),c=this.countTurns(a);if(c===void 0||c<2)continue;let l=this.getTraceEndpoints(s,a,t,n);if(!l)continue;for(let[h,d]of[l,[l[1],l[0]]]){let u=this.getFlipCandidate({trace:s,targetEndpoint:h,connectedEndpoint:d,currentTurnCount:c,portsByComponentId:o,placementsByComponentId:r});if(!u)continue;let _=u.targetPort.schematic_component_id,p=i.get(_);if(!p||this.isBetterCandidate(u,p))i.set(_,u)}}for(let s of i.values())this.out.push(this.makeIssue(s));this.solved=!0}getFlipCandidate({trace:t,targetEndpoint:n,connectedEndpoint:o,currentTurnCount:r,portsByComponentId:i,placementsByComponentId:s}){let a=n.port,c=o.port,l=a.schematic_component_id,h=c.schematic_component_id;if(!l||!h||l===h||a.schematic_sheet_id!==c.schematic_sheet_id)return;let d=i.get(l);if(d?.length!==2)return;if(d.some((x)=>x.source_port_id&&this.powerOrGroundConnectionIds.has(x.source_port_id)))return;if((i.get(h)??[]).length<=2)return;let _=d.find((x)=>x.schematic_port_id!==a.schematic_port_id);if(!_||!this.areOppositePorts(a,_))return;let p=a.facing_direction,m=_.facing_direction;if(!p||!m)return;if(!this.traceLeavesPortInFacingDirection(n))return;let A=c.center;if(this.isPointInFacingDirection(a.center,A,p)||!this.isPointInFacingDirection(_.center,A,m)||!c.facing_direction||!this.isPointInFacingDirection(A,_.center,c.facing_direction))return;let g=this.getMinimumTurnCount(_.center,A,m);if(g>=r)return;let f=s.get(l),y=s.get(h);if(!f||!y)return;return{trace:t,targetPort:a,targetPlacement:f,connectedPlacement:y,suggestedFacingDirection:m,currentTurnCount:r,suggestedTurnCount:g,traceLength:this.getTraceLength(n.pointsFromEndpoint)}}getTraceEndpoints(t,n,o,r){let i=t.edges[0],s=t.edges.at(-1);if(!i||!s||n.length<2)return;let a=i.from_schematic_port_id?r.get(i.from_schematic_port_id):this.findPortAtPoint(o,n[0],t.schematic_sheet_id),c=s.to_schematic_port_id?r.get(s.to_schematic_port_id):this.findPortAtPoint(o,n.at(-1),t.schematic_sheet_id);if(!a||!c)return;return[{port:a,pointsFromEndpoint:n},{port:c,pointsFromEndpoint:[...n].reverse()}]}getTracePoints(t){let n=t.edges[0];if(!n)return[];let o=[n.from];for(let r of t.edges){if(!this.pointsEqual(o.at(-1),r.from))return[];o.push(r.to)}return o}countTurns(t){let n=[];for(let[o,r]of t.slice(1).entries()){let i=t[o];if(this.pointsEqual(i,r))continue;let s=this.getAxis(i,r);if(!s)return;if(n.at(-1)!==s)n.push(s)}return Math.max(0,n.length-1)}traceLeavesPortInFacingDirection(t){let n=t.pointsFromEndpoint.find((o)=>!this.pointsEqual(o,t.port.center));return Boolean(n&&t.port.facing_direction&&this.isPointInFacingDirection(t.port.center,n,t.port.facing_direction))}areOppositePorts(t,n){let o=(t.facing_direction==="left"&&n.facing_direction==="right"||t.facing_direction==="right"&&n.facing_direction==="left")&&Math.abs(t.center.y-n.center.y)<=e.EPSILON,r=(t.facing_direction==="up"&&n.facing_direction==="down"||t.facing_direction==="down"&&n.facing_direction==="up")&&Math.abs(t.center.x-n.center.x)<=e.EPSILON;return o||r}getMinimumTurnCount(t,n,o){return(o==="left"||o==="right"?Math.abs(t.y-n.y)<=e.EPSILON:Math.abs(t.x-n.x)<=e.EPSILON)?0:1}isPointInFacingDirection(t,n,o){let{EPSILON:r}=e;switch(o){case"left":return n.x<t.x-r;case"right":return n.x>t.x+r;case"up":return n.y>t.y+r;case"down":return n.y<t.y-r}}getAxis(t,n){let o=Math.abs(t.x-n.x),r=Math.abs(t.y-n.y),{EPSILON:i}=e;if(o<=i&&r>i)return"vertical";if(r<=i&&o>i)return"horizontal";return}pointsEqual(t,n){let{EPSILON:o}=e;return Math.abs(t.x-n.x)<=o&&Math.abs(t.y-n.y)<=o}findPortAtPoint(t,n,o){return t.find((r)=>r.schematic_sheet_id===o&&this.pointsEqual(r.center,n))}getTraceLength(t){return t.slice(1).reduce((n,o,r)=>{let i=t[r];return n+Math.abs(o.x-i.x)+Math.abs(o.y-i.y)},0)}isBetterCandidate(t,n){let o=t.currentTurnCount-t.suggestedTurnCount,r=n.currentTurnCount-n.suggestedTurnCount;return o>r||o===r&&t.traceLength>n.traceLength}makeIssue(t){let n=t.targetPlacement.sourceComponentName||"component",o=t.connectedPlacement.sourceComponentName||"component",r=t.targetPort.pin_number?`pin${t.targetPort.pin_number}`:t.targetPort.display_pin_label;return{lineItemType:"TwoPinComponentCouldBeFlipped",schematicTraceId:t.trace.schematic_trace_id,traceName:TBt(this.ctx.circuitJson,t.trace),targetComponent:t.targetPlacement,connectedComponent:t.connectedPlacement,targetPin:r,currentFacingDirection:t.targetPort.facing_direction,suggestedFacingDirection:t.suggestedFacingDirection,deltaSchRotation:180,currentTurnCount:t.currentTurnCount,suggestedTurnCount:t.suggestedTurnCount,message:`rotate ${n} by 180° so ${r??"its connected pin"} faces ${o} and reduce this trace from ${t.currentTurnCount} turns to ${t.suggestedTurnCount}`}}static issueToString(t){let n=[];return sn(n,"traceName",t.traceName),sn(n,"targetComponentName",t.targetComponent.sourceComponentName),sn(n,"connectedComponentName",t.connectedComponent.sourceComponentName),sn(n,"targetPin",t.targetPin),sn(n,"currentFacingDirection",t.currentFacingDirection),sn(n,"suggestedFacingDirection",t.suggestedFacingDirection),sn(n,"deltaSchRotation",t.deltaSchRotation),sn(n,"currentTurnCount",t.currentTurnCount),sn(n,"suggestedTurnCount",t.suggestedTurnCount),sn(n,"message",t.message),`<TwoPinComponentCouldBeFlipped ${n.join(" ")} />`}};var EYe=class extends co{constructor(e){super();this.params=e;let{circuitJson:t}=e.ctx;this.netLabels=t.filter((n)=>this.isSchematicNetLabel(n)),this.tokenToInvolvedPin=this.buildTokenToInvolvedPinMap(t),this.schematicSheetNameById=vYe(t),this.solved=this.netLabels.length===0}params;VERBOSE_NET_LABEL_MESSAGE="Create trace with schDisplayLabel";netLabels;tokenToInvolvedPin;schematicSheetNameById;currentIndex=0;seen=new Set;_step(){let e=this.netLabels[this.currentIndex++];if(!e){this.solved=!0;return}this.solved=this.currentIndex>=this.netLabels.length;let t=`${e.schematic_sheet_id??""}:${e.text}`;if(!e.text.includes("/")||this.seen.has(t))return;this.seen.add(t);let n;if(e.schematic_sheet_id)n=this.schematicSheetNameById.get(e.schematic_sheet_id);let o={lineItemType:"VerboseSchematicNetLabel",schematicNetLabelId:e.schematic_net_label_id,sourceNetId:e.source_net_id,schematicSheetId:e.schematic_sheet_id,schematicSheetName:n,text:e.text,involvedPins:this.getInvolvedPins(e.text,this.tokenToInvolvedPin),schX:e.center.x,schY:e.center.y,message:this.VERBOSE_NET_LABEL_MESSAGE};this.params.issues.push(o)}static issueToString(e){let t=[];return sn(t,"message",e.message),sn(t,"text",e.text),sn(t,"involvedPins",e.involvedPins.join(",")),sn(t,"schSheetName",e.schematicSheetName),sn(t,"schX",e.schX),sn(t,"schY",e.schY),`<VerboseSchematicNetLabel ${t.join(" ")} />`}isSchematicNetLabel(e){return e.type==="schematic_net_label"}isSourcePort(e){return e.type==="source_port"}getSourceComponentWithName(e){if(e.type!=="source_component"||!("source_component_id"in e)||!("name"in e)||typeof e.source_component_id!=="string"||typeof e.name!=="string")return null;return{source_component_id:e.source_component_id,name:e.name}}getSourcePortNameCandidates(e){return[e.most_frequently_referenced_by_name,e.name,...e.port_hints??[],e.pin_number===void 0?void 0:String(e.pin_number)].filter((t)=>Boolean(t))}getBestSourcePortName(e){return e.most_frequently_referenced_by_name??e.name??(e.pin_number===void 0?"":`pin${e.pin_number}`)}buildTokenToInvolvedPinMap(e){let t=new Map(e.flatMap((o)=>{let r=this.getSourceComponentWithName(o);return r?[r]:[]}).map((o)=>[o.source_component_id,o])),n=new Map;for(let o of e.filter((r)=>this.isSourcePort(r))){if(!o.source_component_id)continue;let r=t.get(o.source_component_id);if(!r?.name)continue;let i=`${r.name}.${this.getBestSourcePortName(o)}`;for(let s of this.getSourcePortNameCandidates(o))n.set(`${r.name}_${s}`,i)}return n}getInvolvedPins(e,t){let n=new Set;for(let o of e.split("/")){let r=t.get(o);if(r)n.add(r)}return Array.from(n)}},MYe=class extends co{constructor(e){super();this.params=e;let{ctx:t}=e;this.sheetNames=vYe(t.circuitJson);let n=new Set(t.circuitJson.flatMap((r)=>r.type==="schematic_component"&&r.is_box_with_pins===!1&&!r.symbol_name?[r.schematic_component_id]:[])),o=new Set;this.texts=t.circuitJson.flatMap((r)=>{if(r.type!=="schematic_text")return[];if(r.schematic_component_id||r.schematic_symbol_id)return[];let i=VVe(r);if(!i.length)return[];let s=r.schematic_sheet_id,a=JSON.stringify([s,r.text,r.position.x,r.position.y,r.font_size,r.anchor,r.rotation,r.color]);if(o.has(a))return[];return o.add(a),[{text:r,isTraceLabel:Boolean("source_trace_id"in r&&r.source_trace_id),polygons:i,sheetId:s,object:{type:"text",id:r.schematic_text_id,text:r.text}}]}),this.obstacles=[...t.componentPlacements.flatMap((r)=>r.schematicComponentId&&!n.has(r.schematicComponentId)?[{object:{type:"component",id:r.schematicComponentId,componentName:r.sourceComponentName,schematicComponentId:r.schematicComponentId},polygons:[aK(XM(r.schX,r.schY,r.width,r.height))],sheetId:r.schematicSheetId}]:[]),...t.circuitJson.flatMap((r)=>r.type==="schematic_trace"?[{object:{type:"trace",id:r.schematic_trace_id},sheetId:r.schematic_sheet_id,segments:r.edges,polygons:r.edges.flatMap((i)=>{let s=GVe(i.from,i.to);return s?[s]:[]})}]:[])],this.solved=this.texts.length===0}params;texts;obstacles;sheetNames;index=0;_step(){let e=this.texts[this.index],n=[...this.obstacles,...this.texts.slice(this.index+1)].filter((o)=>this.collides(e,o));if(n.length){let o=e.isTraceLabel?void 0:this.findClearPosition(e);for(let r of n){let i=r.object.componentName??r.object.text;this.params.issues.push({lineItemType:"SchematicTextCollision",schematicSheetId:e.sheetId,schematicSheetName:e.sheetId?this.sheetNames.get(e.sheetId):void 0,schematicTextId:e.text.schematic_text_id,text:e.text.text,collidingObject:r.object,textBounds:Lwt(e.polygons),collidingObjectBounds:Lwt(r.polygons),suggestedMove:o,message:`Text "${e.text.text}" overlaps ${r.object.type}${i?` ${i}`:""}; ${e.isTraceLabel?"adjust the owning trace's label placement or remove stale duplicates to leave the visible text area clear.":"reposition the text to leave its visible area clear."}`})}}this.index++,this.solved=this.index>=this.texts.length}collides(e,t){if(e.sheetId!==t.sheetId)return!1;return e.polygons.some((n)=>t.segments?t.segments.some((o)=>Gxe(o.from,o.to,n)):t.polygons.some((o)=>YVe(n,o)))}findClearPosition(e){let t=[...this.obstacles,...this.texts.filter((o)=>o!==e)],n=Math.max(0.1,e.text.font_size/2);for(let o=n;o<=Math.max(4,e.text.font_size*8);o+=n)for(let[r,i]of[[0,o],[0,-o],[-o,0],[o,0]]){let s=Math.round((e.text.position.x+r)*1000)/1000,a=Math.round((e.text.position.y+i)*1000)/1000,c={...e,polygons:VVe({...e.text,position:{x:s,y:a}})};if(t.every((l)=>!this.collides(c,l)))return{newSchX:s,newSchY:a}}return}static issueToString(e){let t=[];return sn(t,"text",e.text),sn(t,"collidingObjectType",e.collidingObject.type),sn(t,"collidingText",e.collidingObject.text),sn(t,"newSchX",e.suggestedMove?.newSchX),sn(t,"newSchY",e.suggestedMove?.newSchY),sn(t,"message",e.message),`<SchematicTextCollision ${t.join(" ")} />`}},wYe=class e extends co{constructor(t){super();this.params=t,this.networks=this.findNetworks(t.ctx),this.solved=this.networks.length===0}params;static MIN_DISTANCE=6;networks;index=0;_step(){let t=this.networks[this.index],n=t.members.slice(0,2),o=Math.max(e.MIN_DISTANCE,...n.map((i)=>3*Math.max(i.width,i.height))),r=n.map((i)=>Math.hypot(Math.max(0,Math.abs(i.schX-t.pinPosition.x)-i.width/2),Math.max(0,Math.abs(i.schY-t.pinPosition.y)-i.height/2)));if(r.some((i)=>i>o)){let i=t.host.sourceComponentName||"component",s=Vwt(t.pin),a=n.map((c)=>c.sourceComponentName||"component").join(", ");this.params.issues.push({lineItemType:"ResetNetworkNotGrouped",hostSchematicBox:t.host,resetSourcePortId:t.pin.source_port_id,resetPinName:s,supportNetworkComponents:t.members,maxDistanceFromResetPin:Math.round(Math.max(...r)*100)/100,maxRecommendedDistance:o,message:`Group ${a} near ${i}.${s} so the reset pull-up and capacitor can be read together. Preserve all net connections; associated test points may remain in a debug area.`})}this.index++,this.solved=this.index>=this.networks.length}findNetworks(t){let n=IBt(t.circuitJson),o=t.circuitJson.filter((m)=>m.type==="source_component"),r=new Map(o.map((m)=>[m.source_component_id,m])),i=t.circuitJson.filter((m)=>m.type==="source_port"),s=new Map,a=new Map,c=new Set,l=new Set;for(let m of i){if(!m.source_component_id)continue;let A=s.get(m.source_component_id)??[];A.push(m),s.set(m.source_component_id,A);let g=n(m.source_port_id),f=a.get(g)??[];if(f.push(m),a.set(g,f),m.provides_power||m.requires_power)c.add(g);if(m.provides_ground||m.requires_ground)l.add(g)}for(let m of t.circuitJson){if(m.type!=="source_net")continue;if(m.is_power||m.is_positive_voltage_source)c.add(n(m.source_net_id));if(m.is_ground)l.add(n(m.source_net_id))}let h=new Map(t.componentPlacements.flatMap((m)=>m.sourceComponentId?[[m.sourceComponentId,m]]:[])),d=t.circuitJson.filter((m)=>m.type==="schematic_port"),u=new Map(t.circuitJson.filter((m)=>m.type==="schematic_component").map((m)=>[m.schematic_component_id,m])),_=[],p=new Set;for(let m of i){if(!m.source_component_id||!Vwt(m)||m.do_not_connect)continue;if(r.get(m.source_component_id)?.ftype!=="simple_chip")continue;let A=n(m.source_port_id);if(p.has(A)||c.has(A)||l.has(A))continue;p.add(A);let g=a.get(A)??[];if(new Set(g.filter((B)=>B.source_component_id&&r.get(B.source_component_id)?.ftype==="simple_chip").map((B)=>B.source_component_id)).size!==1)continue;let y=h.get(m.source_component_id),x=d.find((B)=>B.source_port_id===m.source_port_id&&B.schematic_component_id===y?.schematicComponentId);if(!y||!x||x.schematic_sheet_id!==y.schematicSheetId)continue;let C=[],b=[],I=[],v=!1;for(let B of new Set(g.map((T)=>T.source_component_id))){if(!B||B===m.source_component_id)continue;let T=r.get(B)?.ftype,N=s.get(B)??[],D=h.get(B);if(T==="simple_connector"||T==="simple_pin_header")continue;if(!D){v=!0;break}if(T==="simple_test_point"&&N.length===1){I.push(D);continue}if(N.length!==2){v=!0;break}let L=N.find((V)=>n(V.source_port_id)!==A);if(!L){v=!0;break}let H=n(L.source_port_id);if(T==="simple_resistor"&&c.has(H)&&!l.has(H))C.push(D);else if(T==="simple_capacitor"&&l.has(H)&&!c.has(H))b.push(D);else{v=!0;break}}if(v||C.length!==1||b.length!==1)continue;let P=[...C,...b,...I],M=y.schematicComponentId?u.get(y.schematicComponentId)?.schematic_group_id:void 0;if(P.some((B)=>{let T=B.schematicComponentId?u.get(B.schematicComponentId)?.schematic_group_id:void 0;return B.schematicSheetId!==y.schematicSheetId||B.subcircuitId!==y.subcircuitId||T!==M}))continue;_.push({host:y,pin:m,pinPosition:x.center,members:P})}return _}static issueToString(t){let n=[];return sn(n,"hostComponentName",t.hostSchematicBox.sourceComponentName),sn(n,"resetPin",t.resetPinName),sn(n,"supportNetworkComponents",t.supportNetworkComponents.map((o)=>o.sourceComponentName||"component").join(",")),sn(n,"maxDistanceFromResetPin",t.maxDistanceFromResetPin),sn(n,"maxRecommendedDistance",t.maxRecommendedDistance),sn(n,"message",t.message),`<ResetNetworkNotGrouped ${n.join(" ")} />`}},Vwt=(e)=>[e.name,...e.port_hints??[]].find((t)=>/^N?(RESET|RST)(N|B)?$/.test(t.toUpperCase().replace(/[_\-!~#/]/g,""))),KYo={SeriesLedChainNotOrdered:[qVe],RailPathTooSpreadOut:[tYe],ResistorSeparatedFromChipPin:[ZVe],CapacitorSeparatedFromChipPins:[nYe],DiodeCapacitorJunctionTooSpreadOut:[$Ve],PiFilterComponentsNotGrouped:[oYe],MosfetGateNetworkNotGrouped:[rYe],FlybackDiodeSeparatedFromRelayCoil:[iYe],ComponentOverlap:[bYe],SchematicBoxHasALotOfSurroundingWhitespace:[],CapacitorSymbolHorizontal:[uYe,bse],VerboseSchematicNetLabel:[EYe],PinHeaderSchematicBoxTooWide:[Kxe],GenericSchematicBoxTooWide:[Kxe],SchematicBoxInnerLabelCollision:[CYe],SchematicPinPaddingToEdgeTooLarge:[IYe],DiodeResistorNotAligned:[gYe],ParallelRcNotAligned:[JVe],ParallelDiodeResistorNotAligned:[eYe],ComponentPinsWouldAlignWithVerticalShift:[mYe],TraceCanBeSimplifiedByMovingComponent:[SYe],CrystalNotCenteredOverLoadCapacitors:[_Ye],ComponentNetLabelCollision:[Cse],ComponentBoxNetLabelCollision:[Cse],NetLabelCollision:[Cse],FeedbackNetworkNotCompact:[AYe],PullResistorOnWrongSide:[fYe,BBt],SchematicTextCollision:[MYe],ResetNetworkNotGrouped:[wYe],TwoPinComponentCouldBeFlipped:[PYe],TwoPinComponentShouldBeVertical:[bse],TwoPinComponentHasInvertedRails:[bse],DecouplingCapacitorsNotCloseTogether:[pYe],ConnectorPositionCausesTraceDetours:[lYe],LowSideTransistorNotAlignedWithLoad:[hYe],UsbSeriesResistorsNotAligned:[dYe],CurrentSenseShuntSeparatedFromInputs:[sYe],VoltageDividerSupplyResistorBelowGroundResistor:[aYe],RegulatorCapacitorsOnWrongSides:[cYe]},$Yo=class extends XC{ctx;issues=[];pipelineDef=[xi("SeriesLedChainPlacementSolver",qVe,(e)=>[{ctx:e.ctx,issues:e.issues}]),xi("ParallelRcPlacementSolver",JVe,(e)=>[{ctx:e.ctx,issues:e.issues}]),xi("ParallelDiodeResistorPlacementSolver",eYe,(e)=>[{ctx:e.ctx,issues:e.issues}]),xi("SchematicTextClearanceSolver",MYe,(e)=>[{ctx:e.ctx,issues:e.issues}]),xi("ResetNetworkGroupingSolver",wYe,(e)=>[{ctx:e.ctx,issues:e.issues}]),xi("SchematicBoxOverlapSolver",bYe,(e)=>[{ctx:e.ctx,issues:e.issues}]),xi("CapacitorOrientationSolver",uYe,(e)=>[{ctx:e.ctx,issues:e.issues}]),xi("VerboseNetLabelSolver",EYe,(e)=>[{ctx:e.ctx,issues:e.issues}]),xi("SchematicBoxTooWideSolver",Kxe,(e)=>[{ctx:e.ctx,issues:e.issues}]),xi("SchematicPinPaddingToEdgeSolver",IYe,(e)=>[{ctx:e.ctx,issues:e.issues}]),xi("SchematicBoxInnerLabelCollisionSolver",CYe,(e)=>[{ctx:e.ctx,issues:e.issues}]),xi("DiodeResistorAlignmentSolver",gYe,(e)=>[{ctx:e.ctx,issues:e.issues}]),xi("ComponentPinAlignmentSolver",mYe,(e)=>[{ctx:e.ctx,issues:e.issues}]),xi("TraceSimplificationSolver",SYe,(e)=>[{ctx:e.ctx,issues:e.issues}]),xi("CrystalLoadCapacitorPlacementSolver",_Ye,(e)=>[{ctx:e.ctx,issues:e.issues}]),xi("TwoPinComponentOrientationSolver",PYe,(e)=>[{ctx:e.ctx,issues:e.issues}]),xi("FeedbackNetworkPlacementSolver",AYe,(e)=>[{ctx:e.ctx,issues:e.issues}]),xi("TwoPinComponentRailOrientationSolver",bse,(e)=>[{ctx:e.ctx,issues:e.issues}]),xi("PullResistorPlacementSolver",fYe,(e)=>[{ctx:e.ctx,issues:e.issues}]),xi("SwitchPullResistorPlacementSolver",BBt,(e)=>[{ctx:e.ctx,issues:e.issues}]),xi("ComponentNetLabelCollisionSolver",Cse,(e)=>[{ctx:e.ctx,issues:e.issues}]),xi("DecouplingCapacitorGroupingSolver",pYe,(e)=>[{ctx:e.ctx,issues:e.issues}]),xi("ConnectorPlacementSolver",lYe,(e)=>[{ctx:e.ctx,issues:e.issues}]),xi("LowSideTransistorPlacementSolver",hYe,(e)=>[{ctx:e.ctx,issues:e.issues}]),xi("UsbSeriesResistorPlacementSolver",dYe,(e)=>[{ctx:e.ctx,issues:e.issues}]),xi("RegulatorInputOutputCapacitorPlacementSolver",cYe,(e)=>[{ctx:e.ctx,issues:e.issues}]),xi("VoltageDividerPlacementSolver",aYe,(e)=>[{ctx:e.ctx,issues:e.issues}]),xi("CurrentSenseShuntPlacementSolver",sYe,(e)=>[{ctx:e.ctx,issues:e.issues}]),xi("RelayFlybackDiodePlacementSolver",iYe,(e)=>[{ctx:e.ctx,issues:e.issues}]),xi("DiodeCapacitorStagePlacementSolver",$Ve,(e)=>[{ctx:e.ctx,issues:e.issues}]),xi("PiFilterPlacementSolver",oYe,(e)=>[{ctx:e.ctx,issues:e.issues}]),xi("MosfetGateNetworkPlacementSolver",rYe,(e)=>[{ctx:e.ctx,issues:e.issues}]),xi("ChipPinResistorPlacementSolver",ZVe,(e)=>[{ctx:e.ctx,issues:e.issues}]),xi("ChipPinPairCapacitorPlacementSolver",nYe,(e)=>[{ctx:e.ctx,issues:e.issues}]),xi("RailPathVisibilitySolver",tYe,(e)=>[{ctx:e.ctx,issues:e.issues,maxSpan:e.railPathVisibility?.maxSpan,maxLength:e.railPathVisibility?.maxPathLength}])];selectedIssueTypes;railPathVisibility;constructor(e,t={}){super(e);if(this.railPathVisibility=t.railPathVisibility,t.issueTypes!==void 0){this.selectedIssueTypes=new Set(t.issueTypes);let n=new Set(t.issueTypes.flatMap((o)=>KYo[o]));this.pipelineDef=this.pipelineDef.filter((o)=>n.has(o.solverClass))}}_setup(){this.ctx=WYo(this.inputProblem)}getOutput(){let e=new Set(this.issues.flatMap((t)=>t.lineItemType==="TwoPinComponentShouldBeVertical"&&t.schematicBox.schematicComponentId?[t.schematicBox.schematicComponentId]:[]));return{issues:this.issues.filter((t)=>t.lineItemType!=="CapacitorSymbolHorizontal"||!e.has(t.schematicBox.schematicComponentId??"")).filter((t)=>this.selectedIssueTypes===void 0||this.selectedIssueTypes.has(t.lineItemType)),componentPlacements:this.ctx.componentPlacements}}},Ywt=0.01,qYo=({issues:e,componentPlacements:t,circuitJson:n})=>{let o=new Set,r=new Map(t.flatMap((c)=>c.schematicComponentId?[[c.schematicComponentId,c]]:[])),i=new Map;for(let c of t){if(!c.sourceComponentName)continue;let l=i.get(c.sourceComponentName);if(l)l.push(c);else i.set(c.sourceComponentName,[c])}let s=(c)=>{if(!c)return;let l=c.schematicComponentId?r.get(c.schematicComponentId):t.find((h)=>h.sourceComponentId===c.sourceComponentId&&h.schX===c.schX&&h.schY===c.schY);if(l)o.add(l)},a=(c,l)=>{if(!c)return;for(let h of i.get(c)??[])if(l===void 0||h.schematicSheetId===l)o.add(h)};for(let c of e)switch(c.lineItemType){case"SeriesLedChainNotOrdered":for(let l of c.ledSchematicBoxes)s(l);break;case"ResistorSeparatedFromChipPin":s(c.hostSchematicBox),s(c.resistorSchematicBox);break;case"CapacitorSeparatedFromChipPins":s(c.hostSchematicBox),s(c.capacitorSchematicBox);break;case"DiodeCapacitorJunctionTooSpreadOut":s(c.capacitorSchematicBox);for(let l of c.diodeSchematicBoxes)s(l);break;case"PiFilterComponentsNotGrouped":s(c.inductorSchematicBox),s(c.firstCapacitorSchematicBox),s(c.secondCapacitorSchematicBox);break;case"MosfetGateNetworkNotGrouped":s(c.mosfetSchematicBox),s(c.seriesGateResistorSchematicBox),s(c.gateSourceResistorSchematicBox);break;case"FlybackDiodeSeparatedFromRelayCoil":s(c.relaySchematicBox),s(c.diodeSchematicBox);break;case"CurrentSenseShuntSeparatedFromInputs":s(c.amplifierSchematicBox),s(c.shuntSchematicBox);break;case"VoltageDividerSupplyResistorBelowGroundResistor":s(c.supplyResistorSchematicBox),s(c.groundResistorSchematicBox);break;case"RegulatorCapacitorsOnWrongSides":s(c.regulatorSchematicBox),s(c.inputCapacitorSchematicBox),s(c.outputCapacitorSchematicBox);break;case"UsbSeriesResistorsNotAligned":s(c.positiveResistorSchematicBox),s(c.negativeResistorSchematicBox);break;case"LowSideTransistorNotAlignedWithLoad":s(c.transistorSchematicBox),s(c.loadSchematicBox),s(c.baseResistorSchematicBox),s(c.clampDiodeSchematicBox);break;case"DecouplingCapacitorsNotCloseTogether":for(let l of c.capacitorSchematicBoxes)s(l);break;case"ConnectorPositionCausesTraceDetours":s(c.connectorSchematicBox);for(let l of c.connectedComponents)s(l);break;case"ResetNetworkNotGrouped":s(c.hostSchematicBox);for(let l of c.supportNetworkComponents)s(l);break;case"SchematicTextCollision":if(c.collidingObject.schematicComponentId)s(r.get(c.collidingObject.schematicComponentId));if(c.collidingObject.type==="trace")for(let l of Uwt({schematicTraceId:c.collidingObject.id,circuitJson:n,placementByComponentId:r}))s(l);break;case"ComponentOverlap":s(c.firstComponent),s(c.secondComponent);break;case"SchematicBoxHasALotOfSurroundingWhitespace":case"CapacitorSymbolHorizontal":case"PinHeaderSchematicBoxTooWide":case"GenericSchematicBoxTooWide":case"SchematicBoxInnerLabelCollision":case"SchematicPinPaddingToEdgeTooLarge":s(c.schematicBox);break;case"VerboseSchematicNetLabel":for(let l of c.involvedPins)a(JYo(l),c.schematicSheetId);break;case"ParallelRcNotAligned":s(c.resistorSchematicBox),s(c.capacitorSchematicBox);break;case"ParallelDiodeResistorNotAligned":case"DiodeResistorNotAligned":s(c.diodeSchematicBox),s(c.resistorSchematicBox);break;case"ComponentPinsWouldAlignWithVerticalShift":s(c.firstComponent),s(c.secondComponent),s(c.targetComponent);break;case"TraceCanBeSimplifiedByMovingComponent":s(c.targetComponent);for(let l of Uwt({schematicTraceId:c.schematicTraceId,circuitJson:n,placementByComponentId:r}))o.add(l);break;case"CrystalNotCenteredOverLoadCapacitors":s(c.crystalSchematicBox),s(c.firstLoadCapacitorSchematicBox),s(c.secondLoadCapacitorSchematicBox);break;case"TwoPinComponentCouldBeFlipped":s(c.targetComponent),s(c.connectedComponent);break;case"FeedbackNetworkNotCompact":s(c.amplifierSchematicBox);for(let l of c.feedbackComponents)s(l);break;case"TwoPinComponentShouldBeVertical":case"TwoPinComponentHasInvertedRails":s(c.schematicBox);break;case"RailPathTooSpreadOut":s(c.hostSchematicBox);for(let l of c.supportSchematicBoxes)s(l);break;case"PullResistorOnWrongSide":s(c.resistorSchematicBox),s(c.hostSchematicBox);break;case"ComponentNetLabelCollision":s(c.firstComponent),s(c.secondComponent);break;case"ComponentBoxNetLabelCollision":s(c.boxComponent),s(c.labelComponent);break;case"NetLabelCollision":for(let l of c.pairs)a(l.comp1Name,c.schematicSheetId),a(l.comp2Name,c.schematicSheetId);for(let l of c.moves)a(l.componentName,c.schematicSheetId);break}return t.filter((c)=>o.has(c))},Gwt=(e)=>{if("schematicSheetId"in e||"schematicSheetName"in e){let t="schematicSheetId"in e&&typeof e.schematicSheetId==="string"?e.schematicSheetId:void 0,n="schematicSheetName"in e&&typeof e.schematicSheetName==="string"?e.schematicSheetName:void 0;if(t||n)return{schematicSheetId:t,schematicSheetName:n}}for(let t of Object.values(e).flat())if(ZYo(t))return{schematicSheetId:t.schematicSheetId,schematicSheetName:t.schematicSheetName};return{}},JYo=(e)=>{let t=e.lastIndexOf(".");return t===-1?e:e.slice(0,t)},ZYo=(e)=>Boolean(e&&typeof e==="object"&&"positionAnchor"in e&&e.positionAnchor==="center"&&"schX"in e&&"schY"in e&&"width"in e&&"height"in e),Uwt=({schematicTraceId:e,circuitJson:t,placementByComponentId:n})=>{let o=t.find((l)=>l.type==="schematic_trace"&&l.schematic_trace_id===e),r=o?.edges[0],i=o?.edges.at(-1);if(!o||!r||!i)return[];let s=t.filter((l)=>l.type==="schematic_port"),a=new Map(s.map((l)=>[l.schematic_port_id,l]));return[r.from_schematic_port_id?a.get(r.from_schematic_port_id):Wwt(s,r.from,o.schematic_sheet_id),i.to_schematic_port_id?a.get(i.to_schematic_port_id):Wwt(s,i.to,o.schematic_sheet_id)].flatMap((l)=>{let h=l?.schematic_component_id?n.get(l.schematic_component_id):void 0;return h?[h]:[]})},Wwt=(e,t,n)=>e.find((o)=>o.schematic_sheet_id===n&&Math.abs(o.center.x-t.x)<=Ywt&&Math.abs(o.center.y-t.y)<=Ywt),eGo=class{constructor(e,t=!1){this.lineItems=e,this.groupBySchematicSheet=t}lineItems;groupBySchematicSheet;getLineItems(){return this.lineItems}getIssues(e={}){return this.lineItems.flatMap((t)=>t.lineItemType==="SchematicPlacementIssues"?t.issues:[]).filter((t)=>(e.issueTypes===void 0||e.issueTypes.includes(t.lineItemType))&&(e.schematicSheetId===void 0||(Gwt(t).schematicSheetId??"")===e.schematicSheetId))}getIssueCounts(e={}){let t={FlybackDiodeSeparatedFromRelayCoil:0,ComponentOverlap:0,SchematicBoxHasALotOfSurroundingWhitespace:0,CapacitorSymbolHorizontal:0,VerboseSchematicNetLabel:0,PinHeaderSchematicBoxTooWide:0,GenericSchematicBoxTooWide:0,SchematicBoxInnerLabelCollision:0,SchematicPinPaddingToEdgeTooLarge:0,DiodeResistorNotAligned:0,ParallelRcNotAligned:0,ParallelDiodeResistorNotAligned:0,ComponentPinsWouldAlignWithVerticalShift:0,TraceCanBeSimplifiedByMovingComponent:0,CrystalNotCenteredOverLoadCapacitors:0,ComponentNetLabelCollision:0,ComponentBoxNetLabelCollision:0,NetLabelCollision:0,FeedbackNetworkNotCompact:0,PullResistorOnWrongSide:0,SchematicTextCollision:0,ResetNetworkNotGrouped:0,TwoPinComponentCouldBeFlipped:0,TwoPinComponentShouldBeVertical:0,TwoPinComponentHasInvertedRails:0,DecouplingCapacitorsNotCloseTogether:0,ConnectorPositionCausesTraceDetours:0,LowSideTransistorNotAlignedWithLoad:0,UsbSeriesResistorsNotAligned:0,RegulatorCapacitorsOnWrongSides:0,VoltageDividerSupplyResistorBelowGroundResistor:0,CurrentSenseShuntSeparatedFromInputs:0,DiodeCapacitorJunctionTooSpreadOut:0,PiFilterComponentsNotGrouped:0,MosfetGateNetworkNotGrouped:0,CapacitorSeparatedFromChipPins:0,ResistorSeparatedFromChipPin:0,RailPathTooSpreadOut:0,SeriesLedChainNotOrdered:0};for(let n of this.getIssues(e))t[n.lineItemType]++;return t}getString(){return this.toString()}schematicBoxPlacementsToString(e){let t=[];return sn(t,"componentName",e.sourceComponentName),sn(t,"positionAnchor",e.positionAnchor),sn(t,"schX",e.schX),sn(t,"schY",e.schY),sn(t,"width",e.width),sn(t,"height",e.height),`<SchematicBoxPlacement ${t.join(" ")} />`}schematicIssuesToString(e){switch(e.lineItemType){case"SeriesLedChainNotOrdered":return qVe.issueToString(e);case"ResistorSeparatedFromChipPin":return ZVe.issueToString(e);case"CapacitorSeparatedFromChipPins":return nYe.issueToString(e);case"DiodeCapacitorJunctionTooSpreadOut":return $Ve.issueToString(e);case"PiFilterComponentsNotGrouped":return oYe.issueToString(e);case"MosfetGateNetworkNotGrouped":return rYe.issueToString(e);case"CurrentSenseShuntSeparatedFromInputs":return sYe.issueToString(e);case"ComponentOverlap":return bYe.issueToString(e);case"CapacitorSymbolHorizontal":return uYe.issueToString(e);case"DecouplingCapacitorsNotCloseTogether":return pYe.issueToString(e);case"VerboseSchematicNetLabel":return EYe.issueToString(e);case"PinHeaderSchematicBoxTooWide":case"GenericSchematicBoxTooWide":return Kxe.issueToString(e);case"SchematicBoxInnerLabelCollision":return CYe.issueToString(e);case"SchematicPinPaddingToEdgeTooLarge":return IYe.issueToString(e);case"ParallelRcNotAligned":return JVe.issueToString(e);case"ParallelDiodeResistorNotAligned":return eYe.issueToString(e);case"DiodeResistorNotAligned":return gYe.issueToString(e);case"ComponentPinsWouldAlignWithVerticalShift":return mYe.issueToString(e);case"TraceCanBeSimplifiedByMovingComponent":return SYe.issueToString(e);case"CrystalNotCenteredOverLoadCapacitors":return _Ye.issueToString(e);case"TwoPinComponentCouldBeFlipped":return PYe.issueToString(e);case"FeedbackNetworkNotCompact":return AYe.issueToString(e);case"TwoPinComponentShouldBeVertical":case"TwoPinComponentHasInvertedRails":return bse.issueToString(e);case"RailPathTooSpreadOut":return tYe.issueToString(e);case"PullResistorOnWrongSide":return fYe.issueToString(e);case"NetLabelCollision":return Cse.netLabelCollisionToString(e);case"SchematicTextCollision":return MYe.issueToString(e);case"ResetNetworkNotGrouped":return wYe.issueToString(e);case"ConnectorPositionCausesTraceDetours":return lYe.issueToString(e);case"LowSideTransistorNotAlignedWithLoad":return hYe.issueToString(e);case"FlybackDiodeSeparatedFromRelayCoil":return iYe.issueToString(e);case"VoltageDividerSupplyResistorBelowGroundResistor":return aYe.issueToString(e);case"RegulatorCapacitorsOnWrongSides":return cYe.issueToString(e);case"UsbSeriesResistorsNotAligned":return dYe.issueToString(e);default:return""}}toString(){let e=this.lineItems.filter((r)=>r.lineItemType==="SchematicBoxPlacement"),t=this.lineItems.flatMap((r)=>r.lineItemType==="SchematicPlacementIssues"?r.issues:[]);if(t.length===0)return"";if(!this.groupBySchematicSheet)return this.issueContextToLines(e,t).join(`
`);let n=new Map,o=(r)=>{let i=r.schematicSheetId??r.schematicSheetName??"__default__",s=n.get(i);if(s)return s;let a={...r,placements:[],issues:[]};return n.set(i,a),a};for(let r of t)o(Gwt(r)).issues.push(r);for(let r of e)o({schematicSheetId:r.schematicSheetId,schematicSheetName:r.schematicSheetName}).placements.push(r);return[...n.values()].flatMap((r)=>{let i=[];return sn(i,"name",r.schematicSheetName),sn(i,"id",r.schematicSheetId),[`<SchematicSheet${i.length>0?` ${i.join(" ")}`:""}>`,...this.issueContextToLines(r.placements,r.issues),"</SchematicSheet>"]}).join(`
`)}issueContextToLines(e,t){return[...e.length>0?["<SchematicBoxPositions>",...e.map(this.schematicBoxPlacementsToString),"</SchematicBoxPositions>"]:[],"<SchematicPlacementIssues>",...t.map(this.schematicIssuesToString),"</SchematicPlacementIssues>"]}},tGo=(e,t={})=>{let n=new $Yo(e,t);n.solve();let{issues:o,componentPlacements:r}=n.getOutput(),s=[...qYo({issues:o,componentPlacements:r,circuitJson:e}),...o.length>0?[{lineItemType:"SchematicPlacementIssues",issues:o}]:[]],a=new Set(e.flatMap((c)=>("schematic_sheet_id"in c)&&typeof c.schematic_sheet_id==="string"?[c.schematic_sheet_id]:[]));return new eGo(s,a.size>1)},nGo=["TwoPinComponentHasInvertedRails","RegulatorCapacitorsOnWrongSides","PullResistorOnWrongSide","VoltageDividerSupplyResistorBelowGroundResistor","SeriesLedChainNotOrdered","ParallelRcNotAligned"];function oGo(e){let t=tGo(e,{issueTypes:nGo}),n=As(e);return t.getIssues().flatMap((o)=>{let r,i,s;switch(o.lineItemType){case"TwoPinComponentHasInvertedRails":{r=o.schematicBox.schematicComponentId;let l=Hs(e,r??"");i="inverted_rails",s=`${l} has its positive-supply pin facing down. Rotate ${l} by 180° so that pin faces up, preserving pin connections, and reroute attached traces.`;break}case"RegulatorCapacitorsOnWrongSides":{r=o.regulatorSchematicBox.schematicComponentId;let l=Hs(e,r??""),h=Hs(e,o.inputCapacitorSchematicBox.schematicComponentId??""),d=Hs(e,o.outputCapacitorSchematicBox.schematicComponentId??"");i="regulator_capacitors_on_wrong_sides",s=`${h} and ${d} are on the wrong sides of ${l}. Move them beside their connected regulator pins, preserving connections and rerouting traces.`;break}case"PullResistorOnWrongSide":r=o.resistorSchematicBox.schematicComponentId,i="pull_resistor_on_wrong_side",s=`consider placing ${Hs(e,r??"")} ${o.preferredSide} ${Hs(e,o.hostSchematicBox.schematicComponentId??"")}.${Hs(e,o.signalSourcePortId)} so the pull-${o.pullDirection} branch reads toward ${o.pullDirection==="up"?"power":"ground"}`;break;case"VoltageDividerSupplyResistorBelowGroundResistor":{r=o.supplyResistorSchematicBox.schematicComponentId;let l=Hs(e,r??""),h=Hs(e,o.groundResistorSchematicBox.schematicComponentId??"");i="voltage_divider_supply_resistor_below_ground_resistor",s=`${l}, connected to the supply, is below ${h}, connected to ground. Place ${l} above ${h} so their shared divider tap is easy to follow. Preserve pin connections and reroute affected traces; exact alignment is not required.`;break}case"SeriesLedChainNotOrdered":{r=o.ledSchematicBoxes[0]?.schematicComponentId;let l=o.ledSchematicBoxes.map((h)=>Hs(e,h.schematicComponentId??"")).join(", ");i="series_led_chain_not_ordered",s=`The series chain ${l} requires long connections behind LED pins. Arrange the LEDs in their connected order, preserving anode/cathode connections, and reroute affected traces. A horizontal, vertical, or clearly connected folded chain is acceptable.`;break}case"ParallelRcNotAligned":{r=o.resistorSchematicBox.schematicComponentId;let l=Hs(e,r??""),h=Hs(e,o.capacitorSchematicBox.schematicComponentId??"");i="parallel_rc_not_aligned",s=`${l} and ${h} share chip-pin and ground connections but are not drawn as adjacent parallel branches. Place their shared connections at matching ends, preserving pin connections and capacitor polarity, and reroute affected traces.`;break}default:return[]}if(!r)return[];let a=n.schematic_component.get(r);if(!a)return[];let c=a.schematic_group_id?n.schematic_group.get(a.schematic_group_id):void 0;return[{type:"schematic_component_styling_warning",schematic_component_styling_warning_id:`schematic_component_styling_warning_${r}_${i}`,warning_type:"schematic_component_styling_warning",styling_issue_type:i,message:s,schematic_component_id:r,source_component_id:a.source_component_id,schematic_sheet_id:a.schematic_sheet_id,subcircuit_id:a.subcircuit_id??c?.subcircuit_id,schematic_port_ids:n.schematic_port.list().filter((l)=>l.schematic_component_id===r).map((l)=>l.schematic_port_id)}]})}var rGo=Object.create,{getPrototypeOf:iGo,defineProperty:Xwt,getOwnPropertyNames:sGo}=Object,jwt=Object.prototype.hasOwnProperty;function aGo(e){return this[e]}var cGo,lGo,hGo=(e,t,n)=>{var o=e!=null&&typeof e==="object";if(o){var r=t?cGo??=new WeakMap:lGo??=new WeakMap,i=r.get(e);if(i)return i}n=e!=null?rGo(iGo(e)):{};let s=t||!e||!e.__esModule||!jwt.call(e,"default")?Xwt(n,"default",{value:e,enumerable:!0}):n;if(e&&typeof e==="object"||typeof e==="function"){for(let a of sGo(e))if(!jwt.call(s,a))Xwt(s,a,{get:aGo.bind(e,a),enumerable:!0})}if(o)r.set(e,s);return s},dGo=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),uGo=dGo(function(e,t){(function(n,o){typeof e==="object"&&typeof t<"u"?t.exports=o():typeof define==="function"&&define.amd?define(o):(n=typeof globalThis<"u"?globalThis:n||self,n.svgson=o())})(e,function(){var n=function(Y){return Y!=null&&(o(Y)||r(Y)||!!Y._isBuffer)};function o(Y){return!!Y.constructor&&typeof Y.constructor.isBuffer==="function"&&Y.constructor.isBuffer(Y)}function r(Y){return typeof Y.readFloatLE==="function"&&typeof Y.slice==="function"&&o(Y.slice(0,0))}var i=Object.prototype.toString,s=function(Y){if(typeof Y>"u")return"undefined";if(Y===null)return"null";if(Y===!0||Y===!1||Y instanceof Boolean)return"boolean";if(typeof Y==="string"||Y instanceof String)return"string";if(typeof Y==="number"||Y instanceof Number)return"number";if(typeof Y==="function"||Y instanceof Function)return"function";if(typeof Array.isArray<"u"&&Array.isArray(Y))return"array";if(Y instanceof RegExp)return"regexp";if(Y instanceof Date)return"date";var X=i.call(Y);if(X==="[object RegExp]")return"regexp";if(X==="[object Date]")return"date";if(X==="[object Arguments]")return"arguments";if(X==="[object Error]")return"error";if(n(Y))return"buffer";if(X==="[object Set]")return"set";if(X==="[object WeakSet]")return"weakset";if(X==="[object Map]")return"map";if(X==="[object WeakMap]")return"weakmap";if(X==="[object Symbol]")return"symbol";if(X==="[object Int8Array]")return"int8array";if(X==="[object Uint8Array]")return"uint8array";if(X==="[object Uint8ClampedArray]")return"uint8clampedarray";if(X==="[object Int16Array]")return"int16array";if(X==="[object Uint16Array]")return"uint16array";if(X==="[object Int32Array]")return"int32array";if(X==="[object Uint32Array]")return"uint32array";if(X==="[object Float32Array]")return"float32array";if(X==="[object Float64Array]")return"float64array";return"object"};function a(Y,X){return X={exports:{}},Y(X,X.exports),X.exports}var c=a(function(Y){(function(){function X(K,J){if(typeof J!=="function")return K;var ee={};for(var se in K)if(Object.prototype.hasOwnProperty.call(K,se))ee[J(se,K[se])||se]=K[se];return ee}if(Y.exports)Y.exports=X;else window.rename=X})()}),l=function Y(X,K){var J=s(X);if(J!=="object"&&J!=="array")throw Error("expected an object");var ee=[];if(J==="object")X=c(X,K),ee={};for(var se in X)if(X.hasOwnProperty(se)){var ne=X[se];if(s(ne)==="object"||s(ne)==="array")ee[se]=Y(ne,K);else ee[se]=ne}return ee},h=a(function(Y){var X=Object.prototype.hasOwnProperty,K="~";function J(){}if(Object.create){if(J.prototype=Object.create(null),!new J().__proto__)K=!1}function ee(ne,re,Z){this.fn=ne,this.context=re,this.once=Z||!1}function se(){this._events=new J,this._eventsCount=0}se.prototype.eventNames=function(){var ne=[],re,Z;if(this._eventsCount===0)return ne;for(Z in re=this._events)if(X.call(re,Z))ne.push(K?Z.slice(1):Z);if(Object.getOwnPropertySymbols)return ne.concat(Object.getOwnPropertySymbols(re));return ne},se.prototype.listeners=function(ne,re){var Z=K?K+ne:ne,te=this._events[Z];if(re)return!!te;if(!te)return[];if(te.fn)return[te.fn];for(var ie=0,ce=te.length,ue=Array(ce);ie<ce;ie++)ue[ie]=te[ie].fn;return ue},se.prototype.emit=function(ne,re,Z,te,ie,ce){var ue=K?K+ne:ne;if(!this._events[ue])return!1;var de=this._events[ue],me=arguments.length,ge,xe;if(de.fn){if(de.once)this.removeListener(ne,de.fn,void 0,!0);switch(me){case 1:return de.fn.call(de.context),!0;case 2:return de.fn.call(de.context,re),!0;case 3:return de.fn.call(de.context,re,Z),!0;case 4:return de.fn.call(de.context,re,Z,te),!0;case 5:return de.fn.call(de.context,re,Z,te,ie),!0;case 6:return de.fn.call(de.context,re,Z,te,ie,ce),!0}for(xe=1,ge=Array(me-1);xe<me;xe++)ge[xe-1]=arguments[xe];de.fn.apply(de.context,ge)}else{var Ee=de.length,Re;for(xe=0;xe<Ee;xe++){if(de[xe].once)this.removeListener(ne,de[xe].fn,void 0,!0);switch(me){case 1:de[xe].fn.call(de[xe].context);break;case 2:de[xe].fn.call(de[xe].context,re);break;case 3:de[xe].fn.call(de[xe].context,re,Z);break;case 4:de[xe].fn.call(de[xe].context,re,Z,te);break;default:if(!ge)for(Re=1,ge=Array(me-1);Re<me;Re++)ge[Re-1]=arguments[Re];de[xe].fn.apply(de[xe].context,ge)}}}return!0},se.prototype.on=function(ne,re,Z){var te=new ee(re,Z||this),ie=K?K+ne:ne;if(!this._events[ie])this._events[ie]=te,this._eventsCount++;else if(!this._events[ie].fn)this._events[ie].push(te);else this._events[ie]=[this._events[ie],te];return this},se.prototype.once=function(ne,re,Z){var te=new ee(re,Z||this,!0),ie=K?K+ne:ne;if(!this._events[ie])this._events[ie]=te,this._eventsCount++;else if(!this._events[ie].fn)this._events[ie].push(te);else this._events[ie]=[this._events[ie],te];return this},se.prototype.removeListener=function(ne,re,Z,te){var ie=K?K+ne:ne;if(!this._events[ie])return this;if(!re){if(--this._eventsCount===0)this._events=new J;else delete this._events[ie];return this}var ce=this._events[ie];if(ce.fn){if(ce.fn===re&&(!te||ce.once)&&(!Z||ce.context===Z))if(--this._eventsCount===0)this._events=new J;else delete this._events[ie]}else{for(var ue=0,de=[],me=ce.length;ue<me;ue++)if(ce[ue].fn!==re||te&&!ce[ue].once||Z&&ce[ue].context!==Z)de.push(ce[ue]);if(de.length)this._events[ie]=de.length===1?de[0]:de;else if(--this._eventsCount===0)this._events=new J;else delete this._events[ie]}return this},se.prototype.removeAllListeners=function(ne){var re;if(ne){if(re=K?K+ne:ne,this._events[re])if(--this._eventsCount===0)this._events=new J;else delete this._events[re]}else this._events=new J,this._eventsCount=0;return this},se.prototype.off=se.prototype.removeListener,se.prototype.addListener=se.prototype.on,se.prototype.setMaxListeners=function(){return this},se.prefixed=K,se.EventEmitter=se,Y.exports=se});function d(Y,X,K){if(X in Y)Object.defineProperty(Y,X,{value:K,enumerable:!0,configurable:!0,writable:!0});else Y[X]=K;return Y}var u=function(){},_={data:"state-data",cdata:"state-cdata",tagBegin:"state-tag-begin",tagName:"state-tag-name",tagEnd:"state-tag-end",attributeNameStart:"state-attribute-name-start",attributeName:"state-attribute-name",attributeNameEnd:"state-attribute-name-end",attributeValueBegin:"state-attribute-value-begin",attributeValue:"state-attribute-value"},p={lt:"action-lt",gt:"action-gt",space:"action-space",equal:"action-equal",quote:"action-quote",slash:"action-slash",char:"action-char",error:"action-error"},m={text:"text",openTag:"open-tag",closeTag:"close-tag",attributeName:"attribute-name",attributeValue:"attribute-value"},A={" ":p.space,"\t":p.space,"\n":p.space,"\r":p.space,"<":p.lt,">":p.gt,'"':p.quote,"'":p.quote,"=":p.equal,"/":p.slash},g=function(Y){return A[Y]||p.char},f=function(Y){var X,K,J,ee,se,ne,re,Z,te,ie;Y=Object.assign({debug:!1},Y);var ce=new h,ue=_.data,de="",me="",ge="",xe="",Ee="",Re="",Me=function(ye,Se){if(me[0]==="?"||me[0]==="!")return;var Ne={type:ye,value:Se};if(Y.debug)console.log("emit:",Ne);ce.emit("data",Ne)};ce.stateMachine=(ie={},d(ie,_.data,(X={},d(X,p.lt,function(){if(de.trim())Me(m.text,de);me="",Ee=!1,ue=_.tagBegin}),d(X,p.char,function(ye){de+=ye}),X)),d(ie,_.cdata,d({},p.char,function(ye){if(de+=ye,de.substr(-3)==="]]>")Me(m.text,de.slice(0,-3)),de="",ue=_.data})),d(ie,_.tagBegin,(K={},d(K,p.space,u),d(K,p.char,function(ye){me=ye,ue=_.tagName}),d(K,p.slash,function(){me="",Ee=!0}),K)),d(ie,_.tagName,(J={},d(J,p.space,function(){if(Ee)ue=_.tagEnd;else ue=_.attributeNameStart,Me(m.openTag,me)}),d(J,p.gt,function(){if(Ee)Me(m.closeTag,me);else Me(m.openTag,me);de="",ue=_.data}),d(J,p.slash,function(){ue=_.tagEnd,Me(m.openTag,me)}),d(J,p.char,function(ye){if(me+=ye,me==="![CDATA[")ue=_.cdata,de="",me=""}),J)),d(ie,_.tagEnd,(ee={},d(ee,p.gt,function(){Me(m.closeTag,me),de="",ue=_.data}),d(ee,p.char,u),ee)),d(ie,_.attributeNameStart,(se={},d(se,p.char,function(ye){ge=ye,ue=_.attributeName}),d(se,p.gt,function(){de="",ue=_.data}),d(se,p.space,u),d(se,p.slash,function(){Ee=!0,ue=_.tagEnd}),se)),d(ie,_.attributeName,(ne={},d(ne,p.space,function(){ue=_.attributeNameEnd}),d(ne,p.equal,function(){Me(m.attributeName,ge),ue=_.attributeValueBegin}),d(ne,p.gt,function(){xe="",Me(m.attributeName,ge),Me(m.attributeValue,xe),de="",ue=_.data}),d(ne,p.slash,function(){Ee=!0,xe="",Me(m.attributeName,ge),Me(m.attributeValue,xe),ue=_.tagEnd}),d(ne,p.char,function(ye){ge+=ye}),ne)),d(ie,_.attributeNameEnd,(re={},d(re,p.space,u),d(re,p.equal,function(){Me(m.attributeName,ge),ue=_.attributeValueBegin}),d(re,p.gt,function(){xe="",Me(m.attributeName,ge),Me(m.attributeValue,xe),de="",ue=_.data}),d(re,p.char,function(ye){xe="",Me(m.attributeName,ge),Me(m.attributeValue,xe),ge=ye,ue=_.attributeName}),re)),d(ie,_.attributeValueBegin,(Z={},d(Z,p.space,u),d(Z,p.quote,function(ye){Re=ye,xe="",ue=_.attributeValue}),d(Z,p.gt,function(){xe="",Me(m.attributeValue,xe),de="",ue=_.data}),d(Z,p.char,function(ye){Re="",xe=ye,ue=_.attributeValue}),Z)),d(ie,_.attributeValue,(te={},d(te,p.space,function(ye){if(Re)xe+=ye;else Me(m.attributeValue,xe),ue=_.attributeNameStart}),d(te,p.quote,function(ye){if(Re===ye)Me(m.attributeValue,xe),ue=_.attributeNameStart;else xe+=ye}),d(te,p.gt,function(ye){if(Re)xe+=ye;else Me(m.attributeValue,xe),de="",ue=_.data}),d(te,p.slash,function(ye){if(Re)xe+=ye;else Me(m.attributeValue,xe),Ee=!0,ue=_.tagEnd}),d(te,p.char,function(ye){xe+=ye}),te)),ie);var _e=function(ye){if(Y.debug)console.log(ue,ye);var Se=ce.stateMachine[ue],Ne=Se[g(ye)]||Se[p.error]||Se[p.char];Ne(ye)};return ce.write=function(ye){var Se=ye.length;for(var Ne=0;Ne<Se;Ne++)_e(ye[Ne])},ce},y={State:_,Action:p,Type:m,create:f},x=y.Type,C={element:"element",text:"text"},b=function(Y){return Object.assign({name:"",type:C.element,value:"",parent:null,attributes:{},children:[]},Y)},I=function(Y){Y=Object.assign({stream:!1,parentNodes:!0,doneEvent:"done",tagPrefix:"tag:",emitTopLevelOnly:!1,debug:!1},Y);var X=void 0,K=void 0,J=void 0,ee=void 0,se=new h,ne=function(re){switch(re.type){case x.openTag:if(J===null)J=K,J.name=re.value;else{var Z=b({name:re.value,parent:J});J.children.push(Z),J=Z}break;case x.closeTag:var te=J.parent;if(!Y.parentNodes)J.parent=null;if(J.name!==re.value)break;if(Y.stream&&te===K)K.children=[],J.parent=null;if(!Y.emitTopLevelOnly||te===K)se.emit(Y.tagPrefix+J.name,J),se.emit("tag",J.name,J);if(J===K)X.removeAllListeners("data"),se.emit(Y.doneEvent,J),K=null;J=te;break;case x.text:if(J)J.children.push(b({type:C.text,value:re.value,parent:Y.parentNodes?J:null}));break;case x.attributeName:ee=re.value,J.attributes[ee]="";break;case x.attributeValue:J.attributes[ee]=re.value;break}};return se.reset=function(){X=y.create({debug:Y.debug}),X.on("data",ne),K=b(),J=null,ee="",se.parse=X.write},se.reset(),se},v=function(Y,X){X=Object.assign({},X,{stream:!1,tagPrefix:":"});var K=I(X),J=void 0;return K.on("done",function(ee){J=ee}),K.parse(Y),J},P={parseSync:v,create:I,NodeType:C},M=P.parseSync,B=function(Y){var X=M("<root>".concat(Y,"</root>"),{parentNodes:!1}),K=X.children&&X.children.length>0&&X.children.every(function(J){return J.name==="svg"});if(K)return X.children.length===1?X.children[0]:X.children;else throw Error("nothing to parse")},T=function(Y){return l(Y,function(X){if(!D(X))return N(X);return X})},N=function(Y){return Y.replace(/[-|:]([a-z])/gi,function(X,K){return K.toUpperCase()})},D=function(Y){return/^(data|aria)(-\w+)/.test(Y)},L=function(Y){if(Y){var X=String(Y);return/[&<>]/.test(X)?"<![CDATA[".concat(X.replace(/]]>/,"]]]]><![CDATA[>"),"]]>"):X}return""},H=function(Y){return String(Y).replace(/&/g,"&amp;").replace(/'/g,"&apos;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")},V=function(Y){var X=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},K=X.transformNode,J=K===void 0?function(re){return re}:K,ee=X.camelcase,se=ee===void 0?!1:ee,ne=function(re){var Z=J(re);if(se)Z=T(Z);return Z};return ne(B(Y))};function O(){for(var Y=arguments.length,X=Array(Y),K=0;K<Y;K++)X[K]=arguments[K];return new Promise(function(J,ee){try{var se=V.apply(void 0,X);J(se)}catch(ne){ee(ne)}})}var U=function Y(X){var K=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},J=K.transformAttr,ee=J===void 0?function(de,me,ge){return"".concat(de,'="').concat(ge(me),'"')}:J,se=K.transformNode,ne=se===void 0?function(de){return de}:se,re=K.selfClose,Z=re===void 0?!0:re;if(Array.isArray(X))return X.map(function(de){return Y(de,{transformAttr:ee,selfClose:Z,transformNode:ne})}).join("");var te=ne(X);if(te.type==="text")return L(te.value);var ie="";for(var ce in te.attributes){var ue=ee(ce,te.attributes[ce],H,te.name);ie+=ue?" ".concat(ue):""}return te.children&&te.children.length>0||!Z?"<".concat(te.name).concat(ie,">").concat(Y(te.children,{transformAttr:ee,transformNode:ne,selfClose:Z}),"</").concat(te.name,">"):"<".concat(te.name).concat(ie,"/>")},j=Object.assign({},{parse:O,parseSync:V,stringify:U});return j})}),Kwt={"0":"M0.301025 0.257813 L0.206593 0.283385 L0.122042 0.361307 L0.075923 0.474441 L0.064942 0.642221 L0.091296 0.78289 L0.159376 0.899463 L0.257104 0.961214 L0.344948 0.961214 L0.442678 0.899463 L0.510757 0.78289 L0.537111 0.642221 L0.526131 0.474441 L0.480012 0.361307 L0.39546 0.283385 L0.301025 0.257813","1":"M0.220426 0.40845 L0.381626 0.270996 L0.381626 0.948966","2":"M0.110409 0.39212 L0.125621 0.342293 L0.170571 0.295823 L0.244237 0.26431 L0.291518 0.257813 L0.373319 0.263799 L0.434683 0.290705 L0.468239 0.331966 L0.480292 0.379913 L0.479492 0.411806 L0.465088 0.465192 L0.402571 0.568988 L0.245134 0.766438 L0.07959 0.948045 L0.522462 0.948045","3":"M0.081606 0.345073 L0.119154 0.315633 L0.178996 0.284091 L0.255265 0.257813 L0.349133 0.263062 L0.43127 0.289348 L0.48994 0.336662 L0.525141 0.394491 L0.513407 0.457577 L0.466472 0.504892 L0.384334 0.541692 L0.290464 0.56272 L0.20833 0.573235 L0.290464 0.583749 L0.384334 0.610035 L0.466472 0.652092 L0.519274 0.709922 L0.531007 0.773007 L0.50754 0.841351 L0.454738 0.899179 L0.3726 0.946494 L0.310412 0.961214 L0.209503 0.959111 L0.127367 0.946494 L0.071046 0.929671","4":"M0.418494 0.270996 L0.048828 0.724199 L0.553224 0.724199 M0.414181 0.578167 L0.414181 0.94897","5":"M0.074951 0.270996 L0.074951 0.614701 L0.267655 0.5695 L0.405247 0.586502 L0.460002 0.617189 L0.498028 0.660731 L0.527101 0.779401 L0.513352 0.841049 L0.477274 0.889568 L0.406378 0.93463 L0.324445 0.958337 L0.247399 0.962139 L0.182516 0.949767 L0.130068 0.925508 L0.074951 0.875607 M0.074951 0.270996 L0.527101 0.270996","6":"M0.428549 0.257813 L0.341433 0.285053 L0.26073 0.312099 L0.192188 0.360182 L0.138902 0.410969 L0.098219 0.500422 L0.070249 0.584267 L0.067264 0.670716 L0.065164 0.756863 L0.087163 0.820973 L0.108168 0.861042 L0.157916 0.913131 L0.210981 0.948192 L0.29279 0.961214 L0.384548 0.956206 L0.456409 0.924151 L0.507262 0.881077 L0.5349 0.821975 L0.537111 0.771889 L0.521634 0.718798 L0.498418 0.67372 L0.463042 0.636657 L0.414398 0.613617 L0.34696 0.598591 L0.28284 0.595587 L0.215403 0.605604 L0.145756 0.641665 L0.109274 0.678729 L0.064942 0.724006","7":"M0.071534 0.270996 L0.530519 0.270996 L0.495935 0.291702 L0.477752 0.305407 L0.435186 0.346112 L0.412067 0.374136 L0.388565 0.40796 L0.365315 0.448098 L0.342943 0.495062 L0.322081 0.549366 L0.303364 0.611524 L0.287416 0.68205 L0.270077 0.80465 L0.26253 0.94897","8":"M0.286761 0.257813 L0.210684 0.27162 L0.1414 0.305622 L0.092494 0.382125 L0.111513 0.450128 L0.16857 0.502193 L0.228345 0.539382 L0.377781 0.594635 L0.470161 0.645637 L0.52586 0.706203 L0.538087 0.792269 L0.506841 0.87621 L0.438915 0.927212 L0.339743 0.961214 L0.263666 0.959089 L0.174004 0.929337 L0.102003 0.881523 L0.063965 0.811395 L0.066682 0.741266 L0.102003 0.671139 L0.180797 0.608448 L0.259591 0.580822 L0.358762 0.548945 L0.456576 0.49688 L0.486463 0.446941 L0.487822 0.362999 L0.453859 0.302434 L0.384574 0.265245 L0.286761 0.257813","9":"M0.511026 0.437812 L0.491026 0.347812 L0.451026 0.297812 L0.391026 0.267812 L0.311026 0.257813 L0.231026 0.267812 L0.161026 0.297812 L0.111026 0.347812 L0.091026 0.417812 L0.111026 0.487812 L0.161026 0.537812 L0.231026 0.567812 L0.311026 0.577812 L0.391026 0.557812 L0.451026 0.517812 L0.491026 0.477812 L0.511026 0.437812 M0.510026 0.438812 L0.434026 0.636812 L0.381026 0.777812 L0.337026 0.879812 L0.301026 0.957812","!":"M0.301026 0.270996 L0.301026 0.749566 M0.251466 0.94897 L0.350587 0.94897",'"':"M0.16504 0.270996 L0.16504 0.523022 M0.437013 0.270996 L0.437013 0.523022","#":"M0.20958 0.282227 L0.146515 0.949754 M0.461844 0.282227 L0.398779 0.949754 M0.032999 0.526969 L0.600587 0.452796 M0.001465 0.82366 L0.569055 0.749486",$:"M0.307121 0.240234 L0.307121 1.083502 M0.490031 0.415915 L0.404676 0.328075 L0.23396 0.310507 L0.136407 0.398347 L0.099828 0.521324 L0.124213 0.591596 L0.197379 0.644299 L0.429061 0.697003 L0.502224 0.749708 L0.526613 0.837547 L0.477836 0.960526 L0.355897 1.013228 L0.197379 0.99566 L0.112021 0.942957 L0.07544 0.837547","'":"M0.301026 0.270996 L0.301026 0.523022","(":"M0.413087 0.241211 L0.372337 0.28347 L0.331589 0.334184 L0.290838 0.393349 L0.25009 0.460965 L0.219528 0.528584 L0.199153 0.5962 L0.188966 0.655364 L0.199153 0.714529 L0.219528 0.782146 L0.25009 0.849764 L0.290838 0.91738 L0.331589 0.976544 L0.372337 1.027258 L0.413087 1.069491",")":"M0.188966 0.241211 L0.229716 0.28347 L0.270466 0.334184 L0.311213 0.393349 L0.351964 0.460965 L0.382526 0.528584 L0.4029 0.5962 L0.413087 0.655364 L0.4029 0.714529 L0.382526 0.782146 L0.351964 0.849764 L0.311213 0.91738 L0.270466 0.976544 L0.229716 1.027258 L0.188966 1.069491","*":"M0.301026 0.458702 L0.301026 0.681942 M0.301026 0.458702 L0.520997 0.536834 M0.301026 0.458702 L0.439954 0.257813 M0.301026 0.458702 L0.162098 0.257813 M0.301026 0.458702 L0.081055 0.536834","+":"M0.042969 0.66845 L0.559083 0.66845 M0.301023 0.428223 L0.301023 0.908661",",":"M0.38672 0.852051 L0.215333 1.030661 L0.301025 1.119971","-":"M0.173829 0.686035 L0.428224 0.686035",".":"M0.362549 0.851074 L0.239503 0.851074","/":"M0.062501 1.035249 L0.539551 0.270996","<":"M0.559083 0.441895 L0.042969 0.66939 L0.042969 0.66939 L0.559083 0.896902","=":"M0.042969 0.545898 L0.559083 0.545898 M0.042969 0.80837 L0.559083 0.80837",">":"M0.042969 0.441895 L0.559083 0.66939 L0.559083 0.66939 L0.042969 0.896902",A:"M0.018067 0.94897 L0.290179 0.270996 L0.583986 0.94897 M0.155303 0.684521 L0.433548 0.684521",B:"M0.063965 0.94897 L0.063965 0.278953 L0.209356 0.270996 L0.342486 0.294394 L0.432179 0.37292 L0.418224 0.48773 L0.312686 0.549166 L0.084728 0.575531 L0.306377 0.589434 L0.468877 0.647456 L0.538087 0.736658 L0.5324 0.85202 L0.501247 0.902983 L0.42355 0.944398 L0.063965 0.94897",C:"M0.529054 0.419847 L0.498425 0.345196 L0.442238 0.292341 L0.33583 0.257813 L0.257199 0.268357 L0.187906 0.303748 L0.120243 0.385432 L0.072998 0.599844 L0.110073 0.815385 L0.165381 0.902183 L0.222883 0.942801 L0.334904 0.961214 L0.43253 0.937679 L0.504816 0.868999 L0.529054 0.772065",D:"M0.064454 0.94897 L0.071838 0.285078 L0.171217 0.270996 L0.247348 0.272633 L0.37101 0.306078 L0.462461 0.378304 L0.514748 0.475555 L0.535591 0.576392 L0.537599 0.652313 L0.528065 0.717381 L0.508562 0.772419 L0.445948 0.855695 L0.362356 0.90871 L0.225203 0.945862 L0.064454 0.94897",E:"M0.080078 0.270996 L0.080078 0.94897 M0.080078 0.270996 L0.521974 0.270996 M0.080078 0.609981 L0.389405 0.609981 M0.080078 0.94897 L0.521974 0.94897",F:"M0.086426 0.270996 L0.086426 0.94897 M0.091304 0.275607 L0.515626 0.275607 M0.091304 0.607677 L0.447344 0.607677",G:"M0.498034 0.284943 L0.374621 0.257813 L0.244219 0.268648 L0.160577 0.311997 L0.094556 0.398116 L0.056397 0.58404 L0.076752 0.785532 L0.120865 0.858197 L0.188947 0.916734 L0.271008 0.953591 L0.357069 0.961214 L0.43715 0.932047 L0.501262 0.858539 L0.545656 0.648611 L0.329595 0.648131",H:"M0.066895 0.270996 L0.066895 0.94897 M0.066895 0.595658 L0.530009 0.595658 M0.535157 0.270996 L0.535157 0.94897",I:"M0.301026 0.270996 L0.301026 0.94897",J:"M0.506839 0.270996 L0.507814 0.782193 L0.498468 0.846168 L0.480733 0.880789 L0.455864 0.90832 L0.426095 0.929408 L0.360746 0.954812 L0.302508 0.962139 L0.223573 0.953638 L0.16538 0.930312 L0.137072 0.907715 L0.116428 0.880312 L0.102822 0.848819 L0.095633 0.813947 L0.094239 0.776413",K:"M0.035401 0.270996 L0.035401 0.94897 M0.502258 0.316194 L0.035401 0.687823 M0.212484 0.582361 L0.566652 0.933903",L:"M0.07544 0.270996 L0.07544 0.94897 L0.526613 0.94897",M:"M0.042481 0.94897 L0.042481 0.270996 L0.301027 0.712492 L0.559571 0.270996 L0.559571 0.94897",N:"M0.067871 0.94897 L0.067871 0.270996 L0.534181 0.94897 L0.525031 0.270996",O:"M0.287293 0.961214 L0.19843 0.933567 L0.1172 0.849451 L0.057129 0.563945 L0.114348 0.350255 L0.18455 0.289392 L0.306101 0.257813 L0.42054 0.29572 L0.487543 0.365003 L0.544923 0.625294 L0.516366 0.789624 L0.465476 0.884596 L0.375084 0.949287 L0.287293 0.961214",P:"M0.070557 0.94897 L0.070557 0.28379 L0.20704 0.270996 L0.329134 0.278993 L0.408525 0.300514 L0.444022 0.317908 L0.500637 0.368929 L0.525796 0.423728 L0.531496 0.50384 L0.508934 0.554205 L0.473724 0.582043 L0.417577 0.604365 L0.336375 0.620372 L0.226014 0.629268 L0.082368 0.630258",Q:"M0.282435 1.050813 L0.195447 1.019646 L0.115933 0.924817 L0.057129 0.602943 L0.113139 0.362034 L0.18186 0.293418 L0.300844 0.257813 L0.412868 0.300553 L0.478457 0.37866 L0.534625 0.672103 L0.506671 0.857367 L0.456855 0.964437 L0.368371 1.037368 L0.282435 1.050813 M0.341225 0.815559 L0.544923 1.070653",R:"M0.034912 0.944112 L0.034912 0.288556 L0.227127 0.270996 L0.362038 0.276867 L0.443423 0.294907 L0.477644 0.309614 L0.505809 0.328757 L0.526616 0.352817 L0.544963 0.418061 L0.543241 0.475921 L0.524463 0.517817 L0.49076 0.546518 L0.444265 0.564799 L0.355195 0.578739 L0.047653 0.589627 M0.303054 0.617306 L0.56714 0.94897",S:"M0.483037 0.364333 L0.407613 0.267477 L0.22883 0.257813 L0.128623 0.327565 L0.087712 0.455539 L0.104656 0.518727 L0.168054 0.573307 L0.41928 0.617318 L0.503796 0.669342 L0.535157 0.759324 L0.493846 0.900055 L0.367668 0.961214 L0.205436 0.956661 L0.116711 0.907038 L0.066895 0.790334",T:"M0.022949 0.270996 L0.579103 0.270996 M0.309284 0.270996 L0.309284 0.94897",U:"M0.072022 0.270996 L0.07308 0.648875 L0.080372 0.75167 L0.099024 0.827813 L0.134786 0.885729 L0.181571 0.924023 L0.251464 0.95168 L0.339655 0.962139 L0.401553 0.951668 L0.45232 0.924086 L0.482701 0.891771 L0.495745 0.870529 L0.515699 0.81637 L0.525014 0.744626 L0.530031 0.272017",V:"M0.027832 0.270996 L0.320083 0.94897 L0.57422 0.270996",W:"M0 0.270996 L0.079799 0.940377 L0.285198 0.472884 L0.505255 0.94897 L0.602052 0.270996",X:"M0.009034 0.270996 L0.586805 0.94897 M0.593019 0.270996 L0.015246 0.94897",Y:"M0.018067 0.270996 L0.293132 0.574135 M0.583986 0.271959 L0.294954 0.57606 L0.305277 0.94897",Z:"M0.053711 0.270996 L0.548341 0.270996 L0.053711 0.94897 L0.548341 0.94897","[":"M0.404542 0.240234 L0.197511 0.240234 L0.197511 1.069424 L0.404542 1.069424","\\":"M0.062501 0.270996 L0.539551 1.035249","]":"M0.19751 0.240234 L0.404542 0.240234 L0.404542 1.069424 L0.19751 1.069424","^":"M0.035156 0.523931 L0.301024 0.270996 L0.566896 0.523931",_:"M0 1.160601 L0.602052 1.160601",a:"M0.527101 0.439941 L0.527101 0.973965 M0.527101 0.553824 L0.451366 0.477535 L0.376759 0.439941 L0.263722 0.439941 L0.187989 0.477535 L0.112255 0.553824 L0.074951 0.66881 L0.074951 0.745099 L0.112255 0.85898 L0.187989 0.93527 L0.263722 0.973965 L0.376759 0.973965 L0.451366 0.93527 L0.527101 0.85898",b:"M0.07666 0.240234 L0.07666 0.959985 M0.07666 0.582737 L0.151822 0.514237 L0.225865 0.480483 L0.338045 0.480483 L0.413211 0.514237 L0.488374 0.582737 L0.525392 0.685983 L0.525392 0.754485 L0.488374 0.856739 L0.413211 0.92524 L0.338045 0.959985 L0.225865 0.959985 L0.151822 0.92524 L0.07666 0.856739",c:"M0.512452 0.553823 L0.441624 0.477535 L0.371854 0.439941 L0.26614 0.439941 L0.195312 0.477535 L0.124486 0.553823 L0.0896 0.668808 L0.0896 0.745099 L0.124486 0.858979 L0.195312 0.93527 L0.26614 0.973965 L0.371854 0.973965 L0.441624 0.93527 L0.512452 0.858979",d:"M0.525392 0.240234 L0.525392 0.959985 M0.525392 0.582737 L0.450232 0.514237 L0.376189 0.480483 L0.264006 0.480483 L0.188844 0.514237 L0.11368 0.582737 L0.076661 0.685983 L0.076661 0.754485 L0.11368 0.856739 L0.188844 0.92524 L0.264006 0.959985 L0.376189 0.959985 L0.450232 0.92524 L0.525392 0.856739",e:"M0.059571 0.668808 L0.542482 0.668808 M0.542482 0.592521 L0.502641 0.516231 L0.461594 0.477535 L0.381914 0.439941 L0.261186 0.439941 L0.180299 0.477535 L0.099412 0.553823 L0.059571 0.668808 L0.059571 0.745099 L0.099412 0.858979 L0.180299 0.93527 L0.261186 0.973965 L0.381914 0.973965 L0.461594 0.93527 L0.542482 0.858979",f:"M0.512941 0.240234 L0.406984 0.240234 L0.301026 0.274346 L0.248047 0.374731 L0.248047 0.946817 M0.089112 0.476088 L0.459965 0.476088",g:"M0.525392 0.439941 L0.525392 0.989395 L0.488373 1.091918 L0.45023 1.126757 L0.376189 1.160601 L0.264004 1.160601 L0.188844 1.126757 L0.113681 1.058075 L0.076661 0.954555 M0.525392 0.542467 L0.45023 0.473786 L0.376189 0.439941 L0.264004 0.439941 L0.188844 0.473786 L0.113681 0.542467 L0.076661 0.645988 L0.076661 0.714669 L0.113681 0.817193 L0.188844 0.885875 L0.264004 0.920713 L0.376189 0.920713 L0.45023 0.885875 L0.525392 0.817193",h:"M0.092041 0.240234 L0.092041 0.946817 M0.092041 0.61058 L0.205937 0.509225 L0.282214 0.476086 L0.396109 0.476086 L0.47187 0.509225 L0.510011 0.61058 L0.510011 0.946817",i:"M0.261026 0.240234 L0.341026 0.240234 M0.300978 0.476089 L0.300978 0.946817",j:"M0.3853 0.240234 L0.447023 0.240234 M0.416159 0.465708 L0.416159 1.011689 L0.383887 1.108586 L0.252832 1.140264 L0.15503 1.108586",k:"M0.065186 0.240234 L0.065186 0.946817 M0.493824 0.476086 L0.065186 0.812323 M0.236758 0.677829 L0.536867 0.946817",l:"M0.301026 0.234863 L0.301026 0.946441",m:"M0.050538 0.439941 L0.050538 0.960796 M0.050538 0.588758 L0.114405 0.476607 L0.157178 0.439941 L0.236864 0.439941 L0.279637 0.476607 L0.32241 0.588758 L0.32241 0.960796 M0.32241 0.588758 L0.386281 0.476607 L0.428467 0.439941 L0.50874 0.439941 L0.551515 0.476607 L0.551515 0.960796",n:"M0.092041 0.439941 L0.092041 0.960796 M0.092041 0.588758 L0.205936 0.476607 L0.282216 0.439941 L0.396113 0.439941 L0.471871 0.476607 L0.510011 0.588758 L0.510011 0.960796",o:"M0.247175 0.439941 L0.175178 0.477535 L0.103186 0.553823 L0.066895 0.668808 L0.066895 0.745099 L0.103186 0.858979 L0.175178 0.93527 L0.247175 0.973965 L0.354874 0.973965 L0.426872 0.93527 L0.498866 0.858979 L0.535157 0.745099 L0.535157 0.668808 L0.498866 0.553823 L0.426872 0.477535 L0.354874 0.439941 L0.247175 0.439941",p:"M0.076904 0.439941 L0.076904 1.154244 M0.076904 0.541563 L0.151986 0.473487 L0.225944 0.439941 L0.338005 0.439941 L0.413087 0.473487 L0.488166 0.541563 L0.525148 0.644169 L0.525148 0.712246 L0.488166 0.813866 L0.413087 0.881942 L0.338005 0.916471 L0.225944 0.916471 L0.151986 0.881942 L0.076904 0.813866",q:"M0.525148 0.441895 L0.525148 1.156195 M0.525148 0.5435 L0.450067 0.47544 L0.376106 0.441895 L0.264042 0.441895 L0.188966 0.47544 L0.113885 0.5435 L0.076905 0.646108 L0.076905 0.714187 L0.113885 0.815809 L0.188966 0.883886 L0.264042 0.918418 L0.376106 0.918418 L0.450067 0.883886 L0.525148 0.815809",r:"M0.107422 0.439941 L0.107422 0.960796 M0.107422 0.663164 L0.155824 0.551014 L0.252626 0.476607 L0.349428 0.439941 L0.49463 0.439941",s:"M0.475556 0.477535 L0.400757 0.439941 L0.276092 0.439941 L0.176361 0.477535 L0.101563 0.553823 L0.101563 0.630112 L0.176361 0.668808 L0.301024 0.668808 L0.425688 0.745099 L0.50049 0.821387 L0.50049 0.897677 L0.425688 0.93527 L0.325956 0.973965 L0.201295 0.973965 L0.126496 0.93527 L0.101563 0.858979",t:"M0.246032 0.297852 L0.246032 0.826549 L0.301023 0.919323 L0.411011 0.950848 L0.520997 0.950848 M0.081055 0.515799 L0.466004 0.515799",u:"M0.092041 0.454102 L0.092041 0.826134 L0.13018 0.937211 L0.205936 0.974954 L0.319832 0.974954 L0.396113 0.937211 L0.510011 0.826134 M0.510011 0.454102 L0.510011 0.974954",v:"M0.048828 0.453125 L0.301026 0.961719 M0.553224 0.453125 L0.301026 0.961719",w:"M0 0.453125 L0.150512 0.961719 M0.301024 0.453125 L0.150512 0.961719 M0.301024 0.453125 L0.451539 0.961719 M0.602052 0.453125 L0.451539 0.961719",x:"M0.03711 0.453125 L0.564943 0.961719 M0.564943 0.453125 L0.03711 0.961719",y:"M0.084618 0.453125 L0.320232 0.921476 M0.55713 0.453125 L0.320232 0.921476 L0.242119 1.055289 L0.163369 1.122196 L0.084618 1.155166 L0.044922 1.155166",z:"M0.505373 0.452148 L0.09668 0.961651 M0.09668 0.452148 L0.505373 0.452148 M0.09668 0.961651 L0.505373 0.961651"},$wt={};for(let e in Kwt){$wt[e]=[];let t=Kwt[e].split("M").slice(1).map((n)=>n.split("L").map((o)=>o.trim().split(" ").map(parseFloat)));for(let n of t)for(let o=0;o<n.length-1;o++)$wt[e].push({x1:n[o][0],y1:1-n[o][1],x2:n[o+1][0],y2:1-n[o+1][1]})}var v6s=(()=>{let e=new Uint8Array(4),t=new Uint32Array(e.buffer);return!((t[0]=1)&e[0])})(),S6s={int8:globalThis.Int8Array,uint8:globalThis.Uint8Array,int16:globalThis.Int16Array,uint16:globalThis.Uint16Array,int32:globalThis.Int32Array,uint32:globalThis.Uint32Array,uint64:globalThis.BigUint64Array,int64:globalThis.BigInt64Array,float32:globalThis.Float32Array,float64:globalThis.Float64Array},pGo=[];for(let e=0;e<256;e++){let t=e;for(let n=0;n<8;n++)if(t&1)t=3988292384^t>>>1;else t=t>>>1;pGo[e]=t}var mGo=new Uint16Array([255]),_Go=new Uint8Array(mGo.buffer),P6s=_Go[0]===255,gGo=new Uint16Array([255]),AGo=new Uint8Array(gGo.buffer),E6s=AGo[0]===255,M6s=new Uint8Array(0),w6s=Uint8Array.of(137,80,78,71,13,10,26,10),B6s=new TextDecoder("latin1"),{cos:T6s,sin:D6s,PI:N6s}=Math,{tan:R6s}=Math,Q6s=hGo(uGo(),1);function MVe(e,t){if(e.points)for(let n of e.points)n.step=t;if(e.lines)for(let n of e.lines)n.step=t;if(e.infiniteLines)for(let n of e.infiniteLines)n.step=t;if(e.polygons)for(let n of e.polygons)n.step=t;if(e.rects)for(let n of e.rects)n.step=t;if(e.circles)for(let n of e.circles)n.step=t;if(e.texts)for(let n of e.texts)n.step=t;return e}var BYe=class{MAX_ITERATIONS=1e5;solved=!1;failed=!1;iterations=0;progress=0;error=null;activeSubSolver;failedSubSolvers;timeToSolve;stats={};_setupDone=!1;getSolverName(){return this.constructor.name}setup(){if(this._setupDone)return;this._setup(),this._setupDone=!0}_setup(){}step(){if(!this._setupDone)this.setup();if(this.solved)return;if(this.failed)return;this.iterations++;try{this._step()}catch(e){throw this.error=`${this.getSolverName()} error: ${e}`,this.failed=!0,e}if(!this.solved&&this.iterations>=this.MAX_ITERATIONS)this.tryFinalAcceptance();if(!this.solved&&this.iterations>=this.MAX_ITERATIONS)this.error=`${this.getSolverName()} ran out of iterations`,this.failed=!0;if("computeProgress"in this)this.progress=this.computeProgress()}_step(){}getConstructorParams(){throw Error("getConstructorParams not implemented")}getOutput(){return null}solve(){let e=Date.now();while(!this.solved&&!this.failed)this.step();let t=Date.now();this.timeToSolve=t-e}visualize(){return{lines:[],points:[],rects:[],circles:[]}}tryFinalAcceptance(){}preview(){return{lines:[],points:[],rects:[],circles:[]}}};function wVe(e,t,n,o={}){return{solverName:e,solverClass:t,getConstructorParams:n,onSolved:o.onSolved}}var fGo=class extends BYe{startTimeOfStage={};endTimeOfStage={};timeSpentOnStage={};firstIterationOfStage={};currentPipelineStageIndex=0;inputProblem;pipelineOutputs={};constructor(e){super();this.inputProblem=e,this.MAX_ITERATIONS=1e6}_step(){let e=this.pipelineDef[this.currentPipelineStageIndex];if(!e){this.solved=!0;return}if(this.activeSubSolver){if(this.activeSubSolver.step(),this.activeSubSolver.solved){this.endTimeOfStage[e.solverName]=performance.now(),this.timeSpentOnStage[e.solverName]=this.endTimeOfStage[e.solverName]-this.startTimeOfStage[e.solverName];let n=this.activeSubSolver.getOutput();if(n!==null)this.pipelineOutputs[e.solverName]=n;e.onSolved?.(this),this.activeSubSolver=null,this.currentPipelineStageIndex++}else if(this.activeSubSolver.failed)this.error=this.activeSubSolver?.error,this.failed=!0,this.activeSubSolver=null;return}let t=e.getConstructorParams(this);this.activeSubSolver=new e.solverClass(...t),this[e.solverName]=this.activeSubSolver,this.timeSpentOnStage[e.solverName]=0,this.startTimeOfStage[e.solverName]=performance.now(),this.firstIterationOfStage[e.solverName]=this.iterations}solveUntilStage(e){while(this.getCurrentStageName().toLowerCase()!==e.toLowerCase())if(this.step(),this.failed||this.solved)break}getCurrentStageName(){return this.pipelineDef[this.currentPipelineStageIndex]?.solverName??"none"}getStageProgress(){let e=this.pipelineDef.length;if(e===0)return 1;let t=this.activeSubSolver?.progress??0;return(this.currentPipelineStageIndex+t)/e}getStageStats(){let e={};for(let t of this.pipelineDef){let n=this.timeSpentOnStage[t.solverName]||0,o=this.firstIterationOfStage[t.solverName]||0,r=this.iterations,i=t.solverName===this.getCurrentStageName()?r-o:0,s=this.currentPipelineStageIndex>this.pipelineDef.findIndex((a)=>a.solverName===t.solverName);e[t.solverName]={timeSpent:n,iterations:i,completed:s}}return e}initialVisualize(){return null}finalVisualize(){return null}visualize(){if(!this.solved&&this.activeSubSolver)return this.activeSubSolver.visualize();let e=0,t=this.initialVisualize();if(t)MVe(t,0),e=1;let n=null;if(this.solved)n=this.finalVisualize();let o=[t].filter(Boolean).concat(this.pipelineDef.map((r,i)=>{let s=this[r.solverName]?.visualize();if(!s)return null;return MVe(s,i+e),s}).filter(Boolean));if(o.length===0)return{points:[],rects:[],lines:[],circles:[],texts:[]};if(this.solved&&n)MVe(n,o.length+e+1),o.push(n);if(o.length===1)return o[0];return{points:o.flatMap((r)=>r.points||[]),rects:o.flatMap((r)=>r.rects||[]),lines:o.flatMap((r)=>r.lines||[]),circles:o.flatMap((r)=>r.circles||[]),texts:o.flatMap((r)=>r.texts||[])}}preview(){if(this.activeSubSolver)return this.activeSubSolver.preview();return super.preview()}computeProgress(){return this.getStageProgress()}getStageOutput(e){return this.pipelineOutputs[e]}getAllOutputs(){return{...this.pipelineOutputs}}hasStageOutput(e){return e in this.pipelineOutputs}getSolver(e){return this[e]}};function qwt(e,t){if(e.route_type==="through_pad")return t?e.end:e.start;return{x:e.x,y:e.y}}function BVe(e,t){if(e.route_type==="wire")return e.layer;if(e.route_type==="via")return t?e.to_layer:e.from_layer;return t?e.end_layer:e.start_layer}function yGo(e){let t=new Set;for(let o of e){if(o.type!=="source_bus")continue;if(o.max_length_skew===void 0&&o.target_length===void 0&&!o.length_match_source_trace_ids?.length)continue;for(let r of o.source_trace_ids)t.add(r);for(let r of o.length_match_source_trace_ids??[])t.add(r)}let n=[];for(let[o,r]of e.entries()){if(r.type!=="pcb_trace")continue;for(let i=0;i<r.route.length-1;i++){let s=r.route[i],a=r.route[i+1],c=(p)=>["wire","via","through_pad"].includes(p.route_type);if(!c(s)||!c(a))throw Error(r.pcb_trace_id+": unsupported route point at "+i);if(s.route_type!=="wire"&&a.route_type!=="wire")continue;if(BVe(s,!0)!==BVe(a,!1))continue;let l=qwt(s,!0),h=qwt(a,!1);if(![l.x,l.y,h.x,h.y].every(Number.isFinite))throw Error(r.pcb_trace_id+": nonfinite route coordinates at "+i);let d=Math.hypot(h.x-l.x,h.y-l.y);if(d<=0.000000001)continue;let u=s.route_type==="wire"?s:a,_=u.route_type==="wire"?Math.max(u.width,u.end_width??u.width):0;if(!Number.isFinite(_)||_<=0)throw Error(r.pcb_trace_id+": invalid wire width at "+i);n.push({pcbTraceId:r.pcb_trace_id,sourceTraceId:r.source_trace_id,pcbGroupId:r.pcb_group_id,subcircuitId:r.subcircuit_id,circuitJsonIndex:o,startRouteIndex:i,endRouteIndex:i+1,layer:BVe(s,!0),start:{...l},end:{...h},width:_,lengthMm:d})}}return{circuitJson:e,segments:n,lengthMatchedSourceTraceIds:t}}function xGo(e){return e.map((t)=>({issue:t,color:"#ff5555",message:t.message}))}function uK(e,t){let n=xGo(t);return{coordinateSystem:"cartesian",lines:[...e.segments.map((o)=>({points:[o.start,o.end],strokeColor:o.layer==="bottom"?"#60a5fa":"#94a3b8",strokeWidth:o.width})),...n.flatMap(({issue:o,color:r,message:i})=>(o.constituentSegments??[o]).map((s)=>({points:[s.start,s.end],strokeColor:r,strokeWidth:Math.max(s.width*2,0.25),label:i})))],points:n.map(({issue:o,color:r,message:i},s)=>({...o.location,color:r,label:s+1+": "+i}))}}function CGo(e,t,n){let o=n.x-t.x,r=n.y-t.y,i=o*o+r*r,s=i?Math.max(0,Math.min(1,((e.x-t.x)*o+(e.y-t.y)*r)/i)):0;return Math.hypot(e.x-t.x-s*o,e.y-t.y-s*r)}function DBt(e){let t=[],n=(o)=>{let r=[[0,o.length-1]];while(r.length){let[i,s]=r.pop();if(i===s)continue;let a=o[i].start,c=o[s].end,l=1/0,h=-1,d=i;for(let _=i;_<=s;_++){if(l=Math.min(l,o[_].width),_===s)continue;let p=CGo(o[_].end,a,c);if(p>h)h=p,d=_}if(h>l/2+0.000000001){r.push([d+1,s],[i,d]);continue}let u=o.slice(i,s+1);t.push({...o[i],endRouteIndex:o[s].endRouteIndex,end:c,width:u.reduce((_,p)=>Math.max(_,p.width),0),lengthMm:Math.hypot(c.x-a.x,c.y-a.y),constituentSegments:u,maxCenterlineDeviationMm:h<=0.000000001?0:h})}};for(let o of NBt(e))n(o);return[...e.segments.filter((o)=>!TYe(e,o)),...t]}function TYe(e,t){return t.sourceTraceId!==void 0&&(e.lengthMatchedSourceTraceIds?.has(t.sourceTraceId)??!1)}function NBt(e){let t=[],n=[];for(let o of e.segments){if(TYe(e,o)){if(n.length)t.push(n);n=[];continue}let r=n.at(-1);if(r){let i=e.circuitJson[o.circuitJsonIndex];if(!(r.circuitJsonIndex===o.circuitJsonIndex&&i.type==="pcb_trace"&&i.route.slice(r.endRouteIndex,o.startRouteIndex+1).every((s)=>s.route_type==="wire"&&s.layer===o.layer))||r.layer!==o.layer||Math.hypot(r.end.x-o.start.x,r.end.y-o.start.y)>0.000000001)t.push(n),n=[]}n.push(o)}if(n.length)t.push(n);return t}var bGo=class extends BYe{params;segments=[];nextSegment=0;candidates;constructor(e){super();if(this.params=e,!Number.isFinite(e.maxSegmentLengthMm)||e.maxSegmentLengthMm<=0)throw Error("maxSegmentLengthMm must be finite and positive");this.candidates=DBt(e.ctx),this.MAX_ITERATIONS=this.candidates.length+2}_step(){let e=this.candidates[this.nextSegment++];if(!e){this.solved=!0,this.progress=1;return}if(e.lengthMm>this.params.maxSegmentLengthMm)this.segments.push(e);this.progress=this.nextSegment/this.candidates.length,this.stats={segmentsChecked:this.nextSegment,candidateCount:this.segments.length}}getOutput(){return this.segments}visualize(){return uK(this.params.ctx,[])}getConstructorParams(){return[this.params]}};function RBt(e,t){let{start:n,end:o}=e,r=(e.constituentSegments??[e]).reduce((i,s)=>({minX:Math.min(i.minX,s.start.x-s.width/2,s.end.x-s.width/2),minY:Math.min(i.minY,s.start.y-s.width/2,s.end.y-s.width/2),maxX:Math.max(i.maxX,s.start.x+s.width/2,s.end.x+s.width/2),maxY:Math.max(i.maxY,s.start.y+s.width/2,s.end.y+s.width/2)}),{minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0});return{...e,issueId:t+":"+e.circuitJsonIndex+":"+e.startRouteIndex,severity:"error",message:"",location:{x:(n.x+o.x)/2,y:(n.y+o.y)/2},bounds:r}}var QBt=class extends BYe{ctx;issues=[];nextSegment=0;constructor(e){super();this.ctx=e,this.MAX_ITERATIONS=e.segments.length+2}_step(){let e=this.ctx.segments[this.nextSegment++];if(!e){this.solved=!0,this.progress=1;return}let t=this.checkSegment(e);if(t)this.issues.push(t);this.progress=this.nextSegment/this.ctx.segments.length,this.stats={segmentsChecked:this.nextSegment,issueCount:this.issues.length}}getOutput(){return this.issues}visualize(){return uK(this.ctx,this.issues)}},IGo=class extends QBt{params;constructor(e){super({...e.ctx,segments:e.candidateSegments??DBt(e.ctx)});if(this.params=e,!Number.isFinite(e.maxSegmentLengthMm)||e.maxSegmentLengthMm<=0)throw Error("maxSegmentLengthMm must be finite and positive");if(!Number.isFinite(e.angleToleranceDegrees)||e.angleToleranceDegrees<0||e.angleToleranceDegrees>=22.5)throw Error("angleToleranceDegrees must be in [0, 22.5)");let t=new Set;for(let n of this.ctx.segments){if(!n.constituentSegments||!this.checkSegment(n))continue;for(let o of n.constituentSegments)t.add(o.circuitJsonIndex+":"+o.startRouteIndex)}this.ctx={...this.ctx,segments:this.ctx.segments.filter((n)=>n.constituentSegments||!t.has(n.circuitJsonIndex+":"+n.startRouteIndex))}}checkSegment(e){if(TYe(this.params.ctx,e))return;if(e.lengthMm<=this.params.maxSegmentLengthMm)return;let t=(Math.atan2(e.end.y-e.start.y,e.end.x-e.start.x)*180/Math.PI+360)%360,n=Math.round(t/45)*45,o=Math.abs(t-n),r=Math.atan2(2*(e.maxCenterlineDeviationMm??0),e.lengthMm)*180/Math.PI;if(o<=this.params.angleToleranceDegrees+r+0.0000000001)return;return{...RBt(e,"odd-angle"),lineItemType:"PcbTraceSegmentOddAngle",maxSegmentLengthMm:this.params.maxSegmentLengthMm,angleDegrees:t,nearestAllowedAngleDegrees:n%360,deviationDegrees:o,angleToleranceDegrees:this.params.angleToleranceDegrees,...e.constituentSegments?{angleUncertaintyDegrees:r}:{},message:e.pcbTraceId+(e.constituentSegments?" run "+e.startRouteIndex+" → "+e.endRouteIndex:" segment "+e.startRouteIndex)+" on "+e.layer+" is "+e.lengthMm.toFixed(3)+" mm long (threshold "+this.params.maxSegmentLengthMm+" mm) and at "+t.toFixed(3)+"°; nearest allowed direction "+n%360+"° (deviation "+o.toFixed(3)+"°, tolerance "+this.params.angleToleranceDegrees+"°"+(r?", approximation allowance "+r.toFixed(3)+"°":"")+")"}}visualize(){return uK(this.params.ctx,this.issues)}getConstructorParams(){return[this.params]}};function vGo(e){return(Math.atan2(e.end.y-e.start.y,e.end.x-e.start.x)*180/Math.PI+360)%360}function TVe(e,t){return Math.abs((e-t+540)%360-180)}var SGo=class extends QBt{params;bendCounts=new Map;constructor(e){super({...e.ctx,segments:[]});this.params=e;let t=e.minStaircaseBends??6,n=e.minStaircaseLengthMm??2,o=e.maxStairStepLengthMm??1;if(!Number.isInteger(t)||t<2)throw Error("minStaircaseBends must be an integer of at least 2");if(!Number.isFinite(n)||n<=0)throw Error("minStaircaseLengthMm must be finite and positive");if(!Number.isFinite(o)||o<=0)throw Error("maxStairStepLengthMm must be finite and positive");let r=[];for(let i of NBt(e.ctx)){let s=[];for(let a of i){let c=vGo(a),l=s.at(-1);if(l&&TVe(l.direction,c)<=4.0000000001)l.parts.push(a),l.lengthMm+=a.lengthMm;else s.push({direction:c,parts:[a],lengthMm:a.lengthMm})}for(let a=0;a<s.length-1;){let c=s[a],l=s[a+1],h=TVe(c.direction,l.direction);if(h<14.9999999999||h>90.0000000001||c.lengthMm>o+0.000000001||l.lengthMm>o+0.000000001){a++;continue}let d=a+2;while(d<s.length&&TVe(s[d].direction,s[a+(d-a)%2].direction)<=4.0000000001&&s[d].lengthMm<=o+0.000000001)d++;let u=s.slice(a,d).flatMap((p)=>p.parts),_=u.reduce((p,m)=>p+m.lengthMm,0);if(d-a-1>=t&&_+0.000000001>=n){let p={...u[0],end:u.at(-1).end,endRouteIndex:u.at(-1).endRouteIndex,width:u.reduce((m,A)=>Math.max(m,A.width),0),lengthMm:_,constituentSegments:u};r.push(p),this.bendCounts.set(p,d-a-1),a=d}else a=d-1}}this.ctx={...e.ctx,segments:r},this.MAX_ITERATIONS=r.length+2}checkSegment(e){let t=this.bendCounts.get(e);return{...RBt(e,"staircase"),lineItemType:"PcbTraceStaircase",bendCount:t,minStaircaseBends:this.params.minStaircaseBends??6,minStaircaseLengthMm:this.params.minStaircaseLengthMm??2,maxStairStepLengthMm:this.params.maxStairStepLengthMm??1,message:`${e.pcbTraceId} route ${e.startRouteIndex} → ${e.endRouteIndex} on ${e.layer} has ${t} alternating staircase bends over ${e.lengthMm.toFixed(3)} mm`}}visualize(){return uK(this.params.ctx,this.issues)}getConstructorParams(){return[this.params]}},PGo=class extends fGo{options;ctx;pipelineDef=[wVe("LongTraceSegmentSolver",bGo,(e)=>[{ctx:e.ctx,maxSegmentLengthMm:e.options.maxSegmentLengthMm??5}]),wVe("OddAngleTraceSegmentSolver",IGo,(e)=>[{ctx:e.ctx,candidateSegments:e.getSolver("LongTraceSegmentSolver").getOutput(),maxSegmentLengthMm:e.options.maxSegmentLengthMm??5,angleToleranceDegrees:e.options.angleToleranceDegrees??4}]),wVe("StaircaseTraceSolver",SGo,(e)=>[{ctx:e.ctx,minStaircaseBends:e.options.minStaircaseBends,minStaircaseLengthMm:e.options.minStaircaseLengthMm,maxStairStepLengthMm:e.options.maxStairStepLengthMm}])];constructor(e,t={}){super(e);if(this.options=t,t.issueTypes){let n=t.issueTypes.includes("PcbTraceSegmentOddAngle"),o=t.issueTypes.includes("PcbTraceStaircase");this.pipelineDef=this.pipelineDef.filter((r)=>r.solverName==="StaircaseTraceSolver"?o:n)}this.MAX_ITERATIONS=e.reduce((n,o)=>n+(o.type==="pcb_trace"?o.route.length*5:0),10)}_setup(){this.ctx=yGo(this.inputProblem)}getOutput(){return{issues:[...this.getSolver("OddAngleTraceSegmentSolver")?.getOutput()??[],...this.getSolver("StaircaseTraceSolver")?.getOutput()??[]]}}getConstructorParams(){return[this.inputProblem,this.options]}initialVisualize(){return this.setup(),uK(this.ctx,[])}finalVisualize(){return this.setup(),uK(this.ctx,this.getOutput().issues)}};function EGo(e,t={}){let n=new PGo(e,t);if(n.solve(),n.failed)throw Error(n.error??"PCB style analysis failed");return n.getOutput()}function MGo(e){return EGo(e,{issueTypes:["PcbTraceSegmentOddAngle"]}).issues.filter((t)=>t.lineItemType==="PcbTraceSegmentOddAngle").map((t)=>({type:"pcb_trace_style_warning",pcb_trace_style_warning_id:`pcb_trace_style_warning_${t.pcbTraceId}_${t.startRouteIndex}_${t.endRouteIndex}`,warning_type:"pcb_trace_style_warning",styling_issue_type:"long_segment_at_odd_angle",pcb_trace_id:t.pcbTraceId,source_trace_id:t.sourceTraceId,subcircuit_id:t.subcircuitId,layer:t.layer,start_route_index:t.startRouteIndex,end_route_index:t.endRouteIndex,segment_start:t.start,segment_end:t.end,center:t.location,segment_length:t.lengthMm,minimum_segment_length:t.maxSegmentLengthMm,angle_degrees:t.angleDegrees,nearest_allowed_angle_degrees:t.nearestAllowedAngleDegrees,angle_deviation_degrees:t.deviationDegrees,angle_tolerance_degrees:t.angleToleranceDegrees,message:`${jM(e,t.pcbTraceId)} has a ${t.lengthMm.toFixed(2)} mm segment on ${t.layer} at ${t.angleDegrees.toFixed(2)}°, ${t.deviationDegrees.toFixed(2)}° from the nearest allowed direction (${t.nearestAllowedAngleDegrees}°). Prefer a multiple of 45° for segments longer than ${t.maxSegmentLengthMm} mm (tolerance ${t.angleToleranceDegrees}°).`}))}function wGo(e,t,n){if(e.connected_source_port_ids.length!==2||!t.length)return;let o=e.connected_source_port_ids.map((A)=>n.filter((g)=>g.type==="pcb_port"&&g.source_port_id===A));if(o.some((A)=>A.length!==1))return;let r=new Map,i=new Set,s=[],a=(A,g)=>`${A.x.toFixed(6)},${A.y.toFixed(6)},${g}`,c=!0,l=(A,g,f,y,x)=>{if(![A.x,A.y,f.x,f.y,x].every(Number.isFinite)){c=!1;return}let C=a(A,g),b=a(f,y);if(C===b)return;let I=[C,b].sort().join("|");if(i.has(I)){c=!1;return}i.add(I);for(let[v,P,M,B]of[[C,A,g,b],[b,f,y,C]]){if(!r.has(v))r.set(v,{point:P,layer:M,edges:new Set});r.get(v).edges.add(B)}if(g===y){if(x<=0)c=!1;s.push({a:A,b:f,layer:g,width:x})}else if(Math.hypot(A.x-f.x,A.y-f.y)>0.000001)c=!1};for(let A of t)for(let g=0;g<A.route.length;g++){let f=A.route[g],y=A.route[g+1];if(f.route_type==="through_pad"||y?.route_type==="through_pad")return;if(f.route_type==="wire"&&f.width_interpolation_mode)return;if(f.route_type==="via")l(f,f.from_layer,f,f.to_layer,0);if(!y)continue;let x=f.route_type==="wire"?f.layer:f.to_layer,C=y.route_type==="wire"?y.layer:y.from_layer;if(x!==C){c=!1;continue}let b=f.route_type==="wire"?Math.max(f.width,f.end_width??f.width):y.route_type==="wire"?y.width:0;l(f,x,y,C,b)}for(let A of n.filter((g)=>g.type==="pcb_via")){let g=A.layers.filter((f)=>r.has(a(A,f)));if(g.length>2){c=!1;continue}if(g.length===2){let f=a(A,g[0]),y=a(A,g[1]);if(!i.has([f,y].sort().join("|")))l(A,g[0],A,g[1],0)}}if(!c||!s.length||[...r.values()].some((A)=>A.edges.size>2))return;let h=[...r.entries()].filter(([,A])=>A.edges.size===1);if(h.length!==2)return;let d=(A,g)=>A.layers.includes(g.layer)&&Math.hypot(A.x-g.point.x,A.y-g.point.y)<=0.00001,[u,_]=o.map((A)=>A[0]);if(!(d(u,h[0][1])&&d(_,h[1][1]))&&!(d(u,h[1][1])&&d(_,h[0][1])))return;let p=new Set,m=[h[0][0]];while(m.length){let A=m.pop();if(p.has(A))continue;p.add(A),m.push(...r.get(A).edges)}if(p.size!==r.size)return;return{length:s.reduce((A,g)=>A+Math.hypot(g.a.x-g.b.x,g.a.y-g.b.y),0),manhattan:Math.abs(u.x-_.x)+Math.abs(u.y-_.y),segments:s}}var oK=(e,t)=>e.x*t.x+e.y*t.y,zxe=(e,t)=>({x:e.x-t.x,y:e.y-t.y});function BGo(e,t,n){let o=zxe(e.b,e.a),r=zxe(t.b,t.a),i=zxe(e.a,t.a),s=oK(r,r);if(s===0)return[];let a=oK(i,r)/s,c=oK(o,r)/s,l=[0,1];if(Math.abs(c)>0.000000000000001){for(let d of[-a/c,(1-a)/c])if(d>0&&d<1)l.push(d)}l.sort((d,u)=>d-u);let h=[];for(let d=0;d<l.length-1;d++){let u=l[d],_=l[d+1],p=a+c*(u+_)/2,m=i,A=o;if(p>=1)m=zxe(e.a,t.b);else if(p>0)m={x:i.x-r.x*a,y:i.y-r.y*a},A={x:o.x-r.x*c,y:o.y-r.y*c};let g=oK(A,A),f=2*oK(m,A),y=oK(m,m)-n*n;if(g<0.00000000000000000001){if(y<-0.000000000001)h.push([u,_]);continue}let x=f*f-4*g*y;if(x<=0)continue;let C=Math.sqrt(x),b=Math.max(u,(-f-C)/(2*g)),I=Math.min(_,(-f+C)/(2*g));if(I-b>0.0000000001)h.push([b,I])}return h}function TGo(e,t){let n=(i,s,a)=>(s.x-i.x)*(a.y-i.y)-(s.y-i.y)*(a.x-i.x),o=(i,s,a,c)=>Math.max(Math.min(i,s),Math.min(a,c))<=Math.min(Math.max(i,s),Math.max(a,c));if(o(e.a.x,e.b.x,t.a.x,t.b.x)&&o(e.a.y,e.b.y,t.a.y,t.b.y)&&n(e.a,e.b,t.a)*n(e.a,e.b,t.b)<=0&&n(t.a,t.b,e.a)*n(t.a,t.b,e.b)<=0)return 0;let r=(i,s)=>{let a=s.b.x-s.a.x,c=s.b.y-s.a.y,l=a*a+c*c,h=l?Math.max(0,Math.min(1,((i.x-s.a.x)*a+(i.y-s.a.y)*c)/l)):0;return Math.hypot(i.x-s.a.x-h*a,i.y-s.a.y-h*c)};return Math.min(r(e.a,t),r(e.b,t),r(t.a,e),r(t.b,e))}var Hz=0.00000001,kBt=(e)=>[e.length_match_source_trace_ids,e.min_length,e.max_length,e.target_length,e.length_tolerance,e.pcb_trace_spacing,e.pcb_spacing_to_other_signals,e.target_impedance_min,e.target_impedance_max,e.target_differential_impedance_min,e.target_differential_impedance_max].some((t)=>t!==void 0);function DGo(e){let t=[],n=e.filter((_)=>_.type==="source_bus"),o=new Map(e.filter((_)=>_.type==="source_trace").map((_)=>[_.source_trace_id,_])),r=e.filter((_)=>_.type==="pcb_trace"),i=new Map;for(let _ of r){if(!_.source_trace_id)continue;let p=i.get(_.source_trace_id)??[];p.push(_),i.set(_.source_trace_id,p)}let s=new Map,a=(_)=>{if(!s.has(_)){let p=o.get(_);s.set(_,p&&wGo(p,i.get(_)??[],e))}return s.get(_)},c=[];for(let _ of r)for(let p=0;p<_.route.length-1;p++){let m=_.route[p],A=_.route[p+1];if(m.route_type==="through_pad"||A.route_type==="through_pad")continue;let g=m.route_type==="wire"?m.layer:m.to_layer,f=A.route_type==="wire"?A.layer:A.from_layer,y=Math.max(m.route_type==="wire"?Math.max(m.width,m.end_width??m.width):0,A.route_type==="wire"?Math.max(A.width,A.end_width??A.width):0);if(g!==f||y<=0||![m.x,m.y,A.x,A.y,y].every(Number.isFinite))continue;c.push({trace:_,segment:{a:m,b:A,layer:g,width:y}})}let l=c.length?new I4(c.length):void 0,h=0;for(let{segment:_}of c)h=Math.max(h,_.width),l.add(Math.min(_.a.x,_.b.x),Math.min(_.a.y,_.b.y),Math.max(_.a.x,_.b.x),Math.max(_.a.y,_.b.y));l?.finish();let d=(_,p)=>typeof _==="number"?_:_.width_multiplier*p,u=new Set(n.filter((_)=>_.differential_pair).map((_)=>[_.differential_pair.positive_source_trace_id,_.differential_pair.negative_source_trace_id].sort().join("|")));for(let _ of n){if(!kBt(_))continue;let p=[...new Set(_.source_trace_ids)],m=[...new Set([...p,..._.length_match_source_trace_ids??[]])],A=(v,P,M)=>({message:`${P?"Unverified ":""}bus ${Hs(e,_.source_bus_id)}: ${M}`,source_bus_id:_.source_bus_id,source_trace_ids:v,pcb_trace_ids:v.flatMap((B)=>(i.get(B)??[]).map((T)=>T.pcb_trace_id)),subcircuit_id:_.subcircuit_id}),g=(v,P,M=p[0])=>{t.push(lAe.parse({type:"pcb_bus_routing_constraint_warning",pcb_bus_routing_constraint_warning_id:`pcb_bus_routing_constraint_warning_${_.source_bus_id}_${t.length}`,...A([M],!0,P),routing_rule:v}))},f=(v,P,M=p[0])=>{let B=v.routing_rule==="length_skew"?m:[M];t.push(cAe.parse({type:"pcb_bus_routing_constraint_error",pcb_bus_routing_constraint_error_id:`pcb_bus_routing_constraint_error_${_.source_bus_id}_${t.length}`,...A(B,!1,P),...v}))},y=(v,P)=>{let M=v.find((B)=>!a(B));if(M)g(P,"a signal lacks complete, unbranched pad-to-pad geometry",M);return!M};if(_.max_length_skew!==void 0&&y(m,"route_geometry")){let v=m.map((M)=>a(M).length),P=Math.max(...v)-Math.min(...v);if(P>_.max_length_skew+Hz)f({routing_rule:"length_skew",actual_length_skew:P,maximum_length_skew:_.max_length_skew},`planar length skew is ${P.toFixed(3)} mm`,m[v.indexOf(Math.max(...v))])}let x=(v)=>{if(v===void 0||typeof v==="number")return v;let P=v.source_trace_ids??m;if(!P.length||!y(P,"reference_geometry"))return;return Math.max(...P.map((M)=>a(M).manhattan))+(v.offset??0)},C=x(_.min_length),b=x(_.max_length),I=x(_.target_length);if(_.target_length!==void 0&&_.length_tolerance===void 0)g("target_length","a target length requires an explicit length tolerance");else if(_.length_tolerance!==void 0&&_.target_length===void 0)g("target_length","a length tolerance requires an explicit target length");if([_.min_length,_.max_length,_.target_length].some((v)=>v!==void 0)&&y(p,"route_geometry"))for(let v of p){let P=a(v).length;if(C!==void 0&&P<C-Hz)f({routing_rule:"min_length",actual_trace_length:P,minimum_trace_length:C},"planar length is below the declared minimum",v);if(b!==void 0&&P>b+Hz)f({routing_rule:"max_length",actual_trace_length:P,maximum_trace_length:b},"planar length exceeds the declared maximum",v);if(I!==void 0&&_.length_tolerance!==void 0&&Math.abs(P-I)>_.length_tolerance+Hz)f({routing_rule:"target_length",actual_trace_length:P,target_trace_length:I,length_tolerance:_.length_tolerance},"planar length is outside the target tolerance",v)}for(let v of p){if(_.pcb_trace_spacing===void 0&&_.pcb_spacing_to_other_signals===void 0)break;let P=a(v);if(!P){g("spacing_geometry","spacing requires supported route geometry",v);continue}let M=new Set;for(let B of P.segments){let T=Math.max(...[_.pcb_trace_spacing,_.pcb_spacing_to_other_signals].filter((N)=>N!==void 0).map((N)=>d(N,Math.max(B.width,h))));for(let N of l?.search(Math.min(B.a.x,B.b.x)-T,Math.min(B.a.y,B.b.y)-T,Math.max(B.a.x,B.b.x)+T,Math.max(B.a.y,B.b.y)+T)??[]){let{trace:D,segment:L}=c[N],H=D.source_trace_id;if(v===H||B.layer!==L.layer||H&&u.has([v,H].sort().join("|")))continue;if(H&&o.get(v)?.connected_source_net_ids.some((j)=>o.get(H)?.connected_source_net_ids.includes(j)))continue;let V=H!==void 0&&p.includes(H),O=V?_.pcb_trace_spacing:_.pcb_spacing_to_other_signals;if(O===void 0)continue;let U=d(O,Math.max(B.width,L.width));if(BGo(B,L,U-Hz).length){let j=V?"pcb_trace_spacing":"pcb_spacing_to_other_signals";if(!M.has(j))f({routing_rule:j,other_pcb_trace_id:D.pcb_trace_id,other_source_trace_id:H,actual_centerline_spacing:TGo(B,L),minimum_centerline_spacing:U},`${Hs(e,v)} falls below declared centreline spacing`,v);M.add(j)}}}}for(let[v,P,M]of[[_.target_impedance,_.target_impedance_min,_.target_impedance_max],[_.target_differential_impedance,_.target_differential_impedance_min,_.target_differential_impedance_max]]){if([v,P,M].every((B)=>B===void 0))continue;if(v!==void 0&&(P!==void 0&&v<P-Hz||M!==void 0&&v>M+Hz))f({routing_rule:"impedance_target",target_impedance:v,minimum_impedance:P,maximum_impedance:M},"declared impedance target is outside its bounds");g("physical_impedance","actual impedance requires physical stackup analysis; declared targets are not measured impedance")}}return t}var NGo=(e)=>{let t=e.filter((r)=>r.type==="source_bus"),n=ABt(e),o=[];for(let r of t){if(r.max_length_skew===void 0||kBt(r))continue;let i=[...new Set(r.source_trace_ids)].flatMap((a)=>{let c=n.get(a)?.filter((l)=>l.trace_length!==void 0||l.route.length>1);if(!c?.length)return[];return[{id:a,traces:c,length:c.reduce((l,h)=>l+gBt(h),0)}]});if(i.length<2)continue;let s=Math.max(...i.map((a)=>a.length))-Math.min(...i.map((a)=>a.length));if(s<=r.max_length_skew+0.000000001)continue;o.push({type:"pcb_bus_length_skew_error",pcb_bus_length_skew_error_id:`pcb_bus_length_skew_error_${r.source_bus_id}`,error_type:"pcb_bus_length_skew_error",message:`PCB bus ${Hs(e,r.source_bus_id)} has ${s.toFixed(2)}mm length skew, exceeding the ${r.max_length_skew}mm maximum`,source_bus_id:r.source_bus_id,source_trace_ids:i.map((a)=>a.id),pcb_trace_ids:i.flatMap((a)=>a.traces.map((c)=>c.pcb_trace_id)),actual_length_skew:s,maximum_length_skew:r.max_length_skew,subcircuit_id:r.subcircuit_id})}return o};function _K(e,t){let n=new Map,o=new Map;for(let l of e){let h=La(l);if(o.set(h,l),"pcb_component_id"in l&&l.pcb_component_id)n.set(h,l.pcb_component_id)}let r=t.flatMap((l)=>l.type==="pcb_footprint_overlap_error"?l.related_errors??[l]:[l]),i=new Map,s=new Map;for(let l of r){let h;if(l.type==="pcb_footprint_overlap_error"){if(l.pcb_keepout_ids?.length)continue;let _=l,p=[...l.pcb_smtpad_ids??[],...l.pcb_plated_hole_ids??[],...l.pcb_hole_ids??[]];if(p.some((m)=>!n.has(m)))continue;h=_.pcb_component_ids??p.map((m)=>n.get(m))}else if(l.type==="pcb_pad_pad_clearance_error"){if(l.pcb_pad_ids.some((_)=>!n.has(_)))continue;h=l.pcb_pad_ids.map((_)=>n.get(_))}else if(l.type==="pcb_courtyard_overlap_error")h=l.pcb_component_ids;else continue;if(h=[...new Set(h)].sort(),h.length!==2)continue;let d=JSON.stringify(h);s.set(l,d);let u=i.get(d)??[];u.push(l),i.set(d,u)}let a=new Map;for(let[l,h]of i){let d=h.filter((f)=>f.type==="pcb_footprint_overlap_error");if(h.length<2||d.length===0)continue;let u=JSON.parse(l),_=u.map((f)=>{let y=o.get(f),x=y?.type==="pcb_component"?o.get(y.source_component_id):void 0;return x?.type==="source_component"?x.name:f}),m=[[d.length,"footprint overlap"],[h.filter((f)=>f.type==="pcb_pad_pad_clearance_error").length,"pad clearance violation"],[h.filter((f)=>f.type==="pcb_courtyard_overlap_error").length,"courtyard conflict"]].filter(([f])=>f>0).map(([f,y])=>`${f} ${y}${f===1?"":"s"}`),A={type:"pcb_footprint_overlap_error",error_type:"pcb_footprint_overlap_error",pcb_error_id:`pcb_component_overlap_${u.join("_")}`,pcb_component_ids:u,message:`${_.join(" overlaps ")}: ${m.join(", ")}. Move the components apart.`,related_errors:h};if(h.some((f)=>f.is_fatal))A.is_fatal=!0;let g=new Set;for(let f of h)if(f.type==="pcb_footprint_overlap_error")for(let y of[...f.pcb_smtpad_ids??[],...f.pcb_plated_hole_ids??[],...f.pcb_hole_ids??[]])g.add(y);else if(f.type==="pcb_pad_pad_clearance_error")for(let y of f.pcb_pad_ids)g.add(y);for(let[f,y]of[["pcb_smtpad_ids","pcb_smtpad"],["pcb_plated_hole_ids","pcb_plated_hole"],["pcb_hole_ids","pcb_hole"]]){let x=[...g].filter((C)=>o.get(C)?.type===y).sort();if(x.length)A[f]=x}a.set(l,A)}let c=new Set;return r.flatMap((l)=>{let h=s.get(l),d=h===void 0?void 0:a.get(h);if(!d||h===void 0)return[l];if(c.has(h))return[];return c.add(h),[d]})}function RGo(e){let t=new Map,n=(s)=>{let a=s;while(t.has(a)&&t.get(a)!==a)a=t.get(a);while(t.has(s)&&t.get(s)!==a){let c=t.get(s);t.set(s,a),s=c}return a},o=(s)=>{if(s.length<2)return;let a=n(s[0]);for(let c of s.slice(1))t.set(n(c),a)},r=new Map;for(let s of e){if(s.type==="source_net"&&s.name.trim()){let a=r.get(s.name)??[];a.push(s),r.set(s.name,a)}if(s.type==="source_trace")o([...s.connected_source_net_ids.map((a)=>`net:${a}`),...s.connected_source_port_ids.map((a)=>`port:${a}`)]);if(s.type==="source_component_internal_connection")o(s.source_port_ids.map((a)=>`port:${a}`));if(s.type==="source_component")for(let a of s.internally_connected_source_port_ids??[])o(a.map((c)=>`port:${c}`))}let i=[];for(let[s,a]of r){let c=new Set(a.map((h)=>n(`net:${h.source_net_id}`)));if(c.size<2)continue;let l=a.map((h)=>h.source_net_id).sort();i.push({type:"source_confusing_net_name_warning",source_confusing_net_name_warning_id:`source_confusing_net_name_warning_${l[0]}`,warning_type:"source_confusing_net_name_warning",message:`Nets named "${s}" are not all connected (${c.size} separate electrical networks). Connect them or use distinct names to avoid confusion.`,source_net_ids:l,net_name:s,...a.every((h)=>h.subcircuit_id===a[0].subcircuit_id)?{subcircuit_id:a[0].subcircuit_id}:{}})}return i}function QGo(e){switch(e.insertion_direction){case"from_left":return"x-";case"from_right":return"x+";case"from_top":return"y+";case"from_bottom":return"y-";case"from_above":case"from_below":return null;default:return null}}function kGo(e){if(e.insertion_direction)return QGo(e);if(!e.center||!e.cable_insertion_center)return null;let t=e.cable_insertion_center.x-e.center.x,n=e.cable_insertion_center.y-e.center.y;if(Math.abs(t)<0.000001&&Math.abs(n)<0.000001)return null;if(Math.abs(t)>=Math.abs(n))return t>=0?"x+":"x-";return n>=0?"y+":"y-"}function LGo(e,t){if(!e.center)return null;let n=[{direction:"x-",distance:e.center.x-t.minX},{direction:"x+",distance:t.maxX-e.center.x},{direction:"y-",distance:e.center.y-t.minY},{direction:"y+",distance:t.maxY-e.center.y}];return n.sort((o,r)=>o.distance-r.distance),n[0]?.direction??null}function DYe(e){let t=e.find((s)=>s.type==="pcb_board");if(!t)return[];let n=(()=>{try{return hbt(t)}catch{return null}})();if(!n)return[];let o=[],r=e.filter((s)=>s.type==="pcb_component"),i=new Set(e.filter((s)=>s.type==="source_component"&&s.ftype==="simple_pin_header").map((s)=>s.source_component_id));for(let s of r){if(!s.insertion_direction&&i.has(s.source_component_id))continue;let a=kGo(s),c=LGo(s,n);if(!a||!c)continue;if(a===c)continue;let l=Yz(e,s.pcb_component_id),h=s.insertion_direction?`${l} is facing ${a} but should face ${c} so the connector is accessible from the board edge`:`${l} is inferred to face ${a} from its cable insertion center because no explicit footprint insertionDirection is defined, but should face ${c} so the connector is accessible from the board edge. Set insertionDirection on the <footprint> to specify the actual direction in the footprint's unrotated orientation; for example, <footprint insertionDirection="from_above"> for a connector accessed from above the PCB (+Z).`;o.push({type:"pcb_connector_not_in_accessible_orientation_warning",warning_type:"pcb_connector_not_in_accessible_orientation_warning",pcb_connector_not_in_accessible_orientation_warning_id:`pcb_connector_not_in_accessible_orientation_warning_${s.pcb_component_id}`,message:h,pcb_component_id:s.pcb_component_id,source_component_id:s.source_component_id,pcb_board_id:t.pcb_board_id,facing_direction:a,recommended_facing_direction:c,subcircuit_id:s.subcircuit_id})}return o}function Jwt(e){if(e.type==="pcb_courtyard_rect"){let t=e.width/2,n=e.height/2,o=[{x:-t,y:-n},{x:+t,y:-n},{x:+t,y:+n},{x:-t,y:+n}],r=(e.ccw_rotation??0)*Math.PI/180,i=Math.cos(r),s=Math.sin(r);return o.map(({x:a,y:c})=>({x:e.center.x+a*i-c*s,y:e.center.y+a*s+c*i}))}if(e.type==="pcb_courtyard_circle")return Array.from({length:32},(n,o)=>{let r=2*Math.PI*o/32;return{x:e.center.x+e.radius*Math.cos(r),y:e.center.y+e.radius*Math.sin(r)}});return e.outline}function Zwt(e,t){return Yz(e,t)}function HGo(e,t){if(e.some((n)=>UC(n,t)))return!0;if(t.some((n)=>UC(n,e)))return!0;for(let n=0;n<e.length;n++){let o=e[n],r=e[(n+1)%e.length];for(let i=0;i<t.length;i++){let s=t[i],a=t[(i+1)%t.length];if(dA(o,r,s,a))return!0}}return!1}function FGo(e){let t=new Set(e.flatMap((s)=>s.type==="pcb_component"&&s.do_not_place?[s.pcb_component_id]:[])),n=e.filter((s)=>s.type==="pcb_courtyard_rect"||s.type==="pcb_courtyard_circle"||s.type==="pcb_courtyard_outline").filter((s)=>!t.has(s.pcb_component_id)),o=new Map;for(let s of n){let a=s.pcb_component_id;if(!o.has(a))o.set(a,[]);o.get(a).push(s)}let r=Array.from(o.keys()),i=[];for(let s=0;s<r.length;s++)for(let a=s+1;a<r.length;a++){let c=r[s],l=r[a],h=!1;e:for(let d of o.get(c))for(let u of o.get(l)){if("layer"in d&&"layer"in u&&d.layer!==u.layer)continue;let _=Jwt(d),p=Jwt(u);if(HGo(_,p)){h=!0;break e}}if(h)i.push({type:"pcb_courtyard_overlap_error",pcb_error_id:`pcb_courtyard_overlap_${c}_${l}`,error_type:"pcb_courtyard_overlap_error",message:`Courtyard of ${Zwt(e,c)} overlaps with courtyard of ${Zwt(e,l)}`,pcb_component_ids:[c,l]})}return i}function zGo(e,{minClearance:t}={}){let n=t??WI(XI(e),"min_trace_to_hole_edge_clearance")??E2.min_trace_to_hole_edge_clearance;if(!Number.isFinite(n)||n<0)throw Error("Trace-to-hole clearance must be finite and non-negative");let o=aBt(e);if(o.length===0)return[];let r=new mK({objects:o,getId:(a)=>a.elementId,getBounds:(a)=>({minX:a.bounds.xmin,minY:a.bounds.ymin,maxX:a.bounds.xmax,maxY:a.bounds.ymax})}),i=new Map,s=new Set;for(let a of e){if(a.type!=="pcb_trace")continue;for(let c=1;c<a.route.length;c++){let l=a.route[c-1],h=a.route[c];if(l.route_type!=="wire"&&l.route_type!=="via"||h.route_type!=="wire"&&h.route_type!=="via")continue;if(l.route_type!=="wire"&&h.route_type!=="wire")continue;if(l.route_type==="wire"&&h.route_type==="wire"&&l.layer!==h.layer)continue;let d=Math.max(l.route_type==="wire"?l.width:0,h.route_type==="wire"?h.width:0)/2,u=r.getObjectsInBounds({minX:Math.min(l.x,h.x),minY:Math.min(l.y,h.y),maxX:Math.max(l.x,h.x),maxY:Math.max(l.y,h.y)},n+d);for(let _ of u){let p=_.sourceElement;if(p.type!=="pcb_hole")continue;let{gap:m,center:A}=cBt({x1:l.x,y1:l.y,x2:h.x,y2:h.y,thickness:d*2},_),g=`${a.pcb_trace_id}_${p.pcb_hole_id}`;if(cK(m)){i.delete(g),s.add(g);continue}if(s.has(g))continue;if(m+0.000001>=n)continue;if((i.get(g)?.gap??1/0)<=m)continue;i.set(g,{gap:m,error:{type:"pcb_trace_error",error_type:"pcb_trace_error",pcb_trace_error_id:`overlap_${g}`,pcb_trace_id:a.pcb_trace_id,source_trace_id:a.source_trace_id??"",pcb_component_ids:p.pcb_component_id?[p.pcb_component_id]:[],pcb_port_ids:[],center:A,message:`Trace ${jM(e,a.pcb_trace_id)} is too close to non-plated hole ${Hs(e,p.pcb_hole_id)} (gap: ${m.toFixed(6)}mm, required: ${n}mm)`}})}}}return Array.from(i.values(),({error:a})=>a)}var OGo=(e)=>e.type==="pcb_courtyard_circle"||e.type==="pcb_courtyard_outline"||e.type==="pcb_courtyard_polygon"||e.type==="pcb_courtyard_rect",VGo=(e,t)=>{if(t.type==="pcb_courtyard_circle"){let o=e.x-t.center.x,r=e.y-t.center.y;return o*o+r*r<=t.radius*t.radius}if(t.type==="pcb_courtyard_rect"){let o=-1*(t.ccw_rotation??0)*Math.PI/180,r=e.x-t.center.x,i=e.y-t.center.y,s=r*Math.cos(o)-i*Math.sin(o),a=r*Math.sin(o)+i*Math.cos(o);return Math.abs(s)<=t.width/2&&Math.abs(a)<=t.height/2}let n=t.type==="pcb_courtyard_polygon"?t.points:t.outline;return UC(e,n)},YGo=(e,t)=>{let n=e.find((r)=>r.type==="pcb_component"&&r.pcb_component_id===t),o=e.find((r)=>r.type==="source_component"&&r.source_component_id===n?.source_component_id);return(o&&"name"in o?o.name:void 0)??Yz(e,t)};function GGo(e){let t=e.filter((c)=>c.type==="source_component"&&c.ftype==="simple_test_point"),n=new Set(t.map((c)=>c.source_component_id)),o=new Map(t.map((c)=>[c.source_component_id,c.name])),r=e.filter((c)=>c.type==="pcb_component"&&n.has(c.source_component_id)),i=e.filter(OGo),s=[],a=new Set;for(let c of r)for(let l of i){if(l.pcb_component_id===c.pcb_component_id)continue;if(l.layer!==c.layer)continue;if(!VGo(c.center,l))continue;let h=`${c.pcb_component_id}:${l.pcb_component_id}`;if(a.has(h))continue;a.add(h);let d=o.get(c.source_component_id)??"Test point",u=YGo(e,l.pcb_component_id);s.push({type:"pcb_placement_error",pcb_placement_error_id:`testpoint_in_courtyard_${c.pcb_component_id}_${l.pcb_component_id}`,error_type:"pcb_placement_error",message:`Test point ${d} is not accessible because it is inside the courtyard of ${u}`,subcircuit_id:c.subcircuit_id})}return s}async function t5e(e,{consolidateOverlaps:t=!0}={}){let n=[...CVo(e),...uYo(e),...PVo(e),...BVo(e),...RVo(e),...kVo(e),...DVo(e),...eYo(e),...nYo(e),...sYo(e),...FGo(e),...DYe(e),...GGo(e)];return t?_K(e,n):n}async function LBt(e){return[...pYo(e),...mYo(e),...RGo(e),..._Yo(e)]}async function HBt(e){return[...xYo(e),...IYo(e),...SYo(e),...oGo(e)]}async function n5e(e){KVe(e);let t={connMap:oa(e),pcbConnectivityMap:jVe(e)};return[...gVo(e,t),...YVo(e,t),...VVo(e),...LVo(e),...rYo(e),...MGo(e),...NGo(e),...DGo(e),...iYo(e),...fVo(e,t),...mVo(e,t),...aYo(e,t),...zGo(e),...cYo(e,t),...lYo(e,t),...FVo(e,t),...zVo(e,t),...KVo(e,t),...eVo(e,t),...qVo(e)]}/*! Bundled license information:

@tscircuit/circuit-json-pcb-style-analysis/dist/index.js:
  (*!
  * Determine if an object is a Buffer
  *
  * @author   Feross Aboukhadijeh <https://feross.org>
  * @license  MIT
  *)
*/Kt();Kt();Ie();Kt();Ie();Ie();Ie();Ie();Kt();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Kt();Ie();Ie();Kt();Ie();Kt();Ie();Kt();Ie();Kt();Ie();Kt();Ie();Ie();Kt();Ie();Ie();Kt();Ie();var dTt=Qe(rn(),1);Ie();Ie();Kt();Ie();Ie();Kt();Ie();Ie();Ie();Ie();Ie();Kt();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Kt();Ie();Kt();Ie();Kt();Ie();Kt();Ie();Ie();Ie();Ie();Kt();Ie();Kt();Ie();Ie();Ie();Kt();Ie();Kt();Ie();Ie();Ie();Ie();Ie();Kt();Ie();Kt();Ie();Kt();Ie();Kt();Ie();Kt();Ie();Kt();Ie();Kt();Ie();Kt();Ie();var DTt=Qe(rn(),1);Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Kt();Ie();Kt();Ie();Kt();Ie();Kt();Ie();Kt();Ie();Kt();Ie();Kt();Ie();Ie();Kt();Ie();Ie();Kt();Ie();Ie();Ie();Kt();Ie();Kt();Kt();Ie();Kt();Ie();Ie();Kt();Ie();Kt();Ie();Kt();Ie();Ie();Kt();Ie();Ie();Ie();Ie();Ie();Kt();Ie();Ie();Ie();Ie();Kt();Ie();Kt();Ie();Kt();Ie();Kt();Ie();Kt();Ie();Kt();Ie();Kt();Ie();Kt();Ie();Ie();Kt();Ie();Kt();Ie();Kt();Ie();Kt();Kt();Ie();Kt();Kt();Ie();Ie();Kt();Kt();Ie();Kt();Ie();Ie();Ie();Kt();Ie();Ie();Kt();Ie();Kt();Ie();Kt();Ie();Kt();Ie();Kt();Ie();Kt();Ie();Ie();Kt();Ie();Kt();Ie();Kt();Ie();Kt();Ie();Kt();Ie();Ie();Kt();Ie();Kt();Ie();Kt();Ie();Kt();Ie();Kt();Kt();Ie();Kt();Ie();Kt();Kt();Ie();Kt();Ie();Kt();Ie();Kt();Ie();Kt();Ie();Kt();Ie();Kt();Ie();Ie();var fn=(e)=>{};fn("extra props b");fn("missing props b");fn(!0);fn("property a has mismatched types");var UGo=Pt(["up","down","left","right"]),SIs=Pt(["top-to-bottom","left-to-right","bottom-to-top","right-to-left"]);fn(!0);fn(!0);var WGo=k().regex(/^calc\(.*\)$/),Hn=Ke,Jm=WGo.or(Ke),oTt=we({shape:he("pill"),width:Hn,height:Hn}),rTt=we({shape:he("rect"),width:Hn,height:Hn}),iTt=we({shape:he("circle"),radius:Hn}),wIs=ss("shape",[oTt,rTt,iTt]);fn(!0);var ou=are((e)=>{if(e&&typeof e==="object"&&"default"in e)return e.default;return e},k()),q1=we({x:Ke,y:Ke,z:Ke}),XGo=we({x:un([Ae(),k()]),y:un([Ae(),k()]),z:un([Ae(),k()])}),jGo=["x+","x-","y+","y-","z+","z-"],sTt=Pt(jGo),M4=we({rotationOffset:Ae().or(XGo).optional(),positionOffset:q1.optional(),modelOriginPosition:q1.optional(),modelBounds:we({min:q1,max:q1}).optional(),size:q1.optional(),modelUnitToMmScale:Hn.optional(),modelBoardNormalDirection:sTt.optional(),pcbRotationOffset:Ae().optional(),zOffsetFromSurface:Hn.optional(),showAsTranslucentModel:Be().optional(),stepUrl:ou.optional()});fn(!0);var KGo=M4.extend({stlUrl:ou}),$Go=M4.extend({objUrl:ou,mtlUrl:ou.optional()}),qGo=M4.extend({gltfUrl:ou}),JGo=M4.extend({glbUrl:ou}),ZGo=M4.extend({stepUrl:ou}),eUo=M4.extend({wrlUrl:ou}),tUo=M4.extend({jscad:gs(Jh())}),Uz=un([M1t(),k().min(1),Wa((e)=>e&&typeof e==="object"&&("type"in e)&&("props"in e)),KGo,$Go,qGo,JGo,ZGo,eUo,tUo]);fn(!0);var aTt=we({name:k().refine((e)=>e.trim().length>0,{message:"name cannot be empty"}),displayName:k().optional(),model:k().trim().min(1).optional(),modelUrl:ou.refine((e)=>e.trim().length>0,{message:"modelUrl cannot be empty"}).optional(),cadModel:Uz.optional(),children:Wa().optional()}).refine((e)=>e.modelUrl===void 0||e.cadModel===void 0,{message:"Provide either modelUrl or cadModel, not both",path:["modelUrl"]}).refine((e)=>e.model===void 0||e.modelUrl===void 0&&e.cadModel===void 0,{message:"Provide only one of model, modelUrl, or cadModel",path:["model"]});fn(!0);var cTt=we({name:k().trim().min(1),from:k().trim().min(1),to:k().trim().min(1),standard:he("usb_c").optional(),model:k().trim().min(1).optional()});fn(!0);var XYe=we({name:k().trim().min(1),displayName:k().optional(),model:k().trim().min(1).optional(),modelUrl:ou.refine((e)=>e.trim().length>0,"modelUrl cannot be empty").optional(),cadModel:Uz.optional(),children:Wa().optional()}).refine((e)=>[e.model,e.modelUrl,e.cadModel].filter((t)=>t!==void 0).length<=1,{message:"Provide only one of model, modelUrl, or cadModel",path:["model"]});fn(!0);var FBt=k().trim().regex(/^[A-Za-z_][A-Za-z0-9_-]*(?:\.[A-Za-z_][A-Za-z0-9_-]*)+$/,"Expected a qualified reference surface, e.g. part.face"),nUo=XYe.and(we({mountedTo:FBt.optional(),fastenedTo:FBt.optional(),mountFace:k().trim().min(1).optional(),mountGap:Hn.pipe(Ae().nonnegative().finite()).optional()})).superRefine((e,t)=>{if(e.mountedTo!==void 0&&e.fastenedTo!==void 0&&e.mountedTo!==e.fastenedTo)t.addIssue({code:Vt.custom,path:["fastenedTo"],message:"mountedTo and fastenedTo must refer to the same surface"});if(e.mountedTo===void 0&&e.fastenedTo===void 0){for(let n of["mountFace","mountGap"])if(e[n]!==void 0)t.addIssue({code:Vt.custom,path:[n],message:`${n} requires mountedTo or fastenedTo`})}}).transform(({fastenedTo:e,...t})=>{let n=t.mountedTo??e;return n===void 0?t:{...t,mountedTo:n}});fn(!0);var NYe=Hn.pipe(Ae().positive().finite()),FIs=nUo.and(we({diameter:NYe.optional(),length:NYe.optional(),threadPitch:NYe.optional(),headType:Pt(["socket","hex","pan","countersunk"]).optional()})).superRefine((e,t)=>{if([e.model,e.modelUrl,e.cadModel].some((o)=>o!==void 0)){for(let o of["diameter","length","threadPitch","headType"])if(e[o]!==void 0)t.addIssue({code:Vt.custom,path:[o],message:"Bolt dimensions and headType are exclusive with CAD sources"})}else for(let o of["diameter","length"])if(e[o]===void 0)t.addIssue({code:Vt.custom,path:[o],message:"Provide diameter and length, or an assembly CAD source"})}).transform((e)=>e.diameter===void 0?e:{...e,headType:e.headType??"socket"});fn(!0);var lTt=we({name:k().optional(),model:k().trim().min(1).optional(),modelUrl:ou.refine((e)=>e.trim().length>0,{message:"modelUrl cannot be empty"}).optional()}).refine((e)=>e.model===void 0||e.modelUrl===void 0,{message:"Provide either model or modelUrl, not both",path:["model"]});fn(!0);var RYe=Hn.pipe(Ae().finite()),zBt=Hn.pipe(Ae().positive().finite()),hTt=we({name:k().trim().min(1).default("anchor"),shape:he("rect").default("rect"),plane:Pt(["xy","xz","yz"]).default("xy"),normalDirection:Pt(["x+","x-","y+","y-","z+","z-"]).optional(),centerXOffset:RYe.default(0),centerYOffset:RYe.default(0),centerZOffset:RYe.default(0),width:zBt.optional(),height:zBt.optional()}).refine((e)=>e.width===void 0===(e.height===void 0),{message:"Provide width and height together",path:["width"]}).superRefine((e,t)=>{let n=e.plane==="xy"?"z":e.plane==="xz"?"y":"x";if(e.normalDirection&&e.normalDirection[0]!==n)t.addIssue({code:Vt.custom,path:["normalDirection"],message:`normalDirection must be ${n}+ or ${n}- for plane ${e.plane}`})}).transform((e)=>({...e,normalDirection:e.normalDirection??(e.plane==="xy"?"z+":e.plane==="xz"?"y+":"x+")}));fn(!0);var uTt=we({name:k().trim().min(1),displayName:k().optional(),color:k().trim().min(1).optional(),material:Pt(["pla","petg","nylon"]).optional(),children:Wa().optional(),jscad:Wa(dTt.isValidElement,"Expected jscad-fiber JSX").optional(),model:k().trim().min(1).optional(),modelUrl:ou.refine((e)=>e.trim().length>0,"modelUrl cannot be empty").optional(),cadModel:Uz.optional(),mountedTo:k().trim().regex(/^.+\.[^.]+$/,"Expected part.face").optional(),mountFace:k().trim().min(1).optional(),mountGap:Hn.pipe(Ae().nonnegative().finite()).optional()}).superRefine((e,t)=>{if([e.jscad,e.model,e.modelUrl,e.cadModel].filter((n)=>n!==void 0).length!==1)t.addIssue({code:Vt.custom,path:["jscad"],message:"Provide exactly one of jscad, model, modelUrl, or cadModel"});if(e.mountedTo===void 0!==(e.mountFace===void 0))t.addIssue({code:Vt.custom,path:["mountFace"],message:"Provide mountedTo and mountFace together"});if(e.mountGap!==void 0&&e.mountedTo===void 0)t.addIssue({code:Vt.custom,path:["mountGap"],message:"mountGap requires mountedTo"})});fn(!0);var pTt=we({name:k().refine((e)=>e.trim().length>0,{message:"name cannot be empty"}),displayName:k().optional(),standard:Pt(["nema8","nema17","nema23"]).optional(),model:k().trim().min(1).optional(),shaftFacingDirection:sTt.optional(),wireConnection:k().optional(),mountedTo:k().trim().regex(/^.+\.[^.]+$/,"Expected part.face").optional(),mountFace:k().trim().min(1).optional(),mountGap:Hn.pipe(Ae().nonnegative().finite()).optional()}).superRefine((e,t)=>{if(e.mountedTo===void 0!==(e.mountFace===void 0))t.addIssue({code:Vt.custom,message:"Provide mountedTo and mountFace together",path:["mountFace"]});if(e.mountGap!==void 0&&e.mountedTo===void 0)t.addIssue({code:Vt.custom,message:"mountGap requires mountedTo",path:["mountGap"]});if(e.mountedTo!==void 0&&e.shaftFacingDirection!==void 0)t.addIssue({code:Vt.custom,message:"Mounted motors derive shaft direction from the mating faces",path:["shaftFacingDirection"]});if(e.model!==void 0&&e.wireConnection!==void 0)t.addIssue({code:Vt.custom,message:"Set wireConnection in the custom model string, or use standard",path:["wireConnection"]});if(e.standard===void 0&&e.model===void 0)t.addIssue({code:Vt.custom,message:"Provide standard or model",path:["standard"]});if(e.standard!==void 0&&e.model!==void 0)t.addIssue({code:Vt.custom,message:"Provide either standard or model, not both",path:["model"]})}).transform((e)=>e.mountedTo===void 0?{...e,shaftFacingDirection:e.shaftFacingDirection??"z+"}:e);fn(!0);var QYe=(e)=>k().refine((t)=>t.trim().length>0,{message:`${e} cannot be empty`}),OBt=(e)=>Hn.refine((t)=>Number.isFinite(t)&&t>0,{message:`${e} must be a positive finite distance`}),mTt=we({name:QYe("name"),model:k().trim().min(1).optional(),modelUrl:ou.refine((e)=>e.trim().length>0,{message:"modelUrl cannot be empty"}).optional(),connectsTo:QYe("connectsTo"),width:OBt("width").optional(),height:OBt("height").optional(),cadModel:QYe("cadModel").optional()}).superRefine((e,t)=>{if(e.model!==void 0&&(e.modelUrl!==void 0||e.cadModel!==void 0))t.addIssue({code:Vt.custom,message:"Provide only one of model, modelUrl, or cadModel",path:["model"]});if(e.modelUrl!==void 0&&e.cadModel!==void 0)t.addIssue({code:Vt.custom,message:"Provide either modelUrl or cadModel, not both",path:["modelUrl"]});let n=e.width!==void 0,o=e.height!==void 0;if(n!==o){t.addIssue({code:Vt.custom,message:"width and height must be provided together",path:n?["height"]:["width"]});return}if(!n&&e.cadModel===void 0&&e.modelUrl===void 0&&e.model===void 0)t.addIssue({code:Vt.custom,message:"provide width and height, model, cadModel, or modelUrl",path:[]})});fn(!0);var oUo="[A-Za-z_][A-Za-z0-9_-]*(?:\\.[A-Za-z_][A-Za-z0-9_-]*)*",_Tt="[A-Za-z_][A-Za-z0-9_-]*(?:\\.[A-Za-z_][A-Za-z0-9_-]*)+",rUo=new RegExp(`^${_Tt}$`),iUo=new RegExp(`^${oUo}$`),sUo=new RegExp(`^calc\\(\\s*(${_Tt})\\s*(?:([+-])\\s*((?:\\d+(?:\\.\\d*)?|\\.\\d+))\\s*(degcw|degccw))?\\s*\\)$`),aUo=k().trim().superRefine((e,t)=>{if(rUo.test(e))return;let n=sUo.exec(e);if(!n){t.addIssue({code:Vt.custom,message:"Expected a qualified mounting reference or calc(reference +/- Ndegcw|Ndegccw)"});return}if(n[3]!==void 0&&!Number.isFinite(Number(n[3])))t.addIssue({code:Vt.custom,message:"Mount rotation angle must be finite"})}),cUo=Wa((e)=>typeof e==="string",{message:"Expected a board edge or component identity path"}).transform((e)=>e.trim()).refine((e)=>iUo.test(e),{message:"Expected a board edge or component identity path"}),lUo=Pt(["top_layer_toward_mount_face","bottom_layer_toward_mount_face"]);var hUo=we({margin:Hn.optional(),widthDimensionOffset:Hn.optional(),heightDimensionOffset:Hn.optional(),depth:Hn.optional()}),kYe=hUo.shape,gTt=ss("shape",[oTt.extend(kYe),rTt.extend(kYe),iTt.extend(kYe)]);fn(!0);var ATt=we({name:k().optional(),boardRef:k().min(1),width:Hn.optional(),height:Hn.optional(),depth:Hn.optional(),wallThickness:Hn.default("2mm"),floorThickness:Hn.optional(),lidThickness:Hn.optional(),boardClearance:Hn.optional(),standoffHeight:Hn.optional(),topHeadroom:Hn.optional(),lidLipDepth:Hn.optional(),disableCutouts:Be().optional(),showHiddenEdges:Be().optional()});fn(!0);var jC=it(k().or(Ae()));fn(!0);var jYe=Wa((e)=>!0),J1=we({x:Ke,y:Ke}),KYe=J1.extend({rotation:ei.optional()});fn(!0);var fTt=we({size:J1.optional(),thickness:Ke.optional()});fn(!0);var dUo=we({font:fTt.optional()});fn(!0);var o5e=we({value:k(),at:KYe.optional(),layer:k().optional(),uuid:k().optional(),hide:Be().optional(),effects:dUo.optional()});fn(!0);var uUo=we({Reference:o5e.optional(),Value:o5e.optional(),Datasheet:o5e.optional(),Description:o5e.optional()});fn(!0);var pUo=we({through_hole:Be().optional(),smd:Be().optional(),exclude_from_pos_files:Be().optional(),exclude_from_bom:Be().optional()});fn(!0);var mUo=we({name:k(),type:k(),shape:k().optional(),at:KYe.optional(),size:J1.optional(),drill:Ke.optional(),layers:it(k()).optional(),removeUnusedLayers:Be().optional(),uuid:k().optional()});fn(!0);var _Uo=we({path:k(),offset:q1.optional(),scale:q1.optional(),rotate:q1.optional()});fn(!0);var gUo=we({footprintName:k().optional(),version:un([Ae(),k()]).optional(),generator:k().optional(),generatorVersion:un([Ae(),k()]).optional(),layer:k().optional(),properties:uUo.optional(),attributes:pUo.optional(),pads:it(mUo).optional(),embeddedFonts:Be().optional(),model:_Uo.optional()});fn(!0);var AUo=we({hide:Be().optional()});fn(!0);var fUo=we({offset:Ke.optional(),hide:Be().optional()});fn(!0);var yUo=we({font:fTt.optional(),justify:un([k(),it(k())]).optional(),hide:Be().optional()});fn(!0);var Gz=we({value:k(),id:un([Ae(),k()]).optional(),at:KYe.optional(),effects:yUo.optional()});fn(!0);var xUo=we({Reference:Gz.optional(),Value:Gz.optional(),Footprint:Gz.optional(),Datasheet:Gz.optional(),Description:Gz.optional(),ki_keywords:Gz.optional(),ki_fp_filters:Gz.optional()});fn(!0);var CUo=we({symbolName:k().optional(),extends:k().optional(),pinNumbers:AUo.optional(),pinNames:fUo.optional(),excludeFromSim:Be().optional(),inBom:Be().optional(),onBoard:Be().optional(),properties:xUo.optional(),embeddedFonts:Be().optional()});fn(!0);var $Ye=we({silkscreenFontSize:Ke.optional(),viaPadDiameter:Ke.optional(),viaHoleDiameter:Ke.optional(),silkscreenTextPosition:un([Pt(["centered","outside","none"]),we({offsetX:Ae(),offsetY:Ae()})]).optional(),silkscreenTextVisibility:Pt(["hidden","visible","inherit"]).optional()});fn(!0);var bUo=we({fontSize:be.optional(),pcbX:Jm.optional(),pcbY:Jm.optional(),visibility:Pt(["hidden","visible","inherit"]).optional()}),yTt=gs(k(),bUo);fn(!0);var LYe=Pt(["i2c_sda","i2c_scl","spi_cs","spi_sck","spi_mosi","spi_miso","uart_tx","uart_rx"]),IUo=we({isInput:Be().optional(),isOutput:Be().optional(),isBidirectional:Be().optional(),isPassive:Be().optional(),canUseTriState:Be().optional(),isUsingTriState:Be().optional(),canUseOpenCollector:Be().optional(),isUsingOpenCollector:Be().optional(),canUseOpenEmitter:Be().optional(),isUsingOpenEmitter:Be().optional(),capabilities:it(LYe).optional(),activeCapabilities:it(LYe).optional(),activeCapability:LYe.optional(),providesPower:Be().optional(),requiresPower:Be().optional(),providesGround:Be().optional(),requiresGround:Be().optional(),providesVoltage:un([k(),Ae()]).optional(),requiresVoltage:un([k(),Ae()]).optional(),requiredVoltageTolerance:un([Ae(),k().trim().regex(/^(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?\s*%?$/,"Expected a tolerance fraction or percentage").transform((e)=>e.endsWith("%")?Number(e.slice(0,-1))/100:Number(e))]).pipe(Ae().finite().min(0).max(1)).optional(),doNotConnect:Be().optional(),includeInBoardPinout:Be().optional(),highlightColor:k().optional(),mustBeConnected:Be().optional(),canUseInternalPullup:Be().optional(),isUsingInternalPullup:Be().optional(),needsExternalPullup:Be().optional(),canUseInternalPulldown:Be().optional(),isUsingInternalPulldown:Be().optional(),needsExternalPulldown:Be().optional(),canUseOpenDrain:Be().optional(),isUsingOpenDrain:Be().optional(),canUsePushPull:Be().optional(),isUsingPushPull:Be().optional(),shouldHaveDecouplingCapacitor:Be().optional(),recommendedDecouplingCapacitorCapacitance:un([k(),Ae()]).optional(),isGpio:Be().optional()});fn(!0);var vUo=we({defaultPassiveSize:un([Pt(["xs","sm","md"]),Ke]).optional(),defaultCapacitorOrientation:Pt(["vertical","none"]).optional()});fn(!0);var SUo=Wa((e)=>!0),ws=we({pcbX:Jm.optional(),pcbY:Jm.optional(),pcbLeftEdgeX:Jm.optional(),pcbRightEdgeX:Jm.optional(),pcbTopEdgeY:Jm.optional(),pcbBottomEdgeY:Jm.optional(),pcbOffsetX:Ke.optional(),pcbOffsetY:Ke.optional(),pcbRotation:ei.optional(),pcbPositionAnchor:k().optional(),pcbPositionMode:Pt(["relative_to_group_anchor","auto","relative_to_board_anchor","relative_to_component_anchor"]).optional(),shouldBeOnEdgeOfBoard:Be().optional(),layer:Bo.optional(),pcbMarginTop:Ke.optional(),pcbMarginRight:Ke.optional(),pcbMarginBottom:Ke.optional(),pcbMarginLeft:Ke.optional(),pcbMarginX:Ke.optional(),pcbMarginY:Ke.optional(),pcbStyle:$Ye.optional(),pcbSx:yTt.optional(),pcbRelative:Be().optional(),relative:Be().optional()});fn(!0);var l5e=we({pcbX:Jm.optional(),pcbY:Jm.optional(),pcbLeftEdgeX:Jm.optional(),pcbRightEdgeX:Jm.optional(),pcbTopEdgeY:Jm.optional(),pcbBottomEdgeY:Jm.optional(),pcbOffsetX:Ke.optional(),pcbOffsetY:Ke.optional(),pcbRotation:ei.optional(),pcbPositionAnchor:k().optional(),pcbPositionMode:Pt(["relative_to_group_anchor","auto","relative_to_board_anchor","relative_to_component_anchor"]).optional(),shouldBeOnEdgeOfBoard:Be().optional(),pcbMarginTop:Ke.optional(),pcbMarginRight:Ke.optional(),pcbMarginBottom:Ke.optional(),pcbMarginLeft:Ke.optional(),pcbMarginX:Ke.optional(),pcbMarginY:Ke.optional(),pcbStyle:$Ye.optional(),pcbSx:yTt.optional(),schMarginTop:Ke.optional(),schMarginRight:Ke.optional(),schMarginBottom:Ke.optional(),schMarginLeft:Ke.optional(),schMarginX:Ke.optional(),schMarginY:Ke.optional(),schX:Ke.optional(),schY:Ke.optional(),schRotation:ei.optional(),layer:Bo.optional(),footprint:jYe.optional(),symbol:SUo.optional(),schStyle:vUo.optional(),relative:Be().optional(),schRelative:Be().optional(),pcbRelative:Be().optional()});fn(!0);var $M=we({supplierPartNumbers:gs(K8,it(k())).optional()});fn(!0);var ru=l5e.merge($M).extend({key:Jh().optional(),name:k(),displayName:k().optional(),schSectionName:k().optional().describe('This component will be drawn as part of this section e.g. "Power"'),schSheetName:k().optional().describe('This component will be drawn as part of this sheet e.g. "Main"'),datasheetUrl:ou.optional(),cadModel:Uz.optional(),kicadFootprintMetadata:gUo.optional(),kicadSymbolMetadata:CUo.optional(),children:Jh().optional(),symbolName:k().optional(),doNotPlace:Be().optional(),isSmt:Be().optional().describe("Whether this component is surface mounted. True marks it as SMT; false marks it as through hole. Omit to let core infer mounting style from the footprint. Parsed unchanged with no aliases or schema conflicts; core determines solder paste generation, including for plated-hole pads."),allowOffBoard:Be().optional().describe("Allows the PCB component to hang off the board (e.g. for USB ports or displays)"),obstructsWithinBounds:Be().optional().describe("Does this component take up all the space within its bounds on a layer. This is generally true except for when separated pin headers are being represented by a single component (in which case, chips can be placed between the pin headers) or for tall modules where chips fit underneath"),showAsTranslucentModel:Be().optional().describe("Whether to show this component's CAD model as translucent in the 3D viewer."),pinAttributes:gs(k(),IUo).optional(),mpn:k().describe("Manufacturer Part Number").optional(),mfn:k().describe("Manufacturer Part Number").optional(),manufacturerPartNumber:k().optional()});fn(!0);var xTt=["pin1","left","pin2","right"],Dse=["pin1","left","anode","pos","pin2","right","cathode","neg"],u9s=Ke.or(Pt(["2x","3x","4x"])),ii=(e)=>{let t=[e.manufacturerPartNumber,e.mpn,e.mfn].map((n)=>n?.trim()).filter((n)=>Boolean(n));if(new Set(t).size>1)throw Error("Conflicting manufacturerPartNumber, mpn, and mfn: specify the same manufacturer part number for all aliases");return t[0]},PUo=J1.extend({via:Be().optional(),fromLayer:Bo.optional(),toLayer:Bo.optional()}),EUo=PUo.superRefine((e,t)=>{if(e.via){if(!e.toLayer)t.addIssue({code:Vt.custom,message:"toLayer is required when via is true",path:["toLayer"]})}else if(e.fromLayer||e.toLayer)t.addIssue({code:Vt.custom,message:"fromLayer/toLayer are only allowed when via is true",path:["via"]})}),YYe=it(un([EUo,k()]));fn(!0);fn(!0);var MUo=["Audio_Module/Reverb_BTDR-1H","Audio_Module/Reverb_BTDR-1V","Battery/BatteryClip_Keystone_54_D16-19mm","Battery/BatteryHolder_Bulgin_BX0034_1xAAA","Battery/BatteryHolder_Bulgin_BX0036_1xC","Battery/BatteryHolder_Bulgin_BX0123_1xCR123","Battery/BatteryHolder_ComfortableElectronic_CH273-2450_1x2450","Battery/BatteryHolder_Eagle_12BH611-GR","Battery/BatteryHolder_Keystone_103_1x20mm","Battery/BatteryHolder_Keystone_1042_1x18650","Battery/BatteryHolder_Keystone_104_1x23mm","Battery/BatteryHolder_Keystone_1057_1x2032","Battery/BatteryHolder_Keystone_1058_1x2032","Battery/BatteryHolder_Keystone_105_1x2430","Battery/BatteryHolder_Keystone_1060_1x2032","Battery/BatteryHolder_Keystone_106_1x20mm","Battery/BatteryHolder_Keystone_107_1x23mm","Battery/BatteryHolder_Keystone_2460_1xAA","Battery/BatteryHolder_Keystone_2462_2xAA","Battery/BatteryHolder_Keystone_2466_1xAAA","Battery/BatteryHolder_Keystone_2468_2xAAA","Battery/BatteryHolder_Keystone_2479_3xAAA","Battery/BatteryHolder_Keystone_2993","Battery/BatteryHolder_Keystone_2998_1x6.8mm","Battery/BatteryHolder_Keystone_3000_1x12mm","Battery/BatteryHolder_Keystone_3001_1x12mm","Battery/BatteryHolder_Keystone_3002_1x2032","Battery/BatteryHolder_Keystone_3008_1x2450","Battery/BatteryHolder_Keystone_3009_1x2450","Battery/BatteryHolder_Keystone_3034_1x20mm","Battery/BatteryHolder_Keystone_500","Battery/BatteryHolder_Keystone_590","Battery/BatteryHolder_LINX_BAT-HLD-012-SMT","Battery/BatteryHolder_MPD_BA9VPC_1xPP3","Battery/BatteryHolder_MPD_BC12AAPC_2xAA","Battery/BatteryHolder_MPD_BC2003_1x2032","Battery/BatteryHolder_MPD_BC2AAPC_2xAA","Battery/BatteryHolder_MPD_BH-18650-PC","Battery/BatteryHolder_MPD_BK-18650-PC2","Battery/BatteryHolder_MYOUNG_BS-07-A1BJ001_CR2032","Battery/BatteryHolder_Multicomp_BC-2001_1x2032","Battery/BatteryHolder_Renata_SMTU2032-LF_1x2032","Battery/BatteryHolder_Seiko_MS621F","Battery/BatteryHolder_TruPower_BH-331P_3xAA","Battery/Battery_CR1225","Battery/Battery_Panasonic_CR1025-VSK_Vertical_CircularHoles","Battery/Battery_Panasonic_CR1220-VCN_Vertical_CircularHoles","Battery/Battery_Panasonic_CR1632-V1AN_Vertical_CircularHoles","Battery/Battery_Panasonic_CR2025-V1AK_Vertical_CircularHoles","Battery/Battery_Panasonic_CR2032-HFN_Horizontal_CircularHoles","Battery/Battery_Panasonic_CR2032-VS1N_Vertical_CircularHoles","Battery/Battery_Panasonic_CR2354-VCN_Vertical_CircularHoles","Battery/Battery_Panasonic_CR2450-VAN_Vertical_CircularHoles","Battery/Battery_Panasonic_CR2477-VCN_Vertical_CircularHoles","Battery/Battery_Panasonic_CR3032-VCN_Vertical_CircularHoles","Button_Switch_Keyboard/SW_Cherry_MX_1.00u_PCB","Button_Switch_Keyboard/SW_Cherry_MX_1.00u_Plate","Button_Switch_Keyboard/SW_Cherry_MX_1.25u_PCB","Button_Switch_Keyboard/SW_Cherry_MX_1.25u_Plate","Button_Switch_Keyboard/SW_Cherry_MX_1.50u_PCB","Button_Switch_Keyboard/SW_Cherry_MX_1.50u_Plate","Button_Switch_Keyboard/SW_Cherry_MX_1.75u_PCB","Button_Switch_Keyboard/SW_Cherry_MX_1.75u_Plate","Button_Switch_Keyboard/SW_Cherry_MX_2.00u_PCB","Button_Switch_Keyboard/SW_Cherry_MX_2.00u_Plate","Button_Switch_Keyboard/SW_Cherry_MX_2.00u_Vertical_PCB","Button_Switch_Keyboard/SW_Cherry_MX_2.00u_Vertical_Plate","Button_Switch_Keyboard/SW_Cherry_MX_2.25u_PCB","Button_Switch_Keyboard/SW_Cherry_MX_2.25u_Plate","Button_Switch_Keyboard/SW_Cherry_MX_2.75u_PCB","Button_Switch_Keyboard/SW_Cherry_MX_2.75u_Plate","Button_Switch_Keyboard/SW_Cherry_MX_6.25u_PCB","Button_Switch_Keyboard/SW_Cherry_MX_6.25u_Plate","Button_Switch_Keyboard/SW_Cherry_MX_ISOEnter_PCB","Button_Switch_Keyboard/SW_Cherry_MX_ISOEnter_Plate","Button_Switch_Keyboard/SW_Matias_1.00u","Button_Switch_Keyboard/SW_Matias_1.25u","Button_Switch_Keyboard/SW_Matias_1.50u","Button_Switch_Keyboard/SW_Matias_1.75u","Button_Switch_Keyboard/SW_Matias_2.00u","Button_Switch_Keyboard/SW_Matias_2.25u","Button_Switch_Keyboard/SW_Matias_2.75u","Button_Switch_Keyboard/SW_Matias_6.25u","Button_Switch_Keyboard/SW_Matias_ISOEnter","Button_Switch_SMD/Nidec_Copal_CAS-120A","Button_Switch_SMD/Nidec_Copal_SH-7010A","Button_Switch_SMD/Nidec_Copal_SH-7010B","Button_Switch_SMD/Nidec_Copal_SH-7040B","Button_Switch_SMD/Panasonic_EVQPUJ_EVQPUA","Button_Switch_SMD/Panasonic_EVQPUK_EVQPUB","Button_Switch_SMD/Panasonic_EVQPUL_EVQPUC","Button_Switch_SMD/Panasonic_EVQPUM_EVQPUD","Button_Switch_SMD/SW_DIP_SPSTx01_Slide_6.7x4.1mm_W6.73mm_P2.54mm_LowProfile_JPin","Button_Switch_SMD/SW_DIP_SPSTx01_Slide_6.7x4.1mm_W8.61mm_P2.54mm_LowProfile","Button_Switch_SMD/SW_DIP_SPSTx01_Slide_9.78x4.72mm_W8.61mm_P2.54mm","Button_Switch_SMD/SW_DIP_SPSTx01_Slide_Copal_CHS-01A_W5.08mm_P1.27mm_JPin","Button_Switch_SMD/SW_DIP_SPSTx01_Slide_Copal_CHS-01B_W7.62mm_P1.27mm","Button_Switch_SMD/SW_DIP_SPSTx01_Slide_Copal_CVS-01xB_W5.9mm_P1mm","Button_Switch_SMD/SW_DIP_SPSTx01_Slide_Omron_A6S-110x_W8.9mm_P2.54mm","Button_Switch_SMD/SW_DIP_SPSTx02_Slide_6.7x6.64mm_W6.73mm_P2.54mm_LowProfile_JPin","Button_Switch_SMD/SW_DIP_SPSTx02_Slide_6.7x6.64mm_W8.61mm_P2.54mm_LowProfile","Button_Switch_SMD/SW_DIP_SPSTx02_Slide_9.78x7.26mm_W8.61mm_P2.54mm","Button_Switch_SMD/SW_DIP_SPSTx02_Slide_Copal_CHS-02A_W5.08mm_P1.27mm_JPin","Button_Switch_SMD/SW_DIP_SPSTx02_Slide_Copal_CHS-02B_W7.62mm_P1.27mm","Button_Switch_SMD/SW_DIP_SPSTx02_Slide_Copal_CVS-02xB_W5.9mm_P1mm","Button_Switch_SMD/SW_DIP_SPSTx02_Slide_KingTek_DSHP02TJ_W5.25mm_P1.27mm_JPin","Button_Switch_SMD/SW_DIP_SPSTx02_Slide_KingTek_DSHP02TS_W7.62mm_P1.27mm","Button_Switch_SMD/SW_DIP_SPSTx02_Slide_Omron_A6H-2101_W6.15mm_P1.27mm","Button_Switch_SMD/SW_DIP_SPSTx02_Slide_Omron_A6S-210x_W8.9mm_P2.54mm","Button_Switch_SMD/SW_DIP_SPSTx03_Slide_6.7x9.18mm_W6.73mm_P2.54mm_LowProfile_JPin","Button_Switch_SMD/SW_DIP_SPSTx03_Slide_6.7x9.18mm_W8.61mm_P2.54mm_LowProfile","Button_Switch_SMD/SW_DIP_SPSTx03_Slide_9.78x9.8mm_W8.61mm_P2.54mm","Button_Switch_SMD/SW_DIP_SPSTx03_Slide_Copal_CVS-03xB_W5.9mm_P1mm","Button_Switch_SMD/SW_DIP_SPSTx03_Slide_KingTek_DSHP03TJ_W5.25mm_P1.27mm_JPin","Button_Switch_SMD/SW_DIP_SPSTx03_Slide_KingTek_DSHP03TS_W7.62mm_P1.27mm","Button_Switch_SMD/SW_DIP_SPSTx03_Slide_Omron_A6S-310x_W8.9mm_P2.54mm","Button_Switch_SMD/SW_DIP_SPSTx04_Slide_6.7x11.72mm_W6.73mm_P2.54mm_LowProfile_JPin","Button_Switch_SMD/SW_DIP_SPSTx04_Slide_6.7x11.72mm_W8.61mm_P2.54mm_LowProfile","Button_Switch_SMD/SW_DIP_SPSTx04_Slide_9.78x12.34mm_W8.61mm_P2.54mm","Button_Switch_SMD/SW_DIP_SPSTx04_Slide_Copal_CHS-04A_W5.08mm_P1.27mm_JPin","Button_Switch_SMD/SW_DIP_SPSTx04_Slide_Copal_CHS-04B_W7.62mm_P1.27mm","Button_Switch_SMD/SW_DIP_SPSTx04_Slide_Copal_CVS-04xB_W5.9mm_P1mm","Button_Switch_SMD/SW_DIP_SPSTx04_Slide_KingTek_DSHP04TJ_W5.25mm_P1.27mm_JPin","Button_Switch_SMD/SW_DIP_SPSTx04_Slide_KingTek_DSHP04TS_W7.62mm_P1.27mm","Button_Switch_SMD/SW_DIP_SPSTx04_Slide_Omron_A6H-4101_W6.15mm_P1.27mm","Button_Switch_SMD/SW_DIP_SPSTx04_Slide_Omron_A6S-410x_W8.9mm_P2.54mm","Button_Switch_SMD/SW_DIP_SPSTx05_Slide_6.7x14.26mm_W6.73mm_P2.54mm_LowProfile_JPin","Button_Switch_SMD/SW_DIP_SPSTx05_Slide_6.7x14.26mm_W8.61mm_P2.54mm_LowProfile","Button_Switch_SMD/SW_DIP_SPSTx05_Slide_9.78x14.88mm_W8.61mm_P2.54mm","Button_Switch_SMD/SW_DIP_SPSTx05_Slide_KingTek_DSHP05TJ_W5.25mm_P1.27mm_JPin","Button_Switch_SMD/SW_DIP_SPSTx05_Slide_KingTek_DSHP05TS_W7.62mm_P1.27mm","Button_Switch_SMD/SW_DIP_SPSTx05_Slide_Omron_A6S-510x_W8.9mm_P2.54mm","Button_Switch_SMD/SW_DIP_SPSTx06_Slide_6.7x16.8mm_W6.73mm_P2.54mm_LowProfile_JPin","Button_Switch_SMD/SW_DIP_SPSTx06_Slide_6.7x16.8mm_W8.61mm_P2.54mm_LowProfile","Button_Switch_SMD/SW_DIP_SPSTx06_Slide_9.78x17.42mm_W8.61mm_P2.54mm","Button_Switch_SMD/SW_DIP_SPSTx06_Slide_Copal_CHS-06A_W5.08mm_P1.27mm_JPin","Button_Switch_SMD/SW_DIP_SPSTx06_Slide_Copal_CHS-06B_W7.62mm_P1.27mm","Button_Switch_SMD/SW_DIP_SPSTx06_Slide_KingTek_DSHP06TJ_W5.25mm_P1.27mm_JPin","Button_Switch_SMD/SW_DIP_SPSTx06_Slide_KingTek_DSHP06TS_W7.62mm_P1.27mm","Button_Switch_SMD/SW_DIP_SPSTx06_Slide_Omron_A6H-6101_W6.15mm_P1.27mm","Button_Switch_SMD/SW_DIP_SPSTx06_Slide_Omron_A6S-610x_W8.9mm_P2.54mm","Button_Switch_SMD/SW_DIP_SPSTx07_Slide_6.7x19.34mm_W6.73mm_P2.54mm_LowProfile_JPin","Button_Switch_SMD/SW_DIP_SPSTx07_Slide_6.7x19.34mm_W8.61mm_P2.54mm_LowProfile","Button_Switch_SMD/SW_DIP_SPSTx07_Slide_9.78x19.96mm_W8.61mm_P2.54mm","Button_Switch_SMD/SW_DIP_SPSTx07_Slide_KingTek_DSHP07TJ_W5.25mm_P1.27mm_JPin","Button_Switch_SMD/SW_DIP_SPSTx07_Slide_KingTek_DSHP07TS_W7.62mm_P1.27mm","Button_Switch_SMD/SW_DIP_SPSTx07_Slide_Omron_A6S-710x_W8.9mm_P2.54mm","Button_Switch_SMD/SW_DIP_SPSTx08_Slide_6.7x21.88mm_W6.73mm_P2.54mm_LowProfile_JPin","Button_Switch_SMD/SW_DIP_SPSTx08_Slide_6.7x21.88mm_W8.61mm_P2.54mm_LowProfile","Button_Switch_SMD/SW_DIP_SPSTx08_Slide_9.78x22.5mm_W8.61mm_P2.54mm","Button_Switch_SMD/SW_DIP_SPSTx08_Slide_Copal_CHS-08A_W5.08mm_P1.27mm_JPin","Button_Switch_SMD/SW_DIP_SPSTx08_Slide_Copal_CHS-08B_W7.62mm_P1.27mm","Button_Switch_SMD/SW_DIP_SPSTx08_Slide_Copal_CVS-08xB_W5.9mm_P1mm","Button_Switch_SMD/SW_DIP_SPSTx08_Slide_KingTek_DSHP08TJ_W5.25mm_P1.27mm_JPin","Button_Switch_SMD/SW_DIP_SPSTx08_Slide_KingTek_DSHP08TS_W7.62mm_P1.27mm","Button_Switch_SMD/SW_DIP_SPSTx08_Slide_Omron_A6H-8101_W6.15mm_P1.27mm","Button_Switch_SMD/SW_DIP_SPSTx08_Slide_Omron_A6S-810x_W8.9mm_P2.54mm","Button_Switch_SMD/SW_DIP_SPSTx09_Slide_6.7x24.42mm_W6.73mm_P2.54mm_LowProfile_JPin","Button_Switch_SMD/SW_DIP_SPSTx09_Slide_6.7x24.42mm_W8.61mm_P2.54mm_LowProfile","Button_Switch_SMD/SW_DIP_SPSTx09_Slide_9.78x25.04mm_W8.61mm_P2.54mm","Button_Switch_SMD/SW_DIP_SPSTx09_Slide_KingTek_DSHP09TJ_W5.25mm_P1.27mm_JPin","Button_Switch_SMD/SW_DIP_SPSTx09_Slide_KingTek_DSHP09TS_W7.62mm_P1.27mm","Button_Switch_SMD/SW_DIP_SPSTx09_Slide_Omron_A6S-910x_W8.9mm_P2.54mm","Button_Switch_SMD/SW_DIP_SPSTx10_Slide_6.7x26.96mm_W6.73mm_P2.54mm_LowProfile_JPin","Button_Switch_SMD/SW_DIP_SPSTx10_Slide_6.7x26.96mm_W8.61mm_P2.54mm_LowProfile","Button_Switch_SMD/SW_DIP_SPSTx10_Slide_9.78x27.58mm_W8.61mm_P2.54mm","Button_Switch_SMD/SW_DIP_SPSTx10_Slide_Copal_CHS-10A_W5.08mm_P1.27mm_JPin","Button_Switch_SMD/SW_DIP_SPSTx10_Slide_Copal_CHS-10B_W7.62mm_P1.27mm","Button_Switch_SMD/SW_DIP_SPSTx10_Slide_KingTek_DSHP10TJ_W5.25mm_P1.27mm_JPin","Button_Switch_SMD/SW_DIP_SPSTx10_Slide_KingTek_DSHP10TS_W7.62mm_P1.27mm","Button_Switch_SMD/SW_DIP_SPSTx10_Slide_Omron_A6H-10101_W6.15mm_P1.27mm","Button_Switch_SMD/SW_DIP_SPSTx10_Slide_Omron_A6S-1010x_W8.9mm_P2.54mm","Button_Switch_SMD/SW_DIP_SPSTx11_Slide_6.7x29.5mm_W6.73mm_P2.54mm_LowProfile_JPin","Button_Switch_SMD/SW_DIP_SPSTx11_Slide_6.7x29.5mm_W8.61mm_P2.54mm_LowProfile","Button_Switch_SMD/SW_DIP_SPSTx11_Slide_9.78x30.12mm_W8.61mm_P2.54mm","Button_Switch_SMD/SW_DIP_SPSTx12_Slide_6.7x32.04mm_W6.73mm_P2.54mm_LowProfile_JPin","Button_Switch_SMD/SW_DIP_SPSTx12_Slide_6.7x32.04mm_W8.61mm_P2.54mm_LowProfile","Button_Switch_SMD/SW_DIP_SPSTx12_Slide_9.78x32.66mm_W8.61mm_P2.54mm","Button_Switch_SMD/SW_DPDT_CK_JS202011JCQN","Button_Switch_SMD/SW_MEC_5GSH9","Button_Switch_SMD/SW_Push_1P1T-MP_NO_Horizontal_Alps_SKRTLAE010","Button_Switch_SMD/SW_Push_1P1T-SH_NO_CK_KMR2xxG","Button_Switch_SMD/SW_Push_1P1T_NO_CK_KMR2","Button_Switch_SMD/SW_Push_1P1T_NO_CK_KSC6xxG","Button_Switch_SMD/SW_Push_1P1T_NO_CK_KSC6xxJ","Button_Switch_SMD/SW_Push_1P1T_NO_CK_KSC7xxJ","Button_Switch_SMD/SW_Push_1P1T_NO_CK_KSC9xxG","Button_Switch_SMD/SW_Push_1P1T_NO_CK_KSC9xxJ","Button_Switch_SMD/SW_Push_1P1T_NO_CK_PTS125Sx43PSMTR","Button_Switch_SMD/SW_Push_1P1T_NO_CK_PTS125Sx43SMTR","Button_Switch_SMD/SW_Push_1P1T_NO_CK_PTS125Sx73PSMTR","Button_Switch_SMD/SW_Push_1P1T_NO_CK_PTS125Sx73SMTR","Button_Switch_SMD/SW_Push_1P1T_NO_CK_PTS125Sx85PSMTR","Button_Switch_SMD/SW_Push_1P1T_NO_CK_PTS125Sx85SMTR","Button_Switch_SMD/SW_Push_1P1T_NO_E-Switch_TL3301NxxxxxG","Button_Switch_SMD/SW_Push_1P1T_NO_Vertical_Wuerth_434133025816","Button_Switch_SMD/SW_Push_1P1T_XKB_TS-1187A","Button_Switch_SMD/SW_Push_1TS009xxxx-xxxx-xxxx_6x6x5mm","Button_Switch_SMD/SW_Push_SPST_NO_Alps_SKRK","Button_Switch_SMD/SW_SP3T_PCM13","Button_Switch_SMD/SW_SPDT_CK_JS102011SAQN","Button_Switch_SMD/SW_SPDT_PCM12","Button_Switch_SMD/SW_SPDT_REED_MSDM-DT","Button_Switch_SMD/SW_SPDT_Shouhan_MSK12C02","Button_Switch_SMD/SW_SPST_B3S-1000","Button_Switch_SMD/SW_SPST_B3S-1100","Button_Switch_SMD/SW_SPST_B3SL-1002P","Button_Switch_SMD/SW_SPST_B3SL-1022P","Button_Switch_SMD/SW_SPST_B3U-1000P-B","Button_Switch_SMD/SW_SPST_B3U-1000P","Button_Switch_SMD/SW_SPST_B3U-1100P-B","Button_Switch_SMD/SW_SPST_B3U-1100P","Button_Switch_SMD/SW_SPST_B3U-3000P-B","Button_Switch_SMD/SW_SPST_B3U-3000P","Button_Switch_SMD/SW_SPST_B3U-3100P-B","Button_Switch_SMD/SW_SPST_B3U-3100P","Button_Switch_SMD/SW_SPST_CK_KMS2xxG","Button_Switch_SMD/SW_SPST_CK_KMS2xxGP","Button_Switch_SMD/SW_SPST_CK_KXT3","Button_Switch_SMD/SW_SPST_CK_RS282G05A3","Button_Switch_SMD/SW_SPST_EVPBF","Button_Switch_SMD/SW_SPST_EVQP0","Button_Switch_SMD/SW_SPST_EVQP2_MiddlePushTravel_H2.5mm","Button_Switch_SMD/SW_SPST_EVQP2_ShortPushTravel_H2.1mm","Button_Switch_SMD/SW_SPST_EVQP2_ShortPushTravel_H2.5mm","Button_Switch_SMD/SW_SPST_EVQP7A","Button_Switch_SMD/SW_SPST_EVQP7C","Button_Switch_SMD/SW_SPST_EVQPE1","Button_Switch_SMD/SW_SPST_EVQQ2","Button_Switch_SMD/SW_SPST_FSMSM","Button_Switch_SMD/SW_SPST_GT-TC155X","Button_Switch_SMD/SW_SPST_Omron_B3FS-100xP","Button_Switch_SMD/SW_SPST_Omron_B3FS-101xP","Button_Switch_SMD/SW_SPST_Omron_B3FS-105xP","Button_Switch_SMD/SW_SPST_PTS645Sx43SMTR92","Button_Switch_SMD/SW_SPST_PTS647_Sx38","Button_Switch_SMD/SW_SPST_PTS647_Sx50","Button_Switch_SMD/SW_SPST_PTS647_Sx70","Button_Switch_SMD/SW_SPST_PTS810","Button_Switch_SMD/SW_SPST_Panasonic_EVQPL_3PL_5PL_PT_A08","Button_Switch_SMD/SW_SPST_Panasonic_EVQPL_3PL_5PL_PT_A15","Button_Switch_SMD/SW_SPST_REED_CT05-XXXX-G1","Button_Switch_SMD/SW_SPST_REED_CT05-XXXX-J1","Button_Switch_SMD/SW_SPST_REED_CT10-XXXX-G1","Button_Switch_SMD/SW_SPST_REED_CT10-XXXX-G2","Button_Switch_SMD/SW_SPST_REED_CT10-XXXX-G4","Button_Switch_SMD/SW_SPST_SKQG_WithStem","Button_Switch_SMD/SW_SPST_SKQG_WithoutStem","Button_Switch_SMD/SW_SPST_TL3305A","Button_Switch_SMD/SW_SPST_TL3305B","Button_Switch_SMD/SW_SPST_TL3305C","Button_Switch_SMD/SW_SPST_TL3342","Button_Switch_SMD/SW_SPST_TS-1088-xR020","Button_Switch_SMD/SW_SPST_TS-1088-xR025","Button_Switch_SMD/SW_Tactile_SPST_NO_Straight_CK_PTS636Sx25SMTRLFS","Button_Switch_THT/KSA_Tactile_SPST","Button_Switch_THT/Nidec_Copal_SH-7010C","Button_Switch_THT/Push_E-Switch_KS01Q01","Button_Switch_THT/SW_CK_JS202011AQN_DPDT_Angled","Button_Switch_THT/SW_CK_JS202011CQN_DPDT_Straight","Button_Switch_THT/SW_CW_GPTS203211B","Button_Switch_THT/SW_DIP_SPSTx01_Piano_10.8x4.1mm_W7.62mm_P2.54mm","Button_Switch_THT/SW_DIP_SPSTx01_Slide_6.7x4.1mm_W7.62mm_P2.54mm_LowProfile","Button_Switch_THT/SW_DIP_SPSTx01_Slide_9.78x4.72mm_W7.62mm_P2.54mm","Button_Switch_THT/SW_DIP_SPSTx02_Piano_10.8x6.64mm_W7.62mm_P2.54mm","Button_Switch_THT/SW_DIP_SPSTx02_Piano_CTS_Series194-2MSTN_W7.62mm_P2.54mm","Button_Switch_THT/SW_DIP_SPSTx02_Slide_6.7x6.64mm_W7.62mm_P2.54mm_LowProfile","Button_Switch_THT/SW_DIP_SPSTx02_Slide_9.78x7.26mm_W7.62mm_P2.54mm","Button_Switch_THT/SW_DIP_SPSTx03_Piano_10.8x9.18mm_W7.62mm_P2.54mm","Button_Switch_THT/SW_DIP_SPSTx03_Piano_CTS_Series194-3MSTN_W7.62mm_P2.54mm","Button_Switch_THT/SW_DIP_SPSTx03_Slide_6.7x9.18mm_W7.62mm_P2.54mm_LowProfile","Button_Switch_THT/SW_DIP_SPSTx03_Slide_9.78x9.8mm_W7.62mm_P2.54mm","Button_Switch_THT/SW_DIP_SPSTx04_Piano_10.8x11.72mm_W7.62mm_P2.54mm","Button_Switch_THT/SW_DIP_SPSTx04_Piano_CTS_Series194-4MSTN_W7.62mm_P2.54mm","Button_Switch_THT/SW_DIP_SPSTx04_Slide_6.7x11.72mm_W7.62mm_P2.54mm_LowProfile","Button_Switch_THT/SW_DIP_SPSTx04_Slide_9.78x12.34mm_W7.62mm_P2.54mm","Button_Switch_THT/SW_DIP_SPSTx05_Piano_10.8x14.26mm_W7.62mm_P2.54mm","Button_Switch_THT/SW_DIP_SPSTx05_Piano_CTS_Series194-5MSTN_W7.62mm_P2.54mm","Button_Switch_THT/SW_DIP_SPSTx05_Slide_6.7x14.26mm_W7.62mm_P2.54mm_LowProfile","Button_Switch_THT/SW_DIP_SPSTx05_Slide_9.78x14.88mm_W7.62mm_P2.54mm","Button_Switch_THT/SW_DIP_SPSTx06_Piano_10.8x16.8mm_W7.62mm_P2.54mm","Button_Switch_THT/SW_DIP_SPSTx06_Piano_CTS_Series194-6MSTN_W7.62mm_P2.54mm","Button_Switch_THT/SW_DIP_SPSTx06_Slide_6.7x16.8mm_W7.62mm_P2.54mm_LowProfile","Button_Switch_THT/SW_DIP_SPSTx06_Slide_9.78x17.42mm_W7.62mm_P2.54mm","Button_Switch_THT/SW_DIP_SPSTx07_Piano_10.8x19.34mm_W7.62mm_P2.54mm","Button_Switch_THT/SW_DIP_SPSTx07_Piano_CTS_Series194-7MSTN_W7.62mm_P2.54mm","Button_Switch_THT/SW_DIP_SPSTx07_Slide_6.7x19.34mm_W7.62mm_P2.54mm_LowProfile","Button_Switch_THT/SW_DIP_SPSTx07_Slide_9.78x19.96mm_W7.62mm_P2.54mm","Button_Switch_THT/SW_DIP_SPSTx08_Piano_10.8x21.88mm_W7.62mm_P2.54mm","Button_Switch_THT/SW_DIP_SPSTx08_Piano_CTS_Series194-8MSTN_W7.62mm_P2.54mm","Button_Switch_THT/SW_DIP_SPSTx08_Slide_6.7x21.88mm_W7.62mm_P2.54mm_LowProfile","Button_Switch_THT/SW_DIP_SPSTx08_Slide_9.78x22.5mm_W7.62mm_P2.54mm","Button_Switch_THT/SW_DIP_SPSTx09_Piano_10.8x24.42mm_W7.62mm_P2.54mm","Button_Switch_THT/SW_DIP_SPSTx09_Piano_CTS_Series194-9MSTN_W7.62mm_P2.54mm","Button_Switch_THT/SW_DIP_SPSTx09_Slide_6.7x24.42mm_W7.62mm_P2.54mm_LowProfile","Button_Switch_THT/SW_DIP_SPSTx09_Slide_9.78x25.04mm_W7.62mm_P2.54mm","Button_Switch_THT/SW_DIP_SPSTx10_Piano_10.8x26.96mm_W7.62mm_P2.54mm","Button_Switch_THT/SW_DIP_SPSTx10_Piano_CTS_Series194-10MSTN_W7.62mm_P2.54mm","Button_Switch_THT/SW_DIP_SPSTx10_Slide_6.7x26.96mm_W7.62mm_P2.54mm_LowProfile","Button_Switch_THT/SW_DIP_SPSTx10_Slide_9.78x27.58mm_W7.62mm_P2.54mm","Button_Switch_THT/SW_DIP_SPSTx11_Piano_10.8x29.5mm_W7.62mm_P2.54mm","Button_Switch_THT/SW_DIP_SPSTx11_Piano_CTS_Series194-11MSTN_W7.62mm_P2.54mm","Button_Switch_THT/SW_DIP_SPSTx11_Slide_6.7x29.5mm_W7.62mm_P2.54mm_LowProfile","Button_Switch_THT/SW_DIP_SPSTx11_Slide_9.78x30.12mm_W7.62mm_P2.54mm","Button_Switch_THT/SW_DIP_SPSTx12_Piano_10.8x32.04mm_W7.62mm_P2.54mm","Button_Switch_THT/SW_DIP_SPSTx12_Piano_CTS_Series194-12MSTN_W7.62mm_P2.54mm","Button_Switch_THT/SW_DIP_SPSTx12_Slide_6.7x32.04mm_W7.62mm_P2.54mm_LowProfile","Button_Switch_THT/SW_DIP_SPSTx12_Slide_9.78x32.66mm_W7.62mm_P2.54mm","Button_Switch_THT/SW_E-Switch_EG1224_SPDT_Angled","Button_Switch_THT/SW_E-Switch_EG1271_SPDT","Button_Switch_THT/SW_E-Switch_EG2219_DPDT_Angled","Button_Switch_THT/SW_Lever_1P2T_NKK_GW12LxH","Button_Switch_THT/SW_MEC_5GTH9","Button_Switch_THT/SW_NKK_BB15AH","Button_Switch_THT/SW_NKK_G1xJP","Button_Switch_THT/SW_NKK_GW12LJP","Button_Switch_THT/SW_NKK_NR01","Button_Switch_THT/SW_PUSH-12mm","Button_Switch_THT/SW_PUSH-12mm_Wuerth-430476085716","Button_Switch_THT/SW_PUSH_1P1T_6x3.5mm_H4.3_APEM_MJTP1243","Button_Switch_THT/SW_PUSH_1P1T_6x3.5mm_H5.0_APEM_MJTP1250","Button_Switch_THT/SW_PUSH_6mm","Button_Switch_THT/SW_PUSH_6mm_H13mm","Button_Switch_THT/SW_PUSH_6mm_H4.3mm","Button_Switch_THT/SW_PUSH_6mm_H5mm","Button_Switch_THT/SW_PUSH_6mm_H7.3mm","Button_Switch_THT/SW_PUSH_6mm_H8.5mm","Button_Switch_THT/SW_PUSH_6mm_H8mm","Button_Switch_THT/SW_PUSH_6mm_H9.5mm","Button_Switch_THT/SW_PUSH_E-Switch_FS5700DP_DPDT","Button_Switch_THT/SW_PUSH_LCD_E3_SAxxxx","Button_Switch_THT/SW_PUSH_LCD_E3_SAxxxx_SocketPins","Button_Switch_THT/SW_Push_1P1T_NO_LED_E-Switch_TL1250","Button_Switch_THT/SW_Push_1P2T_Vertical_E-Switch_800UDP8P1A1M6","Button_Switch_THT/SW_Push_2P1T_Toggle_CK_PVA1xxH1xxxxxxV2","Button_Switch_THT/SW_Push_2P1T_Toggle_CK_PVA1xxH2xxxxxxV2","Button_Switch_THT/SW_Push_2P1T_Toggle_CK_PVA1xxH3xxxxxxV2","Button_Switch_THT/SW_Push_2P1T_Toggle_CK_PVA1xxH4xxxxxxV2","Button_Switch_THT/SW_Push_2P2T_Toggle_CK_PVA2OAH5xxxxxxV2","Button_Switch_THT/SW_Push_2P2T_Toggle_CK_PVA2xxH1xxxxxxV2","Button_Switch_THT/SW_Push_2P2T_Toggle_CK_PVA2xxH2xxxxxxV2","Button_Switch_THT/SW_Push_2P2T_Toggle_CK_PVA2xxH3xxxxxxV2","Button_Switch_THT/SW_Push_2P2T_Toggle_CK_PVA2xxH4xxxxxxV2","Button_Switch_THT/SW_Push_2P2T_Vertical_E-Switch_800UDP8P1A1M6","Button_Switch_THT/SW_SPST_Omron_B3F-315x_Angled","Button_Switch_THT/SW_SPST_Omron_B3F-40xx","Button_Switch_THT/SW_SPST_Omron_B3F-50xx","Button_Switch_THT/SW_Slide-03_Wuerth-WS-SLTV_10x2.5x6.4_P2.54mm","Button_Switch_THT/SW_Slide_SP3T_Straight_CK_OS103012MU1QP1","Button_Switch_THT/SW_Slide_SPDT_Angled_CK_OS102011MA1Q","Button_Switch_THT/SW_Slide_SPDT_Straight_CK_OS102011MS2Q","Button_Switch_THT/SW_TH_Tactile_Omron_B3F-100x","Button_Switch_THT/SW_TH_Tactile_Omron_B3F-102x","Button_Switch_THT/SW_TH_Tactile_Omron_B3F-106x","Button_Switch_THT/SW_TH_Tactile_Omron_B3F-107x","Button_Switch_THT/SW_TH_Tactile_Omron_B3F-110x","Button_Switch_THT/SW_TH_Tactile_Omron_B3F-1110","Button_Switch_THT/SW_TH_Tactile_Omron_B3F-112x","Button_Switch_THT/SW_Tactile_SKHH_Angled","Button_Switch_THT/SW_Tactile_SPST_Angled_PTS645Vx31-2LFS","Button_Switch_THT/SW_Tactile_SPST_Angled_PTS645Vx39-2LFS","Button_Switch_THT/SW_Tactile_SPST_Angled_PTS645Vx58-2LFS","Button_Switch_THT/SW_Tactile_SPST_Angled_PTS645Vx83-2LFS","Button_Switch_THT/SW_Tactile_Straight_KSA0Axx1LFTR","Button_Switch_THT/SW_Tactile_Straight_KSL0Axx1LFTR","Button_Switch_THT/SW_XKB_DM1-16UC-1","Button_Switch_THT/SW_XKB_DM1-16UD-1","Button_Switch_THT/SW_XKB_DM1-16UP-1","Buzzer_Beeper/Buzzer_12x9.5RM7.6","Buzzer_Beeper/Buzzer_15x7.5RM7.6","Buzzer_Beeper/Buzzer_CUI_CPT-9019S-SMT","Buzzer_Beeper/Buzzer_D14mm_H7mm_P10mm","Buzzer_Beeper/Buzzer_Mallory_AST1109MLTRQ","Buzzer_Beeper/Buzzer_Mallory_AST1240MLQ","Buzzer_Beeper/Buzzer_Murata_PKLCS1212E","Buzzer_Beeper/Buzzer_Murata_PKMCS0909E","Buzzer_Beeper/Buzzer_TDK_PS1240P02BT_D12.2mm_H6.5mm","Buzzer_Beeper/Indicator_PUI_AI-1440-TWT-24V-2-R","Buzzer_Beeper/MagneticBuzzer_CUI_CMT-8504-100-SMT","Buzzer_Beeper/MagneticBuzzer_CUI_CST-931RP-A","Buzzer_Beeper/MagneticBuzzer_Kingstate_KCG0601","Buzzer_Beeper/MagneticBuzzer_Kobitone_254-EMB73-RO","Buzzer_Beeper/MagneticBuzzer_Kobitone_254-EMB84Q-RO","Buzzer_Beeper/MagneticBuzzer_PUI_AT-0927-TT-6-R","Buzzer_Beeper/MagneticBuzzer_PUI_SMT-1028-T-2-R","Buzzer_Beeper/MagneticBuzzer_ProSignal_ABI-009-RC","Buzzer_Beeper/MagneticBuzzer_ProSignal_ABI-010-RC","Buzzer_Beeper/MagneticBuzzer_ProSignal_ABT-410-RC","Buzzer_Beeper/MagneticBuzzer_ProjectsUnlimited_AI-4228-TWT-R","Buzzer_Beeper/MagneticBuzzer_StarMicronics_HGP","Buzzer_Beeper/MagneticBuzzer_StarMicronics_HMB-06_HMB-12","Buzzer_Beeper/MagneticBuzzer_StarMicronics_HMB","Buzzer_Beeper/MagneticBuzzer_StarMicronics_QMB-105","Buzzer_Beeper/MagneticBuzzer_StarMicronics_QMB-108","Buzzer_Beeper/MagneticBuzzer_StarMicronics_QMB-111","Buzzer_Beeper/MagneticBuzzer_StarMicronics_QMB","Buzzer_Beeper/MagneticBuzzer_StarMicronics_QMX","Buzzer_Beeper/MagneticBuzzer_StarMicronics_RMX","Buzzer_Beeper/MagneticBuzzer_StarMicronics_TMB","Buzzer_Beeper/MagneticBuzzer_StarMicronics_TMX-F","Buzzer_Beeper/MagneticBuzzer_StarMicronics_TMX-H","Buzzer_Beeper/PUIAudio_SMT_0825_S_4_R","Buzzer_Beeper/Speaker_CUI_CMR-1206S-67","Calibration_Scale/Gauge_100mm_Grid_Type1_CopperTop","Calibration_Scale/Gauge_100mm_Type1_CopperTop","Calibration_Scale/Gauge_100mm_Type1_SilkScreenTop","Calibration_Scale/Gauge_100mm_Type2_CopperTop","Calibration_Scale/Gauge_100mm_Type2_SilkScreenTop","Calibration_Scale/Gauge_10mm_Type1_CopperTop","Calibration_Scale/Gauge_10mm_Type1_SilkScreenTop","Calibration_Scale/Gauge_10mm_Type2_CopperTop","Calibration_Scale/Gauge_10mm_Type2_SilkScreenTop","Calibration_Scale/Gauge_10mm_Type3_CopperTop","Calibration_Scale/Gauge_10mm_Type3_SilkScreenTop","Calibration_Scale/Gauge_10mm_Type4_CopperTop","Calibration_Scale/Gauge_10mm_Type4_SilkScreenTop","Calibration_Scale/Gauge_10mm_Type5_CopperTop","Calibration_Scale/Gauge_10mm_Type5_SilkScreenTop","Calibration_Scale/Gauge_50mm_Type1_CopperTop","Calibration_Scale/Gauge_50mm_Type1_SilkScreenTop","Calibration_Scale/Gauge_50mm_Type2_CopperTop","Calibration_Scale/Gauge_50mm_Type2_SilkScreenTop","Capacitor_SMD/CP_Elec_10x10.5","Capacitor_SMD/CP_Elec_10x10","Capacitor_SMD/CP_Elec_10x12.5","Capacitor_SMD/CP_Elec_10x12.6","Capacitor_SMD/CP_Elec_10x14.3","Capacitor_SMD/CP_Elec_10x7.7","Capacitor_SMD/CP_Elec_10x7.9","Capacitor_SMD/CP_Elec_16x17.5","Capacitor_SMD/CP_Elec_16x22","Capacitor_SMD/CP_Elec_18x17.5","Capacitor_SMD/CP_Elec_18x22","Capacitor_SMD/CP_Elec_3x5.3","Capacitor_SMD/CP_Elec_3x5.4","Capacitor_SMD/CP_Elec_4x3.9","Capacitor_SMD/CP_Elec_4x3","Capacitor_SMD/CP_Elec_4x4.5","Capacitor_SMD/CP_Elec_4x5.3","Capacitor_SMD/CP_Elec_4x5.4","Capacitor_SMD/CP_Elec_4x5.7","Capacitor_SMD/CP_Elec_4x5.8","Capacitor_SMD/CP_Elec_5x3.9","Capacitor_SMD/CP_Elec_5x3","Capacitor_SMD/CP_Elec_5x4.4","Capacitor_SMD/CP_Elec_5x4.5","Capacitor_SMD/CP_Elec_5x5.3","Capacitor_SMD/CP_Elec_5x5.4","Capacitor_SMD/CP_Elec_5x5.7","Capacitor_SMD/CP_Elec_5x5.8","Capacitor_SMD/CP_Elec_5x5.9","Capacitor_SMD/CP_Elec_6.3x3.9","Capacitor_SMD/CP_Elec_6.3x3","Capacitor_SMD/CP_Elec_6.3x4.5","Capacitor_SMD/CP_Elec_6.3x4.9","Capacitor_SMD/CP_Elec_6.3x5.2","Capacitor_SMD/CP_Elec_6.3x5.3","Capacitor_SMD/CP_Elec_6.3x5.4","Capacitor_SMD/CP_Elec_6.3x5.4_Nichicon","Capacitor_SMD/CP_Elec_6.3x5.7","Capacitor_SMD/CP_Elec_6.3x5.8","Capacitor_SMD/CP_Elec_6.3x5.9","Capacitor_SMD/CP_Elec_6.3x7.7","Capacitor_SMD/CP_Elec_6.3x9.9","Capacitor_SMD/CP_Elec_8x10.5","Capacitor_SMD/CP_Elec_8x10","Capacitor_SMD/CP_Elec_8x11.9","Capacitor_SMD/CP_Elec_8x5.4","Capacitor_SMD/CP_Elec_8x6.2","Capacitor_SMD/CP_Elec_8x6.5","Capacitor_SMD/CP_Elec_8x6.7","Capacitor_SMD/CP_Elec_8x6.9","Capacitor_SMD/CP_Elec_CAP-XX_DMF3Zxxxxxxxx3D","Capacitor_SMD/C_01005_0402Metric","Capacitor_SMD/C_01005_0402Metric_Pad0.57x0.30mm_HandSolder","Capacitor_SMD/C_0201_0603Metric","Capacitor_SMD/C_0201_0603Metric_Pad0.64x0.40mm_HandSolder","Capacitor_SMD/C_0402_1005Metric","Capacitor_SMD/C_0402_1005Metric_Pad0.74x0.62mm_HandSolder","Capacitor_SMD/C_0504_1310Metric","Capacitor_SMD/C_0504_1310Metric_Pad0.83x1.28mm_HandSolder","Capacitor_SMD/C_0603_1608Metric","Capacitor_SMD/C_0603_1608Metric_Pad1.08x0.95mm_HandSolder","Capacitor_SMD/C_0805_2012Metric","Capacitor_SMD/C_0805_2012Metric_Pad1.18x1.45mm_HandSolder","Capacitor_SMD/C_1206_3216Metric","Capacitor_SMD/C_1206_3216Metric_Pad1.33x1.80mm_HandSolder","Capacitor_SMD/C_1210_3225Metric","Capacitor_SMD/C_1210_3225Metric_Pad1.33x2.70mm_HandSolder","Capacitor_SMD/C_1808_4520Metric","Capacitor_SMD/C_1808_4520Metric_Pad1.72x2.30mm_HandSolder","Capacitor_SMD/C_1812_4532Metric","Capacitor_SMD/C_1812_4532Metric_Pad1.57x3.40mm_HandSolder","Capacitor_SMD/C_1825_4564Metric","Capacitor_SMD/C_1825_4564Metric_Pad1.57x6.80mm_HandSolder","Capacitor_SMD/C_2220_5750Metric","Capacitor_SMD/C_2220_5750Metric_Pad1.97x5.40mm_HandSolder","Capacitor_SMD/C_2225_5664Metric","Capacitor_SMD/C_2225_5664Metric_Pad1.80x6.60mm_HandSolder","Capacitor_SMD/C_3640_9110Metric","Capacitor_SMD/C_3640_9110Metric_Pad2.10x10.45mm_HandSolder","Capacitor_SMD/C_Elec_10x10.2","Capacitor_SMD/C_Elec_3x5.4","Capacitor_SMD/C_Elec_4x5.4","Capacitor_SMD/C_Elec_4x5.8","Capacitor_SMD/C_Elec_5x5.4","Capacitor_SMD/C_Elec_5x5.8","Capacitor_SMD/C_Elec_6.3x5.4","Capacitor_SMD/C_Elec_6.3x5.8","Capacitor_SMD/C_Elec_6.3x7.7","Capacitor_SMD/C_Elec_8x10.2","Capacitor_SMD/C_Elec_8x5.4","Capacitor_SMD/C_Elec_8x6.2","Capacitor_SMD/C_Trimmer_Murata_TZB4-A","Capacitor_SMD/C_Trimmer_Murata_TZB4-B","Capacitor_SMD/C_Trimmer_Murata_TZC3","Capacitor_SMD/C_Trimmer_Murata_TZR1","Capacitor_SMD/C_Trimmer_Murata_TZW4","Capacitor_SMD/C_Trimmer_Murata_TZY2","Capacitor_SMD/C_Trimmer_Sprague-Goodman_SGC3","Capacitor_SMD/C_Trimmer_Voltronics_JN","Capacitor_SMD/C_Trimmer_Voltronics_JQ","Capacitor_SMD/C_Trimmer_Voltronics_JR","Capacitor_SMD/C_Trimmer_Voltronics_JV","Capacitor_SMD/C_Trimmer_Voltronics_JZ","Capacitor_THT/CP_Axial_L10.0mm_D4.5mm_P15.00mm_Horizontal","Capacitor_THT/CP_Axial_L10.0mm_D6.0mm_P15.00mm_Horizontal","Capacitor_THT/CP_Axial_L11.0mm_D5.0mm_P18.00mm_Horizontal","Capacitor_THT/CP_Axial_L11.0mm_D6.0mm_P18.00mm_Horizontal","Capacitor_THT/CP_Axial_L11.0mm_D8.0mm_P15.00mm_Horizontal","Capacitor_THT/CP_Axial_L18.0mm_D10.0mm_P25.00mm_Horizontal","Capacitor_THT/CP_Axial_L18.0mm_D6.5mm_P25.00mm_Horizontal","Capacitor_THT/CP_Axial_L18.0mm_D8.0mm_P25.00mm_Horizontal","Capacitor_THT/CP_Axial_L20.0mm_D10.0mm_P26.00mm_Horizontal","Capacitor_THT/CP_Axial_L20.0mm_D13.0mm_P26.00mm_Horizontal","Capacitor_THT/CP_Axial_L21.0mm_D8.0mm_P28.00mm_Horizontal","Capacitor_THT/CP_Axial_L25.0mm_D10.0mm_P30.00mm_Horizontal","Capacitor_THT/CP_Axial_L26.5mm_D20.0mm_P33.00mm_Horizontal","Capacitor_THT/CP_Axial_L29.0mm_D10.0mm_P35.00mm_Horizontal","Capacitor_THT/CP_Axial_L29.0mm_D13.0mm_P35.00mm_Horizontal","Capacitor_THT/CP_Axial_L29.0mm_D16.0mm_P35.00mm_Horizontal","Capacitor_THT/CP_Axial_L29.0mm_D20.0mm_P35.00mm_Horizontal","Capacitor_THT/CP_Axial_L30.0mm_D10.0mm_P35.00mm_Horizontal","Capacitor_THT/CP_Axial_L30.0mm_D12.5mm_P35.00mm_Horizontal","Capacitor_THT/CP_Axial_L30.0mm_D15.0mm_P35.00mm_Horizontal","Capacitor_THT/CP_Axial_L30.0mm_D18.0mm_P35.00mm_Horizontal","Capacitor_THT/CP_Axial_L34.5mm_D20.0mm_P41.00mm_Horizontal","Capacitor_THT/CP_Axial_L37.0mm_D13.0mm_P43.00mm_Horizontal","Capacitor_THT/CP_Axial_L37.0mm_D16.0mm_P43.00mm_Horizontal","Capacitor_THT/CP_Axial_L37.0mm_D20.0mm_P43.00mm_Horizontal","Capacitor_THT/CP_Axial_L38.0mm_D18.0mm_P44.00mm_Horizontal","Capacitor_THT/CP_Axial_L38.0mm_D21.0mm_P44.00mm_Horizontal","Capacitor_THT/CP_Axial_L40.0mm_D16.0mm_P48.00mm_Horizontal","Capacitor_THT/CP_Axial_L42.0mm_D23.0mm_P45.00mm_Horizontal","Capacitor_THT/CP_Axial_L42.0mm_D26.0mm_P45.00mm_Horizontal","Capacitor_THT/CP_Axial_L42.0mm_D29.0mm_P45.00mm_Horizontal","Capacitor_THT/CP_Axial_L42.0mm_D32.0mm_P45.00mm_Horizontal","Capacitor_THT/CP_Axial_L42.0mm_D35.0mm_P45.00mm_Horizontal","Capacitor_THT/CP_Axial_L42.5mm_D20.0mm_P49.00mm_Horizontal","Capacitor_THT/CP_Axial_L46.0mm_D20.0mm_P52.00mm_Horizontal","Capacitor_THT/CP_Axial_L55.0mm_D23.0mm_P60.00mm_Horizontal","Capacitor_THT/CP_Axial_L55.0mm_D26.0mm_P60.00mm_Horizontal","Capacitor_THT/CP_Axial_L55.0mm_D29.0mm_P60.00mm_Horizontal","Capacitor_THT/CP_Axial_L55.0mm_D32.0mm_P60.00mm_Horizontal","Capacitor_THT/CP_Axial_L55.0mm_D35.0mm_P60.00mm_Horizontal","Capacitor_THT/CP_Axial_L67.0mm_D23.0mm_P75.00mm_Horizontal","Capacitor_THT/CP_Axial_L67.0mm_D26.0mm_P75.00mm_Horizontal","Capacitor_THT/CP_Axial_L67.0mm_D29.0mm_P75.00mm_Horizontal","Capacitor_THT/CP_Axial_L67.0mm_D32.0mm_P75.00mm_Horizontal","Capacitor_THT/CP_Axial_L67.0mm_D35.0mm_P75.00mm_Horizontal","Capacitor_THT/CP_Axial_L80.0mm_D23.0mm_P85.00mm_Horizontal","Capacitor_THT/CP_Axial_L80.0mm_D26.0mm_P85.00mm_Horizontal","Capacitor_THT/CP_Axial_L80.0mm_D29.0mm_P85.00mm_Horizontal","Capacitor_THT/CP_Axial_L80.0mm_D32.0mm_P85.00mm_Horizontal","Capacitor_THT/CP_Axial_L80.0mm_D35.0mm_P85.00mm_Horizontal","Capacitor_THT/CP_Axial_L93.0mm_D23.0mm_P100.00mm_Horizontal","Capacitor_THT/CP_Axial_L93.0mm_D26.0mm_P100.00mm_Horizontal","Capacitor_THT/CP_Axial_L93.0mm_D29.0mm_P100.00mm_Horizontal","Capacitor_THT/CP_Axial_L93.0mm_D32.0mm_P100.00mm_Horizontal","Capacitor_THT/CP_Axial_L93.0mm_D35.0mm_P100.00mm_Horizontal","Capacitor_THT/CP_Radial_D10.0mm_P2.50mm","Capacitor_THT/CP_Radial_D10.0mm_P2.50mm_P5.00mm","Capacitor_THT/CP_Radial_D10.0mm_P3.50mm","Capacitor_THT/CP_Radial_D10.0mm_P3.80mm","Capacitor_THT/CP_Radial_D10.0mm_P5.00mm","Capacitor_THT/CP_Radial_D10.0mm_P5.00mm_P7.50mm","Capacitor_THT/CP_Radial_D10.0mm_P7.50mm","Capacitor_THT/CP_Radial_D12.5mm_P2.50mm","Capacitor_THT/CP_Radial_D12.5mm_P5.00mm","Capacitor_THT/CP_Radial_D12.5mm_P7.50mm","Capacitor_THT/CP_Radial_D13.0mm_P2.50mm","Capacitor_THT/CP_Radial_D13.0mm_P5.00mm","Capacitor_THT/CP_Radial_D13.0mm_P7.50mm","Capacitor_THT/CP_Radial_D14.0mm_P5.00mm","Capacitor_THT/CP_Radial_D14.0mm_P7.50mm","Capacitor_THT/CP_Radial_D16.0mm_P7.50mm","Capacitor_THT/CP_Radial_D17.0mm_P7.50mm","Capacitor_THT/CP_Radial_D18.0mm_P7.50mm","Capacitor_THT/CP_Radial_D22.0mm_P10.00mm_3pin_SnapIn","Capacitor_THT/CP_Radial_D22.0mm_P10.00mm_SnapIn","Capacitor_THT/CP_Radial_D24.0mm_P10.00mm_3pin_SnapIn","Capacitor_THT/CP_Radial_D24.0mm_P10.00mm_SnapIn","Capacitor_THT/CP_Radial_D25.0mm_P10.00mm_3pin_SnapIn","Capacitor_THT/CP_Radial_D25.0mm_P10.00mm_SnapIn","Capacitor_THT/CP_Radial_D26.0mm_P10.00mm_3pin_SnapIn","Capacitor_THT/CP_Radial_D26.0mm_P10.00mm_SnapIn","Capacitor_THT/CP_Radial_D30.0mm_P10.00mm_3pin_SnapIn","Capacitor_THT/CP_Radial_D30.0mm_P10.00mm_SnapIn","Capacitor_THT/CP_Radial_D35.0mm_P10.00mm_3pin_SnapIn","Capacitor_THT/CP_Radial_D35.0mm_P10.00mm_SnapIn","Capacitor_THT/CP_Radial_D4.0mm_P1.50mm","Capacitor_THT/CP_Radial_D4.0mm_P2.00mm","Capacitor_THT/CP_Radial_D40.0mm_P10.00mm_3pin_SnapIn","Capacitor_THT/CP_Radial_D40.0mm_P10.00mm_SnapIn","Capacitor_THT/CP_Radial_D5.0mm_P2.00mm","Capacitor_THT/CP_Radial_D5.0mm_P2.50mm","Capacitor_THT/CP_Radial_D6.3mm_P2.50mm","Capacitor_THT/CP_Radial_D7.5mm_P2.50mm","Capacitor_THT/CP_Radial_D8.0mm_P2.50mm","Capacitor_THT/CP_Radial_D8.0mm_P3.50mm","Capacitor_THT/CP_Radial_D8.0mm_P3.80mm","Capacitor_THT/CP_Radial_D8.0mm_P5.00mm","Capacitor_THT/CP_Radial_Tantal_D10.5mm_P2.50mm","Capacitor_THT/CP_Radial_Tantal_D10.5mm_P5.00mm","Capacitor_THT/CP_Radial_Tantal_D4.5mm_P2.50mm","Capacitor_THT/CP_Radial_Tantal_D4.5mm_P5.00mm","Capacitor_THT/CP_Radial_Tantal_D5.0mm_P2.50mm","Capacitor_THT/CP_Radial_Tantal_D5.0mm_P5.00mm","Capacitor_THT/CP_Radial_Tantal_D5.5mm_P2.50mm","Capacitor_THT/CP_Radial_Tantal_D5.5mm_P5.00mm","Capacitor_THT/CP_Radial_Tantal_D6.0mm_P2.50mm","Capacitor_THT/CP_Radial_Tantal_D6.0mm_P5.00mm","Capacitor_THT/CP_Radial_Tantal_D7.0mm_P2.50mm","Capacitor_THT/CP_Radial_Tantal_D7.0mm_P5.00mm","Capacitor_THT/CP_Radial_Tantal_D8.0mm_P2.50mm","Capacitor_THT/CP_Radial_Tantal_D8.0mm_P5.00mm","Capacitor_THT/CP_Radial_Tantal_D9.0mm_P2.50mm","Capacitor_THT/CP_Radial_Tantal_D9.0mm_P5.00mm","Capacitor_THT/C_Axial_L12.0mm_D10.5mm_P15.00mm_Horizontal","Capacitor_THT/C_Axial_L12.0mm_D10.5mm_P20.00mm_Horizontal","Capacitor_THT/C_Axial_L12.0mm_D6.5mm_P15.00mm_Horizontal","Capacitor_THT/C_Axial_L12.0mm_D6.5mm_P20.00mm_Horizontal","Capacitor_THT/C_Axial_L12.0mm_D7.5mm_P15.00mm_Horizontal","Capacitor_THT/C_Axial_L12.0mm_D7.5mm_P20.00mm_Horizontal","Capacitor_THT/C_Axial_L12.0mm_D8.5mm_P15.00mm_Horizontal","Capacitor_THT/C_Axial_L12.0mm_D8.5mm_P20.00mm_Horizontal","Capacitor_THT/C_Axial_L12.0mm_D9.5mm_P15.00mm_Horizontal","Capacitor_THT/C_Axial_L12.0mm_D9.5mm_P20.00mm_Horizontal","Capacitor_THT/C_Axial_L17.0mm_D6.5mm_P20.00mm_Horizontal","Capacitor_THT/C_Axial_L17.0mm_D6.5mm_P25.00mm_Horizontal","Capacitor_THT/C_Axial_L17.0mm_D7.0mm_P20.00mm_Horizontal","Capacitor_THT/C_Axial_L17.0mm_D7.0mm_P25.00mm_Horizontal","Capacitor_THT/C_Axial_L19.0mm_D7.5mm_P25.00mm_Horizontal","Capacitor_THT/C_Axial_L19.0mm_D8.0mm_P25.00mm_Horizontal","Capacitor_THT/C_Axial_L19.0mm_D9.0mm_P25.00mm_Horizontal","Capacitor_THT/C_Axial_L19.0mm_D9.5mm_P25.00mm_Horizontal","Capacitor_THT/C_Axial_L22.0mm_D10.5mm_P27.50mm_Horizontal","Capacitor_THT/C_Axial_L22.0mm_D9.5mm_P27.50mm_Horizontal","Capacitor_THT/C_Axial_L3.8mm_D2.6mm_P10.00mm_Horizontal","Capacitor_THT/C_Axial_L3.8mm_D2.6mm_P12.50mm_Horizontal","Capacitor_THT/C_Axial_L3.8mm_D2.6mm_P15.00mm_Horizontal","Capacitor_THT/C_Axial_L3.8mm_D2.6mm_P7.50mm_Horizontal","Capacitor_THT/C_Axial_L5.1mm_D3.1mm_P10.00mm_Horizontal","Capacitor_THT/C_Axial_L5.1mm_D3.1mm_P12.50mm_Horizontal","Capacitor_THT/C_Axial_L5.1mm_D3.1mm_P15.00mm_Horizontal","Capacitor_THT/C_Axial_L5.1mm_D3.1mm_P7.50mm_Horizontal","Capacitor_THT/C_Disc_D10.0mm_W2.5mm_P5.00mm","Capacitor_THT/C_Disc_D10.5mm_W5.0mm_P10.00mm","Capacitor_THT/C_Disc_D10.5mm_W5.0mm_P5.00mm","Capacitor_THT/C_Disc_D10.5mm_W5.0mm_P7.50mm","Capacitor_THT/C_Disc_D11.0mm_W5.0mm_P10.00mm","Capacitor_THT/C_Disc_D11.0mm_W5.0mm_P5.00mm","Capacitor_THT/C_Disc_D11.0mm_W5.0mm_P7.50mm","Capacitor_THT/C_Disc_D12.0mm_W4.4mm_P7.75mm","Capacitor_THT/C_Disc_D12.5mm_W5.0mm_P10.00mm","Capacitor_THT/C_Disc_D12.5mm_W5.0mm_P7.50mm","Capacitor_THT/C_Disc_D14.5mm_W5.0mm_P10.00mm","Capacitor_THT/C_Disc_D14.5mm_W5.0mm_P7.50mm","Capacitor_THT/C_Disc_D16.0mm_W5.0mm_P10.00mm","Capacitor_THT/C_Disc_D16.0mm_W5.0mm_P7.50mm","Capacitor_THT/C_Disc_D3.0mm_W1.6mm_P2.50mm","Capacitor_THT/C_Disc_D3.0mm_W2.0mm_P2.50mm","Capacitor_THT/C_Disc_D3.4mm_W2.1mm_P2.50mm","Capacitor_THT/C_Disc_D3.8mm_W2.6mm_P2.50mm","Capacitor_THT/C_Disc_D4.3mm_W1.9mm_P5.00mm","Capacitor_THT/C_Disc_D4.7mm_W2.5mm_P5.00mm","Capacitor_THT/C_Disc_D5.0mm_W2.5mm_P2.50mm","Capacitor_THT/C_Disc_D5.0mm_W2.5mm_P5.00mm","Capacitor_THT/C_Disc_D5.1mm_W3.2mm_P5.00mm","Capacitor_THT/C_Disc_D6.0mm_W2.5mm_P5.00mm","Capacitor_THT/C_Disc_D6.0mm_W4.4mm_P5.00mm","Capacitor_THT/C_Disc_D7.0mm_W2.5mm_P5.00mm","Capacitor_THT/C_Disc_D7.5mm_W2.5mm_P5.00mm","Capacitor_THT/C_Disc_D7.5mm_W4.4mm_P5.00mm","Capacitor_THT/C_Disc_D7.5mm_W5.0mm_P10.00mm","Capacitor_THT/C_Disc_D7.5mm_W5.0mm_P5.00mm","Capacitor_THT/C_Disc_D7.5mm_W5.0mm_P7.50mm","Capacitor_THT/C_Disc_D8.0mm_W2.5mm_P5.00mm","Capacitor_THT/C_Disc_D8.0mm_W5.0mm_P10.00mm","Capacitor_THT/C_Disc_D8.0mm_W5.0mm_P5.00mm","Capacitor_THT/C_Disc_D8.0mm_W5.0mm_P7.50mm","Capacitor_THT/C_Disc_D9.0mm_W2.5mm_P5.00mm","Capacitor_THT/C_Disc_D9.0mm_W5.0mm_P10.00mm","Capacitor_THT/C_Disc_D9.0mm_W5.0mm_P5.00mm","Capacitor_THT/C_Disc_D9.0mm_W5.0mm_P7.50mm","Capacitor_THT/C_Radial_D10.0mm_H12.5mm_P5.00mm","Capacitor_THT/C_Radial_D10.0mm_H16.0mm_P5.00mm","Capacitor_THT/C_Radial_D10.0mm_H20.0mm_P5.00mm","Capacitor_THT/C_Radial_D12.5mm_H20.0mm_P5.00mm","Capacitor_THT/C_Radial_D12.5mm_H25.0mm_P5.00mm","Capacitor_THT/C_Radial_D16.0mm_H25.0mm_P7.50mm","Capacitor_THT/C_Radial_D16.0mm_H31.5mm_P7.50mm","Capacitor_THT/C_Radial_D18.0mm_H35.5mm_P7.50mm","Capacitor_THT/C_Radial_D4.0mm_H5.0mm_P1.50mm","Capacitor_THT/C_Radial_D4.0mm_H7.0mm_P1.50mm","Capacitor_THT/C_Radial_D5.0mm_H11.0mm_P2.00mm","Capacitor_THT/C_Radial_D5.0mm_H5.0mm_P2.00mm","Capacitor_THT/C_Radial_D5.0mm_H7.0mm_P2.00mm","Capacitor_THT/C_Radial_D6.3mm_H11.0mm_P2.50mm","Capacitor_THT/C_Radial_D6.3mm_H5.0mm_P2.50mm","Capacitor_THT/C_Radial_D6.3mm_H7.0mm_P2.50mm","Capacitor_THT/C_Radial_D8.0mm_H11.5mm_P3.50mm","Capacitor_THT/C_Radial_D8.0mm_H7.0mm_P3.50mm","Capacitor_THT/C_Rect_L10.0mm_W2.5mm_P7.50mm_MKS4","Capacitor_THT/C_Rect_L10.0mm_W3.0mm_P7.50mm_FKS3_FKP3","Capacitor_THT/C_Rect_L10.0mm_W3.0mm_P7.50mm_MKS4","Capacitor_THT/C_Rect_L10.0mm_W4.0mm_P7.50mm_FKS3_FKP3","Capacitor_THT/C_Rect_L10.0mm_W4.0mm_P7.50mm_MKS4","Capacitor_THT/C_Rect_L10.0mm_W5.0mm_P5.00mm_P7.50mm","Capacitor_THT/C_Rect_L10.3mm_W4.5mm_P7.50mm_MKS4","Capacitor_THT/C_Rect_L10.3mm_W5.0mm_P7.50mm_MKS4","Capacitor_THT/C_Rect_L10.3mm_W5.7mm_P7.50mm_MKS4","Capacitor_THT/C_Rect_L10.3mm_W7.2mm_P7.50mm_MKS4","Capacitor_THT/C_Rect_L11.0mm_W2.8mm_P10.00mm_MKT","Capacitor_THT/C_Rect_L11.0mm_W3.4mm_P10.00mm_MKT","Capacitor_THT/C_Rect_L11.0mm_W3.5mm_P10.00mm_MKT","Capacitor_THT/C_Rect_L11.0mm_W4.2mm_P10.00mm_MKT","Capacitor_THT/C_Rect_L11.0mm_W4.3mm_P10.00mm_MKT","Capacitor_THT/C_Rect_L11.0mm_W5.1mm_P10.00mm_MKT","Capacitor_THT/C_Rect_L11.0mm_W5.3mm_P10.00mm_MKT","Capacitor_THT/C_Rect_L11.0mm_W6.3mm_P10.00mm_MKT","Capacitor_THT/C_Rect_L11.0mm_W6.4mm_P10.00mm_MKT","Capacitor_THT/C_Rect_L11.0mm_W7.3mm_P10.00mm_MKT","Capacitor_THT/C_Rect_L11.0mm_W8.8mm_P10.00mm_MKT","Capacitor_THT/C_Rect_L11.5mm_W2.0mm_P10.00mm_MKT","Capacitor_THT/C_Rect_L11.5mm_W2.6mm_P10.00mm_MKT","Capacitor_THT/C_Rect_L11.5mm_W2.8mm_P10.00mm_MKT","Capacitor_THT/C_Rect_L11.5mm_W3.2mm_P10.00mm_MKT","Capacitor_THT/C_Rect_L11.5mm_W3.5mm_P10.00mm_MKT","Capacitor_THT/C_Rect_L11.5mm_W3.6mm_P10.00mm_MKT","Capacitor_THT/C_Rect_L11.5mm_W4.0mm_P10.00mm_MKT","Capacitor_THT/C_Rect_L11.5mm_W4.3mm_P10.00mm_MKT","Capacitor_THT/C_Rect_L11.5mm_W4.5mm_P10.00mm_MKT","Capacitor_THT/C_Rect_L11.5mm_W5.0mm_P10.00mm_MKT","Capacitor_THT/C_Rect_L11.5mm_W5.1mm_P10.00mm_MKT","Capacitor_THT/C_Rect_L11.5mm_W5.2mm_P10.00mm_MKT","Capacitor_THT/C_Rect_L11.5mm_W5.6mm_P10.00mm_MKT","Capacitor_THT/C_Rect_L11.5mm_W6.4mm_P10.00mm_MKT","Capacitor_THT/C_Rect_L11.5mm_W6.6mm_P10.00mm_MKT","Capacitor_THT/C_Rect_L11.5mm_W6.9mm_P10.00mm_MKT","Capacitor_THT/C_Rect_L11.5mm_W7.3mm_P10.00mm_MKT","Capacitor_THT/C_Rect_L11.5mm_W7.5mm_P10.00mm_MKT","Capacitor_THT/C_Rect_L11.5mm_W7.8mm_P10.00mm_MKT","Capacitor_THT/C_Rect_L11.5mm_W8.0mm_P10.00mm_MKT","Capacitor_THT/C_Rect_L11.5mm_W8.8mm_P10.00mm_MKT","Capacitor_THT/C_Rect_L11.5mm_W9.5mm_P10.00mm_MKT","Capacitor_THT/C_Rect_L11.5mm_W9.8mm_P10.00mm_MKT","Capacitor_THT/C_Rect_L13.0mm_W3.0mm_P10.00mm_FKS3_FKP3_MKS4","Capacitor_THT/C_Rect_L13.0mm_W4.0mm_P10.00mm_FKS3_FKP3_MKS4","Capacitor_THT/C_Rect_L13.0mm_W5.0mm_P10.00mm_FKS3_FKP3_MKS4","Capacitor_THT/C_Rect_L13.0mm_W6.0mm_P10.00mm_FKS3_FKP3_MKS4","Capacitor_THT/C_Rect_L13.0mm_W6.5mm_P7.50mm_P10.00mm","Capacitor_THT/C_Rect_L13.0mm_W8.0mm_P10.00mm_FKS3_FKP3_MKS4","Capacitor_THT/C_Rect_L13.5mm_W4.0mm_P10.00mm_FKS3_FKP3_MKS4","Capacitor_THT/C_Rect_L13.5mm_W5.0mm_P10.00mm_FKS3_FKP3_MKS4","Capacitor_THT/C_Rect_L16.5mm_W10.7mm_P15.00mm_MKT","Capacitor_THT/C_Rect_L16.5mm_W10.9mm_P15.00mm_MKT","Capacitor_THT/C_Rect_L16.5mm_W11.2mm_P15.00mm_MKT","Capacitor_THT/C_Rect_L16.5mm_W11.8mm_P15.00mm_MKT","Capacitor_THT/C_Rect_L16.5mm_W13.5mm_P15.00mm_MKT","Capacitor_THT/C_Rect_L16.5mm_W13.7mm_P15.00mm_MKT","Capacitor_THT/C_Rect_L16.5mm_W13.9mm_P15.00mm_MKT","Capacitor_THT/C_Rect_L16.5mm_W4.7mm_P15.00mm_MKT","Capacitor_THT/C_Rect_L16.5mm_W4.9mm_P15.00mm_MKT","Capacitor_THT/C_Rect_L16.5mm_W5.0mm_P15.00mm_MKT","Capacitor_THT/C_Rect_L16.5mm_W6.0mm_P15.00mm_MKT","Capacitor_THT/C_Rect_L16.5mm_W7.0mm_P15.00mm_MKT","Capacitor_THT/C_Rect_L16.5mm_W7.3mm_P15.00mm_MKT","Capacitor_THT/C_Rect_L16.5mm_W8.7mm_P15.00mm_MKT","Capacitor_THT/C_Rect_L16.5mm_W8.9mm_P15.00mm_MKT","Capacitor_THT/C_Rect_L16.5mm_W9.0mm_P15.00mm_MKT","Capacitor_THT/C_Rect_L16.5mm_W9.2mm_P15.00mm_MKT","Capacitor_THT/C_Rect_L18.0mm_W11.0mm_P15.00mm_FKS3_FKP3","Capacitor_THT/C_Rect_L18.0mm_W5.0mm_P15.00mm_FKS3_FKP3","Capacitor_THT/C_Rect_L18.0mm_W6.0mm_P15.00mm_FKS3_FKP3","Capacitor_THT/C_Rect_L18.0mm_W7.0mm_P15.00mm_FKS3_FKP3","Capacitor_THT/C_Rect_L18.0mm_W8.0mm_P15.00mm_FKS3_FKP3","Capacitor_THT/C_Rect_L18.0mm_W9.0mm_P15.00mm_FKS3_FKP3","Capacitor_THT/C_Rect_L19.0mm_W11.0mm_P15.00mm_MKS4","Capacitor_THT/C_Rect_L19.0mm_W5.0mm_P15.00mm_MKS4","Capacitor_THT/C_Rect_L19.0mm_W6.0mm_P15.00mm_MKS4","Capacitor_THT/C_Rect_L19.0mm_W7.0mm_P15.00mm_MKS4","Capacitor_THT/C_Rect_L19.0mm_W8.0mm_P15.00mm_MKS4","Capacitor_THT/C_Rect_L19.0mm_W9.0mm_P15.00mm_MKS4","Capacitor_THT/C_Rect_L24.0mm_W10.1mm_P22.50mm_MKT","Capacitor_THT/C_Rect_L24.0mm_W10.3mm_P22.50mm_MKT","Capacitor_THT/C_Rect_L24.0mm_W10.9mm_P22.50mm_MKT","Capacitor_THT/C_Rect_L24.0mm_W12.2mm_P22.50mm_MKT","Capacitor_THT/C_Rect_L24.0mm_W12.6mm_P22.50mm_MKT","Capacitor_THT/C_Rect_L24.0mm_W12.8mm_P22.50mm_MKT","Capacitor_THT/C_Rect_L24.0mm_W7.0mm_P22.50mm_MKT","Capacitor_THT/C_Rect_L24.0mm_W8.3mm_P22.50mm_MKT","Capacitor_THT/C_Rect_L24.0mm_W8.6mm_P22.50mm_MKT","Capacitor_THT/C_Rect_L26.5mm_W10.5mm_P22.50mm_MKS4","Capacitor_THT/C_Rect_L26.5mm_W11.5mm_P22.50mm_MKS4","Capacitor_THT/C_Rect_L26.5mm_W5.0mm_P22.50mm_MKS4","Capacitor_THT/C_Rect_L26.5mm_W6.0mm_P22.50mm_MKS4","Capacitor_THT/C_Rect_L26.5mm_W7.0mm_P22.50mm_MKS4","Capacitor_THT/C_Rect_L26.5mm_W8.5mm_P22.50mm_MKS4","Capacitor_THT/C_Rect_L27.0mm_W11.0mm_P22.00mm","Capacitor_THT/C_Rect_L27.0mm_W9.0mm_P22.00mm","Capacitor_THT/C_Rect_L27.0mm_W9.0mm_P23.00mm","Capacitor_THT/C_Rect_L28.0mm_W10.0mm_P22.50mm_MKS4","Capacitor_THT/C_Rect_L28.0mm_W12.0mm_P22.50mm_MKS4","Capacitor_THT/C_Rect_L28.0mm_W8.0mm_P22.50mm_MKS4","Capacitor_THT/C_Rect_L29.0mm_W11.0mm_P27.50mm_MKT","Capacitor_THT/C_Rect_L29.0mm_W11.9mm_P27.50mm_MKT","Capacitor_THT/C_Rect_L29.0mm_W12.2mm_P27.50mm_MKT","Capacitor_THT/C_Rect_L29.0mm_W13.0mm_P27.50mm_MKT","Capacitor_THT/C_Rect_L29.0mm_W13.8mm_P27.50mm_MKT","Capacitor_THT/C_Rect_L29.0mm_W14.2mm_P27.50mm_MKT","Capacitor_THT/C_Rect_L29.0mm_W16.0mm_P27.50mm_MKT","Capacitor_THT/C_Rect_L29.0mm_W7.6mm_P27.50mm_MKT","Capacitor_THT/C_Rect_L29.0mm_W7.8mm_P27.50mm_MKT","Capacitor_THT/C_Rect_L29.0mm_W7.9mm_P27.50mm_MKT","Capacitor_THT/C_Rect_L29.0mm_W9.1mm_P27.50mm_MKT","Capacitor_THT/C_Rect_L29.0mm_W9.6mm_P27.50mm_MKT","Capacitor_THT/C_Rect_L31.5mm_W11.0mm_P27.50mm_MKS4","Capacitor_THT/C_Rect_L31.5mm_W13.0mm_P27.50mm_MKS4","Capacitor_THT/C_Rect_L31.5mm_W15.0mm_P27.50mm_MKS4","Capacitor_THT/C_Rect_L31.5mm_W17.0mm_P27.50mm_MKS4","Capacitor_THT/C_Rect_L31.5mm_W20.0mm_P27.50mm_MKS4","Capacitor_THT/C_Rect_L31.5mm_W9.0mm_P27.50mm_MKS4","Capacitor_THT/C_Rect_L32.0mm_W15.0mm_P27.00mm","Capacitor_THT/C_Rect_L33.0mm_W13.0mm_P27.50mm_MKS4","Capacitor_THT/C_Rect_L33.0mm_W15.0mm_P27.50mm_MKS4","Capacitor_THT/C_Rect_L33.0mm_W20.0mm_P27.50mm_MKS4","Capacitor_THT/C_Rect_L4.0mm_W2.5mm_P2.50mm","Capacitor_THT/C_Rect_L4.6mm_W2.0mm_P2.50mm_MKS02_FKP02","Capacitor_THT/C_Rect_L4.6mm_W3.0mm_P2.50mm_MKS02_FKP02","Capacitor_THT/C_Rect_L4.6mm_W3.8mm_P2.50mm_MKS02_FKP02","Capacitor_THT/C_Rect_L4.6mm_W4.6mm_P2.50mm_MKS02_FKP02","Capacitor_THT/C_Rect_L4.6mm_W5.5mm_P2.50mm_MKS02_FKP02","Capacitor_THT/C_Rect_L41.5mm_W11.0mm_P37.50mm_MKS4","Capacitor_THT/C_Rect_L41.5mm_W13.0mm_P37.50mm_MKS4","Capacitor_THT/C_Rect_L41.5mm_W15.0mm_P37.50mm_MKS4","Capacitor_THT/C_Rect_L41.5mm_W17.0mm_P37.50mm_MKS4","Capacitor_THT/C_Rect_L41.5mm_W19.0mm_P37.50mm_MKS4","Capacitor_THT/C_Rect_L41.5mm_W20.0mm_P37.50mm_MKS4","Capacitor_THT/C_Rect_L41.5mm_W24.0mm_P37.50mm_MKS4","Capacitor_THT/C_Rect_L41.5mm_W31.0mm_P37.50mm_MKS4","Capacitor_THT/C_Rect_L41.5mm_W35.0mm_P37.50mm_MKS4","Capacitor_THT/C_Rect_L41.5mm_W40.0mm_P37.50mm_MKS4","Capacitor_THT/C_Rect_L41.5mm_W9.0mm_P37.50mm_MKS4","Capacitor_THT/C_Rect_L7.0mm_W2.0mm_P5.00mm","Capacitor_THT/C_Rect_L7.0mm_W2.5mm_P5.00mm","Capacitor_THT/C_Rect_L7.0mm_W3.5mm_P2.50mm_P5.00mm","Capacitor_THT/C_Rect_L7.0mm_W3.5mm_P5.00mm","Capacitor_THT/C_Rect_L7.0mm_W4.5mm_P5.00mm","Capacitor_THT/C_Rect_L7.0mm_W6.0mm_P5.00mm","Capacitor_THT/C_Rect_L7.0mm_W6.5mm_P5.00mm","Capacitor_THT/C_Rect_L7.2mm_W11.0mm_P5.00mm_FKS2_FKP2_MKS2_MKP2","Capacitor_THT/C_Rect_L7.2mm_W2.5mm_P5.00mm","Capacitor_THT/C_Rect_L7.2mm_W2.5mm_P5.00mm_FKS2_FKP2_MKS2_MKP2","Capacitor_THT/C_Rect_L7.2mm_W3.0mm_P5.00mm_FKS2_FKP2_MKS2_MKP2","Capacitor_THT/C_Rect_L7.2mm_W3.5mm_P5.00mm","Capacitor_THT/C_Rect_L7.2mm_W3.5mm_P5.00mm_FKS2_FKP2_MKS2_MKP2","Capacitor_THT/C_Rect_L7.2mm_W4.5mm_P5.00mm","Capacitor_THT/C_Rect_L7.2mm_W4.5mm_P5.00mm_FKS2_FKP2_MKS2_MKP2","Capacitor_THT/C_Rect_L7.2mm_W5.0mm_P5.00mm","Capacitor_THT/C_Rect_L7.2mm_W5.5mm_P5.00mm_FKS2_FKP2_MKS2_MKP2","Capacitor_THT/C_Rect_L7.2mm_W6.0mm_P5.00mm","Capacitor_THT/C_Rect_L7.2mm_W7.2mm_P5.00mm","Capacitor_THT/C_Rect_L7.2mm_W7.2mm_P5.00mm_FKS2_FKP2_MKS2_MKP2","Capacitor_THT/C_Rect_L7.2mm_W8.5mm_P5.00mm_FKP2_FKP2_MKS2_MKP2","Capacitor_THT/C_Rect_L7.5mm_W6.5mm_P5.00mm","Capacitor_THT/C_Rect_L9.0mm_W2.5mm_P7.50mm_MKT","Capacitor_THT/C_Rect_L9.0mm_W2.6mm_P7.50mm_MKT","Capacitor_THT/C_Rect_L9.0mm_W2.7mm_P7.50mm_MKT","Capacitor_THT/C_Rect_L9.0mm_W3.2mm_P7.50mm_MKT","Capacitor_THT/C_Rect_L9.0mm_W3.3mm_P7.50mm_MKT","Capacitor_THT/C_Rect_L9.0mm_W3.4mm_P7.50mm_MKT","Capacitor_THT/C_Rect_L9.0mm_W3.6mm_P7.50mm_MKT","Capacitor_THT/C_Rect_L9.0mm_W3.8mm_P7.50mm_MKT","Capacitor_THT/C_Rect_L9.0mm_W3.9mm_P7.50mm_MKT","Capacitor_THT/C_Rect_L9.0mm_W4.0mm_P7.50mm_MKT","Capacitor_THT/C_Rect_L9.0mm_W4.2mm_P7.50mm_MKT","Capacitor_THT/C_Rect_L9.0mm_W4.9mm_P7.50mm_MKT","Capacitor_THT/C_Rect_L9.0mm_W5.1mm_P7.50mm_MKT","Capacitor_THT/C_Rect_L9.0mm_W5.7mm_P7.50mm_MKT","Capacitor_THT/C_Rect_L9.0mm_W6.4mm_P7.50mm_MKT","Capacitor_THT/C_Rect_L9.0mm_W6.7mm_P7.50mm_MKT","Capacitor_THT/C_Rect_L9.0mm_W7.7mm_P7.50mm_MKT","Capacitor_THT/C_Rect_L9.0mm_W8.5mm_P7.50mm_MKT","Capacitor_THT/C_Rect_L9.0mm_W9.5mm_P7.50mm_MKT","Capacitor_THT/C_Rect_L9.0mm_W9.8mm_P7.50mm_MKT","Capacitor_THT/DX_5R5HxxxxU_D11.5mm_P10.00mm","Capacitor_THT/DX_5R5VxxxxU_D11.5mm_P5.00mm","Capacitor_THT/DX_5R5VxxxxU_D19.0mm_P5.00mm","Capacitor_Tantalum_SMD/CP_EIA-1608-08_AVX-J","Capacitor_Tantalum_SMD/CP_EIA-1608-08_AVX-J_HandSolder","Capacitor_Tantalum_SMD/CP_EIA-1608-10_AVX-L","Capacitor_Tantalum_SMD/CP_EIA-1608-10_AVX-L_HandSolder","Capacitor_Tantalum_SMD/CP_EIA-2012-12_Kemet-R","Capacitor_Tantalum_SMD/CP_EIA-2012-12_Kemet-R_HandSolder","Capacitor_Tantalum_SMD/CP_EIA-2012-15_AVX-P","Capacitor_Tantalum_SMD/CP_EIA-2012-15_AVX-P_HandSolder","Capacitor_Tantalum_SMD/CP_EIA-3216-10_Kemet-I","Capacitor_Tantalum_SMD/CP_EIA-3216-10_Kemet-I_HandSolder","Capacitor_Tantalum_SMD/CP_EIA-3216-12_Kemet-S","Capacitor_Tantalum_SMD/CP_EIA-3216-12_Kemet-S_HandSolder","Capacitor_Tantalum_SMD/CP_EIA-3216-18_Kemet-A","Capacitor_Tantalum_SMD/CP_EIA-3216-18_Kemet-A_HandSolder","Capacitor_Tantalum_SMD/CP_EIA-3528-12_Kemet-T","Capacitor_Tantalum_SMD/CP_EIA-3528-12_Kemet-T_HandSolder","Capacitor_Tantalum_SMD/CP_EIA-3528-15_AVX-H","Capacitor_Tantalum_SMD/CP_EIA-3528-15_AVX-H_HandSolder","Capacitor_Tantalum_SMD/CP_EIA-3528-21_Kemet-B","Capacitor_Tantalum_SMD/CP_EIA-3528-21_Kemet-B_HandSolder","Capacitor_Tantalum_SMD/CP_EIA-6032-15_Kemet-U","Capacitor_Tantalum_SMD/CP_EIA-6032-15_Kemet-U_HandSolder","Capacitor_Tantalum_SMD/CP_EIA-6032-20_AVX-F","Capacitor_Tantalum_SMD/CP_EIA-6032-20_AVX-F_HandSolder","Capacitor_Tantalum_SMD/CP_EIA-6032-28_Kemet-C","Capacitor_Tantalum_SMD/CP_EIA-6032-28_Kemet-C_HandSolder","Capacitor_Tantalum_SMD/CP_EIA-7132-20_AVX-U","Capacitor_Tantalum_SMD/CP_EIA-7132-20_AVX-U_HandSolder","Capacitor_Tantalum_SMD/CP_EIA-7132-28_AVX-C","Capacitor_Tantalum_SMD/CP_EIA-7132-28_AVX-C_HandSolder","Capacitor_Tantalum_SMD/CP_EIA-7260-15_AVX-R","Capacitor_Tantalum_SMD/CP_EIA-7260-15_AVX-R_HandSolder","Capacitor_Tantalum_SMD/CP_EIA-7260-20_AVX-M","Capacitor_Tantalum_SMD/CP_EIA-7260-20_AVX-M_HandSolder","Capacitor_Tantalum_SMD/CP_EIA-7260-28_AVX-M","Capacitor_Tantalum_SMD/CP_EIA-7260-28_AVX-M_HandSolder","Capacitor_Tantalum_SMD/CP_EIA-7260-38_AVX-R","Capacitor_Tantalum_SMD/CP_EIA-7260-38_AVX-R_HandSolder","Capacitor_Tantalum_SMD/CP_EIA-7343-15_Kemet-W","Capacitor_Tantalum_SMD/CP_EIA-7343-15_Kemet-W_HandSolder","Capacitor_Tantalum_SMD/CP_EIA-7343-20_Kemet-V","Capacitor_Tantalum_SMD/CP_EIA-7343-20_Kemet-V_HandSolder","Capacitor_Tantalum_SMD/CP_EIA-7343-30_AVX-N","Capacitor_Tantalum_SMD/CP_EIA-7343-30_AVX-N_HandSolder","Capacitor_Tantalum_SMD/CP_EIA-7343-31_Kemet-D","Capacitor_Tantalum_SMD/CP_EIA-7343-31_Kemet-D_HandSolder","Capacitor_Tantalum_SMD/CP_EIA-7343-40_Kemet-Y","Capacitor_Tantalum_SMD/CP_EIA-7343-40_Kemet-Y_HandSolder","Capacitor_Tantalum_SMD/CP_EIA-7343-43_Kemet-X","Capacitor_Tantalum_SMD/CP_EIA-7343-43_Kemet-X_HandSolder","Capacitor_Tantalum_SMD/CP_EIA-7360-38_Kemet-E","Capacitor_Tantalum_SMD/CP_EIA-7360-38_Kemet-E_HandSolder","Capacitor_Tantalum_SMD/CP_EIA-7361-38_AVX-V","Capacitor_Tantalum_SMD/CP_EIA-7361-38_AVX-V_HandSolder","Capacitor_Tantalum_SMD/CP_EIA-7361-438_AVX-U","Capacitor_Tantalum_SMD/CP_EIA-7361-438_AVX-U_HandSolder","Connector/BJB_Pico_46.110.1001_Receptacle_Horizontal","Connector/Banana_Cliff_FCR7350B_S16N-PC_Horizontal","Connector/Banana_Cliff_FCR7350G_S16N-PC_Horizontal","Connector/Banana_Cliff_FCR7350L_S16N-PC_Horizontal","Connector/Banana_Cliff_FCR7350N_S16N-PC_Horizontal","Connector/Banana_Cliff_FCR7350R_S16N-PC_Horizontal","Connector/Banana_Cliff_FCR7350Y_S16N-PC_Horizontal","Connector/Banana_Jack_1Pin","Connector/Banana_Jack_2Pin","Connector/Banana_Jack_3Pin","Connector/CUI_PD-30","Connector/CUI_PD-30S","Connector/CUI_PD-30S_CircularHoles","Connector/CalTest_CT3151","Connector/Conn_C14_Receptacle_RightAngle_Schurter_DD21.01xx","Connector/Connector_SFP_and_Cage","Connector/DTF13-12Px","Connector/FanPinHeader_1x03_P2.54mm_Vertical","Connector/FanPinHeader_1x04_P2.54mm_Vertical","Connector/GB042-34S-H10","Connector/IHI_B6A-PCB-45_Vertical","Connector/JWT_A3963_1x02_P3.96mm_Vertical","Connector/Joint-Tech_C5080WR-04P_1x04_P5.08mm_Vertical","Connector/NS-Tech_Grove_1x04_P2mm_Vertical","Connector/OCN_OK-01GM030-04_2x15_P0.4mm_Vertical","Connector/SpringContact_Harwin_S1941-46R","Connector/Tag-Connect_TC2030-IDC-FP_2x03_P1.27mm_Vertical","Connector/Tag-Connect_TC2030-IDC-NL_2x03_P1.27mm_Vertical","Connector/Tag-Connect_TC2050-IDC-FP_2x05_P1.27mm_Vertical","Connector/Tag-Connect_TC2050-IDC-NL_2x05_P1.27mm_Vertical","Connector/Tag-Connect_TC2050-IDC-NL_2x05_P1.27mm_Vertical_with_bottom_clip","Connector/Tag-Connect_TC2070-IDC-FP_2x07_P1.27mm_Vertical","Connector_AMASS/AMASS_MR30PW-FB_1x03_P3.50mm_Horizontal","Connector_AMASS/AMASS_MR30PW-M_1x03_P3.50mm_Horizontal","Connector_AMASS/AMASS_XT30PW-F_1x02_P2.50mm_Horizontal","Connector_AMASS/AMASS_XT30PW-M_1x02_P2.50mm_Horizontal","Connector_AMASS/AMASS_XT30U-F_1x02_P5.0mm_Vertical","Connector_AMASS/AMASS_XT30U-M_1x02_P5.0mm_Vertical","Connector_AMASS/AMASS_XT30UPB-F_1x02_P5.0mm_Vertical","Connector_AMASS/AMASS_XT30UPB-M_1x02_P5.0mm_Vertical","Connector_AMASS/AMASS_XT60-F_1x02_P7.20mm_Vertical","Connector_AMASS/AMASS_XT60-M_1x02_P7.20mm_Vertical","Connector_AMASS/AMASS_XT60IPW-M_1x03_P7.20mm_Horizontal","Connector_AMASS/AMASS_XT60PW-F_1x02_P7.20mm_Horizontal","Connector_AMASS/AMASS_XT60PW-M_1x02_P7.20mm_Horizontal","Connector_AMASS/AMASS_XT90PW-M_1x02_P10.90mm_Horizontal","Connector_Amphenol/Amphenol_M8S-03PMMR-SF8001","Connector_Audio/Jack_3.5mm_CUI_SJ-3523-SMT_Horizontal","Connector_Audio/Jack_3.5mm_CUI_SJ-3524-SMT_Horizontal","Connector_Audio/Jack_3.5mm_CUI_SJ1-3513N_Horizontal","Connector_Audio/Jack_3.5mm_CUI_SJ1-3514N_Horizontal","Connector_Audio/Jack_3.5mm_CUI_SJ1-3515N_Horizontal","Connector_Audio/Jack_3.5mm_CUI_SJ1-3523N_Horizontal","Connector_Audio/Jack_3.5mm_CUI_SJ1-3524N_Horizontal","Connector_Audio/Jack_3.5mm_CUI_SJ1-3525N_Horizontal","Connector_Audio/Jack_3.5mm_CUI_SJ1-3533NG_Horizontal","Connector_Audio/Jack_3.5mm_CUI_SJ1-3533NG_Horizontal_CircularHoles","Connector_Audio/Jack_3.5mm_CUI_SJ1-3535NG_Horizontal","Connector_Audio/Jack_3.5mm_CUI_SJ1-3535NG_Horizontal_CircularHoles","Connector_Audio/Jack_3.5mm_CUI_SJ2-3593D-SMT_Horizontal","Connector_Audio/Jack_3.5mm_KoreanHropartsElec_PJ-320D-4A_Horizontal","Connector_Audio/Jack_3.5mm_Ledino_KB3SPRS_Horizontal","Connector_Audio/Jack_3.5mm_Lumberg_1503_02_Horizontal","Connector_Audio/Jack_3.5mm_Lumberg_1503_03_Horizontal","Connector_Audio/Jack_3.5mm_Lumberg_1503_07_Horizontal","Connector_Audio/Jack_3.5mm_PJ31060-I_Horizontal","Connector_Audio/Jack_3.5mm_PJ311_Horizontal","Connector_Audio/Jack_3.5mm_PJ320D_Horizontal","Connector_Audio/Jack_3.5mm_PJ320E_Horizontal","Connector_Audio/Jack_3.5mm_QingPu_WQP-PJ398SM_Vertical_CircularHoles","Connector_Audio/Jack_3.5mm_Switronic_ST-005-G_horizontal","Connector_Audio/Jack_3.5mm_Technik_TWP-3002_Horizontal","Connector_Audio/Jack_6.35mm_Neutrik_NJ2FD-V_Vertical","Connector_Audio/Jack_6.35mm_Neutrik_NJ3FD-V_Vertical","Connector_Audio/Jack_6.35mm_Neutrik_NJ5FD-V_Vertical","Connector_Audio/Jack_6.35mm_Neutrik_NJ6FD-V_Vertical","Connector_Audio/Jack_6.35mm_Neutrik_NJ6TB-V_Vertical","Connector_Audio/Jack_6.35mm_Neutrik_NMJ4HCD2_Horizontal","Connector_Audio/Jack_6.35mm_Neutrik_NMJ4HFD2_Horizontal","Connector_Audio/Jack_6.35mm_Neutrik_NMJ4HFD3_Horizontal","Connector_Audio/Jack_6.35mm_Neutrik_NMJ4HHD2_Horizontal","Connector_Audio/Jack_6.35mm_Neutrik_NMJ6HCD2_Horizontal","Connector_Audio/Jack_6.35mm_Neutrik_NMJ6HCD3_Horizontal","Connector_Audio/Jack_6.35mm_Neutrik_NMJ6HFD2-AU_Horizontal","Connector_Audio/Jack_6.35mm_Neutrik_NMJ6HFD2_Horizontal","Connector_Audio/Jack_6.35mm_Neutrik_NMJ6HFD3_Horizontal","Connector_Audio/Jack_6.35mm_Neutrik_NMJ6HFD4_Horizontal","Connector_Audio/Jack_6.35mm_Neutrik_NMJ6HHD2_Horizontal","Connector_Audio/Jack_6.35mm_Neutrik_NRJ3HF-1_Horizontal","Connector_Audio/Jack_6.35mm_Neutrik_NRJ4HF-1_Horizontal","Connector_Audio/Jack_6.35mm_Neutrik_NRJ4HF_Horizontal","Connector_Audio/Jack_6.35mm_Neutrik_NRJ4HH-1_Horizontal","Connector_Audio/Jack_6.35mm_Neutrik_NRJ4HH_Horizontal","Connector_Audio/Jack_6.35mm_Neutrik_NRJ6HF-1-AU_Horizontal","Connector_Audio/Jack_6.35mm_Neutrik_NRJ6HF-1_Horizontal","Connector_Audio/Jack_6.35mm_Neutrik_NRJ6HF-AU_Horizontal","Connector_Audio/Jack_6.35mm_Neutrik_NRJ6HF_Horizontal","Connector_Audio/Jack_6.35mm_Neutrik_NRJ6HH-1_Horizontal","Connector_Audio/Jack_6.35mm_Neutrik_NRJ6HH-AU_Horizontal","Connector_Audio/Jack_6.35mm_Neutrik_NRJ6HH_Horizontal","Connector_Audio/Jack_6.35mm_Neutrik_NRJ6HM-1-AU_Horizontal","Connector_Audio/Jack_6.35mm_Neutrik_NRJ6HM-1-PRE_Horizontal","Connector_Audio/Jack_6.35mm_Neutrik_NRJ6HM-1_Horizontal","Connector_Audio/Jack_6.35mm_Neutrik_NSJ12HC_Horizontal","Connector_Audio/Jack_6.35mm_Neutrik_NSJ12HF-1_Horizontal","Connector_Audio/Jack_6.35mm_Neutrik_NSJ12HH-1_Horizontal","Connector_Audio/Jack_6.35mm_Neutrik_NSJ12HL_Horizontal","Connector_Audio/Jack_6.35mm_Neutrik_NSJ8HC_Horizontal","Connector_Audio/Jack_6.35mm_Neutrik_NSJ8HL_Horizontal","Connector_Audio/Jack_XLR-6.35mm_Neutrik_NCJ10FI-H-0_Horizontal","Connector_Audio/Jack_XLR-6.35mm_Neutrik_NCJ10FI-H_Horizontal","Connector_Audio/Jack_XLR-6.35mm_Neutrik_NCJ10FI-V-0_Vertical","Connector_Audio/Jack_XLR-6.35mm_Neutrik_NCJ10FI-V_Vertical","Connector_Audio/Jack_XLR-6.35mm_Neutrik_NCJ5FI-H-0_Horizontal","Connector_Audio/Jack_XLR-6.35mm_Neutrik_NCJ5FI-H_Horizontal","Connector_Audio/Jack_XLR-6.35mm_Neutrik_NCJ5FI-V-0_Vertical","Connector_Audio/Jack_XLR-6.35mm_Neutrik_NCJ5FI-V_Vertical","Connector_Audio/Jack_XLR-6.35mm_Neutrik_NCJ6FA-H-0_Horizontal","Connector_Audio/Jack_XLR-6.35mm_Neutrik_NCJ6FA-H-DA_Horizontal","Connector_Audio/Jack_XLR-6.35mm_Neutrik_NCJ6FA-H_Horizontal","Connector_Audio/Jack_XLR-6.35mm_Neutrik_NCJ6FA-V-0_Vertical","Connector_Audio/Jack_XLR-6.35mm_Neutrik_NCJ6FA-V-DA_Vertical","Connector_Audio/Jack_XLR-6.35mm_Neutrik_NCJ6FA-V_Vertical","Connector_Audio/Jack_XLR-6.35mm_Neutrik_NCJ6FI-H-0_Horizontal","Connector_Audio/Jack_XLR-6.35mm_Neutrik_NCJ6FI-H_Horizontal","Connector_Audio/Jack_XLR-6.35mm_Neutrik_NCJ6FI-V-0_Vertical","Connector_Audio/Jack_XLR-6.35mm_Neutrik_NCJ6FI-V_Vertical","Connector_Audio/Jack_XLR-6.35mm_Neutrik_NCJ9FI-H-0_Horizontal","Connector_Audio/Jack_XLR-6.35mm_Neutrik_NCJ9FI-H_Horizontal","Connector_Audio/Jack_XLR-6.35mm_Neutrik_NCJ9FI-V-0_Vertical","Connector_Audio/Jack_XLR-6.35mm_Neutrik_NCJ9FI-V_Vertical","Connector_Audio/Jack_XLR_Neutrik_NC3FAAH-0_Horizontal","Connector_Audio/Jack_XLR_Neutrik_NC3FAAH1-0_Horizontal","Connector_Audio/Jack_XLR_Neutrik_NC3FAAH1-DA_Horizontal","Connector_Audio/Jack_XLR_Neutrik_NC3FAAH1_Horizontal","Connector_Audio/Jack_XLR_Neutrik_NC3FAAH2-0_Horizontal","Connector_Audio/Jack_XLR_Neutrik_NC3FAAH2_Horizontal","Connector_Audio/Jack_XLR_Neutrik_NC3FAAH_Horizontal","Connector_Audio/Jack_XLR_Neutrik_NC3FAAV-0_Vertical","Connector_Audio/Jack_XLR_Neutrik_NC3FAAV1-0_Vertical","Connector_Audio/Jack_XLR_Neutrik_NC3FAAV1-DA_Vertical","Connector_Audio/Jack_XLR_Neutrik_NC3FAAV1_Vertical","Connector_Audio/Jack_XLR_Neutrik_NC3FAAV2-0_Vertical","Connector_Audio/Jack_XLR_Neutrik_NC3FAAV2_Vertical","Connector_Audio/Jack_XLR_Neutrik_NC3FAAV_Vertical","Connector_Audio/Jack_XLR_Neutrik_NC3FAH-0_Horizontal","Connector_Audio/Jack_XLR_Neutrik_NC3FAH1-0_Horizontal","Connector_Audio/Jack_XLR_Neutrik_NC3FAH1-DA_Horizontal","Connector_Audio/Jack_XLR_Neutrik_NC3FAH1_Horizontal","Connector_Audio/Jack_XLR_Neutrik_NC3FAH2-0_Horizontal","Connector_Audio/Jack_XLR_Neutrik_NC3FAH2-DA_Horizontal","Connector_Audio/Jack_XLR_Neutrik_NC3FAH2_Horizontal","Connector_Audio/Jack_XLR_Neutrik_NC3FAHL-0_Horizontal","Connector_Audio/Jack_XLR_Neutrik_NC3FAHL1-0_Horizontal","Connector_Audio/Jack_XLR_Neutrik_NC3FAHL1_Horizontal","Connector_Audio/Jack_XLR_Neutrik_NC3FAHR-0_Horizontal","Connector_Audio/Jack_XLR_Neutrik_NC3FAHR1-0_Horizontal","Connector_Audio/Jack_XLR_Neutrik_NC3FAHR1_Horizontal","Connector_Audio/Jack_XLR_Neutrik_NC3FAHR2-0_Horizontal","Connector_Audio/Jack_XLR_Neutrik_NC3FAHR2_Horizontal","Connector_Audio/Jack_XLR_Neutrik_NC3FAH_Horizontal","Connector_Audio/Jack_XLR_Neutrik_NC3FAV-0_Vertical","Connector_Audio/Jack_XLR_Neutrik_NC3FAV1-0_Vertical","Connector_Audio/Jack_XLR_Neutrik_NC3FAV1-DA_Vertical","Connector_Audio/Jack_XLR_Neutrik_NC3FAV1_Vertical","Connector_Audio/Jack_XLR_Neutrik_NC3FAV2-0_Vertical","Connector_Audio/Jack_XLR_Neutrik_NC3FAV2-DA_Vertical","Connector_Audio/Jack_XLR_Neutrik_NC3FAV2_Vertical","Connector_Audio/Jack_XLR_Neutrik_NC3FAV_Vertical","Connector_Audio/Jack_XLR_Neutrik_NC3FBH1-B_Horizontal","Connector_Audio/Jack_XLR_Neutrik_NC3FBH1-DA_Horizontal","Connector_Audio/Jack_XLR_Neutrik_NC3FBH1-E_Horizontal","Connector_Audio/Jack_XLR_Neutrik_NC3FBH1_Horizontal","Connector_Audio/Jack_XLR_Neutrik_NC3FBH2-B_Horizontal","Connector_Audio/Jack_XLR_Neutrik_NC3FBH2-DA_Horizontal","Connector_Audio/Jack_XLR_Neutrik_NC3FBH2-E_Horizontal","Connector_Audio/Jack_XLR_Neutrik_NC3FBH2_Horizontal","Connector_Audio/Jack_XLR_Neutrik_NC3FBHL1_Horizontal","Connector_Audio/Jack_XLR_Neutrik_NC3FBV1-0_Vertical","Connector_Audio/Jack_XLR_Neutrik_NC3FBV1-B_Vertical","Connector_Audio/Jack_XLR_Neutrik_NC3FBV1-DA_Vertical","Connector_Audio/Jack_XLR_Neutrik_NC3FBV1_Vertical","Connector_Audio/Jack_XLR_Neutrik_NC3FBV2-B_Vertical","Connector_Audio/Jack_XLR_Neutrik_NC3FBV2-DA_Vertical","Connector_Audio/Jack_XLR_Neutrik_NC3FBV2-SW_Vertical","Connector_Audio/Jack_XLR_Neutrik_NC3FBV2_Vertical","Connector_Audio/Jack_XLR_Neutrik_NC3MAAH-0_Horizontal","Connector_Audio/Jack_XLR_Neutrik_NC3MAAH-1_Horizontal","Connector_Audio/Jack_XLR_Neutrik_NC3MAAH_Horizontal","Connector_Audio/Jack_XLR_Neutrik_NC3MAAV-0_Vertical","Connector_Audio/Jack_XLR_Neutrik_NC3MAAV-1_Vertical","Connector_Audio/Jack_XLR_Neutrik_NC3MAAV_Vertical","Connector_Audio/Jack_XLR_Neutrik_NC3MAFH-PH_Horizontal","Connector_Audio/Jack_XLR_Neutrik_NC3MAH-0_Horizontal","Connector_Audio/Jack_XLR_Neutrik_NC3MAHL_Horizontal","Connector_Audio/Jack_XLR_Neutrik_NC3MAHR_Horizontal","Connector_Audio/Jack_XLR_Neutrik_NC3MAH_Horizontal","Connector_Audio/Jack_XLR_Neutrik_NC3MAMH-PH_Horizontal","Connector_Audio/Jack_XLR_Neutrik_NC3MAV-0_Vertical","Connector_Audio/Jack_XLR_Neutrik_NC3MAV_Vertical","Connector_Audio/Jack_XLR_Neutrik_NC3MBH-0_Horizontal","Connector_Audio/Jack_XLR_Neutrik_NC3MBH-1_Horizontal","Connector_Audio/Jack_XLR_Neutrik_NC3MBH-B_Horizontal","Connector_Audio/Jack_XLR_Neutrik_NC3MBH-E_Horizontal","Connector_Audio/Jack_XLR_Neutrik_NC3MBHL-B_Horizontal","Connector_Audio/Jack_XLR_Neutrik_NC3MBHL_Horizontal","Connector_Audio/Jack_XLR_Neutrik_NC3MBHR-B_Horizontal","Connector_Audio/Jack_XLR_Neutrik_NC3MBHR_Horizontal","Connector_Audio/Jack_XLR_Neutrik_NC3MBH_Horizontal","Connector_Audio/Jack_XLR_Neutrik_NC3MBV-0_Vertical","Connector_Audio/Jack_XLR_Neutrik_NC3MBV-1_Vertical","Connector_Audio/Jack_XLR_Neutrik_NC3MBV-B_Vertical","Connector_Audio/Jack_XLR_Neutrik_NC3MBV-E_Vertical","Connector_Audio/Jack_XLR_Neutrik_NC3MBV-SW_Vertical","Connector_Audio/Jack_XLR_Neutrik_NC3MBV_Vertical","Connector_Audio/Jack_XLR_Neutrik_NC4FAH-0_Horizontal","Connector_Audio/Jack_XLR_Neutrik_NC4FAH_Horizontal","Connector_Audio/Jack_XLR_Neutrik_NC4FAV-0_Vertical","Connector_Audio/Jack_XLR_Neutrik_NC4FAV_Vertical","Connector_Audio/Jack_XLR_Neutrik_NC4FBH_Horizontal","Connector_Audio/Jack_XLR_Neutrik_NC4FBV_Vertical","Connector_Audio/Jack_XLR_Neutrik_NC4MAH_Horizontal","Connector_Audio/Jack_XLR_Neutrik_NC4MAV_Vertical","Connector_Audio/Jack_XLR_Neutrik_NC4MBH_Horizontal","Connector_Audio/Jack_XLR_Neutrik_NC4MBV_Vertical","Connector_Audio/Jack_XLR_Neutrik_NC5FAH-0_Horizontal","Connector_Audio/Jack_XLR_Neutrik_NC5FAH-DA_Horizontal","Connector_Audio/Jack_XLR_Neutrik_NC5FAH_Horizontal","Connector_Audio/Jack_XLR_Neutrik_NC5FAV-DA_Vertical","Connector_Audio/Jack_XLR_Neutrik_NC5FAV-SW_Vertical","Connector_Audio/Jack_XLR_Neutrik_NC5FAV_Vertical","Connector_Audio/Jack_XLR_Neutrik_NC5FBH-B_Horizontal","Connector_Audio/Jack_XLR_Neutrik_NC5FBH_Horizontal","Connector_Audio/Jack_XLR_Neutrik_NC5FBV-B_Vertical","Connector_Audio/Jack_XLR_Neutrik_NC5FBV-SW_Vertical","Connector_Audio/Jack_XLR_Neutrik_NC5FBV_Vertical","Connector_Audio/Jack_XLR_Neutrik_NC5MAH_Horizontal","Connector_Audio/Jack_XLR_Neutrik_NC5MAV-SW_Vertical","Connector_Audio/Jack_XLR_Neutrik_NC5MAV_Vertical","Connector_Audio/Jack_XLR_Neutrik_NC5MBH-B_Horizontal","Connector_Audio/Jack_XLR_Neutrik_NC5MBH_Horizontal","Connector_Audio/Jack_XLR_Neutrik_NC5MBV-B_Vertical","Connector_Audio/Jack_XLR_Neutrik_NC5MBV-SW_Vertical","Connector_Audio/Jack_XLR_Neutrik_NC5MBV_Vertical","Connector_Audio/Jack_speakON-6.35mm_Neutrik_NLJ2MDXX-H_Horizontal","Connector_Audio/Jack_speakON-6.35mm_Neutrik_NLJ2MDXX-V_Vertical","Connector_Audio/Jack_speakON_Neutrik_NL2MDXX-H-3_Horizontal","Connector_Audio/Jack_speakON_Neutrik_NL2MDXX-V_Vertical","Connector_Audio/Jack_speakON_Neutrik_NL4MDXX-H-2_Horizontal","Connector_Audio/Jack_speakON_Neutrik_NL4MDXX-H-3_Horizontal","Connector_Audio/Jack_speakON_Neutrik_NL4MDXX-V-2_Vertical","Connector_Audio/Jack_speakON_Neutrik_NL4MDXX-V-3_Vertical","Connector_Audio/Jack_speakON_Neutrik_NL4MDXX-V_Vertical","Connector_Audio/Jack_speakON_Neutrik_NL8MDXX-V-3_Vertical","Connector_Audio/Jack_speakON_Neutrik_NL8MDXX-V_Vertical","Connector_Audio/Jack_speakON_Neutrik_NLT4MD-V_Vertical","Connector_Audio/MiniXLR-5_Switchcraft_TRAPC_Horizontal","Connector_Audio/Plug_3.5mm_CUI_SP-3541","Connector_BarrelJack/BarrelJack_CLIFF_FC681465S_SMT_Horizontal","Connector_BarrelJack/BarrelJack_CUI_PJ-036AH-SMT_Horizontal","Connector_BarrelJack/BarrelJack_CUI_PJ-063AH_Horizontal","Connector_BarrelJack/BarrelJack_CUI_PJ-063AH_Horizontal_CircularHoles","Connector_BarrelJack/BarrelJack_CUI_PJ-079BH_Horizontal","Connector_BarrelJack/BarrelJack_CUI_PJ-102AH_Horizontal","Connector_BarrelJack/BarrelJack_GCT_DCJ200-10-A_Horizontal","Connector_BarrelJack/BarrelJack_Horizontal","Connector_BarrelJack/BarrelJack_Kycon_KLDX-0202-xC_Horizontal","Connector_BarrelJack/BarrelJack_SwitchcraftConxall_RAPC10U_Horizontal","Connector_BarrelJack/BarrelJack_Wuerth_694102107102_1.0x3.9mm","Connector_BarrelJack/BarrelJack_Wuerth_694103107102_1.35x3.9mm","Connector_BarrelJack/BarrelJack_Wuerth_694106106102_2.0x5.5mm","Connector_BarrelJack/BarrelJack_Wuerth_694108106102_2.5x5.5mm","Connector_BarrelJack/BarrelJack_Wuerth_6941xx301002","Connector_Card/CF-Card_3M_N7E50-A516xx-30","Connector_Card/CF-Card_3M_N7E50-E516xx-30","Connector_Card/SD-SIM_microSD-microSIM_Molex_104168-1620","Connector_Card/SD_Card_Device_16mm_SlotDepth","Connector_Card/SD_Hirose_DM1AA_SF_PEJ82","Connector_Card/SD_Kyocera_145638009211859+","Connector_Card/SD_Kyocera_145638009511859+","Connector_Card/SD_Kyocera_145638109211859+","Connector_Card/SD_Kyocera_145638109511859+","Connector_Card/SD_TE_2041021","Connector_Card/microSD_HC_Hirose_DM3AT-SF-PEJM5","Connector_Card/microSD_HC_Hirose_DM3BT-DSF-PEJS","Connector_Card/microSD_HC_Hirose_DM3D-SF","Connector_Card/microSD_HC_Molex_104031-0811","Connector_Card/microSD_HC_Molex_47219-2001","Connector_Card/microSD_HC_Wuerth_693072010801","Connector_Card/microSIM_JAE_SF53S006VCBR2000","Connector_Card/nanoSIM_GCT_SIM8060-6-0-14-00","Connector_Card/nanoSIM_GCT_SIM8060-6-1-14-00","Connector_Card/nanoSIM_Hinged_CUI_NSIM-2-C","Connector_Coaxial/BNC_Amphenol_031-5539_Vertical","Connector_Coaxial/BNC_Amphenol_031-6575_Horizontal","Connector_Coaxial/BNC_Amphenol_B6252HB-NPP3G-50_Horizontal","Connector_Coaxial/BNC_PanelMountable_Vertical","Connector_Coaxial/BNC_TEConnectivity_1478035_Horizontal","Connector_Coaxial/BNC_TEConnectivity_1478204_Vertical","Connector_Coaxial/BNC_Win_364A2x95_Horizontal","Connector_Coaxial/CoaxialSwitch_Hirose_MS-156C3_Horizontal","Connector_Coaxial/LEMO-EPG.00.302.NLN","Connector_Coaxial/LEMO-EPL.00.250.NTN","Connector_Coaxial/MMCX_Molex_73415-0961_Horizontal_0.8mm-PCB","Connector_Coaxial/MMCX_Molex_73415-0961_Horizontal_1.0mm-PCB","Connector_Coaxial/MMCX_Molex_73415-0961_Horizontal_1.6mm-PCB","Connector_Coaxial/MMCX_Molex_73415-1471_Vertical","Connector_Coaxial/SMA_Amphenol_132134-10_Vertical","Connector_Coaxial/SMA_Amphenol_132134-11_Vertical","Connector_Coaxial/SMA_Amphenol_132134-14_Vertical","Connector_Coaxial/SMA_Amphenol_132134-16_Vertical","Connector_Coaxial/SMA_Amphenol_132134_Vertical","Connector_Coaxial/SMA_Amphenol_132203-12_Horizontal","Connector_Coaxial/SMA_Amphenol_132289_EdgeMount","Connector_Coaxial/SMA_Amphenol_132291-12_Vertical","Connector_Coaxial/SMA_Amphenol_132291_Vertical","Connector_Coaxial/SMA_Amphenol_901-143_Horizontal","Connector_Coaxial/SMA_Amphenol_901-144_Vertical","Connector_Coaxial/SMA_BAT_Wireless_BWSMA-KWE-Z001","Connector_Coaxial/SMA_Molex_73251-1153_EdgeMount_Horizontal","Connector_Coaxial/SMA_Molex_73251-2120_EdgeMount_Horizontal","Connector_Coaxial/SMA_Molex_73251-2200_Horizontal","Connector_Coaxial/SMA_Samtec_SMA-J-P-H-ST-EM1_EdgeMount","Connector_Coaxial/SMA_Wurth_60312002114503_Vertical","Connector_Coaxial/SMA_Wurth_60312102114405_Vertical","Connector_Coaxial/SMB_Jack_Vertical","Connector_Coaxial/U.FL_Hirose_U.FL-R-SMT-1_Vertical","Connector_Coaxial/U.FL_Molex_MCRF_73412-0110_Vertical","Connector_Coaxial/WR-MMCX_Wuerth_66011102111302_Horizontal","Connector_Coaxial/WR-MMCX_Wuerth_66012102111404_Vertical","Connector_DIN/DIN41612_B2_2x16_Female_Vertical_THT","Connector_DIN/DIN41612_B2_2x16_Male_Horizontal_THT","Connector_DIN/DIN41612_B2_2x8_Female_Vertical_THT","Connector_DIN/DIN41612_B2_2x8_Male_Horizontal_THT","Connector_DIN/DIN41612_B3_2x10_Female_Vertical_THT","Connector_DIN/DIN41612_B3_2x10_Male_Horizontal_THT","Connector_DIN/DIN41612_B3_2x5_Female_Vertical_THT","Connector_DIN/DIN41612_B3_2x5_Male_Horizontal_THT","Connector_DIN/DIN41612_B_1x32_Female_Vertical_THT","Connector_DIN/DIN41612_B_1x32_Male_Horizontal_THT","Connector_DIN/DIN41612_B_2x16_Female_Vertical_THT","Connector_DIN/DIN41612_B_2x16_Male_Horizontal_THT","Connector_DIN/DIN41612_B_2x32_Female_Vertical_THT","Connector_DIN/DIN41612_B_2x32_Male_Horizontal_THT","Connector_DIN/DIN41612_C2_2x16_Female_Vertical_THT","Connector_DIN/DIN41612_C2_2x16_Male_Horizontal_THT","Connector_DIN/DIN41612_C2_3x16_Female_Vertical_THT","Connector_DIN/DIN41612_C2_3x16_Male_Horizontal_THT","Connector_DIN/DIN41612_C3_2x10_Female_Vertical_THT","Connector_DIN/DIN41612_C3_2x10_Male_Horizontal_THT","Connector_DIN/DIN41612_C3_3x10_Female_Vertical_THT","Connector_DIN/DIN41612_C3_3x10_Male_Horizontal_THT","Connector_DIN/DIN41612_C_1x32_Female_Vertical_THT","Connector_DIN/DIN41612_C_1x32_Male_Horizontal_THT","Connector_DIN/DIN41612_C_2x16_Female_Vertical_THT","Connector_DIN/DIN41612_C_2x16_Male_Horizontal_THT","Connector_DIN/DIN41612_C_2x32_Female_Vertical_THT","Connector_DIN/DIN41612_C_2x32_Male_Horizontal_THT","Connector_DIN/DIN41612_C_3x16_Female_Vertical_THT","Connector_DIN/DIN41612_C_3x16_Male_Horizontal_THT","Connector_DIN/DIN41612_C_3x32_Female_Vertical_THT","Connector_DIN/DIN41612_C_3x32_Male_Horizontal_THT","Connector_DIN/DIN41612_D_2x16_Female_Vertical_THT","Connector_DIN/DIN41612_D_2x16_Male_Horizontal_THT","Connector_DIN/DIN41612_D_2x8_Female_Vertical_THT","Connector_DIN/DIN41612_D_2x8_Male_Horizontal_THT","Connector_DIN/DIN41612_E_2x16_Female_Vertical_THT","Connector_DIN/DIN41612_E_2x16_Male_Horizontal_THT","Connector_DIN/DIN41612_E_2x16_RowsAC_Female_Vertical_THT","Connector_DIN/DIN41612_E_2x16_RowsAC_Male_Horizontal_THT","Connector_DIN/DIN41612_E_3x16_Female_Vertical_THT","Connector_DIN/DIN41612_E_3x16_Male_Horizontal_THT","Connector_DIN/DIN41612_F_2x16_Female_Vertical_THT","Connector_DIN/DIN41612_F_2x16_Male_Horizontal_THT","Connector_DIN/DIN41612_F_2x16_RowsZD_Female_Vertical_THT","Connector_DIN/DIN41612_F_2x16_RowsZD_Male_Horizontal_THT","Connector_DIN/DIN41612_F_3x16_Female_Vertical_THT","Connector_DIN/DIN41612_F_3x16_Male_Horizontal_THT","Connector_DIN/DIN41612_M-flat_3x14+6_Female_Vertical_THT","Connector_DIN/DIN41612_M-flat_3x20+4_Female_Vertical_THT","Connector_DIN/DIN41612_M-flat_3x26+2_Female_Vertical_THT","Connector_DIN/DIN41612_M-flat_3x8+8_Female_Vertical_THT","Connector_DIN/DIN41612_M-invers_3x14+6_Female_Horizontal_THT","Connector_DIN/DIN41612_M-invers_3x14+6_Male_Vertical_THT","Connector_DIN/DIN41612_M-invers_3x2+10_Female_Horizontal_THT","Connector_DIN/DIN41612_M-invers_3x2+10_Male_Vertical_THT","Connector_DIN/DIN41612_M-invers_3x20+4_Female_Horizontal_THT","Connector_DIN/DIN41612_M-invers_3x20+4_Male_Vertical_THT","Connector_DIN/DIN41612_M-invers_3x26+2_Female_Horizontal_THT","Connector_DIN/DIN41612_M-invers_3x26+2_Male_Vertical_THT","Connector_DIN/DIN41612_M-invers_3x8+8_Female_Horizontal_THT","Connector_DIN/DIN41612_M-invers_3x8+8_Male_Vertical_THT","Connector_DIN/DIN41612_M_3x14+6_Female_Vertical_THT","Connector_DIN/DIN41612_M_3x14+6_Male_Horizontal_THT","Connector_DIN/DIN41612_M_3x20+4_Female_Vertical_THT","Connector_DIN/DIN41612_M_3x20+4_Male_Horizontal_THT","Connector_DIN/DIN41612_M_3x26+2_Female_Vertical_THT","Connector_DIN/DIN41612_M_3x26+2_Male_Horizontal_THT","Connector_DIN/DIN41612_M_3x8+8_Female_Vertical_THT","Connector_DIN/DIN41612_M_3x8+8_Male_Horizontal_THT","Connector_DIN/DIN41612_Q2_2x16_Female_Horizontal_THT","Connector_DIN/DIN41612_Q2_2x16_Male_Vertical_THT","Connector_DIN/DIN41612_Q3_2x10_Female_Horizontal_THT","Connector_DIN/DIN41612_Q3_2x10_Male_Vertical_THT","Connector_DIN/DIN41612_Q_2x32_Female_Horizontal_THT","Connector_DIN/DIN41612_Q_2x32_Male_Vertical_THT","Connector_DIN/DIN41612_R2_2x16_Female_Horizontal_THT","Connector_DIN/DIN41612_R2_2x16_Male_Vertical_THT","Connector_DIN/DIN41612_R2_3x16_Female_Horizontal_THT","Connector_DIN/DIN41612_R2_3x16_Male_Vertical_THT","Connector_DIN/DIN41612_R3_2x10_Female_Horizontal_THT","Connector_DIN/DIN41612_R3_2x10_Male_Vertical_THT","Connector_DIN/DIN41612_R3_3x10_Female_Horizontal_THT","Connector_DIN/DIN41612_R3_3x10_Male_Vertical_THT","Connector_DIN/DIN41612_R_1x32_Female_Horizontal_THT","Connector_DIN/DIN41612_R_1x32_Male_Vertical_THT","Connector_DIN/DIN41612_R_2x16_Female_Horizontal_THT","Connector_DIN/DIN41612_R_2x16_Male_Vertical_THT","Connector_DIN/DIN41612_R_2x32_Female_Horizontal_THT","Connector_DIN/DIN41612_R_2x32_Male_Vertical_THT","Connector_DIN/DIN41612_R_3x16_Female_Horizontal_THT","Connector_DIN/DIN41612_R_3x16_Male_Vertical_THT","Connector_DIN/DIN41612_R_3x32_Female_Horizontal_THT","Connector_DIN/DIN41612_R_3x32_Male_Vertical_THT","Connector_Dsub/DSUB-15-HD_Pins_Horizontal_P2.29x1.90mm_EdgePinOffset3.03mm_Housed_MountingHolesOffset4.94mm","Connector_Dsub/DSUB-15-HD_Pins_Horizontal_P2.29x2.54mm_EdgePinOffset8.35mm_Housed_MountingHolesOffset10.89mm","Connector_Dsub/DSUB-15-HD_Pins_Vertical_P2.29x1.98mm_MountingHoles","Connector_Dsub/DSUB-15-HD_Socket_Horizontal_P2.29x1.90mm_EdgePinOffset3.03mm_Housed_MountingHolesOffset4.94mm","Connector_Dsub/DSUB-15-HD_Socket_Horizontal_P2.29x2.54mm_EdgePinOffset8.35mm_Housed_MountingHolesOffset10.89mm","Connector_Dsub/DSUB-15-HD_Socket_Vertical_P2.29x1.98mm_MountingHoles","Connector_Dsub/DSUB-15_Pins_EdgeMount_P2.77mm","Connector_Dsub/DSUB-15_Pins_Horizontal_P2.77x2.54mm_EdgePinOffset9.40mm","Connector_Dsub/DSUB-15_Pins_Horizontal_P2.77x2.84mm_EdgePinOffset14.56mm_Housed_MountingHolesOffset15.98mm","Connector_Dsub/DSUB-15_Pins_Horizontal_P2.77x2.84mm_EdgePinOffset14.56mm_Housed_MountingHolesOffset8.20mm","Connector_Dsub/DSUB-15_Pins_Horizontal_P2.77x2.84mm_EdgePinOffset4.94mm_Housed_MountingHolesOffset4.94mm","Connector_Dsub/DSUB-15_Pins_Horizontal_P2.77x2.84mm_EdgePinOffset7.70mm_Housed_MountingHolesOffset9.12mm","Connector_Dsub/DSUB-15_Pins_Horizontal_P2.77x2.84mm_EdgePinOffset9.40mm","Connector_Dsub/DSUB-15_Pins_Horizontal_P2.77x2.84mm_EdgePinOffset9.90mm_Housed_MountingHolesOffset11.32mm","Connector_Dsub/DSUB-15_Pins_Vertical_P2.77x2.84mm","Connector_Dsub/DSUB-15_Pins_Vertical_P2.77x2.84mm_MountingHoles","Connector_Dsub/DSUB-15_Socket_EdgeMount_P2.77mm","Connector_Dsub/DSUB-15_Socket_Horizontal_P2.77x2.54mm_EdgePinOffset9.40mm","Connector_Dsub/DSUB-15_Socket_Horizontal_P2.77x2.84mm_EdgePinOffset14.56mm_Housed_MountingHolesOffset15.98mm","Connector_Dsub/DSUB-15_Socket_Horizontal_P2.77x2.84mm_EdgePinOffset14.56mm_Housed_MountingHolesOffset8.20mm","Connector_Dsub/DSUB-15_Socket_Horizontal_P2.77x2.84mm_EdgePinOffset4.94mm_Housed_MountingHolesOffset4.94mm","Connector_Dsub/DSUB-15_Socket_Horizontal_P2.77x2.84mm_EdgePinOffset7.70mm_Housed_MountingHolesOffset9.12mm","Connector_Dsub/DSUB-15_Socket_Horizontal_P2.77x2.84mm_EdgePinOffset9.40mm","Connector_Dsub/DSUB-15_Socket_Horizontal_P2.77x2.84mm_EdgePinOffset9.90mm_Housed_MountingHolesOffset11.32mm","Connector_Dsub/DSUB-15_Socket_Vertical_P2.77x2.84mm","Connector_Dsub/DSUB-15_Socket_Vertical_P2.77x2.84mm_MountingHoles","Connector_Dsub/DSUB-25_Pins_EdgeMount_P2.77mm","Connector_Dsub/DSUB-25_Pins_Horizontal_P2.77x2.54mm_EdgePinOffset9.40mm","Connector_Dsub/DSUB-25_Pins_Horizontal_P2.77x2.84mm_EdgePinOffset14.56mm_Housed_MountingHolesOffset15.98mm","Connector_Dsub/DSUB-25_Pins_Horizontal_P2.77x2.84mm_EdgePinOffset14.56mm_Housed_MountingHolesOffset8.20mm","Connector_Dsub/DSUB-25_Pins_Horizontal_P2.77x2.84mm_EdgePinOffset4.94mm_Housed_MountingHolesOffset4.94mm","Connector_Dsub/DSUB-25_Pins_Horizontal_P2.77x2.84mm_EdgePinOffset7.70mm_Housed_MountingHolesOffset9.12mm","Connector_Dsub/DSUB-25_Pins_Horizontal_P2.77x2.84mm_EdgePinOffset9.40mm","Connector_Dsub/DSUB-25_Pins_Horizontal_P2.77x2.84mm_EdgePinOffset9.90mm_Housed_MountingHolesOffset11.32mm","Connector_Dsub/DSUB-25_Pins_Vertical_P2.77x2.84mm","Connector_Dsub/DSUB-25_Pins_Vertical_P2.77x2.84mm_MountingHoles","Connector_Dsub/DSUB-25_Socket_EdgeMount_P2.77mm","Connector_Dsub/DSUB-25_Socket_Horizontal_P2.77x2.54mm_EdgePinOffset9.40mm","Connector_Dsub/DSUB-25_Socket_Horizontal_P2.77x2.84mm_EdgePinOffset14.56mm_Housed_MountingHolesOffset15.98mm","Connector_Dsub/DSUB-25_Socket_Horizontal_P2.77x2.84mm_EdgePinOffset14.56mm_Housed_MountingHolesOffset8.20mm","Connector_Dsub/DSUB-25_Socket_Horizontal_P2.77x2.84mm_EdgePinOffset4.94mm_Housed_MountingHolesOffset4.94mm","Connector_Dsub/DSUB-25_Socket_Horizontal_P2.77x2.84mm_EdgePinOffset7.70mm_Housed_MountingHolesOffset9.12mm","Connector_Dsub/DSUB-25_Socket_Horizontal_P2.77x2.84mm_EdgePinOffset9.40mm","Connector_Dsub/DSUB-25_Socket_Horizontal_P2.77x2.84mm_EdgePinOffset9.90mm_Housed_MountingHolesOffset11.32mm","Connector_Dsub/DSUB-25_Socket_Vertical_P2.77x2.84mm","Connector_Dsub/DSUB-25_Socket_Vertical_P2.77x2.84mm_MountingHoles","Connector_Dsub/DSUB-26-HD_Pins_Horizontal_P2.29x1.90mm_EdgePinOffset3.03mm_Housed_MountingHolesOffset4.94mm","Connector_Dsub/DSUB-26-HD_Pins_Horizontal_P2.29x2.54mm_EdgePinOffset8.35mm_Housed_MountingHolesOffset10.89mm","Connector_Dsub/DSUB-26-HD_Pins_Vertical_P2.29x1.98mm_MountingHoles","Connector_Dsub/DSUB-26-HD_Socket_Horizontal_P2.29x1.90mm_EdgePinOffset3.03mm_Housed_MountingHolesOffset4.94mm","Connector_Dsub/DSUB-26-HD_Socket_Horizontal_P2.29x2.54mm_EdgePinOffset8.35mm_Housed_MountingHolesOffset10.89mm","Connector_Dsub/DSUB-26-HD_Socket_Vertical_P2.29x1.98mm_MountingHoles","Connector_Dsub/DSUB-37_Pins_EdgeMount_P2.77mm","Connector_Dsub/DSUB-37_Pins_Horizontal_P2.77x2.54mm_EdgePinOffset9.40mm","Connector_Dsub/DSUB-37_Pins_Horizontal_P2.77x2.84mm_EdgePinOffset14.56mm_Housed_MountingHolesOffset15.98mm","Connector_Dsub/DSUB-37_Pins_Horizontal_P2.77x2.84mm_EdgePinOffset14.56mm_Housed_MountingHolesOffset8.20mm","Connector_Dsub/DSUB-37_Pins_Horizontal_P2.77x2.84mm_EdgePinOffset4.94mm_Housed_MountingHolesOffset4.94mm","Connector_Dsub/DSUB-37_Pins_Horizontal_P2.77x2.84mm_EdgePinOffset7.70mm_Housed_MountingHolesOffset9.12mm","Connector_Dsub/DSUB-37_Pins_Horizontal_P2.77x2.84mm_EdgePinOffset9.40mm","Connector_Dsub/DSUB-37_Pins_Horizontal_P2.77x2.84mm_EdgePinOffset9.90mm_Housed_MountingHolesOffset11.32mm","Connector_Dsub/DSUB-37_Pins_Vertical_P2.77x2.84mm","Connector_Dsub/DSUB-37_Pins_Vertical_P2.77x2.84mm_MountingHoles","Connector_Dsub/DSUB-37_Socket_EdgeMount_P2.77mm","Connector_Dsub/DSUB-37_Socket_Horizontal_P2.77x2.54mm_EdgePinOffset9.40mm","Connector_Dsub/DSUB-37_Socket_Horizontal_P2.77x2.84mm_EdgePinOffset14.56mm_Housed_MountingHolesOffset15.98mm","Connector_Dsub/DSUB-37_Socket_Horizontal_P2.77x2.84mm_EdgePinOffset14.56mm_Housed_MountingHolesOffset8.20mm","Connector_Dsub/DSUB-37_Socket_Horizontal_P2.77x2.84mm_EdgePinOffset4.94mm_Housed_MountingHolesOffset4.94mm","Connector_Dsub/DSUB-37_Socket_Horizontal_P2.77x2.84mm_EdgePinOffset7.70mm_Housed_MountingHolesOffset9.12mm","Connector_Dsub/DSUB-37_Socket_Horizontal_P2.77x2.84mm_EdgePinOffset9.40mm","Connector_Dsub/DSUB-37_Socket_Horizontal_P2.77x2.84mm_EdgePinOffset9.90mm_Housed_MountingHolesOffset11.32mm","Connector_Dsub/DSUB-37_Socket_Vertical_P2.77x2.84mm","Connector_Dsub/DSUB-37_Socket_Vertical_P2.77x2.84mm_MountingHoles","Connector_Dsub/DSUB-44-HD_Pins_Horizontal_P2.29x1.90mm_EdgePinOffset3.03mm_Housed_MountingHolesOffset4.94mm","Connector_Dsub/DSUB-44-HD_Pins_Horizontal_P2.29x2.54mm_EdgePinOffset8.35mm_Housed_MountingHolesOffset10.89mm","Connector_Dsub/DSUB-44-HD_Pins_Vertical_P2.29x1.98mm_MountingHoles","Connector_Dsub/DSUB-44-HD_Socket_Horizontal_P2.29x1.90mm_EdgePinOffset3.03mm_Housed_MountingHolesOffset4.94mm","Connector_Dsub/DSUB-44-HD_Socket_Horizontal_P2.29x2.54mm_EdgePinOffset8.35mm_Housed_MountingHolesOffset10.89mm","Connector_Dsub/DSUB-44-HD_Socket_Vertical_P2.29x1.98mm_MountingHoles","Connector_Dsub/DSUB-62-HD_Pins_Horizontal_P2.41x1.90mm_EdgePinOffset3.03mm_Housed_MountingHolesOffset4.94mm","Connector_Dsub/DSUB-62-HD_Pins_Horizontal_P2.41x2.54mm_EdgePinOffset8.35mm_Housed_MountingHolesOffset10.89mm","Connector_Dsub/DSUB-62-HD_Pins_Vertical_P2.41x1.98mm_MountingHoles","Connector_Dsub/DSUB-62-HD_Socket_Horizontal_P2.41x1.90mm_EdgePinOffset3.03mm_Housed_MountingHolesOffset4.94mm","Connector_Dsub/DSUB-62-HD_Socket_Horizontal_P2.41x2.54mm_EdgePinOffset8.35mm_Housed_MountingHolesOffset10.89mm","Connector_Dsub/DSUB-62-HD_Socket_Vertical_P2.41x1.98mm_MountingHoles","Connector_Dsub/DSUB-9_Pins_EdgeMount_P2.77mm","Connector_Dsub/DSUB-9_Pins_Horizontal_P2.77x2.54mm_EdgePinOffset9.40mm","Connector_Dsub/DSUB-9_Pins_Horizontal_P2.77x2.84mm_EdgePinOffset14.56mm_Housed_MountingHolesOffset15.98mm","Connector_Dsub/DSUB-9_Pins_Horizontal_P2.77x2.84mm_EdgePinOffset14.56mm_Housed_MountingHolesOffset8.20mm","Connector_Dsub/DSUB-9_Pins_Horizontal_P2.77x2.84mm_EdgePinOffset4.94mm_Housed_MountingHolesOffset4.94mm","Connector_Dsub/DSUB-9_Pins_Horizontal_P2.77x2.84mm_EdgePinOffset7.70mm_Housed_MountingHolesOffset9.12mm","Connector_Dsub/DSUB-9_Pins_Horizontal_P2.77x2.84mm_EdgePinOffset9.40mm","Connector_Dsub/DSUB-9_Pins_Horizontal_P2.77x2.84mm_EdgePinOffset9.90mm_Housed_MountingHolesOffset11.32mm","Connector_Dsub/DSUB-9_Pins_Vertical_P2.77x2.84mm","Connector_Dsub/DSUB-9_Pins_Vertical_P2.77x2.84mm_MountingHoles","Connector_Dsub/DSUB-9_Socket_EdgeMount_P2.77mm","Connector_Dsub/DSUB-9_Socket_Horizontal_P2.77x2.54mm_EdgePinOffset9.40mm","Connector_Dsub/DSUB-9_Socket_Horizontal_P2.77x2.84mm_EdgePinOffset14.56mm_Housed_MountingHolesOffset15.98mm","Connector_Dsub/DSUB-9_Socket_Horizontal_P2.77x2.84mm_EdgePinOffset14.56mm_Housed_MountingHolesOffset8.20mm","Connector_Dsub/DSUB-9_Socket_Horizontal_P2.77x2.84mm_EdgePinOffset4.94mm_Housed_MountingHolesOffset4.94mm","Connector_Dsub/DSUB-9_Socket_Horizontal_P2.77x2.84mm_EdgePinOffset7.70mm_Housed_MountingHolesOffset9.12mm","Connector_Dsub/DSUB-9_Socket_Horizontal_P2.77x2.84mm_EdgePinOffset9.40mm","Connector_Dsub/DSUB-9_Socket_Horizontal_P2.77x2.84mm_EdgePinOffset9.90mm_Housed_MountingHolesOffset11.32mm","Connector_Dsub/DSUB-9_Socket_Vertical_P2.77x2.84mm","Connector_Dsub/DSUB-9_Socket_Vertical_P2.77x2.84mm_MountingHoles","Connector_FFC-FPC/Amphenol_F32Q-1A7x1-11004_1x04-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32Q-1A7x1-11005_1x05-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32Q-1A7x1-11006_1x06-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32Q-1A7x1-11007_1x07-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32Q-1A7x1-11008_1x08-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32Q-1A7x1-11009_1x09-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32Q-1A7x1-11010_1x10-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32Q-1A7x1-11011_1x11-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32Q-1A7x1-11012_1x12-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32Q-1A7x1-11013_1x13-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32Q-1A7x1-11014_1x14-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32Q-1A7x1-11015_1x15-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32Q-1A7x1-11016_1x16-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32Q-1A7x1-11017_1x17-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32Q-1A7x1-11018_1x18-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32Q-1A7x1-11019_1x19-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32Q-1A7x1-11020_1x20-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32Q-1A7x1-11021_1x21-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32Q-1A7x1-11022_1x22-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32Q-1A7x1-11023_1x23-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32Q-1A7x1-11024_1x24-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32Q-1A7x1-11025_1x25-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32Q-1A7x1-11026_1x26-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32Q-1A7x1-11027_1x27-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32Q-1A7x1-11028_1x28-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32Q-1A7x1-11029_1x29-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32Q-1A7x1-11030_1x30-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32Q-1A7x1-11031_1x31-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32Q-1A7x1-11032_1x32-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32Q-1A7x1-11033_1x33-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32Q-1A7x1-11034_1x34-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32Q-1A7x1-11035_1x35-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32Q-1A7x1-11036_1x36-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32Q-1A7x1-11037_1x37-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32Q-1A7x1-11038_1x38-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32Q-1A7x1-11039_1x39-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32Q-1A7x1-11040_1x40-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32Q-1A7x1-11041_1x41-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32Q-1A7x1-11042_1x42-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32Q-1A7x1-11043_1x43-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32Q-1A7x1-11044_1x44-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32Q-1A7x1-11045_1x45-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32Q-1A7x1-11046_1x46-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32Q-1A7x1-11047_1x47-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32Q-1A7x1-11048_1x48-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32Q-1A7x1-11049_1x49-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32Q-1A7x1-11050_1x50-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32Q-1A7x1-11051_1x51-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32Q-1A7x1-11052_1x52-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32Q-1A7x1-11053_1x53-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32Q-1A7x1-11054_1x54-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32Q-1A7x1-11055_1x55-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32Q-1A7x1-11056_1x56-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32Q-1A7x1-11057_1x57-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32Q-1A7x1-11058_1x58-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32Q-1A7x1-11059_1x59-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32Q-1A7x1-11060_1x60-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32R-1A7x1-11004_1x04-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32R-1A7x1-11005_1x05-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32R-1A7x1-11006_1x06-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32R-1A7x1-11007_1x07-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32R-1A7x1-11008_1x08-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32R-1A7x1-11009_1x09-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32R-1A7x1-11010_1x10-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32R-1A7x1-11011_1x11-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32R-1A7x1-11012_1x12-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32R-1A7x1-11013_1x13-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32R-1A7x1-11014_1x14-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32R-1A7x1-11015_1x15-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32R-1A7x1-11016_1x16-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32R-1A7x1-11017_1x17-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32R-1A7x1-11018_1x18-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32R-1A7x1-11019_1x19-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32R-1A7x1-11020_1x20-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32R-1A7x1-11021_1x21-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32R-1A7x1-11022_1x22-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32R-1A7x1-11023_1x23-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32R-1A7x1-11024_1x24-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32R-1A7x1-11025_1x25-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32R-1A7x1-11026_1x26-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32R-1A7x1-11027_1x27-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32R-1A7x1-11028_1x28-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32R-1A7x1-11029_1x29-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32R-1A7x1-11030_1x30-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32R-1A7x1-11031_1x31-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32R-1A7x1-11032_1x32-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32R-1A7x1-11033_1x33-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32R-1A7x1-11034_1x34-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32R-1A7x1-11035_1x35-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32R-1A7x1-11036_1x36-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32R-1A7x1-11037_1x37-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32R-1A7x1-11038_1x38-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32R-1A7x1-11039_1x39-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32R-1A7x1-11040_1x40-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32R-1A7x1-11041_1x41-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32R-1A7x1-11042_1x42-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32R-1A7x1-11043_1x43-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32R-1A7x1-11044_1x44-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32R-1A7x1-11045_1x45-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32R-1A7x1-11046_1x46-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32R-1A7x1-11047_1x47-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32R-1A7x1-11048_1x48-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32R-1A7x1-11049_1x49-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32R-1A7x1-11050_1x50-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32R-1A7x1-11051_1x51-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32R-1A7x1-11052_1x52-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32R-1A7x1-11053_1x53-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32R-1A7x1-11054_1x54-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32R-1A7x1-11055_1x55-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32R-1A7x1-11056_1x56-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32R-1A7x1-11057_1x57-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32R-1A7x1-11058_1x58-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32R-1A7x1-11059_1x59-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Amphenol_F32R-1A7x1-11060_1x60-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Hirose_FH12-10S-0.5SH_1x10-1MP_P0.50mm_Horizontal","Connector_FFC-FPC/Hirose_FH12-11S-0.5SH_1x11-1MP_P0.50mm_Horizontal","Connector_FFC-FPC/Hirose_FH12-12S-0.5SH_1x12-1MP_P0.50mm_Horizontal","Connector_FFC-FPC/Hirose_FH12-13S-0.5SH_1x13-1MP_P0.50mm_Horizontal","Connector_FFC-FPC/Hirose_FH12-14S-0.5SH_1x14-1MP_P0.50mm_Horizontal","Connector_FFC-FPC/Hirose_FH12-15S-0.5SH_1x15-1MP_P0.50mm_Horizontal","Connector_FFC-FPC/Hirose_FH12-16S-0.5SH_1x16-1MP_P0.50mm_Horizontal","Connector_FFC-FPC/Hirose_FH12-17S-0.5SH_1x17-1MP_P0.50mm_Horizontal","Connector_FFC-FPC/Hirose_FH12-18S-0.5SH_1x18-1MP_P0.50mm_Horizontal","Connector_FFC-FPC/Hirose_FH12-19S-0.5SH_1x19-1MP_P0.50mm_Horizontal","Connector_FFC-FPC/Hirose_FH12-20S-0.5SH_1x20-1MP_P0.50mm_Horizontal","Connector_FFC-FPC/Hirose_FH12-22S-0.5SH_1x22-1MP_P0.50mm_Horizontal","Connector_FFC-FPC/Hirose_FH12-24S-0.5SH_1x24-1MP_P0.50mm_Horizontal","Connector_FFC-FPC/Hirose_FH12-25S-0.5SH_1x25-1MP_P0.50mm_Horizontal","Connector_FFC-FPC/Hirose_FH12-26S-0.5SH_1x26-1MP_P0.50mm_Horizontal","Connector_FFC-FPC/Hirose_FH12-28S-0.5SH_1x28-1MP_P0.50mm_Horizontal","Connector_FFC-FPC/Hirose_FH12-30S-0.5SH_1x30-1MP_P0.50mm_Horizontal","Connector_FFC-FPC/Hirose_FH12-32S-0.5SH_1x32-1MP_P0.50mm_Horizontal","Connector_FFC-FPC/Hirose_FH12-33S-0.5SH_1x33-1MP_P0.50mm_Horizontal","Connector_FFC-FPC/Hirose_FH12-34S-0.5SH_1x34-1MP_P0.50mm_Horizontal","Connector_FFC-FPC/Hirose_FH12-35S-0.5SH_1x35-1MP_P0.50mm_Horizontal","Connector_FFC-FPC/Hirose_FH12-36S-0.5SH_1x36-1MP_P0.50mm_Horizontal","Connector_FFC-FPC/Hirose_FH12-40S-0.5SH_1x40-1MP_P0.50mm_Horizontal","Connector_FFC-FPC/Hirose_FH12-45S-0.5SH_1x45-1MP_P0.50mm_Horizontal","Connector_FFC-FPC/Hirose_FH12-50S-0.5SH_1x50-1MP_P0.50mm_Horizontal","Connector_FFC-FPC/Hirose_FH12-53S-0.5SH_1x53-1MP_P0.50mm_Horizontal","Connector_FFC-FPC/Hirose_FH12-6S-0.5SH_1x06-1MP_P0.50mm_Horizontal","Connector_FFC-FPC/Hirose_FH12-8S-0.5SH_1x08-1MP_P0.50mm_Horizontal","Connector_FFC-FPC/Hirose_FH26-13S-0.3SHW_2Rows-13Pins-1MP_P0.60mm_Horizontal","Connector_FFC-FPC/Hirose_FH26-15S-0.3SHW_2Rows-15Pins-1MP_P0.60mm_Horizontal","Connector_FFC-FPC/Hirose_FH26-17S-0.3SHW_2Rows-17Pins-1MP_P0.60mm_Horizontal","Connector_FFC-FPC/Hirose_FH26-19S-0.3SHW_2Rows-19Pins-1MP_P0.60mm_Horizontal","Connector_FFC-FPC/Hirose_FH26-21S-0.3SHW_2Rows-21Pins-1MP_P0.60mm_Horizontal","Connector_FFC-FPC/Hirose_FH26-23S-0.3SHW_2Rows-23Pins-1MP_P0.60mm_Horizontal","Connector_FFC-FPC/Hirose_FH26-25S-0.3SHW_2Rows-25Pins-1MP_P0.60mm_Horizontal","Connector_FFC-FPC/Hirose_FH26-27S-0.3SHW_2Rows-27Pins-1MP_P0.60mm_Horizontal","Connector_FFC-FPC/Hirose_FH26-29S-0.3SHW_2Rows-29Pins-1MP_P0.60mm_Horizontal","Connector_FFC-FPC/Hirose_FH26-31S-0.3SHW_2Rows-31Pins-1MP_P0.60mm_Horizontal","Connector_FFC-FPC/Hirose_FH26-33S-0.3SHW_2Rows-33Pins-1MP_P0.60mm_Horizontal","Connector_FFC-FPC/Hirose_FH26-35S-0.3SHW_2Rows-35Pins-1MP_P0.60mm_Horizontal","Connector_FFC-FPC/Hirose_FH26-37S-0.3SHW_2Rows-37Pins-1MP_P0.60mm_Horizontal","Connector_FFC-FPC/Hirose_FH26-39S-0.3SHW_2Rows-39Pins-1MP_P0.60mm_Horizontal","Connector_FFC-FPC/Hirose_FH26-41S-0.3SHW_2Rows-41Pins-1MP_P0.60mm_Horizontal","Connector_FFC-FPC/Hirose_FH26-45S-0.3SHW_2Rows-45Pins-1MP_P0.60mm_Horizontal","Connector_FFC-FPC/Hirose_FH26-51S-0.3SHW_2Rows-51Pins-1MP_P0.60mm_Horizontal","Connector_FFC-FPC/Hirose_FH26-55S-0.3SHW_2Rows-55Pins-1MP_P0.60mm_Horizontal","Connector_FFC-FPC/Hirose_FH26-57S-0.3SHW_2Rows-57Pins-1MP_P0.60mm_Horizontal","Connector_FFC-FPC/Hirose_FH26-61S-0.3SHW_2Rows-61Pins-1MP_P0.60mm_Horizontal","Connector_FFC-FPC/Hirose_FH26-71S-0.3SHW_2Rows-71Pins-1MP_P0.60mm_Horizontal","Connector_FFC-FPC/Hirose_FH41-30S-0.5SH_1x30_1MP_1SH_P0.5mm_Horizontal","Connector_FFC-FPC/JAE_FF0825SA1_2Rows-25Pins_P0.40mm_Horizontal","Connector_FFC-FPC/JAE_FF0829SA1_2Rows-29Pins_P0.40mm_Horizontal","Connector_FFC-FPC/JAE_FF0841SA1_2Rows-41Pins_P0.40mm_Horizontal","Connector_FFC-FPC/JAE_FF0851SA1_2Rows-51Pins_P0.40mm_Horizontal","Connector_FFC-FPC/JAE_FF0871SA1_2Rows-71Pins_P0.40mm_Horizontal","Connector_FFC-FPC/JAE_FF0881SA1_2Rows-81Pins_P0.40mm_Horizontal","Connector_FFC-FPC/JUSHUO_AFA07-S04FCA-00_1x4-1MP_P1.0mm_Horizontal","Connector_FFC-FPC/JUSHUO_AFA07-S05FCA-00_1x5-1MP_P1.0mm_Horizontal","Connector_FFC-FPC/JUSHUO_AFA07-S06FCA-00_1x6-1MP_P1.0mm_Horizontal","Connector_FFC-FPC/JUSHUO_AFA07-S07FCA-00_1x7-1MP_P1.0mm_Horizontal","Connector_FFC-FPC/JUSHUO_AFA07-S08FCA-00_1x8-1MP_P1.0mm_Horizontal","Connector_FFC-FPC/JUSHUO_AFA07-S09FCA-00_1x9-1MP_P1.0mm_Horizontal","Connector_FFC-FPC/JUSHUO_AFA07-S10FCA-00_1x10-1MP_P1.0mm_Horizontal","Connector_FFC-FPC/JUSHUO_AFA07-S11FCA-00_1x11-1MP_P1.0mm_Horizontal","Connector_FFC-FPC/JUSHUO_AFA07-S12FCA-00_1x12-1MP_P1.0mm_Horizontal","Connector_FFC-FPC/JUSHUO_AFA07-S13FCA-00_1x13-1MP_P1.0mm_Horizontal","Connector_FFC-FPC/JUSHUO_AFA07-S14FCA-00_1x14-1MP_P1.0mm_Horizontal","Connector_FFC-FPC/JUSHUO_AFA07-S15FCA-00_1x15-1MP_P1.0mm_Horizontal","Connector_FFC-FPC/JUSHUO_AFA07-S16FCA-00_1x16-1MP_P1.0mm_Horizontal","Connector_FFC-FPC/JUSHUO_AFA07-S17FCA-00_1x17-1MP_P1.0mm_Horizontal","Connector_FFC-FPC/JUSHUO_AFA07-S18FCA-00_1x18-1MP_P1.0mm_Horizontal","Connector_FFC-FPC/JUSHUO_AFA07-S19FCA-00_1x19-1MP_P1.0mm_Horizontal","Connector_FFC-FPC/JUSHUO_AFA07-S20FCA-00_1x20-1MP_P1.0mm_Horizontal","Connector_FFC-FPC/JUSHUO_AFA07-S21FCA-00_1x21-1MP_P1.0mm_Horizontal","Connector_FFC-FPC/JUSHUO_AFA07-S22FCA-00_1x22-1MP_P1.0mm_Horizontal","Connector_FFC-FPC/JUSHUO_AFA07-S23FCA-00_1x23-1MP_P1.0mm_Horizontal","Connector_FFC-FPC/JUSHUO_AFA07-S24FCA-00_1x24-1MP_P1.0mm_Horizontal","Connector_FFC-FPC/JUSHUO_AFA07-S25FCA-00_1x25-1MP_P1.0mm_Horizontal","Connector_FFC-FPC/JUSHUO_AFA07-S26FCA-00_1x26-1MP_P1.0mm_Horizontal","Connector_FFC-FPC/JUSHUO_AFA07-S27FCA-00_1x27-1MP_P1.0mm_Horizontal","Connector_FFC-FPC/JUSHUO_AFA07-S28FCA-00_1x28-1MP_P1.0mm_Horizontal","Connector_FFC-FPC/JUSHUO_AFA07-S29FCA-00_1x29-1MP_P1.0mm_Horizontal","Connector_FFC-FPC/Jushuo_AFC07-S06FCA-00_1x6-1MP_P0.50_Horizontal","Connector_FFC-FPC/Jushuo_AFC07-S24FCA-00_1x24-1MP_P0.50_Horizontal","Connector_FFC-FPC/Molex_200528-0040_1x04-1MP_P1.00mm_Horizontal","Connector_FFC-FPC/Molex_200528-0050_1x05-1MP_P1.00mm_Horizontal","Connector_FFC-FPC/Molex_200528-0060_1x06-1MP_P1.00mm_Horizontal","Connector_FFC-FPC/Molex_200528-0070_1x07-1MP_P1.00mm_Horizontal","Connector_FFC-FPC/Molex_200528-0080_1x08-1MP_P1.00mm_Horizontal","Connector_FFC-FPC/Molex_200528-0090_1x09-1MP_P1.00mm_Horizontal","Connector_FFC-FPC/Molex_200528-0100_1x10-1MP_P1.00mm_Horizontal","Connector_FFC-FPC/Molex_200528-0110_1x11-1MP_P1.00mm_Horizontal","Connector_FFC-FPC/Molex_200528-0120_1x12-1MP_P1.00mm_Horizontal","Connector_FFC-FPC/Molex_200528-0130_1x13-1MP_P1.00mm_Horizontal","Connector_FFC-FPC/Molex_200528-0140_1x14-1MP_P1.00mm_Horizontal","Connector_FFC-FPC/Molex_200528-0150_1x15-1MP_P1.00mm_Horizontal","Connector_FFC-FPC/Molex_200528-0160_1x16-1MP_P1.00mm_Horizontal","Connector_FFC-FPC/Molex_200528-0170_1x17-1MP_P1.00mm_Horizontal","Connector_FFC-FPC/Molex_200528-0180_1x18-1MP_P1.00mm_Horizontal","Connector_FFC-FPC/Molex_200528-0190_1x19-1MP_P1.00mm_Horizontal","Connector_FFC-FPC/Molex_200528-0200_1x20-1MP_P1.00mm_Horizontal","Connector_FFC-FPC/Molex_200528-0210_1x21-1MP_P1.00mm_Horizontal","Connector_FFC-FPC/Molex_200528-0220_1x22-1MP_P1.00mm_Horizontal","Connector_FFC-FPC/Molex_200528-0230_1x23-1MP_P1.00mm_Horizontal","Connector_FFC-FPC/Molex_200528-0240_1x24-1MP_P1.00mm_Horizontal","Connector_FFC-FPC/Molex_200528-0250_1x25-1MP_P1.00mm_Horizontal","Connector_FFC-FPC/Molex_200528-0260_1x26-1MP_P1.00mm_Horizontal","Connector_FFC-FPC/Molex_200528-0270_1x27-1MP_P1.00mm_Horizontal","Connector_FFC-FPC/Molex_200528-0280_1x28-1MP_P1.00mm_Horizontal","Connector_FFC-FPC/Molex_200528-0290_1x29-1MP_P1.00mm_Horizontal","Connector_FFC-FPC/Molex_200528-0300_1x30-1MP_P1.00mm_Horizontal","Connector_FFC-FPC/Molex_502231-1500_1x15-1SH_P0.5mm_Vertical","Connector_FFC-FPC/Molex_502231-2400_1x24-1SH_P0.5mm_Vertical","Connector_FFC-FPC/Molex_502231-3300_1x33-1SH_P0.5mm_Vertical","Connector_FFC-FPC/Molex_502244-1530_1x15-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Molex_502244-2430_1x24-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Molex_502244-3330_1x33-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Molex_502250-1791_2Rows-17Pins-1MP_P0.60mm_Horizontal","Connector_FFC-FPC/Molex_502250-2191_2Rows-21Pins-1MP_P0.60mm_Horizontal","Connector_FFC-FPC/Molex_502250-2391_2Rows-23Pins-1MP_P0.60mm_Horizontal","Connector_FFC-FPC/Molex_502250-2791_2Rows-27Pins-1MP_P0.60mm_Horizontal","Connector_FFC-FPC/Molex_502250-3391_2Rows-33Pins-1MP_P0.60mm_Horizontal","Connector_FFC-FPC/Molex_502250-3591_2Rows-35Pins-1MP_P0.60mm_Horizontal","Connector_FFC-FPC/Molex_502250-3991_2Rows-39Pins-1MP_P0.60mm_Horizontal","Connector_FFC-FPC/Molex_502250-4191_2Rows-41Pins-1MP_P0.60mm_Horizontal","Connector_FFC-FPC/Molex_502250-5191_2Rows-51Pins-1MP_P0.60mm_Horizontal","Connector_FFC-FPC/Molex_52559-3652_2x18-1MP_P0.5mm_Vertical","Connector_FFC-FPC/Molex_54132-5033_1x50-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Molex_54548-1071_1x10-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/Omron_XF2M-4015-1A_1x40-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/TE_0-1734839-5_1x05-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/TE_0-1734839-6_1x06-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/TE_0-1734839-7_1x07-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/TE_0-1734839-8_1x08-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/TE_0-1734839-9_1x09-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/TE_1-1734839-0_1x10-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/TE_1-1734839-1_1x11-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/TE_1-1734839-2_1x12-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/TE_1-1734839-3_1x13-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/TE_1-1734839-4_1x14-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/TE_1-1734839-5_1x15-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/TE_1-1734839-6_1x16-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/TE_1-1734839-7_1x17-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/TE_1-1734839-8_1x18-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/TE_1-1734839-9_1x19-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/TE_1-84952-0_1x10-1MP_P1.0mm_Horizontal","Connector_FFC-FPC/TE_1-84952-1_1x11-1MP_P1.0mm_Horizontal","Connector_FFC-FPC/TE_1-84952-2_1x12-1MP_P1.0mm_Horizontal","Connector_FFC-FPC/TE_1-84952-3_1x13-1MP_P1.0mm_Horizontal","Connector_FFC-FPC/TE_1-84952-4_1x14-1MP_P1.0mm_Horizontal","Connector_FFC-FPC/TE_1-84952-5_1x15-1MP_P1.0mm_Horizontal","Connector_FFC-FPC/TE_1-84952-6_1x16-1MP_P1.0mm_Horizontal","Connector_FFC-FPC/TE_1-84952-7_1x17-1MP_P1.0mm_Horizontal","Connector_FFC-FPC/TE_1-84952-8_1x18-1MP_P1.0mm_Horizontal","Connector_FFC-FPC/TE_1-84952-9_1x19-1MP_P1.0mm_Horizontal","Connector_FFC-FPC/TE_1-84953-0_1x10-1MP_P1.0mm_Horizontal","Connector_FFC-FPC/TE_1-84953-1_1x11-1MP_P1.0mm_Horizontal","Connector_FFC-FPC/TE_1-84953-2_1x12-1MP_P1.0mm_Horizontal","Connector_FFC-FPC/TE_1-84953-3_1x13-1MP_P1.0mm_Horizontal","Connector_FFC-FPC/TE_1-84953-4_1x14-1MP_P1.0mm_Horizontal","Connector_FFC-FPC/TE_1-84953-5_1x15-1MP_P1.0mm_Horizontal","Connector_FFC-FPC/TE_1-84953-6_1x16-1MP_P1.0mm_Horizontal","Connector_FFC-FPC/TE_1-84953-7_1x17-1MP_P1.0mm_Horizontal","Connector_FFC-FPC/TE_1-84953-8_1x18-1MP_P1.0mm_Horizontal","Connector_FFC-FPC/TE_1-84953-9_1x19-1MP_P1.0mm_Horizontal","Connector_FFC-FPC/TE_1-84982-0_2Rows-10Pins-P1.0mm_Vertical","Connector_FFC-FPC/TE_1-84982-1_2Rows-11Pins-P1.0mm_Vertical","Connector_FFC-FPC/TE_1-84982-2_2Rows-12Pins-P1.0mm_Vertical","Connector_FFC-FPC/TE_1-84982-3_2Rows-13Pins-P1.0mm_Vertical","Connector_FFC-FPC/TE_1-84982-4_2Rows-14Pins-P1.0mm_Vertical","Connector_FFC-FPC/TE_1-84982-5_2Rows-15Pins-P1.0mm_Vertical","Connector_FFC-FPC/TE_1-84982-6_2Rows-16Pins-P1.0mm_Vertical","Connector_FFC-FPC/TE_1-84982-7_2Rows-17Pins-P1.0mm_Vertical","Connector_FFC-FPC/TE_1-84982-8_2Rows-18Pins-P1.0mm_Vertical","Connector_FFC-FPC/TE_1-84982-9_2Rows-19Pins-P1.0mm_Vertical","Connector_FFC-FPC/TE_2-1734839-0_1x20-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/TE_2-1734839-1_1x21-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/TE_2-1734839-2_1x22-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/TE_2-1734839-3_1x23-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/TE_2-1734839-4_1x24-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/TE_2-1734839-5_1x25-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/TE_2-1734839-6_1x26-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/TE_2-1734839-7_1x27-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/TE_2-1734839-8_1x28-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/TE_2-1734839-9_1x29-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/TE_2-84952-0_1x20-1MP_P1.0mm_Horizontal","Connector_FFC-FPC/TE_2-84952-1_1x21-1MP_P1.0mm_Horizontal","Connector_FFC-FPC/TE_2-84952-2_1x22-1MP_P1.0mm_Horizontal","Connector_FFC-FPC/TE_2-84952-3_1x23-1MP_P1.0mm_Horizontal","Connector_FFC-FPC/TE_2-84952-4_1x24-1MP_P1.0mm_Horizontal","Connector_FFC-FPC/TE_2-84952-5_1x25-1MP_P1.0mm_Horizontal","Connector_FFC-FPC/TE_2-84952-6_1x26-1MP_P1.0mm_Horizontal","Connector_FFC-FPC/TE_2-84952-7_1x27-1MP_P1.0mm_Horizontal","Connector_FFC-FPC/TE_2-84952-8_1x28-1MP_P1.0mm_Horizontal","Connector_FFC-FPC/TE_2-84952-9_1x29-1MP_P1.0mm_Horizontal","Connector_FFC-FPC/TE_2-84953-0_1x20-1MP_P1.0mm_Horizontal","Connector_FFC-FPC/TE_2-84953-1_1x21-1MP_P1.0mm_Horizontal","Connector_FFC-FPC/TE_2-84953-2_1x22-1MP_P1.0mm_Horizontal","Connector_FFC-FPC/TE_2-84953-3_1x23-1MP_P1.0mm_Horizontal","Connector_FFC-FPC/TE_2-84953-4_1x24-1MP_P1.0mm_Horizontal","Connector_FFC-FPC/TE_2-84953-5_1x25-1MP_P1.0mm_Horizontal","Connector_FFC-FPC/TE_2-84953-6_1x26-1MP_P1.0mm_Horizontal","Connector_FFC-FPC/TE_2-84953-7_1x27-1MP_P1.0mm_Horizontal","Connector_FFC-FPC/TE_2-84953-8_1x28-1MP_P1.0mm_Horizontal","Connector_FFC-FPC/TE_2-84953-9_1x29-1MP_P1.0mm_Horizontal","Connector_FFC-FPC/TE_2-84982-0_2Rows-20Pins-P1.0mm_Vertical","Connector_FFC-FPC/TE_2-84982-1_2Rows-21Pins-P1.0mm_Vertical","Connector_FFC-FPC/TE_2-84982-2_2Rows-22Pins-P1.0mm_Vertical","Connector_FFC-FPC/TE_2-84982-3_2Rows-23Pins-P1.0mm_Vertical","Connector_FFC-FPC/TE_2-84982-4_2Rows-24Pins-P1.0mm_Vertical","Connector_FFC-FPC/TE_2-84982-5_2Rows-25Pins-P1.0mm_Vertical","Connector_FFC-FPC/TE_2-84982-6_2Rows-26Pins-P1.0mm_Vertical","Connector_FFC-FPC/TE_2-84982-7_2Rows-27Pins-P1.0mm_Vertical","Connector_FFC-FPC/TE_2-84982-8_2Rows-28Pins-P1.0mm_Vertical","Connector_FFC-FPC/TE_2-84982-9_2Rows-29Pins-P1.0mm_Vertical","Connector_FFC-FPC/TE_3-1734839-0_1x30-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/TE_3-1734839-1_1x31-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/TE_3-1734839-2_1x32-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/TE_3-1734839-3_1x33-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/TE_3-1734839-4_1x34-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/TE_3-1734839-5_1x35-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/TE_3-1734839-6_1x36-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/TE_3-1734839-7_1x37-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/TE_3-1734839-8_1x38-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/TE_3-1734839-9_1x39-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/TE_3-84952-0_1x30-1MP_P1.0mm_Horizontal","Connector_FFC-FPC/TE_3-84953-0_1x30-1MP_P1.0mm_Horizontal","Connector_FFC-FPC/TE_3-84982-0_2Rows-30Pins-P1.0mm_Vertical","Connector_FFC-FPC/TE_4-1734839-0_1x40-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/TE_4-1734839-1_1x41-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/TE_4-1734839-2_1x42-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/TE_4-1734839-3_1x43-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/TE_4-1734839-4_1x44-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/TE_4-1734839-5_1x45-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/TE_4-1734839-6_1x46-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/TE_4-1734839-7_1x47-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/TE_4-1734839-8_1x48-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/TE_4-1734839-9_1x49-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/TE_5-1734839-0_1x50-1MP_P0.5mm_Horizontal","Connector_FFC-FPC/TE_84952-4_1x04-1MP_P1.0mm_Horizontal","Connector_FFC-FPC/TE_84952-5_1x05-1MP_P1.0mm_Horizontal","Connector_FFC-FPC/TE_84952-6_1x06-1MP_P1.0mm_Horizontal","Connector_FFC-FPC/TE_84952-7_1x07-1MP_P1.0mm_Horizontal","Connector_FFC-FPC/TE_84952-8_1x08-1MP_P1.0mm_Horizontal","Connector_FFC-FPC/TE_84952-9_1x09-1MP_P1.0mm_Horizontal","Connector_FFC-FPC/TE_84953-4_1x04-1MP_P1.0mm_Horizontal","Connector_FFC-FPC/TE_84953-5_1x05-1MP_P1.0mm_Horizontal","Connector_FFC-FPC/TE_84953-6_1x06-1MP_P1.0mm_Horizontal","Connector_FFC-FPC/TE_84953-7_1x07-1MP_P1.0mm_Horizontal","Connector_FFC-FPC/TE_84953-8_1x08-1MP_P1.0mm_Horizontal","Connector_FFC-FPC/TE_84953-9_1x09-1MP_P1.0mm_Horizontal","Connector_FFC-FPC/TE_84982-4_2Rows-04Pins-P1.0mm_Vertical","Connector_FFC-FPC/TE_84982-5_2Rows-05Pins-P1.0mm_Vertical","Connector_FFC-FPC/TE_84982-6_2Rows-06Pins-P1.0mm_Vertical","Connector_FFC-FPC/TE_84982-7_2Rows-07Pins-P1.0mm_Vertical","Connector_FFC-FPC/TE_84982-8_2Rows-08Pins-P1.0mm_Vertical","Connector_FFC-FPC/TE_84982-9_2Rows-09Pins-P1.0mm_Vertical","Connector_FFC-FPC/Wuerth_68611214422_1x12-1MP_P1.0mm_Horizontal","Connector_Harting/Harting_har-flexicon_14110213001xxx_1x02-MP_P2.54mm_Vertical","Connector_Harting/Harting_har-flexicon_14110213002xxx_1x02-MP_P2.54mm_Horizontal","Connector_Harting/Harting_har-flexicon_14110213010xxx_1x02-MP_P2.54mm_Horizontal","Connector_Harting/Harting_har-flexicon_14110313001xxx_1x03-MP_P2.54mm_Vertical","Connector_Harting/Harting_har-flexicon_14110313002xxx_1x03-MP_P2.54mm_Horizontal","Connector_Harting/Harting_har-flexicon_14110313010xxx_1x03-MP_P2.54mm_Horizontal","Connector_Harting/Harting_har-flexicon_14110413001xxx_1x04-MP_P2.54mm_Vertical","Connector_Harting/Harting_har-flexicon_14110413002xxx_1x04-MP_P2.54mm_Horizontal","Connector_Harting/Harting_har-flexicon_14110413010xxx_1x04-MP_P2.54mm_Horizontal","Connector_Harting/Harting_har-flexicon_14110513001xxx_1x05-MP_P2.54mm_Vertical","Connector_Harting/Harting_har-flexicon_14110513002xxx_1x05-MP_P2.54mm_Horizontal","Connector_Harting/Harting_har-flexicon_14110513010xxx_1x05-MP_P2.54mm_Horizontal","Connector_Harting/Harting_har-flexicon_14110613001xxx_1x06-MP_P2.54mm_Vertical","Connector_Harting/Harting_har-flexicon_14110613002xxx_1x06-MP_P2.54mm_Horizontal","Connector_Harting/Harting_har-flexicon_14110613010xxx_1x06-MP_P2.54mm_Horizontal","Connector_Harting/Harting_har-flexicon_14110713001xxx_1x07-MP_P2.54mm_Vertical","Connector_Harting/Harting_har-flexicon_14110713002xxx_1x07-MP_P2.54mm_Horizontal","Connector_Harting/Harting_har-flexicon_14110713010xxx_1x07-MP_P2.54mm_Horizontal","Connector_Harting/Harting_har-flexicon_14110813001xxx_1x08-MP_P2.54mm_Vertical","Connector_Harting/Harting_har-flexicon_14110813002xxx_1x08-MP_P2.54mm_Horizontal","Connector_Harting/Harting_har-flexicon_14110813010xxx_1x08-MP_P2.54mm_Horizontal","Connector_Harting/Harting_har-flexicon_14110913001xxx_1x09-MP_P2.54mm_Vertical","Connector_Harting/Harting_har-flexicon_14110913002xxx_1x09-MP_P2.54mm_Horizontal","Connector_Harting/Harting_har-flexicon_14110913010xxx_1x09-MP_P2.54mm_Horizontal","Connector_Harting/Harting_har-flexicon_14111013001xxx_1x10-MP_P2.54mm_Vertical","Connector_Harting/Harting_har-flexicon_14111013002xxx_1x10-MP_P2.54mm_Horizontal","Connector_Harting/Harting_har-flexicon_14111013010xxx_1x10-MP_P2.54mm_Horizontal","Connector_Harting/Harting_har-flexicon_14111113001xxx_1x11-MP_P2.54mm_Vertical","Connector_Harting/Harting_har-flexicon_14111113002xxx_1x11-MP_P2.54mm_Horizontal","Connector_Harting/Harting_har-flexicon_14111113010xxx_1x11-MP_P2.54mm_Horizontal","Connector_Harting/Harting_har-flexicon_14111213001xxx_1x12-MP_P2.54mm_Vertical","Connector_Harting/Harting_har-flexicon_14111213002xxx_1x12-MP_P2.54mm_Horizontal","Connector_Harting/Harting_har-flexicon_14111213010xxx_1x12-MP_P2.54mm_Horizontal","Connector_Harwin/Harwin_Gecko-G125-FVX0605L0X_2x03_P1.25mm_Vertical","Connector_Harwin/Harwin_Gecko-G125-FVX1005L0X_2x05_P1.25mm_Vertical","Connector_Harwin/Harwin_Gecko-G125-FVX1205L0X_2x06_P1.25mm_Vertical","Connector_Harwin/Harwin_Gecko-G125-FVX1605L0X_2x08_P1.25mm_Vertical","Connector_Harwin/Harwin_Gecko-G125-FVX2005L0X_2x10_P1.25mm_Vertical","Connector_Harwin/Harwin_Gecko-G125-FVX2605L0X_2x13_P1.25mm_Vertical","Connector_Harwin/Harwin_Gecko-G125-FVX3405L0X_2x17_P1.25mm_Vertical","Connector_Harwin/Harwin_Gecko-G125-FVX5005L0X_2x25_P1.25mm_Vertical","Connector_Harwin/Harwin_Gecko-G125-MVX0605L0X_2x03_P1.25mm_Vertical","Connector_Harwin/Harwin_Gecko-G125-MVX0605L1X_2x03_P1.25mm_Vertical","Connector_Harwin/Harwin_Gecko-G125-MVX1005L0X_2x05_P1.25mm_Vertical","Connector_Harwin/Harwin_Gecko-G125-MVX1005L1X_2x05_P1.25mm_Vertical","Connector_Harwin/Harwin_Gecko-G125-MVX1205L0X_2x06_P1.25mm_Vertical","Connector_Harwin/Harwin_Gecko-G125-MVX1205L1X_2x06_P1.25mm_Vertical","Connector_Harwin/Harwin_Gecko-G125-MVX1605L0X_2x08_P1.25mm_Vertical","Connector_Harwin/Harwin_Gecko-G125-MVX1605L1X_2x08_P1.25mm_Vertical","Connector_Harwin/Harwin_Gecko-G125-MVX2005L0X_2x10_P1.25mm_Vertical","Connector_Harwin/Harwin_Gecko-G125-MVX2005L1X_2x10_P1.25mm_Vertical","Connector_Harwin/Harwin_Gecko-G125-MVX2605L0X_2x13_P1.25mm_Vertical","Connector_Harwin/Harwin_Gecko-G125-MVX2605L1X_2x13_P1.25mm_Vertical","Connector_Harwin/Harwin_Gecko-G125-MVX3405L0X_2x17_P1.25mm_Vertical","Connector_Harwin/Harwin_Gecko-G125-MVX3405L1X_2x17_P1.25mm_Vertical","Connector_Harwin/Harwin_Gecko-G125-MVX5005L0X_2x25_P1.25mm_Vertical","Connector_Harwin/Harwin_Gecko-G125-MVX5005L1X_2x25_P1.25mm_Vertical","Connector_Harwin/Harwin_Gecko_G125-MS10605M2P_2x03_P1.25mm_Vertical","Connector_Harwin/Harwin_Gecko_G125-MS11005M2P_2x05_P1.25mm_Vertical","Connector_Harwin/Harwin_Gecko_G125-MS11205M2P_2x06_P1.25mm_Vertical","Connector_Harwin/Harwin_Gecko_G125-MS11605M2P_2x08_P1.25mm_Vertical","Connector_Harwin/Harwin_Gecko_G125-MS12005M2P_2x10_P1.25mm_Vertical","Connector_Harwin/Harwin_Gecko_G125-MS12605M2P_2x13_P1.25mm_Vertical","Connector_Harwin/Harwin_Gecko_G125-MS13405M2P_2x17_P1.25mm_Vertical","Connector_Harwin/Harwin_Gecko_G125-MS15005M2P_2x25_P1.25mm_Vertical","Connector_Harwin/Harwin_LTek-Male_02_P2.00mm_Vertical","Connector_Harwin/Harwin_LTek-Male_02_P2.00mm_Vertical_StrainRelief","Connector_Harwin/Harwin_LTek-Male_03_P2.00mm_Vertical","Connector_Harwin/Harwin_LTek-Male_03_P2.00mm_Vertical_StrainRelief","Connector_Harwin/Harwin_LTek-Male_04_P2.00mm_Vertical","Connector_Harwin/Harwin_LTek-Male_04_P2.00mm_Vertical_StrainRelief","Connector_Harwin/Harwin_LTek-Male_05_P2.00mm_Vertical","Connector_Harwin/Harwin_LTek-Male_05_P2.00mm_Vertical_StrainRelief","Connector_Harwin/Harwin_LTek-Male_06_P2.00mm_Vertical","Connector_Harwin/Harwin_LTek-Male_06_P2.00mm_Vertical_StrainRelief","Connector_Harwin/Harwin_LTek-Male_07_P2.00mm_Vertical","Connector_Harwin/Harwin_LTek-Male_07_P2.00mm_Vertical_StrainRelief","Connector_Harwin/Harwin_LTek-Male_17_P2.00mm_Vertical","Connector_Harwin/Harwin_LTek-Male_17_P2.00mm_Vertical_StrainRelief","Connector_Harwin/Harwin_LTek-Male_22_P2.00mm_Vertical","Connector_Harwin/Harwin_LTek-Male_22_P2.00mm_Vertical_StrainRelief","Connector_Harwin/Harwin_LTek-Male_2x02_P2.00mm_Vertical","Connector_Harwin/Harwin_LTek-Male_2x02_P2.00mm_Vertical_StrainRelief","Connector_Harwin/Harwin_LTek-Male_2x03_P2.00mm_Vertical","Connector_Harwin/Harwin_LTek-Male_2x03_P2.00mm_Vertical_StrainRelief","Connector_Harwin/Harwin_LTek-Male_2x04_P2.00mm_Vertical","Connector_Harwin/Harwin_LTek-Male_2x04_P2.00mm_Vertical_StrainRelief","Connector_Harwin/Harwin_LTek-Male_2x05_P2.00mm_Vertical","Connector_Harwin/Harwin_LTek-Male_2x05_P2.00mm_Vertical_StrainRelief","Connector_Harwin/Harwin_LTek-Male_2x06_P2.00mm_Vertical","Connector_Harwin/Harwin_LTek-Male_2x06_P2.00mm_Vertical_StrainRelief","Connector_Harwin/Harwin_LTek-Male_2x07_P2.00mm_Vertical","Connector_Harwin/Harwin_LTek-Male_2x07_P2.00mm_Vertical_StrainRelief","Connector_Harwin/Harwin_LTek-Male_2x08_P2.00mm_Vertical","Connector_Harwin/Harwin_LTek-Male_2x08_P2.00mm_Vertical_StrainRelief","Connector_Harwin/Harwin_LTek-Male_2x09_P2.00mm_Vertical","Connector_Harwin/Harwin_LTek-Male_2x09_P2.00mm_Vertical_StrainRelief","Connector_Harwin/Harwin_LTek-Male_2x10_P2.00mm_Vertical","Connector_Harwin/Harwin_LTek-Male_2x10_P2.00mm_Vertical_StrainRelief","Connector_Harwin/Harwin_LTek-Male_2x13_P2.00mm_Vertical","Connector_Harwin/Harwin_LTek-Male_2x13_P2.00mm_Vertical_StrainRelief","Connector_Harwin/Harwin_LTek-Male_2x17_P2.00mm_Vertical","Connector_Harwin/Harwin_LTek-Male_2x17_P2.00mm_Vertical_StrainRelief","Connector_Harwin/Harwin_LTek-Male_2x22_P2.00mm_Vertical","Connector_Harwin/Harwin_LTek-Male_2x22_P2.00mm_Vertical_StrainRelief","Connector_Harwin/Harwin_M20-7810245_2x02_P2.54mm_Vertical","Connector_Harwin/Harwin_M20-7810345_2x03_P2.54mm_Vertical","Connector_Harwin/Harwin_M20-7810445_2x04_P2.54mm_Vertical","Connector_Harwin/Harwin_M20-7810545_2x05_P2.54mm_Vertical","Connector_Harwin/Harwin_M20-7810645_2x06_P2.54mm_Vertical","Connector_Harwin/Harwin_M20-7810745_2x07_P2.54mm_Vertical","Connector_Harwin/Harwin_M20-7810845_2x08_P2.54mm_Vertical","Connector_Harwin/Harwin_M20-7810945_2x09_P2.54mm_Vertical","Connector_Harwin/Harwin_M20-7811045_2x10_P2.54mm_Vertical","Connector_Harwin/Harwin_M20-7811245_2x12_P2.54mm_Vertical","Connector_Harwin/Harwin_M20-7811545_2x15_P2.54mm_Vertical","Connector_Harwin/Harwin_M20-7812045_2x20_P2.54mm_Vertical","Connector_Harwin/Harwin_M20-89003xx_1x03_P2.54mm_Horizontal","Connector_Harwin/Harwin_M20-89004xx_1x04_P2.54mm_Horizontal","Connector_Harwin/Harwin_M20-89005xx_1x05_P2.54mm_Horizontal","Connector_Harwin/Harwin_M20-89006xx_1x06_P2.54mm_Horizontal","Connector_Harwin/Harwin_M20-89007xx_1x07_P2.54mm_Horizontal","Connector_Harwin/Harwin_M20-89008xx_1x08_P2.54mm_Horizontal","Connector_Harwin/Harwin_M20-89009xx_1x09_P2.54mm_Horizontal","Connector_Harwin/Harwin_M20-89010xx_1x10_P2.54mm_Horizontal","Connector_Harwin/Harwin_M20-89011xx_1x11_P2.54mm_Horizontal","Connector_Harwin/Harwin_M20-89012xx_1x12_P2.54mm_Horizontal","Connector_Harwin/Harwin_M20-89013xx_1x13_P2.54mm_Horizontal","Connector_Harwin/Harwin_M20-89014xx_1x14_P2.54mm_Horizontal","Connector_Harwin/Harwin_M20-89015xx_1x15_P2.54mm_Horizontal","Connector_Harwin/Harwin_M20-89016xx_1x16_P2.54mm_Horizontal","Connector_Harwin/Harwin_M20-89017xx_1x17_P2.54mm_Horizontal","Connector_Harwin/Harwin_M20-89018xx_1x18_P2.54mm_Horizontal","Connector_Harwin/Harwin_M20-89019xx_1x19_P2.54mm_Horizontal","Connector_Harwin/Harwin_M20-89020xx_1x20_P2.54mm_Horizontal","Connector_Hirose/Hirose_BM23FR0.6-16DP-0.35V_2x08_1MP_Vertical","Connector_Hirose/Hirose_BM23FR0.6-16DS-0.35V_2x08_P0.35_1MP_Vertical","Connector_Hirose/Hirose_BM24_BM24-40DP-2-0.35V_2x20_P0.35mm_PowerPin2_Vertical","Connector_Hirose/Hirose_BM24_BM24-40DS-2-0.35V_2x20_P0.35mm_PowerPin2_Vertical","Connector_Hirose/Hirose_DF11-10DP-2DSA_2x05_P2.00mm_Vertical","Connector_Hirose/Hirose_DF11-12DP-2DSA_2x06_P2.00mm_Vertical","Connector_Hirose/Hirose_DF11-14DP-2DSA_2x07_P2.00mm_Vertical","Connector_Hirose/Hirose_DF11-16DP-2DSA_2x08_P2.00mm_Vertical","Connector_Hirose/Hirose_DF11-18DP-2DSA_2x09_P2.00mm_Vertical","Connector_Hirose/Hirose_DF11-20DP-2DSA_2x10_P2.00mm_Vertical","Connector_Hirose/Hirose_DF11-22DP-2DSA_2x11_P2.00mm_Vertical","Connector_Hirose/Hirose_DF11-24DP-2DSA_2x12_P2.00mm_Vertical","Connector_Hirose/Hirose_DF11-26DP-2DSA_2x13_P2.00mm_Vertical","Connector_Hirose/Hirose_DF11-28DP-2DSA_2x14_P2.00mm_Vertical","Connector_Hirose/Hirose_DF11-30DP-2DSA_2x15_P2.00mm_Vertical","Connector_Hirose/Hirose_DF11-32DP-2DSA_2x16_P2.00mm_Vertical","Connector_Hirose/Hirose_DF11-4DP-2DSA_2x02_P2.00mm_Vertical","Connector_Hirose/Hirose_DF11-6DP-2DSA_2x03_P2.00mm_Vertical","Connector_Hirose/Hirose_DF11-8DP-2DSA_2x04_P2.00mm_Vertical","Connector_Hirose/Hirose_DF12_DF12C3.0-10DS-0.5V_2x05_P0.50mm_Vertical","Connector_Hirose/Hirose_DF12_DF12C3.0-14DS-0.5V_2x07_P0.50mm_Vertical","Connector_Hirose/Hirose_DF12_DF12C3.0-20DS-0.5V_2x10_P0.50mm_Vertical","Connector_Hirose/Hirose_DF12_DF12C3.0-30DS-0.5V_2x15_P0.50mm_Vertical","Connector_Hirose/Hirose_DF12_DF12C3.0-32DS-0.5V_2x16_P0.50mm_Vertical","Connector_Hirose/Hirose_DF12_DF12C3.0-36DS-0.5V_2x18_P0.50mm_Vertical","Connector_Hirose/Hirose_DF12_DF12C3.0-40DS-0.5V_2x20_P0.50mm_Vertical","Connector_Hirose/Hirose_DF12_DF12C3.0-50DS-0.5V_2x25_P0.50mm_Vertical","Connector_Hirose/Hirose_DF12_DF12C3.0-60DS-0.5V_2x30_P0.50mm_Vertical","Connector_Hirose/Hirose_DF12_DF12E3.0-10DP-0.5V_2x05_P0.50mm_Vertical","Connector_Hirose/Hirose_DF12_DF12E3.0-14DP-0.5V_2x07_P0.50mm_Vertical","Connector_Hirose/Hirose_DF12_DF12E3.0-20DP-0.5V_2x10_P0.50mm_Vertical","Connector_Hirose/Hirose_DF12_DF12E3.0-30DP-0.5V_2x15_P0.50mm_Vertical","Connector_Hirose/Hirose_DF12_DF12E3.0-32DP-0.5V_2x16_P0.50mm_Vertical","Connector_Hirose/Hirose_DF12_DF12E3.0-36DP-0.5V_2x18_P0.50mm_Vertical","Connector_Hirose/Hirose_DF12_DF12E3.0-40DP-0.5V_2x20_P0.50mm_Vertical","Connector_Hirose/Hirose_DF12_DF12E3.0-50DP-0.5V_2x25_P0.50mm_Vertical","Connector_Hirose/Hirose_DF12_DF12E3.0-60DP-0.5V_2x30_P0.50mm_Vertical","Connector_Hirose/Hirose_DF12_DF12E3.0-80DP-0.5V_2x40_P0.50mm_Vertical","Connector_Hirose/Hirose_DF13-02P-1.25DSA_1x02_P1.25mm_Vertical","Connector_Hirose/Hirose_DF13-02P-1.25DS_1x02_P1.25mm_Horizontal","Connector_Hirose/Hirose_DF13-03P-1.25DSA_1x03_P1.25mm_Vertical","Connector_Hirose/Hirose_DF13-03P-1.25DS_1x03_P1.25mm_Horizontal","Connector_Hirose/Hirose_DF13-04P-1.25DSA_1x04_P1.25mm_Vertical","Connector_Hirose/Hirose_DF13-04P-1.25DS_1x04_P1.25mm_Horizontal","Connector_Hirose/Hirose_DF13-05P-1.25DSA_1x05_P1.25mm_Vertical","Connector_Hirose/Hirose_DF13-05P-1.25DS_1x05_P1.25mm_Horizontal","Connector_Hirose/Hirose_DF13-06P-1.25DSA_1x06_P1.25mm_Vertical","Connector_Hirose/Hirose_DF13-06P-1.25DS_1x06_P1.25mm_Horizontal","Connector_Hirose/Hirose_DF13-07P-1.25DSA_1x07_P1.25mm_Vertical","Connector_Hirose/Hirose_DF13-07P-1.25DS_1x07_P1.25mm_Horizontal","Connector_Hirose/Hirose_DF13-08P-1.25DSA_1x08_P1.25mm_Vertical","Connector_Hirose/Hirose_DF13-08P-1.25DS_1x08_P1.25mm_Horizontal","Connector_Hirose/Hirose_DF13-09P-1.25DSA_1x09_P1.25mm_Vertical","Connector_Hirose/Hirose_DF13-09P-1.25DS_1x09_P1.25mm_Horizontal","Connector_Hirose/Hirose_DF13-10P-1.25DSA_1x10_P1.25mm_Vertical","Connector_Hirose/Hirose_DF13-10P-1.25DS_1x10_P1.25mm_Horizontal","Connector_Hirose/Hirose_DF13-11P-1.25DSA_1x11_P1.25mm_Vertical","Connector_Hirose/Hirose_DF13-11P-1.25DS_1x11_P1.25mm_Horizontal","Connector_Hirose/Hirose_DF13-12P-1.25DSA_1x12_P1.25mm_Vertical","Connector_Hirose/Hirose_DF13-12P-1.25DS_1x12_P1.25mm_Horizontal","Connector_Hirose/Hirose_DF13-13P-1.25DSA_1x13_P1.25mm_Vertical","Connector_Hirose/Hirose_DF13-14P-1.25DSA_1x14_P1.25mm_Vertical","Connector_Hirose/Hirose_DF13-14P-1.25DS_1x14_P1.25mm_Horizontal","Connector_Hirose/Hirose_DF13-15P-1.25DSA_1x15_P1.25mm_Vertical","Connector_Hirose/Hirose_DF13-15P-1.25DS_1x15_P1.25mm_Horizontal","Connector_Hirose/Hirose_DF13C_CL535-0402-2-51_1x02-1MP_P1.25mm_Vertical","Connector_Hirose/Hirose_DF13C_CL535-0403-5-51_1x03-1MP_P1.25mm_Vertical","Connector_Hirose/Hirose_DF13C_CL535-0404-8-51_1x04-1MP_P1.25mm_Vertical","Connector_Hirose/Hirose_DF13C_CL535-0405-0-51_1x05-1MP_P1.25mm_Vertical","Connector_Hirose/Hirose_DF13C_CL535-0406-3-51_1x06-1MP_P1.25mm_Vertical","Connector_Hirose/Hirose_DF13C_CL535-0407-6-51_1x07-1MP_P1.25mm_Vertical","Connector_Hirose/Hirose_DF13C_CL535-0408-9-51_1x08-1MP_P1.25mm_Vertical","Connector_Hirose/Hirose_DF13C_CL535-0409-1-51_1x09-1MP_P1.25mm_Vertical","Connector_Hirose/Hirose_DF13C_CL535-0410-4-51_1x10-1MP_P1.25mm_Vertical","Connector_Hirose/Hirose_DF13C_CL535-0411-3-51_1x11-1MP_P1.25mm_Vertical","Connector_Hirose/Hirose_DF13C_CL535-0412-6-51_1x12-1MP_P1.25mm_Vertical","Connector_Hirose/Hirose_DF13C_CL535-0414-1-51_1x14-1MP_P1.25mm_Vertical","Connector_Hirose/Hirose_DF13C_CL535-0415-4-51_1x15-1MP_P1.25mm_Vertical","Connector_Hirose/Hirose_DF3EA-02P-2H_1x02-1MP_P2.00mm_Horizontal","Connector_Hirose/Hirose_DF3EA-02P-2V_1x02-1MP_P2.00mm_Vertical","Connector_Hirose/Hirose_DF3EA-03P-2H_1x03-1MP_P2.00mm_Horizontal","Connector_Hirose/Hirose_DF3EA-03P-2V_1x03-1MP_P2.00mm_Vertical","Connector_Hirose/Hirose_DF3EA-04P-2H_1x04-1MP_P2.00mm_Horizontal","Connector_Hirose/Hirose_DF3EA-04P-2V_1x04-1MP_P2.00mm_Vertical","Connector_Hirose/Hirose_DF3EA-05P-2H_1x05-1MP_P2.00mm_Horizontal","Connector_Hirose/Hirose_DF3EA-05P-2V_1x05-1MP_P2.00mm_Vertical","Connector_Hirose/Hirose_DF3EA-06P-2H_1x06-1MP_P2.00mm_Horizontal","Connector_Hirose/Hirose_DF3EA-06P-2V_1x06-1MP_P2.00mm_Vertical","Connector_Hirose/Hirose_DF3EA-07P-2H_1x07-1MP_P2.00mm_Horizontal","Connector_Hirose/Hirose_DF3EA-07P-2V_1x07-1MP_P2.00mm_Vertical","Connector_Hirose/Hirose_DF3EA-08P-2H_1x08-1MP_P2.00mm_Horizontal","Connector_Hirose/Hirose_DF3EA-08P-2V_1x08-1MP_P2.00mm_Vertical","Connector_Hirose/Hirose_DF3EA-09P-2H_1x09-1MP_P2.00mm_Horizontal","Connector_Hirose/Hirose_DF3EA-09P-2V_1x09-1MP_P2.00mm_Vertical","Connector_Hirose/Hirose_DF3EA-10P-2H_1x10-1MP_P2.00mm_Horizontal","Connector_Hirose/Hirose_DF3EA-10P-2V_1x10-1MP_P2.00mm_Vertical","Connector_Hirose/Hirose_DF3EA-11P-2H_1x11-1MP_P2.00mm_Horizontal","Connector_Hirose/Hirose_DF3EA-11P-2V_1x11-1MP_P2.00mm_Vertical","Connector_Hirose/Hirose_DF3EA-12P-2H_1x12-1MP_P2.00mm_Horizontal","Connector_Hirose/Hirose_DF3EA-12P-2V_1x12-1MP_P2.00mm_Vertical","Connector_Hirose/Hirose_DF3EA-13P-2H_1x13-1MP_P2.00mm_Horizontal","Connector_Hirose/Hirose_DF3EA-13P-2V_1x13-1MP_P2.00mm_Vertical","Connector_Hirose/Hirose_DF3EA-14P-2H_1x14-1MP_P2.00mm_Horizontal","Connector_Hirose/Hirose_DF3EA-14P-2V_1x14-1MP_P2.00mm_Vertical","Connector_Hirose/Hirose_DF3EA-15P-2H_1x15-1MP_P2.00mm_Horizontal","Connector_Hirose/Hirose_DF3EA-15P-2V_1x15-1MP_P2.00mm_Vertical","Connector_Hirose/Hirose_DF52-10S-0.8H_1x10-1MP_P0.80mm_Horizontal","Connector_Hirose/Hirose_DF52-11S-0.8H_1x11-1MP_P0.80mm_Horizontal","Connector_Hirose/Hirose_DF52-12S-0.8H_1x12-1MP_P0.80mm_Horizontal","Connector_Hirose/Hirose_DF52-14S-0.8H_1x14-1MP_P0.80mm_Horizontal","Connector_Hirose/Hirose_DF52-15S-0.8H_1x15-1MP_P0.80mm_Horizontal","Connector_Hirose/Hirose_DF52-2S-0.8H_1x02-1MP_P0.80mm_Horizontal","Connector_Hirose/Hirose_DF52-3S-0.8H_1x03-1MP_P0.80mm_Horizontal","Connector_Hirose/Hirose_DF52-4S-0.8H_1x04-1MP_P0.80mm_Horizontal","Connector_Hirose/Hirose_DF52-5S-0.8H_1x05-1MP_P0.80mm_Horizontal","Connector_Hirose/Hirose_DF52-6S-0.8H_1x06-1MP_P0.80mm_Horizontal","Connector_Hirose/Hirose_DF52-7S-0.8H_1x07-1MP_P0.80mm_Horizontal","Connector_Hirose/Hirose_DF52-8S-0.8H_1x08-1MP_P0.80mm_Horizontal","Connector_Hirose/Hirose_DF52-9S-0.8H_1x09-1MP_P0.80mm_Horizontal","Connector_Hirose/Hirose_DF57H-2P-1.2V_1x02_P1.2mm_Socket","Connector_Hirose/Hirose_DF57H-2P-2.4V_1x02_P2.4mm_Socket","Connector_Hirose/Hirose_DF57H-3P-1.2V_1x03_P1.2mm_Socket","Connector_Hirose/Hirose_DF57H-4P-1.2V_1x04_P1.2mm_Socket","Connector_Hirose/Hirose_DF57H-5P-1.2V_1x05_P1.2mm_Socket","Connector_Hirose/Hirose_DF57H-6P-1.2V_1x06_P1.2mm_Socket","Connector_Hirose/Hirose_DF63-5P-3.96DSA_1x05_P3.96mm_Vertical","Connector_Hirose/Hirose_DF63-6P-3.96DSA_1x06_P3.96mm_Vertical","Connector_Hirose/Hirose_DF63M-1P-3.96DSA_1x01_P3.96mm_Vertical","Connector_Hirose/Hirose_DF63M-2P-3.96DSA_1x02_P3.96mm_Vertical","Connector_Hirose/Hirose_DF63M-3P-3.96DSA_1x03_P3.96mm_Vertical","Connector_Hirose/Hirose_DF63M-4P-3.96DSA_1x04_P3.96mm_Vertical","Connector_Hirose/Hirose_DF63R-1P-3.96DSA_1x01_P3.96mm_Vertical","Connector_Hirose/Hirose_DF63R-2P-3.96DSA_1x02_P3.96mm_Vertical","Connector_Hirose/Hirose_DF63R-3P-3.96DSA_1x03_P3.96mm_Vertical","Connector_Hirose/Hirose_DF63R-4P-3.96DSA_1x04_P3.96mm_Vertical","Connector_Hirose/Hirose_DF63R-5P-3.96DSA_1x05_P3.96mm_Vertical","Connector_Hirose/Hirose_FX10A-120P-SV_2x60-1MP_P0.5mm","Connector_Hirose/Hirose_FX10A-120S-SV_2x60-1MP_P0.5mm","Connector_Hirose/Hirose_FX10A-144P-SV_2x72-1MP_P0.5mm","Connector_Hirose/Hirose_FX10A-144S-SV_2x72-1MP_P0.5mm","Connector_Hirose/Hirose_FX10A-168P-SV_2x84-1MP_P0.5mm","Connector_Hirose/Hirose_FX10A-168S-SV_2x84-1MP_P0.5mm","Connector_Hirose/Hirose_FX10A-96P-SV_2x48-1MP_P0.5mm","Connector_Hirose/Hirose_FX10A-96S-SV_2x48-1MP_P0.5mm","Connector_Hirose/Hirose_FX10B-120P-SV_2x60-1MP_P0.5mm","Connector_Hirose/Hirose_FX10B-120S-SV_2x60-1MP_P0.5mm","Connector_Hirose/Hirose_FX10B-144P-SV_2x72-1MP_P0.5mm","Connector_Hirose/Hirose_FX10B-144S-SV_2x72-1MP_P0.5mm","Connector_Hirose/Hirose_FX10B-168P-SV_2x84-1MP_P0.5mm","Connector_Hirose/Hirose_FX10B-168S-SV_2x84-1MP_P0.5mm","Connector_Hirose/Hirose_FX10B-96P-SV_2x48-1MP_P0.5mm","Connector_Hirose/Hirose_FX10B-96S-SV_2x48-1MP_P0.5mm","Connector_Hirose_DF40/Hirose_DF40B(2.0)-12DS-0.4V_2x06-1MP_P0.4mm","Connector_Hirose_DF40/Hirose_DF40B(2.0)-80DS-0.4V_2x40-1MP_P0.4mm","Connector_Hirose_DF40/Hirose_DF40B-10DS-0.4V_2x05-1MP_P0.4mm","Connector_Hirose_DF40/Hirose_DF40B-12DS-0.4V_2x06-1MP_P0.4mm","Connector_Hirose_DF40/Hirose_DF40B-30DS-0.4V_2x15-1MP_P0.4mm","Connector_Hirose_DF40/Hirose_DF40B-50DS-0.4V_2x25-1MP_P0.4mm","Connector_Hirose_DF40/Hirose_DF40B-60DS-0.4V_2x30-1MP_P0.4mm","Connector_Hirose_DF40/Hirose_DF40B-80DS-0.4V_2x40-1MP_P0.4mm","Connector_Hirose_DF40/Hirose_DF40C(2.0)-20DS-0.4V_2x10_P0.4mm","Connector_Hirose_DF40/Hirose_DF40C(2.0)-24DS-0.4V_2x12_P0.4mm","Connector_Hirose_DF40/Hirose_DF40C(2.0)-30DS-0.4V_2x15_P0.4mm","Connector_Hirose_DF40/Hirose_DF40C(2.0)-40DS-0.4V_2x20_P0.4mm","Connector_Hirose_DF40/Hirose_DF40C(2.0)-50DS-0.4V_2x25_P0.4mm","Connector_Hirose_DF40/Hirose_DF40C(2.0)-60DS-0.4V_2x30_P0.4mm","Connector_Hirose_DF40/Hirose_DF40C(2.0)-70DS-0.4V_2x35_P0.4mm","Connector_Hirose_DF40/Hirose_DF40C(2.0)-80DS-0.4V_2x40_P0.4mm","Connector_Hirose_DF40/Hirose_DF40C-100DP-0.4V_2x50-1MP_P0.4mm","Connector_Hirose_DF40/Hirose_DF40C-100DS-0.4V_2x50_P0.4mm","Connector_Hirose_DF40/Hirose_DF40C-10DP-0.4V_2x05-1MP_P0.4mm","Connector_Hirose_DF40/Hirose_DF40C-120DP-0.4V_2x60-1MP_P0.4mm","Connector_Hirose_DF40/Hirose_DF40C-120DS-0.4V_2x60_P0.4mm","Connector_Hirose_DF40/Hirose_DF40C-12DP-0.4V_2x06-1MP_P0.4mm","Connector_Hirose_DF40/Hirose_DF40C-20DP-0.4V_2x10-1MP_P0.4mm","Connector_Hirose_DF40/Hirose_DF40C-20DS-0.4V_2x10_P0.4mm","Connector_Hirose_DF40/Hirose_DF40C-24DP-0.4V_2x12-1MP_P0.4mm","Connector_Hirose_DF40/Hirose_DF40C-24DS-0.4V_2x12_P0.4mm","Connector_Hirose_DF40/Hirose_DF40C-30DP-0.4V_2x15-1MP_P0.4mm","Connector_Hirose_DF40/Hirose_DF40C-30DS-0.4V_2x15_P0.4mm","Connector_Hirose_DF40/Hirose_DF40C-34DP-0.4V_2x17-1MP_P0.4mm","Connector_Hirose_DF40/Hirose_DF40C-34DS-0.4V_2x17_P0.4mm","Connector_Hirose_DF40/Hirose_DF40C-40DP-0.4V_2x20-1MP_P0.4mm","Connector_Hirose_DF40/Hirose_DF40C-40DS-0.4V_2x20_P0.4mm","Connector_Hirose_DF40/Hirose_DF40C-44DP-0.4V_2x22-1MP_P0.4mm","Connector_Hirose_DF40/Hirose_DF40C-50DP-0.4V_2x25-1MP_P0.4mm","Connector_Hirose_DF40/Hirose_DF40C-50DS-0.4V_2x25_P0.4mm","Connector_Hirose_DF40/Hirose_DF40C-60DP-0.4V_2x30-1MP_P0.4mm","Connector_Hirose_DF40/Hirose_DF40C-60DS-0.4V_2x30_P0.4mm","Connector_Hirose_DF40/Hirose_DF40C-70DP-0.4V_2x35-1MP_P0.4mm","Connector_Hirose_DF40/Hirose_DF40C-70DS-0.4V_2x35_P0.4mm","Connector_Hirose_DF40/Hirose_DF40C-80DP-0.4V_2x40-1MP_P0.4mm","Connector_Hirose_DF40/Hirose_DF40C-80DS-0.4V_2x40_P0.4mm","Connector_Hirose_DF40/Hirose_DF40C-90DP-0.4V_2x45-1MP_P0.4mm","Connector_Hirose_DF40/Hirose_DF40C-90DS-0.4V_2x45_P0.4mm","Connector_Hirose_DF40/Hirose_DF40HB(2.5)-10DS-0.4V_2x05-1MP_P0.4mm","Connector_Hirose_DF40/Hirose_DF40HB(4.0)-50DS-0.4V_2x25-1MP_P0.4mm","Connector_Hirose_DF40/Hirose_DF40HC(2.5)-20DS-0.4V_2x10_P0.4mm","Connector_Hirose_DF40/Hirose_DF40HC(2.5)-30DS-0.4V_2x15_P0.4mm","Connector_Hirose_DF40/Hirose_DF40HC(2.5)-40DS-0.4V_2x20_P0.4mm","Connector_Hirose_DF40/Hirose_DF40HC(2.5)-50DS-0.4V_2x25_P0.4mm","Connector_Hirose_DF40/Hirose_DF40HC(2.5)-60DS-0.4V_2x30_P0.4mm","Connector_Hirose_DF40/Hirose_DF40HC(3.0)-100DS-0.4V_2x50_P0.4mm","Connector_Hirose_DF40/Hirose_DF40HC(3.0)-30DS-0.4V_2x15_P0.4mm","Connector_Hirose_DF40/Hirose_DF40HC(3.0)-40DS-0.4V_2x20_P0.4mm","Connector_Hirose_DF40/Hirose_DF40HC(3.0)-44DS-0.4V_2x22_P0.4mm","Connector_Hirose_DF40/Hirose_DF40HC(3.0)-50DS-0.4V_2x25_P0.4mm","Connector_Hirose_DF40/Hirose_DF40HC(3.0)-60DS-0.4V_2x30_P0.4mm","Connector_Hirose_DF40/Hirose_DF40HC(3.0)-70DS-0.4V_2x35_P0.4mm","Connector_Hirose_DF40/Hirose_DF40HC(3.0)-80DS-0.4V_2x40_P0.4mm","Connector_Hirose_DF40/Hirose_DF40HC(3.0)-90DS-0.4V_2x45_P0.4mm","Connector_Hirose_DF40/Hirose_DF40HC(3.5)-20DS-0.4V_2x10_P0.4mm","Connector_Hirose_DF40/Hirose_DF40HC(3.5)-30DS-0.4V_2x15_P0.4mm","Connector_Hirose_DF40/Hirose_DF40HC(3.5)-40DS-0.4V_2x20_P0.4mm","Connector_Hirose_DF40/Hirose_DF40HC(3.5)-50DS-0.4V_2x25_P0.4mm","Connector_Hirose_DF40/Hirose_DF40HC(3.5)-60DS-0.4V_2x30_P0.4mm","Connector_Hirose_DF40/Hirose_DF40HC(3.5)-80DS-0.4V_2x40_P0.4mm","Connector_Hirose_DF40/Hirose_DF40HC(4.0)-40DS-0.4V_2x20_P0.4mm","Connector_Hirose_DF40/Hirose_DF40HC(4.0)-50DS-0.4V_2x25_P0.4mm","Connector_Hirose_DF40/Hirose_DF40HC(4.0)-60DS-0.4V_2x30_P0.4mm","Connector_Hirose_DF40/Hirose_DF40HC(4.0)-80DS-0.4V_2x40_P0.4mm","Connector_Hirose_DF40/Hirose_DF40HC(4.0)-90DS-0.4V_2x45_P0.4mm","Connector_Hirose_FX8/Hirose_FX8-100P-SV_2x50_P0.6mm","Connector_Hirose_FX8/Hirose_FX8-100S-SV_2x50_P0.6mm","Connector_Hirose_FX8/Hirose_FX8-120P-SV_2x60_P0.6mm","Connector_Hirose_FX8/Hirose_FX8-120S-SV_2x60_P0.6mm","Connector_Hirose_FX8/Hirose_FX8-140P-SV_2x70_P0.6mm","Connector_Hirose_FX8/Hirose_FX8-140S-SV_2x70_P0.6mm","Connector_Hirose_FX8/Hirose_FX8-60P-SV_2x30_P0.6mm","Connector_Hirose_FX8/Hirose_FX8-60S-SV_2x30_P0.6mm","Connector_Hirose_FX8/Hirose_FX8-80P-SV_2x40_P0.6mm","Connector_Hirose_FX8/Hirose_FX8-80S-SV_2x40_P0.6mm","Connector_Hirose_FX8/Hirose_FX8-90P-SV_2x45_P0.6mm","Connector_Hirose_FX8/Hirose_FX8-90S-SV_2x45_P0.6mm","Connector_IDC/IDC-Header_2x03_P2.54mm_Horizontal","Connector_IDC/IDC-Header_2x03_P2.54mm_Vertical","Connector_IDC/IDC-Header_2x03_P2.54mm_Vertical_SMD","Connector_IDC/IDC-Header_2x04_P2.54mm_Horizontal","Connector_IDC/IDC-Header_2x04_P2.54mm_Vertical","Connector_IDC/IDC-Header_2x04_P2.54mm_Vertical_SMD","Connector_IDC/IDC-Header_2x05-1MP_P2.54mm_Latch12.0mm_Vertical","Connector_IDC/IDC-Header_2x05-1MP_P2.54mm_Latch6.5mm_Vertical","Connector_IDC/IDC-Header_2x05-1MP_P2.54mm_Latch9.5mm_Vertical","Connector_IDC/IDC-Header_2x05-1MP_P2.54mm_Latch_Horizontal","Connector_IDC/IDC-Header_2x05-1MP_P2.54mm_Latch_Vertical","Connector_IDC/IDC-Header_2x05_P2.54mm_Horizontal","Connector_IDC/IDC-Header_2x05_P2.54mm_Latch12.0mm_Vertical","Connector_IDC/IDC-Header_2x05_P2.54mm_Latch6.5mm_Vertical","Connector_IDC/IDC-Header_2x05_P2.54mm_Latch9.5mm_Vertical","Connector_IDC/IDC-Header_2x05_P2.54mm_Latch_Horizontal","Connector_IDC/IDC-Header_2x05_P2.54mm_Latch_Vertical","Connector_IDC/IDC-Header_2x05_P2.54mm_Vertical","Connector_IDC/IDC-Header_2x05_P2.54mm_Vertical_SMD","Connector_IDC/IDC-Header_2x06-1MP_P2.54mm_Latch12.0mm_Vertical","Connector_IDC/IDC-Header_2x06-1MP_P2.54mm_Latch6.5mm_Vertical","Connector_IDC/IDC-Header_2x06-1MP_P2.54mm_Latch9.5mm_Vertical","Connector_IDC/IDC-Header_2x06-1MP_P2.54mm_Latch_Horizontal","Connector_IDC/IDC-Header_2x06-1MP_P2.54mm_Latch_Vertical","Connector_IDC/IDC-Header_2x06_P2.54mm_Horizontal","Connector_IDC/IDC-Header_2x06_P2.54mm_Latch12.0mm_Vertical","Connector_IDC/IDC-Header_2x06_P2.54mm_Latch6.5mm_Vertical","Connector_IDC/IDC-Header_2x06_P2.54mm_Latch9.5mm_Vertical","Connector_IDC/IDC-Header_2x06_P2.54mm_Latch_Horizontal","Connector_IDC/IDC-Header_2x06_P2.54mm_Latch_Vertical","Connector_IDC/IDC-Header_2x06_P2.54mm_Vertical","Connector_IDC/IDC-Header_2x06_P2.54mm_Vertical_SMD","Connector_IDC/IDC-Header_2x07-1MP_P2.54mm_Latch12.0mm_Vertical","Connector_IDC/IDC-Header_2x07-1MP_P2.54mm_Latch6.5mm_Vertical","Connector_IDC/IDC-Header_2x07-1MP_P2.54mm_Latch9.5mm_Vertical","Connector_IDC/IDC-Header_2x07-1MP_P2.54mm_Latch_Horizontal","Connector_IDC/IDC-Header_2x07-1MP_P2.54mm_Latch_Vertical","Connector_IDC/IDC-Header_2x07_P2.54mm_Horizontal","Connector_IDC/IDC-Header_2x07_P2.54mm_Horizontal_Lock","Connector_IDC/IDC-Header_2x07_P2.54mm_Latch12.0mm_Vertical","Connector_IDC/IDC-Header_2x07_P2.54mm_Latch6.5mm_Vertical","Connector_IDC/IDC-Header_2x07_P2.54mm_Latch9.5mm_Vertical","Connector_IDC/IDC-Header_2x07_P2.54mm_Latch_Horizontal","Connector_IDC/IDC-Header_2x07_P2.54mm_Latch_Vertical","Connector_IDC/IDC-Header_2x07_P2.54mm_Vertical","Connector_IDC/IDC-Header_2x07_P2.54mm_Vertical_SMD","Connector_IDC/IDC-Header_2x08-1MP_P2.54mm_Latch12.0mm_Vertical","Connector_IDC/IDC-Header_2x08-1MP_P2.54mm_Latch6.5mm_Vertical","Connector_IDC/IDC-Header_2x08-1MP_P2.54mm_Latch9.5mm_Vertical","Connector_IDC/IDC-Header_2x08-1MP_P2.54mm_Latch_Horizontal","Connector_IDC/IDC-Header_2x08-1MP_P2.54mm_Latch_Vertical","Connector_IDC/IDC-Header_2x08_P2.54mm_Horizontal","Connector_IDC/IDC-Header_2x08_P2.54mm_Latch12.0mm_Vertical","Connector_IDC/IDC-Header_2x08_P2.54mm_Latch6.5mm_Vertical","Connector_IDC/IDC-Header_2x08_P2.54mm_Latch9.5mm_Vertical","Connector_IDC/IDC-Header_2x08_P2.54mm_Latch_Horizontal","Connector_IDC/IDC-Header_2x08_P2.54mm_Latch_Vertical","Connector_IDC/IDC-Header_2x08_P2.54mm_Vertical","Connector_IDC/IDC-Header_2x08_P2.54mm_Vertical_SMD","Connector_IDC/IDC-Header_2x09_P2.54mm_Horizontal","Connector_IDC/IDC-Header_2x09_P2.54mm_Vertical","Connector_IDC/IDC-Header_2x09_P2.54mm_Vertical_SMD","Connector_IDC/IDC-Header_2x10-1MP_P2.54mm_Latch12.0mm_Vertical","Connector_IDC/IDC-Header_2x10-1MP_P2.54mm_Latch6.5mm_Vertical","Connector_IDC/IDC-Header_2x10-1MP_P2.54mm_Latch9.5mm_Vertical","Connector_IDC/IDC-Header_2x10-1MP_P2.54mm_Latch_Horizontal","Connector_IDC/IDC-Header_2x10-1MP_P2.54mm_Latch_Vertical","Connector_IDC/IDC-Header_2x10_P2.54mm_Horizontal","Connector_IDC/IDC-Header_2x10_P2.54mm_Latch12.0mm_Vertical","Connector_IDC/IDC-Header_2x10_P2.54mm_Latch6.5mm_Vertical","Connector_IDC/IDC-Header_2x10_P2.54mm_Latch9.5mm_Vertical","Connector_IDC/IDC-Header_2x10_P2.54mm_Latch_Horizontal","Connector_IDC/IDC-Header_2x10_P2.54mm_Latch_Vertical","Connector_IDC/IDC-Header_2x10_P2.54mm_Vertical","Connector_IDC/IDC-Header_2x10_P2.54mm_Vertical_SMD","Connector_IDC/IDC-Header_2x11_P2.54mm_Horizontal","Connector_IDC/IDC-Header_2x11_P2.54mm_Vertical","Connector_IDC/IDC-Header_2x11_P2.54mm_Vertical_SMD","Connector_IDC/IDC-Header_2x12-1MP_P2.54mm_Latch12.0mm_Vertical","Connector_IDC/IDC-Header_2x12-1MP_P2.54mm_Latch6.5mm_Vertical","Connector_IDC/IDC-Header_2x12-1MP_P2.54mm_Latch9.5mm_Vertical","Connector_IDC/IDC-Header_2x12-1MP_P2.54mm_Latch_Horizontal","Connector_IDC/IDC-Header_2x12-1MP_P2.54mm_Latch_Vertical","Connector_IDC/IDC-Header_2x12_P2.54mm_Horizontal","Connector_IDC/IDC-Header_2x12_P2.54mm_Latch12.0mm_Vertical","Connector_IDC/IDC-Header_2x12_P2.54mm_Latch6.5mm_Vertical","Connector_IDC/IDC-Header_2x12_P2.54mm_Latch9.5mm_Vertical","Connector_IDC/IDC-Header_2x12_P2.54mm_Latch_Horizontal","Connector_IDC/IDC-Header_2x12_P2.54mm_Latch_Vertical","Connector_IDC/IDC-Header_2x12_P2.54mm_Vertical","Connector_IDC/IDC-Header_2x12_P2.54mm_Vertical_SMD","Connector_IDC/IDC-Header_2x13-1MP_P2.54mm_Latch12.0mm_Vertical","Connector_IDC/IDC-Header_2x13-1MP_P2.54mm_Latch6.5mm_Vertical","Connector_IDC/IDC-Header_2x13-1MP_P2.54mm_Latch9.5mm_Vertical","Connector_IDC/IDC-Header_2x13-1MP_P2.54mm_Latch_Horizontal","Connector_IDC/IDC-Header_2x13-1MP_P2.54mm_Latch_Vertical","Connector_IDC/IDC-Header_2x13_P2.54mm_Horizontal","Connector_IDC/IDC-Header_2x13_P2.54mm_Latch12.0mm_Vertical","Connector_IDC/IDC-Header_2x13_P2.54mm_Latch6.5mm_Vertical","Connector_IDC/IDC-Header_2x13_P2.54mm_Latch9.5mm_Vertical","Connector_IDC/IDC-Header_2x13_P2.54mm_Latch_Horizontal","Connector_IDC/IDC-Header_2x13_P2.54mm_Latch_Vertical","Connector_IDC/IDC-Header_2x13_P2.54mm_Vertical","Connector_IDC/IDC-Header_2x13_P2.54mm_Vertical_SMD","Connector_IDC/IDC-Header_2x15-1MP_P2.54mm_Latch12.0mm_Vertical","Connector_IDC/IDC-Header_2x15-1MP_P2.54mm_Latch6.5mm_Vertical","Connector_IDC/IDC-Header_2x15-1MP_P2.54mm_Latch9.5mm_Vertical","Connector_IDC/IDC-Header_2x15-1MP_P2.54mm_Latch_Horizontal","Connector_IDC/IDC-Header_2x15-1MP_P2.54mm_Latch_Vertical","Connector_IDC/IDC-Header_2x15_P2.54mm_Horizontal","Connector_IDC/IDC-Header_2x15_P2.54mm_Latch12.0mm_Vertical","Connector_IDC/IDC-Header_2x15_P2.54mm_Latch6.5mm_Vertical","Connector_IDC/IDC-Header_2x15_P2.54mm_Latch9.5mm_Vertical","Connector_IDC/IDC-Header_2x15_P2.54mm_Latch_Horizontal","Connector_IDC/IDC-Header_2x15_P2.54mm_Latch_Vertical","Connector_IDC/IDC-Header_2x15_P2.54mm_Vertical","Connector_IDC/IDC-Header_2x17-1MP_P2.54mm_Latch12.0mm_Vertical","Connector_IDC/IDC-Header_2x17-1MP_P2.54mm_Latch6.5mm_Vertical","Connector_IDC/IDC-Header_2x17-1MP_P2.54mm_Latch9.5mm_Vertical","Connector_IDC/IDC-Header_2x17-1MP_P2.54mm_Latch_Horizontal","Connector_IDC/IDC-Header_2x17-1MP_P2.54mm_Latch_Vertical","Connector_IDC/IDC-Header_2x17_P2.54mm_Horizontal","Connector_IDC/IDC-Header_2x17_P2.54mm_Latch12.0mm_Vertical","Connector_IDC/IDC-Header_2x17_P2.54mm_Latch6.5mm_Vertical","Connector_IDC/IDC-Header_2x17_P2.54mm_Latch9.5mm_Vertical","Connector_IDC/IDC-Header_2x17_P2.54mm_Latch_Horizontal","Connector_IDC/IDC-Header_2x17_P2.54mm_Latch_Vertical","Connector_IDC/IDC-Header_2x17_P2.54mm_Vertical","Connector_IDC/IDC-Header_2x20-1MP_P2.54mm_Latch12.0mm_Vertical","Connector_IDC/IDC-Header_2x20-1MP_P2.54mm_Latch6.5mm_Vertical","Connector_IDC/IDC-Header_2x20-1MP_P2.54mm_Latch9.5mm_Vertical","Connector_IDC/IDC-Header_2x20-1MP_P2.54mm_Latch_Horizontal","Connector_IDC/IDC-Header_2x20-1MP_P2.54mm_Latch_Vertical","Connector_IDC/IDC-Header_2x20_P2.54mm_Horizontal","Connector_IDC/IDC-Header_2x20_P2.54mm_Latch12.0mm_Vertical","Connector_IDC/IDC-Header_2x20_P2.54mm_Latch6.5mm_Vertical","Connector_IDC/IDC-Header_2x20_P2.54mm_Latch9.5mm_Vertical","Connector_IDC/IDC-Header_2x20_P2.54mm_Latch_Horizontal","Connector_IDC/IDC-Header_2x20_P2.54mm_Latch_Vertical","Connector_IDC/IDC-Header_2x20_P2.54mm_Vertical","Connector_IDC/IDC-Header_2x20_P2.54mm_Vertical_SMD","Connector_IDC/IDC-Header_2x22_P2.54mm_Horizontal","Connector_IDC/IDC-Header_2x22_P2.54mm_Vertical","Connector_IDC/IDC-Header_2x22_P2.54mm_Vertical_SMD","Connector_IDC/IDC-Header_2x25-1MP_P2.54mm_Latch12.0mm_Vertical","Connector_IDC/IDC-Header_2x25-1MP_P2.54mm_Latch6.5mm_Vertical","Connector_IDC/IDC-Header_2x25-1MP_P2.54mm_Latch9.5mm_Vertical","Connector_IDC/IDC-Header_2x25-1MP_P2.54mm_Latch_Horizontal","Connector_IDC/IDC-Header_2x25-1MP_P2.54mm_Latch_Vertical","Connector_IDC/IDC-Header_2x25_P2.54mm_Horizontal","Connector_IDC/IDC-Header_2x25_P2.54mm_Latch12.0mm_Vertical","Connector_IDC/IDC-Header_2x25_P2.54mm_Latch6.5mm_Vertical","Connector_IDC/IDC-Header_2x25_P2.54mm_Latch9.5mm_Vertical","Connector_IDC/IDC-Header_2x25_P2.54mm_Latch_Horizontal","Connector_IDC/IDC-Header_2x25_P2.54mm_Latch_Vertical","Connector_IDC/IDC-Header_2x25_P2.54mm_Vertical","Connector_IDC/IDC-Header_2x25_P2.54mm_Vertical_SMD","Connector_IDC/IDC-Header_2x30-1MP_P2.54mm_Latch12.0mm_Vertical","Connector_IDC/IDC-Header_2x30-1MP_P2.54mm_Latch6.5mm_Vertical","Connector_IDC/IDC-Header_2x30-1MP_P2.54mm_Latch9.5mm_Vertical","Connector_IDC/IDC-Header_2x30-1MP_P2.54mm_Latch_Horizontal","Connector_IDC/IDC-Header_2x30-1MP_P2.54mm_Latch_Vertical","Connector_IDC/IDC-Header_2x30_P2.54mm_Horizontal","Connector_IDC/IDC-Header_2x30_P2.54mm_Latch12.0mm_Vertical","Connector_IDC/IDC-Header_2x30_P2.54mm_Latch6.5mm_Vertical","Connector_IDC/IDC-Header_2x30_P2.54mm_Latch9.5mm_Vertical","Connector_IDC/IDC-Header_2x30_P2.54mm_Latch_Horizontal","Connector_IDC/IDC-Header_2x30_P2.54mm_Latch_Vertical","Connector_IDC/IDC-Header_2x30_P2.54mm_Vertical","Connector_IDC/IDC-Header_2x30_P2.54mm_Vertical_SMD","Connector_IDC/IDC-Header_2x32-1MP_P2.54mm_Latch12.0mm_Vertical","Connector_IDC/IDC-Header_2x32-1MP_P2.54mm_Latch6.5mm_Vertical","Connector_IDC/IDC-Header_2x32-1MP_P2.54mm_Latch9.5mm_Vertical","Connector_IDC/IDC-Header_2x32-1MP_P2.54mm_Latch_Horizontal","Connector_IDC/IDC-Header_2x32-1MP_P2.54mm_Latch_Vertical","Connector_IDC/IDC-Header_2x32_P2.54mm_Horizontal","Connector_IDC/IDC-Header_2x32_P2.54mm_Latch12.0mm_Vertical","Connector_IDC/IDC-Header_2x32_P2.54mm_Latch6.5mm_Vertical","Connector_IDC/IDC-Header_2x32_P2.54mm_Latch9.5mm_Vertical","Connector_IDC/IDC-Header_2x32_P2.54mm_Latch_Horizontal","Connector_IDC/IDC-Header_2x32_P2.54mm_Latch_Vertical","Connector_IDC/IDC-Header_2x32_P2.54mm_Vertical","Connector_JAE/JAE_LY20-10P-DLT1_2x05_P2.00mm_Horizontal","Connector_JAE/JAE_LY20-10P-DT1_2x05_P2.00mm_Vertical","Connector_JAE/JAE_LY20-12P-DLT1_2x06_P2.00mm_Horizontal","Connector_JAE/JAE_LY20-12P-DT1_2x06_P2.00mm_Vertical","Connector_JAE/JAE_LY20-14P-DLT1_2x07_P2.00mm_Horizontal","Connector_JAE/JAE_LY20-14P-DT1_2x07_P2.00mm_Vertical","Connector_JAE/JAE_LY20-16P-DLT1_2x08_P2.00mm_Horizontal","Connector_JAE/JAE_LY20-16P-DT1_2x08_P2.00mm_Vertical","Connector_JAE/JAE_LY20-18P-DLT1_2x09_P2.00mm_Horizontal","Connector_JAE/JAE_LY20-18P-DT1_2x09_P2.00mm_Vertical","Connector_JAE/JAE_LY20-20P-DLT1_2x10_P2.00mm_Horizontal","Connector_JAE/JAE_LY20-20P-DT1_2x10_P2.00mm_Vertical","Connector_JAE/JAE_LY20-22P-DLT1_2x11_P2.00mm_Horizontal","Connector_JAE/JAE_LY20-22P-DT1_2x11_P2.00mm_Vertical","Connector_JAE/JAE_LY20-24P-DLT1_2x12_P2.00mm_Horizontal","Connector_JAE/JAE_LY20-24P-DT1_2x12_P2.00mm_Vertical","Connector_JAE/JAE_LY20-26P-DLT1_2x13_P2.00mm_Horizontal","Connector_JAE/JAE_LY20-26P-DT1_2x13_P2.00mm_Vertical","Connector_JAE/JAE_LY20-28P-DLT1_2x14_P2.00mm_Horizontal","Connector_JAE/JAE_LY20-28P-DT1_2x14_P2.00mm_Vertical","Connector_JAE/JAE_LY20-30P-DLT1_2x15_P2.00mm_Horizontal","Connector_JAE/JAE_LY20-30P-DT1_2x15_P2.00mm_Vertical","Connector_JAE/JAE_LY20-32P-DLT1_2x16_P2.00mm_Horizontal","Connector_JAE/JAE_LY20-32P-DT1_2x16_P2.00mm_Vertical","Connector_JAE/JAE_LY20-34P-DLT1_2x17_P2.00mm_Horizontal","Connector_JAE/JAE_LY20-34P-DT1_2x17_P2.00mm_Vertical","Connector_JAE/JAE_LY20-36P-DLT1_2x18_P2.00mm_Horizontal","Connector_JAE/JAE_LY20-36P-DT1_2x18_P2.00mm_Vertical","Connector_JAE/JAE_LY20-38P-DLT1_2x19_P2.00mm_Horizontal","Connector_JAE/JAE_LY20-38P-DT1_2x19_P2.00mm_Vertical","Connector_JAE/JAE_LY20-40P-DLT1_2x20_P2.00mm_Horizontal","Connector_JAE/JAE_LY20-40P-DT1_2x20_P2.00mm_Vertical","Connector_JAE/JAE_LY20-42P-DLT1_2x21_P2.00mm_Horizontal","Connector_JAE/JAE_LY20-42P-DT1_2x21_P2.00mm_Vertical","Connector_JAE/JAE_LY20-44P-DLT1_2x22_P2.00mm_Horizontal","Connector_JAE/JAE_LY20-44P-DT1_2x22_P2.00mm_Vertical","Connector_JAE/JAE_LY20-4P-DLT1_2x02_P2.00mm_Horizontal","Connector_JAE/JAE_LY20-4P-DT1_2x02_P2.00mm_Vertical","Connector_JAE/JAE_LY20-6P-DLT1_2x03_P2.00mm_Horizontal","Connector_JAE/JAE_LY20-6P-DT1_2x03_P2.00mm_Vertical","Connector_JAE/JAE_LY20-8P-DLT1_2x04_P2.00mm_Horizontal","Connector_JAE/JAE_LY20-8P-DT1_2x04_P2.00mm_Vertical","Connector_JAE/JAE_MM70-314-310B1","Connector_JAE/JAE_SIM_Card_SF72S006","Connector_JAE_WP7B/JAE_WP7B-P034VA1-R8000_2x17-1MP_P0.4mm","Connector_JAE_WP7B/JAE_WP7B-P034VA1-R8000_Longpads_2x17-1MP_P0.4mm","Connector_JAE_WP7B/JAE_WP7B-P040VA1-R8000_2x20-1MP_P0.4mm","Connector_JAE_WP7B/JAE_WP7B-P040VA1-R8000_Longpads_2x20-1MP_P0.4mm","Connector_JAE_WP7B/JAE_WP7B-P050VA1-R8000_2x25-1MP_P0.4mm","Connector_JAE_WP7B/JAE_WP7B-P050VA1-R8000_Longpads_2x25-1MP_P0.4mm","Connector_JAE_WP7B/JAE_WP7B-P060VA1-R8000_2x30-1MP_P0.4mm","Connector_JAE_WP7B/JAE_WP7B-P060VA1-R8000_Longpads_2x30-1MP_P0.4mm","Connector_JAE_WP7B/JAE_WP7B-P070VA1-R8000_2x35-1MP_P0.4mm","Connector_JAE_WP7B/JAE_WP7B-P070VA1-R8000_Longpads_2x35-1MP_P0.4mm","Connector_JAE_WP7B/JAE_WP7B-S034VA1-R8000_2x17-1MP_P0.4mm","Connector_JAE_WP7B/JAE_WP7B-S034VA1-R8000_Longpads_2x17-1MP_P0.4mm","Connector_JAE_WP7B/JAE_WP7B-S040VA1-R8000_2x20-1MP_P0.4mm","Connector_JAE_WP7B/JAE_WP7B-S040VA1-R8000_Longpads_2x20-1MP_P0.4mm","Connector_JAE_WP7B/JAE_WP7B-S050VA1-R8000_2x25-1MP_P0.4mm","Connector_JAE_WP7B/JAE_WP7B-S050VA1-R8000_Longpads_2x25-1MP_P0.4mm","Connector_JAE_WP7B/JAE_WP7B-S060VA1-R8000_2x30-1MP_P0.4mm","Connector_JAE_WP7B/JAE_WP7B-S060VA1-R8000_Longpads_2x30-1MP_P0.4mm","Connector_JAE_WP7B/JAE_WP7B-S070VA1-R8000_2x35-1MP_P0.4mm","Connector_JAE_WP7B/JAE_WP7B-S070VA1-R8000_Longpads_2x35-1MP_P0.4mm","Connector_JST/JST_ACH_BM01B-ACHSS-A-GAN-ETF_1x01-1MP_P1.20mm_Vertical","Connector_JST/JST_ACH_BM02B-ACHSS-GAN-ETF_1x02-1MP_P1.20mm_Vertical","Connector_JST/JST_ACH_BM03B-ACHSS-GAN-ETF_1x03-1MP_P1.20mm_Vertical","Connector_JST/JST_ACH_BM04B-ACHSS-A-GAN-ETF_1x04-1MP_P1.20mm_Vertical","Connector_JST/JST_ACH_BM05B-ACHSS-A-GAN-ETF_1x05-1MP_P1.20mm_Vertical","Connector_JST/JST_AUH_BM03B-AUHKS-GA-TB_1x03-1MP_P1.50mm_Vertical","Connector_JST/JST_AUH_BM05B-AUHKS-GA-TB_1x05-1MP_P1.50mm_Vertical","Connector_JST/JST_EH_B10B-EH-A_1x10_P2.50mm_Vertical","Connector_JST/JST_EH_B11B-EH-A_1x11_P2.50mm_Vertical","Connector_JST/JST_EH_B12B-EH-A_1x12_P2.50mm_Vertical","Connector_JST/JST_EH_B13B-EH-A_1x13_P2.50mm_Vertical","Connector_JST/JST_EH_B14B-EH-A_1x14_P2.50mm_Vertical","Connector_JST/JST_EH_B15B-EH-A_1x15_P2.50mm_Vertical","Connector_JST/JST_EH_B2B-EH-A_1x02_P2.50mm_Vertical","Connector_JST/JST_EH_B3B-EH-A_1x03_P2.50mm_Vertical","Connector_JST/JST_EH_B4B-EH-A_1x04_P2.50mm_Vertical","Connector_JST/JST_EH_B5B-EH-A_1x05_P2.50mm_Vertical","Connector_JST/JST_EH_B6B-EH-A_1x06_P2.50mm_Vertical","Connector_JST/JST_EH_B7B-EH-A_1x07_P2.50mm_Vertical","Connector_JST/JST_EH_B8B-EH-A_1x08_P2.50mm_Vertical","Connector_JST/JST_EH_B9B-EH-A_1x09_P2.50mm_Vertical","Connector_JST/JST_EH_S10B-EH_1x10_P2.50mm_Horizontal","Connector_JST/JST_EH_S11B-EH_1x11_P2.50mm_Horizontal","Connector_JST/JST_EH_S12B-EH_1x12_P2.50mm_Horizontal","Connector_JST/JST_EH_S13B-EH_1x13_P2.50mm_Horizontal","Connector_JST/JST_EH_S14B-EH_1x14_P2.50mm_Horizontal","Connector_JST/JST_EH_S15B-EH_1x15_P2.50mm_Horizontal","Connector_JST/JST_EH_S2B-EH_1x02_P2.50mm_Horizontal","Connector_JST/JST_EH_S3B-EH_1x03_P2.50mm_Horizontal","Connector_JST/JST_EH_S4B-EH_1x04_P2.50mm_Horizontal","Connector_JST/JST_EH_S5B-EH_1x05_P2.50mm_Horizontal","Connector_JST/JST_EH_S6B-EH_1x06_P2.50mm_Horizontal","Connector_JST/JST_EH_S7B-EH_1x07_P2.50mm_Horizontal","Connector_JST/JST_EH_S8B-EH_1x08_P2.50mm_Horizontal","Connector_JST/JST_EH_S9B-EH_1x09_P2.50mm_Horizontal","Connector_JST/JST_GH_BM02B-GHS-TBT_1x02-1MP_P1.25mm_Vertical","Connector_JST/JST_GH_BM03B-GHS-TBT_1x03-1MP_P1.25mm_Vertical","Connector_JST/JST_GH_BM04B-GHS-TBT_1x04-1MP_P1.25mm_Vertical","Connector_JST/JST_GH_BM05B-GHS-TBT_1x05-1MP_P1.25mm_Vertical","Connector_JST/JST_GH_BM06B-GHS-TBT_1x06-1MP_P1.25mm_Vertical","Connector_JST/JST_GH_BM07B-GHS-TBT_1x07-1MP_P1.25mm_Vertical","Connector_JST/JST_GH_BM08B-GHS-TBT_1x08-1MP_P1.25mm_Vertical","Connector_JST/JST_GH_BM09B-GHS-TBT_1x09-1MP_P1.25mm_Vertical","Connector_JST/JST_GH_BM10B-GHS-TBT_1x10-1MP_P1.25mm_Vertical","Connector_JST/JST_GH_BM11B-GHS-TBT_1x11-1MP_P1.25mm_Vertical","Connector_JST/JST_GH_BM12B-GHS-TBT_1x12-1MP_P1.25mm_Vertical","Connector_JST/JST_GH_BM13B-GHS-TBT_1x13-1MP_P1.25mm_Vertical","Connector_JST/JST_GH_BM14B-GHS-TBT_1x14-1MP_P1.25mm_Vertical","Connector_JST/JST_GH_BM15B-GHS-TBT_1x15-1MP_P1.25mm_Vertical","Connector_JST/JST_GH_SM02B-GHS-TB_1x02-1MP_P1.25mm_Horizontal","Connector_JST/JST_GH_SM03B-GHS-TB_1x03-1MP_P1.25mm_Horizontal","Connector_JST/JST_GH_SM04B-GHS-TB_1x04-1MP_P1.25mm_Horizontal","Connector_JST/JST_GH_SM05B-GHS-TB_1x05-1MP_P1.25mm_Horizontal","Connector_JST/JST_GH_SM06B-GHS-TB_1x06-1MP_P1.25mm_Horizontal","Connector_JST/JST_GH_SM07B-GHS-TB_1x07-1MP_P1.25mm_Horizontal","Connector_JST/JST_GH_SM08B-GHS-TB_1x08-1MP_P1.25mm_Horizontal","Connector_JST/JST_GH_SM09B-GHS-TB_1x09-1MP_P1.25mm_Horizontal","Connector_JST/JST_GH_SM10B-GHS-TB_1x10-1MP_P1.25mm_Horizontal","Connector_JST/JST_GH_SM11B-GHS-TB_1x11-1MP_P1.25mm_Horizontal","Connector_JST/JST_GH_SM12B-GHS-TB_1x12-1MP_P1.25mm_Horizontal","Connector_JST/JST_GH_SM13B-GHS-TB_1x13-1MP_P1.25mm_Horizontal","Connector_JST/JST_GH_SM14B-GHS-TB_1x14-1MP_P1.25mm_Horizontal","Connector_JST/JST_GH_SM15B-GHS-TB_1x15-1MP_P1.25mm_Horizontal","Connector_JST/JST_J2100_B06B-J21DK-GGXR_2x03_P2.50x4.00mm_Vertical","Connector_JST/JST_J2100_B08B-J21DK-GGXR_2x04_P2.50x4.00mm_Vertical","Connector_JST/JST_J2100_B10B-J21DK-GGXR_2x05_P2.50x4.00mm_Vertical","Connector_JST/JST_J2100_B12B-J21DK-GGXR_2x06_P2.50x4.00mm_Vertical","Connector_JST/JST_J2100_B16B-J21DK-GGXR_2x08_P2.50x4.00mm_Vertical","Connector_JST/JST_J2100_B20B-J21DK-GGXR_2x10_P2.50x4.00mm_Vertical","Connector_JST/JST_J2100_S06B-J21DK-GGXR_2x03_P2.50mm_Horizontal","Connector_JST/JST_J2100_S08B-J21DK-GGXR_2x04_P2.50mm_Horizontal","Connector_JST/JST_J2100_S10B-J21DK-GGXR_2x05_P2.50mm_Horizontal","Connector_JST/JST_J2100_S12B-J21DK-GGXR_2x06_P2.50mm_Horizontal","Connector_JST/JST_J2100_S16B-J21DK-GGXR_2x08_P2.50mm_Horizontal","Connector_JST/JST_J2100_S20B-J21DK-GGXR_2x10_P2.50mm_Horizontal","Connector_JST/JST_JWPF_B02B-JWPF-SK-R_1x02_P2.00mm_Vertical","Connector_JST/JST_JWPF_B03B-JWPF-SK-R_1x03_P2.00mm_Vertical","Connector_JST/JST_JWPF_B04B-JWPF-SK-R_1x04_P2.00mm_Vertical","Connector_JST/JST_JWPF_B06B-JWPF-SK-R_2x03_P2.00mm_Vertical","Connector_JST/JST_JWPF_B08B-JWPF-SK-R_2x04_P2.00mm_Vertical","Connector_JST/JST_LEA_SM02B-LEASS-TF_1x02-1MP_P4.20mm_Horizontal","Connector_JST/JST_NV_B02P-NV_1x02_P5.00mm_Vertical","Connector_JST/JST_NV_B03P-NV_1x03_P5.00mm_Vertical","Connector_JST/JST_NV_B04P-NV_1x04_P5.00mm_Vertical","Connector_JST/JST_PHD_B10B-PHDSS_2x05_P2.00mm_Vertical","Connector_JST/JST_PHD_B12B-PHDSS_2x06_P2.00mm_Vertical","Connector_JST/JST_PHD_B14B-PHDSS_2x07_P2.00mm_Vertical","Connector_JST/JST_PHD_B16B-PHDSS_2x08_P2.00mm_Vertical","Connector_JST/JST_PHD_B18B-PHDSS_2x09_P2.00mm_Vertical","Connector_JST/JST_PHD_B20B-PHDSS_2x10_P2.00mm_Vertical","Connector_JST/JST_PHD_B22B-PHDSS_2x11_P2.00mm_Vertical","Connector_JST/JST_PHD_B24B-PHDSS_2x12_P2.00mm_Vertical","Connector_JST/JST_PHD_B26B-PHDSS_2x13_P2.00mm_Vertical","Connector_JST/JST_PHD_B28B-PHDSS_2x14_P2.00mm_Vertical","Connector_JST/JST_PHD_B30B-PHDSS_2x15_P2.00mm_Vertical","Connector_JST/JST_PHD_B32B-PHDSS_2x16_P2.00mm_Vertical","Connector_JST/JST_PHD_B34B-PHDSS_2x17_P2.00mm_Vertical","Connector_JST/JST_PHD_B8B-PHDSS_2x04_P2.00mm_Vertical","Connector_JST/JST_PHD_S10B-PHDSS_2x05_P2.00mm_Horizontal","Connector_JST/JST_PHD_S12B-PHDSS_2x06_P2.00mm_Horizontal","Connector_JST/JST_PHD_S14B-PHDSS_2x07_P2.00mm_Horizontal","Connector_JST/JST_PHD_S16B-PHDSS_2x08_P2.00mm_Horizontal","Connector_JST/JST_PHD_S18B-PHDSS_2x09_P2.00mm_Horizontal","Connector_JST/JST_PHD_S20B-PHDSS_2x10_P2.00mm_Horizontal","Connector_JST/JST_PHD_S22B-PHDSS_2x11_P2.00mm_Horizontal","Connector_JST/JST_PHD_S24B-PHDSS_2x12_P2.00mm_Horizontal","Connector_JST/JST_PHD_S26B-PHDSS_2x13_P2.00mm_Horizontal","Connector_JST/JST_PHD_S28B-PHDSS_2x14_P2.00mm_Horizontal","Connector_JST/JST_PHD_S30B-PHDSS_2x15_P2.00mm_Horizontal","Connector_JST/JST_PHD_S32B-PHDSS_2x16_P2.00mm_Horizontal","Connector_JST/JST_PHD_S34B-PHDSS_2x17_P2.00mm_Horizontal","Connector_JST/JST_PHD_S8B-PHDSS_2x04_P2.00mm_Horizontal","Connector_JST/JST_PH_B10B-PH-K_1x10_P2.00mm_Vertical","Connector_JST/JST_PH_B10B-PH-SM4-TB_1x10-1MP_P2.00mm_Vertical","Connector_JST/JST_PH_B11B-PH-K_1x11_P2.00mm_Vertical","Connector_JST/JST_PH_B11B-PH-SM4-TB_1x11-1MP_P2.00mm_Vertical","Connector_JST/JST_PH_B12B-PH-K_1x12_P2.00mm_Vertical","Connector_JST/JST_PH_B12B-PH-SM4-TB_1x12-1MP_P2.00mm_Vertical","Connector_JST/JST_PH_B13B-PH-K_1x13_P2.00mm_Vertical","Connector_JST/JST_PH_B13B-PH-SM4-TB_1x13-1MP_P2.00mm_Vertical","Connector_JST/JST_PH_B14B-PH-K_1x14_P2.00mm_Vertical","Connector_JST/JST_PH_B14B-PH-SM4-TB_1x14-1MP_P2.00mm_Vertical","Connector_JST/JST_PH_B15B-PH-K_1x15_P2.00mm_Vertical","Connector_JST/JST_PH_B15B-PH-SM4-TB_1x15-1MP_P2.00mm_Vertical","Connector_JST/JST_PH_B16B-PH-K_1x16_P2.00mm_Vertical","Connector_JST/JST_PH_B16B-PH-SM4-TB_1x16-1MP_P2.00mm_Vertical","Connector_JST/JST_PH_B2B-PH-K_1x02_P2.00mm_Vertical","Connector_JST/JST_PH_B2B-PH-SM4-TB_1x02-1MP_P2.00mm_Vertical","Connector_JST/JST_PH_B3B-PH-K_1x03_P2.00mm_Vertical","Connector_JST/JST_PH_B3B-PH-SM4-TB_1x03-1MP_P2.00mm_Vertical","Connector_JST/JST_PH_B4B-PH-K_1x04_P2.00mm_Vertical","Connector_JST/JST_PH_B4B-PH-SM4-TB_1x04-1MP_P2.00mm_Vertical","Connector_JST/JST_PH_B5B-PH-K_1x05_P2.00mm_Vertical","Connector_JST/JST_PH_B5B-PH-SM4-TB_1x05-1MP_P2.00mm_Vertical","Connector_JST/JST_PH_B6B-PH-K_1x06_P2.00mm_Vertical","Connector_JST/JST_PH_B6B-PH-SM4-TB_1x06-1MP_P2.00mm_Vertical","Connector_JST/JST_PH_B7B-PH-K_1x07_P2.00mm_Vertical","Connector_JST/JST_PH_B7B-PH-SM4-TB_1x07-1MP_P2.00mm_Vertical","Connector_JST/JST_PH_B8B-PH-K_1x08_P2.00mm_Vertical","Connector_JST/JST_PH_B8B-PH-SM4-TB_1x08-1MP_P2.00mm_Vertical","Connector_JST/JST_PH_B9B-PH-K_1x09_P2.00mm_Vertical","Connector_JST/JST_PH_B9B-PH-SM4-TB_1x09-1MP_P2.00mm_Vertical","Connector_JST/JST_PH_S10B-PH-K_1x10_P2.00mm_Horizontal","Connector_JST/JST_PH_S10B-PH-SM4-TB_1x10-1MP_P2.00mm_Horizontal","Connector_JST/JST_PH_S11B-PH-K_1x11_P2.00mm_Horizontal","Connector_JST/JST_PH_S11B-PH-SM4-TB_1x11-1MP_P2.00mm_Horizontal","Connector_JST/JST_PH_S12B-PH-K_1x12_P2.00mm_Horizontal","Connector_JST/JST_PH_S12B-PH-SM4-TB_1x12-1MP_P2.00mm_Horizontal","Connector_JST/JST_PH_S13B-PH-K_1x13_P2.00mm_Horizontal","Connector_JST/JST_PH_S13B-PH-SM4-TB_1x13-1MP_P2.00mm_Horizontal","Connector_JST/JST_PH_S14B-PH-K_1x14_P2.00mm_Horizontal","Connector_JST/JST_PH_S14B-PH-SM4-TB_1x14-1MP_P2.00mm_Horizontal","Connector_JST/JST_PH_S15B-PH-K_1x15_P2.00mm_Horizontal","Connector_JST/JST_PH_S15B-PH-SM4-TB_1x15-1MP_P2.00mm_Horizontal","Connector_JST/JST_PH_S16B-PH-K_1x16_P2.00mm_Horizontal","Connector_JST/JST_PH_S2B-PH-K_1x02_P2.00mm_Horizontal","Connector_JST/JST_PH_S2B-PH-SM4-TB_1x02-1MP_P2.00mm_Horizontal","Connector_JST/JST_PH_S3B-PH-K_1x03_P2.00mm_Horizontal","Connector_JST/JST_PH_S3B-PH-SM4-TB_1x03-1MP_P2.00mm_Horizontal","Connector_JST/JST_PH_S4B-PH-K_1x04_P2.00mm_Horizontal","Connector_JST/JST_PH_S4B-PH-SM4-TB_1x04-1MP_P2.00mm_Horizontal","Connector_JST/JST_PH_S5B-PH-K_1x05_P2.00mm_Horizontal","Connector_JST/JST_PH_S5B-PH-SM4-TB_1x05-1MP_P2.00mm_Horizontal","Connector_JST/JST_PH_S6B-PH-K_1x06_P2.00mm_Horizontal","Connector_JST/JST_PH_S6B-PH-SM4-TB_1x06-1MP_P2.00mm_Horizontal","Connector_JST/JST_PH_S7B-PH-K_1x07_P2.00mm_Horizontal","Connector_JST/JST_PH_S7B-PH-SM4-TB_1x07-1MP_P2.00mm_Horizontal","Connector_JST/JST_PH_S8B-PH-K_1x08_P2.00mm_Horizontal","Connector_JST/JST_PH_S8B-PH-SM4-TB_1x08-1MP_P2.00mm_Horizontal","Connector_JST/JST_PH_S9B-PH-K_1x09_P2.00mm_Horizontal","Connector_JST/JST_PH_S9B-PH-SM4-TB_1x09-1MP_P2.00mm_Horizontal","Connector_JST/JST_PUD_B08B-PUDSS_2x04_P2.00mm_Vertical","Connector_JST/JST_PUD_B10B-PUDSS_2x05_P2.00mm_Vertical","Connector_JST/JST_PUD_B12B-PUDSS_2x06_P2.00mm_Vertical","Connector_JST/JST_PUD_B14B-PUDSS_2x07_P2.00mm_Vertical","Connector_JST/JST_PUD_B16B-PUDSS_2x08_P2.00mm_Vertical","Connector_JST/JST_PUD_B18B-PUDSS_2x09_P2.00mm_Vertical","Connector_JST/JST_PUD_B20B-PUDSS_2x10_P2.00mm_Vertical","Connector_JST/JST_PUD_B22B-PUDSS_2x11_P2.00mm_Vertical","Connector_JST/JST_PUD_B24B-PUDSS_2x12_P2.00mm_Vertical","Connector_JST/JST_PUD_B26B-PUDSS_2x13_P2.00mm_Vertical","Connector_JST/JST_PUD_B28B-PUDSS_2x14_P2.00mm_Vertical","Connector_JST/JST_PUD_B30B-PUDSS_2x15_P2.00mm_Vertical","Connector_JST/JST_PUD_B32B-PUDSS_2x16_P2.00mm_Vertical","Connector_JST/JST_PUD_B34B-PUDSS_2x17_P2.00mm_Vertical","Connector_JST/JST_PUD_B36B-PUDSS_2x18_P2.00mm_Vertical","Connector_JST/JST_PUD_B38B-PUDSS_2x19_P2.00mm_Vertical","Connector_JST/JST_PUD_B40B-PUDSS_2x20_P2.00mm_Vertical","Connector_JST/JST_PUD_S08B-PUDSS-1_2x04_P2.00mm_Horizontal","Connector_JST/JST_PUD_S10B-PUDSS-1_2x05_P2.00mm_Horizontal","Connector_JST/JST_PUD_S12B-PUDSS-1_2x06_P2.00mm_Horizontal","Connector_JST/JST_PUD_S14B-PUDSS-1_2x07_P2.00mm_Horizontal","Connector_JST/JST_PUD_S16B-PUDSS-1_2x08_P2.00mm_Horizontal","Connector_JST/JST_PUD_S18B-PUDSS-1_2x09_P2.00mm_Horizontal","Connector_JST/JST_PUD_S20B-PUDSS-1_2x10_P2.00mm_Horizontal","Connector_JST/JST_PUD_S22B-PUDSS-1_2x11_P2.00mm_Horizontal","Connector_JST/JST_PUD_S24B-PUDSS-1_2x12_P2.00mm_Horizontal","Connector_JST/JST_PUD_S26B-PUDSS-1_2x13_P2.00mm_Horizontal","Connector_JST/JST_PUD_S28B-PUDSS-1_2x14_P2.00mm_Horizontal","Connector_JST/JST_PUD_S30B-PUDSS-1_2x15_P2.00mm_Horizontal","Connector_JST/JST_PUD_S32B-PUDSS-1_2x16_P2.00mm_Horizontal","Connector_JST/JST_PUD_S34B-PUDSS-1_2x17_P2.00mm_Horizontal","Connector_JST/JST_PUD_S36B-PUDSS-1_2x18_P2.00mm_Horizontal","Connector_JST/JST_PUD_S38B-PUDSS-1_2x19_P2.00mm_Horizontal","Connector_JST/JST_PUD_S40B-PUDSS-1_2x20_P2.00mm_Horizontal","Connector_JST/JST_SFH_SM02B-SFHRS-TF_1x02-1MP_P4.20mm_Horizontal","Connector_JST/JST_SHD_BM20B-SRDS-A-G-TF_2x10-1MP_P1.0mm_Vertical","Connector_JST/JST_SHD_BM20B-SRDS-G-TF_2x10-1MP_P1.0mm_Vertical","Connector_JST/JST_SHD_BM30B-SRDS-A-G-TF_2x15-1MP_P1.0mm_Vertical","Connector_JST/JST_SHD_BM30B-SRDS-G-TF_2x15-1MP_P1.0mm_Vertical","Connector_JST/JST_SHD_BM40B-SRDS-A-G-TF_2x20-1MP_P1.0mm_Vertical","Connector_JST/JST_SHD_BM40B-SRDS-G-TF_2x20-1MP_P1.0mm_Vertical","Connector_JST/JST_SHD_BM50B-SRDS-A-G-TF_2x25-1MP_P1.0mm_Vertical","Connector_JST/JST_SHD_BM50B-SRDS-G-TF_2x25-1MP_P1.0mm_Vertical","Connector_JST/JST_SHD_SM20B-SRDS-G-TF_2x10-1MP_P1.0mm_Horizontal","Connector_JST/JST_SHD_SM30B-SRDS-G-TF_2x15-1MP_P1.0mm_Horizontal","Connector_JST/JST_SHD_SM40B-SRDS-G-TF_2x20-1MP_P1.0mm_Horizontal","Connector_JST/JST_SHD_SM50B-SRDS-G-TF_2x25-1MP_P1.0mm_Horizontal","Connector_JST/JST_SHL_SM02B-SHLS-TF_1x02-1MP_P1.00mm_Horizontal","Connector_JST/JST_SHL_SM05B-SHLS-TF_1x05-1MP_P1.00mm_Horizontal","Connector_JST/JST_SHL_SM06B-SHLS-TF_1x06-1MP_P1.00mm_Horizontal","Connector_JST/JST_SHL_SM07B-SHLS-TF_1x07-1MP_P1.00mm_Horizontal","Connector_JST/JST_SHL_SM08B-SHLS-TF_1x08-1MP_P1.00mm_Horizontal","Connector_JST/JST_SHL_SM10B-SHLS-TF_1x10-1MP_P1.00mm_Horizontal","Connector_JST/JST_SHL_SM11B-SHLS-TF_1x11-1MP_P1.00mm_Horizontal","Connector_JST/JST_SHL_SM12B-SHLS-TF_1x12-1MP_P1.00mm_Horizontal","Connector_JST/JST_SHL_SM14B-SHLS-TF_1x14-1MP_P1.00mm_Horizontal","Connector_JST/JST_SHL_SM16B-SHLS-TF_1x16-1MP_P1.00mm_Horizontal","Connector_JST/JST_SHL_SM20B-SHLS-TF_1x20-1MP_P1.00mm_Horizontal","Connector_JST/JST_SHL_SM22B-SHLS-TF_1x22-1MP_P1.00mm_Horizontal","Connector_JST/JST_SHL_SM26B-SHLS-TF_1x26-1MP_P1.00mm_Horizontal","Connector_JST/JST_SHL_SM30B-SHLS-TF_1x30-1MP_P1.00mm_Horizontal","Connector_JST/JST_SH_BM02B-SRSS-TB_1x02-1MP_P1.00mm_Vertical","Connector_JST/JST_SH_BM03B-SRSS-TB_1x03-1MP_P1.00mm_Vertical","Connector_JST/JST_SH_BM04B-SRSS-TB_1x04-1MP_P1.00mm_Vertical","Connector_JST/JST_SH_BM05B-SRSS-TB_1x05-1MP_P1.00mm_Vertical","Connector_JST/JST_SH_BM06B-SRSS-TB_1x06-1MP_P1.00mm_Vertical","Connector_JST/JST_SH_BM07B-SRSS-TB_1x07-1MP_P1.00mm_Vertical","Connector_JST/JST_SH_BM08B-SRSS-TB_1x08-1MP_P1.00mm_Vertical","Connector_JST/JST_SH_BM09B-SRSS-TB_1x09-1MP_P1.00mm_Vertical","Connector_JST/JST_SH_BM10B-SRSS-TB_1x10-1MP_P1.00mm_Vertical","Connector_JST/JST_SH_BM11B-SRSS-TB_1x11-1MP_P1.00mm_Vertical","Connector_JST/JST_SH_BM12B-SRSS-TB_1x12-1MP_P1.00mm_Vertical","Connector_JST/JST_SH_BM13B-SRSS-TB_1x13-1MP_P1.00mm_Vertical","Connector_JST/JST_SH_BM14B-SRSS-TB_1x14-1MP_P1.00mm_Vertical","Connector_JST/JST_SH_BM15B-SRSS-TB_1x15-1MP_P1.00mm_Vertical","Connector_JST/JST_SH_SM02B-SRSS-TB_1x02-1MP_P1.00mm_Horizontal","Connector_JST/JST_SH_SM03B-SRSS-TB_1x03-1MP_P1.00mm_Horizontal","Connector_JST/JST_SH_SM04B-SRSS-TB_1x04-1MP_P1.00mm_Horizontal","Connector_JST/JST_SH_SM05B-SRSS-TB_1x05-1MP_P1.00mm_Horizontal","Connector_JST/JST_SH_SM06B-SRSS-TB_1x06-1MP_P1.00mm_Horizontal","Connector_JST/JST_SH_SM07B-SRSS-TB_1x07-1MP_P1.00mm_Horizontal","Connector_JST/JST_SH_SM08B-SRSS-TB_1x08-1MP_P1.00mm_Horizontal","Connector_JST/JST_SH_SM09B-SRSS-TB_1x09-1MP_P1.00mm_Horizontal","Connector_JST/JST_SH_SM10B-SRSS-TB_1x10-1MP_P1.00mm_Horizontal","Connector_JST/JST_SH_SM11B-SRSS-TB_1x11-1MP_P1.00mm_Horizontal","Connector_JST/JST_SH_SM12B-SRSS-TB_1x12-1MP_P1.00mm_Horizontal","Connector_JST/JST_SH_SM13B-SRSS-TB_1x13-1MP_P1.00mm_Horizontal","Connector_JST/JST_SH_SM14B-SRSS-TB_1x14-1MP_P1.00mm_Horizontal","Connector_JST/JST_SH_SM15B-SRSS-TB_1x15-1MP_P1.00mm_Horizontal","Connector_JST/JST_SH_SM20B-SRSS-TB_1x20-1MP_P1.00mm_Horizontal","Connector_JST/JST_SUR_BM02B-SURS-TF_1x02-1MP_P0.80mm_Vertical","Connector_JST/JST_SUR_BM03B-SURS-TF_1x03-1MP_P0.80mm_Vertical","Connector_JST/JST_SUR_BM04B-SURS-TF_1x04-1MP_P0.80mm_Vertical","Connector_JST/JST_SUR_BM05B-SURS-TF_1x05-1MP_P0.80mm_Vertical","Connector_JST/JST_SUR_BM06B-SURS-TF_1x06-1MP_P0.80mm_Vertical","Connector_JST/JST_SUR_BM08B-SURS-TF_1x08-1MP_P0.80mm_Vertical","Connector_JST/JST_SUR_BM10B-SURS-TF_1x10-1MP_P0.80mm_Vertical","Connector_JST/JST_SUR_BM12B-SURS-TF_1x12-1MP_P0.80mm_Vertical","Connector_JST/JST_SUR_BM14B-SURS-TF_1x14-1MP_P0.80mm_Vertical","Connector_JST/JST_SUR_BM15B-SURS-TF_1x15-1MP_P0.80mm_Vertical","Connector_JST/JST_SUR_BM16B-SURS-TF_1x16-1MP_P0.80mm_Vertical","Connector_JST/JST_SUR_BM17B-SURS-TF_1x17-1MP_P0.80mm_Vertical","Connector_JST/JST_SUR_BM20B-SURS-TF_1x20-1MP_P0.80mm_Vertical","Connector_JST/JST_SUR_SM02B-SURS-TF_1x02-1MP_P0.80mm_Horizontal","Connector_JST/JST_SUR_SM03B-SURS-TF_1x03-1MP_P0.80mm_Horizontal","Connector_JST/JST_SUR_SM04B-SURS-TF_1x04-1MP_P0.80mm_Horizontal","Connector_JST/JST_SUR_SM05B-SURS-TF_1x05-1MP_P0.80mm_Horizontal","Connector_JST/JST_SUR_SM06B-SURS-TF_1x06-1MP_P0.80mm_Horizontal","Connector_JST/JST_SUR_SM08B-SURS-TF_1x08-1MP_P0.80mm_Horizontal","Connector_JST/JST_SUR_SM10B-SURS-TF_1x10-1MP_P0.80mm_Horizontal","Connector_JST/JST_SUR_SM12B-SURS-TF_1x12-1MP_P0.80mm_Horizontal","Connector_JST/JST_SUR_SM14B-SURS-TF_1x14-1MP_P0.80mm_Horizontal","Connector_JST/JST_SUR_SM15B-SURS-TF_1x15-1MP_P0.80mm_Horizontal","Connector_JST/JST_SUR_SM16B-SURS-TF_1x16-1MP_P0.80mm_Horizontal","Connector_JST/JST_SUR_SM17B-SURS-TF_1x17-1MP_P0.80mm_Horizontal","Connector_JST/JST_SUR_SM20B-SURS-TF_1x20-1MP_P0.80mm_Horizontal","Connector_JST/JST_SUR_SM22B-SURS-TF_1x22-1MP_P0.80mm_Horizontal","Connector_JST/JST_VH_B10P-VH-B_1x10_P3.96mm_Vertical","Connector_JST/JST_VH_B10P-VH-FB-B_1x10_P3.96mm_Vertical","Connector_JST/JST_VH_B10P-VH_1x10_P3.96mm_Vertical","Connector_JST/JST_VH_B10PS-VH_1x10_P3.96mm_Horizontal","Connector_JST/JST_VH_B11P-VH-B_1x11_P3.96mm_Vertical","Connector_JST/JST_VH_B2P-VH-B_1x02_P3.96mm_Vertical","Connector_JST/JST_VH_B2P-VH-FB-B_1x02_P3.96mm_Vertical","Connector_JST/JST_VH_B2P-VH_1x02_P3.96mm_Vertical","Connector_JST/JST_VH_B2P3-VH_1x02_P7.92mm_Vertical","Connector_JST/JST_VH_B2PS-VH_1x02_P3.96mm_Horizontal","Connector_JST/JST_VH_B3P-VH-B_1x03_P3.96mm_Vertical","Connector_JST/JST_VH_B3P-VH-FB-B_1x03_P3.96mm_Vertical","Connector_JST/JST_VH_B3P-VH_1x03_P3.96mm_Vertical","Connector_JST/JST_VH_B3PS-VH_1x03_P3.96mm_Horizontal","Connector_JST/JST_VH_B4P-VH-B_1x04_P3.96mm_Vertical","Connector_JST/JST_VH_B4P-VH-FB-B_1x04_P3.96mm_Vertical","Connector_JST/JST_VH_B4P-VH_1x04_P3.96mm_Vertical","Connector_JST/JST_VH_B4PS-VH_1x04_P3.96mm_Horizontal","Connector_JST/JST_VH_B5P-VH-B_1x05_P3.96mm_Vertical","Connector_JST/JST_VH_B5P-VH-FB-B_1x05_P3.96mm_Vertical","Connector_JST/JST_VH_B5P-VH_1x05_P3.96mm_Vertical","Connector_JST/JST_VH_B5PS-VH_1x05_P3.96mm_Horizontal","Connector_JST/JST_VH_B6P-VH-B_1x06_P3.96mm_Vertical","Connector_JST/JST_VH_B6P-VH-FB-B_1x06_P3.96mm_Vertical","Connector_JST/JST_VH_B6P-VH_1x06_P3.96mm_Vertical","Connector_JST/JST_VH_B6PS-VH_1x06_P3.96mm_Horizontal","Connector_JST/JST_VH_B7P-VH-B_1x07_P3.96mm_Vertical","Connector_JST/JST_VH_B7P-VH-FB-B_1x07_P3.96mm_Vertical","Connector_JST/JST_VH_B7P-VH_1x07_P3.96mm_Vertical","Connector_JST/JST_VH_B7PS-VH_1x07_P3.96mm_Horizontal","Connector_JST/JST_VH_B8P-VH-B_1x08_P3.96mm_Vertical","Connector_JST/JST_VH_B8P-VH-FB-B_1x08_P3.96mm_Vertical","Connector_JST/JST_VH_B8P-VH_1x08_P3.96mm_Vertical","Connector_JST/JST_VH_B8PS-VH_1x08_P3.96mm_Horizontal","Connector_JST/JST_VH_B9P-VH-B_1x09_P3.96mm_Vertical","Connector_JST/JST_VH_B9P-VH-FB-B_1x09_P3.96mm_Vertical","Connector_JST/JST_VH_B9P-VH_1x09_P3.96mm_Vertical","Connector_JST/JST_VH_B9PS-VH_1x09_P3.96mm_Horizontal","Connector_JST/JST_VH_S2P-VH_1x02_P3.96mm_Horizontal","Connector_JST/JST_VH_S3P-VH_1x03_P3.96mm_Horizontal","Connector_JST/JST_VH_S4P-VH_1x04_P3.96mm_Horizontal","Connector_JST/JST_VH_S5P-VH_1x05_P3.96mm_Horizontal","Connector_JST/JST_VH_S6P-VH_1x06_P3.96mm_Horizontal","Connector_JST/JST_VH_S7P-VH_1x07_P3.96mm_Horizontal","Connector_JST/JST_XAG_SM05B-XAGKS-BN-TB_1x05-1MP_P2.50mm_Horizontal","Connector_JST/JST_XA_B02B-XASK-1-A_1x02_P2.50mm_Vertical","Connector_JST/JST_XA_B02B-XASK-1_1x02_P2.50mm_Vertical","Connector_JST/JST_XA_B03B-XASK-1-A_1x03_P2.50mm_Vertical","Connector_JST/JST_XA_B03B-XASK-1_1x03_P2.50mm_Vertical","Connector_JST/JST_XA_B04B-XASK-1-A_1x04_P2.50mm_Vertical","Connector_JST/JST_XA_B04B-XASK-1_1x04_P2.50mm_Vertical","Connector_JST/JST_XA_B05B-XASK-1-A_1x05_P2.50mm_Vertical","Connector_JST/JST_XA_B05B-XASK-1_1x05_P2.50mm_Vertical","Connector_JST/JST_XA_B06B-XASK-1-A_1x06_P2.50mm_Vertical","Connector_JST/JST_XA_B06B-XASK-1_1x06_P2.50mm_Vertical","Connector_JST/JST_XA_B07B-XASK-1-A_1x07_P2.50mm_Vertical","Connector_JST/JST_XA_B07B-XASK-1_1x07_P2.50mm_Vertical","Connector_JST/JST_XA_B08B-XASK-1-A_1x08_P2.50mm_Vertical","Connector_JST/JST_XA_B08B-XASK-1_1x08_P2.50mm_Vertical","Connector_JST/JST_XA_B09B-XASK-1-A_1x09_P2.50mm_Vertical","Connector_JST/JST_XA_B09B-XASK-1_1x09_P2.50mm_Vertical","Connector_JST/JST_XA_B10B-XASK-1-A_1x10_P2.50mm_Vertical","Connector_JST/JST_XA_B10B-XASK-1_1x10_P2.50mm_Vertical","Connector_JST/JST_XA_B11B-XASK-1-A_1x11_P2.50mm_Vertical","Connector_JST/JST_XA_B11B-XASK-1_1x11_P2.50mm_Vertical","Connector_JST/JST_XA_B12B-XASK-1-A_1x12_P2.50mm_Vertical","Connector_JST/JST_XA_B12B-XASK-1_1x12_P2.50mm_Vertical","Connector_JST/JST_XA_B13B-XASK-1-A_1x13_P2.50mm_Vertical","Connector_JST/JST_XA_B13B-XASK-1_1x13_P2.50mm_Vertical","Connector_JST/JST_XA_B14B-XASK-1-A_1x14_P2.50mm_Vertical","Connector_JST/JST_XA_B14B-XASK-1_1x14_P2.50mm_Vertical","Connector_JST/JST_XA_B15B-XASK-1-A_1x15_P2.50mm_Vertical","Connector_JST/JST_XA_B15B-XASK-1_1x15_P2.50mm_Vertical","Connector_JST/JST_XA_B18B-XASK-1_1x18_P2.50mm_Vertical","Connector_JST/JST_XA_B20B-XASK-1-A_1x20_P2.50mm_Vertical","Connector_JST/JST_XA_B20B-XASK-1_1x20_P2.50mm_Vertical","Connector_JST/JST_XA_S02B-XASK-1N-BN_1x02_P2.50mm_Horizontal","Connector_JST/JST_XA_S02B-XASK-1_1x02_P2.50mm_Horizontal","Connector_JST/JST_XA_S03B-XASK-1N-BN_1x03_P2.50mm_Horizontal","Connector_JST/JST_XA_S03B-XASK-1_1x03_P2.50mm_Horizontal","Connector_JST/JST_XA_S04B-XASK-1N-BN_1x04_P2.50mm_Horizontal","Connector_JST/JST_XA_S04B-XASK-1_1x04_P2.50mm_Horizontal","Connector_JST/JST_XA_S05B-XASK-1N-BN_1x05_P2.50mm_Horizontal","Connector_JST/JST_XA_S05B-XASK-1_1x05_P2.50mm_Horizontal","Connector_JST/JST_XA_S06B-XASK-1N-BN_1x06_P2.50mm_Horizontal","Connector_JST/JST_XA_S06B-XASK-1_1x06_P2.50mm_Horizontal","Connector_JST/JST_XA_S07B-XASK-1N-BN_1x07_P2.50mm_Horizontal","Connector_JST/JST_XA_S07B-XASK-1_1x07_P2.50mm_Horizontal","Connector_JST/JST_XA_S08B-XASK-1N-BN_1x08_P2.50mm_Horizontal","Connector_JST/JST_XA_S08B-XASK-1_1x08_P2.50mm_Horizontal","Connector_JST/JST_XA_S09B-XASK-1N-BN_1x09_P2.50mm_Horizontal","Connector_JST/JST_XA_S09B-XASK-1_1x09_P2.50mm_Horizontal","Connector_JST/JST_XA_S10B-XASK-1N-BN_1x10_P2.50mm_Horizontal","Connector_JST/JST_XA_S10B-XASK-1_1x10_P2.50mm_Horizontal","Connector_JST/JST_XA_S11B-XASK-1N-BN_1x11_P2.50mm_Horizontal","Connector_JST/JST_XA_S11B-XASK-1_1x11_P2.50mm_Horizontal","Connector_JST/JST_XA_S12B-XASK-1N-BN_1x12_P2.50mm_Horizontal","Connector_JST/JST_XA_S12B-XASK-1_1x12_P2.50mm_Horizontal","Connector_JST/JST_XA_S13B-XASK-1N-BN_1x13_P2.50mm_Horizontal","Connector_JST/JST_XA_S13B-XASK-1_1x13_P2.50mm_Horizontal","Connector_JST/JST_XA_S14B-XASK-1N-BN_1x14_P2.50mm_Horizontal","Connector_JST/JST_XA_S14B-XASK-1_1x14_P2.50mm_Horizontal","Connector_JST/JST_XH_B10B-XH-AM_1x10_P2.50mm_Vertical","Connector_JST/JST_XH_B10B-XH-A_1x10_P2.50mm_Vertical","Connector_JST/JST_XH_B11B-XH-A_1x11_P2.50mm_Vertical","Connector_JST/JST_XH_B12B-XH-AM_1x12_P2.50mm_Vertical","Connector_JST/JST_XH_B12B-XH-A_1x12_P2.50mm_Vertical","Connector_JST/JST_XH_B13B-XH-A_1x13_P2.50mm_Vertical","Connector_JST/JST_XH_B14B-XH-A_1x14_P2.50mm_Vertical","Connector_JST/JST_XH_B15B-XH-A_1x15_P2.50mm_Vertical","Connector_JST/JST_XH_B16B-XH-A_1x16_P2.50mm_Vertical","Connector_JST/JST_XH_B1B-XH-AM_1x01_P2.50mm_Vertical","Connector_JST/JST_XH_B20B-XH-A_1x20_P2.50mm_Vertical","Connector_JST/JST_XH_B2B-XH-AM_1x02_P2.50mm_Vertical","Connector_JST/JST_XH_B2B-XH-A_1x02_P2.50mm_Vertical","Connector_JST/JST_XH_B3B-XH-AM_1x03_P2.50mm_Vertical","Connector_JST/JST_XH_B3B-XH-A_1x03_P2.50mm_Vertical","Connector_JST/JST_XH_B4B-XH-AM_1x04_P2.50mm_Vertical","Connector_JST/JST_XH_B4B-XH-A_1x04_P2.50mm_Vertical","Connector_JST/JST_XH_B5B-XH-AM_1x05_P2.50mm_Vertical","Connector_JST/JST_XH_B5B-XH-A_1x05_P2.50mm_Vertical","Connector_JST/JST_XH_B6B-XH-AM_1x06_P2.50mm_Vertical","Connector_JST/JST_XH_B6B-XH-A_1x06_P2.50mm_Vertical","Connector_JST/JST_XH_B7B-XH-AM_1x07_P2.50mm_Vertical","Connector_JST/JST_XH_B7B-XH-A_1x07_P2.50mm_Vertical","Connector_JST/JST_XH_B8B-XH-AM_1x08_P2.50mm_Vertical","Connector_JST/JST_XH_B8B-XH-A_1x08_P2.50mm_Vertical","Connector_JST/JST_XH_B9B-XH-AM_1x09_P2.50mm_Vertical","Connector_JST/JST_XH_B9B-XH-A_1x09_P2.50mm_Vertical","Connector_JST/JST_XH_S10B-XH-A-1_1x10_P2.50mm_Horizontal","Connector_JST/JST_XH_S10B-XH-A_1x10_P2.50mm_Horizontal","Connector_JST/JST_XH_S11B-XH-A-1_1x11_P2.50mm_Horizontal","Connector_JST/JST_XH_S11B-XH-A_1x11_P2.50mm_Horizontal","Connector_JST/JST_XH_S12B-XH-A-1_1x12_P2.50mm_Horizontal","Connector_JST/JST_XH_S12B-XH-A_1x12_P2.50mm_Horizontal","Connector_JST/JST_XH_S13B-XH-A-1_1x13_P2.50mm_Horizontal","Connector_JST/JST_XH_S13B-XH-A_1x13_P2.50mm_Horizontal","Connector_JST/JST_XH_S14B-XH-A-1_1x14_P2.50mm_Horizontal","Connector_JST/JST_XH_S14B-XH-A_1x14_P2.50mm_Horizontal","Connector_JST/JST_XH_S15B-XH-A-1_1x15_P2.50mm_Horizontal","Connector_JST/JST_XH_S15B-XH-A_1x15_P2.50mm_Horizontal","Connector_JST/JST_XH_S16B-XH-A_1x16_P2.50mm_Horizontal","Connector_JST/JST_XH_S2B-XH-A-1_1x02_P2.50mm_Horizontal","Connector_JST/JST_XH_S2B-XH-A_1x02_P2.50mm_Horizontal","Connector_JST/JST_XH_S3B-XH-A-1_1x03_P2.50mm_Horizontal","Connector_JST/JST_XH_S3B-XH-A_1x03_P2.50mm_Horizontal","Connector_JST/JST_XH_S3B-XH-SM4-TB_1x03-1MP_P2.50mm_Horizontal","Connector_JST/JST_XH_S4B-XH-A-1_1x04_P2.50mm_Horizontal","Connector_JST/JST_XH_S4B-XH-A_1x04_P2.50mm_Horizontal","Connector_JST/JST_XH_S4B-XH-SM4-TB_1x04-1MP_P2.50mm_Horizontal","Connector_JST/JST_XH_S5B-XH-A-1_1x05_P2.50mm_Horizontal","Connector_JST/JST_XH_S5B-XH-A_1x05_P2.50mm_Horizontal","Connector_JST/JST_XH_S6B-XH-A-1_1x06_P2.50mm_Horizontal","Connector_JST/JST_XH_S6B-XH-A_1x06_P2.50mm_Horizontal","Connector_JST/JST_XH_S6B-XH-SM4-TB_1x06-1MP_P2.50mm_Horizontal","Connector_JST/JST_XH_S7B-XH-A-1_1x07_P2.50mm_Horizontal","Connector_JST/JST_XH_S7B-XH-A_1x07_P2.50mm_Horizontal","Connector_JST/JST_XH_S8B-XH-A-1_1x08_P2.50mm_Horizontal","Connector_JST/JST_XH_S8B-XH-A_1x08_P2.50mm_Horizontal","Connector_JST/JST_XH_S9B-XH-A-1_1x09_P2.50mm_Horizontal","Connector_JST/JST_XH_S9B-XH-A_1x09_P2.50mm_Horizontal","Connector_JST/JST_ZE_B02B-ZESK-1D_1x02_P1.50mm_Vertical","Connector_JST/JST_ZE_B03B-ZESK-1D_1x03_P1.50mm_Vertical","Connector_JST/JST_ZE_B03B-ZESK-D_1x03_P1.50mm_Vertical","Connector_JST/JST_ZE_B04B-ZESK-1D_1x04_P1.50mm_Vertical","Connector_JST/JST_ZE_B04B-ZESK-D_1x04_P1.50mm_Vertical","Connector_JST/JST_ZE_B05B-ZESK-1D_1x05_P1.50mm_Vertical","Connector_JST/JST_ZE_B05B-ZESK-D_1x05_P1.50mm_Vertical","Connector_JST/JST_ZE_B06B-ZESK-1D_1x06_P1.50mm_Vertical","Connector_JST/JST_ZE_B06B-ZESK-D_1x06_P1.50mm_Vertical","Connector_JST/JST_ZE_B07B-ZESK-1D_1x07_P1.50mm_Vertical","Connector_JST/JST_ZE_B07B-ZESK-D_1x07_P1.50mm_Vertical","Connector_JST/JST_ZE_B08B-ZESK-1D_1x08_P1.50mm_Vertical","Connector_JST/JST_ZE_B08B-ZESK-D_1x08_P1.50mm_Vertical","Connector_JST/JST_ZE_B09B-ZESK-1D_1x09_P1.50mm_Vertical","Connector_JST/JST_ZE_B09B-ZESK-D_1x09_P1.50mm_Vertical","Connector_JST/JST_ZE_B10B-ZESK-1D_1x10_P1.50mm_Vertical","Connector_JST/JST_ZE_B10B-ZESK-D_1x10_P1.50mm_Vertical","Connector_JST/JST_ZE_B11B-ZESK-1D_1x11_P1.50mm_Vertical","Connector_JST/JST_ZE_B11B-ZESK-D_1x11_P1.50mm_Vertical","Connector_JST/JST_ZE_B12B-ZESK-1D_1x12_P1.50mm_Vertical","Connector_JST/JST_ZE_B12B-ZESK-D_1x12_P1.50mm_Vertical","Connector_JST/JST_ZE_B13B-ZESK-1D_1x13_P1.50mm_Vertical","Connector_JST/JST_ZE_B13B-ZESK-D_1x13_P1.50mm_Vertical","Connector_JST/JST_ZE_B14B-ZESK-1D_1x14_P1.50mm_Vertical","Connector_JST/JST_ZE_B14B-ZESK-D_1x14_P1.50mm_Vertical","Connector_JST/JST_ZE_B15B-ZESK-1D_1x15_P1.50mm_Vertical","Connector_JST/JST_ZE_B15B-ZESK-D_1x15_P1.50mm_Vertical","Connector_JST/JST_ZE_B16B-ZESK-1D_1x16_P1.50mm_Vertical","Connector_JST/JST_ZE_B16B-ZESK-D_1x16_P1.50mm_Vertical","Connector_JST/JST_ZE_BM02B-ZESS-TBT_1x02-1MP_P1.50mm_Vertical","Connector_JST/JST_ZE_BM03B-ZESS-TBT_1x03-1MP_P1.50mm_Vertical","Connector_JST/JST_ZE_BM04B-ZESS-TBT_1x04-1MP_P1.50mm_Vertical","Connector_JST/JST_ZE_BM05B-ZESS-TBT_1x05-1MP_P1.50mm_Vertical","Connector_JST/JST_ZE_BM06B-ZESS-TBT_1x06-1MP_P1.50mm_Vertical","Connector_JST/JST_ZE_BM07B-ZESS-TBT_1x07-1MP_P1.50mm_Vertical","Connector_JST/JST_ZE_BM08B-ZESS-TBT_1x08-1MP_P1.50mm_Vertical","Connector_JST/JST_ZE_BM09B-ZESS-TBT_1x09-1MP_P1.50mm_Vertical","Connector_JST/JST_ZE_BM10B-ZESS-TBT_1x10-1MP_P1.50mm_Vertical","Connector_JST/JST_ZE_BM11B-ZESS-TBT_1x11-1MP_P1.50mm_Vertical","Connector_JST/JST_ZE_BM12B-ZESS-TBT_1x12-1MP_P1.50mm_Vertical","Connector_JST/JST_ZE_BM13B-ZESS-TBT_1x13-1MP_P1.50mm_Vertical","Connector_JST/JST_ZE_BM14B-ZESS-TBT_1x14-1MP_P1.50mm_Vertical","Connector_JST/JST_ZE_BM15B-ZESS-TBT_1x15-1MP_P1.50mm_Vertical","Connector_JST/JST_ZE_BM16B-ZESS-TBT_1x16-1MP_P1.50mm_Vertical","Connector_JST/JST_ZE_S02B-ZESK-2D_1x02_P1.50mm_Horizontal","Connector_JST/JST_ZE_S03B-ZESK-2D_1x03_P1.50mm_Horizontal","Connector_JST/JST_ZE_S04B-ZESK-2D_1x04_P1.50mm_Horizontal","Connector_JST/JST_ZE_S05B-ZESK-2D_1x05_P1.50mm_Horizontal","Connector_JST/JST_ZE_S06B-ZESK-2D_1x06_P1.50mm_Horizontal","Connector_JST/JST_ZE_S07B-ZESK-2D_1x07_P1.50mm_Horizontal","Connector_JST/JST_ZE_S08B-ZESK-2D_1x08_P1.50mm_Horizontal","Connector_JST/JST_ZE_S09B-ZESK-2D_1x09_P1.50mm_Horizontal","Connector_JST/JST_ZE_S10B-ZESK-2D_1x10_P1.50mm_Horizontal","Connector_JST/JST_ZE_S11B-ZESK-2D_1x11_P1.50mm_Horizontal","Connector_JST/JST_ZE_S12B-ZESK-2D_1x12_P1.50mm_Horizontal","Connector_JST/JST_ZE_S13B-ZESK-2D_1x13_P1.50mm_Horizontal","Connector_JST/JST_ZE_S14B-ZESK-2D_1x14_P1.50mm_Horizontal","Connector_JST/JST_ZE_S15B-ZESK-2D_1x15_P1.50mm_Horizontal","Connector_JST/JST_ZE_S16B-ZESK-2D_1x16_P1.50mm_Horizontal","Connector_JST/JST_ZE_SM02B-ZESS-TB_1x02-1MP_P1.50mm_Horizontal","Connector_JST/JST_ZE_SM03B-ZESS-TB_1x03-1MP_P1.50mm_Horizontal","Connector_JST/JST_ZE_SM04B-ZESS-TB_1x04-1MP_P1.50mm_Horizontal","Connector_JST/JST_ZE_SM05B-ZESS-TB_1x05-1MP_P1.50mm_Horizontal","Connector_JST/JST_ZE_SM06B-ZESS-TB_1x06-1MP_P1.50mm_Horizontal","Connector_JST/JST_ZE_SM07B-ZESS-TB_1x07-1MP_P1.50mm_Horizontal","Connector_JST/JST_ZE_SM08B-ZESS-TB_1x08-1MP_P1.50mm_Horizontal","Connector_JST/JST_ZE_SM09B-ZESS-TB_1x09-1MP_P1.50mm_Horizontal","Connector_JST/JST_ZE_SM10B-ZESS-TB_1x10-1MP_P1.50mm_Horizontal","Connector_JST/JST_ZE_SM11B-ZESS-TB_1x11-1MP_P1.50mm_Horizontal","Connector_JST/JST_ZE_SM12B-ZESS-TB_1x12-1MP_P1.50mm_Horizontal","Connector_JST/JST_ZE_SM13B-ZESS-TB_1x13-1MP_P1.50mm_Horizontal","Connector_JST/JST_ZE_SM14B-ZESS-TB_1x14-1MP_P1.50mm_Horizontal","Connector_JST/JST_ZE_SM15B-ZESS-TB_1x15-1MP_P1.50mm_Horizontal","Connector_JST/JST_ZE_SM16B-ZESS-TB_1x16-1MP_P1.50mm_Horizontal","Connector_JST/JST_ZH_B10B-ZR-SM4-TF_1x10-1MP_P1.50mm_Vertical","Connector_JST/JST_ZH_B10B-ZR_1x10_P1.50mm_Vertical","Connector_JST/JST_ZH_B11B-ZR-SM4-TF_1x11-1MP_P1.50mm_Vertical","Connector_JST/JST_ZH_B11B-ZR_1x11_P1.50mm_Vertical","Connector_JST/JST_ZH_B12B-ZR-SM4-TF_1x12-1MP_P1.50mm_Vertical","Connector_JST/JST_ZH_B12B-ZR_1x12_P1.50mm_Vertical","Connector_JST/JST_ZH_B13B-ZR-SM4-TF_1x13-1MP_P1.50mm_Vertical","Connector_JST/JST_ZH_B2B-ZR-SM4-TF_1x02-1MP_P1.50mm_Vertical","Connector_JST/JST_ZH_B2B-ZR_1x02_P1.50mm_Vertical","Connector_JST/JST_ZH_B3B-ZR-SM4-TF_1x03-1MP_P1.50mm_Vertical","Connector_JST/JST_ZH_B3B-ZR_1x03_P1.50mm_Vertical","Connector_JST/JST_ZH_B4B-ZR-SM4-TF_1x04-1MP_P1.50mm_Vertical","Connector_JST/JST_ZH_B4B-ZR_1x04_P1.50mm_Vertical","Connector_JST/JST_ZH_B5B-ZR-SM4-TF_1x05-1MP_P1.50mm_Vertical","Connector_JST/JST_ZH_B5B-ZR_1x05_P1.50mm_Vertical","Connector_JST/JST_ZH_B6B-ZR-SM4-TF_1x06-1MP_P1.50mm_Vertical","Connector_JST/JST_ZH_B6B-ZR_1x06_P1.50mm_Vertical","Connector_JST/JST_ZH_B7B-ZR-SM4-TF_1x07-1MP_P1.50mm_Vertical","Connector_JST/JST_ZH_B7B-ZR_1x07_P1.50mm_Vertical","Connector_JST/JST_ZH_B8B-ZR-SM4-TF_1x08-1MP_P1.50mm_Vertical","Connector_JST/JST_ZH_B8B-ZR_1x08_P1.50mm_Vertical","Connector_JST/JST_ZH_B9B-ZR-SM4-TF_1x09-1MP_P1.50mm_Vertical","Connector_JST/JST_ZH_B9B-ZR_1x09_P1.50mm_Vertical","Connector_JST/JST_ZH_S10B-ZR-SM4A-TF_1x10-1MP_P1.50mm_Horizontal","Connector_JST/JST_ZH_S11B-ZR-SM4A-TF_1x11-1MP_P1.50mm_Horizontal","Connector_JST/JST_ZH_S12B-ZR-SM4A-TF_1x12-1MP_P1.50mm_Horizontal","Connector_JST/JST_ZH_S13B-ZR-SM4A-TF_1x13-1MP_P1.50mm_Horizontal","Connector_JST/JST_ZH_S2B-ZR-SM4A-TF_1x02-1MP_P1.50mm_Horizontal","Connector_JST/JST_ZH_S3B-ZR-SM4A-TF_1x03-1MP_P1.50mm_Horizontal","Connector_JST/JST_ZH_S4B-ZR-SM4A-TF_1x04-1MP_P1.50mm_Horizontal","Connector_JST/JST_ZH_S5B-ZR-SM4A-TF_1x05-1MP_P1.50mm_Horizontal","Connector_JST/JST_ZH_S6B-ZR-SM4A-TF_1x06-1MP_P1.50mm_Horizontal","Connector_JST/JST_ZH_S7B-ZR-SM4A-TF_1x07-1MP_P1.50mm_Horizontal","Connector_JST/JST_ZH_S8B-ZR-SM4A-TF_1x08-1MP_P1.50mm_Horizontal","Connector_JST/JST_ZH_S9B-ZR-SM4A-TF_1x09-1MP_P1.50mm_Horizontal","Connector_Molex/Molex_CLIK-Mate_502382-0270_1x02-1MP_P1.25mm_Vertical","Connector_Molex/Molex_CLIK-Mate_502382-0370_1x03-1MP_P1.25mm_Vertical","Connector_Molex/Molex_CLIK-Mate_502382-0470_1x04-1MP_P1.25mm_Vertical","Connector_Molex/Molex_CLIK-Mate_502382-0570_1x05-1MP_P1.25mm_Vertical","Connector_Molex/Molex_CLIK-Mate_502382-0670_1x06-1MP_P1.25mm_Vertical","Connector_Molex/Molex_CLIK-Mate_502382-0770_1x07-1MP_P1.25mm_Vertical","Connector_Molex/Molex_CLIK-Mate_502382-0870_1x08-1MP_P1.25mm_Vertical","Connector_Molex/Molex_CLIK-Mate_502382-0970_1x09-1MP_P1.25mm_Vertical","Connector_Molex/Molex_CLIK-Mate_502382-1070_1x10-1MP_P1.25mm_Vertical","Connector_Molex/Molex_CLIK-Mate_502382-1170_1x11-1MP_P1.25mm_Vertical","Connector_Molex/Molex_CLIK-Mate_502382-1270_1x12-1MP_P1.25mm_Vertical","Connector_Molex/Molex_CLIK-Mate_502382-1370_1x13-1MP_P1.25mm_Vertical","Connector_Molex/Molex_CLIK-Mate_502382-1470_1x14-1MP_P1.25mm_Vertical","Connector_Molex/Molex_CLIK-Mate_502382-1570_1x15-1MP_P1.25mm_Vertical","Connector_Molex/Molex_CLIK-Mate_502386-0270_1x02-1MP_P1.25mm_Horizontal","Connector_Molex/Molex_CLIK-Mate_502386-0370_1x03-1MP_P1.25mm_Horizontal","Connector_Molex/Molex_CLIK-Mate_502386-0470_1x04-1MP_P1.25mm_Horizontal","Connector_Molex/Molex_CLIK-Mate_502386-0570_1x05-1MP_P1.25mm_Horizontal","Connector_Molex/Molex_CLIK-Mate_502386-0670_1x06-1MP_P1.25mm_Horizontal","Connector_Molex/Molex_CLIK-Mate_502386-0770_1x07-1MP_P1.25mm_Horizontal","Connector_Molex/Molex_CLIK-Mate_502386-0870_1x08-1MP_P1.25mm_Horizontal","Connector_Molex/Molex_CLIK-Mate_502386-0970_1x09-1MP_P1.25mm_Horizontal","Connector_Molex/Molex_CLIK-Mate_502386-1070_1x10-1MP_P1.25mm_Horizontal","Connector_Molex/Molex_CLIK-Mate_502386-1170_1x11-1MP_P1.25mm_Horizontal","Connector_Molex/Molex_CLIK-Mate_502386-1270_1x12-1MP_P1.25mm_Horizontal","Connector_Molex/Molex_CLIK-Mate_502386-1370_1x13-1MP_P1.25mm_Horizontal","Connector_Molex/Molex_CLIK-Mate_502386-1470_1x14-1MP_P1.25mm_Horizontal","Connector_Molex/Molex_CLIK-Mate_502386-1570_1x15-1MP_P1.25mm_Horizontal","Connector_Molex/Molex_CLIK-Mate_502443-0270_1x02-1MP_P2.00mm_Vertical","Connector_Molex/Molex_CLIK-Mate_502443-0370_1x03-1MP_P2.00mm_Vertical","Connector_Molex/Molex_CLIK-Mate_502443-0470_1x04-1MP_P2.00mm_Vertical","Connector_Molex/Molex_CLIK-Mate_502443-0570_1x05-1MP_P2.00mm_Vertical","Connector_Molex/Molex_CLIK-Mate_502443-0670_1x06-1MP_P2.00mm_Vertical","Connector_Molex/Molex_CLIK-Mate_502443-0770_1x07-1MP_P2.00mm_Vertical","Connector_Molex/Molex_CLIK-Mate_502443-0870_1x08-1MP_P2.00mm_Vertical","Connector_Molex/Molex_CLIK-Mate_502443-0970_1x09-1MP_P2.00mm_Vertical","Connector_Molex/Molex_CLIK-Mate_502443-1270_1x12-1MP_P2.00mm_Vertical","Connector_Molex/Molex_CLIK-Mate_502443-1370_1x13-1MP_P2.00mm_Vertical","Connector_Molex/Molex_CLIK-Mate_502443-1470_1x14-1MP_P2.00mm_Vertical","Connector_Molex/Molex_CLIK-Mate_502443-1570_1x15-1MP_P2.00mm_Vertical","Connector_Molex/Molex_CLIK-Mate_502494-0270_1x02-1MP_P2.00mm_Horizontal","Connector_Molex/Molex_CLIK-Mate_502494-0370_1x03-1MP_P2.00mm_Horizontal","Connector_Molex/Molex_CLIK-Mate_502494-0470_1x04-1MP_P2.00mm_Horizontal","Connector_Molex/Molex_CLIK-Mate_502494-0670_1x06-1MP_P2.00mm_Horizontal","Connector_Molex/Molex_CLIK-Mate_502494-0870_1x08-1MP_P2.00mm_Horizontal","Connector_Molex/Molex_CLIK-Mate_502494-1070_1x10-1MP_P2.00mm_Horizontal","Connector_Molex/Molex_CLIK-Mate_502494-1270_1x12-1MP_P2.00mm_Horizontal","Connector_Molex/Molex_CLIK-Mate_502494-1370_1x13-1MP_P2.00mm_Horizontal","Connector_Molex/Molex_CLIK-Mate_502494-1470_1x14-1MP_P2.00mm_Horizontal","Connector_Molex/Molex_CLIK-Mate_502494-1570_1x15-1MP_P2.00mm_Horizontal","Connector_Molex/Molex_CLIK-Mate_502585-0270_1x02-1MP_P1.50mm_Horizontal","Connector_Molex/Molex_CLIK-Mate_502585-0370_1x03-1MP_P1.50mm_Horizontal","Connector_Molex/Molex_CLIK-Mate_502585-0470_1x04-1MP_P1.50mm_Horizontal","Connector_Molex/Molex_CLIK-Mate_502585-0570_1x05-1MP_P1.50mm_Horizontal","Connector_Molex/Molex_CLIK-Mate_502585-0670_1x06-1MP_P1.50mm_Horizontal","Connector_Molex/Molex_CLIK-Mate_502585-0770_1x07-1MP_P1.50mm_Horizontal","Connector_Molex/Molex_CLIK-Mate_502585-0870_1x08-1MP_P1.50mm_Horizontal","Connector_Molex/Molex_CLIK-Mate_502585-0970_1x09-1MP_P1.50mm_Horizontal","Connector_Molex/Molex_CLIK-Mate_502585-1070_1x10-1MP_P1.50mm_Horizontal","Connector_Molex/Molex_CLIK-Mate_502585-1170_1x11-1MP_P1.50mm_Horizontal","Connector_Molex/Molex_CLIK-Mate_502585-1270_1x12-1MP_P1.50mm_Horizontal","Connector_Molex/Molex_CLIK-Mate_502585-1370_1x13-1MP_P1.50mm_Horizontal","Connector_Molex/Molex_CLIK-Mate_502585-1470_1x14-1MP_P1.50mm_Horizontal","Connector_Molex/Molex_CLIK-Mate_502585-1570_1x15-1MP_P1.50mm_Horizontal","Connector_Molex/Molex_CLIK-Mate_505405-0270_1x02-1MP_P1.50mm_Vertical","Connector_Molex/Molex_CLIK-Mate_505405-0370_1x03-1MP_P1.50mm_Vertical","Connector_Molex/Molex_CLIK-Mate_505405-0470_1x04-1MP_P1.50mm_Vertical","Connector_Molex/Molex_CLIK-Mate_505405-0570_1x05-1MP_P1.50mm_Vertical","Connector_Molex/Molex_CLIK-Mate_505405-0670_1x06-1MP_P1.50mm_Vertical","Connector_Molex/Molex_CLIK-Mate_505405-0770_1x07-1MP_P1.50mm_Vertical","Connector_Molex/Molex_CLIK-Mate_505405-0870_1x08-1MP_P1.50mm_Vertical","Connector_Molex/Molex_CLIK-Mate_505405-0970_1x09-1MP_P1.50mm_Vertical","Connector_Molex/Molex_CLIK-Mate_505405-1070_1x10-1MP_P1.50mm_Vertical","Connector_Molex/Molex_CLIK-Mate_505405-1170_1x11-1MP_P1.50mm_Vertical","Connector_Molex/Molex_CLIK-Mate_505405-1270_1x12-1MP_P1.50mm_Vertical","Connector_Molex/Molex_CLIK-Mate_505405-1370_1x13-1MP_P1.50mm_Vertical","Connector_Molex/Molex_CLIK-Mate_505405-1470_1x14-1MP_P1.50mm_Vertical","Connector_Molex/Molex_CLIK-Mate_505405-1570_1x15-1MP_P1.50mm_Vertical","Connector_Molex/Molex_DuraClik_502352-0200_1x02-1MP_P2.00mm_Horizontal","Connector_Molex/Molex_DuraClik_502352-0300_1x03-1MP_P2.00mm_Horizontal","Connector_Molex/Molex_DuraClik_502352-0400_1x04-1MP_P2.00mm_Horizontal","Connector_Molex/Molex_DuraClik_502352-0500_1x05-1MP_P2.00mm_Horizontal","Connector_Molex/Molex_DuraClik_502352-0600_1x06-1MP_P2.00mm_Horizontal","Connector_Molex/Molex_DuraClik_502352-0700_1x07-1MP_P2.00mm_Horizontal","Connector_Molex/Molex_DuraClik_502352-0800_1x08-1MP_P2.00mm_Horizontal","Connector_Molex/Molex_DuraClik_502352-0900_1x09-1MP_P2.00mm_Horizontal","Connector_Molex/Molex_DuraClik_502352-1000_1x10-1MP_P2.00mm_Horizontal","Connector_Molex/Molex_DuraClik_502352-1100_1x11-1MP_P2.00mm_Horizontal","Connector_Molex/Molex_DuraClik_502352-1200_1x12-1MP_P2.00mm_Horizontal","Connector_Molex/Molex_DuraClik_502352-1300_1x13-1MP_P2.00mm_Horizontal","Connector_Molex/Molex_DuraClik_502352-1400_1x14-1MP_P2.00mm_Horizontal","Connector_Molex/Molex_DuraClik_502352-1500_1x15-1MP_P2.00mm_Horizontal","Connector_Molex/Molex_KK-254_AE-6410-02A_1x02_P2.54mm_Vertical","Connector_Molex/Molex_KK-254_AE-6410-03A_1x03_P2.54mm_Vertical","Connector_Molex/Molex_KK-254_AE-6410-04A_1x04_P2.54mm_Vertical","Connector_Molex/Molex_KK-254_AE-6410-05A_1x05_P2.54mm_Vertical","Connector_Molex/Molex_KK-254_AE-6410-06A_1x06_P2.54mm_Vertical","Connector_Molex/Molex_KK-254_AE-6410-07A_1x07_P2.54mm_Vertical","Connector_Molex/Molex_KK-254_AE-6410-08A_1x08_P2.54mm_Vertical","Connector_Molex/Molex_KK-254_AE-6410-09A_1x09_P2.54mm_Vertical","Connector_Molex/Molex_KK-254_AE-6410-10A_1x10_P2.54mm_Vertical","Connector_Molex/Molex_KK-254_AE-6410-11A_1x11_P2.54mm_Vertical","Connector_Molex/Molex_KK-254_AE-6410-12A_1x12_P2.54mm_Vertical","Connector_Molex/Molex_KK-254_AE-6410-13A_1x13_P2.54mm_Vertical","Connector_Molex/Molex_KK-254_AE-6410-14A_1x14_P2.54mm_Vertical","Connector_Molex/Molex_KK-254_AE-6410-15A_1x15_P2.54mm_Vertical","Connector_Molex/Molex_KK-254_AE-6410-16A_1x16_P2.54mm_Vertical","Connector_Molex/Molex_KK-396_5273-02A_1x02_P3.96mm_Vertical","Connector_Molex/Molex_KK-396_5273-03A_1x03_P3.96mm_Vertical","Connector_Molex/Molex_KK-396_5273-04A_1x04_P3.96mm_Vertical","Connector_Molex/Molex_KK-396_5273-05A_1x05_P3.96mm_Vertical","Connector_Molex/Molex_KK-396_5273-06A_1x06_P3.96mm_Vertical","Connector_Molex/Molex_KK-396_5273-07A_1x07_P3.96mm_Vertical","Connector_Molex/Molex_KK-396_5273-08A_1x08_P3.96mm_Vertical","Connector_Molex/Molex_KK-396_5273-09A_1x09_P3.96mm_Vertical","Connector_Molex/Molex_KK-396_5273-10A_1x10_P3.96mm_Vertical","Connector_Molex/Molex_KK-396_5273-11A_1x11_P3.96mm_Vertical","Connector_Molex/Molex_KK-396_5273-12A_1x12_P3.96mm_Vertical","Connector_Molex/Molex_KK-396_A-41791-0002_1x02_P3.96mm_Vertical","Connector_Molex/Molex_KK-396_A-41791-0003_1x03_P3.96mm_Vertical","Connector_Molex/Molex_KK-396_A-41791-0004_1x04_P3.96mm_Vertical","Connector_Molex/Molex_KK-396_A-41791-0005_1x05_P3.96mm_Vertical","Connector_Molex/Molex_KK-396_A-41791-0006_1x06_P3.96mm_Vertical","Connector_Molex/Molex_KK-396_A-41791-0007_1x07_P3.96mm_Vertical","Connector_Molex/Molex_KK-396_A-41791-0008_1x08_P3.96mm_Vertical","Connector_Molex/Molex_KK-396_A-41791-0009_1x09_P3.96mm_Vertical","Connector_Molex/Molex_KK-396_A-41791-0010_1x10_P3.96mm_Vertical","Connector_Molex/Molex_KK-396_A-41791-0011_1x11_P3.96mm_Vertical","Connector_Molex/Molex_KK-396_A-41791-0012_1x12_P3.96mm_Vertical","Connector_Molex/Molex_KK-396_A-41791-0013_1x13_P3.96mm_Vertical","Connector_Molex/Molex_KK-396_A-41791-0014_1x14_P3.96mm_Vertical","Connector_Molex/Molex_KK-396_A-41791-0015_1x15_P3.96mm_Vertical","Connector_Molex/Molex_KK-396_A-41791-0016_1x16_P3.96mm_Vertical","Connector_Molex/Molex_KK-396_A-41791-0017_1x17_P3.96mm_Vertical","Connector_Molex/Molex_KK-396_A-41791-0018_1x18_P3.96mm_Vertical","Connector_Molex/Molex_KK-396_A-41792-0002_1x02_P3.96mm_Horizontal","Connector_Molex/Molex_KK-396_A-41792-0003_1x03_P3.96mm_Horizontal","Connector_Molex/Molex_KK-396_A-41792-0004_1x04_P3.96mm_Horizontal","Connector_Molex/Molex_KK-396_A-41792-0005_1x05_P3.96mm_Horizontal","Connector_Molex/Molex_KK-396_A-41792-0006_1x06_P3.96mm_Horizontal","Connector_Molex/Molex_KK-396_A-41792-0007_1x07_P3.96mm_Horizontal","Connector_Molex/Molex_KK-396_A-41792-0008_1x08_P3.96mm_Horizontal","Connector_Molex/Molex_KK-396_A-41792-0009_1x09_P3.96mm_Horizontal","Connector_Molex/Molex_KK-396_A-41792-0010_1x10_P3.96mm_Horizontal","Connector_Molex/Molex_KK-396_A-41792-0011_1x11_P3.96mm_Horizontal","Connector_Molex/Molex_KK-396_A-41792-0012_1x12_P3.96mm_Horizontal","Connector_Molex/Molex_KK-396_A-41792-0013_1x13_P3.96mm_Horizontal","Connector_Molex/Molex_KK-396_A-41792-0014_1x14_P3.96mm_Horizontal","Connector_Molex/Molex_KK-396_A-41792-0015_1x15_P3.96mm_Horizontal","Connector_Molex/Molex_KK-396_A-41792-0016_1x16_P3.96mm_Horizontal","Connector_Molex/Molex_KK-396_A-41792-0017_1x17_P3.96mm_Horizontal","Connector_Molex/Molex_KK-396_A-41792-0018_1x18_P3.96mm_Horizontal","Connector_Molex/Molex_Mega-Fit_76825-0002_2x01_P5.70mm_Horizontal","Connector_Molex/Molex_Mega-Fit_76825-0004_2x02_P5.70mm_Horizontal","Connector_Molex/Molex_Mega-Fit_76825-0006_2x03_P5.70mm_Horizontal","Connector_Molex/Molex_Mega-Fit_76825-0008_2x04_P5.70mm_Horizontal","Connector_Molex/Molex_Mega-Fit_76825-0010_2x05_P5.70mm_Horizontal","Connector_Molex/Molex_Mega-Fit_76825-0012_2x06_P5.70mm_Horizontal","Connector_Molex/Molex_Mega-Fit_76829-0002_2x01_P5.70mm_Vertical","Connector_Molex/Molex_Mega-Fit_76829-0004_2x02_P5.70mm_Vertical","Connector_Molex/Molex_Mega-Fit_76829-0006_2x03_P5.70mm_Vertical","Connector_Molex/Molex_Mega-Fit_76829-0008_2x04_P5.70mm_Vertical","Connector_Molex/Molex_Mega-Fit_76829-0010_2x05_P5.70mm_Vertical","Connector_Molex/Molex_Mega-Fit_76829-0012_2x06_P5.70mm_Vertical","Connector_Molex/Molex_Mega-Fit_76829-0102_2x01_P5.70mm_Vertical","Connector_Molex/Molex_Mega-Fit_76829-0104_2x02_P5.70mm_Vertical","Connector_Molex/Molex_Mega-Fit_76829-0106_2x03_P5.70mm_Vertical","Connector_Molex/Molex_Mega-Fit_76829-0108_2x04_P5.70mm_Vertical","Connector_Molex/Molex_Mega-Fit_76829-0110_2x05_P5.70mm_Vertical","Connector_Molex/Molex_Mega-Fit_76829-0112_2x06_P5.70mm_Vertical","Connector_Molex/Molex_Micro-Fit_3.0_43045-0200_2x01_P3.00mm_Horizontal","Connector_Molex/Molex_Micro-Fit_3.0_43045-0210_2x01-1MP_P3.00mm_Horizontal","Connector_Molex/Molex_Micro-Fit_3.0_43045-0212_2x01_P3.00mm_Vertical","Connector_Molex/Molex_Micro-Fit_3.0_43045-0215_2x01_P3.00mm_Vertical","Connector_Molex/Molex_Micro-Fit_3.0_43045-0218_2x01-1MP_P3.00mm_Vertical","Connector_Molex/Molex_Micro-Fit_3.0_43045-0221_2x01-1MP_P3.00mm_Horizontal","Connector_Molex/Molex_Micro-Fit_3.0_43045-0400_2x02_P3.00mm_Horizontal","Connector_Molex/Molex_Micro-Fit_3.0_43045-0410_2x02-1MP_P3.00mm_Horizontal","Connector_Molex/Molex_Micro-Fit_3.0_43045-0412_2x02_P3.00mm_Vertical","Connector_Molex/Molex_Micro-Fit_3.0_43045-0415_2x02_P3.00mm_Vertical","Connector_Molex/Molex_Micro-Fit_3.0_43045-0418_2x02-1MP_P3.00mm_Vertical","Connector_Molex/Molex_Micro-Fit_3.0_43045-0421_2x02-1MP_P3.00mm_Horizontal","Connector_Molex/Molex_Micro-Fit_3.0_43045-0600_2x03_P3.00mm_Horizontal","Connector_Molex/Molex_Micro-Fit_3.0_43045-0610_2x03-1MP_P3.00mm_Horizontal","Connector_Molex/Molex_Micro-Fit_3.0_43045-0612_2x03_P3.00mm_Vertical","Connector_Molex/Molex_Micro-Fit_3.0_43045-0615_2x03_P3.00mm_Vertical","Connector_Molex/Molex_Micro-Fit_3.0_43045-0618_2x03-1MP_P3.00mm_Vertical","Connector_Molex/Molex_Micro-Fit_3.0_43045-0621_2x03-1MP_P3.00mm_Horizontal","Connector_Molex/Molex_Micro-Fit_3.0_43045-0800_2x04_P3.00mm_Horizontal","Connector_Molex/Molex_Micro-Fit_3.0_43045-0810_2x04-1MP_P3.00mm_Horizontal","Connector_Molex/Molex_Micro-Fit_3.0_43045-0812_2x04_P3.00mm_Vertical","Connector_Molex/Molex_Micro-Fit_3.0_43045-0815_2x04_P3.00mm_Vertical","Connector_Molex/Molex_Micro-Fit_3.0_43045-0818_2x04-1MP_P3.00mm_Vertical","Connector_Molex/Molex_Micro-Fit_3.0_43045-0821_2x04-1MP_P3.00mm_Horizontal","Connector_Molex/Molex_Micro-Fit_3.0_43045-1000_2x05_P3.00mm_Horizontal","Connector_Molex/Molex_Micro-Fit_3.0_43045-1010_2x05-1MP_P3.00mm_Horizontal","Connector_Molex/Molex_Micro-Fit_3.0_43045-1012_2x05_P3.00mm_Vertical","Connector_Molex/Molex_Micro-Fit_3.0_43045-1015_2x05_P3.00mm_Vertical","Connector_Molex/Molex_Micro-Fit_3.0_43045-1018_2x05-1MP_P3.00mm_Vertical","Connector_Molex/Molex_Micro-Fit_3.0_43045-1021_2x05-1MP_P3.00mm_Horizontal","Connector_Molex/Molex_Micro-Fit_3.0_43045-1200_2x06_P3.00mm_Horizontal","Connector_Molex/Molex_Micro-Fit_3.0_43045-1210_2x06-1MP_P3.00mm_Horizontal","Connector_Molex/Molex_Micro-Fit_3.0_43045-1212_2x06_P3.00mm_Vertical","Connector_Molex/Molex_Micro-Fit_3.0_43045-1215_2x06_P3.00mm_Vertical","Connector_Molex/Molex_Micro-Fit_3.0_43045-1218_2x06-1MP_P3.00mm_Vertical","Connector_Molex/Molex_Micro-Fit_3.0_43045-1221_2x06-1MP_P3.00mm_Horizontal","Connector_Molex/Molex_Micro-Fit_3.0_43045-1400_2x07_P3.00mm_Horizontal","Connector_Molex/Molex_Micro-Fit_3.0_43045-1410_2x07-1MP_P3.00mm_Horizontal","Connector_Molex/Molex_Micro-Fit_3.0_43045-1412_2x07_P3.00mm_Vertical","Connector_Molex/Molex_Micro-Fit_3.0_43045-1415_2x07_P3.00mm_Vertical","Connector_Molex/Molex_Micro-Fit_3.0_43045-1418_2x07-1MP_P3.00mm_Vertical","Connector_Molex/Molex_Micro-Fit_3.0_43045-1421_2x07-1MP_P3.00mm_Horizontal","Connector_Molex/Molex_Micro-Fit_3.0_43045-1600_2x08_P3.00mm_Horizontal","Connector_Molex/Molex_Micro-Fit_3.0_43045-1610_2x08-1MP_P3.00mm_Horizontal","Connector_Molex/Molex_Micro-Fit_3.0_43045-1612_2x08_P3.00mm_Vertical","Connector_Molex/Molex_Micro-Fit_3.0_43045-1615_2x08_P3.00mm_Vertical","Connector_Molex/Molex_Micro-Fit_3.0_43045-1618_2x08-1MP_P3.00mm_Vertical","Connector_Molex/Molex_Micro-Fit_3.0_43045-1621_2x08-1MP_P3.00mm_Horizontal","Connector_Molex/Molex_Micro-Fit_3.0_43045-1800_2x09_P3.00mm_Horizontal","Connector_Molex/Molex_Micro-Fit_3.0_43045-1810_2x09-1MP_P3.00mm_Horizontal","Connector_Molex/Molex_Micro-Fit_3.0_43045-1812_2x09_P3.00mm_Vertical","Connector_Molex/Molex_Micro-Fit_3.0_43045-1815_2x09_P3.00mm_Vertical","Connector_Molex/Molex_Micro-Fit_3.0_43045-1818_2x09-1MP_P3.00mm_Vertical","Connector_Molex/Molex_Micro-Fit_3.0_43045-1821_2x09-1MP_P3.00mm_Horizontal","Connector_Molex/Molex_Micro-Fit_3.0_43045-2000_2x10_P3.00mm_Horizontal","Connector_Molex/Molex_Micro-Fit_3.0_43045-2010_2x10-1MP_P3.00mm_Horizontal","Connector_Molex/Molex_Micro-Fit_3.0_43045-2012_2x10_P3.00mm_Vertical","Connector_Molex/Molex_Micro-Fit_3.0_43045-2015_2x10_P3.00mm_Vertical","Connector_Molex/Molex_Micro-Fit_3.0_43045-2018_2x10-1MP_P3.00mm_Vertical","Connector_Molex/Molex_Micro-Fit_3.0_43045-2021_2x10-1MP_P3.00mm_Horizontal","Connector_Molex/Molex_Micro-Fit_3.0_43045-2200_2x11_P3.00mm_Horizontal","Connector_Molex/Molex_Micro-Fit_3.0_43045-2210_2x11-1MP_P3.00mm_Horizontal","Connector_Molex/Molex_Micro-Fit_3.0_43045-2212_2x11_P3.00mm_Vertical","Connector_Molex/Molex_Micro-Fit_3.0_43045-2215_2x11_P3.00mm_Vertical","Connector_Molex/Molex_Micro-Fit_3.0_43045-2218_2x11-1MP_P3.00mm_Vertical","Connector_Molex/Molex_Micro-Fit_3.0_43045-2221_2x11-1MP_P3.00mm_Horizontal","Connector_Molex/Molex_Micro-Fit_3.0_43045-2400_2x12_P3.00mm_Horizontal","Connector_Molex/Molex_Micro-Fit_3.0_43045-2410_2x12-1MP_P3.00mm_Horizontal","Connector_Molex/Molex_Micro-Fit_3.0_43045-2412_2x12_P3.00mm_Vertical","Connector_Molex/Molex_Micro-Fit_3.0_43045-2415_2x12_P3.00mm_Vertical","Connector_Molex/Molex_Micro-Fit_3.0_43045-2418_2x12-1MP_P3.00mm_Vertical","Connector_Molex/Molex_Micro-Fit_3.0_43045-2421_2x12-1MP_P3.00mm_Horizontal","Connector_Molex/Molex_Micro-Fit_3.0_43650-0200_1x02_P3.00mm_Horizontal","Connector_Molex/Molex_Micro-Fit_3.0_43650-0210_1x02-1MP_P3.00mm_Horizontal","Connector_Molex/Molex_Micro-Fit_3.0_43650-0210_1x02-1MP_P3.00mm_Horizontal_PnP","Connector_Molex/Molex_Micro-Fit_3.0_43650-0212_1x02-1MP_P3.00mm_Horizontal","Connector_Molex/Molex_Micro-Fit_3.0_43650-0215_1x02_P3.00mm_Vertical","Connector_Molex/Molex_Micro-Fit_3.0_43650-0221_1x02_P3.00mm_Vertical","Connector_Molex/Molex_Micro-Fit_3.0_43650-0224_1x02-1MP_P3.00mm_Vertical","Connector_Molex/Molex_Micro-Fit_3.0_43650-0300_1x03_P3.00mm_Horizontal","Connector_Molex/Molex_Micro-Fit_3.0_43650-0310_1x03-1MP_P3.00mm_Horizontal","Connector_Molex/Molex_Micro-Fit_3.0_43650-0310_1x03-1MP_P3.00mm_Horizontal_PnP","Connector_Molex/Molex_Micro-Fit_3.0_43650-0312_1x03-1MP_P3.00mm_Horizontal","Connector_Molex/Molex_Micro-Fit_3.0_43650-0315_1x03_P3.00mm_Vertical","Connector_Molex/Molex_Micro-Fit_3.0_43650-0321_1x03_P3.00mm_Vertical","Connector_Molex/Molex_Micro-Fit_3.0_43650-0324_1x03-1MP_P3.00mm_Vertical","Connector_Molex/Molex_Micro-Fit_3.0_43650-0400_1x04_P3.00mm_Horizontal","Connector_Molex/Molex_Micro-Fit_3.0_43650-0410_1x04-1MP_P3.00mm_Horizontal","Connector_Molex/Molex_Micro-Fit_3.0_43650-0410_1x04-1MP_P3.00mm_Horizontal_PnP","Connector_Molex/Molex_Micro-Fit_3.0_43650-0412_1x04-1MP_P3.00mm_Horizontal","Connector_Molex/Molex_Micro-Fit_3.0_43650-0415_1x04_P3.00mm_Vertical","Connector_Molex/Molex_Micro-Fit_3.0_43650-0421_1x04_P3.00mm_Vertical","Connector_Molex/Molex_Micro-Fit_3.0_43650-0424_1x04-1MP_P3.00mm_Vertical","Connector_Molex/Molex_Micro-Fit_3.0_43650-0500_1x05_P3.00mm_Horizontal","Connector_Molex/Molex_Micro-Fit_3.0_43650-0510_1x05-1MP_P3.00mm_Horizontal","Connector_Molex/Molex_Micro-Fit_3.0_43650-0510_1x05-1MP_P3.00mm_Horizontal_PnP","Connector_Molex/Molex_Micro-Fit_3.0_43650-0512_1x05-1MP_P3.00mm_Horizontal","Connector_Molex/Molex_Micro-Fit_3.0_43650-0515_1x05_P3.00mm_Vertical","Connector_Molex/Molex_Micro-Fit_3.0_43650-0521_1x05_P3.00mm_Vertical","Connector_Molex/Molex_Micro-Fit_3.0_43650-0524_1x05-1MP_P3.00mm_Vertical","Connector_Molex/Molex_Micro-Fit_3.0_43650-0600_1x06_P3.00mm_Horizontal","Connector_Molex/Molex_Micro-Fit_3.0_43650-0610_1x06-1MP_P3.00mm_Horizontal","Connector_Molex/Molex_Micro-Fit_3.0_43650-0610_1x06-1MP_P3.00mm_Horizontal_PnP","Connector_Molex/Molex_Micro-Fit_3.0_43650-0612_1x06-1MP_P3.00mm_Horizontal","Connector_Molex/Molex_Micro-Fit_3.0_43650-0615_1x06_P3.00mm_Vertical","Connector_Molex/Molex_Micro-Fit_3.0_43650-0621_1x06_P3.00mm_Vertical","Connector_Molex/Molex_Micro-Fit_3.0_43650-0624_1x06-1MP_P3.00mm_Vertical","Connector_Molex/Molex_Micro-Fit_3.0_43650-0700_1x07_P3.00mm_Horizontal","Connector_Molex/Molex_Micro-Fit_3.0_43650-0710_1x07-1MP_P3.00mm_Horizontal","Connector_Molex/Molex_Micro-Fit_3.0_43650-0710_1x07-1MP_P3.00mm_Horizontal_PnP","Connector_Molex/Molex_Micro-Fit_3.0_43650-0712_1x07-1MP_P3.00mm_Horizontal","Connector_Molex/Molex_Micro-Fit_3.0_43650-0715_1x07_P3.00mm_Vertical","Connector_Molex/Molex_Micro-Fit_3.0_43650-0721_1x07_P3.00mm_Vertical","Connector_Molex/Molex_Micro-Fit_3.0_43650-0724_1x07-1MP_P3.00mm_Vertical","Connector_Molex/Molex_Micro-Fit_3.0_43650-0800_1x08_P3.00mm_Horizontal","Connector_Molex/Molex_Micro-Fit_3.0_43650-0810_1x08-1MP_P3.00mm_Horizontal","Connector_Molex/Molex_Micro-Fit_3.0_43650-0810_1x08-1MP_P3.00mm_Horizontal_PnP","Connector_Molex/Molex_Micro-Fit_3.0_43650-0812_1x08-1MP_P3.00mm_Horizontal","Connector_Molex/Molex_Micro-Fit_3.0_43650-0815_1x08_P3.00mm_Vertical","Connector_Molex/Molex_Micro-Fit_3.0_43650-0821_1x08_P3.00mm_Vertical","Connector_Molex/Molex_Micro-Fit_3.0_43650-0824_1x08-1MP_P3.00mm_Vertical","Connector_Molex/Molex_Micro-Fit_3.0_43650-0900_1x09_P3.00mm_Horizontal","Connector_Molex/Molex_Micro-Fit_3.0_43650-0910_1x09-1MP_P3.00mm_Horizontal","Connector_Molex/Molex_Micro-Fit_3.0_43650-0910_1x09-1MP_P3.00mm_Horizontal_PnP","Connector_Molex/Molex_Micro-Fit_3.0_43650-0912_1x09-1MP_P3.00mm_Horizontal","Connector_Molex/Molex_Micro-Fit_3.0_43650-0915_1x09_P3.00mm_Vertical","Connector_Molex/Molex_Micro-Fit_3.0_43650-0921_1x09_P3.00mm_Vertical","Connector_Molex/Molex_Micro-Fit_3.0_43650-0924_1x09-1MP_P3.00mm_Vertical","Connector_Molex/Molex_Micro-Fit_3.0_43650-1000_1x10_P3.00mm_Horizontal","Connector_Molex/Molex_Micro-Fit_3.0_43650-1010_1x10-1MP_P3.00mm_Horizontal","Connector_Molex/Molex_Micro-Fit_3.0_43650-1010_1x10-1MP_P3.00mm_Horizontal_PnP","Connector_Molex/Molex_Micro-Fit_3.0_43650-1012_1x10-1MP_P3.00mm_Horizontal","Connector_Molex/Molex_Micro-Fit_3.0_43650-1015_1x10_P3.00mm_Vertical","Connector_Molex/Molex_Micro-Fit_3.0_43650-1021_1x10_P3.00mm_Vertical","Connector_Molex/Molex_Micro-Fit_3.0_43650-1024_1x10-1MP_P3.00mm_Vertical","Connector_Molex/Molex_Micro-Fit_3.0_43650-1100_1x11_P3.00mm_Horizontal","Connector_Molex/Molex_Micro-Fit_3.0_43650-1110_1x11-1MP_P3.00mm_Horizontal","Connector_Molex/Molex_Micro-Fit_3.0_43650-1110_1x11-1MP_P3.00mm_Horizontal_PnP","Connector_Molex/Molex_Micro-Fit_3.0_43650-1112_1x11-1MP_P3.00mm_Horizontal","Connector_Molex/Molex_Micro-Fit_3.0_43650-1115_1x11_P3.00mm_Vertical","Connector_Molex/Molex_Micro-Fit_3.0_43650-1121_1x11_P3.00mm_Vertical","Connector_Molex/Molex_Micro-Fit_3.0_43650-1124_1x11-1MP_P3.00mm_Vertical","Connector_Molex/Molex_Micro-Fit_3.0_43650-1200_1x12_P3.00mm_Horizontal","Connector_Molex/Molex_Micro-Fit_3.0_43650-1210_1x12-1MP_P3.00mm_Horizontal","Connector_Molex/Molex_Micro-Fit_3.0_43650-1210_1x12-1MP_P3.00mm_Horizontal_PnP","Connector_Molex/Molex_Micro-Fit_3.0_43650-1212_1x12-1MP_P3.00mm_Horizontal","Connector_Molex/Molex_Micro-Fit_3.0_43650-1215_1x12_P3.00mm_Vertical","Connector_Molex/Molex_Micro-Fit_3.0_43650-1221_1x12_P3.00mm_Vertical","Connector_Molex/Molex_Micro-Fit_3.0_43650-1224_1x12-1MP_P3.00mm_Vertical","Connector_Molex/Molex_Micro-Latch_53253-0270_1x02_P2.00mm_Vertical","Connector_Molex/Molex_Micro-Latch_53253-0370_1x03_P2.00mm_Vertical","Connector_Molex/Molex_Micro-Latch_53253-0470_1x04_P2.00mm_Vertical","Connector_Molex/Molex_Micro-Latch_53253-0570_1x05_P2.00mm_Vertical","Connector_Molex/Molex_Micro-Latch_53253-0670_1x06_P2.00mm_Vertical","Connector_Molex/Molex_Micro-Latch_53253-0770_1x07_P2.00mm_Vertical","Connector_Molex/Molex_Micro-Latch_53253-0870_1x08_P2.00mm_Vertical","Connector_Molex/Molex_Micro-Latch_53253-0970_1x09_P2.00mm_Vertical","Connector_Molex/Molex_Micro-Latch_53253-1070_1x10_P2.00mm_Vertical","Connector_Molex/Molex_Micro-Latch_53253-1170_1x11_P2.00mm_Vertical","Connector_Molex/Molex_Micro-Latch_53253-1270_1x12_P2.00mm_Vertical","Connector_Molex/Molex_Micro-Latch_53253-1370_1x13_P2.00mm_Vertical","Connector_Molex/Molex_Micro-Latch_53253-1470_1x14_P2.00mm_Vertical","Connector_Molex/Molex_Micro-Latch_53253-1570_1x15_P2.00mm_Vertical","Connector_Molex/Molex_Micro-Latch_53254-0270_1x02_P2.00mm_Horizontal","Connector_Molex/Molex_Micro-Latch_53254-0370_1x03_P2.00mm_Horizontal","Connector_Molex/Molex_Micro-Latch_53254-0470_1x04_P2.00mm_Horizontal","Connector_Molex/Molex_Micro-Latch_53254-0570_1x05_P2.00mm_Horizontal","Connector_Molex/Molex_Micro-Latch_53254-0670_1x06_P2.00mm_Horizontal","Connector_Molex/Molex_Micro-Latch_53254-0770_1x07_P2.00mm_Horizontal","Connector_Molex/Molex_Micro-Latch_53254-0870_1x08_P2.00mm_Horizontal","Connector_Molex/Molex_Micro-Latch_53254-0970_1x09_P2.00mm_Horizontal","Connector_Molex/Molex_Micro-Latch_53254-1070_1x10_P2.00mm_Horizontal","Connector_Molex/Molex_Micro-Latch_53254-1170_1x11_P2.00mm_Horizontal","Connector_Molex/Molex_Micro-Latch_53254-1270_1x12_P2.00mm_Horizontal","Connector_Molex/Molex_Micro-Latch_53254-1370_1x13_P2.00mm_Horizontal","Connector_Molex/Molex_Micro-Latch_53254-1470_1x14_P2.00mm_Horizontal","Connector_Molex/Molex_Micro-Latch_53254-1570_1x15_P2.00mm_Horizontal","Connector_Molex/Molex_MicroClasp_55932-0210_1x02_P2.00mm_Vertical","Connector_Molex/Molex_MicroClasp_55932-0230_1x02_P2.00mm_Vertical","Connector_Molex/Molex_MicroClasp_55932-0310_1x03_P2.00mm_Vertical","Connector_Molex/Molex_MicroClasp_55932-0330_1x03_P2.00mm_Vertical","Connector_Molex/Molex_MicroClasp_55932-0410_1x04_P2.00mm_Vertical","Connector_Molex/Molex_MicroClasp_55932-0430_1x04_P2.00mm_Vertical","Connector_Molex/Molex_MicroClasp_55932-0510_1x05_P2.00mm_Vertical","Connector_Molex/Molex_MicroClasp_55932-0530_1x05_P2.00mm_Vertical","Connector_Molex/Molex_MicroClasp_55932-0610_1x06_P2.00mm_Vertical","Connector_Molex/Molex_MicroClasp_55932-0630_1x06_P2.00mm_Vertical","Connector_Molex/Molex_MicroClasp_55932-0710_1x07_P2.00mm_Vertical","Connector_Molex/Molex_MicroClasp_55932-0730_1x07_P2.00mm_Vertical","Connector_Molex/Molex_MicroClasp_55932-0810_1x08_P2.00mm_Vertical","Connector_Molex/Molex_MicroClasp_55932-0830_1x08_P2.00mm_Vertical","Connector_Molex/Molex_MicroClasp_55932-0910_1x09_P2.00mm_Vertical","Connector_Molex/Molex_MicroClasp_55932-0930_1x09_P2.00mm_Vertical","Connector_Molex/Molex_MicroClasp_55932-1010_1x10_P2.00mm_Vertical","Connector_Molex/Molex_MicroClasp_55932-1030_1x10_P2.00mm_Vertical","Connector_Molex/Molex_MicroClasp_55932-1110_1x11_P2.00mm_Vertical","Connector_Molex/Molex_MicroClasp_55932-1130_1x11_P2.00mm_Vertical","Connector_Molex/Molex_MicroClasp_55932-1210_1x12_P2.00mm_Vertical","Connector_Molex/Molex_MicroClasp_55932-1230_1x12_P2.00mm_Vertical","Connector_Molex/Molex_MicroClasp_55932-1310_1x13_P2.00mm_Vertical","Connector_Molex/Molex_MicroClasp_55932-1330_1x13_P2.00mm_Vertical","Connector_Molex/Molex_MicroClasp_55932-1410_1x14_P2.00mm_Vertical","Connector_Molex/Molex_MicroClasp_55932-1430_1x14_P2.00mm_Vertical","Connector_Molex/Molex_MicroClasp_55932-1510_1x15_P2.00mm_Vertical","Connector_Molex/Molex_MicroClasp_55932-1530_1x15_P2.00mm_Vertical","Connector_Molex/Molex_MicroClasp_55935-0210_1x02_P2.00mm_Horizontal","Connector_Molex/Molex_MicroClasp_55935-0230_1x02_P2.00mm_Horizontal","Connector_Molex/Molex_MicroClasp_55935-0310_1x03_P2.00mm_Horizontal","Connector_Molex/Molex_MicroClasp_55935-0330_1x03_P2.00mm_Horizontal","Connector_Molex/Molex_MicroClasp_55935-0410_1x04_P2.00mm_Horizontal","Connector_Molex/Molex_MicroClasp_55935-0430_1x04_P2.00mm_Horizontal","Connector_Molex/Molex_MicroClasp_55935-0510_1x05_P2.00mm_Horizontal","Connector_Molex/Molex_MicroClasp_55935-0530_1x05_P2.00mm_Horizontal","Connector_Molex/Molex_MicroClasp_55935-0610_1x06_P2.00mm_Horizontal","Connector_Molex/Molex_MicroClasp_55935-0630_1x06_P2.00mm_Horizontal","Connector_Molex/Molex_MicroClasp_55935-0710_1x07_P2.00mm_Horizontal","Connector_Molex/Molex_MicroClasp_55935-0730_1x07_P2.00mm_Horizontal","Connector_Molex/Molex_MicroClasp_55935-0810_1x08_P2.00mm_Horizontal","Connector_Molex/Molex_MicroClasp_55935-0830_1x08_P2.00mm_Horizontal","Connector_Molex/Molex_MicroClasp_55935-0910_1x09_P2.00mm_Horizontal","Connector_Molex/Molex_MicroClasp_55935-0930_1x09_P2.00mm_Horizontal","Connector_Molex/Molex_MicroClasp_55935-1010_1x10_P2.00mm_Horizontal","Connector_Molex/Molex_MicroClasp_55935-1030_1x10_P2.00mm_Horizontal","Connector_Molex/Molex_MicroClasp_55935-1110_1x11_P2.00mm_Horizontal","Connector_Molex/Molex_MicroClasp_55935-1130_1x11_P2.00mm_Horizontal","Connector_Molex/Molex_MicroClasp_55935-1210_1x12_P2.00mm_Horizontal","Connector_Molex/Molex_MicroClasp_55935-1230_1x12_P2.00mm_Horizontal","Connector_Molex/Molex_MicroClasp_55935-1310_1x13_P2.00mm_Horizontal","Connector_Molex/Molex_MicroClasp_55935-1330_1x13_P2.00mm_Horizontal","Connector_Molex/Molex_MicroClasp_55935-1410_1x14_P2.00mm_Horizontal","Connector_Molex/Molex_MicroClasp_55935-1430_1x14_P2.00mm_Horizontal","Connector_Molex/Molex_MicroClasp_55935-1510_1x15_P2.00mm_Horizontal","Connector_Molex/Molex_MicroClasp_55935-1530_1x15_P2.00mm_Horizontal","Connector_Molex/Molex_Mini-Fit_Jr_5566-02A2_2x01_P4.20mm_Vertical","Connector_Molex/Molex_Mini-Fit_Jr_5566-02A_2x01_P4.20mm_Vertical","Connector_Molex/Molex_Mini-Fit_Jr_5566-04A2_2x02_P4.20mm_Vertical","Connector_Molex/Molex_Mini-Fit_Jr_5566-04A_2x02_P4.20mm_Vertical","Connector_Molex/Molex_Mini-Fit_Jr_5566-06A2_2x03_P4.20mm_Vertical","Connector_Molex/Molex_Mini-Fit_Jr_5566-06A_2x03_P4.20mm_Vertical","Connector_Molex/Molex_Mini-Fit_Jr_5566-08A2_2x04_P4.20mm_Vertical","Connector_Molex/Molex_Mini-Fit_Jr_5566-08A_2x04_P4.20mm_Vertical","Connector_Molex/Molex_Mini-Fit_Jr_5566-10A2_2x05_P4.20mm_Vertical","Connector_Molex/Molex_Mini-Fit_Jr_5566-10A_2x05_P4.20mm_Vertical","Connector_Molex/Molex_Mini-Fit_Jr_5566-12A2_2x06_P4.20mm_Vertical","Connector_Molex/Molex_Mini-Fit_Jr_5566-12A_2x06_P4.20mm_Vertical","Connector_Molex/Molex_Mini-Fit_Jr_5566-14A2_2x07_P4.20mm_Vertical","Connector_Molex/Molex_Mini-Fit_Jr_5566-14A_2x07_P4.20mm_Vertical","Connector_Molex/Molex_Mini-Fit_Jr_5566-16A2_2x08_P4.20mm_Vertical","Connector_Molex/Molex_Mini-Fit_Jr_5566-16A_2x08_P4.20mm_Vertical","Connector_Molex/Molex_Mini-Fit_Jr_5566-18A2_2x09_P4.20mm_Vertical","Connector_Molex/Molex_Mini-Fit_Jr_5566-18A_2x09_P4.20mm_Vertical","Connector_Molex/Molex_Mini-Fit_Jr_5566-20A2_2x10_P4.20mm_Vertical","Connector_Molex/Molex_Mini-Fit_Jr_5566-20A_2x10_P4.20mm_Vertical","Connector_Molex/Molex_Mini-Fit_Jr_5566-22A2_2x11_P4.20mm_Vertical","Connector_Molex/Molex_Mini-Fit_Jr_5566-22A_2x11_P4.20mm_Vertical","Connector_Molex/Molex_Mini-Fit_Jr_5566-24A2_2x12_P4.20mm_Vertical","Connector_Molex/Molex_Mini-Fit_Jr_5566-24A_2x12_P4.20mm_Vertical","Connector_Molex/Molex_Mini-Fit_Jr_5569-02A1_2x01_P4.20mm_Horizontal","Connector_Molex/Molex_Mini-Fit_Jr_5569-02A2_2x01_P4.20mm_Horizontal","Connector_Molex/Molex_Mini-Fit_Jr_5569-04A1_2x02_P4.20mm_Horizontal","Connector_Molex/Molex_Mini-Fit_Jr_5569-04A2_2x02_P4.20mm_Horizontal","Connector_Molex/Molex_Mini-Fit_Jr_5569-06A1_2x03_P4.20mm_Horizontal","Connector_Molex/Molex_Mini-Fit_Jr_5569-06A2_2x03_P4.20mm_Horizontal","Connector_Molex/Molex_Mini-Fit_Jr_5569-08A1_2x04_P4.20mm_Horizontal","Connector_Molex/Molex_Mini-Fit_Jr_5569-08A2_2x04_P4.20mm_Horizontal","Connector_Molex/Molex_Mini-Fit_Jr_5569-10A1_2x05_P4.20mm_Horizontal","Connector_Molex/Molex_Mini-Fit_Jr_5569-10A2_2x05_P4.20mm_Horizontal","Connector_Molex/Molex_Mini-Fit_Jr_5569-12A1_2x06_P4.20mm_Horizontal","Connector_Molex/Molex_Mini-Fit_Jr_5569-12A2_2x06_P4.20mm_Horizontal","Connector_Molex/Molex_Mini-Fit_Jr_5569-14A1_2x07_P4.20mm_Horizontal","Connector_Molex/Molex_Mini-Fit_Jr_5569-14A2_2x07_P4.20mm_Horizontal","Connector_Molex/Molex_Mini-Fit_Jr_5569-16A1_2x08_P4.20mm_Horizontal","Connector_Molex/Molex_Mini-Fit_Jr_5569-16A2_2x08_P4.20mm_Horizontal","Connector_Molex/Molex_Mini-Fit_Jr_5569-18A1_2x09_P4.20mm_Horizontal","Connector_Molex/Molex_Mini-Fit_Jr_5569-18A2_2x09_P4.20mm_Horizontal","Connector_Molex/Molex_Mini-Fit_Jr_5569-20A1_2x10_P4.20mm_Horizontal","Connector_Molex/Molex_Mini-Fit_Jr_5569-20A2_2x10_P4.20mm_Horizontal","Connector_Molex/Molex_Mini-Fit_Jr_5569-22A1_2x11_P4.20mm_Horizontal","Connector_Molex/Molex_Mini-Fit_Jr_5569-22A2_2x11_P4.20mm_Horizontal","Connector_Molex/Molex_Mini-Fit_Jr_5569-24A1_2x12_P4.20mm_Horizontal","Connector_Molex/Molex_Mini-Fit_Jr_5569-24A2_2x12_P4.20mm_Horizontal","Connector_Molex/Molex_Mini-Fit_Sr_42819-22XX_1x02_P10.00mm_Vertical","Connector_Molex/Molex_Mini-Fit_Sr_42819-22XX_1x02_P10.00mm_Vertical_ThermalVias","Connector_Molex/Molex_Mini-Fit_Sr_42819-32XX_1x03_P10.00mm_Vertical","Connector_Molex/Molex_Mini-Fit_Sr_42819-32XX_1x03_P10.00mm_Vertical_ThermalVias","Connector_Molex/Molex_Mini-Fit_Sr_42819-42XX_1x04_P10.00mm_Vertical","Connector_Molex/Molex_Mini-Fit_Sr_42819-42XX_1x04_P10.00mm_Vertical_ThermalVias","Connector_Molex/Molex_Mini-Fit_Sr_42819-52XX_1x05_P10.00mm_Vertical","Connector_Molex/Molex_Mini-Fit_Sr_42819-52XX_1x05_P10.00mm_Vertical_ThermalVias","Connector_Molex/Molex_Mini-Fit_Sr_42819-62XX_1x06_P10.00mm_Vertical","Connector_Molex/Molex_Mini-Fit_Sr_42819-62XX_1x06_P10.00mm_Vertical_ThermalVias","Connector_Molex/Molex_Mini-Fit_Sr_42820-22XX_1x02_P10.00mm_Horizontal","Connector_Molex/Molex_Mini-Fit_Sr_42820-22XX_1x02_P10.00mm_Horizontal_ThermalVias","Connector_Molex/Molex_Mini-Fit_Sr_42820-32XX_1x03_P10.00mm_Horizontal","Connector_Molex/Molex_Mini-Fit_Sr_42820-32XX_1x03_P10.00mm_Horizontal_ThermalVias","Connector_Molex/Molex_Mini-Fit_Sr_42820-42XX_1x04_P10.00mm_Horizontal","Connector_Molex/Molex_Mini-Fit_Sr_42820-42XX_1x04_P10.00mm_Horizontal_ThermalVias","Connector_Molex/Molex_Mini-Fit_Sr_42820-52XX_1x05_P10.00mm_Horizontal","Connector_Molex/Molex_Mini-Fit_Sr_42820-52XX_1x05_P10.00mm_Horizontal_ThermalVias","Connector_Molex/Molex_Mini-Fit_Sr_42820-62XX_1x06_P10.00mm_Horizontal","Connector_Molex/Molex_Mini-Fit_Sr_42820-62XX_1x06_P10.00mm_Horizontal_ThermalVias","Connector_Molex/Molex_Mini-Fit_Sr_43915-xx06_2x03_P10.00mm_Vertical","Connector_Molex/Molex_Mini-Fit_Sr_43915-xx06_2x03_P10.00mm_Vertical_ThermalVias","Connector_Molex/Molex_Mini-Fit_Sr_43915-xx08_2x04_P10.00mm_Vertical","Connector_Molex/Molex_Mini-Fit_Sr_43915-xx08_2x04_P10.00mm_Vertical_ThermalVias","Connector_Molex/Molex_Mini-Fit_Sr_43915-xx10_2x05_P10.00mm_Vertical","Connector_Molex/Molex_Mini-Fit_Sr_43915-xx10_2x05_P10.00mm_Vertical_ThermalVias","Connector_Molex/Molex_Mini-Fit_Sr_43915-xx12_2x06_P10.00mm_Vertical","Connector_Molex/Molex_Mini-Fit_Sr_43915-xx12_2x06_P10.00mm_Vertical_ThermalVias","Connector_Molex/Molex_Mini-Fit_Sr_43915-xx14_2x07_P10.00mm_Vertical","Connector_Molex/Molex_Mini-Fit_Sr_43915-xx14_2x07_P10.00mm_Vertical_ThermalVias","Connector_Molex/Molex_Nano-Fit_105309-xx02_1x02_P2.50mm_Vertical","Connector_Molex/Molex_Nano-Fit_105309-xx03_1x03_P2.50mm_Vertical","Connector_Molex/Molex_Nano-Fit_105309-xx04_1x04_P2.50mm_Vertical","Connector_Molex/Molex_Nano-Fit_105309-xx05_1x05_P2.50mm_Vertical","Connector_Molex/Molex_Nano-Fit_105309-xx06_1x06_P2.50mm_Vertical","Connector_Molex/Molex_Nano-Fit_105309-xx07_1x07_P2.50mm_Vertical","Connector_Molex/Molex_Nano-Fit_105309-xx08_1x08_P2.50mm_Vertical","Connector_Molex/Molex_Nano-Fit_105310-xx04_2x02_P2.50mm_Vertical","Connector_Molex/Molex_Nano-Fit_105310-xx06_2x03_P2.50mm_Vertical","Connector_Molex/Molex_Nano-Fit_105310-xx08_2x04_P2.50mm_Vertical","Connector_Molex/Molex_Nano-Fit_105310-xx10_2x05_P2.50mm_Vertical","Connector_Molex/Molex_Nano-Fit_105310-xx12_2x06_P2.50mm_Vertical","Connector_Molex/Molex_Nano-Fit_105310-xx14_2x07_P2.50mm_Vertical","Connector_Molex/Molex_Nano-Fit_105310-xx16_2x08_P2.50mm_Vertical","Connector_Molex/Molex_Nano-Fit_105313-xx02_1x02_P2.50mm_Horizontal","Connector_Molex/Molex_Nano-Fit_105313-xx03_1x03_P2.50mm_Horizontal","Connector_Molex/Molex_Nano-Fit_105313-xx04_1x04_P2.50mm_Horizontal","Connector_Molex/Molex_Nano-Fit_105313-xx05_1x05_P2.50mm_Horizontal","Connector_Molex/Molex_Nano-Fit_105313-xx06_1x06_P2.50mm_Horizontal","Connector_Molex/Molex_Nano-Fit_105313-xx07_1x07_P2.50mm_Horizontal","Connector_Molex/Molex_Nano-Fit_105313-xx08_1x08_P2.50mm_Horizontal","Connector_Molex/Molex_Nano-Fit_105314-xx04_2x02_P2.50mm_Horizontal","Connector_Molex/Molex_Nano-Fit_105314-xx06_2x03_P2.50mm_Horizontal","Connector_Molex/Molex_Nano-Fit_105314-xx08_2x04_P2.50mm_Horizontal","Connector_Molex/Molex_Nano-Fit_105314-xx10_2x05_P2.50mm_Horizontal","Connector_Molex/Molex_Nano-Fit_105314-xx12_2x06_P2.50mm_Horizontal","Connector_Molex/Molex_Nano-Fit_105314-xx14_2x07_P2.50mm_Horizontal","Connector_Molex/Molex_Nano-Fit_105314-xx16_2x08_P2.50mm_Horizontal","Connector_Molex/Molex_Panelmate_53780-0270_1x02-1MP_P1.25mm_Horizontal","Connector_Molex/Molex_Panelmate_53780-0370_1x03-1MP_P1.25mm_Horizontal","Connector_Molex/Molex_Panelmate_53780-0470_1x04-1MP_P1.25mm_Horizontal","Connector_Molex/Molex_Panelmate_53780-0570_1x05-1MP_P1.25mm_Horizontal","Connector_Molex/Molex_Panelmate_53780-0670_1x06-1MP_P1.25mm_Horizontal","Connector_Molex/Molex_Panelmate_53780-0770_1x07-1MP_P1.25mm_Horizontal","Connector_Molex/Molex_Panelmate_53780-0870_1x08-1MP_P1.25mm_Horizontal","Connector_Molex/Molex_Panelmate_53780-0970_1x09-1MP_P1.25mm_Horizontal","Connector_Molex/Molex_Panelmate_53780-1070_1x10-1MP_P1.25mm_Horizontal","Connector_Molex/Molex_Panelmate_53780-1270_1x12-1MP_P1.25mm_Horizontal","Connector_Molex/Molex_Panelmate_53780-1470_1x14-1MP_P1.25mm_Horizontal","Connector_Molex/Molex_Panelmate_53780-1570_1x15-1MP_P1.25mm_Horizontal","Connector_Molex/Molex_Panelmate_53780-1870_1x18-1MP_P1.25mm_Horizontal","Connector_Molex/Molex_Panelmate_53780-3070_1x30-1MP_P1.25mm_Horizontal","Connector_Molex/Molex_Pico-Clasp_202396-0207_1x02-1MP_P1.00mm_Horizontal","Connector_Molex/Molex_Pico-Clasp_202396-0307_1x03-1MP_P1.00mm_Horizontal","Connector_Molex/Molex_Pico-Clasp_202396-0407_1x04-1MP_P1.00mm_Horizontal","Connector_Molex/Molex_Pico-Clasp_202396-0507_1x05-1MP_P1.00mm_Horizontal","Connector_Molex/Molex_Pico-Clasp_202396-0607_1x06-1MP_P1.00mm_Horizontal","Connector_Molex/Molex_Pico-Clasp_202396-0707_1x07-1MP_P1.00mm_Horizontal","Connector_Molex/Molex_Pico-Clasp_202396-0807_1x08-1MP_P1.00mm_Horizontal","Connector_Molex/Molex_Pico-Clasp_202396-0907_1x09-1MP_P1.00mm_Horizontal","Connector_Molex/Molex_Pico-Clasp_202396-1007_1x10-1MP_P1.00mm_Horizontal","Connector_Molex/Molex_Pico-Clasp_202396-1107_1x11-1MP_P1.00mm_Horizontal","Connector_Molex/Molex_Pico-Clasp_202396-1207_1x12-1MP_P1.00mm_Horizontal","Connector_Molex/Molex_Pico-Clasp_202396-1307_1x13-1MP_P1.00mm_Horizontal","Connector_Molex/Molex_Pico-Clasp_202396-1407_1x14-1MP_P1.00mm_Horizontal","Connector_Molex/Molex_Pico-Clasp_202396-1507_1x15-1MP_P1.00mm_Horizontal","Connector_Molex/Molex_Pico-Clasp_501331-0207_1x02-1MP_P1.00mm_Vertical","Connector_Molex/Molex_Pico-Clasp_501331-0307_1x03-1MP_P1.00mm_Vertical","Connector_Molex/Molex_Pico-Clasp_501331-0407_1x04-1MP_P1.00mm_Vertical","Connector_Molex/Molex_Pico-Clasp_501331-0507_1x05-1MP_P1.00mm_Vertical","Connector_Molex/Molex_Pico-Clasp_501331-0607_1x06-1MP_P1.00mm_Vertical","Connector_Molex/Molex_Pico-Clasp_501331-0707_1x07-1MP_P1.00mm_Vertical","Connector_Molex/Molex_Pico-Clasp_501331-0807_1x08-1MP_P1.00mm_Vertical","Connector_Molex/Molex_Pico-Clasp_501331-0907_1x09-1MP_P1.00mm_Vertical","Connector_Molex/Molex_Pico-Clasp_501331-1007_1x10-1MP_P1.00mm_Vertical","Connector_Molex/Molex_Pico-Clasp_501331-1107_1x11-1MP_P1.00mm_Vertical","Connector_Molex/Molex_Pico-Clasp_501331-1207_1x12-1MP_P1.00mm_Vertical","Connector_Molex/Molex_Pico-Clasp_501331-1307_1x13-1MP_P1.00mm_Vertical","Connector_Molex/Molex_Pico-Clasp_501331-1407_1x14-1MP_P1.00mm_Vertical","Connector_Molex/Molex_Pico-Clasp_501331-1507_1x15-1MP_P1.00mm_Vertical","Connector_Molex/Molex_Pico-EZmate_78171-0002_1x02-1MP_P1.20mm_Vertical","Connector_Molex/Molex_Pico-EZmate_78171-0003_1x03-1MP_P1.20mm_Vertical","Connector_Molex/Molex_Pico-EZmate_78171-0004_1x04-1MP_P1.20mm_Vertical","Connector_Molex/Molex_Pico-EZmate_78171-0005_1x05-1MP_P1.20mm_Vertical","Connector_Molex/Molex_Pico-EZmate_Slim_202656-0021_1x02-1MP_P1.20mm_Vertical","Connector_Molex/Molex_Pico-Lock_205338-0002_1x02-1MP_P2.00mm_Horizontal","Connector_Molex/Molex_Pico-Lock_205338-0004_1x04-1MP_P2.00mm_Horizontal","Connector_Molex/Molex_Pico-Lock_205338-0006_1x06-1MP_P2.00mm_Horizontal","Connector_Molex/Molex_Pico-Lock_205338-0008_1x08-1MP_P2.00mm_Horizontal","Connector_Molex/Molex_Pico-Lock_205338-0010_1x10-1MP_P2.00mm_Horizontal","Connector_Molex/Molex_Pico-Lock_504050-0291_1x02-1MP_P1.50mm_Horizontal","Connector_Molex/Molex_Pico-Lock_504050-0391_1x03-1MP_P1.50mm_Horizontal","Connector_Molex/Molex_Pico-Lock_504050-0491_1x04-1MP_P1.50mm_Horizontal","Connector_Molex/Molex_Pico-Lock_504050-0591_1x05-1MP_P1.50mm_Horizontal","Connector_Molex/Molex_Pico-Lock_504050-0691_1x06-1MP_P1.50mm_Horizontal","Connector_Molex/Molex_Pico-Lock_504050-0791_1x07-1MP_P1.50mm_Horizontal","Connector_Molex/Molex_Pico-Lock_504050-0891_1x08-1MP_P1.50mm_Horizontal","Connector_Molex/Molex_Pico-Lock_504050-0991_1x09-1MP_P1.50mm_Horizontal","Connector_Molex/Molex_Pico-Lock_504050-1091_1x10-1MP_P1.50mm_Horizontal","Connector_Molex/Molex_Pico-Lock_504050-1191_1x11-1MP_P1.50mm_Horizontal","Connector_Molex/Molex_Pico-Lock_504050-1291_1x12-1MP_P1.50mm_Horizontal","Connector_Molex/Molex_Pico-SPOX_87437-1443_1x14-P1.5mm_Vertical","Connector_Molex/Molex_PicoBlade_53047-0210_1x02_P1.25mm_Vertical","Connector_Molex/Molex_PicoBlade_53047-0310_1x03_P1.25mm_Vertical","Connector_Molex/Molex_PicoBlade_53047-0410_1x04_P1.25mm_Vertical","Connector_Molex/Molex_PicoBlade_53047-0510_1x05_P1.25mm_Vertical","Connector_Molex/Molex_PicoBlade_53047-0610_1x06_P1.25mm_Vertical","Connector_Molex/Molex_PicoBlade_53047-0710_1x07_P1.25mm_Vertical","Connector_Molex/Molex_PicoBlade_53047-0810_1x08_P1.25mm_Vertical","Connector_Molex/Molex_PicoBlade_53047-0910_1x09_P1.25mm_Vertical","Connector_Molex/Molex_PicoBlade_53047-1010_1x10_P1.25mm_Vertical","Connector_Molex/Molex_PicoBlade_53047-1110_1x11_P1.25mm_Vertical","Connector_Molex/Molex_PicoBlade_53047-1210_1x12_P1.25mm_Vertical","Connector_Molex/Molex_PicoBlade_53047-1310_1x13_P1.25mm_Vertical","Connector_Molex/Molex_PicoBlade_53047-1410_1x14_P1.25mm_Vertical","Connector_Molex/Molex_PicoBlade_53047-1510_1x15_P1.25mm_Vertical","Connector_Molex/Molex_PicoBlade_53048-0210_1x02_P1.25mm_Horizontal","Connector_Molex/Molex_PicoBlade_53048-0310_1x03_P1.25mm_Horizontal","Connector_Molex/Molex_PicoBlade_53048-0410_1x04_P1.25mm_Horizontal","Connector_Molex/Molex_PicoBlade_53048-0510_1x05_P1.25mm_Horizontal","Connector_Molex/Molex_PicoBlade_53048-0610_1x06_P1.25mm_Horizontal","Connector_Molex/Molex_PicoBlade_53048-0710_1x07_P1.25mm_Horizontal","Connector_Molex/Molex_PicoBlade_53048-0810_1x08_P1.25mm_Horizontal","Connector_Molex/Molex_PicoBlade_53048-0910_1x09_P1.25mm_Horizontal","Connector_Molex/Molex_PicoBlade_53048-1010_1x10_P1.25mm_Horizontal","Connector_Molex/Molex_PicoBlade_53048-1110_1x11_P1.25mm_Horizontal","Connector_Molex/Molex_PicoBlade_53048-1210_1x12_P1.25mm_Horizontal","Connector_Molex/Molex_PicoBlade_53048-1310_1x13_P1.25mm_Horizontal","Connector_Molex/Molex_PicoBlade_53048-1410_1x14_P1.25mm_Horizontal","Connector_Molex/Molex_PicoBlade_53048-1510_1x15_P1.25mm_Horizontal","Connector_Molex/Molex_PicoBlade_53261-0271_1x02-1MP_P1.25mm_Horizontal","Connector_Molex/Molex_PicoBlade_53261-0371_1x03-1MP_P1.25mm_Horizontal","Connector_Molex/Molex_PicoBlade_53261-0471_1x04-1MP_P1.25mm_Horizontal","Connector_Molex/Molex_PicoBlade_53261-0571_1x05-1MP_P1.25mm_Horizontal","Connector_Molex/Molex_PicoBlade_53261-0671_1x06-1MP_P1.25mm_Horizontal","Connector_Molex/Molex_PicoBlade_53261-0771_1x07-1MP_P1.25mm_Horizontal","Connector_Molex/Molex_PicoBlade_53261-0871_1x08-1MP_P1.25mm_Horizontal","Connector_Molex/Molex_PicoBlade_53261-0971_1x09-1MP_P1.25mm_Horizontal","Connector_Molex/Molex_PicoBlade_53261-1071_1x10-1MP_P1.25mm_Horizontal","Connector_Molex/Molex_PicoBlade_53261-1171_1x11-1MP_P1.25mm_Horizontal","Connector_Molex/Molex_PicoBlade_53261-1271_1x12-1MP_P1.25mm_Horizontal","Connector_Molex/Molex_PicoBlade_53261-1371_1x13-1MP_P1.25mm_Horizontal","Connector_Molex/Molex_PicoBlade_53261-1471_1x14-1MP_P1.25mm_Horizontal","Connector_Molex/Molex_PicoBlade_53261-1571_1x15-1MP_P1.25mm_Horizontal","Connector_Molex/Molex_PicoBlade_53261-1771_1x17-1MP_P1.25mm_Horizontal","Connector_Molex/Molex_PicoBlade_53398-0271_1x02-1MP_P1.25mm_Vertical","Connector_Molex/Molex_PicoBlade_53398-0371_1x03-1MP_P1.25mm_Vertical","Connector_Molex/Molex_PicoBlade_53398-0471_1x04-1MP_P1.25mm_Vertical","Connector_Molex/Molex_PicoBlade_53398-0571_1x05-1MP_P1.25mm_Vertical","Connector_Molex/Molex_PicoBlade_53398-0671_1x06-1MP_P1.25mm_Vertical","Connector_Molex/Molex_PicoBlade_53398-0771_1x07-1MP_P1.25mm_Vertical","Connector_Molex/Molex_PicoBlade_53398-0871_1x08-1MP_P1.25mm_Vertical","Connector_Molex/Molex_PicoBlade_53398-0971_1x09-1MP_P1.25mm_Vertical","Connector_Molex/Molex_PicoBlade_53398-1071_1x10-1MP_P1.25mm_Vertical","Connector_Molex/Molex_PicoBlade_53398-1171_1x11-1MP_P1.25mm_Vertical","Connector_Molex/Molex_PicoBlade_53398-1271_1x12-1MP_P1.25mm_Vertical","Connector_Molex/Molex_PicoBlade_53398-1371_1x13-1MP_P1.25mm_Vertical","Connector_Molex/Molex_PicoBlade_53398-1471_1x14-1MP_P1.25mm_Vertical","Connector_Molex/Molex_PicoBlade_53398-1571_1x15-1MP_P1.25mm_Vertical","Connector_Molex/Molex_Picoflex_90325-0004_2x02_P1.27mm_Vertical","Connector_Molex/Molex_Picoflex_90325-0006_2x03_P1.27mm_Vertical","Connector_Molex/Molex_Picoflex_90325-0008_2x04_P1.27mm_Vertical","Connector_Molex/Molex_Picoflex_90325-0010_2x05_P1.27mm_Vertical","Connector_Molex/Molex_Picoflex_90325-0012_2x06_P1.27mm_Vertical","Connector_Molex/Molex_Picoflex_90325-0014_2x07_P1.27mm_Vertical","Connector_Molex/Molex_Picoflex_90325-0016_2x08_P1.27mm_Vertical","Connector_Molex/Molex_Picoflex_90325-0018_2x09_P1.27mm_Vertical","Connector_Molex/Molex_Picoflex_90325-0020_2x10_P1.27mm_Vertical","Connector_Molex/Molex_Picoflex_90325-0022_2x11_P1.27mm_Vertical","Connector_Molex/Molex_Picoflex_90325-0024_2x12_P1.27mm_Vertical","Connector_Molex/Molex_Picoflex_90325-0026_2x13_P1.27mm_Vertical","Connector_Molex/Molex_Picoflex_90814-0004_2x02_P1.27mm_Vertical","Connector_Molex/Molex_Picoflex_90814-0006_2x03_P1.27mm_Vertical","Connector_Molex/Molex_Picoflex_90814-0008_2x04_P1.27mm_Vertical","Connector_Molex/Molex_Picoflex_90814-0010_2x05_P1.27mm_Vertical","Connector_Molex/Molex_Picoflex_90814-0012_2x06_P1.27mm_Vertical","Connector_Molex/Molex_Picoflex_90814-0014_2x07_P1.27mm_Vertical","Connector_Molex/Molex_Picoflex_90814-0016_2x08_P1.27mm_Vertical","Connector_Molex/Molex_Picoflex_90814-0018_2x09_P1.27mm_Vertical","Connector_Molex/Molex_Picoflex_90814-0020_2x10_P1.27mm_Vertical","Connector_Molex/Molex_Picoflex_90814-0022_2x11_P1.27mm_Vertical","Connector_Molex/Molex_Picoflex_90814-0024_2x12_P1.27mm_Vertical","Connector_Molex/Molex_Picoflex_90814-0026_2x13_P1.27mm_Vertical","Connector_Molex/Molex_SL_171971-0002_1x02_P2.54mm_Vertical","Connector_Molex/Molex_SL_171971-0003_1x03_P2.54mm_Vertical","Connector_Molex/Molex_SL_171971-0004_1x04_P2.54mm_Vertical","Connector_Molex/Molex_SL_171971-0005_1x05_P2.54mm_Vertical","Connector_Molex/Molex_SL_171971-0006_1x06_P2.54mm_Vertical","Connector_Molex/Molex_SL_171971-0007_1x07_P2.54mm_Vertical","Connector_Molex/Molex_SL_171971-0008_1x08_P2.54mm_Vertical","Connector_Molex/Molex_SL_171971-0009_1x09_P2.54mm_Vertical","Connector_Molex/Molex_SL_171971-0010_1x10_P2.54mm_Vertical","Connector_Molex/Molex_SL_171971-0011_1x11_P2.54mm_Vertical","Connector_Molex/Molex_SL_171971-0012_1x12_P2.54mm_Vertical","Connector_Molex/Molex_SL_171971-0013_1x13_P2.54mm_Vertical","Connector_Molex/Molex_SL_171971-0014_1x14_P2.54mm_Vertical","Connector_Molex/Molex_SL_171971-0015_1x15_P2.54mm_Vertical","Connector_Molex/Molex_SL_171971-0016_1x16_P2.54mm_Vertical","Connector_Molex/Molex_SL_171971-0017_1x17_P2.54mm_Vertical","Connector_Molex/Molex_SL_171971-0018_1x18_P2.54mm_Vertical","Connector_Molex/Molex_SL_171971-0019_1x19_P2.54mm_Vertical","Connector_Molex/Molex_SL_171971-0020_1x20_P2.54mm_Vertical","Connector_Molex/Molex_SL_171971-0021_1x21_P2.54mm_Vertical","Connector_Molex/Molex_SL_171971-0022_1x22_P2.54mm_Vertical","Connector_Molex/Molex_SL_171971-0023_1x23_P2.54mm_Vertical","Connector_Molex/Molex_SL_171971-0024_1x24_P2.54mm_Vertical","Connector_Molex/Molex_SL_171971-0025_1x25_P2.54mm_Vertical","Connector_Molex/Molex_SPOX_5267-02A_1x02_P2.50mm_Vertical","Connector_Molex/Molex_SPOX_5267-03A_1x03_P2.50mm_Vertical","Connector_Molex/Molex_SPOX_5267-04A_1x04_P2.50mm_Vertical","Connector_Molex/Molex_SPOX_5267-05A_1x05_P2.50mm_Vertical","Connector_Molex/Molex_SPOX_5267-06A_1x06_P2.50mm_Vertical","Connector_Molex/Molex_SPOX_5267-07A_1x07_P2.50mm_Vertical","Connector_Molex/Molex_SPOX_5267-08A_1x08_P2.50mm_Vertical","Connector_Molex/Molex_SPOX_5267-09A_1x09_P2.50mm_Vertical","Connector_Molex/Molex_SPOX_5267-10A_1x10_P2.50mm_Vertical","Connector_Molex/Molex_SPOX_5267-11A_1x11_P2.50mm_Vertical","Connector_Molex/Molex_SPOX_5267-12A_1x12_P2.50mm_Vertical","Connector_Molex/Molex_SPOX_5267-13A_1x13_P2.50mm_Vertical","Connector_Molex/Molex_SPOX_5267-14A_1x14_P2.50mm_Vertical","Connector_Molex/Molex_SPOX_5267-15A_1x15_P2.50mm_Vertical","Connector_Molex/Molex_SPOX_5268-02A_1x02_P2.50mm_Horizontal","Connector_Molex/Molex_SPOX_5268-03A_1x03_P2.50mm_Horizontal","Connector_Molex/Molex_SPOX_5268-04A_1x04_P2.50mm_Horizontal","Connector_Molex/Molex_SPOX_5268-05A_1x05_P2.50mm_Horizontal","Connector_Molex/Molex_SPOX_5268-06A_1x06_P2.50mm_Horizontal","Connector_Molex/Molex_SPOX_5268-07A_1x07_P2.50mm_Horizontal","Connector_Molex/Molex_SPOX_5268-08A_1x08_P2.50mm_Horizontal","Connector_Molex/Molex_SPOX_5268-09A_1x09_P2.50mm_Horizontal","Connector_Molex/Molex_SPOX_5268-10A_1x10_P2.50mm_Horizontal","Connector_Molex/Molex_SPOX_5268-11A_1x11_P2.50mm_Horizontal","Connector_Molex/Molex_SPOX_5268-12A_1x12_P2.50mm_Horizontal","Connector_Molex/Molex_SPOX_5268-13A_1x13_P2.50mm_Horizontal","Connector_Molex/Molex_SPOX_5268-14A_1x14_P2.50mm_Horizontal","Connector_Molex/Molex_SPOX_5268-15A_1x15_P2.50mm_Horizontal","Connector_Molex/Molex_Sabre_43160-0102_1x02_P7.49mm_Vertical","Connector_Molex/Molex_Sabre_43160-0102_1x02_P7.49mm_Vertical_ThermalVias","Connector_Molex/Molex_Sabre_43160-0103_1x03_P7.49mm_Vertical","Connector_Molex/Molex_Sabre_43160-0103_1x03_P7.49mm_Vertical_ThermalVias","Connector_Molex/Molex_Sabre_43160-0104_1x04_P7.49mm_Vertical","Connector_Molex/Molex_Sabre_43160-0104_1x04_P7.49mm_Vertical_ThermalVias","Connector_Molex/Molex_Sabre_43160-0105_1x05_P7.49mm_Vertical","Connector_Molex/Molex_Sabre_43160-0105_1x05_P7.49mm_Vertical_ThermalVias","Connector_Molex/Molex_Sabre_43160-0106_1x06_P7.49mm_Vertical","Connector_Molex/Molex_Sabre_43160-0106_1x06_P7.49mm_Vertical_ThermalVias","Connector_Molex/Molex_Sabre_43160-1102_1x02_P7.49mm_Horizontal","Connector_Molex/Molex_Sabre_43160-1102_1x02_P7.49mm_Horizontal_ThermalVias","Connector_Molex/Molex_Sabre_43160-1103_1x03_P7.49mm_Horizontal","Connector_Molex/Molex_Sabre_43160-1103_1x03_P7.49mm_Horizontal_ThermalVias","Connector_Molex/Molex_Sabre_43160-1104_1x04_P7.49mm_Horizontal","Connector_Molex/Molex_Sabre_43160-1104_1x04_P7.49mm_Horizontal_ThermalVias","Connector_Molex/Molex_Sabre_43160-1105_1x05_P7.49mm_Horizontal","Connector_Molex/Molex_Sabre_43160-1105_1x05_P7.49mm_Horizontal_ThermalVias","Connector_Molex/Molex_Sabre_43160-1106_1x06_P7.49mm_Horizontal","Connector_Molex/Molex_Sabre_43160-1106_1x06_P7.49mm_Horizontal_ThermalVias","Connector_Molex/Molex_Sabre_43160-2102_1x02_P7.49mm_Vertical","Connector_Molex/Molex_Sabre_43160-2102_1x02_P7.49mm_Vertical_ThermalVias","Connector_Molex/Molex_Sabre_43160-2103_1x03_P7.49mm_Vertical","Connector_Molex/Molex_Sabre_43160-2103_1x03_P7.49mm_Vertical_ThermalVias","Connector_Molex/Molex_Sabre_43160-2104_1x04_P7.49mm_Vertical","Connector_Molex/Molex_Sabre_43160-2104_1x04_P7.49mm_Vertical_ThermalVias","Connector_Molex/Molex_Sabre_43160-2105_1x05_P7.49mm_Vertical","Connector_Molex/Molex_Sabre_43160-2105_1x05_P7.49mm_Vertical_ThermalVias","Connector_Molex/Molex_Sabre_43160-2106_1x06_P7.49mm_Vertical","Connector_Molex/Molex_Sabre_43160-2106_1x06_P7.49mm_Vertical_ThermalVias","Connector_Molex/Molex_Sabre_46007-1102_1x02_P7.49mm_Horizontal","Connector_Molex/Molex_Sabre_46007-1102_1x02_P7.49mm_Horizontal_ThermalVias","Connector_Molex/Molex_Sabre_46007-1103_1x03_P7.49mm_Horizontal","Connector_Molex/Molex_Sabre_46007-1103_1x03_P7.49mm_Horizontal_ThermalVias","Connector_Molex/Molex_Sabre_46007-1104_1x04_P7.49mm_Horizontal","Connector_Molex/Molex_Sabre_46007-1104_1x04_P7.49mm_Horizontal_ThermalVias","Connector_Molex/Molex_Sabre_46007-1105_1x05_P7.49mm_Horizontal","Connector_Molex/Molex_Sabre_46007-1105_1x05_P7.49mm_Horizontal_ThermalVias","Connector_Molex/Molex_Sabre_46007-1106_1x06_P7.49mm_Horizontal","Connector_Molex/Molex_Sabre_46007-1106_1x06_P7.49mm_Horizontal_ThermalVias","Connector_Molex/Molex_SlimStack_501920-3001_2x15_P0.50mm_Vertical","Connector_Molex/Molex_SlimStack_501920-4001_2x20_P0.50mm_Vertical","Connector_Molex/Molex_SlimStack_501920-5001_2x25_P0.50mm_Vertical","Connector_Molex/Molex_SlimStack_502426-0810_2x04_P0.40mm_Vertical","Connector_Molex/Molex_SlimStack_502426-1410_2x07_P0.40mm_Vertical","Connector_Molex/Molex_SlimStack_502426-2010_2x10_P0.40mm_Vertical","Connector_Molex/Molex_SlimStack_502426-2210_2x11_P0.40mm_Vertical","Connector_Molex/Molex_SlimStack_502426-2410_2x12_P0.40mm_Vertical","Connector_Molex/Molex_SlimStack_502426-2610_2x13_P0.40mm_Vertical","Connector_Molex/Molex_SlimStack_502426-3010_2x15_P0.40mm_Vertical","Connector_Molex/Molex_SlimStack_502426-3210_2x16_P0.40mm_Vertical","Connector_Molex/Molex_SlimStack_502426-3410_2x17_P0.40mm_Vertical","Connector_Molex/Molex_SlimStack_502426-4010_2x20_P0.40mm_Vertical","Connector_Molex/Molex_SlimStack_502426-4410_2x22_P0.40mm_Vertical","Connector_Molex/Molex_SlimStack_502426-5010_2x25_P0.40mm_Vertical","Connector_Molex/Molex_SlimStack_502426-6010_2x30_P0.40mm_Vertical","Connector_Molex/Molex_SlimStack_502426-6410_2x32_P0.40mm_Vertical","Connector_Molex/Molex_SlimStack_502426-8010_2x40_P0.40mm_Vertical","Connector_Molex/Molex_SlimStack_502430-0820_2x04_P0.40mm_Vertical","Connector_Molex/Molex_SlimStack_502430-1410_2x07_P0.40mm_Vertical","Connector_Molex/Molex_SlimStack_502430-2010_2x10_P0.40mm_Vertical","Connector_Molex/Molex_SlimStack_502430-2210_2x11_P0.40mm_Vertical","Connector_Molex/Molex_SlimStack_502430-2410_2x12_P0.40mm_Vertical","Connector_Molex/Molex_SlimStack_502430-2610_2x13_P0.40mm_Vertical","Connector_Molex/Molex_SlimStack_502430-3010_2x15_P0.40mm_Vertical","Connector_Molex/Molex_SlimStack_502430-3210_2x16_P0.40mm_Vertical","Connector_Molex/Molex_SlimStack_502430-3410_2x17_P0.40mm_Vertical","Connector_Molex/Molex_SlimStack_502430-4010_2x20_P0.40mm_Vertical","Connector_Molex/Molex_SlimStack_502430-4410_2x22_P0.40mm_Vertical","Connector_Molex/Molex_SlimStack_502430-5010_2x25_P0.40mm_Vertical","Connector_Molex/Molex_SlimStack_502430-6010_2x30_P0.40mm_Vertical","Connector_Molex/Molex_SlimStack_502430-6410_2x32_P0.40mm_Vertical","Connector_Molex/Molex_SlimStack_502430-8010_2x40_P0.40mm_Vertical","Connector_Molex/Molex_SlimStack_52991-0208_2x10_P0.50mm_Vertical","Connector_Molex/Molex_SlimStack_52991-0308_2x15_P0.50mm_Vertical","Connector_Molex/Molex_SlimStack_52991-0408_2x20_P0.50mm_Vertical","Connector_Molex/Molex_SlimStack_52991-0508_2x25_P0.50mm_Vertical","Connector_Molex/Molex_SlimStack_52991-0608_2x30_P0.50mm_Vertical","Connector_Molex/Molex_SlimStack_52991-0708_2x35_P0.50mm_Vertical","Connector_Molex/Molex_SlimStack_52991-0808_2x40_P0.50mm_Vertical","Connector_Molex/Molex_SlimStack_53748-0208_2x10_P0.50mm_Vertical","Connector_Molex/Molex_SlimStack_53748-0308_2x15_P0.50mm_Vertical","Connector_Molex/Molex_SlimStack_53748-0408_2x20_P0.50mm_Vertical","Connector_Molex/Molex_SlimStack_53748-0608_2x30_P0.50mm_Vertical","Connector_Molex/Molex_SlimStack_53748-0708_2x35_P0.50mm_Vertical","Connector_Molex/Molex_SlimStack_53748-0808_2x40_P0.50mm_Vertical","Connector_Molex/Molex_SlimStack_54722-0164_2x08_P0.50mm_Vertical","Connector_Molex/Molex_SlimStack_54722-0204_2x10_P0.50mm_Vertical","Connector_Molex/Molex_SlimStack_54722-0224_2x11_P0.50mm_Vertical","Connector_Molex/Molex_SlimStack_54722-0244_2x12_P0.50mm_Vertical","Connector_Molex/Molex_SlimStack_54722-0304_2x15_P0.50mm_Vertical","Connector_Molex/Molex_SlimStack_54722-0344_2x17_P0.50mm_Vertical","Connector_Molex/Molex_SlimStack_54722-0404_2x20_P0.50mm_Vertical","Connector_Molex/Molex_SlimStack_54722-0504_2x25_P0.50mm_Vertical","Connector_Molex/Molex_SlimStack_54722-0604_2x30_P0.50mm_Vertical","Connector_Molex/Molex_SlimStack_54722-0804_2x40_P0.50mm_Vertical","Connector_Molex/Molex_SlimStack_55560-0161_2x08_P0.50mm_Vertical","Connector_Molex/Molex_SlimStack_55560-0201_2x10_P0.50mm_Vertical","Connector_Molex/Molex_SlimStack_55560-0221_2x11_P0.50mm_Vertical","Connector_Molex/Molex_SlimStack_55560-0241_2x12_P0.50mm_Vertical","Connector_Molex/Molex_SlimStack_55560-0301_2x15_P0.50mm_Vertical","Connector_Molex/Molex_SlimStack_55560-0341_2x17_P0.50mm_Vertical","Connector_Molex/Molex_SlimStack_55560-0401_2x20_P0.50mm_Vertical","Connector_Molex/Molex_SlimStack_55560-0501_2x25_P0.50mm_Vertical","Connector_Molex/Molex_SlimStack_55560-0601_2x30_P0.50mm_Vertical","Connector_Molex/Molex_SlimStack_55560-0801_2x40_P0.50mm_Vertical","Connector_Molex_Milligrid/Molex_8783204xx_2x02_P2.0mm_Header_Vertical","Connector_Molex_Milligrid/Molex_8783206xx_2x03_P2.0mm_Header_Vertical","Connector_Molex_Milligrid/Molex_8783206xx_2x03_P2.0mm_Header_Vertical_MountingPegs","Connector_Molex_Milligrid/Molex_8783206xx_2x03_P2.0mm_Header_Vertical_Polarized","Connector_Molex_Milligrid/Molex_8783206xx_2x03_P2.0mm_Header_Vertical_Polarized_MountingPegs","Connector_Molex_Milligrid/Molex_8783208xx_2x04_P2.0mm_Header_Vertical","Connector_Molex_Milligrid/Molex_8783208xx_2x04_P2.0mm_Header_Vertical_MountingPegs","Connector_Molex_Milligrid/Molex_8783208xx_2x04_P2.0mm_Header_Vertical_Polarized","Connector_Molex_Milligrid/Molex_8783208xx_2x04_P2.0mm_Header_Vertical_Polarized_MountingPegs","Connector_Molex_Milligrid/Molex_8783210xx_2x05_P2.0mm_Header_Vertical","Connector_Molex_Milligrid/Molex_8783210xx_2x05_P2.0mm_Header_Vertical_MountingPegs","Connector_Molex_Milligrid/Molex_8783210xx_2x05_P2.0mm_Header_Vertical_Polarized","Connector_Molex_Milligrid/Molex_8783210xx_2x05_P2.0mm_Header_Vertical_Polarized_MountingPegs","Connector_Molex_Milligrid/Molex_8783212xx_2x06_P2.0mm_Header_Vertical","Connector_Molex_Milligrid/Molex_8783212xx_2x06_P2.0mm_Header_Vertical_MountingPegs","Connector_Molex_Milligrid/Molex_8783212xx_2x06_P2.0mm_Header_Vertical_Polarized","Connector_Molex_Milligrid/Molex_8783212xx_2x06_P2.0mm_Header_Vertical_Polarized_MountingPegs","Connector_Molex_Milligrid/Molex_8783214xx_2x07_P2.0mm_Header_Vertical_Polarized","Connector_Molex_Milligrid/Molex_8783214xx_2x07_P2.0mm_Header_Vertical_Polarized_MountingPegs","Connector_Molex_Milligrid/Molex_8783216xx_2x08_P2.0mm_Header_Vertical_Polarized","Connector_Molex_Milligrid/Molex_8783216xx_2x08_P2.0mm_Header_Vertical_Polarized_MountingPegs","Connector_Molex_Milligrid/Molex_8783218xx_2x09_P2.0mm_Header_Vertical_Polarized","Connector_Molex_Milligrid/Molex_8783218xx_2x09_P2.0mm_Header_Vertical_Polarized_MountingPegs","Connector_Molex_Milligrid/Molex_8783220xx_2x10_P2.0mm_Header_Vertical_Polarized","Connector_Molex_Milligrid/Molex_8783220xx_2x10_P2.0mm_Header_Vertical_Polarized_MountingPegs","Connector_Molex_Milligrid/Molex_8783222xx_2x11_P2.0mm_Header_Vertical_Polarized","Connector_Molex_Milligrid/Molex_8783222xx_2x11_P2.0mm_Header_Vertical_Polarized_MountingPegs","Connector_Molex_Milligrid/Molex_8783224xx_2x12_P2.0mm_Header_Vertical_Polarized","Connector_Molex_Milligrid/Molex_8783224xx_2x12_P2.0mm_Header_Vertical_Polarized_MountingPegs","Connector_Molex_Milligrid/Molex_8783226xx_2x13_P2.0mm_Header_Vertical_Polarized","Connector_Molex_Milligrid/Molex_8783226xx_2x13_P2.0mm_Header_Vertical_Polarized_MountingPegs","Connector_Molex_Milligrid/Molex_8783228xx_2x14_P2.0mm_Header_Vertical_Polarized","Connector_Molex_Milligrid/Molex_8783228xx_2x14_P2.0mm_Header_Vertical_Polarized_MountingPegs","Connector_Molex_Milligrid/Molex_8783230xx_2x15_P2.0mm_Header_Vertical_Polarized","Connector_Molex_Milligrid/Molex_8783230xx_2x15_P2.0mm_Header_Vertical_Polarized_MountingPegs","Connector_Molex_Milligrid/Molex_8783232xx_2x16_P2.0mm_Header_Vertical_Polarized","Connector_Molex_Milligrid/Molex_8783232xx_2x16_P2.0mm_Header_Vertical_Polarized_MountingPegs","Connector_Molex_Milligrid/Molex_8783234xx_2x17_P2.0mm_Header_Vertical_Polarized","Connector_Molex_Milligrid/Molex_8783234xx_2x17_P2.0mm_Header_Vertical_Polarized_MountingPegs","Connector_Molex_Milligrid/Molex_8783236xx_2x18_P2.0mm_Header_Vertical_Polarized","Connector_Molex_Milligrid/Molex_8783236xx_2x18_P2.0mm_Header_Vertical_Polarized_MountingPegs","Connector_Molex_Milligrid/Molex_8783238xx_2x19_P2.0mm_Header_Vertical_Polarized","Connector_Molex_Milligrid/Molex_8783238xx_2x19_P2.0mm_Header_Vertical_Polarized_MountingPegs","Connector_Molex_Milligrid/Molex_8783240xx_2x20_P2.0mm_Header_Vertical_Polarized","Connector_Molex_Milligrid/Molex_8783240xx_2x20_P2.0mm_Header_Vertical_Polarized_MountingPegs","Connector_Molex_Milligrid/Molex_8783242xx_2x21_P2.0mm_Header_Vertical_Polarized","Connector_Molex_Milligrid/Molex_8783242xx_2x21_P2.0mm_Header_Vertical_Polarized_MountingPegs","Connector_Molex_Milligrid/Molex_8783244xx_2x22_P2.0mm_Header_Vertical_Polarized","Connector_Molex_Milligrid/Molex_8783244xx_2x22_P2.0mm_Header_Vertical_Polarized_MountingPegs","Connector_Molex_Milligrid/Molex_8783246xx_2x23_P2.0mm_Header_Vertical_Polarized","Connector_Molex_Milligrid/Molex_8783246xx_2x23_P2.0mm_Header_Vertical_Polarized_MountingPegs","Connector_Molex_Milligrid/Molex_8783248xx_2x24_P2.0mm_Header_Vertical_Polarized","Connector_Molex_Milligrid/Molex_8783248xx_2x24_P2.0mm_Header_Vertical_Polarized_MountingPegs","Connector_Molex_Milligrid/Molex_8783250xx_2x25_P2.0mm_Header_Vertical_Polarized","Connector_Molex_Milligrid/Molex_8783250xx_2x25_P2.0mm_Header_Vertical_Polarized_MountingPegs","Connector_PCBEdge/4UCON_10156_2x40_P1.27mm_Socket_Horizontal","Connector_PCBEdge/BUS_AT","Connector_PCBEdge/BUS_PCI","Connector_PCBEdge/BUS_PCI_Express_Mini","Connector_PCBEdge/BUS_PCI_Express_Mini_Dual","Connector_PCBEdge/BUS_PCI_Express_Mini_Full","Connector_PCBEdge/BUS_PCI_Express_Mini_Half","Connector_PCBEdge/BUS_PCIexpress_x1","Connector_PCBEdge/BUS_PCIexpress_x16","Connector_PCBEdge/BUS_PCIexpress_x4","Connector_PCBEdge/BUS_PCIexpress_x8","Connector_PCBEdge/DEC_double_long","Connector_PCBEdge/DEC_double_short","Connector_PCBEdge/DEC_quad_long","Connector_PCBEdge/DEC_quad_short","Connector_PCBEdge/DEC_single_long","Connector_PCBEdge/DEC_single_short","Connector_PCBEdge/JAE_MM60-EZH039-Bx_BUS_PCI_Express_Holder","Connector_PCBEdge/JAE_MM60-EZH059-Bx_BUS_PCI_Express_Holder","Connector_PCBEdge/M.2_22110-xx-B","Connector_PCBEdge/M.2_22110-xx-M","Connector_PCBEdge/M.2_2230-xx-A","Connector_PCBEdge/M.2_2230-xx-B","Connector_PCBEdge/M.2_2230-xx-E","Connector_PCBEdge/M.2_2230-xx-M","Connector_PCBEdge/M.2_2242-xx-B","Connector_PCBEdge/M.2_2242-xx-M","Connector_PCBEdge/M.2_2260-xx-B","Connector_PCBEdge/M.2_2260-xx-M","Connector_PCBEdge/M.2_2280-xx-B","Connector_PCBEdge/M.2_2280-xx-M","Connector_PCBEdge/M.2_3030-xx-A","Connector_PCBEdge/M.2_3030-xx-E","Connector_PCBEdge/M.2_3042-xx-B","Connector_PCBEdge/SODIMM-200_1.8V_Card_edge","Connector_PCBEdge/SODIMM-200_2.5V_Card_edge","Connector_PCBEdge/SODIMM-260_DDR4_H4.0-5.2_OrientationStd_Socket","Connector_PCBEdge/Samtec_MECF-05-01-L-DV-WT_2x05_P1.27mm_Polarized_Socket_Horizontal","Connector_PCBEdge/Samtec_MECF-05-01-L-DV_2x05_P1.27mm_Polarized_Socket_Horizontal","Connector_PCBEdge/Samtec_MECF-05-01-NP-L-DV-WT_2x05_P1.27mm_Socket_Horizontal","Connector_PCBEdge/Samtec_MECF-05-01-NP-L-DV_2x05_P1.27mm_Socket_Horizontal","Connector_PCBEdge/Samtec_MECF-05-02-L-DV-WT_2x05_P1.27mm_Polarized_Socket_Horizontal","Connector_PCBEdge/Samtec_MECF-05-02-L-DV_2x05_P1.27mm_Polarized_Socket_Horizontal","Connector_PCBEdge/Samtec_MECF-05-02-NP-L-DV-WT_2x05_P1.27mm_Socket_Horizontal","Connector_PCBEdge/Samtec_MECF-05-02-NP-L-DV_2x05_P1.27mm_Socket_Horizontal","Connector_PCBEdge/Samtec_MECF-05-0_-L-DV_2x05_P1.27mm_Polarized_Edge","Connector_PCBEdge/Samtec_MECF-05-0_-NP-L-DV_2x05_P1.27mm_Edge","Connector_PCBEdge/Samtec_MECF-08-01-L-DV-WT_2x08_P1.27mm_Polarized_Socket_Horizontal","Connector_PCBEdge/Samtec_MECF-08-01-L-DV_2x08_P1.27mm_Polarized_Socket_Horizontal","Connector_PCBEdge/Samtec_MECF-08-01-NP-L-DV-WT_2x08_P1.27mm_Socket_Horizontal","Connector_PCBEdge/Samtec_MECF-08-01-NP-L-DV_2x08_P1.27mm_Socket_Horizontal","Connector_PCBEdge/Samtec_MECF-08-02-L-DV-WT_2x08_P1.27mm_Polarized_Socket_Horizontal","Connector_PCBEdge/Samtec_MECF-08-02-L-DV_2x08_P1.27mm_Polarized_Socket_Horizontal","Connector_PCBEdge/Samtec_MECF-08-02-NP-L-DV-WT_2x08_P1.27mm_Socket_Horizontal","Connector_PCBEdge/Samtec_MECF-08-02-NP-L-DV_2x08_P1.27mm_Socket_Horizontal","Connector_PCBEdge/Samtec_MECF-08-0_-L-DV_2x08_P1.27mm_Polarized_Edge","Connector_PCBEdge/Samtec_MECF-08-0_-NP-L-DV_2x08_P1.27mm_Edge","Connector_PCBEdge/Samtec_MECF-20-01-L-DV-WT_2x20_P1.27mm_Polarized_Socket_Horizontal","Connector_PCBEdge/Samtec_MECF-20-01-L-DV_2x20_P1.27mm_Polarized_Socket_Horizontal","Connector_PCBEdge/Samtec_MECF-20-01-NP-L-DV-WT_2x20_P1.27mm_Socket_Horizontal","Connector_PCBEdge/Samtec_MECF-20-01-NP-L-DV_2x20_P1.27mm_Socket_Horizontal","Connector_PCBEdge/Samtec_MECF-20-02-L-DV-WT_2x20_P1.27mm_Polarized_Socket_Horizontal","Connector_PCBEdge/Samtec_MECF-20-02-L-DV_2x20_P1.27mm_Polarized_Socket_Horizontal","Connector_PCBEdge/Samtec_MECF-20-02-NP-L-DV-WT_2x20_P1.27mm_Socket_Horizontal","Connector_PCBEdge/Samtec_MECF-20-02-NP-L-DV_2x20_P1.27mm_Socket_Horizontal","Connector_PCBEdge/Samtec_MECF-20-0_-L-DV_2x20_P1.27mm_Polarized_Edge","Connector_PCBEdge/Samtec_MECF-20-0_-NP-L-DV_2x20_P1.27mm_Edge","Connector_PCBEdge/Samtec_MECF-30-01-L-DV-WT_2x30_P1.27mm_Polarized_Socket_Horizontal","Connector_PCBEdge/Samtec_MECF-30-01-L-DV_2x30_P1.27mm_Polarized_Socket_Horizontal","Connector_PCBEdge/Samtec_MECF-30-01-NP-L-DV-WT_2x30_P1.27mm_Socket_Horizontal","Connector_PCBEdge/Samtec_MECF-30-01-NP-L-DV_2x30_P1.27mm_Socket_Horizontal","Connector_PCBEdge/Samtec_MECF-30-02-L-DV-WT_2x30_P1.27mm_Polarized_Socket_Horizontal","Connector_PCBEdge/Samtec_MECF-30-02-L-DV_2x30_P1.27mm_Polarized_Socket_Horizontal","Connector_PCBEdge/Samtec_MECF-30-02-NP-L-DV-WT_2x30_P1.27mm_Socket_Horizontal","Connector_PCBEdge/Samtec_MECF-30-02-NP-L-DV_2x30_P1.27mm_Socket_Horizontal","Connector_PCBEdge/Samtec_MECF-30-0_-L-DV_2x30_P1.27mm_Polarized_Edge","Connector_PCBEdge/Samtec_MECF-30-0_-NP-L-DV_2x30_P1.27mm_Edge","Connector_PCBEdge/Samtec_MECF-40-01-L-DV-WT_2x40_P1.27mm_Polarized_Socket_Horizontal","Connector_PCBEdge/Samtec_MECF-40-01-L-DV_2x40_P1.27mm_Polarized_Socket_Horizontal","Connector_PCBEdge/Samtec_MECF-40-01-NP-L-DV-WT_2x40_P1.27mm_Socket_Horizontal","Connector_PCBEdge/Samtec_MECF-40-01-NP-L-DV_2x40_P1.27mm_Socket_Horizontal","Connector_PCBEdge/Samtec_MECF-40-02-L-DV-WT_2x40_P1.27mm_Polarized_Socket_Horizontal","Connector_PCBEdge/Samtec_MECF-40-02-L-DV_2x40_P1.27mm_Polarized_Socket_Horizontal","Connector_PCBEdge/Samtec_MECF-40-02-NP-L-DV-WT_2x40_P1.27mm_Socket_Horizontal","Connector_PCBEdge/Samtec_MECF-40-02-NP-L-DV_2x40_P1.27mm_Socket_Horizontal","Connector_PCBEdge/Samtec_MECF-40-0_-L-DV_2x40_P1.27mm_Polarized_Edge","Connector_PCBEdge/Samtec_MECF-40-0_-NP-L-DV_2x40_P1.27mm_Edge","Connector_PCBEdge/Samtec_MECF-50-01-L-DV-WT_2x50_P1.27mm_Polarized_Socket_Horizontal","Connector_PCBEdge/Samtec_MECF-50-01-L-DV_2x50_P1.27mm_Polarized_Socket_Horizontal","Connector_PCBEdge/Samtec_MECF-50-01-NP-L-DV-WT_2x50_P1.27mm_Socket_Horizontal","Connector_PCBEdge/Samtec_MECF-50-01-NP-L-DV_2x50_P1.27mm_Socket_Horizontal","Connector_PCBEdge/Samtec_MECF-50-02-L-DV-WT_2x50_P1.27mm_Polarized_Socket_Horizontal","Connector_PCBEdge/Samtec_MECF-50-02-L-DV_2x50_P1.27mm_Polarized_Socket_Horizontal","Connector_PCBEdge/Samtec_MECF-50-02-NP-L-DV-WT_2x50_P1.27mm_Socket_Horizontal","Connector_PCBEdge/Samtec_MECF-50-02-NP-L-DV_2x50_P1.27mm_Socket_Horizontal","Connector_PCBEdge/Samtec_MECF-50-0_-L-DV_2x50_P1.27mm_Polarized_Edge","Connector_PCBEdge/Samtec_MECF-50-0_-NP-L-DV_2x50_P1.27mm_Edge","Connector_PCBEdge/Samtec_MECF-60-01-L-DV-WT_2x60_P1.27mm_Polarized_Socket_Horizontal","Connector_PCBEdge/Samtec_MECF-60-01-L-DV_2x60_P1.27mm_Polarized_Socket_Horizontal","Connector_PCBEdge/Samtec_MECF-60-01-NP-L-DV-WT_2x60_P1.27mm_Socket_Horizontal","Connector_PCBEdge/Samtec_MECF-60-01-NP-L-DV_2x60_P1.27mm_Socket_Horizontal","Connector_PCBEdge/Samtec_MECF-60-02-L-DV-WT_2x60_P1.27mm_Polarized_Socket_Horizontal","Connector_PCBEdge/Samtec_MECF-60-02-L-DV_2x60_P1.27mm_Polarized_Socket_Horizontal","Connector_PCBEdge/Samtec_MECF-60-02-NP-L-DV-WT_2x60_P1.27mm_Socket_Horizontal","Connector_PCBEdge/Samtec_MECF-60-02-NP-L-DV_2x60_P1.27mm_Socket_Horizontal","Connector_PCBEdge/Samtec_MECF-60-0_-L-DV_2x60_P1.27mm_Polarized_Edge","Connector_PCBEdge/Samtec_MECF-60-0_-NP-L-DV_2x60_P1.27mm_Edge","Connector_PCBEdge/Samtec_MECF-70-01-L-DV-WT_2x70_P1.27mm_Polarized_Socket_Horizontal","Connector_PCBEdge/Samtec_MECF-70-01-L-DV_2x70_P1.27mm_Polarized_Socket_Horizontal","Connector_PCBEdge/Samtec_MECF-70-01-NP-L-DV-WT_2x70_P1.27mm_Socket_Horizontal","Connector_PCBEdge/Samtec_MECF-70-01-NP-L-DV_2x70_P1.27mm_Socket_Horizontal","Connector_PCBEdge/Samtec_MECF-70-02-L-DV-WT_2x70_P1.27mm_Polarized_Socket_Horizontal","Connector_PCBEdge/Samtec_MECF-70-02-L-DV_2x70_P1.27mm_Polarized_Socket_Horizontal","Connector_PCBEdge/Samtec_MECF-70-02-NP-L-DV-WT_2x70_P1.27mm_Socket_Horizontal","Connector_PCBEdge/Samtec_MECF-70-02-NP-L-DV_2x70_P1.27mm_Socket_Horizontal","Connector_PCBEdge/Samtec_MECF-70-0_-L-DV_2x70_P1.27mm_Polarized_Edge","Connector_PCBEdge/Samtec_MECF-70-0_-NP-L-DV_2x70_P1.27mm_Edge","Connector_PCBEdge/molex_EDGELOCK_2-CKT","Connector_PCBEdge/molex_EDGELOCK_4-CKT","Connector_PCBEdge/molex_EDGELOCK_6-CKT","Connector_PCBEdge/molex_EDGELOCK_8-CKT","Connector_Phoenix_GMSTB/PhoenixContact_GMSTBA_2,5_10-G-7,62_1x10_P7.62mm_Horizontal","Connector_Phoenix_GMSTB/PhoenixContact_GMSTBA_2,5_10-G_1x10_P7.50mm_Horizontal","Connector_Phoenix_GMSTB/PhoenixContact_GMSTBA_2,5_11-G-7,62_1x11_P7.62mm_Horizontal","Connector_Phoenix_GMSTB/PhoenixContact_GMSTBA_2,5_11-G_1x11_P7.50mm_Horizontal","Connector_Phoenix_GMSTB/PhoenixContact_GMSTBA_2,5_12-G-7,62_1x12_P7.62mm_Horizontal","Connector_Phoenix_GMSTB/PhoenixContact_GMSTBA_2,5_12-G_1x12_P7.50mm_Horizontal","Connector_Phoenix_GMSTB/PhoenixContact_GMSTBA_2,5_2-G-7,62_1x02_P7.62mm_Horizontal","Connector_Phoenix_GMSTB/PhoenixContact_GMSTBA_2,5_2-G_1x02_P7.50mm_Horizontal","Connector_Phoenix_GMSTB/PhoenixContact_GMSTBA_2,5_3-G-7,62_1x03_P7.62mm_Horizontal","Connector_Phoenix_GMSTB/PhoenixContact_GMSTBA_2,5_3-G_1x03_P7.50mm_Horizontal","Connector_Phoenix_GMSTB/PhoenixContact_GMSTBA_2,5_4-G-7,62_1x04_P7.62mm_Horizontal","Connector_Phoenix_GMSTB/PhoenixContact_GMSTBA_2,5_4-G_1x04_P7.50mm_Horizontal","Connector_Phoenix_GMSTB/PhoenixContact_GMSTBA_2,5_5-G-7,62_1x05_P7.62mm_Horizontal","Connector_Phoenix_GMSTB/PhoenixContact_GMSTBA_2,5_5-G_1x05_P7.50mm_Horizontal","Connector_Phoenix_GMSTB/PhoenixContact_GMSTBA_2,5_6-G-7,62_1x06_P7.62mm_Horizontal","Connector_Phoenix_GMSTB/PhoenixContact_GMSTBA_2,5_6-G_1x06_P7.50mm_Horizontal","Connector_Phoenix_GMSTB/PhoenixContact_GMSTBA_2,5_7-G-7,62_1x07_P7.62mm_Horizontal","Connector_Phoenix_GMSTB/PhoenixContact_GMSTBA_2,5_7-G_1x07_P7.50mm_Horizontal","Connector_Phoenix_GMSTB/PhoenixContact_GMSTBA_2,5_8-G-7,62_1x08_P7.62mm_Horizontal","Connector_Phoenix_GMSTB/PhoenixContact_GMSTBA_2,5_8-G_1x08_P7.50mm_Horizontal","Connector_Phoenix_GMSTB/PhoenixContact_GMSTBA_2,5_9-G-7,62_1x09_P7.62mm_Horizontal","Connector_Phoenix_GMSTB/PhoenixContact_GMSTBA_2,5_9-G_1x09_P7.50mm_Horizontal","Connector_Phoenix_GMSTB/PhoenixContact_GMSTBVA_2,5_10-G-7,62_1x10_P7.62mm_Vertical","Connector_Phoenix_GMSTB/PhoenixContact_GMSTBVA_2,5_10-G_1x10_P7.50mm_Vertical","Connector_Phoenix_GMSTB/PhoenixContact_GMSTBVA_2,5_11-G-7,62_1x11_P7.62mm_Vertical","Connector_Phoenix_GMSTB/PhoenixContact_GMSTBVA_2,5_11-G_1x11_P7.50mm_Vertical","Connector_Phoenix_GMSTB/PhoenixContact_GMSTBVA_2,5_12-G-7,62_1x12_P7.62mm_Vertical","Connector_Phoenix_GMSTB/PhoenixContact_GMSTBVA_2,5_12-G_1x12_P7.50mm_Vertical","Connector_Phoenix_GMSTB/PhoenixContact_GMSTBVA_2,5_2-G-7,62_1x02_P7.62mm_Vertical","Connector_Phoenix_GMSTB/PhoenixContact_GMSTBVA_2,5_2-G_1x02_P7.50mm_Vertical","Connector_Phoenix_GMSTB/PhoenixContact_GMSTBVA_2,5_3-G-7,62_1x03_P7.62mm_Vertical","Connector_Phoenix_GMSTB/PhoenixContact_GMSTBVA_2,5_3-G_1x03_P7.50mm_Vertical","Connector_Phoenix_GMSTB/PhoenixContact_GMSTBVA_2,5_4-G-7,62_1x04_P7.62mm_Vertical","Connector_Phoenix_GMSTB/PhoenixContact_GMSTBVA_2,5_4-G_1x04_P7.50mm_Vertical","Connector_Phoenix_GMSTB/PhoenixContact_GMSTBVA_2,5_5-G-7,62_1x05_P7.62mm_Vertical","Connector_Phoenix_GMSTB/PhoenixContact_GMSTBVA_2,5_5-G_1x05_P7.50mm_Vertical","Connector_Phoenix_GMSTB/PhoenixContact_GMSTBVA_2,5_6-G-7,62_1x06_P7.62mm_Vertical","Connector_Phoenix_GMSTB/PhoenixContact_GMSTBVA_2,5_6-G_1x06_P7.50mm_Vertical","Connector_Phoenix_GMSTB/PhoenixContact_GMSTBVA_2,5_7-G-7,62_1x07_P7.62mm_Vertical","Connector_Phoenix_GMSTB/PhoenixContact_GMSTBVA_2,5_7-G_1x07_P7.50mm_Vertical","Connector_Phoenix_GMSTB/PhoenixContact_GMSTBVA_2,5_8-G-7,62_1x08_P7.62mm_Vertical","Connector_Phoenix_GMSTB/PhoenixContact_GMSTBVA_2,5_8-G_1x08_P7.50mm_Vertical","Connector_Phoenix_GMSTB/PhoenixContact_GMSTBVA_2,5_9-G-7,62_1x09_P7.62mm_Vertical","Connector_Phoenix_GMSTB/PhoenixContact_GMSTBVA_2,5_9-G_1x09_P7.50mm_Vertical","Connector_Phoenix_GMSTB/PhoenixContact_GMSTBV_2,5_10-GF-7,62_1x10_P7.62mm_Vertical_ThreadedFlange","Connector_Phoenix_GMSTB/PhoenixContact_GMSTBV_2,5_10-GF-7,62_1x10_P7.62mm_Vertical_ThreadedFlange_MountHole","Connector_Phoenix_GMSTB/PhoenixContact_GMSTBV_2,5_11-GF-7,62_1x11_P7.62mm_Vertical_ThreadedFlange","Connector_Phoenix_GMSTB/PhoenixContact_GMSTBV_2,5_11-GF-7,62_1x11_P7.62mm_Vertical_ThreadedFlange_MountHole","Connector_Phoenix_GMSTB/PhoenixContact_GMSTBV_2,5_12-GF-7,62_1x12_P7.62mm_Vertical_ThreadedFlange","Connector_Phoenix_GMSTB/PhoenixContact_GMSTBV_2,5_12-GF-7,62_1x12_P7.62mm_Vertical_ThreadedFlange_MountHole","Connector_Phoenix_GMSTB/PhoenixContact_GMSTBV_2,5_2-GF-7,62_1x02_P7.62mm_Vertical_ThreadedFlange","Connector_Phoenix_GMSTB/PhoenixContact_GMSTBV_2,5_2-GF-7,62_1x02_P7.62mm_Vertical_ThreadedFlange_MountHole","Connector_Phoenix_GMSTB/PhoenixContact_GMSTBV_2,5_3-GF-7,62_1x03_P7.62mm_Vertical_ThreadedFlange","Connector_Phoenix_GMSTB/PhoenixContact_GMSTBV_2,5_3-GF-7,62_1x03_P7.62mm_Vertical_ThreadedFlange_MountHole","Connector_Phoenix_GMSTB/PhoenixContact_GMSTBV_2,5_4-GF-7,62_1x04_P7.62mm_Vertical_ThreadedFlange","Connector_Phoenix_GMSTB/PhoenixContact_GMSTBV_2,5_4-GF-7,62_1x04_P7.62mm_Vertical_ThreadedFlange_MountHole","Connector_Phoenix_GMSTB/PhoenixContact_GMSTBV_2,5_5-GF-7,62_1x05_P7.62mm_Vertical_ThreadedFlange","Connector_Phoenix_GMSTB/PhoenixContact_GMSTBV_2,5_5-GF-7,62_1x05_P7.62mm_Vertical_ThreadedFlange_MountHole","Connector_Phoenix_GMSTB/PhoenixContact_GMSTBV_2,5_6-GF-7,62_1x06_P7.62mm_Vertical_ThreadedFlange","Connector_Phoenix_GMSTB/PhoenixContact_GMSTBV_2,5_6-GF-7,62_1x06_P7.62mm_Vertical_ThreadedFlange_MountHole","Connector_Phoenix_GMSTB/PhoenixContact_GMSTBV_2,5_7-GF-7,62_1x07_P7.62mm_Vertical_ThreadedFlange","Connector_Phoenix_GMSTB/PhoenixContact_GMSTBV_2,5_7-GF-7,62_1x07_P7.62mm_Vertical_ThreadedFlange_MountHole","Connector_Phoenix_GMSTB/PhoenixContact_GMSTBV_2,5_8-GF-7,62_1x08_P7.62mm_Vertical_ThreadedFlange","Connector_Phoenix_GMSTB/PhoenixContact_GMSTBV_2,5_8-GF-7,62_1x08_P7.62mm_Vertical_ThreadedFlange_MountHole","Connector_Phoenix_GMSTB/PhoenixContact_GMSTBV_2,5_9-GF-7,62_1x09_P7.62mm_Vertical_ThreadedFlange","Connector_Phoenix_GMSTB/PhoenixContact_GMSTBV_2,5_9-GF-7,62_1x09_P7.62mm_Vertical_ThreadedFlange_MountHole","Connector_Phoenix_GMSTB/PhoenixContact_GMSTB_2,5_10-GF-7,62_1x10_P7.62mm_Horizontal_ThreadedFlange","Connector_Phoenix_GMSTB/PhoenixContact_GMSTB_2,5_10-GF-7,62_1x10_P7.62mm_Horizontal_ThreadedFlange_MountHole","Connector_Phoenix_GMSTB/PhoenixContact_GMSTB_2,5_11-GF-7,62_1x11_P7.62mm_Horizontal_ThreadedFlange","Connector_Phoenix_GMSTB/PhoenixContact_GMSTB_2,5_11-GF-7,62_1x11_P7.62mm_Horizontal_ThreadedFlange_MountHole","Connector_Phoenix_GMSTB/PhoenixContact_GMSTB_2,5_12-GF-7,62_1x12_P7.62mm_Horizontal_ThreadedFlange","Connector_Phoenix_GMSTB/PhoenixContact_GMSTB_2,5_12-GF-7,62_1x12_P7.62mm_Horizontal_ThreadedFlange_MountHole","Connector_Phoenix_GMSTB/PhoenixContact_GMSTB_2,5_2-GF-7,62_1x02_P7.62mm_Horizontal_ThreadedFlange","Connector_Phoenix_GMSTB/PhoenixContact_GMSTB_2,5_2-GF-7,62_1x02_P7.62mm_Horizontal_ThreadedFlange_MountHole","Connector_Phoenix_GMSTB/PhoenixContact_GMSTB_2,5_3-GF-7,62_1x03_P7.62mm_Horizontal_ThreadedFlange","Connector_Phoenix_GMSTB/PhoenixContact_GMSTB_2,5_3-GF-7,62_1x03_P7.62mm_Horizontal_ThreadedFlange_MountHole","Connector_Phoenix_GMSTB/PhoenixContact_GMSTB_2,5_4-GF-7,62_1x04_P7.62mm_Horizontal_ThreadedFlange","Connector_Phoenix_GMSTB/PhoenixContact_GMSTB_2,5_4-GF-7,62_1x04_P7.62mm_Horizontal_ThreadedFlange_MountHole","Connector_Phoenix_GMSTB/PhoenixContact_GMSTB_2,5_5-GF-7,62_1x05_P7.62mm_Horizontal_ThreadedFlange","Connector_Phoenix_GMSTB/PhoenixContact_GMSTB_2,5_5-GF-7,62_1x05_P7.62mm_Horizontal_ThreadedFlange_MountHole","Connector_Phoenix_GMSTB/PhoenixContact_GMSTB_2,5_6-GF-7,62_1x06_P7.62mm_Horizontal_ThreadedFlange","Connector_Phoenix_GMSTB/PhoenixContact_GMSTB_2,5_6-GF-7,62_1x06_P7.62mm_Horizontal_ThreadedFlange_MountHole","Connector_Phoenix_GMSTB/PhoenixContact_GMSTB_2,5_7-GF-7,62_1x07_P7.62mm_Horizontal_ThreadedFlange","Connector_Phoenix_GMSTB/PhoenixContact_GMSTB_2,5_7-GF-7,62_1x07_P7.62mm_Horizontal_ThreadedFlange_MountHole","Connector_Phoenix_GMSTB/PhoenixContact_GMSTB_2,5_8-GF-7,62_1x08_P7.62mm_Horizontal_ThreadedFlange","Connector_Phoenix_GMSTB/PhoenixContact_GMSTB_2,5_8-GF-7,62_1x08_P7.62mm_Horizontal_ThreadedFlange_MountHole","Connector_Phoenix_GMSTB/PhoenixContact_GMSTB_2,5_9-GF-7,62_1x09_P7.62mm_Horizontal_ThreadedFlange","Connector_Phoenix_GMSTB/PhoenixContact_GMSTB_2,5_9-GF-7,62_1x09_P7.62mm_Horizontal_ThreadedFlange_MountHole","Connector_Phoenix_MC/PhoenixContact_MCV_1,5_10-G-3.5_1x10_P3.50mm_Vertical","Connector_Phoenix_MC/PhoenixContact_MCV_1,5_10-G-3.81_1x10_P3.81mm_Vertical","Connector_Phoenix_MC/PhoenixContact_MCV_1,5_10-GF-3.5_1x10_P3.50mm_Vertical_ThreadedFlange","Connector_Phoenix_MC/PhoenixContact_MCV_1,5_10-GF-3.5_1x10_P3.50mm_Vertical_ThreadedFlange_MountHole","Connector_Phoenix_MC/PhoenixContact_MCV_1,5_10-GF-3.81_1x10_P3.81mm_Vertical_ThreadedFlange","Connector_Phoenix_MC/PhoenixContact_MCV_1,5_10-GF-3.81_1x10_P3.81mm_Vertical_ThreadedFlange_MountHole","Connector_Phoenix_MC/PhoenixContact_MCV_1,5_11-G-3.5_1x11_P3.50mm_Vertical","Connector_Phoenix_MC/PhoenixContact_MCV_1,5_11-G-3.81_1x11_P3.81mm_Vertical","Connector_Phoenix_MC/PhoenixContact_MCV_1,5_11-GF-3.5_1x11_P3.50mm_Vertical_ThreadedFlange","Connector_Phoenix_MC/PhoenixContact_MCV_1,5_11-GF-3.5_1x11_P3.50mm_Vertical_ThreadedFlange_MountHole","Connector_Phoenix_MC/PhoenixContact_MCV_1,5_11-GF-3.81_1x11_P3.81mm_Vertical_ThreadedFlange","Connector_Phoenix_MC/PhoenixContact_MCV_1,5_11-GF-3.81_1x11_P3.81mm_Vertical_ThreadedFlange_MountHole","Connector_Phoenix_MC/PhoenixContact_MCV_1,5_12-G-3.5_1x12_P3.50mm_Vertical","Connector_Phoenix_MC/PhoenixContact_MCV_1,5_12-G-3.81_1x12_P3.81mm_Vertical","Connector_Phoenix_MC/PhoenixContact_MCV_1,5_12-GF-3.5_1x12_P3.50mm_Vertical_ThreadedFlange","Connector_Phoenix_MC/PhoenixContact_MCV_1,5_12-GF-3.5_1x12_P3.50mm_Vertical_ThreadedFlange_MountHole","Connector_Phoenix_MC/PhoenixContact_MCV_1,5_12-GF-3.81_1x12_P3.81mm_Vertical_ThreadedFlange","Connector_Phoenix_MC/PhoenixContact_MCV_1,5_12-GF-3.81_1x12_P3.81mm_Vertical_ThreadedFlange_MountHole","Connector_Phoenix_MC/PhoenixContact_MCV_1,5_13-G-3.5_1x13_P3.50mm_Vertical","Connector_Phoenix_MC/PhoenixContact_MCV_1,5_13-G-3.81_1x13_P3.81mm_Vertical","Connector_Phoenix_MC/PhoenixContact_MCV_1,5_13-GF-3.5_1x13_P3.50mm_Vertical_ThreadedFlange","Connector_Phoenix_MC/PhoenixContact_MCV_1,5_13-GF-3.5_1x13_P3.50mm_Vertical_ThreadedFlange_MountHole","Connector_Phoenix_MC/PhoenixContact_MCV_1,5_13-GF-3.81_1x13_P3.81mm_Vertical_ThreadedFlange","Connector_Phoenix_MC/PhoenixContact_MCV_1,5_13-GF-3.81_1x13_P3.81mm_Vertical_ThreadedFlange_MountHole","Connector_Phoenix_MC/PhoenixContact_MCV_1,5_14-G-3.5_1x14_P3.50mm_Vertical","Connector_Phoenix_MC/PhoenixContact_MCV_1,5_14-G-3.81_1x14_P3.81mm_Vertical","Connector_Phoenix_MC/PhoenixContact_MCV_1,5_14-GF-3.5_1x14_P3.50mm_Vertical_ThreadedFlange","Connector_Phoenix_MC/PhoenixContact_MCV_1,5_14-GF-3.5_1x14_P3.50mm_Vertical_ThreadedFlange_MountHole","Connector_Phoenix_MC/PhoenixContact_MCV_1,5_14-GF-3.81_1x14_P3.81mm_Vertical_ThreadedFlange","Connector_Phoenix_MC/PhoenixContact_MCV_1,5_14-GF-3.81_1x14_P3.81mm_Vertical_ThreadedFlange_MountHole","Connector_Phoenix_MC/PhoenixContact_MCV_1,5_15-G-3.5_1x15_P3.50mm_Vertical","Connector_Phoenix_MC/PhoenixContact_MCV_1,5_15-G-3.81_1x15_P3.81mm_Vertical","Connector_Phoenix_MC/PhoenixContact_MCV_1,5_15-GF-3.5_1x15_P3.50mm_Vertical_ThreadedFlange","Connector_Phoenix_MC/PhoenixContact_MCV_1,5_15-GF-3.5_1x15_P3.50mm_Vertical_ThreadedFlange_MountHole","Connector_Phoenix_MC/PhoenixContact_MCV_1,5_15-GF-3.81_1x15_P3.81mm_Vertical_ThreadedFlange","Connector_Phoenix_MC/PhoenixContact_MCV_1,5_15-GF-3.81_1x15_P3.81mm_Vertical_ThreadedFlange_MountHole","Connector_Phoenix_MC/PhoenixContact_MCV_1,5_16-G-3.5_1x16_P3.50mm_Vertical","Connector_Phoenix_MC/PhoenixContact_MCV_1,5_16-G-3.81_1x16_P3.81mm_Vertical","Connector_Phoenix_MC/PhoenixContact_MCV_1,5_16-GF-3.5_1x16_P3.50mm_Vertical_ThreadedFlange","Connector_Phoenix_MC/PhoenixContact_MCV_1,5_16-GF-3.5_1x16_P3.50mm_Vertical_ThreadedFlange_MountHole","Connector_Phoenix_MC/PhoenixContact_MCV_1,5_16-GF-3.81_1x16_P3.81mm_Vertical_ThreadedFlange","Connector_Phoenix_MC/PhoenixContact_MCV_1,5_16-GF-3.81_1x16_P3.81mm_Vertical_ThreadedFlange_MountHole","Connector_Phoenix_MC/PhoenixContact_MCV_1,5_2-G-3.5_1x02_P3.50mm_Vertical","Connector_Phoenix_MC/PhoenixContact_MCV_1,5_2-G-3.81_1x02_P3.81mm_Vertical","Connector_Phoenix_MC/PhoenixContact_MCV_1,5_2-GF-3.5_1x02_P3.50mm_Vertical_ThreadedFlange","Connector_Phoenix_MC/PhoenixContact_MCV_1,5_2-GF-3.5_1x02_P3.50mm_Vertical_ThreadedFlange_MountHole","Connector_Phoenix_MC/PhoenixContact_MCV_1,5_2-GF-3.81_1x02_P3.81mm_Vertical_ThreadedFlange","Connector_Phoenix_MC/PhoenixContact_MCV_1,5_2-GF-3.81_1x02_P3.81mm_Vertical_ThreadedFlange_MountHole","Connector_Phoenix_MC/PhoenixContact_MCV_1,5_3-G-3.5_1x03_P3.50mm_Vertical","Connector_Phoenix_MC/PhoenixContact_MCV_1,5_3-G-3.81_1x03_P3.81mm_Vertical","Connector_Phoenix_MC/PhoenixContact_MCV_1,5_3-GF-3.5_1x03_P3.50mm_Vertical_ThreadedFlange","Connector_Phoenix_MC/PhoenixContact_MCV_1,5_3-GF-3.5_1x03_P3.50mm_Vertical_ThreadedFlange_MountHole","Connector_Phoenix_MC/PhoenixContact_MCV_1,5_3-GF-3.81_1x03_P3.81mm_Vertical_ThreadedFlange","Connector_Phoenix_MC/PhoenixContact_MCV_1,5_3-GF-3.81_1x03_P3.81mm_Vertical_ThreadedFlange_MountHole","Connector_Phoenix_MC/PhoenixContact_MCV_1,5_4-G-3.5_1x04_P3.50mm_Vertical","Connector_Phoenix_MC/PhoenixContact_MCV_1,5_4-G-3.81_1x04_P3.81mm_Vertical","Connector_Phoenix_MC/PhoenixContact_MCV_1,5_4-GF-3.5_1x04_P3.50mm_Vertical_ThreadedFlange","Connector_Phoenix_MC/PhoenixContact_MCV_1,5_4-GF-3.5_1x04_P3.50mm_Vertical_ThreadedFlange_MountHole","Connector_Phoenix_MC/PhoenixContact_MCV_1,5_4-GF-3.81_1x04_P3.81mm_Vertical_ThreadedFlange","Connector_Phoenix_MC/PhoenixContact_MCV_1,5_4-GF-3.81_1x04_P3.81mm_Vertical_ThreadedFlange_MountHole","Connector_Phoenix_MC/PhoenixContact_MCV_1,5_5-G-3.5_1x05_P3.50mm_Vertical","Connector_Phoenix_MC/PhoenixContact_MCV_1,5_5-G-3.81_1x05_P3.81mm_Vertical","Connector_Phoenix_MC/PhoenixContact_MCV_1,5_5-GF-3.5_1x05_P3.50mm_Vertical_ThreadedFlange","Connector_Phoenix_MC/PhoenixContact_MCV_1,5_5-GF-3.5_1x05_P3.50mm_Vertical_ThreadedFlange_MountHole","Connector_Phoenix_MC/PhoenixContact_MCV_1,5_5-GF-3.81_1x05_P3.81mm_Vertical_ThreadedFlange","Connector_Phoenix_MC/PhoenixContact_MCV_1,5_5-GF-3.81_1x05_P3.81mm_Vertical_ThreadedFlange_MountHole","Connector_Phoenix_MC/PhoenixContact_MCV_1,5_6-G-3.5_1x06_P3.50mm_Vertical","Connector_Phoenix_MC/PhoenixContact_MCV_1,5_6-G-3.81_1x06_P3.81mm_Vertical","Connector_Phoenix_MC/PhoenixContact_MCV_1,5_6-GF-3.5_1x06_P3.50mm_Vertical_ThreadedFlange","Connector_Phoenix_MC/PhoenixContact_MCV_1,5_6-GF-3.5_1x06_P3.50mm_Vertical_ThreadedFlange_MountHole","Connector_Phoenix_MC/PhoenixContact_MCV_1,5_6-GF-3.81_1x06_P3.81mm_Vertical_ThreadedFlange","Connector_Phoenix_MC/PhoenixContact_MCV_1,5_6-GF-3.81_1x06_P3.81mm_Vertical_ThreadedFlange_MountHole","Connector_Phoenix_MC/PhoenixContact_MCV_1,5_7-G-3.5_1x07_P3.50mm_Vertical","Connector_Phoenix_MC/PhoenixContact_MCV_1,5_7-G-3.81_1x07_P3.81mm_Vertical","Connector_Phoenix_MC/PhoenixContact_MCV_1,5_7-GF-3.5_1x07_P3.50mm_Vertical_ThreadedFlange","Connector_Phoenix_MC/PhoenixContact_MCV_1,5_7-GF-3.5_1x07_P3.50mm_Vertical_ThreadedFlange_MountHole","Connector_Phoenix_MC/PhoenixContact_MCV_1,5_7-GF-3.81_1x07_P3.81mm_Vertical_ThreadedFlange","Connector_Phoenix_MC/PhoenixContact_MCV_1,5_7-GF-3.81_1x07_P3.81mm_Vertical_ThreadedFlange_MountHole","Connector_Phoenix_MC/PhoenixContact_MCV_1,5_8-G-3.5_1x08_P3.50mm_Vertical","Connector_Phoenix_MC/PhoenixContact_MCV_1,5_8-G-3.81_1x08_P3.81mm_Vertical","Connector_Phoenix_MC/PhoenixContact_MCV_1,5_8-GF-3.5_1x08_P3.50mm_Vertical_ThreadedFlange","Connector_Phoenix_MC/PhoenixContact_MCV_1,5_8-GF-3.5_1x08_P3.50mm_Vertical_ThreadedFlange_MountHole","Connector_Phoenix_MC/PhoenixContact_MCV_1,5_8-GF-3.81_1x08_P3.81mm_Vertical_ThreadedFlange","Connector_Phoenix_MC/PhoenixContact_MCV_1,5_8-GF-3.81_1x08_P3.81mm_Vertical_ThreadedFlange_MountHole","Connector_Phoenix_MC/PhoenixContact_MCV_1,5_9-G-3.5_1x09_P3.50mm_Vertical","Connector_Phoenix_MC/PhoenixContact_MCV_1,5_9-G-3.81_1x09_P3.81mm_Vertical","Connector_Phoenix_MC/PhoenixContact_MCV_1,5_9-GF-3.5_1x09_P3.50mm_Vertical_ThreadedFlange","Connector_Phoenix_MC/PhoenixContact_MCV_1,5_9-GF-3.5_1x09_P3.50mm_Vertical_ThreadedFlange_MountHole","Connector_Phoenix_MC/PhoenixContact_MCV_1,5_9-GF-3.81_1x09_P3.81mm_Vertical_ThreadedFlange","Connector_Phoenix_MC/PhoenixContact_MCV_1,5_9-GF-3.81_1x09_P3.81mm_Vertical_ThreadedFlange_MountHole","Connector_Phoenix_MC/PhoenixContact_MC_1,5_10-G-3.5_1x10_P3.50mm_Horizontal","Connector_Phoenix_MC/PhoenixContact_MC_1,5_10-G-3.81_1x10_P3.81mm_Horizontal","Connector_Phoenix_MC/PhoenixContact_MC_1,5_10-GF-3.5_1x10_P3.50mm_Horizontal_ThreadedFlange","Connector_Phoenix_MC/PhoenixContact_MC_1,5_10-GF-3.5_1x10_P3.50mm_Horizontal_ThreadedFlange_MountHole","Connector_Phoenix_MC/PhoenixContact_MC_1,5_10-GF-3.81_1x10_P3.81mm_Horizontal_ThreadedFlange","Connector_Phoenix_MC/PhoenixContact_MC_1,5_10-GF-3.81_1x10_P3.81mm_Horizontal_ThreadedFlange_MountHole","Connector_Phoenix_MC/PhoenixContact_MC_1,5_11-G-3.5_1x11_P3.50mm_Horizontal","Connector_Phoenix_MC/PhoenixContact_MC_1,5_11-G-3.81_1x11_P3.81mm_Horizontal","Connector_Phoenix_MC/PhoenixContact_MC_1,5_11-GF-3.5_1x11_P3.50mm_Horizontal_ThreadedFlange","Connector_Phoenix_MC/PhoenixContact_MC_1,5_11-GF-3.5_1x11_P3.50mm_Horizontal_ThreadedFlange_MountHole","Connector_Phoenix_MC/PhoenixContact_MC_1,5_11-GF-3.81_1x11_P3.81mm_Horizontal_ThreadedFlange","Connector_Phoenix_MC/PhoenixContact_MC_1,5_11-GF-3.81_1x11_P3.81mm_Horizontal_ThreadedFlange_MountHole","Connector_Phoenix_MC/PhoenixContact_MC_1,5_12-G-3.5_1x12_P3.50mm_Horizontal","Connector_Phoenix_MC/PhoenixContact_MC_1,5_12-G-3.81_1x12_P3.81mm_Horizontal","Connector_Phoenix_MC/PhoenixContact_MC_1,5_12-GF-3.5_1x12_P3.50mm_Horizontal_ThreadedFlange","Connector_Phoenix_MC/PhoenixContact_MC_1,5_12-GF-3.5_1x12_P3.50mm_Horizontal_ThreadedFlange_MountHole","Connector_Phoenix_MC/PhoenixContact_MC_1,5_12-GF-3.81_1x12_P3.81mm_Horizontal_ThreadedFlange","Connector_Phoenix_MC/PhoenixContact_MC_1,5_12-GF-3.81_1x12_P3.81mm_Horizontal_ThreadedFlange_MountHole","Connector_Phoenix_MC/PhoenixContact_MC_1,5_13-G-3.5_1x13_P3.50mm_Horizontal","Connector_Phoenix_MC/PhoenixContact_MC_1,5_13-G-3.81_1x13_P3.81mm_Horizontal","Connector_Phoenix_MC/PhoenixContact_MC_1,5_13-GF-3.5_1x13_P3.50mm_Horizontal_ThreadedFlange","Connector_Phoenix_MC/PhoenixContact_MC_1,5_13-GF-3.5_1x13_P3.50mm_Horizontal_ThreadedFlange_MountHole","Connector_Phoenix_MC/PhoenixContact_MC_1,5_13-GF-3.81_1x13_P3.81mm_Horizontal_ThreadedFlange","Connector_Phoenix_MC/PhoenixContact_MC_1,5_13-GF-3.81_1x13_P3.81mm_Horizontal_ThreadedFlange_MountHole","Connector_Phoenix_MC/PhoenixContact_MC_1,5_14-G-3.5_1x14_P3.50mm_Horizontal","Connector_Phoenix_MC/PhoenixContact_MC_1,5_14-G-3.81_1x14_P3.81mm_Horizontal","Connector_Phoenix_MC/PhoenixContact_MC_1,5_14-GF-3.5_1x14_P3.50mm_Horizontal_ThreadedFlange","Connector_Phoenix_MC/PhoenixContact_MC_1,5_14-GF-3.5_1x14_P3.50mm_Horizontal_ThreadedFlange_MountHole","Connector_Phoenix_MC/PhoenixContact_MC_1,5_14-GF-3.81_1x14_P3.81mm_Horizontal_ThreadedFlange","Connector_Phoenix_MC/PhoenixContact_MC_1,5_14-GF-3.81_1x14_P3.81mm_Horizontal_ThreadedFlange_MountHole","Connector_Phoenix_MC/PhoenixContact_MC_1,5_15-G-3.5_1x15_P3.50mm_Horizontal","Connector_Phoenix_MC/PhoenixContact_MC_1,5_15-G-3.81_1x15_P3.81mm_Horizontal","Connector_Phoenix_MC/PhoenixContact_MC_1,5_15-GF-3.5_1x15_P3.50mm_Horizontal_ThreadedFlange","Connector_Phoenix_MC/PhoenixContact_MC_1,5_15-GF-3.5_1x15_P3.50mm_Horizontal_ThreadedFlange_MountHole","Connector_Phoenix_MC/PhoenixContact_MC_1,5_15-GF-3.81_1x15_P3.81mm_Horizontal_ThreadedFlange","Connector_Phoenix_MC/PhoenixContact_MC_1,5_15-GF-3.81_1x15_P3.81mm_Horizontal_ThreadedFlange_MountHole","Connector_Phoenix_MC/PhoenixContact_MC_1,5_16-G-3.5_1x16_P3.50mm_Horizontal","Connector_Phoenix_MC/PhoenixContact_MC_1,5_16-G-3.81_1x16_P3.81mm_Horizontal","Connector_Phoenix_MC/PhoenixContact_MC_1,5_16-GF-3.5_1x16_P3.50mm_Horizontal_ThreadedFlange","Connector_Phoenix_MC/PhoenixContact_MC_1,5_16-GF-3.5_1x16_P3.50mm_Horizontal_ThreadedFlange_MountHole","Connector_Phoenix_MC/PhoenixContact_MC_1,5_16-GF-3.81_1x16_P3.81mm_Horizontal_ThreadedFlange","Connector_Phoenix_MC/PhoenixContact_MC_1,5_16-GF-3.81_1x16_P3.81mm_Horizontal_ThreadedFlange_MountHole","Connector_Phoenix_MC/PhoenixContact_MC_1,5_2-G-3.5_1x02_P3.50mm_Horizontal","Connector_Phoenix_MC/PhoenixContact_MC_1,5_2-G-3.81_1x02_P3.81mm_Horizontal","Connector_Phoenix_MC/PhoenixContact_MC_1,5_2-GF-3.5_1x02_P3.50mm_Horizontal_ThreadedFlange","Connector_Phoenix_MC/PhoenixContact_MC_1,5_2-GF-3.5_1x02_P3.50mm_Horizontal_ThreadedFlange_MountHole","Connector_Phoenix_MC/PhoenixContact_MC_1,5_2-GF-3.81_1x02_P3.81mm_Horizontal_ThreadedFlange","Connector_Phoenix_MC/PhoenixContact_MC_1,5_2-GF-3.81_1x02_P3.81mm_Horizontal_ThreadedFlange_MountHole","Connector_Phoenix_MC/PhoenixContact_MC_1,5_3-G-3.5_1x03_P3.50mm_Horizontal","Connector_Phoenix_MC/PhoenixContact_MC_1,5_3-G-3.81_1x03_P3.81mm_Horizontal","Connector_Phoenix_MC/PhoenixContact_MC_1,5_3-GF-3.5_1x03_P3.50mm_Horizontal_ThreadedFlange","Connector_Phoenix_MC/PhoenixContact_MC_1,5_3-GF-3.5_1x03_P3.50mm_Horizontal_ThreadedFlange_MountHole","Connector_Phoenix_MC/PhoenixContact_MC_1,5_3-GF-3.81_1x03_P3.81mm_Horizontal_ThreadedFlange","Connector_Phoenix_MC/PhoenixContact_MC_1,5_3-GF-3.81_1x03_P3.81mm_Horizontal_ThreadedFlange_MountHole","Connector_Phoenix_MC/PhoenixContact_MC_1,5_4-G-3.5_1x04_P3.50mm_Horizontal","Connector_Phoenix_MC/PhoenixContact_MC_1,5_4-G-3.81_1x04_P3.81mm_Horizontal","Connector_Phoenix_MC/PhoenixContact_MC_1,5_4-GF-3.5_1x04_P3.50mm_Horizontal_ThreadedFlange","Connector_Phoenix_MC/PhoenixContact_MC_1,5_4-GF-3.5_1x04_P3.50mm_Horizontal_ThreadedFlange_MountHole","Connector_Phoenix_MC/PhoenixContact_MC_1,5_4-GF-3.81_1x04_P3.81mm_Horizontal_ThreadedFlange","Connector_Phoenix_MC/PhoenixContact_MC_1,5_4-GF-3.81_1x04_P3.81mm_Horizontal_ThreadedFlange_MountHole","Connector_Phoenix_MC/PhoenixContact_MC_1,5_5-G-3.5_1x05_P3.50mm_Horizontal","Connector_Phoenix_MC/PhoenixContact_MC_1,5_5-G-3.81_1x05_P3.81mm_Horizontal","Connector_Phoenix_MC/PhoenixContact_MC_1,5_5-GF-3.5_1x05_P3.50mm_Horizontal_ThreadedFlange","Connector_Phoenix_MC/PhoenixContact_MC_1,5_5-GF-3.5_1x05_P3.50mm_Horizontal_ThreadedFlange_MountHole","Connector_Phoenix_MC/PhoenixContact_MC_1,5_5-GF-3.81_1x05_P3.81mm_Horizontal_ThreadedFlange","Connector_Phoenix_MC/PhoenixContact_MC_1,5_5-GF-3.81_1x05_P3.81mm_Horizontal_ThreadedFlange_MountHole","Connector_Phoenix_MC/PhoenixContact_MC_1,5_6-G-3.5_1x06_P3.50mm_Horizontal","Connector_Phoenix_MC/PhoenixContact_MC_1,5_6-G-3.81_1x06_P3.81mm_Horizontal","Connector_Phoenix_MC/PhoenixContact_MC_1,5_6-GF-3.5_1x06_P3.50mm_Horizontal_ThreadedFlange","Connector_Phoenix_MC/PhoenixContact_MC_1,5_6-GF-3.5_1x06_P3.50mm_Horizontal_ThreadedFlange_MountHole","Connector_Phoenix_MC/PhoenixContact_MC_1,5_6-GF-3.81_1x06_P3.81mm_Horizontal_ThreadedFlange","Connector_Phoenix_MC/PhoenixContact_MC_1,5_6-GF-3.81_1x06_P3.81mm_Horizontal_ThreadedFlange_MountHole","Connector_Phoenix_MC/PhoenixContact_MC_1,5_7-G-3.5_1x07_P3.50mm_Horizontal","Connector_Phoenix_MC/PhoenixContact_MC_1,5_7-G-3.81_1x07_P3.81mm_Horizontal","Connector_Phoenix_MC/PhoenixContact_MC_1,5_7-GF-3.5_1x07_P3.50mm_Horizontal_ThreadedFlange","Connector_Phoenix_MC/PhoenixContact_MC_1,5_7-GF-3.5_1x07_P3.50mm_Horizontal_ThreadedFlange_MountHole","Connector_Phoenix_MC/PhoenixContact_MC_1,5_7-GF-3.81_1x07_P3.81mm_Horizontal_ThreadedFlange","Connector_Phoenix_MC/PhoenixContact_MC_1,5_7-GF-3.81_1x07_P3.81mm_Horizontal_ThreadedFlange_MountHole","Connector_Phoenix_MC/PhoenixContact_MC_1,5_8-G-3.5_1x08_P3.50mm_Horizontal","Connector_Phoenix_MC/PhoenixContact_MC_1,5_8-G-3.81_1x08_P3.81mm_Horizontal","Connector_Phoenix_MC/PhoenixContact_MC_1,5_8-GF-3.5_1x08_P3.50mm_Horizontal_ThreadedFlange","Connector_Phoenix_MC/PhoenixContact_MC_1,5_8-GF-3.5_1x08_P3.50mm_Horizontal_ThreadedFlange_MountHole","Connector_Phoenix_MC/PhoenixContact_MC_1,5_8-GF-3.81_1x08_P3.81mm_Horizontal_ThreadedFlange","Connector_Phoenix_MC/PhoenixContact_MC_1,5_8-GF-3.81_1x08_P3.81mm_Horizontal_ThreadedFlange_MountHole","Connector_Phoenix_MC/PhoenixContact_MC_1,5_9-G-3.5_1x09_P3.50mm_Horizontal","Connector_Phoenix_MC/PhoenixContact_MC_1,5_9-G-3.81_1x09_P3.81mm_Horizontal","Connector_Phoenix_MC/PhoenixContact_MC_1,5_9-GF-3.5_1x09_P3.50mm_Horizontal_ThreadedFlange","Connector_Phoenix_MC/PhoenixContact_MC_1,5_9-GF-3.5_1x09_P3.50mm_Horizontal_ThreadedFlange_MountHole","Connector_Phoenix_MC/PhoenixContact_MC_1,5_9-GF-3.81_1x09_P3.81mm_Horizontal_ThreadedFlange","Connector_Phoenix_MC/PhoenixContact_MC_1,5_9-GF-3.81_1x09_P3.81mm_Horizontal_ThreadedFlange_MountHole","Connector_Phoenix_MC_HighVoltage/PhoenixContact_MCV_1,5_10-G-5.08_1x10_P5.08mm_Vertical","Connector_Phoenix_MC_HighVoltage/PhoenixContact_MCV_1,5_10-GF-5.08_1x10_P5.08mm_Vertical_ThreadedFlange","Connector_Phoenix_MC_HighVoltage/PhoenixContact_MCV_1,5_10-GF-5.08_1x10_P5.08mm_Vertical_ThreadedFlange_MountHole","Connector_Phoenix_MC_HighVoltage/PhoenixContact_MCV_1,5_11-G-5.08_1x11_P5.08mm_Vertical","Connector_Phoenix_MC_HighVoltage/PhoenixContact_MCV_1,5_11-GF-5.08_1x11_P5.08mm_Vertical_ThreadedFlange","Connector_Phoenix_MC_HighVoltage/PhoenixContact_MCV_1,5_11-GF-5.08_1x11_P5.08mm_Vertical_ThreadedFlange_MountHole","Connector_Phoenix_MC_HighVoltage/PhoenixContact_MCV_1,5_12-G-5.08_1x12_P5.08mm_Vertical","Connector_Phoenix_MC_HighVoltage/PhoenixContact_MCV_1,5_12-GF-5.08_1x12_P5.08mm_Vertical_ThreadedFlange","Connector_Phoenix_MC_HighVoltage/PhoenixContact_MCV_1,5_12-GF-5.08_1x12_P5.08mm_Vertical_ThreadedFlange_MountHole","Connector_Phoenix_MC_HighVoltage/PhoenixContact_MCV_1,5_2-G-5.08_1x02_P5.08mm_Vertical","Connector_Phoenix_MC_HighVoltage/PhoenixContact_MCV_1,5_2-GF-5.08_1x02_P5.08mm_Vertical_ThreadedFlange","Connector_Phoenix_MC_HighVoltage/PhoenixContact_MCV_1,5_2-GF-5.08_1x02_P5.08mm_Vertical_ThreadedFlange_MountHole","Connector_Phoenix_MC_HighVoltage/PhoenixContact_MCV_1,5_3-G-5.08_1x03_P5.08mm_Vertical","Connector_Phoenix_MC_HighVoltage/PhoenixContact_MCV_1,5_3-GF-5.08_1x03_P5.08mm_Vertical_ThreadedFlange","Connector_Phoenix_MC_HighVoltage/PhoenixContact_MCV_1,5_3-GF-5.08_1x03_P5.08mm_Vertical_ThreadedFlange_MountHole","Connector_Phoenix_MC_HighVoltage/PhoenixContact_MCV_1,5_4-G-5.08_1x04_P5.08mm_Vertical","Connector_Phoenix_MC_HighVoltage/PhoenixContact_MCV_1,5_4-GF-5.08_1x04_P5.08mm_Vertical_ThreadedFlange","Connector_Phoenix_MC_HighVoltage/PhoenixContact_MCV_1,5_4-GF-5.08_1x04_P5.08mm_Vertical_ThreadedFlange_MountHole","Connector_Phoenix_MC_HighVoltage/PhoenixContact_MCV_1,5_5-G-5.08_1x05_P5.08mm_Vertical","Connector_Phoenix_MC_HighVoltage/PhoenixContact_MCV_1,5_5-GF-5.08_1x05_P5.08mm_Vertical_ThreadedFlange","Connector_Phoenix_MC_HighVoltage/PhoenixContact_MCV_1,5_5-GF-5.08_1x05_P5.08mm_Vertical_ThreadedFlange_MountHole","Connector_Phoenix_MC_HighVoltage/PhoenixContact_MCV_1,5_6-G-5.08_1x06_P5.08mm_Vertical","Connector_Phoenix_MC_HighVoltage/PhoenixContact_MCV_1,5_6-GF-5.08_1x06_P5.08mm_Vertical_ThreadedFlange","Connector_Phoenix_MC_HighVoltage/PhoenixContact_MCV_1,5_6-GF-5.08_1x06_P5.08mm_Vertical_ThreadedFlange_MountHole","Connector_Phoenix_MC_HighVoltage/PhoenixContact_MCV_1,5_7-G-5.08_1x07_P5.08mm_Vertical","Connector_Phoenix_MC_HighVoltage/PhoenixContact_MCV_1,5_7-GF-5.08_1x07_P5.08mm_Vertical_ThreadedFlange","Connector_Phoenix_MC_HighVoltage/PhoenixContact_MCV_1,5_7-GF-5.08_1x07_P5.08mm_Vertical_ThreadedFlange_MountHole","Connector_Phoenix_MC_HighVoltage/PhoenixContact_MCV_1,5_8-G-5.08_1x08_P5.08mm_Vertical","Connector_Phoenix_MC_HighVoltage/PhoenixContact_MCV_1,5_8-GF-5.08_1x08_P5.08mm_Vertical_ThreadedFlange","Connector_Phoenix_MC_HighVoltage/PhoenixContact_MCV_1,5_8-GF-5.08_1x08_P5.08mm_Vertical_ThreadedFlange_MountHole","Connector_Phoenix_MC_HighVoltage/PhoenixContact_MCV_1,5_9-G-5.08_1x09_P5.08mm_Vertical","Connector_Phoenix_MC_HighVoltage/PhoenixContact_MCV_1,5_9-GF-5.08_1x09_P5.08mm_Vertical_ThreadedFlange","Connector_Phoenix_MC_HighVoltage/PhoenixContact_MCV_1,5_9-GF-5.08_1x09_P5.08mm_Vertical_ThreadedFlange_MountHole","Connector_Phoenix_MC_HighVoltage/PhoenixContact_MC_1,5_10-G-5.08_1x10_P5.08mm_Horizontal","Connector_Phoenix_MC_HighVoltage/PhoenixContact_MC_1,5_10-GF-5.08_1x10_P5.08mm_Horizontal_ThreadedFlange","Connector_Phoenix_MC_HighVoltage/PhoenixContact_MC_1,5_10-GF-5.08_1x10_P5.08mm_Horizontal_ThreadedFlange_MountHole","Connector_Phoenix_MC_HighVoltage/PhoenixContact_MC_1,5_11-G-5.08_1x11_P5.08mm_Horizontal","Connector_Phoenix_MC_HighVoltage/PhoenixContact_MC_1,5_11-GF-5.08_1x11_P5.08mm_Horizontal_ThreadedFlange","Connector_Phoenix_MC_HighVoltage/PhoenixContact_MC_1,5_11-GF-5.08_1x11_P5.08mm_Horizontal_ThreadedFlange_MountHole","Connector_Phoenix_MC_HighVoltage/PhoenixContact_MC_1,5_12-G-5.08_1x12_P5.08mm_Horizontal","Connector_Phoenix_MC_HighVoltage/PhoenixContact_MC_1,5_12-GF-5.08_1x12_P5.08mm_Horizontal_ThreadedFlange","Connector_Phoenix_MC_HighVoltage/PhoenixContact_MC_1,5_12-GF-5.08_1x12_P5.08mm_Horizontal_ThreadedFlange_MountHole","Connector_Phoenix_MC_HighVoltage/PhoenixContact_MC_1,5_2-G-5.08_1x02_P5.08mm_Horizontal","Connector_Phoenix_MC_HighVoltage/PhoenixContact_MC_1,5_2-GF-5.08_1x02_P5.08mm_Horizontal_ThreadedFlange","Connector_Phoenix_MC_HighVoltage/PhoenixContact_MC_1,5_2-GF-5.08_1x02_P5.08mm_Horizontal_ThreadedFlange_MountHole","Connector_Phoenix_MC_HighVoltage/PhoenixContact_MC_1,5_3-G-5.08_1x03_P5.08mm_Horizontal","Connector_Phoenix_MC_HighVoltage/PhoenixContact_MC_1,5_3-GF-5.08_1x03_P5.08mm_Horizontal_ThreadedFlange","Connector_Phoenix_MC_HighVoltage/PhoenixContact_MC_1,5_3-GF-5.08_1x03_P5.08mm_Horizontal_ThreadedFlange_MountHole","Connector_Phoenix_MC_HighVoltage/PhoenixContact_MC_1,5_4-G-5.08_1x04_P5.08mm_Horizontal","Connector_Phoenix_MC_HighVoltage/PhoenixContact_MC_1,5_4-GF-5.08_1x04_P5.08mm_Horizontal_ThreadedFlange","Connector_Phoenix_MC_HighVoltage/PhoenixContact_MC_1,5_4-GF-5.08_1x04_P5.08mm_Horizontal_ThreadedFlange_MountHole","Connector_Phoenix_MC_HighVoltage/PhoenixContact_MC_1,5_5-G-5.08_1x05_P5.08mm_Horizontal","Connector_Phoenix_MC_HighVoltage/PhoenixContact_MC_1,5_5-GF-5.08_1x05_P5.08mm_Horizontal_ThreadedFlange","Connector_Phoenix_MC_HighVoltage/PhoenixContact_MC_1,5_5-GF-5.08_1x05_P5.08mm_Horizontal_ThreadedFlange_MountHole","Connector_Phoenix_MC_HighVoltage/PhoenixContact_MC_1,5_6-G-5.08_1x06_P5.08mm_Horizontal","Connector_Phoenix_MC_HighVoltage/PhoenixContact_MC_1,5_6-GF-5.08_1x06_P5.08mm_Horizontal_ThreadedFlange","Connector_Phoenix_MC_HighVoltage/PhoenixContact_MC_1,5_6-GF-5.08_1x06_P5.08mm_Horizontal_ThreadedFlange_MountHole","Connector_Phoenix_MC_HighVoltage/PhoenixContact_MC_1,5_7-G-5.08_1x07_P5.08mm_Horizontal","Connector_Phoenix_MC_HighVoltage/PhoenixContact_MC_1,5_7-GF-5.08_1x07_P5.08mm_Horizontal_ThreadedFlange","Connector_Phoenix_MC_HighVoltage/PhoenixContact_MC_1,5_7-GF-5.08_1x07_P5.08mm_Horizontal_ThreadedFlange_MountHole","Connector_Phoenix_MC_HighVoltage/PhoenixContact_MC_1,5_8-G-5.08_1x08_P5.08mm_Horizontal","Connector_Phoenix_MC_HighVoltage/PhoenixContact_MC_1,5_8-GF-5.08_1x08_P5.08mm_Horizontal_ThreadedFlange","Connector_Phoenix_MC_HighVoltage/PhoenixContact_MC_1,5_8-GF-5.08_1x08_P5.08mm_Horizontal_ThreadedFlange_MountHole","Connector_Phoenix_MC_HighVoltage/PhoenixContact_MC_1,5_9-G-5.08_1x09_P5.08mm_Horizontal","Connector_Phoenix_MC_HighVoltage/PhoenixContact_MC_1,5_9-GF-5.08_1x09_P5.08mm_Horizontal_ThreadedFlange","Connector_Phoenix_MC_HighVoltage/PhoenixContact_MC_1,5_9-GF-5.08_1x09_P5.08mm_Horizontal_ThreadedFlange_MountHole","Connector_Phoenix_MSTB/PhoenixContact_MSTBA_2,5_10-G-5,08_1x10_P5.08mm_Horizontal","Connector_Phoenix_MSTB/PhoenixContact_MSTBA_2,5_10-G_1x10_P5.00mm_Horizontal","Connector_Phoenix_MSTB/PhoenixContact_MSTBA_2,5_11-G-5,08_1x11_P5.08mm_Horizontal","Connector_Phoenix_MSTB/PhoenixContact_MSTBA_2,5_11-G_1x11_P5.00mm_Horizontal","Connector_Phoenix_MSTB/PhoenixContact_MSTBA_2,5_12-G-5,08_1x12_P5.08mm_Horizontal","Connector_Phoenix_MSTB/PhoenixContact_MSTBA_2,5_12-G_1x12_P5.00mm_Horizontal","Connector_Phoenix_MSTB/PhoenixContact_MSTBA_2,5_13-G-5,08_1x13_P5.08mm_Horizontal","Connector_Phoenix_MSTB/PhoenixContact_MSTBA_2,5_13-G_1x13_P5.00mm_Horizontal","Connector_Phoenix_MSTB/PhoenixContact_MSTBA_2,5_14-G-5,08_1x14_P5.08mm_Horizontal","Connector_Phoenix_MSTB/PhoenixContact_MSTBA_2,5_14-G_1x14_P5.00mm_Horizontal","Connector_Phoenix_MSTB/PhoenixContact_MSTBA_2,5_15-G-5,08_1x15_P5.08mm_Horizontal","Connector_Phoenix_MSTB/PhoenixContact_MSTBA_2,5_15-G_1x15_P5.00mm_Horizontal","Connector_Phoenix_MSTB/PhoenixContact_MSTBA_2,5_16-G-5,08_1x16_P5.08mm_Horizontal","Connector_Phoenix_MSTB/PhoenixContact_MSTBA_2,5_16-G_1x16_P5.00mm_Horizontal","Connector_Phoenix_MSTB/PhoenixContact_MSTBA_2,5_2-G-5,08_1x02_P5.08mm_Horizontal","Connector_Phoenix_MSTB/PhoenixContact_MSTBA_2,5_2-G_1x02_P5.00mm_Horizontal","Connector_Phoenix_MSTB/PhoenixContact_MSTBA_2,5_3-G-5,08_1x03_P5.08mm_Horizontal","Connector_Phoenix_MSTB/PhoenixContact_MSTBA_2,5_3-G_1x03_P5.00mm_Horizontal","Connector_Phoenix_MSTB/PhoenixContact_MSTBA_2,5_4-G-5,08_1x04_P5.08mm_Horizontal","Connector_Phoenix_MSTB/PhoenixContact_MSTBA_2,5_4-G_1x04_P5.00mm_Horizontal","Connector_Phoenix_MSTB/PhoenixContact_MSTBA_2,5_5-G-5,08_1x05_P5.08mm_Horizontal","Connector_Phoenix_MSTB/PhoenixContact_MSTBA_2,5_5-G_1x05_P5.00mm_Horizontal","Connector_Phoenix_MSTB/PhoenixContact_MSTBA_2,5_6-G-5,08_1x06_P5.08mm_Horizontal","Connector_Phoenix_MSTB/PhoenixContact_MSTBA_2,5_6-G_1x06_P5.00mm_Horizontal","Connector_Phoenix_MSTB/PhoenixContact_MSTBA_2,5_7-G-5,08_1x07_P5.08mm_Horizontal","Connector_Phoenix_MSTB/PhoenixContact_MSTBA_2,5_7-G_1x07_P5.00mm_Horizontal","Connector_Phoenix_MSTB/PhoenixContact_MSTBA_2,5_8-G-5,08_1x08_P5.08mm_Horizontal","Connector_Phoenix_MSTB/PhoenixContact_MSTBA_2,5_8-G_1x08_P5.00mm_Horizontal","Connector_Phoenix_MSTB/PhoenixContact_MSTBA_2,5_9-G-5,08_1x09_P5.08mm_Horizontal","Connector_Phoenix_MSTB/PhoenixContact_MSTBA_2,5_9-G_1x09_P5.00mm_Horizontal","Connector_Phoenix_MSTB/PhoenixContact_MSTBVA_2,5_10-G-5,08_1x10_P5.08mm_Vertical","Connector_Phoenix_MSTB/PhoenixContact_MSTBVA_2,5_10-G_1x10_P5.00mm_Vertical","Connector_Phoenix_MSTB/PhoenixContact_MSTBVA_2,5_11-G-5,08_1x11_P5.08mm_Vertical","Connector_Phoenix_MSTB/PhoenixContact_MSTBVA_2,5_11-G_1x11_P5.00mm_Vertical","Connector_Phoenix_MSTB/PhoenixContact_MSTBVA_2,5_12-G-5,08_1x12_P5.08mm_Vertical","Connector_Phoenix_MSTB/PhoenixContact_MSTBVA_2,5_12-G_1x12_P5.00mm_Vertical","Connector_Phoenix_MSTB/PhoenixContact_MSTBVA_2,5_13-G-5,08_1x13_P5.08mm_Vertical","Connector_Phoenix_MSTB/PhoenixContact_MSTBVA_2,5_13-G_1x13_P5.00mm_Vertical","Connector_Phoenix_MSTB/PhoenixContact_MSTBVA_2,5_14-G-5,08_1x14_P5.08mm_Vertical","Connector_Phoenix_MSTB/PhoenixContact_MSTBVA_2,5_14-G_1x14_P5.00mm_Vertical","Connector_Phoenix_MSTB/PhoenixContact_MSTBVA_2,5_15-G-5,08_1x15_P5.08mm_Vertical","Connector_Phoenix_MSTB/PhoenixContact_MSTBVA_2,5_15-G_1x15_P5.00mm_Vertical","Connector_Phoenix_MSTB/PhoenixContact_MSTBVA_2,5_16-G-5,08_1x16_P5.08mm_Vertical","Connector_Phoenix_MSTB/PhoenixContact_MSTBVA_2,5_16-G_1x16_P5.00mm_Vertical","Connector_Phoenix_MSTB/PhoenixContact_MSTBVA_2,5_2-G-5,08_1x02_P5.08mm_Vertical","Connector_Phoenix_MSTB/PhoenixContact_MSTBVA_2,5_2-G_1x02_P5.00mm_Vertical","Connector_Phoenix_MSTB/PhoenixContact_MSTBVA_2,5_3-G-5,08_1x03_P5.08mm_Vertical","Connector_Phoenix_MSTB/PhoenixContact_MSTBVA_2,5_3-G_1x03_P5.00mm_Vertical","Connector_Phoenix_MSTB/PhoenixContact_MSTBVA_2,5_4-G-5,08_1x04_P5.08mm_Vertical","Connector_Phoenix_MSTB/PhoenixContact_MSTBVA_2,5_4-G_1x04_P5.00mm_Vertical","Connector_Phoenix_MSTB/PhoenixContact_MSTBVA_2,5_5-G-5,08_1x05_P5.08mm_Vertical","Connector_Phoenix_MSTB/PhoenixContact_MSTBVA_2,5_5-G_1x05_P5.00mm_Vertical","Connector_Phoenix_MSTB/PhoenixContact_MSTBVA_2,5_6-G-5,08_1x06_P5.08mm_Vertical","Connector_Phoenix_MSTB/PhoenixContact_MSTBVA_2,5_6-G_1x06_P5.00mm_Vertical","Connector_Phoenix_MSTB/PhoenixContact_MSTBVA_2,5_7-G-5,08_1x07_P5.08mm_Vertical","Connector_Phoenix_MSTB/PhoenixContact_MSTBVA_2,5_7-G_1x07_P5.00mm_Vertical","Connector_Phoenix_MSTB/PhoenixContact_MSTBVA_2,5_8-G-5,08_1x08_P5.08mm_Vertical","Connector_Phoenix_MSTB/PhoenixContact_MSTBVA_2,5_8-G_1x08_P5.00mm_Vertical","Connector_Phoenix_MSTB/PhoenixContact_MSTBVA_2,5_9-G-5,08_1x09_P5.08mm_Vertical","Connector_Phoenix_MSTB/PhoenixContact_MSTBVA_2,5_9-G_1x09_P5.00mm_Vertical","Connector_Phoenix_MSTB/PhoenixContact_MSTBV_2,5_10-GF-5,08_1x10_P5.08mm_Vertical_ThreadedFlange","Connector_Phoenix_MSTB/PhoenixContact_MSTBV_2,5_10-GF-5,08_1x10_P5.08mm_Vertical_ThreadedFlange_MountHole","Connector_Phoenix_MSTB/PhoenixContact_MSTBV_2,5_10-GF_1x10_P5.00mm_Vertical_ThreadedFlange","Connector_Phoenix_MSTB/PhoenixContact_MSTBV_2,5_10-GF_1x10_P5.00mm_Vertical_ThreadedFlange_MountHole","Connector_Phoenix_MSTB/PhoenixContact_MSTBV_2,5_11-GF-5,08_1x11_P5.08mm_Vertical_ThreadedFlange","Connector_Phoenix_MSTB/PhoenixContact_MSTBV_2,5_11-GF-5,08_1x11_P5.08mm_Vertical_ThreadedFlange_MountHole","Connector_Phoenix_MSTB/PhoenixContact_MSTBV_2,5_11-GF_1x11_P5.00mm_Vertical_ThreadedFlange","Connector_Phoenix_MSTB/PhoenixContact_MSTBV_2,5_11-GF_1x11_P5.00mm_Vertical_ThreadedFlange_MountHole","Connector_Phoenix_MSTB/PhoenixContact_MSTBV_2,5_12-GF-5,08_1x12_P5.08mm_Vertical_ThreadedFlange","Connector_Phoenix_MSTB/PhoenixContact_MSTBV_2,5_12-GF-5,08_1x12_P5.08mm_Vertical_ThreadedFlange_MountHole","Connector_Phoenix_MSTB/PhoenixContact_MSTBV_2,5_12-GF_1x12_P5.00mm_Vertical_ThreadedFlange","Connector_Phoenix_MSTB/PhoenixContact_MSTBV_2,5_12-GF_1x12_P5.00mm_Vertical_ThreadedFlange_MountHole","Connector_Phoenix_MSTB/PhoenixContact_MSTBV_2,5_13-GF-5,08_1x13_P5.08mm_Vertical_ThreadedFlange","Connector_Phoenix_MSTB/PhoenixContact_MSTBV_2,5_13-GF-5,08_1x13_P5.08mm_Vertical_ThreadedFlange_MountHole","Connector_Phoenix_MSTB/PhoenixContact_MSTBV_2,5_13-GF_1x13_P5.00mm_Vertical_ThreadedFlange","Connector_Phoenix_MSTB/PhoenixContact_MSTBV_2,5_13-GF_1x13_P5.00mm_Vertical_ThreadedFlange_MountHole","Connector_Phoenix_MSTB/PhoenixContact_MSTBV_2,5_14-GF-5,08_1x14_P5.08mm_Vertical_ThreadedFlange","Connector_Phoenix_MSTB/PhoenixContact_MSTBV_2,5_14-GF-5,08_1x14_P5.08mm_Vertical_ThreadedFlange_MountHole","Connector_Phoenix_MSTB/PhoenixContact_MSTBV_2,5_14-GF_1x14_P5.00mm_Vertical_ThreadedFlange","Connector_Phoenix_MSTB/PhoenixContact_MSTBV_2,5_14-GF_1x14_P5.00mm_Vertical_ThreadedFlange_MountHole","Connector_Phoenix_MSTB/PhoenixContact_MSTBV_2,5_15-GF-5,08_1x15_P5.08mm_Vertical_ThreadedFlange","Connector_Phoenix_MSTB/PhoenixContact_MSTBV_2,5_15-GF-5,08_1x15_P5.08mm_Vertical_ThreadedFlange_MountHole","Connector_Phoenix_MSTB/PhoenixContact_MSTBV_2,5_15-GF_1x15_P5.00mm_Vertical_ThreadedFlange","Connector_Phoenix_MSTB/PhoenixContact_MSTBV_2,5_15-GF_1x15_P5.00mm_Vertical_ThreadedFlange_MountHole","Connector_Phoenix_MSTB/PhoenixContact_MSTBV_2,5_16-GF-5,08_1x16_P5.08mm_Vertical_ThreadedFlange","Connector_Phoenix_MSTB/PhoenixContact_MSTBV_2,5_16-GF-5,08_1x16_P5.08mm_Vertical_ThreadedFlange_MountHole","Connector_Phoenix_MSTB/PhoenixContact_MSTBV_2,5_16-GF_1x16_P5.00mm_Vertical_ThreadedFlange","Connector_Phoenix_MSTB/PhoenixContact_MSTBV_2,5_16-GF_1x16_P5.00mm_Vertical_ThreadedFlange_MountHole","Connector_Phoenix_MSTB/PhoenixContact_MSTBV_2,5_2-GF-5,08_1x02_P5.08mm_Vertical_ThreadedFlange","Connector_Phoenix_MSTB/PhoenixContact_MSTBV_2,5_2-GF-5,08_1x02_P5.08mm_Vertical_ThreadedFlange_MountHole","Connector_Phoenix_MSTB/PhoenixContact_MSTBV_2,5_2-GF_1x02_P5.00mm_Vertical_ThreadedFlange","Connector_Phoenix_MSTB/PhoenixContact_MSTBV_2,5_2-GF_1x02_P5.00mm_Vertical_ThreadedFlange_MountHole","Connector_Phoenix_MSTB/PhoenixContact_MSTBV_2,5_3-GF-5,08_1x03_P5.08mm_Vertical_ThreadedFlange","Connector_Phoenix_MSTB/PhoenixContact_MSTBV_2,5_3-GF-5,08_1x03_P5.08mm_Vertical_ThreadedFlange_MountHole","Connector_Phoenix_MSTB/PhoenixContact_MSTBV_2,5_3-GF_1x03_P5.00mm_Vertical_ThreadedFlange","Connector_Phoenix_MSTB/PhoenixContact_MSTBV_2,5_3-GF_1x03_P5.00mm_Vertical_ThreadedFlange_MountHole","Connector_Phoenix_MSTB/PhoenixContact_MSTBV_2,5_4-GF-5,08_1x04_P5.08mm_Vertical_ThreadedFlange","Connector_Phoenix_MSTB/PhoenixContact_MSTBV_2,5_4-GF-5,08_1x04_P5.08mm_Vertical_ThreadedFlange_MountHole","Connector_Phoenix_MSTB/PhoenixContact_MSTBV_2,5_4-GF_1x04_P5.00mm_Vertical_ThreadedFlange","Connector_Phoenix_MSTB/PhoenixContact_MSTBV_2,5_4-GF_1x04_P5.00mm_Vertical_ThreadedFlange_MountHole","Connector_Phoenix_MSTB/PhoenixContact_MSTBV_2,5_5-GF-5,08_1x05_P5.08mm_Vertical_ThreadedFlange","Connector_Phoenix_MSTB/PhoenixContact_MSTBV_2,5_5-GF-5,08_1x05_P5.08mm_Vertical_ThreadedFlange_MountHole","Connector_Phoenix_MSTB/PhoenixContact_MSTBV_2,5_5-GF_1x05_P5.00mm_Vertical_ThreadedFlange","Connector_Phoenix_MSTB/PhoenixContact_MSTBV_2,5_5-GF_1x05_P5.00mm_Vertical_ThreadedFlange_MountHole","Connector_Phoenix_MSTB/PhoenixContact_MSTBV_2,5_6-GF-5,08_1x06_P5.08mm_Vertical_ThreadedFlange","Connector_Phoenix_MSTB/PhoenixContact_MSTBV_2,5_6-GF-5,08_1x06_P5.08mm_Vertical_ThreadedFlange_MountHole","Connector_Phoenix_MSTB/PhoenixContact_MSTBV_2,5_6-GF_1x06_P5.00mm_Vertical_ThreadedFlange","Connector_Phoenix_MSTB/PhoenixContact_MSTBV_2,5_6-GF_1x06_P5.00mm_Vertical_ThreadedFlange_MountHole","Connector_Phoenix_MSTB/PhoenixContact_MSTBV_2,5_7-GF-5,08_1x07_P5.08mm_Vertical_ThreadedFlange","Connector_Phoenix_MSTB/PhoenixContact_MSTBV_2,5_7-GF-5,08_1x07_P5.08mm_Vertical_ThreadedFlange_MountHole","Connector_Phoenix_MSTB/PhoenixContact_MSTBV_2,5_7-GF_1x07_P5.00mm_Vertical_ThreadedFlange","Connector_Phoenix_MSTB/PhoenixContact_MSTBV_2,5_7-GF_1x07_P5.00mm_Vertical_ThreadedFlange_MountHole","Connector_Phoenix_MSTB/PhoenixContact_MSTBV_2,5_8-GF-5,08_1x08_P5.08mm_Vertical_ThreadedFlange","Connector_Phoenix_MSTB/PhoenixContact_MSTBV_2,5_8-GF-5,08_1x08_P5.08mm_Vertical_ThreadedFlange_MountHole","Connector_Phoenix_MSTB/PhoenixContact_MSTBV_2,5_8-GF_1x08_P5.00mm_Vertical_ThreadedFlange","Connector_Phoenix_MSTB/PhoenixContact_MSTBV_2,5_8-GF_1x08_P5.00mm_Vertical_ThreadedFlange_MountHole","Connector_Phoenix_MSTB/PhoenixContact_MSTBV_2,5_9-GF-5,08_1x09_P5.08mm_Vertical_ThreadedFlange","Connector_Phoenix_MSTB/PhoenixContact_MSTBV_2,5_9-GF-5,08_1x09_P5.08mm_Vertical_ThreadedFlange_MountHole","Connector_Phoenix_MSTB/PhoenixContact_MSTBV_2,5_9-GF_1x09_P5.00mm_Vertical_ThreadedFlange","Connector_Phoenix_MSTB/PhoenixContact_MSTBV_2,5_9-GF_1x09_P5.00mm_Vertical_ThreadedFlange_MountHole","Connector_Phoenix_MSTB/PhoenixContact_MSTB_2,5_10-GF-5,08_1x10_P5.08mm_Horizontal_ThreadedFlange","Connector_Phoenix_MSTB/PhoenixContact_MSTB_2,5_10-GF-5,08_1x10_P5.08mm_Horizontal_ThreadedFlange_MountHole","Connector_Phoenix_MSTB/PhoenixContact_MSTB_2,5_10-GF_1x10_P5.00mm_Horizontal_ThreadedFlange","Connector_Phoenix_MSTB/PhoenixContact_MSTB_2,5_10-GF_1x10_P5.00mm_Horizontal_ThreadedFlange_MountHole","Connector_Phoenix_MSTB/PhoenixContact_MSTB_2,5_11-GF-5,08_1x11_P5.08mm_Horizontal_ThreadedFlange","Connector_Phoenix_MSTB/PhoenixContact_MSTB_2,5_11-GF-5,08_1x11_P5.08mm_Horizontal_ThreadedFlange_MountHole","Connector_Phoenix_MSTB/PhoenixContact_MSTB_2,5_11-GF_1x11_P5.00mm_Horizontal_ThreadedFlange","Connector_Phoenix_MSTB/PhoenixContact_MSTB_2,5_11-GF_1x11_P5.00mm_Horizontal_ThreadedFlange_MountHole","Connector_Phoenix_MSTB/PhoenixContact_MSTB_2,5_12-GF-5,08_1x12_P5.08mm_Horizontal_ThreadedFlange","Connector_Phoenix_MSTB/PhoenixContact_MSTB_2,5_12-GF-5,08_1x12_P5.08mm_Horizontal_ThreadedFlange_MountHole","Connector_Phoenix_MSTB/PhoenixContact_MSTB_2,5_12-GF_1x12_P5.00mm_Horizontal_ThreadedFlange","Connector_Phoenix_MSTB/PhoenixContact_MSTB_2,5_12-GF_1x12_P5.00mm_Horizontal_ThreadedFlange_MountHole","Connector_Phoenix_MSTB/PhoenixContact_MSTB_2,5_13-GF-5,08_1x13_P5.08mm_Horizontal_ThreadedFlange","Connector_Phoenix_MSTB/PhoenixContact_MSTB_2,5_13-GF-5,08_1x13_P5.08mm_Horizontal_ThreadedFlange_MountHole","Connector_Phoenix_MSTB/PhoenixContact_MSTB_2,5_13-GF_1x13_P5.00mm_Horizontal_ThreadedFlange","Connector_Phoenix_MSTB/PhoenixContact_MSTB_2,5_13-GF_1x13_P5.00mm_Horizontal_ThreadedFlange_MountHole","Connector_Phoenix_MSTB/PhoenixContact_MSTB_2,5_14-GF-5,08_1x14_P5.08mm_Horizontal_ThreadedFlange","Connector_Phoenix_MSTB/PhoenixContact_MSTB_2,5_14-GF-5,08_1x14_P5.08mm_Horizontal_ThreadedFlange_MountHole","Connector_Phoenix_MSTB/PhoenixContact_MSTB_2,5_14-GF_1x14_P5.00mm_Horizontal_ThreadedFlange","Connector_Phoenix_MSTB/PhoenixContact_MSTB_2,5_14-GF_1x14_P5.00mm_Horizontal_ThreadedFlange_MountHole","Connector_Phoenix_MSTB/PhoenixContact_MSTB_2,5_15-GF-5,08_1x15_P5.08mm_Horizontal_ThreadedFlange","Connector_Phoenix_MSTB/PhoenixContact_MSTB_2,5_15-GF-5,08_1x15_P5.08mm_Horizontal_ThreadedFlange_MountHole","Connector_Phoenix_MSTB/PhoenixContact_MSTB_2,5_15-GF_1x15_P5.00mm_Horizontal_ThreadedFlange","Connector_Phoenix_MSTB/PhoenixContact_MSTB_2,5_15-GF_1x15_P5.00mm_Horizontal_ThreadedFlange_MountHole","Connector_Phoenix_MSTB/PhoenixContact_MSTB_2,5_16-GF-5,08_1x16_P5.08mm_Horizontal_ThreadedFlange","Connector_Phoenix_MSTB/PhoenixContact_MSTB_2,5_16-GF-5,08_1x16_P5.08mm_Horizontal_ThreadedFlange_MountHole","Connector_Phoenix_MSTB/PhoenixContact_MSTB_2,5_16-GF_1x16_P5.00mm_Horizontal_ThreadedFlange","Connector_Phoenix_MSTB/PhoenixContact_MSTB_2,5_16-GF_1x16_P5.00mm_Horizontal_ThreadedFlange_MountHole","Connector_Phoenix_MSTB/PhoenixContact_MSTB_2,5_2-GF-5,08_1x02_P5.08mm_Horizontal_ThreadedFlange","Connector_Phoenix_MSTB/PhoenixContact_MSTB_2,5_2-GF-5,08_1x02_P5.08mm_Horizontal_ThreadedFlange_MountHole","Connector_Phoenix_MSTB/PhoenixContact_MSTB_2,5_2-GF_1x02_P5.00mm_Horizontal_ThreadedFlange","Connector_Phoenix_MSTB/PhoenixContact_MSTB_2,5_2-GF_1x02_P5.00mm_Horizontal_ThreadedFlange_MountHole","Connector_Phoenix_MSTB/PhoenixContact_MSTB_2,5_3-GF-5,08_1x03_P5.08mm_Horizontal_ThreadedFlange","Connector_Phoenix_MSTB/PhoenixContact_MSTB_2,5_3-GF-5,08_1x03_P5.08mm_Horizontal_ThreadedFlange_MountHole","Connector_Phoenix_MSTB/PhoenixContact_MSTB_2,5_3-GF_1x03_P5.00mm_Horizontal_ThreadedFlange","Connector_Phoenix_MSTB/PhoenixContact_MSTB_2,5_3-GF_1x03_P5.00mm_Horizontal_ThreadedFlange_MountHole","Connector_Phoenix_MSTB/PhoenixContact_MSTB_2,5_4-GF-5,08_1x04_P5.08mm_Horizontal_ThreadedFlange","Connector_Phoenix_MSTB/PhoenixContact_MSTB_2,5_4-GF-5,08_1x04_P5.08mm_Horizontal_ThreadedFlange_MountHole","Connector_Phoenix_MSTB/PhoenixContact_MSTB_2,5_4-GF_1x04_P5.00mm_Horizontal_ThreadedFlange","Connector_Phoenix_MSTB/PhoenixContact_MSTB_2,5_4-GF_1x04_P5.00mm_Horizontal_ThreadedFlange_MountHole","Connector_Phoenix_MSTB/PhoenixContact_MSTB_2,5_5-GF-5,08_1x05_P5.08mm_Horizontal_ThreadedFlange","Connector_Phoenix_MSTB/PhoenixContact_MSTB_2,5_5-GF-5,08_1x05_P5.08mm_Horizontal_ThreadedFlange_MountHole","Connector_Phoenix_MSTB/PhoenixContact_MSTB_2,5_5-GF_1x05_P5.00mm_Horizontal_ThreadedFlange","Connector_Phoenix_MSTB/PhoenixContact_MSTB_2,5_5-GF_1x05_P5.00mm_Horizontal_ThreadedFlange_MountHole","Connector_Phoenix_MSTB/PhoenixContact_MSTB_2,5_6-GF-5,08_1x06_P5.08mm_Horizontal_ThreadedFlange","Connector_Phoenix_MSTB/PhoenixContact_MSTB_2,5_6-GF-5,08_1x06_P5.08mm_Horizontal_ThreadedFlange_MountHole","Connector_Phoenix_MSTB/PhoenixContact_MSTB_2,5_6-GF_1x06_P5.00mm_Horizontal_ThreadedFlange","Connector_Phoenix_MSTB/PhoenixContact_MSTB_2,5_6-GF_1x06_P5.00mm_Horizontal_ThreadedFlange_MountHole","Connector_Phoenix_MSTB/PhoenixContact_MSTB_2,5_7-GF-5,08_1x07_P5.08mm_Horizontal_ThreadedFlange","Connector_Phoenix_MSTB/PhoenixContact_MSTB_2,5_7-GF-5,08_1x07_P5.08mm_Horizontal_ThreadedFlange_MountHole","Connector_Phoenix_MSTB/PhoenixContact_MSTB_2,5_7-GF_1x07_P5.00mm_Horizontal_ThreadedFlange","Connector_Phoenix_MSTB/PhoenixContact_MSTB_2,5_7-GF_1x07_P5.00mm_Horizontal_ThreadedFlange_MountHole","Connector_Phoenix_MSTB/PhoenixContact_MSTB_2,5_8-GF-5,08_1x08_P5.08mm_Horizontal_ThreadedFlange","Connector_Phoenix_MSTB/PhoenixContact_MSTB_2,5_8-GF-5,08_1x08_P5.08mm_Horizontal_ThreadedFlange_MountHole","Connector_Phoenix_MSTB/PhoenixContact_MSTB_2,5_8-GF_1x08_P5.00mm_Horizontal_ThreadedFlange","Connector_Phoenix_MSTB/PhoenixContact_MSTB_2,5_8-GF_1x08_P5.00mm_Horizontal_ThreadedFlange_MountHole","Connector_Phoenix_MSTB/PhoenixContact_MSTB_2,5_9-GF-5,08_1x09_P5.08mm_Horizontal_ThreadedFlange","Connector_Phoenix_MSTB/PhoenixContact_MSTB_2,5_9-GF-5,08_1x09_P5.08mm_Horizontal_ThreadedFlange_MountHole","Connector_Phoenix_MSTB/PhoenixContact_MSTB_2,5_9-GF_1x09_P5.00mm_Horizontal_ThreadedFlange","Connector_Phoenix_MSTB/PhoenixContact_MSTB_2,5_9-GF_1x09_P5.00mm_Horizontal_ThreadedFlange_MountHole","Connector_Phoenix_SPT/PhoenixContact_SPT_1.5_10-H-3.5_1x10_P3.5mm_Horizontal","Connector_Phoenix_SPT/PhoenixContact_SPT_1.5_11-H-3.5_1x11_P3.5mm_Horizontal","Connector_Phoenix_SPT/PhoenixContact_SPT_1.5_12-H-3.5_1x12_P3.5mm_Horizontal","Connector_Phoenix_SPT/PhoenixContact_SPT_1.5_2-H-3.5_1x02_P3.5mm_Horizontal","Connector_Phoenix_SPT/PhoenixContact_SPT_1.5_3-H-3.5_1x03_P3.5mm_Horizontal","Connector_Phoenix_SPT/PhoenixContact_SPT_1.5_4-H-3.5_1x04_P3.5mm_Horizontal","Connector_Phoenix_SPT/PhoenixContact_SPT_1.5_5-H-3.5_1x05_P3.5mm_Horizontal","Connector_Phoenix_SPT/PhoenixContact_SPT_1.5_6-H-3.5_1x06_P3.5mm_Horizontal","Connector_Phoenix_SPT/PhoenixContact_SPT_1.5_7-H-3.5_1x07_P3.5mm_Horizontal","Connector_Phoenix_SPT/PhoenixContact_SPT_1.5_8-H-3.5_1x08_P3.5mm_Horizontal","Connector_Phoenix_SPT/PhoenixContact_SPT_1.5_9-H-3.5_1x09_P3.5mm_Horizontal","Connector_Phoenix_SPT/PhoenixContact_SPT_2.5_1-H-5.0_1x01_P5.0mm_Horizontal","Connector_Phoenix_SPT/PhoenixContact_SPT_2.5_10-H-5.0-EX_1x10_P5.0mm_Horizontal","Connector_Phoenix_SPT/PhoenixContact_SPT_2.5_10-H-5.0_1x10_P5.0mm_Horizontal","Connector_Phoenix_SPT/PhoenixContact_SPT_2.5_10-V-5.0-EX_1x10_P5.0mm_Vertical","Connector_Phoenix_SPT/PhoenixContact_SPT_2.5_11-H-5.0-EX_1x11_P5.0mm_Horizontal","Connector_Phoenix_SPT/PhoenixContact_SPT_2.5_11-H-5.0_1x11_P5.0mm_Horizontal","Connector_Phoenix_SPT/PhoenixContact_SPT_2.5_11-V-5.0-EX_1x11_P5.0mm_Vertical","Connector_Phoenix_SPT/PhoenixContact_SPT_2.5_12-H-5.0-EX_1x12_P5.0mm_Horizontal","Connector_Phoenix_SPT/PhoenixContact_SPT_2.5_12-H-5.0_1x12_P5.0mm_Horizontal","Connector_Phoenix_SPT/PhoenixContact_SPT_2.5_12-V-5.0-EX_1x12_P5.0mm_Vertical","Connector_Phoenix_SPT/PhoenixContact_SPT_2.5_2-H-5.0-EX_1x02_P5.0mm_Horizontal","Connector_Phoenix_SPT/PhoenixContact_SPT_2.5_2-H-5.0_1x02_P5.0mm_Horizontal","Connector_Phoenix_SPT/PhoenixContact_SPT_2.5_2-V-5.0-EX_1x02_P5.0mm_Vertical","Connector_Phoenix_SPT/PhoenixContact_SPT_2.5_3-H-5.0-EX_1x03_P5.0mm_Horizontal","Connector_Phoenix_SPT/PhoenixContact_SPT_2.5_3-H-5.0_1x03_P5.0mm_Horizontal","Connector_Phoenix_SPT/PhoenixContact_SPT_2.5_3-V-5.0-EX_1x03_P5.0mm_Vertical","Connector_Phoenix_SPT/PhoenixContact_SPT_2.5_4-H-5.0-EX_1x04_P5.0mm_Horizontal","Connector_Phoenix_SPT/PhoenixContact_SPT_2.5_4-H-5.0_1x04_P5.0mm_Horizontal","Connector_Phoenix_SPT/PhoenixContact_SPT_2.5_4-V-5.0-EX_1x04_P5.0mm_Vertical","Connector_Phoenix_SPT/PhoenixContact_SPT_2.5_5-H-5.0-EX_1x05_P5.0mm_Horizontal","Connector_Phoenix_SPT/PhoenixContact_SPT_2.5_5-H-5.0_1x05_P5.0mm_Horizontal","Connector_Phoenix_SPT/PhoenixContact_SPT_2.5_5-V-5.0-EX_1x05_P5.0mm_Vertical","Connector_Phoenix_SPT/PhoenixContact_SPT_2.5_6-H-5.0-EX_1x06_P5.0mm_Horizontal","Connector_Phoenix_SPT/PhoenixContact_SPT_2.5_6-H-5.0_1x06_P5.0mm_Horizontal","Connector_Phoenix_SPT/PhoenixContact_SPT_2.5_6-V-5.0-EX_1x06_P5.0mm_Vertical","Connector_Phoenix_SPT/PhoenixContact_SPT_2.5_7-H-5.0-EX_1x07_P5.0mm_Horizontal","Connector_Phoenix_SPT/PhoenixContact_SPT_2.5_7-H-5.0_1x07_P5.0mm_Horizontal","Connector_Phoenix_SPT/PhoenixContact_SPT_2.5_7-V-5.0-EX_1x07_P5.0mm_Vertical","Connector_Phoenix_SPT/PhoenixContact_SPT_2.5_8-H-5.0-EX_1x08_P5.0mm_Horizontal","Connector_Phoenix_SPT/PhoenixContact_SPT_2.5_8-H-5.0_1x08_P5.0mm_Horizontal","Connector_Phoenix_SPT/PhoenixContact_SPT_2.5_8-V-5.0-EX_1x08_P5.0mm_Vertical","Connector_Phoenix_SPT/PhoenixContact_SPT_2.5_9-H-5.0-EX_1x09_P5.0mm_Horizontal","Connector_Phoenix_SPT/PhoenixContact_SPT_2.5_9-H-5.0_1x09_P5.0mm_Horizontal","Connector_Phoenix_SPT/PhoenixContact_SPT_2.5_9-V-5.0-EX_1x09_P5.0mm_Vertical","Connector_Phoenix_SPT/PhoenixContact_SPT_5_1-H-7.5_1x01_P7.5mm_Horizontal","Connector_Phoenix_SPT/PhoenixContact_SPT_5_1-V-7.5_1x01_P7.5mm_Vertical","Connector_Phoenix_SPT/PhoenixContact_SPT_5_10-H-7.5-ZB_1x10_P7.5mm_Horizontal","Connector_Phoenix_SPT/PhoenixContact_SPT_5_10-V-7.5-ZB_1x10_P7.5mm_Vertical","Connector_Phoenix_SPT/PhoenixContact_SPT_5_11-H-7.5-ZB_1x11_P7.5mm_Horizontal","Connector_Phoenix_SPT/PhoenixContact_SPT_5_11-V-7.5-ZB_1x11_P7.5mm_Vertical","Connector_Phoenix_SPT/PhoenixContact_SPT_5_12-H-7.5-ZB_1x12_P7.5mm_Horizontal","Connector_Phoenix_SPT/PhoenixContact_SPT_5_12-V-7.5-ZB_1x12_P7.5mm_Vertical","Connector_Phoenix_SPT/PhoenixContact_SPT_5_2-H-7.5-ZB_1x02_P7.5mm_Horizontal","Connector_Phoenix_SPT/PhoenixContact_SPT_5_2-V-7.5_1x02_P7.5mm_Vertical","Connector_Phoenix_SPT/PhoenixContact_SPT_5_3-H-7.5-ZB_1x03_P7.5mm_Horizontal","Connector_Phoenix_SPT/PhoenixContact_SPT_5_3-H-7.5_1x03_P7.5mm_Horizontal","Connector_Phoenix_SPT/PhoenixContact_SPT_5_3-V-7.5-ZB_1x03_P7.5mm_Vertical","Connector_Phoenix_SPT/PhoenixContact_SPT_5_4-H-7.5-ZB_1x04_P7.5mm_Horizontal","Connector_Phoenix_SPT/PhoenixContact_SPT_5_5-H-7.5-ZB_1x05_P7.5mm_Horizontal","Connector_Phoenix_SPT/PhoenixContact_SPT_5_5-V-7.5-ZB_1x05_P7.5mm_Vertical","Connector_Phoenix_SPT/PhoenixContact_SPT_5_6-H-7.5-ZB_1x06_P7.5mm_Horizontal","Connector_Phoenix_SPT/PhoenixContact_SPT_5_6-V-7.5-ZB_1x06_P7.5mm_Vertical","Connector_Phoenix_SPT/PhoenixContact_SPT_5_7-H-7.5-ZB_1x07_P7.5mm_Horizontal","Connector_Phoenix_SPT/PhoenixContact_SPT_5_7-V-7.5-ZB_1x07_P7.5mm_Vertical","Connector_Phoenix_SPT/PhoenixContact_SPT_5_8-H-7.5-ZB_1x08_P7.5mm_Horizontal","Connector_Phoenix_SPT/PhoenixContact_SPT_5_8-V-7.5-ZB_1x08_P7.5mm_Vertical","Connector_Phoenix_SPT/PhoenixContact_SPT_5_9-H-7.5-ZB_1x09_P7.5mm_Horizontal","Connector_Phoenix_SPT/PhoenixContact_SPT_5_9-V-7.5-ZB_1x09_P7.5mm_Vertical","Connector_Pin/Pin_D0.7mm_L6.5mm_W1.8mm_FlatFork","Connector_Pin/Pin_D0.9mm_L10.0mm_W2.4mm_FlatFork","Connector_Pin/Pin_D1.0mm_L10.0mm","Connector_Pin/Pin_D1.0mm_L10.0mm_LooseFit","Connector_Pin/Pin_D1.1mm_L10.2mm_W3.5mm_Flat","Connector_Pin/Pin_D1.1mm_L8.5mm_W2.5mm_FlatFork","Connector_Pin/Pin_D1.2mm_L10.2mm_W2.9mm_FlatFork","Connector_Pin/Pin_D1.2mm_L11.3mm_W3.0mm_Flat","Connector_Pin/Pin_D1.3mm_L10.0mm_W3.5mm_Flat","Connector_Pin/Pin_D1.3mm_L11.0mm","Connector_Pin/Pin_D1.3mm_L11.0mm_LooseFit","Connector_Pin/Pin_D1.3mm_L11.3mm_W2.8mm_Flat","Connector_Pin/Pin_D1.4mm_L8.5mm_W2.8mm_FlatFork","Connector_PinHeader_1.00mm/PinHeader_1x01_P1.00mm_Horizontal","Connector_PinHeader_1.00mm/PinHeader_1x01_P1.00mm_Vertical","Connector_PinHeader_1.00mm/PinHeader_1x02_P1.00mm_Horizontal","Connector_PinHeader_1.00mm/PinHeader_1x02_P1.00mm_Vertical","Connector_PinHeader_1.00mm/PinHeader_1x02_P1.00mm_Vertical_SMD_Pin1Left","Connector_PinHeader_1.00mm/PinHeader_1x02_P1.00mm_Vertical_SMD_Pin1Right","Connector_PinHeader_1.00mm/PinHeader_1x03_P1.00mm_Horizontal","Connector_PinHeader_1.00mm/PinHeader_1x03_P1.00mm_Vertical","Connector_PinHeader_1.00mm/PinHeader_1x03_P1.00mm_Vertical_SMD_Pin1Left","Connector_PinHeader_1.00mm/PinHeader_1x03_P1.00mm_Vertical_SMD_Pin1Right","Connector_PinHeader_1.00mm/PinHeader_1x04_P1.00mm_Horizontal","Connector_PinHeader_1.00mm/PinHeader_1x04_P1.00mm_Vertical","Connector_PinHeader_1.00mm/PinHeader_1x04_P1.00mm_Vertical_SMD_Pin1Left","Connector_PinHeader_1.00mm/PinHeader_1x04_P1.00mm_Vertical_SMD_Pin1Right","Connector_PinHeader_1.00mm/PinHeader_1x05_P1.00mm_Horizontal","Connector_PinHeader_1.00mm/PinHeader_1x05_P1.00mm_Vertical","Connector_PinHeader_1.00mm/PinHeader_1x05_P1.00mm_Vertical_SMD_Pin1Left","Connector_PinHeader_1.00mm/PinHeader_1x05_P1.00mm_Vertical_SMD_Pin1Right","Connector_PinHeader_1.00mm/PinHeader_1x06_P1.00mm_Horizontal","Connector_PinHeader_1.00mm/PinHeader_1x06_P1.00mm_Vertical","Connector_PinHeader_1.00mm/PinHeader_1x06_P1.00mm_Vertical_SMD_Pin1Left","Connector_PinHeader_1.00mm/PinHeader_1x06_P1.00mm_Vertical_SMD_Pin1Right","Connector_PinHeader_1.00mm/PinHeader_1x07_P1.00mm_Horizontal","Connector_PinHeader_1.00mm/PinHeader_1x07_P1.00mm_Vertical","Connector_PinHeader_1.00mm/PinHeader_1x07_P1.00mm_Vertical_SMD_Pin1Left","Connector_PinHeader_1.00mm/PinHeader_1x07_P1.00mm_Vertical_SMD_Pin1Right","Connector_PinHeader_1.00mm/PinHeader_1x08_P1.00mm_Horizontal","Connector_PinHeader_1.00mm/PinHeader_1x08_P1.00mm_Vertical","Connector_PinHeader_1.00mm/PinHeader_1x08_P1.00mm_Vertical_SMD_Pin1Left","Connector_PinHeader_1.00mm/PinHeader_1x08_P1.00mm_Vertical_SMD_Pin1Right","Connector_PinHeader_1.00mm/PinHeader_1x09_P1.00mm_Horizontal","Connector_PinHeader_1.00mm/PinHeader_1x09_P1.00mm_Vertical","Connector_PinHeader_1.00mm/PinHeader_1x09_P1.00mm_Vertical_SMD_Pin1Left","Connector_PinHeader_1.00mm/PinHeader_1x09_P1.00mm_Vertical_SMD_Pin1Right","Connector_PinHeader_1.00mm/PinHeader_1x10_P1.00mm_Horizontal","Connector_PinHeader_1.00mm/PinHeader_1x10_P1.00mm_Vertical","Connector_PinHeader_1.00mm/PinHeader_1x10_P1.00mm_Vertical_SMD_Pin1Left","Connector_PinHeader_1.00mm/PinHeader_1x10_P1.00mm_Vertical_SMD_Pin1Right","Connector_PinHeader_1.00mm/PinHeader_1x11_P1.00mm_Horizontal","Connector_PinHeader_1.00mm/PinHeader_1x11_P1.00mm_Vertical","Connector_PinHeader_1.00mm/PinHeader_1x11_P1.00mm_Vertical_SMD_Pin1Left","Connector_PinHeader_1.00mm/PinHeader_1x11_P1.00mm_Vertical_SMD_Pin1Right","Connector_PinHeader_1.00mm/PinHeader_1x12_P1.00mm_Horizontal","Connector_PinHeader_1.00mm/PinHeader_1x12_P1.00mm_Vertical","Connector_PinHeader_1.00mm/PinHeader_1x12_P1.00mm_Vertical_SMD_Pin1Left","Connector_PinHeader_1.00mm/PinHeader_1x12_P1.00mm_Vertical_SMD_Pin1Right","Connector_PinHeader_1.00mm/PinHeader_1x13_P1.00mm_Horizontal","Connector_PinHeader_1.00mm/PinHeader_1x13_P1.00mm_Vertical","Connector_PinHeader_1.00mm/PinHeader_1x13_P1.00mm_Vertical_SMD_Pin1Left","Connector_PinHeader_1.00mm/PinHeader_1x13_P1.00mm_Vertical_SMD_Pin1Right","Connector_PinHeader_1.00mm/PinHeader_1x14_P1.00mm_Horizontal","Connector_PinHeader_1.00mm/PinHeader_1x14_P1.00mm_Vertical","Connector_PinHeader_1.00mm/PinHeader_1x14_P1.00mm_Vertical_SMD_Pin1Left","Connector_PinHeader_1.00mm/PinHeader_1x14_P1.00mm_Vertical_SMD_Pin1Right","Connector_PinHeader_1.00mm/PinHeader_1x15_P1.00mm_Horizontal","Connector_PinHeader_1.00mm/PinHeader_1x15_P1.00mm_Vertical","Connector_PinHeader_1.00mm/PinHeader_1x15_P1.00mm_Vertical_SMD_Pin1Left","Connector_PinHeader_1.00mm/PinHeader_1x15_P1.00mm_Vertical_SMD_Pin1Right","Connector_PinHeader_1.00mm/PinHeader_1x16_P1.00mm_Horizontal","Connector_PinHeader_1.00mm/PinHeader_1x16_P1.00mm_Vertical","Connector_PinHeader_1.00mm/PinHeader_1x16_P1.00mm_Vertical_SMD_Pin1Left","Connector_PinHeader_1.00mm/PinHeader_1x16_P1.00mm_Vertical_SMD_Pin1Right","Connector_PinHeader_1.00mm/PinHeader_1x17_P1.00mm_Horizontal","Connector_PinHeader_1.00mm/PinHeader_1x17_P1.00mm_Vertical","Connector_PinHeader_1.00mm/PinHeader_1x17_P1.00mm_Vertical_SMD_Pin1Left","Connector_PinHeader_1.00mm/PinHeader_1x17_P1.00mm_Vertical_SMD_Pin1Right","Connector_PinHeader_1.00mm/PinHeader_1x18_P1.00mm_Horizontal","Connector_PinHeader_1.00mm/PinHeader_1x18_P1.00mm_Vertical","Connector_PinHeader_1.00mm/PinHeader_1x18_P1.00mm_Vertical_SMD_Pin1Left","Connector_PinHeader_1.00mm/PinHeader_1x18_P1.00mm_Vertical_SMD_Pin1Right","Connector_PinHeader_1.00mm/PinHeader_1x19_P1.00mm_Horizontal","Connector_PinHeader_1.00mm/PinHeader_1x19_P1.00mm_Vertical","Connector_PinHeader_1.00mm/PinHeader_1x19_P1.00mm_Vertical_SMD_Pin1Left","Connector_PinHeader_1.00mm/PinHeader_1x19_P1.00mm_Vertical_SMD_Pin1Right","Connector_PinHeader_1.00mm/PinHeader_1x20_P1.00mm_Horizontal","Connector_PinHeader_1.00mm/PinHeader_1x20_P1.00mm_Vertical","Connector_PinHeader_1.00mm/PinHeader_1x20_P1.00mm_Vertical_SMD_Pin1Left","Connector_PinHeader_1.00mm/PinHeader_1x20_P1.00mm_Vertical_SMD_Pin1Right","Connector_PinHeader_1.00mm/PinHeader_1x21_P1.00mm_Horizontal","Connector_PinHeader_1.00mm/PinHeader_1x21_P1.00mm_Vertical","Connector_PinHeader_1.00mm/PinHeader_1x21_P1.00mm_Vertical_SMD_Pin1Left","Connector_PinHeader_1.00mm/PinHeader_1x21_P1.00mm_Vertical_SMD_Pin1Right","Connector_PinHeader_1.00mm/PinHeader_1x22_P1.00mm_Horizontal","Connector_PinHeader_1.00mm/PinHeader_1x22_P1.00mm_Vertical","Connector_PinHeader_1.00mm/PinHeader_1x22_P1.00mm_Vertical_SMD_Pin1Left","Connector_PinHeader_1.00mm/PinHeader_1x22_P1.00mm_Vertical_SMD_Pin1Right","Connector_PinHeader_1.00mm/PinHeader_1x23_P1.00mm_Horizontal","Connector_PinHeader_1.00mm/PinHeader_1x23_P1.00mm_Vertical","Connector_PinHeader_1.00mm/PinHeader_1x23_P1.00mm_Vertical_SMD_Pin1Left","Connector_PinHeader_1.00mm/PinHeader_1x23_P1.00mm_Vertical_SMD_Pin1Right","Connector_PinHeader_1.00mm/PinHeader_1x24_P1.00mm_Horizontal","Connector_PinHeader_1.00mm/PinHeader_1x24_P1.00mm_Vertical","Connector_PinHeader_1.00mm/PinHeader_1x24_P1.00mm_Vertical_SMD_Pin1Left","Connector_PinHeader_1.00mm/PinHeader_1x24_P1.00mm_Vertical_SMD_Pin1Right","Connector_PinHeader_1.00mm/PinHeader_1x25_P1.00mm_Horizontal","Connector_PinHeader_1.00mm/PinHeader_1x25_P1.00mm_Vertical","Connector_PinHeader_1.00mm/PinHeader_1x25_P1.00mm_Vertical_SMD_Pin1Left","Connector_PinHeader_1.00mm/PinHeader_1x25_P1.00mm_Vertical_SMD_Pin1Right","Connector_PinHeader_1.00mm/PinHeader_1x26_P1.00mm_Horizontal","Connector_PinHeader_1.00mm/PinHeader_1x26_P1.00mm_Vertical","Connector_PinHeader_1.00mm/PinHeader_1x26_P1.00mm_Vertical_SMD_Pin1Left","Connector_PinHeader_1.00mm/PinHeader_1x26_P1.00mm_Vertical_SMD_Pin1Right","Connector_PinHeader_1.00mm/PinHeader_1x27_P1.00mm_Horizontal","Connector_PinHeader_1.00mm/PinHeader_1x27_P1.00mm_Vertical","Connector_PinHeader_1.00mm/PinHeader_1x27_P1.00mm_Vertical_SMD_Pin1Left","Connector_PinHeader_1.00mm/PinHeader_1x27_P1.00mm_Vertical_SMD_Pin1Right","Connector_PinHeader_1.00mm/PinHeader_1x28_P1.00mm_Horizontal","Connector_PinHeader_1.00mm/PinHeader_1x28_P1.00mm_Vertical","Connector_PinHeader_1.00mm/PinHeader_1x28_P1.00mm_Vertical_SMD_Pin1Left","Connector_PinHeader_1.00mm/PinHeader_1x28_P1.00mm_Vertical_SMD_Pin1Right","Connector_PinHeader_1.00mm/PinHeader_1x29_P1.00mm_Horizontal","Connector_PinHeader_1.00mm/PinHeader_1x29_P1.00mm_Vertical","Connector_PinHeader_1.00mm/PinHeader_1x29_P1.00mm_Vertical_SMD_Pin1Left","Connector_PinHeader_1.00mm/PinHeader_1x29_P1.00mm_Vertical_SMD_Pin1Right","Connector_PinHeader_1.00mm/PinHeader_1x30_P1.00mm_Horizontal","Connector_PinHeader_1.00mm/PinHeader_1x30_P1.00mm_Vertical","Connector_PinHeader_1.00mm/PinHeader_1x30_P1.00mm_Vertical_SMD_Pin1Left","Connector_PinHeader_1.00mm/PinHeader_1x30_P1.00mm_Vertical_SMD_Pin1Right","Connector_PinHeader_1.00mm/PinHeader_1x31_P1.00mm_Horizontal","Connector_PinHeader_1.00mm/PinHeader_1x31_P1.00mm_Vertical","Connector_PinHeader_1.00mm/PinHeader_1x31_P1.00mm_Vertical_SMD_Pin1Left","Connector_PinHeader_1.00mm/PinHeader_1x31_P1.00mm_Vertical_SMD_Pin1Right","Connector_PinHeader_1.00mm/PinHeader_1x32_P1.00mm_Horizontal","Connector_PinHeader_1.00mm/PinHeader_1x32_P1.00mm_Vertical","Connector_PinHeader_1.00mm/PinHeader_1x32_P1.00mm_Vertical_SMD_Pin1Left","Connector_PinHeader_1.00mm/PinHeader_1x32_P1.00mm_Vertical_SMD_Pin1Right","Connector_PinHeader_1.00mm/PinHeader_1x33_P1.00mm_Horizontal","Connector_PinHeader_1.00mm/PinHeader_1x33_P1.00mm_Vertical","Connector_PinHeader_1.00mm/PinHeader_1x33_P1.00mm_Vertical_SMD_Pin1Left","Connector_PinHeader_1.00mm/PinHeader_1x33_P1.00mm_Vertical_SMD_Pin1Right","Connector_PinHeader_1.00mm/PinHeader_1x34_P1.00mm_Horizontal","Connector_PinHeader_1.00mm/PinHeader_1x34_P1.00mm_Vertical","Connector_PinHeader_1.00mm/PinHeader_1x34_P1.00mm_Vertical_SMD_Pin1Left","Connector_PinHeader_1.00mm/PinHeader_1x34_P1.00mm_Vertical_SMD_Pin1Right","Connector_PinHeader_1.00mm/PinHeader_1x35_P1.00mm_Horizontal","Connector_PinHeader_1.00mm/PinHeader_1x35_P1.00mm_Vertical","Connector_PinHeader_1.00mm/PinHeader_1x35_P1.00mm_Vertical_SMD_Pin1Left","Connector_PinHeader_1.00mm/PinHeader_1x35_P1.00mm_Vertical_SMD_Pin1Right","Connector_PinHeader_1.00mm/PinHeader_1x36_P1.00mm_Horizontal","Connector_PinHeader_1.00mm/PinHeader_1x36_P1.00mm_Vertical","Connector_PinHeader_1.00mm/PinHeader_1x36_P1.00mm_Vertical_SMD_Pin1Left","Connector_PinHeader_1.00mm/PinHeader_1x36_P1.00mm_Vertical_SMD_Pin1Right","Connector_PinHeader_1.00mm/PinHeader_1x37_P1.00mm_Horizontal","Connector_PinHeader_1.00mm/PinHeader_1x37_P1.00mm_Vertical","Connector_PinHeader_1.00mm/PinHeader_1x37_P1.00mm_Vertical_SMD_Pin1Left","Connector_PinHeader_1.00mm/PinHeader_1x37_P1.00mm_Vertical_SMD_Pin1Right","Connector_PinHeader_1.00mm/PinHeader_1x38_P1.00mm_Horizontal","Connector_PinHeader_1.00mm/PinHeader_1x38_P1.00mm_Vertical","Connector_PinHeader_1.00mm/PinHeader_1x38_P1.00mm_Vertical_SMD_Pin1Left","Connector_PinHeader_1.00mm/PinHeader_1x38_P1.00mm_Vertical_SMD_Pin1Right","Connector_PinHeader_1.00mm/PinHeader_1x39_P1.00mm_Horizontal","Connector_PinHeader_1.00mm/PinHeader_1x39_P1.00mm_Vertical","Connector_PinHeader_1.00mm/PinHeader_1x39_P1.00mm_Vertical_SMD_Pin1Left","Connector_PinHeader_1.00mm/PinHeader_1x39_P1.00mm_Vertical_SMD_Pin1Right","Connector_PinHeader_1.00mm/PinHeader_1x40_P1.00mm_Horizontal","Connector_PinHeader_1.00mm/PinHeader_1x40_P1.00mm_Vertical","Connector_PinHeader_1.00mm/PinHeader_1x40_P1.00mm_Vertical_SMD_Pin1Left","Connector_PinHeader_1.00mm/PinHeader_1x40_P1.00mm_Vertical_SMD_Pin1Right","Connector_PinHeader_1.00mm/PinHeader_2x01_P1.00mm_Horizontal","Connector_PinHeader_1.00mm/PinHeader_2x01_P1.00mm_Vertical","Connector_PinHeader_1.00mm/PinHeader_2x01_P1.00mm_Vertical_SMD","Connector_PinHeader_1.00mm/PinHeader_2x02_P1.00mm_Horizontal","Connector_PinHeader_1.00mm/PinHeader_2x02_P1.00mm_Vertical","Connector_PinHeader_1.00mm/PinHeader_2x02_P1.00mm_Vertical_SMD","Connector_PinHeader_1.00mm/PinHeader_2x03_P1.00mm_Horizontal","Connector_PinHeader_1.00mm/PinHeader_2x03_P1.00mm_Vertical","Connector_PinHeader_1.00mm/PinHeader_2x03_P1.00mm_Vertical_SMD","Connector_PinHeader_1.00mm/PinHeader_2x04_P1.00mm_Horizontal","Connector_PinHeader_1.00mm/PinHeader_2x04_P1.00mm_Vertical","Connector_PinHeader_1.00mm/PinHeader_2x04_P1.00mm_Vertical_SMD","Connector_PinHeader_1.00mm/PinHeader_2x05_P1.00mm_Horizontal","Connector_PinHeader_1.00mm/PinHeader_2x05_P1.00mm_Vertical","Connector_PinHeader_1.00mm/PinHeader_2x05_P1.00mm_Vertical_SMD","Connector_PinHeader_1.00mm/PinHeader_2x06_P1.00mm_Horizontal","Connector_PinHeader_1.00mm/PinHeader_2x06_P1.00mm_Vertical","Connector_PinHeader_1.00mm/PinHeader_2x06_P1.00mm_Vertical_SMD","Connector_PinHeader_1.00mm/PinHeader_2x07_P1.00mm_Horizontal","Connector_PinHeader_1.00mm/PinHeader_2x07_P1.00mm_Vertical","Connector_PinHeader_1.00mm/PinHeader_2x07_P1.00mm_Vertical_SMD","Connector_PinHeader_1.00mm/PinHeader_2x08_P1.00mm_Horizontal","Connector_PinHeader_1.00mm/PinHeader_2x08_P1.00mm_Vertical","Connector_PinHeader_1.00mm/PinHeader_2x08_P1.00mm_Vertical_SMD","Connector_PinHeader_1.00mm/PinHeader_2x09_P1.00mm_Horizontal","Connector_PinHeader_1.00mm/PinHeader_2x09_P1.00mm_Vertical","Connector_PinHeader_1.00mm/PinHeader_2x09_P1.00mm_Vertical_SMD","Connector_PinHeader_1.00mm/PinHeader_2x10_P1.00mm_Horizontal","Connector_PinHeader_1.00mm/PinHeader_2x10_P1.00mm_Vertical","Connector_PinHeader_1.00mm/PinHeader_2x10_P1.00mm_Vertical_SMD","Connector_PinHeader_1.00mm/PinHeader_2x11_P1.00mm_Horizontal","Connector_PinHeader_1.00mm/PinHeader_2x11_P1.00mm_Vertical","Connector_PinHeader_1.00mm/PinHeader_2x11_P1.00mm_Vertical_SMD","Connector_PinHeader_1.00mm/PinHeader_2x12_P1.00mm_Horizontal","Connector_PinHeader_1.00mm/PinHeader_2x12_P1.00mm_Vertical","Connector_PinHeader_1.00mm/PinHeader_2x12_P1.00mm_Vertical_SMD","Connector_PinHeader_1.00mm/PinHeader_2x13_P1.00mm_Horizontal","Connector_PinHeader_1.00mm/PinHeader_2x13_P1.00mm_Vertical","Connector_PinHeader_1.00mm/PinHeader_2x13_P1.00mm_Vertical_SMD","Connector_PinHeader_1.00mm/PinHeader_2x14_P1.00mm_Horizontal","Connector_PinHeader_1.00mm/PinHeader_2x14_P1.00mm_Vertical","Connector_PinHeader_1.00mm/PinHeader_2x14_P1.00mm_Vertical_SMD","Connector_PinHeader_1.00mm/PinHeader_2x15_P1.00mm_Horizontal","Connector_PinHeader_1.00mm/PinHeader_2x15_P1.00mm_Vertical","Connector_PinHeader_1.00mm/PinHeader_2x15_P1.00mm_Vertical_SMD","Connector_PinHeader_1.00mm/PinHeader_2x16_P1.00mm_Horizontal","Connector_PinHeader_1.00mm/PinHeader_2x16_P1.00mm_Vertical","Connector_PinHeader_1.00mm/PinHeader_2x16_P1.00mm_Vertical_SMD","Connector_PinHeader_1.00mm/PinHeader_2x17_P1.00mm_Horizontal","Connector_PinHeader_1.00mm/PinHeader_2x17_P1.00mm_Vertical","Connector_PinHeader_1.00mm/PinHeader_2x17_P1.00mm_Vertical_SMD","Connector_PinHeader_1.00mm/PinHeader_2x18_P1.00mm_Horizontal","Connector_PinHeader_1.00mm/PinHeader_2x18_P1.00mm_Vertical","Connector_PinHeader_1.00mm/PinHeader_2x18_P1.00mm_Vertical_SMD","Connector_PinHeader_1.00mm/PinHeader_2x19_P1.00mm_Horizontal","Connector_PinHeader_1.00mm/PinHeader_2x19_P1.00mm_Vertical","Connector_PinHeader_1.00mm/PinHeader_2x19_P1.00mm_Vertical_SMD","Connector_PinHeader_1.00mm/PinHeader_2x20_P1.00mm_Horizontal","Connector_PinHeader_1.00mm/PinHeader_2x20_P1.00mm_Vertical","Connector_PinHeader_1.00mm/PinHeader_2x20_P1.00mm_Vertical_SMD","Connector_PinHeader_1.00mm/PinHeader_2x21_P1.00mm_Horizontal","Connector_PinHeader_1.00mm/PinHeader_2x21_P1.00mm_Vertical","Connector_PinHeader_1.00mm/PinHeader_2x21_P1.00mm_Vertical_SMD","Connector_PinHeader_1.00mm/PinHeader_2x22_P1.00mm_Horizontal","Connector_PinHeader_1.00mm/PinHeader_2x22_P1.00mm_Vertical","Connector_PinHeader_1.00mm/PinHeader_2x22_P1.00mm_Vertical_SMD","Connector_PinHeader_1.00mm/PinHeader_2x23_P1.00mm_Horizontal","Connector_PinHeader_1.00mm/PinHeader_2x23_P1.00mm_Vertical","Connector_PinHeader_1.00mm/PinHeader_2x23_P1.00mm_Vertical_SMD","Connector_PinHeader_1.00mm/PinHeader_2x24_P1.00mm_Horizontal","Connector_PinHeader_1.00mm/PinHeader_2x24_P1.00mm_Vertical","Connector_PinHeader_1.00mm/PinHeader_2x24_P1.00mm_Vertical_SMD","Connector_PinHeader_1.00mm/PinHeader_2x25_P1.00mm_Horizontal","Connector_PinHeader_1.00mm/PinHeader_2x25_P1.00mm_Vertical","Connector_PinHeader_1.00mm/PinHeader_2x25_P1.00mm_Vertical_SMD","Connector_PinHeader_1.00mm/PinHeader_2x26_P1.00mm_Horizontal","Connector_PinHeader_1.00mm/PinHeader_2x26_P1.00mm_Vertical","Connector_PinHeader_1.00mm/PinHeader_2x26_P1.00mm_Vertical_SMD","Connector_PinHeader_1.00mm/PinHeader_2x27_P1.00mm_Horizontal","Connector_PinHeader_1.00mm/PinHeader_2x27_P1.00mm_Vertical","Connector_PinHeader_1.00mm/PinHeader_2x27_P1.00mm_Vertical_SMD","Connector_PinHeader_1.00mm/PinHeader_2x28_P1.00mm_Horizontal","Connector_PinHeader_1.00mm/PinHeader_2x28_P1.00mm_Vertical","Connector_PinHeader_1.00mm/PinHeader_2x28_P1.00mm_Vertical_SMD","Connector_PinHeader_1.00mm/PinHeader_2x29_P1.00mm_Horizontal","Connector_PinHeader_1.00mm/PinHeader_2x29_P1.00mm_Vertical","Connector_PinHeader_1.00mm/PinHeader_2x29_P1.00mm_Vertical_SMD","Connector_PinHeader_1.00mm/PinHeader_2x30_P1.00mm_Horizontal","Connector_PinHeader_1.00mm/PinHeader_2x30_P1.00mm_Vertical","Connector_PinHeader_1.00mm/PinHeader_2x30_P1.00mm_Vertical_SMD","Connector_PinHeader_1.00mm/PinHeader_2x31_P1.00mm_Horizontal","Connector_PinHeader_1.00mm/PinHeader_2x31_P1.00mm_Vertical","Connector_PinHeader_1.00mm/PinHeader_2x31_P1.00mm_Vertical_SMD","Connector_PinHeader_1.00mm/PinHeader_2x32_P1.00mm_Horizontal","Connector_PinHeader_1.00mm/PinHeader_2x32_P1.00mm_Vertical","Connector_PinHeader_1.00mm/PinHeader_2x32_P1.00mm_Vertical_SMD","Connector_PinHeader_1.00mm/PinHeader_2x33_P1.00mm_Horizontal","Connector_PinHeader_1.00mm/PinHeader_2x33_P1.00mm_Vertical","Connector_PinHeader_1.00mm/PinHeader_2x33_P1.00mm_Vertical_SMD","Connector_PinHeader_1.00mm/PinHeader_2x34_P1.00mm_Horizontal","Connector_PinHeader_1.00mm/PinHeader_2x34_P1.00mm_Vertical","Connector_PinHeader_1.00mm/PinHeader_2x34_P1.00mm_Vertical_SMD","Connector_PinHeader_1.00mm/PinHeader_2x35_P1.00mm_Horizontal","Connector_PinHeader_1.00mm/PinHeader_2x35_P1.00mm_Vertical","Connector_PinHeader_1.00mm/PinHeader_2x35_P1.00mm_Vertical_SMD","Connector_PinHeader_1.00mm/PinHeader_2x36_P1.00mm_Horizontal","Connector_PinHeader_1.00mm/PinHeader_2x36_P1.00mm_Vertical","Connector_PinHeader_1.00mm/PinHeader_2x36_P1.00mm_Vertical_SMD","Connector_PinHeader_1.00mm/PinHeader_2x37_P1.00mm_Horizontal","Connector_PinHeader_1.00mm/PinHeader_2x37_P1.00mm_Vertical","Connector_PinHeader_1.00mm/PinHeader_2x37_P1.00mm_Vertical_SMD","Connector_PinHeader_1.00mm/PinHeader_2x38_P1.00mm_Horizontal","Connector_PinHeader_1.00mm/PinHeader_2x38_P1.00mm_Vertical","Connector_PinHeader_1.00mm/PinHeader_2x38_P1.00mm_Vertical_SMD","Connector_PinHeader_1.00mm/PinHeader_2x39_P1.00mm_Horizontal","Connector_PinHeader_1.00mm/PinHeader_2x39_P1.00mm_Vertical","Connector_PinHeader_1.00mm/PinHeader_2x39_P1.00mm_Vertical_SMD","Connector_PinHeader_1.00mm/PinHeader_2x40_P1.00mm_Horizontal","Connector_PinHeader_1.00mm/PinHeader_2x40_P1.00mm_Vertical","Connector_PinHeader_1.00mm/PinHeader_2x40_P1.00mm_Vertical_SMD","Connector_PinHeader_1.27mm/PinHeader_1x01_P1.27mm_Horizontal","Connector_PinHeader_1.27mm/PinHeader_1x01_P1.27mm_Vertical","Connector_PinHeader_1.27mm/PinHeader_1x02_P1.27mm_Horizontal","Connector_PinHeader_1.27mm/PinHeader_1x02_P1.27mm_Vertical","Connector_PinHeader_1.27mm/PinHeader_1x02_P1.27mm_Vertical_SMD_Pin1Left","Connector_PinHeader_1.27mm/PinHeader_1x02_P1.27mm_Vertical_SMD_Pin1Right","Connector_PinHeader_1.27mm/PinHeader_1x03_P1.27mm_Horizontal","Connector_PinHeader_1.27mm/PinHeader_1x03_P1.27mm_Vertical","Connector_PinHeader_1.27mm/PinHeader_1x03_P1.27mm_Vertical_SMD_Pin1Left","Connector_PinHeader_1.27mm/PinHeader_1x03_P1.27mm_Vertical_SMD_Pin1Right","Connector_PinHeader_1.27mm/PinHeader_1x04_P1.27mm_Horizontal","Connector_PinHeader_1.27mm/PinHeader_1x04_P1.27mm_Vertical","Connector_PinHeader_1.27mm/PinHeader_1x04_P1.27mm_Vertical_SMD_Pin1Left","Connector_PinHeader_1.27mm/PinHeader_1x04_P1.27mm_Vertical_SMD_Pin1Right","Connector_PinHeader_1.27mm/PinHeader_1x05_P1.27mm_Horizontal","Connector_PinHeader_1.27mm/PinHeader_1x05_P1.27mm_Vertical","Connector_PinHeader_1.27mm/PinHeader_1x05_P1.27mm_Vertical_SMD_Pin1Left","Connector_PinHeader_1.27mm/PinHeader_1x05_P1.27mm_Vertical_SMD_Pin1Right","Connector_PinHeader_1.27mm/PinHeader_1x06_P1.27mm_Horizontal","Connector_PinHeader_1.27mm/PinHeader_1x06_P1.27mm_Vertical","Connector_PinHeader_1.27mm/PinHeader_1x06_P1.27mm_Vertical_SMD_Pin1Left","Connector_PinHeader_1.27mm/PinHeader_1x06_P1.27mm_Vertical_SMD_Pin1Right","Connector_PinHeader_1.27mm/PinHeader_1x07_P1.27mm_Horizontal","Connector_PinHeader_1.27mm/PinHeader_1x07_P1.27mm_Vertical","Connector_PinHeader_1.27mm/PinHeader_1x07_P1.27mm_Vertical_SMD_Pin1Left","Connector_PinHeader_1.27mm/PinHeader_1x07_P1.27mm_Vertical_SMD_Pin1Right","Connector_PinHeader_1.27mm/PinHeader_1x08_P1.27mm_Horizontal","Connector_PinHeader_1.27mm/PinHeader_1x08_P1.27mm_Vertical","Connector_PinHeader_1.27mm/PinHeader_1x08_P1.27mm_Vertical_SMD_Pin1Left","Connector_PinHeader_1.27mm/PinHeader_1x08_P1.27mm_Vertical_SMD_Pin1Right","Connector_PinHeader_1.27mm/PinHeader_1x09_P1.27mm_Horizontal","Connector_PinHeader_1.27mm/PinHeader_1x09_P1.27mm_Vertical","Connector_PinHeader_1.27mm/PinHeader_1x09_P1.27mm_Vertical_SMD_Pin1Left","Connector_PinHeader_1.27mm/PinHeader_1x09_P1.27mm_Vertical_SMD_Pin1Right","Connector_PinHeader_1.27mm/PinHeader_1x10_P1.27mm_Horizontal","Connector_PinHeader_1.27mm/PinHeader_1x10_P1.27mm_Vertical","Connector_PinHeader_1.27mm/PinHeader_1x10_P1.27mm_Vertical_SMD_Pin1Left","Connector_PinHeader_1.27mm/PinHeader_1x10_P1.27mm_Vertical_SMD_Pin1Right","Connector_PinHeader_1.27mm/PinHeader_1x11_P1.27mm_Horizontal","Connector_PinHeader_1.27mm/PinHeader_1x11_P1.27mm_Vertical","Connector_PinHeader_1.27mm/PinHeader_1x11_P1.27mm_Vertical_SMD_Pin1Left","Connector_PinHeader_1.27mm/PinHeader_1x11_P1.27mm_Vertical_SMD_Pin1Right","Connector_PinHeader_1.27mm/PinHeader_1x12_P1.27mm_Horizontal","Connector_PinHeader_1.27mm/PinHeader_1x12_P1.27mm_Vertical","Connector_PinHeader_1.27mm/PinHeader_1x12_P1.27mm_Vertical_SMD_Pin1Left","Connector_PinHeader_1.27mm/PinHeader_1x12_P1.27mm_Vertical_SMD_Pin1Right","Connector_PinHeader_1.27mm/PinHeader_1x13_P1.27mm_Horizontal","Connector_PinHeader_1.27mm/PinHeader_1x13_P1.27mm_Vertical","Connector_PinHeader_1.27mm/PinHeader_1x13_P1.27mm_Vertical_SMD_Pin1Left","Connector_PinHeader_1.27mm/PinHeader_1x13_P1.27mm_Vertical_SMD_Pin1Right","Connector_PinHeader_1.27mm/PinHeader_1x14_P1.27mm_Horizontal","Connector_PinHeader_1.27mm/PinHeader_1x14_P1.27mm_Vertical","Connector_PinHeader_1.27mm/PinHeader_1x14_P1.27mm_Vertical_SMD_Pin1Left","Connector_PinHeader_1.27mm/PinHeader_1x14_P1.27mm_Vertical_SMD_Pin1Right","Connector_PinHeader_1.27mm/PinHeader_1x15_P1.27mm_Horizontal","Connector_PinHeader_1.27mm/PinHeader_1x15_P1.27mm_Vertical","Connector_PinHeader_1.27mm/PinHeader_1x15_P1.27mm_Vertical_SMD_Pin1Left","Connector_PinHeader_1.27mm/PinHeader_1x15_P1.27mm_Vertical_SMD_Pin1Right","Connector_PinHeader_1.27mm/PinHeader_1x16_P1.27mm_Horizontal","Connector_PinHeader_1.27mm/PinHeader_1x16_P1.27mm_Vertical","Connector_PinHeader_1.27mm/PinHeader_1x16_P1.27mm_Vertical_SMD_Pin1Left","Connector_PinHeader_1.27mm/PinHeader_1x16_P1.27mm_Vertical_SMD_Pin1Right","Connector_PinHeader_1.27mm/PinHeader_1x17_P1.27mm_Horizontal","Connector_PinHeader_1.27mm/PinHeader_1x17_P1.27mm_Vertical","Connector_PinHeader_1.27mm/PinHeader_1x17_P1.27mm_Vertical_SMD_Pin1Left","Connector_PinHeader_1.27mm/PinHeader_1x17_P1.27mm_Vertical_SMD_Pin1Right","Connector_PinHeader_1.27mm/PinHeader_1x18_P1.27mm_Horizontal","Connector_PinHeader_1.27mm/PinHeader_1x18_P1.27mm_Vertical","Connector_PinHeader_1.27mm/PinHeader_1x18_P1.27mm_Vertical_SMD_Pin1Left","Connector_PinHeader_1.27mm/PinHeader_1x18_P1.27mm_Vertical_SMD_Pin1Right","Connector_PinHeader_1.27mm/PinHeader_1x19_P1.27mm_Horizontal","Connector_PinHeader_1.27mm/PinHeader_1x19_P1.27mm_Vertical","Connector_PinHeader_1.27mm/PinHeader_1x19_P1.27mm_Vertical_SMD_Pin1Left","Connector_PinHeader_1.27mm/PinHeader_1x19_P1.27mm_Vertical_SMD_Pin1Right","Connector_PinHeader_1.27mm/PinHeader_1x20_P1.27mm_Horizontal","Connector_PinHeader_1.27mm/PinHeader_1x20_P1.27mm_Vertical","Connector_PinHeader_1.27mm/PinHeader_1x20_P1.27mm_Vertical_SMD_Pin1Left","Connector_PinHeader_1.27mm/PinHeader_1x20_P1.27mm_Vertical_SMD_Pin1Right","Connector_PinHeader_1.27mm/PinHeader_1x21_P1.27mm_Horizontal","Connector_PinHeader_1.27mm/PinHeader_1x21_P1.27mm_Vertical","Connector_PinHeader_1.27mm/PinHeader_1x21_P1.27mm_Vertical_SMD_Pin1Left","Connector_PinHeader_1.27mm/PinHeader_1x21_P1.27mm_Vertical_SMD_Pin1Right","Connector_PinHeader_1.27mm/PinHeader_1x22_P1.27mm_Horizontal","Connector_PinHeader_1.27mm/PinHeader_1x22_P1.27mm_Vertical","Connector_PinHeader_1.27mm/PinHeader_1x22_P1.27mm_Vertical_SMD_Pin1Left","Connector_PinHeader_1.27mm/PinHeader_1x22_P1.27mm_Vertical_SMD_Pin1Right","Connector_PinHeader_1.27mm/PinHeader_1x23_P1.27mm_Horizontal","Connector_PinHeader_1.27mm/PinHeader_1x23_P1.27mm_Vertical","Connector_PinHeader_1.27mm/PinHeader_1x23_P1.27mm_Vertical_SMD_Pin1Left","Connector_PinHeader_1.27mm/PinHeader_1x23_P1.27mm_Vertical_SMD_Pin1Right","Connector_PinHeader_1.27mm/PinHeader_1x24_P1.27mm_Horizontal","Connector_PinHeader_1.27mm/PinHeader_1x24_P1.27mm_Vertical","Connector_PinHeader_1.27mm/PinHeader_1x24_P1.27mm_Vertical_SMD_Pin1Left","Connector_PinHeader_1.27mm/PinHeader_1x24_P1.27mm_Vertical_SMD_Pin1Right","Connector_PinHeader_1.27mm/PinHeader_1x25_P1.27mm_Horizontal","Connector_PinHeader_1.27mm/PinHeader_1x25_P1.27mm_Vertical","Connector_PinHeader_1.27mm/PinHeader_1x25_P1.27mm_Vertical_SMD_Pin1Left","Connector_PinHeader_1.27mm/PinHeader_1x25_P1.27mm_Vertical_SMD_Pin1Right","Connector_PinHeader_1.27mm/PinHeader_1x26_P1.27mm_Horizontal","Connector_PinHeader_1.27mm/PinHeader_1x26_P1.27mm_Vertical","Connector_PinHeader_1.27mm/PinHeader_1x26_P1.27mm_Vertical_SMD_Pin1Left","Connector_PinHeader_1.27mm/PinHeader_1x26_P1.27mm_Vertical_SMD_Pin1Right","Connector_PinHeader_1.27mm/PinHeader_1x27_P1.27mm_Horizontal","Connector_PinHeader_1.27mm/PinHeader_1x27_P1.27mm_Vertical","Connector_PinHeader_1.27mm/PinHeader_1x27_P1.27mm_Vertical_SMD_Pin1Left","Connector_PinHeader_1.27mm/PinHeader_1x27_P1.27mm_Vertical_SMD_Pin1Right","Connector_PinHeader_1.27mm/PinHeader_1x28_P1.27mm_Horizontal","Connector_PinHeader_1.27mm/PinHeader_1x28_P1.27mm_Vertical","Connector_PinHeader_1.27mm/PinHeader_1x28_P1.27mm_Vertical_SMD_Pin1Left","Connector_PinHeader_1.27mm/PinHeader_1x28_P1.27mm_Vertical_SMD_Pin1Right","Connector_PinHeader_1.27mm/PinHeader_1x29_P1.27mm_Horizontal","Connector_PinHeader_1.27mm/PinHeader_1x29_P1.27mm_Vertical","Connector_PinHeader_1.27mm/PinHeader_1x29_P1.27mm_Vertical_SMD_Pin1Left","Connector_PinHeader_1.27mm/PinHeader_1x29_P1.27mm_Vertical_SMD_Pin1Right","Connector_PinHeader_1.27mm/PinHeader_1x30_P1.27mm_Horizontal","Connector_PinHeader_1.27mm/PinHeader_1x30_P1.27mm_Vertical","Connector_PinHeader_1.27mm/PinHeader_1x30_P1.27mm_Vertical_SMD_Pin1Left","Connector_PinHeader_1.27mm/PinHeader_1x30_P1.27mm_Vertical_SMD_Pin1Right","Connector_PinHeader_1.27mm/PinHeader_1x31_P1.27mm_Horizontal","Connector_PinHeader_1.27mm/PinHeader_1x31_P1.27mm_Vertical","Connector_PinHeader_1.27mm/PinHeader_1x31_P1.27mm_Vertical_SMD_Pin1Left","Connector_PinHeader_1.27mm/PinHeader_1x31_P1.27mm_Vertical_SMD_Pin1Right","Connector_PinHeader_1.27mm/PinHeader_1x32_P1.27mm_Horizontal","Connector_PinHeader_1.27mm/PinHeader_1x32_P1.27mm_Vertical","Connector_PinHeader_1.27mm/PinHeader_1x32_P1.27mm_Vertical_SMD_Pin1Left","Connector_PinHeader_1.27mm/PinHeader_1x32_P1.27mm_Vertical_SMD_Pin1Right","Connector_PinHeader_1.27mm/PinHeader_1x33_P1.27mm_Horizontal","Connector_PinHeader_1.27mm/PinHeader_1x33_P1.27mm_Vertical","Connector_PinHeader_1.27mm/PinHeader_1x33_P1.27mm_Vertical_SMD_Pin1Left","Connector_PinHeader_1.27mm/PinHeader_1x33_P1.27mm_Vertical_SMD_Pin1Right","Connector_PinHeader_1.27mm/PinHeader_1x34_P1.27mm_Horizontal","Connector_PinHeader_1.27mm/PinHeader_1x34_P1.27mm_Vertical","Connector_PinHeader_1.27mm/PinHeader_1x34_P1.27mm_Vertical_SMD_Pin1Left","Connector_PinHeader_1.27mm/PinHeader_1x34_P1.27mm_Vertical_SMD_Pin1Right","Connector_PinHeader_1.27mm/PinHeader_1x35_P1.27mm_Horizontal","Connector_PinHeader_1.27mm/PinHeader_1x35_P1.27mm_Vertical","Connector_PinHeader_1.27mm/PinHeader_1x35_P1.27mm_Vertical_SMD_Pin1Left","Connector_PinHeader_1.27mm/PinHeader_1x35_P1.27mm_Vertical_SMD_Pin1Right","Connector_PinHeader_1.27mm/PinHeader_1x36_P1.27mm_Horizontal","Connector_PinHeader_1.27mm/PinHeader_1x36_P1.27mm_Vertical","Connector_PinHeader_1.27mm/PinHeader_1x36_P1.27mm_Vertical_SMD_Pin1Left","Connector_PinHeader_1.27mm/PinHeader_1x36_P1.27mm_Vertical_SMD_Pin1Right","Connector_PinHeader_1.27mm/PinHeader_1x37_P1.27mm_Horizontal","Connector_PinHeader_1.27mm/PinHeader_1x37_P1.27mm_Vertical","Connector_PinHeader_1.27mm/PinHeader_1x37_P1.27mm_Vertical_SMD_Pin1Left","Connector_PinHeader_1.27mm/PinHeader_1x37_P1.27mm_Vertical_SMD_Pin1Right","Connector_PinHeader_1.27mm/PinHeader_1x38_P1.27mm_Horizontal","Connector_PinHeader_1.27mm/PinHeader_1x38_P1.27mm_Vertical","Connector_PinHeader_1.27mm/PinHeader_1x38_P1.27mm_Vertical_SMD_Pin1Left","Connector_PinHeader_1.27mm/PinHeader_1x38_P1.27mm_Vertical_SMD_Pin1Right","Connector_PinHeader_1.27mm/PinHeader_1x39_P1.27mm_Horizontal","Connector_PinHeader_1.27mm/PinHeader_1x39_P1.27mm_Vertical","Connector_PinHeader_1.27mm/PinHeader_1x39_P1.27mm_Vertical_SMD_Pin1Left","Connector_PinHeader_1.27mm/PinHeader_1x39_P1.27mm_Vertical_SMD_Pin1Right","Connector_PinHeader_1.27mm/PinHeader_1x40_P1.27mm_Horizontal","Connector_PinHeader_1.27mm/PinHeader_1x40_P1.27mm_Vertical","Connector_PinHeader_1.27mm/PinHeader_1x40_P1.27mm_Vertical_SMD_Pin1Left","Connector_PinHeader_1.27mm/PinHeader_1x40_P1.27mm_Vertical_SMD_Pin1Right","Connector_PinHeader_1.27mm/PinHeader_2x01_P1.27mm_Horizontal","Connector_PinHeader_1.27mm/PinHeader_2x01_P1.27mm_Vertical","Connector_PinHeader_1.27mm/PinHeader_2x01_P1.27mm_Vertical_SMD","Connector_PinHeader_1.27mm/PinHeader_2x02_P1.27mm_Horizontal","Connector_PinHeader_1.27mm/PinHeader_2x02_P1.27mm_Vertical","Connector_PinHeader_1.27mm/PinHeader_2x02_P1.27mm_Vertical_SMD","Connector_PinHeader_1.27mm/PinHeader_2x03_P1.27mm_Horizontal","Connector_PinHeader_1.27mm/PinHeader_2x03_P1.27mm_Vertical","Connector_PinHeader_1.27mm/PinHeader_2x03_P1.27mm_Vertical_SMD","Connector_PinHeader_1.27mm/PinHeader_2x04_P1.27mm_Horizontal","Connector_PinHeader_1.27mm/PinHeader_2x04_P1.27mm_Vertical","Connector_PinHeader_1.27mm/PinHeader_2x04_P1.27mm_Vertical_SMD","Connector_PinHeader_1.27mm/PinHeader_2x05_P1.27mm_Horizontal","Connector_PinHeader_1.27mm/PinHeader_2x05_P1.27mm_Vertical","Connector_PinHeader_1.27mm/PinHeader_2x05_P1.27mm_Vertical_SMD","Connector_PinHeader_1.27mm/PinHeader_2x06_P1.27mm_Horizontal","Connector_PinHeader_1.27mm/PinHeader_2x06_P1.27mm_Vertical","Connector_PinHeader_1.27mm/PinHeader_2x06_P1.27mm_Vertical_SMD","Connector_PinHeader_1.27mm/PinHeader_2x07_P1.27mm_Horizontal","Connector_PinHeader_1.27mm/PinHeader_2x07_P1.27mm_Vertical","Connector_PinHeader_1.27mm/PinHeader_2x07_P1.27mm_Vertical_SMD","Connector_PinHeader_1.27mm/PinHeader_2x08_P1.27mm_Horizontal","Connector_PinHeader_1.27mm/PinHeader_2x08_P1.27mm_Vertical","Connector_PinHeader_1.27mm/PinHeader_2x08_P1.27mm_Vertical_SMD","Connector_PinHeader_1.27mm/PinHeader_2x09_P1.27mm_Horizontal","Connector_PinHeader_1.27mm/PinHeader_2x09_P1.27mm_Vertical","Connector_PinHeader_1.27mm/PinHeader_2x09_P1.27mm_Vertical_SMD","Connector_PinHeader_1.27mm/PinHeader_2x10_P1.27mm_Horizontal","Connector_PinHeader_1.27mm/PinHeader_2x10_P1.27mm_Vertical","Connector_PinHeader_1.27mm/PinHeader_2x10_P1.27mm_Vertical_SMD","Connector_PinHeader_1.27mm/PinHeader_2x11_P1.27mm_Horizontal","Connector_PinHeader_1.27mm/PinHeader_2x11_P1.27mm_Vertical","Connector_PinHeader_1.27mm/PinHeader_2x11_P1.27mm_Vertical_SMD","Connector_PinHeader_1.27mm/PinHeader_2x12_P1.27mm_Horizontal","Connector_PinHeader_1.27mm/PinHeader_2x12_P1.27mm_Vertical","Connector_PinHeader_1.27mm/PinHeader_2x12_P1.27mm_Vertical_SMD","Connector_PinHeader_1.27mm/PinHeader_2x13_P1.27mm_Horizontal","Connector_PinHeader_1.27mm/PinHeader_2x13_P1.27mm_Vertical","Connector_PinHeader_1.27mm/PinHeader_2x13_P1.27mm_Vertical_SMD","Connector_PinHeader_1.27mm/PinHeader_2x14_P1.27mm_Horizontal","Connector_PinHeader_1.27mm/PinHeader_2x14_P1.27mm_Vertical","Connector_PinHeader_1.27mm/PinHeader_2x14_P1.27mm_Vertical_SMD","Connector_PinHeader_1.27mm/PinHeader_2x15_P1.27mm_Horizontal","Connector_PinHeader_1.27mm/PinHeader_2x15_P1.27mm_Vertical","Connector_PinHeader_1.27mm/PinHeader_2x15_P1.27mm_Vertical_SMD","Connector_PinHeader_1.27mm/PinHeader_2x16_P1.27mm_Horizontal","Connector_PinHeader_1.27mm/PinHeader_2x16_P1.27mm_Vertical","Connector_PinHeader_1.27mm/PinHeader_2x16_P1.27mm_Vertical_SMD","Connector_PinHeader_1.27mm/PinHeader_2x17_P1.27mm_Horizontal","Connector_PinHeader_1.27mm/PinHeader_2x17_P1.27mm_Vertical","Connector_PinHeader_1.27mm/PinHeader_2x17_P1.27mm_Vertical_SMD","Connector_PinHeader_1.27mm/PinHeader_2x18_P1.27mm_Horizontal","Connector_PinHeader_1.27mm/PinHeader_2x18_P1.27mm_Vertical","Connector_PinHeader_1.27mm/PinHeader_2x18_P1.27mm_Vertical_SMD","Connector_PinHeader_1.27mm/PinHeader_2x19_P1.27mm_Horizontal","Connector_PinHeader_1.27mm/PinHeader_2x19_P1.27mm_Vertical","Connector_PinHeader_1.27mm/PinHeader_2x19_P1.27mm_Vertical_SMD","Connector_PinHeader_1.27mm/PinHeader_2x20_P1.27mm_Horizontal","Connector_PinHeader_1.27mm/PinHeader_2x20_P1.27mm_Vertical","Connector_PinHeader_1.27mm/PinHeader_2x20_P1.27mm_Vertical_SMD","Connector_PinHeader_1.27mm/PinHeader_2x21_P1.27mm_Horizontal","Connector_PinHeader_1.27mm/PinHeader_2x21_P1.27mm_Vertical","Connector_PinHeader_1.27mm/PinHeader_2x21_P1.27mm_Vertical_SMD","Connector_PinHeader_1.27mm/PinHeader_2x22_P1.27mm_Horizontal","Connector_PinHeader_1.27mm/PinHeader_2x22_P1.27mm_Vertical","Connector_PinHeader_1.27mm/PinHeader_2x22_P1.27mm_Vertical_SMD","Connector_PinHeader_1.27mm/PinHeader_2x23_P1.27mm_Horizontal","Connector_PinHeader_1.27mm/PinHeader_2x23_P1.27mm_Vertical","Connector_PinHeader_1.27mm/PinHeader_2x23_P1.27mm_Vertical_SMD","Connector_PinHeader_1.27mm/PinHeader_2x24_P1.27mm_Horizontal","Connector_PinHeader_1.27mm/PinHeader_2x24_P1.27mm_Vertical","Connector_PinHeader_1.27mm/PinHeader_2x24_P1.27mm_Vertical_SMD","Connector_PinHeader_1.27mm/PinHeader_2x25_P1.27mm_Horizontal","Connector_PinHeader_1.27mm/PinHeader_2x25_P1.27mm_Vertical","Connector_PinHeader_1.27mm/PinHeader_2x25_P1.27mm_Vertical_SMD","Connector_PinHeader_1.27mm/PinHeader_2x26_P1.27mm_Horizontal","Connector_PinHeader_1.27mm/PinHeader_2x26_P1.27mm_Vertical","Connector_PinHeader_1.27mm/PinHeader_2x26_P1.27mm_Vertical_SMD","Connector_PinHeader_1.27mm/PinHeader_2x27_P1.27mm_Horizontal","Connector_PinHeader_1.27mm/PinHeader_2x27_P1.27mm_Vertical","Connector_PinHeader_1.27mm/PinHeader_2x27_P1.27mm_Vertical_SMD","Connector_PinHeader_1.27mm/PinHeader_2x28_P1.27mm_Horizontal","Connector_PinHeader_1.27mm/PinHeader_2x28_P1.27mm_Vertical","Connector_PinHeader_1.27mm/PinHeader_2x28_P1.27mm_Vertical_SMD","Connector_PinHeader_1.27mm/PinHeader_2x29_P1.27mm_Horizontal","Connector_PinHeader_1.27mm/PinHeader_2x29_P1.27mm_Vertical","Connector_PinHeader_1.27mm/PinHeader_2x29_P1.27mm_Vertical_SMD","Connector_PinHeader_1.27mm/PinHeader_2x30_P1.27mm_Horizontal","Connector_PinHeader_1.27mm/PinHeader_2x30_P1.27mm_Vertical","Connector_PinHeader_1.27mm/PinHeader_2x30_P1.27mm_Vertical_SMD","Connector_PinHeader_1.27mm/PinHeader_2x31_P1.27mm_Horizontal","Connector_PinHeader_1.27mm/PinHeader_2x31_P1.27mm_Vertical","Connector_PinHeader_1.27mm/PinHeader_2x31_P1.27mm_Vertical_SMD","Connector_PinHeader_1.27mm/PinHeader_2x32_P1.27mm_Horizontal","Connector_PinHeader_1.27mm/PinHeader_2x32_P1.27mm_Vertical","Connector_PinHeader_1.27mm/PinHeader_2x32_P1.27mm_Vertical_SMD","Connector_PinHeader_1.27mm/PinHeader_2x33_P1.27mm_Horizontal","Connector_PinHeader_1.27mm/PinHeader_2x33_P1.27mm_Vertical","Connector_PinHeader_1.27mm/PinHeader_2x33_P1.27mm_Vertical_SMD","Connector_PinHeader_1.27mm/PinHeader_2x34_P1.27mm_Horizontal","Connector_PinHeader_1.27mm/PinHeader_2x34_P1.27mm_Vertical","Connector_PinHeader_1.27mm/PinHeader_2x34_P1.27mm_Vertical_SMD","Connector_PinHeader_1.27mm/PinHeader_2x35_P1.27mm_Horizontal","Connector_PinHeader_1.27mm/PinHeader_2x35_P1.27mm_Vertical","Connector_PinHeader_1.27mm/PinHeader_2x35_P1.27mm_Vertical_SMD","Connector_PinHeader_1.27mm/PinHeader_2x36_P1.27mm_Horizontal","Connector_PinHeader_1.27mm/PinHeader_2x36_P1.27mm_Vertical","Connector_PinHeader_1.27mm/PinHeader_2x36_P1.27mm_Vertical_SMD","Connector_PinHeader_1.27mm/PinHeader_2x37_P1.27mm_Horizontal","Connector_PinHeader_1.27mm/PinHeader_2x37_P1.27mm_Vertical","Connector_PinHeader_1.27mm/PinHeader_2x37_P1.27mm_Vertical_SMD","Connector_PinHeader_1.27mm/PinHeader_2x38_P1.27mm_Horizontal","Connector_PinHeader_1.27mm/PinHeader_2x38_P1.27mm_Vertical","Connector_PinHeader_1.27mm/PinHeader_2x38_P1.27mm_Vertical_SMD","Connector_PinHeader_1.27mm/PinHeader_2x39_P1.27mm_Horizontal","Connector_PinHeader_1.27mm/PinHeader_2x39_P1.27mm_Vertical","Connector_PinHeader_1.27mm/PinHeader_2x39_P1.27mm_Vertical_SMD","Connector_PinHeader_1.27mm/PinHeader_2x40_P1.27mm_Horizontal","Connector_PinHeader_1.27mm/PinHeader_2x40_P1.27mm_Vertical","Connector_PinHeader_1.27mm/PinHeader_2x40_P1.27mm_Vertical_SMD","Connector_PinHeader_2.00mm/PinHeader_1x01_P2.00mm_Horizontal","Connector_PinHeader_2.00mm/PinHeader_1x01_P2.00mm_Vertical","Connector_PinHeader_2.00mm/PinHeader_1x02_P2.00mm_Horizontal","Connector_PinHeader_2.00mm/PinHeader_1x02_P2.00mm_Vertical","Connector_PinHeader_2.00mm/PinHeader_1x02_P2.00mm_Vertical_SMD_Pin1Left","Connector_PinHeader_2.00mm/PinHeader_1x02_P2.00mm_Vertical_SMD_Pin1Right","Connector_PinHeader_2.00mm/PinHeader_1x03_P2.00mm_Horizontal","Connector_PinHeader_2.00mm/PinHeader_1x03_P2.00mm_Vertical","Connector_PinHeader_2.00mm/PinHeader_1x03_P2.00mm_Vertical_SMD_Pin1Left","Connector_PinHeader_2.00mm/PinHeader_1x03_P2.00mm_Vertical_SMD_Pin1Right","Connector_PinHeader_2.00mm/PinHeader_1x04_P2.00mm_Horizontal","Connector_PinHeader_2.00mm/PinHeader_1x04_P2.00mm_Vertical","Connector_PinHeader_2.00mm/PinHeader_1x04_P2.00mm_Vertical_SMD_Pin1Left","Connector_PinHeader_2.00mm/PinHeader_1x04_P2.00mm_Vertical_SMD_Pin1Right","Connector_PinHeader_2.00mm/PinHeader_1x05_P2.00mm_Horizontal","Connector_PinHeader_2.00mm/PinHeader_1x05_P2.00mm_Vertical","Connector_PinHeader_2.00mm/PinHeader_1x05_P2.00mm_Vertical_SMD_Pin1Left","Connector_PinHeader_2.00mm/PinHeader_1x05_P2.00mm_Vertical_SMD_Pin1Right","Connector_PinHeader_2.00mm/PinHeader_1x06_P2.00mm_Horizontal","Connector_PinHeader_2.00mm/PinHeader_1x06_P2.00mm_Vertical","Connector_PinHeader_2.00mm/PinHeader_1x06_P2.00mm_Vertical_SMD_Pin1Left","Connector_PinHeader_2.00mm/PinHeader_1x06_P2.00mm_Vertical_SMD_Pin1Right","Connector_PinHeader_2.00mm/PinHeader_1x07_P2.00mm_Horizontal","Connector_PinHeader_2.00mm/PinHeader_1x07_P2.00mm_Vertical","Connector_PinHeader_2.00mm/PinHeader_1x07_P2.00mm_Vertical_SMD_Pin1Left","Connector_PinHeader_2.00mm/PinHeader_1x07_P2.00mm_Vertical_SMD_Pin1Right","Connector_PinHeader_2.00mm/PinHeader_1x08_P2.00mm_Horizontal","Connector_PinHeader_2.00mm/PinHeader_1x08_P2.00mm_Vertical","Connector_PinHeader_2.00mm/PinHeader_1x08_P2.00mm_Vertical_SMD_Pin1Left","Connector_PinHeader_2.00mm/PinHeader_1x08_P2.00mm_Vertical_SMD_Pin1Right","Connector_PinHeader_2.00mm/PinHeader_1x09_P2.00mm_Horizontal","Connector_PinHeader_2.00mm/PinHeader_1x09_P2.00mm_Vertical","Connector_PinHeader_2.00mm/PinHeader_1x09_P2.00mm_Vertical_SMD_Pin1Left","Connector_PinHeader_2.00mm/PinHeader_1x09_P2.00mm_Vertical_SMD_Pin1Right","Connector_PinHeader_2.00mm/PinHeader_1x10_P2.00mm_Horizontal","Connector_PinHeader_2.00mm/PinHeader_1x10_P2.00mm_Vertical","Connector_PinHeader_2.00mm/PinHeader_1x10_P2.00mm_Vertical_SMD_Pin1Left","Connector_PinHeader_2.00mm/PinHeader_1x10_P2.00mm_Vertical_SMD_Pin1Right","Connector_PinHeader_2.00mm/PinHeader_1x11_P2.00mm_Horizontal","Connector_PinHeader_2.00mm/PinHeader_1x11_P2.00mm_Vertical","Connector_PinHeader_2.00mm/PinHeader_1x11_P2.00mm_Vertical_SMD_Pin1Left","Connector_PinHeader_2.00mm/PinHeader_1x11_P2.00mm_Vertical_SMD_Pin1Right","Connector_PinHeader_2.00mm/PinHeader_1x12_P2.00mm_Horizontal","Connector_PinHeader_2.00mm/PinHeader_1x12_P2.00mm_Vertical","Connector_PinHeader_2.00mm/PinHeader_1x12_P2.00mm_Vertical_SMD_Pin1Left","Connector_PinHeader_2.00mm/PinHeader_1x12_P2.00mm_Vertical_SMD_Pin1Right","Connector_PinHeader_2.00mm/PinHeader_1x13_P2.00mm_Horizontal","Connector_PinHeader_2.00mm/PinHeader_1x13_P2.00mm_Vertical","Connector_PinHeader_2.00mm/PinHeader_1x13_P2.00mm_Vertical_SMD_Pin1Left","Connector_PinHeader_2.00mm/PinHeader_1x13_P2.00mm_Vertical_SMD_Pin1Right","Connector_PinHeader_2.00mm/PinHeader_1x14_P2.00mm_Horizontal","Connector_PinHeader_2.00mm/PinHeader_1x14_P2.00mm_Vertical","Connector_PinHeader_2.00mm/PinHeader_1x14_P2.00mm_Vertical_SMD_Pin1Left","Connector_PinHeader_2.00mm/PinHeader_1x14_P2.00mm_Vertical_SMD_Pin1Right","Connector_PinHeader_2.00mm/PinHeader_1x15_P2.00mm_Horizontal","Connector_PinHeader_2.00mm/PinHeader_1x15_P2.00mm_Vertical","Connector_PinHeader_2.00mm/PinHeader_1x15_P2.00mm_Vertical_SMD_Pin1Left","Connector_PinHeader_2.00mm/PinHeader_1x15_P2.00mm_Vertical_SMD_Pin1Right","Connector_PinHeader_2.00mm/PinHeader_1x16_P2.00mm_Horizontal","Connector_PinHeader_2.00mm/PinHeader_1x16_P2.00mm_Vertical","Connector_PinHeader_2.00mm/PinHeader_1x16_P2.00mm_Vertical_SMD_Pin1Left","Connector_PinHeader_2.00mm/PinHeader_1x16_P2.00mm_Vertical_SMD_Pin1Right","Connector_PinHeader_2.00mm/PinHeader_1x17_P2.00mm_Horizontal","Connector_PinHeader_2.00mm/PinHeader_1x17_P2.00mm_Vertical","Connector_PinHeader_2.00mm/PinHeader_1x17_P2.00mm_Vertical_SMD_Pin1Left","Connector_PinHeader_2.00mm/PinHeader_1x17_P2.00mm_Vertical_SMD_Pin1Right","Connector_PinHeader_2.00mm/PinHeader_1x18_P2.00mm_Horizontal","Connector_PinHeader_2.00mm/PinHeader_1x18_P2.00mm_Vertical","Connector_PinHeader_2.00mm/PinHeader_1x18_P2.00mm_Vertical_SMD_Pin1Left","Connector_PinHeader_2.00mm/PinHeader_1x18_P2.00mm_Vertical_SMD_Pin1Right","Connector_PinHeader_2.00mm/PinHeader_1x19_P2.00mm_Horizontal","Connector_PinHeader_2.00mm/PinHeader_1x19_P2.00mm_Vertical","Connector_PinHeader_2.00mm/PinHeader_1x19_P2.00mm_Vertical_SMD_Pin1Left","Connector_PinHeader_2.00mm/PinHeader_1x19_P2.00mm_Vertical_SMD_Pin1Right","Connector_PinHeader_2.00mm/PinHeader_1x20_P2.00mm_Horizontal","Connector_PinHeader_2.00mm/PinHeader_1x20_P2.00mm_Vertical","Connector_PinHeader_2.00mm/PinHeader_1x20_P2.00mm_Vertical_SMD_Pin1Left","Connector_PinHeader_2.00mm/PinHeader_1x20_P2.00mm_Vertical_SMD_Pin1Right","Connector_PinHeader_2.00mm/PinHeader_1x21_P2.00mm_Horizontal","Connector_PinHeader_2.00mm/PinHeader_1x21_P2.00mm_Vertical","Connector_PinHeader_2.00mm/PinHeader_1x21_P2.00mm_Vertical_SMD_Pin1Left","Connector_PinHeader_2.00mm/PinHeader_1x21_P2.00mm_Vertical_SMD_Pin1Right","Connector_PinHeader_2.00mm/PinHeader_1x22_P2.00mm_Horizontal","Connector_PinHeader_2.00mm/PinHeader_1x22_P2.00mm_Vertical","Connector_PinHeader_2.00mm/PinHeader_1x22_P2.00mm_Vertical_SMD_Pin1Left","Connector_PinHeader_2.00mm/PinHeader_1x22_P2.00mm_Vertical_SMD_Pin1Right","Connector_PinHeader_2.00mm/PinHeader_1x23_P2.00mm_Horizontal","Connector_PinHeader_2.00mm/PinHeader_1x23_P2.00mm_Vertical","Connector_PinHeader_2.00mm/PinHeader_1x23_P2.00mm_Vertical_SMD_Pin1Left","Connector_PinHeader_2.00mm/PinHeader_1x23_P2.00mm_Vertical_SMD_Pin1Right","Connector_PinHeader_2.00mm/PinHeader_1x24_P2.00mm_Horizontal","Connector_PinHeader_2.00mm/PinHeader_1x24_P2.00mm_Vertical","Connector_PinHeader_2.00mm/PinHeader_1x24_P2.00mm_Vertical_SMD_Pin1Left","Connector_PinHeader_2.00mm/PinHeader_1x24_P2.00mm_Vertical_SMD_Pin1Right","Connector_PinHeader_2.00mm/PinHeader_1x25_P2.00mm_Horizontal","Connector_PinHeader_2.00mm/PinHeader_1x25_P2.00mm_Vertical","Connector_PinHeader_2.00mm/PinHeader_1x25_P2.00mm_Vertical_SMD_Pin1Left","Connector_PinHeader_2.00mm/PinHeader_1x25_P2.00mm_Vertical_SMD_Pin1Right","Connector_PinHeader_2.00mm/PinHeader_1x26_P2.00mm_Horizontal","Connector_PinHeader_2.00mm/PinHeader_1x26_P2.00mm_Vertical","Connector_PinHeader_2.00mm/PinHeader_1x26_P2.00mm_Vertical_SMD_Pin1Left","Connector_PinHeader_2.00mm/PinHeader_1x26_P2.00mm_Vertical_SMD_Pin1Right","Connector_PinHeader_2.00mm/PinHeader_1x27_P2.00mm_Horizontal","Connector_PinHeader_2.00mm/PinHeader_1x27_P2.00mm_Vertical","Connector_PinHeader_2.00mm/PinHeader_1x27_P2.00mm_Vertical_SMD_Pin1Left","Connector_PinHeader_2.00mm/PinHeader_1x27_P2.00mm_Vertical_SMD_Pin1Right","Connector_PinHeader_2.00mm/PinHeader_1x28_P2.00mm_Horizontal","Connector_PinHeader_2.00mm/PinHeader_1x28_P2.00mm_Vertical","Connector_PinHeader_2.00mm/PinHeader_1x28_P2.00mm_Vertical_SMD_Pin1Left","Connector_PinHeader_2.00mm/PinHeader_1x28_P2.00mm_Vertical_SMD_Pin1Right","Connector_PinHeader_2.00mm/PinHeader_1x29_P2.00mm_Horizontal","Connector_PinHeader_2.00mm/PinHeader_1x29_P2.00mm_Vertical","Connector_PinHeader_2.00mm/PinHeader_1x29_P2.00mm_Vertical_SMD_Pin1Left","Connector_PinHeader_2.00mm/PinHeader_1x29_P2.00mm_Vertical_SMD_Pin1Right","Connector_PinHeader_2.00mm/PinHeader_1x30_P2.00mm_Horizontal","Connector_PinHeader_2.00mm/PinHeader_1x30_P2.00mm_Vertical","Connector_PinHeader_2.00mm/PinHeader_1x30_P2.00mm_Vertical_SMD_Pin1Left","Connector_PinHeader_2.00mm/PinHeader_1x30_P2.00mm_Vertical_SMD_Pin1Right","Connector_PinHeader_2.00mm/PinHeader_1x31_P2.00mm_Horizontal","Connector_PinHeader_2.00mm/PinHeader_1x31_P2.00mm_Vertical","Connector_PinHeader_2.00mm/PinHeader_1x31_P2.00mm_Vertical_SMD_Pin1Left","Connector_PinHeader_2.00mm/PinHeader_1x31_P2.00mm_Vertical_SMD_Pin1Right","Connector_PinHeader_2.00mm/PinHeader_1x32_P2.00mm_Horizontal","Connector_PinHeader_2.00mm/PinHeader_1x32_P2.00mm_Vertical","Connector_PinHeader_2.00mm/PinHeader_1x32_P2.00mm_Vertical_SMD_Pin1Left","Connector_PinHeader_2.00mm/PinHeader_1x32_P2.00mm_Vertical_SMD_Pin1Right","Connector_PinHeader_2.00mm/PinHeader_1x33_P2.00mm_Horizontal","Connector_PinHeader_2.00mm/PinHeader_1x33_P2.00mm_Vertical","Connector_PinHeader_2.00mm/PinHeader_1x33_P2.00mm_Vertical_SMD_Pin1Left","Connector_PinHeader_2.00mm/PinHeader_1x33_P2.00mm_Vertical_SMD_Pin1Right","Connector_PinHeader_2.00mm/PinHeader_1x34_P2.00mm_Horizontal","Connector_PinHeader_2.00mm/PinHeader_1x34_P2.00mm_Vertical","Connector_PinHeader_2.00mm/PinHeader_1x34_P2.00mm_Vertical_SMD_Pin1Left","Connector_PinHeader_2.00mm/PinHeader_1x34_P2.00mm_Vertical_SMD_Pin1Right","Connector_PinHeader_2.00mm/PinHeader_1x35_P2.00mm_Horizontal","Connector_PinHeader_2.00mm/PinHeader_1x35_P2.00mm_Vertical","Connector_PinHeader_2.00mm/PinHeader_1x35_P2.00mm_Vertical_SMD_Pin1Left","Connector_PinHeader_2.00mm/PinHeader_1x35_P2.00mm_Vertical_SMD_Pin1Right","Connector_PinHeader_2.00mm/PinHeader_1x36_P2.00mm_Horizontal","Connector_PinHeader_2.00mm/PinHeader_1x36_P2.00mm_Vertical","Connector_PinHeader_2.00mm/PinHeader_1x36_P2.00mm_Vertical_SMD_Pin1Left","Connector_PinHeader_2.00mm/PinHeader_1x36_P2.00mm_Vertical_SMD_Pin1Right","Connector_PinHeader_2.00mm/PinHeader_1x37_P2.00mm_Horizontal","Connector_PinHeader_2.00mm/PinHeader_1x37_P2.00mm_Vertical","Connector_PinHeader_2.00mm/PinHeader_1x37_P2.00mm_Vertical_SMD_Pin1Left","Connector_PinHeader_2.00mm/PinHeader_1x37_P2.00mm_Vertical_SMD_Pin1Right","Connector_PinHeader_2.00mm/PinHeader_1x38_P2.00mm_Horizontal","Connector_PinHeader_2.00mm/PinHeader_1x38_P2.00mm_Vertical","Connector_PinHeader_2.00mm/PinHeader_1x38_P2.00mm_Vertical_SMD_Pin1Left","Connector_PinHeader_2.00mm/PinHeader_1x38_P2.00mm_Vertical_SMD_Pin1Right","Connector_PinHeader_2.00mm/PinHeader_1x39_P2.00mm_Horizontal","Connector_PinHeader_2.00mm/PinHeader_1x39_P2.00mm_Vertical","Connector_PinHeader_2.00mm/PinHeader_1x39_P2.00mm_Vertical_SMD_Pin1Left","Connector_PinHeader_2.00mm/PinHeader_1x39_P2.00mm_Vertical_SMD_Pin1Right","Connector_PinHeader_2.00mm/PinHeader_1x40_P2.00mm_Horizontal","Connector_PinHeader_2.00mm/PinHeader_1x40_P2.00mm_Vertical","Connector_PinHeader_2.00mm/PinHeader_1x40_P2.00mm_Vertical_SMD_Pin1Left","Connector_PinHeader_2.00mm/PinHeader_1x40_P2.00mm_Vertical_SMD_Pin1Right","Connector_PinHeader_2.00mm/PinHeader_2x01_P2.00mm_Horizontal","Connector_PinHeader_2.00mm/PinHeader_2x01_P2.00mm_Vertical","Connector_PinHeader_2.00mm/PinHeader_2x01_P2.00mm_Vertical_SMD","Connector_PinHeader_2.00mm/PinHeader_2x02_P2.00mm_Horizontal","Connector_PinHeader_2.00mm/PinHeader_2x02_P2.00mm_Vertical","Connector_PinHeader_2.00mm/PinHeader_2x02_P2.00mm_Vertical_SMD","Connector_PinHeader_2.00mm/PinHeader_2x03_P2.00mm_Horizontal","Connector_PinHeader_2.00mm/PinHeader_2x03_P2.00mm_Vertical","Connector_PinHeader_2.00mm/PinHeader_2x03_P2.00mm_Vertical_SMD","Connector_PinHeader_2.00mm/PinHeader_2x04_P2.00mm_Horizontal","Connector_PinHeader_2.00mm/PinHeader_2x04_P2.00mm_Vertical","Connector_PinHeader_2.00mm/PinHeader_2x04_P2.00mm_Vertical_SMD","Connector_PinHeader_2.00mm/PinHeader_2x05_P2.00mm_Horizontal","Connector_PinHeader_2.00mm/PinHeader_2x05_P2.00mm_Vertical","Connector_PinHeader_2.00mm/PinHeader_2x05_P2.00mm_Vertical_SMD","Connector_PinHeader_2.00mm/PinHeader_2x06_P2.00mm_Horizontal","Connector_PinHeader_2.00mm/PinHeader_2x06_P2.00mm_Vertical","Connector_PinHeader_2.00mm/PinHeader_2x06_P2.00mm_Vertical_SMD","Connector_PinHeader_2.00mm/PinHeader_2x07_P2.00mm_Horizontal","Connector_PinHeader_2.00mm/PinHeader_2x07_P2.00mm_Vertical","Connector_PinHeader_2.00mm/PinHeader_2x07_P2.00mm_Vertical_SMD","Connector_PinHeader_2.00mm/PinHeader_2x08_P2.00mm_Horizontal","Connector_PinHeader_2.00mm/PinHeader_2x08_P2.00mm_Vertical","Connector_PinHeader_2.00mm/PinHeader_2x08_P2.00mm_Vertical_SMD","Connector_PinHeader_2.00mm/PinHeader_2x09_P2.00mm_Horizontal","Connector_PinHeader_2.00mm/PinHeader_2x09_P2.00mm_Vertical","Connector_PinHeader_2.00mm/PinHeader_2x09_P2.00mm_Vertical_SMD","Connector_PinHeader_2.00mm/PinHeader_2x10_P2.00mm_Horizontal","Connector_PinHeader_2.00mm/PinHeader_2x10_P2.00mm_Vertical","Connector_PinHeader_2.00mm/PinHeader_2x10_P2.00mm_Vertical_SMD","Connector_PinHeader_2.00mm/PinHeader_2x11_P2.00mm_Horizontal","Connector_PinHeader_2.00mm/PinHeader_2x11_P2.00mm_Vertical","Connector_PinHeader_2.00mm/PinHeader_2x11_P2.00mm_Vertical_SMD","Connector_PinHeader_2.00mm/PinHeader_2x12_P2.00mm_Horizontal","Connector_PinHeader_2.00mm/PinHeader_2x12_P2.00mm_Vertical","Connector_PinHeader_2.00mm/PinHeader_2x12_P2.00mm_Vertical_SMD","Connector_PinHeader_2.00mm/PinHeader_2x13_P2.00mm_Horizontal","Connector_PinHeader_2.00mm/PinHeader_2x13_P2.00mm_Vertical","Connector_PinHeader_2.00mm/PinHeader_2x13_P2.00mm_Vertical_SMD","Connector_PinHeader_2.00mm/PinHeader_2x14_P2.00mm_Horizontal","Connector_PinHeader_2.00mm/PinHeader_2x14_P2.00mm_Vertical","Connector_PinHeader_2.00mm/PinHeader_2x14_P2.00mm_Vertical_SMD","Connector_PinHeader_2.00mm/PinHeader_2x15_P2.00mm_Horizontal","Connector_PinHeader_2.00mm/PinHeader_2x15_P2.00mm_Vertical","Connector_PinHeader_2.00mm/PinHeader_2x15_P2.00mm_Vertical_SMD","Connector_PinHeader_2.00mm/PinHeader_2x16_P2.00mm_Horizontal","Connector_PinHeader_2.00mm/PinHeader_2x16_P2.00mm_Vertical","Connector_PinHeader_2.00mm/PinHeader_2x16_P2.00mm_Vertical_SMD","Connector_PinHeader_2.00mm/PinHeader_2x17_P2.00mm_Horizontal","Connector_PinHeader_2.00mm/PinHeader_2x17_P2.00mm_Vertical","Connector_PinHeader_2.00mm/PinHeader_2x17_P2.00mm_Vertical_SMD","Connector_PinHeader_2.00mm/PinHeader_2x18_P2.00mm_Horizontal","Connector_PinHeader_2.00mm/PinHeader_2x18_P2.00mm_Vertical","Connector_PinHeader_2.00mm/PinHeader_2x18_P2.00mm_Vertical_SMD","Connector_PinHeader_2.00mm/PinHeader_2x19_P2.00mm_Horizontal","Connector_PinHeader_2.00mm/PinHeader_2x19_P2.00mm_Vertical","Connector_PinHeader_2.00mm/PinHeader_2x19_P2.00mm_Vertical_SMD","Connector_PinHeader_2.00mm/PinHeader_2x20_P2.00mm_Horizontal","Connector_PinHeader_2.00mm/PinHeader_2x20_P2.00mm_Vertical","Connector_PinHeader_2.00mm/PinHeader_2x20_P2.00mm_Vertical_SMD","Connector_PinHeader_2.00mm/PinHeader_2x21_P2.00mm_Horizontal","Connector_PinHeader_2.00mm/PinHeader_2x21_P2.00mm_Vertical","Connector_PinHeader_2.00mm/PinHeader_2x21_P2.00mm_Vertical_SMD","Connector_PinHeader_2.00mm/PinHeader_2x22_P2.00mm_Horizontal","Connector_PinHeader_2.00mm/PinHeader_2x22_P2.00mm_Vertical","Connector_PinHeader_2.00mm/PinHeader_2x22_P2.00mm_Vertical_SMD","Connector_PinHeader_2.00mm/PinHeader_2x23_P2.00mm_Horizontal","Connector_PinHeader_2.00mm/PinHeader_2x23_P2.00mm_Vertical","Connector_PinHeader_2.00mm/PinHeader_2x23_P2.00mm_Vertical_SMD","Connector_PinHeader_2.00mm/PinHeader_2x24_P2.00mm_Horizontal","Connector_PinHeader_2.00mm/PinHeader_2x24_P2.00mm_Vertical","Connector_PinHeader_2.00mm/PinHeader_2x24_P2.00mm_Vertical_SMD","Connector_PinHeader_2.00mm/PinHeader_2x25_P2.00mm_Horizontal","Connector_PinHeader_2.00mm/PinHeader_2x25_P2.00mm_Vertical","Connector_PinHeader_2.00mm/PinHeader_2x25_P2.00mm_Vertical_SMD","Connector_PinHeader_2.00mm/PinHeader_2x26_P2.00mm_Horizontal","Connector_PinHeader_2.00mm/PinHeader_2x26_P2.00mm_Vertical","Connector_PinHeader_2.00mm/PinHeader_2x26_P2.00mm_Vertical_SMD","Connector_PinHeader_2.00mm/PinHeader_2x27_P2.00mm_Horizontal","Connector_PinHeader_2.00mm/PinHeader_2x27_P2.00mm_Vertical","Connector_PinHeader_2.00mm/PinHeader_2x27_P2.00mm_Vertical_SMD","Connector_PinHeader_2.00mm/PinHeader_2x28_P2.00mm_Horizontal","Connector_PinHeader_2.00mm/PinHeader_2x28_P2.00mm_Vertical","Connector_PinHeader_2.00mm/PinHeader_2x28_P2.00mm_Vertical_SMD","Connector_PinHeader_2.00mm/PinHeader_2x29_P2.00mm_Horizontal","Connector_PinHeader_2.00mm/PinHeader_2x29_P2.00mm_Vertical","Connector_PinHeader_2.00mm/PinHeader_2x29_P2.00mm_Vertical_SMD","Connector_PinHeader_2.00mm/PinHeader_2x30_P2.00mm_Horizontal","Connector_PinHeader_2.00mm/PinHeader_2x30_P2.00mm_Vertical","Connector_PinHeader_2.00mm/PinHeader_2x30_P2.00mm_Vertical_SMD","Connector_PinHeader_2.00mm/PinHeader_2x31_P2.00mm_Horizontal","Connector_PinHeader_2.00mm/PinHeader_2x31_P2.00mm_Vertical","Connector_PinHeader_2.00mm/PinHeader_2x31_P2.00mm_Vertical_SMD","Connector_PinHeader_2.00mm/PinHeader_2x32_P2.00mm_Horizontal","Connector_PinHeader_2.00mm/PinHeader_2x32_P2.00mm_Vertical","Connector_PinHeader_2.00mm/PinHeader_2x32_P2.00mm_Vertical_SMD","Connector_PinHeader_2.00mm/PinHeader_2x33_P2.00mm_Horizontal","Connector_PinHeader_2.00mm/PinHeader_2x33_P2.00mm_Vertical","Connector_PinHeader_2.00mm/PinHeader_2x33_P2.00mm_Vertical_SMD","Connector_PinHeader_2.00mm/PinHeader_2x34_P2.00mm_Horizontal","Connector_PinHeader_2.00mm/PinHeader_2x34_P2.00mm_Vertical","Connector_PinHeader_2.00mm/PinHeader_2x34_P2.00mm_Vertical_SMD","Connector_PinHeader_2.00mm/PinHeader_2x35_P2.00mm_Horizontal","Connector_PinHeader_2.00mm/PinHeader_2x35_P2.00mm_Vertical","Connector_PinHeader_2.00mm/PinHeader_2x35_P2.00mm_Vertical_SMD","Connector_PinHeader_2.00mm/PinHeader_2x36_P2.00mm_Horizontal","Connector_PinHeader_2.00mm/PinHeader_2x36_P2.00mm_Vertical","Connector_PinHeader_2.00mm/PinHeader_2x36_P2.00mm_Vertical_SMD","Connector_PinHeader_2.00mm/PinHeader_2x37_P2.00mm_Horizontal","Connector_PinHeader_2.00mm/PinHeader_2x37_P2.00mm_Vertical","Connector_PinHeader_2.00mm/PinHeader_2x37_P2.00mm_Vertical_SMD","Connector_PinHeader_2.00mm/PinHeader_2x38_P2.00mm_Horizontal","Connector_PinHeader_2.00mm/PinHeader_2x38_P2.00mm_Vertical","Connector_PinHeader_2.00mm/PinHeader_2x38_P2.00mm_Vertical_SMD","Connector_PinHeader_2.00mm/PinHeader_2x39_P2.00mm_Horizontal","Connector_PinHeader_2.00mm/PinHeader_2x39_P2.00mm_Vertical","Connector_PinHeader_2.00mm/PinHeader_2x39_P2.00mm_Vertical_SMD","Connector_PinHeader_2.00mm/PinHeader_2x40_P2.00mm_Horizontal","Connector_PinHeader_2.00mm/PinHeader_2x40_P2.00mm_Vertical","Connector_PinHeader_2.00mm/PinHeader_2x40_P2.00mm_Vertical_SMD","Connector_PinHeader_2.54mm/PinHeader_1x01_P2.54mm_Horizontal","Connector_PinHeader_2.54mm/PinHeader_1x01_P2.54mm_Vertical","Connector_PinHeader_2.54mm/PinHeader_1x02_P2.54mm_Horizontal","Connector_PinHeader_2.54mm/PinHeader_1x02_P2.54mm_Vertical","Connector_PinHeader_2.54mm/PinHeader_1x02_P2.54mm_Vertical_SMD_Pin1Left","Connector_PinHeader_2.54mm/PinHeader_1x02_P2.54mm_Vertical_SMD_Pin1Right","Connector_PinHeader_2.54mm/PinHeader_1x03_P2.54mm_Horizontal","Connector_PinHeader_2.54mm/PinHeader_1x03_P2.54mm_Vertical","Connector_PinHeader_2.54mm/PinHeader_1x03_P2.54mm_Vertical_SMD_Pin1Left","Connector_PinHeader_2.54mm/PinHeader_1x03_P2.54mm_Vertical_SMD_Pin1Right","Connector_PinHeader_2.54mm/PinHeader_1x04_P2.54mm_Horizontal","Connector_PinHeader_2.54mm/PinHeader_1x04_P2.54mm_Vertical","Connector_PinHeader_2.54mm/PinHeader_1x04_P2.54mm_Vertical_SMD_Pin1Left","Connector_PinHeader_2.54mm/PinHeader_1x04_P2.54mm_Vertical_SMD_Pin1Right","Connector_PinHeader_2.54mm/PinHeader_1x05_P2.54mm_Horizontal","Connector_PinHeader_2.54mm/PinHeader_1x05_P2.54mm_Vertical","Connector_PinHeader_2.54mm/PinHeader_1x05_P2.54mm_Vertical_SMD_Pin1Left","Connector_PinHeader_2.54mm/PinHeader_1x05_P2.54mm_Vertical_SMD_Pin1Right","Connector_PinHeader_2.54mm/PinHeader_1x06_P2.54mm_Horizontal","Connector_PinHeader_2.54mm/PinHeader_1x06_P2.54mm_Vertical","Connector_PinHeader_2.54mm/PinHeader_1x06_P2.54mm_Vertical_SMD_Pin1Left","Connector_PinHeader_2.54mm/PinHeader_1x06_P2.54mm_Vertical_SMD_Pin1Right","Connector_PinHeader_2.54mm/PinHeader_1x07_P2.54mm_Horizontal","Connector_PinHeader_2.54mm/PinHeader_1x07_P2.54mm_Vertical","Connector_PinHeader_2.54mm/PinHeader_1x07_P2.54mm_Vertical_SMD_Pin1Left","Connector_PinHeader_2.54mm/PinHeader_1x07_P2.54mm_Vertical_SMD_Pin1Right","Connector_PinHeader_2.54mm/PinHeader_1x08_P2.54mm_Horizontal","Connector_PinHeader_2.54mm/PinHeader_1x08_P2.54mm_Vertical","Connector_PinHeader_2.54mm/PinHeader_1x08_P2.54mm_Vertical_SMD_Pin1Left","Connector_PinHeader_2.54mm/PinHeader_1x08_P2.54mm_Vertical_SMD_Pin1Right","Connector_PinHeader_2.54mm/PinHeader_1x09_P2.54mm_Horizontal","Connector_PinHeader_2.54mm/PinHeader_1x09_P2.54mm_Vertical","Connector_PinHeader_2.54mm/PinHeader_1x09_P2.54mm_Vertical_SMD_Pin1Left","Connector_PinHeader_2.54mm/PinHeader_1x09_P2.54mm_Vertical_SMD_Pin1Right","Connector_PinHeader_2.54mm/PinHeader_1x10_P2.54mm_Horizontal","Connector_PinHeader_2.54mm/PinHeader_1x10_P2.54mm_Vertical","Connector_PinHeader_2.54mm/PinHeader_1x10_P2.54mm_Vertical_SMD_Pin1Left","Connector_PinHeader_2.54mm/PinHeader_1x10_P2.54mm_Vertical_SMD_Pin1Right","Connector_PinHeader_2.54mm/PinHeader_1x11_P2.54mm_Horizontal","Connector_PinHeader_2.54mm/PinHeader_1x11_P2.54mm_Vertical","Connector_PinHeader_2.54mm/PinHeader_1x11_P2.54mm_Vertical_SMD_Pin1Left","Connector_PinHeader_2.54mm/PinHeader_1x11_P2.54mm_Vertical_SMD_Pin1Right","Connector_PinHeader_2.54mm/PinHeader_1x12_P2.54mm_Horizontal","Connector_PinHeader_2.54mm/PinHeader_1x12_P2.54mm_Vertical","Connector_PinHeader_2.54mm/PinHeader_1x12_P2.54mm_Vertical_SMD_Pin1Left","Connector_PinHeader_2.54mm/PinHeader_1x12_P2.54mm_Vertical_SMD_Pin1Right","Connector_PinHeader_2.54mm/PinHeader_1x13_P2.54mm_Horizontal","Connector_PinHeader_2.54mm/PinHeader_1x13_P2.54mm_Vertical","Connector_PinHeader_2.54mm/PinHeader_1x13_P2.54mm_Vertical_SMD_Pin1Left","Connector_PinHeader_2.54mm/PinHeader_1x13_P2.54mm_Vertical_SMD_Pin1Right","Connector_PinHeader_2.54mm/PinHeader_1x14_P2.54mm_Horizontal","Connector_PinHeader_2.54mm/PinHeader_1x14_P2.54mm_Vertical","Connector_PinHeader_2.54mm/PinHeader_1x14_P2.54mm_Vertical_SMD_Pin1Left","Connector_PinHeader_2.54mm/PinHeader_1x14_P2.54mm_Vertical_SMD_Pin1Right","Connector_PinHeader_2.54mm/PinHeader_1x15_P2.54mm_Horizontal","Connector_PinHeader_2.54mm/PinHeader_1x15_P2.54mm_Vertical","Connector_PinHeader_2.54mm/PinHeader_1x15_P2.54mm_Vertical_SMD_Pin1Left","Connector_PinHeader_2.54mm/PinHeader_1x15_P2.54mm_Vertical_SMD_Pin1Right","Connector_PinHeader_2.54mm/PinHeader_1x16_P2.54mm_Horizontal","Connector_PinHeader_2.54mm/PinHeader_1x16_P2.54mm_Vertical","Connector_PinHeader_2.54mm/PinHeader_1x16_P2.54mm_Vertical_SMD_Pin1Left","Connector_PinHeader_2.54mm/PinHeader_1x16_P2.54mm_Vertical_SMD_Pin1Right","Connector_PinHeader_2.54mm/PinHeader_1x17_P2.54mm_Horizontal","Connector_PinHeader_2.54mm/PinHeader_1x17_P2.54mm_Vertical","Connector_PinHeader_2.54mm/PinHeader_1x17_P2.54mm_Vertical_SMD_Pin1Left","Connector_PinHeader_2.54mm/PinHeader_1x17_P2.54mm_Vertical_SMD_Pin1Right","Connector_PinHeader_2.54mm/PinHeader_1x18_P2.54mm_Horizontal","Connector_PinHeader_2.54mm/PinHeader_1x18_P2.54mm_Vertical","Connector_PinHeader_2.54mm/PinHeader_1x18_P2.54mm_Vertical_SMD_Pin1Left","Connector_PinHeader_2.54mm/PinHeader_1x18_P2.54mm_Vertical_SMD_Pin1Right","Connector_PinHeader_2.54mm/PinHeader_1x19_P2.54mm_Horizontal","Connector_PinHeader_2.54mm/PinHeader_1x19_P2.54mm_Vertical","Connector_PinHeader_2.54mm/PinHeader_1x19_P2.54mm_Vertical_SMD_Pin1Left","Connector_PinHeader_2.54mm/PinHeader_1x19_P2.54mm_Vertical_SMD_Pin1Right","Connector_PinHeader_2.54mm/PinHeader_1x20_P2.54mm_Horizontal","Connector_PinHeader_2.54mm/PinHeader_1x20_P2.54mm_Vertical","Connector_PinHeader_2.54mm/PinHeader_1x20_P2.54mm_Vertical_SMD_Pin1Left","Connector_PinHeader_2.54mm/PinHeader_1x20_P2.54mm_Vertical_SMD_Pin1Right","Connector_PinHeader_2.54mm/PinHeader_1x21_P2.54mm_Horizontal","Connector_PinHeader_2.54mm/PinHeader_1x21_P2.54mm_Vertical","Connector_PinHeader_2.54mm/PinHeader_1x21_P2.54mm_Vertical_SMD_Pin1Left","Connector_PinHeader_2.54mm/PinHeader_1x21_P2.54mm_Vertical_SMD_Pin1Right","Connector_PinHeader_2.54mm/PinHeader_1x22_P2.54mm_Horizontal","Connector_PinHeader_2.54mm/PinHeader_1x22_P2.54mm_Vertical","Connector_PinHeader_2.54mm/PinHeader_1x22_P2.54mm_Vertical_SMD_Pin1Left","Connector_PinHeader_2.54mm/PinHeader_1x22_P2.54mm_Vertical_SMD_Pin1Right","Connector_PinHeader_2.54mm/PinHeader_1x23_P2.54mm_Horizontal","Connector_PinHeader_2.54mm/PinHeader_1x23_P2.54mm_Vertical","Connector_PinHeader_2.54mm/PinHeader_1x23_P2.54mm_Vertical_SMD_Pin1Left","Connector_PinHeader_2.54mm/PinHeader_1x23_P2.54mm_Vertical_SMD_Pin1Right","Connector_PinHeader_2.54mm/PinHeader_1x24_P2.54mm_Horizontal","Connector_PinHeader_2.54mm/PinHeader_1x24_P2.54mm_Vertical","Connector_PinHeader_2.54mm/PinHeader_1x24_P2.54mm_Vertical_SMD_Pin1Left","Connector_PinHeader_2.54mm/PinHeader_1x24_P2.54mm_Vertical_SMD_Pin1Right","Connector_PinHeader_2.54mm/PinHeader_1x25_P2.54mm_Horizontal","Connector_PinHeader_2.54mm/PinHeader_1x25_P2.54mm_Vertical","Connector_PinHeader_2.54mm/PinHeader_1x25_P2.54mm_Vertical_SMD_Pin1Left","Connector_PinHeader_2.54mm/PinHeader_1x25_P2.54mm_Vertical_SMD_Pin1Right","Connector_PinHeader_2.54mm/PinHeader_1x26_P2.54mm_Horizontal","Connector_PinHeader_2.54mm/PinHeader_1x26_P2.54mm_Vertical","Connector_PinHeader_2.54mm/PinHeader_1x26_P2.54mm_Vertical_SMD_Pin1Left","Connector_PinHeader_2.54mm/PinHeader_1x26_P2.54mm_Vertical_SMD_Pin1Right","Connector_PinHeader_2.54mm/PinHeader_1x27_P2.54mm_Horizontal","Connector_PinHeader_2.54mm/PinHeader_1x27_P2.54mm_Vertical","Connector_PinHeader_2.54mm/PinHeader_1x27_P2.54mm_Vertical_SMD_Pin1Left","Connector_PinHeader_2.54mm/PinHeader_1x27_P2.54mm_Vertical_SMD_Pin1Right","Connector_PinHeader_2.54mm/PinHeader_1x28_P2.54mm_Horizontal","Connector_PinHeader_2.54mm/PinHeader_1x28_P2.54mm_Vertical","Connector_PinHeader_2.54mm/PinHeader_1x28_P2.54mm_Vertical_SMD_Pin1Left","Connector_PinHeader_2.54mm/PinHeader_1x28_P2.54mm_Vertical_SMD_Pin1Right","Connector_PinHeader_2.54mm/PinHeader_1x29_P2.54mm_Horizontal","Connector_PinHeader_2.54mm/PinHeader_1x29_P2.54mm_Vertical","Connector_PinHeader_2.54mm/PinHeader_1x29_P2.54mm_Vertical_SMD_Pin1Left","Connector_PinHeader_2.54mm/PinHeader_1x29_P2.54mm_Vertical_SMD_Pin1Right","Connector_PinHeader_2.54mm/PinHeader_1x30_P2.54mm_Horizontal","Connector_PinHeader_2.54mm/PinHeader_1x30_P2.54mm_Vertical","Connector_PinHeader_2.54mm/PinHeader_1x30_P2.54mm_Vertical_SMD_Pin1Left","Connector_PinHeader_2.54mm/PinHeader_1x30_P2.54mm_Vertical_SMD_Pin1Right","Connector_PinHeader_2.54mm/PinHeader_1x31_P2.54mm_Horizontal","Connector_PinHeader_2.54mm/PinHeader_1x31_P2.54mm_Vertical","Connector_PinHeader_2.54mm/PinHeader_1x31_P2.54mm_Vertical_SMD_Pin1Left","Connector_PinHeader_2.54mm/PinHeader_1x31_P2.54mm_Vertical_SMD_Pin1Right","Connector_PinHeader_2.54mm/PinHeader_1x32_P2.54mm_Horizontal","Connector_PinHeader_2.54mm/PinHeader_1x32_P2.54mm_Vertical","Connector_PinHeader_2.54mm/PinHeader_1x32_P2.54mm_Vertical_SMD_Pin1Left","Connector_PinHeader_2.54mm/PinHeader_1x32_P2.54mm_Vertical_SMD_Pin1Right","Connector_PinHeader_2.54mm/PinHeader_1x33_P2.54mm_Horizontal","Connector_PinHeader_2.54mm/PinHeader_1x33_P2.54mm_Vertical","Connector_PinHeader_2.54mm/PinHeader_1x33_P2.54mm_Vertical_SMD_Pin1Left","Connector_PinHeader_2.54mm/PinHeader_1x33_P2.54mm_Vertical_SMD_Pin1Right","Connector_PinHeader_2.54mm/PinHeader_1x34_P2.54mm_Horizontal","Connector_PinHeader_2.54mm/PinHeader_1x34_P2.54mm_Vertical","Connector_PinHeader_2.54mm/PinHeader_1x34_P2.54mm_Vertical_SMD_Pin1Left","Connector_PinHeader_2.54mm/PinHeader_1x34_P2.54mm_Vertical_SMD_Pin1Right","Connector_PinHeader_2.54mm/PinHeader_1x35_P2.54mm_Horizontal","Connector_PinHeader_2.54mm/PinHeader_1x35_P2.54mm_Vertical","Connector_PinHeader_2.54mm/PinHeader_1x35_P2.54mm_Vertical_SMD_Pin1Left","Connector_PinHeader_2.54mm/PinHeader_1x35_P2.54mm_Vertical_SMD_Pin1Right","Connector_PinHeader_2.54mm/PinHeader_1x36_P2.54mm_Horizontal","Connector_PinHeader_2.54mm/PinHeader_1x36_P2.54mm_Vertical","Connector_PinHeader_2.54mm/PinHeader_1x36_P2.54mm_Vertical_SMD_Pin1Left","Connector_PinHeader_2.54mm/PinHeader_1x36_P2.54mm_Vertical_SMD_Pin1Right","Connector_PinHeader_2.54mm/PinHeader_1x37_P2.54mm_Horizontal","Connector_PinHeader_2.54mm/PinHeader_1x37_P2.54mm_Vertical","Connector_PinHeader_2.54mm/PinHeader_1x37_P2.54mm_Vertical_SMD_Pin1Left","Connector_PinHeader_2.54mm/PinHeader_1x37_P2.54mm_Vertical_SMD_Pin1Right","Connector_PinHeader_2.54mm/PinHeader_1x38_P2.54mm_Horizontal","Connector_PinHeader_2.54mm/PinHeader_1x38_P2.54mm_Vertical","Connector_PinHeader_2.54mm/PinHeader_1x38_P2.54mm_Vertical_SMD_Pin1Left","Connector_PinHeader_2.54mm/PinHeader_1x38_P2.54mm_Vertical_SMD_Pin1Right","Connector_PinHeader_2.54mm/PinHeader_1x39_P2.54mm_Horizontal","Connector_PinHeader_2.54mm/PinHeader_1x39_P2.54mm_Vertical","Connector_PinHeader_2.54mm/PinHeader_1x39_P2.54mm_Vertical_SMD_Pin1Left","Connector_PinHeader_2.54mm/PinHeader_1x39_P2.54mm_Vertical_SMD_Pin1Right","Connector_PinHeader_2.54mm/PinHeader_1x40_P2.54mm_Horizontal","Connector_PinHeader_2.54mm/PinHeader_1x40_P2.54mm_Vertical","Connector_PinHeader_2.54mm/PinHeader_1x40_P2.54mm_Vertical_SMD_Pin1Left","Connector_PinHeader_2.54mm/PinHeader_1x40_P2.54mm_Vertical_SMD_Pin1Right","Connector_PinHeader_2.54mm/PinHeader_2x01_P2.54mm_Horizontal","Connector_PinHeader_2.54mm/PinHeader_2x01_P2.54mm_Vertical","Connector_PinHeader_2.54mm/PinHeader_2x01_P2.54mm_Vertical_SMD","Connector_PinHeader_2.54mm/PinHeader_2x02_P2.54mm_Horizontal","Connector_PinHeader_2.54mm/PinHeader_2x02_P2.54mm_Vertical","Connector_PinHeader_2.54mm/PinHeader_2x02_P2.54mm_Vertical_SMD","Connector_PinHeader_2.54mm/PinHeader_2x03_P2.54mm_Horizontal","Connector_PinHeader_2.54mm/PinHeader_2x03_P2.54mm_Vertical","Connector_PinHeader_2.54mm/PinHeader_2x03_P2.54mm_Vertical_SMD","Connector_PinHeader_2.54mm/PinHeader_2x04_P2.54mm_Horizontal","Connector_PinHeader_2.54mm/PinHeader_2x04_P2.54mm_Vertical","Connector_PinHeader_2.54mm/PinHeader_2x04_P2.54mm_Vertical_SMD","Connector_PinHeader_2.54mm/PinHeader_2x05_P2.54mm_Horizontal","Connector_PinHeader_2.54mm/PinHeader_2x05_P2.54mm_Vertical","Connector_PinHeader_2.54mm/PinHeader_2x05_P2.54mm_Vertical_SMD","Connector_PinHeader_2.54mm/PinHeader_2x06_P2.54mm_Horizontal","Connector_PinHeader_2.54mm/PinHeader_2x06_P2.54mm_Vertical","Connector_PinHeader_2.54mm/PinHeader_2x06_P2.54mm_Vertical_SMD","Connector_PinHeader_2.54mm/PinHeader_2x07_P2.54mm_Horizontal","Connector_PinHeader_2.54mm/PinHeader_2x07_P2.54mm_Vertical","Connector_PinHeader_2.54mm/PinHeader_2x07_P2.54mm_Vertical_SMD","Connector_PinHeader_2.54mm/PinHeader_2x08_P2.54mm_Horizontal","Connector_PinHeader_2.54mm/PinHeader_2x08_P2.54mm_Vertical","Connector_PinHeader_2.54mm/PinHeader_2x08_P2.54mm_Vertical_SMD","Connector_PinHeader_2.54mm/PinHeader_2x09_P2.54mm_Horizontal","Connector_PinHeader_2.54mm/PinHeader_2x09_P2.54mm_Vertical","Connector_PinHeader_2.54mm/PinHeader_2x09_P2.54mm_Vertical_SMD","Connector_PinHeader_2.54mm/PinHeader_2x10_P2.54mm_Horizontal","Connector_PinHeader_2.54mm/PinHeader_2x10_P2.54mm_Vertical","Connector_PinHeader_2.54mm/PinHeader_2x10_P2.54mm_Vertical_SMD","Connector_PinHeader_2.54mm/PinHeader_2x11_P2.54mm_Horizontal","Connector_PinHeader_2.54mm/PinHeader_2x11_P2.54mm_Vertical","Connector_PinHeader_2.54mm/PinHeader_2x11_P2.54mm_Vertical_SMD","Connector_PinHeader_2.54mm/PinHeader_2x12_P2.54mm_Horizontal","Connector_PinHeader_2.54mm/PinHeader_2x12_P2.54mm_Vertical","Connector_PinHeader_2.54mm/PinHeader_2x12_P2.54mm_Vertical_SMD","Connector_PinHeader_2.54mm/PinHeader_2x13_P2.54mm_Horizontal","Connector_PinHeader_2.54mm/PinHeader_2x13_P2.54mm_Vertical","Connector_PinHeader_2.54mm/PinHeader_2x13_P2.54mm_Vertical_SMD","Connector_PinHeader_2.54mm/PinHeader_2x14_P2.54mm_Horizontal","Connector_PinHeader_2.54mm/PinHeader_2x14_P2.54mm_Vertical","Connector_PinHeader_2.54mm/PinHeader_2x14_P2.54mm_Vertical_SMD","Connector_PinHeader_2.54mm/PinHeader_2x15_P2.54mm_Horizontal","Connector_PinHeader_2.54mm/PinHeader_2x15_P2.54mm_Vertical","Connector_PinHeader_2.54mm/PinHeader_2x15_P2.54mm_Vertical_SMD","Connector_PinHeader_2.54mm/PinHeader_2x16_P2.54mm_Horizontal","Connector_PinHeader_2.54mm/PinHeader_2x16_P2.54mm_Vertical","Connector_PinHeader_2.54mm/PinHeader_2x16_P2.54mm_Vertical_SMD","Connector_PinHeader_2.54mm/PinHeader_2x17_P2.54mm_Horizontal","Connector_PinHeader_2.54mm/PinHeader_2x17_P2.54mm_Vertical","Connector_PinHeader_2.54mm/PinHeader_2x17_P2.54mm_Vertical_SMD","Connector_PinHeader_2.54mm/PinHeader_2x18_P2.54mm_Horizontal","Connector_PinHeader_2.54mm/PinHeader_2x18_P2.54mm_Vertical","Connector_PinHeader_2.54mm/PinHeader_2x18_P2.54mm_Vertical_SMD","Connector_PinHeader_2.54mm/PinHeader_2x19_P2.54mm_Horizontal","Connector_PinHeader_2.54mm/PinHeader_2x19_P2.54mm_Vertical","Connector_PinHeader_2.54mm/PinHeader_2x19_P2.54mm_Vertical_SMD","Connector_PinHeader_2.54mm/PinHeader_2x20_P2.54mm_Horizontal","Connector_PinHeader_2.54mm/PinHeader_2x20_P2.54mm_Vertical","Connector_PinHeader_2.54mm/PinHeader_2x20_P2.54mm_Vertical_SMD","Connector_PinHeader_2.54mm/PinHeader_2x21_P2.54mm_Horizontal","Connector_PinHeader_2.54mm/PinHeader_2x21_P2.54mm_Vertical","Connector_PinHeader_2.54mm/PinHeader_2x21_P2.54mm_Vertical_SMD","Connector_PinHeader_2.54mm/PinHeader_2x22_P2.54mm_Horizontal","Connector_PinHeader_2.54mm/PinHeader_2x22_P2.54mm_Vertical","Connector_PinHeader_2.54mm/PinHeader_2x22_P2.54mm_Vertical_SMD","Connector_PinHeader_2.54mm/PinHeader_2x23_P2.54mm_Horizontal","Connector_PinHeader_2.54mm/PinHeader_2x23_P2.54mm_Vertical","Connector_PinHeader_2.54mm/PinHeader_2x23_P2.54mm_Vertical_SMD","Connector_PinHeader_2.54mm/PinHeader_2x24_P2.54mm_Horizontal","Connector_PinHeader_2.54mm/PinHeader_2x24_P2.54mm_Vertical","Connector_PinHeader_2.54mm/PinHeader_2x24_P2.54mm_Vertical_SMD","Connector_PinHeader_2.54mm/PinHeader_2x25_P2.54mm_Horizontal","Connector_PinHeader_2.54mm/PinHeader_2x25_P2.54mm_Vertical","Connector_PinHeader_2.54mm/PinHeader_2x25_P2.54mm_Vertical_SMD","Connector_PinHeader_2.54mm/PinHeader_2x26_P2.54mm_Horizontal","Connector_PinHeader_2.54mm/PinHeader_2x26_P2.54mm_Vertical","Connector_PinHeader_2.54mm/PinHeader_2x26_P2.54mm_Vertical_SMD","Connector_PinHeader_2.54mm/PinHeader_2x27_P2.54mm_Horizontal","Connector_PinHeader_2.54mm/PinHeader_2x27_P2.54mm_Vertical","Connector_PinHeader_2.54mm/PinHeader_2x27_P2.54mm_Vertical_SMD","Connector_PinHeader_2.54mm/PinHeader_2x28_P2.54mm_Horizontal","Connector_PinHeader_2.54mm/PinHeader_2x28_P2.54mm_Vertical","Connector_PinHeader_2.54mm/PinHeader_2x28_P2.54mm_Vertical_SMD","Connector_PinHeader_2.54mm/PinHeader_2x29_P2.54mm_Horizontal","Connector_PinHeader_2.54mm/PinHeader_2x29_P2.54mm_Vertical","Connector_PinHeader_2.54mm/PinHeader_2x29_P2.54mm_Vertical_SMD","Connector_PinHeader_2.54mm/PinHeader_2x30_P2.54mm_Horizontal","Connector_PinHeader_2.54mm/PinHeader_2x30_P2.54mm_Vertical","Connector_PinHeader_2.54mm/PinHeader_2x30_P2.54mm_Vertical_SMD","Connector_PinHeader_2.54mm/PinHeader_2x31_P2.54mm_Horizontal","Connector_PinHeader_2.54mm/PinHeader_2x31_P2.54mm_Vertical","Connector_PinHeader_2.54mm/PinHeader_2x31_P2.54mm_Vertical_SMD","Connector_PinHeader_2.54mm/PinHeader_2x32_P2.54mm_Horizontal","Connector_PinHeader_2.54mm/PinHeader_2x32_P2.54mm_Vertical","Connector_PinHeader_2.54mm/PinHeader_2x32_P2.54mm_Vertical_SMD","Connector_PinHeader_2.54mm/PinHeader_2x33_P2.54mm_Horizontal","Connector_PinHeader_2.54mm/PinHeader_2x33_P2.54mm_Vertical","Connector_PinHeader_2.54mm/PinHeader_2x33_P2.54mm_Vertical_SMD","Connector_PinHeader_2.54mm/PinHeader_2x34_P2.54mm_Horizontal","Connector_PinHeader_2.54mm/PinHeader_2x34_P2.54mm_Vertical","Connector_PinHeader_2.54mm/PinHeader_2x34_P2.54mm_Vertical_SMD","Connector_PinHeader_2.54mm/PinHeader_2x35_P2.54mm_Horizontal","Connector_PinHeader_2.54mm/PinHeader_2x35_P2.54mm_Vertical","Connector_PinHeader_2.54mm/PinHeader_2x35_P2.54mm_Vertical_SMD","Connector_PinHeader_2.54mm/PinHeader_2x36_P2.54mm_Horizontal","Connector_PinHeader_2.54mm/PinHeader_2x36_P2.54mm_Vertical","Connector_PinHeader_2.54mm/PinHeader_2x36_P2.54mm_Vertical_SMD","Connector_PinHeader_2.54mm/PinHeader_2x37_P2.54mm_Horizontal","Connector_PinHeader_2.54mm/PinHeader_2x37_P2.54mm_Vertical","Connector_PinHeader_2.54mm/PinHeader_2x37_P2.54mm_Vertical_SMD","Connector_PinHeader_2.54mm/PinHeader_2x38_P2.54mm_Horizontal","Connector_PinHeader_2.54mm/PinHeader_2x38_P2.54mm_Vertical","Connector_PinHeader_2.54mm/PinHeader_2x38_P2.54mm_Vertical_SMD","Connector_PinHeader_2.54mm/PinHeader_2x39_P2.54mm_Horizontal","Connector_PinHeader_2.54mm/PinHeader_2x39_P2.54mm_Vertical","Connector_PinHeader_2.54mm/PinHeader_2x39_P2.54mm_Vertical_SMD","Connector_PinHeader_2.54mm/PinHeader_2x40_P2.54mm_Horizontal","Connector_PinHeader_2.54mm/PinHeader_2x40_P2.54mm_Vertical","Connector_PinHeader_2.54mm/PinHeader_2x40_P2.54mm_Vertical_SMD","Connector_PinSocket_1.00mm/PinSocket_1x02_P1.00mm_Vertical","Connector_PinSocket_1.00mm/PinSocket_1x02_P1.00mm_Vertical_SMD_Pin1Left","Connector_PinSocket_1.00mm/PinSocket_1x02_P1.00mm_Vertical_SMD_Pin1Right","Connector_PinSocket_1.00mm/PinSocket_1x03_P1.00mm_Vertical","Connector_PinSocket_1.00mm/PinSocket_1x03_P1.00mm_Vertical_SMD_Pin1Left","Connector_PinSocket_1.00mm/PinSocket_1x03_P1.00mm_Vertical_SMD_Pin1Right","Connector_PinSocket_1.00mm/PinSocket_1x04_P1.00mm_Vertical","Connector_PinSocket_1.00mm/PinSocket_1x04_P1.00mm_Vertical_SMD_Pin1Left","Connector_PinSocket_1.00mm/PinSocket_1x04_P1.00mm_Vertical_SMD_Pin1Right","Connector_PinSocket_1.00mm/PinSocket_1x05_P1.00mm_Vertical","Connector_PinSocket_1.00mm/PinSocket_1x05_P1.00mm_Vertical_SMD_Pin1Left","Connector_PinSocket_1.00mm/PinSocket_1x05_P1.00mm_Vertical_SMD_Pin1Right","Connector_PinSocket_1.00mm/PinSocket_1x06_P1.00mm_Vertical","Connector_PinSocket_1.00mm/PinSocket_1x06_P1.00mm_Vertical_SMD_Pin1Left","Connector_PinSocket_1.00mm/PinSocket_1x06_P1.00mm_Vertical_SMD_Pin1Right","Connector_PinSocket_1.00mm/PinSocket_1x07_P1.00mm_Vertical","Connector_PinSocket_1.00mm/PinSocket_1x07_P1.00mm_Vertical_SMD_Pin1Left","Connector_PinSocket_1.00mm/PinSocket_1x07_P1.00mm_Vertical_SMD_Pin1Right","Connector_PinSocket_1.00mm/PinSocket_1x08_P1.00mm_Vertical","Connector_PinSocket_1.00mm/PinSocket_1x08_P1.00mm_Vertical_SMD_Pin1Left","Connector_PinSocket_1.00mm/PinSocket_1x08_P1.00mm_Vertical_SMD_Pin1Right","Connector_PinSocket_1.00mm/PinSocket_1x09_P1.00mm_Vertical","Connector_PinSocket_1.00mm/PinSocket_1x09_P1.00mm_Vertical_SMD_Pin1Left","Connector_PinSocket_1.00mm/PinSocket_1x09_P1.00mm_Vertical_SMD_Pin1Right","Connector_PinSocket_1.00mm/PinSocket_1x10_P1.00mm_Vertical","Connector_PinSocket_1.00mm/PinSocket_1x10_P1.00mm_Vertical_SMD_Pin1Left","Connector_PinSocket_1.00mm/PinSocket_1x10_P1.00mm_Vertical_SMD_Pin1Right","Connector_PinSocket_1.00mm/PinSocket_1x11_P1.00mm_Vertical","Connector_PinSocket_1.00mm/PinSocket_1x11_P1.00mm_Vertical_SMD_Pin1Left","Connector_PinSocket_1.00mm/PinSocket_1x11_P1.00mm_Vertical_SMD_Pin1Right","Connector_PinSocket_1.00mm/PinSocket_1x12_P1.00mm_Vertical","Connector_PinSocket_1.00mm/PinSocket_1x12_P1.00mm_Vertical_SMD_Pin1Left","Connector_PinSocket_1.00mm/PinSocket_1x12_P1.00mm_Vertical_SMD_Pin1Right","Connector_PinSocket_1.00mm/PinSocket_1x13_P1.00mm_Vertical","Connector_PinSocket_1.00mm/PinSocket_1x13_P1.00mm_Vertical_SMD_Pin1Left","Connector_PinSocket_1.00mm/PinSocket_1x13_P1.00mm_Vertical_SMD_Pin1Right","Connector_PinSocket_1.00mm/PinSocket_1x14_P1.00mm_Vertical","Connector_PinSocket_1.00mm/PinSocket_1x14_P1.00mm_Vertical_SMD_Pin1Left","Connector_PinSocket_1.00mm/PinSocket_1x14_P1.00mm_Vertical_SMD_Pin1Right","Connector_PinSocket_1.00mm/PinSocket_1x15_P1.00mm_Vertical","Connector_PinSocket_1.00mm/PinSocket_1x15_P1.00mm_Vertical_SMD_Pin1Left","Connector_PinSocket_1.00mm/PinSocket_1x15_P1.00mm_Vertical_SMD_Pin1Right","Connector_PinSocket_1.00mm/PinSocket_1x16_P1.00mm_Vertical","Connector_PinSocket_1.00mm/PinSocket_1x16_P1.00mm_Vertical_SMD_Pin1Left","Connector_PinSocket_1.00mm/PinSocket_1x16_P1.00mm_Vertical_SMD_Pin1Right","Connector_PinSocket_1.00mm/PinSocket_1x17_P1.00mm_Vertical","Connector_PinSocket_1.00mm/PinSocket_1x17_P1.00mm_Vertical_SMD_Pin1Left","Connector_PinSocket_1.00mm/PinSocket_1x17_P1.00mm_Vertical_SMD_Pin1Right","Connector_PinSocket_1.00mm/PinSocket_1x18_P1.00mm_Vertical","Connector_PinSocket_1.00mm/PinSocket_1x18_P1.00mm_Vertical_SMD_Pin1Left","Connector_PinSocket_1.00mm/PinSocket_1x18_P1.00mm_Vertical_SMD_Pin1Right","Connector_PinSocket_1.00mm/PinSocket_1x19_P1.00mm_Vertical","Connector_PinSocket_1.00mm/PinSocket_1x19_P1.00mm_Vertical_SMD_Pin1Left","Connector_PinSocket_1.00mm/PinSocket_1x19_P1.00mm_Vertical_SMD_Pin1Right","Connector_PinSocket_1.00mm/PinSocket_1x20_P1.00mm_Vertical","Connector_PinSocket_1.00mm/PinSocket_1x20_P1.00mm_Vertical_SMD_Pin1Left","Connector_PinSocket_1.00mm/PinSocket_1x20_P1.00mm_Vertical_SMD_Pin1Right","Connector_PinSocket_1.00mm/PinSocket_1x21_P1.00mm_Vertical","Connector_PinSocket_1.00mm/PinSocket_1x21_P1.00mm_Vertical_SMD_Pin1Left","Connector_PinSocket_1.00mm/PinSocket_1x21_P1.00mm_Vertical_SMD_Pin1Right","Connector_PinSocket_1.00mm/PinSocket_1x22_P1.00mm_Vertical","Connector_PinSocket_1.00mm/PinSocket_1x22_P1.00mm_Vertical_SMD_Pin1Left","Connector_PinSocket_1.00mm/PinSocket_1x22_P1.00mm_Vertical_SMD_Pin1Right","Connector_PinSocket_1.00mm/PinSocket_1x23_P1.00mm_Vertical","Connector_PinSocket_1.00mm/PinSocket_1x23_P1.00mm_Vertical_SMD_Pin1Left","Connector_PinSocket_1.00mm/PinSocket_1x23_P1.00mm_Vertical_SMD_Pin1Right","Connector_PinSocket_1.00mm/PinSocket_1x24_P1.00mm_Vertical","Connector_PinSocket_1.00mm/PinSocket_1x24_P1.00mm_Vertical_SMD_Pin1Left","Connector_PinSocket_1.00mm/PinSocket_1x24_P1.00mm_Vertical_SMD_Pin1Right","Connector_PinSocket_1.00mm/PinSocket_1x25_P1.00mm_Vertical","Connector_PinSocket_1.00mm/PinSocket_1x25_P1.00mm_Vertical_SMD_Pin1Left","Connector_PinSocket_1.00mm/PinSocket_1x25_P1.00mm_Vertical_SMD_Pin1Right","Connector_PinSocket_1.00mm/PinSocket_1x26_P1.00mm_Vertical","Connector_PinSocket_1.00mm/PinSocket_1x26_P1.00mm_Vertical_SMD_Pin1Left","Connector_PinSocket_1.00mm/PinSocket_1x26_P1.00mm_Vertical_SMD_Pin1Right","Connector_PinSocket_1.00mm/PinSocket_1x27_P1.00mm_Vertical","Connector_PinSocket_1.00mm/PinSocket_1x27_P1.00mm_Vertical_SMD_Pin1Left","Connector_PinSocket_1.00mm/PinSocket_1x27_P1.00mm_Vertical_SMD_Pin1Right","Connector_PinSocket_1.00mm/PinSocket_1x28_P1.00mm_Vertical","Connector_PinSocket_1.00mm/PinSocket_1x28_P1.00mm_Vertical_SMD_Pin1Left","Connector_PinSocket_1.00mm/PinSocket_1x28_P1.00mm_Vertical_SMD_Pin1Right","Connector_PinSocket_1.00mm/PinSocket_1x29_P1.00mm_Vertical","Connector_PinSocket_1.00mm/PinSocket_1x29_P1.00mm_Vertical_SMD_Pin1Left","Connector_PinSocket_1.00mm/PinSocket_1x29_P1.00mm_Vertical_SMD_Pin1Right","Connector_PinSocket_1.00mm/PinSocket_1x30_P1.00mm_Vertical","Connector_PinSocket_1.00mm/PinSocket_1x30_P1.00mm_Vertical_SMD_Pin1Left","Connector_PinSocket_1.00mm/PinSocket_1x30_P1.00mm_Vertical_SMD_Pin1Right","Connector_PinSocket_1.00mm/PinSocket_1x31_P1.00mm_Vertical","Connector_PinSocket_1.00mm/PinSocket_1x31_P1.00mm_Vertical_SMD_Pin1Left","Connector_PinSocket_1.00mm/PinSocket_1x31_P1.00mm_Vertical_SMD_Pin1Right","Connector_PinSocket_1.00mm/PinSocket_1x32_P1.00mm_Vertical","Connector_PinSocket_1.00mm/PinSocket_1x32_P1.00mm_Vertical_SMD_Pin1Left","Connector_PinSocket_1.00mm/PinSocket_1x32_P1.00mm_Vertical_SMD_Pin1Right","Connector_PinSocket_1.00mm/PinSocket_1x33_P1.00mm_Vertical","Connector_PinSocket_1.00mm/PinSocket_1x33_P1.00mm_Vertical_SMD_Pin1Left","Connector_PinSocket_1.00mm/PinSocket_1x33_P1.00mm_Vertical_SMD_Pin1Right","Connector_PinSocket_1.00mm/PinSocket_1x34_P1.00mm_Vertical","Connector_PinSocket_1.00mm/PinSocket_1x34_P1.00mm_Vertical_SMD_Pin1Left","Connector_PinSocket_1.00mm/PinSocket_1x34_P1.00mm_Vertical_SMD_Pin1Right","Connector_PinSocket_1.00mm/PinSocket_1x35_P1.00mm_Vertical","Connector_PinSocket_1.00mm/PinSocket_1x35_P1.00mm_Vertical_SMD_Pin1Left","Connector_PinSocket_1.00mm/PinSocket_1x35_P1.00mm_Vertical_SMD_Pin1Right","Connector_PinSocket_1.00mm/PinSocket_1x36_P1.00mm_Vertical","Connector_PinSocket_1.00mm/PinSocket_1x36_P1.00mm_Vertical_SMD_Pin1Left","Connector_PinSocket_1.00mm/PinSocket_1x36_P1.00mm_Vertical_SMD_Pin1Right","Connector_PinSocket_1.00mm/PinSocket_1x37_P1.00mm_Vertical","Connector_PinSocket_1.00mm/PinSocket_1x37_P1.00mm_Vertical_SMD_Pin1Left","Connector_PinSocket_1.00mm/PinSocket_1x37_P1.00mm_Vertical_SMD_Pin1Right","Connector_PinSocket_1.00mm/PinSocket_1x38_P1.00mm_Vertical","Connector_PinSocket_1.00mm/PinSocket_1x38_P1.00mm_Vertical_SMD_Pin1Left","Connector_PinSocket_1.00mm/PinSocket_1x38_P1.00mm_Vertical_SMD_Pin1Right","Connector_PinSocket_1.00mm/PinSocket_1x39_P1.00mm_Vertical","Connector_PinSocket_1.00mm/PinSocket_1x39_P1.00mm_Vertical_SMD_Pin1Left","Connector_PinSocket_1.00mm/PinSocket_1x39_P1.00mm_Vertical_SMD_Pin1Right","Connector_PinSocket_1.00mm/PinSocket_1x40_P1.00mm_Vertical","Connector_PinSocket_1.00mm/PinSocket_1x40_P1.00mm_Vertical_SMD_Pin1Left","Connector_PinSocket_1.00mm/PinSocket_1x40_P1.00mm_Vertical_SMD_Pin1Right","Connector_PinSocket_1.00mm/PinSocket_2x02_P1.00mm_Vertical_SMD","Connector_PinSocket_1.00mm/PinSocket_2x03_P1.00mm_Vertical_SMD","Connector_PinSocket_1.00mm/PinSocket_2x04_P1.00mm_Vertical_SMD","Connector_PinSocket_1.00mm/PinSocket_2x05_P1.00mm_Vertical_SMD","Connector_PinSocket_1.00mm/PinSocket_2x06_P1.00mm_Vertical_SMD","Connector_PinSocket_1.00mm/PinSocket_2x07_P1.00mm_Vertical_SMD","Connector_PinSocket_1.00mm/PinSocket_2x08_P1.00mm_Vertical_SMD","Connector_PinSocket_1.00mm/PinSocket_2x09_P1.00mm_Vertical_SMD","Connector_PinSocket_1.00mm/PinSocket_2x10_P1.00mm_Vertical_SMD","Connector_PinSocket_1.00mm/PinSocket_2x11_P1.00mm_Vertical_SMD","Connector_PinSocket_1.00mm/PinSocket_2x12_P1.00mm_Vertical_SMD","Connector_PinSocket_1.00mm/PinSocket_2x13_P1.00mm_Vertical_SMD","Connector_PinSocket_1.00mm/PinSocket_2x14_P1.00mm_Vertical_SMD","Connector_PinSocket_1.00mm/PinSocket_2x15_P1.00mm_Vertical_SMD","Connector_PinSocket_1.00mm/PinSocket_2x16_P1.00mm_Vertical_SMD","Connector_PinSocket_1.00mm/PinSocket_2x17_P1.00mm_Vertical_SMD","Connector_PinSocket_1.00mm/PinSocket_2x18_P1.00mm_Vertical_SMD","Connector_PinSocket_1.00mm/PinSocket_2x19_P1.00mm_Vertical_SMD","Connector_PinSocket_1.00mm/PinSocket_2x20_P1.00mm_Vertical_SMD","Connector_PinSocket_1.00mm/PinSocket_2x21_P1.00mm_Vertical_SMD","Connector_PinSocket_1.00mm/PinSocket_2x22_P1.00mm_Vertical_SMD","Connector_PinSocket_1.00mm/PinSocket_2x23_P1.00mm_Vertical_SMD","Connector_PinSocket_1.00mm/PinSocket_2x24_P1.00mm_Vertical_SMD","Connector_PinSocket_1.00mm/PinSocket_2x25_P1.00mm_Vertical_SMD","Connector_PinSocket_1.00mm/PinSocket_2x26_P1.00mm_Vertical_SMD","Connector_PinSocket_1.00mm/PinSocket_2x27_P1.00mm_Vertical_SMD","Connector_PinSocket_1.00mm/PinSocket_2x28_P1.00mm_Vertical_SMD","Connector_PinSocket_1.00mm/PinSocket_2x29_P1.00mm_Vertical_SMD","Connector_PinSocket_1.00mm/PinSocket_2x30_P1.00mm_Vertical_SMD","Connector_PinSocket_1.00mm/PinSocket_2x31_P1.00mm_Vertical_SMD","Connector_PinSocket_1.00mm/PinSocket_2x32_P1.00mm_Vertical_SMD","Connector_PinSocket_1.00mm/PinSocket_2x33_P1.00mm_Vertical_SMD","Connector_PinSocket_1.00mm/PinSocket_2x34_P1.00mm_Vertical_SMD","Connector_PinSocket_1.00mm/PinSocket_2x35_P1.00mm_Vertical_SMD","Connector_PinSocket_1.00mm/PinSocket_2x36_P1.00mm_Vertical_SMD","Connector_PinSocket_1.00mm/PinSocket_2x37_P1.00mm_Vertical_SMD","Connector_PinSocket_1.00mm/PinSocket_2x38_P1.00mm_Vertical_SMD","Connector_PinSocket_1.00mm/PinSocket_2x39_P1.00mm_Vertical_SMD","Connector_PinSocket_1.00mm/PinSocket_2x40_P1.00mm_Vertical_SMD","Connector_PinSocket_1.27mm/PinSocket_1x01_P1.27mm_Vertical","Connector_PinSocket_1.27mm/PinSocket_1x02_P1.27mm_Vertical","Connector_PinSocket_1.27mm/PinSocket_1x02_P1.27mm_Vertical_SMD_Pin1Left","Connector_PinSocket_1.27mm/PinSocket_1x02_P1.27mm_Vertical_SMD_Pin1Right","Connector_PinSocket_1.27mm/PinSocket_1x03_P1.27mm_Vertical","Connector_PinSocket_1.27mm/PinSocket_1x03_P1.27mm_Vertical_SMD_Pin1Left","Connector_PinSocket_1.27mm/PinSocket_1x03_P1.27mm_Vertical_SMD_Pin1Right","Connector_PinSocket_1.27mm/PinSocket_1x04_P1.27mm_Vertical","Connector_PinSocket_1.27mm/PinSocket_1x04_P1.27mm_Vertical_SMD_Pin1Left","Connector_PinSocket_1.27mm/PinSocket_1x04_P1.27mm_Vertical_SMD_Pin1Right","Connector_PinSocket_1.27mm/PinSocket_1x05_P1.27mm_Vertical","Connector_PinSocket_1.27mm/PinSocket_1x05_P1.27mm_Vertical_SMD_Pin1Left","Connector_PinSocket_1.27mm/PinSocket_1x05_P1.27mm_Vertical_SMD_Pin1Right","Connector_PinSocket_1.27mm/PinSocket_1x06_P1.27mm_Vertical","Connector_PinSocket_1.27mm/PinSocket_1x06_P1.27mm_Vertical_SMD_Pin1Left","Connector_PinSocket_1.27mm/PinSocket_1x06_P1.27mm_Vertical_SMD_Pin1Right","Connector_PinSocket_1.27mm/PinSocket_1x07_P1.27mm_Vertical","Connector_PinSocket_1.27mm/PinSocket_1x07_P1.27mm_Vertical_SMD_Pin1Left","Connector_PinSocket_1.27mm/PinSocket_1x07_P1.27mm_Vertical_SMD_Pin1Right","Connector_PinSocket_1.27mm/PinSocket_1x08_P1.27mm_Vertical","Connector_PinSocket_1.27mm/PinSocket_1x08_P1.27mm_Vertical_SMD_Pin1Left","Connector_PinSocket_1.27mm/PinSocket_1x08_P1.27mm_Vertical_SMD_Pin1Right","Connector_PinSocket_1.27mm/PinSocket_1x09_P1.27mm_Vertical","Connector_PinSocket_1.27mm/PinSocket_1x09_P1.27mm_Vertical_SMD_Pin1Left","Connector_PinSocket_1.27mm/PinSocket_1x09_P1.27mm_Vertical_SMD_Pin1Right","Connector_PinSocket_1.27mm/PinSocket_1x10_P1.27mm_Vertical","Connector_PinSocket_1.27mm/PinSocket_1x10_P1.27mm_Vertical_SMD_Pin1Left","Connector_PinSocket_1.27mm/PinSocket_1x10_P1.27mm_Vertical_SMD_Pin1Right","Connector_PinSocket_1.27mm/PinSocket_1x11_P1.27mm_Vertical","Connector_PinSocket_1.27mm/PinSocket_1x11_P1.27mm_Vertical_SMD_Pin1Left","Connector_PinSocket_1.27mm/PinSocket_1x11_P1.27mm_Vertical_SMD_Pin1Right","Connector_PinSocket_1.27mm/PinSocket_1x12_P1.27mm_Vertical","Connector_PinSocket_1.27mm/PinSocket_1x12_P1.27mm_Vertical_SMD_Pin1Left","Connector_PinSocket_1.27mm/PinSocket_1x12_P1.27mm_Vertical_SMD_Pin1Right","Connector_PinSocket_1.27mm/PinSocket_1x13_P1.27mm_Vertical","Connector_PinSocket_1.27mm/PinSocket_1x13_P1.27mm_Vertical_SMD_Pin1Left","Connector_PinSocket_1.27mm/PinSocket_1x13_P1.27mm_Vertical_SMD_Pin1Right","Connector_PinSocket_1.27mm/PinSocket_1x14_P1.27mm_Vertical","Connector_PinSocket_1.27mm/PinSocket_1x14_P1.27mm_Vertical_SMD_Pin1Left","Connector_PinSocket_1.27mm/PinSocket_1x14_P1.27mm_Vertical_SMD_Pin1Right","Connector_PinSocket_1.27mm/PinSocket_1x15_P1.27mm_Vertical","Connector_PinSocket_1.27mm/PinSocket_1x15_P1.27mm_Vertical_SMD_Pin1Left","Connector_PinSocket_1.27mm/PinSocket_1x15_P1.27mm_Vertical_SMD_Pin1Right","Connector_PinSocket_1.27mm/PinSocket_1x16_P1.27mm_Vertical","Connector_PinSocket_1.27mm/PinSocket_1x16_P1.27mm_Vertical_SMD_Pin1Left","Connector_PinSocket_1.27mm/PinSocket_1x16_P1.27mm_Vertical_SMD_Pin1Right","Connector_PinSocket_1.27mm/PinSocket_1x17_P1.27mm_Vertical","Connector_PinSocket_1.27mm/PinSocket_1x17_P1.27mm_Vertical_SMD_Pin1Left","Connector_PinSocket_1.27mm/PinSocket_1x17_P1.27mm_Vertical_SMD_Pin1Right","Connector_PinSocket_1.27mm/PinSocket_1x18_P1.27mm_Vertical","Connector_PinSocket_1.27mm/PinSocket_1x18_P1.27mm_Vertical_SMD_Pin1Left","Connector_PinSocket_1.27mm/PinSocket_1x18_P1.27mm_Vertical_SMD_Pin1Right","Connector_PinSocket_1.27mm/PinSocket_1x19_P1.27mm_Vertical","Connector_PinSocket_1.27mm/PinSocket_1x19_P1.27mm_Vertical_SMD_Pin1Left","Connector_PinSocket_1.27mm/PinSocket_1x19_P1.27mm_Vertical_SMD_Pin1Right","Connector_PinSocket_1.27mm/PinSocket_1x20_P1.27mm_Vertical","Connector_PinSocket_1.27mm/PinSocket_1x20_P1.27mm_Vertical_SMD_Pin1Left","Connector_PinSocket_1.27mm/PinSocket_1x20_P1.27mm_Vertical_SMD_Pin1Right","Connector_PinSocket_1.27mm/PinSocket_1x21_P1.27mm_Vertical","Connector_PinSocket_1.27mm/PinSocket_1x21_P1.27mm_Vertical_SMD_Pin1Left","Connector_PinSocket_1.27mm/PinSocket_1x21_P1.27mm_Vertical_SMD_Pin1Right","Connector_PinSocket_1.27mm/PinSocket_1x22_P1.27mm_Vertical","Connector_PinSocket_1.27mm/PinSocket_1x22_P1.27mm_Vertical_SMD_Pin1Left","Connector_PinSocket_1.27mm/PinSocket_1x22_P1.27mm_Vertical_SMD_Pin1Right","Connector_PinSocket_1.27mm/PinSocket_1x23_P1.27mm_Vertical","Connector_PinSocket_1.27mm/PinSocket_1x23_P1.27mm_Vertical_SMD_Pin1Left","Connector_PinSocket_1.27mm/PinSocket_1x23_P1.27mm_Vertical_SMD_Pin1Right","Connector_PinSocket_1.27mm/PinSocket_1x24_P1.27mm_Vertical","Connector_PinSocket_1.27mm/PinSocket_1x24_P1.27mm_Vertical_SMD_Pin1Left","Connector_PinSocket_1.27mm/PinSocket_1x24_P1.27mm_Vertical_SMD_Pin1Right","Connector_PinSocket_1.27mm/PinSocket_1x25_P1.27mm_Vertical","Connector_PinSocket_1.27mm/PinSocket_1x25_P1.27mm_Vertical_SMD_Pin1Left","Connector_PinSocket_1.27mm/PinSocket_1x25_P1.27mm_Vertical_SMD_Pin1Right","Connector_PinSocket_1.27mm/PinSocket_1x26_P1.27mm_Vertical","Connector_PinSocket_1.27mm/PinSocket_1x26_P1.27mm_Vertical_SMD_Pin1Left","Connector_PinSocket_1.27mm/PinSocket_1x26_P1.27mm_Vertical_SMD_Pin1Right","Connector_PinSocket_1.27mm/PinSocket_1x27_P1.27mm_Vertical","Connector_PinSocket_1.27mm/PinSocket_1x27_P1.27mm_Vertical_SMD_Pin1Left","Connector_PinSocket_1.27mm/PinSocket_1x27_P1.27mm_Vertical_SMD_Pin1Right","Connector_PinSocket_1.27mm/PinSocket_1x28_P1.27mm_Vertical","Connector_PinSocket_1.27mm/PinSocket_1x28_P1.27mm_Vertical_SMD_Pin1Left","Connector_PinSocket_1.27mm/PinSocket_1x28_P1.27mm_Vertical_SMD_Pin1Right","Connector_PinSocket_1.27mm/PinSocket_1x29_P1.27mm_Vertical","Connector_PinSocket_1.27mm/PinSocket_1x29_P1.27mm_Vertical_SMD_Pin1Left","Connector_PinSocket_1.27mm/PinSocket_1x29_P1.27mm_Vertical_SMD_Pin1Right","Connector_PinSocket_1.27mm/PinSocket_1x30_P1.27mm_Vertical","Connector_PinSocket_1.27mm/PinSocket_1x30_P1.27mm_Vertical_SMD_Pin1Left","Connector_PinSocket_1.27mm/PinSocket_1x30_P1.27mm_Vertical_SMD_Pin1Right","Connector_PinSocket_1.27mm/PinSocket_1x31_P1.27mm_Vertical","Connector_PinSocket_1.27mm/PinSocket_1x31_P1.27mm_Vertical_SMD_Pin1Left","Connector_PinSocket_1.27mm/PinSocket_1x31_P1.27mm_Vertical_SMD_Pin1Right","Connector_PinSocket_1.27mm/PinSocket_1x32_P1.27mm_Vertical","Connector_PinSocket_1.27mm/PinSocket_1x32_P1.27mm_Vertical_SMD_Pin1Left","Connector_PinSocket_1.27mm/PinSocket_1x32_P1.27mm_Vertical_SMD_Pin1Right","Connector_PinSocket_1.27mm/PinSocket_1x33_P1.27mm_Vertical","Connector_PinSocket_1.27mm/PinSocket_1x33_P1.27mm_Vertical_SMD_Pin1Left","Connector_PinSocket_1.27mm/PinSocket_1x33_P1.27mm_Vertical_SMD_Pin1Right","Connector_PinSocket_1.27mm/PinSocket_1x34_P1.27mm_Vertical","Connector_PinSocket_1.27mm/PinSocket_1x34_P1.27mm_Vertical_SMD_Pin1Left","Connector_PinSocket_1.27mm/PinSocket_1x34_P1.27mm_Vertical_SMD_Pin1Right","Connector_PinSocket_1.27mm/PinSocket_1x35_P1.27mm_Vertical","Connector_PinSocket_1.27mm/PinSocket_1x35_P1.27mm_Vertical_SMD_Pin1Left","Connector_PinSocket_1.27mm/PinSocket_1x35_P1.27mm_Vertical_SMD_Pin1Right","Connector_PinSocket_1.27mm/PinSocket_1x36_P1.27mm_Vertical","Connector_PinSocket_1.27mm/PinSocket_1x36_P1.27mm_Vertical_SMD_Pin1Left","Connector_PinSocket_1.27mm/PinSocket_1x36_P1.27mm_Vertical_SMD_Pin1Right","Connector_PinSocket_1.27mm/PinSocket_1x37_P1.27mm_Vertical","Connector_PinSocket_1.27mm/PinSocket_1x37_P1.27mm_Vertical_SMD_Pin1Left","Connector_PinSocket_1.27mm/PinSocket_1x37_P1.27mm_Vertical_SMD_Pin1Right","Connector_PinSocket_1.27mm/PinSocket_1x38_P1.27mm_Vertical","Connector_PinSocket_1.27mm/PinSocket_1x38_P1.27mm_Vertical_SMD_Pin1Left","Connector_PinSocket_1.27mm/PinSocket_1x38_P1.27mm_Vertical_SMD_Pin1Right","Connector_PinSocket_1.27mm/PinSocket_1x39_P1.27mm_Vertical","Connector_PinSocket_1.27mm/PinSocket_1x39_P1.27mm_Vertical_SMD_Pin1Left","Connector_PinSocket_1.27mm/PinSocket_1x39_P1.27mm_Vertical_SMD_Pin1Right","Connector_PinSocket_1.27mm/PinSocket_1x40_P1.27mm_Vertical","Connector_PinSocket_1.27mm/PinSocket_1x40_P1.27mm_Vertical_SMD_Pin1Left","Connector_PinSocket_1.27mm/PinSocket_1x40_P1.27mm_Vertical_SMD_Pin1Right","Connector_PinSocket_1.27mm/PinSocket_2x01_P1.27mm_Vertical","Connector_PinSocket_1.27mm/PinSocket_2x01_P1.27mm_Vertical_SMD","Connector_PinSocket_1.27mm/PinSocket_2x02_P1.27mm_Vertical","Connector_PinSocket_1.27mm/PinSocket_2x02_P1.27mm_Vertical_SMD","Connector_PinSocket_1.27mm/PinSocket_2x03_P1.27mm_Horizontal","Connector_PinSocket_1.27mm/PinSocket_2x03_P1.27mm_Vertical","Connector_PinSocket_1.27mm/PinSocket_2x03_P1.27mm_Vertical_SMD","Connector_PinSocket_1.27mm/PinSocket_2x04_P1.27mm_Horizontal","Connector_PinSocket_1.27mm/PinSocket_2x04_P1.27mm_Vertical","Connector_PinSocket_1.27mm/PinSocket_2x04_P1.27mm_Vertical_SMD","Connector_PinSocket_1.27mm/PinSocket_2x05_P1.27mm_Horizontal","Connector_PinSocket_1.27mm/PinSocket_2x05_P1.27mm_Vertical","Connector_PinSocket_1.27mm/PinSocket_2x05_P1.27mm_Vertical_SMD","Connector_PinSocket_1.27mm/PinSocket_2x06_P1.27mm_Horizontal","Connector_PinSocket_1.27mm/PinSocket_2x06_P1.27mm_Vertical","Connector_PinSocket_1.27mm/PinSocket_2x06_P1.27mm_Vertical_SMD","Connector_PinSocket_1.27mm/PinSocket_2x07_P1.27mm_Horizontal","Connector_PinSocket_1.27mm/PinSocket_2x07_P1.27mm_Vertical","Connector_PinSocket_1.27mm/PinSocket_2x07_P1.27mm_Vertical_SMD","Connector_PinSocket_1.27mm/PinSocket_2x08_P1.27mm_Horizontal","Connector_PinSocket_1.27mm/PinSocket_2x08_P1.27mm_Vertical","Connector_PinSocket_1.27mm/PinSocket_2x08_P1.27mm_Vertical_SMD","Connector_PinSocket_1.27mm/PinSocket_2x09_P1.27mm_Horizontal","Connector_PinSocket_1.27mm/PinSocket_2x09_P1.27mm_Vertical","Connector_PinSocket_1.27mm/PinSocket_2x09_P1.27mm_Vertical_SMD","Connector_PinSocket_1.27mm/PinSocket_2x10_P1.27mm_Horizontal","Connector_PinSocket_1.27mm/PinSocket_2x10_P1.27mm_Vertical","Connector_PinSocket_1.27mm/PinSocket_2x10_P1.27mm_Vertical_SMD","Connector_PinSocket_1.27mm/PinSocket_2x11_P1.27mm_Horizontal","Connector_PinSocket_1.27mm/PinSocket_2x11_P1.27mm_Vertical","Connector_PinSocket_1.27mm/PinSocket_2x11_P1.27mm_Vertical_SMD","Connector_PinSocket_1.27mm/PinSocket_2x12_P1.27mm_Horizontal","Connector_PinSocket_1.27mm/PinSocket_2x12_P1.27mm_Vertical","Connector_PinSocket_1.27mm/PinSocket_2x12_P1.27mm_Vertical_SMD","Connector_PinSocket_1.27mm/PinSocket_2x13_P1.27mm_Horizontal","Connector_PinSocket_1.27mm/PinSocket_2x13_P1.27mm_Vertical","Connector_PinSocket_1.27mm/PinSocket_2x13_P1.27mm_Vertical_SMD","Connector_PinSocket_1.27mm/PinSocket_2x14_P1.27mm_Horizontal","Connector_PinSocket_1.27mm/PinSocket_2x14_P1.27mm_Vertical","Connector_PinSocket_1.27mm/PinSocket_2x14_P1.27mm_Vertical_SMD","Connector_PinSocket_1.27mm/PinSocket_2x15_P1.27mm_Horizontal","Connector_PinSocket_1.27mm/PinSocket_2x15_P1.27mm_Vertical","Connector_PinSocket_1.27mm/PinSocket_2x15_P1.27mm_Vertical_SMD","Connector_PinSocket_1.27mm/PinSocket_2x16_P1.27mm_Horizontal","Connector_PinSocket_1.27mm/PinSocket_2x16_P1.27mm_Vertical","Connector_PinSocket_1.27mm/PinSocket_2x16_P1.27mm_Vertical_SMD","Connector_PinSocket_1.27mm/PinSocket_2x17_P1.27mm_Horizontal","Connector_PinSocket_1.27mm/PinSocket_2x17_P1.27mm_Vertical","Connector_PinSocket_1.27mm/PinSocket_2x17_P1.27mm_Vertical_SMD","Connector_PinSocket_1.27mm/PinSocket_2x18_P1.27mm_Horizontal","Connector_PinSocket_1.27mm/PinSocket_2x18_P1.27mm_Vertical","Connector_PinSocket_1.27mm/PinSocket_2x18_P1.27mm_Vertical_SMD","Connector_PinSocket_1.27mm/PinSocket_2x19_P1.27mm_Horizontal","Connector_PinSocket_1.27mm/PinSocket_2x19_P1.27mm_Vertical","Connector_PinSocket_1.27mm/PinSocket_2x19_P1.27mm_Vertical_SMD","Connector_PinSocket_1.27mm/PinSocket_2x20_P1.27mm_Horizontal","Connector_PinSocket_1.27mm/PinSocket_2x20_P1.27mm_Vertical","Connector_PinSocket_1.27mm/PinSocket_2x20_P1.27mm_Vertical_SMD","Connector_PinSocket_1.27mm/PinSocket_2x21_P1.27mm_Horizontal","Connector_PinSocket_1.27mm/PinSocket_2x21_P1.27mm_Vertical","Connector_PinSocket_1.27mm/PinSocket_2x21_P1.27mm_Vertical_SMD","Connector_PinSocket_1.27mm/PinSocket_2x22_P1.27mm_Horizontal","Connector_PinSocket_1.27mm/PinSocket_2x22_P1.27mm_Vertical","Connector_PinSocket_1.27mm/PinSocket_2x22_P1.27mm_Vertical_SMD","Connector_PinSocket_1.27mm/PinSocket_2x23_P1.27mm_Horizontal","Connector_PinSocket_1.27mm/PinSocket_2x23_P1.27mm_Vertical","Connector_PinSocket_1.27mm/PinSocket_2x23_P1.27mm_Vertical_SMD","Connector_PinSocket_1.27mm/PinSocket_2x24_P1.27mm_Horizontal","Connector_PinSocket_1.27mm/PinSocket_2x24_P1.27mm_Vertical","Connector_PinSocket_1.27mm/PinSocket_2x24_P1.27mm_Vertical_SMD","Connector_PinSocket_1.27mm/PinSocket_2x25_P1.27mm_Horizontal","Connector_PinSocket_1.27mm/PinSocket_2x25_P1.27mm_Vertical","Connector_PinSocket_1.27mm/PinSocket_2x25_P1.27mm_Vertical_SMD","Connector_PinSocket_1.27mm/PinSocket_2x26_P1.27mm_Horizontal","Connector_PinSocket_1.27mm/PinSocket_2x26_P1.27mm_Vertical","Connector_PinSocket_1.27mm/PinSocket_2x26_P1.27mm_Vertical_SMD","Connector_PinSocket_1.27mm/PinSocket_2x27_P1.27mm_Horizontal","Connector_PinSocket_1.27mm/PinSocket_2x27_P1.27mm_Vertical","Connector_PinSocket_1.27mm/PinSocket_2x27_P1.27mm_Vertical_SMD","Connector_PinSocket_1.27mm/PinSocket_2x28_P1.27mm_Horizontal","Connector_PinSocket_1.27mm/PinSocket_2x28_P1.27mm_Vertical","Connector_PinSocket_1.27mm/PinSocket_2x28_P1.27mm_Vertical_SMD","Connector_PinSocket_1.27mm/PinSocket_2x29_P1.27mm_Horizontal","Connector_PinSocket_1.27mm/PinSocket_2x29_P1.27mm_Vertical","Connector_PinSocket_1.27mm/PinSocket_2x29_P1.27mm_Vertical_SMD","Connector_PinSocket_1.27mm/PinSocket_2x30_P1.27mm_Horizontal","Connector_PinSocket_1.27mm/PinSocket_2x30_P1.27mm_Vertical","Connector_PinSocket_1.27mm/PinSocket_2x30_P1.27mm_Vertical_SMD","Connector_PinSocket_1.27mm/PinSocket_2x31_P1.27mm_Horizontal","Connector_PinSocket_1.27mm/PinSocket_2x31_P1.27mm_Vertical","Connector_PinSocket_1.27mm/PinSocket_2x31_P1.27mm_Vertical_SMD","Connector_PinSocket_1.27mm/PinSocket_2x32_P1.27mm_Horizontal","Connector_PinSocket_1.27mm/PinSocket_2x32_P1.27mm_Vertical","Connector_PinSocket_1.27mm/PinSocket_2x32_P1.27mm_Vertical_SMD","Connector_PinSocket_1.27mm/PinSocket_2x33_P1.27mm_Horizontal","Connector_PinSocket_1.27mm/PinSocket_2x33_P1.27mm_Vertical","Connector_PinSocket_1.27mm/PinSocket_2x33_P1.27mm_Vertical_SMD","Connector_PinSocket_1.27mm/PinSocket_2x34_P1.27mm_Horizontal","Connector_PinSocket_1.27mm/PinSocket_2x34_P1.27mm_Vertical","Connector_PinSocket_1.27mm/PinSocket_2x34_P1.27mm_Vertical_SMD","Connector_PinSocket_1.27mm/PinSocket_2x35_P1.27mm_Horizontal","Connector_PinSocket_1.27mm/PinSocket_2x35_P1.27mm_Vertical","Connector_PinSocket_1.27mm/PinSocket_2x35_P1.27mm_Vertical_SMD","Connector_PinSocket_1.27mm/PinSocket_2x36_P1.27mm_Horizontal","Connector_PinSocket_1.27mm/PinSocket_2x36_P1.27mm_Vertical","Connector_PinSocket_1.27mm/PinSocket_2x36_P1.27mm_Vertical_SMD","Connector_PinSocket_1.27mm/PinSocket_2x37_P1.27mm_Horizontal","Connector_PinSocket_1.27mm/PinSocket_2x37_P1.27mm_Vertical","Connector_PinSocket_1.27mm/PinSocket_2x37_P1.27mm_Vertical_SMD","Connector_PinSocket_1.27mm/PinSocket_2x38_P1.27mm_Horizontal","Connector_PinSocket_1.27mm/PinSocket_2x38_P1.27mm_Vertical","Connector_PinSocket_1.27mm/PinSocket_2x38_P1.27mm_Vertical_SMD","Connector_PinSocket_1.27mm/PinSocket_2x39_P1.27mm_Horizontal","Connector_PinSocket_1.27mm/PinSocket_2x39_P1.27mm_Vertical","Connector_PinSocket_1.27mm/PinSocket_2x39_P1.27mm_Vertical_SMD","Connector_PinSocket_1.27mm/PinSocket_2x40_P1.27mm_Horizontal","Connector_PinSocket_1.27mm/PinSocket_2x40_P1.27mm_Vertical","Connector_PinSocket_1.27mm/PinSocket_2x40_P1.27mm_Vertical_SMD","Connector_PinSocket_1.27mm/PinSocket_2x41_P1.27mm_Horizontal","Connector_PinSocket_1.27mm/PinSocket_2x42_P1.27mm_Horizontal","Connector_PinSocket_1.27mm/PinSocket_2x43_P1.27mm_Horizontal","Connector_PinSocket_1.27mm/PinSocket_2x44_P1.27mm_Horizontal","Connector_PinSocket_1.27mm/PinSocket_2x45_P1.27mm_Horizontal","Connector_PinSocket_1.27mm/PinSocket_2x46_P1.27mm_Horizontal","Connector_PinSocket_1.27mm/PinSocket_2x47_P1.27mm_Horizontal","Connector_PinSocket_1.27mm/PinSocket_2x48_P1.27mm_Horizontal","Connector_PinSocket_1.27mm/PinSocket_2x49_P1.27mm_Horizontal","Connector_PinSocket_1.27mm/PinSocket_2x50_P1.27mm_Horizontal","Connector_PinSocket_2.00mm/PinSocket_1x01_P2.00mm_Horizontal","Connector_PinSocket_2.00mm/PinSocket_1x01_P2.00mm_Vertical","Connector_PinSocket_2.00mm/PinSocket_1x02_P2.00mm_Horizontal","Connector_PinSocket_2.00mm/PinSocket_1x02_P2.00mm_Vertical","Connector_PinSocket_2.00mm/PinSocket_1x02_P2.00mm_Vertical_SMD_Pin1Left","Connector_PinSocket_2.00mm/PinSocket_1x02_P2.00mm_Vertical_SMD_Pin1Right","Connector_PinSocket_2.00mm/PinSocket_1x03_P2.00mm_Horizontal","Connector_PinSocket_2.00mm/PinSocket_1x03_P2.00mm_Vertical","Connector_PinSocket_2.00mm/PinSocket_1x03_P2.00mm_Vertical_SMD_Pin1Left","Connector_PinSocket_2.00mm/PinSocket_1x03_P2.00mm_Vertical_SMD_Pin1Right","Connector_PinSocket_2.00mm/PinSocket_1x04_P2.00mm_Horizontal","Connector_PinSocket_2.00mm/PinSocket_1x04_P2.00mm_Vertical","Connector_PinSocket_2.00mm/PinSocket_1x04_P2.00mm_Vertical_SMD_Pin1Left","Connector_PinSocket_2.00mm/PinSocket_1x04_P2.00mm_Vertical_SMD_Pin1Right","Connector_PinSocket_2.00mm/PinSocket_1x05_P2.00mm_Horizontal","Connector_PinSocket_2.00mm/PinSocket_1x05_P2.00mm_Vertical","Connector_PinSocket_2.00mm/PinSocket_1x05_P2.00mm_Vertical_SMD_Pin1Left","Connector_PinSocket_2.00mm/PinSocket_1x05_P2.00mm_Vertical_SMD_Pin1Right","Connector_PinSocket_2.00mm/PinSocket_1x06_P2.00mm_Horizontal","Connector_PinSocket_2.00mm/PinSocket_1x06_P2.00mm_Vertical","Connector_PinSocket_2.00mm/PinSocket_1x06_P2.00mm_Vertical_SMD_Pin1Left","Connector_PinSocket_2.00mm/PinSocket_1x06_P2.00mm_Vertical_SMD_Pin1Right","Connector_PinSocket_2.00mm/PinSocket_1x07_P2.00mm_Horizontal","Connector_PinSocket_2.00mm/PinSocket_1x07_P2.00mm_Vertical","Connector_PinSocket_2.00mm/PinSocket_1x07_P2.00mm_Vertical_SMD_Pin1Left","Connector_PinSocket_2.00mm/PinSocket_1x07_P2.00mm_Vertical_SMD_Pin1Right","Connector_PinSocket_2.00mm/PinSocket_1x08_P2.00mm_Horizontal","Connector_PinSocket_2.00mm/PinSocket_1x08_P2.00mm_Vertical","Connector_PinSocket_2.00mm/PinSocket_1x08_P2.00mm_Vertical_SMD_Pin1Left","Connector_PinSocket_2.00mm/PinSocket_1x08_P2.00mm_Vertical_SMD_Pin1Right","Connector_PinSocket_2.00mm/PinSocket_1x09_P2.00mm_Horizontal","Connector_PinSocket_2.00mm/PinSocket_1x09_P2.00mm_Vertical","Connector_PinSocket_2.00mm/PinSocket_1x09_P2.00mm_Vertical_SMD_Pin1Left","Connector_PinSocket_2.00mm/PinSocket_1x09_P2.00mm_Vertical_SMD_Pin1Right","Connector_PinSocket_2.00mm/PinSocket_1x10_P2.00mm_Horizontal","Connector_PinSocket_2.00mm/PinSocket_1x10_P2.00mm_Vertical","Connector_PinSocket_2.00mm/PinSocket_1x10_P2.00mm_Vertical_SMD_Pin1Left","Connector_PinSocket_2.00mm/PinSocket_1x10_P2.00mm_Vertical_SMD_Pin1Right","Connector_PinSocket_2.00mm/PinSocket_1x11_P2.00mm_Horizontal","Connector_PinSocket_2.00mm/PinSocket_1x11_P2.00mm_Vertical","Connector_PinSocket_2.00mm/PinSocket_1x11_P2.00mm_Vertical_SMD_Pin1Left","Connector_PinSocket_2.00mm/PinSocket_1x11_P2.00mm_Vertical_SMD_Pin1Right","Connector_PinSocket_2.00mm/PinSocket_1x12_P2.00mm_Horizontal","Connector_PinSocket_2.00mm/PinSocket_1x12_P2.00mm_Vertical","Connector_PinSocket_2.00mm/PinSocket_1x12_P2.00mm_Vertical_SMD_Pin1Left","Connector_PinSocket_2.00mm/PinSocket_1x12_P2.00mm_Vertical_SMD_Pin1Right","Connector_PinSocket_2.00mm/PinSocket_1x13_P2.00mm_Horizontal","Connector_PinSocket_2.00mm/PinSocket_1x13_P2.00mm_Vertical","Connector_PinSocket_2.00mm/PinSocket_1x13_P2.00mm_Vertical_SMD_Pin1Left","Connector_PinSocket_2.00mm/PinSocket_1x13_P2.00mm_Vertical_SMD_Pin1Right","Connector_PinSocket_2.00mm/PinSocket_1x14_P2.00mm_Horizontal","Connector_PinSocket_2.00mm/PinSocket_1x14_P2.00mm_Vertical","Connector_PinSocket_2.00mm/PinSocket_1x14_P2.00mm_Vertical_SMD_Pin1Left","Connector_PinSocket_2.00mm/PinSocket_1x14_P2.00mm_Vertical_SMD_Pin1Right","Connector_PinSocket_2.00mm/PinSocket_1x15_P2.00mm_Horizontal","Connector_PinSocket_2.00mm/PinSocket_1x15_P2.00mm_Vertical","Connector_PinSocket_2.00mm/PinSocket_1x15_P2.00mm_Vertical_SMD_Pin1Left","Connector_PinSocket_2.00mm/PinSocket_1x15_P2.00mm_Vertical_SMD_Pin1Right","Connector_PinSocket_2.00mm/PinSocket_1x16_P2.00mm_Horizontal","Connector_PinSocket_2.00mm/PinSocket_1x16_P2.00mm_Vertical","Connector_PinSocket_2.00mm/PinSocket_1x16_P2.00mm_Vertical_SMD_Pin1Left","Connector_PinSocket_2.00mm/PinSocket_1x16_P2.00mm_Vertical_SMD_Pin1Right","Connector_PinSocket_2.00mm/PinSocket_1x17_P2.00mm_Horizontal","Connector_PinSocket_2.00mm/PinSocket_1x17_P2.00mm_Vertical","Connector_PinSocket_2.00mm/PinSocket_1x17_P2.00mm_Vertical_SMD_Pin1Left","Connector_PinSocket_2.00mm/PinSocket_1x17_P2.00mm_Vertical_SMD_Pin1Right","Connector_PinSocket_2.00mm/PinSocket_1x18_P2.00mm_Horizontal","Connector_PinSocket_2.00mm/PinSocket_1x18_P2.00mm_Vertical","Connector_PinSocket_2.00mm/PinSocket_1x18_P2.00mm_Vertical_SMD_Pin1Left","Connector_PinSocket_2.00mm/PinSocket_1x18_P2.00mm_Vertical_SMD_Pin1Right","Connector_PinSocket_2.00mm/PinSocket_1x19_P2.00mm_Horizontal","Connector_PinSocket_2.00mm/PinSocket_1x19_P2.00mm_Vertical","Connector_PinSocket_2.00mm/PinSocket_1x19_P2.00mm_Vertical_SMD_Pin1Left","Connector_PinSocket_2.00mm/PinSocket_1x19_P2.00mm_Vertical_SMD_Pin1Right","Connector_PinSocket_2.00mm/PinSocket_1x20_P2.00mm_Horizontal","Connector_PinSocket_2.00mm/PinSocket_1x20_P2.00mm_Vertical","Connector_PinSocket_2.00mm/PinSocket_1x20_P2.00mm_Vertical_SMD_Pin1Left","Connector_PinSocket_2.00mm/PinSocket_1x20_P2.00mm_Vertical_SMD_Pin1Right","Connector_PinSocket_2.00mm/PinSocket_1x21_P2.00mm_Horizontal","Connector_PinSocket_2.00mm/PinSocket_1x21_P2.00mm_Vertical","Connector_PinSocket_2.00mm/PinSocket_1x21_P2.00mm_Vertical_SMD_Pin1Left","Connector_PinSocket_2.00mm/PinSocket_1x21_P2.00mm_Vertical_SMD_Pin1Right","Connector_PinSocket_2.00mm/PinSocket_1x22_P2.00mm_Horizontal","Connector_PinSocket_2.00mm/PinSocket_1x22_P2.00mm_Vertical","Connector_PinSocket_2.00mm/PinSocket_1x22_P2.00mm_Vertical_SMD_Pin1Left","Connector_PinSocket_2.00mm/PinSocket_1x22_P2.00mm_Vertical_SMD_Pin1Right","Connector_PinSocket_2.00mm/PinSocket_1x23_P2.00mm_Horizontal","Connector_PinSocket_2.00mm/PinSocket_1x23_P2.00mm_Vertical","Connector_PinSocket_2.00mm/PinSocket_1x23_P2.00mm_Vertical_SMD_Pin1Left","Connector_PinSocket_2.00mm/PinSocket_1x23_P2.00mm_Vertical_SMD_Pin1Right","Connector_PinSocket_2.00mm/PinSocket_1x24_P2.00mm_Horizontal","Connector_PinSocket_2.00mm/PinSocket_1x24_P2.00mm_Vertical","Connector_PinSocket_2.00mm/PinSocket_1x24_P2.00mm_Vertical_SMD_Pin1Left","Connector_PinSocket_2.00mm/PinSocket_1x24_P2.00mm_Vertical_SMD_Pin1Right","Connector_PinSocket_2.00mm/PinSocket_1x25_P2.00mm_Horizontal","Connector_PinSocket_2.00mm/PinSocket_1x25_P2.00mm_Vertical","Connector_PinSocket_2.00mm/PinSocket_1x25_P2.00mm_Vertical_SMD_Pin1Left","Connector_PinSocket_2.00mm/PinSocket_1x25_P2.00mm_Vertical_SMD_Pin1Right","Connector_PinSocket_2.00mm/PinSocket_1x26_P2.00mm_Horizontal","Connector_PinSocket_2.00mm/PinSocket_1x26_P2.00mm_Vertical","Connector_PinSocket_2.00mm/PinSocket_1x26_P2.00mm_Vertical_SMD_Pin1Left","Connector_PinSocket_2.00mm/PinSocket_1x26_P2.00mm_Vertical_SMD_Pin1Right","Connector_PinSocket_2.00mm/PinSocket_1x27_P2.00mm_Horizontal","Connector_PinSocket_2.00mm/PinSocket_1x27_P2.00mm_Vertical","Connector_PinSocket_2.00mm/PinSocket_1x27_P2.00mm_Vertical_SMD_Pin1Left","Connector_PinSocket_2.00mm/PinSocket_1x27_P2.00mm_Vertical_SMD_Pin1Right","Connector_PinSocket_2.00mm/PinSocket_1x28_P2.00mm_Horizontal","Connector_PinSocket_2.00mm/PinSocket_1x28_P2.00mm_Vertical","Connector_PinSocket_2.00mm/PinSocket_1x28_P2.00mm_Vertical_SMD_Pin1Left","Connector_PinSocket_2.00mm/PinSocket_1x28_P2.00mm_Vertical_SMD_Pin1Right","Connector_PinSocket_2.00mm/PinSocket_1x29_P2.00mm_Horizontal","Connector_PinSocket_2.00mm/PinSocket_1x29_P2.00mm_Vertical","Connector_PinSocket_2.00mm/PinSocket_1x29_P2.00mm_Vertical_SMD_Pin1Left","Connector_PinSocket_2.00mm/PinSocket_1x29_P2.00mm_Vertical_SMD_Pin1Right","Connector_PinSocket_2.00mm/PinSocket_1x30_P2.00mm_Horizontal","Connector_PinSocket_2.00mm/PinSocket_1x30_P2.00mm_Vertical","Connector_PinSocket_2.00mm/PinSocket_1x30_P2.00mm_Vertical_SMD_Pin1Left","Connector_PinSocket_2.00mm/PinSocket_1x30_P2.00mm_Vertical_SMD_Pin1Right","Connector_PinSocket_2.00mm/PinSocket_1x31_P2.00mm_Horizontal","Connector_PinSocket_2.00mm/PinSocket_1x31_P2.00mm_Vertical","Connector_PinSocket_2.00mm/PinSocket_1x31_P2.00mm_Vertical_SMD_Pin1Left","Connector_PinSocket_2.00mm/PinSocket_1x31_P2.00mm_Vertical_SMD_Pin1Right","Connector_PinSocket_2.00mm/PinSocket_1x32_P2.00mm_Horizontal","Connector_PinSocket_2.00mm/PinSocket_1x32_P2.00mm_Vertical","Connector_PinSocket_2.00mm/PinSocket_1x32_P2.00mm_Vertical_SMD_Pin1Left","Connector_PinSocket_2.00mm/PinSocket_1x32_P2.00mm_Vertical_SMD_Pin1Right","Connector_PinSocket_2.00mm/PinSocket_1x33_P2.00mm_Horizontal","Connector_PinSocket_2.00mm/PinSocket_1x33_P2.00mm_Vertical","Connector_PinSocket_2.00mm/PinSocket_1x33_P2.00mm_Vertical_SMD_Pin1Left","Connector_PinSocket_2.00mm/PinSocket_1x33_P2.00mm_Vertical_SMD_Pin1Right","Connector_PinSocket_2.00mm/PinSocket_1x34_P2.00mm_Horizontal","Connector_PinSocket_2.00mm/PinSocket_1x34_P2.00mm_Vertical","Connector_PinSocket_2.00mm/PinSocket_1x34_P2.00mm_Vertical_SMD_Pin1Left","Connector_PinSocket_2.00mm/PinSocket_1x34_P2.00mm_Vertical_SMD_Pin1Right","Connector_PinSocket_2.00mm/PinSocket_1x35_P2.00mm_Horizontal","Connector_PinSocket_2.00mm/PinSocket_1x35_P2.00mm_Vertical","Connector_PinSocket_2.00mm/PinSocket_1x35_P2.00mm_Vertical_SMD_Pin1Left","Connector_PinSocket_2.00mm/PinSocket_1x35_P2.00mm_Vertical_SMD_Pin1Right","Connector_PinSocket_2.00mm/PinSocket_1x36_P2.00mm_Horizontal","Connector_PinSocket_2.00mm/PinSocket_1x36_P2.00mm_Vertical","Connector_PinSocket_2.00mm/PinSocket_1x36_P2.00mm_Vertical_SMD_Pin1Left","Connector_PinSocket_2.00mm/PinSocket_1x36_P2.00mm_Vertical_SMD_Pin1Right","Connector_PinSocket_2.00mm/PinSocket_1x37_P2.00mm_Horizontal","Connector_PinSocket_2.00mm/PinSocket_1x37_P2.00mm_Vertical","Connector_PinSocket_2.00mm/PinSocket_1x37_P2.00mm_Vertical_SMD_Pin1Left","Connector_PinSocket_2.00mm/PinSocket_1x37_P2.00mm_Vertical_SMD_Pin1Right","Connector_PinSocket_2.00mm/PinSocket_1x38_P2.00mm_Horizontal","Connector_PinSocket_2.00mm/PinSocket_1x38_P2.00mm_Vertical","Connector_PinSocket_2.00mm/PinSocket_1x38_P2.00mm_Vertical_SMD_Pin1Left","Connector_PinSocket_2.00mm/PinSocket_1x38_P2.00mm_Vertical_SMD_Pin1Right","Connector_PinSocket_2.00mm/PinSocket_1x39_P2.00mm_Horizontal","Connector_PinSocket_2.00mm/PinSocket_1x39_P2.00mm_Vertical","Connector_PinSocket_2.00mm/PinSocket_1x39_P2.00mm_Vertical_SMD_Pin1Left","Connector_PinSocket_2.00mm/PinSocket_1x39_P2.00mm_Vertical_SMD_Pin1Right","Connector_PinSocket_2.00mm/PinSocket_1x40_P2.00mm_Horizontal","Connector_PinSocket_2.00mm/PinSocket_1x40_P2.00mm_Vertical","Connector_PinSocket_2.00mm/PinSocket_1x40_P2.00mm_Vertical_SMD_Pin1Left","Connector_PinSocket_2.00mm/PinSocket_1x40_P2.00mm_Vertical_SMD_Pin1Right","Connector_PinSocket_2.00mm/PinSocket_2x01_P2.00mm_Horizontal","Connector_PinSocket_2.00mm/PinSocket_2x01_P2.00mm_Vertical","Connector_PinSocket_2.00mm/PinSocket_2x01_P2.00mm_Vertical_SMD","Connector_PinSocket_2.00mm/PinSocket_2x02_P2.00mm_Horizontal","Connector_PinSocket_2.00mm/PinSocket_2x02_P2.00mm_Vertical","Connector_PinSocket_2.00mm/PinSocket_2x02_P2.00mm_Vertical_SMD","Connector_PinSocket_2.00mm/PinSocket_2x03_P2.00mm_Horizontal","Connector_PinSocket_2.00mm/PinSocket_2x03_P2.00mm_Vertical","Connector_PinSocket_2.00mm/PinSocket_2x03_P2.00mm_Vertical_SMD","Connector_PinSocket_2.00mm/PinSocket_2x04_P2.00mm_Horizontal","Connector_PinSocket_2.00mm/PinSocket_2x04_P2.00mm_Vertical","Connector_PinSocket_2.00mm/PinSocket_2x04_P2.00mm_Vertical_SMD","Connector_PinSocket_2.00mm/PinSocket_2x05_P2.00mm_Horizontal","Connector_PinSocket_2.00mm/PinSocket_2x05_P2.00mm_Vertical","Connector_PinSocket_2.00mm/PinSocket_2x05_P2.00mm_Vertical_SMD","Connector_PinSocket_2.00mm/PinSocket_2x06_P2.00mm_Horizontal","Connector_PinSocket_2.00mm/PinSocket_2x06_P2.00mm_Vertical","Connector_PinSocket_2.00mm/PinSocket_2x06_P2.00mm_Vertical_SMD","Connector_PinSocket_2.00mm/PinSocket_2x07_P2.00mm_Horizontal","Connector_PinSocket_2.00mm/PinSocket_2x07_P2.00mm_Vertical","Connector_PinSocket_2.00mm/PinSocket_2x07_P2.00mm_Vertical_SMD","Connector_PinSocket_2.00mm/PinSocket_2x08_P2.00mm_Horizontal","Connector_PinSocket_2.00mm/PinSocket_2x08_P2.00mm_Vertical","Connector_PinSocket_2.00mm/PinSocket_2x08_P2.00mm_Vertical_SMD","Connector_PinSocket_2.00mm/PinSocket_2x09_P2.00mm_Horizontal","Connector_PinSocket_2.00mm/PinSocket_2x09_P2.00mm_Vertical","Connector_PinSocket_2.00mm/PinSocket_2x09_P2.00mm_Vertical_SMD","Connector_PinSocket_2.00mm/PinSocket_2x10_P2.00mm_Horizontal","Connector_PinSocket_2.00mm/PinSocket_2x10_P2.00mm_Vertical","Connector_PinSocket_2.00mm/PinSocket_2x10_P2.00mm_Vertical_SMD","Connector_PinSocket_2.00mm/PinSocket_2x11_P2.00mm_Horizontal","Connector_PinSocket_2.00mm/PinSocket_2x11_P2.00mm_Vertical","Connector_PinSocket_2.00mm/PinSocket_2x11_P2.00mm_Vertical_SMD","Connector_PinSocket_2.00mm/PinSocket_2x12_P2.00mm_Horizontal","Connector_PinSocket_2.00mm/PinSocket_2x12_P2.00mm_Vertical","Connector_PinSocket_2.00mm/PinSocket_2x12_P2.00mm_Vertical_SMD","Connector_PinSocket_2.00mm/PinSocket_2x13_P2.00mm_Horizontal","Connector_PinSocket_2.00mm/PinSocket_2x13_P2.00mm_Vertical","Connector_PinSocket_2.00mm/PinSocket_2x13_P2.00mm_Vertical_SMD","Connector_PinSocket_2.00mm/PinSocket_2x14_P2.00mm_Horizontal","Connector_PinSocket_2.00mm/PinSocket_2x14_P2.00mm_Vertical","Connector_PinSocket_2.00mm/PinSocket_2x14_P2.00mm_Vertical_SMD","Connector_PinSocket_2.00mm/PinSocket_2x15_P2.00mm_Horizontal","Connector_PinSocket_2.00mm/PinSocket_2x15_P2.00mm_Vertical","Connector_PinSocket_2.00mm/PinSocket_2x15_P2.00mm_Vertical_SMD","Connector_PinSocket_2.00mm/PinSocket_2x16_P2.00mm_Horizontal","Connector_PinSocket_2.00mm/PinSocket_2x16_P2.00mm_Vertical","Connector_PinSocket_2.00mm/PinSocket_2x16_P2.00mm_Vertical_SMD","Connector_PinSocket_2.00mm/PinSocket_2x17_P2.00mm_Horizontal","Connector_PinSocket_2.00mm/PinSocket_2x17_P2.00mm_Vertical","Connector_PinSocket_2.00mm/PinSocket_2x17_P2.00mm_Vertical_SMD","Connector_PinSocket_2.00mm/PinSocket_2x18_P2.00mm_Horizontal","Connector_PinSocket_2.00mm/PinSocket_2x18_P2.00mm_Vertical","Connector_PinSocket_2.00mm/PinSocket_2x18_P2.00mm_Vertical_SMD","Connector_PinSocket_2.00mm/PinSocket_2x19_P2.00mm_Horizontal","Connector_PinSocket_2.00mm/PinSocket_2x19_P2.00mm_Vertical","Connector_PinSocket_2.00mm/PinSocket_2x19_P2.00mm_Vertical_SMD","Connector_PinSocket_2.00mm/PinSocket_2x20_P2.00mm_Horizontal","Connector_PinSocket_2.00mm/PinSocket_2x20_P2.00mm_Vertical","Connector_PinSocket_2.00mm/PinSocket_2x20_P2.00mm_Vertical_SMD","Connector_PinSocket_2.00mm/PinSocket_2x21_P2.00mm_Horizontal","Connector_PinSocket_2.00mm/PinSocket_2x21_P2.00mm_Vertical","Connector_PinSocket_2.00mm/PinSocket_2x21_P2.00mm_Vertical_SMD","Connector_PinSocket_2.00mm/PinSocket_2x22_P2.00mm_Horizontal","Connector_PinSocket_2.00mm/PinSocket_2x22_P2.00mm_Vertical","Connector_PinSocket_2.00mm/PinSocket_2x22_P2.00mm_Vertical_SMD","Connector_PinSocket_2.00mm/PinSocket_2x23_P2.00mm_Horizontal","Connector_PinSocket_2.00mm/PinSocket_2x23_P2.00mm_Vertical","Connector_PinSocket_2.00mm/PinSocket_2x23_P2.00mm_Vertical_SMD","Connector_PinSocket_2.00mm/PinSocket_2x24_P2.00mm_Horizontal","Connector_PinSocket_2.00mm/PinSocket_2x24_P2.00mm_Vertical","Connector_PinSocket_2.00mm/PinSocket_2x24_P2.00mm_Vertical_SMD","Connector_PinSocket_2.00mm/PinSocket_2x25_P2.00mm_Horizontal","Connector_PinSocket_2.00mm/PinSocket_2x25_P2.00mm_Vertical","Connector_PinSocket_2.00mm/PinSocket_2x25_P2.00mm_Vertical_SMD","Connector_PinSocket_2.00mm/PinSocket_2x26_P2.00mm_Horizontal","Connector_PinSocket_2.00mm/PinSocket_2x26_P2.00mm_Vertical","Connector_PinSocket_2.00mm/PinSocket_2x26_P2.00mm_Vertical_SMD","Connector_PinSocket_2.00mm/PinSocket_2x27_P2.00mm_Horizontal","Connector_PinSocket_2.00mm/PinSocket_2x27_P2.00mm_Vertical","Connector_PinSocket_2.00mm/PinSocket_2x27_P2.00mm_Vertical_SMD","Connector_PinSocket_2.00mm/PinSocket_2x28_P2.00mm_Horizontal","Connector_PinSocket_2.00mm/PinSocket_2x28_P2.00mm_Vertical","Connector_PinSocket_2.00mm/PinSocket_2x28_P2.00mm_Vertical_SMD","Connector_PinSocket_2.00mm/PinSocket_2x29_P2.00mm_Horizontal","Connector_PinSocket_2.00mm/PinSocket_2x29_P2.00mm_Vertical","Connector_PinSocket_2.00mm/PinSocket_2x29_P2.00mm_Vertical_SMD","Connector_PinSocket_2.00mm/PinSocket_2x30_P2.00mm_Horizontal","Connector_PinSocket_2.00mm/PinSocket_2x30_P2.00mm_Vertical","Connector_PinSocket_2.00mm/PinSocket_2x30_P2.00mm_Vertical_SMD","Connector_PinSocket_2.00mm/PinSocket_2x31_P2.00mm_Horizontal","Connector_PinSocket_2.00mm/PinSocket_2x31_P2.00mm_Vertical","Connector_PinSocket_2.00mm/PinSocket_2x31_P2.00mm_Vertical_SMD","Connector_PinSocket_2.00mm/PinSocket_2x32_P2.00mm_Horizontal","Connector_PinSocket_2.00mm/PinSocket_2x32_P2.00mm_Vertical","Connector_PinSocket_2.00mm/PinSocket_2x32_P2.00mm_Vertical_SMD","Connector_PinSocket_2.00mm/PinSocket_2x33_P2.00mm_Horizontal","Connector_PinSocket_2.00mm/PinSocket_2x33_P2.00mm_Vertical","Connector_PinSocket_2.00mm/PinSocket_2x33_P2.00mm_Vertical_SMD","Connector_PinSocket_2.00mm/PinSocket_2x34_P2.00mm_Horizontal","Connector_PinSocket_2.00mm/PinSocket_2x34_P2.00mm_Vertical","Connector_PinSocket_2.00mm/PinSocket_2x34_P2.00mm_Vertical_SMD","Connector_PinSocket_2.00mm/PinSocket_2x35_P2.00mm_Horizontal","Connector_PinSocket_2.00mm/PinSocket_2x35_P2.00mm_Vertical","Connector_PinSocket_2.00mm/PinSocket_2x35_P2.00mm_Vertical_SMD","Connector_PinSocket_2.00mm/PinSocket_2x36_P2.00mm_Horizontal","Connector_PinSocket_2.00mm/PinSocket_2x36_P2.00mm_Vertical","Connector_PinSocket_2.00mm/PinSocket_2x36_P2.00mm_Vertical_SMD","Connector_PinSocket_2.00mm/PinSocket_2x37_P2.00mm_Horizontal","Connector_PinSocket_2.00mm/PinSocket_2x37_P2.00mm_Vertical","Connector_PinSocket_2.00mm/PinSocket_2x37_P2.00mm_Vertical_SMD","Connector_PinSocket_2.00mm/PinSocket_2x38_P2.00mm_Horizontal","Connector_PinSocket_2.00mm/PinSocket_2x38_P2.00mm_Vertical","Connector_PinSocket_2.00mm/PinSocket_2x38_P2.00mm_Vertical_SMD","Connector_PinSocket_2.00mm/PinSocket_2x39_P2.00mm_Horizontal","Connector_PinSocket_2.00mm/PinSocket_2x39_P2.00mm_Vertical","Connector_PinSocket_2.00mm/PinSocket_2x39_P2.00mm_Vertical_SMD","Connector_PinSocket_2.00mm/PinSocket_2x40_P2.00mm_Horizontal","Connector_PinSocket_2.00mm/PinSocket_2x40_P2.00mm_Vertical","Connector_PinSocket_2.00mm/PinSocket_2x40_P2.00mm_Vertical_SMD","Connector_PinSocket_2.54mm/PinSocket_1x01_P2.54mm_Horizontal","Connector_PinSocket_2.54mm/PinSocket_1x01_P2.54mm_Vertical","Connector_PinSocket_2.54mm/PinSocket_1x02_P2.54mm_Horizontal","Connector_PinSocket_2.54mm/PinSocket_1x02_P2.54mm_Vertical","Connector_PinSocket_2.54mm/PinSocket_1x02_P2.54mm_Vertical_SMD_Pin1Left","Connector_PinSocket_2.54mm/PinSocket_1x02_P2.54mm_Vertical_SMD_Pin1Right","Connector_PinSocket_2.54mm/PinSocket_1x03_P2.54mm_Horizontal","Connector_PinSocket_2.54mm/PinSocket_1x03_P2.54mm_Vertical","Connector_PinSocket_2.54mm/PinSocket_1x03_P2.54mm_Vertical_SMD_Pin1Left","Connector_PinSocket_2.54mm/PinSocket_1x03_P2.54mm_Vertical_SMD_Pin1Right","Connector_PinSocket_2.54mm/PinSocket_1x04_P2.54mm_Horizontal","Connector_PinSocket_2.54mm/PinSocket_1x04_P2.54mm_Vertical","Connector_PinSocket_2.54mm/PinSocket_1x04_P2.54mm_Vertical_SMD_Pin1Left","Connector_PinSocket_2.54mm/PinSocket_1x04_P2.54mm_Vertical_SMD_Pin1Right","Connector_PinSocket_2.54mm/PinSocket_1x05_P2.54mm_Horizontal","Connector_PinSocket_2.54mm/PinSocket_1x05_P2.54mm_Vertical","Connector_PinSocket_2.54mm/PinSocket_1x05_P2.54mm_Vertical_SMD_Pin1Left","Connector_PinSocket_2.54mm/PinSocket_1x05_P2.54mm_Vertical_SMD_Pin1Right","Connector_PinSocket_2.54mm/PinSocket_1x06_P2.54mm_Horizontal","Connector_PinSocket_2.54mm/PinSocket_1x06_P2.54mm_Vertical","Connector_PinSocket_2.54mm/PinSocket_1x06_P2.54mm_Vertical_SMD_Pin1Left","Connector_PinSocket_2.54mm/PinSocket_1x06_P2.54mm_Vertical_SMD_Pin1Right","Connector_PinSocket_2.54mm/PinSocket_1x07_P2.54mm_Horizontal","Connector_PinSocket_2.54mm/PinSocket_1x07_P2.54mm_Vertical","Connector_PinSocket_2.54mm/PinSocket_1x07_P2.54mm_Vertical_SMD_Pin1Left","Connector_PinSocket_2.54mm/PinSocket_1x07_P2.54mm_Vertical_SMD_Pin1Right","Connector_PinSocket_2.54mm/PinSocket_1x08_P2.54mm_Horizontal","Connector_PinSocket_2.54mm/PinSocket_1x08_P2.54mm_Vertical","Connector_PinSocket_2.54mm/PinSocket_1x08_P2.54mm_Vertical_SMD_Pin1Left","Connector_PinSocket_2.54mm/PinSocket_1x08_P2.54mm_Vertical_SMD_Pin1Right","Connector_PinSocket_2.54mm/PinSocket_1x09_P2.54mm_Horizontal","Connector_PinSocket_2.54mm/PinSocket_1x09_P2.54mm_Vertical","Connector_PinSocket_2.54mm/PinSocket_1x09_P2.54mm_Vertical_SMD_Pin1Left","Connector_PinSocket_2.54mm/PinSocket_1x09_P2.54mm_Vertical_SMD_Pin1Right","Connector_PinSocket_2.54mm/PinSocket_1x10_P2.54mm_Horizontal","Connector_PinSocket_2.54mm/PinSocket_1x10_P2.54mm_Vertical","Connector_PinSocket_2.54mm/PinSocket_1x10_P2.54mm_Vertical_SMD_Pin1Left","Connector_PinSocket_2.54mm/PinSocket_1x10_P2.54mm_Vertical_SMD_Pin1Right","Connector_PinSocket_2.54mm/PinSocket_1x11_P2.54mm_Horizontal","Connector_PinSocket_2.54mm/PinSocket_1x11_P2.54mm_Vertical","Connector_PinSocket_2.54mm/PinSocket_1x11_P2.54mm_Vertical_SMD_Pin1Left","Connector_PinSocket_2.54mm/PinSocket_1x11_P2.54mm_Vertical_SMD_Pin1Right","Connector_PinSocket_2.54mm/PinSocket_1x12_P2.54mm_Horizontal","Connector_PinSocket_2.54mm/PinSocket_1x12_P2.54mm_Vertical","Connector_PinSocket_2.54mm/PinSocket_1x12_P2.54mm_Vertical_SMD_Pin1Left","Connector_PinSocket_2.54mm/PinSocket_1x12_P2.54mm_Vertical_SMD_Pin1Right","Connector_PinSocket_2.54mm/PinSocket_1x13_P2.54mm_Horizontal","Connector_PinSocket_2.54mm/PinSocket_1x13_P2.54mm_Vertical","Connector_PinSocket_2.54mm/PinSocket_1x13_P2.54mm_Vertical_SMD_Pin1Left","Connector_PinSocket_2.54mm/PinSocket_1x13_P2.54mm_Vertical_SMD_Pin1Right","Connector_PinSocket_2.54mm/PinSocket_1x14_P2.54mm_Horizontal","Connector_PinSocket_2.54mm/PinSocket_1x14_P2.54mm_Vertical","Connector_PinSocket_2.54mm/PinSocket_1x14_P2.54mm_Vertical_SMD_Pin1Left","Connector_PinSocket_2.54mm/PinSocket_1x14_P2.54mm_Vertical_SMD_Pin1Right","Connector_PinSocket_2.54mm/PinSocket_1x15_P2.54mm_Horizontal","Connector_PinSocket_2.54mm/PinSocket_1x15_P2.54mm_Vertical","Connector_PinSocket_2.54mm/PinSocket_1x15_P2.54mm_Vertical_SMD_Pin1Left","Connector_PinSocket_2.54mm/PinSocket_1x15_P2.54mm_Vertical_SMD_Pin1Right","Connector_PinSocket_2.54mm/PinSocket_1x16_P2.54mm_Horizontal","Connector_PinSocket_2.54mm/PinSocket_1x16_P2.54mm_Vertical","Connector_PinSocket_2.54mm/PinSocket_1x16_P2.54mm_Vertical_SMD_Pin1Left","Connector_PinSocket_2.54mm/PinSocket_1x16_P2.54mm_Vertical_SMD_Pin1Right","Connector_PinSocket_2.54mm/PinSocket_1x17_P2.54mm_Horizontal","Connector_PinSocket_2.54mm/PinSocket_1x17_P2.54mm_Vertical","Connector_PinSocket_2.54mm/PinSocket_1x17_P2.54mm_Vertical_SMD_Pin1Left","Connector_PinSocket_2.54mm/PinSocket_1x17_P2.54mm_Vertical_SMD_Pin1Right","Connector_PinSocket_2.54mm/PinSocket_1x18_P2.54mm_Horizontal","Connector_PinSocket_2.54mm/PinSocket_1x18_P2.54mm_Vertical","Connector_PinSocket_2.54mm/PinSocket_1x18_P2.54mm_Vertical_SMD_Pin1Left","Connector_PinSocket_2.54mm/PinSocket_1x18_P2.54mm_Vertical_SMD_Pin1Right","Connector_PinSocket_2.54mm/PinSocket_1x19_P2.54mm_Horizontal","Connector_PinSocket_2.54mm/PinSocket_1x19_P2.54mm_Vertical","Connector_PinSocket_2.54mm/PinSocket_1x19_P2.54mm_Vertical_SMD_Pin1Left","Connector_PinSocket_2.54mm/PinSocket_1x19_P2.54mm_Vertical_SMD_Pin1Right","Connector_PinSocket_2.54mm/PinSocket_1x20_P2.54mm_Horizontal","Connector_PinSocket_2.54mm/PinSocket_1x20_P2.54mm_Vertical","Connector_PinSocket_2.54mm/PinSocket_1x20_P2.54mm_Vertical_SMD_Pin1Left","Connector_PinSocket_2.54mm/PinSocket_1x20_P2.54mm_Vertical_SMD_Pin1Right","Connector_PinSocket_2.54mm/PinSocket_1x21_P2.54mm_Horizontal","Connector_PinSocket_2.54mm/PinSocket_1x21_P2.54mm_Vertical","Connector_PinSocket_2.54mm/PinSocket_1x21_P2.54mm_Vertical_SMD_Pin1Left","Connector_PinSocket_2.54mm/PinSocket_1x21_P2.54mm_Vertical_SMD_Pin1Right","Connector_PinSocket_2.54mm/PinSocket_1x22_P2.54mm_Horizontal","Connector_PinSocket_2.54mm/PinSocket_1x22_P2.54mm_Vertical","Connector_PinSocket_2.54mm/PinSocket_1x22_P2.54mm_Vertical_SMD_Pin1Left","Connector_PinSocket_2.54mm/PinSocket_1x22_P2.54mm_Vertical_SMD_Pin1Right","Connector_PinSocket_2.54mm/PinSocket_1x23_P2.54mm_Horizontal","Connector_PinSocket_2.54mm/PinSocket_1x23_P2.54mm_Vertical","Connector_PinSocket_2.54mm/PinSocket_1x23_P2.54mm_Vertical_SMD_Pin1Left","Connector_PinSocket_2.54mm/PinSocket_1x23_P2.54mm_Vertical_SMD_Pin1Right","Connector_PinSocket_2.54mm/PinSocket_1x24_P2.54mm_Horizontal","Connector_PinSocket_2.54mm/PinSocket_1x24_P2.54mm_Vertical","Connector_PinSocket_2.54mm/PinSocket_1x24_P2.54mm_Vertical_SMD_Pin1Left","Connector_PinSocket_2.54mm/PinSocket_1x24_P2.54mm_Vertical_SMD_Pin1Right","Connector_PinSocket_2.54mm/PinSocket_1x25_P2.54mm_Horizontal","Connector_PinSocket_2.54mm/PinSocket_1x25_P2.54mm_Vertical","Connector_PinSocket_2.54mm/PinSocket_1x25_P2.54mm_Vertical_SMD_Pin1Left","Connector_PinSocket_2.54mm/PinSocket_1x25_P2.54mm_Vertical_SMD_Pin1Right","Connector_PinSocket_2.54mm/PinSocket_1x26_P2.54mm_Horizontal","Connector_PinSocket_2.54mm/PinSocket_1x26_P2.54mm_Vertical","Connector_PinSocket_2.54mm/PinSocket_1x26_P2.54mm_Vertical_SMD_Pin1Left","Connector_PinSocket_2.54mm/PinSocket_1x26_P2.54mm_Vertical_SMD_Pin1Right","Connector_PinSocket_2.54mm/PinSocket_1x27_P2.54mm_Horizontal","Connector_PinSocket_2.54mm/PinSocket_1x27_P2.54mm_Vertical","Connector_PinSocket_2.54mm/PinSocket_1x27_P2.54mm_Vertical_SMD_Pin1Left","Connector_PinSocket_2.54mm/PinSocket_1x27_P2.54mm_Vertical_SMD_Pin1Right","Connector_PinSocket_2.54mm/PinSocket_1x28_P2.54mm_Horizontal","Connector_PinSocket_2.54mm/PinSocket_1x28_P2.54mm_Vertical","Connector_PinSocket_2.54mm/PinSocket_1x28_P2.54mm_Vertical_SMD_Pin1Left","Connector_PinSocket_2.54mm/PinSocket_1x28_P2.54mm_Vertical_SMD_Pin1Right","Connector_PinSocket_2.54mm/PinSocket_1x29_P2.54mm_Horizontal","Connector_PinSocket_2.54mm/PinSocket_1x29_P2.54mm_Vertical","Connector_PinSocket_2.54mm/PinSocket_1x29_P2.54mm_Vertical_SMD_Pin1Left","Connector_PinSocket_2.54mm/PinSocket_1x29_P2.54mm_Vertical_SMD_Pin1Right","Connector_PinSocket_2.54mm/PinSocket_1x30_P2.54mm_Horizontal","Connector_PinSocket_2.54mm/PinSocket_1x30_P2.54mm_Vertical","Connector_PinSocket_2.54mm/PinSocket_1x30_P2.54mm_Vertical_SMD_Pin1Left","Connector_PinSocket_2.54mm/PinSocket_1x30_P2.54mm_Vertical_SMD_Pin1Right","Connector_PinSocket_2.54mm/PinSocket_1x31_P2.54mm_Horizontal","Connector_PinSocket_2.54mm/PinSocket_1x31_P2.54mm_Vertical","Connector_PinSocket_2.54mm/PinSocket_1x31_P2.54mm_Vertical_SMD_Pin1Left","Connector_PinSocket_2.54mm/PinSocket_1x31_P2.54mm_Vertical_SMD_Pin1Right","Connector_PinSocket_2.54mm/PinSocket_1x32_P2.54mm_Horizontal","Connector_PinSocket_2.54mm/PinSocket_1x32_P2.54mm_Vertical","Connector_PinSocket_2.54mm/PinSocket_1x32_P2.54mm_Vertical_SMD_Pin1Left","Connector_PinSocket_2.54mm/PinSocket_1x32_P2.54mm_Vertical_SMD_Pin1Right","Connector_PinSocket_2.54mm/PinSocket_1x33_P2.54mm_Horizontal","Connector_PinSocket_2.54mm/PinSocket_1x33_P2.54mm_Vertical","Connector_PinSocket_2.54mm/PinSocket_1x33_P2.54mm_Vertical_SMD_Pin1Left","Connector_PinSocket_2.54mm/PinSocket_1x33_P2.54mm_Vertical_SMD_Pin1Right","Connector_PinSocket_2.54mm/PinSocket_1x34_P2.54mm_Horizontal","Connector_PinSocket_2.54mm/PinSocket_1x34_P2.54mm_Vertical","Connector_PinSocket_2.54mm/PinSocket_1x34_P2.54mm_Vertical_SMD_Pin1Left","Connector_PinSocket_2.54mm/PinSocket_1x34_P2.54mm_Vertical_SMD_Pin1Right","Connector_PinSocket_2.54mm/PinSocket_1x35_P2.54mm_Horizontal","Connector_PinSocket_2.54mm/PinSocket_1x35_P2.54mm_Vertical","Connector_PinSocket_2.54mm/PinSocket_1x35_P2.54mm_Vertical_SMD_Pin1Left","Connector_PinSocket_2.54mm/PinSocket_1x35_P2.54mm_Vertical_SMD_Pin1Right","Connector_PinSocket_2.54mm/PinSocket_1x36_P2.54mm_Horizontal","Connector_PinSocket_2.54mm/PinSocket_1x36_P2.54mm_Vertical","Connector_PinSocket_2.54mm/PinSocket_1x36_P2.54mm_Vertical_SMD_Pin1Left","Connector_PinSocket_2.54mm/PinSocket_1x36_P2.54mm_Vertical_SMD_Pin1Right","Connector_PinSocket_2.54mm/PinSocket_1x37_P2.54mm_Horizontal","Connector_PinSocket_2.54mm/PinSocket_1x37_P2.54mm_Vertical","Connector_PinSocket_2.54mm/PinSocket_1x37_P2.54mm_Vertical_SMD_Pin1Left","Connector_PinSocket_2.54mm/PinSocket_1x37_P2.54mm_Vertical_SMD_Pin1Right","Connector_PinSocket_2.54mm/PinSocket_1x38_P2.54mm_Horizontal","Connector_PinSocket_2.54mm/PinSocket_1x38_P2.54mm_Vertical","Connector_PinSocket_2.54mm/PinSocket_1x38_P2.54mm_Vertical_SMD_Pin1Left","Connector_PinSocket_2.54mm/PinSocket_1x38_P2.54mm_Vertical_SMD_Pin1Right","Connector_PinSocket_2.54mm/PinSocket_1x39_P2.54mm_Horizontal","Connector_PinSocket_2.54mm/PinSocket_1x39_P2.54mm_Vertical","Connector_PinSocket_2.54mm/PinSocket_1x39_P2.54mm_Vertical_SMD_Pin1Left","Connector_PinSocket_2.54mm/PinSocket_1x39_P2.54mm_Vertical_SMD_Pin1Right","Connector_PinSocket_2.54mm/PinSocket_1x40_P2.54mm_Horizontal","Connector_PinSocket_2.54mm/PinSocket_1x40_P2.54mm_Vertical","Connector_PinSocket_2.54mm/PinSocket_1x40_P2.54mm_Vertical_SMD_Pin1Left","Connector_PinSocket_2.54mm/PinSocket_1x40_P2.54mm_Vertical_SMD_Pin1Right","Connector_PinSocket_2.54mm/PinSocket_2x01_P2.54mm_Horizontal","Connector_PinSocket_2.54mm/PinSocket_2x01_P2.54mm_Vertical","Connector_PinSocket_2.54mm/PinSocket_2x01_P2.54mm_Vertical_SMD","Connector_PinSocket_2.54mm/PinSocket_2x02_P2.54mm_Horizontal","Connector_PinSocket_2.54mm/PinSocket_2x02_P2.54mm_Vertical","Connector_PinSocket_2.54mm/PinSocket_2x02_P2.54mm_Vertical_SMD","Connector_PinSocket_2.54mm/PinSocket_2x03_P2.54mm_Horizontal","Connector_PinSocket_2.54mm/PinSocket_2x03_P2.54mm_Vertical","Connector_PinSocket_2.54mm/PinSocket_2x03_P2.54mm_Vertical_SMD","Connector_PinSocket_2.54mm/PinSocket_2x04_P2.54mm_Horizontal","Connector_PinSocket_2.54mm/PinSocket_2x04_P2.54mm_Vertical","Connector_PinSocket_2.54mm/PinSocket_2x04_P2.54mm_Vertical_SMD","Connector_PinSocket_2.54mm/PinSocket_2x05_P2.54mm_Horizontal","Connector_PinSocket_2.54mm/PinSocket_2x05_P2.54mm_Vertical","Connector_PinSocket_2.54mm/PinSocket_2x05_P2.54mm_Vertical_SMD","Connector_PinSocket_2.54mm/PinSocket_2x06_P2.54mm_Horizontal","Connector_PinSocket_2.54mm/PinSocket_2x06_P2.54mm_Vertical","Connector_PinSocket_2.54mm/PinSocket_2x06_P2.54mm_Vertical_SMD","Connector_PinSocket_2.54mm/PinSocket_2x07_P2.54mm_Horizontal","Connector_PinSocket_2.54mm/PinSocket_2x07_P2.54mm_Vertical","Connector_PinSocket_2.54mm/PinSocket_2x07_P2.54mm_Vertical_SMD","Connector_PinSocket_2.54mm/PinSocket_2x08_P2.54mm_Horizontal","Connector_PinSocket_2.54mm/PinSocket_2x08_P2.54mm_Vertical","Connector_PinSocket_2.54mm/PinSocket_2x08_P2.54mm_Vertical_SMD","Connector_PinSocket_2.54mm/PinSocket_2x09_P2.54mm_Horizontal","Connector_PinSocket_2.54mm/PinSocket_2x09_P2.54mm_Vertical","Connector_PinSocket_2.54mm/PinSocket_2x09_P2.54mm_Vertical_SMD","Connector_PinSocket_2.54mm/PinSocket_2x10_P2.54mm_Horizontal","Connector_PinSocket_2.54mm/PinSocket_2x10_P2.54mm_Vertical","Connector_PinSocket_2.54mm/PinSocket_2x10_P2.54mm_Vertical_SMD","Connector_PinSocket_2.54mm/PinSocket_2x11_P2.54mm_Horizontal","Connector_PinSocket_2.54mm/PinSocket_2x11_P2.54mm_Vertical","Connector_PinSocket_2.54mm/PinSocket_2x11_P2.54mm_Vertical_SMD","Connector_PinSocket_2.54mm/PinSocket_2x12_P2.54mm_Horizontal","Connector_PinSocket_2.54mm/PinSocket_2x12_P2.54mm_Vertical","Connector_PinSocket_2.54mm/PinSocket_2x12_P2.54mm_Vertical_SMD","Connector_PinSocket_2.54mm/PinSocket_2x13_P2.54mm_Horizontal","Connector_PinSocket_2.54mm/PinSocket_2x13_P2.54mm_Vertical","Connector_PinSocket_2.54mm/PinSocket_2x13_P2.54mm_Vertical_SMD","Connector_PinSocket_2.54mm/PinSocket_2x14_P2.54mm_Horizontal","Connector_PinSocket_2.54mm/PinSocket_2x14_P2.54mm_Vertical","Connector_PinSocket_2.54mm/PinSocket_2x14_P2.54mm_Vertical_SMD","Connector_PinSocket_2.54mm/PinSocket_2x15_P2.54mm_Horizontal","Connector_PinSocket_2.54mm/PinSocket_2x15_P2.54mm_Vertical","Connector_PinSocket_2.54mm/PinSocket_2x15_P2.54mm_Vertical_SMD","Connector_PinSocket_2.54mm/PinSocket_2x16_P2.54mm_Horizontal","Connector_PinSocket_2.54mm/PinSocket_2x16_P2.54mm_Vertical","Connector_PinSocket_2.54mm/PinSocket_2x16_P2.54mm_Vertical_SMD","Connector_PinSocket_2.54mm/PinSocket_2x17_P2.54mm_Horizontal","Connector_PinSocket_2.54mm/PinSocket_2x17_P2.54mm_Vertical","Connector_PinSocket_2.54mm/PinSocket_2x17_P2.54mm_Vertical_SMD","Connector_PinSocket_2.54mm/PinSocket_2x18_P2.54mm_Horizontal","Connector_PinSocket_2.54mm/PinSocket_2x18_P2.54mm_Vertical","Connector_PinSocket_2.54mm/PinSocket_2x18_P2.54mm_Vertical_SMD","Connector_PinSocket_2.54mm/PinSocket_2x19_P2.54mm_Horizontal","Connector_PinSocket_2.54mm/PinSocket_2x19_P2.54mm_Vertical","Connector_PinSocket_2.54mm/PinSocket_2x19_P2.54mm_Vertical_SMD","Connector_PinSocket_2.54mm/PinSocket_2x20_P2.54mm_Horizontal","Connector_PinSocket_2.54mm/PinSocket_2x20_P2.54mm_Vertical","Connector_PinSocket_2.54mm/PinSocket_2x20_P2.54mm_Vertical_SMD","Connector_PinSocket_2.54mm/PinSocket_2x21_P2.54mm_Horizontal","Connector_PinSocket_2.54mm/PinSocket_2x21_P2.54mm_Vertical","Connector_PinSocket_2.54mm/PinSocket_2x21_P2.54mm_Vertical_SMD","Connector_PinSocket_2.54mm/PinSocket_2x22_P2.54mm_Horizontal","Connector_PinSocket_2.54mm/PinSocket_2x22_P2.54mm_Vertical","Connector_PinSocket_2.54mm/PinSocket_2x22_P2.54mm_Vertical_SMD","Connector_PinSocket_2.54mm/PinSocket_2x23_P2.54mm_Horizontal","Connector_PinSocket_2.54mm/PinSocket_2x23_P2.54mm_Vertical","Connector_PinSocket_2.54mm/PinSocket_2x23_P2.54mm_Vertical_SMD","Connector_PinSocket_2.54mm/PinSocket_2x24_P2.54mm_Horizontal","Connector_PinSocket_2.54mm/PinSocket_2x24_P2.54mm_Vertical","Connector_PinSocket_2.54mm/PinSocket_2x24_P2.54mm_Vertical_SMD","Connector_PinSocket_2.54mm/PinSocket_2x25_P2.54mm_Horizontal","Connector_PinSocket_2.54mm/PinSocket_2x25_P2.54mm_Vertical","Connector_PinSocket_2.54mm/PinSocket_2x25_P2.54mm_Vertical_SMD","Connector_PinSocket_2.54mm/PinSocket_2x26_P2.54mm_Horizontal","Connector_PinSocket_2.54mm/PinSocket_2x26_P2.54mm_Vertical","Connector_PinSocket_2.54mm/PinSocket_2x26_P2.54mm_Vertical_SMD","Connector_PinSocket_2.54mm/PinSocket_2x27_P2.54mm_Horizontal","Connector_PinSocket_2.54mm/PinSocket_2x27_P2.54mm_Vertical","Connector_PinSocket_2.54mm/PinSocket_2x27_P2.54mm_Vertical_SMD","Connector_PinSocket_2.54mm/PinSocket_2x28_P2.54mm_Horizontal","Connector_PinSocket_2.54mm/PinSocket_2x28_P2.54mm_Vertical","Connector_PinSocket_2.54mm/PinSocket_2x28_P2.54mm_Vertical_SMD","Connector_PinSocket_2.54mm/PinSocket_2x29_P2.54mm_Horizontal","Connector_PinSocket_2.54mm/PinSocket_2x29_P2.54mm_Vertical","Connector_PinSocket_2.54mm/PinSocket_2x29_P2.54mm_Vertical_SMD","Connector_PinSocket_2.54mm/PinSocket_2x30_P2.54mm_Horizontal","Connector_PinSocket_2.54mm/PinSocket_2x30_P2.54mm_Vertical","Connector_PinSocket_2.54mm/PinSocket_2x30_P2.54mm_Vertical_SMD","Connector_PinSocket_2.54mm/PinSocket_2x31_P2.54mm_Horizontal","Connector_PinSocket_2.54mm/PinSocket_2x31_P2.54mm_Vertical","Connector_PinSocket_2.54mm/PinSocket_2x31_P2.54mm_Vertical_SMD","Connector_PinSocket_2.54mm/PinSocket_2x32_P2.54mm_Horizontal","Connector_PinSocket_2.54mm/PinSocket_2x32_P2.54mm_Vertical","Connector_PinSocket_2.54mm/PinSocket_2x32_P2.54mm_Vertical_SMD","Connector_PinSocket_2.54mm/PinSocket_2x33_P2.54mm_Horizontal","Connector_PinSocket_2.54mm/PinSocket_2x33_P2.54mm_Vertical","Connector_PinSocket_2.54mm/PinSocket_2x33_P2.54mm_Vertical_SMD","Connector_PinSocket_2.54mm/PinSocket_2x34_P2.54mm_Horizontal","Connector_PinSocket_2.54mm/PinSocket_2x34_P2.54mm_Vertical","Connector_PinSocket_2.54mm/PinSocket_2x34_P2.54mm_Vertical_SMD","Connector_PinSocket_2.54mm/PinSocket_2x35_P2.54mm_Horizontal","Connector_PinSocket_2.54mm/PinSocket_2x35_P2.54mm_Vertical","Connector_PinSocket_2.54mm/PinSocket_2x35_P2.54mm_Vertical_SMD","Connector_PinSocket_2.54mm/PinSocket_2x36_P2.54mm_Horizontal","Connector_PinSocket_2.54mm/PinSocket_2x36_P2.54mm_Vertical","Connector_PinSocket_2.54mm/PinSocket_2x36_P2.54mm_Vertical_SMD","Connector_PinSocket_2.54mm/PinSocket_2x37_P2.54mm_Horizontal","Connector_PinSocket_2.54mm/PinSocket_2x37_P2.54mm_Vertical","Connector_PinSocket_2.54mm/PinSocket_2x37_P2.54mm_Vertical_SMD","Connector_PinSocket_2.54mm/PinSocket_2x38_P2.54mm_Horizontal","Connector_PinSocket_2.54mm/PinSocket_2x38_P2.54mm_Vertical","Connector_PinSocket_2.54mm/PinSocket_2x38_P2.54mm_Vertical_SMD","Connector_PinSocket_2.54mm/PinSocket_2x39_P2.54mm_Horizontal","Connector_PinSocket_2.54mm/PinSocket_2x39_P2.54mm_Vertical","Connector_PinSocket_2.54mm/PinSocket_2x39_P2.54mm_Vertical_SMD","Connector_PinSocket_2.54mm/PinSocket_2x40_P2.54mm_Horizontal","Connector_PinSocket_2.54mm/PinSocket_2x40_P2.54mm_Vertical","Connector_PinSocket_2.54mm/PinSocket_2x40_P2.54mm_Vertical_SMD","Connector_RJ/RJ12_Amphenol_54601-x06_Horizontal","Connector_RJ/RJ14_Connfly_DS1133-S4_Horizontal","Connector_RJ/RJ25_Wayconn_MJEA-660X1_Horizontal","Connector_RJ/RJ45_Abracon_ARJP11A-MA_Horizontal","Connector_RJ/RJ45_Amphenol_54602-x08_Horizontal","Connector_RJ/RJ45_Amphenol_RJHSE5380-08","Connector_RJ/RJ45_Amphenol_RJHSE5380","Connector_RJ/RJ45_Amphenol_RJHSE538X-02","Connector_RJ/RJ45_Amphenol_RJHSE538X-04","Connector_RJ/RJ45_Amphenol_RJHSE538X","Connector_RJ/RJ45_Amphenol_RJMG1BD3B8K1ANR","Connector_RJ/RJ45_BEL_SS74301-00x_Vertical","Connector_RJ/RJ45_Bel_SI-60062-F","Connector_RJ/RJ45_Bel_V895-1001-AW_Vertical","Connector_RJ/RJ45_Cetus_J1B1211CCD_Horizontal","Connector_RJ/RJ45_Connfly_DS1128-09-S8xx-S_Horizontal","Connector_RJ/RJ45_HALO_HFJ11-x2450E-LxxRL_Horizontal","Connector_RJ/RJ45_HALO_HFJ11-x2450ERL_Horizontal","Connector_RJ/RJ45_HALO_HFJ11-x2450HRL_Horizontal","Connector_RJ/RJ45_Hanrun_HR911105A_Horizontal","Connector_RJ/RJ45_Kycon_G7LX-A88S7-BP-xx_Horizontal","Connector_RJ/RJ45_Molex_0855135013_Vertical","Connector_RJ/RJ45_Molex_9346520x_Horizontal","Connector_RJ/RJ45_Ninigi_GE","Connector_RJ/RJ45_OST_PJ012-8P8CX_Vertical","Connector_RJ/RJ45_Plug_Metz_AJP92A8813","Connector_RJ/RJ45_Pulse_JK00177NL_Horizontal","Connector_RJ/RJ45_Pulse_JK0654219NL_Horizontal","Connector_RJ/RJ45_Pulse_JXD6-0001NL_Horizontal","Connector_RJ/RJ45_RCH_RC01937","Connector_RJ/RJ45_UDE_RB1-125B8G1A","Connector_RJ/RJ45_Wuerth_74980111211_Horizontal","Connector_RJ/RJ45_Wuerth_7499010001A_Horizontal","Connector_RJ/RJ45_Wuerth_7499010121A_Horizontal","Connector_RJ/RJ45_Wuerth_7499010211A_Horizontal","Connector_RJ/RJ45_Wuerth_7499111446_Horizontal","Connector_RJ/RJ45_Wuerth_7499151120_Horizontal","Connector_RJ/RJ9_Evercom_5301-440xxx_Horizontal","Connector_SATA_SAS/SAS-mini_TEConnectivity_1888174_Vertical","Connector_SATA_SAS/SATA_Amphenol_10029364-001LF_Horizontal","Connector_Samtec/Samtec_FMC_ASP-134486-01_10x40_P1.27mm_Vertical","Connector_Samtec/Samtec_FMC_ASP-134602-01_10x40_P1.27mm_Vertical","Connector_Samtec/Samtec_FMC_ASP-134604-01_4x40_Vertical","Connector_Samtec/Samtec_LSHM-105-xx.x-x-DV-N_2x05_P0.50mm_Vertical","Connector_Samtec/Samtec_LSHM-105-xx.x-x-DV-S_2x05-1SH_P0.50mm_Vertical","Connector_Samtec/Samtec_LSHM-110-xx.x-x-DV-N_2x10_P0.50mm_Vertical","Connector_Samtec/Samtec_LSHM-110-xx.x-x-DV-S_2x10-1SH_P0.50mm_Vertical","Connector_Samtec/Samtec_LSHM-120-xx.x-x-DV-N_2x20_P0.50mm_Vertical","Connector_Samtec/Samtec_LSHM-120-xx.x-x-DV-S_2x20-1SH_P0.50mm_Vertical","Connector_Samtec/Samtec_LSHM-130-xx.x-x-DV-N_2x30_P0.50mm_Vertical","Connector_Samtec/Samtec_LSHM-130-xx.x-x-DV-S_2x30-1SH_P0.50mm_Vertical","Connector_Samtec/Samtec_LSHM-140-xx.x-x-DV-N_2x40_P0.50mm_Vertical","Connector_Samtec/Samtec_LSHM-140-xx.x-x-DV-S_2x40-1SH_P0.50mm_Vertical","Connector_Samtec/Samtec_LSHM-150-xx.x-x-DV-N_2x50_P0.50mm_Vertical","Connector_Samtec/Samtec_LSHM-150-xx.x-x-DV-S_2x50-1SH_P0.50mm_Vertical","Connector_Samtec/Samtec_SS4-10-3.00-x-D-K-xR_2x10_P0.4mm_Socket","Connector_Samtec/Samtec_SS4-10-3.50-x-D-K-xR_2x10_P0.4mm_Socket","Connector_Samtec/Samtec_SS4-15-3.00-x-D-K-xR_2x15_P0.4mm_Socket","Connector_Samtec/Samtec_SS4-15-3.50-x-D-K-xR_2x15_P0.4mm_Socket","Connector_Samtec/Samtec_SS4-20-3.00-x-D-K-xR_2x20_P0.4mm_Socket","Connector_Samtec/Samtec_SS4-20-3.50-x-D-K-xR_2x20_P0.4mm_Socket","Connector_Samtec/Samtec_SS4-30-3.00-x-D-K-xR_2x30_P0.4mm_Socket","Connector_Samtec/Samtec_SS4-30-3.50-x-D-K-xR_2x30_P0.4mm_Socket","Connector_Samtec/Samtec_SS4-40-3.00-x-D-K-xR_2x40_P0.4mm_Socket","Connector_Samtec/Samtec_SS4-40-3.50-x-D-K-xR_2x40_P0.4mm_Socket","Connector_Samtec/Samtec_SS4-50-3.00-x-D-K-xR_2x50_P0.4mm_Socket","Connector_Samtec/Samtec_SS4-50-3.50-x-D-K-xR_2x50_P0.4mm_Socket","Connector_Samtec_EdgeRate/Samtec_ERF8-005-XX.X-DV-L_2x05_P0.8mm_Socket_Latch","Connector_Samtec_EdgeRate/Samtec_ERF8-005-XX.X-DV_2x05_P0.8mm_Socket","Connector_Samtec_EdgeRate/Samtec_ERF8-010-XX.X-DV-L_2x10_P0.8mm_Socket_Latch","Connector_Samtec_EdgeRate/Samtec_ERF8-010-XX.X-DV_2x10_P0.8mm_Socket","Connector_Samtec_EdgeRate/Samtec_ERF8-011-XX.X-DV-L_2x11_P0.8mm_Socket_Latch","Connector_Samtec_EdgeRate/Samtec_ERF8-011-XX.X-DV_2x11_P0.8mm_Socket","Connector_Samtec_EdgeRate/Samtec_ERF8-013-XX.X-DV-L_2x13_P0.8mm_Socket_Latch","Connector_Samtec_EdgeRate/Samtec_ERF8-013-XX.X-DV_2x13_P0.8mm_Socket","Connector_Samtec_EdgeRate/Samtec_ERF8-020-XX.X-DV-L_2x20_P0.8mm_Socket_Latch","Connector_Samtec_EdgeRate/Samtec_ERF8-020-XX.X-DV_2x20_P0.8mm_Socket","Connector_Samtec_EdgeRate/Samtec_ERF8-025-XX.X-DV-L_2x25_P0.8mm_Socket_Latch","Connector_Samtec_EdgeRate/Samtec_ERF8-025-XX.X-DV_2x25_P0.8mm_Socket","Connector_Samtec_EdgeRate/Samtec_ERF8-030-XX.X-DV-L_2x30_P0.8mm_Socket_Latch","Connector_Samtec_EdgeRate/Samtec_ERF8-030-XX.X-DV_2x30_P0.8mm_Socket","Connector_Samtec_EdgeRate/Samtec_ERF8-035-XX.X-DV-L_2x35_P0.8mm_Socket_Latch","Connector_Samtec_EdgeRate/Samtec_ERF8-035-XX.X-DV_2x35_P0.8mm_Socket","Connector_Samtec_EdgeRate/Samtec_ERF8-040-XX.X-DV-L_2x40_P0.8mm_Socket_Latch","Connector_Samtec_EdgeRate/Samtec_ERF8-040-XX.X-DV_2x40_P0.8mm_Socket","Connector_Samtec_EdgeRate/Samtec_ERF8-049-XX.X-DV-L_2x49_P0.8mm_Socket_Latch","Connector_Samtec_EdgeRate/Samtec_ERF8-049-XX.X-DV_2x49_P0.8mm_Socket","Connector_Samtec_EdgeRate/Samtec_ERF8-050-XX.X-DV-L_2x50_P0.8mm_Socket_Latch","Connector_Samtec_EdgeRate/Samtec_ERF8-050-XX.X-DV_2x50_P0.8mm_Socket","Connector_Samtec_EdgeRate/Samtec_ERF8-060-XX.X-DV-L_2x60_P0.8mm_Socket_Latch","Connector_Samtec_EdgeRate/Samtec_ERF8-060-XX.X-DV_2x60_P0.8mm_Socket","Connector_Samtec_EdgeRate/Samtec_ERF8-070-XX.X-DV-L_2x70_P0.8mm_Socket_Latch","Connector_Samtec_EdgeRate/Samtec_ERF8-070-XX.X-DV_2x70_P0.8mm_Socket","Connector_Samtec_EdgeRate/Samtec_ERF8-075-XX.X-DV-L_2x75_P0.8mm_Socket_Latch","Connector_Samtec_EdgeRate/Samtec_ERF8-075-XX.X-DV_2x75_P0.8mm_Socket","Connector_Samtec_EdgeRate/Samtec_ERF8-100-XX.X-DV-L_2x100_P0.8mm_Socket_Latch","Connector_Samtec_EdgeRate/Samtec_ERF8-100-XX.X-DV_2x100_P0.8mm_Socket","Connector_Samtec_EdgeRate/Samtec_ERM8-005-XX.X-DV-L_2x05_P0.8mm_Terminal_Latch","Connector_Samtec_EdgeRate/Samtec_ERM8-005-XX.X-DV_2x05_P0.8mm_Terminal","Connector_Samtec_EdgeRate/Samtec_ERM8-010-XX.X-DV-L_2x10_P0.8mm_Terminal_Latch","Connector_Samtec_EdgeRate/Samtec_ERM8-010-XX.X-DV_2x10_P0.8mm_Terminal","Connector_Samtec_EdgeRate/Samtec_ERM8-011-XX.X-DV-L_2x11_P0.8mm_Terminal_Latch","Connector_Samtec_EdgeRate/Samtec_ERM8-011-XX.X-DV_2x11_P0.8mm_Terminal","Connector_Samtec_EdgeRate/Samtec_ERM8-013-XX.X-DV-L_2x13_P0.8mm_Terminal_Latch","Connector_Samtec_EdgeRate/Samtec_ERM8-013-XX.X-DV_2x13_P0.8mm_Terminal","Connector_Samtec_EdgeRate/Samtec_ERM8-020-XX.X-DV-L_2x20_P0.8mm_Terminal_Latch","Connector_Samtec_EdgeRate/Samtec_ERM8-020-XX.X-DV_2x20_P0.8mm_Terminal","Connector_Samtec_EdgeRate/Samtec_ERM8-025-XX.X-DV-L_2x25_P0.8mm_Terminal_Latch","Connector_Samtec_EdgeRate/Samtec_ERM8-025-XX.X-DV_2x25_P0.8mm_Terminal","Connector_Samtec_EdgeRate/Samtec_ERM8-030-XX.X-DV-L_2x30_P0.8mm_Terminal_Latch","Connector_Samtec_EdgeRate/Samtec_ERM8-030-XX.X-DV_2x30_P0.8mm_Terminal","Connector_Samtec_EdgeRate/Samtec_ERM8-035-XX.X-DV-L_2x35_P0.8mm_Terminal_Latch","Connector_Samtec_EdgeRate/Samtec_ERM8-035-XX.X-DV_2x35_P0.8mm_Terminal","Connector_Samtec_EdgeRate/Samtec_ERM8-040-XX.X-DV-L_2x40_P0.8mm_Terminal_Latch","Connector_Samtec_EdgeRate/Samtec_ERM8-040-XX.X-DV_2x40_P0.8mm_Terminal","Connector_Samtec_EdgeRate/Samtec_ERM8-049-XX.X-DV-L_2x49_P0.8mm_Terminal_Latch","Connector_Samtec_EdgeRate/Samtec_ERM8-049-XX.X-DV_2x49_P0.8mm_Terminal","Connector_Samtec_EdgeRate/Samtec_ERM8-050-XX.X-DV-L_2x50_P0.8mm_Terminal_Latch","Connector_Samtec_EdgeRate/Samtec_ERM8-050-XX.X-DV_2x50_P0.8mm_Terminal","Connector_Samtec_EdgeRate/Samtec_ERM8-060-XX.X-DV-L_2x60_P0.8mm_Terminal_Latch","Connector_Samtec_EdgeRate/Samtec_ERM8-060-XX.X-DV_2x60_P0.8mm_Terminal","Connector_Samtec_EdgeRate/Samtec_ERM8-070-XX.X-DV-L_2x70_P0.8mm_Terminal_Latch","Connector_Samtec_EdgeRate/Samtec_ERM8-070-XX.X-DV_2x70_P0.8mm_Terminal","Connector_Samtec_EdgeRate/Samtec_ERM8-075-XX.X-DV-L_2x75_P0.8mm_Terminal_Latch","Connector_Samtec_EdgeRate/Samtec_ERM8-075-XX.X-DV_2x75_P0.8mm_Terminal","Connector_Samtec_EdgeRate/Samtec_ERM8-100-XX.X-DV-L_2x100_P0.8mm_Terminal_Latch","Connector_Samtec_EdgeRate/Samtec_ERM8-100-XX.X-DV_2x100_P0.8mm_Terminal","Connector_Samtec_FSI/Samtec_FSI-105-03-X-D-AD_2x05_P1.0mm_Socket_AlignmentPin","Connector_Samtec_FSI/Samtec_FSI-105-03-X-D_2x05_P1.0mm_Socket","Connector_Samtec_FSI/Samtec_FSI-105-XX-X-D-AD_2x05_P1.0mm_Mate_AlignmentPin","Connector_Samtec_FSI/Samtec_FSI-105-XX-X-D-AD_2x05_P1.0mm_Socket_AlignmentPin","Connector_Samtec_FSI/Samtec_FSI-105-XX-X-D_2x05_P1.0mm_Mate","Connector_Samtec_FSI/Samtec_FSI-105-XX-X-D_2x05_P1.0mm_Socket","Connector_Samtec_FSI/Samtec_FSI-110-03-X-D-AD_2x10_P1.0mm_Socket_AlignmentPin","Connector_Samtec_FSI/Samtec_FSI-110-03-X-D-M-AD_2x10_P1.0mm_Socket_Threaded_AlignmentPin","Connector_Samtec_FSI/Samtec_FSI-110-03-X-D-M_2x10_P1.0mm_Socket_Threaded","Connector_Samtec_FSI/Samtec_FSI-110-03-X-D_2x10_P1.0mm_Socket","Connector_Samtec_FSI/Samtec_FSI-110-XX-X-D-AD_2x10_P1.0mm_Mate_AlignmentPin","Connector_Samtec_FSI/Samtec_FSI-110-XX-X-D-AD_2x10_P1.0mm_Socket_AlignmentPin","Connector_Samtec_FSI/Samtec_FSI-110-XX-X-D-M-AD_2x10_P1.0mm_Mate_Threaded_AlignmentPin","Connector_Samtec_FSI/Samtec_FSI-110-XX-X-D-M-AD_2x10_P1.0mm_Socket_Threaded_AlignmentPin","Connector_Samtec_FSI/Samtec_FSI-110-XX-X-D-M_2x10_P1.0mm_Mate_Threaded","Connector_Samtec_FSI/Samtec_FSI-110-XX-X-D-M_2x10_P1.0mm_Socket_Threaded","Connector_Samtec_FSI/Samtec_FSI-110-XX-X-D_2x10_P1.0mm_Mate","Connector_Samtec_FSI/Samtec_FSI-110-XX-X-D_2x10_P1.0mm_Socket","Connector_Samtec_FSI/Samtec_FSI-115-03-X-D-AD_2x15_P1.0mm_Socket_AlignmentPin","Connector_Samtec_FSI/Samtec_FSI-115-03-X-D_2x15_P1.0mm_Socket","Connector_Samtec_FSI/Samtec_FSI-115-XX-X-D-AD_2x15_P1.0mm_Mate_AlignmentPin","Connector_Samtec_FSI/Samtec_FSI-115-XX-X-D-AD_2x15_P1.0mm_Socket_AlignmentPin","Connector_Samtec_FSI/Samtec_FSI-115-XX-X-D_2x15_P1.0mm_Mate","Connector_Samtec_FSI/Samtec_FSI-115-XX-X-D_2x15_P1.0mm_Socket","Connector_Samtec_FSI/Samtec_FSI-120-03-X-D-AD_2x20_P1.0mm_Socket_AlignmentPin","Connector_Samtec_FSI/Samtec_FSI-120-03-X-D-M-AD_2x20_P1.0mm_Socket_Threaded_AlignmentPin","Connector_Samtec_FSI/Samtec_FSI-120-03-X-D-M_2x20_P1.0mm_Socket_Threaded","Connector_Samtec_FSI/Samtec_FSI-120-03-X-D_2x20_P1.0mm_Socket","Connector_Samtec_FSI/Samtec_FSI-120-XX-X-D-AD_2x20_P1.0mm_Mate_AlignmentPin","Connector_Samtec_FSI/Samtec_FSI-120-XX-X-D-AD_2x20_P1.0mm_Socket_AlignmentPin","Connector_Samtec_FSI/Samtec_FSI-120-XX-X-D-M-AD_2x20_P1.0mm_Mate_Threaded_AlignmentPin","Connector_Samtec_FSI/Samtec_FSI-120-XX-X-D-M-AD_2x20_P1.0mm_Socket_Threaded_AlignmentPin","Connector_Samtec_FSI/Samtec_FSI-120-XX-X-D-M_2x20_P1.0mm_Mate_Threaded","Connector_Samtec_FSI/Samtec_FSI-120-XX-X-D-M_2x20_P1.0mm_Socket_Threaded","Connector_Samtec_FSI/Samtec_FSI-120-XX-X-D_2x20_P1.0mm_Mate","Connector_Samtec_FSI/Samtec_FSI-120-XX-X-D_2x20_P1.0mm_Socket","Connector_Samtec_FSI/Samtec_FSI-125-03-X-D-AD_2x25_P1.0mm_Socket_AlignmentPin","Connector_Samtec_FSI/Samtec_FSI-125-03-X-D_2x25_P1.0mm_Socket","Connector_Samtec_FSI/Samtec_FSI-125-XX-X-D-AD_2x25_P1.0mm_Mate_AlignmentPin","Connector_Samtec_FSI/Samtec_FSI-125-XX-X-D-AD_2x25_P1.0mm_Socket_AlignmentPin","Connector_Samtec_FSI/Samtec_FSI-125-XX-X-D_2x25_P1.0mm_Mate","Connector_Samtec_FSI/Samtec_FSI-125-XX-X-D_2x25_P1.0mm_Socket","Connector_Samtec_FSI/Samtec_FSI-130-03-X-D-AD_2x30_P1.0mm_Socket_AlignmentPin","Connector_Samtec_FSI/Samtec_FSI-130-03-X-D-M-AD_2x30_P1.0mm_Socket_Threaded_AlignmentPin","Connector_Samtec_FSI/Samtec_FSI-130-03-X-D-M_2x30_P1.0mm_Socket_Threaded","Connector_Samtec_FSI/Samtec_FSI-130-03-X-D_2x30_P1.0mm_Socket","Connector_Samtec_FSI/Samtec_FSI-130-XX-X-D-AD_2x30_P1.0mm_Mate_AlignmentPin","Connector_Samtec_FSI/Samtec_FSI-130-XX-X-D-AD_2x30_P1.0mm_Socket_AlignmentPin","Connector_Samtec_FSI/Samtec_FSI-130-XX-X-D-M-AD_2x30_P1.0mm_Mate_Threaded_AlignmentPin","Connector_Samtec_FSI/Samtec_FSI-130-XX-X-D-M-AD_2x30_P1.0mm_Socket_Threaded_AlignmentPin","Connector_Samtec_FSI/Samtec_FSI-130-XX-X-D-M_2x30_P1.0mm_Mate_Threaded","Connector_Samtec_FSI/Samtec_FSI-130-XX-X-D-M_2x30_P1.0mm_Socket_Threaded","Connector_Samtec_FSI/Samtec_FSI-130-XX-X-D_2x30_P1.0mm_Mate","Connector_Samtec_FSI/Samtec_FSI-130-XX-X-D_2x30_P1.0mm_Socket","Connector_Samtec_FSI/Samtec_FSI-135-03-X-D-AD_2x35_P1.0mm_Socket_AlignmentPin","Connector_Samtec_FSI/Samtec_FSI-135-03-X-D_2x35_P1.0mm_Socket","Connector_Samtec_FSI/Samtec_FSI-135-XX-X-D-AD_2x35_P1.0mm_Mate_AlignmentPin","Connector_Samtec_FSI/Samtec_FSI-135-XX-X-D-AD_2x35_P1.0mm_Socket_AlignmentPin","Connector_Samtec_FSI/Samtec_FSI-135-XX-X-D_2x35_P1.0mm_Mate","Connector_Samtec_FSI/Samtec_FSI-135-XX-X-D_2x35_P1.0mm_Socket","Connector_Samtec_FSI/Samtec_FSI-140-03-X-D-AD_2x40_P1.0mm_Socket_AlignmentPin","Connector_Samtec_FSI/Samtec_FSI-140-03-X-D-M-AD_2x40_P1.0mm_Pol20_Socket_Threaded_AlignmentPin","Connector_Samtec_FSI/Samtec_FSI-140-03-X-D-M_2x40_P1.0mm_Pol20_Socket_Threaded","Connector_Samtec_FSI/Samtec_FSI-140-03-X-D_2x40_P1.0mm_Socket","Connector_Samtec_FSI/Samtec_FSI-140-XX-X-D-AD_2x40_P1.0mm_Mate_AlignmentPin","Connector_Samtec_FSI/Samtec_FSI-140-XX-X-D-AD_2x40_P1.0mm_Socket_AlignmentPin","Connector_Samtec_FSI/Samtec_FSI-140-XX-X-D-M-AD_2x40_P1.0mm_Pol20_Mate_Threaded_AlignmentPin","Connector_Samtec_FSI/Samtec_FSI-140-XX-X-D-M-AD_2x40_P1.0mm_Pol20_Socket_Threaded_AlignmentPin","Connector_Samtec_FSI/Samtec_FSI-140-XX-X-D-M_2x40_P1.0mm_Pol20_Mate_Threaded","Connector_Samtec_FSI/Samtec_FSI-140-XX-X-D-M_2x40_P1.0mm_Pol20_Socket_Threaded","Connector_Samtec_FSI/Samtec_FSI-140-XX-X-D_2x40_P1.0mm_Mate","Connector_Samtec_FSI/Samtec_FSI-140-XX-X-D_2x40_P1.0mm_Socket","Connector_Samtec_FSI/Samtec_FSI-145-03-X-D-AD_2x45_P1.0mm_Socket_AlignmentPin","Connector_Samtec_FSI/Samtec_FSI-145-03-X-D_2x45_P1.0mm_Socket","Connector_Samtec_FSI/Samtec_FSI-145-XX-X-D-AD_2x45_P1.0mm_Mate_AlignmentPin","Connector_Samtec_FSI/Samtec_FSI-145-XX-X-D-AD_2x45_P1.0mm_Socket_AlignmentPin","Connector_Samtec_FSI/Samtec_FSI-145-XX-X-D_2x45_P1.0mm_Mate","Connector_Samtec_FSI/Samtec_FSI-145-XX-X-D_2x45_P1.0mm_Socket","Connector_Samtec_FSI/Samtec_FSI-150-03-X-D-AD_2x50_P1.0mm_Socket_AlignmentPin","Connector_Samtec_FSI/Samtec_FSI-150-03-X-D-M-AD_2x50_P1.0mm_Pol25_Socket_Threaded_AlignmentPin","Connector_Samtec_FSI/Samtec_FSI-150-03-X-D-M_2x50_P1.0mm_Pol25_Socket_Threaded","Connector_Samtec_FSI/Samtec_FSI-150-03-X-D_2x50_P1.0mm_Socket","Connector_Samtec_FSI/Samtec_FSI-150-XX-X-D-AD_2x50_P1.0mm_Mate_AlignmentPin","Connector_Samtec_FSI/Samtec_FSI-150-XX-X-D-AD_2x50_P1.0mm_Socket_AlignmentPin","Connector_Samtec_FSI/Samtec_FSI-150-XX-X-D-M-AD_2x50_P1.0mm_Pol25_Mate_Threaded_AlignmentPin","Connector_Samtec_FSI/Samtec_FSI-150-XX-X-D-M-AD_2x50_P1.0mm_Pol25_Socket_Threaded_AlignmentPin","Connector_Samtec_FSI/Samtec_FSI-150-XX-X-D-M_2x50_P1.0mm_Pol25_Mate_Threaded","Connector_Samtec_FSI/Samtec_FSI-150-XX-X-D-M_2x50_P1.0mm_Pol25_Socket_Threaded","Connector_Samtec_FSI/Samtec_FSI-150-XX-X-D_2x50_P1.0mm_Mate","Connector_Samtec_FSI/Samtec_FSI-150-XX-X-D_2x50_P1.0mm_Socket","Connector_Samtec_HLE_SMD/Samtec_HLE-102-02-xxx-DV-BE-LC_2x02_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-102-02-xxx-DV-BE_2x02_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-102-02-xxx-DV-LC_2x02_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-102-02-xxx-DV_2x02_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-103-02-xxx-DV-BE-LC_2x03_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-103-02-xxx-DV-BE_2x03_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-103-02-xxx-DV-LC_2x03_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-103-02-xxx-DV_2x03_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-104-02-xxx-DV-A_2x04_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-104-02-xxx-DV-BE-A_2x04_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-104-02-xxx-DV-BE-LC_2x04_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-104-02-xxx-DV-BE_2x04_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-104-02-xxx-DV-LC_2x04_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-104-02-xxx-DV_2x04_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-105-02-xxx-DV-A_2x05_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-105-02-xxx-DV-BE-A_2x05_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-105-02-xxx-DV-BE-LC_2x05_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-105-02-xxx-DV-BE_2x05_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-105-02-xxx-DV-LC_2x05_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-105-02-xxx-DV_2x05_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-106-02-xxx-DV-A_2x06_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-106-02-xxx-DV-BE-A_2x06_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-106-02-xxx-DV-BE-LC_2x06_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-106-02-xxx-DV-BE_2x06_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-106-02-xxx-DV-LC_2x06_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-106-02-xxx-DV_2x06_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-107-02-xxx-DV-A_2x07_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-107-02-xxx-DV-BE-A_2x07_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-107-02-xxx-DV-BE-LC_2x07_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-107-02-xxx-DV-BE_2x07_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-107-02-xxx-DV-LC_2x07_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-107-02-xxx-DV_2x07_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-108-02-xxx-DV-A_2x08_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-108-02-xxx-DV-BE-A_2x08_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-108-02-xxx-DV-BE-LC_2x08_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-108-02-xxx-DV-BE_2x08_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-108-02-xxx-DV-LC_2x08_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-108-02-xxx-DV_2x08_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-109-02-xxx-DV-A_2x09_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-109-02-xxx-DV-BE-A_2x09_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-109-02-xxx-DV-BE-LC_2x09_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-109-02-xxx-DV-BE_2x09_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-109-02-xxx-DV-LC_2x09_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-109-02-xxx-DV_2x09_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-110-02-xxx-DV-A_2x10_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-110-02-xxx-DV-BE-A_2x10_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-110-02-xxx-DV-BE-LC_2x10_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-110-02-xxx-DV-BE_2x10_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-110-02-xxx-DV-LC_2x10_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-110-02-xxx-DV_2x10_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-111-02-xxx-DV-A_2x11_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-111-02-xxx-DV-BE-A_2x11_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-111-02-xxx-DV-BE-LC_2x11_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-111-02-xxx-DV-BE_2x11_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-111-02-xxx-DV-LC_2x11_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-111-02-xxx-DV_2x11_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-112-02-xxx-DV-A_2x12_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-112-02-xxx-DV-BE-A_2x12_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-112-02-xxx-DV-BE-LC_2x12_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-112-02-xxx-DV-BE_2x12_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-112-02-xxx-DV-LC_2x12_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-112-02-xxx-DV_2x12_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-113-02-xxx-DV-A_2x13_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-113-02-xxx-DV-BE-A_2x13_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-113-02-xxx-DV-BE-LC_2x13_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-113-02-xxx-DV-BE_2x13_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-113-02-xxx-DV-LC_2x13_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-113-02-xxx-DV_2x13_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-114-02-xxx-DV-A_2x14_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-114-02-xxx-DV-BE-A_2x14_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-114-02-xxx-DV-BE-LC_2x14_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-114-02-xxx-DV-BE_2x14_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-114-02-xxx-DV-LC_2x14_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-114-02-xxx-DV_2x14_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-115-02-xxx-DV-A_2x15_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-115-02-xxx-DV-BE-A_2x15_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-115-02-xxx-DV-BE-LC_2x15_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-115-02-xxx-DV-BE_2x15_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-115-02-xxx-DV-LC_2x15_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-115-02-xxx-DV_2x15_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-116-02-xxx-DV-A_2x16_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-116-02-xxx-DV-BE-A_2x16_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-116-02-xxx-DV-BE-LC_2x16_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-116-02-xxx-DV-BE_2x16_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-116-02-xxx-DV-LC_2x16_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-116-02-xxx-DV_2x16_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-117-02-xxx-DV-A_2x17_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-117-02-xxx-DV-BE-A_2x17_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-117-02-xxx-DV-BE-LC_2x17_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-117-02-xxx-DV-BE_2x17_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-117-02-xxx-DV-LC_2x17_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-117-02-xxx-DV_2x17_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-118-02-xxx-DV-A_2x18_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-118-02-xxx-DV-BE-A_2x18_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-118-02-xxx-DV-BE-LC_2x18_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-118-02-xxx-DV-BE_2x18_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-118-02-xxx-DV-LC_2x18_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-118-02-xxx-DV_2x18_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-119-02-xxx-DV-A_2x19_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-119-02-xxx-DV-BE-A_2x19_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-119-02-xxx-DV-BE-LC_2x19_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-119-02-xxx-DV-BE_2x19_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-119-02-xxx-DV-LC_2x19_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-119-02-xxx-DV_2x19_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-120-02-xxx-DV-A_2x20_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-120-02-xxx-DV-BE-A_2x20_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-120-02-xxx-DV-BE-LC_2x20_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-120-02-xxx-DV-BE_2x20_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-120-02-xxx-DV-LC_2x20_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-120-02-xxx-DV_2x20_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-121-02-xxx-DV-A_2x21_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-121-02-xxx-DV-BE-A_2x21_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-121-02-xxx-DV-BE-LC_2x21_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-121-02-xxx-DV-BE_2x21_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-121-02-xxx-DV-LC_2x21_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-121-02-xxx-DV_2x21_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-122-02-xxx-DV-A_2x22_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-122-02-xxx-DV-BE-A_2x22_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-122-02-xxx-DV-BE-LC_2x22_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-122-02-xxx-DV-BE_2x22_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-122-02-xxx-DV-LC_2x22_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-122-02-xxx-DV_2x22_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-123-02-xxx-DV-A_2x23_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-123-02-xxx-DV-BE-A_2x23_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-123-02-xxx-DV-BE-LC_2x23_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-123-02-xxx-DV-BE_2x23_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-123-02-xxx-DV-LC_2x23_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-123-02-xxx-DV_2x23_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-124-02-xxx-DV-A_2x24_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-124-02-xxx-DV-BE-A_2x24_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-124-02-xxx-DV-BE-LC_2x24_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-124-02-xxx-DV-BE_2x24_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-124-02-xxx-DV-LC_2x24_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-124-02-xxx-DV_2x24_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-125-02-xxx-DV-A_2x25_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-125-02-xxx-DV-BE-A_2x25_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-125-02-xxx-DV-BE-LC_2x25_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-125-02-xxx-DV-BE_2x25_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-125-02-xxx-DV-LC_2x25_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-125-02-xxx-DV_2x25_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-126-02-xxx-DV-A_2x26_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-126-02-xxx-DV-BE-A_2x26_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-126-02-xxx-DV-BE-LC_2x26_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-126-02-xxx-DV-BE_2x26_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-126-02-xxx-DV-LC_2x26_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-126-02-xxx-DV_2x26_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-127-02-xxx-DV-A_2x27_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-127-02-xxx-DV-BE-A_2x27_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-127-02-xxx-DV-BE-LC_2x27_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-127-02-xxx-DV-BE_2x27_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-127-02-xxx-DV-LC_2x27_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-127-02-xxx-DV_2x27_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-128-02-xxx-DV-A_2x28_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-128-02-xxx-DV-BE-A_2x28_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-128-02-xxx-DV-BE-LC_2x28_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-128-02-xxx-DV-BE_2x28_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-128-02-xxx-DV-LC_2x28_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-128-02-xxx-DV_2x28_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-129-02-xxx-DV-A_2x29_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-129-02-xxx-DV-BE-A_2x29_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-129-02-xxx-DV-BE-LC_2x29_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-129-02-xxx-DV-BE_2x29_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-129-02-xxx-DV-LC_2x29_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-129-02-xxx-DV_2x29_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-130-02-xxx-DV-A_2x30_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-130-02-xxx-DV-BE-A_2x30_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-130-02-xxx-DV-BE-LC_2x30_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-130-02-xxx-DV-BE_2x30_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-130-02-xxx-DV-LC_2x30_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-130-02-xxx-DV_2x30_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-131-02-xxx-DV-A_2x31_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-131-02-xxx-DV-BE-A_2x31_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-131-02-xxx-DV-BE-LC_2x31_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-131-02-xxx-DV-BE_2x31_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-131-02-xxx-DV-LC_2x31_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-131-02-xxx-DV_2x31_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-132-02-xxx-DV-A_2x32_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-132-02-xxx-DV-BE-A_2x32_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-132-02-xxx-DV-BE-LC_2x32_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-132-02-xxx-DV-BE_2x32_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-132-02-xxx-DV-LC_2x32_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-132-02-xxx-DV_2x32_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-133-02-xxx-DV-A_2x33_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-133-02-xxx-DV-BE-A_2x33_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-133-02-xxx-DV-BE-LC_2x33_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-133-02-xxx-DV-BE_2x33_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-133-02-xxx-DV-LC_2x33_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-133-02-xxx-DV_2x33_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-134-02-xxx-DV-A_2x34_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-134-02-xxx-DV-BE-A_2x34_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-134-02-xxx-DV-BE-LC_2x34_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-134-02-xxx-DV-BE_2x34_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-134-02-xxx-DV-LC_2x34_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-134-02-xxx-DV_2x34_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-135-02-xxx-DV-A_2x35_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-135-02-xxx-DV-BE-A_2x35_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-135-02-xxx-DV-BE-LC_2x35_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-135-02-xxx-DV-BE_2x35_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-135-02-xxx-DV-LC_2x35_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-135-02-xxx-DV_2x35_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-136-02-xxx-DV-A_2x36_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-136-02-xxx-DV-BE-A_2x36_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-136-02-xxx-DV-BE-LC_2x36_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-136-02-xxx-DV-BE_2x36_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-136-02-xxx-DV-LC_2x36_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-136-02-xxx-DV_2x36_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-137-02-xxx-DV-A_2x37_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-137-02-xxx-DV-BE-A_2x37_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-137-02-xxx-DV-BE-LC_2x37_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-137-02-xxx-DV-BE_2x37_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-137-02-xxx-DV-LC_2x37_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-137-02-xxx-DV_2x37_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-138-02-xxx-DV-A_2x38_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-138-02-xxx-DV-BE-A_2x38_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-138-02-xxx-DV-BE-LC_2x38_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-138-02-xxx-DV-BE_2x38_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-138-02-xxx-DV-LC_2x38_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-138-02-xxx-DV_2x38_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-139-02-xxx-DV-A_2x39_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-139-02-xxx-DV-BE-A_2x39_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-139-02-xxx-DV-BE-LC_2x39_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-139-02-xxx-DV-BE_2x39_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-139-02-xxx-DV-LC_2x39_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-139-02-xxx-DV_2x39_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-140-02-xxx-DV-A_2x40_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-140-02-xxx-DV-BE-A_2x40_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-140-02-xxx-DV-BE-LC_2x40_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-140-02-xxx-DV-BE_2x40_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-140-02-xxx-DV-LC_2x40_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-140-02-xxx-DV_2x40_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-141-02-xxx-DV-A_2x41_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-141-02-xxx-DV-BE-A_2x41_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-141-02-xxx-DV-BE-LC_2x41_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-141-02-xxx-DV-BE_2x41_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-141-02-xxx-DV-LC_2x41_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-141-02-xxx-DV_2x41_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-142-02-xxx-DV-A_2x42_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-142-02-xxx-DV-BE-A_2x42_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-142-02-xxx-DV-BE-LC_2x42_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-142-02-xxx-DV-BE_2x42_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-142-02-xxx-DV-LC_2x42_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-142-02-xxx-DV_2x42_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-143-02-xxx-DV-A_2x43_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-143-02-xxx-DV-BE-A_2x43_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-143-02-xxx-DV-BE-LC_2x43_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-143-02-xxx-DV-BE_2x43_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-143-02-xxx-DV-LC_2x43_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-143-02-xxx-DV_2x43_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-144-02-xxx-DV-A_2x44_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-144-02-xxx-DV-BE-A_2x44_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-144-02-xxx-DV-BE-LC_2x44_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-144-02-xxx-DV-BE_2x44_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-144-02-xxx-DV-LC_2x44_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-144-02-xxx-DV_2x44_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-145-02-xxx-DV-A_2x45_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-145-02-xxx-DV-BE-A_2x45_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-145-02-xxx-DV-BE-LC_2x45_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-145-02-xxx-DV-BE_2x45_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-145-02-xxx-DV-LC_2x45_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-145-02-xxx-DV_2x45_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-146-02-xxx-DV-A_2x46_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-146-02-xxx-DV-BE-A_2x46_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-146-02-xxx-DV-BE-LC_2x46_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-146-02-xxx-DV-BE_2x46_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-146-02-xxx-DV-LC_2x46_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-146-02-xxx-DV_2x46_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-147-02-xxx-DV-A_2x47_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-147-02-xxx-DV-BE-A_2x47_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-147-02-xxx-DV-BE-LC_2x47_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-147-02-xxx-DV-BE_2x47_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-147-02-xxx-DV-LC_2x47_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-147-02-xxx-DV_2x47_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-148-02-xxx-DV-A_2x48_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-148-02-xxx-DV-BE-A_2x48_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-148-02-xxx-DV-BE-LC_2x48_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-148-02-xxx-DV-BE_2x48_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-148-02-xxx-DV-LC_2x48_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-148-02-xxx-DV_2x48_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-149-02-xxx-DV-A_2x49_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-149-02-xxx-DV-BE-A_2x49_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-149-02-xxx-DV-BE-LC_2x49_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-149-02-xxx-DV-BE_2x49_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-149-02-xxx-DV-LC_2x49_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-149-02-xxx-DV_2x49_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-150-02-xxx-DV-A_2x50_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-150-02-xxx-DV-BE-A_2x50_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-150-02-xxx-DV-BE-LC_2x50_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-150-02-xxx-DV-BE_2x50_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-150-02-xxx-DV-LC_2x50_P2.54mm_Horizontal","Connector_Samtec_HLE_SMD/Samtec_HLE-150-02-xxx-DV_2x50_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-104-02-xx-DV-PE-LC_2x04_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-104-02-xx-DV-PE_2x04_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-104-02-xx-DV-TE_2x04_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-105-02-xx-DV-PE-LC_2x05_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-105-02-xx-DV-PE_2x05_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-105-02-xx-DV-TE_2x05_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-106-02-xx-DV-PE-LC_2x06_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-106-02-xx-DV-PE_2x06_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-106-02-xx-DV-TE_2x06_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-107-02-xx-DV-PE-LC_2x07_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-107-02-xx-DV-PE_2x07_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-107-02-xx-DV-TE_2x07_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-108-02-xx-DV-PE-LC_2x08_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-108-02-xx-DV-PE_2x08_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-108-02-xx-DV-TE_2x08_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-109-02-xx-DV-PE-LC_2x09_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-109-02-xx-DV-PE_2x09_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-109-02-xx-DV-TE_2x09_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-110-02-xx-DV-PE-LC_2x10_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-110-02-xx-DV-PE_2x10_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-110-02-xx-DV-TE_2x10_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-111-02-xx-DV-PE-LC_2x11_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-111-02-xx-DV-PE_2x11_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-111-02-xx-DV-TE_2x11_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-112-02-xx-DV-PE-LC_2x12_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-112-02-xx-DV-PE_2x12_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-112-02-xx-DV-TE_2x12_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-113-02-xx-DV-PE-LC_2x13_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-113-02-xx-DV-PE_2x13_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-113-02-xx-DV-TE_2x13_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-114-02-xx-DV-PE-LC_2x14_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-114-02-xx-DV-PE_2x14_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-114-02-xx-DV-TE_2x14_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-115-02-xx-DV-PE-LC_2x15_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-115-02-xx-DV-PE_2x15_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-115-02-xx-DV-TE_2x15_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-116-02-xx-DV-PE-LC_2x16_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-116-02-xx-DV-PE_2x16_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-116-02-xx-DV-TE_2x16_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-117-02-xx-DV-PE-LC_2x17_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-117-02-xx-DV-PE_2x17_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-117-02-xx-DV-TE_2x17_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-118-02-xx-DV-PE-LC_2x18_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-118-02-xx-DV-PE_2x18_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-118-02-xx-DV-TE_2x18_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-119-02-xx-DV-PE-LC_2x19_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-119-02-xx-DV-PE_2x19_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-119-02-xx-DV-TE_2x19_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-120-02-xx-DV-PE-LC_2x20_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-120-02-xx-DV-PE_2x20_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-120-02-xx-DV-TE_2x20_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-121-02-xx-DV-PE-LC_2x21_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-121-02-xx-DV-PE_2x21_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-121-02-xx-DV-TE_2x21_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-122-02-xx-DV-PE-LC_2x22_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-122-02-xx-DV-PE_2x22_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-122-02-xx-DV-TE_2x22_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-123-02-xx-DV-PE-LC_2x23_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-123-02-xx-DV-PE_2x23_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-123-02-xx-DV-TE_2x23_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-124-02-xx-DV-PE-LC_2x24_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-124-02-xx-DV-PE_2x24_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-124-02-xx-DV-TE_2x24_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-125-02-xx-DV-PE-LC_2x25_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-125-02-xx-DV-PE_2x25_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-125-02-xx-DV-TE_2x25_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-126-02-xx-DV-PE-LC_2x26_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-126-02-xx-DV-PE_2x26_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-126-02-xx-DV-TE_2x26_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-127-02-xx-DV-PE-LC_2x27_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-127-02-xx-DV-PE_2x27_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-127-02-xx-DV-TE_2x27_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-128-02-xx-DV-PE-LC_2x28_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-128-02-xx-DV-PE_2x28_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-128-02-xx-DV-TE_2x28_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-129-02-xx-DV-PE-LC_2x29_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-129-02-xx-DV-PE_2x29_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-129-02-xx-DV-TE_2x29_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-130-02-xx-DV-PE-LC_2x30_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-130-02-xx-DV-PE_2x30_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-130-02-xx-DV-TE_2x30_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-131-02-xx-DV-PE-LC_2x31_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-131-02-xx-DV-PE_2x31_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-131-02-xx-DV-TE_2x31_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-132-02-xx-DV-PE-LC_2x32_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-132-02-xx-DV-PE_2x32_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-132-02-xx-DV-TE_2x32_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-133-02-xx-DV-PE-LC_2x33_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-133-02-xx-DV-PE_2x33_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-133-02-xx-DV-TE_2x33_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-134-02-xx-DV-PE-LC_2x34_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-134-02-xx-DV-PE_2x34_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-134-02-xx-DV-TE_2x34_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-135-02-xx-DV-PE-LC_2x35_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-135-02-xx-DV-PE_2x35_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-135-02-xx-DV-TE_2x35_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-136-02-xx-DV-PE-LC_2x36_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-136-02-xx-DV-PE_2x36_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-136-02-xx-DV-TE_2x36_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-137-02-xx-DV-PE-LC_2x37_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-137-02-xx-DV-PE_2x37_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-137-02-xx-DV-TE_2x37_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-138-02-xx-DV-PE-LC_2x38_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-138-02-xx-DV-PE_2x38_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-138-02-xx-DV-TE_2x38_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-139-02-xx-DV-PE-LC_2x39_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-139-02-xx-DV-PE_2x39_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-139-02-xx-DV-TE_2x39_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-140-02-xx-DV-PE-LC_2x40_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-140-02-xx-DV-PE_2x40_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-140-02-xx-DV-TE_2x40_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-141-02-xx-DV-PE-LC_2x41_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-141-02-xx-DV-PE_2x41_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-141-02-xx-DV-TE_2x41_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-142-02-xx-DV-PE-LC_2x42_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-142-02-xx-DV-PE_2x42_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-142-02-xx-DV-TE_2x42_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-143-02-xx-DV-PE-LC_2x43_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-143-02-xx-DV-PE_2x43_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-143-02-xx-DV-TE_2x43_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-144-02-xx-DV-PE-LC_2x44_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-144-02-xx-DV-PE_2x44_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-144-02-xx-DV-TE_2x44_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-145-02-xx-DV-PE-LC_2x45_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-145-02-xx-DV-PE_2x45_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-145-02-xx-DV-TE_2x45_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-146-02-xx-DV-PE-LC_2x46_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-146-02-xx-DV-PE_2x46_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-146-02-xx-DV-TE_2x46_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-147-02-xx-DV-PE-LC_2x47_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-147-02-xx-DV-PE_2x47_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-147-02-xx-DV-TE_2x47_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-148-02-xx-DV-PE-LC_2x48_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-148-02-xx-DV-PE_2x48_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-148-02-xx-DV-TE_2x48_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-149-02-xx-DV-PE-LC_2x49_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-149-02-xx-DV-PE_2x49_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-149-02-xx-DV-TE_2x49_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-150-02-xx-DV-PE-LC_2x50_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-150-02-xx-DV-PE_2x50_P2.54mm_Horizontal","Connector_Samtec_HLE_THT/Samtec_HLE-150-02-xx-DV-TE_2x50_P2.54mm_Horizontal","Connector_Samtec_HPM_THT/Samtec_HPM-01-01-x-S_Straight_1x01_Pitch5.08mm","Connector_Samtec_HPM_THT/Samtec_HPM-01-05-x-S_Straight_1x01_Pitch5.08mm","Connector_Samtec_HPM_THT/Samtec_HPM-02-01-x-S_Straight_1x02_Pitch5.08mm","Connector_Samtec_HPM_THT/Samtec_HPM-02-05-x-S_Straight_1x02_Pitch5.08mm","Connector_Samtec_HPM_THT/Samtec_HPM-03-01-x-S_Straight_1x03_Pitch5.08mm","Connector_Samtec_HPM_THT/Samtec_HPM-03-05-x-S_Straight_1x03_Pitch5.08mm","Connector_Samtec_HPM_THT/Samtec_HPM-04-01-x-S_Straight_1x04_Pitch5.08mm","Connector_Samtec_HPM_THT/Samtec_HPM-04-05-x-S_Straight_1x04_Pitch5.08mm","Connector_Samtec_HPM_THT/Samtec_HPM-05-01-x-S_Straight_1x05_Pitch5.08mm","Connector_Samtec_HPM_THT/Samtec_HPM-05-05-x-S_Straight_1x05_Pitch5.08mm","Connector_Samtec_HPM_THT/Samtec_HPM-06-01-x-S_Straight_1x06_Pitch5.08mm","Connector_Samtec_HPM_THT/Samtec_HPM-06-05-x-S_Straight_1x06_Pitch5.08mm","Connector_Samtec_HPM_THT/Samtec_HPM-07-01-x-S_Straight_1x07_Pitch5.08mm","Connector_Samtec_HPM_THT/Samtec_HPM-07-05-x-S_Straight_1x07_Pitch5.08mm","Connector_Samtec_HPM_THT/Samtec_HPM-08-01-x-S_Straight_1x08_Pitch5.08mm","Connector_Samtec_HPM_THT/Samtec_HPM-08-05-x-S_Straight_1x08_Pitch5.08mm","Connector_Samtec_HPM_THT/Samtec_HPM-09-01-x-S_Straight_1x09_Pitch5.08mm","Connector_Samtec_HPM_THT/Samtec_HPM-09-05-x-S_Straight_1x09_Pitch5.08mm","Connector_Samtec_HPM_THT/Samtec_HPM-10-01-x-S_Straight_1x10_Pitch5.08mm","Connector_Samtec_HPM_THT/Samtec_HPM-10-05-x-S_Straight_1x10_Pitch5.08mm","Connector_Samtec_HPM_THT/Samtec_HPM-11-01-x-S_Straight_1x11_Pitch5.08mm","Connector_Samtec_HPM_THT/Samtec_HPM-11-05-x-S_Straight_1x11_Pitch5.08mm","Connector_Samtec_HPM_THT/Samtec_HPM-12-01-x-S_Straight_1x12_Pitch5.08mm","Connector_Samtec_HPM_THT/Samtec_HPM-12-05-x-S_Straight_1x12_Pitch5.08mm","Connector_Samtec_HPM_THT/Samtec_HPM-13-01-x-S_Straight_1x13_Pitch5.08mm","Connector_Samtec_HPM_THT/Samtec_HPM-13-05-x-S_Straight_1x13_Pitch5.08mm","Connector_Samtec_HPM_THT/Samtec_HPM-14-01-x-S_Straight_1x14_Pitch5.08mm","Connector_Samtec_HPM_THT/Samtec_HPM-14-05-x-S_Straight_1x14_Pitch5.08mm","Connector_Samtec_HPM_THT/Samtec_HPM-15-01-x-S_Straight_1x15_Pitch5.08mm","Connector_Samtec_HPM_THT/Samtec_HPM-15-05-x-S_Straight_1x15_Pitch5.08mm","Connector_Samtec_HPM_THT/Samtec_HPM-16-01-x-S_Straight_1x16_Pitch5.08mm","Connector_Samtec_HPM_THT/Samtec_HPM-16-05-x-S_Straight_1x16_Pitch5.08mm","Connector_Samtec_HPM_THT/Samtec_HPM-17-01-x-S_Straight_1x17_Pitch5.08mm","Connector_Samtec_HPM_THT/Samtec_HPM-17-05-x-S_Straight_1x17_Pitch5.08mm","Connector_Samtec_HPM_THT/Samtec_HPM-18-01-x-S_Straight_1x18_Pitch5.08mm","Connector_Samtec_HPM_THT/Samtec_HPM-18-05-x-S_Straight_1x18_Pitch5.08mm","Connector_Samtec_HPM_THT/Samtec_HPM-19-01-x-S_Straight_1x19_Pitch5.08mm","Connector_Samtec_HPM_THT/Samtec_HPM-19-05-x-S_Straight_1x19_Pitch5.08mm","Connector_Samtec_HSEC8/Samtec_HSEC8-109-01-X-DV-A-BL_2x09_P0.8mm_Pol04_Socket_WeldTabs_BoardLocks","Connector_Samtec_HSEC8/Samtec_HSEC8-109-01-X-DV-A-WT_2x09_P0.8mm_Pol04_Socket_WeldTabs","Connector_Samtec_HSEC8/Samtec_HSEC8-109-X-X-DV-BL_2x09_P0.8mm_Edge","Connector_Samtec_HSEC8/Samtec_HSEC8-109-X-X-DV_2x09_P0.8mm_Edge","Connector_Samtec_HSEC8/Samtec_HSEC8-109-X-X-DV_2x09_P0.8mm_Wing_Edge","Connector_Samtec_HSEC8/Samtec_HSEC8-110-01-X-DV-A-BL_2x10_P0.8mm_Socket_WeldTabs_BoardLocks","Connector_Samtec_HSEC8/Samtec_HSEC8-110-01-X-DV-A-WT_2x10_P0.8mm_Socket_WeldTabs","Connector_Samtec_HSEC8/Samtec_HSEC8-110-01-X-DV-A_2x10_P0.8mm_Socket_AlignmentPins","Connector_Samtec_HSEC8/Samtec_HSEC8-110-01-X-DV_2x10_P0.8mm_Socket","Connector_Samtec_HSEC8/Samtec_HSEC8-110-03-X-DV-A-WT_2x10_P0.8mm_Socket_WeldTabs","Connector_Samtec_HSEC8/Samtec_HSEC8-110-03-X-DV-A_2x10_P0.8mm_Socket_AlignmentPins","Connector_Samtec_HSEC8/Samtec_HSEC8-110-03-X-DV_2x10_P0.8mm_Socket","Connector_Samtec_HSEC8/Samtec_HSEC8-110-X-X-DV-BL_2x10_P0.8mm_Edge","Connector_Samtec_HSEC8/Samtec_HSEC8-110-X-X-DV_2x10_P0.8mm_Edge","Connector_Samtec_HSEC8/Samtec_HSEC8-110-X-X-DV_2x10_P0.8mm_Wing_Edge","Connector_Samtec_HSEC8/Samtec_HSEC8-1100-01-X-DV-A-BL_2x100_P0.8mm_Pol32_Socket_WeldTabs_BoardLocks","Connector_Samtec_HSEC8/Samtec_HSEC8-1100-01-X-DV-A-WT_2x100_P0.8mm_Pol32_Socket_WeldTabs","Connector_Samtec_HSEC8/Samtec_HSEC8-1100-01-X-DV-A_2x100_P0.8mm_Pol32_Socket_AlignmentPins","Connector_Samtec_HSEC8/Samtec_HSEC8-1100-01-X-DV_2x100_P0.8mm_Pol32_Socket","Connector_Samtec_HSEC8/Samtec_HSEC8-1100-03-X-DV-A-WT_2x100_P0.8mm_Pol32_Socket_WeldTabs","Connector_Samtec_HSEC8/Samtec_HSEC8-1100-03-X-DV-A_2x100_P0.8mm_Pol32_Socket_AlignmentPins","Connector_Samtec_HSEC8/Samtec_HSEC8-1100-03-X-DV_2x100_P0.8mm_Pol32_Socket","Connector_Samtec_HSEC8/Samtec_HSEC8-1100-X-X-DV-BL_2x100_P0.8mm_Edge","Connector_Samtec_HSEC8/Samtec_HSEC8-1100-X-X-DV_2x100_P0.8mm_Edge","Connector_Samtec_HSEC8/Samtec_HSEC8-1100-X-X-DV_2x100_P0.8mm_Wing_Edge","Connector_Samtec_HSEC8/Samtec_HSEC8-113-01-X-DV-A-BL_2x13_P0.8mm_Pol06_Socket_WeldTabs_BoardLocks","Connector_Samtec_HSEC8/Samtec_HSEC8-113-01-X-DV-A-WT_2x13_P0.8mm_Pol06_Socket_WeldTabs","Connector_Samtec_HSEC8/Samtec_HSEC8-113-01-X-DV-A_2x13_P0.8mm_Pol06_Socket_AlignmentPins","Connector_Samtec_HSEC8/Samtec_HSEC8-113-01-X-DV_2x13_P0.8mm_Pol06_Socket","Connector_Samtec_HSEC8/Samtec_HSEC8-113-X-X-DV-BL_2x13_P0.8mm_Edge","Connector_Samtec_HSEC8/Samtec_HSEC8-113-X-X-DV_2x13_P0.8mm_Edge","Connector_Samtec_HSEC8/Samtec_HSEC8-113-X-X-DV_2x13_P0.8mm_Wing_Edge","Connector_Samtec_HSEC8/Samtec_HSEC8-120-01-X-DV-A-BL_2x20_P0.8mm_Socket_WeldTabs_BoardLocks","Connector_Samtec_HSEC8/Samtec_HSEC8-120-01-X-DV-A-WT_2x20_P0.8mm_Socket_WeldTabs","Connector_Samtec_HSEC8/Samtec_HSEC8-120-01-X-DV-A_2x20_P0.8mm_Socket_AlignmentPins","Connector_Samtec_HSEC8/Samtec_HSEC8-120-01-X-DV_2x20_P0.8mm_Socket","Connector_Samtec_HSEC8/Samtec_HSEC8-120-03-X-DV-A-WT_2x20_P0.8mm_Socket_WeldTabs","Connector_Samtec_HSEC8/Samtec_HSEC8-120-03-X-DV-A_2x20_P0.8mm_Socket_AlignmentPins","Connector_Samtec_HSEC8/Samtec_HSEC8-120-03-X-DV_2x20_P0.8mm_Socket","Connector_Samtec_HSEC8/Samtec_HSEC8-120-X-X-DV-BL_2x20_P0.8mm_Edge","Connector_Samtec_HSEC8/Samtec_HSEC8-120-X-X-DV_2x20_P0.8mm_Edge","Connector_Samtec_HSEC8/Samtec_HSEC8-120-X-X-DV_2x20_P0.8mm_Wing_Edge","Connector_Samtec_HSEC8/Samtec_HSEC8-125-01-X-DV-A-BL_2x25_P0.8mm_Pol06_Socket_WeldTabs_BoardLocks","Connector_Samtec_HSEC8/Samtec_HSEC8-125-01-X-DV-A-WT_2x25_P0.8mm_Pol06_Socket_WeldTabs","Connector_Samtec_HSEC8/Samtec_HSEC8-125-01-X-DV-A_2x25_P0.8mm_Pol06_Socket_AlignmentPins","Connector_Samtec_HSEC8/Samtec_HSEC8-125-01-X-DV_2x25_P0.8mm_Pol06_Socket","Connector_Samtec_HSEC8/Samtec_HSEC8-125-X-X-DV-BL_2x25_P0.8mm_Edge","Connector_Samtec_HSEC8/Samtec_HSEC8-125-X-X-DV_2x25_P0.8mm_Edge","Connector_Samtec_HSEC8/Samtec_HSEC8-125-X-X-DV_2x25_P0.8mm_Wing_Edge","Connector_Samtec_HSEC8/Samtec_HSEC8-130-01-X-DV-A-BL_2x30_P0.8mm_Socket_WeldTabs_BoardLocks","Connector_Samtec_HSEC8/Samtec_HSEC8-130-01-X-DV-A-WT_2x30_P0.8mm_Socket_WeldTabs","Connector_Samtec_HSEC8/Samtec_HSEC8-130-01-X-DV-A_2x30_P0.8mm_Socket_AlignmentPins","Connector_Samtec_HSEC8/Samtec_HSEC8-130-01-X-DV_2x30_P0.8mm_Socket","Connector_Samtec_HSEC8/Samtec_HSEC8-130-03-X-DV-A-WT_2x30_P0.8mm_Socket_WeldTabs","Connector_Samtec_HSEC8/Samtec_HSEC8-130-03-X-DV-A_2x30_P0.8mm_Socket_AlignmentPins","Connector_Samtec_HSEC8/Samtec_HSEC8-130-03-X-DV_2x30_P0.8mm_Socket","Connector_Samtec_HSEC8/Samtec_HSEC8-130-X-X-DV-BL_2x30_P0.8mm_Edge","Connector_Samtec_HSEC8/Samtec_HSEC8-130-X-X-DV_2x30_P0.8mm_Edge","Connector_Samtec_HSEC8/Samtec_HSEC8-130-X-X-DV_2x30_P0.8mm_Wing_Edge","Connector_Samtec_HSEC8/Samtec_HSEC8-137-01-X-DV-A-BL_2x37_P0.8mm_Pol21_Socket_WeldTabs_BoardLocks","Connector_Samtec_HSEC8/Samtec_HSEC8-137-01-X-DV-A-WT_2x37_P0.8mm_Pol21_Socket_WeldTabs","Connector_Samtec_HSEC8/Samtec_HSEC8-137-01-X-DV-A_2x37_P0.8mm_Pol21_Socket_AlignmentPins","Connector_Samtec_HSEC8/Samtec_HSEC8-137-01-X-DV_2x37_P0.8mm_Pol21_Socket","Connector_Samtec_HSEC8/Samtec_HSEC8-137-X-X-DV-BL_2x37_P0.8mm_Edge","Connector_Samtec_HSEC8/Samtec_HSEC8-137-X-X-DV_2x37_P0.8mm_Edge","Connector_Samtec_HSEC8/Samtec_HSEC8-137-X-X-DV_2x37_P0.8mm_Wing_Edge","Connector_Samtec_HSEC8/Samtec_HSEC8-140-01-X-DV-A-BL_2x40_P0.8mm_Pol22_Socket_WeldTabs_BoardLocks","Connector_Samtec_HSEC8/Samtec_HSEC8-140-01-X-DV-A-WT_2x40_P0.8mm_Pol22_Socket_WeldTabs","Connector_Samtec_HSEC8/Samtec_HSEC8-140-01-X-DV-A_2x40_P0.8mm_Pol22_Socket_AlignmentPins","Connector_Samtec_HSEC8/Samtec_HSEC8-140-01-X-DV_2x40_P0.8mm_Pol22_Socket","Connector_Samtec_HSEC8/Samtec_HSEC8-140-03-X-DV-A-WT_2x40_P0.8mm_Pol22_Socket_WeldTabs","Connector_Samtec_HSEC8/Samtec_HSEC8-140-03-X-DV-A_2x40_P0.8mm_Pol22_Socket_AlignmentPins","Connector_Samtec_HSEC8/Samtec_HSEC8-140-03-X-DV_2x40_P0.8mm_Pol22_Socket","Connector_Samtec_HSEC8/Samtec_HSEC8-140-X-X-DV-BL_2x40_P0.8mm_Edge","Connector_Samtec_HSEC8/Samtec_HSEC8-140-X-X-DV_2x40_P0.8mm_Edge","Connector_Samtec_HSEC8/Samtec_HSEC8-140-X-X-DV_2x40_P0.8mm_Wing_Edge","Connector_Samtec_HSEC8/Samtec_HSEC8-149-01-X-DV-A-BL_2x49_P0.8mm_Pol27_Socket_WeldTabs_BoardLocks","Connector_Samtec_HSEC8/Samtec_HSEC8-149-01-X-DV-A-WT_2x49_P0.8mm_Pol27_Socket_WeldTabs","Connector_Samtec_HSEC8/Samtec_HSEC8-149-01-X-DV-A_2x49_P0.8mm_Pol27_Socket_AlignmentPins","Connector_Samtec_HSEC8/Samtec_HSEC8-149-01-X-DV_2x49_P0.8mm_Pol27_Socket","Connector_Samtec_HSEC8/Samtec_HSEC8-149-X-X-DV-BL_2x49_P0.8mm_Edge","Connector_Samtec_HSEC8/Samtec_HSEC8-149-X-X-DV_2x49_P0.8mm_Edge","Connector_Samtec_HSEC8/Samtec_HSEC8-149-X-X-DV_2x49_P0.8mm_Wing_Edge","Connector_Samtec_HSEC8/Samtec_HSEC8-150-01-X-DV-A-BL_2x50_P0.8mm_Pol27_Socket_WeldTabs_BoardLocks","Connector_Samtec_HSEC8/Samtec_HSEC8-150-01-X-DV-A-WT_2x50_P0.8mm_Pol27_Socket_WeldTabs","Connector_Samtec_HSEC8/Samtec_HSEC8-150-01-X-DV-A_2x50_P0.8mm_Pol27_Socket_AlignmentPins","Connector_Samtec_HSEC8/Samtec_HSEC8-150-01-X-DV_2x50_P0.8mm_Pol27_Socket","Connector_Samtec_HSEC8/Samtec_HSEC8-150-03-X-DV-A-WT_2x50_P0.8mm_Pol27_Socket_WeldTabs","Connector_Samtec_HSEC8/Samtec_HSEC8-150-03-X-DV-A_2x50_P0.8mm_Pol27_Socket_AlignmentPins","Connector_Samtec_HSEC8/Samtec_HSEC8-150-03-X-DV_2x50_P0.8mm_Pol27_Socket","Connector_Samtec_HSEC8/Samtec_HSEC8-150-X-X-DV-BL_2x50_P0.8mm_Edge","Connector_Samtec_HSEC8/Samtec_HSEC8-150-X-X-DV_2x50_P0.8mm_Edge","Connector_Samtec_HSEC8/Samtec_HSEC8-150-X-X-DV_2x50_P0.8mm_Wing_Edge","Connector_Samtec_HSEC8/Samtec_HSEC8-160-01-X-DV-A-BL_2x60_P0.8mm_Pol32_Socket_WeldTabs_BoardLocks","Connector_Samtec_HSEC8/Samtec_HSEC8-160-01-X-DV-A-WT_2x60_P0.8mm_Pol32_Socket_WeldTabs","Connector_Samtec_HSEC8/Samtec_HSEC8-160-01-X-DV-A_2x60_P0.8mm_Pol32_Socket_AlignmentPins","Connector_Samtec_HSEC8/Samtec_HSEC8-160-01-X-DV_2x60_P0.8mm_Pol32_Socket","Connector_Samtec_HSEC8/Samtec_HSEC8-160-03-X-DV-A-WT_2x60_P0.8mm_Pol32_Socket_WeldTabs","Connector_Samtec_HSEC8/Samtec_HSEC8-160-03-X-DV-A_2x60_P0.8mm_Pol32_Socket_AlignmentPins","Connector_Samtec_HSEC8/Samtec_HSEC8-160-03-X-DV_2x60_P0.8mm_Pol32_Socket","Connector_Samtec_HSEC8/Samtec_HSEC8-160-X-X-DV-BL_2x60_P0.8mm_Edge","Connector_Samtec_HSEC8/Samtec_HSEC8-160-X-X-DV_2x60_P0.8mm_Edge","Connector_Samtec_HSEC8/Samtec_HSEC8-160-X-X-DV_2x60_P0.8mm_Wing_Edge","Connector_Samtec_HSEC8/Samtec_HSEC8-170-01-X-DV-A-BL_2x70_P0.8mm_Pol32_Socket_WeldTabs_BoardLocks","Connector_Samtec_HSEC8/Samtec_HSEC8-170-01-X-DV-A-WT_2x70_P0.8mm_Pol32_Socket_WeldTabs","Connector_Samtec_HSEC8/Samtec_HSEC8-170-01-X-DV-A_2x70_P0.8mm_Pol32_Socket_AlignmentPins","Connector_Samtec_HSEC8/Samtec_HSEC8-170-01-X-DV_2x70_P0.8mm_Pol32_Socket","Connector_Samtec_HSEC8/Samtec_HSEC8-170-03-X-DV-A-WT_2x70_P0.8mm_Pol32_Socket_WeldTabs","Connector_Samtec_HSEC8/Samtec_HSEC8-170-03-X-DV-A_2x70_P0.8mm_Pol32_Socket_AlignmentPins","Connector_Samtec_HSEC8/Samtec_HSEC8-170-03-X-DV_2x70_P0.8mm_Pol32_Socket","Connector_Samtec_HSEC8/Samtec_HSEC8-170-X-X-DV-BL_2x70_P0.8mm_Edge","Connector_Samtec_HSEC8/Samtec_HSEC8-170-X-X-DV_2x70_P0.8mm_Edge","Connector_Samtec_HSEC8/Samtec_HSEC8-170-X-X-DV_2x70_P0.8mm_Wing_Edge","Connector_Samtec_HSEC8/Samtec_HSEC8-180-01-X-DV-A-BL_2x80_P0.8mm_Pol32_Socket_WeldTabs_BoardLocks","Connector_Samtec_HSEC8/Samtec_HSEC8-180-01-X-DV-A-WT_2x80_P0.8mm_Pol32_Socket_WeldTabs","Connector_Samtec_HSEC8/Samtec_HSEC8-180-01-X-DV-A_2x80_P0.8mm_Pol32_Socket_AlignmentPins","Connector_Samtec_HSEC8/Samtec_HSEC8-180-01-X-DV_2x80_P0.8mm_Pol32_Socket","Connector_Samtec_HSEC8/Samtec_HSEC8-180-03-X-DV-A-WT_2x80_P0.8mm_Pol32_Socket_WeldTabs","Connector_Samtec_HSEC8/Samtec_HSEC8-180-03-X-DV-A_2x80_P0.8mm_Pol32_Socket_AlignmentPins","Connector_Samtec_HSEC8/Samtec_HSEC8-180-03-X-DV_2x80_P0.8mm_Pol32_Socket","Connector_Samtec_HSEC8/Samtec_HSEC8-180-X-X-DV-BL_2x80_P0.8mm_Edge","Connector_Samtec_HSEC8/Samtec_HSEC8-180-X-X-DV_2x80_P0.8mm_Edge","Connector_Samtec_HSEC8/Samtec_HSEC8-180-X-X-DV_2x80_P0.8mm_Wing_Edge","Connector_Samtec_HSEC8/Samtec_HSEC8-190-01-X-DV-A-BL_2x90_P0.8mm_Pol32_Socket_WeldTabs_BoardLocks","Connector_Samtec_HSEC8/Samtec_HSEC8-190-01-X-DV-A-WT_2x90_P0.8mm_Pol32_Socket_WeldTabs","Connector_Samtec_HSEC8/Samtec_HSEC8-190-01-X-DV-A_2x90_P0.8mm_Pol32_Socket_AlignmentPins","Connector_Samtec_HSEC8/Samtec_HSEC8-190-01-X-DV_2x90_P0.8mm_Pol32_Socket","Connector_Samtec_HSEC8/Samtec_HSEC8-190-03-X-DV-A-WT_2x90_P0.8mm_Pol32_Socket_WeldTabs","Connector_Samtec_HSEC8/Samtec_HSEC8-190-03-X-DV-A_2x90_P0.8mm_Pol32_Socket_AlignmentPins","Connector_Samtec_HSEC8/Samtec_HSEC8-190-03-X-DV_2x90_P0.8mm_Pol32_Socket","Connector_Samtec_HSEC8/Samtec_HSEC8-190-X-X-DV-BL_2x90_P0.8mm_Edge","Connector_Samtec_HSEC8/Samtec_HSEC8-190-X-X-DV_2x90_P0.8mm_Edge","Connector_Samtec_HSEC8/Samtec_HSEC8-190-X-X-DV_2x90_P0.8mm_Wing_Edge","Connector_Samtec_LTMM/Samtec_LTMM-104-02-X-D-SM-LC_2x04_P2.0mm_Header_Vertical_LockingClip","Connector_Samtec_LTMM/Samtec_LTMM-104-02-X-D-SM_2x04_P2.0mm_Header_Vertical","Connector_Samtec_LTMM/Samtec_LTMM-105-02-X-D-SM-LC_2x05_P2.0mm_Header_Vertical_LockingClip","Connector_Samtec_LTMM/Samtec_LTMM-105-02-X-D-SM_2x05_P2.0mm_Header_Vertical","Connector_Samtec_LTMM/Samtec_LTMM-106-02-X-D-SM-LC_2x06_P2.0mm_Header_Vertical_LockingClip","Connector_Samtec_LTMM/Samtec_LTMM-106-02-X-D-SM_2x06_P2.0mm_Header_Vertical","Connector_Samtec_LTMM/Samtec_LTMM-107-02-X-D-SM-LC_2x07_P2.0mm_Header_Vertical_LockingClip","Connector_Samtec_LTMM/Samtec_LTMM-107-02-X-D-SM_2x07_P2.0mm_Header_Vertical","Connector_Samtec_LTMM/Samtec_LTMM-108-02-X-D-SM-LC_2x08_P2.0mm_Header_Vertical_LockingClip","Connector_Samtec_LTMM/Samtec_LTMM-108-02-X-D-SM_2x08_P2.0mm_Header_Vertical","Connector_Samtec_LTMM/Samtec_LTMM-110-02-X-D-SM-LC_2x10_P2.0mm_Header_Vertical_LockingClip","Connector_Samtec_LTMM/Samtec_LTMM-110-02-X-D-SM_2x10_P2.0mm_Header_Vertical","Connector_Samtec_LTMM/Samtec_LTMM-112-02-X-D-SM-LC_2x12_P2.0mm_Header_Vertical_LockingClip","Connector_Samtec_LTMM/Samtec_LTMM-112-02-X-D-SM_2x12_P2.0mm_Header_Vertical","Connector_Samtec_LTMM/Samtec_LTMM-113-02-X-D-SM-LC_2x13_P2.0mm_Header_Vertical_LockingClip","Connector_Samtec_LTMM/Samtec_LTMM-113-02-X-D-SM_2x13_P2.0mm_Header_Vertical","Connector_Samtec_LTMM/Samtec_LTMM-115-02-X-D-SM-LC_2x15_P2.0mm_Header_Vertical_LockingClip","Connector_Samtec_LTMM/Samtec_LTMM-115-02-X-D-SM_2x15_P2.0mm_Header_Vertical","Connector_Samtec_LTMM/Samtec_LTMM-117-02-X-D-SM-LC_2x17_P2.0mm_Header_Vertical_LockingClip","Connector_Samtec_LTMM/Samtec_LTMM-117-02-X-D-SM_2x17_P2.0mm_Header_Vertical","Connector_Samtec_LTMM/Samtec_LTMM-120-02-X-D-SM-LC_2x20_P2.0mm_Header_Vertical_LockingClip","Connector_Samtec_LTMM/Samtec_LTMM-120-02-X-D-SM_2x20_P2.0mm_Header_Vertical","Connector_Samtec_LTMM/Samtec_LTMM-122-02-X-D-SM-LC_2x22_P2.0mm_Header_Vertical_LockingClip","Connector_Samtec_LTMM/Samtec_LTMM-122-02-X-D-SM_2x22_P2.0mm_Header_Vertical","Connector_Samtec_LTMM/Samtec_LTMM-125-02-X-D-SM-LC_2x25_P2.0mm_Header_Vertical_LockingClip","Connector_Samtec_LTMM/Samtec_LTMM-125-02-X-D-SM_2x25_P2.0mm_Header_Vertical","Connector_Samtec_MicroMate/Samtec_T1M-02-X-S-RA_1x02-1MP_P1.0mm_Terminal_Horizontal","Connector_Samtec_MicroMate/Samtec_T1M-02-X-S-V_1x02-1MP_P1.0mm_Terminal_Vertical","Connector_Samtec_MicroMate/Samtec_T1M-02-X-SH-L_1x02-1MP_P1.0mm_Terminal_Horizontal_Latch","Connector_Samtec_MicroMate/Samtec_T1M-02-X-SV-L_1x02-1MP_P1.0mm_Terminal_Vertical_Latch","Connector_Samtec_MicroMate/Samtec_T1M-03-X-S-RA_1x03-1MP_P1.0mm_Terminal_Horizontal","Connector_Samtec_MicroMate/Samtec_T1M-03-X-S-V_1x03-1MP_P1.0mm_Terminal_Vertical","Connector_Samtec_MicroMate/Samtec_T1M-03-X-SH-L_1x03-1MP_P1.0mm_Terminal_Horizontal_Latch","Connector_Samtec_MicroMate/Samtec_T1M-03-X-SV-L_1x03-1MP_P1.0mm_Terminal_Vertical_Latch","Connector_Samtec_MicroMate/Samtec_T1M-04-X-S-RA_1x04-1MP_P1.0mm_Terminal_Horizontal","Connector_Samtec_MicroMate/Samtec_T1M-04-X-S-V_1x04-1MP_P1.0mm_Terminal_Vertical","Connector_Samtec_MicroMate/Samtec_T1M-04-X-SH-L_1x04-1MP_P1.0mm_Terminal_Horizontal_Latch","Connector_Samtec_MicroMate/Samtec_T1M-04-X-SV-L_1x04-1MP_P1.0mm_Terminal_Vertical_Latch","Connector_Samtec_MicroMate/Samtec_T1M-05-X-S-RA_1x05-1MP_P1.0mm_Terminal_Horizontal","Connector_Samtec_MicroMate/Samtec_T1M-05-X-S-V_1x05-1MP_P1.0mm_Terminal_Vertical","Connector_Samtec_MicroMate/Samtec_T1M-05-X-SH-L_1x05-1MP_P1.0mm_Terminal_Horizontal_Latch","Connector_Samtec_MicroMate/Samtec_T1M-05-X-SV-L_1x05-1MP_P1.0mm_Terminal_Vertical_Latch","Connector_Samtec_MicroMate/Samtec_T1M-06-X-S-RA_1x06-1MP_P1.0mm_Terminal_Horizontal","Connector_Samtec_MicroMate/Samtec_T1M-06-X-S-V_1x06-1MP_P1.0mm_Terminal_Vertical","Connector_Samtec_MicroMate/Samtec_T1M-06-X-SH-L_1x06-1MP_P1.0mm_Terminal_Horizontal_Latch","Connector_Samtec_MicroMate/Samtec_T1M-06-X-SV-L_1x06-1MP_P1.0mm_Terminal_Vertical_Latch","Connector_Samtec_MicroMate/Samtec_T1M-07-X-S-RA_1x07-1MP_P1.0mm_Terminal_Horizontal","Connector_Samtec_MicroMate/Samtec_T1M-07-X-S-V_1x07-1MP_P1.0mm_Terminal_Vertical","Connector_Samtec_MicroMate/Samtec_T1M-07-X-SH-L_1x07-1MP_P1.0mm_Terminal_Horizontal_Latch","Connector_Samtec_MicroMate/Samtec_T1M-07-X-SV-L_1x07-1MP_P1.0mm_Terminal_Vertical_Latch","Connector_Samtec_MicroMate/Samtec_T1M-08-X-S-RA_1x08-1MP_P1.0mm_Terminal_Horizontal","Connector_Samtec_MicroMate/Samtec_T1M-08-X-S-V_1x08-1MP_P1.0mm_Terminal_Vertical","Connector_Samtec_MicroMate/Samtec_T1M-08-X-SH-L_1x08-1MP_P1.0mm_Terminal_Horizontal_Latch","Connector_Samtec_MicroMate/Samtec_T1M-08-X-SV-L_1x08-1MP_P1.0mm_Terminal_Vertical_Latch","Connector_Samtec_MicroMate/Samtec_T1M-09-X-S-RA_1x09-1MP_P1.0mm_Terminal_Horizontal","Connector_Samtec_MicroMate/Samtec_T1M-09-X-S-V_1x09-1MP_P1.0mm_Terminal_Vertical","Connector_Samtec_MicroMate/Samtec_T1M-09-X-SH-L_1x09-1MP_P1.0mm_Terminal_Horizontal_Latch","Connector_Samtec_MicroMate/Samtec_T1M-09-X-SV-L_1x09-1MP_P1.0mm_Terminal_Vertical_Latch","Connector_Samtec_MicroMate/Samtec_T1M-10-X-S-RA_1x10-1MP_P1.0mm_Terminal_Horizontal","Connector_Samtec_MicroMate/Samtec_T1M-10-X-S-V_1x10-1MP_P1.0mm_Terminal_Vertical","Connector_Samtec_MicroMate/Samtec_T1M-10-X-SH-L_1x10-1MP_P1.0mm_Terminal_Horizontal_Latch","Connector_Samtec_MicroMate/Samtec_T1M-10-X-SV-L_1x10-1MP_P1.0mm_Terminal_Vertical_Latch","Connector_Samtec_MicroMate/Samtec_T1M-11-X-S-RA_1x11-1MP_P1.0mm_Terminal_Horizontal","Connector_Samtec_MicroMate/Samtec_T1M-11-X-S-V_1x11-1MP_P1.0mm_Terminal_Vertical","Connector_Samtec_MicroMate/Samtec_T1M-11-X-SH-L_1x11-1MP_P1.0mm_Terminal_Horizontal_Latch","Connector_Samtec_MicroMate/Samtec_T1M-11-X-SV-L_1x11-1MP_P1.0mm_Terminal_Vertical_Latch","Connector_Samtec_MicroMate/Samtec_T1M-12-X-S-RA_1x12-1MP_P1.0mm_Terminal_Horizontal","Connector_Samtec_MicroMate/Samtec_T1M-12-X-S-V_1x12-1MP_P1.0mm_Terminal_Vertical","Connector_Samtec_MicroMate/Samtec_T1M-12-X-SH-L_1x12-1MP_P1.0mm_Terminal_Horizontal_Latch","Connector_Samtec_MicroMate/Samtec_T1M-12-X-SV-L_1x12-1MP_P1.0mm_Terminal_Vertical_Latch","Connector_Samtec_MicroMate/Samtec_T1M-13-X-S-RA_1x13-1MP_P1.0mm_Terminal_Horizontal","Connector_Samtec_MicroMate/Samtec_T1M-13-X-S-V_1x13-1MP_P1.0mm_Terminal_Vertical","Connector_Samtec_MicroMate/Samtec_T1M-13-X-SH-L_1x13-1MP_P1.0mm_Terminal_Horizontal_Latch","Connector_Samtec_MicroMate/Samtec_T1M-13-X-SV-L_1x13-1MP_P1.0mm_Terminal_Vertical_Latch","Connector_Samtec_MicroMate/Samtec_T1M-14-X-S-RA_1x14-1MP_P1.0mm_Terminal_Horizontal","Connector_Samtec_MicroMate/Samtec_T1M-14-X-S-V_1x14-1MP_P1.0mm_Terminal_Vertical","Connector_Samtec_MicroMate/Samtec_T1M-14-X-SH-L_1x14-1MP_P1.0mm_Terminal_Horizontal_Latch","Connector_Samtec_MicroMate/Samtec_T1M-14-X-SV-L_1x14-1MP_P1.0mm_Terminal_Vertical_Latch","Connector_Samtec_MicroMate/Samtec_T1M-15-X-S-RA_1x15-1MP_P1.0mm_Terminal_Horizontal","Connector_Samtec_MicroMate/Samtec_T1M-15-X-S-V_1x15-1MP_P1.0mm_Terminal_Vertical","Connector_Samtec_MicroMate/Samtec_T1M-15-X-SH-L_1x15-1MP_P1.0mm_Terminal_Horizontal_Latch","Connector_Samtec_MicroMate/Samtec_T1M-15-X-SV-L_1x15-1MP_P1.0mm_Terminal_Vertical_Latch","Connector_Samtec_MicroMate/Samtec_T1M-16-X-S-RA_1x16-1MP_P1.0mm_Terminal_Horizontal","Connector_Samtec_MicroMate/Samtec_T1M-16-X-S-V_1x16-1MP_P1.0mm_Terminal_Vertical","Connector_Samtec_MicroMate/Samtec_T1M-16-X-SH-L_1x16-1MP_P1.0mm_Terminal_Horizontal_Latch","Connector_Samtec_MicroMate/Samtec_T1M-16-X-SV-L_1x16-1MP_P1.0mm_Terminal_Vertical_Latch","Connector_Samtec_MicroMate/Samtec_T1M-17-X-S-RA_1x17-1MP_P1.0mm_Terminal_Horizontal","Connector_Samtec_MicroMate/Samtec_T1M-17-X-S-V_1x17-1MP_P1.0mm_Terminal_Vertical","Connector_Samtec_MicroMate/Samtec_T1M-17-X-SH-L_1x17-1MP_P1.0mm_Terminal_Horizontal_Latch","Connector_Samtec_MicroMate/Samtec_T1M-17-X-SV-L_1x17-1MP_P1.0mm_Terminal_Vertical_Latch","Connector_Samtec_MicroMate/Samtec_T1M-18-X-S-RA_1x18-1MP_P1.0mm_Terminal_Horizontal","Connector_Samtec_MicroMate/Samtec_T1M-18-X-S-V_1x18-1MP_P1.0mm_Terminal_Vertical","Connector_Samtec_MicroMate/Samtec_T1M-18-X-SH-L_1x18-1MP_P1.0mm_Terminal_Horizontal_Latch","Connector_Samtec_MicroMate/Samtec_T1M-18-X-SV-L_1x18-1MP_P1.0mm_Terminal_Vertical_Latch","Connector_Samtec_MicroMate/Samtec_T1M-19-X-S-RA_1x19-1MP_P1.0mm_Terminal_Horizontal","Connector_Samtec_MicroMate/Samtec_T1M-19-X-S-V_1x19-1MP_P1.0mm_Terminal_Vertical","Connector_Samtec_MicroMate/Samtec_T1M-19-X-SH-L_1x19-1MP_P1.0mm_Terminal_Horizontal_Latch","Connector_Samtec_MicroMate/Samtec_T1M-19-X-SV-L_1x19-1MP_P1.0mm_Terminal_Vertical_Latch","Connector_Samtec_MicroMate/Samtec_T1M-20-X-S-RA_1x20-1MP_P1.0mm_Terminal_Horizontal","Connector_Samtec_MicroMate/Samtec_T1M-20-X-S-V_1x20-1MP_P1.0mm_Terminal_Vertical","Connector_Samtec_MicroMate/Samtec_T1M-20-X-SH-L_1x20-1MP_P1.0mm_Terminal_Horizontal_Latch","Connector_Samtec_MicroMate/Samtec_T1M-20-X-SV-L_1x20-1MP_P1.0mm_Terminal_Vertical_Latch","Connector_Samtec_MicroPower/Samtec_UMPS-02-XX.X-X-V-S-W_1x02-1MP_P2.0mm_Socket_WeldTab","Connector_Samtec_MicroPower/Samtec_UMPS-02-XX.X-X-V-S_1x02_P2.0mm_Socket","Connector_Samtec_MicroPower/Samtec_UMPS-03-XX.X-X-V-S-W_1x03-1MP_P2.0mm_Socket_WeldTab","Connector_Samtec_MicroPower/Samtec_UMPS-03-XX.X-X-V-S_1x03_P2.0mm_Socket","Connector_Samtec_MicroPower/Samtec_UMPS-04-XX.X-X-V-S-W_1x04-1MP_P2.0mm_Socket_WeldTab","Connector_Samtec_MicroPower/Samtec_UMPS-04-XX.X-X-V-S_1x04_P2.0mm_Socket","Connector_Samtec_MicroPower/Samtec_UMPS-05-XX.X-X-V-S-W_1x05-1MP_P2.0mm_Socket_WeldTab","Connector_Samtec_MicroPower/Samtec_UMPS-05-XX.X-X-V-S_1x05_P2.0mm_Socket","Connector_Samtec_MicroPower/Samtec_UMPS-06-XX.X-X-V-S-W_1x06-1MP_P2.0mm_Socket_WeldTab","Connector_Samtec_MicroPower/Samtec_UMPS-06-XX.X-X-V-S_1x06_P2.0mm_Socket","Connector_Samtec_MicroPower/Samtec_UMPS-07-XX.X-X-V-S-W_1x07-1MP_P2.0mm_Socket_WeldTab","Connector_Samtec_MicroPower/Samtec_UMPS-07-XX.X-X-V-S_1x07_P2.0mm_Socket","Connector_Samtec_MicroPower/Samtec_UMPS-08-XX.X-X-V-S-W_1x08-1MP_P2.0mm_Socket_WeldTab","Connector_Samtec_MicroPower/Samtec_UMPS-08-XX.X-X-V-S_1x08_P2.0mm_Socket","Connector_Samtec_MicroPower/Samtec_UMPS-09-XX.X-X-V-S-W_1x09-1MP_P2.0mm_Socket_WeldTab","Connector_Samtec_MicroPower/Samtec_UMPS-09-XX.X-X-V-S_1x09_P2.0mm_Socket","Connector_Samtec_MicroPower/Samtec_UMPS-10-XX.X-X-V-S-W_1x10-1MP_P2.0mm_Socket_WeldTab","Connector_Samtec_MicroPower/Samtec_UMPS-10-XX.X-X-V-S_1x10_P2.0mm_Socket","Connector_Samtec_MicroPower/Samtec_UMPT-02-XX.X-X-V-S-W_1x02-1MP_P2.0mm_Terminal_WeldTab","Connector_Samtec_MicroPower/Samtec_UMPT-02-XX.X-X-V-S_1x02_P2.0mm_Terminal","Connector_Samtec_MicroPower/Samtec_UMPT-03-XX.X-X-V-S-W_1x03-1MP_P2.0mm_Terminal_WeldTab","Connector_Samtec_MicroPower/Samtec_UMPT-03-XX.X-X-V-S_1x03_P2.0mm_Terminal","Connector_Samtec_MicroPower/Samtec_UMPT-04-XX.X-X-V-S-W_1x04-1MP_P2.0mm_Terminal_WeldTab","Connector_Samtec_MicroPower/Samtec_UMPT-04-XX.X-X-V-S_1x04_P2.0mm_Terminal","Connector_Samtec_MicroPower/Samtec_UMPT-05-XX.X-X-V-S-W_1x05-1MP_P2.0mm_Terminal_WeldTab","Connector_Samtec_MicroPower/Samtec_UMPT-05-XX.X-X-V-S_1x05_P2.0mm_Terminal","Connector_Samtec_MicroPower/Samtec_UMPT-06-XX.X-X-V-S-W_1x06-1MP_P2.0mm_Terminal_WeldTab","Connector_Samtec_MicroPower/Samtec_UMPT-06-XX.X-X-V-S_1x06_P2.0mm_Terminal","Connector_Samtec_MicroPower/Samtec_UMPT-07-XX.X-X-V-S-W_1x07-1MP_P2.0mm_Terminal_WeldTab","Connector_Samtec_MicroPower/Samtec_UMPT-07-XX.X-X-V-S_1x07_P2.0mm_Terminal","Connector_Samtec_MicroPower/Samtec_UMPT-08-XX.X-X-V-S-W_1x08-1MP_P2.0mm_Terminal_WeldTab","Connector_Samtec_MicroPower/Samtec_UMPT-08-XX.X-X-V-S_1x08_P2.0mm_Terminal","Connector_Samtec_MicroPower/Samtec_UMPT-09-XX.X-X-V-S-W_1x09-1MP_P2.0mm_Terminal_WeldTab","Connector_Samtec_MicroPower/Samtec_UMPT-09-XX.X-X-V-S_1x09_P2.0mm_Terminal","Connector_Samtec_MicroPower/Samtec_UMPT-10-XX.X-X-V-S-W_1x10-1MP_P2.0mm_Terminal_WeldTab","Connector_Samtec_MicroPower/Samtec_UMPT-10-XX.X-X-V-S_1x10_P2.0mm_Terminal","Connector_Stocko/Stocko_MKS_1651-6-0-202_1x2_P2.50mm_Vertical","Connector_Stocko/Stocko_MKS_1652-6-0-202_1x2_P2.50mm_Vertical","Connector_Stocko/Stocko_MKS_1653-6-0-303_1x3_P2.50mm_Vertical","Connector_Stocko/Stocko_MKS_1654-6-0-404_1x4_P2.50mm_Vertical","Connector_Stocko/Stocko_MKS_1655-6-0-505_1x5_P2.50mm_Vertical","Connector_Stocko/Stocko_MKS_1656-6-0-606_1x6_P2.50mm_Vertical","Connector_Stocko/Stocko_MKS_1657-6-0-707_1x7_P2.50mm_Vertical","Connector_Stocko/Stocko_MKS_1658-6-0-808_1x8_P2.50mm_Vertical","Connector_Stocko/Stocko_MKS_1659-6-0-909_1x9_P2.50mm_Vertical","Connector_Stocko/Stocko_MKS_1660-6-0-1010_1x10_P2.50mm_Vertical","Connector_Stocko/Stocko_MKS_1661-6-0-1111_1x11_P2.50mm_Vertical","Connector_Stocko/Stocko_MKS_1662-6-0-1212_1x12_P2.50mm_Vertical","Connector_Stocko/Stocko_MKS_1663-6-0-1313_1x13_P2.50mm_Vertical","Connector_Stocko/Stocko_MKS_1664-6-0-1414_1x14_P2.50mm_Vertical","Connector_Stocko/Stocko_MKS_1665-6-0-1515_1x15_P2.50mm_Vertical","Connector_Stocko/Stocko_MKS_1666-6-0-1616_1x16_P2.50mm_Vertical","Connector_Stocko/Stocko_MKS_1667-6-0-1717_1x17_P2.50mm_Vertical","Connector_Stocko/Stocko_MKS_1668-6-0-1818_1x18_P2.50mm_Vertical","Connector_Stocko/Stocko_MKS_1669-6-0-1919_1x19_P2.50mm_Vertical","Connector_Stocko/Stocko_MKS_1670-6-0-2020_1x20_P2.50mm_Vertical","Connector_TE-Connectivity/TE_1-826576-3_1x13_P3.96mm_Vertical","Connector_TE-Connectivity/TE_1-826576-5_1x15_P3.96mm_Vertical","Connector_TE-Connectivity/TE_1-826576-6_1x16_P3.96mm_Vertical","Connector_TE-Connectivity/TE_1-826576-7_1x17_P3.96mm_Vertical","Connector_TE-Connectivity/TE_1-826576-8_1x18_P3.96mm_Vertical","Connector_TE-Connectivity/TE_2-826576-0_1x20_P3.96mm_Vertical","Connector_TE-Connectivity/TE_2834006-1_1x01_P4.0mm_Horizontal","Connector_TE-Connectivity/TE_2834006-2_1x02_P4.0mm_Horizontal","Connector_TE-Connectivity/TE_2834006-3_1x03_P4.0mm_Horizontal","Connector_TE-Connectivity/TE_2834006-4_1x04_P4.0mm_Horizontal","Connector_TE-Connectivity/TE_2834006-5_1x05_P4.0mm_Horizontal","Connector_TE-Connectivity/TE_3-826576-6_1x36_P3.96mm_Vertical","Connector_TE-Connectivity/TE_440054-2_1x02_P2.00mm_Vertical","Connector_TE-Connectivity/TE_440055-2_1x02_P2.00mm_Horizontal","Connector_TE-Connectivity/TE_5767171-1_2x19_P0.635mm_Vertical","Connector_TE-Connectivity/TE_826576-2_1x02_P3.96mm_Vertical","Connector_TE-Connectivity/TE_826576-3_1x03_P3.96mm_Vertical","Connector_TE-Connectivity/TE_826576-5_1x05_P3.96mm_Vertical","Connector_TE-Connectivity/TE_826576-6_1x06_P3.96mm_Vertical","Connector_TE-Connectivity/TE_826576-7_1x07_P3.96mm_Vertical","Connector_TE-Connectivity/TE_826576-8_1x08_P3.96mm_Vertical","Connector_TE-Connectivity/TE_826576-9_1x09_P3.96mm_Vertical","Connector_TE-Connectivity/TE_AMPSEAL_1-776087-x_3Rows_23_P0.4mm_Horizontal","Connector_TE-Connectivity/TE_MATE-N-LOK_1-770182-x_3x03_P4.14mm_Vertical","Connector_TE-Connectivity/TE_MATE-N-LOK_1-770186-x_3x04_P4.14mm_Vertical","Connector_TE-Connectivity/TE_MATE-N-LOK_1-770190-x_3x05_P4.14mm_Vertical","Connector_TE-Connectivity/TE_MATE-N-LOK_1-770621-x_2x06_P4.14mm_Vertical","Connector_TE-Connectivity/TE_MATE-N-LOK_1-770858-x_2x05_P4.14mm_Vertical","Connector_TE-Connectivity/TE_MATE-N-LOK_1-770866-x_1x02_P4.14mm_Vertical","Connector_TE-Connectivity/TE_MATE-N-LOK_1-770870-x_1x03_P4.14mm_Vertical","Connector_TE-Connectivity/TE_MATE-N-LOK_1-770874-x_2x02_P4.14mm_Vertical","Connector_TE-Connectivity/TE_MATE-N-LOK_1-770875-x_2x03_P4.14mm_Vertical","Connector_TE-Connectivity/TE_MATE-N-LOK_1-770966-x_1x02_P4.14mm_Horizontal","Connector_TE-Connectivity/TE_MATE-N-LOK_1-770967-x_1x03_P4.14mm_Horizontal","Connector_TE-Connectivity/TE_MATE-N-LOK_1-770968-x_2x02_P4.14mm_Horizontal","Connector_TE-Connectivity/TE_MATE-N-LOK_1-770969-x_2x03_P4.14mm_Horizontal","Connector_TE-Connectivity/TE_MATE-N-LOK_1-770970-x_2x04_P4.14mm_Horizontal","Connector_TE-Connectivity/TE_MATE-N-LOK_1-770971-x_2x05_P4.14mm_Horizontal","Connector_TE-Connectivity/TE_MATE-N-LOK_1-770972-x_2x06_P4.14mm_Horizontal","Connector_TE-Connectivity/TE_MATE-N-LOK_1-770973-x_2x07_P4.14mm_Horizontal","Connector_TE-Connectivity/TE_MATE-N-LOK_1-770974-x_2x08_P4.14mm_Horizontal","Connector_TE-Connectivity/TE_MATE-N-LOK_1-794067-x_2x07_P4.14mm_Vertical","Connector_TE-Connectivity/TE_MATE-N-LOK_1-794068-x_2x08_P4.14mm_Vertical","Connector_TE-Connectivity/TE_MATE-N-LOK_1-794069-x_2x09_P4.14mm_Vertical","Connector_TE-Connectivity/TE_MATE-N-LOK_1-794070-x_2x10_P4.14mm_Vertical","Connector_TE-Connectivity/TE_MATE-N-LOK_1-794071-x_2x11_P4.14mm_Vertical","Connector_TE-Connectivity/TE_MATE-N-LOK_1-794072-x_2x12_P4.14mm_Vertical","Connector_TE-Connectivity/TE_MATE-N-LOK_1-794073-x_2x04_P4.14mm_Vertical","Connector_TE-Connectivity/TE_MATE-N-LOK_1-794105-x_2x09_P4.14mm_Horizontal","Connector_TE-Connectivity/TE_MATE-N-LOK_1-794106-x_2x10_P4.14mm_Horizontal","Connector_TE-Connectivity/TE_MATE-N-LOK_1-794107-x_2x11_P4.14mm_Horizontal","Connector_TE-Connectivity/TE_MATE-N-LOK_1-794108-x_2x12_P4.14mm_Horizontal","Connector_TE-Connectivity/TE_MATE-N-LOK_1-794374-x_1x01_P4.14mm_Horizontal","Connector_TE-Connectivity/TE_MATE-N-LOK_350211-1_1x04_P5.08mm_Vertical","Connector_TE-Connectivity/TE_Micro-MaTch_1-215079-0_2x05_P1.27mm_Vertical","Connector_TE-Connectivity/TE_Micro-MaTch_1-215079-2_2x06_P1.27mm_Vertical","Connector_TE-Connectivity/TE_Micro-MaTch_1-215079-4_2x07_P1.27mm_Vertical","Connector_TE-Connectivity/TE_Micro-MaTch_1-215079-6_2x08_P1.27mm_Vertical","Connector_TE-Connectivity/TE_Micro-MaTch_1-215079-8_2x09_P1.27mm_Vertical","Connector_TE-Connectivity/TE_Micro-MaTch_2-215079-0_2x10_P1.27mm_Vertical","Connector_TE-Connectivity/TE_Micro-MaTch_215079-4_2x02_P1.27mm_Vertical","Connector_TE-Connectivity/TE_Micro-MaTch_215079-6_2x03_P1.27mm_Vertical","Connector_TE-Connectivity/TE_Micro-MaTch_215079-8_2x04_P1.27mm_Vertical","Connector_TE-Connectivity/TE_T4041037031-000_M8_03_Socket_Straight","Connector_TE-Connectivity/TE_T4041037041-000_M8_04_Socket_Straight","Connector_USB/USB3_A_Molex_48393-001","Connector_USB/USB3_A_Molex_48406-0001_Horizontal_Stacked","Connector_USB/USB3_A_Plug_Wuerth_692112030100_Horizontal","Connector_USB/USB3_A_Receptacle_Wuerth_692122030100","Connector_USB/USB3_Micro-B_Connfly_DS1104-01","Connector_USB/USB_A_CNCTech_1001-011-01101_Horizontal","Connector_USB/USB_A_CUI_UJ2-ADH-TH_Horizontal_Stacked","Connector_USB/USB_A_Connfly_DS1095","Connector_USB/USB_A_Connfly_DS1098_Horizontal","Connector_USB/USB_A_Kycon_KUSBX-AS1N-B_Horizontal","Connector_USB/USB_A_Molex_105057_Vertical","Connector_USB/USB_A_Molex_48037-2200_Horizontal","Connector_USB/USB_A_Molex_67643_Horizontal","Connector_USB/USB_A_Receptacle_GCT_USB1046","Connector_USB/USB_A_Receptacle_XKB_U231-091N-4BLRA00-S","Connector_USB/USB_A_Stewart_SS-52100-001_Horizontal","Connector_USB/USB_A_TE_292303-7_Horizontal","Connector_USB/USB_A_Wuerth_614004134726_Horizontal","Connector_USB/USB_A_Wuerth_61400826021_Horizontal_Stacked","Connector_USB/USB_B_Amphenol_MUSB-D511_Vertical_Rugged","Connector_USB/USB_B_Lumberg_2411_02_Horizontal","Connector_USB/USB_B_OST_USB-B1HSxx_Horizontal","Connector_USB/USB_B_TE_5787834_Vertical","Connector_USB/USB_C_Plug_JAE_DX07P024AJ1","Connector_USB/USB_C_Plug_Molex_105444","Connector_USB/USB_C_Plug_ShenzhenJingTuoJin_918-118A2021Y40002_Vertical","Connector_USB/USB_C_Receptacle_Amphenol_12401548E4-2A","Connector_USB/USB_C_Receptacle_Amphenol_12401548E4-2A_CircularHoles","Connector_USB/USB_C_Receptacle_Amphenol_12401610E4-2A","Connector_USB/USB_C_Receptacle_Amphenol_12401610E4-2A_CircularHoles","Connector_USB/USB_C_Receptacle_Amphenol_12401948E412A","Connector_USB/USB_C_Receptacle_Amphenol_124019772112A","Connector_USB/USB_C_Receptacle_CNCTech_C-ARA1-AK51X","Connector_USB/USB_C_Receptacle_G-Switch_GT-USB-7010ASV","Connector_USB/USB_C_Receptacle_G-Switch_GT-USB-7025","Connector_USB/USB_C_Receptacle_G-Switch_GT-USB-7051x","Connector_USB/USB_C_Receptacle_GCT_USB4085","Connector_USB/USB_C_Receptacle_GCT_USB4105-xx-A_16P_TopMnt_Horizontal","Connector_USB/USB_C_Receptacle_GCT_USB4110","Connector_USB/USB_C_Receptacle_GCT_USB4115-03-C","Connector_USB/USB_C_Receptacle_GCT_USB4125-xx-x-0190_6P_TopMnt_Horizontal","Connector_USB/USB_C_Receptacle_GCT_USB4125-xx-x_6P_TopMnt_Horizontal","Connector_USB/USB_C_Receptacle_GCT_USB4135-GF-A_6P_TopMnt_Horizontal","Connector_USB/USB_C_Receptacle_HCTL_HC-TYPE-C-16P-01A","Connector_USB/USB_C_Receptacle_HRO_TYPE-C-31-M-12","Connector_USB/USB_C_Receptacle_HRO_TYPE-C-31-M-17","Connector_USB/USB_C_Receptacle_JAE_DX07S016JA1R1500","Connector_USB/USB_C_Receptacle_JAE_DX07S024WJ1R350","Connector_USB/USB_C_Receptacle_JAE_DX07S024WJ3R400","Connector_USB/USB_C_Receptacle_Molex_105450-0101","Connector_USB/USB_C_Receptacle_Palconn_UTC16-G","Connector_USB/USB_C_Receptacle_XKB_U262-16XN-4BVC11","Connector_USB/USB_Micro-AB_Molex_47590-0001","Connector_USB/USB_Micro-B_Amphenol_10103594-0001LF_Horizontal","Connector_USB/USB_Micro-B_Amphenol_10104110_Horizontal","Connector_USB/USB_Micro-B_Amphenol_10118193-0001LF_Horizontal","Connector_USB/USB_Micro-B_Amphenol_10118193-0002LF_Horizontal","Connector_USB/USB_Micro-B_Amphenol_10118194-0001LF_Horizontal","Connector_USB/USB_Micro-B_Amphenol_10118194_Horizontal","Connector_USB/USB_Micro-B_GCT_USB3076-30-A","Connector_USB/USB_Micro-B_Molex-105017-0001","Connector_USB/USB_Micro-B_Molex-105133-0001","Connector_USB/USB_Micro-B_Molex-105133-0031","Connector_USB/USB_Micro-B_Molex_47346-0001","Connector_USB/USB_Micro-B_Technik_TWP-4002D-H3","Connector_USB/USB_Micro-B_Wuerth_614105150721_Vertical","Connector_USB/USB_Micro-B_Wuerth_614105150721_Vertical_CircularHoles","Connector_USB/USB_Micro-B_Wuerth_629105150521","Connector_USB/USB_Micro-B_Wuerth_629105150521_CircularHoles","Connector_USB/USB_Micro-B_XKB_U254-051T-4BH83-F1S","Connector_USB/USB_Mini-B_AdamTech_MUSB-B5-S-VT-TSMT-1_SMD_Vertical","Connector_USB/USB_Mini-B_Lumberg_2486_01_Horizontal","Connector_USB/USB_Mini-B_Tensility_54-00023_Vertical","Connector_USB/USB_Mini-B_Tensility_54-00023_Vertical_CircularHoles","Connector_USB/USB_Mini-B_Wuerth_65100516121_Horizontal","Connector_Video/DVI-D_Molex_74320-4004_Horizontal","Connector_Video/DVI-I_Molex_74320-1004_Horizontal","Connector_Video/HDMI_A_Amphenol_10029449-x01xLF_Horizontal","Connector_Video/HDMI_A_Contact_Technology_19APL2_Horizontal","Connector_Video/HDMI_A_Kycon_KDMIX-SL1-NS-WS-B15_VerticalRightAngle","Connector_Video/HDMI_A_Molex_208658-1001_Horizontal","Connector_Video/HDMI_Micro-D_Molex_46765-0xxx","Connector_Video/HDMI_Micro-D_Molex_46765-1xxx","Connector_Video/HDMI_Micro-D_Molex_46765-2xxx","Connector_Wago/Wago_734-132_1x02_P3.50mm_Vertical","Connector_Wago/Wago_734-133_1x03_P3.50mm_Vertical","Connector_Wago/Wago_734-134_1x04_P3.50mm_Vertical","Connector_Wago/Wago_734-135_1x05_P3.50mm_Vertical","Connector_Wago/Wago_734-136_1x06_P3.50mm_Vertical","Connector_Wago/Wago_734-137_1x07_P3.50mm_Vertical","Connector_Wago/Wago_734-138_1x08_P3.50mm_Vertical","Connector_Wago/Wago_734-139_1x09_P3.50mm_Vertical","Connector_Wago/Wago_734-140_1x10_P3.50mm_Vertical","Connector_Wago/Wago_734-141_1x11_P3.50mm_Vertical","Connector_Wago/Wago_734-142_1x12_P3.50mm_Vertical","Connector_Wago/Wago_734-143_1x13_P3.50mm_Vertical","Connector_Wago/Wago_734-144_1x14_P3.50mm_Vertical","Connector_Wago/Wago_734-146_1x16_P3.50mm_Vertical","Connector_Wago/Wago_734-148_1x18_P3.50mm_Vertical","Connector_Wago/Wago_734-150_1x20_P3.50mm_Vertical","Connector_Wago/Wago_734-154_1x24_P3.50mm_Vertical","Connector_Wago/Wago_734-162_1x02_P3.50mm_Horizontal","Connector_Wago/Wago_734-163_1x03_P3.50mm_Horizontal","Connector_Wago/Wago_734-164_1x04_P3.50mm_Horizontal","Connector_Wago/Wago_734-165_1x05_P3.50mm_Horizontal","Connector_Wago/Wago_734-166_1x06_P3.50mm_Horizontal","Connector_Wago/Wago_734-167_1x07_P3.50mm_Horizontal","Connector_Wago/Wago_734-168_1x08_P3.50mm_Horizontal","Connector_Wago/Wago_734-169_1x09_P3.50mm_Horizontal","Connector_Wago/Wago_734-170_1x10_P3.50mm_Horizontal","Connector_Wago/Wago_734-171_1x11_P3.50mm_Horizontal","Connector_Wago/Wago_734-172_1x12_P3.50mm_Horizontal","Connector_Wago/Wago_734-173_1x13_P3.50mm_Horizontal","Connector_Wago/Wago_734-174_1x14_P3.50mm_Horizontal","Connector_Wago/Wago_734-176_1x16_P3.50mm_Horizontal","Connector_Wago/Wago_734-178_1x18_P3.50mm_Horizontal","Connector_Wago/Wago_734-180_1x20_P3.50mm_Horizontal","Connector_Wago/Wago_734-184_1x24_P3.50mm_Horizontal","Connector_Wire/SolderWire-0.127sqmm_1x01_D0.48mm_OD1mm","Connector_Wire/SolderWire-0.127sqmm_1x01_D0.48mm_OD1mm_Relief","Connector_Wire/SolderWire-0.127sqmm_1x01_D0.48mm_OD1mm_Relief2x","Connector_Wire/SolderWire-0.127sqmm_1x02_P3.7mm_D0.48mm_OD1mm","Connector_Wire/SolderWire-0.127sqmm_1x02_P3.7mm_D0.48mm_OD1mm_Relief","Connector_Wire/SolderWire-0.127sqmm_1x02_P3.7mm_D0.48mm_OD1mm_Relief2x","Connector_Wire/SolderWire-0.127sqmm_1x03_P3.7mm_D0.48mm_OD1mm","Connector_Wire/SolderWire-0.127sqmm_1x03_P3.7mm_D0.48mm_OD1mm_Relief","Connector_Wire/SolderWire-0.127sqmm_1x03_P3.7mm_D0.48mm_OD1mm_Relief2x","Connector_Wire/SolderWire-0.127sqmm_1x04_P3.7mm_D0.48mm_OD1mm","Connector_Wire/SolderWire-0.127sqmm_1x04_P3.7mm_D0.48mm_OD1mm_Relief","Connector_Wire/SolderWire-0.127sqmm_1x04_P3.7mm_D0.48mm_OD1mm_Relief2x","Connector_Wire/SolderWire-0.127sqmm_1x05_P3.7mm_D0.48mm_OD1mm","Connector_Wire/SolderWire-0.127sqmm_1x05_P3.7mm_D0.48mm_OD1mm_Relief","Connector_Wire/SolderWire-0.127sqmm_1x05_P3.7mm_D0.48mm_OD1mm_Relief2x","Connector_Wire/SolderWire-0.127sqmm_1x06_P3.7mm_D0.48mm_OD1mm","Connector_Wire/SolderWire-0.127sqmm_1x06_P3.7mm_D0.48mm_OD1mm_Relief","Connector_Wire/SolderWire-0.127sqmm_1x06_P3.7mm_D0.48mm_OD1mm_Relief2x","Connector_Wire/SolderWire-0.15sqmm_1x01_D0.5mm_OD1.5mm","Connector_Wire/SolderWire-0.15sqmm_1x01_D0.5mm_OD1.5mm_Relief","Connector_Wire/SolderWire-0.15sqmm_1x01_D0.5mm_OD1.5mm_Relief2x","Connector_Wire/SolderWire-0.15sqmm_1x02_P4mm_D0.5mm_OD1.5mm","Connector_Wire/SolderWire-0.15sqmm_1x02_P4mm_D0.5mm_OD1.5mm_Relief","Connector_Wire/SolderWire-0.15sqmm_1x02_P4mm_D0.5mm_OD1.5mm_Relief2x","Connector_Wire/SolderWire-0.15sqmm_1x03_P4mm_D0.5mm_OD1.5mm","Connector_Wire/SolderWire-0.15sqmm_1x03_P4mm_D0.5mm_OD1.5mm_Relief","Connector_Wire/SolderWire-0.15sqmm_1x03_P4mm_D0.5mm_OD1.5mm_Relief2x","Connector_Wire/SolderWire-0.15sqmm_1x04_P4mm_D0.5mm_OD1.5mm","Connector_Wire/SolderWire-0.15sqmm_1x04_P4mm_D0.5mm_OD1.5mm_Relief","Connector_Wire/SolderWire-0.15sqmm_1x04_P4mm_D0.5mm_OD1.5mm_Relief2x","Connector_Wire/SolderWire-0.15sqmm_1x05_P4mm_D0.5mm_OD1.5mm","Connector_Wire/SolderWire-0.15sqmm_1x05_P4mm_D0.5mm_OD1.5mm_Relief","Connector_Wire/SolderWire-0.15sqmm_1x05_P4mm_D0.5mm_OD1.5mm_Relief2x","Connector_Wire/SolderWire-0.15sqmm_1x06_P4mm_D0.5mm_OD1.5mm","Connector_Wire/SolderWire-0.15sqmm_1x06_P4mm_D0.5mm_OD1.5mm_Relief","Connector_Wire/SolderWire-0.15sqmm_1x06_P4mm_D0.5mm_OD1.5mm_Relief2x","Connector_Wire/SolderWire-0.1sqmm_1x01_D0.4mm_OD1mm","Connector_Wire/SolderWire-0.1sqmm_1x01_D0.4mm_OD1mm_Relief","Connector_Wire/SolderWire-0.1sqmm_1x01_D0.4mm_OD1mm_Relief2x","Connector_Wire/SolderWire-0.1sqmm_1x02_P3.6mm_D0.4mm_OD1mm","Connector_Wire/SolderWire-0.1sqmm_1x02_P3.6mm_D0.4mm_OD1mm_Relief","Connector_Wire/SolderWire-0.1sqmm_1x02_P3.6mm_D0.4mm_OD1mm_Relief2x","Connector_Wire/SolderWire-0.1sqmm_1x03_P3.6mm_D0.4mm_OD1mm","Connector_Wire/SolderWire-0.1sqmm_1x03_P3.6mm_D0.4mm_OD1mm_Relief","Connector_Wire/SolderWire-0.1sqmm_1x03_P3.6mm_D0.4mm_OD1mm_Relief2x","Connector_Wire/SolderWire-0.1sqmm_1x04_P3.6mm_D0.4mm_OD1mm","Connector_Wire/SolderWire-0.1sqmm_1x04_P3.6mm_D0.4mm_OD1mm_Relief","Connector_Wire/SolderWire-0.1sqmm_1x04_P3.6mm_D0.4mm_OD1mm_Relief2x","Connector_Wire/SolderWire-0.1sqmm_1x05_P3.6mm_D0.4mm_OD1mm","Connector_Wire/SolderWire-0.1sqmm_1x05_P3.6mm_D0.4mm_OD1mm_Relief","Connector_Wire/SolderWire-0.1sqmm_1x05_P3.6mm_D0.4mm_OD1mm_Relief2x","Connector_Wire/SolderWire-0.1sqmm_1x06_P3.6mm_D0.4mm_OD1mm","Connector_Wire/SolderWire-0.1sqmm_1x06_P3.6mm_D0.4mm_OD1mm_Relief","Connector_Wire/SolderWire-0.1sqmm_1x06_P3.6mm_D0.4mm_OD1mm_Relief2x","Connector_Wire/SolderWire-0.25sqmm_1x01_D0.65mm_OD1.7mm","Connector_Wire/SolderWire-0.25sqmm_1x01_D0.65mm_OD1.7mm_Relief","Connector_Wire/SolderWire-0.25sqmm_1x01_D0.65mm_OD1.7mm_Relief2x","Connector_Wire/SolderWire-0.25sqmm_1x01_D0.65mm_OD2mm","Connector_Wire/SolderWire-0.25sqmm_1x01_D0.65mm_OD2mm_Relief","Connector_Wire/SolderWire-0.25sqmm_1x01_D0.65mm_OD2mm_Relief2x","Connector_Wire/SolderWire-0.25sqmm_1x02_P4.2mm_D0.65mm_OD1.7mm","Connector_Wire/SolderWire-0.25sqmm_1x02_P4.2mm_D0.65mm_OD1.7mm_Relief","Connector_Wire/SolderWire-0.25sqmm_1x02_P4.2mm_D0.65mm_OD1.7mm_Relief2x","Connector_Wire/SolderWire-0.25sqmm_1x02_P4.5mm_D0.65mm_OD2mm","Connector_Wire/SolderWire-0.25sqmm_1x02_P4.5mm_D0.65mm_OD2mm_Relief","Connector_Wire/SolderWire-0.25sqmm_1x02_P4.5mm_D0.65mm_OD2mm_Relief2x","Connector_Wire/SolderWire-0.25sqmm_1x03_P4.2mm_D0.65mm_OD1.7mm","Connector_Wire/SolderWire-0.25sqmm_1x03_P4.2mm_D0.65mm_OD1.7mm_Relief","Connector_Wire/SolderWire-0.25sqmm_1x03_P4.2mm_D0.65mm_OD1.7mm_Relief2x","Connector_Wire/SolderWire-0.25sqmm_1x03_P4.5mm_D0.65mm_OD2mm","Connector_Wire/SolderWire-0.25sqmm_1x03_P4.5mm_D0.65mm_OD2mm_Relief","Connector_Wire/SolderWire-0.25sqmm_1x03_P4.5mm_D0.65mm_OD2mm_Relief2x","Connector_Wire/SolderWire-0.25sqmm_1x04_P4.2mm_D0.65mm_OD1.7mm","Connector_Wire/SolderWire-0.25sqmm_1x04_P4.2mm_D0.65mm_OD1.7mm_Relief","Connector_Wire/SolderWire-0.25sqmm_1x04_P4.2mm_D0.65mm_OD1.7mm_Relief2x","Connector_Wire/SolderWire-0.25sqmm_1x04_P4.5mm_D0.65mm_OD2mm","Connector_Wire/SolderWire-0.25sqmm_1x04_P4.5mm_D0.65mm_OD2mm_Relief","Connector_Wire/SolderWire-0.25sqmm_1x04_P4.5mm_D0.65mm_OD2mm_Relief2x","Connector_Wire/SolderWire-0.25sqmm_1x05_P4.2mm_D0.65mm_OD1.7mm","Connector_Wire/SolderWire-0.25sqmm_1x05_P4.2mm_D0.65mm_OD1.7mm_Relief","Connector_Wire/SolderWire-0.25sqmm_1x05_P4.2mm_D0.65mm_OD1.7mm_Relief2x","Connector_Wire/SolderWire-0.25sqmm_1x05_P4.5mm_D0.65mm_OD2mm","Connector_Wire/SolderWire-0.25sqmm_1x05_P4.5mm_D0.65mm_OD2mm_Relief","Connector_Wire/SolderWire-0.25sqmm_1x05_P4.5mm_D0.65mm_OD2mm_Relief2x","Connector_Wire/SolderWire-0.25sqmm_1x06_P4.2mm_D0.65mm_OD1.7mm","Connector_Wire/SolderWire-0.25sqmm_1x06_P4.2mm_D0.65mm_OD1.7mm_Relief","Connector_Wire/SolderWire-0.25sqmm_1x06_P4.2mm_D0.65mm_OD1.7mm_Relief2x","Connector_Wire/SolderWire-0.25sqmm_1x06_P4.5mm_D0.65mm_OD2mm","Connector_Wire/SolderWire-0.25sqmm_1x06_P4.5mm_D0.65mm_OD2mm_Relief","Connector_Wire/SolderWire-0.25sqmm_1x06_P4.5mm_D0.65mm_OD2mm_Relief2x","Connector_Wire/SolderWire-0.5sqmm_1x01_D0.9mm_OD2.1mm","Connector_Wire/SolderWire-0.5sqmm_1x01_D0.9mm_OD2.1mm_Relief","Connector_Wire/SolderWire-0.5sqmm_1x01_D0.9mm_OD2.1mm_Relief2x","Connector_Wire/SolderWire-0.5sqmm_1x01_D0.9mm_OD2.3mm","Connector_Wire/SolderWire-0.5sqmm_1x01_D0.9mm_OD2.3mm_Relief","Connector_Wire/SolderWire-0.5sqmm_1x01_D0.9mm_OD2.3mm_Relief2x","Connector_Wire/SolderWire-0.5sqmm_1x02_P4.6mm_D0.9mm_OD2.1mm","Connector_Wire/SolderWire-0.5sqmm_1x02_P4.6mm_D0.9mm_OD2.1mm_Relief","Connector_Wire/SolderWire-0.5sqmm_1x02_P4.6mm_D0.9mm_OD2.1mm_Relief2x","Connector_Wire/SolderWire-0.5sqmm_1x02_P4.8mm_D0.9mm_OD2.3mm","Connector_Wire/SolderWire-0.5sqmm_1x02_P4.8mm_D0.9mm_OD2.3mm_Relief","Connector_Wire/SolderWire-0.5sqmm_1x02_P4.8mm_D0.9mm_OD2.3mm_Relief2x","Connector_Wire/SolderWire-0.5sqmm_1x03_P4.6mm_D0.9mm_OD2.1mm","Connector_Wire/SolderWire-0.5sqmm_1x03_P4.6mm_D0.9mm_OD2.1mm_Relief","Connector_Wire/SolderWire-0.5sqmm_1x03_P4.6mm_D0.9mm_OD2.1mm_Relief2x","Connector_Wire/SolderWire-0.5sqmm_1x03_P4.8mm_D0.9mm_OD2.3mm","Connector_Wire/SolderWire-0.5sqmm_1x03_P4.8mm_D0.9mm_OD2.3mm_Relief","Connector_Wire/SolderWire-0.5sqmm_1x03_P4.8mm_D0.9mm_OD2.3mm_Relief2x","Connector_Wire/SolderWire-0.5sqmm_1x04_P4.6mm_D0.9mm_OD2.1mm","Connector_Wire/SolderWire-0.5sqmm_1x04_P4.6mm_D0.9mm_OD2.1mm_Relief","Connector_Wire/SolderWire-0.5sqmm_1x04_P4.6mm_D0.9mm_OD2.1mm_Relief2x","Connector_Wire/SolderWire-0.5sqmm_1x04_P4.8mm_D0.9mm_OD2.3mm","Connector_Wire/SolderWire-0.5sqmm_1x04_P4.8mm_D0.9mm_OD2.3mm_Relief","Connector_Wire/SolderWire-0.5sqmm_1x04_P4.8mm_D0.9mm_OD2.3mm_Relief2x","Connector_Wire/SolderWire-0.5sqmm_1x05_P4.6mm_D0.9mm_OD2.1mm","Connector_Wire/SolderWire-0.5sqmm_1x05_P4.6mm_D0.9mm_OD2.1mm_Relief","Connector_Wire/SolderWire-0.5sqmm_1x05_P4.6mm_D0.9mm_OD2.1mm_Relief2x","Connector_Wire/SolderWire-0.5sqmm_1x05_P4.8mm_D0.9mm_OD2.3mm","Connector_Wire/SolderWire-0.5sqmm_1x05_P4.8mm_D0.9mm_OD2.3mm_Relief","Connector_Wire/SolderWire-0.5sqmm_1x05_P4.8mm_D0.9mm_OD2.3mm_Relief2x","Connector_Wire/SolderWire-0.5sqmm_1x06_P4.6mm_D0.9mm_OD2.1mm","Connector_Wire/SolderWire-0.5sqmm_1x06_P4.6mm_D0.9mm_OD2.1mm_Relief","Connector_Wire/SolderWire-0.5sqmm_1x06_P4.6mm_D0.9mm_OD2.1mm_Relief2x","Connector_Wire/SolderWire-0.5sqmm_1x06_P4.8mm_D0.9mm_OD2.3mm","Connector_Wire/SolderWire-0.5sqmm_1x06_P4.8mm_D0.9mm_OD2.3mm_Relief","Connector_Wire/SolderWire-0.5sqmm_1x06_P4.8mm_D0.9mm_OD2.3mm_Relief2x","Connector_Wire/SolderWire-0.75sqmm_1x01_D1.25mm_OD2.3mm","Connector_Wire/SolderWire-0.75sqmm_1x01_D1.25mm_OD2.3mm_Relief","Connector_Wire/SolderWire-0.75sqmm_1x01_D1.25mm_OD2.3mm_Relief2x","Connector_Wire/SolderWire-0.75sqmm_1x01_D1.25mm_OD3.5mm","Connector_Wire/SolderWire-0.75sqmm_1x01_D1.25mm_OD3.5mm_Relief","Connector_Wire/SolderWire-0.75sqmm_1x01_D1.25mm_OD3.5mm_Relief2x","Connector_Wire/SolderWire-0.75sqmm_1x02_P4.8mm_D1.25mm_OD2.3mm","Connector_Wire/SolderWire-0.75sqmm_1x02_P4.8mm_D1.25mm_OD2.3mm_Relief","Connector_Wire/SolderWire-0.75sqmm_1x02_P4.8mm_D1.25mm_OD2.3mm_Relief2x","Connector_Wire/SolderWire-0.75sqmm_1x02_P7mm_D1.25mm_OD3.5mm","Connector_Wire/SolderWire-0.75sqmm_1x02_P7mm_D1.25mm_OD3.5mm_Relief","Connector_Wire/SolderWire-0.75sqmm_1x02_P7mm_D1.25mm_OD3.5mm_Relief2x","Connector_Wire/SolderWire-0.75sqmm_1x03_P4.8mm_D1.25mm_OD2.3mm","Connector_Wire/SolderWire-0.75sqmm_1x03_P4.8mm_D1.25mm_OD2.3mm_Relief","Connector_Wire/SolderWire-0.75sqmm_1x03_P4.8mm_D1.25mm_OD2.3mm_Relief2x","Connector_Wire/SolderWire-0.75sqmm_1x03_P7mm_D1.25mm_OD3.5mm","Connector_Wire/SolderWire-0.75sqmm_1x03_P7mm_D1.25mm_OD3.5mm_Relief","Connector_Wire/SolderWire-0.75sqmm_1x03_P7mm_D1.25mm_OD3.5mm_Relief2x","Connector_Wire/SolderWire-0.75sqmm_1x04_P4.8mm_D1.25mm_OD2.3mm","Connector_Wire/SolderWire-0.75sqmm_1x04_P4.8mm_D1.25mm_OD2.3mm_Relief","Connector_Wire/SolderWire-0.75sqmm_1x04_P4.8mm_D1.25mm_OD2.3mm_Relief2x","Connector_Wire/SolderWire-0.75sqmm_1x04_P7mm_D1.25mm_OD3.5mm","Connector_Wire/SolderWire-0.75sqmm_1x04_P7mm_D1.25mm_OD3.5mm_Relief","Connector_Wire/SolderWire-0.75sqmm_1x04_P7mm_D1.25mm_OD3.5mm_Relief2x","Connector_Wire/SolderWire-0.75sqmm_1x05_P4.8mm_D1.25mm_OD2.3mm","Connector_Wire/SolderWire-0.75sqmm_1x05_P4.8mm_D1.25mm_OD2.3mm_Relief","Connector_Wire/SolderWire-0.75sqmm_1x05_P4.8mm_D1.25mm_OD2.3mm_Relief2x","Connector_Wire/SolderWire-0.75sqmm_1x05_P7mm_D1.25mm_OD3.5mm","Connector_Wire/SolderWire-0.75sqmm_1x05_P7mm_D1.25mm_OD3.5mm_Relief","Connector_Wire/SolderWire-0.75sqmm_1x05_P7mm_D1.25mm_OD3.5mm_Relief2x","Connector_Wire/SolderWire-0.75sqmm_1x06_P4.8mm_D1.25mm_OD2.3mm","Connector_Wire/SolderWire-0.75sqmm_1x06_P4.8mm_D1.25mm_OD2.3mm_Relief","Connector_Wire/SolderWire-0.75sqmm_1x06_P4.8mm_D1.25mm_OD2.3mm_Relief2x","Connector_Wire/SolderWire-0.75sqmm_1x06_P7mm_D1.25mm_OD3.5mm","Connector_Wire/SolderWire-0.75sqmm_1x06_P7mm_D1.25mm_OD3.5mm_Relief","Connector_Wire/SolderWire-0.75sqmm_1x06_P7mm_D1.25mm_OD3.5mm_Relief2x","Connector_Wire/SolderWire-1.5sqmm_1x01_D1.7mm_OD3.9mm","Connector_Wire/SolderWire-1.5sqmm_1x01_D1.7mm_OD3.9mm_Relief","Connector_Wire/SolderWire-1.5sqmm_1x01_D1.7mm_OD3.9mm_Relief2x","Connector_Wire/SolderWire-1.5sqmm_1x01_D1.7mm_OD3mm","Connector_Wire/SolderWire-1.5sqmm_1x01_D1.7mm_OD3mm_Relief","Connector_Wire/SolderWire-1.5sqmm_1x01_D1.7mm_OD3mm_Relief2x","Connector_Wire/SolderWire-1.5sqmm_1x02_P6mm_D1.7mm_OD3mm","Connector_Wire/SolderWire-1.5sqmm_1x02_P6mm_D1.7mm_OD3mm_Relief","Connector_Wire/SolderWire-1.5sqmm_1x02_P6mm_D1.7mm_OD3mm_Relief2x","Connector_Wire/SolderWire-1.5sqmm_1x02_P7.8mm_D1.7mm_OD3.9mm","Connector_Wire/SolderWire-1.5sqmm_1x02_P7.8mm_D1.7mm_OD3.9mm_Relief","Connector_Wire/SolderWire-1.5sqmm_1x02_P7.8mm_D1.7mm_OD3.9mm_Relief2x","Connector_Wire/SolderWire-1.5sqmm_1x03_P6mm_D1.7mm_OD3mm","Connector_Wire/SolderWire-1.5sqmm_1x03_P6mm_D1.7mm_OD3mm_Relief","Connector_Wire/SolderWire-1.5sqmm_1x03_P6mm_D1.7mm_OD3mm_Relief2x","Connector_Wire/SolderWire-1.5sqmm_1x03_P7.8mm_D1.7mm_OD3.9mm","Connector_Wire/SolderWire-1.5sqmm_1x03_P7.8mm_D1.7mm_OD3.9mm_Relief","Connector_Wire/SolderWire-1.5sqmm_1x03_P7.8mm_D1.7mm_OD3.9mm_Relief2x","Connector_Wire/SolderWire-1.5sqmm_1x04_P6mm_D1.7mm_OD3mm","Connector_Wire/SolderWire-1.5sqmm_1x04_P6mm_D1.7mm_OD3mm_Relief","Connector_Wire/SolderWire-1.5sqmm_1x04_P6mm_D1.7mm_OD3mm_Relief2x","Connector_Wire/SolderWire-1.5sqmm_1x04_P7.8mm_D1.7mm_OD3.9mm","Connector_Wire/SolderWire-1.5sqmm_1x04_P7.8mm_D1.7mm_OD3.9mm_Relief","Connector_Wire/SolderWire-1.5sqmm_1x04_P7.8mm_D1.7mm_OD3.9mm_Relief2x","Connector_Wire/SolderWire-1.5sqmm_1x05_P6mm_D1.7mm_OD3mm","Connector_Wire/SolderWire-1.5sqmm_1x05_P6mm_D1.7mm_OD3mm_Relief","Connector_Wire/SolderWire-1.5sqmm_1x05_P6mm_D1.7mm_OD3mm_Relief2x","Connector_Wire/SolderWire-1.5sqmm_1x05_P7.8mm_D1.7mm_OD3.9mm","Connector_Wire/SolderWire-1.5sqmm_1x05_P7.8mm_D1.7mm_OD3.9mm_Relief","Connector_Wire/SolderWire-1.5sqmm_1x05_P7.8mm_D1.7mm_OD3.9mm_Relief2x","Connector_Wire/SolderWire-1.5sqmm_1x06_P6mm_D1.7mm_OD3mm","Connector_Wire/SolderWire-1.5sqmm_1x06_P6mm_D1.7mm_OD3mm_Relief","Connector_Wire/SolderWire-1.5sqmm_1x06_P6mm_D1.7mm_OD3mm_Relief2x","Connector_Wire/SolderWire-1.5sqmm_1x06_P7.8mm_D1.7mm_OD3.9mm","Connector_Wire/SolderWire-1.5sqmm_1x06_P7.8mm_D1.7mm_OD3.9mm_Relief","Connector_Wire/SolderWire-1.5sqmm_1x06_P7.8mm_D1.7mm_OD3.9mm_Relief2x","Connector_Wire/SolderWire-1sqmm_1x01_D1.4mm_OD2.7mm","Connector_Wire/SolderWire-1sqmm_1x01_D1.4mm_OD2.7mm_Relief","Connector_Wire/SolderWire-1sqmm_1x01_D1.4mm_OD2.7mm_Relief2x","Connector_Wire/SolderWire-1sqmm_1x01_D1.4mm_OD3.9mm","Connector_Wire/SolderWire-1sqmm_1x01_D1.4mm_OD3.9mm_Relief","Connector_Wire/SolderWire-1sqmm_1x01_D1.4mm_OD3.9mm_Relief2x","Connector_Wire/SolderWire-1sqmm_1x02_P5.4mm_D1.4mm_OD2.7mm","Connector_Wire/SolderWire-1sqmm_1x02_P5.4mm_D1.4mm_OD2.7mm_Relief","Connector_Wire/SolderWire-1sqmm_1x02_P5.4mm_D1.4mm_OD2.7mm_Relief2x","Connector_Wire/SolderWire-1sqmm_1x02_P7.8mm_D1.4mm_OD3.9mm","Connector_Wire/SolderWire-1sqmm_1x02_P7.8mm_D1.4mm_OD3.9mm_Relief","Connector_Wire/SolderWire-1sqmm_1x02_P7.8mm_D1.4mm_OD3.9mm_Relief2x","Connector_Wire/SolderWire-1sqmm_1x03_P5.4mm_D1.4mm_OD2.7mm","Connector_Wire/SolderWire-1sqmm_1x03_P5.4mm_D1.4mm_OD2.7mm_Relief","Connector_Wire/SolderWire-1sqmm_1x03_P5.4mm_D1.4mm_OD2.7mm_Relief2x","Connector_Wire/SolderWire-1sqmm_1x03_P7.8mm_D1.4mm_OD3.9mm","Connector_Wire/SolderWire-1sqmm_1x03_P7.8mm_D1.4mm_OD3.9mm_Relief","Connector_Wire/SolderWire-1sqmm_1x03_P7.8mm_D1.4mm_OD3.9mm_Relief2x","Connector_Wire/SolderWire-1sqmm_1x04_P5.4mm_D1.4mm_OD2.7mm","Connector_Wire/SolderWire-1sqmm_1x04_P5.4mm_D1.4mm_OD2.7mm_Relief","Connector_Wire/SolderWire-1sqmm_1x04_P5.4mm_D1.4mm_OD2.7mm_Relief2x","Connector_Wire/SolderWire-1sqmm_1x04_P7.8mm_D1.4mm_OD3.9mm","Connector_Wire/SolderWire-1sqmm_1x04_P7.8mm_D1.4mm_OD3.9mm_Relief","Connector_Wire/SolderWire-1sqmm_1x04_P7.8mm_D1.4mm_OD3.9mm_Relief2x","Connector_Wire/SolderWire-1sqmm_1x05_P5.4mm_D1.4mm_OD2.7mm","Connector_Wire/SolderWire-1sqmm_1x05_P5.4mm_D1.4mm_OD2.7mm_Relief","Connector_Wire/SolderWire-1sqmm_1x05_P5.4mm_D1.4mm_OD2.7mm_Relief2x","Connector_Wire/SolderWire-1sqmm_1x05_P7.8mm_D1.4mm_OD3.9mm","Connector_Wire/SolderWire-1sqmm_1x05_P7.8mm_D1.4mm_OD3.9mm_Relief","Connector_Wire/SolderWire-1sqmm_1x05_P7.8mm_D1.4mm_OD3.9mm_Relief2x","Connector_Wire/SolderWire-1sqmm_1x06_P5.4mm_D1.4mm_OD2.7mm","Connector_Wire/SolderWire-1sqmm_1x06_P5.4mm_D1.4mm_OD2.7mm_Relief","Connector_Wire/SolderWire-1sqmm_1x06_P5.4mm_D1.4mm_OD2.7mm_Relief2x","Connector_Wire/SolderWire-1sqmm_1x06_P7.8mm_D1.4mm_OD3.9mm","Connector_Wire/SolderWire-1sqmm_1x06_P7.8mm_D1.4mm_OD3.9mm_Relief","Connector_Wire/SolderWire-1sqmm_1x06_P7.8mm_D1.4mm_OD3.9mm_Relief2x","Connector_Wire/SolderWire-2.5sqmm_1x01_D2.4mm_OD3.6mm","Connector_Wire/SolderWire-2.5sqmm_1x01_D2.4mm_OD3.6mm_Relief","Connector_Wire/SolderWire-2.5sqmm_1x01_D2.4mm_OD3.6mm_Relief2x","Connector_Wire/SolderWire-2.5sqmm_1x01_D2.4mm_OD4.4mm","Connector_Wire/SolderWire-2.5sqmm_1x01_D2.4mm_OD4.4mm_Relief","Connector_Wire/SolderWire-2.5sqmm_1x01_D2.4mm_OD4.4mm_Relief2x","Connector_Wire/SolderWire-2.5sqmm_1x02_P7.2mm_D2.4mm_OD3.6mm","Connector_Wire/SolderWire-2.5sqmm_1x02_P7.2mm_D2.4mm_OD3.6mm_Relief","Connector_Wire/SolderWire-2.5sqmm_1x02_P7.2mm_D2.4mm_OD3.6mm_Relief2x","Connector_Wire/SolderWire-2.5sqmm_1x02_P8.8mm_D2.4mm_OD4.4mm","Connector_Wire/SolderWire-2.5sqmm_1x02_P8.8mm_D2.4mm_OD4.4mm_Relief","Connector_Wire/SolderWire-2.5sqmm_1x02_P8.8mm_D2.4mm_OD4.4mm_Relief2x","Connector_Wire/SolderWire-2.5sqmm_1x03_P7.2mm_D2.4mm_OD3.6mm","Connector_Wire/SolderWire-2.5sqmm_1x03_P7.2mm_D2.4mm_OD3.6mm_Relief","Connector_Wire/SolderWire-2.5sqmm_1x03_P7.2mm_D2.4mm_OD3.6mm_Relief2x","Connector_Wire/SolderWire-2.5sqmm_1x03_P8.8mm_D2.4mm_OD4.4mm","Connector_Wire/SolderWire-2.5sqmm_1x03_P8.8mm_D2.4mm_OD4.4mm_Relief","Connector_Wire/SolderWire-2.5sqmm_1x03_P8.8mm_D2.4mm_OD4.4mm_Relief2x","Connector_Wire/SolderWire-2.5sqmm_1x04_P7.2mm_D2.4mm_OD3.6mm","Connector_Wire/SolderWire-2.5sqmm_1x04_P7.2mm_D2.4mm_OD3.6mm_Relief","Connector_Wire/SolderWire-2.5sqmm_1x04_P7.2mm_D2.4mm_OD3.6mm_Relief2x","Connector_Wire/SolderWire-2.5sqmm_1x04_P8.8mm_D2.4mm_OD4.4mm","Connector_Wire/SolderWire-2.5sqmm_1x04_P8.8mm_D2.4mm_OD4.4mm_Relief","Connector_Wire/SolderWire-2.5sqmm_1x04_P8.8mm_D2.4mm_OD4.4mm_Relief2x","Connector_Wire/SolderWire-2.5sqmm_1x05_P7.2mm_D2.4mm_OD3.6mm","Connector_Wire/SolderWire-2.5sqmm_1x05_P7.2mm_D2.4mm_OD3.6mm_Relief","Connector_Wire/SolderWire-2.5sqmm_1x05_P7.2mm_D2.4mm_OD3.6mm_Relief2x","Connector_Wire/SolderWire-2.5sqmm_1x05_P8.8mm_D2.4mm_OD4.4mm","Connector_Wire/SolderWire-2.5sqmm_1x05_P8.8mm_D2.4mm_OD4.4mm_Relief","Connector_Wire/SolderWire-2.5sqmm_1x05_P8.8mm_D2.4mm_OD4.4mm_Relief2x","Connector_Wire/SolderWire-2.5sqmm_1x06_P7.2mm_D2.4mm_OD3.6mm","Connector_Wire/SolderWire-2.5sqmm_1x06_P7.2mm_D2.4mm_OD3.6mm_Relief","Connector_Wire/SolderWire-2.5sqmm_1x06_P7.2mm_D2.4mm_OD3.6mm_Relief2x","Connector_Wire/SolderWire-2.5sqmm_1x06_P8.8mm_D2.4mm_OD4.4mm","Connector_Wire/SolderWire-2.5sqmm_1x06_P8.8mm_D2.4mm_OD4.4mm_Relief","Connector_Wire/SolderWire-2.5sqmm_1x06_P8.8mm_D2.4mm_OD4.4mm_Relief2x","Connector_Wire/SolderWire-2sqmm_1x01_D2mm_OD3.9mm","Connector_Wire/SolderWire-2sqmm_1x01_D2mm_OD3.9mm_Relief","Connector_Wire/SolderWire-2sqmm_1x01_D2mm_OD3.9mm_Relief2x","Connector_Wire/SolderWire-2sqmm_1x02_P7.8mm_D2mm_OD3.9mm","Connector_Wire/SolderWire-2sqmm_1x02_P7.8mm_D2mm_OD3.9mm_Relief","Connector_Wire/SolderWire-2sqmm_1x02_P7.8mm_D2mm_OD3.9mm_Relief2x","Connector_Wire/SolderWire-2sqmm_1x03_P7.8mm_D2mm_OD3.9mm","Connector_Wire/SolderWire-2sqmm_1x03_P7.8mm_D2mm_OD3.9mm_Relief","Connector_Wire/SolderWire-2sqmm_1x03_P7.8mm_D2mm_OD3.9mm_Relief2x","Connector_Wire/SolderWire-2sqmm_1x04_P7.8mm_D2mm_OD3.9mm","Connector_Wire/SolderWire-2sqmm_1x04_P7.8mm_D2mm_OD3.9mm_Relief","Connector_Wire/SolderWire-2sqmm_1x04_P7.8mm_D2mm_OD3.9mm_Relief2x","Connector_Wire/SolderWire-2sqmm_1x05_P7.8mm_D2mm_OD3.9mm","Connector_Wire/SolderWire-2sqmm_1x05_P7.8mm_D2mm_OD3.9mm_Relief","Connector_Wire/SolderWire-2sqmm_1x05_P7.8mm_D2mm_OD3.9mm_Relief2x","Connector_Wire/SolderWire-2sqmm_1x06_P7.8mm_D2mm_OD3.9mm","Connector_Wire/SolderWire-2sqmm_1x06_P7.8mm_D2mm_OD3.9mm_Relief","Connector_Wire/SolderWire-2sqmm_1x06_P7.8mm_D2mm_OD3.9mm_Relief2x","Connector_Wire/SolderWire-4sqmm_1x01_D3mm_OD6mm","Connector_Wire/SolderWire-4sqmm_1x01_D3mm_OD6mm_Relief","Connector_Wire/SolderWire-4sqmm_1x01_D3mm_OD6mm_Relief2x","Connector_Wire/SolderWire-4sqmm_1x02_P12mm_D3mm_OD6mm","Connector_Wire/SolderWire-4sqmm_1x02_P12mm_D3mm_OD6mm_Relief","Connector_Wire/SolderWire-4sqmm_1x02_P12mm_D3mm_OD6mm_Relief2x","Connector_Wire/SolderWire-4sqmm_1x03_P12mm_D3mm_OD6mm","Connector_Wire/SolderWire-4sqmm_1x03_P12mm_D3mm_OD6mm_Relief","Connector_Wire/SolderWire-4sqmm_1x03_P12mm_D3mm_OD6mm_Relief2x","Connector_Wire/SolderWire-4sqmm_1x04_P12mm_D3mm_OD6mm","Connector_Wire/SolderWire-4sqmm_1x04_P12mm_D3mm_OD6mm_Relief","Connector_Wire/SolderWire-4sqmm_1x04_P12mm_D3mm_OD6mm_Relief2x","Connector_Wire/SolderWire-4sqmm_1x05_P12mm_D3mm_OD6mm","Connector_Wire/SolderWire-4sqmm_1x05_P12mm_D3mm_OD6mm_Relief","Connector_Wire/SolderWire-4sqmm_1x05_P12mm_D3mm_OD6mm_Relief2x","Connector_Wire/SolderWire-4sqmm_1x06_P12mm_D3mm_OD6mm","Connector_Wire/SolderWire-4sqmm_1x06_P12mm_D3mm_OD6mm_Relief","Connector_Wire/SolderWire-4sqmm_1x06_P12mm_D3mm_OD6mm_Relief2x","Connector_Wire/SolderWire-6sqmm_1x01_D3.5mm_OD7mm","Connector_Wire/SolderWire-6sqmm_1x01_D3.5mm_OD7mm_Relief","Connector_Wire/SolderWire-6sqmm_1x01_D3.5mm_OD7mm_Relief2x","Connector_Wire/SolderWire-6sqmm_1x02_P14mm_D3.5mm_OD7mm","Connector_Wire/SolderWire-6sqmm_1x02_P14mm_D3.5mm_OD7mm_Relief","Connector_Wire/SolderWire-6sqmm_1x02_P14mm_D3.5mm_OD7mm_Relief2x","Connector_Wire/SolderWire-6sqmm_1x03_P14mm_D3.5mm_OD7mm","Connector_Wire/SolderWire-6sqmm_1x03_P14mm_D3.5mm_OD7mm_Relief","Connector_Wire/SolderWire-6sqmm_1x03_P14mm_D3.5mm_OD7mm_Relief2x","Connector_Wire/SolderWire-6sqmm_1x04_P14mm_D3.5mm_OD7mm","Connector_Wire/SolderWire-6sqmm_1x04_P14mm_D3.5mm_OD7mm_Relief","Connector_Wire/SolderWire-6sqmm_1x04_P14mm_D3.5mm_OD7mm_Relief2x","Connector_Wire/SolderWire-6sqmm_1x05_P14mm_D3.5mm_OD7mm","Connector_Wire/SolderWire-6sqmm_1x05_P14mm_D3.5mm_OD7mm_Relief","Connector_Wire/SolderWire-6sqmm_1x05_P14mm_D3.5mm_OD7mm_Relief2x","Connector_Wire/SolderWire-6sqmm_1x06_P14mm_D3.5mm_OD7mm","Connector_Wire/SolderWire-6sqmm_1x06_P14mm_D3.5mm_OD7mm_Relief","Connector_Wire/SolderWire-6sqmm_1x06_P14mm_D3.5mm_OD7mm_Relief2x","Connector_Wire/SolderWirePad_1x01_SMD_1.5x3mm","Connector_Wire/SolderWirePad_1x01_SMD_1x2mm","Connector_Wire/SolderWirePad_1x01_SMD_2x4mm","Connector_Wire/SolderWirePad_1x01_SMD_3x6mm","Connector_Wire/SolderWirePad_1x01_SMD_4x8mm","Connector_Wire/SolderWirePad_1x01_SMD_5x10mm","Connector_Wuerth/Wuerth_WR-PHD_610004243021_SMD_2x02_P2.54mm_Vertical","Connector_Wuerth/Wuerth_WR-PHD_610006243021_SMD_2x03_P2.54mm_Vertical","Connector_Wuerth/Wuerth_WR-PHD_610008243021_SMD_2x04_P2.54mm_Vertical","Connector_Wuerth/Wuerth_WR-PHD_610010243021_SMD_2x05_P2.54mm_Vertical","Connector_Wuerth/Wuerth_WR-PHD_610012243021_SMD_2x06_P2.54mm_Vertical","Connector_Wuerth/Wuerth_WR-PHD_610016243021_SMD_2x08_P2.54mm_Vertical","Connector_Wuerth/Wuerth_WR-PHD_610018243021_SMD_2x09_P2.54mm_Vertical","Connector_Wuerth/Wuerth_WR-PHD_610020243021_SMD_2x10_P2.54mm_Vertical","Connector_Wuerth/Wuerth_WR-PHD_610022243021_SMD_2x11_P2.54mm_Vertical","Connector_Wuerth/Wuerth_WR-PHD_610024243021_SMD_2x12_P2.54mm_Vertical","Connector_Wuerth/Wuerth_WR-PHD_610026243021_SMD_2x13_P2.54mm_Vertical","Connector_Wuerth/Wuerth_WR-PHD_610032243021_SMD_2x16_P2.54mm_Vertical","Connector_Wuerth/Wuerth_WR-PHD_610034243021_SMD_2x17_P2.54mm_Vertical","Connector_Wuerth/Wuerth_WR-PHD_613004216921_Large_2x02_P2.54mm_Vertical","Connector_Wuerth/Wuerth_WR-PHD_61300425721_Standard_2x02_P2.54mm_Vertical","Connector_Wuerth/Wuerth_WR-PHD_613006216921_Large_2x03_P2.54mm_Vertical","Connector_Wuerth/Wuerth_WR-PHD_61300625721_Standard_2x03_P2.54mm_Vertical","Connector_Wuerth/Wuerth_WR-PHD_613008216921_Large_2x04_P2.54mm_Vertical","Connector_Wuerth/Wuerth_WR-PHD_61300825721_Standard_2x04_P2.54mm_Vertical","Connector_Wuerth/Wuerth_WR-PHD_613010216921_Large_2x05_P2.54mm_Vertical","Connector_Wuerth/Wuerth_WR-PHD_61301025721_Standard_2x05_P2.54mm_Vertical","Connector_Wuerth/Wuerth_WR-PHD_613012216921_Large_2x06_P2.54mm_Vertical","Connector_Wuerth/Wuerth_WR-PHD_61301225721_Standard_2x06_P2.54mm_Vertical","Connector_Wuerth/Wuerth_WR-PHD_613016216921_Large_2x08_P2.54mm_Vertical","Connector_Wuerth/Wuerth_WR-PHD_61301625721_Standard_2x08_P2.54mm_Vertical","Connector_Wuerth/Wuerth_WR-PHD_613018216921_Large_2x09_P2.54mm_Vertical","Connector_Wuerth/Wuerth_WR-PHD_613020216921_Large_2x10_P2.54mm_Vertical","Connector_Wuerth/Wuerth_WR-PHD_61302025721_Standard_2x10_P2.54mm_Vertical","Connector_Wuerth/Wuerth_WR-PHD_613022216921_Large_2x11_P2.54mm_Vertical","Connector_Wuerth/Wuerth_WR-PHD_613024216921_Large_2x12_P2.54mm_Vertical","Connector_Wuerth/Wuerth_WR-PHD_61302425721_Standard_2x12_P2.54mm_Vertical","Connector_Wuerth/Wuerth_WR-PHD_613026216921_Large_2x13_P2.54mm_Vertical","Connector_Wuerth/Wuerth_WR-PHD_61302625721_Standard_2x13_P2.54mm_Vertical","Connector_Wuerth/Wuerth_WR-PHD_613032216921_Large_2x16_P2.54mm_Vertical","Connector_Wuerth/Wuerth_WR-PHD_61303225721_Standard_2x16_P2.54mm_Vertical","Connector_Wuerth/Wuerth_WR-PHD_613034216921_Large_2x17_P2.54mm_Vertical","Connector_Wuerth/Wuerth_WR-PHD_61303425721_Standard_2x17_P2.54mm_Vertical","Connector_Wuerth/Wuerth_WR-WTB_64800211622_1x02_P1.50mm_Vertical","Connector_Wuerth/Wuerth_WR-WTB_64800311622_1x03_P1.50mm_Vertical","Connector_Wuerth/Wuerth_WR-WTB_64800411622_1x04_P1.50mm_Vertical","Connector_Wuerth/Wuerth_WR-WTB_64800511622_1x05_P1.50mm_Vertical","Connector_Wuerth/Wuerth_WR-WTB_64800611622_1x06_P1.50mm_Vertical","Connector_Wuerth/Wuerth_WR-WTB_64800711622_1x07_P1.50mm_Vertical","Connector_Wuerth/Wuerth_WR-WTB_64800811622_1x08_P1.50mm_Vertical","Connector_Wuerth/Wuerth_WR-WTB_64800911622_1x09_P1.50mm_Vertical","Connector_Wuerth/Wuerth_WR-WTB_64801011622_1x10_P1.50mm_Vertical","Connector_Zhaoxing/Zhaoxing_VH_ZX-VH3.96-10PLT_1x10-1MP_P3.96mm_Vertical","Connector_Zhaoxing/Zhaoxing_VH_ZX-VH3.96-2PLT_1x02-1MP_P3.96mm_Vertical","Connector_Zhaoxing/Zhaoxing_VH_ZX-VH3.96-3PLT_1x03-1MP_P3.96mm_Vertical","Connector_Zhaoxing/Zhaoxing_VH_ZX-VH3.96-4PLT_1x04-1MP_P3.96mm_Vertical","Connector_Zhaoxing/Zhaoxing_VH_ZX-VH3.96-5PLT_1x05-1MP_P3.96mm_Vertical","Connector_Zhaoxing/Zhaoxing_VH_ZX-VH3.96-6PLT_1x06-1MP_P3.96mm_Vertical","Connector_Zhaoxing/Zhaoxing_VH_ZX-VH3.96-7PLT_1x07-1MP_P3.96mm_Vertical","Connector_Zhaoxing/Zhaoxing_VH_ZX-VH3.96-8PLT_1x08-1MP_P3.96mm_Vertical","Connector_Zhaoxing/Zhaoxing_VH_ZX-VH3.96-9PLT_1x09-1MP_P3.96mm_Vertical","Converter_ACDC/Converter_ACDC_CUI_PBO-3-Sxx_THT_Vertical","Converter_ACDC/Converter_ACDC_Hahn_HS-400xx_THT","Converter_ACDC/Converter_ACDC_Hi-Link_HLK-10Mxx","Converter_ACDC/Converter_ACDC_Hi-Link_HLK-12MxxA","Converter_ACDC/Converter_ACDC_Hi-Link_HLK-20Mxx","Converter_ACDC/Converter_ACDC_Hi-Link_HLK-2Mxx","Converter_ACDC/Converter_ACDC_Hi-Link_HLK-30Mxx","Converter_ACDC/Converter_ACDC_Hi-Link_HLK-5Mxx","Converter_ACDC/Converter_ACDC_Hi-Link_HLK-PMxx","Converter_ACDC/Converter_ACDC_MeanWell_IRM-02-xx_SMD","Converter_ACDC/Converter_ACDC_MeanWell_IRM-02-xx_THT","Converter_ACDC/Converter_ACDC_MeanWell_IRM-03-xx_SMD","Converter_ACDC/Converter_ACDC_MeanWell_IRM-03-xx_THT","Converter_ACDC/Converter_ACDC_MeanWell_IRM-05-xx_THT","Converter_ACDC/Converter_ACDC_MeanWell_IRM-10-xx_THT","Converter_ACDC/Converter_ACDC_MeanWell_IRM-20-xx_THT","Converter_ACDC/Converter_ACDC_MeanWell_IRM-60-xx_THT","Converter_ACDC/Converter_ACDC_MeanWell_MFM-10-xx_THT","Converter_ACDC/Converter_ACDC_MeanWell_MFM-15-xx_THT","Converter_ACDC/Converter_ACDC_Murata_BAC05SxxDC_THT","Converter_ACDC/Converter_ACDC_RECOM_RAC01-xxSGB_THT","Converter_ACDC/Converter_ACDC_RECOM_RAC04-xxSGx_THT","Converter_ACDC/Converter_ACDC_RECOM_RAC05-xxSK_THT","Converter_ACDC/Converter_ACDC_Recom_RAC20-xxDK_THT","Converter_ACDC/Converter_ACDC_Recom_RAC20-xxSK_THT","Converter_ACDC/Converter_ACDC_TRACO_TMF_051xx_THT","Converter_ACDC/Converter_ACDC_TRACO_TMF_101xx_THT","Converter_ACDC/Converter_ACDC_TRACO_TMF_201xx_THT","Converter_ACDC/Converter_ACDC_TRACO_TMF_301xx_THT","Converter_ACDC/Converter_ACDC_TRACO_TMG_071xx_THT","Converter_ACDC/Converter_ACDC_TRACO_TMG_151xx_THT","Converter_ACDC/Converter_ACDC_TRACO_TMLM-04_THT","Converter_ACDC/Converter_ACDC_TRACO_TMLM-05_THT","Converter_ACDC/Converter_ACDC_TRACO_TMLM-10-20_THT","Converter_ACDC/Converter_ACDC_TRACO_TMPW10_1xx_THT","Converter_ACDC/Converter_ACDC_TRACO_TMPW25_1xx_THT","Converter_ACDC/Converter_ACDC_TRACO_TMPW5-1xx_THT","Converter_ACDC/Converter_ACDC_TRACO_TPP-15-1xx-D_THT","Converter_ACDC/Converter_ACDC_Vigortronix_VTX-214-010-1xx_THT","Converter_ACDC/Converter_ACDC_Vigortronix_VTX-214-010-2xx_THT","Converter_ACDC/Converter_ACDC_Vigortronix_VTX-214-015-1xx_THT","Converter_ACDC/Converter_ACDC_ZETTLER_ZPI03Sxx00WC_THT","Converter_DCDC/Converter_DCDC_Artesyn_ATA_SMD","Converter_DCDC/Converter_DCDC_Bothhand_CFUDxxxx_THT","Converter_DCDC/Converter_DCDC_Bothhand_CFUSxxxxEH_THT","Converter_DCDC/Converter_DCDC_Bothhand_CFUSxxxx_THT","Converter_DCDC/Converter_DCDC_Cincon_EC5BExx_Dual_THT","Converter_DCDC/Converter_DCDC_Cincon_EC5BExx_Single_THT","Converter_DCDC/Converter_DCDC_Cincon_EC6Cxx_Dual-Triple_THT","Converter_DCDC/Converter_DCDC_Cincon_EC6Cxx_Single_THT","Converter_DCDC/Converter_DCDC_Cyntec_MUN12AD01-SH","Converter_DCDC/Converter_DCDC_Cyntec_MUN12AD03-SH","Converter_DCDC/Converter_DCDC_Hamamatsu_C11204-1_THT","Converter_DCDC/Converter_DCDC_MeanWell_NID30_THT","Converter_DCDC/Converter_DCDC_MeanWell_NID60_THT","Converter_DCDC/Converter_DCDC_MeanWell_NSD10_THT","Converter_DCDC/Converter_DCDC_Murata_CRE1xxxxxx3C_THT","Converter_DCDC/Converter_DCDC_Murata_CRE1xxxxxxDC_THT","Converter_DCDC/Converter_DCDC_Murata_CRE1xxxxxxSC_THT","Converter_DCDC/Converter_DCDC_Murata_MEE1SxxxxSC_THT","Converter_DCDC/Converter_DCDC_Murata_MEE3SxxxxSC_THT","Converter_DCDC/Converter_DCDC_Murata_MGJ2DxxxxxxSC_THT","Converter_DCDC/Converter_DCDC_Murata_MGJ3","Converter_DCDC/Converter_DCDC_Murata_MYRxP","Converter_DCDC/Converter_DCDC_Murata_NCS1SxxxxSC_THT","Converter_DCDC/Converter_DCDC_Murata_NMAxxxxDC_THT","Converter_DCDC/Converter_DCDC_Murata_NMAxxxxSC_THT","Converter_DCDC/Converter_DCDC_Murata_NXExSxxxxMC_SMD","Converter_DCDC/Converter_DCDC_Murata_OKI-78SR_Horizontal","Converter_DCDC/Converter_DCDC_Murata_OKI-78SR_Vertical","Converter_DCDC/Converter_DCDC_RECOM_R-78B-2.0_THT","Converter_DCDC/Converter_DCDC_RECOM_R-78E-0.5_THT","Converter_DCDC/Converter_DCDC_RECOM_R-78HB-0.5L_THT","Converter_DCDC/Converter_DCDC_RECOM_R-78HB-0.5_THT","Converter_DCDC/Converter_DCDC_RECOM_R-78S-0.1_THT","Converter_DCDC/Converter_DCDC_RECOM_R5xxxDA_THT","Converter_DCDC/Converter_DCDC_RECOM_R5xxxPA_THT","Converter_DCDC/Converter_DCDC_RECOM_RCD-24_THT","Converter_DCDC/Converter_DCDC_RECOM_RPA60-xxxxSFW","Converter_DCDC/Converter_DCDC_RECOM_RPMx.x-x.0","Converter_DCDC/Converter_DCDC_Silvertel_Ag54xx","Converter_DCDC/Converter_DCDC_Silvertel_Ag5810","Converter_DCDC/Converter_DCDC_Silvertel_Ag99xxLP_THT","Converter_DCDC/Converter_DCDC_TRACO_TBA1-xxxxE_Dual_THT","Converter_DCDC/Converter_DCDC_TRACO_TBA1-xxxxE_Single_THT","Converter_DCDC/Converter_DCDC_TRACO_TBA1-xxxx_THT","Converter_DCDC/Converter_DCDC_TRACO_TBA2-xxxx_Dual_THT","Converter_DCDC/Converter_DCDC_TRACO_TBA2-xxxx_Single_THT","Converter_DCDC/Converter_DCDC_TRACO_TDN_5-xxxxWISM_SMD","Converter_DCDC/Converter_DCDC_TRACO_TDN_5-xxxxWI_THT","Converter_DCDC/Converter_DCDC_TRACO_TDU1-xxxx_THT","Converter_DCDC/Converter_DCDC_TRACO_TEA1-xxxxE_THT","Converter_DCDC/Converter_DCDC_TRACO_TEA1-xxxxHI_THT","Converter_DCDC/Converter_DCDC_TRACO_TEA1-xxxx_THT","Converter_DCDC/Converter_DCDC_TRACO_TEC2-12xxWI_24xxWI_48xxWI_THT","Converter_DCDC/Converter_DCDC_TRACO_TEC3-24xxUI_THT","Converter_DCDC/Converter_DCDC_TRACO_TEL12-xxxx_THT","Converter_DCDC/Converter_DCDC_TRACO_TEN10-110xxWIRH_THT","Converter_DCDC/Converter_DCDC_TRACO_TEN10-xxxx_Dual_THT","Converter_DCDC/Converter_DCDC_TRACO_TEN10-xxxx_Single_THT","Converter_DCDC/Converter_DCDC_TRACO_TEN10-xxxx_THT","Converter_DCDC/Converter_DCDC_TRACO_TEN20-110xxWIRH_THT","Converter_DCDC/Converter_DCDC_TRACO_TEN20-xxxx-N4_THT","Converter_DCDC/Converter_DCDC_TRACO_TEN20-xxxx_THT","Converter_DCDC/Converter_DCDC_TRACO_TEN30-xxxxUIR_THT","Converter_DCDC/Converter_DCDC_TRACO_TEN40-110xxWIRH_THT","Converter_DCDC/Converter_DCDC_TRACO_TEP150-721xUIR_THT","Converter_DCDC/Converter_DCDC_TRACO_TES1-051x_121x_241x_Single_SMD","Converter_DCDC/Converter_DCDC_TRACO_TES1-052x_122x_242x_Dual_SMD","Converter_DCDC/Converter_DCDC_TRACO_THB10-xxxx_Dual_THT","Converter_DCDC/Converter_DCDC_TRACO_THB10-xxxx_Single_THT","Converter_DCDC/Converter_DCDC_TRACO_THD_15-xxxxWIN_THT","Converter_DCDC/Converter_DCDC_TRACO_THL30-xxxxWI_THT","Converter_DCDC/Converter_DCDC_TRACO_THL40-xxxxWI_THT","Converter_DCDC/Converter_DCDC_TRACO_THN10-xxxxUIR_THT","Converter_DCDC/Converter_DCDC_TRACO_THN30-xxxx_THT","Converter_DCDC/Converter_DCDC_TRACO_THR40-72xxWI_THT","Converter_DCDC/Converter_DCDC_TRACO_TMA-05xxD_12xxD_Dual_THT","Converter_DCDC/Converter_DCDC_TRACO_TMA-05xxS_12xxS_Single_THT","Converter_DCDC/Converter_DCDC_TRACO_TMA-15xxD_24xxD_Dual_THT","Converter_DCDC/Converter_DCDC_TRACO_TMA-15xxS_24xxS_Single_THT","Converter_DCDC/Converter_DCDC_TRACO_TME_03xxS_05xxS_12xxS_Single_THT","Converter_DCDC/Converter_DCDC_TRACO_TME_24xxS_Single_THT","Converter_DCDC/Converter_DCDC_TRACO_TMR-1-xxxx_Dual_THT","Converter_DCDC/Converter_DCDC_TRACO_TMR-1-xxxx_Single_THT","Converter_DCDC/Converter_DCDC_TRACO_TMR-1SM_SMD","Converter_DCDC/Converter_DCDC_TRACO_TMR10-24xxWIR_48xxWIR_72xxWIR_THT","Converter_DCDC/Converter_DCDC_TRACO_TMR2-xxxxWI_THT","Converter_DCDC/Converter_DCDC_TRACO_TMR4-xxxxWI_THT","Converter_DCDC/Converter_DCDC_TRACO_TMU3-05xx_12xx_THT","Converter_DCDC/Converter_DCDC_TRACO_TMU3-24xx_THT","Converter_DCDC/Converter_DCDC_TRACO_TMV-051xD_121xD_Dual_THT","Converter_DCDC/Converter_DCDC_TRACO_TMV-051xS_121xS_Single_THT","Converter_DCDC/Converter_DCDC_TRACO_TMV-241xD_Dual_THT","Converter_DCDC/Converter_DCDC_TRACO_TMV-241xS_Single_THT","Converter_DCDC/Converter_DCDC_TRACO_TOS06-05SIL_THT","Converter_DCDC/Converter_DCDC_TRACO_TOS06-12SIL_THT","Converter_DCDC/Converter_DCDC_TRACO_TRA3-xxxx_THT","Converter_DCDC/Converter_DCDC_TRACO_TRI1-xxxxSM_SMD","Converter_DCDC/Converter_DCDC_TRACO_TRI1-xxxx_THT","Converter_DCDC/Converter_DCDC_TRACO_TRI10_Dual_THT","Converter_DCDC/Converter_DCDC_TRACO_TRI10_Single_THT","Converter_DCDC/Converter_DCDC_TRACO_TRN3-xx1x_Single_THT","Converter_DCDC/Converter_DCDC_TRACO_TRN3-xx2x_Dual_THT","Converter_DCDC/Converter_DCDC_TRACO_TSR-1_THT","Converter_DCDC/Converter_DCDC_TRACO_TSR0.5-24xxSM_241xxSM_SMD","Converter_DCDC/Converter_DCDC_TRACO_TSR0.5-24xx_TSR0.5-24xxx_THT","Converter_DCDC/Converter_DCDC_TRACO_TSR0.6-48xxWI_TSR0.6-48xxxWI_THT","Converter_DCDC/Converter_DCDC_TRACO_TSR1-xxxxE_THT","Converter_DCDC/Converter_DCDC_TRACO_TSR1.5-24xxE_24120E_THT","Converter_DCDC/Converter_DCDC_TRACO_TSR2-24xxN_TSR2-24xxxN_THT","Converter_DCDC/Converter_DCDC_TRACO_TSR2-xxxx_THT","Converter_DCDC/Converter_DCDC_XP_POWER-IA48xxD_THT","Converter_DCDC/Converter_DCDC_XP_POWER-IA48xxS_THT","Converter_DCDC/Converter_DCDC_XP_POWER-IAxxxxD_THT","Converter_DCDC/Converter_DCDC_XP_POWER-IAxxxxS_THT","Converter_DCDC/Converter_DCDC_XP_POWER-IHxxxxDH_THT","Converter_DCDC/Converter_DCDC_XP_POWER-IHxxxxD_THT","Converter_DCDC/Converter_DCDC_XP_POWER-IHxxxxSH_THT","Converter_DCDC/Converter_DCDC_XP_POWER-IHxxxxS_THT","Converter_DCDC/Converter_DCDC_XP_POWER-ISU02_SMD","Converter_DCDC/Converter_DCDC_XP_POWER-ITQxxxxS-H_THT","Converter_DCDC/Converter_DCDC_XP_POWER-ITXxxxxSA_THT","Converter_DCDC/Converter_DCDC_XP_POWER-ITxxxxxS_THT","Converter_DCDC/Converter_DCDC_XP_POWER_JTDxxxxxxx_THT","Converter_DCDC/Converter_DCDC_XP_POWER_JTExxxxDxx_THT","Converter_DCDC/Converter_DCDC_muRata_MEJ1DxxxxSC_THT","Converter_DCDC/Converter_DCDC_muRata_MEJ1SxxxxSC_THT","Crystal/Crystal_AT310_D3.0mm_L10.0mm_Horizontal","Crystal/Crystal_AT310_D3.0mm_L10.0mm_Horizontal_1EP_style1","Crystal/Crystal_AT310_D3.0mm_L10.0mm_Horizontal_1EP_style2","Crystal/Crystal_AT310_D3.0mm_L10.0mm_Vertical","Crystal/Crystal_C26-LF_D2.1mm_L6.5mm_Horizontal","Crystal/Crystal_C26-LF_D2.1mm_L6.5mm_Horizontal_1EP_style1","Crystal/Crystal_C26-LF_D2.1mm_L6.5mm_Horizontal_1EP_style2","Crystal/Crystal_C26-LF_D2.1mm_L6.5mm_Vertical","Crystal/Crystal_C38-LF_D3.0mm_L8.0mm_Horizontal","Crystal/Crystal_C38-LF_D3.0mm_L8.0mm_Horizontal_1EP_style1","Crystal/Crystal_C38-LF_D3.0mm_L8.0mm_Horizontal_1EP_style2","Crystal/Crystal_C38-LF_D3.0mm_L8.0mm_Vertical","Crystal/Crystal_DS10_D1.0mm_L4.3mm_Horizontal","Crystal/Crystal_DS10_D1.0mm_L4.3mm_Horizontal_1EP_style1","Crystal/Crystal_DS10_D1.0mm_L4.3mm_Horizontal_1EP_style2","Crystal/Crystal_DS10_D1.0mm_L4.3mm_Vertical","Crystal/Crystal_DS15_D1.5mm_L5.0mm_Horizontal","Crystal/Crystal_DS15_D1.5mm_L5.0mm_Horizontal_1EP_style1","Crystal/Crystal_DS15_D1.5mm_L5.0mm_Horizontal_1EP_style2","Crystal/Crystal_DS15_D1.5mm_L5.0mm_Vertical","Crystal/Crystal_DS26_D2.0mm_L6.0mm_Horizontal","Crystal/Crystal_DS26_D2.0mm_L6.0mm_Horizontal_1EP_style1","Crystal/Crystal_DS26_D2.0mm_L6.0mm_Horizontal_1EP_style2","Crystal/Crystal_DS26_D2.0mm_L6.0mm_Vertical","Crystal/Crystal_HC18-U_Horizontal","Crystal/Crystal_HC18-U_Horizontal_1EP_style1","Crystal/Crystal_HC18-U_Horizontal_1EP_style2","Crystal/Crystal_HC18-U_Vertical","Crystal/Crystal_HC33-U_Horizontal","Crystal/Crystal_HC33-U_Horizontal_1EP_style1","Crystal/Crystal_HC33-U_Horizontal_1EP_style2","Crystal/Crystal_HC33-U_Vertical","Crystal/Crystal_HC35-U","Crystal/Crystal_HC49-4H_Vertical","Crystal/Crystal_HC49-U-3Pin_Vertical","Crystal/Crystal_HC49-U_Horizontal","Crystal/Crystal_HC49-U_Horizontal_1EP_style1","Crystal/Crystal_HC49-U_Horizontal_1EP_style2","Crystal/Crystal_HC49-U_Vertical","Crystal/Crystal_HC50_Horizontal","Crystal/Crystal_HC50_Horizontal_1EP_style1","Crystal/Crystal_HC50_Horizontal_1EP_style2","Crystal/Crystal_HC50_Vertical","Crystal/Crystal_HC51-U_Vertical","Crystal/Crystal_HC51_Horizontal","Crystal/Crystal_HC51_Horizontal_1EP_style1","Crystal/Crystal_HC51_Horizontal_1EP_style2","Crystal/Crystal_HC52-6mm_Horizontal","Crystal/Crystal_HC52-6mm_Horizontal_1EP_style1","Crystal/Crystal_HC52-6mm_Horizontal_1EP_style2","Crystal/Crystal_HC52-6mm_Vertical","Crystal/Crystal_HC52-8mm_Horizontal","Crystal/Crystal_HC52-8mm_Horizontal_1EP_style1","Crystal/Crystal_HC52-8mm_Horizontal_1EP_style2","Crystal/Crystal_HC52-8mm_Vertical","Crystal/Crystal_HC52-U-3Pin_Vertical","Crystal/Crystal_HC52-U_Horizontal","Crystal/Crystal_HC52-U_Horizontal_1EP_style1","Crystal/Crystal_HC52-U_Horizontal_1EP_style2","Crystal/Crystal_HC52-U_Vertical","Crystal/Crystal_Round_D1.0mm_Vertical","Crystal/Crystal_Round_D1.5mm_Vertical","Crystal/Crystal_Round_D2.0mm_Vertical","Crystal/Crystal_Round_D3.0mm_Vertical","Crystal/Crystal_SMD_0603-2Pin_6.0x3.5mm","Crystal/Crystal_SMD_0603-2Pin_6.0x3.5mm_HandSoldering","Crystal/Crystal_SMD_0603-4Pin_6.0x3.5mm","Crystal/Crystal_SMD_0603-4Pin_6.0x3.5mm_HandSoldering","Crystal/Crystal_SMD_1210-4Pin_1.2x1.0mm","Crystal/Crystal_SMD_1210-4Pin_1.2x1.0mm_RotB","Crystal/Crystal_SMD_2012-2Pin_2.0x1.2mm","Crystal/Crystal_SMD_2012-2Pin_2.0x1.2mm_HandSoldering","Crystal/Crystal_SMD_2016-4Pin_2.0x1.6mm","Crystal/Crystal_SMD_2520-4Pin_2.5x2.0mm","Crystal/Crystal_SMD_3215-2Pin_3.2x1.5mm","Crystal/Crystal_SMD_3225-4Pin_3.2x2.5mm","Crystal/Crystal_SMD_3225-4Pin_3.2x2.5mm_HandSoldering","Crystal/Crystal_SMD_5032-2Pin_5.0x3.2mm","Crystal/Crystal_SMD_5032-2Pin_5.0x3.2mm_HandSoldering","Crystal/Crystal_SMD_5032-4Pin_5.0x3.2mm","Crystal/Crystal_SMD_7050-2Pin_7.0x5.0mm","Crystal/Crystal_SMD_7050-2Pin_7.0x5.0mm_HandSoldering","Crystal/Crystal_SMD_7050-4Pin_7.0x5.0mm","Crystal/Crystal_SMD_Abracon_ABM10-4Pin_2.5x2.0mm","Crystal/Crystal_SMD_Abracon_ABM3-2Pin_5.0x3.2mm","Crystal/Crystal_SMD_Abracon_ABM3-2Pin_5.0x3.2mm_HandSoldering","Crystal/Crystal_SMD_Abracon_ABM3B-4Pin_5.0x3.2mm","Crystal/Crystal_SMD_Abracon_ABM3C-4Pin_5.0x3.2mm","Crystal/Crystal_SMD_Abracon_ABM7-2Pin_6.0x3.5mm","Crystal/Crystal_SMD_Abracon_ABM8AIG-4Pin_3.2x2.5mm","Crystal/Crystal_SMD_Abracon_ABM8G-4Pin_3.2x2.5mm","Crystal/Crystal_SMD_Abracon_ABS25-4Pin_8.0x3.8mm","Crystal/Crystal_SMD_Citizen_CS325S-4Pin_3.2x2.5mm","Crystal/Crystal_SMD_ECS_CSM3X-2Pin_7.6x4.1mm","Crystal/Crystal_SMD_EuroQuartz_EQ161-2Pin_3.2x1.5mm","Crystal/Crystal_SMD_EuroQuartz_EQ161-2Pin_3.2x1.5mm_HandSoldering","Crystal/Crystal_SMD_EuroQuartz_MJ-4Pin_5.0x3.2mm","Crystal/Crystal_SMD_EuroQuartz_MJ-4Pin_5.0x3.2mm_HandSoldering","Crystal/Crystal_SMD_EuroQuartz_MQ-4Pin_7.0x5.0mm","Crystal/Crystal_SMD_EuroQuartz_MQ-4Pin_7.0x5.0mm_HandSoldering","Crystal/Crystal_SMD_EuroQuartz_MQ2-2Pin_7.0x5.0mm","Crystal/Crystal_SMD_EuroQuartz_MQ2-2Pin_7.0x5.0mm_HandSoldering","Crystal/Crystal_SMD_EuroQuartz_MT-4Pin_3.2x2.5mm","Crystal/Crystal_SMD_EuroQuartz_MT-4Pin_3.2x2.5mm_HandSoldering","Crystal/Crystal_SMD_EuroQuartz_X22-4Pin_2.5x2.0mm","Crystal/Crystal_SMD_EuroQuartz_X22-4Pin_2.5x2.0mm_HandSoldering","Crystal/Crystal_SMD_FOX_FE-2Pin_7.5x5.0mm","Crystal/Crystal_SMD_FOX_FE-2Pin_7.5x5.0mm_HandSoldering","Crystal/Crystal_SMD_FOX_FQ7050-2Pin_7.0x5.0mm","Crystal/Crystal_SMD_FOX_FQ7050-2Pin_7.0x5.0mm_HandSoldering","Crystal/Crystal_SMD_FOX_FQ7050-4Pin_7.0x5.0mm","Crystal/Crystal_SMD_FrontierElectronics_FM206","Crystal/Crystal_SMD_G8-2Pin_3.2x1.5mm","Crystal/Crystal_SMD_G8-2Pin_3.2x1.5mm_HandSoldering","Crystal/Crystal_SMD_HC49-SD","Crystal/Crystal_SMD_HC49-SD_HandSoldering","Crystal/Crystal_SMD_MicroCrystal_CC1V-T1A-2Pin_8.0x3.7mm","Crystal/Crystal_SMD_MicroCrystal_CC1V-T1A-2Pin_8.0x3.7mm_HandSoldering","Crystal/Crystal_SMD_MicroCrystal_CC4V-T1A-2Pin_5.0x1.9mm","Crystal/Crystal_SMD_MicroCrystal_CC4V-T1A-2Pin_5.0x1.9mm_HandSoldering","Crystal/Crystal_SMD_MicroCrystal_CC5V-T1A-2Pin_4.1x1.5mm","Crystal/Crystal_SMD_MicroCrystal_CC5V-T1A-2Pin_4.1x1.5mm_HandSoldering","Crystal/Crystal_SMD_MicroCrystal_CC7V-T1A-2Pin_3.2x1.5mm","Crystal/Crystal_SMD_MicroCrystal_CC7V-T1A-2Pin_3.2x1.5mm_HandSoldering","Crystal/Crystal_SMD_MicroCrystal_CC8V-T1A-2Pin_2.0x1.2mm","Crystal/Crystal_SMD_MicroCrystal_CC8V-T1A-2Pin_2.0x1.2mm_HandSoldering","Crystal/Crystal_SMD_MicroCrystal_CM9V-T1A-2Pin_1.6x1.0mm","Crystal/Crystal_SMD_MicroCrystal_CM9V-T1A-2Pin_1.6x1.0mm_HandSoldering","Crystal/Crystal_SMD_MicroCrystal_MS1V-T1K","Crystal/Crystal_SMD_MicroCrystal_MS3V-T1R","Crystal/Crystal_SMD_Qantek_QC5CB-2Pin_5x3.2mm","Crystal/Crystal_SMD_SeikoEpson_FA128-4Pin_2.0x1.6mm","Crystal/Crystal_SMD_SeikoEpson_FA238-4Pin_3.2x2.5mm","Crystal/Crystal_SMD_SeikoEpson_FA238-4Pin_3.2x2.5mm_HandSoldering","Crystal/Crystal_SMD_SeikoEpson_FA238V-4Pin_3.2x2.5mm","Crystal/Crystal_SMD_SeikoEpson_FA238V-4Pin_3.2x2.5mm_HandSoldering","Crystal/Crystal_SMD_SeikoEpson_MA406-4Pin_11.7x4.0mm","Crystal/Crystal_SMD_SeikoEpson_MA406-4Pin_11.7x4.0mm_HandSoldering","Crystal/Crystal_SMD_SeikoEpson_MA505-2Pin_12.7x5.1mm","Crystal/Crystal_SMD_SeikoEpson_MA505-2Pin_12.7x5.1mm_HandSoldering","Crystal/Crystal_SMD_SeikoEpson_MA506-4Pin_12.7x5.1mm","Crystal/Crystal_SMD_SeikoEpson_MA506-4Pin_12.7x5.1mm_HandSoldering","Crystal/Crystal_SMD_SeikoEpson_MC146-4Pin_6.7x1.5mm","Crystal/Crystal_SMD_SeikoEpson_MC146-4Pin_6.7x1.5mm_HandSoldering","Crystal/Crystal_SMD_SeikoEpson_MC156-4Pin_7.1x2.5mm","Crystal/Crystal_SMD_SeikoEpson_MC156-4Pin_7.1x2.5mm_HandSoldering","Crystal/Crystal_SMD_SeikoEpson_MC306-4Pin_8.0x3.2mm","Crystal/Crystal_SMD_SeikoEpson_MC306-4Pin_8.0x3.2mm_HandSoldering","Crystal/Crystal_SMD_SeikoEpson_MC405-2Pin_9.6x4.1mm","Crystal/Crystal_SMD_SeikoEpson_MC405-2Pin_9.6x4.1mm_HandSoldering","Crystal/Crystal_SMD_SeikoEpson_MC406-4Pin_9.6x4.1mm","Crystal/Crystal_SMD_SeikoEpson_MC406-4Pin_9.6x4.1mm_HandSoldering","Crystal/Crystal_SMD_SeikoEpson_TSX3225-4Pin_3.2x2.5mm","Crystal/Crystal_SMD_SeikoEpson_TSX3225-4Pin_3.2x2.5mm_HandSoldering","Crystal/Crystal_SMD_TXC_7A-2Pin_5x3.2mm","Crystal/Crystal_SMD_TXC_7M-4Pin_3.2x2.5mm","Crystal/Crystal_SMD_TXC_7M-4Pin_3.2x2.5mm_HandSoldering","Crystal/Crystal_SMD_TXC_9HT11-2Pin_2.0x1.2mm","Crystal/Crystal_SMD_TXC_9HT11-2Pin_2.0x1.2mm_HandSoldering","Crystal/Crystal_SMD_TXC_AX_8045-2Pin_8.0x4.5mm","Crystal/Crystal_SMD_WE_12SMX-4Pin_7.0x5.0mm","Crystal/Crystal_SMD_WE_CFPX-104-4Pin_5.0x3.2mm","Crystal/Crystal_SMD_WE_CFPX-180-4Pin_3.2x2.5mm","Crystal/Crystal_SMD_WE_CFPX-218-4Pin_2.5x2.0mm","Crystal/Crystal_SMD_WE_IQXC-240-4Pin_1.2x1.0mm","Crystal/Crystal_SMD_WE_IQXC-26-4Pin_1.6x1.2mm","Crystal/Crystal_SMD_WE_IQXC-42-4Pin_2.0x1.6mm","Crystal/Resonator-2Pin_W10.0mm_H5.0mm","Crystal/Resonator-2Pin_W6.0mm_H3.0mm","Crystal/Resonator-2Pin_W7.0mm_H2.5mm","Crystal/Resonator-2Pin_W8.0mm_H3.5mm","Crystal/Resonator-3Pin_W10.0mm_H5.0mm","Crystal/Resonator-3Pin_W6.0mm_H3.0mm","Crystal/Resonator-3Pin_W7.0mm_H2.5mm","Crystal/Resonator-3Pin_W8.0mm_H3.5mm","Crystal/Resonator_Murata_CSTLSxxxG-3Pin_W8.0mm_H3.0mm","Crystal/Resonator_Murata_CSTLSxxxX-3Pin_W5.5mm_H3.0mm","Crystal/Resonator_Murata_DSN6-3Pin_W7.0mm_H2.5mm","Crystal/Resonator_Murata_DSS6-3Pin_W7.0mm_H2.5mm","Crystal/Resonator_SMD-3Pin_7.2x3.0mm","Crystal/Resonator_SMD-3Pin_7.2x3.0mm_HandSoldering","Crystal/Resonator_SMD_Murata_CDSCB-2Pin_4.5x2.0mm","Crystal/Resonator_SMD_Murata_CDSCB-2Pin_4.5x2.0mm_HandSoldering","Crystal/Resonator_SMD_Murata_CSTCR_4.5x2x1.15mm","Crystal/Resonator_SMD_Murata_CSTxExxV-3Pin_3.0x1.1mm","Crystal/Resonator_SMD_Murata_CSTxExxV-3Pin_3.0x1.1mm_HandSoldering","Crystal/Resonator_SMD_Murata_SFECV-3Pin_6.9x2.9mm","Crystal/Resonator_SMD_Murata_SFECV-3Pin_6.9x2.9mm_HandSoldering","Crystal/Resonator_SMD_Murata_SFSKA-3Pin_7.9x3.8mm","Crystal/Resonator_SMD_Murata_SFSKA-3Pin_7.9x3.8mm_HandSoldering","Crystal/Resonator_SMD_Murata_TPSKA-3Pin_7.9x3.8mm","Crystal/Resonator_SMD_Murata_TPSKA-3Pin_7.9x3.8mm_HandSoldering","Diode_SMD/D_01005_0402Metric","Diode_SMD/D_01005_0402Metric_Pad0.57x0.30mm_HandSolder","Diode_SMD/D_0201_0603Metric","Diode_SMD/D_0201_0603Metric_Pad0.64x0.40mm_HandSolder","Diode_SMD/D_0402_1005Metric","Diode_SMD/D_0402_1005Metric_Pad0.77x0.64mm_HandSolder","Diode_SMD/D_0603_1608Metric","Diode_SMD/D_0603_1608Metric_Pad1.05x0.95mm_HandSolder","Diode_SMD/D_0805_2012Metric","Diode_SMD/D_0805_2012Metric_Pad1.15x1.40mm_HandSolder","Diode_SMD/D_1206_3216Metric","Diode_SMD/D_1206_3216Metric_Pad1.42x1.75mm_HandSolder","Diode_SMD/D_1210_3225Metric","Diode_SMD/D_1210_3225Metric_Pad1.42x2.65mm_HandSolder","Diode_SMD/D_1812_4532Metric","Diode_SMD/D_1812_4532Metric_Pad1.30x3.40mm_HandSolder","Diode_SMD/D_2010_5025Metric","Diode_SMD/D_2010_5025Metric_Pad1.52x2.65mm_HandSolder","Diode_SMD/D_2114_3652Metric","Diode_SMD/D_2114_3652Metric_Pad1.85x3.75mm_HandSolder","Diode_SMD/D_2512_6332Metric","Diode_SMD/D_2512_6332Metric_Pad1.52x3.35mm_HandSolder","Diode_SMD/D_3220_8050Metric","Diode_SMD/D_3220_8050Metric_Pad2.65x5.15mm_HandSolder","Diode_SMD/D_MELF-RM10_Universal_Handsoldering","Diode_SMD/D_MELF","Diode_SMD/D_MELF_Handsoldering","Diode_SMD/D_MicroMELF","Diode_SMD/D_MicroMELF_Handsoldering","Diode_SMD/D_MicroSMP_LargeAnode","Diode_SMD/D_MicroSMP_LargeCathode","Diode_SMD/D_MiniMELF","Diode_SMD/D_MiniMELF_Handsoldering","Diode_SMD/D_PowerDI-123","Diode_SMD/D_PowerDI-5","Diode_SMD/D_Powermite2_LargeAnode","Diode_SMD/D_Powermite2_LargeCathode","Diode_SMD/D_Powermite3","Diode_SMD/D_Powermite_LargeAnode","Diode_SMD/D_Powermite_LargeCathode","Diode_SMD/D_QFN_3.3x3.3mm_P0.65mm","Diode_SMD/D_SC-80","Diode_SMD/D_SC-80_HandSoldering","Diode_SMD/D_SMA-SMB_Universal_Handsoldering","Diode_SMD/D_SMA","Diode_SMD/D_SMA_Handsoldering","Diode_SMD/D_SMB-SMC_Universal_Handsoldering","Diode_SMD/D_SMB","Diode_SMD/D_SMB_Handsoldering","Diode_SMD/D_SMB_Modified","Diode_SMD/D_SMC-RM10_Universal_Handsoldering","Diode_SMD/D_SMC","Diode_SMD/D_SMC_Handsoldering","Diode_SMD/D_SMF","Diode_SMD/D_SMP_DO-220AA","Diode_SMD/D_SOD-110","Diode_SMD/D_SOD-123","Diode_SMD/D_SOD-123F","Diode_SMD/D_SOD-128","Diode_SMD/D_SOD-323","Diode_SMD/D_SOD-323F","Diode_SMD/D_SOD-323_HandSoldering","Diode_SMD/D_SOD-523","Diode_SMD/D_SOD-882","Diode_SMD/D_SOD-882D","Diode_SMD/D_SOD-923","Diode_SMD/D_TUMD2","Diode_SMD/Diode_Bridge_Bourns_CD-DF4xxS","Diode_SMD/Diode_Bridge_Diotec_ABS","Diode_SMD/Diode_Bridge_Diotec_MicroDil_3.0x3.0x1.8mm","Diode_SMD/Diode_Bridge_Diotec_SO-DIL-Slim","Diode_SMD/Diode_Bridge_OnSemi_SDIP-4L","Diode_SMD/Diode_Bridge_Vishay_DFS","Diode_SMD/Diode_Bridge_Vishay_DFSFlat","Diode_SMD/Diode_Bridge_Vishay_MBLS","Diode_SMD/Infineon_SG-WLL-2-3_0.58x0.28_P0.36mm","Diode_SMD/Littelfuse_PolyZen-LS","Diode_SMD/Nexperia_CFP3_SOD-123W","Diode_SMD/Nexperia_DSN0603-2_0.6x0.3mm_P0.4mm","Diode_SMD/Nexperia_DSN1608-2_1.6x0.8mm","Diode_SMD/ST_D_SMC","Diode_SMD/ST_QFN-2L_1.6x1.0mm","Diode_SMD/Vishay_SMPA","Diode_THT/D_5KPW_P12.70mm_Horizontal","Diode_THT/D_5KPW_P7.62mm_Vertical_AnodeUp","Diode_THT/D_5KPW_P7.62mm_Vertical_CathodeUp","Diode_THT/D_5KP_P10.16mm_Horizontal","Diode_THT/D_5KP_P12.70mm_Horizontal","Diode_THT/D_5KP_P7.62mm_Vertical_AnodeUp","Diode_THT/D_5KP_P7.62mm_Vertical_CathodeUp","Diode_THT/D_5W_P10.16mm_Horizontal","Diode_THT/D_5W_P12.70mm_Horizontal","Diode_THT/D_5W_P5.08mm_Vertical_AnodeUp","Diode_THT/D_5W_P5.08mm_Vertical_CathodeUp","Diode_THT/D_A-405_P10.16mm_Horizontal","Diode_THT/D_A-405_P12.70mm_Horizontal","Diode_THT/D_A-405_P2.54mm_Vertical_AnodeUp","Diode_THT/D_A-405_P2.54mm_Vertical_CathodeUp","Diode_THT/D_A-405_P5.08mm_Vertical_AnodeUp","Diode_THT/D_A-405_P5.08mm_Vertical_CathodeUp","Diode_THT/D_A-405_P7.62mm_Horizontal","Diode_THT/D_DO-15_P10.16mm_Horizontal","Diode_THT/D_DO-15_P12.70mm_Horizontal","Diode_THT/D_DO-15_P15.24mm_Horizontal","Diode_THT/D_DO-15_P2.54mm_Vertical_AnodeUp","Diode_THT/D_DO-15_P2.54mm_Vertical_CathodeUp","Diode_THT/D_DO-15_P3.81mm_Vertical_AnodeUp","Diode_THT/D_DO-15_P3.81mm_Vertical_CathodeUp","Diode_THT/D_DO-15_P5.08mm_Vertical_AnodeUp","Diode_THT/D_DO-15_P5.08mm_Vertical_CathodeUp","Diode_THT/D_DO-201AD_P12.70mm_Horizontal","Diode_THT/D_DO-201AD_P15.24mm_Horizontal","Diode_THT/D_DO-201AD_P3.81mm_Vertical_AnodeUp","Diode_THT/D_DO-201AD_P3.81mm_Vertical_CathodeUp","Diode_THT/D_DO-201AD_P5.08mm_Vertical_AnodeUp","Diode_THT/D_DO-201AD_P5.08mm_Vertical_CathodeUp","Diode_THT/D_DO-201AE_P12.70mm_Horizontal","Diode_THT/D_DO-201AE_P15.24mm_Horizontal","Diode_THT/D_DO-201AE_P3.81mm_Vertical_AnodeUp","Diode_THT/D_DO-201AE_P3.81mm_Vertical_CathodeUp","Diode_THT/D_DO-201AE_P5.08mm_Vertical_AnodeUp","Diode_THT/D_DO-201AE_P5.08mm_Vertical_CathodeUp","Diode_THT/D_DO-201_P12.70mm_Horizontal","Diode_THT/D_DO-201_P15.24mm_Horizontal","Diode_THT/D_DO-201_P3.81mm_Vertical_AnodeUp","Diode_THT/D_DO-201_P3.81mm_Vertical_CathodeUp","Diode_THT/D_DO-201_P5.08mm_Vertical_AnodeUp","Diode_THT/D_DO-201_P5.08mm_Vertical_CathodeUp","Diode_THT/D_DO-247_Horizontal_TabDown","Diode_THT/D_DO-247_Horizontal_TabUp","Diode_THT/D_DO-247_Vertical","Diode_THT/D_DO-27_P12.70mm_Horizontal","Diode_THT/D_DO-27_P15.24mm_Horizontal","Diode_THT/D_DO-27_P5.08mm_Vertical_AnodeUp","Diode_THT/D_DO-27_P5.08mm_Vertical_CathodeUp","Diode_THT/D_DO-34_SOD68_P10.16mm_Horizontal","Diode_THT/D_DO-34_SOD68_P12.70mm_Horizontal","Diode_THT/D_DO-34_SOD68_P2.54mm_Vertical_AnodeUp","Diode_THT/D_DO-34_SOD68_P2.54mm_Vertical_CathodeUp","Diode_THT/D_DO-34_SOD68_P5.08mm_Vertical_AnodeUp","Diode_THT/D_DO-34_SOD68_P5.08mm_Vertical_CathodeUp","Diode_THT/D_DO-34_SOD68_P7.62mm_Horizontal","Diode_THT/D_DO-35_SOD27_P10.16mm_Horizontal","Diode_THT/D_DO-35_SOD27_P12.70mm_Horizontal","Diode_THT/D_DO-35_SOD27_P2.54mm_Vertical_AnodeUp","Diode_THT/D_DO-35_SOD27_P2.54mm_Vertical_CathodeUp","Diode_THT/D_DO-35_SOD27_P3.81mm_Vertical_AnodeUp","Diode_THT/D_DO-35_SOD27_P3.81mm_Vertical_CathodeUp","Diode_THT/D_DO-35_SOD27_P5.08mm_Vertical_AnodeUp","Diode_THT/D_DO-35_SOD27_P5.08mm_Vertical_CathodeUp","Diode_THT/D_DO-35_SOD27_P7.62mm_Horizontal","Diode_THT/D_DO-41_SOD81_P10.16mm_Horizontal","Diode_THT/D_DO-41_SOD81_P12.70mm_Horizontal","Diode_THT/D_DO-41_SOD81_P2.54mm_Vertical_AnodeUp","Diode_THT/D_DO-41_SOD81_P2.54mm_Vertical_CathodeUp","Diode_THT/D_DO-41_SOD81_P3.81mm_Vertical_AnodeUp","Diode_THT/D_DO-41_SOD81_P3.81mm_Vertical_CathodeUp","Diode_THT/D_DO-41_SOD81_P5.08mm_Vertical_AnodeUp","Diode_THT/D_DO-41_SOD81_P5.08mm_Vertical_CathodeUp","Diode_THT/D_DO-41_SOD81_P7.62mm_Horizontal","Diode_THT/D_P600_R-6_P12.70mm_Horizontal","Diode_THT/D_P600_R-6_P20.00mm_Horizontal","Diode_THT/D_P600_R-6_P7.62mm_Vertical_AnodeUp","Diode_THT/D_P600_R-6_P7.62mm_Vertical_CathodeUp","Diode_THT/D_T-1_P10.16mm_Horizontal","Diode_THT/D_T-1_P12.70mm_Horizontal","Diode_THT/D_T-1_P2.54mm_Vertical_AnodeUp","Diode_THT/D_T-1_P2.54mm_Vertical_CathodeUp","Diode_THT/D_T-1_P5.08mm_Horizontal","Diode_THT/Diode_Bridge_15.1x15.1x6.3mm_P10.9mm","Diode_THT/Diode_Bridge_15.2x15.2x6.3mm_P10.9mm","Diode_THT/Diode_Bridge_15.7x15.7x6.3mm_P10.8mm","Diode_THT/Diode_Bridge_16.7x16.7x6.3mm_P10.8mm","Diode_THT/Diode_Bridge_19.0x19.0x6.8mm_P12.7mm","Diode_THT/Diode_Bridge_19.0x3.5x10.0mm_P5.0mm","Diode_THT/Diode_Bridge_28.6x28.6x7.3mm_P18.0mm_P11.6mm","Diode_THT/Diode_Bridge_32.0x5.6x17.0mm_P10.0mm_P7.5mm","Diode_THT/Diode_Bridge_Comchip_SCVB-L","Diode_THT/Diode_Bridge_DIGITRON_KBPC_T","Diode_THT/Diode_Bridge_DIP-4_W5.08mm_P2.54mm","Diode_THT/Diode_Bridge_DIP-4_W7.62mm_P5.08mm","Diode_THT/Diode_Bridge_GeneSiC_KBPC_T","Diode_THT/Diode_Bridge_GeneSiC_KBPC_W","Diode_THT/Diode_Bridge_IXYS_GUFP","Diode_THT/Diode_Bridge_Round_D8.9mm","Diode_THT/Diode_Bridge_Round_D9.0mm","Diode_THT/Diode_Bridge_Round_D9.8mm","Diode_THT/Diode_Bridge_Vishay_GBL","Diode_THT/Diode_Bridge_Vishay_GBU","Diode_THT/Diode_Bridge_Vishay_KBL","Diode_THT/Diode_Bridge_Vishay_KBPC1","Diode_THT/Diode_Bridge_Vishay_KBPC6","Diode_THT/Diode_Bridge_Vishay_KBPM","Diode_THT/Diode_Bridge_Vishay_KBU","Display/AG12864E","Display/Adafruit_SSD1306","Display/Adafruit_SSD1306_No_Mounting_Holes","Display/CR2013-MI2120","Display/DL1416","Display/EA-eDIP128B-XXX","Display/EA_DOGL128-6","Display/EA_DOGM128-6","Display/EA_DOGS104X-A","Display/EA_DOGXL160-7","Display/EA_DOGXL160-7_Backlight","Display/EA_T123X-I2C","Display/EA_eDIP160-XXX","Display/EA_eDIP240-XXX","Display/EA_eDIP320X-XXX","Display/EA_eDIPTFT32-XXX","Display/EA_eDIPTFT43-ATC","Display/EA_eDIPTFT43-XXX","Display/EA_eDIPTFT57-XXX","Display/EA_eDIPTFT70-ATC","Display/EA_eDIPTFT70-XXX","Display/ER-OLED0.42-1W_Folded","Display/ERM19264","Display/ER_OLEDM0.91_1x-I2C","Display/HDSM-441B_HDSM-443B","Display/HDSM-541B_HDSM-543B","Display/HDSP-4830","Display/HDSP-4832","Display/HDSP-4836","Display/HDSP-4840","Display/HDSP-4850","Display/HDSP-48xx","Display/HLCP-J100","Display/HY1602E","Display/LCD-016N002L","Display/LM16255","Display/NHD-0420H1Z","Display/NHD-C0220BiZ-FSRGB","Display/NHD-C0220BiZ","Display/NHD-C12832A1Z-FSRGB","Display/Noritake_CU20025-Ux1J","Display/OLED-128O064D","Display/RC1602A","Display/WC1602A","Display_7Segment/7SEGMENT-LED__HDSM531_HDSM533_SMD","Display_7Segment/7SegmentLED_LTS6760_LTS6780","Display_7Segment/AD-121F2","Display_7Segment/AFF_2x7SEG-DIGIT_10mm","Display_7Segment/CA56-12CGKWA","Display_7Segment/CA56-12EWA","Display_7Segment/CA56-12SEKWA","Display_7Segment/CA56-12SRWA","Display_7Segment/CA56-12SURKWA","Display_7Segment/CA56-12SYKWA","Display_7Segment/CC56-12GWA","Display_7Segment/CC56-12YWA","Display_7Segment/D1X8K","Display_7Segment/DA04-11CGKWA","Display_7Segment/DA04-11SEKWA","Display_7Segment/DA04-11SURKWA","Display_7Segment/DA04-11SYKWA","Display_7Segment/DA56-11CGKWA","Display_7Segment/DA56-11SEKWA","Display_7Segment/DA56-11SURKWA","Display_7Segment/DA56-11SYKWA","Display_7Segment/DE113-XX-XX","Display_7Segment/DE114-RS-20","Display_7Segment/DE119-XX-XX","Display_7Segment/DE122-XX-XX","Display_7Segment/DE152-XX-XX","Display_7Segment/DE170-XX-XX","Display_7Segment/ELD_426XXXX","Display_7Segment/HDSP-7401","Display_7Segment/HDSP-7507","Display_7Segment/HDSP-7801","Display_7Segment/HDSP-7807","Display_7Segment/HDSP-A151","Display_7Segment/HDSP-A401","Display_7Segment/KCSC02-105","Display_7Segment/KCSC02-106","Display_7Segment/KCSC02-107","Display_7Segment/KCSC02-123","Display_7Segment/KCSC02-136","Display_7Segment/LTC-4627Jx","Display_7Segment/MAN3410A","Display_7Segment/MAN3420A","Display_7Segment/MAN3610A","Display_7Segment/MAN3620A","Display_7Segment/MAN3630A","Display_7Segment/MAN3810A","Display_7Segment/MAN3820A","Display_7Segment/MAN71A","Display_7Segment/MAN72A","Display_7Segment/MAN73A","Display_7Segment/SA15-11xxx","Display_7Segment/SBC18-11SURKCGKWA","Display_7Segment/Sx39-1xxxxx","Ferrite_THT/LairdTech_28C0236-0JW-10","Fiducial/Fiducial_0.5mm_Mask1.5mm","Fiducial/Fiducial_0.5mm_Mask1mm","Fiducial/Fiducial_0.5mm_Mask2mm","Fiducial/Fiducial_0.75mm_Mask1.5mm","Fiducial/Fiducial_0.75mm_Mask2.25mm","Fiducial/Fiducial_1.5mm_Mask3mm","Fiducial/Fiducial_1.5mm_Mask4.5mm","Fiducial/Fiducial_1mm_Mask2mm","Fiducial/Fiducial_1mm_Mask3mm","Fiducial/Fiducial_Cross_1.5mm_Mask2mm","Filter/Filter_1109-5_1.1x0.9mm","Filter/Filter_1411-5_1.4x1.1mm","Filter/Filter_Bourns_SRF0905_6.0x9.2mm","Filter/Filter_FILTERCON_1FPxx","Filter/Filter_KEMET_PZB300_24.0x12.5mm_P10.0mm","Filter/Filter_Mini-Circuits_FV1206-1","Filter/Filter_Mini-Circuits_FV1206-4","Filter/Filter_Mini-Circuits_FV1206-5","Filter/Filter_Mini-Circuits_FV1206-6","Filter/Filter_Mini-Circuits_FV1206-7","Filter/Filter_Mini-Circuits_FV1206","Filter/Filter_Murata_BNX025","Filter/Filter_Murata_BNX025_ThermalVias","Filter/Filter_Murata_SFECF-6","Filter/Filter_Murata_SFECF-6_HandSoldering","Filter/Filter_SAW-6_3.8x3.8mm","Filter/Filter_SAW-8_3.8x3.8mm","Filter/Filter_SAW_Epcos_DCC6C_3x3mm","Filter/Filter_Schaffner_FN405","Filter/Filter_Schaffner_FN406","Fuse/FuseHolder_Blade_ATO_Littelfuse_FLR_178.6165","Fuse/Fuse_0402_1005Metric","Fuse/Fuse_0402_1005Metric_Pad0.77x0.64mm_HandSolder","Fuse/Fuse_0603_1608Metric","Fuse/Fuse_0603_1608Metric_Pad1.05x0.95mm_HandSolder","Fuse/Fuse_0805_2012Metric","Fuse/Fuse_0805_2012Metric_Pad1.15x1.40mm_HandSolder","Fuse/Fuse_1206_3216Metric","Fuse/Fuse_1206_3216Metric_Pad1.42x1.75mm_HandSolder","Fuse/Fuse_1210_3225Metric","Fuse/Fuse_1210_3225Metric_Pad1.42x2.65mm_HandSolder","Fuse/Fuse_1812_4532Metric","Fuse/Fuse_1812_4532Metric_Pad1.30x3.40mm_HandSolder","Fuse/Fuse_2010_5025Metric","Fuse/Fuse_2010_5025Metric_Pad1.52x2.65mm_HandSolder","Fuse/Fuse_2512_6332Metric","Fuse/Fuse_2512_6332Metric_Pad1.52x3.35mm_HandSolder","Fuse/Fuse_2920_7451Metric","Fuse/Fuse_2920_7451Metric_Pad2.10x5.45mm_HandSolder","Fuse/Fuse_BelFuse_0ZRE0005FF_L8.3mm_W3.8mm","Fuse/Fuse_BelFuse_0ZRE0008FF_L8.3mm_W3.8mm","Fuse/Fuse_BelFuse_0ZRE0012FF_L8.3mm_W3.8mm","Fuse/Fuse_BelFuse_0ZRE0016FF_L9.9mm_W3.8mm","Fuse/Fuse_BelFuse_0ZRE0025FF_L9.6mm_W3.8mm","Fuse/Fuse_BelFuse_0ZRE0033FF_L11.4mm_W3.8mm","Fuse/Fuse_BelFuse_0ZRE0040FF_L11.5mm_W3.8mm","Fuse/Fuse_BelFuse_0ZRE0055FF_L14.0mm_W4.1mm","Fuse/Fuse_BelFuse_0ZRE0075FF_L11.5mm_W4.8mm","Fuse/Fuse_BelFuse_0ZRE0100FF_L18.7mm_W5.1mm","Fuse/Fuse_BelFuse_0ZRE0125FF_L21.2mm_W5.3mm","Fuse/Fuse_BelFuse_0ZRE0150FF_L23.4mm_W5.3mm","Fuse/Fuse_BelFuse_0ZRE0200FF_L24.9mm_W6.1mm","Fuse/Fuse_Blade_ATO_directSolder","Fuse/Fuse_Blade_Mini_directSolder","Fuse/Fuse_Bourns_MF-RG1000","Fuse/Fuse_Bourns_MF-RG1100","Fuse/Fuse_Bourns_MF-RG300","Fuse/Fuse_Bourns_MF-RG400","Fuse/Fuse_Bourns_MF-RG500","Fuse/Fuse_Bourns_MF-RG600","Fuse/Fuse_Bourns_MF-RG650","Fuse/Fuse_Bourns_MF-RG700","Fuse/Fuse_Bourns_MF-RG800","Fuse/Fuse_Bourns_MF-RG900","Fuse/Fuse_Bourns_MF-RHT050","Fuse/Fuse_Bourns_MF-RHT070","Fuse/Fuse_Bourns_MF-RHT100","Fuse/Fuse_Bourns_MF-RHT1000","Fuse/Fuse_Bourns_MF-RHT1100","Fuse/Fuse_Bourns_MF-RHT1300","Fuse/Fuse_Bourns_MF-RHT200","Fuse/Fuse_Bourns_MF-RHT300","Fuse/Fuse_Bourns_MF-RHT400","Fuse/Fuse_Bourns_MF-RHT500","Fuse/Fuse_Bourns_MF-RHT550","Fuse/Fuse_Bourns_MF-RHT600","Fuse/Fuse_Bourns_MF-RHT650","Fuse/Fuse_Bourns_MF-RHT700","Fuse/Fuse_Bourns_MF-RHT750","Fuse/Fuse_Bourns_MF-RHT800","Fuse/Fuse_Bourns_MF-RHT900","Fuse/Fuse_Bourns_MF-SM_7.98x5.44mm","Fuse/Fuse_Bourns_MF-SM_9.5x6.71mm","Fuse/Fuse_Bourns_TBU-CA","Fuse/Fuse_Littelfuse-LVR100","Fuse/Fuse_Littelfuse-LVR125","Fuse/Fuse_Littelfuse-LVR200","Fuse/Fuse_Littelfuse-NANO2-451_453","Fuse/Fuse_Littelfuse-NANO2-462","Fuse/Fuse_Littelfuse-NANO2-885","Fuse/Fuse_Littelfuse_372_D8.50mm","Fuse/Fuse_Littelfuse_395Series","Fuse/Fuse_Schurter_UMT250","Fuse/Fuse_Schurter_UMZ250","Fuse/Fuse_SunFuse-6HP","Fuse/Fuseholder_Blade_ATO_Littelfuse_Pudenz_2_Pin","Fuse/Fuseholder_Blade_Mini_Keystone_3568","Fuse/Fuseholder_Clip-5x20mm_Bel_FC-203-22_Lateral_P17.80x5.00mm_D1.17mm_Horizontal","Fuse/Fuseholder_Clip-5x20mm_Eaton_1A5601-01_Inline_P20.80x6.76mm_D1.70mm_Horizontal","Fuse/Fuseholder_Clip-5x20mm_Keystone_3512P_Inline_P23.62x7.27mm_D1.02x2.41x1.02x1.57mm_Horizontal","Fuse/Fuseholder_Clip-5x20mm_Keystone_3512_Inline_P23.62x7.27mm_D1.02x1.57mm_Horizontal","Fuse/Fuseholder_Clip-5x20mm_Keystone_3517_Inline_P23.11x6.76mm_D1.70mm_Horizontal","Fuse/Fuseholder_Clip-5x20mm_Keystone_3518P_Inline_P23.11x6.76mm_D2.44x1.70mm_Horizontal","Fuse/Fuseholder_Clip-5x20mm_Littelfuse_100_Inline_P20.50x4.60mm_D1.30mm_Horizontal","Fuse/Fuseholder_Clip-5x20mm_Littelfuse_111_Inline_P20.00x5.00mm_D1.05mm_Horizontal","Fuse/Fuseholder_Clip-5x20mm_Littelfuse_111_Lateral_P18.80x5.00mm_D1.17mm_Horizontal","Fuse/Fuseholder_Clip-5x20mm_Littelfuse_445-030_Inline_P20.50x5.20mm_D1.30mm_Horizontal","Fuse/Fuseholder_Clip-5x20mm_Littelfuse_519_Inline_P20.60x5.00mm_D1.00mm_Horizontal","Fuse/Fuseholder_Clip-5x20mm_Littelfuse_520_Inline_P20.50x5.80mm_D1.30mm_Horizontal","Fuse/Fuseholder_Clip-5x20mm_Littelfuse_521_Lateral_P17.00x5.00mm_D1.30mm_Horizontal","Fuse/Fuseholder_Clip-5x20mm_Schurter_CQM_Inline_P20.60x5.00mm_D1.00mm_Horizontal","Fuse/Fuseholder_Clip-5x20mm_Schurter_OG_Lateral_P15.00x5.00mm_D1.3mm_Horizontal","Fuse/Fuseholder_Clip-6.3x32mm_Littelfuse_102071_Inline_P34.70x7.60mm_D2.00mm_Horizontal","Fuse/Fuseholder_Clip-6.3x32mm_Littelfuse_102_122_Inline_P34.21x7.62mm_D1.98mm_Horizontal","Fuse/Fuseholder_Clip-6.3x32mm_Littelfuse_102_Inline_P34.21x7.62mm_D2.54mm_Horizontal","Fuse/Fuseholder_Clip-6.3x32mm_Littelfuse_122_Inline_P34.21x7.62mm_D2.54mm_Horizontal","Fuse/Fuseholder_Cylinder-5x20mm_Bulgin_FX0456_Vertical_Closed","Fuse/Fuseholder_Cylinder-5x20mm_Bulgin_FX0457_Horizontal_Closed","Fuse/Fuseholder_Cylinder-5x20mm_EATON_H15-V-1_Vertical_Closed","Fuse/Fuseholder_Cylinder-5x20mm_EATON_HBV_Vertical_Closed","Fuse/Fuseholder_Cylinder-5x20mm_EATON_HBW_Vertical_Closed","Fuse/Fuseholder_Cylinder-5x20mm_Schurter_0031_8201_Horizontal_Open","Fuse/Fuseholder_Cylinder-5x20mm_Schurter_FAB_0031-355x_Horizontal_Closed","Fuse/Fuseholder_Cylinder-5x20mm_Schurter_FPG4_Vertical_Closed","Fuse/Fuseholder_Cylinder-5x20mm_Schurter_FUP_0031.2510_Horizontal_Closed","Fuse/Fuseholder_Cylinder-5x20mm_Schurter_OGN-SMD_Horizontal_Open","Fuse/Fuseholder_Cylinder-5x20mm_Stelvio-Kontek_PTF78_Horizontal_Open","Fuse/Fuseholder_Cylinder-5x20mm_Wuerth_696103101002-SMD_Horizontal_Open","Fuse/Fuseholder_Cylinder-6.3x32mm_Schurter_0031-8002_Horizontal_Open","Fuse/Fuseholder_Cylinder-6.3x32mm_Schurter_FUP_0031.2520_Horizontal_Closed","Fuse/Fuseholder_Keystone_3555-2","Fuse/Fuseholder_Littelfuse_100_series_5x20mm","Fuse/Fuseholder_Littelfuse_100_series_5x25mm","Fuse/Fuseholder_Littelfuse_100_series_5x30mm","Fuse/Fuseholder_Littelfuse_445_030_series_5x20mm","Fuse/Fuseholder_Littelfuse_445_030_series_5x25mm","Fuse/Fuseholder_Littelfuse_445_030_series_5x30mm","Fuse/Fuseholder_Littelfuse_Nano2_154x","Fuse/Fuseholder_Littelfuse_Nano2_157x","Fuse/Fuseholder_TR5_Littelfuse_No560_No460","Fuse/GDT_Bourns_2038","Fuse/GDT_Yageo_3RxxxxL-6","Fuse/GDT_Yageo_3RxxxxM-6","Heatsink/Heatsink_125x35x50mm_3xFixationM3","Heatsink/Heatsink_35x26mm_1xFixation3mm_Fischer-SK486-35","Heatsink/Heatsink_38x38mm_SpringFixation","Heatsink/Heatsink_62x40mm_2xFixation3mm","Heatsink/Heatsink_AAVID_573300D00010G_TO-263","Heatsink/Heatsink_AAVID_576802B03900G","Heatsink/Heatsink_AAVID_590302B03600G","Heatsink/Heatsink_AAVID_Extruded_531002B00000G_34.9x12.7mm_H25.4mm","Heatsink/Heatsink_AAVID_Extruded_531002B02100G_34.9x12.7mm_H25.4mm","Heatsink/Heatsink_AAVID_Extruded_531002B02500G_34.9x12.7mm_H25.4mm","Heatsink/Heatsink_AAVID_Extruded_531102B00000G_34.9x12.7mm_H38.1mm","Heatsink/Heatsink_AAVID_Extruded_531102B02100G_34.9x12.7mm_H38.1mm","Heatsink/Heatsink_AAVID_Extruded_531102B02500G_34.9x12.7mm_H38.1mm","Heatsink/Heatsink_AAVID_Extruded_531102V02500G_34.9x12.7mm_H38.1mm","Heatsink/Heatsink_AAVID_Extruded_531202B00000G_34.9x12.7mm_H50.8mm","Heatsink/Heatsink_AAVID_Extruded_531202B02100G_34.9x12.7mm_H50.8mm","Heatsink/Heatsink_AAVID_Extruded_531202B02500G_34.9x12.7mm_H50.8mm","Heatsink/Heatsink_AAVID_Extruded_531302B02500G_34.9x12.7mm_H63.5mm","Heatsink/Heatsink_AAVID_TV5G_TO220_Horizontal","Heatsink/Heatsink_Fischer_FK224xx2201_25x8.3mm","Heatsink/Heatsink_Fischer_FK24413D2PAK_26x13mm","Heatsink/Heatsink_Fischer_FK24413DPAK_23x13mm","Heatsink/Heatsink_Fischer_SK104-STC-STIC_35x13mm_2xDrill2.5mm","Heatsink/Heatsink_Fischer_SK104-STCB_35x13mm__2xDrill3.5mm_ScrewM3","Heatsink/Heatsink_Fischer_SK129-STS_42x25mm_2xDrill2.5mm","Heatsink/Heatsink_SheetType_50x7mm_2Fixations","Heatsink/Heatsink_Stonecold_HS-130_30x12mm_2xFixation2.5mm","Heatsink/Heatsink_Stonecold_HS-132_32x14mm_2xFixation1.5mm","Heatsink/Heatsink_Stonecold_HS-S01_13.21x6.35mm","Heatsink/Heatsink_Stonecold_HS-S02_13.21x9.53mm","Heatsink/Heatsink_Stonecold_HS-S03_13.21x12.7mm","Inductor_SMD/L_01005_0402Metric","Inductor_SMD/L_01005_0402Metric_Pad0.57x0.30mm_HandSolder","Inductor_SMD/L_0201_0603Metric","Inductor_SMD/L_0201_0603Metric_Pad0.64x0.40mm_HandSolder","Inductor_SMD/L_0402_1005Metric","Inductor_SMD/L_0402_1005Metric_Pad0.77x0.64mm_HandSolder","Inductor_SMD/L_0603_1608Metric","Inductor_SMD/L_0603_1608Metric_Pad1.05x0.95mm_HandSolder","Inductor_SMD/L_0805_2012Metric","Inductor_SMD/L_0805_2012Metric_Pad1.05x1.20mm_HandSolder","Inductor_SMD/L_10.4x10.4_H4.8","Inductor_SMD/L_1008_2520Metric","Inductor_SMD/L_1008_2520Metric_Pad1.43x2.20mm_HandSolder","Inductor_SMD/L_1206_3216Metric","Inductor_SMD/L_1206_3216Metric_Pad1.22x1.90mm_HandSolder","Inductor_SMD/L_1210_3225Metric","Inductor_SMD/L_1210_3225Metric_Pad1.42x2.65mm_HandSolder","Inductor_SMD/L_12x12mm_H4.5mm","Inductor_SMD/L_12x12mm_H6mm","Inductor_SMD/L_12x12mm_H8mm","Inductor_SMD/L_1806_4516Metric","Inductor_SMD/L_1806_4516Metric_Pad1.45x1.90mm_HandSolder","Inductor_SMD/L_1812_4532Metric","Inductor_SMD/L_1812_4532Metric_Pad1.30x3.40mm_HandSolder","Inductor_SMD/L_2010_5025Metric","Inductor_SMD/L_2010_5025Metric_Pad1.52x2.65mm_HandSolder","Inductor_SMD/L_2512_6332Metric","Inductor_SMD/L_2512_6332Metric_Pad1.52x3.35mm_HandSolder","Inductor_SMD/L_6.3x6.3_H3","Inductor_SMD/L_7.3x7.3_H3.5","Inductor_SMD/L_7.3x7.3_H4.5","Inductor_SMD/L_APV_ANR252010","Inductor_SMD/L_APV_ANR252012","Inductor_SMD/L_APV_ANR3010","Inductor_SMD/L_APV_ANR3012","Inductor_SMD/L_APV_ANR3015","Inductor_SMD/L_APV_ANR4010","Inductor_SMD/L_APV_ANR4012","Inductor_SMD/L_APV_ANR4018","Inductor_SMD/L_APV_ANR4020","Inductor_SMD/L_APV_ANR4026","Inductor_SMD/L_APV_ANR4030","Inductor_SMD/L_APV_ANR5012","Inductor_SMD/L_APV_ANR5020","Inductor_SMD/L_APV_ANR5040","Inductor_SMD/L_APV_ANR5045","Inductor_SMD/L_APV_ANR6020","Inductor_SMD/L_APV_ANR6028","Inductor_SMD/L_APV_ANR6045","Inductor_SMD/L_APV_ANR8040","Inductor_SMD/L_APV_ANR8065","Inductor_SMD/L_APV_APH0412","Inductor_SMD/L_APV_APH0420","Inductor_SMD/L_APV_APH0518","Inductor_SMD/L_APV_APH0530","Inductor_SMD/L_APV_APH0615","Inductor_SMD/L_APV_APH0618","Inductor_SMD/L_APV_APH0620","Inductor_SMD/L_APV_APH0624","Inductor_SMD/L_APV_APH0630","Inductor_SMD/L_APV_APH0640","Inductor_SMD/L_APV_APH0650","Inductor_SMD/L_APV_APH0840","Inductor_SMD/L_APV_APH0850","Inductor_SMD/L_APV_APH1030","Inductor_SMD/L_APV_APH1040","Inductor_SMD/L_APV_APH1050","Inductor_SMD/L_APV_APH1240","Inductor_SMD/L_APV_APH1250","Inductor_SMD/L_APV_APH1260","Inductor_SMD/L_APV_APH1265","Inductor_SMD/L_APV_APH1770","Inductor_SMD/L_APV_APH2213","Inductor_SMD/L_AVX_LMLP07A7","Inductor_SMD/L_Abracon_ASPI-0425","Inductor_SMD/L_Abracon_ASPI-0630LR","Inductor_SMD/L_Abracon_ASPI-3012S","Inductor_SMD/L_Abracon_ASPI-4030S","Inductor_SMD/L_Abracon_ASPIAIG-F4020","Inductor_SMD/L_Bourns-SRN1060","Inductor_SMD/L_Bourns-SRN4018","Inductor_SMD/L_Bourns-SRN6028","Inductor_SMD/L_Bourns-SRN8040_8x8.15mm","Inductor_SMD/L_Bourns-SRR1005","Inductor_SMD/L_Bourns-SRU1028_10.0x10.0mm","Inductor_SMD/L_Bourns-SRU8028_8.0x8.0mm","Inductor_SMD/L_Bourns-SRU8043","Inductor_SMD/L_Bourns_SDR0604","Inductor_SMD/L_Bourns_SDR1806","Inductor_SMD/L_Bourns_SRF1260","Inductor_SMD/L_Bourns_SRN6045TA","Inductor_SMD/L_Bourns_SRN8040TA","Inductor_SMD/L_Bourns_SRP1038C_10.0x10.0mm","Inductor_SMD/L_Bourns_SRP1050WA","Inductor_SMD/L_Bourns_SRP1245A","Inductor_SMD/L_Bourns_SRP1770TA_16.9x16.9mm","Inductor_SMD/L_Bourns_SRP2313AA","Inductor_SMD/L_Bourns_SRP5030T","Inductor_SMD/L_Bourns_SRP6060FA","Inductor_SMD/L_Bourns_SRP7028A_7.3x6.6mm","Inductor_SMD/L_Bourns_SRR1208_12.7x12.7mm","Inductor_SMD/L_Bourns_SRR1210A","Inductor_SMD/L_Bourns_SRR1260","Inductor_SMD/L_Bourns_SRU5016_5.2x5.2mm","Inductor_SMD/L_Cenker_CKCS201610","Inductor_SMD/L_Cenker_CKCS252010","Inductor_SMD/L_Cenker_CKCS252012","Inductor_SMD/L_Cenker_CKCS3012","Inductor_SMD/L_Cenker_CKCS3015","Inductor_SMD/L_Cenker_CKCS4018","Inductor_SMD/L_Cenker_CKCS4020","Inductor_SMD/L_Cenker_CKCS4030","Inductor_SMD/L_Cenker_CKCS5020","Inductor_SMD/L_Cenker_CKCS5040","Inductor_SMD/L_Cenker_CKCS6020","Inductor_SMD/L_Cenker_CKCS6028","Inductor_SMD/L_Cenker_CKCS6045","Inductor_SMD/L_Cenker_CKCS8040","Inductor_SMD/L_Cenker_CKCS8060","Inductor_SMD/L_Cenker_CKCS8080","Inductor_SMD/L_Changjiang_FNR252010S","Inductor_SMD/L_Changjiang_FNR252012S","Inductor_SMD/L_Changjiang_FNR3010S","Inductor_SMD/L_Changjiang_FNR3012S","Inductor_SMD/L_Changjiang_FNR3015S","Inductor_SMD/L_Changjiang_FNR3021S","Inductor_SMD/L_Changjiang_FNR4010S","Inductor_SMD/L_Changjiang_FNR4012S","Inductor_SMD/L_Changjiang_FNR4015S","Inductor_SMD/L_Changjiang_FNR4018S","Inductor_SMD/L_Changjiang_FNR4020S","Inductor_SMD/L_Changjiang_FNR4026S","Inductor_SMD/L_Changjiang_FNR4030S","Inductor_SMD/L_Changjiang_FNR5012S","Inductor_SMD/L_Changjiang_FNR5015S","Inductor_SMD/L_Changjiang_FNR5020S","Inductor_SMD/L_Changjiang_FNR5030S","Inductor_SMD/L_Changjiang_FNR5040S","Inductor_SMD/L_Changjiang_FNR5045S","Inductor_SMD/L_Changjiang_FNR6020S","Inductor_SMD/L_Changjiang_FNR6028S","Inductor_SMD/L_Changjiang_FNR6040S","Inductor_SMD/L_Changjiang_FNR6045S","Inductor_SMD/L_Changjiang_FNR8040S","Inductor_SMD/L_Changjiang_FNR8050S","Inductor_SMD/L_Changjiang_FNR8065S","Inductor_SMD/L_Changjiang_FTC100765D","Inductor_SMD/L_Changjiang_FTC121065S","Inductor_SMD/L_Changjiang_FTC141207S","Inductor_SMD/L_Changjiang_FTC141208S","Inductor_SMD/L_Changjiang_FTC141265S","Inductor_SMD/L_Changjiang_FTC160808S","Inductor_SMD/L_Changjiang_FTC160865S","Inductor_SMD/L_Changjiang_FTC201208S","Inductor_SMD/L_Changjiang_FTC201210S","Inductor_SMD/L_Changjiang_FTC201212S","Inductor_SMD/L_Changjiang_FTC201265S","Inductor_SMD/L_Changjiang_FTC201607S","Inductor_SMD/L_Changjiang_FTC201608S","Inductor_SMD/L_Changjiang_FTC201610D","Inductor_SMD/L_Changjiang_FTC201610S","Inductor_SMD/L_Changjiang_FTC201612S","Inductor_SMD/L_Changjiang_FTC201655S","Inductor_SMD/L_Changjiang_FTC201665S","Inductor_SMD/L_Changjiang_FTC252008S","Inductor_SMD/L_Changjiang_FTC252010S","Inductor_SMD/L_Changjiang_FTC252012S","Inductor_SMD/L_Changjiang_FTC252075S","Inductor_SMD/L_Changjiang_FTC303010D","Inductor_SMD/L_Changjiang_FTC303012D","Inductor_SMD/L_Changjiang_FTC303015D","Inductor_SMD/L_Changjiang_FTC303018D","Inductor_SMD/L_Changjiang_FTC303020D","Inductor_SMD/L_Changjiang_FTC322510S","Inductor_SMD/L_Changjiang_FTC322512S","Inductor_SMD/L_Changjiang_FTC322520S","Inductor_SMD/L_Changjiang_FTC404010S","Inductor_SMD/L_Changjiang_FTC404012S","Inductor_SMD/L_Changjiang_FTC404020S","Inductor_SMD/L_Changjiang_FTC404030S","Inductor_SMD/L_Changjiang_FXL0412","Inductor_SMD/L_Changjiang_FXL0420","Inductor_SMD/L_Changjiang_FXL0518","Inductor_SMD/L_Changjiang_FXL0530","Inductor_SMD/L_Changjiang_FXL0615","Inductor_SMD/L_Changjiang_FXL0618","Inductor_SMD/L_Changjiang_FXL0624","Inductor_SMD/L_Changjiang_FXL0630","Inductor_SMD/L_Changjiang_FXL0640","Inductor_SMD/L_Changjiang_FXL0650","Inductor_SMD/L_Changjiang_FXL0840","Inductor_SMD/L_Changjiang_FXL1030","Inductor_SMD/L_Changjiang_FXL1040","Inductor_SMD/L_Changjiang_FXL1050","Inductor_SMD/L_Changjiang_FXL1340","Inductor_SMD/L_Changjiang_FXL1350","Inductor_SMD/L_Changjiang_FXL1360","Inductor_SMD/L_Changjiang_FXL1365","Inductor_SMD/L_Changjiang_FXL1770","Inductor_SMD/L_Changjiang_FXL2213","Inductor_SMD/L_Chilisin_BMRA00040415","Inductor_SMD/L_Chilisin_BMRA00040420","Inductor_SMD/L_Chilisin_BMRA00050520","Inductor_SMD/L_Chilisin_BMRA00050530","Inductor_SMD/L_Chilisin_BMRB00050512","Inductor_SMD/L_Chilisin_BMRB00050518-B","Inductor_SMD/L_Chilisin_BMRB00050518","Inductor_SMD/L_Chilisin_BMRB00060612","Inductor_SMD/L_Chilisin_BMRB00060618","Inductor_SMD/L_Chilisin_BMRB00060624","Inductor_SMD/L_Chilisin_BMRB00060650","Inductor_SMD/L_Chilisin_BMRF00101040","Inductor_SMD/L_Chilisin_BMRF00131350","Inductor_SMD/L_Chilisin_BMRF00131360","Inductor_SMD/L_Chilisin_BMRF00171770","Inductor_SMD/L_Chilisin_BMRG00101030","Inductor_SMD/L_Chilisin_BMRG00131360","Inductor_SMD/L_Chilisin_BMRx00040412","Inductor_SMD/L_Chilisin_BMRx00050512-B","Inductor_SMD/L_Chilisin_BMRx00050515","Inductor_SMD/L_Chilisin_BMRx00060615","Inductor_SMD/L_Chilisin_BMRx00060630","Inductor_SMD/L_Chilisin_BWVS00322515","Inductor_SMD/L_Chilisin_BWVS00404012","Inductor_SMD/L_Chilisin_BWVS00404018","Inductor_SMD/L_Chilisin_BWVS00404026","Inductor_SMD/L_Chilisin_BWVS00505020","Inductor_SMD/L_Chilisin_BWVS00505030","Inductor_SMD/L_Chilisin_BWVS00505040","Inductor_SMD/L_Chilisin_BWVS00606020","Inductor_SMD/L_Chilisin_BWVS00606028","Inductor_SMD/L_Chilisin_BWVS00606045","Inductor_SMD/L_Chilisin_BWVS00808040","Inductor_SMD/L_Coilcraft_0403HQ_1008Metric","Inductor_SMD/L_Coilcraft_0604HQ_1610Metric","Inductor_SMD/L_Coilcraft_0805HQ_2012Metric","Inductor_SMD/L_Coilcraft_1008HQ_2520Metric","Inductor_SMD/L_Coilcraft_1008HQ_2520Metric_LowProfile","Inductor_SMD/L_Coilcraft_1515SQ-47N","Inductor_SMD/L_Coilcraft_1515SQ-68N","Inductor_SMD/L_Coilcraft_1515SQ-82N","Inductor_SMD/L_Coilcraft_2222SQ-111","Inductor_SMD/L_Coilcraft_2222SQ-131","Inductor_SMD/L_Coilcraft_2222SQ-161","Inductor_SMD/L_Coilcraft_2222SQ-181","Inductor_SMD/L_Coilcraft_2222SQ-221","Inductor_SMD/L_Coilcraft_2222SQ-271","Inductor_SMD/L_Coilcraft_2222SQ-301","Inductor_SMD/L_Coilcraft_2222SQ-90N","Inductor_SMD/L_Coilcraft_2929SQ-331","Inductor_SMD/L_Coilcraft_2929SQ-361","Inductor_SMD/L_Coilcraft_2929SQ-391","Inductor_SMD/L_Coilcraft_2929SQ-431","Inductor_SMD/L_Coilcraft_2929SQ-501","Inductor_SMD/L_Coilcraft_LPS3010","Inductor_SMD/L_Coilcraft_LPS3314","Inductor_SMD/L_Coilcraft_LPS4018","Inductor_SMD/L_Coilcraft_LPS4414","Inductor_SMD/L_Coilcraft_LPS5030","Inductor_SMD/L_Coilcraft_MOS6020-XXX","Inductor_SMD/L_Coilcraft_MSS1038-XXX","Inductor_SMD/L_Coilcraft_MSS1038T-XXX","Inductor_SMD/L_Coilcraft_MSS1048-XXX","Inductor_SMD/L_Coilcraft_MSS1048T-XXX","Inductor_SMD/L_Coilcraft_MSS1210-XXX","Inductor_SMD/L_Coilcraft_MSS1210H-XXX","Inductor_SMD/L_Coilcraft_MSS1246-XXX","Inductor_SMD/L_Coilcraft_MSS1246H-XXX","Inductor_SMD/L_Coilcraft_MSS1246T-XXX","Inductor_SMD/L_Coilcraft_MSS1260-XXX","Inductor_SMD/L_Coilcraft_MSS1260H-XXX","Inductor_SMD/L_Coilcraft_MSS1260T-XXX","Inductor_SMD/L_Coilcraft_MSS1278-XXX","Inductor_SMD/L_Coilcraft_MSS1278H-XXX","Inductor_SMD/L_Coilcraft_MSS1278T-XXX","Inductor_SMD/L_Coilcraft_MSS1514V-XXX","Inductor_SMD/L_Coilcraft_MSS1583-XXX","Inductor_SMD/L_Coilcraft_MSS1812T-XXX","Inductor_SMD/L_Coilcraft_MSS7348-XXX","Inductor_SMD/L_Coilcraft_XAL1010-XXX","Inductor_SMD/L_Coilcraft_XAL1030-XXX","Inductor_SMD/L_Coilcraft_XAL1060-XXX","Inductor_SMD/L_Coilcraft_XAL1350-XXX","Inductor_SMD/L_Coilcraft_XAL1510-103","Inductor_SMD/L_Coilcraft_XAL1510-153","Inductor_SMD/L_Coilcraft_XAL1510-223","Inductor_SMD/L_Coilcraft_XAL1510-333","Inductor_SMD/L_Coilcraft_XAL1510-472","Inductor_SMD/L_Coilcraft_XAL1510-682","Inductor_SMD/L_Coilcraft_XAL1510-822","Inductor_SMD/L_Coilcraft_XAL1513-153","Inductor_SMD/L_Coilcraft_XAL1580-102","Inductor_SMD/L_Coilcraft_XAL1580-132","Inductor_SMD/L_Coilcraft_XAL1580-182","Inductor_SMD/L_Coilcraft_XAL1580-202","Inductor_SMD/L_Coilcraft_XAL1580-302","Inductor_SMD/L_Coilcraft_XAL1580-401","Inductor_SMD/L_Coilcraft_XAL1580-452","Inductor_SMD/L_Coilcraft_XAL1580-532","Inductor_SMD/L_Coilcraft_XAL1580-612","Inductor_SMD/L_Coilcraft_XAL1580-741","Inductor_SMD/L_Coilcraft_XAL4020-XXX","Inductor_SMD/L_Coilcraft_XAL4030-XXX","Inductor_SMD/L_Coilcraft_XAL4040-XXX","Inductor_SMD/L_Coilcraft_XAL5020-XXX","Inductor_SMD/L_Coilcraft_XAL5030-XXX","Inductor_SMD/L_Coilcraft_XAL5050-XXX","Inductor_SMD/L_Coilcraft_XAL6020-XXX","Inductor_SMD/L_Coilcraft_XAL6030-XXX","Inductor_SMD/L_Coilcraft_XAL6060-XXX","Inductor_SMD/L_Coilcraft_XAL7020-102","Inductor_SMD/L_Coilcraft_XAL7020-122","Inductor_SMD/L_Coilcraft_XAL7020-151","Inductor_SMD/L_Coilcraft_XAL7020-152","Inductor_SMD/L_Coilcraft_XAL7020-222","Inductor_SMD/L_Coilcraft_XAL7020-271","Inductor_SMD/L_Coilcraft_XAL7020-331","Inductor_SMD/L_Coilcraft_XAL7020-471","Inductor_SMD/L_Coilcraft_XAL7020-681","Inductor_SMD/L_Coilcraft_XAL7030-102","Inductor_SMD/L_Coilcraft_XAL7030-103","Inductor_SMD/L_Coilcraft_XAL7030-152","Inductor_SMD/L_Coilcraft_XAL7030-161","Inductor_SMD/L_Coilcraft_XAL7030-222","Inductor_SMD/L_Coilcraft_XAL7030-272","Inductor_SMD/L_Coilcraft_XAL7030-301","Inductor_SMD/L_Coilcraft_XAL7030-332","Inductor_SMD/L_Coilcraft_XAL7030-472","Inductor_SMD/L_Coilcraft_XAL7030-562","Inductor_SMD/L_Coilcraft_XAL7030-601","Inductor_SMD/L_Coilcraft_XAL7030-682","Inductor_SMD/L_Coilcraft_XAL7030-822","Inductor_SMD/L_Coilcraft_XAL7050-XXX","Inductor_SMD/L_Coilcraft_XAL7070-XXX","Inductor_SMD/L_Coilcraft_XAL8050-223","Inductor_SMD/L_Coilcraft_XAL8080-XXX","Inductor_SMD/L_Coilcraft_XFL2010","Inductor_SMD/L_Coilcraft_XxL4020","Inductor_SMD/L_Coilcraft_XxL4030","Inductor_SMD/L_Coilcraft_XxL4040","Inductor_SMD/L_CommonModeChoke_Bourns_SRF1260","Inductor_SMD/L_CommonModeChoke_Coilank_ACM1210","Inductor_SMD/L_CommonModeChoke_Coilank_ACM1608","Inductor_SMD/L_CommonModeChoke_Coilank_ACM2012","Inductor_SMD/L_CommonModeChoke_Coilank_ACM2520","Inductor_SMD/L_CommonModeChoke_Coilank_ACM3216","Inductor_SMD/L_CommonModeChoke_Coilank_ACM3225","Inductor_SMD/L_CommonModeChoke_Coilank_ACM4532","Inductor_SMD/L_CommonModeChoke_Coilcraft_0603USB","Inductor_SMD/L_CommonModeChoke_Coilcraft_0805USB","Inductor_SMD/L_CommonModeChoke_Coilcraft_1812CAN","Inductor_SMD/L_CommonModeChoke_Murata_DLW5BTMxxxSQ2x_5x5mm","Inductor_SMD/L_CommonModeChoke_TDK_ACM2520-2P","Inductor_SMD/L_CommonModeChoke_TDK_ACM2520-3P","Inductor_SMD/L_CommonModeChoke_TDK_ACM7060","Inductor_SMD/L_CommonModeChoke_Wuerth_WE-SL5-HC","Inductor_SMD/L_CommonModeChoke_Wuerth_WE-SL5","Inductor_SMD/L_CommonModeChoke_XR_XRGM0905C","Inductor_SMD/L_CommonMode_Bourns_DR331","Inductor_SMD/L_CommonMode_Delevan_4222","Inductor_SMD/L_CommonMode_Wuerth_WE-SL2","Inductor_SMD/L_CommonMode_Wurth_WE-CNSW-1206","Inductor_SMD/L_Eaton_MCL2012V1","Inductor_SMD/L_Fastron_PISN","Inductor_SMD/L_Fastron_PISN_Handsoldering","Inductor_SMD/L_Fastron_PISR","Inductor_SMD/L_Fastron_PISR_Handsoldering","Inductor_SMD/L_Ferrocore_DLG-0302","Inductor_SMD/L_Ferrocore_DLG-0403","Inductor_SMD/L_Ferrocore_DLG-0504","Inductor_SMD/L_Ferrocore_DLG-0703","Inductor_SMD/L_Ferrocore_DLG-0705","Inductor_SMD/L_Ferrocore_DLG-1004","Inductor_SMD/L_Ferrocore_DLG-1005","Inductor_SMD/L_KOHERelec_MDA5030","Inductor_SMD/L_KOHERelec_MDA7030","Inductor_SMD/L_Murata_DEM3512C","Inductor_SMD/L_Murata_DEM3518C","Inductor_SMD/L_Murata_DFE201610P","Inductor_SMD/L_Murata_LQH2MCNxxxx02_2.0x1.6mm","Inductor_SMD/L_Murata_LQH55DN_5.7x5.0mm","Inductor_SMD/L_Neosid_Air-Coil_SML_1turn_HDM0131A","Inductor_SMD/L_Neosid_Air-Coil_SML_2turn_HAM0231A","Inductor_SMD/L_Neosid_Air-Coil_SML_2turn_HDM0231A","Inductor_SMD/L_Neosid_Air-Coil_SML_3turn_HAM0331A","Inductor_SMD/L_Neosid_Air-Coil_SML_3turn_HDM0331A","Inductor_SMD/L_Neosid_Air-Coil_SML_4turn_HAM0431A","Inductor_SMD/L_Neosid_Air-Coil_SML_4turn_HDM0431A","Inductor_SMD/L_Neosid_Air-Coil_SML_5turn_HAM0531A","Inductor_SMD/L_Neosid_Air-Coil_SML_5turn_HDM0531A","Inductor_SMD/L_Neosid_Air-Coil_SML_6-10turn_HAM0631A-HAM1031A","Inductor_SMD/L_Neosid_Air-Coil_SML_6-10turn_HDM0431A-HDM1031A","Inductor_SMD/L_Neosid_Air-Coil_SML_6turn_HAM0631A","Inductor_SMD/L_Neosid_MicroCoil_Ms36-L","Inductor_SMD/L_Neosid_Ms42","Inductor_SMD/L_Neosid_Ms50","Inductor_SMD/L_Neosid_Ms50T","Inductor_SMD/L_Neosid_Ms85","Inductor_SMD/L_Neosid_Ms85T","Inductor_SMD/L_Neosid_Ms95","Inductor_SMD/L_Neosid_Ms95T","Inductor_SMD/L_Neosid_Ms95a","Inductor_SMD/L_Neosid_SM-NE127","Inductor_SMD/L_Neosid_SM-NE127_HandSoldering","Inductor_SMD/L_Neosid_SM-NE150","Inductor_SMD/L_Neosid_SM-NE95H","Inductor_SMD/L_Neosid_SM-PIC0512H","Inductor_SMD/L_Neosid_SM-PIC0602H","Inductor_SMD/L_Neosid_SM-PIC0612H","Inductor_SMD/L_Neosid_SM-PIC1004H","Inductor_SMD/L_Neosid_SMS-ME3010","Inductor_SMD/L_Neosid_SMS-ME3015","Inductor_SMD/L_Neosid_SMs42","Inductor_SMD/L_Neosid_SMs50","Inductor_SMD/L_Neosid_SMs85","Inductor_SMD/L_Neosid_SMs95_SMs95p","Inductor_SMD/L_Panasonic_PCC-M0530M","Inductor_SMD/L_Panasonic_PCC-M0540M","Inductor_SMD/L_Panasonic_PCC-M0630M","Inductor_SMD/L_Panasonic_PCC-M0645M","Inductor_SMD/L_Panasonic_PCC-M0750M","Inductor_SMD/L_Panasonic_PCC-M0754M","Inductor_SMD/L_Panasonic_PCC-M0850M","Inductor_SMD/L_Panasonic_PCC-M0854M","Inductor_SMD/L_Panasonic_PCC-M1040ML","Inductor_SMD/L_Panasonic_PCC-M1050M","Inductor_SMD/L_Panasonic_PCC-M1050ML","Inductor_SMD/L_Panasonic_PCC-M1054M","Inductor_SMD/L_Panasonic_PCC-M1060ML","Inductor_SMD/L_Pulse_P059x","Inductor_SMD/L_Pulse_PA4320","Inductor_SMD/L_Pulse_PA4332","Inductor_SMD/L_Pulse_PA4334","Inductor_SMD/L_Pulse_PA4340","Inductor_SMD/L_Pulse_PA4341","Inductor_SMD/L_Pulse_PA4344","Inductor_SMD/L_Pulse_PA4349","Inductor_SMD/L_Pulse_PA5402","Inductor_SMD/L_SOREDE_SNR.1050_10x10x5mm","Inductor_SMD/L_SXN_SMDRI124","Inductor_SMD/L_SXN_SMDRI125","Inductor_SMD/L_SXN_SMDRI127","Inductor_SMD/L_SXN_SMDRI62","Inductor_SMD/L_SXN_SMDRI64","Inductor_SMD/L_SXN_SMDRI73","Inductor_SMD/L_SXN_SMDRI74","Inductor_SMD/L_SXN_SMMS1770","Inductor_SMD/L_Sagami_CER1242B","Inductor_SMD/L_Sagami_CER1257B","Inductor_SMD/L_Sagami_CER1277B","Inductor_SMD/L_Sagami_CWR1242C","Inductor_SMD/L_Sagami_CWR1257C","Inductor_SMD/L_Sagami_CWR1277C","Inductor_SMD/L_SigTra_SC3316F","Inductor_SMD/L_Sumida_CDMC6D28_7.25x6.5mm","Inductor_SMD/L_Sumida_CR75","Inductor_SMD/L_Sunlord_MWSA0402S","Inductor_SMD/L_Sunlord_MWSA0412S","Inductor_SMD/L_Sunlord_MWSA0503S","Inductor_SMD/L_Sunlord_MWSA0518S","Inductor_SMD/L_Sunlord_MWSA0602S","Inductor_SMD/L_Sunlord_MWSA0603S","Inductor_SMD/L_Sunlord_MWSA0604S","Inductor_SMD/L_Sunlord_MWSA0605S","Inductor_SMD/L_Sunlord_MWSA0615S","Inductor_SMD/L_Sunlord_MWSA0618S","Inductor_SMD/L_Sunlord_MWSA0624S","Inductor_SMD/L_Sunlord_MWSA0804S","Inductor_SMD/L_Sunlord_MWSA1003S","Inductor_SMD/L_Sunlord_MWSA1004S","Inductor_SMD/L_Sunlord_MWSA1005S","Inductor_SMD/L_Sunlord_MWSA1204S-100","Inductor_SMD/L_Sunlord_MWSA1204S-150","Inductor_SMD/L_Sunlord_MWSA1204S-1R0","Inductor_SMD/L_Sunlord_MWSA1204S-1R5","Inductor_SMD/L_Sunlord_MWSA1204S-220","Inductor_SMD/L_Sunlord_MWSA1204S-2R2","Inductor_SMD/L_Sunlord_MWSA1204S-3R3","Inductor_SMD/L_Sunlord_MWSA1204S-4R7","Inductor_SMD/L_Sunlord_MWSA1204S-6R8","Inductor_SMD/L_Sunlord_MWSA1204S-R22","Inductor_SMD/L_Sunlord_MWSA1204S-R47","Inductor_SMD/L_Sunlord_MWSA1204S-R68","Inductor_SMD/L_Sunlord_MWSA1204S-R82","Inductor_SMD/L_Sunlord_MWSA1205S-100","Inductor_SMD/L_Sunlord_MWSA1205S-150","Inductor_SMD/L_Sunlord_MWSA1205S-1R0","Inductor_SMD/L_Sunlord_MWSA1205S-1R5","Inductor_SMD/L_Sunlord_MWSA1205S-220","Inductor_SMD/L_Sunlord_MWSA1205S-2R2","Inductor_SMD/L_Sunlord_MWSA1205S-330","Inductor_SMD/L_Sunlord_MWSA1205S-3R3","Inductor_SMD/L_Sunlord_MWSA1205S-470","Inductor_SMD/L_Sunlord_MWSA1205S-4R7","Inductor_SMD/L_Sunlord_MWSA1205S-6R8","Inductor_SMD/L_Sunlord_MWSA1205S-R22","Inductor_SMD/L_Sunlord_MWSA1205S-R36","Inductor_SMD/L_Sunlord_MWSA1205S-R50","Inductor_SMD/L_Sunlord_MWSA1205S-R68","Inductor_SMD/L_Sunlord_MWSA1205S-R82","Inductor_SMD/L_Sunlord_MWSA1206S-100","Inductor_SMD/L_Sunlord_MWSA1206S-101","Inductor_SMD/L_Sunlord_MWSA1206S-120","Inductor_SMD/L_Sunlord_MWSA1206S-121","Inductor_SMD/L_Sunlord_MWSA1206S-150","Inductor_SMD/L_Sunlord_MWSA1206S-151","Inductor_SMD/L_Sunlord_MWSA1206S-180","Inductor_SMD/L_Sunlord_MWSA1206S-1R5","Inductor_SMD/L_Sunlord_MWSA1206S-220","Inductor_SMD/L_Sunlord_MWSA1206S-270","Inductor_SMD/L_Sunlord_MWSA1206S-2R2","Inductor_SMD/L_Sunlord_MWSA1206S-330","Inductor_SMD/L_Sunlord_MWSA1206S-3R3","Inductor_SMD/L_Sunlord_MWSA1206S-470","Inductor_SMD/L_Sunlord_MWSA1206S-4R7","Inductor_SMD/L_Sunlord_MWSA1206S-5R6","Inductor_SMD/L_Sunlord_MWSA1206S-680","Inductor_SMD/L_Sunlord_MWSA1206S-6R8","Inductor_SMD/L_Sunlord_MWSA1206S-8R2","Inductor_SMD/L_Sunlord_MWSA1206S-R68","Inductor_SMD/L_Sunlord_MWSA1265S","Inductor_SMD/L_Sunlord_MWSA1707S","Inductor_SMD/L_Sunlord_MWSA2213S","Inductor_SMD/L_Sunlord_SWPA252010S","Inductor_SMD/L_Sunlord_SWPA252012S","Inductor_SMD/L_Sunlord_SWPA3010S","Inductor_SMD/L_Sunlord_SWPA3012S","Inductor_SMD/L_Sunlord_SWPA3015S","Inductor_SMD/L_Sunlord_SWPA4010S","Inductor_SMD/L_Sunlord_SWPA4012S","Inductor_SMD/L_Sunlord_SWPA4018S","Inductor_SMD/L_Sunlord_SWPA4020S","Inductor_SMD/L_Sunlord_SWPA4026S","Inductor_SMD/L_Sunlord_SWPA4030S","Inductor_SMD/L_Sunlord_SWPA5012S","Inductor_SMD/L_Sunlord_SWPA5020S","Inductor_SMD/L_Sunlord_SWPA5040S","Inductor_SMD/L_Sunlord_SWPA6020S","Inductor_SMD/L_Sunlord_SWPA6028S","Inductor_SMD/L_Sunlord_SWPA6040S","Inductor_SMD/L_Sunlord_SWPA6045S","Inductor_SMD/L_Sunlord_SWPA8040S","Inductor_SMD/L_Sunlord_SWRB1204S","Inductor_SMD/L_Sunlord_SWRB1205S","Inductor_SMD/L_Sunlord_SWRB1207S","Inductor_SMD/L_TDK_MLZ1608","Inductor_SMD/L_TDK_MLZ2012_h0.85mm","Inductor_SMD/L_TDK_MLZ2012_h1.25mm","Inductor_SMD/L_TDK_NLV25_2.5x2.0mm","Inductor_SMD/L_TDK_NLV32_3.2x2.5mm","Inductor_SMD/L_TDK_SLF10145","Inductor_SMD/L_TDK_SLF10165","Inductor_SMD/L_TDK_SLF12555","Inductor_SMD/L_TDK_SLF12565","Inductor_SMD/L_TDK_SLF12575","Inductor_SMD/L_TDK_SLF6025","Inductor_SMD/L_TDK_SLF6028","Inductor_SMD/L_TDK_SLF6045","Inductor_SMD/L_TDK_SLF7032","Inductor_SMD/L_TDK_SLF7045","Inductor_SMD/L_TDK_SLF7055","Inductor_SMD/L_TDK_VLF10040","Inductor_SMD/L_TDK_VLP8040","Inductor_SMD/L_TDK_VLS6045EX_VLS6045AF","Inductor_SMD/L_TaiTech_TMPC1265_13.5x12.5mm","Inductor_SMD/L_Taiyo-Yuden_BK_Array_1206_3216Metric","Inductor_SMD/L_Taiyo-Yuden_MD-1616","Inductor_SMD/L_Taiyo-Yuden_MD-2020","Inductor_SMD/L_Taiyo-Yuden_MD-3030","Inductor_SMD/L_Taiyo-Yuden_MD-4040","Inductor_SMD/L_Taiyo-Yuden_MD-5050","Inductor_SMD/L_Taiyo-Yuden_NR-10050_9.8x10.0mm","Inductor_SMD/L_Taiyo-Yuden_NR-10050_9.8x10.0mm_HandSoldering","Inductor_SMD/L_Taiyo-Yuden_NR-20xx","Inductor_SMD/L_Taiyo-Yuden_NR-20xx_HandSoldering","Inductor_SMD/L_Taiyo-Yuden_NR-24xx","Inductor_SMD/L_Taiyo-Yuden_NR-24xx_HandSoldering","Inductor_SMD/L_Taiyo-Yuden_NR-30xx","Inductor_SMD/L_Taiyo-Yuden_NR-30xx_HandSoldering","Inductor_SMD/L_Taiyo-Yuden_NR-40xx","Inductor_SMD/L_Taiyo-Yuden_NR-40xx_HandSoldering","Inductor_SMD/L_Taiyo-Yuden_NR-50xx","Inductor_SMD/L_Taiyo-Yuden_NR-50xx_HandSoldering","Inductor_SMD/L_Taiyo-Yuden_NR-60xx","Inductor_SMD/L_Taiyo-Yuden_NR-60xx_HandSoldering","Inductor_SMD/L_Taiyo-Yuden_NR-80xx","Inductor_SMD/L_Taiyo-Yuden_NR-80xx_HandSoldering","Inductor_SMD/L_TechFuse_SL0420","Inductor_SMD/L_TechFuse_SL0520","Inductor_SMD/L_TechFuse_SL0530","Inductor_SMD/L_TechFuse_SL0620","Inductor_SMD/L_TechFuse_SL0624","Inductor_SMD/L_TechFuse_SL0630","Inductor_SMD/L_TechFuse_SL0650","Inductor_SMD/L_TechFuse_SL1040","Inductor_SMD/L_TechFuse_SL1050","Inductor_SMD/L_TechFuse_SL1250","Inductor_SMD/L_TechFuse_SL1265","Inductor_SMD/L_TracoPower_TCK-047_5.2x5.8mm","Inductor_SMD/L_TracoPower_TCK-141","Inductor_SMD/L_Vishay_IFSC-1515AH_4x4x1.8mm","Inductor_SMD/L_Vishay_IHLP-1212","Inductor_SMD/L_Vishay_IHLP-1616","Inductor_SMD/L_Vishay_IHLP-2020","Inductor_SMD/L_Vishay_IHLP-2525","Inductor_SMD/L_Vishay_IHLP-3232","Inductor_SMD/L_Vishay_IHLP-4040","Inductor_SMD/L_Vishay_IHLP-5050","Inductor_SMD/L_Vishay_IHLP-6767","Inductor_SMD/L_Vishay_IHSM-3825","Inductor_SMD/L_Vishay_IHSM-4825","Inductor_SMD/L_Vishay_IHSM-5832","Inductor_SMD/L_Vishay_IHSM-7832","Inductor_SMD/L_Walsin_WLFM201209x","Inductor_SMD/L_Walsin_WLFM201609x","Inductor_SMD/L_Walsin_WLFM252009x","Inductor_SMD/L_Wuerth_HCF-2013","Inductor_SMD/L_Wuerth_HCF-2815","Inductor_SMD/L_Wuerth_HCF-2818","Inductor_SMD/L_Wuerth_HCI-1030","Inductor_SMD/L_Wuerth_HCI-1040","Inductor_SMD/L_Wuerth_HCI-1050","Inductor_SMD/L_Wuerth_HCI-1335","Inductor_SMD/L_Wuerth_HCI-1350","Inductor_SMD/L_Wuerth_HCI-1365","Inductor_SMD/L_Wuerth_HCI-1890","Inductor_SMD/L_Wuerth_HCI-2212","Inductor_SMD/L_Wuerth_HCI-5040","Inductor_SMD/L_Wuerth_HCI-7030","Inductor_SMD/L_Wuerth_HCI-7040","Inductor_SMD/L_Wuerth_HCI-7050","Inductor_SMD/L_Wuerth_HCM-1050","Inductor_SMD/L_Wuerth_HCM-1052","Inductor_SMD/L_Wuerth_HCM-1070","Inductor_SMD/L_Wuerth_HCM-1078","Inductor_SMD/L_Wuerth_HCM-1190","Inductor_SMD/L_Wuerth_HCM-1240","Inductor_SMD/L_Wuerth_HCM-1350","Inductor_SMD/L_Wuerth_HCM-1390","Inductor_SMD/L_Wuerth_HCM-7050","Inductor_SMD/L_Wuerth_HCM-7070","Inductor_SMD/L_Wuerth_LQFS-3818","Inductor_SMD/L_Wuerth_LQFS-4818","Inductor_SMD/L_Wuerth_LQFS-4828","Inductor_SMD/L_Wuerth_MAPI-1610","Inductor_SMD/L_Wuerth_MAPI-2010","Inductor_SMD/L_Wuerth_MAPI-2506","Inductor_SMD/L_Wuerth_MAPI-2508","Inductor_SMD/L_Wuerth_MAPI-2510","Inductor_SMD/L_Wuerth_MAPI-2512","Inductor_SMD/L_Wuerth_MAPI-3010","Inductor_SMD/L_Wuerth_MAPI-3012","Inductor_SMD/L_Wuerth_MAPI-3015","Inductor_SMD/L_Wuerth_MAPI-3020","Inductor_SMD/L_Wuerth_MAPI-4020","Inductor_SMD/L_Wuerth_MAPI-4030","Inductor_SMD/L_Wuerth_MAPI-5020","Inductor_SMD/L_Wuerth_MAPI-5030","Inductor_SMD/L_Wuerth_PMCI-160808","Inductor_SMD/L_Wuerth_PMCI-201210","Inductor_SMD/L_Wuerth_PMCI-201610","Inductor_SMD/L_Wuerth_PMCI-252010","Inductor_SMD/L_Wuerth_PMCI-252012","Inductor_SMD/L_Wuerth_PMCI-322510","Inductor_SMD/L_Wuerth_PMCI-322512","Inductor_SMD/L_Wuerth_PMCI-322515","Inductor_SMD/L_Wuerth_PMFI-201610","Inductor_SMD/L_Wuerth_PMFI-201610_PMCI-compatible","Inductor_SMD/L_Wuerth_PMFI-252012","Inductor_SMD/L_Wuerth_PMFI-252012_PMCI-compatible","Inductor_SMD/L_Wuerth_PMFI-322512","Inductor_SMD/L_Wuerth_PMFI-322512_PMCI-compatible","Inductor_SMD/L_Wuerth_PMFI-353220","Inductor_SMD/L_Wuerth_WE-DD-Typ-L-Typ-XL-Typ-XXL","Inductor_SMD/L_Wuerth_WE-DD-Typ-M-Typ-S","Inductor_SMD/L_Wuerth_WE-GF-1210","Inductor_SMD/L_Wuerth_WE-PD-Typ-7345","Inductor_SMD/L_Wuerth_WE-PD-Typ-LS","Inductor_SMD/L_Wuerth_WE-PD-Typ-LS_Handsoldering","Inductor_SMD/L_Wuerth_WE-PD-Typ-M-Typ-S","Inductor_SMD/L_Wuerth_WE-PD-Typ-M-Typ-S_Handsoldering","Inductor_SMD/L_Wuerth_WE-PD2-Typ-L","Inductor_SMD/L_Wuerth_WE-PD2-Typ-MS","Inductor_SMD/L_Wuerth_WE-PD2-Typ-XL","Inductor_SMD/L_Wuerth_WE-PD4-Typ-X","Inductor_SMD/L_Wuerth_WE-PDF","Inductor_SMD/L_Wuerth_WE-PDF_Handsoldering","Inductor_SMD/L_Wuerth_WE-TPC-3816","Inductor_SMD/L_Wuerth_XHMI-6060","Inductor_SMD/L_Wuerth_XHMI-8080","Inductor_SMD/L_Wurth_WE-CAIR-5910","Inductor_SMD_Wurth/L_Wurth_WE-LQSH-2010","Inductor_SMD_Wurth/L_Wurth_WE-LQSH-2512","Inductor_SMD_Wurth/L_Wurth_WE-LQSH-3012","Inductor_SMD_Wurth/L_Wurth_WE-LQSH-4020","Inductor_THT/Choke_EPCOS_B82722A","Inductor_THT/Choke_Schaffner_RN102-04-14.0x14.0mm","Inductor_THT/Choke_Schaffner_RN112-04-17.7x17.1mm","Inductor_THT/Choke_Schaffner_RN114-04-22.5x21.5mm","Inductor_THT/Choke_Schaffner_RN116-04-22.5x21.5mm","Inductor_THT/Choke_Schaffner_RN122-04-28.0x27.0mm","Inductor_THT/Choke_Schaffner_RN142-04-33.1x32.5mm","Inductor_THT/Choke_Schaffner_RN143-04-33.1x32.5mm","Inductor_THT/Choke_Schaffner_RN152-04-43.0x41.8mm","Inductor_THT/Choke_Schaffner_RN202-04-8.8x18.2mm","Inductor_THT/Choke_Schaffner_RN204-04-9.0x14.0mm","Inductor_THT/Choke_Schaffner_RN212-04-12.5x18.0mm","Inductor_THT/Choke_Schaffner_RN214-04-15.5x23.0mm","Inductor_THT/Choke_Schaffner_RN216-04-15.5x23.0mm","Inductor_THT/Choke_Schaffner_RN218-04-12.5x18.0mm","Inductor_THT/Choke_Schaffner_RN222-04-18.0x31.0mm","Inductor_THT/Choke_Schaffner_RN232-04-18.0x31.0mm","Inductor_THT/Choke_Schaffner_RN242-04-18.0x31.0mm","Inductor_THT/L_Axial_L11.0mm_D4.5mm_P15.24mm_Horizontal_Fastron_MECC","Inductor_THT/L_Axial_L11.0mm_D4.5mm_P5.08mm_Vertical_Fastron_MECC","Inductor_THT/L_Axial_L11.0mm_D4.5mm_P7.62mm_Vertical_Fastron_MECC","Inductor_THT/L_Axial_L12.0mm_D5.0mm_P15.24mm_Horizontal_Fastron_MISC","Inductor_THT/L_Axial_L12.0mm_D5.0mm_P5.08mm_Vertical_Fastron_MISC","Inductor_THT/L_Axial_L12.0mm_D5.0mm_P7.62mm_Vertical_Fastron_MISC","Inductor_THT/L_Axial_L12.8mm_D5.8mm_P20.32mm_Horizontal_Fastron_HBCC","Inductor_THT/L_Axial_L12.8mm_D5.8mm_P25.40mm_Horizontal_Fastron_HBCC","Inductor_THT/L_Axial_L12.8mm_D5.8mm_P5.08mm_Vertical_Fastron_HBCC","Inductor_THT/L_Axial_L12.8mm_D5.8mm_P7.62mm_Vertical_Fastron_HBCC","Inductor_THT/L_Axial_L13.0mm_D4.5mm_P15.24mm_Horizontal_Fastron_HCCC","Inductor_THT/L_Axial_L13.0mm_D4.5mm_P5.08mm_Vertical_Fastron_HCCC","Inductor_THT/L_Axial_L13.0mm_D4.5mm_P7.62mm_Vertical_Fastron_HCCC","Inductor_THT/L_Axial_L14.0mm_D4.5mm_P15.24mm_Horizontal_Fastron_LACC","Inductor_THT/L_Axial_L14.0mm_D4.5mm_P5.08mm_Vertical_Fastron_LACC","Inductor_THT/L_Axial_L14.0mm_D4.5mm_P7.62mm_Vertical_Fastron_LACC","Inductor_THT/L_Axial_L14.5mm_D5.8mm_P20.32mm_Horizontal_Fastron_HBCC","Inductor_THT/L_Axial_L14.5mm_D5.8mm_P25.40mm_Horizontal_Fastron_HBCC","Inductor_THT/L_Axial_L14.5mm_D5.8mm_P5.08mm_Vertical_Fastron_HBCC","Inductor_THT/L_Axial_L14.5mm_D5.8mm_P7.62mm_Vertical_Fastron_HBCC","Inductor_THT/L_Axial_L16.0mm_D6.3mm_P20.32mm_Horizontal_Fastron_VHBCC","Inductor_THT/L_Axial_L16.0mm_D6.3mm_P25.40mm_Horizontal_Fastron_VHBCC","Inductor_THT/L_Axial_L16.0mm_D6.3mm_P5.08mm_Vertical_Fastron_VHBCC","Inductor_THT/L_Axial_L16.0mm_D6.3mm_P7.62mm_Vertical_Fastron_VHBCC","Inductor_THT/L_Axial_L16.0mm_D7.5mm_P20.32mm_Horizontal_Fastron_XHBCC","Inductor_THT/L_Axial_L16.0mm_D7.5mm_P25.40mm_Horizontal_Fastron_XHBCC","Inductor_THT/L_Axial_L16.0mm_D7.5mm_P5.08mm_Vertical_Fastron_XHBCC","Inductor_THT/L_Axial_L16.0mm_D7.5mm_P7.62mm_Vertical_Fastron_XHBCC","Inductor_THT/L_Axial_L16.0mm_D9.5mm_P20.32mm_Horizontal_Vishay_IM-10-37","Inductor_THT/L_Axial_L16.0mm_D9.5mm_P5.08mm_Vertical_Vishay_IM-10-37","Inductor_THT/L_Axial_L17.5mm_D12.0mm_P20.32mm_Horizontal_Vishay_IM-10-46","Inductor_THT/L_Axial_L17.5mm_D12.0mm_P7.62mm_Vertical_Vishay_IM-10-46","Inductor_THT/L_Axial_L20.0mm_D8.0mm_P25.40mm_Horizontal","Inductor_THT/L_Axial_L20.0mm_D8.0mm_P5.08mm_Vertical","Inductor_THT/L_Axial_L20.0mm_D8.0mm_P7.62mm_Vertical","Inductor_THT/L_Axial_L20.3mm_D12.1mm_P28.50mm_Horizontal_Vishay_IHA-101","Inductor_THT/L_Axial_L20.3mm_D12.1mm_P7.62mm_Vertical_Vishay_IHA-101","Inductor_THT/L_Axial_L20.3mm_D12.7mm_P25.40mm_Horizontal_Vishay_IHA-201","Inductor_THT/L_Axial_L20.3mm_D12.7mm_P7.62mm_Vertical_Vishay_IHA-201","Inductor_THT/L_Axial_L23.4mm_D12.7mm_P32.00mm_Horizontal_Vishay_IHA-203","Inductor_THT/L_Axial_L23.4mm_D12.7mm_P7.62mm_Vertical_Vishay_IHA-203","Inductor_THT/L_Axial_L24.0mm_D7.1mm_P30.48mm_Horizontal_Vishay_IM-10-28","Inductor_THT/L_Axial_L24.0mm_D7.1mm_P5.08mm_Vertical_Vishay_IM-10-28","Inductor_THT/L_Axial_L24.0mm_D7.5mm_P27.94mm_Horizontal_Fastron_MESC","Inductor_THT/L_Axial_L24.0mm_D7.5mm_P5.08mm_Vertical_Fastron_MESC","Inductor_THT/L_Axial_L24.0mm_D7.5mm_P7.62mm_Vertical_Fastron_MESC","Inductor_THT/L_Axial_L26.0mm_D10.0mm_P30.48mm_Horizontal_Fastron_77A","Inductor_THT/L_Axial_L26.0mm_D10.0mm_P5.08mm_Vertical_Fastron_77A","Inductor_THT/L_Axial_L26.0mm_D10.0mm_P7.62mm_Vertical_Fastron_77A","Inductor_THT/L_Axial_L26.0mm_D11.0mm_P30.48mm_Horizontal_Fastron_77A","Inductor_THT/L_Axial_L26.0mm_D11.0mm_P5.08mm_Vertical_Fastron_77A","Inductor_THT/L_Axial_L26.0mm_D11.0mm_P7.62mm_Vertical_Fastron_77A","Inductor_THT/L_Axial_L26.0mm_D9.0mm_P30.48mm_Horizontal_Fastron_77A","Inductor_THT/L_Axial_L26.0mm_D9.0mm_P5.08mm_Vertical_Fastron_77A","Inductor_THT/L_Axial_L26.0mm_D9.0mm_P7.62mm_Vertical_Fastron_77A","Inductor_THT/L_Axial_L26.7mm_D12.1mm_P35.00mm_Horizontal_Vishay_IHA-103","Inductor_THT/L_Axial_L26.7mm_D12.1mm_P7.62mm_Vertical_Vishay_IHA-103","Inductor_THT/L_Axial_L26.7mm_D14.0mm_P35.00mm_Horizontal_Vishay_IHA-104","Inductor_THT/L_Axial_L26.7mm_D14.0mm_P7.62mm_Vertical_Vishay_IHA-104","Inductor_THT/L_Axial_L29.9mm_D14.0mm_P38.00mm_Horizontal_Vishay_IHA-105","Inductor_THT/L_Axial_L29.9mm_D14.0mm_P7.62mm_Vertical_Vishay_IHA-105","Inductor_THT/L_Axial_L30.0mm_D8.0mm_P35.56mm_Horizontal_Fastron_77A","Inductor_THT/L_Axial_L30.0mm_D8.0mm_P5.08mm_Vertical_Fastron_77A","Inductor_THT/L_Axial_L30.0mm_D8.0mm_P7.62mm_Vertical_Fastron_77A","Inductor_THT/L_Axial_L5.0mm_D3.6mm_P10.00mm_Horizontal_Murata_BL01RN1A2A2","Inductor_THT/L_Axial_L5.3mm_D2.2mm_P10.16mm_Horizontal_Vishay_IM-1","Inductor_THT/L_Axial_L5.3mm_D2.2mm_P2.54mm_Vertical_Vishay_IM-1","Inductor_THT/L_Axial_L5.3mm_D2.2mm_P7.62mm_Horizontal_Vishay_IM-1","Inductor_THT/L_Axial_L6.6mm_D2.7mm_P10.16mm_Horizontal_Vishay_IM-2","Inductor_THT/L_Axial_L6.6mm_D2.7mm_P2.54mm_Vertical_Vishay_IM-2","Inductor_THT/L_Axial_L7.0mm_D3.3mm_P10.16mm_Horizontal_Fastron_MICC","Inductor_THT/L_Axial_L7.0mm_D3.3mm_P12.70mm_Horizontal_Fastron_MICC","Inductor_THT/L_Axial_L7.0mm_D3.3mm_P2.54mm_Vertical_Fastron_MICC","Inductor_THT/L_Axial_L7.0mm_D3.3mm_P5.08mm_Vertical_Fastron_MICC","Inductor_THT/L_Axial_L9.5mm_D4.0mm_P12.70mm_Horizontal_Fastron_SMCC","Inductor_THT/L_Axial_L9.5mm_D4.0mm_P15.24mm_Horizontal_Fastron_SMCC","Inductor_THT/L_Axial_L9.5mm_D4.0mm_P2.54mm_Vertical_Fastron_SMCC","Inductor_THT/L_Axial_L9.5mm_D4.0mm_P5.08mm_Vertical_Fastron_SMCC","Inductor_THT/L_CommonMode_PulseElectronics_PH9455x105NL_1","Inductor_THT/L_CommonMode_PulseElectronics_PH9455x155NL_1","Inductor_THT/L_CommonMode_PulseElectronics_PH9455x205NL_1","Inductor_THT/L_CommonMode_PulseElectronics_PH9455x405NL_1","Inductor_THT/L_CommonMode_PulseElectronics_PH9455x705NL_1","Inductor_THT/L_CommonMode_PulseElectronics_PH9455xxx6NL_2","Inductor_THT/L_CommonMode_TDK_B82746S4143A040","Inductor_THT/L_CommonMode_TDK_B82746S6702A040","Inductor_THT/L_CommonMode_TDK_B82747E6163A040","Inductor_THT/L_CommonMode_TDK_B82747E6203A040","Inductor_THT/L_CommonMode_TDK_B82747E6253A040","Inductor_THT/L_CommonMode_TDK_B82747E6353A040","Inductor_THT/L_CommonMode_TDK_B82767S4123N030","Inductor_THT/L_CommonMode_TDK_B82767S4193N030","Inductor_THT/L_CommonMode_TDK_B82767S4263N030","Inductor_THT/L_CommonMode_Toroid_Vertical_L13.0mm_W7.5mm_Px6.00mm_Py5.00mm_PRODTech_PDMCAT1065","Inductor_THT/L_CommonMode_Toroid_Vertical_L19.3mm_W10.8mm_Px6.35mm_Py15.24mm_Bourns_8100","Inductor_THT/L_CommonMode_Toroid_Vertical_L21.0mm_W10.0mm_Px5.08mm_Py12.70mm_Murata_5100","Inductor_THT/L_CommonMode_Toroid_Vertical_L22.0mm_W12.0mm_Px9.00mm_Py8.00mm_PRODTech_PDMCAT18107-102ML","Inductor_THT/L_CommonMode_Toroid_Vertical_L22.0mm_W12.0mm_Px9.00mm_Py8.00mm_PRODTech_PDMCAT18107-103ML","Inductor_THT/L_CommonMode_Toroid_Vertical_L22.0mm_W12.0mm_Px9.00mm_Py8.00mm_PRODTech_PDMCAT18107-202ML","Inductor_THT/L_CommonMode_Toroid_Vertical_L22.0mm_W12.0mm_Px9.00mm_Py8.00mm_PRODTech_PDMCAT18107-203ML","Inductor_THT/L_CommonMode_Toroid_Vertical_L22.0mm_W12.0mm_Px9.00mm_Py8.00mm_PRODTech_PDMCAT18107-502ML","Inductor_THT/L_CommonMode_Toroid_Vertical_L24.0mm_W16.3mm_Px10.16mm_Py20.32mm_Murata_5200","Inductor_THT/L_CommonMode_Toroid_Vertical_L30.5mm_W15.2mm_Px10.16mm_Py20.32mm_Bourns_8100","Inductor_THT/L_CommonMode_Toroid_Vertical_L34.3mm_W20.3mm_Px15.24mm_Py22.86mm_Bourns_8100","Inductor_THT/L_CommonMode_Toroid_Vertical_L36.8mm_W20.3mm_Px15.24mm_Py22.86mm_Bourns_8100","Inductor_THT/L_CommonMode_Toroid_Vertical_L38.1mm_W20.3mm_Px15.24mm_Py22.86mm_Bourns_8100","Inductor_THT/L_CommonMode_Toroid_Vertical_L39.4mm_W20.3mm_Px15.24mm_Py22.86mm_Bourns_8100","Inductor_THT/L_CommonMode_Toroid_Vertical_L41.9mm_W20.3mm_Px15.24mm_Py22.86mm_Bourns_8100","Inductor_THT/L_CommonMode_Toroid_Vertical_L43.2mm_W22.9mm_Px17.78mm_Py30.48mm_Bourns_8100","Inductor_THT/L_CommonMode_VAC_T60405-S6123-X140","Inductor_THT/L_CommonMode_VAC_T60405-S6123-X240","Inductor_THT/L_CommonMode_VAC_T60405-S6123-X402","Inductor_THT/L_CommonMode_Wuerth_WE-CMB-L","Inductor_THT/L_CommonMode_Wuerth_WE-CMB-M","Inductor_THT/L_CommonMode_Wuerth_WE-CMB-S","Inductor_THT/L_CommonMode_Wuerth_WE-CMB-XL","Inductor_THT/L_CommonMode_Wuerth_WE-CMB-XS","Inductor_THT/L_CommonMode_Wuerth_WE-CMB-XXL","Inductor_THT/L_Mount_Lodestone_VTM120","Inductor_THT/L_Mount_Lodestone_VTM160","Inductor_THT/L_Mount_Lodestone_VTM254","Inductor_THT/L_Mount_Lodestone_VTM280","Inductor_THT/L_Mount_Lodestone_VTM950-6","Inductor_THT/L_Radial_D10.0mm_P5.00mm_Fastron_07M","Inductor_THT/L_Radial_D10.0mm_P5.00mm_Fastron_07P","Inductor_THT/L_Radial_D10.0mm_P5.00mm_Neosid_SD12_style3","Inductor_THT/L_Radial_D10.0mm_P5.00mm_Neosid_SD12k_style3","Inductor_THT/L_Radial_D10.5mm_P4.00x5.00mm_Murata_1200RS","Inductor_THT/L_Radial_D10.5mm_P5.00mm_Abacron_AISR-01","Inductor_THT/L_Radial_D12.0mm_P10.00mm_Neosid_SD12_style1","Inductor_THT/L_Radial_D12.0mm_P10.00mm_Neosid_SD12k_style1","Inductor_THT/L_Radial_D12.0mm_P5.00mm_Fastron_11P","Inductor_THT/L_Radial_D12.0mm_P5.00mm_Neosid_SD12_style2","Inductor_THT/L_Radial_D12.0mm_P5.00mm_Neosid_SD12k_style2","Inductor_THT/L_Radial_D12.0mm_P6.00mm_Murata_1900R","Inductor_THT/L_Radial_D12.5mm_P7.00mm_Fastron_09HCP","Inductor_THT/L_Radial_D12.5mm_P9.00mm_Fastron_09HCP","Inductor_THT/L_Radial_D13.5mm_P7.00mm_Fastron_09HCP","Inductor_THT/L_Radial_D14.2mm_P10.00mm_Neosid_SD14","Inductor_THT/L_Radial_D16.0mm_P10.00mm_Panasonic_15E-L","Inductor_THT/L_Radial_D16.8mm_P11.43mm_Vishay_IHB-1","Inductor_THT/L_Radial_D16.8mm_P12.07mm_Vishay_IHB-1","Inductor_THT/L_Radial_D16.8mm_P12.70mm_Vishay_IHB-1","Inductor_THT/L_Radial_D18.0mm_P10.00mm","Inductor_THT/L_Radial_D21.0mm_P14.61mm_Vishay_IHB-2","Inductor_THT/L_Radial_D21.0mm_P15.00mm_Vishay_IHB-2","Inductor_THT/L_Radial_D21.0mm_P15.24mm_Vishay_IHB-2","Inductor_THT/L_Radial_D21.0mm_P15.75mm_Vishay_IHB-2","Inductor_THT/L_Radial_D21.0mm_P19.00mm","Inductor_THT/L_Radial_D24.0mm_P24.00mm","Inductor_THT/L_Radial_D24.4mm_P22.90mm_Murata_1400series","Inductor_THT/L_Radial_D24.4mm_P23.10mm_Murata_1400series","Inductor_THT/L_Radial_D24.4mm_P23.40mm_Murata_1400series","Inductor_THT/L_Radial_D24.4mm_P23.70mm_Murata_1400series","Inductor_THT/L_Radial_D24.4mm_P23.90mm_Murata_1400series","Inductor_THT/L_Radial_D27.9mm_P18.29mm_Vishay_IHB-3","Inductor_THT/L_Radial_D27.9mm_P19.05mm_Vishay_IHB-3","Inductor_THT/L_Radial_D27.9mm_P20.07mm_Vishay_IHB-3","Inductor_THT/L_Radial_D28.0mm_P29.20mm","Inductor_THT/L_Radial_D29.8mm_P28.30mm_Murata_1400series","Inductor_THT/L_Radial_D29.8mm_P28.50mm_Murata_1400series","Inductor_THT/L_Radial_D29.8mm_P28.80mm_Murata_1400series","Inductor_THT/L_Radial_D29.8mm_P29.00mm_Murata_1400series","Inductor_THT/L_Radial_D29.8mm_P29.30mm_Murata_1400series","Inductor_THT/L_Radial_D40.6mm_P26.16mm_Vishay_IHB-5","Inductor_THT/L_Radial_D40.6mm_P27.18mm_Vishay_IHB-4","Inductor_THT/L_Radial_D40.6mm_P27.94mm_Vishay_IHB-4","Inductor_THT/L_Radial_D40.6mm_P27.94mm_Vishay_IHB-5","Inductor_THT/L_Radial_D40.6mm_P28.70mm_Vishay_IHB-5","Inductor_THT/L_Radial_D50.8mm_P33.27mm_Vishay_IHB-6","Inductor_THT/L_Radial_D50.8mm_P34.29mm_Vishay_IHB-6","Inductor_THT/L_Radial_D50.8mm_P35.81mm_Vishay_IHB-6","Inductor_THT/L_Radial_D50.8mm_P36.32mm_Vishay_IHB-6","Inductor_THT/L_Radial_D50.8mm_P38.86mm_Vishay_IHB-6","Inductor_THT/L_Radial_D6.0mm_P4.00mm","Inductor_THT/L_Radial_D7.0mm_P3.00mm","Inductor_THT/L_Radial_D7.2mm_P3.00mm_Murata_1700","Inductor_THT/L_Radial_D7.5mm_P3.50mm_Fastron_07P","Inductor_THT/L_Radial_D7.5mm_P5.00mm_Fastron_07P","Inductor_THT/L_Radial_D7.8mm_P5.00mm_Fastron_07HCP","Inductor_THT/L_Radial_D8.7mm_P5.00mm_Fastron_07HCP","Inductor_THT/L_Radial_D9.5mm_P5.00mm_Fastron_07HVP","Inductor_THT/L_Radial_L10.2mm_W10.2mm_Px7.62mm_Py7.62mm_Pulse_LP-30","Inductor_THT/L_Radial_L11.5mm_W11.5mm_Px6.00mm_Py6.00mm_Neosid_NE-CPB-11EN_Drill1.3mm","Inductor_THT/L_Radial_L11.5mm_W11.5mm_Px6.00mm_Py6.00mm_Neosid_NE-CPB-11EN_Drill1.5mm","Inductor_THT/L_Radial_L11.5mm_W11.5mm_Px6.00mm_Py6.00mm_Neosid_NE-CPB-11EN_Drill1.7mm","Inductor_THT/L_Radial_L11.5mm_W11.5mm_Px6.00mm_Py6.00mm_Neosid_NE-CPB-11EN_Drill1.8mm","Inductor_THT/L_Radial_L12.6mm_W12.6mm_Px9.52mm_Py9.52mm_Pulse_LP-37","Inductor_THT/L_Radial_L16.1mm_W16.1mm_Px7.62mm_Py12.70mm_Pulse_LP-44","Inductor_THT/L_Radial_L7.5mm_W4.6mm_P5.00mm_Neosid_SD75","Inductor_THT/L_Radial_L8.0mm_W8.0mm_P5.00mm_Neosid_NE-CPB-07E","Inductor_THT/L_Radial_L8.0mm_W8.0mm_P5.00mm_Neosid_SD8","Inductor_THT/L_Radial_L9.1mm_W9.1mm_Px6.35mm_Py6.35mm_Pulse_LP-25","Inductor_THT/L_SELF1408","Inductor_THT/L_SELF1418","Inductor_THT/L_Toroid_Horizontal_D11.2mm_P17.00mm_Diameter12-5mm_Amidon-T44","Inductor_THT/L_Toroid_Horizontal_D12.7mm_P20.00mm_Diameter14-5mm_Amidon-T50","Inductor_THT/L_Toroid_Horizontal_D16.8mm_P14.70mm_Vishay_TJ3","Inductor_THT/L_Toroid_Horizontal_D16.8mm_P14.70mm_Vishay_TJ3_BigPads","Inductor_THT/L_Toroid_Horizontal_D17.3mm_P15.24mm_Bourns_2000","Inductor_THT/L_Toroid_Horizontal_D21.8mm_P19.10mm_Bourns_2100","Inductor_THT/L_Toroid_Horizontal_D21.8mm_P19.60mm_Bourns_2100","Inductor_THT/L_Toroid_Horizontal_D22.4mm_P19.80mm_Vishay_TJ4","Inductor_THT/L_Toroid_Horizontal_D24.1mm_P21.80mm_Bourns_2200","Inductor_THT/L_Toroid_Horizontal_D24.1mm_P23.10mm_Bourns_2200","Inductor_THT/L_Toroid_Horizontal_D25.4mm_P22.90mm_Vishay_TJ5","Inductor_THT/L_Toroid_Horizontal_D25.4mm_P22.90mm_Vishay_TJ5_BigPads","Inductor_THT/L_Toroid_Horizontal_D26.0mm_P5.08mm","Inductor_THT/L_Toroid_Horizontal_D28.0mm_P25.10mm_Bourns_2200","Inductor_THT/L_Toroid_Horizontal_D28.0mm_P26.67mm_Bourns_2200","Inductor_THT/L_Toroid_Horizontal_D3.2mm_P6.40mm_Diameter3-5mm_Amidon-T12","Inductor_THT/L_Toroid_Horizontal_D32.5mm_P28.90mm_Bourns_2300","Inductor_THT/L_Toroid_Horizontal_D32.5mm_P30.00mm_Bourns_2300","Inductor_THT/L_Toroid_Horizontal_D35.1mm_P31.00mm_Vishay_TJ6","Inductor_THT/L_Toroid_Horizontal_D4.1mm_P8.00mm_Diameter4-5mm_Amidon-T16","Inductor_THT/L_Toroid_Horizontal_D40.0mm_P48.26mm","Inductor_THT/L_Toroid_Horizontal_D41.9mm_P37.60mm_Vishay_TJ7","Inductor_THT/L_Toroid_Horizontal_D49.3mm_P44.60mm_Vishay_TJ8","Inductor_THT/L_Toroid_Horizontal_D5.1mm_P9.00mm_Diameter6-5mm_Amidon-T20","Inductor_THT/L_Toroid_Horizontal_D6.5mm_P10.00mm_Diameter7-5mm_Amidon-T25","Inductor_THT/L_Toroid_Horizontal_D69.1mm_P63.20mm_Vishay_TJ9","Inductor_THT/L_Toroid_Horizontal_D7.8mm_P13.00mm_Diameter9-5mm_Amidon-T30","Inductor_THT/L_Toroid_Horizontal_D9.5mm_P15.00mm_Diameter10-5mm_Amidon-T37","Inductor_THT/L_Toroid_Vertical_L10.0mm_W5.0mm_P5.08mm","Inductor_THT/L_Toroid_Vertical_L13.0mm_W6.5mm_P5.60mm","Inductor_THT/L_Toroid_Vertical_L14.0mm_W5.6mm_P5.30mm_Bourns_5700","Inductor_THT/L_Toroid_Vertical_L14.0mm_W6.3mm_P4.57mm_Pulse_A","Inductor_THT/L_Toroid_Vertical_L14.7mm_W8.6mm_P5.58mm_Pulse_KM-1","Inductor_THT/L_Toroid_Vertical_L16.0mm_W8.0mm_P7.62mm","Inductor_THT/L_Toroid_Vertical_L16.3mm_W7.1mm_P7.11mm_Pulse_H","Inductor_THT/L_Toroid_Vertical_L16.4mm_W7.6mm_P6.60mm_Vishay_TJ3","Inductor_THT/L_Toroid_Vertical_L16.5mm_W11.4mm_P7.62mm_Pulse_KM-2","Inductor_THT/L_Toroid_Vertical_L16.8mm_W9.2mm_P7.10mm_Vishay_TJ3","Inductor_THT/L_Toroid_Vertical_L16.8mm_W9.2mm_P7.10mm_Vishay_TJ3_BigPads","Inductor_THT/L_Toroid_Vertical_L17.8mm_W8.1mm_P7.62mm_Bourns_5700","Inductor_THT/L_Toroid_Vertical_L17.8mm_W9.7mm_P7.11mm_Pulse_B","Inductor_THT/L_Toroid_Vertical_L19.1mm_W8.1mm_P7.10mm_Bourns_5700","Inductor_THT/L_Toroid_Vertical_L21.6mm_W11.4mm_P7.62mm_Pulse_KM-3","Inductor_THT/L_Toroid_Vertical_L21.6mm_W8.4mm_P8.38mm_Pulse_G","Inductor_THT/L_Toroid_Vertical_L21.6mm_W9.1mm_P8.40mm_Bourns_5700","Inductor_THT/L_Toroid_Vertical_L21.6mm_W9.5mm_P7.11mm_Pulse_C","Inductor_THT/L_Toroid_Vertical_L22.4mm_W10.2mm_P7.90mm_Vishay_TJ4","Inductor_THT/L_Toroid_Vertical_L24.6mm_W15.5mm_P11.44mm_Pulse_KM-4","Inductor_THT/L_Toroid_Vertical_L25.4mm_W14.7mm_P12.20mm_Vishay_TJ5","Inductor_THT/L_Toroid_Vertical_L25.4mm_W14.7mm_P12.20mm_Vishay_TJ5_BigPads","Inductor_THT/L_Toroid_Vertical_L26.7mm_W14.0mm_P10.16mm_Pulse_D","Inductor_THT/L_Toroid_Vertical_L28.6mm_W14.3mm_P11.43mm_Bourns_5700","Inductor_THT/L_Toroid_Vertical_L31.8mm_W15.9mm_P13.50mm_Bourns_5700","Inductor_THT/L_Toroid_Vertical_L33.0mm_W17.8mm_P12.70mm_Pulse_KM-5","Inductor_THT/L_Toroid_Vertical_L35.1mm_W21.1mm_P18.50mm_Vishay_TJ6","Inductor_THT/L_Toroid_Vertical_L35.6mm_W17.8mm_P12.70mm_Pulse_E","Inductor_THT/L_Toroid_Vertical_L41.9mm_W17.8mm_P12.70mm_Pulse_F","Inductor_THT/L_Toroid_Vertical_L41.9mm_W19.1mm_P15.80mm_Vishay_TJ7","Inductor_THT/L_Toroid_Vertical_L46.0mm_W19.1mm_P21.80mm_Bourns_5700","Inductor_THT/L_Toroid_Vertical_L48.8mm_W25.4mm_P20.80mm_Vishay_TJ8","Inductor_THT/L_Toroid_Vertical_L54.0mm_W23.8mm_P20.10mm_Bourns_5700","Inductor_THT/L_Toroid_Vertical_L67.6mm_W36.1mm_P31.80mm_Vishay_TJ9","Inductor_THT_Wurth/L_Wurth_WE-HCFT-2012_LeadDiameter1.2mm","Inductor_THT_Wurth/L_Wurth_WE-HCFT-2012_LeadDiameter1.5mm","Inductor_THT_Wurth/L_Wurth_WE-HCFT-2504","Inductor_THT_Wurth/L_Wurth_WE-HCFT-3521","Inductor_THT_Wurth/L_Wurth_WE-HCFT-3533_LeadDiameter1.8mm","Inductor_THT_Wurth/L_Wurth_WE-HCFT-3533_LeadDiameter2.0mm","Inductor_THT_Wurth/L_Wurth_WE-HCFT-3540_LeadDiameter0.8mm","Inductor_THT_Wurth/L_Wurth_WE-HCFT-3540_LeadDiameter1.3mm","Inductor_THT_Wurth/L_Wurth_WE-HCFT-3540_LeadDiameter1.5mm","Inductor_THT_Wurth/L_Wurth_WE-HCFT-3540_LeadDiameter2.0mm","Jumper/Jumper_Harwin_S1621_P10.9mm","Jumper/SolderJumper-2_P1.3mm_Bridged2Bar_Pad1.0x1.5mm","Jumper/SolderJumper-2_P1.3mm_Bridged2Bar_RoundedPad1.0x1.5mm","Jumper/SolderJumper-2_P1.3mm_Bridged_Pad1.0x1.5mm","Jumper/SolderJumper-2_P1.3mm_Bridged_RoundedPad1.0x1.5mm","Jumper/SolderJumper-2_P1.3mm_Open_Pad1.0x1.5mm","Jumper/SolderJumper-2_P1.3mm_Open_RoundedPad1.0x1.5mm","Jumper/SolderJumper-2_P1.3mm_Open_TrianglePad1.0x1.5mm","Jumper/SolderJumper-3_P1.3mm_Bridged123_Pad1.0x1.5mm","Jumper/SolderJumper-3_P1.3mm_Bridged123_Pad1.0x1.5mm_NumberLabels","Jumper/SolderJumper-3_P1.3mm_Bridged123_RoundedPad1.0x1.5mm","Jumper/SolderJumper-3_P1.3mm_Bridged123_RoundedPad1.0x1.5mm_NumberLabels","Jumper/SolderJumper-3_P1.3mm_Bridged12_Pad1.0x1.5mm","Jumper/SolderJumper-3_P1.3mm_Bridged12_Pad1.0x1.5mm_NumberLabels","Jumper/SolderJumper-3_P1.3mm_Bridged12_RoundedPad1.0x1.5mm","Jumper/SolderJumper-3_P1.3mm_Bridged12_RoundedPad1.0x1.5mm_NumberLabels","Jumper/SolderJumper-3_P1.3mm_Bridged2Bar123_Pad1.0x1.5mm","Jumper/SolderJumper-3_P1.3mm_Bridged2Bar123_Pad1.0x1.5mm_NumberLabels","Jumper/SolderJumper-3_P1.3mm_Bridged2Bar123_RoundedPad1.0x1.5mm","Jumper/SolderJumper-3_P1.3mm_Bridged2Bar123_RoundedPad1.0x1.5mm_NumberLabels","Jumper/SolderJumper-3_P1.3mm_Bridged2Bar12_Pad1.0x1.5mm","Jumper/SolderJumper-3_P1.3mm_Bridged2Bar12_Pad1.0x1.5mm_NumberLabels","Jumper/SolderJumper-3_P1.3mm_Bridged2Bar12_RoundedPad1.0x1.5mm","Jumper/SolderJumper-3_P1.3mm_Bridged2Bar12_RoundedPad1.0x1.5mm_NumberLabels","Jumper/SolderJumper-3_P1.3mm_Open_Pad1.0x1.5mm","Jumper/SolderJumper-3_P1.3mm_Open_Pad1.0x1.5mm_NumberLabels","Jumper/SolderJumper-3_P1.3mm_Open_RoundedPad1.0x1.5mm","Jumper/SolderJumper-3_P1.3mm_Open_RoundedPad1.0x1.5mm_NumberLabels","Jumper/SolderJumper-3_P2.0mm_Open_TrianglePad1.0x1.5mm","Jumper/SolderJumper-3_P2.0mm_Open_TrianglePad1.0x1.5mm_NumberLabels","LED_SMD/LED-APA102-2020","LED_SMD/LED-L1T2_LUMILEDS","LED_SMD/LED_01005_0402Metric","LED_SMD/LED_01005_0402Metric_Pad0.57x0.30mm_HandSolder","LED_SMD/LED_0201_0603Metric","LED_SMD/LED_0201_0603Metric_Pad0.64x0.40mm_HandSolder","LED_SMD/LED_0402_1005Metric","LED_SMD/LED_0402_1005Metric_Pad0.77x0.64mm_HandSolder","LED_SMD/LED_0603_1608Metric","LED_SMD/LED_0603_1608Metric_Pad1.05x0.95mm_HandSolder","LED_SMD/LED_0805_2012Metric","LED_SMD/LED_0805_2012Metric_Pad1.15x1.40mm_HandSolder","LED_SMD/LED_1206_3216Metric","LED_SMD/LED_1206_3216Metric_Pad1.42x1.75mm_HandSolder","LED_SMD/LED_1206_3216Metric_ReverseMount_Hole1.8x2.4mm","LED_SMD/LED_1210_3225Metric","LED_SMD/LED_1210_3225Metric_Pad1.42x2.65mm_HandSolder","LED_SMD/LED_1812_4532Metric","LED_SMD/LED_1812_4532Metric_Pad1.30x3.40mm_HandSolder","LED_SMD/LED_1W_3W_R8","LED_SMD/LED_2010_5025Metric","LED_SMD/LED_2010_5025Metric_Pad1.52x2.65mm_HandSolder","LED_SMD/LED_2512_6332Metric","LED_SMD/LED_2512_6332Metric_Pad1.52x3.35mm_HandSolder","LED_SMD/LED_ASMB-KTF0-0A306","LED_SMD/LED_Avago_PLCC4_3.2x2.8mm_CW","LED_SMD/LED_Avago_PLCC6_3x2.8mm","LED_SMD/LED_CSP_Samsung_LH181B_2.36x2.36mm","LED_SMD/LED_Cree-PLCC4_2x2mm_CW","LED_SMD/LED_Cree-PLCC4_3.2x2.8mm_CCW","LED_SMD/LED_Cree-PLCC4_5x5mm_CW","LED_SMD/LED_Cree-PLCC6_4.7x1.5mm","LED_SMD/LED_Cree-XB","LED_SMD/LED_Cree-XH","LED_SMD/LED_Cree-XHP35","LED_SMD/LED_Cree-XHP50_12V_HighDensity","LED_SMD/LED_Cree-XHP50_12V_HighIntensity","LED_SMD/LED_Cree-XHP50_3V_HighDensity","LED_SMD/LED_Cree-XHP50_3V_HighIntensity","LED_SMD/LED_Cree-XHP50_6V_HighDensity","LED_SMD/LED_Cree-XHP50_6V_HighIntensity","LED_SMD/LED_Cree-XHP70_12V","LED_SMD/LED_Cree-XHP70_6V","LED_SMD/LED_Cree-XP-G","LED_SMD/LED_Cree-XP","LED_SMD/LED_Cree-XQ","LED_SMD/LED_Cree-XQ_HandSoldering","LED_SMD/LED_Dialight_591","LED_SMD/LED_Everlight-SMD3528_3.5x2.8mm_67-21ST","LED_SMD/LED_Foshan-NTD3528_3.5x2.8mm","LED_SMD/LED_Inolux_IN-P55TATRGB_PLCC6_5.0x5.5mm_P1.8mm","LED_SMD/LED_Inolux_IN-PI554FCH_PLCC4_5.0x5.0mm_P3.2mm","LED_SMD/LED_Kingbright_AAA3528ESGCT","LED_SMD/LED_Kingbright_APA1606_1.6x0.6mm_Horizontal","LED_SMD/LED_Kingbright_APDA3020VBCD","LED_SMD/LED_Kingbright_APFA3010_3x1.5mm_Horizontal","LED_SMD/LED_Kingbright_APHBM2012_2x1.25mm","LED_SMD/LED_Kingbright_KPA-3010_3x2x1mm","LED_SMD/LED_Kingbright_KPBD-3224","LED_SMD/LED_LiteOn_LTST-C19HE1WT","LED_SMD/LED_LiteOn_LTST-C235KGKRKT","LED_SMD/LED_LiteOn_LTST-C295K_1.6x0.8mm","LED_SMD/LED_LiteOn_LTST-E563C_PLCC4_5.0x5.0mm_P3.2mm","LED_SMD/LED_LiteOn_LTST-E563C_PLCC4_5.0x5.0mm_P3.2mm_HandSoldering","LED_SMD/LED_LiteOn_LTST-S326","LED_SMD/LED_Lumex_SML-LX0303SIUPGUSB","LED_SMD/LED_Lumex_SML-LX0404SIUPGUSB","LED_SMD/LED_Luminus_MP-3030-1100_3.0x3.0mm","LED_SMD/LED_OPSCO_SK6812_PLCC4_5.0x5.0mm_P3.1mm","LED_SMD/LED_Osram_Lx_P47F_D2mm_ReverseMount","LED_SMD/LED_PLCC-2_3.4x3.0mm_AK","LED_SMD/LED_PLCC-2_3.4x3.0mm_KA","LED_SMD/LED_PLCC-2_3x2mm_AK","LED_SMD/LED_PLCC-2_3x2mm_KA","LED_SMD/LED_PLCC_2835","LED_SMD/LED_PLCC_2835_Handsoldering","LED_SMD/LED_RGB_1210","LED_SMD/LED_RGB_5050-6","LED_SMD/LED_RGB_Cree-PLCC-6_6x5mm_P2.1mm","LED_SMD/LED_RGB_Everlight_EASV3015RGBA0_Horizontal","LED_SMD/LED_RGB_Getian_GT-P6PRGB4303","LED_SMD/LED_RGB_Lumex_SML-LXT0805SIUGUBW","LED_SMD/LED_RGB_PLCC-6","LED_SMD/LED_RGB_Wuerth-PLCC4_3.2x2.8mm_150141M173100","LED_SMD/LED_RGB_Wuerth_150080M153000","LED_SMD/LED_ROHM_SMLVN6","LED_SMD/LED_SK6805_PLCC4_2.4x2.7mm_P1.3mm","LED_SMD/LED_SK6812MINI-E_3.2x2.8mm_P1.5mm_ReverseMount","LED_SMD/LED_SK6812MINI_PLCC4_3.5x3.5mm_P1.75mm","LED_SMD/LED_SK6812_EC15_1.5x1.5mm","LED_SMD/LED_SK6812_PLCC4_5.0x5.0mm_P3.2mm","LED_SMD/LED_WS2812B-2020_PLCC4_2.0x2.0mm","LED_SMD/LED_WS2812B-Mini_PLCC4_3.5x3.5mm","LED_SMD/LED_WS2812B_PLCC4_5.0x5.0mm_P3.2mm","LED_SMD/LED_WS2812_PLCC6_5.0x5.0mm_P1.6mm","LED_SMD/LED_Wurth_150044M155260","LED_SMD/LED_Yuji_5730","LED_SMD/LED_miniPLCC_2315","LED_SMD/LED_miniPLCC_2315_Handsoldering","LED_THT/LED_BL-FL7680RGB","LED_THT/LED_D1.8mm_W1.8mm_H2.4mm_Horizontal_O1.27mm_Z1.6mm","LED_THT/LED_D1.8mm_W1.8mm_H2.4mm_Horizontal_O1.27mm_Z4.9mm","LED_THT/LED_D1.8mm_W1.8mm_H2.4mm_Horizontal_O1.27mm_Z8.2mm","LED_THT/LED_D1.8mm_W1.8mm_H2.4mm_Horizontal_O3.81mm_Z1.6mm","LED_THT/LED_D1.8mm_W1.8mm_H2.4mm_Horizontal_O3.81mm_Z4.9mm","LED_THT/LED_D1.8mm_W1.8mm_H2.4mm_Horizontal_O3.81mm_Z8.2mm","LED_THT/LED_D1.8mm_W1.8mm_H2.4mm_Horizontal_O6.35mm_Z1.6mm","LED_THT/LED_D1.8mm_W1.8mm_H2.4mm_Horizontal_O6.35mm_Z4.9mm","LED_THT/LED_D1.8mm_W1.8mm_H2.4mm_Horizontal_O6.35mm_Z8.2mm","LED_THT/LED_D1.8mm_W3.3mm_H2.4mm","LED_THT/LED_D10.0mm-3","LED_THT/LED_D10.0mm","LED_THT/LED_D2.0mm_W4.0mm_H2.8mm_FlatTop","LED_THT/LED_D2.0mm_W4.8mm_H2.5mm_FlatTop","LED_THT/LED_D20.0mm","LED_THT/LED_D3.0mm-3","LED_THT/LED_D3.0mm","LED_THT/LED_D3.0mm_Clear","LED_THT/LED_D3.0mm_FlatTop","LED_THT/LED_D3.0mm_Horizontal_O1.27mm_Z10.0mm","LED_THT/LED_D3.0mm_Horizontal_O1.27mm_Z2.0mm","LED_THT/LED_D3.0mm_Horizontal_O1.27mm_Z2.0mm_Clear","LED_THT/LED_D3.0mm_Horizontal_O1.27mm_Z2.0mm_IRBlack","LED_THT/LED_D3.0mm_Horizontal_O1.27mm_Z2.0mm_IRGrey","LED_THT/LED_D3.0mm_Horizontal_O1.27mm_Z6.0mm","LED_THT/LED_D3.0mm_Horizontal_O3.81mm_Z10.0mm","LED_THT/LED_D3.0mm_Horizontal_O3.81mm_Z2.0mm","LED_THT/LED_D3.0mm_Horizontal_O3.81mm_Z6.0mm","LED_THT/LED_D3.0mm_Horizontal_O6.35mm_Z10.0mm","LED_THT/LED_D3.0mm_Horizontal_O6.35mm_Z2.0mm","LED_THT/LED_D3.0mm_Horizontal_O6.35mm_Z6.0mm","LED_THT/LED_D3.0mm_IRBlack","LED_THT/LED_D3.0mm_IRGrey","LED_THT/LED_D4.0mm","LED_THT/LED_D5.0mm-3","LED_THT/LED_D5.0mm-3_Horizontal_O3.81mm_Z3.0mm","LED_THT/LED_D5.0mm-4_RGB","LED_THT/LED_D5.0mm-4_RGB_Staggered_Pins","LED_THT/LED_D5.0mm-4_RGB_Wide_Pins","LED_THT/LED_D5.0mm","LED_THT/LED_D5.0mm_Clear","LED_THT/LED_D5.0mm_FlatTop","LED_THT/LED_D5.0mm_Horizontal_O1.27mm_Z15.0mm","LED_THT/LED_D5.0mm_Horizontal_O1.27mm_Z3.0mm","LED_THT/LED_D5.0mm_Horizontal_O1.27mm_Z3.0mm_Clear","LED_THT/LED_D5.0mm_Horizontal_O1.27mm_Z3.0mm_IRBlack","LED_THT/LED_D5.0mm_Horizontal_O1.27mm_Z3.0mm_IRGrey","LED_THT/LED_D5.0mm_Horizontal_O1.27mm_Z9.0mm","LED_THT/LED_D5.0mm_Horizontal_O3.81mm_Z15.0mm","LED_THT/LED_D5.0mm_Horizontal_O3.81mm_Z3.0mm","LED_THT/LED_D5.0mm_Horizontal_O3.81mm_Z9.0mm","LED_THT/LED_D5.0mm_Horizontal_O6.35mm_Z15.0mm","LED_THT/LED_D5.0mm_Horizontal_O6.35mm_Z3.0mm","LED_THT/LED_D5.0mm_Horizontal_O6.35mm_Z9.0mm","LED_THT/LED_D5.0mm_IRBlack","LED_THT/LED_D5.0mm_IRGrey","LED_THT/LED_D8.0mm-3","LED_THT/LED_D8.0mm","LED_THT/LED_Oval_W5.2mm_H3.8mm","LED_THT/LED_Rectangular_W3.0mm_H2.0mm","LED_THT/LED_Rectangular_W3.9mm_H1.8mm","LED_THT/LED_Rectangular_W3.9mm_H1.9mm","LED_THT/LED_Rectangular_W5.0mm_H2.0mm-3Pins","LED_THT/LED_Rectangular_W5.0mm_H2.0mm","LED_THT/LED_Rectangular_W5.0mm_H2.0mm_Horizontal_O1.27mm_Z1.0mm","LED_THT/LED_Rectangular_W5.0mm_H2.0mm_Horizontal_O1.27mm_Z3.0mm","LED_THT/LED_Rectangular_W5.0mm_H2.0mm_Horizontal_O1.27mm_Z5.0mm","LED_THT/LED_Rectangular_W5.0mm_H2.0mm_Horizontal_O3.81mm_Z1.0mm","LED_THT/LED_Rectangular_W5.0mm_H2.0mm_Horizontal_O3.81mm_Z3.0mm","LED_THT/LED_Rectangular_W5.0mm_H2.0mm_Horizontal_O3.81mm_Z5.0mm","LED_THT/LED_Rectangular_W5.0mm_H2.0mm_Horizontal_O6.35mm_Z1.0mm","LED_THT/LED_Rectangular_W5.0mm_H2.0mm_Horizontal_O6.35mm_Z3.0mm","LED_THT/LED_Rectangular_W5.0mm_H2.0mm_Horizontal_O6.35mm_Z5.0mm","LED_THT/LED_Rectangular_W5.0mm_H5.0mm","LED_THT/LED_Rectangular_W7.62mm_H4.55mm_P5.08mm_R3","LED_THT/LED_SideEmitter_Rectangular_W4.5mm_H1.6mm","LED_THT/LED_VCCLite_5381H1_6.35x6.35mm","LED_THT/LED_VCCLite_5381H3_6.35x6.35mm","LED_THT/LED_VCCLite_5381H5_6.35x6.35mm","LED_THT/LED_VCCLite_5381H7_6.35x6.35mm","Module/A20_OLINUXINO_LIME2","Module/Adafruit_Feather","Module/Adafruit_Feather_32u4_FONA","Module/Adafruit_Feather_32u4_FONA_WithMountingHoles","Module/Adafruit_Feather_32u4_RFM","Module/Adafruit_Feather_32u4_RFM_WithMountingHoles","Module/Adafruit_Feather_M0_RFM","Module/Adafruit_Feather_M0_RFM_WithMountingHoles","Module/Adafruit_Feather_M0_Wifi","Module/Adafruit_Feather_M0_Wifi_WithMountingHoles","Module/Adafruit_Feather_WICED","Module/Adafruit_Feather_WICED_WithMountingHoles","Module/Adafruit_Feather_WithMountingHoles","Module/Adafruit_HUZZAH_ESP8266_breakout","Module/Adafruit_HUZZAH_ESP8266_breakout_WithMountingHoles","Module/Arduino_Nano","Module/Arduino_Nano_WithMountingHoles","Module/Arduino_UNO_R2","Module/Arduino_UNO_R2_WithMountingHoles","Module/Arduino_UNO_R3","Module/Arduino_UNO_R3_WithMountingHoles","Module/BeagleBoard_PocketBeagle","Module/Carambola2","Module/Electrosmith_Daisy_Seed","Module/Flipper_Zero_Angled","Module/Flipper_Zero_Straight","Module/Google_Coral_SMT_TPU_Module","Module/Maple_Mini","Module/Olimex_MOD-WIFI-ESP8266-DEV","Module/Onion_Omega2+","Module/Onion_Omega2S","Module/Pololu_Breakout-16_15.2x20.3mm","Module/RaspberryPi_Pico_Common_SMD","Module/RaspberryPi_Pico_Common_THT","Module/RaspberryPi_Pico_Common_Unspecified","Module/RaspberryPi_Pico_SMD","Module/RaspberryPi_Pico_SMD_HandSolder","Module/RaspberryPi_Pico_W_SMD","Module/RaspberryPi_Pico_W_SMD_HandSolder","Module/Raspberry_Pi_Zero_Socketed_THT_FaceDown_MountingHoles","Module/ST_Morpho_Connector_144_STLink","Module/ST_Morpho_Connector_144_STLink_MountingHoles","Module/Sipeed-M1","Module/Sipeed-M1W","Module/Texas_EUK_R-PDSS-T7_THT","Module/Texas_EUS_R-PDSS-T5_THT","Module/Texas_EUW_R-PDSS-T7_THT","Motors/Vybronics_VZ30C1T8219732L","MountingEquipment/DINRailAdapter_3xM3_PhoenixContact_1201578","MountingHole/MountingHole_2.1mm","MountingHole/MountingHole_2.2mm_M2","MountingHole/MountingHole_2.2mm_M2_DIN965","MountingHole/MountingHole_2.2mm_M2_DIN965_Pad","MountingHole/MountingHole_2.2mm_M2_DIN965_Pad_TopBottom","MountingHole/MountingHole_2.2mm_M2_DIN965_Pad_TopOnly","MountingHole/MountingHole_2.2mm_M2_ISO14580","MountingHole/MountingHole_2.2mm_M2_ISO14580_Pad","MountingHole/MountingHole_2.2mm_M2_ISO14580_Pad_TopBottom","MountingHole/MountingHole_2.2mm_M2_ISO14580_Pad_TopOnly","MountingHole/MountingHole_2.2mm_M2_ISO7380","MountingHole/MountingHole_2.2mm_M2_ISO7380_Pad","MountingHole/MountingHole_2.2mm_M2_ISO7380_Pad_TopBottom","MountingHole/MountingHole_2.2mm_M2_ISO7380_Pad_TopOnly","MountingHole/MountingHole_2.2mm_M2_Pad","MountingHole/MountingHole_2.2mm_M2_Pad_TopBottom","MountingHole/MountingHole_2.2mm_M2_Pad_TopOnly","MountingHole/MountingHole_2.2mm_M2_Pad_Via","MountingHole/MountingHole_2.5mm","MountingHole/MountingHole_2.5mm_Pad","MountingHole/MountingHole_2.5mm_Pad_TopBottom","MountingHole/MountingHole_2.5mm_Pad_TopOnly","MountingHole/MountingHole_2.5mm_Pad_Via","MountingHole/MountingHole_2.7mm","MountingHole/MountingHole_2.7mm_M2.5","MountingHole/MountingHole_2.7mm_M2.5_DIN965","MountingHole/MountingHole_2.7mm_M2.5_DIN965_Pad","MountingHole/MountingHole_2.7mm_M2.5_DIN965_Pad_TopBottom","MountingHole/MountingHole_2.7mm_M2.5_DIN965_Pad_TopOnly","MountingHole/MountingHole_2.7mm_M2.5_ISO14580","MountingHole/MountingHole_2.7mm_M2.5_ISO14580_Pad","MountingHole/MountingHole_2.7mm_M2.5_ISO14580_Pad_TopBottom","MountingHole/MountingHole_2.7mm_M2.5_ISO14580_Pad_TopOnly","MountingHole/MountingHole_2.7mm_M2.5_ISO7380","MountingHole/MountingHole_2.7mm_M2.5_ISO7380_Pad","MountingHole/MountingHole_2.7mm_M2.5_ISO7380_Pad_TopBottom","MountingHole/MountingHole_2.7mm_M2.5_ISO7380_Pad_TopOnly","MountingHole/MountingHole_2.7mm_M2.5_Pad","MountingHole/MountingHole_2.7mm_M2.5_Pad_TopBottom","MountingHole/MountingHole_2.7mm_M2.5_Pad_TopOnly","MountingHole/MountingHole_2.7mm_M2.5_Pad_Via","MountingHole/MountingHole_2.7mm_Pad","MountingHole/MountingHole_2.7mm_Pad_TopBottom","MountingHole/MountingHole_2.7mm_Pad_TopOnly","MountingHole/MountingHole_2.7mm_Pad_Via","MountingHole/MountingHole_2mm","MountingHole/MountingHole_3.2mm_M3","MountingHole/MountingHole_3.2mm_M3_DIN965","MountingHole/MountingHole_3.2mm_M3_DIN965_Pad","MountingHole/MountingHole_3.2mm_M3_DIN965_Pad_TopBottom","MountingHole/MountingHole_3.2mm_M3_DIN965_Pad_TopOnly","MountingHole/MountingHole_3.2mm_M3_ISO14580","MountingHole/MountingHole_3.2mm_M3_ISO14580_Pad","MountingHole/MountingHole_3.2mm_M3_ISO14580_Pad_TopBottom","MountingHole/MountingHole_3.2mm_M3_ISO14580_Pad_TopOnly","MountingHole/MountingHole_3.2mm_M3_ISO7380","MountingHole/MountingHole_3.2mm_M3_ISO7380_Pad","MountingHole/MountingHole_3.2mm_M3_ISO7380_Pad_TopBottom","MountingHole/MountingHole_3.2mm_M3_ISO7380_Pad_TopOnly","MountingHole/MountingHole_3.2mm_M3_Pad","MountingHole/MountingHole_3.2mm_M3_Pad_TopBottom","MountingHole/MountingHole_3.2mm_M3_Pad_TopOnly","MountingHole/MountingHole_3.2mm_M3_Pad_Via","MountingHole/MountingHole_3.5mm","MountingHole/MountingHole_3.5mm_Pad","MountingHole/MountingHole_3.5mm_Pad_TopBottom","MountingHole/MountingHole_3.5mm_Pad_TopOnly","MountingHole/MountingHole_3.5mm_Pad_Via","MountingHole/MountingHole_3.7mm","MountingHole/MountingHole_3.7mm_Pad","MountingHole/MountingHole_3.7mm_Pad_TopBottom","MountingHole/MountingHole_3.7mm_Pad_TopOnly","MountingHole/MountingHole_3.7mm_Pad_Via","MountingHole/MountingHole_3mm","MountingHole/MountingHole_3mm_Pad","MountingHole/MountingHole_3mm_Pad_TopBottom","MountingHole/MountingHole_3mm_Pad_TopOnly","MountingHole/MountingHole_3mm_Pad_Via","MountingHole/MountingHole_4.3mm_M4","MountingHole/MountingHole_4.3mm_M4_DIN965","MountingHole/MountingHole_4.3mm_M4_DIN965_Pad","MountingHole/MountingHole_4.3mm_M4_DIN965_Pad_TopBottom","MountingHole/MountingHole_4.3mm_M4_DIN965_Pad_TopOnly","MountingHole/MountingHole_4.3mm_M4_ISO14580","MountingHole/MountingHole_4.3mm_M4_ISO14580_Pad","MountingHole/MountingHole_4.3mm_M4_ISO14580_Pad_TopBottom","MountingHole/MountingHole_4.3mm_M4_ISO14580_Pad_TopOnly","MountingHole/MountingHole_4.3mm_M4_ISO7380","MountingHole/MountingHole_4.3mm_M4_ISO7380_Pad","MountingHole/MountingHole_4.3mm_M4_ISO7380_Pad_TopBottom","MountingHole/MountingHole_4.3mm_M4_ISO7380_Pad_TopOnly","MountingHole/MountingHole_4.3mm_M4_Pad","MountingHole/MountingHole_4.3mm_M4_Pad_TopBottom","MountingHole/MountingHole_4.3mm_M4_Pad_TopOnly","MountingHole/MountingHole_4.3mm_M4_Pad_Via","MountingHole/MountingHole_4.3x6.2mm_M4_Pad","MountingHole/MountingHole_4.3x6.2mm_M4_Pad_Via","MountingHole/MountingHole_4.5mm","MountingHole/MountingHole_4.5mm_Pad","MountingHole/MountingHole_4.5mm_Pad_TopBottom","MountingHole/MountingHole_4.5mm_Pad_TopOnly","MountingHole/MountingHole_4.5mm_Pad_Via","MountingHole/MountingHole_4mm","MountingHole/MountingHole_4mm_Pad","MountingHole/MountingHole_4mm_Pad_TopBottom","MountingHole/MountingHole_4mm_Pad_TopOnly","MountingHole/MountingHole_4mm_Pad_Via","MountingHole/MountingHole_5.3mm_M5","MountingHole/MountingHole_5.3mm_M5_DIN965","MountingHole/MountingHole_5.3mm_M5_DIN965_Pad","MountingHole/MountingHole_5.3mm_M5_DIN965_Pad_TopBottom","MountingHole/MountingHole_5.3mm_M5_DIN965_Pad_TopOnly","MountingHole/MountingHole_5.3mm_M5_ISO14580","MountingHole/MountingHole_5.3mm_M5_ISO14580_Pad","MountingHole/MountingHole_5.3mm_M5_ISO14580_Pad_TopBottom","MountingHole/MountingHole_5.3mm_M5_ISO14580_Pad_TopOnly","MountingHole/MountingHole_5.3mm_M5_ISO7380","MountingHole/MountingHole_5.3mm_M5_ISO7380_Pad","MountingHole/MountingHole_5.3mm_M5_ISO7380_Pad_TopBottom","MountingHole/MountingHole_5.3mm_M5_ISO7380_Pad_TopOnly","MountingHole/MountingHole_5.3mm_M5_Pad","MountingHole/MountingHole_5.3mm_M5_Pad_TopBottom","MountingHole/MountingHole_5.3mm_M5_Pad_TopOnly","MountingHole/MountingHole_5.3mm_M5_Pad_Via","MountingHole/MountingHole_5.5mm","MountingHole/MountingHole_5.5mm_Pad","MountingHole/MountingHole_5.5mm_Pad_TopBottom","MountingHole/MountingHole_5.5mm_Pad_TopOnly","MountingHole/MountingHole_5.5mm_Pad_Via","MountingHole/MountingHole_5mm","MountingHole/MountingHole_5mm_Pad","MountingHole/MountingHole_5mm_Pad_TopBottom","MountingHole/MountingHole_5mm_Pad_TopOnly","MountingHole/MountingHole_5mm_Pad_Via","MountingHole/MountingHole_6.4mm_M6","MountingHole/MountingHole_6.4mm_M6_DIN965","MountingHole/MountingHole_6.4mm_M6_DIN965_Pad","MountingHole/MountingHole_6.4mm_M6_DIN965_Pad_TopBottom","MountingHole/MountingHole_6.4mm_M6_DIN965_Pad_TopOnly","MountingHole/MountingHole_6.4mm_M6_ISO14580","MountingHole/MountingHole_6.4mm_M6_ISO14580_Pad","MountingHole/MountingHole_6.4mm_M6_ISO14580_Pad_TopBottom","MountingHole/MountingHole_6.4mm_M6_ISO14580_Pad_TopOnly","MountingHole/MountingHole_6.4mm_M6_ISO7380","MountingHole/MountingHole_6.4mm_M6_ISO7380_Pad","MountingHole/MountingHole_6.4mm_M6_ISO7380_Pad_TopBottom","MountingHole/MountingHole_6.4mm_M6_ISO7380_Pad_TopOnly","MountingHole/MountingHole_6.4mm_M6_Pad","MountingHole/MountingHole_6.4mm_M6_Pad_TopBottom","MountingHole/MountingHole_6.4mm_M6_Pad_TopOnly","MountingHole/MountingHole_6.4mm_M6_Pad_Via","MountingHole/MountingHole_6.5mm","MountingHole/MountingHole_6.5mm_Pad","MountingHole/MountingHole_6.5mm_Pad_TopBottom","MountingHole/MountingHole_6.5mm_Pad_TopOnly","MountingHole/MountingHole_6.5mm_Pad_Via","MountingHole/MountingHole_6mm","MountingHole/MountingHole_6mm_Pad","MountingHole/MountingHole_6mm_Pad_TopBottom","MountingHole/MountingHole_6mm_Pad_TopOnly","MountingHole/MountingHole_6mm_Pad_Via","MountingHole/MountingHole_8.4mm_M8","MountingHole/MountingHole_8.4mm_M8_Pad","MountingHole/MountingHole_8.4mm_M8_Pad_TopBottom","MountingHole/MountingHole_8.4mm_M8_Pad_TopOnly","MountingHole/MountingHole_8.4mm_M8_Pad_Via","MountingHole/ToolingHole_1.152mm","Mounting_Wuerth/Mounting_Wuerth_WA-SMSE-ExternalM3_H10mm_9771100360","Mounting_Wuerth/Mounting_Wuerth_WA-SMSE-ExternalM3_H11mm_9771110360","Mounting_Wuerth/Mounting_Wuerth_WA-SMSE-ExternalM3_H12mm_9771120360","Mounting_Wuerth/Mounting_Wuerth_WA-SMSE-ExternalM3_H13mm_9771130360","Mounting_Wuerth/Mounting_Wuerth_WA-SMSE-ExternalM3_H14mm_9771140360","Mounting_Wuerth/Mounting_Wuerth_WA-SMSE-ExternalM3_H15mm_9771150360","Mounting_Wuerth/Mounting_Wuerth_WA-SMSE-ExternalM3_H5mm_9771050360","Mounting_Wuerth/Mounting_Wuerth_WA-SMSE-ExternalM3_H6mm_9771060360","Mounting_Wuerth/Mounting_Wuerth_WA-SMSE-ExternalM3_H7mm_9771070360","Mounting_Wuerth/Mounting_Wuerth_WA-SMSE-ExternalM3_H8mm_9771080360","Mounting_Wuerth/Mounting_Wuerth_WA-SMSE-ExternalM3_H9mm_9771090360","Mounting_Wuerth/Mounting_Wuerth_WA-SMSI-M1.6_H0.5mm_9774005633","Mounting_Wuerth/Mounting_Wuerth_WA-SMSI-M1.6_H1.5mm_9774015633","Mounting_Wuerth/Mounting_Wuerth_WA-SMSI-M1.6_H1mm_9774010633","Mounting_Wuerth/Mounting_Wuerth_WA-SMSI-M1.6_H2.5mm_9774025633","Mounting_Wuerth/Mounting_Wuerth_WA-SMSI-M1.6_H2.5mm_ThreadDepth1.5mm_97730256332","Mounting_Wuerth/Mounting_Wuerth_WA-SMSI-M1.6_H2.5mm_ThreadDepth1.5mm_NoNPTH_97730256330","Mounting_Wuerth/Mounting_Wuerth_WA-SMSI-M1.6_H2mm_9774020633","Mounting_Wuerth/Mounting_Wuerth_WA-SMSI-M1.6_H3.5mm_ThreadDepth2mm_97730356332","Mounting_Wuerth/Mounting_Wuerth_WA-SMSI-M1.6_H3.5mm_ThreadDepth2mm_97730356334","Mounting_Wuerth/Mounting_Wuerth_WA-SMSI-M1.6_H3.5mm_ThreadDepth2mm_NoNPTH_97730356330","Mounting_Wuerth/Mounting_Wuerth_WA-SMSI-M1.6_H3mm_9774030633","Mounting_Wuerth/Mounting_Wuerth_WA-SMSI-M1.6_H3mm_ThreadDepth1.8mm_97730306332","Mounting_Wuerth/Mounting_Wuerth_WA-SMSI-M1.6_H3mm_ThreadDepth1.8mm_NoNPTH_97730306330","Mounting_Wuerth/Mounting_Wuerth_WA-SMSI-M1.6_H4.5mm_ThreadDepth2mm_97730456332","Mounting_Wuerth/Mounting_Wuerth_WA-SMSI-M1.6_H4.5mm_ThreadDepth2mm_97730456334","Mounting_Wuerth/Mounting_Wuerth_WA-SMSI-M1.6_H4.5mm_ThreadDepth2mm_NoNPTH_97730456330","Mounting_Wuerth/Mounting_Wuerth_WA-SMSI-M1.6_H4mm_ThreadDepth2mm_97730406332","Mounting_Wuerth/Mounting_Wuerth_WA-SMSI-M1.6_H4mm_ThreadDepth2mm_97730406334","Mounting_Wuerth/Mounting_Wuerth_WA-SMSI-M1.6_H4mm_ThreadDepth2mm_NoNPTH_97730406330","Mounting_Wuerth/Mounting_Wuerth_WA-SMSI-M1.6_H5mm_ThreadDepth2mm_97730506332","Mounting_Wuerth/Mounting_Wuerth_WA-SMSI-M1.6_H5mm_ThreadDepth2mm_97730506334","Mounting_Wuerth/Mounting_Wuerth_WA-SMSI-M1.6_H5mm_ThreadDepth2mm_NoNPTH_97730506330","Mounting_Wuerth/Mounting_Wuerth_WA-SMSI-M1.6_H6mm_ThreadDepth2mm_97730606332","Mounting_Wuerth/Mounting_Wuerth_WA-SMSI-M1.6_H6mm_ThreadDepth2mm_97730606334","Mounting_Wuerth/Mounting_Wuerth_WA-SMSI-M1.6_H6mm_ThreadDepth2mm_NoNPTH_97730606330","Mounting_Wuerth/Mounting_Wuerth_WA-SMSI-M2.5_H0.5mm_9774005151","Mounting_Wuerth/Mounting_Wuerth_WA-SMSI-M2.5_H1.5mm_9774015151","Mounting_Wuerth/Mounting_Wuerth_WA-SMSI-M2.5_H10mm_9774100151","Mounting_Wuerth/Mounting_Wuerth_WA-SMSI-M2.5_H1mm_9774010151","Mounting_Wuerth/Mounting_Wuerth_WA-SMSI-M2.5_H2.5mm_9774025151","Mounting_Wuerth/Mounting_Wuerth_WA-SMSI-M2.5_H2.7mm_9774027151","Mounting_Wuerth/Mounting_Wuerth_WA-SMSI-M2.5_H2mm_9774020151","Mounting_Wuerth/Mounting_Wuerth_WA-SMSI-M2.5_H3.5mm_9774035151","Mounting_Wuerth/Mounting_Wuerth_WA-SMSI-M2.5_H3mm_9774030151","Mounting_Wuerth/Mounting_Wuerth_WA-SMSI-M2.5_H4.5mm_9774045151","Mounting_Wuerth/Mounting_Wuerth_WA-SMSI-M2.5_H4mm_9774040151","Mounting_Wuerth/Mounting_Wuerth_WA-SMSI-M2.5_H5.5mm_9774055151","Mounting_Wuerth/Mounting_Wuerth_WA-SMSI-M2.5_H5mm_9774050151","Mounting_Wuerth/Mounting_Wuerth_WA-SMSI-M2.5_H6.5mm_9774065151","Mounting_Wuerth/Mounting_Wuerth_WA-SMSI-M2.5_H6mm_9774060151","Mounting_Wuerth/Mounting_Wuerth_WA-SMSI-M2.5_H7.5mm_9774075151","Mounting_Wuerth/Mounting_Wuerth_WA-SMSI-M2.5_H7mm_9774070151","Mounting_Wuerth/Mounting_Wuerth_WA-SMSI-M2.5_H8.5mm_9774085151","Mounting_Wuerth/Mounting_Wuerth_WA-SMSI-M2.5_H8mm_9774080151","Mounting_Wuerth/Mounting_Wuerth_WA-SMSI-M2.5_H9.5mm_9774095151","Mounting_Wuerth/Mounting_Wuerth_WA-SMSI-M2.5_H9mm_9774090151","Mounting_Wuerth/Mounting_Wuerth_WA-SMSI-M2_H0.5mm_9774005243","Mounting_Wuerth/Mounting_Wuerth_WA-SMSI-M2_H1.5mm_9774015243","Mounting_Wuerth/Mounting_Wuerth_WA-SMSI-M2_H1mm_9774010243","Mounting_Wuerth/Mounting_Wuerth_WA-SMSI-M2_H2.5mm_9774025243","Mounting_Wuerth/Mounting_Wuerth_WA-SMSI-M2_H2mm_9774020243","Mounting_Wuerth/Mounting_Wuerth_WA-SMSI-M2_H3.5mm_9774035243","Mounting_Wuerth/Mounting_Wuerth_WA-SMSI-M2_H3mm_9774030243","Mounting_Wuerth/Mounting_Wuerth_WA-SMSI-M2_H4.5mm_9774045243","Mounting_Wuerth/Mounting_Wuerth_WA-SMSI-M2_H4mm_9774040243","Mounting_Wuerth/Mounting_Wuerth_WA-SMSI-M2_H5mm_9774050243","Mounting_Wuerth/Mounting_Wuerth_WA-SMSI-M2_H6mm_9774060243","Mounting_Wuerth/Mounting_Wuerth_WA-SMSI-M2_H7mm_9774070243","Mounting_Wuerth/Mounting_Wuerth_WA-SMSI-M2_H8mm_9774080243","Mounting_Wuerth/Mounting_Wuerth_WA-SMSI-M3_H0.5mm_9774005360","Mounting_Wuerth/Mounting_Wuerth_WA-SMSI-M3_H1.5mm_9774015360","Mounting_Wuerth/Mounting_Wuerth_WA-SMSI-M3_H10mm_9774100360","Mounting_Wuerth/Mounting_Wuerth_WA-SMSI-M3_H11mm_9774110360","Mounting_Wuerth/Mounting_Wuerth_WA-SMSI-M3_H12mm_9774120360","Mounting_Wuerth/Mounting_Wuerth_WA-SMSI-M3_H13mm_9774130360","Mounting_Wuerth/Mounting_Wuerth_WA-SMSI-M3_H14mm_9774140360","Mounting_Wuerth/Mounting_Wuerth_WA-SMSI-M3_H15mm_9774150360","Mounting_Wuerth/Mounting_Wuerth_WA-SMSI-M3_H16mm_9774160360","Mounting_Wuerth/Mounting_Wuerth_WA-SMSI-M3_H1mm_9774010360","Mounting_Wuerth/Mounting_Wuerth_WA-SMSI-M3_H2.5mm_9774025360","Mounting_Wuerth/Mounting_Wuerth_WA-SMSI-M3_H2mm_9774020360","Mounting_Wuerth/Mounting_Wuerth_WA-SMSI-M3_H3mm_9774030360","Mounting_Wuerth/Mounting_Wuerth_WA-SMSI-M3_H4mm_9774040360","Mounting_Wuerth/Mounting_Wuerth_WA-SMSI-M3_H5mm_9774050360","Mounting_Wuerth/Mounting_Wuerth_WA-SMSI-M3_H6mm_9774060360","Mounting_Wuerth/Mounting_Wuerth_WA-SMSI-M3_H7mm_9774070360","Mounting_Wuerth/Mounting_Wuerth_WA-SMSI-M3_H8mm_9774080360","Mounting_Wuerth/Mounting_Wuerth_WA-SMSI-M3_H9mm_9774090360","Mounting_Wuerth/Mounting_Wuerth_WA-SMSI-M4_H10mm_9774100482","Mounting_Wuerth/Mounting_Wuerth_WA-SMSI-M4_H1mm_9774010482","Mounting_Wuerth/Mounting_Wuerth_WA-SMSI-M4_H2mm_9774020482","Mounting_Wuerth/Mounting_Wuerth_WA-SMSI-M4_H3mm_9774030482","Mounting_Wuerth/Mounting_Wuerth_WA-SMSI-M4_H4mm_9774040482","Mounting_Wuerth/Mounting_Wuerth_WA-SMSI-M4_H5mm_9774050482","Mounting_Wuerth/Mounting_Wuerth_WA-SMSI-M4_H6mm_9774060482","Mounting_Wuerth/Mounting_Wuerth_WA-SMSI-M4_H7mm_9774070482","Mounting_Wuerth/Mounting_Wuerth_WA-SMSI-M4_H8mm_9774080482","Mounting_Wuerth/Mounting_Wuerth_WA-SMSI-M4_H9mm_9774090482","Mounting_Wuerth/Mounting_Wuerth_WA-SMSR-3.2mm_H10.6mm_ReverseMount_9775106960","Mounting_Wuerth/Mounting_Wuerth_WA-SMSR-3.2mm_H11.6mm_ReverseMount_9775116960","Mounting_Wuerth/Mounting_Wuerth_WA-SMSR-3.2mm_H2.6mm_ReverseMount_9775026960","Mounting_Wuerth/Mounting_Wuerth_WA-SMSR-3.2mm_H3.1mm_ReverseMount_9775031960","Mounting_Wuerth/Mounting_Wuerth_WA-SMSR-3.2mm_H3.6mm_ReverseMount_9775036960","Mounting_Wuerth/Mounting_Wuerth_WA-SMSR-3.2mm_H4.1mm_ReverseMount_9775041960","Mounting_Wuerth/Mounting_Wuerth_WA-SMSR-3.2mm_H4.6mm_ReverseMount_9775046960","Mounting_Wuerth/Mounting_Wuerth_WA-SMSR-3.2mm_H5.1mm_ReverseMount_9775051960","Mounting_Wuerth/Mounting_Wuerth_WA-SMSR-3.2mm_H5.6mm_ReverseMount_9775056960","Mounting_Wuerth/Mounting_Wuerth_WA-SMSR-3.2mm_H6.6mm_ReverseMount_9775066960","Mounting_Wuerth/Mounting_Wuerth_WA-SMSR-3.2mm_H7.6mm_ReverseMount_9775076960","Mounting_Wuerth/Mounting_Wuerth_WA-SMSR-3.2mm_H8.6mm_ReverseMount_9775086960","Mounting_Wuerth/Mounting_Wuerth_WA-SMSR-3.2mm_H9.6mm_ReverseMount_9775096960","Mounting_Wuerth/Mounting_Wuerth_WA-SMSR-M3_H10.6mm_ReverseMount_9775106360","Mounting_Wuerth/Mounting_Wuerth_WA-SMSR-M3_H11.6mm_ReverseMount_9775116360","Mounting_Wuerth/Mounting_Wuerth_WA-SMSR-M3_H2.6mm_ReverseMount_9775026360","Mounting_Wuerth/Mounting_Wuerth_WA-SMSR-M3_H3.1mm_ReverseMount_9775031360","Mounting_Wuerth/Mounting_Wuerth_WA-SMSR-M3_H3.6mm_ReverseMount_9775036360","Mounting_Wuerth/Mounting_Wuerth_WA-SMSR-M3_H4.1mm_ReverseMount_9775041360","Mounting_Wuerth/Mounting_Wuerth_WA-SMSR-M3_H4.6mm_ReverseMount_9775046360","Mounting_Wuerth/Mounting_Wuerth_WA-SMSR-M3_H5.1mm_ReverseMount_9775051360","Mounting_Wuerth/Mounting_Wuerth_WA-SMSR-M3_H5.6mm_ReverseMount_9775056360","Mounting_Wuerth/Mounting_Wuerth_WA-SMSR-M3_H6.6mm_ReverseMount_9775066360","Mounting_Wuerth/Mounting_Wuerth_WA-SMSR-M3_H7.6mm_ReverseMount_9775076360","Mounting_Wuerth/Mounting_Wuerth_WA-SMSR-M3_H8.6mm_ReverseMount_9775086360","Mounting_Wuerth/Mounting_Wuerth_WA-SMSR-M3_H9.6mm_ReverseMount_9775096360","Mounting_Wuerth/Mounting_Wuerth_WA-SMSSR-3.3mm_H10mm_SnapRivet_9776100960","Mounting_Wuerth/Mounting_Wuerth_WA-SMSSR-3.3mm_H2.5mm_SnapRivet_9776025960","Mounting_Wuerth/Mounting_Wuerth_WA-SMSSR-3.3mm_H2mm_SnapRivet_9776020960","Mounting_Wuerth/Mounting_Wuerth_WA-SMSSR-3.3mm_H3mm_SnapRivet_9776030960","Mounting_Wuerth/Mounting_Wuerth_WA-SMSSR-3.3mm_H4mm_SnapRivet_9776040960","Mounting_Wuerth/Mounting_Wuerth_WA-SMSSR-3.3mm_H5mm_SnapRivet_9776050960","Mounting_Wuerth/Mounting_Wuerth_WA-SMSSR-3.3mm_H6mm_SnapRivet_9776060960","Mounting_Wuerth/Mounting_Wuerth_WA-SMSSR-3.3mm_H7mm_SnapRivet_9776070960","Mounting_Wuerth/Mounting_Wuerth_WA-SMSSR-3.3mm_H8mm_SnapRivet_9776080960","Mounting_Wuerth/Mounting_Wuerth_WA-SMSSR-3.3mm_H9mm_SnapRivet_9776090960","Mounting_Wuerth/Mounting_Wuerth_WA-SMST-2.25mm_H1.5mm_9774015943","Mounting_Wuerth/Mounting_Wuerth_WA-SMST-2.25mm_H1mm_9774010943","Mounting_Wuerth/Mounting_Wuerth_WA-SMST-2.25mm_H2.5mm_9774025943","Mounting_Wuerth/Mounting_Wuerth_WA-SMST-2.25mm_H2mm_9774020943","Mounting_Wuerth/Mounting_Wuerth_WA-SMST-2.25mm_H3.5mm_9774035943","Mounting_Wuerth/Mounting_Wuerth_WA-SMST-2.25mm_H3mm_9774030943","Mounting_Wuerth/Mounting_Wuerth_WA-SMST-2.25mm_H4.5mm_9774045943","Mounting_Wuerth/Mounting_Wuerth_WA-SMST-2.25mm_H4mm_9774040943","Mounting_Wuerth/Mounting_Wuerth_WA-SMST-2.25mm_H5mm_9774050943","Mounting_Wuerth/Mounting_Wuerth_WA-SMST-2.25mm_H6mm_9774060943","Mounting_Wuerth/Mounting_Wuerth_WA-SMST-2.25mm_H7mm_9774070943","Mounting_Wuerth/Mounting_Wuerth_WA-SMST-2.25mm_H8mm_9774080943","Mounting_Wuerth/Mounting_Wuerth_WA-SMST-2.7mm_H1.5mm_9774015951","Mounting_Wuerth/Mounting_Wuerth_WA-SMST-2.7mm_H10mm_9774100951","Mounting_Wuerth/Mounting_Wuerth_WA-SMST-2.7mm_H1mm_9774010951","Mounting_Wuerth/Mounting_Wuerth_WA-SMST-2.7mm_H2.5mm_9774025951","Mounting_Wuerth/Mounting_Wuerth_WA-SMST-2.7mm_H2mm_9774020951","Mounting_Wuerth/Mounting_Wuerth_WA-SMST-2.7mm_H3mm_9774030951","Mounting_Wuerth/Mounting_Wuerth_WA-SMST-2.7mm_H4mm_9774040951","Mounting_Wuerth/Mounting_Wuerth_WA-SMST-2.7mm_H5.5mm_9774055951","Mounting_Wuerth/Mounting_Wuerth_WA-SMST-2.7mm_H5mm_9774050951","Mounting_Wuerth/Mounting_Wuerth_WA-SMST-2.7mm_H6.5mm_9774065951","Mounting_Wuerth/Mounting_Wuerth_WA-SMST-2.7mm_H6mm_9774060951","Mounting_Wuerth/Mounting_Wuerth_WA-SMST-2.7mm_H7mm_9774070951","Mounting_Wuerth/Mounting_Wuerth_WA-SMST-2.7mm_H8mm_9774080951","Mounting_Wuerth/Mounting_Wuerth_WA-SMST-2.7mm_H9mm_9774090951","Mounting_Wuerth/Mounting_Wuerth_WA-SMST-3.3mm_H1.5mm_9774015960","Mounting_Wuerth/Mounting_Wuerth_WA-SMST-3.3mm_H10mm_9774100960","Mounting_Wuerth/Mounting_Wuerth_WA-SMST-3.3mm_H11mm_9774110960","Mounting_Wuerth/Mounting_Wuerth_WA-SMST-3.3mm_H12mm_9774120960","Mounting_Wuerth/Mounting_Wuerth_WA-SMST-3.3mm_H13mm_9774130960","Mounting_Wuerth/Mounting_Wuerth_WA-SMST-3.3mm_H14mm_9774140960","Mounting_Wuerth/Mounting_Wuerth_WA-SMST-3.3mm_H15mm_9774150960","Mounting_Wuerth/Mounting_Wuerth_WA-SMST-3.3mm_H16mm_9774160960","Mounting_Wuerth/Mounting_Wuerth_WA-SMST-3.3mm_H1mm_9774010960","Mounting_Wuerth/Mounting_Wuerth_WA-SMST-3.3mm_H2.5mm_9774025960","Mounting_Wuerth/Mounting_Wuerth_WA-SMST-3.3mm_H2mm_9774020960","Mounting_Wuerth/Mounting_Wuerth_WA-SMST-3.3mm_H3mm_9774030960","Mounting_Wuerth/Mounting_Wuerth_WA-SMST-3.3mm_H4mm_9774040960","Mounting_Wuerth/Mounting_Wuerth_WA-SMST-3.3mm_H5mm_9774050960","Mounting_Wuerth/Mounting_Wuerth_WA-SMST-3.3mm_H6mm_9774060960","Mounting_Wuerth/Mounting_Wuerth_WA-SMST-3.3mm_H7mm_9774070960","Mounting_Wuerth/Mounting_Wuerth_WA-SMST-3.3mm_H8mm_9774080960","Mounting_Wuerth/Mounting_Wuerth_WA-SMST-3.3mm_H9mm_9774090960","Mounting_Wuerth/Mounting_Wuerth_WA-SMST-4.5mm_H10mm_9774100982","Mounting_Wuerth/Mounting_Wuerth_WA-SMST-4.5mm_H1mm_9774010982","Mounting_Wuerth/Mounting_Wuerth_WA-SMST-4.5mm_H2mm_9774020982","Mounting_Wuerth/Mounting_Wuerth_WA-SMST-4.5mm_H3mm_9774030982","Mounting_Wuerth/Mounting_Wuerth_WA-SMST-4.5mm_H4mm_9774040982","Mounting_Wuerth/Mounting_Wuerth_WA-SMST-4.5mm_H5mm_9774050982","Mounting_Wuerth/Mounting_Wuerth_WA-SMST-4.5mm_H6mm_9774060982","Mounting_Wuerth/Mounting_Wuerth_WA-SMST-4.5mm_H7mm_9774070982","Mounting_Wuerth/Mounting_Wuerth_WA-SMST-4.5mm_H8mm_9774080982","Mounting_Wuerth/Mounting_Wuerth_WA-SMST-4.5mm_H9mm_9774090982","Mounting_Wuerth/Mounting_Wuerth_WP-SMRA-D3.3mm_L7mm_7466300_Horizontal","Mounting_Wuerth/Mounting_Wuerth_WP-SMRA-M3_L7mm_7466303_Horizontal","NetTie/NetTie-2_SMD_Pad0.5mm","NetTie/NetTie-2_SMD_Pad2.0mm","NetTie/NetTie-2_THT_Pad0.3mm","NetTie/NetTie-2_THT_Pad1.0mm","NetTie/NetTie-3_SMD_Pad0.5mm","NetTie/NetTie-3_SMD_Pad2.0mm","NetTie/NetTie-3_THT_Pad0.3mm","NetTie/NetTie-3_THT_Pad1.0mm","NetTie/NetTie-4_SMD_Pad0.5mm","NetTie/NetTie-4_SMD_Pad2.0mm","NetTie/NetTie-4_THT_Pad0.3mm","NetTie/NetTie-4_THT_Pad1.0mm","OptoDevice/ADNS-9800","OptoDevice/AGILENT_HFBR-152x","OptoDevice/AGILENT_HFBR-252x","OptoDevice/AMS_TSL2550_SMD","OptoDevice/AMS_TSL25911FN","OptoDevice/Broadcom_AFBR-16xxZ_Horizontal","OptoDevice/Broadcom_AFBR-16xxZ_Tilted","OptoDevice/Broadcom_AFBR-16xxZ_Vertical","OptoDevice/Broadcom_APDS-9160-003","OptoDevice/Broadcom_APDS-9301","OptoDevice/Broadcom_DFN-6_2x2mm_P0.65mm","OptoDevice/Broadcom_LGA-8_2x2mm_P0.53mm","OptoDevice/Broadcom_LGA-8_2x2mm_P0.5mm","OptoDevice/Everlight_IRM-H6xxT","OptoDevice/Everlight_ITR1201SR10AR","OptoDevice/Everlight_ITR8307","OptoDevice/Everlight_ITR8307F43","OptoDevice/Everlight_ITR8307_Reverse","OptoDevice/Everlight_ITR9608-F","OptoDevice/Finder_34.81","OptoDevice/Hamamatsu_C12880","OptoDevice/Hamamatsu_S13360-30CS","OptoDevice/Hamamatsu_S14160-6050HS","OptoDevice/Kingbright_KPS-3227","OptoDevice/Kingbright_KPS-5130","OptoDevice/Kingbright_KRC011_Horizontal","OptoDevice/Kingbright_KRC011_Vertical","OptoDevice/Kodenshi_LG206D","OptoDevice/Kodenshi_LG206L","OptoDevice/Kodenshi_SG105","OptoDevice/Kodenshi_SG105F","OptoDevice/Kodenshi_SG105_Reverse","OptoDevice/LaserDiode_TO18-D5.6-3","OptoDevice/LaserDiode_TO3.3-D3.3-3","OptoDevice/LaserDiode_TO38ICut-3","OptoDevice/LaserDiode_TO5-D9-3","OptoDevice/LaserDiode_TO56-3","OptoDevice/Lightpipe_Bivar_RLP1-400-650","OptoDevice/Lightpipe_Bivar_SLP3-150-100-F","OptoDevice/Lightpipe_Bivar_SLP3-150-100-R","OptoDevice/Lightpipe_Bivar_SLP3-150-150-F","OptoDevice/Lightpipe_Bivar_SLP3-150-150-R","OptoDevice/Lightpipe_Bivar_SLP3-150-200-R","OptoDevice/Lightpipe_Bivar_SLP3-150-250-F","OptoDevice/Lightpipe_Bivar_SLP3-150-250-R","OptoDevice/Lightpipe_Bivar_SLP3-150-300-F","OptoDevice/Lightpipe_Bivar_SLP3-150-300-R","OptoDevice/Lightpipe_Bivar_SLP3-150-450-R","OptoDevice/Lightpipe_Dialight_515-1064F","OptoDevice/Lightpipe_LPF-C012303S","OptoDevice/Lightpipe_LPF-C013301S","OptoDevice/Lightpipe_Mentor_1275.x00x","OptoDevice/Lightpipe_Mentor_1276.1004","OptoDevice/Lightpipe_Mentor_1276.2004","OptoDevice/Lite-On_LTR-303ALS-01","OptoDevice/Luna_NSL-32","OptoDevice/Maxim_OLGA-14_3.3x5.6mm_P0.8mm","OptoDevice/ONSemi_QSE15x","OptoDevice/OnSemi_CASE100AQ","OptoDevice/OnSemi_CASE100CY","OptoDevice/Osram_BP104-SMD","OptoDevice/Osram_BPW34S-SMD","OptoDevice/Osram_BPW82","OptoDevice/Osram_DIL2_4.3x4.65mm_P5.08mm","OptoDevice/Osram_LPT80A","OptoDevice/Osram_SFH205","OptoDevice/Osram_SFH2201","OptoDevice/Osram_SFH225","OptoDevice/Osram_SFH2430","OptoDevice/Osram_SFH2440","OptoDevice/Osram_SFH3710","OptoDevice/Osram_SFH9x0x","OptoDevice/Osram_SMD-SmartDIL","OptoDevice/Panasonic_APV-AQY_SSOP-4_4.45x2.65mm_P1.27mm","OptoDevice/PerkinElmer_VTL5C","OptoDevice/PerkinElmer_VTL5Cx2","OptoDevice/R_LDR_10x8.5mm_P7.6mm_Vertical","OptoDevice/R_LDR_11x9.4mm_P8.2mm_Vertical","OptoDevice/R_LDR_12x10.8mm_P9.0mm_Vertical","OptoDevice/R_LDR_4.9x4.2mm_P2.54mm_Vertical","OptoDevice/R_LDR_5.0x4.1mm_P3mm_Vertical","OptoDevice/R_LDR_5.1x4.3mm_P3.4mm_Vertical","OptoDevice/R_LDR_5.2x5.2mm_P3.5mm_Horizontal","OptoDevice/R_LDR_7x6mm_P5.1mm_Vertical","OptoDevice/R_LDR_D13.8mm_P9.0mm_Vertical","OptoDevice/R_LDR_D20mm_P17.5mm_Vertical","OptoDevice/R_LDR_D6.4mm_P3.4mm_Vertical","OptoDevice/Renesas_DFN-6_1.5x1.6mm_P0.5mm","OptoDevice/Rohm_RPR-0720","OptoDevice/ST_VL53L0X","OptoDevice/Sharp_GP2S700HCP","OptoDevice/Sharp_GP2Y0A41SK0F","OptoDevice/Sharp_IS471F","OptoDevice/Sharp_IS485","OptoDevice/Siemens_SFH900","OptoDevice/Toshiba_TORX170_TORX173_TORX193_TORX194","OptoDevice/Toshiba_TOTX170_TOTX173_TOTX193_TOTX194","OptoDevice/Vishay_CAST-3Pin","OptoDevice/Vishay_CNY70","OptoDevice/Vishay_MINICAST-3Pin","OptoDevice/Vishay_MINIMOLD-3Pin","OptoDevice/Vishay_MOLD-3Pin","OptoDevice/Vishay_TCRT5000","Oscillator/Oscillator_DIP-14","Oscillator/Oscillator_DIP-14_LargePads","Oscillator/Oscillator_DIP-8","Oscillator/Oscillator_DIP-8_LargePads","Oscillator/Oscillator_OCXO_Morion_MV267","Oscillator/Oscillator_OCXO_Morion_MV317","Oscillator/Oscillator_SMD_Abracon_ABLNO","Oscillator/Oscillator_SMD_Abracon_ASCO-4Pin_1.6x1.2mm","Oscillator/Oscillator_SMD_Abracon_ASDMB-4Pin_2.5x2.0mm","Oscillator/Oscillator_SMD_Abracon_ASE-4Pin_3.2x2.5mm","Oscillator/Oscillator_SMD_Abracon_ASE-4Pin_3.2x2.5mm_HandSoldering","Oscillator/Oscillator_SMD_Abracon_ASV-4Pin_7.0x5.1mm","Oscillator/Oscillator_SMD_Abracon_ASV-4Pin_7.0x5.1mm_HandSoldering","Oscillator/Oscillator_SMD_Diodes_FN-4Pin_7.0x5.0mm","Oscillator/Oscillator_SMD_ECS_2520MV-xxx-xx-4Pin_2.5x2.0mm","Oscillator/Oscillator_SMD_EuroQuartz_XO32-4Pin_3.2x2.5mm","Oscillator/Oscillator_SMD_EuroQuartz_XO32-4Pin_3.2x2.5mm_RotB","Oscillator/Oscillator_SMD_EuroQuartz_XO32-4Pin_3.2x2.5mm_RotB_HandSoldering","Oscillator/Oscillator_SMD_EuroQuartz_XO53-4Pin_5.0x3.2mm","Oscillator/Oscillator_SMD_EuroQuartz_XO53-4Pin_5.0x3.2mm_HandSoldering","Oscillator/Oscillator_SMD_EuroQuartz_XO91-4Pin_7.0x5.0mm","Oscillator/Oscillator_SMD_EuroQuartz_XO91-4Pin_7.0x5.0mm_HandSoldering","Oscillator/Oscillator_SMD_Fordahl_DFAS1-6Pin_14.8x9.1mm","Oscillator/Oscillator_SMD_Fordahl_DFAS11-4Pin_7.0x5.0mm","Oscillator/Oscillator_SMD_Fordahl_DFAS11-4Pin_7.0x5.0mm_HandSoldering","Oscillator/Oscillator_SMD_Fordahl_DFAS15-4Pin_5.0x3.2mm","Oscillator/Oscillator_SMD_Fordahl_DFAS15-4Pin_5.0x3.2mm_HandSoldering","Oscillator/Oscillator_SMD_Fordahl_DFAS2-4Pin_7.3x5.1mm","Oscillator/Oscillator_SMD_Fordahl_DFAS2-4Pin_7.3x5.1mm_HandSoldering","Oscillator/Oscillator_SMD_Fordahl_DFAS3-4Pin_9.1x7.2mm","Oscillator/Oscillator_SMD_Fordahl_DFAS3-4Pin_9.1x7.2mm_HandSoldering","Oscillator/Oscillator_SMD_Fordahl_DFAS7-4Pin_19.9x12.9mm","Oscillator/Oscillator_SMD_Fordahl_DFAS7-4Pin_19.9x12.9mm_HandSoldering","Oscillator/Oscillator_SMD_Fox_FT5H_5.0x3.2mm","Oscillator/Oscillator_SMD_IDT_JS6-6_5.0x3.2mm_P1.27mm","Oscillator/Oscillator_SMD_IDT_JU6-6_7.0x5.0mm_P2.54mm","Oscillator/Oscillator_SMD_IQD_IQXO70-4Pin_7.5x5.0mm","Oscillator/Oscillator_SMD_IQD_IQXO70-4Pin_7.5x5.0mm_HandSoldering","Oscillator/Oscillator_SMD_Kyocera_2520-6Pin_2.5x2.0mm","Oscillator/Oscillator_SMD_Kyocera_KC2520Z-4Pin_2.5x2.0mm","Oscillator/Oscillator_SMD_OCXO_ConnorWinfield_OH300","Oscillator/Oscillator_SMD_SI570_SI571_HandSoldering","Oscillator/Oscillator_SMD_SI570_SI571_Standard","Oscillator/Oscillator_SMD_SeikoEpson_SG210-4Pin_2.5x2.0mm","Oscillator/Oscillator_SMD_SeikoEpson_SG210-4Pin_2.5x2.0mm_HandSoldering","Oscillator/Oscillator_SMD_SeikoEpson_SG3030CM","Oscillator/Oscillator_SMD_SeikoEpson_SG8002CA-4Pin_7.0x5.0mm","Oscillator/Oscillator_SMD_SeikoEpson_SG8002CA-4Pin_7.0x5.0mm_HandSoldering","Oscillator/Oscillator_SMD_SeikoEpson_SG8002CE-4Pin_3.2x2.5mm","Oscillator/Oscillator_SMD_SeikoEpson_SG8002CE-4Pin_3.2x2.5mm_HandSoldering","Oscillator/Oscillator_SMD_SeikoEpson_SG8002JA-4Pin_14.0x8.7mm","Oscillator/Oscillator_SMD_SeikoEpson_SG8002JA-4Pin_14.0x8.7mm_HandSoldering","Oscillator/Oscillator_SMD_SeikoEpson_SG8002JC-4Pin_10.5x5.0mm","Oscillator/Oscillator_SMD_SeikoEpson_SG8002JC-4Pin_10.5x5.0mm_HandSoldering","Oscillator/Oscillator_SMD_SeikoEpson_SG8002LB-4Pin_5.0x3.2mm","Oscillator/Oscillator_SMD_SeikoEpson_SG8002LB-4Pin_5.0x3.2mm_HandSoldering","Oscillator/Oscillator_SMD_SeikoEpson_TG2520SMN-xxx-xxxxxx-4Pin_2.5x2.0mm","Oscillator/Oscillator_SMD_SiT_PQFN-4Pin_2.0x1.6mm","Oscillator/Oscillator_SMD_SiT_PQFN-4Pin_2.5x2.0mm","Oscillator/Oscillator_SMD_SiT_PQFN-4Pin_3.2x2.5mm","Oscillator/Oscillator_SMD_SiT_PQFN-4Pin_5.0x3.2mm","Oscillator/Oscillator_SMD_SiT_PQFN-4Pin_7.0x5.0mm","Oscillator/Oscillator_SMD_SiTime_PQFD-6L_3.2x2.5mm","Oscillator/Oscillator_SMD_SiTime_SiT9121-6Pin_3.2x2.5mm","Oscillator/Oscillator_SMD_Silicon_Labs_LGA-6_2.5x3.2mm_P1.25mm","Oscillator/Oscillator_SMD_TCXO_G158","Oscillator/Oscillator_SMD_TXC_7C-4Pin_5.0x3.2mm","Oscillator/Oscillator_SMD_TXC_7C-4Pin_5.0x3.2mm_HandSoldering","Oscillator/Oscillator_SeikoEpson_SG-8002DB","Oscillator/Oscillator_SeikoEpson_SG-8002DC","Package_BGA/Alliance_TFBGA-36_6x8mm_Layout6x8_P0.75mm","Package_BGA/Alliance_TFBGA-54_8x8mm_Layout9x9_P0.8mm","Package_BGA/Analog_BGA-165_11.9x16mm_Layout11x15_P1.0mm","Package_BGA/Analog_BGA-209_9.5x16mm_Layout11x19_P0.8mm","Package_BGA/Analog_BGA-28_4x6.25mm_Layout4x7_P0.8mm","Package_BGA/Analog_BGA-49_6.25x6.25mm_Layout7x7_P0.8mm","Package_BGA/Analog_BGA-77_9x15mm_Layout7x11_P1.27mm","Package_BGA/BGA-100_11.0x11.0mm_Layout10x10_P1.0mm_Ball0.5mm_Pad0.4mm_NSMD","Package_BGA/BGA-100_12x18mm_Layout10x17_P1mm","Package_BGA/BGA-100_14x18mm_Layout10x17_P1mm","Package_BGA/BGA-100_6.0x6.0mm_Layout11x11_P0.5mm_Ball0.3mm_Pad0.25mm_NSMD","Package_BGA/BGA-1023_33.0x33.0mm_Layout32x32_P1.0mm","Package_BGA/BGA-1156_35.0x35.0mm_Layout34x34_P1.0mm","Package_BGA/BGA-121_9.0x9.0mm_Layout11x11_P0.8mm_Ball0.4mm_Pad0.35mm_NSMD","Package_BGA/BGA-1295_37.5x37.5mm_Layout36x36_P1.0mm","Package_BGA/BGA-132_12x18mm_Layout11x17_P1.0mm","Package_BGA/BGA-132_12x18mm_Layout11x17_P1mm","Package_BGA/BGA-144_13.0x13.0mm_Layout12x12_P1.0mm","Package_BGA/BGA-144_7.0x7.0mm_Layout13x13_P0.5mm_Ball0.3mm_Pad0.25mm_NSMD","Package_BGA/BGA-152_14x18mm_Layout13x17_P0.5mm","Package_BGA/BGA-152_14x18mm_Layout13x17_P1mm","Package_BGA/BGA-153_8.0x8.0mm_Layout15x15_P0.5mm_Ball0.3mm_Pad0.25mm_NSMD","Package_BGA/BGA-169_11.0x11.0mm_Layout13x13_P0.8mm_Ball0.5mm_Pad0.4mm_NSMD","Package_BGA/BGA-16_1.92x1.92mm_Layout4x4_P0.5mm","Package_BGA/BGA-196_15x15mm_Layout14x14_P1.0mm","Package_BGA/BGA-200_10x14.5mm_Layout12x22_P0.8x0.65mm","Package_BGA/BGA-24_6x8mm_Layout5x5_P1.0mm","Package_BGA/BGA-24_8x8mm_Layout5x5_P1.0mm","Package_BGA/BGA-256_11.0x11.0mm_Layout20x20_P0.5mm_Ball0.3mm_Pad0.25mm_NSMD","Package_BGA/BGA-256_14.0x14.0mm_Layout16x16_P0.8mm_Ball0.45mm_Pad0.32mm_NSMD","Package_BGA/BGA-256_17.0x17.0mm_Layout16x16_P1.0mm_Ball0.5mm_Pad0.4mm_NSMD","Package_BGA/BGA-25_6.35x6.35mm_Layout5x5_P1.27mm","Package_BGA/BGA-324_15.0x15.0mm_Layout18x18_P0.8mm_Ball0.5mm_Pad0.4mm_NSMD","Package_BGA/BGA-324_15x15mm_Layout18x18_P0.8mm","Package_BGA/BGA-324_19.0x19.0mm_Layout18x18_P1.0mm_Ball0.5mm_Pad0.4mm_NSMD","Package_BGA/BGA-352_35.0x35.0mm_Layout26x26_P1.27mm","Package_BGA/BGA-36_3.396x3.466mm_Layout6x6_P0.4mm_Ball0.25mm_Pad0.2mm_NSMD","Package_BGA/BGA-400_21.0x21.0mm_Layout20x20_P1.0mm","Package_BGA/BGA-484_23.0x23.0mm_Layout22x22_P1.0mm","Package_BGA/BGA-48_8.0x9.0mm_Layout6x8_P0.8mm","Package_BGA/BGA-529_19x19mm_Layout23x23_P0.8mm","Package_BGA/BGA-624_21x21mm_Layout25x25_P0.8mm","Package_BGA/BGA-625_21.0x21.0mm_Layout25x25_P0.8mm","Package_BGA/BGA-63_9x11mm_Layout10x12_P0.8mm","Package_BGA/BGA-64_9.0x9.0mm_Layout10x10_P0.8mm","Package_BGA/BGA-672_27.0x27.0mm_Layout26x26_P1.0mm_Ball0.6mm_Pad0.5mm_NSMD","Package_BGA/BGA-676_27.0x27.0mm_Layout26x26_P1.0mm_Ball0.6mm_Pad0.5mm_NSMD","Package_BGA/BGA-68_5.0x5.0mm_Layout9x9_P0.5mm_Ball0.3mm_Pad0.25mm_NSMD","Package_BGA/BGA-81_4.496x4.377mm_Layout9x9_P0.4mm_Ball0.25mm_Pad0.2mm_NSMD","Package_BGA/BGA-90_8.0x13.0mm_Layout2x3x15_P0.8mm","Package_BGA/BGA-96_9.0x13.0mm_Layout2x3x16_P0.8mm","Package_BGA/BGA-9_1.6x1.6mm_Layout3x3_P0.5mm","Package_BGA/EPC_BGA-4_0.9x0.9mm_Layout2x2_P0.45mm","Package_BGA/FB-BGA-484_23.0x23.0mm_Layout22x22_P1.0mm","Package_BGA/FBGA-78_7.5x10.5mm_Layout9x13_P0.8mm","Package_BGA/FBGA-78_7.5x10.6mm_Layout9x13_P0.8mm","Package_BGA/FBGA-78_7.5x11mm_Layout2x3x13_P0.8mm","Package_BGA/FBGA-78_8x10.5mm_Layout9x13_P0.8mm","Package_BGA/FBGA-78_9x10.5mm_Layout9x13_P0.8mm","Package_BGA/FBGA-78_9x10.6mm_Layout9x13_P0.8mm","Package_BGA/FBGA-96_7.5x13.5mm_Layout9x16_P0.8mm","Package_BGA/FBGA-96_7.5x13mm_Layout9x16_P0.8mm","Package_BGA/FBGA-96_8x13mm_Layout9x16_P0.8mm","Package_BGA/FBGA-96_8x14mm_Layout9x16_P0.8mm","Package_BGA/FBGA-96_9x13mm_Layout9x16_P0.8mm","Package_BGA/FBGA-96_9x14mm_Layout9x16_P0.8mm","Package_BGA/FCPBGA-780_23x23mm_Layout28x28_P0.8mm","Package_BGA/Fujitsu_WLP-15_2.28x3.092mm_Layout3x5_P0.4mm","Package_BGA/Infineon_LFBGA-292_17x17mm_Layout20x20_P0.8mm","Package_BGA/Infineon_TFBGA-48_6x10mm_Layout6x8_P0.75mm","Package_BGA/LFBGA-100_10x10mm_Layout10x10_P0.8mm","Package_BGA/LFBGA-144_10x10mm_Layout12x12_P0.8mm","Package_BGA/LFBGA-153_11.5x13mm_Layout14x14_P0.5mm","Package_BGA/LFBGA-169_12x16mm_Layout14x28_P0.5mm","Package_BGA/LFBGA-169_12x18mm_Layout14x28_P0.5mm","Package_BGA/LFBGA-169_14x18mm_Layout14x28_P0.5mm","Package_BGA/LFBGA-289_14x14mm_Layout17x17_P0.8mm","Package_BGA/LFBGA-400_16x16mm_Layout20x20_P0.8mm","Package_BGA/LFBGA-484_18x18mm_Layout22x22_P0.8mm","Package_BGA/Lattice_caBGA-381_17x17mm_Layout20x20_P0.8mm","Package_BGA/Lattice_caBGA-381_17x17mm_Layout20x20_P0.8mm_SMD","Package_BGA/Lattice_caBGA-756_27x27mm_Layout32x32_P0.8mm","Package_BGA/Lattice_iCE40_csBGA-132_8x8mm_Layout14x14_P0.5mm","Package_BGA/Linear_BGA-133_15.0x15.0mm_Layout12x12_P1.27mm","Package_BGA/MAPBGA-272_9x9mm_Layout17x17_P0.5mm","Package_BGA/MAPBGA-289_14x14mm_Layout17x17_P0.8mm","Package_BGA/Maxim_WLP-12","Package_BGA/Maxim_WLP-12_2.008x1.608mm_Layout4x3_P0.4mm","Package_BGA/Maxim_WLP-9_1.595x1.415_Layout3x3_P0.4mm_Ball0.27mm_Pad0.25mm_NSMD","Package_BGA/Microchip_FCG1152_BGA-1152_35x35mm_Layout34x34_P1.0mm","Package_BGA/Microchip_FCSG325_BGA-325_11x11mm_Layout21x21_P0.5mm","Package_BGA/Microchip_FCSG536_BGA-536_16x16mm_Layout30x30_P0.5mm","Package_BGA/Microchip_FCVG484_BGA-484_19x19mm_Layout22x22_P0.8mm","Package_BGA/Microchip_FCVG784_BGA-784_23x23mm_Layout28x28_P0.8mm","Package_BGA/Microchip_TFBGA-196_11x11mm_Layout14x14_P0.75mm_SMD","Package_BGA/Micron_FBGA-78_7.5x10.6mm_Layout9x13_P0.8mm","Package_BGA/Micron_FBGA-78_8x10.5mm_Layout9x13_P0.8mm","Package_BGA/Micron_FBGA-78_9x10.5mm_Layout9x13_P0.8mm","Package_BGA/Micron_FBGA-96_7.5x13.5mm_Layout9x16_P0.8mm","Package_BGA/Micron_FBGA-96_8x14mm_Layout9x16_P0.8mm","Package_BGA/Micron_FBGA-96_9x14mm_Layout9x16_P0.8mm","Package_BGA/NXP_SOT1982-1_VFBGA-98_7x7mm_Layout13x13_P0.5mm","Package_BGA/NXP_SOT2162-1_VFBGA-59_4x4mm_Layout9x9_P0.4mm","Package_BGA/NXP_TFBGA-50_5x5mm_Layout9x9_P0.5mm","Package_BGA/NXP_VFBGA-42_2.6x3mm_Layout6x7_P0.4mm","Package_BGA/ST_LFBGA-354_16x16mm_Layout19x19_P0.8mm","Package_BGA/ST_LFBGA-448_18x18mm_Layout22x22_P0.8mm","Package_BGA/ST_TFBGA-169_7x7mm_Layout13x13_P0.5mm","Package_BGA/ST_TFBGA-225_13x13mm_Layout15x15_P0.8mm","Package_BGA/ST_TFBGA-257_10x10mm_Layout19x19_P0.5mmP0.65mm","Package_BGA/ST_TFBGA-320_11x11mm_Layout21x21_P0.5mm","Package_BGA/ST_TFBGA-361_12x12mm_Layout23x23_P0.5mmP0.65mm","Package_BGA/ST_TFBGA-436_18x18mm_Layout22x22_P0.8mm","Package_BGA/ST_UFBGA-121_6x6mm_Layout11x11_P0.5mm","Package_BGA/ST_UFBGA-129_7x7mm_Layout13x13_P0.5mm","Package_BGA/ST_UFBGA-59_5x5mm_Layout8x8_P0.5mm","Package_BGA/ST_UFBGA-73_5x5mm_Layout9x9_P0.5mm","Package_BGA/ST_UFBGA-81_5x5mm_Layout9x9_P0.5mm","Package_BGA/ST_VFBGA-361_10x10mm_Layout19x19_P0.5mm","Package_BGA/ST_VFBGA-424_14x14mm_Layout27x27_P0.5mmP0.5x0.5mm_Stagger","Package_BGA/ST_uTFBGA-36_3.6x3.6mm_Layout6x6_P0.5mm","Package_BGA/TFBGA-100_5.5x5.5mm_Layout10x10_P0.5mm","Package_BGA/TFBGA-100_8x8mm_Layout10x10_P0.8mm","Package_BGA/TFBGA-100_9.0x9.0mm_Layout10x10_P0.8mm","Package_BGA/TFBGA-121_10x10mm_Layout11x11_P0.8mm","Package_BGA/TFBGA-169_9x9mm_Layout13x13_P0.65mm","Package_BGA/TFBGA-216_13x13mm_Layout15x15_P0.8mm","Package_BGA/TFBGA-225_10x10mm_Layout15x15_P0.65mm","Package_BGA/TFBGA-256_13x13mm_Layout16x16_P0.8mm","Package_BGA/TFBGA-265_14x14mm_Layout17x17_P0.8mm","Package_BGA/TFBGA-289_9x9mm_Layout17x17_P0.5mm","Package_BGA/TFBGA-324_12x12mm_Layout18x18_P0.65mm","Package_BGA/TFBGA-361_13x13mm_Layout19x19_P0.65mm","Package_BGA/TFBGA-48_6x10mm_Layout6x8_P0.75mm","Package_BGA/TFBGA-49_3x3mm_Layout7x7_P0.4mm","Package_BGA/TFBGA-576_16x16mm_Layout24x24_P0.65mm","Package_BGA/TFBGA-644_19x19mm_Layout28x28_P0.65mm","Package_BGA/TFBGA-64_5x5mm_Layout8x8_P0.5mm","Package_BGA/TFBGA-81_5x5mm_Layout9x9_P0.5mm","Package_BGA/Texas_BGA-289_15x15mm_Layout17x17_P0.8mm","Package_BGA/Texas_DSBGA-10_1.36x1.86mm_Layout3x4_P0.5mm","Package_BGA/Texas_DSBGA-12_1.36x1.86mm_Layout3x4_P0.5mm","Package_BGA/Texas_DSBGA-12_2.11x1.61mm_Layout4x3_P0.5mm","Package_BGA/Texas_DSBGA-16_2.39x2.39mm_Layout4x4_P0.5mm","Package_BGA/Texas_DSBGA-28_1.9x3mm_Layout4x7_P0.4mm","Package_BGA/Texas_DSBGA-49_3.33x3.488mm_Layout7x7_P0.4mm","Package_BGA/Texas_DSBGA-5_0.822x1.116mm_Layout2x1x2_P0.4mm","Package_BGA/Texas_DSBGA-5_0.8875x1.3875mm_Layout2x3_P0.5mm","Package_BGA/Texas_DSBGA-5_1.5855x1.6365mm_Layout3x2_P0.5mm","Package_BGA/Texas_DSBGA-64_3.415x3.535mm_Layout8x8_P0.4mm","Package_BGA/Texas_DSBGA-6_0.704x1.054mm_Layout2x3_P0.35mm","Package_BGA/Texas_DSBGA-6_0.757x1.01mm_Layout2x3_P0.35mm","Package_BGA/Texas_DSBGA-6_0.76x1.16mm_Layout2x3_P0.4mm","Package_BGA/Texas_DSBGA-6_0.855x1.255mm_Layout2x3_P0.4mm_LevelB","Package_BGA/Texas_DSBGA-6_0.855x1.255mm_Layout2x3_P0.4mm_LevelC","Package_BGA/Texas_DSBGA-6_0.95x1.488mm_Layout2x3_P0.4mm","Package_BGA/Texas_DSBGA-6_0.9x1.4mm_Layout2x3_P0.5mm","Package_BGA/Texas_DSBGA-8_0.705x1.468mm_Layout2x4_P0.4mm","Package_BGA/Texas_DSBGA-8_0.9x1.9mm_Layout2x4_P0.5mm","Package_BGA/Texas_DSBGA-8_1.43x1.41mm_Layout3x3_P0.5mm","Package_BGA/Texas_DSBGA-8_1.5195x1.5195mm_Layout3x3_P0.5mm","Package_BGA/Texas_DSBGA-9_1.4715x1.4715mm_Layout3x3_P0.5mm","Package_BGA/Texas_DSBGA-9_1.62x1.58mm_Layout3x3_P0.5mm","Package_BGA/Texas_MicroStar_Junior_BGA-113_7x7mm_Layout12x12_P0.5mm","Package_BGA/Texas_MicroStar_Junior_BGA-12_2.0x2.5mm_Layout4x3_P0.5mm","Package_BGA/Texas_MicroStar_Junior_BGA-80_5.0x5.0mm_Layout9x9_P0.5mm","Package_BGA/Texas_PicoStar_BGA-4_0.758x0.758mm_Layout2x2_P0.4mm","Package_BGA/Texas_YFP0020_DSBGA-20_1.588x1.988mm_Layout4x5_P0.4mm","Package_BGA/UCBGA-36_2.5x2.5mm_Layout6x6_P0.4mm","Package_BGA/UCBGA-49_3x3mm_Layout7x7_P0.4mm","Package_BGA/UCBGA-81_4x4mm_Layout9x9_P0.4mm","Package_BGA/UFBGA-100_7x7mm_Layout12x12_P0.5mm","Package_BGA/UFBGA-132_7x7mm_Layout12x12_P0.5mm","Package_BGA/UFBGA-132_7x7mm_P0.5mm","Package_BGA/UFBGA-144_10x10mm_Layout12x12_P0.8mm","Package_BGA/UFBGA-144_7x7mm_Layout12x12_P0.5mm","Package_BGA/UFBGA-15_3.0x3.0mm_Layout4x4_P0.65mm","Package_BGA/UFBGA-169_7x7mm_Layout13x13_P0.5mm","Package_BGA/UFBGA-201_10x10mm_Layout15x15_P0.65mm","Package_BGA/UFBGA-32_4.0x4.0mm_Layout6x6_P0.5mm","Package_BGA/UFBGA-64_5x5mm_Layout8x8_P0.5mm","Package_BGA/VFBGA-100_7.0x7.0mm_Layout10x10_P0.65mm","Package_BGA/VFBGA-49_5.0x5.0mm_Layout7x7_P0.65mm","Package_BGA/VFBGA-86_6x6mm_Layout10x10_P0.55mm","Package_BGA/WLP-4_0.728x0.728mm_Layout2x2_P0.35mm","Package_BGA/WLP-4_0.83x0.83mm_P0.4mm","Package_BGA/WLP-4_0.86x0.86mm_P0.4mm","Package_BGA/WLP-9_1.468x1.448mm_Layout3x3_P0.4mm","Package_BGA/XBGA-121_10x10mm_Layout11x11_P0.8mm","Package_BGA/XFBGA-121_8x8mm_Layout11x11_P0.65mm","Package_BGA/XFBGA-36_3.5x3.5mm_Layout6x6_P0.5mm","Package_BGA/XFBGA-64_5.0x5.0mm_Layout8x8_P0.5mm","Package_BGA/Xilinx_CLG225","Package_BGA/Xilinx_CLG400","Package_BGA/Xilinx_CLG484_CLG485","Package_BGA/Xilinx_CPG236","Package_BGA/Xilinx_CPG238","Package_BGA/Xilinx_CPGA196","Package_BGA/Xilinx_CSG324","Package_BGA/Xilinx_CSG325","Package_BGA/Xilinx_CSGA225","Package_BGA/Xilinx_CSGA324","Package_BGA/Xilinx_FBG484","Package_BGA/Xilinx_FBG676","Package_BGA/Xilinx_FBG900","Package_BGA/Xilinx_FFG1156","Package_BGA/Xilinx_FFG1157_FFG1158","Package_BGA/Xilinx_FFG1761","Package_BGA/Xilinx_FFG1926_FFG1927_FFG1928_FFG1930","Package_BGA/Xilinx_FFG676","Package_BGA/Xilinx_FFG900_FFG901","Package_BGA/Xilinx_FFV1761","Package_BGA/Xilinx_FGG484","Package_BGA/Xilinx_FGG676","Package_BGA/Xilinx_FGGA484","Package_BGA/Xilinx_FGGA676","Package_BGA/Xilinx_FHG1761","Package_BGA/Xilinx_FLG1925_FLG1926_FLG1928_FLG1930","Package_BGA/Xilinx_FTG256","Package_BGA/Xilinx_FTGB196","Package_BGA/Xilinx_RB484","Package_BGA/Xilinx_RB676","Package_BGA/Xilinx_RF1156","Package_BGA/Xilinx_RF1157_RF1158","Package_BGA/Xilinx_RF1761","Package_BGA/Xilinx_RF1930","Package_BGA/Xilinx_RF676","Package_BGA/Xilinx_RF900","Package_BGA/Xilinx_RFG676","Package_BGA/Xilinx_RS484","Package_BGA/Xilinx_SBG484","Package_BGA/Xilinx_SBG485","Package_BGA/csBGA-64_5x5mm_Layout8x8_P0.5mm","Package_BGA/ucBGA-64_4x4mm_Layout8x8_P0.4mm","Package_CSP/Analog_LFCSP-16-1EP_4x4mm_P0.65mm_EP2.1x2.1mm","Package_CSP/Analog_LFCSP-16-1EP_4x4mm_P0.65mm_EP2.1x2.1mm_ThermalVias","Package_CSP/Analog_LFCSP-16-1EP_4x4mm_P0.65mm_EP2.35x2.35mm","Package_CSP/Analog_LFCSP-16-1EP_4x4mm_P0.65mm_EP2.35x2.35mm_ThermalVias","Package_CSP/Analog_LFCSP-8-1EP_3x3mm_P0.5mm_EP1.53x1.85mm","Package_CSP/Analog_LFCSP-UQ-10_1.3x1.6mm_P0.4mm","Package_CSP/Anpec_WLCSP-20_1.76x2.03mm_Layout4x5_P0.4mm","Package_CSP/Dialog_WLCSP-34_4.54x1.66mm_Layout17x4_P0.25x0.34mm","Package_CSP/DiodesInc_GEA20_WLCSP-20_1.7x2.1mm_Layout4x5_P0.4mm","Package_CSP/Efinix_WLCSP-64_3.5353x3.3753mm_Layout8x8_P0.4mm","Package_CSP/Efinix_WLCSP-80_4.4567x3.5569mm_Layout10x8_P0.4mm","Package_CSP/LFCSP-10_2x2mm_P0.5mm","Package_CSP/LFCSP-16-1EP_3x3mm_P0.5mm_EP1.3x1.3mm","Package_CSP/LFCSP-16-1EP_3x3mm_P0.5mm_EP1.3x1.3mm_ThermalVias","Package_CSP/LFCSP-16-1EP_3x3mm_P0.5mm_EP1.5x1.5mm","Package_CSP/LFCSP-16-1EP_3x3mm_P0.5mm_EP1.6x1.6mm","Package_CSP/LFCSP-16-1EP_3x3mm_P0.5mm_EP1.6x1.6mm_ThermalVias","Package_CSP/LFCSP-16-1EP_3x3mm_P0.5mm_EP1.7x1.7mm","Package_CSP/LFCSP-16-1EP_3x3mm_P0.5mm_EP1.7x1.7mm_ThermalVias","Package_CSP/LFCSP-16-1EP_3x3mm_P0.5mm_EP1.854x1.854mm","Package_CSP/LFCSP-16-1EP_4x4mm_P0.65mm_EP2.1x2.1mm","Package_CSP/LFCSP-16-1EP_4x4mm_P0.65mm_EP2.4x2.4mm","Package_CSP/LFCSP-16-1EP_4x4mm_P0.65mm_EP2.4x2.4mm_ThermalVias","Package_CSP/LFCSP-16-1EP_4x4mm_P0.65mm_EP2.6x2.6mm","Package_CSP/LFCSP-16-1EP_4x4mm_P0.65mm_EP2.6x2.6mm_ThermalVias","Package_CSP/LFCSP-16_3x3mm_P0.5mm","Package_CSP/LFCSP-20-1EP_4x4mm_P0.5mm_EP2.1x2.1mm","Package_CSP/LFCSP-20-1EP_4x4mm_P0.5mm_EP2.1x2.1mm_ThermalVias","Package_CSP/LFCSP-20-1EP_4x4mm_P0.5mm_EP2.5x2.5mm","Package_CSP/LFCSP-20-1EP_4x4mm_P0.5mm_EP2.5x2.5mm_ThermalVias","Package_CSP/LFCSP-20-1EP_4x4mm_P0.5mm_EP2.6x2.6mm","Package_CSP/LFCSP-20-1EP_4x4mm_P0.5mm_EP2.6x2.6mm_ThermalVias","Package_CSP/LFCSP-24-1EP_4x4mm_P0.5mm_EP0.5x0.5mm","Package_CSP/LFCSP-24-1EP_4x4mm_P0.5mm_EP2.3x2.3mm","Package_CSP/LFCSP-24-1EP_4x4mm_P0.5mm_EP2.3x2.3mm_ThermalVias","Package_CSP/LFCSP-24-1EP_4x4mm_P0.5mm_EP2.5x2.5mm","Package_CSP/LFCSP-24-1EP_4x4mm_P0.5mm_EP2.5x2.5mm_ThermalVias","Package_CSP/LFCSP-28-1EP_5x5mm_P0.5mm_EP3.14x3.14mm","Package_CSP/LFCSP-28-1EP_5x5mm_P0.5mm_EP3.14x3.14mm_ThermalVias","Package_CSP/LFCSP-32-1EP_5x5mm_P0.5mm_EP3.1x3.1mm","Package_CSP/LFCSP-32-1EP_5x5mm_P0.5mm_EP3.1x3.1mm_ThermalVias","Package_CSP/LFCSP-32-1EP_5x5mm_P0.5mm_EP3.25x3.25mm","Package_CSP/LFCSP-32-1EP_5x5mm_P0.5mm_EP3.5x3.5mm","Package_CSP/LFCSP-32-1EP_5x5mm_P0.5mm_EP3.5x3.5mm_ThermalVias","Package_CSP/LFCSP-32-1EP_5x5mm_P0.5mm_EP3.6x3.6mm","Package_CSP/LFCSP-32-1EP_5x5mm_P0.5mm_EP3.6x3.6mm_ThermalVias","Package_CSP/LFCSP-40-1EP_6x6mm_P0.5mm_EP3.9x3.9mm","Package_CSP/LFCSP-40-1EP_6x6mm_P0.5mm_EP3.9x3.9mm_ThermalVias","Package_CSP/LFCSP-40-1EP_6x6mm_P0.5mm_EP4.65x4.65mm","Package_CSP/LFCSP-40-1EP_6x6mm_P0.5mm_EP4.65x4.65mm_ThermalVias","Package_CSP/LFCSP-40-1EP_6x6mm_P0.5mm_EP4.6x4.6mm","Package_CSP/LFCSP-40-1EP_6x6mm_P0.5mm_EP4.6x4.6mm_ThermalVias","Package_CSP/LFCSP-48-1EP_7x7mm_P0.5mm_EP4.1x4.1mm","Package_CSP/LFCSP-48-1EP_7x7mm_P0.5mm_EP4.1x4.1mm_ThermalVias","Package_CSP/LFCSP-56-1EP_8x8mm_P0.5mm_EP6.6x6.6mm","Package_CSP/LFCSP-56-1EP_8x8mm_P0.5mm_EP6.6x6.6mm_ThermalVias","Package_CSP/LFCSP-6-1EP_2x2mm_P0.65mm_EP1x1.6mm","Package_CSP/LFCSP-64-1EP_9x9mm_P0.5mm_EP5.21x5.21mm","Package_CSP/LFCSP-64-1EP_9x9mm_P0.5mm_EP5.21x5.21mm_ThermalVias","Package_CSP/LFCSP-72-1EP_10x10mm_P0.5mm_EP5.3x5.3mm","Package_CSP/LFCSP-72-1EP_10x10mm_P0.5mm_EP5.3x5.3mm_ThermalVias","Package_CSP/LFCSP-72-1EP_10x10mm_P0.5mm_EP6.15x6.15mm","Package_CSP/LFCSP-8-1EP_3x2mm_P0.5mm_EP1.6x1.65mm","Package_CSP/LFCSP-8-1EP_3x3mm_P0.5mm_EP1.45x1.74mm","Package_CSP/LFCSP-8-1EP_3x3mm_P0.5mm_EP1.6x2.34mm","Package_CSP/LFCSP-8-1EP_3x3mm_P0.5mm_EP1.6x2.34mm_ThermalVias","Package_CSP/LFCSP-8_2x2mm_P0.5mm","Package_CSP/LFCSP-VQ-24-1EP_4x4mm_P0.5mm_EP2.642x2.642mm","Package_CSP/LFCSP-VQ-48-1EP_7x7mm_P0.5mm","Package_CSP/LFCSP-WD-10-1EP_3x3mm_P0.5mm_EP1.64x2.38mm","Package_CSP/LFCSP-WD-10-1EP_3x3mm_P0.5mm_EP1.64x2.38mm_ThermalVias","Package_CSP/LFCSP-WD-8-1EP_3x3mm_P0.65mm_EP1.6x2.44mm","Package_CSP/LFCSP-WD-8-1EP_3x3mm_P0.65mm_EP1.6x2.44mm_ThermalVias","Package_CSP/Macronix_WLCSP-12_2.02x2.09mm_Layout4x4_P0.5mm","Package_CSP/Maxim_WLCSP-35_2.998x2.168mm_Layout7x5_P0.4mm","Package_CSP/NXP_SOT1444-5_WLCSP-49_3.44x3.44mm_Layout7x7_P0.4mm","Package_CSP/NXP_SOT1450-2_WLCSP-100_5.07x5.07mm_Layout10x10_P0.5mm","Package_CSP/Nexperia_WLCSP-15_2.37x1.17mm_Layout6x3_P0.4mmP0.8mm","Package_CSP/OnSemi_ODCSP36_BGA-36_6.13x6.13mm_Layout6x6_P1.0mm","Package_CSP/OnSemi_ODCSP36_BGA-36_6.13x6.13mm_Layout6x6_P1.0mm_ManualAssembly","Package_CSP/OnSemi_ODCSP8_BGA-8_3.16x3.16mm_Layout3x3_P1.26mm","Package_CSP/OnSemi_ODCSP8_BGA-8_3.16x3.16mm_Layout3x3_P1.26mm_ManualAssembly","Package_CSP/ST_WLCSP-100_4.437x4.456mm_Layout10x10_P0.4mm","Package_CSP/ST_WLCSP-100_4.4x4.38mm_Layout10x10_P0.4mm_Offcenter","Package_CSP/ST_WLCSP-100_Die422","Package_CSP/ST_WLCSP-100_Die446","Package_CSP/ST_WLCSP-100_Die452","Package_CSP/ST_WLCSP-100_Die461","Package_CSP/ST_WLCSP-101_3.86x3.79mm_Layout11x19_P0.35mm_Stagger","Package_CSP/ST_WLCSP-104_Die437","Package_CSP/ST_WLCSP-115_3.73x4.15mm_Layout11x21_P0.35mm_Stagger","Package_CSP/ST_WLCSP-115_4.63x4.15mm_Layout21x11_P0.4mm_Stagger","Package_CSP/ST_WLCSP-12_1.7x1.42mm_Layout4x6_P0.35mm_Stagger","Package_CSP/ST_WLCSP-132_4.57x4.37mm_Layout12x11_P0.35mm","Package_CSP/ST_WLCSP-143_Die419","Package_CSP/ST_WLCSP-143_Die449","Package_CSP/ST_WLCSP-144_Die470","Package_CSP/ST_WLCSP-150_5.38x5.47mm_Layout13x23_P0.4mm_Stagger","Package_CSP/ST_WLCSP-156_4.96x4.64mm_Layout13x12_P0.35mm","Package_CSP/ST_WLCSP-168_Die434","Package_CSP/ST_WLCSP-180_Die451","Package_CSP/ST_WLCSP-18_1.86x2.14mm_Layout7x5_P0.4mm_Stagger","Package_CSP/ST_WLCSP-19_1.643x2.492mm_Layout4x11_P0.35mm_Stagger","Package_CSP/ST_WLCSP-208_5.38x5.47mm_Layout26x16_P0.35mm_Stagger","Package_CSP/ST_WLCSP-208_5.8x5.6mm_Layout26x16_P0.35mm_Stagger","Package_CSP/ST_WLCSP-20_1.94x2.4mm_Layout4x5_P0.4mm","Package_CSP/ST_WLCSP-25_2.33x2.24mm_Layout5x5_P0.4mm","Package_CSP/ST_WLCSP-25_2.3x2.48mm_Layout5x5_P0.4mm","Package_CSP/ST_WLCSP-25_Die425","Package_CSP/ST_WLCSP-25_Die444","Package_CSP/ST_WLCSP-25_Die457","Package_CSP/ST_WLCSP-27_2.34x2.55mm_Layout9x6_P0.4mm_Stagger","Package_CSP/ST_WLCSP-36_2.58x3.07mm_Layout6x6_P0.4mm","Package_CSP/ST_WLCSP-36_2.652x2.592mm_Layout7x12_P0.4mm_Stagger_Offcenter","Package_CSP/ST_WLCSP-36_2.83x2.99mm_Layout7x13_P0.4mm_Stagger_Offcenter","Package_CSP/ST_WLCSP-36_Die417","Package_CSP/ST_WLCSP-36_Die440","Package_CSP/ST_WLCSP-36_Die445","Package_CSP/ST_WLCSP-36_Die458","Package_CSP/ST_WLCSP-39_2.76x2.78mm_Layout11x7_P0.4mm_Stagger","Package_CSP/ST_WLCSP-41_2.98x2.76mm_Layout13x7_P0.4mm_Stagger","Package_CSP/ST_WLCSP-42_2.93x2.82mm_Layout12x7_P0.4mm_Stagger","Package_CSP/ST_WLCSP-49_3.14x3.14mm_Layout7x7_P0.4mm_Offcenter","Package_CSP/ST_WLCSP-49_3.15x3.13mm_Layout7x7_P0.4mm","Package_CSP/ST_WLCSP-49_3.3x3.38mm_Layout7x7_P0.4mm_Offcenter","Package_CSP/ST_WLCSP-49_Die423","Package_CSP/ST_WLCSP-49_Die431","Package_CSP/ST_WLCSP-49_Die433","Package_CSP/ST_WLCSP-49_Die435","Package_CSP/ST_WLCSP-49_Die438","Package_CSP/ST_WLCSP-49_Die439","Package_CSP/ST_WLCSP-49_Die447","Package_CSP/ST_WLCSP-49_Die448","Package_CSP/ST_WLCSP-52_3.09x3.15mm_Layout13x8_P0.4mm_Stagger","Package_CSP/ST_WLCSP-56_3.38x3.38mm_Layout14x8_P0.4mm_Stagger","Package_CSP/ST_WLCSP-63_Die427","Package_CSP/ST_WLCSP-64_3.56x3.52mm_Layout8x8_P0.4mm","Package_CSP/ST_WLCSP-64_Die414","Package_CSP/ST_WLCSP-64_Die427","Package_CSP/ST_WLCSP-64_Die435","Package_CSP/ST_WLCSP-64_Die436","Package_CSP/ST_WLCSP-64_Die441","Package_CSP/ST_WLCSP-64_Die442","Package_CSP/ST_WLCSP-64_Die462","Package_CSP/ST_WLCSP-66_Die411","Package_CSP/ST_WLCSP-66_Die432","Package_CSP/ST_WLCSP-72_3.38x3.38mm_Layout16x9_P0.35mm_Stagger","Package_CSP/ST_WLCSP-72_Die415","Package_CSP/ST_WLCSP-80_3.5x3.27mm_Layout10x16_P0.35mm_Stagger_Offcenter","Package_CSP/ST_WLCSP-81_4.02x4.27mm_Layout9x9_P0.4mm","Package_CSP/ST_WLCSP-81_4.36x4.07mm_Layout9x9_P0.4mm","Package_CSP/ST_WLCSP-81_Die415","Package_CSP/ST_WLCSP-81_Die421","Package_CSP/ST_WLCSP-81_Die463","Package_CSP/ST_WLCSP-90_4.2x3.95mm_Layout18x10_P0.4mm_Stagger","Package_CSP/ST_WLCSP-90_Die413","Package_CSP/ST_WLCSP-99_4.42x3.77mm_Layout11x9_P0.35mm","Package_CSP/WLCSP-12_1.403x1.555mm_Layout6x4_P0.4mm_Stagger","Package_CSP/WLCSP-12_1.56x1.56mm_P0.4mm","Package_CSP/WLCSP-16_1.409x1.409mm_Layout4x4_P0.35mm","Package_CSP/WLCSP-16_2.225x2.17mm_Layout4x4_P0.5mm","Package_CSP/WLCSP-16_4x4_B2.17x2.32mm_P0.5mm","Package_CSP/WLCSP-20_1.934x2.434mm_Layout4x5_P0.4mm","Package_CSP/WLCSP-20_1.994x1.609mm_Layout5x4_P0.4mm","Package_CSP/WLCSP-20_1.994x1.94mm_Layout4x5_P0.4mm","Package_CSP/WLCSP-36_2.374x2.459mm_Layout6x6_P0.35mm","Package_CSP/WLCSP-36_2.82x2.67mm_Layout6x6_P0.4mm","Package_CSP/WLCSP-4_0.64x0.64mm_Layout2x2_P0.35mm","Package_CSP/WLCSP-4_0.89x0.89mm_Layout2x2_P0.5mm","Package_CSP/WLCSP-56_3.170x3.444mm_Layout7x8_P0.4mm","Package_CSP/WLCSP-6_1.46x1.1mm_Layout3x2_P0.4mm","Package_CSP/WLCSP-6_1.4x1.0mm_P0.4mm","Package_CSP/WLCSP-81_4.41x3.76mm_P0.4mm","Package_CSP/WLCSP-8_1.551x2.284mm_Layout2x4_P0.5mm","Package_CSP/WLCSP-8_1.58x1.63x0.35mm_Layout3x5_P0.35x0.4mm_Ball0.25mm_Pad0.25mm_NSMD","Package_CSP/WLCSP-9_1.21x1.22mm_Layout3x3_P0.4mm","Package_CSP/Xilinx_CSG48_7.0x7.0mm_Layout7x7_P0.8mm","Package_CSP/pSemi_CSP-16_1.64x2.04mm_P0.4mm","Package_CSP/pSemi_CSP-16_1.64x2.04mm_P0.4mm_Pad0.18mm","Package_DFN_QFN/AMS_QFN-4-1EP_2x2mm_P0.95mm_EP0.7x1.6mm","Package_DFN_QFN/AO_AOZ666xDI_DFN-8-1EP_3x3mm_P0.65mm_EP1.25x2.7mm","Package_DFN_QFN/AO_DFN-8-1EP_5.55x5.2mm_P1.27mm_EP4.12x4.6mm","Package_DFN_QFN/Analog_QFN-28-36-2EP_5x6mm_P0.5mm","Package_DFN_QFN/ArtInChip_QFN-100-1EP_12x12mm_P0.4mm_EP7.4x7.4mm","Package_DFN_QFN/ArtInChip_QFN-100-1EP_12x12mm_P0.4mm_EP7.4x7.4mm_ThermalVias","Package_DFN_QFN/ArtInChip_QFN-68-1EP_7x7mm_P0.35mm_EP5.49x5.49mm","Package_DFN_QFN/ArtInChip_QFN-68-1EP_7x7mm_P0.35mm_EP5.49x5.49mm_ThermalVias","Package_DFN_QFN/ArtInChip_QFN-88-1EP_10x10mm_P0.4mm_EP6.74x6.74mm","Package_DFN_QFN/ArtInChip_QFN-88-1EP_10x10mm_P0.4mm_EP6.74x6.74mm_ThermalVias","Package_DFN_QFN/CDFN-4_2.5x3.2mm_P2.1mm","Package_DFN_QFN/CDFN-4_2x2.5mm_P1.65mm","Package_DFN_QFN/CDFN-4_3.2x5mm_P2.54mm","Package_DFN_QFN/Cypress_QFN-56-1EP_8x8mm_P0.5mm_EP6.22x6.22mm_ThermalVias","Package_DFN_QFN/DFN-10-1EP_2.6x2.6mm_P0.5mm_EP1.3x2.2mm","Package_DFN_QFN/DFN-10-1EP_2.6x2.6mm_P0.5mm_EP1.3x2.2mm_ThermalVias","Package_DFN_QFN/DFN-10-1EP_2x3mm_P0.5mm_EP0.64x2.4mm","Package_DFN_QFN/DFN-10-1EP_3x3mm_P0.5mm_EP1.55x2.48mm","Package_DFN_QFN/DFN-10-1EP_3x3mm_P0.5mm_EP1.58x2.35mm","Package_DFN_QFN/DFN-10-1EP_3x3mm_P0.5mm_EP1.58x2.35mm_ThermalVias","Package_DFN_QFN/DFN-10-1EP_3x3mm_P0.5mm_EP1.646x3.1mm","Package_DFN_QFN/DFN-10-1EP_3x3mm_P0.5mm_EP1.646x3.1mm_ThermalVias","Package_DFN_QFN/DFN-10-1EP_3x3mm_P0.5mm_EP1.65x2.38mm","Package_DFN_QFN/DFN-10-1EP_3x3mm_P0.5mm_EP1.65x2.38mm_ThermalVias","Package_DFN_QFN/DFN-10-1EP_3x3mm_P0.5mm_EP1.75x2.7mm","Package_DFN_QFN/DFN-10-1EP_3x3mm_P0.5mm_EP1.7x2.5mm","Package_DFN_QFN/DFN-10_2x2mm_P0.4mm","Package_DFN_QFN/DFN-12-1EP_2x3mm_P0.45mm_EP0.64x2.4mm","Package_DFN_QFN/DFN-12-1EP_3x3mm_P0.45mm_EP1.65x2.38mm","Package_DFN_QFN/DFN-12-1EP_3x3mm_P0.45mm_EP1.65x2.38mm_ThermalVias","Package_DFN_QFN/DFN-12-1EP_3x3mm_P0.5mm_EP1.6x2.5mm","Package_DFN_QFN/DFN-12-1EP_3x3mm_P0.5mm_EP1.6x2.5mm_ThermalVias","Package_DFN_QFN/DFN-12-1EP_3x3mm_P0.5mm_EP2.05x2.86mm","Package_DFN_QFN/DFN-12-1EP_3x4mm_P0.5mm_EP1.7x3.3mm","Package_DFN_QFN/DFN-12-1EP_4x4mm_P0.5mm_EP2.66x3.38mm","Package_DFN_QFN/DFN-12-1EP_4x4mm_P0.65mm_EP2.64x3.54mm","Package_DFN_QFN/DFN-14-1EP_3x3mm_P0.4mm_EP1.78x2.35mm","Package_DFN_QFN/DFN-14-1EP_3x4.5mm_P0.65mm_EP1.65x4.25mm","Package_DFN_QFN/DFN-14-1EP_3x4.5mm_P0.65mm_EP1.65x4.25mm_ThermalVias","Package_DFN_QFN/DFN-14-1EP_3x4mm_P0.5mm_EP1.7x3.3mm","Package_DFN_QFN/DFN-14_1.35x3.5mm_P0.5mm","Package_DFN_QFN/DFN-16-1EP_3x4mm_P0.45mm_EP1.7x3.3mm","Package_DFN_QFN/DFN-16-1EP_3x5mm_P0.5mm_EP1.66x4.4mm","Package_DFN_QFN/DFN-16-1EP_4x5mm_P0.5mm_EP2.44x4.34mm","Package_DFN_QFN/DFN-16-1EP_5x5mm_P0.5mm_EP3.46x4mm","Package_DFN_QFN/DFN-18-1EP_3x5mm_P0.5mm_EP1.66x4.4mm","Package_DFN_QFN/DFN-18-1EP_4x5mm_P0.5mm_EP2.44x4.34mm","Package_DFN_QFN/DFN-20-1EP_5x6mm_P0.5mm_EP3.24x4.24mm","Package_DFN_QFN/DFN-22-1EP_5x6mm_P0.5mm_EP3.14x4.3mm","Package_DFN_QFN/DFN-24-1EP_4x7mm_P0.5mm_EP2.64x6.44mm","Package_DFN_QFN/DFN-32-1EP_4x7mm_P0.4mm_EP2.64x6.44mm","Package_DFN_QFN/DFN-44-1EP_5x8.9mm_P0.4mm_EP3.7x8.4mm","Package_DFN_QFN/DFN-4_5x7mm_P5.08mm","Package_DFN_QFN/DFN-6-1EP_1.2x1.2mm_P0.4mm_EP0.3x0.94mm_PullBack","Package_DFN_QFN/DFN-6-1EP_2x1.6mm_P0.5mm_EP1.15x1.3mm","Package_DFN_QFN/DFN-6-1EP_2x1.8mm_P0.5mm_EP1.2x1.6mm","Package_DFN_QFN/DFN-6-1EP_2x2mm_P0.5mm_EP0.61x1.42mm","Package_DFN_QFN/DFN-6-1EP_2x2mm_P0.5mm_EP0.6x1.37mm","Package_DFN_QFN/DFN-6-1EP_2x2mm_P0.5mm_EP0.7x1.6mm","Package_DFN_QFN/DFN-6-1EP_2x2mm_P0.65mm_EP1.01x1.7mm","Package_DFN_QFN/DFN-6-1EP_2x2mm_P0.65mm_EP1x1.6mm","Package_DFN_QFN/DFN-6-1EP_3x2mm_P0.5mm_EP1.65x1.35mm","Package_DFN_QFN/DFN-6-1EP_3x3mm_P0.95mm_EP1.7x2.6mm","Package_DFN_QFN/DFN-6-1EP_3x3mm_P1mm_EP1.5x2.4mm","Package_DFN_QFN/DFN-6_1.3x1.2mm_P0.4mm","Package_DFN_QFN/DFN-6_1.6x1.3mm_P0.4mm","Package_DFN_QFN/DFN-8-1EP_1.5x1.5mm_P0.4mm_EP0.7x1.2mm","Package_DFN_QFN/DFN-8-1EP_2x2mm_P0.45mm_EP0.64x1.37mm","Package_DFN_QFN/DFN-8-1EP_2x2mm_P0.5mm_EP0.6x1.2mm","Package_DFN_QFN/DFN-8-1EP_2x2mm_P0.5mm_EP0.86x1.55mm","Package_DFN_QFN/DFN-8-1EP_2x2mm_P0.5mm_EP0.8x1.6mm","Package_DFN_QFN/DFN-8-1EP_2x2mm_P0.5mm_EP0.9x1.3mm","Package_DFN_QFN/DFN-8-1EP_2x2mm_P0.5mm_EP0.9x1.5mm","Package_DFN_QFN/DFN-8-1EP_2x2mm_P0.5mm_EP0.9x1.6mm","Package_DFN_QFN/DFN-8-1EP_2x2mm_P0.5mm_EP0.9x1.7mm","Package_DFN_QFN/DFN-8-1EP_2x2mm_P0.5mm_EP1.05x1.75mm","Package_DFN_QFN/DFN-8-1EP_2x3mm_P0.5mm_EP0.61x2.2mm","Package_DFN_QFN/DFN-8-1EP_3x2mm_P0.45mm_EP1.66x1.36mm","Package_DFN_QFN/DFN-8-1EP_3x2mm_P0.5mm_EP1.36x1.46mm","Package_DFN_QFN/DFN-8-1EP_3x2mm_P0.5mm_EP1.3x1.5mm","Package_DFN_QFN/DFN-8-1EP_3x2mm_P0.5mm_EP1.75x1.45mm","Package_DFN_QFN/DFN-8-1EP_3x2mm_P0.5mm_EP1.7x1.4mm","Package_DFN_QFN/DFN-8-1EP_3x2mm_P0.5mm_EP1.7x1.6mm","Package_DFN_QFN/DFN-8-1EP_3x3mm_P0.5mm_EP1.65x2.38mm","Package_DFN_QFN/DFN-8-1EP_3x3mm_P0.5mm_EP1.65x2.38mm_ThermalVias","Package_DFN_QFN/DFN-8-1EP_3x3mm_P0.5mm_EP1.66x2.38mm","Package_DFN_QFN/DFN-8-1EP_3x3mm_P0.5mm_EP1.7x2.4mm","Package_DFN_QFN/DFN-8-1EP_3x3mm_P0.65mm_EP1.2x2.15mm","Package_DFN_QFN/DFN-8-1EP_3x3mm_P0.65mm_EP1.2x2.15mm_ThermalVias","Package_DFN_QFN/DFN-8-1EP_3x3mm_P0.65mm_EP1.55x2.4mm","Package_DFN_QFN/DFN-8-1EP_3x3mm_P0.65mm_EP1.5x2.25mm","Package_DFN_QFN/DFN-8-1EP_3x3mm_P0.65mm_EP1.6x2.56mm","Package_DFN_QFN/DFN-8-1EP_3x3mm_P0.65mm_EP1.6x2.56mm_ThermalVias","Package_DFN_QFN/DFN-8-1EP_3x3mm_P0.65mm_EP1.7x2.05mm","Package_DFN_QFN/DFN-8-1EP_4x4mm_P0.8mm_EP2.39x2.21mm","Package_DFN_QFN/DFN-8-1EP_4x4mm_P0.8mm_EP2.3x3.24mm","Package_DFN_QFN/DFN-8-1EP_4x4mm_P0.8mm_EP2.5x3.6mm","Package_DFN_QFN/DFN-8-1EP_6x5mm_P1.27mm_EP2x2mm","Package_DFN_QFN/DFN-8-1EP_6x5mm_P1.27mm_EP4x4mm","Package_DFN_QFN/DFN-8_2x2mm_P0.5mm","Package_DFN_QFN/DFN-S-8-1EP_6x5mm_P1.27mm","Package_DFN_QFN/DHVQFN-14-1EP_2.5x3mm_P0.5mm_EP1x1.5mm","Package_DFN_QFN/DHVQFN-14-1EP_2.5x3mm_P0.5mm_EP1x1.5mm_ThermalVias","Package_DFN_QFN/DHVQFN-16-1EP_2.5x3.5mm_P0.5mm_EP1x2mm","Package_DFN_QFN/DHVQFN-20-1EP_2.5x4.5mm_P0.5mm_EP1x3mm","Package_DFN_QFN/DHWQFN-14-1EP_2.5x3mm_P0.5mm_EP1x1.5mm","Package_DFN_QFN/DHWQFN-14-1EP_2.5x3mm_P0.5mm_EP1x1.5mm_ThermalVias","Package_DFN_QFN/Diodes_DFN1006-3","Package_DFN_QFN/Diodes_UDFN-10_1x2.5mm_P0.5mm","Package_DFN_QFN/Diodes_UDFN2020-6_Type-F","Package_DFN_QFN/Diodes_UDFN3810-9_TYPE_B","Package_DFN_QFN/Diodes_ZL32_TQFN-32-1EP_3x6mm_P0.4mm_EP1.25x3.5mm","Package_DFN_QFN/EPC_QFN-13-3EP_3.5x5mm_P0.5mm","Package_DFN_QFN/HVQFN-16-1EP_3x3mm_P0.5mm_EP1.5x1.5mm","Package_DFN_QFN/HVQFN-24-1EP_4x4mm_P0.5mm_EP2.1x2.1mm","Package_DFN_QFN/HVQFN-24-1EP_4x4mm_P0.5mm_EP2.5x2.5mm","Package_DFN_QFN/HVQFN-24-1EP_4x4mm_P0.5mm_EP2.5x2.5mm_ThermalVias","Package_DFN_QFN/HVQFN-24-1EP_4x4mm_P0.5mm_EP2.6x2.6mm","Package_DFN_QFN/HVQFN-24-1EP_4x4mm_P0.5mm_EP2.6x2.6mm_ThermalVias","Package_DFN_QFN/HVQFN-32-1EP_5x5mm_P0.5mm_EP3.1x3.1mm","Package_DFN_QFN/HVQFN-32-1EP_5x5mm_P0.5mm_EP3.1x3.1mm_ThermalVias","Package_DFN_QFN/HVQFN-36-1EP_6x6mm_P0.5mm_EP3.9x3.9mm","Package_DFN_QFN/HVQFN-36-1EP_6x6mm_P0.5mm_EP3.9x3.9mm_ThermalVias","Package_DFN_QFN/HVQFN-40-1EP_6x6mm_P0.5mm_EP4.1x4.1mm","Package_DFN_QFN/HVQFN-40-1EP_6x6mm_P0.5mm_EP4.1x4.1mm_ThermalVias","Package_DFN_QFN/HXQFN-16-1EP_3x3mm_P0.5mm_EP1.85x1.85mm","Package_DFN_QFN/HXQFN-16-1EP_3x3mm_P0.5mm_EP1.85x1.85mm_ThermalVias","Package_DFN_QFN/IDT_QFN-12-1EP_2x2mm_P0.5mm_EP1.1x1.1mm","Package_DFN_QFN/IDT_QFN-12-1EP_2x2mm_P0.5mm_EP1.1x1.1mm_ThermalVias","Package_DFN_QFN/Infineon_MLPQ-16-14-1EP_4x4mm_P0.5mm","Package_DFN_QFN/Infineon_MLPQ-40-32-1EP_7x7mm_P0.5mm","Package_DFN_QFN/Infineon_MLPQ-48-1EP_7x7mm_P0.5mm_EP5.15x5.15mm","Package_DFN_QFN/Infineon_MLPQ-48-1EP_7x7mm_P0.5mm_EP5.55x5.55mm","Package_DFN_QFN/Infineon_PQFN-22-15-4EP_6x5mm_P0.65mm","Package_DFN_QFN/Infineon_PQFN-44-31-5EP_7x7mm_P0.5mm","Package_DFN_QFN/LQFN-10-1EP_2x2mm_P0.5mm_EP0.7x0.7mm","Package_DFN_QFN/LQFN-12-1EP_2x2mm_P0.5mm_EP0.7x0.7mm","Package_DFN_QFN/LQFN-16-1EP_3x3mm_P0.5mm_EP1.7x1.7mm","Package_DFN_QFN/Linear_DE14MA","Package_DFN_QFN/Linear_UGK52_QFN-46-52","Package_DFN_QFN/MLF-20-1EP_4x4mm_P0.5mm_EP2.6x2.6mm","Package_DFN_QFN/MLF-20-1EP_4x4mm_P0.5mm_EP2.6x2.6mm_ThermalVias","Package_DFN_QFN/MLF-6-1EP_1.6x1.6mm_P0.5mm_EP0.5x1.26mm","Package_DFN_QFN/MLF-8-1EP_3x3mm_P0.65mm_EP1.55x2.3mm","Package_DFN_QFN/MLF-8-1EP_3x3mm_P0.65mm_EP1.55x2.3mm_ThermalVias","Package_DFN_QFN/MLPQ-16-1EP_4x4mm_P0.65mm_EP2.8x2.8mm","Package_DFN_QFN/MPS_QFN-12_2x2mm_P0.4mm","Package_DFN_QFN/MPS_QFN-16_3x3mm_P0.5mm","Package_DFN_QFN/Maxim_FC2QFN-14_2.5x2.5mm_P0.5mm","Package_DFN_QFN/Maxim_TDFN-10-1EP_3x3mm_P0.5mm_EP1.58x2.35mm","Package_DFN_QFN/Maxim_TDFN-12-1EP_3x3mm_P0.5mm_EP1.7x2.5mm","Package_DFN_QFN/Maxim_TDFN-12-1EP_3x3mm_P0.5mm_EP1.7x2.5mm_ThermalVias","Package_DFN_QFN/Maxim_TDFN-6-1EP_3x3mm_P0.95mm_EP1.5x2.3mm","Package_DFN_QFN/Maxim_WSON-8-1EP_3x2mm_P0.5mm_EP1.75x1.63mm","Package_DFN_QFN/Micrel_MLF-8-1EP_2x2mm_P0.5mm_EP0.6x1.2mm","Package_DFN_QFN/Micrel_MLF-8-1EP_2x2mm_P0.5mm_EP0.6x1.2mm_ThermalVias","Package_DFN_QFN/Micrel_MLF-8-1EP_2x2mm_P0.5mm_EP0.8x1.3mm_ThermalVias","Package_DFN_QFN/Microchip_8E-16","Package_DFN_QFN/Microchip_DRQFN-44-1EP_5x5mm_P0.7mm_EP2.65x2.65mm","Package_DFN_QFN/Microchip_DRQFN-44-1EP_5x5mm_P0.7mm_EP2.65x2.65mm_ThermalVias","Package_DFN_QFN/Microchip_DRQFN-64-1EP_7x7mm_P0.65mm_EP4.1x4.1mm","Package_DFN_QFN/Microchip_DRQFN-64-1EP_7x7mm_P0.65mm_EP4.1x4.1mm_ThermalVias","Package_DFN_QFN/Microsemi_QFN-40-32-2EP_6x8mm_P0.5mm","Package_DFN_QFN/Mini-Circuits_DL805","Package_DFN_QFN/Mini-Circuits_FG873-4_3x3mm","Package_DFN_QFN/NXP_LQFN-48-1EP_7x7mm_P0.5mm_EP3.5x3.5mm_16xMask0.45x0.45","Package_DFN_QFN/NXP_LQFN-48-1EP_7x7mm_P0.5mm_EP3.5x3.5mm_16xMask0.45x0.45_ThermalVias","Package_DFN_QFN/NXP_VQFN-16-1EP_4x4mm_P0.65mm_EP2.1x2.1mm","Package_DFN_QFN/Nordic_AQFN-73-1EP_7x7mm_P0.5mm","Package_DFN_QFN/Nordic_AQFN-94-1EP_7x7mm_P0.4mm","Package_DFN_QFN/OnSemi_DFN-14-1EP_4x4mm_P0.5mm_EP2.7x3.4mm","Package_DFN_QFN/OnSemi_DFN-8_2x2mm_P0.5mm","Package_DFN_QFN/OnSemi_SIP-38-6EP-9x7mm_P0.65mm_EP1.2x1.2mm","Package_DFN_QFN/OnSemi_UDFN-16-1EP_1.35x3.3mm_P0.4mm_EP0.4x2.8mm","Package_DFN_QFN/OnSemi_UDFN-8_1.2x1.8mm_P0.4mm","Package_DFN_QFN/OnSemi_VCT-28_3.5x3.5mm_P0.4mm","Package_DFN_QFN/OnSemi_XDFN-10_1.35x2.2mm_P0.4mm","Package_DFN_QFN/OnSemi_XDFN4-1EP_1.0x1.0mm_EP0.52x0.52mm","Package_DFN_QFN/PQFN-8-EP_6x5mm_P1.27mm_Generic","Package_DFN_QFN/Panasonic_HQFN-16-1EP_4x4mm_P0.65mm_EP2.9x2.9mm","Package_DFN_QFN/Panasonic_HSON-8_8x8mm_P2.00mm","Package_DFN_QFN/QFN-12-1EP_3x3mm_P0.51mm_EP1.45x1.45mm","Package_DFN_QFN/QFN-12-1EP_3x3mm_P0.5mm_EP1.45x1.45mm","Package_DFN_QFN/QFN-12-1EP_3x3mm_P0.5mm_EP1.45x1.45mm_ThermalVias","Package_DFN_QFN/QFN-12-1EP_3x3mm_P0.5mm_EP1.65x1.65mm","Package_DFN_QFN/QFN-12-1EP_3x3mm_P0.5mm_EP1.65x1.65mm_ThermalVias","Package_DFN_QFN/QFN-12-1EP_3x3mm_P0.5mm_EP1.6x1.6mm","Package_DFN_QFN/QFN-12-1EP_3x3mm_P0.5mm_EP1.6x1.6mm_ThermalVias","Package_DFN_QFN/QFN-16-1EP_1.8x2.6mm_P0.4mm_EP0.7x1.5mm","Package_DFN_QFN/QFN-16-1EP_1.8x2.6mm_P0.4mm_EP0.7x1.5mm_ThermalVias","Package_DFN_QFN/QFN-16-1EP_3x3mm_P0.5mm_EP1.45x1.45mm","Package_DFN_QFN/QFN-16-1EP_3x3mm_P0.5mm_EP1.45x1.45mm_ThermalVias","Package_DFN_QFN/QFN-16-1EP_3x3mm_P0.5mm_EP1.675x1.675mm","Package_DFN_QFN/QFN-16-1EP_3x3mm_P0.5mm_EP1.75x1.75mm","Package_DFN_QFN/QFN-16-1EP_3x3mm_P0.5mm_EP1.75x1.75mm_ThermalVias","Package_DFN_QFN/QFN-16-1EP_3x3mm_P0.5mm_EP1.7x1.7mm","Package_DFN_QFN/QFN-16-1EP_3x3mm_P0.5mm_EP1.7x1.7mm_ThermalVias","Package_DFN_QFN/QFN-16-1EP_3x3mm_P0.5mm_EP1.9x1.9mm","Package_DFN_QFN/QFN-16-1EP_3x3mm_P0.5mm_EP1.9x1.9mm_ThermalVias","Package_DFN_QFN/QFN-16-1EP_4x4mm_P0.5mm_EP2.45x2.45mm","Package_DFN_QFN/QFN-16-1EP_4x4mm_P0.5mm_EP2.45x2.45mm_ThermalVias","Package_DFN_QFN/QFN-16-1EP_4x4mm_P0.65mm_EP2.15x2.15mm","Package_DFN_QFN/QFN-16-1EP_4x4mm_P0.65mm_EP2.15x2.15mm_ThermalVias","Package_DFN_QFN/QFN-16-1EP_4x4mm_P0.65mm_EP2.1x2.1mm","Package_DFN_QFN/QFN-16-1EP_4x4mm_P0.65mm_EP2.1x2.1mm_ThermalVias","Package_DFN_QFN/QFN-16-1EP_4x4mm_P0.65mm_EP2.5x2.5mm","Package_DFN_QFN/QFN-16-1EP_4x4mm_P0.65mm_EP2.5x2.5mm_ThermalVias","Package_DFN_QFN/QFN-16-1EP_4x4mm_P0.65mm_EP2.7x2.7mm","Package_DFN_QFN/QFN-16-1EP_4x4mm_P0.65mm_EP2.7x2.7mm_PullBack","Package_DFN_QFN/QFN-16-1EP_4x4mm_P0.65mm_EP2.7x2.7mm_PullBack_ThermalVias","Package_DFN_QFN/QFN-16-1EP_4x4mm_P0.65mm_EP2.7x2.7mm_ThermalVias","Package_DFN_QFN/QFN-16-1EP_5x5mm_P0.8mm_EP2.7x2.7mm","Package_DFN_QFN/QFN-16-1EP_5x5mm_P0.8mm_EP2.7x2.7mm_ThermalVias","Package_DFN_QFN/QFN-20-1EP_3.5x3.5mm_P0.5mm_EP2x2mm","Package_DFN_QFN/QFN-20-1EP_3.5x3.5mm_P0.5mm_EP2x2mm_ThermalVias","Package_DFN_QFN/QFN-20-1EP_3x3mm_P0.45mm_EP1.6x1.6mm","Package_DFN_QFN/QFN-20-1EP_3x3mm_P0.45mm_EP1.6x1.6mm_ThermalVias","Package_DFN_QFN/QFN-20-1EP_3x3mm_P0.4mm_EP1.65x1.65mm","Package_DFN_QFN/QFN-20-1EP_3x3mm_P0.4mm_EP1.65x1.65mm_ThermalVias","Package_DFN_QFN/QFN-20-1EP_3x4mm_P0.5mm_EP1.65x2.65mm","Package_DFN_QFN/QFN-20-1EP_3x4mm_P0.5mm_EP1.65x2.65mm_ThermalVias","Package_DFN_QFN/QFN-20-1EP_4x4mm_P0.5mm_EP2.5x2.5mm","Package_DFN_QFN/QFN-20-1EP_4x4mm_P0.5mm_EP2.5x2.5mm_ThermalVias","Package_DFN_QFN/QFN-20-1EP_4x4mm_P0.5mm_EP2.6x2.6mm","Package_DFN_QFN/QFN-20-1EP_4x4mm_P0.5mm_EP2.6x2.6mm_ThermalVias","Package_DFN_QFN/QFN-20-1EP_4x4mm_P0.5mm_EP2.7x2.7mm","Package_DFN_QFN/QFN-20-1EP_4x4mm_P0.5mm_EP2.7x2.7mm_ThermalVias","Package_DFN_QFN/QFN-20-1EP_4x5mm_P0.5mm_EP2.65x3.65mm","Package_DFN_QFN/QFN-20-1EP_4x5mm_P0.5mm_EP2.65x3.65mm_ThermalVias","Package_DFN_QFN/QFN-20-1EP_5x5mm_P0.65mm_EP3.35x3.35mm","Package_DFN_QFN/QFN-20-1EP_5x5mm_P0.65mm_EP3.35x3.35mm_ThermalVias","Package_DFN_QFN/QFN-24-1EP_3x3mm_P0.4mm_EP1.75x1.6mm","Package_DFN_QFN/QFN-24-1EP_3x3mm_P0.4mm_EP1.75x1.6mm_ThermalVias","Package_DFN_QFN/QFN-24-1EP_3x4mm_P0.4mm_EP1.65x2.65mm","Package_DFN_QFN/QFN-24-1EP_3x4mm_P0.4mm_EP1.65x2.65mm_ThermalVias","Package_DFN_QFN/QFN-24-1EP_4x4mm_P0.5mm_EP2.15x2.15mm","Package_DFN_QFN/QFN-24-1EP_4x4mm_P0.5mm_EP2.15x2.15mm_ThermalVias","Package_DFN_QFN/QFN-24-1EP_4x4mm_P0.5mm_EP2.5x2.5mm","Package_DFN_QFN/QFN-24-1EP_4x4mm_P0.5mm_EP2.65x2.65mm","Package_DFN_QFN/QFN-24-1EP_4x4mm_P0.5mm_EP2.65x2.65mm_ThermalVias","Package_DFN_QFN/QFN-24-1EP_4x4mm_P0.5mm_EP2.6x2.6mm","Package_DFN_QFN/QFN-24-1EP_4x4mm_P0.5mm_EP2.6x2.6mm_ThermalVias","Package_DFN_QFN/QFN-24-1EP_4x4mm_P0.5mm_EP2.75x2.75mm","Package_DFN_QFN/QFN-24-1EP_4x4mm_P0.5mm_EP2.75x2.75mm_ThermalVias","Package_DFN_QFN/QFN-24-1EP_4x4mm_P0.5mm_EP2.7x2.6mm","Package_DFN_QFN/QFN-24-1EP_4x4mm_P0.5mm_EP2.7x2.6mm_ThermalVias","Package_DFN_QFN/QFN-24-1EP_4x4mm_P0.5mm_EP2.7x2.7mm","Package_DFN_QFN/QFN-24-1EP_4x4mm_P0.5mm_EP2.7x2.7mm_ThermalVias","Package_DFN_QFN/QFN-24-1EP_4x4mm_P0.5mm_EP2.8x2.8mm","Package_DFN_QFN/QFN-24-1EP_4x4mm_P0.5mm_EP2.8x2.8mm_ThermalVias","Package_DFN_QFN/QFN-24-1EP_4x5mm_P0.5mm_EP2.65x3.65mm","Package_DFN_QFN/QFN-24-1EP_4x5mm_P0.5mm_EP2.65x3.65mm_ThermalVias","Package_DFN_QFN/QFN-24-1EP_5x5mm_P0.65mm_EP3.25x3.25mm","Package_DFN_QFN/QFN-24-1EP_5x5mm_P0.65mm_EP3.25x3.25mm_ThermalVias","Package_DFN_QFN/QFN-24-1EP_5x5mm_P0.65mm_EP3.2x3.2mm","Package_DFN_QFN/QFN-24-1EP_5x5mm_P0.65mm_EP3.2x3.2mm_ThermalVias","Package_DFN_QFN/QFN-24-1EP_5x5mm_P0.65mm_EP3.4x3.4mm","Package_DFN_QFN/QFN-24-1EP_5x5mm_P0.65mm_EP3.4x3.4mm_ThermalVias","Package_DFN_QFN/QFN-24-1EP_5x5mm_P0.65mm_EP3.6x3.6mm","Package_DFN_QFN/QFN-24-1EP_5x5mm_P0.65mm_EP3.6x3.6mm_ThermalVias","Package_DFN_QFN/QFN-28-1EP_3x6mm_P0.5mm_EP1.7x4.75mm","Package_DFN_QFN/QFN-28-1EP_3x6mm_P0.5mm_EP1.7x4.75mm_ThermalVias","Package_DFN_QFN/QFN-28-1EP_4x4mm_P0.45mm_EP2.4x2.4mm","Package_DFN_QFN/QFN-28-1EP_4x4mm_P0.45mm_EP2.4x2.4mm_ThermalVias","Package_DFN_QFN/QFN-28-1EP_4x4mm_P0.45mm_EP2.6x2.6mm","Package_DFN_QFN/QFN-28-1EP_4x4mm_P0.4mm_EP2.3x2.3mm","Package_DFN_QFN/QFN-28-1EP_4x4mm_P0.4mm_EP2.3x2.3mm_ThermalVias","Package_DFN_QFN/QFN-28-1EP_4x4mm_P0.4mm_EP2.4x2.4mm","Package_DFN_QFN/QFN-28-1EP_4x4mm_P0.4mm_EP2.4x2.4mm_ThermalVias","Package_DFN_QFN/QFN-28-1EP_4x5mm_P0.5mm_EP2.65x3.65mm","Package_DFN_QFN/QFN-28-1EP_4x5mm_P0.5mm_EP2.65x3.65mm_ThermalVias","Package_DFN_QFN/QFN-28-1EP_5x5mm_P0.5mm_EP2.7x2.7mm","Package_DFN_QFN/QFN-28-1EP_5x5mm_P0.5mm_EP2.7x2.7mm_ThermalVias","Package_DFN_QFN/QFN-28-1EP_5x5mm_P0.5mm_EP3.1x3.1mm","Package_DFN_QFN/QFN-28-1EP_5x5mm_P0.5mm_EP3.1x3.1mm_ThermalVias","Package_DFN_QFN/QFN-28-1EP_5x5mm_P0.5mm_EP3.25x3.25mm","Package_DFN_QFN/QFN-28-1EP_5x5mm_P0.5mm_EP3.25x3.25mm_ThermalVias","Package_DFN_QFN/QFN-28-1EP_5x5mm_P0.5mm_EP3.35x3.35mm","Package_DFN_QFN/QFN-28-1EP_5x5mm_P0.5mm_EP3.35x3.35mm_ThermalVias","Package_DFN_QFN/QFN-28-1EP_5x5mm_P0.5mm_EP3.75x3.75mm","Package_DFN_QFN/QFN-28-1EP_5x5mm_P0.5mm_EP3.75x3.75mm_ThermalVias","Package_DFN_QFN/QFN-28-1EP_5x6mm_P0.5mm_EP3.65x4.65mm","Package_DFN_QFN/QFN-28-1EP_5x6mm_P0.5mm_EP3.65x4.65mm_ThermalVias","Package_DFN_QFN/QFN-28-1EP_6x6mm_P0.65mm_EP4.25x4.25mm","Package_DFN_QFN/QFN-28-1EP_6x6mm_P0.65mm_EP4.25x4.25mm_ThermalVias","Package_DFN_QFN/QFN-28-1EP_6x6mm_P0.65mm_EP4.8x4.8mm","Package_DFN_QFN/QFN-28-1EP_6x6mm_P0.65mm_EP4.8x4.8mm_ThermalVias","Package_DFN_QFN/QFN-28_4x4mm_P0.5mm","Package_DFN_QFN/QFN-32-1EP_4x4mm_P0.4mm_EP2.65x2.65mm","Package_DFN_QFN/QFN-32-1EP_4x4mm_P0.4mm_EP2.65x2.65mm_ThermalVias","Package_DFN_QFN/QFN-32-1EP_4x4mm_P0.4mm_EP2.9x2.9mm","Package_DFN_QFN/QFN-32-1EP_4x4mm_P0.4mm_EP2.9x2.9mm_ThermalVias","Package_DFN_QFN/QFN-32-1EP_5x5mm_P0.5mm_EP3.1x3.1mm","Package_DFN_QFN/QFN-32-1EP_5x5mm_P0.5mm_EP3.1x3.1mm_ThermalVias","Package_DFN_QFN/QFN-32-1EP_5x5mm_P0.5mm_EP3.3x3.3mm","Package_DFN_QFN/QFN-32-1EP_5x5mm_P0.5mm_EP3.3x3.3mm_ThermalVias","Package_DFN_QFN/QFN-32-1EP_5x5mm_P0.5mm_EP3.45x3.45mm","Package_DFN_QFN/QFN-32-1EP_5x5mm_P0.5mm_EP3.45x3.45mm_ThermalVias","Package_DFN_QFN/QFN-32-1EP_5x5mm_P0.5mm_EP3.65x3.65mm","Package_DFN_QFN/QFN-32-1EP_5x5mm_P0.5mm_EP3.65x3.65mm_ThermalVias","Package_DFN_QFN/QFN-32-1EP_5x5mm_P0.5mm_EP3.6x3.6mm","Package_DFN_QFN/QFN-32-1EP_5x5mm_P0.5mm_EP3.6x3.6mm_ThermalVias","Package_DFN_QFN/QFN-32-1EP_5x5mm_P0.5mm_EP3.7x3.7mm","Package_DFN_QFN/QFN-32-1EP_5x5mm_P0.5mm_EP3.7x3.7mm_ThermalVias","Package_DFN_QFN/QFN-32-1EP_7x7mm_P0.65mm_EP4.65x4.65mm","Package_DFN_QFN/QFN-32-1EP_7x7mm_P0.65mm_EP4.65x4.65mm_ThermalVias","Package_DFN_QFN/QFN-32-1EP_7x7mm_P0.65mm_EP4.7x4.7mm","Package_DFN_QFN/QFN-32-1EP_7x7mm_P0.65mm_EP4.7x4.7mm_ThermalVias","Package_DFN_QFN/QFN-32-1EP_7x7mm_P0.65mm_EP5.4x5.4mm","Package_DFN_QFN/QFN-32-1EP_7x7mm_P0.65mm_EP5.4x5.4mm_ThermalVias","Package_DFN_QFN/QFN-36-1EP_5x6mm_P0.5mm_EP3.6x4.1mm","Package_DFN_QFN/QFN-36-1EP_5x6mm_P0.5mm_EP3.6x4.1mm_ThermalVias","Package_DFN_QFN/QFN-36-1EP_5x6mm_P0.5mm_EP3.6x4.6mm","Package_DFN_QFN/QFN-36-1EP_5x6mm_P0.5mm_EP3.6x4.6mm_ThermalVias","Package_DFN_QFN/QFN-36-1EP_6x6mm_P0.5mm_EP3.7x3.7mm","Package_DFN_QFN/QFN-36-1EP_6x6mm_P0.5mm_EP3.7x3.7mm_ThermalVias","Package_DFN_QFN/QFN-36-1EP_6x6mm_P0.5mm_EP4.1x4.1mm","Package_DFN_QFN/QFN-36-1EP_6x6mm_P0.5mm_EP4.1x4.1mm_ThermalVias","Package_DFN_QFN/QFN-38-1EP_4x6mm_P0.4mm_EP2.65x4.65mm","Package_DFN_QFN/QFN-38-1EP_4x6mm_P0.4mm_EP2.65x4.65mm_ThermalVias","Package_DFN_QFN/QFN-40-1EP_5x5mm_P0.4mm_EP3.6x3.6mm","Package_DFN_QFN/QFN-40-1EP_5x5mm_P0.4mm_EP3.6x3.6mm_ThermalVias","Package_DFN_QFN/QFN-40-1EP_5x5mm_P0.4mm_EP3.8x3.8mm","Package_DFN_QFN/QFN-40-1EP_5x5mm_P0.4mm_EP3.8x3.8mm_ThermalVias","Package_DFN_QFN/QFN-40-1EP_6x6mm_P0.5mm_EP4.6x4.6mm","Package_DFN_QFN/QFN-40-1EP_6x6mm_P0.5mm_EP4.6x4.6mm_ThermalVias","Package_DFN_QFN/QFN-42-1EP_5x6mm_P0.4mm_EP3.7x4.7mm","Package_DFN_QFN/QFN-42-1EP_5x6mm_P0.4mm_EP3.7x4.7mm_ThermalVias","Package_DFN_QFN/QFN-44-1EP_7x7mm_P0.5mm_EP5.15x5.15mm","Package_DFN_QFN/QFN-44-1EP_7x7mm_P0.5mm_EP5.15x5.15mm_ThermalVias","Package_DFN_QFN/QFN-44-1EP_7x7mm_P0.5mm_EP5.2x5.2mm","Package_DFN_QFN/QFN-44-1EP_7x7mm_P0.5mm_EP5.2x5.2mm_ThermalVias","Package_DFN_QFN/QFN-44-1EP_8x8mm_P0.65mm_EP6.45x6.45mm","Package_DFN_QFN/QFN-44-1EP_8x8mm_P0.65mm_EP6.45x6.45mm_ThermalVias","Package_DFN_QFN/QFN-44-1EP_9x9mm_P0.65mm_EP7.5x7.5mm","Package_DFN_QFN/QFN-44-1EP_9x9mm_P0.65mm_EP7.5x7.5mm_ThermalVias","Package_DFN_QFN/QFN-48-1EP_5x5mm_P0.35mm_EP3.7x3.7mm","Package_DFN_QFN/QFN-48-1EP_5x5mm_P0.35mm_EP3.7x3.7mm_ThermalVias","Package_DFN_QFN/QFN-48-1EP_6x6mm_P0.4mm_EP4.2x4.2mm","Package_DFN_QFN/QFN-48-1EP_6x6mm_P0.4mm_EP4.2x4.2mm_ThermalVias","Package_DFN_QFN/QFN-48-1EP_6x6mm_P0.4mm_EP4.3x4.3mm","Package_DFN_QFN/QFN-48-1EP_6x6mm_P0.4mm_EP4.3x4.3mm_ThermalVias","Package_DFN_QFN/QFN-48-1EP_6x6mm_P0.4mm_EP4.4x4.4mm","Package_DFN_QFN/QFN-48-1EP_6x6mm_P0.4mm_EP4.4x4.4mm_ThermalVias","Package_DFN_QFN/QFN-48-1EP_6x6mm_P0.4mm_EP4.66x4.66mm","Package_DFN_QFN/QFN-48-1EP_6x6mm_P0.4mm_EP4.66x4.66mm_ThermalVias","Package_DFN_QFN/QFN-48-1EP_6x6mm_P0.4mm_EP4.6x4.6mm","Package_DFN_QFN/QFN-48-1EP_6x6mm_P0.4mm_EP4.6x4.6mm_ThermalVias","Package_DFN_QFN/QFN-48-1EP_7x7mm_P0.5mm_EP3.5x3.5mm","Package_DFN_QFN/QFN-48-1EP_7x7mm_P0.5mm_EP3.5x3.5mm_ThermalVias","Package_DFN_QFN/QFN-48-1EP_7x7mm_P0.5mm_EP5.15x5.15mm","Package_DFN_QFN/QFN-48-1EP_7x7mm_P0.5mm_EP5.15x5.15mm_ThermalVias","Package_DFN_QFN/QFN-48-1EP_7x7mm_P0.5mm_EP5.1x5.1mm","Package_DFN_QFN/QFN-48-1EP_7x7mm_P0.5mm_EP5.1x5.1mm_ThermalVias","Package_DFN_QFN/QFN-48-1EP_7x7mm_P0.5mm_EP5.3x5.3mm","Package_DFN_QFN/QFN-48-1EP_7x7mm_P0.5mm_EP5.3x5.3mm_ThermalVias","Package_DFN_QFN/QFN-48-1EP_7x7mm_P0.5mm_EP5.45x5.45mm","Package_DFN_QFN/QFN-48-1EP_7x7mm_P0.5mm_EP5.45x5.45mm_ThermalVias","Package_DFN_QFN/QFN-48-1EP_7x7mm_P0.5mm_EP5.6x5.6mm","Package_DFN_QFN/QFN-48-1EP_7x7mm_P0.5mm_EP5.6x5.6mm_ThermalVias","Package_DFN_QFN/QFN-48-1EP_7x7mm_P0.5mm_EP5.7x5.7mm","Package_DFN_QFN/QFN-48-1EP_7x7mm_P0.5mm_EP5.7x5.7mm_ThermalVias","Package_DFN_QFN/QFN-48-1EP_8x8mm_P0.5mm_EP6.2x6.2mm","Package_DFN_QFN/QFN-48-1EP_8x8mm_P0.5mm_EP6.2x6.2mm_ThermalVias","Package_DFN_QFN/QFN-52-1EP_7x8mm_P0.5mm_EP5.41x6.45mm","Package_DFN_QFN/QFN-52-1EP_7x8mm_P0.5mm_EP5.41x6.45mm_ThermalVias","Package_DFN_QFN/QFN-56-1EP_7x7mm_P0.4mm_EP3.2x3.2mm","Package_DFN_QFN/QFN-56-1EP_7x7mm_P0.4mm_EP3.2x3.2mm_ThermalVias","Package_DFN_QFN/QFN-56-1EP_7x7mm_P0.4mm_EP4x4mm","Package_DFN_QFN/QFN-56-1EP_7x7mm_P0.4mm_EP4x4mm_ThermalVias","Package_DFN_QFN/QFN-56-1EP_7x7mm_P0.4mm_EP5.6x5.6mm","Package_DFN_QFN/QFN-56-1EP_7x7mm_P0.4mm_EP5.6x5.6mm_ThermalVias","Package_DFN_QFN/QFN-56-1EP_8x8mm_P0.5mm_EP4.3x4.3mm","Package_DFN_QFN/QFN-56-1EP_8x8mm_P0.5mm_EP4.3x4.3mm_ThermalVias","Package_DFN_QFN/QFN-56-1EP_8x8mm_P0.5mm_EP4.5x5.2mm","Package_DFN_QFN/QFN-56-1EP_8x8mm_P0.5mm_EP4.5x5.2mm_ThermalVias","Package_DFN_QFN/QFN-56-1EP_8x8mm_P0.5mm_EP4.5x5.2mm_ThermalVias_TopTented","Package_DFN_QFN/QFN-56-1EP_8x8mm_P0.5mm_EP5.6x5.6mm","Package_DFN_QFN/QFN-56-1EP_8x8mm_P0.5mm_EP5.6x5.6mm_ThermalVias","Package_DFN_QFN/QFN-56-1EP_8x8mm_P0.5mm_EP5.9x5.9mm","Package_DFN_QFN/QFN-56-1EP_8x8mm_P0.5mm_EP5.9x5.9mm_ThermalVias","Package_DFN_QFN/QFN-56-1EP_8x8mm_P0.5mm_EP6.1x6.1mm","Package_DFN_QFN/QFN-56-1EP_8x8mm_P0.5mm_EP6.1x6.1mm_ThermalVias","Package_DFN_QFN/QFN-60-1EP_7x7mm_P0.4mm_EP3.4x3.4mm","Package_DFN_QFN/QFN-60-1EP_7x7mm_P0.4mm_EP3.4x3.4mm_ThermalVias","Package_DFN_QFN/QFN-64-1EP_8x8mm_P0.4mm_EP6.5x6.5mm","Package_DFN_QFN/QFN-64-1EP_8x8mm_P0.4mm_EP6.5x6.5mm_ThermalVias","Package_DFN_QFN/QFN-64-1EP_9x9mm_P0.5mm_EP3.4x3.4mm","Package_DFN_QFN/QFN-64-1EP_9x9mm_P0.5mm_EP3.4x3.4mm_ThermalVias","Package_DFN_QFN/QFN-64-1EP_9x9mm_P0.5mm_EP3.8x3.8mm","Package_DFN_QFN/QFN-64-1EP_9x9mm_P0.5mm_EP3.8x3.8mm_ThermalVias","Package_DFN_QFN/QFN-64-1EP_9x9mm_P0.5mm_EP4.1x4.1mm","Package_DFN_QFN/QFN-64-1EP_9x9mm_P0.5mm_EP4.1x4.1mm_ThermalVias","Package_DFN_QFN/QFN-64-1EP_9x9mm_P0.5mm_EP4.35x4.35mm","Package_DFN_QFN/QFN-64-1EP_9x9mm_P0.5mm_EP4.35x4.35mm_ThermalVias","Package_DFN_QFN/QFN-64-1EP_9x9mm_P0.5mm_EP4.7x4.7mm","Package_DFN_QFN/QFN-64-1EP_9x9mm_P0.5mm_EP4.7x4.7mm_ThermalVias","Package_DFN_QFN/QFN-64-1EP_9x9mm_P0.5mm_EP5.2x5.2mm","Package_DFN_QFN/QFN-64-1EP_9x9mm_P0.5mm_EP5.2x5.2mm_ThermalVias","Package_DFN_QFN/QFN-64-1EP_9x9mm_P0.5mm_EP5.45x5.45mm","Package_DFN_QFN/QFN-64-1EP_9x9mm_P0.5mm_EP5.45x5.45mm_ThermalVias","Package_DFN_QFN/QFN-64-1EP_9x9mm_P0.5mm_EP5.4x5.4mm","Package_DFN_QFN/QFN-64-1EP_9x9mm_P0.5mm_EP5.4x5.4mm_ThermalVias","Package_DFN_QFN/QFN-64-1EP_9x9mm_P0.5mm_EP5.7x5.7mm","Package_DFN_QFN/QFN-64-1EP_9x9mm_P0.5mm_EP5.7x5.7mm_ThermalVias","Package_DFN_QFN/QFN-64-1EP_9x9mm_P0.5mm_EP6x6mm","Package_DFN_QFN/QFN-64-1EP_9x9mm_P0.5mm_EP6x6mm_ThermalVias","Package_DFN_QFN/QFN-64-1EP_9x9mm_P0.5mm_EP7.15x7.15mm","Package_DFN_QFN/QFN-64-1EP_9x9mm_P0.5mm_EP7.15x7.15mm_ThermalVias","Package_DFN_QFN/QFN-64-1EP_9x9mm_P0.5mm_EP7.25x7.25mm","Package_DFN_QFN/QFN-64-1EP_9x9mm_P0.5mm_EP7.35x7.35mm","Package_DFN_QFN/QFN-64-1EP_9x9mm_P0.5mm_EP7.3x7.3mm","Package_DFN_QFN/QFN-64-1EP_9x9mm_P0.5mm_EP7.3x7.3mm_ThermalVias","Package_DFN_QFN/QFN-64-1EP_9x9mm_P0.5mm_EP7.5x7.5mm","Package_DFN_QFN/QFN-64-1EP_9x9mm_P0.5mm_EP7.5x7.5mm_ThermalVias","Package_DFN_QFN/QFN-64-1EP_9x9mm_P0.5mm_EP7.65x7.65mm","Package_DFN_QFN/QFN-64-1EP_9x9mm_P0.5mm_EP7.65x7.65mm_ThermalVias","Package_DFN_QFN/QFN-68-1EP_8x8mm_P0.4mm_EP5.2x5.2mm","Package_DFN_QFN/QFN-68-1EP_8x8mm_P0.4mm_EP5.2x5.2mm_ThermalVias","Package_DFN_QFN/QFN-68-1EP_8x8mm_P0.4mm_EP6.4x6.4mm","Package_DFN_QFN/QFN-68-1EP_8x8mm_P0.4mm_EP6.4x6.4mm_ThermalVias","Package_DFN_QFN/QFN-72-1EP_10x10mm_P0.5mm_EP6x6mm","Package_DFN_QFN/QFN-72-1EP_10x10mm_P0.5mm_EP6x6mm_ThermalVias","Package_DFN_QFN/QFN-76-1EP_9x9mm_P0.4mm_EP3.8x3.8mm","Package_DFN_QFN/QFN-76-1EP_9x9mm_P0.4mm_EP3.8x3.8mm_ThermalVias","Package_DFN_QFN/QFN-76-1EP_9x9mm_P0.4mm_EP5.81x6.31mm","Package_DFN_QFN/QFN-76-1EP_9x9mm_P0.4mm_EP5.81x6.31mm_ThermalVias","Package_DFN_QFN/QFN-8-1EP_6x5mm_P1.27mm_EP3.4x4.2mm","Package_DFN_QFN/QFN-80-1EP_10x10mm_P0.4mm_EP3.4x3.4mm","Package_DFN_QFN/QFN-80-1EP_10x10mm_P0.4mm_EP3.4x3.4mm_ThermalVias","Package_DFN_QFN/Qorvo_DFN-8-1EP_2x2mm_P0.5mm","Package_DFN_QFN/Qorvo_TQFN66-48-1EP_6x6mm_P0.4mm_EP4.2x4.2mm","Package_DFN_QFN/Qorvo_TQFN66-48-1EP_6x6mm_P0.4mm_EP4.2x4.2mm_ThermalVias","Package_DFN_QFN/ROHM_DFN0604-3","Package_DFN_QFN/Renesas_UQFN-16_2x2mm_P0.4mm","Package_DFN_QFN/Renesas_UQFN-20_2x3mm_P0.4mm_LayoutBorder4x6y","Package_DFN_QFN/ST_DFN-10-1EP_3x3mm_P0.5mm_EP0.62x0.98mm","Package_DFN_QFN/ST_DFN-10-1EP_3x3mm_P0.5mm_EP0.62x0.98mm_ThermalVias","Package_DFN_QFN/ST_UFDFPN-12-1EP_3x3mm_P0.5mm_EP1.4x2.55mm","Package_DFN_QFN/ST_UFQFPN-20_3x3mm_P0.5mm","Package_DFN_QFN/ST_UQFN-6L_1.5x1.7mm_P0.5mm","Package_DFN_QFN/SiliconLabs_QFN-20-1EP_3x3mm_P0.5mm_EP1.8x1.8mm","Package_DFN_QFN/SiliconLabs_QFN-20-1EP_3x3mm_P0.5mm_EP1.8x1.8mm_ThermalVias","Package_DFN_QFN/TDFN-10-1EP_2x3mm_P0.5mm_EP0.9x2mm","Package_DFN_QFN/TDFN-10-1EP_2x3mm_P0.5mm_EP0.9x2mm_ThermalVias","Package_DFN_QFN/TDFN-12-1EP_3x3mm_P0.4mm_EP1.7x2.45mm","Package_DFN_QFN/TDFN-12-1EP_3x3mm_P0.4mm_EP1.7x2.45mm_ThermalVias","Package_DFN_QFN/TDFN-12_2x3mm_P0.5mm","Package_DFN_QFN/TDFN-14-1EP_3x3mm_P0.4mm_EP1.78x2.35mm","Package_DFN_QFN/TDFN-14-1EP_3x3mm_P0.4mm_EP1.78x2.35mm_ThermalVias","Package_DFN_QFN/TDFN-6-1EP_1.2x1.2mm_P0.4mm_EP0.3x0.94mm","Package_DFN_QFN/TDFN-6-1EP_2.5x2.5mm_P0.65mm_EP1.3x2mm","Package_DFN_QFN/TDFN-6-1EP_2.5x2.5mm_P0.65mm_EP1.3x2mm_ThermalVias","Package_DFN_QFN/TDFN-8-1EP_2x2mm_P0.5mm_EP0.8x1.2mm","Package_DFN_QFN/TDFN-8-1EP_3x2mm_P0.5mm_EP1.3x1.4mm","Package_DFN_QFN/TDFN-8-1EP_3x2mm_P0.5mm_EP1.4x1.4mm","Package_DFN_QFN/TDFN-8-1EP_3x2mm_P0.5mm_EP1.80x1.65mm","Package_DFN_QFN/TDFN-8-1EP_3x2mm_P0.5mm_EP1.80x1.65mm_ThermalVias","Package_DFN_QFN/TDFN-8_1.4x1.6mm_P0.4mm","Package_DFN_QFN/TQFN-16-1EP_3x3mm_P0.5mm_EP1.23x1.23mm","Package_DFN_QFN/TQFN-16-1EP_3x3mm_P0.5mm_EP1.23x1.23mm_ThermalVias","Package_DFN_QFN/TQFN-16-1EP_3x3mm_P0.5mm_EP1.6x1.6mm","Package_DFN_QFN/TQFN-16-1EP_4x4mm_P0.65mm_EP2.1x2.1mm","Package_DFN_QFN/TQFN-16-1EP_4x4mm_P0.65mm_EP2.1x2.1mm_ThermalVias","Package_DFN_QFN/TQFN-16-1EP_5x5mm_P0.8mm_EP2.29x2.29mm","Package_DFN_QFN/TQFN-16-1EP_5x5mm_P0.8mm_EP2.29x2.29mm_ThermalVias","Package_DFN_QFN/TQFN-16-1EP_5x5mm_P0.8mm_EP3.1x3.1mm","Package_DFN_QFN/TQFN-16-1EP_5x5mm_P0.8mm_EP3.1x3.1mm_ThermalVias","Package_DFN_QFN/TQFN-20-1EP_4x4mm_P0.5mm_EP2.1x2.1mm","Package_DFN_QFN/TQFN-20-1EP_4x4mm_P0.5mm_EP2.1x2.1mm_ThermalVias","Package_DFN_QFN/TQFN-20-1EP_4x4mm_P0.5mm_EP2.9x2.9mm","Package_DFN_QFN/TQFN-20-1EP_4x4mm_P0.5mm_EP2.9x2.9mm_ThermalVias","Package_DFN_QFN/TQFN-20-1EP_5x5mm_P0.65mm_EP3.1x3.1mm","Package_DFN_QFN/TQFN-20-1EP_5x5mm_P0.65mm_EP3.1x3.1mm_ThermalVias","Package_DFN_QFN/TQFN-20-1EP_5x5mm_P0.65mm_EP3.25x3.25mm","Package_DFN_QFN/TQFN-20-1EP_5x5mm_P0.65mm_EP3.25x3.25mm_ThermalVias","Package_DFN_QFN/TQFN-24-1EP_4x4mm_P0.5mm_EP2.1x2.1mm","Package_DFN_QFN/TQFN-24-1EP_4x4mm_P0.5mm_EP2.1x2.1mm_ThermalVias","Package_DFN_QFN/TQFN-24-1EP_4x4mm_P0.5mm_EP2.6x2.6mm","Package_DFN_QFN/TQFN-24-1EP_4x4mm_P0.5mm_EP2.6x2.6mm_ThermalVias","Package_DFN_QFN/TQFN-24-1EP_4x4mm_P0.5mm_EP2.8x2.8mm_PullBack","Package_DFN_QFN/TQFN-24-1EP_4x4mm_P0.5mm_EP2.8x2.8mm_PullBack_ThermalVias","Package_DFN_QFN/TQFN-28-1EP_5x5mm_P0.5mm_EP2.7x2.7mm","Package_DFN_QFN/TQFN-28-1EP_5x5mm_P0.5mm_EP2.7x2.7mm_ThermalVias","Package_DFN_QFN/TQFN-28-1EP_5x5mm_P0.5mm_EP3.25x3.25mm","Package_DFN_QFN/TQFN-28-1EP_5x5mm_P0.5mm_EP3.25x3.25mm_ThermalVias","Package_DFN_QFN/TQFN-32-1EP_5x5mm_P0.5mm_EP2.1x2.1mm","Package_DFN_QFN/TQFN-32-1EP_5x5mm_P0.5mm_EP2.1x2.1mm_ThermalVias","Package_DFN_QFN/TQFN-32-1EP_5x5mm_P0.5mm_EP3.1x3.1mm","Package_DFN_QFN/TQFN-32-1EP_5x5mm_P0.5mm_EP3.1x3.1mm_ThermalVias","Package_DFN_QFN/TQFN-32-1EP_5x5mm_P0.5mm_EP3.4x3.4mm","Package_DFN_QFN/TQFN-32-1EP_5x5mm_P0.5mm_EP3.4x3.4mm_ThermalVias","Package_DFN_QFN/TQFN-40-1EP_5x5mm_P0.4mm_EP3.5x3.5mm","Package_DFN_QFN/TQFN-40-1EP_5x5mm_P0.4mm_EP3.5x3.5mm_ThermalVias","Package_DFN_QFN/TQFN-44-1EP_7x7mm_P0.5mm_EP4.7x4.7mm","Package_DFN_QFN/TQFN-44-1EP_7x7mm_P0.5mm_EP4.7x4.7mm_ThermalVias","Package_DFN_QFN/TQFN-48-1EP_7x7mm_P0.5mm_EP5.1x5.1mm","Package_DFN_QFN/TQFN-48-1EP_7x7mm_P0.5mm_EP5.1x5.1mm_ThermalVias","Package_DFN_QFN/Texas_B3QFN-14-1EP_5x5.5mm_P0.65mm","Package_DFN_QFN/Texas_B3QFN-14-1EP_5x5.5mm_P0.65mm_ThermalVia","Package_DFN_QFN/Texas_DLH0010A_WSON-10-1EP_2.2x2mm_P0.4mm_EP0.9x1.5mm","Package_DFN_QFN/Texas_DLH0010A_WSON-10-1EP_2.2x2mm_P0.4mm_EP0.9x1.5mm_ThermalVias","Package_DFN_QFN/Texas_DRB0008A","Package_DFN_QFN/Texas_DSQ0010A_WSON-10-1EP_2x2mm_P0.4mm_EP0.9x1.5mm","Package_DFN_QFN/Texas_DSQ0010A_WSON-10-1EP_2x2mm_P0.4mm_EP0.9x1.5mm_ThermalVias","Package_DFN_QFN/Texas_MOF0009A","Package_DFN_QFN/Texas_PicoStar_DFN-3_0.69x0.60mm","Package_DFN_QFN/Texas_QFN-41_10x16mm","Package_DFN_QFN/Texas_R-PUQFN-N10","Package_DFN_QFN/Texas_R-PUQFN-N12","Package_DFN_QFN/Texas_RDX0007A_QFN-FCMOD-7-3.3x4mm-P0.5mm_4EP","Package_DFN_QFN/Texas_REE0036A_WQFN-36-1EP_4x5mm_P0.4mm_EP2.7x3.7mm","Package_DFN_QFN/Texas_REE0036A_WQFN-36-1EP_4x5mm_P0.4mm_EP2.7x3.7mm_ThermalVias","Package_DFN_QFN/Texas_REF0038A_WQFN-38-2EP_6x4mm_P0.4","Package_DFN_QFN/Texas_RGC0064B_VQFN-64-1EP_9x9mm_P0.5mm_EP4.25x4.25mm","Package_DFN_QFN/Texas_RGC0064B_VQFN-64-1EP_9x9mm_P0.5mm_EP4.25x4.25mm_ThermalVias","Package_DFN_QFN/Texas_RGE0024C_VQFN-24-1EP_4x4mm_P0.5mm_EP2.1x2.1mm","Package_DFN_QFN/Texas_RGE0024C_VQFN-24-1EP_4x4mm_P0.5mm_EP2.1x2.1mm_ThermalVias","Package_DFN_QFN/Texas_RGE0024H_VQFN-24-1EP_4x4mm_P0.5mm_EP2.7x2.7mm","Package_DFN_QFN/Texas_RGE0024H_VQFN-24-1EP_4x4mm_P0.5mm_EP2.7x2.7mm_ThermalVias","Package_DFN_QFN/Texas_RGP0020D_VQFN-20-1EP_4x4mm_P0.5mm_EP2.7x2.7mm","Package_DFN_QFN/Texas_RGP0020D_VQFN-20-1EP_4x4mm_P0.5mm_EP2.7x2.7mm_ThermalVias","Package_DFN_QFN/Texas_RGP0020H_VQFN-20-1EP_4x4mm_P0.5mm_EP2.4x2.4mm","Package_DFN_QFN/Texas_RGP0020H_VQFN-20-1EP_4x4mm_P0.5mm_EP2.4x2.4mm_ThermalVias","Package_DFN_QFN/Texas_RGV0016A_VQFN-16-1EP_4x4mm_P0.65mm_EP2.1x2.1mm","Package_DFN_QFN/Texas_RGV0016A_VQFN-16-1EP_4x4mm_P0.65mm_EP2.1x2.1mm_ThermalVias","Package_DFN_QFN/Texas_RGW0020A_VQFN-20-1EP_5x5mm_P0.65mm_EP3.15x3.15mm","Package_DFN_QFN/Texas_RGW0020A_VQFN-20-1EP_5x5mm_P0.65mm_EP3.15x3.15mm_ThermalVias","Package_DFN_QFN/Texas_RGY_R-PVQFN-N16_EP2.05x2.55mm","Package_DFN_QFN/Texas_RGY_R-PVQFN-N16_EP2.05x2.55mm_ThermalVias","Package_DFN_QFN/Texas_RGY_R-PVQFN-N20_EP2.05x3.05mm","Package_DFN_QFN/Texas_RGY_R-PVQFN-N20_EP2.05x3.05mm_ThermalVias","Package_DFN_QFN/Texas_RGY_R-PVQFN-N24_EP2.05x3.1mm","Package_DFN_QFN/Texas_RGY_R-PVQFN-N24_EP2.05x3.1mm_ThermalVias","Package_DFN_QFN/Texas_RGZ0048A_VQFN-48-1EP_7x7mm_P0.5mm_EP5.15x5.15mm","Package_DFN_QFN/Texas_RGZ0048A_VQFN-48-1EP_7x7mm_P0.5mm_EP5.15x5.15mm_ThermalVias","Package_DFN_QFN/Texas_RHA0040B_VQFN-40-1EP_6x6mm_P0.5mm_EP4.15x4.15mm","Package_DFN_QFN/Texas_RHA0040B_VQFN-40-1EP_6x6mm_P0.5mm_EP4.15x4.15mm_ThermalVias","Package_DFN_QFN/Texas_RHA0040D_VQFN-40-1EP_6x6mm_P0.5mm_EP2.9x2.9mm","Package_DFN_QFN/Texas_RHA0040D_VQFN-40-1EP_6x6mm_P0.5mm_EP2.9x2.9mm_ThermalVias","Package_DFN_QFN/Texas_RHA0040E_VQFN-40-1EP_6x6mm_P0.5mm_EP3.52x2.62mm","Package_DFN_QFN/Texas_RHA0040E_VQFN-40-1EP_6x6mm_P0.5mm_EP3.52x2.62mm_ThermalVias","Package_DFN_QFN/Texas_RHA_VQFN-40-1EP_6x6mm_P0.5mm_EP4.6x4.6mm","Package_DFN_QFN/Texas_RHA_VQFN-40-1EP_6x6mm_P0.5mm_EP4.6x4.6mm_ThermalVias","Package_DFN_QFN/Texas_RHB0032E_VQFN-32-1EP_5x5mm_P0.5mm_EP3.45x3.45mm","Package_DFN_QFN/Texas_RHB0032E_VQFN-32-1EP_5x5mm_P0.5mm_EP3.45x3.45mm_ThermalVias","Package_DFN_QFN/Texas_RHB0032M_VQFN-32-1EP_5x5mm_P0.5mm_EP2.1x2.1mm","Package_DFN_QFN/Texas_RHB0032M_VQFN-32-1EP_5x5mm_P0.5mm_EP2.1x2.1mm_ThermalVias","Package_DFN_QFN/Texas_RHF0024A_VQFN-24-1EP_4x5mm_P0.5mm_EP2.65x3.65mm","Package_DFN_QFN/Texas_RHF0024A_VQFN-24-1EP_4x5mm_P0.5mm_EP2.65x3.65mm_ThermalVias","Package_DFN_QFN/Texas_RHH0036C_VQFN-36-1EP_6x6mm_P0.5mm_EP4.4x4.4mm","Package_DFN_QFN/Texas_RHH0036C_VQFN-36-1EP_6x6mm_P0.5mm_EP4.4x4.4mm_ThermalVias","Package_DFN_QFN/Texas_RJE0020A_VQFN-20-1EP_3x3mm_P0.45mm_EP0.675x0.76mm","Package_DFN_QFN/Texas_RJE0020A_VQFN-20-1EP_3x3mm_P0.45mm_EP0.675x0.76mm_ThermalVias","Package_DFN_QFN/Texas_RMG0012A_WQFN-12_1.8x1.8mm_P0.4mm","Package_DFN_QFN/Texas_RMQ0024A_WQFN-24-1EP_3x3mm_P0.4mm_EP1.9x1.9mm","Package_DFN_QFN/Texas_RMQ0024A_WQFN-24-1EP_3x3mm_P0.4mm_EP1.9x1.9mm_ThermalVias","Package_DFN_QFN/Texas_RNH0030A_WQFN-30-1EP_2.5x4.5mm_P0.4mm_EP1.2x3.2mm","Package_DFN_QFN/Texas_RNH0030A_WQFN-30-1EP_2.5x4.5mm_P0.4mm_EP1.2x3.2mm_ThermalVias","Package_DFN_QFN/Texas_RNN0018A","Package_DFN_QFN/Texas_RNP0030B_WQFN-30-1EP_4x6mm_P0.5mm_EP1.8x4.5mm","Package_DFN_QFN/Texas_RNP0030B_WQFN-30-1EP_4x6mm_P0.5mm_EP1.8x4.5mm_ThermalVias","Package_DFN_QFN/Texas_RNQ0040A_WQFN-40-1EP_6x4mm_P0.4mm_EP4.7x2.7mm","Package_DFN_QFN/Texas_RNQ0040A_WQFN-40-1EP_6x4mm_P0.4mm_EP4.7x2.7mm_ThermalVias","Package_DFN_QFN/Texas_RNX0012C_VQFN-14-11-1EP_2x3mm_P0.5mm_EP0.25x1.825mm","Package_DFN_QFN/Texas_RPU0010A_VQFN-HR-10_2x2mm_P0.5mm","Package_DFN_QFN/Texas_RQM0029A_VQFN-29_4x4mm_P0.4mm","Package_DFN_QFN/Texas_RRW0024A_WQFN-24-1EP_3x3mm_P0.4mm_EP1.9x1.9mm","Package_DFN_QFN/Texas_RRW0024A_WQFN-24-1EP_3x3mm_P0.4mm_EP1.9x1.9mm_ThermalVias","Package_DFN_QFN/Texas_RSA_VQFN-16-1EP_4x4mm_P0.65mm_EP2.7x2.7mm","Package_DFN_QFN/Texas_RSA_VQFN-16-1EP_4x4mm_P0.65mm_EP2.7x2.7mm_ThermalVias","Package_DFN_QFN/Texas_RSN_WQFN-32-1EP_4x4mm_P0.4mm_EP2.8x2.8mm","Package_DFN_QFN/Texas_RSN_WQFN-32-1EP_4x4mm_P0.4mm_EP2.8x2.8mm_ThermalVias","Package_DFN_QFN/Texas_RSW0010A_UQFN-10_1.4x1.8mm_P0.4mm","Package_DFN_QFN/Texas_RTE0016D_WQFN-16-1EP_3x3mm_P0.5mm_EP0.8x0.8mm","Package_DFN_QFN/Texas_RTE0016D_WQFN-16-1EP_3x3mm_P0.5mm_EP0.8x0.8mm_ThermalVias","Package_DFN_QFN/Texas_RTE_WQFN-16-1EP_3x3mm_P0.5mm_EP1.2x0.8mm","Package_DFN_QFN/Texas_RTE_WQFN-16-1EP_3x3mm_P0.5mm_EP1.2x0.8mm_ThermalVias","Package_DFN_QFN/Texas_RTW_WQFN-24-1EP_4x4mm_P0.5mm_EP2.7x2.7mm","Package_DFN_QFN/Texas_RTW_WQFN-24-1EP_4x4mm_P0.5mm_EP2.7x2.7mm_ThermalVias","Package_DFN_QFN/Texas_RTY_WQFN-16-1EP_4x4mm_P0.65mm_EP2.1x2.1mm","Package_DFN_QFN/Texas_RTY_WQFN-16-1EP_4x4mm_P0.65mm_EP2.1x2.1mm_ThermalVias","Package_DFN_QFN/Texas_RUK0020B_WQFN-20-1EP_3x3mm_P0.4mm_EP1.7x1.7mm","Package_DFN_QFN/Texas_RUK0020B_WQFN-20-1EP_3x3mm_P0.4mm_EP1.7x1.7mm_ThermalVias","Package_DFN_QFN/Texas_RUM0016A_WQFN-16-1EP_4x4mm_P0.65mm_EP2.6x2.6mm","Package_DFN_QFN/Texas_RUM0016A_WQFN-16-1EP_4x4mm_P0.65mm_EP2.6x2.6mm_ThermalVias","Package_DFN_QFN/Texas_RUM0016E_WQFN-16-1EP_4x4mm_P0.65mm_EP2.5x2.5mm","Package_DFN_QFN/Texas_RUM0016E_WQFN-16-1EP_4x4mm_P0.65mm_EP2.5x2.5mm_ThermalVias","Package_DFN_QFN/Texas_RUN0010A_WQFN-10_2x2mm_P0.5mm","Package_DFN_QFN/Texas_RVA_VQFN-16-1EP_3.5x3.5mm_P0.5mm_EP2.14x2.14mm","Package_DFN_QFN/Texas_RVA_VQFN-16-1EP_3.5x3.5mm_P0.5mm_EP2.14x2.14mm_ThermalVias","Package_DFN_QFN/Texas_RVC0020A_WQFN-20-1EP_3x4mm_P0.5mm_EP1.6x2.6mm","Package_DFN_QFN/Texas_RVC0020A_WQFN-20-1EP_3x4mm_P0.5mm_EP1.6x2.6mm_ThermalVias","Package_DFN_QFN/Texas_RVE0028A_VQFN-28-1EP_3.5x4.5mm_P0.4mm_EP2.1x3.1mm","Package_DFN_QFN/Texas_RVE0028A_VQFN-28-1EP_3.5x4.5mm_P0.4mm_EP2.1x3.1mm_ThermalVias","Package_DFN_QFN/Texas_RWH0032A","Package_DFN_QFN/Texas_RWH0032A_ThermalVias","Package_DFN_QFN/Texas_RWU0007A_VQFN-7_2x2mm_P0.5mm","Package_DFN_QFN/Texas_S-PDSO-N10_EP1.2x2mm","Package_DFN_QFN/Texas_S-PDSO-N10_EP1.2x2mm_ThermalVias","Package_DFN_QFN/Texas_S-PVQFN-N14","Package_DFN_QFN/Texas_S-PVQFN-N14_ThermalVias","Package_DFN_QFN/Texas_S-PWQFN-N100_EP5.5x5.5mm","Package_DFN_QFN/Texas_S-PWQFN-N100_EP5.5x5.5mm_ThermalVias","Package_DFN_QFN/Texas_S-PWQFN-N20","Package_DFN_QFN/Texas_S-PX2QFN-14","Package_DFN_QFN/Texas_UQFN-10_1.5x2mm_P0.5mm","Package_DFN_QFN/Texas_UQFN-8_1.5x1.5mm_P0.5mm","Package_DFN_QFN/Texas_VQFN-HR-12_2x2.5mm_P0.5mm","Package_DFN_QFN/Texas_VQFN-HR-12_2x2.5mm_P0.5mm_ThermalVias","Package_DFN_QFN/Texas_VQFN-HR-20_3x2.5mm_P0.5mm_RQQ0011A","Package_DFN_QFN/Texas_VQFN-RHL-20","Package_DFN_QFN/Texas_VQFN-RHL-20_ThermalVias","Package_DFN_QFN/Texas_VQFN-RNR0011A-11","Package_DFN_QFN/Texas_WQFN-MR-100_3x3-DapStencil","Package_DFN_QFN/Texas_WQFN-MR-100_ThermalVias_3x3-DapStencil","Package_DFN_QFN/Texas_X2QFN-12_1.6x1.6mm_P0.4mm","Package_DFN_QFN/Texas_X2QFN-RUE-12_1.4x2mm_P0.4mm","Package_DFN_QFN/UDC-QFN-20-4EP_3x4mm_P0.5mm_EP0.41x0.25mm","Package_DFN_QFN/UDFN-10_1.35x2.6mm_P0.5mm","Package_DFN_QFN/UDFN-4-1EP_1x1mm_P0.65mm_EP0.48x0.48mm","Package_DFN_QFN/UDFN-9_1.0x3.8mm_P0.5mm","Package_DFN_QFN/UFQFPN-32-1EP_5x5mm_P0.5mm_EP3.5x3.5mm","Package_DFN_QFN/UFQFPN-32-1EP_5x5mm_P0.5mm_EP3.5x3.5mm_ThermalVias","Package_DFN_QFN/UQFN-10_1.3x1.8mm_P0.4mm","Package_DFN_QFN/UQFN-10_1.4x1.8mm_P0.4mm","Package_DFN_QFN/UQFN-10_1.6x2.1mm_P0.5mm","Package_DFN_QFN/UQFN-12-1EP_2x2mm_P0.4mm_EP1.1x1.1mm","Package_DFN_QFN/UQFN-16-1EP_3x3mm_P0.5mm_EP1.75x1.75mm","Package_DFN_QFN/UQFN-16-1EP_4x4mm_P0.65mm_EP2.6x2.6mm","Package_DFN_QFN/UQFN-16-1EP_4x4mm_P0.65mm_EP2.6x2.6mm_ThermalVias","Package_DFN_QFN/UQFN-16-1EP_4x4mm_P0.65mm_EP2.7x2.7mm","Package_DFN_QFN/UQFN-16_1.8x2.6mm_P0.4mm","Package_DFN_QFN/UQFN-20-1EP_3x3mm_P0.4mm_EP1.7x1.7mm","Package_DFN_QFN/UQFN-20-1EP_3x3mm_P0.4mm_EP1.7x1.7mm_ThermalVias","Package_DFN_QFN/UQFN-20-1EP_3x3mm_P0.4mm_EP1.85x1.85mm","Package_DFN_QFN/UQFN-20-1EP_3x3mm_P0.4mm_EP1.85x1.85mm_ThermalVias","Package_DFN_QFN/UQFN-20-1EP_4x4mm_P0.5mm_EP2.8x2.8mm","Package_DFN_QFN/UQFN-20-1EP_4x4mm_P0.5mm_EP2.8x2.8mm_ThermalVias","Package_DFN_QFN/UQFN-20_3x3mm_P0.4mm","Package_DFN_QFN/UQFN-28-1EP_4x4mm_P0.4mm_EP2.35x2.35mm","Package_DFN_QFN/UQFN-28-1EP_4x4mm_P0.4mm_EP2.35x2.35mm_ThermalVias","Package_DFN_QFN/UQFN-32_5x5mm_P0.5mm","Package_DFN_QFN/UQFN-40-1EP_5x5mm_P0.4mm_EP3.8x3.8mm","Package_DFN_QFN/UQFN-40-1EP_5x5mm_P0.4mm_EP3.8x3.8mm_ThermalVias","Package_DFN_QFN/UQFN-48-1EP_6x6mm_P0.4mm_EP4.45x4.45mm","Package_DFN_QFN/UQFN-48-1EP_6x6mm_P0.4mm_EP4.45x4.45mm_ThermalVias","Package_DFN_QFN/UQFN-48-1EP_6x6mm_P0.4mm_EP4.62x4.62mm","Package_DFN_QFN/UQFN-48-1EP_6x6mm_P0.4mm_EP4.62x4.62mm_ThermalVias","Package_DFN_QFN/VDFN-8-1EP_2x2mm_P0.5mm_EP0.9x1.7mm","Package_DFN_QFN/VQFN-100-1EP_12x12mm_P0.4mm_EP8x8mm","Package_DFN_QFN/VQFN-100-1EP_12x12mm_P0.4mm_EP8x8mm_ThermalVias","Package_DFN_QFN/VQFN-12-1EP_4x4mm_P0.8mm_EP2.1x2.1mm","Package_DFN_QFN/VQFN-12-1EP_4x4mm_P0.8mm_EP2.1x2.1mm_ThermalVias","Package_DFN_QFN/VQFN-16-1EP_3x3mm_P0.5mm_EP1.1x1.1mm","Package_DFN_QFN/VQFN-16-1EP_3x3mm_P0.5mm_EP1.1x1.1mm_ThermalVias","Package_DFN_QFN/VQFN-16-1EP_3x3mm_P0.5mm_EP1.45x1.45mm","Package_DFN_QFN/VQFN-16-1EP_3x3mm_P0.5mm_EP1.45x1.45mm_ThermalVias","Package_DFN_QFN/VQFN-16-1EP_3x3mm_P0.5mm_EP1.68x1.68mm","Package_DFN_QFN/VQFN-16-1EP_3x3mm_P0.5mm_EP1.68x1.68mm_ThermalVias","Package_DFN_QFN/VQFN-16-1EP_3x3mm_P0.5mm_EP1.6x1.6mm","Package_DFN_QFN/VQFN-16-1EP_3x3mm_P0.5mm_EP1.6x1.6mm_ThermalVias","Package_DFN_QFN/VQFN-16-1EP_3x3mm_P0.5mm_EP1.8x1.8mm","Package_DFN_QFN/VQFN-16-1EP_3x3mm_P0.5mm_EP1.8x1.8mm_ThermalVias","Package_DFN_QFN/VQFN-20-1EP_3x3mm_P0.45mm_EP1.55x1.55mm","Package_DFN_QFN/VQFN-20-1EP_3x3mm_P0.45mm_EP1.55x1.55mm_ThermalVias","Package_DFN_QFN/VQFN-20-1EP_3x3mm_P0.4mm_EP1.7x1.7mm","Package_DFN_QFN/VQFN-20-1EP_3x3mm_P0.4mm_EP1.7x1.7mm_ThermalVias","Package_DFN_QFN/VQFN-24-1EP_4x4mm_P0.5mm_EP2.45x2.45mm","Package_DFN_QFN/VQFN-24-1EP_4x4mm_P0.5mm_EP2.45x2.45mm_ThermalVias","Package_DFN_QFN/VQFN-24-1EP_4x4mm_P0.5mm_EP2.5x2.5mm","Package_DFN_QFN/VQFN-24-1EP_4x4mm_P0.5mm_EP2.5x2.5mm_ThermalVias","Package_DFN_QFN/VQFN-28-1EP_4x4mm_P0.45mm_EP2.4x2.4mm","Package_DFN_QFN/VQFN-28-1EP_4x4mm_P0.45mm_EP2.4x2.4mm_ThermalVias","Package_DFN_QFN/VQFN-28-1EP_4x5mm_P0.5mm_EP2.55x3.55mm","Package_DFN_QFN/VQFN-28-1EP_4x5mm_P0.5mm_EP2.55x3.55mm_ThermalVias","Package_DFN_QFN/VQFN-28-1EP_5x5mm_P0.5mm_EP3.25x3.25mm","Package_DFN_QFN/VQFN-28-1EP_5x5mm_P0.5mm_EP3.25x3.25mm_ThermalVias","Package_DFN_QFN/VQFN-28-1EP_5x5mm_P0.5mm_EP3.7x3.7mm","Package_DFN_QFN/VQFN-28-1EP_5x5mm_P0.5mm_EP3.7x3.7mm_ThermalVias","Package_DFN_QFN/VQFN-32-1EP_4x4mm_P0.4mm_EP2.8x2.8mm","Package_DFN_QFN/VQFN-32-1EP_4x4mm_P0.4mm_EP2.8x2.8mm_ThermalVias","Package_DFN_QFN/VQFN-32-1EP_5x5mm_P0.5mm_EP3.15x3.15mm","Package_DFN_QFN/VQFN-32-1EP_5x5mm_P0.5mm_EP3.15x3.15mm_ThermalVias","Package_DFN_QFN/VQFN-32-1EP_5x5mm_P0.5mm_EP3.1x3.1mm","Package_DFN_QFN/VQFN-32-1EP_5x5mm_P0.5mm_EP3.1x3.1mm_ThermalVias","Package_DFN_QFN/VQFN-32-1EP_5x5mm_P0.5mm_EP3.5x3.5mm","Package_DFN_QFN/VQFN-32-1EP_5x5mm_P0.5mm_EP3.5x3.5mm_ThermalVias","Package_DFN_QFN/VQFN-40-1EP_5x5mm_P0.4mm_EP3.3x3.3mm","Package_DFN_QFN/VQFN-40-1EP_5x5mm_P0.4mm_EP3.3x3.3mm_ThermalVias","Package_DFN_QFN/VQFN-40-1EP_5x5mm_P0.4mm_EP3.5x3.5mm","Package_DFN_QFN/VQFN-40-1EP_5x5mm_P0.4mm_EP3.5x3.5mm_ThermalVias","Package_DFN_QFN/VQFN-40-1EP_5x5mm_P0.4mm_EP3.6x3.6mm","Package_DFN_QFN/VQFN-40-1EP_5x5mm_P0.4mm_EP3.6x3.6mm_ThermalVias","Package_DFN_QFN/VQFN-40-1EP_5x5mm_P0.4mm_EP3.7x3.7mm","Package_DFN_QFN/VQFN-40-1EP_5x5mm_P0.4mm_EP3.7x3.7mm_ThermalVias","Package_DFN_QFN/VQFN-40-1EP_6x6mm_P0.5mm_EP3.5x3.5mm","Package_DFN_QFN/VQFN-40-1EP_6x6mm_P0.5mm_EP3.5x3.5mm_ThermalVias","Package_DFN_QFN/VQFN-46-1EP_5x6mm_P0.4mm_EP2.8x3.8mm","Package_DFN_QFN/VQFN-46-1EP_5x6mm_P0.4mm_EP2.8x3.8mm_ThermalVias","Package_DFN_QFN/VQFN-48-1EP_6x6mm_P0.4mm_EP4.1x4.1mm","Package_DFN_QFN/VQFN-48-1EP_6x6mm_P0.4mm_EP4.1x4.1mm_ThermalVias","Package_DFN_QFN/VQFN-48-1EP_7x7mm_P0.5mm_EP2.6x2.6mm","Package_DFN_QFN/VQFN-48-1EP_7x7mm_P0.5mm_EP2.6x2.6mm_ThermalVias","Package_DFN_QFN/VQFN-48-1EP_7x7mm_P0.5mm_EP4.1x4.1mm","Package_DFN_QFN/VQFN-48-1EP_7x7mm_P0.5mm_EP4.1x4.1mm_ThermalVias","Package_DFN_QFN/VQFN-48-1EP_7x7mm_P0.5mm_EP4.2x4.2mm","Package_DFN_QFN/VQFN-48-1EP_7x7mm_P0.5mm_EP4.2x4.2mm_ThermalVias","Package_DFN_QFN/VQFN-48-1EP_7x7mm_P0.5mm_EP5.15x5.15mm","Package_DFN_QFN/VQFN-48-1EP_7x7mm_P0.5mm_EP5.15x5.15mm_ThermalVias","Package_DFN_QFN/VQFN-56-1EP_8x8mm_P0.5mm_EP5.1x4.96mm","Package_DFN_QFN/VQFN-56-1EP_8x8mm_P0.5mm_EP5.1x4.96mm_ThermalVias","Package_DFN_QFN/VQFN-56-1EP_8x8mm_P0.5mm_EP5.5x5.06mm","Package_DFN_QFN/VQFN-56-1EP_8x8mm_P0.5mm_EP5.5x5.06mm_ThermalVias","Package_DFN_QFN/VQFN-64-1EP_9x9mm_P0.5mm_EP5.4x5.4mm","Package_DFN_QFN/VQFN-64-1EP_9x9mm_P0.5mm_EP5.4x5.4mm_ThermalVias","Package_DFN_QFN/VQFN-64-1EP_9x9mm_P0.5mm_EP7.15x7.15mm","Package_DFN_QFN/VQFN-64-1EP_9x9mm_P0.5mm_EP7.15x7.15mm_ThermalVias","Package_DFN_QFN/VQFN-68-1EP_8x8mm_P0.4mm_EP4.3x4.3mm","Package_DFN_QFN/Vishay_PowerPAK_MLP44-24L","Package_DFN_QFN/Vishay_PowerPAK_MLP44-24L_ThermalVias","Package_DFN_QFN/Vishay_PowerPAK_MLP55-27L","Package_DFN_QFN/Vishay_PowerPAK_MLP55-27L_R","Package_DFN_QFN/Vishay_PowerPAK_MLP55-27L_R_ThermalVias","Package_DFN_QFN/Vishay_PowerPAK_MLP55-27L_ThermalVias","Package_DFN_QFN/W-PDFN-8-1EP_6x5mm_P1.27mm_EP3x3mm","Package_DFN_QFN/WCH_QFN-16-1EP_3x3mm_P0.5mm_EP1.8x1.8mm","Package_DFN_QFN/WDFN-10-1EP_3x3mm_P0.5mm_EP1.8x2.5mm","Package_DFN_QFN/WDFN-10-1EP_3x3mm_P0.5mm_EP1.8x2.5mm_ThermalVias","Package_DFN_QFN/WDFN-12-1EP_3x3mm_P0.45mm_EP1.7x2.5mm","Package_DFN_QFN/WDFN-6-2EP_4.0x2.6mm_P0.65mm","Package_DFN_QFN/WDFN-8-1EP_2x2.2mm_P0.5mm_EP0.80x0.54","Package_DFN_QFN/WDFN-8-1EP_2x2mm_P0.5mm_EP0.8x1.2mm","Package_DFN_QFN/WDFN-8-1EP_3x2mm_P0.5mm_EP1.3x1.4mm","Package_DFN_QFN/WDFN-8-1EP_4x3mm_P0.65mm_EP2.4x1.8mm","Package_DFN_QFN/WDFN-8-1EP_4x3mm_P0.65mm_EP2.4x1.8mm_ThermalVias","Package_DFN_QFN/WDFN-8-1EP_6x5mm_P1.27mm_EP3.4x4mm","Package_DFN_QFN/WDFN-8-1EP_8x6mm_P1.27mm_EP6x4.8mm","Package_DFN_QFN/WDFN-8-1EP_8x6mm_P1.27mm_EP6x4.8mm_ThermalVias","Package_DFN_QFN/WDFN-8_2x2mm_P0.5mm","Package_DFN_QFN/WFDFPN-8-1EP_3x2mm_P0.5mm_EP1.25x1.35mm","Package_DFN_QFN/WQFN-14-1EP_2.5x2.5mm_P0.5mm_EP1.45x1.45mm","Package_DFN_QFN/WQFN-14-1EP_2.5x2.5mm_P0.5mm_EP1.45x1.45mm_ThermalVias","Package_DFN_QFN/WQFN-16-1EP_3x3mm_P0.5mm_EP1.68x1.68mm","Package_DFN_QFN/WQFN-16-1EP_3x3mm_P0.5mm_EP1.68x1.68mm_ThermalVias","Package_DFN_QFN/WQFN-16-1EP_3x3mm_P0.5mm_EP1.6x1.6mm","Package_DFN_QFN/WQFN-16-1EP_3x3mm_P0.5mm_EP1.6x1.6mm_ThermalVias","Package_DFN_QFN/WQFN-16-1EP_3x3mm_P0.5mm_EP1.75x1.75mm","Package_DFN_QFN/WQFN-16-1EP_3x3mm_P0.5mm_EP1.75x1.75mm_ThermalVias","Package_DFN_QFN/WQFN-16-1EP_4x4mm_P0.5mm_EP2.6x2.6mm","Package_DFN_QFN/WQFN-16-1EP_4x4mm_P0.5mm_EP2.6x2.6mm_ThermalVias","Package_DFN_QFN/WQFN-20-1EP_2.5x4.5mm_P0.5mm_EP1x2.9mm","Package_DFN_QFN/WQFN-20-1EP_3x3mm_P0.4mm_EP1.7x1.7mm","Package_DFN_QFN/WQFN-20-1EP_3x3mm_P0.4mm_EP1.7x1.7mm_ThermalVias","Package_DFN_QFN/WQFN-20-1EP_4x4mm_P0.5mm_EP2.7x2.7mm","Package_DFN_QFN/WQFN-20-1EP_4x4mm_P0.5mm_EP2.7x2.7mm_ThermalVias","Package_DFN_QFN/WQFN-24-1EP_4x4mm_P0.5mm_EP2.45x2.45mm","Package_DFN_QFN/WQFN-24-1EP_4x4mm_P0.5mm_EP2.45x2.45mm_ThermalVias","Package_DFN_QFN/WQFN-24-1EP_4x4mm_P0.5mm_EP2.6x2.6mm","Package_DFN_QFN/WQFN-24-1EP_4x4mm_P0.5mm_EP2.6x2.6mm_ThermalVias","Package_DFN_QFN/WQFN-28-1EP_4x4mm_P0.4mm_EP2.7x2.7mm","Package_DFN_QFN/WQFN-28-1EP_4x4mm_P0.4mm_EP2.7x2.7mm_ThermalVias","Package_DFN_QFN/WQFN-32-1EP_5x5mm_P0.5mm_EP3.1x3.1mm","Package_DFN_QFN/WQFN-38-1EP_5x7mm_P0.5mm_EP2.7x4.7mm","Package_DFN_QFN/WQFN-38-1EP_5x7mm_P0.5mm_EP2.7x4.7mm_ThermalVias","Package_DFN_QFN/WQFN-38-1EP_5x7mm_P0.5mm_EP3.15x5.15mm","Package_DFN_QFN/WQFN-38-1EP_5x7mm_P0.5mm_EP3.15x5.15mm_ThermalVias","Package_DFN_QFN/WQFN-38-1EP_5x7mm_P0.5mm_EP3.65x5.65mm","Package_DFN_QFN/WQFN-38-1EP_5x7mm_P0.5mm_EP3.65x5.65mm_ThermalVias","Package_DFN_QFN/WQFN-42-1EP_3.5x9mm_P0.5mm_EP2.05x7.55mm","Package_DFN_QFN/WQFN-42-1EP_3.5x9mm_P0.5mm_EP2.05x7.55mm_ThermalVias","Package_DIP/CERDIP-14_W7.62mm_SideBrazed","Package_DIP/CERDIP-14_W7.62mm_SideBrazed_LongPads","Package_DIP/CERDIP-14_W7.62mm_SideBrazed_LongPads_Socket","Package_DIP/CERDIP-14_W7.62mm_SideBrazed_Socket","Package_DIP/CERDIP-16_W7.62mm_SideBrazed","Package_DIP/CERDIP-16_W7.62mm_SideBrazed_LongPads","Package_DIP/CERDIP-16_W7.62mm_SideBrazed_LongPads_Socket","Package_DIP/CERDIP-16_W7.62mm_SideBrazed_Socket","Package_DIP/CERDIP-18_W7.62mm_SideBrazed","Package_DIP/CERDIP-18_W7.62mm_SideBrazed_LongPads","Package_DIP/CERDIP-18_W7.62mm_SideBrazed_LongPads_Socket","Package_DIP/CERDIP-18_W7.62mm_SideBrazed_Socket","Package_DIP/CERDIP-20_W7.62mm_SideBrazed","Package_DIP/CERDIP-20_W7.62mm_SideBrazed_LongPads","Package_DIP/CERDIP-20_W7.62mm_SideBrazed_LongPads_Socket","Package_DIP/CERDIP-20_W7.62mm_SideBrazed_Socket","Package_DIP/CERDIP-22_W7.62mm_SideBrazed","Package_DIP/CERDIP-22_W7.62mm_SideBrazed_LongPads","Package_DIP/CERDIP-22_W7.62mm_SideBrazed_LongPads_Socket","Package_DIP/CERDIP-22_W7.62mm_SideBrazed_Socket","Package_DIP/CERDIP-24_W7.62mm_SideBrazed","Package_DIP/CERDIP-24_W7.62mm_SideBrazed_LongPads","Package_DIP/CERDIP-24_W7.62mm_SideBrazed_LongPads_Socket","Package_DIP/CERDIP-24_W7.62mm_SideBrazed_Socket","Package_DIP/CERDIP-28_W7.62mm_SideBrazed","Package_DIP/CERDIP-28_W7.62mm_SideBrazed_LongPads","Package_DIP/CERDIP-28_W7.62mm_SideBrazed_LongPads_Socket","Package_DIP/CERDIP-28_W7.62mm_SideBrazed_Socket","Package_DIP/CERDIP-8_W7.62mm_SideBrazed","Package_DIP/CERDIP-8_W7.62mm_SideBrazed_LongPads","Package_DIP/CERDIP-8_W7.62mm_SideBrazed_LongPads_Socket","Package_DIP/CERDIP-8_W7.62mm_SideBrazed_Socket","Package_DIP/DIP-10_W10.16mm","Package_DIP/DIP-10_W10.16mm_LongPads","Package_DIP/DIP-10_W7.62mm","Package_DIP/DIP-10_W7.62mm_LongPads","Package_DIP/DIP-10_W7.62mm_SMDSocket_SmallPads","Package_DIP/DIP-10_W7.62mm_Socket","Package_DIP/DIP-10_W7.62mm_Socket_LongPads","Package_DIP/DIP-10_W8.89mm_SMDSocket_LongPads","Package_DIP/DIP-12_W10.16mm","Package_DIP/DIP-12_W10.16mm_LongPads","Package_DIP/DIP-12_W7.62mm","Package_DIP/DIP-12_W7.62mm_LongPads","Package_DIP/DIP-12_W7.62mm_SMDSocket_SmallPads","Package_DIP/DIP-12_W7.62mm_Socket","Package_DIP/DIP-12_W7.62mm_Socket_LongPads","Package_DIP/DIP-12_W8.89mm_SMDSocket_LongPads","Package_DIP/DIP-14_W10.16mm","Package_DIP/DIP-14_W10.16mm_LongPads","Package_DIP/DIP-14_W7.62mm","Package_DIP/DIP-14_W7.62mm_LongPads","Package_DIP/DIP-14_W7.62mm_SMDSocket_SmallPads","Package_DIP/DIP-14_W7.62mm_Socket","Package_DIP/DIP-14_W7.62mm_Socket_LongPads","Package_DIP/DIP-14_W8.89mm_SMDSocket_LongPads","Package_DIP/DIP-16_W10.16mm","Package_DIP/DIP-16_W10.16mm_LongPads","Package_DIP/DIP-16_W7.62mm","Package_DIP/DIP-16_W7.62mm_LongPads","Package_DIP/DIP-16_W7.62mm_SMDSocket_SmallPads","Package_DIP/DIP-16_W7.62mm_Socket","Package_DIP/DIP-16_W7.62mm_Socket_LongPads","Package_DIP/DIP-16_W8.89mm_SMDSocket_LongPads","Package_DIP/DIP-18_W7.62mm","Package_DIP/DIP-18_W7.62mm_LongPads","Package_DIP/DIP-18_W7.62mm_SMDSocket_SmallPads","Package_DIP/DIP-18_W7.62mm_Socket","Package_DIP/DIP-18_W7.62mm_Socket_LongPads","Package_DIP/DIP-18_W8.89mm_SMDSocket_LongPads","Package_DIP/DIP-20_W7.62mm","Package_DIP/DIP-20_W7.62mm_LongPads","Package_DIP/DIP-20_W7.62mm_SMDSocket_SmallPads","Package_DIP/DIP-20_W7.62mm_Socket","Package_DIP/DIP-20_W7.62mm_Socket_LongPads","Package_DIP/DIP-20_W8.89mm_SMDSocket_LongPads","Package_DIP/DIP-22_W10.16mm","Package_DIP/DIP-22_W10.16mm_LongPads","Package_DIP/DIP-22_W10.16mm_SMDSocket_SmallPads","Package_DIP/DIP-22_W10.16mm_Socket","Package_DIP/DIP-22_W10.16mm_Socket_LongPads","Package_DIP/DIP-22_W11.43mm_SMDSocket_LongPads","Package_DIP/DIP-22_W7.62mm","Package_DIP/DIP-22_W7.62mm_LongPads","Package_DIP/DIP-22_W7.62mm_SMDSocket_SmallPads","Package_DIP/DIP-22_W7.62mm_Socket","Package_DIP/DIP-22_W7.62mm_Socket_LongPads","Package_DIP/DIP-22_W8.89mm_SMDSocket_LongPads","Package_DIP/DIP-24_18.0mmx34.29mm_W15.24mm","Package_DIP/DIP-24_18.0mmx34.29mm_W15.24mm_LongPads","Package_DIP/DIP-24_18.0mmx34.29mm_W15.24mm_SMDSocket_SmallPads","Package_DIP/DIP-24_18.0mmx34.29mm_W15.24mm_Socket","Package_DIP/DIP-24_18.0mmx34.29mm_W15.24mm_Socket_LongPads","Package_DIP/DIP-24_W10.16mm","Package_DIP/DIP-24_W10.16mm_LongPads","Package_DIP/DIP-24_W10.16mm_SMDSocket_SmallPads","Package_DIP/DIP-24_W10.16mm_Socket","Package_DIP/DIP-24_W10.16mm_Socket_LongPads","Package_DIP/DIP-24_W11.43mm_SMDSocket_LongPads","Package_DIP/DIP-24_W15.24mm","Package_DIP/DIP-24_W15.24mm_LongPads","Package_DIP/DIP-24_W15.24mm_SMDSocket_SmallPads","Package_DIP/DIP-24_W15.24mm_Socket","Package_DIP/DIP-24_W15.24mm_Socket_LongPads","Package_DIP/DIP-24_W16.51mm_SMDSocket_LongPads","Package_DIP/DIP-24_W7.62mm","Package_DIP/DIP-24_W7.62mm_LongPads","Package_DIP/DIP-24_W7.62mm_SMDSocket_SmallPads","Package_DIP/DIP-24_W7.62mm_Socket","Package_DIP/DIP-24_W7.62mm_Socket_LongPads","Package_DIP/DIP-24_W8.89mm_SMDSocket_LongPads","Package_DIP/DIP-26_W15.24mm","Package_DIP/DIP-26_W15.24mm_LongPads","Package_DIP/DIP-26_W15.24mm_SMDSocket_SmallPads","Package_DIP/DIP-26_W15.24mm_Socket","Package_DIP/DIP-26_W15.24mm_Socket_LongPads","Package_DIP/DIP-26_W16.51mm_SMDSocket_LongPads","Package_DIP/DIP-28_W15.24mm","Package_DIP/DIP-28_W15.24mm_LongPads","Package_DIP/DIP-28_W15.24mm_SMDSocket_SmallPads","Package_DIP/DIP-28_W15.24mm_Socket","Package_DIP/DIP-28_W15.24mm_Socket_LongPads","Package_DIP/DIP-28_W16.51mm_SMDSocket_LongPads","Package_DIP/DIP-28_W7.62mm","Package_DIP/DIP-28_W7.62mm_LongPads","Package_DIP/DIP-28_W7.62mm_SMDSocket_SmallPads","Package_DIP/DIP-28_W7.62mm_Socket","Package_DIP/DIP-28_W7.62mm_Socket_LongPads","Package_DIP/DIP-28_W8.89mm_SMDSocket_LongPads","Package_DIP/DIP-32_W15.24mm","Package_DIP/DIP-32_W15.24mm_LongPads","Package_DIP/DIP-32_W15.24mm_SMDSocket_SmallPads","Package_DIP/DIP-32_W15.24mm_Socket","Package_DIP/DIP-32_W15.24mm_Socket_LongPads","Package_DIP/DIP-32_W16.51mm_SMDSocket_LongPads","Package_DIP/DIP-32_W7.62mm","Package_DIP/DIP-40_W15.24mm","Package_DIP/DIP-40_W15.24mm_LongPads","Package_DIP/DIP-40_W15.24mm_SMDSocket_SmallPads","Package_DIP/DIP-40_W15.24mm_Socket","Package_DIP/DIP-40_W15.24mm_Socket_LongPads","Package_DIP/DIP-40_W16.51mm_SMDSocket_LongPads","Package_DIP/DIP-40_W25.4mm","Package_DIP/DIP-40_W25.4mm_LongPads","Package_DIP/DIP-40_W25.4mm_SMDSocket_SmallPads","Package_DIP/DIP-40_W25.4mm_Socket","Package_DIP/DIP-40_W25.4mm_Socket_LongPads","Package_DIP/DIP-40_W26.67mm_SMDSocket_LongPads","Package_DIP/DIP-42_W15.24mm","Package_DIP/DIP-42_W15.24mm_LongPads","Package_DIP/DIP-42_W15.24mm_SMDSocket_SmallPads","Package_DIP/DIP-42_W15.24mm_Socket","Package_DIP/DIP-42_W15.24mm_Socket_LongPads","Package_DIP/DIP-42_W16.51mm_SMDSocket_LongPads","Package_DIP/DIP-48_W15.24mm","Package_DIP/DIP-48_W15.24mm_LongPads","Package_DIP/DIP-48_W15.24mm_SMDSocket_SmallPads","Package_DIP/DIP-48_W15.24mm_Socket","Package_DIP/DIP-48_W15.24mm_Socket_LongPads","Package_DIP/DIP-48_W16.51mm_SMDSocket_LongPads","Package_DIP/DIP-4_W10.16mm","Package_DIP/DIP-4_W10.16mm_LongPads","Package_DIP/DIP-4_W7.62mm","Package_DIP/DIP-4_W7.62mm_LongPads","Package_DIP/DIP-4_W7.62mm_SMDSocket_SmallPads","Package_DIP/DIP-4_W7.62mm_Socket","Package_DIP/DIP-4_W7.62mm_Socket_LongPads","Package_DIP/DIP-4_W8.89mm_SMDSocket_LongPads","Package_DIP/DIP-5-6_W10.16mm","Package_DIP/DIP-5-6_W10.16mm_LongPads","Package_DIP/DIP-5-6_W7.62mm","Package_DIP/DIP-5-6_W7.62mm_LongPads","Package_DIP/DIP-5-6_W7.62mm_SMDSocket_SmallPads","Package_DIP/DIP-5-6_W7.62mm_Socket","Package_DIP/DIP-5-6_W7.62mm_Socket_LongPads","Package_DIP/DIP-5-6_W8.89mm_SMDSocket_LongPads","Package_DIP/DIP-64_W15.24mm","Package_DIP/DIP-64_W15.24mm_LongPads","Package_DIP/DIP-64_W15.24mm_SMDSocket_SmallPads","Package_DIP/DIP-64_W15.24mm_Socket","Package_DIP/DIP-64_W15.24mm_Socket_LongPads","Package_DIP/DIP-64_W16.51mm_SMDSocket_LongPads","Package_DIP/DIP-64_W22.86mm","Package_DIP/DIP-64_W22.86mm_LongPads","Package_DIP/DIP-64_W22.86mm_SMDSocket_SmallPads","Package_DIP/DIP-64_W22.86mm_Socket","Package_DIP/DIP-64_W22.86mm_Socket_LongPads","Package_DIP/DIP-64_W24.13mm_SMDSocket_LongPads","Package_DIP/DIP-64_W25.4mm","Package_DIP/DIP-64_W25.4mm_LongPads","Package_DIP/DIP-64_W25.4mm_SMDSocket_SmallPads","Package_DIP/DIP-64_W25.4mm_Socket","Package_DIP/DIP-64_W25.4mm_Socket_LongPads","Package_DIP/DIP-64_W26.67mm_SMDSocket_LongPads","Package_DIP/DIP-6_W10.16mm","Package_DIP/DIP-6_W10.16mm_LongPads","Package_DIP/DIP-6_W7.62mm","Package_DIP/DIP-6_W7.62mm_LongPads","Package_DIP/DIP-6_W7.62mm_SMDSocket_SmallPads","Package_DIP/DIP-6_W7.62mm_Socket","Package_DIP/DIP-6_W7.62mm_Socket_LongPads","Package_DIP/DIP-6_W8.89mm_SMDSocket_LongPads","Package_DIP/DIP-8-16_W7.62mm","Package_DIP/DIP-8-16_W7.62mm_Socket","Package_DIP/DIP-8-16_W7.62mm_Socket_LongPads","Package_DIP/DIP-8-N6_W7.62mm","Package_DIP/DIP-8-N7_W7.62mm","Package_DIP/DIP-8_W10.16mm","Package_DIP/DIP-8_W10.16mm_LongPads","Package_DIP/DIP-8_W7.62mm","Package_DIP/DIP-8_W7.62mm_LongPads","Package_DIP/DIP-8_W7.62mm_SMDSocket_SmallPads","Package_DIP/DIP-8_W7.62mm_Socket","Package_DIP/DIP-8_W7.62mm_Socket_LongPads","Package_DIP/DIP-8_W8.89mm_SMDSocket_LongPads","Package_DIP/Fairchild_LSOP-8","Package_DIP/IXYS_Flatpak-8_6.3x9.7mm_P2.54mm","Package_DIP/IXYS_SMD-8_6.3x9.7mm_P2.54mm","Package_DIP/PowerIntegrations_PDIP-8B","Package_DIP/PowerIntegrations_PDIP-8C","Package_DIP/PowerIntegrations_SDIP-10C","Package_DIP/PowerIntegrations_SMD-8","Package_DIP/PowerIntegrations_SMD-8B","Package_DIP/PowerIntegrations_SMD-8C","Package_DIP/PowerIntegrations_eDIP-12B","Package_DIP/SMDIP-10_W11.48mm","Package_DIP/SMDIP-10_W7.62mm","Package_DIP/SMDIP-10_W9.53mm","Package_DIP/SMDIP-10_W9.53mm_Clearance8mm","Package_DIP/SMDIP-12_W11.48mm","Package_DIP/SMDIP-12_W7.62mm","Package_DIP/SMDIP-12_W9.53mm","Package_DIP/SMDIP-12_W9.53mm_Clearance8mm","Package_DIP/SMDIP-14_W11.48mm","Package_DIP/SMDIP-14_W7.62mm","Package_DIP/SMDIP-14_W9.53mm","Package_DIP/SMDIP-14_W9.53mm_Clearance8mm","Package_DIP/SMDIP-16_W11.48mm","Package_DIP/SMDIP-16_W7.62mm","Package_DIP/SMDIP-16_W9.53mm","Package_DIP/SMDIP-16_W9.53mm_Clearance8mm","Package_DIP/SMDIP-18_W11.48mm","Package_DIP/SMDIP-18_W7.62mm","Package_DIP/SMDIP-18_W9.53mm","Package_DIP/SMDIP-18_W9.53mm_Clearance8mm","Package_DIP/SMDIP-20_W11.48mm","Package_DIP/SMDIP-20_W7.62mm","Package_DIP/SMDIP-20_W9.53mm","Package_DIP/SMDIP-20_W9.53mm_Clearance8mm","Package_DIP/SMDIP-22_W11.48mm","Package_DIP/SMDIP-22_W7.62mm","Package_DIP/SMDIP-22_W9.53mm","Package_DIP/SMDIP-22_W9.53mm_Clearance8mm","Package_DIP/SMDIP-24_W11.48mm","Package_DIP/SMDIP-24_W15.24mm","Package_DIP/SMDIP-24_W7.62mm","Package_DIP/SMDIP-24_W9.53mm","Package_DIP/SMDIP-28_W15.24mm","Package_DIP/SMDIP-32_W11.48mm","Package_DIP/SMDIP-32_W15.24mm","Package_DIP/SMDIP-32_W7.62mm","Package_DIP/SMDIP-32_W9.53mm","Package_DIP/SMDIP-40_W15.24mm","Package_DIP/SMDIP-40_W25.24mm","Package_DIP/SMDIP-42_W15.24mm","Package_DIP/SMDIP-48_W15.24mm","Package_DIP/SMDIP-4_W11.48mm","Package_DIP/SMDIP-4_W7.62mm","Package_DIP/SMDIP-4_W9.53mm","Package_DIP/SMDIP-4_W9.53mm_Clearance8mm","Package_DIP/SMDIP-64_W15.24mm","Package_DIP/SMDIP-6_W11.48mm","Package_DIP/SMDIP-6_W7.62mm","Package_DIP/SMDIP-6_W9.53mm","Package_DIP/SMDIP-6_W9.53mm_Clearance8mm","Package_DIP/SMDIP-8_W11.48mm","Package_DIP/SMDIP-8_W7.62mm","Package_DIP/SMDIP-8_W9.53mm","Package_DIP/SMDIP-8_W9.53mm_Clearance8mm","Package_DIP/Toshiba_11-7A9","Package_DIP/Vishay_HVM-DIP-3_W7.62mm","Package_DirectFET/DirectFET_L4","Package_DirectFET/DirectFET_L6","Package_DirectFET/DirectFET_L8","Package_DirectFET/DirectFET_LA","Package_DirectFET/DirectFET_M2","Package_DirectFET/DirectFET_M4","Package_DirectFET/DirectFET_MA","Package_DirectFET/DirectFET_MB","Package_DirectFET/DirectFET_MC","Package_DirectFET/DirectFET_MD","Package_DirectFET/DirectFET_ME","Package_DirectFET/DirectFET_MF","Package_DirectFET/DirectFET_MN","Package_DirectFET/DirectFET_MP","Package_DirectFET/DirectFET_MQ","Package_DirectFET/DirectFET_MT","Package_DirectFET/DirectFET_MU","Package_DirectFET/DirectFET_MX","Package_DirectFET/DirectFET_MZ","Package_DirectFET/DirectFET_S1","Package_DirectFET/DirectFET_S2","Package_DirectFET/DirectFET_S3C","Package_DirectFET/DirectFET_SA","Package_DirectFET/DirectFET_SB","Package_DirectFET/DirectFET_SC","Package_DirectFET/DirectFET_SH","Package_DirectFET/DirectFET_SJ","Package_DirectFET/DirectFET_SQ","Package_DirectFET/DirectFET_ST","Package_LCC/Analog_LCC-8_5x5mm_P1.27mm","Package_LCC/MO047AD_PLCC-52_19.1x19.1mm_P1.27mm","Package_LCC/PLCC-20","Package_LCC/PLCC-20_9.0x9.0mm_P1.27mm","Package_LCC/PLCC-20_SMD-Socket","Package_LCC/PLCC-20_THT-Socket","Package_LCC/PLCC-28","Package_LCC/PLCC-28_SMD-Socket","Package_LCC/PLCC-28_THT-Socket","Package_LCC/PLCC-32_11.4x14.0mm_P1.27mm","Package_LCC/PLCC-32_THT-Socket","Package_LCC/PLCC-44","Package_LCC/PLCC-44_16.6x16.6mm_P1.27mm","Package_LCC/PLCC-44_SMD-Socket","Package_LCC/PLCC-44_THT-Socket","Package_LCC/PLCC-52","Package_LCC/PLCC-52_SMD-Socket","Package_LCC/PLCC-52_THT-Socket","Package_LCC/PLCC-68","Package_LCC/PLCC-68_24.2x24.2mm_P1.27mm","Package_LCC/PLCC-68_SMD-Socket","Package_LCC/PLCC-68_THT-Socket","Package_LCC/PLCC-84","Package_LCC/PLCC-84_29.3x29.3mm_P1.27mm","Package_LCC/PLCC-84_SMD-Socket","Package_LCC/PLCC-84_THT-Socket","Package_LGA/AMS_LGA-10-1EP_2.7x4mm_P0.6mm","Package_LGA/AMS_LGA-20_4.7x4.5mm_P0.65mm","Package_LGA/AMS_OLGA-8_2x3.1mm_P0.8mm","Package_LGA/Bosch_LGA-14_3x2.5mm_P0.5mm","Package_LGA/Bosch_LGA-16_4.5x3mm_P0.5mm_LayoutBorder7x1y_ClockwisePinNumbering","Package_LGA/Bosch_LGA-8_2.5x2.5mm_P0.65mm_ClockwisePinNumbering","Package_LGA/Bosch_LGA-8_2x2.5mm_P0.65mm_ClockwisePinNumbering","Package_LGA/Bosch_LGA-8_3x3mm_P0.8mm_ClockwisePinNumbering","Package_LGA/Infineon_PG-TSNP-6-10_0.7x1.1mm_0.7x1.1mm_P0.4mm","Package_LGA/Kionix_LGA-12_2x2mm_P0.5mm_LayoutBorder2x4y","Package_LGA/LGA-12_2x2mm_P0.5mm","Package_LGA/LGA-14_2x2mm_P0.35mm_LayoutBorder3x4y","Package_LGA/LGA-14_3x2.5mm_P0.5mm_LayoutBorder3x4y","Package_LGA/LGA-14_3x5mm_P0.8mm_LayoutBorder1x6y","Package_LGA/LGA-16_3x3mm_P0.5mm","Package_LGA/LGA-16_3x3mm_P0.5mm_LayoutBorder3x5y","Package_LGA/LGA-16_4x4mm_P0.65mm_LayoutBorder4x4y","Package_LGA/LGA-24L_3x3.5mm_P0.43mm","Package_LGA/LGA-28_5.2x3.8mm_P0.5mm","Package_LGA/LGA-8_3x5mm_P1.25mm","Package_LGA/LGA-8_8x6.2mm_P1.27mm","Package_LGA/LGA-8_8x6mm_P1.27mm","Package_LGA/Linear_LGA-133_15.0x15.0mm_Layout12x12_P1.27mm","Package_LGA/MPS_LGA-18-10EP_12x12mm_P3.3mm","Package_LGA/NXP_LGA-8_3x5mm_P1.25mm_H1.1mm","Package_LGA/NXP_LGA-8_3x5mm_P1.25mm_H1.2mm","Package_LGA/NXP_USON-8_1x1.35mm_P0.35mm","Package_LGA/Nordic_nRF9151-LAxx_LGA-80-33EP_12.1x11.1mm_P0.5mm","Package_LGA/Nordic_nRF9160-SIxx_LGA-102-59EP_16.0x10.5mm_P0.5mm","Package_LGA/Rohm_MLGA010V020A_LGA-10_2x2mm_P0.45mm_LayoutBorder2x3y","Package_LGA/ST_CCLGA-7L_2.8x2.8mm_P1.15mm_H1.95mm","Package_LGA/ST_HLGA-10_2.5x2.5mm_P0.6mm_LayoutBorder3x2y","Package_LGA/ST_HLGA-10_2x2mm_P0.5mm_LayoutBorder3x2y","Package_LGA/Texas_SIL0008C_MicroSiP-8-1EP_2.8x3mm_P0.65mm_EP1.1x1.9mm","Package_LGA/Texas_SIL0008C_MicroSiP-8-1EP_2.8x3mm_P0.65mm_EP1.1x1.9mm_ThermalVias","Package_LGA/Texas_SIL0008D_MicroSiP-8-1EP_2.8x3mm_P0.65mm_EP1.1x1.9mm","Package_LGA/Texas_SIL0008D_MicroSiP-8-1EP_2.8x3mm_P0.65mm_EP1.1x1.9mm_ThermalVias","Package_LGA/Texas_SIL0010A_MicroSiP-10-1EP_3.8x3mm_P0.6mm_EP0.7x2.9mm","Package_LGA/Texas_SIL0010A_MicroSiP-10-1EP_3.8x3mm_P0.6mm_EP0.7x2.9mm_ThermalVias","Package_LGA/VLGA-4_2x2.5mm_P1.65mm","Package_LGA/ublox_LGA-53_4.5x4.5mm_Layout9x9_P0.5mm","Package_QFP/EQFP-144-1EP_20x20mm_P0.5mm_EP4x4mm","Package_QFP/EQFP-144-1EP_20x20mm_P0.5mm_EP4x4mm_ThermalVias","Package_QFP/EQFP-144-1EP_20x20mm_P0.5mm_EP5x5mm","Package_QFP/EQFP-144-1EP_20x20mm_P0.5mm_EP5x5mm_ThermalVias","Package_QFP/EQFP-144-1EP_20x20mm_P0.5mm_EP6.61x5.615mm","Package_QFP/EQFP-144-1EP_20x20mm_P0.5mm_EP6.61x5.615mm_ThermalVias","Package_QFP/EQFP-144-1EP_20x20mm_P0.5mm_EP7.2x6.35mm","Package_QFP/EQFP-144-1EP_20x20mm_P0.5mm_EP7.2x6.35mm_ThermalVias","Package_QFP/EQFP-144-1EP_20x20mm_P0.5mm_EP8.93x8.7mm","Package_QFP/EQFP-144-1EP_20x20mm_P0.5mm_EP8.93x8.7mm_ThermalVias","Package_QFP/Hitachi_FP80B_PQFP-80_14x20mm_P0.8mm","Package_QFP/LQFP-100-1EP_14x14mm_P0.5mm_EP6.9x6.9mm","Package_QFP/LQFP-100-1EP_14x14mm_P0.5mm_EP6.9x6.9mm_ThermalVias","Package_QFP/LQFP-100_14x14mm_P0.5mm","Package_QFP/LQFP-128_14x14mm_P0.4mm","Package_QFP/LQFP-128_14x20mm_P0.5mm","Package_QFP/LQFP-144-1EP_20x20mm_P0.5mm_EP6.5x6.5mm","Package_QFP/LQFP-144-1EP_20x20mm_P0.5mm_EP6.5x6.5mm_ThermalVias","Package_QFP/LQFP-144_20x20mm_P0.5mm","Package_QFP/LQFP-160_24x24mm_P0.5mm","Package_QFP/LQFP-176-1EP_24x24mm_P0.5mm_EP6.6x6.6mm","Package_QFP/LQFP-176-1EP_24x24mm_P0.5mm_EP6.6x6.6mm_ThermalVias","Package_QFP/LQFP-176_20x20mm_P0.4mm","Package_QFP/LQFP-176_24x24mm_P0.5mm","Package_QFP/LQFP-208_28x28mm_P0.5mm","Package_QFP/LQFP-216_24x24mm_P0.4mm","Package_QFP/LQFP-32_5x5mm_P0.5mm","Package_QFP/LQFP-32_7x7mm_P0.8mm","Package_QFP/LQFP-36_7x7mm_P0.65mm","Package_QFP/LQFP-44_10x10mm_P0.8mm","Package_QFP/LQFP-48-1EP_7x7mm_P0.5mm_EP3.6x3.6mm","Package_QFP/LQFP-48-1EP_7x7mm_P0.5mm_EP3.6x3.6mm_ThermalVias","Package_QFP/LQFP-48_7x7mm_P0.5mm","Package_QFP/LQFP-52-1EP_10x10mm_P0.65mm_EP4.8x4.8mm","Package_QFP/LQFP-52-1EP_10x10mm_P0.65mm_EP4.8x4.8mm_ThermalVias","Package_QFP/LQFP-52_10x10mm_P0.65mm","Package_QFP/LQFP-52_14x14mm_P1mm","Package_QFP/LQFP-64-1EP_10x10mm_P0.5mm_EP5x5mm","Package_QFP/LQFP-64-1EP_10x10mm_P0.5mm_EP5x5mm_ThermalVias","Package_QFP/LQFP-64-1EP_10x10mm_P0.5mm_EP6.5x6.5mm","Package_QFP/LQFP-64-1EP_10x10mm_P0.5mm_EP6.5x6.5mm_ThermalVias","Package_QFP/LQFP-64_10x10mm_P0.5mm","Package_QFP/LQFP-64_14x14mm_P0.8mm","Package_QFP/LQFP-64_7x7mm_P0.4mm","Package_QFP/LQFP-80_10x10mm_P0.4mm","Package_QFP/LQFP-80_12x12mm_P0.5mm","Package_QFP/LQFP-80_14x14mm_P0.65mm","Package_QFP/MO112AC1_PQFP-52_10x10mm_P0.65mm","Package_QFP/Microchip_PQFP-44_10x10mm_P0.8mm","Package_QFP/PQFP-100_14x20mm_P0.65mm","Package_QFP/PQFP-112_20x20mm_P0.65mm","Package_QFP/PQFP-128_28x28mm_P0.8mm","Package_QFP/PQFP-132_24x24mm_P0.635mm","Package_QFP/PQFP-132_24x24mm_P0.635mm_i386","Package_QFP/PQFP-144_28x28mm_P0.65mm","Package_QFP/PQFP-160_28x28mm_P0.65mm","Package_QFP/PQFP-168_28x28mm_P0.65mm","Package_QFP/PQFP-208_28x28mm_P0.5mm","Package_QFP/PQFP-240_32.1x32.1mm_P0.5mm","Package_QFP/PQFP-256_28x28mm_P0.4mm","Package_QFP/PQFP-44_10x10mm_P0.8mm","Package_QFP/PQFP-64_14x14mm_P0.8mm","Package_QFP/PQFP-80_14x14mm_P0.65mm","Package_QFP/PQFP-80_14x20mm_P0.8mm","Package_QFP/TQFP-100-1EP_14x14mm_P0.5mm_EP5x5mm","Package_QFP/TQFP-100-1EP_14x14mm_P0.5mm_EP5x5mm_ThermalVias","Package_QFP/TQFP-100_12x12mm_P0.4mm","Package_QFP/TQFP-100_14x14mm_P0.5mm","Package_QFP/TQFP-120_14x14mm_P0.4mm","Package_QFP/TQFP-128_14x14mm_P0.4mm","Package_QFP/TQFP-144_16x16mm_P0.4mm","Package_QFP/TQFP-144_20x20mm_P0.5mm","Package_QFP/TQFP-176_20x20mm_P0.4mm","Package_QFP/TQFP-176_24x24mm_P0.5mm","Package_QFP/TQFP-32_5x5mm_P0.5mm","Package_QFP/TQFP-32_7x7mm_P0.8mm","Package_QFP/TQFP-44-1EP_10x10mm_P0.8mm_EP4.5x4.5mm","Package_QFP/TQFP-44-1EP_10x10mm_P0.8mm_EP4.5x4.5mm_ThermalVias","Package_QFP/TQFP-44_10x10mm_P0.8mm","Package_QFP/TQFP-48-1EP_7x7mm_P0.5mm_EP3.5x3.5mm","Package_QFP/TQFP-48-1EP_7x7mm_P0.5mm_EP3.5x3.5mm_ThermalVias","Package_QFP/TQFP-48-1EP_7x7mm_P0.5mm_EP4.11x4.11mm","Package_QFP/TQFP-48-1EP_7x7mm_P0.5mm_EP5x5mm","Package_QFP/TQFP-48-1EP_7x7mm_P0.5mm_EP5x5mm_ThermalVias","Package_QFP/TQFP-48_7x7mm_P0.5mm","Package_QFP/TQFP-52-1EP_10x10mm_P0.65mm_EP6.5x6.5mm","Package_QFP/TQFP-52-1EP_10x10mm_P0.65mm_EP6.5x6.5mm_ThermalVias","Package_QFP/TQFP-64-1EP_10x10mm_P0.5mm_EP5.305x5.305mm","Package_QFP/TQFP-64-1EP_10x10mm_P0.5mm_EP5.305x5.305mm_ThermalVias","Package_QFP/TQFP-64_10x10mm_P0.5mm","Package_QFP/TQFP-64_14x14mm_P0.8mm","Package_QFP/TQFP-64_7x7mm_P0.4mm","Package_QFP/TQFP-80-1EP_14x14mm_P0.65mm_EP9.5x9.5mm","Package_QFP/TQFP-80-1EP_14x14mm_P0.65mm_EP9.5x9.5mm_ThermalVias","Package_QFP/TQFP-80_12x12mm_P0.5mm","Package_QFP/TQFP-80_14x14mm_P0.65mm","Package_QFP/Texas_PHP0048E_HTQFP-48-1EP_7x7mm_P0.5mm_EP6.5x6.5mm_Mask3.62x3.62mm","Package_QFP/Texas_PHP0048E_HTQFP-48-1EP_7x7mm_P0.5mm_EP6.5x6.5mm_Mask3.62x3.62mm_ThermalVias","Package_QFP/Texas_TQFP-64-1EP_10x10mm_P0.5mm_EP8x8mm_Mask4.44x4.44mm","Package_QFP/Texas_TQFP-64-1EP_10x10mm_P0.5mm_EP8x8mm_Mask4.44x4.44mm_ThermalVias","Package_QFP/Texas_TQFP-64-1EP_10x10mm_P0.5mm_EP8x8mm_Mask5x5mm","Package_QFP/Texas_TQFP-64-1EP_10x10mm_P0.5mm_EP8x8mm_Mask5x5mm_ThermalVias","Package_SIP/PowerIntegrations_eSIP-7C","Package_SIP/PowerIntegrations_eSIP-7F","Package_SIP/SIP-8_19x3mm_P2.54mm","Package_SIP/SIP-9_21.54x3mm_P2.54mm","Package_SIP/SIP-9_22.3x3mm_P2.54mm","Package_SIP/SIP3_11.6x8.5mm","Package_SIP/SIP4_Sharp-SSR_P7.62mm_Angled","Package_SIP/SIP4_Sharp-SSR_P7.62mm_Angled_NoHole","Package_SIP/SIP4_Sharp-SSR_P7.62mm_Straight","Package_SIP/SIP9_Housing","Package_SIP/SIP9_Housing_BigPads","Package_SIP/SLA704XM","Package_SIP/STK672-040-E","Package_SIP/STK672-080-E","Package_SIP/Sanyo_STK4xx-15_59.2x8.0mm_P2.54mm","Package_SIP/Sanyo_STK4xx-15_78.0x8.0mm_P2.54mm","Package_SO/Analog_MSOP-12-16-1EP_3x4.039mm_P0.5mm_EP1.651x2.845mm","Package_SO/Analog_MSOP-12-16-1EP_3x4.039mm_P0.5mm_EP1.651x2.845mm_ThermalVias","Package_SO/Analog_MSOP-12-16_3x4.039mm_P0.5mm","Package_SO/Diodes_PSOP-8","Package_SO/Diodes_SO-8EP","Package_SO/ETSSOP-20-1EP_4.4x6.5mm_P0.65mm_EP3x4.2mm","Package_SO/HSOP-20-1EP_11.0x15.9mm_P1.27mm_SlugDown","Package_SO/HSOP-20-1EP_11.0x15.9mm_P1.27mm_SlugDown_ThermalVias","Package_SO/HSOP-20-1EP_11.0x15.9mm_P1.27mm_SlugUp","Package_SO/HSOP-32-1EP_7.5x11mm_P0.65mm_EP4.7x4.7mm","Package_SO/HSOP-36-1EP_11.0x15.9mm_P0.65mm_SlugDown","Package_SO/HSOP-36-1EP_11.0x15.9mm_P0.65mm_SlugDown_ThermalVias","Package_SO/HSOP-36-1EP_11.0x15.9mm_P0.65mm_SlugUp","Package_SO/HSOP-54-1EP_7.5x17.9mm_P0.65mm_EP4.6x4.6mm","Package_SO/HSOP-8-1EP_3.9x4.9mm_P1.27mm_EP2.3x2.3mm","Package_SO/HSOP-8-1EP_3.9x4.9mm_P1.27mm_EP2.3x2.3mm_ThermalVias","Package_SO/HSOP-8-1EP_3.9x4.9mm_P1.27mm_EP2.41x3.1mm","Package_SO/HSOP-8-1EP_3.9x4.9mm_P1.27mm_EP2.41x3.1mm_ThermalVias","Package_SO/HTSOP-8-1EP_3.9x4.9mm_P1.27mm_EP2.4x3.2mm","Package_SO/HTSOP-8-1EP_3.9x4.9mm_P1.27mm_EP2.4x3.2mm_ThermalVias","Package_SO/HTSSOP-16-1EP_4.4x5mm_P0.65mm_EP3.4x5mm","Package_SO/HTSSOP-16-1EP_4.4x5mm_P0.65mm_EP3.4x5mm_Mask2.46x2.31mm","Package_SO/HTSSOP-16-1EP_4.4x5mm_P0.65mm_EP3.4x5mm_Mask2.46x2.31mm_ThermalVias","Package_SO/HTSSOP-16-1EP_4.4x5mm_P0.65mm_EP3.4x5mm_Mask2.66x2.46mm","Package_SO/HTSSOP-16-1EP_4.4x5mm_P0.65mm_EP3.4x5mm_Mask2.66x2.46mm_ThermalVias","Package_SO/HTSSOP-16-1EP_4.4x5mm_P0.65mm_EP3.4x5mm_Mask3x3mm_ThermalVias","Package_SO/HTSSOP-16-1EP_4.4x5mm_P0.65mm_EP3x3mm","Package_SO/HTSSOP-20-1EP_4.4x6.5mm_P0.65mm_EP2.74x3.86mm","Package_SO/HTSSOP-20-1EP_4.4x6.5mm_P0.65mm_EP2.85x4mm","Package_SO/HTSSOP-20-1EP_4.4x6.5mm_P0.65mm_EP3.4x6.5mm","Package_SO/HTSSOP-20-1EP_4.4x6.5mm_P0.65mm_EP3.4x6.5mm_Mask2.4x3.7mm","Package_SO/HTSSOP-20-1EP_4.4x6.5mm_P0.65mm_EP3.4x6.5mm_Mask2.75x3.43mm","Package_SO/HTSSOP-20-1EP_4.4x6.5mm_P0.65mm_EP3.4x6.5mm_Mask2.75x3.43mm_ThermalVias","Package_SO/HTSSOP-20-1EP_4.4x6.5mm_P0.65mm_EP3.4x6.5mm_Mask2.96x2.96mm","Package_SO/HTSSOP-20-1EP_4.4x6.5mm_P0.65mm_EP3.4x6.5mm_Mask2.96x2.96mm_ThermalVias","Package_SO/HTSSOP-20-1EP_4.4x6.5mm_P0.65mm_EP3.4x6.5mm_ThermalVias","Package_SO/HTSSOP-24-1EP_4.4x7.8mm_P0.65mm_EP3.2x5mm","Package_SO/HTSSOP-24-1EP_4.4x7.8mm_P0.65mm_EP3.4x7.8mm_Mask2.44x3.42mm","Package_SO/HTSSOP-24-1EP_4.4x7.8mm_P0.65mm_EP3.4x7.8mm_Mask2.44x3.42mm_ThermalVias","Package_SO/HTSSOP-24-1EP_4.4x7.8mm_P0.65mm_EP3.4x7.8mm_Mask2.4x2.98mm","Package_SO/HTSSOP-24-1EP_4.4x7.8mm_P0.65mm_EP3.4x7.8mm_Mask2.4x2.98mm_ThermalVias","Package_SO/HTSSOP-24-1EP_4.4x7.8mm_P0.65mm_EP3.4x7.8mm_Mask2.4x4.68mm","Package_SO/HTSSOP-24-1EP_4.4x7.8mm_P0.65mm_EP3.4x7.8mm_Mask2.4x4.68mm_ThermalVias","Package_SO/HTSSOP-28-1EP_4.4x9.7mm_P0.65mm_EP2.75x6.2mm","Package_SO/HTSSOP-28-1EP_4.4x9.7mm_P0.65mm_EP2.75x6.2mm_ThermalVias","Package_SO/HTSSOP-28-1EP_4.4x9.7mm_P0.65mm_EP2.85x5.4mm","Package_SO/HTSSOP-28-1EP_4.4x9.7mm_P0.65mm_EP2.85x5.4mm_ThermalVias","Package_SO/HTSSOP-28-1EP_4.4x9.7mm_P0.65mm_EP3.4x9.5mm","Package_SO/HTSSOP-28-1EP_4.4x9.7mm_P0.65mm_EP3.4x9.5mm_Mask2.4x6.17mm","Package_SO/HTSSOP-28-1EP_4.4x9.7mm_P0.65mm_EP3.4x9.5mm_Mask2.4x6.17mm_ThermalVias","Package_SO/HTSSOP-28-1EP_4.4x9.7mm_P0.65mm_EP3.4x9.5mm_ThermalVias","Package_SO/HTSSOP-32-1EP_6.1x11mm_P0.65mm_EP5.2x11mm_Mask4.11x4.36mm","Package_SO/HTSSOP-32-1EP_6.1x11mm_P0.65mm_EP5.2x11mm_Mask4.11x4.36mm_ThermalVias","Package_SO/HTSSOP-38-1EP_4.4x9.7mm_P0.5mm_EP1.5x3.3mm","Package_SO/HTSSOP-38-1EP_4.4x9.7mm_P0.5mm_EP1.5x3.3mm_ThermalVias","Package_SO/HTSSOP-38-1EP_4.4x9.7mm_P0.5mm_EP2.74x4.75mm","Package_SO/HTSSOP-38-1EP_4.4x9.7mm_P0.5mm_EP2.74x4.75mm_ThermalVias","Package_SO/HTSSOP-38-1EP_4.4x9.7mm_P0.5mm_EP3.05x6.65mm","Package_SO/HTSSOP-38-1EP_4.4x9.7mm_P0.5mm_EP3.05x6.65mm_ThermalVias","Package_SO/HTSSOP-38-1EP_6.1x12.5mm_P0.65mm_EP5.2x12.5mm_Mask3.39x6.35mm","Package_SO/HTSSOP-38-1EP_6.1x12.5mm_P0.65mm_EP5.2x12.5mm_Mask3.39x6.35mm_ThermalVias","Package_SO/HTSSOP-44-1EP_6.1x14mm_P0.635mm_EP5.2x14mm_Mask4.31x8.26mm","Package_SO/HTSSOP-44-1EP_6.1x14mm_P0.635mm_EP5.2x14mm_Mask4.31x8.26mm_ThermalVias","Package_SO/HTSSOP-44_6.1x14mm_P0.635mm_TopEP4.14x7.01mm","Package_SO/HTSSOP-56-1EP_6.1x14mm_P0.5mm_EP3.61x6.35mm","Package_SO/HVSSOP-10-1EP_3x3mm_P0.5mm_EP1.83x1.89mm","Package_SO/HVSSOP-10-1EP_3x3mm_P0.5mm_EP1.83x1.89mm_ThermalVias","Package_SO/HVSSOP-8-1EP_3x3mm_P0.65mm_EP1.57x1.89mm","Package_SO/HVSSOP-8-1EP_3x3mm_P0.65mm_EP1.57x1.89mm_ThermalVias","Package_SO/Infineon_PG-DSO-12-11","Package_SO/Infineon_PG-DSO-12-11_ThermalVias","Package_SO/Infineon_PG-DSO-12-9","Package_SO/Infineon_PG-DSO-12-9_ThermalVias","Package_SO/Infineon_PG-DSO-20-30","Package_SO/Infineon_PG-DSO-20-30_ThermalVias","Package_SO/Infineon_PG-DSO-20-32","Package_SO/Infineon_PG-DSO-20-85","Package_SO/Infineon_PG-DSO-20-85_ThermalVias","Package_SO/Infineon_PG-DSO-20-87","Package_SO/Infineon_PG-DSO-20-U03_7.5x12.8mm","Package_SO/Infineon_PG-DSO-8-24_4x5mm","Package_SO/Infineon_PG-DSO-8-27_3.9x4.9mm_EP2.65x3mm","Package_SO/Infineon_PG-DSO-8-27_3.9x4.9mm_EP2.65x3mm_ThermalVias","Package_SO/Infineon_PG-DSO-8-43","Package_SO/Infineon_PG-DSO-8-59_7.5x6.3mm","Package_SO/Infineon_PG-TSDSO-14-22","Package_SO/Infineon_SOIC-20W_7.6x12.8mm_P1.27mm","Package_SO/JEITA_SOIC-16_3.9x9.9mm_P1.27mm","Package_SO/JEITA_SOIC-8_3.9x4.9mm_P1.27mm","Package_SO/Linear_HTSSOP-31-38-1EP_4.4x9.7mm_P0.5mm_EP2.74x4.75mm","Package_SO/Linear_HTSSOP-31-38-1EP_4.4x9.7mm_P0.5mm_EP2.74x4.75mm_ThermalVias","Package_SO/MSOP-10-1EP_3x3mm_P0.5mm_EP1.68x1.88mm","Package_SO/MSOP-10-1EP_3x3mm_P0.5mm_EP1.68x1.88mm_ThermalVias","Package_SO/MSOP-10-1EP_3x3mm_P0.5mm_EP1.73x1.98mm","Package_SO/MSOP-10-1EP_3x3mm_P0.5mm_EP1.73x1.98mm_ThermalVias","Package_SO/MSOP-10-1EP_3x3mm_P0.5mm_EP2.2x3.1mm_Mask1.83x1.89mm","Package_SO/MSOP-10-1EP_3x3mm_P0.5mm_EP2.2x3.1mm_Mask1.83x1.89mm_ThermalVias","Package_SO/MSOP-10_3x3mm_P0.5mm","Package_SO/MSOP-12-1EP_3x4.039mm_P0.65mm_EP1.651x2.845mm","Package_SO/MSOP-12-1EP_3x4.039mm_P0.65mm_EP1.651x2.845mm_ThermalVias","Package_SO/MSOP-12_3x4.039mm_P0.65mm","Package_SO/MSOP-16-1EP_3x4.039mm_P0.5mm_EP1.651x2.845mm","Package_SO/MSOP-16-1EP_3x4.039mm_P0.5mm_EP1.651x2.845mm_ThermalVias","Package_SO/MSOP-16_3x4.039mm_P0.5mm","Package_SO/MSOP-8-1EP_3x3mm_P0.65mm_EP1.5x1.8mm","Package_SO/MSOP-8-1EP_3x3mm_P0.65mm_EP1.5x1.8mm_ThermalVias","Package_SO/MSOP-8-1EP_3x3mm_P0.65mm_EP1.68x1.88mm","Package_SO/MSOP-8-1EP_3x3mm_P0.65mm_EP1.68x1.88mm_ThermalVias","Package_SO/MSOP-8-1EP_3x3mm_P0.65mm_EP1.73x1.85mm","Package_SO/MSOP-8-1EP_3x3mm_P0.65mm_EP1.73x1.85mm_ThermalVias","Package_SO/MSOP-8-1EP_3x3mm_P0.65mm_EP1.95x2.15mm","Package_SO/MSOP-8-1EP_3x3mm_P0.65mm_EP1.95x2.15mm_ThermalVias","Package_SO/MSOP-8-1EP_3x3mm_P0.65mm_EP2.5x3mm_Mask1.73x2.36mm","Package_SO/MSOP-8-1EP_3x3mm_P0.65mm_EP2.5x3mm_Mask1.73x2.36mm_ThermalVias","Package_SO/MSOP-8_3x3mm_P0.65mm","Package_SO/NXP_HTSSOP-28-1EP_4.4x9.7mm_P0.65mm_EP2.2x3.4mm","Package_SO/NXP_HTSSOP-28-1EP_4.4x9.7mm_P0.65mm_EP2.2x3.4mm_ThermalVias","Package_SO/ONSemi_SO-8FL_488AA","Package_SO/OnSemi_751EP_SOIC-4_3.9x4.725mm_P2.54mm","Package_SO/OnSemi_Micro8","Package_SO/PSOP-44_16.9x27.17mm_P1.27mm","Package_SO/PowerIntegrations_SO-8","Package_SO/PowerIntegrations_SO-8B","Package_SO/PowerIntegrations_SO-8C","Package_SO/PowerIntegrations_eSOP-12B","Package_SO/PowerPAK_SO-8L_Single","Package_SO/PowerPAK_SO-8_Dual","Package_SO/PowerPAK_SO-8_Single","Package_SO/PowerSSO-16-1EP_3.9x4.9mm_P0.5mm_EP2.5x3.61mm","Package_SO/PowerSSO-16-1EP_3.9x4.9mm_P0.5mm_EP2.5x3.61mm_ThermalVias","Package_SO/QSOP-16_3.9x4.9mm_P0.635mm","Package_SO/QSOP-20_3.9x8.7mm_P0.635mm","Package_SO/QSOP-24_3.9x8.7mm_P0.635mm","Package_SO/QSOP-28_3.9x9.9mm_P0.635mm","Package_SO/Renesas_SOP-32_11.4x20.75mm_P1.27mm","Package_SO/SO-14_3.9x8.65mm_P1.27mm","Package_SO/SO-14_5.3x10.2mm_P1.27mm","Package_SO/SO-16_3.9x9.9mm_P1.27mm","Package_SO/SO-16_5.3x10.2mm_P1.27mm","Package_SO/SO-20-1EP_7.52x12.825mm_P1.27mm_EP6.045x12.09mm_Mask3.56x4.47mm","Package_SO/SO-20-1EP_7.52x12.825mm_P1.27mm_EP6.045x12.09mm_Mask3.56x4.47mm_ThermalVias","Package_SO/SO-20_12.8x7.5mm_P1.27mm","Package_SO/SO-20_5.3x12.6mm_P1.27mm","Package_SO/SO-24_5.3x15mm_P1.27mm","Package_SO/SO-4_4.4x2.3mm_P1.27mm","Package_SO/SO-4_4.4x3.6mm_P2.54mm","Package_SO/SO-4_4.4x3.9mm_P2.54mm","Package_SO/SO-4_4.4x4.3mm_P2.54mm","Package_SO/SO-4_7.6x3.6mm_P2.54mm","Package_SO/SO-5-6_4.55x3.7mm_P1.27mm","Package_SO/SO-6L_10x3.84mm_P1.27mm","Package_SO/SO-6_4.4x3.6mm_P1.27mm","Package_SO/SO-8_3.9x4.9mm_P1.27mm","Package_SO/SOIC-10_3.9x4.9mm_P1mm","Package_SO/SOIC-14-16_3.9x9.9mm_P1.27mm","Package_SO/SOIC-14W_7.5x9mm_P1.27mm","Package_SO/SOIC-14_3.9x8.7mm_P1.27mm","Package_SO/SOIC-16W-12_7.5x10.3mm_P1.27mm","Package_SO/SOIC-16W_5.3x10.2mm_P1.27mm","Package_SO/SOIC-16W_7.5x10.3mm_P1.27mm","Package_SO/SOIC-16W_7.5x12.8mm_P1.27mm","Package_SO/SOIC-16_3.9x9.9mm_P1.27mm","Package_SO/SOIC-16_4.55x10.3mm_P1.27mm","Package_SO/SOIC-18W_7.5x11.6mm_P1.27mm","Package_SO/SOIC-20W_7.5x12.8mm_P1.27mm","Package_SO/SOIC-20W_7.5x15.4mm_P1.27mm","Package_SO/SOIC-24W_7.5x15.4mm_P1.27mm","Package_SO/SOIC-28W_7.5x17.9mm_P1.27mm","Package_SO/SOIC-28W_7.5x18.7mm_P1.27mm","Package_SO/SOIC-32_7.518x20.777mm_P1.27mm","Package_SO/SOIC-4_4.55x2.6mm_P1.27mm","Package_SO/SOIC-4_4.55x3.7mm_P2.54mm","Package_SO/SOIC-5-6_4.4x3.6mm_P1.27mm","Package_SO/SOIC-8-1EP_3.9x4.9mm_P1.27mm_EP2.29x3mm","Package_SO/SOIC-8-1EP_3.9x4.9mm_P1.27mm_EP2.29x3mm_ThermalVias","Package_SO/SOIC-8-1EP_3.9x4.9mm_P1.27mm_EP2.41x3.3mm","Package_SO/SOIC-8-1EP_3.9x4.9mm_P1.27mm_EP2.41x3.3mm_ThermalVias","Package_SO/SOIC-8-1EP_3.9x4.9mm_P1.27mm_EP2.41x3.81mm","Package_SO/SOIC-8-1EP_3.9x4.9mm_P1.27mm_EP2.41x3.81mm_ThermalVias","Package_SO/SOIC-8-1EP_3.9x4.9mm_P1.27mm_EP2.514x3.2mm","Package_SO/SOIC-8-1EP_3.9x4.9mm_P1.27mm_EP2.514x3.2mm_ThermalVias","Package_SO/SOIC-8-1EP_3.9x4.9mm_P1.27mm_EP2.62x3.51mm","Package_SO/SOIC-8-1EP_3.9x4.9mm_P1.27mm_EP2.62x3.51mm_ThermalVias","Package_SO/SOIC-8-1EP_3.9x4.9mm_P1.27mm_EP2.71x3.7mm","Package_SO/SOIC-8-1EP_3.9x4.9mm_P1.27mm_EP2.71x3.7mm_ThermalVias","Package_SO/SOIC-8-1EP_3.9x4.9mm_P1.27mm_EP2.95x4.9mm_Mask2.34x2.34mm","Package_SO/SOIC-8-1EP_3.9x4.9mm_P1.27mm_EP2.95x4.9mm_Mask2.34x2.34mm_ThermalVias","Package_SO/SOIC-8-1EP_3.9x4.9mm_P1.27mm_EP2.95x4.9mm_Mask2.71x3.4mm","Package_SO/SOIC-8-1EP_3.9x4.9mm_P1.27mm_EP2.95x4.9mm_Mask2.71x3.4mm_ThermalVias","Package_SO/SOIC-8-N7_3.9x4.9mm_P1.27mm","Package_SO/SOIC-8_3.81x9.347mm_P2.54mm","Package_SO/SOIC-8_3.9x4.9mm_P1.27mm","Package_SO/SOIC-8_5.3x5.3mm_P1.27mm","Package_SO/SOIC-8_5.3x6.2mm_P1.27mm","Package_SO/SOIC-8_7.5x5.85mm_P1.27mm","Package_SO/SOJ-24_7.62x15.875mm_P1.27mm","Package_SO/SOJ-28_10.16x18.415mm_P1.27mm","Package_SO/SOJ-28_7.62x18.415mm_P1.27mm","Package_SO/SOJ-32_10.16x20.955mm_P1.27mm","Package_SO/SOJ-32_7.62x20.955mm_P1.27mm","Package_SO/SOJ-36_10.16x23.495mm_P1.27mm","Package_SO/SOJ-44_10.16x28.575mm_P1.27mm","Package_SO/SOP-16_4.4x10.4mm_P1.27mm","Package_SO/SOP-16_4.55x10.3mm_P1.27mm","Package_SO/SOP-18_7.495x11.515mm_P1.27mm","Package_SO/SOP-18_7x12.5mm_P1.27mm","Package_SO/SOP-20_7.5x12.8mm_P1.27mm","Package_SO/SOP-24_7.5x15.4mm_P1.27mm","Package_SO/SOP-28_8.4x18.16mm_P1.27mm","Package_SO/SOP-32_11.305x20.495mm_P1.27mm","Package_SO/SOP-44_12.6x28.5mm_P1.27mm","Package_SO/SOP-44_13.3x28.2mm_P1.27mm","Package_SO/SOP-4_3.8x4.1mm_P2.54mm","Package_SO/SOP-4_4.4x2.6mm_P1.27mm","Package_SO/SOP-4_7.5x4.1mm_P2.54mm","Package_SO/SOP-8-1EP_4.57x4.57mm_P1.27mm_EP4.57x4.45mm","Package_SO/SOP-8-1EP_4.57x4.57mm_P1.27mm_EP4.57x4.45mm_ThermalVias","Package_SO/SOP-8_3.76x4.96mm_P1.27mm","Package_SO/SOP-8_6.605x9.655mm_P2.54mm","Package_SO/SOP-8_6.62x9.15mm_P2.54mm","Package_SO/SSO-4_6.7x5.1mm_P2.54mm_Clearance8mm","Package_SO/SSO-6_6.8x4.6mm_P1.27mm_Clearance7mm","Package_SO/SSO-6_6.8x4.6mm_P1.27mm_Clearance8mm","Package_SO/SSO-7-8_6.4x9.78mm_P2.54mm","Package_SO/SSO-8-7_6.4x9.7mm_P2.54mm","Package_SO/SSO-8_13.6x6.3mm_P1.27mm_Clearance14.2mm","Package_SO/SSO-8_6.7x9.8mm_P2.54mm_Clearance8mm","Package_SO/SSO-8_6.8x5.9mm_P1.27mm_Clearance7mm","Package_SO/SSO-8_6.8x5.9mm_P1.27mm_Clearance8mm","Package_SO/SSO-8_9.6x6.3mm_P1.27mm_Clearance10.5mm","Package_SO/SSOP-10-1EP_3.9x4.9mm_P1mm_EP2.1x3.3mm","Package_SO/SSOP-10-1EP_3.9x4.9mm_P1mm_EP2.1x3.3mm_ThermalVias","Package_SO/SSOP-10_3.9x4.9mm_P1.00mm","Package_SO/SSOP-14_5.3x6.2mm_P0.65mm","Package_SO/SSOP-16_3.9x4.9mm_P0.635mm","Package_SO/SSOP-16_4.4x5.2mm_P0.65mm","Package_SO/SSOP-16_5.3x6.2mm_P0.65mm","Package_SO/SSOP-18_4.4x6.5mm_P0.65mm","Package_SO/SSOP-20_3.9x8.7mm_P0.635mm","Package_SO/SSOP-20_4.4x6.5mm_P0.65mm","Package_SO/SSOP-20_5.3x7.2mm_P0.65mm","Package_SO/SSOP-24_3.9x8.7mm_P0.635mm","Package_SO/SSOP-24_5.3x8.2mm_P0.65mm","Package_SO/SSOP-28_3.9x9.9mm_P0.635mm","Package_SO/SSOP-28_5.3x10.2mm_P0.65mm","Package_SO/SSOP-40_8.8x17.5mm_P0.8mm","Package_SO/SSOP-44_5.3x12.8mm_P0.5mm","Package_SO/SSOP-48_5.3x12.8mm_P0.5mm","Package_SO/SSOP-48_7.5x15.9mm_P0.635mm","Package_SO/SSOP-4_4.4x2.6mm_P1.27mm","Package_SO/SSOP-56_7.5x18.5mm_P0.635mm","Package_SO/SSOP-8_2.95x2.8mm_P0.65mm","Package_SO/SSOP-8_3.95x5.21x3.27mm_P1.27mm","Package_SO/SSOP-8_3.9x5.05mm_P1.27mm","Package_SO/SSOP-8_5.3x3mm_P0.65mm","Package_SO/STC_SOP-16_3.9x9.9mm_P1.27mm","Package_SO/ST_MultiPowerSO-30","Package_SO/ST_PowerSSO-24_SlugDown","Package_SO/ST_PowerSSO-24_SlugDown_ThermalVias","Package_SO/ST_PowerSSO-24_SlugUp","Package_SO/ST_PowerSSO-36_SlugDown","Package_SO/ST_PowerSSO-36_SlugDown_ThermalVias","Package_SO/ST_PowerSSO-36_SlugUp","Package_SO/TI_SO-PowerPAD-8","Package_SO/TI_SO-PowerPAD-8_ThermalVias","Package_SO/TSOP-5_1.65x3.05mm_P0.95mm","Package_SO/TSOP-6_1.65x3.05mm_P0.95mm","Package_SO/TSOP-I-24_12.4x6mm_P0.5mm","Package_SO/TSOP-I-24_14.4x6mm_P0.5mm","Package_SO/TSOP-I-24_16.4x6mm_P0.5mm","Package_SO/TSOP-I-24_18.4x6mm_P0.5mm","Package_SO/TSOP-I-28_11.8x8mm_P0.55mm","Package_SO/TSOP-I-32_11.8x8mm_P0.5mm","Package_SO/TSOP-I-32_12.4x8mm_P0.5mm","Package_SO/TSOP-I-32_14.4x8mm_P0.5mm","Package_SO/TSOP-I-32_16.4x8mm_P0.5mm","Package_SO/TSOP-I-32_18.4x8mm_P0.5mm","Package_SO/TSOP-I-32_18.4x8mm_P0.5mm_Reverse","Package_SO/TSOP-I-40_12.4x10mm_P0.5mm","Package_SO/TSOP-I-40_14.4x10mm_P0.5mm","Package_SO/TSOP-I-40_16.4x10mm_P0.5mm","Package_SO/TSOP-I-40_18.4x10mm_P0.5mm","Package_SO/TSOP-I-48_12.4x12mm_P0.5mm","Package_SO/TSOP-I-48_14.4x12mm_P0.5mm","Package_SO/TSOP-I-48_16.4x12mm_P0.5mm","Package_SO/TSOP-I-48_18.4x12mm_P0.5mm","Package_SO/TSOP-I-56_14.4x14mm_P0.5mm","Package_SO/TSOP-I-56_16.4x14mm_P0.5mm","Package_SO/TSOP-I-56_18.4x14mm_P0.5mm","Package_SO/TSOP-II-32_21.0x10.2mm_P1.27mm","Package_SO/TSOP-II-40-44_10.16x18.37mm_P0.8mm","Package_SO/TSOP-II-44_10.16x18.41mm_P0.8mm","Package_SO/TSOP-II-54_22.2x10.16mm_P0.8mm","Package_SO/TSSOP-100_6.1x20.8mm_P0.4mm","Package_SO/TSSOP-10_3x3mm_P0.5mm","Package_SO/TSSOP-14-1EP_4.4x5mm_P0.65mm","Package_SO/TSSOP-14_4.4x3.6mm_P0.4mm","Package_SO/TSSOP-14_4.4x5mm_P0.65mm","Package_SO/TSSOP-16-1EP_4.4x5mm_P0.65mm","Package_SO/TSSOP-16-1EP_4.4x5mm_P0.65mm_EP3x3mm","Package_SO/TSSOP-16-1EP_4.4x5mm_P0.65mm_EP3x3mm_ThermalVias","Package_SO/TSSOP-16_4.4x3.6mm_P0.4mm","Package_SO/TSSOP-16_4.4x5mm_P0.65mm","Package_SO/TSSOP-20-1EP_4.4x6.5mm_P0.65mm_EP2.15x3.35mm","Package_SO/TSSOP-20_4.4x5mm_P0.4mm","Package_SO/TSSOP-20_4.4x5mm_P0.5mm","Package_SO/TSSOP-20_4.4x6.5mm_P0.65mm","Package_SO/TSSOP-24_4.4x5mm_P0.4mm","Package_SO/TSSOP-24_4.4x6.5mm_P0.5mm","Package_SO/TSSOP-24_4.4x7.8mm_P0.65mm","Package_SO/TSSOP-24_6.1x7.8mm_P0.65mm","Package_SO/TSSOP-28-1EP_4.4x9.7mm_P0.65mm_EP2.74x4.75mm","Package_SO/TSSOP-28-1EP_4.4x9.7mm_P0.65mm_EP2.74x4.75mm_ThermalVias","Package_SO/TSSOP-28-1EP_4.4x9.7mm_P0.65mm_EP2.85x6.7mm","Package_SO/TSSOP-28-1EP_4.4x9.7mm_P0.65mm_EP3.05x7.56mm","Package_SO/TSSOP-28-1EP_4.4x9.7mm_P0.65mm_EP3.05x7.56mm_ThermalVias","Package_SO/TSSOP-28-1EP_4.4x9.7mm_P0.65mm_EP3.4x9.7mm_Mask3.1x4.05mm","Package_SO/TSSOP-28-1EP_4.4x9.7mm_P0.65mm_EP3.4x9.7mm_Mask3.1x4.05mm_ThermalVias","Package_SO/TSSOP-28_4.4x7.8mm_P0.5mm","Package_SO/TSSOP-28_4.4x9.7mm_P0.65mm","Package_SO/TSSOP-28_6.1x7.8mm_P0.5mm","Package_SO/TSSOP-28_6.1x9.7mm_P0.65mm","Package_SO/TSSOP-28_8x9.7mm_P0.65mm","Package_SO/TSSOP-30_4.4x7.8mm_P0.5mm","Package_SO/TSSOP-30_6.1x9.7mm_P0.65mm","Package_SO/TSSOP-32_4.4x6.5mm_P0.4mm","Package_SO/TSSOP-32_6.1x11mm_P0.65mm","Package_SO/TSSOP-32_8x11mm_P0.65mm","Package_SO/TSSOP-36_4.4x7.8mm_P0.4mm","Package_SO/TSSOP-36_4.4x9.7mm_P0.5mm","Package_SO/TSSOP-36_6.1x12.5mm_P0.65mm","Package_SO/TSSOP-36_6.1x7.8mm_P0.4mm","Package_SO/TSSOP-36_6.1x9.7mm_P0.5mm","Package_SO/TSSOP-36_8x12.5mm_P0.65mm","Package_SO/TSSOP-36_8x9.7mm_P0.5mm","Package_SO/TSSOP-38_4.4x9.7mm_P0.5mm","Package_SO/TSSOP-38_6.1x12.5mm_P0.65mm","Package_SO/TSSOP-40_6.1x11mm_P0.5mm","Package_SO/TSSOP-40_6.1x14mm_P0.65mm","Package_SO/TSSOP-40_8x11mm_P0.5mm","Package_SO/TSSOP-40_8x14mm_P0.65mm","Package_SO/TSSOP-44_4.4x11.2mm_P0.5mm","Package_SO/TSSOP-44_4.4x11mm_P0.5mm","Package_SO/TSSOP-44_6.1x11mm_P0.5mm","Package_SO/TSSOP-48_4.4x9.7mm_P0.4mm","Package_SO/TSSOP-48_6.1x12.5mm_P0.5mm","Package_SO/TSSOP-48_6.1x9.7mm_P0.4mm","Package_SO/TSSOP-48_8x12.5mm_P0.5mm","Package_SO/TSSOP-48_8x9.7mm_P0.4mm","Package_SO/TSSOP-4_4.4x5mm_P4mm","Package_SO/TSSOP-50_4.4x12.5mm_P0.5mm","Package_SO/TSSOP-52_6.1x11mm_P0.4mm","Package_SO/TSSOP-52_8x11mm_P0.4mm","Package_SO/TSSOP-56_4.4x11.3mm_P0.4mm","Package_SO/TSSOP-56_6.1x12.5mm_P0.4mm","Package_SO/TSSOP-56_6.1x14mm_P0.5mm","Package_SO/TSSOP-56_8x12.5mm_P0.4mm","Package_SO/TSSOP-56_8x14mm_P0.5mm","Package_SO/TSSOP-60_8x12.5mm_P0.4mm","Package_SO/TSSOP-64_6.1x14mm_P0.4mm","Package_SO/TSSOP-64_6.1x17mm_P0.5mm","Package_SO/TSSOP-64_8x14mm_P0.4mm","Package_SO/TSSOP-68_8x14mm_P0.4mm","Package_SO/TSSOP-80_6.1x17mm_P0.4mm","Package_SO/TSSOP-8_3x3mm_P0.65mm","Package_SO/TSSOP-8_4.4x3mm_P0.65mm","Package_SO/Texas_DAD0032A_HTSSOP-32_6.1x11mm_P0.65mm_TopEP3.71x3.81mm","Package_SO/Texas_DGN0008B_VSSOP-8-1EP_3x3mm_P0.65mm_EP2x3mm_Mask1.88x1.98mm","Package_SO/Texas_DGN0008B_VSSOP-8-1EP_3x3mm_P0.65mm_EP2x3mm_Mask1.88x1.98mm_ThermalVias","Package_SO/Texas_DGN0008D_VSSOP-8-1EP_3x3mm_P0.65mm_EP2x2.94mm_Mask1.57x1.89mm","Package_SO/Texas_DGN0008D_VSSOP-8-1EP_3x3mm_P0.65mm_EP2x2.94mm_Mask1.57x1.89mm_ThermalVias","Package_SO/Texas_DGN0008G_VSSOP-8-1EP_3x3mm_P0.65mm_EP2x2.94mm_Mask1.846x2.15mm","Package_SO/Texas_DGN0008G_VSSOP-8-1EP_3x3mm_P0.65mm_EP2x2.94mm_Mask1.846x2.15mm_ThermalVias","Package_SO/Texas_DGS0020A_TSSOP-20_3x5.1mm_P0.5mm","Package_SO/Texas_DKD0036A_HSSOP-36_11x15.9mm_P0.65mm_TopEP5.85x12.65mm","Package_SO/Texas_DYY0016A_TSOT-23-16_2x4.2mm_P0.5mm","Package_SO/Texas_HSOP-8-1EP_3.9x4.9mm_P1.27mm","Package_SO/Texas_HSOP-8-1EP_3.9x4.9mm_P1.27mm_ThermalVias","Package_SO/Texas_HTSOP-8-1EP_3.9x4.9mm_P1.27mm_EP2.95x4.9mm_Mask2.4x3.1mm_ThermalVias","Package_SO/Texas_HTSSOP-14-1EP_4.4x5mm_P0.65mm_EP3.4x5mm_Mask3.155x3.255mm","Package_SO/Texas_HTSSOP-14-1EP_4.4x5mm_P0.65mm_EP3.4x5mm_Mask3.155x3.255mm_ThermalVias","Package_SO/Texas_PW0020A_TSSOP-20_4.4x6.5mm_P0.65mm","Package_SO/Texas_PWP0020A","Package_SO/Texas_PWP0028V_TSSOP-28-1EP_4.4x9.7mm_P0.65mm_EP3.4x9.7mm_Mask2.94x5.62mm","Package_SO/Texas_PWP0028V_TSSOP-28-1EP_4.4x9.7mm_P0.65mm_EP3.4x9.7mm_Mask2.94x5.62mm_ThermalVias","Package_SO/Texas_R-PDSO-G8_EP2.95x4.9mm_Mask2.4x3.1mm","Package_SO/Texas_R-PDSO-G8_EP2.95x4.9mm_Mask2.4x3.1mm_ThermalVias","Package_SO/Texas_S-PDSO-G8_3x3mm_P0.65mm","Package_SO/Toshiba_SOIC-4-6_4.4x3.6mm_P1.27mm","Package_SO/Toshiba_SOIC-5-6_4.4x3.6mm_P1.27mm","Package_SO/VSO-40_7.6x15.4mm_P0.762mm","Package_SO/VSO-56_11.1x21.5mm_P0.75mm","Package_SO/VSSOP-8_2.3x2mm_P0.5mm","Package_SO/VSSOP-8_3x3mm_P0.65mm","Package_SO/Vishay_PowerPAK_1212-8_Dual","Package_SO/Vishay_PowerPAK_1212-8_Single","Package_SO/Zetex_SM8","Package_SON/Diodes_PowerDI3333-8","Package_SON/Diodes_PowerDI3333-8_UXC_3.3x3.3mm_P0.65mm","Package_SON/EPSON_CE-USON-10_USON-10_3.2x2.5mm_P0.7mm","Package_SON/Fairchild_DualPower33-6_3x3mm","Package_SON/Fairchild_MicroPak-6_1.0x1.45mm_P0.5mm","Package_SON/Fairchild_MicroPak2-6_1.0x1.0mm_P0.35mm","Package_SON/HUSON-3-1EP_2x2mm_P1.3mm_EP1.1x1.6mm","Package_SON/HVSON-8-1EP_3x3mm_P0.65mm_EP1.6x2.4mm","Package_SON/HVSON-8-1EP_4x4mm_P0.8mm_EP2.2x3.1mm","Package_SON/Infineon_PG-LSON-8-1","Package_SON/Infineon_PG-TDSON-8_6.15x5.15mm","Package_SON/Infineon_PG-TISON-8-2","Package_SON/Infineon_PG-TISON-8-3","Package_SON/Infineon_PG-TISON-8-4","Package_SON/Infineon_PG-TISON-8-5","Package_SON/MPS_USON-6_1.2x1.6mm_P0.5mm","Package_SON/MPS_VSON-6_1x1.5mm_P0.5mm","Package_SON/MicroCrystal_C7_SON-8_1.5x3.2mm_P0.9mm","Package_SON/Microchip_USON-10-1EP_3x3mm_P0.5mm_EP1.8x2.5mm","Package_SON/Microchip_USON-10-1EP_3x3mm_P0.5mm_EP1.8x2.5mm_ThermalVias","Package_SON/NXP_XSON-16","Package_SON/Nexperia_HUSON-12_USON-12-1EP_1.35x2.5mm_P0.4mm_EP0.4x2mm","Package_SON/Nexperia_HUSON-16_USON-16-1EP_1.35x3.3mm_P0.4mm_EP0.4x2.8mm","Package_SON/Nexperia_HUSON-8_USON-8-1EP_1.35x1.7mm_P0.4mm_EP0.4x1.2mm","Package_SON/ROHM_VML0806","Package_SON/RTC_SMD_MicroCrystal_C3_2.5x3.7mm","Package_SON/SON-8-1EP_3x2mm_P0.5mm_EP1.4x1.6mm","Package_SON/ST_PowerFLAT-6L_5x6mm_P1.27mm","Package_SON/ST_PowerFLAT_HV-5_8x8mm","Package_SON/ST_PowerFLAT_HV-8_5x6mm","Package_SON/Texas_DPY0002A_0.6x1mm_P0.65mm","Package_SON/Texas_DQK","Package_SON/Texas_DQX002A","Package_SON/Texas_DRC0010J","Package_SON/Texas_DRC0010J_ThermalVias","Package_SON/Texas_DRX_WSON-10_2.5x2.5mm_P0.5mm","Package_SON/Texas_DSC0010J","Package_SON/Texas_DSC0010J_ThermalVias","Package_SON/Texas_DSG0008A_WSON-8-1EP_2x2mm_P0.5mm_EP0.9x1.6mm","Package_SON/Texas_DSG0008A_WSON-8-1EP_2x2mm_P0.5mm_EP0.9x1.6mm_ThermalVias","Package_SON/Texas_PWSON-N6","Package_SON/Texas_R-PUSON-N14","Package_SON/Texas_R-PUSON-N8_USON-8-1EP_1.6x2.1mm_P0.5mm_EP0.4x1.7mm","Package_SON/Texas_R-PWSON-N12_EP0.4x2mm","Package_SON/Texas_S-PDSO-N12","Package_SON/Texas_S-PVSON-N10","Package_SON/Texas_S-PVSON-N10_ThermalVias","Package_SON/Texas_S-PVSON-N8","Package_SON/Texas_S-PVSON-N8_ThermalVias","Package_SON/Texas_S-PWSON-N10","Package_SON/Texas_S-PWSON-N10_ThermalVias","Package_SON/Texas_S-PWSON-N8_EP1.2x2mm","Package_SON/Texas_S-PWSON-N8_EP1.2x2mm_ThermalVias","Package_SON/Texas_USON-6_1x1.45mm_P0.5mm_SMD","Package_SON/Texas_VSON-HR-8_1.5x2mm_P0.5mm","Package_SON/Texas_X2SON-4-1EP_1.1x1.4mm_P0.5mm_EP0.8x0.6mm","Package_SON/Texas_X2SON-4-1EP_1.1x1.4mm_P0.5mm_EP0.8x0.6mm_ThermalVias","Package_SON/Texas_X2SON-4_1x1mm_P0.65mm","Package_SON/Texas_X2SON-5_0.8x0.8mm_P0.48mm","Package_SON/Texas_X2SON-5_0.8x0.8mm_P0.48mm_RoutingVia","Package_SON/USON-10_2.5x1.0mm_P0.5mm","Package_SON/USON-20_2x4mm_P0.4mm","Package_SON/VSON-10-1EP_3x3mm_P0.5mm_EP1.2x2mm","Package_SON/VSON-10-1EP_3x3mm_P0.5mm_EP1.2x2mm_ThermalVias","Package_SON/VSON-10-1EP_3x3mm_P0.5mm_EP1.65x2.4mm","Package_SON/VSON-10-1EP_3x3mm_P0.5mm_EP1.65x2.4mm_ThermalVias","Package_SON/VSON-14-1EP_3x4.45mm_P0.65mm_EP1.6x4.2mm","Package_SON/VSON-14-1EP_3x4.45mm_P0.65mm_EP1.6x4.2mm_ThermalVias","Package_SON/VSON-8-1EP_3x3mm_P0.65mm_EP1.65x2.4mm","Package_SON/VSON-8-1EP_3x3mm_P0.65mm_EP1.65x2.4mm_ThermalVias","Package_SON/VSON-8-1EP_3x3mm_P0.65mm_EP1.6x2.4mm","Package_SON/VSON-8_1.5x2mm_P0.5mm","Package_SON/VSON-8_3.3x3.3mm_P0.65mm_NexFET","Package_SON/VSONP-8-1EP_5x6_P1.27mm","Package_SON/WSON-10-1EP_2.5x2.5mm_P0.5mm_EP1.2x2mm","Package_SON/WSON-10-1EP_2.5x2.5mm_P0.5mm_EP1.2x2mm_ThermalVias","Package_SON/WSON-10-1EP_2x3mm_P0.5mm_EP0.84x2.4mm","Package_SON/WSON-10-1EP_2x3mm_P0.5mm_EP0.84x2.4mm_ThermalVias","Package_SON/WSON-10-1EP_4x3mm_P0.5mm_EP2.2x2mm","Package_SON/WSON-10-1EP_4x4mm_P0.8mm_EP2.6x3mm","Package_SON/WSON-10-1EP_4x4mm_P0.8mm_EP2.6x3mm_ThermalVias","Package_SON/WSON-12-1EP_3x2mm_P0.5mm_EP1x2.65","Package_SON/WSON-12-1EP_3x2mm_P0.5mm_EP1x2.65_ThermalVias","Package_SON/WSON-12-1EP_3x3mm_P0.5mm_EP1.5x2.5mm","Package_SON/WSON-12-1EP_3x3mm_P0.5mm_EP1.5x2.5mm_ThermalVias","Package_SON/WSON-12-1EP_4x4mm_P0.5mm_EP2.6x3mm","Package_SON/WSON-12-1EP_4x4mm_P0.5mm_EP2.6x3mm_ThermalVias","Package_SON/WSON-14-1EP_4.0x4.0mm_P0.5mm_EP2.6x2.6mm","Package_SON/WSON-16_3.3x1.35_P0.4mm","Package_SON/WSON-6-1EP_2x2mm_P0.65mm_EP1x1.6mm","Package_SON/WSON-6-1EP_2x2mm_P0.65mm_EP1x1.6mm_ThermalVias","Package_SON/WSON-6-1EP_3x3mm_P0.95mm","Package_SON/WSON-6_1.5x1.5mm_P0.5mm","Package_SON/WSON-8-1EP_2x2mm_P0.5mm_EP0.9x1.6mm","Package_SON/WSON-8-1EP_2x2mm_P0.5mm_EP0.9x1.6mm_ThermalVias","Package_SON/WSON-8-1EP_3x2.5mm_P0.5mm_EP1.2x1.5mm_PullBack","Package_SON/WSON-8-1EP_3x2.5mm_P0.5mm_EP1.2x1.5mm_PullBack_ThermalVias","Package_SON/WSON-8-1EP_3x3mm_P0.5mm_EP1.2x2mm","Package_SON/WSON-8-1EP_3x3mm_P0.5mm_EP1.2x2mm_ThermalVias","Package_SON/WSON-8-1EP_3x3mm_P0.5mm_EP1.45x2.4mm","Package_SON/WSON-8-1EP_3x3mm_P0.5mm_EP1.45x2.4mm_ThermalVias","Package_SON/WSON-8-1EP_3x3mm_P0.5mm_EP1.6x2.0mm","Package_SON/WSON-8-1EP_4x4mm_P0.8mm_EP1.98x3mm","Package_SON/WSON-8-1EP_4x4mm_P0.8mm_EP1.98x3mm_ThermalVias","Package_SON/WSON-8-1EP_4x4mm_P0.8mm_EP2.2x3mm","Package_SON/WSON-8-1EP_4x4mm_P0.8mm_EP2.2x3mm_ThermalVias","Package_SON/WSON-8-1EP_4x4mm_P0.8mm_EP2.6x3mm","Package_SON/WSON-8-1EP_4x4mm_P0.8mm_EP2.6x3mm_ThermalVias","Package_SON/WSON-8-1EP_6x5mm_P1.27mm_EP3.4x4.3mm","Package_SON/WSON-8-1EP_6x5mm_P1.27mm_EP3.4x4mm","Package_SON/WSON-8-1EP_8x6mm_P1.27mm_EP3.4x4.3mm","Package_SON/Winbond_USON-8-1EP_3x2mm_P0.5mm_EP0.2x1.6mm","Package_SON/Winbond_USON-8-2EP_3x4mm_P0.8mm_EP0.2x0.8mm","Package_SON/X2SON-8_1.4x1mm_P0.35mm","Package_SO_J-Lead/TSOC-6_3.76x3.94mm_P1.27mm","Package_TO_SOT_SMD/ATPAK-2","Package_TO_SOT_SMD/Analog_KS-4","Package_TO_SOT_SMD/Diodes_SOT-553","Package_TO_SOT_SMD/HVSOF5","Package_TO_SOT_SMD/HVSOF6","Package_TO_SOT_SMD/Infineon_PG-HDSOP-10-1","Package_TO_SOT_SMD/Infineon_PG-HSOF-8-1","Package_TO_SOT_SMD/Infineon_PG-HSOF-8-1_ThermalVias","Package_TO_SOT_SMD/Infineon_PG-HSOF-8-2","Package_TO_SOT_SMD/Infineon_PG-HSOF-8-2_ThermalVias","Package_TO_SOT_SMD/Infineon_PG-HSOF-8-2_ThermalVias2","Package_TO_SOT_SMD/Infineon_PG-HSOF-8-3","Package_TO_SOT_SMD/Infineon_PG-HSOF-8-3_ThermalVias","Package_TO_SOT_SMD/Infineon_PG-TO-220-7Lead_TabPin8","Package_TO_SOT_SMD/Infineon_PG-TSFP-3-1","Package_TO_SOT_SMD/LFPAK33","Package_TO_SOT_SMD/LFPAK56","Package_TO_SOT_SMD/LFPAK88","Package_TO_SOT_SMD/Nexperia_CFP15_SOT-1289","Package_TO_SOT_SMD/OnSemi_ECH8","Package_TO_SOT_SMD/PQFN_8x8","Package_TO_SOT_SMD/PowerMacro_M234_NoHole","Package_TO_SOT_SMD/PowerMacro_M234_WithHole","Package_TO_SOT_SMD/ROHM_SOT-457_ClockwisePinNumbering","Package_TO_SOT_SMD/Rohm_HRP7","Package_TO_SOT_SMD/SC-59","Package_TO_SOT_SMD/SC-59_Handsoldering","Package_TO_SOT_SMD/SC-70-8","Package_TO_SOT_SMD/SC-74-6_1.55x2.9mm_P0.95mm","Package_TO_SOT_SMD/SC-74A-5_1.55x2.9mm_P0.95mm","Package_TO_SOT_SMD/SC-82AA","Package_TO_SOT_SMD/SC-82AA_Handsoldering","Package_TO_SOT_SMD/SC-82AB","Package_TO_SOT_SMD/SC-82AB_Handsoldering","Package_TO_SOT_SMD/SOT-1123","Package_TO_SOT_SMD/SOT-1333-1","Package_TO_SOT_SMD/SOT-1334-1","Package_TO_SOT_SMD/SOT-143","Package_TO_SOT_SMD/SOT-143R","Package_TO_SOT_SMD/SOT-143R_Handsoldering","Package_TO_SOT_SMD/SOT-143_Handsoldering","Package_TO_SOT_SMD/SOT-223-3_TabPin2","Package_TO_SOT_SMD/SOT-223-5","Package_TO_SOT_SMD/SOT-223-6","Package_TO_SOT_SMD/SOT-223-6_TabPin3","Package_TO_SOT_SMD/SOT-223-8","Package_TO_SOT_SMD/SOT-223","Package_TO_SOT_SMD/SOT-23-3","Package_TO_SOT_SMD/SOT-23-5","Package_TO_SOT_SMD/SOT-23-5_HandSoldering","Package_TO_SOT_SMD/SOT-23-6","Package_TO_SOT_SMD/SOT-23-6_Handsoldering","Package_TO_SOT_SMD/SOT-23-8","Package_TO_SOT_SMD/SOT-23-8_Handsoldering","Package_TO_SOT_SMD/SOT-23","Package_TO_SOT_SMD/SOT-23W","Package_TO_SOT_SMD/SOT-23W_Handsoldering","Package_TO_SOT_SMD/SOT-23_Handsoldering","Package_TO_SOT_SMD/SOT-323_SC-70","Package_TO_SOT_SMD/SOT-343_SC-70-4","Package_TO_SOT_SMD/SOT-353_SC-70-5","Package_TO_SOT_SMD/SOT-363_SC-70-6","Package_TO_SOT_SMD/SOT-383F","Package_TO_SOT_SMD/SOT-383FL","Package_TO_SOT_SMD/SOT-416","Package_TO_SOT_SMD/SOT-457T","Package_TO_SOT_SMD/SOT-523","Package_TO_SOT_SMD/SOT-543","Package_TO_SOT_SMD/SOT-553","Package_TO_SOT_SMD/SOT-563","Package_TO_SOT_SMD/SOT-583-8","Package_TO_SOT_SMD/SOT-665","Package_TO_SOT_SMD/SOT-666","Package_TO_SOT_SMD/SOT-723","Package_TO_SOT_SMD/SOT-883","Package_TO_SOT_SMD/SOT-886","Package_TO_SOT_SMD/SOT-89-3","Package_TO_SOT_SMD/SOT-89-3_Handsoldering","Package_TO_SOT_SMD/SOT-89-5","Package_TO_SOT_SMD/SOT-89-5_Handsoldering","Package_TO_SOT_SMD/SOT-963","Package_TO_SOT_SMD/SuperSOT-3","Package_TO_SOT_SMD/SuperSOT-6","Package_TO_SOT_SMD/SuperSOT-8","Package_TO_SOT_SMD/TDSON-8-1","Package_TO_SOT_SMD/TO-252-2","Package_TO_SOT_SMD/TO-252-2_TabPin1","Package_TO_SOT_SMD/TO-252-3_TabPin2","Package_TO_SOT_SMD/TO-252-3_TabPin4","Package_TO_SOT_SMD/TO-252-4","Package_TO_SOT_SMD/TO-252-5_TabPin3","Package_TO_SOT_SMD/TO-252-5_TabPin6","Package_TO_SOT_SMD/TO-263-2","Package_TO_SOT_SMD/TO-263-2_TabPin1","Package_TO_SOT_SMD/TO-263-3_TabPin2","Package_TO_SOT_SMD/TO-263-3_TabPin4","Package_TO_SOT_SMD/TO-263-4","Package_TO_SOT_SMD/TO-263-5_TabPin3","Package_TO_SOT_SMD/TO-263-5_TabPin6","Package_TO_SOT_SMD/TO-263-6","Package_TO_SOT_SMD/TO-263-7_TabPin4","Package_TO_SOT_SMD/TO-263-7_TabPin8","Package_TO_SOT_SMD/TO-263-9_TabPin10","Package_TO_SOT_SMD/TO-263-9_TabPin5","Package_TO_SOT_SMD/TO-268-2","Package_TO_SOT_SMD/TO-269AA","Package_TO_SOT_SMD/TO-277A","Package_TO_SOT_SMD/TO-277B","Package_TO_SOT_SMD/TO-50-3_LongPad-NoHole_Housing","Package_TO_SOT_SMD/TO-50-3_LongPad-WithHole_Housing","Package_TO_SOT_SMD/TO-50-3_ShortPad-NoHole_Housing","Package_TO_SOT_SMD/TO-50-3_ShortPad-WithHole_Housing","Package_TO_SOT_SMD/TO-50-4_LongPad-NoHole_Housing","Package_TO_SOT_SMD/TO-50-4_LongPad-WithHole_Housing","Package_TO_SOT_SMD/TO-50-4_ShortPad-NoHole_Housing","Package_TO_SOT_SMD/TO-50-4_ShortPad-WithHole_Housing","Package_TO_SOT_SMD/TSOT-23-5","Package_TO_SOT_SMD/TSOT-23-5_HandSoldering","Package_TO_SOT_SMD/TSOT-23-6","Package_TO_SOT_SMD/TSOT-23-6_HandSoldering","Package_TO_SOT_SMD/TSOT-23-8","Package_TO_SOT_SMD/TSOT-23-8_HandSoldering","Package_TO_SOT_SMD/TSOT-23","Package_TO_SOT_SMD/TSOT-23_HandSoldering","Package_TO_SOT_SMD/Texas_DDF0008A_SOT-8_1.6x2.9mm_P0.65mm","Package_TO_SOT_SMD/Texas_DRT-3","Package_TO_SOT_SMD/Texas_NDQ","Package_TO_SOT_SMD/Texas_NDW-7_TabPin4","Package_TO_SOT_SMD/Texas_NDW-7_TabPin8","Package_TO_SOT_SMD/Texas_NDY0011A","Package_TO_SOT_SMD/Texas_R-PDSO-G5_DCK-5","Package_TO_SOT_SMD/Texas_R-PDSO-G6","Package_TO_SOT_SMD/Texas_R-PDSO-N5_DRL-5","Package_TO_SOT_SMD/Texas_R-PDSO-N6_DRL-6","Package_TO_SOT_SMD/VSOF5","Package_TO_SOT_SMD/Vishay_PowerPAK_SC70-6L_Dual","Package_TO_SOT_SMD/Vishay_PowerPAK_SC70-6L_Single","Package_TO_SOT_THT/Analog_TO-46-4_ThermalShield","Package_TO_SOT_THT/Fairchild_TO-220F-6L","Package_TO_SOT_THT/Heraeus_TO-92-2","Package_TO_SOT_THT/NEC_Molded_7x4x9mm","Package_TO_SOT_THT/PowerIntegrations_TO-220-7C","Package_TO_SOT_THT/SIPAK-1EP_Horizontal_TabDown","Package_TO_SOT_THT/SIPAK_Vertical","Package_TO_SOT_THT/SOD-70_P2.54mm","Package_TO_SOT_THT/SOD-70_P5.08mm","Package_TO_SOT_THT/SOT-227","Package_TO_SOT_THT/TO-100-10","Package_TO_SOT_THT/TO-100-10_Window","Package_TO_SOT_THT/TO-11-2","Package_TO_SOT_THT/TO-11-2_Window","Package_TO_SOT_THT/TO-11-3","Package_TO_SOT_THT/TO-11-3_Window","Package_TO_SOT_THT/TO-12-4","Package_TO_SOT_THT/TO-12-4_Window","Package_TO_SOT_THT/TO-126-2_Horizontal_TabDown","Package_TO_SOT_THT/TO-126-2_Horizontal_TabUp","Package_TO_SOT_THT/TO-126-2_Vertical","Package_TO_SOT_THT/TO-126-3_Horizontal_TabDown","Package_TO_SOT_THT/TO-126-3_Horizontal_TabUp","Package_TO_SOT_THT/TO-126-3_Vertical","Package_TO_SOT_THT/TO-17-4","Package_TO_SOT_THT/TO-17-4_Window","Package_TO_SOT_THT/TO-18-2","Package_TO_SOT_THT/TO-18-2_Lens","Package_TO_SOT_THT/TO-18-2_Window","Package_TO_SOT_THT/TO-18-3","Package_TO_SOT_THT/TO-18-3_Lens","Package_TO_SOT_THT/TO-18-3_Window","Package_TO_SOT_THT/TO-18-4","Package_TO_SOT_THT/TO-18-4_Lens","Package_TO_SOT_THT/TO-18-4_Window","Package_TO_SOT_THT/TO-218-2_Horizontal_TabDown","Package_TO_SOT_THT/TO-218-2_Horizontal_TabUp","Package_TO_SOT_THT/TO-218-2_Vertical","Package_TO_SOT_THT/TO-218-3_Horizontal_TabDown","Package_TO_SOT_THT/TO-218-3_Horizontal_TabUp","Package_TO_SOT_THT/TO-218-3_Vertical","Package_TO_SOT_THT/TO-220-11_P3.4x2.54mm_StaggerEven_Lead5.84mm_TabDown","Package_TO_SOT_THT/TO-220-11_P3.4x2.54mm_StaggerOdd_Lead5.84mm_TabDown","Package_TO_SOT_THT/TO-220-11_P3.4x5.08mm_StaggerEven_Lead4.58mm_Vertical","Package_TO_SOT_THT/TO-220-11_P3.4x5.08mm_StaggerOdd_Lead4.58mm_Vertical","Package_TO_SOT_THT/TO-220-11_P3.4x5.08mm_StaggerOdd_Lead8.45mm_TabDown","Package_TO_SOT_THT/TO-220-15_P2.54x2.54mm_StaggerEven_Lead5.84mm_TabDown","Package_TO_SOT_THT/TO-220-15_P2.54x2.54mm_StaggerOdd_Lead5.84mm_TabDown","Package_TO_SOT_THT/TO-220-15_P2.54x5.08mm_StaggerEven_Lead4.58mm_Vertical","Package_TO_SOT_THT/TO-220-15_P2.54x5.08mm_StaggerOdd_Lead4.58mm_Vertical","Package_TO_SOT_THT/TO-220-2_Horizontal_TabDown","Package_TO_SOT_THT/TO-220-2_Horizontal_TabUp","Package_TO_SOT_THT/TO-220-2_Vertical","Package_TO_SOT_THT/TO-220-3_Horizontal_TabDown","Package_TO_SOT_THT/TO-220-3_Horizontal_TabUp","Package_TO_SOT_THT/TO-220-3_Vertical","Package_TO_SOT_THT/TO-220-4_Horizontal_TabDown","Package_TO_SOT_THT/TO-220-4_Horizontal_TabUp","Package_TO_SOT_THT/TO-220-4_P5.08x3.7mm_StaggerEven_Lead3.8mm_Vertical","Package_TO_SOT_THT/TO-220-4_P5.08x3.7mm_StaggerOdd_Lead3.8mm_Vertical","Package_TO_SOT_THT/TO-220-4_P5.08x3.8mm_StaggerEven_Lead5.85mm_TabDown","Package_TO_SOT_THT/TO-220-4_P5.08x3.8mm_StaggerOdd_Lead5.85mm_TabDown","Package_TO_SOT_THT/TO-220-4_Vertical","Package_TO_SOT_THT/TO-220-5_Horizontal_TabDown","Package_TO_SOT_THT/TO-220-5_Horizontal_TabUp","Package_TO_SOT_THT/TO-220-5_P3.4x3.7mm_StaggerEven_Lead3.8mm_Vertical","Package_TO_SOT_THT/TO-220-5_P3.4x3.7mm_StaggerOdd_Lead3.8mm_Vertical","Package_TO_SOT_THT/TO-220-5_P3.4x3.8mm_StaggerEven_Lead7.13mm_TabDown","Package_TO_SOT_THT/TO-220-5_P3.4x3.8mm_StaggerOdd_Lead7.13mm_TabDown","Package_TO_SOT_THT/TO-220-5_Vertical","Package_TO_SOT_THT/TO-220-7_P2.54x3.7mm_StaggerEven_Lead3.8mm_Vertical","Package_TO_SOT_THT/TO-220-7_P2.54x3.7mm_StaggerOdd_Lead3.8mm_Vertical","Package_TO_SOT_THT/TO-220-7_P2.54x3.8mm_StaggerEven_Lead5.85mm_TabDown","Package_TO_SOT_THT/TO-220-7_P2.54x3.8mm_StaggerOdd_Lead5.85mm_TabDown","Package_TO_SOT_THT/TO-220-7_P2.54x5.08mm_StaggerOdd_Lead3.08mm_Vertical","Package_TO_SOT_THT/TO-220-7_P2.54x5.1mm_StaggerOdd_Lead8.025mm_TabDown","Package_TO_SOT_THT/TO-220-8_Vertical","Package_TO_SOT_THT/TO-220-9_P1.93x5.08mm_StaggerOdd_Lead3.378mm_Vertical","Package_TO_SOT_THT/TO-220-9_P1.94x3.7mm_StaggerEven_Lead3.8mm_Vertical","Package_TO_SOT_THT/TO-220-9_P1.94x3.7mm_StaggerOdd_Lead3.8mm_Vertical","Package_TO_SOT_THT/TO-220-9_P1.94x3.8mm_StaggerEven_Lead5.85mm_TabDown","Package_TO_SOT_THT/TO-220-9_P1.94x3.8mm_StaggerOdd_Lead5.85mm_TabDown","Package_TO_SOT_THT/TO-220F-11_P3.4x5.08mm_StaggerEven_Lead5.08mm_Vertical","Package_TO_SOT_THT/TO-220F-11_P3.4x5.08mm_StaggerOdd_Lead5.08mm_Vertical","Package_TO_SOT_THT/TO-220F-15_P2.54x5.08mm_StaggerEven_Lead5.08mm_Vertical","Package_TO_SOT_THT/TO-220F-15_P2.54x5.08mm_StaggerOdd_Lead5.08mm_Vertical","Package_TO_SOT_THT/TO-220F-2_Horizontal_TabDown","Package_TO_SOT_THT/TO-220F-2_Horizontal_TabUp","Package_TO_SOT_THT/TO-220F-2_Vertical","Package_TO_SOT_THT/TO-220F-3_Horizontal_TabDown","Package_TO_SOT_THT/TO-220F-3_Horizontal_TabUp","Package_TO_SOT_THT/TO-220F-3_Vertical","Package_TO_SOT_THT/TO-220F-4_Horizontal_TabDown","Package_TO_SOT_THT/TO-220F-4_Horizontal_TabUp","Package_TO_SOT_THT/TO-220F-4_P5.08x2.05mm_StaggerEven_Lead1.85mm_Vertical","Package_TO_SOT_THT/TO-220F-4_P5.08x2.05mm_StaggerOdd_Lead1.85mm_Vertical","Package_TO_SOT_THT/TO-220F-4_P5.08x3.7mm_StaggerEven_Lead3.5mm_Vertical","Package_TO_SOT_THT/TO-220F-4_P5.08x3.7mm_StaggerOdd_Lead3.5mm_Vertical","Package_TO_SOT_THT/TO-220F-4_Vertical","Package_TO_SOT_THT/TO-220F-5_Horizontal_TabDown","Package_TO_SOT_THT/TO-220F-5_Horizontal_TabUp","Package_TO_SOT_THT/TO-220F-5_P3.4x2.06mm_StaggerEven_Lead1.86mm_Vertical","Package_TO_SOT_THT/TO-220F-5_P3.4x2.06mm_StaggerOdd_Lead1.86mm_Vertical","Package_TO_SOT_THT/TO-220F-5_P3.4x3.7mm_StaggerEven_Lead3.5mm_Vertical","Package_TO_SOT_THT/TO-220F-5_P3.4x3.7mm_StaggerOdd_Lead3.5mm_Vertical","Package_TO_SOT_THT/TO-220F-5_Vertical","Package_TO_SOT_THT/TO-220F-7_P2.54x3.7mm_StaggerEven_Lead3.5mm_Vertical","Package_TO_SOT_THT/TO-220F-7_P2.54x3.7mm_StaggerOdd_Lead3.5mm_Vertical","Package_TO_SOT_THT/TO-220F-9_P1.8x3.7mm_StaggerEven_Lead3.5mm_Vertical","Package_TO_SOT_THT/TO-220F-9_P1.8x3.7mm_StaggerOdd_Lead3.5mm_Vertical","Package_TO_SOT_THT/TO-247-2_Horizontal_TabDown","Package_TO_SOT_THT/TO-247-2_Horizontal_TabUp","Package_TO_SOT_THT/TO-247-2_Vertical","Package_TO_SOT_THT/TO-247-3_Horizontal_TabDown","Package_TO_SOT_THT/TO-247-3_Horizontal_TabUp","Package_TO_SOT_THT/TO-247-3_Vertical","Package_TO_SOT_THT/TO-247-4_Horizontal_TabDown","Package_TO_SOT_THT/TO-247-4_Horizontal_TabUp","Package_TO_SOT_THT/TO-247-4_Vertical","Package_TO_SOT_THT/TO-247-5_Horizontal_TabDown","Package_TO_SOT_THT/TO-247-5_Horizontal_TabUp","Package_TO_SOT_THT/TO-247-5_Vertical","Package_TO_SOT_THT/TO-251-2-1EP_Horizontal_TabDown","Package_TO_SOT_THT/TO-251-2_Vertical","Package_TO_SOT_THT/TO-251-3-1EP_Horizontal_TabDown","Package_TO_SOT_THT/TO-251-3_Vertical","Package_TO_SOT_THT/TO-262-3-1EP_Horizontal_TabDown","Package_TO_SOT_THT/TO-262-3_Vertical","Package_TO_SOT_THT/TO-262-5-1EP_Horizontal_TabDown","Package_TO_SOT_THT/TO-262-5_Vertical","Package_TO_SOT_THT/TO-264-2_Horizontal_TabDown","Package_TO_SOT_THT/TO-264-2_Horizontal_TabUp","Package_TO_SOT_THT/TO-264-2_Vertical","Package_TO_SOT_THT/TO-264-3_Horizontal_TabDown","Package_TO_SOT_THT/TO-264-3_Horizontal_TabUp","Package_TO_SOT_THT/TO-264-3_Vertical","Package_TO_SOT_THT/TO-264-5_Horizontal_TabDown","Package_TO_SOT_THT/TO-264-5_Horizontal_TabUp","Package_TO_SOT_THT/TO-264-5_Vertical","Package_TO_SOT_THT/TO-3","Package_TO_SOT_THT/TO-33-4","Package_TO_SOT_THT/TO-33-4_Window","Package_TO_SOT_THT/TO-38-2","Package_TO_SOT_THT/TO-38-2_Window","Package_TO_SOT_THT/TO-38-3","Package_TO_SOT_THT/TO-38-3_Window","Package_TO_SOT_THT/TO-39-10","Package_TO_SOT_THT/TO-39-10_Window","Package_TO_SOT_THT/TO-39-2","Package_TO_SOT_THT/TO-39-2_Window","Package_TO_SOT_THT/TO-39-3","Package_TO_SOT_THT/TO-39-3_Window","Package_TO_SOT_THT/TO-39-4","Package_TO_SOT_THT/TO-39-4_Window","Package_TO_SOT_THT/TO-39-6","Package_TO_SOT_THT/TO-39-6_Window","Package_TO_SOT_THT/TO-39-8","Package_TO_SOT_THT/TO-39-8_Window","Package_TO_SOT_THT/TO-3P-3_Horizontal_TabDown","Package_TO_SOT_THT/TO-3P-3_Horizontal_TabUp","Package_TO_SOT_THT/TO-3P-3_Vertical","Package_TO_SOT_THT/TO-3PB-3_Horizontal_TabDown","Package_TO_SOT_THT/TO-3PB-3_Horizontal_TabUp","Package_TO_SOT_THT/TO-3PB-3_Vertical","Package_TO_SOT_THT/TO-46-2","Package_TO_SOT_THT/TO-46-2_Pin2Center","Package_TO_SOT_THT/TO-46-2_Pin2Center_Window","Package_TO_SOT_THT/TO-46-2_Window","Package_TO_SOT_THT/TO-46-3","Package_TO_SOT_THT/TO-46-3_Pin2Center","Package_TO_SOT_THT/TO-46-3_Pin2Center_Window","Package_TO_SOT_THT/TO-46-3_Window","Package_TO_SOT_THT/TO-46-4","Package_TO_SOT_THT/TO-46-4_Window","Package_TO_SOT_THT/TO-5-10","Package_TO_SOT_THT/TO-5-10_Window","Package_TO_SOT_THT/TO-5-2","Package_TO_SOT_THT/TO-5-2_Window","Package_TO_SOT_THT/TO-5-3","Package_TO_SOT_THT/TO-5-3_Window","Package_TO_SOT_THT/TO-5-4","Package_TO_SOT_THT/TO-5-4_Window","Package_TO_SOT_THT/TO-5-6","Package_TO_SOT_THT/TO-5-6_Window","Package_TO_SOT_THT/TO-5-8","Package_TO_SOT_THT/TO-5-8_PD5.08","Package_TO_SOT_THT/TO-5-8_PD5.08_Window","Package_TO_SOT_THT/TO-5-8_Window","Package_TO_SOT_THT/TO-52-2","Package_TO_SOT_THT/TO-52-2_Window","Package_TO_SOT_THT/TO-52-3","Package_TO_SOT_THT/TO-52-3_Window","Package_TO_SOT_THT/TO-72-4","Package_TO_SOT_THT/TO-72-4_Window","Package_TO_SOT_THT/TO-75-6","Package_TO_SOT_THT/TO-75-6_Window","Package_TO_SOT_THT/TO-78-10","Package_TO_SOT_THT/TO-78-10_Window","Package_TO_SOT_THT/TO-78-6","Package_TO_SOT_THT/TO-78-6_Window","Package_TO_SOT_THT/TO-78-8","Package_TO_SOT_THT/TO-78-8_Window","Package_TO_SOT_THT/TO-8-2","Package_TO_SOT_THT/TO-8-2_Window","Package_TO_SOT_THT/TO-8-3","Package_TO_SOT_THT/TO-8-3_Window","Package_TO_SOT_THT/TO-92-2","Package_TO_SOT_THT/TO-92-2_Horizontal1","Package_TO_SOT_THT/TO-92-2_Horizontal2","Package_TO_SOT_THT/TO-92-2_W4.0mm_Horizontal_FlatSideDown","Package_TO_SOT_THT/TO-92-2_W4.0mm_Horizontal_FlatSideUp","Package_TO_SOT_THT/TO-92-2_Wide","Package_TO_SOT_THT/TO-92","Package_TO_SOT_THT/TO-92Flat","Package_TO_SOT_THT/TO-92L","Package_TO_SOT_THT/TO-92L_HandSolder","Package_TO_SOT_THT/TO-92L_Inline","Package_TO_SOT_THT/TO-92L_Inline_Wide","Package_TO_SOT_THT/TO-92L_Wide","Package_TO_SOT_THT/TO-92Mini-2","Package_TO_SOT_THT/TO-92S","Package_TO_SOT_THT/TO-92_HandSolder","Package_TO_SOT_THT/TO-92_Horizontal1","Package_TO_SOT_THT/TO-92_Horizontal2","Package_TO_SOT_THT/TO-92_Inline","Package_TO_SOT_THT/TO-92_Inline_Horizontal1","Package_TO_SOT_THT/TO-92_Inline_Horizontal2","Package_TO_SOT_THT/TO-92_Inline_W4.0mm_Horizontal_FlatSideDown","Package_TO_SOT_THT/TO-92_Inline_W4.0mm_Horizontal_FlatSideUp","Package_TO_SOT_THT/TO-92_Inline_Wide","Package_TO_SOT_THT/TO-92_W4.0mm_StaggerEven_Horizontal_FlatSideDown","Package_TO_SOT_THT/TO-92_W4.0mm_StaggerEven_Horizontal_FlatSideUp","Package_TO_SOT_THT/TO-92_Wide","Package_TO_SOT_THT/TO-99-6","Package_TO_SOT_THT/TO-99-6_Window","Package_TO_SOT_THT/TO-99-8","Package_TO_SOT_THT/TO-99-8_Window","Panelization/BreakLine_11h_D0.5mm_P0.85mm","Panelization/BreakLine_1h_D0.5mm_P0.85mm","Panelization/BreakLine_2h_D0.5mm_P0.85mm","Panelization/BreakLine_2h_D0.5mm_P1.7mm","Panelization/BreakLine_3h_D0.5mm_P0.85mm","Panelization/BreakLine_3h_D0.5mm_P1.7mm","Panelization/BreakLine_5h_D0.5mm_P0.85mm","Panelization/BreakLine_7h_D0.5mm_P0.85mm","Panelization/BreakLine_9h_D0.5mm_P0.85mm","Panelization/MouseBite-Part_2.0x2.0mm_0h","Panelization/MouseBite-Part_2.0x2.0mm_inset_D0.5mm_P0.85mm_4h_Trace","Panelization/MouseBite-Part_2.0x2.0mm_inset_D0.5mm_P0.85mm_5h","Panelization/MouseBite-Part_2.0x2.0mm_outset_D0.5mm_P0.85mm_2h_Trace","Panelization/MouseBite-Part_2.0x2.0mm_outset_D0.5mm_P0.85mm_3h","Panelization/MouseBite-Part_2.0x4.5mm_0h","Panelization/MouseBite-Part_2.0x4.5mm_inset_D0.5mm_P0.85mm_5h_Trace","Panelization/MouseBite-Part_2.0x4.5mm_inset_D0.5mm_P0.85mm_7h","Panelization/MouseBite-Part_2.0x4.5mm_outset_D0.5mm_P0.85mm_5h_Trace","Panelization/MouseBite-Part_2.0x4.5mm_outset_D0.5mm_P0.85mm_7h","Panelization/MouseBite-Slot-Jumper_01005","Panelization/MouseBite-Slot-Jumper_0201","Panelization/MouseBite-Slot_2.0x2.0mm_inset_D0.5mm_P0.85mm_4h_Trace","Panelization/MouseBite-Slot_2.0x2.0mm_inset_D0.5mm_P0.85mm_5h","Panelization/MouseBite-Slot_2.0x2.0mm_outset_D0.5mm_P0.85mm_2h_Trace","Panelization/MouseBite-Slot_2.0x2.0mm_outset_D0.5mm_P0.85mm_3h","Panelization/MouseBite-Slot_2.0x4.5mm_inset_D0.5mm_P0.85mm_5h_Trace","Panelization/MouseBite-Slot_2.0x4.5mm_inset_D0.5mm_P0.85mm_7h","Panelization/MouseBite-Slot_2.0x4.5mm_outset_D0.5mm_P0.85mm_5h_Trace","Panelization/MouseBite-Slot_2.0x4.5mm_outset_D0.5mm_P0.85mm_7h","Panelization/MouseBite-Slot_2.54x2.54mm_on-edge_D0.5mm_P0.85mm_4h_Trace","Panelization/MouseBite-Slot_2.54x5.08mm_on-edge_D0.5mm_P0.85mm_5h_Trace","Potentiometer_SMD/Potentiometer_ACP_CA14-VSMD_Vertical","Potentiometer_SMD/Potentiometer_ACP_CA14-VSMD_Vertical_Hole","Potentiometer_SMD/Potentiometer_ACP_CA6-VSMD_Vertical","Potentiometer_SMD/Potentiometer_ACP_CA6-VSMD_Vertical_Hole","Potentiometer_SMD/Potentiometer_ACP_CA9-VSMD_Vertical","Potentiometer_SMD/Potentiometer_ACP_CA9-VSMD_Vertical_Hole","Potentiometer_SMD/Potentiometer_Bourns_3214G_Horizontal","Potentiometer_SMD/Potentiometer_Bourns_3214J_Horizontal","Potentiometer_SMD/Potentiometer_Bourns_3214W_Vertical","Potentiometer_SMD/Potentiometer_Bourns_3214X_Vertical","Potentiometer_SMD/Potentiometer_Bourns_3224G_Horizontal","Potentiometer_SMD/Potentiometer_Bourns_3224J_Horizontal","Potentiometer_SMD/Potentiometer_Bourns_3224W_Vertical","Potentiometer_SMD/Potentiometer_Bourns_3224X_Vertical","Potentiometer_SMD/Potentiometer_Bourns_3269P_Horizontal","Potentiometer_SMD/Potentiometer_Bourns_3269W_Vertical","Potentiometer_SMD/Potentiometer_Bourns_3269X_Horizontal","Potentiometer_SMD/Potentiometer_Bourns_3314G_Vertical","Potentiometer_SMD/Potentiometer_Bourns_3314J_Vertical","Potentiometer_SMD/Potentiometer_Bourns_3314R-1_Vertical_Hole","Potentiometer_SMD/Potentiometer_Bourns_3314R-GM5_Vertical_Hole","Potentiometer_SMD/Potentiometer_Bourns_3314S_Horizontal","Potentiometer_SMD/Potentiometer_Bourns_PRS11S_Vertical","Potentiometer_SMD/Potentiometer_Bourns_TC33X_Vertical","Potentiometer_SMD/Potentiometer_Vishay_TS53YJ_Vertical","Potentiometer_SMD/Potentiometer_Vishay_TS53YL_Vertical","Potentiometer_THT/Potentiometer_ACP_CA14-H2,5_Horizontal","Potentiometer_THT/Potentiometer_ACP_CA14-H4_Horizontal","Potentiometer_THT/Potentiometer_ACP_CA14-H5_Horizontal","Potentiometer_THT/Potentiometer_ACP_CA14V-15_Vertical","Potentiometer_THT/Potentiometer_ACP_CA14V-15_Vertical_Hole","Potentiometer_THT/Potentiometer_ACP_CA6-H2,5_Horizontal","Potentiometer_THT/Potentiometer_ACP_CA9-H2,5_Horizontal","Potentiometer_THT/Potentiometer_ACP_CA9-H3,8_Horizontal","Potentiometer_THT/Potentiometer_ACP_CA9-H5_Horizontal","Potentiometer_THT/Potentiometer_ACP_CA9-V10_Vertical","Potentiometer_THT/Potentiometer_ACP_CA9-V10_Vertical_Hole","Potentiometer_THT/Potentiometer_Alpha_RD901F-40-00D_Single_Vertical","Potentiometer_THT/Potentiometer_Alpha_RD901F-40-00D_Single_Vertical_CircularHoles","Potentiometer_THT/Potentiometer_Alpha_RD902F-40-00D_Dual_Vertical","Potentiometer_THT/Potentiometer_Alpha_RD902F-40-00D_Dual_Vertical_CircularHoles","Potentiometer_THT/Potentiometer_Alps_RK097_Dual_Horizontal","Potentiometer_THT/Potentiometer_Alps_RK097_Dual_Horizontal_Switch","Potentiometer_THT/Potentiometer_Alps_RK097_Single_Horizontal","Potentiometer_THT/Potentiometer_Alps_RK097_Single_Horizontal_Switch","Potentiometer_THT/Potentiometer_Alps_RK09K_Single_Horizontal","Potentiometer_THT/Potentiometer_Alps_RK09K_Single_Vertical","Potentiometer_THT/Potentiometer_Alps_RK09L_Double_Horizontal","Potentiometer_THT/Potentiometer_Alps_RK09L_Double_Vertical","Potentiometer_THT/Potentiometer_Alps_RK09L_Single_Horizontal","Potentiometer_THT/Potentiometer_Alps_RK09L_Single_Vertical","Potentiometer_THT/Potentiometer_Alps_RK09Y11_Single_Horizontal","Potentiometer_THT/Potentiometer_Alps_RK163_Dual_Horizontal","Potentiometer_THT/Potentiometer_Alps_RK163_Single_Horizontal","Potentiometer_THT/Potentiometer_Bourns_20P_Horizontal","Potentiometer_THT/Potentiometer_Bourns_3005_Horizontal","Potentiometer_THT/Potentiometer_Bourns_3006P_Horizontal","Potentiometer_THT/Potentiometer_Bourns_3006W_Horizontal","Potentiometer_THT/Potentiometer_Bourns_3006Y_Horizontal","Potentiometer_THT/Potentiometer_Bourns_3009P_Horizontal","Potentiometer_THT/Potentiometer_Bourns_3009Y_Horizontal","Potentiometer_THT/Potentiometer_Bourns_3266P_Horizontal","Potentiometer_THT/Potentiometer_Bourns_3266W_Vertical","Potentiometer_THT/Potentiometer_Bourns_3266X_Horizontal","Potentiometer_THT/Potentiometer_Bourns_3266Y_Vertical","Potentiometer_THT/Potentiometer_Bourns_3266Z_Horizontal","Potentiometer_THT/Potentiometer_Bourns_3296P_Horizontal","Potentiometer_THT/Potentiometer_Bourns_3296W_Vertical","Potentiometer_THT/Potentiometer_Bourns_3296X_Horizontal","Potentiometer_THT/Potentiometer_Bourns_3296Y_Vertical","Potentiometer_THT/Potentiometer_Bourns_3296Z_Horizontal","Potentiometer_THT/Potentiometer_Bourns_3299P_Horizontal","Potentiometer_THT/Potentiometer_Bourns_3299W_Vertical","Potentiometer_THT/Potentiometer_Bourns_3299X_Horizontal","Potentiometer_THT/Potentiometer_Bourns_3299Y_Vertical","Potentiometer_THT/Potentiometer_Bourns_3299Z_Horizontal","Potentiometer_THT/Potentiometer_Bourns_3339H_Vertical","Potentiometer_THT/Potentiometer_Bourns_3339P_Vertical","Potentiometer_THT/Potentiometer_Bourns_3339P_Vertical_HandSoldering","Potentiometer_THT/Potentiometer_Bourns_3339S_Horizontal","Potentiometer_THT/Potentiometer_Bourns_3339W_Horizontal","Potentiometer_THT/Potentiometer_Bourns_3386C_Horizontal","Potentiometer_THT/Potentiometer_Bourns_3386F_Vertical","Potentiometer_THT/Potentiometer_Bourns_3386H_Horizontal","Potentiometer_THT/Potentiometer_Bourns_3386P_Vertical","Potentiometer_THT/Potentiometer_Bourns_3386W_Horizontal","Potentiometer_THT/Potentiometer_Bourns_3386X_Horizontal","Potentiometer_THT/Potentiometer_Bourns_PTA1543_Single_Slide","Potentiometer_THT/Potentiometer_Bourns_PTA2043_Single_Slide","Potentiometer_THT/Potentiometer_Bourns_PTA3043_Single_Slide","Potentiometer_THT/Potentiometer_Bourns_PTA4543_Single_Slide","Potentiometer_THT/Potentiometer_Bourns_PTA6043_Single_Slide","Potentiometer_THT/Potentiometer_Bourns_PTV09A-1_Single_Vertical","Potentiometer_THT/Potentiometer_Bourns_PTV09A-2_Single_Horizontal","Potentiometer_THT/Potentiometer_Bourns_PTV112-4_Dual_Vertical","Potentiometer_THT/Potentiometer_Omeg_PC16BU_Horizontal","Potentiometer_THT/Potentiometer_Omeg_PC16BU_Vertical","Potentiometer_THT/Potentiometer_Piher_PC-16_Dual_Horizontal","Potentiometer_THT/Potentiometer_Piher_PC-16_Single_Horizontal","Potentiometer_THT/Potentiometer_Piher_PC-16_Single_Vertical","Potentiometer_THT/Potentiometer_Piher_PC-16_Triple_Horizontal","Potentiometer_THT/Potentiometer_Piher_PT-10-H01_Horizontal","Potentiometer_THT/Potentiometer_Piher_PT-10-H05_Horizontal","Potentiometer_THT/Potentiometer_Piher_PT-10-V05_Vertical","Potentiometer_THT/Potentiometer_Piher_PT-10-V10_Vertical","Potentiometer_THT/Potentiometer_Piher_PT-10-V10_Vertical_Hole","Potentiometer_THT/Potentiometer_Piher_PT-15-H01_Horizontal","Potentiometer_THT/Potentiometer_Piher_PT-15-H05_Horizontal","Potentiometer_THT/Potentiometer_Piher_PT-15-H06_Horizontal","Potentiometer_THT/Potentiometer_Piher_PT-15-H25_Horizontal","Potentiometer_THT/Potentiometer_Piher_PT-15-V02_Vertical","Potentiometer_THT/Potentiometer_Piher_PT-15-V02_Vertical_Hole","Potentiometer_THT/Potentiometer_Piher_PT-15-V15_Vertical","Potentiometer_THT/Potentiometer_Piher_PT-15-V15_Vertical_Hole","Potentiometer_THT/Potentiometer_Piher_PT-6-H_Horizontal","Potentiometer_THT/Potentiometer_Piher_PT-6-V_Vertical","Potentiometer_THT/Potentiometer_Piher_PT-6-V_Vertical_Hole","Potentiometer_THT/Potentiometer_Piher_T-16H_Double_Horizontal","Potentiometer_THT/Potentiometer_Piher_T-16H_Single_Horizontal","Potentiometer_THT/Potentiometer_Piher_T-16L_Single_Vertical_Hole","Potentiometer_THT/Potentiometer_Runtron_RM-063_Horizontal","Potentiometer_THT/Potentiometer_Runtron_RM-065_Vertical","Potentiometer_THT/Potentiometer_TT_P0915N","Potentiometer_THT/Potentiometer_Vishay_148-149_Dual_Horizontal","Potentiometer_THT/Potentiometer_Vishay_148-149_Single_Horizontal","Potentiometer_THT/Potentiometer_Vishay_148-149_Single_Vertical","Potentiometer_THT/Potentiometer_Vishay_148E-149E_Dual_Horizontal","Potentiometer_THT/Potentiometer_Vishay_148E-149E_Single_Horizontal","Potentiometer_THT/Potentiometer_Vishay_248BH-249BH_Single_Horizontal","Potentiometer_THT/Potentiometer_Vishay_248GJ-249GJ_Single_Horizontal","Potentiometer_THT/Potentiometer_Vishay_248GJ-249GJ_Single_Vertical","Potentiometer_THT/Potentiometer_Vishay_43_Horizontal","Potentiometer_THT/Potentiometer_Vishay_T7-YA_Single_Vertical","Potentiometer_THT/Potentiometer_Vishay_T73XW_Horizontal","Potentiometer_THT/Potentiometer_Vishay_T73XX_Horizontal","Potentiometer_THT/Potentiometer_Vishay_T73YP_Vertical","Potentiometer_THT/Potentiometer_Vishay_T93XA_Horizontal","Potentiometer_THT/Potentiometer_Vishay_T93YA_Vertical","RF/Skyworks_SKY13575_639LF","RF/Skyworks_SKY65404-31","RF_Antenna/AVX_M620720","RF_Antenna/Abracon_APAES868R8060C16-T","RF_Antenna/Abracon_PRO-OB-440","RF_Antenna/Abracon_PRO-OB-471","RF_Antenna/Antenova_SR4G013_GPS","RF_Antenna/Astrocast_AST50127-00","RF_Antenna/Coilcraft_MA5532-AE_RFID","RF_Antenna/Johanson_2450AT18x100","RF_Antenna/Johanson_2450AT18x100_2400-2500Mhz","RF_Antenna/Johanson_2450AT43F0100","RF_Antenna/Johanson_2450AT43F0100_2400-2500Mhz","RF_Antenna/Molex_47948-0001_2.4Ghz","RF_Antenna/NiceRF_SW868-TH13_868Mhz","RF_Antenna/Pulse_W3000","RF_Antenna/Pulse_W3011","RF_Antenna/Texas_SWRA117D_2.4GHz_Left","RF_Antenna/Texas_SWRA117D_2.4GHz_Right","RF_Antenna/Texas_SWRA416_868MHz_915MHz","RF_Converter/Anaren_0805_2012Metric-6","RF_Converter/Balun_Johanson_0896BM15A0001","RF_Converter/Balun_Johanson_0900FM15K0039","RF_Converter/Balun_Johanson_0900PC15J0013","RF_Converter/Balun_Johanson_1.6x0.8mm","RF_Converter/Balun_Johanson_5400BL15B050E","RF_Converter/RF_Attenuator_Susumu_PAT1220","RF_GPS/Linx_RXM-GPS","RF_GPS/OriginGPS_ORG1510","RF_GPS/Quectel_L70-R","RF_GPS/Quectel_L76","RF_GPS/Quectel_L80-R","RF_GPS/Quectel_L96","RF_GPS/SIM28ML","RF_GPS/Sierra_XA11X0","RF_GPS/Sierra_XM11X0","RF_GPS/ublox_LEA","RF_GPS/ublox_MAX","RF_GPS/ublox_NEO","RF_GPS/ublox_SAM-M8Q","RF_GPS/ublox_SAM-M8Q_HandSolder","RF_GPS/ublox_ZED","RF_GPS/ublox_ZOE_M8","RF_GSM/Quectel_BC66","RF_GSM/Quectel_BC95","RF_GSM/Quectel_BG95","RF_GSM/Quectel_BG96","RF_GSM/Quectel_M95","RF_GSM/SIMCom_SIM800C","RF_GSM/SIMCom_SIM900","RF_GSM/Telit_SE150A4","RF_GSM/Telit_xL865","RF_GSM/ublox_LENA-R8_LGA-100","RF_GSM/ublox_SARA_LGA-96","RF_Mini-Circuits/Mini-Circuits_BK377","RF_Mini-Circuits/Mini-Circuits_BK377_LandPatternPL-005","RF_Mini-Circuits/Mini-Circuits_CD541_H2.08mm","RF_Mini-Circuits/Mini-Circuits_CD542_H2.84mm","RF_Mini-Circuits/Mini-Circuits_CD542_LandPatternPL-052","RF_Mini-Circuits/Mini-Circuits_CD542_LandPatternPL-094","RF_Mini-Circuits/Mini-Circuits_CD636_H4.11mm","RF_Mini-Circuits/Mini-Circuits_CD636_LandPatternPL-035","RF_Mini-Circuits/Mini-Circuits_CD637_H5.23mm","RF_Mini-Circuits/Mini-Circuits_CK605","RF_Mini-Circuits/Mini-Circuits_CK605_LandPatternPL-012","RF_Mini-Circuits/Mini-Circuits_DB1627","RF_Mini-Circuits/Mini-Circuits_GP1212","RF_Mini-Circuits/Mini-Circuits_GP1212_LandPatternPL-176","RF_Mini-Circuits/Mini-Circuits_GP731","RF_Mini-Circuits/Mini-Circuits_GP731_LandPatternPL-176","RF_Mini-Circuits/Mini-Circuits_HF1139","RF_Mini-Circuits/Mini-Circuits_HF1139_LandPatternPL-230","RF_Mini-Circuits/Mini-Circuits_HQ1157","RF_Mini-Circuits/Mini-Circuits_HZ1198","RF_Mini-Circuits/Mini-Circuits_HZ1198_LandPatternPL-247","RF_Mini-Circuits/Mini-Circuits_MMM168","RF_Mini-Circuits/Mini-Circuits_MMM168_LandPatternPL-225","RF_Mini-Circuits/Mini-Circuits_QQQ130_ClockwisePinNumbering","RF_Mini-Circuits/Mini-Circuits_QQQ130_LandPattern_PL-236_ClockwisePinNumbering","RF_Mini-Circuits/Mini-Circuits_TT1224_ClockwisePinNumbering","RF_Mini-Circuits/Mini-Circuits_TT1224_LandPatternPL-258_ClockwisePinNumbering","RF_Mini-Circuits/Mini-Circuits_TTT167","RF_Mini-Circuits/Mini-Circuits_TTT167_LandPatternPL-079","RF_Mini-Circuits/Mini-Circuits_YY161","RF_Mini-Circuits/Mini-Circuits_YY161_LandPatternPL-049","RF_Module/Ai-Thinker-Ra-01-LoRa","RF_Module/Astrocast_AST50147-00","RF_Module/Atmel_ATSAMR21G18-MR210UA_NoRFPads","RF_Module/BLE112-A","RF_Module/BM78SPPS5xC2","RF_Module/CMWX1ZZABZ","RF_Module/CYBLE-21Pin-10x10mm","RF_Module/DWM1000","RF_Module/DecaWave_DWM1001","RF_Module/Digi_XBee_SMT","RF_Module/E18-MS1-PCB","RF_Module/E73-2G4M04S","RF_Module/ESP-01","RF_Module/ESP-07","RF_Module/ESP-12E","RF_Module/ESP-WROOM-02","RF_Module/ESP32-C3-DevKitM-1","RF_Module/ESP32-C3-WROOM-02","RF_Module/ESP32-C3-WROOM-02U","RF_Module/ESP32-C6-MINI-1","RF_Module/ESP32-S2-MINI-1","RF_Module/ESP32-S2-MINI-1U","RF_Module/ESP32-S2-WROVER","RF_Module/ESP32-S3-WROOM-1","RF_Module/ESP32-S3-WROOM-1U","RF_Module/ESP32-S3-WROOM-2","RF_Module/ESP32-WROOM-32","RF_Module/ESP32-WROOM-32D","RF_Module/ESP32-WROOM-32E","RF_Module/ESP32-WROOM-32U","RF_Module/ESP32-WROOM-32UE","RF_Module/Garmin_M8-35_9.8x14.0mm_Layout6x6_P1.5mm","RF_Module/HOPERF_RFM69HW","RF_Module/HOPERF_RFM9XW_SMD","RF_Module/HOPERF_RFM9XW_THT","RF_Module/Heltec_HT-CT62","RF_Module/IQRF_TRx2DA_KON-SIM-01","RF_Module/IQRF_TRx2D_KON-SIM-01","RF_Module/Jadak_Thingmagic_M6e-Nano","RF_Module/Laird_BL652","RF_Module/Laird_BL653","RF_Module/MCU_Seeed_ESP32C3","RF_Module/MOD-nRF8001","RF_Module/Microchip_BM83","RF_Module/Microchip_RN4871","RF_Module/Modtronix_inAir9","RF_Module/MonoWireless_TWE-L-WX","RF_Module/NINA-B111","RF_Module/Particle_P1","RF_Module/RAK3172","RF_Module/RAK4200","RF_Module/RAK811","RF_Module/RFDigital_RFD77101","RF_Module/RMC20452T","RF_Module/RN2483","RF_Module/RN42","RF_Module/RN42N","RF_Module/Raytac_MDBT42Q","RF_Module/Raytac_MDBT50Q","RF_Module/ST-SiP-LGA-86-11x7.3mm","RF_Module/ST_SPBTLE","RF_Module/TD1205","RF_Module/TD1208","RF_Module/Taiyo-Yuden_EYSGJNZWY","RF_Module/WEMOS_C3_mini","RF_Module/WEMOS_D1_mini_light","RF_Module/ZETA-433-SO_SMD","RF_Module/ZETA-433-SO_THT","RF_Module/nRF24L01_Breakout","RF_Shielding/Laird_Technologies_97-2002_25.40x25.40mm","RF_Shielding/Laird_Technologies_97-2003_12.70x13.37mm","RF_Shielding/Laird_Technologies_BMI-S-101_13.66x12.70mm","RF_Shielding/Laird_Technologies_BMI-S-102_16.50x16.50mm","RF_Shielding/Laird_Technologies_BMI-S-103_26.21x26.21mm","RF_Shielding/Laird_Technologies_BMI-S-104_32.00x32.00mm","RF_Shielding/Laird_Technologies_BMI-S-105_38.10x25.40mm","RF_Shielding/Laird_Technologies_BMI-S-106_36.83x33.68mm","RF_Shielding/Laird_Technologies_BMI-S-107_44.37x44.37mm","RF_Shielding/Laird_Technologies_BMI-S-201-F_13.66x12.70mm","RF_Shielding/Laird_Technologies_BMI-S-202-F_16.50x16.50mm","RF_Shielding/Laird_Technologies_BMI-S-203-F_26.21x26.21mm","RF_Shielding/Laird_Technologies_BMI-S-204-F_32.00x32.00mm","RF_Shielding/Laird_Technologies_BMI-S-205-F_38.10x25.40mm","RF_Shielding/Laird_Technologies_BMI-S-206-F_36.83x33.68mm","RF_Shielding/Laird_Technologies_BMI-S-207-F_44.37x44.37mm","RF_Shielding/Laird_Technologies_BMI-S-208-F_39.60x39.60mm","RF_Shielding/Laird_Technologies_BMI-S-209-F_29.36x18.50mm","RF_Shielding/Laird_Technologies_BMI-S-210-F_44.00x30.50mm","RF_Shielding/Laird_Technologies_BMI-S-230-F_50.8x38.1mm","RF_Shielding/Wuerth_36103205_20x20mm","RF_Shielding/Wuerth_36103255_25x25mm","RF_Shielding/Wuerth_36103305_30x30mm","RF_Shielding/Wuerth_36103505_50x50mm","RF_Shielding/Wuerth_36103605_60x60mm","RF_Shielding/Wuerth_36503205_20x20mm","RF_Shielding/Wuerth_36503255_25x25mm","RF_Shielding/Wuerth_36503305_30x30mm","RF_Shielding/Wuerth_36503505_50x50mm","RF_Shielding/Wuerth_36503605_60x60mm","RF_WiFi/USR-C322","Relay_SMD/Relay_2P2T_10x6mm_TE_IMxxG","Relay_SMD/Relay_DPDT_AXICOM_IMSeries_JLeg","Relay_SMD/Relay_DPDT_FRT5_SMD","Relay_SMD/Relay_DPDT_Kemet_EE2_NU","Relay_SMD/Relay_DPDT_Kemet_EE2_NUH","Relay_SMD/Relay_DPDT_Kemet_EE2_NUH_DoubleCoil","Relay_SMD/Relay_DPDT_Kemet_EE2_NUX_DoubleCoil","Relay_SMD/Relay_DPDT_Kemet_EE2_NUX_NKX","Relay_SMD/Relay_DPDT_Kemet_EE2_NU_DoubleCoil","Relay_SMD/Relay_DPDT_Omron_G6H-2F","Relay_SMD/Relay_DPDT_Omron_G6K-2F-Y","Relay_SMD/Relay_DPDT_Omron_G6K-2F","Relay_SMD/Relay_DPDT_Omron_G6K-2G-Y","Relay_SMD/Relay_DPDT_Omron_G6K-2G","Relay_SMD/Relay_DPDT_Omron_G6S-2F","Relay_SMD/Relay_DPDT_Omron_G6S-2G","Relay_SMD/Relay_DPDT_Omron_G6SK-2F","Relay_SMD/Relay_DPDT_Omron_G6SK-2G","Relay_SMD/Relay_Fujitsu_FTR-B3S","Relay_SMD/Relay_SPDT_AXICOM_HF3Series_50ohms_Pitch1.27mm","Relay_SMD/Relay_SPDT_AXICOM_HF3Series_75ohms_Pitch1.27mm","Relay_THT/Relay_1-Form-A_Schrack-RYII_RM5mm","Relay_THT/Relay_1-Form-B_Schrack-RYII_RM5mm","Relay_THT/Relay_1-Form-C_Schrack-RYII_RM3.2mm","Relay_THT/Relay_3PST_COTO_3650","Relay_THT/Relay_3PST_COTO_3660","Relay_THT/Relay_DPDT_AXICOM_IMSeries_Pitch3.2mm","Relay_THT/Relay_DPDT_AXICOM_IMSeries_Pitch5.08mm","Relay_THT/Relay_DPDT_FRT5","Relay_THT/Relay_DPDT_Finder_30.22","Relay_THT/Relay_DPDT_Finder_40.52","Relay_THT/Relay_DPDT_Finder_40.62","Relay_THT/Relay_DPDT_Fujitsu_FTR-F1C","Relay_THT/Relay_DPDT_Hongfa_HF115F-2Z-x4","Relay_THT/Relay_DPDT_Kemet_EC2_NJ","Relay_THT/Relay_DPDT_Kemet_EC2_NJ_DoubleCoil","Relay_THT/Relay_DPDT_Kemet_EC2_NU","Relay_THT/Relay_DPDT_Kemet_EC2_NU_DoubleCoil","Relay_THT/Relay_DPDT_Omron_G2RL-2","Relay_THT/Relay_DPDT_Omron_G5V-2","Relay_THT/Relay_DPDT_Omron_G6A","Relay_THT/Relay_DPDT_Omron_G6AK","Relay_THT/Relay_DPDT_Omron_G6H-2","Relay_THT/Relay_DPDT_Omron_G6K-2P-Y","Relay_THT/Relay_DPDT_Omron_G6K-2P","Relay_THT/Relay_DPDT_Omron_G6S-2","Relay_THT/Relay_DPDT_Omron_G6SK-2","Relay_THT/Relay_DPDT_Panasonic_JW2","Relay_THT/Relay_DPDT_Schrack-RT2-FormC-Dual-Coil_RM5mm","Relay_THT/Relay_DPDT_Schrack-RT2-FormC_RM5mm","Relay_THT/Relay_DPST_COTO_3602","Relay_THT/Relay_DPST_Fujitsu_FTR-F1A","Relay_THT/Relay_DPST_Omron_G2RL-2A","Relay_THT/Relay_DPST_Schrack-RT2-FormA_RM5mm","Relay_THT/Relay_NCR_HHG1D-1","Relay_THT/Relay_SPDT_CUI_SR5","Relay_THT/Relay_SPDT_Finder_32.21-x000","Relay_THT/Relay_SPDT_Finder_34.51_Horizontal","Relay_THT/Relay_SPDT_Finder_34.51_Vertical","Relay_THT/Relay_SPDT_Finder_36.11","Relay_THT/Relay_SPDT_Finder_40.11","Relay_THT/Relay_SPDT_Finder_40.31","Relay_THT/Relay_SPDT_Finder_40.41","Relay_THT/Relay_SPDT_Finder_40.51","Relay_THT/Relay_SPDT_Finder_40.61","Relay_THT/Relay_SPDT_Fujitsu_FTR-LYCA005x_FormC_Vertical","Relay_THT/Relay_SPDT_HJR-4102","Relay_THT/Relay_SPDT_Hongfa_HF3F-L-xx-1ZL1T","Relay_THT/Relay_SPDT_Hongfa_HF3F-L-xx-1ZL2T-R","Relay_THT/Relay_SPDT_Hongfa_HF3F-L-xx-1ZL2T","Relay_THT/Relay_SPDT_Hongfa_JQC-3FF_0XX-1Z","Relay_THT/Relay_SPDT_HsinDa_Y14","Relay_THT/Relay_SPDT_Omron-G5LE-1","Relay_THT/Relay_SPDT_Omron-G5Q-1","Relay_THT/Relay_SPDT_Omron_G2RL-1-E","Relay_THT/Relay_SPDT_Omron_G2RL-1","Relay_THT/Relay_SPDT_Omron_G5V-1","Relay_THT/Relay_SPDT_Omron_G6E","Relay_THT/Relay_SPDT_Omron_G6EK","Relay_THT/Relay_SPDT_Panasonic_DR-L","Relay_THT/Relay_SPDT_Panasonic_DR-L2","Relay_THT/Relay_SPDT_Panasonic_DR","Relay_THT/Relay_SPDT_Panasonic_JW1_FormC","Relay_THT/Relay_SPDT_PotterBrumfield_T9AP5D52_12V30A","Relay_THT/Relay_SPDT_RAYEX-L90","Relay_THT/Relay_SPDT_RAYEX-L90S","Relay_THT/Relay_SPDT_SANYOU_SRD_Series_Form_C","Relay_THT/Relay_SPDT_Schrack-RP-II-1-16A-FormC_RM5mm","Relay_THT/Relay_SPDT_Schrack-RP-II-1-FormC_RM3.5mm","Relay_THT/Relay_SPDT_Schrack-RP-II-1-FormC_RM5mm","Relay_THT/Relay_SPDT_Schrack-RT1-16A-FormC_RM5mm","Relay_THT/Relay_SPDT_Schrack-RT1-FormC_RM3.5mm","Relay_THT/Relay_SPDT_Schrack-RT1-FormC_RM5mm","Relay_THT/Relay_SPDT_StandexMeder_SIL_Form1C","Relay_THT/Relay_SPST-NO_Fujitsu_FTR-LYAA005x_FormA_Vertical","Relay_THT/Relay_SPST_Finder_32.21-x300","Relay_THT/Relay_SPST_Hongfa_HF3F-L-xx-1HL1T","Relay_THT/Relay_SPST_Hongfa_HF3F-L-xx-1HL2T-R","Relay_THT/Relay_SPST_Hongfa_HF3F-L-xx-1HL2T","Relay_THT/Relay_SPST_Hongfa_JQC-3FF_0XX-1H","Relay_THT/Relay_SPST_Omron-G5Q-1A","Relay_THT/Relay_SPST_Omron_G2RL-1A-E","Relay_THT/Relay_SPST_Omron_G2RL-1A","Relay_THT/Relay_SPST_Omron_G5NB","Relay_THT/Relay_SPST_Omron_G5PZ","Relay_THT/Relay_SPST_Panasonic_ADW11","Relay_THT/Relay_SPST_Panasonic_ALFG_FormA","Relay_THT/Relay_SPST_Panasonic_ALFG_FormA_CircularHoles","Relay_THT/Relay_SPST_Panasonic_JW1_FormA","Relay_THT/Relay_SPST_PotterBrumfield_T9AP1D52_12V30A","Relay_THT/Relay_SPST_RAYEX-L90A","Relay_THT/Relay_SPST_RAYEX-L90AS","Relay_THT/Relay_SPST_RAYEX-L90B","Relay_THT/Relay_SPST_RAYEX-L90BS","Relay_THT/Relay_SPST_SANYOU_SRD_Series_Form_A","Relay_THT/Relay_SPST_SANYOU_SRD_Series_Form_B","Relay_THT/Relay_SPST_Schrack-RP-II-1-16A-FormA_RM5mm","Relay_THT/Relay_SPST_Schrack-RP-II-1-FormA_RM3.5mm","Relay_THT/Relay_SPST_Schrack-RP-II-1-FormA_RM5mm","Relay_THT/Relay_SPST_Schrack-RP3SL-1coil_RM5mm","Relay_THT/Relay_SPST_Schrack-RP3SL_RM5mm","Relay_THT/Relay_SPST_Schrack-RT1-16A-FormA_RM5mm","Relay_THT/Relay_SPST_Schrack-RT1-FormA_RM3.5mm","Relay_THT/Relay_SPST_Schrack-RT1-FormA_RM5mm","Relay_THT/Relay_SPST_StandexMeder_MS_Form1AB","Relay_THT/Relay_SPST_StandexMeder_SIL_Form1A","Relay_THT/Relay_SPST_StandexMeder_SIL_Form1B","Relay_THT/Relay_SPST_TE_PCH-1xxx2M","Relay_THT/Relay_SPST_TE_PCN-1xxD3MHZ","Relay_THT/Relay_SPST_Zettler-AZSR131","Relay_THT/Relay_Socket_3PDT_Omron_PLE11-0","Relay_THT/Relay_Socket_4PDT_Omron_PY14-02","Relay_THT/Relay_Socket_DPDT_Finder_96.12","Relay_THT/Relay_Socket_DPDT_Omron_PLE08-0","Relay_THT/Relay_StandexMeder_DIP_HighProfile","Relay_THT/Relay_StandexMeder_DIP_LowProfile","Relay_THT/Relay_StandexMeder_UMS","Relay_THT/Relay_Tyco_V23072_Sealed","Resistor_SMD/R_01005_0402Metric","Resistor_SMD/R_01005_0402Metric_Pad0.57x0.30mm_HandSolder","Resistor_SMD/R_0201_0603Metric","Resistor_SMD/R_0201_0603Metric_Pad0.64x0.40mm_HandSolder","Resistor_SMD/R_0402_1005Metric","Resistor_SMD/R_0402_1005Metric_Pad0.72x0.64mm_HandSolder","Resistor_SMD/R_0508_1220Metric","Resistor_SMD/R_0508_1220Metric_Pad1.12x2.15mm_HandSolder","Resistor_SMD/R_0603_1608Metric","Resistor_SMD/R_0603_1608Metric_Pad0.98x0.95mm_HandSolder","Resistor_SMD/R_0612_1632Metric","Resistor_SMD/R_0612_1632Metric_Pad1.18x3.40mm_HandSolder","Resistor_SMD/R_0805_2012Metric","Resistor_SMD/R_0805_2012Metric_Pad1.20x1.40mm_HandSolder","Resistor_SMD/R_0815_2038Metric","Resistor_SMD/R_0815_2038Metric_Pad1.20x4.05mm_HandSolder","Resistor_SMD/R_1020_2550Metric","Resistor_SMD/R_1020_2550Metric_Pad1.33x5.20mm_HandSolder","Resistor_SMD/R_1206_3216Metric","Resistor_SMD/R_1206_3216Metric_Pad1.30x1.75mm_HandSolder","Resistor_SMD/R_1210_3225Metric","Resistor_SMD/R_1210_3225Metric_Pad1.30x2.65mm_HandSolder","Resistor_SMD/R_1218_3246Metric","Resistor_SMD/R_1218_3246Metric_Pad1.22x4.75mm_HandSolder","Resistor_SMD/R_1225_3264Metric","Resistor_SMD/R_1225_3264Metric_Pad1.47x6.45mm_HandSolder","Resistor_SMD/R_1812_4532Metric","Resistor_SMD/R_1812_4532Metric_Pad1.30x3.40mm_HandSolder","Resistor_SMD/R_2010_5025Metric","Resistor_SMD/R_2010_5025Metric_Pad1.40x2.65mm_HandSolder","Resistor_SMD/R_2512_6332Metric","Resistor_SMD/R_2512_6332Metric_Pad1.40x3.35mm_HandSolder","Resistor_SMD/R_2816_7142Metric","Resistor_SMD/R_2816_7142Metric_Pad3.20x4.45mm_HandSolder","Resistor_SMD/R_4020_10251Metric","Resistor_SMD/R_4020_10251Metric_Pad1.65x5.30mm_HandSolder","Resistor_SMD/R_Array_Concave_2x0603","Resistor_SMD/R_Array_Concave_4x0402","Resistor_SMD/R_Array_Concave_4x0603","Resistor_SMD/R_Array_Convex_2x0402","Resistor_SMD/R_Array_Convex_2x0603","Resistor_SMD/R_Array_Convex_2x0606","Resistor_SMD/R_Array_Convex_2x1206","Resistor_SMD/R_Array_Convex_4x0402","Resistor_SMD/R_Array_Convex_4x0603","Resistor_SMD/R_Array_Convex_4x0612","Resistor_SMD/R_Array_Convex_4x1206","Resistor_SMD/R_Array_Convex_5x0603","Resistor_SMD/R_Array_Convex_5x1206","Resistor_SMD/R_Array_Convex_8x0602","Resistor_SMD/R_Cat16-2","Resistor_SMD/R_Cat16-4","Resistor_SMD/R_Cat16-8","Resistor_SMD/R_MELF_MMB-0207","Resistor_SMD/R_MicroMELF_MMU-0102","Resistor_SMD/R_MiniMELF_MMA-0204","Resistor_SMD/R_Shunt_Isabellenhuette_BVR4026","Resistor_SMD/R_Shunt_Ohmite_LVK12","Resistor_SMD/R_Shunt_Ohmite_LVK20","Resistor_SMD/R_Shunt_Ohmite_LVK24","Resistor_SMD/R_Shunt_Ohmite_LVK25","Resistor_SMD/R_Shunt_Vishay_WSK2512_6332Metric_T1.19mm","Resistor_SMD/R_Shunt_Vishay_WSK2512_6332Metric_T2.21mm","Resistor_SMD/R_Shunt_Vishay_WSK2512_6332Metric_T2.66mm","Resistor_SMD/R_Shunt_Vishay_WSKW0612","Resistor_SMD/R_Shunt_Vishay_WSR2_WSR3","Resistor_SMD/R_Shunt_Vishay_WSR2_WSR3_KelvinConnection","Resistor_THT/R_Array_SIP10","Resistor_THT/R_Array_SIP11","Resistor_THT/R_Array_SIP12","Resistor_THT/R_Array_SIP13","Resistor_THT/R_Array_SIP14","Resistor_THT/R_Array_SIP4","Resistor_THT/R_Array_SIP5","Resistor_THT/R_Array_SIP6","Resistor_THT/R_Array_SIP7","Resistor_THT/R_Array_SIP8","Resistor_THT/R_Array_SIP9","Resistor_THT/R_Axial_DIN0204_L3.6mm_D1.6mm_P1.90mm_Vertical","Resistor_THT/R_Axial_DIN0204_L3.6mm_D1.6mm_P2.54mm_Vertical","Resistor_THT/R_Axial_DIN0204_L3.6mm_D1.6mm_P5.08mm_Horizontal","Resistor_THT/R_Axial_DIN0204_L3.6mm_D1.6mm_P5.08mm_Vertical","Resistor_THT/R_Axial_DIN0204_L3.6mm_D1.6mm_P7.62mm_Horizontal","Resistor_THT/R_Axial_DIN0207_L6.3mm_D2.5mm_P10.16mm_Horizontal","Resistor_THT/R_Axial_DIN0207_L6.3mm_D2.5mm_P15.24mm_Horizontal","Resistor_THT/R_Axial_DIN0207_L6.3mm_D2.5mm_P2.54mm_Vertical","Resistor_THT/R_Axial_DIN0207_L6.3mm_D2.5mm_P5.08mm_Vertical","Resistor_THT/R_Axial_DIN0207_L6.3mm_D2.5mm_P7.62mm_Horizontal","Resistor_THT/R_Axial_DIN0309_L9.0mm_D3.2mm_P12.70mm_Horizontal","Resistor_THT/R_Axial_DIN0309_L9.0mm_D3.2mm_P15.24mm_Horizontal","Resistor_THT/R_Axial_DIN0309_L9.0mm_D3.2mm_P2.54mm_Vertical","Resistor_THT/R_Axial_DIN0309_L9.0mm_D3.2mm_P20.32mm_Horizontal","Resistor_THT/R_Axial_DIN0309_L9.0mm_D3.2mm_P25.40mm_Horizontal","Resistor_THT/R_Axial_DIN0309_L9.0mm_D3.2mm_P5.08mm_Vertical","Resistor_THT/R_Axial_DIN0411_L9.9mm_D3.6mm_P12.70mm_Horizontal","Resistor_THT/R_Axial_DIN0411_L9.9mm_D3.6mm_P15.24mm_Horizontal","Resistor_THT/R_Axial_DIN0411_L9.9mm_D3.6mm_P20.32mm_Horizontal","Resistor_THT/R_Axial_DIN0411_L9.9mm_D3.6mm_P25.40mm_Horizontal","Resistor_THT/R_Axial_DIN0411_L9.9mm_D3.6mm_P5.08mm_Vertical","Resistor_THT/R_Axial_DIN0411_L9.9mm_D3.6mm_P7.62mm_Vertical","Resistor_THT/R_Axial_DIN0414_L11.9mm_D4.5mm_P15.24mm_Horizontal","Resistor_THT/R_Axial_DIN0414_L11.9mm_D4.5mm_P20.32mm_Horizontal","Resistor_THT/R_Axial_DIN0414_L11.9mm_D4.5mm_P25.40mm_Horizontal","Resistor_THT/R_Axial_DIN0414_L11.9mm_D4.5mm_P5.08mm_Vertical","Resistor_THT/R_Axial_DIN0414_L11.9mm_D4.5mm_P7.62mm_Vertical","Resistor_THT/R_Axial_DIN0516_L15.5mm_D5.0mm_P20.32mm_Horizontal","Resistor_THT/R_Axial_DIN0516_L15.5mm_D5.0mm_P25.40mm_Horizontal","Resistor_THT/R_Axial_DIN0516_L15.5mm_D5.0mm_P30.48mm_Horizontal","Resistor_THT/R_Axial_DIN0516_L15.5mm_D5.0mm_P5.08mm_Vertical","Resistor_THT/R_Axial_DIN0516_L15.5mm_D5.0mm_P7.62mm_Vertical","Resistor_THT/R_Axial_DIN0614_L14.3mm_D5.7mm_P15.24mm_Horizontal","Resistor_THT/R_Axial_DIN0614_L14.3mm_D5.7mm_P20.32mm_Horizontal","Resistor_THT/R_Axial_DIN0614_L14.3mm_D5.7mm_P25.40mm_Horizontal","Resistor_THT/R_Axial_DIN0614_L14.3mm_D5.7mm_P5.08mm_Vertical","Resistor_THT/R_Axial_DIN0614_L14.3mm_D5.7mm_P7.62mm_Vertical","Resistor_THT/R_Axial_DIN0617_L17.0mm_D6.0mm_P20.32mm_Horizontal","Resistor_THT/R_Axial_DIN0617_L17.0mm_D6.0mm_P25.40mm_Horizontal","Resistor_THT/R_Axial_DIN0617_L17.0mm_D6.0mm_P30.48mm_Horizontal","Resistor_THT/R_Axial_DIN0617_L17.0mm_D6.0mm_P5.08mm_Vertical","Resistor_THT/R_Axial_DIN0617_L17.0mm_D6.0mm_P7.62mm_Vertical","Resistor_THT/R_Axial_DIN0918_L18.0mm_D9.0mm_P22.86mm_Horizontal","Resistor_THT/R_Axial_DIN0918_L18.0mm_D9.0mm_P25.40mm_Horizontal","Resistor_THT/R_Axial_DIN0918_L18.0mm_D9.0mm_P30.48mm_Horizontal","Resistor_THT/R_Axial_DIN0918_L18.0mm_D9.0mm_P7.62mm_Vertical","Resistor_THT/R_Axial_DIN0922_L20.0mm_D9.0mm_P25.40mm_Horizontal","Resistor_THT/R_Axial_DIN0922_L20.0mm_D9.0mm_P30.48mm_Horizontal","Resistor_THT/R_Axial_DIN0922_L20.0mm_D9.0mm_P7.62mm_Vertical","Resistor_THT/R_Axial_Power_L20.0mm_W6.4mm_P22.40mm","Resistor_THT/R_Axial_Power_L20.0mm_W6.4mm_P25.40mm","Resistor_THT/R_Axial_Power_L20.0mm_W6.4mm_P30.48mm","Resistor_THT/R_Axial_Power_L20.0mm_W6.4mm_P5.08mm_Vertical","Resistor_THT/R_Axial_Power_L20.0mm_W6.4mm_P7.62mm_Vertical","Resistor_THT/R_Axial_Power_L25.0mm_W6.4mm_P27.94mm","Resistor_THT/R_Axial_Power_L25.0mm_W6.4mm_P30.48mm","Resistor_THT/R_Axial_Power_L25.0mm_W9.0mm_P10.16mm_Vertical","Resistor_THT/R_Axial_Power_L25.0mm_W9.0mm_P27.94mm","Resistor_THT/R_Axial_Power_L25.0mm_W9.0mm_P30.48mm","Resistor_THT/R_Axial_Power_L25.0mm_W9.0mm_P7.62mm_Vertical","Resistor_THT/R_Axial_Power_L38.0mm_W6.4mm_P40.64mm","Resistor_THT/R_Axial_Power_L38.0mm_W6.4mm_P45.72mm","Resistor_THT/R_Axial_Power_L38.0mm_W9.0mm_P40.64mm","Resistor_THT/R_Axial_Power_L38.0mm_W9.0mm_P45.72mm","Resistor_THT/R_Axial_Power_L48.0mm_W12.5mm_P10.16mm_Vertical","Resistor_THT/R_Axial_Power_L48.0mm_W12.5mm_P55.88mm","Resistor_THT/R_Axial_Power_L48.0mm_W12.5mm_P60.96mm","Resistor_THT/R_Axial_Power_L48.0mm_W12.5mm_P7.62mm_Vertical","Resistor_THT/R_Axial_Power_L50.0mm_W9.0mm_P55.88mm","Resistor_THT/R_Axial_Power_L50.0mm_W9.0mm_P60.96mm","Resistor_THT/R_Axial_Power_L60.0mm_W14.0mm_P10.16mm_Vertical","Resistor_THT/R_Axial_Power_L60.0mm_W14.0mm_P66.04mm","Resistor_THT/R_Axial_Power_L60.0mm_W14.0mm_P71.12mm","Resistor_THT/R_Axial_Power_L75.0mm_W9.0mm_P81.28mm","Resistor_THT/R_Axial_Power_L75.0mm_W9.0mm_P86.36mm","Resistor_THT/R_Axial_Shunt_L22.2mm_W8.0mm_PS14.30mm_P25.40mm","Resistor_THT/R_Axial_Shunt_L22.2mm_W9.5mm_PS14.30mm_P25.40mm","Resistor_THT/R_Axial_Shunt_L35.3mm_W9.5mm_PS25.40mm_P38.10mm","Resistor_THT/R_Axial_Shunt_L47.6mm_W12.7mm_PS34.93mm_P50.80mm","Resistor_THT/R_Axial_Shunt_L47.6mm_W9.5mm_PS34.93mm_P50.80mm","Resistor_THT/R_Bare_Metal_Element_L12.4mm_W4.8mm_P11.40mm","Resistor_THT/R_Bare_Metal_Element_L16.3mm_W4.8mm_P15.30mm","Resistor_THT/R_Bare_Metal_Element_L21.3mm_W4.8mm_P20.30mm","Resistor_THT/R_Box_L13.0mm_W4.0mm_P9.00mm","Resistor_THT/R_Box_L14.0mm_W5.0mm_P9.00mm","Resistor_THT/R_Box_L26.0mm_W5.0mm_P20.00mm","Resistor_THT/R_Box_L8.4mm_W2.5mm_P5.08mm","Resistor_THT/R_Radial_Power_L11.0mm_W7.0mm_P5.00mm","Resistor_THT/R_Radial_Power_L12.0mm_W8.0mm_P5.00mm","Resistor_THT/R_Radial_Power_L13.0mm_W9.0mm_P5.00mm","Resistor_THT/R_Radial_Power_L16.1mm_W9.0mm_P7.37mm","Resistor_THT/R_Radial_Power_L7.0mm_W8.0mm_Px2.40mm_Py2.30mm","Resistor_THT/R_Radial_Power_L9.0mm_W10.0mm_Px2.70mm_Py2.30mm","Rotary_Encoder/RotaryEncoder_Alps_EC11E-Switch_Vertical_H20mm","Rotary_Encoder/RotaryEncoder_Alps_EC11E-Switch_Vertical_H20mm_CircularMountingHoles","Rotary_Encoder/RotaryEncoder_Alps_EC11E-Switch_Vertical_H20mm_MountingHoles","Rotary_Encoder/RotaryEncoder_Alps_EC11E_Vertical_H20mm","Rotary_Encoder/RotaryEncoder_Alps_EC11E_Vertical_H20mm_CircularMountingHoles","Rotary_Encoder/RotaryEncoder_Alps_EC12E-Switch_Vertical_H20mm","Rotary_Encoder/RotaryEncoder_Alps_EC12E-Switch_Vertical_H20mm_CircularMountingHoles","Rotary_Encoder/RotaryEncoder_Alps_EC12E_Vertical_H20mm","Rotary_Encoder/RotaryEncoder_Alps_EC12E_Vertical_H20mm_CircularMountingHoles","Rotary_Encoder/RotaryEncoder_Bourns_Horizontal_PEC09-2xxxF-Nxxxx","Rotary_Encoder/RotaryEncoder_Bourns_Horizontal_PEC09-2xxxF-Sxxxx","Rotary_Encoder/RotaryEncoder_Bourns_Horizontal_PEC12R-2x17F-Nxxxx","Rotary_Encoder/RotaryEncoder_Bourns_Horizontal_PEC12R-2x17F-Sxxxx","Rotary_Encoder/RotaryEncoder_Bourns_Horizontal_PEL12D-2x16F-Sxxxx","Rotary_Encoder/RotaryEncoder_Bourns_Horizontal_PEL12D-2x18F-Sxxxx","Rotary_Encoder/RotaryEncoder_Bourns_Horizontal_PEL12D-2x21F-Sxxxx","Rotary_Encoder/RotaryEncoder_Bourns_Horizontal_PEL12D-2x25S-Sxxxx","Rotary_Encoder/RotaryEncoder_Bourns_Horizontal_PEL12D-2x26F-Sxxxx","Rotary_Encoder/RotaryEncoder_Bourns_Horizontal_PEL12D-2x31F-Sxxxx","Rotary_Encoder/RotaryEncoder_Bourns_Vertical_PEC12R-3x17F-Nxxxx","Rotary_Encoder/RotaryEncoder_Bourns_Vertical_PEC12R-3x17F-Sxxxx","Rotary_Encoder/RotaryEncoder_Bourns_Vertical_PEL12D-4x25S-Sxxxx","Rotary_Encoder/RotaryEncoder_Bourns_Vertical_PEL12D-4xxxF-Sxxxx","Sensor/ASAIR_AM2302_P2.54mm_Lead2.75mm_TabDown","Sensor/ASAIR_AM2302_P2.54mm_Vertical","Sensor/Aosong_DHT11_5.5x12.0_P2.54mm","Sensor/Avago_APDS-9960","Sensor/LuminOX_LOX-O2","Sensor/MQ-6","Sensor/Rohm_RPR-0521RS","Sensor/SHT1x","Sensor/SPEC_110-xxx_SMD-10Pin_20x20mm_P4.0mm","Sensor/Senseair_S8_Down","Sensor/Senseair_S8_Up","Sensor/Sensirion_SCD4x-1EP_10.1x10.1mm_P1.25mm_EP4.8x4.8mm","Sensor/Sensortech_MiCS_5x7mm_P1.25mm","Sensor/TGS-5141","Sensor/Winson_GM-402B_5x5mm_P1.27mm","Sensor_Audio/CUI_CMC-4013-SMT","Sensor_Audio/Infineon_PG-LLGA-5-1","Sensor_Audio/Infineon_PG-LLGA-5-2","Sensor_Audio/InvenSense_ICS-43434-6_3.5x2.65mm","Sensor_Audio/Knowles_LGA-5_3.5x2.65mm","Sensor_Audio/Knowles_LGA-6_4.72x3.76mm","Sensor_Audio/Knowles_SPH0645LM4H-6_3.5x2.65mm","Sensor_Audio/POM-2244P-C3310-2-R","Sensor_Audio/ST_HLGA-6_3.76x4.72mm_P1.65mm","Sensor_Current/AKM_CQ_7","Sensor_Current/AKM_CQ_7S","Sensor_Current/AKM_CQ_VSOP-24_5.6x7.9mm_P0.65mm","Sensor_Current/AKM_CZ_SSOP-10_6.5x8.1mm_P0.95mm","Sensor_Current/Allegro_CB_PFF","Sensor_Current/Allegro_CB_PSF","Sensor_Current/Allegro_CB_PSS","Sensor_Current/Allegro_PSOF-7_4.8x6.4mm_P1.60mm","Sensor_Current/Allegro_QFN-12-10-1EP_3x3mm_P0.5mm","Sensor_Current/Allegro_QSOP-24_3.9x8.7mm_P0.635mm","Sensor_Current/Allegro_SIP-4","Sensor_Current/Diodes_SIP-3_4.1x1.5mm_P1.27mm","Sensor_Current/Diodes_SIP-3_4.1x1.5mm_P2.65mm","Sensor_Current/Honeywell_CSLW","Sensor_Current/LEM_CKSR","Sensor_Current/LEM_HO40-NP","Sensor_Current/LEM_HO8-NP","Sensor_Current/LEM_HO8-NSM","Sensor_Current/LEM_HTFS","Sensor_Current/LEM_HX02-P","Sensor_Current/LEM_HX03-P-SP2","Sensor_Current/LEM_HX04-P","Sensor_Current/LEM_HX05-NP","Sensor_Current/LEM_HX05-P-SP2","Sensor_Current/LEM_HX06-P","Sensor_Current/LEM_HX10-NP","Sensor_Current/LEM_HX10-P-SP2","Sensor_Current/LEM_HX15-NP","Sensor_Current/LEM_HX15-P-SP2","Sensor_Current/LEM_HX20-P-SP2","Sensor_Current/LEM_HX25-P-SP2","Sensor_Current/LEM_HX50-P-SP2","Sensor_Current/LEM_LA25-NP","Sensor_Current/LEM_LA25-P","Sensor_Current/LEM_LTSR-NP","Sensor_Distance/AMS_OLGA12","Sensor_Distance/ST_VL53L1x","Sensor_Humidity/Sensirion_DFN-4-1EP_2x2mm_P1mm_EP0.7x1.6mm","Sensor_Humidity/Sensirion_DFN-4_1.5x1.5mm_P0.8mm_SHT4x_NoCentralPad","Sensor_Humidity/Sensirion_DFN-8-1EP_2.5x2.5mm_P0.5mm_EP1.1x1.7mm","Sensor_Humidity/Texas_S-PWSON-N6-HDC2080","Sensor_Motion/Analog_LGA-16_3.25x3mm_P0.5mm_LayoutBorder3x5y","Sensor_Motion/InvenSense_QFN-24_3x3mm_P0.4mm","Sensor_Motion/InvenSense_QFN-24_3x3mm_P0.4mm_NoMask","Sensor_Motion/InvenSense_QFN-24_4x4mm_P0.5mm","Sensor_Motion/InvenSense_QFN-24_4x4mm_P0.5mm_NoMask","Sensor_Pressure/CFSensor_XGZP6859D_7x7mm","Sensor_Pressure/CFSensor_XGZP6897x","Sensor_Pressure/CFSensor_XGZP6899x","Sensor_Pressure/Freescale_98ARH99066A","Sensor_Pressure/Freescale_98ARH99089A","Sensor_Pressure/Honeywell_40PCxxxG1A","Sensor_Pressure/Honeywell_ABPDAN","Sensor_Pressure/TE_MS5525DSO-DBxxxyS","Sensor_Pressure/TE_MS5837-xxBA","Sensor_Voltage/LEM_LV25-P","Socket/3M_Textool_240-1288-00-0602J_2x20_P2.54mm","Socket/DIP_Socket-14_W4.3mm_W5.08mm_W7.62mm_W10.16mm_W10.9mm_3M_214-3339-00-0602J","Socket/DIP_Socket-16_W4.3mm_W5.08mm_W7.62mm_W10.16mm_W10.9mm_3M_216-3340-00-0602J","Socket/DIP_Socket-18_W4.3mm_W5.08mm_W7.62mm_W10.16mm_W10.9mm_3M_218-3341-00-0602J","Socket/DIP_Socket-20_W4.3mm_W5.08mm_W7.62mm_W10.16mm_W10.9mm_3M_220-3342-00-0602J","Socket/DIP_Socket-22_W6.9mm_W7.62mm_W10.16mm_W12.7mm_W13.5mm_3M_222-3343-00-0602J","Socket/DIP_Socket-24_W11.9mm_W12.7mm_W15.24mm_W17.78mm_W18.5mm_3M_224-1275-00-0602J","Socket/DIP_Socket-24_W4.3mm_W5.08mm_W7.62mm_W10.16mm_W10.9mm_3M_224-5248-00-0602J","Socket/DIP_Socket-28_W11.9mm_W12.7mm_W15.24mm_W17.78mm_W18.5mm_3M_228-1277-00-0602J","Socket/DIP_Socket-28_W6.9mm_W7.62mm_W10.16mm_W12.7mm_W13.5mm_3M_228-4817-00-0602J","Socket/DIP_Socket-32_W11.9mm_W12.7mm_W15.24mm_W17.78mm_W18.5mm_3M_232-1285-00-0602J","Socket/DIP_Socket-40_W11.9mm_W12.7mm_W15.24mm_W17.78mm_W18.5mm_3M_240-1280-00-0602J","Socket/DIP_Socket-40_W22.1mm_W22.86mm_W25.4mm_W27.94mm_W28.7mm_3M_240-3639-00-0602J","Socket/DIP_Socket-42_W11.9mm_W12.7mm_W15.24mm_W17.78mm_W18.5mm_3M_242-1281-00-0602J","Socket/Wells_648-0482211SA01","Symbol/CE-Logo_11.2x8mm_SilkScreen","Symbol/CE-Logo_16.8x12mm_SilkScreen","Symbol/CE-Logo_28x20mm_SilkScreen","Symbol/CE-Logo_42x30mm_SilkScreen","Symbol/CE-Logo_56.1x40mm_SilkScreen","Symbol/CE-Logo_8.5x6mm_SilkScreen","Symbol/ESD-Logo_13.2x12mm_SilkScreen","Symbol/ESD-Logo_22x20mm_SilkScreen","Symbol/ESD-Logo_33x30mm_SilkScreen","Symbol/ESD-Logo_44.1x40mm_SilkScreen","Symbol/ESD-Logo_6.6x6mm_SilkScreen","Symbol/ESD-Logo_8.9x8mm_SilkScreen","Symbol/EasterEgg_EWG1308-2013_ClassA","Symbol/FCC-Logo_14.6x12mm_SilkScreen","Symbol/FCC-Logo_24.2x20mm_SilkScreen","Symbol/FCC-Logo_36.3x30mm_SilkScreen","Symbol/FCC-Logo_48.3x40mm_SilkScreen","Symbol/FCC-Logo_7.3x6mm_SilkScreen","Symbol/FCC-Logo_9.6x8mm_SilkScreen","Symbol/KiCad-Logo2_12mm_Copper","Symbol/KiCad-Logo2_12mm_SilkScreen","Symbol/KiCad-Logo2_20mm_Copper","Symbol/KiCad-Logo2_20mm_SilkScreen","Symbol/KiCad-Logo2_30mm_Copper","Symbol/KiCad-Logo2_30mm_SilkScreen","Symbol/KiCad-Logo2_40mm_Copper","Symbol/KiCad-Logo2_40mm_SilkScreen","Symbol/KiCad-Logo2_5mm_Copper","Symbol/KiCad-Logo2_5mm_SilkScreen","Symbol/KiCad-Logo2_6mm_Copper","Symbol/KiCad-Logo2_6mm_SilkScreen","Symbol/KiCad-Logo2_8mm_Copper","Symbol/KiCad-Logo2_8mm_SilkScreen","Symbol/KiCad-Logo_12mm_Copper","Symbol/KiCad-Logo_12mm_SilkScreen","Symbol/KiCad-Logo_20mm_Copper","Symbol/KiCad-Logo_20mm_SilkScreen","Symbol/KiCad-Logo_30mm_Copper","Symbol/KiCad-Logo_30mm_SilkScreen","Symbol/KiCad-Logo_40mm_Copper","Symbol/KiCad-Logo_40mm_SilkScreen","Symbol/KiCad-Logo_5mm_Copper","Symbol/KiCad-Logo_5mm_SilkScreen","Symbol/KiCad-Logo_6mm_Copper","Symbol/KiCad-Logo_6mm_SilkScreen","Symbol/KiCad-Logo_8mm_Copper","Symbol/KiCad-Logo_8mm_SilkScreen","Symbol/LayerMarker_10_14x2.54mm_TextH1mm_P1.27mm_AlNum","Symbol/LayerMarker_10_14x2.54mm_TextH1mm_P1.27mm_AlNum_BottomMirrored","Symbol/LayerMarker_10_14x2.54mm_TextH1mm_P1.27mm_AlNum_LowerMirrored","Symbol/LayerMarker_10_14x2.54mm_TextH1mm_P1.27mm_Named","Symbol/LayerMarker_10_14x2.54mm_TextH1mm_P1.27mm_Named_BottomMirrored","Symbol/LayerMarker_10_14x2.54mm_TextH1mm_P1.27mm_Named_LowerMirrored","Symbol/LayerMarker_12_16.5x2.54mm_TextH1mm_P1.27mm_AlNum","Symbol/LayerMarker_12_16.5x2.54mm_TextH1mm_P1.27mm_AlNum_BottomMirrored","Symbol/LayerMarker_12_16.5x2.54mm_TextH1mm_P1.27mm_AlNum_LowerMirrored","Symbol/LayerMarker_14_19.1x2.54mm_TextH1mm_P1.27mm_AlNum","Symbol/LayerMarker_14_19.1x2.54mm_TextH1mm_P1.27mm_AlNum_BottomMirrored","Symbol/LayerMarker_14_19.1x2.54mm_TextH1mm_P1.27mm_AlNum_LowerMirrored","Symbol/LayerMarker_16_21.6x2.54mm_TextH1mm_P1.27mm_AlNum","Symbol/LayerMarker_16_21.6x2.54mm_TextH1mm_P1.27mm_AlNum_BottomMirrored","Symbol/LayerMarker_16_21.6x2.54mm_TextH1mm_P1.27mm_AlNum_LowerMirrored","Symbol/LayerMarker_18_24.1x2.54mm_TextH1mm_P1.27mm_AlNum","Symbol/LayerMarker_18_24.1x2.54mm_TextH1mm_P1.27mm_AlNum_BottomMirrored","Symbol/LayerMarker_18_24.1x2.54mm_TextH1mm_P1.27mm_AlNum_LowerMirrored","Symbol/LayerMarker_20_26.7x2.54mm_TextH1mm_P1.27mm_AlNum","Symbol/LayerMarker_20_26.7x2.54mm_TextH1mm_P1.27mm_AlNum_BottomMirrored","Symbol/LayerMarker_20_26.7x2.54mm_TextH1mm_P1.27mm_AlNum_LowerMirrored","Symbol/LayerMarker_22_29.2x2.54mm_TextH1mm_P1.27mm_AlNum","Symbol/LayerMarker_22_29.2x2.54mm_TextH1mm_P1.27mm_AlNum_BottomMirrored","Symbol/LayerMarker_22_29.2x2.54mm_TextH1mm_P1.27mm_AlNum_LowerMirrored","Symbol/LayerMarker_24_31.8x2.54mm_TextH1mm_P1.27mm_AlNum","Symbol/LayerMarker_24_31.8x2.54mm_TextH1mm_P1.27mm_AlNum_BottomMirrored","Symbol/LayerMarker_24_31.8x2.54mm_TextH1mm_P1.27mm_AlNum_LowerMirrored","Symbol/LayerMarker_26_34.3x2.54mm_TextH1mm_P1.27mm_AlNum","Symbol/LayerMarker_26_34.3x2.54mm_TextH1mm_P1.27mm_AlNum_BottomMirrored","Symbol/LayerMarker_26_34.3x2.54mm_TextH1mm_P1.27mm_AlNum_LowerMirrored","Symbol/LayerMarker_28_36.8x2.54mm_TextH1mm_P1.27mm_AlNum","Symbol/LayerMarker_28_36.8x2.54mm_TextH1mm_P1.27mm_AlNum_BottomMirrored","Symbol/LayerMarker_28_36.8x2.54mm_TextH1mm_P1.27mm_AlNum_LowerMirrored","Symbol/LayerMarker_2_3.81x2.54mm_TextH1mm_P1.27mm","Symbol/LayerMarker_2_3.81x2.54mm_TextH1mm_P1.27mm_BottomMirrored","Symbol/LayerMarker_2_3.81x2.54mm_TextH1mm_P1.27mm_Named","Symbol/LayerMarker_2_3.81x2.54mm_TextH1mm_P1.27mm_Named_BottomMirrored","Symbol/LayerMarker_30_39.4x2.54mm_TextH1mm_P1.27mm_AlNum","Symbol/LayerMarker_30_39.4x2.54mm_TextH1mm_P1.27mm_AlNum_BottomMirrored","Symbol/LayerMarker_30_39.4x2.54mm_TextH1mm_P1.27mm_AlNum_LowerMirrored","Symbol/LayerMarker_32_41.9x2.54mm_TextH1mm_P1.27mm_AlNum","Symbol/LayerMarker_32_41.9x2.54mm_TextH1mm_P1.27mm_AlNum_BottomMirrored","Symbol/LayerMarker_32_41.9x2.54mm_TextH1mm_P1.27mm_AlNum_LowerMirrored","Symbol/LayerMarker_4_6.35x2.54mm_TextH1mm_P1.27mm","Symbol/LayerMarker_4_6.35x2.54mm_TextH1mm_P1.27mm_BottomMirrored","Symbol/LayerMarker_4_6.35x2.54mm_TextH1mm_P1.27mm_LowerMirrored","Symbol/LayerMarker_4_6.35x2.54mm_TextH1mm_P1.27mm_Named","Symbol/LayerMarker_4_6.35x2.54mm_TextH1mm_P1.27mm_Named_BottomMirrored","Symbol/LayerMarker_4_6.35x2.54mm_TextH1mm_P1.27mm_Named_LowerMirrored","Symbol/LayerMarker_6_8.89x2.54mm_TextH1mm_P1.27mm","Symbol/LayerMarker_6_8.89x2.54mm_TextH1mm_P1.27mm_BottomMirrored","Symbol/LayerMarker_6_8.89x2.54mm_TextH1mm_P1.27mm_LowerMirrored","Symbol/LayerMarker_6_8.89x2.54mm_TextH1mm_P1.27mm_Named","Symbol/LayerMarker_6_8.89x2.54mm_TextH1mm_P1.27mm_Named_BottomMirrored","Symbol/LayerMarker_6_8.89x2.54mm_TextH1mm_P1.27mm_Named_LowerMirrored","Symbol/LayerMarker_8_11.4x2.54mm_TextH1mm_P1.27mm","Symbol/LayerMarker_8_11.4x2.54mm_TextH1mm_P1.27mm_BottomMirrored","Symbol/LayerMarker_8_11.4x2.54mm_TextH1mm_P1.27mm_LowerMirrored","Symbol/LayerMarker_8_11.4x2.54mm_TextH1mm_P1.27mm_Named","Symbol/LayerMarker_8_11.4x2.54mm_TextH1mm_P1.27mm_Named_BottomMirrored","Symbol/LayerMarker_8_11.4x2.54mm_TextH1mm_P1.27mm_Named_LowerMirrored","Symbol/OSHW-Logo2_14.6x12mm_Copper","Symbol/OSHW-Logo2_14.6x12mm_SilkScreen","Symbol/OSHW-Logo2_24.3x20mm_Copper","Symbol/OSHW-Logo2_24.3x20mm_SilkScreen","Symbol/OSHW-Logo2_36.5x30mm_Copper","Symbol/OSHW-Logo2_36.5x30mm_SilkScreen","Symbol/OSHW-Logo2_48.7x40mm_Copper","Symbol/OSHW-Logo2_48.7x40mm_SilkScreen","Symbol/OSHW-Logo2_7.3x6mm_Copper","Symbol/OSHW-Logo2_7.3x6mm_SilkScreen","Symbol/OSHW-Logo2_9.8x8mm_Copper","Symbol/OSHW-Logo2_9.8x8mm_SilkScreen","Symbol/OSHW-Logo_11.4x12mm_Copper","Symbol/OSHW-Logo_11.4x12mm_SilkScreen","Symbol/OSHW-Logo_19x20mm_Copper","Symbol/OSHW-Logo_19x20mm_SilkScreen","Symbol/OSHW-Logo_28.5x30mm_Copper","Symbol/OSHW-Logo_28.5x30mm_SilkScreen","Symbol/OSHW-Logo_38.1x40mm_Copper","Symbol/OSHW-Logo_38.1x40mm_SilkScreen","Symbol/OSHW-Logo_5.7x6mm_Copper","Symbol/OSHW-Logo_5.7x6mm_SilkScreen","Symbol/OSHW-Logo_7.5x8mm_Copper","Symbol/OSHW-Logo_7.5x8mm_SilkScreen","Symbol/OSHW-Symbol_13.4x12mm_Copper","Symbol/OSHW-Symbol_13.4x12mm_SilkScreen","Symbol/OSHW-Symbol_22.3x20mm_Copper","Symbol/OSHW-Symbol_22.3x20mm_SilkScreen","Symbol/OSHW-Symbol_33.5x30mm_Copper","Symbol/OSHW-Symbol_33.5x30mm_SilkScreen","Symbol/OSHW-Symbol_44.5x40mm_Copper","Symbol/OSHW-Symbol_44.5x40mm_SilkScreen","Symbol/OSHW-Symbol_6.7x6mm_Copper","Symbol/OSHW-Symbol_6.7x6mm_SilkScreen","Symbol/OSHW-Symbol_8.9x8mm_Copper","Symbol/OSHW-Symbol_8.9x8mm_SilkScreen","Symbol/Polarity_Center_Negative_12mm_SilkScreen","Symbol/Polarity_Center_Negative_20mm_SilkScreen","Symbol/Polarity_Center_Negative_30mm_SilkScreen","Symbol/Polarity_Center_Negative_40mm_SilkScreen","Symbol/Polarity_Center_Negative_6mm_SilkScreen","Symbol/Polarity_Center_Negative_8mm_SilkScreen","Symbol/Polarity_Center_Positive_12mm_SilkScreen","Symbol/Polarity_Center_Positive_20mm_SilkScreen","Symbol/Polarity_Center_Positive_30mm_SilkScreen","Symbol/Polarity_Center_Positive_40mm_SilkScreen","Symbol/Polarity_Center_Positive_6mm_SilkScreen","Symbol/Polarity_Center_Positive_8mm_SilkScreen","Symbol/RoHS-Logo_12mm_SilkScreen","Symbol/RoHS-Logo_20mm_SilkScreen","Symbol/RoHS-Logo_30mm_SilkScreen","Symbol/RoHS-Logo_40mm_SilkScreen","Symbol/RoHS-Logo_6mm_SilkScreen","Symbol/RoHS-Logo_8mm_SilkScreen","Symbol/Screw_Generic_2.0x3.0mm_SilkScreen","Symbol/Smolhaj_Scale_0.1","Symbol/Symbol_Attention_Triangle_17x15mm_Copper","Symbol/Symbol_Attention_Triangle_8x7mm_Copper","Symbol/Symbol_Barrel_Polarity","Symbol/Symbol_CC-Attribution_CopperTop_Big","Symbol/Symbol_CC-Attribution_CopperTop_Small","Symbol/Symbol_CC-Noncommercial_CopperTop_Big","Symbol/Symbol_CC-Noncommercial_CopperTop_Small","Symbol/Symbol_CC-PublicDomain_CopperTop_Big","Symbol/Symbol_CC-PublicDomain_CopperTop_Small","Symbol/Symbol_CC-PublicDomain_SilkScreenTop_Big","Symbol/Symbol_CC-ShareAlike_CopperTop_Big","Symbol/Symbol_CC-ShareAlike_CopperTop_Small","Symbol/Symbol_CreativeCommonsPublicDomain_CopperTop_Small","Symbol/Symbol_CreativeCommonsPublicDomain_SilkScreenTop_Small","Symbol/Symbol_CreativeCommons_CopperTop_Type1_Big","Symbol/Symbol_CreativeCommons_CopperTop_Type2_Big","Symbol/Symbol_CreativeCommons_CopperTop_Type2_Small","Symbol/Symbol_CreativeCommons_SilkScreenTop_Type2_Big","Symbol/Symbol_Danger_18x16mm_Copper","Symbol/Symbol_Danger_8x8mm_Copper","Symbol/Symbol_ESD-Logo-Text_CopperTop","Symbol/Symbol_ESD-Logo_CopperTop","Symbol/Symbol_GNU-GPL_CopperTop_Big","Symbol/Symbol_GNU-GPL_CopperTop_Small","Symbol/Symbol_GNU-Logo_CopperTop","Symbol/Symbol_GNU-Logo_SilkscreenTop","Symbol/Symbol_HighVoltage_NoTriangle_2x5mm_Copper","Symbol/Symbol_HighVoltage_NoTriangle_6x15mm_Copper","Symbol/Symbol_HighVoltage_Triangle_17x15mm_Copper","Symbol/Symbol_HighVoltage_Triangle_6x6mm_Copper","Symbol/Symbol_HighVoltage_Triangle_8x7mm_Copper","Symbol/UKCA-Logo_12x12mm_SilkScreen","Symbol/UKCA-Logo_20x20mm_SilkScreen","Symbol/UKCA-Logo_30x30mm_SilkScreen","Symbol/UKCA-Logo_40x40mm_SilkScreen","Symbol/UKCA-Logo_6x6mm_SilkScreen","Symbol/UKCA-Logo_8x8mm_SilkScreen","Symbol/WEEE-Logo_14x20mm_SilkScreen","Symbol/WEEE-Logo_21x30mm_SilkScreen","Symbol/WEEE-Logo_28.1x40mm_SilkScreen","Symbol/WEEE-Logo_4.2x6mm_SilkScreen","Symbol/WEEE-Logo_5.6x8mm_SilkScreen","Symbol/WEEE-Logo_8.4x12mm_SilkScreen","TerminalBlock/TerminalBlock_MaiXu_MX126-5.0-02P_1x02_P5.00mm","TerminalBlock/TerminalBlock_MaiXu_MX126-5.0-03P_1x03_P5.00mm","TerminalBlock/TerminalBlock_MaiXu_MX126-5.0-04P_1x04_P5.00mm","TerminalBlock/TerminalBlock_MaiXu_MX126-5.0-05P_1x05_P5.00mm","TerminalBlock/TerminalBlock_MaiXu_MX126-5.0-06P_1x06_P5.00mm","TerminalBlock/TerminalBlock_MaiXu_MX126-5.0-07P_1x07_P5.00mm","TerminalBlock/TerminalBlock_MaiXu_MX126-5.0-08P_1x08_P5.00mm","TerminalBlock/TerminalBlock_MaiXu_MX126-5.0-09P_1x09_P5.00mm","TerminalBlock/TerminalBlock_MaiXu_MX126-5.0-10P_1x10_P5.00mm","TerminalBlock/TerminalBlock_MaiXu_MX126-5.0-11P_1x11_P5.00mm","TerminalBlock/TerminalBlock_MaiXu_MX126-5.0-12P_1x12_P5.00mm","TerminalBlock/TerminalBlock_MaiXu_MX126-5.0-13P_1x13_P5.00mm","TerminalBlock/TerminalBlock_MaiXu_MX126-5.0-14P_1x14_P5.00mm","TerminalBlock/TerminalBlock_MaiXu_MX126-5.0-15P_1x15_P5.00mm","TerminalBlock/TerminalBlock_MaiXu_MX126-5.0-16P_1x16_P5.00mm","TerminalBlock/TerminalBlock_MaiXu_MX126-5.0-17P_1x17_P5.00mm","TerminalBlock/TerminalBlock_MaiXu_MX126-5.0-18P_1x18_P5.00mm","TerminalBlock/TerminalBlock_MaiXu_MX126-5.0-19P_1x19_P5.00mm","TerminalBlock/TerminalBlock_MaiXu_MX126-5.0-20P_1x20_P5.00mm","TerminalBlock/TerminalBlock_MaiXu_MX126-5.0-21P_1x21_P5.00mm","TerminalBlock/TerminalBlock_MaiXu_MX126-5.0-22P_1x22_P5.00mm","TerminalBlock/TerminalBlock_MaiXu_MX126-5.0-23P_1x23_P5.00mm","TerminalBlock/TerminalBlock_MaiXu_MX126-5.0-24P_1x24_P5.00mm","TerminalBlock/TerminalBlock_Xinya_XY308-2.54-10P_1x10_P2.54mm_Horizontal","TerminalBlock/TerminalBlock_Xinya_XY308-2.54-11P_1x11_P2.54mm_Horizontal","TerminalBlock/TerminalBlock_Xinya_XY308-2.54-12P_1x12_P2.54mm_Horizontal","TerminalBlock/TerminalBlock_Xinya_XY308-2.54-13P_1x13_P2.54mm_Horizontal","TerminalBlock/TerminalBlock_Xinya_XY308-2.54-14P_1x14_P2.54mm_Horizontal","TerminalBlock/TerminalBlock_Xinya_XY308-2.54-15P_1x15_P2.54mm_Horizontal","TerminalBlock/TerminalBlock_Xinya_XY308-2.54-16P_1x16_P2.54mm_Horizontal","TerminalBlock/TerminalBlock_Xinya_XY308-2.54-17P_1x17_P2.54mm_Horizontal","TerminalBlock/TerminalBlock_Xinya_XY308-2.54-18P_1x18_P2.54mm_Horizontal","TerminalBlock/TerminalBlock_Xinya_XY308-2.54-19P_1x19_P2.54mm_Horizontal","TerminalBlock/TerminalBlock_Xinya_XY308-2.54-20P_1x20_P2.54mm_Horizontal","TerminalBlock/TerminalBlock_Xinya_XY308-2.54-21P_1x21_P2.54mm_Horizontal","TerminalBlock/TerminalBlock_Xinya_XY308-2.54-22P_1x22_P2.54mm_Horizontal","TerminalBlock/TerminalBlock_Xinya_XY308-2.54-23P_1x23_P2.54mm_Horizontal","TerminalBlock/TerminalBlock_Xinya_XY308-2.54-2P_1x02_P2.54mm_Horizontal","TerminalBlock/TerminalBlock_Xinya_XY308-2.54-3P_1x03_P2.54mm_Horizontal","TerminalBlock/TerminalBlock_Xinya_XY308-2.54-4P_1x04_P2.54mm_Horizontal","TerminalBlock/TerminalBlock_Xinya_XY308-2.54-5P_1x05_P2.54mm_Horizontal","TerminalBlock/TerminalBlock_Xinya_XY308-2.54-6P_1x06_P2.54mm_Horizontal","TerminalBlock/TerminalBlock_Xinya_XY308-2.54-7P_1x07_P2.54mm_Horizontal","TerminalBlock/TerminalBlock_Xinya_XY308-2.54-8P_1x08_P2.54mm_Horizontal","TerminalBlock/TerminalBlock_Xinya_XY308-2.54-9P_1x09_P2.54mm_Horizontal","TerminalBlock_4Ucon/TerminalBlock_4Ucon_1x02_P3.50mm_Horizontal","TerminalBlock_4Ucon/TerminalBlock_4Ucon_1x02_P3.50mm_Vertical","TerminalBlock_4Ucon/TerminalBlock_4Ucon_1x03_P3.50mm_Horizontal","TerminalBlock_4Ucon/TerminalBlock_4Ucon_1x03_P3.50mm_Vertical","TerminalBlock_4Ucon/TerminalBlock_4Ucon_1x04_P3.50mm_Horizontal","TerminalBlock_4Ucon/TerminalBlock_4Ucon_1x04_P3.50mm_Vertical","TerminalBlock_4Ucon/TerminalBlock_4Ucon_1x05_P3.50mm_Horizontal","TerminalBlock_4Ucon/TerminalBlock_4Ucon_1x05_P3.50mm_Vertical","TerminalBlock_4Ucon/TerminalBlock_4Ucon_1x06_P3.50mm_Horizontal","TerminalBlock_4Ucon/TerminalBlock_4Ucon_1x06_P3.50mm_Vertical","TerminalBlock_4Ucon/TerminalBlock_4Ucon_1x07_P3.50mm_Horizontal","TerminalBlock_4Ucon/TerminalBlock_4Ucon_1x07_P3.50mm_Vertical","TerminalBlock_4Ucon/TerminalBlock_4Ucon_1x08_P3.50mm_Horizontal","TerminalBlock_4Ucon/TerminalBlock_4Ucon_1x08_P3.50mm_Vertical","TerminalBlock_4Ucon/TerminalBlock_4Ucon_1x09_P3.50mm_Horizontal","TerminalBlock_4Ucon/TerminalBlock_4Ucon_1x09_P3.50mm_Vertical","TerminalBlock_4Ucon/TerminalBlock_4Ucon_1x10_P3.50mm_Horizontal","TerminalBlock_4Ucon/TerminalBlock_4Ucon_1x10_P3.50mm_Vertical","TerminalBlock_4Ucon/TerminalBlock_4Ucon_1x11_P3.50mm_Horizontal","TerminalBlock_4Ucon/TerminalBlock_4Ucon_1x11_P3.50mm_Vertical","TerminalBlock_4Ucon/TerminalBlock_4Ucon_1x12_P3.50mm_Horizontal","TerminalBlock_4Ucon/TerminalBlock_4Ucon_1x12_P3.50mm_Vertical","TerminalBlock_4Ucon/TerminalBlock_4Ucon_1x13_P3.50mm_Horizontal","TerminalBlock_4Ucon/TerminalBlock_4Ucon_1x13_P3.50mm_Vertical","TerminalBlock_4Ucon/TerminalBlock_4Ucon_1x14_P3.50mm_Horizontal","TerminalBlock_4Ucon/TerminalBlock_4Ucon_1x14_P3.50mm_Vertical","TerminalBlock_4Ucon/TerminalBlock_4Ucon_1x15_P3.50mm_Horizontal","TerminalBlock_4Ucon/TerminalBlock_4Ucon_1x15_P3.50mm_Vertical","TerminalBlock_Altech/Altech_AK100_1x02_P5.00mm","TerminalBlock_Altech/Altech_AK100_1x03_P5.00mm","TerminalBlock_Altech/Altech_AK100_1x04_P5.00mm","TerminalBlock_Altech/Altech_AK100_1x05_P5.00mm","TerminalBlock_Altech/Altech_AK100_1x06_P5.00mm","TerminalBlock_Altech/Altech_AK100_1x07_P5.00mm","TerminalBlock_Altech/Altech_AK100_1x08_P5.00mm","TerminalBlock_Altech/Altech_AK100_1x09_P5.00mm","TerminalBlock_Altech/Altech_AK100_1x10_P5.00mm","TerminalBlock_Altech/Altech_AK100_1x11_P5.00mm","TerminalBlock_Altech/Altech_AK100_1x12_P5.00mm","TerminalBlock_Altech/Altech_AK100_1x13_P5.00mm","TerminalBlock_Altech/Altech_AK100_1x14_P5.00mm","TerminalBlock_Altech/Altech_AK100_1x15_P5.00mm","TerminalBlock_Altech/Altech_AK100_1x16_P5.00mm","TerminalBlock_Altech/Altech_AK100_1x17_P5.00mm","TerminalBlock_Altech/Altech_AK100_1x18_P5.00mm","TerminalBlock_Altech/Altech_AK100_1x19_P5.00mm","TerminalBlock_Altech/Altech_AK100_1x20_P5.00mm","TerminalBlock_Altech/Altech_AK100_1x21_P5.00mm","TerminalBlock_Altech/Altech_AK100_1x22_P5.00mm","TerminalBlock_Altech/Altech_AK100_1x23_P5.00mm","TerminalBlock_Altech/Altech_AK100_1x24_P5.00mm","TerminalBlock_Altech/Altech_AK300_1x02_P5.00mm_45-Degree","TerminalBlock_Altech/Altech_AK300_1x03_P5.00mm_45-Degree","TerminalBlock_Altech/Altech_AK300_1x04_P5.00mm_45-Degree","TerminalBlock_Altech/Altech_AK300_1x05_P5.00mm_45-Degree","TerminalBlock_Altech/Altech_AK300_1x06_P5.00mm_45-Degree","TerminalBlock_Altech/Altech_AK300_1x07_P5.00mm_45-Degree","TerminalBlock_Altech/Altech_AK300_1x08_P5.00mm_45-Degree","TerminalBlock_Altech/Altech_AK300_1x09_P5.00mm_45-Degree","TerminalBlock_Altech/Altech_AK300_1x10_P5.00mm_45-Degree","TerminalBlock_Altech/Altech_AK300_1x11_P5.00mm_45-Degree","TerminalBlock_Altech/Altech_AK300_1x12_P5.00mm_45-Degree","TerminalBlock_Altech/Altech_AK300_1x13_P5.00mm_45-Degree","TerminalBlock_Altech/Altech_AK300_1x14_P5.00mm_45-Degree","TerminalBlock_Altech/Altech_AK300_1x15_P5.00mm_45-Degree","TerminalBlock_Altech/Altech_AK300_1x16_P5.00mm_45-Degree","TerminalBlock_Altech/Altech_AK300_1x17_P5.00mm_45-Degree","TerminalBlock_Altech/Altech_AK300_1x18_P5.00mm_45-Degree","TerminalBlock_Altech/Altech_AK300_1x19_P5.00mm_45-Degree","TerminalBlock_Altech/Altech_AK300_1x20_P5.00mm_45-Degree","TerminalBlock_Altech/Altech_AK300_1x21_P5.00mm_45-Degree","TerminalBlock_Altech/Altech_AK300_1x22_P5.00mm_45-Degree","TerminalBlock_Altech/Altech_AK300_1x23_P5.00mm_45-Degree","TerminalBlock_Altech/Altech_AK300_1x24_P5.00mm_45-Degree","TerminalBlock_CUI/TerminalBlock_CUI_TB007-508-02_1x02_P5.08mm_Horizontal","TerminalBlock_CUI/TerminalBlock_CUI_TB007-508-03_1x03_P5.08mm_Horizontal","TerminalBlock_CUI/TerminalBlock_CUI_TB007-508-04_1x04_P5.08mm_Horizontal","TerminalBlock_CUI/TerminalBlock_CUI_TB007-508-05_1x05_P5.08mm_Horizontal","TerminalBlock_CUI/TerminalBlock_CUI_TB007-508-06_1x06_P5.08mm_Horizontal","TerminalBlock_CUI/TerminalBlock_CUI_TB007-508-07_1x07_P5.08mm_Horizontal","TerminalBlock_CUI/TerminalBlock_CUI_TB007-508-08_1x08_P5.08mm_Horizontal","TerminalBlock_CUI/TerminalBlock_CUI_TB007-508-09_1x09_P5.08mm_Horizontal","TerminalBlock_CUI/TerminalBlock_CUI_TB007-508-10_1x10_P5.08mm_Horizontal","TerminalBlock_CUI/TerminalBlock_CUI_TB007-508-11_1x11_P5.08mm_Horizontal","TerminalBlock_CUI/TerminalBlock_CUI_TB007-508-12_1x12_P5.08mm_Horizontal","TerminalBlock_CUI/TerminalBlock_CUI_TB007-508-13_1x13_P5.08mm_Horizontal","TerminalBlock_CUI/TerminalBlock_CUI_TB007-508-14_1x14_P5.08mm_Horizontal","TerminalBlock_CUI/TerminalBlock_CUI_TB007-508-15_1x15_P5.08mm_Horizontal","TerminalBlock_CUI/TerminalBlock_CUI_TB007-508-16_1x16_P5.08mm_Horizontal","TerminalBlock_CUI/TerminalBlock_CUI_TB007-508-17_1x17_P5.08mm_Horizontal","TerminalBlock_CUI/TerminalBlock_CUI_TB007-508-18_1x18_P5.08mm_Horizontal","TerminalBlock_CUI/TerminalBlock_CUI_TB007-508-19_1x19_P5.08mm_Horizontal","TerminalBlock_CUI/TerminalBlock_CUI_TB007-508-20_1x20_P5.08mm_Horizontal","TerminalBlock_CUI/TerminalBlock_CUI_TB007-508-21_1x21_P5.08mm_Horizontal","TerminalBlock_CUI/TerminalBlock_CUI_TB007-508-22_1x22_P5.08mm_Horizontal","TerminalBlock_CUI/TerminalBlock_CUI_TB007-508-23_1x23_P5.08mm_Horizontal","TerminalBlock_CUI/TerminalBlock_CUI_TB007-508-24_1x24_P5.08mm_Horizontal","TerminalBlock_Degson/Degson_DG246-3.81-03P","TerminalBlock_Degson/TerminalBlock_Degson_DG250-3.5-01P_1x01_P3.50mm_45Degree","TerminalBlock_Degson/TerminalBlock_Degson_DG250-3.5-02P_1x02_P3.50mm_45Degree","TerminalBlock_Degson/TerminalBlock_Degson_DG250-3.5-03P_1x03_P3.50mm_45Degree","TerminalBlock_Degson/TerminalBlock_Degson_DG250-3.5-04P_1x04_P3.50mm_45Degree","TerminalBlock_Degson/TerminalBlock_Degson_DG250-3.5-05P_1x05_P3.50mm_45Degree","TerminalBlock_Degson/TerminalBlock_Degson_DG250-3.5-06P_1x06_P3.50mm_45Degree","TerminalBlock_Degson/TerminalBlock_Degson_DG250-3.5-07P_1x07_P3.50mm_45Degree","TerminalBlock_Degson/TerminalBlock_Degson_DG250-3.5-08P_1x08_P3.50mm_45Degree","TerminalBlock_Degson/TerminalBlock_Degson_DG250-3.5-09P_1x09_P3.50mm_45Degree","TerminalBlock_Degson/TerminalBlock_Degson_DG250-3.5-10P_1x10_P3.50mm_45Degree","TerminalBlock_Degson/TerminalBlock_Degson_DG250-3.5-11P_1x11_P3.50mm_45Degree","TerminalBlock_Degson/TerminalBlock_Degson_DG250-3.5-12P_1x12_P3.50mm_45Degree","TerminalBlock_Degson/TerminalBlock_Degson_DG250-3.5-14P_1x14_P3.50mm_45Degree","TerminalBlock_Degson/TerminalBlock_Degson_DG250-3.5-15P_1x15_P3.50mm_45Degree","TerminalBlock_Degson/TerminalBlock_Degson_DG250-3.5-16P_1x16_P3.50mm_45Degree","TerminalBlock_Degson/TerminalBlock_Degson_DG250-3.5-18P_1x18_P3.50mm_45Degree","TerminalBlock_Degson/TerminalBlock_Degson_DG250-3.5-19P_1x19_P3.50mm_45Degree","TerminalBlock_Degson/TerminalBlock_Degson_DG250-3.5-20P_1x20_P3.50mm_45Degree","TerminalBlock_Degson/TerminalBlock_Degson_DG250-3.5-24P_1x24_P3.50mm_45Degree","TerminalBlock_Degson/TerminalBlock_Degson_DG250-3.5-44P_1x44_P3.50mm_45Degree","TerminalBlock_Degson/TerminalBlock_Degson_DG250-3.5-45P_1x45_P3.50mm_45Degree","TerminalBlock_Dinkle/TerminalBlock_Dinkle_DT-55-B01X-02_P10.00mm","TerminalBlock_Dinkle/TerminalBlock_Dinkle_DT-55-B01X-03_P10.00mm","TerminalBlock_Dinkle/TerminalBlock_Dinkle_DT-55-B01X-04_P10.00mm","TerminalBlock_Dinkle/TerminalBlock_Dinkle_DT-55-B01X-05_P10.00mm","TerminalBlock_Dinkle/TerminalBlock_Dinkle_DT-55-B01X-06_P10.00mm","TerminalBlock_Dinkle/TerminalBlock_Dinkle_DT-55-B01X-07_P10.00mm","TerminalBlock_Dinkle/TerminalBlock_Dinkle_DT-55-B01X-08_P10.00mm","TerminalBlock_Dinkle/TerminalBlock_Dinkle_DT-55-B01X-09_P10.00mm","TerminalBlock_Dinkle/TerminalBlock_Dinkle_DT-55-B01X-10_P10.00mm","TerminalBlock_Dinkle/TerminalBlock_Dinkle_DT-55-B01X-11_P10.00mm","TerminalBlock_Dinkle/TerminalBlock_Dinkle_DT-55-B01X-12_P10.00mm","TerminalBlock_Dinkle/TerminalBlock_Dinkle_DT-55-B01X-13_P10.00mm","TerminalBlock_Dinkle/TerminalBlock_Dinkle_DT-55-B01X-14_P10.00mm","TerminalBlock_Dinkle/TerminalBlock_Dinkle_DT-55-B01X-15_P10.00mm","TerminalBlock_Dinkle/TerminalBlock_Dinkle_DT-55-B01X-16_P10.00mm","TerminalBlock_Dinkle/TerminalBlock_Dinkle_DT-55-B01X-17_P10.00mm","TerminalBlock_Dinkle/TerminalBlock_Dinkle_DT-55-B01X-18_P10.00mm","TerminalBlock_Dinkle/TerminalBlock_Dinkle_DT-55-B01X-19_P10.00mm","TerminalBlock_Dinkle/TerminalBlock_Dinkle_DT-55-B01X-20_P10.00mm","TerminalBlock_Dinkle/TerminalBlock_Dinkle_DT-55-B01X-21_P10.00mm","TerminalBlock_Dinkle/TerminalBlock_Dinkle_DT-55-B01X-22_P10.00mm","TerminalBlock_Dinkle/TerminalBlock_Dinkle_DT-55-B01X-23_P10.00mm","TerminalBlock_Dinkle/TerminalBlock_Dinkle_DT-55-B01X-24_P10.00mm","TerminalBlock_Dinkle/TerminalBlock_Dinkle_DT-55-B01X-25_P10.00mm","TerminalBlock_Dinkle/TerminalBlock_Dinkle_DT-55-B01X-26_P10.00mm","TerminalBlock_Dinkle/TerminalBlock_Dinkle_DT-55-B01X-27_P10.00mm","TerminalBlock_Dinkle/TerminalBlock_Dinkle_DT-55-B01X-28_P10.00mm","TerminalBlock_Dinkle/TerminalBlock_Dinkle_DT-55-B01X-29_P10.00mm","TerminalBlock_Dinkle/TerminalBlock_Dinkle_DT-55-B01X-30_P10.00mm","TerminalBlock_MetzConnect/TerminalBlock_MetzConnect_360271_1x01_Horizontal_ScrewM3.0_Boxed","TerminalBlock_MetzConnect/TerminalBlock_MetzConnect_360272_1x01_Horizontal_ScrewM2.6","TerminalBlock_MetzConnect/TerminalBlock_MetzConnect_360273_1x01_Horizontal_ScrewM2.6_WireProtection","TerminalBlock_MetzConnect/TerminalBlock_MetzConnect_360291_1x01_Horizontal_ScrewM3.0_Boxed","TerminalBlock_MetzConnect/TerminalBlock_MetzConnect_360322_1x01_Horizontal_ScrewM3.0_WireProtection","TerminalBlock_MetzConnect/TerminalBlock_MetzConnect_360381_1x01_Horizontal_ScrewM3.0","TerminalBlock_MetzConnect/TerminalBlock_MetzConnect_360410_1x01_Horizontal_ScrewM3.0","TerminalBlock_MetzConnect/TerminalBlock_MetzConnect_360425_1x01_Horizontal_ScrewM4.0_Boxed","TerminalBlock_MetzConnect/TerminalBlock_MetzConnect_Type011_RT05502HBLC_1x02_P5.00mm_Horizontal","TerminalBlock_MetzConnect/TerminalBlock_MetzConnect_Type011_RT05503HBLC_1x03_P5.00mm_Horizontal","TerminalBlock_MetzConnect/TerminalBlock_MetzConnect_Type011_RT05504HBLC_1x04_P5.00mm_Horizontal","TerminalBlock_MetzConnect/TerminalBlock_MetzConnect_Type011_RT05505HBLC_1x05_P5.00mm_Horizontal","TerminalBlock_MetzConnect/TerminalBlock_MetzConnect_Type011_RT05506HBLC_1x06_P5.00mm_Horizontal","TerminalBlock_MetzConnect/TerminalBlock_MetzConnect_Type055_RT01502HDWU_1x02_P5.00mm_Horizontal","TerminalBlock_MetzConnect/TerminalBlock_MetzConnect_Type055_RT01503HDWU_1x03_P5.00mm_Horizontal","TerminalBlock_MetzConnect/TerminalBlock_MetzConnect_Type055_RT01504HDWU_1x04_P5.00mm_Horizontal","TerminalBlock_MetzConnect/TerminalBlock_MetzConnect_Type059_RT06302HBWC_1x02_P3.50mm_Horizontal","TerminalBlock_MetzConnect/TerminalBlock_MetzConnect_Type059_RT06303HBWC_1x03_P3.50mm_Horizontal","TerminalBlock_MetzConnect/TerminalBlock_MetzConnect_Type059_RT06304HBWC_1x04_P3.50mm_Horizontal","TerminalBlock_MetzConnect/TerminalBlock_MetzConnect_Type059_RT06305HBWC_1x05_P3.50mm_Horizontal","TerminalBlock_MetzConnect/TerminalBlock_MetzConnect_Type059_RT06306HBWC_1x06_P3.50mm_Horizontal","TerminalBlock_MetzConnect/TerminalBlock_MetzConnect_Type067_RT01902HDWC_1x02_P10.00mm_Horizontal","TerminalBlock_MetzConnect/TerminalBlock_MetzConnect_Type067_RT01903HDWC_1x03_P10.00mm_Horizontal","TerminalBlock_MetzConnect/TerminalBlock_MetzConnect_Type067_RT01904HDWC_1x04_P10.00mm_Horizontal","TerminalBlock_MetzConnect/TerminalBlock_MetzConnect_Type067_RT01905HDWC_1x05_P10.00mm_Horizontal","TerminalBlock_MetzConnect/TerminalBlock_MetzConnect_Type073_RT02602HBLU_1x02_P5.08mm_Horizontal","TerminalBlock_MetzConnect/TerminalBlock_MetzConnect_Type073_RT02603HBLU_1x03_P5.08mm_Horizontal","TerminalBlock_MetzConnect/TerminalBlock_MetzConnect_Type086_RT03402HBLC_1x02_P3.81mm_Horizontal","TerminalBlock_MetzConnect/TerminalBlock_MetzConnect_Type086_RT03403HBLC_1x03_P3.81mm_Horizontal","TerminalBlock_MetzConnect/TerminalBlock_MetzConnect_Type086_RT03404HBLC_1x04_P3.81mm_Horizontal","TerminalBlock_MetzConnect/TerminalBlock_MetzConnect_Type086_RT03405HBLC_1x05_P3.81mm_Horizontal","TerminalBlock_MetzConnect/TerminalBlock_MetzConnect_Type086_RT03406HBLC_1x06_P3.81mm_Horizontal","TerminalBlock_MetzConnect/TerminalBlock_MetzConnect_Type094_RT03502HBLU_1x02_P5.00mm_Horizontal","TerminalBlock_MetzConnect/TerminalBlock_MetzConnect_Type094_RT03503HBLU_1x03_P5.00mm_Horizontal","TerminalBlock_MetzConnect/TerminalBlock_MetzConnect_Type094_RT03504HBLU_1x04_P5.00mm_Horizontal","TerminalBlock_MetzConnect/TerminalBlock_MetzConnect_Type094_RT03505HBLU_1x05_P5.00mm_Horizontal","TerminalBlock_MetzConnect/TerminalBlock_MetzConnect_Type094_RT03506HBLU_1x06_P5.00mm_Horizontal","TerminalBlock_MetzConnect/TerminalBlock_MetzConnect_Type101_RT01602HBWC_1x02_P5.08mm_Horizontal","TerminalBlock_MetzConnect/TerminalBlock_MetzConnect_Type101_RT01603HBWC_1x03_P5.08mm_Horizontal","TerminalBlock_MetzConnect/TerminalBlock_MetzConnect_Type101_RT01604HBWC_1x04_P5.08mm_Horizontal","TerminalBlock_MetzConnect/TerminalBlock_MetzConnect_Type101_RT01605HBWC_1x05_P5.08mm_Horizontal","TerminalBlock_MetzConnect/TerminalBlock_MetzConnect_Type101_RT01606HBWC_1x06_P5.08mm_Horizontal","TerminalBlock_MetzConnect/TerminalBlock_MetzConnect_Type171_RT13702HBWC_1x02_P7.50mm_Horizontal","TerminalBlock_MetzConnect/TerminalBlock_MetzConnect_Type171_RT13703HBWC_1x03_P7.50mm_Horizontal","TerminalBlock_MetzConnect/TerminalBlock_MetzConnect_Type171_RT13704HBWC_1x04_P7.50mm_Horizontal","TerminalBlock_MetzConnect/TerminalBlock_MetzConnect_Type171_RT13705HBWC_1x05_P7.50mm_Horizontal","TerminalBlock_MetzConnect/TerminalBlock_MetzConnect_Type171_RT13706HBWC_1x06_P7.50mm_Horizontal","TerminalBlock_MetzConnect/TerminalBlock_MetzConnect_Type175_RT02702HBLC_1x02_P7.50mm_Horizontal","TerminalBlock_MetzConnect/TerminalBlock_MetzConnect_Type175_RT02703HBLC_1x03_P7.50mm_Horizontal","TerminalBlock_MetzConnect/TerminalBlock_MetzConnect_Type175_RT02704HBLC_1x04_P7.50mm_Horizontal","TerminalBlock_MetzConnect/TerminalBlock_MetzConnect_Type175_RT02705HBLC_1x05_P7.50mm_Horizontal","TerminalBlock_MetzConnect/TerminalBlock_MetzConnect_Type175_RT02706HBLC_1x06_P7.50mm_Horizontal","TerminalBlock_MetzConnect/TerminalBlock_MetzConnect_Type205_RT04502UBLC_1x02_P5.00mm_45Degree","TerminalBlock_MetzConnect/TerminalBlock_MetzConnect_Type205_RT04503UBLC_1x03_P5.00mm_45Degree","TerminalBlock_MetzConnect/TerminalBlock_MetzConnect_Type205_RT04504UBLC_1x04_P5.00mm_45Degree","TerminalBlock_MetzConnect/TerminalBlock_MetzConnect_Type205_RT04505UBLC_1x05_P5.00mm_45Degree","TerminalBlock_MetzConnect/TerminalBlock_MetzConnect_Type205_RT04506UBLC_1x06_P5.00mm_45Degree","TerminalBlock_MetzConnect/TerminalBlock_MetzConnect_Type701_RT11L02HGLU_1x02_P6.35mm_Horizontal","TerminalBlock_MetzConnect/TerminalBlock_MetzConnect_Type701_RT11L03HGLU_1x03_P6.35mm_Horizontal","TerminalBlock_MetzConnect/TerminalBlock_MetzConnect_Type703_RT10N02HGLU_1x02_P9.52mm_Horizontal","TerminalBlock_MetzConnect/TerminalBlock_MetzConnect_Type703_RT10N03HGLU_1x03_P9.52mm_Horizontal","TerminalBlock_Ningbo-Kagnex/TerminalBlock_Ningbo-Kagnex_HB9500M_1x02_P9.5mm","TerminalBlock_Ningbo-Kagnex/TerminalBlock_Ningbo-Kagnex_HB9500M_1x03_P9.5mm","TerminalBlock_Ningbo-Kagnex/TerminalBlock_Ningbo-Kagnex_HB9500M_1x04_P9.5mm","TerminalBlock_Ningbo-Kagnex/TerminalBlock_Ningbo-Kagnex_HB9500M_1x05_P9.5mm","TerminalBlock_Ningbo-Kagnex/TerminalBlock_Ningbo-Kagnex_HB9500M_1x06_P9.5mm","TerminalBlock_Ningbo-Kagnex/TerminalBlock_Ningbo-Kagnex_HB9500M_1x07_P9.5mm","TerminalBlock_Ningbo-Kagnex/TerminalBlock_Ningbo-Kagnex_HB9500M_1x08_P9.5mm","TerminalBlock_Ningbo-Kagnex/TerminalBlock_Ningbo-Kagnex_HB9500M_1x09_P9.5mm","TerminalBlock_Ningbo-Kagnex/TerminalBlock_Ningbo-Kagnex_HB9500M_1x10_P9.5mm","TerminalBlock_Ningbo-Kagnex/TerminalBlock_Ningbo-Kagnex_HB9500M_1x11_P9.5mm","TerminalBlock_Ningbo-Kagnex/TerminalBlock_Ningbo-Kagnex_HB9500M_1x12_P9.5mm","TerminalBlock_Ningbo-Kagnex/TerminalBlock_Ningbo-Kagnex_HB9500_1x02_P9.5mm","TerminalBlock_Ningbo-Kagnex/TerminalBlock_Ningbo-Kagnex_HB9500_1x03_P9.5mm","TerminalBlock_Ningbo-Kagnex/TerminalBlock_Ningbo-Kagnex_HB9500_1x04_P9.5mm","TerminalBlock_Ningbo-Kagnex/TerminalBlock_Ningbo-Kagnex_HB9500_1x05_P9.5mm","TerminalBlock_Ningbo-Kagnex/TerminalBlock_Ningbo-Kagnex_HB9500_1x06_P9.5mm","TerminalBlock_Ningbo-Kagnex/TerminalBlock_Ningbo-Kagnex_HB9500_1x07_P9.5mm","TerminalBlock_Ningbo-Kagnex/TerminalBlock_Ningbo-Kagnex_HB9500_1x08_P9.5mm","TerminalBlock_Ningbo-Kagnex/TerminalBlock_Ningbo-Kagnex_HB9500_1x09_P9.5mm","TerminalBlock_Ningbo-Kagnex/TerminalBlock_Ningbo-Kagnex_HB9500_1x10_P9.5mm","TerminalBlock_Ningbo-Kagnex/TerminalBlock_Ningbo-Kagnex_HB9500_1x11_P9.5mm","TerminalBlock_Ningbo-Kagnex/TerminalBlock_Ningbo-Kagnex_HB9500_1x12_P9.5mm","TerminalBlock_Philmore/TerminalBlock_Philmore_TB132_1x02_P5.00mm_Horizontal","TerminalBlock_Philmore/TerminalBlock_Philmore_TB133_1x03_P5.00mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_MKDS-1,5-10-5.08_1x10_P5.08mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_MKDS-1,5-10_1x10_P5.00mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_MKDS-1,5-11-5.08_1x11_P5.08mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_MKDS-1,5-11_1x11_P5.00mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_MKDS-1,5-12-5.08_1x12_P5.08mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_MKDS-1,5-12_1x12_P5.00mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_MKDS-1,5-13-5.08_1x13_P5.08mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_MKDS-1,5-13_1x13_P5.00mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_MKDS-1,5-14-5.08_1x14_P5.08mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_MKDS-1,5-14_1x14_P5.00mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_MKDS-1,5-15-5.08_1x15_P5.08mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_MKDS-1,5-15_1x15_P5.00mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_MKDS-1,5-16-5.08_1x16_P5.08mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_MKDS-1,5-16_1x16_P5.00mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_MKDS-1,5-2-5.08_1x02_P5.08mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_MKDS-1,5-2_1x02_P5.00mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_MKDS-1,5-3-5.08_1x03_P5.08mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_MKDS-1,5-3_1x03_P5.00mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_MKDS-1,5-4-5.08_1x04_P5.08mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_MKDS-1,5-4_1x04_P5.00mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_MKDS-1,5-5-5.08_1x05_P5.08mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_MKDS-1,5-5_1x05_P5.00mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_MKDS-1,5-6-5.08_1x06_P5.08mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_MKDS-1,5-6_1x06_P5.00mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_MKDS-1,5-7-5.08_1x07_P5.08mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_MKDS-1,5-7_1x07_P5.00mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_MKDS-1,5-8-5.08_1x08_P5.08mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_MKDS-1,5-8_1x08_P5.00mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_MKDS-1,5-9-5.08_1x09_P5.08mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_MKDS-1,5-9_1x09_P5.00mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_MKDS-1-10-3.81_1x10_P3.81mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_MKDS-1-11-3.81_1x11_P3.81mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_MKDS-1-12-3.81_1x12_P3.81mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_MKDS-1-13-3.81_1x13_P3.81mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_MKDS-1-2-3.81_1x02_P3.81mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_MKDS-1-3-3.81_1x03_P3.81mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_MKDS-1-4-3.81_1x04_P3.81mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_MKDS-1-5-3.81_1x05_P3.81mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_MKDS-1-6-3.81_1x06_P3.81mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_MKDS-1-7-3.81_1x07_P3.81mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_MKDS-1-8-3.81_1x08_P3.81mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_MKDS-1-9-3.81_1x09_P3.81mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_MKDS-3-10-5.08_1x10_P5.08mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_MKDS-3-11-5.08_1x11_P5.08mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_MKDS-3-12-5.08_1x12_P5.08mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_MKDS-3-13-5.08_1x13_P5.08mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_MKDS-3-14-5.08_1x14_P5.08mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_MKDS-3-15-5.08_1x15_P5.08mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_MKDS-3-16-5.08_1x16_P5.08mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_MKDS-3-2-5.08_1x02_P5.08mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_MKDS-3-3-5.08_1x03_P5.08mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_MKDS-3-4-5.08_1x04_P5.08mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_MKDS-3-5-5.08_1x05_P5.08mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_MKDS-3-6-5.08_1x06_P5.08mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_MKDS-3-7-5.08_1x07_P5.08mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_MKDS-3-8-5.08_1x08_P5.08mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_MKDS-3-9-5.08_1x09_P5.08mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_MPT-0,5-10-2.54_1x10_P2.54mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_MPT-0,5-11-2.54_1x11_P2.54mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_MPT-0,5-12-2.54_1x12_P2.54mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_MPT-0,5-2-2.54_1x02_P2.54mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_MPT-0,5-3-2.54_1x03_P2.54mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_MPT-0,5-4-2.54_1x04_P2.54mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_MPT-0,5-5-2.54_1x05_P2.54mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_MPT-0,5-6-2.54_1x06_P2.54mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_MPT-0,5-7-2.54_1x07_P2.54mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_MPT-0,5-8-2.54_1x08_P2.54mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_MPT-0,5-9-2.54_1x09_P2.54mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_PT-1,5-10-3.5-H_1x10_P3.50mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_PT-1,5-10-5.0-H_1x10_P5.00mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_PT-1,5-11-3.5-H_1x11_P3.50mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_PT-1,5-11-5.0-H_1x11_P5.00mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_PT-1,5-12-3.5-H_1x12_P3.50mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_PT-1,5-12-5.0-H_1x12_P5.00mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_PT-1,5-13-3.5-H_1x13_P3.50mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_PT-1,5-13-5.0-H_1x13_P5.00mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_PT-1,5-14-3.5-H_1x14_P3.50mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_PT-1,5-14-5.0-H_1x14_P5.00mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_PT-1,5-15-3.5-H_1x15_P3.50mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_PT-1,5-15-5.0-H_1x15_P5.00mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_PT-1,5-16-3.5-H_1x16_P3.50mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_PT-1,5-16-5.0-H_1x16_P5.00mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_PT-1,5-2-3.5-H_1x02_P3.50mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_PT-1,5-2-5.0-H_1x02_P5.00mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_PT-1,5-3-3.5-H_1x03_P3.50mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_PT-1,5-3-5.0-H_1x03_P5.00mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_PT-1,5-4-3.5-H_1x04_P3.50mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_PT-1,5-4-5.0-H_1x04_P5.00mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_PT-1,5-5-3.5-H_1x05_P3.50mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_PT-1,5-5-5.0-H_1x05_P5.00mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_PT-1,5-6-3.5-H_1x06_P3.50mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_PT-1,5-6-5.0-H_1x06_P5.00mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_PT-1,5-7-3.5-H_1x07_P3.50mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_PT-1,5-7-5.0-H_1x07_P5.00mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_PT-1,5-8-3.5-H_1x08_P3.50mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_PT-1,5-8-5.0-H_1x08_P5.00mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_PT-1,5-9-3.5-H_1x09_P3.50mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_PT-1,5-9-5.0-H_1x09_P5.00mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_PTSM-0,5-2-2,5-V-SMD_1x02-1MP_P2.50mm_Vertical","TerminalBlock_Phoenix/TerminalBlock_Phoenix_PTSM-0,5-2-2.5-H-THR_1x02_P2.50mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_PTSM-0,5-2-2.5-V-THR_1x02_P2.50mm_Vertical","TerminalBlock_Phoenix/TerminalBlock_Phoenix_PTSM-0,5-2-HV-2.5-SMD_1x02-1MP_P2.50mm_Vertical","TerminalBlock_Phoenix/TerminalBlock_Phoenix_PTSM-0,5-3-2,5-V-SMD_1x03-1MP_P2.50mm_Vertical","TerminalBlock_Phoenix/TerminalBlock_Phoenix_PTSM-0,5-3-2.5-H-THR_1x03_P2.50mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_PTSM-0,5-3-2.5-V-THR_1x03_P2.50mm_Vertical","TerminalBlock_Phoenix/TerminalBlock_Phoenix_PTSM-0,5-3-HV-2.5-SMD_1x03-1MP_P2.50mm_Vertical","TerminalBlock_Phoenix/TerminalBlock_Phoenix_PTSM-0,5-4-2,5-V-SMD_1x04-1MP_P2.50mm_Vertical","TerminalBlock_Phoenix/TerminalBlock_Phoenix_PTSM-0,5-4-2.5-H-THR_1x04_P2.50mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_PTSM-0,5-4-2.5-V-THR_1x04_P2.50mm_Vertical","TerminalBlock_Phoenix/TerminalBlock_Phoenix_PTSM-0,5-4-HV-2.5-SMD_1x04-1MP_P2.50mm_Vertical","TerminalBlock_Phoenix/TerminalBlock_Phoenix_PTSM-0,5-5-2,5-V-SMD_1x05-1MP_P2.50mm_Vertical","TerminalBlock_Phoenix/TerminalBlock_Phoenix_PTSM-0,5-5-2.5-H-THR_1x05_P2.50mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_PTSM-0,5-5-2.5-V-THR_1x05_P2.50mm_Vertical","TerminalBlock_Phoenix/TerminalBlock_Phoenix_PTSM-0,5-5-HV-2.5-SMD_1x05-1MP_P2.50mm_Vertical","TerminalBlock_Phoenix/TerminalBlock_Phoenix_PTSM-0,5-6-2,5-V-SMD_1x06-1MP_P2.50mm_Vertical","TerminalBlock_Phoenix/TerminalBlock_Phoenix_PTSM-0,5-6-2.5-H-THR_1x06_P2.50mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_PTSM-0,5-6-2.5-V-THR_1x06_P2.50mm_Vertical","TerminalBlock_Phoenix/TerminalBlock_Phoenix_PTSM-0,5-6-HV-2.5-SMD_1x06-1MP_P2.50mm_Vertical","TerminalBlock_Phoenix/TerminalBlock_Phoenix_PTSM-0,5-7-2,5-V-SMD_1x07-1MP_P2.50mm_Vertical","TerminalBlock_Phoenix/TerminalBlock_Phoenix_PTSM-0,5-7-2.5-H-THR_1x07_P2.50mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_PTSM-0,5-7-2.5-V-THR_1x07_P2.50mm_Vertical","TerminalBlock_Phoenix/TerminalBlock_Phoenix_PTSM-0,5-7-HV-2.5-SMD_1x07-1MP_P2.50mm_Vertical","TerminalBlock_Phoenix/TerminalBlock_Phoenix_PTSM-0,5-8-2,5-V-SMD_1x08-1MP_P2.50mm_Vertical","TerminalBlock_Phoenix/TerminalBlock_Phoenix_PTSM-0,5-8-2.5-H-THR_1x08_P2.50mm_Horizontal","TerminalBlock_Phoenix/TerminalBlock_Phoenix_PTSM-0,5-8-2.5-V-THR_1x08_P2.50mm_Vertical","TerminalBlock_Phoenix/TerminalBlock_Phoenix_PTSM-0,5-8-HV-2.5-SMD_1x08-1MP_P2.50mm_Vertical","TerminalBlock_RND/TerminalBlock_RND_205-00001_1x02_P5.00mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00002_1x03_P5.00mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00003_1x04_P5.00mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00004_1x05_P5.00mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00005_1x06_P5.00mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00006_1x07_P5.00mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00007_1x08_P5.00mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00008_1x09_P5.00mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00009_1x10_P5.00mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00010_1x11_P5.00mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00011_1x12_P5.00mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00012_1x02_P5.00mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00013_1x03_P5.00mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00014_1x04_P5.00mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00015_1x05_P5.00mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00016_1x06_P5.00mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00017_1x07_P5.00mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00018_1x08_P5.00mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00019_1x09_P5.00mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00020_1x10_P5.00mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00021_1x11_P5.00mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00022_1x12_P5.00mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00023_1x02_P10.00mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00024_1x03_P10.00mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00025_1x04_P10.00mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00026_1x05_P10.00mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00027_1x06_P10.00mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00028_1x07_P10.00mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00029_1x08_P10.00mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00030_1x09_P10.00mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00031_1x10_P10.00mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00032_1x11_P10.00mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00033_1x12_P10.00mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00045_1x02_P5.00mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00046_1x03_P5.00mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00047_1x04_P5.00mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00048_1x05_P5.00mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00049_1x06_P5.00mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00050_1x07_P5.00mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00051_1x08_P5.00mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00052_1x09_P5.00mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00053_1x10_P5.00mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00054_1x11_P5.00mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00055_1x12_P5.00mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00056_1x02_P5.00mm_45Degree","TerminalBlock_RND/TerminalBlock_RND_205-00057_1x03_P5.00mm_45Degree","TerminalBlock_RND/TerminalBlock_RND_205-00058_1x04_P5.00mm_45Degree","TerminalBlock_RND/TerminalBlock_RND_205-00059_1x05_P5.00mm_45Degree","TerminalBlock_RND/TerminalBlock_RND_205-00060_1x06_P5.00mm_45Degree","TerminalBlock_RND/TerminalBlock_RND_205-00061_1x07_P5.00mm_45Degree","TerminalBlock_RND/TerminalBlock_RND_205-00062_1x08_P5.00mm_45Degree","TerminalBlock_RND/TerminalBlock_RND_205-00063_1x09_P5.00mm_45Degree","TerminalBlock_RND/TerminalBlock_RND_205-00064_1x10_P5.00mm_45Degree","TerminalBlock_RND/TerminalBlock_RND_205-00065_1x11_P5.00mm_45Degree","TerminalBlock_RND/TerminalBlock_RND_205-00066_1x12_P5.00mm_45Degree","TerminalBlock_RND/TerminalBlock_RND_205-00067_1x02_P7.50mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00068_1x03_P7.50mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00069_1x04_P7.50mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00070_1x05_P7.50mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00071_1x06_P7.50mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00072_1x07_P7.50mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00073_1x08_P7.50mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00074_1x09_P7.50mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00075_1x10_P7.50mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00076_1x11_P7.50mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00077_1x12_P7.50mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00078_1x02_P10.00mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00079_1x03_P10.00mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00080_1x04_P10.00mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00081_1x05_P10.00mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00082_1x06_P10.00mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00083_1x07_P10.00mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00084_1x08_P10.00mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00085_1x09_P10.00mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00086_1x10_P10.00mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00087_1x11_P10.00mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00088_1x12_P10.00mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00232_1x02_P5.08mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00233_1x03_P5.08mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00234_1x04_P5.08mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00235_1x05_P5.08mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00236_1x06_P5.08mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00237_1x07_P5.08mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00238_1x08_P5.08mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00239_1x09_P5.08mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00240_1x10_P5.08mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00241_1x02_P10.16mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00241_1x11_P5.08mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00242_1x03_P10.16mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00242_1x12_P5.08mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00243_1x04_P10.16mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00244_1x05_P10.16mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00245_1x06_P10.16mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00246_1x07_P10.16mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00247_1x08_P10.16mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00248_1x09_P10.16mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00249_1x10_P10.16mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00250_1x11_P10.16mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00251_1x12_P10.16mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00276_1x02_P5.00mm_Vertical","TerminalBlock_RND/TerminalBlock_RND_205-00277_1x03_P5.00mm_Vertical","TerminalBlock_RND/TerminalBlock_RND_205-00278_1x04_P5.00mm_Vertical","TerminalBlock_RND/TerminalBlock_RND_205-00279_1x05_P5.00mm_Vertical","TerminalBlock_RND/TerminalBlock_RND_205-00280_1x06_P5.00mm_Vertical","TerminalBlock_RND/TerminalBlock_RND_205-00281_1x07_P5.00mm_Vertical","TerminalBlock_RND/TerminalBlock_RND_205-00282_1x08_P5.00mm_Vertical","TerminalBlock_RND/TerminalBlock_RND_205-00283_1x09_P5.00mm_Vertical","TerminalBlock_RND/TerminalBlock_RND_205-00284_1x10_P5.00mm_Vertical","TerminalBlock_RND/TerminalBlock_RND_205-00285_1x11_P5.00mm_Vertical","TerminalBlock_RND/TerminalBlock_RND_205-00286_1x12_P5.00mm_Vertical","TerminalBlock_RND/TerminalBlock_RND_205-00287_1x02_P5.08mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00288_1x03_P5.08mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00289_1x04_P5.08mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00290_1x05_P5.08mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00291_1x06_P5.08mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00292_1x07_P5.08mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00293_1x08_P5.08mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00294_1x09_P5.08mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00295_1x10_P5.08mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00296_1x11_P5.08mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00297_1x12_P5.08mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00298_1x02_P10.00mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00299_1x03_P10.00mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00300_1x04_P10.00mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00301_1x05_P10.00mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00302_1x06_P10.00mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00303_1x07_P10.00mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00304_1x08_P10.00mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00305_1x09_P10.00mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00306_1x10_P10.00mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00307_1x11_P10.00mm_Horizontal","TerminalBlock_RND/TerminalBlock_RND_205-00308_1x12_P10.00mm_Horizontal","TerminalBlock_TE-Connectivity/TerminalBlock_TE_1-282834-0_1x10_P2.54mm_Horizontal","TerminalBlock_TE-Connectivity/TerminalBlock_TE_1-282834-1_1x11_P2.54mm_Horizontal","TerminalBlock_TE-Connectivity/TerminalBlock_TE_1-282834-2_1x12_P2.54mm_Horizontal","TerminalBlock_TE-Connectivity/TerminalBlock_TE_282834-2_1x02_P2.54mm_Horizontal","TerminalBlock_TE-Connectivity/TerminalBlock_TE_282834-3_1x03_P2.54mm_Horizontal","TerminalBlock_TE-Connectivity/TerminalBlock_TE_282834-4_1x04_P2.54mm_Horizontal","TerminalBlock_TE-Connectivity/TerminalBlock_TE_282834-5_1x05_P2.54mm_Horizontal","TerminalBlock_TE-Connectivity/TerminalBlock_TE_282834-6_1x06_P2.54mm_Horizontal","TerminalBlock_TE-Connectivity/TerminalBlock_TE_282834-7_1x07_P2.54mm_Horizontal","TerminalBlock_TE-Connectivity/TerminalBlock_TE_282834-8_1x08_P2.54mm_Horizontal","TerminalBlock_TE-Connectivity/TerminalBlock_TE_282834-9_1x09_P2.54mm_Horizontal","TerminalBlock_WAGO/TerminalBlock_WAGO_233-502_2x02_P2.54mm","TerminalBlock_WAGO/TerminalBlock_WAGO_233-503_2x03_P2.54mm","TerminalBlock_WAGO/TerminalBlock_WAGO_233-504_2x04_P2.54mm","TerminalBlock_WAGO/TerminalBlock_WAGO_233-505_2x05_P2.54mm","TerminalBlock_WAGO/TerminalBlock_WAGO_233-506_2x06_P2.54mm","TerminalBlock_WAGO/TerminalBlock_WAGO_233-507_2x07_P2.54mm","TerminalBlock_WAGO/TerminalBlock_WAGO_233-508_2x08_P2.54mm","TerminalBlock_WAGO/TerminalBlock_WAGO_233-509_2x09_P2.54mm","TerminalBlock_WAGO/TerminalBlock_WAGO_233-510_2x10_P2.54mm","TerminalBlock_WAGO/TerminalBlock_WAGO_233-512_2x12_P2.54mm","TerminalBlock_WAGO/TerminalBlock_WAGO_236-101_1x01_P5.00mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-102_1x02_P5.00mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-103_1x03_P5.00mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-104_1x04_P5.00mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-105_1x05_P5.00mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-106_1x06_P5.00mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-107_1x07_P5.00mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-108_1x08_P5.00mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-109_1x09_P5.00mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-110_1x10_P5.00mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-111_1x11_P5.00mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-112_1x12_P5.00mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-113_1x13_P5.00mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-114_1x14_P5.00mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-115_1x15_P5.00mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-116_1x16_P5.00mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-124_1x24_P5.00mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-136_1x36_P5.00mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-148_1x48_P5.00mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-201_1x01_P7.50mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-202_1x02_P7.50mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-203_1x03_P7.50mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-204_1x04_P7.50mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-205_1x05_P7.50mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-206_1x06_P7.50mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-207_1x07_P7.50mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-208_1x08_P7.50mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-209_1x09_P7.50mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-210_1x10_P7.50mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-211_1x11_P7.50mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-212_1x12_P7.50mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-213_1x13_P7.50mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-214_1x14_P7.50mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-215_1x15_P7.50mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-216_1x16_P7.50mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-224_1x24_P7.50mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-301_1x01_P10.00mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-302_1x02_P10.00mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-303_1x03_P10.00mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-304_1x04_P10.00mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-305_1x05_P10.00mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-306_1x06_P10.00mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-307_1x07_P10.00mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-308_1x08_P10.00mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-309_1x09_P10.00mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-310_1x10_P10.00mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-311_1x11_P10.00mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-312_1x12_P10.00mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-313_1x13_P10.00mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-314_1x14_P10.00mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-315_1x15_P10.00mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-316_1x16_P10.00mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-324_1x24_P10.00mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-401_1x01_P5.00mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-402_1x02_P5.00mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-403_1x03_P5.00mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-404_1x04_P5.00mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-405_1x05_P5.00mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-406_1x06_P5.00mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-407_1x07_P5.00mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-408_1x08_P5.00mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-409_1x09_P5.00mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-410_1x10_P5.00mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-411_1x11_P5.00mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-412_1x12_P5.00mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-413_1x13_P5.00mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-414_1x14_P5.00mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-415_1x15_P5.00mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-416_1x16_P5.00mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-424_1x24_P5.00mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-436_1x36_P5.00mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-448_1x48_P5.00mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-501_1x01_P7.50mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-502_1x02_P7.50mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-503_1x03_P7.50mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-504_1x04_P7.50mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-505_1x05_P7.50mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-506_1x06_P7.50mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-507_1x07_P7.50mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-508_1x08_P7.50mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-509_1x09_P7.50mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-510_1x10_P7.50mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-511_1x11_P7.50mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-512_1x12_P7.50mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-513_1x13_P7.50mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-514_1x14_P7.50mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-515_1x15_P7.50mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-516_1x16_P7.50mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-524_1x24_P7.50mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-601_1x01_P10.00mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-602_1x02_P10.00mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-603_1x03_P10.00mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-604_1x04_P10.00mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-605_1x05_P10.00mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-606_1x06_P10.00mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-607_1x07_P10.00mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-608_1x08_P10.00mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-609_1x09_P10.00mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-610_1x10_P10.00mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-611_1x11_P10.00mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-612_1x12_P10.00mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-613_1x13_P10.00mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-614_1x14_P10.00mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-615_1x15_P10.00mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-616_1x16_P10.00mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_236-624_1x24_P10.00mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_2601-1102_1x02_P3.50mm_Horizontal","TerminalBlock_WAGO/TerminalBlock_WAGO_2601-1103_1x03_P3.50mm_Horizontal","TerminalBlock_WAGO/TerminalBlock_WAGO_2601-1104_1x04_P3.50mm_Horizontal","TerminalBlock_WAGO/TerminalBlock_WAGO_2601-1105_1x05_P3.50mm_Horizontal","TerminalBlock_WAGO/TerminalBlock_WAGO_2601-1106_1x06_P3.50mm_Horizontal","TerminalBlock_WAGO/TerminalBlock_WAGO_2601-1108_1x08_P3.50mm_Horizontal","TerminalBlock_WAGO/TerminalBlock_WAGO_2601-1109_1x09_P3.50mm_Horizontal","TerminalBlock_WAGO/TerminalBlock_WAGO_2601-1110_1x10_P3.50mm_Horizontal","TerminalBlock_WAGO/TerminalBlock_WAGO_2601-1111_1x11_P3.50mm_Horizontal","TerminalBlock_WAGO/TerminalBlock_WAGO_2601-1112_1x12_P3.50mm_Horizontal","TerminalBlock_WAGO/TerminalBlock_WAGO_2601-3102_1x02_P3.50mm_Vertical","TerminalBlock_WAGO/TerminalBlock_WAGO_2601-3103_1x03_P3.50mm_Vertical","TerminalBlock_WAGO/TerminalBlock_WAGO_2601-3104_1x04_P3.50mm_Vertical","TerminalBlock_WAGO/TerminalBlock_WAGO_2601-3105_1x05_P3.50mm_Vertical","TerminalBlock_WAGO/TerminalBlock_WAGO_2601-3106_1x06_P3.50mm_Vertical","TerminalBlock_WAGO/TerminalBlock_WAGO_2601-3107_1x07_P3.50mm_Vertical","TerminalBlock_WAGO/TerminalBlock_WAGO_2601-3108_1x08_P3.50mm_Vertical","TerminalBlock_WAGO/TerminalBlock_WAGO_2601-3109_1x09_P3.50mm_Vertical","TerminalBlock_WAGO/TerminalBlock_WAGO_2601-3110_1x10_P3.50mm_Vertical","TerminalBlock_WAGO/TerminalBlock_WAGO_2601-3111_1x11_P3.50mm_Vertical","TerminalBlock_WAGO/TerminalBlock_WAGO_2601-3112_1x12_P3.50mm_Vertical","TerminalBlock_WAGO/TerminalBlock_WAGO_2601-3114_1x14_P3.50mm_Vertical","TerminalBlock_WAGO/TerminalBlock_WAGO_2601-3124_1x24_P3.50mm_Vertical","TerminalBlock_WAGO/TerminalBlock_WAGO_804-101_1x01_P5.00mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_804-102_1x02_P5.00mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_804-103_1x03_P5.00mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_804-104_1x04_P5.00mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_804-105_1x05_P5.00mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_804-106_1x06_P5.00mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_804-107_1x07_P5.00mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_804-108_1x08_P5.00mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_804-109_1x09_P5.00mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_804-110_1x10_P5.00mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_804-111_1x11_P5.00mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_804-112_1x12_P5.00mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_804-113_1x13_P5.00mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_804-114_1x14_P5.00mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_804-115_1x15_P5.00mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_804-116_1x16_P5.00mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_804-124_1x24_P5.00mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_804-301_1x01_P7.50mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_804-302_1x02_P7.50mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_804-303_1x03_P7.50mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_804-304_1x04_P7.50mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_804-305_1x05_P7.50mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_804-306_1x06_P7.50mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_804-307_1x07_P7.50mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_804-308_1x08_P7.50mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_804-309_1x09_P7.50mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_804-310_1x10_P7.50mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_804-311_1x11_P7.50mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_804-312_1x12_P7.50mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_804-316_1x16_P7.50mm_45Degree","TerminalBlock_WAGO/TerminalBlock_WAGO_804-324_1x24_P7.50mm_45Degree","TerminalBlock_Wuerth/Wuerth_691311400102_P7.62mm","TerminalBlock_Wuerth/Wuerth_REDCUBE-THR_WP-THRBU_74650073_THR","TerminalBlock_Wuerth/Wuerth_REDCUBE-THR_WP-THRBU_74650074_THR","TerminalBlock_Wuerth/Wuerth_REDCUBE-THR_WP-THRBU_74650094_THR","TerminalBlock_Wuerth/Wuerth_REDCUBE-THR_WP-THRBU_74650173_THR","TerminalBlock_Wuerth/Wuerth_REDCUBE-THR_WP-THRBU_74650174_THR","TerminalBlock_Wuerth/Wuerth_REDCUBE-THR_WP-THRBU_74650194_THR","TerminalBlock_Wuerth/Wuerth_REDCUBE-THR_WP-THRBU_74650195_THR","TerminalBlock_Wuerth/Wuerth_REDCUBE-THR_WP-THRBU_74655095_THR","TerminalBlock_Wuerth/Wuerth_REDCUBE-THR_WP-THRSH_74651173_THR","TerminalBlock_Wuerth/Wuerth_REDCUBE-THR_WP-THRSH_74651174_THR","TerminalBlock_Wuerth/Wuerth_REDCUBE-THR_WP-THRSH_74651175_THR","TerminalBlock_Wuerth/Wuerth_REDCUBE-THR_WP-THRSH_74651194_THR","TerminalBlock_Wuerth/Wuerth_REDCUBE-THR_WP-THRSH_74651195_THR","TestPoint/TestPoint_2Pads_Pitch2.54mm_Drill0.8mm","TestPoint/TestPoint_2Pads_Pitch5.08mm_Drill1.3mm","TestPoint/TestPoint_Bridge_Pitch2.0mm_Drill0.7mm","TestPoint/TestPoint_Bridge_Pitch2.54mm_Drill0.7mm","TestPoint/TestPoint_Bridge_Pitch2.54mm_Drill1.0mm","TestPoint/TestPoint_Bridge_Pitch2.54mm_Drill1.3mm","TestPoint/TestPoint_Bridge_Pitch3.81mm_Drill1.3mm","TestPoint/TestPoint_Bridge_Pitch5.08mm_Drill0.7mm","TestPoint/TestPoint_Bridge_Pitch5.08mm_Drill1.3mm","TestPoint/TestPoint_Bridge_Pitch6.35mm_Drill1.3mm","TestPoint/TestPoint_Bridge_Pitch7.62mm_Drill1.3mm","TestPoint/TestPoint_Keystone_5000-5004_Miniature","TestPoint/TestPoint_Keystone_5005-5009_Compact","TestPoint/TestPoint_Keystone_5010-5014_Multipurpose","TestPoint/TestPoint_Keystone_5015_Micro_Mini","TestPoint/TestPoint_Keystone_5019_Miniature","TestPoint/TestPoint_Loop_D1.80mm_Drill1.0mm_Beaded","TestPoint/TestPoint_Loop_D2.50mm_Drill1.0mm","TestPoint/TestPoint_Loop_D2.50mm_Drill1.0mm_LowProfile","TestPoint/TestPoint_Loop_D2.50mm_Drill1.85mm","TestPoint/TestPoint_Loop_D2.54mm_Drill1.5mm_Beaded","TestPoint/TestPoint_Loop_D2.60mm_Drill0.9mm_Beaded","TestPoint/TestPoint_Loop_D2.60mm_Drill1.4mm_Beaded","TestPoint/TestPoint_Loop_D2.60mm_Drill1.6mm_Beaded","TestPoint/TestPoint_Loop_D3.50mm_Drill0.9mm_Beaded","TestPoint/TestPoint_Loop_D3.50mm_Drill1.4mm_Beaded","TestPoint/TestPoint_Loop_D3.80mm_Drill2.0mm","TestPoint/TestPoint_Loop_D3.80mm_Drill2.5mm","TestPoint/TestPoint_Loop_D3.80mm_Drill2.8mm","TestPoint/TestPoint_Pad_1.0x1.0mm","TestPoint/TestPoint_Pad_1.5x1.5mm","TestPoint/TestPoint_Pad_2.0x2.0mm","TestPoint/TestPoint_Pad_2.5x2.5mm","TestPoint/TestPoint_Pad_3.0x3.0mm","TestPoint/TestPoint_Pad_4.0x4.0mm","TestPoint/TestPoint_Pad_D1.0mm","TestPoint/TestPoint_Pad_D1.5mm","TestPoint/TestPoint_Pad_D2.0mm","TestPoint/TestPoint_Pad_D2.5mm","TestPoint/TestPoint_Pad_D3.0mm","TestPoint/TestPoint_Pad_D4.0mm","TestPoint/TestPoint_Plated_Hole_D2.0mm","TestPoint/TestPoint_Plated_Hole_D3.0mm","TestPoint/TestPoint_Plated_Hole_D4.0mm","TestPoint/TestPoint_Plated_Hole_D5.0mm","TestPoint/TestPoint_THTPad_1.0x1.0mm_Drill0.5mm","TestPoint/TestPoint_THTPad_1.5x1.5mm_Drill0.7mm","TestPoint/TestPoint_THTPad_2.0x2.0mm_Drill1.0mm","TestPoint/TestPoint_THTPad_2.5x2.5mm_Drill1.2mm","TestPoint/TestPoint_THTPad_3.0x3.0mm_Drill1.5mm","TestPoint/TestPoint_THTPad_4.0x4.0mm_Drill2.0mm","TestPoint/TestPoint_THTPad_D1.0mm_Drill0.5mm","TestPoint/TestPoint_THTPad_D1.5mm_Drill0.7mm","TestPoint/TestPoint_THTPad_D2.0mm_Drill1.0mm","TestPoint/TestPoint_THTPad_D2.5mm_Drill1.2mm","TestPoint/TestPoint_THTPad_D3.0mm_Drill1.5mm","TestPoint/TestPoint_THTPad_D4.0mm_Drill2.0mm","Transformer_SMD/Pulse_P0926NL","Transformer_SMD/Pulse_PA1323NL","Transformer_SMD/Pulse_PA2001NL","Transformer_SMD/Pulse_PA2002NL-PA2008NL-PA2009NL","Transformer_SMD/Pulse_PA2004NL","Transformer_SMD/Pulse_PA2005NL","Transformer_SMD/Pulse_PA2006NL","Transformer_SMD/Pulse_PA2007NL","Transformer_SMD/Pulse_PA2777NL","Transformer_SMD/Pulse_PA3493NL","Transformer_SMD/Transformer_Coilcraft_CST1","Transformer_SMD/Transformer_Coilcraft_CST2","Transformer_SMD/Transformer_Coilcraft_CST2010","Transformer_SMD/Transformer_CurrentSense_8.4x7.2mm","Transformer_SMD/Transformer_ED8_4-Lead_10.5x8mm_P5mm","Transformer_SMD/Transformer_Ethernet_Bel_S558-5999-T7-F","Transformer_SMD/Transformer_Ethernet_Bourns_PT61017PEL","Transformer_SMD/Transformer_Ethernet_Bourns_PT61020EL","Transformer_SMD/Transformer_Ethernet_Bourns_SM13126PEL","Transformer_SMD/Transformer_Ethernet_CNDtek_H1102N","Transformer_SMD/Transformer_Ethernet_HALO_TG111-MSC13","Transformer_SMD/Transformer_Ethernet_Halo_N2_SO-16_7.11x12.7mm","Transformer_SMD/Transformer_Ethernet_Halo_N5_SO-16_7.11x12.7mm","Transformer_SMD/Transformer_Ethernet_Halo_N6_SO-16_7.11x14.73mm","Transformer_SMD/Transformer_Ethernet_Wuerth_749013011A","Transformer_SMD/Transformer_Ethernet_YDS_30F-51NL_SO-24_7.1x15.1mm","Transformer_SMD/Transformer_MACOM_SM-22","Transformer_SMD/Transformer_MiniCircuits_AT224-1A","Transformer_SMD/Transformer_Murata_78250JC","Transformer_SMD/Transformer_NF_ETAL_P2781","Transformer_SMD/Transformer_NF_ETAL_P2781_HandSoldering","Transformer_SMD/Transformer_NF_ETAL_P3000","Transformer_SMD/Transformer_NF_ETAL_P3000_HandSoldering","Transformer_SMD/Transformer_NF_ETAL_P3181","Transformer_SMD/Transformer_NF_ETAL_P3181_HandSoldering","Transformer_SMD/Transformer_NF_ETAL_P3188","Transformer_SMD/Transformer_NF_ETAL_P3188_HandSoldering","Transformer_SMD/Transformer_NF_ETAL_P3191","Transformer_SMD/Transformer_NF_ETAL_P3191_HandSoldering","Transformer_SMD/Transformer_Pulse_H1100NL","Transformer_SMD/Transformer_Wuerth_750315371","Transformer_SMD/Transformer_Wurth_WE-AGDT-EP7","Transformer_THT/Autotransformer_Toroid_1Tap_Horizontal_D10.5mm_Amidon-T37","Transformer_THT/Autotransformer_Toroid_1Tap_Horizontal_D12.5mm_Amidon-T44","Transformer_THT/Autotransformer_Toroid_1Tap_Horizontal_D14.0mm_Amidon-T50","Transformer_THT/Autotransformer_Toroid_1Tap_Horizontal_D9.0mm_Amidon-T30","Transformer_THT/Autotransformer_ZS1052-AC","Transformer_THT/Transformer_37x44","Transformer_THT/Transformer_Breve_TEZ-22x24","Transformer_THT/Transformer_Breve_TEZ-28x33","Transformer_THT/Transformer_Breve_TEZ-35x42","Transformer_THT/Transformer_Breve_TEZ-38x45","Transformer_THT/Transformer_Breve_TEZ-44x52","Transformer_THT/Transformer_Breve_TEZ-47x57","Transformer_THT/Transformer_CHK_EI30-2VA_1xSec","Transformer_THT/Transformer_CHK_EI30-2VA_2xSec","Transformer_THT/Transformer_CHK_EI30-2VA_Neutral","Transformer_THT/Transformer_CHK_EI38-3VA_1xSec","Transformer_THT/Transformer_CHK_EI38-3VA_2xSec","Transformer_THT/Transformer_CHK_EI38-3VA_Neutral","Transformer_THT/Transformer_CHK_EI42-5VA_1xSec","Transformer_THT/Transformer_CHK_EI42-5VA_2xSec","Transformer_THT/Transformer_CHK_EI42-5VA_Neutral","Transformer_THT/Transformer_CHK_EI48-10VA_1xSec","Transformer_THT/Transformer_CHK_EI48-10VA_2xSec","Transformer_THT/Transformer_CHK_EI48-10VA_Neutral","Transformer_THT/Transformer_CHK_EI48-8VA_1xSec","Transformer_THT/Transformer_CHK_EI48-8VA_2xSec","Transformer_THT/Transformer_CHK_EI48-8VA_Neutral","Transformer_THT/Transformer_CHK_EI54-12VA_1xSec","Transformer_THT/Transformer_CHK_EI54-12VA_2xSec","Transformer_THT/Transformer_CHK_EI54-12VA_Neutral","Transformer_THT/Transformer_CHK_EI54-16VA_1xSec","Transformer_THT/Transformer_CHK_EI54-16VA_2xSec","Transformer_THT/Transformer_CHK_EI54-16VA_Neutral","Transformer_THT/Transformer_CHK_UI30-4VA_Flat","Transformer_THT/Transformer_CHK_UI39-10VA_Flat","Transformer_THT/Transformer_Coilcraft_Q4434-B_Rhombus-T1311","Transformer_THT/Transformer_EPCOS_B66359A1013T_Horizontal","Transformer_THT/Transformer_EPCOS_B66359J1014T_Vertical","Transformer_THT/Transformer_Microphone_Lundahl_LL1538","Transformer_THT/Transformer_Microphone_Lundahl_LL1587","Transformer_THT/Transformer_Myrra_74040_Horizontal","Transformer_THT/Transformer_Myrra_EF20_7408x","Transformer_THT/Transformer_Myrra_EI30-5_44000_Horizontal","Transformer_THT/Transformer_NF_ETAL_1-1_P1200","Transformer_THT/Transformer_NF_ETAL_P1165","Transformer_THT/Transformer_NF_ETAL_P3324","Transformer_THT/Transformer_NF_ETAL_P3356","Transformer_THT/Transformer_Toroid_Horizontal_D10.5mm_Amidon-T37","Transformer_THT/Transformer_Toroid_Horizontal_D12.5mm_Amidon-T44","Transformer_THT/Transformer_Toroid_Horizontal_D14.0mm_Amidon-T50","Transformer_THT/Transformer_Toroid_Horizontal_D18.0mm","Transformer_THT/Transformer_Toroid_Horizontal_D9.0mm_Amidon-T30","Transformer_THT/Transformer_Toroid_Tapped_Horizontal_D10.5mm_Amidon-T37","Transformer_THT/Transformer_Toroid_Tapped_Horizontal_D12.5mm_Amidon-T44","Transformer_THT/Transformer_Toroid_Tapped_Horizontal_D14.0mm_Amidon-T50","Transformer_THT/Transformer_Toroid_Tapped_Horizontal_D9.0mm_Amidon-T30","Transformer_THT/Transformer_Triad_VPP16-310","Transformer_THT/Transformer_Wuerth_750343373","Transformer_THT/Transformer_Wuerth_760871131","Transformer_THT/Transformer_Zeming_ZMCT103C","Transformer_THT/Transformer_Zeming_ZMPT101K","Transistor_Power/GaN_Systems_GaNPX-3_5x6.6mm_Drain2.93x0.6mm","Transistor_Power/GaN_Systems_GaNPX-3_5x6.6mm_Drain3.76x0.6mm","Transistor_Power/GaN_Systems_GaNPX-4_7x8.4mm","Transistor_Power_Module/Infineon_AG-ECONO2","Transistor_Power_Module/Infineon_AG-ECONO3","Transistor_Power_Module/Infineon_AG-ECONO3B","Transistor_Power_Module/Infineon_EasyPACK-1B","Transistor_Power_Module/Infineon_EasyPACK-1B_PressFIT","Transistor_Power_Module/Infineon_EasyPIM-1B","Transistor_Power_Module/Infineon_EasyPIM-2B","Transistor_Power_Module/Littelfuse_Package_H_XBN2MM","Transistor_Power_Module/Littelfuse_Package_H_XN2MM","Transistor_Power_Module/Littelfuse_Package_W_XBN2MM","Transistor_Power_Module/Littelfuse_Package_W_XN2MM","Transistor_Power_Module/ST_ACEPACK-2-CIB","Transistor_Power_Module/ST_ACEPACK-2-CIB_PressFIT","Transistor_Power_Module/ST_SDIP-25L","Valve/Valve_ECC-83-1","Valve/Valve_ECC-83-2","Valve/Valve_EURO","Valve/Valve_Glimm","Valve/Valve_Mini_G","Valve/Valve_Mini_P","Valve/Valve_Mini_Pentode_Linear","Valve/Valve_Noval_G","Valve/Valve_Noval_P","Valve/Valve_Octal","Varistor/RV_Disc_D12mm_W3.9mm_P7.5mm","Varistor/RV_Disc_D12mm_W4.2mm_P7.5mm","Varistor/RV_Disc_D12mm_W4.3mm_P7.5mm","Varistor/RV_Disc_D12mm_W4.4mm_P7.5mm","Varistor/RV_Disc_D12mm_W4.5mm_P7.5mm","Varistor/RV_Disc_D12mm_W4.6mm_P7.5mm","Varistor/RV_Disc_D12mm_W4.7mm_P7.5mm","Varistor/RV_Disc_D12mm_W4.8mm_P7.5mm","Varistor/RV_Disc_D12mm_W4mm_P7.5mm","Varistor/RV_Disc_D12mm_W5.1mm_P7.5mm","Varistor/RV_Disc_D12mm_W5.4mm_P7.5mm","Varistor/RV_Disc_D12mm_W5.8mm_P7.5mm","Varistor/RV_Disc_D12mm_W5mm_P7.5mm","Varistor/RV_Disc_D12mm_W6.1mm_P7.5mm","Varistor/RV_Disc_D12mm_W6.2mm_P7.5mm","Varistor/RV_Disc_D12mm_W6.3mm_P7.5mm","Varistor/RV_Disc_D12mm_W6.7mm_P7.5mm","Varistor/RV_Disc_D12mm_W7.1mm_P7.5mm","Varistor/RV_Disc_D12mm_W7.5mm_P7.5mm","Varistor/RV_Disc_D12mm_W7.9mm_P7.5mm","Varistor/RV_Disc_D15.5mm_W11mm_P7.5mm","Varistor/RV_Disc_D15.5mm_W3.9mm_P7.5mm","Varistor/RV_Disc_D15.5mm_W4.2mm_P7.5mm","Varistor/RV_Disc_D15.5mm_W4.3mm_P7.5mm","Varistor/RV_Disc_D15.5mm_W4.4mm_P7.5mm","Varistor/RV_Disc_D15.5mm_W4.5mm_P7.5mm","Varistor/RV_Disc_D15.5mm_W4.6mm_P7.5mm","Varistor/RV_Disc_D15.5mm_W4.7mm_P7.5mm","Varistor/RV_Disc_D15.5mm_W4.8mm_P7.5mm","Varistor/RV_Disc_D15.5mm_W4.9mm_P7.5mm","Varistor/RV_Disc_D15.5mm_W4mm_P7.5mm","Varistor/RV_Disc_D15.5mm_W5.2mm_P7.5mm","Varistor/RV_Disc_D15.5mm_W5.4mm_P7.5mm","Varistor/RV_Disc_D15.5mm_W5.9mm_P7.5mm","Varistor/RV_Disc_D15.5mm_W5mm_P7.5mm","Varistor/RV_Disc_D15.5mm_W6.1mm_P7.5mm","Varistor/RV_Disc_D15.5mm_W6.3mm_P7.5mm","Varistor/RV_Disc_D15.5mm_W6.4mm_P7.5mm","Varistor/RV_Disc_D15.5mm_W6.8mm_P7.5mm","Varistor/RV_Disc_D15.5mm_W7.2mm_P7.5mm","Varistor/RV_Disc_D15.5mm_W7.5mm_P7.5mm","Varistor/RV_Disc_D15.5mm_W8mm_P7.5mm","Varistor/RV_Disc_D16.5mm_W6.7mm_P7.5mm","Varistor/RV_Disc_D21.5mm_W11.4mm_P10mm","Varistor/RV_Disc_D21.5mm_W4.3mm_P10mm","Varistor/RV_Disc_D21.5mm_W4.4mm_P10mm","Varistor/RV_Disc_D21.5mm_W4.5mm_P10mm","Varistor/RV_Disc_D21.5mm_W4.6mm_P10mm","Varistor/RV_Disc_D21.5mm_W4.7mm_P10mm","Varistor/RV_Disc_D21.5mm_W4.8mm_P10mm","Varistor/RV_Disc_D21.5mm_W4.9mm_P10mm","Varistor/RV_Disc_D21.5mm_W5.1mm_P10mm","Varistor/RV_Disc_D21.5mm_W5.3mm_P10mm","Varistor/RV_Disc_D21.5mm_W5.4mm_P10mm","Varistor/RV_Disc_D21.5mm_W5.6mm_P10mm","Varistor/RV_Disc_D21.5mm_W5.8mm_P10mm","Varistor/RV_Disc_D21.5mm_W5mm_P10mm","Varistor/RV_Disc_D21.5mm_W6.1mm_P7.5mm","Varistor/RV_Disc_D21.5mm_W6.3mm_P10mm","Varistor/RV_Disc_D21.5mm_W6.5mm_P10mm","Varistor/RV_Disc_D21.5mm_W6.7mm_P10mm","Varistor/RV_Disc_D21.5mm_W6.8mm_P10mm","Varistor/RV_Disc_D21.5mm_W7.1mm_P10mm","Varistor/RV_Disc_D21.5mm_W7.5mm_P10mm","Varistor/RV_Disc_D21.5mm_W7.9mm_P10mm","Varistor/RV_Disc_D21.5mm_W8.4mm_P10mm","Varistor/RV_Disc_D7mm_W3.4mm_P5mm","Varistor/RV_Disc_D7mm_W3.5mm_P5mm","Varistor/RV_Disc_D7mm_W3.6mm_P5mm","Varistor/RV_Disc_D7mm_W3.7mm_P5mm","Varistor/RV_Disc_D7mm_W3.8mm_P5mm","Varistor/RV_Disc_D7mm_W3.9mm_P5mm","Varistor/RV_Disc_D7mm_W4.2mm_P5mm","Varistor/RV_Disc_D7mm_W4.3mm_P5mm","Varistor/RV_Disc_D7mm_W4.5mm_P5mm","Varistor/RV_Disc_D7mm_W4.8mm_P5mm","Varistor/RV_Disc_D7mm_W4.9mm_P5mm","Varistor/RV_Disc_D7mm_W4mm_P5mm","Varistor/RV_Disc_D7mm_W5.1mm_P5mm","Varistor/RV_Disc_D7mm_W5.4mm_P5mm","Varistor/RV_Disc_D7mm_W5.5mm_P5mm","Varistor/RV_Disc_D7mm_W5.7mm_P5mm","Varistor/RV_Disc_D9mm_W3.3mm_P5mm","Varistor/RV_Disc_D9mm_W3.4mm_P5mm","Varistor/RV_Disc_D9mm_W3.5mm_P5mm","Varistor/RV_Disc_D9mm_W3.6mm_P5mm","Varistor/RV_Disc_D9mm_W3.7mm_P5mm","Varistor/RV_Disc_D9mm_W3.8mm_P5mm","Varistor/RV_Disc_D9mm_W3.9mm_P5mm","Varistor/RV_Disc_D9mm_W4.1mm_P5mm","Varistor/RV_Disc_D9mm_W4.2mm_P5mm","Varistor/RV_Disc_D9mm_W4.4mm_P5mm","Varistor/RV_Disc_D9mm_W4.5mm_P5mm","Varistor/RV_Disc_D9mm_W4.8mm_P5mm","Varistor/RV_Disc_D9mm_W4mm_P5mm","Varistor/RV_Disc_D9mm_W5.2mm_P5mm","Varistor/RV_Disc_D9mm_W5.4mm_P5mm","Varistor/RV_Disc_D9mm_W5.5mm_P5mm","Varistor/RV_Disc_D9mm_W5.7mm_P5mm","Varistor/RV_Disc_D9mm_W6.1mm_P5mm","Varistor/RV_Rect_V25S440P_L26.5mm_W8.2mm_P12.7mm","Varistor/Varistor_Panasonic_VF"];var wUo=Object.fromEntries(MUo.map((e)=>[e,`kicad:${e}`]));var gR=Pt(["vertical","horizontal","pos_top","pos_bottom","pos_left","pos_right","neg_top","neg_bottom","neg_left","neg_right"]).describe("horizontal means pins go 1->2 rightward and vertical means pins go 1->2 downward (generally, positive on top)");fn(!0);var BUo=we({pins:it(un([Ae(),k()])),direction:un([he("top-to-bottom"),he("left-to-right"),he("bottom-to-top"),he("right-to-left")])}),TUo=it(un([Ae(),k()])),r5e=(e)=>un([BUo,TUo]).transform((t)=>Array.isArray(t)?{pins:t,direction:e}:t),c5e=we({leftSize:Ae().optional().describe("@deprecated, use leftPinCount"),topSize:Ae().optional().describe("@deprecated, use topPinCount"),rightSize:Ae().optional().describe("@deprecated, use rightPinCount"),bottomSize:Ae().optional().describe("@deprecated, use bottomPinCount"),leftPinCount:Ae().optional(),rightPinCount:Ae().optional(),topPinCount:Ae().optional(),bottomPinCount:Ae().optional(),leftSide:r5e("top-to-bottom").optional(),rightSide:r5e("top-to-bottom").optional(),topSide:r5e("left-to-right").optional(),bottomSide:r5e("left-to-right").optional()}),h5e=c5e;fn(!0);var Nse=gs(we({marginLeft:Ke.optional(),marginRight:Ke.optional(),marginTop:Ke.optional(),marginBottom:Ke.optional(),leftMargin:Ke.optional(),rightMargin:Ke.optional(),topMargin:Ke.optional(),bottomMargin:Ke.optional()}));fn(!0);var Zm=k().regex(/^[A-Za-z0-9_]+$/),d5e=Pt(["xs","sm","default","md"]).or(Ke.pipe(Ae().finite())).describe("distance between pin1 and pin2 of the schematic symbol"),DUo=Pt(["input","output","bidirectional","tri_state","passive","free","unspecified","power_in","power_out","open_collector","open_emitter","no_connect"]),NUo=Pt(["line","inverted","clock","inverted_clock","input_low","clock_low","output_low","falling_edge_clock","nonlogic"]),RUo=we({electricalType:DUo.optional(),graphicStyle:NUo.optional(),pinLength:Hn.optional(),nameTextSize:Hn.optional(),numberTextSize:Hn.optional()});fn(!0);var QUo=Wa((e)=>typeof e==="function"),I7=Pt(["top_left","top_center","top_right","center_left","center","center_right","bottom_left","bottom_center","bottom_right"]),Rse=we({edit_event_id:k(),in_progress:Be().optional(),created_at:Ae()});fn(!0);var kUo=Rse.extend({pcb_edit_event_type:he("edit_component_location").describe("deprecated"),edit_event_type:he("edit_pcb_component_location"),pcb_component_id:k(),original_center:we({x:Ae(),y:Ae()}),new_center:we({x:Ae(),y:Ae()})});fn(!0);var LUo=Rse.extend({pcb_edit_event_type:he("edit_trace_hint").describe("deprecated"),edit_event_type:he("edit_pcb_trace_hint").optional(),pcb_port_id:k(),pcb_trace_hint_id:k().optional(),route:it(we({x:Ae(),y:Ae(),via:Be().optional()}))});fn(!0);var HUo=Rse.extend({edit_event_type:he("edit_schematic_component_location"),schematic_component_id:k(),original_center:we({x:Ae(),y:Ae()}),new_center:we({x:Ae(),y:Ae()})});fn(!0);var N9s=Rse.extend({edit_event_type:he("edit_pcb_group_location"),pcb_group_id:k(),original_center:we({x:Ae(),y:Ae()}),new_center:we({x:Ae(),y:Ae()})});fn(!0);var Q9s=Rse.extend({edit_event_type:he("edit_schematic_group_location"),schematic_group_id:k(),original_center:we({x:Ae(),y:Ae()}),new_center:we({x:Ae(),y:Ae()})});fn(!0);var L9s=un([kUo,LUo,HUo]);fn(!0);var FUo=we({selector:k(),relative_to:k().optional().default("group_center").describe("Can be a selector or 'group_center'"),center:Yo});fn(!0);var zUo=we({pcb_port_selector:k(),offsets:it(yf)});fn(!0);var OUo=we({selector:k(),relative_to:k().optional().default("group_center").describe("Can be a selector or 'group_center'"),center:Yo});fn(!0);var VUo=we({pcb_placements:it(FUo).optional(),manual_trace_hints:it(zUo).optional(),schematic_placements:it(OUo).optional()});fn(!0);var Wz=k().or(it(k()).readonly()).or(it(k())),w4=(e)=>gs(Pt(e),Wz),Mse=we({layoutMode:Pt(["grid","flex","match-adapt","relative","none"]).optional(),position:Pt(["absolute","relative"]).optional(),grid:Be().optional(),gridCols:Ae().or(k()).optional(),gridRows:Ae().or(k()).optional(),gridTemplateRows:k().optional(),gridTemplateColumns:k().optional(),gridTemplate:k().optional(),gridGap:Ae().or(k()).optional(),gridRowGap:Ae().or(k()).optional(),gridColumnGap:Ae().or(k()).optional(),flex:Be().or(k()).optional(),flexDirection:Pt(["row","column"]).optional(),alignItems:Pt(["start","center","end","stretch"]).optional(),justifyContent:Pt(["start","center","end","stretch","space-between","space-around","space-evenly"]).optional(),flexRow:Be().optional(),flexColumn:Be().optional(),gap:Ae().or(k()).optional(),pack:Be().optional().describe("Pack the contents of this group using a packing strategy"),packOrderStrategy:Pt(["largest_to_smallest","first_to_last","highest_to_lowest_pin_count"]).optional(),packPlacementStrategy:Pt(["shortest_connection_along_outline"]).optional(),padding:be.optional(),paddingLeft:be.optional(),paddingRight:be.optional(),paddingTop:be.optional(),paddingBottom:be.optional(),paddingX:be.optional(),paddingY:be.optional(),width:be.optional(),height:be.optional(),matchAdapt:Be().optional(),matchAdaptTemplate:Jh().optional()});fn(!0);var VBt=we({strokeWidth:be.optional(),dashed:Be().optional(),solid:Be().optional()}),YUo=Wa((e)=>typeof e==="string"),CTt=we({minTraceWidth:be.optional(),minViaHoleEdgeToViaHoleEdgeClearance:be.optional(),minViaEdgeToPadEdgeClearance:be.optional(),minPlatedHoleDrillEdgeToDrillEdgeClearance:be.optional(),minTraceToPadEdgeClearance:be.optional(),minTraceToHoleEdgeClearance:be.refine((e)=>Number.isFinite(e)&&e>=0,{message:"minTraceToHoleEdgeClearance must be finite and non-negative"}).optional(),minPadEdgeToPadEdgeClearance:be.optional(),minBoardEdgeClearance:be.optional(),minViaHoleDiameter:be.optional(),minViaPadDiameter:be.optional()}),bTt=we({serverUrl:ou.optional(),inputFormat:Pt(["simplified","circuit-json"]).optional(),serverMode:Pt(["job","solve-endpoint"]).optional(),serverCacheEnabled:Be().optional(),cache:Wa((e)=>!0).optional(),traceClearance:be.optional(),availableJumperTypes:it(Pt(["1206x4","0603"])).optional(),allowViaInPad:Be().optional().describe("Allows the autorouter to place vias inside connected pads. Omitted or false keeps via-in-pad routing disabled."),groupMode:Pt(["sequential_trace","subcircuit","sequential-trace"]).optional(),algorithmFn:Wa((e)=>typeof e==="function"||e===void 0).optional(),implicitBreakoutPointSolverFn:Wa((e)=>typeof e==="function"||e===void 0).optional(),preset:Pt(["sequential_trace","subcircuit","default","auto","auto_local","auto_cloud","auto_jumper","tscircuit_beta","krt","freerouting","simplify","laser_prefab","single_layer_fanout","fanout","dogbone","bus_lanes","single_layer_routing","auto-jumper","sequential-trace","auto-local","auto-cloud"]).transform((e)=>e==="single_layer_routing"?"bus_lanes":e).optional(),local:Be().optional()}),GUo=un([he("sequential_trace"),he("subcircuit"),he("default"),he("auto"),he("auto_local"),he("auto_cloud"),he("auto_jumper"),he("tscircuit_beta"),he("krt"),he("freerouting"),he("simplify"),he("laser_prefab"),he("single_layer_fanout"),he("fanout"),he("dogbone"),he("bus_lanes"),he("single_layer_routing").transform(()=>"bus_lanes"),he("auto-jumper"),he("sequential-trace"),he("auto-local"),he("auto-cloud")]),UUo=k(),u5e=un([bTt,GUo,UUo]),WUo=Pt(["1x","1.5x","2x","5x","10x","100x"]),ITt=Pt(["none","basic","conservative"]),XUo=Pt(["beta_pipeline1","beta_pipeline3","beta_pipeline4","beta_pipeline5","beta_pipeline7","beta_pipeline9","latest"]),jUo=Wa((e)=>typeof e==="string").transform((e)=>{let t=XUo.safeParse(e);if(t.success)return t.data;return console.warn(`Unknown autorouterVersion "${e}", falling back to "latest".`),"latest"}),qYe=l5e.extend({name:k().optional(),children:Jh().optional(),schTitle:k().optional(),schSheetName:k().optional().describe('This group will be drawn as part of this sheet e.g. "Main"'),key:Jh().optional(),showAsSchematicBox:Be().optional(),connections:gs(k(),Wz.optional()).optional(),schPinArrangement:h5e.optional(),schPinSpacing:be.optional(),schPinStyle:Nse.optional(),...Mse.shape,grid:Mse.shape.grid.describe("@deprecated use pcbGrid"),flex:Mse.shape.flex.describe("@deprecated use pcbFlex"),pcbGrid:Be().optional(),pcbGridCols:Ae().or(k()).optional(),pcbGridRows:Ae().or(k()).optional(),pcbGridTemplateRows:k().optional(),pcbGridTemplateColumns:k().optional(),pcbGridTemplate:k().optional(),pcbGridGap:Ae().or(k()).optional(),pcbGridRowGap:Ae().or(k()).optional(),pcbGridColumnGap:Ae().or(k()).optional(),pcbFlex:Be().or(k()).optional(),pcbFlexGap:Ae().or(k()).optional(),pcbFlexDirection:Pt(["row","column"]).optional(),pcbAlignItems:Pt(["start","center","end","stretch"]).optional(),pcbJustifyContent:Pt(["start","center","end","stretch","space-between","space-around","space-evenly"]).optional(),pcbFlexRow:Be().optional(),pcbFlexColumn:Be().optional(),pcbGap:Ae().or(k()).optional(),pcbPack:Be().optional(),pcbPackGap:Ae().or(k()).optional(),schGrid:Be().optional(),schGridCols:Ae().or(k()).optional(),schGridRows:Ae().or(k()).optional(),schGridTemplateRows:k().optional(),schGridTemplateColumns:k().optional(),schGridTemplate:k().optional(),schGridGap:Ae().or(k()).optional(),schGridRowGap:Ae().or(k()).optional(),schGridColumnGap:Ae().or(k()).optional(),schFlex:Be().or(k()).optional(),schFlexGap:Ae().or(k()).optional(),schFlexDirection:Pt(["row","column"]).optional(),schAlignItems:Pt(["start","center","end","stretch"]).optional(),schJustifyContent:Pt(["start","center","end","stretch","space-between","space-around","space-evenly"]).optional(),schFlexRow:Be().optional(),schFlexColumn:Be().optional(),schGap:Ae().or(k()).optional(),schPack:Be().optional(),schMatchAdapt:Be().optional(),pcbWidth:be.optional(),pcbHeight:be.optional(),minTraceWidth:be.optional(),nominalTraceWidth:be.optional(),schWidth:be.optional(),schHeight:be.optional(),pcbLayout:Mse.optional(),schLayout:Mse.optional(),cellBorder:VBt.nullable().optional(),border:VBt.nullable().optional(),schPadding:be.optional(),schPaddingLeft:be.optional(),schPaddingRight:be.optional(),schPaddingTop:be.optional(),schPaddingBottom:be.optional(),pcbPadding:be.optional(),pcbPaddingLeft:be.optional(),pcbPaddingRight:be.optional(),pcbPaddingTop:be.optional(),pcbPaddingBottom:be.optional(),pcbAnchorAlignment:YUo.optional()}),vTt=Wa((e)=>("findPart"in e)),p5e=qYe.extend({manualEdits:VUo.optional(),schAutoLayoutEnabled:Be().optional(),schTraceAutoLabelEnabled:Be().optional(),schMaxTraceDistance:Ke.optional(),routingDisabled:Be().optional(),placementDrcChecksDisabled:Be().optional(),bomDisabled:Be().optional(),defaultTraceWidth:be.optional(),...CTt.shape,nominalTraceWidth:be.optional(),partsEngine:vTt.optional(),_subcircuitCachingEnabled:Be().optional(),pcbRouteCache:Wa((e)=>!0).optional(),autorouter:u5e.optional(),preflightRoutingCheckPolicy:ITt.optional(),autorouterEffortLevel:WUo.optional(),autorouterVersion:jUo.optional(),square:Be().optional(),emptyArea:k().optional(),filledArea:k().optional(),width:Ke.optional(),height:Ke.optional(),outline:it(J1).optional(),outlineOffsetX:Ke.optional(),outlineOffsetY:Ke.optional(),circuitJson:it(Jh()).optional(),exposedNets:it(k()).optional(),exposeNets:Be().optional()}),KUo=p5e.extend({subcircuit:he(!0)}),STt=ss("subcircuit",[qYe.extend({subcircuit:he(!1).optional()}),KUo]);fn(!0);fn(!0);fn(!0);fn(!0);fn(!0);var gK=Wa((e)=>typeof e==="string"),$Uo=we({...J1.shape,isCastellatedHole:Be().optional(),holeDiameter:Hn.optional(),padDiameter:Hn.optional(),connectsTo:k().or(it(k())).optional()}).superRefine((e,t)=>{if(e.isCastellatedHole){if(e.holeDiameter===void 0)t.addIssue({code:Vt.custom,path:["holeDiameter"],message:"holeDiameter is required for a castellated hole"});if(e.padDiameter===void 0)t.addIssue({code:Vt.custom,path:["padDiameter"],message:"padDiameter is required for a castellated hole"});return}if(e.holeDiameter!==void 0||e.padDiameter!==void 0||e.connectsTo!==void 0)t.addIssue({code:Vt.custom,path:["isCastellatedHole"],message:"isCastellatedHole must be true when castellated hole props are provided"})}),JYe=p5e.omit({connections:!0}).extend({mountedTo:k().trim().min(1).optional().describe('e.g. "NEMA17.backface".'),mountGap:Hn.pipe(Ae().nonnegative().finite()).optional().describe('Clearance from the mounting face, e.g. "6mm".'),mountRotationAnchor:cUo.optional().describe('e.g. "J_USB" or "rightedge".'),mountRotation:aUo.optional().describe('e.g. "calc(NEMA17.wireside-90degcw)".'),mountOrientation:lUo.optional().describe('e.g. "top_layer_toward_mount_face".'),fabricatorPreset:Pt(["jlcpcb_economy","jlcpcb_standard","jlcpcb_economy_20260912","jlcpcb_standard_20260912"]).optional().describe("Fabricator preset, preserved as supplied. Omitted leaves the preset unset."),material:Pt(["fr4","fr1","flex"]).default("fr4"),layers:un([he(1),he(2),he(4),he(6),he(8),he(10)]).default(2),allowBlindAndBuriedVias:Be().default(!1).describe("Whether the autorouter may generate blind and buried vias. Defaults to false, which restricts newly generated vias to the full board stack."),routeRemaining:Be().optional().describe("Whether to route remaining unrouted connections after explicit routing phases. Boolean values are preserved; omitted leaves the setting unset. No aliases or prop conflicts are introduced, and existing boards require no migration."),defaultViaTenting:un([Be(),Pt(["both_sides","top_and_bottom_tented","top_tented","bottom_tented","exposed"])]).transform((e)=>{if(e===!0||e==="both_sides")return"top_and_bottom_tented";if(e===!1)return"exposed";return e}).optional(),borderRadius:Hn.optional(),thickness:Hn.optional(),boardAnchorPosition:J1.optional(),anchorAlignment:I7.optional(),boardAnchorAlignment:I7.optional().describe("Prefer using anchorAlignment when possible"),outline:it($Uo).optional(),title:k().optional(),solderMaskColor:gK.optional(),topSolderMaskColor:gK.optional(),bottomSolderMaskColor:gK.optional(),silkscreenColor:gK.optional(),topSilkscreenColor:gK.optional(),bottomSilkscreenColor:gK.optional(),doubleSidedAssembly:Be().optional().default(!1),isViaInPadAllowed:Be().optional().describe("Allows intentional via-in-pad designs to pass DRC. Omitted or false keeps via-in-pad disallowed."),automaticPoursEnabled:Be().default(!1).describe("Whether implicit copper pours should be generated automatically. Defaults to false."),enableViaStitching:Be().default(!1).describe("Whether to stitch copper pours on the same net across layers with vias. Defaults to false."),viaStitchPitch:Hn.pipe(Ae().positive().finite()).optional().describe("Positive center-to-center stitching via spacing in millimeters or a unit string, parsed to millimeters. Omitted uses the solver default. Does not enable stitching by itself."),schematicDisabled:Be().optional()});fn(!0);fn(!0);var i5e=Hn.pipe(Ae().finite()),PTt=we({name:k().optional(),x1:i5e,y1:i5e,x2:i5e,y2:i5e,bendAngle:ei.pipe(Ae().finite()),bendRadius:Hn.pipe(Ae().finite().positive()),tearReliefRadius:Hn.pipe(Ae().finite().positive()).optional(),bendSide:Pt(["left","right"])}).refine(({x1:e,y1:t,x2:n,y2:o})=>e!==n||t!==o,{message:"Bend centerline endpoints must be distinct",path:["x2"]});fn(!0);var YBt=Hn.pipe(Ae().finite()),HYe=Hn.pipe(Ae().finite().positive()),FYe=ws.omit({layer:!0}).extend({name:k().optional(),layer:Pt(["top","bottom"])}),ETt=ss("shape",[FYe.extend({shape:he("rect"),width:HYe,height:HYe,radius:sm().optional(),points:sm().optional()}),FYe.extend({shape:he("circle"),radius:HYe,width:sm().optional(),height:sm().optional(),points:sm().optional()}),FYe.extend({shape:he("polygon"),points:it(we({x:YBt,y:YBt})).min(3).refine((e)=>{let t=e.reduce((n,o,r)=>{let i=e[(r+1)%e.length];return n+o.x*i.y-i.x*o.y},0);return Number.isFinite(t)&&t!==0},"Solder-mask opening must enclose a nonzero area"),width:sm().optional(),height:sm().optional(),radius:sm().optional()})]),GYe=Hn.pipe(Ae().finite().positive()),GBt=Hn.pipe(Ae().finite()),UBt=ws.omit({layer:!0}).extend({name:k().optional(),layer:Pt(["top","bottom"]),material:Pt(["fr4","polyimide","stainless_steel","aluminum"]),thickness:GYe,adhesiveThickness:Hn.pipe(Ae().finite().nonnegative()).optional()}),MTt=ss("shape",[UBt.extend({shape:he("rect"),width:GYe,height:GYe,outline:sm().optional()}),UBt.extend({shape:he("polygon"),outline:it(we({x:GBt,y:GBt})).min(3).refine((e)=>{let t=e.reduce((n,o,r)=>{let i=e[(r+1)%e.length];return n+o.x*i.y-i.x*o.y},0);return Number.isFinite(t)&&t!==0},"Stiffener outline must enclose a nonzero area"),width:sm().optional(),height:sm().optional()})]),ZYe=qYe.omit({width:!0,height:!0,layoutMode:!0,children:!0}).extend({width:Hn.optional(),height:Hn.optional(),children:Jh().optional(),anchorAlignment:I7.optional(),noSolderMask:Be().optional(),panelizationMethod:Pt(["tab-routing","outline_routing","none"]).optional(),boardGap:Hn.optional(),layoutMode:Pt(["grid","pack","none"]).optional(),row:Ae().optional(),col:Ae().optional(),cellWidth:Hn.optional(),cellHeight:Hn.optional(),tabWidth:Hn.optional(),tabLength:Hn.optional(),mouseBites:Be().optional(),edgePadding:Hn.optional(),edgePaddingLeft:Hn.optional(),edgePaddingRight:Hn.optional(),edgePaddingTop:Hn.optional(),edgePaddingBottom:Hn.optional(),_subcircuitCachingEnabled:Be().optional()});fn(!0);var wTt=ZYe;fn(!0);var s5e=Hn.refine(Number.isFinite,"Coordinate must be finite"),zYe=Hn.refine((e)=>Number.isFinite(e)&&e>0,"Distance must be positive and finite"),qUo=ss("route_type",[we({route_type:he("wire"),x:s5e,y:s5e,width:zYe,width_interpolation_mode:Pt(["linear","quadratic"]).optional().describe("Interpolate width from this point to the next wire point."),layer:Bo}),we({route_type:he("via"),x:s5e,y:s5e,from_layer:Bo,to_layer:Bo,via_diameter:zYe.optional(),via_hole_diameter:zYe.optional()})]),Qse=we({connection:k().min(1),route:it(qUo).min(2).superRefine((e,t)=>{let n=e[0],o=n?.route_type==="via"?n.from_layer:n?.layer;for(let[r,i]of e.entries()){if(i.route_type==="wire"&&i.width_interpolation_mode){let s=e[r+1];if(s?.route_type!=="wire"||s.layer!==i.layer||s.x===i.x&&s.y===i.y)t.addIssue({code:"custom",path:[r,"width_interpolation_mode"],message:"Width interpolation requires a distinct next wire point on the same layer"})}if((i.route_type==="wire"?i.layer:i.from_layer)!==o)t.addIssue({code:"custom",message:"A fanout trace path must use vias for layer changes"});if(i.route_type==="via")o=i.to_layer}})}),wse=Hn.refine((e)=>e>=0,{message:"Fanout boundary padding cannot be negative"}),JUo=un([wse,we({top:wse.optional(),right:wse.optional(),bottom:wse.optional(),left:wse.optional()})]);fn(!0);var eGe=["topside_left","topside_center","topside_right","rightside_top","rightside_center","rightside_bottom","bottomside_right","bottomside_center","bottomside_left","leftside_bottom","leftside_center","leftside_top","center"],WBt=Pt(eGe),ZUo=un([I7,WBt,we({direction:un([I7,WBt])})]),BTt=we({busFanoutDirections:gs(ZUo).optional(),fanoutBoundaryPadding:JUo.optional(),fanoutRoutingLayers:it(Bo).min(1).optional(),fanoutPourNetMap:gs(Bo,un([k(),it(k()).min(1)])).optional()});fn(!0);var eWo=Hn.refine((e)=>e>=0,{message:"Fanout margin cannot be negative"}),TTt=p5e.extend({autorouter:u5e.default("fanout"),pcbTracePaths:it(Qse).optional(),padding:Hn.optional(),paddingLeft:Hn.optional(),paddingRight:Hn.optional(),paddingTop:Hn.optional(),paddingBottom:Hn.optional(),fanoutMargin:eWo.optional(),...BTt.shape});fn(!0);var tWo=k().or(it(k()).readonly()).or(it(k())),NTt=it(Zm).readonly().or(it(Zm)),nWo=Wa().pipe(gs(k(),tWo)),oWo=Wa((e)=>!!e&&typeof e==="object"&&("type"in e)&&("props"in e)),rWo=Wa((e)=>DTt.isValidElement(e)&&e.type==="internalcircuit"),tGe=gs(Zm,Zm.or(it(Zm).readonly()).or(it(Zm)));fn(!0);var iWo=we({manufacturerPartNumber:k().optional(),supplierPartNumber:gs(K8,it(k())).optional()}),M2=ru.extend({manufacturerPartNumber:k().optional(),pinLabels:tGe.optional(),showPinAliases:Be().optional(),pcbPinLabels:gs(k(),k()).optional(),internallyConnectedPins:it(it(un([k(),Ae()]))).optional(),externallyConnectedPins:it(it(k())).optional(),schPinArrangement:c5e.optional(),schPortArrangement:c5e.optional(),pinCompatibleVariants:it(iWo).optional(),schPinStyle:Nse.optional(),schPinSpacing:Ke.optional(),schWidth:Ke.optional(),schHeight:Ke.optional(),noSchematicRepresentation:Be().optional(),schShowInternalCircuit:Be().optional().default(!1),noConnect:NTt.optional(),connections:nWo.optional(),spiceModel:oWo.optional(),internalCircuit:rWo.optional()});fn(!0);var RTt=M2;fn(!0);var nGe=ru.extend({manufacturerPartNumber:k().optional(),pinLabels:gs(Ae().or(Zm),Zm.or(it(Zm))).optional(),schPinStyle:Nse.optional(),schPinSpacing:Ke.optional(),schWidth:Ke.optional(),schHeight:Ke.optional(),schDirection:Pt(["left","right"]).optional(),schPinArrangement:h5e.optional(),schPortArrangement:c5e.optional(),pcbPinLabels:gs(k(),k()).optional(),pinCount:un([he(2),he(3)]).optional(),internallyConnectedPins:it(it(un([k(),Ae()]))).optional(),connections:Wa().pipe(gs(k(),Wz)).optional()});fn(!0);var QTt=nGe.extend({bridgedPins:it(it(k())).optional(),bridged:Be().optional()});fn(!0);var sWo=Pt(["usb_c","m2","jst_sh","jst_gh","jst_zh","jst_ph","jst_xh","jst_vh"]),kTt=M2.extend({standard:sWo.optional(),pinCount:Ae().int().positive().optional()});fn(!0);var LTt=ru.extend({standard:Pt(["TSC0001_36P_XALT_2025_11","0805","0603","1206"]).optional(),pinLabels:gs(Ae().or(Zm),Zm.or(it(Zm))).optional(),internallyConnectedPins:it(it(un([k(),Ae()]))).optional()});fn(!0);var HTt=ru.extend({currentRating:un([Ae(),k()]),voltageRating:un([Ae(),k()]).optional(),schShowRatings:Be().optional(),schOrientation:gR.optional(),connections:gs(k(),un([k(),it(k()).readonly(),it(k())])).optional()}),aWo="0.04in",cWo="0.1in",lWo=(e)=>{if(!e||typeof e!=="object")return e;let t={...e};if(t.shape!==void 0)return t;if(t.padOutline!==void 0)return t.shape="hole_with_polygon_pad",t;if(t.rectPadWidth!==void 0||t.rectPadHeight!==void 0){if(t.holeDiameter!==void 0)return t.shape="circular_hole_with_rect_pad",t;return t.shape="pill_hole_with_rect_pad",t}if(t.outerDiameter!==void 0||t.holeDiameter!==void 0||t.padDiameter!==void 0)return t.shape="circle",t;if(t.outerWidth!==void 0||t.outerHeight!==void 0)return t.shape=t.rectPad===!0?"pill":"oval",t;return t.shape="circle",t.holeDiameter=aWo,t.outerDiameter=cWo,t},a5e=Wa().transform((e)=>{if(e===void 0)return;return Ke.parse(e)}),hWo=ss("shape",[ws.omit({pcbRotation:!0,layer:!0}).extend({name:k().optional(),connectsTo:k().or(it(k())).optional(),shape:he("circle"),holeDiameter:Ke,outerDiameter:Ke,padDiameter:Ke.optional().describe("Diameter of the copper pad"),portHints:jC.optional(),solderMaskMargin:Ke.optional(),coveredWithSolderMask:Be().optional()}),ws.omit({layer:!0}).extend({name:k().optional(),connectsTo:k().or(it(k())).optional(),shape:he("oval"),outerWidth:Ke,outerHeight:Ke,holeWidth:a5e,holeHeight:a5e,innerWidth:Ke.optional().describe("DEPRECATED use holeWidth"),innerHeight:Ke.optional().describe("DEPRECATED use holeHeight"),portHints:jC.optional(),solderMaskMargin:Ke.optional(),coveredWithSolderMask:Be().optional()}),ws.omit({layer:!0}).extend({name:k().optional(),connectsTo:k().or(it(k())).optional(),shape:he("pill"),rectPad:Be().optional(),outerWidth:Ke,outerHeight:Ke,holeWidth:a5e,holeHeight:a5e,innerWidth:Ke.optional().describe("DEPRECATED use holeWidth"),innerHeight:Ke.optional().describe("DEPRECATED use holeHeight"),portHints:jC.optional(),holeOffsetX:Ke.optional(),holeOffsetY:Ke.optional(),solderMaskMargin:Ke.optional(),coveredWithSolderMask:Be().optional()}),ws.omit({layer:!0}).extend({name:k().optional(),connectsTo:k().or(it(k())).optional(),shape:he("circular_hole_with_rect_pad"),holeDiameter:Ke,rectPadWidth:Ke,rectPadHeight:Ke,rectBorderRadius:Ke.optional(),holeShape:he("circle").optional(),padShape:he("rect").optional(),portHints:jC.optional(),holeOffsetX:Ke.optional(),holeOffsetY:Ke.optional(),solderMaskMargin:Ke.optional(),coveredWithSolderMask:Be().optional()}),ws.omit({layer:!0}).extend({name:k().optional(),connectsTo:k().or(it(k())).optional(),shape:he("pill_hole_with_rect_pad"),holeShape:he("pill").optional(),padShape:he("rect").optional(),holeWidth:Ke,holeHeight:Ke,rectPadWidth:Ke,rectPadHeight:Ke,rectBorderRadius:Ke.optional(),portHints:jC.optional(),holeOffsetX:Ke.optional(),holeOffsetY:Ke.optional(),solderMaskMargin:Ke.optional(),coveredWithSolderMask:Be().optional()}),ws.omit({pcbRotation:!0,layer:!0}).extend({name:k().optional(),connectsTo:k().or(it(k())).optional(),shape:he("hole_with_polygon_pad"),holeShape:Pt(["circle","oval","pill","rotated_pill"]),holeDiameter:Ke.optional(),holeWidth:Ke.optional(),holeHeight:Ke.optional(),padOutline:it(J1),holeOffsetX:Ke,holeOffsetY:Ke,portHints:jC.optional(),solderMaskMargin:Ke.optional(),coveredWithSolderMask:Be().optional()})]).transform((e)=>{if("innerWidth"in e&&e.innerWidth!==void 0)e.holeWidth??=e.innerWidth;if("innerHeight"in e&&e.innerHeight!==void 0)e.holeHeight??=e.innerHeight;return e}),FTt=are(lWo,hWo);fn(!0);var dWo=["pin1","pin2","pos","neg"],uWo=new Set(["01005","0201","0402","0504","0603","0805","1206","1210","1812","2010","2512"]),pWo=(e)=>{if(typeof e!=="string")return e;if(!uWo.has(e))return e;return`res${e}`},mWo=jYe.optional().transform(pWo),zTt=ru.extend({footprint:mWo,resistance:mx,tolerance:un([k(),Ae()]).transform((e)=>{if(typeof e==="string"){if(e.endsWith("%"))return parseFloat(e.slice(0,-1))/100;return parseFloat(e)}return e}).pipe(Ae().min(0,"Tolerance must be non-negative").max(1,"Tolerance cannot be greater than 100%")).optional(),pullupFor:k().optional(),pullupTo:k().optional(),pulldownFor:k().optional(),pulldownTo:k().optional(),schOrientation:gR.optional(),schSize:d5e.optional(),connections:w4(dWo).optional()}),OTt=xTt;fn(!0);var _Wo=["pin1","pin2","pin3"],VTt=ru.extend({maxResistance:mx,pinVariant:Pt(["two_pin","three_pin"]).optional(),connections:w4(_Wo).optional()});fn(!0);var gWo=["pin1","left","pin2","right","pin3","pin4"],YTt=ru.extend({frequency:mp,loadCapacitance:MI,maxTraceLength:Ke.optional(),manufacturerPartNumber:k().optional(),pinVariant:Pt(["two_pin","four_pin"]).optional(),schOrientation:gR.optional(),connections:w4(gWo).optional()});fn(!0);var GTt=ru.extend({frequency:mp,loadCapacitance:MI,pinVariant:Pt(["no_ground","ground_pin","two_ground_pins"]).optional()});fn(!0);var Ivs=JYe.extend({leftPinCount:Ae().optional(),rightPinCount:Ae().optional(),topPinCount:Ae().optional(),bottomPinCount:Ae().optional(),leftPins:it(k()).optional(),rightPins:it(k()).optional(),topPins:it(k()).optional(),bottomPins:it(k()).optional(),pinPitch:Ke.optional(),innerHoles:Be().optional()});fn(!0);var AWo=["pin1","pin2","pos","neg","anode","cathode"],UTt=ru.extend({capacitance:MI,maxVoltageRating:Xl.optional(),schShowRatings:Be().optional().default(!1),polarized:Be().optional().default(!1),decouplingFor:k().optional(),decouplingTo:k().optional(),bypassFor:k().optional(),bypassTo:k().optional(),maxDecouplingTraceLength:Ke.optional(),schOrientation:gR.optional(),schSize:d5e.optional(),connections:w4(AWo).optional()}),WTt=Dse;fn(!0);var XTt=we({name:k(),connectsTo:k().or(it(k())).optional(),routingPhaseIndex:Ae().nullable().optional(),highlightColor:k().optional(),isPowerNet:Be().optional(),isGroundNet:Be().optional(),nominalTraceWidth:Ke.optional()});fn(!0);var m5e=ru.extend({soldermaskPullback:Hn.optional(),padDiameter:Hn});fn(!0);var wvs=we({name:k().optional(),pcbOnly:Be().optional(),schOnly:Be().optional()});fn(!0);var fWo=we({pcb:he(!0).optional(),xDist:Hn,left:k(),right:k(),edgeToEdge:he(!0).optional(),centerToCenter:he(!0).optional()});fn(!0);var yWo=we({pcb:he(!0).optional(),yDist:Hn,top:k(),bottom:k(),edgeToEdge:he(!0).optional(),centerToCenter:he(!0).optional()});fn(!0);var xWo=we({pcb:he(!0).optional(),sameY:he(!0).optional(),for:it(k())});fn(!0);var CWo=we({pcb:he(!0).optional(),sameX:he(!0).optional(),for:it(k())});fn(!0);var jTt=un([fWo,yWo,xWo,CWo]);fn(!0);var bWo=ws.omit({layer:!0,pcbRotation:!0}).extend({name:k().optional(),shape:he("rect"),width:Hn,height:Hn});fn(!0);var IWo=ws.omit({layer:!0,pcbRotation:!0}).extend({name:k().optional(),shape:he("circle"),radius:Hn});fn(!0);var vWo=ws.omit({layer:!0,pcbRotation:!0}).extend({name:k().optional(),shape:he("polygon"),points:it(J1)});fn(!0);var KTt=ss("shape",[bWo,IWo,vWo]),$Tt=we({name:k().optional(),checkFn:QUo});fn(!0);var SWo=ws.omit({pcbRotation:!0}).extend({name:k().optional(),shape:he("rect"),width:Hn,height:Hn,rectBorderRadius:Hn.optional(),cornerRadius:Hn.optional(),portHints:jC.optional(),coveredWithSolderMask:Be().optional(),solderMaskMargin:Hn.optional(),solderMaskMarginLeft:Hn.optional(),solderMaskMarginRight:Hn.optional(),solderMaskMarginTop:Hn.optional(),solderMaskMarginBottom:Hn.optional(),noSolderPaste:Be().optional(),solderPasteMargin:Hn.optional()});fn(!0);var PWo=ws.omit({pcbRotation:!0}).extend({name:k().optional(),shape:he("rotated_rect"),width:Hn,height:Hn,ccwRotation:Ae(),cornerRadius:Hn.optional(),portHints:jC.optional(),coveredWithSolderMask:Be().optional(),solderMaskMargin:Hn.optional(),solderMaskMarginLeft:Hn.optional(),solderMaskMarginRight:Hn.optional(),solderMaskMarginTop:Hn.optional(),solderMaskMarginBottom:Hn.optional(),noSolderPaste:Be().optional(),solderPasteMargin:Hn.optional()});fn(!0);var EWo=ws.omit({pcbRotation:!0}).extend({name:k().optional(),shape:he("circle"),radius:Hn,portHints:jC.optional(),coveredWithSolderMask:Be().optional(),solderMaskMargin:Hn.optional(),noSolderPaste:Be().optional(),solderPasteMargin:Hn.optional()});fn(!0);var MWo=ws.omit({pcbRotation:!0}).extend({name:k().optional(),shape:he("pill"),width:Hn,height:Hn,radius:Hn,portHints:jC.optional(),coveredWithSolderMask:Be().optional(),solderMaskMargin:Hn.optional(),noSolderPaste:Be().optional(),solderPasteMargin:Hn.optional()});fn(!0);var wWo=ws.omit({pcbRotation:!0}).extend({name:k().optional(),shape:he("rotated_pill"),width:Hn,height:Hn,radius:Hn,ccwRotation:Ae(),portHints:jC.optional(),coveredWithSolderMask:Be().optional(),solderMaskMargin:Hn.optional(),noSolderPaste:Be().optional(),solderPasteMargin:Hn.optional()});fn(!0);var BWo=ws.omit({pcbRotation:!0}).extend({name:k().optional(),shape:he("polygon"),points:it(J1),portHints:jC.optional(),coveredWithSolderMask:Be().optional(),solderMaskMargin:Hn.optional(),noSolderPaste:Be().optional(),solderPasteMargin:Hn.optional()});fn(!0);var qTt=ss("shape",[EWo,SWo,PWo,MWo,wWo,BWo]);fn(!0);var TWo=ws.omit({pcbRotation:!0}).extend({shape:he("rect"),width:Hn,height:Hn});fn(!0);var DWo=ws.omit({pcbRotation:!0}).extend({shape:he("circle"),radius:Hn});fn(!0);var JTt=un([DWo,TWo]);fn(!0);var NWo=ws.extend({name:k().optional(),shape:he("circle").optional(),diameter:Hn.optional(),radius:Hn.optional(),solderMaskMargin:Hn.optional(),coveredWithSolderMask:Be().optional()}).transform((e)=>({...e,diameter:e.diameter??2*e.radius,radius:e.radius??e.diameter/2})),RWo=ws.extend({name:k().optional(),shape:he("pill"),width:Hn,height:Hn,solderMaskMargin:Hn.optional(),coveredWithSolderMask:Be().optional()}),QWo=ws.extend({name:k().optional(),shape:he("oval"),width:Hn,height:Hn,solderMaskMargin:Hn.optional(),coveredWithSolderMask:Be().optional()}),kWo=ws.extend({name:k().optional(),shape:he("rect"),width:Hn,height:Hn,solderMaskMargin:Hn.optional(),coveredWithSolderMask:Be().optional()}),ZTt=un([NWo,RWo,QWo,kWo]);fn(!0);var LWo=["2.4ghz_quarter_wave_monopole","2.4ghz_meandered_monopole","2.4ghz_inverted_f","2.4ghz_meandered_inverted_f","2.4ghz_folded_dipole"],HWo=Pt(LWo),FWo=["2.4ghz","5ghz","6ghz","dual_band_2.4ghz_5ghz","tri_band_2.4ghz_5ghz_6ghz"],zWo=Pt(FWo),eDt=ru.extend({antennaShape:HWo.optional(),frequencyBand:zWo.optional(),pcbPath:YYe.optional()});fn(!0);var Bse=un([k(),Wa((e)=>typeof e==="object"&&e!==null&&("getPortSelector"in e)&&typeof e.getPortSelector==="function")]),OYe=we({key:k().optional(),name:k().optional(),displayName:k().optional(),thickness:Ke.optional(),width:Ke.optional().describe("Alias for trace thickness"),schematicRouteHints:it(J1).optional(),pcbRouteHints:it(yf).optional(),pcbTeardrops:Be().optional().describe("Enable PCB trace teardrops."),pcbTeardropStart:Be().optional().describe("Teardrop at the start (from) of trace"),pcbTeardropEnd:Be().optional().describe("Teardrop at the end (to) of trace"),pcbPathRelativeTo:k().optional(),pcbPath:YYe.optional(),pcbPaths:it(YYe).optional(),routingPhaseIndex:Ae().nullable().optional(),pcbStraightLine:Be().optional().describe("Draw a straight pcb trace between the connected points"),schDisplayLabel:k().optional(),schStroke:k().optional(),highlightColor:k().optional(),maxLength:Ke.optional(),maxViaCount:Ae().int().nonnegative().optional().describe("Maximum number of vias allowed in the PCB trace route"),connectsTo:k().or(it(k())).optional()}),tDt=un([OYe.extend({path:it(Bse)}),OYe.extend({from:Bse,to:Bse}),OYe.extend({start:Bse,end:Bse})]),oGe=Ke.pipe(Ae().nonnegative().finite()),fK=un([oGe,we({reference:he("longest_manhattan"),of:it(k().min(1)).min(1).optional(),offset:Ke.pipe(Ae().finite()).optional()}).strict()]);fn(!0);function nDt(e,t){if(Boolean(e.targetLength!==void 0)!==Boolean(e.lengthTolerance!==void 0))t.addIssue({code:Vt.custom,path:["lengthTolerance"],message:"targetLength and lengthTolerance must be supplied together"});if(e.lengthMatchTo!==void 0&&e.maxLengthSkew===void 0)t.addIssue({code:Vt.custom,path:["maxLengthSkew"],message:"lengthMatchTo requires an explicit maxLengthSkew"});let n=(s)=>typeof s==="number"?{basis:"absolute",amount:s}:{basis:JSON.stringify([s.reference,s.of?[...s.of].sort():null]),amount:s.offset??0},o=e.minLength===void 0?void 0:n(e.minLength),r=e.maxLength===void 0?void 0:n(e.maxLength),i=e.targetLength===void 0?void 0:n(e.targetLength);if(o&&r&&o.basis===r.basis&&o.amount>r.amount)t.addIssue({code:Vt.custom,path:["maxLength"],message:"maxLength cannot be below minLength for the same reference"});if(i&&o&&i.basis===o.basis&&i.amount+(e.lengthTolerance??0)<o.amount||i&&r&&i.basis===r.basis&&i.amount-(e.lengthTolerance??0)>r.amount)t.addIssue({code:Vt.custom,path:["targetLength"],message:"targetLength tolerance window does not intersect the declared length bounds"})}var oDt=un([k().min(1),it(k().min(1)).min(1)]),OWo=k().regex(/^\s*(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?\s*w\s*$/i).transform((e)=>({widthMultiplier:Number(e.trim().replace(/w$/i,""))})).pipe(we({widthMultiplier:Ae().positive().finite()})),VWo=Ke.pipe(Ae().positive().finite()),UYe=un([OWo,VWo]);fn(!0);var Tse=un([Ae(),k().refine((e)=>!/(?:±|\+\/-)/.test(e),"Use a scalar impedance for explicit bounds")]).pipe(mx).pipe(Ae().positive().finite()),XBt=/^([+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?)\s*(.*?)$/i,YWo=k().regex(/(?:±|\+\/-)/).transform((e,t)=>{let n=e.trim().split(/\s*(?:±|\+\/-)\s*/),o=n.length===2?n[0].match(XBt):null,r=n.length===2?n[1].match(XBt):null;if(!o||!r)return t.addIssue({code:Vt.custom,message:"Use a nominal impedance ± an absolute ohm tolerance"}),$ge;let i=/^(?:[yzafpnumkKMGTPEZYµμ])?(?:ohms?|Ω)$/i;if(o[2]&&!i.test(o[2])||r[2]&&!i.test(r[2]))return t.addIssue({code:Vt.custom,message:"Use an absolute ohm tolerance, not a percentage or another unit"}),$ge;let s=mx.safeParse(`${o[1]}${o[2]||r[2]||"ohm"}`),a=mx.safeParse(`${r[1]}${r[2]||o[2]||"ohm"}`);if(!s.success||!a.success||!Number.isFinite(s.data)||!Number.isFinite(a.data)||s.data<=0||a.data<0)return t.addIssue({code:Vt.custom,message:"Nominal impedance must be positive and tolerance nonnegative, in ohms"}),$ge;return{nominal:s.data,min:s.data-a.data,max:s.data+a.data}}).pipe(we({nominal:Ae().positive().finite(),min:Ae().positive().finite(),max:Ae().positive().finite()})),GWo=Tse,rDt=un([YWo,GWo]);fn(!0);function iDt(e,t,n,o,r){if(t!==void 0&&n!==void 0&&t>n)o.addIssue({code:Vt.custom,path:[`${r}Max`],message:"Maximum impedance cannot be below minimum impedance"});if(typeof e==="object"){for(let[i,s,a]of[["Min",t,e.min],["Max",n,e.max]])if(s!==void 0&&Math.abs(s-a)>0.000000001*Math.max(1,Math.abs(a)))o.addIssue({code:Vt.custom,path:[`${r}${i}`],message:"Explicit impedance bound conflicts with the target tolerance"})}else if(e!==void 0&&(t!==void 0&&e<t||n!==void 0&&e>n))o.addIssue({code:Vt.custom,path:[r],message:"Target impedance must lie within its declared bounds"})}var sDt=we({name:k().optional(),lengthMatchTo:oDt.optional(),minLength:fK.optional(),maxLength:fK.optional(),targetLength:fK.optional(),lengthTolerance:oGe.optional(),pcbTraceSpacing:UYe.optional(),pcbSpacingToOtherSignals:UYe.optional(),connections:it(k()).min(1),routingPhaseIndex:Ae().nullable().optional(),maxLengthSkew:Ke.pipe(Ae().min(0).finite()).optional(),targetImpedance:rDt.optional(),targetImpedanceMin:Tse.optional(),targetImpedanceMax:Tse.optional(),pcbTraceWidth:Ke.pipe(Ae().positive().finite()).optional(),pcbAllowedLayers:it(Bo).min(1).optional(),preferredLayer:Bo.optional(),preferredLayers:it(Bo).min(1).optional()}).superRefine((e,t)=>{nDt(e,t),iDt(e.targetImpedance,e.targetImpedanceMin,e.targetImpedanceMax,t,"targetImpedance")}).transform(({targetImpedance:e,...t})=>{if(e===void 0)return t;if(typeof e==="number")return{...t,targetImpedance:e};return{...t,targetImpedance:e.nominal,targetImpedanceMin:e.min,targetImpedanceMax:e.max}});fn(!0);var aDt=we({name:k().optional(),lengthMatchTo:oDt.optional(),minLength:fK.optional(),maxLength:fK.optional(),targetLength:fK.optional(),lengthTolerance:oGe.optional(),pcbSpacingToOtherSignals:UYe.optional(),positiveConnection:k(),negativeConnection:k(),maxLengthSkew:Ke.pipe(Ae().min(0).finite()).optional(),targetDifferentialImpedance:rDt.optional(),targetDifferentialImpedanceMin:Tse.optional(),targetDifferentialImpedanceMax:Tse.optional(),pcbTraceGap:Ke.pipe(Ae().positive().finite()).optional(),maxUncoupledLength:Ke.pipe(Ae().min(0).finite()).optional()}).superRefine((e,t)=>{nDt(e,t),iDt(e.targetDifferentialImpedance,e.targetDifferentialImpedanceMin,e.targetDifferentialImpedanceMax,t,"targetDifferentialImpedance")}).transform(({targetDifferentialImpedance:e,...t})=>{if(e===void 0)return t;if(typeof e==="number")return{...t,targetDifferentialImpedance:e};return{...t,targetDifferentialImpedance:e.nominal,targetDifferentialImpedanceMin:e.min,targetDifferentialImpedanceMax:e.max}});fn(!0);var jBt=Pt(["from_left","from_right","from_top","from_bottom","from_above","from_below","from_x_neg","from_x_pos","from_y_pos","from_y_neg","from_z_pos","from_z_neg","from_front","from_back"]);fn(!0);var cDt=we({children:Jh().optional(),name:k().optional(),originalLayer:Bo.default("top").optional(),circuitJson:it(Jh()).optional(),src:jYe.describe("Can be a footprint or kicad string").optional(),insertionDirection:jBt.optional().describe("Direction a cable or mating part is attached from, named for the side of the footprint it approaches from, in its unrotated orientation."),cutoutApertureDirection:jBt.optional().describe("Direction the part's enclosure opening faces, in its unrotated orientation. Distinct from insertionDirection: a side-actuated switch is installed from above and actuated from the side. Falls back to insertionDirection when absent.")});fn(!0);var lDt=we({originalFacingDirection:Pt(["up","down","left","right"]).default("right").optional(),width:Hn.optional(),height:Hn.optional(),fit:Pt(["fill","contain","stretch"]).optional(),viewbox:we({minX:Hn,maxX:Hn,minY:Hn,maxY:Hn}).refine((e)=>e.maxX>e.minX,{message:"viewbox maxX must exceed minX",path:["maxX"]}).refine((e)=>e.maxY>e.minY,{message:"viewbox maxY must exceed minY",path:["maxY"]}).optional(),name:k().optional()});fn(!0);var UWo=Ae().or(k().endsWith("mAh")).transform((e)=>{if(typeof e==="string"){let t=e.replace("mAh",""),n=Number.parseFloat(t);if(Number.isNaN(n))throw Error("Invalid capacity");return n}return e}).describe("Battery capacity in mAh"),WWo=Dse,hDt=ru.extend({capacity:UWo.optional(),voltage:Xl.optional(),standard:Pt(["AA","AAA","9V","CR2032","18650","C"]).optional(),schOrientation:gR.optional(),connections:w4(WWo).optional()});fn(!0);var dDt=p5e.extend({mpn:M2.shape.mpn,mfn:M2.shape.mfn,manufacturerPartNumber:M2.shape.manufacturerPartNumber,pinLabels:M2.shape.pinLabels,showPinAliases:M2.shape.showPinAliases,pcbPinLabels:M2.shape.pcbPinLabels,schPortArrangement:M2.shape.schPortArrangement,pinCompatibleVariants:M2.shape.pinCompatibleVariants,noSchematicRepresentation:M2.shape.noSchematicRepresentation,internallyConnectedPins:M2.shape.internallyConnectedPins,externallyConnectedPins:M2.shape.externallyConnectedPins,boardToBoardDistance:Hn.optional(),mountOrientation:Pt(["faceDown","faceUp"]).optional()});fn(!0);var XWo=Pt(["vertical","horizontal"]).describe("vertical means pins go 1->2 downward and horizontal means pins go 1->2 rightward");fn(!0);var uDt=ru.extend({pinCount:Ae(),pitch:Ke.optional(),schFacingDirection:Pt(["up","down","left","right"]).optional(),gender:Pt(["male","female"]).optional().default("male"),showSilkscreenPinLabels:Be().optional(),pcbPinLabels:gs(k(),k()).optional(),doubleRow:Be().optional(),rightAngle:Be().optional(),pcbOrientation:XWo.optional(),holeDiameter:Ke.optional(),platedDiameter:Ke.optional(),pinLabels:gs(k(),Zm).or(it(Zm)).optional(),connections:Wa().pipe(gs(k(),Wz)).optional(),facingDirection:Pt(["left","right"]).optional(),schPinArrangement:h5e.optional(),schPinStyle:Nse.optional(),schPinSpacing:Ke.optional(),schWidth:Ke.optional(),schHeight:Ke.optional(),connectsFromAbove:Be().optional(),connectsFromBelow:Be().optional()}).superRefine((e,t)=>{if(e.connectsFromAbove&&e.connectsFromBelow)t.addIssue({code:Vt.custom,message:"connectsFromAbove and connectsFromBelow are opposites; set at most one"})}).transform((e)=>{let t=e.layer??(e.connectsFromBelow?"bottom":e.connectsFromAbove?"top":void 0);return t===void 0?e:{...e,layer:t}});fn(!0);var s8s=we({net:k().optional(),connection:k().optional(),schX:Hn.optional(),schY:Hn.optional(),schRotation:ei.optional(),anchorSide:Pt(["left","top","right","bottom"]).optional()});fn(!0);var pDt=we({net:k().optional(),connection:k().optional(),connectsTo:k().or(it(k())).optional(),inline:Be().optional(),schX:Hn.optional(),schY:Hn.optional(),schRotation:ei.optional(),anchorSide:Pt(["left","top","right","bottom"]).optional()});fn(!0);var mDt=M2.extend({});fn(!0);fn(!0);var _Dt=Wa((e)=>typeof e==="string"),gDt=we({method:Pt(["trap","gear"]).optional(),reltol:un([Ae(),k()]).optional(),abstol:un([Ae(),k()]).optional(),vntol:un([Ae(),k()]).optional()}),_5e={name:k().optional(),spiceEngine:_Dt.optional(),spiceOptions:gDt.optional(),graphIndependentAxes:Be().optional(),children:Wa().optional()},ADt=we({name:k().optional(),simulationType:he("spice_transient_analysis").default("spice_transient_analysis"),duration:lc.optional(),startTime:lc.optional(),timePerStep:lc.optional(),spiceEngine:_Dt.optional(),spiceOptions:gDt.optional(),graphIndependentAxes:Be().optional()});fn(!0);var KBt=lc.refine((e)=>e>0,"Time must be positive"),fDt=we({..._5e,duration:KBt.default("10ms"),startTime:lc.default("0ms"),timePerStep:KBt.default("0.01ms")}).superRefine((e,t)=>{if(e.startTime<0||e.startTime>e.duration)t.addIssue({code:Vt.custom,path:["startTime"],message:"startTime must be between zero and duration"})});fn(!0);var yDt=we({..._5e});fn(!0);var VYe=un([Xl,C2]),xDt=we({..._5e,sweepSource:k().min(1),sweepStart:VYe,sweepStop:VYe,sweepStep:VYe.refine((e)=>e!==0,"sweepStep must be nonzero")}).superRefine((e,t)=>{if(Math.sign(e.sweepStop-e.sweepStart)!==Math.sign(e.sweepStep))t.addIssue({code:Vt.custom,path:["sweepStep"],message:"sweepStep must move from sweepStart toward sweepStop"})});fn(!0);var CDt=we({..._5e,sweepType:Pt(["linear","decade","octave"]),startFrequency:mp.refine((e)=>e>0,"startFrequency must be positive"),stopFrequency:mp.refine((e)=>e>0,"stopFrequency must be positive"),samplesPerInterval:Ae().int().positive().optional(),sampleCount:Ae().int().positive().optional()}).superRefine((e,t)=>{if(e.stopFrequency<=e.startFrequency)t.addIssue({code:Vt.custom,path:["stopFrequency"],message:"stopFrequency must be greater than startFrequency"});if(e.sweepType==="linear"){if(e.sampleCount===void 0)t.addIssue({code:Vt.custom,path:["sampleCount"],message:"sampleCount is required for a linear AC sweep"});if(e.samplesPerInterval!==void 0)t.addIssue({code:Vt.custom,path:["samplesPerInterval"],message:"samplesPerInterval is only valid for decade or octave sweeps"});return}if(e.samplesPerInterval===void 0)t.addIssue({code:Vt.custom,path:["samplesPerInterval"],message:"samplesPerInterval is required for decade or octave sweeps"});if(e.sampleCount!==void 0)t.addIssue({code:Vt.custom,path:["sampleCount"],message:"sampleCount is only valid for a linear sweep"})});fn(!0);var AK=k().trim().min(1,"Provide a nonempty selector"),jWo="[+-]?(?:\\d+(?:\\.\\d*)?|\\.\\d+)(?:[eE][+-]?\\d+)?",KWo={"":1,y:0.000000000000000000000001,z:0.000000000000000000001,a:0.000000000000000001,f:0.000000000000001,p:0.000000000001,n:0.000000001,u:0.000001,µ:0.000001,μ:0.000001,m:0.001,k:1000,M:1e6,G:1e9,T:1000000000000,P:1000000000000000,E:1000000000000000000,Z:1000000000000000000000,Y:1000000000000000000000000};function bDt(e,t,n){let o=new RegExp(`^(${jWo})\\s*(?:([yzafpnumkMGTPEZYµμ]?)(?:${e}))?$`);return un([Ae(),k().trim().regex(o,`Use ${t} or a unit string, e.g. ${n}`)]).transform((r)=>{if(typeof r==="number")return r;let i=o.exec(r);return Number(i[1])*KWo[i[2]??""]}).pipe(Ae().finite().positive(`${t} must be greater than zero`))}var $Wo=bDt("A","peak amperes","5mA"),$Bt=bDt("ohms?|Ohms?|Ω","real ohms","100ohm"),IDt=we({name:k().trim().min(1).optional(),source:AK,load:AK,ground:AK,current:$Wo,returnSource:AK,returnSink:AK,sourceImpedance:$Bt,loadImpedance:$Bt,trace:AK.optional(),returnSourceLayer:Bo.optional(),returnSinkLayer:Bo.optional()}).strict();fn(!0);var vDt=we({name:k().trim().min(1).optional(),children:Wa().optional()}).strict();fn(!0);var qWo=mx.pipe(Ae()),JWo=MI.pipe(Ae()),ZWo=cX.pipe(Ae()),eXo=Xl.pipe(Ae()),tXo=C2.pipe(Ae()),kse=(e)=>({name:k().optional(),values:it(e).min(1).optional(),start:e.optional(),stop:e.optional(),step:e.optional()}),nXo=we({...kse(qWo),parameterType:he("resistance"),resistorRef:k().min(1)}).strict(),oXo=we({...kse(JWo),parameterType:he("capacitance"),capacitorRef:k().min(1)}).strict(),rXo=we({...kse(ZWo),parameterType:he("inductance"),inductorRef:k().min(1)}).strict(),iXo=we({...kse(eXo),parameterType:he("voltage"),net:k().min(1)}).strict(),sXo=we({...kse(tXo),parameterType:he("current"),currentSourceRef:k().min(1)}).strict(),aXo=(e,t)=>{let n=e.values!==void 0,o=[e.start,e.stop,e.step].filter((i)=>i!==void 0).length,r=o>0;if(n===r){t.addIssue({code:Vt.custom,message:"Provide either values or start/stop/step"});return}if(o!==0&&o!==3){t.addIssue({code:Vt.custom,message:"start, stop, and step must be provided together"});return}if(e.step===0)t.addIssue({code:Vt.custom,path:["step"],message:"step must be nonzero"});if(e.start!==void 0&&e.stop!==void 0&&e.step!==void 0&&Math.sign(e.stop-e.start)!==Math.sign(e.step))t.addIssue({code:Vt.custom,path:["step"],message:"step must move from start toward stop"})},SDt=ss("parameterType",[nXo,oXo,rXo,iXo,sXo]).superRefine(aXo);fn(!0);fn(!0);fn(!0);fn(!0);fn(!0);fn(!0);var PDt=we({key:Jh().optional(),name:k().optional(),autorouter:u5e.optional(),algorithmFn:bTt.shape.algorithmFn,preflightRoutingCheckPolicy:ITt.optional(),phaseIndex:Ae().optional(),pcbTracePaths:it(Qse).optional(),...CTt.shape,region:we({shape:he("rect").optional(),minX:Ae(),maxX:Ae(),minY:Ae(),maxY:Ae()}).optional(),connection:k().optional(),connections:it(k()).optional(),reroute:Be().optional(),...BTt.shape}).superRefine((e,t)=>{let n=e.autorouter==="simplify"||typeof e.autorouter==="object"&&e.autorouter?.preset==="simplify";if(n&&e.reroute!==!0)console.warn('The "simplify" autorouter preset should only be used with reroute=true');if(e.reroute!==void 0&&!(n&&e.reroute===!0)&&e.region===void 0&&e.connection===void 0&&e.connections===void 0)t.addIssue({code:Vt.custom,message:"region, connection, or connections is required when reroute is provided",path:["region"]})});fn(!0);var EDt=we({source:k(),spicePinMapping:gs(k(),k()).optional()});fn(!0);var cXo=["pin1","pin2","pin3","emitter","collector","base","gate","source","drain"],MDt=ru.extend({type:Pt(["npn","pnp","bjt","jfet","mosfet","igbt"]),connections:w4(cXo).optional()});fn(!0);var lXo=["pin1","drain","pin2","source","pin3","gate"],wDt=ru.extend({channelType:Pt(["n","p"]),mosfetMode:Pt(["enhancement","depletion"]),symbolDrainSide:Pt(["left","right","top","bottom"]).optional(),symbolSourceSide:Pt(["left","right","top","bottom"]).optional(),symbolGateSide:Pt(["left","right","top","bottom"]).optional(),connections:w4(lXo).optional()});fn(!0);var hXo=["inverting_input","non_inverting_input","output","positive_supply","negative_supply"],BDt=ru.extend({connections:w4(hXo).optional()});fn(!0);var dXo=xTt,TDt=ru.extend({inductance:cX,maxCurrentRating:un([k(),Ae()]).optional(),schOrientation:gR.optional(),connections:w4(dXo).optional()});fn(!0);var B8s=we({children:Wa().optional()});fn(!0);var rGe=Dse,uXo=Pt(["anode","cathode","pin1","pin2","pos","neg"]),pXo=k().or(it(k()).readonly()).or(it(k())),mXo=gs(uXo,pXo),DDt=gs(Pt(rGe),Zm.or(it(Zm).readonly()).or(it(Zm))),_Xo=Pt(["standard","schottky","zener","avalanche","photo","tvs"]),NDt=ru.extend({connections:mXo.optional(),variant:_Xo.optional().default("standard"),standard:Be().optional(),schottky:Be().optional(),zener:Be().optional(),avalanche:Be().optional(),photo:Be().optional(),tvs:Be().optional(),schOrientation:gR.optional(),schSize:d5e.optional(),pinLabels:DDt.optional()}).superRefine((e,t)=>{if([e.standard,e.schottky,e.zener,e.avalanche,e.photo,e.tvs].filter(Boolean).length>1)return t.addIssue({code:Vt.custom,message:"Exactly one diode variant must be enabled",path:[]}),is}).transform((e)=>{let t={...e,standard:!1,schottky:!1,zener:!1,avalanche:!1,photo:!1,tvs:!1};if(e.standard)t.standard=!0;else if(e.schottky)t.schottky=!0;else if(e.zener)t.zener=!0;else if(e.photo)t.photo=!0;else if(e.tvs)t.tvs=!0;else switch(e.variant){case"standard":t.standard=!0;break;case"schottky":t.schottky=!0;break;case"zener":t.zener=!0;break;case"avalanche":t.avalanche=!0;break;case"photo":t.photo=!0;break;case"tvs":t.tvs=!0;break;default:t.standard=!0}return t});fn(!0);var gXo=gs(Pt(["1","2"]),Zm.or(it(Zm).readonly()).or(it(Zm))).transform((e)=>({...e["1"]===void 0?{}:{pin1:e["1"]},...e["2"]===void 0?{}:{pin2:e["2"]}})),RDt=ru.extend({color:k().optional(),wavelength:k().optional(),schDisplayValue:k().optional(),schOrientation:gR.optional(),schSize:d5e.optional(),pinLabels:DDt.or(gXo).optional(),connections:w4(Dse).optional(),laser:Be().optional()}),QDt=Dse,kDt=ru.extend({type:Pt(["spst","spdt","dpst","dpdt"]).optional(),isNormallyClosed:Be().optional().default(!1),spst:Be().optional(),spdt:Be().optional(),dpst:Be().optional(),dpdt:Be().optional(),pinLabels:tGe.optional(),noConnect:NTt.optional(),simSwitchFrequency:mp.optional(),simCloseAt:lc.optional(),simOpenAt:lc.optional(),simStartClosed:Be().optional(),simStartOpen:Be().optional(),connections:Wa().pipe(gs(k(),Wz)).optional()}).transform((e)=>{let t={...e};if(t.dpdt)t.type="dpdt";else if(t.spst)t.type="spst";else if(t.spdt)t.type="spdt";else if(t.dpst)t.type="dpst";switch(t.type){case"spdt":t.spdt=!0;break;case"spst":t.spst=!0;break;case"dpst":t.dpst=!0;break;case"dpdt":t.dpdt=!0;break}return t});fn(!0);var LDt=ws.extend({text:k(),anchorAlignment:Pt(["center","top_left","top_right","bottom_left","bottom_right"]).default("center"),font:Pt(["tscircuit2024"]).optional(),fontSize:be.optional(),color:k().optional()});fn(!0);var HDt=ws.omit({pcbRotation:!0}).extend({width:Ke,height:Ke,strokeWidth:Ke.optional(),isFilled:Be().optional(),hasStroke:Be().optional(),isStrokeDashed:Be().optional(),color:k().optional(),cornerRadius:Ke.optional()}),FDt=ws.omit({pcbLeftEdgeX:!0,pcbRightEdgeX:!0,pcbTopEdgeY:!0,pcbBottomEdgeY:!0,pcbX:!0,pcbY:!0,pcbOffsetX:!0,pcbOffsetY:!0,pcbRotation:!0}).extend({route:it(yf),strokeWidth:be.optional(),color:k().optional(),isFilled:Be().optional(),hasStroke:Be().optional()}),qBt=un([k(),J1]),zDt=ws.omit({pcbLeftEdgeX:!0,pcbRightEdgeX:!0,pcbTopEdgeY:!0,pcbBottomEdgeY:!0,pcbX:!0,pcbY:!0,pcbOffsetX:!0,pcbOffsetY:!0,pcbRotation:!0}).extend({from:qBt,to:qBt,text:k().optional(),offset:Ke.optional(),offsetDirection:we({x:Ae().finite(),y:Ae().finite()}).optional(),font:Pt(["tscircuit2024"]).optional(),fontSize:be.optional(),color:k().optional(),arrowSize:Ke.optional(),units:Pt(["in","mm"]).optional(),outerEdgeToEdge:he(!0).optional(),centerToCenter:he(!0).optional(),innerEdgeToEdge:he(!0).optional()});fn(!0);var U8s=we({layer:k().optional(),thickness:Ke.optional(),route:it(yf)}),g5e=l5e.extend({name:k().optional(),fromLayer:Bo.optional(),toLayer:Bo.optional(),holeDiameter:Ke.optional(),outerDiameter:Ke.optional(),layers:it(Bo).optional(),connectsTo:k().or(it(k())).optional(),netIsAssignable:Be().optional(),tented:un([Be(),Pt(["both_sides","top_and_bottom_tented","top_tented","bottom_tented","exposed"])]).transform((e)=>{if(e===!0||e==="both_sides")return"top_and_bottom_tented";if(e===!1)return"exposed";return e}).optional()});fn(!0);var AXo=we({pin1:Wz}).strict(),ODt=ru.extend({connections:AXo.optional(),footprintVariant:Pt(["pad","through_hole"]).optional(),padShape:Pt(["rect","circle"]).optional().default("circle"),padDiameter:Ke.optional(),holeDiameter:Ke.optional(),width:Ke.optional(),height:Ke.optional()}).refine((e)=>e.footprintVariant!=="through_hole"||e.holeDiameter!==void 0,{message:"holeDiameter is required for through_hole testpoints"});fn(!0);var VDt=ws.omit({pcbRotation:!0,layer:!0}).extend({connection:k()});fn(!0);var YDt=un([ws.omit({pcbRotation:!0}).extend({shape:he("circle"),radius:Ke,layers:it(Bo).optional(),warningOnly:Be().optional(),allowTraces:Be().optional(),allowPlacements:Be().optional(),excludeRefs:it(k()).optional().describe('Component selectors excluded from the keepout, such as ".ANT1"')}),ws.extend({shape:he("rect"),width:Ke,height:Ke,layers:it(Bo).optional(),warningOnly:Be().optional(),allowTraces:Be().optional(),allowPlacements:Be().optional(),excludeRefs:it(k()).optional().describe('Component selectors excluded from the keepout, such as ".ANT1"')})]),GDt=ws.extend({width:Ke,height:Ke,strokeWidth:Ke.optional(),isFilled:Be().optional(),hasStroke:Be().optional(),isStrokeDashed:Be().optional(),color:k().optional()}),UDt=ws.omit({pcbLeftEdgeX:!0,pcbRightEdgeX:!0,pcbTopEdgeY:!0,pcbBottomEdgeY:!0,pcbX:!0,pcbY:!0,pcbOffsetX:!0,pcbOffsetY:!0,pcbRotation:!0}).extend({outline:it(J1),strokeWidth:be.optional(),isClosed:Be().optional(),isStrokeDashed:Be().optional(),color:k().optional()}),WDt=ws.omit({pcbRotation:!0}).extend({radius:Ke}),i7s=ws.omit({pcbRotation:!0}).extend({width:Ke,height:Ke,radius:Ke}),XDt=we({name:k().optional(),layer:Bo,connectsTo:k(),crosshatch:Be().optional(),crosshatchPitch:Hn.pipe(Ae().finite().positive()).optional(),crosshatchWidth:Hn.pipe(Ae().finite().positive()).optional(),unbroken:Be().optional().describe("Reserves the pour region during autorouting so unrelated traces do not split it. Vias may still cross the region using antipads."),padMargin:Hn.optional(),traceMargin:Hn.optional(),clearance:Hn.optional(),boardEdgeMargin:Hn.optional(),cutoutMargin:Hn.optional(),useThermalReliefs:Be().optional(),outline:it(J1).optional(),coveredWithSolderMask:Be().optional().default(!0)}).superRefine((e,t)=>{if(e.crosshatch&&(e.crosshatchWidth??0.25)>=(e.crosshatchPitch??1))t.addIssue({code:Vt.custom,path:["crosshatchWidth"],message:"crosshatchWidth must be less than crosshatchPitch"})});fn(!0);var jDt=we({originalLayer:Bo.default("top").optional(),children:Jh().optional()});fn(!0);var KDt=we({pcbX:Jm.optional(),pcbY:Jm.optional(),pcbLeftEdgeX:Jm.optional(),pcbRightEdgeX:Jm.optional(),pcbTopEdgeY:Jm.optional(),pcbBottomEdgeY:Jm.optional(),pcbOffsetX:Hn.optional(),pcbOffsetY:Hn.optional(),pcbZ:Hn.optional()}),fXo=M4.extend({modelUrl:ou,stepUrl:ou.optional()}),yXo=fXo.merge(KDt);fn(!0);var xXo=M4.extend({model:k().trim().min(1).optional(),modelUrl:ou.optional()}).merge(KDt).refine((e)=>e.model===void 0!==(e.modelUrl===void 0),{message:"Provide exactly one of model or modelUrl",path:["model"]}).transform(({model:e,...t})=>({...t,modelUrl:e===void 0?t.modelUrl:/^https?:\/\//i.test(e)?e:`https://modelcdn.tscircuit.com/jscad_models/${encodeURIComponent(e)}.glb`})).pipe(yXo);fn(!0);var $Dt=un([M1t(),ou,xXo]),qDt=ru.extend({voltage:Xl}),CXo=["pin1","pin2","pos","neg"],bXo=un([k(),Ae()]).transform((e)=>{if(typeof e==="string"){if(e.endsWith("%"))return parseFloat(e.slice(0,-1))/100;return parseFloat(e)}return e}).pipe(Ae().min(0,"Duty cycle must be non-negative").max(1,"Duty cycle cannot be greater than 100%")),JDt=ru.extend({voltage:Xl.optional(),frequency:mp.optional(),peakToPeakVoltage:Xl.optional(),waveShape:Pt(["sinewave","square","triangle","sawtooth"]).optional(),phase:ei.optional(),dutyCycle:bXo.optional(),pulseDelay:lc.optional(),riseTime:lc.optional(),fallTime:lc.optional(),pulseWidth:lc.optional(),period:lc.optional(),acMagnitude:Xl.optional(),acPhase:ei.optional(),connections:w4(CXo).optional()});fn(!0);var IXo=["pin1","pin2","pos","neg"],vXo=un([k(),Ae()]).transform((e)=>{if(typeof e==="string"){if(e.endsWith("%"))return parseFloat(e.slice(0,-1))/100;return parseFloat(e)}return e}).pipe(Ae().min(0,"Duty cycle must be non-negative").max(1,"Duty cycle cannot be greater than 100%")),ZDt=ru.extend({current:C2.optional(),frequency:mp.optional(),peakToPeakCurrent:C2.optional(),waveShape:Pt(["sinewave","square","triangle","sawtooth"]).optional(),phase:ei.optional(),dutyCycle:vXo.optional(),acMagnitude:C2.optional(),acPhase:ei.optional(),connections:w4(IXo).optional()});fn(!0);var eNt=ru.omit({name:!0}).extend({name:k().optional(),connectsTo:k(),referenceTo:k().optional(),color:k().optional(),graphDisplayName:k().optional(),graphCenter:Ae().optional(),graphVerticalOffset:Ae().or(k()).optional(),graphVoltagePerDiv:Ae().or(k()).optional()});fn(!0);var SXo=["pin1","pin2","pos","neg"],PXo=(e)=>e.pos!==void 0&&e.neg!==void 0||e.pin1!==void 0&&e.pin2!==void 0,tNt=ru.extend({connections:w4(SXo).refine(PXo,"Ammeter connections must include either pos/neg or pin1/pin2"),color:k().optional(),graphDisplayName:k().optional(),graphCenter:Ae().optional(),graphVerticalOffset:Ae().or(k()).optional(),graphCurrentPerDiv:Ae().or(k()).optional()});fn(!0);var nNt=we({center:Yo,radius:Ke,startAngleDegrees:ei,endAngleDegrees:ei,direction:Pt(["clockwise","counterclockwise"]).default("counterclockwise"),strokeWidth:Ke.optional(),color:k().optional(),isDashed:Be().optional().default(!1)});fn(!0);var C7s=we({children:Jh().optional()});fn(!0);var oNt=we({name:k().optional(),chipRef:k().optional(),pinLabels:tGe.optional(),schPinArrangement:h5e.optional(),schPinStyle:Nse.optional(),schX:Ke.optional(),schY:Ke.optional(),schSectionName:k().optional(),schSheetName:k().optional(),width:Ke.optional(),height:Ke.optional(),overlay:it(k()).optional(),padding:Ke.optional(),paddingLeft:Ke.optional(),paddingRight:Ke.optional(),paddingTop:Ke.optional(),paddingBottom:Ke.optional(),title:k().optional(),titleAlignment:I7.default("top_left"),titleColor:k().optional(),titleFontSize:Ke.optional(),titleInside:Be().default(!1),strokeStyle:Pt(["solid","dashed"]).default("solid")}).refine((e)=>e.width!==void 0&&e.height!==void 0||Array.isArray(e.overlay)&&e.overlay.length>0,{message:"Must provide either both `width` and `height`, or a non-empty `overlay` array."}).refine((e)=>!(e.width!==void 0&&e.height!==void 0&&Array.isArray(e.overlay)&&e.overlay.length>0),{message:"Cannot provide both `width`/`height` and `overlay` at the same time."});fn(!0);var EXo=Wa().pipe(gs(k(),Wz)).refine((e)=>Object.keys(e).length>0,{message:"connections must map at least one schematic symbol port"}),rNt=we({name:k().min(1),displayName:k().optional(),chipRef:k().min(1).optional(),symbolName:k().min(1),connections:EXo.optional(),schX:Hn.optional(),schY:Hn.optional(),schRotation:ei.optional(),schSectionName:k().optional(),schSheetName:k().optional()});fn(!0);var iNt=we({center:Yo,radius:Ke,strokeWidth:Ke.optional(),color:k().optional(),isFilled:Be().optional().default(!1),fillColor:k().optional(),isDashed:Be().optional().default(!1)});fn(!0);var sNt=we({schX:Ke.optional(),schY:Ke.optional(),width:Ke,height:Ke,rotation:ei.default(0),strokeWidth:Ke.optional(),color:k().optional(),isFilled:Be().optional().default(!1),fillColor:k().optional(),isDashed:Be().optional().default(!1)});fn(!0);var aNt=we({x1:Ke,y1:Ke,x2:Ke,y2:Ke,strokeWidth:Ke.optional(),color:k().optional(),isDashed:Be().optional().default(!1),dashLength:Ke.optional(),dashGap:Ke.optional()});fn(!0);var MXo=Pt(["center","left","right","top","bottom"]),cNt=we({schX:Ke.optional(),schY:Ke.optional(),text:k(),fontSize:Ae().default(1),anchor:un([MXo.describe("legacy"),I7]).default("center"),color:k().default("#000000"),schRotation:ei.default(0)});fn(!0);var lNt=we({points:it(Yo).optional(),svgPath:k().optional(),strokeWidth:Ke.optional(),strokeColor:k().optional(),dashLength:Ke.optional(),dashGap:Ke.optional(),isFilled:Be().optional().default(!1),fillColor:k().optional()});fn(!0);var hNt=we({schX:Ke.optional(),schY:Ke.optional(),children:Jh().optional(),cellPadding:Ke.optional(),borderWidth:Ke.optional(),anchor:I7.optional(),fontSize:Ke.optional()});fn(!0);var dNt=we({children:Jh().optional(),height:Ke.optional()});fn(!0);var uNt=we({children:k().optional(),horizontalAlign:Pt(["left","center","right"]).optional(),verticalAlign:Pt(["top","middle","bottom"]).optional(),fontSize:Ke.optional(),rowSpan:Ae().optional(),colSpan:Ae().optional(),width:Ke.optional(),text:k().optional()});fn(!0);var pNt=we({displayName:k().optional(),name:k(),sectionTitleFontSize:Ke.optional()});fn(!0);var mNt=we({name:k().optional(),displayName:k().optional(),sheetIndex:Ae().optional(),sheetSize:Pt(["A4","ANSI_B"]).default("A4"),sheetWidth:Ke.pipe(Ae().positive()).optional(),sheetHeight:Ke.pipe(Ae().positive()).optional(),children:Jh().optional()});fn(!0);var wXo=ou.refine((e)=>e.trim().length>0,{message:"imageUrl cannot be empty"}),JBt=(e)=>Hn.refine((t)=>Number.isFinite(t)&&t>0,{message:`${e} must be a positive finite distance`}),_Nt=we({imageUrl:wXo.optional(),svgContent:k().refine((e)=>e.trim().length>0,{message:"svgContent cannot be empty"}).optional(),width:JBt("width").optional(),height:JBt("height").optional()}).superRefine(({imageUrl:e,svgContent:t},n)=>{if(e===void 0&&t===void 0)n.addIssue({code:Vt.custom,message:"At least one of imageUrl or svgContent is required"})});fn(!0);var gNt=ws.extend({text:k(),anchorAlignment:I7.default("center"),font:Pt(["tscircuit2024"]).optional(),fontSize:be.optional(),layers:it(Bo).optional(),knockout:Be().optional(),mirrored:Be().optional()}),ANt=ws.extend({text:k(),anchorAlignment:I7.default("center"),font:Pt(["tscircuit2024"]).optional(),fontSize:be.optional(),isKnockout:Be().optional(),knockoutPadding:be.optional(),knockoutPaddingLeft:be.optional(),knockoutPaddingRight:be.optional(),knockoutPaddingTop:be.optional(),knockoutPaddingBottom:be.optional(),layers:it(Bo).optional()}),fNt=ws.omit({pcbLeftEdgeX:!0,pcbRightEdgeX:!0,pcbTopEdgeY:!0,pcbBottomEdgeY:!0,pcbX:!0,pcbY:!0,pcbOffsetX:!0,pcbOffsetY:!0,pcbRotation:!0}).extend({route:it(yf),strokeWidth:be.optional()}),yNt=ws.omit({pcbX:!0,pcbY:!0,pcbOffsetX:!0,pcbOffsetY:!0,pcbRotation:!0}).extend({strokeWidth:Ke,x1:Ke,y1:Ke,x2:Ke,y2:Ke}),xNt=ws.omit({pcbRotation:!0}).extend({filled:Be().default(!0).optional(),stroke:Pt(["dashed","solid","none"]).optional(),strokeWidth:Ke.optional(),width:Ke,height:Ke,cornerRadius:Ke.optional()}),CNt=ws.omit({pcbRotation:!0}).extend({isFilled:Be().optional(),isOutline:Be().optional(),strokeWidth:Ke.optional(),radius:Ke}),bNt=ws.omit({layer:!0,pcbStyle:!0,pcbSx:!0}).extend({imageUrl:ou,width:Hn,height:Hn,layer:_p.optional()});fn(!0);var ZBt=we({x:Ke,y:Ke,via:Be().optional(),toLayer:Bo.optional()}),INt=we({for:k().optional().describe("Selector for the port you're targeting, not required if you're inside a trace"),order:Ae().optional(),offset:yf.or(ZBt).optional(),offsets:it(yf).or(it(ZBt)).optional(),traceWidth:Ae().optional()}),vNt=l5e.extend({name:k().optional(),pinNumber:Ae().optional(),schStemLength:Ae().optional(),schPinLabelFontSize:Pt(["default","sm"]).or(Ke.refine((e)=>Number.isFinite(e)&&e>0,{message:"Schematic pin-label font size must be positive and finite"})).optional(),aliases:it(k()).optional(),layer:k().optional(),layers:it(k()).optional(),schX:Ae().optional(),schY:Ae().optional(),direction:UGo.optional(),connectsTo:k().or(it(k())).optional(),kicadPinMetadata:RUo.optional(),hasInversionCircle:Be().optional()}),SNt=ws.extend({text:k(),anchorAlignment:Pt(["center","top_left","top_right","bottom_left","bottom_right"]).default("center"),font:Pt(["tscircuit2024"]).optional(),fontSize:be.optional(),color:k().optional()});fn(!0);var PNt=ws.omit({pcbRotation:!0}).extend({width:Ke,height:Ke,strokeWidth:Ke.optional(),isFilled:Be().optional(),hasStroke:Be().optional(),isStrokeDashed:Be().optional(),color:k().optional(),cornerRadius:Ke.optional()});fn(!0);var ENt=ws.omit({pcbLeftEdgeX:!0,pcbRightEdgeX:!0,pcbTopEdgeY:!0,pcbBottomEdgeY:!0,pcbX:!0,pcbY:!0,pcbOffsetX:!0,pcbOffsetY:!0,pcbRotation:!0}).extend({route:it(yf),strokeWidth:be.optional(),color:k().optional()});fn(!0);var MNt=ws.omit({pcbLeftEdgeX:!0,pcbRightEdgeX:!0,pcbTopEdgeY:!0,pcbBottomEdgeY:!0,pcbX:!0,pcbY:!0,pcbOffsetX:!0,pcbOffsetY:!0,pcbRotation:!0}).extend({x1:Ke,y1:Ke,x2:Ke,y2:Ke,strokeWidth:Ke.optional(),color:k().optional(),isDashed:Be().optional()});fn(!0);var eTt=un([k(),J1]),wNt=ws.omit({pcbLeftEdgeX:!0,pcbRightEdgeX:!0,pcbTopEdgeY:!0,pcbBottomEdgeY:!0,pcbX:!0,pcbY:!0,pcbOffsetX:!0,pcbOffsetY:!0,pcbRotation:!0}).extend({from:eTt,to:eTt,text:k().optional(),offset:Ke.optional(),offsetDirection:we({x:Ae().finite(),y:Ae().finite()}).optional(),font:Pt(["tscircuit2024"]).optional(),fontSize:be.optional(),color:k().optional(),arrowSize:Ke.optional(),units:Pt(["in","mm"]).optional(),outerEdgeToEdge:he(!0).optional(),centerToCenter:he(!0).optional(),innerEdgeToEdge:he(!0).optional()});fn(!0);var BNt=it(Jh()).describe("Circuit JSON"),WYe=we({footprintCircuitJson:it(Jh()),cadModel:Uz.optional()}),tTt=xN().args(k()).returns(CN(WYe)).or(xN().args(k(),we({resolvedPcbStyle:$Ye.optional()}).optional()).returns(CN(WYe))).describe("A function that takes a path and returns Circuit JSON"),BXo=we({loadFromUrl:xN().args(k()).returns(CN(WYe)).describe("A function that takes a footprint file URL and returns Circuit JSON")}),TXo=we({engineVersionString:k().optional(),simulationResultCircuitJson:BNt}),DXo=we({simulate:xN().args(k()).returns(CN(TXo)).describe("A function that takes a SPICE string and returns a simulation result")}),NXo=Wa((e)=>typeof e==="string"),nTt=we({run:xN().args().returns(CN(LF())).describe("Run the autorouter"),getOutputSimpleRouteJson:xN().args().returns(CN(Jh())).describe("Get the resulting SimpleRouteJson")}),RXo=we({createAutorouter:xN().args(Jh(),Jh().optional()).returns(un([nTt,CN(nTt)])).describe("Create an autorouter instance")}),QXo=Wa((e)=>typeof e==="function").describe("A fetch-like function to use for platform requests"),kXo=Wa((e)=>typeof e==="object"&&e!==null&&("getItem"in e)&&typeof e.getItem==="function"&&("setItem"in e)&&typeof e.setItem==="function"),LXo=Wa((e)=>typeof e==="object"&&e!==null&&("runDrcChecks"in e)&&typeof e.runDrcChecks==="function"),HXo=we({partsEngine:vTt.optional(),checkAvailability:Be().describe("Opt in to networked JLCPCB availability checks during rendering. Disabled by default; enabling adds non-deterministic diagnostics.").optional(),fabricatorEngine:LXo.optional(),autorouter:u5e.optional(),autorouterMap:gs(k(),RXo).optional(),allowLegacyAutorouters:Be().optional(),registryApiUrl:ou.optional(),cloudAutorouterUrl:ou.optional(),jscdnBaseUrl:ou.optional(),projectName:k().optional(),projectBaseUrl:ou.optional(),version:k().optional(),url:ou.optional(),printBoardInformationToSilkscreen:Be().optional(),includeBoardFiles:it(k()).describe('The board files to automatically build with "tsci build", defaults to ["**/*.circuit.tsx"]. Can be an array of files or globs').optional(),snapshotsDir:k().describe('The directory where snapshots are stored for "tsci snapshot", defaults to "tests/__snapshots__"').optional(),defaultSpiceEngine:NXo.optional(),unitPreference:Pt(["mm","in","mil"]).optional(),localCacheEngine:kXo.optional(),useCloudAutorouter:Be().optional(),enablePartOrientationAnalysis:Be().optional(),pcbPackSolverTimeoutMs:Ae().finite().positive().optional(),pcbDisabled:Be().optional(),routingDisabled:Be().optional(),schematicDisabled:Be().optional(),partsEngineDisabled:Be().optional(),analogSimulationDisabled:Be().optional(),drcChecksDisabled:Be().optional(),netlistDrcChecksDisabled:Be().optional(),routingDrcChecksDisabled:Be().optional(),placementDrcChecksDisabled:Be().optional(),pinSpecificationDrcChecksDisabled:Be().optional(),spiceEngineMap:gs(k(),DXo).optional(),footprintLibraryMap:gs(k(),un([tTt,gs(k(),un([BNt,tTt]))])).optional(),footprintFileParserMap:gs(k(),BXo).optional(),resolveProjectStaticFileImportUrl:xN().args(k()).returns(CN(k())).describe("A function that returns a string URL for static files for the project").optional(),platformFetch:QXo.optional()});fn(!0);var FXo=HXo,CSs=FXo.pick({projectName:!0,projectBaseUrl:!0,version:!0,url:!0,printBoardInformationToSilkscreen:!0,includeBoardFiles:!0,snapshotsDir:!0,defaultSpiceEngine:!0,pcbDisabled:!0,schematicDisabled:!0,analogSimulationDisabled:!0});fn(!0);Kt();Ie();var Fse=new Set,iGe=!1;function jI(e,t,n=2){let o=t&&t.length,r=o?t[0]*n:e.length;if(Fse.size)Fse.clear();let i=RNt(e,0,r,n,!0),s=[];if(!i||i.next===i.prev)return s;let a=0,c=0,l=0;if(o)i=GXo(e,t,i,n);if(e.length>80*n){a=e[0],c=e[1];let h=a,d=c;for(let u=n;u<r;u+=n){let _=e[u],p=e[u+1];if(_<a)a=_;if(p<c)c=p;if(_>h)h=_;if(p>d)d=p}l=Math.max(h-a,d-c),l=l!==0?32767/l:0}return sGe(i,s,a,c,l),s}function RNt(e,t,n,o,r){let i=null;if(r===ojo(e,t,n,o)>0)for(let s=t;s<n;s+=o)i=NNt(s/o|0,e[s],e[s+1],i);else for(let s=n-o;s>=t;s-=o)i=NNt(s/o|0,e[s],e[s+1],i);if(i&&zse(i,i.next))Vse(i),i=i.next;return i}function jz(e,t=e){let n=t===e,o=e,r;do if(r=!1,o!==o.next&&(Fse.size===0||!Fse.has(o))&&(zse(o,o.next)||e_(o.prev,o,o.next)===0)){if(n||o===t)t=o.prev;iGe=!0,Vse(o),o=o.prev,r=!0}else if(n||o!==t)o=o.next,r=!n;while(r||o!==t);return t}function sGe(e,t,n,o,r){if(r)qXo(e,n,o,r);let i=e,s=!1;while(e.prev!==e.next){let a=e.prev,c=e.next;if(e_(a,e,c)<0&&(r?OXo(e,n,o,r):zXo(e))){t.push(a.i,e.i,c.i),Vse(e),e=c,i=c;continue}if(e=c,e===i){if(iGe=!1,e=jz(e),iGe){i=e;continue}if(!s){e=VXo(e,t),i=e,s=!0;continue}YXo(e,t,n,o,r);break}}}function zXo(e){let t=e.prev,n=e,o=e.next,r=t.x,i=n.x,s=o.x,a=t.y,c=n.y,l=o.y,h=Math.min(r,i,s),d=Math.min(a,c,l),u=Math.max(r,i,s),_=Math.max(a,c,l),p=o.next;while(p!==t){if(p.x>=h&&p.x<=u&&p.y>=d&&p.y<=_&&!(r===p.x&&a===p.y)&&x5e(r,a,i,c,s,l,p.x,p.y)&&e_(p.prev,p,p.next)>=0)return!1;p=p.next}return!0}function OXo(e,t,n,o){let r=e.prev,i=e,s=e.next,a=r.x,c=i.x,l=s.x,h=r.y,d=i.y,u=s.y,_=Math.min(a,c,l),p=Math.min(h,d,u),m=Math.max(a,c,l),A=Math.max(h,d,u),g=hGe(_,p,t,n,o),f=hGe(m,A,t,n,o),y=e.prevZ;while(y&&y.z>=g){if(y.x>=_&&y.x<=m&&y.y>=p&&y.y<=A&&y!==s&&!(a===y.x&&h===y.y)&&x5e(a,h,c,d,l,u,y.x,y.y)&&e_(y.prev,y,y.next)>=0)return!1;y=y.prevZ}let x=e.nextZ;while(x&&x.z<=f){if(x.x>=_&&x.x<=m&&x.y>=p&&x.y<=A&&x!==s&&!(a===x.x&&h===x.y)&&x5e(a,h,c,d,l,u,x.x,x.y)&&e_(x.prev,x,x.next)>=0)return!1;x=x.nextZ}return!0}function VXo(e,t){let n=e,o=!1;do{let r=n.prev,i=n.next.next;if(LNt(r,n,n.next,i,!1)&&Ose(r,i)&&Ose(i,r))t.push(r.i,n.i,i.i),Vse(n),Vse(n.next),n=e=i,o=!0;n=n.next}while(n!==e);return o?jz(n):n}function YXo(e,t,n,o,r){let i=e;do{let s=i.next.next;while(s!==i.prev){if(i.i!==s.i&&ejo(i,s)){let a=HNt(i,s);i=jz(i,i.next),a=jz(a,a.next),sGe(i,t,n,o,r),sGe(a,t,n,o,r);return}s=s.next}i=i.next}while(i!==e)}var aGe=!1;function GXo(e,t,n,o){let r=[];for(let i=0,s=t.length;i<s;i++){let a=t[i]*o,c=i<s-1?t[i+1]*o:e.length,l=RNt(e,a,c,o,!1);if(l===l.next)Fse.add(l);r.push(ZXo(l))}r.sort(UXo),XXo(e.length/o,t.length),kNt(n,n),aGe=!0;for(let i=0;i<r.length;i++)n=WXo(r[i],n);return aGe=!1,jz(n)}function UXo(e,t){return e.x-t.x||e.y-t.y||(e.next.y-e.y)/(e.next.x-e.x)-(t.next.y-t.y)/(t.next.x-t.x)}function WXo(e,t){let n=KXo(e,t);if(!n)return t;let o=HNt(n,e),r=o.next;return kNt(n,r.next),jz(o,o.next),jz(n,n.next)}var QNt=16,bp=new Float64Array(0),y5e=0,cGe=[],lGe=[];function XXo(e,t){let n=Math.ceil((e+2*t)/QNt)+t+2;if(bp.length<n*4)bp=new Float64Array(n*4);y5e=0}function kNt(e,t){let n=e;do{let o=y5e++;cGe[o]=n;let r=n.x,i=n.y,s=n.x,a=n.y,c=0;do{let h=n.next;if(n.z=o,h.x<r)r=h.x;if(h.x>s)s=h.x;if(h.y<i)i=h.y;if(h.y>a)a=h.y;n=h}while(++c<QNt&&n!==t);lGe[o]=n;let l=o*4;bp[l]=r,bp[l+1]=i,bp[l+2]=s,bp[l+3]=a}while(n!==t)}function jXo(e,t){let n=e.z*4;if(t.x<bp[n])bp[n]=t.x;if(t.y<bp[n+1])bp[n+1]=t.y;if(t.x>bp[n+2])bp[n+2]=t.x;if(t.y>bp[n+3])bp[n+3]=t.y}function TNt(e){let t=lGe[e];while(t.prev.next!==t)t=t.next;return lGe[e]=t,t}function DNt(e){let t=cGe[e];while(t.prev.next!==t)t=t.next;return cGe[e]=t,t}function KXo(e,t){let n=t,{x:o,y:r}=e,i=-1/0,s;if(zse(e,n))return n;for(let u=0,_=0;u<y5e;u++,_+=4){if(r<bp[_+1]||r>bp[_+3]||bp[_]>o||bp[_+2]<=i)continue;let p=TNt(u);n=DNt(u);do{if(n.prev.next===n){if(zse(e,n.next))return n.next;else if(r<=n.y&&r>=n.next.y&&n.next.y!==n.y){let m=n.x+(r-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(m<=o&&m>i){if(i=m,s=n.x<n.next.x?n:n.next,m===o)return s}}}n=n.next}while(n!==p)}if(!s)return null;let a=s.x,c=s.y,l=Math.min(r,c),h=Math.max(r,c),d=1/0;for(let u=0,_=0;u<y5e;u++,_+=4){if(bp[_+2]<a||bp[_]>o||bp[_+3]<l||bp[_+1]>h)continue;let p=TNt(u);n=DNt(u);do{if(n.prev.next===n&&o>=n.x&&n.x>=a&&o!==n.x&&x5e(r<c?o:i,r,a,c,r<c?i:o,r,n.x,n.y)){let m=Math.abs(r-n.y)/(o-n.x);if((Ose(n,e)||n.y===r&&n.next.y===r&&n.next.x>o)&&(m<d||m===d&&(n.x>s.x||n.x===s.x&&$Xo(s,n))))s=n,d=m}n=n.next}while(n!==p)}return s}function $Xo(e,t){return e_(e.prev,e,t.prev)<0&&e_(t.next,e,e.next)<0}var B4=[],yK=[],Xz=new Uint32Array(0),Lse=new Uint32Array(0),Hse=new Uint32Array(256);function qXo(e,t,n,o){let r=e,i=0;do r.z=hGe(r.x,r.y,t,n,o),B4[i++]=r,r=r.next;while(r!==e);JXo(i);let s=null;for(let a=0;a<i;a++){let c=B4[a];if(c.prevZ=s,s)s.nextZ=c;s=c}s.nextZ=null,B4.fill(null,0,i),yK.fill(null,0,i)}function JXo(e){if(e<=32){for(let t=1;t<e;t++){let n=B4[t],o=n.z,r=t-1;while(r>=0&&B4[r].z>o)B4[r+1]=B4[r],r--;B4[r+1]=n}return}if(Xz.length<e)Xz=new Uint32Array(e),Lse=new Uint32Array(e),yK=Array(e);for(let t=0;t<e;t++)Xz[t]=B4[t].z;A5e(e,B4,Xz,yK,Lse,0),A5e(e,yK,Lse,B4,Xz,8),A5e(e,B4,Xz,yK,Lse,16),A5e(e,yK,Lse,B4,Xz,24)}function A5e(e,t,n,o,r,i){Hse.fill(0);for(let a=0;a<e;a++)Hse[n[a]>>>i&255]++;let s=0;for(let a=0;a<256;a++){let c=Hse[a];Hse[a]=s,s+=c}for(let a=0;a<e;a++){let c=n[a],l=Hse[c>>>i&255]++;o[l]=t[a],r[l]=c}}function hGe(e,t,n,o,r){return e=(e-n)*r|0,t=(t-o)*r|0,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,e|t<<1}function ZXo(e){let t=e,n=e;do{if(t.x<n.x||t.x===n.x&&t.y<n.y)n=t;t=t.next}while(t!==e);return n}function x5e(e,t,n,o,r,i,s,a){return(r-s)*(t-a)>=(e-s)*(i-a)&&(e-s)*(o-a)>=(n-s)*(t-a)&&(n-s)*(i-a)>=(r-s)*(o-a)}function ejo(e,t){let n=zse(e,t)&&e_(e.prev,e,e.next)>0&&e_(t.prev,t,t.next)>0;return e.next.i!==t.i&&(n||Ose(e,t)&&Ose(t,e)&&(e_(e.prev,e,t.prev)!==0||e_(e,t.prev,t)!==0))&&!tjo(e,t)&&(n||njo(e,t))}function e_(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function zse(e,t){return e.x===t.x&&e.y===t.y}function LNt(e,t,n,o,r=!0){let i=e_(e,t,n),s=e_(e,t,o),a=e_(n,o,e),c=e_(n,o,t);if((i>0&&s<0||i<0&&s>0)&&(a>0&&c<0||a<0&&c>0))return!0;if(!r)return!1;if(i===0&&f5e(e,n,t))return!0;if(s===0&&f5e(e,o,t))return!0;if(a===0&&f5e(n,e,o))return!0;if(c===0&&f5e(n,t,o))return!0;return!1}function f5e(e,t,n){return t.x<=Math.max(e.x,n.x)&&t.x>=Math.min(e.x,n.x)&&t.y<=Math.max(e.y,n.y)&&t.y>=Math.min(e.y,n.y)}function tjo(e,t){let n=Math.min(e.x,t.x),o=Math.max(e.x,t.x),r=Math.min(e.y,t.y),i=Math.max(e.y,t.y),s=e;do{let a=s.next;if(s.x>o&&a.x>o||s.x<n&&a.x<n||s.y>i&&a.y>i||s.y<r&&a.y<r){s=a;continue}if(s.i!==e.i&&a.i!==e.i&&s.i!==t.i&&a.i!==t.i&&LNt(s,a,e,t))return!0;s=a}while(s!==e);return!1}function Ose(e,t){return e_(e.prev,e,e.next)<0?e_(e,t,e.next)>=0&&e_(e,e.prev,t)>=0:e_(e,t,e.prev)<0||e_(e,e.next,t)<0}function njo(e,t){let n=e,o=!1,r=(e.x+t.x)/2,i=(e.y+t.y)/2;do{let s=n.next;if(n.y>i!==s.y>i&&r<(s.x-n.x)*(i-n.y)/(s.y-n.y)+n.x)o=!o;n=s}while(n!==e);return o}function HNt(e,t){let n=dGe(e.i,e.x,e.y),o=dGe(t.i,t.x,t.y),r=e.next,i=t.prev;return e.next=t,t.prev=e,n.next=r,r.prev=n,o.next=n,n.prev=o,i.next=o,o.prev=i,o}function NNt(e,t,n,o){let r=dGe(e,t,n);if(!o)r.prev=r,r.next=r;else r.next=o.next,r.prev=o,o.next.prev=r,o.next=r;return r}function Vse(e){if(e.next.prev=e.prev,e.prev.next=e.next,e.prevZ)e.prevZ.nextZ=e.nextZ;if(e.nextZ)e.nextZ.prevZ=e.prevZ;if(aGe)jXo(e.prev,e.next)}function dGe(e,t,n){return{i:e,x:t,y:n,prev:null,next:null,z:0,prevZ:null,nextZ:null}}function ojo(e,t,n,o){let r=0;for(let i=t,s=n-o;i<n;i+=o)r+=(e[s]-e[i])*(e[i+1]+e[s+1]),s=i;return r}Kt();Kt();Ie();Ie();Ie();Ie();var FNt={in:25.4,inch:25.4,mil:0.0254,mm:1,m:1000,cm:10,ft:304.8,feet:304.8},Ni=(e)=>{let t=typeof e==="number"?"mm":e.replace(/^[^a-zA-Z]+/g,"").toLowerCase();if(!t)t="mm";let n=typeof e==="number"?e:Number.parseFloat(e.split(t)[0]);if(t in FNt)return n*FNt[t];throw Error(`Unsupported unit: ${t}`)};var Dl=Ni;Kt();Ie();Kt();Ie();Kt();Kt();Ie();Kt();Ie();Kt();Ie();Kt();Ie();Kt();Ie();Kt();Ie();Kt();Ie();Kt();Ie();Kt();Ie();Ie();Kt();Kt();Ie();Kt();Ie();Kt();Kt();Kt();Ie();Ie();Kt();Ie();Kt();Ie();Kt();Ie();Kt();Ie();Ie();Kt();Ie();Kt();Ie();Kt();Ie();Kt();Ie();Kt();Ie();Ie();Kt();Kt();Ie();Ie();Kt();Kt();Ie();Kt();Ie();Kt();Ie();Kt();Ie();Kt();Ie();Kt();Ie();Kt();Ie();Kt();Ie();Kt();Ie();Kt();Ie();Ie();Kt();Ie();Kt();Ie();Kt();Ie();Kt();Ie();Kt();Ie();Kt();Ie();Kt();Ie();Kt();Ie();Kt();Ie();Kt();Ie();Kt();Ie();Kt();Ie();Kt();Ie();Ie();Kt();Ie();Kt();Ie();Kt();Ie();Kt();Ie();Kt();Ie();Kt();Ie();Kt();Ie();Kt();Ie();Ie();Ie();Kt();Ie();Ie();Kt();Ie();Kt();Ie();Kt();Ie();Kt();Ie();Kt();Ie();Kt();Ie();Kt();Kt();Ie();Kt();Ie();Ie();Kt();Ie();Kt();Ie();Kt();Ie();Ie();Kt();Ie();Ie();Kt();Kt();Ie();Kt();Ie();Kt();Ie();Kt();Ie();Ie();Kt();Ie();Kt();Ie();Ie();Ie();Kt();Ie();Ie();Kt();Ie();Kt();Ie();Kt();Ie();var rjo=Object.defineProperty,ijo=(e,t)=>{for(var n in t)rjo(e,n,{get:t[n],enumerable:!0})},JM={};ijo(JM,{axial:()=>a$o,bga:()=>tKo,breakoutheaders:()=>v$o,cap:()=>Ijo,crystal:()=>Sjo,d2pak:()=>lRt,dfn:()=>FKo,diode:()=>bjo,dip:()=>ujo,do219ad:()=>OKo,dpak:()=>cRt,electrolytic:()=>vZo,fpc:()=>EZo,hc49:()=>E$o,headermodule:()=>GKo,jst:()=>FJo,lcc:()=>Cer,led:()=>Pjo,led2835:()=>Mjo,led5050:()=>Bjo,lga:()=>b$o,lqfp:()=>x$o,m2host:()=>cer,melf:()=>Xqo,micromelf:()=>qqo,minimelf:()=>Fqo,mlp:()=>_Ko,mountedpcbmodule:()=>her,ms012:()=>KKo,ms013:()=>qKo,msop:()=>KJo,pad:()=>M$o,pinrow:()=>IRt,platedhole:()=>$Zo,potentiometer:()=>CZo,pushbutton:()=>m$o,qfn:()=>uKo,qfp:()=>mKo,quad:()=>CR,radial:()=>h$o,res:()=>qjo,rj45:()=>u$o,sma:()=>tJo,smb:()=>lJo,smbf:()=>wZo,smc:()=>pJo,smdpads:()=>zZo,smdpinheader:()=>jZo,smdpushbutton:()=>VZo,smdslideswitch:()=>WZo,smf:()=>iJo,smtpad:()=>HZo,sod110:()=>OJo,sod123:()=>o$o,sod123f:()=>uqo,sod123fl:()=>gqo,sod123w:()=>G$o,sod128:()=>vqo,sod323:()=>j$o,sod323f:()=>cqo,sod323fl:()=>tZo,sod323he:()=>J$o,sod323w:()=>qJo,sod523:()=>R$o,sod723:()=>xqo,sod80:()=>z$o,sod882:()=>rqo,sod882d:()=>Yqo,sod923:()=>eqo,soic:()=>oKo,solderjumper:()=>uZo,son:()=>iZo,sop8:()=>H$o,sot:()=>JZo,sot143:()=>ter,sot223:()=>AJo,sot23:()=>TKo,sot23w:()=>PJo,sot25:()=>QKo,sot323:()=>RZo,sot343:()=>rer,sot363:()=>vKo,sot457:()=>_Zo,sot563:()=>XKo,sot723:()=>ZKo,sot886:()=>EKo,sot89:()=>Rqo,sot963:()=>fZo,ssop:()=>fKo,stampboard:()=>g$o,stampreceiver:()=>y$o,to220:()=>ERt,to220f:()=>Lqo,to252:()=>gjo,to263:()=>Ajo,to92:()=>D$o,to92l:()=>mer,to92s:()=>DJo,tqfp:()=>pKo,tssop:()=>CKo,usba:()=>fer,usbcmidmount:()=>ger,usbmicro:()=>xer,vson:()=>aZo,vssop:()=>WJo,wson:()=>dZo});var Xo=(e,t,n)=>({type:"pcb_silkscreen_text",pcb_silkscreen_text_id:"silkscreen_text_1",font:"tscircuit2024",font_size:n,pcb_component_id:"pcb_component_1",text:"{REF}",layer:"top",anchor_position:{x:e,y:t},anchor_alignment:"center"}),xK=k().or(it(Jh())).transform((e)=>{if(Array.isArray(e))return e;if(e.startsWith("(")&&e.endsWith(")"))e=e.slice(1,-1);return e.split(",").map((t)=>{let n=Number(t);return isNaN(n)?t:n})}).pipe(it(k().or(Ae()))),sjo=Pt(["leftside","rightside"]),ajo=Pt(["topside","bottomside"]),cjo=Pt(["left","right"]),ljo=Pt(["top","bottom"]),sRt=xK.pipe(un([kC([sjo,ljo]),kC([ajo,cjo])])),Fo=we({norefdes:Be().optional().describe("disable reference designator label"),invert:Be().optional().describe("install the part backwards: for a pin header, the LONG pins pass through the board instead of the short ones. It does not change which side of the board the part is on — that is the component's `layer`"),faceup:Be().optional().describe("DEPRECATED, and a no-op for through-hole parts. It meant 'the male pin header should face upwards, out of the top layer', which is what a correctly mounted header does by default; its other effect was to delete the pins below the board, leaving a through-hole part that cannot be soldered into its own plated holes. Use `layer` for which side of the board a part is on, and `invert` to install it backwards"),nosilkscreen:Be().optional().describe("omit all silkscreen elements from the footprint"),rounded:be.refine((e)=>e>=0,{message:"rounded radius must be non-negative"}).optional().describe("corner radius applied to all rectangular copper pads"),pin1location:sRt.optional().describe("rotate the footprint to place pin 1 on a requested side"),cathodepin:j8.number().pipe(un([he(1),he(2)])).optional().describe("identify which diode pad is the cathode"),anodepin:j8.number().pipe(un([he(1),he(2)])).optional().describe("identify which diode pad is the anode")}),Ri=(e,t,n,o,r)=>({pcb_plated_hole_id:"",type:"pcb_plated_hole",shape:"circle",x:t,y:n,hole_diameter:Ni(o),outer_diameter:Ni(r),pcb_port_id:"",layers:["top","bottom"],port_hints:[e.toString()]}),Z1=(e)=>{let{pn:t,x:n,y:o,holeDiameter:r,rectPadWidth:i,rectPadHeight:s,holeOffsetX:a=0,holeOffsetY:c=0,rectBorderRadius:l}=e;return{pcb_plated_hole_id:"",type:"pcb_plated_hole",shape:"circular_hole_with_rect_pad",x:n,y:o,hole_diameter:Ni(r),hole_shape:"circle",pad_shape:"rect",rect_pad_width:Ni(i),rect_pad_height:Ni(s),...l!==void 0&&{rect_border_radius:l},pcb_port_id:"",layers:["top","bottom"],port_hints:[t.toString()],hole_offset_x:a,hole_offset_y:c}},D5e=Array.from({length:9},(e,t)=>Math.cos(t/8*Math.PI-Math.PI)).map((e)=>({x:e,y:-Math.sqrt(1-e**2)})),ey=(e)=>{if(e.length<2)throw Error("Rect union outline requires at least two bounds");for(let l of e)if(l.minX>=l.maxX||l.minY>=l.maxY)throw Error("Each rectangle bound must have min < max on both axes");for(let l=1;l<e.length;l++){let h=e[l-1],d=e[l];if(d.minX<h.minX||d.maxX>h.maxX||d.minY>h.minY||d.maxY<h.maxY)throw Error("Bounds must be ordered outer-to-inner with tighter X and larger Y span")}let t=()=>{let l=[],h=e.length-1;l.push({x:e[h].minX,y:e[h].maxY});while(h>0){let d=e[h],u=e[h-1];l.push({x:d.minX,y:u.maxY}),l.push({x:u.minX,y:u.maxY}),h-=1}return l},n=()=>{let l=[],h=e.length-1;l.push({x:e[h].maxX,y:e[h].maxY});while(h>0){let d=e[h],u=e[h-1];l.push({x:d.maxX,y:u.maxY}),l.push({x:u.maxX,y:u.maxY}),h-=1}return l},o=()=>{let l=[],h=e.length-1;l.push({x:e[h].maxX,y:e[h].minY});while(h>0){let d=e[h],u=e[h-1];l.push({x:d.maxX,y:u.minY}),l.push({x:u.maxX,y:u.minY}),h-=1}return l},r=()=>{let l=[],h=e.length-1;l.push({x:e[h].minX,y:e[h].minY});while(h>0){let d=e[h],u=e[h-1];l.push({x:d.minX,y:u.minY}),l.push({x:u.minX,y:u.minY}),h-=1}return l},i=t(),s=n(),a=o(),c=r();return[...i.reverse(),...s,...a.reverse(),...c]};function yR(e){if(typeof e==="string"){if(e.trim().toLowerCase().endsWith("mil"))return parseFloat(e)*0.0254;return parseFloat(e)}return Number(e)}var C5e=un([k(),Ae()]).transform((e)=>yR(e)),hjo=(e)=>Fo.extend({fn:k(),num_pins:Ae().optional().default(6),wide:Be().optional(),narrow:Be().optional(),w:C5e.optional(),p:C5e.default(e.p??"2.54mm"),id:C5e.optional(),od:C5e.optional(),nosquareplating:Be().optional().default(!1).describe("do not use rectangular pad for pin 1")}).transform((t)=>{if(!t.id&&!t.od)if(Math.abs(t.p-1.27)<0.01)t.id=yR("0.55mm"),t.od=yR("0.95mm");else t.id=yR("0.8mm"),t.od=yR("1.6mm");else if(!t.id)t.id=t.od*0.6666666666666666;else if(!t.od)t.od=t.id*1.5;if(!t.w)if(t.wide)t.w=yR("600mil");else if(t.narrow)t.w=yR("300mil");else t.w=yR(e.w??"300mil");return t}),djo=hjo({}),zNt=(e,t,n,o,r)=>{let i=e/2,s=t<=i,a=i-1,c=o,l=c*a;if(s)return{x:-n/2,y:l/2-(t-1)*c};return{x:n/2,y:-l/2+(t-i-1)*c}},ujo=(e)=>{let t=djo.parse(e),n=[];for(let g=0;g<t.num_pins;g++){let{x:f,y}=zNt(t.num_pins,g+1,t.w,t.p??2.54,t.nosquareplating);if(g===0&&!t.nosquareplating){n.push(Z1({pn:g+1,x:f,y,holeDiameter:t.id??"0.8mm",rectPadWidth:t.od??"1mm",rectPadHeight:t.od??"1mm"}));continue}n.push(Ri(g+1,f,y,t.id??"0.8mm",t.od??"1mm"))}let o=(t.num_pins/2-1)*t.p+t.od,i=t.w-t.od-1,s=(t.num_pins/2-1)*t.p+t.od+0.4,a={layer:"top",pcb_component_id:"",pcb_silkscreen_path_id:"silkscreen_path_1",route:[{x:-i/2,y:-s/2},{x:-i/2,y:s/2},...D5e.map(({x:g,y:f})=>({x:g*i/6,y:f*i/6+s/2})),{x:i/2,y:s/2},{x:i/2,y:-s/2},{x:-i/2,y:-s/2}],type:"pcb_silkscreen_path",stroke_width:0.1},c=[];for(let g=0;g<t.num_pins;g++){let f=g+1,y=f<=t.num_pins/2,x=zNt(t.num_pins,f,t.w,t.p??2.54,t.nosquareplating),C=0.6,b=y?x.x-t.od/2-0.6:x.x+t.od/2+0.6,I=0.3;c.push({type:"pcb_fabrication_note_text",pcb_fabrication_note_text_id:`pin_${f}`,layer:"top",pcb_component_id:`pin_${f}`,text:`{pin${f}}`,anchor_position:{x:b,y:x.y+0.15},font_size:0.3,font:"tscircuit2024",anchor_alignment:y?"top_right":"top_left"})}let l=Xo(0,s/2+0.5,0.4),h=t.w+t.od,d=o,u=h/2+0.25,_=u,p=d/2+0.72,m=p,A={type:"pcb_courtyard_outline",pcb_courtyard_outline_id:"",pcb_component_id:"",outline:ey([{minX:-u,maxX:u,minY:-m,maxY:m},{minX:-_,maxX:_,minY:-p,maxY:p}]),layer:"top"};return{circuitJson:[...n,a,l,...c,A],parameters:t}},uo=(e,t,n,o,r,i)=>({type:"pcb_smtpad",x:t,y:n,width:o,height:r,layer:"top",shape:"rect",...i!==void 0&&{corner_radius:i},pcb_smtpad_id:"",port_hints:Array.isArray(e)?e.map((s)=>s.toString()):[e.toString()]}),fs=(e,t={})=>({type:"pcb_silkscreen_path",layer:t.layer||"top",pcb_component_id:t.pcb_component_id||"",pcb_silkscreen_path_id:t.pcb_silkscreen_path_id||"",route:e,stroke_width:t.stroke_width||0.1}),pjo=Fo.extend({fn:k(),num_pins:un([he(3),he(6)]).default(3),p:be.default("2.29mm").describe("pitch between adjacent lead positions"),pw:be.default("1.6mm").describe("lead pad width along the pin column"),pl:be.default("3mm").describe("lead pad length toward the package"),tabw:be.default("6.2mm").describe("large tab pad width"),tabh:be.default("5.8mm").describe("large tab pad height"),span:be.default("6.85mm").describe("center-to-center distance from the leads to the tab"),w:be.default("6.6mm").describe("package body width"),h:be.default("6.5mm").describe("package body height"),string:k().optional()}),mjo={p:"2.54mm",pw:"1.5mm",pl:"3.5mm",tabw:"8.38mm",tabh:"10.7mm",span:"10.21mm",w:"10.1mm",h:"10.1mm"},_jo=(e)=>{if(e.num_pins===3||e.num_pins===6)return e.num_pins;let t=e.string?.match(/^(?:d2pak|to252|to263)_(\d+)/i),n=Number.parseInt(t?.[1]??"3",10);if(n===5||n===6)return 6;return 3},aRt=(e,t)=>{let n=pjo.parse({...t,...e,num_pins:_jo(e)}),{num_pins:o,p:r,pw:i,pl:s,tabw:a,tabh:c,span:l,w:h,h:d}=n,u=o===3?2:5,_=-l/2,p=l/2,m=[];for(let T=0;T<u;T++){let N=o===3?T*2+1:T+1,D=o===3?(1-T*2)*r:((u-1)/2-T)*r;m.push(uo(N,_,D,s,i))}m.push(uo(o===3?2:6,p,0,a,c));let A=-h/2,g=h/2,f=Math.min(_-s/2,p-a/2),y=Math.max(_+s/2,p+a/2),x=(o===3?r:(u-1)/2*r)+i/2,C=Math.max(x,c/2),b=Math.max(C,d/2)+0.2,I=[fs([{x:A,y:b},{x:g,y:b}]),fs([{x:A,y:-b},{x:g,y:-b}]),fs([{x:_-0.3,y:b+0.15},{x:_,y:b+0.45},{x:_+0.3,y:b+0.15}])],v=Math.min(f,A)-0.25,P=Math.max(y,g)+0.25,M=Math.max(C,d/2)+0.25,B={type:"pcb_courtyard_rect",pcb_courtyard_rect_id:"",pcb_component_id:"",center:{x:(v+P)/2,y:0},width:P-v,height:M*2,layer:"top"};return{circuitJson:[...m,...I,Xo(0,M+0.55,0.5),B],parameters:n}},cRt=(e)=>aRt(e),lRt=(e)=>aRt(e,mjo),gjo=cRt,Ajo=lRt,hRt=[{imperial:"01005",metric:"0402",p_mm_min:0.5,pw_mm_min:0.4,ph_mm_min:0.3,w_mm_min:0.58,h_mm_min:0.21,courtyard_width_mm:1.2,courtyard_height_mm:0.6},{imperial:"0504",metric:"1310",p_mm_min:1.1,pw_mm_min:0.65,ph_mm_min:1.3,w_mm_min:0.58,h_mm_min:0.21},{imperial:"1812",metric:"4532",p_mm_min:4.275,pw_mm_min:1.125,ph_mm_min:3.4,w_mm_min:5.4,h_mm_min:3.4,courtyard_width_mm:5.9,courtyard_height_mm:3.9,rounded_pads:!0,nonpolarizedSilkscreen:{line_half_length_mm:1.386252,line_y_mm:1.71,stroke_width_mm:0.12}},{imperial:"0201",metric:"0603",p_mm_min:0.66,pw_mm_min:0.46,ph_mm_min:0.4,w_mm_min:0.9,h_mm_min:0.3,courtyard_width_mm:1.4,courtyard_height_mm:0.7,rounded_pads:!0},{imperial:"0402",metric:"1005",p_mm_min:1.02,pw_mm_min:0.54,ph_mm_min:0.64,w_mm_min:1.56,h_mm_min:0.64,courtyard_width_mm:1.86,courtyard_height_mm:0.94,rounded_pads:!0,nonpolarizedSilkscreen:{line_half_length_mm:0.153641,line_y_mm:0.38,stroke_width_mm:0.12}},{imperial:"0603",metric:"1608",p_mm_min:1.65,pw_mm_min:0.8,ph_mm_min:0.95,w_mm_min:2.45,h_mm_min:0.95,courtyard_width_mm:2.96,courtyard_height_mm:1.46,rounded_pads:!0,nonpolarizedSilkscreen:{line_half_length_mm:0.237258,line_y_mm:0.5225,stroke_width_mm:0.12}},{imperial:"0805",metric:"2012",p_mm_min:1.825,pw_mm_min:1.025,ph_mm_min:1.4,w_mm_min:2.8499999999999996,h_mm_min:1.4,courtyard_width_mm:3.36,courtyard_height_mm:1.9,rounded_pads:!0,nonpolarizedSilkscreen:{line_half_length_mm:0.227064,line_y_mm:0.735,stroke_width_mm:0.12}},{imperial:"1206",metric:"3216",p_mm_min:2.925,pw_mm_min:1.125,ph_mm_min:1.75,w_mm_min:4.05,h_mm_min:1.75,courtyard_width_mm:4.56,courtyard_height_mm:2.26,rounded_pads:!0,nonpolarizedSilkscreen:{line_half_length_mm:0.727064,line_y_mm:0.91,stroke_width_mm:0.12}},{imperial:"1210",metric:"3225",p_mm_min:2.925,pw_mm_min:1.125,ph_mm_min:2.65,w_mm_min:4.05,h_mm_min:2.65,courtyard_width_mm:4.56,courtyard_height_mm:3.16,rounded_pads:!0,nonpolarizedSilkscreen:{line_half_length_mm:0.723737,line_y_mm:1.355,stroke_width_mm:0.12}},{imperial:"2010",metric:"5025",p_mm_min:4.625,pw_mm_min:1.225,ph_mm_min:2.65,w_mm_min:5.85,h_mm_min:2.65,courtyard_width_mm:6.36,courtyard_height_mm:3.16,rounded_pads:!0,nonpolarizedSilkscreen:{line_half_length_mm:1.527064,line_y_mm:1.36,stroke_width_mm:0.12}},{imperial:"2512",metric:"6332",p_mm_min:5.925,pw_mm_min:1.225,ph_mm_min:3.35,w_mm_min:7.15,h_mm_min:3.35,courtyard_width_mm:7.66,courtyard_height_mm:3.86,rounded_pads:!0,nonpolarizedSilkscreen:{line_half_length_mm:2.177064,line_y_mm:1.71,stroke_width_mm:0.12}}],fjo=Object.fromEntries(hRt.map((e)=>[e.metric,e])),yjo=Object.fromEntries(hRt.map((e)=>[e.imperial,e])),ONt=(e,t)=>({type:"pcb_courtyard_rect",pcb_courtyard_rect_id:"",pcb_component_id:"",center:{x:0,y:0},width:e,height:t,layer:"top"}),HSs=Fo.extend({fn:k().optional(),string:k().optional(),tht:Be(),p:be.optional(),pw:be.optional(),ph:be.optional(),metric:Ke.optional(),imperial:Ke.optional(),w:be.optional(),h:be.optional(),cyw:be.optional().describe("courtyard width"),cyh:be.optional().describe("courtyard height"),nonpolarized:Be().optional(),textbottom:Be().optional(),roundedPads:Be().optional()}),N5e=(e)=>{let{fn:t,tht:n,p:o,pw:r,ph:i,metric:s,imperial:a,w:c,h:l,cyw:h,cyh:d,nonpolarized:u,textbottom:_,roundedPads:p,string:m}=e;if(typeof c==="string")c=Dl(c);if(typeof l==="string")l=Dl(l);if(typeof h==="string")h=Dl(h);if(typeof d==="string")d=Dl(d);if(typeof o==="string")o=Dl(o);if(typeof r==="string")r=Dl(r);if(typeof i==="string")i=Dl(i);if(l!==void 0&&c!==void 0&&l>c)throw Error("height cannot be greater than width (rotated footprint not yet implemented)");let A;if(s)A=fjo[s];if(a)A=yjo[a];if(A)c=A.w_mm_min,l=A.h_mm_min,o=A.p_mm_min,r=A.pw_mm_min,i=A.ph_mm_min;if(o===void 0||r===void 0||i===void 0)throw Error("Could not determine required pad dimensions (p, pw, ph)");let g=[],f=t==="res"&&(u===!0||typeof m!=="string"||/^res(?:\d{4}|\d{5})(?:_|$)/i.test(m))?A?.nonpolarizedSilkscreen:void 0;if(f?.stroke_width_mm){let{line_half_length_mm:v=0,line_y_mm:P=0,stroke_width_mm:M}=f;g=[{type:"pcb_silkscreen_path",layer:"top",pcb_component_id:"",route:[{x:-v,y:P},{x:v,y:P}],stroke_width:M,pcb_silkscreen_path_id:""},{type:"pcb_silkscreen_path",layer:"top",pcb_component_id:"",route:[{x:-v,y:-P},{x:v,y:-P}],stroke_width:M,pcb_silkscreen_path_id:""}]}else g=[{type:"pcb_silkscreen_path",layer:"top",pcb_component_id:"",route:[{x:o/2,y:i/2+0.4},{x:-o/2-r/2-0.2,y:i/2+0.4},{x:-o/2-r/2-0.2,y:-i/2-0.4},{x:o/2,y:-i/2-0.4}],stroke_width:0.1,pcb_silkscreen_path_id:""}];let y=_?-i/2-0.9:i/2+0.9,x=Xo(0,y,0.2),C=A?.courtyard_width_mm&&A.courtyard_height_mm?ONt(A.courtyard_width_mm,A.courtyard_height_mm):h!==void 0&&d!==void 0?ONt(h,d):null,I=p??A?.rounded_pads??!1?Math.min(0.125,Math.min(r,i)/8):void 0;if(n)return[Ri(1,-o/2,0,r,r*1/0.8),Ri(2,o/2,0,r,r*1/0.8),...g,x,...C?[C]:[]];return[uo(["1","left"],-o/2,0,r,i,I),uo(["2","right"],o/2,0,r,i,I),...g,x,...C?[C]:[]]},xjo=(e)=>{let{POSITIVE_INFINITY:t,NEGATIVE_INFINITY:n,POSITIVE_INFINITY:o,NEGATIVE_INFINITY:r}=Number;for(let i of e){if(i.type==="pcb_smtpad")t=Math.min(t,i.x-i.width/2),n=Math.max(n,i.x+i.width/2),o=Math.min(o,i.y-i.height/2),r=Math.max(r,i.y+i.height/2);if(i.type==="pcb_plated_hole")t=Math.min(t,i.x-i.outer_diameter/2),n=Math.max(n,i.x+i.outer_diameter/2),o=Math.min(o,i.y-i.outer_diameter/2),r=Math.max(r,i.y+i.outer_diameter/2)}if(!Number.isFinite(t)||!Number.isFinite(n)||!Number.isFinite(o)||!Number.isFinite(r))throw Error("Could not determine diode copper bounds");return{minX:t,maxX:n,minY:o,maxY:r}},yGe=(e,t={})=>R5e(xjo(e),t),Cjo=({anodePin:e,cathodePin:t})=>{if(e!==void 0&&e!==1&&e!==2)throw Error("Diode anode pin must be 1 or 2");if(t!==void 0&&t!==1&&t!==2)throw Error("Diode cathode pin must be 1 or 2");if(e!==void 0&&t!==void 0){if(e===t)throw Error("Diode anode and cathode cannot use the same pin");return t}if(t!==void 0)return t;if(e===1)return 2;if(e===2)return 1;return},f0=(e)=>{let t=e.p??e.pad_spacing;if(t===void 0||e.pl===void 0||e.pw===void 0)throw Error("Diode fabrication note requires p or pad_spacing, pl, and pw");let n=be.parse(t),o=be.parse(e.pl),r=be.parse(e.pw);return R5e({minX:-n/2-o/2,maxX:n/2+o/2,minY:-r/2,maxY:r/2},{anodePin:e.anodepin,cathodePin:e.cathodepin})},R5e=(e,t={})=>{let n=[],o=e.maxX-e.minX,r=e.maxY-e.minY,i=(e.minX+e.maxX)/2,s=(e.minY+e.maxY)/2,c=Cjo(t)===1?(b)=>2*i-b:(b)=>b,l=r*0.28,h=l*2,d=o*0.2,u=1.25,_=Math.min(d,h*1.25),p=i-_/2,m=i+_/2,A=_*0.18,g=p+A,f=m-A,y=Math.max(Math.min(o,r)*0.035,0.01),x=Math.max(Math.min(o,r)*0.25,0.1),C=(b)=>t.idSuffix?`${b}_${t.idSuffix}`:b;return n.push({type:"pcb_fabrication_note_path",pcb_fabrication_note_path_id:C("diode_fabrication_note_anode_leg"),pcb_component_id:"",layer:"top",stroke_width:y,route:[{x:c(p),y:s},{x:c(g),y:s}]},{type:"pcb_fabrication_note_path",pcb_fabrication_note_path_id:C("diode_fabrication_note_triangle"),pcb_component_id:"",layer:"top",stroke_width:y,route:[{x:c(g),y:s+l},{x:c(f),y:s},{x:c(g),y:s-l},{x:c(g),y:s+l}]},{type:"pcb_fabrication_note_path",pcb_fabrication_note_path_id:C("diode_fabrication_note_cathode"),pcb_component_id:"",layer:"top",stroke_width:y,route:[{x:c(f),y:s+l},{x:c(f),y:s-l}]},{type:"pcb_fabrication_note_path",pcb_fabrication_note_path_id:C("diode_fabrication_note_cathode_leg"),pcb_component_id:"",layer:"top",stroke_width:y,route:[{x:c(f),y:s},{x:c(m),y:s}]},{type:"pcb_fabrication_note_text",pcb_fabrication_note_text_id:C("diode_fabrication_note_positive"),pcb_component_id:"",layer:"top",font:"tscircuit2024",font_size:x,text:"+",anchor_position:{x:c(e.minX+o*0.125),y:s},anchor_alignment:"center"},{type:"pcb_fabrication_note_text",pcb_fabrication_note_text_id:C("diode_fabrication_note_negative"),pcb_component_id:"",layer:"top",font:"tscircuit2024",font_size:x,text:"-",anchor_position:{x:c(e.maxX-o*0.125),y:s},anchor_alignment:"center"}),n},bjo=(e)=>{let t=N5e({...e,roundedPads:!0}),{anodepin:n,cathodepin:o}=Fo.parse(e);return{circuitJson:t.concat(yGe(t,{anodePin:n,cathodePin:o})),parameters:e}},Ijo=(e)=>({circuitJson:N5e(e),parameters:e}),vjo=Fo.extend({fn:he("crystal"),num_pins:he(4).default(4),px:be.default("2.2mm").describe("horizontal pad center pitch"),py:be.default("1.7mm").describe("vertical pad center pitch"),pw:be.default("1.4mm").describe("pad width"),ph:be.default("1.2mm").describe("pad height")}),Sjo=(e)=>{let t=vjo.parse(e),{px:n,py:o,pw:r,ph:i}=t,s=[uo(1,-n/2,-o/2,r,i),uo(2,n/2,-o/2,r,i),uo(3,n/2,o/2,r,i),uo(4,-n/2,o/2,r,i)],a=(n+r)/2+0.2,c=(o+i)/2+0.2,l=fs([{x:-a,y:-c},{x:a,y:-c},{x:a,y:c},{x:-a,y:c},{x:-a,y:-c}]),h=Xo(0,c+0.6,0.5),d={type:"pcb_courtyard_rect",pcb_courtyard_rect_id:"",pcb_component_id:"",center:{x:0,y:0},width:n+r+0.5,height:o+i+0.5,layer:"top"};return{circuitJson:[...s,l,h,d],parameters:t}},Pjo=(e)=>{let t=N5e(e),{anodepin:n,cathodepin:o}=Fo.parse(e);return{circuitJson:t.concat(yGe(t,{anodePin:n,cathodePin:o})).map((i)=>{if(i.type!=="pcb_silkscreen_path")return i;return{...i,route:i.route.map((s)=>({...s,x:-s.x}))}}),parameters:e}},Ejo=Fo.extend({fn:he("led2835"),num_pins:he(2).default(2),p1w:be.default("2.2mm").describe("pin 1 (anode) pad width"),p2w:be.default("1.25mm").describe("pin 2 (cathode) pad width"),ph:be.default("2.2mm").describe("pad height"),p1x:be.default("-0.9mm").describe("pin 1 pad center x"),p2x:be.default("1.375mm").describe("pin 2 pad center x"),w:be.default("3.5mm").describe("package body width"),h:be.default("2.8mm").describe("package body height")}),Mjo=(e)=>{let t=Ejo.parse(e),{p1w:n,p2w:o,ph:r,p1x:i,p2x:s,w:a,h:c}=t,l=[uo(1,i,0,n,r),uo(2,s,0,o,r)],h=a/2+0.45,d=c/2+0.2,u=[fs([{x:s-o/2,y:-d},{x:-h,y:-d},{x:-h,y:d},{x:s-o/2,y:d}])],_=Xo(0,d+0.8,0.5),p={type:"pcb_courtyard_rect",pcb_courtyard_rect_id:"",pcb_component_id:"",center:{x:(i-n/2+s+o/2)/2,y:0},width:s+o/2-(i-n/2)+0.5,height:Math.max(c,r)+0.5,layer:"top"},m=R5e({minX:Math.min(i-n/2,s-o/2),maxX:Math.max(i+n/2,s+o/2),minY:-r/2,maxY:r/2},{anodePin:t.anodepin,cathodePin:t.cathodepin});return{circuitJson:[...l,...u,_,p,...m],parameters:t}},wjo=Fo.extend({fn:he("led5050"),num_pins:he(6).default(6),p:be.default("1.7mm").describe("pin pitch along each column"),rowspan:be.default("4.8mm").describe("distance between pad columns"),pl:be.default("2mm").describe("pad length across the package edge"),pw:be.default("1.1mm").describe("pad width along the pin column"),w:be.default("5mm").describe("package body width"),h:be.default("5mm").describe("package body height")}),Bjo=(e)=>{let t=wjo.parse(e),{p:n,rowspan:o,pl:r,pw:i,w:s,h:a}=t,c=[];for(let A=0;A<3;A++)c.push(uo(A+1,-o/2,n-A*n,r,i)),c.push(uo(6-A,o/2,n-A*n,r,i));let l=s/2,h=a/2+0.2,d=[fs([{x:-l,y:h},{x:l,y:h}]),fs([{x:-l,y:-h},{x:l,y:-h}]),fs([{x:-o/2-r/2-0.4,y:n+i/2},{x:-o/2-r/2-0.4,y:n-i/2}])],u=Xo(0,h+0.8,0.5),_={type:"pcb_courtyard_rect",pcb_courtyard_rect_id:"",pcb_component_id:"",center:{x:0,y:0},width:o+r+0.5,height:Math.max(a,2*n+i)+0.5,layer:"top"},m=[{color:"green",y:n},{color:"red",y:0},{color:"blue",y:-n}].flatMap(({color:A,y:g})=>R5e({minX:-o/2-r/2,maxX:o/2+r/2,minY:g-i/2,maxY:g+i/2},{idSuffix:A}));return{circuitJson:[...c,...d,u,_,...m],parameters:t}},CK=(e)=>{let{padSpacing:t,padWidth:n,padHeight:o,padPitch:r,numRows:i,textbottom:s,courtyardOutline:a}=e,c=[],l=(i-1)*(r/2);for(let M=0;M<i;M++)c.push(l-M*r);let h=[];c.forEach((M,B)=>{h.push(uo(B+1,-t/2,M,n,o))}),c.slice().reverse().forEach((M,B)=>{h.push(uo(B+i+1,t/2,M,n,o))});let d=Math.max(...c)+o/2+0.4,u=Math.min(...c)-o/2-0.4,_=-t/2-n/2-0.4,p=t/2+n/2+0.4,m={type:"pcb_silkscreen_path",layer:"top",pcb_component_id:"",route:[{x:p*0.5,y:d},{x:_*0.5,y:d}],stroke_width:0.12,pcb_silkscreen_path_id:"silkscreen_top"},A={type:"pcb_silkscreen_path",layer:"top",pcb_component_id:"",route:[{x:p*0.5,y:u},{x:_*0.5,y:u}],stroke_width:0.12,pcb_silkscreen_path_id:"silkscreen_bottom"},g=-t/2,f=Math.max(...c),y=0.2,x=g-n/2-0.1,C=f+o/2+0.1,b={type:"pcb_silkscreen_path",layer:"top",pcb_component_id:"",pcb_silkscreen_path_id:"pin1_marker",route:[{x,y:C},{x:x-y,y:C},{x,y:C+y},{x,y:C}],stroke_width:0.1},I=s?u-0.9:d+0.9,v=Xo(0,I,0.2),P=a?{type:"pcb_courtyard_outline",pcb_courtyard_outline_id:"",pcb_component_id:"",layer:"top",outline:a}:null;return[...h,m,A,b,v,...P?[P]:[]]},Tjo=Fo.extend({pw:be.default("0.5mm"),ph:be.default("0.4mm"),p:be.default("0.7mm"),textbottom:Be().optional(),convex:Be().optional(),concave:Be().optional()}),Djo=1,Njo=(e)=>{let t=Tjo.parse(e);if(t.concave===!0)return[];let n=Dl(t.pw),o=Dl(t.ph),r=Dl(t.p);return CK({padSpacing:Djo,padWidth:n,padHeight:o,padPitch:r,numRows:2,textbottom:t.textbottom,convex:t.convex,concave:t.concave,courtyardOutline:[{x:-1,y:0.95},{x:-1,y:-0.95},{x:1,y:-0.95},{x:1,y:0.95}]})},Rjo=Fo.extend({pw:be.default("0.5mm"),ph:be.default("0.32mm"),p:be.default("0.5mm"),textbottom:Be().optional(),convex:Be().optional(),concave:Be().optional()}),Qjo=1,kjo=(e)=>{let t=Rjo.parse(e),n=Dl(t.pw),o=Dl(t.ph),r=Dl(t.p);return CK({padSpacing:Qjo,padWidth:n,padHeight:o,padPitch:r,numRows:4,textbottom:t.textbottom,convex:t.convex,concave:t.concave,courtyardOutline:[{x:-1,y:1.25},{x:-1,y:-1.25},{x:1,y:-1.25},{x:1,y:1.25}]})},Ljo=Fo.extend({pw:be.default("0.9mm"),ph:be.default("0.4mm"),p:be.default("0.8mm"),textbottom:Be().optional(),convex:Be().optional(),concave:Be().optional()}),Hjo=1.7,Fjo=(e)=>{let t=Ljo.parse(e),n=Dl(t.pw),o=Dl(t.ph),r=Dl(t.p);return CK({padSpacing:Hjo,padWidth:n,padHeight:o,padPitch:r,numRows:2,textbottom:t.textbottom,convex:t.convex,concave:t.concave,courtyardOutline:[{x:-1.55,y:1.05},{x:-1.55,y:-1.05},{x:1.55,y:-1.05},{x:1.55,y:1.05}]})},zjo=Fo.extend({pw:be.default("0.9mm"),ph:be.default("0.4mm"),p:be.default("0.8mm"),textbottom:Be().optional(),convex:Be().optional(),concave:Be().optional()}),Ojo=1.7,Vjo=(e)=>{let t=zjo.parse(e),n=Dl(t.pw),o=Dl(t.ph),r=Dl(t.p);return CK({padSpacing:Ojo,padWidth:n,padHeight:o,padPitch:r,numRows:4,textbottom:t.textbottom,convex:t.convex,concave:t.concave,courtyardOutline:[{x:-1.55,y:1.88},{x:-1.55,y:-1.87},{x:1.55,y:-1.87},{x:1.55,y:1.88}]})},Yjo=Fo.extend({pw:be.default("0.7mm"),ph:be.default("0.64mm"),p:be.default("0.94mm"),textbottom:Be().optional(),convex:Be().optional(),concave:Be().optional()}),Gjo=1.4,Ujo=(e)=>{let t=Yjo.parse(e),n=Dl(t.pw),o=Dl(t.ph),r=Dl(t.p);return CK({padSpacing:Gjo,padWidth:n,padHeight:o,padPitch:r,numRows:2,textbottom:t.textbottom,convex:t.convex,concave:t.concave,courtyardOutline:[{x:-1.3,y:1.05},{x:-1.3,y:-1.05},{x:1.3,y:-1.05},{x:1.3,y:1.05}]})},Wjo=Fo.extend({pw:be.default("0.9mm"),ph:be.default("0.9mm"),p:be.default("1.34mm"),textbottom:Be().optional(),convex:Be().optional(),concave:Be().optional()}),Xjo=3,jjo=(e)=>{let t=Wjo.parse(e),n=Dl(t.pw),o=Dl(t.ph),r=Dl(t.p);return CK({padSpacing:Xjo,padWidth:n,padHeight:o,padPitch:r,numRows:4,textbottom:t.textbottom,convex:t.convex,concave:t.concave,courtyardOutline:[{x:-2.21,y:2.85},{x:-2.21,y:-2.85},{x:2.2,y:-2.85},{x:2.2,y:2.85}]})},Kjo=(e)=>{let t=e.array??e.x;if(typeof t==="number")return Number.isNaN(t)?void 0:t;if(typeof t==="string"){let n=Number.parseInt(t,10);return Number.isNaN(n)?void 0:n}if(typeof e.imperial==="string"){let o=e.imperial.match(/x(2|4)$/)?.[1];if(o)return Number.parseInt(o,10)}return},$jo=(e)=>{if(!e)return;return(typeof e==="number"?`${e}`:e).split(/[_x]/)[0]},qjo=(e)=>{let t=Kjo(e),n=$jo(e.imperial);if(t===2&&n==="0402")return{circuitJson:Njo(e),parameters:e};if(t===4&&n==="0402")return{circuitJson:kjo(e),parameters:e};if(t===2&&n==="0603")return{circuitJson:Fjo(e),parameters:e};if(t===4&&n==="0603")return{circuitJson:Vjo(e),parameters:e};if(t===2&&n==="0606")return{circuitJson:Ujo(e),parameters:e};if(t===4&&n==="1206")return{circuitJson:jjo(e),parameters:e};return{circuitJson:N5e(e),parameters:e}},w5e=(e,{x:t,y:n,radius:o})=>({type:"pcb_smtpad",x:t,y:n,radius:o,layer:"top",shape:"circle",pcb_smtpad_id:"",port_hints:Array.isArray(e)?e.map((r)=>r.toString()):[e.toString()]}),Jjo="ABCDEFGHIJKLMNOPQRSTUVWXYZ",Px=k().transform((e)=>{let[t,n]=e.split(/[x ]/);return{x:be.parse(t??""),y:be.parse(n??"")}}).pipe(we({x:Ae(),y:Ae()})),dRt="ABCDEFGHJKLMNPRTUVWY",uRt=(e,t=dRt)=>{let n=e+1,o="";while(n>0)n--,o=t[n%t.length]+o,n=Math.floor(n/t.length);return o},Zjo=Pt(["rowmajor","columnmajor","ballcoords"]),eKo=Fo.extend({fn:k(),num_pins:Ae().optional().default(64),grid:Px.optional(),p:Ke.default("0.8mm"),w:be.optional(),h:be.optional(),ball:be.optional().describe("ball diameter"),pad:be.optional().describe("pad width/height"),circularpads:Be().optional().default(!0).describe("use circular pads"),tlorigin:Be().optional(),blorigin:Be().optional(),trorigin:Be().optional(),brorigin:Be().optional(),pinnumbering:are((e)=>typeof e==="string"?e.trim().replace(/^\(([^()]*)\)$/,"$1"):e,Zjo).optional().describe("rowmajor or columnmajor numeric IDs, or ball-coordinate IDs"),missing:xK.default([])}).transform((e,t)=>{let n="tl";if(e.blorigin)n="bl";if(e.trorigin)n="tr";if(e.brorigin)n="br";if(!e.grid){let i=Math.ceil(Math.sqrt(e.num_pins));e.grid={x:i,y:i}}let o=Array.from({length:e.grid.y},(i,s)=>uRt(s,e.pinnumbering?dRt:Jjo));if(e.missing)e.missing=e.missing.map((i)=>{if(typeof i==="number")return i;if(i==="center")return"center";if(i==="topleft")return"topleft";let s=i.match(/^([A-Z]+)(\d+)$/);if(!s)return i;let a=o.indexOf(s[1]),c=Number.parseInt(s[2])-1;if(a<0||c<0||c>=e.grid.x)t.addIssue({code:Vt.custom,path:["missing"],message:`Missing ball ${i} is outside the BGA grid or row alphabet`});return a*e.grid.x+c+1});return{...e,origin:n,rowLabels:o}}),tKo=(e)=>{let t=eKo.parse(e),{num_pins:n,grid:o,p:r,w:i,h:s,ball:a,pad:c,missing:l}=t;a??=0.5905511811023622*r,c??=t.ball===void 0?r*0.5:a*0.8;let h=[],d=(l??[]).filter((U)=>typeof U==="number"),u=o.x*o.y-n;if(l.length===0&&u>0){if(Math.sqrt(u)%1===0)l.push("center");else if(u===1)l.push("topleft")}if(l?.includes("center")){let U=Math.floor(Math.sqrt(u)),j=Math.floor((o.x-U)/2),Y=Math.floor((o.y-U)/2);for(let X=Y;X<Y+U;X++)for(let K=j;K<j+U;K++)d.push(X*o.x+K+1)}if(l?.includes("topleft"))d.push(1);let _=new Set(d),p=Array.from({length:o.x*o.y},(U,j)=>j+1).filter((U)=>!_.has(U));if(t.pinnumbering==="columnmajor"){let U=(j)=>(j-1)%o.x*o.y+Math.floor((j-1)/o.x);p.sort((j,Y)=>U(j)-U(Y))}let m=new Map(p.map((U,j)=>[U,j+1]));for(let U=0;U<o.y;U++)for(let j=0;j<o.x;j++){let Y=(j-(o.x-1)/2)*r,X=(U-(o.y-1)/2)*r,K=j,J=U;switch(t.origin){case"bl":K=j,J=o.y-1-U;break;case"br":K=o.x-1-j,J=o.y-1-U;break;case"tr":K=o.x-1-j,J=U;break;case"tl":default:break}let ee=m.get(J*o.x+K+1);if(ee===void 0)continue;let se=`${t.rowLabels[J]}${K+1}`,ne=t.pinnumbering==="ballcoords"?[se]:[ee,se];h.push(t.circularpads?w5e(ne,{x:Y,y:X,radius:c/2}):uo(ne,Y,X,c,c))}let A=Xo(0,o.y*r/2,0.2),g=r/6,f,y=o.x*r/2,x=o.y*r/2;switch(t.origin){case"bl":f=[{x:-y,y:-x},{x:-y,y:-x-g},{x:-y-g,y:-x},{x:-y,y:-x}];break;case"br":f=[{x:y,y:-x},{x:y,y:-x-g},{x:y+g,y:-x},{x:y,y:-x}];break;case"tr":f=[{x:y,y:x},{x:y,y:x+g},{x:y+g,y:x},{x:y,y:x}];break;case"tl":default:f=[{x:-y,y:x},{x:-y,y:x+g},{x:-y-g,y:x},{x:-y,y:x}];break}if(t.pinnumbering)f=f.map(({x:U,y:j})=>({x:U,y:-j}));let C={type:"pcb_silkscreen_path",layer:"top",pcb_component_id:"",pcb_silkscreen_path_id:"pin1_marker",route:f,stroke_width:0.05},b=(o.x-1)*r+c,I=(o.y-1)*r+c,v=i??b,P=s??I,M=Math.max(b/2,v/2),B=Math.max(I/2,P/2),T=1.715,N=1.765,D=M+T,L=D,H=B+N,V=H,O={type:"pcb_courtyard_outline",pcb_courtyard_outline_id:"",pcb_component_id:"",outline:ey([{minX:-D,maxX:D,minY:-V,maxY:V},{minX:-L,maxX:L,minY:-H,maxY:H}]),layer:"top"};return{circuitJson:[...h,A,C,O],parameters:t}},xR=(e,t,n,o,r)=>({type:"pcb_smtpad",x:t,y:n,width:o,height:r,radius:Math.min(o,r)/2,layer:"top",shape:"pill",pcb_smtpad_id:"",port_hints:Array.isArray(e)?e.map((i)=>i.toString()):[e.toString()]}),bK={thermalpadcenteroffsetx:be.optional().default(0),thermalpadcenteroffsety:be.optional().default(0)},ZM=(e,t)=>uo(["thermalpad"],t.x,t.y,e.x,e.y),qz=(e)=>Fo.extend({fn:k(),num_pins:Ae().optional().default(8),w:be.default(be.parse(e.w??"5.3mm")),p:be.default(be.parse(e.p??"1.27mm")),pw:be.default(be.parse(e.pw??"0.6mm")),pl:be.default(be.parse(e.pl??"1.0mm")),legsoutside:Be().optional().default(e.legsoutside??!1),pillpads:Be().optional().default(e.pillpads??!1),thermalpad:Px.optional(),...bK,silkscreen_stroke_width:Ae().optional().default(0.1)}).transform((t)=>{if(!t.pw&&!t.pl)t.pw=be.parse("0.6mm"),t.pl=be.parse("1.0mm");else if(!t.pw)t.pw=t.pl*0.6;else if(!t.pl)t.pl=t.pw*1.6666666666666667;return t}),nKo=qz({}),xGe=(e)=>{if(e.widthincludeslegs!==void 0)e.legsoutside=!e.widthincludeslegs;let{num_pins:t,pn:n,w:o,p:r,pl:i,legsoutside:s}=e,a=t/2,c=n<=a,l=a-1,h=r,d=h*l,u=s?i/2:-i/2;if(c)return{x:-o/2-u,y:d/2-(n-1)*h};return{x:o/2+u,y:-d/2+(n-a-1)*h}},oKo=(e)=>{let t=nKo.parse(e);return{circuitJson:Yse(t),parameters:t}},Yse=(e)=>{let t=[],n=Math.min(e.pl,e.pw)/8,o=0,r=0;for(let g=0;g<e.num_pins;g++){let{x:f,y}=xGe({num_pins:e.num_pins,pn:g+1,w:e.w,p:e.p,pl:e.pl,legsoutside:e.legsoutside});if(o=Math.max(o,Math.abs(f)+e.pl/2),r=Math.max(r,Math.abs(y)+e.pw/2),e.pillpads)t.push(xR(g+1,f,y,e.pl,e.pw));else t.push(uo(g+1,f,y,e.pl,e.pw,n))}if(e.thermalpad)t.push(ZM(e.thermalpad,{x:e.thermalpadcenteroffsetx,y:e.thermalpadcenteroffsety}));let i=Math.min(1,e.p/2),s=e.w-(e.legsoutside?0:e.pl*2)-0.2,a=(e.num_pins/2-1)*e.p+e.pw+i,c=Xo(0,a/2+0.4,a/12),l={type:"pcb_silkscreen_path",layer:"top",pcb_component_id:"",pcb_silkscreen_path_id:"silkscreen_path_1",stroke_width:e.silkscreen_stroke_width??0.1,route:[{x:-s/2,y:-a/2},{x:-s/2,y:a/2},...D5e.map(({x:g,y:f})=>({x:g*s/6,y:f*s/6+a/2})),{x:s/2,y:a/2},{x:s/2,y:-a/2},{x:-s/2,y:-a/2}]},h=e.w/2,d=a/2,u=Math.max(o,h)+0.25,_=Math.min(r,d)+0.25,p=Math.min(o,h)+0.25,m=Math.max(r,d)+0.25,A={type:"pcb_courtyard_outline",pcb_courtyard_outline_id:"",pcb_component_id:"",layer:"top",outline:ey([{minX:-u,maxX:u,minY:-_,maxY:_},{minX:-p,maxX:p,minY:-m,maxY:m}])};return[...t,l,c,A]},pRt=({num_pins:e,sidePinCounts:t,cw:n,ccw:o,startingpin:r})=>{let i=[],s=t.left,a=s+1,c=t.left+t.bottom,l=c+1,h=t.left+t.bottom+t.right,d=h+1,u=1,_={};for(let p of r??[])_[p]=!0;if(!_.leftside&&!_.topside&&!_.rightside&&!_.bottomside)_.leftside=!0;if(!_.bottompin&&!_.leftpin&&!_.rightpin&&!_.toppin){if(_.leftside)_.toppin=!0;else if(_.topside)_.rightpin=!0;else if(_.rightside)_.bottompin=!0;else if(_.bottomside)_.leftpin=!0}if(_.leftside&&_.toppin)u=1;else if(_.leftside&&_.bottompin)u=s;else if(_.bottomside&&_.leftpin)u=a;else if(_.bottomside&&_.rightpin)u=c;else if(_.rightside&&_.bottompin)u=l;else if(_.rightside&&_.toppin)u=h;else if(_.topside&&_.rightpin)u=d;else if(_.topside&&_.leftpin)u=e;i.push(-1);for(let p=0;p<e;p++)if(i[u]=p+1,o||!n){if(u++,u>e)u=1}else if(u--,u<1)u=e;return i},VNt=(e,t,n,o)=>{if(t!==void 0&&o!==void 0&&t!==o)throw Error(`Conflicting ${e} (${t}) and ${n} (${o})`);return o??t},mRt=(e)=>{let t=VNt("lrpins",e.lrpins,"leftrightpins",e.leftrightpins),n=VNt("tbpins",e.tbpins,"topbottompins",e.topbottompins),o=e.num_pins/4,r={left:e.leftpins??t??o,top:e.toppins??n??o,right:e.rightpins??t??o,bottom:e.bottompins??n??o};if([e.leftpins,e.toppins,e.rightpins,e.bottompins,e.lrpins,e.leftrightpins,e.tbpins,e.topbottompins].some((s)=>s!==void 0)){let s=Object.entries(r),a=s.find(([,l])=>!Number.isInteger(l)||l<1);if(a)throw Error(`Quad ${a[0]} pin count must be a positive integer, got ${a[1]}`);let c=s.reduce((l,[,h])=>l+h,0);if(c!==e.num_pins)throw Error(`Quad side pin counts left=${r.left}, top=${r.top}, right=${r.right}, bottom=${r.bottom} require ${c} pins, got ${e.num_pins}`)}return r},B5e=Pt(["leftside","topside","rightside","bottomside","toppin","bottompin","leftpin","rightpin"]),AR=j8.number().int().positive().optional(),Q5e=Fo.extend({fn:k(),cc:Be().default(!0).optional(),ccw:Be().default(!0).optional(),startingpin:k().or(it(B5e)).transform((e)=>typeof e==="string"?e.slice(1,-1).split(","):e).pipe(it(B5e)).optional(),num_pins:Ae().optional().default(64),leftpins:AR,toppins:AR,rightpins:AR,bottompins:AR,lrpins:AR,leftrightpins:AR,tbpins:AR,topbottompins:AR,w:be.optional(),h:be.optional(),p:be.default(be.parse("0.5mm")),px:be.optional().describe("top and bottom side pad pitch"),py:be.optional().describe("left and right side pad pitch"),pw:be.optional(),pl:be.optional(),lrpw:be.optional().describe("alias for leftrightpadwidth"),lrpl:be.optional().describe("alias for leftrightpadlength"),leftrightpadwidth:be.optional().describe("left and right side pad width"),leftrightpadlength:be.optional().describe("left and right side pad length"),thermalpad:un([he(!0),Px]).optional(),...bK,pillpads:Be().optional().default(!1),legsoutside:Be().default(!1)}),k5e=(e)=>{if(e.lrpw!==void 0&&e.leftrightpadwidth!==void 0&&e.lrpw!==e.leftrightpadwidth)throw Error(`Conflicting lrpw (${e.lrpw}) and leftrightpadwidth (${e.leftrightpadwidth})`);if(e.lrpl!==void 0&&e.leftrightpadlength!==void 0&&e.lrpl!==e.leftrightpadlength)throw Error(`Conflicting lrpl (${e.lrpl}) and leftrightpadlength (${e.leftrightpadlength})`);if(e.leftrightpadwidth=e.leftrightpadwidth??e.lrpw,e.leftrightpadlength=e.leftrightpadlength??e.lrpl,e.w&&!e.h)e.h=e.w;else if(!e.w&&e.h)e.w=e.h;let t=mRt(e),n=Math.max(t.top,t.bottom),o=Math.max(t.left,t.right),r=e.px??e.p,i=e.py??e.p;if(!e.p&&!e.pw&&!e.pl&&e.w){let s=n+4;e.p=e.w/s}if(!e.p&&e.w&&e.h&&e.pw&&e.pl){let s=(e.w-e.pl*2)/Math.max(n-1,1),a=(e.h-e.pl*2)/Math.max(o-1,1);e.p=(s+a)/2}if(!e.w&&!e.h&&e.p)e.w=r*(n+4),e.h=i*(o+4);if(e.p&&!e.pw&&!e.pl)e.pw=e.p/2,e.pl=e.p/2;else if(!e.pw)e.pw=e.pl*0.6;else if(!e.pl)e.pl=e.pw*1.6666666666666667;return e},_Rt=Q5e.transform(k5e),rKo=["left","bottom","right","top"],iKo=(e)=>{let{sidePinCounts:t,pn:n,w:o,h:r,p:i,px:s,py:a,pl:c,leftRightPadLength:l,legsoutside:h}=e,d=[t.left,t.bottom,t.right,t.top],u=0,_=n-1;while(u<d.length-1&&_>=d[u])_-=d[u],u+=1;let p=d[u],m=rKo[u],A=m==="left"||m==="right"?a??i:s??i,g=m==="left"||m==="right"?l??c:c,f=A*(p-1),y=A*(p-1),x=h?g/2:-g/2;switch(m){case"left":return{x:-o/2-x+0.1,y:y/2-_*A,o:"vert"};case"bottom":return{x:-f/2+_*A,y:-r/2-x+0.1,o:"horz"};case"right":return{x:o/2+x-0.1,y:-y/2+_*A,o:"vert"};case"top":return{x:f/2-_*A,y:r/2+x-0.1,o:"horz"};default:throw Error("Invalid pin number")}},CR=(e)=>{let t=_Rt.parse(e),n=t.leftrightpadwidth??t.lrpw??t.pw,o=t.leftrightpadlength??t.lrpl??t.pl,r=mRt(t),i=[],s=0,a=0,c=pRt({...t,sidePinCounts:r}),l=Math.max(r.left,r.right),h=Math.max(r.top,r.bottom),d=r.left,u=d+1,_=r.left+r.bottom,p=_+1,m=r.left+r.bottom+r.right,A=m+1,g=t.num_pins;for(let D=0;D<t.num_pins;D++){let{x:L,y:H,o:V}=iKo({sidePinCounts:r,pin_count:t.num_pins,pn:D+1,w:t.w,h:t.h,p:t.p??0.5,px:t.px,py:t.py,pl:t.pl,leftRightPadLength:o,legsoutside:t.legsoutside}),O=V==="vert",U=O?n:t.pw,j=O?o:t.pl;if(V==="vert")[U,j]=[j,U];let Y=Math.min(U,j)/8,X=c[D+1];s=Math.max(s,Math.abs(L)+U/2),a=Math.max(a,Math.abs(H)+j/2),i.push(t.pillpads?xR(X,L,H,U,j):uo(X,L,H,U,j,Y))}if(t.thermalpad){let D={x:t.thermalpadcenteroffsetx,y:t.thermalpadcenteroffsety};if(typeof t.thermalpad==="boolean"){let L=(t.px??t.p)*(h-1)+t.pw,H=(t.py??t.p)*(l-1)+n;s=Math.max(s,Math.abs(D.x)+L/2),a=Math.max(a,Math.abs(D.y)+H/2),i.push(ZM({x:L,y:H},D))}else s=Math.max(s,Math.abs(D.x)+t.thermalpad.x/2),a=Math.max(a,Math.abs(D.y)+t.thermalpad.y/2),i.push(ZM(t.thermalpad,D))}let f=[];for(let[D,L,H]of[["top-left",-1,1],["bottom-left",-1,-1],["bottom-right",1,-1],["top-right",1,1]]){let V=t.w/2*L,O=t.h/2*H,U="none",j=V,Y=O,X=t.pw*2;if(c[1]===1&&D==="top-left")U="in1";else if(c[g]===1&&D==="top-left")U="in2";else if(c[A]===1&&D==="top-right")U="in2";else if(c[m]===1&&D==="top-right")U="in1";else if(c[d]===1&&D==="bottom-left")U="in1";else if(c[u]===1&&D==="bottom-left")U="in2";else if(c[_]===1&&D==="bottom-right")U="in1";else if(c[p]===1&&D==="bottom-right")U="in2";let K=U==="in1"?1:-1;if(t.legsoutside){let J=U==="in1"?t.pl/2:t.pw/2,ee=U==="in1"?t.pw/2:t.pl/2;j+=J*L*K,Y-=ee*H*K}if(U==="none"||t.legsoutside)f.push({layer:"top",pcb_component_id:"",pcb_silkscreen_path_id:`pcb_silkscreen_path_${D}`,route:[{x:V-X*L,y:O},{x:V,y:O},{x:V,y:O-X*H}],type:"pcb_silkscreen_path",stroke_width:0.1});if((U==="in1"||U==="in2")&&!t.legsoutside)f.push({layer:"top",pcb_component_id:"",pcb_silkscreen_path_id:`pcb_silkscreen_path_${D}_1`,route:[{x:V-X*L,y:O},{x:V-X*L/2,y:O}],type:"pcb_silkscreen_path",stroke_width:0},{layer:"top",pcb_component_id:"",pcb_silkscreen_path_id:`pcb_silkscreen_path_${D}_2`,route:[{x:V,y:O-X*H/2},{x:V,y:O-X*H}],type:"pcb_silkscreen_path",stroke_width:0.1});if(U==="in1"||U==="in2")f.push({layer:"top",pcb_component_id:"",pcb_silkscreen_path_id:`pcb_silkscreen_path_${D}_3`,route:[{x:j-0.2*-L,y:Y+0.2*K},{x:j,y:Y},{x:j+0.2*K*-L,y:Y+0.2},{x:j-0.2*-L,y:Y+0.2*K}],type:"pcb_silkscreen_path",stroke_width:0.1})}let y=Xo(0,t.h/2+(t.legsoutside?t.pl*1.2:0.5),0.3),x=(D)=>Math.ceil(D/0.05)*0.05,C=(h-1)*(t.px??t.p)+t.pw,b=(l-1)*(t.py??t.p)+n,I=C/2+0.25,v=b/2+0.25,P=t.w/2+0.25,M=t.h/2+0.25,B=Math.max(P,x(s+0.25)),T=Math.max(M,x(a+0.25)),N={type:"pcb_courtyard_outline",pcb_courtyard_outline_id:"",pcb_component_id:"",layer:"top",outline:ey([{minX:-B,maxX:B,minY:-v,maxY:v},{minX:-P,maxX:P,minY:-M,maxY:M},{minX:-I,maxX:I,minY:-T,maxY:T}])};return{circuitJson:[...i,...f,y,N],parameters:t}},sKo=Px.refine(({x:e,y:t})=>Number.isInteger(e)&&Number.isInteger(t)&&e>0&&t>0,"thermal via grid dimensions must be positive integers"),uGe=be.refine((e)=>e>0,{message:"thermal via dimensions must be positive"}),gRt=we({thermalvias:un([he(!0),sKo]).optional(),thermalviapitch:uGe.optional(),thermalviaid:uGe.optional().describe("thermal via inner (hole) diameter"),thermalviaod:uGe.optional().describe("thermal via outer diameter")}),b5e={grid:{x:4,y:4},pitch:be.parse("1mm"),holeDiameter:be.parse("0.3048mm"),outerDiameter:be.parse("0.6096mm")},aKo=(e,t)=>{if(!e.thermalvias)return[];let n=e.thermalvias===!0?b5e.grid:e.thermalvias,o=e.thermalviapitch??b5e.pitch,r=e.thermalviaid??b5e.holeDiameter,i=e.thermalviaod??b5e.outerDiameter;if(i<r)throw Error("thermalviaod must be greater than or equal to thermalviaid");let s=(n.x-1)*o+i,a=(n.y-1)*o+i;if(s>t.width||a>t.height)throw Error("thermal via grid must fit inside thermalpad");return Array.from({length:n.x*n.y},(c,l)=>{let h=l%n.x,d=Math.floor(l/n.x);return{pcb_via_id:"",type:"pcb_via",x:t.x+(h-(n.x-1)/2)*o,y:t.y+(d-(n.y-1)/2)*o,hole_diameter:r,outer_diameter:i,layers:["top","bottom"]}})},ARt=(e,t)=>{if(!t.thermalvias)return e;let n=e.find((o)=>o.type==="pcb_smtpad"&&o.port_hints.includes("thermalpad"));if(!n)throw Error("thermalvias requires a thermalpad");return[...e,...aKo(t,n)]},YNt=be.refine((e)=>Number.isFinite(e)&&e>0,"QFN dimensions must be positive finite lengths"),pGe=we({x:Ae(),y:Ae()}),cKo=Q5e.extend(gRt.shape).extend({fn:he("qfn"),rows:j8.number().pipe(un([he(1),he(2)])).default(1),grid:Px.or(pGe).refine(({x:e,y:t})=>Number.isInteger(e)&&Number.isInteger(t)&&e>0&&t>0,"QFN grid must contain positive integer side counts").optional().describe("outer row sites: top/bottom by left/right"),thermalpad:un([he(!0),Px,pGe]).optional(),thermalvias:un([he(!0),Px,pGe]).refine((e)=>e===!0||e===void 0||Number.isInteger(e.x)&&Number.isInteger(e.y)&&e.x>0&&e.y>0,"thermal via grid dimensions must be positive integers").optional(),rowgap:YNt.optional().describe("center gap between outer and inner rows"),rowspan:YNt.optional().describe("opposing outer-row center span, on both axes"),staggered:Be().default(!1).describe("shift the inner rows left and down by half their pitch"),circularpads:Be().default(!1).describe("circular lands with diameter pw"),pinnumbering:are((e)=>typeof e==="string"?e.replace(/^\(([^()]*)\)$/,"$1"):e,he("ballcoords")).optional(),missing:xK.default([]).describe("omit nominal pin numbers or package-coordinate sites")}).transform((e)=>{let t=Math.min(e.px??e.p,e.py??e.p,e.rowgap??e.p)/2,n=e.pw??(e.rows===2?t:0.25),o=e.pl??(e.circularpads?n:e.rows===2?t:0.875);if(e.circularpads&&(e.pillpads||o!==n))throw Error("Circular QFN pads require equal pl/pw and no pillpads");if(e.circularpads){if(e.leftrightpadwidth!==void 0||e.leftrightpadlength!==void 0||e.lrpw!==void 0||e.lrpl!==void 0)throw Error("Circular QFN pads use one diameter and no left/right pad overrides");for(let c of[e.p,e.px,e.py,n,o,e.w,e.h])if(c!==void 0&&(!Number.isFinite(c)||c<=0))throw Error("QFN dimensions must be positive finite lengths")}if(e.rows===1){if(e.staggered||e.rowgap!==void 0||e.rowspan!==void 0)throw Error("QFN rowgap, rowspan, and staggered require rows2");let c=e.grid?{leftpins:e.grid.y,rightpins:e.grid.y,toppins:e.grid.x,bottompins:e.grid.x}:{};for(let l of["leftpins","rightpins","toppins","bottompins"])if(e[l]!==void 0&&c[l]!==void 0&&e[l]!==c[l])throw Error("QFN grid conflicts with explicit side counts");return k5e({...e,...c,pl:o,pw:n})}if(e.cc===!1||e.ccw===!1||e.startingpin||e.leftrightpadwidth!==void 0||e.leftrightpadlength!==void 0||e.lrpw!==void 0||e.lrpl!==void 0)throw Error("Two-row QFN uses counterclockwise grid numbering and uniform pad sizes");for(let c of["leftpins","rightpins","toppins","bottompins","lrpins","leftrightpins","tbpins","topbottompins"])if(e[c]!==void 0)throw Error("Two-row QFN uses grid instead of explicit side counts");let r=(e.num_pins+8)/8,i=e.grid??{x:r,y:r};if(!Number.isInteger(i.x)||!Number.isInteger(i.y)||i.x<3||i.y<3||4*(i.x+i.y)-8!==e.num_pins)throw Error("Two-row QFN grid requires 4*(x+y)-8 nominal sites");let s=e.w??e.h??(i.x+2)*(e.px??e.p),a=e.h??e.w??(i.y+2)*(e.py??e.p);for(let c of[e.p,e.px??e.p,e.py??e.p,n,o,s,a])if(!Number.isFinite(c)||c<=0)throw Error("QFN dimensions must be positive finite lengths");return{...e,grid:i,w:s,h:a,pl:o,pw:n,rowgap:e.rowgap??e.p}}),lKo=(e)=>{let t=e.grid,n=[],o=e.rowspan??e.w-e.pl-0.2,r=e.rowspan??e.h-e.pl-0.2;for(let i of[0,1]){let s=t.x-2*i,a=t.y-2*i,c=o/2-i*e.rowgap,l=r/2-i*e.rowgap;if(c<=0||l<=0)throw Error("QFN rowgap leaves no inner-row span");let h=e.px??e.p,d=e.py??e.p,u=i&&e.staggered?-h/2:0,_=i&&e.staggered?-d/2:0,p=(g)=>i?4+2*g-(e.staggered?1:0):g===t.x-1?2*t.x-1:2+2*g,m=(g)=>i?2+2*g+(e.staggered?1:0):g===0?1:2*g,A=(g,f,y,x,C)=>{n.push({x:g,y:f,label:`${uRt(y)}${x}`,vertical:C,number:n.length+1})};for(let g=0;g<a;g++)A(-c,((a-1)/2-g)*d+_,m(g),i+1,!0);for(let g=0;g<s;g++)A((g-(s-1)/2)*h+u,-l,2*t.y-1-i,p(g),!1);for(let g=a-1;g>=0;g--)A(c,((a-1)/2-g)*d+_,m(g),2*t.x-i,!0);for(let g=s-1;g>=0;g--)A((g-(s-1)/2)*h+u,l,i,p(g),!1)}return n},GNt=(e,t)=>{let n=new Set;for(let o of t.missing){let r=typeof o==="number"?e.find((i)=>i.number===o):e.find((i)=>i.label===o);if(!r)throw Error(`QFN missing site ${o} is outside the nominal package`);if(n.has(r.number))throw Error("QFN missing sites must not contain duplicates");n.add(r.number)}return e.filter((o)=>!n.has(o.number))},hKo=(e,t)=>{if(t.pinnumbering==="ballcoords")return[e.label];return[e.number]},dKo=(e,t)=>{let n=e.map((o)=>{if(o.shape!=="circle"&&o.shape!=="rect"&&o.shape!=="pill")throw Error("Unsupported QFN pad shape");return{pad:o,x:o.x,y:o.y,rx:o.shape==="circle"?o.radius:o.width/2,ry:o.shape==="circle"?o.radius:o.height/2}});for(let[o,r]of n.entries()){if(r.rx<=0||r.ry<=0||Math.abs(r.x)+r.rx>t.w/2+0.0000000001||Math.abs(r.y)+r.ry>t.h/2+0.0000000001)throw Error("QFN copper must fit inside the package body");for(let i of n.slice(o+1)){let s=Math.abs(r.x-i.x),a=Math.abs(r.y-i.y),c;if(r.pad.shape==="circle"&&i.pad.shape==="circle")c=Math.hypot(s,a)<=r.rx+i.rx+0.0000000001;else if(r.pad.shape==="circle"||i.pad.shape==="circle"){let l=r.pad.shape==="circle"?r:i,h=r.pad.shape==="circle"?i:r;c=Math.hypot(Math.max(s-h.rx,0),Math.max(a-h.ry,0))<=l.rx+0.0000000001}else c=s<=r.rx+i.rx+0.0000000001&&a<=r.ry+i.ry+0.0000000001;if(c)throw Error(`QFN copper for ${r.pad.port_hints?.[0]} and ${i.pad.port_hints?.[0]} overlaps`)}}},uKo=(e)=>{let t=cKo.parse({...e,legsoutside:!1}),n;if(t.rows===1){let o=typeof t.thermalpad==="object"?`${t.thermalpad.x}x${t.thermalpad.y}mm`:t.thermalpad,r=CR({...e,...t,thermalpad:o}),i=r.circuitJson.filter((l)=>l.type==="pcb_smtpad"&&(l.shape==="rect"||l.shape==="pill")&&!l.port_hints?.includes("thermalpad"));if(t.pinnumbering||t.missing.some((l)=>typeof l==="string"))throw Error("QFN package-coordinate numbering requires rows2");let s=i.map((l)=>({number:Number(l.port_hints?.[0]),label:l.port_hints[0],x:l.x,y:l.y,vertical:!1})),a=GNt(s,t),c=new Set(a.map((l)=>l.number));if(n=r.circuitJson.filter((l)=>l.type!=="pcb_smtpad"||l.port_hints?.includes("thermalpad")||c.has(Number(l.port_hints?.[0]))),t.circularpads)n=n.map((l)=>l.type==="pcb_smtpad"&&l.shape==="rect"&&!l.port_hints?.includes("thermalpad")?w5e(l.port_hints??[],{x:l.x,y:l.y,radius:t.pw/2}):l)}else{let r=GNt(lKo(t),t).map((a)=>{let c=hKo(a,t);if(t.circularpads)return w5e(c,{x:a.x,y:a.y,radius:t.pw/2});return(t.pillpads?xR:uo)(c,a.x,a.y,a.vertical?t.pl:t.pw,a.vertical?t.pw:t.pl)});if(t.thermalpad){let a=t.thermalpad===!0?{x:(t.rowspan??t.w-t.pl-0.2)-2*t.rowgap-2*t.pl,y:(t.rowspan??t.h-t.pl-0.2)-2*t.rowgap-2*t.pl}:t.thermalpad,c=ZM(a,{x:t.thermalpadcenteroffsetx,y:t.thermalpadcenteroffsety});if(t.pinnumbering==="ballcoords")c.port_hints=["EP","thermalpad"];r.push(c)}dKo(r,t);let i={leftpins:t.grid.y,rightpins:t.grid.y,toppins:t.grid.x,bottompins:t.grid.x},s=CR({fn:"qfn",num_pins:2*(t.grid.x+t.grid.y),...i,w:t.w,h:t.h,p:t.p,px:t.px,py:t.py,pw:t.pw,pl:t.pl}).circuitJson.filter((a)=>a.type!=="pcb_smtpad");n=[...r,...s]}return{circuitJson:ARt(n,t),parameters:t}},pKo=(e)=>{if(e.legsoutside=!0,!e.p)switch(e.num_pins){case 32:e.p=0.8;break;case 44:case 48:e.p=0.5;break;case 64:case 80:case 100:e.p=0.5;break;case 144:e.p=0.5;break}if(!e.pl)switch(e.num_pins){case 32:case 44:case 48:case 64:case 80:case 100:e.pl=1.475;break;case 144:e.pl=1.6;break}if(!e.pw)switch(e.num_pins){case 32:e.pw=0.55;break;case 44:case 48:case 64:case 80:case 100:e.pw=0.3;break;case 144:e.pw=0.25;break}return CR(e)},mKo=(e)=>{e.legsoutside=!0;let t=_Rt.parse(e);if(!e.p)switch(e.num_pins){case 44:case 64:e.p=0.8;break;case 52:if(e.w===14)e.p=1;else e.p=0.65;break;case 208:e.p=0.5;break}if(!e.pl)switch(e.num_pins){case 44:case 52:case 64:e.pl=2.25;break;case 208:e.pl=1.65;break;default:e.pl=t.pl*4;break}if(!e.pw)switch(e.num_pins){case 44:case 64:e.pw=0.5;break;case 52:if(e.w===14)e.pw=0.45;else e.pw=0.55;break;case 208:e.pw=0.3;break;default:e.pw=t.pw;break}return CR(e)},SPs=Q5e.extend({}).transform(k5e),_Ko=(e)=>{if(e.legsoutside=!1,e.thermalpad===void 0)e.thermalpad=!0;return CR(e)},gKo=Fo.extend({fn:k(),bodywidth:be.refine((e)=>Number.isFinite(e)&&e>0,{message:"bodywidth must be a positive finite length"}).optional().describe("physical body X size before footprint rotation, independent of copper"),bodyheight:be.refine((e)=>Number.isFinite(e)&&e>0,{message:"bodyheight must be a positive finite length"}).optional().describe("physical body Y size before footprint rotation, independent of copper"),bodythickness:be.refine((e)=>Number.isFinite(e)&&e>0,{message:"bodythickness must be a positive finite length"}).optional().describe("physical body Z size, excluding board standoff; metadata for 3D consumers"),num_pins:Ae().optional().default(8),w:be.default(be.parse("3.9mm")),p:be.default(be.parse("1.27mm")),pw:be.optional(),pl:be.optional(),legsoutside:Be().optional().default(!1),thermalpad:Px.optional(),...bK,silkscreen_stroke_width:Ae().optional().default(0.1)}).transform((e)=>{if(e.pw==null&&e.pl==null)e.pw=be.parse("0.51mm"),e.pl=be.parse("1.1mm");else if(e.pw==null)e.pw=e.pl*0.4636363636363636;else if(e.pl==null)e.pl=e.pw*2.1568627450980395;return e}),AKo=(e)=>{let{num_pins:t,pn:n,w:o,p:r}=e,i=t/2,s=n<=i,a=i-1,c=r,l=c*a,h=o+be.parse("0.2mm"),d=(s?-1:1)*(h/2);if(s)return{x:d,y:l/2-(n-1)*c};return{x:d,y:-l/2+(n-i-1)*c}},fKo=(e)=>{let t=gKo.parse(e),n=[],o=Math.min(t.pl,t.pw)/8;for(let g=0;g<t.num_pins;g++){let{x:f,y}=AKo({num_pins:t.num_pins,pn:g+1,w:t.w,p:t.p,pl:t.pl,legsoutside:t.legsoutside});n.push(uo(g+1,f,y,t.pl,t.pw,o))}if(t.thermalpad)n.push(ZM(t.thermalpad,{x:t.thermalpadcenteroffsetx,y:t.thermalpadcenteroffsety}));let r=Math.min(1,t.p/2),i=t.w-(t.legsoutside?0:t.pl)-0.2,s=(t.num_pins/2-1)*t.p+t.pw+r,a=Xo(0,s/2+0.4,s/12),c={type:"pcb_silkscreen_path",layer:"top",pcb_component_id:"",pcb_silkscreen_path_id:"silkscreen_path_1",stroke_width:t.silkscreen_stroke_width??0.1,route:[{x:-i/2,y:-s/2},{x:-i/2,y:s/2},...D5e.map(({x:g,y:f})=>({x:g*i/6,y:f*i/6+s/2})),{x:i/2,y:s/2},{x:i/2,y:-s/2},{x:-i/2,y:-s/2}]},l=(t.num_pins/2-1)*t.p+t.pw,h=t.legsoutside?t.w/2+t.pl:(t.w+0.2)/2+t.pl/2,d=l/2,u=h+0.25,_=u,p=d+0.445,m=p,A={type:"pcb_courtyard_outline",pcb_courtyard_outline_id:"",pcb_component_id:"",outline:ey([{minX:-u,maxX:u,minY:-m,maxY:m},{minX:-_,maxX:_,minY:-p,maxY:p}]),layer:"top"};if(t.bodywidth!==void 0||t.bodyheight!==void 0){let g=t.bodywidth===void 0?u:t.bodywidth/2+0.25,f=t.bodyheight===void 0?p:t.bodyheight/2+0.25;for(let y of n){if(y.type!=="pcb_smtpad"||y.shape!=="rect")continue;g=Math.max(g,Math.abs(y.x)+y.width/2+0.25),f=Math.max(f,Math.abs(y.y)+y.height/2+0.25)}A.outline=[{x:-g,y:-f},{x:g,y:-f},{x:g,y:f},{x:-g,y:f},{x:-g,y:-f}]}return{circuitJson:[...n,c,a,A],parameters:t}},yKo=Fo.extend({fn:k(),num_pins:Ae().optional().default(8),w:be.default(be.parse("3.0mm")),p:be.default(be.parse("0.5mm")),pw:be.default(be.parse("0.30mm")),pl:be.default(be.parse("1.45mm")),legsoutside:Be().optional().default(!0),thermalpad:Px.optional(),...bK,silkscreen_stroke_width:Ae().optional().default(0.1)}),xKo=(e)=>{let{num_pins:t,pn:n,w:o,p:r,pl:i,legsoutside:s}=e,a=t/2,c=n<=a,l=a-1,h=r*l,d=s?i/2:-i/2;if(c)return{x:-o/2-d,y:h/2-(n-1)*r};return{x:o/2+d,y:-h/2+(n-a-1)*r}},CKo=(e)=>{let t={...e},n=t.p,o=typeof n==="string"||typeof n==="number"?be.parse(n):void 0,r=o!=null&&o<=be.parse("0.5mm"),i=yKo.parse(t),s=[],a=i.rounded??Math.min(i.pl,i.pw)/8,c=r?i.w-be.parse("0.15mm"):i.w;for(let C=0;C<i.num_pins;C++){let{x:b,y:I}=xKo({num_pins:i.num_pins,pn:C+1,w:c,p:i.p,pl:i.pl,legsoutside:i.legsoutside});s.push(uo(C+1,b,I,i.pl,i.pw,a))}if(i.thermalpad)s.push(ZM(i.thermalpad,{x:i.thermalpadcenteroffsetx,y:i.thermalpadcenteroffsety}));let l=Math.min(1,i.p/2),h=i.w-(i.legsoutside?0:i.pl*2)-0.2,d=(i.num_pins/2-1)*i.p+i.pw+l,u=Xo(0,d/2+0.4,d/12),_={type:"pcb_silkscreen_path",layer:"top",pcb_component_id:"",pcb_silkscreen_path_id:"silkscreen_path_1",stroke_width:i.silkscreen_stroke_width??0.1,route:[{x:-h/2,y:-d/2},{x:-h/2,y:d/2},...D5e.map(({x:C,y:b})=>({x:C*h/6,y:b*h/6+d/2})),{x:h/2,y:d/2},{x:h/2,y:-d/2},{x:-h/2,y:-d/2}]},p=(i.num_pins/2-1)*i.p+i.pw,m=i.w/2+(i.legsoutside?i.pl:0),A=i.w/2+0.25,g=m+0.18,f=p/2+0.25,y=f+0.35,x={type:"pcb_courtyard_outline",pcb_courtyard_outline_id:"",pcb_component_id:"",layer:"top",outline:ey([{minX:-g,maxX:g,minY:-f,maxY:f},{minX:-A,maxX:A,minY:-y,maxY:y}])};return{circuitJson:[...s,_,u,x],parameters:i}},bKo=[{x:-1.45,y:0.93},{x:-0.73,y:0.93},{x:-0.73,y:1.1},{x:0.73,y:1.1},{x:0.73,y:0.93},{x:1.45,y:0.93},{x:1.45,y:-0.93},{x:0.73,y:-0.93},{x:0.73,y:-1.1},{x:-0.73,y:-1.1},{x:-0.73,y:-0.93},{x:-1.45,y:-0.93}],IKo=Fo.extend({fn:k(),num_pins:he(6).default(6),w:k().default("3.1mm"),h:k().default("2.0mm"),p:k().default("0.65mm"),pl:k().default("1.03mm"),pw:k().default("0.35mm"),string:k().optional()}),vKo=(e)=>{let t=IKo.parse({...e,fn:"sot363"}),n=be.parse(t.w),o=be.parse(t.h),r=be.parse(t.p),i=be.parse(t.pl),s=be.parse(t.pw),a=Math.min(i,s)/8,c=[];for(let m=0;m<6;m++){let{x:A,y:g}=UNt(m+1,n,r,i);c.push(uo(m+1,A,g,i,s,a))}let l={type:"pcb_silkscreen_path",layer:"top",pcb_component_id:"",route:[{x:-n/4,y:o/2+0.1},{x:n/4,y:o/2+0.1}],stroke_width:0.05,pcb_silkscreen_path_id:""},h={type:"pcb_silkscreen_path",layer:"top",pcb_component_id:"",route:[{x:-n/4,y:-o/2-0.1},{x:n/4,y:-o/2-0.1}],stroke_width:0.05,pcb_silkscreen_path_id:""},d=UNt(1,n,r,i),u={type:"pcb_silkscreen_path",layer:"top",pcb_component_id:"pin_marker_1",route:[{x:d.x-i/2-0.3,y:d.y},{x:d.x-i/2-0.45,y:d.y+0.15},{x:d.x-i/2-0.45,y:d.y-0.15},{x:d.x-i/2-0.3,y:d.y}],stroke_width:0.05,pcb_silkscreen_path_id:"pin_marker_1"},_=Xo(0,o/2+0.4,0.25),p={type:"pcb_courtyard_outline",pcb_courtyard_outline_id:"",pcb_component_id:"",outline:bKo,layer:"top"};return{circuitJson:[...c,l,h,_,u,p],parameters:t}},UNt=(e,t,n,o)=>{let r=t/2-o/2;if(e<=3)return{x:-0.84,y:n-(e-1)*n};return{x:0.84,y:-n+(e-4)*n}},SKo=[{x:-0.75,y:1},{x:-0.75,y:-1},{x:0.75,y:-1},{x:0.75,y:1}],PKo=Fo.extend({fn:k(),num_pins:he(6).default(6),w:k().default("1.01mm"),h:k().default("1.45mm"),p:k().default("0.5mm"),pl:k().default("0.33mm"),pw:k().default("0.27mm"),string:k().optional()}),EKo=(e)=>{let t=PKo.parse({...e,fn:"sot886"}),n=be.parse(t.w),o=be.parse(t.h),r=be.parse(t.p),i=be.parse(t.pl),s=be.parse(t.pw),a=Math.min(i,s)/8,c=[];for(let m=0;m<6;m++){let{x:A,y:g}=WNt(m+1,n,r,i);c.push(uo(m+1,A,g,i,s,a))}let l={type:"pcb_silkscreen_path",layer:"top",pcb_component_id:"",route:[{x:-n/2,y:o/2},{x:n/2,y:o/2}],stroke_width:0.05,pcb_silkscreen_path_id:""},h={type:"pcb_silkscreen_path",layer:"top",pcb_component_id:"",route:[{x:-n/2,y:-o/2},{x:n/2,y:-o/2}],stroke_width:0.05,pcb_silkscreen_path_id:""},d=WNt(1,n,r,i),u={type:"pcb_silkscreen_path",layer:"top",pcb_component_id:"pin_marker_1",route:[{x:d.x-i/2-0.3,y:d.y},{x:d.x-i/2-0.45,y:d.y+0.15},{x:d.x-i/2-0.45,y:d.y-0.15},{x:d.x-i/2-0.3,y:d.y}],stroke_width:0.05,pcb_silkscreen_path_id:"pin_marker_1"},_=Xo(0,o/2+0.4,0.25),p={type:"pcb_courtyard_outline",pcb_courtyard_outline_id:"",pcb_component_id:"",outline:SKo,layer:"top"};return{circuitJson:[...c,l,h,_,u,p],parameters:t}},WNt=(e,t,n,o)=>{let r=t/2-o/2;if(e<=3)return{x:-r,y:n-(e-1)*n};return{x:r,y:-n+(e-4)*n}},MKo=[{x:-2.05,y:1.5},{x:-1.05,y:1.5},{x:-1.05,y:1.7},{x:1.05,y:1.7},{x:1.05,y:0.55},{x:2.05,y:0.55},{x:2.05,y:-0.55},{x:1.05,y:-0.55},{x:1.05,y:-1.7},{x:-1.05,y:-1.7},{x:-1.05,y:-1.5},{x:-2.05,y:-1.5},{x:-2.05,y:-0.39},{x:-1.05,y:-0.39},{x:-1.05,y:0.39},{x:-2.05,y:0.39}],wKo=[{x:-2.05,y:1.5},{x:-1.05,y:1.5},{x:-1.05,y:1.7},{x:1.05,y:1.7},{x:1.05,y:1.5},{x:2.05,y:1.5},{x:2.05,y:0.39},{x:1.05,y:0.39},{x:1.05,y:-0.39},{x:2.05,y:-0.39},{x:2.05,y:-1.5},{x:1.05,y:-1.5},{x:1.05,y:-1.7},{x:-1.05,y:-1.7},{x:-1.05,y:-1.5},{x:-2.05,y:-1.5}],fRt=Fo.extend({fn:k(),num_pins:Ae().default(3),w:k().default("2.275mm"),h:k().default("2.74mm"),pl:k().default("1.325mm"),pw:k().default("0.6mm"),p:k().default("0.95mm"),string:k().optional()}),BKo=qz({p:"0.95mm",w:"1.6mm",legsoutside:!0}),TKo=(e)=>{let t=e.string?.match(/^sot23_(\d+)/),n=t?Number.parseInt(t[1],10):3;if(n===6||n===8){let r=BKo.parse({...e,num_pins:n});return{circuitJson:Yse(r),parameters:r}}let o=fRt.parse({...e,num_pins:n});if(o.num_pins===3)return{circuitJson:NKo(o),parameters:o};if(o.num_pins===5)return{circuitJson:yRt(o),parameters:o};throw Error("Invalid number of pins")},DKo=(e)=>{let{pn:t,w:n,h:o,pl:r,p:i}=e;if(t===1)return{x:-n/2,y:i};if(t===2)return{x:-n/2,y:-i};return{x:n/2,y:0}},NKo=(e)=>{let t=[],n=Number.parseFloat(e.w),o=Number.parseFloat(e.h),r=Number.parseFloat(e.pl),i=Number.parseFloat(e.pw),s=Number.parseFloat(e.p),a=e.rounded??Math.min(r,i)/8;for(let h=0;h<e.num_pins;h++){let{x:d,y:u}=DKo({num_pins:e.num_pins,pn:h+1,w:n,h:o,pl:r,p:s});t.push(uo(h+1,d,u,r,i,a))}let c=Xo(0,Number.parseInt(e.h),0.3),l={type:"pcb_courtyard_outline",pcb_courtyard_outline_id:"",pcb_component_id:"",outline:MKo,layer:"top"};return[...t,c,l]},XNt=(e)=>{let{w:t,p:n,h:o,pn:r}=e;if(r===1)return{x:-t/2,y:n};if(r===2)return{x:-t/2,y:0};if(r===3)return{x:-t/2,y:-n};if(r===4)return{x:t/2,y:-n};if(r===5)return{x:t/2,y:n};throw Error("Invalid pin number")},yRt=(e)=>{let t=[],n=Number.parseFloat(e.w),o=Number.parseFloat(e.h),r=Number.parseFloat(e.p),i=Number.parseFloat(e.pl),s=Number.parseFloat(e.pw),a=e.rounded??Math.min(i,s)/8;for(let f=1;f<=e.num_pins;f++){let{x:y,y:x}=XNt({w:n,h:o,p:r,pn:f});t.push(uo(f,y,x,i,s,a))}let c=(e.num_pins+1)/2*r,l=o,h={layer:"top",pcb_component_id:"",pcb_silkscreen_path_id:"silkscreen_path_1",route:[{x:-c/3,y:l/2+r/1.3},{x:c/3,y:l/2+r/1.3}],type:"pcb_silkscreen_path",stroke_width:0.05},d={layer:"top",pcb_component_id:"",pcb_silkscreen_path_id:"silkscreen_path_2",route:[{x:-c/3,y:-l/2-r/1.3},{x:c/3,y:-l/2-r/1.3}],type:"pcb_silkscreen_path",stroke_width:0.05},u=Xo(0,l+0.3,0.3),_=XNt({w:n,h:o,p:r,pn:1});_.x=_.x-s*1.5;let p=0.3,m=0.4,A={type:"pcb_silkscreen_path",layer:"top",pcb_component_id:"",pcb_silkscreen_path_id:"pin1_indicator",route:[{x:_.x+p/2,y:_.y},{x:_.x-p/2,y:_.y+m/2},{x:_.x-p/2,y:_.y-m/2},{x:_.x+p/2,y:_.y}],stroke_width:0.05},g={type:"pcb_courtyard_outline",pcb_courtyard_outline_id:"",pcb_component_id:"",outline:wKo,layer:"top"};return[...t,u,h,d,A,g]},RKo=fRt.extend({}),QKo=(e)=>{let t=RKo.parse({...e,num_pins:5});return{circuitJson:yRt(t),parameters:t}},kKo=[{name:"top-left",dx:-1,dy:1},{name:"top-right",dx:1,dy:1},{name:"bottom-left",dx:-1,dy:-1},{name:"bottom-right",dx:1,dy:-1}],CGe=(e,t)=>({type:"pcb_smtpad",points:t,layer:"top",shape:"polygon",pcb_smtpad_id:"",port_hints:Array.isArray(e)?e.map((n)=>n.toString()):[e.toString()]}),Kz=be.refine((e)=>e>0,{message:"DFN mechanical dimension must be positive"}),I5e=be.refine((e)=>e>=0,{message:"DFN mechanical dimension must be non-negative"}),LKo=we({bodywidth:Kz.optional(),bodylength:Kz.optional(),bodythickness:Kz.optional(),standoff:I5e.optional(),terminalinset:I5e.optional(),terminallength:Kz.optional(),terminalwidth:Kz.optional(),terminalpitch:Kz.optional(),terminalthickness:Kz.optional(),pin1terminalchamfer:I5e.optional(),pin1markwidth:I5e.optional()}),HKo=qz({}).and(gRt).and(LKo),FKo=(e)=>{let t=Be().optional().parse(e.cornerpads),n=e.cornerpadcutlength===void 0?void 0:be.parse(e.cornerpadcutlength),o=xK.parse(e.missing??[]);if(o.some((P)=>typeof P!=="number"))throw Error("DFN missing positions must be pad numbers");let r=[...new Set(o)];if(r.length!==o.length)throw Error("DFN missing positions must not contain duplicates");let i={...HKo.parse(e),cornerpads:t,cornerpadcutlength:n,missing:r};if(i.bodythickness!==void 0&&i.standoff!==void 0&&i.standoff>=i.bodythickness)throw Error("DFN standoff must be less than bodythickness");if(i.terminalthickness!==void 0&&i.bodythickness!==void 0&&i.terminalthickness>i.bodythickness)throw Error("DFN terminalthickness must not exceed bodythickness");if(i.pin1markwidth!==void 0&&i.bodywidth!==void 0&&i.pin1markwidth>=i.bodywidth/2)throw Error("DFN pin1markwidth must be less than half bodywidth");let s=i.num_pins;if(r.some((P)=>P<1||P>s))throw Error("DFN missing position is outside the nominal pad range");if(t){if(s!==4||r.length>0||i.pillpads)throw Error("DFN corner pads require four nominal pads with none missing");if(n===void 0||n<=0||n>Math.min(i.pl,i.pw))throw Error("DFN corner pads require a valid cornerpadcutlength")}let a=new Set(r),c=[],l=Math.min(i.pl,i.pw)/8,h=0,d=1;for(let P=1;P<=s;P+=1){if(a.has(P))continue;let{x:M,y:B}=xGe({num_pins:s,pn:P,w:i.w,p:i.p??1.27,pl:i.pl,widthincludeslegs:!0});if(h=Math.max(h,Math.abs(B)+i.pw/2),t){let T=Math.sign(M),N=Math.sign(B),D=M-T*i.pl/2,L=B-N*i.pw/2,H=M+T*i.pl/2,V=B+N*i.pw/2;c.push(CGe(d,[{x:D,y:L+N*n},{x:D,y:V},{x:H,y:V},{x:H,y:L},{x:D+T*n,y:L}]))}else c.push((i.pillpads?xR:uo)(d,M,B,i.pl??"1mm",i.pw??"0.6mm",l));d+=1}if(i.thermalpad)c.push(ZM(i.thermalpad,{x:i.thermalpadcenteroffsetx,y:i.thermalpadcenteroffsety}));let u=Math.min(1,i.p/2),_=i.w+u,p=h*2+u,m=[];for(let P of kKo){let{dx:M,dy:B}=P;m.push({layer:"top",pcb_component_id:"",pcb_silkscreen_path_id:"",route:[{x:M*_/2-M*i.p,y:B*p/2},{x:M*_/2,y:B*p/2},{x:M*_/2,y:B*p/2-B*i.p}],type:"pcb_silkscreen_path",stroke_width:0.1})}let A=i.p/4,g=-_/2-A/2,f=p/2-i.p/2;m.push({layer:"top",pcb_component_id:"",pcb_silkscreen_path_id:"",type:"pcb_silkscreen_path",route:[{x:g,y:f},{x:g-A,y:f+A},{x:g-A,y:f-A},{x:g,y:f}],stroke_width:0.1});let y=Xo(0,p/2+0.4,p/12),x=(P)=>Math.ceil(P/0.05)*0.05,C=x(i.w/2+0.25),b=x(h+0.45),I={type:"pcb_courtyard_rect",pcb_courtyard_rect_id:"",pcb_component_id:"",center:{x:0,y:0},width:C*2,height:b*2,layer:"top"},v=[...c,y,...m,I];return{circuitJson:ARt(v,i),parameters:i}};var Sx=be.refine((e)=>e>0,{message:"dimension must be positive"}),mGe=be.refine((e)=>e>=0,{message:"dimension must be non-negative"}),jNt=j8.number().pipe(un([he(1),he(2)])),xRt=(e,t)=>Fo.extend({[e]:he(!0).optional(),fn:he(e),string:k().optional(),origin:k().optional(),num_pins:he(2).default(2),p:Sx.default(be.parse(t.p)).describe("pad center-to-center pitch"),pw:Sx.default(be.parse(t.pw)).describe("pad size along the package length"),ph:Sx.default(be.parse(t.ph)).describe("pad size along the package width"),cyw:Sx.optional().describe("courtyard width"),cyh:Sx.optional().describe("courtyard height"),bodylength:Sx.default(be.parse(t.bodylength)),bodywidth:Sx.default(be.parse(t.bodywidth)),bodyheight:Sx.default(be.parse(t.bodyheight)),leadspan:Sx.default(be.parse(t.leadspan)),cathodelength:Sx.default(be.parse(t.cathodelength)),cathodewidth:Sx.default(be.parse(t.cathodewidth)),anodelength:Sx.default(be.parse(t.anodelength)),anodewidth:Sx.default(be.parse(t.anodewidth)),terminalthickness:Sx.default(be.parse(t.terminalthickness)),standoff:mGe.default(be.parse(t.standoff)),taperinset:mGe.default(be.parse(t.taperinset)),markingwidth:mGe.default(be.parse(t.markingwidth)),cathodepin:jNt.default(1),anodepin:jNt.default(2)}).strict().superRefine((n,o)=>{if(n.cathodepin===n.anodepin)o.addIssue({code:Vt.custom,message:"anode and cathode must use different pins",path:["cathodepin"]});if(n.bodyheight<=n.standoff)o.addIssue({code:Vt.custom,message:"bodyheight must be greater than standoff",path:["bodyheight"]});if(n.terminalthickness>=n.bodyheight)o.addIssue({code:Vt.custom,message:"terminalthickness must be less than bodyheight",path:["terminalthickness"]});if(n.standoff>=n.terminalthickness)o.addIssue({code:Vt.custom,message:"standoff must be less than terminalthickness",path:["standoff"]});if(n.leadspan<n.bodylength)o.addIssue({code:Vt.custom,message:"leadspan must be at least bodylength",path:["leadspan"]});if(n.taperinset*2>=Math.min(n.bodylength,n.bodywidth))o.addIssue({code:Vt.custom,message:"taperinset is too large for the body dimensions",path:["taperinset"]});if(n.markingwidth>n.bodylength)o.addIssue({code:Vt.custom,message:"markingwidth must not exceed bodylength",path:["markingwidth"]});let r=(n.leadspan-n.bodylength)/2;if(n.cathodelength<=r||n.anodelength<=r||n.cathodelength+n.anodelength>=n.leadspan||n.cathodewidth>n.bodywidth||n.anodewidth>n.bodywidth)o.addIssue({code:Vt.custom,message:"terminal dimensions are incompatible with the package body",path:["leadspan"]});if(n.markingwidth*2>=n.bodylength-n.taperinset*2)o.addIssue({code:Vt.custom,message:"markingwidth is too large for the tapered body",path:["markingwidth"]})}).transform((n)=>{let{[e]:o,string:r,...i}=n;return i}),CRt=(e)=>{let t=[uo(1,-e.p/2,0,e.pw,e.ph),uo(2,e.p/2,0,e.pw,e.ph)],n=e.bodylength/2,o=e.bodywidth/2,r=[o,-o].map((l,h)=>({type:"pcb_silkscreen_path",pcb_silkscreen_path_id:`flat_lead_body_${h}`,pcb_component_id:"",layer:"top",stroke_width:0.1,route:[{x:-n,y:l},{x:n,y:l}]})),i=e.p/2+e.pw/2,s=e.cyw??Math.max(i,n)*2+0.5,a=e.cyh??Math.max(e.ph/2,o)*2+0.5,c={type:"pcb_courtyard_rect",pcb_courtyard_rect_id:"",pcb_component_id:"",center:{x:0,y:0},width:s,height:a,layer:"top"};return[...t,...yGe(t,{cathodePin:e.cathodepin,anodePin:e.anodepin}),...r,Xo(0,a/2+0.4,0.3),c]},zKo=xRt("do219ad",{p:"1.84mm",pw:"1.35mm",ph:"0.95mm",bodylength:"2.2mm",bodywidth:"1.3mm",bodyheight:"0.68mm",leadspan:"2.5mm",cathodelength:"1.3mm",cathodewidth:"0.88mm",anodelength:"0.65mm",anodewidth:"0.65mm",terminalthickness:"0.195mm",standoff:"0.11mm",taperinset:"0.05mm",markingwidth:"0.23mm"}),OKo=(e)=>{let t=zKo.parse(e);return{circuitJson:CRt(t),parameters:t}};function bRt({pinlabeltextalignleft:e,pinlabeltextalignright:t,pinlabelorthogonal:n}){let o="top";if(n)o="left";else o="top";if(e)if(n)o="bottom";else o="right";if(t)if(n)o="top";else o="left";return o}var $z=({fs:e,pn:t,anchor_x:n,anchor_y:o,textalign:r="center",anchorplacement:i,orthogonal:s=!1,verticallyinverted:a=!1,layer:c="top"})=>{let l=0;if(s&&a)l=270;else if(a)l=180;else if(s)l=90;else l=0;let h="center";if(r!=="center"){if(h=r==="left"?a?"center_right":"center_left":a?"center_left":"center_right",i){let u={top:{x:0,y:1},bottom:{x:0,y:-1},left:{x:-1,y:0},right:{x:1,y:0}}[i],_=l*Math.PI/180,p={x:Math.cos(_),y:Math.sin(_)},m=u.x*p.x+u.y*p.y;if(Math.abs(m)>0.5)h=m>0?"center_left":"center_right"}}if(c==="bottom"){if(h==="center_left")h="center_right";else if(h==="center_right")h="center_left"}return{type:"pcb_silkscreen_text",pcb_silkscreen_text_id:"silkscreen_text_1",font:"tscircuit2024",font_size:e,pcb_component_id:"pcb_component_1",text:`{PIN${t}}`,layer:c,anchor_position:{x:n,y:o},anchor_alignment:h,ccw_rotation:l}},VKo=Pt(["rowmajor","columnmajor"]),YKo=Fo.extend({fn:k(),num_pins:Ae().optional().default(6),rows:un([k(),Ae()]).transform((e)=>Number(e)).optional().default(1).describe("number of rows"),cols:un([k(),Ae()]).transform((e)=>Number(e)).optional().describe("number of nominal columns in a sparse grid"),pinnumbering:are((e)=>typeof e==="string"?e.trim().replace(/^\(([^()]*)\)$/,"$1"):e,VKo).optional().describe("rowmajor or columnmajor grid numbering; omitted preserves the existing traversal"),p:be.default("0.1in").describe("pitch"),py:be.optional().describe("vertical row pitch"),id:be.default("1.0mm").describe("inner diameter"),od:be.default("1.5mm").describe("outer diameter"),missing:xK.default([]).describe("row-major nominal grid positions to omit"),male:Be().optional().describe("for male pin headers"),female:Be().optional().describe("for female pin headers"),smd:Be().optional().describe("surface mount device"),surfacemount:Be().optional().describe("surface mount device (verbose)"),rightangle:Be().optional().describe("right angle"),pw:be.optional().default("1.0mm").describe("pad width for SMD"),pl:be.optional().default("2.0mm").describe("pad length for SMD"),cyw:be.pipe(Ae().finite().positive()).optional().describe("explicit courtyard width"),cyh:be.pipe(Ae().finite().positive()).optional().describe("explicit courtyard height"),pinlabeltextalignleft:Be().optional().default(!1),pinlabeltextaligncenter:Be().optional().default(!1),pinlabeltextalignright:Be().optional().default(!1),pinlabelverticallyinverted:Be().optional().default(!1),pinlabelorthogonal:Be().optional().default(!1),nosquareplating:Be().optional().default(!1).describe("do not use rectangular pad for pin 1"),nopinlabels:Be().optional().default(!1).describe("omit silkscreen pin labels"),doublesidedpinlabel:Be().optional().default(!1).describe("add silkscreen pins in top and bottom layers"),bottomsidepinlabel:Be().optional().default(!1).describe("place the silkscreen reference text on the bottom layer instead of top"),silkscreenborder:Be().optional().default(!1).describe("add a rectangular silkscreen border around the pin row"),silkscreenlabel:k().transform((e)=>e.startsWith("(")&&e.endsWith(")")?e.slice(1,-1):e).optional().describe("replace the reference designator with a custom silkscreen label")}).transform((e)=>{let t=bRt(e);return{...e,pinlabelAnchorSide:t,male:e.male??!e.female,female:e.female??!1,smd:e.smd??e.surfacemount??!1,rightangle:e.rightangle??!1}}).superRefine((e,t)=>{if(e.male&&e.female)t.addIssue({code:Vt.custom,message:"'male' and 'female' cannot both be true; it should be male or female.",path:["male","female"]});if(e.cols!==void 0&&(!Number.isInteger(e.cols)||e.cols<1))t.addIssue({code:Vt.custom,message:"'cols' must be a positive integer",path:["cols"]});if(e.missing.some((n)=>typeof n!=="number"))t.addIssue({code:Vt.custom,message:"'missing' positions must be pad numbers",path:["missing"]})}),IRt=(e)=>{let t=YKo.parse(e),{p:n,py:o,id:r,od:i,rows:s,cols:a,pinnumbering:c,num_pins:l,missing:h,pinlabelAnchorSide:d,pinlabelverticallyinverted:u,pinlabelorthogonal:_,pinlabeltextalignleft:p,pinlabeltextalignright:m,nopinlabels:A,doublesidedpinlabel:g,bottomsidepinlabel:f,silkscreenborder:y,silkscreenlabel:x}=t,C="center";if(p)C="left";else if(m)C="right";let b=[],I={center:null},v=h,P=new Set(v);if(P.size!==v.length)throw Error("Pinrow missing positions must not contain duplicates");let M=l+v.length,B=a??Math.ceil(M/s),T=B*s,N=a!==void 0||v.length>0||c!==void 0;if(N&&T!==M)throw Error(`Pinrow grid has ${T} positions, but ${M} are required for ${l} pins and ${v.length} missing positions`);if(v.some((ge)=>!Number.isInteger(ge)||ge<1||ge>T))throw Error("Pinrow missing position is outside the nominal grid");let D=o??n,L=(s-1)*D,H=L/2,V=-D,O=({xoff:ge,yoff:xe,od:Ee,anchorSide:Re,smd:Me,pw:_e,pl:ye})=>{let Se=0,Ne=0;if(Me){let Le=Ee/5;switch(Re){case"right":Se=_e/2+Le;break;case"top":Ne=ye/2+Le;break;case"bottom":Ne=-(ye/2+Le);break;case"left":Se=-(_e/2+Le);break}}else{let Le=Ee/2+0.6;switch(Re){case"right":Se=Le;break;case"top":Ne=Le;break;case"bottom":Ne=-Le;break;case"left":Se=-Le;break}}return{anchor_x:ge+Se,anchor_y:xe+Ne}},U=(ge,xe,Ee)=>{if(ge===1)I.center={x:xe,y:Ee};if(t.smd)b.push(uo(ge,xe,Ee,t.pw,t.pl));else if(ge===1&&!t.nosquareplating)b.push(Z1({pn:ge,x:xe,y:Ee,holeDiameter:r,rectPadWidth:i,rectPadHeight:i}));else b.push(Ri(ge,xe,Ee,r,i));let{anchor_x:Re,anchor_y:Me}=O({xoff:xe,yoff:Ee,od:i,anchorSide:d,smd:t.smd,pw:t.pw,pl:t.pl});if(!A){if(!f)b.push($z({fs:i/5,pn:ge,anchor_x:Re,anchor_y:Me,anchorplacement:d,textalign:C,orthogonal:_,verticallyinverted:u,layer:"top"}));else b.push($z({fs:i/5,pn:ge,anchor_x:Re,anchor_y:Me,anchorplacement:d,textalign:C,orthogonal:_,verticallyinverted:u,layer:"bottom"}));if(g)b.push($z({fs:i/5,pn:ge,anchor_x:Re,anchor_y:Me,anchorplacement:d,textalign:C,orthogonal:_,verticallyinverted:u,layer:"bottom"}))}},j=new Set;if(N){let ge=-((B-1)/2)*n,xe=1;for(let Ee=0;Ee<T;Ee++){let Re=c==="columnmajor"?Ee%s:Math.floor(Ee/B),Me=c==="columnmajor"?Math.floor(Ee/s):Ee%B,_e=Re*B+Me+1;if(P.has(_e))continue;let ye=ge+Me*n,Se=H+Re*V,Ne=`${ye},${Se}`;if(j.has(Ne))throw Error(`Overlap at ${Ne}`);j.add(Ne),U(xe++,ye,Se)}}else if(s===1){let ge=-((l-1)/2)*n;for(let xe=0;xe<l;xe++){let Ee=xe+1,Re=ge+xe*n,Me=`${Re},0`;if(j.has(Me))throw Error(`Overlap at ${Me}`);j.add(Me),U(Ee,Re,0)}}else if(s>2&&B>2){let xe=-((B-1)/2)*n,Ee=1;for(let Re=0;Re<s&&Ee<=l;Re++)for(let Me=0;Me<B&&Ee<=l;Me++){let _e=xe+Me*n,ye=H+Re*V,Se=`${_e},${ye}`;if(j.has(Se))throw Error(`Overlap at ${Se}`);j.add(Se),U(Ee++,_e,ye)}}else{let xe=-((B-1)/2)*n,Ee=1,Re=0,Me=s-1,_e=0,ye=B-1;while(Ee<=l&&Re<=Me&&_e<=ye){for(let Se=Re;Se<=Me&&Ee<=l;Se++){let Ne=xe+_e*n,Le=H+Se*V,nt=`${Ne},${Le}`;if(j.has(nt))throw Error(`Overlap at ${nt}`);j.add(nt),U(Ee++,Ne,Le)}_e++;for(let Se=_e;Se<=ye&&Ee<=l;Se++){let Ne=xe+Se*n,Le=H+Me*V,nt=`${Ne},${Le}`;if(j.has(nt))throw Error(`Overlap at ${nt}`);j.add(nt),U(Ee++,Ne,Le)}if(Me--,_e<=ye){for(let Se=Me;Se>=Re&&Ee<=l;Se--){let Ne=xe+ye*n,Le=H+Se*V,nt=`${Ne},${Le}`;if(j.has(nt))throw Error(`Overlap at ${nt}`);j.add(nt),U(Ee++,Ne,Le)}ye--}if(Re<=Me){for(let Se=ye;Se>=_e&&Ee<=l;Se--){let Ne=xe+Se*n,Le=H+Re*V,nt=`${Ne},${Le}`;if(j.has(nt))throw Error(`Overlap at ${nt}`);j.add(nt),U(Ee++,Ne,Le)}Re++}}if(Ee-1<l)throw Error(`Missing pins: assigned ${Ee-1}, expected ${l}`)}let Y=t.smd?t.pw/2:i/2,X=t.smd?t.pl/2:i/2,K=(B-1)*n,J=K/2+n/2+1,ee=Math.max(L/2+X+1,n/2+1),se=y?fs([{x:-J,y:-ee},{x:J,y:-ee},{x:J,y:ee},{x:-J,y:ee},{x:-J,y:-ee}]):null,ne=(()=>{let ge=I.center;if(t.fn!=="headermodule"||!ge)return null;let xe=Math.max(0.3,Math.min(0.6,n/4)),Ee=0.15;if(d==="top"||d==="bottom"){let Se=Math.sign(ge.x)||(d==="top"?-1:1),Ne=ge.x+Se*(Y+Ee),Le=Ne+Se*xe;return fs([{x:Ne,y:ge.y},{x:Le,y:ge.y-xe},{x:Le,y:ge.y+xe},{x:Ne,y:ge.y}],{pcb_component_id:"pin_marker_1",pcb_silkscreen_path_id:"pin_marker_1"})}let Me=Math.sign(ge.y)||1,_e=ge.y+Me*(X+Ee),ye=_e+Me*xe;return fs([{x:ge.x,y:_e},{x:ge.x-xe,y:ye},{x:ge.x+xe,y:ye},{x:ge.x,y:_e}],{pcb_component_id:"pin_marker_1",pcb_silkscreen_path_id:"pin_marker_1"})})(),re=x?{type:"pcb_silkscreen_text",pcb_silkscreen_text_id:"silkscreen_text_1",font:"tscircuit2024",font_size:0.8,pcb_component_id:"pcb_component_1",text:x,layer:"top",anchor_position:{x:0,y:0},anchor_alignment:"center"}:Xo(0,L/2+n,0.5),Z=K/2+Y,te=L/2+X,ie=K/2+n/2,ce=L/2+n/2,ue=Math.max(Z+0.25,ie+0.5),de=Math.max(te+0.25,ce+0.5),me={type:"pcb_courtyard_rect",pcb_courtyard_rect_id:"",pcb_component_id:"",center:{x:0,y:0},width:t.cyw??2*ue,height:t.cyh??2*de,layer:"top"};return{circuitJson:[...b,...se?[se]:[],...ne?[ne]:[],re,me],parameters:t}},GKo=(e)=>IRt({...e,fn:"headermodule"}),UKo=[{x:-1.2,y:0.83},{x:-0.75,y:0.83},{x:-0.75,y:0.95},{x:0.75,y:0.95},{x:0.75,y:0.83},{x:1.2,y:0.83},{x:1.2,y:-0.83},{x:0.75,y:-0.83},{x:0.75,y:-0.95},{x:-0.75,y:-0.95},{x:-0.75,y:-0.83},{x:-1.2,y:-0.83}],WKo=Fo.extend({fn:k(),num_pins:he(6).default(6),w:k().default("2.1mm"),h:k().default("2.45mm"),p:k().default("0.5mm"),pl:k().default("0.675mm"),pw:k().default("0.35mm"),string:k().optional()}),XKo=(e)=>{let t=WKo.parse({...e,fn:"sot563"}),n=be.parse(t.w),o=be.parse(t.h),r=be.parse(t.p),i=be.parse(t.pl),s=be.parse(t.pw),a=Math.min(i,s)/8,c=[];for(let m=0;m<6;m++){let{x:A,y:g}=KNt(m+1,n,r,i);c.push(uo(m+1,A,g,i,s,a))}let l={type:"pcb_silkscreen_path",layer:"top",pcb_component_id:"",route:[{x:-n/2,y:o/2},{x:n/2,y:o/2}],stroke_width:0.05,pcb_silkscreen_path_id:""},h={type:"pcb_silkscreen_path",layer:"top",pcb_component_id:"",route:[{x:-n/2,y:-o/2},{x:n/2,y:-o/2}],stroke_width:0.05,pcb_silkscreen_path_id:""},d=KNt(1,n,r,i),u={type:"pcb_silkscreen_path",layer:"top",pcb_component_id:"pin_marker_1",route:[{x:d.x-i/2-0.3,y:d.y},{x:d.x-i/2-0.45,y:d.y+0.15},{x:d.x-i/2-0.45,y:d.y-0.15},{x:d.x-i/2-0.3,y:d.y}],stroke_width:0.05,pcb_silkscreen_path_id:"pin_marker_1"},_=Xo(0,o/2+0.4,0.25),p={type:"pcb_courtyard_outline",pcb_courtyard_outline_id:"",pcb_component_id:"",outline:UKo,layer:"top"};return{circuitJson:[...c,l,h,_,u,p],parameters:t}},KNt=(e,t,n,o)=>{let r=t/2-o/2;if(e<=3)return{x:-r,y:n-(e-1)*n};return{x:r,y:-n+(e-4)*n}},jKo=qz({p:"1.27mm",w:"3.9mm",legsoutside:!0}),KKo=(e)=>{let t=jKo.parse({...e,num_pins:8});return{circuitJson:Yse(t),parameters:t}},$Ko=qz({p:"1.27mm",w:"7.5mm",legsoutside:!0}),qKo=(e)=>{let t=$Ko.parse({...e,num_pins:16});return{circuitJson:Yse(t),parameters:t}},JKo=Fo.extend({fn:k(),num_pins:he(3).default(3),w:k().default("1.2mm"),h:k().default("1.2mm"),pw:k().default("0.40mm"),pl:k().default("0.45mm"),p:k().default("0.575mm")}),ZKo=(e)=>{let t=JKo.parse(e),n=t$o(t),o=Xo(0,be.parse(t.h),0.2),r=1.8,i=1.8,s={type:"pcb_courtyard_outline",pcb_courtyard_outline_id:"",pcb_component_id:"",outline:[{x:-0.9,y:0.9},{x:0.9,y:0.9},{x:0.9,y:-0.9},{x:-0.9,y:-0.9}],layer:"top"};return{circuitJson:[...n,o,s],parameters:t}},e$o=(e)=>{let{pn:t,w:n,h:o,pl:r,p:i}=e;if(t===1)return{x:i,y:0};if(t===2)return{x:-i,y:-0.4};return{x:-i,y:0.4}},t$o=(e)=>{let t=[],n=Number.parseFloat(e.w),o=Number.parseFloat(e.h),r=Number.parseFloat(e.pl),i=Number.parseFloat(e.pw),s=Number.parseFloat(e.p),a=Math.min(r,i)/8;for(let c=0;c<3;c++){let{x:l,y:h}=e$o({num_pins:e.num_pins,pn:c+1,w:n,h:o,pl:r,p:s});t.push(uo(c+1,l,h,r,i,a))}return t},n$o=Fo.extend({fn:k(),num_pins:he(2).default(2),w:k().default("2.36mm"),h:k().default("1.22mm"),pl:k().default("0.9mm"),pw:k().default("1.2mm"),p:k().default("3.30mm")}),o$o=(e)=>{let t=n$o.parse(e),n=be.parse(t.h),o=Xo(0,n/4+0.4,0.3),r=4.7,i=2.3,s={type:"pcb_courtyard_rect",pcb_courtyard_rect_id:"",pcb_component_id:"",center:{x:0,y:0},width:4.7,height:2.3,layer:"top"};return{circuitJson:i$o(t).concat(...f0(t),o,s),parameters:t}},r$o=(e)=>{let{pn:t,p:n}=e;if(t===1)return{x:-n/2,y:0};else return{x:n/2,y:0}},i$o=(e)=>{let t=[];for(let n=1;n<=e.num_pins;n++){let{x:o,y:r}=r$o({pn:n,p:be.parse(e.p)});t.push(uo(n,o,r,be.parse(e.pl),be.parse(e.pw),0.1125))}return t},s$o=Fo.extend({fn:k(),p:be.optional().default("2.54mm"),id:be.optional().default("0.7mm"),od:be.optional().default("1.4mm")}),a$o=(e)=>{let t=s$o.parse(e),{p:n,id:o,od:r}=t,i=[Ri(1,-n/2,0,o,r),Ri(2,n/2,0,o,r)],s={type:"pcb_silkscreen_path",layer:"top",pcb_component_id:"",route:[{x:-n/2+r+o/2,y:0},{x:n/2-r-o/2,y:0}],stroke_width:0.1,pcb_silkscreen_path_id:""},a=Xo(0,1.5,0.5),c=-n/2,l=n/2,h=r/2,d=r/2,u=c-h-0.35,_=l+h+0.26,p=d+0.35,m=u,A=_,g=p,f={type:"pcb_courtyard_outline",pcb_courtyard_outline_id:"",pcb_component_id:"",outline:ey([{minX:u,maxX:_,minY:-g,maxY:g},{minX:m,maxX:A,minY:-p,maxY:p}]),layer:"top"};return{circuitJson:[...i,s,a,f],parameters:t}},c$o=(e,t,n,o,r,i=0.1)=>{let s=[],a=[],c=Math.max(1,Math.ceil(Math.PI*n/i)),l=Math.PI/c;for(let h=0;h<=c;h++){let d=h*l,u=e+Math.cos(d)*n,_=t+Math.sin(d)*n;if(u<e-o&&_>=t-r/2&&_<=t+r/2)continue;s.push({x:u,y:_})}for(let h=0;h<=c;h++){let d=Math.PI+h*l,u=e+Math.cos(d)*n,_=t+Math.sin(d)*n;if(u<e-o&&_>=t-r/2&&_<=t+r/2)continue;a.push({x:u,y:_})}return{topArc:s,bottomArc:a}},l$o=Fo.extend({fn:k(),p:be.optional().default("5mm"),id:be.optional().default("0.8mm"),od:be.optional().default("1.6mm"),ceramic:Be().optional(),electrolytic:Be().optional(),polarized:Be().optional()}),h$o=(e)=>{let t=l$o.parse(e),{p:n,id:o,od:r}=t;if(o===0.8&&r===1.6)t.id=n===5?0.8:n*0.25,t.od=n===5?1.6:n*0.5;let i=[Ri(1,-n/2,0,t.id,t.od),Ri(2,n/2,0,t.id,t.od)],s=n+0.1,{topArc:a,bottomArc:c}=c$o(0,0,s,t.od/2,t.od),l=0.02*n,h={type:"pcb_silkscreen_path",layer:"top",pcb_component_id:"",route:a,stroke_width:l,pcb_silkscreen_path_id:""},d={type:"pcb_silkscreen_path",layer:"top",pcb_component_id:"",route:c,stroke_width:l,pcb_silkscreen_path_id:""},u={type:"pcb_silkscreen_path",layer:"top",pcb_component_id:"",route:[{x:0,y:s},{x:0,y:-s}],stroke_width:l,pcb_silkscreen_path_id:""},_=0.1*n,p=-(n+_+0.04*n),m=s-_-0.08*n,A={type:"pcb_silkscreen_path",layer:"top",pcb_component_id:"",route:[{x:p-_,y:m},{x:p+_,y:m}],stroke_width:l,pcb_silkscreen_path_id:""},g={type:"pcb_silkscreen_path",layer:"top",pcb_component_id:"",route:[{x:p,y:m-_},{x:p,y:m+_}],stroke_width:l,pcb_silkscreen_path_id:""},f=Xo(0,s+0.12*n,0.1*n),y=[...i,h,d,u,f];if(t.electrolytic===!0||t.polarized===!0)y.push(A,g);let C=n+0.25,b={type:"pcb_courtyard_circle",pcb_courtyard_circle_id:"",pcb_component_id:"",center:{x:0,y:0},radius:C,layer:"top"};return y.push(b),{circuitJson:y,parameters:t}},d$o=Fo.extend({fn:he("rj45"),num_pins:un([he(10),he(14)]).default(10),ledpins:Be().default(!1).describe("add the four through-hole LED connections as pins 9 through 12"),firstpinleft:Be().default(!1).describe("mirror the eight signal pins so pin 1 is on the left"),firstpintop:Be().default(!1).describe("mirror the eight signal pins so pin 1 is in the top row"),p:be.default("1.02mm").describe("horizontal signal-pin pitch"),py:be.default("1.78mm").describe("signal-row pitch"),id:be.default("0.9144mm").describe("signal and LED hole diameter"),od:be.default("1.524mm").describe("signal and LED outer diameter"),shieldx:be.default("8.13mm").describe("shield-pin x offset from the footprint center"),shieldy:be.default("0.13mm").describe("signed shield-pin y offset from the signal-row center"),shieldid:be.default("1.8mm").describe("shield-pin hole diameter"),shieldod:be.default("2.5mm").describe("shield-pin outer diameter"),holex:be.default("6.35mm").describe("locator-hole x offset from the footprint center"),holey:be.default("-3.43mm").describe("signed locator-hole y offset from the signal-row center"),holed:be.default("3.25mm").describe("locator-hole diameter"),ledx:be.default("4.57mm").describe("inner LED-pin x offset from the footprint center"),ledp:be.default("2.29mm").describe("pitch within each LED-pin pair"),ledy:be.default("5.7mm").describe("signed LED-pin y offset from the signal-row center"),w:be.default("16.26mm").describe("connector body width"),h:be.default("15.88mm").describe("connector body height"),bodyy:be.default("-0.96mm").describe("signed connector body center y offset")}),u$o=(e)=>{let t=e.ledpins===!0||e.num_pins===14,n=d$o.parse({...e,ledpins:t,num_pins:t?14:10}),{ledpins:o,firstpinleft:r,firstpintop:i,p:s,py:a,id:c,od:l,shieldx:h,shieldy:d,shieldid:u,shieldod:_,holex:p,holey:m,holed:A,ledx:g,ledp:f,ledy:y,w:x,h:C,bodyy:b}=n,I=(ue)=>Number(ue.toFixed(12)),v=Array.from({length:8},(ue,de)=>{let me=de+1,ge=(3.5-de)*s,xe=de%2===0?-a/2:a/2,Ee=I(r?-ge:ge),Re=I(i?-xe:xe);return Ri(me,Ee,Re,c,l)}),P=o?[Ri(9,I(-g-f),y,c,l),Ri(10,-g,y,c,l),Ri(11,g,y,c,l),Ri(12,I(g+f),y,c,l)]:[],M=o?14:9,B=o?13:10,T=r!==i,N=T?B:M,D=T?M:B,L=[Ri(N,-h,d,u,_),Ri(D,h,d,u,_)],H=[-p,p].map((ue)=>({type:"pcb_hole",pcb_hole_id:"",pcb_component_id:"",hole_shape:"circle",hole_diameter:A,x:ue,y:m})),V=-x/2,O=x/2,U=b-C/2,j=b+C/2,Y=_/2+0.2,X=[[U,Math.min(j,d-Y)],[Math.max(U,d+Y),j]].filter(([ue,de])=>de-ue>0.01),K=[fs([{x:V,y:U},{x:O,y:U}]),fs([{x:V,y:j},{x:O,y:j}]),...X.flatMap(([ue,de])=>[fs([{x:V,y:ue},{x:V,y:de}]),fs([{x:O,y:ue},{x:O,y:de}])])],J=Math.min(-h-_/2,-p-A/2,o?-g-f-l/2:0),ee=-J,se=Math.min(d-_/2,m-A/2,-a/2-l/2,o?y-l/2:Number.POSITIVE_INFINITY),ne=Math.max(d+_/2,m+A/2,a/2+l/2,o?y+l/2:Number.NEGATIVE_INFINITY),re=Math.min(V,J)-0.25,Z=Math.max(O,ee)+0.25,te=Math.min(U,se)-0.25,ie=Math.max(j,ne)+0.25,ce={type:"pcb_courtyard_rect",pcb_courtyard_rect_id:"",pcb_component_id:"",center:{x:(re+Z)/2,y:(te+ie)/2},width:Z-re,height:ie-te,layer:"top"};return{circuitJson:[...H,...v,...P,...L,...K,Xo(0,ie+0.55,0.5),ce],parameters:n}},p$o=Fo.extend({fn:he("pushbutton"),w:be.default(4.5),h:be.default(6.5),id:be.default(1),od:be.default(1.2)}),m$o=(e)=>{let t=p$o.parse(e),{w:n,h:o,id:r}=t,i=[Ri(1,-n/2,o/2,r,r*1.5),Ri(2,-n/2,-o/2,r,r*1.5),Ri(3,n/2,-o/2,r,r*1.5),Ri(4,n/2,o/2,r,r*1.5)],s=[fs([{x:-n/2,y:-o/2},{x:-n/2,y:o/2}]),fs([{x:n/2,y:-o/2},{x:n/2,y:o/2}]),fs([{x:-n/2,y:0},{x:-n/5,y:0},{x:n/5*1/Math.sqrt(2),y:o/8}]),fs([{x:n/2,y:0},{x:n/5,y:0}])],a=Xo(0,o/2+0.4,0.5),c=r*1.5/2,l=n,h=o,d=l/2+c,u=h/2+c,_=d+0.5,p=u+0.5,m={type:"pcb_courtyard_rect",pcb_courtyard_rect_id:"",pcb_component_id:"",center:{x:0,y:0},width:2*_,height:2*p,layer:"top"};return{circuitJson:[...i,...s,a,m],parameters:t}},vRt=Fo.extend({fn:k(),w:be.default("22.58mm"),h:be.optional(),left:be.optional().default(20),right:be.optional().default(20),top:be.optional().default(2),bottom:be.optional().default(2),p:be.default(be.parse("2.54mm")),pw:be.default(be.parse("1.6mm")),pl:be.default(be.parse("2.4mm")),innerhole:Be().default(!1),innerholeedgedistance:be.default(be.parse("1.61mm")),silkscreenlabels:Be().default(!1),silkscreenlabelmargin:be.default(be.parse("0.1mm"))}),_$o=(e)=>{let t=vRt.parse(e);if(t.left&&t.right)return Math.max(t.left,t.right)*t.p;if(t.left)return t.left*t.p;if(t.right)return t.right*t.p;return 51},v5e=(e,t,n)=>{let o=[],r=1,i=0.6;if(n==="right")o=[{x:e+r/2,y:t},{x:e-r/2,y:t+i/2},{x:e-r/2,y:t-i/2},{x:e+r/2,y:t}];if(n==="left")o=[{x:e-r/2,y:t},{x:e+r/2,y:t+i/2},{x:e+r/2,y:t-i/2},{x:e-r/2,y:t}];if(n==="top")o=[{x:e,y:t+r/2},{x:e-i/2,y:t-r/2},{x:e+i/2,y:t-r/2},{x:e,y:t+r/2}];if(n==="bottom")o=[{x:e,y:t-r/2},{x:e-i/2,y:t+r/2},{x:e+i/2,y:t+r/2},{x:e,y:t-r/2}];return o},g$o=(e)=>{let t=vRt.parse(e),n=t.h??_$o(t),o=[],r=[],i=[],s=[],a=1,c=a,l=t.left+t.right+(t.bottom??0)+(t.top??0),d=`pin${l}`.length*0.7/2;if(t.right){let m=-((t.right-1)/2)*t.p;for(let A=0;A<t.right;A++){if(A===0&&!t.left&&!t.bottom&&!t.silkscreenlabels)s=v5e(t.w/2-t.pl*1.4,m+A*t.p,"right");if(o.push(uo(A+1+t.left+(t.bottom??0),t.w/2-t.pl/2,m+A*t.p,t.pl,t.pw)),t.silkscreenlabels){let g=A+1+t.left+(t.bottom??0),f=`pin${g}`;i.push({type:"pcb_silkscreen_text",pcb_silkscreen_text_id:`pin_${g}`,pcb_component_id:"1",layer:"top",anchor_position:{x:t.w/2-t.pl-(d+t.silkscreenlabelmargin),y:m+A*t.p},text:f,font_size:0.7,font:"tscircuit2024",anchor_alignment:"center"})}if(t.innerhole)r.push(Ri(A+1+t.left+(t.bottom??0)+l,t.w/2,m+A*t.p,a,c)),r.push(Ri(A+1+t.left+(t.bottom??0)+l*2,t.w/2-t.innerholeedgedistance,m+A*t.p,a,c))}}if(t.left){let m=(t.left-1)/2*t.p;for(let A=0;A<t.left;A++){if(A===0&&!t.silkscreenlabels)s=v5e(-t.w/2+t.pl*1.4,m-A*t.p,"left");if(o.push(uo(A+1,-t.w/2+t.pl/2,m-A*t.p,t.pl,t.pw)),t.silkscreenlabels){let g=A+1,f=`pin${g}`;i.push({type:"pcb_silkscreen_text",pcb_silkscreen_text_id:`pin_${g}`,pcb_component_id:"1",layer:"top",anchor_position:{x:-t.w/2+t.pl+(d+t.silkscreenlabelmargin),y:m-A*t.p},text:f,font_size:0.7,font:"tscircuit2024",anchor_alignment:"center"})}if(t.innerhole)r.push(Ri(A+1+l,-t.w/2,m-A*t.p,a,c)),r.push(Ri(A+1+l*2,-t.w/2+t.innerholeedgedistance,m-A*t.p,a,c))}}if(t.top){let m=(t.top-1)/2*t.p;for(let A=0;A<t.top;A++){if(A===0&&!t.left&&!t.bottom&&!t.right&&!t.silkscreenlabels)s=v5e(m-A*t.p,n/2-t.pl*1.4,"top");if(o.push(uo(A+1+t.left+t.right+(t.bottom??0),m-A*t.p,n/2-t.pl/2,t.pw,t.pl)),t.silkscreenlabels){let g=A+1+t.left+t.right+(t.bottom??0),f=`pin${g}`;i.push({type:"pcb_silkscreen_text",pcb_silkscreen_text_id:`pin_${g}`,pcb_component_id:"1",layer:"top",anchor_position:{x:m-A*t.p,y:n/2-t.pl-(d+t.silkscreenlabelmargin)},text:f,font_size:0.7,font:"tscircuit2024",anchor_alignment:"center",ccw_rotation:270})}if(t.innerhole)r.push(Ri(A+1+t.left+t.right+(t.bottom??0)+l,m-A*t.p,n/2,a,c)),r.push(Ri(A+1+t.left+t.right+(t.bottom??0)+l*2,m-A*t.p,n/2-t.innerholeedgedistance,a,c))}}if(t.bottom){let m=-((t.bottom-1)/2)*t.p;for(let A=0;A<t.bottom;A++){if(A===0&&!t.left&&!t.silkscreenlabels)s=v5e(m+A*t.p,-n/2+t.pl*1.4,"bottom");if(o.push(uo(A+1+t.left,m+A*t.p,-n/2+t.pl/2,t.pw,t.pl)),t.silkscreenlabels){let g=A+1+t.left,f=`pin${g}`;i.push({type:"pcb_silkscreen_text",pcb_silkscreen_text_id:`pin_${g}`,pcb_component_id:"1",layer:"top",anchor_position:{x:m+A*t.p,y:-n/2+t.pl+(d+t.silkscreenlabelmargin)},text:f,font_size:0.7,font:"tscircuit2024",anchor_alignment:"center",ccw_rotation:90})}if(t.innerhole)r.push(Ri(A+1+t.left+l,m+A*t.p,-n/2,a,c)),r.push(Ri(A+1+t.left+l*2,m+A*t.p,-n/2+t.innerholeedgedistance,a,c))}}let u={type:"pcb_silkscreen_path",pcb_silkscreen_path_id:"pcb_silkscreen_triangle_1",pcb_component_id:"2",route:s,stroke_width:0.1,layer:"top"},_={type:"pcb_silkscreen_path",pcb_silkscreen_path_id:"pcb_silkscreen_path_1",pcb_component_id:"1",route:[{x:-t.w/2,y:n/2},{x:t.w/2,y:n/2},{x:t.w/2,y:-n/2},{x:-t.w/2,y:-n/2},{x:-t.w/2,y:n/2}],stroke_width:0.1,layer:"top"},p=Xo(0,n/1.8,n/25);return{circuitJson:[...o,...r,...i,_,...t.silkscreenlabels?[]:[u],p],parameters:t}},SRt=Fo.extend({fn:k(),w:be.default("22.58mm"),h:be.optional(),left:be.optional().default(20),right:be.optional().default(20),top:be.optional().default(2),bottom:be.optional().default(2),p:be.default(be.parse("2.54mm")),pw:be.default(be.parse("1.6mm")),pl:be.default(be.parse("3.2mm")),innerhole:Be().default(!1),innerholeedgedistance:be.default(be.parse("1.61mm"))}),A$o=(e)=>{let t=SRt.parse(e);if(t.left&&t.right)return Math.max(t.left,t.right)*t.p;if(t.left)return t.left*t.p;if(t.right)return t.right*t.p;return 51},f$o=(e,t,n,o=1,r=0.6)=>{let i=o/2,s=r/2;return{left:[{x:e+i,y:t},{x:e-i,y:t+s},{x:e-i,y:t-s},{x:e+i,y:t}],right:[{x:e-i,y:t},{x:e+i,y:t+s},{x:e+i,y:t-s},{x:e-i,y:t}],top:[{x:e,y:t-i},{x:e-s,y:t+i},{x:e+s,y:t+i},{x:e,y:t-i}],bottom:[{x:e,y:t+i},{x:e-s,y:t-i},{x:e+s,y:t-i},{x:e,y:t+i}]}[n]},y$o=(e)=>{let t=SRt.parse(e),n=t.h??A$o(t),o=[],r=[],i=[],s=1,a=1.2,c=t.left+t.right+(t.bottom??0)+(t.top??0),l=[],h=1;if(t.left){let p=(t.left-1)/2*t.p;for(let m=0;m<t.left;m++){if(m===0)l=f$o(-t.w/2-t.pl/2,p-m*t.p,"left");o.push(uo(h,-t.w/2+t.pl/2,p-m*t.p,t.pl,t.pw)),r.push({type:"pcb_silkscreen_text",pcb_silkscreen_text_id:`pin_${h}`,pcb_component_id:"1",layer:"top",anchor_position:{x:-t.w/2+t.pl/2-4.5,y:p-m*t.p},text:`pin${h}`,font_size:0.7,font:"tscircuit2024",anchor_alignment:"center"}),h++,t.innerhole&&i.push(Ri(h+c,-t.w/2+t.innerholeedgedistance,p-m*t.p,1,1.2))}}if(t.bottom){let p=(t.bottom-1)/2*t.p;for(let m=t.bottom-1;m>=0;m--)o.push(uo(h,p-m*t.p,-n/2+t.pl/2,t.pw,t.pl)),r.push({type:"pcb_silkscreen_text",pcb_silkscreen_text_id:`pin_${h}`,pcb_component_id:"1",layer:"top",anchor_position:{x:p-m*t.p,y:-n/2+t.pl/2-3.2},text:`pin${h}`,font_size:0.7,font:"tscircuit2024",anchor_alignment:"center"}),h++,t.innerhole&&i.push(Ri(h+c,p-m*t.p,-n/2+t.innerholeedgedistance,1,1.2))}if(t.right){let p=-((t.right-1)/2)*t.p;for(let m=0;m<t.right;m++)o.push(uo(h,t.w/2-t.pl/2,p+m*t.p,t.pl,t.pw)),r.push({type:"pcb_silkscreen_text",pcb_silkscreen_text_id:`pin_${h}`,pcb_component_id:"1",layer:"top",anchor_position:{x:t.w/2-t.pl/2+3.7,y:p+m*t.p},text:`pin${h}`,font_size:0.7,font:"tscircuit2024",anchor_alignment:"center"}),h++,t.innerhole&&i.push(Ri(h+c,t.w/2-t.innerholeedgedistance,p+m*t.p,1,1.2))}if(t.top){let p=-((t.top-1)/2)*t.p;for(let m=t.top-1;m>=0;m--)o.push(uo(h,p+m*t.p,n/2-t.pl/2,t.pw,t.pl)),r.push({type:"pcb_silkscreen_text",pcb_silkscreen_text_id:`pin_${h}`,pcb_component_id:"1",layer:"top",anchor_position:{x:p+m*t.p,y:n/2-t.pl/2+3.2},text:`pin${h}`,font_size:0.7,font:"tscircuit2024",anchor_alignment:"center"}),h++,t.innerhole&&i.push(Ri(h+c,p+m*t.p,n/2-t.innerholeedgedistance,1,1.2))}let d={type:"pcb_silkscreen_path",pcb_silkscreen_path_id:"1",pcb_component_id:"1",layer:"top",route:l,stroke_width:0.1},u={type:"pcb_silkscreen_path",pcb_silkscreen_path_id:"pcb_silkscreen_path_1",pcb_component_id:"1",route:[{x:-t.w/2-t.pl/3,y:n/2+t.pl/3},{x:t.w/2+t.pl/3,y:n/2+t.pl/3},{x:t.w/2+t.pl/3,y:-n/2-t.pl/3},{x:-t.w/2-t.pl/3,y:-n/2-t.pl/3},{x:-t.w/2-t.pl/3,y:n/2+t.pl/3}],stroke_width:0.1,layer:"top"},_=Xo(0,n/1.8,n/25);return{circuitJson:[...i,...o,...r,u,d,_],parameters:t}},x$o=(e)=>{if(e.legsoutside=!0,!e.pl)e.pl=1.5;if(!e.pw)e.pw=0.3;return CR(e)},S5e=be.refine((e)=>Number.isFinite(e)&&e>0,{message:"pitch must be a positive finite length"}),C$o=Fo.extend({fn:k(),bodywidth:be.refine((e)=>Number.isFinite(e)&&e>0,{message:"bodywidth must be a positive finite length"}).optional().describe("physical body X size before footprint rotation, independent of copper"),bodyheight:be.refine((e)=>Number.isFinite(e)&&e>0,{message:"bodyheight must be a positive finite length"}).optional().describe("physical body Y size before footprint rotation, independent of copper"),bodythickness:be.refine((e)=>Number.isFinite(e)&&e>0,{message:"bodythickness must be a positive finite length"}).optional().describe("physical body Z size, excluding board standoff; metadata for 3D consumers"),num_pins:Ae().int().positive().optional().default(14),grid:Px.optional(),p:be.default(be.parse("0.5mm")),px:S5e.optional().describe("top and bottom row pitch"),py:S5e.optional().describe("left and right row pitch"),lrendpitch:S5e.optional().describe("first and last gaps on left and right rows"),tbendpitch:S5e.optional().describe("first and last gaps on top and bottom rows"),cw:Be().optional(),ccw:Be().optional(),startingpin:k().or(it(B5e)).transform((e)=>typeof e==="string"?e.slice(1,-1).split(","):e).pipe(it(B5e)).optional(),w:be.optional(),h:be.optional(),pw:be.default(be.parse("0.28mm")),pl:be.default(be.parse("0.7mm")),pillpads:Be().optional().default(!1)}),b$o=(e)=>{let t=C$o.parse(e),n=t.num_pins/2;if(!Number.isInteger(n))throw Error("LGA footprints require an even number of perimeter pads");let o=t.grid??{x:Math.ceil(n/2),y:Math.floor(n/2)};if(!Number.isInteger(o.x)||!Number.isInteger(o.y)||o.x<0||o.y<0||o.x+o.y<=0||2*(o.x+o.y)!==t.num_pins)throw Error(`LGA grid ${o.x}x${o.y} requires ${2*(o.x+o.y)} pads, got ${t.num_pins}`);if(t.cw&&t.ccw)throw Error("Choose either cw or ccw numbering");for(let[v,P,M]of[[o.x,t.lrendpitch,"left/right"],[o.y,t.tbendpitch,"top/bottom"]])if(P!==void 0&&v<3)throw Error(`${M} end pitch requires at least three pads per row`);let r=(v,P,M)=>M===void 0?(v-1)*P:2*M+(v-3)*P,i=t.w??r(o.y,t.px??t.p,t.tbendpitch)+2*t.pl,s=t.h??r(o.x,t.py??t.p,t.lrendpitch)+2*t.pl,a={left:o.x,right:o.x,top:o.y,bottom:o.y};for(let v of["left","right","top","bottom"])if(t.startingpin?.includes(`${v}side`)&&a[v]===0)throw Error(`Starting side ${v} has no pads`);let c=pRt({...t,sidePinCounts:a}),l=(v,P,M,B)=>{if(B===void 0)return((v-1)/2-P)*M;return(2*B+(v-3)*M)/2-(P===0?0:B+(P-1)*M+(P===v-1?B-M:0))},h=(i-t.pl)/2,d=(s-t.pl)/2,u=[],_=(v,P,M,B,T)=>{u.push(t.pillpads?xR(c[v],P,M,B,T):uo(c[v],P,M,B,T))},p=1;for(let v=0;v<o.x;v+=1)_(p++,-h,l(o.x,v,t.py??t.p,t.lrendpitch),t.pl,t.pw);for(let v=0;v<o.y;v+=1)_(p++,-l(o.y,v,t.px??t.p,t.tbendpitch)||0,-d,t.pw,t.pl);for(let v=0;v<o.x;v+=1)_(p++,h,-l(o.x,v,t.py??t.p,t.lrendpitch)||0,t.pl,t.pw);for(let v=0;v<o.y;v+=1)_(p++,l(o.y,v,t.px??t.p,t.tbendpitch),d,t.pw,t.pl);let m=Math.max(t.pw,0.15),A=u.find((v)=>v.type==="pcb_smtpad"&&(v.shape==="rect"||v.shape==="pill")&&Boolean(v.port_hints?.includes("1"))),g=A.x>0?1:-1,f=A.y<0?-1:1,y={type:"pcb_silkscreen_path",layer:"top",pcb_component_id:"",pcb_silkscreen_path_id:"pin1_marker",stroke_width:0.1,route:[{x:g*i/2,y:f*(s/2-m)},{x:g*i/2,y:f*s/2},{x:g*(i/2-m),y:f*s/2}]},x=0.25,C=i/2+x,b=s/2+x;if(t.bodywidth!==void 0||t.bodyheight!==void 0){C=Math.max(i,t.bodywidth??i)/2+x,b=Math.max(s,t.bodyheight??s)/2+x;for(let v of u){if(v.type!=="pcb_smtpad"||v.shape!=="rect"&&v.shape!=="pill")continue;C=Math.max(C,Math.abs(v.x)+v.width/2+x),b=Math.max(b,Math.abs(v.y)+v.height/2+x)}}let I={type:"pcb_courtyard_outline",pcb_courtyard_outline_id:"",pcb_component_id:"",layer:"top",outline:[{x:-C,y:-b},{x:C,y:-b},{x:C,y:b},{x:-C,y:b},{x:-C,y:-b}]};return{circuitJson:[...u,y,Xo(0,s/2+0.5,0.3),I],parameters:{...t,grid:o,w:i,h:s}}},PRt=Fo.extend({fn:k(),w:be.default("10mm"),h:be.optional(),left:be.optional().default(20),right:be.optional().default(20),top:be.optional().default(0),bottom:be.optional().default(0),p:be.default(be.parse("2.54mm")),id:be.optional().default(be.parse("1mm")),od:be.optional().default(be.parse("1.5mm"))}),I$o=(e)=>{let t=PRt.parse(e);if(t.left&&t.right)return Math.max(t.left,t.right)*t.p;if(t.left)return t.left*t.p;if(t.right)return t.right*t.p;return 51},P5e=(e,t,n,o=1,r=0.6)=>{let i=o/2,s=r/2;return{left:[{x:e+i,y:t},{x:e-i,y:t+s},{x:e-i,y:t-s},{x:e+i,y:t}],right:[{x:e-i,y:t},{x:e+i,y:t+s},{x:e+i,y:t-s},{x:e-i,y:t}],top:[{x:e,y:t-i},{x:e-s,y:t+i},{x:e+s,y:t+i},{x:e,y:t-i}],bottom:[{x:e,y:t+i},{x:e-s,y:t-i},{x:e+s,y:t-i},{x:e,y:t+i}]}[n]},v$o=(e)=>{let t=PRt.parse(e),n=t.h??I$o(t),o=[],{id:r,od:i}=t,s=[];if(t.right){let h=-((t.right-1)/2)*t.p;for(let d=0;d<t.right;d++){if(d===0&&!t.left&&!t.bottom)s=P5e(t.w/2+i*1.4,h+d*t.p,"right");o.push(Ri(d+1+t.left+(t.bottom??0),t.w/2,h+d*t.p,r,i))}}if(t.left){let h=-((t.left-1)/2)*t.p;for(let d=0;d<t.left;d++){if(d===t.left-1)s=P5e(-t.w/2-i*1.4,h+d*t.p,"left");o.push(Ri(d+1,-t.w/2,h+d*t.p,r,i))}}if(t.top){let h=-((t.top-1)/2)*t.p;for(let d=0;d<t.top;d++){if(d===t.top-1&&!t.left&&!t.bottom&&!t.right)s=P5e(h+d*t.p,n/2+i*1.4,"top");o.push(Ri(d+1+t.right+(t.bottom??0)+t.left,h+d*t.p,n/2,r,i))}}if(t.bottom){let h=-((t.bottom-1)/2)*t.p;for(let d=0;d<t.bottom;d++){if(d===0&&!t.left)s=P5e(h+d*t.p,-n/2-i*1.4,"bottom");o.push(Ri(d+1+t.left,h+d*t.p,-n/2,r,i))}}let a={type:"pcb_silkscreen_path",pcb_silkscreen_path_id:"1",pcb_component_id:"1",layer:"top",route:s,stroke_width:0.1},c={type:"pcb_silkscreen_path",pcb_silkscreen_path_id:"pcb_silkscreen_path_1",pcb_component_id:"1",route:[{x:-t.w/2-i,y:n/2+i},{x:t.w/2+i,y:n/2+i},{x:t.w/2+i,y:-n/2-i},{x:-t.w/2-i,y:-n/2-i},{x:-t.w/2-i,y:n/2+i}],stroke_width:0.1,layer:"top"},l=Xo(0,n/1.7,n/25);return{circuitJson:[...o,c,l,a],parameters:t}},S$o=(e)=>{let{centerX:t,centerY:n,straightHalfLength:o,radius:r,arcSegmentCount:i=9,orientation:s="horizontal"}=e;if(o<0)throw Error("Capsule straightHalfLength must be non-negative");if(r<=0)throw Error("Capsule radius must be positive");if(i<2)throw Error("Capsule arcSegmentCount must be at least 2");if(s==="horizontal"){let d=t-o,u=t+o,_=Array.from({length:i+1},(m,A)=>{let g=Math.PI/2-A*Math.PI/i;return{x:u+Math.cos(g)*r,y:n+Math.sin(g)*r}}),p=Array.from({length:i+1},(m,A)=>{let g=-Math.PI/2+A*Math.PI/i;return{x:d-Math.cos(g)*r,y:n+Math.sin(g)*r}});return[{x:d,y:n+r},{x:u,y:n+r},..._.slice(1,-1),{x:u,y:n-r},{x:d,y:n-r},...p.slice(1,-1)]}let a=n-o,c=n+o,l=Array.from({length:i+1},(d,u)=>{let _=Math.PI-u*Math.PI/i;return{x:t+Math.cos(_)*r,y:c+Math.sin(_)*r}}),h=Array.from({length:i+1},(d,u)=>{let _=u*Math.PI/i;return{x:t+Math.cos(_)*r,y:a-Math.sin(_)*r}});return[{x:t-r,y:a},{x:t-r,y:c},...l.slice(1,-1),{x:t+r,y:c},{x:t+r,y:a},...h.slice(1,-1)]},$Nt=(e,t,n,o)=>Array.from({length:25},(r,i)=>{let s=i/24*Math.PI-Math.PI/2;return{x:e+(o==="right"?1:-1)*Math.cos(s)*n,y:t+Math.sin(s)*n}}),P$o=Fo.extend({fn:k(),p:be.optional().default("4.88mm"),id:be.optional().default("0.8mm"),od:be.optional().default("1.5mm"),w:be.optional().default("5.6mm"),h:be.optional().default("3.5mm")}),E$o=(e)=>{let t=P$o.parse(e),{p:n,id:o,od:r,w:i,h:s}=t,a=s/2,c=[Ri(1,-n/2,0,o,r),Ri(2,n/2,0,o,r)],l=$Nt(-i/2,0,a,"left"),h=$Nt(i/2,0,a,"right"),d={type:"pcb_silkscreen_path",layer:"top",pcb_component_id:"",route:[...l,...l.slice(1).reverse(),{x:-i/2,y:-s/2},{x:i/2,y:-s/2},...h,{x:i/2,y:s/2},{x:-i/2,y:s/2}],stroke_width:0.1,pcb_silkscreen_path_id:""},u=Xo(0,n/4,0.5),p=n/2+r/2,m=Math.max(s/2+0.25,i/2+0.03),A={type:"pcb_courtyard_outline",pcb_courtyard_outline_id:"",pcb_component_id:"",outline:S$o({centerX:0,centerY:0,straightHalfLength:p,radius:m,arcSegmentCount:9}),layer:"top"};return{circuitJson:[...c,d,u,A],parameters:t}},mEs=Fo.extend({w:be,h:be}),M$o=(e)=>{let{w:t,h:n}=e,o=Ni(t),r=Ni(n);return{circuitJson:[uo(1,0,0,o,r),Xo(0,r/2+0.5,0.2)],parameters:e}},S7=(e,t,n,o,r,i)=>({pcb_plated_hole_id:"",type:"pcb_plated_hole",shape:"pill",x:t,y:n,outer_width:Ni(r),outer_height:Ni(i),hole_width:Ni(o),hole_height:Ni(o),pcb_port_id:"",layers:["top","bottom"],port_hints:[e.toString()],ccw_rotation:0}),w$o=[{x:-2.5,y:4.75},{x:-2.5,y:-0.25},{x:2.5,y:-0.25},{x:2.5,y:4.75}],B$o=Fo.extend({fn:k(),num_pins:un([he(3),he(2)]).default(3),p:k().default("1.27mm"),id:k().default("0.72mm"),od:k().default("0.95mm"),w:k().default("4.5mm"),h:k().default("4.5mm"),inline:Be().default(!1),string:k().optional()}),T$o=(e,t,n)=>Array.from({length:25},(o,r)=>{let i=r/24*Math.PI;return{x:e+Math.cos(i)*n,y:t+Math.sin(i)*n}}),D$o=(e)=>{let t=e.string?.match(/^to92_(\d+)/),n=t?Number.parseInt(t[1],10):3,o=B$o.parse({...e,num_pins:n}),{p:r,id:i,od:s,w:a,h:c,inline:l}=o,h=Number.parseFloat(c)/2,d=Number.parseFloat(r),u=Number.parseFloat(i),_=Number.parseFloat(s),p=_,m=_*1.4285714285714286,A=[];if(o.num_pins===3)if(l)A=[Z1({pn:1,x:-d,y:h-d,holeDiameter:u,rectPadWidth:_,rectPadHeight:m}),S7(2,0,h-d,u,p,m),S7(3,d,h-d,u,p,m)];else A=[Z1({pn:1,x:-d,y:h-d,holeDiameter:u,rectPadWidth:_,rectPadHeight:_}),Ri(2,0,h,u,_),Ri(3,d,h-d,u,_)];else if(o.num_pins===2)A=[Z1({pn:1,x:-d,y:h-d,holeDiameter:u,rectPadWidth:p,rectPadHeight:m}),S7(2,d,h-d,u,p,m)];else throw Error("Invalid number of pins for TO-92");let g=Number.parseFloat(a)/2,f=T$o(0,h,g),y={type:"pcb_silkscreen_path",layer:"top",pcb_component_id:"",route:[...f,{x:-g,y:0},{x:g,y:0},f[0]],stroke_width:0.1,pcb_silkscreen_path_id:""},x=Xo(0,h+1,0.5),C={type:"pcb_courtyard_outline",pcb_courtyard_outline_id:"",pcb_component_id:"",outline:w$o,layer:"top"};return{circuitJson:[...A,y,x,C],parameters:o}},N$o=Fo.extend({fn:k(),num_pins:he(2).default(2),w:k().default("2.15mm"),h:k().default("0.7mm"),pl:k().default("0.6mm"),pw:k().default("0.7mm"),p:k().default("1.4mm")}),R$o=(e)=>{let t=N$o.parse(e),n=Xo(0,be.parse(t.h),0.3),o={type:"pcb_silkscreen_path",layer:"top",pcb_component_id:"",route:[{x:be.parse(t.p)/2,y:be.parse(t.h)/2+0.2},{x:-be.parse(t.w)/2-0.2,y:be.parse(t.h)/2+0.2},{x:-be.parse(t.w)/2-0.2,y:-be.parse(t.h)/2-0.2},{x:be.parse(t.p)/2,y:-be.parse(t.h)/2-0.2}],stroke_width:0.1,pcb_silkscreen_path_id:""},r=2.5,i=1.4,s={type:"pcb_courtyard_rect",pcb_courtyard_rect_id:"",pcb_component_id:"",center:{x:0,y:0},width:2.5,height:1.4,layer:"top"};return{circuitJson:k$o(t).concat(...f0(t),o,n,s),parameters:t}},Q$o=(e)=>{let{pn:t,p:n}=e;if(t===1)return{x:-n/2,y:0};else return{x:n/2,y:0}},k$o=(e)=>{let t=[],n=be.parse(e.p),o=be.parse(e.pl),r=be.parse(e.pw),i=0.075;for(let s=1;s<=e.num_pins;s++){let{x:a,y:c}=Q$o({pn:s,p:n});t.push(uo(s,a,c,o,r,0.075))}return t},L$o=qz({w:"7.05mm",p:"1.27mm",pw:"0.65mm",pl:"1.975mm"}),H$o=(e)=>{let t=L$o.parse(e),n=[],o=Math.min(t.pl,t.pw)/8;for(let _=0;_<t.num_pins;_++){let{x:p,y:m}=xGe({num_pins:t.num_pins,pn:_+1,w:t.w,p:t.p??1.27,pl:t.pl,widthincludeslegs:!0});n.push(uo(_+1,p,m,t.pl,t.pw,o))}let r=(t.num_pins/2-1)*t.p+t.pw,i=Xo(0,r/2+1,r/12),s={layer:"top",pcb_component_id:"",pcb_silkscreen_path_id:"",type:"pcb_silkscreen_path",route:[{x:-t.w/3,y:r/2+0.4},{x:t.w/3,y:r/2+0.4}],stroke_width:0.1},a=(t.num_pins/2-1)*t.p+t.pw,c=t.w/2-1.395,l=t.w/2+0.255,h=a/2+0.25,d=a/2+0.5,u={type:"pcb_courtyard_outline",pcb_courtyard_outline_id:"",pcb_component_id:"",layer:"top",outline:ey([{minX:-l,maxX:l,minY:-h,maxY:h},{minX:-c,maxX:c,minY:-d,maxY:d}])};return{circuitJson:[...n,i,s,u],parameters:t}},F$o=Fo.extend({fn:k(),num_pins:he(2).default(2),w:k().default("5.0mm"),h:k().default("2.30mm"),pl:k().default("1.25mm"),pw:k().default("2mm"),p:k().default("3.75mm")}),z$o=(e)=>{let t=F$o.parse(e),n=Xo(0,be.parse(t.h)/2+1,0.3),o={type:"pcb_silkscreen_path",layer:"top",pcb_component_id:"",route:[{x:be.parse(t.p)/2+0.5,y:be.parse(t.h)/2+0.5},{x:-be.parse(t.w)/2-0.5,y:be.parse(t.h)/2+0.5},{x:-be.parse(t.w)/2-0.5,y:-be.parse(t.h)/2-0.5},{x:be.parse(t.p)/2+0.5,y:-be.parse(t.h)/2-0.5}],stroke_width:0.1,pcb_silkscreen_path_id:""},r=5.1,i=2.8,s={type:"pcb_courtyard_rect",pcb_courtyard_rect_id:"",pcb_component_id:"",center:{x:0,y:0},width:5.1,height:2.8,layer:"top"};return{circuitJson:V$o(t).concat(...f0(t),o,n,s),parameters:t}},O$o=(e)=>{let{pn:t,p:n}=e;return t===1?{x:-n/2,y:0}:{x:n/2,y:0}},V$o=(e)=>{let t=[];for(let n=1;n<=e.num_pins;n++){let{x:o,y:r}=O$o({pn:n,p:be.parse(e.p)});t.push(uo(n,o,r,be.parse(e.pl),be.parse(e.pw)))}return t},Y$o=Fo.extend({fn:k(),num_pins:he(2).default(2),w:k().default("4.4mm"),h:k().default("1.7mm"),pl:k().default("1.2mm"),pw:k().default("1.2mm"),p:k().default("2.8mm")}),G$o=(e)=>{let t=Y$o.parse(e),n=Xo(0,be.parse(t.h)-0.5,0.3),o={type:"pcb_silkscreen_path",layer:"top",pcb_component_id:"",route:[{x:be.parse(t.p)/2,y:be.parse(t.h)/2},{x:-be.parse(t.w)/2-0.2,y:be.parse(t.h)/2},{x:-be.parse(t.w)/2-0.2,y:-be.parse(t.h)/2},{x:be.parse(t.p)/2,y:-be.parse(t.h)/2}],stroke_width:0.1,pcb_silkscreen_path_id:""},r=4.5,i=2.2,s={type:"pcb_courtyard_rect",pcb_courtyard_rect_id:"",pcb_component_id:"",center:{x:0,y:0},width:4.5,height:2.2,layer:"top"};return{circuitJson:W$o(t).concat(...f0(t),o,n,s),parameters:t}},U$o=(e)=>{let{pn:t,p:n}=e;if(t===1)return{x:-n/2,y:0};return{x:n/2,y:0}},W$o=(e)=>{let t=[];for(let n=1;n<=e.num_pins;n++){let{x:o,y:r}=U$o({pn:n,p:be.parse(e.p)});t.push(uo(n,o,r,be.parse(e.pl),be.parse(e.pw)))}return t},X$o=Fo.extend({fn:k(),num_pins:he(2).default(2),w:k().default("3.30mm"),h:k().default("1.80mm"),pl:k().default("0.60mm"),pw:k().default("0.45mm"),p:k().default("2.1mm")}),j$o=(e)=>{let t=X$o.parse(e),n=Xo(0,be.parse(t.h)-0.5,0.3),o={type:"pcb_silkscreen_path",layer:"top",pcb_component_id:"",route:[{x:be.parse(t.p)/2,y:be.parse(t.h)/2},{x:-be.parse(t.w)/2,y:be.parse(t.h)/2},{x:-be.parse(t.w)/2,y:-be.parse(t.h)/2},{x:be.parse(t.p)/2,y:-be.parse(t.h)/2}],stroke_width:0.1,pcb_silkscreen_path_id:""},r=3.2,i=1.9,s={type:"pcb_courtyard_rect",pcb_courtyard_rect_id:"",pcb_component_id:"",center:{x:0,y:0},width:3.2,height:1.9,layer:"top"};return{circuitJson:$$o(t).concat(...f0(t),o,n,s),parameters:t}},K$o=(e)=>{let{pn:t,p:n}=e;if(t===1)return{x:-n/2,y:0};return{x:n/2,y:0}},$$o=(e)=>{let t=[],n=be.parse(e.p),o=be.parse(e.pl),r=be.parse(e.pw),i=0.05625;for(let s=1;s<=e.num_pins;s++){let{x:a,y:c}=K$o({pn:s,p:n});t.push(uo(s,a,c,o,r,0.05625))}return t},q$o=xRt("sod323he",{p:"2.1001mm",pw:"0.8mm",ph:"1.1mm",bodylength:"2mm",bodywidth:"1.4mm",bodyheight:"0.6mm",leadspan:"2.5mm",cathodelength:"0.55mm",cathodewidth:"0.8mm",anodelength:"0.55mm",anodewidth:"0.8mm",terminalthickness:"0.17mm",standoff:"0.05mm",taperinset:"0.15mm",markingwidth:"0.2mm"}),J$o=(e)=>{let t=q$o.parse(e);return{circuitJson:CRt(t),parameters:t}},Z$o=Fo.extend({fn:k(),num_pins:he(2).default(2),w:k().default("1.4mm"),h:k().default("0.9mm"),pl:k().default("0.36mm"),pw:k().default("0.25mm"),p:k().default("0.85mm")}),eqo=(e)=>{let t=Z$o.parse(e),n=be.parse(t.w),o=be.parse(t.h),r=be.parse(t.pl),i=be.parse(t.pw),s=be.parse(t.p),a=Xo(0,o,0.3),c={type:"pcb_silkscreen_path",layer:"top",pcb_component_id:"",route:[{x:s/2+0.15,y:o/2},{x:-n/2-0.15,y:o/2},{x:-n/2-0.15,y:-o/2},{x:s/2+0.15,y:-o/2}],stroke_width:0.1,pcb_silkscreen_path_id:""},l=s+r,h=i,d=n/2,u=o/2,_=l/2,p=h/2,m=Math.max(d,_),A=Math.max(u,p),g=Math.min(d,_),f=Math.min(u,p),y=m+0.05,x=g-0.055,C=A,b=f+0.155,I={type:"pcb_courtyard_outline",pcb_courtyard_outline_id:"",pcb_component_id:"",outline:ey([{minX:-y,maxX:y,minY:-b,maxY:b},{minX:-x,maxX:x,minY:-C,maxY:C}]),layer:"top"};return{circuitJson:nqo(t).concat(...f0(t),c,a,I),parameters:t}},tqo=(e)=>{let{pn:t,p:n}=e;if(t===1)return{x:-n/2,y:0};else return{x:n/2,y:0}},nqo=(e)=>{let t=[],n=be.parse(e.p),o=be.parse(e.pl),r=be.parse(e.pw),i=0.03125;for(let s=1;s<=e.num_pins;s++){let{x:a,y:c}=tqo({pn:s,p:n});t.push(uo(s,a,c,o,r,0.03125))}return t},oqo=Fo.extend({fn:k(),num_pins:he(2).default(2),w:k().default("1.3mm"),h:k().default("0.9mm"),pl:k().default("0.4mm"),pw:k().default("0.7mm"),p:k().default("0.7mm")}),rqo=(e)=>{let t=oqo.parse(e),n=Xo(0,be.parse(t.h)+0.1,0.3),o={type:"pcb_silkscreen_path",layer:"top",pcb_component_id:"",route:[{x:be.parse(t.p)/2+0.2,y:be.parse(t.h)/2+0.2},{x:-be.parse(t.w)/2-0.2,y:be.parse(t.h)/2+0.2},{x:-be.parse(t.w)/2-0.2,y:-be.parse(t.h)/2-0.2},{x:be.parse(t.p)/2+0.2,y:-be.parse(t.h)/2-0.2}],stroke_width:0.1,pcb_silkscreen_path_id:""},r=1.6,i=1.2,s={type:"pcb_courtyard_rect",pcb_courtyard_rect_id:"",pcb_component_id:"",center:{x:0,y:0},width:1.6,height:1.2,layer:"top"};return{circuitJson:sqo(t).concat(...f0(t),o,n,s),parameters:t}},iqo=(e)=>{let{pn:t,p:n}=e;if(t===1)return{x:-n/2,y:0};else return{x:n/2,y:0}},sqo=(e)=>{let t=[];for(let n=1;n<=e.num_pins;n++){let{x:o,y:r}=iqo({pn:n,p:be.parse(e.p)});t.push(uo(n,o,r,be.parse(e.pl),be.parse(e.pw),0.025))}return t},aqo=Fo.extend({fn:k(),num_pins:he(2).default(2),w:k().default("3.05mm"),h:k().default("1.4mm"),pl:k().default("0.5mm"),pw:k().default("0.5mm"),pad_spacing:k().default("2.2mm")}),cqo=(e)=>{let t=aqo.parse(e),n=Xo(0,be.parse(t.h),0.3),o={type:"pcb_silkscreen_path",layer:"top",pcb_component_id:"",route:[{x:be.parse(t.pad_spacing)/2,y:be.parse(t.h)/2},{x:-be.parse(t.w)/2-0.2,y:be.parse(t.h)/2},{x:-be.parse(t.w)/2-0.2,y:-be.parse(t.h)/2},{x:be.parse(t.pad_spacing)/2,y:-be.parse(t.h)/2}],stroke_width:0.1,pcb_silkscreen_path_id:""},r=3.2,i=1.9,s={type:"pcb_courtyard_rect",pcb_courtyard_rect_id:"",pcb_component_id:"",center:{x:0,y:0},width:3.2,height:1.9,layer:"top"};return{circuitJson:hqo(t).concat(...f0(t),o,n,s),parameters:t}},lqo=(e)=>{let{pn:t,pad_spacing:n}=e;if(t===1)return{x:-n/2,y:0};else return{x:n/2,y:0}},hqo=(e)=>{let t=[];for(let n=1;n<=e.num_pins;n++){let{x:o,y:r}=lqo({pn:n,pad_spacing:be.parse(e.pad_spacing)});t.push(uo(n,o,r,be.parse(e.pl),be.parse(e.pw),0.0625))}return t},dqo=Fo.extend({fn:k(),num_pins:he(2).default(2),w:k().default("4.4mm"),h:k().default("2.1mm"),pl:k().default("1.10mm"),pw:k().default("1.10mm"),p:k().default("2.8mm")}),uqo=(e)=>{let t=dqo.parse(e),n=Xo(0,be.parse(t.h),0.3),o={type:"pcb_silkscreen_path",layer:"top",pcb_component_id:"",route:[{x:be.parse(t.p)/2,y:be.parse(t.h)/2},{x:-be.parse(t.w)/2-0.2,y:be.parse(t.h)/2},{x:-be.parse(t.w)/2-0.2,y:-be.parse(t.h)/2},{x:be.parse(t.p)/2,y:-be.parse(t.h)/2}],stroke_width:0.1,pcb_silkscreen_path_id:""},r=4.4,i=2.3,s={type:"pcb_courtyard_rect",pcb_courtyard_rect_id:"",pcb_component_id:"",center:{x:0,y:0},width:4.4,height:2.3,layer:"top"};return{circuitJson:mqo(t).concat(...f0(t),o,n,s),parameters:t}},pqo=(e)=>{let{pn:t,p:n}=e;if(t===1)return{x:-n/2,y:0};else return{x:n/2,y:0}},mqo=(e)=>{let t=[],n=be.parse(e.p),o=be.parse(e.pl),r=be.parse(e.pw),i=0.125;for(let s=1;s<=e.num_pins;s++){let{x:a,y:c}=pqo({pn:s,p:n});t.push(uo(s,a,c,o,r,0.125))}return t},_qo=Fo.extend({fn:k(),num_pins:he(2).default(2),w:k().default("4.4mm"),h:k().default("2.1mm"),pl:k().default("0.91mm"),pw:k().default("1.22mm"),p:k().default("3.146mm")}),gqo=(e)=>{let t=_qo.parse(e),n=Xo(0,be.parse(t.h),0.3),o={type:"pcb_silkscreen_path",layer:"top",pcb_component_id:"",route:[{x:be.parse(t.p)/2,y:be.parse(t.h)/2},{x:-be.parse(t.w)/2-0.2,y:be.parse(t.h)/2},{x:-be.parse(t.w)/2-0.2,y:-be.parse(t.h)/2},{x:be.parse(t.p)/2,y:-be.parse(t.h)/2}],stroke_width:0.1,pcb_silkscreen_path_id:""},r=4.9,i=2.7,s={type:"pcb_courtyard_rect",pcb_courtyard_rect_id:"",pcb_component_id:"",center:{x:0,y:0},width:4.9,height:2.7,layer:"top"};return{circuitJson:fqo(t).concat(...f0(t),o,n,s),parameters:t}},Aqo=(e)=>{let{pn:t,p:n}=e;if(t===1)return{x:-n/2,y:0};else return{x:n/2,y:0}},fqo=(e)=>{let t=[];for(let n=1;n<=e.num_pins;n++){let{x:o,y:r}=Aqo({pn:n,p:be.parse(e.p)});t.push(uo(n,o,r,be.parse(e.pl),be.parse(e.pw)))}return t},yqo=Fo.extend({fn:k(),num_pins:he(2).default(2),w:k().default("1.80mm"),h:k().default("1.00mm"),pl:k().default("0.66mm"),pw:k().default("0.5mm"),p:k().default("0.8mm")}),xqo=(e)=>{let t=yqo.parse(e),n=Xo(0,be.parse(t.h),0.3),o={type:"pcb_silkscreen_path",layer:"top",pcb_component_id:"",route:[{x:be.parse(t.p)/2,y:be.parse(t.h)/2},{x:-be.parse(t.w)/2-0.1,y:be.parse(t.h)/2},{x:-be.parse(t.w)/2-0.1,y:-be.parse(t.h)/2},{x:be.parse(t.p)/2,y:-be.parse(t.h)/2}],stroke_width:0.1,pcb_silkscreen_path_id:""},r=2.3,i=1.5,s={type:"pcb_courtyard_rect",pcb_courtyard_rect_id:"",pcb_component_id:"",center:{x:0,y:0},width:2.3,height:1.5,layer:"top"};return{circuitJson:bqo(t).concat(...f0(t),o,n,s),parameters:t}},Cqo=(e)=>{let{pn:t,p:n}=e;if(t===1)return{x:-n/2,y:0};else return{x:n/2,y:0}},bqo=(e)=>{let t=[];for(let n=1;n<=e.num_pins;n++){let{x:o,y:r}=Cqo({pn:n,p:be.parse(e.p)});t.push(uo(n,o,r,be.parse(e.pl),be.parse(e.pw)))}return t},Iqo=Fo.extend({fn:k(),num_pins:he(2).default(2),w:k().default("6.2mm"),h:k().default("3.4mm"),pl:k().default("1.4mm"),pw:k().default("2.1mm"),p:k().default("4.4mm")}),vqo=(e)=>{let t=Iqo.parse(e),n=Xo(0,be.parse(t.h)/2+0.4,0.3),o={type:"pcb_silkscreen_path",layer:"top",pcb_component_id:"",route:[{x:be.parse(t.p)/2,y:be.parse(t.h)/2},{x:-be.parse(t.w)/2-0.2,y:be.parse(t.h)/2},{x:-be.parse(t.w)/2-0.2,y:-be.parse(t.h)/2},{x:be.parse(t.p)/2,y:-be.parse(t.h)/2}],stroke_width:0.1,pcb_silkscreen_path_id:""},r=6.3,i=3,s={type:"pcb_courtyard_rect",pcb_courtyard_rect_id:"",pcb_component_id:"",center:{x:0,y:0},width:6.3,height:3,layer:"top"};return{circuitJson:Pqo(t).concat(...f0(t),o,n,s),parameters:t}},Sqo=(e)=>{let{pn:t,p:n}=e;if(t===1)return{x:-n/2,y:0};else return{x:n/2,y:0}},Pqo=(e)=>{let t=[];for(let n=1;n<=e.num_pins;n++){let{x:o,y:r}=Sqo({pn:n,p:be.parse(e.p)});t.push(uo(n,o,r,be.parse(e.pl),be.parse(e.pw),0.125))}return t},Eqo=[{x:-2.85,y:-2.5},{x:-2.85,y:2.5},{x:2.25,y:2.5},{x:2.25,y:-2.5}],Mqo=[{x:-2.85,y:-2.5},{x:-2.85,y:2.5},{x:2.85,y:2.5},{x:2.85,y:-2.5}],wqo=[{x:0.9,y:0.5},{x:2.6,y:0.5},{x:2.6,y:-0.5},{x:0.9,y:-0.5},{x:0.4,y:-1},{x:-0.4,y:-1},{x:-0.9,y:-0.5},{x:-2.6,y:-0.5},{x:-2.6,y:0.5},{x:-0.9,y:0.5},{x:-0.4,y:1},{x:0.4,y:1}],Bqo=[{x:2,y:-0.8665},{x:-1.125,y:-0.8665},{x:-1.125,y:-0.45},{x:-2.6,y:-0.45},{x:-2.6,y:0.45},{x:-1.125,y:0.45},{x:-1.125,y:0.8665},{x:2,y:0.8665}],Tqo=Fo.extend({fn:k(),num_pins:un([he(3),he(5)]).default(3),w:k().default("4.20mm"),h:k().default("4.80mm"),pl:k().default("1.3mm"),pw:k().default("0.9mm"),p:k().default("1.5mm"),string:k().optional()}),Dqo=(e)=>{let t=Number.parseFloat(e.p),n=Number.parseFloat(e.pw),o=Number.parseFloat(e.w),r=Number.parseFloat(e.pl),i=Math.min(r,n)/8,s=-o/2+0.15,a=o/2-1,c=Number.parseFloat(e.h)/2,l=[uo(1,s,t,r,n,i),CGe(2,Bqo),uo(3,s,-t,r,n,i)],h=Xo(0,c+0.5,0.3),d={layer:"top",pcb_component_id:"",pcb_silkscreen_path_id:"silkscreen_path_1",route:[{x:-a,y:c},{x:a,y:c},{x:a,y:c/2+0.5}],type:"pcb_silkscreen_path",stroke_width:0.1},u={layer:"top",pcb_component_id:"",pcb_silkscreen_path_id:"silkscreen_path_2",route:[{x:-a,y:-c},{x:a,y:-c},{x:a,y:-c/2-0.5}],type:"pcb_silkscreen_path",stroke_width:0.1},_={type:"pcb_courtyard_outline",pcb_courtyard_outline_id:"",pcb_component_id:"",outline:Eqo,layer:"top"};return[...l,d,u,h,_]},Nqo=(e)=>{let t=Math.min(1.5,0.7)/8,n=[uo(1,-1.85,-1.5,1.5,0.7,t),uo(2,-1.85,1.5,1.5,0.7,t),CGe(3,wqo),uo(4,1.85,-1.5,1.5,0.7,t),uo(5,1.85,1.5,1.5,0.7,t)],o=Number.parseFloat(e.w)/2-1,r=Number.parseFloat(e.h)/2,i=Xo(0,r+0.5,0.3),s={layer:"top",pcb_component_id:"",pcb_silkscreen_path_id:"silkscreen_path_1",route:[{x:-o,y:r},{x:o,y:r}],type:"pcb_silkscreen_path",stroke_width:0.1},a={layer:"top",pcb_component_id:"",pcb_silkscreen_path_id:"silkscreen_path_2",route:[{x:-o,y:-r},{x:o,y:-r}],type:"pcb_silkscreen_path",stroke_width:0.1},c={type:"pcb_courtyard_outline",pcb_courtyard_outline_id:"",pcb_component_id:"",outline:Mqo,layer:"top"};return[...n,s,a,i,c]},Rqo=(e)=>{let t=e.string?.match(/^sot89_(\d+)/),n=t?Number.parseInt(t[1],10):3,o=Tqo.parse({...e,num_pins:n});if(o.num_pins===3)return{circuitJson:Dqo(o),parameters:o};if(o.num_pins===5)return{circuitJson:Nqo(o),parameters:o};throw Error("Invalid number of pins for SOT89")},Qqo=Fo.extend({fn:k(),p:be.optional().default("5.0mm"),id:be.optional().default("1.0mm"),od:be.optional().default("1.9mm"),w:be.optional().default("13mm"),h:be.optional().default("7mm"),num_pins:Ae().optional(),string:k().optional()}),ERt=(e)=>{let t=Qqo.parse(e),{id:n,od:o,w:r,h:i,string:s}=t,a=t.num_pins??Number.parseInt(s?.match(/^to220(?:_|-)(\d+)/i)?.[1]??"3"),c=-1,l=r/2,h=i/2,d=2.5,u=r*0.4,_=Math.max(2.5,u/(a-1)),p=Array.from({length:a},(L,H)=>{let V=a%2===0?(H-a/2+0.5)*_:(H-Math.floor(a/2))*_;return Ri(H+1,V,-1,n,o)}),m={type:"pcb_silkscreen_path",layer:"top",pcb_component_id:"",route:[{x:-l,y:-h},{x:l,y:-h},{x:l,y:h},{x:-l,y:h},{x:-l,y:-h}],stroke_width:0.1,pcb_silkscreen_path_id:""},A=-h+2*i/3,g={type:"pcb_silkscreen_path",layer:"top",pcb_component_id:"",route:[{x:-l,y:A},{x:l,y:A}],stroke_width:0.1,pcb_silkscreen_path_id:""},f=[{type:"pcb_silkscreen_path",layer:"top",pcb_component_id:"",route:[{x:-r/6,y:A},{x:-r/6,y:h}],stroke_width:0.1,pcb_silkscreen_path_id:""},{type:"pcb_silkscreen_path",layer:"top",pcb_component_id:"",route:[{x:r/6,y:A},{x:r/6,y:h}],stroke_width:0.1,pcb_silkscreen_path_id:""}],y=Xo(0,i/2+0.6,0.5),x=Math.max(...p.map((L)=>Math.abs(L.x)))+o/2,C=-1+o/2,b=-1-o/2,I=Math.max(x+0.25,l-o*0.59),v=h-o*0.63,P=b-(o/2+0.01),M=-I,B=I,T=Math.min(P,b-0.25),N=Math.max(v,C+0.25),D={type:"pcb_courtyard_rect",pcb_courtyard_rect_id:"",pcb_component_id:"",center:{x:(M+B)/2,y:(T+N)/2},width:B-M,height:N-T,layer:"top"};return{circuitJson:[...p,m,g,...f,y,D],parameters:{...t,p:_}}},_Ge=2.54,kqo=Fo.extend({fn:k(),id:be.optional().default("1.2mm"),od:be.optional().default("1.905mm"),ph:be.optional().default("2mm"),w:be.optional().default("13mm"),h:be.optional().default("7mm"),num_pins:Ae().optional(),string:k().optional()}),Lqo=(e)=>{let t=kqo.parse(e),n=t.num_pins??Number.parseInt(t.string?.match(/^to220f(?:_|-)(\d+)/i)?.[1]??"3"),o=ERt({...t,fn:"to220",string:t.string?.replace(/^to220f/i,"to220"),num_pins:n}),r=-1,i=Array.from({length:n},(a,c)=>{let l=n%2===0?(c-n/2+0.5)*_Ge:(c-Math.floor(n/2))*_Ge;if(c===0)return Z1({pn:1,x:l,y:-1,holeDiameter:t.id,rectPadWidth:t.od,rectPadHeight:t.ph});return S7(c+1,l,-1,Ni(t.id),Ni(t.od),Ni(t.ph))}),s=o.circuitJson.filter((a)=>a.type!=="pcb_plated_hole");return{circuitJson:[...i,...s],parameters:{...t,p:_Ge,num_pins:n}}},Hqo=Fo.extend({fn:k(),num_pins:he(2).default(2),w:k().default("5.40mm"),h:k().default("2.30mm"),pl:k().default("1.30mm"),pw:k().default("1.70mm"),p:k().default("3.5mm")}),Fqo=(e)=>{let t=Hqo.parse(e),n=Xo(0,be.parse(t.h)/2+0.4,0.3),o={type:"pcb_silkscreen_path",layer:"top",pcb_component_id:"",route:[{x:be.parse(t.p)/2,y:be.parse(t.h)/2},{x:-be.parse(t.w)/2,y:be.parse(t.h)/2},{x:-be.parse(t.w)/2,y:-be.parse(t.h)/2},{x:be.parse(t.p)/2,y:-be.parse(t.h)/2}],stroke_width:0.1,pcb_silkscreen_path_id:""},r=5.3,i=2.2,s={type:"pcb_courtyard_rect",pcb_courtyard_rect_id:"",pcb_component_id:"",center:{x:0,y:0},width:5.3,height:2.2,layer:"top"};return{circuitJson:Oqo(t).concat(...f0(t),o,n,s),parameters:t}},zqo=(e)=>{let{pn:t,p:n}=e;return t===1?{x:-n/2,y:0}:{x:n/2,y:0}},Oqo=(e)=>{let t=[];for(let n=1;n<=e.num_pins;n++){let{x:o,y:r}=zqo({pn:n,p:be.parse(e.p)});t.push(uo(n,o,r,be.parse(e.pl),be.parse(e.pw),0.125))}return t},Vqo=Fo.extend({fn:k(),num_pins:he(2).default(2),w:k().default("1.90mm"),h:k().default("1.33mm"),pl:k().default("0.5mm"),pw:k().default("0.7mm"),p:k().default("0.8mm")}),Yqo=(e)=>{let t=Vqo.parse(e),n=Xo(0,be.parse(t.h)+0.1,0.3),o={type:"pcb_silkscreen_path",layer:"top",pcb_component_id:"",route:[{x:be.parse(t.p)/2+0.1,y:be.parse(t.h)/2},{x:-be.parse(t.w)/2,y:be.parse(t.h)/2},{x:-be.parse(t.w)/2,y:-be.parse(t.h)/2},{x:be.parse(t.p)/2+0.1,y:-be.parse(t.h)/2}],stroke_width:0.1,pcb_silkscreen_path_id:""},r=1.8,i=1.2,s={type:"pcb_courtyard_rect",pcb_courtyard_rect_id:"",pcb_component_id:"",center:{x:0,y:0},width:1.8,height:1.2,layer:"top"};return{circuitJson:Uqo(t).concat(...f0(t),o,n,s),parameters:t}};var Gqo=(e)=>{let{pn:t,p:n}=e;if(t===1)return{x:-n/2,y:0};else return{x:n/2,y:0}},Uqo=(e)=>{let t=[];for(let n=1;n<=e.num_pins;n++){let{x:o,y:r}=Gqo({pn:n,p:be.parse(e.p)});t.push(uo(n,o,r,be.parse(e.pl),be.parse(e.pw),0.0625))}return t},Wqo=Fo.extend({fn:k(),num_pins:he(2).default(2),w:k().default("7.0mm"),h:k().default("3.35mm"),pl:k().default("1.50mm"),pw:k().default("2.70mm"),p:k().default("4.8mm")}),Xqo=(e)=>{let t=Wqo.parse(e),n=Xo(0,be.parse(t.h),0.3),o={type:"pcb_silkscreen_path",layer:"top",pcb_component_id:"",route:[{x:be.parse(t.p)/2,y:be.parse(t.h)/2},{x:-be.parse(t.w)/2,y:be.parse(t.h)/2},{x:-be.parse(t.w)/2,y:-be.parse(t.h)/2},{x:be.parse(t.p)/2,y:-be.parse(t.h)/2}],stroke_width:0.1,pcb_silkscreen_path_id:""},r=6.8,i=3.2,s={type:"pcb_courtyard_rect",pcb_courtyard_rect_id:"",pcb_component_id:"",center:{x:0,y:0},width:6.8,height:3.2,layer:"top"};return{circuitJson:Kqo(t).concat(...f0(t),o,n,s),parameters:t}},jqo=(e)=>{let{pn:t,p:n}=e;if(t===1)return{x:-n/2,y:0};else return{x:n/2,y:0}},Kqo=(e)=>{let t=[];for(let n=1;n<=e.num_pins;n++){let{x:o,y:r}=jqo({pn:n,p:be.parse(e.p)});t.push(uo(n,o,r,be.parse(e.pl),be.parse(e.pw),0.125))}return t},$qo=Fo.extend({fn:k(),num_pins:he(2).default(2),w:k().default("3.0mm"),h:k().default("1.80mm"),pl:k().default("0.80mm"),pw:k().default("1.20mm"),p:k().default("1.6mm")}),qqo=(e)=>{let t=$qo.parse(e),n=Xo(0,be.parse(t.h),0.3),o={type:"pcb_silkscreen_path",layer:"top",pcb_component_id:"",route:[{x:be.parse(t.p)/2,y:be.parse(t.h)/2},{x:-be.parse(t.w)/2-0.1,y:be.parse(t.h)/2},{x:-be.parse(t.w)/2-0.1,y:-be.parse(t.h)/2},{x:be.parse(t.p)/2,y:-be.parse(t.h)/2}],stroke_width:0.1,pcb_silkscreen_path_id:""},r=2.9,i=1.7,s={type:"pcb_courtyard_rect",pcb_courtyard_rect_id:"",pcb_component_id:"",center:{x:0,y:0},width:2.9,height:1.7,layer:"top"};return{circuitJson:Zqo(t).concat(...f0(t),o,n,s),parameters:t}},Jqo=(e)=>{let{pn:t,p:n}=e;if(t===1)return{x:-n/2,y:0};else return{x:n/2,y:0}},Zqo=(e)=>{let t=[];for(let n=1;n<=e.num_pins;n++){let{x:o,y:r}=Jqo({pn:n,p:be.parse(e.p)});t.push(uo(n,o,r,be.parse(e.pl),be.parse(e.pw),0.1))}return t},eJo=Fo.extend({fn:k(),num_pins:he(2).default(2),w:k().default("7.10mm"),h:k().default("3.40mm"),pl:k().default("2.50mm"),pw:k().default("1.80mm"),p:k().default("4.00mm")}),tJo=(e)=>{let t=eJo.parse(e),n=Xo(0,be.parse(t.h)/2+0.5,0.3),o={type:"pcb_silkscreen_path",layer:"top",pcb_component_id:"",route:[{x:be.parse(t.p)/2,y:be.parse(t.h)/2},{x:-be.parse(t.w)/2-0.5,y:be.parse(t.h)/2},{x:-be.parse(t.w)/2-0.5,y:-be.parse(t.h)/2},{x:be.parse(t.p)/2,y:-be.parse(t.h)/2}],stroke_width:0.1,pcb_silkscreen_path_id:""},r=7,i=3.5,s={type:"pcb_courtyard_rect",pcb_courtyard_rect_id:"",pcb_component_id:"",center:{x:0,y:0},width:7,height:3.5,layer:"top"};return{circuitJson:oJo(t).concat(...f0(t),o,n,s),parameters:t}},nJo=(e)=>{let{pn:t,p:n}=e;if(t===1)return{x:-n/2,y:0};return{x:n/2,y:0}},oJo=(e)=>{let t=[];for(let n=1;n<=e.num_pins;n++){let{x:o,y:r}=nJo({pn:n,p:be.parse(e.p)});t.push(uo(n,o,r,be.parse(e.pl),be.parse(e.pw),0.125))}return t},rJo=Fo.extend({fn:k(),num_pins:he(2).default(2),w:k().default("4.80mm"),h:k().default("2.10mm"),pl:k().default("1.30mm"),pw:k().default("1.40mm"),p:k().default("2.9mm")}),iJo=(e)=>{let t=rJo.parse(e),n=Xo(0,be.parse(t.h)-0.5,0.3),o={type:"pcb_silkscreen_path",layer:"top",pcb_component_id:"",route:[{x:be.parse(t.p)/2,y:be.parse(t.h)/2},{x:-be.parse(t.w)/2,y:be.parse(t.h)/2},{x:-be.parse(t.w)/2,y:-be.parse(t.h)/2},{x:be.parse(t.p)/2,y:-be.parse(t.h)/2}],stroke_width:0.1,pcb_silkscreen_path_id:""},r=4.7,i=2.3,s={type:"pcb_courtyard_rect",pcb_courtyard_rect_id:"",pcb_component_id:"",center:{x:0,y:0},width:4.7,height:2.3,layer:"top"};return{circuitJson:aJo(t).concat(...f0(t),o,n,s),parameters:t}},sJo=(e)=>{let{pn:t,p:n}=e;if(t===1)return{x:-n/2,y:0};else return{x:n/2,y:0}},aJo=(e)=>{let t=[];for(let n=1;n<=e.num_pins;n++){let{x:o,y:r}=sJo({pn:n,p:be.parse(e.p)});t.push(uo(n,o,r,be.parse(e.pl),be.parse(e.pw),0.125))}return t},cJo=Fo.extend({fn:k(),num_pins:he(2).default(2),w:k().default("7.30mm"),h:k().default("4.40mm"),pl:k().default("2.50mm"),pw:k().default("2.30mm"),p:k().default("4.30mm")}),lJo=(e)=>{let t=cJo.parse(e),n=Xo(0,be.parse(t.h)/2+0.5,0.3),o={type:"pcb_silkscreen_path",layer:"top",pcb_component_id:"",route:[{x:be.parse(t.p)/2,y:be.parse(t.h)/2},{x:-be.parse(t.w)/2-0.1,y:be.parse(t.h)/2},{x:-be.parse(t.w)/2-0.1,y:-be.parse(t.h)/2},{x:be.parse(t.p)/2,y:-be.parse(t.h)/2}],stroke_width:0.1,pcb_silkscreen_path_id:""},r=7.3,i=4.5,s={type:"pcb_courtyard_rect",pcb_courtyard_rect_id:"",pcb_component_id:"",center:{x:0,y:0},width:7.3,height:4.5,layer:"top"};return{circuitJson:dJo(t).concat(...f0(t),o,n,s),parameters:t}},hJo=(e)=>{let{pn:t,p:n}=e;if(t===1)return{x:-n/2,y:0};else return{x:n/2,y:0}},dJo=(e)=>{let t=[];for(let n=1;n<=e.num_pins;n++){let{x:o,y:r}=hJo({pn:n,p:be.parse(e.p)});t.push(uo(n,o,r,be.parse(e.pl),be.parse(e.pw),0.125))}return t},uJo=Fo.extend({fn:k(),num_pins:he(2).default(2),w:k().default("10.70mm"),h:k().default("6.60mm"),pl:k().default("2.50mm"),pw:k().default("3.30mm"),p:k().default("6.80mm")}),pJo=(e)=>{let t=uJo.parse(e),n=Xo(0,3,0.3),o={type:"pcb_silkscreen_path",layer:"top",pcb_component_id:"",route:[{x:be.parse(t.p)/2,y:be.parse(t.h)/2-0.8},{x:-be.parse(t.w)/2-0.8,y:be.parse(t.h)/2-0.8},{x:-be.parse(t.w)/2-0.8,y:-be.parse(t.h)/2+0.8},{x:be.parse(t.p)/2,y:-be.parse(t.h)/2+0.8}],stroke_width:0.1,pcb_silkscreen_path_id:""},r=9.8,i=6.7,s={type:"pcb_courtyard_rect",pcb_courtyard_rect_id:"",pcb_component_id:"",center:{x:0,y:0},width:9.8,height:6.7,layer:"top"};return{circuitJson:_Jo(t).concat(...f0(t),o,n,s),parameters:t}},mJo=(e)=>{let{pn:t,p:n}=e;if(t===1)return{x:-n/2,y:0};return{x:n/2,y:0}},_Jo=(e)=>{let t=[];for(let n=1;n<=e.num_pins;n++){let{x:o,y:r}=mJo({pn:n,p:be.parse(e.p)});t.push(uo(n,o,r,be.parse(e.pl),be.parse(e.pw),0.125))}return t},gJo=Fo.extend({fn:k(),num_pins:Ae().default(4),w:k().default("8.50mm"),h:k().default("6.90mm"),pl:k().default("2mm"),pw:k().default("1.5mm"),p:k().default("2.30mm"),tabpl:k().optional(),tabpw:k().default("3.8mm"),taboffset:k().default("0mm"),string:k().optional()}),AJo=(e)=>{let t=e.string?.match(/^sot223_(\d+)/),n=t?Number.parseInt(t[1],10):4;if(n===8){let r=xJo.parse({...e,num_pins:n});return{circuitJson:Yse(r),parameters:r}}let o=gJo.parse({...e,num_pins:n});if(o.num_pins===4)return{circuitJson:yJo(o),parameters:o};if(o.num_pins===5)return{circuitJson:bJo(o),parameters:o};if(o.num_pins===6)return{circuitJson:vJo(o),parameters:o};throw Error("Invalid number of pins")},fJo=(e)=>{let{pn:t,w:n,h:o,pl:r,p:i,taboffset:s}=e;if(t===1)return{x:-n/2+1.1,y:i};if(t===2)return{x:-n/2+1.1,y:0};if(t===3)return{x:-n/2+1.1,y:-i};return{x:n/2-1.1+s,y:0}},yJo=(e)=>{let t=[],n=0,o=0,r=Number.parseFloat(e.w),i=Number.parseFloat(e.h),s=Number.parseFloat(e.pl),a=Number.parseFloat(e.p),c=Number.parseFloat(e.pw),l=Number.parseFloat(e.tabpl??e.pl),h=Number.parseFloat(e.tabpw),d=Number.parseFloat(e.taboffset);for(let b=0;b<e.num_pins;b++){let{x:I,y:v}=fJo({num_pins:e.num_pins,pn:b+1,w:r,h:i,pl:s,p:a,taboffset:d}),P=b===3?h:c,M=b===3?l:s,B=Math.min(M,P)/8;n=Math.max(n,Math.abs(I)+M/2),o=Math.max(o,Math.abs(v)+P/2),t.push(uo(b+1,I,v,M,P,B))}let u=Xo(0,0,0.3),_=r/2-2.4,p=i/2,m={layer:"top",pcb_component_id:"",pcb_silkscreen_path_id:"silkscreen_path_1",route:[{x:-_,y:p},{x:_,y:p},{x:_,y:p/2+0.5}],type:"pcb_silkscreen_path",stroke_width:0.1},A={layer:"top",pcb_component_id:"",pcb_silkscreen_path_id:"silkscreen_path_2",route:[{x:-_,y:-p},{x:_,y:-p},{x:_,y:-p/2-0.5}],type:"pcb_silkscreen_path",stroke_width:0.1},g=r/2,f=i/2,y=Math.max(n+0.25,g+0.15),x=Math.max(o+0.25,f+0.15),C={type:"pcb_courtyard_rect",pcb_courtyard_rect_id:"",pcb_component_id:"",center:{x:0,y:0},width:2*y,height:2*x,layer:"top"};return[...t,m,A,u,C]},xJo=qz({p:"0.90mm",w:"2.8mm",legsoutside:!0}),CJo=(e)=>{let{p:t,h:n,pn:o,w:r}=e;if(o===1)return{x:-r/2+1.2,y:t/2+t};if(o===2)return{x:-r/2+1.2,y:t/2};if(o===3)return{x:-r/2+1.2,y:-t/2};if(o===4)return{x:-r/2+1.2,y:-t/2-t};if(o===5)return{x:r/2-1,y:0};throw Error("Invalid pin number")},bJo=(e)=>{let t=[],n=0,o=0,r=Number.parseFloat(e.w),i=Number.parseFloat(e.h);for(let A=1;A<=e.num_pins;A++){let{x:g,y:f}=CJo({h:i,p:1.5,pn:A,w:r}),y=Number.parseFloat(e.pw),x=Number.parseFloat(e.pl);if(A===5)y=3.4,x=1.8;else y=1,x=2.2;let C=Math.min(x,y)/8;n=Math.max(n,Math.abs(g)+x/2),o=Math.max(o,Math.abs(f)+y/2),t.push(uo(A,g,f,x,y,C))}let s=r/2-2.4,a=i/2,c={layer:"top",pcb_component_id:"",pcb_silkscreen_path_id:"silkscreen_path_1",route:[{x:-s,y:a},{x:s,y:a},{x:s,y:a/2+0.5}],type:"pcb_silkscreen_path",stroke_width:0.1},l={layer:"top",pcb_component_id:"",pcb_silkscreen_path_id:"silkscreen_path_2",route:[{x:-s,y:-a},{x:s,y:-a},{x:s,y:-a/2-0.5}],type:"pcb_silkscreen_path",stroke_width:0.1},h=Xo(0,0,0.3),d=r/2,u=i/2,_=Math.max(n+0.25,d+0.15),p=Math.max(o+0.25,u+0.15),m={type:"pcb_courtyard_rect",pcb_courtyard_rect_id:"",pcb_component_id:"",center:{x:0,y:0},width:2*_,height:2*p,layer:"top"};return[...t,c,l,h,m]},IJo=(e)=>{let{p:t,h:n,pn:o,w:r}=e;if(o===1)return{x:-r/2+1.2,y:2*t};if(o===2)return{x:-r/2+1.2,y:t};if(o===3)return{x:-r/2+1.2,y:0};if(o===4)return{x:-r/2+1.2,y:-t};if(o===5)return{x:-r/2+1.2,y:-2*t};if(o===6)return{x:r/2-1.175,y:0};throw Error("Invalid pin number")},vJo=(e)=>{let t=[],n=0,o=0,r=Number.parseFloat(e.h),i=8.7;for(let A=1;A<=e.num_pins;A++){let{x:g,y:f}=IJo({h:r,p:1.3,pn:A,w:i}),y=Number.parseFloat(e.pw),x=Number.parseFloat(e.pl);if(A===6)y=3.4,x=2.15;else y=0.6,x=2.2;let C=Math.min(x,y)/8;n=Math.max(n,Math.abs(g)+x/2),o=Math.max(o,Math.abs(f)+y/2),t.push(uo(A,g,f,x,y,C))}let s=Number.parseFloat(e.w)/2-2.4,a=r/2,c={layer:"top",pcb_component_id:"",pcb_silkscreen_path_id:"silkscreen_path_1",route:[{x:-s,y:a},{x:s,y:a},{x:s,y:a/2+0.5}],type:"pcb_silkscreen_path",stroke_width:0.1},l={layer:"top",pcb_component_id:"",pcb_silkscreen_path_id:"silkscreen_path_2",route:[{x:-s,y:-a},{x:s,y:-a},{x:s,y:-a/2-0.5}],type:"pcb_silkscreen_path",stroke_width:0.1},h=Xo(0,0,0.3),d=Number.parseFloat(e.w)/2,u=r/2,_=Math.max(n+0.25,d+0.15),p=Math.max(o+0.25,u+0.15),m={type:"pcb_courtyard_rect",pcb_courtyard_rect_id:"",pcb_component_id:"",center:{x:0,y:0},width:2*_,height:2*p,layer:"top"};return[...t,c,l,h,m]},SJo=Fo.extend({fn:k(),num_pins:Ae().default(3),w:k().default("3.40mm"),h:k().default("3.30mm"),pl:k().default("1mm"),pw:k().default("0.7mm"),p:k().default("1.2mm"),string:k().optional()}),PJo=(e)=>{let t=e.string?.match(/^sot23w_(\d+)/),n=t?Number.parseInt(t[1],3):3,o=SJo.parse({...e,num_pins:n});if(o.num_pins===3)return{circuitJson:MJo(o),parameters:o};throw Error("Invalid number of pins")},EJo=(e)=>{let{pn:t,w:n,h:o,pl:r,p:i}=e;if(t===1)return{x:-i,y:0.95};if(t===2)return{x:-i,y:-0.95};return{x:i,y:0}},MJo=(e)=>{let t=[],n=Number.parseFloat(e.w),o=Number.parseFloat(e.h),r=Number.parseFloat(e.pl),i=Number.parseFloat(e.pw),s=Number.parseFloat(e.p),a=Math.min(r,i)/8;for(let y=0;y<e.num_pins;y++){let{x,y:C}=EJo({num_pins:e.num_pins,pn:y+1,w:n,h:o,pl:r,p:s});t.push(uo(y+1,x,C,r,i,a))}let c=Xo(0,Number.parseInt(e.h)/2+1,0.3),l=n/2-1,h=o/2,d={layer:"top",pcb_component_id:"",pcb_silkscreen_path_id:"silkscreen_path_1",route:[{x:-l,y:h},{x:l+0.3,y:h},{x:l+0.3,y:h/2}],type:"pcb_silkscreen_path",stroke_width:0.1},u={layer:"top",pcb_component_id:"",pcb_silkscreen_path_id:"silkscreen_path_2",route:[{x:-l,y:-h},{x:l+0.3,y:-h},{x:l+0.3,y:-h/2}],type:"pcb_silkscreen_path",stroke_width:0.1},_=s+r/2,p=0.95+i/2,m=o/2,A=_+0.25,g=Math.max(p+0.25,m+0.09),f={type:"pcb_courtyard_rect",pcb_courtyard_rect_id:"",pcb_component_id:"",center:{x:0,y:0},width:2*A,height:2*g,layer:"top"};return[...t,d,u,c,f]},wJo=Fo.extend({fn:k(),num_pins:un([he(3),he(2)]).default(3),p:k().default("1.27mm"),id:k().default("0.72mm"),od:k().default("0.95mm"),w:k().default("2.5mm"),h:k().default("4.2mm"),string:k().optional()}),BJo=(e)=>{let{p:t,id:n,od:o,w:r,h:i}=e,s=Number.parseFloat(i)/2,a=Number.parseFloat(t);return[Ri(1,-a,s-a,n,o),Ri(2,0,s-a,n,o),Ri(3,a,s-a,n,o)]},TJo=(e)=>{let{p:t,id:n,od:o,h:r}=e,i=Number.parseFloat(r)/2,s=Number.parseFloat(t),a=Number.parseFloat(n),c=Number.parseFloat(o),l=c*1.4285714285714286;return[Z1({pn:1,x:-s,y:i-s,holeDiameter:a,rectPadWidth:c,rectPadHeight:l}),S7(2,s,i-s,a,c,l)]},DJo=(e)=>{let t=e.string?.match(/^to92s_(\d+)/),n=t?Number.parseInt(t[1],10):3,o=wJo.parse({...e,num_pins:n}),r=[];if(o.num_pins===3)r=BJo(o);else if(o.num_pins===2)r=TJo(o);else throw Error("Invalid number of pins for TO-92");let i=Number.parseFloat(o.h)/2,s=Number.parseFloat(o.p),a={type:"pcb_silkscreen_path",layer:"top",pcb_component_id:"",route:[{x:-i,y:i-s},{x:-1.9,y:0},{x:1.9,y:0},{x:i,y:i-s},{x:1.5,y:Number.parseFloat(o.h)/2+0.5},{x:-1.5,y:Number.parseFloat(o.h)/2+0.5},{x:-i,y:i-s}],stroke_width:0.1,pcb_silkscreen_path_id:""},c=Xo(0,i+1,0.5),l=Number.parseFloat(o.od),h=i-s,d=-s-l/2,u=s+l/2,_=h-l/2,p=h+l/2,m=-i,A=i,g=0,f=i+0.5,y=Math.min(d,m)-0.25,x=Math.max(u,A)+0.25,C=Math.min(_,g)-0.25,b=Math.max(p,f)+0.25,I={type:"pcb_courtyard_rect",pcb_courtyard_rect_id:"",pcb_component_id:"",center:{x:(y+x)/2,y:(C+b)/2},width:x-y,height:b-C,layer:"top"};return{circuitJson:[...r,a,c,I],parameters:o}},NJo=Fo.extend({fn:k(),p:be.optional(),id:be.optional(),pw:be.optional(),pl:be.optional(),w:be.optional(),h:be.optional(),mpx:be.optional().describe("center-to-center distance between the SMD mounting pads"),mpy:be.optional().describe("mounting-pad row distance from the signal-pad row"),mpw:be.optional().describe("SMD mounting pad width"),mpl:be.optional().describe("SMD mounting pad length"),mounttop:Be().optional().describe("place SMD mounting pads above the signal-pad row"),smd:Be().optional().describe("Generic surface-mount JST-style connector with one signal row and two mounting pads."),sh:Be().optional().describe('JST SH (Surface-mount) connector family. SH stands for "Super High-density".'),ph:Be().optional().describe('JST PH (Through-hole) connector family. PH stands for "Pin Header".'),zh:Be().optional().describe("JST ZH (Through-hole) connector family. 1.5mm pitch wire-to-board."),xh:Be().optional().describe("JST XH (Through-hole) connector family. 2.5mm pitch wire-to-board."),string:k().optional()}),RJo=()=>({minX:Number.POSITIVE_INFINITY,maxX:Number.NEGATIVE_INFINITY,minY:Number.POSITIVE_INFINITY,maxY:Number.NEGATIVE_INFINITY}),fR=({bounds:e,centerX:t,centerY:n,width:o,height:r})=>{let i=o/2,s=r/2;e.minX=Math.min(e.minX,t-i),e.maxX=Math.max(e.maxX,t+i),e.minY=Math.min(e.minY,n-s),e.maxY=Math.max(e.maxY,n+s)},QJo={ph:{p:be.parse("2mm"),id:be.parse("0.75mm"),pw:be.parse("1.20mm"),pl:be.parse("1.75mm"),h:be.parse("5mm")},sh:{p:be.parse("1mm"),pw:be.parse("0.6mm"),pl:be.parse("1.55mm"),w:be.parse("5.8mm"),h:be.parse("7.8mm")},smd:{p:be.parse("2mm"),id:0,pw:be.parse("1mm"),pl:be.parse("3mm"),mpw:be.parse("1.8mm"),mpl:be.parse("3mm"),mpy:be.parse("2.5mm"),w:be.parse("8mm"),h:be.parse("5mm")},zh:{p:be.parse("1.5mm"),id:be.parse("0.73mm"),pw:be.parse("1.03mm"),pl:be.parse("1.73mm"),w:be.parse("3mm"),h:be.parse("3.5mm")},xh:{p:be.parse("2.5mm"),pw:be.parse("1.7mm")}};function kJo(e){if(e.smd)return"smd";if(e.sh)return"sh";if(e.ph)return"ph";if(e.zh)return"zh";if(e.xh)return"xh";return"ph"}function LJo({variant:e,numPins:t,p:n,id:o,pw:r,pl:i,mpx:s,mpy:a,mpw:c,mpl:l,mounttop:h}){let d=[],u=RJo(),_=0;if(e==="smd"){let p=-((t-1)/2)*n;for(let A=0;A<t;A++){let g=p+A*n;d.push(uo(A+1,g,0,r,i)),fR({bounds:u,centerX:g,centerY:0,width:r,height:i})}let m=a===0?0:(h?1:-1)*a;for(let[A,g]of[-s/2,s/2].entries())d.push(uo(t+A+1,g,m,c,l)),fR({bounds:u,centerX:g,centerY:m,width:c,height:l});_=Math.max(i/2,l/2)}else if(e==="ph"){let p=-((t-1)/2)*n;for(let m=0;m<t;m++){let A=p+m*n;if(m===0)d.push(Z1({pn:m+1,x:A,y:0,holeDiameter:o,rectPadWidth:r,rectPadHeight:i,rectBorderRadius:0.1249998}));else d.push(S7(m+1,A,0,o,r,i));fR({bounds:u,centerX:A,centerY:0,width:r,height:i}),_=Math.max(_,i/2)}}else if(e==="zh"){let p=-((t-1)/2)*n;for(let m=0;m<t;m++){let A=p+m*n;if(m===0)d.push(Z1({pn:m+1,x:A,y:0,holeDiameter:o,rectPadWidth:r,rectPadHeight:i,rectBorderRadius:0.12499977}));else d.push(S7(m+1,A,0,o,r,i));fR({bounds:u,centerX:A,centerY:0,width:r,height:i}),_=Math.max(_,i/2)}}else if(e==="xh"){let p=-((t-1)/2)*n;for(let m=0;m<t;m++){let A=p+m*n;if(m===0)d.push(Z1({pn:m+1,x:A,y:0,holeDiameter:o,rectPadWidth:r,rectPadHeight:i,rectBorderRadius:0.12500015}));else d.push(S7(m+1,A,0,o,r,i));fR({bounds:u,centerX:A,centerY:0,width:r,height:i}),_=Math.max(_,i/2)}}else{let p=-((t-1)/2)*n;for(let A=0;A<t;A++){let g=p+A*n;d.push(uo(A+1,g,-1.325,r,i)),fR({bounds:u,centerX:g,centerY:-1.325,width:r,height:i}),_=Math.max(_,i/2)}let m=(t-1)/2*n+1.3;d.push(uo(t+1,-m,1.22,1.2,1.8)),d.push(uo(t+2,m,1.22,1.2,1.8)),fR({bounds:u,centerX:-m,centerY:1.22,width:1.2,height:1.8}),fR({bounds:u,centerX:m,centerY:1.22,width:1.2,height:1.8}),_=Math.max(_,0.9)}return{pads:d,padBounds:u,maxPadHalfY:_}}function HJo({variant:e,w:t,h:n,numPins:o,p:r}){let i=(s)=>({type:"pcb_silkscreen_path",layer:"top",pcb_component_id:"",route:s,stroke_width:0.1,pcb_silkscreen_path_id:""});if(e==="smd")return[i([{x:-t/2,y:-n/2},{x:t/2,y:-n/2},{x:t/2,y:n/2},{x:-t/2,y:n/2},{x:-t/2,y:-n/2}])];else if(e==="ph"){let s=n/2+0.5,a=s-n;return[i([{x:-t/2,y:s},{x:t/2,y:s},{x:t/2,y:a},{x:-t/2,y:a},{x:-t/2,y:s}])]}else if(e==="zh"&&o&&r){let s=(o-1)*r,a=-s/2-1.5,c=s/2+1.5,l=-n/2,h=n/2;return[i([{x:a,y:l},{x:c,y:l},{x:c,y:h},{x:a,y:h},{x:a,y:l}])]}else if(e==="xh"&&o&&r){let s=-((o-1)/2)*r,a=Array.from({length:o},(y,x)=>s+x*r),c=a[0],l=a[o-1],h=(c+l)/2,d=-2.75,u=-3.51,_=2.46,p=2.75,m=1.5,A=0.2,g=(y,x,C,b)=>i([{x:y,y:x},{x:C,y:x},{x:C,y:b},{x:y,y:b},{x:y,y:x}]),f=[];if(f.push(g(c-2.56,2.46,l+2.56,-3.51)),f.push(i([{x:c-1.6,y:2.75},{x:c-2.85,y:2.75},{x:c-2.85,y:1.5}])),f.push(i([{x:c-2.55,y:0.2},{x:c-1.8,y:0.2},{x:c-1.8,y:-2.75},{x:h,y:-2.75}])),f.push(i([{x:l+2.55,y:0.2},{x:l+1.8,y:0.2},{x:l+1.8,y:-2.75},{x:h,y:-2.75}])),f.push(g(c-2.55,2.45,c-0.75,1.7)),l-0.75>c+0.75)f.push(g(c+0.75,2.45,l-0.75,1.7));return f.push(g(l+0.75,2.45,l+2.55,1.7)),f}else return[]}var FJo=(e)=>{let t=NJo.parse(e),n=kJo(t),o=QJo[n],r,i=e.num_pins;if(typeof i==="number")r=i;let s=typeof e.string==="string"?e.string:"",a=s.match(/(?:^|_)jst(\d+)(?:_|$)/),c=s.match(/(?:^|_)zh(\d+)(?:_|$)/);if(a&&a[1]){let te=Number.parseInt(a[1],10);if(!Number.isNaN(te))r=te}if(c&&c[1]){let te=Number.parseInt(c[1],10);if(!Number.isNaN(te))r=te}if(typeof r!=="number")throw Error(`JST requires an explicit pin count (e.g. jst6_sh or .jst(6))${t.string?`, from string "${t.string}"`:""}`);let l=t.p??o.p,h=t.id??(n==="xh"?r===2?1:0.95:o.id),d=t.pw??o.pw,u=t.pl??(n==="xh"?r===2?2:1.95:o.pl),_=(r-1)*l+4,p=n==="xh"?(r-1)*l+5.12:n==="ph"?_:o.w,m=t.w??p,A=t.h??(n==="xh"?5.97:o.h),g=t.mpx??(r-1)*l+3.4,f=t.mpy??o.mpy??0,y=t.mpw??o.mpw??0,x=t.mpl??o.mpl??0,C=t.mounttop??!1,b=LJo({variant:n,numPins:r,p:l,id:h,pw:d,pl:u,mpx:g,mpy:f,mpw:y,mpl:x,mounttop:C}),{pads:I,padBounds:v,maxPadHalfY:P}=b,M=n==="smd"?Math.max(m,2*Math.max(Math.abs(v.minX),Math.abs(v.maxX))+0.4):m,B=n==="smd"?Math.max(A,2*Math.max(Math.abs(v.minY),Math.abs(v.maxY))+0.4):A,T=HJo({variant:n,w:M,h:B,numPins:r,p:l}),N=Xo(0,B/2+1,0.5),D=T.flatMap((te)=>te.route),L=D.map((te)=>te.x),H=D.map((te)=>te.y),V=L.length>0&&H.length>0,O=V?Math.min(v.minX,Math.min(...L)):v.minX,U=V?Math.max(v.maxX,Math.max(...L)):v.maxX,j=V?Math.min(v.minY,Math.min(...H)):v.minY,Y=V?Math.max(v.maxY,Math.max(...H)):v.maxY,X=0.5,K=0.05,J=P+0.085,ee=O-X,se=U+X,ne=j-J,re=Y+K,Z=n==="ph"?{type:"pcb_courtyard_rect",pcb_courtyard_rect_id:"",pcb_component_id:"",center:{x:0,y:-0.55},width:(r-1)*l+4.9,height:5.5,layer:"top"}:n==="xh"?{type:"pcb_courtyard_rect",pcb_courtyard_rect_id:"",pcb_component_id:"",center:{x:0,y:-0.525},width:(r-1)*l+5.9,height:6.75,layer:"top"}:{type:"pcb_courtyard_rect",pcb_courtyard_rect_id:"",pcb_component_id:"",center:{x:(ee+se)/2,y:(ne+re)/2},width:se-ee,height:re-ne,layer:"top"};return{circuitJson:[...I,...T,N,Z],parameters:{...t,p:l,id:h,pw:d,pl:u,w:m,h:A,num_pins:r,sh:n==="sh",ph:n==="ph",smd:n==="smd",zh:n==="zh",xh:n==="xh",...n==="smd"?{mpx:g,mpy:f,mpw:y,mpl:x,mounttop:C}:{}}}},zJo=Fo.extend({fn:k(),num_pins:he(2).default(2),w:k().default("3.30mm"),h:k().default("1.70mm"),pl:k().default("0.80mm"),pw:k().default("1mm"),p:k().default("1.90mm")}),OJo=(e)=>{let t=zJo.parse(e),n=Xo(0,be.parse(t.h)/2+0.5,0.3),o={type:"pcb_silkscreen_path",layer:"top",pcb_component_id:"",route:[{x:be.parse(t.p)/2,y:be.parse(t.h)/2},{x:-be.parse(t.w)/2,y:be.parse(t.h)/2},{x:-be.parse(t.w)/2,y:-be.parse(t.h)/2},{x:be.parse(t.p)/2,y:-be.parse(t.h)/2}],stroke_width:0.1,pcb_silkscreen_path_id:""},r=3.2,i=2,s={type:"pcb_courtyard_rect",pcb_courtyard_rect_id:"",pcb_component_id:"",center:{x:0,y:0},width:3.2,height:2,layer:"top"};return{circuitJson:YJo(t).concat(...f0(t),o,n,s),parameters:t}},VJo=(e)=>{let{pn:t,p:n}=e;if(t===1)return{x:-n/2,y:0};return{x:n/2,y:0}},YJo=(e)=>{let t=[];for(let n=1;n<=e.num_pins;n++){let{x:o,y:r}=VJo({pn:n,p:be.parse(e.p)});t.push(uo(n,o,r,be.parse(e.pl),be.parse(e.pw),0.1))}return t},GJo=(e)=>{switch(e){case 8:return{w:"3.06mm",h:"3.14mm",p:"0.65mm",pl:"1.6mm",pw:"0.5mm"};case 10:return{w:"3.10mm",h:"3.33mm",p:"0.5mm",pl:"1.45mm",pw:"0.3mm"};default:return{w:"3.06mm",h:"3.14mm",p:"0.65mm",pl:"1.6mm",pw:"0.5mm"}}},UJo=Fo.extend({fn:k(),num_pins:un([he(8),he(10)]).default(8),w:k().optional(),h:k().optional(),p:k().optional(),pl:k().optional(),pw:k().optional(),thermalpad:Px.optional(),...bK,string:k().optional()}),WJo=(e)=>{let t=UJo.parse(e),n=GJo(t.num_pins),o=be.parse(t.w||n.w),r=be.parse(t.h||n.h),i=be.parse(t.p||n.p),s=be.parse(t.pl||n.pl),a=be.parse(t.pw||n.pw),c=Math.min(s,a)/8,l=[],h=t.num_pins/2;for(let P=0;P<t.num_pins;P++){let{x:M,y:B}=qNt(t.num_pins,P+1,o,i),T=P<h?P+1:t.num_pins-(P-h);l.push(uo(T,M,B,s,a,c))}if(t.thermalpad)l.push(ZM(t.thermalpad,{x:t.thermalpadcenteroffsetx,y:t.thermalpadcenteroffsety}));let d=o,u=r,_={type:"pcb_silkscreen_path",layer:"top",pcb_component_id:"",route:[{x:-d/2,y:u/2},{x:d/2,y:u/2}],stroke_width:0.05,pcb_silkscreen_path_id:""},p={type:"pcb_silkscreen_path",layer:"top",pcb_component_id:"",route:[{x:-d/2,y:-u/2},{x:d/2,y:-u/2}],stroke_width:0.05,pcb_silkscreen_path_id:""},m=qNt(t.num_pins,1,d,i),A={x:m.x-0.8,y:m.y},g={type:"pcb_silkscreen_path",layer:"top",pcb_component_id:"pin_marker_1",route:[{x:A.x-0.4,y:A.y},{x:A.x-0.7,y:A.y+0.3},{x:A.x-0.7,y:A.y-0.3},{x:A.x-0.4,y:A.y}],stroke_width:0.05,pcb_silkscreen_path_id:"pin_marker_1"},f=Xo(0,u/2+0.5,0.3),y=(t.num_pins/2-1)*i+a,x=o/2+0.25,C=x+1.43,b=y/2+0.255,I=r/2+0.25,v={type:"pcb_courtyard_outline",pcb_courtyard_outline_id:"",pcb_component_id:"",layer:"top",outline:ey([{minX:-C,maxX:C,minY:-b,maxY:b},{minX:-x,maxX:x,minY:-I,maxY:I}])};return{circuitJson:[...l,_,p,f,g,v],parameters:t}},qNt=(e,t,n,o)=>{let r=e/2,i=(t-1)%r,s=t<=r?-1:1,a=(r-1)/2-i;return{x:s*2.11,y:a*o}},XJo=(e)=>{switch(e){case 10:return{w:"3.10mm",h:"3.32mm",p:"0.5mm",pl:"1.63mm",pw:"0.33mm"};case 12:return{w:"3mm",h:"4mm",p:"0.65mm",pl:"0.88mm",pw:"0.4mm"};case 16:return{w:"3.10mm",h:"4mm",p:"0.5mm",pl:"0.88mm",pw:"0.3mm"};default:return{w:"3.10mm",h:"3.32mm",p:"0.65mm",pl:"1.63mm",pw:"0.4mm"}}},jJo=Fo.extend({fn:k(),num_pins:un([he(8),he(10),he(12),he(16)]).default(8),w:k().optional(),h:k().optional(),p:k().optional(),pl:k().optional(),pw:k().optional(),thermalpad:Px.optional(),...bK,string:k().optional()}),JNt=(e,t,n,o,r)=>{let i=e/2,s=(t-1)%i,a=t<=i?-1:1,c=(i-1)/2-s,l=be.parse("0.2mm");return{x:a*(n/2+r/2-l),y:c*o}},KJo=(e)=>{let t=jJo.parse(e),n=XJo(t.num_pins),o=be.parse(t.w||n.w),r=be.parse(t.h||n.h),i=be.parse(t.p||n.p),s=be.parse(t.pl||n.pl),a=be.parse(t.pw||n.pw),c=Math.min(s,a)/8,l=[];for(let v=0;v<t.num_pins;v++){let{x:P,y:M}=JNt(t.num_pins,v+1,o,i,s);l.push(uo(v+1,P,M,s,a,c))}if(t.thermalpad)l.push(ZM(t.thermalpad,{x:t.thermalpadcenteroffsetx,y:t.thermalpadcenteroffsety}));let h=o,d=r,u={type:"pcb_silkscreen_path",layer:"top",pcb_component_id:"",route:[{x:-h/2,y:d/2},{x:h/2,y:d/2}],stroke_width:0.05,pcb_silkscreen_path_id:""},_={type:"pcb_silkscreen_path",layer:"top",pcb_component_id:"",route:[{x:-h/2,y:-d/2},{x:h/2,y:-d/2}],stroke_width:0.05,pcb_silkscreen_path_id:""},p=JNt(t.num_pins,1,h,i,s),m={x:p.x-0.8,y:p.y},A={type:"pcb_silkscreen_path",layer:"top",pcb_component_id:"pin_marker_1",route:[{x:m.x-0.4,y:m.y},{x:m.x-0.7,y:m.y+0.3},{x:m.x-0.7,y:m.y-0.3},{x:m.x-0.4,y:m.y}],stroke_width:0.05,pcb_silkscreen_path_id:"pin_marker_1"},g=Xo(0,d/2+0.5,0.3),f=(t.num_pins/2-1)*i+a,y=o/2+0.25,x=y+1.43,C=f/2+0.255,b=r/2+0.25,I={type:"pcb_courtyard_outline",pcb_courtyard_outline_id:"",pcb_component_id:"",layer:"top",outline:ey([{minX:-x,maxX:x,minY:-C,maxY:C},{minX:-y,maxX:y,minY:-b,maxY:b}])};return{circuitJson:[...l,u,_,g,A,I],parameters:t}},$Jo=Fo.extend({fn:k(),num_pins:he(2).default(2),w:k().default("3.8mm"),h:k().default("1.65mm"),pl:k().default("1.2mm"),pw:k().default("1.2mm"),pad_spacing:k().default("2.6mm")}),qJo=(e)=>{let t=$Jo.parse(e),n=Xo(0,be.parse(t.h),0.3),o={type:"pcb_silkscreen_path",layer:"top",pcb_component_id:"",route:[{x:be.parse(t.pad_spacing)/2,y:be.parse(t.h)/2},{x:-be.parse(t.w)/2-0.2,y:be.parse(t.h)/2},{x:-be.parse(t.w)/2-0.2,y:-be.parse(t.h)/2},{x:be.parse(t.pad_spacing)/2,y:-be.parse(t.h)/2}],stroke_width:0.1,pcb_silkscreen_path_id:""},r=4.3,i=2.15,s={type:"pcb_courtyard_rect",pcb_courtyard_rect_id:"",pcb_component_id:"",center:{x:0,y:0},width:4.3,height:2.15,layer:"top"};return{circuitJson:ZJo(t).concat(...f0(t),o,n,s),parameters:t}},JJo=(e)=>{let{pn:t,pad_spacing:n}=e;if(t===1)return{x:-n/2,y:0};else return{x:n/2,y:0}},ZJo=(e)=>{let t=[];for(let n=1;n<=e.num_pins;n++){let{x:o,y:r}=JJo({pn:n,pad_spacing:be.parse(e.pad_spacing)});t.push(uo(n,o,r,be.parse(e.pl),be.parse(e.pw)))}return t},eZo=Fo.extend({fn:k(),num_pins:he(2).default(2),w:k().default("3.20mm"),h:k().default("1.65mm"),pl:k().default("0.8mm"),pw:k().default("0.9mm"),pad_spacing:k().default("2.1mm")}),tZo=(e)=>{let t=eZo.parse(e),n=Xo(0,be.parse(t.h),0.3),o={type:"pcb_silkscreen_path",layer:"top",pcb_component_id:"",route:[{x:be.parse(t.pad_spacing)/2,y:be.parse(t.h)/2},{x:-be.parse(t.w)/2-0.2,y:be.parse(t.h)/2},{x:-be.parse(t.w)/2-0.2,y:-be.parse(t.h)/2},{x:be.parse(t.pad_spacing)/2,y:-be.parse(t.h)/2}],stroke_width:0.1,pcb_silkscreen_path_id:""},r=3.7,i=2.15,s={type:"pcb_courtyard_rect",pcb_courtyard_rect_id:"",pcb_component_id:"",center:{x:0,y:0},width:3.7,height:2.15,layer:"top"};return{circuitJson:oZo(t).concat(...f0(t),o,n,s),parameters:t}},nZo=(e)=>{let{pn:t,pad_spacing:n}=e;if(t===1)return{x:-n/2,y:0};else return{x:n/2,y:0}},oZo=(e)=>{let t=[];for(let n=1;n<=e.num_pins;n++){let{x:o,y:r}=nZo({pn:n,pad_spacing:be.parse(e.pad_spacing)});t.push(uo(n,o,r,be.parse(e.pl),be.parse(e.pw)))}return t},rZo=Fo.extend({fn:k(),num_pins:un([he(6),he(8)]).default(8),w:k().default("3mm"),h:k().default("3mm"),p:k().default("0.5mm"),pl:k().default("0.52mm"),pw:k().default("0.35mm"),epw:k().default("1.40mm"),eph:k().default("1.60mm"),string:k().optional(),ep:Be().default(!1)}),iZo=(e)=>{if(e.string&&e.string.includes("_ep"))e.ep=!0;let t=e.string?.match(/^son_(\d+)/),n=t?Number.parseInt(t[1],10):e.num_pins||8,o=rZo.parse({...e,num_pins:n}),r=be.parse(o.w),i=be.parse(o.h),s=be.parse(o.p),a=be.parse(o.pl),c=be.parse(o.pw),l=be.parse(o.epw),h=be.parse(o.eph),d=Math.min(a,c)/8,u=[];for(let N=0;N<o.num_pins;N++){let{x:D,y:L}=gGe(o.num_pins,N+1,r,s);u.push(uo(N+1,D,L,a,c,d))}if(o.ep)u.push(uo(o.num_pins+1,0,0,l,h));let _=r,p=i,m={type:"pcb_silkscreen_path",layer:"top",pcb_component_id:"",route:[{x:-_/2,y:p/2},{x:_/2,y:p/2}],stroke_width:0.05,pcb_silkscreen_path_id:""},A={type:"pcb_silkscreen_path",layer:"top",pcb_component_id:"",route:[{x:-_/2,y:-p/2},{x:_/2,y:-p/2}],stroke_width:0.05,pcb_silkscreen_path_id:""},g=gGe(o.num_pins,1,_,s),f={x:g.x-0.4,y:g.y},y={type:"pcb_silkscreen_path",layer:"top",pcb_component_id:"pin_marker_1",route:[{x:f.x-0.4,y:f.y},{x:f.x-0.7,y:f.y+0.3},{x:f.x-0.7,y:f.y-0.3},{x:f.x-0.4,y:f.y}],stroke_width:0.05,pcb_silkscreen_path_id:"pin_marker_1"},x=Xo(0,p/2+0.5,0.3),C=Math.abs(gGe(o.num_pins,1,r,s).x),b=(o.num_pins/2-1)*s+c,I=C*2+a,v=r/2+0.25,P=I/2+0.25,M=b/2+0.25,B=i/2+0.25,T={type:"pcb_courtyard_outline",pcb_courtyard_outline_id:"",pcb_component_id:"",layer:"top",outline:ey([{minX:-P,maxX:P,minY:-M,maxY:M},{minX:-v,maxX:v,minY:-B,maxY:B}])};return{circuitJson:[...u,m,A,x,y,T],parameters:o}},gGe=(e,t,n,o)=>{let r=e/2,i=(t-1)%r,s=t<=r?-1:1,a=(r-1)/2-i;return{x:s*be.parse("1.4mm"),y:a*o}},sZo=Fo.extend({fn:k(),num_pins:Ae().optional().default(8),p:Ke.describe("pitch (distance between center of each pin)"),w:be.describe("width between vertical rows of pins"),grid:Px.describe("width and height of the border of the footprint"),ep:Px.default("0x0mm").describe("width and height of the central exposed thermal pad"),epx:be.default("0mm").describe("x offset of the center of the central exposed thermal pad"),pinw:be.describe("width of the pin pads"),pinh:be.describe("height of the pin pads")}),aZo=(e)=>{let t=sZo.parse(e),{num_pins:n,p:o,w:r,grid:i,ep:s,epx:a,pinw:c,pinh:l}=t;if(n%2!==0)throw Error("invalid number of pins");let h=[],d=Math.min(c,l)/8;for(let v=0;v<n;v++){let{pinX:P,pinY:M}=cZo({pinCount:n,pinIndex:v,width:r,pitch:o});h.push(uo(v+1,P,M,c,l,d))}if(s.x>0&&s.y>0)h.push(uo(t.num_pins+1,a,0,s.x,s.y));let u=lZo(i),_=Xo(0,i.y/2+o,i.y/6),p=(n/2-1)*o+l,m=r+c,A=i.x/2+0.25,g=m/2+0.25,f=p/2+0.25,y=p/2+0.45+Math.max(0,0.8-o),x=Math.min(i.y/2+0.25,y),C=Math.max(0,0.37-Math.max(0,g-A-0.38)*1.4),b=Math.max(f,x-C),I={type:"pcb_courtyard_outline",pcb_courtyard_outline_id:"",pcb_component_id:"",layer:"top",outline:ey([{minX:-g,maxX:g,minY:-b,maxY:b},{minX:-A,maxX:A,minY:-x,maxY:x}])};return{circuitJson:[...h,...u,_,I],parameters:t}},cZo=(e)=>{let t=0,n=0,o=(e.pinCount/2-1)*e.pitch/2,r=e.pinCount/2;if(e.pinIndex+1<=r)t=e.pitch*e.pinIndex-o,n=0-e.width/2;else t=e.pitch*(e.pinCount-e.pinIndex-1)-o,n=e.width/2;return{pinX:n,pinY:t}},lZo=(e)=>{let n=e.y/30;return[{layer:"top",pcb_component_id:"",pcb_silkscreen_path_id:"",type:"pcb_silkscreen_path",route:[{x:-e.x/2-0.1,y:e.y/2+0.1-n},{x:-e.x/2-0.1,y:e.y/2+0.1},{x:e.x/2+0.1,y:e.y/2+0.1},{x:e.x/2+0.1,y:e.y/2+0.1-n}],stroke_width:e.y/30},{layer:"top",pcb_component_id:"",pcb_silkscreen_path_id:"",type:"pcb_silkscreen_path",route:[{x:-e.x/2-0.1,y:-e.y/2-0.1+n},{x:-e.x/2-0.1,y:-e.y/2-0.1},{x:e.x/2+0.1,y:-e.y/2-0.1},{x:e.x/2+0.1,y:-e.y/2-0.1+n}],stroke_width:e.y/30}]},hZo=Fo.extend({fn:he("wson"),num_pins:he(8).default(8),p:be.default("0.5mm").describe("pin pitch"),rowspan:be.default("3.015mm").describe("distance between pad rows"),pl:be.default("0.6mm").describe("pad length across the package edge"),pw:be.default("0.28mm").describe("pad width along the pin row"),ep:Be().default(!0).describe("include the exposed pad"),epw:be.default("1.7mm").describe("exposed pad width"),eph:be.default("0.3mm").describe("exposed pad height"),w:be.default("2mm").describe("package body width"),h:be.default("3mm").describe("package body height")}),dZo=(e)=>{let t=hZo.parse(e),{p:n,rowspan:o,pl:r,pw:i,ep:s,epw:a,eph:c,w:l,h}=t,d=[],u=-3*n/2;for(let f=0;f<4;f+=1){let y=u+f*n;d.push(uo(f+1,y,-o/2,i,r)),d.push(uo(8-f,y,o/2,i,r))}if(s)d.push(uo(9,0,0,a,c));let _=[fs([{x:-l/2,y:-h/2},{x:-l/2,y:h/2}]),fs([{x:l/2,y:-h/2},{x:l/2,y:h/2}])],p=Xo(0,Math.max(h/2,(o+r)/2)+0.6,0.5),m=Math.max(3*n+i,s?a:0),A=Math.max(o+r,s?c:0),g={type:"pcb_courtyard_rect",pcb_courtyard_rect_id:"",pcb_component_id:"",center:{x:0,y:0},width:Math.max(l,m)+0.5,height:Math.max(h,A)+0.5,layer:"top"};return{circuitJson:[...d,..._,p,g],parameters:t}},uZo=(e)=>{let{num_pins:t,bridged:n,p:o=2.54,pw:r=1.5,ph:i=1.5}=e,s=be.parse(o),a=be.parse(r),c=be.parse(i),l=Math.min(c/4,0.5),h=[];for(let M=0;M<t;M++)h.push(uo(M+1,M*s,0,a,c));let d=[];if(n){let M=n.split("").map(Number);if(M.length>1)for(let B=0;B<M.length-1;B++){let T=M[B],N=M[B+1];if(typeof T==="number"&&typeof N==="number"&&!isNaN(T)&&!isNaN(N)){let D=(T-1)*s,L=(N-1)*s,H=Math.sign(L-D),V=D+H*(a/2),O=L-H*(a/2);d.push({type:"pcb_trace",pcb_trace_id:"",route:[{start_pcb_port_id:`{PIN${T}}`,x:V,y:0,width:l,layer:"top",route_type:"wire"},{end_pcb_port_id:`{PIN${N}}`,x:O,y:0,width:l,layer:"top",route_type:"wire"}]})}}}let u=(t-1)*s+a+0.7,_=c+1,p=(t-1)*s/2,m=0,A={type:"pcb_silkscreen_path",layer:"top",pcb_component_id:"",pcb_silkscreen_path_id:"outline",route:[{x:p-u/2,y:m-_/2},{x:p+u/2,y:m-_/2},{x:p+u/2,y:m+_/2},{x:p-u/2,y:m+_/2},{x:p-u/2,y:m-_/2}],stroke_width:0.15},g=0.6,f=m+_/2+g,y=Xo(p,f,0.4),x=(t-1)*s,C=x/2+a/2,b=c/2,I=C+0.5,v=b+0.5,P={type:"pcb_courtyard_rect",pcb_courtyard_rect_id:"",pcb_component_id:"",center:{x:x/2,y:0},width:2*I,height:2*v,layer:"top"};return{circuitJson:[...h,...d,A,y,P],parameters:e}},MRt={fn:he("sot457"),num_pins:he(6).default(6),pillh:k().default("0.45mm"),pillw:k().default("1.45mm"),pl:k(),pw:k(),p:k(),wave:Be().optional(),reflow:Be().optional()},pZo=Fo.extend({...MRt,h:k().default("2.5mm"),w:k().default("2.7mm"),pl:k().default("0.8mm"),pw:k().default("0.55mm"),p:k().default("0.95mm")}),mZo=Fo.extend({...MRt,h:k().default("3mm"),w:k().default("4mm"),pillr:k().default("0.225mm"),pl:k().default("1.45mm"),pw:k().default("1.5mm"),p:k().default("1.475mm")}).transform((e)=>({...e,wave:e.wave??(e.reflow===void 0?!0:!e.reflow),reflow:e.reflow??(e.wave===void 0?!1:!e.wave)})),qM=(e)=>Number.parseFloat(e.replace("mm","")),ZNt=({pitch:e,width:t,pinNumber:n})=>{let i={1:{x:-t/2-0.1,y:e},2:{x:-t/2-0.1,y:0},3:{x:-t/2-0.1,y:-e},4:{x:t/2+0.1,y:-e},5:{x:t/2+0.1,y:0},6:{x:t/2+0.1,y:e}}[n];if(!i)throw Error(`Invalid pin number: ${n}`);return i},eRt=(e)=>{let t=[],n=qM(e.p),o=qM(e.pl),r=qM(e.pw),i=qM(e.w),s=qM(e.h),a=Math.min(o,r)/8;if(e.wave){let A={1:({padWidth:g,padHeight:f})=>uo(1,-n,n,f,g,a),2:({padWidth:g,padHeight:f})=>uo(2,-n,-n,f,g,a),3:({padWidth:g,padHeight:f})=>xR(3,-n,0,qM(e.pillw),qM(e.pillh)),4:({padWidth:g,padHeight:f})=>xR(4,n,0,qM(e.pillw),qM(e.pillh)),5:({padWidth:g,padHeight:f})=>uo(5,n,n,f,g,a),6:({padWidth:g,padHeight:f})=>uo(6,n,-n,f,g,a)};for(let g=1;g<=e.num_pins;g++){let f=A[g];if(f)t.push(f({padWidth:o,padHeight:r}))}}else for(let A=1;A<=e.num_pins;A++){let{x:g,y:f}=ZNt({pitch:n,width:i,pinNumber:A});t.push(uo(A,g,f,o,r,a))}let c={type:"pcb_silkscreen_path",layer:"top",pcb_component_id:"",pcb_silkscreen_path_id:"silkscreen_path_1",route:[{x:-i/3,y:s/2+n/1.3},{x:i/3,y:s/2+n/1.3}],stroke_width:0.05},l={type:"pcb_silkscreen_path",layer:"top",pcb_component_id:"",pcb_silkscreen_path_id:"silkscreen_path_2",route:[{x:-i/3,y:-s/2-n/1.3},{x:i/3,y:-s/2-n/1.3}],stroke_width:0.05},h=Xo(0,s+0.5,0.3),d=ZNt({pitch:n,width:i,pinNumber:1}),u=e.wave?1:0.5,_=e.wave?0.7:0.3;d.x-=e.wave?r:r*1.7;let p={type:"pcb_silkscreen_path",layer:"top",pcb_component_id:"",pcb_silkscreen_path_id:"pin1_indicator",route:[{x:d.x+u/2,y:d.y},{x:d.x-u/2,y:d.y+_/2},{x:d.x-u/2,y:d.y-_/2},{x:d.x+u/2,y:d.y}],stroke_width:0.05},m;if(e.wave){let A=2*n,g=2*n,f=A/2+r/2,y=g/2+o/2,x=f+0.25,C=y+0.25;m={type:"pcb_courtyard_rect",pcb_courtyard_rect_id:"",pcb_component_id:"",center:{x:0,y:0},width:2*x,height:2*C,layer:"top"}}else{let g=i/2+0.1+o/2,f=n+r/2,y=i/2,x=s/2,C=g+0.25,b=y+0.08,I=f+0.25,v=Math.max(x+0.45,I);m={type:"pcb_courtyard_outline",pcb_courtyard_outline_id:"",pcb_component_id:"",outline:ey([{minX:-C,maxX:C,minY:-I,maxY:I},{minX:-b,maxX:b,minY:-v,maxY:v}]),layer:"top"}}return[h,c,l,p,...t,m]},_Zo=(e)=>{if(e.wave){let n=mZo.parse({...e,fn:"sot457"});return{circuitJson:eRt(n),parameters:n}}let t=pZo.parse(e);return{circuitJson:eRt(t),parameters:t}},gZo=[{x:-0.8,y:0.75},{x:0.8,y:0.75},{x:0.8,y:-0.75},{x:-0.8,y:-0.75}],AZo=Fo.extend({fn:k(),num_pins:he(6).default(6),w:k().default("1.1mm"),h:k().default("1.45mm"),p:k().default("0.35mm"),pl:k().default("0.2mm"),pw:k().default("0.2mm"),string:k().optional()}),fZo=(e)=>{let t=AZo.parse({...e,fn:"sot963"}),n=be.parse(t.w),o=be.parse(t.h),r=be.parse(t.p),i=be.parse(t.pl),s=be.parse(t.pw),a=Math.min(i,s)/8,c=[];for(let m=0;m<6;m++){let{x:A,y:g}=tRt(m+1,n,r,i);c.push(uo(m+1,A,g,i,s,a))}let l={type:"pcb_silkscreen_path",layer:"top",pcb_component_id:"",route:[{x:-n/2,y:o/2},{x:n/2,y:o/2}],stroke_width:0.05,pcb_silkscreen_path_id:""},h={type:"pcb_silkscreen_path",layer:"top",pcb_component_id:"",route:[{x:-n/2,y:-o/2},{x:n/2,y:-o/2}],stroke_width:0.05,pcb_silkscreen_path_id:""},d=tRt(1,n,r,i),u={type:"pcb_silkscreen_path",layer:"top",pcb_component_id:"pin_marker_1",route:[{x:d.x-i/2-0.3,y:d.y},{x:d.x-i/2-0.45,y:d.y+0.15},{x:d.x-i/2-0.45,y:d.y-0.15},{x:d.x-i/2-0.3,y:d.y}],stroke_width:0.05,pcb_silkscreen_path_id:"pin_marker_1"},_=Xo(0,o/2+0.4,0.25),p={type:"pcb_courtyard_outline",pcb_courtyard_outline_id:"",pcb_component_id:"",outline:gZo,layer:"top"};return{circuitJson:[...c,l,h,_,u,p],parameters:t}},tRt=(e,t,n,o)=>{let r=t/2-o/2;if(e<=3)return{x:-r,y:n-(e-1)*n};return{x:r,y:-n+(e-4)*n}},yZo=Fo.extend({fn:k(),num_pins:un([he(3),he(2)]).default(3),p:k().default("5mm"),id:k().default("1.25mm"),od:k().default("2.35mm"),ca:k().default("14mm").describe("Caliper axis (width or diameter of the potentiometer body or adjustment knob)"),w:k().default("5.35mm"),h:k().default("4mm"),string:k().optional()}),xZo=(e)=>{let{p:t,id:n,od:o,h:r}=e,i=Number.parseFloat(r),s=Number.parseFloat(t);return[Ri(1,0,s,n,o),Ri(2,i,0,n,o),Ri(3,0,-s,n,o)]},CZo=(e)=>{let t=e.string?.match(/^potentiometer_(\d+)/),n=t?Number.parseInt(t[1],10):3,o=yZo.parse({...e,num_pins:n}),r=[];if(o.num_pins===3)r=xZo(o);let i=Number.parseFloat(o.ca)/2+0.15,s=Number.parseFloat(o.w),a=Number.parseFloat(o.od)/2+0.35,c={type:"pcb_silkscreen_path",layer:"top",pcb_component_id:"",route:[{x:0,y:i-1.75},{x:0,y:i},{x:s,y:i},{x:s,y:a}],stroke_width:0.1,pcb_silkscreen_path_id:""},l={type:"pcb_silkscreen_path",layer:"top",pcb_component_id:"",route:[{x:s,y:-a},{x:s,y:-i},{x:0,y:-i},{x:0,y:-i+1.75}],stroke_width:0.1,pcb_silkscreen_path_id:""},h=Number.parseFloat(o.w)/2,d=Xo(h,i+1,0.5),u=Number.parseFloat(o.od)/2,_=Number.parseFloat(o.h),p=Number.parseFloat(o.ca)/2,m=-(u+0.25),A=_+u+0.25,g=p+0.25,f={type:"pcb_courtyard_rect",pcb_courtyard_rect_id:"",pcb_component_id:"",center:{x:(m+A)/2,y:0},width:A-m,height:2*g,layer:"top"};return{circuitJson:[...r,c,l,d,f],parameters:o}},bZo=Fo.extend({fn:k(),p:be.optional().default("7.5mm"),id:be.optional().default("1mm"),od:be.optional().default("2mm"),d:be.optional().default("10.5mm")}),IZo=(e,t,n,o,r)=>{let i=[],s=[];for(let a=0;a<=50;a++){let c=a/50*Math.PI,l=e+Math.cos(c)*n,h=t+Math.sin(c)*n;if(l<e-o&&h>=t-r/2&&h<=t+r/2)continue;i.push({x:l,y:h})}for(let a=0;a<=50;a++){let c=Math.PI+a/50*Math.PI,l=e+Math.cos(c)*n,h=t+Math.sin(c)*n;if(l<e-o&&h>=t-r/2&&h<=t+r/2)continue;s.push({x:l,y:h})}return{topArc:i,bottomArc:s}},vZo=(e)=>{let t=bZo.parse(e),{p:n,id:o,od:r,d:i}=t,s=[Z1({pn:1,x:-n/2,y:0,holeDiameter:o,rectPadWidth:r,rectPadHeight:r}),Ri(2,n/2,0,o,r)],{topArc:a,bottomArc:c}=IZo(0,0,i/2+0.1,r/2,r),l={type:"pcb_silkscreen_path",layer:"top",pcb_component_id:"",route:a,stroke_width:0.1,pcb_silkscreen_path_id:""},h={type:"pcb_silkscreen_path",layer:"top",pcb_component_id:"",route:c,stroke_width:0.1,pcb_silkscreen_path_id:""},d={type:"pcb_silkscreen_path",layer:"top",pcb_component_id:"",route:[{x:0,y:i/2+0.1},{x:0,y:-(i/2+0.1)}],stroke_width:0.1,pcb_silkscreen_path_id:""},u=-(i/2+0.5),_=r/2+1.5,p=0.5,m={type:"pcb_silkscreen_path",layer:"top",pcb_component_id:"",route:[{x:u-0.5,y:_},{x:u+0.5,y:_}],stroke_width:0.1,pcb_silkscreen_path_id:""},A={type:"pcb_silkscreen_path",layer:"top",pcb_component_id:"",route:[{x:u,y:_-0.5},{x:u,y:_+0.5}],stroke_width:0.1,pcb_silkscreen_path_id:""},g=Xo(0,i/2+1,0.5),f=i/2,y=n/2+r/2,x=0.25,C=Math.max(f,y)+0.25,b={type:"pcb_courtyard_circle",pcb_courtyard_circle_id:"",pcb_component_id:"",center:{x:0,y:0},radius:C,layer:"top"};return{circuitJson:[...s,l,h,d,m,A,g,b],parameters:t}},SZo=Fo.extend({fn:he("fpc"),num_pins:j8.number().int().min(2),p:be.default("0.5mm").describe("contact pad pitch"),pw:be.default("0.3mm").describe("contact pad width"),pl:be.default("1.25mm").describe("contact pad length"),staggered:Be().default(!1).describe("alternate contacts between two rows"),reverse:Be().default(!1).describe("place pin 1 on the upper row when staggered"),py:be.default("2.4mm").describe("staggered row center pitch"),toppl:be.optional().describe("upper-row contact pad length"),bottompl:be.optional().describe("lower-row contact pad length"),mpx:be.optional().describe("mounting pad center pitch"),mpy:be.optional().describe("mounting pad row distance from the contact-row center"),mounttop:Be().default(!1).describe("place the mounting pads above the contact-row center"),mpw:be.default("2mm").describe("mounting pad width"),mpl:be.default("2.5mm").describe("mounting pad length")}),AGe=(...e)=>uo(...e),PZo=(e)=>({maxX:Math.max(...e.map((t)=>t.x+t.width/2)),maxY:Math.max(...e.map((t)=>t.y+t.height/2)),minX:Math.min(...e.map((t)=>t.x-t.width/2)),minY:Math.min(...e.map((t)=>t.y-t.height/2))}),EZo=(e)=>{let t=SZo.parse(e),{num_pins:n,p:o,pw:r,pl:i,staggered:s,reverse:a,py:c,toppl:l,bottompl:h,mounttop:d,mpw:u,mpl:_}=t,p=(n-1)*o,m=t.mpx??p+(s?3.5:3.38),A=t.mpy??(s?0:2.575),g=A===0?0:(d?1:-1)*A,f=-p/2,y=Array.from({length:n},(H,V)=>{let O=s&&V%2===1!==a,U=s?O?c/2:-c/2:0,j=O?l??i:h??i;return AGe(V+1,f+V*o,U,r,j)}),x=[AGe(n+1,m/2,g,u,_),AGe(n+2,-m/2,g,u,_)],C=[...y,...x],b=PZo(C),I=Math.min(p/2+r/2,m/2-u/2),v=b.maxY+0.2,P=b.minY-0.2,M=y[0],B=M.x-M.width/2-0.2,T=M.y,N=[fs([{x:-I,y:v},{x:I,y:v}]),fs([{x:-I,y:P},{x:I,y:P}]),fs([{x:B-0.25,y:T-0.25},{x:B,y:T},{x:B-0.25,y:T+0.25}])],D=Xo(0,v+0.7,0.5),L={type:"pcb_courtyard_rect",pcb_courtyard_rect_id:"",pcb_component_id:"",center:{x:(b.minX+b.maxX)/2,y:(b.minY+b.maxY)/2},width:b.maxX-b.minX+0.5,height:b.maxY-b.minY+0.5,layer:"top"};return{circuitJson:[...C,...N,D,L],parameters:{...t,mpx:m,mpy:A,toppl:l??i,bottompl:h??i}}},MZo=Fo.extend({fn:k(),num_pins:he(2).default(2),w:k().default("6.5mm"),h:k().default("3mm"),pl:k().default("1.75mm"),pw:k().default("2.40mm"),p:k().default("4.75mm")}),wZo=(e)=>{let t=MZo.parse(e),n=Xo(0,be.parse(t.h)-0.5,0.3),o={type:"pcb_silkscreen_path",layer:"top",pcb_component_id:"",route:[{x:be.parse(t.p)/2,y:be.parse(t.h)/2},{x:-be.parse(t.w)/2-0.3,y:be.parse(t.h)/2},{x:-be.parse(t.w)/2-0.3,y:-be.parse(t.h)/2},{x:be.parse(t.p)/2,y:-be.parse(t.h)/2}],stroke_width:0.1,pcb_silkscreen_path_id:""},r=7,i=3.5,s={type:"pcb_courtyard_rect",pcb_courtyard_rect_id:"",pcb_component_id:"",center:{x:0,y:0},width:7,height:3.5,layer:"top"};return{circuitJson:TZo(t).concat(...f0(t),o,n,s),parameters:t}},BZo=(e)=>{let{pn:t,p:n}=e;if(t===1)return{x:-n/2,y:0};return{x:n/2,y:0}},TZo=(e)=>{let t=[],n=be.parse(e.p),o=be.parse(e.pl),r=be.parse(e.pw),i=0.125;for(let s=1;s<=e.num_pins;s++){let{x:a,y:c}=BZo({pn:s,p:n});t.push(uo(s,a,c,o,r,0.125))}return t},DZo=[{x:-1.45,y:0.98},{x:-0.73,y:0.98},{x:-0.73,y:1.1},{x:0.73,y:1.1},{x:0.73,y:0.33},{x:1.45,y:0.33},{x:1.45,y:-0.33},{x:0.73,y:-0.33},{x:0.73,y:-1.1},{x:-0.73,y:-1.1},{x:-0.73,y:-0.98},{x:-1.45,y:-0.98},{x:-1.45,y:-0.32},{x:-0.73,y:-0.32},{x:-0.73,y:0.32},{x:-1.45,y:0.32}],NZo=Fo.extend({fn:k(),num_pins:Ae().default(3),w:k().default("2.45mm"),h:k().default("2.40mm"),pl:k().default("0.92mm"),pw:k().default("0.45mm"),p:k().default("0.891mm"),string:k().optional()}),RZo=(e)=>{let t=e.string?.match(/^sot323_(\d+)/),n=t?Number.parseInt(t[1],3):3,o=NZo.parse({...e,num_pins:n});if(o.num_pins===3)return{circuitJson:kZo(o),parameters:o};throw Error("Invalid number of pins")},QZo=(e)=>{let{pn:t,w:n,h:o,pl:r,p:i}=e;if(t===1)return{x:-i,y:0.65};if(t===2)return{x:-i,y:-0.65};return{x:i,y:0}},kZo=(e)=>{let t=[],n=Number.parseFloat(e.w),o=Number.parseFloat(e.h),r=Number.parseFloat(e.pl),i=Number.parseFloat(e.pw),s=Number.parseFloat(e.p),a=Math.min(r,i)/8;for(let p=0;p<e.num_pins;p++){let{x:m,y:A}=QZo({num_pins:e.num_pins,pn:p+1,w:n,h:o,pl:r,p:s});t.push(uo(p+1,m,A,r,i,a))}let c=Xo(0,Number.parseInt(e.h)/2+1,0.3),l=n/2-r,h=o/2,d={layer:"top",pcb_component_id:"",pcb_silkscreen_path_id:"silkscreen_path_1",route:[{x:-l,y:h+0.3},{x:l,y:h+0.3},{x:l,y:h/2}],type:"pcb_silkscreen_path",stroke_width:0.1},u={layer:"top",pcb_component_id:"",pcb_silkscreen_path_id:"silkscreen_path_2",route:[{x:-l,y:-h-0.3},{x:l,y:-h-0.3},{x:l,y:-h/2}],type:"pcb_silkscreen_path",stroke_width:0.1},_={type:"pcb_courtyard_outline",pcb_courtyard_outline_id:"",pcb_component_id:"",outline:DZo,layer:"top"};return[...t,d,u,c,_]},LZo=Fo.extend({fn:k(),circle:Be().optional(),rect:Be().optional(),square:Be().optional(),pill:Be().optional(),d:be.optional(),pd:be.optional(),diameter:be.optional(),r:be.optional(),pr:be.optional(),radius:be.optional(),w:be.optional(),pw:be.optional(),width:be.optional(),h:be.optional(),ph:be.optional(),height:be.optional(),s:be.optional(),size:be.optional(),string:k().optional()}).transform((e)=>{let t="rect";if(e.circle)t="circle";if(e.square)t="square";if(e.rect)t="rect";if(e.pill)t="pill";let n,o,r;if(t==="circle")if(e.r!==void 0)n=Ni(e.r);else if(e.pr!==void 0)n=Ni(e.pr);else if(e.radius!==void 0)n=Ni(e.radius);else if(e.d!==void 0)n=Ni(e.d)/2;else if(e.pd!==void 0)n=Ni(e.pd)/2;else if(e.diameter!==void 0)n=Ni(e.diameter)/2;else n=Ni("1mm")/2;else{if(e.w!==void 0)o=Ni(e.w);else if(e.pw!==void 0)o=Ni(e.pw);else if(e.width!==void 0)o=Ni(e.width);else if(e.s!==void 0)o=Ni(e.s);else if(e.size!==void 0)o=Ni(e.size);else o=Ni("1mm");if(e.h!==void 0)r=Ni(e.h);else if(e.ph!==void 0)r=Ni(e.ph);else if(e.height!==void 0)r=Ni(e.height);else if(t==="square")r=o;else if(t==="rect")r=o;else r=Ni("1mm")}return{fn:e.fn,shape:t,radius:n,width:o,height:r}}),HZo=(e)=>{let t=LZo.parse(e),{shape:n,radius:o,width:r,height:i}=t,s,a;if(n==="circle")s=w5e(1,{x:0,y:0,radius:o}),a=o+0.5;else if(n==="pill")s=xR(1,0,0,r,i),a=Math.max(r,i)/2+0.5;else s=uo(1,0,0,r,i),a=i/2+0.5;return{circuitJson:[s,Xo(0,a,0.2)],parameters:t}},FZo=Fo.extend({fn:he("smdpads"),num_pins:Ae().int().positive().default(3),p:be.default("1mm").describe("pad center pitch"),pw:be.default("1mm").describe("outer pad width"),ph:be.default("1mm").describe("pad height"),cyw:be.optional().describe("courtyard width"),cyh:be.optional().describe("courtyard height"),centerpadwidth:be.optional().describe("center pad width")}).superRefine((e,t)=>{if(e.centerpadwidth!==void 0&&e.num_pins%2===0)t.addIssue({code:Vt.custom,message:"'centerpadwidth' requires an odd number of SMD pads",path:["centerpadwidth"]})}),zZo=(e)=>{let t=FZo.parse(e),{num_pins:n,p:o,pw:r,ph:i,cyw:s,cyh:a,centerpadwidth:c}=t,l=Math.ceil(n/2),h=-((n-1)*o)/2,d=Array.from({length:n},(g,f)=>{let y=f+1,x=c!==void 0&&y===l?c:r;return uo(y,h+f*o,0,x,i)}),u=(n-1)*o/2+r/2,_=c?c/2:0,p=Math.max(u,_),m=s!==void 0&&a!==void 0?{width:s,height:a}:{width:p*2+0.5,height:i+0.5},A={type:"pcb_courtyard_rect",pcb_courtyard_rect_id:"",pcb_component_id:"",center:{x:0,y:0},width:m.width,height:m.height,layer:"top"};return{circuitJson:[...d,Xo(0,i/2+0.8,0.4),A],parameters:t}},OZo=Fo.extend({fn:he("smdpushbutton"),num_pins:he(4).default(4),px:be.default("4.2mm").describe("horizontal pad center pitch"),py:be.default("2.15mm").describe("vertical pad center pitch"),pw:be.default("1.05mm").describe("pad width"),ph:be.default("0.7mm").describe("pad height")}),VZo=(e)=>{let t=OZo.parse(e),{px:n,py:o,pw:r,ph:i}=t,s=[uo(1,-n/2,o/2,r,i),uo(2,n/2,o/2,r,i),uo(3,-n/2,-o/2,r,i),uo(4,n/2,-o/2,r,i)],a=Math.max(n/2-r/2-0.15,0.2),c=o/2+i/2+0.1,l=Math.max(o/2-i/2-0.15,0.2),h=[fs([{x:-a,y:c},{x:a,y:c}]),fs([{x:-a,y:-c},{x:a,y:-c}]),fs([{x:-n/2,y:-l},{x:-n/2,y:l}]),fs([{x:n/2,y:-l},{x:n/2,y:l}])],d=Xo(0,c+0.6,0.5),u={type:"pcb_courtyard_rect",pcb_courtyard_rect_id:"",pcb_component_id:"",center:{x:0,y:0},width:n+r+0.5,height:o+i+0.5,layer:"top"};return{circuitJson:[...s,...h,d,u],parameters:t}},YZo=(e)=>({x:(e.minX+e.maxX)/2,y:(e.minY+e.maxY)/2}),GZo=(e)=>{if(e.length===0)return null;let t=e[0].x,n=e[0].y,o=e[0].x,r=e[0].y;for(let i=1;i<e.length;i++){let s=e[i];if(s.x<t)t=s.x;if(s.y<n)n=s.y;if(s.x>o)o=s.x;if(s.y>r)r=s.y}return{minX:t,minY:n,maxX:o,maxY:r}},UZo=Fo.extend({fn:he("smdslideswitch"),num_pins:he(7).default(7),signalcols:j8.number().int().min(3).default(3),missing:xK.default([]),p:be.default("1mm").describe("signal-pad column pitch"),pw:be.default("0.7mm").describe("signal-pad width"),pl:be.default("1.5mm").describe("signal-pad length"),mounty:be.default("-1.8mm").describe("Y position of the mounting-pad row center"),mpx:be.default("5.5mm").describe("horizontal center-to-center mounting-pad distance"),mpy:be.default("2.2mm").describe("vertical center-to-center mounting-pad distance"),mpw:be.default("1mm").describe("mounting-pad width"),mpl:be.default("0.8mm").describe("mounting-pad length"),holex:be.default("1.5mm").describe("alignment-hole X distance from the footprint center"),holey:be.optional().describe("alignment-hole Y position; defaults to mounty"),holed:be.default("0.9mm").describe("alignment-hole diameter"),noholes:Be().optional().default(!1)}),WZo=(e)=>{let t=UZo.parse(e),{num_pins:n,signalcols:o,missing:r,p:i,pw:s,pl:a,mounty:c,mpx:l,mpy:h,mpw:d,mpl:u,holex:_,holed:p,noholes:m}=t,A=t.holey??c,g=r.find((X)=>typeof X!=="number"||!Number.isInteger(X)||X<1||X>o);if(g!==void 0)throw Error(`Invalid missing signal column "${g}" for signalcols${o}`);let f=new Set(r.filter((X)=>typeof X==="number")),y=o-f.size;if(y+4!==n)throw Error(`smdslideswitch${n} needs ${n-4} signal pads, but signalcols${o}_missing(${[...f].join(",")}) creates ${y}`);let x=(X)=>Number(X.toFixed(12)),C=[],b=-((o-1)*i)/2,I=1;for(let X=1;X<=o;X++){if(f.has(X))continue;C.push(uo(I,x(b+(X-1)*i),0,s,a)),I++}let v=c+h/2,P=c-h/2,M=[{x:x(-l/2),y:x(v)},{x:x(l/2),y:x(v)},{x:x(-l/2),y:x(P)},{x:x(l/2),y:x(P)}];for(let X of M)C.push(uo(I,X.x,X.y,d,u)),I++;let B=m?[]:[-_,_].map((X)=>({type:"pcb_hole",pcb_hole_id:"",pcb_component_id:"",hole_shape:"circle",hole_diameter:p,x:X,y:A})),T=Math.max(l/2-d/2-0.2,i),N=-a/2-0.2,D=P+u/2+0.2,L=[fs([{x:-T,y:N},{x:T,y:N}]),fs([{x:-T,y:D},{x:T,y:D}]),fs([{x:-T,y:D},{x:-T,y:N}]),fs([{x:T,y:D},{x:T,y:N}])],H=b+(o-1)*i,V=GZo([{x:b-s/2,y:-a/2},{x:H+s/2,y:a/2},{x:-l/2-d/2,y:P-u/2},{x:l/2+d/2,y:v+u/2},...!m?[{x:-_-p/2,y:A-p/2},{x:_+p/2,y:A+p/2}]:[]]);if(!V)throw Error("Could not determine SMD slide-switch bounds");let O=0.25,U=YZo(V),j={type:"pcb_courtyard_rect",pcb_courtyard_rect_id:"",pcb_component_id:"",center:U,width:V.maxX-V.minX+O*2,height:V.maxY-V.minY+O*2,layer:"top"},Y=Xo(U.x,V.maxY+0.6,0.5);return{circuitJson:[...C,...B,...L,Y,j],parameters:t}},XZo=Fo.extend({fn:he("smdpinheader"),num_pins:Ae().int().positive().default(6),p:be.default("2.54mm").describe("contact pitch"),py:be.default("3.31mm").describe("center-to-center distance between alternating pad rows"),pw:be.default("1mm").describe("pad width"),ph:be.default("2.51mm").describe("pad height"),bh:be.default("2.5mm").describe("plastic body height"),male:he(!0).default(!0),female:he(!1).default(!1),smd:he(!0).default(!0)}),jZo=(e)=>{let t=XZo.parse(e),{num_pins:n,p:o,py:r,pw:i,ph:s,bh:a}=t,c=-((n-1)*o)/2,l=Array.from({length:n},(C,b)=>uo(b+1,c+b*o,b%2===0?r/2:-r/2,i,s)),h=n*o/2,d=a/2,u=Math.min(0.5,a/4),_=(C,b,I=-h)=>{let v=i/2+0.2,P=[],M=I;for(let B=b;B<n;B+=2){let T=c+B*o,N=T-v;if(N>M)P.push(fs([{x:M,y:C},{x:N,y:C}]));M=T+v}if(M<h)P.push(fs([{x:M,y:C},{x:h,y:C}]));return P},p=[..._(d,0,-h+u),..._(-d,1),fs([{x:h,y:-d},{x:h,y:d}]),fs([{x:-h,y:-d},{x:-h,y:d-u},{x:-h+u,y:d}])],m=(n-1)*o/2+i/2,A=r/2+s/2,g=Math.max(h,m)+0.25,f=Math.max(d,A)+0.25,y={type:"pcb_courtyard_rect",pcb_courtyard_rect_id:"",pcb_component_id:"",center:{x:0,y:0},width:2*g,height:2*f,layer:"top"},x=Xo(0,f+0.6,0.5);return{circuitJson:[...l,...p,x,y],parameters:t}},KZo=Fo.extend({fn:k(),d:be.optional(),hd:be.optional(),r:be.optional(),hr:be.optional(),pd:be.optional(),pr:be.optional(),squarepad:Be().optional().default(!1)}).transform((e)=>{let t;if(e.d!==void 0)t=Ni(e.d);else if(e.hd!==void 0)t=Ni(e.hd);else if(e.r!==void 0)t=Ni(e.r)*2;else if(e.hr!==void 0)t=Ni(e.hr)*2;else t=Ni("1mm");let n;if(e.pd!==void 0)n=Ni(e.pd);else if(e.pr!==void 0)n=Ni(e.pr)*2;else n=t*1.5;return{fn:e.fn,d:t,pd:n,squarepad:e.squarepad??!1}}),$Zo=(e)=>{let t=KZo.parse(e),{d:n,pd:o,squarepad:r}=t;return{circuitJson:[r?Z1({pn:1,x:0,y:0,holeDiameter:n,rectPadWidth:o,rectPadHeight:o}):Ri(1,0,0,n,o),Xo(0,o/2+0.5,0.2)],parameters:t}},qZo=Fo.extend({fn:k(),num_pins:he(6).default(6),h:k().default("1.3mm"),pl:k().default("1.325mm"),pw:k().default("0.6mm"),p:k().default("0.95mm")}),JZo=(e)=>{let t=qZo.parse(e);return{circuitJson:ZZo(t),parameters:t}},nRt=(e)=>{let{p:t,h:n,pn:o}=e;if(o===1)return{x:-n/2-0.4875,y:t};if(o===2)return{x:-n/2-0.4875,y:0};if(o===3)return{x:-n/2-0.4875,y:-t};if(o===4)return{x:n/2+0.4875,y:-t};if(o===5)return{x:n/2+0.4875,y:0};if(o===6)return{x:n/2+0.4875,y:t};throw Error("Invalid pin number")},ZZo=(e)=>{let t=[],n=Number.parseFloat(e.h),o=Number.parseFloat(e.p),r=Number.parseFloat(e.pl),i=Number.parseFloat(e.pw),s=Math.min(r,i)/8;for(let v=1;v<=e.num_pins;v++){let{x:P,y:M}=nRt({h:n,p:o,pn:v});t.push(uo(v,P,M,r,i,s))}let a=e.num_pins/2*o,c=n,l={layer:"top",pcb_component_id:"",pcb_silkscreen_path_id:"silkscreen_path_1",route:[{x:-a/3,y:c/2+Number.parseFloat(e.p)/1.3},{x:a/3,y:c/2+o/1.3}],type:"pcb_silkscreen_path",stroke_width:0.05},h={layer:"top",pcb_component_id:"",pcb_silkscreen_path_id:"silkscreen_path_2",route:[{x:-a/3,y:-c/2-o/1.3},{x:a/3,y:-c/2-o/1.3}],type:"pcb_silkscreen_path",stroke_width:0.05},d=Xo(0,c+0.3,0.3),u=nRt({h:n,p:o,pn:1});u.x=u.x-i*1.5;let _=0.7,p=0.3,m={type:"pcb_silkscreen_path",layer:"top",pcb_component_id:"",pcb_silkscreen_path_id:"pin1_indicator",route:[{x:u.x+_/2-0.2,y:u.y},{x:u.x-_/2,y:u.y+p/2},{x:u.x-_/2,y:u.y-p/2},{x:u.x+_/2-0.2,y:u.y}],stroke_width:0.05},A=n/2+0.4875,g=o*2+i,f=A+r/2,y=n/2+0.4,x=f+0.25,C=g/2+0.25,b=C+0.2,I={type:"pcb_courtyard_outline",pcb_courtyard_outline_id:"",pcb_component_id:"",layer:"top",outline:ey([{minX:-x,maxX:x,minY:-C,maxY:C},{minX:-y,maxX:y,minY:-b,maxY:b}])};return[...t,d,l,h,m,I]},eer=Fo.extend({fn:he("sot143"),num_pins:he(4).default(4),p:be.default("2.382774mm"),px:be.default("1.89992mm"),pw:be.default("0.8382mm"),ph:be.default("0.8382mm"),pin1padwidth:be.default("1.1938mm"),pin1centeroffsetx:be.default("0.199898mm"),w:be.default("3mm"),h:be.default("2.9mm")}),ter=(e)=>{let t=eer.parse(e),{p:n,px:o,pw:r,ph:i,pin1padwidth:s,pin1centeroffsetx:a,w:c,h:l}=t,h=o/2,d=n/2,u=[uo(1,-h+a,-d,s,i),uo(2,h,-d,r,i),uo(3,h,d,r,i),uo(4,-h,d,r,i)],_=c/2,p=l/2,m=[fs([{x:-_,y:-p/2},{x:-_,y:p/2}]),fs([{x:_,y:p/2},{x:_,y:-p/2}])],A=o+Math.max(s,r),g=n+i,f={type:"pcb_courtyard_rect",pcb_courtyard_rect_id:"",pcb_component_id:"",center:{x:0,y:0},width:Math.max(c,A)+0.5,height:Math.max(l,g)+0.5,layer:"top"};return{circuitJson:[...u,...m,Xo(0,Math.max(p,g/2)+0.8,0.4),f],parameters:t}},ner=[{x:-1.703,y:0.98},{x:-0.983,y:0.98},{x:-0.983,y:1.1},{x:0.477,y:1.1},{x:0.477,y:0.98},{x:1.197,y:0.98},{x:1.197,y:-0.98},{x:0.477,y:-0.98},{x:0.477,y:-1.1},{x:-0.983,y:-1.1},{x:-0.983,y:-0.98},{x:-1.703,y:-0.98}],oer=Fo.extend({fn:k(),num_pins:Ae().default(4),w:k().default("3.2mm"),h:k().default("2.6mm"),pl:k().default("1.05mm"),pw:k().default("0.45mm"),p:k().default("0.55mm"),string:k().optional()}),rer=(e)=>{let t=e.string?.match(/^sot343_(\d+)/),n=t?Number.parseInt(t[1],4):4,o=oer.parse({...e,num_pins:n});if(o.num_pins===4)return{circuitJson:ser(o),parameters:o};throw Error("Invalid number of pins")},ier=(e)=>{let{pn:t,p:n}=e;if(t===1)return{x:-n*1.92,y:-0.65};if(t===2)return{x:-n*1.92,y:0.65};if(t===3)return{x:n,y:0.65};if(t===4)return{x:n,y:-0.65};return{x:0,y:0}},ser=(e)=>{let t=[],n=Number.parseFloat(e.w),o=Number.parseFloat(e.h),r=Number.parseFloat(e.pl),i=Number.parseFloat(e.pw),s=Number.parseFloat(e.p),a=Math.min(r,i)/8,c=1/0,l=-1/0,h=1/0,d=-1/0;for(let C=0;C<e.num_pins;C++){let{x:b,y:I}=ier({num_pins:e.num_pins,pn:C+1,w:n,h:o,pl:r,p:s});if(t.push(uo(C+1,b,I,r,i,a)),b<c)c=b;if(b>l)l=b;if(I<h)h=I;if(I>d)d=I}let u=(c+l)/2,_=d-h,p=o*0.3,m=_/2+p,A=n*0.8;if(o<=2.6)A/=2;let g=Xo(u,m+0.5,0.3),f={layer:"top",pcb_component_id:"",pcb_silkscreen_path_id:"silkscreen_path_top",route:[{x:u-A/2,y:m},{x:u+A/2,y:m}],type:"pcb_silkscreen_path",stroke_width:0.1},y={layer:"top",pcb_component_id:"",pcb_silkscreen_path_id:"silkscreen_path_bottom",route:[{x:u-A/2,y:-m},{x:u+A/2,y:-m}],type:"pcb_silkscreen_path",stroke_width:0.1},x={type:"pcb_courtyard_outline",pcb_courtyard_outline_id:"",pcb_component_id:"",outline:ner,layer:"top"};return[...t,f,y,g,x]},aer=Fo.extend({fn:k()}),cer=(e)=>{let t=aer.parse(e),n=[],o=0.35,r=1.5,i=0.5,s=0.25,a=0.5,c=75,l=-18.5;for(let v=0;v<75;v++){let P=v+1;if(P>=24&&P<=31)continue;let M=-18.5-v*0.25,B=P%2===0,T=1.5+(B?0.25:0),D=0.5-T/2,L=uo(P,D,M,T,0.35);L.layer=B?"bottom":"top",n.push(L)}let h=1.1683999999999999,d=3.4798,u=6.6293999999999995,_={type:"pcb_cutout",pcb_cutout_id:"",shape:"rect",center:{x:-d/2+0.75,y:-18.5-u},width:d,height:h},p={x:-0.5,y:-18.5},m={type:"pcb_silkscreen_path",layer:"top",pcb_component_id:"pin_marker_1",route:[{x:p.x-0.4,y:p.y},{x:p.x-0.7,y:p.y+0.3},{x:p.x-0.7,y:p.y-0.3},{x:p.x-0.4,y:p.y}],stroke_width:0.05,pcb_silkscreen_path_id:"pin_marker_1"},A=1/0,g=-1/0,f=1/0,y=-1/0,x=(v,P,M=0,B=0)=>{A=Math.min(A,v-M/2),g=Math.max(g,v+M/2),f=Math.min(f,P-B/2),y=Math.max(y,P+B/2)};for(let v of n){let P=v;x(P.x,P.y,P.width,P.height)}x(_.center.x,_.center.y,_.width,_.height);for(let v of m.route)x(v.x,v.y);let C=(A+g)/2,b=(f+y)/2,I=(v)=>{if(typeof v.x==="number")v.x-=C;if(typeof v.y==="number")v.y-=b;if(v.center)v.center.x-=C,v.center.y-=b;if(Array.isArray(v.route))v.route=v.route.map((P)=>({x:P.x-C,y:P.y-b}))};for(let v of n)I(v);return I(_),I(m),{circuitJson:[...n,_,m],parameters:t}};var ler=Fo.extend({fn:k(),numPins:Ae().optional().default(0),rows:un([k(),Ae()]).transform((e)=>Number(e)).optional().default(1).describe("number of rows"),p:be.default("2.54mm").describe("pitch"),id:be.default("1.0mm").describe("inner diameter"),od:be.default("1.5mm").describe("outer diameter"),male:Be().optional().describe("the module uses male headers"),nopin:Be().optional().default(!1).describe("omit pins rendering"),female:Be().optional().describe("the module uses female headers"),smd:Be().optional().describe("surface mount device"),pinlabeltextalignleft:Be().optional().default(!1),pinlabeltextaligncenter:Be().optional().default(!1),pinlabeltextalignright:Be().optional().default(!1),pinlabelverticallyinverted:Be().optional().default(!1),pinlabelorthogonal:Be().optional().default(!1),nopinlabels:Be().optional().default(!1).describe("omit silkscreen pin labels"),doublesidedpinlabel:Be().optional().default(!1).describe("add silkscreen pins in top and bottom layers"),bottomsidepinlabel:Be().optional().default(!1).describe("place the silkscreen reference text on the bottom layer instead of top"),pinRowSide:Pt(["left","right","top","bottom"]).optional().default("left"),pinrowleft:Be().optional().default(!1),pinrowright:Be().optional().default(!1),pinrowtop:Be().optional().default(!1),pinrowbottom:Be().optional().default(!1),pinrowleftpins:un([k(),Ae()]).transform((e)=>Number(e)).optional(),pinrowrightpins:un([k(),Ae()]).transform((e)=>Number(e)).optional(),pinrowtoppins:un([k(),Ae()]).transform((e)=>Number(e)).optional(),pinrowbottompins:un([k(),Ae()]).transform((e)=>Number(e)).optional(),width:be.optional(),height:be.optional(),pinRowHoleEdgeToEdgeDist:be.default("2mm"),holes:un([k(),it(k())]).optional().transform((e)=>{if(!e)return e;if(Array.isArray(e))return e;if(e.startsWith("(")&&e.endsWith(")"))return e.slice(1,-1).split(",").map((t)=>t.trim());return[e]}),holeXDist:be.optional(),holeYDist:be.optional(),holeInset:be.default("1mm"),pinrow:un([k(),Ae()]).optional(),usbposition:Pt(["left","right","top","bottom"]).optional().default("left"),usbleft:Be().optional().default(!1),usbtop:Be().optional().default(!1),usbright:Be().optional().default(!1),usbbottom:Be().optional().default(!1),usbtype:Pt(["micro","c"]).optional(),usbmicro:Be().optional().default(!1),usbc:Be().optional().default(!1),screen:Be().optional().default(!1).describe("add silkscreen outline for screen/display area"),screenwidth:be.optional(),screenheight:be.optional(),screencenteroffsetx:be.optional(),screencenteroffsety:be.optional()}).transform((e)=>{let t=bRt(e),n=e.pinRowSide;if(e.pinrowleft)n="left";if(e.pinrowright)n="right";if(e.pinrowtop)n="top";if(e.pinrowbottom)n="bottom";let o=e.usbposition;if(e.usbleft)o="left";if(e.usbtop)o="top";if(e.usbright)o="right";if(e.usbbottom)o="bottom";let r=e.usbtype;if(e.usbmicro)r="micro";if(e.usbc)r="c";if(e.pinrow!==void 0)e.numPins=Number(e.pinrow);let i={left:e.pinrowleftpins,right:e.pinrowrightpins,top:e.pinrowtoppins,bottom:e.pinrowbottompins},s=Object.values(i).some((x)=>x!==void 0&&x>0),a=(i.left??0)>0&&(i.right??0)>0,c=(i.top??0)>0&&(i.bottom??0)>0;if(s){if((i.left??0)>0)n="left";else if((i.right??0)>0)n="right";else if((i.top??0)>0)n="top";else if((i.bottom??0)>0)n="bottom";e.numPins=(i.left??0)+(i.right??0)+(i.top??0)+(i.bottom??0)}let l=Math.ceil(e.numPins/e.rows),h=Math.max(i.left??0,i.right??0),d=Math.max(i.top??0,i.bottom??0),u,_;if(s){let x=a?e.p:0,C=c?e.p:0;u=(d>0?(d-1)*e.p:0)+2*e.pinRowHoleEdgeToEdgeDist+x,_=(h>0?(h-1)*e.p:0)+2*e.pinRowHoleEdgeToEdgeDist+C}else if(n==="left"||n==="right")u=(e.rows-1)*e.p+2*e.pinRowHoleEdgeToEdgeDist,_=(l-1)*e.p+2*e.pinRowHoleEdgeToEdgeDist;else _=(e.rows-1)*e.p+2*e.pinRowHoleEdgeToEdgeDist,u=(l-1)*e.p+2*e.pinRowHoleEdgeToEdgeDist;if(e.numPins===0)u=10,_=10;let p=e.width??u,m=e.height??_,A=e.screenwidth??p*0.95,g=e.screenheight??m*0.95,f=e.screencenteroffsetx??0,y=e.screencenteroffsety??0;return{...e,pinlabelAnchorSide:t,pinRowSide:n,usbposition:o,usbtype:r,male:e.male??!e.female,female:e.female??!1,width:p,height:m,screenwidth:A,screenheight:g,screencenteroffsetx:f,screencenteroffsety:y,pinrowleftpins:i.left,pinrowrightpins:i.right,pinrowtoppins:i.top,pinrowbottompins:i.bottom}}).superRefine((e,t)=>{if(e.male&&e.female)t.addIssue({code:Vt.custom,message:"'male' and 'female' cannot both be true; it should be male or female.",path:["male","female"]})}),her=(e)=>{let t=ler.parse(e),{p:n,id:o,od:r,rows:i,numPins:s,pinlabelAnchorSide:a,pinlabelverticallyinverted:c,pinlabelorthogonal:l,pinlabeltextalignleft:h,pinlabeltextalignright:d,nopinlabels:u,doublesidedpinlabel:_,bottomsidepinlabel:p,pinRowSide:m,width:A,height:g,pinRowHoleEdgeToEdgeDist:f,holes:y,holeXDist:x,holeYDist:C,holeInset:b,pinrowleftpins:I,pinrowrightpins:v,pinrowtoppins:P,pinrowbottompins:M,usbposition:B,usbtype:T,screen:N,screenwidth:D,screenheight:L,screencenteroffsetx:H,screencenteroffsety:V}=t,O="center";if(h)O="left";else if(d)O="right";let U=[],j={left:I,right:v,top:P,bottom:M},Y=Object.values(j).some((J)=>J!==void 0&&J>0),X=(J,ee,se,ne)=>{if(t.smd)U.push(uo(J,ee,se,t.od,t.od));else if(J===1)U.push(Z1({pn:J,x:ee,y:se,holeDiameter:o,rectPadWidth:r,rectPadHeight:r}));else U.push(Ri(J,ee,se,o,r));if(!u){let re=ee+(ne==="left"?-r:ne==="right"?r:0),Z=se+(ne==="top"?r:ne==="bottom"?-r:0);if(!p)U.push($z({fs:r/5,pn:J,anchor_x:re,anchor_y:Z,anchorplacement:ne,textalign:O,orthogonal:l,verticallyinverted:c,layer:"top"}));if(_||p)U.push($z({fs:r/5,pn:J,anchor_x:re,anchor_y:Z,anchorplacement:ne,textalign:O,orthogonal:l,verticallyinverted:c,layer:"bottom"}))}};if(Y){let J=n,ee=1,se=j.left??0,ne=j.right??0,re=j.top??0,Z=j.bottom??0,te=(ie,ce)=>{if(ce<=0)return;if(ie==="left"||ie==="right"){let ue=ie==="left"?-A/2+f:A/2-f,de=(ce-1)/2*J;for(let me=0;me<ce;me++)X(ee,ue,de-me*J,ie),ee++}else{let ue=ie==="top"?g/2-f:-g/2+f,de=-((ce-1)/2)*J;for(let me=0;me<ce;me++)X(ee,de+me*J,ue,ie),ee++}};te("left",se),te("right",ne),te("top",re),te("bottom",Z)}else{let J=n,ee=0,se=0,ne=0,re=0,Z=0,te=0,ie=Math.ceil(s/i);if(m==="left"||m==="right")ee=m==="left"?-A/2+f:A/2-f,se=(ie-1)/2*J,ne=0,re=-J,Z=m==="left"?J:-J,te=0;else ee=-(ie-1)/2*J,se=m==="top"?g/2-f:-g/2+f,ne=J,re=0,Z=0,te=m==="top"?-J:J;let ce=1;for(let ue=0;ue<i&&ce<=s;ue++)for(let de=0;de<ie&&ce<=s;de++){let me=ee+de*ne+ue*Z,ge=se+de*re+ue*te;if(t.smd)U.push(uo(ce,me,ge,t.od,t.od));else if(ce===1)U.push(Z1({pn:ce,x:me,y:ge,holeDiameter:o,rectPadWidth:r,rectPadHeight:r}));else U.push(Ri(ce,me,ge,o,r));if(!u){let xe=me+(m==="left"?-r:m==="right"?r:0),Ee=ge+(m==="top"?r:m==="bottom"?-r:0);if(!p)U.push($z({fs:r/5,pn:ce,anchor_x:xe,anchor_y:Ee,anchorplacement:a,textalign:O,orthogonal:l,verticallyinverted:c,layer:"top"}));if(_||p)U.push($z({fs:r/5,pn:ce,anchor_x:xe,anchor_y:Ee,anchorplacement:a,textalign:O,orthogonal:l,verticallyinverted:c,layer:"bottom"}))}ce++}}if(y)for(let J of y){let ee=0,se=0;if(J==="topleft")ee=-A/2+b,se=g/2-b;else if(J==="topright")ee=A/2-b,se=g/2-b;else if(J==="bottomleft")ee=-A/2+b,se=-g/2+b;else if(J==="bottomright")ee=A/2-b,se=-g/2+b;else if(J==="center")ee=0,se=0;if(x!==void 0)ee+=x;if(C!==void 0)se+=C;U.push(Ri(s+y.indexOf(J)+1,ee,se,o,r))}if(!t.nosilkscreen){let J=[{x:-A/2,y:-g/2},{x:A/2,y:-g/2},{x:A/2,y:g/2},{x:-A/2,y:g/2},{x:-A/2,y:-g/2}];U.push(fs(J,{stroke_width:0.1,layer:"top"}))}let K=Xo(0,g/2+1,0.5);if(U.push(K),B&&T){let J,ee;if(T==="c")J=8,ee=3;else if(T==="micro")J=6,ee=2;else return{circuitJson:U,parameters:t};let se;if(B==="left")se=[{x:-A/2,y:-J/2},{x:-A/2+ee,y:-J/2},{x:-A/2+ee,y:J/2},{x:-A/2,y:J/2},{x:-A/2,y:-J/2}];else if(B==="right")se=[{x:A/2-ee,y:-J/2},{x:A/2,y:-J/2},{x:A/2,y:J/2},{x:A/2-ee,y:J/2},{x:A/2-ee,y:-J/2}];else if(B==="top")se=[{x:-J/2,y:g/2-ee},{x:J/2,y:g/2-ee},{x:J/2,y:g/2},{x:-J/2,y:g/2},{x:-J/2,y:g/2-ee}];else if(B==="bottom")se=[{x:-J/2,y:-g/2},{x:J/2,y:-g/2},{x:J/2,y:-g/2+ee},{x:-J/2,y:-g/2+ee},{x:-J/2,y:-g/2}];else return{circuitJson:U,parameters:t};U.push(fs(se,{stroke_width:0.1,layer:"top"}))}if(N){let J=D/2,ee=L/2,se=H,ne=V,re=[{x:-J+se,y:-ee+ne},{x:J+se,y:-ee+ne},{x:J+se,y:ee+ne},{x:-J+se,y:ee+ne},{x:-J+se,y:-ee+ne}];U.push(fs(re,{stroke_width:0.05,layer:"top"}))}return{circuitJson:U,parameters:t}},der=[{x:-1.45,y:2.75},{x:-1.45,y:-1.85},{x:4.05,y:-1.85},{x:4.05,y:2.75}],uer=[{x:-1.55,y:2.75},{x:-1.55,y:-1.85},{x:3.95,y:-1.85},{x:3.95,y:2.75}],per=Fo.extend({fn:k(),num_pins:Ae().default(3),inline:Be().default(!1),p:k().default("1.27mm"),id:k().default("0.75mm"),od:k().default("1.3mm"),w:k().default("4.8mm"),h:k().default("4.0mm")}),mer=(e)=>{let t=per.parse(e),n=Number.parseFloat(t.p),o=Number.parseFloat(t.w),r=Number.parseFloat(t.h),i=t.inline?1.05:Number.parseFloat(t.od),s=t.inline?1.5:i,a=[Z1({pn:1,x:0,y:0,holeDiameter:t.id,rectPadWidth:i,rectPadHeight:s}),t.inline?S7(2,n,0,Number.parseFloat(t.id),i,s):Ri(2,n,n,t.id,i),t.inline?S7(3,n*2,0,Number.parseFloat(t.id),i,s):Ri(3,n*2,0,t.id,i)],c=o/2,l=t.inline?n-0.09:n,h=0.2,d=0.2+c-r,u=Array.from({length:32},(A,g)=>{let f=Math.PI*g/31;return{x:l+c*Math.cos(f),y:0.2+c*Math.sin(f)}}),_={type:"pcb_silkscreen_path",layer:"top",pcb_component_id:"",pcb_silkscreen_path_id:"",stroke_width:0.12,route:[...u,{x:l-c,y:d},{x:l+c,y:d},u[0]]},p=Xo(l,0.2+c+1,0.5),m={type:"pcb_courtyard_outline",pcb_courtyard_outline_id:"",pcb_component_id:"",outline:t.inline?uer:der,layer:"top"};return{circuitJson:[...a,_,p,m],parameters:t}},_er=Fo.extend({fn:he("usbcmidmount"),num_pins:he(16).default(16),pinstart:j8.number().int().positive().default(1),split:Be().default(!1).describe("emit all 16 contact lands"),reverse:Be().default(!1).describe("number contact lands right-to-left"),noholes:Be().default(!1).describe("omit the two locator holes"),rowy:be.default("2.125mm").describe("contact pad row y position"),ph:be.default("1.1mm").describe("contact pad height"),pw:be.default("0.3mm").describe("signal contact pad width"),powerpw:be.default("0.55mm").describe("merged power pad width"),powerx:be.default("3.2mm").describe("outer merged power pad x"),shellx:be.default("4.325mm").describe("shell tab x position"),topy:be.default("1.575mm").describe("upper shell tab y position"),bottomy:be.default("2.625mm").describe("lower shell tab negative y magnitude"),tophw:be.default("0.6mm").describe("upper shell slot width"),tophh:be.default("1.5mm").describe("upper shell slot height"),topring:be.default("0.25mm").describe("upper shell annular ring"),bottomhw:be.default("0.6mm").describe("lower shell slot width"),bottomhh:be.default("1.2mm").describe("lower shell slot height"),bottomring:be.default("0.3mm").describe("lower shell annular ring"),holex:be.default("2.89mm").describe("locator hole x position"),holey:be.default("1.055mm").describe("locator hole y position"),holed:be.default("0.7mm").describe("locator hole diameter"),bodybottom:be.default("5.225mm").describe("connector body negative y extent")}),E5e=({pin:e,x:t,y:n,holeWidth:o,holeHeight:r,outerWidth:i,outerHeight:s})=>({type:"pcb_plated_hole",shape:"pill",pcb_plated_hole_id:"",pcb_component_id:"",pcb_port_id:"",x:t,y:n,hole_width:o,hole_height:r,outer_width:i,outer_height:s,ccw_rotation:0,layers:["top","bottom"],port_hints:[e.toString()]}),ger=(e)=>{let t=_er.parse(e),{pinstart:n,split:o,reverse:r,noholes:i,rowy:s,ph:a,pw:c,powerpw:l,powerx:h,shellx:d,topy:u,bottomy:_,tophw:p,tophh:m,topring:A,bottomhw:g,bottomhh:f,bottomring:y,holex:x,holey:C,holed:b,bodybottom:I}=t,v=i?[]:[-x,x].map((ne)=>({type:"pcb_hole",pcb_hole_id:"",pcb_component_id:"",hole_shape:"circle",hole_diameter:b,x:ne,y:C})),P=[E5e({pin:n,x:-d,y:u,holeWidth:p,holeHeight:m,outerWidth:p+2*A,outerHeight:m+2*A}),E5e({pin:n+1,x:d,y:u,holeWidth:p,holeHeight:m,outerWidth:p+2*A,outerHeight:m+2*A}),E5e({pin:n+2,x:-d,y:-_,holeWidth:g,holeHeight:f,outerWidth:g+2*y,outerHeight:f+2*y}),E5e({pin:n+3,x:d,y:-_,holeWidth:g,holeHeight:f,outerWidth:g+2*y,outerHeight:f+2*y})],M=Number((h-0.8).toFixed(12)),B=[-h,-M,-1.75,-1.25,-0.75,-0.25,0.25,0.75,1.25,1.75,M,h],N=o?[-3.35,-3.05,-2.55,-2.25,-1.75,-1.25,-0.75,-0.25,0.25,0.75,1.25,1.75,2.25,2.55,3.05,3.35]:B,D=r?N.slice().reverse():N,L=o?D.map(()=>c):D.map((ne,re)=>re<2||re>=D.length-2?l:c),H=D.map((ne,re)=>uo(n+4+re,ne,s,L[re],a)),V=Math.min(d-Math.max(p,g)/2-0.2,4.5),O=[fs([{x:-V,y:-_+f/2+y+0.2},{x:-V,y:u-m/2-A-0.2}]),fs([{x:V,y:-_+f/2+y+0.2},{x:V,y:u-m/2-A-0.2}]),fs([{x:-V,y:-I},{x:V,y:-I}])],U=Math.max(s+a/2,u+m/2+A),j=Math.min(-I,-_-f/2-y),Y=-d-Math.max(p+2*A,g+2*y)/2-0.25,X=-Y,K=U+0.25,J=j-0.25,ee=Xo(0,K+0.75,0.5),se={type:"pcb_courtyard_rect",pcb_courtyard_rect_id:"",pcb_component_id:"",center:{x:0,y:(K+J)/2},width:X-Y,height:K-J,layer:"top"};return{circuitJson:[...v,...P,...H,...O,ee,se],parameters:t}},v7=be.refine((e)=>Number.isFinite(e)&&e>0,"dimension must be finite and positive"),Aer=Fo.extend({fn:he("usba"),num_pins:he(4).default(4),tht:he(!0).default(!0),smd:he(!1).default(!1),pinstart:j8.number().int().positive().default(1),reverse:Be().default(!1),p:v7.default("2.5mm").describe("pitch within each outer contact pair"),centerp:v7.default("2mm").describe("pitch between the two inner contacts"),id:v7.default("0.92mm").describe("electrical contact drill diameter"),ring:v7.default("0.3mm").describe("electrical contact annular ring"),shieldspan:v7.default("13.14mm").describe("shell mounting-hole center span"),shieldy:be.refine(Number.isFinite,"dimension must be finite").default("-2.71mm").describe("signed shell row offset from the contact row"),shieldid:v7.default("2.3mm").describe("shell mounting-hole drill diameter"),shieldring:v7.default("0.3mm").describe("shell mounting-hole annular ring"),w:v7.default("13.1mm").describe("body width"),h:v7.default("13.85mm").describe("body length toward mating edge"),bodybottom:v7.default("12.99mm").describe("mating-edge distance from contact row")}).superRefine((e,t)=>{if(e.id+2*e.ring>=Math.min(e.p,e.centerp))t.addIssue({code:Vt.custom,path:["ring"],message:"contact lands must remain separate"});if(e.shieldid+2*e.shieldring>=e.shieldspan)t.addIssue({code:Vt.custom,path:["shieldring"],message:"shell mounting lands must remain separate"});if(e.bodybottom>e.h)t.addIssue({code:Vt.custom,path:["bodybottom"],message:"mating edge offset must fit within body length"})}),fer=(e)=>{let t=Aer.parse(e),{pinstart:n,reverse:o,p:r,centerp:i,id:s,ring:a,shieldspan:c,shieldy:l,shieldid:h,shieldring:d,w:u,h:_,bodybottom:p}=t,m=(L)=>Number(L.toFixed(12)),A=m(s+2*a),g=m(h+2*d),f=i/2,y=f+r,C=[-y,-f,f,y].map((L,H)=>Ri(n+H,m(o?-L:L),0,s,A)),b=[Ri(n+4,-c/2,l,h,g),Ri(n+5,c/2,l,h,g)],I=m(_-p),v=g/2+0.2,P=[[-p,Math.min(I,l-v)],[Math.max(-p,l+v),I]].filter(([L,H])=>H>L),M=[fs([{x:-u/2,y:-p},{x:u/2,y:-p}]),fs([{x:-u/2,y:I},{x:u/2,y:I}]),...P.flatMap(([L,H])=>[-u/2,u/2].map((V)=>fs([{x:V,y:L},{x:V,y:H}])))],B=Math.max(u/2,y+A/2,c/2+g/2),T=Math.max(I,A/2,l+g/2)+0.25,N=Math.min(-p,-A/2,l-g/2)-0.25,D={type:"pcb_courtyard_rect",pcb_courtyard_rect_id:"",pcb_component_id:"",center:{x:0,y:m((T+N)/2)},width:m(2*(B+0.25)),height:m(T-N),layer:"top"};return{circuitJson:[...C,...b,...M,Xo(0,T+0.55,0.5),D],parameters:t}},uA=be.refine((e)=>Number.isFinite(e)&&e>0,"dimension must be finite and positive"),oRt=be.refine(Number.isFinite,"dimension must be finite"),yer=Fo.extend({fn:he("usbmicro"),num_pins:he(5).default(5),frontflange:he(!0).default(!0),noflange:he(!1).default(!1),pinstart:j8.number().int().positive().default(1),reverse:Be().default(!1),p:uA.default("0.65mm").describe("electrical contact pitch"),pw:uA.default("0.4mm").describe("electrical contact pad width"),ph:uA.default("1.35mm").describe("electrical contact pad height"),rowy:oRt.default("2.675mm").describe("contact row from front slots"),rearspan:uA.default("5mm").describe("rear shell slot center span"),reary:oRt.default("2.7mm").describe("rear shell row from front slots"),rearhw:uA.default("0.85mm").describe("rear shell slot width"),rearhh:uA.default("0.55mm").describe("rear shell slot height"),rearring:uA.default("0.2mm").describe("rear shell annular ring"),frontspan:uA.default("7mm").describe("front shell slot center span"),fronthw:uA.default("0.5mm").describe("front shell slot width"),fronthh:uA.default("1.15mm").describe("front shell slot height"),frontpw:uA.default("1mm").describe("centered front shell land width"),frontph:uA.default("1.55mm").describe("centered front shell land height"),tabspan:uA.default("2mm").describe("inner shell SMT tab center span"),tabpw:uA.default("1.5mm").describe("inner shell SMT tab pad width"),tabph:uA.default("1.55mm").describe("inner shell SMT tab pad height"),w:uA.default("8mm").describe("body width including front flange"),bodytop:uA.default("2.7mm").describe("body extent behind front slots"),bodybottom:uA.default("2.3mm").describe("body extent toward mating edge")}).superRefine((e,t)=>{for(let[n,o,r]of[[e.pw>=e.p,"pw","contact pads must be narrower than pitch"],[e.frontpw<=e.fronthw,"frontpw","front land must surround slot width"],[e.frontph<=e.fronthh,"frontph","front land must surround slot height"],[e.tabpw>=e.tabspan,"tabpw","inner shell pads must remain separate"]])if(n)t.addIssue({code:Vt.custom,path:[o],message:r})}),xer=(e)=>{let t=yer.parse(e),{pinstart:n,reverse:o,p:r,pw:i,ph:s,rowy:a,rearspan:c,reary:l,rearhw:h,rearhh:d,rearring:u,frontspan:_,fronthw:p,fronthh:m,frontpw:A,frontph:g,tabspan:f,tabpw:y,tabph:x,w:C,bodytop:b,bodybottom:I}=t,v=(j)=>Number(j.toFixed(12)),P=Array.from({length:5},(j,Y)=>uo(n+Y,v((o?2-Y:Y-2)*r),a,i,s)),M=(j,Y,X,K,J,ee,se)=>({type:"pcb_plated_hole",shape:"pill",pcb_plated_hole_id:"",pcb_component_id:"",pcb_port_id:"",x:Y,y:X,hole_width:K,hole_height:J,outer_width:v(ee),outer_height:v(se),ccw_rotation:0,layers:["top","bottom"],port_hints:[String(j)]}),B=[M(n+5,-c/2,l,h,d,h+2*u,d+2*u),M(n+6,c/2,l,h,d,h+2*u,d+2*u),M(n+7,-_/2,0,p,m,A,g),M(n+8,_/2,0,p,m,A,g)],T=[uo(n+9,-f/2,0,y,x),uo(n+10,f/2,0,y,x)],N=Math.max(g,x)/2+0.2,D=[[-I,Math.min(b,-N)],[Math.max(-I,N),b]].filter(([j,Y])=>Y>j),L=[fs([{x:-C/2,y:-I},{x:C/2,y:-I}]),...D.flatMap(([j,Y])=>[-C/2,C/2].map((X)=>fs([{x:X,y:j},{x:X,y:Y}])))],H=Math.max(C/2,2*r+i/2,c/2+h/2+u,_/2+A/2,f/2+y/2),V=Math.max(b,a+s/2,l+d/2+u,g/2,x/2)+0.25,O=Math.min(-I,a-s/2,l-d/2-u,-g/2,-x/2)-0.25,U={type:"pcb_courtyard_rect",pcb_courtyard_rect_id:"",pcb_component_id:"",center:{x:0,y:v((V+O)/2)},width:v(2*(H+0.25)),height:v(V-O),layer:"top"};return{circuitJson:[...P,...B,...T,...L,Xo(0,V+0.55,0.5),U],parameters:t}},_ws=Q5e.extend({}).transform(k5e),Cer=(e)=>{if(e.legsoutside=!1,!e.pl)e.pl=1;if(!e.pw)e.pw=0.6;return CR(e)},ber=(e,t)=>{let n=e.filter((o)=>o.type==="pcb_silkscreen_text");if(n.length===0)return e;for(let o of n)if(t.norefdes)o.text="";return e},Ier=(e,t)=>{if(!t.nosilkscreen)return e;return e.filter((n)=>n.type!=="pcb_silkscreen_path"&&n.type!=="pcb_silkscreen_text")},ver=(e,t)=>{if(!t)return e;let n=e.filter((h)=>h.type==="pcb_smtpad"||h.type==="pcb_plated_hole");if(n.length===0)return e;let{POSITIVE_INFINITY:o,NEGATIVE_INFINITY:r,POSITIVE_INFINITY:i,NEGATIVE_INFINITY:s}=Number,a=(h,d,u=0,_=0)=>{let p=h-u/2,m=h+u/2,A=d-_/2,g=d+_/2;o=Math.min(o,p),r=Math.max(r,m),i=Math.min(i,A),s=Math.max(s,g)};for(let h of n)if(h.type==="pcb_smtpad"){if(h.shape==="polygon"){for(let _ of h.points)a(_.x,_.y);continue}let d=h.shape==="circle"?h.radius*2:h.width,u=h.shape==="circle"?h.radius*2:h.height;if(h.shape==="rotated_rect"){let _=h.ccw_rotation*Math.PI/180,p=Math.abs(Math.cos(_)),m=Math.abs(Math.sin(_));[d,u]=[d*p+u*m,d*m+u*p]}a(h.x,h.y,d,u)}else if(h.type==="pcb_plated_hole"){let d=h.outer_diameter??h.hole_diameter;a(h.x,h.y,d,d)}let c=0,l=0;switch(t){case"center":c=(o+r)/2,l=(i+s)/2;break;case"bottomleft":c=o,l=i;break;case"bottomcenter":case"centerbottom":c=(o+r)/2,l=i;break;case"topcenter":case"centertop":c=(o+r)/2,l=s;break;case"leftcenter":case"centerleft":c=o,l=(i+s)/2;break;case"rightcenter":case"centerright":c=r,l=(i+s)/2;break;case"pin1":{let h=n.find((d)=>d.port_hints?.[0]==="1")||n[0];c=h.x,l=h.y;break}}if(c===0&&l===0)return e;for(let h of e){if(typeof h.x==="number")h.x-=c;if(typeof h.y==="number")h.y-=l;if(h.center&&typeof h.center.x==="number")h.center.x-=c,h.center.y-=l;for(let d of["points","outline","route"]){if(!Array.isArray(h[d]))continue;for(let u of h[d])u.x-=c,u.y-=l}if((h.type==="pcb_silkscreen_text"||h.type==="pcb_fabrication_note_text")&&h.anchor_position)h.anchor_position.x-=c,h.anchor_position.y-=l}return e},Ser=[0,90,180,270],T5e=(e,t)=>{switch(t){case 90:return{x:-e.y,y:e.x};case 180:return{x:-e.x,y:-e.y};case 270:return{x:e.y,y:-e.x};default:return{...e}}},rRt=(e)=>{if(typeof e.x==="number"&&typeof e.y==="number")return{x:e.x,y:e.y};if(Array.isArray(e.points)&&e.points.length>0){let t=e.points.map((o)=>o.x),n=e.points.map((o)=>o.y);return{x:(Math.min(...t)+Math.max(...t))/2,y:(Math.min(...n)+Math.max(...n))/2}}return null},Per=(e)=>e.port_hints?.some((t)=>/^(?:pin)?1$/i.test(String(t))),Eer=(e,t,[n,o])=>{let r=e.map((g)=>g.x),i=e.map((g)=>g.y),s=Math.min(...r),a=Math.max(...r),c=Math.min(...i),l=Math.max(...i),h=(s+a)/2,d=(c+l)/2,u=a-s,_=l-c,p=Math.max(u,_,1)*0.000001,m=n==="leftside"&&Math.abs(t.x-s)<=p||n==="rightside"&&Math.abs(t.x-a)<=p||n==="topside"&&Math.abs(t.y-l)<=p||n==="bottomside"&&Math.abs(t.y-c)<=p,A=o==="left"&&(u<=p||t.x<h-p)||o==="right"&&(u<=p||t.x>h+p)||o==="top"&&(_<=p||t.y>d+p)||o==="bottom"&&(_<=p||t.y<d-p);return m&&A},fGe=(e,t)=>{if(!e||typeof e!=="object"||typeof e.x!=="number"||typeof e.y!=="number")return;let n=T5e(e,t);e.x=n.x,e.y=n.y},M5e=(e)=>(e%360+360)%360,Mer=(e,t)=>{switch(e.shape){case"rect":return{...e,shape:"rotated_rect",ccw_rotation:M5e(t)};case"pill":return{...e,shape:"rotated_pill",ccw_rotation:M5e(t)};case"rotated_rect":case"rotated_pill":return{...e,ccw_rotation:M5e(e.ccw_rotation+t)};default:return e}},wer=(e,t)=>{if(t===0)return e;return e.map((n)=>{let o=structuredClone(n);if(typeof o.x==="number"&&typeof o.y==="number"){let r=T5e(o,t);o.x=r.x,o.y=r.y}fGe(o.center,t),fGe(o.anchor_position,t);for(let r of["route","outline","points"]){if(!Array.isArray(o[r]))continue;for(let i of o[r])fGe(i,t)}if(o.type==="pcb_smtpad")return Mer(o,t);if(o.type==="pcb_plated_hole"||o.type==="pcb_silkscreen_text"||o.type==="pcb_fabrication_note_text")o.ccw_rotation=M5e(Number(o.ccw_rotation??0)+t);if((t===90||t===270)&&(o.type==="pcb_courtyard_rect"||o.type==="pcb_silkscreen_rect"||o.type==="pcb_fabrication_note_rect"||o.type==="pcb_cutout"&&o.shape==="rect"))[o.width,o.height]=[o.height,o.width];return o})},Ber=(e,t)=>{if(!t)return e;let n=e.filter((a)=>a.type==="pcb_smtpad"||a.type==="pcb_plated_hole"),o=n.find(Per),r=n.map(rRt).filter((a)=>a!==null),i=o?rRt(o):null;if(!o||!i||r.length===0)throw Error(`pin1location(${t.join(",")}) requires a footprint with a pad whose port_hints contain "1" or "pin1"`);let s=Ser.find((a)=>{let c=r.map((h)=>T5e(h,a)),l=T5e(i,a);return Eer(c,l,t)});if(s===void 0)throw Error(`pin1location(${t.join(",")}) cannot be reached with a rotation; the requested location may be the mirrored orientation of this footprint`);return wer(e,s)},iRt=(e,t,n)=>Math.min(e,t/2,n/2),Ter=(e,t)=>{if(t===void 0)return e;let n=Ni(t);if(!Number.isFinite(n)||n<0)throw Error(`rounded radius must be a non-negative length, got "${t}"`);for(let o of e){if(o.type==="pcb_smtpad"&&(o.shape==="rect"||o.shape==="rotated_rect"))o.corner_radius=iRt(n,o.width,o.height);if(o.type==="pcb_plated_hole"&&"rect_pad_width"in o&&"rect_pad_height"in o)o.rect_border_radius=iRt(n,o.rect_pad_width,o.rect_pad_height)}return e};function Der(e){return e!==null&&e!==void 0}var Ner=(e)=>e.trim().replace(/^do-219ad(?=_|$)/i,"do219ad").replace(/^sod-323he(?=_|$)/i,"sod323he").replace(/^pinheader(?=[\d_]|$)/i,"pinrow").replace(/^d2pak(\d+)(?=_|$)/i,"d2pak_$1").replace(/^to-252(?:-(\d+))?(?=_|$)/i,(t,n)=>n?`to252_${n}`:"to252").replace(/^to-263(?:-(\d+))?(?=_|$)/i,(t,n)=>n?`to263_${n}`:"to263").replace(/^sot-23(?:-(\d+))?(?=_|$)/i,(t,n)=>n?`sot23_${n}`:"sot23").replace(/^sot23-(\d+)(?=_|$)/i,"sot23_$1").replace(/^sot-223-(\d+)(?=_|$)/i,"sot223_$1").replace(/^to-220f-(\d+)(?=_|$)/i,"to220f_$1").replace(/^jst_(ph|sh|zh|xh)_(\d+)(?=_|$)/i,"jst$2_$1"),Rer=(e)=>e.replace(/([+-]?(?:\d+(?:\.\d*)?|\.\d+))\s*(?:um|µm)(?=$|[x,() ])/gi,(t)=>`${Number(be.parse(t).toPrecision(12))}mm`),Qer=(e)=>{let t=L5e(),n=Ner(e),r=n.replace(/^((?:\d{4}|\d{5}))(?=$|_|x)/,"res$1").replace(/^zh(\d+)(?=$|_)/,"jst$1_zh").split(/_(?!metric)/).map((i)=>{let s=i.match(/^(pin1location)(\(.*\))$/i);if(s)return{fn:s[1].toLowerCase(),v:s[2]};let a=i.match(/((?:(?:p\d+|pin1)[a-zA-Z]+(?=[\(\d\.\+\-\?]))|[a-zA-Z]+)([\(\d\.\+\-\?].*)?/);if(!a)return null;let[,c,l]=a;if(!c)return null;let h=c.toLowerCase();if(l?.includes("?"))return null;return{fn:h,v:l}}).filter(Der);for(let{fn:i,v:s}of r)t=t[i](s);return t.setString(n),t},ker=()=>Object.keys(JM);var L5e=()=>{let e=new Proxy({},{get:(t,n)=>{if(n==="soup"||n==="circuitJson"){if("fn"in t&&JM[t.fn])return()=>{let{circuitJson:o}=JM[t.fn](t),r=Ier(o,t),i=ber(r,t),s=Ber(i,t.pin1location?sRt.parse(t.pin1location):void 0),a=Ter(s,t.rounded);return ver(a,t.origin)};if(!JM[t.fn])throw Error(`Invalid footprint function, got "${t.fn}"${t.string?`, from string "${t.string}"`:""}`);return()=>{throw Error(`No function found for footprinter, make sure to specify .dip, .lr, .p, etc. Got "${n}"`)}}if(n==="json"){if(!JM[t.fn])throw Error(`Invalid footprint function, got "${t.fn}"${t.string?`, from string "${t.string}"`:""}`);return()=>JM[t.fn](t).parameters}if(n==="getFootprintNames")return()=>Object.keys(JM);if(n==="params")return()=>t;if(n==="setString")return(o)=>(t.string=o,e);return(...o)=>{let r=o[0],i=typeof r==="string"?Rer(r):r;if(Object.keys(t).length===0)if(`${n}${r}`in JM)t[`${n}${r}`]=!0,t.fn=`${n}${r}`;else if(t[n]=!0,t.fn=n,n==="res"||n==="cap"||n==="led"||n==="diode"){if(r)if(typeof r==="string"&&r.includes("_metric"))t.metric=r.split("_metric")[0];else t.imperial=r}else t.num_pins=Number.isNaN(Number.parseFloat(r))?void 0:Number.parseFloat(r);else if(!r&&["w","h","p"].includes(n));else t[n]=n==="pin1location"&&o.length>1?o:i??!0;return e}}});return e};L5e.string=Qer;L5e.getFootprintNames=ker;var Kl=L5e;Kt();var qxn=Qe(p0(),1);Kt();var ORt=Qe(p0(),1),GRt=Qe(p0(),1),WRt=Qe(p0(),1);Kt();PAe();var wRt=Qe(wt(),1),bGe=(e,t={})=>{let n=e._internal_store;if(!n){n={counts:{}},e._internal_store=n;for(let r of e){let i=r.type,s=r[`${i}_id`];if(!s)continue;let a=Number.parseInt(s.split("_").pop());if(!Number.isNaN(a))n.counts[i]=Math.max(n.counts[i]??0,a)}}return new Proxy({},{get:(r,i)=>{if(i==="toArray")return()=>e;return{get:(s)=>e.find((a)=>a.type===i&&a[`${i}_id`]===s),getUsing:(s)=>{let a=Object.keys(s);if(a.length!==1)throw Error("getUsing requires exactly one key, e.g. { pcb_component_id }");let c=a[0],l=c.replace("_id",""),h=e.find((d)=>d.type===l&&d[c]===s[c]);if(!h)return null;return e.find((d)=>d.type===i&&d[`${i}_id`]===h[`${i}_id`])},getWhere:(s)=>{let a=Object.keys(s);return e.find((c)=>c.type===i&&a.every((l)=>c[l]===s[l]))},list:(s)=>{let a=!s?[]:Object.keys(s);return e.filter((c)=>c.type===i&&a.every((l)=>c[l]===s[l]))},insert:(s)=>{n.counts[i]??=-1,n.counts[i]++;let a=n.counts[i],c={type:i,[`${i}_id`]:`${i}_${a}`,...s};if(t.validateInserts)(PN[i]??SN).parse(c);return e.push(c),c},delete:(s)=>{let a=e.find((c)=>c[`${i}_id`]===s);if(!a)return;e.splice(e.indexOf(a),1)},update:(s,a)=>{let c=e.find((l)=>l.type===i&&l[`${i}_id`]===s);if(!c)return;return Object.assign(c,a),c},select:(s)=>{if(i==="source_component")return e.find((a)=>a.type==="source_component"&&a.name===s.replace(/\./g,""));else if(i==="pcb_port"||i==="source_port"||i==="schematic_port"){let[a,c]=s.replace(/\./g,"").split(/[\s\>]+/),l=e.find((d)=>d.type==="source_component"&&d.name===a);if(!l)return null;let h=e.find((d)=>d.type==="source_port"&&d.source_component_id===l.source_component_id&&(d.name===c||(d.port_hints??[]).includes(c)));if(!h)return null;if(i==="source_port")return h;if(i==="pcb_port")return e.find((d)=>d.type==="pcb_port"&&d.source_port_id===h.source_port_id);else if(i==="schematic_port")return e.find((d)=>d.type==="schematic_port"&&d.source_port_id===h.source_port_id)}}}}})};bGe.unparsed=bGe;var pA=bGe;tc();var Ger=Qe(TRt(),1);tc();tc();var DRt="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";var NRt=(e=21)=>{let t="",n=crypto.getRandomValues(new Uint8Array(e|=0));while(e--)t+=DRt[n[e]&63];return t};tc();var Zz=(e,t)=>Math.abs(e.x-t.x)+Math.abs(e.y-t.y),RRt=(e,t)=>{let n=t.x-e.x,o=t.y-e.y;if(Math.abs(n)>Math.abs(o))return{dx:Math.sign(n),dy:0};else return{dx:0,dy:Math.sign(o)}},FRt=(e,t,n)=>Math.abs(e.x-t.x)*Math.abs(n.dx)+Math.abs(e.y-t.y)*Math.abs(n.dy),zRt=(e,t=0.1)=>`${Math.round(e.x/t)},${Math.round(e.y/t)}`,QRt=(e,t)=>Math.abs(e-t)<0.0001,VRt=(e,t,{viaDiameter:n=0.5}={})=>{let o=[];for(let r=0;r<e.length-1;r++){let[i,s]=[e[r],e[r+1]],a=r-1>=0?e[r-1]:null,c=QRt(i.y,s.y),l=QRt(i.x,s.x);if(!c&&!l)throw Error(`getObstaclesFromTrace currently only supports horizontal and vertical traces (not diagonals) Conflicting trace: ${t}, start: (${i.x}, ${i.y}), end: (${s.x}, ${s.y})`);let h={type:"rect",layers:[i.layer],center:{x:(i.x+s.x)/2,y:(i.y+s.y)/2},width:c?Math.abs(i.x-s.x):0.1,height:l?Math.abs(i.y-s.y):0.1,connectedTo:[t]};if(o.push(h),a&&a.layer===i.layer&&i.layer!==s.layer){let d={type:"rect",layers:[i.layer,s.layer],center:{x:i.x,y:i.y},connectedTo:[t],width:n,height:n};o.push(d)}}return o},YRt=class{obstacles;GRID_STEP=0.1;constructor(e){this.obstacles=e.map((t)=>({...t,left:t.center.x-t.width/2,right:t.center.x+t.width/2,top:t.center.y+t.height/2,bottom:t.center.y-t.height/2}))}getObstacleAt(e,t,n){n??=this.GRID_STEP;for(let o of this.obstacles){let r=o.width/2+n,i=o.height/2+n;if(e>=o.center.x-r&&e<=o.center.x+r&&t>=o.center.y-i&&t<=o.center.y+i)return o}return null}isObstacleAt(e,t,n){return this.getObstacleAt(e,t,n)!==null}getDirectionDistancesToNearestObstacle(e,t){let{GRID_STEP:n}=this,o={left:1/0,top:1/0,bottom:1/0,right:1/0};for(let r of this.obstacles)if(r.type==="rect"){let i=r.center.x-r.width/2-n,s=r.center.x+r.width/2+n,a=r.center.y+r.height/2+n,c=r.center.y-r.height/2-n;if(t>=c&&t<=a&&e>i)o.left=Math.min(o.left,e-s);if(t>=c&&t<=a&&e<s)o.right=Math.min(o.right,i-e);if(e>=i&&e<=s&&t<a)o.top=Math.min(o.top,c-t);if(e>=i&&e<=s&&t>c)o.bottom=Math.min(o.bottom,t-a)}return o}getOrthoDirectionCollisionInfo(e,t,{margin:n=0}={}){let{x:o,y:r}=e,{dx:i,dy:s}=t,a=1/0,c=null;for(let l of this.obstacles){let h=l.left-n,d=l.right+n,u=l.top+n,_=l.bottom-n,p=null;if(i===1&&s===0){if(r>_&&r<u&&o<l.left)p=l.left-o}else if(i===-1&&s===0){if(r>_&&r<u&&o>l.right)p=o-l.right}else if(i===0&&s===1){if(o>h&&o<d&&r<l.bottom)p=l.bottom-r}else if(i===0&&s===-1){if(o>h&&o<d&&r>l.top)p=r-l.top}if(p!==null&&p<a)a=p,c=l}return{dx:i,dy:s,wallDistance:a,obstacle:c}}getObstaclesOverlappingRegion(e){let t=[];for(let n of this.obstacles){let{left:o,right:r,top:i,bottom:s}=n;if(o<=e.maxX&&r>=e.minX&&i<=e.maxY&&s>=e.minY)t.push(n)}return t}};function Ler(e){if(e.length<4)return e;let t=[{...e[0]}],n=e[0].layer;for(let o=1;o<e.length;o++){let r={start:e[o-1],end:e[o]},i=e[o].route_type==="via"||e[o-1].route_type==="via";if(e[o].layer!==n||i){t.push({...e[o]}),n=e[o].layer;continue}let s=!1,a=null,c=-1;for(let h=0;h<t.length-1;h++){let d={start:t[h],end:t[h+1]};if(d.start.layer!==r.start.layer)continue;if(d.start.layer===r.start.layer){let u=Her(d,r);if(u){s=!0,a={...u,layer:n},c=h;break}}}if(s&&a)t.splice(c+1),t.push(a);let l=t[t.length-1];if(l.x!==e[o].x||l.y!==e[o].y)t.push(e[o])}return t}function Her(e,t){if(e.start.x===e.end.x&&t.start.x===t.end.x||e.start.y===e.end.y&&t.start.y===t.end.y)return null;let n;if(e.start.x===e.end.x){let o=e.start.x,r=t.start.y;n={...e.start,x:o,y:r}}else{let o=t.start.x,r=e.start.y;n={...e.start,x:o,y:r}}if(kRt(n,e)&&kRt(n,t))return n;return null}function kRt(e,t){return e.x>=Math.min(t.start.x,t.end.x)&&e.x<=Math.max(t.start.x,t.end.x)&&e.y>=Math.min(t.start.y,t.end.y)&&e.y<=Math.max(t.start.y,t.end.y)}function Fer(e){let t=[e[0]];for(let n=1;n<e.length-1;n++){let[o,r,i]=[e[n-1],e[n],e[n+1]];if(t.push(r),r.route_type!=="wire"||o.route_type!=="wire"||i.route_type!=="wire")continue;if(o.layer===r.layer&&r.layer!==i.layer)t.push({route_type:"via",from_layer:r.layer,to_layer:i.layer,x:r.x,y:r.y})}return t.push(e[e.length-1]),t}var Sws=GRt.default("autorouter:shortenPathWithShortcuts");function zer(e,t){if(e.length<=2)return e;let n=[e[0]];for(let o=1;o<e.length;o++){let r={start:n[n.length-1],end:e[o]},i=-1,s=r.start.x===r.end.x,a=r.start.y===r.end.y;for(let c=o+1;c<e.length;c++){if(c<=i)continue;let l={start:e[c],end:e[c+1]};if(!l.end)continue;let h=l.start.x===l.end.x,d=l.start.y===l.end.y,u=s&&h,_=a&&d;if(_&&u)continue;if(!(u||_))continue;let m=!1,A=Math.min(r.start.x,r.end.x),g=Math.max(r.start.x,r.end.x),f=Math.min(l.start.x,l.end.x),y=Math.max(l.start.x,l.end.x),x=Math.min(r.start.y,r.end.y),C=Math.max(r.start.y,r.end.y),b=Math.min(l.start.y,l.end.y),I=Math.max(l.start.y,l.end.y);if(_)m=A<=y&&g>=f;else if(u)m=x<=I&&C>=b;if(!m)continue;let v=[],P=n[n.length-1],M=e[c+2];if(!M)continue;if(_&&f<g&&M.x===f)v.push({x:f,y:r.start.y,layer:r.start.layer});if(_&&y>A&&M.x===y)v.push({x:y,y:r.start.y,layer:r.start.layer});if(u&&b<C&&M.y===b)v.push({x:r.start.x,y:b,layer:r.start.layer});if(u&&I>x&&M.y===I)v.push({x:r.start.x,y:I,layer:r.start.layer});let B=null;for(let T of v){if(t(P,T)||t(M,T))continue;B=T;break}if(!B)continue;n.push(B),o=c+1,i=c+1;break}if(i===-1)n.push(e[o])}if(n[n.length-1]!==e[e.length-1])n.push(e[e.length-1]);return n}var Jz=ORt.default("autorouting-dataset:astar"),URt=class{openSet=[];closedSet=new Set;debug=!1;debugSolutions;debugMessage=null;debugTraceCount=0;input;obstacles;allObstacles;startNode;goalPoint;GRID_STEP;OBSTACLE_MARGIN;MAX_ITERATIONS;isRemovePathLoopsEnabled;isShortenPathWithShortcutsEnabled;GREEDY_MULTIPLIER=1.1;iterations=-1;constructor(e){if(this.input=e.input,this.allObstacles=e.input.obstacles,this.startNode=e.startNode,this.goalPoint=e.goalPoint?{l:0,...e.goalPoint}:void 0,this.GRID_STEP=e.GRID_STEP??0.1,this.OBSTACLE_MARGIN=e.OBSTACLE_MARGIN??0.15,this.MAX_ITERATIONS=e.MAX_ITERATIONS??100,this.debug=e.debug??Jz.enabled,this.isRemovePathLoopsEnabled=e.isRemovePathLoopsEnabled??!1,this.isShortenPathWithShortcutsEnabled=e.isShortenPathWithShortcutsEnabled??!1,this.debug)Jz.enabled=!0;if(Jz.enabled)this.debugSolutions={},this.debugMessage=""}getNeighbors(e){return[]}isSameNode(e,t){return Zz(e,t)<this.GRID_STEP}computeG(e,t){return e.g+Zz(e,t)}computeH(e){return Zz(e,this.goalPoint)}getNodeName(e){return zRt(e,this.GRID_STEP)}solveOneStep(){this.iterations+=1;let{openSet:e,closedSet:t,GRID_STEP:n,goalPoint:o}=this;e.sort((a,c)=>a.f-c.f);let r=e.shift();if(this.computeH(r)<=n*2)return{solved:!0,current:r,newNeighbors:[]};this.closedSet.add(this.getNodeName(r));let s=[];for(let a of this.getNeighbors(r)){if(t.has(this.getNodeName(a)))continue;let c=this.computeG(r,a),l=this.openSet.find((h)=>this.isSameNode(h,a));if(!l||c<l.g){let h=this.computeH(a),d=c+h*this.GREEDY_MULTIPLIER,u={...a,g:c,h,f:d,obstacleHit:a.obstacleHit??void 0,manDistFromParent:Zz(r,a),nodesInPath:r.nodesInPath+1,parent:r,enterMarginCost:a.enterMarginCost,travelMarginCostFactor:a.travelMarginCostFactor};e.push(u),s.push(u)}}if(Jz.enabled)e.sort((a,c)=>a.f-c.f),this.drawDebugSolution({current:r,newNeighbors:s});return{solved:!1,current:r,newNeighbors:s}}getStartNode(e){return{x:e.pointsToConnect[0].x,y:e.pointsToConnect[0].y,manDistFromParent:0,f:0,g:0,h:0,nodesInPath:0,parent:null}}layerToIndex(e){return 0}indexToLayer(e){return"top"}preprocessConnectionBeforeSolving(e){return e}solveConnection(e){if(e.pointsToConnect.length>2)throw Error("GeneralizedAstarAutorouter doesn't currently support 2+ points in a connection");e=this.preprocessConnectionBeforeSolving(e);let{pointsToConnect:t}=e;this.iterations=0,this.closedSet=new Set,this.startNode=this.getStartNode(e),this.goalPoint={...t[t.length-1],l:this.layerToIndex(t[t.length-1].layer)},this.openSet=[this.startNode];while(this.iterations<this.MAX_ITERATIONS){let{solved:n,current:o}=this.solveOneStep();if(n){let r=[],i=o;while(i){let s=i.l;r.unshift({x:i.x,y:i.y,layer:s!==void 0?this.indexToLayer(s):t[0].layer}),i=i.parent}if(Jz.enabled)this.debugMessage+=`t${this.debugTraceCount}: ${this.iterations} iterations
`;if(this.isRemovePathLoopsEnabled)r=Ler(r);if(this.isShortenPathWithShortcutsEnabled)r=zer(r,(s,a)=>{if(s.x===a.x&&s.y===a.y)return!1;let c=this.obstacles.getOrthoDirectionCollisionInfo({x:s.x,y:s.y,l:this.layerToIndex(s.layer)??0},{dx:Math.sign(a.x-s.x),dy:Math.sign(a.y-s.y),dl:0},{margin:0.05}),l=Math.sqrt((s.x-a.x)**2+(s.y-a.y)**2);return c.wallDistance<l});return{solved:!0,route:r,connectionName:e.name}}if(this.openSet.length===0)break}if(Jz.enabled)this.debugMessage+=`t${this.debugTraceCount}: ${this.iterations} iterations (failed)
`;return{solved:!1,connectionName:e.name}}createObstacleList({dominantLayer:e,connection:t,obstaclesFromTraces:n}){return new YRt(this.allObstacles.filter((o)=>!o.connectedTo.includes(t.name)).filter((o)=>o.layers.includes(e)).concat(n??[]))}postprocessConnectionSolveResult(e,t){return t}solve(){let e=[],t=[];this.debugTraceCount=0;for(let n of this.input.connections){let o=n.pointsToConnect[0].layer??"top";this.debugTraceCount+=1,this.obstacles=this.createObstacleList({dominantLayer:o,connection:n,obstaclesFromTraces:t});let r=this.solveConnection(n);if(r=this.postprocessConnectionSolveResult(n,r),e.push(r),Jz.enabled)this.drawDebugTraceObstacles(t);if(r.solved)t.push(...VRt(r.route.map((i)=>({x:i.x,y:i.y,layer:i.layer??o})),n.name))}return e}solveAndMapToTraces(){return this.solve().flatMap((t)=>{if(!t.solved)return[];return[{type:"pcb_trace",pcb_trace_id:`pcb_trace_for_${t.connectionName}`,route:Fer(t.route.map((n)=>({route_type:"wire",x:n.x,y:n.y,width:this.input.minTraceWidth,layer:n.layer})))}]})}getDebugGroup(){let e=`t${this.debugTraceCount}_iter[${this.iterations-1}]`;if(this.iterations<30)return e;if(this.iterations<100&&this.iterations%10===0)return e;if(this.iterations<1000&&this.iterations%100===0)return e;if(!this.debugSolutions)return e;return null}drawDebugTraceObstacles(e){let{debugTraceCount:t,debugSolutions:n}=this;for(let o in n)if(o.startsWith(`t${t}_`))n[o].push(...e.map((r,i)=>({type:"pcb_smtpad",pcb_component_id:"",layer:r.layers[0],width:r.width,shape:"rect",x:r.center.x,y:r.center.y,pcb_smtpad_id:`trace_obstacle_${i}`,height:r.height})))}drawDebugSolution({current:e,newNeighbors:t}){let n=this.getDebugGroup();if(!n)return;let{openSet:o,debugTraceCount:r,debugSolutions:i}=this;i[n]??=[];let s=i[n];s.push({type:"pcb_fabrication_note_text",pcb_fabrication_note_text_id:`debug_note_${e.x}_${e.y}`,font:"tscircuit2024",font_size:0.25,text:"X"+(e.l!==void 0?e.l:""),pcb_component_id:"",layer:"top",anchor_position:{x:e.x,y:e.y},anchor_alignment:"center"});for(let a=0;a<o.length;a++){let c=o[a];s.push({type:"pcb_fabrication_note_path",pcb_component_id:"",pcb_fabrication_note_path_id:`note_path_${c.x}_${c.y}`,layer:"top",route:[[0,0.05],[0.05,0],[0,-0.05],[-0.05,0],[0,0.05]].map(([l,h])=>({x:c.x+l,y:c.y+h})),stroke_width:0.01}),s.push({type:"pcb_fabrication_note_text",pcb_fabrication_note_text_id:`debug_note_${c.x}_${c.y}`,font:"tscircuit2024",font_size:0.03,text:a.toString(),pcb_component_id:"",layer:"top",anchor_position:{x:c.x,y:c.y},anchor_alignment:"center"})}if(e.parent){let a=[],c=e;while(c)a.unshift(c),c=c.parent;s.push({type:"pcb_fabrication_note_path",pcb_component_id:"",pcb_fabrication_note_path_id:`note_path_${e.x}_${e.y}`,layer:"top",route:a,stroke_width:0.01})}}},Oer=WRt.default("autorouting-dataset:infinite-grid-ijump-astar:get-distance-to-overcome-obstacle");function IGe({node:e,travelDir:t,wallDir:n,obstacle:o,obstacles:r,obstaclesInRow:i=0,OBSTACLE_MARGIN:s=0.15,SHOULD_DETECT_CONJOINED_OBSTACLES:a=!1,MAX_CONJOINED_OBSTACLES:c=20}){let l;if(t.dx===0)if(t.dy>0)l=o.center.y+o.height/2-e.y;else l=e.y-(o.center.y-o.height/2);else if(t.dx>0)l=o.center.x+o.width/2-e.x;else l=e.x-(o.center.x-o.width/2);if(l+=s,a&&i<c){let h=r.getObstacleAt(e.x+t.dx*l+n.dx*(n.wallDistance+0.001),e.y+t.dy*l+n.dy*(n.wallDistance+0.001));if(h===o)return l;if(h&&h.type==="rect"){let d=t.dy===0,u=d?o.height:o.width;if((d?h.height:h.width)>u)return Oer("next obstacle on path is bigger, not trying to overcome it"),l;let p=IGe({node:{x:e.x+t.dx*l,y:e.y+t.dy*l},travelDir:t,wallDir:n,obstacle:h,obstacles:r,obstaclesInRow:i+1,SHOULD_DETECT_CONJOINED_OBSTACLES:a,MAX_CONJOINED_OBSTACLES:c,OBSTACLE_MARGIN:s});l+=p}}return l}var Ver=class extends URt{MAX_ITERATIONS=200;getNeighbors(e){let t=this.obstacles,n=this.goalPoint,o;if(!e.parent)o=RRt(e,n);else o=RRt(e.parent,e);let r=[{dx:0,dy:1},{dx:1,dy:0},{dx:0,dy:-1},{dx:-1,dy:0}].filter((s)=>{if(s.dx===o.dx*-1&&s.dy===o.dy*-1)return!1;else if(s.dx===o.dx&&s.dy===o.dy&&e.parent?.obstacleHit)return!1;return!0}).map((s)=>t.getOrthoDirectionCollisionInfo(e,s,{margin:this.OBSTACLE_MARGIN})).filter((s)=>s.wallDistance>=this.OBSTACLE_MARGIN),i=[];for(let s of r){let a=null;if(e?.obstacleHit)a=IGe({node:e,travelDir:s,wallDir:{...o,wallDistance:this.OBSTACLE_MARGIN},obstacle:e.obstacleHit,obstacles:t,OBSTACLE_MARGIN:this.OBSTACLE_MARGIN,SHOULD_DETECT_CONJOINED_OBSTACLES:!0});let c=FRt(e,n,s),l=(s.dx===0||Math.sign(n.x-e.x)===s.dx)&&(s.dy===0||Math.sign(n.y-e.y)===s.dy);if(c<s.wallDistance&&c>0&&l)i.push({...s,travelDistance:c});else if(a!==null&&a<s.wallDistance)i.push({...s,travelDistance:a});else if(s.wallDistance!==1/0)i.push({...s,travelDistance:s.wallDistance-this.OBSTACLE_MARGIN})}return i.filter((s)=>!t.isObstacleAt(e.x+s.dx*s.travelDistance,e.y+s.dy*s.travelDistance)).map((s)=>({x:e.x+s.dx*s.travelDistance,y:e.y+s.dy*s.travelDistance,obstacleHit:s.obstacle}))}};function Yer(e,t=4){let{center:n,width:o,height:r,rotation:i}=e,s=[],a=i*Math.PI/180,c=Math.cos(a),l=Math.sin(a),h=(i%360+360)%360;if(r<=o?h>=45&&h<135||h>=225&&h<315:h>=135&&h<225||h>=315||h<45){let u=o/t;for(let _=0;_<t;_++){let p=(_-t/2+0.5)*u,m=-p*c,A=-p*l,g=u*1.1,f=Math.abs(r*c)+Math.abs(u*l);s.push({center:{x:n.x+m,y:n.y+A},width:g,height:f})}}else{let u=r/t;for(let _=0;_<t;_++){let p=(_-t/2+0.5)*u,m=-p*l,A=p*c,g=Math.abs(o*c)+Math.abs(u*l),f=u*1.1;s.push({center:{x:n.x+m,y:n.y+A},width:g,height:f})}}return s}var H5e=["top","inner1","inner2","bottom"],XRt=(e,t)=>{let n=(r)=>t?r.concat(r.map((i)=>t?.getNetConnectedToId(i)).filter(Boolean)):r,o=[];for(let r of e)if(r.type==="pcb_smtpad"){if(r.shape==="circle")o.push({type:"oval",layers:[r.layer],center:{x:r.x,y:r.y},width:r.radius*2,height:r.radius*2,connectedTo:n([r.pcb_smtpad_id])});else if(r.shape==="rect")o.push({type:"rect",layers:[r.layer],center:{x:r.x,y:r.y},width:r.width,height:r.height,connectedTo:n([r.pcb_smtpad_id])});else if(r.shape==="rotated_rect"){let i={center:{x:r.x,y:r.y},width:r.width,height:r.height,rotation:r.ccw_rotation},s=Yer(i);for(let a of s)o.push({type:"rect",layers:[r.layer],center:a.center,width:a.width,height:a.height,connectedTo:n([r.pcb_smtpad_id])})}}else if(r.type==="pcb_keepout"){if(r.shape==="circle")o.push({type:"oval",layers:r.layers,center:{x:r.center.x,y:r.center.y},width:r.radius*2,height:r.radius*2,connectedTo:[]});else if(r.shape==="rect")o.push({type:"rect",layers:r.layers,center:{x:r.center.x,y:r.center.y},width:r.width,height:r.height,connectedTo:[]})}else if(r.type==="pcb_hole"){if(r.hole_shape==="oval")o.push({type:"oval",center:{x:r.x,y:r.y},width:r.hole_width,height:r.hole_height,connectedTo:[]});else if(r.hole_shape==="square")o.push({type:"rect",layers:H5e,center:{x:r.x,y:r.y},width:r.hole_diameter,height:r.hole_diameter,connectedTo:[]});else if(r.hole_shape==="round"||r.hole_shape==="circle")o.push({type:"rect",layers:H5e,center:{x:r.x,y:r.y},width:r.hole_diameter,height:r.hole_diameter,connectedTo:[]})}else if(r.type==="pcb_plated_hole"){if(r.shape==="circle")o.push({type:"oval",layers:H5e,center:{x:r.x,y:r.y},width:r.outer_diameter,height:r.outer_diameter,connectedTo:n([r.pcb_plated_hole_id])});else if(r.shape==="oval"||r.shape==="pill")o.push({type:"oval",layers:H5e,center:{x:r.x,y:r.y},width:r.outer_width,height:r.outer_height,connectedTo:n([r.pcb_plated_hole_id])})}else if(r.type==="pcb_trace"){let i=VRt(r.route.map((s)=>({x:s.x,y:s.y,layer:"layer"in s?s.layer:s.from_layer})),r.source_trace_id);o.push(...i)}else if(r.type==="pcb_via")o.push({type:"rect",layers:r.layers,center:{x:r.x,y:r.y},connectedTo:[],width:r.outer_diameter,height:r.outer_diameter});return o};function LRt(e){let{pcbConnMap:t,goalElementId:n}=e;if(!n.startsWith("pcb_port_"))throw Error(`Currently alternative goal boxes must have a goal id with prefix "pcb_port_" (got ${n})`);let o=t.getAllTracesConnectedToPort(n);return XRt(o).map((r)=>({...r,connectedTo:[n]}))}var jRt=(e)=>{let{connection:t,pcbConnMap:n}=e;if(t.pointsToConnect.length!==2)throw Error(`Connection must have exactly 2 points for alternative goal boxes (got ${t.pointsToConnect.length})`);let[o,r]=t.pointsToConnect;if(!o.pcb_port_id||!r.pcb_port_id)throw Error(`Connection points must have pcb_port_id for alternative goal box calculation (got ${o.pcb_port_id} and ${r.pcb_port_id})`);let i=LRt({goalElementId:o.pcb_port_id,pcbConnMap:n}).concat([{center:o,width:0.01,height:0.01,connectedTo:[o.pcb_port_id],layers:[o.layer],type:"rect"}]),s=LRt({goalElementId:r.pcb_port_id,pcbConnMap:n}).concat([{center:r,width:0.01,height:0.01,connectedTo:[r.pcb_port_id],layers:[r.layer],type:"rect"}]);if(i.length<=1&&s.length<=1)return{...t,startPoint:o,endPoint:r,goalBoxes:[]};let a=gxe(i,s),c,l,h;if(i.length>=s.length)c={...r,...a.pointB},l={...o,...a.pointA},h=i;else c={...o,...a.pointA},l={...r,...a.pointB},h=s;return{startPoint:c,endPoint:l,goalBoxes:h,name:t.name,pointsToConnect:[c,l]}},Uer=(e,t={})=>{let n={minTraceWidth:0.1};n.layerCount=t.layerCount??1,n.obstacles=XRt(e,t.connMap),n.connections=[];for(let r of e)if(r.type==="source_trace"){if(e.some((a)=>a.type==="pcb_trace"&&a.source_trace_id===r.source_trace_id))continue;let s={name:r.source_trace_id,pointsToConnect:r.connected_source_port_ids.map((a)=>{let c=pA(e).pcb_port.getWhere({source_port_id:a});if(!c)throw Error(`Could not find pcb_port for source_port_id "${a}"`);return{x:c.x,y:c.y,layer:c.layers?.[0]??"top",pcb_port_id:c.pcb_port_id}})};if(t.optimizeWithGoalBoxes){let a=new IX(e);s=jRt({connection:s,pcbConnMap:a})}n.connections.push(s),Wer(n.obstacles,s.pointsToConnect,s.name)}let o={minX:1/0,maxX:-1/0,minY:1/0,maxY:-1/0};for(let r of n.obstacles)o.minX=Math.min(o.minX,r.center.x-r.width/2),o.maxX=Math.max(o.maxX,r.center.x+r.width/2),o.minY=Math.min(o.minY,r.center.y-r.height/2),o.maxY=Math.max(o.maxY,r.center.y+r.height/2);for(let r of n.connections)for(let i of r.pointsToConnect)o.minX=Math.min(o.minX,i.x),o.maxX=Math.max(o.maxX,i.x),o.minY=Math.min(o.minY,i.y),o.maxY=Math.max(o.maxY,i.y);return n.bounds=o,n},Wer=(e,t,n)=>{for(let o of t)for(let r of e)if(Xer(o,r))r.connectedTo.push(n)};function Xer(e,t){let n=t.width/2,o=t.height/2;if(t.type==="rect")return e.x>=t.center.x-n&&e.x<=t.center.x+n&&e.y>=t.center.y-o&&e.y<=t.center.y+o;else if(t.type==="oval"){let r=(e.x-t.center.x)/n,i=(e.y-t.center.y)/o;return r*r+i*i<=1}return!1}function HRt(e,t){let n=t.x>e.x?1:t.x<e.x?-1:0,o=t.y>e.y?1:t.y<e.y?-1:0,r=t.l>e.l?1:t.l<e.l?-1:0;return{dx:n,dy:o,dl:r}}var vGe={1:["top"],2:["top","bottom"],4:["top","inner1","inner2","bottom"]},jer=(e)=>vGe[e];function KRt(e,t){let o=vGe[e].indexOf(t);if(o===-1)throw Error(`Invalid layer for getLayerIndex (for layerCount === ${e}): "${t}"`);return o}function Ker(e,t){let o=vGe[e][t];if(!o)throw Error(`Invalid index for indexToLayer (for layerCount === ${e}): "${t}"`);return o}var $er=class extends YRt{obstacles;GRID_STEP=0.1;layerCount;constructor(e,t){super([]);this.layerCount=e;let n=jer(e);this.obstacles=t.flatMap((o)=>o.layers.filter((r)=>n.includes(r)).map((r)=>({...o,left:o.center.x-o.width/2,right:o.center.x+o.width/2,top:o.center.y+o.height/2,bottom:o.center.y-o.height/2,l:KRt(e,r)})))}getObstacleAt(e,t,n,o){o??=this.GRID_STEP;for(let r of this.obstacles){if(r.l!==n)continue;let i=r.width/2+o,s=r.height/2+o;if(e>=r.center.x-i&&e<=r.center.x+i&&t>=r.center.y-s&&t<=r.center.y+s)return r}return null}isObstacleAt(e,t,n,o){return this.getObstacleAt(e,t,n,o)!==null}getDirectionDistancesToNearestObstacle3d(e,t,n){let{GRID_STEP:o}=this,r={left:1/0,top:1/0,bottom:1/0,right:1/0};for(let i of this.obstacles){if(i.l!==n)continue;if(i.type==="rect"){let s=i.center.x-i.width/2-o,a=i.center.x+i.width/2+o,c=i.center.y+i.height/2+o,l=i.center.y-i.height/2-o;if(t>=l&&t<=c&&e>s)r.left=Math.min(r.left,e-a);if(t>=l&&t<=c&&e<a)r.right=Math.min(r.right,s-e);if(e>=s&&e<=a&&t<c)r.top=Math.min(r.top,l-t);if(e>=s&&e<=a&&t>l)r.bottom=Math.min(r.bottom,t-c)}}return r}getOrthoDirectionCollisionInfo(e,t,{margin:n=0}={}){let{x:o,y:r,l:i}=e,{dx:s,dy:a,dl:c}=t,l=1/0,h=null;if(c!==0){let d=i+c;if(this.isObstacleAt(o,r,d,n))l=1,h=this.getObstacleAt(o,r,d,n);else l=1;return{dx:s,dy:a,dl:c,wallDistance:l,obstacle:h}}else{for(let d of this.obstacles){if(d.l!==i)continue;let u=d.left-n,_=d.right+n,p=d.top+n,m=d.bottom-n,A=null;if(s===1&&a===0){if(r>m&&r<p&&o<d.left)A=d.left-o}else if(s===-1&&a===0){if(r>m&&r<p&&o>d.right)A=o-d.right}else if(s===0&&a===1){if(o>u&&o<_&&r<d.bottom)A=d.bottom-r}else if(s===0&&a===-1){if(o>u&&o<_&&r>d.top)A=r-d.top}if(A!==null&&A<l)l=A,h=d}return{dx:s,dy:a,dl:0,wallDistance:l,obstacle:h}}}getObstaclesOverlappingRegion(e){let t=[];for(let n of this.obstacles){if(n.l!==e.l)continue;let{left:o,right:r,top:i,bottom:s}=n;if(o<=e.maxX&&r>=e.minX&&i>=e.minY&&s<=e.maxY)t.push(n)}return t}},F5e=class extends URt{MAX_ITERATIONS=500;VIA_COST=4;VIA_DIAMETER=0.5;allowLayerChange=!0;layerCount;obstacles;optimizeWithGoalBoxes;connMap;pcbConnMap;GOAL_RUSH_FACTOR=1.1;defaultGoalViaMargin=0.5;marginsWithCosts;get largestMargin(){return this.marginsWithCosts[0].margin}constructor(e){super(e);this.layerCount=e.input.layerCount??2,this.MAX_ITERATIONS=e.MAX_ITERATIONS??this.MAX_ITERATIONS,this.VIA_COST=e.VIA_COST??this.VIA_COST,this.connMap=e.connMap,this.pcbConnMap=e.pcbConnMap??new IX,this.optimizeWithGoalBoxes=e.optimizeWithGoalBoxes??!1,this.obstacles=null,this.marginsWithCosts=e.marginsWithCosts??[{margin:1,enterCost:0,travelCostFactor:1},{margin:this.OBSTACLE_MARGIN,enterCost:10,travelCostFactor:2}]}preprocessConnectionBeforeSolving(e){if(!this.optimizeWithGoalBoxes)return e;return jRt({connection:e,pcbConnMap:this.pcbConnMap})}postprocessConnectionSolveResult(e,t){if(!t.solved)return t;if(this.optimizeWithGoalBoxes){let n=t.route.map((o)=>({x:o.x,y:o.y,route_type:"wire",layer:o.layer,width:this.input.minTraceWidth}));n[0].start_pcb_port_id=e.pointsToConnect[0].pcb_port_id,n[n.length-1].end_pcb_port_id=e.pointsToConnect[1].pcb_port_id,this.pcbConnMap.addTrace({type:"pcb_trace",pcb_trace_id:`postprocess_trace_${NRt(8)}`,route:n})}return t}createObstacleList({dominantLayer:e,connection:t,obstaclesFromTraces:n}){let o=this.connMap?this.connMap.getNetConnectedToId(t.name):t.name;if(!o)throw Error(`The connection.name "${t.name}" wasn't present in the full connectivity map`);return new $er(this.layerCount,this.allObstacles.filter((r)=>!r.connectedTo.includes(o)).concat(n??[]))}computeG(e,t){let n=e.g+Zz(e,t)*(e.travelMarginCostFactor??1)+(t.enterMarginCost??0);if(t.l??e.l!==-1??-1)n+=this.VIA_COST;return n}computeH(e){let t=Math.abs(e.x-this.goalPoint.x),n=Math.abs(e.y-this.goalPoint.y),o=Math.abs(e.l-this.goalPoint.l);return(t+n)**this.GOAL_RUSH_FACTOR+o*this.VIA_COST}getStartNode(e){return{...super.getStartNode(e),l:this.layerToIndex(e.pointsToConnect[0].layer)}}layerToIndex(e){return KRt(this.layerCount,e)}indexToLayer(e){return Ker(this.layerCount,e)}getNodeName(e){return`${zRt(e,this.GRID_STEP)}-${e.l??0}`}hasSpaceForVia(e,t){return e.every((n)=>this.obstacles.getObstaclesOverlappingRegion({minX:t.x-this.VIA_DIAMETER/2-this.OBSTACLE_MARGIN,minY:t.y-this.VIA_DIAMETER/2-this.OBSTACLE_MARGIN,maxX:t.x+this.VIA_DIAMETER/2+this.OBSTACLE_MARGIN,maxY:t.y+this.VIA_DIAMETER/2+this.OBSTACLE_MARGIN,l:n}).length===0)}getNeighborsSurroundingGoal(e){let t=this.obstacles,n=this.goalPoint,o=[],r=[{dx:1,dy:0,dl:0},{dx:-1,dy:0,dl:0},{dx:0,dy:1,dl:0},{dx:0,dy:-1,dl:0}],i=this.VIA_DIAMETER+this.OBSTACLE_MARGIN+this.defaultGoalViaMargin;for(let s of r){let a={x:e.x+s.dx*i,y:e.y+s.dy*i,l:e.l+s.dl,obstacleHit:null};if(!this.hasSpaceForVia([e.l,n.l],a))continue;o.push(a)}return o}getNeighbors(e){let t=this.obstacles,n=this.goalPoint,o=Zz(e,n);if(o<=this.OBSTACLE_MARGIN)return this.getNeighborsSurroundingGoal(e);let r;if(!e.parent)r=HRt(e,n);else r=HRt(e.parent,e);let i=[{dx:0,dy:1,dl:0},{dx:1,dy:0,dl:0},{dx:0,dy:-1,dl:0},{dx:-1,dy:0,dl:0}],s=o>this.VIA_DIAMETER+this.OBSTACLE_MARGIN,a=Zz(e,this.startNode)>this.VIA_DIAMETER+this.OBSTACLE_MARGIN;if(this.allowLayerChange&&s&&a){if(e.l<this.layerCount-1)i.push({dx:0,dy:0,dl:1});if(e.l>0)i.push({dx:0,dy:0,dl:-1})}let c=i.filter((h)=>{if(h.dx===r.dx*-1&&h.dy===r.dy*-1&&h.dl===r.dl*-1)return!1;else if(h.dx===r.dx&&h.dy===r.dy&&h.dl===r.dl&&e.parent?.obstacleHit)return!1;return!0}).map((h)=>t.getOrthoDirectionCollisionInfo(e,h,{margin:this.OBSTACLE_MARGIN})).filter((h)=>!(h.wallDistance<this.OBSTACLE_MARGIN)),l=[];for(let h of c){let d=h.dx===0&&h.dy===0&&h.dl===1,u=h.dx===0&&h.dy===0&&h.dl===-1;if(d||u){if(![e.l,e.l+h.dl].every((g)=>t.getObstaclesOverlappingRegion({minX:e.x-this.VIA_DIAMETER/2-this.OBSTACLE_MARGIN,minY:e.y-this.VIA_DIAMETER/2-this.OBSTACLE_MARGIN,maxX:e.x+this.VIA_DIAMETER/2+this.OBSTACLE_MARGIN,maxY:e.y+this.VIA_DIAMETER/2+this.OBSTACLE_MARGIN,l:g}).length===0))continue}if(d){if(e.l<this.layerCount-1)l.push({...h,travelDistance:0,enterMarginCost:0,travelMarginCostFactor:1});continue}if(u){if(e.l>0)l.push({...h,travelDistance:0,enterMarginCost:0,travelMarginCostFactor:1});continue}let _=null;if(e?.obstacleHit)_=IGe({node:e,travelDir:h,wallDir:{...r,wallDistance:this.OBSTACLE_MARGIN},obstacle:e.obstacleHit,obstacles:t,OBSTACLE_MARGIN:this.OBSTACLE_MARGIN,SHOULD_DETECT_CONJOINED_OBSTACLES:!0});let p=FRt(e,n,h),m=(h.dx===0||Math.sign(n.x-e.x)===h.dx)&&(h.dy===0||Math.sign(n.y-e.y)===h.dy);if(p<h.wallDistance&&p>0&&m){let A=e.l===n.l,g=0;if(!A&&Math.abs(p-o)<this.GRID_STEP)g=this.VIA_DIAMETER+this.OBSTACLE_MARGIN+this.defaultGoalViaMargin;l.push({...h,travelDistance:p-g,enterMarginCost:0,travelMarginCostFactor:1})}else if(_!==null&&_<h.wallDistance){for(let{margin:A,enterCost:g,travelCostFactor:f}of this.marginsWithCosts)if(_-this.OBSTACLE_MARGIN+A*2<h.wallDistance)l.push({...h,travelDistance:_-this.OBSTACLE_MARGIN+A,enterMarginCost:g,travelMarginCostFactor:f});if(h.wallDistance===1/0)l.push({...h,travelDistance:p,enterMarginCost:0,travelMarginCostFactor:1});else if(h.wallDistance>this.largestMargin){for(let{margin:A,enterCost:g,travelCostFactor:f}of this.marginsWithCosts)if(h.wallDistance>this.largestMargin+A)l.push({...h,travelDistance:h.wallDistance-A,enterMarginCost:g,travelMarginCostFactor:f})}}else if(h.wallDistance!==1/0){for(let{margin:A,enterCost:g,travelCostFactor:f}of this.marginsWithCosts)if(h.wallDistance>A)l.push({...h,travelDistance:h.wallDistance-A,enterMarginCost:g,travelMarginCostFactor:f})}}return l.map((h)=>({x:e.x+h.dx*h.travelDistance,y:e.y+h.dy*h.travelDistance,l:e.l+h.dl,obstacleHit:h.obstacle,travelMarginCostFactor:h.travelMarginCostFactor,enterMarginCost:h.enterMarginCost}))}};function $Rt(e){let t=Uer(e),n=new Ver({input:t});return{solution:n.solveAndMapToTraces(),debugSolutions:n.debugSolutions,debugMessage:n.debugMessage}}Kt();tc();var W5e={};jW(W5e,{DocumentPosition:()=>KC,append:()=>xtr,appendChild:()=>ytr,compareDocumentPosition:()=>bQt,existsOne:()=>xQt,filter:()=>IK,find:()=>yQt,findAll:()=>vtr,findOne:()=>Y5e,findOneChild:()=>Itr,getAttributeValue:()=>ptr,getChildren:()=>AQt,getElementById:()=>Mtr,getElements:()=>Etr,getElementsByClassName:()=>wtr,getElementsByTagName:()=>eO,getElementsByTagType:()=>Btr,getFeed:()=>Ntr,getInnerHTML:()=>dtr,getName:()=>_tr,getOuterHTML:()=>gQt,getParent:()=>fQt,getSiblings:()=>utr,getText:()=>V5e,hasAttrib:()=>mtr,hasChildren:()=>w2,innerText:()=>wGe,isCDATA:()=>Use,isComment:()=>z5e,isDocument:()=>aQt,isTag:()=>Sf,isText:()=>ew,nextElementSibling:()=>gtr,prepend:()=>btr,prependChild:()=>Ctr,prevElementSibling:()=>Atr,removeElement:()=>Xse,removeSubsets:()=>Ttr,replaceElement:()=>ftr,testElement:()=>Ptr,textContent:()=>Wse,uniqueSort:()=>Dtr});var um;(function(e){e.Root="root",e.Text="text",e.Directive="directive",e.Comment="comment",e.Script="script",e.Style="style",e.Tag="tag",e.CDATA="cdata",e.Doctype="doctype"})(um||(um={}));function qRt(e){return e.type===um.Tag||e.type===um.Script||e.type===um.Style}var JRt=um.Root,ZRt=um.Text,eQt=um.Directive,tQt=um.Comment,nQt=um.Script,oQt=um.Style,rQt=um.Tag,iQt=um.CDATA,sQt=um.Doctype;function Sf(e){return qRt(e)}function Use(e){return e.type===um.CDATA}function ew(e){return e.type===um.Text}function z5e(e){return e.type===um.Comment}function aQt(e){return e.type===um.Root}function w2(e){return Object.prototype.hasOwnProperty.call(e,"children")}var cQt=/["&'<>$\x80-\uFFFF]/g,lQt=new Map([[34,"&quot;"],[38,"&amp;"],[39,"&apos;"],[60,"&lt;"],[62,"&gt;"]]),Jer=String.prototype.codePointAt!=null?(e,t)=>e.codePointAt(t):(e,t)=>(e.charCodeAt(t)&64512)===55296?(e.charCodeAt(t)-55296)*1024+e.charCodeAt(t+1)-56320+65536:e.charCodeAt(t);function O5e(e){let t="",n=0,o;while((o=cQt.exec(e))!==null){let r=o.index,i=e.charCodeAt(r),s=lQt.get(i);if(s!==void 0)t+=e.substring(n,r)+s,n=r+1;else t+=`${e.substring(n,r)}&#x${Jer(e,r).toString(16)};`,n=cQt.lastIndex+=Number((i&64512)===55296)}return t+e.substr(n)}function SGe(e,t){return function(o){let r,i=0,s="";while(r=e.exec(o)){if(i!==r.index)s+=o.substring(i,r.index);s+=t.get(r[0].charCodeAt(0)),i=r.index+1}return s+o.substring(i)}}var Zer=SGe(/[&<>'"]/g,lQt),PGe=SGe(/["&\u00A0]/g,new Map([[34,"&quot;"],[38,"&amp;"],[160,"&nbsp;"]])),EGe=SGe(/[&<>\u00A0]/g,new Map([[38,"&amp;"],[60,"&lt;"],[62,"&gt;"],[160,"&nbsp;"]]));var hQt;(function(e){e[e.XML=0]="XML",e[e.HTML=1]="HTML"})(hQt||(hQt={}));var dQt;(function(e){e[e.UTF8=0]="UTF8",e[e.ASCII=1]="ASCII",e[e.Extensive=2]="Extensive",e[e.Attribute=3]="Attribute",e[e.Text=4]="Text"})(dQt||(dQt={}));var uQt=new Map(["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","textPath"].map((e)=>[e.toLowerCase(),e])),pQt=new Map(["definitionURL","attributeName","attributeType","baseFrequency","baseProfile","calcMode","clipPathUnits","diffuseConstant","edgeMode","filterUnits","glyphRef","gradientTransform","gradientUnits","kernelMatrix","kernelUnitLength","keyPoints","keySplines","keyTimes","lengthAdjust","limitingConeAngle","markerHeight","markerUnits","markerWidth","maskContentUnits","maskUnits","numOctaves","pathLength","patternContentUnits","patternTransform","patternUnits","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","refX","refY","repeatCount","repeatDur","requiredExtensions","requiredFeatures","specularConstant","specularExponent","spreadMethod","startOffset","stdDeviation","stitchTiles","surfaceScale","systemLanguage","tableValues","targetX","targetY","textLength","viewBox","viewTarget","xChannelSelector","yChannelSelector","zoomAndPan"].map((e)=>[e.toLowerCase(),e]));var etr=new Set(["style","script","xmp","iframe","noembed","noframes","plaintext","noscript"]);function ttr(e){return e.replace(/"/g,"&quot;")}function ntr(e,t){var n;if(!e)return;let o=((n=t.encodeEntities)!==null&&n!==void 0?n:t.decodeEntities)===!1?ttr:t.xmlMode||t.encodeEntities!=="utf8"?O5e:PGe;return Object.keys(e).map((r)=>{var i,s;let a=(i=e[r])!==null&&i!==void 0?i:"";if(t.xmlMode==="foreign")r=(s=pQt.get(r))!==null&&s!==void 0?s:r;if(!t.emptyAttrs&&!t.xmlMode&&a==="")return r;return`${r}="${o(a)}"`}).join(" ")}var mQt=new Set(["area","base","basefont","br","col","command","embed","frame","hr","img","input","isindex","keygen","link","meta","param","source","track","wbr"]);function MGe(e,t={}){let n="length"in e?e:[e],o="";for(let r=0;r<n.length;r++)o+=otr(n[r],t);return o}var _Qt=MGe;function otr(e,t){switch(e.type){case JRt:return MGe(e.children,t);case sQt:case eQt:return atr(e);case tQt:return htr(e);case iQt:return ltr(e);case nQt:case oQt:case rQt:return str(e,t);case ZRt:return ctr(e,t)}}var rtr=new Set(["mi","mo","mn","ms","mtext","annotation-xml","foreignObject","desc","title"]),itr=new Set(["svg","math"]);function str(e,t){var n;if(t.xmlMode==="foreign"){if(e.name=(n=uQt.get(e.name))!==null&&n!==void 0?n:e.name,e.parent&&rtr.has(e.parent.name))t={...t,xmlMode:!1}}if(!t.xmlMode&&itr.has(e.name))t={...t,xmlMode:"foreign"};let o=`<${e.name}`,r=ntr(e.attribs,t);if(r)o+=` ${r}`;if(e.children.length===0&&(t.xmlMode?t.selfClosingTags!==!1:t.selfClosingTags&&mQt.has(e.name))){if(!t.xmlMode)o+=" ";o+="/>"}else{if(o+=">",e.children.length>0)o+=MGe(e.children,t);if(t.xmlMode||!mQt.has(e.name))o+=`</${e.name}>`}return o}function atr(e){return`<${e.data}>`}function ctr(e,t){var n;let o=e.data||"";if(((n=t.encodeEntities)!==null&&n!==void 0?n:t.decodeEntities)!==!1&&!(!t.xmlMode&&e.parent&&etr.has(e.parent.name)))o=t.xmlMode||t.encodeEntities!=="utf8"?O5e(o):EGe(o);return o}function ltr(e){return`<![CDATA[${e.children[0].data}]]>`}function htr(e){return`<!--${e.data}-->`}function gQt(e,t){return _Qt(e,t)}function dtr(e,t){return w2(e)?e.children.map((n)=>gQt(n,t)).join(""):""}function V5e(e){if(Array.isArray(e))return e.map(V5e).join("");if(Sf(e))return e.name==="br"?`
`:V5e(e.children);if(Use(e))return V5e(e.children);if(ew(e))return e.data;return""}function Wse(e){if(Array.isArray(e))return e.map(Wse).join("");if(w2(e)&&!z5e(e))return Wse(e.children);if(ew(e))return e.data;return""}function wGe(e){if(Array.isArray(e))return e.map(wGe).join("");if(w2(e)&&(e.type===um.Tag||Use(e)))return wGe(e.children);if(ew(e))return e.data;return""}function AQt(e){return w2(e)?e.children:[]}function fQt(e){return e.parent||null}function utr(e){let t=fQt(e);if(t!=null)return AQt(t);let n=[e],{prev:o,next:r}=e;while(o!=null)n.unshift(o),{prev:o}=o;while(r!=null)n.push(r),{next:r}=r;return n}function ptr(e,t){var n;return(n=e.attribs)===null||n===void 0?void 0:n[t]}function mtr(e,t){return e.attribs!=null&&Object.prototype.hasOwnProperty.call(e.attribs,t)&&e.attribs[t]!=null}function _tr(e){return e.name}function gtr(e){let{next:t}=e;while(t!==null&&!Sf(t))({next:t}=t);return t}function Atr(e){let{prev:t}=e;while(t!==null&&!Sf(t))({prev:t}=t);return t}function Xse(e){if(e.prev)e.prev.next=e.next;if(e.next)e.next.prev=e.prev;if(e.parent){let t=e.parent.children,n=t.lastIndexOf(e);if(n>=0)t.splice(n,1)}e.next=null,e.prev=null,e.parent=null}function ftr(e,t){let n=t.prev=e.prev;if(n)n.next=t;let o=t.next=e.next;if(o)o.prev=t;let r=t.parent=e.parent;if(r){let i=r.children;i[i.lastIndexOf(e)]=t,e.parent=null}}function ytr(e,t){if(Xse(t),t.next=null,t.parent=e,e.children.push(t)>1){let n=e.children[e.children.length-2];n.next=t,t.prev=n}else t.prev=null}function xtr(e,t){Xse(t);let{parent:n}=e,o=e.next;if(t.next=o,t.prev=e,e.next=t,t.parent=n,o){if(o.prev=t,n){let r=n.children;r.splice(r.lastIndexOf(o),0,t)}}else if(n)n.children.push(t)}function Ctr(e,t){if(Xse(t),t.parent=e,t.prev=null,e.children.unshift(t)!==1){let n=e.children[1];n.prev=t,t.next=n}else t.next=null}function btr(e,t){Xse(t);let{parent:n}=e;if(n){let o=n.children;o.splice(o.indexOf(e),0,t)}if(e.prev)e.prev.next=t;t.parent=n,t.prev=e.prev,t.next=e,e.prev=t}function IK(e,t,n=!0,o=1/0){return yQt(e,Array.isArray(t)?t:[t],n,o)}function yQt(e,t,n,o){let r=[],i=[Array.isArray(t)?t:[t]],s=[0];for(;;){if(s[0]>=i[0].length){if(s.length===1)return r;i.shift(),s.shift();continue}let a=i[0][s[0]++];if(e(a)){if(r.push(a),--o<=0)return r}if(n&&w2(a)&&a.children.length>0)s.unshift(0),i.unshift(a.children)}}function Itr(e,t){return t.find(e)}function Y5e(e,t,n=!0){let o=Array.isArray(t)?t:[t];for(let r=0;r<o.length;r++){let i=o[r];if(Sf(i)&&e(i))return i;if(n&&w2(i)&&i.children.length>0){let s=Y5e(e,i.children,!0);if(s)return s}}return null}function xQt(e,t){return(Array.isArray(t)?t:[t]).some((n)=>Sf(n)&&e(n)||w2(n)&&xQt(e,n.children))}function vtr(e,t){let n=[],o=[Array.isArray(t)?t:[t]],r=[0];for(;;){if(r[0]>=o[0].length){if(o.length===1)return n;o.shift(),r.shift();continue}let i=o[0][r[0]++];if(Sf(i)&&e(i))n.push(i);if(w2(i)&&i.children.length>0)r.unshift(0),o.unshift(i.children)}}var G5e={tag_name(e){if(typeof e==="function")return(t)=>Sf(t)&&e(t.name);else if(e==="*")return Sf;return(t)=>Sf(t)&&t.name===e},tag_type(e){if(typeof e==="function")return(t)=>e(t.type);return(t)=>t.type===e},tag_contains(e){if(typeof e==="function")return(t)=>ew(t)&&e(t.data);return(t)=>ew(t)&&t.data===e}};function BGe(e,t){if(typeof t==="function")return(n)=>Sf(n)&&t(n.attribs[e]);return(n)=>Sf(n)&&n.attribs[e]===t}function Str(e,t){return(n)=>e(n)||t(n)}function CQt(e){let t=Object.keys(e).map((n)=>{let o=e[n];return Object.prototype.hasOwnProperty.call(G5e,n)?G5e[n](o):BGe(n,o)});return t.length===0?null:t.reduce(Str)}function Ptr(e,t){let n=CQt(e);return n?n(t):!0}function Etr(e,t,n,o=1/0){let r=CQt(e);return r?IK(r,t,n,o):[]}function Mtr(e,t,n=!0){if(!Array.isArray(t))t=[t];return Y5e(BGe("id",e),t,n)}function eO(e,t,n=!0,o=1/0){return IK(G5e.tag_name(e),t,n,o)}function wtr(e,t,n=!0,o=1/0){return IK(BGe("class",e),t,n,o)}function Btr(e,t,n=!0,o=1/0){return IK(G5e.tag_type(e),t,n,o)}function Ttr(e){let t=e.length;while(--t>=0){let n=e[t];if(t>0&&e.lastIndexOf(n,t-1)>=0){e.splice(t,1);continue}for(let o=n.parent;o;o=o.parent)if(e.includes(o)){e.splice(t,1);break}}return e}var KC;(function(e){e[e.DISCONNECTED=1]="DISCONNECTED",e[e.PRECEDING=2]="PRECEDING",e[e.FOLLOWING=4]="FOLLOWING",e[e.CONTAINS=8]="CONTAINS",e[e.CONTAINED_BY=16]="CONTAINED_BY"})(KC||(KC={}));function bQt(e,t){let n=[],o=[];if(e===t)return 0;let r=w2(e)?e:e.parent;while(r)n.unshift(r),r=r.parent;r=w2(t)?t:t.parent;while(r)o.unshift(r),r=r.parent;let i=Math.min(n.length,o.length),s=0;while(s<i&&n[s]===o[s])s++;if(s===0)return KC.DISCONNECTED;let a=n[s-1],c=a.children,l=n[s],h=o[s];if(c.indexOf(l)>c.indexOf(h)){if(a===t)return KC.FOLLOWING|KC.CONTAINED_BY;return KC.FOLLOWING}if(a===e)return KC.PRECEDING|KC.CONTAINS;return KC.PRECEDING}function Dtr(e){return e=e.filter((t,n,o)=>!o.includes(t,n+1)),e.sort((t,n)=>{let o=bQt(t,n);if(o&KC.PRECEDING)return-1;else if(o&KC.FOLLOWING)return 1;return 0}),e}function Ntr(e){let t=U5e(Htr,e);return!t?null:t.name==="feed"?Rtr(t):Qtr(t)}function Rtr(e){var t;let n=e.children,o={type:"atom",items:eO("entry",n).map((s)=>{var a;let{children:c}=s,l={media:IQt(c)};Ex(l,"id","id",c),Ex(l,"title","title",c);let h=(a=U5e("link",c))===null||a===void 0?void 0:a.attribs.href;if(h)l.link=h;let d=bR("summary",c)||bR("content",c);if(d)l.description=d;let u=bR("updated",c);if(u)l.pubDate=new Date(u);return l})};Ex(o,"id","id",n),Ex(o,"title","title",n);let r=(t=U5e("link",n))===null||t===void 0?void 0:t.attribs.href;if(r)o.link=r;Ex(o,"description","subtitle",n);let i=bR("updated",n);if(i)o.updated=new Date(i);return Ex(o,"author","email",n,!0),o}function Qtr(e){var t,n;let o=(n=(t=U5e("channel",e.children))===null||t===void 0?void 0:t.children)!==null&&n!==void 0?n:[],r={type:e.name.substr(0,3),id:"",items:eO("item",e.children).map((s)=>{let{children:a}=s,c={media:IQt(a)};Ex(c,"id","guid",a),Ex(c,"title","title",a),Ex(c,"link","link",a),Ex(c,"description","description",a);let l=bR("pubDate",a)||bR("dc:date",a);if(l)c.pubDate=new Date(l);return c})};Ex(r,"title","title",o),Ex(r,"link","link",o),Ex(r,"description","description",o);let i=bR("lastBuildDate",o);if(i)r.updated=new Date(i);return Ex(r,"author","managingEditor",o,!0),r}var ktr=["url","type","lang"],Ltr=["fileSize","bitrate","framerate","samplingrate","channels","duration","height","width"];function IQt(e){return eO("media:content",e).map((t)=>{let{attribs:n}=t,o={medium:n.medium,isDefault:!!n.isDefault};for(let r of ktr)if(n[r])o[r]=n[r];for(let r of Ltr)if(n[r])o[r]=parseInt(n[r],10);if(n.expression)o.expression=n.expression;return o})}function U5e(e,t){return eO(e,t,!0,1)[0]}function bR(e,t,n=!1){return Wse(eO(e,t,n,1)).trim()}function Ex(e,t,n,o,r=!1){let i=bR(n,o,r);if(i)e[t]=i}function Htr(e){return e==="rss"||e==="feed"||e==="rdf:RDF"}var YGe=Qe(tO(),1);var ts;(function(e){e.Attribute="attribute",e.Pseudo="pseudo",e.PseudoElement="pseudo-element",e.Tag="tag",e.Universal="universal",e.Adjacent="adjacent",e.Child="child",e.Descendant="descendant",e.Parent="parent",e.Sibling="sibling",e.ColumnCombinator="column-combinator"})(ts||(ts={}));var pm;(function(e){e.Any="any",e.Element="element",e.End="end",e.Equals="equals",e.Exists="exists",e.Hyphen="hyphen",e.Not="not",e.Start="start"})(pm||(pm={}));var SQt=/^[^\\#]?(?:\\(?:[\da-f]{1,6}\s?|.)|[\w\-\u00b0-\uFFFF])+/,Ftr=/\\([\da-f]{1,6}\s?|(\s)|.)/gi,ztr=new Map([[126,pm.Element],[94,pm.Start],[36,pm.End],[42,pm.Any],[33,pm.Not],[124,pm.Hyphen]]),Otr=new Set(["has","not","matches","is","where","host","host-context"]);function EQt(e){switch(e.type){case ts.Adjacent:case ts.Child:case ts.Descendant:case ts.Parent:case ts.Sibling:case ts.ColumnCombinator:return!0;default:return!1}}var Vtr=new Set(["contains","icontains"]);function Ytr(e,t,n){let o=parseInt(t,16)-65536;return o!==o||n?t:o<0?String.fromCharCode(o+65536):String.fromCharCode(o>>10|55296,o&1023|56320)}function jse(e){return e.replace(Ftr,Ytr)}function TGe(e){return e===39||e===34}function PQt(e){return e===32||e===9||e===10||e===12||e===13}function Kse(e){let t=[],n=MQt(t,`${e}`,0);if(n<e.length)throw Error(`Unmatched selector: ${e.slice(n)}`);return t}function MQt(e,t,n){let o=[];function r(u){let _=t.slice(n+u).match(SQt);if(!_)throw Error(`Expected name, found ${t.slice(n)}`);let[p]=_;return n+=u+p.length,jse(p)}function i(u){n+=u;while(n<t.length&&PQt(t.charCodeAt(n)))n++}function s(){n+=1;let u=n,_=1;for(;_>0&&n<t.length;n++)if(t.charCodeAt(n)===40&&!a(n))_++;else if(t.charCodeAt(n)===41&&!a(n))_--;if(_)throw Error("Parenthesis not matched");return jse(t.slice(u,n-1))}function a(u){let _=0;while(t.charCodeAt(--u)===92)_++;return(_&1)===1}function c(){if(o.length>0&&EQt(o[o.length-1]))throw Error("Did not expect successive traversals.")}function l(u){if(o.length>0&&o[o.length-1].type===ts.Descendant){o[o.length-1].type=u;return}c(),o.push({type:u})}function h(u,_){o.push({type:ts.Attribute,name:u,action:_,value:r(1),namespace:null,ignoreCase:"quirks"})}function d(){if(o.length&&o[o.length-1].type===ts.Descendant)o.pop();if(o.length===0)throw Error("Empty sub-selector");e.push(o)}if(i(0),t.length===n)return n;e:while(n<t.length){let u=t.charCodeAt(n);switch(u){case 32:case 9:case 10:case 12:case 13:{if(o.length===0||o[0].type!==ts.Descendant)c(),o.push({type:ts.Descendant});i(1);break}case 62:{l(ts.Child),i(1);break}case 60:{l(ts.Parent),i(1);break}case 126:{l(ts.Sibling),i(1);break}case 43:{l(ts.Adjacent),i(1);break}case 46:{h("class",pm.Element);break}case 35:{h("id",pm.Equals);break}case 91:{i(1);let _,p=null;if(t.charCodeAt(n)===124)_=r(1);else if(t.startsWith("*|",n))p="*",_=r(2);else if(_=r(0),t.charCodeAt(n)===124&&t.charCodeAt(n+1)!==61)p=_,_=r(1);i(0);let m=pm.Exists,A=ztr.get(t.charCodeAt(n));if(A){if(m=A,t.charCodeAt(n+1)!==61)throw Error("Expected `=`");i(2)}else if(t.charCodeAt(n)===61)m=pm.Equals,i(1);let g="",f=null;if(m!=="exists"){if(TGe(t.charCodeAt(n))){let C=t.charCodeAt(n),b=n+1;while(b<t.length&&(t.charCodeAt(b)!==C||a(b)))b+=1;if(t.charCodeAt(b)!==C)throw Error("Attribute value didn't end");g=jse(t.slice(n+1,b)),n=b+1}else{let C=n;while(n<t.length&&(!PQt(t.charCodeAt(n))&&t.charCodeAt(n)!==93||a(n)))n+=1;g=jse(t.slice(C,n))}i(0);let x=t.charCodeAt(n)|32;if(x===115)f=!1,i(1);else if(x===105)f=!0,i(1)}if(t.charCodeAt(n)!==93)throw Error("Attribute selector didn't terminate");n+=1;let y={type:ts.Attribute,name:_,action:m,value:g,namespace:p,ignoreCase:f};o.push(y);break}case 58:{if(t.charCodeAt(n+1)===58){o.push({type:ts.PseudoElement,name:r(2).toLowerCase(),data:t.charCodeAt(n)===40?s():null});continue}let _=r(1).toLowerCase(),p=null;if(t.charCodeAt(n)===40)if(Otr.has(_)){if(TGe(t.charCodeAt(n+1)))throw Error(`Pseudo-selector ${_} cannot be quoted`);if(p=[],n=MQt(p,t,n+1),t.charCodeAt(n)!==41)throw Error(`Missing closing parenthesis in :${_} (${t})`);n+=1}else{if(p=s(),Vtr.has(_)){let m=p.charCodeAt(0);if(m===p.charCodeAt(p.length-1)&&TGe(m))p=p.slice(1,-1)}p=jse(p)}o.push({type:ts.Pseudo,name:_,data:p});break}case 44:{d(),o=[],i(1);break}default:{if(t.startsWith("/*",n)){let m=t.indexOf("*/",n+2);if(m<0)throw Error("Comment was not terminated");if(n=m+2,o.length===0)i(0);break}let _=null,p;if(u===42)n+=1,p="*";else if(u===124){if(p="",t.charCodeAt(n+1)===124){l(ts.ColumnCombinator),i(2);break}}else if(SQt.test(t.slice(n)))p=r(0);else break e;if(t.charCodeAt(n)===124&&t.charCodeAt(n+1)!==124)if(_=p,t.charCodeAt(n+1)===42)p="*",n+=2;else p=r(1);o.push(p==="*"?{type:ts.Universal,namespace:_}:{type:ts.Tag,name:p,namespace:_})}}}return d(),n}var tw=Qe(tO(),1);var wQt=new Map([[ts.Universal,50],[ts.Tag,30],[ts.Attribute,1],[ts.Pseudo,0]]);function $se(e){return!wQt.has(e.type)}var Gtr=new Map([[pm.Exists,10],[pm.Equals,8],[pm.Not,7],[pm.Start,6],[pm.End,6],[pm.Any,5]]);function DGe(e){let t=e.map(BQt);for(let n=1;n<e.length;n++){let o=t[n];if(o<0)continue;for(let r=n-1;r>=0&&o<t[r];r--){let i=e[r+1];e[r+1]=e[r],e[r]=i,t[r+1]=t[r],t[r]=o}}}function BQt(e){var t,n;let o=(t=wQt.get(e.type))!==null&&t!==void 0?t:-1;if(e.type===ts.Attribute){if(o=(n=Gtr.get(e.action))!==null&&n!==void 0?n:4,e.action===pm.Equals&&e.name==="id")o=9;if(e.ignoreCase)o>>=1}else if(e.type===ts.Pseudo)if(!e.data)o=3;else if(e.name==="has"||e.name==="contains")o=0;else if(Array.isArray(e.data)){if(o=Math.min(...e.data.map((r)=>Math.min(...r.map(BQt)))),o<0)o=0}else o=2;return o}var qse=Qe(tO(),1),Utr=/[-[\]{}()*+?.,\\^$|#\s]/g;function TQt(e){return e.replace(Utr,"\\$&")}var Wtr=new Set(["accept","accept-charset","align","alink","axis","bgcolor","charset","checked","clear","codetype","color","compact","declare","defer","dir","direction","disabled","enctype","face","frame","hreflang","http-equiv","lang","language","link","media","method","multiple","nohref","noresize","noshade","nowrap","readonly","rel","rev","rules","scope","scrolling","selected","shape","target","text","type","valign","valuetype","vlink"]);function nO(e,t){return typeof e.ignoreCase==="boolean"?e.ignoreCase:e.ignoreCase==="quirks"?!!t.quirksMode:!t.xmlMode&&Wtr.has(e.name)}var DQt={equals(e,t,n){let{adapter:o}=n,{name:r}=t,{value:i}=t;if(nO(t,n))return i=i.toLowerCase(),(s)=>{let a=o.getAttributeValue(s,r);return a!=null&&a.length===i.length&&a.toLowerCase()===i&&e(s)};return(s)=>o.getAttributeValue(s,r)===i&&e(s)},hyphen(e,t,n){let{adapter:o}=n,{name:r}=t,{value:i}=t,s=i.length;if(nO(t,n))return i=i.toLowerCase(),function(c){let l=o.getAttributeValue(c,r);return l!=null&&(l.length===s||l.charAt(s)==="-")&&l.substr(0,s).toLowerCase()===i&&e(c)};return function(c){let l=o.getAttributeValue(c,r);return l!=null&&(l.length===s||l.charAt(s)==="-")&&l.substr(0,s)===i&&e(c)}},element(e,t,n){let{adapter:o}=n,{name:r,value:i}=t;if(/\s/.test(i))return qse.default.falseFunc;let s=new RegExp(`(?:^|\\s)${TQt(i)}(?:$|\\s)`,nO(t,n)?"i":"");return function(c){let l=o.getAttributeValue(c,r);return l!=null&&l.length>=i.length&&s.test(l)&&e(c)}},exists(e,{name:t},{adapter:n}){return(o)=>n.hasAttrib(o,t)&&e(o)},start(e,t,n){let{adapter:o}=n,{name:r}=t,{value:i}=t,s=i.length;if(s===0)return qse.default.falseFunc;if(nO(t,n))return i=i.toLowerCase(),(a)=>{let c=o.getAttributeValue(a,r);return c!=null&&c.length>=s&&c.substr(0,s).toLowerCase()===i&&e(a)};return(a)=>{var c;return!!((c=o.getAttributeValue(a,r))===null||c===void 0?void 0:c.startsWith(i))&&e(a)}},end(e,t,n){let{adapter:o}=n,{name:r}=t,{value:i}=t,s=-i.length;if(s===0)return qse.default.falseFunc;if(nO(t,n))return i=i.toLowerCase(),(a)=>{var c;return((c=o.getAttributeValue(a,r))===null||c===void 0?void 0:c.substr(s).toLowerCase())===i&&e(a)};return(a)=>{var c;return!!((c=o.getAttributeValue(a,r))===null||c===void 0?void 0:c.endsWith(i))&&e(a)}},any(e,t,n){let{adapter:o}=n,{name:r,value:i}=t;if(i==="")return qse.default.falseFunc;if(nO(t,n)){let s=new RegExp(TQt(i),"i");return function(c){let l=o.getAttributeValue(c,r);return l!=null&&l.length>=i.length&&s.test(l)&&e(c)}}return(s)=>{var a;return!!((a=o.getAttributeValue(s,r))===null||a===void 0?void 0:a.includes(i))&&e(s)}},not(e,t,n){let{adapter:o}=n,{name:r}=t,{value:i}=t;if(i==="")return(s)=>!!o.getAttributeValue(s,r)&&e(s);else if(nO(t,n))return i=i.toLowerCase(),(s)=>{let a=o.getAttributeValue(s,r);return(a==null||a.length!==i.length||a.toLowerCase()!==i)&&e(s)};return(s)=>o.getAttributeValue(s,r)!==i&&e(s)}};var Xtr=new Set([9,10,12,13,32]);function NQt(e){if(e=e.trim().toLowerCase(),e==="even")return[2,0];else if(e==="odd")return[2,1];let t=0,n=0,o=i(),r=s();if(t<e.length&&e.charAt(t)==="n")if(t++,n=o*(r!==null&&r!==void 0?r:1),a(),t<e.length)o=i(),a(),r=s();else o=r=0;if(r===null||t<e.length)throw Error(`n-th rule couldn't be parsed ('${e}')`);return[n,o*r];function i(){if(e.charAt(t)==="-")return t++,-1;if(e.charAt(t)==="+")t++;return 1}function s(){let c=t,l=0;while(t<e.length&&e.charCodeAt(t)>=48&&e.charCodeAt(t)<=57)l=l*10+(e.charCodeAt(t)-48),t++;return t===c?null:l}function a(){while(t<e.length&&Xtr.has(e.charCodeAt(t)))t++}}var NGe=Qe(tO(),1);function RQt(e){let t=e[0],n=e[1]-1;if(n<0&&t<=0)return NGe.default.falseFunc;if(t===-1)return(i)=>i<=n;if(t===0)return(i)=>i===n;if(t===1)return n<0?NGe.default.trueFunc:(i)=>i>=n;let o=Math.abs(t),r=(n%o+o)%o;return t>1?(i)=>i>=n&&i%o===r:(i)=>i<=n&&i%o===r}function vK(e){return RQt(NQt(e))}var Mx=Qe(tO(),1);function X5e(e,t){return(n)=>{let o=t.getParent(n);return o!=null&&t.isTag(o)&&e(n)}}var Jse={contains(e,t,{adapter:n}){return function(r){return e(r)&&n.getText(r).includes(t)}},icontains(e,t,{adapter:n}){let o=t.toLowerCase();return function(i){return e(i)&&n.getText(i).toLowerCase().includes(o)}},"nth-child"(e,t,{adapter:n,equals:o}){let r=vK(t);if(r===Mx.default.falseFunc)return Mx.default.falseFunc;if(r===Mx.default.trueFunc)return X5e(e,n);return function(s){let a=n.getSiblings(s),c=0;for(let l=0;l<a.length;l++){if(o(s,a[l]))break;if(n.isTag(a[l]))c++}return r(c)&&e(s)}},"nth-last-child"(e,t,{adapter:n,equals:o}){let r=vK(t);if(r===Mx.default.falseFunc)return Mx.default.falseFunc;if(r===Mx.default.trueFunc)return X5e(e,n);return function(s){let a=n.getSiblings(s),c=0;for(let l=a.length-1;l>=0;l--){if(o(s,a[l]))break;if(n.isTag(a[l]))c++}return r(c)&&e(s)}},"nth-of-type"(e,t,{adapter:n,equals:o}){let r=vK(t);if(r===Mx.default.falseFunc)return Mx.default.falseFunc;if(r===Mx.default.trueFunc)return X5e(e,n);return function(s){let a=n.getSiblings(s),c=0;for(let l=0;l<a.length;l++){let h=a[l];if(o(s,h))break;if(n.isTag(h)&&n.getName(h)===n.getName(s))c++}return r(c)&&e(s)}},"nth-last-of-type"(e,t,{adapter:n,equals:o}){let r=vK(t);if(r===Mx.default.falseFunc)return Mx.default.falseFunc;if(r===Mx.default.trueFunc)return X5e(e,n);return function(s){let a=n.getSiblings(s),c=0;for(let l=a.length-1;l>=0;l--){let h=a[l];if(o(s,h))break;if(n.isTag(h)&&n.getName(h)===n.getName(s))c++}return r(c)&&e(s)}},root(e,t,{adapter:n}){return(o)=>{let r=n.getParent(o);return(r==null||!n.isTag(r))&&e(o)}},scope(e,t,n,o){let{equals:r}=n;if(!o||o.length===0)return Jse.root(e,t,n);if(o.length===1)return(i)=>r(o[0],i)&&e(i);return(i)=>o.includes(i)&&e(i)},hover:RGe("isHovered"),visited:RGe("isVisited"),active:RGe("isActive")};function RGe(e){return function(n,o,{adapter:r}){let i=r[e];if(typeof i!=="function")return Mx.default.falseFunc;return function(a){return i(a)&&n(a)}}}var j5e={empty(e,{adapter:t}){return!t.getChildren(e).some((n)=>t.isTag(n)||t.getText(n)!=="")},"first-child"(e,{adapter:t,equals:n}){if(t.prevElementSibling)return t.prevElementSibling(e)==null;let o=t.getSiblings(e).find((r)=>t.isTag(r));return o!=null&&n(e,o)},"last-child"(e,{adapter:t,equals:n}){let o=t.getSiblings(e);for(let r=o.length-1;r>=0;r--){if(n(e,o[r]))return!0;if(t.isTag(o[r]))break}return!1},"first-of-type"(e,{adapter:t,equals:n}){let o=t.getSiblings(e),r=t.getName(e);for(let i=0;i<o.length;i++){let s=o[i];if(n(e,s))return!0;if(t.isTag(s)&&t.getName(s)===r)break}return!1},"last-of-type"(e,{adapter:t,equals:n}){let o=t.getSiblings(e),r=t.getName(e);for(let i=o.length-1;i>=0;i--){let s=o[i];if(n(e,s))return!0;if(t.isTag(s)&&t.getName(s)===r)break}return!1},"only-of-type"(e,{adapter:t,equals:n}){let o=t.getName(e);return t.getSiblings(e).every((r)=>n(e,r)||!t.isTag(r)||t.getName(r)!==o)},"only-child"(e,{adapter:t,equals:n}){return t.getSiblings(e).every((o)=>n(e,o)||!t.isTag(o))}};function QGe(e,t,n,o){if(n===null){if(e.length>o)throw Error(`Pseudo-class :${t} requires an argument`)}else if(e.length===o)throw Error(`Pseudo-class :${t} doesn't have any arguments`)}var kGe={"any-link":":is(a, area, link)[href]",link:":any-link:not(:visited)",disabled:`:is(
        :is(button, input, select, textarea, optgroup, option)[disabled],
        optgroup[disabled] > option,
        fieldset[disabled]:not(fieldset[disabled] legend:first-of-type *)
    )`,enabled:":not(:disabled)",checked:":is(:is(input[type=radio], input[type=checkbox])[checked], option:selected)",required:":is(input, select, textarea)[required]",optional:":is(input, select, textarea):not([required])",selected:"option:is([selected], select:not([multiple]):not(:has(> option[selected])) > :first-of-type)",checkbox:"[type=checkbox]",file:"[type=file]",password:"[type=password]",radio:"[type=radio]",reset:"[type=reset]",image:"[type=image]",submit:"[type=submit]",parent:":not(:empty)",header:":is(h1, h2, h3, h4, h5, h6)",button:":is(button, input[type=button])",input:":is(input, textarea, select, button)",text:"input:is(:not([type!='']), [type=text])"};var $C=Qe(tO(),1);var FGe={};function zGe(e,t){if(e===$C.default.falseFunc)return $C.default.falseFunc;return(n)=>t.isTag(n)&&e(n)}function OGe(e,t){let n=t.getSiblings(e);if(n.length<=1)return[];let o=n.indexOf(e);if(o<0||o===n.length-1)return[];return n.slice(o+1).filter(t.isTag)}function HGe(e){return{xmlMode:!!e.xmlMode,lowerCaseAttributeNames:!!e.lowerCaseAttributeNames,lowerCaseTags:!!e.lowerCaseTags,quirksMode:!!e.quirksMode,cacheResults:!!e.cacheResults,pseudos:e.pseudos,adapter:e.adapter,equals:e.equals}}var LGe=(e,t,n,o,r)=>{let i=r(t,HGe(n),o);return i===$C.default.trueFunc?e:i===$C.default.falseFunc?$C.default.falseFunc:(s)=>i(s)&&e(s)},K5e={is:LGe,matches:LGe,where:LGe,not(e,t,n,o,r){let i=r(t,HGe(n),o);return i===$C.default.falseFunc?e:i===$C.default.trueFunc?$C.default.falseFunc:(s)=>!i(s)&&e(s)},has(e,t,n,o,r){let{adapter:i}=n,s=HGe(n);s.relativeSelector=!0;let a=t.some((h)=>h.some($se))?[FGe]:void 0,c=r(t,s,a);if(c===$C.default.falseFunc)return $C.default.falseFunc;let l=zGe(c,i);if(a&&c!==$C.default.trueFunc){let{shouldTestNextSiblings:h=!1}=c;return(d)=>{if(!e(d))return!1;a[0]=d;let u=i.getChildren(d),_=h?[...u,...OGe(d,i)]:u;return i.existsOne(l,_)}}return(h)=>e(h)&&i.existsOne(l,i.getChildren(h))}};function QQt(e,t,n,o,r){var i;let{name:s,data:a}=t;if(Array.isArray(a)){if(!(s in K5e))throw Error(`Unknown pseudo-class :${s}(${a})`);return K5e[s](e,a,n,o,r)}let c=(i=n.pseudos)===null||i===void 0?void 0:i[s],l=typeof c==="string"?c:kGe[s];if(typeof l==="string"){if(a!=null)throw Error(`Pseudo ${s} doesn't have any arguments`);let h=Kse(l);return K5e.is(e,h,n,o,r)}if(typeof c==="function")return QGe(c,s,a,1),(h)=>c(h,a)&&e(h);if(s in Jse)return Jse[s](e,a,n,o);if(s in j5e){let h=j5e[s];return QGe(h,s,a,2),(d)=>h(d,n,a)&&e(d)}throw Error(`Unknown pseudo-class :${s}`)}function VGe(e,t){let n=t.getParent(e);if(n&&t.isTag(n))return n;return null}function kQt(e,t,n,o,r){let{adapter:i,equals:s}=n;switch(t.type){case ts.PseudoElement:throw Error("Pseudo-elements are not supported by css-select");case ts.ColumnCombinator:throw Error("Column combinators are not yet supported by css-select");case ts.Attribute:{if(t.namespace!=null)throw Error("Namespaced attributes are not yet supported by css-select");if(!n.xmlMode||n.lowerCaseAttributeNames)t.name=t.name.toLowerCase();return DQt[t.action](e,t,n)}case ts.Pseudo:return QQt(e,t,n,o,r);case ts.Tag:{if(t.namespace!=null)throw Error("Namespaced tag names are not yet supported by css-select");let{name:a}=t;if(!n.xmlMode||n.lowerCaseTags)a=a.toLowerCase();return function(l){return i.getName(l)===a&&e(l)}}case ts.Descendant:{if(n.cacheResults===!1||typeof WeakSet>"u")return function(l){let h=l;while(h=VGe(h,i))if(e(h))return!0;return!1};let a=new WeakSet;return function(l){let h=l;while(h=VGe(h,i))if(!a.has(h)){if(i.isTag(h)&&e(h))return!0;a.add(h)}return!1}}case"_flexibleDescendant":return function(c){let l=c;do if(e(l))return!0;while(l=VGe(l,i));return!1};case ts.Parent:return function(c){return i.getChildren(c).some((l)=>i.isTag(l)&&e(l))};case ts.Child:return function(c){let l=i.getParent(c);return l!=null&&i.isTag(l)&&e(l)};case ts.Sibling:return function(c){let l=i.getSiblings(c);for(let h=0;h<l.length;h++){let d=l[h];if(s(c,d))break;if(i.isTag(d)&&e(d))return!0}return!1};case ts.Adjacent:{if(i.prevElementSibling)return function(c){let l=i.prevElementSibling(c);return l!=null&&e(l)};return function(c){let l=i.getSiblings(c),h;for(let d=0;d<l.length;d++){let u=l[d];if(s(c,u))break;if(i.isTag(u))h=u}return!!h&&e(h)}}case ts.Universal:{if(t.namespace!=null&&t.namespace!=="*")throw Error("Namespaced universal selectors are not yet supported by css-select");return e}}}function LQt(e,t,n){let o=$5e(e,t,n);return zGe(o,t.adapter)}function $5e(e,t,n){let o=typeof e==="string"?Kse(e):e;return q5e(o,t,n)}function HQt(e){return e.type===ts.Pseudo&&(e.name==="scope"||Array.isArray(e.data)&&e.data.some((t)=>t.some(HQt)))}var jtr={type:ts.Descendant},Ktr={type:"_flexibleDescendant"},$tr={type:ts.Pseudo,name:"scope",data:null};function qtr(e,{adapter:t},n){let o=!!(n===null||n===void 0?void 0:n.every((r)=>{let i=t.isTag(r)&&t.getParent(r);return r===FGe||i&&t.isTag(i)}));for(let r of e){if(r.length>0&&$se(r[0])&&r[0].type!==ts.Descendant);else if(o&&!r.some(HQt))r.unshift(jtr);else continue;r.unshift($tr)}}function q5e(e,t,n){var o;e.forEach(DGe),n=(o=t.context)!==null&&o!==void 0?o:n;let r=Array.isArray(n),i=n&&(Array.isArray(n)?n:[n]);if(t.relativeSelector!==!1)qtr(e,t,i);else if(e.some((c)=>c.length>0&&$se(c[0])))throw Error("Relative selectors are not allowed when the `relativeSelector` option is disabled");let s=!1,a=e.map((c)=>{if(c.length>=2){let[l,h]=c;if(l.type!==ts.Pseudo||l.name!=="scope");else if(r&&h.type===ts.Descendant)c[1]=Ktr;else if(h.type===ts.Adjacent||h.type===ts.Sibling)s=!0}return Jtr(c,t,i)}).reduce(Ztr,tw.default.falseFunc);return a.shouldTestNextSiblings=s,a}function Jtr(e,t,n){var o;return e.reduce((r,i)=>r===tw.default.falseFunc?tw.default.falseFunc:kQt(r,i,t,n,q5e),(o=t.rootFunc)!==null&&o!==void 0?o:tw.default.trueFunc)}function Ztr(e,t){if(t===tw.default.falseFunc||e===tw.default.trueFunc)return e;if(e===tw.default.falseFunc||t===tw.default.trueFunc)return t;return function(o){return e(o)||t(o)}}var FQt=(e,t)=>e===t,enr={adapter:W5e,equals:FQt};function zQt(e){var t,n,o,r;let i=e!==null&&e!==void 0?e:enr;return(t=i.adapter)!==null&&t!==void 0||(i.adapter=W5e),(n=i.equals)!==null&&n!==void 0||(i.equals=(r=(o=i.adapter)===null||o===void 0?void 0:o.equals)!==null&&r!==void 0?r:FQt),i}function GGe(e){return function(n,o,r){let i=zQt(o);return e(n,i,r)}}var aTs=GGe(LQt),cTs=GGe($5e),lTs=GGe(q5e);function OQt(e){return function(n,o,r){let i=zQt(r);if(typeof n!=="function")n=$5e(n,i,o);let s=tnr(o,i.adapter,n.shouldTestNextSiblings);return e(n,s,i)}}function tnr(e,t,n=!1){if(n)e=nnr(e,t);return Array.isArray(e)?t.removeSubsets(e):t.getChildren(e)}function nnr(e,t){let n=Array.isArray(e)?e.slice(0):[e],o=n.length;for(let r=0;r<o;r++){let i=OGe(n[r],t);n.push(...i)}return n}var oO=OQt((e,t,n)=>e===YGe.default.falseFunc||!t||t.length===0?[]:n.adapter.findAll(e,t)),SK=OQt((e,t,n)=>e===YGe.default.falseFunc||!t||t.length===0?null:n.adapter.findOne(e,t));var MGs=Qe(p0(),1),Zxn=Qe(p0(),1);Kt();m0();Ie();var nP=Qe(wt(),1),xh=Qe(wt(),1);fp();fp();var VQt={name:"@tscircuit/capacity-autorouter",main:"./dist/index.js",version:"0.0.993",type:"module",repository:{type:"git",url:"https://github.com/tscircuit/tscircuit-autorouter"},files:["dist"],scripts:{prepublishOnly:"bun run build && bun scripts/check-published-autorouter-version.ts",start:"cosmos",build:"tsup ./lib/index.ts --minify terser --external @tscircuit/core --external circuit-to-svg --format esm --dts --sourcemap",bench:"bun test tests/spatial-index-bench.test.ts",format:"biome format --write .","format:check":"biome format .","vercel-build":"NODE_OPTIONS=--max-old-space-size=6144 cosmos-export","run-sample":"bun scripts/run-sample.ts","repomix:lib":"repomix --ignore 'testing/**,**/TwoRouteHighDensitySolver/**,**/RouteStitchingSolver/**,solvers/CapacitySegmentPointOptimizer/CapacitySegmentPointOptimizer.ts' lib","bug-report":"bun run scripts/download-bug-report.ts","bug-report-with-test":"bun run scripts/create-bug-report-test.ts"},devDependencies:{"@biomejs/biome":"^1.9.4","@radix-ui/react-icons":"^1.3.2","@radix-ui/react-menubar":"^1.1.14","@react-hook/resize-observer":"^2.0.2","@resvg/resvg-js":"^2.6.2","@tsci/seveibar.dataset-srj13":"git+https://github.com/tscircuit/dataset-srj13.git#56db70039aeb28a76540fe951b5a96be60f9e949","@tsci/dataset-srj23-partially-routed-subcircuits":"git+https://github.com/tscircuit/dataset-srj23-partially-routed-subcircuits.git#53fc559","@tsci/tscircuit.dataset-srj16-bga-breakouts":"git+https://github.com/tscircuit/dataset-srj16-bga-breakouts.git#e8b2e70e1f50a0dba3ad977e140766f53b9b75fb","@tsci/tscircuit.dataset-srj19-bga-passive-overlays":"git+https://github.com/tscircuit/dataset-srj19.git#5104d03ed72a9090d76ea1f42ae9f4bc439f7534","@tsci/tscircuit.dataset-srj20-partial-bga-breakouts":"git+https://github.com/tscircuit/dataset-srj20.git#9384fb8f45fb479b97178ddfa42fc74c69afbbec","@tsci/0hmX.multi-component-dataset-srj01":"git+https://github.com/tscircuit/multi-component-dataset-srj01.git#abf9d17c966d466b56ac21b735c6bb6f4518919d","@tsci/tscircuit.dataset-srj12-bus-routing":"git+https://github.com/tscircuit/dataset-srj12-bus-routing.git#ba82f86a7d1288566b7144eb8661ad2549c5f328","@tscircuit/autorouting-dataset-01":"git+https://github.com/tscircuit/autorouting-dataset-01.git#b97f5052a2359ab2da3f186765c6a5e839535efb","@tscircuit/checks":"^0.0.259","@tscircuit/circuit-json-util":"^0.0.114","@tscircuit/core":"0.0.337","@tscircuit/curvy-trace-solver":"^0.0.10","@tscircuit/dataset-srj05":"git+https://github.com/tscircuit/dataset-srj05.git#9a49c126a89c083dc4d2b72cd17184735f637762","@tscircuit/dataset-srj24":"git+https://github.com/tscircuit/dataset-srj24.git#6340ee442bc36cc5a0fd3c9b84070548ed5f416a","@tscircuit/dataset-srj27-power-traces":"git+https://github.com/tscircuit/dataset-srj27-power-traces.git#eb24d36","@tscircuit/dataset-srj28-partially-prerouted":"git+https://github.com/tscircuit/dataset-srj28-partially-prerouted.git#5b1673544b6ade4480612539ba6574ad414fddc0","@tscircuit/dataset-srj29-ddr3-bga-pairs":"git+https://github.com/ShiboSoftwareDev/dataset-srj29-ddr3-bga-pairs.git#585c3abd4c6ce4be52bbc430b1d5e6dcc9b4ea30","@tscircuit/dataset-srj33-drc-failures":"git+https://github.com/tscircuit/dataset-srj33-drc-failures.git#f566b62be0f83395d9ab63ddc068f9d645b68b16","@tscircuit/fanout-solver":"^0.0.29","@tscircuit/fanout-for-pipeline9-fixtures":"npm:@tscircuit/fanout-solver@0.0.66","@tscircuit/fixed-via-hypergraph-solver":"https://codeload.github.com/tscircuit/fixed-via-hypergraph-solver/tar.gz/bed37a6201b5dd07c9cc68b828917ecc20d6d049","@tscircuit/hypergraph":"^0.0.71","@tscircuit/jumper-topology-generator":"^0.0.4","@tscircuit/krt-wasm":"^0.1.0","@tscircuit/length-matching-solver":"git+https://github.com/tscircuit/length-matching-solver.git#6a85c3ac7cc90f593b177790a988df8b26ece1e7","@tscircuit/math-utils":"^0.0.36","@tscircuit/power-trace-expander":"git+https://github.com/tscircuit/power-trace-expander.git#ab0071efa0be5d5a9cdaf60a6729512ee47c6645","@tscircuit/rectdiff":"git+https://github.com/tscircuit/rectdiff.git#d3a8b095035f4e7d03cdb19f2fdb7a554c6c008a","@tscircuit/repair04":"https://codeload.github.com/tscircuit/repair04/tar.gz/81d4585d335ea1958a1c6569e4064c58cba44bad","@tscircuit/solver-utils":"^0.0.16","@tscircuit/trace-simplification-solver":"github:tscircuit/trace-simplification-solver#404f2ab10bac05bccf9b11e6b30bdd16d0694b07","@types/bun":"^1.2.23","@types/fast-json-stable-stringify":"^2.1.2","@types/object-hash":"^3.0.6","@types/rbush":"^4.0.0","@types/react":"^19.0.8","@types/react-dom":"^19.0.3","@vercel/node":"^5.1.7","@vitejs/plugin-react":"^4.3.4","bun-match-svg":"^0.0.14","circuit-json-to-connectivity-map":"^0.0.34","circuit-json":"^0.0.525","circuit-to-svg":"^0.0.220",clsx:"^2.1.1","dataset-srj11-45-degree":"git+https://github.com/tscircuit/dataset-srj11-45-degree.git#c49dd43c38f85fa2777c7d67393df413ca8d5a75","dataset-srj18":"git+https://github.com/tscircuit/dataset-srj18.git#100e8957ce789b5b288e14c476dc83f4efc5214b",flatbush:"^4.4.0","format-si-unit":"0.0.12","graphics-debug":"0.0.99","high-density-dataset-z04":"git+https://github.com/tscircuit/high-density-dataset-z04.git#b9128ed52f5a50102b6526319be1d4ec33dca2c2","kicad-to-circuit-json":"0.0.77",kleur:"^4.1.5","looks-same":"9","pcb-poly-hyper-graph":"https://codeload.github.com/tscircuit/pcb-poly-hyper-graph/tar.gz/80db1463c4a47506eeda15b2c14d59679de900f8",rbush:"^4.0.1",react:"18","react-for-pipeline9-fixtures":"npm:react@19.2.8","react-cosmos":"^6.2.3","react-cosmos-plugin-vite":"^6.2.0","react-dom":"18","react-konva":"18",recharts:"^2.15.1","tailwind-merge":"^3.2.0",terser:"^5.43.1","tiny-hypergraph":"git+https://github.com/tscircuit/tiny-hypergraph.git#e5e1d34f6df3f9b364dc420b17ec5c97cd487fa0","tiny-hypergraph-poly":"git+https://github.com/tscircuit/tiny-hypergraph.git#7b93b4c",tsup:"^8.3.6","tscircuit-for-pipeline9-fixtures":"npm:tscircuit@0.0.2467",typescript:"^5.9.3","use-mouse-matrix-transform":"^1.3.0",vite:"^6.0.11","vite-tsconfig-paths":"^5.1.4","zdwiel-dataset":"git+https://github.com/dwiel/tscircuit-benchmark.git#be36518b5bf51755dae92c230061ab3cf4e3e063","high-density-repair01":"git+https://github.com/tscircuit/high-density-repair01.git#27b3392c38ed4474b0557c73640b261155e28c27","high-density-repair02":"https://codeload.github.com/tscircuit/high-density-repair02/tar.gz/1981ac8d3547772cb4b0267f26c7a0c2fd4dea09","high-density-repair03":"https://codeload.github.com/tscircuit/high-density-repair03/tar.gz/79c9b022a678b1f0289059962bf49f253310a5dc","@tscircuit/high-density-a01":"git+https://github.com/tscircuit/high-density-a01.git#44005d6b9dde7d93a3d3a4815b4e7c8c52b59d34","@tscircuit/high-density-a13":"git+https://github.com/tscircuit/high-density-a01.git#c6812cebd44b09f29f2fee929837b313b822f2ae","@tscircuit/high-density-b01":"git+https://github.com/tscircuit/high-density-b01.git#e651cab6c314e7aab6df31fd6067277436f67148"},dependencies:{"fast-json-stable-stringify":"^2.1.0","object-hash":"^3.0.0","stack-svgs":"^0.0.1","@tscircuit/pcb-trace-linter":"github:tscircuit/pcb-trace-linter#4c035f9d40ffb03ba547a08975b5e64b20371123"}};m0();var v9=Qe(wt(),1);Kt();var ak=Qe(wt(),1),e7e=Qe(wt(),1);Kt();tc();tc();kre();Kt();var Lk=Qe(wt(),1);Ie();Kt();var eUs=Qe(rn(),1),f5n=Qe(GQt(),1),Mve=Qe(WGe(),1),x5n=Qe(wt(),1);Kt();var v5n=Qe(wt(),1),P5n=Qe(wt(),1);var t7e=Qe(wt(),1);var M5n=Qe(wt(),1);var pUs=Qe(wt(),1);var T5n=Qe(wt(),1);Kt();var N5n=Qe(wt(),1);var mot=Qe(wt(),1);var Q5n=Qe(wt(),1);var L5n=Qe(wt(),1);var F5n=Qe(wt(),1);Kt();Ie();var Dde=Qe(wt(),1),Zhe=Qe(wt(),1);Kt();Ie();Kt();var Y5n=Qe(wt(),1);var _ot=Qe(wt(),1);var got=Qe(wt(),1);var Aot=Qe(wt(),1);var inr=Object.keys({a:1,b:0,c:0,d:1,e:0,f:0,m11:1,m12:0,m13:0,m14:0,m21:0,m22:1,m23:0,m24:0,m31:0,m32:0,m33:1,m34:0,m41:0,m42:0,m43:0,m44:1,is2D:!0,isIdentity:!0}),WQt=(e)=>(e instanceof Float64Array||e instanceof Float32Array||Array.isArray(e)&&e.every((t)=>typeof t==="number"))&&[6,16].some((t)=>e.length===t),XQt=(e)=>typeof DOMMatrix<"u"&&e instanceof DOMMatrix||e instanceof B2||typeof e==="object"&&inr.every((t)=>e&&(t in e)),Z5e=(e,t)=>{if(!WQt(e))throw TypeError(`CSSMatrix: "${Array.from(e).join(",")}" must be an array with 6/16 numbers.`);if(e.length===16){let[c,l,h,d,u,_,p,m,A,g,f,y,x,C,b,I]=e;return eae(t??new B2,c,l,h,d,u,_,p,m,A,g,f,y,x,C,b,I)}let[n,o,r,i,s,a]=e;return eae(t??new B2,n,o,0,0,r,i,0,0,0,0,1,0,s,a,0,1)},eae=(e,t,n,o,r,i,s,a,c,l,h,d,u,_,p,m,A)=>(e.m11=t,e.a=t,e.m21=i,e.c=i,e.m31=l,e.m41=_,e.e=_,e.m12=n,e.b=n,e.m22=s,e.d=s,e.m32=h,e.m42=p,e.f=p,e.m13=o,e.m23=a,e.m33=d,e.m43=m,e.m14=r,e.m24=c,e.m34=u,e.m44=A,e),XGe=(e,t,n,o,r,i,s,a,c,l,h,d,u,_,p,m)=>eae(new B2,e,t,n,o,r,i,s,a,c,l,h,d,u,_,p,m),J5e=(e,t)=>{if(XQt(e))return eae(t??new B2,e.m11,e.m12,e.m13,e.m14,e.m21,e.m22,e.m23,e.m24,e.m31,e.m32,e.m33,e.m34,e.m41,e.m42,e.m43,e.m44);throw TypeError(`CSSMatrix: "${JSON.stringify(e)}" is not a DOMMatrix / CSSMatrix / JSON compatible object.`)},jGe=(e)=>{if(typeof e!=="string")throw TypeError(`CSSMatrix: "${JSON.stringify(e)}" is not a string.`);let t=String(e).replace(/\s/g,""),n=new B2,o=`CSSMatrix: invalid transform string "${e}"`,r=/([\w-]+)\(([^)]*)\)/g,i=0,s;while(s=r.exec(t)){let a=s[1],c=s[2];if(i+=s[0].length,!c)throw TypeError(o);let l=c.split(",").map((A)=>A.includes("rad")?parseFloat(A)*(180/Math.PI):parseFloat(A)),[h,d,u,_]=l,p=[h,d,u],m=[h,d,u,_];if(a==="perspective"&&h&&[d,u].every((A)=>A===void 0))n.m34=-1/h;else if(a.includes("matrix")&&[6,16].includes(l.length)&&l.every((A)=>!Number.isNaN(+A))){let A=l.map((g)=>Math.abs(g)<0.000001?0:g);n.multiplySelf(Z5e(A))}else if(a==="translate3d"&&p.every((A)=>!Number.isNaN(+A)))n.translateSelf(h,d,u);else if(a==="translate"&&h&&u===void 0)n.translateSelf(h,d||0,0);else if(a==="rotate3d"&&m.every((A)=>!Number.isNaN(+A))&&_)n.rotateAxisAngleSelf(h,d,u,_);else if(a==="rotate"&&h&&[d,u].every((A)=>A===void 0))n.rotateSelf(0,0,h);else if(a==="scale3d"&&p.every((A)=>!Number.isNaN(+A))&&p.some((A)=>A!==1))n.scaleSelf(h,d,u);else if(a==="scale"&&!Number.isNaN(h)&&(h!==1||d!==1)&&u===void 0){let A=Number.isNaN(+d)?h:d;n.scaleSelf(h,A,1)}else if(a==="skew"&&(h||!Number.isNaN(h)&&d)&&u===void 0)n.skewSelf(h,d||0);else if(["translate","rotate","scale","skew"].some((A)=>a.includes(A))&&/[XYZ]/.test(a)&&h&&[d,u].every((A)=>A===void 0))if(a==="skewX"||a==="skewY")n[a==="skewX"?"skewXSelf":"skewYSelf"](h);else{let A=a.replace(/[XYZ]/,""),g=a.replace(A,""),f=["X","Y","Z"].indexOf(g),y=A==="scale"?1:0,x=A+"Self",C=[f===0?h:y,f===1?h:y,f===2?h:y];n[x](...C)}else throw TypeError(o)}if(i!==t.length)throw TypeError(o);return n},snr=(e,t)=>{if(t)return[e.a,e.b,e.c,e.d,e.e,e.f];return[e.m11,e.m12,e.m13,e.m14,e.m21,e.m22,e.m23,e.m24,e.m31,e.m32,e.m33,e.m34,e.m41,e.m42,e.m43,e.m44]},anr=(e,t,n)=>{let o=new B2;return o.m41=e,o.e=e,o.m42=t,o.f=t,o.m43=n,o},KGe=(e,t,n)=>{let o=new B2,r=Math.PI/180,i=e*r,s=t*r,a=n*r,c=Math.cos(i),l=-Math.sin(i),h=Math.cos(s),d=-Math.sin(s),u=Math.cos(a),_=-Math.sin(a),p=h*u,m=-h*_;o.m11=p,o.a=p,o.m12=m,o.b=m,o.m13=d;let A=l*d*u+c*_;o.m21=A,o.c=A;let g=c*u-l*d*_;return o.m22=g,o.d=g,o.m23=-l*h,o.m31=l*_-c*d*u,o.m32=l*u+c*d*_,o.m33=c*h,o},$Ge=(e=0,t=0,n=0,o=0)=>{let r=new B2,i=Math.sqrt(e*e+t*t+n*n);if(i===0)return r;let s=e/i,a=t/i,c=n/i,l=o*(Math.PI/360),h=Math.sin(l),d=Math.cos(l),u=h*h,_=s*s,p=a*a,m=c*c,A=1-2*(p+m)*u;r.m11=A,r.a=A;let g=2*(s*a*u+c*h*d);r.m12=g,r.b=g,r.m13=2*(s*c*u-a*h*d);let f=2*(a*s*u-c*h*d);r.m21=f,r.c=f;let y=1-2*(m+_)*u;return r.m22=y,r.d=y,r.m23=2*(a*c*u+s*h*d),r.m31=2*(c*s*u+a*h*d),r.m32=2*(c*a*u-s*h*d),r.m33=1-2*(_+p)*u,r},cnr=(e,t,n)=>{let o=new B2;return o.m11=e,o.a=e,o.m22=t,o.d=t,o.m33=n,o},qGe=(e,t)=>{let n=new B2;if(e){let o=e*Math.PI/180,r=Math.tan(o);n.m21=r,n.c=r}if(t){let o=t*Math.PI/180,r=Math.tan(o);n.m12=r,n.b=r}return n},lnr=(e)=>qGe(e,0),hnr=(e)=>qGe(0,e),jQt=(e,t,n)=>{let o=t.m11*e.m11+t.m12*e.m21+t.m13*e.m31+t.m14*e.m41,r=t.m11*e.m12+t.m12*e.m22+t.m13*e.m32+t.m14*e.m42,i=t.m11*e.m13+t.m12*e.m23+t.m13*e.m33+t.m14*e.m43,s=t.m11*e.m14+t.m12*e.m24+t.m13*e.m34+t.m14*e.m44,a=t.m21*e.m11+t.m22*e.m21+t.m23*e.m31+t.m24*e.m41,c=t.m21*e.m12+t.m22*e.m22+t.m23*e.m32+t.m24*e.m42,l=t.m21*e.m13+t.m22*e.m23+t.m23*e.m33+t.m24*e.m43,h=t.m21*e.m14+t.m22*e.m24+t.m23*e.m34+t.m24*e.m44,d=t.m31*e.m11+t.m32*e.m21+t.m33*e.m31+t.m34*e.m41,u=t.m31*e.m12+t.m32*e.m22+t.m33*e.m32+t.m34*e.m42,_=t.m31*e.m13+t.m32*e.m23+t.m33*e.m33+t.m34*e.m43,p=t.m31*e.m14+t.m32*e.m24+t.m33*e.m34+t.m34*e.m44,m=t.m41*e.m11+t.m42*e.m21+t.m43*e.m31+t.m44*e.m41,A=t.m41*e.m12+t.m42*e.m22+t.m43*e.m32+t.m44*e.m42,g=t.m41*e.m13+t.m42*e.m23+t.m43*e.m33+t.m44*e.m43,f=t.m41*e.m14+t.m42*e.m24+t.m43*e.m34+t.m44*e.m44;return n.m11=o,n.a=o,n.m21=a,n.c=a,n.m31=d,n.m41=m,n.e=m,n.m12=r,n.b=r,n.m22=c,n.d=c,n.m32=u,n.m42=A,n.f=A,n.m13=i,n.m23=l,n.m33=_,n.m43=g,n.m14=s,n.m24=h,n.m34=p,n.m44=f,n},UQt=(e,t)=>jQt(e,t,new B2),B2=class{static Translate=anr;static Rotate=KGe;static RotateAxisAngle=$Ge;static Scale=cnr;static SkewX=lnr;static SkewY=hnr;static Skew=qGe;static Multiply=UQt;static fromArray=Z5e;static fromMatrix=J5e;static fromString=jGe;static toArray=snr;static isCompatibleArray=WQt;static isCompatibleObject=XQt;constructor(e){if(e){if(typeof e==="string"&&e.length&&e!=="none")return jGe(e);if(Array.isArray(e)||e instanceof Float64Array||e instanceof Float32Array)return Z5e(e);if(typeof e==="object")return J5e(e)}return this.a=1,this.b=0,this.c=0,this.d=1,this.e=0,this.f=0,this.m11=1,this.m12=0,this.m13=0,this.m14=0,this.m21=0,this.m22=1,this.m23=0,this.m24=0,this.m31=0,this.m32=0,this.m33=1,this.m34=0,this.m41=0,this.m42=0,this.m43=0,this.m44=1,this}get isIdentity(){return this.m11===1&&this.m12===0&&this.m13===0&&this.m14===0&&this.m21===0&&this.m22===1&&this.m23===0&&this.m24===0&&this.m31===0&&this.m32===0&&this.m33===1&&this.m34===0&&this.m41===0&&this.m42===0&&this.m43===0&&this.m44===1}get is2D(){return this.m31===0&&this.m32===0&&this.m33===1&&this.m34===0&&this.m43===0&&this.m44===1}setMatrixValue(e){if(typeof e==="string"&&e.length&&e!=="none"){let t=jGe(e);return eae(this,t.m11,t.m12,t.m13,t.m14,t.m21,t.m22,t.m23,t.m24,t.m31,t.m32,t.m33,t.m34,t.m41,t.m42,t.m43,t.m44)}if(Array.isArray(e)||e instanceof Float64Array||e instanceof Float32Array)return Z5e(e,this);if(typeof e==="object")return J5e(e,this);return this}toFloat32Array(e){return e?new Float32Array([this.a,this.b,this.c,this.d,this.e,this.f]):new Float32Array([this.m11,this.m12,this.m13,this.m14,this.m21,this.m22,this.m23,this.m24,this.m31,this.m32,this.m33,this.m34,this.m41,this.m42,this.m43,this.m44])}toFloat64Array(e){return e?new Float64Array([this.a,this.b,this.c,this.d,this.e,this.f]):new Float64Array([this.m11,this.m12,this.m13,this.m14,this.m21,this.m22,this.m23,this.m24,this.m31,this.m32,this.m33,this.m34,this.m41,this.m42,this.m43,this.m44])}toString(){let{is2D:e}=this,t=this.toFloat64Array(e).join(", ");return`${e?"matrix":"matrix3d"}(${t})`}toJSON(){let{is2D:e,isIdentity:t}=this;return{a:this.a,b:this.b,c:this.c,d:this.d,e:this.e,f:this.f,m11:this.m11,m12:this.m12,m13:this.m13,m14:this.m14,m21:this.m21,m22:this.m22,m23:this.m23,m24:this.m24,m31:this.m31,m32:this.m32,m33:this.m33,m34:this.m34,m41:this.m41,m42:this.m42,m43:this.m43,m44:this.m44,is2D:e,isIdentity:t}}multiply(e){return UQt(this,e)}translate(e,t,n){let o=t??0,r=n??0,{m11:i,m12:s,m13:a,m14:c,m21:l,m22:h,m23:d,m24:u,m31:_,m32:p,m33:m,m34:A,m41:g,m42:f,m43:y,m44:x}=this,C=e*i+o*l+r*_+g,b=e*s+o*h+r*p+f,I=e*a+o*d+r*m+y,v=e*c+o*u+r*A+x;return XGe(i,s,a,c,l,h,d,u,_,p,m,A,C,b,I,v)}scale(e,t,n){let o=t??e,r=n??1,{m41:i,m42:s,m43:a,m44:c}=this;return XGe(this.m11*e,this.m12*e,this.m13*e,this.m14*e,this.m21*o,this.m22*o,this.m23*o,this.m24*o,this.m31*r,this.m32*r,this.m33*r,this.m34*r,i,s,a,c)}rotate(e,t,n){let o=e,r=t||0,i=n||0;if(typeof e==="number"&&typeof t>"u"&&typeof n>"u")i=o,o=0,r=0;return this.multiply(KGe(o,r,i))}rotateAxisAngle(e=0,t=0,n=0,o=0){if([e,t,n,o].some((r)=>!Number.isFinite(r)))throw TypeError("CSSMatrix: expecting 4 values");if(Math.sqrt(e*e+t*t+n*n)===0)return J5e(this);return this.multiply($Ge(e,t,n,o))}skewX(e){return this.skew(e,0)}skewY(e){return this.skew(0,e)}skew(e,t){let n=e?Math.tan(e*Math.PI/180):0,o=t?Math.tan(t*Math.PI/180):0,{m11:r,m12:i,m13:s,m14:a,m21:c,m22:l,m23:h,m24:d}=this;return XGe(r+o*c,i+o*l,s+o*h,a+o*d,n*r+c,n*i+l,n*s+h,n*a+d,this.m31,this.m32,this.m33,this.m34,this.m41,this.m42,this.m43,this.m44)}multiplySelf(e){return jQt(this,e,this),this}translateSelf(e,t,n){let o=t??0,r=n??0,{m11:i,m12:s,m13:a,m14:c,m21:l,m22:h,m23:d,m24:u,m31:_,m32:p,m33:m,m34:A,m41:g,m42:f,m43:y,m44:x}=this,C=e*i+o*l+r*_+g,b=e*s+o*h+r*p+f,I=e*a+o*d+r*m+y,v=e*c+o*u+r*A+x;return this.m41=C,this.e=C,this.m42=b,this.f=b,this.m43=I,this.m44=v,this}scaleSelf(e,t,n){let o=t??e,r=n??1;return this.m11*=e,this.a*=e,this.m12*=e,this.b*=e,this.m13*=e,this.m14*=e,this.m21*=o,this.c*=o,this.m22*=o,this.d*=o,this.m23*=o,this.m24*=o,this.m31*=r,this.m32*=r,this.m33*=r,this.m34*=r,this}rotateSelf(e,t,n){let o=e,r=t||0,i=n||0;if(typeof e==="number"&&typeof t>"u"&&typeof n>"u")i=o,o=0,r=0;return this.multiplySelf(KGe(o,r,i))}rotateAxisAngleSelf(e=0,t=0,n=0,o=0){if([e,t,n,o].some((r)=>!Number.isFinite(r)))throw TypeError("CSSMatrix: expecting 4 values");if(Math.sqrt(e*e+t*t+n*n)===0)return this;return this.multiplySelf($Ge(e,t,n,o))}skewXSelf(e){return this.skewSelf(e,0)}skewYSelf(e){return this.skewSelf(0,e)}skewSelf(e,t){let n=e?Math.tan(e*Math.PI/180):0,o=t?Math.tan(t*Math.PI/180):0,{m11:r,m12:i,m13:s,m14:a,m21:c,m22:l,m23:h,m24:d}=this,u=r+o*c,_=i+o*l,p=s+o*h,m=a+o*d,A=n*r+c,g=n*i+l,f=n*s+h,y=n*a+d;return this.m11=u,this.a=u,this.m12=_,this.b=_,this.m13=p,this.m14=m,this.m21=A,this.c=A,this.m22=g,this.d=g,this.m23=f,this.m24=y,this}transformPoint(e){let t=this.m11*e.x+this.m21*e.y+this.m31*e.z+this.m41*e.w,n=this.m12*e.x+this.m22*e.y+this.m32*e.z+this.m42*e.w,o=this.m13*e.x+this.m23*e.y+this.m33*e.z+this.m43*e.w,r=this.m14*e.x+this.m24*e.y+this.m34*e.z+this.m44*e.w;return typeof DOMPoint<"u"&&e instanceof DOMPoint?new DOMPoint(t,n,o,r):{x:t,y:n,z:o,w:r}}};/*!
* SVGPathCommander v2.3.3 (http://thednp.github.io/svg-path-commander)
* Copyright 2026 © thednp
* Licensed under MIT (https://github.com/thednp/svg-path-commander/blob/master/LICENSE)
*/var dnr="2.3.3",P7=([e,t],[n,o],r)=>[e+(n-e)*r,t+(o-t)*r],l4e=(e,t)=>Math.sqrt((e[0]-t[0])*(e[0]-t[0])+(e[1]-t[1])*(e[1]-t[1])),wK=(e,t,n,o)=>l4e([e,t],[n,o]),e4e=(e,t,n,o,r)=>{let i={x:e,y:t};if(typeof r==="number"){let s=l4e([e,t],[n,o]);if(r<=0)i={x:e,y:t};else if(r>=s)i={x:n,y:o};else{let[a,c]=P7([e,t],[n,o],r/s);i={x:a,y:c}}}return i},JGe=(e,t,n,o)=>{let{min:r,max:i}=Math;return[r(e,n),r(t,o),i(e,n),i(t,o)]},unr={getLineBBox:JGe,getLineLength:wK,getPointAtLineLength:e4e},oae=[-0.06405689286260563,0.06405689286260563,-0.1911188674736163,0.1911188674736163,-0.3150426796961634,0.3150426796961634,-0.4337935076260451,0.4337935076260451,-0.5454214713888396,0.5454214713888396,-0.6480936519369755,0.6480936519369755,-0.7401241915785544,0.7401241915785544,-0.820001985973903,0.820001985973903,-0.8864155270044011,0.8864155270044011,-0.9382745520027328,0.9382745520027328,-0.9747285559713095,0.9747285559713095,-0.9951872199970213,0.9951872199970213],dUe=[0.12793819534675216,0.12793819534675216,0.1258374563468283,0.1258374563468283,0.12167047292780339,0.12167047292780339,0.1155056680537256,0.1155056680537256,0.10744427011596563,0.10744427011596563,0.09761865210411388,0.09761865210411388,0.08619016153195327,0.08619016153195327,0.0733464814110803,0.0733464814110803,0.05929858491543678,0.05929858491543678,0.04427743881741981,0.04427743881741981,0.028531388628933663,0.028531388628933663,0.0123412297999872,0.0123412297999872],h4e=(e)=>{let t=[];for(let n=e,o=n.length,r=o-1;o>1;o-=1,r-=1){let i=[];for(let s=0;s<r;s+=1)i.push({x:r*(n[s+1].x-n[s].x),y:r*(n[s+1].y-n[s].y),t:0});t.push(i),n=i}return t},d4e=(e,t)=>{if(t===0)return e[0].t=0,e[0];let n=e.length-1;if(t===1)return e[n].t=1,e[n];let o=1-t,r=e;if(n===0)return e[0].t=t,e[0];if(n===1)return{x:o*r[0].x+t*r[1].x,y:o*r[0].y+t*r[1].y,t};let i=o*o,s=t*t,a=0,c=0,l=0,h=0;if(n===2)r=[r[0],r[1],r[2],{x:0,y:0}],a=i,c=o*t*2,l=s;else if(n===3)a=i*o,c=i*t*3,l=o*s*3,h=t*s;return{x:a*r[0].x+c*r[1].x+l*r[2].x+h*r[3].x,y:a*r[0].y+c*r[1].y+l*r[2].y+h*r[3].y,t}},rkt=(e,t)=>{let n=e(t),o=n.x*n.x+n.y*n.y;return Math.sqrt(o)},ikt=(e)=>u4e(e,1),u4e=(e,t)=>{let n=t/2,o=oae.length,r=0;for(let i=0,s;i<o;i++)s=n*oae[i]+n,r+=dUe[i]*rkt(e,s);return n*r},p4e=(e)=>{let t=[];for(let n=0,o=e.length,r=2;n<o;n+=r)t.push({x:e[n],y:e[n+1]});return t},pnr=(e,t)=>{let n=h4e(p4e(e));return u4e((o)=>d4e(n[0],o),t)},uUe=(e,t)=>{let n=h4e(p4e(e)),o=(s)=>d4e(n[0],s),r=0,i=1;for(let s=0;s<25;s+=1){let a=(r+i)/2;if(u4e(o,a)<t)r=a;else i=a}return(r+i)/2},aae=(e)=>{let t=p4e(e),n=h4e(t);return ikt((o)=>d4e(n[0],o))},mnr=0.00000001,t4e=([e,t,n])=>{let o=Math.min(e,n),r=Math.max(e,n);if(t>=e?n>=t:n<=t)return[o,r];let i=(e*n-t*t)/(e-2*t+n);return i<o?[i,r]:[o,i]},ZGe=([e,t,n,o])=>{let r=e-3*t+3*n-o;if(Math.abs(r)<0.00000001){if(e===o&&e===t)return[e,o];return t4e([e,-0.5*e+1.5*t,e-3*t+3*n])}let i=-e*n+e*o-t*n-t*o+t*t+n*n;if(i<=0)return[Math.min(e,o),Math.max(e,o)];let s=Math.sqrt(i),a=Math.min(e,o),c=Math.max(e,o),l=e-2*t+n;for(let h=(l+s)/r,d=1;d<=2;h=(l-s)/r,d++)if(h>0&&h<1){let u=e*(1-h)*(1-h)*(1-h)+t*3*(1-h)*(1-h)*h+n*3*(1-h)*h*h+o*h*h*h;if(u<a)a=u;if(u>c)c=u}return[a,c]},_nr={bezierLength:ikt,bezierLengthAtT:u4e,calculateBezier:rkt,CBEZIER_MINMAX_EPSILON:mnr,computeBezier:d4e,Cvalues:dUe,deriveBezier:h4e,getBezierLength:aae,getBezierLengthAtT:pnr,getBezierPoints:p4e,getTAtBezierLength:uUe,minmaxC:ZGe,minmaxQ:t4e,Tvalues:oae},n4e=(e,t,n)=>{let o=n<0?-1:1,r=Math.abs(n),i=Math.PI/2,s=0,a=r,c=0;while(a>0){let l=Math.min(i,a),h=l/2,d=0;for(let u=0,_=oae.length;u<_;u+=1){let p=c+h*oae[u]+h;d+=dUe[u]*Math.sqrt((e*Math.sin(p))**2+(t*Math.cos(p))**2)}s+=h*d,c+=l,a-=l}return o*s},o4e=(e,t,n,o)=>n4e(e,t,o)-n4e(e,t,n),gnr=(e,t,n)=>Math.abs(n4e(e,t,n)),iO=(e,t,n,o,r,i)=>{let{sin:s,cos:a}=Math,c=a(r),l=s(r),h=n*a(i),d=o*s(i);return[e+c*h-l*d,t+l*h+c*d]},eUe=(e,t)=>{let{x:n,y:o}=e,{x:r,y:i}=t,s=n*r+o*i,a=Math.sqrt((n**2+o**2)*(r**2+i**2));return(n*i-o*r<0?-1:1)*Math.acos(s/a)},m4e=(e,t,n,o,r,i,s,a,c)=>{let{abs:l,sin:h,cos:d,sqrt:u,PI:_}=Math,p=l(n),m=l(o),A=(r%360+360)%360*(_/180);if(e===a&&t===c)return{rx:p,ry:m,startAngle:0,endAngle:0,center:{x:a,y:c}};if(p===0||m===0)return{rx:p,ry:m,startAngle:0,endAngle:0,center:{x:(a+e)/2,y:(c+t)/2}};let g=(e-a)/2,f=(t-c)/2,y={x:d(A)*g+h(A)*f,y:-h(A)*g+d(A)*f},x=y.x**2/p**2+y.y**2/m**2;if(x>1)p*=u(x),m*=u(x);let C=(p**2*m**2-p**2*y.y**2-m**2*y.x**2)/(p**2*y.y**2+m**2*y.x**2);C=C<0?0:C;let b=(i!==s?1:-1)*u(C),I={x:b*(p*y.y/m),y:b*(-(m*y.x)/p)},v={x:d(A)*I.x-h(A)*I.y+(e+a)/2,y:h(A)*I.x+d(A)*I.y+(t+c)/2},P={x:(y.x-I.x)/p,y:(y.y-I.y)/m},M=eUe({x:1,y:0},P),B={x:(-y.x-I.x)/p,y:(-y.y-I.y)/m},T=eUe(P,B);if(!s&&T>0)T-=2*_;else if(s&&T<0)T+=2*_;return T%=2*_,{center:v,startAngle:M,endAngle:M+T,rx:p,ry:m}},pUe=(e,t,n,o,r,i,s,a,c)=>{let{rx:l,ry:h,startAngle:d,endAngle:u}=m4e(e,t,n,o,r,i,s,a,c);return Math.abs(o4e(l,h,d,u))},skt=(e,t,n,o,r,i,s,a,c,l)=>{let h={x:e,y:t},{center:d,rx:u,ry:_,startAngle:p,endAngle:m}=m4e(e,t,n,o,r,i,s,a,c);if(typeof l==="number"){let A=m-p,g=Math.abs(o4e(u,_,p,m));if(l<=0)h={x:e,y:t};else if(l>=g)h={x:a,y:c};else{if(e===a&&t===c)return{x:a,y:c};if(u===0||_===0)return e4e(e,t,a,c,l);let{PI:f,cos:y,sin:x}=Math,C=(r%360+360)%360*(f/180),b=0,I=1;for(let B=0;B<25;B+=1){let T=(b+I)/2;if(Math.abs(o4e(u,_,p,p+A*T))<l)b=T;else I=T}let v=p+A*((b+I)/2),P=u*y(v),M=_*x(v);h={x:y(C)*P-x(C)*M+d.x,y:x(C)*P+y(C)*M+d.y}}}return h},akt=(e,t,n,o,r,i,s,a,c)=>{let{center:l,rx:h,ry:d,startAngle:u,endAngle:_}=m4e(e,t,n,o,r,i,s,a,c),p=_-u,{min:m,max:A,tan:g,atan2:f,PI:y}=Math,{x,y:C}=l,b=r*y/180,I=g(b),v=f(-d*I,h),P=v,M=v+y,B=f(d,h*I),T=B+y,N=[a],D=[c],L=m(e,a),H=A(e,a),V=m(t,c),O=A(t,c),U=_-p*0.00001,j=iO(x,C,h,d,b,U),Y=_-p*0.99999,X=iO(x,C,h,d,b,Y);if(j[0]>H||X[0]>H){let K=iO(x,C,h,d,b,P);N.push(K[0]),D.push(K[1])}if(j[0]<L||X[0]<L){let K=iO(x,C,h,d,b,M);N.push(K[0]),D.push(K[1])}if(j[1]<V||X[1]<V){let K=iO(x,C,h,d,b,T);N.push(K[0]),D.push(K[1])}if(j[1]>O||X[1]>O){let K=iO(x,C,h,d,b,B);N.push(K[0]),D.push(K[1])}return L=m.apply([],N),V=m.apply([],D),H=A.apply([],N),O=A.apply([],D),[L,V,H,O]},Anr={angleBetween:eUe,arcLength:gnr,arcLengthAtAngle:n4e,arcLengthBetween:o4e,arcPoint:iO,getArcBBox:akt,getArcLength:pUe,getArcProps:m4e,getPointAtArcLength:skt},ckt=([e,t,n,o,r,i,s,a],c)=>{let l=1-c;return{x:l**3*e+3*l**2*c*n+3*l*c**2*r+c**3*s,y:l**3*t+3*l**2*c*o+3*l*c**2*i+c**3*a}},aO=(e,t,n,o,r,i,s,a)=>aae([e,t,n,o,r,i,s,a]),r4e=(e,t,n,o,r,i,s,a,c)=>{let l=typeof c==="number",h={x:e,y:t};if(l){let d=[e,t,n,o,r,i,s,a],u=aae(d);if(c<=0);else if(c>=u)h={x:s,y:a};else{let _=uUe(d,c);h=ckt(d,_)}}return h},rae=(e,t,n,o,r,i,s,a)=>{let c=ZGe([e,n,r,s]),l=ZGe([t,o,i,a]);return[c[0],l[0],c[1],l[1]]},fnr={getCubicBBox:rae,getCubicLength:aO,getPointAtCubicLength:r4e,getPointAtCubicSegmentLength:ckt},lkt=([e,t,n,o,r,i],s)=>{let a=1-s;return{x:a**2*e+2*a*s*n+s**2*r,y:a**2*t+2*a*s*o+s**2*i}},i4e=(e,t,n,o,r,i)=>aae([e,t,n,o,r,i]),hkt=(e,t,n,o,r,i,s)=>{let a=typeof s==="number",c={x:e,y:t};if(a){let l=[e,t,n,o,r,i],h=aae(l);if(s<=0);else if(s>=h)c={x:r,y:i};else{let d=uUe(l,s);c=lkt(l,d)}}return c},tUe=(e,t,n,o,r,i)=>{let s=t4e([e,n,r]),a=t4e([t,o,i]);return[s[0],a[0],s[1],a[1]]},ynr={getPointAtQuadLength:hkt,getPointAtQuadSegmentLength:lkt,getQuadBBox:tUe,getQuadLength:i4e},BK=(e)=>{let t=e.length,n=-1,o,r=e[t-1],i=0;while(++n<t)o=r,r=e[n],i+=o[1]*r[0]-o[0]*r[1];return i/2},xnr=(e)=>e.reduce((t,n,o)=>{if(o)return t+l4e(e[o-1],n);return 0},0),Cnr=(e)=>{if(e.length===0)return[0,0];let t=0,n=0;for(let[r,i]of e)t+=r,n+=i;let o=e.length;return[t/o,n/o]},bnr={polygonArea:BK,polygonLength:xnr,polygonCentroid:Cnr},tae=(e,t,n)=>{let{sin:o,cos:r}=Math;return{x:e*r(n)-t*o(n),y:e*o(n)+t*r(n)}},nd=(e,t)=>{let n=t>=1?10**t:1;return t>0?Math.round(e*n)/n:Math.round(e)},SR={origin:[0,0,0],round:4},EK={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0},nUe=(e)=>{let t=e.pathValue[e.segmentStart],n=t.toLowerCase(),{data:o}=e,r=0;while(o.length-r>=EK[n]){if(n==="m"&&o.length-r>2){let i=[,,,];i[0]=t,i[1]=o[r],i[2]=o[r+1],e.segments.push(i),r+=2,n="l",t=t==="m"?"l":"L"}else{let i=EK[n],s=Array(i+1);s[0]=t;for(let a=0;a<i;a+=1)s[a+1]=o[r+a];e.segments.push(s),r+=i}if(!EK[n])break}},cg="SVGPathCommanderError",dkt=(e)=>{let{index:t,pathValue:n}=e,o=n.charCodeAt(t);if(o===48){e.param=0,e.index+=1;return}if(o===49){e.param=1,e.index+=1;return}e.err=`${cg}: invalid Arc flag "${n[t]}", expecting 0 or 1 at index ${t}`},IR=(e)=>e>=48&&e<=57,vR="Invalid path value",ukt=(e)=>{let{max:t,pathValue:n,index:o}=e,r=o,i=!1,s=!1,a=!1,c=!1,l;if(r>=t){e.err=`${cg}: ${vR} at index ${r}, "pathValue" is missing param`;return}if(l=n.charCodeAt(r),l===43||l===45)r+=1,l=n.charCodeAt(r);if(!IR(l)&&l!==46){e.err=`${cg}: ${vR} at index ${r}, "${n[r]}" is not a number`;return}if(l!==46){if(i=l===48,r+=1,l=n.charCodeAt(r),i&&r<t){if(l&&IR(l)){e.err=`${cg}: ${vR} at index ${o}, "${n[o]}" illegal number`;return}}while(r<t&&IR(n.charCodeAt(r)))r+=1,s=!0;l=n.charCodeAt(r)}if(l===46){c=!0,r+=1;while(IR(n.charCodeAt(r)))r+=1,a=!0;l=n.charCodeAt(r)}if(l===101||l===69){if(c&&!s&&!a){e.err=`${cg}: ${vR} at index ${r}, "${n[r]}" invalid float exponent`;return}if(r+=1,l=n.charCodeAt(r),l===43||l===45)r+=1;if(r<t&&IR(n.charCodeAt(r)))while(r<t&&IR(n.charCodeAt(r)))r+=1;else{e.err=`${cg}: ${vR} at index ${r}, "${n[r]}" invalid integer exponent`;return}}e.index=r,e.param=Inr(n,o,r)},Inr=(e,t,n)=>{let o=t,r=1,i=0,s=0,a=0,c=!1,l=1,h=0,d=e.charCodeAt(o);if(d===43)o+=1;else if(d===45)r=-1,o+=1;for(;o<n;o+=1){let _=e.charCodeAt(o);if(_===46)c=!0;else if(_===101||_===69){o+=1;let p=e.charCodeAt(o);if(p===43)o+=1;else if(p===45)l=-1,o+=1;for(;o<n;o+=1)h=h*10+(e.charCodeAt(o)-48)}else{let p=_-48;if(p!==0||i!==0)a+=1;if(i=i*10+p,c)s+=1}}if(a>15||a===0)return+e.slice(t,n);let u=l*h-s;if(u>22||u<-22)return+e.slice(t,n);if(u>=0)return r*i*10**u;return r*i/10**-u},pkt=(e)=>[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279,10,13,8232,8233,32,9,11,12,160].includes(e),MK=(e)=>{let{pathValue:t,max:n}=e;while(e.index<n&&pkt(t.charCodeAt(e.index)))e.index+=1},mkt=(e)=>{switch(e|32){case 109:case 122:case 108:case 104:case 118:case 99:case 115:case 113:case 116:case 97:return!0;default:return!1}},_kt=(e)=>IR(e)||e===43||e===45||e===46,gkt=(e)=>(e|32)===97,Akt=(e)=>{switch(e|32){case 109:case 77:return!0;default:return!1}},mUe=(e)=>{let{max:t,pathValue:n,index:o,segments:r}=e,i=n.charCodeAt(o),s=EK[n[o].toLowerCase()];if(e.segmentStart=o,!mkt(i)){e.err=`${cg}: ${vR} "${n[o]}" is not a path command at index ${o}`;return}let a=r[r.length-1];if(!Akt(i)&&a?.[0]?.toLocaleLowerCase()==="z"){e.err=`${cg}: ${vR} "${n[o]}" is not a MoveTo path command at index ${o}`;return}if(e.index+=1,MK(e),e.data=[],!s){nUe(e);return}for(;;){for(let c=s;c>0;c-=1){if(gkt(i)&&(c===3||c===4))dkt(e);else ukt(e);if(e.err.length)return;if(e.data.push(e.param),MK(e),e.index<t&&n.charCodeAt(e.index)===44)e.index+=1,MK(e)}if(e.index>=e.max)break;if(!_kt(n.charCodeAt(e.index)))break}nUe(e)},_Ue=class{constructor(e){this.segments=[],this.pathValue=e,this.max=e.length,this.index=0,this.param=0,this.segmentStart=0,this.data=[],this.err=""}},wx=(e)=>{if(typeof e!=="string")return e.slice(0);let t=new _Ue(e);MK(t);while(t.index<t.max&&!t.err.length)mUe(t);if(!t.err.length){if(t.segments.length)t.segments[0][0]="M"}else throw TypeError(t.err);return t.segments},cae=(e,t,n,o)=>{let[r]=e,i=r.toUpperCase();if(t===0||i===r)return e;if(i==="A")return[i,e[1],e[2],e[3],e[4],e[5],e[6]+n,e[7]+o];else if(i==="V")return[i,e[1]+o];else if(i==="H")return[i,e[1]+n];else if(i==="L")return[i,e[1]+n,e[2]+o];else if(i==="C")return[i,e[1]+n,e[2]+o,e[3]+n,e[4]+o,e[5]+n,e[6]+o];else{let s=[],a=e.length;for(let c=1;c<a;c+=1)s.push(e[c]+(c%2?n:o));return[i].concat(s)}},ty=(e,t)=>{let n=0,o=0,r=0,i=0,s=0;while(s<e.length){let a=e[s],[c]=a,l=c.charCodeAt(0),h=l>=97,d=h?String.fromCharCode(l-32):c,u=t(a,s,n,o);if(u===!1)break;if(d==="Z")n=r,o=i;else if(d==="H")n=a[1]+(h?n:0);else if(d==="V")o=a[1]+(h?o:0);else{let _=a.length;if(n=a[_-2]+(h?n:0),o=a[_-1]+(h?o:0),d==="M")r=n,i=o}if(u)e[s]=u;s+=1}return e},s4e=(e)=>{let t=wx(e);return ty(t,cae)},gUe=(e,t,n,o)=>{let[r]=e,i=r.toLowerCase();if(t===0||r===i)return e;if(i==="a")return[i,e[1],e[2],e[3],e[4],e[5],e[6]-n,e[7]-o];else if(i==="v")return[i,e[1]-o];else if(i==="h")return[i,e[1]-n];else if(i==="l")return[i,e[1]-n,e[2]-o];else{let s=[],a=e.length;for(let c=1;c<a;c+=1)s.push(e[c]-(c%2?n:o));return[i].concat(s)}},KQt=(e)=>{let t=wx(e);return ty(t,gUe)},lae=(e,t,n,o,r,i,s,a,c,l)=>{let h=e,d=t,u=n,_=o,p=a,m=c,A=Math.PI*120/180,g=Math.PI/180*(+r||0),f=[],y,x,C,b,I;if(!l){y=tae(h,d,-g),h=y.x,d=y.y,y=tae(p,m,-g),p=y.x,m=y.y;let Y=(h-p)/2,X=(d-m)/2,K=Y*Y/(u*u)+X*X/(_*_);if(K>1)K=Math.sqrt(K),u*=K,_*=K;let J=u*u,ee=_*_,se=(i===s?-1:1)*Math.sqrt(Math.abs((J*ee-J*X*X-ee*Y*Y)/(J*X*X+ee*Y*Y)));if(b=se*u*X/_+(h+p)/2,I=se*-_*Y/u+(d+m)/2,x=Math.asin(((d-I)/_*1e9>>0)/1e9),C=Math.asin(((m-I)/_*1e9>>0)/1e9),x=h<b?Math.PI-x:x,C=p<b?Math.PI-C:C,x<0)x=Math.PI*2+x;if(C<0)C=Math.PI*2+C;if(s&&x>C)x-=Math.PI*2;if(!s&&C>x)C-=Math.PI*2}else[x,C,b,I]=l;let v=C-x;if(Math.abs(v)>A){let Y=C,X=p,K=m;C=x+A*(s&&C>x?1:-1),p=b+u*Math.cos(C),m=I+_*Math.sin(C),f=lae(p,m,u,_,r,0,s,X,K,[C,Y,b,I])}v=C-x;let P=Math.cos(x),M=Math.sin(x),B=Math.cos(C),T=Math.sin(C),N=Math.tan(v/4),D=1.3333333333333333*u*N,L=1.3333333333333333*_*N,H=[h,d],V=[h+D*M,d-L*P],O=[p+D*T,m-L*B],U=[p,m];if(V[0]=2*H[0]-V[0],V[1]=2*H[1]-V[1],l)return[V[0],V[1],O[0],O[1],U[0],U[1]].concat(f);f=[V[0],V[1],O[0],O[1],U[0],U[1]].concat(f);let j=[];for(let Y=0,X=f.length;Y<X;Y+=1)j[Y]=Y%2?tae(f[Y-1],f[Y],g).y:tae(f[Y],f[Y+1],g).x;return j},fkt=(e,t,n,o,r,i)=>[0.3333333333333333*e+0.6666666666666666*n,0.3333333333333333*t+0.6666666666666666*o,0.3333333333333333*r+0.6666666666666666*n,0.3333333333333333*i+0.6666666666666666*o,r,i],oUe=(e,t,n,o)=>{let r=P7([e,t],[n,o],0.3333333333333333),i=P7([e,t],[n,o],0.6666666666666666);return[r[0],r[1],i[0],i[1],n,o]},ykt=(e,t)=>{let n=e[0],o=e.slice(1).map(Number),[r,i]=o,{x1:s,y1:a}=t;if(!"TQ".includes(n))t.qx=null,t.qy=null;if(n==="M")return t.mx=r,t.my=i,t.x=r,t.y=i,e;else if(n==="A")return["C"].concat(lae(s,a,o[0],o[1],o[2],o[3],o[4],o[5],o[6]));else if(n==="Q")return t.qx=r,t.qy=i,["C"].concat(fkt(s,a,o[0],o[1],o[2],o[3]));else if(n==="L")return["C"].concat(oUe(s,a,r,i));else if(n==="Z")return["C"].concat(oUe(s,a,t.mx,t.my));return e},_4e=(e,t)=>{let[n]=e,o=n.toUpperCase(),r=n!==o,{x1:i,y1:s,x2:a,y2:c,x:l,y:h}=t,d=e.slice(1),u=d.map((_,p)=>_+(r?p%2?h:l:0));if(!"TQ".includes(o))t.qx=null,t.qy=null;if(o==="A")return u=d.slice(0,-2).concat(d[5]+(r?l:0),d[6]+(r?h:0)),["A"].concat(u);else if(o==="H")return["L",e[1]+(r?l:0),s];else if(o==="V")return["L",i,e[1]+(r?h:0)];else if(o==="L")return["L",e[1]+(r?l:0),e[2]+(r?h:0)];else if(o==="M")return["M",e[1]+(r?l:0),e[2]+(r?h:0)];else if(o==="C")return["C"].concat(u);else if(o==="S"){let _=i*2-a,p=s*2-c;return t.x1=_,t.y1=p,["C",_,p].concat(u)}else if(o==="T"){let _=t.qx!=null?i*2-t.qx:i,p=t.qy!=null?s*2-t.qy:s;return t.qx=_,t.qy=p,["Q",_,p].concat(u)}else if(o==="Q"){let[_,p]=u;return t.qx=_,t.qy=p,["Q"].concat(u)}else if(o==="Z")return["Z"];return e},g4e={mx:0,my:0,x1:0,y1:0,x2:0,y2:0,x:0,y:0,qx:null,qy:null},PR=(e)=>{let t={...g4e},n=wx(e);return ty(n,(o,r,i,s)=>{t.x=i,t.y=s;let a=_4e(o,t);if(a[0]==="M")t.mx=a[1],t.my=a[2];let c=ykt(a,t);if(c[0]==="C"&&c.length>7)n.splice(r+1,0,["C"].concat(c.slice(7))),c=c.slice(0,7);let l=c.length;return t.x1=+c[l-2],t.y1=+c[l-1],t.x2=+c[l-4]||t.x1,t.y2=+c[l-3]||t.y1,c})},rUe=(e,t)=>{let n=e.length,{round:o}=SR,r=e[0],i="";o=t==="off"?t:typeof t==="number"&&t>=0?t:typeof o==="number"&&o>=0?o:"off";let s=o==="off"?0:10**o;for(let a=0;a<n;a+=1){r=e[a];let c=r[0],l=r.length;if(i+=c,o==="off"){for(let h=1;h<l;h+=1)if(i+=r[h],h!==l-1)i+=" "}else for(let h=1;h<l;h+=1)if(i+=Math.round(r[h]*s)/s,h!==l-1)i+=" "}return i},iUe=(e)=>{if(!e)return{x:0,y:0,width:0,height:0,x2:0,y2:0,cx:0,cy:0,cz:0};let t=wx(e),n="M",o=0,r=0,{max:i,min:s}=Math,a=1/0,c=1/0,l=-1/0,h=-1/0,d=0,u=0,_=0,p=0,m=0,A=0,g=0,f=0,y=null,x=null;ty(t,(I,v,P,M)=>{[n]=I;let B=n.charCodeAt(0),T=B>=97,N=T?String.fromCharCode(B-32):n,D=T?cae(I,v,P,M):I,L=N==="V"?["L",P,D[1]]:N==="H"?["L",D[1],M]:D;if([n]=L,N!=="T"&&N!=="Q")y=null,x=null;if(n==="M")[,o,r]=L,d=o,u=r,_=o,p=r;else if(n==="L")[d,u,_,p]=JGe(P,M,L[1],L[2]);else if(n==="A")[d,u,_,p]=akt(P,M,L[1],L[2],L[3],L[4],L[5],L[6],L[7]);else if(n==="S"){let H=m*2-g,V=A*2-f;[d,u,_,p]=rae(P,M,H,V,L[1],L[2],L[3],L[4])}else if(n==="C")[d,u,_,p]=rae(P,M,L[1],L[2],L[3],L[4],L[5],L[6]);else if(n==="T")y=y===null?P:m*2-y,x=x===null?M:A*2-x,[d,u,_,p]=tUe(P,M,y,x,L[1],L[2]);else if(n==="Q")y=L[1],x=L[2],[d,u,_,p]=tUe(P,M,L[1],L[2],L[3],L[4]);else if(n==="Z")[d,u,_,p]=JGe(P,M,o,r);if(a=s(d,a),c=s(u,c),l=i(_,l),h=i(p,h),n==="Z")m=o,A=r;else{let H=L.length;m=L[H-2],A=L[H-1]}if(n==="C")g=L[3],f=L[4];else if(n==="S")g=L[1],f=L[2];else g=m,f=A});let C=l-a,b=h-c;return{width:C,height:b,x:a,y:c,x2:l,y2:h,cx:a+C/2,cy:c+b/2,cz:Math.max(C,b)+Math.min(C,b)/2}},nw=(e)=>{let t=wx(e),n=0,o=0,r=0,i=0,s=null,a=null,c="M",l=0,h=0,d=0;return ty(t,(u,_,p,m)=>{[c]=u;let A=c.toUpperCase(),g=A!==c?cae(u,_,p,m):u.slice(0),f=A==="V"?["L",p,g[1]]:A==="H"?["L",g[1],m]:g;if([c]=f,!"TQ".includes(A))s=null,a=null;if(c==="M")[,l,h]=f;else if(c==="L")d+=wK(p,m,f[1],f[2]);else if(c==="A")d+=pUe(p,m,f[1],f[2],f[3],f[4],f[5],f[6],f[7]);else if(c==="S"){let y=n*2-r,x=o*2-i;d+=aO(p,m,y,x,f[1],f[2],f[3],f[4])}else if(c==="C")d+=aO(p,m,f[1],f[2],f[3],f[4],f[5],f[6]);else if(c==="T")s=s===null?p:n*2-s,a=a===null?m:o*2-a,d+=i4e(p,m,s,a,f[1],f[2]);else if(c==="Q")s=f[1],a=f[2],d+=i4e(p,m,f[1],f[2],f[3],f[4]);else if(c==="Z")d+=wK(p,m,l,h);[n,o]=c==="Z"?[l,h]:f.slice(-2),[r,i]=c==="C"?[f[3],f[4]]:c==="S"?[f[1],f[2]]:[n,o]}),d},AUe=0.00001,$I=(e)=>{let t=wx(e),n={...g4e};return ty(t,(o,r,i,s)=>{n.x=i,n.y=s;let a=_4e(o,n),c=a.length;return n.x1=+a[c-2],n.y1=+a[c-1],n.x2=+a[c-4]||n.x1,n.y2=+a[c-3]||n.y1,a})},nae=(e,t)=>{let n=$I(e),o=!1,r=[],[i,s]=n[0].slice(1),a=typeof t==="number",c={x:i,y:s},l=0,h=c,d=0;if(!a||t<0.00001)return c;return ty(n,(u,_,p,m)=>{let A=u[0];if(o=A==="M",r=!o?[p,m].concat(u.slice(1)):r,o)[,i,s]=u,c={x:i,y:s},l=0;else if(A==="L")c=e4e(r[0],r[1],r[2],r[3],t-d),l=wK(r[0],r[1],r[2],r[3]);else if(A==="A")c=skt(r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],t-d),l=pUe(r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8]);else if(A==="C")c=r4e(r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],t-d),l=aO(r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7]);else if(A==="Q")c=hkt(r[0],r[1],r[2],r[3],r[4],r[5],t-d),l=i4e(r[0],r[1],r[2],r[3],r[4],r[5]);else if(A==="Z")r=[p,m,i,s],c=e4e(r[0],r[1],r[2],r[3],t-d),l=wK(r[0],r[1],r[2],r[3]);if(d<t)h=c;else return!1;d+=l}),h},fUe=(e,t)=>{let n=wx(e),o=n.slice(0),r=nw(o),i=o.length-1,s=0,a=0,c=n[0];if(i<=0||!t||!Number.isFinite(t))return{segment:c,index:0,length:a,lengthAtSegment:s};if(t>=r)return o=n.slice(0,-1),s=nw(o),a=r-s,c=n[i],{segment:c,index:i,length:a,lengthAtSegment:s};let l=[];while(i>0)c=o[i],o=o.slice(0,-1),s=nw(o),a=r-s,r=s,l.push({segment:c,index:i,length:a,lengthAtSegment:s}),i-=1;return l.find(({lengthAtSegment:h})=>h<=t)},A4e=(e,t)=>{let n=wx(e),o=$I(n),r=nw(o),i=(y)=>{let x=y.x-t.x,C=y.y-t.y;return x*x+C*C},s=8,a,c={x:0,y:0},l=0,h=0,d=1/0;for(let y=0;y<=r;y+=s)if(a=nae(o,y),l=i(a),l<d)c=a,h=y,d=l;s/=2;let u,_,p=0,m=0,A=0,g=0;while(s>0.000001){if(p=h-s,u=nae(o,p),A=i(u),m=h+s,_=nae(o,m),g=i(_),p>=0&&A<d)c=u,h=p,d=A;else if(m<=r&&g<d)c=_,h=m,d=g;else s/=2;if(s<0.00001)break}let f=fUe(n,h);return{closest:c,distance:Math.sqrt(d),segment:f}},vnr=(e,t)=>A4e(e,t).closest,Snr=(e,t,n,o,r,i,s,a)=>3*((a-t)*(n+r)-(s-e)*(o+i)+o*(e-r)-n*(t-i)+a*(r+e/3)-s*(i+t/3))/20,xkt=(e)=>{let t=0,n=0,o=0;return PR(e).map((r)=>{switch(r[0]){case"M":return[,t,n]=r,0;default:return o=Snr(t,n,r[1],r[2],r[3],r[4],r[5],r[6]),[t,n]=r.slice(-2),o}}).reduce((r,i)=>r+i,0)},Pnr=(e)=>xkt(PR(e))>=0,Enr=(e,t)=>fUe(e,t).segment,Mnr=(e,t)=>A4e(e,t).segment,hae=(e)=>Array.isArray(e)&&e.every((t)=>{let n=t[0].toLowerCase();return EK[n]===t.length-1&&"achlmqstvz".includes(n)&&t.slice(1).every(Number.isFinite)})&&e.length>0,Ckt=(e)=>hae(e)&&e.every(([t])=>t===t.toUpperCase()),f4e=(e)=>Ckt(e)&&e.every(([t])=>"ACLMQZ".includes(t)),iae=(e)=>f4e(e)&&e.every(([t])=>"MLVHZ".includes(t)),wnr=(e)=>f4e(e)&&e.every(([t])=>"MC".includes(t)),Bnr=(e,t)=>{let{distance:n}=A4e(e,t);return Math.abs(n)<AUe},Tnr=(e)=>hae(e)&&e.slice(1).every(([t])=>t===t.toLowerCase()),bkt=(e)=>{if(typeof e!=="string"||!e.length)return!1;let t=new _Ue(e);MK(t);while(t.index<t.max&&!t.err.length)mUe(t);return!t.err.length&&"mM".includes(t.segments[0][0])};function TK(e){let t=[],[n,o]=[0,0];return ty(e,(r)=>{let i=r[0];if(i==="M")[n,o]=[r[1],r[2]],t.push([n,o]);else if(i==="L")t.push([r[1],r[2]]);else if(i==="C")t.push([r[5],r[6]]);else if(i==="A")t.push([r[6],r[7]]);else if(i==="Z")t.push([n,o]);else throw TypeError(`${cg}: path command "${i}" is not supported`)}),t}var sae={line:["x1","y1","x2","y2"],circle:["cx","cy","r"],ellipse:["cx","cy","rx","ry"],rect:["width","height","x","y","rx","ry"],polygon:["points"],polyline:["points"],glyph:["d"]},Ikt=(e)=>e!==void 0&&e!==null&&typeof e==="object"&&e.nodeType===1,Dnr=(e)=>{let{x1:t,y1:n,x2:o,y2:r}=e;return[t,n,o,r]=[t,n,o,r].map((i)=>+i),[["M",t,n],["L",o,r]]},Nnr=(e)=>{let t=[],n=(e.points||"").trim().split(/[\s|,]/).map((r)=>+r),o=0;while(o<n.length)t.push([o?"L":"M",n[o],n[o+1]]),o+=2;return e.type==="polygon"?[...t,["z"]]:t},Rnr=(e)=>{let{cx:t,cy:n,r:o}=e;return[t,n,o]=[t,n,o].map((r)=>+r),[["M",t-o,n],["a",o,o,0,1,0,2*o,0],["a",o,o,0,1,0,-2*o,0]]},Qnr=(e)=>{let{cx:t,cy:n}=e,o=e.rx||0,r=e.ry||o;return[t,n,o,r]=[t,n,o,r].map((i)=>+i),[["M",t-o,n],["a",o,r,0,1,0,2*o,0],["a",o,r,0,1,0,-2*o,0]]},knr=(e)=>{let t=+e.x||0,n=+e.y||0,o=+e.width,r=+e.height,i=+(e.rx||0),s=+(e.ry||i);if(i||s){if(i*2>o)i-=(i*2-o)/2;if(s*2>r)s-=(s*2-r)/2;return[["M",t+i,n],["h",o-i*2],["s",i,0,i,s],["v",r-s*2],["s",0,s,-i,s],["h",-o+i*2],["s",-i,0,-i,-s],["v",-r+s*2],["s",0,-s,i,-s]]}return[["M",t,n],["h",o],["v",r],["H",t],["Z"]]},vkt=(e)=>{let t=Object.keys(sae),n=Ikt(e),o=n?e.tagName:null;if(o&&[...t,"path"].every((c)=>o!==c))throw TypeError(`${cg}: "${o}" is not SVGElement`);let r=n?o:e.type,i=sae[r],s={type:r};if(n)i.forEach((c)=>{s[c]=e.getAttribute(c)});else Object.assign(s,e);let a=[];if(r==="circle")a=Rnr(s);else if(r==="ellipse")a=Qnr(s);else if(["polyline","polygon"].includes(r))a=Nnr(s);else if(r==="rect")a=knr(s);else if(r==="line")a=Dnr(s);else if(["glyph","path"].includes(r))a=wx(n?e.getAttribute("d")||"":e.d||"");if(hae(a)&&a.length)return a;return!1},Lnr=(e,t,n)=>{let o=n||document,r=Object.keys(sae),i=Ikt(e),s=i?e.tagName:null;if(s==="path")throw TypeError(`${cg}: "${s}" is already SVGPathElement`);if(s&&r.every((p)=>s!==p))throw TypeError(`${cg}: "${s}" is not SVGElement`);let a=o.createElementNS("http://www.w3.org/2000/svg","path"),c=i?s:e.type,l=sae[c],h={type:c},d=SR.round,u=vkt(e),_=u&&u.length?rUe(u,d):"";if(i){l.forEach((p)=>{h[p]=e.getAttribute(p)});for(let p=0;p<e.attributes.length;p++){let m=e.attributes[p];if(m&&!l.includes(m.name))a.setAttribute(m.name,m.value)}}else Object.assign(h,e),Object.keys(h).forEach((p)=>{if(!l.includes(p)&&p!=="type")a.setAttribute(p.replace(/[A-Z]/g,(m)=>`-${m.toLowerCase()}`),h[p])});if(bkt(_)){if(a.setAttribute("d",_),t&&i)e.before(a,e),e.remove();return a}return!1},sUe=(e)=>{if(typeof e==="string"){let t=e.match(/[Mm]/g);return t?t.length>1:!1}if(hae(e)){let t=0;for(let n of e)if(n[0].toUpperCase()==="M"){if(t++,t>1)return!0}return!1}throw TypeError(cg+": expected string or PathArray")};function DK(e){return f4e(e)&&e.every(([t])=>"MLVH".includes(t))}var yUe=(e)=>e[e.length-1][0].toUpperCase()==="Z",Skt=(e,t,n,o)=>{let[r]=e,{round:i}=SR,s=typeof i==="number"?i:4,a=t.slice(1),{x1:c,y1:l,x2:h,y2:d,x:u,y:_}=n,[p,m]=a.slice(-2),A=e;if(!"TQ".includes(r))n.qx=null,n.qy=null;if(r==="L"){if(nd(u,s)===nd(p,s))return["V",m];else if(nd(_,s)===nd(m,s))return["H",p]}else if(r==="C"){let[g,f]=a;if(n.x1=g,n.y1=f,"CS".includes(o)&&(nd(g,s)===nd(c*2-h,s)&&nd(f,s)===nd(l*2-d,s)||nd(c,s)===nd(h*2-u,s)&&nd(l,s)===nd(d*2-_,s)))return["S",a[2],a[3],a[4],a[5]]}else if(r==="Q"){let[g,f]=a;if(n.qx=g,n.qy=f,"QT".includes(o)&&nd(g,s)===nd(c*2-h,s)&&nd(f,s)===nd(l*2-d,s))return["T",a[2],a[3]]}return A},a4e=(e,t)=>{let n=e.slice(1).map((o)=>nd(o,t));return[e[0]].concat(n)},$Qt=(e,t)=>{let n=s4e(e),o=typeof t==="number"&&t>=0?t:2,r={...g4e},i=[],s="M",a="Z";return ty(n,(c,l,h,d)=>{r.x=h,r.y=d;let u=_4e(c,r),_=c;if(s=c[0],i[l]=s,l){a=i[l-1];let m=Skt(c,u,r,a),A=a4e(m,o),g=A.join(""),f=gUe(m,l,h,d),y=a4e(f,o),x=y.join("");_=g.length<x.length?A:y}let p=u.length;return r.x1=+u[p-2],r.y1=+u[p-1],r.x2=+u[p-4]||r.x1,r.y2=+u[p-3]||r.y1,_})},sO=(e)=>{let t=s4e(e),n=$I(t),o=t.length,r=t[o-1][0]==="Z",i=ty(t,(s,a)=>{let c=n[a],l=a&&t[a-1],h=l&&l[0],d=t[a+1],u=d&&d[0],_=s[0],[p,m]=n[a?a-1:o-1].slice(-2),A=s;switch(_){case"M":A=r?["Z"]:[_,p,m];break;case"A":A=[_,s[1],s[2],s[3],s[4],s[5]===1?0:1,p,m];break;case"C":if(d&&u==="S")A=["S",s[1],s[2],p,m];else A=[_,s[3],s[4],s[1],s[2],p,m];break;case"S":if(h&&"CS".includes(h)&&(!d||u!=="S"))A=["C",c[3],c[4],c[1],c[2],p,m];else A=[_,c[1],c[2],p,m];break;case"Q":if(d&&u==="T")A=["T",p,m];else A=[_,s[1],s[2],p,m];break;case"T":if(h&&"QT".includes(h)&&(!d||u!=="T"))A=["Q",c[1],c[2],p,m];else A=[_,p,m];break;case"Z":A=["M",p,m];break;case"H":A=[_,p];break;case"V":A=[_,m];break;default:A=[_].concat(s.slice(1,-2),p,m)}return A});return r?i.reverse():[i[0]].concat(i.slice(1).reverse())},c4e=(e)=>{let t=[],n=wx(e),o=[],r=-1,i=0,s=0,a=0,c=0;return ty(n,(l,h,d,u)=>{let _=l[0],p=_.toUpperCase(),m=_===_.toLowerCase(),A=l.slice(1);if(p==="M")r+=1,[i,s]=A,i+=m?d:0,s+=m?u:0,a=i,c=s,o=[m?[p,a,c]:l];else{if(p==="Z")i=a,s=c;else if(p==="H")[,i]=l,i+=m?d:0;else if(p==="V")[,s]=l,s+=m?u:0;else[i,s]=l.slice(-2),i+=m?d:0,s+=m?u:0;o.push(l)}t[r]=o}),t},Pkt=(e)=>{let t=new B2,{origin:n}=e,[o,r]=n,{translate:i}=e,{rotate:s}=e,{skew:a}=e,{scale:c}=e;if(Array.isArray(i)&&i.length>=2&&i.every((l)=>!Number.isNaN(+l))&&i.some((l)=>l!==0))t=t.translate(...i);else if(typeof i==="number"&&!Number.isNaN(i))t=t.translate(i);if(s||a||c){if(t=t.translate(o,r),Array.isArray(s)&&s.length>=2&&s.every((l)=>!Number.isNaN(+l))&&s.some((l)=>l!==0))t=t.rotate(...s);else if(typeof s==="number"&&!Number.isNaN(s))t=t.rotate(s);if(Array.isArray(a)&&a.length===2&&a.every((l)=>!Number.isNaN(+l))&&a.some((l)=>l!==0))t=a[0]?t.skewX(a[0]):t,t=a[1]?t.skewY(a[1]):t;else if(typeof a==="number"&&!Number.isNaN(a))t=t.skewX(a);if(Array.isArray(c)&&c.length>=2&&c.every((l)=>!Number.isNaN(+l))&&c.some((l)=>l!==1))t=t.scale(...c);else if(typeof c==="number"&&!Number.isNaN(c))t=t.scale(c);t=t.translate(-o,-r)}return t},Hnr=(e,t)=>{if(e.is2D)return[e.a*t[0]+e.c*t[1]+e.e*t[3],e.b*t[0]+e.d*t[1]+e.f*t[3],0,1];let n=B2.Translate(t[0],t[1],t[2]);return[,,,n.m44]=t,n=e.multiply(n),[n.m41,n.m42,n.m43,n.m44]},aUe=(e,t,n)=>{let[o,r,i]=n,[s,a,c]=Hnr(e,[t[0],t[1],0,1]),l=s-o,h=a-r,d=c-i;return[l*(Math.abs(i)/Math.abs(d)||1)+o,h*(Math.abs(i)/Math.abs(d)||1)+r]},Fnr=(e,t,n,o,r,i,s,a,c)=>{let l=[],h=0,d=0,u=0,_=0,p=0,m=0,A=0,g=0;for(let f=0,y=e.length;f<y;f+=1){let x=e[f],C=x[0],b=C.charCodeAt(0),I=b>=97,v=I?String.fromCharCode(b-32):C,P=f===0&&I?C:v;if(v==="Z"){l.push(["Z"]),p=A,m=g;continue}if(v==="V"){let M=x[1]+(I?m:0);if(u=t*p+o*M+i-a+a,_=n*p+r*M+s-c+c,h!==u&&d!==_)l.push(["L",u,_]);else if(d===_)l.push(["H",u]);else if(h===u)l.push(["V",_]);else l.push(["L",p,M]);m=M,h=u,d=_;continue}if(v==="H"){let M=x[1]+(I?p:0);if(u=t*M+o*m+i-a+a,_=n*M+r*m+s-c+c,h!==u&&d!==_)l.push(["L",u,_]);else if(d===_)l.push(["H",u]);else if(h===u)l.push(["V",_]);else l.push(["L",M,m]);p=M,h=u,d=_;continue}if(v==="A"){let M=x[6]+(I?p:0),B=x[7]+(I?m:0),T=lae(p,m,x[1],x[2],x[3],x[4],x[5],M,B),N=T.length,D=0;if(N>0)do{let L=["C"],H=D+6;for(let V=D;V<H;V+=2)u=t*T[V]+o*T[V+1]+i-a+a,_=n*T[V]+r*T[V+1]+s-c+c,L.push(u,_);l.push(L),D=H}while(D<N);else l.push(["C"]);if(N>0)p=T[N-2],m=T[N-1];else p=M,m=B;h=u,d=_;continue}if(v==="L"){let M=x[1]+(I?p:0),B=x[2]+(I?m:0);if(u=t*M+o*B+i-a+a,_=n*M+r*B+s-c+c,h!==u&&d!==_)l.push(["L",u,_]);else if(d===_)l.push(["H",u]);else if(h===u)l.push(["V",_]);else l.push(["L",M,B]);p=M,m=B,h=u,d=_;continue}{let M=[P],B=x.length;for(let T=1;T<B;T+=2){let N=x[T]+(I?p:0),D=x[T+1]+(I?m:0);u=t*N+o*D+i-a+a,_=n*N+r*D+s-c+c,M.push(u,_)}if(l.push(M),p=x[B-2]+(I?p:0),m=x[B-1]+(I?m:0),v==="M")A=p,g=m;h=u,d=_}}return l},qQt=(e,t)=>{let n=wx(e),o=t&&Object.keys(t);if(!t||o&&!o.length)return n.slice(0);if(!t.origin)Object.assign(t,{origin:SR.origin});let r=t.origin,i=Pkt(t);if(i.isIdentity)return n.slice(0);if(i.is2D)return Fnr(n,i.a,i.b,i.c,i.d,i.e,i.f,r[0],r[1]);let s=0,a=0,c=0,l=0,h=0,d=0;return ty(n,(u,_,p,m)=>{let[A]=u,g=A.toUpperCase(),f=g!==A?cae(u,_,p,m):u.slice(0),y=g==="A"?["C"].concat(lae(p,m,f[1],f[2],f[3],f[4],f[5],f[6],f[7])):g==="V"?["L",p,f[1]]:g==="H"?["L",f[1],m]:f;if(y[0]==="C"&&y.length>7){let x=y.slice(0,7);n.splice(_+1,0,["C"].concat(y.slice(7))),y=x}if(y[0]==="L"){if([c,l]=aUe(i,[y[1],y[2]],r),s!==c&&a!==l)y=["L",c,l];else if(a===l)y=["H",c];else if(s===c)y=["V",l]}else for(h=1,d=y.length;h<d;h+=2)[c,l]=aUe(i,[+y[h],+y[h+1]],r),y[h]=c,y[h+1]=l;return s=c,a=l,y})},znr=(e)=>{let t=e.slice(1).map((n,o,r)=>!o?e[0].slice(1).concat(n.slice(1)):r[o-1].slice(-2).concat(n.slice(1))).map((n)=>n.map((o,r)=>n[n.length-r-2*(1-r%2)])).reverse();return[["M"].concat(t[0].slice(0,2))].concat(t.map((n)=>["C"].concat(n.slice(2))))},cUe=(e,t)=>{let{round:n}=SR;if(n=t==="off"?t:typeof t==="number"&&t>=0?t:typeof n==="number"&&n>=0?n:"off",n==="off")return e.slice(0);return ty(e,(o)=>a4e(o,n))},lUe=(e)=>{let t=wx(e);if(yUe(t)){let n=$I(t),o=t.length,r=o-2,[i,s]=n[0].slice(1),[a,c]=n[r].slice(-2);if(i===a&&s===c)t.splice(o-1,1)}};function Ekt(e,t,n,o,r,i,s,a,c){let[l,h]=P7([e,t],[n,o],c),[d,u]=P7([n,o],[r,i],c),[_,p]=P7([r,i],[s,a],c),[m,A]=P7([l,h],[d,u],c),[g,f]=P7([d,u],[_,p],c),[y,x]=P7([m,A],[g,f],c);return[[e,t,l,h,m,A,y,x],[y,x,g,f,_,p,s,a]]}var JQt=(e)=>{let t=$I(e);if(!iae(t)&&!DK(t))throw TypeError(`${cg}: pathValue is not a polyline/polygon`);if(!yUe(t))return t;let n=[t[0]],[o,r]=t[0].slice(1);for(let i=1;i<t.length;i++){let s=t[i];if(s[0].toUpperCase()==="Z")n.push(["L",o,r]);else n.push(s)}return n};function Onr(e,t,n,o,r){if(r<=1)return[[e,t,n,o]];let i=[],s=n-e,a=o-t,c=e,l=t,h=0;while(h<r){let d=1/(r-h),u=e+d*s,_=t+d*a;i.push([c,l,u,_]),c=u,l=_,h++}return i}function Mkt(e,t){if(t<=1)throw TypeError(`${cg}: target must be >= 2`);let n=nw(e);if(n===0)return Array(e.length).fill(1);let o=n/t,r=DK(e),i=[1],s=[0];ty(e,(l,h,d,u)=>{if(h>0){let[_,p]=l.slice(-2),m=r?wK(d,u,_,p):aO(d,u,l[1],l[2],l[3],l[4],l[5],l[6]);s.push(m),i.push(1)}});let a=1;for(let l=1;l<s.length;l++){let h=s[l],d=h>o?Math.round(h/o):1;i[l]=d,a+=d}let c=t-a;if(c!==0){let l=[];for(let d=1;d<s.length;d++)if(s[d]>0)l.push([d,s[d]]);let h=l.length;if(c<0){l.sort((d,u)=>d[1]-u[1]);for(let d=0;d<h;d++){let u=l[d][0];if(i[u]>1&&l[d][1]>0)i[u]--,c++;if(c===0)break;else if(d===h-1)d=0}}else if(c>0){l.sort((d,u)=>u[1]-d[1]);for(let d=0;d<h;d++){let u=l[d][0];if(l[d][1]>0)i[u]++,c--;if(c===0)break;else if(d===h-1)d=0}}}return i}function ZQt(e,t){if(e.length<2||t<=1)return e;let n=Mkt(e,t),o=0,r=[e[0]],i=e.length,s=e[0][1],a=e[0][2];for(let c=1;c<i;c++){let[l,h]=e[c].slice(1),d=n[c];if(d>=1){let u=Onr(s,a,l,h,d);for(let _ of u)r.push(["L",_[2],_[3]]),o++}s=l,a=h}if(r.length!==t)console.warn(`${cg}: requested ${t} segments, got ${r.length}. Adjusted on last segment.`);return r}function Vnr(e,t,n,o,r,i,s,a,c){if(c<=1)return[[e,t,n,o,r,i,s,a]];let l=[],h=e,d=t,u=n,_=o,p=r,m=i,A=s,g=a,f=0;while(f<c){let y=1/(c-f),[x,C]=Ekt(h,d,u,_,p,m,A,g,y);l.push(x),[h,d,u,_,p,m,A,g]=C,f++}return l}function ekt(e,t){if(e.length<2||t<=1)return e;let n=Mkt(e,t),o=0,r=[e[0]],i=e.length,s=e[0][1],a=e[0][2];for(let c=1;c<i;c++){let l=e[c],[h,d]=l.slice(-2),u=n[c];if(u>=1){let _=Vnr(s,a,l[1],l[2],l[3],l[4],l[5],l[6],u);for(let p of _)r.push(["C",p[2],p[3],p[4],p[5],p[6],p[7]]),o++}s=h,a=d}if(r.length!==t)console.warn(`${cg}: requested ${t} segments, got ${r.length}.`);return r}function Ynr(e){let t=e.length,n=t-1,o,r=[];for(let i=0;i<t;i++){o=[];for(let s=0;s<t;s++){let a=i+s,c;if(s===0||e[a]&&e[a][0]==="M"){c=e[a],o.push(["M",...c.slice(-2)]);continue}if(a>=t)a-=n;o.push(e[a])}r.push(o)}return r}function Gnr(e,t,n){let o=n||Ynr(e);if(e.length!==t.length)throw TypeError(cg+": paths must have the same number of segments after equalization");let r=0,i=1/0;for(let s=0;s<o.length;s++){let a=o[s],c=a.length,l=0;for(let h=0;h<c;h++){let d=a[h],u=t[h],_=d.slice(-2),p=u.slice(-2),m=_[0]-p[0],A=_[1]-p[1];l+=m*m+A*A}if(l<i)i=l,r=s}return o[r]}var Unr={mode:"auto",sampleSize:10,roundValues:4,reverse:!0,close:!1,target:void 0},hUe=(e,t,n={})=>{let{close:o,mode:r,reverse:i,roundValues:s,target:a}=Object.assign(Unr,n),c=$I(e),l=$I(t);lUe(c),lUe(l);let h=(iae(c)||DK(c))&&(iae(l)||DK(l));if(h&&r==="auto")c=JQt(c),l=JQt(l);else h=!1,c=PR(c),l=PR(l);let d=BK(TK(c)),u=BK(TK(l));if(i!==!1&&Math.sign(d)!==Math.sign(u))l=sO(l);let _=c.length,p=l.length,m=Math.max(_,p),A=m;if(typeof a!=="number"){let y=(nw(c)+nw(l))/2,x=y/Math.max(_,p),C=Math.max(m,Math.round(y/Math.max(x,1)));A=Math.min(C,Math.max(_,p)*3)}else if(a>=m)A=a;else console.warn('equalizeSegments "target" option: '+a+", expected >= "+m);let g=c,f=l;if(h)g=ZQt(c,A),f=ZQt(l,A);else g=ekt(c,A),f=ekt(l,A);if(f=Gnr(f,g),typeof s==="number"&&s!==4)g=cUe(g,s),f=cUe(f,s);if(o)g.push(["Z"]),f.push(["Z"]);return[g,f]},KI=(e,[t,n])=>{let[o,r,i,s]=e;return t>=o&&t<=i&&n>=r&&n<=s},xUe=(e,t)=>{let[n,o,r,i]=e,[s,a,c,l]=t;return KI(t,[n,o])||KI(t,[r,o])||KI(t,[n,i])||KI(t,[r,i])||KI(e,[s,a])||KI(e,[c,a])||KI(e,[s,l])||KI(e,[c,l])||(n<c&&n>s||s<r&&s>n)&&(o<l&&o>a||a<i&&a>o)},tkt=([e,t])=>[["M",e,t],["L",e+0.001,t],["L",e+0.001,t+0.001],["L",e,t+0.001],["L",e,t],["Z"]];function Wnr(e,t){let n=e.bbox,o=[];for(let i=0;i<t.length;i++){let{bbox:s,size:a}=t[i],c=n.cx-s.cx,l=n.cy-s.cy,h=Math.sqrt(c*c+l*l),d=Math.abs(e.size-a)/Math.max(e.size,a,0.000001),u=KI([n.x,n.y,n.x2,n.y2],[s.cx,s.cy])||KI([s.x,s.y,s.x2,s.y2],[n.cx,n.cy]),_=xUe([n.x,n.y,n.x2,n.y2],[s.x,s.y,s.x2,s.y2]);o.push({index:i,hasOverlap:u,boxIntersect:_,sizeDifference:d,centeredDistance:h})}let r=o.filter((i)=>i.hasOverlap&&i.boxIntersect);if(r.length>0){let i=r[0];for(let s=1;s<r.length;s++)if(r[s].centeredDistance<i.centeredDistance)i=r[s];return t.splice(i.index,1)[0]}return null}function nkt(e,t){let n=[];e.sort((o,r)=>r.size-o.size),t.sort((o,r)=>r.size-o.size);while(e.length>0){let o=e.shift(),r=Wnr(o,t);if(r)n.push([o.path,r.path]);else{let i=[o.bbox.cx,o.bbox.cy];n.push([o.path,tkt(i)])}}while(t.length>0){let o=t.shift(),r=[o.bbox.cx,o.bbox.cy];n.push([tkt(r),o.path])}return n}var okt=(e)=>{let t=[],n=[];for(let o of e){let r=BK(TK(o)),i=iUe(o),s={isPoly:iae(o)||DK(o),size:i.width*i.height,path:o,signedArea:r,area:Math.abs(r),bbox:i};if(r>0)t.push(s);else n.push(s)}return{outers:t,inners:n}},Xnr={mode:"auto",roundValues:4,close:!1,sampleSize:10},jnr=(e,t,n={})=>{let o=Object.assign(Xnr,n),r=$I(e),i=$I(t),s=sUe(r),a=sUe(i);if(!s&&!a)return hUe(r,i,o);let c=BK(TK(r)),l=BK(TK(i)),h=r,d=i;if(Math.sign(c)<0)h=sO(h);if(Math.sign(l)<0)d=sO(d);let u=c4e(h),_=c4e(d),{outers:p,inners:m}=okt(u),{outers:A,inners:g}=okt(_),f=nkt(p,A),y=nkt(m,g),x=[];for(let[C,b]of[...f,...y]){let[I,v]=hUe(C,b,{...o,reverse:!1});x.push([I,v])}return[x.map((C)=>C[0]).flat(),x.map((C)=>C[1]).flat()]},Knr=(e,t,n,o,r,i,s,a)=>{if(Math.max(e,n)<Math.min(r,s)||Math.min(e,n)>Math.max(r,s)||Math.max(t,o)<Math.min(i,a)||Math.min(t,o)>Math.max(i,a))return;let c=(e*o-t*n)*(r-s)-(e-n)*(r*a-i*s),l=(e*o-t*n)*(i-a)-(t-o)*(r*a-i*s),h=(e-n)*(i-a)-(t-o)*(r-s);if(!h)return;let d=c/h,u=l/h,_=nd(d,2),p=nd(u,2);if(_<nd(Math.min(e,n),2)||_>nd(Math.max(e,n),2)||_<nd(Math.min(r,s),2)||_>nd(Math.max(r,s),2)||p<nd(Math.min(t,o),2)||p>nd(Math.max(t,o),2)||p<nd(Math.min(i,a),2)||p>nd(Math.max(i,a),2))return;return{x:d,y:u}},$nr=(e,t,n)=>{let o=rae(...e),r=rae(...t),{justCount:i,epsilon:s}=Object.assign({justCount:!0,epsilon:AUe},n);if(!xUe(o,r))return i?0:[];let a=aO(...e),c=aO(...t),l=Math.max(a/5>>0,1),h=Math.max(c/5>>0,1),d=[],u=[],_={},p=i?0:[];for(let m=0;m<l+1;m++){let A=r4e(...e,m/l*a);d.push({x:A.x,y:A.y,t:m/l})}for(let m=0;m<h+1;m++){let A=r4e(...t,m/h*c);u.push({x:A.x,y:A.y,t:m/h})}for(let m=0;m<l;m++)for(let A=0;A<h;A++){let g=1+s,f=d[m],y=d[m+1],x=u[A],C=u[A+1],b=Math.abs(y.x-f.x)<0.001?"y":"x",I=Math.abs(C.x-x.x)<0.001?"y":"x",v=Knr(f.x,f.y,y.x,y.y,x.x,x.y,C.x,C.y);if(v){if(_[v.x.toFixed(4)]==v.y.toFixed(4))continue;_[v.x.toFixed(4)]=v.y.toFixed(4);let P=f.t+Math.abs((v[b]-f[b])/(y[b]-f[b]))*(y.t-f.t),M=x.t+Math.abs((v[I]-x[I])/(C[I]-x[I]))*(C.t-x.t);if(P>=0&&P<=g&&M>=0&&M<=g)if(i)p++;else p.push({x:v.x,y:v.y,t1:Math.min(P,1),t2:Math.min(M,1)})}}return p},qnr=(e,t,n=!0)=>{let o=PR(e),r=PR(t),i=0,s=0,a=0,c=0,l=0,h=0,d=0,u=0,_=[i,s,i,s,l,h,l,h],p=[a,c,a,c,d,u,d,u],m=0,A=[],g=o.length,f=r.length;for(let y=0;y<g;y++){let x=o[y];if(x[0]=="M")i=x[1],s=x[2],l=i,h=s;else{if(x[0]=="C")_=[i,s,x[1],x[2],x[3],x[4],x[5],x[6]],i=_[6],s=_[7];else _=[i,s,i,s,l,h,l,h],i=l,s=h;for(let C=0;C<f;C++){let b=r[C];if(b[0]=="M")a=b[1],c=b[2],d=a,u=c;else if(b[0]=="C")p=[a,c,b[1],b[2],b[3],b[4],b[5],b[6]],a=p[6],c=p[7];let I=$nr(_,p,{justCount:n});if(n)m+=I;else A.push(...I)}}}return n?m:A},Jnr=class{constructor(e,t){let n=t||{},o=typeof e>"u";if(o||!e.length)throw TypeError(`${cg}: "pathValue" is ${o?"undefined":"empty"}`);this.segments=wx(e);let{round:r,origin:i}=n,s;if(Number.isInteger(r)||r==="off")s=r;else s=SR.round;let a=SR.origin;if(Array.isArray(i)&&i.length>=2){let[c,l,h]=i.map(Number);a=[!Number.isNaN(c)?c:0,!Number.isNaN(l)?l:0,!Number.isNaN(h)?h:0]}return this.round=s,this.origin=a,this}get bbox(){return iUe(this.segments)}get length(){return nw(this.segments)}getBBox(){return this.bbox}getTotalLength(){return this.length}getPointAtLength(e){return nae(this.segments,e)}toAbsolute(){let{segments:e}=this;return this.segments=s4e(e),this}toRelative(){let{segments:e}=this;return this.segments=KQt(e),this}toCurve(){let{segments:e}=this;return this.segments=PR(e),this}reverse(e){let{segments:t}=this,n=c4e(t),o=n.length>1?n:!1,r=o?o.map((s,a)=>{if(e)return a?sO(s):s.slice(0);return sO(s)}):t.slice(0),i=[];if(o)i=r.flat(1);else i=e?t:sO(t);return this.segments=i.slice(0),this}normalize(){let{segments:e}=this;return this.segments=$I(e),this}optimize(){let{segments:e}=this,t=this.round==="off"?2:this.round;return this.segments=$Qt(e,t),this}transform(e){if(!e||typeof e!=="object"||typeof e==="object"&&!["translate","rotate","skew","scale"].some((a)=>(a in e)))return this;let{segments:t,origin:[n,o,r]}=this,i={};for(let[a,c]of Object.entries(e))if(a==="skew"&&Array.isArray(c))i[a]=c.map(Number);else if((a==="rotate"||a==="translate"||a==="origin"||a==="scale")&&Array.isArray(c))i[a]=c.map(Number);else if(a!=="origin"&&typeof Number(c)==="number")i[a]=Number(c);let{origin:s}=i;if(Array.isArray(s)&&s.length>=2){let[a,c,l]=s.map(Number);i.origin=[!Number.isNaN(a)?a:n,!Number.isNaN(c)?c:o,l||r]}else i.origin=[n,o,r];return this.segments=qQt(t,i),this}flipX(){let{cx:e,cy:t}=this.bbox;return this.transform({rotate:[0,180,0],origin:[e,t,0]}),this}flipY(){let{cx:e,cy:t}=this.bbox;return this.transform({rotate:[180,0,0],origin:[e,t,0]}),this}toString(){return rUe(this.segments,this.round)}dispose(){Object.keys(this).forEach((e)=>delete this[e])}static options=SR;static CSSMatrix=B2;static arcTools=Anr;static bezierTools=_nr;static cubicTools=fnr;static lineTools=unr;static polygonTools=bnr;static quadTools=ynr;static pathToAbsolute=s4e;static pathToRelative=KQt;static pathToCurve=PR;static pathToString=rUe;static distanceSquareRoot=l4e;static midPoint=P7;static rotateVector=tae;static roundTo=nd;static parsePathString=wx;static finalizeSegment=nUe;static invalidPathValue=vR;static isArcCommand=gkt;static isDigit=IR;static isDigitStart=_kt;static isMoveCommand=Akt;static isPathCommand=mkt;static isSpace=pkt;static paramsCount=EK;static paramsParser=g4e;static PathParser=_Ue;static scanFlag=dkt;static scanParam=ukt;static scanSegment=mUe;static skipSpaces=MK;static distanceEpsilon=AUe;static fixPath=lUe;static getClosestPoint=vnr;static getDrawDirection=Pnr;static getPathArea=xkt;static getPathBBox=iUe;static getPointAtLength=nae;static getPropertiesAtLength=fUe;static getPropertiesAtPoint=A4e;static getSegmentAtLength=Enr;static getSegmentOfPoint=Mnr;static getTotalLength=nw;static isAbsoluteArray=Ckt;static isCurveArray=wnr;static isPolygonArray=iae;static isNormalizedArray=f4e;static isPathArray=hae;static isPointInStroke=Bnr;static isRelativeArray=Tnr;static isValidPath=bkt;static samplePolygon=TK;static shapeParams=sae;static shapeToPath=Lnr;static shapeToPathArray=vkt;static absolutizeSegment=cae;static arcToCubic=lae;static getSVGMatrix=Pkt;static iterate=ty;static lineToCubic=oUe;static normalizePath=$I;static normalizeSegment=_4e;static optimizePath=$Qt;static projection2d=aUe;static quadToCubic=fkt;static relativizeSegment=gUe;static reverseCurve=znr;static reversePath=sO;static roundPath=cUe;static roundSegment=a4e;static segmentToCubic=ykt;static shortenSegment=Skt;static splitPath=c4e;static equalizePaths=jnr;static equalizeSegments=hUe;static splitCubicSegment=Ekt;static transformPath=qQt;static isPointInsideBBox=KI;static pathsIntersection=qnr;static boundingBoxIntersect=xUe;static isMultiPath=sUe;static isClosedPath=yUe;static isPolylineArray=DK;static version=dnr};var NK=Jnr;var X5n=Qe(wt(),1);var K5n=Qe(wt(),1);var q5n=Qe(wt(),1);var yot=Qe(wt(),1);var t4n=Qe(wt(),1);var o4n=Qe(wt(),1);var R9=Qe(wt(),1);Kt();fp();var lY=Qe(wt(),1);var AB=Qe(wt(),1);var n7e=Qe(wt(),1);Kt();m0();Ie();var qx=Qe(wt(),1),s4n=Qe(wt(),1),Eb=Qe(rn(),1),Iot=Qe(wt(),1);var Tp=Qe(M7(),1),h4n=Qe(OUe(),1);Kt();Ie();var p4n=Qe(wt(),1);Kt();var YJ=Qe(M7(),1),Hb=Qe(wt(),1);function MR(){return new VUe}class VUe{index={};array=[];size(){return this.array.length}empty(){return this.array.length===0}itemAt(e){return this.array[e]}contains(e){return this.index[e.id()]!==void 0}find(e){let t=this.index[e.id()];return t===void 0?void 0:this.array[t]}setDefault(e,t){let n=this.index[e.id()];if(n===void 0){let o=new C4e(e,t());return this.index[e.id()]=this.array.length,this.array.push(o),o}else return this.array[n]}insert(e,t){let n=new C4e(e,t),o=this.index[e.id()];if(o===void 0)this.index[e.id()]=this.array.length,this.array.push(n);else this.array[o]=n;return n}erase(e){let t=this.index[e.id()];if(t===void 0)return;this.index[e.id()]=void 0;let n=this.array[t],o=this.array.pop();if(n!==o)this.array[t]=o,this.index[o.first.id()]=t;return n}copy(){let e=new VUe;for(let t=0;t<this.array.length;t++){let n=this.array[t].copy();e.array[t]=n,e.index[n.first.id()]=t}return e}}class C4e{first;second;constructor(e,t){this.first=e,this.second=t}copy(){return new C4e(this.first,this.second)}}class wR{constructor(e=""){this._name=e}id(){return this._id}name(){return this._name}setName(e){this._name=e}context(){return this._context}setContext(e){this._context=e}value(){return this._value}setValue(e){this._value=e}plus(e){return new od(this,e)}minus(e){return new od(this,typeof e==="number"?-e:[-1,e])}multiply(e){return new od([e,this])}divide(e){return new od([1/e,this])}toJSON(){return{name:this._name,value:this._value}}toString(){return this._context+"["+this._name+":"+this._value+"]"}_name;_value=0;_context=null;_id=tpr++}var tpr=0;class od{constructor(){let e=npr(arguments);this._terms=e.terms,this._constant=e.constant}terms(){return this._terms}constant(){return this._constant}value(){let e=this._constant;for(let t=0,n=this._terms.size();t<n;t++){let o=this._terms.itemAt(t);e+=o.first.value()*o.second}return e}plus(e){return new od(this,e)}minus(e){return new od(this,typeof e==="number"?-e:[-1,e])}multiply(e){return new od([e,this])}divide(e){return new od([1/e,this])}isConstant(){return this._terms.size()==0}toString(){let e=this._terms.array.map(function(t){return t.second+"*"+t.first.toString()}).join(" + ");if(!this.isConstant()&&this._constant!==0)e+=" + ";return e+=this._constant,e}_terms;_constant}function npr(e){let t=0,n=()=>0,o=MR();for(let r=0,i=e.length;r<i;++r){let s=e[r];if(typeof s==="number")t+=s;else if(s instanceof wR)o.setDefault(s,n).second+=1;else if(s instanceof od){t+=s.constant();let a=s.terms();for(let c=0,l=a.size();c<l;c++){let h=a.itemAt(c);o.setDefault(h.first,n).second+=h.second}}else if(s instanceof Array){if(s.length!==2)throw Error("array must have length 2");let a=s[0],c=s[1];if(typeof a!=="number")throw Error("array item 0 must be a number");if(c instanceof wR)o.setDefault(c,n).second+=a;else if(c instanceof od){t+=c.constant()*a;let l=c.terms();for(let h=0,d=l.size();h<d;h++){let u=l.itemAt(h);o.setDefault(u.first,n).second+=u.second*a}}else throw Error("array item 1 must be a variable or expression")}else throw Error("invalid Expression argument: "+s)}return{terms:o,constant:t}}class fh{static create(e,t,n,o=1){let r=0;return r+=Math.max(0,Math.min(1000,e*o))*1e6,r+=Math.max(0,Math.min(1000,t*o))*1000,r+=Math.max(0,Math.min(1000,n*o)),r}static required=fh.create(1000,1000,1000);static strong=fh.create(1,0,0);static medium=fh.create(0,1,0);static weak=fh.create(0,0,1);static clip(e){return Math.max(0,Math.min(fh.required,e))}}var Ip;(function(e){e[e.Le=0]="Le",e[e.Ge=1]="Ge",e[e.Eq=2]="Eq"})(Ip||(Ip={}));class mA{constructor(e,t,n,o=fh.required){if(this._operator=t,this._strength=fh.clip(o),n===void 0&&e instanceof od)this._expression=e;else this._expression=e.minus(n)}id(){return this._id}expression(){return this._expression}op(){return this._operator}strength(){return this._strength}toString(){return this._expression.toString()+" "+["<=",">=","="][this._operator]+" 0 ("+this._strength.toString()+")"}_expression;_operator;_strength;_id=opr++}var opr=0;class uae{maxIterations=1000;constructor(){}createConstraint(e,t,n,o=fh.required){let r=new mA(e,t,n,o);return this.addConstraint(r),r}addConstraint(e){if(this._cnMap.find(e)!==void 0)throw Error("duplicate constraint");let n=this._createRow(e),{row:o,tag:r}=n,i=this._chooseSubject(o,r);if(i.type()===xl.Invalid&&o.allDummies())if(!b4e(o.constant()))throw Error("unsatisfiable constraint");else i=r.marker;if(i.type()===xl.Invalid){if(!this._addWithArtificialVariable(o))throw Error("unsatisfiable constraint")}else o.solveFor(i),this._substitute(i,o),this._rowMap.insert(i,o);this._cnMap.insert(e,r),this._optimize(this._objective)}removeConstraint(e){let t=this._cnMap.erase(e);if(t===void 0)throw Error("unknown constraint");this._removeConstraintEffects(e,t.second);let n=t.second.marker,o=this._rowMap.erase(n);if(o===void 0){let r=this._getMarkerLeavingSymbol(n);if(r.type()===xl.Invalid)throw Error("failed to find leaving row");o=this._rowMap.erase(r),o.second.solveForEx(r,n),this._substitute(n,o.second)}this._optimize(this._objective)}hasConstraint(e){return this._cnMap.contains(e)}getConstraints(){return this._cnMap.array.map(({first:e})=>e)}addEditVariable(e,t){if(this._editMap.find(e)!==void 0)throw Error("duplicate edit variable");if(t=fh.clip(t),t===fh.required)throw Error("bad required strength");let o=new od(e),r=new mA(o,Ip.Eq,void 0,t);this.addConstraint(r);let s={tag:this._cnMap.find(r).second,constraint:r,constant:0};this._editMap.insert(e,s)}removeEditVariable(e){let t=this._editMap.erase(e);if(t===void 0)throw Error("unknown edit variable");this.removeConstraint(t.second.constraint)}hasEditVariable(e){return this._editMap.contains(e)}suggestValue(e,t){let n=this._editMap.find(e);if(n===void 0)throw Error("unknown edit variable");let o=this._rowMap,r=n.second,i=t-r.constant;r.constant=t;let s=r.tag.marker,a=o.find(s);if(a!==void 0){if(a.second.add(-i)<0)this._infeasibleRows.push(s);this._dualOptimize();return}let c=r.tag.other;if(a=o.find(c),a!==void 0){if(a.second.add(i)<0)this._infeasibleRows.push(c);this._dualOptimize();return}for(let l=0,h=o.size();l<h;++l){let d=o.itemAt(l),u=d.second,_=u.coefficientFor(s);if(_!==0&&u.add(i*_)<0&&d.first.type()!==xl.External)this._infeasibleRows.push(d.first)}this._dualOptimize()}updateVariables(){let e=this._varMap,t=this._rowMap;for(let n=0,o=e.size();n<o;++n){let r=e.itemAt(n),i=t.find(r.second);if(i!==void 0)r.first.setValue(i.second.constant());else r.first.setValue(0)}}_getVarSymbol(e){let t=()=>this._makeSymbol(xl.External);return this._varMap.setDefault(e,t).second}_createRow(e){let t=e.expression(),n=new I4e(t.constant()),o=t.terms();for(let a=0,c=o.size();a<c;++a){let l=o.itemAt(a);if(!b4e(l.second)){let h=this._getVarSymbol(l.first),d=this._rowMap.find(h);if(d!==void 0)n.insertRow(d.second,l.second);else n.insertSymbol(h,l.second)}}let r=this._objective,i=e.strength(),s={marker:BR,other:BR};switch(e.op()){case Ip.Le:case Ip.Ge:{let a=e.op()===Ip.Le?1:-1,c=this._makeSymbol(xl.Slack);if(s.marker=c,n.insertSymbol(c,a),i<fh.required){let l=this._makeSymbol(xl.Error);s.other=l,n.insertSymbol(l,-a),r.insertSymbol(l,i)}break}case Ip.Eq:{if(i<fh.required){let a=this._makeSymbol(xl.Error),c=this._makeSymbol(xl.Error);s.marker=a,s.other=c,n.insertSymbol(a,-1),n.insertSymbol(c,1),r.insertSymbol(a,i),r.insertSymbol(c,i)}else{let a=this._makeSymbol(xl.Dummy);s.marker=a,n.insertSymbol(a)}break}}if(n.constant()<0)n.reverseSign();return{row:n,tag:s}}_chooseSubject(e,t){let n=e.cells();for(let r=0,i=n.size();r<i;++r){let s=n.itemAt(r);if(s.first.type()===xl.External)return s.first}let o=t.marker.type();if(o===xl.Slack||o===xl.Error){if(e.coefficientFor(t.marker)<0)return t.marker}if(o=t.other.type(),o===xl.Slack||o===xl.Error){if(e.coefficientFor(t.other)<0)return t.other}return BR}_addWithArtificialVariable(e){let t=this._makeSymbol(xl.Slack);this._rowMap.insert(t,e.copy()),this._artificial=e.copy(),this._optimize(this._artificial);let n=b4e(this._artificial.constant());this._artificial=null;let o=this._rowMap.erase(t);if(o!==void 0){let i=o.second;if(i.isConstant())return n;let s=this._anyPivotableSymbol(i);if(s.type()===xl.Invalid)return!1;i.solveForEx(t,s),this._substitute(s,i),this._rowMap.insert(s,i)}let r=this._rowMap;for(let i=0,s=r.size();i<s;++i)r.itemAt(i).second.removeSymbol(t);return this._objective.removeSymbol(t),n}_substitute(e,t){let n=this._rowMap;for(let o=0,r=n.size();o<r;++o){let i=n.itemAt(o);if(i.second.substitute(e,t),i.second.constant()<0&&i.first.type()!==xl.External)this._infeasibleRows.push(i.first)}if(this._objective.substitute(e,t),this._artificial)this._artificial.substitute(e,t)}_optimize(e){let t=0;while(t<this.maxIterations){let n=this._getEnteringSymbol(e);if(n.type()===xl.Invalid)return;let o=this._getLeavingSymbol(n);if(o.type()===xl.Invalid)throw Error("the objective is unbounded");let r=this._rowMap.erase(o).second;r.solveForEx(o,n),this._substitute(n,r),this._rowMap.insert(n,r),t++}throw Error("solver iterations exceeded")}_dualOptimize(){let e=this._rowMap,t=this._infeasibleRows;while(t.length!==0){let n=t.pop(),o=e.find(n);if(o!==void 0&&o.second.constant()<0){let r=this._getDualEnteringSymbol(o.second);if(r.type()===xl.Invalid)throw Error("dual optimize failed");let i=o.second;e.erase(n),i.solveForEx(n,r),this._substitute(r,i),e.insert(r,i)}}}_getEnteringSymbol(e){let t=e.cells();for(let n=0,o=t.size();n<o;++n){let r=t.itemAt(n),i=r.first;if(r.second<0&&i.type()!==xl.Dummy)return i}return BR}_getDualEnteringSymbol(e){let t=Number.MAX_VALUE,n=BR,o=e.cells();for(let r=0,i=o.size();r<i;++r){let s=o.itemAt(r),{first:a,second:c}=s;if(c>0&&a.type()!==xl.Dummy){let h=this._objective.coefficientFor(a)/c;if(h<t)t=h,n=a}}return n}_getLeavingSymbol(e){let t=Number.MAX_VALUE,n=BR,o=this._rowMap;for(let r=0,i=o.size();r<i;++r){let s=o.itemAt(r),a=s.first;if(a.type()!==xl.External){let c=s.second,l=c.coefficientFor(e);if(l<0){let h=-c.constant()/l;if(h<t)t=h,n=a}}}return n}_getMarkerLeavingSymbol(e){let t=Number.MAX_VALUE,n=t,o=t,r=BR,i=r,s=r,a=r,c=this._rowMap;for(let l=0,h=c.size();l<h;++l){let d=c.itemAt(l),u=d.second,_=u.coefficientFor(e);if(_===0)continue;let p=d.first;if(p.type()===xl.External)a=p;else if(_<0){let m=-u.constant()/_;if(m<n)n=m,i=p}else{let m=u.constant()/_;if(m<o)o=m,s=p}}if(i!==r)return i;if(s!==r)return s;return a}_removeConstraintEffects(e,t){if(t.marker.type()===xl.Error)this._removeMarkerEffects(t.marker,e.strength());if(t.other.type()===xl.Error)this._removeMarkerEffects(t.other,e.strength())}_removeMarkerEffects(e,t){let n=this._rowMap.find(e);if(n!==void 0)this._objective.insertRow(n.second,-t);else this._objective.insertSymbol(e,-t)}_anyPivotableSymbol(e){let t=e.cells();for(let n=0,o=t.size();n<o;++n){let r=t.itemAt(n),i=r.first.type();if(i===xl.Slack||i===xl.Error)return r.first}return BR}_makeSymbol(e){return new YUe(e,this._idTick++)}_cnMap=rpr();_rowMap=ipr();_varMap=spr();_editMap=apr();_infeasibleRows=[];_objective=new I4e;_artificial=null;_idTick=0}function b4e(e){let t=0.00000001;return e<0?-e<t:e<t}function rpr(){return MR()}function ipr(){return MR()}function spr(){return MR()}function apr(){return MR()}var xl;(function(e){e[e.Invalid=0]="Invalid",e[e.External=1]="External",e[e.Slack=2]="Slack",e[e.Error=3]="Error",e[e.Dummy=4]="Dummy"})(xl||(xl={}));class YUe{constructor(e,t){this._id=t,this._type=e}id(){return this._id}type(){return this._type}_id;_type}var BR=new YUe(xl.Invalid,-1);class I4e{constructor(e=0){this._constant=e}cells(){return this._cellMap}constant(){return this._constant}isConstant(){return this._cellMap.empty()}allDummies(){let e=this._cellMap;for(let t=0,n=e.size();t<n;++t)if(e.itemAt(t).first.type()!==xl.Dummy)return!1;return!0}copy(){let e=new I4e(this._constant);return e._cellMap=this._cellMap.copy(),e}add(e){return this._constant+=e}insertSymbol(e,t=1){let n=this._cellMap.setDefault(e,()=>0);if(b4e(n.second+=t))this._cellMap.erase(e)}insertRow(e,t=1){this._constant+=e._constant*t;let n=e._cellMap;for(let o=0,r=n.size();o<r;++o){let i=n.itemAt(o);this.insertSymbol(i.first,i.second*t)}}removeSymbol(e){this._cellMap.erase(e)}reverseSign(){this._constant=-this._constant;let e=this._cellMap;for(let t=0,n=e.size();t<n;++t){let o=e.itemAt(t);o.second=-o.second}}solveFor(e){let t=this._cellMap,o=-1/t.erase(e).second;this._constant*=o;for(let r=0,i=t.size();r<i;++r)t.itemAt(r).second*=o}solveForEx(e,t){this.insertSymbol(e,-1),this.solveFor(t)}coefficientFor(e){let t=this._cellMap.find(e);return t!==void 0?t.second:0}substitute(e,t){let n=this._cellMap.erase(e);if(n!==void 0)this.insertRow(t,n.second)}_cellMap=MR();_constant}var _4n=Qe(p0(),1);Ko();Ko();Kt();Kt();Kt();var C4n=Qe(p0(),1),Eot=Qe(rn(),1),I4n=Qe(rn(),1);Kt();Ko();Kt();Ko();var a7e=Qe(wt(),1);Y0();m0();Ko();var Hk=Qe(wt(),1),Fk=Qe(wt(),1);Kt();var XHt=()=>({minX:Number.POSITIVE_INFINITY,maxX:Number.NEGATIVE_INFINITY,minY:Number.POSITIVE_INFINITY,maxY:Number.NEGATIVE_INFINITY}),hO=(e,t,n)=>{e.minX=Math.min(e.minX,t),e.maxX=Math.max(e.maxX,t),e.minY=Math.min(e.minY,n),e.maxY=Math.max(e.maxY,n)},lO=(e,t,n,o,r)=>{hO(e,t-o/2,n-r/2),hO(e,t+o/2,n+r/2)},jHt=(e)=>Number.isFinite(e.minX)&&Number.isFinite(e.maxX)&&Number.isFinite(e.minY)&&Number.isFinite(e.maxY),cpr=(e)=>e.find((t)=>t.type==="pcb_component"),lpr=(e,t)=>{if(!t)return[];return e.filter((n)=>("pcb_component_id"in n)&&n.pcb_component_id===t)},hpr=(e)=>{switch(e){case"from_left":case"from_x_neg":return"left";case"from_right":case"from_x_pos":return"right";case"from_top":case"from_y_pos":case"from_front":return"top";case"from_bottom":case"from_y_neg":case"from_back":return"bottom";case"from_above":case"from_z_pos":return"above";case"from_below":case"from_z_neg":return"below";default:return}},dpr=(e)=>{if(!("insertion_direction"in e))return;return typeof e.insertion_direction==="string"?e.insertion_direction:void 0},upr=(e,t)=>{let n=XHt();for(let o of e){if(o.type==="pcb_smtpad"){if("points"in o)for(let r of o.points)hO(n,r.x,r.y);else if("x"in o&&"y"in o&&"width"in o&&"height"in o)lO(n,o.x,o.y,o.width,o.height);else if("x"in o&&"y"in o&&"radius"in o)lO(n,o.x,o.y,o.radius*2,o.radius*2);continue}if(o.type==="pcb_plated_hole"){if("outer_width"in o&&"outer_height"in o)lO(n,o.x,o.y,o.outer_width,o.outer_height);else if("outer_diameter"in o)lO(n,o.x,o.y,o.outer_diameter,o.outer_diameter);continue}if(o.type==="pcb_hole"){if("hole_diameter"in o)lO(n,o.x,o.y,o.hole_diameter,o.hole_diameter);else if("hole_width"in o&&"hole_height"in o)lO(n,o.x,o.y,o.hole_width,o.hole_height);continue}if(o.type==="pcb_silkscreen_path"){for(let r of o.route)hO(n,r.x,r.y);continue}if(o.type==="pcb_component")lO(n,o.center.x,o.center.y,o.width,o.height)}return jHt(n)?n:t},ppr=(e,t)=>{let n=XHt();for(let o of e){if(o.type==="pcb_smtpad"){if("x"in o&&"y"in o)hO(n,o.x,o.y);if("points"in o)for(let r of o.points)hO(n,r.x,r.y)}if(o.type==="pcb_plated_hole"&&o.pcb_port_id)hO(n,o.x,o.y)}return jHt(n)?n:t},KHt=(e)=>{let t=cpr(e);if(!t)return{x:0,y:0,side:"bottom"};let n={minX:t.center.x-t.width/2,maxX:t.center.x+t.width/2,minY:t.center.y-t.height/2,maxY:t.center.y+t.height/2},o=lpr(e,t.pcb_component_id),r=upr(o,n),i=ppr(o,n),s={left:i.minX-r.minX,right:r.maxX-i.maxX,top:r.maxY-i.maxY,bottom:i.minY-r.minY},a=Object.entries(s).sort((p,m)=>m[1]-p[1])[0]?.[0]??"bottom",c=hpr(dpr(t))??a,l=r.maxX-r.minX,h=r.maxY-r.minY,d=Math.max(0.4,Math.min(l,h)*0.08),u=(r.minX+r.maxX)/2,_=(r.minY+r.maxY)/2;if(c==="above"||c==="below")return{x:u,y:_,side:c,pcbComponentId:t.pcb_component_id};if(c==="top")return{x:u,y:r.maxY+d,side:c,pcbComponentId:t.pcb_component_id};if(c==="left")return{x:r.minX-d,y:_,side:c,pcbComponentId:t.pcb_component_id};if(c==="right")return{x:r.maxX+d,y:_,side:c,pcbComponentId:t.pcb_component_id};return{x:u,y:r.minY-d,side:"bottom",pcbComponentId:t.pcb_component_id}};Kt();m0();m0();var c7e=Qe(wt(),1),l7e=Qe(wt(),1),R4n=Qe(wt(),1);var xXt=Qe(v4e(),1);var Fsn=Qe(v4e(),1),Vsn=Qe(v4e(),1),{create:mpr,defineProperty:$Xe,getOwnPropertyDescriptor:_pr,getOwnPropertyNames:UWt,getPrototypeOf:gpr}=Object,Apr=Object.prototype.hasOwnProperty,Am=(e,t)=>function(){return t||(0,e[UWt(e)[0]])((t={exports:{}}).exports,t),t.exports},wbe=(e,t)=>{for(var n in t)$Xe(e,n,{get:t[n],enumerable:!0})},qXe=(e,t,n)=>(n=e!=null?mpr(gpr(e)):{},((o,r,i,s)=>{if(r&&typeof r=="object"||typeof r=="function")for(let a of UWt(r))Apr.call(o,a)||a===i||$Xe(o,a,{get:()=>r[a],enumerable:!(s=_pr(r,a))||s.enumerable});return o})(!t&&e&&e.__esModule?n:$Xe(n,"default",{value:e,enumerable:!0}),e)),fpr=Am({"node_modules/is-buffer/index.js"(e,t){function n(o){return!!o.constructor&&typeof o.constructor.isBuffer=="function"&&o.constructor.isBuffer(o)}t.exports=function(o){return o!=null&&(n(o)||function(r){return typeof r.readFloatLE=="function"&&typeof r.slice=="function"&&n(r.slice(0,0))}(o)||!!o._isBuffer)}}}),ypr=Am({"node_modules/kind-of/index.js"(e,t){var n=fpr(),o=Object.prototype.toString;t.exports=function(r){if(r===void 0)return"undefined";if(r===null)return"null";if(r===!0||r===!1||r instanceof Boolean)return"boolean";if(typeof r=="string"||r instanceof String)return"string";if(typeof r=="number"||r instanceof Number)return"number";if(typeof r=="function"||r instanceof Function)return"function";if(Array.isArray!==void 0&&Array.isArray(r))return"array";if(r instanceof RegExp)return"regexp";if(r instanceof Date)return"date";var i=o.call(r);return i==="[object RegExp]"?"regexp":i==="[object Date]"?"date":i==="[object Arguments]"?"arguments":i==="[object Error]"?"error":n(r)?"buffer":i==="[object Set]"?"set":i==="[object WeakSet]"?"weakset":i==="[object Map]"?"map":i==="[object WeakMap]"?"weakmap":i==="[object Symbol]"?"symbol":i==="[object Int8Array]"?"int8array":i==="[object Uint8Array]"?"uint8array":i==="[object Uint8ClampedArray]"?"uint8clampedarray":i==="[object Int16Array]"?"int16array":i==="[object Uint16Array]"?"uint16array":i==="[object Int32Array]"?"int32array":i==="[object Uint32Array]"?"uint32array":i==="[object Float32Array]"?"float32array":i==="[object Float64Array]"?"float64array":"object"}}}),xpr=Am({"node_modules/rename-keys/index.js"(e,t){(function(){function n(o,r){if(typeof r!="function")return o;var i={};for(var s in o)Object.prototype.hasOwnProperty.call(o,s)&&(i[r(s,o[s])||s]=o[s]);return i}t!==void 0&&t.exports?t.exports=n:typeof define=="function"&&define.amd?define([],function(){return n}):window.rename=n})()}}),Cpr=Am({"node_modules/deep-rename-keys/index.js"(e,t){var n=ypr(),o=xpr();t.exports=function r(i,s){var a=n(i);if(a!=="object"&&a!=="array")throw Error("expected an object");var c=[];for(var l in a==="object"&&(i=o(i,s),c={}),i)if(i.hasOwnProperty(l)){var h=i[l];n(h)==="object"||n(h)==="array"?c[l]=r(h,s):c[l]=h}return c}}}),bpr=Am({"node_modules/xml-reader/node_modules/eventemitter3/index.js"(e,t){var n=Object.prototype.hasOwnProperty,o="~";function r(){}function i(a,c,l){this.fn=a,this.context=c,this.once=l||!1}function s(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),new r().__proto__||(o=!1)),s.prototype.eventNames=function(){var a,c,l=[];if(this._eventsCount===0)return l;for(c in a=this._events)n.call(a,c)&&l.push(o?c.slice(1):c);return Object.getOwnPropertySymbols?l.concat(Object.getOwnPropertySymbols(a)):l},s.prototype.listeners=function(a,c){var l=o?o+a:a,h=this._events[l];if(c)return!!h;if(!h)return[];if(h.fn)return[h.fn];for(var d=0,u=h.length,_=Array(u);d<u;d++)_[d]=h[d].fn;return _},s.prototype.emit=function(a,c,l,h,d,u){var _=o?o+a:a;if(!this._events[_])return!1;var p,m,A=this._events[_],g=arguments.length;if(A.fn){switch(A.once&&this.removeListener(a,A.fn,void 0,!0),g){case 1:return A.fn.call(A.context),!0;case 2:return A.fn.call(A.context,c),!0;case 3:return A.fn.call(A.context,c,l),!0;case 4:return A.fn.call(A.context,c,l,h),!0;case 5:return A.fn.call(A.context,c,l,h,d),!0;case 6:return A.fn.call(A.context,c,l,h,d,u),!0}for(m=1,p=Array(g-1);m<g;m++)p[m-1]=arguments[m];A.fn.apply(A.context,p)}else{var f,y=A.length;for(m=0;m<y;m++)switch(A[m].once&&this.removeListener(a,A[m].fn,void 0,!0),g){case 1:A[m].fn.call(A[m].context);break;case 2:A[m].fn.call(A[m].context,c);break;case 3:A[m].fn.call(A[m].context,c,l);break;case 4:A[m].fn.call(A[m].context,c,l,h);break;default:if(!p)for(f=1,p=Array(g-1);f<g;f++)p[f-1]=arguments[f];A[m].fn.apply(A[m].context,p)}}return!0},s.prototype.on=function(a,c,l){var h=new i(c,l||this),d=o?o+a:a;return this._events[d]?this._events[d].fn?this._events[d]=[this._events[d],h]:this._events[d].push(h):(this._events[d]=h,this._eventsCount++),this},s.prototype.once=function(a,c,l){var h=new i(c,l||this,!0),d=o?o+a:a;return this._events[d]?this._events[d].fn?this._events[d]=[this._events[d],h]:this._events[d].push(h):(this._events[d]=h,this._eventsCount++),this},s.prototype.removeListener=function(a,c,l,h){var d=o?o+a:a;if(!this._events[d])return this;if(!c)return--this._eventsCount===0?this._events=new r:delete this._events[d],this;var u=this._events[d];if(u.fn)u.fn!==c||h&&!u.once||l&&u.context!==l||(--this._eventsCount===0?this._events=new r:delete this._events[d]);else{for(var _=0,p=[],m=u.length;_<m;_++)(u[_].fn!==c||h&&!u[_].once||l&&u[_].context!==l)&&p.push(u[_]);p.length?this._events[d]=p.length===1?p[0]:p:--this._eventsCount===0?this._events=new r:delete this._events[d]}return this},s.prototype.removeAllListeners=function(a){var c;return a?(c=o?o+a:a,this._events[c]&&(--this._eventsCount===0?this._events=new r:delete this._events[c])):(this._events=new r,this._eventsCount=0),this},s.prototype.off=s.prototype.removeListener,s.prototype.addListener=s.prototype.on,s.prototype.setMaxListeners=function(){return this},s.prefixed=o,s.EventEmitter=s,t!==void 0&&(t.exports=s)}}),Ipr=Am({"node_modules/xml-lexer/node_modules/eventemitter3/index.js"(e,t){var n=Object.prototype.hasOwnProperty,o="~";function r(){}function i(a,c,l){this.fn=a,this.context=c,this.once=l||!1}function s(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),new r().__proto__||(o=!1)),s.prototype.eventNames=function(){var a,c,l=[];if(this._eventsCount===0)return l;for(c in a=this._events)n.call(a,c)&&l.push(o?c.slice(1):c);return Object.getOwnPropertySymbols?l.concat(Object.getOwnPropertySymbols(a)):l},s.prototype.listeners=function(a,c){var l=o?o+a:a,h=this._events[l];if(c)return!!h;if(!h)return[];if(h.fn)return[h.fn];for(var d=0,u=h.length,_=Array(u);d<u;d++)_[d]=h[d].fn;return _},s.prototype.emit=function(a,c,l,h,d,u){var _=o?o+a:a;if(!this._events[_])return!1;var p,m,A=this._events[_],g=arguments.length;if(A.fn){switch(A.once&&this.removeListener(a,A.fn,void 0,!0),g){case 1:return A.fn.call(A.context),!0;case 2:return A.fn.call(A.context,c),!0;case 3:return A.fn.call(A.context,c,l),!0;case 4:return A.fn.call(A.context,c,l,h),!0;case 5:return A.fn.call(A.context,c,l,h,d),!0;case 6:return A.fn.call(A.context,c,l,h,d,u),!0}for(m=1,p=Array(g-1);m<g;m++)p[m-1]=arguments[m];A.fn.apply(A.context,p)}else{var f,y=A.length;for(m=0;m<y;m++)switch(A[m].once&&this.removeListener(a,A[m].fn,void 0,!0),g){case 1:A[m].fn.call(A[m].context);break;case 2:A[m].fn.call(A[m].context,c);break;case 3:A[m].fn.call(A[m].context,c,l);break;case 4:A[m].fn.call(A[m].context,c,l,h);break;default:if(!p)for(f=1,p=Array(g-1);f<g;f++)p[f-1]=arguments[f];A[m].fn.apply(A[m].context,p)}}return!0},s.prototype.on=function(a,c,l){var h=new i(c,l||this),d=o?o+a:a;return this._events[d]?this._events[d].fn?this._events[d]=[this._events[d],h]:this._events[d].push(h):(this._events[d]=h,this._eventsCount++),this},s.prototype.once=function(a,c,l){var h=new i(c,l||this,!0),d=o?o+a:a;return this._events[d]?this._events[d].fn?this._events[d]=[this._events[d],h]:this._events[d].push(h):(this._events[d]=h,this._eventsCount++),this},s.prototype.removeListener=function(a,c,l,h){var d=o?o+a:a;if(!this._events[d])return this;if(!c)return--this._eventsCount===0?this._events=new r:delete this._events[d],this;var u=this._events[d];if(u.fn)u.fn!==c||h&&!u.once||l&&u.context!==l||(--this._eventsCount===0?this._events=new r:delete this._events[d]);else{for(var _=0,p=[],m=u.length;_<m;_++)(u[_].fn!==c||h&&!u[_].once||l&&u[_].context!==l)&&p.push(u[_]);p.length?this._events[d]=p.length===1?p[0]:p:--this._eventsCount===0?this._events=new r:delete this._events[d]}return this},s.prototype.removeAllListeners=function(a){var c;return a?(c=o?o+a:a,this._events[c]&&(--this._eventsCount===0?this._events=new r:delete this._events[c])):(this._events=new r,this._eventsCount=0),this},s.prototype.off=s.prototype.removeListener,s.prototype.addListener=s.prototype.on,s.prototype.setMaxListeners=function(){return this},s.prefixed=o,s.EventEmitter=s,t!==void 0&&(t.exports=s)}}),vpr=Am({"node_modules/xml-lexer/dist/lexer.js"(e,t){function n(l,h,d){return h in l?Object.defineProperty(l,h,{value:d,enumerable:!0,configurable:!0,writable:!0}):l[h]=d,l}var o=Ipr(),r=function(){},i={data:"state-data",cdata:"state-cdata",tagBegin:"state-tag-begin",tagName:"state-tag-name",tagEnd:"state-tag-end",attributeNameStart:"state-attribute-name-start",attributeName:"state-attribute-name",attributeNameEnd:"state-attribute-name-end",attributeValueBegin:"state-attribute-value-begin",attributeValue:"state-attribute-value"},s={lt:"action-lt",gt:"action-gt",space:"action-space",equal:"action-equal",quote:"action-quote",slash:"action-slash",char:"action-char",error:"action-error"},a={text:"text",openTag:"open-tag",closeTag:"close-tag",attributeName:"attribute-name",attributeValue:"attribute-value"},c={" ":s.space,"\t":s.space,"\n":s.space,"\r":s.space,"<":s.lt,">":s.gt,'"':s.quote,"'":s.quote,"=":s.equal,"/":s.slash};t.exports={State:i,Action:s,Type:a,create:function(l){var h,d,u,_,p,m,A,g,f,y;l=Object.assign({debug:!1},l);var x=new o,C=i.data,b="",I="",v="",P="",M="",B="",T=function(D,L){if(I[0]!=="?"&&I[0]!=="!"){var H={type:D,value:L};l.debug&&console.log("emit:",H),x.emit("data",H)}};x.stateMachine=(n(y={},i.data,(n(h={},s.lt,function(){b.trim()&&T(a.text,b),I="",M=!1,C=i.tagBegin}),n(h,s.char,function(D){b+=D}),h)),n(y,i.cdata,n({},s.char,function(D){(b+=D).substr(-3)==="]]>"&&(T(a.text,b.slice(0,-3)),b="",C=i.data)})),n(y,i.tagBegin,(n(d={},s.space,r),n(d,s.char,function(D){I=D,C=i.tagName}),n(d,s.slash,function(){I="",M=!0}),d)),n(y,i.tagName,(n(u={},s.space,function(){M?C=i.tagEnd:(C=i.attributeNameStart,T(a.openTag,I))}),n(u,s.gt,function(){T(M?a.closeTag:a.openTag,I),b="",C=i.data}),n(u,s.slash,function(){C=i.tagEnd,T(a.openTag,I)}),n(u,s.char,function(D){(I+=D)==="![CDATA["&&(C=i.cdata,b="",I="")}),u)),n(y,i.tagEnd,(n(_={},s.gt,function(){T(a.closeTag,I),b="",C=i.data}),n(_,s.char,r),_)),n(y,i.attributeNameStart,(n(p={},s.char,function(D){v=D,C=i.attributeName}),n(p,s.gt,function(){b="",C=i.data}),n(p,s.space,r),n(p,s.slash,function(){M=!0,C=i.tagEnd}),p)),n(y,i.attributeName,(n(m={},s.space,function(){C=i.attributeNameEnd}),n(m,s.equal,function(){T(a.attributeName,v),C=i.attributeValueBegin}),n(m,s.gt,function(){P="",T(a.attributeName,v),T(a.attributeValue,P),b="",C=i.data}),n(m,s.slash,function(){M=!0,P="",T(a.attributeName,v),T(a.attributeValue,P),C=i.tagEnd}),n(m,s.char,function(D){v+=D}),m)),n(y,i.attributeNameEnd,(n(A={},s.space,r),n(A,s.equal,function(){T(a.attributeName,v),C=i.attributeValueBegin}),n(A,s.gt,function(){P="",T(a.attributeName,v),T(a.attributeValue,P),b="",C=i.data}),n(A,s.char,function(D){P="",T(a.attributeName,v),T(a.attributeValue,P),v=D,C=i.attributeName}),A)),n(y,i.attributeValueBegin,(n(g={},s.space,r),n(g,s.quote,function(D){B=D,P="",C=i.attributeValue}),n(g,s.gt,function(){T(a.attributeValue,P=""),b="",C=i.data}),n(g,s.char,function(D){B="",P=D,C=i.attributeValue}),g)),n(y,i.attributeValue,(n(f={},s.space,function(D){B?P+=D:(T(a.attributeValue,P),C=i.attributeNameStart)}),n(f,s.quote,function(D){B===D?(T(a.attributeValue,P),C=i.attributeNameStart):P+=D}),n(f,s.gt,function(D){B?P+=D:(T(a.attributeValue,P),b="",C=i.data)}),n(f,s.slash,function(D){B?P+=D:(T(a.attributeValue,P),M=!0,C=i.tagEnd)}),n(f,s.char,function(D){P+=D}),f)),y);var N=function(D){l.debug&&console.log(C,D);var L=x.stateMachine[C],H=L[function(V){return c[V]||s.char}(D)]||L[s.error]||L[s.char];H(D)};return x.write=function(D){for(var L=D.length,H=0;H<L;H++)N(D[H])},x}}}}),Spr=Am({"node_modules/xml-reader/dist/reader.js"(e,t){var n=bpr(),o=vpr(),r=o.Type,i={element:"element",text:"text"},s=function(c){return Object.assign({name:"",type:i.element,value:"",parent:null,attributes:{},children:[]},c)},a=function(c){c=Object.assign({stream:!1,parentNodes:!0,doneEvent:"done",tagPrefix:"tag:",emitTopLevelOnly:!1,debug:!1},c);var l=void 0,h=void 0,d=void 0,u=void 0,_=new n,p=function(m){switch(m.type){case r.openTag:if(d===null)(d=h).name=m.value;else{var A=s({name:m.value,parent:d});d.children.push(A),d=A}break;case r.closeTag:var g=d.parent;if(c.parentNodes||(d.parent=null),d.name!==m.value)break;c.stream&&g===h&&(h.children=[],d.parent=null),c.emitTopLevelOnly&&g!==h||(_.emit(c.tagPrefix+d.name,d),_.emit("tag",d.name,d)),d===h&&(l.removeAllListeners("data"),_.emit(c.doneEvent,d),h=null),d=g;break;case r.text:d&&d.children.push(s({type:i.text,value:m.value,parent:c.parentNodes?d:null}));break;case r.attributeName:u=m.value,d.attributes[u]="";break;case r.attributeValue:d.attributes[u]=m.value}};return _.reset=function(){(l=o.create({debug:c.debug})).on("data",p),h=s(),d=null,u="",_.parse=l.write},_.reset(),_};t.exports={parseSync:function(c,l){l=Object.assign({},l,{stream:!1,tagPrefix:":"});var h=a(l),d=void 0;return h.on("done",function(u){d=u}),h.parse(c),d},create:a,NodeType:i}}}),Bbe=Am({"node_modules/binary-search-bounds/search-bounds.js"(e,t){function n(c,l,h,d,u){for(var _=u+1;d<=u;){var p=d+u>>>1,m=c[p];(h!==void 0?h(m,l):m-l)>=0?(_=p,u=p-1):d=p+1}return _}function o(c,l,h,d,u){for(var _=u+1;d<=u;){var p=d+u>>>1,m=c[p];(h!==void 0?h(m,l):m-l)>0?(_=p,u=p-1):d=p+1}return _}function r(c,l,h,d,u){for(var _=d-1;d<=u;){var p=d+u>>>1,m=c[p];(h!==void 0?h(m,l):m-l)<0?(_=p,d=p+1):u=p-1}return _}function i(c,l,h,d,u){for(var _=d-1;d<=u;){var p=d+u>>>1,m=c[p];(h!==void 0?h(m,l):m-l)<=0?(_=p,d=p+1):u=p-1}return _}function s(c,l,h,d,u){for(;d<=u;){var _=d+u>>>1,p=c[_],m=h!==void 0?h(p,l):p-l;if(m===0)return _;m<=0?d=_+1:u=_-1}return-1}function a(c,l,h,d,u,_){return typeof h=="function"?_(c,l,h,d===void 0?0:0|d,u===void 0?c.length-1:0|u):_(c,l,void 0,h===void 0?0:0|h,d===void 0?c.length-1:0|d)}t.exports={ge:function(c,l,h,d,u){return a(c,l,h,d,u,n)},gt:function(c,l,h,d,u){return a(c,l,h,d,u,o)},lt:function(c,l,h,d,u){return a(c,l,h,d,u,r)},le:function(c,l,h,d,u){return a(c,l,h,d,u,i)},eq:function(c,l,h,d,u){return a(c,l,h,d,u,s)}}}}),l$e=Am({"node_modules/two-product/two-product.js"(e,t){t.exports=function(o,r,i){var s=o*r,a=n*o,c=a-(a-o),l=o-c,h=n*r,d=h-(h-r),u=r-d,_=l*u-(s-c*d-l*d-c*u);if(i)return i[0]=_,i[1]=s,i;return[_,s]};var n=+(Math.pow(2,27)+1)}}),WWt=Am({"node_modules/robust-sum/robust-sum.js"(e,t){t.exports=function(n,o){var r=0|n.length,i=0|o.length;if(r===1&&i===1)return function(v,P){var M=v+P,B=M-v,T=M-B,N=P-B,D=v-T,L=D+N;if(L)return[L,M];return[M]}(n[0],o[0]);var s,a,c=Array(r+i),l=0,h=0,d=0,u=Math.abs,_=n[h],p=u(_),m=o[d],A=u(m);p<A?(a=_,(h+=1)<r&&(p=u(_=n[h]))):(a=m,(d+=1)<i&&(A=u(m=o[d]))),h<r&&p<A||d>=i?(s=_,(h+=1)<r&&(p=u(_=n[h]))):(s=m,(d+=1)<i&&(A=u(m=o[d])));var g,f,y=s+a,x=y-s,C=a-x,b=C,I=y;for(;h<r&&d<i;)p<A?(s=_,(h+=1)<r&&(p=u(_=n[h]))):(s=m,(d+=1)<i&&(A=u(m=o[d]))),(C=(a=b)-(x=(y=s+a)-s))&&(c[l++]=C),b=I-((g=I+y)-(f=g-I))+(y-f),I=g;for(;h<r;)(C=(a=b)-(x=(y=(s=_)+a)-s))&&(c[l++]=C),b=I-((g=I+y)-(f=g-I))+(y-f),I=g,(h+=1)<r&&(_=n[h]);for(;d<i;)(C=(a=b)-(x=(y=(s=m)+a)-s))&&(c[l++]=C),b=I-((g=I+y)-(f=g-I))+(y-f),I=g,(d+=1)<i&&(m=o[d]);return b&&(c[l++]=b),I&&(c[l++]=I),l||(c[l++]=0),c.length=l,c}}}),Ppr=Am({"node_modules/two-sum/two-sum.js"(e,t){t.exports=function(n,o,r){var i=n+o,s=i-n,a=o-s,c=n-(i-s);if(r)return r[0]=c+a,r[1]=i,r;return[c+a,i]}}}),XWt=Am({"node_modules/robust-scale/robust-scale.js"(e,t){var n=l$e(),o=Ppr();t.exports=function(r,i){var s=r.length;if(s===1){var a=n(r[0],i);return a[0]?a:[a[1]]}var c=Array(2*s),l=[0.1,0.1],h=[0.1,0.1],d=0;n(r[0],i,l),l[0]&&(c[d++]=l[0]);for(var u=1;u<s;++u){n(r[u],i,h);var _=l[1];o(_,h[0],l),l[0]&&(c[d++]=l[0]);var p=h[1],m=l[1],A=p+m,g=m-(A-p);l[1]=A,g&&(c[d++]=g)}return l[1]&&(c[d++]=l[1]),d===0&&(c[d++]=0),c.length=d,c}}}),jWt=Am({"node_modules/robust-subtract/robust-diff.js"(e,t){t.exports=function(n,o){var r=0|n.length,i=0|o.length;if(r===1&&i===1)return function(v,P){var M=v+P,B=M-v,T=M-B,N=P-B,D=v-T,L=D+N;if(L)return[L,M];return[M]}(n[0],-o[0]);var s,a,c=Array(r+i),l=0,h=0,d=0,u=Math.abs,_=n[h],p=u(_),m=-o[d],A=u(m);p<A?(a=_,(h+=1)<r&&(p=u(_=n[h]))):(a=m,(d+=1)<i&&(A=u(m=-o[d]))),h<r&&p<A||d>=i?(s=_,(h+=1)<r&&(p=u(_=n[h]))):(s=m,(d+=1)<i&&(A=u(m=-o[d])));var g,f,y=s+a,x=y-s,C=a-x,b=C,I=y;for(;h<r&&d<i;)p<A?(s=_,(h+=1)<r&&(p=u(_=n[h]))):(s=m,(d+=1)<i&&(A=u(m=-o[d]))),(C=(a=b)-(x=(y=s+a)-s))&&(c[l++]=C),b=I-((g=I+y)-(f=g-I))+(y-f),I=g;for(;h<r;)(C=(a=b)-(x=(y=(s=_)+a)-s))&&(c[l++]=C),b=I-((g=I+y)-(f=g-I))+(y-f),I=g,(h+=1)<r&&(_=n[h]);for(;d<i;)(C=(a=b)-(x=(y=(s=m)+a)-s))&&(c[l++]=C),b=I-((g=I+y)-(f=g-I))+(y-f),I=g,(d+=1)<i&&(m=-o[d]);return b&&(c[l++]=b),I&&(c[l++]=I),l||(c[l++]=0),c.length=l,c}}}),Epr=Am({"node_modules/robust-orientation/orientation.js"(e,t){var n=l$e(),o=WWt(),r=XWt(),i=jWt();function s(m,A,g,f){return function(y,x,C){var b=m(m(A(x[1],C[0]),A(-C[1],x[0])),m(A(y[1],x[0]),A(-x[1],y[0]))),I=m(A(y[1],C[0]),A(-C[1],y[0])),v=f(b,I);return v[v.length-1]}}function a(m,A,g,f){return function(y,x,C,b){var I=m(m(g(m(A(C[1],b[0]),A(-b[1],C[0])),x[2]),m(g(m(A(x[1],b[0]),A(-b[1],x[0])),-C[2]),g(m(A(x[1],C[0]),A(-C[1],x[0])),b[2]))),m(g(m(A(x[1],b[0]),A(-b[1],x[0])),y[2]),m(g(m(A(y[1],b[0]),A(-b[1],y[0])),-x[2]),g(m(A(y[1],x[0]),A(-x[1],y[0])),b[2])))),v=m(m(g(m(A(C[1],b[0]),A(-b[1],C[0])),y[2]),m(g(m(A(y[1],b[0]),A(-b[1],y[0])),-C[2]),g(m(A(y[1],C[0]),A(-C[1],y[0])),b[2]))),m(g(m(A(x[1],C[0]),A(-C[1],x[0])),y[2]),m(g(m(A(y[1],C[0]),A(-C[1],y[0])),-x[2]),g(m(A(y[1],x[0]),A(-x[1],y[0])),C[2])))),P=f(I,v);return P[P.length-1]}}function c(m,A,g,f){return function(y,x,C,b,I){var v=m(m(m(g(m(g(m(A(b[1],I[0]),A(-I[1],b[0])),C[2]),m(g(m(A(C[1],I[0]),A(-I[1],C[0])),-b[2]),g(m(A(C[1],b[0]),A(-b[1],C[0])),I[2]))),x[3]),m(g(m(g(m(A(b[1],I[0]),A(-I[1],b[0])),x[2]),m(g(m(A(x[1],I[0]),A(-I[1],x[0])),-b[2]),g(m(A(x[1],b[0]),A(-b[1],x[0])),I[2]))),-C[3]),g(m(g(m(A(C[1],I[0]),A(-I[1],C[0])),x[2]),m(g(m(A(x[1],I[0]),A(-I[1],x[0])),-C[2]),g(m(A(x[1],C[0]),A(-C[1],x[0])),I[2]))),b[3]))),m(g(m(g(m(A(C[1],b[0]),A(-b[1],C[0])),x[2]),m(g(m(A(x[1],b[0]),A(-b[1],x[0])),-C[2]),g(m(A(x[1],C[0]),A(-C[1],x[0])),b[2]))),-I[3]),m(g(m(g(m(A(b[1],I[0]),A(-I[1],b[0])),x[2]),m(g(m(A(x[1],I[0]),A(-I[1],x[0])),-b[2]),g(m(A(x[1],b[0]),A(-b[1],x[0])),I[2]))),y[3]),g(m(g(m(A(b[1],I[0]),A(-I[1],b[0])),y[2]),m(g(m(A(y[1],I[0]),A(-I[1],y[0])),-b[2]),g(m(A(y[1],b[0]),A(-b[1],y[0])),I[2]))),-x[3])))),m(m(g(m(g(m(A(x[1],I[0]),A(-I[1],x[0])),y[2]),m(g(m(A(y[1],I[0]),A(-I[1],y[0])),-x[2]),g(m(A(y[1],x[0]),A(-x[1],y[0])),I[2]))),b[3]),m(g(m(g(m(A(x[1],b[0]),A(-b[1],x[0])),y[2]),m(g(m(A(y[1],b[0]),A(-b[1],y[0])),-x[2]),g(m(A(y[1],x[0]),A(-x[1],y[0])),b[2]))),-I[3]),g(m(g(m(A(C[1],b[0]),A(-b[1],C[0])),x[2]),m(g(m(A(x[1],b[0]),A(-b[1],x[0])),-C[2]),g(m(A(x[1],C[0]),A(-C[1],x[0])),b[2]))),y[3]))),m(g(m(g(m(A(C[1],b[0]),A(-b[1],C[0])),y[2]),m(g(m(A(y[1],b[0]),A(-b[1],y[0])),-C[2]),g(m(A(y[1],C[0]),A(-C[1],y[0])),b[2]))),-x[3]),m(g(m(g(m(A(x[1],b[0]),A(-b[1],x[0])),y[2]),m(g(m(A(y[1],b[0]),A(-b[1],y[0])),-x[2]),g(m(A(y[1],x[0]),A(-x[1],y[0])),b[2]))),C[3]),g(m(g(m(A(x[1],C[0]),A(-C[1],x[0])),y[2]),m(g(m(A(y[1],C[0]),A(-C[1],y[0])),-x[2]),g(m(A(y[1],x[0]),A(-x[1],y[0])),C[2]))),-b[3]))))),P=m(m(m(g(m(g(m(A(b[1],I[0]),A(-I[1],b[0])),C[2]),m(g(m(A(C[1],I[0]),A(-I[1],C[0])),-b[2]),g(m(A(C[1],b[0]),A(-b[1],C[0])),I[2]))),y[3]),g(m(g(m(A(b[1],I[0]),A(-I[1],b[0])),y[2]),m(g(m(A(y[1],I[0]),A(-I[1],y[0])),-b[2]),g(m(A(y[1],b[0]),A(-b[1],y[0])),I[2]))),-C[3])),m(g(m(g(m(A(C[1],I[0]),A(-I[1],C[0])),y[2]),m(g(m(A(y[1],I[0]),A(-I[1],y[0])),-C[2]),g(m(A(y[1],C[0]),A(-C[1],y[0])),I[2]))),b[3]),g(m(g(m(A(C[1],b[0]),A(-b[1],C[0])),y[2]),m(g(m(A(y[1],b[0]),A(-b[1],y[0])),-C[2]),g(m(A(y[1],C[0]),A(-C[1],y[0])),b[2]))),-I[3]))),m(m(g(m(g(m(A(C[1],I[0]),A(-I[1],C[0])),x[2]),m(g(m(A(x[1],I[0]),A(-I[1],x[0])),-C[2]),g(m(A(x[1],C[0]),A(-C[1],x[0])),I[2]))),y[3]),g(m(g(m(A(C[1],I[0]),A(-I[1],C[0])),y[2]),m(g(m(A(y[1],I[0]),A(-I[1],y[0])),-C[2]),g(m(A(y[1],C[0]),A(-C[1],y[0])),I[2]))),-x[3])),m(g(m(g(m(A(x[1],I[0]),A(-I[1],x[0])),y[2]),m(g(m(A(y[1],I[0]),A(-I[1],y[0])),-x[2]),g(m(A(y[1],x[0]),A(-x[1],y[0])),I[2]))),C[3]),g(m(g(m(A(x[1],C[0]),A(-C[1],x[0])),y[2]),m(g(m(A(y[1],C[0]),A(-C[1],y[0])),-x[2]),g(m(A(y[1],x[0]),A(-x[1],y[0])),C[2]))),-I[3])))),M=f(v,P);return M[M.length-1]}}function l(m){return(m===3?s:m===4?a:c)(o,n,r,i)}var h=l(3),d=l(4),u=[function(){return 0},function(){return 0},function(m,A){return A[0]-m[0]},function(m,A,g){var f,y=(m[1]-g[1])*(A[0]-g[0]),x=(m[0]-g[0])*(A[1]-g[1]),C=y-x;if(y>0){if(x<=0)return C;f=y+x}else{if(!(y<0))return C;if(x>=0)return C;f=-(y+x)}var b=0.00000000000000033306690738754716*f;return C>=b||C<=-b?C:h(m,A,g)},function(m,A,g,f){var y=m[0]-f[0],x=A[0]-f[0],C=g[0]-f[0],b=m[1]-f[1],I=A[1]-f[1],v=g[1]-f[1],P=m[2]-f[2],M=A[2]-f[2],B=g[2]-f[2],T=x*v,N=C*I,D=C*b,L=y*v,H=y*I,V=x*b,O=P*(T-N)+M*(D-L)+B*(H-V),U=0.0000000000000007771561172376103*((Math.abs(T)+Math.abs(N))*Math.abs(P)+(Math.abs(D)+Math.abs(L))*Math.abs(M)+(Math.abs(H)+Math.abs(V))*Math.abs(B));return O>U||-O>U?O:d(m,A,g,f)}];function _(m){var A=u[m.length];return A||(A=u[m.length]=l(m.length)),A.apply(void 0,m)}function p(m,A,g,f,y,x,C){return function(b,I,v,P,M){switch(arguments.length){case 0:case 1:return 0;case 2:return f(b,I);case 3:return y(b,I,v);case 4:return x(b,I,v,P);case 5:return C(b,I,v,P,M)}for(var B=Array(arguments.length),T=0;T<arguments.length;++T)B[T]=arguments[T];return m(B)}}(function(){for(;u.length<=5;)u.push(l(u.length));t.exports=p.apply(void 0,[_].concat(u));for(var m=0;m<=5;++m)t.exports[m]=u[m]})()}}),Mpr=Am({"node_modules/cdt2d/lib/monotone.js"(e,t){var n=Bbe(),o=Epr()[3];function r(u,_,p,m,A){this.a=u,this.b=_,this.idx=p,this.lowerIds=m,this.upperIds=A}function i(u,_,p,m){this.a=u,this.b=_,this.type=p,this.idx=m}function s(u,_){var p=u.a[0]-_.a[0]||u.a[1]-_.a[1]||u.type-_.type;return p||(u.type!==0&&(p=o(u.a,u.b,_.b))?p:u.idx-_.idx)}function a(u,_){return o(u.a,u.b,_)}function c(u,_,p,m,A){for(var g=n.lt(_,m,a),f=n.gt(_,m,a),y=g;y<f;++y){for(var x=_[y],C=x.lowerIds,b=C.length;b>1&&o(p[C[b-2]],p[C[b-1]],m)>0;)u.push([C[b-1],C[b-2],A]),b-=1;C.length=b,C.push(A);var I=x.upperIds;for(b=I.length;b>1&&o(p[I[b-2]],p[I[b-1]],m)<0;)u.push([I[b-2],I[b-1],A]),b-=1;I.length=b,I.push(A)}}function l(u,_){var p;return(p=u.a[0]<_.a[0]?o(u.a,u.b,_.a):o(_.b,_.a,u.a))?p:(p=_.b[0]<u.b[0]?o(u.a,u.b,_.b):o(_.b,_.a,u.b))||u.idx-_.idx}function h(u,_,p){var m=n.le(u,p,l),A=u[m],g=A.upperIds,f=g[g.length-1];A.upperIds=[f],u.splice(m+1,0,new r(p.a,p.b,p.idx,[f],g))}function d(u,_,p){var m=p.a;p.a=p.b,p.b=m;var A=n.eq(u,p,l),g=u[A];u[A-1].upperIds=g.upperIds,u.splice(A,1)}t.exports=function(u,_){for(var p=u.length,m=_.length,A=[],g=0;g<p;++g)A.push(new i(u[g],null,0,g));for(g=0;g<m;++g){var f=_[g],y=u[f[0]],x=u[f[1]];y[0]<x[0]?A.push(new i(y,x,2,g),new i(x,y,1,g)):y[0]>x[0]&&A.push(new i(x,y,2,g),new i(y,x,1,g))}A.sort(s);for(var C=A[0].a[0]-(1+Math.abs(A[0].a[0]))*Math.pow(2,-52),b=[new r([C,1],[C,0],-1,[],[],[],[])],I=[],v=(g=0,A.length);g<v;++g){var P=A[g],M=P.type;M===0?c(I,b,u,P.a,P.idx):M===2?h(b,u,P):d(b,u,P)}return I}}}),wpr=Am({"node_modules/cdt2d/lib/triangulation.js"(e,t){var n=Bbe();function o(s,a){this.stars=s,this.edges=a}t.exports=function(s,a){for(var c=Array(s),l=0;l<s;++l)c[l]=[];return new o(c,a)};var r=o.prototype;function i(s,a,c){for(var l=1,h=s.length;l<h;l+=2)if(s[l-1]===a&&s[l]===c)return s[l-1]=s[h-2],s[l]=s[h-1],void(s.length=h-2)}r.isConstraint=function(){var s=[0,0];function a(c,l){return c[0]-l[0]||c[1]-l[1]}return function(c,l){return s[0]=Math.min(c,l),s[1]=Math.max(c,l),n.eq(this.edges,s,a)>=0}}(),r.removeTriangle=function(s,a,c){var l=this.stars;i(l[s],a,c),i(l[a],c,s),i(l[c],s,a)},r.addTriangle=function(s,a,c){var l=this.stars;l[s].push(a,c),l[a].push(c,s),l[c].push(s,a)},r.opposite=function(s,a){for(var c=this.stars[a],l=1,h=c.length;l<h;l+=2)if(c[l]===s)return c[l-1];return-1},r.flip=function(s,a){var c=this.opposite(s,a),l=this.opposite(a,s);this.removeTriangle(s,a,c),this.removeTriangle(a,s,l),this.addTriangle(s,l,c),this.addTriangle(a,c,l)},r.edges=function(){for(var s=this.stars,a=[],c=0,l=s.length;c<l;++c)for(var h=s[c],d=0,u=h.length;d<u;d+=2)a.push([h[d],h[d+1]]);return a},r.cells=function(){for(var s=this.stars,a=[],c=0,l=s.length;c<l;++c)for(var h=s[c],d=0,u=h.length;d<u;d+=2){var _=h[d],p=h[d+1];c<Math.min(_,p)&&a.push([c,_,p])}return a}}}),Bpr=Am({"node_modules/robust-in-sphere/in-sphere.js"(e,t){var n=l$e(),o=WWt(),r=jWt(),i=XWt();function s(p){return(p===3?a:p===4?c:p===5?l:h)(o,r,n,i)}function a(p,m,A,g){return function(f,y,x){var C=A(f[0],f[0]),b=g(C,y[0]),I=g(C,x[0]),v=A(y[0],y[0]),P=g(v,f[0]),M=g(v,x[0]),B=A(x[0],x[0]),T=g(B,f[0]),N=g(B,y[0]),D=p(m(N,M),m(P,b)),L=m(T,I),H=m(D,L);return H[H.length-1]}}function c(p,m,A,g){return function(f,y,x,C){var b=p(A(f[0],f[0]),A(f[1],f[1])),I=g(b,y[0]),v=g(b,x[0]),P=g(b,C[0]),M=p(A(y[0],y[0]),A(y[1],y[1])),B=g(M,f[0]),T=g(M,x[0]),N=g(M,C[0]),D=p(A(x[0],x[0]),A(x[1],x[1])),L=g(D,f[0]),H=g(D,y[0]),V=g(D,C[0]),O=p(A(C[0],C[0]),A(C[1],C[1])),U=g(O,f[0]),j=g(O,y[0]),Y=g(O,x[0]),X=p(p(g(m(Y,V),y[1]),p(g(m(j,N),-x[1]),g(m(H,T),C[1]))),p(g(m(j,N),f[1]),p(g(m(U,P),-y[1]),g(m(B,I),C[1])))),K=p(p(g(m(Y,V),f[1]),p(g(m(U,P),-x[1]),g(m(L,v),C[1]))),p(g(m(H,T),f[1]),p(g(m(L,v),-y[1]),g(m(B,I),x[1])))),J=m(X,K);return J[J.length-1]}}function l(p,m,A,g){return function(f,y,x,C,b){var I=p(A(f[0],f[0]),p(A(f[1],f[1]),A(f[2],f[2]))),v=g(I,y[0]),P=g(I,x[0]),M=g(I,C[0]),B=g(I,b[0]),T=p(A(y[0],y[0]),p(A(y[1],y[1]),A(y[2],y[2]))),N=g(T,f[0]),D=g(T,x[0]),L=g(T,C[0]),H=g(T,b[0]),V=p(A(x[0],x[0]),p(A(x[1],x[1]),A(x[2],x[2]))),O=g(V,f[0]),U=g(V,y[0]),j=g(V,C[0]),Y=g(V,b[0]),X=p(A(C[0],C[0]),p(A(C[1],C[1]),A(C[2],C[2]))),K=g(X,f[0]),J=g(X,y[0]),ee=g(X,x[0]),se=g(X,b[0]),ne=p(A(b[0],b[0]),p(A(b[1],b[1]),A(b[2],b[2]))),re=g(ne,f[0]),Z=g(ne,y[0]),te=g(ne,x[0]),ie=g(ne,C[0]),ce=p(p(p(g(p(g(m(ie,se),x[1]),p(g(m(te,Y),-C[1]),g(m(ee,j),b[1]))),y[2]),p(g(p(g(m(ie,se),y[1]),p(g(m(Z,H),-C[1]),g(m(J,L),b[1]))),-x[2]),g(p(g(m(te,Y),y[1]),p(g(m(Z,H),-x[1]),g(m(U,D),b[1]))),C[2]))),p(g(p(g(m(ee,j),y[1]),p(g(m(J,L),-x[1]),g(m(U,D),C[1]))),-b[2]),p(g(p(g(m(ie,se),y[1]),p(g(m(Z,H),-C[1]),g(m(J,L),b[1]))),f[2]),g(p(g(m(ie,se),f[1]),p(g(m(re,B),-C[1]),g(m(K,M),b[1]))),-y[2])))),p(p(g(p(g(m(Z,H),f[1]),p(g(m(re,B),-y[1]),g(m(N,v),b[1]))),C[2]),p(g(p(g(m(J,L),f[1]),p(g(m(K,M),-y[1]),g(m(N,v),C[1]))),-b[2]),g(p(g(m(ee,j),y[1]),p(g(m(J,L),-x[1]),g(m(U,D),C[1]))),f[2]))),p(g(p(g(m(ee,j),f[1]),p(g(m(K,M),-x[1]),g(m(O,P),C[1]))),-y[2]),p(g(p(g(m(J,L),f[1]),p(g(m(K,M),-y[1]),g(m(N,v),C[1]))),x[2]),g(p(g(m(U,D),f[1]),p(g(m(O,P),-y[1]),g(m(N,v),x[1]))),-C[2]))))),ue=p(p(p(g(p(g(m(ie,se),x[1]),p(g(m(te,Y),-C[1]),g(m(ee,j),b[1]))),f[2]),g(p(g(m(ie,se),f[1]),p(g(m(re,B),-C[1]),g(m(K,M),b[1]))),-x[2])),p(g(p(g(m(te,Y),f[1]),p(g(m(re,B),-x[1]),g(m(O,P),b[1]))),C[2]),g(p(g(m(ee,j),f[1]),p(g(m(K,M),-x[1]),g(m(O,P),C[1]))),-b[2]))),p(p(g(p(g(m(te,Y),y[1]),p(g(m(Z,H),-x[1]),g(m(U,D),b[1]))),f[2]),g(p(g(m(te,Y),f[1]),p(g(m(re,B),-x[1]),g(m(O,P),b[1]))),-y[2])),p(g(p(g(m(Z,H),f[1]),p(g(m(re,B),-y[1]),g(m(N,v),b[1]))),x[2]),g(p(g(m(U,D),f[1]),p(g(m(O,P),-y[1]),g(m(N,v),x[1]))),-b[2])))),de=m(ce,ue);return de[de.length-1]}}function h(p,m,A,g){return function(f,y,x,C,b,I){var v=p(p(A(f[0],f[0]),A(f[1],f[1])),p(A(f[2],f[2]),A(f[3],f[3]))),P=g(v,y[0]),M=g(v,x[0]),B=g(v,C[0]),T=g(v,b[0]),N=g(v,I[0]),D=p(p(A(y[0],y[0]),A(y[1],y[1])),p(A(y[2],y[2]),A(y[3],y[3]))),L=g(D,f[0]),H=g(D,x[0]),V=g(D,C[0]),O=g(D,b[0]),U=g(D,I[0]),j=p(p(A(x[0],x[0]),A(x[1],x[1])),p(A(x[2],x[2]),A(x[3],x[3]))),Y=g(j,f[0]),X=g(j,y[0]),K=g(j,C[0]),J=g(j,b[0]),ee=g(j,I[0]),se=p(p(A(C[0],C[0]),A(C[1],C[1])),p(A(C[2],C[2]),A(C[3],C[3]))),ne=g(se,f[0]),re=g(se,y[0]),Z=g(se,x[0]),te=g(se,b[0]),ie=g(se,I[0]),ce=p(p(A(b[0],b[0]),A(b[1],b[1])),p(A(b[2],b[2]),A(b[3],b[3]))),ue=g(ce,f[0]),de=g(ce,y[0]),me=g(ce,x[0]),ge=g(ce,C[0]),xe=g(ce,I[0]),Ee=p(p(A(I[0],I[0]),A(I[1],I[1])),p(A(I[2],I[2]),A(I[3],I[3]))),Re=g(Ee,f[0]),Me=g(Ee,y[0]),_e=g(Ee,x[0]),ye=g(Ee,C[0]),Se=g(Ee,b[0]),Ne=p(p(p(g(p(p(g(p(g(m(Se,xe),C[1]),p(g(m(ye,ie),-b[1]),g(m(ge,te),I[1]))),x[2]),g(p(g(m(Se,xe),x[1]),p(g(m(_e,ee),-b[1]),g(m(me,J),I[1]))),-C[2])),p(g(p(g(m(ye,ie),x[1]),p(g(m(_e,ee),-C[1]),g(m(Z,K),I[1]))),b[2]),g(p(g(m(ge,te),x[1]),p(g(m(me,J),-C[1]),g(m(Z,K),b[1]))),-I[2]))),y[3]),p(g(p(p(g(p(g(m(Se,xe),C[1]),p(g(m(ye,ie),-b[1]),g(m(ge,te),I[1]))),y[2]),g(p(g(m(Se,xe),y[1]),p(g(m(Me,U),-b[1]),g(m(de,O),I[1]))),-C[2])),p(g(p(g(m(ye,ie),y[1]),p(g(m(Me,U),-C[1]),g(m(re,V),I[1]))),b[2]),g(p(g(m(ge,te),y[1]),p(g(m(de,O),-C[1]),g(m(re,V),b[1]))),-I[2]))),-x[3]),g(p(p(g(p(g(m(Se,xe),x[1]),p(g(m(_e,ee),-b[1]),g(m(me,J),I[1]))),y[2]),g(p(g(m(Se,xe),y[1]),p(g(m(Me,U),-b[1]),g(m(de,O),I[1]))),-x[2])),p(g(p(g(m(_e,ee),y[1]),p(g(m(Me,U),-x[1]),g(m(X,H),I[1]))),b[2]),g(p(g(m(me,J),y[1]),p(g(m(de,O),-x[1]),g(m(X,H),b[1]))),-I[2]))),C[3]))),p(p(g(p(p(g(p(g(m(ye,ie),x[1]),p(g(m(_e,ee),-C[1]),g(m(Z,K),I[1]))),y[2]),g(p(g(m(ye,ie),y[1]),p(g(m(Me,U),-C[1]),g(m(re,V),I[1]))),-x[2])),p(g(p(g(m(_e,ee),y[1]),p(g(m(Me,U),-x[1]),g(m(X,H),I[1]))),C[2]),g(p(g(m(Z,K),y[1]),p(g(m(re,V),-x[1]),g(m(X,H),C[1]))),-I[2]))),-b[3]),g(p(p(g(p(g(m(ge,te),x[1]),p(g(m(me,J),-C[1]),g(m(Z,K),b[1]))),y[2]),g(p(g(m(ge,te),y[1]),p(g(m(de,O),-C[1]),g(m(re,V),b[1]))),-x[2])),p(g(p(g(m(me,J),y[1]),p(g(m(de,O),-x[1]),g(m(X,H),b[1]))),C[2]),g(p(g(m(Z,K),y[1]),p(g(m(re,V),-x[1]),g(m(X,H),C[1]))),-b[2]))),I[3])),p(g(p(p(g(p(g(m(Se,xe),C[1]),p(g(m(ye,ie),-b[1]),g(m(ge,te),I[1]))),y[2]),g(p(g(m(Se,xe),y[1]),p(g(m(Me,U),-b[1]),g(m(de,O),I[1]))),-C[2])),p(g(p(g(m(ye,ie),y[1]),p(g(m(Me,U),-C[1]),g(m(re,V),I[1]))),b[2]),g(p(g(m(ge,te),y[1]),p(g(m(de,O),-C[1]),g(m(re,V),b[1]))),-I[2]))),f[3]),g(p(p(g(p(g(m(Se,xe),C[1]),p(g(m(ye,ie),-b[1]),g(m(ge,te),I[1]))),f[2]),g(p(g(m(Se,xe),f[1]),p(g(m(Re,N),-b[1]),g(m(ue,T),I[1]))),-C[2])),p(g(p(g(m(ye,ie),f[1]),p(g(m(Re,N),-C[1]),g(m(ne,B),I[1]))),b[2]),g(p(g(m(ge,te),f[1]),p(g(m(ue,T),-C[1]),g(m(ne,B),b[1]))),-I[2]))),-y[3])))),p(p(p(g(p(p(g(p(g(m(Se,xe),y[1]),p(g(m(Me,U),-b[1]),g(m(de,O),I[1]))),f[2]),g(p(g(m(Se,xe),f[1]),p(g(m(Re,N),-b[1]),g(m(ue,T),I[1]))),-y[2])),p(g(p(g(m(Me,U),f[1]),p(g(m(Re,N),-y[1]),g(m(L,P),I[1]))),b[2]),g(p(g(m(de,O),f[1]),p(g(m(ue,T),-y[1]),g(m(L,P),b[1]))),-I[2]))),C[3]),g(p(p(g(p(g(m(ye,ie),y[1]),p(g(m(Me,U),-C[1]),g(m(re,V),I[1]))),f[2]),g(p(g(m(ye,ie),f[1]),p(g(m(Re,N),-C[1]),g(m(ne,B),I[1]))),-y[2])),p(g(p(g(m(Me,U),f[1]),p(g(m(Re,N),-y[1]),g(m(L,P),I[1]))),C[2]),g(p(g(m(re,V),f[1]),p(g(m(ne,B),-y[1]),g(m(L,P),C[1]))),-I[2]))),-b[3])),p(g(p(p(g(p(g(m(ge,te),y[1]),p(g(m(de,O),-C[1]),g(m(re,V),b[1]))),f[2]),g(p(g(m(ge,te),f[1]),p(g(m(ue,T),-C[1]),g(m(ne,B),b[1]))),-y[2])),p(g(p(g(m(de,O),f[1]),p(g(m(ue,T),-y[1]),g(m(L,P),b[1]))),C[2]),g(p(g(m(re,V),f[1]),p(g(m(ne,B),-y[1]),g(m(L,P),C[1]))),-b[2]))),I[3]),g(p(p(g(p(g(m(ye,ie),x[1]),p(g(m(_e,ee),-C[1]),g(m(Z,K),I[1]))),y[2]),g(p(g(m(ye,ie),y[1]),p(g(m(Me,U),-C[1]),g(m(re,V),I[1]))),-x[2])),p(g(p(g(m(_e,ee),y[1]),p(g(m(Me,U),-x[1]),g(m(X,H),I[1]))),C[2]),g(p(g(m(Z,K),y[1]),p(g(m(re,V),-x[1]),g(m(X,H),C[1]))),-I[2]))),f[3]))),p(p(g(p(p(g(p(g(m(ye,ie),x[1]),p(g(m(_e,ee),-C[1]),g(m(Z,K),I[1]))),f[2]),g(p(g(m(ye,ie),f[1]),p(g(m(Re,N),-C[1]),g(m(ne,B),I[1]))),-x[2])),p(g(p(g(m(_e,ee),f[1]),p(g(m(Re,N),-x[1]),g(m(Y,M),I[1]))),C[2]),g(p(g(m(Z,K),f[1]),p(g(m(ne,B),-x[1]),g(m(Y,M),C[1]))),-I[2]))),-y[3]),g(p(p(g(p(g(m(ye,ie),y[1]),p(g(m(Me,U),-C[1]),g(m(re,V),I[1]))),f[2]),g(p(g(m(ye,ie),f[1]),p(g(m(Re,N),-C[1]),g(m(ne,B),I[1]))),-y[2])),p(g(p(g(m(Me,U),f[1]),p(g(m(Re,N),-y[1]),g(m(L,P),I[1]))),C[2]),g(p(g(m(re,V),f[1]),p(g(m(ne,B),-y[1]),g(m(L,P),C[1]))),-I[2]))),x[3])),p(g(p(p(g(p(g(m(_e,ee),y[1]),p(g(m(Me,U),-x[1]),g(m(X,H),I[1]))),f[2]),g(p(g(m(_e,ee),f[1]),p(g(m(Re,N),-x[1]),g(m(Y,M),I[1]))),-y[2])),p(g(p(g(m(Me,U),f[1]),p(g(m(Re,N),-y[1]),g(m(L,P),I[1]))),x[2]),g(p(g(m(X,H),f[1]),p(g(m(Y,M),-y[1]),g(m(L,P),x[1]))),-I[2]))),-C[3]),g(p(p(g(p(g(m(Z,K),y[1]),p(g(m(re,V),-x[1]),g(m(X,H),C[1]))),f[2]),g(p(g(m(Z,K),f[1]),p(g(m(ne,B),-x[1]),g(m(Y,M),C[1]))),-y[2])),p(g(p(g(m(re,V),f[1]),p(g(m(ne,B),-y[1]),g(m(L,P),C[1]))),x[2]),g(p(g(m(X,H),f[1]),p(g(m(Y,M),-y[1]),g(m(L,P),x[1]))),-C[2]))),I[3]))))),Le=p(p(p(g(p(p(g(p(g(m(Se,xe),C[1]),p(g(m(ye,ie),-b[1]),g(m(ge,te),I[1]))),x[2]),g(p(g(m(Se,xe),x[1]),p(g(m(_e,ee),-b[1]),g(m(me,J),I[1]))),-C[2])),p(g(p(g(m(ye,ie),x[1]),p(g(m(_e,ee),-C[1]),g(m(Z,K),I[1]))),b[2]),g(p(g(m(ge,te),x[1]),p(g(m(me,J),-C[1]),g(m(Z,K),b[1]))),-I[2]))),f[3]),p(g(p(p(g(p(g(m(Se,xe),C[1]),p(g(m(ye,ie),-b[1]),g(m(ge,te),I[1]))),f[2]),g(p(g(m(Se,xe),f[1]),p(g(m(Re,N),-b[1]),g(m(ue,T),I[1]))),-C[2])),p(g(p(g(m(ye,ie),f[1]),p(g(m(Re,N),-C[1]),g(m(ne,B),I[1]))),b[2]),g(p(g(m(ge,te),f[1]),p(g(m(ue,T),-C[1]),g(m(ne,B),b[1]))),-I[2]))),-x[3]),g(p(p(g(p(g(m(Se,xe),x[1]),p(g(m(_e,ee),-b[1]),g(m(me,J),I[1]))),f[2]),g(p(g(m(Se,xe),f[1]),p(g(m(Re,N),-b[1]),g(m(ue,T),I[1]))),-x[2])),p(g(p(g(m(_e,ee),f[1]),p(g(m(Re,N),-x[1]),g(m(Y,M),I[1]))),b[2]),g(p(g(m(me,J),f[1]),p(g(m(ue,T),-x[1]),g(m(Y,M),b[1]))),-I[2]))),C[3]))),p(p(g(p(p(g(p(g(m(ye,ie),x[1]),p(g(m(_e,ee),-C[1]),g(m(Z,K),I[1]))),f[2]),g(p(g(m(ye,ie),f[1]),p(g(m(Re,N),-C[1]),g(m(ne,B),I[1]))),-x[2])),p(g(p(g(m(_e,ee),f[1]),p(g(m(Re,N),-x[1]),g(m(Y,M),I[1]))),C[2]),g(p(g(m(Z,K),f[1]),p(g(m(ne,B),-x[1]),g(m(Y,M),C[1]))),-I[2]))),-b[3]),g(p(p(g(p(g(m(ge,te),x[1]),p(g(m(me,J),-C[1]),g(m(Z,K),b[1]))),f[2]),g(p(g(m(ge,te),f[1]),p(g(m(ue,T),-C[1]),g(m(ne,B),b[1]))),-x[2])),p(g(p(g(m(me,J),f[1]),p(g(m(ue,T),-x[1]),g(m(Y,M),b[1]))),C[2]),g(p(g(m(Z,K),f[1]),p(g(m(ne,B),-x[1]),g(m(Y,M),C[1]))),-b[2]))),I[3])),p(g(p(p(g(p(g(m(Se,xe),x[1]),p(g(m(_e,ee),-b[1]),g(m(me,J),I[1]))),y[2]),g(p(g(m(Se,xe),y[1]),p(g(m(Me,U),-b[1]),g(m(de,O),I[1]))),-x[2])),p(g(p(g(m(_e,ee),y[1]),p(g(m(Me,U),-x[1]),g(m(X,H),I[1]))),b[2]),g(p(g(m(me,J),y[1]),p(g(m(de,O),-x[1]),g(m(X,H),b[1]))),-I[2]))),f[3]),g(p(p(g(p(g(m(Se,xe),x[1]),p(g(m(_e,ee),-b[1]),g(m(me,J),I[1]))),f[2]),g(p(g(m(Se,xe),f[1]),p(g(m(Re,N),-b[1]),g(m(ue,T),I[1]))),-x[2])),p(g(p(g(m(_e,ee),f[1]),p(g(m(Re,N),-x[1]),g(m(Y,M),I[1]))),b[2]),g(p(g(m(me,J),f[1]),p(g(m(ue,T),-x[1]),g(m(Y,M),b[1]))),-I[2]))),-y[3])))),p(p(p(g(p(p(g(p(g(m(Se,xe),y[1]),p(g(m(Me,U),-b[1]),g(m(de,O),I[1]))),f[2]),g(p(g(m(Se,xe),f[1]),p(g(m(Re,N),-b[1]),g(m(ue,T),I[1]))),-y[2])),p(g(p(g(m(Me,U),f[1]),p(g(m(Re,N),-y[1]),g(m(L,P),I[1]))),b[2]),g(p(g(m(de,O),f[1]),p(g(m(ue,T),-y[1]),g(m(L,P),b[1]))),-I[2]))),x[3]),g(p(p(g(p(g(m(_e,ee),y[1]),p(g(m(Me,U),-x[1]),g(m(X,H),I[1]))),f[2]),g(p(g(m(_e,ee),f[1]),p(g(m(Re,N),-x[1]),g(m(Y,M),I[1]))),-y[2])),p(g(p(g(m(Me,U),f[1]),p(g(m(Re,N),-y[1]),g(m(L,P),I[1]))),x[2]),g(p(g(m(X,H),f[1]),p(g(m(Y,M),-y[1]),g(m(L,P),x[1]))),-I[2]))),-b[3])),p(g(p(p(g(p(g(m(me,J),y[1]),p(g(m(de,O),-x[1]),g(m(X,H),b[1]))),f[2]),g(p(g(m(me,J),f[1]),p(g(m(ue,T),-x[1]),g(m(Y,M),b[1]))),-y[2])),p(g(p(g(m(de,O),f[1]),p(g(m(ue,T),-y[1]),g(m(L,P),b[1]))),x[2]),g(p(g(m(X,H),f[1]),p(g(m(Y,M),-y[1]),g(m(L,P),x[1]))),-b[2]))),I[3]),g(p(p(g(p(g(m(ge,te),x[1]),p(g(m(me,J),-C[1]),g(m(Z,K),b[1]))),y[2]),g(p(g(m(ge,te),y[1]),p(g(m(de,O),-C[1]),g(m(re,V),b[1]))),-x[2])),p(g(p(g(m(me,J),y[1]),p(g(m(de,O),-x[1]),g(m(X,H),b[1]))),C[2]),g(p(g(m(Z,K),y[1]),p(g(m(re,V),-x[1]),g(m(X,H),C[1]))),-b[2]))),f[3]))),p(p(g(p(p(g(p(g(m(ge,te),x[1]),p(g(m(me,J),-C[1]),g(m(Z,K),b[1]))),f[2]),g(p(g(m(ge,te),f[1]),p(g(m(ue,T),-C[1]),g(m(ne,B),b[1]))),-x[2])),p(g(p(g(m(me,J),f[1]),p(g(m(ue,T),-x[1]),g(m(Y,M),b[1]))),C[2]),g(p(g(m(Z,K),f[1]),p(g(m(ne,B),-x[1]),g(m(Y,M),C[1]))),-b[2]))),-y[3]),g(p(p(g(p(g(m(ge,te),y[1]),p(g(m(de,O),-C[1]),g(m(re,V),b[1]))),f[2]),g(p(g(m(ge,te),f[1]),p(g(m(ue,T),-C[1]),g(m(ne,B),b[1]))),-y[2])),p(g(p(g(m(de,O),f[1]),p(g(m(ue,T),-y[1]),g(m(L,P),b[1]))),C[2]),g(p(g(m(re,V),f[1]),p(g(m(ne,B),-y[1]),g(m(L,P),C[1]))),-b[2]))),x[3])),p(g(p(p(g(p(g(m(me,J),y[1]),p(g(m(de,O),-x[1]),g(m(X,H),b[1]))),f[2]),g(p(g(m(me,J),f[1]),p(g(m(ue,T),-x[1]),g(m(Y,M),b[1]))),-y[2])),p(g(p(g(m(de,O),f[1]),p(g(m(ue,T),-y[1]),g(m(L,P),b[1]))),x[2]),g(p(g(m(X,H),f[1]),p(g(m(Y,M),-y[1]),g(m(L,P),x[1]))),-b[2]))),-C[3]),g(p(p(g(p(g(m(Z,K),y[1]),p(g(m(re,V),-x[1]),g(m(X,H),C[1]))),f[2]),g(p(g(m(Z,K),f[1]),p(g(m(ne,B),-x[1]),g(m(Y,M),C[1]))),-y[2])),p(g(p(g(m(re,V),f[1]),p(g(m(ne,B),-y[1]),g(m(L,P),C[1]))),x[2]),g(p(g(m(X,H),f[1]),p(g(m(Y,M),-y[1]),g(m(L,P),x[1]))),-C[2]))),b[3]))))),nt=m(Ne,Le);return nt[nt.length-1]}}var d=[function(){return 0},function(){return 0},function(){return 0}];function u(p){var m=d[p.length];return m||(m=d[p.length]=s(p.length)),m.apply(void 0,p)}function _(p,m,A,g,f,y,x,C){return function(b,I,v,P,M,B){switch(arguments.length){case 0:case 1:return 0;case 2:return g(b,I);case 3:return f(b,I,v);case 4:return y(b,I,v,P);case 5:return x(b,I,v,P,M);case 6:return C(b,I,v,P,M,B)}for(var T=Array(arguments.length),N=0;N<arguments.length;++N)T[N]=arguments[N];return p(T)}}(function(){for(;d.length<=6;)d.push(s(d.length));t.exports=_.apply(void 0,[u].concat(d));for(var p=0;p<=6;++p)t.exports[p]=d[p]})()}}),Tpr=Am({"node_modules/cdt2d/lib/delaunay.js"(e,t){var n=Bpr()[4];Bbe();function o(r,i,s,a,c,l){var h=i.opposite(a,c);if(!(h<0)){if(c<a){var d=a;a=c,c=d,d=l,l=h,h=d}i.isConstraint(a,c)||n(r[a],r[c],r[l],r[h])<0&&s.push(a,c)}}t.exports=function(r,i){for(var s=[],a=r.length,c=i.stars,l=0;l<a;++l)for(var h=c[l],d=1;d<h.length;d+=2)if(!((m=h[d])<l)&&!i.isConstraint(l,m)){for(var u=h[d-1],_=-1,p=1;p<h.length;p+=2)if(h[p-1]===m){_=h[p];break}_<0||n(r[l],r[m],r[u],r[_])<0&&s.push(l,m)}for(;s.length>0;){for(var m=s.pop(),A=(u=-1,_=-1,h=c[l=s.pop()],1);A<h.length;A+=2){var g=h[A-1],f=h[A];g===m?_=f:f===m&&(u=g)}u<0||_<0||(n(r[l],r[m],r[u],r[_])>=0||(i.flip(l,m),o(r,i,s,u,l,_),o(r,i,s,l,_,u),o(r,i,s,_,m,u),o(r,i,s,m,u,_)))}}}}),Dpr=Am({"node_modules/cdt2d/lib/filter.js"(e,t){var n=Bbe();function o(i,s,a,c,l,h,d){this.cells=i,this.neighbor=s,this.flags=c,this.constraint=a,this.active=l,this.next=h,this.boundary=d}function r(i,s){return i[0]-s[0]||i[1]-s[1]||i[2]-s[2]}t.exports=function(i,s,a){var c=function(C,b){for(var I=C.cells(),v=I.length,P=0;P<v;++P){var M=(j=I[P])[0],B=j[1],T=j[2];B<T?B<M&&(j[0]=B,j[1]=T,j[2]=M):T<M&&(j[0]=T,j[1]=M,j[2]=B)}I.sort(r);var N=Array(v);for(P=0;P<N.length;++P)N[P]=0;var D=[],L=[],H=Array(3*v),V=Array(3*v),O=null;b&&(O=[]);var U=new o(I,H,V,N,D,L,O);for(P=0;P<v;++P)for(var j=I[P],Y=0;Y<3;++Y){M=j[Y],B=j[(Y+1)%3];var X=H[3*P+Y]=U.locate(B,M,C.opposite(B,M)),K=V[3*P+Y]=C.isConstraint(M,B);X<0&&(K?L.push(P):(D.push(P),N[P]=1),b&&O.push([B,M,-1]))}return U}(i,a);if(s===0)return a?c.cells.concat(c.boundary):c.cells;var l=1,{active:h,next:d,flags:u,cells:_,constraint:p,neighbor:m}=c;for(;h.length>0||d.length>0;){for(;h.length>0;){var A=h.pop();if(u[A]!==-l){u[A]=l,_[A];for(var g=0;g<3;++g){var f=m[3*A+g];f>=0&&u[f]===0&&(p[3*A+g]?d.push(f):(h.push(f),u[f]=l))}}}var y=d;d=h,h=y,d.length=0,l=-l}var x=function(C,b,I){for(var v=0,P=0;P<C.length;++P)b[P]===I&&(C[v++]=C[P]);return C.length=v,C}(_,u,s);if(a)return x.concat(c.boundary);return x},o.prototype.locate=function(){var i=[0,0,0];return function(s,a,c){var l=s,h=a,d=c;return a<c?a<s&&(l=a,h=c,d=s):c<s&&(l=c,h=s,d=a),l<0?-1:(i[0]=l,i[1]=h,i[2]=d,n.eq(this.cells,i,r))}}()}}),Npr=Am({"node_modules/cdt2d/cdt2d.js"(e,t){var n=Mpr(),o=wpr(),r=Tpr(),i=Dpr();function s(l){return[Math.min(l[0],l[1]),Math.max(l[0],l[1])]}function a(l,h){return l[0]-h[0]||l[1]-h[1]}function c(l,h,d){return h in l?l[h]:d}t.exports=function(l,h,d){Array.isArray(h)?(d=d||{},h=h||[]):(d=h||{},h=[]);var u=!!c(d,"delaunay",!0),_=!!c(d,"interior",!0),p=!!c(d,"exterior",!0),m=!!c(d,"infinity",!1);if(!_&&!p||l.length===0)return[];var A=n(l,h);if(u||_!==p||m){for(var g=o(l.length,function(x){return x.map(s).sort(a)}(h)),f=0;f<A.length;++f){var y=A[f];g.addTriangle(y[0],y[1],y[2])}return u&&r(l,g),p?_?m?i(g,0,m):g.cells():i(g,1,m):i(g,-1)}return A}}});function mw(e,t){return Array.isArray(t)?[e.a*t[0]+e.c*t[1]+e.e,e.b*t[0]+e.d*t[1]+e.f]:{x:e.a*t.x+e.c*t.y+e.e,y:e.b*t.x+e.d*t.y+e.f}}function KWt(e,t){return t.map((n)=>mw(e,n))}function $Wt(e){let{a:t,b:n,c:o,d:r,e:i,f:s}=e,a=t*r-n*o;return{a:r/a,b:n/-a,c:o/-a,d:t/a,e:(r*i-o*s)/-a,f:(n*i-t*s)/a}}function JHt(e){return e===void 0}function $O(e,t=0){return{a:1,c:0,e,b:0,d:1,f:t}}function h$e(...e){let t=(n,o)=>({a:n.a*o.a+n.c*o.b,c:n.a*o.c+n.c*o.d,e:n.a*o.e+n.c*o.f+n.e,b:n.b*o.a+n.d*o.b,d:n.b*o.c+n.d*o.d,f:n.b*o.e+n.d*o.f+n.f});switch((e=Array.isArray(e[0])?e[0]:e).length){case 0:throw Error("no matrices provided");case 1:return e[0];case 2:return t(e[0],e[1]);default:{let[n,o,...r]=e;return h$e(t(n,o),...r)}}}function d$e(...e){return h$e(...e)}var{cos:Rpr,sin:Qpr,PI:kpr}=Math;function qWt(e,t,n){let o=Rpr(e),r=Qpr(e),i={a:o,c:-r,e:0,b:r,d:o,f:0};return JHt(t)||JHt(n)?i:h$e([$O(t,n),i,$O(-t,-n)])}function JWt(e,t=void 0,n=void 0){return qWt(e*kpr/180,t,n)}var{tan:PNs}=Math,Lpr=(qXe(Cpr()),qXe(Spr()),(()=>{let e=new Uint8Array(4);new Uint32Array(e.buffer)[0]=1,e[0]})(),globalThis.Int8Array,globalThis.Uint8Array,globalThis.Int16Array,globalThis.Uint16Array,globalThis.Int32Array,globalThis.Uint32Array,globalThis.BigUint64Array,globalThis.BigInt64Array,globalThis.Float32Array,globalThis.Float64Array,[]);for(let e=0;e<256;e++){let t=e;for(let n=0;n<8;n++)1&t?t=3988292384^t>>>1:t>>>=1;Lpr[e]=t}var Hpr=new Uint16Array([255]),Fpr=(new Uint8Array(Hpr.buffer)[0],new Uint16Array([255]));new Uint8Array(Fpr.buffer)[0],new Uint8Array(0),Uint8Array.of(137,80,78,71,13,10,26,10),new TextDecoder("latin1");function Fx(){return Fx=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)({}).hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},Fx.apply(null,arguments)}function ACe(e,t){return(ACe=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n})(e,t)}function ZWt(e){return(ZWt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(e)}function eXt(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(eXt=function(){return!!e})()}function JXe(e){var t=typeof Map=="function"?new Map:void 0;return JXe=function(n){if(n===null||!function(r){try{return Function.toString.call(r).indexOf("[native code]")!==-1}catch(i){return typeof r=="function"}}(n))return n;if(typeof n!="function")throw TypeError("Super expression must either be null or a function");if(t!==void 0){if(t.has(n))return t.get(n);t.set(n,o)}function o(){return function(r,i,s){if(eXt())return Reflect.construct.apply(null,arguments);var a=[null];a.push.apply(a,i);var c=new(r.bind.apply(r,a));return s&&ACe(c,s.prototype),c}(n,arguments,ZWt(this).constructor)}return o.prototype=Object.create(n.prototype,{constructor:{value:o,enumerable:!1,writable:!0,configurable:!0}}),ACe(o,n)},JXe(e)}var zpr={1:`Passed invalid arguments to hsl, please pass multiple numbers e.g. hsl(360, 0.75, 0.4) or an object e.g. rgb({ hue: 255, saturation: 0.4, lightness: 0.75 }).

`,2:`Passed invalid arguments to hsla, please pass multiple numbers e.g. hsla(360, 0.75, 0.4, 0.7) or an object e.g. rgb({ hue: 255, saturation: 0.4, lightness: 0.75, alpha: 0.7 }).

`,3:`Passed an incorrect argument to a color function, please pass a string representation of a color.

`,4:`Couldn't generate valid rgb string from %s, it returned %s.

`,5:`Couldn't parse the color string. Please provide the color as a string in hex, rgb, rgba, hsl or hsla notation.

`,6:`Passed invalid arguments to rgb, please pass multiple numbers e.g. rgb(255, 205, 100) or an object e.g. rgb({ red: 255, green: 205, blue: 100 }).

`,7:`Passed invalid arguments to rgba, please pass multiple numbers e.g. rgb(255, 205, 100, 0.75) or an object e.g. rgb({ red: 255, green: 205, blue: 100, alpha: 0.75 }).

`,8:`Passed invalid argument to toColorString, please pass a RgbColor, RgbaColor, HslColor or HslaColor object.

`,9:`Please provide a number of steps to the modularScale helper.

`,10:`Please pass a number or one of the predefined scales to the modularScale helper as the ratio.

`,11:`Invalid value passed as base to modularScale, expected number or em string but got "%s"

`,12:`Expected a string ending in "px" or a number passed as the first argument to %s(), got "%s" instead.

`,13:`Expected a string ending in "px" or a number passed as the second argument to %s(), got "%s" instead.

`,14:`Passed invalid pixel value ("%s") to %s(), please pass a value like "12px" or 12.

`,15:`Passed invalid base value ("%s") to %s(), please pass a value like "12px" or 12.

`,16:`You must provide a template to this method.

`,17:`You passed an unsupported selector state to this method.

`,18:`minScreen and maxScreen must be provided as stringified numbers with the same units.

`,19:`fromSize and toSize must be provided as stringified numbers with the same units.

`,20:`expects either an array of objects or a single object with the properties prop, fromSize, and toSize.

`,21:"expects the objects in the first argument array to have the properties `prop`, `fromSize`, and `toSize`.\n\n",22:"expects the first argument object to have the properties `prop`, `fromSize`, and `toSize`.\n\n",23:`fontFace expects a name of a font-family.

`,24:`fontFace expects either the path to the font file(s) or a name of a local copy.

`,25:`fontFace expects localFonts to be an array.

`,26:`fontFace expects fileFormats to be an array.

`,27:`radialGradient requries at least 2 color-stops to properly render.

`,28:`Please supply a filename to retinaImage() as the first argument.

`,29:`Passed invalid argument to triangle, please pass correct pointingDirection e.g. 'right'.

`,30:"Passed an invalid value to `height` or `width`. Please provide a pixel based unit.\n\n",31:`The animation shorthand only takes 8 arguments. See the specification for more information: http://mdn.io/animation

`,32:`To pass multiple animations please supply them in arrays, e.g. animation(['rotate', '2s'], ['move', '1s'])
To pass a single animation please supply them in simple values, e.g. animation('rotate', '2s')

`,33:`The animation shorthand arrays can only have 8 elements. See the specification for more information: http://mdn.io/animation

`,34:`borderRadius expects a radius value as a string or number as the second argument.

`,35:`borderRadius expects one of "top", "bottom", "left" or "right" as the first argument.

`,36:`Property must be a string value.

`,37:`Syntax Error at %s.

`,38:`Formula contains a function that needs parentheses at %s.

`,39:`Formula is missing closing parenthesis at %s.

`,40:`Formula has too many closing parentheses at %s.

`,41:`All values in a formula must have the same unit or be unitless.

`,42:`Please provide a number of steps to the modularScale helper.

`,43:`Please pass a number or one of the predefined scales to the modularScale helper as the ratio.

`,44:`Invalid value passed as base to modularScale, expected number or em/rem string but got %s.

`,45:`Passed invalid argument to hslToColorString, please pass a HslColor or HslaColor object.

`,46:`Passed invalid argument to rgbToColorString, please pass a RgbColor or RgbaColor object.

`,47:`minScreen and maxScreen must be provided as stringified numbers with the same units.

`,48:`fromSize and toSize must be provided as stringified numbers with the same units.

`,49:`Expects either an array of objects or a single object with the properties prop, fromSize, and toSize.

`,50:`Expects the objects in the first argument array to have the properties prop, fromSize, and toSize.

`,51:`Expects the first argument object to have the properties prop, fromSize, and toSize.

`,52:`fontFace expects either the path to the font file(s) or a name of a local copy.

`,53:`fontFace expects localFonts to be an array.

`,54:`fontFace expects fileFormats to be an array.

`,55:`fontFace expects a name of a font-family.

`,56:`linearGradient requries at least 2 color-stops to properly render.

`,57:`radialGradient requries at least 2 color-stops to properly render.

`,58:`Please supply a filename to retinaImage() as the first argument.

`,59:`Passed invalid argument to triangle, please pass correct pointingDirection e.g. 'right'.

`,60:"Passed an invalid value to `height` or `width`. Please provide a pixel based unit.\n\n",61:`Property must be a string value.

`,62:`borderRadius expects a radius value as a string or number as the second argument.

`,63:`borderRadius expects one of "top", "bottom", "left" or "right" as the first argument.

`,64:`The animation shorthand only takes 8 arguments. See the specification for more information: http://mdn.io/animation.

`,65:`To pass multiple animations please supply them in arrays, e.g. animation(['rotate', '2s'], ['move', '1s'])\\nTo pass a single animation please supply them in simple values, e.g. animation('rotate', '2s').

`,66:`The animation shorthand arrays can only have 8 elements. See the specification for more information: http://mdn.io/animation.

`,67:`You must provide a template to this method.

`,68:`You passed an unsupported selector state to this method.

`,69:`Expected a string ending in "px" or a number passed as the first argument to %s(), got %s instead.

`,70:`Expected a string ending in "px" or a number passed as the second argument to %s(), got %s instead.

`,71:`Passed invalid pixel value %s to %s(), please pass a value like "12px" or 12.

`,72:`Passed invalid base value %s to %s(), please pass a value like "12px" or 12.

`,73:`Please provide a valid CSS variable.

`,74:`CSS variable not found and no default was provided.

`,75:`important requires a valid style object, got a %s instead.

`,76:`fromSize and toSize must be provided as stringified numbers with the same units as minScreen and maxScreen.

`,77:`remToPx expects a value in "rem" but you provided it in "%s".

`,78:`base must be set in "px" or "%" but you set it in "%s".
`};function Opr(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];var o,r=t[0],i=[];for(o=1;o<t.length;o+=1)i.push(t[o]);return i.forEach(function(s){r=r.replace(/%[a-z]/,s)}),r}var kx=function(e){var t,n;function o(r){var i;for(var s=arguments.length,a=Array(s>1?s-1:0),c=1;c<s;c++)a[c-1]=arguments[c];return i=e.call(this,Opr.apply(void 0,[zpr[r]].concat(a)))||this,function(l){if(l===void 0)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return l}(i)}return n=e,(t=o).prototype=Object.create(n.prototype),t.prototype.constructor=t,ACe(t,n),o}(JXe(Error));function ZHt(e,t){return e.substr(-t.length)===t}var Vpr=/^([+-]?(?:\d+|\d*\.\d+))([a-z]*|%)$/;function eFt(e){return typeof e!="string"?e:e.match(Vpr)?parseFloat(e):e}var tFt=function(e){return function(t,n){n===void 0&&(n="16px");var o=t,r=n;if(typeof t=="string"){if(!ZHt(t,"px"))throw new kx(69,e,t);o=eFt(t)}if(typeof n=="string"){if(!ZHt(n,"px"))throw new kx(70,e,n);r=eFt(n)}if(typeof o=="string")throw new kx(71,t,e);if(typeof r=="string")throw new kx(72,n,e);return""+o/r+e}};tFt("em"),tFt("rem");function GUe(e){return Math.round(255*e)}function Ypr(e,t,n){return GUe(e)+","+GUe(t)+","+GUe(n)}function Dce(e,t,n,o){if(o===void 0&&(o=Ypr),t===0)return o(n,n,n);var r=(e%360+360)%360/60,i=(1-Math.abs(2*n-1))*t,s=i*(1-Math.abs(r%2-1)),a=0,c=0,l=0;r>=0&&r<1?(a=i,c=s):r>=1&&r<2?(a=s,c=i):r>=2&&r<3?(c=i,l=s):r>=3&&r<4?(c=s,l=i):r>=4&&r<5?(a=s,l=i):r>=5&&r<6&&(a=i,l=s);var h=n-i/2;return o(a+h,c+h,l+h)}var nFt={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"00ffff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"0000ff",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"00ffff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"ff00ff",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"639",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},Gpr=/^#[a-fA-F0-9]{6}$/,Upr=/^#[a-fA-F0-9]{8}$/,Wpr=/^#[a-fA-F0-9]{3}$/,Xpr=/^#[a-fA-F0-9]{4}$/,UUe=/^rgb\(\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*\)$/i,jpr=/^rgb(?:a)?\(\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,|\/)\s*([-+]?\d*[.]?\d+[%]?)\s*\)$/i,Kpr=/^hsl\(\s*(\d{0,3}[.]?[0-9]+(?:deg)?)\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*\)$/i,$pr=/^hsl(?:a)?\(\s*(\d{0,3}[.]?[0-9]+(?:deg)?)\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*(?:,|\/)\s*([-+]?\d*[.]?\d+[%]?)\s*\)$/i;function qO(e){if(typeof e!="string")throw new kx(3);var t=function(u){if(typeof u!="string")return u;var _=u.toLowerCase();return nFt[_]?"#"+nFt[_]:u}(e);if(t.match(Gpr))return{red:parseInt(""+t[1]+t[2],16),green:parseInt(""+t[3]+t[4],16),blue:parseInt(""+t[5]+t[6],16)};if(t.match(Upr)){var n=parseFloat((parseInt(""+t[7]+t[8],16)/255).toFixed(2));return{red:parseInt(""+t[1]+t[2],16),green:parseInt(""+t[3]+t[4],16),blue:parseInt(""+t[5]+t[6],16),alpha:n}}if(t.match(Wpr))return{red:parseInt(""+t[1]+t[1],16),green:parseInt(""+t[2]+t[2],16),blue:parseInt(""+t[3]+t[3],16)};if(t.match(Xpr)){var o=parseFloat((parseInt(""+t[4]+t[4],16)/255).toFixed(2));return{red:parseInt(""+t[1]+t[1],16),green:parseInt(""+t[2]+t[2],16),blue:parseInt(""+t[3]+t[3],16),alpha:o}}var r=UUe.exec(t);if(r)return{red:parseInt(""+r[1],10),green:parseInt(""+r[2],10),blue:parseInt(""+r[3],10)};var i=jpr.exec(t.substring(0,50));if(i)return{red:parseInt(""+i[1],10),green:parseInt(""+i[2],10),blue:parseInt(""+i[3],10),alpha:parseFloat(""+i[4])>1?parseFloat(""+i[4])/100:parseFloat(""+i[4])};var s=Kpr.exec(t);if(s){var a="rgb("+Dce(parseInt(""+s[1],10),parseInt(""+s[2],10)/100,parseInt(""+s[3],10)/100)+")",c=UUe.exec(a);if(!c)throw new kx(4,t,a);return{red:parseInt(""+c[1],10),green:parseInt(""+c[2],10),blue:parseInt(""+c[3],10)}}var l=$pr.exec(t.substring(0,50));if(l){var h="rgb("+Dce(parseInt(""+l[1],10),parseInt(""+l[2],10)/100,parseInt(""+l[3],10)/100)+")",d=UUe.exec(h);if(!d)throw new kx(4,t,h);return{red:parseInt(""+d[1],10),green:parseInt(""+d[2],10),blue:parseInt(""+d[3],10),alpha:parseFloat(""+l[4])>1?parseFloat(""+l[4])/100:parseFloat(""+l[4])}}throw new kx(5)}function IQ(e){return function(t){var n,o=t.red/255,r=t.green/255,i=t.blue/255,s=Math.max(o,r,i),a=Math.min(o,r,i),c=(s+a)/2;if(s===a)return t.alpha!==void 0?{hue:0,saturation:0,lightness:c,alpha:t.alpha}:{hue:0,saturation:0,lightness:c};var l=s-a,h=c>0.5?l/(2-s-a):l/(s+a);switch(s){case o:n=(r-i)/l+(r<i?6:0);break;case r:n=(i-o)/l+2;break;default:n=(o-r)/l+4}return n*=60,t.alpha!==void 0?{hue:n,saturation:h,lightness:c,alpha:t.alpha}:{hue:n,saturation:h,lightness:c}}(qO(e))}var ZXe=function(e){return e.length===7&&e[1]===e[2]&&e[3]===e[4]&&e[5]===e[6]?"#"+e[1]+e[3]+e[5]:e};function AO(e){var t=e.toString(16);return t.length===1?"0"+t:t}function WUe(e){return AO(Math.round(255*e))}function qpr(e,t,n){return ZXe("#"+WUe(e)+WUe(t)+WUe(n))}function S4e(e,t,n){return Dce(e,t,n,qpr)}function eje(e,t,n){if(typeof e=="number"&&typeof t=="number"&&typeof n=="number")return ZXe("#"+AO(e)+AO(t)+AO(n));if(typeof e=="object"&&t===void 0&&n===void 0)return ZXe("#"+AO(e.red)+AO(e.green)+AO(e.blue));throw new kx(6)}function Tbe(e,t,n,o){if(typeof e=="string"&&typeof t=="number"){var r=qO(e);return"rgba("+r.red+","+r.green+","+r.blue+","+t+")"}if(typeof e=="number"&&typeof t=="number"&&typeof n=="number"&&typeof o=="number")return o>=1?eje(e,t,n):"rgba("+e+","+t+","+n+","+o+")";if(typeof e=="object"&&t===void 0&&n===void 0&&o===void 0)return e.alpha>=1?eje(e.red,e.green,e.blue):"rgba("+e.red+","+e.green+","+e.blue+","+e.alpha+")";throw new kx(7)}function vQ(e){if(typeof e!="object")throw new kx(8);if(function(t){return typeof t.red=="number"&&typeof t.green=="number"&&typeof t.blue=="number"&&typeof t.alpha=="number"}(e))return Tbe(e);if(function(t){return typeof t.red=="number"&&typeof t.green=="number"&&typeof t.blue=="number"&&(typeof t.alpha!="number"||t.alpha===void 0)}(e))return eje(e);if(function(t){return typeof t.hue=="number"&&typeof t.saturation=="number"&&typeof t.lightness=="number"&&typeof t.alpha=="number"}(e))return function(t,n,o,r){if(typeof t=="number"&&typeof n=="number"&&typeof o=="number"&&typeof r=="number")return r>=1?S4e(t,n,o):"rgba("+Dce(t,n,o)+","+r+")";if(typeof t=="object"&&n===void 0&&o===void 0&&r===void 0)return t.alpha>=1?S4e(t.hue,t.saturation,t.lightness):"rgba("+Dce(t.hue,t.saturation,t.lightness)+","+t.alpha+")";throw new kx(2)}(e);if(function(t){return typeof t.hue=="number"&&typeof t.saturation=="number"&&typeof t.lightness=="number"&&(typeof t.alpha!="number"||t.alpha===void 0)}(e))return function(t,n,o){if(typeof t=="number"&&typeof n=="number"&&typeof o=="number")return S4e(t,n,o);if(typeof t=="object"&&n===void 0&&o===void 0)return S4e(t.hue,t.saturation,t.lightness);throw new kx(1)}(e);throw new kx(8)}function tXt(e,t,n){return function(){var o=n.concat(Array.prototype.slice.call(arguments));return o.length>=t?e.apply(this,o):tXt(e,t,o)}}function Y4(e){return tXt(e,e.length,[])}Y4(function(e,t){if(t==="transparent")return t;var n=IQ(t);return vQ(Fx({},n,{hue:n.hue+parseFloat(e)}))});function Mq(e,t,n){return Math.max(e,Math.min(t,n))}Y4(function(e,t){if(t==="transparent")return t;var n=IQ(t);return vQ(Fx({},n,{lightness:Mq(0,1,n.lightness-parseFloat(e))}))});Y4(function(e,t){if(t==="transparent")return t;var n=IQ(t);return vQ(Fx({},n,{saturation:Mq(0,1,n.saturation-parseFloat(e))}))});Y4(function(e,t){if(t==="transparent")return t;var n=IQ(t);return vQ(Fx({},n,{lightness:Mq(0,1,n.lightness+parseFloat(e))}))});var nXt=Y4(function(e,t,n){if(t==="transparent")return n;if(n==="transparent")return t;if(e===0)return n;var o=qO(t),r=Fx({},o,{alpha:typeof o.alpha=="number"?o.alpha:1}),i=qO(n),s=Fx({},i,{alpha:typeof i.alpha=="number"?i.alpha:1}),a=r.alpha-s.alpha,c=2*parseFloat(e)-1,l=((c*a===-1?c:c+a)/(1+c*a)+1)/2,h=1-l;return Tbe({red:Math.floor(r.red*l+s.red*h),green:Math.floor(r.green*l+s.green*h),blue:Math.floor(r.blue*l+s.blue*h),alpha:r.alpha*parseFloat(e)+s.alpha*(1-parseFloat(e))})});Y4(function(e,t){if(t==="transparent")return t;var n=qO(t);return Tbe(Fx({},n,{alpha:Mq(0,1,(100*(typeof n.alpha=="number"?n.alpha:1)+100*parseFloat(e))/100)}))});Y4(function(e,t){if(t==="transparent")return t;var n=IQ(t);return vQ(Fx({},n,{saturation:Mq(0,1,n.saturation+parseFloat(e))}))});Y4(function(e,t){return t==="transparent"?t:vQ(Fx({},IQ(t),{hue:parseFloat(e)}))});Y4(function(e,t){return t==="transparent"?t:vQ(Fx({},IQ(t),{lightness:parseFloat(e)}))});Y4(function(e,t){return t==="transparent"?t:vQ(Fx({},IQ(t),{saturation:parseFloat(e)}))});Y4(function(e,t){return t==="transparent"?t:nXt(parseFloat(e),"rgb(0, 0, 0)",t)});Y4(function(e,t){return t==="transparent"?t:nXt(parseFloat(e),"rgb(255, 255, 255)",t)});var d$=Y4(function(e,t){if(t==="transparent")return t;var n=qO(t);return Tbe(Fx({},n,{alpha:Mq(0,1,+(100*(typeof n.alpha=="number"?n.alpha:1)-100*parseFloat(e)).toFixed(2)/100)}))}),oFt={0:"M0.301025 0.257813 L0.206593 0.283385 L0.122042 0.361307 L0.075923 0.474441 L0.064942 0.642221 L0.091296 0.78289 L0.159376 0.899463 L0.257104 0.961214 L0.344948 0.961214 L0.442678 0.899463 L0.510757 0.78289 L0.537111 0.642221 L0.526131 0.474441 L0.480012 0.361307 L0.39546 0.283385 L0.301025 0.257813",1:"M0.220426 0.40845 L0.381626 0.270996 L0.381626 0.948966",2:"M0.110409 0.39212 L0.125621 0.342293 L0.170571 0.295823 L0.244237 0.26431 L0.291518 0.257813 L0.373319 0.263799 L0.434683 0.290705 L0.468239 0.331966 L0.480292 0.379913 L0.479492 0.411806 L0.465088 0.465192 L0.402571 0.568988 L0.245134 0.766438 L0.07959 0.948045 L0.522462 0.948045",3:"M0.081606 0.345073 L0.119154 0.315633 L0.178996 0.284091 L0.255265 0.257813 L0.349133 0.263062 L0.43127 0.289348 L0.48994 0.336662 L0.525141 0.394491 L0.513407 0.457577 L0.466472 0.504892 L0.384334 0.541692 L0.290464 0.56272 L0.20833 0.573235 L0.290464 0.583749 L0.384334 0.610035 L0.466472 0.652092 L0.519274 0.709922 L0.531007 0.773007 L0.50754 0.841351 L0.454738 0.899179 L0.3726 0.946494 L0.310412 0.961214 L0.209503 0.959111 L0.127367 0.946494 L0.071046 0.929671",4:"M0.418494 0.270996 L0.048828 0.724199 L0.553224 0.724199 M0.414181 0.578167 L0.414181 0.94897",5:"M0.074951 0.270996 L0.074951 0.614701 L0.267655 0.5695 L0.405247 0.586502 L0.460002 0.617189 L0.498028 0.660731 L0.527101 0.779401 L0.513352 0.841049 L0.477274 0.889568 L0.406378 0.93463 L0.324445 0.958337 L0.247399 0.962139 L0.182516 0.949767 L0.130068 0.925508 L0.074951 0.875607 M0.074951 0.270996 L0.527101 0.270996",6:"M0.428549 0.257813 L0.341433 0.285053 L0.26073 0.312099 L0.192188 0.360182 L0.138902 0.410969 L0.098219 0.500422 L0.070249 0.584267 L0.067264 0.670716 L0.065164 0.756863 L0.087163 0.820973 L0.108168 0.861042 L0.157916 0.913131 L0.210981 0.948192 L0.29279 0.961214 L0.384548 0.956206 L0.456409 0.924151 L0.507262 0.881077 L0.5349 0.821975 L0.537111 0.771889 L0.521634 0.718798 L0.498418 0.67372 L0.463042 0.636657 L0.414398 0.613617 L0.34696 0.598591 L0.28284 0.595587 L0.215403 0.605604 L0.145756 0.641665 L0.109274 0.678729 L0.064942 0.724006",7:"M0.071534 0.270996 L0.530519 0.270996 L0.495935 0.291702 L0.477752 0.305407 L0.435186 0.346112 L0.412067 0.374136 L0.388565 0.40796 L0.365315 0.448098 L0.342943 0.495062 L0.322081 0.549366 L0.303364 0.611524 L0.287416 0.68205 L0.270077 0.80465 L0.26253 0.94897",8:"M0.286761 0.257813 L0.210684 0.27162 L0.1414 0.305622 L0.092494 0.382125 L0.111513 0.450128 L0.16857 0.502193 L0.228345 0.539382 L0.377781 0.594635 L0.470161 0.645637 L0.52586 0.706203 L0.538087 0.792269 L0.506841 0.87621 L0.438915 0.927212 L0.339743 0.961214 L0.263666 0.959089 L0.174004 0.929337 L0.102003 0.881523 L0.063965 0.811395 L0.066682 0.741266 L0.102003 0.671139 L0.180797 0.608448 L0.259591 0.580822 L0.358762 0.548945 L0.456576 0.49688 L0.486463 0.446941 L0.487822 0.362999 L0.453859 0.302434 L0.384574 0.265245 L0.286761 0.257813",9:"M0.511026 0.437812 L0.491026 0.347812 L0.451026 0.297812 L0.391026 0.267812 L0.311026 0.257813 L0.231026 0.267812 L0.161026 0.297812 L0.111026 0.347812 L0.091026 0.417812 L0.111026 0.487812 L0.161026 0.537812 L0.231026 0.567812 L0.311026 0.577812 L0.391026 0.557812 L0.451026 0.517812 L0.491026 0.477812 L0.511026 0.437812 M0.510026 0.438812 L0.434026 0.636812 L0.381026 0.777812 L0.337026 0.879812 L0.301026 0.957812","!":"M0.301026 0.270996 L0.301026 0.749566 M0.251466 0.94897 L0.350587 0.94897",'"':"M0.16504 0.270996 L0.16504 0.523022 M0.437013 0.270996 L0.437013 0.523022","#":"M0.20958 0.282227 L0.146515 0.949754 M0.461844 0.282227 L0.398779 0.949754 M0.032999 0.526969 L0.600587 0.452796 M0.001465 0.82366 L0.569055 0.749486",$:"M0.307121 0.240234 L0.307121 1.083502 M0.490031 0.415915 L0.404676 0.328075 L0.23396 0.310507 L0.136407 0.398347 L0.099828 0.521324 L0.124213 0.591596 L0.197379 0.644299 L0.429061 0.697003 L0.502224 0.749708 L0.526613 0.837547 L0.477836 0.960526 L0.355897 1.013228 L0.197379 0.99566 L0.112021 0.942957 L0.07544 0.837547","'":"M0.301026 0.270996 L0.301026 0.523022","(":"M0.413087 0.241211 L0.372337 0.28347 L0.331589 0.334184 L0.290838 0.393349 L0.25009 0.460965 L0.219528 0.528584 L0.199153 0.5962 L0.188966 0.655364 L0.199153 0.714529 L0.219528 0.782146 L0.25009 0.849764 L0.290838 0.91738 L0.331589 0.976544 L0.372337 1.027258 L0.413087 1.069491",")":"M0.188966 0.241211 L0.229716 0.28347 L0.270466 0.334184 L0.311213 0.393349 L0.351964 0.460965 L0.382526 0.528584 L0.4029 0.5962 L0.413087 0.655364 L0.4029 0.714529 L0.382526 0.782146 L0.351964 0.849764 L0.311213 0.91738 L0.270466 0.976544 L0.229716 1.027258 L0.188966 1.069491","*":"M0.301026 0.458702 L0.301026 0.681942 M0.301026 0.458702 L0.520997 0.536834 M0.301026 0.458702 L0.439954 0.257813 M0.301026 0.458702 L0.162098 0.257813 M0.301026 0.458702 L0.081055 0.536834","+":"M0.042969 0.66845 L0.559083 0.66845 M0.301023 0.428223 L0.301023 0.908661",",":"M0.38672 0.852051 L0.215333 1.030661 L0.301025 1.119971","-":"M0.173829 0.686035 L0.428224 0.686035",".":"M0.362549 0.851074 L0.239503 0.851074","/":"M0.062501 1.035249 L0.539551 0.270996","<":"M0.559083 0.441895 L0.042969 0.66939 L0.042969 0.66939 L0.559083 0.896902","=":"M0.042969 0.545898 L0.559083 0.545898 M0.042969 0.80837 L0.559083 0.80837",">":"M0.042969 0.441895 L0.559083 0.66939 L0.559083 0.66939 L0.042969 0.896902",A:"M0.018067 0.94897 L0.290179 0.270996 L0.583986 0.94897 M0.155303 0.684521 L0.433548 0.684521",B:"M0.063965 0.94897 L0.063965 0.278953 L0.209356 0.270996 L0.342486 0.294394 L0.432179 0.37292 L0.418224 0.48773 L0.312686 0.549166 L0.084728 0.575531 L0.306377 0.589434 L0.468877 0.647456 L0.538087 0.736658 L0.5324 0.85202 L0.501247 0.902983 L0.42355 0.944398 L0.063965 0.94897",C:"M0.529054 0.419847 L0.498425 0.345196 L0.442238 0.292341 L0.33583 0.257813 L0.257199 0.268357 L0.187906 0.303748 L0.120243 0.385432 L0.072998 0.599844 L0.110073 0.815385 L0.165381 0.902183 L0.222883 0.942801 L0.334904 0.961214 L0.43253 0.937679 L0.504816 0.868999 L0.529054 0.772065",D:"M0.064454 0.94897 L0.071838 0.285078 L0.171217 0.270996 L0.247348 0.272633 L0.37101 0.306078 L0.462461 0.378304 L0.514748 0.475555 L0.535591 0.576392 L0.537599 0.652313 L0.528065 0.717381 L0.508562 0.772419 L0.445948 0.855695 L0.362356 0.90871 L0.225203 0.945862 L0.064454 0.94897",E:"M0.080078 0.270996 L0.080078 0.94897 M0.080078 0.270996 L0.521974 0.270996 M0.080078 0.609981 L0.389405 0.609981 M0.080078 0.94897 L0.521974 0.94897",F:"M0.086426 0.270996 L0.086426 0.94897 M0.091304 0.275607 L0.515626 0.275607 M0.091304 0.607677 L0.447344 0.607677",G:"M0.498034 0.284943 L0.374621 0.257813 L0.244219 0.268648 L0.160577 0.311997 L0.094556 0.398116 L0.056397 0.58404 L0.076752 0.785532 L0.120865 0.858197 L0.188947 0.916734 L0.271008 0.953591 L0.357069 0.961214 L0.43715 0.932047 L0.501262 0.858539 L0.545656 0.648611 L0.329595 0.648131",H:"M0.066895 0.270996 L0.066895 0.94897 M0.066895 0.595658 L0.530009 0.595658 M0.535157 0.270996 L0.535157 0.94897",I:"M0.301026 0.270996 L0.301026 0.94897",J:"M0.506839 0.270996 L0.507814 0.782193 L0.498468 0.846168 L0.480733 0.880789 L0.455864 0.90832 L0.426095 0.929408 L0.360746 0.954812 L0.302508 0.962139 L0.223573 0.953638 L0.16538 0.930312 L0.137072 0.907715 L0.116428 0.880312 L0.102822 0.848819 L0.095633 0.813947 L0.094239 0.776413",K:"M0.035401 0.270996 L0.035401 0.94897 M0.502258 0.316194 L0.035401 0.687823 M0.212484 0.582361 L0.566652 0.933903",L:"M0.07544 0.270996 L0.07544 0.94897 L0.526613 0.94897",M:"M0.042481 0.94897 L0.042481 0.270996 L0.301027 0.712492 L0.559571 0.270996 L0.559571 0.94897",N:"M0.067871 0.94897 L0.067871 0.270996 L0.534181 0.94897 L0.525031 0.270996",O:"M0.287293 0.961214 L0.19843 0.933567 L0.1172 0.849451 L0.057129 0.563945 L0.114348 0.350255 L0.18455 0.289392 L0.306101 0.257813 L0.42054 0.29572 L0.487543 0.365003 L0.544923 0.625294 L0.516366 0.789624 L0.465476 0.884596 L0.375084 0.949287 L0.287293 0.961214",P:"M0.070557 0.94897 L0.070557 0.28379 L0.20704 0.270996 L0.329134 0.278993 L0.408525 0.300514 L0.444022 0.317908 L0.500637 0.368929 L0.525796 0.423728 L0.531496 0.50384 L0.508934 0.554205 L0.473724 0.582043 L0.417577 0.604365 L0.336375 0.620372 L0.226014 0.629268 L0.082368 0.630258",Q:"M0.282435 1.050813 L0.195447 1.019646 L0.115933 0.924817 L0.057129 0.602943 L0.113139 0.362034 L0.18186 0.293418 L0.300844 0.257813 L0.412868 0.300553 L0.478457 0.37866 L0.534625 0.672103 L0.506671 0.857367 L0.456855 0.964437 L0.368371 1.037368 L0.282435 1.050813 M0.341225 0.815559 L0.544923 1.070653",R:"M0.034912 0.944112 L0.034912 0.288556 L0.227127 0.270996 L0.362038 0.276867 L0.443423 0.294907 L0.477644 0.309614 L0.505809 0.328757 L0.526616 0.352817 L0.544963 0.418061 L0.543241 0.475921 L0.524463 0.517817 L0.49076 0.546518 L0.444265 0.564799 L0.355195 0.578739 L0.047653 0.589627 M0.303054 0.617306 L0.56714 0.94897",S:"M0.483037 0.364333 L0.407613 0.267477 L0.22883 0.257813 L0.128623 0.327565 L0.087712 0.455539 L0.104656 0.518727 L0.168054 0.573307 L0.41928 0.617318 L0.503796 0.669342 L0.535157 0.759324 L0.493846 0.900055 L0.367668 0.961214 L0.205436 0.956661 L0.116711 0.907038 L0.066895 0.790334",T:"M0.022949 0.270996 L0.579103 0.270996 M0.309284 0.270996 L0.309284 0.94897",U:"M0.072022 0.270996 L0.07308 0.648875 L0.080372 0.75167 L0.099024 0.827813 L0.134786 0.885729 L0.181571 0.924023 L0.251464 0.95168 L0.339655 0.962139 L0.401553 0.951668 L0.45232 0.924086 L0.482701 0.891771 L0.495745 0.870529 L0.515699 0.81637 L0.525014 0.744626 L0.530031 0.272017",V:"M0.027832 0.270996 L0.320083 0.94897 L0.57422 0.270996",W:"M0 0.270996 L0.079799 0.940377 L0.285198 0.472884 L0.505255 0.94897 L0.602052 0.270996",X:"M0.009034 0.270996 L0.586805 0.94897 M0.593019 0.270996 L0.015246 0.94897",Y:"M0.018067 0.270996 L0.293132 0.574135 M0.583986 0.271959 L0.294954 0.57606 L0.305277 0.94897",Z:"M0.053711 0.270996 L0.548341 0.270996 L0.053711 0.94897 L0.548341 0.94897","[":"M0.404542 0.240234 L0.197511 0.240234 L0.197511 1.069424 L0.404542 1.069424","\\":"M0.062501 0.270996 L0.539551 1.035249","]":"M0.19751 0.240234 L0.404542 0.240234 L0.404542 1.069424 L0.19751 1.069424","^":"M0.035156 0.523931 L0.301024 0.270996 L0.566896 0.523931",_:"M0 1.160601 L0.602052 1.160601",a:"M0.527101 0.439941 L0.527101 0.973965 M0.527101 0.553824 L0.451366 0.477535 L0.376759 0.439941 L0.263722 0.439941 L0.187989 0.477535 L0.112255 0.553824 L0.074951 0.66881 L0.074951 0.745099 L0.112255 0.85898 L0.187989 0.93527 L0.263722 0.973965 L0.376759 0.973965 L0.451366 0.93527 L0.527101 0.85898",b:"M0.07666 0.240234 L0.07666 0.959985 M0.07666 0.582737 L0.151822 0.514237 L0.225865 0.480483 L0.338045 0.480483 L0.413211 0.514237 L0.488374 0.582737 L0.525392 0.685983 L0.525392 0.754485 L0.488374 0.856739 L0.413211 0.92524 L0.338045 0.959985 L0.225865 0.959985 L0.151822 0.92524 L0.07666 0.856739",c:"M0.512452 0.553823 L0.441624 0.477535 L0.371854 0.439941 L0.26614 0.439941 L0.195312 0.477535 L0.124486 0.553823 L0.0896 0.668808 L0.0896 0.745099 L0.124486 0.858979 L0.195312 0.93527 L0.26614 0.973965 L0.371854 0.973965 L0.441624 0.93527 L0.512452 0.858979",d:"M0.525392 0.240234 L0.525392 0.959985 M0.525392 0.582737 L0.450232 0.514237 L0.376189 0.480483 L0.264006 0.480483 L0.188844 0.514237 L0.11368 0.582737 L0.076661 0.685983 L0.076661 0.754485 L0.11368 0.856739 L0.188844 0.92524 L0.264006 0.959985 L0.376189 0.959985 L0.450232 0.92524 L0.525392 0.856739",e:"M0.059571 0.668808 L0.542482 0.668808 M0.542482 0.592521 L0.502641 0.516231 L0.461594 0.477535 L0.381914 0.439941 L0.261186 0.439941 L0.180299 0.477535 L0.099412 0.553823 L0.059571 0.668808 L0.059571 0.745099 L0.099412 0.858979 L0.180299 0.93527 L0.261186 0.973965 L0.381914 0.973965 L0.461594 0.93527 L0.542482 0.858979",f:"M0.512941 0.240234 L0.406984 0.240234 L0.301026 0.274346 L0.248047 0.374731 L0.248047 0.946817 M0.089112 0.476088 L0.459965 0.476088",g:"M0.525392 0.439941 L0.525392 0.989395 L0.488373 1.091918 L0.45023 1.126757 L0.376189 1.160601 L0.264004 1.160601 L0.188844 1.126757 L0.113681 1.058075 L0.076661 0.954555 M0.525392 0.542467 L0.45023 0.473786 L0.376189 0.439941 L0.264004 0.439941 L0.188844 0.473786 L0.113681 0.542467 L0.076661 0.645988 L0.076661 0.714669 L0.113681 0.817193 L0.188844 0.885875 L0.264004 0.920713 L0.376189 0.920713 L0.45023 0.885875 L0.525392 0.817193",h:"M0.092041 0.240234 L0.092041 0.946817 M0.092041 0.61058 L0.205937 0.509225 L0.282214 0.476086 L0.396109 0.476086 L0.47187 0.509225 L0.510011 0.61058 L0.510011 0.946817",i:"M0.261026 0.240234 L0.341026 0.240234 M0.300978 0.476089 L0.300978 0.946817",j:"M0.3853 0.240234 L0.447023 0.240234 M0.416159 0.465708 L0.416159 1.011689 L0.383887 1.108586 L0.252832 1.140264 L0.15503 1.108586",k:"M0.065186 0.240234 L0.065186 0.946817 M0.493824 0.476086 L0.065186 0.812323 M0.236758 0.677829 L0.536867 0.946817",l:"M0.301026 0.234863 L0.301026 0.946441",m:"M0.050538 0.439941 L0.050538 0.960796 M0.050538 0.588758 L0.114405 0.476607 L0.157178 0.439941 L0.236864 0.439941 L0.279637 0.476607 L0.32241 0.588758 L0.32241 0.960796 M0.32241 0.588758 L0.386281 0.476607 L0.428467 0.439941 L0.50874 0.439941 L0.551515 0.476607 L0.551515 0.960796",n:"M0.092041 0.439941 L0.092041 0.960796 M0.092041 0.588758 L0.205936 0.476607 L0.282216 0.439941 L0.396113 0.439941 L0.471871 0.476607 L0.510011 0.588758 L0.510011 0.960796",o:"M0.247175 0.439941 L0.175178 0.477535 L0.103186 0.553823 L0.066895 0.668808 L0.066895 0.745099 L0.103186 0.858979 L0.175178 0.93527 L0.247175 0.973965 L0.354874 0.973965 L0.426872 0.93527 L0.498866 0.858979 L0.535157 0.745099 L0.535157 0.668808 L0.498866 0.553823 L0.426872 0.477535 L0.354874 0.439941 L0.247175 0.439941",p:"M0.076904 0.439941 L0.076904 1.154244 M0.076904 0.541563 L0.151986 0.473487 L0.225944 0.439941 L0.338005 0.439941 L0.413087 0.473487 L0.488166 0.541563 L0.525148 0.644169 L0.525148 0.712246 L0.488166 0.813866 L0.413087 0.881942 L0.338005 0.916471 L0.225944 0.916471 L0.151986 0.881942 L0.076904 0.813866",q:"M0.525148 0.441895 L0.525148 1.156195 M0.525148 0.5435 L0.450067 0.47544 L0.376106 0.441895 L0.264042 0.441895 L0.188966 0.47544 L0.113885 0.5435 L0.076905 0.646108 L0.076905 0.714187 L0.113885 0.815809 L0.188966 0.883886 L0.264042 0.918418 L0.376106 0.918418 L0.450067 0.883886 L0.525148 0.815809",r:"M0.107422 0.439941 L0.107422 0.960796 M0.107422 0.663164 L0.155824 0.551014 L0.252626 0.476607 L0.349428 0.439941 L0.49463 0.439941",s:"M0.475556 0.477535 L0.400757 0.439941 L0.276092 0.439941 L0.176361 0.477535 L0.101563 0.553823 L0.101563 0.630112 L0.176361 0.668808 L0.301024 0.668808 L0.425688 0.745099 L0.50049 0.821387 L0.50049 0.897677 L0.425688 0.93527 L0.325956 0.973965 L0.201295 0.973965 L0.126496 0.93527 L0.101563 0.858979",t:"M0.246032 0.297852 L0.246032 0.826549 L0.301023 0.919323 L0.411011 0.950848 L0.520997 0.950848 M0.081055 0.515799 L0.466004 0.515799",u:"M0.092041 0.454102 L0.092041 0.826134 L0.13018 0.937211 L0.205936 0.974954 L0.319832 0.974954 L0.396113 0.937211 L0.510011 0.826134 M0.510011 0.454102 L0.510011 0.974954",v:"M0.048828 0.453125 L0.301026 0.961719 M0.553224 0.453125 L0.301026 0.961719",w:"M0 0.453125 L0.150512 0.961719 M0.301024 0.453125 L0.150512 0.961719 M0.301024 0.453125 L0.451539 0.961719 M0.602052 0.453125 L0.451539 0.961719",x:"M0.03711 0.453125 L0.564943 0.961719 M0.564943 0.453125 L0.03711 0.961719",y:"M0.084618 0.453125 L0.320232 0.921476 M0.55713 0.453125 L0.320232 0.921476 L0.242119 1.055289 L0.163369 1.122196 L0.084618 1.155166 L0.044922 1.155166",z:"M0.505373 0.452148 L0.09668 0.961651 M0.09668 0.452148 L0.505373 0.452148 M0.09668 0.961651 L0.505373 0.961651"},rFt={};for(let e in oFt){rFt[e]=[];let t=oFt[e].split("M").slice(1).map((n)=>n.split("L").map((o)=>o.trim().split(" ").map(parseFloat)));for(let n of t)for(let o=0;o<n.length-1;o++)rFt[e].push({x1:n[o][0],y1:1-n[o][1],x2:n[o+1][0],y2:1-n[o+1][1]})}var TO=(e,t)=>({...e,rects:[...e.rects??[],...t.rects??[]],points:[...e.points??[],...t.points??[]],lines:[...e.lines??[],...t.lines??[]],infiniteLines:[...e.infiniteLines??[],...t.infiniteLines??[]],polygons:[...e.polygons??[],...t.polygons??[]],circles:[...e.circles??[],...t.circles??[]],arrows:[...e.arrows??[],...t.arrows??[]],texts:[...e.texts??[],...t.texts??[]]});function XUe(e,t){if(e.points)for(let n of e.points)n.step=t;if(e.lines)for(let n of e.lines)n.step=t;if(e.infiniteLines)for(let n of e.infiniteLines)n.step=t;if(e.polygons)for(let n of e.polygons)n.step=t;if(e.rects)for(let n of e.rects)n.step=t;if(e.circles)for(let n of e.circles)n.step=t;if(e.texts)for(let n of e.texts)n.step=t;if(e.arrows)for(let n of e.arrows)n.step=t;return e}var fa=class{MAX_ITERATIONS=1e5;solved=!1;failed=!1;iterations=0;progress=0;error=null;activeSubSolver;failedSubSolvers;timeToSolve;stats={};_setupDone=!1;getSolverName(){return this.constructor.name}setup(){this._setupDone||(this._setup(),this._setupDone=!0)}_setup(){}step(){if(this._setupDone||this.setup(),!this.solved&&!this.failed){this.iterations++;try{this._step()}catch(e){throw this.error=`${this.getSolverName()} error: ${e}`,this.failed=!0,e}!this.solved&&this.iterations>=this.MAX_ITERATIONS&&this.tryFinalAcceptance(),!this.solved&&this.iterations>=this.MAX_ITERATIONS&&(this.error=`${this.getSolverName()} ran out of iterations`,this.failed=!0),"computeProgress"in this&&(this.progress=this.computeProgress())}}_step(){}getConstructorParams(){throw Error("getConstructorParams not implemented")}getOutput(){return null}solve(){let e=Date.now();for(;!this.solved&&!this.failed;)this.step();let t=Date.now();this.timeToSolve=t-e}visualize(){return{lines:[],points:[],rects:[],circles:[]}}tryFinalAcceptance(){}preview(){return{lines:[],points:[],rects:[],circles:[]}}};function b0(e,t,n,o={}){return{solverName:e,solverClass:t,getConstructorParams:n,onSolved:o.onSolved}}var mS=class extends fa{startTimeOfStage={};endTimeOfStage={};timeSpentOnStage={};firstIterationOfStage={};currentPipelineStageIndex=0;inputProblem;pipelineOutputs={};constructor(e){super(),this.inputProblem=e,this.MAX_ITERATIONS=1e6}_step(){let e=this.pipelineDef[this.currentPipelineStageIndex];if(!e)return void(this.solved=!0);if(this.activeSubSolver){if(this.activeSubSolver.step(),this.activeSubSolver.solved){this.endTimeOfStage[e.solverName]=performance.now(),this.timeSpentOnStage[e.solverName]=this.endTimeOfStage[e.solverName]-this.startTimeOfStage[e.solverName];let n=this.activeSubSolver.getOutput();n!==null&&(this.pipelineOutputs[e.solverName]=n),e.onSolved?.(this),this.activeSubSolver=null,this.currentPipelineStageIndex++}else this.activeSubSolver.failed&&(this.error=this.activeSubSolver?.error,this.failed=!0,this.activeSubSolver=null);return}let t=e.getConstructorParams(this);this.activeSubSolver=new e.solverClass(...t),this[e.solverName]=this.activeSubSolver,this.timeSpentOnStage[e.solverName]=0,this.startTimeOfStage[e.solverName]=performance.now(),this.firstIterationOfStage[e.solverName]=this.iterations}solveUntilStage(e){for(;this.getCurrentStageName().toLowerCase()!==e.toLowerCase()&&(this.step(),!this.failed&&!this.solved););}getCurrentStageName(){return this.pipelineDef[this.currentPipelineStageIndex]?.solverName??"none"}getStageProgress(){let e=this.pipelineDef.length;if(e===0)return 1;let t=this.activeSubSolver?.progress??0;return(this.currentPipelineStageIndex+t)/e}getStageStats(){let e={};for(let t of this.pipelineDef){let n=this.timeSpentOnStage[t.solverName]||0,o=this.firstIterationOfStage[t.solverName]||0,r=this.iterations,i=t.solverName===this.getCurrentStageName()?r-o:0,s=this.currentPipelineStageIndex>this.pipelineDef.findIndex((a)=>a.solverName===t.solverName);e[t.solverName]={timeSpent:n,iterations:i,completed:s}}return e}initialVisualize(){return null}finalVisualize(){return null}visualize(){if(!this.solved&&this.activeSubSolver)return this.activeSubSolver.visualize();let e=0,t=this.initialVisualize();t&&(XUe(t,0),e=1);let n=null;this.solved&&(n=this.finalVisualize());let o=[t].filter(Boolean).concat(this.pipelineDef.map((r,i)=>{let s=this[r.solverName],a=s?.visualize();return a?(XUe(a,i+e),a):null}).filter(Boolean));return o.length===0?{points:[],rects:[],lines:[],circles:[],texts:[]}:(this.solved&&n&&(XUe(n,o.length+e+1),o.push(n)),o.length===1?o[0]:{points:o.flatMap((r)=>r.points||[]),rects:o.flatMap((r)=>r.rects||[]),lines:o.flatMap((r)=>r.lines||[]),circles:o.flatMap((r)=>r.circles||[]),texts:o.flatMap((r)=>r.texts||[])})}preview(){return this.activeSubSolver?this.activeSubSolver.preview():super.preview()}computeProgress(){return this.getStageProgress()}getStageOutput(e){return this.pipelineOutputs[e]}getAllOutputs(){return{...this.pipelineOutputs}}hasStageOutput(e){return e in this.pipelineOutputs}getSolver(e){return this[e]}},Jpr=class{constructor(e=1/0,t=Float64Array,n=Uint32Array){let o=e!==1/0;this.ids=o?new n(e):[],this.values=o?new t(e):[],this.capacity=e,this.length=0}clear(){this.length=0}push(e,t){if(this.length===this.capacity)throw RangeError("Queue is at capacity.");let n=this.length++;for(;n>0;){let o=n-1>>1,r=this.values[o];if(t>=r)break;this.ids[n]=this.ids[o],this.values[n]=r,n=o}this.ids[n]=e,this.values[n]=t}pop(){if(this.length===0)return;let e=this.ids,t=this.values,n=e[0],o=--this.length;if(o>0){let r=e[o],i=t[o],s=0,a=o>>1;for(;s<a;){let c=1+(s<<1),l=c+1,h=c+(+(l<o)&+(t[l]<t[c]));if(t[h]>=i)break;e[s]=e[h],t[s]=t[h],s=h}e[s]=r,t[s]=i}return n}peek(){return this.length>0?this.ids[0]:void 0}peekValue(){return this.length>0?this.values[0]:void 0}shrink(){Array.isArray(this.ids)&&(this.ids.length=this.length),Array.isArray(this.values)&&(this.values.length=this.length)}},iFt=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],i_=class e{static from(t,n=0){if(n%8!=0)throw Error("byteOffset must be 8-byte aligned.");if(!t||t.byteLength===void 0||"buffer"in t)throw Error("Data must be an instance of ArrayBuffer or SharedArrayBuffer.");let[o,r]=new Uint8Array(t,n+0,2);if(o!==251)throw Error("Data does not appear to be in a Flatbush format.");let i=r>>4;if(i!==3)throw Error(`Got v${i} data when expected v3.`);let s=iFt[15&r];if(!s)throw Error("Unrecognized array type.");let[a]=new Uint16Array(t,n+2,1),[c]=new Uint32Array(t,n+4,1);return new e(c,a,s,void 0,t,n)}constructor(t,n=16,o=Float64Array,r=ArrayBuffer,i,s=0){if(t===void 0)throw Error("Missing required argument: numItems.");if(isNaN(t)||t<=0)throw Error(`Unexpected numItems value: ${t}.`);this.numItems=+t,this.nodeSize=Math.min(Math.max(+n,2),65535),this.byteOffset=s;let a=t,c=a;this._levelBounds=[4*a];do a=Math.ceil(a/this.nodeSize),c+=a,this._levelBounds.push(4*c);while(a!==1);this.ArrayType=o,this.IndexArrayType=c<16384?Uint16Array:Uint32Array;let l=iFt.indexOf(o),h=4*c*o.BYTES_PER_ELEMENT;if(l<0)throw Error(`Unexpected typed array class: ${o}.`);let d=o,u=this.IndexArrayType;if(i)this.data=i,this._boxes=new d(i,s+8,4*c),this._indices=new u(i,s+8+h,c),this._pos=4*c,this.minX=this._boxes[this._pos-4],this.minY=this._boxes[this._pos-3],this.maxX=this._boxes[this._pos-2],this.maxY=this._boxes[this._pos-1];else{let _=this.data=new r(8+h+c*this.IndexArrayType.BYTES_PER_ELEMENT);this._boxes=new d(_,8,4*c),this._indices=new u(_,8+h,c),this._pos=0,this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0,new Uint8Array(_,0,2).set([251,48+l]),new Uint16Array(_,2,1)[0]=n,new Uint32Array(_,4,1)[0]=t}this._queue=new Jpr}add(t,n,o=t,r=n){let i=this._pos,s=i>>2,a=this._boxes;return this._indices[s]=s,a[i]=t,a[i+1]=n,a[i+2]=o,a[i+3]=r,this._pos=i+4,t<this.minX&&(this.minX=t),n<this.minY&&(this.minY=n),o>this.maxX&&(this.maxX=o),r>this.maxY&&(this.maxY=r),s}finish(){if(this._pos>>2!==this.numItems)throw Error(`Added ${this._pos>>2} items when expected ${this.numItems}.`);let t=this._boxes;if(this.numItems<=this.nodeSize)return t[this._pos++]=this.minX,t[this._pos++]=this.minY,t[this._pos++]=this.maxX,void(t[this._pos++]=this.maxY);let{numItems:n,minX:o,minY:r,nodeSize:i,_indices:s,_levelBounds:a}=this,c=this.maxX-o||1,l=this.maxY-r||1,h=new Int32Array(n),d=65535/c,u=65535/l;for(let p=0,m=0;p<n;p++){let A=t[m++],g=t[m++],f=d*((A+t[m++])/2-o)|0,y=u*((g+t[m++])/2-r)|0;h[p]=tmr(f,y)}(function(p,m,A,g,f,y){let x=[g,f];for(;x.length;){let C=x.pop()||0,b=x.pop()||0;if(C-b<=y&&Math.floor(b/y)>=Math.floor(C/y))continue;let I=p[b],v=p[b+C>>1],P=p[C],M=I>v!=I>P?I:v<I!=v<P?v:P,B=b-1,T=C+1;for(;;){do B++;while(p[B]<M);do T--;while(p[T]>M);if(B>=T)break;emr(p,m,A,B,T)}x.push(b,T,T+1,C)}})(h,t,s,0,n-1,i);let _=4*n;for(let p=0,m=0;p<a.length-1;p++){let A=a[p];for(;m<A;){let g=m,f=t[m++],y=t[m++],x=t[m++],C=t[m++];for(let b=1;b<i&&m<A;b++)f=Math.min(f,t[m++]),y=Math.min(y,t[m++]),x=Math.max(x,t[m++]),C=Math.max(C,t[m++]);s[_>>2]=g,t[_++]=f,t[_++]=y,t[_++]=x,t[_++]=C}}this._pos=_}search(t,n,o,r,i){if(this._pos!==this._boxes.length)throw Error("Data not yet indexed - call index.finish().");let{_boxes:s,_levelBounds:a,_indices:c,nodeSize:l}=this,h=4*this.numItems,d=s.length-4,u=a.length-1,_=[],p=[],m=!1;for(;d!==void 0;){let A=Math.min(d+4*l,a[u]),g=d>=h;if(m)this._collectContained(d,A,u,h,p,i);else for(let f=d;f<A;f+=4){let y=s[f];if(o<y)continue;let x=s[f+1];if(r<x)continue;let C=s[f+2];if(t>C)continue;let b=s[f+3];if(n>b)continue;let I=0|c[f>>2];if(g){let v=+(t<=y&&n<=x&&o>=C&&r>=b);_.push(I|v,u-1)}else(i===void 0||i(I,y,x,C,b))&&p.push(I)}u=_.pop(),d=_.pop(),d!==void 0&&(m=!(1&~d),d&=-2)}return p}_collectContained(t,n,o,r,i,s){let a=this._boxes,c=this._indices,l=t;for(let d=o;d>0;d--)l=c[l>>2];let h=Math.min(l+(n-t)*this.nodeSize**o,r);if(s===void 0)for(;l<h;l+=4)i.push(0|c[l>>2]);else for(;l<h;l+=4){let d=0|c[l>>2];s(d,a[l],a[l+1],a[l+2],a[l+3])&&i.push(d)}}neighbors(t,n,o=1/0,r=1/0,i){if(this._pos!==this._boxes.length)throw Error("Data not yet indexed - call index.finish().");let{_boxes:s,_levelBounds:a,_indices:c,_queue:l,nodeSize:h}=this,d=4*this.numItems,u=4*h,_=[],p=o===1,m=r*r;for(l.push(s.length-4<<1,0);l.length;){let A=l.ids[0];if(1&A){if(l.pop(),_.push(A>>1),_.length===o)break;continue}l.pop();let g=A>>1,f=g<d,y=Math.min(g+u,Zpr(g,a));for(let x=g;x<y;x+=4){let C=s[x],b=s[x+1],I=s[x+2],v=s[x+3],P=Math.max(Math.max(C-t,t-I),0),M=Math.max(Math.max(b-n,n-v),0),B=P*P+M*M;if(B>m)continue;let T=0|c[x>>2];f?(i===void 0||i(T))&&(l.push(T<<1|1,B),p&&B<m&&(m=B)):l.push(T<<1,B)}}return l.clear(),_}};function Zpr(e,t){let n=0,o=t.length-1;for(;n<o;){let r=n+o>>1;t[r]>e?o=r:n=r+1}return t[n]}function emr(e,t,n,o,r){let i=e[o];e[o]=e[r],e[r]=i;let s=4*o,a=4*r,c=t[s],l=t[s+1],h=t[s+2],d=t[s+3];t[s]=t[a],t[s+1]=t[a+1],t[s+2]=t[a+2],t[s+3]=t[a+3],t[a]=c,t[a+1]=l,t[a+2]=h,t[a+3]=d;let u=n[o];n[o]=n[r],n[r]=u}function tmr(e,t){let n=e^t,o=65535^n,r=65535^(e|t),i=e&(65535^t),s=n|o>>1,a=n>>1^n,c=r^r>>1^o&i>>1,l=i^n&r>>1^i>>1;return n=s&s>>2^a&a>>2,o=s&a>>2^a&(s^a)>>2,r=c^s&c>>2^a&l>>2,i=l^a&c>>2^(s^a)&l>>2,s=n&n>>4^o&o>>4,a=n&o>>4^o&(n^o)>>4,c=r^n&r>>4^o&i>>4,l=i^o&r>>4^(n^o)&i>>4,r=c^s&c>>8^a&l>>8,i=l^a&c>>8^(s^a)&l>>8,r^=r>>1,i^=i>>1,n=e^t,o=i|65535^(n|r),n=16711935&(n|n<<8),n=252645135&(n|n<<4),n=858993459&(n|n<<2),n=1431655765&(n|n<<1),o=16711935&(o|o<<8),o=252645135&(o|o<<4),o=858993459&(o|o<<2),o=1431655765&(o|o<<1),((o<<1|n)>>>0)-2147483648}var ZI=0.0001,Fae=[{facingDirection:"x-",dx:-1,dy:0,startX:-0.5,startY:0.5,endX:-0.5,endY:-0.5},{facingDirection:"x+",dx:1,dy:0,startX:0.5,startY:0.5,endX:0.5,endY:-0.5},{facingDirection:"y-",dx:0,dy:-1,startX:-0.5,startY:-0.5,endX:0.5,endY:-0.5},{facingDirection:"y+",dx:0,dy:1,startX:0.5,startY:0.5,endX:-0.5,endY:0.5}],sFt={"x-":Fae.find((e)=>e.facingDirection==="x-"),"x+":Fae.find((e)=>e.facingDirection==="x+"),"y-":Fae.find((e)=>e.facingDirection==="y-"),"y+":Fae.find((e)=>e.facingDirection==="y+")},nmr={"x-":{x:-1,y:0},"x+":{x:1,y:0},"y-":{x:0,y:-1},"y+":{x:0,y:1}},jUe=(e,t)=>{let{dir:n,amt:o}=t,r=nmr[n];return e.map((i)=>({x:i.x+r.x*o,y:i.y+r.y*o}))},zae=0.0001;function aFt(e){let t=[];for(let n of e)for(let o of Fae){let r={x:n.center.x+n.width*o.startX,y:n.center.y+n.height*o.startY},i={x:n.center.x+n.width*o.endX,y:n.center.y+n.height*o.endY};r.x>i.x&&([r,i]=[i,r]),Math.abs(r.x-i.x)<zae&&r.y>i.y&&([r,i]=[i,r]);for(let s of n.availableZ)t.push({parent:n,start:r,end:i,facingDirection:o.facingDirection,z:s})}return t}var omr=class extends fa{constructor(e){super(),this.input=e;let t=this.input.targetMeshNodes??this.input.allMeshNodes,n=new Set(t.map((r)=>r.capacityMeshNodeId)),o=this.input.allMeshNodes.filter((r)=>!n.has(r.capacityMeshNodeId));this.unprocessedEdges=aFt(t),this.allEdges=[...this.unprocessedEdges,...aFt(o)],this.edgeSpatialIndex=new i_(this.allEdges.length);for(let r of this.allEdges)this.edgeSpatialIndex.add(r.start.x,r.start.y,r.end.x,r.end.y);this.edgeSpatialIndex.finish()}input;allEdges;unprocessedEdges=[];segmentsWithAdjacentEmptySpace=[];edgeSpatialIndex;lastCandidateEdge=null;lastOverlappingEdges=null;lastUncoveredSegments=null;_step(){if(this.unprocessedEdges.length===0)return this.solved=!0,this.lastCandidateEdge=null,this.lastOverlappingEdges=null,void(this.lastUncoveredSegments=null);let e=this.unprocessedEdges.shift();this.lastCandidateEdge=e;let t=this.edgeSpatialIndex.search(e.start.x-zae,e.start.y-zae,e.end.x+zae,e.end.y+zae).map((o)=>this.allEdges[o]).filter((o)=>o.z===e.z);this.lastOverlappingEdges=t;let n=function(o,r){let i=Math.abs(o.start.y-o.end.y)<ZI,s=Math.abs(o.start.x-o.end.x)<ZI;if(!i&&!s)return[];let a=i?"x":"y",c=i?"y":"x",l=o.start[c],h=o.start[a],d=o.end[a],u=Math.min(h,d),_=Math.max(h,d),p=(y)=>Math.max(u,Math.min(_,y)),m=[];for(let y of r){if(y===o)continue;let x=Math.abs(y.start.y-y.end.y)<ZI,C=Math.abs(y.start.x-y.end.x)<ZI;if(a==="x"&&!x)continue;if(a==="y"&&!C)continue;if(Math.abs(y.start[c]-l)>ZI)continue;let b=Math.min(y.start[a],y.end[a]),I=Math.max(y.start[a],y.end[a]),v=p(b),P=p(I);P-v>ZI&&m.push({s:v,e:P})}if(m.length===0)return[{...o,start:{...o.start},end:{...o.end}}];m.sort((y,x)=>y.s-x.s);let A=[];for(let y of m){let x=A[A.length-1];!x||y.s>x.e+ZI?A.push({...y}):x.e=Math.max(x.e,y.e)}let g=[],f=u;for(let y of A)if(y.s>f+ZI&&g.push({s:f,e:y.s}),f=Math.max(f,y.e),f>=_-ZI)break;return _>f+ZI&&g.push({s:f,e:_}),g.length===0?[]:g.filter((y)=>y.e-y.s>ZI).map((y)=>{let x=a==="x"?{x:y.s,y:l}:{x:l,y:y.s},C=a==="x"?{x:y.e,y:l}:{x:l,y:y.e};return{parent:o.parent,facingDirection:o.facingDirection,start:x,end:C,z:o.z}})}(e,t);this.lastUncoveredSegments=n,this.segmentsWithAdjacentEmptySpace.push(...n)}getOutput(){return{segmentsWithAdjacentEmptySpace:this.segmentsWithAdjacentEmptySpace}}visualize(){let e={title:"FindSegmentsWithAdjacentEmptySpace",coordinateSystem:"cartesian",rects:[],points:[],lines:[],circles:[],infiniteLines:[],polygons:[],arrows:[],texts:[]};for(let t of this.input.allMeshNodes)e.rects.push({center:t.center,width:t.width,height:t.height,stroke:"rgba(0, 0, 0, 0.1)"});for(let t of this.unprocessedEdges)e.lines.push({points:jUe([t.start,t.end],{dir:t.facingDirection,amt:-0.1}),strokeColor:"rgba(0, 0, 255, 0.5)",strokeDash:"5 5"});for(let t of this.segmentsWithAdjacentEmptySpace)e.lines.push({points:[t.start,t.end],strokeColor:"rgba(0,255,0, 0.5)"});if(this.lastCandidateEdge&&e.lines.push({points:[this.lastCandidateEdge.start,this.lastCandidateEdge.end],strokeColor:"blue"}),this.lastOverlappingEdges)for(let t of this.lastOverlappingEdges)e.lines.push({points:jUe([t.start,t.end],{dir:t.facingDirection,amt:0.05}),strokeColor:"red",strokeDash:"2 2"});if(this.lastUncoveredSegments)for(let t of this.lastUncoveredSegments)e.lines.push({points:jUe([t.start,t.end],{dir:t.facingDirection,amt:-0.05}),strokeColor:"green",strokeDash:"2 2"});return e}};function oXt(e,t,n=0,o=e.length-1,r=rmr){for(;o>n;){if(o-n>600){let c=o-n+1,l=t-n+1,h=Math.log(c),d=0.5*Math.exp(2*h/3),u=0.5*Math.sqrt(h*d*(c-d)/c)*(l-c/2<0?-1:1);oXt(e,t,Math.max(n,Math.floor(t-l*d/c+u)),Math.min(o,Math.floor(t+(c-l)*d/c+u)),r)}let i=e[t],s=n,a=o;for(pae(e,n,t),r(e[o],i)>0&&pae(e,n,o);s<a;){for(pae(e,s,a),s++,a--;r(e[s],i)<0;)s++;for(;r(e[a],i)>0;)a--}r(e[n],i)===0?pae(e,n,a):(a++,pae(e,a,o)),a<=t&&(n=a+1),t<=a&&(o=a-1)}}function pae(e,t,n){let o=e[t];e[t]=e[n],e[n]=o}function rmr(e,t){return e<t?-1:e>t?1:0}var gV=class{constructor(e=9){this._maxEntries=Math.max(4,e),this._minEntries=Math.max(2,Math.ceil(0.4*this._maxEntries)),this.clear()}all(){return this._all(this.data,[])}search(e){let t=this.data,n=[];if(!E4e(e,t))return n;let o=this.toBBox,r=[];for(;t;){for(let i=0;i<t.children.length;i++){let s=t.children[i],a=t.leaf?o(s):s;E4e(e,a)&&(t.leaf?n.push(s):$Ue(e,a)?this._all(s,n):r.push(s))}t=r.pop()}return n}collides(e){let t=this.data;if(!E4e(e,t))return!1;let n=[];for(;t;){for(let o=0;o<t.children.length;o++){let r=t.children[o],i=t.leaf?this.toBBox(r):r;if(E4e(e,i)){if(t.leaf||$Ue(e,i))return!0;n.push(r)}}t=n.pop()}return!1}load(e){if(!e||!e.length)return this;if(e.length<this._minEntries){for(let n=0;n<e.length;n++)this.insert(e[n]);return this}let t=this._build(e.slice(),0,e.length-1,0);if(this.data.children.length)if(this.data.height===t.height)this._splitRoot(this.data,t);else{if(this.data.height<t.height){let n=this.data;this.data=t,t=n}this._insert(t,this.data.height-t.height-1,!0)}else this.data=t;return this}insert(e){return e&&this._insert(e,this.data.height-1),this}clear(){return this.data=t$([]),this}remove(e,t){if(!e)return this;let n=this.data,o=this.toBBox(e),r=[],i=[],s,a,c;for(;n||r.length;){if(n||(n=r.pop(),a=r[r.length-1],s=i.pop(),c=!0),n.leaf){let l=imr(e,n.children,t);if(l!==-1)return n.children.splice(l,1),r.push(n),this._condense(r),this}c||n.leaf||!$Ue(n,o)?a?(s++,n=a.children[s],c=!1):n=null:(r.push(n),i.push(s),s=0,a=n,n=n.children[0])}return this}toBBox(e){return e}compareMinX(e,t){return e.minX-t.minX}compareMinY(e,t){return e.minY-t.minY}toJSON(){return this.data}fromJSON(e){return this.data=e,this}_all(e,t){let n=[];for(;e;)e.leaf?t.push(...e.children):n.push(...e.children),e=n.pop();return t}_build(e,t,n,o){let r=n-t+1,i,s=this._maxEntries;if(r<=s)return i=t$(e.slice(t,n+1)),QK(i,this.toBBox),i;o||(o=Math.ceil(Math.log(r)/Math.log(s)),s=Math.ceil(r/Math.pow(s,o-1))),i=t$([]),i.leaf=!1,i.height=o;let a=Math.ceil(r/s),c=a*Math.ceil(Math.sqrt(s));cFt(e,t,n,c,this.compareMinX);for(let l=t;l<=n;l+=c){let h=Math.min(l+c-1,n);cFt(e,l,h,a,this.compareMinY);for(let d=l;d<=h;d+=a){let u=Math.min(d+a-1,h);i.children.push(this._build(e,d,u,o-1))}}return QK(i,this.toBBox),i}_chooseSubtree(e,t,n,o){for(;o.push(t),!t.leaf&&o.length-1!==n;){let r,i=1/0,s=1/0;for(let a=0;a<t.children.length;a++){let c=t.children[a],l=KUe(c),h=cmr(e,c)-l;h<s?(s=h,i=l<i?l:i,r=c):h===s&&l<i&&(i=l,r=c)}t=r||t.children[0]}return t}_insert(e,t,n){let o=n?e:this.toBBox(e),r=[],i=this._chooseSubtree(o,this.data,t,r);for(i.children.push(e),Vae(i,o);t>=0&&r[t].children.length>this._maxEntries;)this._split(r,t),t--;this._adjustParentBBoxes(o,r,t)}_split(e,t){let n=e[t],o=n.children.length,r=this._minEntries;this._chooseSplitAxis(n,r,o);let i=this._chooseSplitIndex(n,r,o),s=t$(n.children.splice(i,n.children.length-i));s.height=n.height,s.leaf=n.leaf,QK(n,this.toBBox),QK(s,this.toBBox),t?e[t-1].children.push(s):this._splitRoot(n,s)}_splitRoot(e,t){this.data=t$([e,t]),this.data.height=e.height+1,this.data.leaf=!1,QK(this.data,this.toBBox)}_chooseSplitIndex(e,t,n){let o,r=1/0,i=1/0;for(let s=t;s<=n-t;s++){let a=Oae(e,0,s,this.toBBox),c=Oae(e,s,n,this.toBBox),l=lmr(a,c),h=KUe(a)+KUe(c);l<r?(r=l,o=s,i=h<i?h:i):l===r&&h<i&&(i=h,o=s)}return o||n-t}_chooseSplitAxis(e,t,n){let o=e.leaf?this.compareMinX:smr,r=e.leaf?this.compareMinY:amr;this._allDistMargin(e,t,n,o)<this._allDistMargin(e,t,n,r)&&e.children.sort(o)}_allDistMargin(e,t,n,o){e.children.sort(o);let r=this.toBBox,i=Oae(e,0,t,r),s=Oae(e,n-t,n,r),a=P4e(i)+P4e(s);for(let c=t;c<n-t;c++){let l=e.children[c];Vae(i,e.leaf?r(l):l),a+=P4e(i)}for(let c=n-t-1;c>=t;c--){let l=e.children[c];Vae(s,e.leaf?r(l):l),a+=P4e(s)}return a}_adjustParentBBoxes(e,t,n){for(let o=n;o>=0;o--)Vae(t[o],e)}_condense(e){for(let t,n=e.length-1;n>=0;n--)e[n].children.length===0?n>0?(t=e[n-1].children,t.splice(t.indexOf(e[n]),1)):this.clear():QK(e[n],this.toBBox)}};function imr(e,t,n){if(!n)return t.indexOf(e);for(let o=0;o<t.length;o++)if(n(e,t[o]))return o;return-1}function QK(e,t){Oae(e,0,e.children.length,t,e)}function Oae(e,t,n,o,r){r||(r=t$(null)),r.minX=1/0,r.minY=1/0,r.maxX=-1/0,r.maxY=-1/0;for(let i=t;i<n;i++){let s=e.children[i];Vae(r,e.leaf?o(s):s)}return r}function Vae(e,t){return e.minX=Math.min(e.minX,t.minX),e.minY=Math.min(e.minY,t.minY),e.maxX=Math.max(e.maxX,t.maxX),e.maxY=Math.max(e.maxY,t.maxY),e}function smr(e,t){return e.minX-t.minX}function amr(e,t){return e.minY-t.minY}function KUe(e){return(e.maxX-e.minX)*(e.maxY-e.minY)}function P4e(e){return e.maxX-e.minX+(e.maxY-e.minY)}function cmr(e,t){return(Math.max(t.maxX,e.maxX)-Math.min(t.minX,e.minX))*(Math.max(t.maxY,e.maxY)-Math.min(t.minY,e.minY))}function lmr(e,t){let n=Math.max(e.minX,t.minX),o=Math.max(e.minY,t.minY),r=Math.min(e.maxX,t.maxX),i=Math.min(e.maxY,t.maxY);return Math.max(0,r-n)*Math.max(0,i-o)}function $Ue(e,t){return e.minX<=t.minX&&e.minY<=t.minY&&t.maxX<=e.maxX&&t.maxY<=e.maxY}function E4e(e,t){return t.minX<=e.maxX&&t.minY<=e.maxY&&t.maxX>=e.minX&&t.maxY>=e.minY}function t$(e){return{children:e,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function cFt(e,t,n,o,r){let i=[t,n];for(;i.length;){if((n=i.pop())-(t=i.pop())<=o)continue;let s=t+Math.ceil((n-t)/o/2)*o;oXt(e,s,t,n,r),i.push(t,s,s,n)}}var lFt=(e)=>({minX:Math.min(...e.map((t)=>t.x)),minY:Math.min(...e.map((t)=>t.y)),maxX:Math.max(...e.map((t)=>t.x)),maxY:Math.max(...e.map((t)=>t.y))});function su(e,t,n,o){let r=M4e(e,t,n),i=M4e(e,t,o),s=M4e(n,o,e),a=M4e(n,o,t);return r!==i&&s!==a||(!(r!==0||!w4e(e,n,t))||(!(i!==0||!w4e(e,o,t))||(!(s!==0||!w4e(n,e,o))||!(a!==0||!w4e(n,t,o)))))}function M4e(e,t,n){let o=(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y);return o===0?0:o>0?1:2}function w4e(e,t,n){return t.x<=Math.max(e.x,n.x)&&t.x>=Math.min(e.x,n.x)&&t.y<=Math.max(e.y,n.y)&&t.y>=Math.min(e.y,n.y)}function oc(e,t,n){let o=(n.x-t.x)**2+(n.y-t.y)**2;if(o===0)return Dn(e,t);let r=((e.x-t.x)*(n.x-t.x)+(e.y-t.y)*(n.y-t.y))/o;return r=Math.max(0,Math.min(1,r)),Dn(e,{x:t.x+r*(n.x-t.x),y:t.y+r*(n.y-t.y)})}function Dn(e,t){let n=e.x-t.x,o=e.y-t.y;return Math.sqrt(n*n+o*o)}function vw(e,t,n,o){let r=t.x-e.x,i=t.y-e.y,s=o.x-n.x,a=o.y-n.y,c=e.x-n.x,l=e.y-n.y,h=r*a-i*s;if(Math.abs(h)<0.0000000001)return null;let d=(l*s-c*a)/h,u=(r*l-i*c)/h,_=0.000000001;if(d>=-0.000000001&&d<=1+_&&u>=-0.000000001&&u<=1+_)return{x:e.x+d*r,y:e.y+d*i};return null}var rXt=(e)=>{if("minX"in e)return e;let t=e.width/2,n=e.height/2;return{minX:e.center.x-t,minY:e.center.y-n,maxX:e.center.x+t,maxY:e.center.y+n}},u$e=(e)=>[{x:e.minX,y:e.minY},{x:e.maxX,y:e.minY},{x:e.maxX,y:e.maxY},{x:e.minX,y:e.maxY}],iXt=(e)=>{let t=[];for(let n=0;n<e.length;n++){let o=e[n],r=e[(n+1)%e.length];t.push([o,r])}return t},hmr=(e,t,n)=>{let o=(e.y-t.y)*(n.x-t.x)-(e.x-t.x)*(n.y-t.y);if(Math.abs(o)>0.000000001)return!1;let r=(e.x-t.x)*(n.x-t.x)+(e.y-t.y)*(n.y-t.y);if(r<0)return!1;let i=(n.x-t.x)**2+(n.y-t.y)**2;return i!==0&&!(r>i)},fCe=(e,t)=>e.x>=t.minX&&e.x<=t.maxX&&e.y>=t.minY&&e.y<=t.maxY,Nce=(e,t)=>{if(t.length<3)return!1;let n=iXt(t);for(let[r,i]of n)if(hmr(e,r,i))return!0;let o=!1;for(let r=0,i=t.length-1;r<t.length;i=r++){let s=t[r].x,a=t[r].y,c=t[i].x,l=t[i].y;a>e.y!=l>e.y&&e.x<(c-s)*(e.y-a)/(l-a)+s&&(o=!o)}return o},sXt=(e,t)=>{let n=u$e(e),o=[[n[0],n[1]],[n[1],n[2]],[n[2],n[3]],[n[3],n[0]]],r=iXt(t);for(let[i,s]of r)for(let[a,c]of o)if(su(i,s,a,c))return!0;return!1},yCe=(e,t)=>((n,o)=>!(o.length<3)&&(!!o.some((r)=>fCe(r,n))||(!!u$e(n).some((r)=>Nce(r,o))||sXt(n,o))))(rXt(e),t),aXt=(e,t)=>((n,o)=>!(o.length<3)&&(!!u$e(n).every((r)=>Nce(r,o))&&!sXt(n,o)))(rXt(e),t);function Pi(e){let t=e.width/2,n=e.height/2;return{minX:e.center.x-t,maxX:e.center.x+t,minY:e.center.y-n,maxY:e.center.y+n}}function Mf(e,t,n){return Math.max(t,Math.min(n,e))}function s_(e,t,n,o){if(e.x===t.x&&e.y===t.y)return oc(e,n,o);if(n.x===o.x&&n.y===o.y)return oc(n,e,t);if(su(e,t,n,o))return 0;let r=[oc(e,n,o),oc(t,n,o),oc(n,e,t),oc(o,e,t)];return Math.min(...r)}function AV(e,t,n){let o={x:n.minX,y:n.minY},r={x:n.maxX,y:n.minY},i={x:n.minX,y:n.maxY},s={x:n.maxX,y:n.maxY};if(su(e,t,o,r)||su(e,t,r,s)||su(e,t,s,i)||su(e,t,i,o))return 0;if(e.x>=n.minX&&e.x<=n.maxX&&e.y>=n.minY&&e.y<=n.maxY&&t.x>=n.minX&&t.x<=n.maxX&&t.y>=n.minY&&t.y<=n.maxY)return 0;let a=[oc(o,e,t),oc(r,e,t),oc(i,e,t),oc(s,e,t)];if(e.x>=n.minX&&e.x<=n.maxX&&e.y>=n.minY&&e.y<=n.maxY)return 0;if(t.x>=n.minX&&t.x<=n.maxX&&t.y>=n.minY&&t.y<=n.maxY)return 0;if(e.x<n.minX||e.x>n.maxX||e.y<n.minY||e.y>n.maxY){let c=Mf(e.x,n.minX,n.maxX),l=Mf(e.y,n.minY,n.maxY);a.push(Dn(e,{x:c,y:l}))}if(t.x<n.minX||t.x>n.maxX||t.y<n.minY||t.y>n.maxY){let c=Mf(t.x,n.minX,n.maxX),l=Mf(t.y,n.minY,n.maxY);a.push(Dn(t,{x:c,y:l}))}return Math.min(...a)}function iS(e,t,n){let o=n.width/2,r=n.height/2;return AV(e,t,{minX:n.center.x-o,maxX:n.center.x+o,minY:n.center.y-r,maxY:n.center.y+r})}function gQ(e,t,n){let o={x:n.x,y:n.y};if(e.x===t.x&&e.y===t.y)return Math.max(0,Dn(e,o)-n.radius);let r=t.x-e.x,i=t.y-e.y,s=o.x-e.x,a=o.y-e.y,c=r*r+i*i,l=Math.max(0,Math.min(1,(r*s+i*a)/c)),h=Dn({x:e.x+l*r,y:e.y+l*i},o);return Math.max(0,h-n.radius)}function mm(e,t,n){let o=n.x-t.x,r=n.y-t.y,i=o*o+r*r;if(i===0)return{x:t.x,y:t.y};let s=((e.x-t.x)*o+(e.y-t.y)*r)/i;return s=Math.max(0,Math.min(1,s)),{x:t.x+s*o,y:t.y+s*r}}var tje=(e,t)=>{let n=t.x-e.x,o=t.y-e.y,r=Math.sqrt(n**2+o**2);return{x:n/r,y:o/r}};function _S(e,t){let n=t.width/2,o=t.height/2,r=t.center.x-n,i=t.center.x+n,s=t.center.y-o,a=t.center.y+o;if(e.x>=r&&e.x<=i&&e.y>=s&&e.y<=a)return 0;return Dn(e,{x:Mf(e.x,r,i),y:Mf(e.y,s,a)})}function cXt(e,t){if(e.x>=t.minX&&e.x<=t.maxX&&e.y>=t.minY&&e.y<=t.maxY)return 0;return Dn(e,{x:Mf(e.x,t.minX,t.maxX),y:Mf(e.y,t.minY,t.maxY)})}function JO(e,t){return{x:(e.x+t.x)/2,y:(e.y+t.y)/2}}function z7(e,t){let n=e.x-t.x,o=e.y-t.y;return n*n+o*o}var Sw=(e,t)=>!(e.maxX<t.minX||t.maxX<e.minX||e.maxY<t.minY||t.maxY<e.minY),Md=(e)=>{let{center:t,width:n,height:o}=e,r=n/2,i=o/2;return{minX:t.x-r,maxX:t.x+r,minY:t.y-i,maxY:t.y+i}},p$e=(e)=>{if(e.length===0)return null;let t=e[0].x,n=e[0].y,o=e[0].x,r=e[0].y;for(let i=1;i<e.length;i++){let s=e[i];s.x<t&&(t=s.x),s.y<n&&(n=s.y),s.x>o&&(o=s.x),s.y>r&&(r=s.y)}return{minX:t,minY:n,maxX:o,maxY:r}},JC=0.0001,dmr=class extends fa{constructor(e){super(),this.input=e,this.input.bounds&&((t)=>{let{minX:n,maxX:o,minY:r,maxY:i}=t;if(![n,o,r,i].every(Number.isFinite))throw Error(`ExpandEdgesToEmptySpaceSolver bounds must be finite, got ${JSON.stringify(t)}`);if(n>o||r>i)throw Error(`ExpandEdgesToEmptySpaceSolver bounds must satisfy minX <= maxX and minY <= maxY, got ${JSON.stringify(t)}`)})(this.input.bounds),this.unprocessedSegments=[...this.input.segmentsWithAdjacentEmptySpace],this.rectSpatialIndex=new gV,this.rectSpatialIndex.load(this.input.boardVoid?.boardVoidRects.map((t,n)=>({capacityMeshNodeId:`void-rect-${n}`,center:{x:t.x+t.width/2,y:t.y+t.height/2},width:t.width,height:t.height,availableZ:Array.from({length:this.input.boardVoid?.layerCount||0},(o,r)=>r),layer:"void",minX:t.x,minY:t.y,maxX:t.x+t.width,maxY:t.y+t.height}))||[]),this.rectSpatialIndex.load(this.input.inputMeshNodes.map((t)=>({...t,minX:t.center.x-t.width/2,minY:t.center.y-t.height/2,maxX:t.center.x+t.width/2,maxY:t.center.y+t.height/2})))}input;unprocessedSegments=[];expandedSegments=[];lastSegment=null;lastSearchBounds=null;lastCollidingNodes=null;lastSearchCorner1=null;lastSearchCorner2=null;lastExpandedSegment=null;rectSpatialIndex;_step(){if(this.unprocessedSegments.length===0)return void(this.solved=!0);let e=this.unprocessedSegments.shift();this.lastSegment=e;let t=this.input.bounds,n=e;if(t){let C=((b,I)=>{let v={...b.start},P={...b.end};if(sFt[b.facingDirection].dx!==0){if(v.x<I.minX||v.x>I.maxX)return null;v.y=Math.max(I.minY,Math.min(I.maxY,v.y)),P.y=Math.max(I.minY,Math.min(I.maxY,P.y))}else{if(v.y<I.minY||v.y>I.maxY)return null;v.x=Math.max(I.minX,Math.min(I.maxX,v.x)),P.x=Math.max(I.minX,Math.min(I.maxX,P.x))}return{...b,start:v,end:P}})(e,t);if(!C)return;n=C,this.lastSegment=C}let{dx:o,dy:r}=sFt[n.facingDirection],i=n.end.x-n.start.x,s=n.end.y-n.start.y,a=Math.sqrt(i**2+s**2);if(a<JC)return;let c=i/a,l=s/a,h=t?((C,b)=>{switch(C.facingDirection){case"x+":return b.maxX-C.start.x;case"x-":return C.start.x-b.minX;case"y+":return b.maxY-C.start.y;case"y-":return C.start.y-b.minY}})(n,t):1/0;if(h<JC)return;let d={x:n.start.x+o*JC+c*JC*10,y:n.start.y+r*JC+l*JC*10},u={x:n.end.x+o*JC-c*JC*10,y:n.end.y+r*JC-l*JC*10};this.lastSearchCorner1=d,this.lastSearchCorner2=u;let _=[];for(let C=1;t||C<1000;C*=4){let b=Math.min(C,h),I=lFt([d,u,{x:d.x+o*b,y:d.y+r*b},{x:u.x+o*b,y:u.y+r*b}]);if(this.lastSearchBounds=I,_=this.rectSpatialIndex.search(I).filter((v)=>v.availableZ.includes(n.z)).filter((v)=>v.capacityMeshNodeId!==n.parent.capacityMeshNodeId),_.length>0)break;if(C>=h)break}if(_.length===0&&!t)return;this.lastCollidingNodes=_;let p=h;for(let C of _){let b=iS(n.start,n.end,C);b<p&&(p=b)}let m=p,A=lFt([n.start,n.end,{x:n.start.x+o*m,y:n.start.y+r*m},{x:n.end.x+o*m,y:n.end.y+r*m}]),g={x:(A.minX+A.maxX)/2,y:(A.minY+A.maxY)/2},f=A.maxX-A.minX,y=A.maxY-A.minY,x={segment:n,newNode:{capacityMeshNodeId:`new-${n.parent.capacityMeshNodeId}-${this.expandedSegments.length}`,center:g,width:f,height:y,availableZ:[n.z],layer:n.parent.layer}};this.lastExpandedSegment=x,f<JC||y<JC||(this.expandedSegments.push(x),this.rectSpatialIndex.insert({...x.newNode,...A}))}getOutput(){return{expandedSegments:this.expandedSegments}}visualize(){let e={title:"ExpandEdgesToEmptySpace",coordinateSystem:"cartesian",rects:[],points:[],lines:[],circles:[],infiniteLines:[],polygons:[],arrows:[],texts:[]};for(let t of this.input.inputMeshNodes)e.rects.push({center:t.center,width:t.width,height:t.height,stroke:"rgba(0, 0, 0, 0.1)",layer:`z${t.availableZ.join(",")}`,label:[`node ${t.capacityMeshNodeId}`,`z:${t.availableZ.join(",")}`].join(`
`)});for(let{newNode:t}of this.expandedSegments)e.rects.push({center:t.center,width:t.width,height:t.height,fill:"green",label:`expandedSegment (z=${t.availableZ.join(",")})`,layer:`z${t.availableZ.join(",")}`});if(this.lastSegment&&e.lines.push({points:[this.lastSegment.start,this.lastSegment.end],strokeColor:"rgba(0, 0, 255, 0.5)"}),this.lastSearchBounds&&e.rects.push({center:{x:(this.lastSearchBounds.minX+this.lastSearchBounds.maxX)/2,y:(this.lastSearchBounds.minY+this.lastSearchBounds.maxY)/2},width:this.lastSearchBounds.maxX-this.lastSearchBounds.minX,height:this.lastSearchBounds.maxY-this.lastSearchBounds.minY,fill:"rgba(0, 0, 255, 0.25)"}),this.lastSearchCorner1&&this.lastSearchCorner2&&(e.points.push({x:this.lastSearchCorner1.x,y:this.lastSearchCorner1.y,color:"rgba(0, 0, 255, 0.5)",label:["searchCorner1",`z=${this.lastSegment?.z}`].join(`
`)}),e.points.push({x:this.lastSearchCorner2.x,y:this.lastSearchCorner2.y,color:"rgba(0, 0, 255, 0.5)",label:["searchCorner2",`z=${this.lastSegment?.z}`].join(`
`)})),this.lastExpandedSegment&&e.rects.push({center:this.lastExpandedSegment.newNode.center,width:this.lastExpandedSegment.newNode.width,height:this.lastExpandedSegment.newNode.height,fill:"purple",label:`expandedSegment (z=${this.lastExpandedSegment.segment.z})`}),this.lastCollidingNodes)for(let t of this.lastCollidingNodes)e.rects.push({center:t.center,width:t.width,height:t.height,fill:"rgba(255, 0, 0, 0.5)"});return e}},umr=class extends mS{findSegmentsWithAdjacentEmptySpaceSolver;expandEdgesToEmptySpaceSolver;outputNodes=[];passExpandedCounts=[];currentPassNodes=[];currentTargetNodes=[];currentPassIndex=0;expandedNodeIds=new Set;maxGapFillPasses=1;pipelineDef=[b0("findSegmentsWithAdjacentEmptySpaceSolver",omr,(e)=>[{allMeshNodes:e.currentPassNodes,targetMeshNodes:e.currentTargetNodes}],{onSolved:()=>{}}),b0("expandEdgesToEmptySpaceSolver",dmr,(e)=>[{inputMeshNodes:e.currentPassNodes,segmentsWithAdjacentEmptySpace:e.findSegmentsWithAdjacentEmptySpaceSolver.getOutput().segmentsWithAdjacentEmptySpace,boardVoid:e.inputProblem.boardVoid,bounds:e.inputProblem.bounds}],{onSolved:(e)=>{e.completePass()}})];_setup(){this.outputNodes=[...this.inputProblem.meshNodes],this.currentPassNodes=[...this.inputProblem.meshNodes],this.currentTargetNodes=[...this.inputProblem.meshNodes],this.passExpandedCounts=[],this.currentPassIndex=0,this.expandedNodeIds.clear();let e=this.inputProblem.maxGapFillPasses;this.maxGapFillPasses=Number.isFinite(e)?Math.max(1,Math.floor(e)):1}completePass(){let e=(this.expandEdgesToEmptySpaceSolver?.getOutput().expandedSegments??[]).map((t)=>t.newNode);for(let t of e)this.expandedNodeIds.add(t.capacityMeshNodeId);this.passExpandedCounts.push(e.length),this.currentPassNodes=[...this.currentPassNodes,...e],this.currentTargetNodes=e,this.outputNodes=this.currentPassNodes,e.length===0||this.currentPassIndex+1>=this.maxGapFillPasses||(this.currentPassIndex+=1,this.currentPipelineStageIndex=-1)}getOutput(){return{outputNodes:this.outputNodes.length?this.outputNodes:this.inputProblem.meshNodes}}initialVisualize(){let e={title:"GapFillSolverPipeline - Initial",coordinateSystem:"cartesian",rects:[],points:[],lines:[],circles:[],infiniteLines:[],polygons:[],arrows:[],texts:[]};for(let t of this.inputProblem.meshNodes)e.rects.push({center:t.center,width:t.width,height:t.height,stroke:"rgba(0, 0, 0, 0.3)",fill:"rgba(100, 100, 100, 0.1)",layer:`z${t.availableZ.join(",")}`,label:[`node ${t.capacityMeshNodeId}`,`z:${t.availableZ.join(",")}`].join(`
`)});return e}finalVisualize(){let e={title:"GapFillSolverPipeline - Final",coordinateSystem:"cartesian",rects:[],points:[],lines:[],circles:[],infiniteLines:[],polygons:[],arrows:[],texts:[]},{outputNodes:t}=this.getOutput();for(let n of t){let o=this.expandedNodeIds.has(n.capacityMeshNodeId);e.rects.push({center:n.center,width:n.width,height:n.height,stroke:o?"rgba(0, 128, 0, 0.8)":"rgba(0, 0, 0, 0.3)",fill:o?"rgba(0, 200, 0, 0.3)":"rgba(100, 100, 100, 0.1)",layer:`z${n.availableZ.join(",")}`,label:[`${o?"[expanded] ":""}node ${n.capacityMeshNodeId}`,`z:${n.availableZ.join(",")}`].join(`
`)})}return e}};function hFt(e){let t=e.toLowerCase();if(t==="top")return-1e6;if(t==="bottom")return 1e6;let n=/^inner(\d+)$/i.exec(t);return n?parseInt(n[1],10)||0:100+t.charCodeAt(0)}function m$e(e){let t=function(l){return Array.from(new Set(l)).sort((h,d)=>{let u=hFt(h),_=hFt(d);return u!==_?u-_:h.localeCompare(d)})}((e.obstacles??[]).flatMap((l)=>l.layers??[])),n=Math.max(1,e.layerCount||t.length||1),o=Array.from({length:n},(l,h)=>h===0?"top":h===n-1?"bottom":`inner${h}`),r=[],i=new Set,s=(l)=>{let h=l.toLowerCase();i.has(h)||(i.add(h),r.push(l))};o.forEach(s),t.forEach(s);let a=r.slice(0,n),c=new Map;return a.forEach((l,h)=>c.set(l.toLowerCase(),h)),r.slice(a.length).forEach((l)=>{let h=l.toLowerCase();c.set(h,((d)=>{if(a.length<=1)return 0;if(d==="top")return 0;if(d==="bottom")return a.length-1;let u=/^inner(\d+)$/i.exec(d);if(u){if(a.length<=2)return a.length-1;let _=parseInt(u[1],10),p=a.length-2;return Math.min(p,Math.max(1,Number.isFinite(_)?_:1))}return 0})(h))}),{layerNames:a,zIndexByName:c}}function _$e(e,t){if(e.zLayers?.length)return Array.from(new Set(e.zLayers)).sort((o,r)=>o-r);let n=(e.layers??[]).map((o)=>t.get(o.toLowerCase())).filter((o)=>typeof o=="number");return Array.from(new Set(n)).sort((o,r)=>o-r)}function g$e(e){let{width:t,height:n}=e;return typeof t!="number"||typeof n!="number"?null:{x:e.center.x-t/2,y:e.center.y-n/2,width:t,height:n}}var xCe=(e)=>{let t=[{fill:"#dbeafe",stroke:"#3b82f6"},{fill:"#fef3c7",stroke:"#f59e0b"},{fill:"#d1fae5",stroke:"#10b981"},{fill:"#e9d5ff",stroke:"#a855f7"},{fill:"#fed7aa",stroke:"#f97316"},{fill:"#fecaca",stroke:"#ef4444"}];return t[Math.min(...e)%t.length]},rr=0.000000001,dFt=(e,t)=>e>t+rr,lXt=(e,t)=>e>t-rr,uFt=(e,t)=>e<t-rr,hXt=(e,t)=>e<t+rr;function ZR(e,t){return!(e.x+e.width<=t.x+rr||t.x+t.width<=e.x+rr||e.y+e.height<=t.y+rr||t.y+t.height<=e.y+rr)}function mce(e,t){let n=t.x,o=t.x+t.width,r=t.y,i=t.y+t.height;if(e.x>=n&&e.x<=o&&e.y>=r&&e.y<=i)return Math.min(e.x-n,o-e.x,e.y-r,i-e.y);let s=e.x<n?n-e.x:e.x>o?e.x-o:0,a=e.y<r?r-e.y:e.y>i?e.y-i:0;return s===0?a:a===0?s:Math.hypot(s,a)}function pFt(e,t){let n=Math.max(e[0],t[0]),o=Math.min(e[1],t[1]);return o>n+rr?[n,o]:null}function dXt(e,t){if(!ZR(e,t))return[e];let n=pFt([e.x,e.x+e.width],[t.x,t.x+t.width]),o=pFt([e.y,e.y+e.height],[t.y,t.y+t.height]);if(!n||!o)return[e];let[r,i]=n,[s,a]=o,c=[];r>e.x+rr&&c.push({x:e.x,y:e.y,width:r-e.x,height:e.height}),e.x+e.width>i+rr&&c.push({x:i,y:e.y,width:e.x+e.width-i,height:e.height});let l=Math.max(0,i-r);return l>rr&&s>e.y+rr&&c.push({x:r,y:e.y,width:l,height:s-e.y}),l>rr&&e.y+e.height>a+rr&&c.push({x:r,y:a,width:l,height:e.y+e.height-a}),c.filter((h)=>h.width>rr&&h.height>rr)}var A$e=(e,t)=>!t||t<=0?e:{x:e.x-t,y:e.y-t,width:e.width+2*t,height:e.height+2*t},TR=(e)=>({x:e.center.x-e.width/2,y:e.center.y-e.height/2,width:e.width,height:e.height}),mFt=(e)=>e.width*e.height,qUe=(e)=>({...e,center:{...e.center},availableZ:[...e.availableZ]}),_Ft=(e,t,n)=>({...e,capacityMeshNodeId:n,center:{x:t.x+t.width/2,y:t.y+t.height/2},width:t.width,height:t.height,availableZ:[...e.availableZ],layer:`z${e.availableZ.join(",")}`}),mae=(e)=>!e._containsObstacle&&!e._containsTarget,gFt=(e,t)=>e.availableZ.length===1&&e.availableZ[0]===t,pmr=(e,t)=>Math.abs(e.x-t.x)<=rr&&Math.abs(e.y-t.y)<=rr&&Math.abs(e.width-t.width)<=rr&&Math.abs(e.height-t.height)<=rr,uXt=(e,t)=>{let n=[e];for(let o of t){if(n.length===0)return n;let r=[];for(let i of n)r.push(...dXt(i,o));n=r}return n},AFt=(e,t)=>uXt(e,t).length===0,mmr=class extends fa{constructor(e){super(),this.input=e}input;outputNodes=[];promotedNodeIds=new Set;residualNodeIds=new Set;_setup(){this.outputNodes=this.input.meshNodes.map(qUe),this.promotedNodeIds.clear(),this.residualNodeIds.clear()}_step(){this.outputNodes=this.processOuterLayerContainmentMerges(),this.solved=!0}processOuterLayerContainmentMerges(){let e=this.input.simpleRouteJson,t=Math.max(1,e.layerCount||1);if(t<3)return this.input.meshNodes.map(qUe);let n=t-1,o=Math.max(e.minViaDiameter??0,e.minTraceWidth||0),r=this.input.meshNodes.map(qUe),i=this.buildObstaclesByLayer(t);if(!i.slice(1,-1).some((m)=>m.some((A)=>A.obstacle.isCopperPour)))return r;let s=r.filter((m)=>mae(m)&&(gFt(m,0)||gFt(m,n))),a=r.filter((m)=>!mae(m)),c=a.filter((m)=>m.availableZ.includes(0)||m.availableZ.includes(n)).map(TR),l=new Map;l.set(0,r.filter((m)=>mae(m)&&m.availableZ.includes(0))),l.set(n,r.filter((m)=>mae(m)&&m.availableZ.includes(n)));let h=[],d=[],u=s.filter((m)=>m.width+rr>=o&&m.height+rr>=o).sort((m,A)=>mFt(TR(A))-mFt(TR(m)));for(let m of u){let A=m.availableZ[0],g=A===0?n:0,f=TR(m);if(c.some((b)=>ZR(b,f)))continue;let y=(l.get(g)??[]).filter((b)=>ZR(f,TR(b))),x=y[0]?.availableZ;if(!x)continue;if(d.some((b)=>ZR(f,b)))continue;if(!this.isTransitCompatibleAcrossIntermediateLayers({rect:f,fromZ:A,toZ:g,obstaclesByLayer:i}))continue;if(!AFt(f,y.map(TR)))continue;let C=y.every((b)=>b.availableZ.length===x.length&&b.availableZ.every((I)=>x.includes(I)))?[{rect:f,availableZ:x}]:y.map((b)=>{let I=TR(b),v=Math.max(f.x,I.x),P=Math.max(f.y,I.y);return{rect:{x:v,y:P,width:Math.min(f.x+f.width,I.x+I.width)-v,height:Math.min(f.y+f.height,I.y+I.height)-P},availableZ:b.availableZ}});for(let[b,I]of C.entries()){if(I.rect.width+rr<o||I.rect.height+rr<o)continue;let v=[...new Set([A,...I.availableZ])].sort((M,B)=>M-B),P=b===0?m.capacityMeshNodeId:`${m.capacityMeshNodeId}-outer-support-${b}`;h.push(_Ft({...m,availableZ:v},I.rect,P)),d.push(I.rect),this.promotedNodeIds.add(P)}}if(h.length===0)return r;let _=0,p=[];for(let m of r.filter(mae)){let A=TR(m);if(m.availableZ.filter((f)=>f===0||f===n).length===0){p.push(m);continue}let g=uXt(A,d);if(g.length===1&&pmr(g[0],A))p.push(m);else for(let f of g){let y=_Ft(m,f,`${m.capacityMeshNodeId}-outer-merge-${_++}`);p.push(y),this.residualNodeIds.add(y.capacityMeshNodeId)}}return[...a,...h,...p]}buildObstaclesByLayer(e){let t=Array.from({length:e},()=>[]);for(let n of this.input.simpleRouteJson.obstacles??[]){let o=g$e(n);if(!o)continue;let r=A$e(o,this.input.obstacleClearance??0),i=_$e(n,this.input.zIndexByName);for(let s of i)s<0||s>=e||t[s].push({obstacle:n,rect:r})}return t}isTransitCompatibleAcrossIntermediateLayers(e){let{rect:t,fromZ:n,toZ:o,obstaclesByLayer:r}=e,i=Math.min(n,o),s=Math.max(n,o);if(s-i<2)return!1;let a=!1;for(let c=i+1;c<s;c++){let l=(r[c]??[]).filter((h)=>ZR(h.rect,t));if(l.length===0)continue;if(l.some((h)=>!h.obstacle.isCopperPour))return!1;if(!AFt(t,l.map((h)=>h.rect)))return!1;a=!0}return a}getOutput(){return{outputNodes:this.outputNodes}}visualize(){return{title:"OuterLayerContainmentMergeSolver",coordinateSystem:"cartesian",rects:this.outputNodes.map((e)=>{let t=xCe(e.availableZ),n=this.promotedNodeIds.has(e.capacityMeshNodeId),o=this.residualNodeIds.has(e.capacityMeshNodeId);return{center:e.center,width:e.width,height:e.height,stroke:n?"rgba(22, 163, 74, 0.95)":o?"rgba(37, 99, 235, 0.95)":t.stroke,fill:e._containsObstacle?"rgba(239, 68, 68, 0.35)":n?"rgba(34, 197, 94, 0.28)":o?"rgba(59, 130, 246, 0.18)":t.fill,layer:`z${e.availableZ.join(",")}`,label:[`node ${e.capacityMeshNodeId}`,`z:${e.availableZ.join(",")}`].join(`
`)}}),points:[],lines:[],texts:[]}}},B4e=0.000000001,_mr=(e)=>Math.abs(e.rect.x+e.rect.width/2-e.startX)<B4e&&Math.abs(e.rect.y+e.rect.height/2-e.startY)<B4e&&Math.abs(e.rect.width-e.initialW)<B4e&&Math.abs(e.rect.height-e.initialH)<B4e,gmr=({rect:e,bounds:t})=>({x:e.x,y:e.y,width:t.x+t.width-e.x,height:e.height}),Amr=({rect:e,bounds:t})=>({x:e.x,y:e.y,width:e.width,height:t.y+t.height-e.y}),fmr=({rect:e,bounds:t})=>({x:t.x,y:e.y,width:e.x-t.x,height:e.height}),ymr=({rect:e,bounds:t})=>({x:e.x,y:t.y,width:e.width,height:e.y-t.y}),T4e=(e,t=0.000001)=>Math.round(e/t)*t,xmr=(e)=>({x:T4e(e.x),y:T4e(e.y),width:T4e(e.width),height:T4e(e.height)});function Cmr(e){let{r:t,bounds:n,blockers:o,maxAspect:r}=e,i=n.x+n.width-t.x;for(let a of o)if(t.y+t.height>a.y+rr&&a.y+a.height>t.y+rr){if(lXt(a.x,t.x+t.width))i=Math.min(i,a.x-t.x);else if(a.x+a.width>t.x+t.width-rr&&a.x<t.x+t.width+rr)return 0}let s=Math.max(0,i-t.width);if(s<=0)return 0;if(r!=null){let{width:a,height:c}=t;a>=c&&(s=Math.min(s,r*c-a))}return Math.max(0,s)}function bmr(e){let{r:t,bounds:n,blockers:o,maxAspect:r}=e,i=n.y+n.height-t.y;for(let a of o)if(t.x+t.width>a.x+rr&&a.x+a.width>t.x+rr){if(lXt(a.y,t.y+t.height))i=Math.min(i,a.y-t.y);else if(a.y+a.height>t.y+t.height-rr&&a.y<t.y+t.height+rr)return 0}let s=Math.max(0,i-t.height);if(s<=0)return 0;if(r!=null){let{width:a,height:c}=t;c>=a&&(s=Math.min(s,r*a-c))}return Math.max(0,s)}function Imr(e){let{r:t,bounds:n,blockers:o,maxAspect:r}=e,i=n.x;for(let a of o)if(t.y+t.height>a.y+rr&&a.y+a.height>t.y+rr){if(hXt(a.x+a.width,t.x))i=Math.max(i,a.x+a.width);else if(a.x<t.x+rr&&a.x+a.width>t.x-rr)return 0}let s=Math.max(0,t.x-i);if(s<=0)return 0;if(r!=null){let{width:a,height:c}=t;a>=c&&(s=Math.min(s,r*c-a))}return Math.max(0,s)}function vmr(e){let{r:t,bounds:n,blockers:o,maxAspect:r}=e,i=n.y;for(let a of o)if(t.x+t.width>a.x+rr&&a.x+a.width>t.x+rr){if(hXt(a.y+a.height,t.y))i=Math.max(i,a.y+a.height);else if(a.y<t.y+rr&&a.y+a.height>t.y-rr)return 0}let s=Math.max(0,t.y-i);if(s<=0)return 0;if(r!=null){let{width:a,height:c}=t;c>=a&&(s=Math.min(s,r*a-c))}return Math.max(0,s)}var fFt=(e)=>{let{rect:t,seen:n,blockers:o}=e;n.has(t)||(n.add(t),o.push(t))};function pXt(e){let{startX:t,startY:n,gridSize:o,bounds:r,obsticalIndexByLayer:i,placedIndexByLayer:s,initialCellRatio:a,maxAspectRatio:c,minReq:l}=e,h=Math.max(0.000000001,o*a),d=Math.max(h,l.width),u=Math.max(h,l.height),_=[],p=new Set,m=s.length,A=[],g=(C)=>{let b=((I)=>{let{bounds:v,rect:P}=I,M=Math.max(v.x,P.x),B=Math.max(v.y,P.y),T=Math.min(v.x+v.width,P.x+P.width),N=Math.min(v.y+v.height,P.y+P.height);return T<=M+rr||N<=B+rr?null:{minX:M,minY:B,maxX:T,maxY:N}})({bounds:r,rect:C});if(b){for(let I of A)if(I.minX<=b.minX&&I.minY<=b.minY&&I.maxX>=b.maxX&&I.maxY>=b.maxY)return;for(let I of e.zLayers){let v=i[I];if(v)for(let M of v.search(b))fFt({rect:M,seen:p,blockers:_});let P=s[I];if(P)for(let M of P.search(b))M.zLayers.length>=m&&(_mr({rect:M,startX:t,startY:n,initialW:d,initialH:u})||fFt({rect:M,seen:p,blockers:_}))}for(let I=A.length-1;I>=0;I--){let v=A[I];b.minX<=v.minX&&b.minY<=v.minY&&b.maxX>=v.maxX&&b.maxY>=v.maxY&&A.splice(I,1)}A.push(b)}},f=[{ox:0,oy:0},{ox:-d,oy:0},{ox:0,oy:-u},{ox:-d,oy:-u},{ox:-d/2,oy:-u/2}],y=null,x=0;e:for(let C of f){let b={x:t+C.ox,y:n+C.oy,width:d,height:u};if(g(b),uFt(b.x,r.x)||uFt(b.y,r.y)||dFt(b.x+b.width,r.x+r.width)||dFt(b.y+b.height,r.y+r.height))continue;for(let B of _)if(ZR(b,B))continue e;let I=0.000001,v=1000,P=!0,M=0;for(;P&&M<v;){M++,P=!1;let B={bounds:r,blockers:_,maxAspect:c};g(gmr({rect:b,bounds:r}));let T=Cmr({...B,r:b});T>I&&(b={...b,width:b.width+T},g(b),P=!0),g(Amr({rect:b,bounds:r}));let N=bmr({...B,r:b});N>I&&(b={...b,height:b.height+N},g(b),P=!0),g(fmr({rect:b,bounds:r}));let D=Imr({...B,r:b});D>I&&(b={x:b.x-D,y:b.y,width:b.width+D,height:b.height},g(b),P=!0),g(ymr({rect:b,bounds:r}));let L=vmr({...B,r:b});L>I&&(b={x:b.x,y:b.y-L,width:b.width,height:b.height+L},g(b),P=!0)}if(b.width+rr>=l.width&&b.height+rr>=l.height){let B=b.width*b.height;B>x&&(y=xmr(b),x=B)}}return y}function Smr(e){let t=Math.max(e.width,e.height);return[t/8,t/16,t/32]}function nje(e){let t={minX:e.point.x,minY:e.point.y,maxX:e.point.x,maxY:e.point.y};for(let n=0;n<e.layerCount;n++){let o=e.obstacleIndexByLayer[n],r=!!o&&o.collides(t),i=e.placedIndexByLayer[n],s=!!i&&i.collides(t);if(!r&&!s)return!1}return!0}function oje(e){let{x:t,y:n,z:o,layerCount:r,minSpan:i,maxSpan:s,obstacleIndexByLayer:a,additionalBlockersByLayer:c}=e,l=(_)=>{let p={minX:t,minY:n,maxX:t,maxY:n},m=a[_];if(m&&m.collides(p))return!1;return!(c?.[_]??[]).some((A)=>{return(f={x:t,y:n}).x>=(g=A).x-rr&&f.x<=g.x+g.width+rr&&f.y>=g.y-rr&&f.y<=g.y+g.height+rr;var g,f})},h=o,d=o;for(;h-1>=0&&l(h-1);)h--;for(;d+1<r&&l(d+1);)d++;if(typeof s=="number"){let _=((p,m,A)=>Math.max(m,Math.min(A,p)))(s,1,r);for(;d-h+1>_;)o-h>d-o?h++:d--}let u=[];for(let _=h;_<=d;_++)u.push(_);return u.length>=i?u:[]}var Pmr=(e,t=0.000001)=>Math.round(e/t)*t,L4=(e,t=0.000001)=>Math.round(e/t)*t,Emr=(e)=>("minX"in e)?{x:e.minX,y:e.minY,width:e.maxX-e.minX,height:e.maxY-e.minY}:e;function Mmr(e){let{segment:t,coveringIntervals:n,hasReversedIntervals:o,minSegmentLength:r}=e,i=L4(t.lineStart),s=L4(t.lineEnd),a=L4(t.clipStart),c=L4(t.clipEnd),l=[];if(o||a>c)l=n.filter((_)=>_.sourceIndex!==t.sourceIndex).map((_)=>{let p=Math.max(a,_.start),m=Math.min(c,_.end);return{start:Math.min(p,m),end:Math.max(p,m)}}).filter((_)=>_.end>_.start+rr).sort((_,p)=>_.start-p.start);else{let _=1/0,p=-1/0;for(let m of n){if(m.sourceIndex===t.sourceIndex)continue;let A=Math.max(a,m.start),g=Math.min(c,m.end);g<A?m.end<a?_=Math.min(_,g):p=Math.max(p,A):g>A+rr&&l.push({start:A,end:g})}a>_+rr&&l.unshift({start:_,end:a}),p>c+rr&&l.push({start:c,end:p})}if(l.length===0)return[{start:i,end:s,center:(i+s)/2}];let h=[],d=l[0].start,u=l[0].end;d>i+rr&&d-i>=r&&h.push({start:i,end:d,center:(i+d)/2});for(let _=1;_<l.length;_++){let p=l[_];p.start<=u+rr?u=Math.max(u,p.end):(p.start-u>=r&&h.push({start:u,end:p.start,center:(u+p.start)/2}),u=p.end)}return u<s-rr&&s-u>=r&&h.push({start:u,end:s,center:(u+s)/2}),h}function wmr(e){let{bounds:t,minSize:n,layerCount:o,obstacleIndexByLayer:r,placedIndexByLayer:i,hardPlacedByLayer:s}=e,a=[],c=Math.max(0.15*n,3*rr),l=0,h=new Map,d=Array.from({length:o},(m,A)=>[...r[A]?.all()??[],...s[A]??[]].map(Emr)),u=d.map((m)=>{if(m.length===0)return null;let A=new i_(m.length);for(let g of m){let f=g.x+g.width,y=g.y+g.height;A.add(Math.min(g.x,f),Math.min(g.y,y),Math.max(g.x,f),Math.max(g.y,y))}return A.finish(),A});function _(m){let A=L4(m.x),g=L4(m.y),{z:f}=m,y=A,x=g;if(y<t.x+rr||x<t.y+rr||y>t.x+t.width-rr||x>t.y+t.height-rr)return;let C=((I)=>`${I.z}|${I.x.toFixed(6)}|${I.y.toFixed(6)}`)({x:y,y:x,z:f}),b=h.get(C);b&&(b.order<m.order||b.order===m.order&&b.pointOrder<=m.pointOrder)||function(I){return nje({layerCount:o,obstacleIndexByLayer:r,placedIndexByLayer:i,point:I})}({x:y,y:x})||h.set(C,{x:y,y:x,z:f,order:m.order,pointOrder:m.pointOrder})}for(let m=0;m<o;m++){let A=(d[m]??[]).map((M)=>({x:L4(M.x),y:L4(M.y),width:L4(M.width),height:L4(M.height)})),g=A.length>0?new i_(A.length):null;if(g){for(let M of A)g.add(M.x,M.y,M.x+M.width,M.y+M.height);g.finish()}let f=new Map,y=new Map,x=(M)=>{let B=M.vertical?f:y,T=B.get(M.coordinate);T?T.push(M.edgeOrdinal):B.set(M.coordinate,[M.edgeOrdinal])},C=l,b=0,I=[{x:t.x+c,y:t.y+c},{x:t.x+t.width-c,y:t.y+c},{x:t.x+c,y:t.y+t.height-c},{x:t.x+t.width-c,y:t.y+t.height-c}];for(let M of I)_({...M,z:m,order:C+b++,pointOrder:0});let v=b;for(let M of[t.y+c,t.y+t.height-c])x({vertical:!1,coordinate:M,edgeOrdinal:b++});for(let M of[t.x+c,t.x+t.width-c])x({vertical:!0,coordinate:M,edgeOrdinal:b++});let P=b;for(let M=0;M<A.length;M++){let B=A[M];for(let T of[B.x-c,B.x+B.width+c]){let N=b++;T>t.x+rr&&T<t.x+t.width-rr&&x({vertical:!0,coordinate:T,edgeOrdinal:N})}for(let T of[B.y-c,B.y+B.height+c]){let N=b++;T>t.y+rr&&T<t.y+t.height-rr&&x({vertical:!1,coordinate:T,edgeOrdinal:N})}}l=C+b;for(let M of[!0,!1]){let B=M?f:y;for(let[T,N]of B){let D=g?M?g.search(T,-1/0,T,1/0):g.search(-1/0,T,1/0,T):[],L=[],H=!1;for(let V of D){let O=A[V];if(M?O.x>T||O.x+O.width<T:O.y>T||O.y+O.height<T)continue;let U=L4(M?O.y:O.x),j=L4(M?O.y+O.height:O.x+O.width);L.push({start:U,end:j,sourceIndex:V}),j<U&&(H=!0)}L.sort((V,O)=>V.start-O.start);for(let V of N){let O=V<P,U=V-P,j=O?void 0:Math.floor(U/4),Y=O?t:A[j],X=O?V===v||V===v+2:U%4==0||U%4==2,K=M?Y.x:Y.y,J=M?Y.width:Y.height,ee=O?X?K+c:K+J-c:X?K-c:K+J+c,se=M?Y.y:Y.x,ne=M?Y.y+Y.height:Y.x+Y.width,re=Mmr({segment:{lineStart:O?se+c:se,lineEnd:O?ne-c:ne,clipStart:se,clipEnd:ne,sourceIndex:j},coveringIntervals:L,hasReversedIntervals:H,minSegmentLength:0.5*n}),Z=0;for(let te of re){let ie=(ue)=>_({...M?{x:ee,y:ue,z:m}:{x:ue,y:ee,z:m},order:C+V,pointOrder:Z++}),ce=te.end-te.start;if(O){if(ce<n)continue;ie(te.center),ce>1.5*n&&(ie(te.start+0.4*n),ie(te.end-0.4*n))}else ie(te.center)}}}}}let p=[...h.values()].sort((m,A)=>m.order-A.order||m.pointOrder-A.pointOrder);for(let{x:m,y:A,z:g}of p){let f=d[g]??[],y=mce({x:m,y:A},t),x=u[g];if(x){let I=x.neighbors(m,A,1)[0];y=Math.min(y,mce({x:m,y:A},f[I]));let v=x.search(m-y,A-y,m+y,A+y);for(let P of v)y=Math.min(y,mce({x:m,y:A},f[P]))}let C=L4(y),b=oje({x:m,y:A,z:g,layerCount:o,minSpan:1,maxSpan:void 0,obstacleIndexByLayer:r,additionalBlockersByLayer:s});a.push({x:m,y:A,z:g,distance:C,zSpanLen:b.length,isEdgeSeed:!0})}return a.sort((m,A)=>A.zSpanLen-m.zSpanLen||A.distance-m.distance||m.z-A.z||m.x-A.x||m.y-A.y),a}var B$=(e,t)=>({...e,minX:e.x,minY:e.y,maxX:e.x+e.width,maxY:e.y+e.height,zLayers:t.zLayers});function mXt(e,t){let n=e.placed[t],{rect:o,zLayers:r}=n,i=e.layerCount,s=[],a=[];for(let l=0;l<e.placed.length;l++){if(l===t)continue;let h=e.placed[l];if(h.zLayers.length>=i)continue;if(!ZR(h.rect,o))continue;let d=h.zLayers.filter((A)=>r.includes(A));if(d.length===0)continue;let u=dXt(h.rect,o);s.push(l);let _=h.zLayers.filter((A)=>!r.includes(A));_.length>0&&a.push({rect:h.rect,zLayers:_});let p=Math.min(e.options.minSingle.width,e.options.minMulti.width),m=Math.min(e.options.minSingle.height,e.options.minMulti.height);for(let A of u)A.width+rr>=p&&A.height+rr>=m&&a.push({rect:A,zLayers:d.slice()})}let c=(l,h)=>l.minX===h.minX&&l.minY===h.minY&&l.maxX===h.maxX&&l.maxY===h.maxY;s.sort((l,h)=>h-l).forEach((l)=>{let h=e.placed.splice(l,1)[0];if(e.placedIndexByLayer)for(let d of h.zLayers){let u=e.placedIndexByLayer[d];u&&u.remove(B$(h.rect,{zLayers:h.zLayers}),c)}});for(let l of a){e.placed.push(l);for(let h of l.zLayers)if(e.placedIndexByLayer){let d=e.placedIndexByLayer[h];d&&d.insert(B$(l.rect,{zLayers:l.zLayers.slice()}))}}}var Bmr=class extends fa{constructor(e){super(),this.input=e}input;srj;layerNames;layerCount;bounds;options;boardVoidRects;gridIndex;candidates;placed;placedIndexByLayer;hardPlacedByLayer;expansionIndex;edgeAnalysisDone;totalSeedsThisGrid;consumedSeedsThisGrid;_setup(){let e=this.input.simpleRouteJson,t=this.input.gridOptions??{},n=this.input.layerNames&&this.input.zIndexByName,{layerNames:o,zIndexByName:r}=n?{layerNames:this.input.layerNames,zIndexByName:this.input.zIndexByName}:m$e({obstacles:e.obstacles,layerCount:e.layerCount}),i=Math.max(1,o.length,e.layerCount||1),s={x:e.bounds.minX,y:e.bounds.minY,width:e.bounds.maxX-e.bounds.minX,height:e.bounds.maxY-e.bounds.minY},a=Math.max(0.01,e.minTraceWidth||0.15),c={...{gridSizes:[],initialCellRatio:0.2,maxAspectRatio:3,minSingle:{width:2*a,height:2*a},minMulti:{width:4*a,height:4*a,minLayers:Math.min(2,Math.max(1,e.layerCount||1))},preferMultiLayer:!0,maxMultiLayerSpan:void 0},...t,gridSizes:t.gridSizes??Smr(s)};this.srj=e,this.layerNames=o,this.layerCount=i,this.bounds=s,this.options=c,this.boardVoidRects=this.input.boardVoidRects,this.gridIndex=0,this.candidates=[],this.placed=[],this.placedIndexByLayer=Array.from({length:i},()=>new gV),this.hardPlacedByLayer=Array.from({length:i},()=>[]),this.expansionIndex=0,this.edgeAnalysisDone=!1,this.totalSeedsThisGrid=0,this.consumedSeedsThisGrid=0,this.stats={gridIndex:this.gridIndex}}_step(){this._stepGrid(),this.stats.gridIndex=this.gridIndex,this.stats.placed=this.placed.length}_stepGrid(){let{gridSizes:e,initialCellRatio:t,maxAspectRatio:n,minSingle:o,minMulti:r,preferMultiLayer:i,maxMultiLayerSpan:s}=this.options,a=e[this.gridIndex];if(this.candidates.length===0&&this.consumedSeedsThisGrid===0&&(this.candidates=function(u){let{bounds:_,gridSize:p,layerCount:m,obstacleIndexByLayer:A,placedIndexByLayer:g,hardPlacedByLayer:f}=u,y=new Map,x=Array.from({length:m},(b,I)=>[...A[I]?.all()??[],...f[I]??[]]);for(let b=_.x;b<_.x+_.width;b+=p)for(let I=_.y;I<_.y+_.height;I+=p){if(Math.abs(b-_.x)<rr||Math.abs(I-_.y)<rr||b>_.x+_.width-p-rr||I>_.y+_.height-p-rr)continue;if(nje({layerCount:m,obstacleIndexByLayer:A,placedIndexByLayer:g,point:{x:b,y:I}}))continue;let v=[],P=0;for(let V=0;V<m;V++){let O=oje({x:b,y:I,z:V,layerCount:m,minSpan:1,maxSpan:void 0,obstacleIndexByLayer:A,additionalBlockersByLayer:f});O.length>v.length&&(v=O,P=V)}let M=v.length?v[Math.floor(v.length/2)]:P,B=x[M]??[],T=mce({x:b,y:I},_);for(let V of B)T=Math.min(T,mce({x:b,y:I},V));let N=Pmr(T),D=`${b.toFixed(6)}|${I.toFixed(6)}`,L={x:b,y:I,z:M,distance:N,zSpanLen:v.length},H=y.get(D);(!H||L.zSpanLen>(H.zSpanLen??0)||L.zSpanLen===H.zSpanLen&&L.distance>H.distance)&&y.set(D,L)}let C=Array.from(y.values());return C.sort((b,I)=>I.zSpanLen-b.zSpanLen||I.distance-b.distance||b.z-I.z||b.x-I.x||b.y-I.y),C}({bounds:this.bounds,gridSize:a,layerCount:this.layerCount,hardPlacedByLayer:this.hardPlacedByLayer,obstacleIndexByLayer:this.input.obstacleIndexByLayer,placedIndexByLayer:this.placedIndexByLayer}),this.totalSeedsThisGrid=this.candidates.length,this.consumedSeedsThisGrid=0),this.consumedSeedsThisGrid>=this.candidates.length){if(this.gridIndex+1<e.length)return this.gridIndex+=1,this.candidates=[],this.totalSeedsThisGrid=0,void(this.consumedSeedsThisGrid=0);if(!this.edgeAnalysisDone){let u=Math.min(o.width,o.height);return this.candidates=wmr({bounds:this.bounds,minSize:u,layerCount:this.layerCount,obstacleIndexByLayer:this.input.obstacleIndexByLayer,placedIndexByLayer:this.placedIndexByLayer,hardPlacedByLayer:this.hardPlacedByLayer}),this.edgeAnalysisDone=!0,this.totalSeedsThisGrid=this.candidates.length,void(this.consumedSeedsThisGrid=0)}return this.candidates=[],this.solved=!0,void(this.expansionIndex=0)}let c=this.candidates[this.consumedSeedsThisGrid++];if(nje({layerCount:this.layerCount,obstacleIndexByLayer:this.input.obstacleIndexByLayer,placedIndexByLayer:this.placedIndexByLayer,point:{x:c.x,y:c.y}}))return;let l=oje({x:c.x,y:c.y,z:c.z,layerCount:this.layerCount,minSpan:r.minLayers,maxSpan:s,obstacleIndexByLayer:this.input.obstacleIndexByLayer,additionalBlockersByLayer:this.hardPlacedByLayer}),h=[];l.length>=r.minLayers&&h.push({kind:"multi",layers:l,minReq:{width:r.width,height:r.height}}),h.push({kind:"single",layers:[c.z],minReq:{width:o.width,height:o.height}});let d=i?h:h.reverse();for(let u of d){let _=pXt({startX:c.x,startY:c.y,gridSize:a,bounds:this.bounds,obsticalIndexByLayer:this.input.obstacleIndexByLayer,placedIndexByLayer:this.placedIndexByLayer,initialCellRatio:t,maxAspectRatio:n,minReq:u.minReq,zLayers:u.layers});if(!_)continue;let p={rect:_,zLayers:[...u.layers]},m=this.placed.push(p)-1;for(let A of u.layers){let g=this.placedIndexByLayer[A];g&&g.insert(B$(_,{zLayers:p.zLayers}))}if(mXt({layerCount:this.layerCount,placed:this.placed,options:this.options,placedIndexByLayer:this.placedIndexByLayer},m),p.zLayers.length>=this.layerCount)for(let A of p.zLayers)this.hardPlacedByLayer[A].push(p.rect);return}}computeProgress(){if(this.solved)return 1;let e=this.options.gridSizes.length,t=this.gridIndex/(e+1),n=Math.max(1,this.totalSeedsThisGrid),o=n?this.consumedSeedsThisGrid/n:1;return Math.min(0.999,t+o*(1/(e+1)))}getOutput(){return{layerNames:this.layerNames,layerCount:this.layerCount,bounds:this.bounds,options:this.options,boardVoidRects:this.boardVoidRects,gridIndex:this.gridIndex,candidates:this.candidates,placed:this.placed,expansionIndex:this.expansionIndex,edgeAnalysisDone:this.edgeAnalysisDone,totalSeedsThisGrid:this.totalSeedsThisGrid,consumedSeedsThisGrid:this.consumedSeedsThisGrid,obstacles:this.srj.obstacles,obstacleClearance:this.input.obstacleClearance}}visualize(){let e=[],t=[],n=[],o=this.srj??this.input.simpleRouteJson,r=o.bounds.minX,i=o.bounds.maxX,s=o.bounds.minY,a=o.bounds.maxY;o.outline&&o.outline.length>1?n.push({points:[...o.outline,o.outline[0]],strokeColor:"#111827",strokeWidth:0.01,label:"outline"}):e.push({center:{x:(r+i)/2,y:(s+a)/2},width:i-r,height:a-s,fill:"none",stroke:"#111827",label:"board"});for(let c of o.obstacles??[])c.type!=="rect"&&c.type!=="oval"||e.push({center:{x:c.center.x,y:c.center.y},width:c.width,height:c.height,fill:"#fee2e2",stroke:"#ef4444",layer:"obstacle",label:"obstacle"});if(this.boardVoidRects){let c=null;if(o.outline&&o.outline.length>0){let l=o.outline.map((_)=>_.x),h=o.outline.map((_)=>_.y),d=Math.min(...l),u=Math.min(...h);c={x:d,y:u,width:Math.max(...l)-d,height:Math.max(...h)-u}}for(let l of this.boardVoidRects)c&&!ZR(l,c)||e.push({center:{x:l.x+l.width/2,y:l.y+l.height/2},width:l.width,height:l.height,fill:"rgba(0, 0, 0, 0.5)",stroke:"none",label:"void"})}if(this.candidates?.length)for(let c of this.candidates)t.push({x:c.x,y:c.y,label:`z:${c.z}`});if(this.placed?.length)for(let c of this.placed){let l=xCe(c.zLayers);e.push({center:{x:c.rect.x+c.rect.width/2,y:c.rect.y+c.rect.height/2},width:c.rect.width,height:c.rect.height,fill:l.fill,stroke:l.stroke,layer:`z${c.zLayers.join(",")}`,label:`free
z:${c.zLayers.join(",")}`})}return{title:"RectDiff Grid",coordinateSystem:"cartesian",rects:e,points:t,lines:n}}},Tmr=(e,t)=>e.minX===t.minX&&e.minY===t.minY&&e.maxX===t.maxX&&e.maxY===t.maxY,Dmr=class extends fa{constructor(e){super(),this.input=e}input;placedIndexByLayer=[];_meshNodes=[];_setup(){this.stats={gridIndex:this.input.gridIndex},this.placedIndexByLayer=Array.from({length:this.input.layerCount},()=>new gV);for(let e of this.input.placed)for(let t of e.zLayers){let n=this.placedIndexByLayer[t];n&&n.insert(B$(e.rect,{zLayers:e.zLayers}))}}_step(){this.solved||(this._stepExpansion(),this.stats.gridIndex=this.input.gridIndex,this.stats.placed=this.input.placed.length,this.input.expansionIndex>=this.input.placed.length&&this.finalizeIfNeeded())}_stepExpansion(){if(this.input.expansionIndex>=this.input.placed.length)return;let e=this.input.expansionIndex,t=this.input.placed[e],n=this.input.options.gridSizes[this.input.options.gridSizes.length-1],o=t.rect,r=pXt({startX:t.rect.x+t.rect.width/2,startY:t.rect.y+t.rect.height/2,gridSize:n,bounds:this.input.bounds,obsticalIndexByLayer:this.input.obstacleIndexByLayer,placedIndexByLayer:this.placedIndexByLayer,initialCellRatio:0,maxAspectRatio:null,minReq:{width:t.rect.width,height:t.rect.height},zLayers:t.zLayers});if(r){this.input.placed[e]={rect:r,zLayers:t.zLayers};for(let i of t.zLayers){let s=this.placedIndexByLayer[i];s&&(s.remove(B$(o,{zLayers:t.zLayers}),Tmr),s.insert(B$(r,{zLayers:t.zLayers})))}mXt({layerCount:this.input.layerCount,placed:this.input.placed,options:this.input.options,placedIndexByLayer:this.placedIndexByLayer},e)}this.input.expansionIndex+=1}finalizeIfNeeded(){if(this.solved)return;let e=function(t){let n=t.placed.map((o)=>({minX:o.rect.x,minY:o.rect.y,maxX:o.rect.x+o.rect.width,maxY:o.rect.y+o.rect.height,zLayers:[...o.zLayers].sort((r,i)=>r-i)}));for(let o of t.obstacles??[]){let r=g$e(o);if(!r)continue;let i=t.obstacleClearance?{x:r.x-t.obstacleClearance,y:r.y-t.obstacleClearance,width:r.width+2*t.obstacleClearance,height:r.height+2*t.obstacleClearance}:r,s=o.zLayers?.length&&o.zLayers.length>0?o.zLayers:_$e(o,t.zIndexByName);n.push({minX:i.x,minY:i.y,maxX:i.x+i.width,maxY:i.y+i.height,zLayers:[...new Set(s)].sort((a,c)=>a-c),isObstacle:!0,connectedTo:[...o.connectedTo]})}return n}({placed:this.input.placed,obstacles:this.input.obstacles,zIndexByName:this.input.zIndexByName,boardVoidRects:this.input.boardVoidRects,obstacleClearance:this.input.obstacleClearance});this._meshNodes=function(t){let n=0,o=[];for(let r of t){let i=Math.max(0,r.maxX-r.minX),s=Math.max(0,r.maxY-r.minY);i<=0||s<=0||r.zLayers.length===0||o.push({capacityMeshNodeId:"cmn_"+n++,center:{x:(r.minX+r.maxX)/2,y:(r.minY+r.maxY)/2},width:i,height:s,layer:"top",availableZ:r.zLayers.slice(),_containsObstacle:r.isObstacle,_containsTarget:r.isObstacle,...r.connectedTo?.length?{_connectedTo:[...r.connectedTo]}:{}})}return o}(e),this.solved=!0}computeProgress(){if(this.solved)return 1;let e=this.input.options.gridSizes.length,t=e/(e+1),n=Math.max(1,this.input.placed.length),o=n?this.input.expansionIndex/n:1;return Math.min(0.999,t+o*(1/(e+1)))}getOutput(){if(this.solved)return{meshNodes:this._meshNodes};return{meshNodes:this.input.placed.map((e,t)=>({capacityMeshNodeId:`expand-preview-${t}`,center:{x:e.rect.x+e.rect.width/2,y:e.rect.y+e.rect.height/2},width:e.rect.width,height:e.rect.height,availableZ:e.zLayers.slice(),layer:`z${e.zLayers.join(",")}`}))}}visualize(){let e=[];for(let t of this.input.placed??[])e.push({center:{x:t.rect.x+t.rect.width/2,y:t.rect.y+t.rect.height/2},width:t.rect.width,height:t.rect.height,stroke:"rgba(37, 99, 235, 0.9)",fill:"rgba(191, 219, 254, 0.5)",layer:`z${t.zLayers.join(",")}`,label:`expanded
z:${t.zLayers.join(",")}`});return{title:"RectDiff Expansion",coordinateSystem:"cartesian",rects:e,points:[],lines:[]}}},Nmr=class extends mS{rectDiffSeedingSolver;rectDiffExpansionSolver;obstacleIndexByLayer;layerNames;zIndexByName;constructor(e){super(e);let{obstacleIndexByLayer:t,layerNames:n,zIndexByName:o}=((r)=>{let{srj:i,boardVoidRects:s,obstacleClearance:a}=r,{layerNames:c,zIndexByName:l}=m$e({obstacles:i.obstacles,layerCount:i.layerCount}),h=Math.max(1,c.length,i.layerCount||1),d=(i.bounds.minX,i.bounds.minY,i.bounds.maxX,i.bounds.minX,i.bounds.maxY,i.bounds.minY,Array.from({length:h},()=>new gV)),u=(_,p)=>{let m={..._,minX:_.x,minY:_.y,maxX:_.x+_.width,maxY:_.y+_.height,zLayers:[p]};d[p]?.insert(m)};if(i.outline&&i.outline.length>2)for(let _ of s??[])for(let p=0;p<h;p++)u(_,p);for(let _ of i.obstacles??[]){let p=g$e(_);if(!p)continue;let m=A$e(p,a??0),A=_$e(_,l),g=A.filter((f)=>f<0||f>=h);if(g.length)throw Error(`RectDiff: obstacle uses z-layer indices ${g.join(",")} outside 0-${h-1}`);_.zLayers&&_.zLayers.length!==0||!A.length||(_.zLayers=A);for(let f of A)u(m,f)}return{obstacleIndexByLayer:d,layerNames:c,zIndexByName:l}})({srj:{bounds:e.bounds,obstacles:e.obstacles,connections:e.connections,outline:e.outline?.outline,layerCount:e.layerCount,minTraceWidth:e.minTraceWidth},boardVoidRects:e.boardVoidRects,obstacleClearance:e.obstacleClearance});this.obstacleIndexByLayer=t,this.layerNames=e.layerNames??n,this.zIndexByName=e.zIndexByName??o}pipelineDef=[b0("rectDiffSeedingSolver",Bmr,(e)=>[{simpleRouteJson:{bounds:e.inputProblem.bounds,obstacles:e.inputProblem.obstacles,connections:e.inputProblem.connections,outline:e.inputProblem.outline?.outline,layerCount:e.inputProblem.layerCount,minTraceWidth:e.inputProblem.minTraceWidth},gridOptions:e.inputProblem.gridOptions,obstacleIndexByLayer:e.obstacleIndexByLayer,boardVoidRects:e.inputProblem.boardVoidRects,layerNames:e.layerNames,zIndexByName:e.zIndexByName,obstacleClearance:e.inputProblem.obstacleClearance}]),b0("rectDiffExpansionSolver",Dmr,(e)=>{let t=e.rectDiffSeedingSolver?.getOutput();if(!t)throw Error("RectDiffSeedingSolver did not produce output");return[{layerNames:t.layerNames??[],boardVoidRects:e.inputProblem.boardVoidRects??[],layerCount:e.inputProblem.layerCount,bounds:t.bounds,candidates:t.candidates,consumedSeedsThisGrid:t.placed.length,totalSeedsThisGrid:t.candidates.length,placed:t.placed,edgeAnalysisDone:t.edgeAnalysisDone,gridIndex:t.gridIndex,expansionIndex:t.expansionIndex,obstacleIndexByLayer:e.obstacleIndexByLayer,options:t.options,zIndexByName:e.zIndexByName,layerNamesCanonical:e.layerNames,obstacles:e.inputProblem.obstacles,obstacleClearance:e.inputProblem.obstacleClearance}]})];getConstructorParams(){return[this.inputProblem]}getOutput(){if(this.rectDiffExpansionSolver)return this.rectDiffExpansionSolver.getOutput();if(this.rectDiffSeedingSolver)return{meshNodes:this.rectDiffSeedingSolver.getOutput().placed.map((e,t)=>({capacityMeshNodeId:`grid-${t}`,center:{x:e.rect.x+e.rect.width/2,y:e.rect.y+e.rect.height/2},width:e.rect.width,height:e.rect.height,availableZ:e.zLayers,layer:`z${e.zLayers.join(",")}`}))};return{meshNodes:[]}}visualize(){return this.rectDiffExpansionSolver?this.rectDiffExpansionSolver.visualize():this.rectDiffSeedingSolver?this.rectDiffSeedingSolver.visualize():{title:"RectDiff Grid Pipeline",coordinateSystem:"cartesian",rects:[],points:[],lines:[]}}},yFt=(e)=>{let{srj:t,clearance:n}=e,o=n??0;if(o<=0)return{title:"Obstacle Clearance",coordinateSystem:"cartesian",rects:[]};let r=[];for(let i of t.obstacles??[]){if(i.type!=="rect"&&i.type!=="oval")continue;let s={x:i.center.x-i.width/2-o,y:i.center.y-i.height/2-o,width:i.width+2*o,height:i.height+2*o};r.push({center:{x:s.x+s.width/2,y:s.y+s.height/2},width:s.width,height:s.height,stroke:"rgba(202, 138, 4, 0.9)",fill:"rgba(234, 179, 8, 0.15)",layer:"obstacle-clearance",label:`clearance
z:${(i.zLayers??[]).join(",")||"all"}`})}return{title:"Obstacle Clearance",coordinateSystem:"cartesian",rects:r}};function Rmr(e,t,n={}){if(!t||t.length<3)return[];let o=t.length>120,r=o?function(_,p){let m=(f)=>Math.round(f/p)*p,A=new Set,g=[];for(let f of _){let y=m(f.x),x=m(f.y),C=`${y},${x}`;A.has(C)||(A.add(C),g.push({x:y,y:x}))}return g}(t,Math.max(e.width,e.height)/120):t,i=new Set([e.x,e.x+e.width]),s=new Set([e.y,e.y+e.height]);for(let _ of r)i.add(_.x),s.add(_.y);(function({polygon:_,xs:p,ys:m,minGridSize:A}){let g=[],f=0;for(let x=0;x<_.length;x++){let C=_[x],b=_[(x+1)%_.length],I=Math.abs(b.x-C.x),v=Math.abs(b.y-C.y);if(I<=rr||v<=rr)continue;let P=Math.max(I,v);g.push({start:C,end:b,span:P}),f+=P}if(g.length===0)return;let y=Math.max(A,f/256);for(let{start:x,end:C,span:b}of g){let I=Math.max(1,Math.ceil(b/y));for(let v=1;v<I;v++){let P=v/I;p.add(x.x+(C.x-x.x)*P),m.add(x.y+(C.y-x.y)*P)}}})({polygon:r,xs:i,ys:s,minGridSize:Math.max(rr,n.minGridSize??Math.max(e.width,e.height)/256)});let a=Array.from(i).sort((_,p)=>_-p),c=Array.from(s).sort((_,p)=>_-p),l=[];for(let _=0;_<a.length-1;_++)for(let p=0;p<c.length-1;p++){let m=a[_],A=a[_+1],g=c[p],f=c[p+1],y=(m+A)/2,x=(g+f)/2;if(y>=e.x&&y<=e.x+e.width&&x>=e.y&&x<=e.y+e.height)(o?[{x:y,y:x}]:[{x:y,y:x},{x:m,y:g},{x:A,y:g},{x:m,y:f},{x:A,y:f}]).every((C)=>Nce(C,t))||l.push({x:m,y:g,width:A-m,height:f-g})}let h=[];l.sort((_,p)=>Math.abs(_.y-p.y)>rr?_.y-p.y:_.x-p.x);let d=null;for(let _ of l){if(!d){d=_;continue}let p=Math.abs(d.y-_.y)<rr,m=Math.abs(d.height-_.height)<rr,A=Math.abs(d.x+d.width-_.x)<rr;p&&m&&A?d.width+=_.width:(h.push(d),d=_)}d&&h.push(d),h.sort((_,p)=>Math.abs(_.x-p.x)>rr?_.x-p.x:_.y-p.y);let u=[];d=null;for(let _ of h){if(!d){d=_;continue}let p=Math.abs(d.x-_.x)<rr,m=Math.abs(d.width-_.width)<rr,A=Math.abs(d.y+d.height-_.y)<rr;p&&m&&A?d.height+=_.height:(u.push(d),d=_)}return d&&u.push(d),u}var wq=class extends mS{rectDiffGridSolverPipeline;gapFillSolver;outerLayerContainmentMergeSolver;boardVoidRects;zIndexByName;layerNames;pipelineDef=[b0("rectDiffGridSolverPipeline",Nmr,(e)=>[{bounds:e.inputProblem.simpleRouteJson.bounds,obstacles:e.inputProblem.simpleRouteJson.obstacles,connections:e.inputProblem.simpleRouteJson.connections,outline:e.inputProblem.simpleRouteJson.outline?{outline:e.inputProblem.simpleRouteJson.outline}:void 0,layerCount:e.inputProblem.simpleRouteJson.layerCount,gridOptions:e.inputProblem.gridOptions,boardVoidRects:e.boardVoidRects,layerNames:e.layerNames,zIndexByName:e.zIndexByName,minTraceWidth:e.inputProblem.simpleRouteJson.minTraceWidth,obstacleClearance:e.inputProblem.obstacleClearance}]),b0("gapFillSolver",umr,(e)=>[{meshNodes:e.rectDiffGridSolverPipeline?.getOutput().meshNodes??[],bounds:e.inputProblem.simpleRouteJson.bounds,boardVoid:{boardVoidRects:e.boardVoidRects||[],layerCount:e.inputProblem.simpleRouteJson.layerCount||0},maxGapFillPasses:e.inputProblem.maxGapFillPasses}]),b0("outerLayerContainmentMergeSolver",mmr,(e)=>[{meshNodes:e.gapFillSolver?.getOutput().outputNodes??e.rectDiffGridSolverPipeline?.getOutput().meshNodes??[],simpleRouteJson:e.inputProblem.simpleRouteJson,zIndexByName:e.zIndexByName??new Map,obstacleClearance:e.inputProblem.obstacleClearance}])];_setup(){let{zIndexByName:e,layerNames:t}=m$e({obstacles:this.inputProblem.simpleRouteJson.obstacles,layerCount:this.inputProblem.simpleRouteJson.layerCount});if(this.zIndexByName=e,this.layerNames=t,this.inputProblem.simpleRouteJson.outline){let n=Math.max(0,this.inputProblem.simpleRouteJson.minBoardEdgeClearance??0);this.boardVoidRects=Rmr({x:this.inputProblem.simpleRouteJson.bounds.minX-n,y:this.inputProblem.simpleRouteJson.bounds.minY-n,width:this.inputProblem.simpleRouteJson.bounds.maxX-this.inputProblem.simpleRouteJson.bounds.minX+2*n,height:this.inputProblem.simpleRouteJson.bounds.maxY-this.inputProblem.simpleRouteJson.bounds.minY+2*n},this.inputProblem.simpleRouteJson.outline??[],{minGridSize:this.inputProblem.simpleRouteJson.minTraceWidth}).map((o)=>A$e(o,n))}}getConstructorParams(){return[this.inputProblem]}getOutput(){let e=this.outerLayerContainmentMergeSolver?.getOutput();if(e)return{meshNodes:e.outputNodes};let t=this.gapFillSolver?.getOutput();return t?{meshNodes:t.outputNodes}:this.rectDiffGridSolverPipeline?this.rectDiffGridSolverPipeline.getOutput():{meshNodes:[]}}initialVisualize(){let e=function(o,r="RectDiff"){let i=[],s=[],a=o.bounds.minX,c=o.bounds.maxX,l=o.bounds.minY,h=o.bounds.maxY;o.outline&&o.outline.length>1?s.push({points:[...o.outline,o.outline[0]],strokeColor:"#111827",strokeWidth:0.01,label:"outline"}):i.push({center:{x:(a+c)/2,y:(l+h)/2},width:c-a,height:h-l,fill:"none",stroke:"#111827",label:"board"});for(let d of o.obstacles??[])if(d.type==="rect"||d.type==="oval"){let u=(d.zLayers??[]).join(",")||"all";i.push({center:{x:d.center.x,y:d.center.y},width:d.width,height:d.height,fill:"#fee2e2",stroke:"#ef4444",layer:"obstacle",label:`obstacle
z:${u}`})}return{title:r,coordinateSystem:"cartesian",rects:i,points:[],lines:s}}(this.inputProblem.simpleRouteJson,"RectDiffPipeline - Initial"),t=yFt({srj:this.inputProblem.simpleRouteJson,clearance:this.inputProblem.obstacleClearance}),n={title:"Initial Nodes",coordinateSystem:"cartesian",rects:(this.rectDiffGridSolverPipeline?.getOutput().meshNodes??[]).map((o)=>({center:o.center,width:o.width,height:o.height,stroke:"rgba(0, 0, 0, 0.3)",fill:"rgba(100, 100, 100, 0.1)",layer:`z${o.availableZ.join(",")}`,label:[`node ${o.capacityMeshNodeId}`,`z:${o.availableZ.join(",")}`].join(`
`)}))};return TO(TO(e,t),n)}finalVisualize(){return(({srj:e,meshNodes:t,obstacleClearance:n})=>{let o=(({srj:s})=>({title:"SimpleRoute Outline",coordinateSystem:"cartesian",lines:s.outline&&s.outline.length>1?[{points:[...s.outline,s.outline[0]],strokeColor:"#111827",strokeWidth:0.1,label:"outline"}]:[{points:[{x:s.bounds.minX,y:s.bounds.minY},{x:s.bounds.maxX,y:s.bounds.minY},{x:s.bounds.maxX,y:s.bounds.maxY},{x:s.bounds.minX,y:s.bounds.maxY},{x:s.bounds.minX,y:s.bounds.minY}],strokeColor:"#111827",strokeWidth:0.1,label:"bounds"}]}))({srj:e}),r=yFt({srj:e,clearance:n}),i=t.map((s)=>({center:s.center,width:s.width,height:s.height,stroke:xCe(s.availableZ).stroke,fill:s._containsObstacle?"#fca5a5":xCe(s.availableZ).fill,layer:`z${s.availableZ.join(",")}`,label:`node ${s.capacityMeshNodeId}
z:${s.availableZ.join(",")}`}));return TO(TO({title:"RectDiffPipeline - Final",coordinateSystem:"cartesian",rects:i,lines:[],points:[],texts:[]},o),r)})({srj:this.inputProblem.simpleRouteJson,meshNodes:this.getOutput().meshNodes,obstacleClearance:this.inputProblem.obstacleClearance})}},Qmr=class{cacheHitsByPrefix={};cacheMissesByPrefix={};isSyncCache=!0;cacheHits=0;cacheMisses=0;cache=new Map;getCachedSolutionSync(e){let t=this.cache.get(e);if(t!==void 0){this.cacheHits++;let n=e.split(":")[0];return this.cacheHitsByPrefix[n]=(this.cacheHitsByPrefix[n]||0)+1,structuredClone(t)}{this.cacheMisses++;let n=e.split(":")[0];return void(this.cacheMissesByPrefix[n]=(this.cacheMissesByPrefix[n]||0)+1)}}async getCachedSolution(e){return this.getCachedSolutionSync(e)}setCachedSolutionSync(e,t){this.cache.set(e,structuredClone(t))}async setCachedSolution(e,t){this.setCachedSolutionSync(e,t)}clearCache(){this.cache.clear(),this.cacheHits=0,this.cacheMisses=0,this.cacheHitsByPrefix={},this.cacheMissesByPrefix={}}getAllCacheKeys(){return Array.from(this.cache.keys())}},JUe="tscircuit_autorouter_cache_",kmr=class{isSyncCache=!0;cacheHits=0;cacheMisses=0;cacheHitsByPrefix={};cacheMissesByPrefix={};constructor(){}getKey(e){return`${JUe}${e}`}getCachedSolutionSync(e){if(typeof localStorage>"u")return;let t=this.getKey(e);try{let n=localStorage.getItem(t);if(n!==null){let o=JSON.parse(n);this.cacheHits++;let r=e.split(":")[0];return this.cacheHitsByPrefix[r]=(this.cacheHitsByPrefix[r]||0)+1,o}{this.cacheMisses++;let o=e.split(":")[0];return void(this.cacheMissesByPrefix[o]=(this.cacheMissesByPrefix[o]||0)+1)}}catch(n){console.error(`Error getting cached solution sync for ${t}:`,n),this.cacheMisses++;let o=e.split(":")[0];return void(this.cacheMissesByPrefix[o]=(this.cacheMissesByPrefix[o]||0)+1)}}async getCachedSolution(e){return this.getCachedSolutionSync(e)}setCachedSolutionSync(e,t){if(typeof localStorage>"u")return;let n=this.getKey(e);try{let o=JSON.stringify(t);localStorage.setItem(n,o)}catch(o){console.error(`Error setting cached solution sync for ${n}:`,o),o instanceof DOMException&&(o.name==="QuotaExceededError"||o.name==="NS_ERROR_DOM_QUOTA_REACHED")&&console.warn(`LocalStorage quota exceeded. Failed to cache solution for ${n}. Consider clearing the cache.`)}}async setCachedSolution(e,t){this.setCachedSolutionSync(e,t)}clearCache(){if(typeof localStorage<"u")try{let e=[];for(let t=0;t<localStorage.length;t++){let n=localStorage.key(t);n?.startsWith(JUe)&&e.push(n)}e.forEach((t)=>localStorage.removeItem(t)),console.log(`Cleared ${e.length} items from LocalStorage cache.`)}catch(e){console.error("Error clearing LocalStorage cache:",e)}finally{this.cacheHits=0,this.cacheMisses=0,this.cacheHitsByPrefix={},this.cacheMissesByPrefix={}}}getAllCacheKeys(){let e=[];for(let t=0;t<1e4;t++){let n=localStorage.key(t);if(!n)break;n.includes(JUe)&&e.push(n)}return e}};function Lmr(){return globalThis.TSCIRCUIT_AUTOROUTER_LOCAL_STORAGE_CACHE||Dbe(),globalThis.TSCIRCUIT_AUTOROUTER_LOCAL_STORAGE_CACHE}function _9(){return globalThis.TSCIRCUIT_AUTOROUTER_IN_MEMORY_CACHE||Dbe(),globalThis.TSCIRCUIT_AUTOROUTER_IN_MEMORY_CACHE}function Dbe(){globalThis.TSCIRCUIT_AUTOROUTER_LOCAL_STORAGE_CACHE??=new kmr,globalThis.TSCIRCUIT_AUTOROUTER_IN_MEMORY_CACHE??=new Qmr}function Rce(e){let t={minX:e.center.x-e.width/2,maxX:e.center.x+e.width/2,minY:e.center.y-e.height/2,maxY:e.center.y+e.height/2};for(let n of e.portPoints)n.x<t.minX&&(t.minX=n.x),n.x>t.maxX&&(t.maxX=n.x),n.y<t.minY&&(t.minY=n.y),n.y>t.maxY&&(t.maxY=n.y);return t}var _Xt=(e,t)=>e<=t?[e,t]:[t,e],rje=(e)=>`${e[0]}|${e[1]}`,Hmr=({portPointId:e,currentNodeId:t,inputNodes:n,connectionNodeIdsByPortPointId:o})=>{let r=e?o?.get(e):void 0;if(e&&!o)for(let a of n){let c=a.portPoints.find((l)=>l.portPointId===e);if(c?.connectionNodeIds){r=c.connectionNodeIds;break}}if(!r||r.length!==2)return[t,t];let[i,s]=r;return i&&s?_Xt(i,s):[t,t]},ije=0.000001,DR=(e,t)=>Math.abs(e-t)<=ije,Fmr=({nodeAId:e,nodeBId:t,nodeBounds:n})=>{if(e===t)return null;let o=n.get(e),r=n.get(t);if(!o||!r)return null;let i=_Xt(e,t),s=rje(i);if(DR(o.maxX,r.minX)||DR(r.maxX,o.minX)){let a=Math.max(o.minY,r.minY),c=Math.min(o.maxY,r.maxY),l=c-a;if(l>ije){let h=DR(o.maxX,r.minX)?o.maxX:o.minX;return{ownerNodeIds:i,ownerPairKey:s,orientation:"vertical",x1:h,y1:a,x2:h,y2:c,center:{x:h,y:(a+c)/2},length:l,nodeSideByOwnerId:DR(o.maxX,r.minX)?{[e]:"right",[t]:"left"}:{[e]:"left",[t]:"right"}}}}if(DR(o.maxY,r.minY)||DR(r.maxY,o.minY)){let a=Math.max(o.minX,r.minX),c=Math.min(o.maxX,r.maxX),l=c-a;if(l>ije){let h=DR(o.maxY,r.minY)?o.maxY:o.minY;return{ownerNodeIds:i,ownerPairKey:s,orientation:"horizontal",x1:a,y1:h,x2:c,y2:h,center:{x:(a+c)/2,y:h},length:l,nodeSideByOwnerId:DR(o.maxY,r.minY)?{[e]:"top",[t]:"bottom"}:{[e]:"bottom",[t]:"top"}}}}return null},zmr=({portPoint:e,ownerNodeIds:t,inputNodes:n})=>{for(let o of t){let r=n.find((s)=>s.capacityMeshNodeId===o);if(r?._containsTarget)return!0;if(r?.portPoints.find((s)=>s.portPointId===e.portPointId)?.connectionNodeIds?.some((s)=>n.find((a)=>a.capacityMeshNodeId===s)?._containsTarget))return!0}return!1},ti=(e,t)=>e==="top"?0:e==="bottom"?t-1:parseInt(e.slice(5));function Ile(e,t){return[...new Set(e)].filter((n)=>Number.isInteger(n)&&n>=0&&n<t).sort((n,o)=>n-o)}function vle(e,t){return Ile(e.map((n)=>ti(n,t)),t)}var kK=0.000001,xFt=({sharedEdge:e,obstacles:t,z:n,layerCount:o})=>{for(let r of t){let i=r.zLayers??(o===void 0?void 0:r.layers.map((h)=>ti(h,o)));if(n!==void 0&&i&&!i.includes(n))continue;let s=r.center.x-r.width/2,a=r.center.x+r.width/2,c=r.center.y-r.height/2,l=r.center.y+r.height/2;if(e.orientation!=="vertical"){if(Math.abs(e.y1-c)<kK||Math.abs(e.y1-l)<kK){let h=Math.max(e.x1,s);if(Math.min(e.x2,a)-h>kK)return!0}}else if(Math.abs(e.x1-s)<kK||Math.abs(e.x1-a)<kK){let h=Math.max(e.y1,c);if(Math.min(e.y2,l)-h>kK)return!0}}return!1},Sle=class extends fa{constructor(e){super(),this.input=e;for(let o of e.nodeWithPortPoints)this.mapOfNodeIdToBounds.set(o.capacityMeshNodeId,e.useLayerAwareGeometry?{minX:o.center.x-o.width/2,maxX:o.center.x+o.width/2,minY:o.center.y-o.height/2,maxY:o.center.y+o.height/2}:Rce(o));let t=new Map,n=((o)=>{let r=new Map;for(let i of o){let s=new Set;for(let a of i.portPoints){let c=a.portPointId;c&&!s.has(c)&&(s.add(c),!r.has(c)&&a.connectionNodeIds&&r.set(c,a.connectionNodeIds))}}return r})(e.inputNodesWithPortPoints);for(let o of e.nodeWithPortPoints)for(let r of o.portPoints){if(!r.portPointId)continue;let i=Hmr({portPointId:r.portPointId,currentNodeId:o.capacityMeshNodeId,inputNodes:e.inputNodesWithPortPoints,connectionNodeIdsByPortPointId:n}),s=rje(i),a=this.mapOfOwnerPairToPortPoints.get(s)??[];a.some((c)=>c.portPointId&&c.portPointId===r.portPointId)||a.push({...r,ownerNodeIds:i,ownerPairKey:s}),this.mapOfOwnerPairToPortPoints.set(s,a),t.set(s,i)}this.mapOfOwnerPairToSharedEdge=(({ownerPairs:o,nodeBounds:r})=>{let i=new Map;for(let s of o){let[a,c]=s;if(a===c)continue;let l=Fmr({nodeAId:a,nodeBId:c,nodeBounds:r});l&&i.set(rje(s),l)}return i})({ownerPairs:Array.from(t.values()),nodeBounds:this.mapOfNodeIdToBounds}),this.ownerPairsToProcess=Array.from(this.mapOfOwnerPairToSharedEdge.keys()),this.ownerPairsToProcess.sort((o,r)=>{let i=this.mapOfOwnerPairToSharedEdge.get(o),s=this.mapOfOwnerPairToSharedEdge.get(r);return i.center.x-s.center.x||i.center.y-s.center.y})}input;getSolverName(){return"UniformPortDistributionSolver"}mapOfNodeIdToBounds=new Map;mapOfOwnerPairToPortPoints=new Map;mapOfOwnerPairToSharedEdge=new Map;ownerPairsToProcess=[];currentOwnerPairBeingProcessed=null;redistributedNodes=[];step(){if(this.ownerPairsToProcess.length===0)return this.rebuildNodes(),void(this.solved=!0);this.currentOwnerPairBeingProcessed=this.ownerPairsToProcess.shift();let e=this.currentOwnerPairBeingProcessed,t=this.mapOfOwnerPairToSharedEdge.get(e);if(!t)return;let n=this.mapOfOwnerPairToPortPoints.get(e)??[],o=xFt({sharedEdge:t,obstacles:this.input.obstacles});if(!this.input.useLayerAwareGeometry&&o)return;let r=new Map;for(let a of n)r.set(a.z,(r.get(a.z)??0)+1);let i=[];for(let a of n)this.input.preserveSolitaryPorts&&o&&r.get(a.z)===1||xFt({sharedEdge:t,obstacles:this.input.obstacles,z:this.input.useLayerAwareGeometry?a.z:void 0,layerCount:this.input.layerCount})||zmr({portPoint:a,ownerNodeIds:a.ownerNodeIds,inputNodes:this.input.inputNodesWithPortPoints})||i.push(a);let s=(({sharedEdge:a,portPoints:c})=>{if(c.length===0)return[];let l=new Map;for(let u of c){let _=u.z??0,p=l.get(_)??[];p.push(u),l.set(_,p)}let h=[],d=Array.from(l.keys()).sort((u,_)=>u-_);for(let u of d){let _=l.get(u),p=_.length;_.sort((m,A)=>a.orientation==="horizontal"?m.x-A.x:m.y-A.y);for(let m=0;m<p;m++){let A=(2*m+1)/(2*p),g=a.orientation==="horizontal"?a.x1+a.length*A:a.x1,f=a.orientation==="horizontal"?a.y1:a.y1+a.length*A;h.push({..._[m],x:g,y:f})}}return h})({sharedEdge:t,portPoints:i});this.mapOfOwnerPairToPortPoints.set(e,s)}rebuildNodes(){let e=new Map;for(let n of this.mapOfOwnerPairToPortPoints.values())for(let o of n)o.portPointId&&e.set(o.portPointId,{x:o.x,y:o.y});let t=(n)=>{if(n.portPointId&&e.has(n.portPointId)){let o=e.get(n.portPointId);return{...n,x:o.x,y:o.y}}return n};this.redistributedNodes=this.input.nodeWithPortPoints.map((n)=>({...n,portPoints:n.portPoints.map(t),portPointsInPairs:n.portPointsInPairs?.map(([o,r])=>[t(o),t(r)])}))}getOutput=()=>this.redistributedNodes;visualize(){return(({obstacles:e,nodeWithPortPoints:t,mapOfOwnerPairToPortPoints:n,mapOfOwnerPairToSharedEdge:o,ownerPairsToProcess:r,currentOwnerPairBeingProcessed:i,mapOfNodeIdToBounds:s})=>{let a=e.filter((p)=>!p.isCopperPour).map((p)=>({...p,fill:"#ec000070"})),c=[],l=[],h=new Map,d=new Map,u=new Map,_=(p)=>p.portPointId?h.get(p.portPointId)??{x:p.x,y:p.y}:{x:p.x,y:p.y};for(let p of t)for(let m of p.portPoints)m.portPointId&&(h.set(m.portPointId,{x:m.x,y:m.y}),d.set(m.portPointId,m.z??0));for(let p of n.values())for(let m of p)m.portPointId&&(h.set(m.portPointId,{x:m.x,y:m.y}),d.set(m.portPointId,m.z??0),u.set(m.portPointId,`${m.ownerNodeIds[0]}&${m.ownerNodeIds[1]}`));t.forEach((p)=>{let m=s.get(p.capacityMeshNodeId);if(m){let A=(m.minX+m.maxX)/2,g=(m.minY+m.maxY)/2,f=m.maxX-m.minX,y=m.maxY-m.minY;a.push({center:{x:A,y:g},width:f,height:y,fill:"#00000030",label:`${p.capacityMeshNodeId}`})}p.portPoints.forEach((A)=>{if(!A.portPointId)return;let g=h.get(A.portPointId),f=d.get(A.portPointId)??0,y=u.get(A.portPointId)??`${p.capacityMeshNodeId}&${p.capacityMeshNodeId}`;c.push({x:g.x,y:g.y,label:`z:${f}
o:${y}`}),p.portPointsInPairs?.length||p.portPoints.forEach((x)=>{if(x.portPointId&&A!==x&&A.connectionName===x.connectionName){let C=h.get(x.portPointId);l.push({points:[g,C],strokeColor:"#fff822c9"})}})}),p.portPointsInPairs?.forEach(([A,g])=>{l.push({points:[_(A),_(g)],strokeColor:"#fff822c9"})})});for(let p of r){let m=o.get(p);m&&l.push({points:[{x:m.x1,y:m.y1},{x:m.x2,y:m.y2}],strokeColor:"orange",strokeWidth:0.01})}if(i){let p=o.get(i);p&&(l.push({points:[{x:p.x1,y:p.y1},{x:p.x2,y:p.y2}],strokeColor:"red",strokeWidth:0.03}),c.push({x:p.center.x,y:p.center.y,label:p.ownerPairKey}))}for(let p of o.values())l.push({points:[{x:p.x1,y:p.y1},{x:p.x2,y:p.y2}],strokeColor:"#33b5ff80",strokeWidth:0.006});return{rects:a,lines:l,points:c}})({obstacles:this.input.obstacles,nodeWithPortPoints:this.input.nodeWithPortPoints,mapOfOwnerPairToPortPoints:this.mapOfOwnerPairToPortPoints,mapOfOwnerPairToSharedEdge:this.mapOfOwnerPairToSharedEdge,ownerPairsToProcess:this.ownerPairsToProcess,currentOwnerPairBeingProcessed:this.currentOwnerPairBeingProcessed,mapOfNodeIdToBounds:this.mapOfNodeIdToBounds})}},Pw=(e,t,n)=>e.connectedTo.some((o)=>o===t.connectionName||o===t.rootConnectionName||(n?.areIdsConnected(t.connectionName,o)??!1)||t.rootConnectionName!==void 0&&(n?.areIdsConnected(t.rootConnectionName,o)??!1));function DO(e){return!("layers"in e)&&typeof e.layer=="string"}function Ef(e){return zx(e)[0]}function zx(e){if(function(t){return!("layer"in t)&&Array.isArray(t.layers)}(e))return e.layers;if(DO(e))return[e.layer];throw Error("Connection point must specify either layer or layers, never both")}var Nh=(e,t)=>{if(e===1&&t===1)return"inner1";if(e<0||e>=t)throw Error(`Invalid z "${e}" for layer count: ${t}`);return e===0?"top":e===t-1?"bottom":`inner${e}`},ZUe=(e,t)=>!!e&&!!t&&Math.abs(e.x-t.x)<=0.000000000001&&Math.abs(e.y-t.y)<=0.000000000001,D4e=(e,t)=>_S(e,t)<=0.000001,Omr=(e,t,n,o)=>t.toNextSegmentType==="through_obstacle"||(o.connectedMultilayerObstacles?o.connectedMultilayerObstacles.some((r)=>D4e(t,r)&&D4e(n,r)):o.obstacles?.some((r)=>((i)=>(i.__zLayers?.length??i.layers?.length??0)>1)(r)&&D4e(t,r)&&D4e(n,r)&&Pw(r,e,o.connMap))??!1),CFt=({endpoint:e,endpointLayer:t,connectionPoints:n,tolerance:o})=>{let r;for(let i of n){if(!DO(i)||!i.terminalVia)continue;if(i.layer!==t)continue;let s=Dn(i,e);s>o||(!r||s<r.distance)&&(r={point:i,distance:s})}return r?.point},V4=(e,t,n={})=>{let o=[];if(e.route.length===0)return o;let r=[],i=e.route[0].z;for(let a=0;a<e.route.length;a++){let c=e.route[a];if(c.z!==i){let l=r[r.length-1],h=Nh(i,t);for(let u of r)o.push({route_type:"wire",x:u.x,y:u.y,width:u.traceThickness??e.traceThickness,layer:h});let d=Nh(c.z,t);if(l&&Omr(e,l,c,n))o.push({route_type:"through_obstacle",start:{x:l.x,y:l.y},end:{x:c.x,y:c.y},from_layer:h,to_layer:d,width:l.traceThickness??e.traceThickness,...l.toNextSegmentCircuitJsonMetadata?{circuitJsonMetadata:l.toNextSegmentCircuitJsonMetadata}:{}});else e.vias.some((u)=>Math.abs(u.x-c.x)<0.001&&Math.abs(u.y-c.y)<0.001)&&o.push({route_type:"via",x:c.x,y:c.y,from_layer:h,to_layer:d,via_diameter:e.viaDiameter,...n.defaultViaHoleDiameter!==void 0?{via_hole_diameter:n.defaultViaHoleDiameter}:{}});r=[c],i=c.z}else ZUe(r[r.length-1],c)||r.push(c)}let s=Nh(i,t);for(let a of r)o.push({route_type:"wire",x:a.x,y:a.y,width:a.traceThickness??e.traceThickness,layer:s});if(e.jumpers&&e.jumpers.length>0){let a=Nh(e.route[0]?.z??0,t);for(let c of e.jumpers)o.push({route_type:"jumper",start:c.start,end:c.end,footprint:c.footprint,layer:a})}return(({route:a,hdRoute:c,layerCount:l,connectionPoints:h=[],tolerance:d=0.25,defaultViaHoleDiameter:u})=>{if(a.length===0||c.route.length===0||!h.length)return a;if(!h.some((B)=>DO(B)&&B.terminalVia))return a;let _=a.filter((B)=>B.route_type!=="jumper"),p=a.filter((B)=>B.route_type==="jumper");if(_.length===0)return a;let m=c.route[0],A=c.route[c.route.length-1],g=Nh(m.z,l),f=Nh(A.z,l),y=CFt({endpoint:m,endpointLayer:g,connectionPoints:h,tolerance:d}),x=CFt({endpoint:A,endpointLayer:f,connectionPoints:h,tolerance:d}),C=[],b=[],I=_[0],v=_[_.length-1],P=m.traceThickness??c.traceThickness,M=A.traceThickness??c.traceThickness;return y?.terminalVia&&(C.push({route_type:"via",x:y.x,y:y.y,from_layer:y.layer,to_layer:y.terminalVia.toLayer,via_diameter:y.terminalVia.viaDiameter??c.viaDiameter,...u!==void 0?{via_hole_diameter:u}:{}}),I?.route_type==="wire"&&I.layer===y.layer&&ZUe(I,y)||C.push({route_type:"wire",x:y.x,y:y.y,width:P,layer:y.layer})),x?.terminalVia&&(v?.route_type==="wire"&&v.layer===x.layer&&ZUe(v,x)||b.push({route_type:"wire",x:x.x,y:x.y,width:M,layer:x.layer}),b.push({route_type:"via",x:x.x,y:x.y,from_layer:x.layer,to_layer:x.terminalVia.toLayer,via_diameter:x.terminalVia.viaDiameter??c.viaDiameter,...u!==void 0?{via_hole_diameter:u}:{}})),[...C,..._,...b,...p]})({route:o,hdRoute:e,layerCount:t,connectionPoints:n.connectionPoints,tolerance:n.terminalViaAttachTolerance,defaultViaHoleDiameter:n.defaultViaHoleDiameter})},bFt=["blue","orange","purple","cyan","magenta","yellowgreen","darkgoldenrod","deeppink"],yA=(e,t)=>{let n={};for(let o=0;o<e.connections.length;o++){let r=e.connections[o],i=t?.getNetConnectedToId(r.name);i&&!n[i]&&(n[i]=`hsl(${300*o/e.connections.length}, 100%, 50%)`),n[r.name]=(i?n[i]:null)??`hsl(${340*o/e.connections.length}, 100%, 50%)`}return n},Qi=(e,t)=>{try{return d$(t,e)}catch(n){return console.error(n),e}},Qce=(e,t=1)=>{if(!e)return"rgba(0, 0, 0, 0.5)";let n=300*e.split("").reduce((o,r)=>o+r.charCodeAt(0),0)/e.length%360;return t<1?`hsla(${n}, 100%, 50%, ${t})`:`hsl(${n}, 100%, 50%)`},IFt=(e)=>{let t=new Set;return e.filter((n)=>!t.has(n)&&(t.add(n),!0))},_ae=(e,t,n)=>{if(!t)return;let o=e.get(t);o?o.includes(n)||o.push(n):e.set(t,[n])},Nw=(e)=>{let t=new Map;for(let n of e.connections){let o=n.__rootConnectionNames??[n.name];for(let r of o){_ae(t,n.name,r),_ae(t,r,r),_ae(t,n.__netConnectionName,r);for(let i of n.pointsToConnect)_ae(t,i.pointId,r),_ae(t,i.pcb_port_id,r)}}return(n)=>((o,r=[])=>{let i=IFt(r).join(", ");return o.layers.map((s)=>i?`${s}
${i}`:s).join(`
`)})(n,((o,r)=>IFt([...o.connectedTo.flatMap((i)=>r.get(i)??[]),...(o.offBoardConnectsTo??[]).flatMap((i)=>r.get(i)??[])]))(n,t))},Yae=(e,t)=>`z${vle(e,t).join(",")}`,Rw=(e,t)=>Yae(zx(e),t),gXt=(e,t)=>e.__zLayers&&e.__zLayers.length>0?Ile(e.__zLayers,t):vle(e.layers,t),sS=(e,t)=>`z${gXt(e,t).join(",")}`,vFt=(...e)=>e.find((t)=>typeof t=="number"&&Number.isFinite(t)),Pp=(e)=>{let t=vFt(e.min_via_hole_diameter,e.minViaHoleDiameter),n=vFt(e.min_via_pad_diameter,e.minViaPadDiameter,e.minViaDiameter),o=Math.max(n??e.minViaDiameter??0.3,t??0);return{padDiameter:o,holeDiameter:t??0.5*o}},ZO={"0603":{length:1.65,width:0.95,padLength:0.8,padWidth:0.95},1206:{length:3.2,width:1.6,padLength:0.6,padWidth:1.6},"1206x4_pair":{length:2.7,width:0.5,padLength:0.8,padWidth:0.5}},SFt={top:"red",bottom:"blue",inner1:"green",inner2:"yellow",inner3:"orange",inner4:"purple",inner5:"cyan",inner6:"magenta",inner7:"lime",inner8:"brown"};function PFt(e){if(Object.hasOwn(SFt,e))return SFt[e];let t=/^inner([1-9]\d*)$/.exec(e);if(t)return`hsl(${137*Number(t[1])%360}, 70%, 45%)`;throw Error(`No visualization color for layer "${e}"`)}var py=(e,t={})=>{let n=[],o=[],r=[],i=[],s=yA(e),a=t.traceColorMode??"layer",c=e.layerCount,l=Pp(e),h=Nw(e);if(e.connections)for(let d of e.connections)for(let u of d.pointsToConnect){let _=zx(u),p=d.__rootConnectionNames??[d.name];r.push({x:u.x,y:u.y,color:s[d.name],layer:Rw(u,c),label:[d.name,p.join(", "),_.join(",")].join(`
`)})}if(e.traces)for(let d of e.traces){let u=e.minTraceWidth,_=d.route.filter((A)=>A.route_type==="jumper"),p=(A,g)=>{for(let y of _){let x=Math.abs(A.x-y.start.x)<0.01&&Math.abs(A.y-y.start.y)<0.01&&Math.abs(g.x-y.end.x)<0.01&&Math.abs(g.y-y.end.y)<0.01,C=Math.abs(A.x-y.end.x)<0.01&&Math.abs(A.y-y.end.y)<0.01&&Math.abs(g.x-y.start.x)<0.01&&Math.abs(g.y-y.start.y)<0.01;if(x||C)return!0}return!1};for(let A of d.route)if(A.route_type==="via"){let g=ti(A.from_layer,c),f=ti(A.to_layer,c),y=(A.via_diameter??l.padDiameter)/2,x=Array.from({length:Math.abs(f-g)+1},(C,b)=>Math.min(g,f)+b);o.push({center:{x:A.x,y:A.y},radius:y,fill:a==="net"?s[d.connection_name]:"blue",stroke:"none",layer:`z${x.join(",")}`})}else if(A.route_type==="through_obstacle"){let g=s[d.connection_name]??"purple";n.push({points:[A.start,A.end],strokeColor:Qi(g,0.35),strokeWidth:A.width,strokeDash:[0.1,0.1],layer:Yae([A.from_layer,A.to_layer],c),label:`${d.connection_name} through_obstacle`})}let m;for(let A=0;A<d.route.length-1;A++){let g=d.route[A],f=d.route[A+1];if(g.route_type==="jumper"){m=void 0;let y=s[d.connection_name]??"rgba(255, 165, 0, 0.8)",x=g.footprint,C=ZO[x==="1206x4_pair"?"1206x4_pair":"0603"]??ZO["0603"],b=g.end.x-g.start.x,I=g.end.y-g.start.y,v=Math.abs(b)>Math.abs(I),P=v?C.padLength:C.padWidth,M=v?C.padWidth:C.padLength;i.push({center:g.start,width:P,height:M,fill:Qi(y,0.5),stroke:"rgba(0, 0, 0, 0.5)",layer:Yae([g.layer],c)}),i.push({center:g.end,width:P,height:M,fill:Qi(y,0.5),stroke:"rgba(0, 0, 0, 0.5)",layer:Yae([g.layer],c)}),n.push({points:[g.start,g.end],strokeColor:"rgba(100, 100, 100, 0.8)",strokeWidth:0.3*C.padWidth,layer:Yae([g.layer],c)})}else if(g.route_type==="wire"&&f.route_type==="wire"&&f.layer===g.layer){if(p({x:g.x,y:g.y},{x:f.x,y:f.y})){m=void 0;continue}u=g.width;let y=g.layer==="top",x=a==="net"?s[d.connection_name]:PFt(g.layer),C=`z${ti(g.layer,c)}`;if(m&&m.layer===C&&m.strokeWidth===u){m.points.push({x:f.x,y:f.y});continue}m={points:[{x:g.x,y:g.y},{x:f.x,y:f.y}],layer:C,strokeWidth:u,strokeColor:y?x:Qi(x,0.5),...a==="net"?{label:d.connection_name}:{},...y?{}:{strokeDash:[0.2,0.2]}},n.push(m)}else m=void 0}}for(let d of e.obstacles){if(d.isCopperPour)continue;let u=gXt(d,c);if(u.length===0)throw Error(`Cannot visualize obstacle "${d.obstacleId??"unknown"}" without a valid layer: layers=${d.layers.join(",")}, __zLayers=${d.__zLayers?.join(",")??"unset"}, layerCount=${c}`);let _=PFt((u.length===1?Nh(u[0],c):null)==="bottom"?"bottom":"top"),p=0.5**u.length;i.push({center:d.center,width:d.width,height:d.height,ccwRotationDegrees:d.ccwRotationDegrees,fill:Qi(_,p),layer:sS(d,c),label:h(d)})}if(e.jumpers)for(let d of e.jumpers)for(let u of d.pads)i.push({center:u.center,width:u.width,height:u.height,ccwRotationDegrees:u.ccwRotationDegrees,fill:"rgba(255, 165, 0, 0.3)",stroke:"rgba(255, 165, 0, 0.8)",layer:sS(u,c)});return{rects:i,circles:o,lines:n,points:r}};function Vmr([e,t],[n,o],{lineThickness:r=0}={}){if(r===0)return EFt(e,t,n,o);return function(s,a,c,l){if(s.x===a.x&&s.y===a.y)return LK(s,c,l);if(c.x===l.x&&c.y===l.y)return LK(c,s,a);if(EFt(s,a,c,l))return 0;let h=[LK(s,c,l),LK(a,c,l),LK(c,s,a),LK(l,s,a)];return Math.min(...h)}(e,t,n,o)<=r}function EFt(e,t,n,o){let r=N4e(e,t,n),i=N4e(e,t,o),s=N4e(n,o,e),a=N4e(n,o,t);return r!==i&&s!==a||(!(r!==0||!R4e(e,n,t))||(!(i!==0||!R4e(e,o,t))||(!(s!==0||!R4e(n,e,o))||!(a!==0||!R4e(n,t,o)))))}function N4e(e,t,n){let o=(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y);return o===0?0:o>0?1:2}function R4e(e,t,n){return t.x<=Math.max(e.x,n.x)&&t.x>=Math.min(e.x,n.x)&&t.y<=Math.max(e.y,n.y)&&t.y>=Math.min(e.y,n.y)}function LK(e,t,n){let o=(n.x-t.x)**2+(n.y-t.y)**2;if(o===0)return MFt(e,t);let r=((e.x-t.x)*(n.x-t.x)+(e.y-t.y)*(n.y-t.y))/o;return r=Math.max(0,Math.min(1,r)),MFt(e,{x:t.x+r*(n.x-t.x),y:t.y+r*(n.y-t.y)})}function MFt(e,t){let n=e.x-t.x,o=e.y-t.y;return Math.sqrt(n*n+o*o)}function f$e(e){let t=new Map,n=0;function o(r){for(let[,s]of t)if(s.has(r))return s;let i=new Set;return t.set("connectivity_net"+n++,i),i}for(let r of e){let i=null;for(let s of r){if(i){if(!i.has(s)){let a=o(s);if(a!==i){for(let c of a)i.add(c);t.delete(Array.from(t.entries()).find(([,c])=>c===a)[0])}}}else i=o(s);i.add(s)}}return Object.fromEntries(Array.from(t.entries()).map(([r,i])=>[r,Array.from(i)]))}var eV=class{netMap;idToNetMap;constructor(e){this.netMap=e,this.idToNetMap={};for(let[t,n]of Object.entries(e))for(let o of n)this.idToNetMap[o]=t}addConnections(e){for(let t of e){let n=new Set;for(let r of t){let i=this.idToNetMap[r];i&&n.add(i)}let o;if(n.size===0)o=`connectivity_net${Object.keys(this.netMap).length}`,this.netMap[o]=[];else if(n.size===1)o=n.values().next().value??`connectivity_net${Object.keys(this.netMap).length}`;else{o=n.values().next().value??`connectivity_net${Object.keys(this.netMap).length}`;for(let r of n)if(r!==o){this.netMap[o].push(...this.netMap[r]),this.netMap[r]=this.netMap[o];for(let i of this.netMap[o])this.idToNetMap[i]=o}}for(let r of t)this.netMap[o].includes(r)||this.netMap[o].push(r),this.idToNetMap[r]=o}}getIdsConnectedToNet(e){return this.netMap[e]||[]}getNetConnectedToId(e){return this.idToNetMap[e]}areIdsConnected(e,t){if(e===t)return!0;let n=this.getNetConnectedToId(e);if(!n)return!1;let o=this.getNetConnectedToId(t);return!!o&&(n===o||o===e||o===e)}areAllIdsConnected(e){let t=this.getNetConnectedToId(e[0]);for(let n of e){let o=this.getNetConnectedToId(n);if(o===void 0)return!1;if(o!==t)return!1}return!0}},fV=(e)=>{let t=[];for(let o of e)if(o.type==="source_trace")t.push([o.source_trace_id,...o.connected_source_port_ids??[],...o.connected_source_net_ids??[]].filter(Boolean));else if(o.type==="pcb_port"){let{pcb_port_id:r,source_port_id:i}=o;i&&r&&t.push([i,r])}else if(o.type==="pcb_smtpad"){let{pcb_smtpad_id:r,pcb_port_id:i}=o;i&&r&&t.push([r,i])}else if(o.type==="pcb_plated_hole"){let{pcb_plated_hole_id:r,pcb_port_id:i}=o;i&&r&&t.push([r,i])}else if(o.type==="pcb_trace"){let{pcb_trace_id:r,source_trace_id:i}=o,s=Array.isArray(o.route)?o.route.filter((a)=>a&&a.route_type==="wire"):[];if(i&&r&&t.push([r,i]),Array.isArray(s)){let a=s.find((l)=>l?.start_pcb_port_id)?.start_pcb_port_id,c=s.find((l)=>l?.end_pcb_port_id)?.end_pcb_port_id;a&&r&&t.push([a,r]),r&&c&&t.push([r,c])}}else if(o.type==="pcb_via"){let{pcb_via_id:r,pcb_trace_id:i,source_trace_id:s,source_net_id:a}=o,c=[...o.pcb_port_ids??[],i,s,a].filter((l)=>Boolean(l));r&&c.length>0&&t.push([r,...c])}else if(o.type==="source_component"&&o.internally_connected_source_port_ids)for(let r of o.internally_connected_source_port_ids)t.push(r);let n=f$e(t);return new eV(n)},Ymr=class{circuitJson;traceIdToElm;portIdToElm;connMap;constructor(e){this.circuitJson=e||[],this.traceIdToElm=new Map,this.portIdToElm=new Map,e?(this._buildTraceMap(),this._buildPortMap(),this.connMap=this._buildTraceConnectivityMap()):this.connMap=new eV({})}_buildPortMap(){for(let e of this.circuitJson)e.type==="pcb_port"&&this.portIdToElm.set(e.pcb_port_id,e)}_buildTraceMap(){for(let e of this.circuitJson)e.type==="pcb_trace"&&this.traceIdToElm.set(e.pcb_trace_id,e)}_buildTraceConnectivityMap(){let e=[],t=Array.from(this.traceIdToElm.keys());for(let n=0;n<t.length;n++)for(let o=n+1;o<t.length;o++){let r=this.traceIdToElm.get(t[n]),i=this.traceIdToElm.get(t[o]);this._arePcbTracesConnected(r,i)&&e.push([t[n],t[o]])}for(let n of this.portIdToElm.values())for(let o of this.traceIdToElm.values())for(let r of o.route)r.route_type==="wire"&&(r.start_pcb_port_id===n.pcb_port_id?e.push([n.pcb_port_id,o.pcb_trace_id]):r.end_pcb_port_id===n.pcb_port_id&&e.push([o.pcb_trace_id,n.pcb_port_id]));return new eV(f$e(e))}addTrace(e){this.traceIdToElm.set(e.pcb_trace_id,e);let t=[];for(let n of e.route)n.route_type==="wire"&&(n.start_pcb_port_id&&t.push([n.start_pcb_port_id,e.pcb_trace_id]),n.end_pcb_port_id&&t.push([n.end_pcb_port_id,e.pcb_trace_id]));this.connMap.addConnections(t)}_arePcbTracesConnected(e,t){for(let n=0;n<e.route.length-1;n++){let o=e.route[n],r=e.route[n+1];if(o.route_type!=="wire")continue;if(r.route_type!=="wire")continue;if(o.layer!==r.layer)continue;let i=Math.min(o.x,r.x),s=Math.min(o.y,r.y),a=Math.max(o.x,r.x),c=Math.max(o.y,r.y),l=Number.isFinite(i)&&Number.isFinite(s)&&Number.isFinite(a)&&Number.isFinite(c);for(let h=0;h<t.route.length-1;h++){let d=t.route[h],u=t.route[h+1];if(d.route_type!=="wire")continue;if(u.route_type!=="wire")continue;if(d.layer!==u.layer)continue;if(o.layer!==d.layer)continue;let _=(o.width+d.width)/2,p=Math.max(0,_)+0.000000001;if(l&&Number.isFinite(d.x)&&Number.isFinite(d.y)&&Number.isFinite(u.x)&&Number.isFinite(u.y)&&Number.isFinite(_)&&(Math.min(d.x,u.x)>a+p||Math.max(d.x,u.x)<i-p||Math.min(d.y,u.y)>c+p||Math.max(d.y,u.y)<s-p))continue;if(Vmr([o,r],[d,u],{lineThickness:_}))return!0}}return!1}areTracesConnected(e,t){return this.connMap.areIdsConnected(e,t)}getAllTracesConnectedToTrace(e){let t=this.connMap.getNetConnectedToId(e);return t?this.connMap.getIdsConnectedToNet(t).filter((n)=>this.traceIdToElm.has(n)).map((n)=>this.traceIdToElm.get(n)):[]}getAllTracesConnectedToPort(e){let t=this.connMap.getNetConnectedToId(e);return t?this.connMap.getIdsConnectedToNet(t).filter((n)=>this.traceIdToElm.has(n)).map((n)=>this.traceIdToElm.get(n)):[]}},wFt=(e)=>`${Math.round(100*e.x)},${Math.round(100*e.y)}`,Ep=(e)=>{let t=new eV({});for(let n of e.connections){for(let o of n.__rootConnectionNames??[])t.addConnections([[n.name,o]]);n.__netConnectionName&&t.addConnections([[n.name,n.__netConnectionName]]);for(let o of n.pointsToConnect)t.addConnections([[n.name,`${wFt(o)}:${zx(o).map((r)=>ti(r,e.layerCount)).sort().join("-")}`]]),"pcb_port_id"in o&&o.pcb_port_id&&t.addConnections([[n.name,o.pcb_port_id]]),o.pointId&&t.addConnections([[n.name,o.pointId]])}for(let n of e.obstacles){let o=n.offBoardConnectsTo??[],r=Array.from(new Set([n.obstacleId,...n.connectedTo,...o,`${wFt(n.center)}:${n.layers.map((i)=>ti(i,e.layerCount)).sort().join("-")}`].filter(Boolean)));r.length>0&&t.addConnections([r])}for(let n of e.traces??[]){let o=Array.from(new Set([n.pcb_trace_id,n.connection_name,...n.connectsTo??[]].filter(Boolean)));o.length>0&&t.addConnections([o])}return t},SQ=(e)=>{let t=new eV({});for(let n of e.connections){let o=n.externallyConnectedPointIds??[];t.addConnections(o)}for(let n of e.traces??[]){let o=n.connectsTo??[];o.length!==0&&t.addConnections([[n.pcb_trace_id,...o]])}return t},Kr=class{MAX_ITERATIONS=1000;solved=!1;failed=!1;iterations=0;progress=0;error=null;activeSubSolver;failedSubSolvers;timeToSolve;stats={};pendingEffects;cacheHit;cacheKey;cacheToSolveSpaceTransform;getSolverName(){return this.constructor.name}step(){if(!this.solved&&!this.failed){this.iterations++;try{this._step()}catch(e){throw this.error=`${this.getSolverName()} error: ${e}`,console.error(this.error),this.failed=!0,e}!this.solved&&this.iterations>this.MAX_ITERATIONS&&this.tryFinalAcceptance(),!this.solved&&this.iterations>this.MAX_ITERATIONS&&(this.error=`${this.getSolverName()} ran out of iterations (MAX_ITERATIONS=${this.MAX_ITERATIONS})`,this.failed=!0),"computeProgress"in this&&(this.progress=this.computeProgress())}}_step(){}getConstructorParams(){throw Error("getConstructorParams not implemented")}solve(){let e=Date.now();for(;!this.solved&&!this.failed;)this.step();let t=Date.now();this.timeToSolve=t-e}visualize(){return{lines:[],points:[],rects:[],circles:[]}}tryFinalAcceptance(){}preview(){return{lines:[],points:[],rects:[],circles:[]}}};function j$(e){let t=new Map;for(let n of e)for(let o of n.nodeIds)t.set(o,[...t.get(o)??[],n]);return t}var yV=class extends Kr{getSolverName(){return"AvailableSegmentPointSolver"}nodes;edges;traceWidth;obstacleMargin;minPortSpacing;nodeMap;nodeEdgeMap;sharedEdgeSegments=[];edgeSegmentMap=new Map;portPointMap=new Map;colorMap;shouldReturnCrampedPortPoints;constructor({nodes:e,edges:t,traceWidth:n,obstacleMargin:o,colorMap:r,shouldReturnCrampedPortPoints:i}){super(),this.nodes=e,this.edges=t,this.traceWidth=n,this.obstacleMargin=o??0.15,this.shouldReturnCrampedPortPoints=i,this.minPortSpacing=this.traceWidth+this.obstacleMargin,this.colorMap=r??{},this.nodeMap=new Map(e.map((s)=>[s.capacityMeshNodeId,s])),this.nodeEdgeMap=j$(t),this.MAX_ITERATIONS=1}_step(){this.computeAllSharedEdgeSegments(),this.solved=!0}computeAllSharedEdgeSegments(){for(let e of this.edges){let[t,n]=e.nodeIds,o=this.nodeMap.get(t),r=this.nodeMap.get(n);if(!o||!r)continue;let i=this.computeSharedEdgeSegment(e,o,r);if(i){this.sharedEdgeSegments.push(i),this.edgeSegmentMap.set(e.capacityMeshEdgeId,i);for(let s of i.portPoints)this.portPointMap.set(s.segmentPortPointId,s)}}}computeSharedEdgeSegment(e,t,n){let o=this.findOverlappingSegment(t,n);if(!o)return null;let r=t.availableZ.filter((g)=>n.availableZ.includes(g));if(r.length===0)return null;let i=Math.sqrt((o.end.x-o.start.x)**2+(o.end.y-o.start.y)**2),s=Boolean(t._isNarrowQfpPadGap||n._isNarrowQfpPadGap),a=3*this.minPortSpacing/4,c=Math.max(0,i-2*a);if(c<=0&&!t._containsTarget&&!n._containsTarget){if(!this.shouldReturnCrampedPortPoints)return null;let g=[];for(let f of r)g.push({segmentPortPointId:`${e.capacityMeshEdgeId}_pp0_z${f}_cramped`,x:(o.start.x+o.end.x)/2,y:(o.start.y+o.end.y)/2,availableZ:[f],nodeIds:[t.capacityMeshNodeId,n.capacityMeshNodeId],edgeId:e.capacityMeshEdgeId,connectionName:null,distToCentermostPortOnZ:0,cramped:!0});return{edgeId:e.capacityMeshEdgeId,nodeIds:[t.capacityMeshNodeId,n.capacityMeshNodeId],start:o.start,end:o.end,availableZ:r,portPoints:g}}let l=Math.max(1,Math.floor(c/this.minPortSpacing)+1);if(t._offBoardConnectionId||n._offBoardConnectionId){if(t._offBoardConnectionId&&!n._offBoardConnectionId){if(this.shouldSkipOffBoardPortPoint(t,n))return null}else if(n._offBoardConnectionId&&!t._offBoardConnectionId&&this.shouldSkipOffBoardPortPoint(n,t))return null;l=1}let h=[],d=o.end.x-o.start.x,u=o.end.y-o.start.y,_=(o.start.x+o.end.x)/2,p=(o.start.y+o.end.y)/2;l>5&&(l=5+Math.floor(l/4));let m=[];for(let g=0;g<l;g++){let f;f=i===0||l===1?0.5:(a+c*g/(l-1))/i;let y=o.start.x+d*f,x=o.start.y+u*f,C=Math.sqrt((y-_)**2+(x-p)**2);m.push({x:y,y:x,distToCenter:C})}let A=m.reduce((g,f)=>f.distToCenter<g.distToCenter?f:g);for(let g=0;g<l;g++){let{x:f,y}=m[g],x=Math.sqrt((f-A.x)**2+(y-A.y)**2);for(let C of r){let b={segmentPortPointId:`${e.capacityMeshEdgeId}_pp${g}_z${C}`,x:f,y,availableZ:[C],nodeIds:[t.capacityMeshNodeId,n.capacityMeshNodeId],edgeId:e.capacityMeshEdgeId,connectionName:null,distToCentermostPortOnZ:x,cramped:s};h.push(b)}}return{edgeId:e.capacityMeshEdgeId,nodeIds:[t.capacityMeshNodeId,n.capacityMeshNodeId],start:o.start,end:o.end,availableZ:r,portPoints:h}}shouldSkipOffBoardPortPoint(e,t){let n=this.nodeEdgeMap.get(t.capacityMeshNodeId)??[];for(let o of n){let r=o.nodeIds[0]===t.capacityMeshNodeId?o.nodeIds[1]:o.nodeIds[0];if(r===e.capacityMeshNodeId)continue;let i=this.nodeMap.get(r);if(i?._offBoardConnectionId!==e._offBoardConnectionId)continue;if(this.nodes.filter((a)=>a._offBoardConnectionId===e._offBoardConnectionId).length!==2)continue;let s={x:(e.center.x+i.center.x)/2,y:(e.center.y+i.center.y)/2};if(s.x>=t.center.x-t.width/2&&s.x<=t.center.x+t.width/2&&s.y>=t.center.y-t.height/2&&s.y<=t.center.y+t.height/2)return!0}return!1}findOverlappingSegment(e,t){let n={start:Math.max(e.center.x-e.width/2,t.center.x-t.width/2),end:Math.min(e.center.x+e.width/2,t.center.x+t.width/2)},o={start:Math.max(e.center.y-e.height/2,t.center.y-t.height/2),end:Math.min(e.center.y+e.height/2,t.center.y+t.height/2)},r=n.end-n.start,i=o.end-o.start;if(r<-0.0001||i<-0.0001)return null;if(r<i){let s=(n.start+n.end)/2;return{start:{x:s,y:o.start},end:{x:s,y:o.end}}}{let s=(o.start+o.end)/2;return{start:{x:n.start,y:s},end:{x:n.end,y:s}}}}getAvailablePortPointsBetweenNodes(e,t){let n=this.edges.find((r)=>r.nodeIds[0]===e&&r.nodeIds[1]===t||r.nodeIds[0]===t&&r.nodeIds[1]===e);if(!n)return[];let o=this.edgeSegmentMap.get(n.capacityMeshEdgeId);return o?o.portPoints.filter((r)=>r.connectionName===null):[]}getPortPointsForEdge(e,t){let n=this.edges.find((r)=>r.nodeIds[0]===e&&r.nodeIds[1]===t||r.nodeIds[0]===t&&r.nodeIds[1]===e);if(!n)return[];return this.edgeSegmentMap.get(n.capacityMeshEdgeId)?.portPoints??[]}assignPortPoint(e,t,n){let o=this.portPointMap.get(e);return!!o&&(o.connectionName===null&&(o.connectionName=t,o.rootConnectionName=n,!0))}releasePortPoint(e){let t=this.portPointMap.get(e);return!!t&&(t.connectionName=null,t.rootConnectionName=void 0,!0)}getAvailablePortCountForEdge(e,t){return this.getAvailablePortPointsBetweenNodes(e,t).length}getOutput(){return this.sharedEdgeSegments}visualize(){let e={lines:[],points:[],rects:[],circles:[]};for(let t of this.sharedEdgeSegments){e.lines.push({points:[t.start,t.end],strokeColor:"rgba(100, 100, 100, 0.5)"});for(let n of t.portPoints){let o=n.connectionName?this.colorMap[n.connectionName]??"blue":"rgba(0, 200, 0, 0.7)";n.cramped?e.rects.push({center:{x:n.x,y:n.y},width:0.1,height:0.1,fill:o,layer:`z${n.availableZ.join(",")}`,label:`cramped ${n.segmentPortPointId}`}):e.circles.push({center:{x:n.x,y:n.y},radius:this.traceWidth/2,fill:o,layer:`z${n.availableZ.join(",")}`,label:[n.segmentPortPointId,n.connectionName,n.availableZ.join(","),`cd: ${n.distToCentermostPortOnZ}`,`connects: ${n.nodeIds.join(",")}`].filter(Boolean).join(`
`)})}}return e}};function Nbe(e,t){let n=e.center.x-e.width/2,o=e.center.x+e.width/2,r=e.center.y-e.height/2,i=e.center.y+e.height/2,s=t.center.x-t.width/2,a=t.center.x+t.width/2,c=t.center.y-t.height/2,l=t.center.y+t.height/2,d=(Math.abs(o-s)<0.001||Math.abs(n-a)<0.001)&&Math.min(i,l)-Math.max(r,c)>=0.001,u=(Math.abs(i-c)<0.001||Math.abs(r-l)<0.001)&&Math.min(o,a)-Math.max(n,s)>=0.001;return d||u}var Gmr=class extends Kr{constructor(e){super(),this.nodes=e,this.edges=[]}nodes;getSolverName(){return"CapacityMeshEdgeSolver"}edges;nodeMap;getNextCapacityMeshEdgeId(){return`ce${this.edges.length}`}_step(){this.edges=[];for(let e=0;e<this.nodes.length;e++)for(let t=e+1;t<this.nodes.length;t++)!(this.nodes[e]._strawNode&&this.nodes[t]._strawNode&&this.nodes[e]._strawParentCapacityMeshNodeId===this.nodes[t]._strawParentCapacityMeshNodeId)&&Nbe(this.nodes[e],this.nodes[t])&&this.doNodesHaveSharedLayer(this.nodes[e],this.nodes[t])&&this.edges.push({capacityMeshEdgeId:this.getNextCapacityMeshEdgeId(),nodeIds:[this.nodes[e].capacityMeshNodeId,this.nodes[t].capacityMeshNodeId]});this.handleTargetNodes(),this.solved=!0}handleTargetNodes(){let e=this.nodes.filter((n)=>n._containsTarget),t=new Map(this.nodes.map((n)=>[n.capacityMeshNodeId,n]));for(let n=0;n<e.length;n++)for(let o=n+1;o<e.length;o++){let r=e[n],i=e[o];this.doNodesHaveSharedLayer(r,i)&&(this.doNodesTouchOrOverlap(r,i)&&(this.hasEdgeBetween(r,i)||this.edges.push({capacityMeshEdgeId:this.getNextCapacityMeshEdgeId(),nodeIds:[r.capacityMeshNodeId,i.capacityMeshNodeId]})))}for(let n of e){if(!n._containsObstacle||!n._targetConnectionName)continue;if(!this.edges.some((o)=>{if(!o.nodeIds.includes(n.capacityMeshNodeId))return!1;let r=o.nodeIds[0]===n.capacityMeshNodeId?o.nodeIds[1]:o.nodeIds[0],i=t.get(r);return!!i&&(!i._containsObstacle&&!i._containsTarget&&this.doNodesHaveSharedLayer(n,i))}))throw Error(`Target obstacle region "${n.capacityMeshNodeId}" for connection "${n._targetConnectionName}" has no bordering routing edge`)}}doNodesHaveSharedLayer(e,t){return e.availableZ.some((n)=>t.availableZ.includes(n))}hasEdgeBetween(e,t){return this.edges.some((n)=>n.nodeIds.includes(e.capacityMeshNodeId)&&n.nodeIds.includes(t.capacityMeshNodeId))}doNodesTouchOrOverlap(e,t){let o=e.center.x-e.width/2,r=e.center.x+e.width/2,i=e.center.y-e.height/2,s=e.center.y+e.height/2,a=t.center.x-t.width/2,c=t.center.x+t.width/2,l=t.center.y-t.height/2,h=t.center.y+t.height/2;return o<=c+0.001&&r+0.001>=a&&i<=h+0.001&&s+0.001>=l}visualize(){let e=new Map;for(let n of this.edges)for(let o of n.nodeIds)e.set(o,1+(e.get(o)??0));let t={lines:[],points:[],rects:this.nodes.map((n)=>{let o=Math.min(...n.availableZ);return{width:Math.max(n.width-2,0.8*n.width),height:Math.max(n.height-2,0.8*n.height),center:{x:n.center.x+o*n.width*0.05,y:n.center.y-o*n.width*0.05},fill:n._containsObstacle?"rgba(255,0,0,0.1)":{"0,1":"rgba(0,0,0,0.1)",0:"rgba(0,200,200, 0.1)",1:"rgba(0,0,200, 0.1)"}[n.availableZ.join(",")]??"rgba(0,200,200,0.1)",label:[n.capacityMeshNodeId,`availableZ: ${n.availableZ.join(",")}`,`target? ${n._containsTarget??!1}`,`obs? ${n._containsObstacle??!1}`,`conn: ${e.get(n.capacityMeshNodeId)??0}`].join(`
`),layer:`z${n.availableZ.join(",")}`}}),circles:[]};if(!this.nodeMap){this.nodeMap=new Map;for(let n of this.nodes)this.nodeMap.set(n.capacityMeshNodeId,n)}for(let n of this.edges){let o=this.nodeMap.get(n.nodeIds[0]),r=this.nodeMap.get(n.nodeIds[1]);if(o?.center&&r?.center){let i=Math.min(...o.availableZ),s=Math.min(...r.availableZ),a={x:o.center.x+i*o.width*0.05,y:o.center.y-i*o.width*0.05},c={x:r.center.x+s*r.width*0.05,y:r.center.y-s*r.width*0.05},l=Array.from(new Set([...o.availableZ,...r.availableZ])).sort();t.lines.push({layer:`z${l.join(",")}`,points:[a,c],strokeDash:o.availableZ.join(",")===r.availableZ.join(",")?void 0:"10 5"})}}return t}},y$e=class{constructor(e){this.nodes=e,this.buckets=new Map;for(let t of e){let n=t.center.x-t.width/2,o=t.center.y-t.height/2,r=t.center.x+t.width/2,i=t.center.y+t.height/2,s=Math.floor(n/this.CELL_SIZE),a=Math.floor(r/this.CELL_SIZE),c=Math.floor(o/this.CELL_SIZE),l=Math.floor(i/this.CELL_SIZE);for(let h=s;h<=a;h++)for(let d=c;d<=l;d++){let u=`${h}x${d}`,_=this.buckets.get(u);_?_.push(t):this.buckets.set(u,[t])}}}nodes;buckets;CELL_SIZE=0.4;getBucketKey(e,t){return`${Math.floor(e/this.CELL_SIZE)}x${Math.floor(t/this.CELL_SIZE)}`}getNodesInArea(e,t,n,o){let r=[],i=new Set,s=e-n/2,a=t-o/2,c=e+n/2,l=t+o/2,h=Math.floor(s/this.CELL_SIZE),d=Math.floor(c/this.CELL_SIZE),u=Math.floor(a/this.CELL_SIZE),_=Math.floor(l/this.CELL_SIZE);for(let p=h;p<=d;p++)for(let m=u;m<=_;m++){let A=`${p}x${m}`,g=this.buckets.get(A)||[];for(let f of g)i.has(f.capacityMeshNodeId)||(i.add(f.capacityMeshNodeId),r.push(f))}return r}},PQ=class extends Gmr{constructor(e){super(e),this.nodes=e,this.MAX_ITERATIONS=1e7,this.nodeTree=new y$e(this.nodes),this.currentNodeIndex=0,this.edgeSet=new Set}nodes;getSolverName(){return"CapacityMeshEdgeSolver2_NodeTreeOptimization"}nodeTree;currentNodeIndex;edgeSet;_step(){if(this.currentNodeIndex>=this.nodes.length)return this.handleTargetNodes(),void(this.solved=!0);let e=this.nodes[this.currentNodeIndex],t=this.nodeTree.getNodesInArea(e.center.x,e.center.y,2*e.width,2*e.height);for(let n of t){if(!Nbe(e,n))continue;let o=e._strawNode&&n._strawNode&&e._strawParentCapacityMeshNodeId===n._strawParentCapacityMeshNodeId;e.capacityMeshNodeId===n.capacityMeshNodeId||o||!this.doNodesHaveSharedLayer(e,n)||this.edgeSet.has(`${e.capacityMeshNodeId}-${n.capacityMeshNodeId}`)||(this.edgeSet.add(`${e.capacityMeshNodeId}-${n.capacityMeshNodeId}`),this.edgeSet.add(`${n.capacityMeshNodeId}-${e.capacityMeshNodeId}`),this.edges.push({capacityMeshEdgeId:this.getNextCapacityMeshEdgeId(),nodeIds:[e.capacityMeshNodeId,n.capacityMeshNodeId]}))}this.currentNodeIndex++}},sl=(...e)=>{let t={points:[],lines:[],circles:[],rects:[],polygons:[],infiniteLines:[],arrows:[],texts:[]};return e.forEach((n,o)=>{n&&(n.lines&&(t.lines=[...t.lines||[],...n.lines.map((r)=>({...r,step:o}))]),n.points&&(t.points=[...t.points||[],...n.points.map((r)=>({...r,step:o}))]),n.circles&&(t.circles=[...t.circles||[],...n.circles.map((r)=>({...r,step:o}))]),n.rects&&(t.rects=[...t.rects||[],...n.rects.map((r)=>({...r,step:o}))]),n.polygons&&(t.polygons=[...t.polygons||[],...n.polygons.map((r)=>({...r,step:o}))]),n.infiniteLines&&(t.infiniteLines=[...t.infiniteLines||[],...n.infiniteLines.map((r)=>({...r,step:o}))]),n.arrows&&(t.arrows=[...t.arrows||[],...n.arrows.map((r)=>({...r,step:o}))]),n.texts&&(t.texts=[...t.texts||[],...n.texts.map((r)=>({...r,step:o}))]))}),t};function Rbe(e,t,n){let o=[],r=null;for(let i=0;i<e.length;i++){let s=e[i];r?r.z===s.z?r.points.push({x:s.x,y:s.y}):(o.push(r),r={points:[{x:s.x,y:s.y}],z:s.z,connectionName:t,color:n}):r={points:[{x:s.x,y:s.y}],z:s.z,connectionName:t,color:n},i===e.length-1&&r&&o.push(r)}return o}function O7(e,t){return{x:e.a*t.x+e.b*t.y+e.c,y:e.d*t.x+e.e*t.y+e.f}}var sje=(e,t,n)=>{let[o,r]=e;if(o===r)return;let i=((s,a)=>{let c=s.portPointId??`${s.connectionName}:${s.x}:${s.y}:${s.z}`,l=a.portPointId??`${a.connectionName}:${a.x}:${a.y}:${a.z}`;return c<l?`${c}|${l}`:`${l}|${c}`})(o,r);t.has(i)||(t.add(i),n.push(e))},BFt=(e,t,n)=>{for(let o=0;o<e.length-1;o++)sje([e[o],e[o+1]],t,n)},AXt=(e)=>{let t=[],n=new Set,o=((s)=>{let a=new Map;for(let c of s)c.portPointId&&a.set(c.portPointId,c);return a})(e);for(let s of e){if(s.prevPortPointId){let a=o.get(s.prevPortPointId);a&&a.connectionName===s.connectionName&&sje([a,s],n,t)}if(s.nextPortPointId){let a=o.get(s.nextPortPointId);a&&a.connectionName===s.connectionName&&sje([s,a],n,t)}}if(t.length===0)return BFt(e,n,t),t;let r=((s)=>{let a=new Set;for(let[c,l]of s)c.portPointId&&a.add(c.portPointId),l.portPointId&&a.add(l.portPointId);return a})(t),i=e.filter((s)=>!s.portPointId||!r.has(s.portPointId));return BFt(i,n,t),t};function Q4e(e,t,n){return Math.max(t,Math.min(n,e))}function fXt(e){let t=e.planeSize*e.layers,n=e.connectionCount,o=Math.sqrt(n),r=Math.max(1,e.maxIterations),i=Q4e(Math.round(t*(8+1.2*o)),150000,12000000),s=Q4e(Math.round(i*e.effort),150000,12000000),a=Q4e(Math.round(0.2*r),150000,2000000);return{maxIterationsIters:Math.max(1,Math.min(r,Math.max(a,s))),baseSearchBudgetIters:Q4e(Math.round(t*(10+0.8*o)*e.effort),50000,4000000)}}function eWe(e,t){for(let n=e;n;n=n.prev)if(n.id===t)return!0;return!1}var Umr=class{f=[];seq=[];id=[];n=0;push(e,t,n){let o=this.n++;for(this.f[o]=e,this.seq[o]=t,this.id[o]=n;o>0;){let r=o-1>>1;if(this.less(r,o))break;this.swap(o,r),o=r}}pop(){let e=this.id[0];return this.n--,this.n>0&&(this.f[0]=this.f[this.n],this.seq[0]=this.seq[this.n],this.id[0]=this.id[this.n],this.siftDown(0)),e}get size(){return this.n}clear(){this.n=0}siftDown(e){for(;;){let t=2*e+1,n=t+1;if(t>=this.n)return;let o=t;if(n<this.n&&!this.less(t,n)&&(o=n),this.less(e,o))return;this.swap(e,o),e=o}}less(e,t){let n=this.f[e],o=this.f[t];return n!==o?n<o:this.seq[e]<this.seq[t]}swap(e,t){let n=this.f[e];this.f[e]=this.f[t],this.f[t]=n;let o=this.seq[e];this.seq[e]=this.seq[t],this.seq[t]=o;let r=this.id[e];this.id[e]=this.id[t],this.id[t]=r}},Wmr=[-1,-1,-1,0,0,1,1,1],Xmr=[-1,0,1,-1,1,-1,0,1],k4e=class extends fa{getSolverName(){return"HighDensitySolverA01"}nodeWithPortPoints;cellSizeMm;viaDiameter;MAX_RIPS;maxCellCount;traceThickness;traceMargin;viaMinDistFromBorder;showPenaltyMap;showUsedCellMap;effort;stepMultiplier;hyperParameters;initialPenaltyFn;useExactViaTraceClearance=!1;ripHistoryCostMultiplier=0;rows;cols;layers;gridOrigin;gridToBoundsTransform;availableZ;zToLayer;layerToZ;connNameToId;connIdToName;connIdToRootNet;overlapFriendlyRootNets;planeSize;usedCellsFlat;portOwnerFlat;usedDiagFlat;penalty2d;visitedStamp;sharedCrossRootPortCells;stamp=0;viaOccupantScanOffsetsDr;viaOccupantScanOffsetsDc;viaOccupantScanOffsetsLen;viaOwnersByCell;viaCenterIndicesByConn;viaTraceClearanceMm;outputCellStepX;outputCellStepY;minViaRow;maxViaRow;minViaCol;maxViaCol;usedIndicesByConn;usedDiagIndicesByConn;unsolvedSegs;solvedRoutes;activeConnSeg=null;activeConnId=-1;crossLayerSearch=!1;nodePool;heap;seqCounter=0;_viaOccs=[];viaOccupantsByCell=new Map;ripCount;totalRipEvents=0;searchIterations=0;consecutiveSkips=0;penaltyCap;baseSearchBudgetIters;_moveCost=0;_moveRipped=null;get unsolvedConnections(){return this.unsolvedSegs}get solvedConnectionsMap(){return this.solvedRoutes}get activeConnection(){if(!this.activeConnSeg)return null;let e=this.activeConnSeg;return{connectionName:this.connIdToName[e.connId]??"",start:{row:e.startRow,col:e.startCol,z:e.startZ,x:0,y:0},end:{row:e.endRow,col:e.endCol,z:e.endZ,x:0,y:0}}}get openSet(){return{length:this.heap?.size??0}}get gridStats(){return{cells:this.planeSize||0,layers:this.layers||0,states:(this.planeSize||0)*(this.layers||0)}}constructor(e){super(),this.nodeWithPortPoints=e.nodeWithPortPoints,this.cellSizeMm=e.cellSizeMm,this.viaDiameter=e.viaDiameter,this.maxCellCount=e.maxCellCount,this.traceThickness=e.traceThickness??0.1,this.traceMargin=e.traceMargin??0.15,this.viaMinDistFromBorder=e.viaMinDistFromBorder??0.15,this.showPenaltyMap=e.showPenaltyMap??!1,this.showUsedCellMap=e.showUsedCellMap??!1,this.effort=e.effort??1,this.stepMultiplier=Math.max(1,Math.floor(e.stepMultiplier??1)),this.hyperParameters={shuffleSeed:0,ripCost:10,ripTracePenalty:0.5,ripViaPenalty:0.75,viaBaseCost:0.1,greedyMultiplier:1.5,...e.hyperParameters},this.MAX_ITERATIONS=1e8,this.MAX_RIPS=200,this.initialPenaltyFn=e.initialPenaltyFn}getConstructorParams(){return[{nodeWithPortPoints:this.nodeWithPortPoints,cellSizeMm:this.cellSizeMm,viaDiameter:this.viaDiameter,maxCellCount:this.maxCellCount,stepMultiplier:this.stepMultiplier,traceThickness:this.traceThickness,traceMargin:this.traceMargin,viaMinDistFromBorder:this.viaMinDistFromBorder,showPenaltyMap:this.showPenaltyMap,showUsedCellMap:this.showUsedCellMap,effort:this.effort,hyperParameters:this.hyperParameters,initialPenaltyFn:this.initialPenaltyFn}]}_setup(){let{nodeWithPortPoints:e,cellSizeMm:t}=this,{width:n,height:o,center:r}=e;this.availableZ=e.availableZ??[...new Set(e.portPoints.map((h)=>h.z))].sort((h,d)=>h-d),this.rows=Math.floor(o/t),this.cols=Math.floor(n/t),this.layers=this.availableZ.length,this.planeSize=this.rows*this.cols;let i=this.layers*this.planeSize;if(this.maxCellCount!==void 0&&i>this.maxCellCount)return this.error=`Cell count ${i} exceeds maxCellCount ${this.maxCellCount}`,void(this.failed=!0);let s=this.layers*Math.max(0,this.rows-1)*Math.max(0,this.cols-1)*2;this.zToLayer=new Map,this.layerToZ=new Map;for(let h=0;h<this.availableZ.length;h++){let d=this.availableZ[h];this.zToLayer.set(d,h),this.layerToZ.set(h,d)}if(this.gridOrigin={x:r.x-n/2,y:r.y-o/2},this.gridToBoundsTransform=function(h){let{originX:d,originY:u,rows:_,cols:p,cellSizeMm:m,width:A,height:g}=h,f,y,x,C;return p>1?(f=A/((p-1)*m),y=d*(1-f)-0.5*m*f):(f=1,y=d+A/2-(d+0.5*m)),_>1?(x=g/((_-1)*m),C=u*(1-x)-0.5*m*x):(x=1,C=u+g/2-(u+0.5*m)),{a:f,b:0,c:y,d:0,e:x,f:C}}({originX:this.gridOrigin.x,originY:this.gridOrigin.y,rows:this.rows,cols:this.cols,cellSizeMm:t,width:n,height:o}),this.outputCellStepX=this.cols>1?n/(this.cols-1):n,this.outputCellStepY=this.rows>1?o/(this.rows-1):o,this.connNameToId=new Map,this.connIdToName=[],this.connIdToRootNet=[],this.overlapFriendlyRootNets=new Set,this.penalty2d=new Float64Array(this.planeSize),this.initialPenaltyFn)for(let h=0;h<this.rows;h++){let d=h*this.cols;for(let u=0;u<this.cols;u++){let _=this.gridOrigin.x+(u+0.5)*t,p=this.gridOrigin.y+(h+0.5)*t,m=(u+0.5)/this.cols,A=(h+0.5)/this.rows;this.penalty2d[d+u]=this.initialPenaltyFn({x:_,y:p,px:m,py:A,row:h,col:u})}}this.usedCellsFlat=new Int32Array(i).fill(-1),this.portOwnerFlat=new Int32Array(i).fill(-1),this.usedDiagFlat=new Int32Array(s).fill(-1),this.visitedStamp=new Uint32Array(i),this.stamp=0;let a=function(h){let d=h.radiusMm/h.cellSizeMm,u=Math.round(d),_=Math.abs(d-u)<=0.000000001?u:Math.ceil(d),p=_*_,m=[],A=[];for(let g=-_;g<=_;g++)for(let f=-_;f<=_;f++)g*g+f*f<=p&&(m.push(g),A.push(f));return{rowOffsets:new Int32Array(m),columnOffsets:new Int32Array(A),length:m.length}}({radiusMm:this.viaDiameter/2,cellSizeMm:t});if(this.viaOccupantScanOffsetsLen=a.length,this.viaOccupantScanOffsetsDr=a.rowOffsets,this.viaOccupantScanOffsetsDc=a.columnOffsets,this.viaOwnersByCell=new Map,this.viaCenterIndicesByConn=[],this.viaTraceClearanceMm=this.viaDiameter/2+this.traceThickness/2,this.viaMinDistFromBorder>0){let h=Math.ceil(this.viaMinDistFromBorder/t);this.minViaRow=h,this.maxViaRow=this.rows-1-h,this.minViaCol=h,this.maxViaCol=this.cols-1-h}else this.minViaRow=0,this.maxViaRow=this.rows-1,this.minViaCol=0,this.maxViaCol=this.cols-1;this.unsolvedSegs=this.buildConnectionSegs(),this.sharedCrossRootPortCells=new Set;let c=new Map;for(let h of this.nodeWithPortPoints.portPoints){let d=this.connNameToId.get(h.connectionName);if(d===void 0)continue;let u=this.pointToCell(h),_=(u.z*this.rows+u.row)*this.cols+u.col,p=this.connIdToRootNet[d],m=c.get(_);m===void 0?c.set(_,p):m!==p&&this.sharedCrossRootPortCells.add(_);let A=this.portOwnerFlat[_];this.portOwnerFlat[_]=A===-1||A===d?d:-2}this.solvedRoutes=new Map,this.usedIndicesByConn=[],this.usedDiagIndicesByConn=[],this.ripCount=[],this.consecutiveSkips=0,this.penaltyCap=0.5*this.hyperParameters.ripCost,this.shuffleConnections();let l=fXt({planeSize:this.planeSize,layers:this.layers,connectionCount:this.unsolvedSegs.length,effort:this.effort,maxIterations:this.MAX_ITERATIONS});this.baseSearchBudgetIters=l.baseSearchBudgetIters,this.MAX_ITERATIONS=l.maxIterationsIters,this.activeConnSeg=null,this.activeConnId=-1,this.nodePool=[],this.heap=new Umr,this.seqCounter=0}_step(){for(let e=0;e<this.stepMultiplier;e++){if(this.solved||this.failed)return;this.stepOnce()}}stepOnce(){if(!this.activeConnSeg){if(this.unsolvedSegs.length===0)return void(this.solved=!0);let y=this.unsolvedSegs.shift();this.activeConnSeg=y,this.activeConnId=y.connId,this.crossLayerSearch=y.startZ!==y.endZ,this.viaOccupantsByCell.clear(),this.nodePool=[],this.heap.clear(),this.seqCounter=0,this.searchIterations=0,this.nextStamp();let x=this.computeH(y.startZ,y.startRow,y.startCol,y.endZ,y.endRow,y.endCol)*this.hyperParameters.greedyMultiplier;return this.nodePool.push({z:y.startZ,row:y.startRow,col:y.startCol,g:0,f:x,parentIdx:-1,ripped:null}),void this.heap.push(x,this.seqCounter++,0)}this.searchIterations++;let e=this.ripCount[this.activeConnId]??0,t=Math.round(this.baseSearchBudgetIters*(1+0.25*Math.min(e,10)));if(this.searchIterations>t){let y=this.penalty2d;for(let x=0;x<y.length;x++)y[x]=0.9*y[x];return this.unsolvedSegs.push(this.activeConnSeg),this.activeConnSeg=null,this.activeConnId=-1,this.heap.clear(),this.nodePool=[],this.consecutiveSkips++,void(this.consecutiveSkips>=3*this.unsolvedSegs.length&&(this.error=`Convergence failure: ${this.unsolvedSegs.length} connections stuck`,this.failed=!0))}if(this.heap.size===0)return this.error=`No path found for ${this.connIdToName[this.activeConnId]}`,void(this.failed=!0);let n=this.heap.pop(),o=this.nodePool[n],{z:r,row:i,col:s,g:a,ripped:c}=o,l=(r*this.rows+i)*this.cols+s;if(this.visitedStamp[l]===this.stamp)return;this.visitedStamp[l]=this.stamp;let h=this.activeConnSeg;if(r===h.endZ&&i===h.endRow&&s===h.endCol)return this.finalizeRoute(n),this.activeConnSeg=null,void(this.activeConnId=-1);let{endZ:d,endRow:u,endCol:_}=h,p=this.activeConnId,m=this.rows,A=this.cols,g=(this.cellSizeMm,this.visitedStamp),f=this.stamp;for(let y=0;y<8;y++){let x=i+Wmr[y],C=s+Xmr[y];if(x<0||x>=m||C<0||C>=A)continue;if(g[(r*m+x)*A+C]===f)continue;if(this.computeMoveCostAndRips(p,r,i,s,r,x,C,c),this._moveCost<0)continue;let b=a+this._moveCost,I=b+this.computeH(r,x,C,d,u,_)*this.hyperParameters.greedyMultiplier,v=this.nodePool.length;this.nodePool.push({z:r,row:x,col:C,g:b,f:I,parentIdx:n,ripped:this._moveRipped}),this.heap.push(I,this.seqCounter++,v)}if(i>=this.minViaRow&&i<=this.maxViaRow&&s>=this.minViaCol&&s<=this.maxViaCol)for(let y=0;y<this.layers;y++){if(y===r)continue;if(g[(y*m+i)*A+s]===f)continue;if(this.computeMoveCostAndRips(p,r,i,s,y,i,s,c),this._moveCost<0)continue;let x=a+this._moveCost,C=x+this.computeH(y,i,s,d,u,_)*this.hyperParameters.greedyMultiplier,b=this.nodePool.length;this.nodePool.push({z:y,row:i,col:s,g:x,f:C,parentIdx:n,ripped:this._moveRipped}),this.heap.push(C,this.seqCounter++,b)}}getRipCost(e){return this.hyperParameters.ripCost*(1+this.ripHistoryCostMultiplier*(this.ripCount[e]??0))}computeMoveCostAndRips(e,t,n,o,r,i,s,a){let c=0,l=a,h=this.cols;if(t!==r){c+=this.hyperParameters.viaBaseCost,c+=Math.min(this.penalty2d[i*h+s],this.penaltyCap);let d=(r*this.rows+i)*h+s,u=this.portOwnerFlat[d],_=this.connIdToRootNet[u]===this.connIdToRootNet[e]&&this.overlapFriendlyRootNets.has(this.connIdToRootNet[e]),p=this.activeConnSeg,m=!!p&&r===p.endZ&&i===p.endRow&&s===p.endCol;if(u>=0&&u!==e&&!_&&!m)return this._moveCost=-1,void(this._moveRipped=l);this.fillViaOccupants(i,s,e);let A=this._viaOccs;for(let g=0;g<A.length;g++){let f=A[g];eWe(l,f)||(c+=this.getRipCost(f),l={id:f,prev:l}),c+=this.hyperParameters.ripViaPenalty}}else{let d=n>i?n-i:i-n,u=o>s?o-s:s-o;c+=(d+u>1?Math.SQRT2:1)*this.cellSizeMm,c+=Math.min(this.penalty2d[i*h+s],this.penaltyCap);let _=(r*this.rows+i)*h+s,p=this.portOwnerFlat[_],m=this.connIdToRootNet[p]===this.connIdToRootNet[e]&&this.overlapFriendlyRootNets.has(this.connIdToRootNet[e]),A=this.activeConnSeg,g=!!A&&r===A.endZ&&i===A.endRow&&s===A.endCol;if(p>=0&&p!==e&&!m&&!g)return this._moveCost=-1,void(this._moveRipped=l);let f=this.usedCellsFlat[_],y=this.connIdToRootNet[f]===this.connIdToRootNet[e]&&this.overlapFriendlyRootNets.has(this.connIdToRootNet[e]);if(f===-1||f===e||y||(eWe(l,f)||(c+=this.getRipCost(f),l={id:f,prev:l}),c+=this.hyperParameters.ripTracePenalty),this.viaOwnersByCell.size>0){this.fillTraceSegmentViaOccupants(n,o,i,s,e);let x=this._viaOccs;for(let C=0;C<x.length;C++){let b=x[C];eWe(l,b)||(c+=this.getRipCost(b),l={id:b,prev:l}),c+=this.hyperParameters.ripViaPenalty}}if(d===1&&u===1){let x=n<i?n:i,C=o<s?o:s,b=1^(n<i&&o<s||n>i&&o>s?0:1),I=this.cols-1,v=2*((r*(this.rows-1)+x)*I+C),P=this.usedDiagFlat[v+b],M=this.connIdToRootNet[P]===this.connIdToRootNet[e]&&this.overlapFriendlyRootNets.has(this.connIdToRootNet[e]);if(P!==-1&&P!==e&&!M)return this._moveCost=-1,void(this._moveRipped=l)}}this._moveCost=c,this._moveRipped=l}fillViaOccupants(e,t,n){let o=this._viaOccs;o.length=0;let r=e*this.cols+t,i=this.viaOccupantsByCell.get(r);if(i){for(let u of i)o.push(u);return}let s=this.rows,a=this.cols,c=this.viaOccupantScanOffsetsDr,l=this.viaOccupantScanOffsetsDc,h=this.viaOccupantScanOffsetsLen,d=this.usedCellsFlat;for(let u=0;u<this.layers;u++){let _=u*this.planeSize;for(let p=0;p<h;p++){let m=e+c[p],A=t+l[p];if(m<0||A<0||m>=s||A>=a)continue;let g=d[_+m*a+A];if(g===-1||g===n)continue;if(this.connIdToRootNet[g]===this.connIdToRootNet[n]&&this.overlapFriendlyRootNets.has(this.connIdToRootNet[n]))continue;let f=!1;for(let y=0;y<o.length;y++)if(o[y]===g){f=!0;break}f||o.push(g)}}this.viaOccupantsByCell.set(r,o.slice())}fillTraceSegmentViaOccupants(e,t,n,o,r){let i=this._viaOccs;i.length=0;let s=Math.min(e,n),a=Math.max(e,n),c=Math.min(t,o),l=Math.max(t,o),h=this.viaTraceClearanceMm/this.outputCellStepY,d=this.viaTraceClearanceMm/this.outputCellStepX,u=(o-t)*this.outputCellStepX,_=(n-e)*this.outputCellStepY,p=u*u+_*_,m=this.viaTraceClearanceMm*this.viaTraceClearanceMm;for(let[A,g]of this.viaOwnersByCell){let f=Math.floor(A/this.cols),y=A-f*this.cols;if(f<s-h||f>a+h||y<c-d||y>l+d)continue;let x=(y-t)*this.outputCellStepX,C=(f-e)*this.outputCellStepY,b=p===0?0:Math.max(0,Math.min(1,(x*u+C*_)/p)),I=x-u*b,v=C-_*b;if(!(I*I+v*v>=m))for(let P of g){if(P===r)continue;this.connIdToRootNet[P]===this.connIdToRootNet[r]&&this.overlapFriendlyRootNets.has(this.connIdToRootNet[r])||(i.includes(P)||i.push(P))}}}shouldSkipFixedPortHalo(e,t){let n=this.portOwnerFlat[e];if(n===t)return!1;if(n===-2)return!0;if(n<0)return!1;return!(this.connIdToRootNet[n]===this.connIdToRootNet[t]&&this.overlapFriendlyRootNets.has(this.connIdToRootNet[t]))}nextStamp(){this.stamp=this.stamp+1>>>0,this.stamp===0&&(this.visitedStamp.fill(0),this.stamp=1)}computeH(e,t,n,o,r,i){let s=Math.abs(t-r)+Math.abs(n-i);if(e===o)return s*this.cellSizeMm;if(!this.crossLayerSearch)return s*this.cellSizeMm+this.hyperParameters.viaBaseCost;let a=Math.max(this.minViaRow,Math.min(this.maxViaRow,t)),c=Math.max(this.minViaCol,Math.min(this.maxViaCol,n)),l=Math.max(this.minViaRow,Math.min(this.maxViaRow,r)),h=Math.max(this.minViaCol,Math.min(this.maxViaCol,i)),d=Math.abs(t-a)+Math.abs(n-c)+Math.abs(a-r)+Math.abs(c-i),u=Math.abs(t-l)+Math.abs(n-h)+Math.abs(l-r)+Math.abs(h-i);return Math.max(Math.min(d,u),s)*this.cellSizeMm+this.hyperParameters.viaBaseCost}internConn(e,t){let n=this.connNameToId.get(e);if(n!==void 0)return n;let o=this.connIdToName.length;var r;return this.connIdToName.push(e),this.connIdToRootNet.push((r=e,t??r.replace(/_mst\d+$/,""))),this.connNameToId.set(e,o),o}buildConnectionSegs(){let e=new Map;for(let o of this.nodeWithPortPoints.portPoints){let r=o.connectionName;e.has(r)||e.set(r,{points:[],rootConnectionName:o.rootConnectionName}),e.get(r).points.push(o)}let t=[],n=new Set;for(let[o,r]of e){let i=r.points,s=AXt(i);if(s.length===0)continue;let a=this.internConn(o,r.rootConnectionName);for(let[c,l]of s){let h=this.pointToCell(c),d=this.pointToCell(l),u=`${h.z}:${h.row}:${h.col}`,_=`${d.z}:${d.row}:${d.col}`,p=u<_?`${u}|${_}`:`${_}|${u}`,m=r.rootConnectionName??o,A=`${m}|${p}`;n.has(A)?this.overlapFriendlyRootNets.add(m):(n.add(A),t.push({connId:a,startZ:h.z,startRow:h.row,startCol:h.col,startPoint:c,endZ:d.z,endRow:d.row,endCol:d.col,endPoint:l}))}}return t}pointToCell(e){let t=Math.max(0,Math.min(this.cols-1,Math.round((e.x-this.gridOrigin.x)/this.cellSizeMm-0.5))),n=Math.max(0,Math.min(this.rows-1,Math.round((e.y-this.gridOrigin.y)/this.cellSizeMm-0.5)));return{z:this.zToLayer.get(e.z)??0,row:n,col:t}}shuffleConnections(){let e=this.unsolvedSegs,t=this.hyperParameters.shuffleSeed,n=()=>(t=1664525*t+1013904223&4294967295,(t>>>0)/4294967295);for(let o=e.length-1;o>0;o--){let r=Math.floor(n()*(o+1)),i=e[o];e[o]=e[r],e[r]=i}}finalizeRoute(e){this.consecutiveSkips=Math.max(0,this.consecutiveSkips-1);let t=[],n=e;for(;n>=0;){let b=this.nodePool[n];t.push({z:b.z,row:b.row,col:b.col}),n=b.parentIdx}for(t.reverse();t.length>1;){let b=t[0],I=(b.z*this.rows+b.row)*this.cols+b.col;if(!this.sharedCrossRootPortCells.has(I))break;t.shift()}for(;t.length>1;){let b=t[t.length-1],I=(b.z*this.rows+b.row)*this.cols+b.col;if(!this.sharedCrossRootPortCells.has(I))break;t.pop()}let o=[];for(let b=1;b<t.length;b++)t[b].z!==t[b-1].z&&o.push({row:t[b].row,col:t[b].col});let r=t[0],i=t[t.length-1],s=this.activeConnId,a=[];for(let b=this.nodePool[e].ripped;b;b=b.prev)a.push(b.id);for(let b=0;b<a.length;b++)if(this.ripTrace(a[b]),this.failed)return;let c=Math.ceil(this.traceMargin/this.cellSizeMm),l=[],h=this.rows,d=this.cols,u=this.usedCellsFlat;for(let b=0;b<t.length;b++){let I=t[b];for(let v=-c;v<=c;v++)for(let P=-c;P<=c;P++){let M=I.row+v,B=I.col+P;if(M<0||M>=h||B<0||B>=d)continue;let T=(I.z*h+M)*d+B;if((M!==I.row||B!==I.col)&&this.shouldSkipFixedPortHalo(T,s))continue;let N=u[T],D=this.connIdToRootNet[N]===this.connIdToRootNet[s]&&this.overlapFriendlyRootNets.has(this.connIdToRootNet[s]);(N===-1||N===s||D)&&(u[T]=s,l.push(T))}}let _=[],p=this.viaOccupantScanOffsetsDr,m=this.viaOccupantScanOffsetsDc,A=this.viaOccupantScanOffsetsLen;for(let b=0;b<o.length;b++){let I=o[b];for(let v=0;v<this.layers;v++){let P=v*this.planeSize;for(let M=0;M<A;M++){let B=I.row+p[M],T=I.col+m[M];if(B<0||B>=h||T<0||T>=d)continue;let N=P+B*d+T;if((B!==I.row||T!==I.col)&&this.shouldSkipFixedPortHalo(N,s))continue;let D=u[N],L=this.connIdToRootNet[D]===this.connIdToRootNet[s]&&this.overlapFriendlyRootNets.has(this.connIdToRootNet[s]);if(D!==-1&&D!==s&&!L){let H=!1;for(let V=0;V<_.length;V++)if(_[V]===D){H=!0;break}H||_.push(D)}u[N]=s,l.push(N)}}}let g=[],f=this.cols-1;for(let b=1;b<t.length;b++){let I=t[b-1],v=t[b];if(I.z!==v.z)continue;let P=I.row>v.row?I.row-v.row:v.row-I.row,M=I.col>v.col?I.col-v.col:v.col-I.col;if(P!==1||M!==1)continue;let B=I.row<v.row?I.row:v.row,T=I.col<v.col?I.col:v.col,N=I.row<v.row&&I.col<v.col||I.row>v.row&&I.col>v.col?0:1,D=1^N,L=2*((I.z*(this.rows-1)+B)*f+T),H=L+D,V=this.usedDiagFlat[H],O=this.connIdToRootNet[V]===this.connIdToRootNet[s]&&this.overlapFriendlyRootNets.has(this.connIdToRootNet[s]);if(V!==-1&&V!==s&&!O)continue;let U=L+N;this.usedDiagFlat[U]=s,g.push(U)}for(;this.usedIndicesByConn.length<=s;)this.usedIndicesByConn.push([]);let y=this.usedIndicesByConn[s]??[];for(y.push(...l),this.usedIndicesByConn[s]=y;this.usedDiagIndicesByConn.length<=s;)this.usedDiagIndicesByConn.push([]);let x=this.usedDiagIndicesByConn[s]??[];x.push(...g),this.usedDiagIndicesByConn[s]=x;let C=this.solvedRoutes.get(s)??[];if(C.push({connId:s,startZ:r.z,startRow:r.row,startCol:r.col,startPoint:this.activeConnSeg.startPoint,endZ:i.z,endRow:i.row,endCol:i.col,endPoint:this.activeConnSeg.endPoint,cells:t,viaCells:o}),this.solvedRoutes.set(s,C),this.useExactViaTraceClearance){for(;this.viaCenterIndicesByConn.length<=s;)this.viaCenterIndicesByConn.push([]);let b=this.viaCenterIndicesByConn[s]??[];for(let I of o){let v=I.row*this.cols+I.col,P=this.viaOwnersByCell.get(v)??new Set;P.has(s)||(P.add(s),b.push(v)),this.viaOwnersByCell.set(v,P)}this.viaCenterIndicesByConn[s]=b}for(let b=0;b<_.length;b++)if(this.ripTrace(_[b]),this.failed)return;if(a.length>0||_.length>0){let b=this.penalty2d,I=this.penaltyCap;if(this.totalRipEvents>50)for(let v=0;v<b.length;v++)b[v]=0.99*b[v];else for(let v=0;v<b.length;v++)b[v]>I&&(b[v]=0.5*b[v])}}ripTrace(e){for(;this.ripCount.length<=e;)this.ripCount.push(0);if(this.ripCount[e]++,this.totalRipEvents++,this.totalRipEvents>=this.MAX_RIPS)return this.error=`Convergence failure: exceeded MAX_RIPS ${this.MAX_RIPS}`,void(this.failed=!0);let t=this.solvedRoutes.get(e)??[];if(t.length>0){let i=this.cols;for(let s of t){for(let a=0;a<s.cells.length;a++){let c=s.cells[a],l=c.row*i+c.col;this.penalty2d[l]=this.penalty2d[l]+this.hyperParameters.ripTracePenalty}for(let a=0;a<s.viaCells.length;a++){let c=s.viaCells[a],l=c.row*i+c.col;this.penalty2d[l]=this.penalty2d[l]+this.hyperParameters.ripViaPenalty}}}let n=this.usedIndicesByConn[e];if(n){let i=this.usedCellsFlat;for(let s=0;s<n.length;s++){let a=n[s];i[a]===e&&(i[a]=-1)}this.usedIndicesByConn[e]=[]}let o=this.usedDiagIndicesByConn[e];if(o){let i=this.usedDiagFlat;for(let s=0;s<o.length;s++){let a=o[s];i[a]===e&&(i[a]=-1)}this.usedDiagIndicesByConn[e]=[]}let r=this.viaCenterIndicesByConn[e];if(r){for(let i of r){let s=this.viaOwnersByCell.get(i);s&&(s.delete(e),s.size===0&&this.viaOwnersByCell.delete(i))}this.viaCenterIndicesByConn[e]=[]}if(t.length>0){this.solvedRoutes.delete(e);for(let i of t)this.unsolvedSegs.push({connId:e,startZ:i.startZ,startRow:i.startRow,startCol:i.startCol,startPoint:i.startPoint,endZ:i.endZ,endRow:i.endRow,endCol:i.endCol,endPoint:i.endPoint})}}visualize(){let e=["red","blue","orange","green"],t=[],n=[],o=[],r=[],{width:i,height:s,center:a}=this.nodeWithPortPoints;r.push({center:{x:a.x,y:a.y},width:i,height:s,stroke:"gray"});let c=this.gridToBoundsTransform;if(this.showPenaltyMap&&this.penalty2d){let d=0;for(let u=0;u<this.penalty2d.length;u++)this.penalty2d[u]>d&&(d=this.penalty2d[u]);if(d>0)for(let u=0;u<this.rows;u++)for(let _=0;_<this.cols;_++){let p=this.penalty2d[u*this.cols+_];if(p<=0)continue;let m=Math.min(0.6,p/d*0.6),A=O7(c,{x:this.gridOrigin.x+(_+0.5)*this.cellSizeMm,y:this.gridOrigin.y+(u+0.5)*this.cellSizeMm});r.push({center:A,width:this.cellSizeMm*c.a,height:this.cellSizeMm*c.e,fill:`rgba(255,165,0,${m.toFixed(3)})`})}}if(this.showUsedCellMap&&this.usedCellsFlat)for(let d=0;d<this.layers;d++)for(let u=0;u<this.rows;u++)for(let _=0;_<this.cols;_++){if(this.usedCellsFlat[(d*this.rows+u)*this.cols+_]===-1)continue;let p=O7(c,{x:this.gridOrigin.x+(_+0.5)*this.cellSizeMm,y:this.gridOrigin.y+(u+0.5)*this.cellSizeMm});r.push({center:p,width:this.cellSizeMm*c.a,height:this.cellSizeMm*c.e,fill:"rgba(0,0,255,0.5)"})}for(let d of this.nodeWithPortPoints.portPoints)t.push({x:d.x,y:d.y,color:e[d.z]??"gray",label:d.connectionName});let l=["rgba(255,0,0,0.75)","rgba(0,0,255,0.75)","rgba(255,165,0,0.75)","rgba(0,128,0,0.75)"],h=this.getOutput();for(let d of h){if(d.route.length<2)continue;let u=0;for(let _=1;_<d.route.length;_++){let p=d.route[_-1];d.route[_].z!==p.z&&(_-u>=2&&n.push({points:d.route.slice(u,_).map((m)=>({x:m.x,y:m.y})),strokeColor:l[p.z]??"rgba(128,128,128,0.75)",strokeWidth:this.traceThickness}),u=_)}if(d.route.length-u>=2){let _=d.route[u].z;n.push({points:d.route.slice(u).map((p)=>({x:p.x,y:p.y})),strokeColor:l[_]??"rgba(128,128,128,0.75)",strokeWidth:this.traceThickness})}}for(let d of h)for(let u of d.vias)o.push({center:{x:u.x,y:u.y},radius:this.viaDiameter/2,fill:"rgba(0,0,0,0.3)",stroke:"black"});if(this.activeConnSeg&&this.visitedStamp){let d=this.stamp;for(let u=0;u<this.layers;u++)for(let _=0;_<this.rows;_++)for(let p=0;p<this.cols;p++){if(this.visitedStamp[(u*this.rows+_)*this.cols+p]!==d)continue;let m=O7(c,{x:this.gridOrigin.x+(p+0.5)*this.cellSizeMm,y:this.gridOrigin.y+(_+0.5)*this.cellSizeMm});t.push({x:m.x,y:m.y,color:"rgba(0,0,255,0.2)"})}}return{points:t,lines:n,circles:o,rects:r,coordinateSystem:"cartesian",title:`HighDensityA01 [${this.solvedRoutes?.size??0} solved, ${this.unsolvedSegs?.length??0} remaining]`}}getOutput(){let e=this.gridToBoundsTransform,t=[];for(let[n,o]of this.solvedRoutes??[]){let r=this.connIdToName[n];for(let i of o){let s=i.cells.map((a)=>{let c=this.gridOrigin.x+(a.col+0.5)*this.cellSizeMm,l=this.gridOrigin.y+(a.row+0.5)*this.cellSizeMm,h=O7(e,{x:c,y:l});return{x:h.x,y:h.y,z:this.layerToZ.get(a.z)??a.z}});s.length>0&&(s[0]={...i.startPoint},s.length>1&&(s[s.length-1]={...i.endPoint})),t.push({connectionName:r,rootConnectionName:this.connIdToRootNet[n],regionId:this.nodeWithPortPoints.capacityMeshNodeId,traceThickness:this.traceThickness,viaDiameter:this.viaDiameter,route:s,vias:i.viaCells.map((a)=>{let c=this.gridOrigin.x+(a.col+0.5)*this.cellSizeMm,l=this.gridOrigin.y+(a.row+0.5)*this.cellSizeMm;return O7(e,{x:c,y:l})})})}}return t}},tWe=["left","top","right","bottom","middle"],jmr=class{f=new Float64Array(1024);seq=new Uint32Array(1024);id=new Int32Array(1024);n=0;push(e,t,n){this.ensureCapacity(this.n+1);let o=this.n++;for(this.f[o]=e,this.seq[o]=t,this.id[o]=n;o>0;){let r=o-1>>1;if(this.less(r,o))break;this.swap(o,r),o=r}}pop(){let e=this.id[0];return this.n--,this.n>0&&(this.f[0]=this.f[this.n],this.seq[0]=this.seq[this.n],this.id[0]=this.id[this.n],this.siftDown(0)),e}get size(){return this.n}clear(){this.n=0}ensureCapacity(e){if(e<=this.f.length)return;let t=this.f.length;for(;t<e;)t*=2;let n=new Float64Array(t);n.set(this.f),this.f=n;let o=new Uint32Array(t);o.set(this.seq),this.seq=o;let r=new Int32Array(t);r.set(this.id),this.id=r}siftDown(e){for(;;){let t=2*e+1,n=t+1;if(t>=this.n)return;let o=t;if(n<this.n&&!this.less(t,n)&&(o=n),this.less(e,o))return;this.swap(e,o),e=o}}less(e,t){let n=this.f[e],o=this.f[t];return n!==o?n<o:this.seq[e]<this.seq[t]}swap(e,t){let n=this.f[e];this.f[e]=this.f[t],this.f[t]=n;let o=this.seq[e];this.seq[e]=this.seq[t],this.seq[t]=o;let r=this.id[e];this.id[e]=this.id[t],this.id[t]=r}},Kmr=class{z=new Int32Array(1024);cellId=new Int32Array(1024);g=new Float64Array(1024);parent=new Int32Array(1024);ripHead=new Int32Array(1024).fill(-1);ripCount=new Int32Array(1024);length=0;clear(){this.length=0}push(e,t,n,o,r,i){this.ensureCapacity(this.length+1);let s=this.length++;return this.z[s]=e,this.cellId[s]=t,this.g[s]=n,this.parent[s]=o,this.ripHead[s]=r,this.ripCount[s]=i,s}ensureCapacity(e){if(e<=this.z.length)return;let t=this.z.length;for(;t<e;)t*=2;let n=new Int32Array(t);n.set(this.z),this.z=n;let o=new Int32Array(t);o.set(this.cellId),this.cellId=o;let r=new Float64Array(t);r.set(this.g),this.g=r;let i=new Int32Array(t);i.set(this.parent),this.parent=i;let s=new Int32Array(t);s.fill(-1),s.set(this.ripHead.subarray(0,this.length)),this.ripHead=s;let a=new Int32Array(t);a.set(this.ripCount.subarray(0,this.length)),this.ripCount=a}},$mr=class{connId=new Int32Array(1024);prev=new Int32Array(1024).fill(-1);length=0;clear(){this.length=0}append(e,t){this.ensureCapacity(this.length+1);let n=this.length++;return this.connId[n]=t,this.prev[n]=e,n}contains(e,t){for(let n=e;n>=0;n=this.prev[n])if(this.connId[n]===t)return!0;return!1}collect(e,t){t.length=0;for(let n=e;n>=0;n=this.prev[n])t.push(this.connId[n])}ensureCapacity(e){if(e<=this.connId.length)return;let t=this.connId.length;for(;t<e;)t*=2;let n=new Int32Array(t);n.set(this.connId),this.connId=n;let o=new Int32Array(t);o.fill(-1),o.set(this.prev.subarray(0,this.length)),this.prev=o}};function Q7(e,t,n){return Math.max(t,Math.min(n,e))}function L4e(e,t){for(let n=0;n<e.length;n++)if(e[n]===t)return;e.push(t)}function TFt(e,t){for(let n=0;n<e.length;n++)if(e[n].cellId===t.cellId)return;e.push(t)}function nWe(e,t,n,o,r,i,s){let a=e-Q7(e,o,i),c=t-Q7(t,r,s);return a*a+c*c<=n*n}var DFt,H4e=class extends fa{getSolverName(){return"HighDensitySolverA03"}nodeWithPortPoints;highResolutionCellSize;highResolutionCellThickness;lowResolutionCellSize;viaDiameter;MAX_RIPS;maxCellCount;traceThickness;traceMargin;viaMinDistFromBorder;showPenaltyMap;showUsedCellMap;effort;enableDiagonalMoves;stepMultiplier;hyperParameters;initialPenaltyFn;boundsMinX;boundsMaxX;boundsMinY;boundsMaxY;gridToBoundsTransform;availableZ;zToLayer;layerToZ;layers;fineRows;fineCols;lowScale;bandRows;bandCols;regions;planeSize;cellCenterX;cellCenterY;cellMinX;cellMinY;cellMaxX;cellMaxY;cellWidth;cellHeight;cellRegion;cellRow;cellCol;viaAllowed;neighborOffset;neighborIds;neighborCosts;usedCellsFlat;sharedCellsFlat;portOwnerFlat;penalty2d;ripStateBuckets;visitedStamp;bestGStamp;bestGValue;visitedFlatStamp;sharedCrossRootPortFlat;stamp=0;connNameToId;connIdToName;connIdToRootNet;overlapFriendlyRootNets;usedIndicesByConn;unsolvedSegs;solvedRoutes;activeConnSeg=null;activeConnId=-1;nodePool;heap;ripChain;seqCounter=0;_viaOccs=[];viaOccupantsByCell=new Map;_cellOccs=[];_rippedIds=[];ripCount;totalRipEvents=0;searchIterations=0;consecutiveSkips=0;penaltyCap;baseSearchBudgetIters;_moveCost=0;_moveRippedHead=-1;_moveRipCount=0;traceKeepoutRadius;viaKeepoutRadius;get unsolvedConnections(){return this.unsolvedSegs}get solvedConnectionsMap(){let e=new Map;for(let t=0;t<this.solvedRoutes.length;t++){let n=this.getSolvedRoutesForConn(t);n.length>0&&e.set(t,n)}return e}get activeConnection(){if(!this.activeConnSeg)return null;let e=this.activeConnSeg.startCellId,t=this.activeConnSeg.endCellId;return{connectionName:this.connIdToName[this.activeConnSeg.connId]??"",start:{cellId:e,region:tWe[this.cellRegion[e]],row:this.cellRow[e],col:this.cellCol[e],x:this.cellCenterX[e],y:this.cellCenterY[e],z:this.activeConnSeg.startZ},end:{cellId:t,region:tWe[this.cellRegion[t]],row:this.cellRow[t],col:this.cellCol[t],x:this.cellCenterX[t],y:this.cellCenterY[t],z:this.activeConnSeg.endZ}}}get openSet(){return{length:this.heap?.size??0}}get gridStats(){return{cells:this.planeSize||0,layers:this.layers||0,states:(this.planeSize||0)*(this.layers||0),ripStateBuckets:this.ripStateBuckets||0,neighborEdges:this.neighborIds?.length??0,regionCounts:this.regions?Object.fromEntries(this.regions.map((e)=>[e.name,e.rows*e.cols])):{}}}constructor(e){super(),this.nodeWithPortPoints=e.nodeWithPortPoints,this.highResolutionCellSize=e.highResolutionCellSize??0.1,this.highResolutionCellThickness=Math.max(1,Math.floor(e.highResolutionCellThickness??8)),this.lowResolutionCellSize=e.lowResolutionCellSize??0.4,this.viaDiameter=e.viaDiameter,this.maxCellCount=e.maxCellCount,this.traceThickness=e.traceThickness??0.1,this.traceMargin=e.traceMargin??0.15,this.viaMinDistFromBorder=e.viaMinDistFromBorder??0.15,this.showPenaltyMap=e.showPenaltyMap??!1,this.showUsedCellMap=e.showUsedCellMap??!1,this.effort=e.effort??1,this.enableDiagonalMoves=e.enableDiagonalMoves??!1,this.stepMultiplier=Math.max(1,Math.floor(e.stepMultiplier??1)),this.hyperParameters={shuffleSeed:0,ripCost:8,ripTracePenalty:0.5,ripViaPenalty:0.75,viaBaseCost:0.1,greedyMultiplier:1.5,...e.hyperParameters},this.MAX_ITERATIONS=1e8,this.MAX_RIPS=200,this.initialPenaltyFn=e.initialPenaltyFn}getConstructorParams(){return[{nodeWithPortPoints:this.nodeWithPortPoints,highResolutionCellSize:this.highResolutionCellSize,highResolutionCellThickness:this.highResolutionCellThickness,lowResolutionCellSize:this.lowResolutionCellSize,viaDiameter:this.viaDiameter,maxCellCount:this.maxCellCount,stepMultiplier:this.stepMultiplier,traceThickness:this.traceThickness,traceMargin:this.traceMargin,viaMinDistFromBorder:this.viaMinDistFromBorder,showPenaltyMap:this.showPenaltyMap,showUsedCellMap:this.showUsedCellMap,effort:this.effort,enableDiagonalMoves:this.enableDiagonalMoves,hyperParameters:this.hyperParameters,initialPenaltyFn:this.initialPenaltyFn}]}_setup(){let{nodeWithPortPoints:e}=this,{width:t,height:n,center:o}=e,r=this.lowResolutionCellSize/this.highResolutionCellSize,i=Math.round(r);if(!Number.isFinite(r)||r<=0||Math.abs(r-i)>0.000000001)return this.error="lowResolutionCellSize must be a positive integer multiple of highResolutionCellSize",void(this.failed=!0);this.lowScale=Math.max(1,i),this.availableZ=e.availableZ??[...new Set(e.portPoints.map((u)=>u.z))].sort((u,_)=>u-_),this.layers=this.availableZ.length,this.zToLayer=new Map,this.layerToZ=new Map;for(let u=0;u<this.availableZ.length;u++){let _=this.availableZ[u];this.zToLayer.set(_,u),this.layerToZ.set(u,_)}this.boundsMinX=o.x-t/2,this.boundsMaxX=o.x+t/2,this.boundsMinY=o.y-n/2,this.boundsMaxY=o.y+n/2,this.traceKeepoutRadius=this.traceMargin+this.traceThickness/2,this.viaKeepoutRadius=this.viaDiameter/2+this.traceKeepoutRadius,this.buildFiveRegionGrid(t,n),this.gridToBoundsTransform=this.computeGridToBoundsTransform();let s=this.layers*this.planeSize;if(this.maxCellCount!==void 0&&s>this.maxCellCount)return this.error=`Cell count ${s} exceeds maxCellCount ${this.maxCellCount}`,void(this.failed=!0);this.connNameToId=new Map,this.connIdToName=[],this.connIdToRootNet=[],this.overlapFriendlyRootNets=new Set,this.unsolvedSegs=this.buildConnectionSegs(),this.penalty2d=new Float64Array(this.planeSize);let a=t>0?1/t:0,c=n>0?1/n:0;for(let u=0;u<this.planeSize;u++){let _=0;this.initialPenaltyFn&&(_+=this.initialPenaltyFn({x:this.cellCenterX[u],y:this.cellCenterY[u],px:(this.cellCenterX[u]-this.boundsMinX)*a,py:(this.cellCenterY[u]-this.boundsMinY)*c,cellId:u,region:tWe[this.cellRegion[u]],row:this.cellRow[u],col:this.cellCol[u]})),this.penalty2d[u]=_}this.usedCellsFlat=new Int32Array(s).fill(-1),this.sharedCellsFlat=Array.from({length:s},()=>{}),this.portOwnerFlat=new Int32Array(s).fill(-1),this.sharedCrossRootPortFlat=new Uint8Array(s),this.ripStateBuckets=1;let l=s;this.visitedStamp=new Uint32Array(l),this.bestGStamp=new Uint32Array(l),this.bestGValue=new Float64Array(l),this.visitedFlatStamp=new Uint32Array(s),this.stamp=0;let h=new Map;for(let u of this.nodeWithPortPoints.portPoints){let _=this.connNameToId.get(u.connectionName);if(_===void 0)continue;let p=this.pointToCell(u),m=p.z*this.planeSize+p.cellId,A=this.connIdToRootNet[_],g=h.get(m);g===void 0?h.set(m,A):g!==A&&(this.sharedCrossRootPortFlat[m]=1);let f=this.portOwnerFlat[m];this.portOwnerFlat[m]=f===-1||f===_?_:-2}this.solvedRoutes=[],this.usedIndicesByConn=[],this.ripCount=[],this.consecutiveSkips=0,this.penaltyCap=0.5*this.hyperParameters.ripCost,this.shuffleConnections();let d=fXt({planeSize:this.planeSize,layers:this.layers,connectionCount:this.unsolvedSegs.length,effort:this.effort,maxIterations:this.MAX_ITERATIONS});this.baseSearchBudgetIters=d.baseSearchBudgetIters,this.MAX_ITERATIONS=d.maxIterationsIters,this.activeConnSeg=null,this.activeConnId=-1,this.nodePool=new Kmr,this.heap=new jmr,this.ripChain=new $mr,this.seqCounter=0}_step(){for(let e=0;e<this.stepMultiplier;e++){if(this.solved||this.failed)return;this.stepOnce()}}buildFiveRegionGrid(e,t){this.fineCols=Math.max(1,Math.ceil(e/this.highResolutionCellSize)),this.fineRows=Math.max(1,Math.ceil(t/this.highResolutionCellSize)),this.bandCols=Math.min(this.highResolutionCellThickness,Math.floor(this.fineCols/2)),this.bandRows=Math.min(this.highResolutionCellThickness,Math.floor(this.fineRows/2));let n=Math.max(0,this.fineCols-2*this.bandCols),o=Math.max(0,this.fineRows-2*this.bandRows),r=n,i=n;this.regions=[{id:0,name:"left",fineOriginRow:0,fineOriginCol:0,fineRows:this.fineRows,fineCols:this.bandCols,cellScale:1,rows:this.fineRows,cols:this.bandCols,offset:0},{id:1,name:"top",fineOriginRow:0,fineOriginCol:this.bandCols,fineRows:this.bandRows,fineCols:r,cellScale:1,rows:this.bandRows,cols:r,offset:0},{id:2,name:"right",fineOriginRow:0,fineOriginCol:this.fineCols-this.bandCols,fineRows:this.fineRows,fineCols:this.bandCols,cellScale:1,rows:this.fineRows,cols:this.bandCols,offset:0},{id:3,name:"bottom",fineOriginRow:this.fineRows-this.bandRows,fineOriginCol:this.bandCols,fineRows:this.bandRows,fineCols:i,cellScale:1,rows:this.bandRows,cols:i,offset:0},{id:4,name:"middle",fineOriginRow:this.bandRows,fineOriginCol:this.bandCols,fineRows:o,fineCols:n,cellScale:this.lowScale,rows:o>0?Math.ceil(o/this.lowScale):0,cols:n>0?Math.ceil(n/this.lowScale):0,offset:0}];let s=0;for(let x=0;x<this.regions.length;x++)this.regions[x].offset=s,s+=this.regions[x].rows*this.regions[x].cols;this.planeSize=s,this.cellCenterX=new Float64Array(this.planeSize),this.cellCenterY=new Float64Array(this.planeSize),this.cellMinX=new Float64Array(this.planeSize),this.cellMinY=new Float64Array(this.planeSize),this.cellMaxX=new Float64Array(this.planeSize),this.cellMaxY=new Float64Array(this.planeSize),this.cellWidth=new Float64Array(this.planeSize),this.cellHeight=new Float64Array(this.planeSize),this.cellRegion=new Uint8Array(this.planeSize),this.cellRow=new Int32Array(this.planeSize),this.cellCol=new Int32Array(this.planeSize),this.viaAllowed=new Uint8Array(this.planeSize);for(let x=0;x<this.regions.length;x++){let C=this.regions[x];for(let b=0;b<C.rows;b++){let I=C.fineOriginRow+b*C.cellScale,v=Math.min(C.fineOriginRow+C.fineRows,I+C.cellScale),P=this.boundsMinY+I*this.highResolutionCellSize,M=Math.min(this.boundsMaxY,this.boundsMinY+v*this.highResolutionCellSize);for(let B=0;B<C.cols;B++){let T=C.fineOriginCol+B*C.cellScale,N=Math.min(C.fineOriginCol+C.fineCols,T+C.cellScale),D=this.boundsMinX+T*this.highResolutionCellSize,L=Math.min(this.boundsMaxX,this.boundsMinX+N*this.highResolutionCellSize),H=this.cellIdFor(C.id,b,B);this.cellCenterX[H]=(D+L)/2,this.cellCenterY[H]=(P+M)/2,this.cellMinX[H]=D,this.cellMinY[H]=P,this.cellMaxX[H]=L,this.cellMaxY[H]=M,this.cellWidth[H]=L-D,this.cellHeight[H]=M-P,this.cellRegion[H]=C.id,this.cellRow[H]=b,this.cellCol[H]=B;let V=Math.min(this.cellCenterX[H]-this.boundsMinX,this.boundsMaxX-this.cellCenterX[H],this.cellCenterY[H]-this.boundsMinY,this.boundsMaxY-this.cellCenterY[H]);this.viaAllowed[H]=V>=this.viaMinDistFromBorder?1:0}}}let a=Array.from({length:this.planeSize},()=>[]),c=(x,C)=>{if(x===C||x<0||C<0)return;let b=this.cellCenterX[x]-this.cellCenterX[C],I=this.cellCenterY[x]-this.cellCenterY[C],v=Math.hypot(b,I);TFt(a[x],{cellId:C,cost:v}),TFt(a[C],{cellId:x,cost:v})};for(let x=0;x<this.regions.length;x++){let C=this.regions[x];for(let b=0;b<C.rows;b++)for(let I=0;I<C.cols;I++){let v=this.cellIdFor(C.id,b,I);b+1<C.rows&&c(v,this.cellIdFor(C.id,b+1,I)),I+1<C.cols&&c(v,this.cellIdFor(C.id,b,I+1)),this.enableDiagonalMoves&&b+1<C.rows&&(I+1<C.cols&&c(v,this.cellIdFor(C.id,b+1,I+1)),I>0&&c(v,this.cellIdFor(C.id,b+1,I-1)))}}let l=this.regions[0],h=this.regions[1],d=this.regions[2],u=this.regions[3],_=this.regions[4],p=l.rows>0&&l.cols>0,m=h.rows>0&&h.cols>0,A=d.rows>0&&d.cols>0,g=u.rows>0&&u.cols>0,f=_.rows>0&&_.cols>0;if(p&&m)for(let x=0;x<this.bandRows;x++)c(this.cellIdFor(0,x,l.cols-1),this.cellIdFor(1,x,0));if(m&&A)for(let x=0;x<this.bandRows;x++)c(this.cellIdFor(1,x,h.cols-1),this.cellIdFor(2,x,0));if(p&&g)for(let x=this.fineRows-this.bandRows;x<this.fineRows;x++)c(this.cellIdFor(0,x,l.cols-1),this.cellIdFor(3,x-(this.fineRows-this.bandRows),0));if(g&&A)for(let x=this.fineRows-this.bandRows;x<this.fineRows;x++)c(this.cellIdFor(3,x-(this.fineRows-this.bandRows),u.cols-1),this.cellIdFor(2,x,0));if(p&&f)for(let x=this.bandRows;x<this.fineRows-this.bandRows;x++)c(this.cellIdFor(0,x,l.cols-1),this.cellIdFor(4,Math.floor((x-this.bandRows)/this.lowScale),0));if(A&&f)for(let x=this.bandRows;x<this.fineRows-this.bandRows;x++)c(this.cellIdFor(4,Math.floor((x-this.bandRows)/this.lowScale),_.cols-1),this.cellIdFor(2,x,0));if(m&&f)for(let x=this.bandCols;x<this.fineCols-this.bandCols;x++)c(this.cellIdFor(1,h.rows-1,x-this.bandCols),this.cellIdFor(4,0,Math.floor((x-this.bandCols)/this.lowScale)));if(g&&f)for(let x=this.bandCols;x<this.fineCols-this.bandCols;x++)c(this.cellIdFor(4,_.rows-1,Math.floor((x-this.bandCols)/this.lowScale)),this.cellIdFor(3,0,x-this.bandCols));if(!f&&!m&&!g&&p&&A)for(let x=0;x<Math.min(l.rows,d.rows);x++)c(this.cellIdFor(0,x,l.cols-1),this.cellIdFor(2,x,0));if(!f&&!p&&!A&&m&&g)for(let x=0;x<Math.min(h.cols,u.cols);x++)c(this.cellIdFor(1,h.rows-1,x),this.cellIdFor(3,0,x));let y=this.flattenNeighborLists(a);this.neighborOffset=y.offset,this.neighborIds=y.ids,this.neighborCosts=y.costs}cellIdFor(e,t,n){let o=this.regions[e];return o.offset+t*o.cols+n}stepOnce(){if(!this.activeConnSeg){if(this.unsolvedSegs.length===0)return void(this.solved=!0);let f=this.unsolvedSegs.shift();this.activeConnSeg=f,this.activeConnId=f.connId,this.viaOccupantsByCell.clear(),this.nodePool.clear(),this.ripChain.clear(),this.heap.clear(),this.seqCounter=0,this.searchIterations=0,this.nextStamp();let y=this.computeH(f.startZ,f.startCellId,f.endZ,f.endCellId)*this.hyperParameters.greedyMultiplier,x=this.nodePool.push(f.startZ,f.startCellId,0,-1,-1,0),C=f.startZ*this.planeSize+f.startCellId,b=this.getSearchStateIdx(C,0);return this.bestGStamp[b]=this.stamp,this.bestGValue[b]=0,void this.heap.push(y,this.seqCounter++,x)}this.searchIterations++;let e=this.ripCount[this.activeConnId]??0,t=Math.round(this.baseSearchBudgetIters*(1+0.25*Math.min(e,10)));if(this.searchIterations>t){let f=this.penalty2d;for(let y=0;y<f.length;y++)f[y]=0.9*f[y];return this.unsolvedSegs.push(this.activeConnSeg),this.activeConnSeg=null,this.activeConnId=-1,this.heap.clear(),this.nodePool.clear(),this.consecutiveSkips++,void(this.consecutiveSkips>=Math.max(3,3*this.unsolvedSegs.length)&&(this.error=`Convergence failure: ${this.unsolvedSegs.length} connections stuck`,this.failed=!0))}if(this.heap.size===0)return this.error=`No path found for ${this.connIdToName[this.activeConnId]}`,void(this.failed=!0);let n=this.heap.pop(),o=this.nodePool.z[n],r=this.nodePool.cellId[n],i=this.nodePool.g[n],s=this.nodePool.ripHead[n],a=this.nodePool.ripCount[n],c=o*this.planeSize+r,l=this.getSearchStateIdx(c,a);if(this.visitedStamp[l]===this.stamp)return;this.visitedStamp[l]=this.stamp,this.visitedFlatStamp[c]=this.stamp;let h=this.activeConnSeg;if(o===h.endZ&&r===h.endCellId)return this.finalizeRoute(n),this.activeConnSeg=null,void(this.activeConnId=-1);let d=this.visitedStamp,u=this.stamp,_=this.activeConnId,{endZ:p,endCellId:m}=h,A=this.neighborOffset[r],g=this.neighborOffset[r+1];for(let f=A;f<g;f++){let y=this.neighborIds[f],x=o*this.planeSize+y;if(this.computeMoveCostAndRips(_,o,y,!1,s,a,this.neighborCosts[f]),this._moveCost<0)continue;let C=this.getSearchStateIdx(x,this._moveRipCount);if(d[C]===u)continue;let b=i+this._moveCost;if(this.bestGStamp[C]===u&&b>=this.bestGValue[C])continue;this.bestGStamp[C]=u,this.bestGValue[C]=b;let I=b+this.computeH(o,y,p,m)*this.hyperParameters.greedyMultiplier,v=this.nodePool.push(o,y,b,n,this._moveRippedHead,this._moveRipCount);this.heap.push(I,this.seqCounter++,v)}if(this.viaAllowed[r])for(let f=0;f<this.layers;f++){if(f===o)continue;let y=f*this.planeSize+r;if(this.computeMoveCostAndRips(_,f,r,!0,s,a,0),this._moveCost<0)continue;let x=this.getSearchStateIdx(y,this._moveRipCount);if(d[x]===u)continue;let C=i+this._moveCost;if(this.bestGStamp[x]===u&&C>=this.bestGValue[x])continue;this.bestGStamp[x]=u,this.bestGValue[x]=C;let b=C+this.computeH(f,r,p,m)*this.hyperParameters.greedyMultiplier,I=this.nodePool.push(f,r,C,n,this._moveRippedHead,this._moveRipCount);this.heap.push(b,this.seqCounter++,I)}}computeMoveCostAndRips(e,t,n,o,r,i,s){let a=0,c=r,l=i,h=t*this.planeSize+n;if(o){a+=this.hyperParameters.viaBaseCost,a+=Math.min(this.penalty2d[n],this.penaltyCap);let d=this.portOwnerFlat[h],u=this.allowSharedUse(e,d),_=this.activeConnSeg,p=!!_&&t===_.endZ&&n===_.endCellId;if(d>=0&&d!==e&&!u&&!p)return this._moveCost=-1,void(this._moveRippedHead=c);this.fillViaOccupants(n,e);let m=this._viaOccs;for(let A=0;A<m.length;A++){let g=m[A];this.ripChain.contains(c,g)||(a+=this.hyperParameters.ripCost,c=this.ripChain.append(c,g),l++),a+=this.hyperParameters.ripViaPenalty}}else{a+=s,a+=Math.min(this.penalty2d[n],this.penaltyCap);let d=this.portOwnerFlat[h],u=this.allowSharedUse(e,d),_=this.activeConnSeg,p=!!_&&t===_.endZ&&n===_.endCellId;if(d>=0&&d!==e&&!u&&!p)return this._moveCost=-1,void(this._moveRippedHead=c);this.fillTraceOccupants(h,e,this._cellOccs);for(let m=0;m<this._cellOccs.length;m++){let A=this._cellOccs[m];this.ripChain.contains(c,A)||(a+=this.hyperParameters.ripCost,c=this.ripChain.append(c,A),l++),a+=this.hyperParameters.ripTracePenalty}}this._moveCost=a,this._moveRippedHead=c,this._moveRipCount=l}fillViaOccupants(e,t){let n=this._viaOccs;n.length=0;let o=this.viaOccupantsByCell.get(e);if(o){for(let s of o)n.push(s);return}let r=this.cellCenterX[e],i=this.cellCenterY[e];this.forEachCellNearCircle(r,i,this.viaKeepoutRadius,(s)=>{if(nWe(r,i,this.viaKeepoutRadius,this.cellMinX[s],this.cellMinY[s],this.cellMaxX[s],this.cellMaxY[s]))for(let a=0;a<this.layers;a++)this.pushFlatOccupants(a*this.planeSize+s,t,n)}),this.viaOccupantsByCell.set(e,n.slice())}fillTraceOccupants(e,t,n){n.length=0,this.pushFlatOccupants(e,t,n)}pushFlatOccupants(e,t,n){let o=this.usedCellsFlat[e];o===-1||o===t||this.allowSharedUse(t,o)||L4e(n,o);let r=this.sharedCellsFlat[e];if(r)for(let i=0;i<r.length;i++){let s=r[i];s!==t&&(this.allowSharedUse(t,s)||L4e(n,s))}}addSharedOccupant(e,t){if(this.usedCellsFlat[e]===t)return;let n=this.sharedCellsFlat[e];n||(n=[],this.sharedCellsFlat[e]=n),L4e(n,t)}replaceOccupants(e,t){this.usedCellsFlat[e]=t,this.sharedCellsFlat[e]=void 0}removeOccupant(e,t){let n=this.sharedCellsFlat[e];if(this.usedCellsFlat[e]===t)return void(n&&n.length>0?(this.usedCellsFlat[e]=n.pop(),n.length===0&&(this.sharedCellsFlat[e]=void 0)):this.usedCellsFlat[e]=-1);if(!n)return;let o=n.indexOf(t);o!==-1&&(n.splice(o,1),n.length===0&&(this.sharedCellsFlat[e]=void 0))}allowSharedUse(e,t){if(t<0)return!1;return this.connIdToRootNet[t]===this.connIdToRootNet[e]}shouldSkipFixedPortHalo(e,t){let n=this.portOwnerFlat[e];return n!==t&&(n===-2||!(n<0)&&!this.allowSharedUse(t,n))}nextStamp(){this.stamp=this.stamp+1>>>0,this.stamp===0&&(this.visitedStamp.fill(0),this.bestGStamp.fill(0),this.visitedFlatStamp.fill(0),this.stamp=1)}getSearchStateIdx(e,t){return e}computeH(e,t,n,o){let r=Math.hypot(this.cellCenterX[t]-this.cellCenterX[o],this.cellCenterY[t]-this.cellCenterY[o]);return e===n?r:r+this.hyperParameters.viaBaseCost}internConn(e,t){let n=this.connNameToId.get(e);if(n!==void 0)return n;let o=this.connIdToName.length;var r;return this.connIdToName.push(e),this.connIdToRootNet.push((r=e,t??r.replace(/_mst\d+$/,""))),this.connNameToId.set(e,o),o}buildConnectionSegs(){let e=new Map;for(let o of this.nodeWithPortPoints.portPoints){let r=o.connectionName;e.has(r)||e.set(r,{points:[],rootConnectionName:o.rootConnectionName}),e.get(r).points.push(o)}let t=[],n=new Set;for(let[o,r]of e){let i=r.points,s=AXt(i);if(s.length===0)continue;let a=this.internConn(o,r.rootConnectionName);for(let[c,l]of s){let h=this.pointToCell(c),d=this.pointToCell(l),u=`${h.z}:${h.cellId}`,_=`${d.z}:${d.cellId}`,p=u<_?`${u}|${_}`:`${_}|${u}`,m=r.rootConnectionName??o,A=`${m}|${p}`;n.has(A)?this.overlapFriendlyRootNets.add(m):(n.add(A),t.push({connId:a,startZ:h.z,startCellId:h.cellId,startPoint:c,endZ:d.z,endCellId:d.cellId,endPoint:l}))}}return t}pointToCell(e){let t=Q7(Math.floor((e.x-this.boundsMinX)/this.highResolutionCellSize),0,this.fineCols-1),n=Q7(Math.floor((e.y-this.boundsMinY)/this.highResolutionCellSize),0,this.fineRows-1),o=4;t<this.bandCols?o=0:t>=this.fineCols-this.bandCols?o=2:n<this.bandRows?o=1:n>=this.fineRows-this.bandRows&&(o=3);let r=this.regions[o],i=n-r.fineOriginRow,s=t-r.fineOriginCol,a=Q7(Math.floor(i/r.cellScale),0,Math.max(0,r.rows-1)),c=Q7(Math.floor(s/r.cellScale),0,Math.max(0,r.cols-1));return{z:this.zToLayer.get(e.z)??0,cellId:this.cellIdFor(o,a,c)}}shuffleConnections(){let e=this.unsolvedSegs,t=this.hyperParameters.shuffleSeed>>>0,n=()=>(t=Math.imul(t,1664525)+1013904223>>>0,t/4294967295);for(let o=e.length-1;o>0;o--){let r=Math.floor(n()*(o+1)),i=e[o];e[o]=e[r],e[r]=i}}finalizeRoute(e){this.consecutiveSkips=Math.max(0,this.consecutiveSkips-1);let t=[],n=e;for(;n>=0;){let l=this.nodePool.z[n],h=this.nodePool.cellId[n];t.push(l*this.planeSize+h),n=this.nodePool.parent[n]}for(t.reverse();t.length>1&&this.sharedCrossRootPortFlat[t[0]];)t.shift();for(;t.length>1&&this.sharedCrossRootPortFlat[t[t.length-1]];)t.pop();let o=this.extractViaCellIds(t),r=this.activeConnId;this.ripChain.collect(this.nodePool.ripHead[e],this._rippedIds);for(let l=0;l<this._rippedIds.length;l++)if(this.ripTrace(this._rippedIds[l]),this.failed)return;let i=[];for(let l=0;l<t.length;l++){let h=t[l],d=Math.floor(h/this.planeSize),u=h-d*this.planeSize;this.markTraceFootprint(r,d,u,i)}let s=[];for(let l=0;l<o.length;l++)this.markViaFootprint(r,o[l],i,s);for(;this.usedIndicesByConn.length<=r;)this.usedIndicesByConn.push(void 0);let a=this.usedIndicesByConn[r]??[];for(a.push(...i),this.usedIndicesByConn[r]=a;this.solvedRoutes.length<=r;)this.solvedRoutes.push(void 0);let c=this.solvedRoutes[r]??[];c.push({connId:r,states:Int32Array.from(t),viaCellIds:Int32Array.from(o),startPoint:this.activeConnSeg.startPoint,endPoint:this.activeConnSeg.endPoint}),this.solvedRoutes[r]=c;for(let l=0;l<s.length;l++)if(this.ripTrace(s[l]),this.failed)return;if(this._rippedIds.length>0||s.length>0){let l=this.penalty2d,h=this.penaltyCap;if(this.totalRipEvents>50)for(let d=0;d<l.length;d++)l[d]=0.99*l[d];else for(let d=0;d<l.length;d++)l[d]>h&&(l[d]=0.5*l[d])}}extractViaCellIds(e){let t=[];for(let n=1;n<e.length;n++){let o=e[n-1],r=e[n],i=Math.floor(o/this.planeSize),s=Math.floor(r/this.planeSize);i!==s&&t.push(r-s*this.planeSize)}return t}markTraceFootprint(e,t,n,o){let r=this.cellCenterX[n],i=this.cellCenterY[n];this.forEachCellNearCircle(r,i,this.traceKeepoutRadius,(s)=>{if(!nWe(r,i,this.traceKeepoutRadius,this.cellMinX[s],this.cellMinY[s],this.cellMaxX[s],this.cellMaxY[s]))return;let a=t*this.planeSize+s;if(s!==n&&this.shouldSkipFixedPortHalo(a,e))return;let c=this.usedCellsFlat[a],l=this.allowSharedUse(e,c);(c===-1||c===e||l)&&(c!==-1&&c!==e?this.addSharedOccupant(a,e):this.usedCellsFlat[a]=e,o.push(a))})}markViaFootprint(e,t,n,o){let r=this.cellCenterX[t],i=this.cellCenterY[t];this.forEachCellNearCircle(r,i,this.viaKeepoutRadius,(s)=>{if(nWe(r,i,this.viaKeepoutRadius,this.cellMinX[s],this.cellMinY[s],this.cellMaxX[s],this.cellMaxY[s]))for(let a=0;a<this.layers;a++){let c=a*this.planeSize+s;if(s!==t&&this.shouldSkipFixedPortHalo(c,e))continue;if(this.fillTraceOccupants(c,e,this._cellOccs),this._cellOccs.length>0){for(let h=0;h<this._cellOccs.length;h++)L4e(o,this._cellOccs[h]);this.replaceOccupants(c,e),n.push(c);continue}let l=this.usedCellsFlat[c];l!==-1&&l!==e?this.addSharedOccupant(c,e):this.usedCellsFlat[c]=e,n.push(c)}})}forEachCellNearCircle(e,t,n,o){let r=Q7(Math.floor((e-n-this.boundsMinX)/this.highResolutionCellSize),0,this.fineCols-1),i=Q7(Math.floor((e+n-this.boundsMinX)/this.highResolutionCellSize),0,this.fineCols-1),s=Q7(Math.floor((t-n-this.boundsMinY)/this.highResolutionCellSize),0,this.fineRows-1),a=Q7(Math.floor((t+n-this.boundsMinY)/this.highResolutionCellSize),0,this.fineRows-1);for(let c=0;c<this.regions.length;c++){let l=this.regions[c];if(l.rows===0||l.cols===0)continue;let h=Math.max(s,l.fineOriginRow),d=Math.min(a,l.fineOriginRow+l.fineRows-1),u=Math.max(r,l.fineOriginCol),_=Math.min(i,l.fineOriginCol+l.fineCols-1);if(h>d)continue;if(u>_)continue;let p=Math.floor((h-l.fineOriginRow)/l.cellScale),m=Math.floor((d-l.fineOriginRow)/l.cellScale),A=Math.floor((u-l.fineOriginCol)/l.cellScale),g=Math.floor((_-l.fineOriginCol)/l.cellScale);for(let f=p;f<=m;f++)for(let y=A;y<=g;y++)o(this.cellIdFor(l.id,f,y))}}ripTrace(e){for(;this.ripCount.length<=e;)this.ripCount.push(0);if(this.ripCount[e]++,this.totalRipEvents++,this.totalRipEvents>=this.MAX_RIPS)return this.error=`Convergence failure: exceeded MAX_RIPS ${this.MAX_RIPS}`,void(this.failed=!0);let t=this.getSolvedRoutesForConn(e);if(t.length>0)for(let o of t){for(let r=0;r<o.states.length;r++){let i=o.states[r]%this.planeSize;this.penalty2d[i]=this.penalty2d[i]+this.hyperParameters.ripTracePenalty}for(let r=0;r<o.viaCellIds.length;r++){let i=o.viaCellIds[r];this.penalty2d[i]=this.penalty2d[i]+this.hyperParameters.ripViaPenalty}}let n=this.usedIndicesByConn[e];if(n){for(let o=0;o<n.length;o++)this.removeOccupant(n[o],e);this.usedIndicesByConn[e]=void 0}if(t.length>0){this.solvedRoutes[e]=void 0;for(let o of t){let r=o.states[0],i=o.states[o.states.length-1],s=Math.floor(r/this.planeSize),a=Math.floor(i/this.planeSize);this.unsolvedSegs.push({connId:e,startZ:s,startCellId:r-s*this.planeSize,startPoint:o.startPoint,endZ:a,endCellId:i-a*this.planeSize,endPoint:o.endPoint})}}}flattenNeighborLists(e){let t=new Int32Array(e.length+1),n=0;for(let s=0;s<e.length;s++)t[s]=n,n+=e[s].length;t[e.length]=n;let o=new Int32Array(n),r=new Float32Array(n),i=0;for(let s=0;s<e.length;s++){let a=e[s];for(let c=0;c<a.length;c++){let l=a[c];o[i]=l.cellId,r[i]=l.cost,i++}}return{offset:t,ids:o,costs:r}}visualize(){let e=["red","blue","orange","green"],t=this.gridToBoundsTransform,n=[],o=[],r=[],i=[];if(i.push({center:{x:this.nodeWithPortPoints.center.x,y:this.nodeWithPortPoints.center.y},width:this.nodeWithPortPoints.width,height:this.nodeWithPortPoints.height,stroke:"gray"}),this.showPenaltyMap&&this.penalty2d){let c=0;for(let l=0;l<this.penalty2d.length;l++)this.penalty2d[l]>c&&(c=this.penalty2d[l]);if(c>0)for(let l=0;l<this.planeSize;l++){let h=this.penalty2d[l];if(h<=0)continue;let d=O7(t,{x:this.cellCenterX[l],y:this.cellCenterY[l]}),u=Math.min(0.6,h/c*0.6);i.push({center:d,width:this.cellWidth[l]*t.a,height:this.cellHeight[l]*t.e,fill:`rgba(255,165,0,${u.toFixed(3)})`})}}if(this.showUsedCellMap&&this.usedCellsFlat)for(let c=0;c<this.layers;c++){let l=c*this.planeSize;for(let h=0;h<this.planeSize;h++){if(this.usedCellsFlat[l+h]===-1)continue;let d=O7(t,{x:this.cellCenterX[h],y:this.cellCenterY[h]});i.push({center:d,width:this.cellWidth[h]*t.a,height:this.cellHeight[h]*t.e,fill:"rgba(0,0,255,0.5)"})}}for(let c of this.nodeWithPortPoints.portPoints)n.push({x:c.x,y:c.y,color:e[c.z]??"gray",label:c.connectionName});let s=["rgba(255,0,0,0.75)","rgba(0,0,255,0.75)","rgba(255,165,0,0.75)","rgba(0,128,0,0.75)"],a=this.getOutput();for(let c of a){if(c.route.length<2)continue;let l=0;for(let h=1;h<c.route.length;h++){let d=c.route[h-1];c.route[h].z!==d.z&&(h-l>=2&&o.push({points:c.route.slice(l,h).map((u)=>({x:u.x,y:u.y})),strokeColor:s[d.z]??"rgba(128,128,128,0.75)",strokeWidth:this.traceThickness}),l=h)}if(c.route.length-l>=2){let h=c.route[l].z;o.push({points:c.route.slice(l).map((d)=>({x:d.x,y:d.y})),strokeColor:s[h]??"rgba(128,128,128,0.75)",strokeWidth:this.traceThickness})}}for(let c of a)for(let l of c.vias)r.push({center:{x:l.x,y:l.y},radius:this.viaDiameter/2,fill:"rgba(0,0,0,0.3)",stroke:"black"});if(this.activeConnSeg&&this.visitedFlatStamp){let c=this.stamp;for(let l=0;l<this.layers;l++){let h=l*this.planeSize;for(let d=0;d<this.planeSize;d++){if(this.visitedFlatStamp[h+d]!==c)continue;let u=O7(t,{x:this.cellCenterX[d],y:this.cellCenterY[d]});n.push({x:u.x,y:u.y,color:"rgba(0,0,255,0.2)"})}}}return{points:n,lines:o,circles:r,rects:i,coordinateSystem:"cartesian",title:`${this.getSolverName()} [${this.getSolvedRouteCount()} solved, ${this.unsolvedSegs?.length??0} remaining]`}}getOutput(){let e=this.gridToBoundsTransform,t=[];for(let n=0;n<this.solvedRoutes.length;n++){let o=this.getSolvedRoutesForConn(n);if(o.length===0)continue;let r=this.connIdToName[n];for(let i of o){let s=Array.from(i.states,(a)=>{let c=Math.floor(a/this.planeSize),l=a-c*this.planeSize,h=O7(e,{x:this.cellCenterX[l],y:this.cellCenterY[l]});return{x:h.x,y:h.y,z:this.layerToZ.get(c)??c}});s.length===1?(s[0]={...i.startPoint},s.push({...i.endPoint})):s.length>1&&(s[0]={...i.startPoint},s[s.length-1]={...i.endPoint}),t.push({connectionName:r,rootConnectionName:this.connIdToRootNet[n],regionId:this.nodeWithPortPoints.capacityMeshNodeId,traceThickness:this.traceThickness,viaDiameter:this.viaDiameter,route:s,vias:Array.from(i.viaCellIds,(a)=>O7(e,{x:this.cellCenterX[a],y:this.cellCenterY[a]}))})}}return t}getSolvedRoutesForConn(e){let t=this.solvedRoutes[e];return t?Array.isArray(t)?t:[t]:[]}getSolvedRouteCount(){let e=0;for(let t=0;t<this.solvedRoutes.length;t++)e+=this.getSolvedRoutesForConn(t).length;return e}computeGridToBoundsTransform(){let e=1/0,t=-1/0,n=1/0,o=-1/0;for(let h=0;h<this.planeSize;h++){let d=this.cellCenterX[h],u=this.cellCenterY[h];d<e&&(e=d),d>t&&(t=d),u<n&&(n=u),u>o&&(o=u)}let r=t-e,i=o-n,s=this.boundsMaxX-this.boundsMinX,a=this.boundsMaxY-this.boundsMinY,c=r>0?s/r:1,l=i>0?a/i:1;return{a:c,b:0,c:r>0?this.boundsMinX-c*e:(this.boundsMinX+this.boundsMaxX)/2-e,d:0,e:l,f:i>0?this.boundsMinY-l*n:(this.boundsMinY+this.boundsMaxY)/2-n}}},qmr=class{begin;run;copyParents;constructor(e,t,n,o,r){let i=e*t,s=i*n,a=new Float64Array(s),c=new Int32Array(s),l=new Uint32Array(s),h=new Int32Array(s),d=new Uint8Array(s),u,_,p,m,A,g,f,y,x=0,C=0,b=0,I=1024,v=new Float64Array(I),P=new Int32Array(I),M=new Uint32Array(I);for(let H=0;H<s;H++){let V=H%i,O=V%e,U=Math.floor(V/e),j=Math.floor(H/i);h[H]=V,d[H]=Number(O>0)|Number(O+1<e)<<1|Number(U>0)<<2|Number(U+1<t)<<3|j%2<<4}function B(H,V){let O=b++;for(;O>0;){let U=O-1>>1;if(v[U]<=V)break;v[O]=v[U],P[O]=P[U],M[O]=M[U],O=U}v[O]=V,P[O]=H,l[H]=l[H]+1>>>0,M[O]=l[H]}let T=0,N=0;function D(){T=P[0],N=M[0];let H=--b;if(!H)return;let V=P[H],O=M[H],U=v[H],j=0;for(;2*j+1<b;){let Y=2*j+1;if(Y+1<b&&v[Y+1]<v[Y]&&Y++,U<=v[Y])break;v[j]=v[Y],P[j]=P[Y],M[j]=M[Y],j=Y}v[j]=U,P[j]=V,M[j]=O}function L(H,V,O,U,j,Y){let X=Y+V;if(X>=a[H])return;if(p[H]&&H!==x)return;if(O&&m[U])return;let K=O?_[U]:u[H],J=O?g[U]:A[H],ee=X+C*K+J;ee>=a[H]||(a[H]=ee,c[H]=j,B(H,ee+f[H]))}this.begin=(H,V,O,U)=>{({traceCost:u,viaCost:_,fixed:p,fixedVia:m,history:A,viaHistory:g,viaAllowed:y}=H),f=H.heuristicCost,x=O,C=U,b=0,a.fill(1/0),c.fill(-1),l.fill(0),a[V]=0,B(V,f[V])},this.run=(H,V)=>{let O=0,U=0;for(;U<H;){if(O>=V)return{status:3,expansions:O};if(!b)return{status:2,expansions:O};if(b+4+n>I){I*=2;let se=new Float64Array(I),ne=new Int32Array(I),re=new Uint32Array(I);se.set(v),ne.set(P),re.set(M),v=se,P=ne,M=re;continue}D(),U++;let j=T;if(N!==l[j])continue;let Y=a[j];if(O++,j===x)return{status:1,expansions:O};let X=h[j],K=d[j],J=o*(16&K?1.05:1),ee=r*(16&K?1:1.05);if(1&K&&L(j-1,J,!1,0,j,Y),2&K&&L(j+1,J,!1,0,j,Y),4&K&&L(j-e,ee,!1,0,j,Y),8&K&&L(j+e,ee,!1,0,j,Y),y[X])for(let se=0;se<n;se++){let ne=se*i+X;ne!==j&&L(ne,0.8,!0,X,j,Y)}}return{status:0,expansions:O}},this.copyParents=(H)=>H.set(c)}},Jmr=class{exports;offsets=[];states;heapCapacity=1024;constructor(e,t,n,o,r){DFt??=new WebAssembly.Module(Uint8Array.from(atob("AGFzbQEAAAABHwVgB39/f3x8f38AYAF/AGAAAX9gA39/fABgAn9/AX8DBwYAAQICAwQFAwEAAgYPAn8BQYCABAt/AEGAgQQLB2kIBm1lbW9yeQIACWNvbmZpZ3VyZQAAEXNldF9oZWFwX2NhcGFjaXR5AAEOZ2V0X2V4cGFuc2lvbnMAAghnZXRfcG9wcwADDGJlZ2luX3NlYXJjaAAEA3J1bgAFC19faGVhcF9iYXNlAwEK0h8G8wcEBX8FewR/BHtBACEHQQAgAjYChICEgABBACAANgKAgISAAEEAIAY2AqCAhIAAQQAgASAAbCIINgKIgISAAEEAIAggAmwiCTYCjICEgABBACADOQOQgISAAEEAIAQ5A5iAhIAAQQAgBSgCBDYCqICEgABBACAFKAIINgKsgISAAEEAIAUoAgw2ArCAhIAAQQAgBSgCEDYCtICEgABBACAFKAIUNgK4gISAAEEAIAUoAgA2AqSAhIAAQQAgBSgCGDYCvICEgABBACAFKAIcNgLAgISAAEEAIAUoAiA2AsSAhIAAQQAgBSgCJDYCyICEgABBACAFKAIoIgo2AsyAhIAAQQAgBSgCLCILNgLQgISAAEEAIAUoAjA2AtSAhIAAQQAgBSgCNDYC2ICEgAACQCAJQQFIDQACQCAJQQhJDQAgCyACIAFsIABsQQJ0IgVqIgIgCksgCiAFaiIFIAtLcQ0AIApBhICEgABJIAVBgICEgABLcQ0AIAtBhICEgABJIAJBgICEgABLcQ0AIAH9ESEMIAD9ESENIAj9ESEOQQD9CQKAgISAACEP/QwAAAAAAQAAAAIAAAADAAAAIRAgCiEFIAshAiAJQfz///8HcSIHIQYDQCAFIBAgEP0bACAO/RsAbSIR/REgEP0bASAO/RsBbSIS/RwBIBD9GwIgDv0bAm0iE/0cAiAQ/RsDIA79GwNtIhT9HAMgDv21Af2xASIV/QsCACACIBX9GwAgDf0bAG39ESAV/RsBIA39GwFt/RwBIBX9GwIgDf0bAm39HAIgFf0bAyAN/RsDbf0cAyIW/QwAAAAAAAAAAAAAAAAAAAAAIhf9O/0MBAAAAAQAAAAEAAAABAAAACIY/U4gFSAWIA39tQH9sQEiFSAX/Tj9sQEgEUECb/0RIBJBAm/9HAEgE0ECb/0cAiAUQQJv/RwDQQT9qwH9UCAV/QwBAAAAAQAAAAEAAAABAAAAIhf9rgEgD/05/QwCAAAAAgAAAAIAAAACAAAA/U79UCAWIBf9rgEgDP05/QwIAAAACAAAAAgAAAAIAAAA/U79UP0LAgAgBUEQaiEFIAJBEGohAiAQIBj9rgEhECAGQXxqIgYNAAsgCSAHRg0BC0EAIAFrIRMgCiAHQQJ0IgJqIQUgCyACaiECQQAgCGshFANAIAUgByAUIAcgCG0iBmxqIhE2AgAgAkEEQQAgESAAbSIRQQBKGyAHIAAgEyAGbCARa2wiEmpBAEdyIAZBAm9BBHRyQQJBACAHQQFqIgYgEmpBACgCgICEgABIG3JBCEEAIBFBAWogAUgbcjYCACAFQQRqIQUgAkEEaiECIAYhByAJIAZHDQALCwsNAEEAIAA2AqCAhIAACwsAQQAoAtyAhIAACwsAQQAoAuCAhIAAC4gFAQl/QQAgAjkD6ICEgABBACABNgLkgISAAEEAKALUgISAACEDQQAoAsSAhIAAIQQCQEEAKAKMgISAACIFQQFIDQBBACgCyICEgAAhBkEAIQcCQCAFQQRJDQBBACEHIAMgBmtBCEkNACAEIQEgBiEIIAMhCSAFQf7///8HcSIHIQoDQCAIQn83AgAgAf0MAAAAAAAA8H8AAAAAAADwf/0LAwAgCUIANwIAIAFBEGohASAIQQhqIQggCUEIaiEJIApBfmoiCg0ACyAFIAdGDQELIAchCwJAIAUgB2tBA3EiCkUNACAHIApqIQsgBCAHQQN0aiEBIAYgB0ECdCIJaiEIIAMgCWohCQNAIAhBfzYCACABQoCAgICAgID4/wA3AwAgCUEANgIAIAFBCGohASAIQQRqIQggCUEEaiEJIApBf2oiCg0ACwsgByAFa0F8Sw0AIAtBAnQhByAFIAtrIQUgBCALQQN0aiEBIAMhCgNAIAYgB2oiCEF/NgIAIAogB2oiCUEANgIAIAhBBGpBfzYCACAJQQRqQQA2AgAgCEEIakF/NgIAIAlBCGpBADYCACAIQQxqQX82AgAgAUKAgICAgICA+P8ANwMAIAFBCGpCgICAgICAgPj/ADcDACABQRBqQoCAgICAgID4/wA3AwAgAUEYakKAgICAgICA+P8ANwMAIAlBDGpBADYCACABQSBqIQEgBkEQaiEGIApBEGohCiAFQXxqIgUNAAsLQQBBATYC8ICEgAAgBCAAQQN0IghqQgA3AwAgAyAAQQJ0aiIBIAEoAgBBAWoiCTYCAEEAKALYgISAACIBQQAoAryAhIAAIAhqKwMAOQMAIAEgCTYCDCABIAA2AggLqhIMC38BfAN/AnwNfwF+AXwDfwJ8AX8BfAN/QQAhAkEAQQA2AuCAhIAAQQBBADYC3ICEgAACQCAAQQFIDQBBACgChICEgAAiA0EEaiEEQQAoAriAhIAAIQVBACgCqICEgAAhBkEAKAKwgISAACEHQQAoAoiAhIAAIQhBACgCwICEgAAhCUEAKAKAgISAACEKQQAoAryAhIAAIQtBACgCyICEgAAhDEEAKwPogISAACENQQAoArSAhIAAIQ5BACgCpICEgAAhD0EAKAKsgISAACEQQQArA5iAhIAAIRFBACsDkICEgAAhEkEAKALQgISAACETQQAoAsyAhIAAIRRBACgC5ICEgAAhFUEAKALEgISAACEWQQAoAtSAhIAAIRdBACgC2ICEgAAhGEEAKAKggISAACEZQQAoAvCAhIAAIRpBACEbQQAhHANAAkAgHCABSA0AQQMPCwJAIBoNAEECDwsCQCAaIARqIBlMDQBBBA8LQQAgGkF/aiIdNgLwgISAACAYKAIMIR4gGCgCCCEfAkAgHUUNACAYIB1BBHRqIgIpAwghICACKwMAISFBACECAkAgGkEDSA0AQQAhIkEBISNBACEkA0ACQAJAICRBAmoiJCAdSA0AICMhAgwBCyAjIQIgGCAkQQR0aisDACAYICNBBHRqKwMAY0UNACAkIQILAkAgISAYIAJBBHRqIiMrAwBlRQ0AICIhAgwCCyAYICJBBHRqICP9AAMA/QsDACACISIgAkEBdCIkQQFyIiMgHUgNAAsLIBggAkEEdGoiAiAgNwMIIAIgITkDAAtBACAbQQFqIhs2AuCAhIAAAkACQCAeIBcgH0ECdCIjaigCAEYNACAdIRoMAQtBASECQQAgHEEBaiIcNgLcgISAACAfIBVGDQIgFiAfQQN0aisDACEhIBJEzczMzMzM8D9EAAAAAAAA8D8gEyAjaigCACICQRBxIiIboiElIBQgI2ooAgAhIwJAAkAgAkEBcQ0AIB0hGgwBCwJAICEgJaAiJiAWIB9Bf2oiHkEDdCIkaiInKwMAIihmRQ0AIB0hGgwBCwJAIB4gFUYNACAQIB5qLQAAQf8BcUUNACAdIRoMAQsCQCAOICRqKwMAICYgDSAPIB5BAXRqLwEAuKKgoCImIChmRQ0AIB0hGgwBCyAMIB5BAnQiKWogHzYCACAnICY5AwBBACAaNgLwgISAACAmIAsgJGorAwCgISYCQCAaQQJIDQADQCAYIB1Bf2pBAXYiJEEEdGoiJysDACAmZQ0BIBggHUEEdGogJ/0AAwD9CwMAICQhHSAkDQALQQAhHQsgFyApaiIkICQoAgBBAWoiJDYCACAYIB1BBHRqIh0gJjkDACAdICQ2AgwgHSAeNgIIC0QAAAAAAADwP0TNzMzMzMzwPyAiGyEmAkACQCACQQJxDQAgGiEdDAELAkAgISAloCIlIBYgH0EBaiIeQQN0IiJqIh0rAwAiKGZFDQAgGiEdDAELAkAgHiAVRg0AIBAgHmotAABB/wFxRQ0AIBohHQwBCwJAIA4gImorAwAgJSANIA8gHkEBdGovAQC4oqCgIiUgKGZFDQAgGiEdDAELIAwgHkECdCInaiAfNgIAIB0gJTkDAEEAIBpBAWoiHTYC8ICEgAAgJSALICJqKwMAoCElAkAgGkEBSA0AA0AgGCAaQX9qQQF2IiJBBHRqIiQrAwAgJWUNASAYIBpBBHRqICT9AAMA/QsDACAiIRogIg0AC0EAIRoLIBcgJ2oiIiAiKAIAQQFqIiI2AgAgGCAaQQR0aiIaICU5AwAgGiAiNgIMIBogHjYCCAsgESAmoiElAkACQCACQQRxDQAgHSEiDAELAkAgISAloCImIBYgHyAKayIeQQN0IhpqIiIrAwAiKGZFDQAgHSEiDAELAkAgHiAVRg0AIBAgHmotAABB/wFxRQ0AIB0hIgwBCwJAIA4gGmorAwAgJiANIA8gHkEBdGovAQC4oqCgIiYgKGZFDQAgHSEiDAELIAwgHkECdCInaiAfNgIAICIgJjkDAEEAIB1BAWoiIjYC8ICEgAAgJiALIBpqKwMAoCEmAkAgHUEBSA0AA0AgGCAdQX9qQQF2IhpBBHRqIiQrAwAgJmUNASAYIB1BBHRqICT9AAMA/QsDACAaIR0gGg0AC0EAIR0LIBcgJ2oiGiAaKAIAQQFqIho2AgAgGCAdQQR0aiIdICY5AwAgHSAaNgIMIB0gHjYCCAsCQAJAIAJBCHENACAiIRoMAQsCQCAhICWgIiUgFiAKIB9qIiRBA3QiAmoiHSsDACImZkUNACAiIRoMAQsCQCAkIBVGDQAgECAkai0AAEH/AXFFDQAgIiEaDAELAkAgDiACaisDACAlIA0gDyAkQQF0ai8BALiioKAiJSAmZkUNACAiIRoMAQsgDCAkQQJ0Ih5qIB82AgAgHSAlOQMAQQAgIkEBaiIaNgLwgISAACAlIAsgAmorAwCgISUCQCAiQQFIDQADQCAYICJBf2pBAXYiAkEEdGoiHSsDACAlZQ0BIBggIkEEdGogHf0AAwD9CwMAIAIhIiACDQALQQAhIgsgFyAeaiICIAIoAgBBAWoiHTYCACAYICJBBHRqIgIgJTkDACACIB02AgwgAiAkNgIICyAJICNqLQAARQ0AIANBAUgNACAHICNqIR4gIUSamZmZmZnpP6AhISAFICNBA3RqIScgBiAjQQF0aiEpQQAhAgNAAkAgCCACbCAjaiIdIB9GDQAgISAWIB1BA3QiImoiJCsDACIlZg0AAkAgHSAVRg0AIBAgHWotAABB/wFxDQELIB4tAAANACAnKwMAICEgDSApLwEAuKKgoCImICVmDQAgDCAdQQJ0IipqIB82AgAgJCAmOQMAQQAgGkEBaiIrNgLwgISAACAmIAsgImorAwCgISUCQCAaQQFIDQADQCAYIBpBf2pBAXYiIkEEdGoiJCsDACAlZQ0BIBggGkEEdGogJP0AAwD9CwMAICIhGiAiDQALQQAhGgsgFyAqaiIiICIoAgBBAWoiIjYCACAYIBpBBHRqIhogJTkDACAaICI2AgwgGiAdNgIIICshGgsgAkEBaiICIANHDQALCyAbIABHDQALQQAhAgsgAgsAdQRuYW1lAAwLa2VybmVsLndhc20BTAYACWNvbmZpZ3VyZQERc2V0X2hlYXBfY2FwYWNpdHkCDmdldF9leHBhbnNpb25zAwhnZXRfcG9wcwQMYmVnaW5fc2VhcmNoBQNydW4HEgEAD19fc3RhY2tfcG9pbnRlcgAvCXByb2R1Y2VycwEMcHJvY2Vzc2VkLWJ5AQ5Ib21lYnJldyBjbGFuZwYyMi4xLjgAnQEPdGFyZ2V0X2ZlYXR1cmVzCSsLYnVsay1tZW1vcnkrD2J1bGstbWVtb3J5LW9wdCsWY2FsbC1pbmRpcmVjdC1vdmVybG9uZysKbXVsdGl2YWx1ZSsPbXV0YWJsZS1nbG9iYWxzKxNub250cmFwcGluZy1mcHRvaW50Kw9yZWZlcmVuY2UtdHlwZXMrCHNpZ24tZXh0KwdzaW1kMTI4"),(c)=>c.charCodeAt(0))),this.exports=new WebAssembly.Instance(DFt).exports;let i=e*t;this.states=i*n;let s=Number(this.exports.__heap_base.value),a=s;s+=56;for(let c of[2*this.states,2*i,this.states,i,8*this.states,8*i,8*this.states,i,8*this.states,4*this.states,4*this.states,4*this.states,4*this.states,16*this.heapCapacity])s=8*Math.ceil(s/8),this.offsets.push(s),s+=c;this.ensureMemory(s),new Int32Array(this.exports.memory.buffer,a,14).set(this.offsets),this.exports.configure(e,t,n,o,r,a,this.heapCapacity)}ensureMemory(e){let t=this.exports.memory;e>t.buffer.byteLength&&t.grow(Math.ceil((e-t.buffer.byteLength)/65536))}begin(e,t,n,o){let r=new Uint8Array(this.exports.memory.buffer),i=[e.traceCost,e.viaCost,e.fixed,e.fixedVia,e.history,e.viaHistory,e.heuristicCost,e.viaAllowed];for(let s=0;s<i.length;s++){let a=i[s];r.set(new Uint8Array(a.buffer,a.byteOffset,a.byteLength),this.offsets[s])}this.exports.begin_search(t,n,o)}run(e,t){let n=0,o=0,r=Math.ceil(e);for(;r>0;)if(o=this.exports.run(Math.min(r,1e6),Math.min(Math.ceil(t-n),2147483647)),r-=this.exports.get_pops(),n+=this.exports.get_expansions(),o===4)this.heapCapacity*=2,this.ensureMemory(this.offsets[13]+16*this.heapCapacity),this.exports.set_heap_capacity(this.heapCapacity);else if(o!==0)break;return{status:o,expansions:n}}copyParents(e){e.set(new Int32Array(this.exports.memory.buffer,this.offsets[9],this.states))}},aje=(e,t,n)=>{let[o,r]=e;if(o===r)return;let i=((s,a)=>{let c=s.portPointId??`${s.connectionName}:${s.x}:${s.y}:${s.z}`,l=a.portPointId??`${a.connectionName}:${a.x}:${a.y}:${a.z}`;return c<l?`${c}|${l}`:`${l}|${c}`})(o,r);t.has(i)||(t.add(i),n.push(e))},NFt=(e,t,n)=>{for(let o=0;o<e.length-1;o++)aje([e[o],e[o+1]],t,n)},Zmr=(e)=>{let t=[],n=new Set,o=((s)=>{let a=new Map;for(let c of s)c.portPointId&&a.set(c.portPointId,c);return a})(e);for(let s of e){if(s.prevPortPointId){let a=o.get(s.prevPortPointId);a&&a.connectionName===s.connectionName&&aje([a,s],n,t)}if(s.nextPortPointId){let a=o.get(s.nextPortPointId);a&&a.connectionName===s.connectionName&&aje([s,a],n,t)}}if(t.length===0)return NFt(e,n,t),t;let r=((s)=>{let a=new Set;for(let[c,l]of s)c.portPointId&&a.add(c.portPointId),l.portPointId&&a.add(l.portPointId);return a})(t),i=e.filter((s)=>!s.portPointId||!r.has(s.portPointId));return NFt(i,n,t),t},Gae=0.000000001,F4e=0.01,gae=0.000001;function z4e(e,t,n){return(t.x-e.x)*(n.y-e.y)-(t.y-e.y)*(n.x-e.x)}function yXt(e,t,n,o){let r=z4e(n,o,e),i=z4e(n,o,t),s=z4e(e,t,n),a=z4e(e,t,o);if((r>Gae&&i<-0.000000001||r<-0.000000001&&i>Gae)&&(s>Gae&&a<-0.000000001||s<-0.000000001&&a>Gae)){let c=r/(r-i);return{x:e.x+c*(t.x-e.x),y:e.y+c*(t.y-e.y)}}return null}function e_r(e,t){let n=[];for(let o=0;o<e.route.length-1;o++){let r=e.route[o],i=e.route[o+1];r.z===t&&i.z===t&&n.push([{x:r.x,y:r.y},{x:i.x,y:i.y}])}return n}function t_r(e,t){return e.route.filter((n)=>n.z===t).map((n)=>({x:n.x,y:n.y}))}function cje(e,t){return Math.hypot(e.x-t.x,e.y-t.y)}function x$e(e,t,n=0.01){return Math.abs(e.x-t.x)<n&&Math.abs(e.y-t.y)<n}function RFt(e,t,n){let o=new Set,r=[e.route[0],e.route[e.route.length-1]];for(let i of r)i&&i.z===t&&i.portPointId&&x$e(i,n)&&o.add(i.portPointId);return o}function lje(e,t,n,o){let r=RFt(e,n,o);if(r.size===0)return!1;let i=RFt(t,n,o);if(i.size===0)return!1;for(let s of r)if(i.has(s))return!0;return!1}function n_r(e,t,n,o){let r=[t.a,t.b],i=[o.a,o.b];for(let s of r)for(let a of i)if(x$e(s,a)&&lje(e,n,t.z,s))return!0;return!1}function u$(e,t,n){let o=n.x-t.x,r=n.y-t.y,i=o*o+r*r;if(i<=Gae)return cje(e,t);let s=e.x-t.x,a=e.y-t.y,c=Math.max(0,Math.min(1,(s*o+a*r)/i)),l=t.x+o*c,h=t.y+r*c;return Math.hypot(e.x-l,e.y-h)}function o_r(e,t,n,o){return yXt(e,t,n,o)?0:Math.min(u$(e,n,o),u$(t,n,o),u$(n,e,t),u$(o,e,t))}function QFt(e){return e.rootConnectionName??e.connectionName.replace(/_mst\d+$/,"")}function Aae(e,t){e.push(t)}function r_r(e){let t=function(o){let r=[],i=new Set;for(let s of o)for(let a of s.route)i.add(a.z);for(let s of i){let a=o.map((c)=>({points:t_r(c,s),segments:e_r(c,s),root:QFt(c)}));for(let c=0;c<o.length;c++){let l=o[c],{points:h,segments:d,root:u}=a[c];for(let _=c+1;_<o.length;_++){let p=o[_],{points:m,segments:A,root:g}=a[_];if(u===g)continue;let f=new Set;for(let y of h)for(let x of m)if(x$e(y,x)){if(lje(l,p,s,y))continue;let C=`${y.x.toFixed(2)},${y.y.toFixed(2)}`;if(f.has(C))continue;f.add(C),r.push({trace1:l.connectionName,trace2:p.connectionName,z:s,point:y,type:"shared_point"})}for(let[y,x]of d)for(let[C,b]of A){let I=yXt(y,x,C,b);I&&r.push({trace1:l.connectionName,trace2:p.connectionName,z:s,point:I,type:"crossing",seg1:[y,x],seg2:[C,b]})}}}}return r}(e).map((o)=>({trace1:o.trace1,trace2:o.trace2,type:o.type,z:o.z,point:o.point,seg1:o.seg1,seg2:o.seg2,distance:0,requiredDistance:0})),n=e.map((o)=>{let r=function(c){let l=[];for(let h=0;h<c.route.length-1;h++){let d=c.route[h],u=c.route[h+1];d.z===u.z&&l.push({minX:Math.min(d.x,u.x),maxX:Math.max(d.x,u.x),minY:Math.min(d.y,u.y),maxY:Math.max(d.y,u.y),z:d.z,a:{x:d.x,y:d.y},b:{x:u.x,y:u.y}})}return l}(o),i=new Set,s=new Map,a=new Map;for(let c of o.route){i.add(c.z);let l=s.get(c.z)??[];l.push({x:c.x,y:c.y}),s.set(c.z,l)}for(let c of r){let l=a.get(c.z)??[];l.push(c),a.set(c.z,l)}return{route:o,rootNet:QFt(o),pointsByLayer:s,segmentsByLayer:a,segments:r,vias:o.vias.map((c)=>({x:c.x,y:c.y})),traceRadius:o.traceThickness/2,viaRadius:o.viaDiameter/2,zLayers:i}});for(let o=0;o<n.length;o++){let r=n[o];for(let i=o+1;i<n.length;i++){let s=n[i];if(r.rootNet===s.rootNet)continue;let a=new Set([...r.zLayers.values(),...s.zLayers.values()]);for(let l of a){let h=r.segmentsByLayer.get(l)??[],d=s.segmentsByLayer.get(l)??[],u=r.pointsByLayer.get(l)??[],_=s.pointsByLayer.get(l)??[],p=r.traceRadius+s.traceRadius;for(let m of h)for(let A of d){if(m.minX-A.maxX>=p||A.minX-m.maxX>=p||m.minY-A.maxY>=p||A.minY-m.maxY>=p)continue;let g=o_r(m.a,m.b,A.a,A.b);g+gae>=p||(g<=F4e&&n_r(r.route,m,s.route,A)||Aae(t,{trace1:r.route.connectionName,trace2:s.route.connectionName,type:g<=F4e?"shared_point":"trace_clearance",z:l,distance:g,requiredDistance:p,seg1:[m.a,m.b],seg2:[A.a,A.b]}))}for(let m of u)for(let A of _){if(Math.abs(m.x-A.x)>=p||Math.abs(m.y-A.y)>=p)continue;let g=cje(m,A);g+gae>=p||(g<=F4e&&lje(r.route,s.route,l,m)||Aae(t,{trace1:r.route.connectionName,trace2:s.route.connectionName,type:g<=F4e?"shared_point":"trace_clearance",z:l,distance:g,requiredDistance:p,point:m,point2:A}))}}let c=r.viaRadius+s.viaRadius;for(let l of r.vias)for(let h of s.vias){if(Math.abs(l.x-h.x)>=c||Math.abs(l.y-h.y)>=c)continue;let d=cje(l,h);d+gae>=c||Aae(t,{trace1:r.route.connectionName,trace2:s.route.connectionName,type:"via_via_clearance",z:null,distance:d,requiredDistance:c,point:l,point2:h})}for(let l of r.vias){let h=r.viaRadius+s.traceRadius;for(let d of s.segments){if(l.x-d.maxX>=h||d.minX-l.x>=h||l.y-d.maxY>=h||d.minY-l.y>=h)continue;let u=u$(l,d.a,d.b);u+gae>=h||Aae(t,{trace1:r.route.connectionName,trace2:s.route.connectionName,type:"via_trace_clearance",z:d.z,distance:u,requiredDistance:h,point:l,seg2:[d.a,d.b]})}}for(let l of s.vias){let h=s.viaRadius+r.traceRadius;for(let d of r.segments){if(l.x-d.maxX>=h||d.minX-l.x>=h||l.y-d.maxY>=h||d.minY-l.y>=h)continue;let u=u$(l,d.a,d.b);u+gae>=h||Aae(t,{trace1:r.route.connectionName,trace2:s.route.connectionName,type:"via_trace_clearance",z:d.z,distance:u,requiredDistance:h,point:l,seg1:[d.a,d.b]})}}}}return t}var N7=class extends fa{nodeWithPortPoints;props;traceThickness;traceMargin;viaDiameter;hyperParameters;phase="routing";round=0;routingIterations=0;routedCount=0;conflictCount=0;rerouteCount=0;bestConflictCount=1/0;broadNegotiations=0;stagnantRounds=0;violations=[];connections=[];activeConnectionIndex=-1;rows=0;cols=0;plane=0;layers=[];pitchX=0;pitchY=0;left=0;bottom=0;routes=new Map;pairCache=new WeakMap;queue=[];traceCost;viaCost;fixed;fixedVia;history;viaHistory;parent;searchKernel;heuristicCost;heuristicCache=new Map;viaAllowed;goal=0;presentCost=0.5;randomState=1;constructor(e){super(),this.props=e,this.nodeWithPortPoints=e.nodeWithPortPoints,this.traceThickness=e.traceThickness??0.1,this.traceMargin=e.traceMargin??0.1,this.viaDiameter=e.viaDiameter??0.3,this.hyperParameters={shuffleSeed:0,greedyMultiplier:1.1,...e.hyperParameters};for(let t of[e.cellSizeMm??0.1,this.traceThickness,this.viaDiameter,e.stepMultiplier??1000,e.maxRounds??200,e.maxSearchIterations??50000000,this.hyperParameters.greedyMultiplier])if(!Number.isFinite(t)||t<=0)throw Error("A13 dimensions and search limits must be positive and finite");if(!Number.isFinite(this.traceMargin)||this.traceMargin<0)throw Error("traceMargin must be nonnegative");this.MAX_ITERATIONS=1e8}getSolverName(){return"HighDensitySolverA13"}getConstructorParams(){return[{...this.props}]}_setup(){let e=this.nodeWithPortPoints;if(e.width<=0||e.height<=0)throw Error("Node dimensions must be positive");this.cols=Math.ceil(e.width/(this.props.cellSizeMm??0.1))+1,this.rows=Math.ceil(e.height/(this.props.cellSizeMm??0.1))+1,this.pitchX=e.width/(this.cols-1),this.pitchY=e.height/(this.rows-1),this.left=e.center.x-e.width/2,this.bottom=e.center.y-e.height/2,this.layers=e.availableZ??[...new Set(e.portPoints.map((i)=>i.z))].sort((i,s)=>i-s),this.plane=this.rows*this.cols;let t=this.plane*this.layers.length;if(t>2000000)throw Error("A13 grid exceeds two million states");this.traceCost=new Uint16Array(t),this.viaCost=new Uint16Array(this.plane),this.fixed=new Uint8Array(t),this.fixedVia=new Uint8Array(this.plane),this.history=new Float64Array(t),this.viaHistory=new Float64Array(this.plane),this.heuristicCost=new Float64Array(t),this.viaAllowed=new Uint8Array(this.plane);let n=Math.max(this.viaDiameter/2,this.props.viaMinDistFromBorder??this.viaDiameter/2);for(let i=0;i<this.plane;i++){let s=this.point(i);s.x-this.left>=n&&this.left+e.width-s.x>=n&&s.y-this.bottom>=n&&this.bottom+e.height-s.y>=n&&(this.viaAllowed[i]=1)}this.parent=new Int32Array(t);let o=this.props.searchBackend==="wasm"?Jmr:qmr;this.searchKernel=new o(this.cols,this.rows,this.layers.length,this.pitchX,this.pitchY);let r=new Map;for(let i of e.portPoints){if(!this.layers.includes(i.z))throw Error("Port is on an unavailable layer");let s=r.get(i.connectionName)??[];s.push(i),r.set(i.connectionName,s)}for(let i of r.values())for(let[s,a]of Zmr(i))this.connections.push({start:s,end:a,root:s.rootConnectionName??s.connectionName.replace(/_mst\d+$/,"")});this.randomState=this.hyperParameters.shuffleSeed+1>>>0,this.queue=this.shuffle(this.connections.map((i,s)=>s))}shuffle(e){for(let t=e.length-1;t>0;t--){this.randomState=Math.imul(this.randomState,1664525)+1013904223>>>0;let n=this.randomState%(t+1);[e[t],e[n]]=[e[n],e[t]]}return e}index(e){let t=Math.max(0,Math.min(this.cols-1,Math.round((e.x-this.left)/this.pitchX))),n=Math.max(0,Math.min(this.rows-1,Math.round((e.y-this.bottom)/this.pitchY)));return this.layers.indexOf(e.z)*this.plane+n*this.cols+t}point(e){let t=e%this.plane;return{x:this.left+t%this.cols*this.pitchX,y:this.bottom+Math.floor(t/this.cols)*this.pitchY,z:this.layers[Math.floor(e/this.plane)]}}capsule(e,t,n,o){let r=Math.max(0,Math.floor((Math.min(e.x,t.x)-n-this.left)/this.pitchX)),i=Math.min(this.cols-1,Math.ceil((Math.max(e.x,t.x)+n-this.left)/this.pitchX)),s=Math.max(0,Math.floor((Math.min(e.y,t.y)-n-this.bottom)/this.pitchY)),a=Math.min(this.rows-1,Math.ceil((Math.max(e.y,t.y)+n-this.bottom)/this.pitchY)),c=t.x-e.x,l=t.y-e.y,h=c*c+l*l;for(let d=s;d<=a;d++)for(let u=r;u<=i;u++){let _=this.left+u*this.pitchX,p=this.bottom+d*this.pitchY,m=h?Math.max(0,Math.min(1,((_-e.x)*c+(p-e.y)*l)/h)):0;(_-e.x-m*c)**2+(p-e.y-m*l)**2<n*n-0.000000000001&&o(d*this.cols+u)}}prepareSearch(e){this.activeConnectionIndex=e;let t=this.connections[e];this.traceCost.fill(0),this.viaCost.fill(0),this.fixed.fill(0),this.fixedVia.fill(0);for(let[i,s]of this.routes)if(this.connections[i].root!==t.root){for(let a of s.traceFootprint)this.traceCost[a]++;for(let a of s.viaFootprint)this.viaCost[a]++}for(let i of this.connections)if(i.root!==t.root)for(let s of[i.start,i.end])this.capsule(s,s,this.traceThickness+this.traceMargin,(a)=>{this.fixed[this.layers.indexOf(s.z)*this.plane+a]=1}),this.capsule(s,s,(this.traceThickness+this.viaDiameter)/2+this.traceMargin,(a)=>{this.fixedVia[a]=1});let n=this.index(t.start);this.goal=this.index(t.end);let o=this.point(this.goal),r=this.heuristicCache.get(this.goal);if(r)this.heuristicCost=r;else{this.heuristicCost=new Float64Array(this.parent.length);for(let s=0;s<this.layers.length;s++)for(let a=0;a<this.rows;a++){let c=Math.abs(this.bottom+a*this.pitchY-o.y);for(let l=0;l<this.cols;l++)this.heuristicCost[s*this.plane+a*this.cols+l]=(Math.abs(this.left+l*this.pitchX-o.x)+c+(this.layers[s]===o.z?0:0.8))*this.hyperParameters.greedyMultiplier}let i=Math.floor(8388608/this.heuristicCost.byteLength);i>0&&(this.heuristicCache.size>=i&&this.heuristicCache.delete(this.heuristicCache.keys().next().value),this.heuristicCache.set(this.goal,this.heuristicCost))}this.searchKernel.begin({traceCost:this.traceCost,viaCost:this.viaCost,fixed:this.fixed,fixedVia:this.fixedVia,history:this.history,viaHistory:this.viaHistory,heuristicCost:this.heuristicCost,viaAllowed:this.viaAllowed},n,this.goal,this.presentCost)}_step(){if(this.phase==="negotiating")return void this.negotiate();if(this.activeConnectionIndex<0){let n=this.queue.shift();if(n===void 0)return void(this.phase="negotiating");this.prepareSearch(n)}let{status:e,expansions:t}=this.searchKernel.run(this.props.stepMultiplier??1000,(this.props.maxSearchIterations??50000000)-this.routingIterations);this.routingIterations+=t,e===1?(this.searchKernel.copyParents(this.parent),this.commit(this.goal)):e===2?(this.failed=!0,this.error=`No path between fixed terminals of ${this.connections[this.activeConnectionIndex].start.connectionName}`):e===3&&(this.failed=!0,this.error="A13 exhausted its search budget")}commit(e){let t=this.activeConnectionIndex,n=this.connections[t],o=[];for(let u=e;u!==-1;u=this.parent[u])o.push(u);o.reverse();let r=[{...n.start},...o.map((u)=>this.point(u)),{...n.end}],i=[];for(let u of r){let _=i.at(-1),p=i.at(-2);_&&_.x===u.x&&_.y===u.y&&_.z===u.z||(p&&_&&p.z===u.z&&_.z===u.z&&(_.x-p.x)*(u.y-_.y)===(_.y-p.y)*(u.x-_.x)&&i.pop(),i.push(u))}i[0]={...n.start},i[i.length-1]={...n.end};let s=[],a=[];for(let u=1;u<o.length;u++)if(Math.floor(o[u]/this.plane)!==Math.floor(o[u-1]/this.plane)){let _=this.point(o[u]);s.push({x:_.x,y:_.y}),a.push(o[u]%this.plane)}let c={connectionName:n.start.connectionName,rootConnectionName:n.root,regionId:this.nodeWithPortPoints.capacityMeshNodeId,traceThickness:this.traceThickness,viaDiameter:this.viaDiameter,route:i,vias:s},l=new Set,h=new Set,d=new Set;for(let u=1;u<i.length;u++){let _=i[u-1],p=i[u];_.z===p.z&&(this.capsule(_,p,0.00001,(m)=>d.add(this.layers.indexOf(_.z)*this.plane+m)),this.capsule(_,p,this.traceThickness+this.traceMargin,(m)=>l.add(this.layers.indexOf(_.z)*this.plane+m)),this.capsule(_,p,(this.traceThickness+this.viaDiameter)/2+this.traceMargin,(m)=>h.add(m)))}for(let u of s)this.capsule(u,u,(this.viaDiameter+this.traceThickness)/2+this.traceMargin,(_)=>{for(let p=0;p<this.layers.length;p++)l.add(p*this.plane+_)}),this.capsule(u,u,this.viaDiameter+this.traceMargin,(_)=>h.add(_));this.routes.has(t)&&this.rerouteCount++,this.routes.set(t,{output:c,clearanceOutput:{...c,traceThickness:c.traceThickness+this.traceMargin,viaDiameter:c.viaDiameter+this.traceMargin},traceFootprint:[...l],traceFootprintSet:l,viaFootprint:[...h],viaFootprintSet:h,cells:[...d],viaCells:a}),this.routedCount=this.routes.size,this.activeConnectionIndex=-1}getPair(e,t){let n=this.pairCache.get(e);n||(n=new WeakMap,this.pairCache.set(e,n));let o=n.get(t);return o||(o={cells:[...e.cells.filter((r)=>t.traceFootprintSet.has(r)),...t.cells.filter((r)=>e.traceFootprintSet.has(r))],vias:[...e.viaCells.filter((r)=>t.viaFootprintSet.has(r)),...t.viaCells.filter((r)=>e.viaFootprintSet.has(r))],violations:r_r([e.clearanceOutput,t.clearanceOutput])},n.set(t,o)),o}negotiate(){this.round++;let e=new Set,t=new Set,n=new Set;for(let[s,a]of this.routes)for(let[c,l]of this.routes){if(c<=s||this.connections[s].root===this.connections[c].root)continue;let h=this.getPair(a,l);if(h.cells.length||h.vias.length){e.add(s),e.add(c);for(let d of h.cells)t.add(d);for(let d of h.vias)n.add(d)}}let o=[...this.routes.entries()].sort(([s],[a])=>s-a),r=new Map;for(let[,s]of o)for(let a of s.output.route)r.has(a.z)||r.set(a.z,[]);let i=[];for(let s=0;s<o.length;s++)for(let a=s+1;a<o.length;a++){let[c,l]=o[s],[h,d]=o[a];if(this.connections[c].root!==this.connections[h].root)for(let u of this.getPair(l,d).violations)u.requiredDistance===0?r.get(u.z).push(u):i.push(u)}this.violations=[...r.values()].flat().concat(i);for(let s of this.violations){for(let a=0;a<this.connections.length;a++)[s.trace1,s.trace2].includes(this.connections[a].start.connectionName)&&e.add(a);for(let a of[s.point,s.point2])if(a){let c=this.index({...a,z:this.layers[0]})%this.plane;n.add(c),s.z!==null&&t.add(this.layers.indexOf(s.z)*this.plane+c)}}if(this.conflictCount=e.size,this.stagnantRounds=this.conflictCount<this.bestConflictCount?0:this.stagnantRounds+1,this.bestConflictCount=Math.min(this.bestConflictCount,this.conflictCount),this.stats={round:this.round,conflictedRoutes:this.conflictCount,geometryViolations:this.violations.length,reroutes:this.rerouteCount,searchExpansions:this.routingIterations},!this.violations.length&&this.routes.size===this.connections.length)return this.solved=!0,this.stats.conflictedRoutes=0,this.conflictCount=0,this.bestConflictCount=0,void(this.phase="complete");if(this.round>=(this.props.maxRounds??200))return this.failed=!0,void(this.error=`Negotiation exhausted ${this.round} rounds (${this.conflictCount} conflicted routes)`);for(let s of t)this.history[s]+=0.15;for(let s of n)this.viaHistory[s]+=0.15;this.presentCost=Math.min(20,1.08*this.presentCost),this.stagnantRounds>=8?(this.queue=this.shuffle(this.connections.map((s,a)=>a)),this.presentCost=Math.max(0.5,this.presentCost/2),this.stagnantRounds=0,this.broadNegotiations++):this.queue=this.shuffle([...e]),this.phase="routing"}getOutput(){return[...this.routes.entries()].sort(([e],[t])=>e-t).map(([,e])=>e.output)}visualize(){let e=this.nodeWithPortPoints,t={title:`A13 negotiated congestion · round ${this.round} · ${this.conflictCount} conflicted routes`,rects:[{center:e.center,width:e.width,height:e.height,stroke:"#475569",fill:"transparent"}],points:e.portPoints.map((n)=>({...n,color:n.z===0?"red":"blue",layer:`z${n.z}`,label:n.connectionName})),lines:[],circles:[]};for(let n of this.getOutput()){for(let o=1;o<n.route.length;o++){let r=n.route[o-1],i=n.route[o];r.z===i.z&&t.lines.push({points:[r,i],strokeColor:r.z===0?"#ef4444":"#3b82f6",strokeWidth:this.traceThickness,layer:`z${r.z}`})}for(let o of n.vias)t.circles.push({center:o,radius:this.viaDiameter/2,fill:"#cbd5e1",stroke:"#334155",layer:`z${this.layers.join(",")}`})}for(let n of this.violations.slice(0,50))n.point&&t.circles.push({center:n.point,radius:0.2,stroke:"#f59e0b",fill:"transparent"});return t}},oWe=(e)=>({minX:Math.min(e[0].x,e[1].x),maxX:Math.max(e[0].x,e[1].x),minY:Math.min(e[0].y,e[1].y),maxY:Math.max(e[0].y,e[1].y)});function oCe(e,t){let n=e.x-t.x,o=e.y-t.y;return n*n+o*o}function p$(e,t,n){let o=oCe(t,n);if(o===0)return oCe(e,t);let r=((e.x-t.x)*(n.x-t.x)+(e.y-t.y)*(n.y-t.y))/o;return r=Math.max(0,Math.min(1,r)),oCe(e,{x:t.x+r*(n.x-t.x),y:t.y+r*(n.y-t.y)})}function i_r(e,t,n,o){if(su(e,t,n,o))return 0;let r={x:e.x,y:e.y},i={x:t.x,y:t.y},s={x:n.x,y:n.y},a={x:o.x,y:o.y};return Math.min(p$(r,s,a),p$(i,s,a),p$(s,r,i),p$(a,r,i))}var CCe=class{segmentBuckets;viaBuckets;CELL_SIZE;maximumCopperRadius=0;constructor(e,t=1){this.segmentBuckets=new Map,this.viaBuckets=new Map,this.CELL_SIZE=t;for(let n of e)if(n&&n.connectionName){if(this.maximumCopperRadius=Math.max(this.maximumCopperRadius,n.traceThickness/2,n.viaDiameter/2),n.route&&n.route.length>=2)for(let o=0;o<n.route.length-1;o++){let r=n.route[o],i=n.route[o+1];if(r.x===i.x&&r.y===i.y)continue;if(r.insideJumperPad&&i.insideJumperPad)continue;let s=[r,i],a=oWe(s),c={segmentId:`${n.connectionName}-seg-${o}`,segment:s,parentRoute:n},l=Math.floor(a.minX/this.CELL_SIZE),h=Math.floor((a.maxX+0.000000001)/this.CELL_SIZE),d=Math.floor(a.minY/this.CELL_SIZE),u=Math.floor((a.maxY+0.000000001)/this.CELL_SIZE);for(let _=l;_<=h;_++)for(let p=d;p<=u;p++){let m=`${_}x${p}`,A=this.segmentBuckets.get(m);A||(A=[],this.segmentBuckets.set(m,A)),A.push(c)}}if(n.vias&&n.vias.length>0)for(let o=0;o<n.vias.length;o++){let r=n.vias[o];if(r==null)continue;let i={viaId:`${n.connectionName}-via-${o}`,x:r.x,y:r.y,parentRoute:n},s=`${Math.floor(r.x/this.CELL_SIZE)}x${Math.floor(r.y/this.CELL_SIZE)}`,a=this.viaBuckets.get(s);a||(a=[],this.viaBuckets.set(s,a)),a.push(i)}}else console.warn("Skipping route with missing data:",n)}getConflictingRoutesForSegment(e,t,n){let o=oWe([e,t]),r=n+this.maximumCopperRadius,i=o.minX-r,s=o.minY-r,a=o.maxX+r,c=o.maxY+r,l=Math.floor(i/this.CELL_SIZE),h=Math.floor((a+0.000000001)/this.CELL_SIZE),d=Math.floor(s/this.CELL_SIZE),u=Math.floor((c+0.000000001)/this.CELL_SIZE),_=new Map,p=new Set,m=new Set,A={x:e.x,y:e.y},g={x:t.x,y:t.y};for(let y=l;y<=h;y++)for(let x=d;x<=u;x++){let C=`${y}x${x}`,b=this.segmentBuckets.get(C);if(b)for(let v of b){if(p.has(v.segmentId))continue;p.add(v.segmentId);let P=v.parentRoute,[M,B]=v.segment;if(e.z!==t.z||M.z!==B.z||M.z!==e.z)continue;let T=n+P.traceThickness/2,N=T*T,D=i_r(e,t,M,B);if(D<N){let L=P.connectionName,H=_.get(L);(!H||D<H.minDistSq)&&_.set(L,{route:P,minDistSq:D})}}let I=this.viaBuckets.get(C);if(I)for(let v of I){if(m.has(v.viaId))continue;m.add(v.viaId);let P=v.parentRoute,M={x:v.x,y:v.y},B=n+P.viaDiameter/2,T=B*B,N=p$(M,A,g);if(N<T){let D=P.connectionName,L=_.get(D);(!L||N<L.minDistSq)&&_.set(D,{route:P,minDistSq:N})}}}let f=[];for(let y of _.values())f.push({conflictingRoute:y.route,distance:Math.sqrt(y.minDistSq)});return f}removeRoute(e){for(let[t,n]of this.segmentBuckets){let o=n.filter((r)=>r.parentRoute.connectionName!==e);o.length===0?this.segmentBuckets.delete(t):o.length!==n.length&&this.segmentBuckets.set(t,o)}for(let[t,n]of this.viaBuckets){let o=n.filter((r)=>r.parentRoute.connectionName!==e);o.length===0?this.viaBuckets.delete(t):o.length!==n.length&&this.viaBuckets.set(t,o)}}addRoute(e){if(!e||!e.connectionName)return void console.warn("Skipping route with missing data:",e);if(this.maximumCopperRadius=Math.max(this.maximumCopperRadius,e.traceThickness/2,e.viaDiameter/2),e.route&&e.route.length>=2)for(let t=0;t<e.route.length-1;t++){let n=e.route[t],o=e.route[t+1];if(n.x===o.x&&n.y===o.y)continue;if(n.insideJumperPad&&o.insideJumperPad)continue;let r=[n,o],i=oWe(r),s={segmentId:`${e.connectionName}-seg-${t}`,segment:r,parentRoute:e},a=Math.floor(i.minX/this.CELL_SIZE),c=Math.floor((i.maxX+0.000000001)/this.CELL_SIZE),l=Math.floor(i.minY/this.CELL_SIZE),h=Math.floor((i.maxY+0.000000001)/this.CELL_SIZE);for(let d=a;d<=c;d++)for(let u=l;u<=h;u++){let _=`${d}x${u}`,p=this.segmentBuckets.get(_);p||(p=[],this.segmentBuckets.set(_,p)),p.push(s)}}if(e.vias&&e.vias.length>0)for(let t=0;t<e.vias.length;t++){let n=e.vias[t];if(n==null)continue;let o={viaId:`${e.connectionName}-via-${t}`,x:n.x,y:n.y,parentRoute:e},r=`${Math.floor(n.x/this.CELL_SIZE)}x${Math.floor(n.y/this.CELL_SIZE)}`,i=this.viaBuckets.get(r);i||(i=[],this.viaBuckets.set(r,i)),i.push(o)}}getConflictingRoutesNearPoint(e,t){let n=t+this.maximumCopperRadius,o=e.x-n,r=e.y-n,i=e.x+n,s=e.y+n,a=Math.floor(o/this.CELL_SIZE),c=Math.floor((i+0.000000001)/this.CELL_SIZE),l=Math.floor(r/this.CELL_SIZE),h=Math.floor((s+0.000000001)/this.CELL_SIZE),d=new Map,u=new Set,_=new Set;for(let m=a;m<=c;m++)for(let A=l;A<=h;A++){let g=`${m}x${A}`,f=this.segmentBuckets.get(g);if(f)for(let x of f){if(u.has(x.segmentId))continue;u.add(x.segmentId);let C=x.segment[0],b=x.segment[1];if(C.z!==b.z||C.z!==e.z)continue;let I=x.parentRoute,v={x:x.segment[0].x,y:x.segment[0].y},P={x:x.segment[1].x,y:x.segment[1].y},M=t+I.traceThickness/2,B=M*M,T=p$(e,v,P);if(T<B){let N=I.connectionName,D=d.get(N);(!D||T<D.minDistSq)&&d.set(N,{route:I,minDistSq:T})}}let y=this.viaBuckets.get(g);if(y)for(let x of y){if(_.has(x.viaId))continue;_.add(x.viaId);let C=x.parentRoute,b={x:x.x,y:x.y},I=t+C.viaDiameter/2,v=I*I,P=oCe(e,b);if(P<v){let M=C.connectionName,B=d.get(M);(!B||P<B.minDistSq)&&d.set(M,{route:C,minDistSq:P})}}}let p=[];for(let m of d.values())p.push({conflictingRoute:m.route,distance:Math.sqrt(m.minDistSq)});return p}};function C$e(e){let t=e;for(let r=0;r<10;r++)t=16807*t%2147483647;let n=t;t=(69069*e+1)%2147483647;for(let r=0;r<10;r++)t=48271*t%2147483647;let o=t;return()=>{let r=n;n=o,r^=r<<23,r^=r>>>17,r^=o,r^=o>>>26,o=r;let i=(n+o)/4294967296;return i-Math.floor(i)}}var s_r={1:[[0]],2:[[0,1],[1,0]],3:[[0,1,2],[2,0,1],[1,0,2],[0,2,1],[1,2,0],[2,1,0]],4:[[0,1,2,3],[2,0,1,3],[1,3,2,0],[3,0,1,2],[0,2,1,3],[2,1,3,0],[3,0,2,1],[1,2,0,3],[3,1,0,2],[0,3,2,1],[2,3,0,1],[2,3,1,0],[1,2,3,0],[3,1,2,0],[0,1,3,2],[0,2,3,1],[0,3,1,2],[1,0,2,3],[1,0,3,2],[1,3,0,2],[2,0,3,1],[2,1,0,3],[3,2,0,1],[3,2,1,0]]};function db(e,t){if(t===0)return e;if(e.length===0)return e;if(e.length<=4){let r=s_r[e.length];return r[t%r.length].map((i)=>e[i])}let n=C$e(t),o=e.slice();for(let r=0;r<o.length;r++){let i=Math.floor(n()*o.length),s=Math.floor(n()*(r+1));[o[i],o[s]]=[o[s],o[i]]}return o}var a_r=class{heap=[];constructor(e){this.heap=[];for(let t of e)this.enqueue(t)}dequeue(){if(this.heap.length===0)return null;let e=this.heap[0];return this.heap[0]=this.heap[this.heap.length-1],this.heap.pop(),this.heapifyDown(),e}peek(){return this.heap.length===0?null:this.heap[0]}enqueue(e){this.heap.push(e),this.heapifyUp()}heapifyUp(){let e=this.heap.length-1,t=this.heap[e];for(;e>0;){let n=Math.floor((e-1)/2),o=this.heap[n];if(o.f<=t.f)break;this.heap[e]=o,e=n}this.heap[e]=t}heapifyDown(){let e=0,t=this.heap.length,n=this.heap[e];if(n){for(;;){let o=2*e+1;if(o>=t)break;let r=o+1,i=o;if(r<t&&this.heap[r].f<this.heap[o].f&&(i=r),n.f<this.heap[i].f)break;this.heap[e]=this.heap[i],e=i}this.heap[e]=n}}getTopN(e){return[...this.heap].sort((t,n)=>t.f-n.f).slice(0,e)}},HK=(e,t,n=[])=>[e,t?`rootConnectionName: ${t}`:void 0,...n].filter(Boolean).join(`
`),c_r=class extends Kr{getSolverName(){return"SingleHighDensityRouteSolver"}obstacleRoutes;bounds;boundsSize;boundsCenter;A;B;straightLineDistance;viaDiameter;traceThickness;obstacleMargin;layerCount;availableZ;minCellSize=0.05;cellStep=0.05;GREEDY_MULTIPLER=1.1;numRoutes;VIA_PENALTY_FACTOR=0.3;CELL_SIZE_FACTOR;NEARBY_SEGMENT_CLEARANCE;exploredNodes;viasInPathByNode=new WeakMap;gridMinXIndex;gridMinYIndex;gridWidth;gridHeight;candidates;connectionName;rootConnectionName;regionId;solvedPath=null;futureConnections;hyperParameters;connMap;obstacleSegments=[];obstacleSegmentIndex=null;obstacleSegmentsByLayer=new Map;obstacleSegmentIndexByLayer=new Map;obstacleVias=[];obstacleViaIndex=null;freePlanarObstaclePoints=new Map;cachedPlanarTraceProximity;cachedPlanarViaProximity;debug_exploredNodesOrdered;debug_nodesTooCloseToObstacle;debug_nodePathToParentIntersectsObstacle;debugEnabled;initialNodeGridOffset;constructor(e){super(),this.bounds=e.bounds,this.connMap=e.connMap,this.hyperParameters=e.hyperParameters??{},this.CELL_SIZE_FACTOR=this.hyperParameters.CELL_SIZE_FACTOR??1,this.boundsSize={width:this.bounds.maxX-this.bounds.minX,height:this.bounds.maxY-this.bounds.minY},this.boundsCenter={x:(this.bounds.minX+this.bounds.maxX)/2,y:(this.bounds.minY+this.bounds.maxY)/2},this.connectionName=e.connectionName,this.rootConnectionName=e.rootConnectionName,this.regionId=e.regionId,this.obstacleRoutes=e.obstacleRoutes,this.A=e.A,this.B=e.B,this.viaDiameter=e.viaDiameter??0.3,this.traceThickness=e.traceThickness??0.15,this.obstacleMargin=e.obstacleMargin??0.15,this.layerCount=e.layerCount??2,this.availableZ=e.availableZ&&e.availableZ.length>0?[...new Set(e.availableZ)].sort((d,u)=>d-u):Array.from({length:this.layerCount},(d,u)=>u),this.exploredNodes=new Set,this.straightLineDistance=Dn(this.A,this.B),this.futureConnections=e.futureConnections??[],this.NEARBY_SEGMENT_CLEARANCE=e.nearbySegmentClearance??0.15,this.debugEnabled=e.captureSearchDebug??!0,this.MAX_ITERATIONS=1e4,this.debug_exploredNodesOrdered=[],this.debug_nodesTooCloseToObstacle=new Set,this.debug_nodePathToParentIntersectsObstacle=new Set,this.numRoutes=this.obstacleRoutes.length+this.futureConnections.length,this.buildObstacleIndexes();let t=Math.ceil(5*(this.numRoutes+1)),n=this.boundsSize.width/this.cellStep,o=this.boundsSize.height/this.cellStep;for(;n*o>t**2&&!(2*this.cellStep>e.minDistBetweenEnteringPoints);)this.cellStep*=2,n=this.boundsSize.width/this.cellStep,o=this.boundsSize.height/this.cellStep;this.cellStep*=this.CELL_SIZE_FACTOR,this.gridMinXIndex=Math.round(this.bounds.minX/this.cellStep)-1,this.gridMinYIndex=Math.round(this.bounds.minY/this.cellStep)-1;let r=Math.round(this.bounds.maxX/this.cellStep)+1,i=Math.round(this.bounds.maxY/this.cellStep)+1;this.gridWidth=r-this.gridMinXIndex+1,this.gridHeight=i-this.gridMinYIndex+1;let s=Math.abs(this.A.x-this.bounds.minX)<0.001&&Math.abs(this.B.x-this.bounds.minX)<0.001||Math.abs(this.A.x-this.bounds.maxX)<0.001&&Math.abs(this.B.x-this.bounds.maxX)<0.001||Math.abs(this.A.y-this.bounds.minY)<0.001&&Math.abs(this.B.y-this.bounds.minY)<0.001||Math.abs(this.A.y-this.bounds.maxY)<0.001&&Math.abs(this.B.y-this.bounds.maxY)<0.001;this.futureConnections&&this.futureConnections.length===0&&this.obstacleRoutes.length===0&&!s&&this.handleSimpleCases();let a={x:Math.round(e.A.x/(this.cellStep/2))*(this.cellStep/2),y:Math.round(e.A.y/(this.cellStep/2))*(this.cellStep/2)};this.initialNodeGridOffset={x:a.x-Math.round(e.A.x/this.cellStep)*this.cellStep,y:a.y-Math.round(e.A.y/this.cellStep)*this.cellStep};let c={...e.A,z:e.A.z??0,g:0,h:0,f:0,parent:null},l={...e.A,...a,z:e.A.z??0,g:0,h:0,f:0,parent:c},h=(Math.abs(l.x-e.A.x)>0.000000001||Math.abs(l.y-e.A.y)>0.000000001)&&(this.isNodeTooCloseToObstacle(l)||this.isNodeTooCloseToEdge(l,!1)||this.doesPathToParentIntersectObstacle(l));this.candidates=new a_r([h?c:l])}handleSimpleCases(){this.solved=!0;let{A:e,B:t}=this,n=e.z===t.z?[e,t]:[e,{...this.boundsCenter,z:this.A.z},{...this.boundsCenter,z:t.z},t];this.solvedPath={connectionName:this.connectionName,rootConnectionName:this.rootConnectionName,regionId:this.regionId,route:n,traceThickness:this.traceThickness,viaDiameter:this.viaDiameter,vias:this.A.z===this.B.z?[]:[this.boundsCenter]}}get viaPenaltyDistance(){return this.cellStep+this.straightLineDistance*this.VIA_PENALTY_FACTOR}isNodeTooCloseToObstacle(e,t,n,o){if(t??=this.obstacleMargin,n&&e.parent){let h=this.getViasInNodePath(e.parent);for(let d of h)if(Dn(e,d)<this.viaDiameter/2+t)return!0}let r=this.traceThickness+t,i=this.viaDiameter/2+this.traceThickness/2+t,s=!n&&this.gridWidth!==void 0&&(!o||o.pointQueryProximity===r)&&(this.obstacleViaIndex!==null||this.obstacleSegmentIndexByLayer.has(e.z))?o?.pointKey??this.getNodeKey(e):void 0;if(s!==void 0){this.cachedPlanarTraceProximity===r&&this.cachedPlanarViaProximity===i||(this.freePlanarObstaclePoints.clear(),this.cachedPlanarTraceProximity=r,this.cachedPlanarViaProximity=i);let h=this.freePlanarObstaclePoints.get(s);if(h&&h.x===e.x&&h.y===e.y&&h.z===e.z)return!1}let a=o?.segments??(n?this.obstacleSegments:this.obstacleSegmentsByLayer.get(e.z)),c=o?.segmentIds??(n?this.obstacleSegmentIndex:this.obstacleSegmentIndexByLayer.get(e.z))?.search(e.x-r,e.y-r,e.x+r,e.y+r)??[],l=o?.segmentBounds;if(a)for(let h of c){let d=a[h];if(d&&!d.connectedToCurrentConnection&&((n||d.z===e.z)&&!(l&&(l.maxX<d.minX||l.maxY<d.minY||l.minX>d.maxX||l.minY>d.maxY)||o&&(e.x+r<d.minX||e.y+r<d.minY||e.x-r>d.maxX||e.y-r>d.maxY)||!(Math.sqrt(Uae(e,d.A,d.deltaX,d.deltaY,d.lengthSquared))<r))))return!0}if(this.obstacleViaIndex){let h=this.obstacleViaIndex.search(e.x-i,e.y-i,e.x+i,e.y+i);for(let d of h){let u=this.obstacleVias[d];if(u&&Dn(e,u)<i)return!0}}return s!==void 0&&this.freePlanarObstaclePoints.set(s,{x:e.x,y:e.y,z:e.z}),!1}isNodeTooCloseToEdge(e,t){let n=t?this.viaDiameter/2+this.obstacleMargin/2:this.obstacleMargin/2,o=e.x<this.bounds.minX+n||e.x>this.bounds.maxX-n||e.y<this.bounds.minY+n||e.y>this.bounds.maxY-n;return!(o&&!t&&(Dn(e,this.B)<2*n||Dn(e,this.A)<2*n))&&o}doesPathToParentIntersectObstacle(e,t){let n=e.parent;if(!n)return!1;let o=t?.segments??this.obstacleSegmentsByLayer.get(e.z);if(!o)return!1;let r=e.z===n.z&&this.obstacleSegments.length>0?this.NEARBY_SEGMENT_CLEARANCE:0,i=Math.min(e.x,n.x),s=Math.max(e.x,n.x),a=Math.min(e.y,n.y),c=Math.max(e.y,n.y),l=t?.segmentIds??this.obstacleSegmentIndexByLayer.get(e.z)?.search(i-r,a-r,s+r,c+r)??[],h=t?.segmentBounds,d=n.x-e.x,u=n.y-e.y,_=d**2+u**2;for(let p of l){let m=o[p];if(m&&!m.connectedToCurrentConnection&&(m.z===e.z&&!(h&&(h.maxX<m.minX||h.maxY<m.minY||h.minX>m.maxX||h.minY>m.maxY)||t&&(s+r<m.minX||c+r<m.minY||i-r>m.maxX||a-r>m.maxY)))){if(su(e,n,m.A,m.B))return!0;if(r>0&&h_r(e,n,d,u,_,m)<r)return!0}}return!1}getPlanarObstacleQuery(e,t,n){let o=e.parent;if(!o)return;let r=t?void 0:this.obstacleSegmentIndexByLayer.get(e.z),i=t?.segments??this.obstacleSegmentsByLayer.get(e.z);if(!i||!t&&!r)return;let s=this.traceThickness+this.obstacleMargin,a=e.z===o.z&&this.obstacleSegments.length>0?this.NEARBY_SEGMENT_CLEARANCE:0,c=Math.min(e.x-s,o.x-a),l=Math.min(e.y-s,o.y-a),h=Math.max(e.x+s,o.x+a),d=Math.max(e.y+s,o.y+a);if(t){let u=t.segmentBounds??={minX:c,minY:l,maxX:h,maxY:d};return u.minX=c,u.minY=l,u.maxX=h,u.maxY=d,t.pointQueryProximity=s,t.pointKey=n,t}return{segments:i,segmentIds:r.search(c,l,h,d),pointQueryProximity:s,pointKey:n}}getPlanarNeighborObstacleQuery(e){let t=this.obstacleSegmentIndexByLayer.get(e.z),n=this.obstacleSegmentsByLayer.get(e.z);if(!t||!n)return;let o=this.traceThickness+this.obstacleMargin,r=this.obstacleSegments.length>0?this.NEARBY_SEGMENT_CLEARANCE:0,{minX:i,minY:s,maxX:a,maxY:c}=this.bounds,l=FK(e.x-this.cellStep,i,a),h=FK(e.y-this.cellStep,s,c),d=FK(e.x+this.cellStep,i,a),u=FK(e.y+this.cellStep,s,c);return{segments:n,segmentIds:t.search(Math.min(l-o,e.x-r),Math.min(h-o,e.y-r),Math.max(d+o,e.x+r),Math.max(u+o,e.y+r))}}buildObstacleIndexes(){if(this.freePlanarObstaclePoints.clear(),this.obstacleRoutes.length===0)return this.obstacleSegmentIndex=null,this.obstacleSegmentsByLayer.clear(),this.obstacleSegmentIndexByLayer.clear(),void(this.obstacleViaIndex=null);let e=[],t=[];for(let n of this.obstacleRoutes){let o=this.connMap?.areIdsConnected?.(this.connectionName,n.connectionName)??!1;for(let r of l_r(n)){let i=r.B.x-r.A.x,s=r.B.y-r.A.y;e.push({...r,deltaX:i,deltaY:s,lengthSquared:i**2+s**2,minX:Math.min(r.A.x,r.B.x),minY:Math.min(r.A.y,r.B.y),maxX:Math.max(r.A.x,r.B.x),maxY:Math.max(r.A.y,r.B.y),connectedToCurrentConnection:o})}for(let r of n.vias)t.push(r)}if(this.obstacleSegments=e,this.obstacleVias=t,this.obstacleSegmentsByLayer.clear(),this.obstacleSegmentIndexByLayer.clear(),e.length>0){let n=new i_(e.length);for(let o of e)n.add(o.minX,o.minY,o.maxX,o.maxY);n.finish(),this.obstacleSegmentIndex=n;for(let o of e){if(o.connectedToCurrentConnection)continue;let r=this.obstacleSegmentsByLayer.get(o.z);r?r.push(o):this.obstacleSegmentsByLayer.set(o.z,[o])}for(let[o,r]of this.obstacleSegmentsByLayer){let i=new i_(r.length);for(let s of r)i.add(s.minX,s.minY,s.maxX,s.maxY);i.finish(),this.obstacleSegmentIndexByLayer.set(o,i)}}else this.obstacleSegmentIndex=null;if(t.length>0){let n=new i_(t.length);for(let o of t)n.add(o.x,o.y,o.x,o.y);n.finish(),this.obstacleViaIndex=n}else this.obstacleViaIndex=null}computeH(e){return Dn(e,this.B)+(e.z!==this.B.z?this.viaPenaltyDistance:0)}computeG(e){return(e.parent?.g??0)+(e.z===e.parent?.z?0:this.viaPenaltyDistance)+Dn(e,e.parent)}computeF(e,t){return e+t*this.GREEDY_MULTIPLER}setNodeCosts(e){e.g=this.computeG(e),e.h=this.computeH(e),e.f=this.computeF(e.g,e.h)}getNodeKey(e){let t=Math.round(e.x/this.cellStep)-this.gridMinXIndex,n=Math.round(e.y/this.cellStep)-this.gridMinYIndex;return(e.z*this.gridHeight+n)*this.gridWidth+t}getNeighbors(e){let t=[],n,o=!1,{maxX:r,minX:i,maxY:s,minY:a}=this.bounds;for(let c=-1;c<=1;c++)for(let l=-1;l<=1;l++){if(c===0&&l===0)continue;let h={x:FK(e.x+c*this.cellStep,i,r),y:FK(e.y+l*this.cellStep,a,s),z:e.z,g:e.g,h:e.h,f:e.f,parent:e},d=this.getNodeKey(h);if(this.exploredNodes.has(d))continue;o||(n=this.getPlanarNeighborObstacleQuery(e),o=!0);let u=this.getPlanarObstacleQuery(h,n,d);this.isNodeTooCloseToObstacle(h,void 0,!1,u)?(this.debugEnabled&&this.debug_nodesTooCloseToObstacle.add(d),this.exploredNodes.add(d)):this.isNodeTooCloseToEdge(h,!1)?this.exploredNodes.add(d):this.doesPathToParentIntersectObstacle(h,u)?(this.debugEnabled&&this.debug_nodePathToParentIntersectsObstacle.add(d),this.exploredNodes.add(d)):(this.setNodeCosts(h),t.push(h))}for(let c of this.availableZ){if(c===e.z)continue;let l={x:e.x,y:e.y,z:c,g:e.g,h:e.h,f:e.f,parent:e};this.exploredNodes.has(this.getNodeKey(l))||this.isNodeTooCloseToObstacle(l,this.viaDiameter/2+this.obstacleMargin/2,!0)||this.isNodeTooCloseToEdge(l,!0)||(this.setNodeCosts(l),t.push(l))}return t}getNodePath(e){let t=[];for(;e;)t.push(e),e=e.parent;return t}getViasInNodePath(e){let t=this.viasInPathByNode.get(e);if(t)return t;let n=e.parent,o=n?this.getViasInNodePath(n):[],r=n&&e.z!==n.z?[{x:e.x,y:e.y},...o]:o;return this.viasInPathByNode.set(e,r),r}setSolvedPath(e){let t=this.getNodePath(e);t.reverse();let n=[];for(let o=0;o<t.length-1;o++)t[o].z!==t[o+1].z&&n.push({x:t[o].x,y:t[o].y});this.solvedPath={connectionName:this.connectionName,rootConnectionName:this.rootConnectionName,regionId:this.regionId,traceThickness:this.traceThickness,viaDiameter:this.viaDiameter,route:t.map((o)=>({x:o.x,y:o.y,z:o.z})).concat([this.B]),vias:n}}computeProgress(e,t,n){if(t===void 0||n===void 0)return Number.NaN;n||(t+=this.viaPenaltyDistance);let o=1-t/this.straightLineDistance;return Math.max(this.progress||0,2/Math.PI*Math.atan(0.112*o/(1-o)))}_step(){let e=this.candidates.dequeue(),t=e?this.getNodeKey(e):void 0;for(;e&&t&&this.exploredNodes.has(t);)e=this.candidates.dequeue(),t=e?this.getNodeKey(e):void 0;if(!e||!t)return this.failed=!0,void(this.error="Ran out of candidate nodes to explore");this.exploredNodes.add(t),this.debugEnabled&&this.debug_exploredNodesOrdered.push({key:t,x:Math.round(e.x/this.cellStep)*this.cellStep+this.initialNodeGridOffset.x,y:Math.round(e.y/this.cellStep)*this.cellStep+this.initialNodeGridOffset.y,z:e.z});let n=Dn(e,this.B);this.progress=this.computeProgress(e,n,e.z===this.B.z),n<=this.cellStep*Math.SQRT2&&e.z===this.B.z&&!this.doesPathToParentIntersectObstacle({...e,parent:e,x:this.B.x,y:this.B.y})&&(this.solved=!0,this.setSolvedPath(e));let o=this.getNeighbors(e);for(let r of o)this.candidates.enqueue(r)}visualize(){let e={lines:[],points:[],rects:[],circles:[]};e.points.push({x:this.A.x,y:this.A.y,label:HK(this.connectionName,this.rootConnectionName,["Input A",`z: ${this.A.z}`]),color:"orange"}),e.points.push({x:this.B.x,y:this.B.y,label:HK(this.connectionName,this.rootConnectionName,["Input B",`z: ${this.B.z}`]),color:"orange"}),e.lines.push({points:[this.A,this.B],strokeColor:"rgba(255, 0, 0, 0.5)",label:HK(this.connectionName,this.rootConnectionName,["Direct Input Connection"])});for(let t=0;t<this.obstacleRoutes.length;t++){let n=this.obstacleRoutes[t];for(let o=0;o<n.route.length-1;o++){let r=n.route[o].z;e.lines.push({points:[n.route[o],n.route[o+1]],strokeColor:r===0?"rgba(255, 0, 0, 0.75)":"rgba(255, 128, 0, 0.25)",strokeWidth:n.traceThickness,label:HK(n.connectionName,n.rootConnectionName,["Obstacle Route"]),layer:`obstacle${t.toString()}`})}}for(let t=0;t<this.debug_exploredNodesOrdered.length;t++){let{key:n,x:o,y:r,z:i}=this.debug_exploredNodesOrdered[t];this.debug_nodesTooCloseToObstacle.has(n)||(this.debug_nodePathToParentIntersectsObstacle.has(n)||e.rects.push({center:{x:o+i*this.cellStep/20,y:r+i*this.cellStep/20},fill:i===0?`rgba(255,0,255,${0.3-t/this.debug_exploredNodesOrdered.length*0.2})`:`rgba(0,0,255,${0.3-t/this.debug_exploredNodesOrdered.length*0.2})`,width:0.9*this.cellStep,height:0.9*this.cellStep,label:`Explored (z=${i})`}))}if(this.candidates.peek()){let t=this.candidates.peek();e.rects.push({center:{x:t.x+t.z*this.cellStep/20,y:t.y+t.z*this.cellStep/20},fill:"rgba(0, 255, 0, 0.8)",width:0.9*this.cellStep,height:0.9*this.cellStep,label:`Next (z=${t.z})`})}for(let t of this.obstacleRoutes)for(let n of t.vias)e.circles.push({center:{x:n.x,y:n.y},radius:this.viaDiameter/2,fill:"rgba(255, 0, 0, 0.5)",label:"Via"});if(this.solvedPath){e.lines.push({points:this.solvedPath.route,strokeColor:"green",label:HK(this.solvedPath.connectionName,this.solvedPath.rootConnectionName,["Solved Route"])});for(let t of this.solvedPath.vias)e.circles.push({center:t,radius:this.viaDiameter/2,fill:"green",label:HK(this.solvedPath.connectionName,this.solvedPath.rootConnectionName,["Via"])})}return e}};function l_r(e){let t=[];for(let n=0;n<e.route.length-1;n++)e.route[n].z===e.route[n+1].z&&t.push({z:e.route[n].z,A:e.route[n],B:e.route[n+1]});return t}function FK(e,t,n){return Math.max(t,Math.min(e,n))}function h_r(e,t,n,o,r,i){return Math.sqrt(Math.min(Uae(e,i.A,i.deltaX,i.deltaY,i.lengthSquared),Uae(t,i.A,i.deltaX,i.deltaY,i.lengthSquared),Uae(i.A,e,n,o,r),Uae(i.B,e,n,o,r)))}function Uae(e,t,n,o,r){if(r===0){let h=e.x-t.x,d=e.y-t.y;return h*h+d*d}let i=Math.max(0,Math.min(1,((e.x-t.x)*n+(e.y-t.y)*o)/r)),s=t.x+i*n,a=t.y+i*o,c=e.x-s,l=e.y-a;return c*c+l*l}var kFt=class extends c_r{FUTURE_CONNECTION_PROX_TRACE_PENALTY_FACTOR=2;FUTURE_CONNECTION_PROX_VIA_PENALTY_FACTOR=1;FUTURE_CONNECTION_PROXIMITY_VD=10;MISALIGNED_DIST_PENALTY_FACTOR=5;VIA_PENALTY_FACTOR_2=1;FLIP_TRACE_ALIGNMENT_DIRECTION=!1;FUTURE_CONNECTION_VIA_TRACE_CLEARANCE=0.1;futureConnectionPoints;futureConnectionSegmentsCache=null;closestFuturePointCacheCoordinates=new Float64Array(1024);closestFuturePointCacheIndices=new Int32Array(256).fill(-2);cachedFutureConnectionPoints;cachedFutureConnectionPointCount=0;constructor(e){super({...e,nearbySegmentClearance:e.nearbySegmentClearance??(e.traceThickness??0.15)/2+(e.obstacleMargin??0.15)});for(let o in e.hyperParameters)this[o]=e.hyperParameters[o];let t=this.boundsSize.width/this.viaDiameter,n=Math.max(1,this.numRoutes);this.VIA_PENALTY_FACTOR=t/n*0.3*this.VIA_PENALTY_FACTOR_2,this.futureConnectionPoints=this.futureConnections.flatMap((o)=>o.points)}getClosestFutureConnectionPoint(e){this.cachedFutureConnectionPoints===this.futureConnectionPoints&&this.cachedFutureConnectionPointCount===this.futureConnectionPoints.length||(this.closestFuturePointCacheIndices.fill(-2),this.cachedFutureConnectionPoints=this.futureConnectionPoints,this.cachedFutureConnectionPointCount=this.futureConnectionPoints.length);let t=this.getNodeKey(e),n=Number.isSafeInteger(t)?Math.abs(t%256):-1,o=4*n,r=this.viaPenaltyDistance,i=this.closestFuturePointCacheIndices[n];if(n>=0&&i>=-1&&this.closestFuturePointCacheCoordinates[o]===e.x&&this.closestFuturePointCacheCoordinates[o+1]===e.y&&this.closestFuturePointCacheCoordinates[o+2]===e.z&&this.closestFuturePointCacheCoordinates[o+3]===r)return i===-1?null:this.futureConnectionPoints[i];let s=1/0,a=null,c=-1,l=0;for(let h of this.futureConnectionPoints){let d=Dn(e,h)+(e.z!==h.z?this.viaPenaltyDistance:0);d<s&&(s=d,a=h,c=l),l++}return n>=0&&(this.closestFuturePointCacheCoordinates[o]=e.x,this.closestFuturePointCacheCoordinates[o+1]=e.y,this.closestFuturePointCacheCoordinates[o+2]=e.z,this.closestFuturePointCacheCoordinates[o+3]=r,this.closestFuturePointCacheIndices[n]=c),a}getFutureConnectionSegments(){if(this.futureConnectionSegmentsCache)return this.futureConnectionSegmentsCache;let e=[];for(let t of this.futureConnections){if(t.connectionName===this.connectionName||(this.connMap?.areIdsConnected?.(this.connectionName,t.connectionName)??!1))continue;let[n,...o]=t.points;if(n)for(let r of o)Math.abs(n.x-r.x)<0.000000001&&Math.abs(n.y-r.y)<0.000000001||e.push({connectionName:t.connectionName,start:n,end:r})}return this.futureConnectionSegmentsCache=e,e}isViaTooCloseToFutureConnectionTrace(e){let t=this.viaDiameter/2+this.traceThickness/2+this.FUTURE_CONNECTION_VIA_TRACE_CLEARANCE;for(let n of this.getFutureConnectionSegments())if(oc(e,n.start,n.end)<t)return!0;return!1}isNodeTooCloseToObstacle(e,t,n,o){return!!super.isNodeTooCloseToObstacle(e,t,n,o)||!(!n||!this.isViaTooCloseToFutureConnectionTrace(e))}diminishCloseToGoal(e){let t=Dn(e,this.B);return 1-Math.exp(-t/this.straightLineDistance*5)}getFutureConnectionPenalty(e,t){let n=0,o=this.getClosestFutureConnectionPoint(e),r=Dn(e,this.B);if(o){let i=Dn(e,o);if(r<=i)return 0;let s=i/(this.viaDiameter*this.FUTURE_CONNECTION_PROXIMITY_VD);n=(t?this.straightLineDistance*this.FUTURE_CONNECTION_PROX_VIA_PENALTY_FACTOR:this.straightLineDistance*this.FUTURE_CONNECTION_PROX_TRACE_PENALTY_FACTOR)*Math.exp(5*-s)}return n}computeH(e){let t=Dn(e,this.B)**1.6;return this.straightLineDistance,t+(e.z!==this.B.z?this.viaPenaltyDistance:0)+this.getFutureConnectionPenalty(e,e.z!==e.parent?.z)}computeG(e){let t=Math.abs(e.x-e.parent.x),n=Math.abs(e.y-e.parent.y),o=Math.sqrt(t**2+n**2),r=e.z%2==0,i=this.FLIP_TRACE_ALIGNMENT_DIRECTION?r?t:n:r?n:t;return(e.parent?.g??0)+(e.z===e.parent?.z?0:this.viaPenaltyDistance)+o+i*this.MISALIGNED_DIST_PENALTY_FACTOR+this.getFutureConnectionPenalty(e,e.z!==e.parent?.z)}setNodeCosts(e){let t=Math.abs(e.x-e.parent.x),n=Math.abs(e.y-e.parent.y),o=Math.sqrt(t**2+n**2),r=e.z%2==0,i=this.FLIP_TRACE_ALIGNMENT_DIRECTION?r?t:n:r?n:t,s=(e.parent?.g??0)+(e.z===e.parent?.z?0:this.viaPenaltyDistance)+o+i*this.MISALIGNED_DIST_PENALTY_FACTOR,a=Dn(e,this.B)**1.6+(e.z!==this.B.z?this.viaPenaltyDistance:0),c=this.getFutureConnectionPenalty(e,e.z!==e.parent?.z);e.g=s+c,e.h=a+c,e.f=this.computeF(e.g,e.h)}},d_r=(e)=>{let t=1/0,n=e.portPoints;for(let o=0;o<n.length;o++)for(let r=o+1;r<n.length;r++){let i=n[o],s=n[r];if(i.z!==s.z)continue;if(i.rootConnectionName&&i.rootConnectionName===s.rootConnectionName)continue;let a=Math.sqrt((i.x-s.x)**2+(i.y-s.y)**2);t=Math.min(t,a)}return t===1/0?0:t},CXt=(e)=>{let t=new Map,n=new Map,o=new Map;for(let{connectionName:r,rootConnectionName:i,x:s,y:a,z:c}of e.portPoints){i&&n.set(r,i);let l=t.get(r),h=o.get(r);l&&h||(l=[],h=new Set,t.set(r,l),o.set(r,h));let d=c??0,u=`${s.toFixed(6)},${a.toFixed(6)},${d}`;h.has(u)||(h.add(u),l.push({x:s,y:a,z:d}))}return{connectionPointsByName:t,rootConnectionNameByConnectionName:n,minDistBetweenEnteringPoints:d_r(e)}},rWe=(e,t,n=[])=>[e,t?`rootConnectionName: ${t}`:void 0,...n].filter(Boolean).join(`
`),u_r=(e)=>`${e.x.toFixed(6)},${e.y.toFixed(6)},${e.z}`,Qbe=class extends Kr{getSolverName(){return"IntraNodeRouteSolver"}nodeWithPortPoints;colorMap;unsolvedConnections;originalConnectionPointsByName;rootConnectionNameByConnectionName;totalConnections;solvedRoutes;failedSubSolvers;hyperParameters;minDistBetweenEnteringPoints;viaDiameter;traceWidth;obstacleMargin;captureSearchDebug;rerouteAttemptsByConnection;POSTROUTE_VIA_TRACE_CLEARANCE=0.1;MAX_POSTROUTE_REPAIR_ATTEMPTS=2;activeSubSolver=null;connMap;get failedSolvers(){return this.failedSubSolvers}get activeSolver(){return this.activeSubSolver}constructor(e){let{nodeWithPortPoints:t,colorMap:n}=e;super(),this.nodeWithPortPoints=t,this.colorMap=n??{},this.solvedRoutes=[],this.hyperParameters=e.hyperParameters??{},this.failedSubSolvers=[],this.connMap=e.connMap,this.viaDiameter=e.viaDiameter??0.3,this.traceWidth=e.traceWidth??0.15,this.obstacleMargin=e.obstacleMargin??0.15,this.captureSearchDebug=e.captureSearchDebug??!0;let o=e.precomputedIntraNodeRouteParams??CXt(t);this.rootConnectionNameByConnectionName=new Map(o.rootConnectionNameByConnectionName),this.originalConnectionPointsByName=new Map(Array.from(o.connectionPointsByName.entries()).map(([r,i])=>[r,i.map((s)=>({...s}))])),this.unsolvedConnections=Array.from(this.originalConnectionPointsByName.entries().map(([r,i])=>({connectionName:r,rootConnectionName:this.rootConnectionNameByConnectionName.get(r),points:[...i]}))),this.rerouteAttemptsByConnection=new Map,this.hyperParameters.SHUFFLE_SEED&&(this.unsolvedConnections=db(this.unsolvedConnections,this.hyperParameters.SHUFFLE_SEED??0),this.unsolvedConnections=this.unsolvedConnections.map(({points:r,...i},s)=>({...i,points:db(r,7117*s+(this.hyperParameters.SHUFFLE_SEED??0))}))),this.totalConnections=this.unsolvedConnections.length,this.MAX_ITERATIONS=1000*this.totalConnections**1.5,this.minDistBetweenEnteringPoints=o.minDistBetweenEnteringPoints}computeProgress(){return(this.solvedRoutes.length+(this.activeSubSolver?.progress||0))/this.totalConnections}getSingleRouteSolverOpts(e){let{connectionName:t,rootConnectionName:n,points:o}=e;return{connectionName:t,rootConnectionName:n,regionId:this.nodeWithPortPoints.capacityMeshNodeId,minDistBetweenEnteringPoints:this.minDistBetweenEnteringPoints,bounds:Rce(this.nodeWithPortPoints),A:{x:o[0].x,y:o[0].y,z:o[0].z},B:{x:o[o.length-1].x,y:o[o.length-1].y,z:o[o.length-1].z},obstacleRoutes:this.connMap?this.solvedRoutes.filter((r)=>!this.connMap.areIdsConnected(r.connectionName,t)):this.solvedRoutes,futureConnections:this.unsolvedConnections,layerCount:this.nodeWithPortPoints.portPoints.reduce((r,i)=>Math.max(r,(i.z??0)+1),2),availableZ:this.nodeWithPortPoints.availableZ&&this.nodeWithPortPoints.availableZ.length>0?this.nodeWithPortPoints.availableZ:[...new Set(this.nodeWithPortPoints.portPoints.map((r)=>r.z??0))].sort((r,i)=>r-i),hyperParameters:this.hyperParameters,connMap:this.connMap,viaDiameter:this.viaDiameter,traceThickness:this.traceWidth,obstacleMargin:this.obstacleMargin,captureSearchDebug:this.captureSearchDebug}}trySolveSamePointLayerChange(e){let t=this.getSingleRouteSolverOpts(e),n=new kFt(t),{A:o,B:r}=t,i={x:o.x,y:o.y};if(!p_r(n,i,o,r))return!1;let s=[{x:o.x,y:o.y,z:o.z},{...i,z:o.z},{...i,z:r.z},{x:r.x,y:r.y,z:r.z}].filter((a,c,l)=>c===0||Math.abs(a.x-l[c-1].x)>0.000001||Math.abs(a.y-l[c-1].y)>0.000001||a.z!==l[c-1].z);return this.solvedRoutes.push({connectionName:e.connectionName,rootConnectionName:e.rootConnectionName,regionId:this.nodeWithPortPoints.capacityMeshNodeId,traceThickness:this.traceWidth,viaDiameter:this.viaDiameter,route:s,vias:[{x:i.x,y:i.y}]}),!0}queueExtraBranchesForMultiPointConnection(e){let[t,...n]=((o)=>{let r=new Set,i=[];for(let s of o){let a=u_r(s);r.has(a)||(r.add(a),i.push(s))}return i})(e.points);if(!t||n.length<=1)return!1;for(let o of n)this.unsolvedConnections.push({connectionName:e.connectionName,rootConnectionName:e.rootConnectionName,points:[t,o]});return!0}getAvailableZLayers(){return this.nodeWithPortPoints.availableZ&&this.nodeWithPortPoints.availableZ.length>0?[...new Set(this.nodeWithPortPoints.availableZ)].sort((e,t)=>e-t):[...new Set(this.nodeWithPortPoints.portPoints.map((e)=>e.z??0))].sort((e,t)=>e-t)}getFirstSolvedViaTraceConflict(){if(this.solvedRoutes.length<2)return null;let e=new CCe(this.solvedRoutes),t=this.getAvailableZLayers();for(let n of this.solvedRoutes){let o=n.viaDiameter/2+this.POSTROUTE_VIA_TRACE_CLEARANCE;for(let r of n.vias)for(let i of t){let s=e.getConflictingRoutesNearPoint({x:r.x,y:r.y,z:i},o).filter(({conflictingRoute:a})=>a.connectionName!==n.connectionName&&!this.connMap?.areIdsConnected(n.connectionName,a.connectionName));if(s.length>0)return{route:n,via:r,conflictingRoute:s[0].conflictingRoute}}}return null}queueConnectionForPostrouteRepair(e){let t=this.originalConnectionPointsByName.get(e);return!(!t||t.length<2)&&(this.solvedRoutes=this.solvedRoutes.filter((n)=>n.connectionName!==e),this.unsolvedConnections.push({connectionName:e,rootConnectionName:this.rootConnectionNameByConnectionName.get(e),points:t.map((n)=>({...n}))}),this.rerouteAttemptsByConnection.set(e,(this.rerouteAttemptsByConnection.get(e)??0)+1),!0)}_step(){if(this.activeSubSolver){if(this.activeSubSolver.step(),this.progress=this.computeProgress(),this.activeSubSolver.solved)this.solvedRoutes.push(this.activeSubSolver.solvedPath),this.activeSubSolver=null;else if(this.activeSubSolver.failed){let t=this.activeSubSolver;this.activeSubSolver=null,this.error=t.error,this.captureSearchDebug&&this.failedSubSolvers.push(t),this.failed=!0}return}let e=this.unsolvedConnections.pop();if(this.progress=this.computeProgress(),!e){let t=this.getFirstSolvedViaTraceConflict();if(t){if((this.rerouteAttemptsByConnection.get(t.route.connectionName)??0)>=this.MAX_POSTROUTE_REPAIR_ATTEMPTS)return this.error=["Post-route via/trace clearance repair exceeded retry budget",`route: ${t.route.connectionName}`,`conflicts with: ${t.conflictingRoute.connectionName}`,`via: (${t.via.x.toFixed(3)}, ${t.via.y.toFixed(3)})`].join(`
`),void(this.failed=!0);if(this.queueConnectionForPostrouteRepair(t.route.connectionName))return void(this.progress=this.computeProgress())}return void(this.solved=this.failedSubSolvers.length===0)}if(e.points.length!==1&&!(e.points.length>2&&this.queueExtraBranchesForMultiPointConnection(e))){if(e.points.length===2){let[t,n]=e.points,o=Math.abs(t.x-n.x)<0.000001,r=Math.abs(t.y-n.y)<0.000001;if(o&&r&&t.z===n.z)return;if(o&&r&&t.z!==n.z&&this.trySolveSamePointLayerChange(e))return}this.activeSubSolver=new kFt(this.getSingleRouteSolverOpts(e))}}visualize(){let e={lines:[],points:[],rects:[],circles:[]};for(let s of this.nodeWithPortPoints.portPoints)e.points.push({x:s.x,y:s.y,label:rWe(s.connectionName,s.rootConnectionName,[`layer: ${s.z}`]),color:this.colorMap[s.connectionName]??"blue"});for(let s=0;s<this.solvedRoutes.length;s++){let a=this.solvedRoutes[s];if(a.route.length>0){let c=this.colorMap[a.connectionName]??"blue",l=a.rootConnectionName??this.rootConnectionNameByConnectionName.get(a.connectionName);for(let h=0;h<a.route.length-1;h++){let d=a.route[h],u=a.route[h+1];e.lines.push({points:[d,u],label:rWe(a.connectionName,l,[`layer: ${d.z}`]),strokeColor:d.z===0?Qi(c,0.2):Qi(c,0.8),layer:`route-layer-${d.z}`,step:s,strokeWidth:a.traceThickness})}for(let h of a.vias)e.circles.push({center:{x:h.x,y:h.y},radius:a.viaDiameter/2,fill:Qi(c,0.5),layer:"via",step:s,label:rWe(a.connectionName,l,["via"])})}}let t=Rce(this.nodeWithPortPoints),{minX:n,minY:o,maxX:r,maxY:i}=t;return e.lines.push({points:[{x:n,y:o},{x:r,y:o},{x:r,y:i},{x:n,y:i},{x:n,y:o}],strokeColor:"rgba(255, 0, 0, 0.25)",strokeDash:"4 4",layer:"border"}),e}},p_r=(e,t,n,o)=>{let r={x:t.x,y:t.y,z:n.z,parent:{x:n.x,y:n.y,z:n.z,g:0,h:0,f:0,parent:null},g:0,h:0,f:0};return!e.isNodeTooCloseToObstacle(r,e.viaDiameter/2+e.obstacleMargin/2,!0)&&!e.isNodeTooCloseToEdge(r,!0)},ZC=(e)=>Math.round(200*e)/200,LFt=(e)=>typeof structuredClone=="function"?structuredClone(e):JSON.parse(JSON.stringify(e));Dbe();var b$e=class extends Qbe{getSolverName(){return"CachedIntraNodeRouteSolver"}cacheProvider;cacheHit=!1;hasAttemptedToUseCache=!1;initialUnsolvedConnections;constructor(e){super(e),this.cacheProvider=e.cacheProvider===void 0?_9():e.cacheProvider,this.initialUnsolvedConnections=this.unsolvedConnections.map((t)=>({...t,points:t.points.map((n)=>({...n}))})),(this.solved||this.failed)&&this.cacheProvider&&!this.cacheHit&&this.saveToCacheSync()}_step(){if(!this.hasAttemptedToUseCache&&this.cacheProvider&&this.attemptToUseCacheSync())return;let e=this.solved,t=this.failed;super._step(),!this.cacheProvider||this.cacheHit||!this.solved&&!this.failed||e||t||this.saveToCacheSync()}computeCacheKeyAndTransform(){let e=this.nodeWithPortPoints.center,t=this.initialUnsolvedConnections.map(({connectionName:l,rootConnectionName:h,points:d})=>({connectionName:l,rootConnectionName:h,points:d.map((u)=>({connectionName:l,x:ZC(u.x-e.x),y:ZC(u.y-e.y),z:u.z??0}))})),n=[...this.nodeWithPortPoints.portPoints].sort((l,h)=>l.connectionName!==h.connectionName?l.connectionName.localeCompare(h.connectionName):(l.portPointId??"")!==(h.portPointId??"")?(l.portPointId??"").localeCompare(h.portPointId??""):l.x!==h.x?l.x-h.x:l.y!==h.y?l.y-h.y:(l.z??0)-(h.z??0)).map((l)=>({connectionName:l.connectionName,rootConnectionName:l.rootConnectionName,portPointId:l.portPointId,prevPortPointId:l.prevPortPointId,nextPortPointId:l.nextPortPointId,x:ZC(l.x-e.x),y:ZC(l.y-e.y),z:l.z??0})),o=Object.fromEntries(Object.entries(this.hyperParameters??{}).filter(([,l])=>l!==void 0).sort(([l],[h])=>l.localeCompare(h))),r=this.connMap?this.initialUnsolvedConnections.map(({connectionName:l})=>({connectionName:l,connectedIds:[...new Set(this.connMap.getIdsConnectedToNet(l)??[])].sort()})):void 0,i={cacheSchemaVersion:6,node:{width:ZC(this.nodeWithPortPoints.width),height:ZC(this.nodeWithPortPoints.height),center:{x:ZC(this.nodeWithPortPoints.center.x),y:ZC(this.nodeWithPortPoints.center.y)},availableZ:this.nodeWithPortPoints.availableZ?[...this.nodeWithPortPoints.availableZ].sort():void 0,portPoints:n},normalizedConnections:t,normalizedHyperParameters:o,minDistBetweenEnteringPoints:ZC(this.minDistBetweenEnteringPoints),traceWidth:ZC(this.traceWidth),viaDiameter:ZC(this.viaDiameter),obstacleMargin:ZC(this.obstacleMargin),normalizedConnMap:r},s=JSON.stringify(i,(l,h)=>typeof h!="number"||Number.isFinite(h)?typeof h=="string"&&(h==="u:"||h.startsWith("n:")||h.startsWith("s:"))?`s:${h}`:h===void 0?"u:":h:`n:${h.toString()}`),a=`intranode-solver:${xXt.default(s)}`,c={};return this.cacheKey=a,this.cacheToSolveSpaceTransform=c,{cacheKey:a,cacheToSolveSpaceTransform:c}}applyCachedSolution(e){e.success?(this.solvedRoutes=LFt(e.solvedRoutes),this.solved=!0,this.failed=!1):(this.solvedRoutes=[],this.failedSubSolvers=[],this.solved=!1,this.failed=!0,this.error=e.error??this.error),this.unsolvedConnections=[],this.activeSubSolver=null,this.cacheHit=!0,this.progress=1}attemptToUseCacheSync(){if(this.hasAttemptedToUseCache=!0,!this.cacheProvider?.isSyncCache)return!1;if(!this.cacheKey)try{this.computeCacheKeyAndTransform()}catch(e){return console.error("Error computing cache key:",e),!1}if(!this.cacheKey)return console.error("Failed to compute cache key."),!1;try{let e=this.cacheProvider.getCachedSolutionSync(this.cacheKey);if(e!=null)return this.applyCachedSolution(e),!0}catch(e){console.error("Error attempting to use cache:",e)}return!1}saveToCacheSync(){if(!this.cacheProvider?.isSyncCache)return;if(!this.cacheKey)try{this.computeCacheKeyAndTransform()}catch(t){return void console.error("Error computing cache key during save:",t)}if(!this.cacheKey)return void console.error("Failed to compute cache key before saving.");let e=this.failed?{success:!1,error:this.error??void 0}:{success:!0,solvedRoutes:LFt(this.solvedRoutes)};try{this.cacheProvider.setCachedSolutionSync(this.cacheKey,e)}catch(t){console.error("Error saving solution to cache:",t)}}},bXt=(e,t)=>{let n={};return e.portPoints.forEach((o,r)=>{n[o.connectionName]=`hsl(${360*r/e.portPoints.length}, 100%, 50%)`}),n},m_r=class extends Kr{getSolverName(){return"ViaPossibilitiesSolver2"}bounds;maxViaCount;portPairMap;colorMap;nodeWidth;availableZ;hyperParameters;VIA_INTERSECTION_BUFFER_DISTANCE=0.05;PLACEHOLDER_WALL_BUFFER_DISTANCE=0.1;NEW_HEAD_WALL_BUFFER_DISTANCE=0.05;viaDiameter;unprocessedConnections;completedPaths=new Map;placeholderPaths=new Map;currentHead;currentConnectionName;currentPath;currentViaCount;constructor({nodeWithPortPoints:e,colorMap:t,hyperParameters:n,viaDiameter:o}){super(),this.MAX_ITERATIONS=1e5,this.colorMap=t??bXt(e),this.maxViaCount=5,this.bounds=Rce(e),this.nodeWidth=this.bounds.maxX-this.bounds.minX,this.portPairMap=((i)=>{let s=new Map;return i.portPoints.forEach((a)=>{s.has(a.connectionName)?s.get(a.connectionName).end=a:s.set(a.connectionName,{start:a,end:null,connectionName:a.connectionName})}),s})(e),this.stats.solutionsFound=0,this.availableZ=e.availableZ??[0,1],this.hyperParameters=n??{SHUFFLE_SEED:0},this.viaDiameter=o??0.3,this.unprocessedConnections=Array.from(this.portPairMap.keys()).sort(),n?.SHUFFLE_SEED&&(this.unprocessedConnections=db(this.unprocessedConnections,n.SHUFFLE_SEED));for(let[i,{start:s,end:a}]of this.portPairMap.entries())if(s.z===a.z){let c=Math.abs(s.x-a.x)<0.000000001,l=Math.abs(s.y-a.y)<0.000000001;c||l?this.placeholderPaths.set(i,[s,this._padByPlaceholderWallBuffer(s),this._padByPlaceholderWallBuffer(a),a]):this.placeholderPaths.set(i,[s,a])}else{let c=(s.x+a.x)/2,l=(s.y+a.y)/2,h=this._padByPlaceholderWallBuffer({x:c,y:l,z:s.z}),d=this._padByPlaceholderWallBuffer({x:c,y:l,z:a.z});this.placeholderPaths.set(i,[s,this._padByPlaceholderWallBuffer(s),h,d,this._padByPlaceholderWallBuffer(a),a])}this.currentConnectionName=this.unprocessedConnections.pop();let r=this.portPairMap.get(this.currentConnectionName).start;this.currentHead=this._padByNewHeadWallBuffer(r),this.currentPath=[r,this.currentHead],this.currentViaCount=0,this.placeholderPaths.delete(this.currentConnectionName)}_padByNewHeadWallBuffer(e){return{x:Mf(e.x,this.bounds.minX+this.NEW_HEAD_WALL_BUFFER_DISTANCE,this.bounds.maxX-this.NEW_HEAD_WALL_BUFFER_DISTANCE),y:Mf(e.y,this.bounds.minY+this.NEW_HEAD_WALL_BUFFER_DISTANCE,this.bounds.maxY-this.NEW_HEAD_WALL_BUFFER_DISTANCE),z:e.z}}_padByPlaceholderWallBuffer(e){return{x:Mf(e.x,this.bounds.minX+this.PLACEHOLDER_WALL_BUFFER_DISTANCE,this.bounds.maxX-this.PLACEHOLDER_WALL_BUFFER_DISTANCE),y:Mf(e.y,this.bounds.minY+this.PLACEHOLDER_WALL_BUFFER_DISTANCE,this.bounds.maxY-this.PLACEHOLDER_WALL_BUFFER_DISTANCE),z:e.z}}_step(){if(this.solved)return;let e=this.portPairMap.get(this.currentConnectionName).end,t=[this.currentHead,e],n=null,o=null,r=(s)=>{for(let a of s.values())for(let c=0;c<a.length-1;c++){let l=[a[c],a[c+1]];if(l[0].x===l[1].x&&l[0].y===l[1].y)continue;if(l[0].z!==this.currentHead.z)continue;let h=vw(t[0],t[1],l[0],l[1]);if(h){let d=Dn(this.currentHead,h);if(d<0.000001)continue;(!n||d<n.dist)&&(n={point:h,dist:d},o=l[0].z)}}};r(this.completedPaths),r(this.placeholderPaths);let i=this.currentHead.z!==e.z;if((n||i)&&(this.currentViaCount++,this.currentViaCount>=this.maxViaCount))return this.failed=!0,void(this.error=`Exceeded max via count of ${this.maxViaCount}`);if(n){let s,a=n.dist;if(a<=this.VIA_INTERSECTION_BUFFER_DISTANCE+0.000001)s=JO(this.currentHead,n.point);else{let d=n.point,u=d.x-this.currentHead.x,_=d.y-this.currentHead.y,p=(a-this.VIA_INTERSECTION_BUFFER_DISTANCE)/a;s={x:this.currentHead.x+u*p,y:this.currentHead.y+_*p}}let c=this.availableZ.find((d)=>d!==o);if(c===void 0)return this.error="Could not determine next Z level for via placement!",void(this.failed=!0);let l={...s,z:this.currentHead.z},h={...s,z:c};this.currentPath.push(l,h),this.currentHead=h}else if(i){let s,a=Dn(this.currentHead,e);if(a<this.VIA_INTERSECTION_BUFFER_DISTANCE)s=JO(this.currentHead,e);else{let d=e.x-this.currentHead.x,u=e.y-this.currentHead.y,_=(a-this.VIA_INTERSECTION_BUFFER_DISTANCE)/a;s={x:this.currentHead.x+d*_,y:this.currentHead.y+u*_}}let c=e.z,l={...s,z:this.currentHead.z},h={...s,z:c};this.currentPath.push(l,h),this.currentHead=h}else if(this.currentPath.push(e),this.completedPaths.set(this.currentConnectionName,this.currentPath),this.unprocessedConnections.length===0)this.solved=!0,this.stats.solutionsFound=1;else{this.currentConnectionName=this.unprocessedConnections.pop();let{start:s}=this.portPairMap.get(this.currentConnectionName);this.currentHead=this._padByNewHeadWallBuffer(s),this.currentPath=[s,this.currentHead],this.currentViaCount=0,this.placeholderPaths.delete(this.currentConnectionName)}}visualize(){let e={points:[],lines:[],circles:[],rects:[],title:"Via Possibilities Solver State",coordinateSystem:"cartesian"},t=this.colorMap;e.lines.push({points:[{x:this.bounds.minX,y:this.bounds.minY},{x:this.bounds.maxX,y:this.bounds.minY},{x:this.bounds.maxX,y:this.bounds.maxY},{x:this.bounds.minX,y:this.bounds.maxY},{x:this.bounds.minX,y:this.bounds.minY}],strokeColor:"gray",strokeWidth:0.01});for(let[o,{start:r,end:i}]of this.portPairMap.entries()){let s=this.colorMap[o]??"black";e.points.push({x:r.x,y:r.y,color:s,label:`Port: ${o} Start (z${r.z})`}),e.points.push({x:i.x,y:i.y,color:s,label:`Port: ${o} End (z${i.z})`})}let n=(o,r)=>{for(let[i,s]of o.entries()){let a=t[i]??"black";for(let c=0;c<s.length-1;c++){let l=s[c],h=s[c+1];l.x===h.x&&l.y===h.y&&l.z!==h.z?e.circles.push({center:{x:l.x,y:l.y},radius:this.viaDiameter/2,fill:Qi(a,0.5),label:`${r}: ${i} Via (z${l.z}->z${h.z})`}):e.lines.push({points:[l,h],strokeColor:Qi(a,0.5),strokeDash:l.z===0?void 0:[0.1,0.1],strokeWidth:0.1,label:`${r}: ${i} (z${l.z})`})}}};if(n(this.placeholderPaths,"Placeholder"),n(this.completedPaths,"Completed"),this.currentPath&&this.currentPath.length>0){let o=t[this.currentConnectionName]??"orange";for(let r=0;r<this.currentPath.length-1;r++){let i=this.currentPath[r],s=this.currentPath[r+1];i.x===s.x&&i.y===s.y&&i.z!==s.z?e.circles.push({center:{x:i.x,y:i.y},radius:this.viaDiameter/2,fill:Qi(o,0.5),label:`Current: ${this.currentConnectionName} Via (z${i.z}->z${s.z})`}):e.lines.push({points:[i,s],strokeColor:Qi(o,0.5),strokeWidth:0.15,strokeDash:"2,2",label:`Current: ${this.currentConnectionName} (z${i.z})`})}e.points.push({x:this.currentHead.x,y:this.currentHead.y,color:"green",label:`Current Head: ${this.currentConnectionName} (z${this.currentHead.z})`})}return e}},O4e=(e)=>Math.round(1e4*e),IXt=(e)=>{let t=0,n=[],o=[];for(let i of e.portPoints){if(n.some((a)=>a.connectionName===i.connectionName))continue;if(o.some((a)=>a.connectionName===i.connectionName))continue;let s={connectionName:i.connectionName,z:i.z,points:[{x:O4e(i.x),y:O4e(i.y),z:i.z}]};for(let a of e.portPoints)i.connectionName===a.connectionName&&(i.x===a.x&&i.y===a.y||s.points.push({x:O4e(a.x),y:O4e(a.y),z:a.z}));s.points.some((a)=>a.z!==s.z)?o.push(s):n.push(s)}n=n.filter((i)=>i.points.length>1);for(let i=0;i<n.length;i++)for(let s=i+1;s<n.length;s++){let a=n[i],c=n[s];a.z===c.z&&su(a.points[0],a.points[1],c.points[0],c.points[1])&&t++}let r=0;for(let i=0;i<o.length;i++)for(let s=i+1;s<o.length;s++){let a=o[i],c=o[s];su(a.points[0],a.points[1],c.points[0],c.points[1])&&r++}return{numSameLayerCrossings:t,numEntryExitLayerChanges:o.length,numTransitionPairCrossings:r}},__r=(e)=>{let{start:t,end:n,segmentsPerPolyline:o,viaPositions:r,viaCount:i,availableZ:s}=e,a=function(_,p){let m=Array(_).fill(0);if(p===0)return m;if(p===_)return m.fill(1);if(p<=_/2){let A=Math.floor(_/p),g=Math.floor((_-(A*(p-1)+1))/2);for(let f=0;f<p;f++)m[g+f*A]=1}else{let A=_-p,g=Math.floor(_/A),f=Math.floor((_-(g*(A-1)+1))/2);m.fill(1);for(let y=0;y<A;y++)m[f+y*g]=0}return m}(o,i),c=a.map(()=>null),l=0,h=t.z1,d=s.indexOf(t.z1);for(let _=0;_<a.length;_++)if(a[_]===1){let p=s[(d+l+1)%s.length];c[_]={...r[l],z1:h,z2:p},h=p,l++}let u=t;for(let _=0;_<c.length;_++){if(c[_]){u=c[_];continue}let p=n,m=c.length;for(let y=_+1;y<c.length;y++)if(c[y]){p=c[y],m=y;break}let A=m-_,g=p.x-u.x,f=p.y-u.y;for(let y=1/(A+1),x=0;_+x!==m;y+=1/(A+1),x++)c[_+x]={x:u.x+g*y,y:u.y+f*y,z1:u.z2,z2:u.z2}}return c},K$=0.000000001;function bCe(e,t){return Math.abs(e-t)<K$}function iWe(e){return`${Math.round(e.x/K$)}:${Math.round(e.y/K$)}`}function sWe(e,t,n,o){return e*o-t*n}function g_r(e,t,n,o){let r={x:t.x-e.x,y:t.y-e.y},i={x:o.x-n.x,y:o.y-n.y},s=sWe(r.x,r.y,i.x,i.y),a={x:n.x-e.x,y:n.y-e.y};if(bCe(s,0))return null;let c=sWe(a.x,a.y,i.x,i.y)/s,l=sWe(a.x,a.y,r.x,r.y)/s;return c>=-0.000000001&&c<=1+K$&&l>=-0.000000001&&l<=1+K$?{x:e.x+c*r.x,y:e.y+c*r.y}:null}function HFt(e,t,n){return bCe(Math.hypot(e.x-t.x,e.y-t.y)+Math.hypot(e.x-n.x,e.y-n.y),Math.hypot(t.x-n.x,t.y-n.y))}function A_r(e,t){let n=[],o=new Map;for(let m of e){let A=[m.start,...m.mPoints,m.end];for(let f=0;f<A.length-1;f++){let y=A[f],x=A[f+1],C=y.z2;if(n.push({start:{x:y.x,y:y.y},end:{x:x.x,y:x.y},connectionName:m.connectionName,layer:C}),y.z1!==y.z2){let b=iWe(y);o.has(b)||o.set(b,{point:y,connectionName:m.connectionName})}}let g=A[A.length-1];if(g.z1!==g.z2){let f=iWe(g);o.has(f)||o.set(f,{point:g,connectionName:m.connectionName})}}let r=[{start:{x:t.minX,y:t.minY},end:{x:t.maxX,y:t.minY},connectionName:null,layer:0},{start:{x:t.maxX,y:t.minY},end:{x:t.maxX,y:t.maxY},connectionName:null,layer:0},{start:{x:t.maxX,y:t.maxY},end:{x:t.minX,y:t.maxY},connectionName:null,layer:0},{start:{x:t.minX,y:t.maxY},end:{x:t.minX,y:t.minY},connectionName:null,layer:0}];n.push(...r);let i=new Map,s=0;function a(m,A){let g=iWe(m),f=i.get(g);if(!f){let y=o.has(g);f={id:s++,x:m.x,y:m.y,isVia:y,connectionNames:new Set,outgoingEdges:[]},i.set(g,f),y&&o.get(g)&&f.connectionNames.add(o.get(g).connectionName)}return A&&f.connectionNames.add(A),f}for(let m of n)a(m.start,m.connectionName),a(m.end,m.connectionName);let c=new Map;for(let m of n)c.set(m,[]);for(let m=0;m<n.length;m++)for(let A=m+1;A<n.length;A++){if(n[m].layer!==n[A].layer)continue;let g=g_r(n[m].start,n[m].end,n[A].start,n[A].end);g&&(a(g),HFt(g,n[m].start,n[m].end)&&c.get(n[m]).push(g),HFt(g,n[A].start,n[A].end)&&c.get(n[A]).push(g))}let l=[],h=0;for(let m of n){let A=[m.start,...c.get(m),m.end];A.sort((f,y)=>{let x=m.end.x-m.start.x,C=m.end.y-m.start.y;return Math.abs(x)>Math.abs(C)?(f.x-m.start.x)/x-(y.x-m.start.x)/x:Math.abs(C)<K$?0:(f.y-m.start.y)/C-(y.y-m.start.y)/C});let g=[];if(A.length>0){g.push(A[0]);for(let f=1;f<A.length;f++)bCe(A[f].x,A[f-1].x)&&bCe(A[f].y,A[f-1].y)||g.push(A[f])}for(let f=0;f<g.length-1;f++){let y=g[f],x=g[f+1],C=a(y,m.connectionName),b=a(x,m.connectionName);if(C===b)continue;let I={id:h++,origin:C,twin:null,next:null,face:null,connectionName:m.connectionName,layer:m.layer,visited:!1},v={id:h++,origin:b,twin:I,next:null,face:null,connectionName:m.connectionName,layer:m.layer,visited:!1};I.twin=v,l.push(I,v),C.outgoingEdges.push(I),b.outgoingEdges.push(v)}}for(let m of i.values()){m.outgoingEdges.sort((g,f)=>{let y=g.twin.origin,x=f.twin.origin;return Math.atan2(y.y-m.y,y.x-m.x)-Math.atan2(x.y-m.y,x.x-m.x)});let A=m.outgoingEdges.length;for(let g=0;g<A;g++){let f=m.outgoingEdges[g],y=m.outgoingEdges[(g-1+A)%A];f.twin&&(f.twin.next=y)}}let d=[],u=0,_=null,p=-1/0;for(let m of l){if(m.visited)continue;let A={id:u++,outerComponent:m,innerComponents:[],isOuterFace:!1};d.push(A);let g=m,f=[],y=[],x=new Set,C=0;do{if(!g||g.visited){console.warn("Face traversal encountered visited edge or null, breaking loop.",A.id),f.length=0;break}g.visited=!0,g.face=A,f.push(g),y.push(g.origin),g.connectionName!==null&&x.add(g.connectionName);let b=g.origin,I=g.twin.origin;C+=b.x*I.y-I.x*b.y,g=g.next}while(g!==m&&g!==null);if(g===m){if(C=0.5*Math.abs(C),C>p&&(p=C,_&&(_.isOuterFace=!1),_=A,A.isOuterFace=!0),!A.isOuterFace&&f.length>0){if([...x].filter((b)=>b!==null).length>1){let b=!1;for(let I of y)if(I.isVia){b=!0;break}if(!b)return!0}}}else console.warn(`Face ${A.id} did not close properly.`),d.pop(),u--}return!1}var vXt=(e)=>{if(e.length===0)return[[]];let t=[];for(let n=0;n<e.length;n++){let o=e[n],r=[...e.slice(0,n),...e.slice(n+1)],i=vXt(r);for(let s of i)t.push([o,...s])}return t},hje=0.000000001;function ICe(e,t,n=0.000000001){return Math.abs(e-t)<n}function aWe(e,t,n,o){return e*o-t*n}function f_r(e,t,n,o){let r={x:t.x-e.x,y:t.y-e.y},i={x:o.x-n.x,y:o.y-n.y},s=aWe(r.x,r.y,i.x,i.y);if(ICe(s,0))return null;let a={x:n.x-e.x,y:n.y-e.y},c=aWe(a.x,a.y,i.x,i.y)/s,l=aWe(a.x,a.y,r.x,r.y)/s;return c<-0.000000001||c>1+hje||l<-0.000000001||l>1+hje?null:{x:e.x+c*r.x,y:e.y+c*r.y}}function y_r(e){let t=0;for(let n=0,o=e.length;n<o;++n){let r=(n+1)%o;t+=e[n].x*e[r].y-e[r].x*e[n].y}return 0.5*t}function x_r(e){let t=0,n=0,o=0;for(let r=0,i=e.length;r<i;++r){let s=(r+1)%i,a=e[r].x*e[s].y-e[s].x*e[r].y;t+=a,n+=(e[r].x+e[s].x)*a,o+=(e[r].y+e[s].y)*a}return t*=0.5,ICe(t,0)?null:(n/=6*t,o/=6*t,{x:n,y:o})}var C_r=class{x;y;out;connectionNames;constructor(e,t){this.x=e,this.y=t,this.out=[],this.connectionNames=new Set}},FFt=class{orig;dest;twin;next;visited;constructor(e,t){this.orig=e,this.dest=t,this.twin=null,this.next=null,this.visited=!1}};function b_r(e,t){let n=[...t,{start:{x:e.minX,y:e.minY},end:{x:e.maxX,y:e.minY}},{start:{x:e.maxX,y:e.minY},end:{x:e.maxX,y:e.maxY}},{start:{x:e.maxX,y:e.maxY},end:{x:e.minX,y:e.maxY}},{start:{x:e.minX,y:e.maxY},end:{x:e.minX,y:e.minY}}],o=n.map(()=>[]);for(let d=0;d<n.length;++d){let u=n[d];o[d].push(u.start,u.end)}for(let d=0;d<n.length;++d)for(let u=d+1;u<n.length;++u){let _=f_r(n[d].start,n[d].end,n[u].start,n[u].end);_&&(o[d].push(_),o[u].push(_))}let r=new Map,i=[];function s(d){let u=function(_,p=0.000000001){return`${Math.round(_.x/p)}:${Math.round(_.y/p)}`}(d);if(!r.has(u)){let _=i.length;return r.set(u,_),i.push(new C_r(d.x,d.y)),_}return r.get(u)}let a=[];for(let d=0;d<n.length;++d){let u=n[d],_=o[d].slice();_.sort((p,m)=>{let A=u.end.x-u.start.x,g=u.end.y-u.start.y;return(ICe(Math.abs(A),0)?(p.y-u.start.y)/g:(p.x-u.start.x)/A)-(ICe(Math.abs(A),0)?(m.y-u.start.y)/g:(m.x-u.start.x)/A)});for(let p=0;p<_.length-1;++p){let m=_[p],A=_[p+1],g=s(m),f=s(A);g!==f&&(a.push([g,f]),u.connectionName&&(i[g].connectionNames.add(u.connectionName),i[f].connectionNames.add(u.connectionName)))}}let c=[];for(let[d,u]of a){let _=new FFt(d,u),p=new FFt(u,d);_.twin=c.length+1,p.twin=c.length;let m=c.length;c.push(_,p),i[d].out.push(m),i[u].out.push(m+1)}for(let d=0;d<i.length;++d){let u=i[d];u.out.sort((p,m)=>{let A=c[p],g=c[m],f=i[A.dest],y=i[g.dest];return Math.atan2(f.y-u.y,f.x-u.x)-Math.atan2(y.y-u.y,y.x-u.x)});let _=u.out.length;for(let p=0;p<_;++p){let m=u.out[p],A=u.out[(p-1+_)%_],g=c[m];g.twin!==null&&(c[g.twin].next=A)}}let l=[],h=[];for(let d=0;d<c.length;++d){if(c[d].visited)continue;let u=d,_=[],p=[];do{if(u===null)break;let m=c[u];m.visited=!0,_.push(i[m.orig]),p.push(u),u=m.next}while(u!==null&&u!==d&&!c[u].visited);if(_.length<3)continue;if(y_r(_)>hje){let m=x_r(_);m&&(l.push(m),h.push({vertices:_.map((A)=>({x:A.x,y:A.y,connectionNames:A.connectionNames.size>0?A.connectionNames:void 0})),centroid:m}))}}return{centroids:l,faces:h,allVertices:i}}function I_r(e,t){if(e>t)throw Error("oneCount cannot be greater than length");if(e<0||t<0)throw Error("oneCount and length must be non-negative");let n=[];return function o(r,i,s){s!==t?(r[s]=0,o(r,i,s+1),i>0&&(r[s]=1,o(r,i-1,s+1))):i===0&&n.push([...r])}(Array(t).fill(0),e,0),n}var SXt=class extends Kr{getSolverName(){return"MultiHeadPolyLineIntraNodeSolver"}nodeWithPortPoints;colorMap;hyperParameters;connMap;candidates;bounds;solvedRoutes=[];unsolvedConnections=[];SEGMENTS_PER_POLYLINE;cellSize;MAX_CANDIDATES=50000;viaDiameter=0.3;obstacleMargin=0.1;traceWidth=0.15;availableZ=[];uniqueConnections=0;BOUNDARY_PADDING;lastCandidate=null;maxViaCount;minViaCount;phase="setup";progress=0;constructor(e){super(),this.MAX_ITERATIONS=1e4,this.nodeWithPortPoints=e.nodeWithPortPoints,this.colorMap=e.colorMap??bXt(e.nodeWithPortPoints),this.hyperParameters=e.hyperParameters??{},this.SEGMENTS_PER_POLYLINE=e.hyperParameters?.SEGMENTS_PER_POLYLINE??3,this.BOUNDARY_PADDING=e.hyperParameters?.BOUNDARY_PADDING??0.05,this.connMap=e.connMap,this.viaDiameter=e.viaDiameter??this.viaDiameter,this.cellSize=this.nodeWithPortPoints.width/1024,this.candidates=[],this.availableZ=this.nodeWithPortPoints.availableZ??[0,1],this.bounds={minX:this.nodeWithPortPoints.center.x-this.nodeWithPortPoints.width/2,maxX:this.nodeWithPortPoints.center.x+this.nodeWithPortPoints.width/2,minY:this.nodeWithPortPoints.center.y-this.nodeWithPortPoints.height/2,maxY:this.nodeWithPortPoints.center.y+this.nodeWithPortPoints.height/2};let t=this.nodeWithPortPoints.width*this.nodeWithPortPoints.height,n=(this.viaDiameter+2*this.obstacleMargin+this.traceWidth/2)**2,o=new Set(this.nodeWithPortPoints.portPoints.map((s)=>s.connectionName)).size;this.uniqueConnections=o;let{numSameLayerCrossings:r,numEntryExitLayerChanges:i}=IXt(this.nodeWithPortPoints);if(this.minViaCount=2*r+i,this.maxViaCount=Math.min(Math.floor(t/n),Math.ceil(1.5*o)),this.minViaCount>this.SEGMENTS_PER_POLYLINE*(o/2))return this.failed=!0,void(this.error=`Not possible to solve problem with given SEGMENTS_PER_POLYLINE (${this.SEGMENTS_PER_POLYLINE}), atleast ${this.minViaCount} vias are required`);this.maxViaCount>this.SEGMENTS_PER_POLYLINE&&(this.maxViaCount=this.SEGMENTS_PER_POLYLINE),this.maxViaCount<this.minViaCount&&(this.maxViaCount=this.minViaCount)}computeMinGapBtwPolyLines(e){let t=[],n=[],o=[];for(let r=0;r<e.length;r++){let i=e[r],s=[i.start,...i.mPoints,i.end],a=new Map(this.availableZ.map((c)=>[c,[]]));for(let c=0;c<s.length-1;c++){let l=[s[c],s[c+1]],h=l[0].z2;a.has(h)||a.set(h,[]),a.get(h).push(l)}n.push(a),o.push(s.filter((c)=>c.z1!==c.z2))}for(let r=0;r<e.length;r++){let i=n[r],s=o[r];for(let a=r+1;a<e.length;a++){if(this.connMap?.areIdsConnected(e[r].connectionName,e[a].connectionName))continue;let c=n[a],l=o[a],h=1;for(let d of this.availableZ){let u=i.get(d)??[],_=c.get(d)??[];for(let p of u)for(let m of _)h=Math.min(h,s_(p[0],p[1],m[0],m[1])-this.traceWidth);for(let p of s)for(let m of _)h=Math.min(h,oc(p,m[0],m[1])-this.traceWidth/2-this.viaDiameter/2);for(let p of l)for(let m of u)h=Math.min(h,oc(p,m[0],m[1])-this.traceWidth/2-this.viaDiameter/2);for(let p of s)for(let m of l)h=Math.min(h,Dn(p,m)-this.viaDiameter)}t.push(h)}}return t}insertCandidate(e){let t=0,n=this.candidates.length-1;for(;t<=n;){let o=Math.floor((t+n)/2);this.candidates[o].f<e.f?t=o+1:n=o-1}this.candidates.splice(t,0,e)}setupInitialPolyLines(){let e=new Map;this.nodeWithPortPoints.portPoints.forEach((i)=>{e.has(i.connectionName)?e.get(i.connectionName).end={...i,z1:i.z??0,z2:i.z??0}:e.set(i.connectionName,{start:{...i,z1:i.z??0,z2:i.z??0},end:null})});for(let[i,s]of e.entries())s.end===null&&e.delete(i);if(e.size===0)return this.failed=!0,void(this.error="No port pairs found, can't solve");let t=Array.from(e.entries()),n=((i,s,a,c)=>{let l=[];for(let[,d]of i){let u=d.start.z1!==d.end.z1,_=[];for(let p=0;p<=s;p++){let m=p%2!=0;u&&m?_.push(p):u||m||_.push(p)}l.push(_)}if(l.length===0)return[[]];let h=((d)=>{if(!d||d.length===0)return[[]];let u=[[]];for(let _ of d){let p=[];for(let m of u)for(let A of _)p.push([...m,A]);u=p}return u})(l).filter((d)=>{for(let u=0;u<d.length;u++)if(d.reduce((_,p)=>_+p,0)<c)return!1;return!0});return h=h.filter((d)=>{for(let u=0;u<i.length;u++){let[,_]=i[u];if(_.start.z1!==_.start.z2&&d[u]===0)return!1}return!0}),h=h.filter((d)=>{for(let u=0;u<i.length;u++){let[,_]=i[u];if(i[u][1].start.z1===i[u][1].start.z2)for(let p=u+1;p<i.length;p++){if(i[p][1].start.z1!==i[p][1].start.z2)continue;let[,m]=i[p];if(_.start.z1===_.end.z1&&m.start.z1===m.end.z1&&_.start.z1===m.start.z1&&su(_.start,_.end,m.start,m.end)&&d[u]+d[p]<2)return!1}}return!0}),h=h.filter((d)=>!(d.reduce((u,_)=>u+_,0)>a)),h})(t,this.SEGMENTS_PER_POLYLINE,this.maxViaCount,this.minViaCount),o=((i)=>{let{bounds:s,portPairsEntries:a,viaCountVariants:c}=i,{centroids:l}=b_r(s,a.map(([d,u])=>u)),h=[];for(let d of c){let u=d.reduce((m,A)=>m+A,0),_=l;if(l.length<u){_=[];let m=Math.ceil(Math.sqrt(u)),A=m;for(let g=0;g<m;g++)for(let f=0;f<A;f++)_.push({x:s.minX+(f+1)/(A+1)*(s.maxX-s.minX),y:s.minY+(g+1)/(m+1)*(s.maxY-s.minY)})}let p=I_r(u,_.length);for(let m of p){let A=[];for(let g=0;g<m.length;g++)m[g]===1&&A.push(_[g]);h.push({viaPositions:A,viaCountVariant:d})}}return h})({portPairsEntries:t,viaCountVariants:n,bounds:this.bounds}),r=[];for(let{viaCountVariant:i,viaPositions:s}of o){let a=vXt(s);for(let c of a)r.push({viaCountVariant:i,viaPositions:c})}for(let{viaPositions:i,viaCountVariant:s}of r){let a=[],c=0;for(let u=0;u<t.length;u++){let[_,p]=t[u],m=s[u],A=i.slice(c,c+m),g=__r({start:p.start,end:p.end,segmentsPerPolyline:this.SEGMENTS_PER_POLYLINE,viaPositions:A,viaCount:m,availableZ:this.availableZ});c+=m,a.push({connectionName:_,start:p.start,end:p.end,mPoints:g})}if(A_r(a,this.bounds))continue;let l=this.computeMinGapBtwPolyLines(a),h=this.computeH({minGaps:l,forces:[]}),d={polyLines:a,g:0,h,f:h,viaCount:s.reduce((u,_)=>u+_,0),minGaps:l};if(this.checkIfSolved(d))return void(this.candidates=[d]);if(this.candidates.push(d),this.candidates.length>this.MAX_CANDIDATES)return}this.candidates.sort((i,s)=>i.f-s.f)}computeG(e,t){return t.g+0.000005+0.000005*t.viaCount*100}computeH(e){let t=0;for(let n of e.forces??[])for(let o of n)for(let r of o.values())t+=r.fx*r.fx+r.fy*r.fy;return t}getNeighbors(e){let{polyLines:t}=e,n=t.length,s=Array.from({length:n},(_,p)=>Array.from({length:t[p].mPoints.length},()=>new Map)),a=(_,p,m,A,g)=>{if(p>0&&p<t[_].mPoints.length+1){let f=p-1,y=s[_][f],x=y.get(m)||{fx:0,fy:0};y.set(m,{fx:x.fx+A,fy:x.fy+g})}};for(let _=0;_<n;_++)for(let p=_+1;p<n;p++){let m=t[_],A=t[p],g=[m.start,...m.mPoints,m.end],f=[A.start,...A.mPoints,A.end],y=[],x=[];for(let I=0;I<g.length-1;I++)y.push({p1:g[I],p2:g[I+1],layer:g[I].z2,p1Idx:I,p2Idx:I+1});g.forEach((I,v)=>{I.z1!==I.z2&&x.push({point:I,layers:[I.z1,I.z2],index:v})});let C=[],b=[];for(let I=0;I<f.length-1;I++)C.push({p1:f[I],p2:f[I+1],layer:f[I].z2,p1Idx:I,p2Idx:I+1});f.forEach((I,v)=>{I.z1!==I.z2&&b.push({point:I,layers:[I.z1,I.z2],index:v})});for(let I of y)for(let v of C)if(I.layer===v.layer){if(s_(I.p1,I.p2,v.p1,v.p2)<0.000001)continue;let P={x:(I.p1.x+I.p2.x)/2,y:(I.p1.y+I.p2.y)/2},M={x:(v.p1.x+v.p2.x)/2,y:(v.p1.y+v.p2.y)/2},B=P.x-M.x,T=P.y-M.y,N=B*B+T*T;if(N>0.000001){let D=Math.sqrt(N),L=(Math.exp(-6*D),`seg:${p}:${v.p1Idx}:${v.p2Idx}`),H=`seg:${_}:${I.p1Idx}:${I.p2Idx}`,V=(O,U,j,Y,X,K,J)=>{let ee=mm(O,j.p1,j.p2),se=O.x-ee.x,ne=O.y-ee.y,re=se*se+ne*ne;if(re<=0.000001)return;let Z=Math.sqrt(re),te=0.02*Math.exp(-6*Z),ie=se/Z*te,ce=ne/Z*te;a(Y,U,K,ie,ce),a(X,j.p1Idx,J,-ie/2,-ce/2),a(X,j.p2Idx,J,-ie/2,-ce/2)};V(I.p1,I.p1Idx,v,_,p,L,H),V(I.p2,I.p2Idx,v,_,p,L,H),V(v.p1,v.p1Idx,I,p,_,H,L),V(v.p2,v.p2Idx,I,p,_,H,L)}}for(let I of x)for(let v of C)if(I.layers.includes(v.layer)){let P=mm(I.point,v.p1,v.p2),M=I.point.x-P.x,B=I.point.y-P.y,T=M*M+B*B;if(T>0.000001){let N=Math.sqrt(T),D=2,L=N;N<this.viaDiameter/2?(D*=4,L=Math.max(0.000001,N)):L=Math.max(0.000001,N-this.viaDiameter/2);let H=D*0.02*Math.exp(-6*L),V=M/N*H,O=B/N*H,U=`seg:${p}:${v.p1Idx}:${v.p2Idx}`;a(_,I.index,U,V,O);let j=`via:${_}:${I.index}`;a(p,v.p1Idx,j,-V/2,-O/2),a(p,v.p2Idx,j,-V/2,-O/2)}}for(let I of b)for(let v of y)if(I.layers.includes(v.layer)){let P=mm(I.point,v.p1,v.p2),M=I.point.x-P.x,B=I.point.y-P.y,T=M*M+B*B;if(T>0.000001){let N=Math.sqrt(T),D=2,L=N;N<this.viaDiameter/2?(D*=4,L=Math.max(0.000001,N)):L=Math.max(0.000001,N-this.viaDiameter/2);let H=D*0.02*Math.exp(-6*L),V=M/N*H,O=B/N*H,U=`seg:${_}:${v.p1Idx}:${v.p2Idx}`;a(p,I.index,U,V,O);let j=`via:${p}:${I.index}`;a(_,v.p1Idx,j,-V/2,-O/2),a(_,v.p2Idx,j,-V/2,-O/2)}}for(let I of x)for(let v of b)if(I.layers.filter((P)=>v.layers.includes(P)).length>0){let P=I.point.x-v.point.x,M=I.point.y-v.point.y,B=P*P+M*M;if(B>0.000001){let T=Math.sqrt(B),N=2,D=T;T<this.viaDiameter?(N*=4,D=Math.max(0.000001,T)):D=Math.max(0.000001,T-this.viaDiameter);let L=N*0.02*Math.exp(-6*D),H=P/T*L,V=M/T*L,O=`via:${p}:${v.index}`,U=`via:${_}:${I.index}`;a(_,I.index,O,H,V),a(p,v.index,U,-H,-V)}}}for(let _=0;_<n;_++){let p=t[_],m=[p.start,...p.mPoints,p.end],A=[];if(m.forEach((g,f)=>{g.z1!==g.z2&&A.push({point:g,layers:[g.z1,g.z2],index:f})}),!(A.length<2))for(let g=0;g<A.length;g++)for(let f=g+1;f<A.length;f++){let y=A[g],x=A[f],C=y.point.x-x.point.x,b=y.point.y-x.point.y,I=C*C+b*b;if(I>0.000001){let v=Math.sqrt(I),P=2,M=v;v<this.viaDiameter?(P*=4,M=Math.max(0.000001,v)):M=Math.max(0.000001,v-this.viaDiameter);let B=P*0.02*Math.exp(-6*M),T=C/v*B,N=b/v*B,D=`via:${_}:${x.index}`,L=`via:${_}:${y.index}`;a(_,y.index,D,T,N),a(_,x.index,L,-T,-N)}}}let c=t.map((_)=>({..._,mPoints:_.mPoints.map((p)=>({...p}))})),l=!1;for(let _=0;_<n;_++)for(let p=0;p<c[_].mPoints.length;p++){let m=c[_].mPoints[p],A=s[_][p],g={fx:0,fy:0};for(let C of A.values())g.fx+=C.fx,g.fy+=C.fy;let f=m.z1!==m.z2,y=m.x+g.fx,x=m.y+g.fy;if(f){let C=this.viaDiameter/2,b=0,I=0,v=this.viaDiameter/2+this.BOUNDARY_PADDING,P=this.bounds.minX+v,M=this.bounds.maxX-v,B=this.bounds.minY+v,T=this.bounds.maxY-v,N=P+C-m.x,D=m.x-(M-C),L=B+C-m.y,H=m.y-(T-C);N>0?b=0.008*(Math.exp(N/(2*this.obstacleMargin))-1):D>0&&(b=-0.008*(Math.exp(D/(2*this.obstacleMargin))-1)),L>0?I=0.008*(Math.exp(L/(2*this.obstacleMargin))-1):H>0&&(I=-0.008*(Math.exp(H/(2*this.obstacleMargin))-1)),g.fx+=b,g.fy+=I,y=m.x+g.fx,x=m.y+g.fy}else{let C=this.traceWidth/2+this.BOUNDARY_PADDING;y=Math.max(this.bounds.minX+C,Math.min(this.bounds.maxX-C,y)),x=Math.max(this.bounds.minY+C,Math.min(this.bounds.maxY-C,x))}Math.abs(g.fx)<0.000001&&Math.abs(g.fy)<0.000001||(Math.abs(m.x-y)>0.000001||Math.abs(m.y-x)>0.000001)&&(m.x=y,m.y=x,l=!0)}if(!l)return[];let h=this.computeMinGapBtwPolyLines(c),d=this.computeG(c,e),u=this.computeH({minGaps:h,forces:s});return[{polyLines:c,g:d,h:u,f:Math.round(5*d)/5+u,minGaps:h,forces:s,viaCount:e.viaCount}]}checkIfSolved(e){let t=e.minGaps.every((o)=>o>=this.obstacleMargin),n=e.polyLines.every((o)=>o.mPoints.every((r)=>{let i=(r.z1!==r.z2?this.viaDiameter/2:this.traceWidth/2)+this.BOUNDARY_PADDING;return((s,a,c=0)=>s.x>=a.minX+c&&s.x<=a.maxX-c&&s.y>=a.minY+c&&s.y<=a.maxY-c)(r,this.bounds,i)}));return t&&n}tryFinalAcceptance(){let e=this.hyperParameters?.MINIMUM_FINAL_ACCEPTANCE_GAP??void 0;if(e===void 0||this.lastCandidate===null||this.lastCandidate.minGaps.length===0)return;return Math.min(...this.lastCandidate.minGaps)>=e?(this.solved=!0,void this._setSolvedRoutes()):void 0}_step(){if(this.phase==="setup")return this.setupInitialPolyLines(),void(this.phase="solving");let e=this.candidates.shift();if(!e){if(this.tryFinalAcceptance(),this.solved)return;return this.failed=!0,void(this.error="No candidates left")}if(this.lastCandidate=e,this.checkIfSolved(e))return this.solved=!0,void this._setSolvedRoutes();if(!e)return void(this.failed=!0);let t=this.getNeighbors(e);for(let n of t)this.insertCandidate(n)}visualize(){let e={points:[],lines:[],rects:[],circles:[],coordinateSystem:"cartesian",title:"MultiHeadPolyLineIntraNodeSolver Visualization"};e.lines.push({points:[{x:this.bounds.minX,y:this.bounds.minY},{x:this.bounds.maxX,y:this.bounds.minY},{x:this.bounds.maxX,y:this.bounds.maxY},{x:this.bounds.minX,y:this.bounds.maxY},{x:this.bounds.minX,y:this.bounds.minY}],strokeColor:"gray"});let t=this.lastCandidate??this.candidates[0];if(t?.hasClosedSameLayerFace){let n=0.1*(this.bounds.maxX-this.bounds.minX),o=0.1*(this.bounds.maxY-this.bounds.minY);e.rects.push({center:{x:this.bounds.maxX+0.6*n,y:this.bounds.maxY+0.6*o},width:n,height:o,fill:"red",label:"HAS CLOSED FACE"})}for(let n of this.nodeWithPortPoints.portPoints)e.points.push({x:n.x,y:n.y,label:`${n.connectionName} (Port z=${n.z??0})`,color:this.colorMap[n.connectionName]??"blue"});return t&&t.polyLines.forEach((n,o)=>{let r=this.colorMap[n.connectionName]??"purple",i=[n.start,...n.mPoints,n.end];for(let s=0;s<i.length-1;s++){let a=i[s],c=i[s+1],l=a.z2,h=l===0,d=h?r:Qi(r,0.5);e.lines.push({points:[a,c],strokeColor:d,strokeWidth:this.traceWidth,strokeDash:h?void 0:[0.15,0.15],label:`${n.connectionName} segment (z=${l})`})}i.forEach((s,a)=>{let c=s.z1!==s.z2,l=s.z1,h=a>0&&a<i.length-1,d="",u="";if(h){let _=a-1,p=t.forces?.[o]?.[_];if(p&&p.size>0){let m={fx:0,fy:0};p.forEach((A,g)=>{if(m.fx+=A.fx,m.fy+=A.fy,Math.abs(A.fx)>0.000001||Math.abs(A.fy)>0.000001){let f=g.split(":"),y=f[0],x=parseInt(f[1],10),C=t.polyLines[x],b=this.colorMap[C.connectionName]??"gray",v={x:s.x+A.fx*20,y:s.y+A.fy*20},P=C.connectionName;if(y==="via")P+=` Via ${parseInt(f[2],10)}`;else if(y==="seg")P+=` Seg ${parseInt(f[2],10)}-${parseInt(f[3],10)}`;e.lines.push({points:[s,v],strokeColor:b,strokeWidth:0.02,strokeDash:"2,2",label:`Force by ${P} on ${n.connectionName} mPoint ${_}`})}}),(Math.abs(m.fx)>0.000001||Math.abs(m.fy)>0.000001)&&(u=`
Net Force: (${m.fx.toFixed(3)}, ${m.fy.toFixed(3)})`)}}if(c)d=`Via (${n.connectionName} z=${s.z1} -> z=${s.z2})${u}`,e.circles.push({center:s,radius:this.viaDiameter/2,fill:Qi(r,0.5),label:d});else if(h){let _=l===0?r:Qi(r,0.5);d=`mPoint (${n.connectionName} z=${l})${u}`,e.circles.push({center:s,radius:this.cellSize/8,fill:_,label:d})}})}),e}_setSolvedRoutes(){if(!this.solved||!this.lastCandidate)return[];let e=[];for(let t of this.lastCandidate.polyLines){let n=[],o=[],r=[t.start,...t.mPoints,t.end];for(let i=0;i<r.length;i++){let s=r[i];n.push({x:s.x,y:s.y,z:s.z1}),s.z1!==s.z2&&(o.push({x:s.x,y:s.y}),n.push({x:s.x,y:s.y,z:s.z2}))}e.push({connectionName:t.connectionName,regionId:this.nodeWithPortPoints.capacityMeshNodeId,traceThickness:this.traceWidth,viaDiameter:this.viaDiameter,route:n,vias:o})}this.solvedRoutes=e}},I$e=class extends SXt{forceWorkspace={netForces:[],geometry:[]};prepareForceWorkspace(e){let{netForces:t,geometry:n}=this.forceWorkspace;t.length=e.length,n.length=e.length;for(let o=0;o<e.length;o++){let r=e[o],i=t[o];i||(i=[],t[o]=i),i.length=r.mPoints.length;for(let d=0;d<i.length;d++){let u=i[d];u?(u.fx=0,u.fy=0):i[d]={fx:0,fy:0}}let s=n[o];s||(s={segments:[],vias:[]},n[o]=s);let{segments:a,vias:c}=s,l=r.mPoints.length+1;a.length=l;let h=0;for(let d=0;d<=l;d++){let u=d===0?r.start:d===l?r.end:r.mPoints[d-1];if(d<l){let _=d+1===l?r.end:r.mPoints[d],p=_.x-u.x,m=_.y-u.y,A=a[d];A?(A.p1=u,A.p2=_,A.deltaX=p,A.deltaY=m,A.lengthSquared=p*p+m*m,A.layer=u.z2,A.p1Idx=d,A.p2Idx=d+1,A.p1Force=i[d-1],A.p2Force=i[d],A.lastTargetLine=-1,A.lastEndpointIndex=-1,A.lastFx=0,A.lastFy=0,A.lastForceActive=!1):(A={p1:u,p2:_,deltaX:p,deltaY:m,lengthSquared:p*p+m*m,layer:u.z2,p1Idx:d,p2Idx:d+1,p1Force:i[d-1],p2Force:i[d],lastTargetLine:-1,lastEndpointIndex:-1,lastFx:0,lastFy:0,lastForceActive:!1},a[d]=A)}if(u.z1!==u.z2){let _=c[h];_?(_.point=u,_.layers[0]=u.z1,_.layers[1]=u.z2,_.index=d,_.force=i[d-1]):(_={point:u,layers:[u.z1,u.z2],index:d,force:i[d-1]},c[h]=_),h++}}c.length=h}return this.forceWorkspace}getSolverName(){return"MultiHeadPolyLineIntraNodeSolver2"}computeG(e,t){return t.g+0.000005+0.000005*t.viaCount*100}computeH(e){let{minGaps:t}=e,n=0;for(let o of t)o<0&&(n+=this.obstacleMargin),o<this.obstacleMargin&&(n+=this.obstacleMargin-o);return 0.011*n}_step(){if(this.phase==="setup")return this.setupInitialPolyLines(),void(this.phase="solving");let e=this.candidates.shift();if(!e){if(this.tryFinalAcceptance(),this.solved)return;return void(this.failed=!0)}if(this.lastCandidate=e,this.checkIfSolved(e))return this.solved=!0,void this._setSolvedRoutes();let t=!1,n=0,o=e.magForceApplied===void 0?1:10;for(let r=0;r<o;r++){let i=this.applyForcesToPolyLines(e.polyLines);if(n+=i.magForceApplied,t=i.lastStepMoved,!i.lastStepMoved)break}if(e.magForceApplied=n,e.minGaps=this.computeMinGapBtwPolyLines(e.polyLines),this.checkIfSolved(e))return this.solved=!0,void this._setSolvedRoutes();e.g=this.computeG(e.polyLines,e),e.h=this.computeH(e),e.f=e.g+e.h,t&&this.insertCandidate(e)}applyForcesToPolyLines(e){let t=0,n=e.length,o=0.02,r=0.008,i=0.000001,{netForces:s,geometry:a}=this.prepareForceWorkspace(e),c=(h,d,u,_,p)=>{let m,A;if(u.lastTargetLine===_&&u.lastEndpointIndex===d){if(!u.lastForceActive)return;m=u.lastFx,A=u.lastFy}else{let g=u.p1.x,f=u.p1.y;if(u.lengthSquared!==0){let v=Math.max(0,Math.min(1,((h.x-u.p1.x)*u.deltaX+(h.y-u.p1.y)*u.deltaY)/u.lengthSquared));g+=v*u.deltaX,f+=v*u.deltaY}let y=h.x-g,x=h.y-f,C=y*y+x*x;if(u.lastTargetLine=_,u.lastEndpointIndex=d,C<=i)return void(u.lastForceActive=!1);let b=Math.sqrt(C),I=0.02*Math.exp(-6*b);m=y/b*I,A=x/b*I,u.lastFx=m,u.lastFy=A,u.lastForceActive=!0}p&&(p.fx+=m,p.fy+=A),u.p1Force&&(u.p1Force.fx+=-m/2,u.p1Force.fy+=-A/2),u.p2Force&&(u.p2Force.fx+=-m/2,u.p2Force.fy+=-A/2)};for(let h=0;h<n;h++)for(let d=h+1;d<n;d++){let{segments:u,vias:_}=a[h],{segments:p,vias:m}=a[d];for(let A of u)for(let g of p)A.layer===g.layer&&(c(A.p1,A.p1Idx,g,h,A.p1Force),c(A.p2,A.p2Idx,g,h,A.p2Force),c(g.p1,g.p1Idx,A,d,g.p1Force),c(g.p2,g.p2Idx,A,d,g.p2Force));for(let A of _)for(let g of p)if(A.layers.includes(g.layer)){let f=mm(A.point,g.p1,g.p2),y=A.point.x-f.x,x=A.point.y-f.y,C=y*y+x*x;if(C>i){let b=Math.sqrt(C),I=2,v=b;b<this.viaDiameter/2?(I*=4,v=Math.max(i,b)):v=Math.max(i,b-this.viaDiameter/2);let P=I*o*Math.exp(-6*v),M=y/b*P,B=x/b*P;A.force&&(A.force.fx+=M,A.force.fy+=B),g.p1Force&&(g.p1Force.fx+=-M/2,g.p1Force.fy+=-B/2),g.p2Force&&(g.p2Force.fx+=-M/2,g.p2Force.fy+=-B/2)}}for(let A of m)for(let g of u)if(A.layers.includes(g.layer)){let f=mm(A.point,g.p1,g.p2),y=A.point.x-f.x,x=A.point.y-f.y,C=y*y+x*x;if(C>i){let b=Math.sqrt(C),I=2,v=b;b<this.viaDiameter/2?(I*=4,v=Math.max(i,b)):v=Math.max(i,b-this.viaDiameter/2);let P=I*o*Math.exp(-6*v),M=y/b*P,B=x/b*P;A.force&&(A.force.fx+=M,A.force.fy+=B),g.p1Force&&(g.p1Force.fx+=-M/2,g.p1Force.fy+=-B/2),g.p2Force&&(g.p2Force.fx+=-M/2,g.p2Force.fy+=-B/2)}}for(let A of _)for(let g of m)if(A.layers.filter((f)=>g.layers.includes(f)).length>0){let f=A.point.x-g.point.x,y=A.point.y-g.point.y,x=f*f+y*y;if(x>i){let C=Math.sqrt(x),b=2,I=C;C<this.viaDiameter?(b*=4,I=Math.max(i,C)):I=Math.max(i,C-this.viaDiameter);let v=b*o*Math.exp(-6*I),P=f/C*v,M=y/C*v;A.force&&(A.force.fx+=P,A.force.fy+=M),g.force&&(g.force.fx+=-P,g.force.fy+=-M)}}}for(let h=0;h<n;h++){let{vias:d}=a[h];if(!(d.length<2))for(let u=0;u<d.length;u++)for(let _=u+1;_<d.length;_++){let p=d[u],m=d[_],A=p.point.x-m.point.x,g=p.point.y-m.point.y,f=A*A+g*g;if(f>i){let y=Math.sqrt(f),x=2,C=y;y<this.viaDiameter?(x*=4,C=Math.max(i,y)):C=Math.max(i,y-this.viaDiameter);let b=x*o*Math.exp(-6*C),I=A/y*b,v=g/y*b;p.force&&(p.force.fx+=I,p.force.fy+=v),m.force&&(m.force.fx+=-I,m.force.fy+=-v)}}}let l=!1;for(let h=0;h<n;h++)for(let d=0;d<e[h].mPoints.length;d++){let u=e[h].mPoints[d],_=s[h][d],p=u.z1!==u.z2,{fx:m,fy:A}=_,g=u.x+m,f=u.y+A;if(p){let y=this.viaDiameter/2,x=0,C=0,b=this.viaDiameter/2+this.BOUNDARY_PADDING,I=this.bounds.minX+b,v=this.bounds.maxX-b,P=this.bounds.minY+b,M=this.bounds.maxY-b,B=I+y-u.x,T=u.x-(v-y),N=P+y-u.y,D=u.y-(M-y);B>0?x=r*(Math.exp(B/(2*this.obstacleMargin))-1):T>0&&(x=-0.008*(Math.exp(T/(2*this.obstacleMargin))-1)),N>0?C=r*(Math.exp(N/(2*this.obstacleMargin))-1):D>0&&(C=-0.008*(Math.exp(D/(2*this.obstacleMargin))-1)),m+=x,A+=C,g=u.x+m,f=u.y+A}else{let y=this.traceWidth/2+this.BOUNDARY_PADDING;g=Math.max(this.bounds.minX+y,Math.min(this.bounds.maxX-y,g)),f=Math.max(this.bounds.minY+y,Math.min(this.bounds.maxY-y,f))}if(Math.abs(m)<i&&Math.abs(A)<i)continue;t+=Math.sqrt(m*m+A*A),(Math.abs(u.x-g)>i||Math.abs(u.y-f)>i)&&(u.x=g,u.y=f,l=!0)}return{lastStepMoved:l,magForceApplied:t}}},zFt=(e)=>e.flatMap((t)=>`${t.connectionName}-${t.mPoints.map((n)=>`${n.x.toFixed(2)},${n.y.toFixed(2)},${n.z1},${n.z2}`)}`).sort().join("|"),PXt=class extends I$e{getSolverName(){return"MultiHeadPolyLineIntraNodeSolver3"}constructor(e){super(e),this.MAX_ITERATIONS=1000}createInitialCandidateFromSeed(e,t){let n=new m_r({nodeWithPortPoints:this.nodeWithPortPoints,colorMap:this.colorMap,hyperParameters:{SHUFFLE_SEED:e},viaDiameter:this.viaDiameter});if(n.solve(),n.failed||!n.solved)return this.failed=!0,this.error=`ViaPossibilitiesSolver2 failed with: ${n.error}`,null;let o=[],r=0;for(let[c,l]of n.completedPaths.entries()){if(l.length<2){console.warn(`Skipping connection "${c}" due to insufficient points (${l.length}) in ViaPossibilitiesSolver2 path.`);continue}let h=l[0],d=l[l.length-1],u=l.slice(1,-1),_=[],p=0,m=h.z;for(let f=0;f<u.length;f++){let y=u[f],x=f+1<u.length?u[f+1]:d,C=m,b=f+1<u.length&&y.x===x.x&&y.y===x.y&&y.z!==x.z?x.z:y.z;_.push({x:y.x,y:y.y,z1:C,z2:b}),C!==b?(p++,f++,m=b):m=y.z}r+=p;let A=this.SEGMENTS_PER_POLYLINE,g=_.length+1;for(;g<A;){let f=-1,y=-1,x=null,C=null,b=[{...h,z1:h.z,z2:h.z,connectionName:c},..._,{...d,z1:d.z,z2:d.z,connectionName:c}];for(let B=0;B<b.length-1;B++){let T=b[B],N=b[B+1];if(T.x===N.x&&T.y===N.y)continue;let D=Dn(T,N);D>f&&(f=D,y=B,x=T,C=N)}if(y===-1||!x||!C){console.warn(`Could not find longest segment for ${c} while trying to reach ${A} segments.`);break}let I=(x.x+C.x)/2,v=(x.y+C.y)/2,P=x.z2,M={x:I,y:v,z1:P,z2:P};_.splice(y,0,M),g++}o.push({connectionName:c,start:{...h,z1:h.z,z2:h.z},end:{...d,z1:d.z,z2:d.z},mPoints:_})}if(o.length===0)return this.failed=!0,this.error="No valid polylines generated from ViaPossibilitiesSolver2.",console.error(this.error),null;if(t?.has(zFt(o)))return null;let i=this.computeMinGapBtwPolyLines(o),s=this.computeH({minGaps:i,forces:[]}),a={polyLines:o,g:0,h:s,f:0+s,viaCount:r,minGaps:i};return a.g=this.computeG(o,a),a.f=a.g+a.h,a}setupInitialPolyLines(){this.candidates=[];let e=Math.min(2000,function(o){if(!Number.isInteger(o)||o<0)throw RangeError("n must be a non-negative integer");let r=1;for(let i=2;i<=o;i++)r*=i;return r}(this.uniqueConnections)),t=new Set,n=this.createInitialCandidateFromSeed===v_r&&this.computeMinGapBtwPolyLines===S_r&&this.computeH===P_r&&this.computeG===E_r;for(let o=0;o<e;o++){let r=n?this.createInitialCandidateFromSeed(o,t):this.createInitialCandidateFromSeed(o);if(!r)continue;let i=zFt(r.polyLines);t.has(i)||(t.add(i),this.candidates.push(r))}this.candidates.sort((o,r)=>o.f-r.f)}},v_r=PXt.prototype.createInitialCandidateFromSeed,S_r=SXt.prototype.computeMinGapBtwPolyLines,P_r=I$e.prototype.computeH,E_r=I$e.prototype.computeG,OFt=(e)=>e.portPointId??`${e.connectionName}:${e.x}:${e.y}:${e.z}`,dje=(e,t)=>{let[n,o]=e;if(n===o)return!1;let r=((i)=>{let[s,a]=i,c=OFt(s),l=OFt(a);return c<l?`${c}|${l}`:`${l}|${c}`})(e);return!t.seenPairKeys.has(r)&&(t.seenPairKeys.add(r),t.pairs.push(e),!0)},VFt=(e,t)=>{for(let n=0;n<e.length-1;n++)dje([e[n],e[n+1]],t)},kce=(e)=>{let t=[],n=new Set,o=new Map(e.filter((a)=>typeof a.portPointId=="string").map((a)=>[a.portPointId,a])),r={pairs:t,seenPairKeys:n};for(let a of e){if(a.prevPortPointId){let c=o.get(a.prevPortPointId);c&&c.connectionName===a.connectionName&&dje([c,a],r)}if(a.nextPortPointId){let c=o.get(a.nextPortPointId);c&&c.connectionName===a.connectionName&&dje([a,c],r)}}if(t.length===0)return VFt(e,r),t;let i=new Set(t.flatMap(([a,c])=>[a.portPointId,c.portPointId]).filter(Boolean)),s=e.filter((a)=>!a.portPointId||!i.has(a.portPointId));return VFt(s,r),t},U7=0.000001,YFt=0.02,fae=(e)=>`${e.x.toFixed(6)},${e.y.toFixed(6)}`,NO=(e,t)=>Math.abs(e.x-t.x)<U7&&Math.abs(e.y-t.y)<U7,GFt=(e)=>({minX:e.center.x-e.width/2,maxX:e.center.x+e.width/2,minY:e.center.y-e.height/2,maxY:e.center.y+e.height/2}),M_r=(e,t)=>e.x>=t.minX-U7&&e.x<=t.maxX+U7&&e.y>=t.minY-U7&&e.y<=t.maxY+U7,w_r=(e,t,n)=>{for(let o of n)if(!NO(o,e)&&!NO(o,t)&&oc(o,e,t)<0.0001)return!0;return!1},B_r=(e,t,n)=>{for(let o of n)if(!(NO(e,o.A)||NO(e,o.B)||NO(t,o.A)||NO(t,o.B))&&su(e,t,o.A,o.B))return!0;return!1},T_r=(e,t)=>{let n=[];for(let o of e){let r=o.rootConnectionName??o.connectionName;if(r!==t)for(let i=0;i<o.route.length-1;i++){let s=o.route[i],a=o.route[i+1];s.z===a.z&&n.push({A:{x:s.x,y:s.y},B:{x:a.x,y:a.y},rootConnectionName:r})}}return n},D_r=(e,t)=>e.portPoints.filter((n)=>(n.rootConnectionName??n.connectionName)!==t).map((n)=>({x:n.x,y:n.y}));function*EXt(e,t=e.length){if(t<=1)yield e.slice();else for(let n=0;n<t;n++)[e[n],e[t-1]]=[e[t-1],e[n]],yield*EXt(e,t-1),[e[n],e[t-1]]=[e[t-1],e[n]]}var N_r=({A:e,B:t,bounds:n,obstacleSegments:o,foreignPorts:r})=>{let i=[{x:e.x,y:e.y},{x:t.x,y:t.y},{x:(n.minX+n.maxX)/2,y:(n.minY+n.maxY)/2},{x:n.minX,y:n.minY},{x:n.maxX,y:n.minY},{x:n.maxX,y:n.maxY},{x:n.minX,y:n.maxY}],s=[...o.flatMap((A)=>[A.A,A.B]),...r,{x:e.x,y:e.y},{x:t.x,y:t.y}];for(let A of s)for(let g of[-0.02,0,YFt])for(let f of[-0.02,0,YFt]){let y={x:A.x+g,y:A.y+f};M_r(y,n)&&i.push(y)}let a=((A)=>{let g=new Set,f=[];for(let y of A){let x=fae(y);g.has(x)||(g.add(x),f.push(y))}return f})(i),c=fae(e),l=fae(t),h=new Map(a.map((A)=>[fae(A),A])),d=new Map,u=new Map,_=new Set;for(let A of a){let g=fae(A);d.set(g,g===c?0:1/0),u.set(g,null),_.add(g)}for(;_.size>0;){let A=null,g=1/0;for(let y of _){let x=d.get(y)??1/0;(x<g-U7||Math.abs(x-g)<=U7&&(A===null||y<A))&&(g=x,A=y)}if(!A||g===1/0)break;if(_.delete(A),A===l)break;let f=h.get(A);for(let y of _){let x=h.get(y);if(NO(f,x))continue;if(B_r(f,x,o))continue;if(w_r(f,x,r))continue;let C=g+Dn(f,x),b=d.get(y)??1/0,I=u.get(y);(C<b-U7||Math.abs(C-b)<=U7&&(I==null||A<I))&&(d.set(y,C),u.set(y,A))}}if((d.get(l)??1/0)===1/0)return null;let p=[],m=l;for(;m;)p.push(h.get(m)),m=u.get(m)??null;return p.reverse(),p.map((A)=>({x:A.x,y:A.y,z:e.z}))},UFt=class extends Kr{getSolverName(){return"SingleLayerNoDifferentRootIntersectionsIntraNodeSolver"}nodeWithPortPoints;traceWidth;viaDiameter;solvedRoutes=[];constructor(e){super(),this.nodeWithPortPoints=e.nodeWithPortPoints,this.traceWidth=e.traceWidth??0.15,this.viaDiameter=e.viaDiameter??0.3,this.MAX_ITERATIONS=1}static isApplicable(e){if(((r)=>r.availableZ?.length?[...new Set(r.availableZ)].sort((i,s)=>i-s):[...new Set(r.portPoints.map((i)=>i.z??0))].sort((i,s)=>i-s))(e).length!==1)return!1;if(e.portPoints.length>12)return!1;let n=GFt(e);if(e.portPoints.some((r)=>((i,s)=>Math.abs(i.y-s.minY)<0.001?"top":Math.abs(i.x-s.maxX)<0.001?"right":Math.abs(i.y-s.maxY)<0.001?"bottom":Math.abs(i.x-s.minX)<0.001?"left":null)(r,n)===null))return!1;let o=new Map;for(let r of e.portPoints)o.set(r.connectionName,(o.get(r.connectionName)??0)+1);return[...o.values()].some((r)=>r>2)}buildTaskGroups(){let e=new Map;for(let t of this.nodeWithPortPoints.portPoints){let n=e.get(t.connectionName)??[];n.push(t),e.set(t.connectionName,n)}return e}trySolveNode(){let e=GFt(this.nodeWithPortPoints),t=this.buildTaskGroups(),n=Array.from(t.entries()).flatMap(([r,i])=>kce(i).map(([s,a])=>({connectionName:r,rootConnectionName:s.rootConnectionName??a.rootConnectionName??r,A:s,B:a}))),o=n.length<=6?EXt(n.slice()):[n];for(let r of o){let i=[],s=!1;for(let a of r){let c=T_r(i,a.rootConnectionName),l=D_r(this.nodeWithPortPoints,a.rootConnectionName),h=N_r({A:a.A,B:a.B,bounds:e,obstacleSegments:c,foreignPorts:l});if(!h||h.length<2){s=!0;break}i.push({connectionName:a.connectionName,rootConnectionName:a.rootConnectionName,regionId:this.nodeWithPortPoints.capacityMeshNodeId,traceThickness:this.traceWidth,viaDiameter:this.viaDiameter,route:h,vias:[]})}if(!s)return i}return null}_step(){let e=this.trySolveNode();if(!e)return this.failed=!0,void(this.error="Failed to find a single-layer route set without different-root intersections");this.solvedRoutes=e,this.stats={routeCount:e.length,distinctRoots:new Set(e.map((t)=>t.rootConnectionName??t.connectionName)).size},this.solved=!0}visualize(){return{lines:this.solvedRoutes.map((e)=>({points:e.route,strokeColor:"cyan",strokeWidth:e.traceThickness,label:`${e.connectionName}
root: ${e.rootConnectionName??e.connectionName}`})),points:this.nodeWithPortPoints.portPoints.map((e)=>({x:e.x,y:e.y,color:"blue",label:`${e.connectionName}
root: ${e.rootConnectionName??e.connectionName}`})),rects:[],circles:[]}}},WFt=(e)=>e.min<=e.max?Mf(e.value,e.min,e.max):e.value,R_r=class extends Kr{getSolverName(){return"SingleTransitionIntraNodeSolver"}nodeWithPortPoints;routes;viaDiameter;traceThickness;obstacleMargin;solvedRoutes=[];bounds;constructor(e){if(super(),this.nodeWithPortPoints=e.nodeWithPortPoints,this.viaDiameter=e?.viaDiameter??0.3,this.traceThickness=e?.traceThickness??0.15,this.obstacleMargin=e?.obstacleMargin??0.1,this.routes=this.extractRoutesFromNode(),this.bounds=this.calculateBounds(),this.routes.length!==1)return this.failed=!0,void(this.error=`Expected 1 route, but got ${this.routes.length}`);let t=this.routes[0];if(t.A.z===void 0||t.B.z===void 0)return this.failed=!0,void(this.error="Route points should have predefined z values");if(t.A.z===t.B.z)return this.failed=!0,void(this.error="Only one route provided, but it has no transition");let n=this.viaDiameter/2+this.obstacleMargin,o={x:WFt({value:(t.A.x+t.B.x)/2,min:this.bounds.minX+n,max:this.bounds.maxX-n}),y:WFt({value:(t.A.y+t.B.y)/2,min:this.bounds.minY+n,max:this.bounds.maxY-n})};this.solvedRoutes.push(this.createTransitionRoute({start:t.A,end:t.B,via:o,connectionName:t.connectionName})),this.solved=!0}extractRoutesFromNode(){let e=[],t=this.nodeWithPortPoints.portPoints,n=new Map;for(let o of t){let{connectionName:r}=o;n.has(r)||n.set(r,[]),n.get(r).push(o)}for(let[o,r]of n.entries())for(let[i,s]of kce(r))e.push({A:{...i},B:{...s},connectionName:o});return e}calculateBounds(){return{minX:this.nodeWithPortPoints.center.x-this.nodeWithPortPoints.width/2,maxX:this.nodeWithPortPoints.center.x+this.nodeWithPortPoints.width/2,minY:this.nodeWithPortPoints.center.y-this.nodeWithPortPoints.height/2,maxY:this.nodeWithPortPoints.center.y+this.nodeWithPortPoints.height/2}}createTransitionRoute(e){let{start:t,end:n,via:o,connectionName:r}=e,i=[{x:t.x,y:t.y,z:t.z},{x:o.x,y:o.y,z:t.z},{x:o.x,y:o.y,z:n.z},{x:n.x,y:n.y,z:n.z}];return{connectionName:r,regionId:this.nodeWithPortPoints.capacityMeshNodeId,route:i,traceThickness:this.traceThickness,viaDiameter:this.viaDiameter,vias:[o]}}_step(){this.solved=!0}visualize(){let e={lines:[],points:[],rects:[],circles:[]};if(e.rects.push({center:{x:(this.bounds.minX+this.bounds.maxX)/2,y:(this.bounds.minY+this.bounds.maxY)/2},width:this.bounds.maxX-this.bounds.minX,height:this.bounds.maxY-this.bounds.minY,stroke:"rgba(0, 0, 0, 0.5)",fill:"rgba(240, 240, 240, 0.1)",label:"PCB Bounds"}),this.routes.length>0)for(let t of this.routes)e.points.push({x:t.A.x,y:t.A.y,label:`${t.connectionName} start (z=${t.A.z})`,color:"orange"}),e.points.push({x:t.B.x,y:t.B.y,label:`${t.connectionName} end (z=${t.B.z})`,color:"orange"}),e.lines.push({points:[t.A,t.B],strokeColor:"rgba(255, 0, 0, 0.5)",label:`${t.connectionName} direct`});for(let t=0;t<this.solvedRoutes.length;t++){let n=this.solvedRoutes[t];for(let r=0;r<n.route.length-1;r++){let i=n.route[r],s=n.route[r+1];e.lines.push({points:[i,s],strokeColor:"rgba(0, 255, 0, 0.75)",strokeDash:i.z!==n.route[0].z?[0.2,0.2]:void 0,strokeWidth:n.traceThickness,label:`${n.connectionName} z=${i.z}`})}for(let r of n.vias)e.circles.push({center:r,radius:this.viaDiameter/2,fill:"rgba(0, 0, 255, 0.8)",stroke:"black",label:"Solved Via"}),e.circles.push({center:r,radius:this.viaDiameter/2+this.obstacleMargin,fill:"rgba(0, 0, 255, 0.3)",stroke:"black",label:"Via Margin"})}return e}},Bq=(e,t=2)=>{let n=Array.from({length:t},(o,r)=>r);return e.map((o)=>{let r=Ile(o.__zLayers??(o.layers?vle(o.layers,t):void 0)??n,t);return{...o,__zLayers:r.length>0?r:n}})},XFt=0.000001,jFt=(e)=>{let{point:t,obstacle:n}=e,o=n.width/2+XFt,r=n.height/2+XFt;return Math.abs(t.x-n.center.x)<=o&&Math.abs(t.y-n.center.y)<=r},Q_r=class e extends Kr{getSolverName(){return"SingleTransitionThroughObstacleIntraNodeSolver"}nodeWithPortPoints;routes;obstacles;viaDiameter;traceThickness;connMap;solvedRoutes=[];constructor(t){if(super(),this.nodeWithPortPoints=t.nodeWithPortPoints,this.obstacles=Bq(t.obstacles??[],t.layerCount??2),this.connMap=t.connMap,this.viaDiameter=t.viaDiameter??0.3,this.traceThickness=t.traceThickness??0.15,this.routes=this.extractRoutesFromNode(),this.routes.length===0)return this.failed=!0,void(this.error="Expected at least 1 route");if(this.routes.some((o)=>o.A.z===void 0||o.B.z===void 0))return this.failed=!0,void(this.error="Route points should have predefined z values");if(!this.routes.some((o)=>o.A.z!==o.B.z))return this.failed=!0,void(this.error="No route transitions through an obstacle");let n=this.routes.map((o)=>this.getContainingThroughObstacle(o));if(n.some((o)=>!o))return this.failed=!0,void(this.error="No same-net multilayer obstacle contains every route");this.solvedRoutes.push(...this.routes.map((o,r)=>({connectionName:o.connectionName,rootConnectionName:o.rootConnectionName,regionId:this.nodeWithPortPoints.capacityMeshNodeId,route:[{x:o.A.x,y:o.A.y,z:o.A.z,...o.A.z!==o.B.z?{toNextSegmentType:"through_obstacle",...n[r].circuitJsonMetadata?{toNextSegmentCircuitJsonMetadata:n[r].circuitJsonMetadata}:{}}:{}},{x:o.B.x,y:o.B.y,z:o.B.z}],traceThickness:this.traceThickness,viaDiameter:this.viaDiameter,vias:[]}))),this.solved=!0}static isApplicable(t){return new e(t).solved}extractRoutesFromNode(){let t=[],n=new Map;for(let o of this.nodeWithPortPoints.portPoints){let{connectionName:r}=o;n.has(r)||n.set(r,[]),n.get(r).push(o)}for(let[o,r]of n.entries())for(let[i,s]of kce(r))t.push({A:{...i},B:{...s},connectionName:o,rootConnectionName:i.rootConnectionName??s.rootConnectionName});return t}getContainingThroughObstacle(t){let n=t.A.z,o=t.B.z;return n===void 0||o===void 0?null:this.obstacles.find((r)=>{return!(r.__zLayers.length<2)&&(!(!r.__zLayers.includes(n)||!r.__zLayers.includes(o))&&(!!(i={obstacle:r,connectionName:t.connectionName,connMap:this.connMap}).obstacle.connectedTo.some((s)=>s===i.connectionName||(i.connMap?.areIdsConnected(i.connectionName,s)??!1))&&(jFt({point:t.A,obstacle:r})&&jFt({point:t.B,obstacle:r}))));var i})??null}_step(){this.solved=!0}visualize(){let t={lines:[],points:[],rects:[],circles:[]};for(let n of this.obstacles)t.rects.push({center:n.center,width:n.width,height:n.height,fill:"rgba(128, 0, 128, 0.2)",stroke:"rgba(128, 0, 128, 0.6)",label:`through obstacle candidate
z: ${n.__zLayers.join(",")}`});for(let n of this.solvedRoutes){t.lines.push({points:n.route,strokeColor:"rgba(0, 180, 0, 0.8)",strokeDash:"4, 3",strokeWidth:n.traceThickness,label:`${n.connectionName} through_obstacle`});for(let o of n.route)t.points.push({x:o.x,y:o.y,color:"green",label:`${n.connectionName}
z: ${o.z}`})}return t}},eb=0.000001,KFt=({value:e,min:t,max:n})=>e>=t&&e<=n,V4e=({value:e,target:t,epsilon:n})=>Math.abs(e-t)<=n,MXt=({point:e,bounds:t,epsilon:n=0.000001})=>{if(![e.x,e.y,t.minX,t.maxX,t.minY,t.maxY].every((d)=>(({value:u})=>Number.isFinite(u))({value:d})))return"outside";if(e.x<t.minX-n||e.x>t.maxX+n||e.y<t.minY-n||e.y>t.maxY+n)return"outside";let o=V4e({value:e.x,target:t.minX,epsilon:n}),r=V4e({value:e.x,target:t.maxX,epsilon:n}),i=V4e({value:e.y,target:t.minY,epsilon:n}),s=V4e({value:e.y,target:t.maxY,epsilon:n}),a=o||r,c=i||s;if(a&&c)return"on-boundary";let l=KFt({value:e.y,min:t.minY,max:t.maxY}),h=KFt({value:e.x,min:t.minX,max:t.maxX});return a&&l||c&&h?"on-boundary":"inside"};function k_r(e,t,n,o,r){let i={x:(e.x+t.x+n.x)/3,y:(e.y+t.y+n.y)/3},s=(f,y)=>Math.sqrt((y.x-f.x)**2+(y.y-f.y)**2),a=(f)=>{let y=s(f,e),x=s(f,t),C=s(f,n),b=f.x>=r.minX&&f.x<=r.maxX&&f.y>=r.minY&&f.y<=r.maxY;return y>=o&&x>=o&&C>=o&&b};if(a(i))return i;let c=(f,y,x)=>{let C=f.x-y.x,b=f.y-y.y,I=Math.sqrt(C*C+b*b);return I<0.0000000001?{x:y.x+x,y:y.y}:{x:y.x+C/I*x,y:y.y+b/I*x}},l=(f,y,x)=>{let C=y.x-f.x,b=y.y-f.y,I=Math.sqrt(C*C+b*b);if(I>2*x-0.0000000001||I<0.0000000001)return[];let v=I*I/(2*I),P=Math.sqrt(Math.max(0,x*x-v*v)),M=f.x+C*v/I,B=f.y+b*v/I,T={x:M+P*b/I,y:B-P*C/I},N={x:M-P*b/I,y:B+P*C/I},D=[],L=0.000001;return Math.abs(s(T,f)-x)<L&&Math.abs(s(T,y)-x)<L&&D.push(T),Math.abs(s(N,f)-x)<L&&Math.abs(s(N,y)-x)<L&&D.push(N),D},h=[c(i,e,o),c(i,t,o),c(i,n,o),...l(e,t,o),...l(t,n,o),...l(n,e,o)],d=h.filter(a);if(d.length>0){let f=d.filter((y)=>!((x)=>Math.abs(x.x-r.minX)<0.000001||Math.abs(x.x-r.maxX)<0.000001||Math.abs(x.y-r.minY)<0.000001||Math.abs(x.y-r.maxY)<0.000001)(y));if(f.length>0)return f.sort((y,x)=>s(y,i)-s(x,i)),f[0]}let u=null,_=1/0;for(let f=r.minX+1;f<r.maxX;f+=5)for(let y=r.minY+1;y<r.maxY;y+=5){let x={x:f,y};if(a(x)){let C=s(x,i);C<_&&(_=C,u=x)}}if(u!==null)return u;let p=[];for(let f=0;f<=100;f++){let y=f/100;p.push({x:r.minX+y*(r.maxX-r.minX),y:r.minY}),p.push({x:r.maxX,y:r.minY+y*(r.maxY-r.minY)}),p.push({x:r.maxX-y*(r.maxX-r.minX),y:r.maxY}),p.push({x:r.minX,y:r.maxY-y*(r.maxY-r.minY)})}let m=p.filter(a);if(m.length>0)return m.sort((f,y)=>s(f,i)-s(y,i)),m[0];let A=1/0,g={x:r.minX,y:r.minY};for(let f of[...h,...p])if(f.x>=r.minX&&f.x<=r.maxX&&f.y>=r.minY&&f.y<=r.maxY){let y=Math.max(0,o-s(f,e))+Math.max(0,o-s(f,t))+Math.max(0,o-s(f,n));y<A&&(A=y,g=f)}return g}function dO(e,t,n){let o=$Ft(t,e,n.center,n.radius),r=$Ft(e,t,n.center,n.radius),i=NR(o,t),s=NR(e,r),c;if(i>0.000001&&s>0.000001){c={x:(o.x+r.x)/2,y:(o.y+r.y)/2};let l=NR(o,c),h=NR(r,c);if(Math.abs(l-h)>0.5*Math.min(l,h)){let u=NR(e,o),_=NR(t,r),p=u+_;if(p>0.000001){let m=_/p,A=u/p;c={x:o.x*m+r.x*A,y:o.y*m+r.y*A}}}let d=NR(c,n.center);if(d<1.05*n.radius){let u={x:(c.x-n.center.x)/d,y:(c.y-n.center.y)/d};c={x:n.center.x+u.x*n.radius*1.2,y:n.center.y+u.y*n.radius*1.2}}}else{let l={x:(e.x+t.x)/2,y:(e.y+t.y)/2},h=NR(l,n.center);if(h<1.1*n.radius){let d={x:(l.x-n.center.x)/h,y:(l.y-n.center.y)/h};c={x:n.center.x+d.x*n.radius*1.2,y:n.center.y+d.y*n.radius*1.2}}else c=l}return{B:o,D:r,E:c}}function $Ft(e,t,n,o){let r=[n.x-e.x,n.y-e.y],i=Math.sqrt(r[0]*r[0]+r[1]*r[1]);if(i<=o){if(i<0.00000001){let A=[t.x-e.x,t.y-e.y],g=Math.sqrt(A[0]*A[0]+A[1]*A[1]);return g<0.00000001?{x:n.x+o,y:n.y}:{x:n.x+A[0]/g*o,y:n.y+A[1]/g*o}}let m=[r[0]/i,r[1]/i];return{x:n.x-m[0]*o,y:n.y-m[1]*o}}let s=[t.x-e.x,t.y-e.y],a=Math.sqrt(i*i-o*o),c=[r[0]/i,r[1]/i],l=[-c[1],c[0]],h=[c[1],-c[0]],d=s[0]*l[0]+s[1]*l[1]>s[0]*h[0]+s[1]*h[1]?l:h,u=o/i,_=a/i,p=[c[0]*_+d[0]*u,c[1]*_+d[1]*u];return{x:e.x+a*p[0],y:e.y+a*p[1]}}function NR(e,t){let n=t.x-e.x,o=t.y-e.y;return Math.sqrt(n*n+o*o)}var N2=0.000000001;function qFt(e,t,n,o="cw"){let r=_ce(e,n),i=_ce(t,n);return Math.abs(i-r)<N2?{left:0,top:0,right:0,bottom:0}:function(s,a,c,l){let h=c.maxX-c.minX,d=c.maxY-c.minY;if(h<N2&&d<N2)return{left:0,top:0,right:0,bottom:0};let u=2*(h+d);if(u<N2)return{left:0,top:0,right:0,bottom:0};let _=h/u*(2*Math.PI),p=(h+d)/u*(2*Math.PI),m=(h+h+d)/u*(2*Math.PI),A=2*Math.PI,g=[{name:"top",start:0,end:_,length:h},{name:"right",start:_,end:p,length:d},{name:"bottom",start:p,end:m,length:h},{name:"left",start:m,end:A,length:d}],f={left:0,top:0,right:0,bottom:0},y=(x,C,b,I,v)=>{let P=C>2*Math.PI-N2?2*Math.PI:C;if(P<=x+N2)return 0;if(v){let M=Math.max(x,b),B=Math.min(P,2*Math.PI),T=Math.max(0,B-M),N=Math.max(x,0),D=Math.min(P,I);return T+Math.max(0,D-N)}{let M=Math.max(x,b),B=Math.min(P,I);return Math.max(0,B-M)}};for(let x of g){let C=x.end-x.start;if(C<N2||x.length<N2)continue;let b=0;if(l==="cw"){let I=s>a+N2;b=y(x.start,x.end,s,a,I)}else{let I=a>s+N2;b=y(x.start,x.end,a,s,I)}if(b>N2){let I=b/C;f[x.name]+=Math.max(0,Number.isFinite(I)?I:0)}}for(let x in f)f[x]=Math.max(0,Math.min(1,f[x]));return f}(r,i,n,o)}function _ce(e,t){let n=t.maxX-t.minX,o=t.maxY-t.minY;if(n<N2&&o<N2)return 0;let r=2*(n+o);if(r<N2)return 0;let i=0;if(Math.abs(e.y-t.maxY)<=eb&&e.x>=t.minX-eb&&e.x<=t.maxX+eb)i=Math.max(0,Math.min(n,e.x-t.minX));else if(Math.abs(e.x-t.maxX)<=eb&&e.y>=t.minY-eb&&e.y<=t.maxY+eb)i=n+Math.max(0,Math.min(o,t.maxY-e.y));else if(Math.abs(e.y-t.minY)<=eb&&e.x>=t.minX-eb&&e.x<=t.maxX+eb)i=n+o+Math.max(0,Math.min(n,t.maxX-e.x));else{if(!(Math.abs(e.x-t.minX)<=eb&&e.y>=t.minY-eb&&e.y<=t.maxY+eb))throw Error(`Point (${e.x}, ${e.y}) does not lie on the boundary defined by ${JSON.stringify(t)}`);i=n+o+n+Math.max(0,Math.min(o,e.y-t.minY))}return i=Math.max(0,Math.min(r,i)),r>N2?i/r*(2*Math.PI):0}function L_r(e,t,n,o){return function({angleA:r,angleB:i,angleC:s}){let a=Math.cos(r),c=Math.sin(r),l=Math.cos(i),h=Math.sin(i),d=Math.cos(s);return(l-a)*(Math.sin(s)-c)-(h-c)*(d-a)<0?"ccw":"cw"}({angleA:_ce(e,o),angleB:_ce(t,o),angleC:_ce(n,o)})}var H_r=class extends Kr{getSolverName(){return"SingleTransitionCrossingRouteSolver"}nodeWithPortPoints;routes;viaDiameter;traceThickness;obstacleMargin;layerCount=2;debugViaPositions;solvedRoutes=[];bounds;constructor(e){if(super(),this.nodeWithPortPoints=e.nodeWithPortPoints,this.viaDiameter=e?.viaDiameter??0.3,this.traceThickness=e?.traceThickness??0.15,this.obstacleMargin=e?.obstacleMargin??0.1,this.layerCount=e?.layerCount??2,this.debugViaPositions=[],this.routes=this.extractRoutesFromNode(),this.bounds=this.calculateBounds(),this.routes.length!==2)return this.failed=!0,void(this.error=`Expected 2 routes, but got ${this.routes.length}`);let t=this.routes.flatMap((s)=>[s.A,s.B]).map((s)=>this.getPortPointBoundsPosition(s));if(t.includes("outside"))return this.failed=!0,void(this.error="Invalid route input: SingleTransitionCrossingRouteSolver received port point(s) outside node bounds");if(t.includes("inside"))return void(this.failed=!0);this.routes=this.routes.map((s)=>({...s,A:this.snapPortPointToBounds(s.A),B:this.snapPortPointToBounds(s.B)}));let[n,o]=this.routes,r=n.A.z!==n.B.z,i=o.A.z!==o.B.z;return r&&i||!r&&!i?(this.failed=!0,void(this.error="Exactly one route must have a layer transition")):void 0}extractRoutesFromNode(){let e=[],t=this.nodeWithPortPoints.portPoints,n=new Map;for(let o of t){let{connectionName:r}=o;n.has(r)||n.set(r,[]),n.get(r)?.push(o)}for(let[o,r]of n.entries())r.length===2&&e.push({A:{...r[0],z:r[0].z??0},B:{...r[1],z:r[1].z??0},connectionName:o});return e}calculateBounds(){return{minX:this.nodeWithPortPoints.center.x-this.nodeWithPortPoints.width/2,maxX:this.nodeWithPortPoints.center.x+this.nodeWithPortPoints.width/2,minY:this.nodeWithPortPoints.center.y-this.nodeWithPortPoints.height/2,maxY:this.nodeWithPortPoints.center.y+this.nodeWithPortPoints.height/2}}getPortPointBoundsPosition(e){return MXt({point:e,bounds:this.bounds})}snapPortPointToBounds(e){let t=Mf(e.x,this.bounds.minX,this.bounds.maxX),n=Mf(e.y,this.bounds.minY,this.bounds.maxY);return[{distance:Math.abs(e.y-this.bounds.maxY),point:{...e,x:t,y:this.bounds.maxY}},{distance:Math.abs(e.x-this.bounds.maxX),point:{...e,x:this.bounds.maxX,y:n}},{distance:Math.abs(e.y-this.bounds.minY),point:{...e,x:t,y:this.bounds.minY}},{distance:Math.abs(e.x-this.bounds.minX),point:{...e,x:this.bounds.minX,y:n}}].reduce((o,r)=>r.distance<o.distance?r:o).point}doRoutesCross(e,t){return su(e.A,e.B,t.A,t.B)}calculateViaPosition(e,t){let n=t.A.z,o=e.A.z!==n?e.A:e.B,r=2*this.obstacleMargin+this.viaDiameter/2+this.traceThickness,i=this.obstacleMargin+this.viaDiameter/2,s=t.A,a=o,c=t.B,l=L_r(s,a,c,this.bounds),h=function(u,_,p,m,A){let g=qFt(u,_,m,A),f=qFt(_,p,m,A),y={left:Math.min(1,g.left+f.left),top:Math.min(1,g.top+f.top),right:Math.min(1,g.right+f.right),bottom:Math.min(1,g.bottom+f.bottom)};for(let x in y)Math.abs(y[x])<N2&&(y[x]=0);return y}(s,a,c,this.bounds,l),d={minX:this.bounds.minX+(h.left>0.5?r:i),minY:this.bounds.minY+(h.bottom>0.5?r:i),maxX:this.bounds.maxX-(h.right>0.5?r:i),maxY:this.bounds.maxY-(h.top>0.5?r:i)};return d.maxY<d.minY&&(d.minY=(d.minY+d.maxY)/2,d.maxY=d.minY),d.maxX<d.minX&&(d.minX=(d.minX+d.maxX)/2,d.maxX=d.minX),k_r(s,a,c,r,d)}createTransitionRoute(e,t,n,o){let r=[{x:e.x,y:e.y,z:e.z??0},{x:n.x,y:n.y,z:e.z??0},{x:n.x,y:n.y,z:t.z??0},{x:t.x,y:t.y,z:t.z??0}];return{connectionName:o,regionId:this.nodeWithPortPoints.capacityMeshNodeId,route:r,traceThickness:this.traceThickness,viaDiameter:this.viaDiameter,vias:[n]}}createFlatRoute(e,t,n,o,r,i){o.z,e.z;let s=this.viaDiameter/2+this.traceThickness/2+this.obstacleMargin,a=((A,g,f,y)=>{let x=f.x-A.x,C=f.y-A.y;return((b,I)=>({x:(b.x+I.x)/2,y:(b.y+I.y)/2}))({x:A.x+x*g,y:A.y+C*g},{x:f.x-x*y,y:f.y-C*y})})(n,this.viaDiameter,o.z!==e.z?o:r,this.traceThickness),c={center:{x:n.x,y:n.y},radius:s},l=dO(e,a,c).E,h=dO(a,t,c).E,d=dO(e,l,c).E,u=dO(l,a,c).E,_=dO(a,h,c).E,p=dO(h,t,c).E,m=dO(u,_,c).E;return{connectionName:i,regionId:this.nodeWithPortPoints.capacityMeshNodeId,route:[{x:e.x,y:e.y,z:e.z??0},{x:d.x,y:d.y,z:e.z??0},{x:l.x,y:l.y,z:e.z??0},{x:u.x,y:u.y,z:e.z??0},{x:m.x,y:m.y,z:e.z??0},{x:_.x,y:_.y,z:e.z??0},{x:h.x,y:h.y,z:e.z??0},{x:p.x,y:p.y,z:e.z??0},{x:t.x,y:t.y,z:t.z??0}],traceThickness:this.traceThickness,viaDiameter:this.viaDiameter,vias:[]}}trySolve(){let[e,t]=this.routes,n=e.A.z!==e.B.z,o=n?e:t,r=n?t:e,i=this.calculateViaPosition(o,r);if(!i)return!1;this.debugViaPositions.push({via:i});let s=this.createTransitionRoute(o.A,o.B,i,o.connectionName),a=this.createFlatRoute(r.A,r.B,i,o.A,o.B,r.connectionName);return this.solvedRoutes.push(s,a),!0}_step(){if(!this.doRoutesCross(this.routes[0],this.routes[1]))return this.failed=!0,void(this.error="Can only solve routes that have a single transition crossing");this.trySolve()?this.solved=!0:(this.failed=!0,this.error="Failed to find a valid via position and route path")}visualize(){let e={lines:[],points:[],rects:[],circles:[]};e.rects.push({center:{x:(this.bounds.minX+this.bounds.maxX)/2,y:(this.bounds.minY+this.bounds.maxY)/2},width:this.bounds.maxX-this.bounds.minX,height:this.bounds.maxY-this.bounds.minY,stroke:"rgba(0, 0, 0, 0.5)",fill:"rgba(240, 240, 240, 0.1)",label:"PCB Bounds"});for(let t of this.routes)e.points.push({x:t.A.x,y:t.A.y,label:`${t.connectionName} start (z=${t.A.z})`,color:"orange"}),e.points.push({x:t.B.x,y:t.B.y,label:`${t.connectionName} end (z=${t.B.z})`,color:"orange"}),e.lines.push({points:[t.A,t.B],strokeColor:"rgba(255, 0, 0, 0.5)",label:`${t.connectionName} direct`});for(let t=0;t<this.debugViaPositions.length;t++){let{via:n}=this.debugViaPositions[t];e.circles.push({center:n,radius:this.viaDiameter/2,fill:"rgba(255, 165, 0, 0.7)",stroke:"rgba(0, 0, 0, 0.5)",label:`Computed Via (attempt ${t+1})`});let o=this.viaDiameter/2+this.obstacleMargin;e.circles.push({center:n,radius:o,stroke:"rgba(255, 165, 0, 0.7)",fill:"rgba(0, 0, 0, 0)",label:"Safety Margin"})}for(let t=0;t<this.solvedRoutes.length;t++){let n=this.solvedRoutes[t],o=t%2==0?"rgba(0, 255, 0, 0.75)":"rgba(255, 0, 255, 0.75)";for(let r=0;r<n.route.length-1;r++){let i=n.route[r],s=n.route[r+1];e.lines.push({points:[i,s],strokeColor:o,strokeDash:i.z!==n.route[0].z?[0.2,0.2]:void 0,strokeWidth:n.traceThickness,label:`${n.connectionName} z=${i.z}`})}for(let r of n.vias)e.circles.push({center:r,radius:this.viaDiameter/2,fill:"rgba(0, 0, 255, 0.8)",stroke:"black",label:"Solved Via"}),e.circles.push({center:r,radius:this.viaDiameter/2+this.obstacleMargin,fill:"rgba(0, 0, 255, 0.3)",stroke:"black",label:"Via Margin"})}return e}getSolvedRoutes(){return this.solvedRoutes}};function F_r({A:e,B:t,C:n,D:o,E:r,F:i,radius:s,margin:a,subdivisions:c=0}){let l=(I,v)=>({x:(I.x+v.x)/2,y:(I.y+v.y)/2}),h=(I,v,P)=>{let M=v.x-I.x,B=v.y-I.y,T=Math.sqrt(M*M+B*B),N=M/T,D=B/T,L=-D,H=N;return{midpoint:{x:(I.x+v.x)/2,y:(I.y+v.y)/2},A_Opp:{x:I.x-N*P,y:I.y-D*P},A_Right:{x:I.x+L*P,y:I.y+H*P},A_Left:{x:I.x-L*P,y:I.y-H*P},B_Opp:{x:v.x+N*P,y:v.y+D*P},B_Right:{x:v.x+L*P,y:v.y+H*P},B_Left:{x:v.x-L*P,y:v.y-H*P}}},d=(I,v)=>{let P=Dn(I,v.start),M=Dn(I,v.end),B=Dn(v.start,v.end);return Math.abs(P+M-B)<0.0001},u=(I,v)=>{let{start:P,end:M}=I,{start:B,end:T}=v;if(d(P,v)||d(M,v)||d(B,I)||d(T,I))return!0;let N=M.x-P.x,D=M.y-P.y,L=T.x-B.x,H=T.y-B.y,V=N*H-D*L;if(Math.abs(V)<0.0001)return!1;let O=B.x-P.x,U=B.y-P.y,j=(O*H-U*L)/V,Y=(O*D-U*N)/V;return j>0&&j<1&&Y>0&&Y<1},_=(I,v)=>{let P=[];for(let B=0;B<I.length-1;B++)P.push({start:I[B],end:I[B+1]});let M=[];for(let B=0;B<v.length-1;B++)M.push({start:v[B],end:v[B+1]});for(let B of P)for(let T of M)if(u(B,T))return!0;return!1},p=(I)=>{let v=0;for(let P=1;P<I.length;P++){let M=I[P].x-I[P-1].x,B=I[P].y-I[P-1].y;v+=Math.sqrt(M*M+B*B)}return v},m=(I,v)=>{let{start:P,end:M}=I,B=M.x-P.x,T=M.y-P.y,N=B*B+T*T;if(N===0)return{...P,t:0};let D=Math.max(0,Math.min(1,((v.x-P.x)*B+(v.y-P.y)*T)/N));return{x:P.x+D*B,y:P.y+D*T,t:D}},A=(I,v,P)=>{let M=m(I,v);if(Dn(M,v)>=P)return M;let B=M.x-v.x,T=M.y-v.y,N=Math.sqrt(B*B+T*T);if(N===0){let D=I.end.x-I.start.x,L=I.end.y-I.start.y,H=Math.sqrt(D*D+L*L);return{x:v.x+P*D/H,y:v.y+P*L/H,t:M.t,isSpecial:!0,specialType:v===e?"A":"B"}}return{x:v.x+P*B/N,y:v.y+P*T/N,t:M.t,isSpecial:!0,specialType:v===e?"A":"B"}},g=h(e,t,s),f=h(e,t,s+a),y=(I,v,P,M,B)=>{let T=I.points;if(T.length<2)return T;let N=P+M,D=[T[0]];for(let L=0;L<T.length-1;L++){let H={start:T[L],end:T[L+1]};if(oc(v,H.start,H.end)<N){let V=m(H,v),O=V.x-v.x,U=V.y-v.y,j=Math.sqrt(O*O+U*U),Y=null;if(j>0.000001)Y={x:v.x+N*O/j,y:v.y+N*U/j};else{let X=H.end.x-H.start.x,K=H.end.y-H.start.y,J=Math.sqrt(X*X+K*K);J>0.000001&&(Y={x:v.x+N*X/J,y:v.y+N*K/J})}Y&&Dn(H.start,Y)>s/10&&D.push(Y)}Dn(D[D.length-1],H.end)>s/10&&D.push(H.end)}if(D.length>1){let L=[D[0]];for(let H=1;H<D.length;H++)Dn(L[L.length-1],D[H])>s/10&&L.push(D[H]);return L}return D},x=(()=>{let I=[[n,g.B_Left,g.B_Opp,g.B_Right,l(g.midpoint,l(g.B_Right,g.A_Right)),l(g.midpoint,l(g.A_Left,g.B_Left)),g.A_Left,g.A_Opp,g.A_Right,o],[n,g.B_Right,g.B_Opp,g.B_Left,l(g.midpoint,l(g.A_Left,g.B_Left)),l(g.midpoint,l(g.A_Right,g.B_Right)),g.A_Right,g.A_Opp,g.A_Left,o],[o,g.B_Left,g.B_Opp,g.B_Right,l(g.midpoint,l(g.A_Right,g.B_Right)),l(g.midpoint,l(g.A_Left,g.B_Left)),g.A_Left,g.A_Opp,g.A_Right,n],[o,g.B_Right,g.B_Opp,g.B_Left,l(g.midpoint,l(g.A_Left,g.B_Left)),l(g.midpoint,l(g.A_Right,g.B_Right)),g.A_Right,g.A_Opp,g.A_Left,n]],v=[];for(let U=0;U<I.length;U++){let j=I[U],Y={start:j[0],end:j[1]},X={start:j[j.length-2],end:j[j.length-1]},K={start:j[3],end:j[4]};u(Y,X)||u(Y,K)||u(X,K)||v.push({index:U+1,path:j,length:p(j)})}if(v.length===0)return{index:0,path:[]};let P=v.sort((U,j)=>U.length-j.length)[0],M=[...P.path],B=M[0],T=Dn(B,M[2]),N=Dn(B,M[3]),D=T<N?2:3;(T<Dn(B,M[1])||N<Dn(B,M[1]))&&M.splice(1,D-1);let L=M[M.length-1],H=Dn(L,M[M.length-3]),V=Dn(L,M[M.length-4]),O=H<V?M.length-3:M.length-4;return(H<Dn(L,M[M.length-2])||V<Dn(L,M[M.length-2]))&&M.splice(O+1,M.length-O-2),{index:P.index,path:M,startsAt:M[0]===n?"C":"D",goesTo:M[M.length-1]===n?"C":"D"}})(),C=c>0?((I,v)=>{if(I.length<2)return I;let P=[I[0]];for(let M=0;M<I.length-1;M++){let B={start:I[M],end:I[M+1]},T={x:(B.start.x+B.end.x)/2,y:(B.start.y+B.end.y)/2},N=Dn(T,e),D=Dn(T,t);if((N<=s||D<=s)&&Math.abs(N-D)>0.0001){let L=m(B,e),H=m(B,t),V=Dn(L,e),O=Dn(H,t)<s,U=V<s?A(B,e,s):null,j=O?A(B,t,s):null,Y=[];if(Dn(B.start,B.end)>s/2&&v>0)for(let X=1;X<=v;X++){let K=X/(v+1),J={x:B.start.x+K*(B.end.x-B.start.x),y:B.start.y+K*(B.end.y-B.start.y),t:K,isSpecial:!1},ee=Dn(J,e),se=Dn(J,t);ee<s||se<s||(U&&Math.abs(J.t-U.t)<0.1||j&&Math.abs(J.t-j.t)<0.1||Y.push(J))}if(U&&Y.push(U),j&&Y.push(j),Y.sort((X,K)=>X.t-K.t),Y.length>1){let X=[Y[0]];for(let K=1;K<Y.length;K++){let J=X[X.length-1],ee=Y[K];Dn(J,ee)>s/10&&X.push(ee)}Y=X}Y.forEach((X)=>P.push(X))}P.push(I[M+1])}if(P.length>1){let M=[P[0]];for(let B=1;B<P.length;B++){let T=M[M.length-1],N=P[B];Dn(T,N)>s/10&&M.push(N)}return M}return P})(x.path,c):x.path,b=(()=>{if(x.path.length===0)return null;let I=(()=>{let T=l(g.A_Right,g.B_Right),N=l(g.B_Left,g.A_Left);return[{startsAt:"E",goesTo:"B",points:[r,t]},{startsAt:"E",goesTo:"A",points:[r,e]},{startsAt:"F",goesTo:"B",points:[i,t]},{startsAt:"F",goesTo:"A",points:[i,e]},{startsAt:"E",goesTo:"B",points:[r,T,t]},{startsAt:"E",goesTo:"A",points:[r,T,e]},{startsAt:"F",goesTo:"B",points:[i,T,t]},{startsAt:"F",goesTo:"A",points:[i,T,e]},{startsAt:"E",goesTo:"B",points:[r,N,t]},{startsAt:"E",goesTo:"A",points:[r,N,e]},{startsAt:"F",goesTo:"B",points:[i,N,t]},{startsAt:"F",goesTo:"A",points:[i,N,e]},{startsAt:"E",goesTo:"B",points:[r,f.A_Right,T,t]},{startsAt:"F",goesTo:"B",points:[i,f.B_Right,T,t]},{startsAt:"E",goesTo:"A",points:[r,f.B_Left,N,e]},{startsAt:"F",goesTo:"A",points:[i,f.A_Left,N,e]},{startsAt:"E",goesTo:"B",points:[r,f.A_Left,N,t]},{startsAt:"E",goesTo:"A",points:[r,f.B_Right,T,e]},{startsAt:"E",goesTo:"B",points:[r,f.A_Opp,f.A_Right,T,t]},{startsAt:"E",goesTo:"A",points:[r,f.B_Opp,f.B_Left,N,e]},{startsAt:"F",goesTo:"B",points:[i,f.A_Opp,f.A_Left,N,t]},{startsAt:"F",goesTo:"A",points:[i,f.B_Opp,f.B_Right,T,e]},{startsAt:"F",goesTo:"A",points:[i,f.B_Opp,f.B_Left,N,e]},{startsAt:"E",goesTo:"B",points:[r,f.A_Opp,f.A_Left,N,t]},{startsAt:"E",goesTo:"A",points:[r,f.B_Opp,f.B_Right,T,e]},{startsAt:"E",goesTo:"B",points:[r,f.A_Left,f.A_Opp,f.A_Right,T,t]},{startsAt:"E",goesTo:"A",points:[r,f.B_Right,f.B_Opp,f.B_Left,N,e]},{startsAt:"F",goesTo:"B",points:[i,f.A_Right,f.A_Opp,f.A_Left,N,t]},{startsAt:"F",goesTo:"A",points:[i,f.B_Left,f.B_Opp,f.B_Right,T,e]},{startsAt:"F",goesTo:"A",points:[i,f.B_Right,f.B_Opp,f.B_Left,N,e]},{startsAt:"E",goesTo:"B",points:[r,f.A_Right,f.A_Opp,f.A_Left,N,t]},{startsAt:"E",goesTo:"A",points:[r,f.B_Left,f.B_Opp,f.B_Right,T,e]}].map((D,L)=>({...D,index:L}))})(),v=I.filter((T)=>T.startsAt==="E"),P=I.filter((T)=>T.startsAt==="F"),M=[],B=[];for(let T of v)if(!_(T.points,x.path)){M.push(T);break}for(let T of P)if(!_(T.points,x.path)){B.push(T);break}return M.length===0||B.length===0?null:{line1:M[0],line2:B[0]}})();if(b){let I=b.line1.goesTo==="A"?t:e,v=b.line2.goesTo==="A"?t:e,P=y(b.line1,I,s,a),M=y(b.line2,v,s,a);b={line1:{...b.line1,points:P},line2:{...b.line2,points:M}}}return{jPair:b,optimalPath:{startsAt:x.startsAt,goesTo:x.goesTo,points:C}}}var z_r=class extends Kr{getSolverName(){return"TwoCrossingRoutesHighDensitySolver"}nodeWithPortPoints;routes;viaDiameter;traceThickness;obstacleMargin;layerCount=2;debugViaPositions;escapeLayer=1;solvedRoutes=[];bounds;constructor(e){if(super(),this.nodeWithPortPoints=e.nodeWithPortPoints,this.viaDiameter=e?.viaDiameter??0.3,this.traceThickness=e?.traceThickness??0.15,this.obstacleMargin=e?.obstacleMargin??0.1,this.layerCount=e?.layerCount??2,this.debugViaPositions=[],this.routes=this.extractRoutesFromNode(),this.bounds=this.calculateBounds(),this.routes.length!==2)return this.failed=!0,void(this.error=`Expected 2 routes, but got ${this.routes.length}`);let[t,n]=this.routes;if(t.startPort.z!==t.endPort.z)return this.failed=!0,void(this.error="Route A must start and end on the same layer");if(n.startPort.z!==n.endPort.z)return this.failed=!0,void(this.error="Route B must start and end on the same layer");if(t.startPort.z!==n.startPort.z)return this.failed=!0,void(this.error="Both routes must be on the same layer");t.startPort.z===0?this.escapeLayer=1:this.escapeLayer=0}extractRoutesFromNode(){let e=[],t=this.nodeWithPortPoints.portPoints,n=new Map;for(let o of t){let{connectionName:r}=o;n.has(r)||n.set(r,[]),n.get(r)?.push(o)}for(let[o,r]of n.entries())r.length===2&&e.push({startPort:{...r[0],z:r[0].z??0},endPort:{...r[1],z:r[1].z??0},connectionName:o});return e}calculateBounds(){return{minX:this.nodeWithPortPoints.center.x-this.nodeWithPortPoints.width/2,maxX:this.nodeWithPortPoints.center.x+this.nodeWithPortPoints.width/2,minY:this.nodeWithPortPoints.center.y-this.nodeWithPortPoints.height/2,maxY:this.nodeWithPortPoints.center.y+this.nodeWithPortPoints.height/2}}doRoutesCross(e,t){return su(e.startPort,e.endPort,t.startPort,t.endPort)}calculateViaPositions(e,t){let n=this.bounds.maxX-this.bounds.minX,o=this.bounds.maxY-this.bounds.minY,r=this.bounds.minX,i=this.bounds.minY,s={width:n-2*this.obstacleMargin-this.viaDiameter,height:o-2*this.obstacleMargin-this.viaDiameter,x:r+this.obstacleMargin+this.viaDiameter/2,y:i+this.obstacleMargin+this.viaDiameter/2},a=this.viaDiameter+this.obstacleMargin,{startPort:c,endPort:l}=t,h=[{x:s.x,y:s.y},{x:s.x+s.width,y:s.y},{x:s.x+s.width,y:s.y+s.height},{x:s.x,y:s.y+s.height}],d=(y,x)=>Dn(y,x),u=[];h.forEach((y,x)=>{d(y,c)>=a&&d(y,l)>=a&&u.push({...y,type:"corner",index:x})});let _=[{p1:h[0],p2:h[1]},{p1:h[1],p2:h[2]},{p1:h[2],p2:h[3]},{p1:h[3],p2:h[0]}];if([c,l].forEach((y,x)=>{_.forEach((C,b)=>{((I,v)=>{let{x:P,y:M,r:B}=I,T=v.p1.x,N=v.p1.y,D=v.p2.x,L=v.p2.y;if(Math.abs(D-T)<0.001){let se=T,ne=B*B-(se-P)**2;if(ne<0)return[];if(Math.abs(ne)<0.001){let ie=M;return ie>=Math.min(N,L)&&ie<=Math.max(N,L)?[{x:se,y:ie}]:[]}let re=M+Math.sqrt(ne),Z=M-Math.sqrt(ne),te=[];return re>=Math.min(N,L)&&re<=Math.max(N,L)&&te.push({x:se,y:re}),Z>=Math.min(N,L)&&Z<=Math.max(N,L)&&te.push({x:se,y:Z}),te}let H=(L-N)/(D-T),V=N-H*T,O=1+H*H,U=2*(H*V-H*M-P),j=U*U-4*O*(P*P+(V-M)*(V-M)-B*B);if(j<0)return[];if(Math.abs(j)<0.001){let se=-U/(2*O),ne=H*se+V;return se>=Math.min(T,D)&&se<=Math.max(T,D)&&ne>=Math.min(N,L)&&ne<=Math.max(N,L)?[{x:se,y:ne}]:[]}let Y=(-U+Math.sqrt(j))/(2*O),X=(-U-Math.sqrt(j))/(2*O),K=H*Y+V,J=H*X+V,ee=[];return Y>=Math.min(T,D)&&Y<=Math.max(T,D)&&K>=Math.min(N,L)&&K<=Math.max(N,L)&&ee.push({x:Y,y:K}),X>=Math.min(T,D)&&X<=Math.max(T,D)&&J>=Math.min(N,L)&&J<=Math.max(N,L)&&ee.push({x:X,y:J}),ee})({...y,r:a},C).forEach((I)=>{d(I,x===0?l:c)>=a&&u.push({...I,type:"intersection",circle:x,edge:b})})})}),u.length<2){let y=0.8*a;if(h.forEach((x,C)=>{d(x,c)>=y&&d(x,l)>=y&&!u.some((b)=>b.x===x.x&&b.y===x.y)&&u.push({...x,type:"relaxed_corner",index:C})}),u.length<2){let x=[...h].sort((C,b)=>{let I=Math.min(d(C,c),d(C,l));return Math.min(d(b,c),d(b,l))-I});for(let C of x)if(!u.some((b)=>b.x===C.x&&b.y===C.y)&&(u.push({...C,type:"forced_corner"}),u.length>=2))break}}if(u.length<2)return null;let p=0,m=[u[0],u[u.length>1?1:0]];for(let y=0;y<u.length;y++)for(let x=y+1;x<u.length;x++){let C=d(u[y],u[x]);C>p&&(p=C,m=[u[y],u[x]])}let A={x:m[0].x,y:m[0].y},g={x:m[1].x,y:m[1].y},f=Dn(A,e.startPort);return Dn(g,e.startPort)<f&&([A,g]=[g,A]),{via1:A,via2:g}}trySolveAOverB(e,t,n=!1){let o=n?this.calculateViaPositions(e,t):this.calculateViaPositions(t,e);if(!o)return!1;this.debugViaPositions.push(o);let{via1:r,via2:i}=this.pushViasFromEndpoints(this.moveViasAsCloseAsPossible(o));this.debugViaPositions.push({via1:r,via2:i});let{jPair:s,optimalPath:a}=F_r({A:r,B:i,C:e.startPort,D:e.endPort,E:t.startPort,F:t.endPort,radius:this.viaDiameter/2+this.obstacleMargin+this.traceThickness/2*1.5,margin:2*this.obstacleMargin+this.traceThickness/2*1.5,subdivisions:1});if(!s)return!1;let c={connectionName:e.connectionName,regionId:this.nodeWithPortPoints.capacityMeshNodeId,route:a.points.map((h)=>({x:h.x,y:h.y,z:e.startPort.z??0})),traceThickness:this.traceThickness,viaDiameter:this.viaDiameter,vias:[]};s.line2.points.reverse();let l={connectionName:t.connectionName,regionId:this.nodeWithPortPoints.capacityMeshNodeId,route:[...s.line1.points.map((h)=>({x:h.x,y:h.y,z:t.startPort.z??0})),{...s.line1.points[s.line1.points.length-1],z:this.escapeLayer},{...s.line2.points[0],z:this.escapeLayer},...s.line2.points.map((h)=>({x:h.x,y:h.y,z:t.startPort.z??0}))],traceThickness:this.traceThickness,viaDiameter:this.viaDiameter,vias:[r,i]};return this.solvedRoutes.push(c,l),!0}pushViasFromEndpoints(e){let t={...e.via1},n={...e.via2},o=[this.routes[0].startPort,this.routes[0].endPort,this.routes[1].startPort,this.routes[1].endPort],r=this.getMinDistanceBetweenViaCenters(),i=this.viaDiameter/2+2*this.traceThickness+2*this.obstacleMargin;for(let a=0;a<10;a++){let c=!1,l=!1,h=0.9**a;for(let u of o){let _=Dn(t,u);if(_<i){let m=(i-_)*h,A=t.x-u.x,g=t.y-u.y,f=Math.sqrt(A*A+g*g);f>0.000001&&(t.x+=A/f*m,t.y+=g/f*m,c=!0)}let p=Dn(n,u);if(p<i){let m=(i-p)*h,A=n.x-u.x,g=n.y-u.y,f=Math.sqrt(A*A+g*g);f>0.000001&&(n.x+=A/f*m,n.y+=g/f*m,l=!0)}}let d=Dn(t,n);if(d<r){let u=(r-d)/2,_=n.x-t.x,p=n.y-t.y,m=Math.sqrt(_*_+p*p);m>0.000001?(t.x-=_/m*u,t.y-=p/m*u,n.x+=_/m*u,n.y+=p/m*u,c=!0,l=!0):(t.x-=u,n.x+=u,c=!0,l=!0)}if(!c&&!l)break}let s=Dn(t,n);if(s<r){let a=(r-s)/2,c=n.x-t.x,l=n.y-t.y,h=Math.sqrt(c*c+l*l);h>0.000001?(t.x-=c/h*a,t.y-=l/h*a,n.x+=c/h*a,n.y+=l/h*a):(t.x-=a,n.x+=a)}return{via1:t,via2:n}}getMinDistanceBetweenViaCenters(){return this.viaDiameter+this.traceThickness+2*this.obstacleMargin}moveViasAsCloseAsPossible(e){let{via1:t,via2:n}=e,o=this.getMinDistanceBetweenViaCenters(),r=Dn(t,n);if(r<=o)return e;let i=n.x-t.x,s=n.y-t.y,a=Math.sqrt(i*i+s*s),c=i/a,l=s/a,h=(t.x,n.x,t.y,n.y,(r-o)/2);return{via1:{x:t.x+c*h,y:t.y+l*h},via2:{x:n.x-c*h,y:n.y-l*h}}}handleRoutesDontCross(){let[e,t]=this.routes,n={connectionName:e.connectionName,regionId:this.nodeWithPortPoints.capacityMeshNodeId,route:[{x:e.startPort.x,y:e.startPort.y,z:e.startPort.z??0},{x:e.endPort.x,y:e.endPort.y,z:e.endPort.z??0}],traceThickness:this.traceThickness,viaDiameter:this.viaDiameter,vias:[]},o={connectionName:t.connectionName,regionId:this.nodeWithPortPoints.capacityMeshNodeId,route:[{x:t.startPort.x,y:t.startPort.y,z:t.startPort.z??0},{x:t.endPort.x,y:t.endPort.y,z:t.endPort.z??0}],traceThickness:this.traceThickness,viaDiameter:this.viaDiameter,vias:[]};this.solvedRoutes.push(n,o),this.solved=!0}_step(){if(this.routes.length!==2)return void(this.failed=!0);let[e,t]=this.routes;this.doRoutesCross(e,t)?this.trySolveAOverB(e,t)||this.trySolveAOverB(t,e)||this.trySolveAOverB(e,t,!0)||this.trySolveAOverB(t,e,!0)?this.solved=!0:(this.failed=!0,this.error="All crossover strategies failed"):this.handleRoutesDontCross()}visualize(){let e={lines:[],points:[],rects:[],circles:[]};e.rects.push({center:{x:(this.bounds.minX+this.bounds.maxX)/2,y:(this.bounds.minY+this.bounds.maxY)/2},width:this.bounds.maxX-this.bounds.minX,height:this.bounds.maxY-this.bounds.minY,stroke:"rgba(0, 0, 0, 0.5)",fill:"rgba(240, 240, 240, 0.1)"});for(let[t,n]of[["Route A",this.routes[0]],["Route B",this.routes[1]]])e.points.push({x:n.startPort.x,y:n.startPort.y,label:`${t}
${n.connectionName} start`,color:"orange"}),e.points.push({x:n.endPort.x,y:n.endPort.y,label:`${t}
${n.connectionName} end`,color:"orange"}),e.lines.push({points:[n.startPort,n.endPort],strokeColor:"rgba(255, 0, 0, 0.5)",label:`${t}
${n.connectionName} direct`});for(let t=0;t<this.debugViaPositions.length;t++){let{via1:n,via2:o}=this.debugViaPositions[t],r=["rgba(255, 165, 0, 0.3)","rgba(128, 0, 128, 0.3)"],i=r[t%r.length];e.circles.push({center:n,radius:this.viaDiameter/2,fill:i,stroke:"rgba(0, 0, 0, 0.3)",label:`Computed Via A (attempt ${t+1})`}),e.circles.push({center:o,radius:this.viaDiameter/2,fill:i,stroke:"rgba(0, 0, 0, 0.3)",label:`Computed Via B (attempt ${t+1})`});let s=this.viaDiameter/2+this.obstacleMargin;e.circles.push({center:n,radius:s,stroke:i,fill:"rgba(0, 0, 0, 0)",label:`Debug Via 1 Safety Margin (attempt ${t+1})`}),e.circles.push({center:o,radius:s,stroke:i,fill:"rgba(0, 0, 0, 0)",label:`Debug Via 2 Safety Margin (attempt ${t+1})`}),e.lines.push({points:[this.routes[t%2].startPort,n,o,this.routes[t%2].endPort],strokeColor:`${i.substring(0,i.lastIndexOf(","))}, 0.3)`,strokeDash:[5,5],label:`Potential Route (attempt ${t+1})`})}for(let t=0;t<this.solvedRoutes.length;t++){let n=this.solvedRoutes[t],o=t%2==0?"rgba(0, 255, 0, 0.75)":"rgba(255, 0, 255, 0.75)";for(let r=0;r<n.route.length-1;r++){let i=n.route[r],s=n.route[r+1];e.lines.push({points:[i,s],strokeColor:o,strokeDash:i.z===1?[0.2,0.2]:void 0,strokeWidth:n.traceThickness,label:`${n.connectionName} z=${i.z}`}),i._label&&e.points.push({x:i.x,y:i.y,label:i._label})}for(let r of n.vias)e.circles.push({center:r,radius:this.viaDiameter/2,fill:"rgba(0, 0, 255, 0.8)",stroke:"black",label:"Solved Via"}),e.circles.push({center:r,radius:this.viaDiameter/2+this.obstacleMargin,fill:"rgba(0, 0, 255, 0.3)",stroke:"black",label:"Solved Via Margin"})}return e}getSolvedRoutes(){return this.solvedRoutes}},kbe=class extends Kr{getSolverName(){return"HyperParameterSupervisorSolver"}GREEDY_MULTIPLIER=1.2;MIN_SUBSTEPS=1;supervisedSolvers;winningSolver;getHyperParameterDefs(){throw Error("Not implemented")}getCombinationDefs(){return null}getHyperParameterCombinations(e){e||(e=this.getHyperParameterDefs());let t=[];if(e.length===0)return[{}];let[n,...o]=e,r=this.getHyperParameterCombinations(o);return n.possibleValues.forEach((i)=>{r.forEach((s)=>{t.push({...s,...i})})}),t}initializeSolvers(){let e=this.getHyperParameterDefs(),t=this.getCombinationDefs()??[e.map((n)=>n.name)];this.supervisedSolvers=[];for(let n of t){let o=this.getHyperParameterCombinations(e.filter((r)=>n.includes(r.name)));for(let r of o){let i=this.generateSolver(r),s=this.computeG(i);this.supervisedSolvers.push({hyperParameters:r,solver:i,h:0,g:s,f:s})}}}generateSolver(e){throw Error("Not implemented")}computeG(e){return e.iterations/e.MAX_ITERATIONS}computeH(e){return 1-(e.progress||0)}computeF(e,t){return e+t*this.GREEDY_MULTIPLIER}getSupervisedSolverWithBestFitness(){let e=1/0,t=null;for(let n of this.supervisedSolvers??[]){if(n.solver.solved)return n;if(n.solver.failed)continue;let o=n.f;o<e&&(e=o,t=n)}return t}getFailureMessage(){return`All solvers failed in hyper solver. Example failures: ${this.supervisedSolvers?.sort((e,t)=>t.f-e.f)?.slice(0,5).map((e)=>e.solver.error).join(", ")}`}_step(){this.supervisedSolvers||this.initializeSolvers();let e=this.getSupervisedSolverWithBestFitness();if(!e)return this.failed=!0,void(this.error=this.getFailureMessage());for(let t=0;t<this.MIN_SUBSTEPS;t++)e.solver.step();this.activeSubSolver=e.solver,e.g=this.computeG(e.solver),e.h=this.computeH(e.solver),e.f=this.computeF(e.g,e.h),e.solver.solved&&(this.solved=!0,this.winningSolver=e.solver,this.onSolve?.(e))}onSolve(e){}visualize(){let e=this.getSupervisedSolverWithBestFitness(),t={lines:[],circles:[],points:[],rects:[]};return e&&(t=e.solver.visualize()),t}};function tV(e,t,n){let o=t.z!==n.z&&e.allowBlindAndBuriedVias!==!0;return{minZ:o?0:Math.min(t.z,n.z),maxZ:o?e.layerCount-1:Math.max(t.z,n.z)}}var O_r=class{values=[];positions;constructor(e){if(e===void 0)this.positions=new Map;else{if(!Number.isSafeInteger(e)||e<=0)throw Error("repair04: dense path queue requires a positive grid size");let t=new Int32Array(e);this.positions={get:(n)=>t[n]===0?void 0:t[n]-1,set:(n,o)=>{t[n]=o+1},delete:(n)=>{t[n]=0}}}}get length(){return this.values.length}push(e){let t=this.positions.get(e.id);if(t===void 0)t=this.values.length,this.values.push(e);else if(e.priority>this.values[t].priority)throw Error("repair04: queued path priorities may only decrease");for(;t>0;){let n=Math.floor((t-1)/2),o=this.values[n];if(o.priority<=e.priority)break;this.values[t]=o,this.positions.set(o.id,t),t=n}this.values[t]=e,this.positions.set(e.id,t)}pop(){let e=this.values[0];if(!e)throw Error("repair04: cannot pop an empty path queue");let t=this.values.pop();if(this.positions.delete(e.id),this.values.length){let n=0;for(;2*n+1<this.values.length;){let o=2*n+1;o+1<this.values.length&&this.values[o+1].priority<this.values[o].priority&&o++;let r=this.values[o];if(r.priority>=t.priority)break;this.values[n]=r,this.positions.set(r.id,n),n=o}this.values[n]=t,this.positions.set(t.id,n)}return e}},v$e=(e,t)=>{let n=[];for(let o=0;o<e.route.length;o+=1){let r=e.route[o];if(r.route_type!=="via"){n.push(structuredClone(r));continue}let i=n[n.length-1],s=e.route[o+1],a=i?.route_type==="wire"?i.width:s?.route_type==="wire"?s.width:t,c=s?.route_type==="wire"?s.width:a;i?.route_type==="wire"&&i.x===r.x&&i.y===r.y&&i.layer===r.from_layer||n.push({route_type:"wire",x:r.x,y:r.y,layer:r.from_layer,width:a}),n.push(structuredClone(r)),s?.route_type==="wire"&&s.x===r.x&&s.y===r.y&&s.layer===r.to_layer||n.push({route_type:"wire",x:r.x,y:r.y,layer:r.to_layer,width:c})}return{...structuredClone(e),route:n}};function S$e(e,t,n){return Math.max(n?0:t,e.defaultObstacleMargin??0,e.minViaEdgeToPadEdgeClearance??0)}var pr=0.00000001,sy=(e,t,n=0)=>e.x>=t.minX+n-pr&&e.x<=t.maxX-n+pr&&e.y>=t.minY+n-pr&&e.y<=t.maxY-n+pr,Cw=(e,t,n)=>{let o=0,r=1;for(let[i,s,a,c]of[[e.x,t.x-e.x,n.minX,n.maxX],[e.y,t.y-e.y,n.minY,n.maxY]]){if(i===void 0||s===void 0||a===void 0||c===void 0)throw Error("Invalid segment clipping axis");if(Math.abs(s)<=pr){if(i<a-pr||i>c+pr)return;continue}let l=(a-i)/s,h=(c-i)/s;if(o=Math.max(o,Math.min(l,h)),r=Math.min(r,Math.max(l,h)),r<o-pr)return}return[Math.max(0,o),Math.min(1,r)]},T$=(e,t,n)=>{if(n<=pr)return structuredClone(e);if(n>=0.99999999)return structuredClone(t);let o={...structuredClone(e),x:e.x+(t.x-e.x)*n,y:e.y+(t.y-e.y)*n};return delete o.pcb_port_id,o},lb=(e,t)=>Math.abs(e.x-t.x)<=pr&&Math.abs(e.y-t.y)<=pr&&e.z===t.z,rl=(e)=>Array.isArray(e)?`[${e.map(rl).join(",")}]`:e!==null&&typeof e=="object"?`{${Object.keys(e).filter((t)=>e[t]!==void 0).sort().map((t)=>`${JSON.stringify(t)}:${rl(e[t])}`).join(",")}}`:JSON.stringify(e)??"undefined",uje=(e,t,n)=>{if(e.route.length===1)return structuredClone(e.route);let o=(i)=>{let s=Math.min(Math.floor(i),e.route.length-2);return T$(e.route[s],e.route[s+1],i-s)},r=[o(t)];for(let i=Math.floor(t)+1;i<n-pr;i+=1)r.push(structuredClone(e.route[i]));return n>t+pr&&r.push(o(n)),r},wXt=(e,t,n)=>{let o=uje(e,t,n),r=Object.fromEntries(Object.entries(e).filter(([s])=>s!=="route"&&s!=="vias")),i=e.vias.filter((s)=>o.some((a)=>Math.hypot(a.x-s.x,a.y-s.y)<=pr));return rl({metadata:r,points:o,vias:i})},vCe={};wbe(vCe,{all_layers:()=>Sjt,any_circuit_element:()=>eqt,any_soup_element:()=>NCe,any_source_component:()=>gjt,asset:()=>WXt,base_circuit_json_error:()=>$l,battery_capacity:()=>UXt,brep_shape:()=>aKt,cadModelDefaultDirectionMap:()=>PAr,cad_component:()=>z$t,cad_model_axis_directions:()=>F$t,cad_model_formats:()=>SAr,capacitance:()=>M$e,circuit_json_footprint_load_error:()=>m$t,current:()=>eq,distance:()=>Wn,duration_ms:()=>Ele,experiment_type:()=>X$t,external_footprint_load_error:()=>p$t,frequency:()=>xV,getZodPrefixedIdWithDefault:()=>po,inductance:()=>YXt,kicadAt:()=>Hbe,kicadEffects:()=>XXt,kicadFont:()=>B$e,kicadFootprintAttributes:()=>KXt,kicadFootprintMetadata:()=>JXt,kicadFootprintModel:()=>qXt,kicadFootprintPad:()=>$Xt,kicadFootprintProperties:()=>jXt,kicadProperty:()=>Wae,kicadSymbolEffects:()=>tjt,kicadSymbolMetadata:()=>ojt,kicadSymbolPinNames:()=>ejt,kicadSymbolPinNumbers:()=>ZXt,kicadSymbolProperties:()=>njt,kicadSymbolProperty:()=>GR,layer_ref:()=>pc,layer_string:()=>Aje,length:()=>sr,manufacturing_drc_properties:()=>hKt,ms:()=>rV,ninePointAnchor:()=>Qw,pcbRenderLayer:()=>Jgr,pcb_autorouting_error:()=>g$t,pcb_board:()=>kKt,pcb_breakout_point:()=>x$t,pcb_component:()=>dKt,pcb_component_invalid_layer_error:()=>B$t,pcb_component_not_on_board_edge_error:()=>w$t,pcb_component_outside_board_error:()=>M$t,pcb_connector_not_in_accessible_orientation_warning:()=>f$t,pcb_copper_pour:()=>E$t,pcb_copper_pour_brep:()=>S$t,pcb_copper_pour_polygon:()=>P$t,pcb_copper_pour_rect:()=>v$t,pcb_copper_text:()=>GKt,pcb_courtyard_circle:()=>H$t,pcb_courtyard_outline:()=>k$t,pcb_courtyard_overlap_error:()=>i$t,pcb_courtyard_polygon:()=>L$t,pcb_courtyard_rect:()=>Q$t,pcb_cutout:()=>d$t,pcb_cutout_circle:()=>c$t,pcb_cutout_path:()=>h$t,pcb_cutout_polygon:()=>l$t,pcb_cutout_rect:()=>a$t,pcb_fabrication_note_dimension:()=>JKt,pcb_fabrication_note_path:()=>$Kt,pcb_fabrication_note_rect:()=>qKt,pcb_fabrication_note_text:()=>KKt,pcb_footprint_overlap_error:()=>r$t,pcb_ground_plane:()=>C$t,pcb_ground_plane_region:()=>b$t,pcb_group:()=>_$t,pcb_hole:()=>fKt,pcb_hole_circle_or_square_shape:()=>iAr,pcb_hole_circle_shape:()=>oAr,pcb_hole_oval_shape:()=>sAr,pcb_hole_pill_shape:()=>aAr,pcb_hole_rect_shape:()=>rAr,pcb_hole_rotated_pill_shape:()=>cAr,pcb_keepout:()=>s$t,pcb_manual_edit_conflict_warning:()=>A$t,pcb_missing_footprint_error:()=>u$t,pcb_net:()=>RKt,pcb_note_dimension:()=>o$t,pcb_note_line:()=>n$t,pcb_note_path:()=>t$t,pcb_note_rect:()=>e$t,pcb_note_text:()=>ZKt,pcb_pad_pad_clearance_error:()=>N$t,pcb_pad_trace_clearance_error:()=>R$t,pcb_panel:()=>LKt,pcb_panelization_placement_error:()=>FKt,pcb_placement_error:()=>HKt,pcb_plated_hole:()=>yKt,pcb_port:()=>xKt,pcb_port_not_connected_error:()=>NKt,pcb_port_not_matched_error:()=>DKt,pcb_route_hint:()=>cKt,pcb_route_hints:()=>nAr,pcb_silkscreen_circle:()=>WKt,pcb_silkscreen_line:()=>OKt,pcb_silkscreen_oval:()=>XKt,pcb_silkscreen_path:()=>VKt,pcb_silkscreen_pill:()=>jKt,pcb_silkscreen_rect:()=>UKt,pcb_silkscreen_text:()=>YKt,pcb_smtpad:()=>bKt,pcb_smtpad_pill:()=>CKt,pcb_solder_paste:()=>IKt,pcb_text:()=>vKt,pcb_thermal_spoke:()=>I$t,pcb_trace:()=>MKt,pcb_trace_error:()=>BKt,pcb_trace_hint:()=>zKt,pcb_trace_missing_error:()=>TKt,pcb_trace_route_point:()=>EKt,pcb_trace_route_point_via:()=>PKt,pcb_trace_route_point_wire:()=>SKt,pcb_trace_warning:()=>wKt,pcb_via:()=>QKt,pcb_via_clearance_error:()=>T$t,pcb_via_trace_clearance_error:()=>D$t,point:()=>Wr,point3:()=>_w,point_with_bulge:()=>sKt,port_arrangement:()=>Ljt,position:()=>$gr,position3:()=>qgr,resistance:()=>Lbe,ring:()=>fje,rotation:()=>_m,route_hint_point:()=>lKt,schematic_arc:()=>Yjt,schematic_box:()=>Djt,schematic_circle:()=>Vjt,schematic_component:()=>Hjt,schematic_component_port_arrangement_by_sides:()=>kjt,schematic_component_port_arrangement_by_size:()=>Qjt,schematic_debug_line:()=>qjt,schematic_debug_object:()=>Zjt,schematic_debug_object_base:()=>zbe,schematic_debug_point:()=>Jjt,schematic_debug_rect:()=>$jt,schematic_error:()=>jjt,schematic_group:()=>nKt,schematic_layout_error:()=>Kjt,schematic_line:()=>zjt,schematic_manual_edit_conflict_warning:()=>tKt,schematic_net_label:()=>Xjt,schematic_path:()=>Njt,schematic_pin_styles:()=>Rjt,schematic_port:()=>Wjt,schematic_rect:()=>Ojt,schematic_sheet:()=>iKt,schematic_symbol:()=>Fjt,schematic_table:()=>oKt,schematic_table_cell:()=>rKt,schematic_text:()=>Ujt,schematic_trace:()=>Gjt,schematic_voltage_probe:()=>eKt,simulation_ac_current_source:()=>U$t,simulation_ac_voltage_source:()=>V$t,simulation_current_source:()=>W$t,simulation_dc_current_source:()=>G$t,simulation_dc_voltage_source:()=>O$t,simulation_experiment:()=>j$t,simulation_op_amp:()=>Z$t,simulation_switch:()=>$$t,simulation_transient_voltage_graph:()=>K$t,simulation_unknown_experiment_error:()=>J$t,simulation_voltage_probe:()=>q$t,simulation_voltage_source:()=>Y$t,size:()=>w$e,source_ambiguous_port_reference:()=>Ijt,source_board:()=>bjt,source_component_base:()=>Bd,source_component_internal_connection:()=>fjt,source_component_pins_underspecified_warning:()=>wjt,source_failed_to_create_component_error:()=>djt,source_group:()=>xjt,source_i2c_misconfigured_error:()=>eqe,source_interconnect:()=>mjt,source_invalid_component_property_error:()=>$$e,source_manually_placed_via:()=>Pjt,source_missing_manufacturer_part_number_warning:()=>Z$e,source_missing_property_error:()=>hjt,source_net:()=>Cjt,source_no_ground_pin_defined_warning:()=>Mjt,source_no_power_pin_defined_warning:()=>Ejt,source_pcb_ground_plane:()=>vjt,source_pin_attributes:()=>ajt,source_pin_missing_trace_warning:()=>J$e,source_pin_must_be_connected_error:()=>Bjt,source_port:()=>Ajt,source_project_metadata:()=>K$e,source_property_ignored_warning:()=>ujt,source_simple_battery:()=>L$e,source_simple_capacitor:()=>D$e,source_simple_chip:()=>Q$e,source_simple_connector:()=>ljt,source_simple_crystal:()=>cjt,source_simple_current_source:()=>sjt,source_simple_diode:()=>Fbe,source_simple_fiducial:()=>rjt,source_simple_ground:()=>ijt,source_simple_inductor:()=>H$e,source_simple_led:()=>R$e,source_simple_mosfet:()=>W$e,source_simple_op_amp:()=>X$e,source_simple_pin_header:()=>O$e,source_simple_pinout:()=>V$e,source_simple_potentiometer:()=>z$e,source_simple_power_source:()=>k$e,source_simple_push_button:()=>F$e,source_simple_resistor:()=>N$e,source_simple_resonator:()=>Y$e,source_simple_switch:()=>j$e,source_simple_test_point:()=>U$e,source_simple_transistor:()=>G$e,source_simple_voltage_probe:()=>pjt,source_simple_voltage_source:()=>_jt,source_trace:()=>yjt,source_trace_not_connected_error:()=>q$e,supplier_footprint_mismatch_warning:()=>y$t,supplier_name:()=>T$e,time:()=>Kgr,timestamp:()=>GXt,unknown_error_finding_part:()=>Tjt,visible_layer:()=>wf,voltage:()=>Ew,wave_shape:()=>nqe});var il,Bx,cWe,E={};wbe(E,{BRAND:()=>dgr,DIRTY:()=>ECe,EMPTY_PATH:()=>G_r,INVALID:()=>ds,NEVER:()=>jgr,OK:()=>my,ParseStatus:()=>Ox,Schema:()=>ja,ZodAny:()=>J$,ZodArray:()=>oV,ZodBigInt:()=>Fce,ZodBoolean:()=>zce,ZodBranded:()=>P$e,ZodCatch:()=>$ce,ZodDate:()=>Oce,ZodDefault:()=>Kce,ZodDiscriminatedUnion:()=>RXt,ZodEffects:()=>s9,ZodEnum:()=>Ple,ZodError:()=>c9,ZodFirstPartyTypeKind:()=>xs,ZodFunction:()=>kXt,ZodIntersection:()=>Uce,ZodIssueCode:()=>zo,ZodLazy:()=>Wce,ZodLiteral:()=>Xce,ZodMap:()=>BCe,ZodNaN:()=>DCe,ZodNativeEnum:()=>jce,ZodNever:()=>bw,ZodNull:()=>Yce,ZodNullable:()=>fQ,ZodNumber:()=>Hce,ZodObject:()=>hb,ZodOptional:()=>eS,ZodParsedType:()=>Yr,ZodPipeline:()=>E$e,ZodPromise:()=>Z$,ZodReadonly:()=>qce,ZodRecord:()=>QXt,ZodSchema:()=>ja,ZodSet:()=>TCe,ZodString:()=>q$,ZodSymbol:()=>MCe,ZodTransformer:()=>s9,ZodTuple:()=>AQ,ZodType:()=>ja,ZodUndefined:()=>Vce,ZodUnion:()=>Gce,ZodUnknown:()=>YO,ZodVoid:()=>wCe,addIssueToContext:()=>vr,any:()=>xgr,array:()=>vgr,bigint:()=>_gr,boolean:()=>OXt,coerce:()=>Xgr,custom:()=>HXt,date:()=>ggr,datetimeRegex:()=>NXt,defaultErrorMap:()=>$$,discriminatedUnion:()=>Mgr,effect:()=>tzt,enum:()=>Lgr,function:()=>Rgr,getErrorMap:()=>SCe,getParsedType:()=>hw,instanceof:()=>pgr,intersection:()=>wgr,isAborted:()=>pje,isAsync:()=>Lce,isDirty:()=>mje,isValid:()=>nV,late:()=>ugr,lazy:()=>Qgr,literal:()=>kgr,makeIssue:()=>PCe,map:()=>Dgr,nan:()=>mgr,nativeEnum:()=>Hgr,never:()=>bgr,null:()=>ygr,nullable:()=>Ogr,number:()=>zXt,object:()=>Sgr,objectUtil:()=>cWe,oboolean:()=>Wgr,onumber:()=>Ugr,optional:()=>zgr,ostring:()=>Ggr,pipeline:()=>Ygr,preprocess:()=>Vgr,promise:()=>Fgr,quotelessJson:()=>V_r,record:()=>Tgr,set:()=>Ngr,setErrorMap:()=>Y_r,strictObject:()=>Pgr,string:()=>FXt,symbol:()=>Agr,transformer:()=>tzt,tuple:()=>Bgr,undefined:()=>fgr,union:()=>Egr,unknown:()=>Cgr,util:()=>il,void:()=>Igr}),(Bx=il||(il={})).assertEqual=(e)=>{},Bx.assertIs=function(e){},Bx.assertNever=function(e){throw Error()},Bx.arrayToEnum=(e)=>{let t={};for(let n of e)t[n]=n;return t},Bx.getValidEnumValues=(e)=>{let t=Bx.objectKeys(e).filter((o)=>typeof e[e[o]]!="number"),n={};for(let o of t)n[o]=e[o];return Bx.objectValues(n)},Bx.objectValues=(e)=>Bx.objectKeys(e).map(function(t){return e[t]}),Bx.objectKeys=typeof Object.keys=="function"?(e)=>Object.keys(e):(e)=>{let t=[];for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.push(n);return t},Bx.find=(e,t)=>{for(let n of e)if(t(n))return n},Bx.isInteger=typeof Number.isInteger=="function"?(e)=>Number.isInteger(e):(e)=>typeof e=="number"&&Number.isFinite(e)&&Math.floor(e)===e,Bx.joinValues=function(e,t=" | "){return e.map((n)=>typeof n=="string"?`'${n}'`:n).join(t)},Bx.jsonStringifyReplacer=(e,t)=>typeof t=="bigint"?t.toString():t,(cWe||(cWe={})).mergeShapes=(e,t)=>({...e,...t});var Yr=il.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),hw=(e)=>{switch(typeof e){case"undefined":return Yr.undefined;case"string":return Yr.string;case"number":return Number.isNaN(e)?Yr.nan:Yr.number;case"boolean":return Yr.boolean;case"function":return Yr.function;case"bigint":return Yr.bigint;case"symbol":return Yr.symbol;case"object":return Array.isArray(e)?Yr.array:e===null?Yr.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?Yr.promise:typeof Map<"u"&&e instanceof Map?Yr.map:typeof Set<"u"&&e instanceof Set?Yr.set:typeof Date<"u"&&e instanceof Date?Yr.date:Yr.object;default:return Yr.unknown}},zo=il.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),V_r=(e)=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),c9=class e extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=(o)=>{this.issues=[...this.issues,o]},this.addIssues=(o=[])=>{this.issues=[...this.issues,...o]};let n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=t}format(t){let n=t||function(i){return i.message},o={_errors:[]},r=(i)=>{for(let s of i.issues)if(s.code==="invalid_union")s.unionErrors.map(r);else if(s.code==="invalid_return_type")r(s.returnTypeError);else if(s.code==="invalid_arguments")r(s.argumentsError);else if(s.path.length===0)o._errors.push(n(s));else{let a=o,c=0;for(;c<s.path.length;){let l=s.path[c];c===s.path.length-1?(a[l]=a[l]||{_errors:[]},a[l]._errors.push(n(s))):a[l]=a[l]||{_errors:[]},a=a[l],c++}}};return r(this),o}static assert(t){if(!(t instanceof e))throw Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,il.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=(n)=>n.message){let n={},o=[];for(let r of this.issues)if(r.path.length>0){let i=r.path[0];n[i]=n[i]||[],n[i].push(t(r))}else o.push(t(r));return{formErrors:o,fieldErrors:n}}get formErrors(){return this.flatten()}};c9.create=(e)=>new c9(e);var $$=(e,t)=>{let n;switch(e.code){case zo.invalid_type:n=e.received===Yr.undefined?"Required":`Expected ${e.expected}, received ${e.received}`;break;case zo.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,il.jsonStringifyReplacer)}`;break;case zo.unrecognized_keys:n=`Unrecognized key(s) in object: ${il.joinValues(e.keys,", ")}`;break;case zo.invalid_union:n="Invalid input";break;case zo.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${il.joinValues(e.options)}`;break;case zo.invalid_enum_value:n=`Invalid enum value. Expected ${il.joinValues(e.options)}, received '${e.received}'`;break;case zo.invalid_arguments:n="Invalid function arguments";break;case zo.invalid_return_type:n="Invalid function return type";break;case zo.invalid_date:n="Invalid date";break;case zo.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):("startsWith"in e.validation)?n=`Invalid input: must start with "${e.validation.startsWith}"`:("endsWith"in e.validation)?n=`Invalid input: must end with "${e.validation.endsWith}"`:il.assertNever(e.validation):n=e.validation!=="regex"?`Invalid ${e.validation}`:"Invalid";break;case zo.too_small:n=e.type==="array"?`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"||e.type==="bigint"?`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:"Invalid input";break;case zo.too_big:n=e.type==="array"?`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:"Invalid input";break;case zo.custom:n="Invalid input";break;case zo.invalid_intersection_types:n="Intersection results could not be merged";break;case zo.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case zo.not_finite:n="Number must be finite";break;default:n=t.defaultError,il.assertNever(e)}return{message:n}},BXt=$$;function Y_r(e){BXt=e}function SCe(){return BXt}var PCe=(e)=>{let{data:t,path:n,errorMaps:o,issueData:r}=e,i=[...n,...r.path||[]],s={...r,path:i};if(r.message!==void 0)return{...r,path:i,message:r.message};let a="",c=o.filter((l)=>!!l).slice().reverse();for(let l of c)a=l(s,{data:t,defaultError:a}).message;return{...r,path:i,message:a}},G_r=[];function vr(e,t){let n=SCe(),o=PCe({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===$$?void 0:$$].filter((r)=>!!r)});e.common.issues.push(o)}var fi,JFt,Ox=class e{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,n){let o=[];for(let r of n){if(r.status==="aborted")return ds;r.status==="dirty"&&t.dirty(),o.push(r.value)}return{status:t.value,value:o}}static async mergeObjectAsync(t,n){let o=[];for(let r of n){let i=await r.key,s=await r.value;o.push({key:i,value:s})}return e.mergeObjectSync(t,o)}static mergeObjectSync(t,n){let o={};for(let r of n){let{key:i,value:s}=r;if(i.status==="aborted")return ds;if(s.status==="aborted")return ds;i.status==="dirty"&&t.dirty(),s.status==="dirty"&&t.dirty(),i.value==="__proto__"||s.value===void 0&&!r.alwaysSet||(o[i.value]=s.value)}return{status:t.value,value:o}}},ds=Object.freeze({status:"aborted"}),ECe=(e)=>({status:"dirty",value:e}),my=(e)=>({status:"valid",value:e}),pje=(e)=>e.status==="aborted",mje=(e)=>e.status==="dirty",nV=(e)=>e.status==="valid",Lce=(e)=>typeof Promise<"u"&&e instanceof Promise;(JFt=fi||(fi={})).errToObj=(e)=>typeof e=="string"?{message:e}:e||{},JFt.toString=(e)=>typeof e=="string"?e:e?.message;var aS=class{constructor(e,t,n,o){this._cachedPath=[],this.parent=e,this.data=t,this._path=n,this._key=o}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},ZFt=(e,t)=>{if(nV(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let n=new c9(e.common.issues);return this._error=n,this._error}}};function Ta(e){if(!e)return{};let{errorMap:t,invalid_type_error:n,required_error:o,description:r}=e;if(t&&(n||o))throw Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);if(t)return{errorMap:t,description:r};return{errorMap:(i,s)=>{let{message:a}=e;return i.code==="invalid_enum_value"?{message:a??s.defaultError}:s.data===void 0?{message:a??o??s.defaultError}:i.code!=="invalid_type"?{message:s.defaultError}:{message:a??n??s.defaultError}},description:r}}var lWe,ja=class{get description(){return this._def.description}_getType(e){return hw(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:hw(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Ox,ctx:{common:e.parent.common,data:e.data,parsedType:hw(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let t=this._parse(e);if(Lce(t))throw Error("Synchronous parse encountered promise.");return t}_parseAsync(e){let t=this._parse(e);return Promise.resolve(t)}parse(e,t){let n=this.safeParse(e,t);if(n.success)return n.data;throw n.error}safeParse(e,t){let n={common:{issues:[],async:t?.async??!1,contextualErrorMap:t?.errorMap},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:hw(e)},o=this._parseSync({data:e,path:n.path,parent:n});return ZFt(n,o)}"~validate"(e){let t={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:hw(e)};if(!this["~standard"].async)try{let n=this._parseSync({data:e,path:[],parent:t});return nV(n)?{value:n.value}:{issues:t.common.issues}}catch(n){n?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then((n)=>nV(n)?{value:n.value}:{issues:t.common.issues})}async parseAsync(e,t){let n=await this.safeParseAsync(e,t);if(n.success)return n.data;throw n.error}async safeParseAsync(e,t){let n={common:{issues:[],contextualErrorMap:t?.errorMap,async:!0},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:hw(e)},o=this._parse({data:e,path:n.path,parent:n}),r=await(Lce(o)?o:Promise.resolve(o));return ZFt(n,r)}refine(e,t){let n=(o)=>typeof t=="string"||t===void 0?{message:t}:typeof t=="function"?t(o):t;return this._refinement((o,r)=>{let i=e(o),s=()=>r.addIssue({code:zo.custom,...n(o)});return typeof Promise<"u"&&i instanceof Promise?i.then((a)=>!!a||(s(),!1)):!!i||(s(),!1)})}refinement(e,t){return this._refinement((n,o)=>!!e(n)||(o.addIssue(typeof t=="function"?t(n,o):t),!1))}_refinement(e){return new s9({schema:this,typeName:xs.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:(t)=>this["~validate"](t)}}optional(){return eS.create(this,this._def)}nullable(){return fQ.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return oV.create(this)}promise(){return Z$.create(this,this._def)}or(e){return Gce.create([this,e],this._def)}and(e){return Uce.create(this,e,this._def)}transform(e){return new s9({...Ta(this._def),schema:this,typeName:xs.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let t=typeof e=="function"?e:()=>e;return new Kce({...Ta(this._def),innerType:this,defaultValue:t,typeName:xs.ZodDefault})}brand(){return new P$e({typeName:xs.ZodBranded,type:this,...Ta(this._def)})}catch(e){let t=typeof e=="function"?e:()=>e;return new $ce({...Ta(this._def),innerType:this,catchValue:t,typeName:xs.ZodCatch})}describe(e){return new this.constructor({...this._def,description:e})}pipe(e){return E$e.create(this,e)}readonly(){return qce.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},U_r=/^c[^\s-]{8,}$/i,W_r=/^[0-9a-z]+$/,X_r=/^[0-9A-HJKMNP-TV-Z]{26}$/i,j_r=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,K_r=/^[a-z0-9_-]{21}$/i,$_r=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,q_r=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,J_r=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Z_r=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,egr=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,tgr=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,ngr=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,ogr=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,rgr=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,TXt="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",igr=new RegExp(`^${TXt}$`);function DXt(e){let t="[0-5]\\d";return e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`),`([01]\\d|2[0-3]):[0-5]\\d(:${t})${e.precision?"+":"?"}`}function sgr(e){return new RegExp(`^${DXt(e)}$`)}function NXt(e){let t=`${TXt}T${DXt(e)}`,n=[];return n.push(e.local?"Z?":"Z"),e.offset&&n.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${n.join("|")})`,new RegExp(`^${t}$`)}function agr(e,t){return!(t!=="v4"&&t||!Z_r.test(e))||!(t!=="v6"&&t||!tgr.test(e))}function cgr(e,t){if(!$_r.test(e))return!1;try{let[n]=e.split(".");if(!n)return!1;let o=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),r=JSON.parse(atob(o));return typeof r=="object"&&r!==null&&((!("typ"in r)||r?.typ==="JWT")&&(!!r.alg&&(!t||r.alg===t)))}catch{return!1}}function lgr(e,t){return!(t!=="v4"&&t||!egr.test(e))||!(t!=="v6"&&t||!ngr.test(e))}var q$=class e extends ja{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==Yr.string){let r=this._getOrReturnCtx(t);return vr(r,{code:zo.invalid_type,expected:Yr.string,received:r.parsedType}),ds}let n=new Ox,o;for(let r of this._def.checks)if(r.kind==="min")t.data.length<r.value&&(o=this._getOrReturnCtx(t,o),vr(o,{code:zo.too_small,minimum:r.value,type:"string",inclusive:!0,exact:!1,message:r.message}),n.dirty());else if(r.kind==="max")t.data.length>r.value&&(o=this._getOrReturnCtx(t,o),vr(o,{code:zo.too_big,maximum:r.value,type:"string",inclusive:!0,exact:!1,message:r.message}),n.dirty());else if(r.kind==="length"){let i=t.data.length>r.value,s=t.data.length<r.value;(i||s)&&(o=this._getOrReturnCtx(t,o),i?vr(o,{code:zo.too_big,maximum:r.value,type:"string",inclusive:!0,exact:!0,message:r.message}):s&&vr(o,{code:zo.too_small,minimum:r.value,type:"string",inclusive:!0,exact:!0,message:r.message}),n.dirty())}else if(r.kind==="email")J_r.test(t.data)||(o=this._getOrReturnCtx(t,o),vr(o,{validation:"email",code:zo.invalid_string,message:r.message}),n.dirty());else if(r.kind==="emoji")lWe||(lWe=new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),lWe.test(t.data)||(o=this._getOrReturnCtx(t,o),vr(o,{validation:"emoji",code:zo.invalid_string,message:r.message}),n.dirty());else if(r.kind==="uuid")j_r.test(t.data)||(o=this._getOrReturnCtx(t,o),vr(o,{validation:"uuid",code:zo.invalid_string,message:r.message}),n.dirty());else if(r.kind==="nanoid")K_r.test(t.data)||(o=this._getOrReturnCtx(t,o),vr(o,{validation:"nanoid",code:zo.invalid_string,message:r.message}),n.dirty());else if(r.kind==="cuid")U_r.test(t.data)||(o=this._getOrReturnCtx(t,o),vr(o,{validation:"cuid",code:zo.invalid_string,message:r.message}),n.dirty());else if(r.kind==="cuid2")W_r.test(t.data)||(o=this._getOrReturnCtx(t,o),vr(o,{validation:"cuid2",code:zo.invalid_string,message:r.message}),n.dirty());else if(r.kind==="ulid")X_r.test(t.data)||(o=this._getOrReturnCtx(t,o),vr(o,{validation:"ulid",code:zo.invalid_string,message:r.message}),n.dirty());else if(r.kind==="url")try{new URL(t.data)}catch{o=this._getOrReturnCtx(t,o),vr(o,{validation:"url",code:zo.invalid_string,message:r.message}),n.dirty()}else if(r.kind==="regex")r.regex.lastIndex=0,r.regex.test(t.data)||(o=this._getOrReturnCtx(t,o),vr(o,{validation:"regex",code:zo.invalid_string,message:r.message}),n.dirty());else if(r.kind==="trim")t.data=t.data.trim();else if(r.kind==="includes")t.data.includes(r.value,r.position)||(o=this._getOrReturnCtx(t,o),vr(o,{code:zo.invalid_string,validation:{includes:r.value,position:r.position},message:r.message}),n.dirty());else if(r.kind==="toLowerCase")t.data=t.data.toLowerCase();else if(r.kind==="toUpperCase")t.data=t.data.toUpperCase();else if(r.kind==="startsWith")t.data.startsWith(r.value)||(o=this._getOrReturnCtx(t,o),vr(o,{code:zo.invalid_string,validation:{startsWith:r.value},message:r.message}),n.dirty());else if(r.kind==="endsWith")t.data.endsWith(r.value)||(o=this._getOrReturnCtx(t,o),vr(o,{code:zo.invalid_string,validation:{endsWith:r.value},message:r.message}),n.dirty());else if(r.kind==="datetime")NXt(r).test(t.data)||(o=this._getOrReturnCtx(t,o),vr(o,{code:zo.invalid_string,validation:"datetime",message:r.message}),n.dirty());else if(r.kind==="date")igr.test(t.data)||(o=this._getOrReturnCtx(t,o),vr(o,{code:zo.invalid_string,validation:"date",message:r.message}),n.dirty());else if(r.kind==="time")sgr(r).test(t.data)||(o=this._getOrReturnCtx(t,o),vr(o,{code:zo.invalid_string,validation:"time",message:r.message}),n.dirty());else r.kind==="duration"?q_r.test(t.data)||(o=this._getOrReturnCtx(t,o),vr(o,{validation:"duration",code:zo.invalid_string,message:r.message}),n.dirty()):r.kind==="ip"?agr(t.data,r.version)||(o=this._getOrReturnCtx(t,o),vr(o,{validation:"ip",code:zo.invalid_string,message:r.message}),n.dirty()):r.kind==="jwt"?cgr(t.data,r.alg)||(o=this._getOrReturnCtx(t,o),vr(o,{validation:"jwt",code:zo.invalid_string,message:r.message}),n.dirty()):r.kind==="cidr"?lgr(t.data,r.version)||(o=this._getOrReturnCtx(t,o),vr(o,{validation:"cidr",code:zo.invalid_string,message:r.message}),n.dirty()):r.kind==="base64"?ogr.test(t.data)||(o=this._getOrReturnCtx(t,o),vr(o,{validation:"base64",code:zo.invalid_string,message:r.message}),n.dirty()):r.kind==="base64url"?rgr.test(t.data)||(o=this._getOrReturnCtx(t,o),vr(o,{validation:"base64url",code:zo.invalid_string,message:r.message}),n.dirty()):il.assertNever(r);return{status:n.value,value:t.data}}_regex(t,n,o){return this.refinement((r)=>t.test(r),{validation:n,code:zo.invalid_string,...fi.errToObj(o)})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...fi.errToObj(t)})}url(t){return this._addCheck({kind:"url",...fi.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...fi.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...fi.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...fi.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...fi.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...fi.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...fi.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...fi.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...fi.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...fi.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...fi.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...fi.errToObj(t)})}datetime(t){return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:t?.precision===void 0?null:t?.precision,offset:t?.offset??!1,local:t?.local??!1,...fi.errToObj(t?.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:t?.precision===void 0?null:t?.precision,...fi.errToObj(t?.message)})}duration(t){return this._addCheck({kind:"duration",...fi.errToObj(t)})}regex(t,n){return this._addCheck({kind:"regex",regex:t,...fi.errToObj(n)})}includes(t,n){return this._addCheck({kind:"includes",value:t,position:n?.position,...fi.errToObj(n?.message)})}startsWith(t,n){return this._addCheck({kind:"startsWith",value:t,...fi.errToObj(n)})}endsWith(t,n){return this._addCheck({kind:"endsWith",value:t,...fi.errToObj(n)})}min(t,n){return this._addCheck({kind:"min",value:t,...fi.errToObj(n)})}max(t,n){return this._addCheck({kind:"max",value:t,...fi.errToObj(n)})}length(t,n){return this._addCheck({kind:"length",value:t,...fi.errToObj(n)})}nonempty(t){return this.min(1,fi.errToObj(t))}trim(){return new e({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new e({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new e({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find((t)=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find((t)=>t.kind==="date")}get isTime(){return!!this._def.checks.find((t)=>t.kind==="time")}get isDuration(){return!!this._def.checks.find((t)=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find((t)=>t.kind==="email")}get isURL(){return!!this._def.checks.find((t)=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find((t)=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find((t)=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find((t)=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find((t)=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find((t)=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find((t)=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find((t)=>t.kind==="ip")}get isCIDR(){return!!this._def.checks.find((t)=>t.kind==="cidr")}get isBase64(){return!!this._def.checks.find((t)=>t.kind==="base64")}get isBase64url(){return!!this._def.checks.find((t)=>t.kind==="base64url")}get minLength(){let t=null;for(let n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxLength(){let t=null;for(let n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}};function hgr(e,t){let n=(e.toString().split(".")[1]||"").length,o=(t.toString().split(".")[1]||"").length,r=n>o?n:o;return Number.parseInt(e.toFixed(r).replace(".",""))%Number.parseInt(t.toFixed(r).replace(".",""))/10**r}q$.create=(e)=>new q$({checks:[],typeName:xs.ZodString,coerce:e?.coerce??!1,...Ta(e)});var Hce=class e extends ja{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==Yr.number){let r=this._getOrReturnCtx(t);return vr(r,{code:zo.invalid_type,expected:Yr.number,received:r.parsedType}),ds}let n,o=new Ox;for(let r of this._def.checks)if(r.kind==="int")il.isInteger(t.data)||(n=this._getOrReturnCtx(t,n),vr(n,{code:zo.invalid_type,expected:"integer",received:"float",message:r.message}),o.dirty());else if(r.kind==="min")(r.inclusive?t.data<r.value:t.data<=r.value)&&(n=this._getOrReturnCtx(t,n),vr(n,{code:zo.too_small,minimum:r.value,type:"number",inclusive:r.inclusive,exact:!1,message:r.message}),o.dirty());else if(r.kind==="max")(r.inclusive?t.data>r.value:t.data>=r.value)&&(n=this._getOrReturnCtx(t,n),vr(n,{code:zo.too_big,maximum:r.value,type:"number",inclusive:r.inclusive,exact:!1,message:r.message}),o.dirty());else r.kind==="multipleOf"?hgr(t.data,r.value)!==0&&(n=this._getOrReturnCtx(t,n),vr(n,{code:zo.not_multiple_of,multipleOf:r.value,message:r.message}),o.dirty()):r.kind==="finite"?Number.isFinite(t.data)||(n=this._getOrReturnCtx(t,n),vr(n,{code:zo.not_finite,message:r.message}),o.dirty()):il.assertNever(r);return{status:o.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,fi.toString(n))}gt(t,n){return this.setLimit("min",t,!1,fi.toString(n))}lte(t,n){return this.setLimit("max",t,!0,fi.toString(n))}lt(t,n){return this.setLimit("max",t,!1,fi.toString(n))}setLimit(t,n,o,r){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:o,message:fi.toString(r)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:fi.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:fi.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:fi.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:fi.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:fi.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:fi.toString(n)})}finite(t){return this._addCheck({kind:"finite",message:fi.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:fi.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:fi.toString(t)})}get minValue(){let t=null;for(let n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(let n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}get isInt(){return!!this._def.checks.find((t)=>t.kind==="int"||t.kind==="multipleOf"&&il.isInteger(t.value))}get isFinite(){let t=null,n=null;for(let o of this._def.checks){if(o.kind==="finite"||o.kind==="int"||o.kind==="multipleOf")return!0;o.kind==="min"?(n===null||o.value>n)&&(n=o.value):o.kind==="max"&&(t===null||o.value<t)&&(t=o.value)}return Number.isFinite(n)&&Number.isFinite(t)}};Hce.create=(e)=>new Hce({checks:[],typeName:xs.ZodNumber,coerce:e?.coerce||!1,...Ta(e)});var Fce=class e extends ja{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}if(this._getType(t)!==Yr.bigint)return this._getInvalidInput(t);let n,o=new Ox;for(let r of this._def.checks)if(r.kind==="min")(r.inclusive?t.data<r.value:t.data<=r.value)&&(n=this._getOrReturnCtx(t,n),vr(n,{code:zo.too_small,type:"bigint",minimum:r.value,inclusive:r.inclusive,message:r.message}),o.dirty());else if(r.kind==="max")(r.inclusive?t.data>r.value:t.data>=r.value)&&(n=this._getOrReturnCtx(t,n),vr(n,{code:zo.too_big,type:"bigint",maximum:r.value,inclusive:r.inclusive,message:r.message}),o.dirty());else r.kind==="multipleOf"?t.data%r.value!==BigInt(0)&&(n=this._getOrReturnCtx(t,n),vr(n,{code:zo.not_multiple_of,multipleOf:r.value,message:r.message}),o.dirty()):il.assertNever(r);return{status:o.value,value:t.data}}_getInvalidInput(t){let n=this._getOrReturnCtx(t);return vr(n,{code:zo.invalid_type,expected:Yr.bigint,received:n.parsedType}),ds}gte(t,n){return this.setLimit("min",t,!0,fi.toString(n))}gt(t,n){return this.setLimit("min",t,!1,fi.toString(n))}lte(t,n){return this.setLimit("max",t,!0,fi.toString(n))}lt(t,n){return this.setLimit("max",t,!1,fi.toString(n))}setLimit(t,n,o,r){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:o,message:fi.toString(r)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:fi.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:fi.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:fi.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:fi.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:fi.toString(n)})}get minValue(){let t=null;for(let n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(let n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}};Fce.create=(e)=>new Fce({checks:[],typeName:xs.ZodBigInt,coerce:e?.coerce??!1,...Ta(e)});var zce=class extends ja{_parse(e){if(this._def.coerce&&(e.data=Boolean(e.data)),this._getType(e)!==Yr.boolean){let t=this._getOrReturnCtx(e);return vr(t,{code:zo.invalid_type,expected:Yr.boolean,received:t.parsedType}),ds}return my(e.data)}};zce.create=(e)=>new zce({typeName:xs.ZodBoolean,coerce:e?.coerce||!1,...Ta(e)});var Oce=class e extends ja{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==Yr.date){let r=this._getOrReturnCtx(t);return vr(r,{code:zo.invalid_type,expected:Yr.date,received:r.parsedType}),ds}if(Number.isNaN(t.data.getTime()))return vr(this._getOrReturnCtx(t),{code:zo.invalid_date}),ds;let n=new Ox,o;for(let r of this._def.checks)r.kind==="min"?t.data.getTime()<r.value&&(o=this._getOrReturnCtx(t,o),vr(o,{code:zo.too_small,message:r.message,inclusive:!0,exact:!1,minimum:r.value,type:"date"}),n.dirty()):r.kind==="max"?t.data.getTime()>r.value&&(o=this._getOrReturnCtx(t,o),vr(o,{code:zo.too_big,message:r.message,inclusive:!0,exact:!1,maximum:r.value,type:"date"}),n.dirty()):il.assertNever(r);return{status:n.value,value:new Date(t.data.getTime())}}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}min(t,n){return this._addCheck({kind:"min",value:t.getTime(),message:fi.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:fi.toString(n)})}get minDate(){let t=null;for(let n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(let n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t!=null?new Date(t):null}};Oce.create=(e)=>new Oce({checks:[],coerce:e?.coerce||!1,typeName:xs.ZodDate,...Ta(e)});var MCe=class extends ja{_parse(e){if(this._getType(e)!==Yr.symbol){let t=this._getOrReturnCtx(e);return vr(t,{code:zo.invalid_type,expected:Yr.symbol,received:t.parsedType}),ds}return my(e.data)}};MCe.create=(e)=>new MCe({typeName:xs.ZodSymbol,...Ta(e)});var Vce=class extends ja{_parse(e){if(this._getType(e)!==Yr.undefined){let t=this._getOrReturnCtx(e);return vr(t,{code:zo.invalid_type,expected:Yr.undefined,received:t.parsedType}),ds}return my(e.data)}};Vce.create=(e)=>new Vce({typeName:xs.ZodUndefined,...Ta(e)});var Yce=class extends ja{_parse(e){if(this._getType(e)!==Yr.null){let t=this._getOrReturnCtx(e);return vr(t,{code:zo.invalid_type,expected:Yr.null,received:t.parsedType}),ds}return my(e.data)}};Yce.create=(e)=>new Yce({typeName:xs.ZodNull,...Ta(e)});var J$=class extends ja{constructor(){super(...arguments),this._any=!0}_parse(e){return my(e.data)}};J$.create=(e)=>new J$({typeName:xs.ZodAny,...Ta(e)});var YO=class extends ja{constructor(){super(...arguments),this._unknown=!0}_parse(e){return my(e.data)}};YO.create=(e)=>new YO({typeName:xs.ZodUnknown,...Ta(e)});var bw=class extends ja{_parse(e){let t=this._getOrReturnCtx(e);return vr(t,{code:zo.invalid_type,expected:Yr.never,received:t.parsedType}),ds}};bw.create=(e)=>new bw({typeName:xs.ZodNever,...Ta(e)});var wCe=class extends ja{_parse(e){if(this._getType(e)!==Yr.undefined){let t=this._getOrReturnCtx(e);return vr(t,{code:zo.invalid_type,expected:Yr.void,received:t.parsedType}),ds}return my(e.data)}};wCe.create=(e)=>new wCe({typeName:xs.ZodVoid,...Ta(e)});var oV=class e extends ja{_parse(t){let{ctx:n,status:o}=this._processInputParams(t),r=this._def;if(n.parsedType!==Yr.array)return vr(n,{code:zo.invalid_type,expected:Yr.array,received:n.parsedType}),ds;if(r.exactLength!==null){let s=n.data.length>r.exactLength.value,a=n.data.length<r.exactLength.value;(s||a)&&(vr(n,{code:s?zo.too_big:zo.too_small,minimum:a?r.exactLength.value:void 0,maximum:s?r.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:r.exactLength.message}),o.dirty())}if(r.minLength!==null&&n.data.length<r.minLength.value&&(vr(n,{code:zo.too_small,minimum:r.minLength.value,type:"array",inclusive:!0,exact:!1,message:r.minLength.message}),o.dirty()),r.maxLength!==null&&n.data.length>r.maxLength.value&&(vr(n,{code:zo.too_big,maximum:r.maxLength.value,type:"array",inclusive:!0,exact:!1,message:r.maxLength.message}),o.dirty()),n.common.async)return Promise.all([...n.data].map((s,a)=>r.type._parseAsync(new aS(n,s,n.path,a)))).then((s)=>Ox.mergeArray(o,s));let i=[...n.data].map((s,a)=>r.type._parseSync(new aS(n,s,n.path,a)));return Ox.mergeArray(o,i)}get element(){return this._def.type}min(t,n){return new e({...this._def,minLength:{value:t,message:fi.toString(n)}})}max(t,n){return new e({...this._def,maxLength:{value:t,message:fi.toString(n)}})}length(t,n){return new e({...this._def,exactLength:{value:t,message:fi.toString(n)}})}nonempty(t){return this.min(1,t)}};function n$(e){if(e instanceof hb){let t={};for(let n in e.shape){let o=e.shape[n];t[n]=eS.create(n$(o))}return new hb({...e._def,shape:()=>t})}return e instanceof oV?new oV({...e._def,type:n$(e.element)}):e instanceof eS?eS.create(n$(e.unwrap())):e instanceof fQ?fQ.create(n$(e.unwrap())):e instanceof AQ?AQ.create(e.items.map((t)=>n$(t))):e}oV.create=(e,t)=>new oV({type:e,minLength:null,maxLength:null,exactLength:null,typeName:xs.ZodArray,...Ta(t)});var hb=class e extends ja{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let t=this._def.shape(),n=il.objectKeys(t);return this._cached={shape:t,keys:n},this._cached}_parse(t){if(this._getType(t)!==Yr.object){let c=this._getOrReturnCtx(t);return vr(c,{code:zo.invalid_type,expected:Yr.object,received:c.parsedType}),ds}let{status:n,ctx:o}=this._processInputParams(t),{shape:r,keys:i}=this._getCached(),s=[];if(!(this._def.catchall instanceof bw&&this._def.unknownKeys==="strip"))for(let c in o.data)i.includes(c)||s.push(c);let a=[];for(let c of i){let l=r[c],h=o.data[c];a.push({key:{status:"valid",value:c},value:l._parse(new aS(o,h,o.path,c)),alwaysSet:c in o.data})}if(this._def.catchall instanceof bw){let c=this._def.unknownKeys;if(c==="passthrough")for(let l of s)a.push({key:{status:"valid",value:l},value:{status:"valid",value:o.data[l]}});else if(c==="strict")s.length>0&&(vr(o,{code:zo.unrecognized_keys,keys:s}),n.dirty());else if(c!=="strip")throw Error("Internal ZodObject error: invalid unknownKeys value.")}else{let c=this._def.catchall;for(let l of s){let h=o.data[l];a.push({key:{status:"valid",value:l},value:c._parse(new aS(o,h,o.path,l)),alwaysSet:l in o.data})}}return o.common.async?Promise.resolve().then(async()=>{let c=[];for(let l of a){let h=await l.key,d=await l.value;c.push({key:h,value:d,alwaysSet:l.alwaysSet})}return c}).then((c)=>Ox.mergeObjectSync(n,c)):Ox.mergeObjectSync(n,a)}get shape(){return this._def.shape()}strict(t){return fi.errToObj,new e({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(n,o)=>{let r=this._def.errorMap?.(n,o).message??o.defaultError;return n.code==="unrecognized_keys"?{message:fi.errToObj(t).message??r}:{message:r}}}:{}})}strip(){return new e({...this._def,unknownKeys:"strip"})}passthrough(){return new e({...this._def,unknownKeys:"passthrough"})}extend(t){return new e({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new e({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:xs.ZodObject})}setKey(t,n){return this.augment({[t]:n})}catchall(t){return new e({...this._def,catchall:t})}pick(t){let n={};for(let o of il.objectKeys(t))t[o]&&this.shape[o]&&(n[o]=this.shape[o]);return new e({...this._def,shape:()=>n})}omit(t){let n={};for(let o of il.objectKeys(this.shape))t[o]||(n[o]=this.shape[o]);return new e({...this._def,shape:()=>n})}deepPartial(){return n$(this)}partial(t){let n={};for(let o of il.objectKeys(this.shape)){let r=this.shape[o];t&&!t[o]?n[o]=r:n[o]=r.optional()}return new e({...this._def,shape:()=>n})}required(t){let n={};for(let o of il.objectKeys(this.shape))if(t&&!t[o])n[o]=this.shape[o];else{let r=this.shape[o];for(;r instanceof eS;)r=r._def.innerType;n[o]=r}return new e({...this._def,shape:()=>n})}keyof(){return LXt(il.objectKeys(this.shape))}};hb.create=(e,t)=>new hb({shape:()=>e,unknownKeys:"strip",catchall:bw.create(),typeName:xs.ZodObject,...Ta(t)}),hb.strictCreate=(e,t)=>new hb({shape:()=>e,unknownKeys:"strict",catchall:bw.create(),typeName:xs.ZodObject,...Ta(t)}),hb.lazycreate=(e,t)=>new hb({shape:e,unknownKeys:"strip",catchall:bw.create(),typeName:xs.ZodObject,...Ta(t)});var Gce=class extends ja{_parse(e){let{ctx:t}=this._processInputParams(e),n=this._def.options;if(t.common.async)return Promise.all(n.map(async(o)=>{let r={...t,common:{...t.common,issues:[]},parent:null};return{result:await o._parseAsync({data:t.data,path:t.path,parent:r}),ctx:r}})).then(function(o){for(let i of o)if(i.result.status==="valid")return i.result;for(let i of o)if(i.result.status==="dirty")return t.common.issues.push(...i.ctx.common.issues),i.result;let r=o.map((i)=>new c9(i.ctx.common.issues));return vr(t,{code:zo.invalid_union,unionErrors:r}),ds});{let o,r=[];for(let s of n){let a={...t,common:{...t.common,issues:[]},parent:null},c=s._parseSync({data:t.data,path:t.path,parent:a});if(c.status==="valid")return c;c.status!=="dirty"||o||(o={result:c,ctx:a}),a.common.issues.length&&r.push(a.common.issues)}if(o)return t.common.issues.push(...o.ctx.common.issues),o.result;let i=r.map((s)=>new c9(s));return vr(t,{code:zo.invalid_union,unionErrors:i}),ds}}get options(){return this._def.options}};Gce.create=(e,t)=>new Gce({options:e,typeName:xs.ZodUnion,...Ta(t)});var YR=(e)=>e instanceof Wce?YR(e.schema):e instanceof s9?YR(e.innerType()):e instanceof Xce?[e.value]:e instanceof Ple?e.options:e instanceof jce?il.objectValues(e.enum):e instanceof Kce?YR(e._def.innerType):e instanceof Vce?[void 0]:e instanceof Yce?[null]:e instanceof eS?[void 0,...YR(e.unwrap())]:e instanceof fQ?[null,...YR(e.unwrap())]:e instanceof P$e||e instanceof qce?YR(e.unwrap()):e instanceof $ce?YR(e._def.innerType):[],RXt=class e extends ja{_parse(t){let{ctx:n}=this._processInputParams(t);if(n.parsedType!==Yr.object)return vr(n,{code:zo.invalid_type,expected:Yr.object,received:n.parsedType}),ds;let o=this.discriminator,r=n.data[o],i=this.optionsMap.get(r);return i?n.common.async?i._parseAsync({data:n.data,path:n.path,parent:n}):i._parseSync({data:n.data,path:n.path,parent:n}):(vr(n,{code:zo.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[o]}),ds)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,n,o){let r=new Map;for(let i of n){let s=YR(i.shape[t]);if(!s.length)throw Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(let a of s){if(r.has(a))throw Error(`Discriminator property ${String(t)} has duplicate value ${String(a)}`);r.set(a,i)}}return new e({typeName:xs.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:r,...Ta(o)})}};function _je(e,t){let n=hw(e),o=hw(t);if(e===t)return{valid:!0,data:e};if(n===Yr.object&&o===Yr.object){let r=il.objectKeys(t),i=il.objectKeys(e).filter((a)=>r.indexOf(a)!==-1),s={...e,...t};for(let a of i){let c=_je(e[a],t[a]);if(!c.valid)return{valid:!1};s[a]=c.data}return{valid:!0,data:s}}if(n===Yr.array&&o===Yr.array){if(e.length!==t.length)return{valid:!1};let r=[];for(let i=0;i<e.length;i++){let s=_je(e[i],t[i]);if(!s.valid)return{valid:!1};r.push(s.data)}return{valid:!0,data:r}}return n===Yr.date&&o===Yr.date&&+e===+t?{valid:!0,data:e}:{valid:!1}}var Uce=class extends ja{_parse(e){let{status:t,ctx:n}=this._processInputParams(e),o=(r,i)=>{if(pje(r)||pje(i))return ds;let s=_je(r.value,i.value);return s.valid?((mje(r)||mje(i))&&t.dirty(),{status:t.value,value:s.data}):(vr(n,{code:zo.invalid_intersection_types}),ds)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([r,i])=>o(r,i)):o(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};Uce.create=(e,t,n)=>new Uce({left:e,right:t,typeName:xs.ZodIntersection,...Ta(n)});var AQ=class e extends ja{_parse(t){let{status:n,ctx:o}=this._processInputParams(t);if(o.parsedType!==Yr.array)return vr(o,{code:zo.invalid_type,expected:Yr.array,received:o.parsedType}),ds;if(o.data.length<this._def.items.length)return vr(o,{code:zo.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),ds;!this._def.rest&&o.data.length>this._def.items.length&&(vr(o,{code:zo.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());let r=[...o.data].map((i,s)=>{let a=this._def.items[s]||this._def.rest;return a?a._parse(new aS(o,i,o.path,s)):null}).filter((i)=>!!i);return o.common.async?Promise.all(r).then((i)=>Ox.mergeArray(n,i)):Ox.mergeArray(n,r)}get items(){return this._def.items}rest(t){return new e({...this._def,rest:t})}};AQ.create=(e,t)=>{if(!Array.isArray(e))throw Error("You must pass an array of schemas to z.tuple([ ... ])");return new AQ({items:e,typeName:xs.ZodTuple,rest:null,...Ta(t)})};var QXt=class e extends ja{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:n,ctx:o}=this._processInputParams(t);if(o.parsedType!==Yr.object)return vr(o,{code:zo.invalid_type,expected:Yr.object,received:o.parsedType}),ds;let r=[],i=this._def.keyType,s=this._def.valueType;for(let a in o.data)r.push({key:i._parse(new aS(o,a,o.path,a)),value:s._parse(new aS(o,o.data[a],o.path,a)),alwaysSet:a in o.data});return o.common.async?Ox.mergeObjectAsync(n,r):Ox.mergeObjectSync(n,r)}get element(){return this._def.valueType}static create(t,n,o){return new e(n instanceof ja?{keyType:t,valueType:n,typeName:xs.ZodRecord,...Ta(o)}:{keyType:q$.create(),valueType:t,typeName:xs.ZodRecord,...Ta(n)})}},BCe=class extends ja{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==Yr.map)return vr(n,{code:zo.invalid_type,expected:Yr.map,received:n.parsedType}),ds;let o=this._def.keyType,r=this._def.valueType,i=[...n.data.entries()].map(([s,a],c)=>({key:o._parse(new aS(n,s,n.path,[c,"key"])),value:r._parse(new aS(n,a,n.path,[c,"value"]))}));if(n.common.async){let s=new Map;return Promise.resolve().then(async()=>{for(let a of i){let c=await a.key,l=await a.value;if(c.status==="aborted"||l.status==="aborted")return ds;c.status!=="dirty"&&l.status!=="dirty"||t.dirty(),s.set(c.value,l.value)}return{status:t.value,value:s}})}{let s=new Map;for(let a of i){let{key:c,value:l}=a;if(c.status==="aborted"||l.status==="aborted")return ds;c.status!=="dirty"&&l.status!=="dirty"||t.dirty(),s.set(c.value,l.value)}return{status:t.value,value:s}}}};BCe.create=(e,t,n)=>new BCe({valueType:t,keyType:e,typeName:xs.ZodMap,...Ta(n)});var TCe=class e extends ja{_parse(t){let{status:n,ctx:o}=this._processInputParams(t);if(o.parsedType!==Yr.set)return vr(o,{code:zo.invalid_type,expected:Yr.set,received:o.parsedType}),ds;let r=this._def;r.minSize!==null&&o.data.size<r.minSize.value&&(vr(o,{code:zo.too_small,minimum:r.minSize.value,type:"set",inclusive:!0,exact:!1,message:r.minSize.message}),n.dirty()),r.maxSize!==null&&o.data.size>r.maxSize.value&&(vr(o,{code:zo.too_big,maximum:r.maxSize.value,type:"set",inclusive:!0,exact:!1,message:r.maxSize.message}),n.dirty());let i=this._def.valueType;function s(c){let l=new Set;for(let h of c){if(h.status==="aborted")return ds;h.status==="dirty"&&n.dirty(),l.add(h.value)}return{status:n.value,value:l}}let a=[...o.data.values()].map((c,l)=>i._parse(new aS(o,c,o.path,l)));return o.common.async?Promise.all(a).then((c)=>s(c)):s(a)}min(t,n){return new e({...this._def,minSize:{value:t,message:fi.toString(n)}})}max(t,n){return new e({...this._def,maxSize:{value:t,message:fi.toString(n)}})}size(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}};TCe.create=(e,t)=>new TCe({valueType:e,minSize:null,maxSize:null,typeName:xs.ZodSet,...Ta(t)});var kXt=class e extends ja{constructor(){super(...arguments),this.validate=this.implement}_parse(t){let{ctx:n}=this._processInputParams(t);if(n.parsedType!==Yr.function)return vr(n,{code:zo.invalid_type,expected:Yr.function,received:n.parsedType}),ds;function o(a,c){return PCe({data:a,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,SCe(),$$].filter((l)=>!!l),issueData:{code:zo.invalid_arguments,argumentsError:c}})}function r(a,c){return PCe({data:a,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,SCe(),$$].filter((l)=>!!l),issueData:{code:zo.invalid_return_type,returnTypeError:c}})}let i={errorMap:n.common.contextualErrorMap},s=n.data;if(this._def.returns instanceof Z$){let a=this;return my(async function(...c){let l=new c9([]),h=await a._def.args.parseAsync(c,i).catch((u)=>{throw l.addIssue(o(c,u)),l}),d=await Reflect.apply(s,this,h);return await a._def.returns._def.type.parseAsync(d,i).catch((u)=>{throw l.addIssue(r(d,u)),l})})}{let a=this;return my(function(...c){let l=a._def.args.safeParse(c,i);if(!l.success)throw new c9([o(c,l.error)]);let h=Reflect.apply(s,this,l.data),d=a._def.returns.safeParse(h,i);if(!d.success)throw new c9([r(h,d.error)]);return d.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new e({...this._def,args:AQ.create(t).rest(YO.create())})}returns(t){return new e({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,n,o){return new e({args:t||AQ.create([]).rest(YO.create()),returns:n||YO.create(),typeName:xs.ZodFunction,...Ta(o)})}},Wce=class extends ja{get schema(){return this._def.getter()}_parse(e){let{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}};Wce.create=(e,t)=>new Wce({getter:e,typeName:xs.ZodLazy,...Ta(t)});var Xce=class extends ja{_parse(e){if(e.data!==this._def.value){let t=this._getOrReturnCtx(e);return vr(t,{received:t.data,code:zo.invalid_literal,expected:this._def.value}),ds}return{status:"valid",value:e.data}}get value(){return this._def.value}};function LXt(e,t){return new Ple({values:e,typeName:xs.ZodEnum,...Ta(t)})}Xce.create=(e,t)=>new Xce({value:e,typeName:xs.ZodLiteral,...Ta(t)});var Ple=class e extends ja{_parse(t){if(typeof t.data!="string"){let n=this._getOrReturnCtx(t),o=this._def.values;return vr(n,{expected:il.joinValues(o),received:n.parsedType,code:zo.invalid_type}),ds}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(t.data)){let n=this._getOrReturnCtx(t),o=this._def.values;return vr(n,{received:n.data,code:zo.invalid_enum_value,options:o}),ds}return my(t.data)}get options(){return this._def.values}get enum(){let t={};for(let n of this._def.values)t[n]=n;return t}get Values(){let t={};for(let n of this._def.values)t[n]=n;return t}get Enum(){let t={};for(let n of this._def.values)t[n]=n;return t}extract(t,n=this._def){return e.create(t,{...this._def,...n})}exclude(t,n=this._def){return e.create(this.options.filter((o)=>!t.includes(o)),{...this._def,...n})}};Ple.create=LXt;var jce=class extends ja{_parse(e){let t=il.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==Yr.string&&n.parsedType!==Yr.number){let o=il.objectValues(t);return vr(n,{expected:il.joinValues(o),received:n.parsedType,code:zo.invalid_type}),ds}if(this._cache||(this._cache=new Set(il.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){let o=il.objectValues(t);return vr(n,{received:n.data,code:zo.invalid_enum_value,options:o}),ds}return my(e.data)}get enum(){return this._def.values}};jce.create=(e,t)=>new jce({values:e,typeName:xs.ZodNativeEnum,...Ta(t)});var Z$=class extends ja{unwrap(){return this._def.type}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==Yr.promise&&t.common.async===!1)return vr(t,{code:zo.invalid_type,expected:Yr.promise,received:t.parsedType}),ds;let n=t.parsedType===Yr.promise?t.data:Promise.resolve(t.data);return my(n.then((o)=>this._def.type.parseAsync(o,{path:t.path,errorMap:t.common.contextualErrorMap})))}};Z$.create=(e,t)=>new Z$({type:e,typeName:xs.ZodPromise,...Ta(t)});var s9=class extends ja{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===xs.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:t,ctx:n}=this._processInputParams(e),o=this._def.effect||null,r={addIssue:(i)=>{vr(n,i),i.fatal?t.abort():t.dirty()},get path(){return n.path}};if(r.addIssue=r.addIssue.bind(r),o.type==="preprocess"){let i=o.transform(n.data,r);if(n.common.async)return Promise.resolve(i).then(async(s)=>{if(t.value==="aborted")return ds;let a=await this._def.schema._parseAsync({data:s,path:n.path,parent:n});return a.status==="aborted"?ds:a.status==="dirty"||t.value==="dirty"?ECe(a.value):a});{if(t.value==="aborted")return ds;let s=this._def.schema._parseSync({data:i,path:n.path,parent:n});return s.status==="aborted"?ds:s.status==="dirty"||t.value==="dirty"?ECe(s.value):s}}if(o.type==="refinement"){let i=(s)=>{let a=o.refinement(s,r);if(n.common.async)return Promise.resolve(a);if(a instanceof Promise)throw Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return s};if(n.common.async===!1){let s=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?ds:(s.status==="dirty"&&t.dirty(),i(s.value),{status:t.value,value:s.value})}return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then((s)=>s.status==="aborted"?ds:(s.status==="dirty"&&t.dirty(),i(s.value).then(()=>({status:t.value,value:s.value}))))}if(o.type==="transform"){if(n.common.async===!1){let i=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!nV(i))return ds;let s=o.transform(i.value,r);if(s instanceof Promise)throw Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:s}}return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then((i)=>nV(i)?Promise.resolve(o.transform(i.value,r)).then((s)=>({status:t.value,value:s})):ds)}il.assertNever(o)}};s9.create=(e,t,n)=>new s9({schema:e,typeName:xs.ZodEffects,effect:t,...Ta(n)}),s9.createWithPreprocess=(e,t,n)=>new s9({schema:t,effect:{type:"preprocess",transform:e},typeName:xs.ZodEffects,...Ta(n)});var eS=class extends ja{_parse(e){return this._getType(e)===Yr.undefined?my(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};eS.create=(e,t)=>new eS({innerType:e,typeName:xs.ZodOptional,...Ta(t)});var fQ=class extends ja{_parse(e){return this._getType(e)===Yr.null?my(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};fQ.create=(e,t)=>new fQ({innerType:e,typeName:xs.ZodNullable,...Ta(t)});var Kce=class extends ja{_parse(e){let{ctx:t}=this._processInputParams(e),n=t.data;return t.parsedType===Yr.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}};Kce.create=(e,t)=>new Kce({innerType:e,typeName:xs.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...Ta(t)});var $ce=class extends ja{_parse(e){let{ctx:t}=this._processInputParams(e),n={...t,common:{...t.common,issues:[]}},o=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return Lce(o)?o.then((r)=>({status:"valid",value:r.status==="valid"?r.value:this._def.catchValue({get error(){return new c9(n.common.issues)},input:n.data})})):{status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new c9(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};$ce.create=(e,t)=>new $ce({innerType:e,typeName:xs.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...Ta(t)});var DCe=class extends ja{_parse(e){if(this._getType(e)!==Yr.nan){let t=this._getOrReturnCtx(e);return vr(t,{code:zo.invalid_type,expected:Yr.nan,received:t.parsedType}),ds}return{status:"valid",value:e.data}}};DCe.create=(e)=>new DCe({typeName:xs.ZodNaN,...Ta(e)});var dgr=Symbol("zod_brand"),P$e=class extends ja{_parse(e){let{ctx:t}=this._processInputParams(e),n=t.data;return this._def.type._parse({data:n,path:t.path,parent:t})}unwrap(){return this._def.type}},E$e=class e extends ja{_parse(t){let{status:n,ctx:o}=this._processInputParams(t);if(o.common.async)return(async()=>{let r=await this._def.in._parseAsync({data:o.data,path:o.path,parent:o});return r.status==="aborted"?ds:r.status==="dirty"?(n.dirty(),ECe(r.value)):this._def.out._parseAsync({data:r.value,path:o.path,parent:o})})();{let r=this._def.in._parseSync({data:o.data,path:o.path,parent:o});return r.status==="aborted"?ds:r.status==="dirty"?(n.dirty(),{status:"dirty",value:r.value}):this._def.out._parseSync({data:r.value,path:o.path,parent:o})}}static create(t,n){return new e({in:t,out:n,typeName:xs.ZodPipeline})}},qce=class extends ja{_parse(e){let t=this._def.innerType._parse(e),n=(o)=>(nV(o)&&(o.value=Object.freeze(o.value)),o);return Lce(t)?t.then((o)=>n(o)):n(t)}unwrap(){return this._def.innerType}};function ezt(e,t){let n=typeof e=="function"?e(t):typeof e=="string"?{message:e}:e;return typeof n=="string"?{message:n}:n}function HXt(e,t={},n){return e?J$.create().superRefine((o,r)=>{let i=e(o);if(i instanceof Promise)return i.then((s)=>{if(!s){let a=ezt(t,o),c=a.fatal??n??!0;r.addIssue({code:"custom",...a,fatal:c})}});if(!i){let s=ezt(t,o),a=s.fatal??n??!0;r.addIssue({code:"custom",...s,fatal:a})}}):J$.create()}qce.create=(e,t)=>new qce({innerType:e,typeName:xs.ZodReadonly,...Ta(t)});var xs,Qc,ugr={object:hb.lazycreate};(Qc=xs||(xs={})).ZodString="ZodString",Qc.ZodNumber="ZodNumber",Qc.ZodNaN="ZodNaN",Qc.ZodBigInt="ZodBigInt",Qc.ZodBoolean="ZodBoolean",Qc.ZodDate="ZodDate",Qc.ZodSymbol="ZodSymbol",Qc.ZodUndefined="ZodUndefined",Qc.ZodNull="ZodNull",Qc.ZodAny="ZodAny",Qc.ZodUnknown="ZodUnknown",Qc.ZodNever="ZodNever",Qc.ZodVoid="ZodVoid",Qc.ZodArray="ZodArray",Qc.ZodObject="ZodObject",Qc.ZodUnion="ZodUnion",Qc.ZodDiscriminatedUnion="ZodDiscriminatedUnion",Qc.ZodIntersection="ZodIntersection",Qc.ZodTuple="ZodTuple",Qc.ZodRecord="ZodRecord",Qc.ZodMap="ZodMap",Qc.ZodSet="ZodSet",Qc.ZodFunction="ZodFunction",Qc.ZodLazy="ZodLazy",Qc.ZodLiteral="ZodLiteral",Qc.ZodEnum="ZodEnum",Qc.ZodEffects="ZodEffects",Qc.ZodNativeEnum="ZodNativeEnum",Qc.ZodOptional="ZodOptional",Qc.ZodNullable="ZodNullable",Qc.ZodDefault="ZodDefault",Qc.ZodCatch="ZodCatch",Qc.ZodPromise="ZodPromise",Qc.ZodBranded="ZodBranded",Qc.ZodPipeline="ZodPipeline",Qc.ZodReadonly="ZodReadonly";var pgr=(e,t={message:`Input not instance of ${e.name}`})=>HXt((n)=>n instanceof e,t),FXt=q$.create,zXt=Hce.create,mgr=DCe.create,_gr=Fce.create,OXt=zce.create,ggr=Oce.create,Agr=MCe.create,fgr=Vce.create,ygr=Yce.create,xgr=J$.create,Cgr=YO.create,bgr=bw.create,Igr=wCe.create,vgr=oV.create,{create:Sgr,strictCreate:Pgr}=hb,Egr=Gce.create,Mgr=RXt.create,wgr=Uce.create,Bgr=AQ.create,Tgr=QXt.create,Dgr=BCe.create,Ngr=TCe.create,Rgr=kXt.create,Qgr=Wce.create,kgr=Xce.create,Lgr=Ple.create,Hgr=jce.create,Fgr=Z$.create,tzt=s9.create,zgr=eS.create,Ogr=fQ.create,Vgr=s9.createWithPreprocess,Ygr=E$e.create,Ggr=()=>FXt().optional(),Ugr=()=>zXt().optional(),Wgr=()=>OXt().optional(),Xgr={string:(e)=>q$.create({...e,coerce:!0}),number:(e)=>Hce.create({...e,coerce:!0}),boolean:(e)=>zce.create({...e,coerce:!0}),bigint:(e)=>Fce.create({...e,coerce:!0}),date:(e)=>Oce.create({...e,coerce:!0})},jgr=ds,VXt={Hz:{baseUnit:"Hz",variants:{MHz:1e6,kHz:1000,Hz:1}},g:{baseUnit:"g",variants:{kg:1000,g:1}},"Ω":{baseUnit:"Ω",variants:{"mΩ":0.001,"Ω":1,"kΩ":1000,"KΩ":1000,kohm:1000,"MΩ":1e6,"GΩ":1e9,"TΩ":1000000000000}},V:{baseUnit:"V",variants:{mV:0.001,V:1,kV:1000,KV:1000,MV:1e6,GV:1e9,TV:1000000000000}},A:{baseUnit:"A",variants:{"µA":0.000001,mA:0.001,ma:0.001,A:1,kA:1000,MA:1e6}},F:{baseUnit:"F",variants:{pF:0.000000000001,nF:0.000000001,"µF":0.000001,uF:0.000001,mF:0.001,F:1}},ml:{baseUnit:"ml",variants:{ml:1,mL:1,l:1000,L:1000}},deg:{baseUnit:"deg",variants:{rad:180/Math.PI}},ms:{baseUnit:"ms",variants:{fs:0.000000000001,ps:0.000000001,ns:0.000001,us:0.001,"µs":0.001,ms:1,s:1000}},mm:{baseUnit:"mm",variants:{nm:0.000001,"µm":0.001,um:0.001,mm:1,cm:10,dm:100,m:1000,km:1e6,in:25.4,ft:304.8,IN:25.4,FT:304.8,yd:914.4,mi:1609344,mil:0.0254}}},gje=new Set;for(let[e,t]of Object.entries(VXt)){gje.add(e);for(let n of Object.keys(t.variants))gje.add(n)}var nzt={tera:1000000000000,T:1000000000000,giga:1e9,G:1e9,mega:1e6,M:1e6,kilo:1000,k:1000,deci:0.1,d:0.1,centi:0.01,c:0.01,milli:0.001,m:0.001,micro:0.000001,u:0.000001,"µ":0.000001,nano:0.000000001,n:0.000000001,pico:0.000000000001,p:0.000000000001};function l9(e){if(e==null)return{parsedUnit:null,unitOfValue:null,value:null};if(typeof e=="string"&&e.match(/^-?[\d\.]+$/))return{value:Number.parseFloat(e),parsedUnit:null,unitOfValue:null};if(typeof e=="number")return{value:e,parsedUnit:null,unitOfValue:null};if(typeof e=="object"&&"x"in e&&"y"in e){let{parsedUnit:a,unitOfValue:c}=l9(e.x),l=l9(e.x),h=l9(e.y);return l.value===null||h.value===null?{parsedUnit:null,unitOfValue:null,value:null}:{parsedUnit:a,unitOfValue:c,value:{x:l.value,y:h.value}}}let t=e.toString().split("").reverse().join(""),n=t.match(/[^\d\s]+/)?.[0];if(!n)throw Error(`Could not determine unit: "${e}"`);let o=n.split("").reverse().join(""),r=e.slice(0,-o.length);if(o in nzt&&!gje.has(o)){let a=nzt[o];return{parsedUnit:null,unitOfValue:null,value:Number.parseFloat(r)*a}}let{baseUnit:i,conversionFactor:s}=function(a){for(let[c,l]of Object.entries(VXt))if(a in l.variants)return{baseUnit:l.baseUnit,conversionFactor:l.variants[a]};return{baseUnit:a,conversionFactor:1}}(o);return{parsedUnit:o,unitOfValue:i,value:s*Number.parseFloat(r)}}var Lbe=E.string().or(E.number()).transform((e)=>l9(e).value),M$e=E.string().or(E.number()).transform((e)=>l9(e).value).transform((e)=>Number.parseFloat(e.toPrecision(12))),YXt=E.string().or(E.number()).transform((e)=>l9(e).value),Ew=E.string().or(E.number()).transform((e)=>l9(e).value),sr=E.string().or(E.number()).transform((e)=>l9(e).value),xV=E.string().or(E.number()).transform((e)=>l9(e).value),Wn=sr,eq=E.string().or(E.number()).transform((e)=>l9(e).value),Ele=E.string().or(E.number()).transform((e)=>l9(e).value),Kgr=Ele,rV=Ele,GXt=E.string().datetime(),_m=E.string().or(E.number()).transform((e)=>typeof e=="number"?e:e.endsWith("deg")?Number.parseFloat(e.split("deg")[0]):e.endsWith("rad")?180*Number.parseFloat(e.split("rad")[0])/Math.PI:Number.parseFloat(e)),UXt=E.number().or(E.string().endsWith("mAh")).transform((e)=>{if(typeof e=="string"){let t=e.replace("mAh",""),n=Number.parseFloat(t);if(Number.isNaN(n))throw Error("Invalid capacity");return n}return e}).describe("Battery capacity in mAh"),Wr=E.object({x:Wn,y:Wn}),$gr=Wr,_w=E.object({x:Wn,y:Wn,z:Wn}),qgr=_w,w$e=E.object({width:E.number(),height:E.number()}),po=(e)=>E.string().optional().default(()=>`${e}_${((t)=>Array.from({length:t},()=>"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"[Math.floor(62*Math.random())]).join(""))(10)}`),Qw=E.enum(["top_left","top_center","top_right","center_left","center","center_right","bottom_left","bottom_center","bottom_right"]),Jgr=E.enum(["top_silkscreen","bottom_silkscreen","top_copper","bottom_copper","top_soldermask","bottom_soldermask","top_fabrication_note","bottom_fabrication_note","top_user_note","bottom_user_note","top_courtyard","bottom_courtyard","inner1_copper","inner2_copper","inner3_copper","inner4_copper","inner5_copper","inner6_copper","edge_cuts","drill"]),WXt=E.object({project_relative_path:E.string(),url:E.string(),mimetype:E.string()}),Hbe=Wr.extend({rotation:_m.optional()}),B$e=E.object({size:Wr.optional(),thickness:Wn.optional()}),XXt=E.object({font:B$e.optional()}),Wae=E.object({value:E.string(),at:Hbe.optional(),layer:E.string().optional(),uuid:E.string().optional(),hide:E.boolean().optional(),effects:XXt.optional()}),jXt=E.object({Reference:Wae.optional(),Value:Wae.optional(),Datasheet:Wae.optional(),Description:Wae.optional()}),KXt=E.object({through_hole:E.boolean().optional(),smd:E.boolean().optional(),exclude_from_pos_files:E.boolean().optional(),exclude_from_bom:E.boolean().optional()}),$Xt=E.object({name:E.string(),type:E.string(),shape:E.string().optional(),at:Hbe.optional(),size:Wr.optional(),drill:Wn.optional(),layers:E.array(E.string()).optional(),removeUnusedLayers:E.boolean().optional(),uuid:E.string().optional()}),qXt=E.object({path:E.string(),offset:_w.optional(),scale:_w.optional(),rotate:_w.optional()}),JXt=E.object({footprintName:E.string().optional(),version:E.union([E.number(),E.string()]).optional(),generator:E.string().optional(),generatorVersion:E.union([E.number(),E.string()]).optional(),layer:E.string().optional(),properties:jXt.optional(),attributes:KXt.optional(),pads:E.array($Xt).optional(),embeddedFonts:E.boolean().optional(),model:qXt.optional()}),ZXt=E.object({hide:E.boolean().optional()}),ejt=E.object({offset:Wn.optional(),hide:E.boolean().optional()}),tjt=E.object({font:B$e.optional(),justify:E.union([E.string(),E.array(E.string())]).optional(),hide:E.boolean().optional()}),GR=E.object({value:E.string(),id:E.union([E.number(),E.string()]).optional(),at:Hbe.optional(),effects:tjt.optional()}),njt=E.object({Reference:GR.optional(),Value:GR.optional(),Footprint:GR.optional(),Datasheet:GR.optional(),Description:GR.optional(),ki_keywords:GR.optional(),ki_fp_filters:GR.optional()}),ojt=E.object({symbolName:E.string().optional(),extends:E.string().optional(),pinNumbers:ZXt.optional(),pinNames:ejt.optional(),excludeFromSim:E.boolean().optional(),inBom:E.boolean().optional(),onBoard:E.boolean().optional(),properties:njt.optional(),embeddedFonts:E.boolean().optional()}),$l=E.object({error_type:E.string(),message:E.string(),is_fatal:E.boolean().optional()}),T$e=E.enum(["jlcpcb","macrofab","pcbway","digikey","mouser","lcsc"]),Bd=E.object({type:E.literal("source_component"),ftype:E.string().optional(),source_component_id:E.string(),name:E.string(),manufacturer_part_number:E.string().optional(),supplier_part_numbers:E.record(T$e,E.array(E.string())).optional(),display_value:E.string().optional(),display_name:E.string().optional(),are_pins_interchangeable:E.boolean().optional(),internally_connected_source_port_ids:E.array(E.array(E.string())).optional(),source_group_id:E.string().optional(),subcircuit_id:E.string().optional()}),D$e=Bd.extend({ftype:E.literal("simple_capacitor"),capacitance:M$e,max_voltage_rating:Ew.optional(),display_capacitance:E.string().optional(),max_decoupling_trace_length:Wn.optional()}),N$e=Bd.extend({ftype:E.literal("simple_resistor"),resistance:Lbe,display_resistance:E.string().optional()}),Fbe=Bd.extend({ftype:E.literal("simple_diode")}),rjt=Bd.extend({ftype:E.literal("simple_fiducial")}),R$e=Fbe.extend({ftype:E.literal("simple_led"),color:E.string().optional(),wavelength:E.string().optional()}),ijt=Bd.extend({ftype:E.literal("simple_ground")}),Q$e=Bd.extend({ftype:E.literal("simple_chip")}),k$e=Bd.extend({ftype:E.literal("simple_power_source"),voltage:Ew}),sjt=Bd.extend({ftype:E.literal("simple_current_source"),current:eq,frequency:xV.optional(),peak_to_peak_current:eq.optional(),wave_shape:E.enum(["sine","square","triangle","sawtooth","dc"]).optional().default("dc"),phase:E.number().optional(),duty_cycle:E.number().min(0).max(1).optional()}),ajt=E.object({must_be_connected:E.boolean().optional(),provides_power:E.boolean().optional(),requires_power:E.boolean().optional(),provides_ground:E.boolean().optional(),requires_ground:E.boolean().optional(),provides_voltage:E.union([E.string(),E.number()]).optional(),requires_voltage:E.union([E.string(),E.number()]).optional(),do_not_connect:E.boolean().optional(),include_in_board_pinout:E.boolean().optional(),can_use_internal_pullup:E.boolean().optional(),is_using_internal_pullup:E.boolean().optional(),needs_external_pullup:E.boolean().optional(),can_use_internal_pulldown:E.boolean().optional(),is_using_internal_pulldown:E.boolean().optional(),needs_external_pulldown:E.boolean().optional(),can_use_open_drain:E.boolean().optional(),is_using_open_drain:E.boolean().optional(),can_use_push_pull:E.boolean().optional(),is_using_push_pull:E.boolean().optional(),should_have_decoupling_capacitor:E.boolean().optional(),recommended_decoupling_capacitor_capacitance:E.union([E.string(),E.number()]).optional(),is_configured_for_i2c_sda:E.boolean().optional(),is_configured_for_i2c_scl:E.boolean().optional(),is_configured_for_spi_mosi:E.boolean().optional(),is_configured_for_spi_miso:E.boolean().optional(),is_configured_for_spi_sck:E.boolean().optional(),is_configured_for_spi_cs:E.boolean().optional(),is_configured_for_uart_tx:E.boolean().optional(),is_configured_for_uart_rx:E.boolean().optional(),supports_i2c_sda:E.boolean().optional(),supports_i2c_scl:E.boolean().optional(),supports_spi_mosi:E.boolean().optional(),supports_spi_miso:E.boolean().optional(),supports_spi_sck:E.boolean().optional(),supports_spi_cs:E.boolean().optional(),supports_uart_tx:E.boolean().optional(),supports_uart_rx:E.boolean().optional()}),Zgr=Bd.extend({ftype:E.literal("simple_fuse"),current_rating_amps:E.number().describe("Nominal current in amps the fuse is rated for"),voltage_rating_volts:E.number().describe("Voltage rating in volts, e.g. ±5V would be 5")}),L$e=Bd.extend({ftype:E.literal("simple_battery"),capacity:UXt}),H$e=Bd.extend({ftype:E.literal("simple_inductor"),inductance:YXt,display_inductance:E.string().optional(),max_current_rating:E.number().optional()}),F$e=Bd.extend({ftype:E.literal("simple_push_button")}),z$e=Bd.extend({ftype:E.literal("simple_potentiometer"),max_resistance:Lbe,display_max_resistance:E.string().optional()}),cjt=Bd.extend({ftype:E.literal("simple_crystal"),frequency:E.number().describe("Frequency in Hz"),load_capacitance:E.number().optional().describe("Load capacitance in pF"),pin_variant:E.enum(["two_pin","four_pin"]).optional()}),O$e=Bd.extend({ftype:E.literal("simple_pin_header"),pin_count:E.number(),gender:E.enum(["male","female"]).optional().default("male")}),ljt=Bd.extend({ftype:E.literal("simple_connector"),standard:E.enum(["usb_c","m2"]).optional()}),V$e=Bd.extend({ftype:E.literal("simple_pinout")}),Y$e=Bd.extend({ftype:E.literal("simple_resonator"),load_capacitance:M$e,equivalent_series_resistance:Lbe.optional(),frequency:xV}),G$e=Bd.extend({ftype:E.literal("simple_transistor"),transistor_type:E.enum(["npn","pnp"])}),U$e=Bd.extend({ftype:E.literal("simple_test_point"),footprint_variant:E.enum(["pad","through_hole"]).optional(),pad_shape:E.enum(["rect","circle"]).optional(),pad_diameter:E.union([E.number(),E.string()]).optional(),hole_diameter:E.union([E.number(),E.string()]).optional(),width:E.union([E.number(),E.string()]).optional(),height:E.union([E.number(),E.string()]).optional()}),W$e=Bd.extend({ftype:E.literal("simple_mosfet"),channel_type:E.enum(["n","p"]),mosfet_mode:E.enum(["enhancement","depletion"])}),X$e=Bd.extend({ftype:E.literal("simple_op_amp")}),j$e=Bd.extend({ftype:E.literal("simple_switch")}),K$e=E.object({type:E.literal("source_project_metadata"),name:E.string().optional(),software_used_string:E.string().optional(),project_url:E.string().optional(),created_at:GXt.optional()}),hjt=$l.extend({type:E.literal("source_missing_property_error"),source_missing_property_error_id:po("source_missing_property_error"),source_component_id:E.string(),property_name:E.string(),subcircuit_id:E.string().optional(),error_type:E.literal("source_missing_property_error").default("source_missing_property_error")}).describe("The source code is missing a property"),djt=$l.extend({type:E.literal("source_failed_to_create_component_error"),source_failed_to_create_component_error_id:po("source_failed_to_create_component_error"),error_type:E.literal("source_failed_to_create_component_error").default("source_failed_to_create_component_error"),component_name:E.string().optional(),subcircuit_id:E.string().optional(),parent_source_component_id:E.string().optional(),pcb_center:E.object({x:E.number().optional(),y:E.number().optional()}).optional(),schematic_center:E.object({x:E.number().optional(),y:E.number().optional()}).optional()}).describe("Error emitted when a component fails to be constructed"),$$e=$l.extend({type:E.literal("source_invalid_component_property_error"),source_invalid_component_property_error_id:po("source_invalid_component_property_error"),source_component_id:E.string(),property_name:E.string(),property_value:E.unknown().optional(),expected_format:E.string().optional(),subcircuit_id:E.string().optional(),error_type:E.literal("source_invalid_component_property_error").default("source_invalid_component_property_error")}).describe("The source component property is invalid"),q$e=$l.extend({type:E.literal("source_trace_not_connected_error"),source_trace_not_connected_error_id:po("source_trace_not_connected_error"),error_type:E.literal("source_trace_not_connected_error").default("source_trace_not_connected_error"),subcircuit_id:E.string().optional(),source_group_id:E.string().optional(),source_trace_id:E.string().optional(),connected_source_port_ids:E.array(E.string()).optional(),selectors_not_found:E.array(E.string()).optional()}).describe("Occurs when a source trace selector does not match any ports"),ujt=E.object({type:E.literal("source_property_ignored_warning"),source_property_ignored_warning_id:po("source_property_ignored_warning"),source_component_id:E.string(),property_name:E.string(),subcircuit_id:E.string().optional(),error_type:E.literal("source_property_ignored_warning").default("source_property_ignored_warning"),message:E.string()}).describe("The source property was ignored"),J$e=E.object({type:E.literal("source_pin_missing_trace_warning"),source_pin_missing_trace_warning_id:po("source_pin_missing_trace_warning"),warning_type:E.literal("source_pin_missing_trace_warning").default("source_pin_missing_trace_warning"),message:E.string(),source_component_id:E.string(),source_port_id:E.string(),subcircuit_id:E.string().optional()}).describe("Warning emitted when a source component pin is missing a trace connection"),Z$e=E.object({type:E.literal("source_missing_manufacturer_part_number_warning"),source_missing_manufacturer_part_number_warning_id:po("source_missing_manufacturer_part_number_warning"),warning_type:E.literal("source_missing_manufacturer_part_number_warning").default("source_missing_manufacturer_part_number_warning"),message:E.string(),source_component_id:E.string(),standard:E.string(),subcircuit_id:E.string().optional()}).describe("Warning emitted when a standard connector is missing manufacturer part number"),pjt=Bd.extend({ftype:E.literal("simple_voltage_probe")}),mjt=Bd.extend({ftype:E.literal("interconnect")}),eqe=$l.extend({type:E.literal("source_i2c_misconfigured_error"),source_i2c_misconfigured_error_id:po("source_i2c_misconfigured_error"),error_type:E.literal("source_i2c_misconfigured_error").default("source_i2c_misconfigured_error"),source_port_ids:E.array(E.string())}).describe("Error emitted when incompatible I2C pins (e.g. SDA and SCL) are connected to the same net"),_jt=Bd.extend({ftype:E.literal("simple_voltage_source"),voltage:Ew,frequency:xV.optional(),peak_to_peak_voltage:Ew.optional(),wave_shape:E.enum(["sinewave","square","triangle","sawtooth"]).optional(),phase:_m.optional(),duty_cycle:E.number().optional().describe("Duty cycle as a fraction (0 to 1)")}),gjt=E.union([N$e,D$e,Fbe,rjt,R$e,ijt,Q$e,k$e,sjt,L$e,H$e,F$e,z$e,cjt,O$e,ljt,V$e,Y$e,j$e,G$e,U$e,W$e,X$e,Zgr,pjt,mjt,_jt,K$e,hjt,$$e,djt,q$e,ujt,J$e,Z$e,eqe]),Ajt=E.object({type:E.literal("source_port"),pin_number:E.number().optional(),port_hints:E.array(E.string()).optional(),name:E.string(),source_port_id:E.string(),source_component_id:E.string().optional(),source_group_id:E.string().optional(),most_frequently_referenced_by_name:E.string().optional(),subcircuit_id:E.string().optional(),subcircuit_connectivity_map_key:E.string().optional()}).merge(ajt),fjt=E.object({type:E.literal("source_component_internal_connection"),source_component_internal_connection_id:E.string(),source_component_id:E.string(),source_port_ids:E.array(E.string()),subcircuit_id:E.string().optional()}),yjt=E.object({type:E.literal("source_trace"),source_trace_id:E.string(),connected_source_port_ids:E.array(E.string()),connected_source_net_ids:E.array(E.string()),subcircuit_id:E.string().optional(),subcircuit_connectivity_map_key:E.string().optional(),max_length:E.number().optional(),min_trace_thickness:E.number().optional(),display_name:E.string().optional()}),xjt=E.object({type:E.literal("source_group"),source_group_id:E.string(),subcircuit_id:E.string().optional(),parent_subcircuit_id:E.string().optional(),parent_source_group_id:E.string().optional(),is_subcircuit:E.boolean().optional(),show_as_schematic_box:E.boolean().optional(),name:E.string().optional(),was_automatically_named:E.boolean().optional()}),Cjt=E.object({type:E.literal("source_net"),source_net_id:E.string(),name:E.string(),member_source_group_ids:E.array(E.string()),is_power:E.boolean().optional(),is_ground:E.boolean().optional(),is_digital_signal:E.boolean().optional(),is_analog_signal:E.boolean().optional(),is_positive_voltage_source:E.boolean().optional(),trace_width:E.number().optional(),subcircuit_id:E.string().optional(),subcircuit_connectivity_map_key:E.string().optional()}),bjt=E.object({type:E.literal("source_board"),source_board_id:E.string(),source_group_id:E.string(),title:E.string().optional()}).describe("Defines a board in the source domain"),Ijt=$l.extend({type:E.literal("source_ambiguous_port_reference"),source_ambiguous_port_reference_id:po("source_ambiguous_port_reference"),error_type:E.literal("source_ambiguous_port_reference").default("source_ambiguous_port_reference"),source_port_id:E.string().optional(),source_component_id:E.string().optional()}).describe("Error emitted when a port hint matches multiple non-overlapping pads, making the port reference ambiguous"),vjt=E.object({type:E.literal("source_pcb_ground_plane"),source_pcb_ground_plane_id:E.string(),source_group_id:E.string(),source_net_id:E.string(),subcircuit_id:E.string().optional()}).describe("Defines a ground plane in the source domain"),Sjt=["top","bottom","inner1","inner2","inner3","inner4","inner5","inner6"],Aje=E.enum(Sjt),pc=Aje.or(E.object({name:Aje})).transform((e)=>typeof e=="string"?e:e.name),wf=E.enum(["top","bottom"]),Pjt=E.object({type:E.literal("source_manually_placed_via"),source_manually_placed_via_id:E.string(),source_group_id:E.string(),source_net_id:E.string(),subcircuit_id:E.string().optional(),source_trace_id:E.string().optional()}).describe("Defines a via that is manually placed in the source domain"),Ejt=E.object({type:E.literal("source_no_power_pin_defined_warning"),source_no_power_pin_defined_warning_id:po("source_no_power_pin_defined_warning"),warning_type:E.literal("source_no_power_pin_defined_warning").default("source_no_power_pin_defined_warning"),message:E.string(),source_component_id:E.string(),source_port_ids:E.array(E.string()),subcircuit_id:E.string().optional()}).describe("Warning emitted when a chip has no source ports with requires_power=true"),Mjt=E.object({type:E.literal("source_no_ground_pin_defined_warning"),source_no_ground_pin_defined_warning_id:po("source_no_ground_pin_defined_warning"),warning_type:E.literal("source_no_ground_pin_defined_warning").default("source_no_ground_pin_defined_warning"),message:E.string(),source_component_id:E.string(),source_port_ids:E.array(E.string()),subcircuit_id:E.string().optional()}).describe("Warning emitted when a chip has no source ports marked as ground pins"),wjt=E.object({type:E.literal("source_component_pins_underspecified_warning"),source_component_pins_underspecified_warning_id:po("source_component_pins_underspecified_warning"),warning_type:E.literal("source_component_pins_underspecified_warning").default("source_component_pins_underspecified_warning"),message:E.string(),source_component_id:E.string(),source_port_ids:E.array(E.string()),subcircuit_id:E.string().optional()}).describe("Warning emitted when all ports on a source component are underspecified"),Bjt=$l.extend({type:E.literal("source_pin_must_be_connected_error"),source_pin_must_be_connected_error_id:po("source_pin_must_be_connected_error"),error_type:E.literal("source_pin_must_be_connected_error").default("source_pin_must_be_connected_error"),source_component_id:E.string(),source_port_id:E.string(),subcircuit_id:E.string().optional()}).describe("Error emitted when a pin with mustBeConnected attribute is not connected to any trace"),Tjt=$l.extend({type:E.literal("unknown_error_finding_part"),unknown_error_finding_part_id:po("unknown_error_finding_part"),error_type:E.literal("unknown_error_finding_part").default("unknown_error_finding_part"),source_component_id:E.string().optional(),subcircuit_id:E.string().optional()}).describe("Error emitted when an unexpected error occurs while finding a part"),Djt=E.object({type:E.literal("schematic_box"),schematic_component_id:E.string().optional(),schematic_symbol_id:E.string().optional(),width:Wn,height:Wn,is_dashed:E.boolean().default(!1),x:Wn,y:Wn,subcircuit_id:E.string().optional()}).describe("Draws a box on the schematic"),Njt=E.object({type:E.literal("schematic_path"),schematic_path_id:po("schematic_path"),schematic_component_id:E.string().optional(),schematic_symbol_id:E.string().optional(),fill_color:E.string().optional(),is_filled:E.boolean().optional(),stroke_width:Wn.nullable().optional(),stroke_color:E.string().optional(),points:E.array(Wr),subcircuit_id:E.string().optional()}),Rjt=E.record(E.object({left_margin:sr.optional(),right_margin:sr.optional(),top_margin:sr.optional(),bottom_margin:sr.optional()})),Qjt=E.object({left_size:E.number(),right_size:E.number(),top_size:E.number().optional(),bottom_size:E.number().optional()}),kjt=E.object({left_side:E.object({pins:E.array(E.number()),direction:E.enum(["top-to-bottom","bottom-to-top"]).optional()}).optional(),right_side:E.object({pins:E.array(E.number()),direction:E.enum(["top-to-bottom","bottom-to-top"]).optional()}).optional(),top_side:E.object({pins:E.array(E.number()),direction:E.enum(["left-to-right","right-to-left"]).optional()}).optional(),bottom_side:E.object({pins:E.array(E.number()),direction:E.enum(["left-to-right","right-to-left"]).optional()}).optional()}),Ljt=E.union([Qjt,kjt]),Hjt=E.object({type:E.literal("schematic_component"),size:w$e,center:Wr,source_component_id:E.string().optional(),schematic_component_id:E.string(),schematic_symbol_id:E.string().optional(),pin_spacing:sr.optional(),pin_styles:Rjt.optional(),box_width:sr.optional(),symbol_name:E.string().optional(),port_arrangement:Ljt.optional(),port_labels:E.record(E.string()).optional(),symbol_display_value:E.string().optional(),subcircuit_id:E.string().optional(),schematic_group_id:E.string().optional(),is_schematic_group:E.boolean().optional(),source_group_id:E.string().optional(),is_box_with_pins:E.boolean().optional().default(!0)}),eAr=E.object({kicad_symbol:ojt.optional()}).catchall(E.unknown()),Fjt=E.object({type:E.literal("schematic_symbol"),schematic_symbol_id:E.string(),name:E.string().optional(),metadata:eAr.optional()}).describe("Defines a named schematic symbol that can be referenced by components."),zjt=E.object({type:E.literal("schematic_line"),schematic_line_id:po("schematic_line"),schematic_component_id:E.string().optional(),schematic_symbol_id:E.string().optional(),x1:Wn,y1:Wn,x2:Wn,y2:Wn,stroke_width:Wn.nullable().optional(),color:E.string().default("#000000"),is_dashed:E.boolean().default(!1),subcircuit_id:E.string().optional()}).describe("Draws a styled line on the schematic"),Ojt=E.object({type:E.literal("schematic_rect"),schematic_rect_id:po("schematic_rect"),schematic_component_id:E.string().optional(),schematic_symbol_id:E.string().optional(),center:Wr,width:Wn,height:Wn,rotation:_m.default(0),stroke_width:Wn.nullable().optional(),color:E.string().default("#000000"),is_filled:E.boolean().default(!1),fill_color:E.string().optional(),is_dashed:E.boolean().default(!1),subcircuit_id:E.string().optional()}).describe("Draws a styled rectangle on the schematic"),Vjt=E.object({type:E.literal("schematic_circle"),schematic_circle_id:po("schematic_circle"),schematic_component_id:E.string().optional(),schematic_symbol_id:E.string().optional(),center:Wr,radius:Wn,stroke_width:Wn.nullable().optional(),color:E.string().default("#000000"),is_filled:E.boolean().default(!1),fill_color:E.string().optional(),is_dashed:E.boolean().default(!1),subcircuit_id:E.string().optional()}).describe("Draws a styled circle on the schematic"),Yjt=E.object({type:E.literal("schematic_arc"),schematic_arc_id:po("schematic_arc"),schematic_component_id:E.string().optional(),schematic_symbol_id:E.string().optional(),center:Wr,radius:Wn,start_angle_degrees:_m,end_angle_degrees:_m,direction:E.enum(["clockwise","counterclockwise"]).default("counterclockwise"),stroke_width:Wn.nullable().optional(),color:E.string().default("#000000"),is_dashed:E.boolean().default(!1),subcircuit_id:E.string().optional()}).describe("Draws a styled arc on the schematic"),Gjt=E.object({type:E.literal("schematic_trace"),schematic_trace_id:E.string(),source_trace_id:E.string().optional(),junctions:E.array(E.object({x:E.number(),y:E.number()})),edges:E.array(E.object({from:E.object({x:E.number(),y:E.number()}),to:E.object({x:E.number(),y:E.number()}),is_crossing:E.boolean().optional(),from_schematic_port_id:E.string().optional(),to_schematic_port_id:E.string().optional()})),subcircuit_id:E.string().optional(),subcircuit_connectivity_map_key:E.string().optional()}),tAr=E.enum(["center","left","right","top","bottom"]),Ujt=E.object({type:E.literal("schematic_text"),schematic_component_id:E.string().optional(),schematic_symbol_id:E.string().optional(),schematic_text_id:E.string(),text:E.string(),font_size:E.number().default(0.18),position:E.object({x:Wn,y:Wn}),rotation:E.number().default(0),anchor:E.union([tAr.describe("legacy"),Qw]).default("center"),color:E.string().default("#000000"),subcircuit_id:E.string().optional()}),Wjt=E.object({type:E.literal("schematic_port"),schematic_port_id:E.string(),source_port_id:E.string(),schematic_component_id:E.string().optional(),center:Wr,facing_direction:E.enum(["up","down","left","right"]).optional(),distance_from_component_edge:E.number().optional(),side_of_component:E.enum(["top","bottom","left","right"]).optional(),true_ccw_index:E.number().optional(),pin_number:E.number().optional(),display_pin_label:E.string().optional(),subcircuit_id:E.string().optional(),is_connected:E.boolean().optional(),has_input_arrow:E.boolean().optional(),has_output_arrow:E.boolean().optional(),is_drawn_with_inversion_circle:E.boolean().optional()}).describe("Defines a port on a schematic component"),Xjt=E.object({type:E.literal("schematic_net_label"),schematic_net_label_id:po("schematic_net_label"),schematic_trace_id:E.string().optional(),source_trace_id:E.string().optional(),source_net_id:E.string(),center:Wr,anchor_position:Wr.optional(),anchor_side:E.enum(["top","bottom","left","right"]),text:E.string(),symbol_name:E.string().optional(),is_movable:E.boolean().optional(),subcircuit_id:E.string().optional()}),jjt=$l.extend({type:E.literal("schematic_error"),schematic_error_id:E.string(),error_type:E.literal("schematic_port_not_found").default("schematic_port_not_found"),subcircuit_id:E.string().optional()}).describe("Defines a schematic error on the schematic"),Kjt=$l.extend({type:E.literal("schematic_layout_error"),schematic_layout_error_id:po("schematic_layout_error"),error_type:E.literal("schematic_layout_error").default("schematic_layout_error"),source_group_id:E.string(),schematic_group_id:E.string(),subcircuit_id:E.string().optional()}).describe("Error emitted when schematic layout fails for a group"),zbe=E.object({type:E.literal("schematic_debug_object"),label:E.string().optional(),subcircuit_id:E.string().optional()}),$jt=zbe.extend({shape:E.literal("rect"),center:Wr,size:w$e}),qjt=zbe.extend({shape:E.literal("line"),start:Wr,end:Wr}),Jjt=zbe.extend({shape:E.literal("point"),center:Wr}),Zjt=E.discriminatedUnion("shape",[$jt,qjt,Jjt]),eKt=E.object({type:E.literal("schematic_voltage_probe"),schematic_voltage_probe_id:E.string(),source_component_id:E.string().optional(),name:E.string().optional(),position:Wr,schematic_trace_id:E.string(),voltage:Ew.optional(),subcircuit_id:E.string().optional(),color:E.string().optional(),label_alignment:Qw.optional()}).describe("Defines a voltage probe measurement point on a schematic trace"),tKt=E.object({type:E.literal("schematic_manual_edit_conflict_warning"),schematic_manual_edit_conflict_warning_id:po("schematic_manual_edit_conflict_warning"),warning_type:E.literal("schematic_manual_edit_conflict_warning").default("schematic_manual_edit_conflict_warning"),message:E.string(),schematic_component_id:E.string(),schematic_group_id:E.string().optional(),subcircuit_id:E.string().optional(),source_component_id:E.string()}).describe("Warning emitted when a component has both manual placement and explicit schX/schY coordinates"),nKt=E.object({type:E.literal("schematic_group"),schematic_group_id:po("schematic_group"),source_group_id:E.string(),is_subcircuit:E.boolean().optional(),subcircuit_id:E.string().optional(),width:sr,height:sr,center:Wr,schematic_component_ids:E.array(E.string()),show_as_schematic_box:E.boolean().optional(),name:E.string().optional(),description:E.string().optional()}).describe("Defines a group of components on the schematic"),oKt=E.object({type:E.literal("schematic_table"),schematic_table_id:po("schematic_table"),anchor_position:Wr,column_widths:E.array(Wn),row_heights:E.array(Wn),cell_padding:Wn.optional(),border_width:Wn.optional(),subcircuit_id:E.string().optional(),schematic_component_id:E.string().optional(),anchor:Qw.optional()}).describe("Defines a table on the schematic"),rKt=E.object({type:E.literal("schematic_table_cell"),schematic_table_cell_id:po("schematic_table_cell"),schematic_table_id:E.string(),start_row_index:E.number(),end_row_index:E.number(),start_column_index:E.number(),end_column_index:E.number(),text:E.string().optional(),center:Wr,width:Wn,height:Wn,horizontal_align:E.enum(["left","center","right"]).optional(),vertical_align:E.enum(["top","middle","bottom"]).optional(),font_size:Wn.optional(),subcircuit_id:E.string().optional()}).describe("Defines a cell within a schematic_table"),iKt=E.object({type:E.literal("schematic_sheet"),schematic_sheet_id:po("schematic_sheet"),name:E.string().optional(),subcircuit_id:E.string().optional()}).describe("Defines a schematic sheet or page that components can be placed on"),sKt=E.object({x:Wn,y:Wn,bulge:E.number().optional()}),fje=E.object({vertices:E.array(sKt)}),aKt=E.object({outer_ring:fje,inner_rings:E.array(fje).default([])}),cKt=E.object({x:Wn,y:Wn,via:E.boolean().optional(),via_to_layer:pc.optional()}),nAr=E.array(cKt),lKt=E.object({x:Wn,y:Wn,via:E.boolean().optional(),to_layer:pc.optional(),trace_width:Wn.optional()}),hKt=E.object({min_trace_width:sr.optional(),min_board_edge_clearance:sr.optional(),min_via_hole_edge_to_via_hole_edge_clearance:sr.optional(),min_plated_hole_drill_edge_to_drill_edge_clearance:sr.optional(),min_trace_to_pad_edge_clearance:sr.optional(),min_pad_edge_to_pad_edge_clearance:sr.optional(),min_same_net_trace_edge_to_trace_edge_clearance:sr.optional(),min_different_net_trace_edge_to_trace_edge_clearance:sr.optional(),min_via_hole_diameter:sr.optional(),min_via_pad_diameter:sr.optional()}),dKt=E.object({type:E.literal("pcb_component"),pcb_component_id:po("pcb_component"),source_component_id:E.string(),center:Wr,layer:pc,rotation:_m,display_offset_x:E.string().optional().describe("How to display the x offset for this part, usually corresponding with how the user specified it"),display_offset_y:E.string().optional().describe("How to display the y offset for this part, usually corresponding with how the user specified it"),width:sr,height:sr,do_not_place:E.boolean().optional(),is_allowed_to_be_off_board:E.boolean().optional(),subcircuit_id:E.string().optional(),pcb_group_id:E.string().optional(),position_mode:E.enum(["packed","relative_to_group_anchor","relative_to_another_component","none"]).optional(),anchor_position:Wr.optional(),anchor_alignment:Qw.optional(),positioned_relative_to_pcb_group_id:E.string().optional(),positioned_relative_to_pcb_board_id:E.string().optional(),cable_insertion_center:Wr.optional(),insertion_direction:E.enum(["from_above","from_left","from_right","from_front","from_back"]).optional(),metadata:E.object({kicad_footprint:JXt.optional()}).optional(),obstructs_within_bounds:E.boolean().default(!0).describe("Does this component take up all the space within its bounds on a layer. This is generally true except for when separated pin headers are being represented by a single component (in which case, chips can be placed between the pin headers) or for tall modules where chips fit underneath")}).describe("Defines a component on the PCB"),uKt=E.object({type:E.literal("pcb_hole"),pcb_hole_id:po("pcb_hole"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),pcb_component_id:E.string().optional(),hole_shape:E.literal("circle"),hole_diameter:E.number(),x:Wn,y:Wn,is_covered_with_solder_mask:E.boolean().optional(),soldermask_margin:E.number().optional()}),oAr=uKt.describe("Defines a circular hole on the PCB"),pKt=E.object({type:E.literal("pcb_hole"),pcb_hole_id:po("pcb_hole"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),pcb_component_id:E.string().optional(),hole_shape:E.literal("rect"),hole_width:E.number(),hole_height:E.number(),x:Wn,y:Wn,is_covered_with_solder_mask:E.boolean().optional(),soldermask_margin:E.number().optional()}),rAr=pKt.describe("Defines a rectangular (square-capable) hole on the PCB. Use equal width/height for square."),mKt=E.object({type:E.literal("pcb_hole"),pcb_hole_id:po("pcb_hole"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),pcb_component_id:E.string().optional(),hole_shape:E.enum(["circle","square"]),hole_diameter:E.number(),x:Wn,y:Wn,is_covered_with_solder_mask:E.boolean().optional(),soldermask_margin:E.number().optional()}),iAr=mKt.describe("Defines a circular or square hole on the PCB"),_Kt=E.object({type:E.literal("pcb_hole"),pcb_hole_id:po("pcb_hole"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),pcb_component_id:E.string().optional(),hole_shape:E.literal("oval"),hole_width:E.number(),hole_height:E.number(),x:Wn,y:Wn,is_covered_with_solder_mask:E.boolean().optional(),soldermask_margin:E.number().optional()}),sAr=_Kt.describe("Defines an oval hole on the PCB"),gKt=E.object({type:E.literal("pcb_hole"),pcb_hole_id:po("pcb_hole"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),pcb_component_id:E.string().optional(),hole_shape:E.literal("pill"),hole_width:E.number(),hole_height:E.number(),x:Wn,y:Wn,is_covered_with_solder_mask:E.boolean().optional(),soldermask_margin:E.number().optional()}),aAr=gKt.describe("Defines a pill-shaped hole on the PCB"),AKt=E.object({type:E.literal("pcb_hole"),pcb_hole_id:po("pcb_hole"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),pcb_component_id:E.string().optional(),hole_shape:E.literal("rotated_pill"),hole_width:E.number(),hole_height:E.number(),x:Wn,y:Wn,ccw_rotation:_m,is_covered_with_solder_mask:E.boolean().optional(),soldermask_margin:E.number().optional()}),cAr=AKt.describe("Defines a rotated pill-shaped hole on the PCB"),fKt=mKt.or(_Kt).or(gKt).or(AKt).or(uKt).or(pKt),lAr=E.object({type:E.literal("pcb_plated_hole"),shape:E.literal("circle"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),outer_diameter:E.number(),hole_diameter:E.number(),is_covered_with_solder_mask:E.boolean().optional(),x:Wn,y:Wn,layers:E.array(pc),port_hints:E.array(E.string()).optional(),pcb_component_id:E.string().optional(),pcb_port_id:E.string().optional(),pcb_plated_hole_id:po("pcb_plated_hole"),soldermask_margin:E.number().optional()}),hAr=E.object({type:E.literal("pcb_plated_hole"),shape:E.enum(["oval","pill"]),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),outer_width:E.number(),outer_height:E.number(),hole_width:E.number(),hole_height:E.number(),is_covered_with_solder_mask:E.boolean().optional(),x:Wn,y:Wn,ccw_rotation:_m,layers:E.array(pc),port_hints:E.array(E.string()).optional(),pcb_component_id:E.string().optional(),pcb_port_id:E.string().optional(),pcb_plated_hole_id:po("pcb_plated_hole"),soldermask_margin:E.number().optional()}),dAr=E.object({type:E.literal("pcb_plated_hole"),shape:E.literal("circular_hole_with_rect_pad"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),hole_shape:E.literal("circle"),pad_shape:E.literal("rect"),hole_diameter:E.number(),rect_pad_width:E.number(),rect_pad_height:E.number(),rect_border_radius:E.number().optional(),hole_offset_x:Wn.default(0),hole_offset_y:Wn.default(0),is_covered_with_solder_mask:E.boolean().optional(),x:Wn,y:Wn,layers:E.array(pc),port_hints:E.array(E.string()).optional(),pcb_component_id:E.string().optional(),pcb_port_id:E.string().optional(),pcb_plated_hole_id:po("pcb_plated_hole"),soldermask_margin:E.number().optional(),rect_ccw_rotation:_m.optional()}),uAr=E.object({type:E.literal("pcb_plated_hole"),shape:E.literal("pill_hole_with_rect_pad"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),hole_shape:E.literal("pill"),pad_shape:E.literal("rect"),hole_width:E.number(),hole_height:E.number(),rect_pad_width:E.number(),rect_pad_height:E.number(),rect_border_radius:E.number().optional(),hole_offset_x:Wn.default(0),hole_offset_y:Wn.default(0),is_covered_with_solder_mask:E.boolean().optional(),x:Wn,y:Wn,layers:E.array(pc),port_hints:E.array(E.string()).optional(),pcb_component_id:E.string().optional(),pcb_port_id:E.string().optional(),pcb_plated_hole_id:po("pcb_plated_hole"),soldermask_margin:E.number().optional()}),pAr=E.object({type:E.literal("pcb_plated_hole"),shape:E.literal("rotated_pill_hole_with_rect_pad"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),hole_shape:E.literal("rotated_pill"),pad_shape:E.literal("rect"),hole_width:E.number(),hole_height:E.number(),hole_ccw_rotation:_m,rect_pad_width:E.number(),rect_pad_height:E.number(),rect_border_radius:E.number().optional(),rect_ccw_rotation:_m,hole_offset_x:Wn.default(0),hole_offset_y:Wn.default(0),is_covered_with_solder_mask:E.boolean().optional(),x:Wn,y:Wn,layers:E.array(pc),port_hints:E.array(E.string()).optional(),pcb_component_id:E.string().optional(),pcb_port_id:E.string().optional(),pcb_plated_hole_id:po("pcb_plated_hole"),soldermask_margin:E.number().optional()}),mAr=E.object({type:E.literal("pcb_plated_hole"),shape:E.literal("hole_with_polygon_pad"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),hole_shape:E.enum(["circle","oval","pill","rotated_pill"]),hole_diameter:E.number().optional(),hole_width:E.number().optional(),hole_height:E.number().optional(),pad_outline:E.array(E.object({x:Wn,y:Wn})).min(3),hole_offset_x:Wn.default(0),hole_offset_y:Wn.default(0),is_covered_with_solder_mask:E.boolean().optional(),x:Wn,y:Wn,layers:E.array(pc),port_hints:E.array(E.string()).optional(),pcb_component_id:E.string().optional(),pcb_port_id:E.string().optional(),pcb_plated_hole_id:po("pcb_plated_hole"),soldermask_margin:E.number().optional(),ccw_rotation:_m.optional()}),yKt=E.union([lAr,hAr,dAr,uAr,pAr,mAr]),xKt=E.object({type:E.literal("pcb_port"),pcb_port_id:po("pcb_port"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),source_port_id:E.string(),pcb_component_id:E.string().optional(),x:Wn,y:Wn,layers:E.array(pc),is_board_pinout:E.boolean().optional()}).describe("Defines a port on the PCB"),_Ar=E.object({type:E.literal("pcb_smtpad"),shape:E.literal("circle"),pcb_smtpad_id:po("pcb_smtpad"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),x:Wn,y:Wn,radius:E.number(),layer:pc,port_hints:E.array(E.string()).optional(),pcb_component_id:E.string().optional(),pcb_port_id:E.string().optional(),is_covered_with_solder_mask:E.boolean().optional(),soldermask_margin:E.number().optional()}),gAr=E.object({type:E.literal("pcb_smtpad"),shape:E.literal("rect"),pcb_smtpad_id:po("pcb_smtpad"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),x:Wn,y:Wn,width:E.number(),height:E.number(),rect_border_radius:E.number().optional(),corner_radius:E.number().optional(),layer:pc,port_hints:E.array(E.string()).optional(),pcb_component_id:E.string().optional(),pcb_port_id:E.string().optional(),is_covered_with_solder_mask:E.boolean().optional(),soldermask_margin:E.number().optional(),soldermask_margin_left:E.number().optional(),soldermask_margin_top:E.number().optional(),soldermask_margin_right:E.number().optional(),soldermask_margin_bottom:E.number().optional()}),AAr=E.object({type:E.literal("pcb_smtpad"),shape:E.literal("rotated_rect"),pcb_smtpad_id:po("pcb_smtpad"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),x:Wn,y:Wn,width:E.number(),height:E.number(),rect_border_radius:E.number().optional(),corner_radius:E.number().optional(),ccw_rotation:_m,layer:pc,port_hints:E.array(E.string()).optional(),pcb_component_id:E.string().optional(),pcb_port_id:E.string().optional(),is_covered_with_solder_mask:E.boolean().optional(),soldermask_margin:E.number().optional(),soldermask_margin_left:E.number().optional(),soldermask_margin_top:E.number().optional(),soldermask_margin_right:E.number().optional(),soldermask_margin_bottom:E.number().optional()}),CKt=E.object({type:E.literal("pcb_smtpad"),shape:E.literal("pill"),pcb_smtpad_id:po("pcb_smtpad"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),x:Wn,y:Wn,width:E.number(),height:E.number(),radius:E.number(),layer:pc,port_hints:E.array(E.string()).optional(),pcb_component_id:E.string().optional(),pcb_port_id:E.string().optional(),is_covered_with_solder_mask:E.boolean().optional(),soldermask_margin:E.number().optional()}),fAr=E.object({type:E.literal("pcb_smtpad"),shape:E.literal("rotated_pill"),pcb_smtpad_id:po("pcb_smtpad"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),x:Wn,y:Wn,width:E.number(),height:E.number(),radius:E.number(),ccw_rotation:_m,layer:pc,port_hints:E.array(E.string()).optional(),pcb_component_id:E.string().optional(),pcb_port_id:E.string().optional(),is_covered_with_solder_mask:E.boolean().optional(),soldermask_margin:E.number().optional()}),yAr=E.object({type:E.literal("pcb_smtpad"),shape:E.literal("polygon"),pcb_smtpad_id:po("pcb_smtpad"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),points:E.array(Wr),layer:pc,port_hints:E.array(E.string()).optional(),pcb_component_id:E.string().optional(),pcb_port_id:E.string().optional(),is_covered_with_solder_mask:E.boolean().optional(),soldermask_margin:E.number().optional()}),bKt=E.discriminatedUnion("shape",[_Ar,gAr,AAr,fAr,CKt,yAr]).describe("Defines an SMT pad on the PCB"),xAr=E.object({type:E.literal("pcb_solder_paste"),shape:E.literal("circle"),pcb_solder_paste_id:po("pcb_solder_paste"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),x:Wn,y:Wn,radius:E.number(),layer:pc,pcb_component_id:E.string().optional(),pcb_smtpad_id:E.string().optional()}),CAr=E.object({type:E.literal("pcb_solder_paste"),shape:E.literal("rect"),pcb_solder_paste_id:po("pcb_solder_paste"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),x:Wn,y:Wn,width:E.number(),height:E.number(),layer:pc,pcb_component_id:E.string().optional(),pcb_smtpad_id:E.string().optional()}),bAr=E.object({type:E.literal("pcb_solder_paste"),shape:E.literal("pill"),pcb_solder_paste_id:po("pcb_solder_paste"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),x:Wn,y:Wn,width:E.number(),height:E.number(),radius:E.number(),layer:pc,pcb_component_id:E.string().optional(),pcb_smtpad_id:E.string().optional()}),IAr=E.object({type:E.literal("pcb_solder_paste"),shape:E.literal("rotated_rect"),pcb_solder_paste_id:po("pcb_solder_paste"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),x:Wn,y:Wn,width:E.number(),height:E.number(),ccw_rotation:Wn,layer:pc,pcb_component_id:E.string().optional(),pcb_smtpad_id:E.string().optional()}),vAr=E.object({type:E.literal("pcb_solder_paste"),shape:E.literal("oval"),pcb_solder_paste_id:po("pcb_solder_paste"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),x:Wn,y:Wn,width:E.number(),height:E.number(),layer:pc,pcb_component_id:E.string().optional(),pcb_smtpad_id:E.string().optional()}),IKt=E.union([xAr,CAr,bAr,IAr,vAr]).describe("Defines solderpaste on the PCB"),vKt=E.object({type:E.literal("pcb_text"),pcb_text_id:po("pcb_text"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),text:E.string(),center:Wr,layer:pc,width:sr,height:sr,lines:E.number(),align:E.enum(["bottom-left"])}).describe("Defines text on the PCB"),SKt=E.object({route_type:E.literal("wire"),x:Wn,y:Wn,width:Wn,copper_pour_id:E.string().optional(),is_inside_copper_pour:E.boolean().optional(),start_pcb_port_id:E.string().optional(),end_pcb_port_id:E.string().optional(),layer:pc}),PKt=E.object({route_type:E.literal("via"),x:Wn,y:Wn,copper_pour_id:E.string().optional(),is_inside_copper_pour:E.boolean().optional(),hole_diameter:Wn.optional(),outer_diameter:Wn.optional(),from_layer:pc,to_layer:pc}),EKt=E.union([SKt,PKt]),MKt=E.object({type:E.literal("pcb_trace"),source_trace_id:E.string().optional(),pcb_component_id:E.string().optional(),pcb_trace_id:po("pcb_trace"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),route_thickness_mode:E.enum(["constant","interpolated"]).default("constant").optional(),route_order_index:E.number().optional(),should_round_corners:E.boolean().optional(),trace_length:E.number().optional(),highlight_color:E.string().optional(),route:E.array(EKt)}).describe("Defines a trace on the PCB"),wKt=E.object({type:E.literal("pcb_trace_warning"),pcb_trace_warning_id:po("pcb_trace_warning"),warning_type:E.literal("pcb_trace_warning").default("pcb_trace_warning"),message:E.string(),center:Wr.optional(),pcb_trace_id:E.string(),source_trace_id:E.string(),pcb_component_ids:E.array(E.string()),pcb_port_ids:E.array(E.string()),subcircuit_id:E.string().optional()}).describe("Defines a trace warning on the PCB"),BKt=$l.extend({type:E.literal("pcb_trace_error"),pcb_trace_error_id:po("pcb_trace_error"),error_type:E.literal("pcb_trace_error").default("pcb_trace_error"),center:Wr.optional(),pcb_trace_id:E.string(),source_trace_id:E.string(),pcb_component_ids:E.array(E.string()),pcb_port_ids:E.array(E.string()),subcircuit_id:E.string().optional()}).describe("Defines a trace error on the PCB"),TKt=$l.extend({type:E.literal("pcb_trace_missing_error"),pcb_trace_missing_error_id:po("pcb_trace_missing_error"),error_type:E.literal("pcb_trace_missing_error").default("pcb_trace_missing_error"),center:Wr.optional(),source_trace_id:E.string(),pcb_component_ids:E.array(E.string()),pcb_port_ids:E.array(E.string()),subcircuit_id:E.string().optional()}).describe("Defines an error when a source trace has no corresponding PCB trace"),DKt=$l.extend({type:E.literal("pcb_port_not_matched_error"),pcb_error_id:po("pcb_error"),error_type:E.literal("pcb_port_not_matched_error").default("pcb_port_not_matched_error"),pcb_component_ids:E.array(E.string()),subcircuit_id:E.string().optional()}).describe("Defines a trace error on the PCB where a port is not matched"),NKt=$l.extend({type:E.literal("pcb_port_not_connected_error"),pcb_port_not_connected_error_id:po("pcb_port_not_connected_error"),error_type:E.literal("pcb_port_not_connected_error").default("pcb_port_not_connected_error"),pcb_port_ids:E.array(E.string()),pcb_component_ids:E.array(E.string()),subcircuit_id:E.string().optional()}).describe("Defines an error when a pcb port is not connected to any trace"),RKt=E.object({type:E.literal("pcb_net"),pcb_net_id:po("pcb_net"),source_net_id:E.string().optional(),highlight_color:E.string().optional()}).describe("Defines a net on the PCB"),QKt=E.object({type:E.literal("pcb_via"),pcb_via_id:po("pcb_via"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),subcircuit_connectivity_map_key:E.string().optional(),x:Wn,y:Wn,outer_diameter:Wn.default("0.6mm"),hole_diameter:Wn.default("0.25mm"),from_layer:pc.optional(),to_layer:pc.optional(),layers:E.array(pc),pcb_trace_id:E.string().optional(),net_is_assignable:E.boolean().optional(),net_assigned:E.boolean().optional(),is_tented:E.boolean().optional()}).describe("Defines a via on the PCB"),kKt=E.object({type:E.literal("pcb_board"),pcb_board_id:po("pcb_board"),pcb_panel_id:E.string().optional(),carrier_pcb_board_id:E.string().optional(),is_subcircuit:E.boolean().optional(),subcircuit_id:E.string().optional(),is_mounted_to_carrier_board:E.boolean().optional(),width:sr.optional(),height:sr.optional(),center:Wr,display_offset_x:E.string().optional().describe("How to display the x offset for this board, usually corresponding with how the user specified it"),display_offset_y:E.string().optional().describe("How to display the y offset for this board, usually corresponding with how the user specified it"),thickness:sr.optional().default(1.4),num_layers:E.number().optional().default(4),outline:E.array(Wr).optional(),shape:E.enum(["rect","polygon"]).optional(),material:E.enum(["fr4","fr1"]).default("fr4"),anchor_position:Wr.optional(),anchor_alignment:Qw.optional(),position_mode:E.enum(["relative_to_panel_anchor","none"]).optional()}).merge(hKt).describe("Defines the board outline of the PCB"),LKt=E.object({type:E.literal("pcb_panel"),pcb_panel_id:po("pcb_panel"),width:sr,height:sr,center:Wr,thickness:sr.optional().default(1.4),covered_with_solder_mask:E.boolean().optional().default(!0)}).describe("Defines a PCB panel that can contain multiple boards"),HKt=$l.extend({type:E.literal("pcb_placement_error"),pcb_placement_error_id:po("pcb_placement_error"),error_type:E.literal("pcb_placement_error").default("pcb_placement_error"),subcircuit_id:E.string().optional()}).describe("Defines a placement error on the PCB"),FKt=$l.extend({type:E.literal("pcb_panelization_placement_error"),pcb_panelization_placement_error_id:po("pcb_panelization_placement_error"),error_type:E.literal("pcb_panelization_placement_error").default("pcb_panelization_placement_error"),pcb_panel_id:E.string().optional(),pcb_board_id:E.string().optional(),subcircuit_id:E.string().optional()}).describe("Defines a panelization placement error on the PCB"),zKt=E.object({type:E.literal("pcb_trace_hint"),pcb_trace_hint_id:po("pcb_trace_hint"),pcb_port_id:E.string(),pcb_component_id:E.string(),route:E.array(lKt),subcircuit_id:E.string().optional()}).describe("A hint that can be used during generation of a PCB trace"),OKt=E.object({type:E.literal("pcb_silkscreen_line"),pcb_silkscreen_line_id:po("pcb_silkscreen_line"),pcb_component_id:E.string(),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),stroke_width:Wn.default("0.1mm"),x1:Wn,y1:Wn,x2:Wn,y2:Wn,layer:wf}).describe("Defines a silkscreen line on the PCB"),VKt=E.object({type:E.literal("pcb_silkscreen_path"),pcb_silkscreen_path_id:po("pcb_silkscreen_path"),pcb_component_id:E.string(),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),layer:wf,route:E.array(Wr),stroke_width:sr}).describe("Defines a silkscreen path on the PCB"),YKt=E.object({type:E.literal("pcb_silkscreen_text"),pcb_silkscreen_text_id:po("pcb_silkscreen_text"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),font:E.literal("tscircuit2024").default("tscircuit2024"),font_size:Wn.default("0.2mm"),pcb_component_id:E.string(),text:E.string(),is_knockout:E.boolean().default(!1).optional(),knockout_padding:E.object({left:sr,top:sr,bottom:sr,right:sr}).default({left:"0.2mm",top:"0.2mm",bottom:"0.2mm",right:"0.2mm"}).optional(),ccw_rotation:E.number().optional(),layer:pc,is_mirrored:E.boolean().default(!1).optional(),anchor_position:Wr.default({x:0,y:0}),anchor_alignment:Qw.default("center")}).describe("Defines silkscreen text on the PCB"),GKt=E.object({type:E.literal("pcb_copper_text"),pcb_copper_text_id:po("pcb_copper_text"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),font:E.literal("tscircuit2024").default("tscircuit2024"),font_size:Wn.default("0.2mm"),pcb_component_id:E.string(),text:E.string(),is_knockout:E.boolean().default(!1).optional(),knockout_padding:E.object({left:sr,top:sr,bottom:sr,right:sr}).default({left:"0.2mm",top:"0.2mm",bottom:"0.2mm",right:"0.2mm"}).optional(),ccw_rotation:E.number().optional(),layer:pc,is_mirrored:E.boolean().default(!1).optional(),anchor_position:Wr.default({x:0,y:0}),anchor_alignment:Qw.default("center")}).describe("Defines copper text on the PCB"),UKt=E.object({type:E.literal("pcb_silkscreen_rect"),pcb_silkscreen_rect_id:po("pcb_silkscreen_rect"),pcb_component_id:E.string(),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),center:Wr,width:sr,height:sr,layer:pc,stroke_width:sr.default("1mm"),corner_radius:sr.optional(),is_filled:E.boolean().default(!0).optional(),has_stroke:E.boolean().optional(),is_stroke_dashed:E.boolean().optional(),ccw_rotation:E.number().optional()}).describe("Defines a silkscreen rect on the PCB"),WKt=E.object({type:E.literal("pcb_silkscreen_circle"),pcb_silkscreen_circle_id:po("pcb_silkscreen_circle"),pcb_component_id:E.string(),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),center:Wr,radius:sr,layer:wf,stroke_width:sr.default("1mm"),is_filled:E.boolean().optional()}).describe("Defines a silkscreen circle on the PCB"),XKt=E.object({type:E.literal("pcb_silkscreen_oval"),pcb_silkscreen_oval_id:po("pcb_silkscreen_oval"),pcb_component_id:E.string(),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),center:Wr,radius_x:Wn,radius_y:Wn,layer:wf,ccw_rotation:_m.optional()}).describe("Defines a silkscreen oval on the PCB"),jKt=E.object({type:E.literal("pcb_silkscreen_pill"),pcb_silkscreen_pill_id:po("pcb_silkscreen_pill"),pcb_component_id:E.string(),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),center:Wr,width:sr,height:sr,layer:pc,ccw_rotation:E.number().optional()}).describe("Defines a silkscreen pill on the PCB"),KKt=E.object({type:E.literal("pcb_fabrication_note_text"),pcb_fabrication_note_text_id:po("pcb_fabrication_note_text"),subcircuit_id:E.string().optional(),pcb_group_id:E.string().optional(),font:E.literal("tscircuit2024").default("tscircuit2024"),font_size:Wn.default("1mm"),pcb_component_id:E.string(),text:E.string(),layer:wf,anchor_position:Wr.default({x:0,y:0}),anchor_alignment:E.enum(["center","top_left","top_right","bottom_left","bottom_right"]).default("center"),color:E.string().optional()}).describe("Defines a fabrication note in text on the PCB, useful for leaving notes for assemblers or fabricators"),$Kt=E.object({type:E.literal("pcb_fabrication_note_path"),pcb_fabrication_note_path_id:po("pcb_fabrication_note_path"),pcb_component_id:E.string(),subcircuit_id:E.string().optional(),layer:pc,route:E.array(Wr),stroke_width:sr,color:E.string().optional()}).describe("Defines a fabrication path on the PCB for fabricators or assemblers"),qKt=E.object({type:E.literal("pcb_fabrication_note_rect"),pcb_fabrication_note_rect_id:po("pcb_fabrication_note_rect"),pcb_component_id:E.string(),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),center:Wr,width:sr,height:sr,layer:wf,stroke_width:sr.default("0.1mm"),corner_radius:sr.optional(),is_filled:E.boolean().optional(),has_stroke:E.boolean().optional(),is_stroke_dashed:E.boolean().optional(),color:E.string().optional()}).describe("Defines a fabrication note rectangle on the PCB"),JKt=E.object({type:E.literal("pcb_fabrication_note_dimension"),pcb_fabrication_note_dimension_id:po("pcb_fabrication_note_dimension"),pcb_component_id:E.string(),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),layer:wf,from:Wr,to:Wr,text:E.string().optional(),text_ccw_rotation:E.number().optional(),offset:sr.optional(),offset_distance:sr.optional(),offset_direction:E.object({x:E.number(),y:E.number()}).optional(),font:E.literal("tscircuit2024").default("tscircuit2024"),font_size:sr.default("1mm"),color:E.string().optional(),arrow_size:sr.default("1mm")}).describe("Defines a measurement annotation within PCB fabrication notes"),ZKt=E.object({type:E.literal("pcb_note_text"),pcb_note_text_id:po("pcb_note_text"),pcb_component_id:E.string().optional(),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),name:E.string().optional(),font:E.literal("tscircuit2024").default("tscircuit2024"),font_size:Wn.default("1mm"),text:E.string().optional(),anchor_position:Wr.default({x:0,y:0}),anchor_alignment:E.enum(["center","top_left","top_right","bottom_left","bottom_right"]).default("center"),layer:wf.default("top"),is_mirrored_from_top_view:E.boolean().optional(),color:E.string().optional()}).describe("Defines a documentation note in text on the PCB"),e$t=E.object({type:E.literal("pcb_note_rect"),pcb_note_rect_id:po("pcb_note_rect"),pcb_component_id:E.string().optional(),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),name:E.string().optional(),text:E.string().optional(),center:Wr,width:sr,height:sr,layer:wf.default("top"),stroke_width:sr.default("0.1mm"),corner_radius:sr.optional(),is_filled:E.boolean().optional(),has_stroke:E.boolean().optional(),is_stroke_dashed:E.boolean().optional(),color:E.string().optional()}).describe("Defines a rectangular documentation note on the PCB"),t$t=E.object({type:E.literal("pcb_note_path"),pcb_note_path_id:po("pcb_note_path"),pcb_component_id:E.string().optional(),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),name:E.string().optional(),text:E.string().optional(),route:E.array(Wr),layer:wf.default("top"),stroke_width:sr.default("0.1mm"),color:E.string().optional()}).describe("Defines a polyline documentation note on the PCB"),n$t=E.object({type:E.literal("pcb_note_line"),pcb_note_line_id:po("pcb_note_line"),pcb_component_id:E.string().optional(),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),name:E.string().optional(),text:E.string().optional(),x1:Wn,y1:Wn,x2:Wn,y2:Wn,layer:wf.default("top"),stroke_width:Wn.default("0.1mm"),color:E.string().optional(),is_dashed:E.boolean().optional()}).describe("Defines a straight documentation note line on the PCB"),o$t=E.object({type:E.literal("pcb_note_dimension"),pcb_note_dimension_id:po("pcb_note_dimension"),pcb_component_id:E.string().optional(),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),name:E.string().optional(),from:Wr,to:Wr,text:E.string().optional(),text_ccw_rotation:E.number().optional(),offset_distance:sr.optional(),offset_direction:E.object({x:E.number(),y:E.number()}).optional(),font:E.literal("tscircuit2024").default("tscircuit2024"),font_size:sr.default("1mm"),layer:wf.default("top"),color:E.string().optional(),arrow_size:sr.default("1mm")}).describe("Defines a measurement annotation within PCB documentation notes"),r$t=$l.extend({type:E.literal("pcb_footprint_overlap_error"),pcb_error_id:po("pcb_error"),error_type:E.literal("pcb_footprint_overlap_error").default("pcb_footprint_overlap_error"),pcb_smtpad_ids:E.array(E.string()).optional(),pcb_plated_hole_ids:E.array(E.string()).optional(),pcb_hole_ids:E.array(E.string()).optional(),pcb_keepout_ids:E.array(E.string()).optional()}).describe("Error emitted when a pcb footprint overlaps with another element"),i$t=$l.extend({type:E.literal("pcb_courtyard_overlap_error"),pcb_error_id:po("pcb_error"),error_type:E.literal("pcb_courtyard_overlap_error").default("pcb_courtyard_overlap_error"),pcb_component_ids:E.tuple([E.string(),E.string()])}).describe("Error emitted when the courtyard (CrtYd) of one PCB component overlaps with the courtyard of another"),s$t=E.object({type:E.literal("pcb_keepout"),shape:E.literal("rect"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),center:Wr,width:Wn,height:Wn,pcb_keepout_id:E.string(),layers:E.array(E.string()),description:E.string().optional()}).or(E.object({type:E.literal("pcb_keepout"),shape:E.literal("circle"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),center:Wr,radius:Wn,pcb_keepout_id:E.string(),layers:E.array(E.string()),description:E.string().optional()})),Obe=E.object({type:E.literal("pcb_cutout"),pcb_cutout_id:po("pcb_cutout"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),pcb_board_id:E.string().optional(),pcb_panel_id:E.string().optional()}),a$t=Obe.extend({shape:E.literal("rect"),center:Wr,width:sr,height:sr,rotation:_m.optional(),corner_radius:sr.optional()}),c$t=Obe.extend({shape:E.literal("circle"),center:Wr,radius:sr}),l$t=Obe.extend({shape:E.literal("polygon"),points:E.array(Wr)}),h$t=Obe.extend({shape:E.literal("path"),route:E.array(Wr),slot_width:sr,slot_length:sr.optional(),space_between_slots:sr.optional(),slot_corner_radius:sr.optional()}),d$t=E.discriminatedUnion("shape",[a$t,c$t,l$t,h$t]).describe("Defines a cutout on the PCB, removing board material."),u$t=$l.extend({type:E.literal("pcb_missing_footprint_error"),pcb_missing_footprint_error_id:po("pcb_missing_footprint_error"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),error_type:E.literal("pcb_missing_footprint_error").default("pcb_missing_footprint_error"),source_component_id:E.string()}).describe("Defines a missing footprint error on the PCB"),p$t=$l.extend({type:E.literal("external_footprint_load_error"),external_footprint_load_error_id:po("external_footprint_load_error"),pcb_component_id:E.string(),source_component_id:E.string(),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),footprinter_string:E.string().optional(),error_type:E.literal("external_footprint_load_error").default("external_footprint_load_error")}).describe("Defines an error when an external footprint fails to load"),m$t=$l.extend({type:E.literal("circuit_json_footprint_load_error"),circuit_json_footprint_load_error_id:po("circuit_json_footprint_load_error"),pcb_component_id:E.string(),source_component_id:E.string(),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),error_type:E.literal("circuit_json_footprint_load_error").default("circuit_json_footprint_load_error"),circuit_json:E.array(E.any()).optional()}).describe("Defines an error when a circuit JSON footprint fails to load"),_$t=E.object({type:E.literal("pcb_group"),pcb_group_id:po("pcb_group"),source_group_id:E.string(),is_subcircuit:E.boolean().optional(),subcircuit_id:E.string().optional(),width:sr.optional(),height:sr.optional(),center:Wr,display_offset_x:E.string().optional().describe("How to display the x offset for this group, usually corresponding with how the user specified it"),display_offset_y:E.string().optional().describe("How to display the y offset for this group, usually corresponding with how the user specified it"),outline:E.array(Wr).optional(),anchor_position:Wr.optional(),anchor_alignment:Qw.default("center"),position_mode:E.enum(["packed","relative_to_group_anchor","none"]).optional(),positioned_relative_to_pcb_group_id:E.string().optional(),positioned_relative_to_pcb_board_id:E.string().optional(),pcb_component_ids:E.array(E.string()),child_layout_mode:E.enum(["packed","none"]).optional(),name:E.string().optional(),description:E.string().optional(),layout_mode:E.string().optional(),autorouter_configuration:E.object({trace_clearance:sr}).optional(),autorouter_used_string:E.string().optional()}).describe("Defines a group of components on the PCB"),g$t=$l.extend({type:E.literal("pcb_autorouting_error"),pcb_error_id:po("pcb_autorouting_error"),error_type:E.literal("pcb_autorouting_error").default("pcb_autorouting_error"),subcircuit_id:E.string().optional()}).describe("The autorouting has failed to route a portion of the board"),A$t=E.object({type:E.literal("pcb_manual_edit_conflict_warning"),pcb_manual_edit_conflict_warning_id:po("pcb_manual_edit_conflict_warning"),warning_type:E.literal("pcb_manual_edit_conflict_warning").default("pcb_manual_edit_conflict_warning"),message:E.string(),pcb_component_id:E.string(),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),source_component_id:E.string()}).describe("Warning emitted when a component has both manual placement and explicit pcbX/pcbY coordinates"),ozt=E.enum(["x-","x+","y+","y-"]),f$t=E.object({type:E.literal("pcb_connector_not_in_accessible_orientation_warning"),pcb_connector_not_in_accessible_orientation_warning_id:po("pcb_connector_not_in_accessible_orientation_warning"),warning_type:E.literal("pcb_connector_not_in_accessible_orientation_warning").default("pcb_connector_not_in_accessible_orientation_warning"),message:E.string(),pcb_component_id:E.string(),source_component_id:E.string().optional(),pcb_board_id:E.string().optional(),facing_direction:ozt,recommended_facing_direction:ozt,subcircuit_id:E.string().optional()}).describe("Warning emitted when a connector PCB component is facing inward toward the board and should be reoriented to an outward-facing direction"),y$t=E.object({type:E.literal("supplier_footprint_mismatch_warning"),supplier_footprint_mismatch_warning_id:po("supplier_footprint_mismatch_warning"),warning_type:E.literal("supplier_footprint_mismatch_warning").default("supplier_footprint_mismatch_warning"),message:E.string(),source_component_id:E.string(),pcb_component_id:E.string().optional(),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),supplier_name:T$e.optional(),supplier_part_number:E.string().optional(),supplier_footprint_url:E.string().optional(),footprint_copper_intersection_over_union:E.number()}).describe("Warning emitted when a supplier part footprint does not match the expected footprint"),x$t=E.object({type:E.literal("pcb_breakout_point"),pcb_breakout_point_id:po("pcb_breakout_point"),pcb_group_id:E.string(),subcircuit_id:E.string().optional(),source_trace_id:E.string().optional(),source_port_id:E.string().optional(),source_net_id:E.string().optional(),x:Wn,y:Wn}).describe("Defines a routing target within a pcb_group for a source_trace or source_net"),C$t=E.object({type:E.literal("pcb_ground_plane"),pcb_ground_plane_id:po("pcb_ground_plane"),source_pcb_ground_plane_id:E.string(),source_net_id:E.string(),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional()}).describe("Defines a ground plane on the PCB"),b$t=E.object({type:E.literal("pcb_ground_plane_region"),pcb_ground_plane_region_id:po("pcb_ground_plane_region"),pcb_ground_plane_id:E.string(),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),layer:pc,points:E.array(Wr)}).describe("Defines a polygon region of a ground plane"),I$t=E.object({type:E.literal("pcb_thermal_spoke"),pcb_thermal_spoke_id:po("pcb_thermal_spoke"),pcb_ground_plane_id:E.string(),shape:E.string(),spoke_count:E.number(),spoke_thickness:Wn,spoke_inner_diameter:Wn,spoke_outer_diameter:Wn,pcb_plated_hole_id:E.string().optional(),subcircuit_id:E.string().optional()}).describe("Pattern for connecting a ground plane to a plated hole"),tqe=E.object({type:E.literal("pcb_copper_pour"),pcb_copper_pour_id:po("pcb_copper_pour"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),layer:pc,source_net_id:E.string().optional(),covered_with_solder_mask:E.boolean().optional().default(!0)}),v$t=tqe.extend({shape:E.literal("rect"),center:Wr,width:sr,height:sr,rotation:_m.optional()}),S$t=tqe.extend({shape:E.literal("brep"),brep_shape:aKt}),P$t=tqe.extend({shape:E.literal("polygon"),points:E.array(Wr)}),E$t=E.discriminatedUnion("shape",[v$t,S$t,P$t]).describe("Defines a copper pour on the PCB."),M$t=$l.extend({type:E.literal("pcb_component_outside_board_error"),pcb_component_outside_board_error_id:po("pcb_component_outside_board_error"),error_type:E.literal("pcb_component_outside_board_error").default("pcb_component_outside_board_error"),pcb_component_id:E.string(),pcb_board_id:E.string(),component_center:Wr,component_bounds:E.object({min_x:E.number(),max_x:E.number(),min_y:E.number(),max_y:E.number()}),subcircuit_id:E.string().optional(),source_component_id:E.string().optional()}).describe("Error emitted when a PCB component is placed outside the board boundaries"),w$t=$l.extend({type:E.literal("pcb_component_not_on_board_edge_error"),pcb_component_not_on_board_edge_error_id:po("pcb_component_not_on_board_edge_error"),error_type:E.literal("pcb_component_not_on_board_edge_error").default("pcb_component_not_on_board_edge_error"),pcb_component_id:E.string(),pcb_board_id:E.string(),component_center:Wr,pad_to_nearest_board_edge_distance:E.number(),source_component_id:E.string().optional(),subcircuit_id:E.string().optional()}).describe("Error emitted when a component that must be placed on the board edge is centered away from the edge"),B$t=$l.extend({type:E.literal("pcb_component_invalid_layer_error"),pcb_component_invalid_layer_error_id:po("pcb_component_invalid_layer_error"),error_type:E.literal("pcb_component_invalid_layer_error").default("pcb_component_invalid_layer_error"),pcb_component_id:E.string().optional(),source_component_id:E.string(),layer:pc,subcircuit_id:E.string().optional()}).describe("Error emitted when a component is placed on an invalid layer (components can only be on 'top' or 'bottom' layers)"),T$t=$l.extend({type:E.literal("pcb_via_clearance_error"),pcb_error_id:po("pcb_error"),error_type:E.literal("pcb_via_clearance_error").default("pcb_via_clearance_error"),pcb_via_ids:E.array(E.string()).min(2),minimum_clearance:Wn.optional(),actual_clearance:Wn.optional(),pcb_center:E.object({x:E.number().optional(),y:E.number().optional()}).optional(),subcircuit_id:E.string().optional()}).describe("Error emitted when vias are closer than the allowed clearance"),D$t=$l.extend({type:E.literal("pcb_via_trace_clearance_error"),pcb_via_trace_clearance_error_id:po("pcb_via_trace_clearance_error"),error_type:E.literal("pcb_via_trace_clearance_error").default("pcb_via_trace_clearance_error"),pcb_via_id:E.string(),pcb_trace_id:E.string(),minimum_clearance:Wn.optional(),actual_clearance:Wn.optional(),center:E.object({x:E.number().optional(),y:E.number().optional()}).optional(),subcircuit_id:E.string().optional()}).describe("Error emitted when a via and trace are closer than the allowed clearance"),N$t=$l.extend({type:E.literal("pcb_pad_pad_clearance_error"),pcb_pad_pad_clearance_error_id:po("pcb_pad_pad_clearance_error"),error_type:E.literal("pcb_pad_pad_clearance_error").default("pcb_pad_pad_clearance_error"),pcb_pad_ids:E.array(E.string()).min(2),minimum_clearance:Wn.optional(),actual_clearance:Wn.optional(),center:E.object({x:E.number().optional(),y:E.number().optional()}).optional(),subcircuit_id:E.string().optional()}).describe("Error emitted when pads are closer than the allowed clearance"),R$t=$l.extend({type:E.literal("pcb_pad_trace_clearance_error"),pcb_pad_trace_clearance_error_id:po("pcb_pad_trace_clearance_error"),error_type:E.literal("pcb_pad_trace_clearance_error").default("pcb_pad_trace_clearance_error"),pcb_pad_id:E.string(),pcb_trace_id:E.string(),minimum_clearance:Wn.optional(),actual_clearance:Wn.optional(),center:E.object({x:E.number().optional(),y:E.number().optional()}).optional(),subcircuit_id:E.string().optional()}).describe("Error emitted when a pad and trace are closer than allowed clearance"),Q$t=E.object({type:E.literal("pcb_courtyard_rect"),pcb_courtyard_rect_id:po("pcb_courtyard_rect"),pcb_component_id:E.string(),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),center:Wr,width:sr,height:sr,layer:wf,ccw_rotation:_m.optional(),color:E.string().optional()}).describe("Defines a courtyard rectangle on the PCB"),k$t=E.object({type:E.literal("pcb_courtyard_outline"),pcb_courtyard_outline_id:po("pcb_courtyard_outline"),pcb_component_id:E.string(),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),layer:wf,outline:E.array(Wr).min(2)}).describe("Defines a courtyard outline on the PCB"),L$t=E.object({type:E.literal("pcb_courtyard_polygon"),pcb_courtyard_polygon_id:po("pcb_courtyard_polygon"),pcb_component_id:E.string(),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),layer:wf,points:E.array(Wr).min(3),color:E.string().optional()}).describe("Defines a courtyard polygon on the PCB"),H$t=E.object({type:E.literal("pcb_courtyard_circle"),pcb_courtyard_circle_id:po("pcb_courtyard_circle"),pcb_component_id:E.string(),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),center:Wr,radius:sr,layer:wf,color:E.string().optional()}).describe("Defines a courtyard circle on the PCB"),SAr=["obj","stl","3mf","gltf","glb","step","wrl"],F$t=["x+","x-","y+","y-","z+","z-"],PAr={obj:"z+",stl:"z+","3mf":"z+",gltf:"y+",glb:"y+",step:"z+",wrl:"y+"},z$t=E.object({type:E.literal("cad_component"),cad_component_id:E.string(),pcb_component_id:E.string(),source_component_id:E.string(),position:_w,rotation:_w.optional(),size:_w.optional(),layer:pc.optional(),subcircuit_id:E.string().optional(),footprinter_string:E.string().optional(),model_obj_url:E.string().optional(),model_stl_url:E.string().optional(),model_3mf_url:E.string().optional(),model_gltf_url:E.string().optional(),model_glb_url:E.string().optional(),model_step_url:E.string().optional(),model_wrl_url:E.string().optional(),model_asset:WXt.optional(),model_unit_to_mm_scale_factor:E.number().optional(),model_board_normal_direction:E.enum(F$t).optional().describe(`The direction in the model's coordinate space that is considered "up" or "coming out of the board surface"`),model_origin_position:_w.optional(),model_origin_alignment:E.enum(["unknown","center","center_of_component_on_board_surface","bottom_center_of_component"]).optional(),model_object_fit:E.enum(["contain_within_bounds","fill_bounds"]).optional().default("contain_within_bounds"),model_jscad:E.any().optional(),show_as_translucent_model:E.boolean().optional(),anchor_alignment:E.enum(["center","center_of_component_on_board_surface"]).optional().default("center")}).describe("Defines a component on the PCB"),nqe=E.enum(["sinewave","square","triangle","sawtooth"]),EAr=E.union([E.string(),E.number()]).transform((e)=>typeof e=="string"?e.endsWith("%")?parseFloat(e.slice(0,-1))/100:parseFloat(e):e).pipe(E.number().min(0,"Duty cycle must be non-negative").max(1,"Duty cycle cannot be greater than 100%")),O$t=E.object({type:E.literal("simulation_voltage_source"),simulation_voltage_source_id:po("simulation_voltage_source"),is_dc_source:E.literal(!0).optional().default(!0),positive_source_port_id:E.string().optional(),negative_source_port_id:E.string().optional(),positive_source_net_id:E.string().optional(),negative_source_net_id:E.string().optional(),voltage:Ew}).describe("Defines a DC voltage source for simulation"),V$t=E.object({type:E.literal("simulation_voltage_source"),simulation_voltage_source_id:po("simulation_voltage_source"),is_dc_source:E.literal(!1),terminal1_source_port_id:E.string().optional(),terminal2_source_port_id:E.string().optional(),terminal1_source_net_id:E.string().optional(),terminal2_source_net_id:E.string().optional(),voltage:Ew.optional(),frequency:xV.optional(),peak_to_peak_voltage:Ew.optional(),wave_shape:nqe.optional(),phase:_m.optional(),duty_cycle:EAr.optional()}).describe("Defines an AC voltage source for simulation"),Y$t=E.union([O$t,V$t]).describe("Defines a voltage source for simulation"),MAr=E.union([E.string(),E.number()]).transform((e)=>typeof e=="string"?e.endsWith("%")?parseFloat(e.slice(0,-1))/100:parseFloat(e):e).pipe(E.number().min(0,"Duty cycle must be non-negative").max(1,"Duty cycle cannot be greater than 100%")),G$t=E.object({type:E.literal("simulation_current_source"),simulation_current_source_id:po("simulation_current_source"),is_dc_source:E.literal(!0).optional().default(!0),positive_source_port_id:E.string().optional(),negative_source_port_id:E.string().optional(),positive_source_net_id:E.string().optional(),negative_source_net_id:E.string().optional(),current:eq}).describe("Defines a DC current source for simulation"),U$t=E.object({type:E.literal("simulation_current_source"),simulation_current_source_id:po("simulation_current_source"),is_dc_source:E.literal(!1),terminal1_source_port_id:E.string().optional(),terminal2_source_port_id:E.string().optional(),terminal1_source_net_id:E.string().optional(),terminal2_source_net_id:E.string().optional(),current:eq.optional(),frequency:xV.optional(),peak_to_peak_current:eq.optional(),wave_shape:nqe.optional(),phase:_m.optional(),duty_cycle:MAr.optional()}).describe("Defines an AC current source for simulation"),W$t=E.union([G$t,U$t]).describe("Defines a current source for simulation"),X$t=E.union([E.literal("spice_dc_sweep"),E.literal("spice_dc_operating_point"),E.literal("spice_transient_analysis"),E.literal("spice_ac_analysis")]),j$t=E.object({type:E.literal("simulation_experiment"),simulation_experiment_id:po("simulation_experiment"),name:E.string(),experiment_type:X$t,time_per_step:Ele.optional(),start_time_ms:rV.optional(),end_time_ms:rV.optional()}).describe("Defines a simulation experiment configuration"),K$t=E.object({type:E.literal("simulation_transient_voltage_graph"),simulation_transient_voltage_graph_id:po("simulation_transient_voltage_graph"),simulation_experiment_id:E.string(),timestamps_ms:E.array(E.number()).optional(),voltage_levels:E.array(E.number()),source_component_id:E.string().optional(),subcircuit_connectivity_map_key:E.string().optional(),time_per_step:Ele,start_time_ms:rV,end_time_ms:rV,name:E.string().optional(),color:E.string().optional()}).describe("Stores voltage measurements over time for a simulation"),$$t=E.object({type:E.literal("simulation_switch"),simulation_switch_id:po("simulation_switch"),source_component_id:E.string().optional(),closes_at:rV.optional(),opens_at:rV.optional(),starts_closed:E.boolean().optional(),switching_frequency:xV.optional()}).describe("Defines a switch for simulation timing control"),q$t=E.object({type:E.literal("simulation_voltage_probe"),simulation_voltage_probe_id:po("simulation_voltage_probe"),source_component_id:E.string().optional(),name:E.string().optional(),signal_input_source_port_id:E.string().optional(),signal_input_source_net_id:E.string().optional(),reference_input_source_port_id:E.string().optional(),reference_input_source_net_id:E.string().optional(),subcircuit_id:E.string().optional(),color:E.string().optional()}).describe("Defines a voltage probe for simulation. If a reference input is not provided, it measures against ground. If a reference input is provided, it measures the differential voltage between two points.").superRefine((e,t)=>{if(e.reference_input_source_port_id||e.reference_input_source_net_id){let n=!!e.signal_input_source_port_id||!!e.reference_input_source_port_id,o=!!e.signal_input_source_net_id||!!e.reference_input_source_net_id;n&&o?t.addIssue({code:E.ZodIssueCode.custom,message:"Cannot mix port and net connections in a differential probe."}):n?e.signal_input_source_port_id&&e.reference_input_source_port_id||t.addIssue({code:E.ZodIssueCode.custom,message:"Differential port probe requires both signal_input_source_port_id and reference_input_source_port_id."}):o&&(e.signal_input_source_net_id&&e.reference_input_source_net_id||t.addIssue({code:E.ZodIssueCode.custom,message:"Differential net probe requires both signal_input_source_net_id and reference_input_source_net_id."}))}else!!e.signal_input_source_port_id==!!e.signal_input_source_net_id&&t.addIssue({code:E.ZodIssueCode.custom,message:"A voltage probe must have exactly one of signal_input_source_port_id or signal_input_source_net_id."})}),J$t=$l.extend({type:E.literal("simulation_unknown_experiment_error"),simulation_unknown_experiment_error_id:po("simulation_unknown_experiment_error"),error_type:E.literal("simulation_unknown_experiment_error").default("simulation_unknown_experiment_error"),simulation_experiment_id:E.string().optional(),subcircuit_id:E.string().optional()}).describe("An unknown error occurred during the simulation experiment."),Z$t=E.object({type:E.literal("simulation_op_amp"),simulation_op_amp_id:po("simulation_op_amp"),source_component_id:E.string().optional(),inverting_input_source_port_id:E.string(),non_inverting_input_source_port_id:E.string(),output_source_port_id:E.string(),positive_supply_source_port_id:E.string(),negative_supply_source_port_id:E.string()}).describe("Defines a simple ideal operational amplifier for simulation"),eqt=E.union([yjt,Ajt,fjt,gjt,Cjt,xjt,Q$e,D$e,Fbe,R$e,N$e,k$e,L$e,H$e,O$e,V$e,Y$e,j$e,G$e,U$e,W$e,X$e,z$e,F$e,vjt,Pjt,bjt,K$e,$$e,q$e,J$e,Z$e,Ejt,Mjt,wjt,Bjt,Tjt,eqe,Ijt,dKt,fKt,u$t,p$t,m$t,A$t,f$t,y$t,yKt,s$t,xKt,RKt,vKt,MKt,wKt,QKt,bKt,IKt,kKt,LKt,_$t,zKt,OKt,VKt,YKt,jKt,GKt,UKt,WKt,XKt,BKt,TKt,HKt,FKt,DKt,NKt,T$t,D$t,N$t,R$t,$Kt,KKt,qKt,JKt,ZKt,e$t,t$t,n$t,o$t,g$t,r$t,i$t,x$t,d$t,C$t,b$t,I$t,E$t,M$t,w$t,B$t,Q$t,k$t,L$t,H$t,Djt,Ujt,zjt,Ojt,Vjt,Yjt,Hjt,Fjt,Wjt,Gjt,Njt,jjt,Kjt,Xjt,Zjt,eKt,tKt,nKt,iKt,oKt,rKt,z$t,Y$t,W$t,j$t,K$t,$$t,q$t,J$t,Z$t]),NCe=eqt;function rzt(e,t,n){if(!t||!n)return;let o=e.get(t);o||(o=new Set,e.set(t,o)),o.add(n);let r=e.get(n);r||(r=new Set,e.set(n,r)),r.add(t)}var yje=(e,t={})=>{let n=e,o=n._internal_store;if(!o){o={counts:{},editCount:0},n._internal_store=o;for(let i of n){let s=i.type,a=i[`${s}_id`];if(!a)continue;let c=Number.parseInt(a.split("_").pop());Number.isNaN(c)||(o.counts[s]=Math.max(o.counts[s]??0,c))}}let r=new Proxy({},{get:(i,s)=>{if(s==="toArray")return()=>(n.editCount=o.editCount,n);if(s==="editCount")return o.editCount;if(s==="subtree")return(c)=>yje(function(l,h){if(!h.subcircuit_id&&!h.source_group_id)return[...l];let d=h;if(h.subcircuit_id){let A=new Set([h.subcircuit_id]),g=new Map,f=new Map;for(let x of l)if(x.type==="source_group"){let{source_group_id:C,subcircuit_id:b}=x;b&&f.set(C,b);let I=x.parent_source_group_id;I&&(g.has(I)||g.set(I,[]),g.get(I).push(C))}let y;for(let[x,C]of f)if(C===h.subcircuit_id){y=x;break}if(y){let x=(C)=>{let b=g.get(C)||[];for(let I of b){let v=f.get(I);v&&A.add(v),x(I)}};x(y),d={...h,subcircuit_ids:Array.from(A)}}}let u=new Map;for(let A of l){let g=A[`${A.type}_id`];typeof g=="string"&&u.set(g,A)}let _=new Map;for(let A of l){let g=Object.entries(A);for(let[f,y]of g)if(f!=="parent_source_group_id"){if(f.endsWith("_id")&&typeof y=="string")rzt(_,A,u.get(y));else if(f.endsWith("_ids")&&Array.isArray(y))for(let x of y)typeof x=="string"&&rzt(_,A,u.get(x))}}let p=[],m=new Set;for(let A of l){let g=!1;(d.subcircuit_id&&("subcircuit_id"in A)&&A.subcircuit_id===d.subcircuit_id||d.subcircuit_ids&&("subcircuit_id"in A)&&A.subcircuit_id&&d.subcircuit_ids.includes(A.subcircuit_id)||d.source_group_id&&("source_group_id"in A)&&A.source_group_id===d.source_group_id||d.source_group_id&&("member_source_group_ids"in A)&&Array.isArray(A.member_source_group_ids)&&A.member_source_group_ids.includes(d.source_group_id))&&(g=!0),g&&(p.push(A),m.add(A))}for(;p.length>0;){let A=p.shift(),g=_.get(A);if(g)for(let f of g)m.has(f)||(m.add(f),p.push(f))}return l.filter((A)=>m.has(A))}(n,c),t);if(s==="insert")return(c)=>{let l=c.type;if(!l)throw Error("insert requires an element with a type");o.counts[l]??=-1,o.counts[l]++;let h=o.counts[l],d={...c,type:l,[`${l}_id`]:`${l}_${h}`};if(t.validateInserts)(vCe[l]??NCe).parse(d);return n.push(d),o.editCount++,d};if(s==="insertAll")return(c)=>c.map((l)=>r.insert(l));let a=s;return{get:(c)=>n.find((l)=>l.type===a&&l[`${a}_id`]===c),getUsing:(c)=>{let l=Object.keys(c);if(l.length!==1)throw Error("getUsing requires exactly one key, e.g. { pcb_component_id }");let h=l[0],d=h.replace("_id",""),u=n.find((_)=>_.type===d&&_[h]===c[h]);return u?n.find((_)=>_.type===a&&_[`${a}_id`]===u[`${a}_id`]):null},getWhere:(c)=>{let l=Object.keys(c);return n.find((h)=>h.type===a&&l.every((d)=>h[d]===c[d]))},list:(c)=>{let l=c?Object.keys(c):[];return n.filter((h)=>h.type===a&&l.every((d)=>h[d]===c[d]))},insert:(c)=>{o.counts[a]??=-1,o.counts[a]++;let l=o.counts[a],h={type:a,[`${a}_id`]:`${a}_${l}`,...c};if(t.validateInserts)(vCe[a]??NCe).parse(h);return n.push(h),o.editCount++,h},delete:(c)=>{let l=n.find((h)=>h[`${a}_id`]===c);l&&(n.splice(n.indexOf(l),1),o.editCount++)},update:(c,l)=>{let h=n.find((d)=>d.type===a&&d[`${a}_id`]===c);return h?(Object.assign(h,l),o.editCount++,h):null},select:(c)=>{if(a==="source_component")return n.find((l)=>l.type==="source_component"&&l.name===c.replace(/\./g,""));if(a==="pcb_port"||a==="source_port"||a==="schematic_port"){let[l,h]=c.replace(/\./g,"").split(/[\s\>]+/),d=n.find((_)=>_.type==="source_component"&&_.name===l);if(!d)return null;let u=n.find((_)=>_.type==="source_port"&&_.source_component_id===d.source_component_id&&(_.name===h||(_.port_hints??[]).includes(h)));if(!u)return null;if(a==="source_port")return u;if(a==="pcb_port")return n.find((_)=>_.type==="pcb_port"&&_.source_port_id===u.source_port_id);if(a==="schematic_port")return n.find((_)=>_.type==="schematic_port"&&_.source_port_id===u.source_port_id)}}}}});return r};function hWe(e){let t=e.type;return`${t}:${e[`${t}_id`]}`}yje.unparsed=yje;var izt=(e,t={})=>{let n=e._internal_store_indexed;if(!n){n={counts:{},editCount:0,indexes:{}};for(let i of e){let s=i.type,a=i[`${s}_id`];if(!a)continue;let c=Number.parseInt(a.split("_").pop()||"");Number.isNaN(c)||(n.counts[s]=Math.max(n.counts[s]??0,c))}let o=t.indexConfig||{},r=n.indexes;if(o.byId&&(r.byId=new Map),o.byType&&(r.byType=new Map),o.byRelation&&(r.byRelation=new Map),o.bySubcircuit&&(r.bySubcircuit=new Map),o.byCustomField&&o.byCustomField.length>0){r.byCustomField=new Map;for(let i of o.byCustomField)r.byCustomField.set(i,new Map)}for(let i of e){if(o.byId){let s=hWe(i);r.byId.set(s,i)}if(o.byType){let s=r.byType.get(i.type)||[];s.push(i),r.byType.set(i.type,s)}if(o.byRelation){let s=Object.entries(i);for(let[a,c]of s)if(a.endsWith("_id")&&a!==`${i.type}_id`&&typeof c=="string"){let l=r.byRelation.get(a)||new Map,h=l.get(c)||[];h.push(i),l.set(c,h),r.byRelation.set(a,l)}}if(o.bySubcircuit&&"subcircuit_id"in i){let s=i.subcircuit_id;if(s&&typeof s=="string"){let a=r.bySubcircuit.get(s)||[];a.push(i),r.bySubcircuit.set(s,a)}}if(o.byCustomField&&r.byCustomField){for(let s of o.byCustomField)if(s in i){let a=i[s];if(a!==void 0&&(typeof a=="string"||typeof a=="number")){let c=String(a),l=r.byCustomField.get(s),h=l.get(c)||[];h.push(i),l.set(c,h)}}}}e._internal_store_indexed=n}return new Proxy({},{get:(o,r)=>{if(r==="toArray")return()=>(e.editCount=n.editCount,e);if(r==="editCount")return n.editCount;let i=r;return{get:(s)=>{let a=t.indexConfig||{};if(a.byId&&n.indexes.byId)return n.indexes.byId.get(`${i}:${s}`)||null;if(a.byType&&n.indexes.byType)return(n.indexes.byType.get(i)||[]).find((c)=>c[`${i}_id`]===s)||null;return e.find((c)=>c.type===i&&c[`${i}_id`]===s)||null},getUsing:(s)=>{let a=t.indexConfig||{},c=Object.keys(s);if(c.length!==1)throw Error("getUsing requires exactly one key, e.g. { pcb_component_id }");let l=c[0],h=l.replace("_id","");if(a.byRelation&&n.indexes.byRelation){let u=n.indexes.byRelation.get(l);if(u){let _=(u.get(s[l])||[]).find((m)=>m.type===h);if(!_)return null;let p=_[`${i}_id`];if(a.byId&&n.indexes.byId)return n.indexes.byId.get(`${i}:${p}`)||null;if(a.byType&&n.indexes.byType)return(n.indexes.byType.get(i)||[]).find((m)=>m[`${i}_id`]===p)||null;return e.find((m)=>m.type===i&&m[`${i}_id`]===p)||null}}let d=e.find((u)=>u.type===h&&u[l]===s[l]);return d&&e.find((u)=>u.type===i&&u[`${i}_id`]===d[`${i}_id`])||null},getWhere:(s)=>{let a=t.indexConfig||{},c=Object.keys(s);if(c.length===1&&a.byCustomField&&n.indexes.byCustomField){let l=c[0],h=n.indexes.byCustomField.get(l);if(h){let d=String(s[l]);return(h.get(d)||[]).find((u)=>u.type===i)||null}}if("subcircuit_id"in s&&a.bySubcircuit&&n.indexes.bySubcircuit){let l=s.subcircuit_id;return(n.indexes.bySubcircuit.get(l)||[]).find((h)=>h.type===i&&c.every((d)=>h[d]===s[d]))||null}if(a.byType&&n.indexes.byType)return(n.indexes.byType.get(i)||[]).find((l)=>c.every((h)=>l[h]===s[h]))||null;return e.find((l)=>l.type===i&&c.every((h)=>l[h]===s[h]))||null},list:(s)=>{let a=t.indexConfig||{},c=s?Object.keys(s):[];if(c.length===0&&a.byType&&n.indexes.byType)return n.indexes.byType.get(i)||[];if(c.length===1&&c[0]==="subcircuit_id"&&a.bySubcircuit&&n.indexes.bySubcircuit){let h=s.subcircuit_id;return(n.indexes.bySubcircuit.get(h)||[]).filter((d)=>d.type===i)}let l;return l=a.byType&&n.indexes.byType?n.indexes.byType.get(i)||[]:e.filter((h)=>h.type===i),c.length>0?l.filter((h)=>c.every((d)=>h[d]===s[d])):l},insert:(s)=>{n.counts[i]??=-1,n.counts[i]++;let a=n.counts[i],c={type:i,[`${i}_id`]:`${i}_${a}`,...s};if(t.validateInserts)(vCe[i]??NCe).parse(c);e.push(c),n.editCount++;let l=t.indexConfig||{};if(l.byId&&n.indexes.byId){let h=hWe(c);n.indexes.byId.set(h,c)}if(l.byType&&n.indexes.byType){let h=n.indexes.byType.get(i)||[];h.push(c),n.indexes.byType.set(i,h)}if(l.byRelation&&n.indexes.byRelation){let h=Object.entries(c);for(let[d,u]of h)if(d.endsWith("_id")&&d!==`${c.type}_id`&&typeof u=="string"){let _=n.indexes.byRelation.get(d)||new Map,p=_.get(u)||[];p.push(c),_.set(u,p),n.indexes.byRelation.set(d,_)}}if(l.bySubcircuit&&n.indexes.bySubcircuit&&"subcircuit_id"in c){let h=c.subcircuit_id;if(h&&typeof h=="string"){let d=n.indexes.bySubcircuit.get(h)||[];d.push(c),n.indexes.bySubcircuit.set(h,d)}}if(l.byCustomField&&n.indexes.byCustomField){for(let h of l.byCustomField)if(h in c){let d=c[h];if(d!==void 0&&(typeof d=="string"||typeof d=="number")){let u=String(d),_=n.indexes.byCustomField.get(h),p=_.get(u)||[];p.push(c),_.set(u,p)}}}return c},delete:(s)=>{let a=t.indexConfig||{},c;if(a.byId&&n.indexes.byId)c=n.indexes.byId.get(`${i}:${s}`);else if(a.byType&&n.indexes.byType)c=(n.indexes.byType.get(i)||[]).find((d)=>d[`${i}_id`]===s);else c=e.find((h)=>h[`${i}_id`]===s);if(!c)return;let l=e.indexOf(c);if(l>=0&&(e.splice(l,1),n.editCount++),a.byId&&n.indexes.byId){let h=hWe(c);n.indexes.byId.delete(h)}if(a.byType&&n.indexes.byType){let h=(n.indexes.byType.get(i)||[]).filter((d)=>d[`${i}_id`]!==s);n.indexes.byType.set(i,h)}if(a.byRelation&&n.indexes.byRelation)for(let[h,d]of n.indexes.byRelation.entries())for(let[u,_]of d.entries()){let p=_.filter((m)=>m!==c);p.length===0?d.delete(u):d.set(u,p)}if(a.bySubcircuit&&n.indexes.bySubcircuit&&"subcircuit_id"in c){let h=c.subcircuit_id;if(h){let d=(n.indexes.bySubcircuit.get(h)||[]).filter((u)=>u!==c);d.length===0?n.indexes.bySubcircuit.delete(h):n.indexes.bySubcircuit.set(h,d)}}if(a.byCustomField&&n.indexes.byCustomField)for(let h of n.indexes.byCustomField.values())for(let[d,u]of h.entries()){let _=u.filter((p)=>p!==c);_.length===0?h.delete(d):h.set(d,_)}},update:(s,a)=>{let c=t.indexConfig||{},l;if(c.byId&&n.indexes.byId)l=n.indexes.byId.get(`${i}:${s}`);else if(c.byType&&n.indexes.byType)l=(n.indexes.byType.get(i)||[]).find((d)=>d[`${i}_id`]===s);else l=e.find((h)=>h.type===i&&h[`${i}_id`]===s);if(!l)return null;if(c.byRelation&&n.indexes.byRelation){let h=Object.entries(l);for(let[d,u]of h)if(d.endsWith("_id")&&d!==`${l.type}_id`&&typeof u=="string"&&d in a&&a[d]!==u){let _=n.indexes.byRelation.get(d);if(_){let p=(_.get(u)||[]).filter((m)=>m!==l);p.length===0?_.delete(u):_.set(u,p)}}}if(c.bySubcircuit&&n.indexes.bySubcircuit&&"subcircuit_id"in l&&"subcircuit_id"in a){let h=l.subcircuit_id;if(h!==a.subcircuit_id){let d=(n.indexes.bySubcircuit.get(h)||[]).filter((u)=>u!==l);d.length===0?n.indexes.bySubcircuit.delete(h):n.indexes.bySubcircuit.set(h,d)}}if(c.byCustomField&&n.indexes.byCustomField){for(let h of c.byCustomField)if(h in l&&h in a&&l[h]!==a[h]){let d=n.indexes.byCustomField.get(h);if(d){let u=String(l[h]),_=(d.get(u)||[]).filter((p)=>p!==l);_.length===0?d.delete(u):d.set(u,_)}}}if(Object.assign(l,a),n.editCount++,c.byRelation&&n.indexes.byRelation){let h=Object.entries(l);for(let[d,u]of h)if(d.endsWith("_id")&&d!==`${l.type}_id`&&typeof u=="string"&&d in a){let _=n.indexes.byRelation.get(d)||new Map,p=_.get(u)||[];p.includes(l)||(p.push(l),_.set(u,p),n.indexes.byRelation.set(d,_))}}if(c.bySubcircuit&&n.indexes.bySubcircuit&&"subcircuit_id"in l&&"subcircuit_id"in a){let h=l.subcircuit_id;if(h&&typeof h=="string"){let d=n.indexes.bySubcircuit.get(h)||[];d.includes(l)||(d.push(l),n.indexes.bySubcircuit.set(h,d))}}if(c.byCustomField&&n.indexes.byCustomField){for(let h of c.byCustomField)if(h in l&&h in a){let d=l[h];if(d!==void 0&&(typeof d=="string"||typeof d=="number")){let u=String(d),_=n.indexes.byCustomField.get(h),p=_.get(u)||[];p.includes(l)||(p.push(l),_.set(u,p))}}}return l},select:(s)=>{if(i==="source_component")return e.find((a)=>a.type==="source_component"&&a.name===s.replace(/\./g,""))||null;if(i==="pcb_port"||i==="source_port"||i==="schematic_port"){let[a,c]=s.replace(/\./g,"").split(/[\s\>]+/),l=e.find((d)=>d.type==="source_component"&&d.name===a);if(!l)return null;let h=e.find((d)=>d.type==="source_port"&&d.source_component_id===l.source_component_id&&(d.name===c||(d.port_hints??[]).includes(c)));if(!h)return null;if(i==="source_port")return h;if(i==="pcb_port")return e.find((d)=>d.type==="pcb_port"&&d.source_port_id===h.source_port_id)||null;if(i==="schematic_port")return e.find((d)=>d.type==="schematic_port"&&d.source_port_id===h.source_port_id)||null}return null}}}})};izt.unparsed=izt;var tqt=!0,D$={CCW:-1,CW:1,NOT_ORIENTABLE:0},wAr=2*Math.PI,RCe=Object.freeze({__proto__:null,BOUNDARY:2,CCW:tqt,CONTAINS:3,CW:!1,END_VERTEX:2,INSIDE:1,INTERLACE:4,NOT_VERTEX:0,ORIENTATION:D$,OUTSIDE:0,OVERLAP_OPPOSITE:2,OVERLAP_SAME:1,PIx2:wAr,START_VERTEX:1}),cS=0.000001;function nqt(e){cS=e}function oqt(){return cS}function xje(e){return e<cS&&e>-cS}function iV(e,t){return e-t<cS&&e-t>-cS}function rqt(e,t){return e-t>cS}function iqt(e,t){return e-t<-cS}var Ge={Utils:Object.freeze({__proto__:null,DECIMALS:3,EQ:iV,EQ_0:xje,GE:function(e,t){return e-t>-cS},GT:rqt,LE:function(e,t){return e-t<cS},LT:iqt,getTolerance:oqt,setTolerance:nqt}),Errors:void 0,Matrix:void 0,Planar_set:void 0,Point:void 0,Vector:void 0,Line:void 0,Circle:void 0,Segment:void 0,Arc:void 0,Box:void 0,Edge:void 0,Face:void 0,Ray:void 0,Ray_shooting:void 0,Multiline:void 0,Polygon:void 0,Distance:void 0,Inversion:void 0};for(let e in RCe)Ge[e]=RCe[e];Object.defineProperty(Ge,"DP_TOL",{get:function(){return oqt()},set:function(e){nqt(e)}});var Fu=class{static get ILLEGAL_PARAMETERS(){return ReferenceError("Illegal Parameters")}static get ZERO_DIVISION(){return Error("Zero division")}static get UNRESOLVED_BOUNDARY_CONFLICT(){return Error("Unresolved boundary conflict in boolean operation")}static get INFINITE_LOOP(){return Error("Infinite loop")}static get CANNOT_COMPLETE_BOOLEAN_OPERATION(){return Error("Cannot complete boolean operation")}static get CANNOT_INVOKE_ABSTRACT_METHOD(){return Error("Abstract method cannot be invoked")}static get OPERATION_IS_NOT_SUPPORTED(){return Error("Operation is not supported")}static get UNSUPPORTED_SHAPE_TYPE(){return Error("Unsupported shape type")}};Ge.Errors=Fu;var oqe=class{constructor(e,t){this.first=e,this.last=t||this.first}[Symbol.iterator](){let e;return{next:()=>(e=e?e.next:this.first,{value:e,done:e===void 0})}}get size(){let e=0;for(let t of this)e++;return e}toArray(e=void 0,t=void 0){let n=[],o=e||this.first,r=t||this.last,i=o;if(i===void 0)return n;do n.push(i),i=i.next;while(i!==r.next);return n}append(e){return this.isEmpty()?this.first=e:(e.prev=this.last,this.last.next=e),this.last=e,this.last.next=void 0,this.first.prev=void 0,this}insert(e,t){if(this.isEmpty())this.first=e,this.last=e;else if(t==null)e.next=this.first,this.first.prev=e,this.first=e;else{let n=t.next;t.next=e,n&&(n.prev=e),e.prev=t,e.next=n,this.last===t&&(this.last=e)}return this.last.next=void 0,this.first.prev=void 0,this}remove(e){return e===this.first&&e===this.last?(this.first=void 0,this.last=void 0):(e.prev&&(e.prev.next=e.next),e.next&&(e.next.prev=e.prev),e===this.first&&(this.first=e.next),e===this.last&&(this.last=e.prev)),this}isEmpty(){return this.first===void 0}static testInfiniteLoop(e){let t=e,n=e;do{if(t!=e&&t===n)throw Fu.INFINITE_LOOP;t=t.next,n=n.next.next}while(t!=e)}},szt={stroke:"black"},BAr=class{constructor(e=szt){for(let t in e)this[t]=e[t];this.stroke=e.stroke??szt.stroke}toAttributesString(){return Object.keys(this).reduce((e,t)=>e+(this[t]!==void 0?this.toAttrString(t,this[t]):""),"")}toAttrString(e,t){let n=e==="className"?"class":this.convertCamelToKebabCase(e);return t===null?`${n} `:`${n}="${t.toString()}" `}convertCamelToKebabCase(e){return e.match(/[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[0-9]+/g).join("-").toLowerCase()}};function CV(e){return new BAr(e).toAttributesString()}function Tq(e,t){let n=[],[o,r,i]=e.standard,[s,a,c]=t.standard,l=o*a-r*s,h=i*a-r*c,d=o*c-i*s;if(!Ge.Utils.EQ_0(l)){let u,_;r===0?(u=i/o,_=d/l):a===0?(u=c/s,_=d/l):o===0?(u=h/l,_=i/r):s===0?(u=h/l,_=c/a):(u=h/l,_=d/l),n.push(new Ge.Point(u,_))}return n}function bV(e,t){let n=[],o=t.pc.projectionOn(e),r=t.pc.distanceTo(o)[0];if(Ge.Utils.EQ(r,t.r))n.push(o);else if(Ge.Utils.LT(r,t.r)){let i,s,a=Math.sqrt(t.r*t.r-r*r);i=e.norm.rotate90CCW().multiply(a),s=o.translate(i),n.push(s),i=e.norm.rotate90CW().multiply(a),s=o.translate(i),n.push(s)}return n}function tq(e,t){let n=[];for(let o of t.toSegments()){let r=Mle(o,e);for(let i of r)pqt(i,n)||n.push(i)}return n}function Vbe(e,t){let n=[];if(tq(e,t.box).length===0)return n;let o=bV(e,new Ge.Circle(t.pc,t.r));for(let r of o)r.on(t)&&n.push(r);return n}function Mle(e,t){let n=[];return e.ps.on(t)&&n.push(e.ps),e.pe.on(t)&&!e.isZeroLength()&&n.push(e.pe),n.length>0||e.isZeroLength()||e.ps.leftTo(t)&&e.pe.leftTo(t)||!e.ps.leftTo(t)&&!e.pe.leftTo(t)?n:Tq(new Ge.Line(e.ps,e.pe),t)}function QCe(e,t){let n=[];if(e.isZeroLength())return e.ps.on(t)&&n.push(e.ps),n;if(t.isZeroLength())return t.ps.on(e)&&n.push(t.ps),n;let o=new Ge.Line(e.ps,e.pe),r=new Ge.Line(t.ps,t.pe);if(o.incidentTo(r))e.ps.on(t)&&n.push(e.ps),e.pe.on(t)&&n.push(e.pe),!t.ps.on(e)||t.ps.equalTo(e.ps)||t.ps.equalTo(e.pe)||n.push(t.ps),!t.pe.on(e)||t.pe.equalTo(e.ps)||t.pe.equalTo(e.pe)||n.push(t.pe);else if(o.parallelTo(r)){let i=new Ge.Vector(e.ps,e.pe),s=new Ge.Vector(t.ps,t.pe),a=new Ge.Vector(e.ps,t.ps),c=i.cross(s);if(!Ge.Utils.EQ_0(c)){let l=a.cross(s)/c,h=a.cross(i)/c;Ge.Utils.GE(l,0)&&Ge.Utils.LE(l,1)&&Ge.Utils.GE(h,0)&&Ge.Utils.LE(h,1)&&n.push(azt(e.ps.translate(i.multiply(l)),e,t))}}else{let i=Tq(o,r);i.length>0&&czt(i[0],e)&&czt(i[0],t)&&n.push(azt(i[0],e,t))}return n}function azt(e,t,n){for(let o of[t.ps,t.pe,n.ps,n.pe])if(e.equalTo(o))return o;return e}function czt(e,t){let n=t.box;return Ge.Utils.LE(e.x,n.xmax)&&Ge.Utils.GE(e.x,n.xmin)&&Ge.Utils.LE(e.y,n.ymax)&&Ge.Utils.GE(e.y,n.ymin)}function kCe(e,t){let n=[];if(e.isZeroLength()){let[r,i]=e.ps.distanceTo(t.pc);return Ge.Utils.EQ(r,t.r)&&n.push(e.ps),n}let o=bV(new Ge.Line(e.ps,e.pe),t);for(let r of o)r.on(e)&&n.push(r);return n}function nq(e,t){let n=[];if(e.isZeroLength())return e.ps.on(t)&&n.push(e.ps),n;let o=bV(new Ge.Line(e.ps,e.pe),new Ge.Circle(t.pc,t.r));for(let r of o)r.on(e)&&r.on(t)&&n.push(r);return n}function sqt(e,t){let n=[],o=new Ge.Vector(e.pc,t.pc),r=e.r,i=t.r;if(Ge.Utils.EQ_0(r)||Ge.Utils.EQ_0(i))return n;if(Ge.Utils.EQ_0(o.x)&&Ge.Utils.EQ_0(o.y)&&Ge.Utils.EQ(r,i))return n.push(e.pc.translate(-r,0)),n;let s,a=e.pc.distanceTo(t.pc)[0];if(Ge.Utils.GT(a,r+i))return n;if(Ge.Utils.LT(a,Math.abs(r-i)))return n;if(o.x/=a,o.y/=a,Ge.Utils.EQ(a,r+i)||Ge.Utils.EQ(a,Math.abs(r-i)))return s=e.pc.translate(r*o.x,r*o.y),n.push(s),n;let c=r*r/(2*a)-i*i/(2*a)+a/2,l=e.pc.translate(c*o.x,c*o.y),h=Math.sqrt(r*r-c*c);return s=l.translate(o.rotate90CCW().multiply(h)),n.push(s),s=l.translate(o.rotate90CW().multiply(h)),n.push(s),n}function aqt(e,t){let n=[];if(e.pc.equalTo(t.pc)&&Ge.Utils.EQ(e.r,t.r)){let s;return s=e.start,s.on(t)&&n.push(s),s=e.end,s.on(t)&&n.push(s),s=t.start,s.on(e)&&n.push(s),s=t.end,s.on(e)&&n.push(s),n}let o=new Ge.Circle(e.pc,e.r),r=new Ge.Circle(t.pc,t.r),i=o.intersect(r);for(let s of i)s.on(e)&&s.on(t)&&n.push(s);return n}function rqe(e,t){let n=[];if(t.pc.equalTo(e.pc)&&Ge.Utils.EQ(t.r,e.r))return n.push(e.start),n.push(e.end),n;let o=sqt(t,new Ge.Circle(e.pc,e.r));for(let r of o)r.on(e)&&n.push(r);return n}function cqt(e,t){return e.isSegment?QCe(e.shape,t):nq(t,e.shape)}function lqt(e,t){return e.isSegment?nq(e.shape,t):aqt(e.shape,t)}function hqt(e,t){return e.isSegment?Mle(e.shape,t):Vbe(t,e.shape)}function TAr(e,t){return e.isSegment?kCe(e.shape,t):rqe(e.shape,t)}function iqe(e,t){let n=[];for(let o of t.edges)for(let r of cqt(o,e))n.push(r);return n}function sqe(e,t){let n=[];for(let o of t.edges)for(let r of lqt(o,e))n.push(r);return n}function wle(e,t){let n=[];if(t.isEmpty())return n;for(let o of t.edges)for(let r of hqt(o,e))pqt(r,n)||n.push(r);return e.sortPoints(n)}function dqt(e,t){let n=[];if(t.isEmpty())return n;for(let o of t.edges)for(let r of TAr(o,e))n.push(r);return n}function uqt(e,t){return e.isSegment?cqt(t,e.shape):e.isArc?lqt(t,e.shape):e.isLine?hqt(t,e.shape):e.isRay?(n=t,o=e.shape,n.isSegment?aqe(o,n.shape):cqe(o,n.shape)):[];var n,o}function lzt(e,t){let n=[];if(t.isEmpty()||e.shape.box.not_intersect(t.box))return n;let o=t.edges.search(e.shape.box);for(let r of o)n=[...n,...uqt(e,r)];return n}function pqt(e,t){return t.some((n)=>n.equalTo(e))}function sQ(e){return new Ge.Line(e.start,e.norm)}function aqe(e,t){return Mle(t,sQ(e)).filter((n)=>e.contains(n))}function cqe(e,t){return Vbe(sQ(e),t).filter((n)=>e.contains(n))}function mqt(e,t){return bV(sQ(e),t).filter((n)=>e.contains(n))}function _qt(e,t){return Tq(sQ(e),t).filter((n)=>e.contains(n))}function gqt(e,t){return wle(sQ(e),t).filter((n)=>e.contains(n))}function Aqt(e,t){if(e.intersect&&e.intersect instanceof Function)return e.intersect(t);throw Fu.UNSUPPORTED_SHAPE_TYPE}function Dq(e,t){let n=[];for(let o of t)n=[...n,...Aqt(e,o.shape)];return n}var GO=class e extends oqe{constructor(...t){if(super(),this.isInfinite=!1,t.length===1&&t[0]instanceof Array&&t[0].length>0){let n=t[0],o=n.length,r=(s)=>s instanceof Ge.Segment||s instanceof Ge.Arc||s instanceof Ge.Ray,i=(s)=>s instanceof Ge.Segment||s instanceof Ge.Arc;if(!(o===1&&((s)=>s instanceof Ge.Segment||s instanceof Ge.Arc||s instanceof Ge.Ray||s instanceof Ge.Line)(n[0])||o>1&&r(n[0])&&r(n[o-1])&&n.slice(1,o-1).every(i)))throw Ge.Errors.ILLEGAL_PARAMETERS;this.isInfinite=n.some((s)=>s instanceof Ge.Ray||s instanceof Ge.Line);for(let s of n){let a=new Ge.Edge(s);this.append(a)}this.setArcLength()}}get edges(){return[...this]}get box(){return this.edges.reduce((t,n)=>t.merge(n.box),new Ge.Box)}get vertices(){let t=this.edges.map((n)=>n.start);return t.push(this.last.end),t}get length(){if(this.isEmpty())return 0;if(this.isInfinite)return Number.POSITIVE_INFINITY;let t=0;for(let n of this)t+=n.length;return t}clone(){return new e(this.toShapes())}setArcLength(){for(let t of this)this.setOneEdgeArcLength(t)}setOneEdgeArcLength(t){t===this.first?t.arc_length=0:t.arc_length=t.prev.arc_length+t.prev.length}pointAtLength(t){if(t>this.length||t<0)return null;if(this.isInfinite)return null;let n=null;for(let o of this)if(t>=o.arc_length&&(o===this.last||t<o.next.arc_length)){n=o.pointAtLength(t-o.arc_length);break}return n}addVertex(t,n){let o=n.shape.split(t);if(o[0]===null)return n.prev;if(o[1]===null)return n;let r=new Ge.Edge(o[0]),i=n.prev;return this.insert(r,i),n.shape=o[1],r}getChain(t,n){let o=[];for(let r=t;r!==n.next;r=r.next)o.push(r);return o}split(t){for(let n of t){let o=this.findEdgeByPoint(n);this.addVertex(n,o)}return this}findEdgeByPoint(t){let n;for(let o of this)if(o.shape.contains(t)){n=o;break}return n}distanceTo(t){if(t instanceof Ge.Point){let[n,o]=Ge.Distance.shape2multiline(t,this);return[n,o.reverse()]}if(t instanceof Ge.Line){let[n,o]=Ge.Distance.shape2multiline(t,this);return[n,o.reverse()]}if(t instanceof Ge.Circle){let[n,o]=Ge.Distance.shape2multiline(t,this);return[n,o.reverse()]}if(t instanceof Ge.Segment){let[n,o]=Ge.Distance.shape2multiline(t,this);return[n,o.reverse()]}if(t instanceof Ge.Arc){let[n,o]=Ge.Distance.shape2multiline(t,this);return[n,o.reverse()]}if(t instanceof Ge.Box){let[n,o]=Ge.Distance.shape2multiline(new Ge.Polygon(t),this);return[n,o.reverse()]}if(t instanceof Ge.Multiline)return Ge.Distance.multiline2multiline(this,t);throw Ge.Errors.UNSUPPORTED_SHAPE_TYPE}intersect(t){return t instanceof Ge.Multiline?function(n,o){let r=[];for(let i of n)for(let s of o)r=[...r,...Aqt(i.shape,s.shape)];return r}(this,t):Dq(t,this)}contains(t){if(t instanceof Ge.Point)return this.edges.some((n)=>n.shape.contains(t));throw Ge.Errors.UNSUPPORTED_SHAPE_TYPE}translate(t){return new e(this.edges.map((n)=>n.shape.translate(t)))}rotate(t=0,n=new Ge.Point){return new e(this.edges.map((o)=>o.shape.rotate(t,n)))}transform(t=new Ge.Matrix){return new e(this.edges.map((n)=>n.shape.transform(t)))}toShapes(){return this.edges.map((t)=>t.shape.clone())}toJSON(){return this.edges.map((t)=>t.toJSON())}svgPoints(){return this.vertices.map((t)=>`${t.x},${t.y}`).join(" ")}dpath(){let t=`M${this.first.start.x},${this.first.start.y}`;for(let n of this)t+=n.svg();return t}svg(t={}){let n=`
<path ${CV({fill:"none",...t})} d="`;n+=`
M${this.first.start.x},${this.first.start.y}`;for(let o of this)n+=o.svg();return n+=`" >
</path>`,n}};Ge.Multiline=GO;function oq(e,t,n){let o=n.length,r=e.shape.split(t);if(r.length===0)return;let i=0;i=r[0]===null?0:r[1]===null?e.shape.length:r[0].length;let s,a=0;iV(i,0)&&(a|=1),iV(i,e.shape.length)&&(a|=2),s=i===1/0?r[0].coord(t):2&a&&e.next&&e.next.arc_length===0?0:e.arc_length+i,n.push({id:o,pt:t,arc_length:s,edge_before:e,edge_after:void 0,face:e.face,is_vertex:a})}function Jce(e){e.int_points1_sorted=XR(e.int_points1),e.int_points2_sorted=XR(e.int_points2)}function XR(e){let t=new Map,n=0;for(let o of e)t.has(o.face)||(t.set(o.face,n),n++);for(let o of e)o.faceId=t.get(o.face);return e.slice().sort(DAr)}function DAr(e,t){return e.faceId<t.faceId?-1:e.faceId>t.faceId?1:e.arc_length<t.arc_length?-1:e.arc_length>t.arc_length?1:0}function lqe(e){if(e.int_points1.length<2)return;let t,n,o,r,i=!1;for(let s=0;s<e.int_points1_sorted.length;s++)if(e.int_points1_sorted[s].id!==-1){t=e.int_points1_sorted[s],n=e.int_points2[t.id];for(let a=s+1;a<e.int_points1_sorted.length&&(o=e.int_points1_sorted[a],iV(o.arc_length,t.arc_length));a++)o.id!==-1&&(r=e.int_points2[o.id],r.id!==-1&&o.edge_before===t.edge_before&&o.edge_after===t.edge_after&&r.edge_before===n.edge_before&&r.edge_after===n.edge_after&&(o.id=-1,r.id=-1,i=!0))}n=e.int_points2_sorted[0],t=e.int_points1[n.id];for(let s=1;s<e.int_points2_sorted.length;s++){let a=e.int_points2_sorted[s];if(a.id===-1)continue;if(n.id===-1||!iV(a.arc_length,n.arc_length)){n=a,t=e.int_points1[n.id];continue}let c=e.int_points1[a.id];c.edge_before===t.edge_before&&c.edge_after===t.edge_after&&a.edge_before===n.edge_before&&a.edge_after===n.edge_after&&(c.id=-1,a.id=-1,i=!0)}i&&(e.int_points1=e.int_points1.filter((s)=>s.id>=0),e.int_points2=e.int_points2.filter((s)=>s.id>=0),e.int_points1.forEach((s,a)=>s.id=a),e.int_points2.forEach((s,a)=>s.id=a))}function Cje(e){for(let t of e)t.edge_before&&(t.edge_before.bvStart=void 0,t.edge_before.bvEnd=void 0,t.edge_before.bv=void 0,t.edge_before.overlap=void 0),t.edge_after&&(t.edge_after.bvStart=void 0,t.edge_after.bvEnd=void 0,t.edge_after.bv=void 0,t.edge_after.overlap=void 0);for(let t of e)t.edge_before&&(t.edge_before.bvEnd=2),t.edge_after&&(t.edge_after.bvStart=2)}function bje(e,t){for(let n of e)n.edge_before&&n.edge_before.setInclusion(t),n.edge_after&&n.edge_after.setInclusion(t)}function rq(e,t,n){let o,r,i=1;if(e.length===1)return 1;o=e[t];for(let s=t+1;s<e.length&&o.face===n&&(r=e[s],r.pt.equalTo(o.pt)&&r.edge_before===o.edge_before&&r.edge_after===o.edge_after);s++)i++;return i}function iq(e,t){if(t){for(let n of t){let o=n.edge_before;if(n.is_vertex=0,o.shape.start&&o.shape.start.equalTo(n.pt)&&(n.is_vertex|=1),o.shape.end&&o.shape.end.equalTo(n.pt)&&(n.is_vertex|=2),1&n.is_vertex){n.edge_before=o.prev,o.prev&&(n.is_vertex=2);continue}if(2&n.is_vertex)continue;let r=e.addVertex(n.pt,o);n.edge_before=r}for(let n of t)n.edge_before?n.edge_after=n.edge_before.next:e instanceof GO&&1&n.is_vertex&&(n.edge_after=e.first)}}function hzt(e,t,n){let o=e.edge_before,r=t.edge_after,i=n.length;o.next=n[0],n[0].prev=o,n[i-1].next=r,r.prev=n[i-1]}Ge.multiline=(...e)=>new Ge.Multiline(...e);var{INSIDE:W7,OUTSIDE:X7,BOUNDARY:gA,OVERLAP_SAME:NAr,OVERLAP_OPPOSITE:RAr}=RCe,{NOT_VERTEX:ENs,START_VERTEX:dzt,END_VERTEX:uzt}=RCe;function Ije(e,t){let n=t.clone().reverse(),[o,r]=Ble(e,n,3,!0);return o}function fqt(e,t){let[n,o]=Ble(e,t,2,!0);return n}function yqt(e,t){let[n,o]=Ble(e,t,2,!1),r=[];for(let s of n.faces)r=[...r,...[...s.edges].map((a)=>a.shape)];let i=[];for(let s of o.faces)i=[...i,...[...s.edges].map((a)=>a.shape)];return[r,i]}function vje(e,t){let[n,o]=Ble(e,t,3,!1),r=[];for(let i of n.faces)r=[...r,...[...i.edges].map((s)=>s.shape)];return r}function xqt(e,t){let n=e.clone(),o=t.clone(),r=Cqt(n,o);return Jce(r),iq(n,r.int_points1_sorted),iq(o,r.int_points2_sorted),lqe(r),Jce(r),[r.int_points1_sorted.map((i)=>i.pt),r.int_points2_sorted.map((i)=>i.pt)]}function QAr(e,t,n,o){let r=pzt(e,n.int_points1),i=pzt(t,n.int_points2);for(mzt(r,t),mzt(i,e),Cje(n.int_points1),Cje(n.int_points2),bje(n.int_points1,t),bje(n.int_points2,e);kAr(e,t,n.int_points1,n.int_points1_sorted,n.int_points2,n););(function(s){let a,c,l,h=s.int_points1.length;for(let d=0;d<h;d++){let u=s.int_points1_sorted[d];u.face!==a&&(c=d,a=u.face);let _,p=d,m=rq(s.int_points1_sorted,d,a);_=p+m<h&&s.int_points1_sorted[p+m].face===a?p+m:c;let A=rq(s.int_points1_sorted,_,a);l=null;for(let I=_;I<_+A;I++){let v=s.int_points1_sorted[I];if(v.face===a&&s.int_points2[v.id].face===s.int_points2[u.id].face){l=v;break}}if(l===null)continue;let g=u.edge_after,f=l.edge_before;if(g.bv!==2||f.bv!==2)continue;if(g!==f)continue;let y=s.int_points2[u.id],x=s.int_points2[l.id],C=y.edge_after,b=x.edge_before;C.bv===2&&b.bv===2&&C===b||(y=s.int_points2[l.id],x=s.int_points2[u.id],C=y.edge_after,b=x.edge_before),C.bv===2&&b.bv===2&&C===b&&g.setOverlap(C)}})(n),Sje(e,o,n.int_points1_sorted,!0),Sje(t,o,n.int_points2_sorted,!1),_zt(e,r,o,!0),_zt(t,i,o,!1)}function Ble(e,t,n,o){let r=e.clone(),i=t.clone(),s=Cqt(r,i);return Jce(s),iq(r,s.int_points1_sorted),iq(i,s.int_points2_sorted),lqe(s),Jce(s),QAr(r,i,s,n),o&&function(a,c,l){(function(h,d,u,_){for(let p of d.faces){for(let m of p)h.edges.add(m);_.find((m)=>m.face===p)===void 0&&h.addFace(p.first,p.last)}})(a,c,0,l.int_points2),function(h,d,u){if(u.int_points1.length!==0)for(let _=0;_<u.int_points1.length;_++){let p=u.int_points1[_],m=u.int_points2[_];if(p.edge_before!==void 0&&p.edge_after===void 0&&m.edge_before===void 0&&m.edge_after!==void 0&&(p.edge_before.next=m.edge_after,m.edge_after.prev=p.edge_before,p.edge_after=m.edge_after,m.edge_before=p.edge_before),m.edge_before!==void 0&&m.edge_after===void 0&&p.edge_before===void 0&&p.edge_after!==void 0&&(m.edge_before.next=p.edge_after,p.edge_after.prev=m.edge_before,m.edge_after=p.edge_after,p.edge_before=m.edge_before),p.edge_before!==void 0&&p.edge_after===void 0)for(let A of u.int_points1_sorted)A!==p&&A.edge_before===void 0&&A.edge_after!==void 0&&A.pt.equalTo(p.pt)&&(p.edge_before.next=A.edge_after,A.edge_after.prev=p.edge_before,p.edge_after=A.edge_after,A.edge_before=p.edge_before);if(m.edge_before!==void 0&&m.edge_after===void 0)for(let A of u.int_points2_sorted)A!==m&&A.edge_before===void 0&&A.edge_after!==void 0&&A.pt.equalTo(m.pt)&&(m.edge_before.next=A.edge_after,A.edge_after.prev=m.edge_before,m.edge_after=A.edge_after,A.edge_before=m.edge_before)}}(0,0,l),Pje(a,l.int_points1),Pje(c,l.int_points2),Eje(a,l.int_points1,l.int_points2),Eje(a,l.int_points2,l.int_points1),gzt(a),gzt(c)}(r,i,s),[r,i]}function Cqt(e,t){let n={int_points1:[],int_points2:[]};for(let o of e.edges){let r=t.edges.search(o.box);for(let i of r){let s=o.shape.intersect(i.shape);for(let a of s)oq(o,a,n.int_points1),oq(i,a,n.int_points2)}}return n}function pzt(e,t){let n=[];for(let o of e.faces)t.find((r)=>r.face===o)||n.push(o);return n}function mzt(e,t){for(let n of e)n.first.bv=n.first.bvStart=n.first.bvEnd=void 0,n.first.setInclusion(t)}function kAr(e,t,n,o,r,i){let s,a,c,l=o.length,h=!1;for(let d=0;d<l;d++){let u=o[d];u.face!==s&&(a=d,s=u.face);let _,p=d,m=rq(o,d,s);_=p+m<l&&o[p+m].face===s?p+m:a;let A=rq(o,_,s);c=null;for(let y=_;y<_+A;y++){let x=o[y];if(x.face===s&&r[x.id].face===r[u.id].face){c=x;break}}if(c===null)continue;let g=u.edge_after,f=c.edge_before;if(g.bv!==gA||f.bv==gA)if(g.bv==gA||f.bv!==gA){if(g.bv===gA&&f.bv===gA&&g!=f||g.bv===W7&&f.bv===X7||g.bv===X7&&f.bv===W7){let y=g.next;for(;y!=f;)y.bvStart=void 0,y.bvEnd=void 0,y.bv=void 0,y.setInclusion(t),y=y.next}if(g.bv===gA&&f.bv===gA&&g!=f){let y,x=g.next;for(;x!=f;){if(x.bv!=gA){if(y===void 0)y=x.bv;else if(x.bv!=y)throw Fu.UNRESOLVED_BOUNDARY_CONFLICT}x=x.next}y!=null&&(g.bv=y,f.bv=y);continue}if(g.bv===W7&&f.bv===X7||g.bv===X7&&f.bv===W7){let y=g;for(;y!=f;){if(y.bvStart===g.bv&&y.bvEnd===f.bv){let[x,C]=y.shape.distanceTo(t);if(x<10*Ge.DP_TOL){oq(y,C.ps,n);let b=n[n.length-1];if(b.is_vertex&dzt)b.edge_after=y,b.edge_before=y.prev,y.bvStart=gA,y.bv=void 0,y.setInclusion(t);else if(b.is_vertex&uzt)b.edge_after=y.next,y.bvEnd=gA,y.bv=void 0,y.setInclusion(t);else{let P=t.addVertex(b.pt,y);b.edge_before=P,b.edge_after=P.next,P.setInclusion(t),P.next.bvStart=gA,P.next.bvEnd=void 0,P.next.bv=void 0,P.next.setInclusion(t)}let I=t.findEdgeByPoint(C.pe);oq(I,C.pe,r);let v=r[r.length-1];if(v.is_vertex&dzt)v.edge_after=I,v.edge_before=I.prev;else if(v.is_vertex&uzt)v.edge_after=I.next;else{let P=r.find((B)=>B.edge_after===I),M=t.addVertex(v.pt,I);v.edge_before=M,v.edge_after=M.next,P&&(P.edge_after=M),M.bvStart=void 0,M.bvEnd=gA,M.bv=void 0,M.setInclusion(e),M.next.bvStart=gA,M.next.bvEnd=void 0,M.next.bv=void 0,M.next.setInclusion(e)}Jce(i),h=!0;break}}y=y.next}if(h)break;throw Fu.UNRESOLVED_BOUNDARY_CONFLICT}}else f.bv=g.bv;else g.bv=f.bv}return h}function Sje(e,t,n,o){if(!n)return;let r,i,s,a;for(let c=0;c<n.length;c++){if(s=n[c],s.face!==r&&(i=c,r=s.face),r.isEmpty())continue;let l,h=c,d=rq(n,c,r);l=h+d<n.length&&n[h+d].face===s.face?h+d:i,a=n[l];let u=l,_=rq(n,u,r),p=s.edge_after,m=a.edge_before;if(p.bv===W7&&m.bv===W7&&t===1||p.bv===X7&&m.bv===X7&&t===2||(p.bv===X7||m.bv===X7)&&t===3&&!o||(p.bv===W7||m.bv===W7)&&t===3&&o||p.bv===gA&&m.bv===gA&&p.overlap&NAr&&o||p.bv===gA&&m.bv===gA&&p.overlap&RAr){e.removeChain(r,p,m);for(let A=h;A<h+d;A++)n[A].edge_after=void 0;for(let A=u;A<u+_;A++)n[A].edge_before=void 0}c+=d-1}}function Pje(e,t){for(let n of t)e.faces.delete(n.face),n.face=void 0,n.edge_before&&(n.edge_before.face=void 0),n.edge_after&&(n.edge_after.face=void 0)}function Eje(e,t,n){for(let o of t){if(o.edge_before===void 0||o.edge_after===void 0)continue;if(o.face)continue;if(o.edge_after.face||o.edge_before.face)continue;let{edge_after:r,edge_before:i}=o;try{oqe.testInfiniteLoop(r)}catch(a){throw Fu.CANNOT_COMPLETE_BOOLEAN_OPERATION}let s=e.addFace(r,i);for(let a of t)a.edge_before&&a.edge_after&&a.edge_before.face===s&&a.edge_after.face===s&&(a.face=s);for(let a of n)a.edge_before&&a.edge_after&&a.edge_before.face===s&&a.edge_after.face===s&&(a.face=s)}}function _zt(e,t,n,o){for(let r of t){let i=r.first.bv;(n===1&&i===W7||n===3&&i===W7&&o||n===3&&i===X7&&!o||n===2&&i===X7)&&e.deleteFace(r)}}function gzt(e){let t=[];for(let n of e.edges)n.face&&e.faces.has(n.face)||t.push(n);for(let n of t)e.edges.delete(n)}var Mje=Object.freeze({__proto__:null,BOOLEAN_INTERSECT:2,BOOLEAN_SUBTRACT:3,BOOLEAN_UNION:1,calculateIntersections:xqt,innerClip:yqt,intersect:fqt,outerClip:vje,removeNotRelevantChains:Sje,removeOldFaces:Pje,restoreFaces:Eje,subtract:Ije,unify:function(e,t){let[n,o]=Ble(e,t,1,!0);return n}}),LAr=RegExp("T.F..FFF.|T.F...F.."),HAr=RegExp("T........|.T.......|...T.....|....T...."),FAr=RegExp("FT.......|F..T.....|F...T...."),zAr=RegExp("T.F..F..."),OAr=RegExp("T.F..F...|.TF..F...|..FT.F...|..F.TF..."),m$=class{constructor(){this.m=[,,,,,,,,,].fill(void 0)}get I2I(){return this.m[0]}set I2I(e){this.m[0]=e}get I2B(){return this.m[1]}set I2B(e){this.m[1]=e}get I2E(){return this.m[2]}set I2E(e){this.m[2]=e}get B2I(){return this.m[3]}set B2I(e){this.m[3]=e}get B2B(){return this.m[4]}set B2B(e){this.m[4]=e}get B2E(){return this.m[5]}set B2E(e){this.m[5]=e}get E2I(){return this.m[6]}set E2I(e){this.m[6]=e}get E2B(){return this.m[7]}set E2B(e){this.m[7]=e}get E2E(){return this.m[8]}set E2E(e){this.m[8]=e}toString(){return this.m.map((e)=>e instanceof Array&&e.length>0?"T":e instanceof Array&&e.length===0?"F":"*").join("")}equal(){return LAr.test(this.toString())}intersect(){return HAr.test(this.toString())}touch(){return FAr.test(this.toString())}inside(){return zAr.test(this.toString())}covered(){return OAr.test(this.toString())}};function gce(e,t){let n,o=new Ge.Ray(t),r=new Ge.Line(o.pt,o.norm),i=new Ge.Box(o.box.xmin-Ge.DP_TOL,o.box.ymin-Ge.DP_TOL,o.box.xmax+Ge.DP_TOL,o.box.ymax+Ge.DP_TOL);if(e.box.not_intersect(i))return Ge.OUTSIDE;let s=e.edges.search(i);if(s.length===0)return Ge.OUTSIDE;for(let h of s)if(h.shape.contains(t))return Ge.BOUNDARY;let a=[...e.faces],c=[];for(let h of s)for(let d of o.intersect(h.shape)){if(d.equalTo(t))return Ge.BOUNDARY;c.push({pt:d,edge:h,face_index:a.indexOf(h.face)})}c.sort((h,d)=>iqt(h.pt.x,d.pt.x)?-1:rqt(h.pt.x,d.pt.x)?1:h.face_index<d.face_index?-1:h.face_index>d.face_index?1:h.edge.arc_length<d.edge.arc_length?-1:h.edge.arc_length>d.edge.arc_length?1:0);let l=0;for(let h=0;h<c.length;h++){let d=c[h];if(d.pt.equalTo(d.edge.shape.start)){if(h>0&&d.pt.equalTo(c[h-1].pt)&&d.face_index===c[h-1].face_index&&d.edge.prev===c[h-1].edge)continue;let u=d.edge.prev;for(;xje(u.length);)u=u.prev;let _=u.shape.tangentInEnd(),p=d.pt.translate(_),m=d.edge.shape.tangentInStart(),A=d.pt.translate(m),g=p.leftTo(r),f=A.leftTo(r);(g&&!f||!g&&f)&&l++}else if(d.pt.equalTo(d.edge.shape.end)){if(h>0&&d.pt.equalTo(c[h-1].pt)&&d.face_index===c[h-1].face_index&&d.edge.next===c[h-1].edge)continue;let u=d.edge.next;for(;xje(u.length);)u=u.next;let _=u.shape.tangentInStart(),p=d.pt.translate(_),m=d.edge.shape.tangentInEnd(),A=d.pt.translate(m),g=p.leftTo(r),f=A.leftTo(r);(g&&!f||!g&&f)&&l++}else if(d.edge.shape instanceof Ge.Segment)l++;else{let u=d.edge.shape.box;iV(d.pt.y,u.ymin)||iV(d.pt.y,u.ymax)||l++}}return n=l%2==1?1:0,n}function Azt(e,t){return N$(e,t).intersect()}function fzt(e,t){return N$(e,t).inside()}function bqt(e,t){return N$(e,t).covered()}function Iqt(e,t){return bqt(t,e)}function N$(e,t){return e instanceof Ge.Line&&t instanceof Ge.Line?function(n,o){let r=new m$,i=Tq(n,o);return i.length===0?n.contains(o.pt)&&o.contains(n.pt)?(r.I2I=[n],r.I2E=[],r.E2I=[]):(r.I2I=[],r.I2E=[n],r.E2I=[o]):(r.I2I=i,r.I2E=n.split(i),r.E2I=o.split(i)),r}(e,t):e instanceof Ge.Line&&t instanceof Ge.Circle?function(n,o){let r=new m$,i=bV(n,o);if(i.length===0)r.I2I=[],r.I2B=[],r.I2E=[n],r.E2I=[o];else if(i.length===1)r.I2I=[],r.I2B=i,r.I2E=n.split(i),r.E2I=[o];else{let s=new GO([n]),a=n.sortPoints(i);s.split(a);let c=s.toShapes();r.I2I=[c[1]],r.I2B=a,r.I2E=[c[0],c[2]],r.E2I=new Ge.Polygon([o.toArc()]).cutWithLine(n)}return r}(e,t):e instanceof Ge.Line&&t instanceof Ge.Box?function(n,o){let r=new m$,i=tq(n,o);if(i.length===0)r.I2I=[],r.I2B=[],r.I2E=[n],r.E2I=[o];else if(i.length===1)r.I2I=[],r.I2B=i,r.I2E=n.split(i),r.E2I=[o];else{let s=new GO([n]),a=n.sortPoints(i);s.split(a);let c=s.toShapes();o.toSegments().some((l)=>l.contains(i[0])&&l.contains(i[1]))?(r.I2I=[],r.I2B=[c[1]],r.I2E=[c[0],c[2]],r.E2I=[o]):(r.I2I=[c[1]],r.I2B=a,r.I2E=[c[0],c[2]],r.E2I=new Ge.Polygon(o.toSegments()).cutWithLine(n))}return r}(e,t):e instanceof Ge.Line&&t instanceof Ge.Polygon?function(n,o){let r=new m$,i=wle(n,o),s=new GO([n]),a=i.length>0?i.slice():n.sortPoints(i);return s.split(a),[...s].forEach((c)=>c.setInclusion(o)),r.I2I=[...s].filter((c)=>c.bv===Ge.INSIDE).map((c)=>c.shape),r.I2B=[...s].slice(1).map((c)=>c.bv===Ge.BOUNDARY?c.shape:c.shape.start),r.I2E=[...s].filter((c)=>c.bv===Ge.OUTSIDE).map((c)=>c.shape),r.E2I=o.cutWithLine(n),r}(e,t):(e instanceof Ge.Segment||e instanceof Ge.Arc)&&t instanceof Ge.Polygon?yzt(e,t):(e instanceof Ge.Segment||e instanceof Ge.Arc)&&(t instanceof Ge.Circle||t instanceof Ge.Box)?yzt(e,new Ge.Polygon(t)):e instanceof Ge.Polygon&&t instanceof Ge.Polygon?Y4e(e,t):(e instanceof Ge.Circle||e instanceof Ge.Box)&&(t instanceof Ge.Circle||t instanceof Ge.Box)?Y4e(new Ge.Polygon(e),new Ge.Polygon(t)):(e instanceof Ge.Circle||e instanceof Ge.Box)&&t instanceof Ge.Polygon?Y4e(new Ge.Polygon(e),t):e instanceof Ge.Polygon&&(t instanceof Ge.Circle||t instanceof Ge.Box)?Y4e(e,new Ge.Polygon(t)):void 0}function yzt(e,t){let n=new m$,o=function(s,a){return s instanceof Ge.Line?wle(s,a):s instanceof Ge.Segment?iqe(s,a):s instanceof Ge.Arc?sqe(s,a):[]}(e,t),r=o.length>0?o.slice():e.sortPoints(o),i=new GO([e]);i.split(r),[...i].forEach((s)=>s.setInclusion(t)),n.I2I=[...i].filter((s)=>s.bv===Ge.INSIDE).map((s)=>s.shape),n.I2B=[...i].slice(1).map((s)=>s.bv===Ge.BOUNDARY?s.shape:s.shape.start),n.I2E=[...i].filter((s)=>s.bv===Ge.OUTSIDE).map((s)=>s.shape),n.B2I=[],n.B2B=[],n.B2E=[];for(let s of[e.start,e.end])switch(gce(t,s)){case Ge.INSIDE:n.B2I.push(s);break;case Ge.BOUNDARY:n.B2B.push(s);break;case Ge.OUTSIDE:n.B2E.push(s)}return n}function Y4e(e,t){let n=new m$,[o,r]=xqt(e,t),i=fqt(e,t),s=Ije(e,t),a=Ije(t,e),[c,l]=yqt(e,t),h=vje(e,t),d=vje(t,e);return n.I2I=i.isEmpty()?[]:[i],n.I2B=l,n.I2E=s.isEmpty()?[]:[s],n.B2I=c,n.B2B=o,n.B2E=h,n.E2I=a.isEmpty()?[]:[a],n.E2B=d,n}var VAr=Object.freeze({__proto__:null,contain:function(e,t){return fzt(t,e)},cover:Iqt,covered:bqt,disjoint:function(e,t){return!Azt(e,t)},equal:function(e,t){return N$(e,t).equal()},inside:fzt,intersect:Azt,relate:N$,touch:function(e,t){return N$(e,t).touch()}}),aQ=class e{constructor(t=1,n=0,o=0,r=1,i=0,s=0){this.a=t,this.b=n,this.c=o,this.d=r,this.tx=i,this.ty=s}fromMatrix3x3(t){let[n,o,r]=t[0],[i,s,a]=t[1];return new e(n,i,o,s,r,a)}toMatrix3x3(){return[[this.a,this.c,this.tx],[this.b,this.d,this.ty],[0,0,1]]}clone(){return new e(this.a,this.b,this.c,this.d,this.tx,this.ty)}transform(t){return[t[0]*this.a+t[1]*this.c+this.tx,t[0]*this.b+t[1]*this.d+this.ty]}multiply(t){return new e(this.a*t.a+this.c*t.b,this.b*t.a+this.d*t.b,this.a*t.c+this.c*t.d,this.b*t.c+this.d*t.d,this.a*t.tx+this.c*t.ty+this.tx,this.b*t.tx+this.d*t.ty+this.ty)}translate(...t){let n,o;if(t.length!=1||isNaN(t[0].x)||isNaN(t[0].y)){if(t.length!==2||typeof t[0]!="number"||typeof t[1]!="number")throw Fu.ILLEGAL_PARAMETERS;n=t[0],o=t[1]}else n=t[0].x,o=t[0].y;return this.multiply(new e(1,0,0,1,n,o))}rotate(t,n=0,o=0){let r=Math.cos(t),i=Math.sin(t);return this.translate(n,o).multiply(new e(r,i,-i,r,0,0)).translate(-n,-o)}scale(t,n){return this.multiply(new e(t,0,0,n,0,0))}equalTo(t){return!!Ge.Utils.EQ(this.tx,t.tx)&&(!!Ge.Utils.EQ(this.ty,t.ty)&&(!!Ge.Utils.EQ(this.a,t.a)&&(!!Ge.Utils.EQ(this.b,t.b)&&(!!Ge.Utils.EQ(this.c,t.c)&&!!Ge.Utils.EQ(this.d,t.d)))))}};Ge.Matrix=aQ;Ge.matrix=(...e)=>new Ge.Matrix(...e);var YAr=class{constructor(e,t){this.low=e,this.high=t}get max(){return this.clone()}less_than(e){return this.low<e.low||this.low===e.low&&this.high<e.high}equal_to(e){return this.low===e.low&&this.high===e.high}intersect(e){return!this.not_intersect(e)}not_intersect(e){return this.high<e.low||e.high<this.low}merge(e){let t=this.low===void 0?e.low:this.low<e.low?this.low:e.low,n=this.high===void 0?e.high:this.high>e.high?this.high:e.high,o=this.clone();return o.low=t,o.high=n,o}output(){return[this.low,this.high]}comparable_less_than(e,t){return e<t}},GAr=class e extends YAr{clone(){return new e(this.low,this.high)}},RR=class{constructor(e,t,n=null,o=null,r=null,i=0){if(this.left=n,this.right=o,this.parent=r,this.color=i,this.item={key:void 0,values:[]},t!==void 0&&this.item.values.push(t),e!==void 0)if(Array.isArray(e)){let[s,a]=e;if(!Number.isNaN(s)&&!Number.isNaN(a)){let c=s,l=a;c>l&&([c,l]=[l,c]),this.item.key=new GAr(c,l)}}else this.item.key=e;this.max=this.item.key?this.item.key.max:void 0}isNil(){return this.item.key===void 0&&this.item.values.length===0&&this.left===null&&this.right===null&&this.color===0}requireKey(){if(!this.item.key)throw Error("Node key is undefined (nil/sentinel). Operation is not applicable.");return this.item.key}less_than(e){let t=this.requireKey(),n=e.requireKey();return t.less_than(n)}_value_equal(e){let t=this.item.values[0],n=e.item.values[0];return t&&n&&t.equal_to?t.equal_to(n):t===n}equal_to(e){let t=this.requireKey(),n=e.requireKey();return t.equal_to(n)}intersect(e){let t=this.requireKey(),n=e.requireKey();return t.intersect(n)}copy_data(e){this.item.key=e.item.key,this.item.values=e.item.values.slice()}update_max(){this.max=this.item.key?this.item.key.max:void 0,this.right&&this.right.max&&(this.max=this.max?this.max.merge(this.right.max):this.right.max),this.left&&this.left.max&&(this.max=this.max?this.max.merge(this.left.max):this.left.max)}not_intersect_left_subtree(e){if(!this.left)return!0;let t=this.left.max?this.left.max.high:this.left.item.key.high,n=this.requireKey(),o=e.requireKey();return n.comparable_less_than(t,o.low)}not_intersect_right_subtree(e){if(!this.right)return!0;let t=this.right.max?this.right.max.low:this.right.item.key.low,n=this.requireKey(),o=e.requireKey();return n.comparable_less_than(o.high,t)}},wje=class e{constructor(){this.root=null,this.nil_node=new RR}get size(){let t=0;return this.tree_walk(this.root,(n)=>t+=n.item.values.length),t}get keys(){let t=[];return this.tree_walk(this.root,(n)=>t.push(n.item.key.output())),t}get values(){let t=[];return this.tree_walk(this.root,(n)=>{for(let o of n.item.values)t.push(o)}),t}get items(){let t=[];return this.tree_walk(this.root,(n)=>{let o=n.item.key.output();for(let r of n.item.values)t.push({key:o,value:r})}),t}isEmpty(){return this.root==null||this.root===this.nil_node}clear(){this.root=null}insert(t,n=t){if(t===void 0)return;let o=this.tree_search(this.root,new RR(t));if(o)return o.item.values.push(n),o;let r=new RR(t,n,this.nil_node,this.nil_node,null,1);return this.tree_insert(r),this.recalc_max(r),r}exist(t,n=t){let o=this.tree_search(this.root,new RR(t));return!!o&&(arguments.length<2||n===t||o.item.values.some((r)=>r&&r.equal_to?r.equal_to(n):r===n))}remove(t,n=t){let o=this.tree_search(this.root,new RR(t));if(!o)return;if(arguments.length<2)return this.tree_delete(o),o;let r=o.item.values.findIndex((i)=>i&&i.equal_to?i.equal_to(n):i===n);return r>=0?(o.item.values.splice(r,1),o.item.values.length===0&&this.tree_delete(o),o):void 0}search(t,n=(o,r)=>o===r?r.output():o){let o=new RR(t),r=[];this.tree_search_interval(this.root,o,r);let i=[];for(let s of r)for(let a of s.item.values)i.push(n(a,s.item.key));return i}intersect_any(t){let n=new RR(t);return this.tree_find_any_interval(this.root,n)}forEach(t){this.tree_walk(this.root,(n)=>{for(let o of n.item.values)t(n.item.key,o)})}map(t){let n=new e;return this.tree_walk(this.root,(o)=>{for(let r of o.item.values)n.insert(o.item.key,t(r,o.item.key))}),n}*iterate(t,n=(o,r)=>o===r?r.output():o){let o=null;for(t?o=this.tree_search_nearest_forward(this.root,new RR(t)):this.root&&(o=this.local_minimum(this.root));o;){for(let r of o.item.values)yield n(r,o.item.key);o=this.tree_successor(o)}}recalc_max(t){let n=t;for(;n.parent!=null;)n.parent.update_max(),n=n.parent}tree_insert(t){let n=this.root,o=null;if(this.root==null||this.root===this.nil_node)this.root=t;else{for(;n!==this.nil_node;)o=n,n=t.less_than(n)?n.left:n.right;t.parent=o,t.less_than(o)?o.left=t:o.right=t}this.insert_fixup(t)}insert_fixup(t){let n,o;for(n=t;n!==this.root&&n.parent.color===1;)n.parent===n.parent.parent.left?(o=n.parent.parent.right,o.color===1?(n.parent.color=0,o.color=0,n.parent.parent.color=1,n=n.parent.parent):(n===n.parent.right&&(n=n.parent,this.rotate_left(n)),n.parent.color=0,n.parent.parent.color=1,this.rotate_right(n.parent.parent))):(o=n.parent.parent.left,o.color===1?(n.parent.color=0,o.color=0,n.parent.parent.color=1,n=n.parent.parent):(n===n.parent.left&&(n=n.parent,this.rotate_right(n)),n.parent.color=0,n.parent.parent.color=1,this.rotate_left(n.parent.parent)));this.root.color=0}tree_delete(t){let n,o;n=t.left===this.nil_node||t.right===this.nil_node?t:this.tree_successor(t),o=n.left!==this.nil_node?n.left:n.right,o.parent=n.parent,n===this.root?this.root=o:(n===n.parent.left?n.parent.left=o:n.parent.right=o,n.parent.update_max()),this.recalc_max(o),n!==t&&(t.copy_data(n),t.update_max(),this.recalc_max(t)),n.color===0&&this.delete_fixup(o)}delete_fixup(t){let n,o=t;for(;o!==this.root&&o.parent!=null&&o.color===0;)o===o.parent.left?(n=o.parent.right,n.color===1&&(n.color=0,o.parent.color=1,this.rotate_left(o.parent),n=o.parent.right),n.left.color===0&&n.right.color===0?(n.color=1,o=o.parent):(n.right.color===0&&(n.color=1,n.left.color=0,this.rotate_right(n),n=o.parent.right),n.color=o.parent.color,o.parent.color=0,n.right.color=0,this.rotate_left(o.parent),o=this.root)):(n=o.parent.left,n.color===1&&(n.color=0,o.parent.color=1,this.rotate_right(o.parent),n=o.parent.left),n.left.color===0&&n.right.color===0?(n.color=1,o=o.parent):(n.left.color===0&&(n.color=1,n.right.color=0,this.rotate_left(n),n=o.parent.left),n.color=o.parent.color,o.parent.color=0,n.left.color=0,this.rotate_right(o.parent),o=this.root));o.color=0}tree_search(t,n){if(t!=null&&t!==this.nil_node)return n.equal_to(t)?t:n.less_than(t)?this.tree_search(t.left,n):this.tree_search(t.right,n)}tree_search_nearest_forward(t,n){let o=null,r=t;for(;r&&r!==this.nil_node;)r.less_than(n)?r.intersect(n)?(o=r,r=r.left):r=r.right:(o&&!r.less_than(o)||(o=r),r=r.left);return o||null}tree_search_interval(t,n,o){t!=null&&t!==this.nil_node&&(t.left===this.nil_node||t.not_intersect_left_subtree(n)||this.tree_search_interval(t.left,n,o),t.intersect(n)&&o.push(t),t.right===this.nil_node||t.not_intersect_right_subtree(n)||this.tree_search_interval(t.right,n,o))}tree_find_any_interval(t,n){let o=!1;return t!=null&&t!==this.nil_node&&(t.left===this.nil_node||t.not_intersect_left_subtree(n)||(o=this.tree_find_any_interval(t.left,n)),o||(o=t.intersect(n)),o||t.right===this.nil_node||t.not_intersect_right_subtree(n)||(o=this.tree_find_any_interval(t.right,n))),o}local_minimum(t){let n=t;for(;n.left!=null&&n.left!==this.nil_node;)n=n.left;return n}local_maximum(t){let n=t;for(;n.right!=null&&n.right!==this.nil_node;)n=n.right;return n}tree_successor(t){let n,o,r;if(t.right!==this.nil_node)n=this.local_minimum(t.right);else{for(o=t,r=t.parent;r!=null&&r.right===o;)o=r,r=r.parent;n=r}return n}rotate_left(t){let n=t.right;t.right=n.left,n.left!==this.nil_node&&(n.left.parent=t),n.parent=t.parent,t===this.root?this.root=n:t===t.parent.left?t.parent.left=n:t.parent.right=n,n.left=t,t.parent=n,t!==null&&t!==this.nil_node&&t.update_max(),n!=null&&n!==this.nil_node&&n.update_max()}rotate_right(t){let n=t.left;t.left=n.right,n.right!==this.nil_node&&(n.right.parent=t),n.parent=t.parent,t===this.root?this.root=n:t===t.parent.left?t.parent.left=n:t.parent.right=n,n.right=t,t.parent=n,t!==null&&t!==this.nil_node&&t.update_max(),n!=null&&n!==this.nil_node&&n.update_max()}tree_walk(t,n){t!=null&&t!==this.nil_node&&(this.tree_walk(t.left,n),n(t),this.tree_walk(t.right,n))}testRedBlackProperty(){let t=!0;return this.tree_walk(this.root,function(n){n.color===1&&(n.left.color===0&&n.right.color===0||(t=!1))}),t}testBlackHeightProperty(t){let n=0,o=0,r=0;if(t.color===0&&n++,o=t.left!==this.nil_node?this.testBlackHeightProperty(t.left):1,r=t.right!==this.nil_node?this.testBlackHeightProperty(t.right):1,o!==r)throw Error("Red-black height property violated");return n+=o,n}},UAr=class extends Set{constructor(e){super(e),this.index=new wje,this.forEach((t)=>this.index.insert(t))}add(e){let t=this.size,{key:n,value:o}=e,r=n||e.box,i=o||e;return super.add(i),this.size>t&&this.index.insert(r,i),this}delete(e){let{key:t,value:n}=e,o=t||e.box,r=n||e,i=super.delete(r);return i&&this.index.remove(o,r),i}clear(){super.clear(),this.index=new wje}search(e){return this.index.search(e)}hit(e){let t=new Ge.Box(e.x-1,e.y-1,e.x+1,e.y+1);return this.index.search(t).filter((n)=>e.on(n))}svg(){return[...this].reduce((e,t)=>e+t.svg(),"")}};Ge.PlanarSet=UAr;var EQ=class{get name(){throw Fu.CANNOT_INVOKE_ABSTRACT_METHOD}get box(){throw Fu.CANNOT_INVOKE_ABSTRACT_METHOD}clone(){throw Fu.CANNOT_INVOKE_ABSTRACT_METHOD}translate(...e){return this.transform(new aQ().translate(...e))}rotate(e,t=new Ge.Point){return this.transform(new aQ().rotate(e,t.x,t.y))}scale(e,t){return this.transform(new aQ().scale(e,t))}transform(...e){throw Fu.CANNOT_INVOKE_ABSTRACT_METHOD}toJSON(){return Object.assign({},this,{name:this.name})}svg(e={}){throw Fu.CANNOT_INVOKE_ABSTRACT_METHOD}},U0=class e extends EQ{constructor(...t){if(super(),this.x=0,this.y=0,t.length!==0){if(t.length===1&&t[0]instanceof Array&&t[0].length===2){let n=t[0];if(typeof n[0]=="number"&&typeof n[1]=="number")return this.x=n[0],void(this.y=n[1])}if(t.length===1&&t[0]instanceof Object&&t[0].name==="point"){let{x:n,y:o}=t[0];return this.x=n,void(this.y=o)}if(t.length===2&&typeof t[0]=="number"&&typeof t[1]=="number")return this.x=t[0],void(this.y=t[1]);throw Fu.ILLEGAL_PARAMETERS}}get box(){return new Ge.Box(this.x,this.y,this.x,this.y)}clone(){return new Ge.Point(this.x,this.y)}get vertices(){return[this.clone()]}equalTo(t){return Ge.Utils.EQ(this.x,t.x)&&Ge.Utils.EQ(this.y,t.y)}lessThan(t){return!!Ge.Utils.LT(this.y,t.y)||!(!Ge.Utils.EQ(this.y,t.y)||!Ge.Utils.LT(this.x,t.x))}transform(t){return new Ge.Point(t.transform([this.x,this.y]))}projectionOn(t){if(this.equalTo(t.pt))return this.clone();let n=new Ge.Vector(this,t.pt);if(Ge.Utils.EQ_0(n.cross(t.norm)))return t.pt.clone();let o=n.dot(t.norm),r=t.norm.multiply(o);return this.translate(r)}leftTo(t){let n=new Ge.Vector(t.pt,this);return Ge.Utils.GT(n.dot(t.norm),0)}distanceTo(t){if(t instanceof e){let n=t.x-this.x,o=t.y-this.y;return[Math.sqrt(n*n+o*o),new Ge.Segment(this,t)]}return t instanceof Ge.Line?Ge.Distance.point2line(this,t):t instanceof Ge.Circle?Ge.Distance.point2circle(this,t):t instanceof Ge.Segment?Ge.Distance.point2segment(this,t):t instanceof Ge.Arc?Ge.Distance.point2arc(this,t):t instanceof Ge.Box?Ge.Distance.point2polygon(this,new Ge.Polygon(t)):t instanceof Ge.Polygon?Ge.Distance.point2polygon(this,t):t instanceof Ge.PlanarSet?Ge.Distance.shape2planarSet(this,t):t instanceof Ge.Multiline?Ge.Distance.shape2multiline(this,t):void 0}on(t){if(t instanceof Ge.Point)return this.equalTo(t);if(t.contains&&t.contains instanceof Function)return t.contains(this);throw Ge.Errors.UNSUPPORTED_SHAPE_TYPE}get name(){return"point"}svg(t={}){let n=t.r??3;return`
<circle cx="${this.x}" cy="${this.y}" r="${n}"
            ${CV({fill:"red",...t})} />`}};Ge.Point=U0;var WAr=(...e)=>new Ge.Point(...e);Ge.point=WAr;var Ybe=class extends EQ{constructor(...e){if(super(),this.x=0,this.y=0,e.length!==0){if(e.length===1&&e[0]instanceof Array&&e[0].length===2){let t=e[0];if(typeof t[0]=="number"&&typeof t[1]=="number")return this.x=t[0],void(this.y=t[1])}if(e.length===1&&e[0]instanceof Object&&e[0].name==="vector"){let{x:t,y:n}=e[0];return this.x=t,void(this.y=n)}if(e.length===1&&e[0]instanceof Object&&e[0].name==="segment"){let{start:t,end:n}=e[0];return this.x=n.x-t.x,void(this.y=n.y-t.y)}if(e.length===2){let t=e[0],n=e[1];if(typeof t=="number"&&typeof n=="number")return this.x=t,void(this.y=n);if(t instanceof Ge.Point&&n instanceof Ge.Point)return this.x=n.x-t.x,void(this.y=n.y-t.y)}throw Fu.ILLEGAL_PARAMETERS}}clone(){return new Ge.Vector(this.x,this.y)}get slope(){let e=Math.atan2(this.y,this.x);return e<0&&(e=2*Math.PI+e),e}get length(){return Math.sqrt(this.dot(this))}isZeroLength(){return Ge.Utils.EQ_0(this.length)}equalTo(e){return Ge.Utils.EQ(this.x,e.x)&&Ge.Utils.EQ(this.y,e.y)}multiply(e){return new Ge.Vector(e*this.x,e*this.y)}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}normalize(){if(this.isZeroLength())throw Fu.ZERO_DIVISION;return new Ge.Vector(this.x/this.length,this.y/this.length)}rotate(e,t=new Ge.Point){if(t.x===0&&t.y===0)return this.transform(new aQ().rotate(e));throw Fu.OPERATION_IS_NOT_SUPPORTED}transform(e){return new Ge.Vector(e.transform([this.x,this.y]))}rotate90CCW(){return new Ge.Vector(-this.y,this.x)}rotate90CW(){return new Ge.Vector(this.y,-this.x)}invert(){return new Ge.Vector(-this.x,-this.y)}add(e){return new Ge.Vector(this.x+e.x,this.y+e.y)}subtract(e){return new Ge.Vector(this.x-e.x,this.y-e.y)}angleTo(e){let t=this.normalize(),n=e.normalize(),o=Math.atan2(t.cross(n),t.dot(n));return o<0&&(o+=2*Math.PI),o}projectionOn(e){let t=e.normalize(),n=this.dot(t);return t.multiply(n)}get name(){return"vector"}};Ge.Vector=Ybe;var vqt=(...e)=>new Ge.Vector(...e);Ge.vector=vqt;var lS=class e extends EQ{constructor(...t){if(super(),this.ps=new Ge.Point,this.pe=new Ge.Point,t.length!==0){if(t.length===1&&t[0]instanceof Array&&t[0].length===4){let n=t[0];return this.ps=new Ge.Point(n[0],n[1]),void(this.pe=new Ge.Point(n[2],n[3]))}if(t.length===1&&t[0]instanceof Object&&t[0].name==="segment"){let{ps:n,pe:o}=t[0];return this.ps=new Ge.Point(n.x,n.y),void(this.pe=new Ge.Point(o.x,o.y))}if(!(t.length===1&&t[0]instanceof Ge.Point)){if(t.length===2&&t[0]instanceof Ge.Point&&t[1]instanceof Ge.Point)return this.ps=t[0].clone(),void(this.pe=t[1].clone());if(t.length===4)return this.ps=new Ge.Point(t[0],t[1]),void(this.pe=new Ge.Point(t[2],t[3]));throw Fu.ILLEGAL_PARAMETERS}this.ps=t[0].clone()}}clone(){return new Ge.Segment(this.start,this.end)}get start(){return this.ps}get end(){return this.pe}get vertices(){return[this.ps.clone(),this.pe.clone()]}get length(){return this.start.distanceTo(this.end)[0]}get slope(){return new Ge.Vector(this.start,this.end).slope}get box(){return new Ge.Box(Math.min(this.start.x,this.end.x),Math.min(this.start.y,this.end.y),Math.max(this.start.x,this.end.x),Math.max(this.start.y,this.end.y))}equalTo(t){return this.ps.equalTo(t.ps)&&this.pe.equalTo(t.pe)}contains(t){return Ge.Utils.EQ_0(this.distanceToPoint(t))}intersect(t){return t instanceof Ge.Point?this.contains(t)?[t]:[]:t instanceof Ge.Line?Mle(this,t):t instanceof Ge.Ray?aqe(t,this):t instanceof Ge.Segment?QCe(this,t):t instanceof Ge.Circle?kCe(this,t):t instanceof Ge.Box?function(n,o){let r=[];for(let i of o.toSegments()){let s=QCe(i,n);for(let a of s)r.push(a)}return r}(this,t):t instanceof Ge.Arc?nq(this,t):t instanceof Ge.Polygon?iqe(this,t):t instanceof Ge.Multiline?Dq(this,t):void 0}distanceTo(t){if(t instanceof Ge.Point){let[n,o]=Ge.Distance.point2segment(t,this);return o=o.reverse(),[n,o]}if(t instanceof Ge.Circle){let[n,o]=Ge.Distance.segment2circle(this,t);return[n,o]}if(t instanceof Ge.Line){let[n,o]=Ge.Distance.segment2line(this,t);return[n,o]}if(t instanceof Ge.Segment){let[n,o]=Ge.Distance.segment2segment(this,t);return[n,o]}if(t instanceof Ge.Arc){let[n,o]=Ge.Distance.segment2arc(this,t);return[n,o]}if(t instanceof Ge.Box){let[n,o]=Ge.Distance.shape2polygon(this,new Ge.Polygon(t));return[n,o]}if(t instanceof Ge.Polygon){let[n,o]=Ge.Distance.shape2polygon(this,t);return[n,o]}if(t instanceof Ge.PlanarSet){let[n,o]=Ge.Distance.shape2planarSet(this,t);return[n,o]}if(t instanceof Ge.Multiline)return Ge.Distance.shape2multiline(this,t)}tangentInStart(){return new Ge.Vector(this.start,this.end).normalize()}tangentInEnd(){return new Ge.Vector(this.end,this.start).normalize()}reverse(){return new e(this.end,this.start)}split(t){return this.start.equalTo(t)?[null,this.clone()]:this.end.equalTo(t)?[this.clone(),null]:[new Ge.Segment(this.start,t),new Ge.Segment(t,this.end)]}middle(){return new Ge.Point((this.start.x+this.end.x)/2,(this.start.y+this.end.y)/2)}pointAtLength(t){if(t>this.length||t<0)return null;if(t==0)return this.start;if(t==this.length)return this.end;let n=t/this.length;return new Ge.Point((this.end.x-this.start.x)*n+this.start.x,(this.end.y-this.start.y)*n+this.start.y)}distanceToPoint(t){let[n,...o]=Ge.Distance.point2segment(t,this);return n}definiteIntegral(t=0){return(this.end.x-this.start.x)*(this.start.y-t+(this.end.y-t))/2}transform(t=new Ge.Matrix){return new e(this.ps.transform(t),this.pe.transform(t))}isZeroLength(){return this.ps.equalTo(this.pe)}sortPoints(t){return new Ge.Line(this.start,this.end).sortPoints(t)}get name(){return"segment"}svg(t={}){return`
<line x1="${this.start.x}" y1="${this.start.y}" x2="${this.end.x}" y2="${this.end.y}" ${CV(t)} />`}};Ge.Segment=lS;var XAr=(...e)=>new Ge.Segment(...e);Ge.segment=XAr;var{vector:yae}=Ge;Ge.Line=class e extends EQ{constructor(...t){if(super(),this.pt=new Ge.Point,this.norm=new Ge.Vector(0,1),t.length!==0){if(t.length===1&&t[0]instanceof Object&&t[0].name==="line"){let{pt:n,norm:o}=t[0];return this.pt=new Ge.Point(n),void(this.norm=new Ge.Vector(o))}if(t.length===2){let n=t[0],o=t[1];if(n instanceof Ge.Point&&o instanceof Ge.Point)return this.pt=n,this.norm=e.points2norm(n,o),void(this.norm.dot(yae(this.pt.x,this.pt.y))>=0&&this.norm.invert());if(n instanceof Ge.Point&&o instanceof Ge.Vector){if(Ge.Utils.EQ_0(o.x)&&Ge.Utils.EQ_0(o.y))throw Fu.ILLEGAL_PARAMETERS;return this.pt=n.clone(),this.norm=o.clone(),this.norm=this.norm.normalize(),void(this.norm.dot(yae(this.pt.x,this.pt.y))>=0&&this.norm.invert())}if(n instanceof Ge.Vector&&o instanceof Ge.Point){if(Ge.Utils.EQ_0(n.x)&&Ge.Utils.EQ_0(n.y))throw Fu.ILLEGAL_PARAMETERS;return this.pt=o.clone(),this.norm=n.clone(),this.norm=this.norm.normalize(),void(this.norm.dot(yae(this.pt.x,this.pt.y))>=0&&this.norm.invert())}}throw Fu.ILLEGAL_PARAMETERS}}clone(){return new Ge.Line(this.pt,this.norm)}get start(){}get end(){}get length(){return Number.POSITIVE_INFINITY}get box(){return new Ge.Box(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY)}get middle(){}get slope(){return new Ge.Vector(this.norm.y,-this.norm.x).slope}get standard(){return[this.norm.x,this.norm.y,this.norm.dot(yae(this.pt.x,this.pt.y))]}parallelTo(t){return Ge.Utils.EQ_0(this.norm.cross(t.norm))}incidentTo(t){return this.parallelTo(t)&&this.pt.on(t)}contains(t){if(this.pt.equalTo(t))return!0;let n=new Ge.Vector(this.pt,t);return Ge.Utils.EQ_0(this.norm.dot(n))}coord(t){return yae(t.x,t.y).cross(this.norm)}intersect(t){return t instanceof Ge.Point?this.contains(t)?[t]:[]:t instanceof Ge.Line?Tq(this,t):t instanceof Ge.Ray?_qt(t,this):t instanceof Ge.Circle?bV(this,t):t instanceof Ge.Box?tq(this,t):t instanceof Ge.Segment?Mle(t,this):t instanceof Ge.Arc?Vbe(this,t):t instanceof Ge.Polygon?wle(this,t):t instanceof Ge.Multiline?Dq(this,t):void 0}distanceTo(t){if(t instanceof Ge.Point){let[n,o]=Ge.Distance.point2line(t,this);return o=o.reverse(),[n,o]}if(t instanceof Ge.Circle){let[n,o]=Ge.Distance.circle2line(t,this);return o=o.reverse(),[n,o]}if(t instanceof Ge.Segment){let[n,o]=Ge.Distance.segment2line(t,this);return[n,o.reverse()]}if(t instanceof Ge.Arc){let[n,o]=Ge.Distance.arc2line(t,this);return[n,o.reverse()]}if(t instanceof Ge.Box){let[n,o]=Ge.Distance.shape2polygon(this,new Ge.Polygon(t));return[n,o]}if(t instanceof Ge.Polygon){let[n,o]=Ge.Distance.shape2polygon(this,t);return[n,o]}}split(t){if(t instanceof Ge.Point)return[new Ge.Ray(t,this.norm),new Ge.Ray(t,this.norm)];{let n=new Ge.Multiline([this]),o=this.sortPoints(t);return n.split(o),n.toShapes()}}rotate(t,n=new Ge.Point){return new Ge.Line(this.pt.rotate(t,n),this.norm.rotate(t))}transform(t){return new Ge.Line(this.pt.transform(t),this.norm.clone())}sortPoints(t){return t.slice().sort((n,o)=>this.coord(n)<this.coord(o)?-1:this.coord(n)>this.coord(o)?1:0)}get name(){return"line"}svg(t,n={}){let o=tq(this,t);if(o.length===0)return"";let r=o[0],i=o.length===2?o[1]:o.find((s)=>!s.equalTo(r));return i===void 0&&(i=r),new Ge.Segment(r,i).svg(n)}static points2norm(t,n){if(t.equalTo(n))throw Fu.ILLEGAL_PARAMETERS;return new Ge.Vector(t,n).normalize().rotate90CCW()}};var jAr=(...e)=>new Ge.Line(...e);Ge.line=jAr;var hqe=class extends EQ{constructor(...e){if(super(),this.pc=new Ge.Point,this.r=1,e.length===1&&e[0]instanceof Object&&e[0].name==="circle"){let{pc:t,r:n}=e[0];this.pc=new Ge.Point(t),this.r=n}else{let[t,n]=[...e];t&&t instanceof Ge.Point&&(this.pc=t.clone()),n!==void 0&&(this.r=n)}}clone(){return new Ge.Circle(this.pc.clone(),this.r)}get center(){return this.pc}get box(){return new Ge.Box(this.pc.x-this.r,this.pc.y-this.r,this.pc.x+this.r,this.pc.y+this.r)}contains(e){return e instanceof Ge.Point?Ge.Utils.LE(e.distanceTo(this.center)[0],this.r):e instanceof Ge.Segment?Ge.Utils.LE(e.start.distanceTo(this.center)[0],this.r)&&Ge.Utils.LE(e.end.distanceTo(this.center)[0],this.r):e instanceof Ge.Arc?this.intersect(e).length===0&&Ge.Utils.LE(e.start.distanceTo(this.center)[0],this.r)&&Ge.Utils.LE(e.end.distanceTo(this.center)[0],this.r):e instanceof Ge.Circle?this.intersect(e).length===0&&Ge.Utils.LE(e.r,this.r)&&Ge.Utils.LE(e.center.distanceTo(this.center)[0],this.r):void 0}toArc(e=!0){return new Ge.Arc(this.center,this.r,Math.PI,-Math.PI,e)}scale(e,t){if(e!==t)throw Fu.OPERATION_IS_NOT_SUPPORTED;if(this.pc.x!==0||this.pc.y!==0)throw Fu.OPERATION_IS_NOT_SUPPORTED;return new Ge.Circle(this.pc,this.r*e)}transform(e=new Ge.Matrix){return new Ge.Circle(this.pc.transform(e),this.r)}intersect(e){return e instanceof Ge.Point?this.contains(e)?[e]:[]:e instanceof Ge.Line?bV(e,this):e instanceof Ge.Ray?mqt(e,this):e instanceof Ge.Segment?kCe(e,this):e instanceof Ge.Circle?sqt(e,this):e instanceof Ge.Box?function(t,n){let o=[];for(let r of n.toSegments()){let i=kCe(r,t);for(let s of i)o.push(s)}return o}(this,e):e instanceof Ge.Arc?rqe(e,this):e instanceof Ge.Polygon?dqt(this,e):e instanceof Ge.Multiline?Dq(this,e):void 0}distanceTo(e){if(e instanceof Ge.Point){let[t,n]=Ge.Distance.point2circle(e,this);return n=n.reverse(),[t,n]}if(e instanceof Ge.Circle){let[t,n]=Ge.Distance.circle2circle(this,e);return[t,n]}if(e instanceof Ge.Line){let[t,n]=Ge.Distance.circle2line(this,e);return[t,n]}if(e instanceof Ge.Segment){let[t,n]=Ge.Distance.segment2circle(e,this);return n=n.reverse(),[t,n]}if(e instanceof Ge.Arc){let[t,n]=Ge.Distance.arc2circle(e,this);return n=n.reverse(),[t,n]}if(e instanceof Ge.Box){let[t,n]=Ge.Distance.shape2polygon(this,new Ge.Polygon(e));return[t,n]}if(e instanceof Ge.Polygon){let[t,n]=Ge.Distance.shape2polygon(this,e);return[t,n]}if(e instanceof Ge.PlanarSet){let[t,n]=Ge.Distance.shape2planarSet(this,e);return[t,n]}if(e instanceof Ge.Multiline){let[t,n]=Ge.Distance.shape2multiline(this,e);return[t,n]}}get name(){return"circle"}svg(e={}){return`
<circle cx="${this.pc.x}" cy="${this.pc.y}" r="${this.r}"
                ${CV({fill:"none",...e})} />`}};Ge.Circle=hqe;Ge.circle=(...e)=>new Ge.Circle(...e);var ub=class extends EQ{constructor(...e){if(super(),this.pc=new Ge.Point,this.r=1,this.startAngle=0,this.endAngle=2*Math.PI,this.counterClockwise=!0,e.length!==0)if(e.length===1&&e[0]instanceof Object&&e[0].name==="arc"){let{pc:t,r:n,startAngle:o,endAngle:r,counterClockwise:i}=e[0];this.pc=new Ge.Point(t.x,t.y),this.r=n,this.startAngle=o,this.endAngle=r,this.counterClockwise=i}else{let[t,n,o,r,i]=[...e];t&&t instanceof Ge.Point&&(this.pc=t.clone()),n!==void 0&&(this.r=n),o!==void 0&&(this.startAngle=o),r!==void 0&&(this.endAngle=r),i!==void 0&&(this.counterClockwise=i)}}clone(){return new Ge.Arc(this.pc.clone(),this.r,this.startAngle,this.endAngle,this.counterClockwise)}get sweep(){let e=this.startAngle,t=this.endAngle;if(Ge.Utils.EQ(Math.abs(e-t),Ge.PIx2))return Ge.PIx2;Math.abs(e)>Ge.PIx2&&(e-=Math.trunc(e/Ge.PIx2)*Ge.PIx2),e<0&&(e+=Ge.PIx2),Math.abs(t)>Ge.PIx2&&(t-=Math.trunc(t/Ge.PIx2)*Ge.PIx2),t<0&&(t+=Ge.PIx2);let n=this.counterClockwise?t-e:e-t;return n<0&&(n+=Ge.PIx2),n}get start(){return new Ge.Point(this.pc.x+this.r,this.pc.y).rotate(this.startAngle,this.pc)}get end(){return new Ge.Point(this.pc.x+this.r,this.pc.y).rotate(this.endAngle,this.pc)}get center(){return this.pc.clone()}get vertices(){return[this.start.clone(),this.end.clone()]}get length(){return Math.abs(this.sweep*this.r)}get box(){let e=this.breakToFunctional().reduce((t,n)=>t.merge(n.start.box),new Ge.Box);return e=e.merge(this.end.box),e}contains(e){if(!Ge.Utils.EQ(this.pc.distanceTo(e)[0],this.r))return!1;if(e.equalTo(this.start))return!0;let t=new Ge.Vector(this.pc,e).slope,n=new Ge.Arc(this.pc,this.r,this.startAngle,t,this.counterClockwise);return Ge.Utils.LE(n.length,this.length)}split(e){if(this.start.equalTo(e))return[null,this.clone()];if(this.end.equalTo(e))return[this.clone(),null];let t=new Ge.Vector(this.pc,e).slope;return[new Ge.Arc(this.pc,this.r,this.startAngle,t,this.counterClockwise),new Ge.Arc(this.pc,this.r,t,this.endAngle,this.counterClockwise)]}middle(){let e=this.counterClockwise?this.startAngle+this.sweep/2:this.startAngle-this.sweep/2;return new Ge.Arc(this.pc,this.r,this.startAngle,e,this.counterClockwise).end}pointAtLength(e){if(e>this.length||e<0)return null;if(e===0)return this.start;if(e===this.length)return this.end;let t=e/this.length,n=this.counterClockwise?this.startAngle+this.sweep*t:this.startAngle-this.sweep*t;return new Ge.Arc(this.pc,this.r,this.startAngle,n,this.counterClockwise).end}chordHeight(){return(1-Math.cos(Math.abs(this.sweep/2)))*this.r}intersect(e){return e instanceof Ge.Point?this.contains(e)?[e]:[]:e instanceof Ge.Line?Vbe(e,this):e instanceof Ge.Ray?cqe(e,this):e instanceof Ge.Circle?rqe(this,e):e instanceof Ge.Segment?nq(e,this):e instanceof Ge.Box?function(t,n){let o=[];for(let r of n.toSegments()){let i=nq(r,t);for(let s of i)o.push(s)}return o}(this,e):e instanceof Ge.Arc?aqt(this,e):e instanceof Ge.Polygon?sqe(this,e):e instanceof Ge.Multiline?Dq(this,e):void 0}distanceTo(e){if(e instanceof Ge.Point){let[t,n]=Ge.Distance.point2arc(e,this);return n=n.reverse(),[t,n]}if(e instanceof Ge.Circle){let[t,n]=Ge.Distance.arc2circle(this,e);return[t,n]}if(e instanceof Ge.Line){let[t,n]=Ge.Distance.arc2line(this,e);return[t,n]}if(e instanceof Ge.Segment){let[t,n]=Ge.Distance.segment2arc(e,this);return n=n.reverse(),[t,n]}if(e instanceof Ge.Arc){let[t,n]=Ge.Distance.arc2arc(this,e);return[t,n]}if(e instanceof Ge.Box){let[t,n]=Ge.Distance.shape2polygon(this,new Ge.Polygon(e));return[t,n]}if(e instanceof Ge.Polygon){let[t,n]=Ge.Distance.shape2polygon(this,e);return[t,n]}if(e instanceof Ge.PlanarSet){let[t,n]=Ge.Distance.shape2planarSet(this,e);return[t,n]}if(e instanceof Ge.Multiline)return Ge.Distance.shape2multiline(this,e)}breakToFunctional(){let e=[],t=[0,Math.PI/2,Math.PI,3*Math.PI/2],n=this.startAngle,o=this.endAngle;Ge.Utils.EQ(Math.abs(n-o),Ge.PIx2)&&(o=n),Math.abs(n)>Ge.PIx2&&(n-=Math.trunc(n/Ge.PIx2)*Ge.PIx2),n<0&&(n+=Ge.PIx2),Math.abs(o)>Ge.PIx2&&(o-=Math.trunc(o/Ge.PIx2)*Ge.PIx2),o<0&&(o+=Ge.PIx2);let r,i,s,a=n;this.counterClockwise?(i=Math.ceil(n/(Math.PI/2))%4,s=1):(i=Math.floor(n/(Math.PI/2))%4,s=-1);for(let c=0,l=i;c<4;c++,l=(l+s+4)%4){if(r=t[l],r===a)continue;let h=this.counterClockwise?r-n:n-r;if(h<0&&(h+=Ge.PIx2),h>this.sweep)break;e.push(new Ge.Arc(this.pc,this.r,a,r,this.counterClockwise)),a=r}return e.length===0?(e.push(this),e):(r=o,a!==r&&e.push(new Ge.Arc(this.pc,this.r,a,r,this.counterClockwise)),e)}tangentInStart(){let e=new Ge.Vector(this.pc,this.start),t=this.counterClockwise?Math.PI/2:-Math.PI/2;return e.rotate(t).normalize()}tangentInEnd(){let e=new Ge.Vector(this.pc,this.end),t=this.counterClockwise?-Math.PI/2:Math.PI/2;return e.rotate(t).normalize()}reverse(){return new Ge.Arc(this.pc,this.r,this.endAngle,this.startAngle,!this.counterClockwise)}transform(e=new Ge.Matrix){let t=this.start.transform(e),n=this.end.transform(e),o=this.pc.transform(e),r=this.counterClockwise;return e.a*e.d<0&&(r=!r),Ge.Arc.arcSE(o,t,n,r)}static arcSE(e,t,n,o){let{vector:r}=Ge,i=r(e,t).slope,s=r(e,n).slope;Ge.Utils.EQ(i,s)&&(s+=2*Math.PI,o=!0);let a=r(e,t).length;return new Ge.Arc(e,a,i,s,o)}definiteIntegral(e=0){return this.breakToFunctional().reduce((t,n)=>t+n.circularSegmentDefiniteIntegral(e),0)}circularSegmentDefiniteIntegral(e){let t=new Ge.Segment(this.start,this.end).definiteIntegral(e),n=Ge.Utils.EQ(this.sweep,Ge.PIx2)?0:this.circularSegmentArea();return this.counterClockwise?t-n:t+n}circularSegmentArea(){return 0.5*this.r*this.r*(this.sweep-Math.sin(this.sweep))}sortPoints(e){let{vector:t}=Ge;return e.slice().sort((n,o)=>{let r=t(this.pc,n).slope,i=t(this.pc,o).slope;return r<i?-1:r>i?1:0})}get name(){return"arc"}svg(e={}){let t=this.sweep<=Math.PI?"0":"1",n=this.counterClockwise?"1":"0";if(Ge.Utils.EQ(this.sweep,2*Math.PI))return new Ge.Circle(this.pc,this.r).svg(e);return`
<path d="M${this.start.x},${this.start.y}
                             A${this.r},${this.r} 0 ${t},${n} ${this.end.x},${this.end.y}"
                    ${CV({fill:"none",...e})} />`}};Ge.Arc=ub;Ge.arc=(...e)=>new Ge.Arc(...e);var dqe=class e extends EQ{constructor(t=void 0,n=void 0,o=void 0,r=void 0){super(),this.xmin=t,this.ymin=n,this.xmax=o,this.ymax=r}clone(){return new e(this.xmin,this.ymin,this.xmax,this.ymax)}get low(){return new Ge.Point(this.xmin,this.ymin)}get high(){return new Ge.Point(this.xmax,this.ymax)}get max(){return this.clone()}get center(){return new Ge.Point((this.xmin+this.xmax)/2,(this.ymin+this.ymax)/2)}get width(){return Math.abs(this.xmax-this.xmin)}get height(){return Math.abs(this.ymax-this.ymin)}get box(){return this.clone()}not_intersect(t){return this.xmax<t.xmin||this.xmin>t.xmax||this.ymax<t.ymin||this.ymin>t.ymax}intersect(t){return!this.not_intersect(t)}merge(t){return new e(this.xmin===void 0?t.xmin:Math.min(this.xmin,t.xmin),this.ymin===void 0?t.ymin:Math.min(this.ymin,t.ymin),this.xmax===void 0?t.xmax:Math.max(this.xmax,t.xmax),this.ymax===void 0?t.ymax:Math.max(this.ymax,t.ymax))}less_than(t){return!!this.low.lessThan(t.low)||!(!this.low.equalTo(t.low)||!this.high.lessThan(t.high))}equal_to(t){return this.low.equalTo(t.low)&&this.high.equalTo(t.high)}output(){return this.clone()}comparable_less_than(t,n){return t.lessThan(n)}set(t,n,o,r){this.xmin=t,this.ymin=n,this.xmax=o,this.ymax=r}extend(t){return t<=0?this.clone():new e(this.xmin-t,this.ymin-t,this.xmax+t,this.ymax+t)}toPoints(){return[new Ge.Point(this.xmin,this.ymin),new Ge.Point(this.xmax,this.ymin),new Ge.Point(this.xmax,this.ymax),new Ge.Point(this.xmin,this.ymax)]}toSegments(){let t=this.toPoints();return[new Ge.Segment(t[0],t[1]),new Ge.Segment(t[1],t[2]),new Ge.Segment(t[2],t[3]),new Ge.Segment(t[3],t[0])]}rotate(t,n=new Ge.Point){throw Fu.OPERATION_IS_NOT_SUPPORTED}transform(t=new Ge.Matrix){return this.toPoints().map((n)=>n.transform(t)).reduce((n,o)=>n.merge(o.box),new e)}contains(t){return t instanceof Ge.Point?t.x>=this.xmin&&t.x<=this.xmax&&t.y>=this.ymin&&t.y<=this.ymax:t instanceof Ge.Segment?t.vertices.every((n)=>this.contains(n)):t instanceof Ge.Box?t.toSegments().every((n)=>this.contains(n)):t instanceof Ge.Circle?this.contains(t.box):t instanceof Ge.Arc?t.vertices.every((n)=>this.contains(n))&&this.toSegments().every((n)=>nq(n,t).length===0):!(t instanceof Ge.Line||t instanceof Ge.Ray)&&(t instanceof Ge.Multiline?t.toShapes().every((n)=>this.contains(n)):t instanceof Ge.Polygon?this.contains(t.box):void 0)}distanceTo(t){let n=this.toSegments().map((r)=>r.distanceTo(t)),o=[Number.MAX_SAFE_INTEGER,null];return n.forEach((r)=>{r[0]<o[0]&&(o=r)}),o}get name(){return"box"}svg(t={}){let n=this.xmax-this.xmin,o=this.ymax-this.ymin;return`
<rect x="${this.xmin}" y="${this.ymin}" width="${n}" height="${o}"
                ${CV({fill:"none",...t})} />`}};Ge.Box=dqe;Ge.box=(...e)=>new Ge.Box(...e);Ge.Edge=class{constructor(e){this.shape=e,this.next=void 0,this.prev=void 0,this.face=void 0,this.arc_length=0,this.bvStart=void 0,this.bvEnd=void 0,this.bv=void 0,this.overlap=void 0}get start(){return this.shape.start}get end(){return this.shape.end}get length(){return this.shape.length}get box(){return this.shape.box}get isSegment(){return this.shape instanceof Ge.Segment}get isArc(){return this.shape instanceof Ge.Arc}get isLine(){return this.shape instanceof Ge.Line}get isRay(){return this.shape instanceof Ge.Ray}middle(){return this.shape.middle()}pointAtLength(e){return this.shape.pointAtLength(e)}contains(e){return this.shape.contains(e)}setInclusion(e){if(this.bv!==void 0)return this.bv;if(this.shape instanceof Ge.Line||this.shape instanceof Ge.Ray)return this.bv=Ge.OUTSIDE,this.bv;if(this.bvStart===void 0&&(this.bvStart=gce(e,this.start)),this.bvEnd===void 0&&(this.bvEnd=gce(e,this.end)),this.bvStart===Ge.OUTSIDE||this.bvEnd==Ge.OUTSIDE)this.bv=Ge.OUTSIDE;else if(this.bvStart===Ge.INSIDE||this.bvEnd==Ge.INSIDE)this.bv=Ge.INSIDE;else{let t=gce(e,this.middle());this.bv=t}return this.bv}setOverlap(e){let t,n=this.shape,o=e.shape;n instanceof Ge.Segment&&o instanceof Ge.Segment?n.start.equalTo(o.start)&&n.end.equalTo(o.end)?t=Ge.OVERLAP_SAME:n.start.equalTo(o.end)&&n.end.equalTo(o.start)&&(t=Ge.OVERLAP_OPPOSITE):(n instanceof Ge.Arc&&o instanceof Ge.Arc||n instanceof Ge.Segment&&o instanceof Ge.Arc||n instanceof Ge.Arc&&o instanceof Ge.Segment)&&(n.start.equalTo(o.start)&&n.end.equalTo(o.end)&&n.middle().equalTo(o.middle())?t=Ge.OVERLAP_SAME:n.start.equalTo(o.end)&&n.end.equalTo(o.start)&&n.middle().equalTo(o.middle())&&(t=Ge.OVERLAP_OPPOSITE)),this.overlap===void 0&&(this.overlap=t),e.overlap===void 0&&(e.overlap=t)}svg(){if(this.shape instanceof Ge.Segment)return` L${this.shape.end.x},${this.shape.end.y}`;if(this.shape instanceof Ge.Arc){let e,t=this.shape,n=t.counterClockwise?"1":"0";if(Ge.Utils.EQ(t.sweep,2*Math.PI)){let o=t.counterClockwise?1:-1,r=new Ge.Arc(t.pc,t.r,t.startAngle,t.startAngle+o*Math.PI,t.counterClockwise),i=new Ge.Arc(t.pc,t.r,t.startAngle+o*Math.PI,t.endAngle,t.counterClockwise);return e="0",` A${r.r},${r.r} 0 ${e},${n} ${r.end.x},${r.end.y}
                    A${i.r},${i.r} 0 ${e},${n} ${i.end.x},${i.end.y}`}return e=t.sweep<=Math.PI?"0":"1",` A${t.r},${t.r} 0 ${e},${n} ${t.end.x},${t.end.y}`}}toJSON(){return this.shape.toJSON()}};var KAr=class extends oqe{constructor(e,t){super(e,t),this.setCircularLinks()}setCircularLinks(){this.isEmpty()||(this.last.next=this.first,this.first.prev=this.last)}[Symbol.iterator](){let e;return{next:()=>{let t=e||this.first,n=!this.first||!!e&&e===this.first;return e=t?t.next:void 0,{value:t,done:n}}}}append(e){return super.append(e),this.setCircularLinks(),this}insert(e,t){return super.insert(e,t),this.setCircularLinks(),this}remove(e){return super.remove(e),this}};Ge.Face=class e extends KAr{constructor(t,...n){if(super(),this._box=void 0,this._orientation=void 0,n.length!==0){if(n.length===1){if(n[0]instanceof Array){let o=n[0];if(o.length===0)return;if(o.every((r)=>r instanceof Ge.Point)){let r=e.points2segments(o);this.shapes2face(t.edges,r)}else if(o.every((r)=>r instanceof Array&&r.length===2)){let r=o.map((s)=>new Ge.Point(s[0],s[1])),i=e.points2segments(r);this.shapes2face(t.edges,i)}else if(o.every((r)=>r instanceof Ge.Segment||r instanceof Ge.Arc))this.shapes2face(t.edges,o);else if(o.every((r)=>r.name==="segment"||r.name==="arc")){let r=[];for(let i of o){let s;s=i.name==="segment"?new Ge.Segment(i):new Ge.Arc(i),r.push(s)}this.shapes2face(t.edges,r)}}else if(n[0]instanceof e){let o=n[0];this.first=o.first,this.last=o.last;for(let r of o)t.edges.add(r)}else if(n[0]instanceof Ge.Circle)this.shapes2face(t.edges,[n[0].toArc(tqt)]);else if(n[0]instanceof Ge.Box){let o=n[0];this.shapes2face(t.edges,[new Ge.Segment(new Ge.Point(o.xmin,o.ymin),new Ge.Point(o.xmax,o.ymin)),new Ge.Segment(new Ge.Point(o.xmax,o.ymin),new Ge.Point(o.xmax,o.ymax)),new Ge.Segment(new Ge.Point(o.xmax,o.ymax),new Ge.Point(o.xmin,o.ymax)),new Ge.Segment(new Ge.Point(o.xmin,o.ymax),new Ge.Point(o.xmin,o.ymin))])}}n.length===2&&n[0]instanceof Ge.Edge&&n[1]instanceof Ge.Edge&&(this.first=n[0],this.last=n[1],this.last.next=this.first,this.first.prev=this.last,this.setArcLength())}}get edges(){return this.toArray()}get vertices(){return this.edges.map((t)=>t.shape.start.clone())}get shapes(){return this.edges.map((t)=>t.shape.clone())}get box(){if(this._box===void 0){let t=new Ge.Box;for(let n of this)t=t.merge(n.box);this._box=t}return this._box}get perimeter(){return this.last.arc_length+this.last.length}pointAtLength(t){if(t>this.perimeter||t<0)return null;let n=null;for(let o of this)if(t>=o.arc_length&&(o===this.last||t<o.next.arc_length)){n=o.pointAtLength(t-o.arc_length);break}return n}static points2segments(t){let n=[];for(let o=0;o<t.length;o++)t[o].equalTo(t[(o+1)%t.length])||n.push(new Ge.Segment(t[o],t[(o+1)%t.length]));return n}shapes2face(t,n){for(let o of n){let r=new Ge.Edge(o);this.append(r),t.add(r)}}append(t){return super.append(t),this.setOneEdgeArcLength(t),t.face=this,this}insert(t,n){return super.insert(t,n),this.setOneEdgeArcLength(t),t.face=this,this}remove(t){return super.remove(t),this.setArcLength(),this}merge_with_next_edge(t){return t.shape.end.x=t.next.shape.end.x,t.shape.end.y=t.next.shape.end.y,this.remove(t.next),this}reverse(){let t=[],n=this.last;do n.shape=n.shape.reverse(),t.push(n),n=n.prev;while(n!==this.last);this.first=void 0,this.last=void 0;for(let o of t)this.first===void 0?(o.prev=o,o.next=o,this.first=o,this.last=o):(o.prev=this.last,this.last.next=o,this.last=o,this.last.next=this.first,this.first.prev=this.last),this.setOneEdgeArcLength(o);this._orientation!==void 0&&(this._orientation=void 0,this._orientation=this.orientation())}setArcLength(){for(let t of this)this.setOneEdgeArcLength(t),t.face=this}setOneEdgeArcLength(t){t===this.first?t.arc_length=0:t.arc_length=t.prev.arc_length+t.prev.length}area(){return Math.abs(this.signedArea())}signedArea(){let t=0,n=this.box.ymin;for(let o of this)t+=o.shape.definiteIntegral(n);return t}orientation(){if(this._orientation===void 0){let t=this.signedArea();Ge.Utils.EQ_0(t)?this._orientation=D$.NOT_ORIENTABLE:Ge.Utils.LT(t,0)?this._orientation=D$.CCW:this._orientation=D$.CW}return this._orientation}isSimple(t){return e.getSelfIntersections(this,t,!0).length===0}static getSelfIntersections(t,n,o=!1){let r=[];for(let i of t){let s=n.search(i.box);for(let a of s){if(i===a)continue;if(a.face!==t)continue;if(i.shape instanceof Ge.Segment&&a.shape instanceof Ge.Segment&&(i.next===a||i.prev===a))continue;let c=i.shape.intersect(a.shape);for(let l of c)if((!l.equalTo(i.start)||!l.equalTo(a.end)||a!==i.prev)&&(!l.equalTo(i.end)||!l.equalTo(a.start)||a!==i.next)&&(r.push(l),o))break;if(r.length>0&&o)break}if(r.length>0&&o)break}return r}findEdgeByPoint(t){let n;for(let o of this)if(!t.equalTo(o.shape.start)&&(t.equalTo(o.shape.end)||o.shape.contains(t))){n=o;break}return n}toPolygon(){return new Ge.Polygon(this.shapes)}toJSON(){return this.edges.map((t)=>t.toJSON())}svg(){let t=`M${this.first.start.x},${this.first.start.y}`;for(let n of this)t+=n.svg();return t+=" z",t}};Ge.Ray=class e extends EQ{constructor(...t){if(super(),this.pt=new Ge.Point,this.norm=new Ge.Vector(0,1),t.length!==0&&(t.length>=1&&t[0]instanceof Ge.Point&&(this.pt=t[0].clone()),t.length!==1)){if(!(t.length===2&&t[1]instanceof Ge.Vector))throw Fu.ILLEGAL_PARAMETERS;this.norm=t[1].clone()}}clone(){return new e(this.pt,this.norm)}get slope(){return new Ge.Vector(this.norm.y,-this.norm.x).slope}get box(){let t=this.slope;return new Ge.Box(t>Math.PI/2&&t<3*Math.PI/2?Number.NEGATIVE_INFINITY:this.pt.x,t>=0&&t<=Math.PI?this.pt.y:Number.NEGATIVE_INFINITY,t>=Math.PI/2&&t<=3*Math.PI/2?this.pt.x:Number.POSITIVE_INFINITY,t>=Math.PI&&t<=2*Math.PI||t===0?this.pt.y:Number.POSITIVE_INFINITY)}get start(){return this.pt}get end(){}get length(){return Number.POSITIVE_INFINITY}contains(t){if(this.pt.equalTo(t))return!0;let n=new Ge.Vector(this.pt,t);return Ge.Utils.EQ_0(this.norm.dot(n))&&Ge.Utils.GE(n.cross(this.norm),0)}coord(t){return vqt(t.x,t.y).cross(this.norm)}split(t){return this.contains(t)?this.pt.equalTo(t)?[this]:[new Ge.Segment(this.pt,t),new Ge.Ray(t,this.norm)]:[]}intersect(t){return t instanceof Ge.Point?this.contains(t)?[t]:[]:t instanceof Ge.Segment?aqe(this,t):t instanceof Ge.Arc?cqe(this,t):t instanceof Ge.Line?_qt(this,t):t instanceof Ge.Ray?(o=t,Tq(sQ(n=this),sQ(o)).filter((s)=>n.contains(s)).filter((s)=>o.contains(s))):t instanceof Ge.Circle?mqt(this,t):t instanceof Ge.Box?(i=t,tq(sQ(r=this),i).filter((s)=>r.contains(s))):t instanceof Ge.Polygon?gqt(this,t):t instanceof Ge.Multiline?Dq(this,t):void 0;var n,o,r,i}rotate(t,n=new Ge.Point){return new Ge.Ray(this.pt.rotate(t,n),this.norm.rotate(t))}transform(t){return new Ge.Ray(this.pt.transform(t),this.norm.clone())}get name(){return"ray"}svg(t,n={}){let o=tq(new Ge.Line(this.pt,this.norm),t);return o=o.filter((r)=>this.contains(r)),o.length===0||o.length===2?"":new Ge.Segment(this.pt,o[0]).svg(n)}};Ge.ray=(...e)=>new Ge.Ray(...e);var xb=class e{constructor(){this.faces=new Ge.PlanarSet,this.edges=new Ge.PlanarSet;let t=[...arguments];if(t.length===1&&(t[0]instanceof Array&&t[0].length>0||t[0]instanceof Ge.Circle||t[0]instanceof Ge.Box)){let n=t[0];if(t[0]instanceof Array&&t[0].every((o)=>o instanceof Array))if(n.every((o)=>o instanceof Array&&o.length===2&&typeof o[0]=="number"&&typeof o[1]=="number"))this.faces.add(new Ge.Face(this,n));else for(let o of n)if(o instanceof Array&&o[0]instanceof Array&&o[0].every((r)=>r instanceof Array&&r.length===2&&typeof r[0]=="number"&&typeof r[1]=="number"))for(let r of o)this.faces.add(new Ge.Face(this,r));else this.faces.add(new Ge.Face(this,o));else this.faces.add(new Ge.Face(this,n))}}get box(){return[...this.faces].reduce((t,n)=>t.merge(n.box),new Ge.Box)}get vertices(){return[...this.faces].flatMap((t)=>t.vertices)}clone(){let t=new e;for(let n of this.faces)t.addFace(n.shapes);return t}createFromArray(t){let n=new e;return t.forEach((o)=>[...o.faces].forEach((r)=>n.addFace(r.shapes))),n}isEmpty(){return this.edges.size===0||this.faces.size===0}isValid(){let t=!0;for(let n of this.faces)if(!n.isSimple(this.edges)){t=!1;break}return t}area(){let t=[...this.faces].reduce((n,o)=>n+o.signedArea(),0);return Math.abs(t)}addFace(...t){let n=new Ge.Face(this,...t);return this.faces.add(n),n}deleteFace(t){for(let n of t)this.edges.delete(n);return this.faces.delete(t)}recreateFaces(){this.faces.clear();for(let o of this.edges)o.face=null;let t,n=!0;for(;n;){n=!1;for(let o of this.edges)if(o.face===null){t=o,n=!0;break}if(n){let o=t;do o=o.next;while(o.next!==t);this.addFace(t,o)}}}removeChain(t,n,o){if(o.next!==n){for(let r=n;r!==o.next;r=r.next)if(t.remove(r),this.edges.delete(r),t.isEmpty()){this.deleteFace(t);break}}else this.deleteFace(t)}addVertex(t,n){let o=n.shape.split(t);if(o[0]===null)return n.prev;if(o[1]===null)return n;let r=new Ge.Edge(o[0]),i=n.prev;return n.face.insert(r,i),this.edges.delete(n),this.edges.add(r),n.shape=o[1],this.edges.add(n),r}removeEndVertex(t){let n=t.next;n!==t&&(t.face.merge_with_next_edge(t),this.edges.delete(n))}cut(t){let n=this.splitToIslands().flatMap((o)=>o._cutSingleIsland(t)).filter((o)=>o.isValid()&&o.isEmpty()===!1);return this.createFromArray(n)}_cutSingleIsland(t){let n=this.clone(),o=t.clone(),r,i,s={int_points1:[],int_points2:[],int_points1_sorted:[],int_points2_sorted:[]};for(let a of o.edges)for(let c of n.edges){let l=uqt(a,c);for(let h of l)oq(a,h,s.int_points1),oq(c,h,s.int_points2)}if(s.int_points1.length===0)return n;s.int_points1_sorted=XR(s.int_points1),s.int_points2_sorted=XR(s.int_points2),iq(o,s.int_points1_sorted),iq(n,s.int_points2_sorted),lqe(s),s.int_points1_sorted=XR(s.int_points1),s.int_points2_sorted=XR(s.int_points2),Cje(s.int_points1),bje(s.int_points1,n);for(let a of s.int_points1_sorted)a.edge_before&&a.edge_after&&a.edge_before.bv===a.edge_after.bv&&(s.int_points2[a.id]=-1,a.id=-1);if(s.int_points1=s.int_points1.filter((a)=>a.id>=0),s.int_points2=s.int_points2.filter((a)=>a.id>=0),s.int_points1.forEach((a,c)=>{a.id=c}),s.int_points2.forEach((a,c)=>{a.id=c}),s.int_points1.length===0)return n;s.int_points1_sorted=XR(s.int_points1),s.int_points2_sorted=XR(s.int_points2);for(let a=1;a<s.int_points1_sorted.length;a++)if(i=s.int_points1_sorted[a],r=s.int_points1_sorted[a-1],i.edge_before&&i.edge_before.bv===1){let c=r.edge_after,l=i.edge_before,h=o.getChain(c,l);hzt(s.int_points2[r.id],s.int_points2[i.id],h),h.forEach((d)=>n.edges.add(d)),h=h.reverse().map((d)=>new Ge.Edge(d.shape.reverse()));for(let d=0;d<h.length-1;d++)h[d].next=h[d+1],h[d+1].prev=h[d];hzt(s.int_points2[i.id],s.int_points2[r.id],h),h.forEach((d)=>n.edges.add(d))}return n.recreateFaces(),n}cutWithLine(t){let n=new GO([t]);return this.cut(n)}findEdgeByPoint(t){let n;for(let o of this.faces)if(n=o.findEdgeByPoint(t),n!==void 0)break;return n}splitToIslands(){if(this.isEmpty())return[];let t=this.toArray();t.sort((r,i)=>i.area()-r.area());let n=[...t[0].faces][0].orientation(),o=t.filter((r)=>[...r.faces][0].orientation()===n);for(let r of t){let i=[...r.faces][0];if(i.orientation()!==n){for(let s of o)if(i.shapes.every((a)=>s.contains(a))){s.addFace(i.shapes);break}}}return o}rearrange(){if(this.faces.size<=1)return this.clone();let t=this.splitToIslands(),n=new e;return t.forEach((o)=>{o.faces.forEach((r)=>n.addFace(r.shapes))}),n}orientation(){return this.isEmpty()?D$.NOT_ORIENTABLE:[...this.faces][0].orientation()}isOuter(t){return t.orientation()===this.orientation()}isMultiPolygon(){let t=0;return this.faces.forEach((n)=>{this.isOuter(n)&&t++}),t>1}reverse(){for(let t of this.faces)t.reverse();return this}contains(t){if(t instanceof Ge.Point){let n=gce(this,t);return n===1||n===2}return Iqt(this,t)}distanceTo(t){if(t instanceof Ge.Point){let[n,o]=Ge.Distance.point2polygon(t,this);return o=o.reverse(),[n,o]}if(t instanceof Ge.Circle||t instanceof Ge.Line||t instanceof Ge.Segment||t instanceof Ge.Arc){let[n,o]=Ge.Distance.shape2polygon(t,this);return o=o.reverse(),[n,o]}if(t instanceof Ge.Box)return this.distanceTo(new Ge.Polygon(t));if(t instanceof Ge.Polygon){let n,o,r=[Number.POSITIVE_INFINITY,new Ge.Segment];for(let i of this.edges){let s=r[0];[n,o]=Ge.Distance.shape2planarSet(i.shape,t.edges,s),Ge.Utils.LT(n,s)&&(r=[n,o])}return r}}intersect(t){return t instanceof Ge.Point?this.contains(t)?[t]:[]:t instanceof Ge.Line?wle(t,this):t instanceof Ge.Ray?gqt(t,this):t instanceof Ge.Circle?dqt(t,this):t instanceof Ge.Segment?iqe(t,this):t instanceof Ge.Arc?sqe(t,this):t instanceof Ge.Polygon?function(n,o){let r=[];if(n.isEmpty()||o.isEmpty())return r;if(n.box.not_intersect(o.box))return r;for(let i of n.edges)r=[...r,...lzt(i,o)];return r}(t,this):t instanceof Ge.Multiline?function(n,o){let r=[];if(o.isEmpty()||n.size===0)return r;for(let i of n)r=[...r,...lzt(i,o)];return r}(t,this):void 0}translate(t){let n=new e;for(let o of this.faces)n.addFace(o.shapes.map((r)=>r.translate(t)));return n}rotate(t=0,n=new Ge.Point){let o=new e;for(let r of this.faces)o.addFace(r.shapes.map((i)=>i.rotate(t,n)));return o}scale(t,n){let o=new e;for(let r of this.faces)o.addFace(r.shapes.map((i)=>i.scale(t,n)));return o}transform(t=new Ge.Matrix){let n=new e;for(let o of this.faces)n.addFace(o.shapes.map((r)=>r.transform(t)));return n}toJSON(){return[...this.faces].map((t)=>t.toJSON())}toArray(){return[...this.faces].map((t)=>t.toPolygon())}dpath(){return[...this.faces].reduce((t,n)=>t+n.svg(),"")}svg(t={}){let n=`
<path ${CV({fillRule:"evenodd",fill:"lightcyan",...t})} d="`;for(let o of this.faces)n+=`
${o.svg()}`;return n+=`" >
</path>`,n}};Ge.Polygon=xb;Ge.polygon=(...e)=>new Ge.Polygon(...e);var{Circle:dWe,Line:xzt,Point:Czt,Vector:G4e,Utils:uWe}=Ge;Ge.Inversion=class e{constructor(t){this.circle=t}get inversion_circle(){return this.circle}static inversePoint(t,n){let o=new G4e(t.pc,n),r=t.r*t.r,i=o.dot(o);return uWe.EQ_0(i)?new Czt(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY):t.pc.translate(o.multiply(r/i))}static inverseCircle(t,n){let o=t.pc.distanceTo(n.pc)[0];if(uWe.EQ(o,n.r)){let r=t.r*t.r/(2*n.r),i=new G4e(t.pc,n.pc);i=i.normalize();let s=t.pc.translate(i.multiply(r));return new xzt(s,i)}{let r=new G4e(t.pc,n.pc),i=t.r*t.r/(r.dot(r)-n.r*n.r),s=t.pc.translate(r.multiply(i)),a=Math.abs(i)*n.r;return new dWe(s,a)}}static inverseLine(t,n){let[o,r]=t.pc.distanceTo(n);if(uWe.EQ_0(o))return n.clone();{let i=t.r*t.r/(2*o),s=new G4e(t.pc,r.end);return s=s.multiply(i/o),new dWe(t.pc.translate(s),i)}}inverse(t){return t instanceof Czt?e.inversePoint(this.circle,t):t instanceof dWe?e.inverseCircle(this.circle,t):t instanceof xzt?e.inverseLine(this.circle,t):void 0}};Ge.inversion=(e)=>new Ge.Inversion(e);Ge.Distance=class e{static point2point(t,n){return t.distanceTo(n)}static point2line(t,n){let o=t.projectionOn(n);return[new Ge.Vector(t,o).length,new Ge.Segment(t,o)]}static point2circle(t,n){let[o,r]=t.distanceTo(n.center);if(Ge.Utils.EQ_0(o))return[n.r,new Ge.Segment(t,n.toArc().start)];{let i=Math.abs(o-n.r),s=new Ge.Vector(n.pc,t).normalize().multiply(n.r),a=n.pc.translate(s);return[i,new Ge.Segment(t,a)]}}static point2segment(t,n){if(n.start.equalTo(n.end))return e.point2point(t,n.start);let o,r,i=new Ge.Vector(n.start,n.end),s=new Ge.Vector(n.start,t),a=new Ge.Vector(n.end,t),c=i.dot(s),l=-i.dot(a);if(Ge.Utils.GE(c,0)&&Ge.Utils.GE(l,0)){let h=n.tangentInStart();return o=Math.abs(h.cross(s)),r=n.start.translate(h.multiply(h.dot(s))),[o,new Ge.Segment(t,r)]}return c<0?t.distanceTo(n.start):t.distanceTo(n.end)}static point2arc(t,n){let o,r,i=new Ge.Circle(n.pc,n.r),s=[];return[o,r]=e.point2circle(t,i),r.end.on(n)&&s.push(e.point2circle(t,i)),s.push(e.point2point(t,n.start)),s.push(e.point2point(t,n.end)),e.sort(s),s[0]}static point2edge(t,n){return n.shape instanceof Ge.Segment?e.point2segment(t,n.shape):e.point2arc(t,n.shape)}static segment2line(t,n){let o=t.intersect(n);if(o.length>0)return[0,new Ge.Segment(o[0],o[0])];let r=[];return r.push(e.point2line(t.start,n)),r.push(e.point2line(t.end,n)),e.sort(r),r[0]}static segment2segment(t,n){let o=QCe(t,n);if(o.length>0)return[0,new Ge.Segment(o[0],o[0])];let r,i,s=[];return[r,i]=e.point2segment(n.start,t),s.push([r,i.reverse()]),[r,i]=e.point2segment(n.end,t),s.push([r,i.reverse()]),s.push(e.point2segment(t.start,n)),s.push(e.point2segment(t.end,n)),e.sort(s),s[0]}static segment2circle(t,n){let o=t.intersect(n);if(o.length>0)return[0,new Ge.Segment(o[0],o[0])];let r=new Ge.Line(t.ps,t.pe),[i,s]=e.point2line(n.center,r);if(Ge.Utils.GE(i,n.r)&&s.end.on(t))return e.point2circle(s.end,n);{let[a,c]=e.point2circle(t.start,n),[l,h]=e.point2circle(t.end,n);return Ge.Utils.LT(a,l)?[a,c]:[l,h]}}static segment2arc(t,n){let o=t.intersect(n);if(o.length>0)return[0,new Ge.Segment(o[0],o[0])];let r=new Ge.Line(t.ps,t.pe),i=new Ge.Circle(n.pc,n.r),[s,a]=e.point2line(i.center,r);if(Ge.Utils.GE(s,i.r)&&a.end.on(t)){let[d,u]=e.point2circle(a.end,i);if(u.end.on(n))return[d,u]}let c,l,h=[];return h.push(e.point2arc(t.start,n)),h.push(e.point2arc(t.end,n)),[c,l]=e.point2segment(n.start,t),h.push([c,l.reverse()]),[c,l]=e.point2segment(n.end,t),h.push([c,l.reverse()]),e.sort(h),h[0]}static circle2circle(t,n){let o=t.intersect(n);if(o.length>0)return[0,new Ge.Segment(o[0],o[0])];if(t.center.equalTo(n.center)){let r=t.toArc(),i=n.toArc();return e.point2point(r.start,i.start)}{let r=new Ge.Line(t.center,n.center),i=r.intersect(t),s=r.intersect(n),a=[];return a.push(e.point2point(i[0],s[0])),a.push(e.point2point(i[0],s[1])),a.push(e.point2point(i[1],s[0])),a.push(e.point2point(i[1],s[1])),e.sort(a),a[0]}}static circle2line(t,n){let o=t.intersect(n);if(o.length>0)return[0,new Ge.Segment(o[0],o[0])];let[r,i]=e.point2line(t.center,n),[s,a]=e.point2circle(i.end,t);return a=a.reverse(),[s,a]}static arc2line(t,n){let o=n.intersect(t);if(o.length>0)return[0,new Ge.Segment(o[0],o[0])];let r=new Ge.Circle(t.center,t.r),[i,s]=e.point2line(r.center,n);if(!Ge.Utils.GE(i,r.r)){let a=[];return a.push(e.point2line(t.start,n)),a.push(e.point2line(t.end,n)),e.sort(a),a[0]}{let[a,c]=e.point2circle(s.end,r);if(c.end.on(t))return[a,c]}}static arc2circle(t,n){let o=t.intersect(n);if(o.length>0)return[0,new Ge.Segment(o[0],o[0])];let r=new Ge.Circle(t.center,t.r),[i,s]=e.circle2circle(r,n);if(s.start.on(t))return[i,s];{let a=[];return a.push(e.point2circle(t.start,n)),a.push(e.point2circle(t.end,n)),e.sort(a),a[0]}}static arc2arc(t,n){let o=t.intersect(n);if(o.length>0)return[0,new Ge.Segment(o[0],o[0])];let r=new Ge.Circle(t.center,t.r),i=new Ge.Circle(n.center,n.r),[s,a]=e.circle2circle(r,i);if(a.start.on(t)&&a.end.on(n))return[s,a];{let c,l,h=[];return[c,l]=e.point2arc(t.start,n),l.end.on(n)&&h.push([c,l]),[c,l]=e.point2arc(t.end,n),l.end.on(n)&&h.push([c,l]),[c,l]=e.point2arc(n.start,t),l.end.on(t)&&h.push([c,l.reverse()]),[c,l]=e.point2arc(n.end,t),l.end.on(t)&&h.push([c,l.reverse()]),[c,l]=e.point2point(t.start,n.start),h.push([c,l]),[c,l]=e.point2point(t.start,n.end),h.push([c,l]),[c,l]=e.point2point(t.end,n.start),h.push([c,l]),[c,l]=e.point2point(t.end,n.end),h.push([c,l]),e.sort(h),h[0]}}static point2polygon(t,n){let o=[Number.POSITIVE_INFINITY,new Ge.Segment];for(let r of n.edges){let[i,s]=e.point2edge(t,r);Ge.Utils.LT(i,o[0])&&(o=[i,s])}return o}static shape2polygon(t,n){let o=[Number.POSITIVE_INFINITY,new Ge.Segment];for(let r of n.edges){let[i,s]=t.distanceTo(r.shape);Ge.Utils.LT(i,o[0])&&(o=[i,s])}return o}static polygon2polygon(t,n){let o=[Number.POSITIVE_INFINITY,new Ge.Segment];for(let r of t.edges)for(let i of n.edges){let[s,a]=r.shape.distanceTo(i.shape);Ge.Utils.LT(s,o[0])&&(o=[s,a])}return o}static box2box_minmax(t,n){let o=Math.max(Math.max(t.xmin-n.xmax,0),Math.max(n.xmin-t.xmax,0)),r=Math.max(Math.max(t.ymin-n.ymax,0),Math.max(n.ymin-t.ymax,0)),i=o*o+r*r,s=t.merge(n),a=s.xmax-s.xmin,c=s.ymax-s.ymin;return[i,a*a+c*c]}static minmax_tree_process_level(t,n,o,r){let i,s;for(let c of n){[i,s]=e.box2box_minmax(t.box,c.item.key);for(let l of c.item.values)l instanceof Ge.Edge?r.insert([i,s],l.shape):r.insert([i,s],l);Ge.Utils.LT(s,o)&&(o=s)}if(n.length===0)return o;let a=[...n.map((c)=>c.left.isNil()?void 0:c.left).filter((c)=>c!==void 0),...n.map((c)=>c.right.isNil()?void 0:c.right).filter((c)=>c!==void 0)].filter((c)=>{let[l,h]=e.box2box_minmax(t.box,c.max);return Ge.Utils.LE(l,o)});return o=e.minmax_tree_process_level(t,a,o,r)}static minmax_tree(t,n,o){let r=new wje,i=[n.index.root],s=o<Number.POSITIVE_INFINITY?o*o:Number.POSITIVE_INFINITY;return s=e.minmax_tree_process_level(t,i,s,r),r}static minmax_tree_calc_distance(t,n,o){let r,i;if(n!=null&&!n.isNil()){if([r,i]=e.minmax_tree_calc_distance(t,n.left,o),i)return[r,i];if(Ge.Utils.LT(r[0],Math.sqrt(n.item.key.low)))return[r,!0];let[s,a]=e.distanceToArray(t,n.item.values);return Ge.Utils.LT(s,r[0])&&(r=[s,a]),[r,i]=e.minmax_tree_calc_distance(t,n.right,r),[r,i]}return[o,!1]}static shape2planarSet(t,n,o=Number.POSITIVE_INFINITY){let r=[o,new Ge.Segment],i=!1;if(n instanceof Ge.PlanarSet){let s=e.minmax_tree(t,n,o);[r,i]=e.minmax_tree_calc_distance(t,s.root,r)}return r}static sort(t){t.sort((n,o)=>Ge.Utils.LT(n[0],o[0])?-1:Ge.Utils.GT(n[0],o[0])?1:0)}static distance(t,n){return t.distanceTo(n)}static distanceToArray(t,n){let o=[Number.POSITIVE_INFINITY,new Ge.Segment];for(let r of n){let[i,s]=t.distanceTo(r);Ge.Utils.LT(i,o[0])&&(o=[i,s])}return o}static shape2multiline(t,n){let o=[Number.POSITIVE_INFINITY,new Ge.Segment];for(let r of n){let[i,s]=e.distance(t,r.shape);Ge.Utils.LT(i,o[0])&&(o=[i,s])}return o}static multiline2multiline(t,n){let o=[Number.POSITIVE_INFINITY,new Ge.Segment];for(let r of t)for(let i of n){let[s,a]=e.distance(r.shape,i.shape);Ge.Utils.LT(s,o[0])&&(o=[s,a])}return o}};var{Multiline:$Ar,Point:Sqt,Segment:qAr,Polygon:Pqt}=Ge;function Bje(e){return new Sqt(e.split(" ").map(Number))}function Eqt(e){return e.split(", ").map(Bje)}function pWe(e){let t=Eqt(e),n=[];for(let o=0;o<t.length-1;o++)n.push(new qAr(t[o],t[o+1]));return new $Ar(n)}function bzt(e){let t=e.replace(/\(\(/,"").replace(/\)\)$/,"").split("), ("),n=new Pqt,o;return t.forEach((r,i)=>{let s=r.split(", ").map((c)=>new Sqt(c.split(" ").map(Number))),a=n.addFace(s);i===0?o=a.orientation():a.orientation()===o&&a.reverse()}),n}function JAr(e){if(e.startsWith("POLYGON"))return bzt(e.replace(/^POLYGON /,""));return function(t){let n=t.split(/\)\), \(\(/).map((r)=>"(("+r+"))").map(bzt),o=new Pqt;return n.reduce((r,i)=>[...r,...i?.faces],[]).forEach((r)=>o.addFace([...r?.shapes])),o}(e.replace(/^MULTIPOLYGON \(\(\((.*)\)\)\)$/,"$1"))}function Izt(e){return e.split(`
`)?.every((t)=>t.includes("POINT"))}function vzt(e){return e.split(`
`)?.every((t)=>t.includes("LINESTRING"))}Ge.isWktString=function(e){return e.startsWith("POINT")||Izt(e)||e.startsWith("LINESTRING")||vzt(e)||e.startsWith("MULTILINESTRING")||e.startsWith("POLYGON")||e.startsWith("MULTIPOINT")||e.startsWith("MULTIPOLYGON")||e.startsWith("GEOMETRYCOLLECTION")},Ge.parseWKT=function e(t){if(t.startsWith("POINT"))return Bje(t.replace(/^POINT \(/,"").replace(/\)$/,""));if(t.startsWith("MULTIPOINT"))return Eqt(t.replace(/^MULTIPOINT \(/,"").replace(/\)$/,""));if(t.startsWith("LINESTRING"))return pWe(t.replace(/^LINESTRING \(/,"").replace(/\)$/,""));if(t.startsWith("MULTILINESTRING"))return function(n){return n.replace(/\(\(/,"").replace(/\)\)$/,"").split("), (").map(pWe)}(t.replace(/^MULTILINESTRING /,""));if(t.startsWith("POLYGON")||t.startsWith("MULTIPOLYGON"))return JAr(t);if(t.startsWith("GEOMETRYCOLLECTION")){let n=/(?<type>POINT|LINESTRING|POLYGON|MULTIPOINT|MULTILINESTRING|MULTIPOLYGON) \((?:[^\(\)]|\([^\)]*\))*\)/g,o=t.match(n);return o[0].startsWith("GEOMETRYCOLLECTION")&&(o[0]=o[0].replace("GEOMETRYCOLLECTION (","")),o.map(e).map((r)=>r instanceof Array?r:[r]).reduce((r,i)=>[...r,...i],[])}return Izt(t)?function(n){return n.split(`
`).map((o)=>o.match(/\(([^)]+)\)/)[1]).map(Bje)}(t):vzt(t)?function(n){return n.split(`
`).map((o)=>o.match(/\(([^)]+)\)/)[1]).map(pWe).reduce((o,r)=>[...o,...r],[])}(t):[]},Ge.BooleanOperations=Mje,Ge.Relations=VAr;var Szt=[0,1,-1,2,-2,3,-3,4],MNs=(Szt.flatMap((e)=>Szt.map((t)=>[e,t])).sort(([e,t],[n,o])=>Math.abs(e)+Math.abs(t)-Math.abs(n)-Math.abs(o)).length,[0.2,0.4,0.8,1.2].flatMap((e)=>[0.2,0.3,0.45,0.6].flatMap((t)=>[-1,1].map((n)=>({halfSpan:e,offset:t,directionSign:n})))).flatMap((e)=>[0,1].map((t)=>({kind:"segment",routeSide:t,...e}))));[1,-1].flatMap((e)=>[1,-1].flatMap((t)=>[!1,!0].flatMap((n)=>[0,1].map((o)=>({routeSide:o,normalDirectionSign:e,tangentDirectionSign:t,reverseEndpointOffsets:n}))))),[0,1].map((e)=>({kind:"displacementChain",routeSide:e})),[-1,1].flatMap((e)=>[0,1].map((t)=>({kind:"segment",routeSide:t,halfSpan:0.4,offset:1.2,directionSign:e}))),[-1,1].flatMap((e)=>[0,1].map((t)=>({kind:"span",routeSide:t,spanExpansion:3,offset:1.8,directionSign:e}))),[{dx:-2.4,dy:-0.4},{dx:-2.4,dy:0.4},{dx:2.4,dy:-0.4},{dx:2.4,dy:0.4},{dx:-0.4,dy:-2.4},{dx:-0.4,dy:2.4},{dx:0.4,dy:-2.4},{dx:0.4,dy:2.4}].flatMap((e)=>[0,1].map((t)=>({kind:"waypoint",routeSide:t,spanExpansion:2,...e}))),[{dx:-0.17,dy:0},{dx:0.17,dy:0},{dx:0,dy:-0.17},{dx:0,dy:0.17}].flatMap((e)=>[0,1].map((t)=>({kind:"waypoint",routeSide:t,spanExpansion:0,...e})));function Gbe(e){if(e.isNonPlatedHole&&e.shape==="circle")return{type:"oval",a:{x:0,y:0},b:{x:0,y:0},radius:e.width/2};if(e.type==="rect")return{type:"rect",bounds:{minX:-e.width/2,maxX:e.width/2,minY:-e.height/2,maxY:e.height/2}};if(e.type!=="oval")throw Error("repair04 found an unsupported obstacle shape");let t=Math.abs(e.width-e.height)/2,n=e.width>=e.height?t:0,o=e.height>e.width?t:0;return{type:"oval",a:{x:-n,y:-o},b:{x:n,y:o},radius:Math.min(e.width,e.height)/2}}function sq(e,t,n){return n.type==="rect"?AV(e,t,n.bounds):Math.max(0,s_(e,t,n.a,n.b)-n.radius)}var Ube=(e,t)=>{let n=new Map,o=(i)=>{let s=n.get(i);if(s===void 0)return n.set(i,i),i;if(s===i)return i;let a=o(s);return n.set(i,a),a},r=(i)=>{let s=i.filter((c)=>typeof c=="string"&&c.length>0);if(s.length===0)return;let a=o(s[0]);for(let c of s)n.set(o(c),a)};for(let i of e.connections){let s=i;r([s.name,s.rootConnectionName,s.netConnectionName,s.__netConnectionName,...s.mergedConnectionNames??[],...s.__rootConnectionNames??[],...s.pointsToConnect.flatMap((a)=>[a.pointId,a.pcb_port_id])])}for(let i of e.obstacles)r(i.connectedTo);for(let i of t)r([i.connectionName,i.rootConnectionName]);for(let i of n.keys())n.set(i,o(i));return n},ZAr=(e,t)=>{let n=e.__zLayers;if(n)return new Set(n);if(e.zLayers)return new Set(e.zLayers);let o=new Set;for(let r of e.layers){let i=r==="top"?0:r==="bottom"?t-1:/^inner\d+$/.test(r)?Number(r.slice(5)):-1;if(i<0||i>=t)throw Error(`repair04 obstacle has an unknown layer: ${r}`);o.add(i)}return o},efr=({srj:e,routes:t,traceClearance:n=0.1,viaClearance:o=0.1})=>{let r,i=new Map,s=[],a=!1;return(c)=>{let l=r??=Ube(e,t),h=new Map,d=a?s:function*(u){for(let _=0;_<e.obstacles.length;_++){if(i.has(_)){let L=i.get(_);L&&(yield L);continue}let p=e.obstacles[_],m=p.connectedTo.some((L)=>/^(pcb_smtpad_|pcb_plated_hole_|pcb_port_)/.test(L)),A=Math.abs((p.ccwRotationDegrees??0)%180)>0.00000001,g=p.type==="rect"&&p.layers.length>1&&Math.abs(p.width-p.height)<0.001;if(m&&!A&&!g){i.set(_,null);continue}if(![p.center.x,p.center.y,p.width,p.height,p.ccwRotationDegrees??0].every(Number.isFinite)||p.width<0||p.height<0)throw Error("repair04 fixed obstacle geometry must be finite and nonnegative");let f=ZAr(p,e.layerCount),y=new Set(p.connectedTo.map((L)=>u.get(L)??L)),x=Gbe(p),C=(p.ccwRotationDegrees??0)*Math.PI/180,b=Math.cos(C),I=Math.sin(C),v=Math.hypot(p.width,p.height)/2,P=(L)=>{let H=L.x-p.center.x,V=L.y-p.center.y;return{x:H*b+V*I,y:-H*I+V*b}},M=(L,H,V)=>Math.max(L.x,H.x)+V<p.center.x-v||Math.min(L.x,H.x)-V>p.center.x+v||Math.max(L.y,H.y)+V<p.center.y-v||Math.min(L.y,H.y)-V>p.center.y+v,B=p.obstacleId?.startsWith("repair04_board_edge_")===!0,T=B?0:p.isNonPlatedHole&&e.minTraceToHoleEdgeClearance!==void 0?e.minTraceToHoleEdgeClearance:Math.max(n,e.defaultObstacleMargin??0,e.minTraceToPadEdgeClearance??0),N=B?0:Math.max(o,e.defaultObstacleMargin??0,e.minViaEdgeToPadEdgeClearance??0),D={obstacleIndex:_,obstacle:p,zLayers:f,obstacleNets:y,shape:x,toLocal:P,separated:M,wireGap:T,viaGap:N};i.set(_,D),s.push(D),yield D}a=!0}(l);for(let{obstacleIndex:u,obstacle:_,zLayers:p,obstacleNets:m,shape:A,toLocal:g,separated:f,wireGap:y,viaGap:x}of d)for(let C=0;C<c.length;C+=1){let b=c[C];if(!(b.route.length<2)&&![b.connectionName,b.rootConnectionName].some((I)=>I!==void 0&&m.has(l.get(I)??I)))for(let I=1;I<b.route.length;I+=1){let v=b.route[I-1],P=b.route[I];if(v.toNextSegmentType==="through_obstacle")continue;if(v.z!==P.z){let N=tV(e,v,P);if(!Array.from(p).some((O)=>O>=N.minZ&&O<=N.maxZ))continue;if(Math.abs(v.x-P.x)>0.00000001||Math.abs(v.y-P.y)>0.00000001)throw Error("repair04 found a non-colocated via transition");if(f(v,v,b.viaDiameter/2+x+0.00000001))continue;let D=g(v),L=sq(D,D,A),H=b.viaDiameter/2+x-L;if(H<=0.00000001)continue;let V=`fixed-obstacle:${C}:${u}:via`;(h.get(V)?.severity??-1/0)<H&&h.set(V,{key:V,center:{x:v.x,y:v.y},routeIndex:C,obstacleIndex:u,kind:"via",severity:H});continue}if(!p.has(v.z))continue;let M=Math.max(v.traceThickness??b.traceThickness,P.traceThickness??b.traceThickness)/2;if(f(v,P,M+y+0.00000001))continue;let B=M+y-sq(g(v),g(P),A);if(B<=0.00000001)continue;let T=`fixed-obstacle:${C}:${u}:wire`;(h.get(T)?.severity??-1/0)<B&&h.set(T,{key:T,center:mm(_.center,v,P),routeIndex:C,obstacleIndex:u,kind:"wire",severity:B})}}return Array.from(h.values())}},sV=(e)=>efr(e)(e.routes),Pzt=(e,t)=>{let n=[];for(let o=1;o<e.route.length;o++){let r=e.route[o-1],i=e.route[o];if(r.z===i.z||r.toNextSegmentType==="through_obstacle")continue;if(r.x!==i.x||r.y!==i.y||![r.x,r.y,r.z,i.z,e.viaDiameter].every(Number.isFinite)||!Number.isInteger(r.z)||!Number.isInteger(i.z)||Math.min(r.z,i.z)<0||Math.max(r.z,i.z)>=t||e.viaDiameter<=0)throw Error("repair04 new-via guard requires valid colocated vias");let s=o-1,a=[r.z,i.z],c=Math.min(r.z,i.z),l=Math.max(r.z,i.z);for(;o+1<e.route.length&&e.route[o].toNextSegmentType!=="through_obstacle";){let h=e.route[o+1];if(h.x!==i.x||h.y!==i.y)break;if(!Number.isInteger(h.z)||h.z<0||h.z>=t)throw Error("repair04 new-via guard found an invalid layer span");h.z!==a.at(-1)&&a.push(h.z),c=Math.min(c,h.z),l=Math.max(l,h.z),o++}n.push({pointIndices:Array.from({length:o-s+1},(h,d)=>s+d),layerSequence:a,x:i.x,y:i.y,minZ:c,maxZ:l,diameter:e.viaDiameter,identity:JSON.stringify([i.x,i.y,c,l,e.viaDiameter])})}return n},uqe=(e)=>(({srj:t,viaClearance:n=0.1})=>{let o=new Map,r=new Map,i=[n,t.defaultObstacleMargin??0,t.minViaEdgeToPadEdgeClearance??0],s=Math.max(...i),a=S$e(t,n,!0),c,l=[],h=(d)=>{let u=r.get(d.identity);if(u)return u;let _=[],p=tV(t,{z:d.minZ},{z:d.maxZ});for(let m=0;m<t.obstacles.length;m++){let A=t.obstacles[m],g=o.get(m);if(!g){let P=A.__zLayers??A.zLayers??A.layers.map((M)=>M==="top"?0:M==="bottom"?t.layerCount-1:/^inner\d+$/.test(M)?Number(M.slice(5)):-1);if(P.some((M)=>!Number.isInteger(M)||M<0||M>=t.layerCount))throw Error("repair04 new-via guard found an unknown obstacle layer");g={zs:P},o.set(m,g)}if(!g.zs.some((P)=>P>=p.minZ&&P<=p.maxZ))continue;if(!g.geometry){if(![A.center.x,A.center.y,A.width,A.height,A.ccwRotationDegrees??0].every(Number.isFinite)||A.width<0||A.height<0)throw Error("repair04 new-via guard found invalid obstacle geometry");let P=(A.ccwRotationDegrees??0)*Math.PI/180;g.geometry={x:A.center.x,y:A.center.y,cosine:Math.cos(P),sine:Math.sin(P),extent:Math.hypot(A.width,A.height)/2,shape:Gbe(A)}}let f=g.geometry,y=f.extent+d.diameter/2+s+0.00000001;if(Math.abs(d.x-f.x)>y||Math.abs(d.y-f.y)>y)continue;let x=d.x-f.x,C=d.y-f.y,b={x:x*f.cosine+C*f.sine,y:-x*f.sine+C*f.cosine},I=sq(b,b,f.shape),v=d.diameter/2+s-I;v<=0.00000001||_.push({obstacleIndex:m,severity:v})}return r.set(d.identity,_),_};return({previousRoutes:d,routes:u,includeExistingVias:_=[]})=>{if(d.length!==u.length)throw Error("repair04 new-via guard requires matching route ordering");if(i.some((m)=>!Number.isFinite(m)||m<0))throw Error("repair04 new-via guard requires nonnegative finite margins");let p=[];c&&l.length===u.length&&!l.some((m,A)=>m.connectionName!==u[A].connectionName||m.rootConnectionName!==u[A].rootConnectionName)||(c=Ube(t,u),l=u.map((m)=>({connectionName:m.connectionName,rootConnectionName:m.rootConnectionName})));for(let m=0;m<u.length;m++){let A=u[m],g=d[m],f=c.get(A.connectionName)??A.connectionName,y=(P)=>h(P).flatMap((M)=>{let B=t.obstacles[M.obstacleIndex].connectedTo.some((N)=>(c.get(N)??N)===f),T=M.severity-(B?s-a:0);return T>0.00000001?[{obstacleIndex:M.obstacleIndex,severity:T}]:[]}),x=Pzt(g,t.layerCount),C=A.connectionName===g.connectionName&&A.rootConnectionName===g.rootConnectionName,b=new Set(C?x.map((P)=>P.identity):[]),I=Pzt(A,t.layerCount),v=C&&A.route.length===g.route.length&&A.route.every((P,M)=>{let B=g.route[M];return(!(M===0||M===A.route.length-1||P.pcb_port_id||P.insideJumperPad||P.toNextSegmentType)||P.x===B.x&&P.y===B.y)&&P.z===B.z&&P.pcb_port_id===B.pcb_port_id&&P.toNextSegmentType===B.toNextSegmentType&&P.insideJumperPad===B.insideJumperPad})&&I.length===x.length&&new Set(I.map((P)=>P.identity)).size===I.length&&I.every((P,M)=>{let B=x[M];return P.diameter===B.diameter&&P.pointIndices.length===B.pointIndices.length&&P.pointIndices.every((T,N)=>T===B.pointIndices[N])&&P.layerSequence.length===B.layerSequence.length&&P.layerSequence.every((T,N)=>T===B.layerSequence[N])&&!x.some((T,N)=>N!==M&&T.identity===P.identity)});for(let P=0;P<I.length;P++){let M=I[P];if(b.has(M.identity)&&!_.some((T)=>T.routeIndex===m&&T.viaIndex===P))continue;let B=v&&!_.some((T)=>T.routeIndex===m&&T.viaIndex===P)?new Map(y(x[P]).map((T)=>[T.obstacleIndex,T.severity])):void 0;for(let T of y(M)){let N=B?.get(T.obstacleIndex);N!==void 0&&T.severity<=N+0.00000001||p.push({key:`new-via-pad:${m}:${T.obstacleIndex}:${P}`,routeIndex:m,obstacleIndex:T.obstacleIndex,center:{x:M.x,y:M.y},kind:"via",severity:T.severity})}}}return p}})(e)(e),Ezt=(e,t,n)=>{if(n<=pr)return structuredClone(e);if(n>=0.99999999)return structuredClone(t);let o={...structuredClone(e),x:e.x+(t.x-e.x)*n,y:e.y+(t.y-e.y)*n};return delete o.start_pcb_port_id,delete o.end_pcb_port_id,o},tfr=(e,t)=>{let n=e.end.x-e.start.x,o=e.end.y-e.start.y,r=t.end.x-t.start.x,i=t.end.y-t.start.y,s=t.start.x-e.start.x,a=t.start.y-e.start.y,c=n*i-o*r,l=(u,_)=>({x:u.start.x+(u.end.x-u.start.x)*_,y:u.start.y+(u.end.y-u.start.y)*_}),h=(u,_)=>{let p=_.end.x-_.start.x,m=_.end.y-_.start.y,A=p*p+m*m,g=A>0.00000000000000010000000000000001?Math.max(0,Math.min(1,((u.x-_.start.x)*p+(u.y-_.start.y)*m)/A)):0;return l(_,g)};if(Math.abs(c)>pr){let u=(s*i-a*r)/c,_=(s*o-a*n)/c;if(u>=0&&u<=1&&_>=0&&_<=1){let p=l(e,u);return[p,p]}}else{let u=n*n+o*o;if(u>0.00000000000000010000000000000001){let _=(s*n+a*o)/u,p=((t.end.x-e.start.x)*n+(t.end.y-e.start.y)*o)/u,m=Math.max(0,Math.min(_,p)),A=Math.min(1,Math.max(_,p));if(m<=A){let g=l(e,(m+A)/2);return[g,h(g,t)]}}}let d=[[e.start,h(e.start,t)],[e.end,h(e.end,t)],[h(t.start,e),t.start],[h(t.end,e),t.end]];return d.sort((u,_)=>Math.hypot(u[0].x-u[1].x,u[0].y-u[1].y)-Math.hypot(_[0].x-_[1].x,_[0].y-_[1].y)),d[0]},U4e=(e,t)=>{let n=e==="top"?0:e==="bottom"?t-1:/^inner\d+$/.test(e)?Number(e.slice(5)):-1;if(!Number.isInteger(n)||n<0||n>=t)throw Error(`repair04 preload has an unknown layer: ${e}`);return n},Mqt=(e,t,n)=>{let o=((A,g)=>{let f=new Map,y=(C)=>{let b=f.get(C);if(b===void 0||b===C)return C;let I=y(b);return f.set(C,I),I},x=(C)=>{let b=C.filter((v)=>typeof v=="string"&&v.length>0);if(b.length===0)return;let I=y(b[0]);for(let v of b)f.set(y(v),I)};for(let C of A.connections){let b=C;x([b.name,b.rootConnectionName,b.netConnectionName,b.__netConnectionName,...b.mergedConnectionNames??[],...b.__rootConnectionNames??[]])}for(let C of g)x([C.connectionName,C.rootConnectionName]);for(let C of A.traces??[])x([C.connection_name,...C.connectsTo??[]]);return y})(e,t),r=t.map((A,g)=>g),i=(A)=>{let g=r[A];if(g===A)return A;let f=i(g);return r[A]=f,f},s=new Map,a=new Map;for(let A=0;A<e.obstacles.length;A+=1)for(let g of e.obstacles[A].connectedTo){let f=a.get(g)??[];f.push(A),a.set(g,f)}for(let A=0;A<t.length;A+=1){let g=t[A];for(let f of[g.route[0],g.route.at(-1)]){if(!f)continue;let y=o(g.connectionName),x=[JSON.stringify([y,"point",f.x,f.y,f.z])],C=f.pcb_port_id?a.get(f.pcb_port_id)??[]:[];for(let b of C){let I=e.obstacles[b];if(!(I.zLayers??I.layers.map((T)=>U4e(T,e.layerCount))).includes(f.z))continue;let v=(I.ccwRotationDegrees??0)*Math.PI/180,P=f.x-I.center.x,M=f.y-I.center.y,B={x:P*Math.cos(v)+M*Math.sin(v),y:-P*Math.sin(v)+M*Math.cos(v)};sq(B,B,Gbe(I))>pr||x.push(JSON.stringify([y,"pad",b]))}for(let b of x){let I=s.get(b);I===void 0?s.set(b,A):r[i(A)]=i(I)}}}let c=(A,g)=>!(!A.startsWith("route:")||!g.startsWith("route:"))&&i(Number(A.slice(6)))===i(Number(g.slice(6))),l=[],h=[],d=[],u=t.map(()=>({segmentTimes:new Map,viaPositions:[]})),_=(A)=>{if(sy(A,n)){d.push(A);for(let g=A.minZ;g<=A.maxZ;g+=1)l.push({x:A.x,y:A.y,z:g,radius:A.radius,net:A.net,source:A.source,...A.routeIndex!==void 0?{viaOwner:A.routeIndex}:{}})}};for(let A=0;A<t.length;A+=1){let g=t[A],f=o(g.connectionName),y=`route:${A}`;for(let x=0;x<g.route.length;x+=1){let C=g.route[x];if((x===0||x===g.route.length-1||C.pcb_port_id)&&sy(C,n)&&l.push({x:C.x,y:C.y,z:C.z,radius:(C.traceThickness??g.traceThickness)/2,net:f,source:y}),x===0)continue;let b=g.route[x-1];b.toNextSegmentType!=="through_obstacle"&&(b.z===C.z?h.push({start:b,end:C,z:C.z,radius:Math.max(b.traceThickness??g.traceThickness,C.traceThickness??g.traceThickness)/2,net:f,source:y,routeIndex:A,segmentIndex:x-1}):_({x:C.x,y:C.y,minZ:Math.min(b.z,C.z),maxZ:Math.max(b.z,C.z),radius:g.viaDiameter/2,net:f,source:y,routeIndex:A}))}}for(let A=0;A<(e.traces??[]).length;A+=1){let g=v$e(e.traces[A],e.minTraceWidth),f=o(g.connection_name),y=`fixed:${A}`;for(let x=0;x<g.route.length;x+=1){let C=g.route[x],b=g.route[x-1];if(C.route_type==="wire"){let I=U4e(C.layer,e.layerCount);(x===0||x===g.route.length-1||C.start_pcb_port_id||C.end_pcb_port_id)&&sy(C,n)&&l.push({x:C.x,y:C.y,z:I,radius:C.width/2,net:f,source:y}),b?.route_type==="wire"&&b.layer===C.layer&&h.push({start:b,end:C,z:I,radius:Math.max(b.width,C.width)/2,net:f,source:y})}else if(C.route_type==="via"){let I=U4e(C.from_layer,e.layerCount),v=U4e(C.to_layer,e.layerCount);_({x:C.x,y:C.y,minZ:Math.min(I,v),maxZ:Math.max(I,v),radius:(C.via_diameter??e.minViaDiameter??0.3)/2,net:f,source:y})}}}let p=new Map;for(let A of l){let g=JSON.stringify([A.net,A.z]),f=p.get(g)??[];f.push(A),p.set(g,f)}let m=(A,g)=>{if(A===void 0)return;let f=u[A].viaPositions;f.some((y)=>Math.hypot(y.x-g.x,y.y-g.y)<=pr)||f.push({x:g.x,y:g.y})};for(let A of h){if(!Cw(A.start,A.end,n))continue;let g=A.end.x-A.start.x,f=A.end.y-A.start.y,y=g*g+f*f;if(!(y<=0.00000000000000010000000000000001))for(let x of p.get(JSON.stringify([A.net,A.z]))??[]){if(x.source===A.source||c(x.source,A.source))continue;let C=Math.max(0,Math.min(1,((x.x-A.start.x)*g+(x.y-A.start.y)*f)/y)),b={x:A.start.x+g*C,y:A.start.y+f*C};if(sy(b,n)&&!(Math.hypot(b.x-x.x,b.y-x.y)>A.radius+x.radius+pr)){if(A.routeIndex!==void 0&&A.segmentIndex!==void 0){let I=u[A.routeIndex].segmentTimes.get(A.segmentIndex)??[];I.some((v)=>Math.abs(v-C)<=pr)||I.push(C),u[A.routeIndex].segmentTimes.set(A.segmentIndex,I)}m(x.viaOwner,x)}}}for(let A of d)for(let g=A.minZ;g<=A.maxZ;g+=1)for(let f of p.get(JSON.stringify([A.net,g]))??[])f.source===A.source||c(f.source,A.source)||Math.hypot(A.x-f.x,A.y-f.y)>A.radius+f.radius+pr||(m(A.routeIndex,A),m(f.viaOwner,f));return((A,g,f,y)=>{let x=new Map,C=new Set,b=[],I=(v,P)=>{if(v.routeIndex===void 0||v.segmentIndex===void 0)return;let M=v.end.x-v.start.x,B=v.end.y-v.start.y,T=M*M+B*B;if(T<=0.00000000000000010000000000000001)return;let N=Math.max(0,Math.min(1,((P.x-v.start.x)*M+(P.y-v.start.y)*B)/T)),D=f[v.routeIndex].segmentTimes.get(v.segmentIndex)??[];D.some((L)=>Math.abs(L-N)<=pr)||D.push(N),f[v.routeIndex].segmentTimes.set(v.segmentIndex,D)};for(let v of A){let P=Cw(v.start,v.end,g);if(!P||P[1]-P[0]<=pr)continue;let M=(V)=>({x:v.start.x+(v.end.x-v.start.x)*V,y:v.start.y+(v.end.y-v.start.y)*V}),B={...v,start:M(P[0]),end:M(P[1])},T=b.length;b.push({original:v,clipped:B});let N=Math.floor((Math.min(B.start.x,B.end.x)-B.radius)/2),D=Math.floor((Math.max(B.start.x,B.end.x)+B.radius)/2),L=Math.floor((Math.min(B.start.y,B.end.y)-B.radius)/2),H=Math.floor((Math.max(B.start.y,B.end.y)+B.radius)/2);for(let V=N;V<=D;V+=1)for(let O=L;O<=H;O+=1){let U=JSON.stringify([B.net,B.z,V,O]),j=x.get(U)??[];for(let Y of j){let X=b[Y];if(X.original.source===v.source||y(X.original.source,v.source)||X.original.routeIndex===void 0&&v.routeIndex===void 0)continue;let K=`${Y}:${T}`;if(C.has(K))continue;C.add(K);let[J,ee]=tfr(B,X.clipped);Math.hypot(J.x-ee.x,J.y-ee.y)>B.radius+X.clipped.radius+pr||(I(v,J),I(X.original,ee))}j.push(T),x.set(U,j)}}})(h,n,u,c),u},Mzt=(e,t)=>({minX:e.minX-t,maxX:e.maxX+t,minY:e.minY-t,maxY:e.maxY+t}),nfr=(e,t,n,o)=>{let r=[],i,s=e.route,a=(l)=>l===0||l===s.length-1||s[l]?.pcb_port_id!==void 0,c=()=>{i!==void 0&&i.points.length>0&&(i.locks[0]=!0,i.locks[i.points.length-1]=!0,r.push(i)),i=void 0};if(s.length===1&&s[0]&&sy(s[0],t))return[{points:structuredClone(s),locks:[!0],start:{segmentIndex:0,t:0},end:{segmentIndex:0,t:0}}];for(let l=0;l<s.length-1;l+=1){let h=s[l],d=s[l+1];if(!h||!d)throw Error("repair04 found a missing route point");if(![h.x,h.y,h.z,d.x,d.y,d.z].every(Number.isFinite))throw Error("repair04 route coordinates must be finite");if(h.z!==d.z&&!lb({x:h.x,y:h.y},{x:d.x,y:d.y})&&h.toNextSegmentType!=="through_obstacle")throw Error("repair04 requires colocated points at a via transition");let u=Cw(h,d,t);if(!u){c();continue}let[_,p]=u;if(p-_<=pr&&!lb(h,d)){c();continue}let m=Cw(h,d,n),A=[_,p],g=o.segmentTimes.get(l)??[];for(let x of g)x>=_-pr&&x<=p+pr&&A.push(Math.max(_,Math.min(p,x)));if(m&&h.z===d.z)for(let x of m)x>_+pr&&x<p-pr&&A.push(x);A.sort((x,C)=>x-C);let f=A.filter((x,C)=>C===0||Math.abs(x-A[C-1])>pr),y=T$(h,d,_);i&&!lb(i.points[i.points.length-1],y)&&c(),i||(i={points:[],locks:[],start:{segmentIndex:l,t:_},end:{segmentIndex:l,t:p}});for(let x of f){let C=T$(h,d,x),b=x<=pr?l:x>=0.99999999?l+1:void 0,I=!sy(C,n,0.00000004)||g.some((P)=>Math.abs(P-x)<=pr)||o.viaPositions.some((P)=>Math.hypot(P.x-C.x,P.y-C.y)<=pr)||b!==void 0&&a(b)||h.toNextSegmentType==="through_obstacle"||C.toNextSegmentType==="through_obstacle"||h.insideJumperPad===!0||d.insideJumperPad===!0||(e.jumpers??[]).some((P)=>lb(C,{...P.start,z:C.z})||lb(C,{...P.end,z:C.z})),v=i.points[i.points.length-1];v&&v.x===C.x&&v.y===C.y&&v.z===C.z?i.locks[i.locks.length-1]=i.locks[i.locks.length-1]||I:(i.points.push(C),i.locks.push(I))}i.end={segmentIndex:l,t:p},p<0.99999999&&c()}c();for(let l of r)for(let h=1;h<l.points.length;h+=1){let d=l.points[h-1],u=l.points[h];if(d.z!==u.z&&(l.locks[h-1]||l.locks[h])){let _=h-1,p=h;for(;_>0&&lb({x:l.points[_-1].x,y:l.points[_-1].y},{x:u.x,y:u.y});)_-=1;for(;p+1<l.points.length&&lb({x:l.points[p+1].x,y:l.points[p+1].y},{x:u.x,y:u.y});)p+=1;for(let m=_;m<=p;m+=1)l.locks[m]=!0}}return r},ofr=(e,t)=>{let n=e.bounds,o=e.outline&&e.outline.length>=3?e.outline:[{x:n.minX,y:n.minY},{x:n.maxX,y:n.minY},{x:n.maxX,y:n.maxY},{x:n.minX,y:n.maxY}],r=[];for(let i=0;i<o.length;i+=1){let s=o[i],a=o[(i+1)%o.length],c=Cw(s,a,t);if(!c)continue;let l=a.x-s.x,h=a.y-s.y,d=Math.hypot(l,h);if(d<=pr)continue;let u=(c[0]+c[1])/2;r.push({obstacleId:`repair04_board_edge_${i}`,type:"rect",center:{x:s.x+l*u,y:s.y+h*u},width:d*(c[1]-c[0]),height:Math.max(2*(e.minBoardEdgeClearance??0),pr),ccwRotationDegrees:180*Math.atan2(h,l)/Math.PI,layers:Array.from({length:e.layerCount},(_,p)=>p===0?"top":p===e.layerCount-1?"bottom":`inner${p}`),zLayers:Array.from({length:e.layerCount},(_,p)=>p),connectedTo:[]})}return r},rfr=({srj:e,routes:t,bounds:n,boundaryMargin:o=0.5,clearanceHalo:r})=>{if(((f)=>{if(!Object.values(f).every(Number.isFinite))throw Error("repair04 bounds must contain finite coordinates");if(f.maxX-f.minX<9.99999999||f.maxY-f.minY<9.99999999)throw Error("repair04 requires bounds at least 10 mm by 10 mm")})(n),!Number.isFinite(o)||o<0||r!==void 0&&(!Number.isFinite(r)||r<0))throw Error("repair04 collar and halo must be finite and nonnegative");let i=Math.max(e.defaultObstacleMargin??0.2,e.minTraceToPadEdgeClearance??0,e.minTraceToHoleEdgeClearance??0,e.minViaEdgeToPadEdgeClearance??0),s=Math.max(e.minTraceWidth,e.minViaDiameter??0);for(let f of t){s=Math.max(s,f.traceThickness,f.viaDiameter);for(let y of f.route)s=Math.max(s,y.traceThickness??0)}for(let f of e.traces??[])for(let y of f.route)y.route_type==="wire"&&(s=Math.max(s,y.width)),y.route_type==="via"&&(s=Math.max(s,y.via_diameter??e.minViaDiameter??0.3));if(!Number.isFinite(s)||s<=0)throw Error("repair04 requires finite positive copper widths");let a=Math.max(o,s+i);if(2*a>=Math.min(n.maxX-n.minX,n.maxY-n.minY))throw Error("repair04 bounds are too small for their required copper safety collar");let c=Mzt(n,Math.max(r??a,i+s)),l=Mzt(n,-a),h=Mqt(e,t,c),d=((f,y,x)=>{let C=[];for(let b of f){let I=v$e(b,x),v=[],P=[],M=()=>{P.length>0&&v.push(P),P=[]},B=(T)=>{rl(P[P.length-1])!==rl(T)&&P.push(structuredClone(T))};for(let T=0;T<I.route.length;T+=1){let N=I.route[T],D=I.route[T-1];if(N.route_type==="wire"&&D?.route_type==="wire"&&N.layer===D.layer){let L=Cw(D,N,y);if(!L){M();continue}let H=Ezt(D,N,L[0]),V=Ezt(D,N,L[1]),O=P[P.length-1];O?.route_type==="wire"&&(O.layer!==H.layer||Math.hypot(O.x-H.x,O.y-H.y)>pr)&&M(),B(H),B(V),L[1]<0.99999999&&M()}else if(N.route_type==="via"){if(!sy(N,y)){M();continue}if(D?.route_type!=="wire")throw Error("repair04 normalized preload via has no incoming wire");B(D),B(N);let L=I.route[T+1];if(L?.route_type!=="wire")throw Error("repair04 normalized preload via has no outgoing wire");B(L)}else if(N.route_type==="wire")sy(N,y)&&B(N);else if("start"in N&&"end"in N){let L=Cw(N.start,N.end,y);if(!L){M();continue}let H=(V)=>({x:N.start.x+(N.end.x-N.start.x)*V,y:N.start.y+(N.end.y-N.start.y)*V});B({...structuredClone(N),start:H(L[0]),end:H(L[1])}),L[1]<0.99999999&&M()}}M();for(let T=0;T<v.length;T+=1)C.push({...structuredClone(b),pcb_trace_id:v.length===1?b.pcb_trace_id:`${b.pcb_trace_id}__repair04_fixed_${T}`,route:v[T]})}return C})(e.traces??[],c,e.minTraceWidth),u=[],_=[],p=[];for(let f=0;f<t.length;f+=1){let y=t[f];for(let x of nfr(y,c,l,h[f])){let C={...structuredClone(Object.fromEntries(Object.entries(y).filter(([b])=>b!=="route"&&b!=="vias"&&b!=="jumpers"))),connectionName:y.connectionName,traceThickness:y.traceThickness,viaDiameter:y.viaDiameter,route:x.points,vias:y.vias.filter((b)=>x.points.some((I)=>Math.abs(I.x-b.x)<=pr&&Math.abs(I.y-b.y)<=pr)).map((b)=>structuredClone(b)),...y.jumpers!==void 0?{jumpers:y.jumpers.filter((b)=>Cw(b.start,b.end,c)!==void 0).map((b)=>structuredClone(b))}:{}};u.push(C),_.push(x.locks),p.push({sourceRouteIndex:f,start:x.start,end:x.end,sourceGeometryKey:wXt(y,x.start.segmentIndex+x.start.t,x.end.segmentIndex+x.end.t),originalFragment:structuredClone(C)})}}let m=new Set([...u.flatMap((f)=>[f.connectionName,...f.rootConnectionName?[f.rootConnectionName]:[]]),...d.map((f)=>f.connection_name)]),A=e.connections.filter((f)=>m.has(f.name)||f.pointsToConnect.some((y)=>sy(y,c))).map((f)=>({...structuredClone(Object.fromEntries(Object.entries(f).filter(([y])=>y!=="pointsToConnect"))),name:f.name,pointsToConnect:f.pointsToConnect.filter((y)=>sy(y,c)).map((y)=>structuredClone(y))}));for(let f=0;f<u.length;f+=1){let y=u[f],x=A.find((C)=>C.name===y.connectionName);x||(x={name:y.connectionName,...y.rootConnectionName?{rootConnectionName:y.rootConnectionName}:{},pointsToConnect:[]},A.push(x));for(let[C,b]of[["start",y.route[0]],["end",y.route[y.route.length-1]]]){if(!b)continue;let I=b.z===0?"top":b.z===e.layerCount-1?"bottom":`inner${b.z}`;x.pointsToConnect.some((v)=>Math.abs(v.x-b.x)<=pr&&Math.abs(v.y-b.y)<=pr&&("layer"in v?v.layer===I:v.layers.includes(I)))||x.pointsToConnect.push({x:b.x,y:b.y,layer:I,pointId:`repair04_${f}_${C}`,...b.pcb_port_id?{pcb_port_id:b.pcb_port_id}:{}})}}return{srj:{...Object.fromEntries(Object.entries(e).filter(([f,y])=>f!=="sourceCircuitJson"&&f!=="sourceKicadPcb"&&(typeof y=="number"||typeof y=="boolean"||typeof y=="string"))),layerCount:e.layerCount,minTraceWidth:e.minTraceWidth,bounds:structuredClone(c),obstacles:[...e.obstacles.filter((f)=>((y,x)=>{let C=(y.ccwRotationDegrees??0)*Math.PI/180,b=(Math.abs(y.width*Math.cos(C))+Math.abs(y.height*Math.sin(C)))/2,I=(Math.abs(y.width*Math.sin(C))+Math.abs(y.height*Math.cos(C)))/2;return y.center.x+b>=x.minX&&y.center.x-b<=x.maxX&&y.center.y+I>=x.minY&&y.center.y-I<=x.maxY})(f,c)).map((f)=>structuredClone(f)),...ofr(e,c)],connections:A,...e.traces!==void 0?{traces:d}:{},...e.allowJumpers!==void 0?{allowJumpers:e.allowJumpers}:{},...e.availableJumperTypes?{availableJumperTypes:structuredClone(e.availableJumperTypes)}:{}},routes:u,bounds:structuredClone(n),contextBounds:c,mutableBounds:l,boundaryMargin:a,lockedPointIndices:_,routeMappings:p}},wzt=(e)=>rl(Object.fromEntries(Object.entries(e).filter(([t])=>t!=="route"&&t!=="vias"))),Bzt=(e,t)=>{let n=[];for(let o=1;o<e.route.length;o+=1){let r=e.route[o-1],i=e.route[o],s=Cw(r,i,t),a=s?[...s[0]>pr?[[0,s[0]]]:[],...s[1]<0.99999999?[[s[1],1]]:[]]:[[0,1]];s&&!sy(T$(r,i,0.5),t,0.00000004)&&a.length===0&&a.push([0,1]);for(let[c,l]of a)n.push(rl([T$(r,i,c),T$(r,i,l)]))}return n},ifr=(e,t,n,o,r,i)=>{if(wzt(e)!==wzt(t))throw Error("repair04 merge rejected changed net, width, jumper, or route metadata");if(n.length!==e.route.length)throw Error("repair04 merge received an invalid lock mask");if(t.route.length===0)throw Error("repair04 merge rejected an empty replacement route");if(rl(e.route[0])!==rl(t.route[0])||rl(e.route[e.route.length-1])!==rl(t.route[t.route.length-1]))throw Error("repair04 merge rejected a moved fragment endpoint");let s=0;for(let a=0;a<e.route.length;a+=1){if(!n[a])continue;let c=rl(e.route[a]);for(;s<t.route.length&&rl(t.route[s])!==c;)s+=1;if(s===t.route.length)throw Error("repair04 merge rejected a moved or removed locked point");s+=1}if(rl(Bzt(e,o))!==rl(Bzt(t,o)))throw Error("repair04 merge rejected modified geometry in the fixed boundary collar");for(let a=1;a<e.route.length;a+=1){let c=e.route[a-1],l=e.route[a];if(!(c.toNextSegmentType==="through_obstacle"||c.insideJumperPad===!0||l.insideJumperPad===!0||(e.jumpers??[]).some((d)=>lb(c,{...d.start,z:c.z})&&lb(l,{...d.end,z:l.z})||lb(c,{...d.end,z:c.z})&&lb(l,{...d.start,z:l.z}))))continue;let h=rl([c,l]);if(!t.route.some((d,u)=>u+1<t.route.length&&rl([d,t.route[u+1]])===h))throw Error("repair04 merge rejected a changed atomic jumper or through-obstacle span")}for(let a of t.route){if(![a.x,a.y,a.z].every(Number.isFinite)||!Number.isInteger(a.z)||a.z<0||a.z>=i||!sy(a,r))throw Error("repair04 merge rejected invalid or out-of-region geometry");if((a.pcb_port_id!==void 0||a.insideJumperPad===!0||a.toNextSegmentCircuitJsonMetadata!==void 0)&&!e.route.some((c)=>rl(c)===rl(a)))throw Error("repair04 merge rejected invented or moved terminal/circuit metadata");if(a.traceThickness!==void 0&&(!Number.isFinite(a.traceThickness)||a.traceThickness<=0||a.traceThickness>Math.max(e.traceThickness,...e.route.map((c)=>c.traceThickness??0))+pr))throw Error("repair04 merge rejected increased per-point copper width")}for(let a=1;a<t.route.length;a+=1){let c=t.route[a-1],l=t.route[a];if(c.toNextSegmentType==="through_obstacle"&&!e.route.some((h,d)=>d+1<e.route.length&&rl([h,e.route[d+1]])===rl([c,l])))throw Error("repair04 merge rejected an invented through-obstacle span");if(c.z!==l.z&&c.toNextSegmentType!=="through_obstacle"&&(Math.abs(c.x-l.x)>pr||Math.abs(c.y-l.y)>pr||!t.vias.some((h)=>Math.abs(h.x-c.x)<=pr&&Math.abs(h.y-c.y)<=pr)))throw Error("repair04 merge rejected a disconnected or missing via")}for(let a of t.vias){if(!(Number.isFinite(a.x)&&Number.isFinite(a.y)&&sy(a,r)&&t.route.some((c)=>Math.abs(c.x-a.x)<=pr&&Math.abs(c.y-a.y)<=pr)))throw Error("repair04 merge rejected an invalid via position");if(!sy(a,o,0.00000004)&&!e.vias.some((c)=>rl(c)===rl(a)))throw Error("repair04 merge rejected a new via in the boundary collar")}for(let a of e.vias)if(!sy(a,o,0.00000004)&&!t.vias.some((c)=>rl(c)===rl(a)))throw Error("repair04 merge rejected a changed via in the boundary collar")},mWe=(e,t)=>{for(let n of t){let o=e[e.length-1];o&&lb(o,n)&&rl(o)===rl(n)||e.push(structuredClone(n))}},sfr=(e,t,n)=>{let o=new Set(t.route.map(rl)),r=new Set(n.flatMap((s)=>s.originalFragment.route.map(rl)).filter((s)=>!o.has(s))),i=[];for(let s of e)for(i.push(s);i.length>=3;){let a=i[i.length-3],c=i[i.length-2],l=i[i.length-1];if(!r.has(rl(c)))break;if(a.z!==c.z||c.z!==l.z&&a.toNextSegmentType!=="through_obstacle")break;if(a.toNextSegmentType!==c.toNextSegmentType||a.insideJumperPad!==c.insideJumperPad||a.traceThickness!==c.traceThickness||rl(a.toNextSegmentCircuitJsonMetadata)!==rl(c.toNextSegmentCircuitJsonMetadata))break;let h=l.x-a.x,d=l.y-a.y,u=h*h+d*d;if(u<=0.00000000000000010000000000000001)break;let _=(c.x-a.x)*d-(c.y-a.y)*h,p=((c.x-a.x)*h+(c.y-a.y)*d)/u;if(Math.abs(_)>pr*Math.sqrt(u)||p<0||p>1)break;i.splice(i.length-2,1)}return i},W4e=(e)=>{if(!Number.isInteger(e.segmentIndex)||e.segmentIndex<0||!Number.isFinite(e.t)||e.t<0||e.t>1)throw Error("repair04 merge received invalid fragment provenance");return e.segmentIndex+e.t},wqt=(e,t)=>{let n=Math.max(Math.abs(e),Math.abs(t));if(n===0||n===Number.POSITIVE_INFINITY)return n;let o=e/n,r=t/n;return n*Math.sqrt(o*o+r*r)};function Tzt(e,t,n){return e.minX-n-pr>t.maxX||e.maxX+n+pr<t.minX||e.minY-n-pr>t.maxY||e.maxY+n+pr<t.minY}var afr=class extends fa{input;stats;phase="initialize";cursor=0;barrierCount=0;output;prepareObstacle;prepareRoute;prepareTrace;indexBarrier;seedSearch;searchBatch;constructor(e){super(),this.input=e,this.stats=e.stats??{nodesPopped:0,completionReason:"no-path"},this.MAX_ITERATIONS=Math.ceil((e.maxNodes??30000)/128)+Math.ceil(e.srj.obstacles.length/128)+Math.ceil(e.routes.length/32)+Math.ceil((e.srj.traces?.length??0)/32)+e.srj.obstacles.length*e.srj.layerCount+e.routes.reduce((t,n)=>t+n.route.length,0)+(e.srj.traces??[]).reduce((t,n)=>t+n.route.length,0)+32}finish(e){this.output=e,this.phase="finished",this.solved=!0,this.progress=1,this.prepareObstacle=void 0,this.prepareRoute=void 0,this.prepareTrace=void 0,this.indexBarrier=void 0,this.seedSearch=void 0,this.searchBatch=void 0}_step(){if(this.phase==="initialize")return void this.initialize();if(this.phase==="seed")return void this.seedSearch();if(this.phase==="search")return this.searchBatch(),void(this.solved||(this.progress=Math.min(0.99,this.stats.nodesPopped/(this.input.maxNodes??30000))));let e=this.cursor;if(this.phase==="obstacles"){let t=this.input.srj.obstacles;for(;this.cursor<Math.min(e+128,t.length);this.cursor++)this.prepareObstacle(t[this.cursor]);return void(this.cursor===t.length&&(this.phase="routes",this.cursor=0))}if(this.phase!=="routes"){if(this.phase==="traces"){let t=this.input.srj.traces??[];for(;this.cursor<Math.min(e+32,t.length);this.cursor++)this.prepareTrace(t[this.cursor]);return void(this.cursor===t.length&&(this.phase="index",this.cursor=0))}if(this.phase!=="index")throw Error("repair04: clearance path stepped after completion");for(;this.cursor<Math.min(e+128,this.barrierCount);this.cursor++)this.indexBarrier(this.cursor);this.cursor===this.barrierCount&&(this.phase="seed")}else{for(;this.cursor<Math.min(e+32,this.input.routes.length);this.cursor++)this.prepareRoute(this.input.routes[this.cursor]);this.cursor===this.input.routes.length&&(this.phase="traces",this.cursor=0)}}initialize(){let e=this.input,{srj:t,routes:n,routeIndex:o,start:r,end:i,bounds:s,traceThickness:a}=e,c=e.heuristicWeight??1;if(!Number.isFinite(c)||c<1)throw Error("repair04: heuristic weight must be finite and at least one");let l=(N,D)=>{let L=e.getAdditionalEdgeCost?.(N,D)??0;if(Number.isNaN(L)||L<0)throw Error("repair04: additional edge costs must be nonnegative");return L};if(e.maxNodes!==void 0&&(!Number.isSafeInteger(e.maxNodes)||e.maxNodes<1))throw Error("repair04: maxNodes must be a positive safe integer");if(this.stats&&(this.stats.nodesPopped=0,this.stats.completionReason="no-path"),e.allowLayerChanges===!1&&r.z!==i.z)return void this.finish(null);let h=n[o],d=e.viaHoleDiameter??h.viaDiameter;if(!Number.isFinite(d)||d<=0||d>h.viaDiameter)throw Error("repair04: via hole diameter must be positive and fit the copper");let u=d+e.viaClearance,_=(N,D)=>{for(let L=D;L;L=L.previous)if((N.x!==L.x||N.y!==L.y)&&Math.hypot(N.x-L.x,N.y-L.y)+pr<u)return!1;return!0},p=(N)=>{let D;for(let L=1;L<N.length;L++){let H=N[L-1],V=N[L];if(H.z!==V.z&&H.toNextSegmentType!=="through_obstacle"){if(!_(H,D))return!1;H.x===D?.x&&H.y===D?.y||(D={x:H.x,y:H.y,previous:D})}}return!0},m=new Map,A=(N)=>{let D=m.get(N);if(D===void 0||D===N)return N;let L=A(D);return m.set(N,L),L},g=(N)=>{let D=N.filter((H)=>Boolean(H));if(!D.length)return;let L=A(D[0]);for(let H of D)m.set(A(H),L)};for(let N of t.connections){let D=N;g([D.name,D.rootConnectionName,D.netConnectionName,D.__netConnectionName,...D.mergedConnectionNames??[],...D.__rootConnectionNames??[],...D.pointsToConnect.flatMap((L)=>[L.pcb_port_id,L.pointId])])}for(let N of t.obstacles)g(N.connectedTo);for(let N of n)g([N.connectionName,N.rootConnectionName]);let f=A(h.connectionName),y=(N)=>N==="top"?0:N==="bottom"?t.layerCount-1:Number(N.slice(5)),x=[s.minX,s.maxX,s.minY,s.maxY,r.x,r.y,i.x,i.y,a,h.viaDiameter,e.traceClearance,e.viaClearance,t.defaultObstacleMargin??0,t.minTraceToPadEdgeClearance??0,t.minTraceToHoleEdgeClearance??0,t.minViaEdgeToPadEdgeClearance??0].every((N)=>Number.isFinite(N)&&Math.abs(N)<=1e4),C=[],b=(N,D,L,H,V=!1,O=!1,U=!1)=>{let j=H?Math.hypot(H.width,H.height)/2:L,Y=H?Math.cos(H.rotation):1,X=H?Math.sin(H.rotation):0,K={minX:Math.min(N.x,D.x)-j,maxX:Math.max(N.x,D.x)+j,minY:Math.min(N.y,D.y)-j,maxY:Math.max(N.y,D.y)+j},J=H&&x?((ee,se,ne,re,Z,te)=>{if(ee.x!==se.x||ee.y!==se.y||!Number.isFinite(ne.rotation)||ne.width<=0||ne.height<=0||![ee.x,ee.y,ne.width,ne.height,te.minX,te.maxX,te.minY,te.maxY].every((xe)=>Number.isFinite(xe)&&Math.abs(xe)<=1e4))return te;let ie=re*re+Z*Z;if(!Number.isFinite(ie)||Math.abs(ie-1)>0.000000000001)return te;let ce=ne.width/2,ue=ne.height/2,de=(Math.abs(re)*ce+Math.abs(Z)*ue)/ie+0.00000001,me=(Math.abs(Z)*ce+Math.abs(re)*ue)/ie+0.00000001,ge={minX:ee.x-de,maxX:ee.x+de,minY:ee.y-me,maxY:ee.y+me};return ge.minX<te.minX||ge.maxX>te.maxX||ge.minY<te.minY||ge.maxY>te.maxY?te:ge})(N,D,H,Y,X,K):K;C.push({a:N,b:D,radius:L,rect:H,viaOnly:V,pad:O,isNonPlatedHole:U,rectCos:Y,rectSin:X,rectBounds:H?{minX:-H.width/2,maxX:H.width/2,minY:-H.height/2,maxY:H.height/2}:void 0,visitedQuery:0,...J,...tV(t,N,D)})};this.prepareObstacle=(N)=>{let D=N.connectedTo.some((V)=>A(V)===f),L=N.__zLayers??N.zLayers??N.layers.map(y),H=N.isNonPlatedHole&&N.shape==="circle"||N.type==="oval"&&N.width===N.height&&N.ccwRotationDegrees===void 0&&L.length>1;for(let V of L){let O={...N.center,z:V};b(O,O,H?N.width/2:0,H?void 0:{width:N.width,height:N.height,rotation:(N.ccwRotationDegrees??0)*Math.PI/180},D,H,N.isNonPlatedHole)}this.barrierCount=C.length},this.prepareRoute=(N)=>{if(A(N.connectionName)!==f){for(let D=1;D<N.route.length;D++){let L=N.route[D-1],H=N.route[D];L.toNextSegmentType!=="through_obstacle"&&b(L,H,L.z!==H.z?N.viaDiameter/2:Math.max(L.traceThickness??N.traceThickness,H.traceThickness??N.traceThickness)/2)}this.barrierCount=C.length}},this.prepareTrace=(N)=>{if(A(N.connection_name)===f)return;let D=v$e(N,t.minTraceWidth);for(let L=1;L<D.route.length;L++){let H=D.route[L-1],V=D.route[L];H.route_type==="wire"&&V.route_type==="wire"&&H.layer===V.layer&&b({x:H.x,y:H.y,z:y(H.layer)},{x:V.x,y:V.y,z:y(V.layer)},Math.max(H.width,V.width)/2),V.route_type==="via"&&b({x:V.x,y:V.y,z:y(V.from_layer)},{x:V.x,y:V.y,z:y(V.to_layer)},(V.via_diameter??h.viaDiameter)/2)}this.barrierCount=C.length};let I=new Map,v=Math.max(h.viaDiameter,a)/2+Math.max(e.traceClearance,e.viaClearance,t.defaultObstacleMargin??0,t.minTraceToPadEdgeClearance??0,t.minTraceToHoleEdgeClearance??0,t.minViaEdgeToPadEdgeClearance??0)+0.00001;this.indexBarrier=(N)=>{let D=C[N];for(let L=Math.floor(Math.max(D.minX,s.minX-v));L<=Math.floor(Math.min(D.maxX,s.maxX+v));L++){let H=I.get(L);for(let V=Math.floor(Math.max(D.minY,s.minY-v));V<=Math.floor(Math.min(D.maxY,s.maxY+v));V++){H||(H=new Map,I.set(L,H));let O=H.get(V);O?O.push(D):H.set(V,[D])}}};let P=0,M={x:0,y:0},B={x:0,y:0},T=(N,D)=>{let L=N.z!==D.z,H=L?h.viaDiameter/2:a/2,V=Math.max(L?e.viaClearance:e.traceClearance,t.defaultObstacleMargin??0,L?t.minViaEdgeToPadEdgeClearance??0:t.minTraceToPadEdgeClearance??0),O=H+Math.max(V,t.minTraceToHoleEdgeClearance??0)+0.00001,U=++P,j=Math.min(N.x,D.x),Y=Math.max(N.x,D.x),X=Math.min(N.y,D.y),K=Math.max(N.y,D.y),{minZ:J,maxZ:ee}=tV(t,N,D);for(let se=Math.floor(j-O);se<=Math.floor(Y+O);se++){let ne=I.get(se);if(ne)for(let re=Math.floor(X-O);re<=Math.floor(K+O);re++){let Z=ne.get(re);if(Z)for(let te of Z){if(te.viaOnly&&!L)continue;if(te.visitedQuery===U)continue;if(te.visitedQuery=U,te.maxZ<J||te.minZ>ee)continue;let ie=H+(te.isNonPlatedHole&&!L&&t.minTraceToHoleEdgeClearance!==void 0?t.minTraceToHoleEdgeClearance:te.viaOnly?S$e(t,e.viaClearance,!0):te.rect||te.pad?V:L&&te.minZ!==te.maxZ?e.viaClearance:e.traceClearance);if(Y+ie<te.minX||j-ie>te.maxX||K+ie<te.minY||X-ie>te.maxY)continue;let ce;if(te.rect?(M.x=(N.x-te.a.x)*te.rectCos+(N.y-te.a.y)*te.rectSin,M.y=-(N.x-te.a.x)*te.rectSin+(N.y-te.a.y)*te.rectCos,B.x=(D.x-te.a.x)*te.rectCos+(D.y-te.a.y)*te.rectSin,B.y=-(D.x-te.a.x)*te.rectSin+(D.y-te.a.y)*te.rectCos,ce=AV(M,B,te.rectBounds)):ce=s_(N,D,te.a,te.b)-te.radius,ce+pr<ie)return!1}}}return!0};this.seedSearch=()=>{if(!T(r,r)||!T(i,i))return void this.finish(null);if(e.existingPath){let Ee=e.existingPath,Re=Ee[0],Me=Ee.at(-1);if(!Re||!Me||Re.x!==r.x||Re.y!==r.y||Re.z!==r.z||Me.x!==i.x||Me.y!==i.y||Me.z!==i.z)throw Error("repair04: existing clearance path must match its anchors");if(Ee.some((_e,ye)=>{let Se=Ee[ye-1];return Boolean(Se&&Se.z!==_e.z&&(Se.x!==_e.x||Se.y!==_e.y))}))throw Error("repair04: existing clearance path has a non-colocated layer transition");if(p(Ee)&&(e.allowLayerChanges!==!1||Ee.every((_e)=>_e.z===r.z))&&Ee.slice(1).every((_e,ye)=>T(Ee[ye],_e)&&l(Ee[ye],_e)===0))return this.stats&&(this.stats.completionReason="found"),void this.finish(Ee.map((_e)=>({..._e})))}let N=e.gridSize??0.1;if(!Number.isFinite(N)||N<=0)throw Error("repair04: clearance grid size must be positive and finite");let D=Math.floor((s.maxX-s.minX)/N),L=Math.floor((s.maxY-s.minY)/N),H=(Ee)=>({x:s.minX+(Ee%D+0.5)*N,y:s.minY+(Math.floor(Ee/D)%L+0.5)*N,z:Math.floor(Ee/(D*L)),traceThickness:a}),V=(Ee,Re,Me)=>(Me*L+Re)*D+Ee,O=(Ee)=>Math.hypot(Ee.x-i.x,Ee.y-i.y)+(Ee.z===i.z?0:1),U=D*L*t.layerCount,j=D>0&&L>0&&Number.isSafeInteger(t.layerCount)&&Number.isSafeInteger(U)&&U>0&&U<=1e6&&Number.isInteger(r.z)&&r.z>=0&&r.z<t.layerCount,Y=new O_r(j?U:void 0),X=j?new Float64Array(U).fill(1/0):void 0,K=j?new Int32Array(U):void 0,J=new Map,ee=new Map,se=new Map,ne=(te=r,V(Math.max(0,Math.min(D-1,Math.floor((te.x-s.minX)/N))),Math.max(0,Math.min(L-1,Math.floor((te.y-s.minY)/N))),te.z)),re=ne%D,Z=Math.floor(ne/D)%L;var te;for(let Ee=-2;Ee<=2;Ee++)for(let Re=-2;Re<=2;Re++){let Me=re+Ee,_e=Z+Re;if(Me<0||Me>=D||_e<0||_e>=L)continue;let ye=V(Me,_e,r.z),Se=H(ye);if(!T(r,Se))continue;let Ne=Math.hypot(Se.x-r.x,Se.y-r.y)+l(r,Se);Number.isFinite(Ne)&&(X?X[ye]=Ne:J.set(ye,Ne),K?K[ye]=-1:ee.set(ye,-1),Y.push({id:ye,cost:Ne,priority:Ne+c*O(Se)}))}let ie=D*L*t.layerCount,ce=D>0&&L>0&&Number.isSafeInteger(t.layerCount)&&Number.isSafeInteger(ie)&&ie>0&&Number.isSafeInteger(ie*ie-1)&&Number.isInteger(r.z)&&r.z>=0&&r.z<t.layerCount,ue=j&&c>1?new Uint8Array(U):void 0,de=!j&&c>1?new Set:void 0,me=new Map,ge=new Map,xe=0;this.searchBatch=()=>{let Ee=Math.min(xe+128,e.maxNodes??30000);for(;Y.length&&xe<Ee;){let Re=Y.pop();if(xe++,this.stats&&(this.stats.nodesPopped=xe),Re.cost!==(X?X[Re.id]:J.get(Re.id)))continue;ue?ue[Re.id]=1:de?.add(Re.id);let Me=H(Re.id),_e=se.get(Re.id);if(Me.z===i.z&&Math.hypot(Me.x-i.x,Me.y-i.y)<3*N&&T(Me,i)&&Number.isFinite(l(Me,i))){let Le=[i];for(let ct=Re.id;ct!==-1;ct=K?K[ct]:ee.get(ct))Le.push(H(ct));Le.push(r);let nt=Le.reverse(),dt=[r],rt=[0];for(let ct=1;e.getAdditionalEdgeCost&&ct<nt.length;ct++){let Ct=nt[ct-1],kt=nt[ct];rt.push(rt[ct-1]+(Ct.z===kt.z?Math.hypot(Ct.x-kt.x,Ct.y-kt.y):1)+l(Ct,kt))}let pt=0;for(let ct=1;ct<nt.length;){let Ct=ct;if(nt[ct].z===dt.at(-1).z)for(let kt=ct+1;kt<nt.length&&nt[kt].z===nt[ct].z;kt++)T(dt.at(-1),nt[kt])&&(!e.getAdditionalEdgeCost||Math.hypot(nt[kt].x-nt[pt].x,nt[kt].y-nt[pt].y)+l(nt[pt],nt[kt])<=rt[kt]-rt[pt]+pr)&&(Ct=kt);dt.push(nt[Ct]),pt=Ct,ct=Ct+1}if(!p(dt))throw Error("repair04: search generated conflicting drill sites");return this.stats&&(this.stats.completionReason="found"),void this.finish(dt)}let ye=Re.id%D,Se=Math.floor(Re.id/D)%L,Ne=[];for(let Le=-1;Le<=1;Le++)for(let nt=-1;nt<=1;nt++)Le===0&&nt===0||ye+Le<0||ye+Le>=D||Se+nt<0||Se+nt>=L||Ne.push(V(ye+Le,Se+nt,Me.z));if(e.allowLayerChanges!==!1&&_(Me,_e))for(let Le=0;Le<t.layerCount;Le++)Le!==Me.z&&Ne.push(V(ye,Se,Le));for(let Le of Ne){if(ue?ue[Le]===1:de?.has(Le))continue;let nt=H(Le),dt=Re.cost+(Me.z===nt.z?Math.hypot(Me.x-nt.x,Me.y-nt.y):1),rt=X?X[Le]:J.get(Le)??1/0;if(dt>=rt)continue;let pt=Math.min(Re.id,Le),ct=Math.max(Re.id,Le),Ct=ce?pt*ie+ct:`${pt},${ct}`,kt=ce&&Me.z!==nt.z&&t.allowBlindAndBuriedVias!==!0?Re.id%(D*L):void 0,Lt=kt===void 0?me.get(Ct):ge.get(kt);if(Lt===void 0&&(Lt=T(Me,nt),kt===void 0?me.set(Ct,Lt):ge.set(kt,Lt)),!Lt)continue;let Bt=dt+l(Me,nt);Bt>=rt||(Me.z===nt.z||Me.x===_e?.x&&Me.y===_e?.y?_e?se.set(Le,_e):se.delete(Le):se.set(Le,{x:Me.x,y:Me.y,previous:_e}),X?X[Le]=Bt:J.set(Le,Bt),K?K[Le]=Re.id:ee.set(Le,Re.id),Y.push({id:Le,cost:Bt,priority:Bt+c*O(nt)}))}}Y.length&&xe<(e.maxNodes??30000)||(this.stats.completionReason=Y.length?"node-limit":"no-path",this.finish(null))},this.phase="search"},this.phase="obstacles"}getOutput(){if(!this.solved||this.failed||this.output===void 0)throw Error("repair04: clearance path output requested before completion");return this.output}getResult(){return this.getOutput()}};function _We(e,t){let n=[];for(let o=1;o<t.length;o++){let r=t[o-1],i=t[o];if(r.z!==i.z&&r.toNextSegmentType!=="through_obstacle"){if(r.x!==i.x||r.y!==i.y)throw Error("repair04: negotiated via endpoints must coincide");n.some((s)=>s.x===i.x&&s.y===i.y)||n.push({x:i.x,y:i.y})}}return{...e,route:t,vias:n}}var cfr=class extends fa{input;phase="initialize";routeCursor=0;copperCursor=0;spanCount=0;output;pathSolver;prepareRoute;finishSetup;selectSpan;prepareCopper;startPath;applyPath;updateWorkStats;constructor(e){super(),this.input=e,this.stats={pathSearchNodes:0,pathSearchCalls:0,unresolvedSpanCount:0},this.MAX_ITERATIONS=Math.ceil(e.maxPathSearchNodes/128)+e.maxPathSearchCalls*(e.routes.reduce((t,n)=>t+n.route.length,0)+e.srj.obstacles.length*e.srj.layerCount+128)+e.routes.length+32}_step(){if(this.phase!=="initialize"){if(this.phase==="spans"){let e=Math.min(this.routeCursor+32,this.input.routes.length);for(;this.routeCursor<e;this.routeCursor++)this.prepareRoute(this.routeCursor);return void(this.routeCursor===this.input.routes.length&&(this.phase="setup"))}if(this.phase!=="setup"){if(this.phase==="select")return this.selectSpan(),void this.updateWorkStats();if(this.phase==="coppers"){let e=Math.min(this.copperCursor+32,this.spanCount);for(;this.copperCursor<e;this.copperCursor++)this.prepareCopper(this.copperCursor);return void(this.copperCursor===this.spanCount&&(this.phase="start-path"))}if(this.phase!=="start-path"){if(this.phase==="path"){let e=this.pathSolver;if(!e)throw Error("repair04: negotiated search child is missing");return e.step(),e.failed?(this.failed=!0,this.error=e.error):e.solved&&(this.activeSubSolver=null,this.phase="apply-path"),void this.updateWorkStats()}if(this.phase==="apply-path"){let e=this.pathSolver;if(!e)throw Error("repair04: completed negotiated search child is missing");return this.applyPath(e.getOutput()),this.applyPath=void 0,void this.updateWorkStats()}throw Error("repair04: negotiated clearance stepped after completion")}this.startPath()}else this.finishSetup()}else this.initialize()}initialize(){let e=this.input;for(let r of[e.maxPathSearchNodes,e.maxPathSearchCalls])if(!Number.isSafeInteger(r)||r<0)throw Error("repair04: negotiated work budgets must be nonnegative integers");if(e.maxPathSearchNodesPerCall!==void 0&&(!Number.isSafeInteger(e.maxPathSearchNodesPerCall)||e.maxPathSearchNodesPerCall<1))throw Error("repair04: per-path work budget must be a positive integer");if(e.pathHeuristicWeight!==void 0&&(!Number.isFinite(e.pathHeuristicWeight)||e.pathHeuristicWeight<1))throw Error("repair04: heuristic weight must be finite and at least one");if(e.pathGridSizeScale!==void 0&&(!Number.isFinite(e.pathGridSizeScale)||e.pathGridSizeScale<=0))throw Error("repair04: path grid scale must be positive and finite");if(e.viaHoleDiameter!==void 0&&(!Number.isFinite(e.viaHoleDiameter)||e.viaHoleDiameter<=0||e.routes.some((r)=>e.viaHoleDiameter>r.viaDiameter)))throw Error("repair04: via hole diameter must be positive and fit the copper");let t=(r)=>r.x>=e.bounds.minX-pr&&r.x<=e.bounds.maxX+pr&&r.y>=e.bounds.minY-pr&&r.y<=e.bounds.maxY+pr,n=[],o=e.routes.map(()=>[]);this.prepareRoute=(r)=>{let i=e.routes[r],s=i.route,a=s.flatMap((c,l)=>{let h=s[l-1],d=s[l+1],u=c.traceThickness??i.traceThickness,_=h&&(h.traceThickness??i.traceThickness)!==u||d&&(d.traceThickness??i.traceThickness)!==u,p=h&&h.z!==c.z&&(!e.allowLayerChanges||e.isLocked(r,l)||e.isLocked(r,l-1))||d&&d.z!==c.z&&(!e.allowLayerChanges||e.isLocked(r,l)||e.isLocked(r,l+1));return l===0||l===s.length-1||e.isLocked(r,l)||c.pcb_port_id||c.toNextSegmentType||c.insideJumperPad||_||p?[l]:[]});for(let c=1;c<a.length;c++){let l=s.slice(a[c-1],a[c]+1),h=l[0].traceThickness??i.traceThickness,d=l.slice(1).every((p,m)=>{let A=l[m],g=(A.x+p.x)/2,f=(A.y+p.y)/2;return g>e.bounds.minX+0.00000004&&g<e.bounds.maxX-0.00000004&&f>e.bounds.minY+0.00000004&&f<e.bounds.maxY-0.00000004}),u=l.slice(1).every((p,m)=>{let A=l[m],g=a[c-1]+m;return A.z===p.z||!e.isLocked(r,g)&&!e.isLocked(r,g+1)}),_=l.every(t)&&d&&u&&!i.jumpers?.length&&l.every((p)=>!p.toNextSegmentType&&!p.insideJumperPad&&(p.traceThickness??i.traceThickness)===h)&&(e.allowLayerChanges||l.every((p)=>p.z===l[0].z));o[r].push(n.length),n.push({routeIndex:r,mutable:Boolean(_),route:_We({...i,traceThickness:h},l)})}},this.finishSetup=()=>{let r=n.map((f)=>f.route),i=n.filter((f)=>!f.mutable).map((f)=>f.route),s=Ube(e.srj,e.routes),a=(f)=>s.get(f.connectionName)??f.connectionName,c=new Set;for(let f of n)for(let y of[f.route.route[0],f.route.route.at(-1)]){let x=y.traceThickness??f.route.traceThickness,C=`${a(f.route)}|${y.x}|${y.y}|${y.z}|${x}`;if(c.has(C))continue;c.add(C);let b={x:y.x,y:y.y,z:y.z};i.push({...f.route,traceThickness:x,route:[b,b],vias:[]})}let l=n.map(({route:f})=>{let y=0;for(let x=1;x<f.route.length;x++){let C=f.route[x-1],b=f.route[x];y+=C.z===b.z?Math.hypot(C.x-b.x,C.y-b.y):1}return y}),h=new Set,d=new Set(e.dirtyRouteIndices),u=[],_=new Set,p=(f)=>{_.has(f)||h.has(f)||!n[f].mutable||(_.add(f),u.push(f))};n.forEach((f,y)=>{d.has(f.routeIndex)&&p(y)});let m=0,A=0,g=0;this.spanCount=n.length,this.updateWorkStats=()=>{this.stats={pathSearchNodes:m+(this.pathSolver?.stats.nodesPopped??0),pathSearchCalls:A,unresolvedSpanCount:_.size+h.size},this.progress=this.solved?1:Math.min(0.99,Math.max(this.stats.pathSearchNodes/Math.max(1,e.maxPathSearchNodes),A/Math.max(1,e.maxPathSearchCalls)))},this.selectSpan=()=>{if(!(g<u.length&&m<e.maxPathSearchNodes&&A<e.maxPathSearchCalls))return this.output={routes:e.routes.map((b,I)=>{if(!o[I].length)return b;return _We(b,o[I].flatMap((v,P)=>P===0?r[v].route:r[v].route.slice(1)))}),pathSearchNodes:m,pathSearchCalls:A,unresolvedSpanCount:_.size+h.size},this.solved=!0,void(this.phase="finished");let f=u[g++];_.delete(f);let y=r[f],x=a(y),C=[];this.copperCursor=0,this.prepareCopper=(b)=>{if(b===f)return;let I=r[b],v=a(I);for(let P=1;P<I.route.length;P++){let M=I.route[P-1],B=I.route[P];if(M.toNextSegmentType==="through_obstacle")continue;let T=!n[b].mutable||h.has(b);if(M.z===B.z&&(v===x||T))continue;let N=(M.z!==B.z?I.viaDiameter:Math.max(M.traceThickness??I.traceThickness,B.traceThickness??I.traceThickness))/2,D={a:M,b:B,radius:N,minX:Math.min(M.x,B.x),maxX:Math.max(M.x,B.x),minY:Math.min(M.y,B.y),maxY:Math.max(M.y,B.y),...tV(e.srj,M,B),spanIndex:b,owner:v,index:C.length,cellX:Math.floor(Math.min(M.x,B.x)-N),cellY:Math.floor(Math.min(M.y,B.y)-N),immutable:T};C.push(D)}},this.startPath=()=>{let b=(D)=>{if(!D.length)return;let L=new i_(D.length);for(let H of D)L.add(H.minX-H.radius-pr,H.minY-H.radius-pr,H.maxX+H.radius+pr,H.maxY+H.radius+pr);return L.finish(),{index:L,copper:D}},I=b(C),v=new Map;for(let D=0;D<e.srj.layerCount;D++)v.set(D,b(C.filter((L)=>L.minZ<=D&&L.maxZ>=D)));let P=(D,L)=>{let H=D.z!==L.z,V=Math.min(D.x,L.x),O=Math.max(D.x,L.x),U=Math.min(D.y,L.y),j=Math.max(D.y,L.y),Y=(H?y.viaDiameter:y.traceThickness)/2+Math.max(e.traceClearance,e.viaClearance),X=[],K=tV(e.srj,D,L),J=H?I:v.get(D.z),ee=J?.index.search(V-Y-pr,U-Y-pr,O+Y+pr,j+Y+pr)??[];for(let re of ee){let Z=J.copper[re],te=H&&Z.minZ!==Z.maxZ,ie=Z.minZ<=K.maxZ&&Z.maxZ>=K.minZ;if(!ie&&!te)continue;if(Z.immutable&&!te)continue;if(Z.owner===x&&(!te||D.x===Z.a.x&&D.y===Z.a.y))continue;let ce=(H?y.viaDiameter:y.traceThickness)/2+(te?e.viaClearance:e.traceClearance)+Z.radius,ue=(e.viaHoleDiameter??y.viaDiameter)/2+(e.viaHoleDiameter??2*Z.radius)/2+e.viaClearance,de=te?ie&&Z.owner!==x?Math.max(ce,ue):ue:ce;if(V-de-pr>Z.maxX||O+de+pr<Z.minX||U-de-pr>Z.maxY||j+de+pr<Z.minY)continue;let me=s_(D,L,Z.a,Z.b);me<de-pr&&X.push({copper:Z,ratio:(de-me)/(de*de)})}let se=Math.floor(V-Y),ne=Math.floor(U-Y);return X.sort((re,Z)=>{let te=Math.max(se,re.copper.cellX)-Math.max(se,Z.copper.cellX);if(te!==0)return te;return Math.max(ne,re.copper.cellY)-Math.max(ne,Z.copper.cellY)||re.copper.index-Z.copper.index}),X},M=(D,L)=>{let H=(D.x+L.x)/2,V=(D.y+L.y)/2;if(H<=e.bounds.minX+0.00000004||H>=e.bounds.maxX-0.00000004||V<=e.bounds.minY+0.00000004||V>=e.bounds.maxY-0.00000004)return 1/0;let O=new Map;for(let{copper:j,ratio:Y}of P(D,L)){if(j.owner===x||j.immutable)return 1/0;O.set(j.owner,Math.max(O.get(j.owner)??0,Y*l[j.spanIndex]))}let U=0;for(let j of O.values())U+=j;return(D.z===L.z?Math.hypot(D.x-L.x,D.y-L.y):1)*U},B=new Map,T={nodesPopped:0,completionReason:"no-path"},N=new afr({srj:e.srj,routes:[...i,y],routeIndex:i.length,start:y.route[0],end:y.route.at(-1),bounds:e.bounds,traceThickness:y.traceThickness,traceClearance:e.traceClearance,viaClearance:e.viaClearance,gridSize:Math.min(0.1,y.traceThickness*(e.pathGridSizeScale??1)/2),allowLayerChanges:e.allowLayerChanges,maxNodes:Math.min(e.maxPathSearchNodesPerCall??e.maxPathSearchNodes,e.maxPathSearchNodes-m),heuristicWeight:e.pathHeuristicWeight,stats:T,getAdditionalEdgeCost:(D,L)=>{if(D.z===L.z||e.srj.allowBlindAndBuriedVias===!0||D.x!==L.x||D.y!==L.y)return M(D,L);let H=B.get(D.x),V=H?.get(D.y);if(V!==void 0)return V;let O=M(D,L);return H||(H=new Map,B.set(D.x,H)),H.set(D.y,O),O},existingPath:y.route,viaHoleDiameter:e.viaHoleDiameter});this.pathSolver=N,this.activeSubSolver=N,this.MAX_ITERATIONS=Math.max(this.MAX_ITERATIONS,this.iterations+N.MAX_ITERATIONS+3),this.phase="path",this.applyPath=(D)=>{if(A++,m+=T.nodesPopped,e.onSearch?.(T),!D)return h.add(f),i.push(y),this.phase="select",void(this.pathSolver=void 0);r[f]=_We(y,D);let L=new Set;for(let H=1;H<D.length;H++)for(let{copper:V}of P(D[H-1],D[H]))L.add(V.spanIndex);for(let H of[...L].sort((V,O)=>V-O))l[H]++,p(H);L.size&&(l[f]++,p(f)),this.phase="select",this.pathSolver=void 0}},this.phase="coppers"},this.phase="select",this.updateWorkStats()},this.phase="spans"}getOutput(){if(!this.solved||this.failed||!this.output)throw Error("repair04: negotiated clearance output requested before completion");return this.output}getResult(){return this.getOutput()}},gWe=256,w7=0.25;function AWe(e,t,n,o){let r=t.x-e.x,i=t.y-e.y,s=o.x-n.x,a=o.y-n.y,c=e.x-n.x,l=e.y-n.y,h=r*r+i*i,d=r*s+i*a,u=s*s+a*a,_=r*c+i*l,p=s*c+a*l,m=h*u-d*d,A=m>0.000000000000001?Math.max(0,Math.min(1,(d*p-u*_)/m)):0;u<0.000000000000001&&(A=h>0.000000000000001?Math.max(0,Math.min(1,-_/h)):0);let g=u>0.000000000000001?(d*A+p)/u:0;g<0?(g=0,A=h>0.000000000000001?Math.max(0,Math.min(1,-_/h)):0):g>1&&(g=1,A=h>0.000000000000001?Math.max(0,Math.min(1,(d-_)/h)):0);let f=e.x+A*r-n.x-g*s,y=e.y+A*i-n.y-g*a;return{s:A,t:g,x:f,y,distance:wqt(f,y)}}function lfr(e,t){let n={x:0,y:0,depth:1/0};for(let o=0;o<t.length;o++){let r=t[o],i=t[(o+1)%t.length],s=i.x-r.x,a=i.y-r.y,c=wqt(s,a),l=a/c,h=-s/c,d=-((e.x-r.x)*l+(e.y-r.y)*h);if(d<0)return null;d<n.depth&&(n={x:l,y:h,depth:d})}return n}var hfr=class extends fa{input;phase="geometry";routes=[];nets=new Map;vertices=new Map;segments=[];pairs=[];padContacts=[];viaPadConstraints=new Map;traceClearance=0.1;viaClearance=0.1;pairOuterIndex=0;pairInnerIndex=1;obstacleIndex=0;sweepIndex=0;sweepPairIndex=0;sweepPadIndex=0;preparedPairCount=0;projectedConstraintCount=0;constructor(e){super(),this.input=e,this.MAX_ITERATIONS=1024}prepareGeometry(){let e=this.input,t=structuredClone(e.routes),n=Ube(e.srj,t),o=e.traceClearance??0.1,r=e.viaClearance??0.1,i={minX:e.bounds.minX+e.boundaryMargin,maxX:e.bounds.maxX-e.boundaryMargin,minY:e.bounds.minY+e.boundaryMargin,maxY:e.bounds.maxY-e.boundaryMargin},s=Mqt(e.srj,t,e.bounds),a=new Map,c=t.map((u,_)=>u.route.map((p,m)=>{let A=`${n.get(u.connectionName)}:${p.x}:${p.y}`,g=a.get(A);return g||(g={x:p.x,y:p.y,original:{x:p.x,y:p.y},locked:!1,radius:0,revision:0,bounds:i,points:[]},a.set(A,g)),g.points.push(p),g.locked||=Boolean(e.lockedPointIndices[_][m]||s[_].segmentTimes.has(m)||s[_].segmentTimes.has(m-1)||s[_].viaPositions.some((f)=>Math.hypot(f.x-p.x,f.y-p.y)<=pr)||m===0||m===u.route.length-1||p.pcb_port_id||p.insideJumperPad||p.toNextSegmentType||p.x<=i.minX||p.x>=i.maxX||p.y<=i.minY||p.y>=i.maxY),g})),l=[];for(let u=0;u<t.length;u++){let _=t[u];for(let p=1;p<_.route.length;p++){let m=_.route[p-1],A=_.route[p];if(m.toNextSegmentType||m.insideJumperPad||A.insideJumperPad)continue;let g=c[u][p-1],f=c[u][p],y=m.z!==A.z;y&&e.allowViaMovement!==!0&&(g.locked=f.locked=!0),l.push({a:g,b:f,initialBounds:{minX:Math.min(g.x,f.x),maxX:Math.max(g.x,f.x),minY:Math.min(g.y,f.y),maxY:Math.max(g.y,f.y)},...tV(e.srj,m,A),radius:y?_.viaDiameter/2:Math.max(m.traceThickness??_.traceThickness,A.traceThickness??_.traceThickness)/2,net:n.get(_.connectionName),routeIndex:u,via:y})}}for(let u of l)u.a.radius=Math.max(u.a.radius,u.radius),u.b.radius=Math.max(u.b.radius,u.radius);if(e.boardEdgeClearance!==void 0){let u=e.srj.bounds;for(let _ of a.values()){let p=_.radius+e.boardEdgeClearance;_.bounds={minX:Math.max(i.minX,Math.min(_.original.x,u.minX+p)),maxX:Math.min(i.maxX,Math.max(_.original.x,u.maxX-p)),minY:Math.max(i.minY,Math.min(_.original.y,u.minY+p)),maxY:Math.min(i.maxY,Math.max(_.original.y,u.maxY-p))}}}this.routes=t,this.nets=n,this.vertices=a,this.segments=l,this.traceClearance=o,this.viaClearance=r;let h=l.length*(l.length-1)/2,d=l.length*e.srj.obstacles.length;this.MAX_ITERATIONS=this.iterations+Math.ceil(h/4096)+Math.ceil(e.srj.obstacles.length/16)+gWe*Math.max(1,Math.ceil((h+d)/4096))+4,this.phase="pairs"}preparePairs(){let e=0;for(;e<4096&&this.pairOuterIndex<this.segments.length;){if(this.pairInnerIndex>=this.segments.length){this.pairOuterIndex++,this.pairInnerIndex=this.pairOuterIndex+1;continue}let t=this.segments[this.pairOuterIndex],n=this.segments[this.pairInnerIndex++];if(e++,this.preparedPairCount++,t.net===n.net||t.maxZ<n.minZ||n.maxZ<t.minZ)continue;let o=t.radius+n.radius+Math.max(this.traceClearance,this.viaClearance)+2*Math.SQRT2*w7;Tzt(t.initialBounds,n.initialBounds,o)||s_(t.a,t.b,n.a,n.b)<=o&&this.pairs.push({a:t,b:n,revisions:[-1,-1,-1,-1],contact:null})}this.pairOuterIndex>=this.segments.length&&(this.phase="obstacles"),this.stats={...this.stats,preparedPairCount:this.preparedPairCount,pairCount:this.pairs.length,lastPreparedPairBatchCount:e}}prepareObstacles(){let{input:e,nets:t,segments:n,traceClearance:o,viaClearance:r,padContacts:i,viaPadConstraints:s}=this,a=0;for(;a<16&&this.obstacleIndex<e.srj.obstacles.length;){let c=e.srj.obstacles[this.obstacleIndex++];a++;let l=(c.ccwRotationDegrees??0)*Math.PI/180,h=Math.cos(l),d=Math.sin(l),u=new Set(c.connectedTo.map((A)=>t.get(A)??A)),_=c.__zLayers??c.zLayers??c.layers.map((A)=>A==="top"?0:A==="bottom"?e.srj.layerCount-1:Number(A.slice(5))),p=[[-1,-1],[1,-1],[1,1],[-1,1]].map(([A,g])=>({x:c.center.x+h*A*c.width/2-d*g*c.height/2,y:c.center.y+d*A*c.width/2+h*g*c.height/2})),m={minX:Math.min(...p.map((A)=>A.x)),maxX:Math.max(...p.map((A)=>A.x)),minY:Math.min(...p.map((A)=>A.y)),maxY:Math.max(...p.map((A)=>A.y))};for(let A of n){if(!A.via&&u.has(A.net)||!_.some((y)=>y>=A.minZ&&y<=A.maxZ))continue;let g=A.radius+Math.max(o,r,e.srj.defaultObstacleMargin??0,e.srj.minTraceToPadEdgeClearance??0,e.srj.minTraceToHoleEdgeClearance??0,e.srj.minViaEdgeToPadEdgeClearance??0)+Math.SQRT2*w7;if(Tzt(A.initialBounds,m,g))continue;if(Math.min(...p.map((y,x)=>s_(A.a,A.b,y,p[(x+1)%4])))>g)continue;let f=A.radius+(A.via?S$e(e.srj,r,u.has(A.net)):c.isNonPlatedHole&&e.srj.minTraceToHoleEdgeClearance!==void 0?e.srj.minTraceToHoleEdgeClearance:Math.max(o,e.srj.defaultObstacleMargin??0,e.srj.minTraceToPadEdgeClearance??0));if(i.push({segment:A,corners:p,required:f,revisions:[-1,-1],contact:null}),A.via){let y={center:c.center,cosine:h,sine:d,shape:Gbe(c),clearance:f},x=A.a.original.x-c.center.x,C=A.a.original.y-c.center.y,b={x:x*h+C*d,y:-x*d+C*h};y.clearance=Math.min(y.clearance,sq(b,b,y.shape));for(let I of new Set([A.a,A.b])){let v=s.get(I);v?v.push(y):s.set(I,[y])}}}}this.stats={...this.stats,preparedObstacleCount:this.obstacleIndex,padContactCount:this.padContacts.length,lastPreparedObstacleBatchCount:a},this.obstacleIndex===e.srj.obstacles.length&&(this.MAX_ITERATIONS=this.iterations+gWe*Math.max(1,Math.ceil((this.pairs.length+this.padContacts.length)/4096))+2,this.phase="sweeps")}project(e,t,n,o,r){let i=this.viaPadConstraints,s=new Map;for(let[l,h]of e)l.locked||s.set(l,(s.get(l)??0)+h);let a=[...s.values()].reduce((l,h)=>l+h*h,0);if(a<0.000000000000001)return;let c=Math.min(0.05,0.7*o)/a;for(let[l,h]of s){let d=Math.max(l.bounds.minX,l.original.x-w7,Math.min(l.bounds.maxX,l.original.x+w7,l.x+t*c*h)),u=Math.max(l.bounds.minY,l.original.y-w7,Math.min(l.bounds.maxY,l.original.y+w7,l.y+n*c*h)),_=i.get(l);if(_?.some((p)=>this.getViaPadDistance({x:d,y:u},p)<p.clearance)){if(!r)continue;let p=this.constrainViaDisplacement(l,{x:d,y:u},_);d=p.x,u=p.y}_?.some((p)=>this.getViaPadDistance({x:d,y:u},p)<p.clearance)||(l.x===d&&l.y===u||l.revision++,l.x=d,l.y=u)}}getViaPadDistance(e,t){let n=e.x-t.center.x,o=e.y-t.center.y,r={x:n*t.cosine+o*t.sine,y:-n*t.sine+o*t.cosine};return sq(r,r,t.shape)}constrainViaDisplacement(e,t,n){let o=t.x-e.x,r=t.y-e.y,i=[];for(let c of n){if(this.getViaPadDistance(t,c)>=c.clearance)continue;let l=e.x-c.center.x,h=e.y-c.center.y,d={x:l*c.cosine+h*c.sine,y:-l*c.sine+h*c.cosine},u;if(c.shape.type==="rect"){let A=c.shape.bounds;u={x:Math.max(A.minX,Math.min(A.maxX,d.x)),y:Math.max(A.minY,Math.min(A.maxY,d.y))}}else{let{a:A,b:g}=c.shape,f=g.x-A.x,y=g.y-A.y,x=f*f+y*y,C=x>0?Math.max(0,Math.min(1,((d.x-A.x)*f+(d.y-A.y)*y)/x)):0;u={x:A.x+C*f,y:A.y+C*y}}let _=d.x-u.x,p=d.y-u.y,m={x:_*c.cosine-p*c.sine,y:_*c.sine+p*c.cosine};m.x*m.x+m.y*m.y>0.00000000000000000001&&i.push(m)}let s={x:0,y:0},a=o*o+r*r;for(let c of i){let l=o*c.x+r*c.y,h=c.x*c.x+c.y*c.y,d=this.shortenDisplacement(e,{x:o-c.x*l/h,y:r-c.y*l/h});if(i.some((_)=>d.x*_.x+d.y*_.y<-0.000000000000001))continue;let u=(d.x-o)**2+(d.y-r)**2;u<a&&(s=d,a=u)}return this.compensateTangentRounding(e,s,n,i)}shortenDisplacement(e,t){let n=Math.max(e.bounds.minX,e.original.x-w7),o=Math.min(e.bounds.maxX,e.original.x+w7),r=Math.max(e.bounds.minY,e.original.y-w7),i=Math.min(e.bounds.maxY,e.original.y+w7),s=1;return t.x>0&&(s=Math.min(s,(o-e.x)/t.x)),t.x<0&&(s=Math.min(s,(n-e.x)/t.x)),t.y>0&&(s=Math.min(s,(i-e.y)/t.y)),t.y<0&&(s=Math.min(s,(r-e.y)/t.y)),{x:Math.max(n,Math.min(o,e.x+t.x*s))-e.x,y:Math.max(r,Math.min(i,e.y+t.y*s))-e.y}}compensateTangentRounding(e,t,n,o){let r={x:e.x+t.x,y:e.y+t.y},i=n.reduce((_,p)=>Math.max(_,Math.abs(p.center.x),Math.abs(p.center.y),p.clearance),Math.max(1,Math.abs(e.x),Math.abs(e.y),Math.abs(r.x),Math.abs(r.y))),s=32*Number.EPSILON*i,a=n.map((_)=>this.getViaPadDistance(r,_));if(a.every((_,p)=>_>=n[p].clearance)||a.some((_,p)=>_<n[p].clearance-s))return r;let c=o.map((_)=>{let p=Math.hypot(_.x,_.y);return{x:_.x/p,y:_.y/p}}),l={x:0,y:0};for(let _ of c)for(let p of[_,{x:-_.y,y:_.x},{x:_.y,y:-_.x}])c.some((m)=>p.x*m.x+p.y*m.y<-0.000000000000001)||(l.x+=p.x,l.y+=p.y);let h=Math.hypot(l.x,l.y);if(h<0.000000000000001)return r;let d=this.shortenDisplacement(e,{x:t.x+l.x*s/h,y:t.y+l.y*s/h}),u={x:e.x+d.x,y:e.y+d.y};return n.every((_)=>this.getViaPadDistance(u,_)>=_.clearance)?u:r}projectPair(e){let{a:t,b:n,revisions:o}=e;t.a.revision===o[0]&&t.b.revision===o[1]&&n.a.revision===o[2]&&n.b.revision===o[3]||(e.contact=AWe(t.a,t.b,n.a,n.b),o[0]=t.a.revision,o[1]=t.b.revision,o[2]=n.a.revision,o[3]=n.b.revision);let r=e.contact,i=t.radius+n.radius+(t.via&&n.via?this.viaClearance:this.traceClearance);r.distance>=i||r.distance<0.0000000001||this.project([[t.a,1-r.s],[t.b,r.s],[n.a,r.t-1],[n.b,-r.t]],r.x/r.distance,r.y/r.distance,i-r.distance,t.via&&n.via)}projectPad(e){let{segment:t,corners:n,required:o}=e,r=t.a===t.b?1:2;for(let s=0;s<r;s++){let a=s===0?t.a:t.b,c=lfr(a,n);c&&this.project([[a,1]],c.x,c.y,o+c.depth,!1)}if(t.a.revision!==e.revisions[0]||t.b.revision!==e.revisions[1]){let s=AWe(t.a,t.b,n[0],n[1]);for(let a=1;a<n.length;a++){let c=AWe(t.a,t.b,n[a],n[(a+1)%n.length]);s=s.distance<c.distance?s:c}e.contact=s,e.revisions[0]=t.a.revision,e.revisions[1]=t.b.revision}let i=e.contact;i.distance<0.0000000001||i.distance>=o||this.project([[t.a,1-i.s],[t.b,i.s]],i.x/i.distance,i.y/i.distance,o-i.distance,!1)}stepSweep(){let e=0;for(;e<4096&&this.sweepPairIndex<this.pairs.length;)this.projectPair(this.pairs[this.sweepPairIndex++]),e++;for(;e<4096&&this.sweepPairIndex===this.pairs.length&&this.sweepPadIndex<this.padContacts.length;)this.projectPad(this.padContacts[this.sweepPadIndex++]),e++;this.projectedConstraintCount+=e,this.sweepPairIndex===this.pairs.length&&this.sweepPadIndex===this.padContacts.length&&(this.sweepIndex++,this.sweepPairIndex=0,this.sweepPadIndex=0,this.sweepIndex===gWe&&(this.phase="finalize")),this.progress=this.sweepIndex/257,this.stats={...this.stats,sweepCount:this.sweepIndex,projectedConstraintCount:this.projectedConstraintCount,lastProjectedConstraintBatchCount:e}}finalizeRoutes(){let{vertices:e,routes:t}=this;for(let n of e.values())for(let o of n.points)o.x=n.x,o.y=n.y;for(let n of t){n.vias=[];for(let o=1;o<n.route.length;o++){let r=n.route[o-1],i=n.route[o];r.z===i.z||r.toNextSegmentType==="through_obstacle"||n.vias.some((s)=>s.x===i.x&&s.y===i.y)||n.vias.push({x:i.x,y:i.y})}}this.solved=!0,this.progress=1}_step(){switch(this.phase){case"geometry":return this.prepareGeometry();case"pairs":return this.preparePairs();case"obstacles":return this.prepareObstacles();case"sweeps":return this.stepSweep();case"finalize":return this.finalizeRoutes()}}getOutput(){if(!this.solved||this.failed)throw Error("Trace clearance projection is not complete");return this.routes}getResult(){return this.getOutput()}},LCe={};wbe(LCe,{all_layers:()=>tS,any_circuit_element:()=>inn,any_soup_element:()=>FCe,any_source_component:()=>hJt,asset:()=>Tle,base_circuit_json_error:()=>_c,battery_capacity:()=>Rqt,brep_shape:()=>Gqe,cadModelDefaultDirectionMap:()=>Kfr,cad_cable:()=>btn,cad_collision_error:()=>Ctn,cad_component:()=>xtn,cad_model_axis_directions:()=>ytn,cad_model_formats:()=>jfr,cad_reference_surface:()=>vtn,capacitance:()=>pqe,circle_shape:()=>mqe,circuit_json_footprint_load_error:()=>Gen,current:()=>cQ,distance:()=>Bn,duration_ms:()=>Nq,experiment_type:()=>Ttn,external_footprint_load_error:()=>Yen,frequency:()=>IV,getRotationBetweenPcbPin1Locations:()=>bfr,getSimulationReturnCurrentGridJsonSchema:()=>Zfr,getZodPrefixedIdWithDefault:()=>vn,inductance:()=>Dqt,insertionDirectionToCanonical:()=>uZt,insertionDirectionToVector:()=>xfr,insertion_direction:()=>pZt,kicadAt:()=>Kbe,kicadEffects:()=>Qqt,kicadFont:()=>gqe,kicadFootprintAttributes:()=>Lqt,kicadFootprintMetadata:()=>zqt,kicadFootprintModel:()=>Fqt,kicadFootprintPad:()=>Hqt,kicadFootprintProperties:()=>kqt,kicadProperty:()=>Xae,kicadSymbolEffects:()=>Yqt,kicadSymbolMetadata:()=>Uqt,kicadSymbolPinNames:()=>Vqt,kicadSymbolPinNumbers:()=>Oqt,kicadSymbolProperties:()=>Gqt,kicadSymbolProperty:()=>UR,layer_ref:()=>Oi,layer_string:()=>Nje,length:()=>Go,manufacturing_drc_properties:()=>gZt,ms:()=>hg,ninePointAnchor:()=>kw,parseAndConvertSiUnit:()=>_b,pcbRenderLayer:()=>Afr,pcb_autorouting_error:()=>Wen,pcb_bend:()=>nen,pcb_board:()=>ten,pcb_breakout_point:()=>Zen,pcb_bus_length_skew_error:()=>GZt,pcb_bus_routing_constraint_error:()=>XZt,pcb_bus_routing_constraint_warning:()=>jZt,pcb_component:()=>AZt,pcb_component_invalid_layer_error:()=>ltn,pcb_component_missing_courtyard_warning:()=>$en,pcb_component_not_on_board_edge_error:()=>ctn,pcb_component_outside_board_error:()=>atn,pcb_connector_not_in_accessible_orientation_warning:()=>Ken,pcb_copper_pour:()=>stn,pcb_copper_pour_brep:()=>rtn,pcb_copper_pour_polygon:()=>itn,pcb_copper_pour_rect:()=>otn,pcb_copper_text:()=>gen,pcb_courtyard_circle:()=>Atn,pcb_courtyard_outline:()=>_tn,pcb_courtyard_overlap_error:()=>Nen,pcb_courtyard_pill:()=>ftn,pcb_courtyard_polygon:()=>gtn,pcb_courtyard_rect:()=>mtn,pcb_cutout:()=>Oen,pcb_cutout_circle:()=>Hen,pcb_cutout_path:()=>zen,pcb_cutout_polygon:()=>Fen,pcb_cutout_rect:()=>Len,pcb_debug_line:()=>yZt,pcb_debug_object:()=>CZt,pcb_debug_object_base:()=>Jbe,pcb_debug_point:()=>xZt,pcb_debug_rect:()=>fZt,pcb_fabrication_note_dimension:()=>Pen,pcb_fabrication_note_path:()=>ven,pcb_fabrication_note_rect:()=>Sen,pcb_fabrication_note_text:()=>Ien,pcb_fabricator_extra_charge_warning:()=>Jen,pcb_footprint_overlap_error:()=>Den,pcb_ground_plane:()=>etn,pcb_ground_plane_region:()=>ttn,pcb_group:()=>Uen,pcb_hole:()=>MZt,pcb_hole_circle_or_square_shape:()=>Pfr,pcb_hole_circle_shape:()=>vfr,pcb_hole_oval_shape:()=>Efr,pcb_hole_pill_shape:()=>Mfr,pcb_hole_rect_shape:()=>Sfr,pcb_hole_rotated_pill_shape:()=>wfr,pcb_keepout:()=>Qen,pcb_keepout_outline:()=>Ren,pcb_keepout_overlap_warning:()=>ken,pcb_manual_edit_conflict_warning:()=>jen,pcb_missing_footprint_error:()=>Ven,pcb_net:()=>ZZt,pcb_note_dimension:()=>Ten,pcb_note_line:()=>Ben,pcb_note_path:()=>wen,pcb_note_rect:()=>Men,pcb_note_text:()=>Een,pcb_packing_error:()=>hen,pcb_pad_pad_clearance_error:()=>utn,pcb_pad_trace_clearance_error:()=>ptn,pcb_panel:()=>cen,pcb_panelization_placement_error:()=>den,pcb_pin1_location:()=>Qje,pcb_placement_error:()=>len,pcb_plated_hole:()=>wZt,pcb_port:()=>BZt,pcb_port_not_connected_error:()=>JZt,pcb_port_not_matched_error:()=>qZt,pcb_preflight_routing_error:()=>Xen,pcb_route_hint:()=>mZt,pcb_route_hints:()=>Ifr,pcb_silkscreen_circle:()=>fen,pcb_silkscreen_graphic:()=>Cen,pcb_silkscreen_graphic_brep:()=>xen,pcb_silkscreen_line:()=>pen,pcb_silkscreen_oval:()=>yen,pcb_silkscreen_path:()=>men,pcb_silkscreen_pill:()=>ben,pcb_silkscreen_rect:()=>Aen,pcb_silkscreen_text:()=>_en,pcb_smtpad:()=>DZt,pcb_smtpad_pill:()=>TZt,pcb_solder_paste:()=>NZt,pcb_soldermask_opening:()=>RZt,pcb_stiffener:()=>aen,pcb_stiffener_polygon:()=>sen,pcb_stiffener_rect:()=>ien,pcb_text:()=>QZt,pcb_thermal_spoke:()=>ntn,pcb_trace:()=>zZt,pcb_trace_error:()=>KZt,pcb_trace_hint:()=>uen,pcb_trace_missing_error:()=>$Zt,pcb_trace_route_point:()=>FZt,pcb_trace_route_point_through_pad:()=>HZt,pcb_trace_route_point_via:()=>LZt,pcb_trace_route_point_wire:()=>kZt,pcb_trace_style_warning:()=>VZt,pcb_trace_too_long_error:()=>YZt,pcb_trace_too_long_warning:()=>UZt,pcb_trace_too_many_vias_warning:()=>WZt,pcb_trace_warning:()=>OZt,pcb_via:()=>een,pcb_via_clearance_error:()=>htn,pcb_via_trace_clearance_error:()=>dtn,point:()=>tr,point3:()=>pb,point_with_bulge:()=>dZt,polygon_shape:()=>Zce,port_arrangement:()=>QJt,position:()=>mfr,position3:()=>_fr,rect_shape:()=>jbe,resistance:()=>Wbe,ring:()=>Rje,rotated_rect_shape:()=>_qe,rotation:()=>Rh,route_hint_point:()=>_Zt,schematic_arc:()=>OJt,schematic_box:()=>BJt,schematic_circle:()=>zJt,schematic_component:()=>kJt,schematic_component_overlap_warning:()=>eZt,schematic_component_port_arrangement_by_sides:()=>RJt,schematic_component_port_arrangement_by_size:()=>NJt,schematic_component_styling_warning:()=>tZt,schematic_debug_line:()=>KJt,schematic_debug_object:()=>qJt,schematic_debug_object_base:()=>qbe,schematic_debug_point:()=>$Jt,schematic_debug_rect:()=>jJt,schematic_element_outside_sheet_warning:()=>oZt,schematic_error:()=>WJt,schematic_graphic:()=>rZt,schematic_group:()=>iZt,schematic_layout_error:()=>XJt,schematic_line:()=>HJt,schematic_manual_edit_conflict_warning:()=>ZJt,schematic_missing_sheet_warning:()=>hZt,schematic_net_label:()=>UJt,schematic_path:()=>TJt,schematic_pin_styles:()=>DJt,schematic_port:()=>GJt,schematic_rect:()=>FJt,schematic_sheet:()=>lZt,schematic_sheet_size:()=>cZt,schematic_sheet_styling_warning:()=>nZt,schematic_symbol:()=>LJt,schematic_table:()=>sZt,schematic_table_cell:()=>aZt,schematic_text:()=>YJt,schematic_text_part:()=>Yqe,schematic_trace:()=>VJt,schematic_voltage_probe:()=>JJt,simulation_ac_current_source:()=>wtn,simulation_ac_sweep_current_graph:()=>Wtn,simulation_ac_sweep_voltage_graph:()=>Utn,simulation_ac_voltage_source:()=>Ptn,simulation_complex_sample:()=>jqe,simulation_current_probe:()=>Htn,simulation_current_source:()=>Btn,simulation_dc_current_source:()=>Mtn,simulation_dc_operating_point_current:()=>Vtn,simulation_dc_operating_point_voltage:()=>Otn,simulation_dc_sweep_current_graph:()=>Gtn,simulation_dc_sweep_unit:()=>e6e,simulation_dc_sweep_voltage_graph:()=>Ytn,simulation_dc_voltage_source:()=>Stn,simulation_experiment:()=>Ntn,simulation_op_amp:()=>Xtn,simulation_oscilloscope_trace:()=>Ktn,simulation_parameter_sweep:()=>ztn,simulation_parameter_sweep_coordinate:()=>Lw,simulation_parameter_type:()=>Jfr,simulation_parameter_unit:()=>Xqe,simulation_pcb_return_current_field:()=>tnn,simulation_pcb_return_current_heatmap:()=>onn,simulation_pcb_return_current_marker:()=>rnn,simulation_pcb_return_current_result:()=>qtn,simulation_return_current_contact:()=>Lje,simulation_return_current_excitation:()=>$tn,simulation_return_current_field_asset:()=>Ztn,simulation_return_current_grid_json:()=>nnn,simulation_return_current_image_asset:()=>enn,simulation_spice_subcircuit:()=>jtn,simulation_switch:()=>ktn,simulation_terminal_port:()=>Hje,simulation_transient_current_graph:()=>Qtn,simulation_transient_voltage_graph:()=>Rtn,simulation_unknown_experiment_error:()=>Ftn,simulation_voltage_probe:()=>Ltn,simulation_voltage_source:()=>Etn,size:()=>Xbe,source_ambiguous_port_reference:()=>AJt,source_board:()=>gJt,source_bus:()=>MJt,source_component_availability_warning:()=>zqe,source_component_base:()=>ql,source_component_internal_connection:()=>uJt,source_component_misconfigured_error:()=>Vqe,source_component_pins_underspecified_warning:()=>IJt,source_confusing_net_name_warning:()=>EJt,source_failed_to_create_component_error:()=>iJt,source_group:()=>mJt,source_i2c_misconfigured_error:()=>Oqe,source_interconnect:()=>cJt,source_invalid_component_property_error:()=>Qqe,source_manually_placed_via:()=>yJt,source_missing_manufacturer_part_number_warning:()=>Hqe,source_missing_property_error:()=>rJt,source_motor:()=>$qt,source_net:()=>_Jt,source_no_ground_pin_defined_warning:()=>bJt,source_no_power_pin_defined_warning:()=>CJt,source_part_not_found_warning:()=>PJt,source_pcb_ground_plane:()=>fJt,source_pin_attributes:()=>eJt,source_pin_missing_trace_warning:()=>Lqe,source_pin_must_be_connected_error:()=>vJt,source_port:()=>dJt,source_printed_part:()=>jqt,source_project_metadata:()=>Rqe,source_property_ignored_warning:()=>sJt,source_refdes_convention_warning:()=>Fqe,source_runtime_error:()=>wJt,source_simple_ammeter:()=>Zqt,source_simple_battery:()=>bqe,source_simple_capacitor:()=>Aqe,source_simple_chip:()=>xqe,source_simple_connector:()=>oJt,source_simple_connector_standards:()=>nJt,source_simple_crystal:()=>tJt,source_simple_current_source:()=>qqt,source_simple_diode:()=>$be,source_simple_fiducial:()=>Wqt,source_simple_fuse:()=>Jqt,source_simple_ground:()=>Xqt,source_simple_inductor:()=>Iqe,source_simple_led:()=>yqe,source_simple_mosfet:()=>Tqe,source_simple_op_amp:()=>Dqe,source_simple_pin_header:()=>Pqe,source_simple_pinout:()=>Eqe,source_simple_potentiometer:()=>Sqe,source_simple_power_source:()=>Cqe,source_simple_push_button:()=>vqe,source_simple_resistor:()=>fqe,source_simple_resonator:()=>Mqe,source_simple_switch:()=>Nqe,source_simple_test_point:()=>Bqe,source_simple_transistor:()=>wqe,source_simple_voltage_probe:()=>aJt,source_simple_voltage_source:()=>lJt,source_subassembly:()=>Kqt,source_trace:()=>pJt,source_trace_not_connected_error:()=>kqe,source_unnamed_trace_warning:()=>xJt,spice_simulation_options:()=>Dtn,standard_shape:()=>gfr,supplier_footprint_mismatch_warning:()=>qen,supplier_name:()=>Rq,time:()=>pfr,timestamp:()=>Nqt,unknown_error_finding_part:()=>SJt,visible_layer:()=>a_,voltage:()=>gb,wave_shape:()=>Wqe});var HCe=(e)=>{let t=Math.round(1000*e)/1000;return`${Number(t.toFixed(3))}mm`},Bqt=new Map([["T",1000000000000],["G",1e9],["M",1e6],["K",1000],["k",1000],["",1],["m",0.001],["µ",0.000001],["μ",0.000001],["u",0.000001],["n",0.000000001],["p",0.000000000001],["f",0.000000000000001]]),dfr=[...Bqt.keys()];function Dzt(e){return Bqt.get(e)}var Tqt={Hz:{baseUnit:"Hz",variants:{MHz:1e6,kHz:1000,Hz:1}},g:{baseUnit:"g",variants:{kg:1000,g:1}},"Ω":{baseUnit:"Ω",variants:{"mΩ":0.001,mohm:0.001,mOhm:0.001,milliohm:0.001,"Ω":1,ohm:1,Ohm:1,"kΩ":1000,"KΩ":1000,kohm:1000,kOhm:1000,KOhm:1000,Kohm:1000,"MΩ":1e6,Mohm:1e6,MOhm:1e6,megohm:1e6,Megohm:1e6,"GΩ":1e9,Gohm:1e9,GOhm:1e9,"TΩ":1000000000000,Tohm:1000000000000,TOhm:1000000000000}},V:{baseUnit:"V",variants:{mV:0.001,V:1,kV:1000,KV:1000,MV:1e6,GV:1e9,TV:1000000000000}},A:{baseUnit:"A",variants:{"µA":0.000001,"μA":0.000001,mA:0.001,ma:0.001,A:1,kA:1000,MA:1e6}},F:{baseUnit:"F",variants:{pF:0.000000000001,nF:0.000000001,"µF":0.000001,"μF":0.000001,uF:0.000001,mF:0.001,F:1,kF:1000,KF:1000,MF:1e6}},H:{baseUnit:"H",variants:{pH:0.000000000001,nH:0.000000001,"µH":0.000001,"μH":0.000001,uH:0.000001,mH:0.001,H:1,kH:1000,KH:1000,MH:1e6}},ml:{baseUnit:"ml",variants:{ml:1,mL:1,l:1000,L:1000}},deg:{baseUnit:"deg",variants:{rad:180/Math.PI}},ms:{baseUnit:"ms",variants:{fs:0.000000000001,ps:0.000000001,ns:0.000001,us:0.001,"µs":0.001,"μs":0.001,ms:1,s:1000}},mm:{baseUnit:"mm",variants:{nm:0.000001,"µm":0.001,"μm":0.001,um:0.001,mm:1,cm:10,dm:100,m:1000,km:1e6,in:25.4,ft:304.8,IN:25.4,FT:304.8,yd:914.4,mi:1609344,mil:0.0254}}},Tje=new Set;for(let[e,t]of Object.entries(Tqt)){Tje.add(e);for(let n of Object.keys(t.variants))Tje.add(n)}function _b(e,t){if(e==null)return{parsedUnit:null,unitOfValue:null,value:null};if(typeof e=="string"&&e.match(/^-?[\d.]+$/))return{value:Number.parseFloat(e),parsedUnit:null,unitOfValue:null};if(typeof e=="number")return{value:e,parsedUnit:null,unitOfValue:null};if(typeof e=="object"&&"x"in e&&"y"in e){let l=_b(e.x,t),h=_b(e.x,t),d=_b(e.y,t);return h.value===null||d.value===null?{parsedUnit:null,unitOfValue:null,value:null}:{parsedUnit:l.parsedUnit,unitOfValue:l.unitOfValue,value:{x:h.value,y:d.value}}}let n=e.toString().split("").reverse().join(""),o=n.match(/[^\d\s]+/)?.[0];if(!o)throw Error(`Could not determine unit: "${e}"`);let r=o.split("").reverse().join(""),i=e.slice(0,-r.length),s=Dzt(r);if(t&&s!=null)return{parsedUnit:null,unitOfValue:t,value:Number.parseFloat(i)*s};if(s!=null&&!Tje.has(r))return{parsedUnit:null,unitOfValue:null,value:Number.parseFloat(i)*s};let{baseUnit:a,conversionFactor:c}=function(l){for(let h of Object.values(Tqt)){if(l in h.variants)return{baseUnit:h.baseUnit,conversionFactor:h.variants[l]};for(let[d,u]of Object.entries(h.variants)){if(!l.endsWith(d))continue;let _=Dzt(l.slice(0,-d.length));if(_!=null)return{baseUnit:h.baseUnit,conversionFactor:_*u}}}return{baseUnit:l,conversionFactor:1}}(r);return{parsedUnit:r,unitOfValue:a,value:c*Number.parseFloat(i)}}var ufr=dfr.filter((e)=>e!=="").sort((e,t)=>t.length-e.length).map((e)=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|"),Wbe=(new RegExp(`^([+-]?(?:\\d+(?:\\.\\d*)?|\\.\\d+)(?:[eE][+-]?\\d+)?)(?:(${ufr}))?$`),E.string().or(E.number()).transform((e)=>_b(e,"Ω").value)),pqe=E.string().or(E.number()).transform((e)=>_b(e,"F").value).transform((e)=>Number.parseFloat(e.toPrecision(12))),Dqt=E.string().or(E.number()).transform((e)=>_b(e,"H").value),gb=E.string().or(E.number()).transform((e)=>_b(e,"V").value),Go=E.string().or(E.number()).transform((e)=>_b(e).value),IV=E.string().or(E.number()).transform((e)=>_b(e,"Hz").value),Bn=Go,cQ=E.string().or(E.number()).transform((e)=>_b(e,"A").value),Nq=E.string().or(E.number()).transform((e)=>_b(e).value),pfr=Nq,hg=Nq,Nqt=E.string().datetime(),Rh=E.string().or(E.number()).transform((e)=>typeof e=="number"?e:e.endsWith("deg")?Number.parseFloat(e.split("deg")[0]):e.endsWith("rad")?180*Number.parseFloat(e.split("rad")[0])/Math.PI:Number.parseFloat(e)),Rqt=E.number().or(E.string().endsWith("mAh")).transform((e)=>{if(typeof e=="string"){let t=e.replace("mAh",""),n=Number.parseFloat(t);if(Number.isNaN(n))throw Error("Invalid capacity");return n}return e}).describe("Battery capacity in mAh"),tr=E.object({x:Bn,y:Bn}),mfr=tr,pb=E.object({x:Bn,y:Bn,z:Bn}),_fr=pb,Xbe=E.object({width:E.number(),height:E.number()}),aq=Bn.pipe(E.number().finite()),Dje=Bn.pipe(E.number().finite().positive()),mqe=E.object({shape:E.literal("circle"),x:aq,y:aq,radius:Dje}).strict(),jbe=E.object({shape:E.literal("rect"),x:aq,y:aq,width:Dje,height:Dje}).strict(),_qe=jbe.extend({shape:E.literal("rotated_rect"),ccw_rotation:Rh.pipe(E.number().finite())}),Zce=E.object({shape:E.literal("polygon"),points:E.array(tr.extend({x:aq,y:aq})).min(3).refine((e)=>{let t=e.reduce((n,o,r)=>{let i=e[(r+1)%e.length];return n+o.x*i.y-i.x*o.y},0);return Number.isFinite(t)&&t!==0},"Polygon boundary must enclose a nonzero area")}).strict(),gfr=E.discriminatedUnion("shape",[mqe,jbe,_qe,Zce]),vn=(e)=>E.string().optional().default(()=>`${e}_${((t)=>Array.from({length:t},()=>"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"[Math.floor(62*Math.random())]).join(""))(10)}`),kw=E.enum(["top_left","top_center","top_right","center_left","center","center_right","bottom_left","bottom_center","bottom_right"]),Afr=E.enum(["top_silkscreen","bottom_silkscreen","top_copper","bottom_copper","top_soldermask","bottom_soldermask","top_fabrication_note","bottom_fabrication_note","top_user_note","bottom_user_note","top_courtyard","bottom_courtyard","inner1_copper","inner2_copper","inner3_copper","inner4_copper","inner5_copper","inner6_copper","inner7_copper","inner8_copper","edge_cuts","drill"]),Tle=E.object({project_relative_path:E.string(),url:E.string(),mimetype:E.string()}),Kbe=tr.extend({rotation:Rh.optional()}),gqe=E.object({size:tr.optional(),thickness:Bn.optional()}),Qqt=E.object({font:gqe.optional()}),Xae=E.object({value:E.string(),at:Kbe.optional(),layer:E.string().optional(),uuid:E.string().optional(),hide:E.boolean().optional(),effects:Qqt.optional()}),kqt=E.object({Reference:Xae.optional(),Value:Xae.optional(),Datasheet:Xae.optional(),Description:Xae.optional()}),Lqt=E.object({through_hole:E.boolean().optional(),smd:E.boolean().optional(),exclude_from_pos_files:E.boolean().optional(),exclude_from_bom:E.boolean().optional()}),Hqt=E.object({name:E.string(),type:E.string(),shape:E.string().optional(),at:Kbe.optional(),size:tr.optional(),drill:Bn.optional(),layers:E.array(E.string()).optional(),removeUnusedLayers:E.boolean().optional(),uuid:E.string().optional()}),Fqt=E.object({path:E.string(),offset:pb.optional(),scale:pb.optional(),rotate:pb.optional()}),zqt=E.object({footprintName:E.string().optional(),version:E.union([E.number(),E.string()]).optional(),generator:E.string().optional(),generatorVersion:E.union([E.number(),E.string()]).optional(),layer:E.string().optional(),properties:kqt.optional(),attributes:Lqt.optional(),pads:E.array(Hqt).optional(),embeddedFonts:E.boolean().optional(),model:Fqt.optional()}),Oqt=E.object({hide:E.boolean().optional()}),Vqt=E.object({offset:Bn.optional(),hide:E.boolean().optional()}),Yqt=E.object({font:gqe.optional(),justify:E.union([E.string(),E.array(E.string())]).optional(),hide:E.boolean().optional()}),UR=E.object({value:E.string(),id:E.union([E.number(),E.string()]).optional(),at:Kbe.optional(),effects:Yqt.optional()}),Gqt=E.object({Reference:UR.optional(),Value:UR.optional(),Footprint:UR.optional(),Datasheet:UR.optional(),Description:UR.optional(),ki_keywords:UR.optional(),ki_fp_filters:UR.optional()}),Uqt=E.object({symbolName:E.string().optional(),extends:E.string().optional(),pinNumbers:Oqt.optional(),pinNames:Vqt.optional(),excludeFromSim:E.boolean().optional(),inBom:E.boolean().optional(),onBoard:E.boolean().optional(),properties:Gqt.optional(),embeddedFonts:E.boolean().optional()}),_c=E.object({error_type:E.string(),message:E.string(),is_fatal:E.boolean().optional()}),Rq=E.enum(["jlcpcb","macrofab","pcbway","digikey","mouser","lcsc"]),ql=E.object({type:E.literal("source_component"),ftype:E.string().optional(),source_component_id:E.string(),name:E.string(),manufacturer_part_number:E.string().optional(),supplier_part_numbers:E.record(Rq,E.array(E.string())).optional(),display_value:E.string().optional(),display_name:E.string().optional(),are_pins_interchangeable:E.boolean().optional(),internally_connected_source_port_ids:E.array(E.array(E.string())).optional(),source_group_id:E.string().optional(),subcircuit_id:E.string().optional()}),Aqe=ql.extend({ftype:E.literal("simple_capacitor"),capacitance:pqe,max_voltage_rating:gb.optional(),display_capacitance:E.string().optional(),max_decoupling_trace_length:Bn.optional()}),fqe=ql.extend({ftype:E.literal("simple_resistor"),resistance:Wbe,display_resistance:E.string().optional()}),$be=ql.extend({ftype:E.literal("simple_diode")}),Wqt=ql.extend({ftype:E.literal("simple_fiducial")}),yqe=$be.extend({ftype:E.literal("simple_led"),color:E.string().optional(),wavelength:E.string().optional()}),Xqt=ql.extend({ftype:E.literal("simple_ground")}),xqe=ql.extend({ftype:E.literal("simple_chip")}),jqt=ql.extend({ftype:E.literal("printedpart"),material:E.enum(["pla","petg","nylon"]).optional(),color:E.string().trim().min(1).optional()}),Kqt=ql.extend({ftype:E.literal("subassembly")}),$qt=ql.extend({ftype:E.literal("motor")}),Cqe=ql.extend({ftype:E.literal("simple_power_source"),voltage:gb}),qqt=ql.extend({ftype:E.literal("simple_current_source"),current:cQ,frequency:IV.optional(),peak_to_peak_current:cQ.optional(),wave_shape:E.enum(["sine","square","triangle","sawtooth","dc"]).optional().default("dc"),phase:E.number().optional(),duty_cycle:E.number().min(0).max(1).optional()}),Jqt=ql.extend({ftype:E.literal("simple_fuse"),current_rating_amps:E.number().describe("Nominal current in amps the fuse is rated for"),voltage_rating_volts:E.number().describe("Voltage rating in volts, e.g. ±5V would be 5")}),Zqt=ql.extend({ftype:E.literal("simple_ammeter")}),Nzt=E.union([E.number(),E.string().trim().regex(/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?\s*(?:[fpnumkKMGTµμ]?V?|V)?$/,"Expected a scalar voltage, optionally with SI units")]).pipe(gb).pipe(E.number().finite()),eJt=E.object({is_input:E.boolean().optional(),is_output:E.boolean().optional(),is_bidirectional:E.boolean().optional(),is_passive:E.boolean().optional(),can_use_tri_state:E.boolean().optional(),is_using_tri_state:E.boolean().optional(),can_use_open_collector:E.boolean().optional(),is_using_open_collector:E.boolean().optional(),can_use_open_emitter:E.boolean().optional(),is_using_open_emitter:E.boolean().optional(),is_gpio:E.boolean().optional(),highlight_color:E.string().optional(),must_be_connected:E.boolean().optional(),provides_power:E.boolean().optional(),requires_power:E.boolean().optional(),provides_ground:E.boolean().optional(),requires_ground:E.boolean().optional(),provides_voltage:Nzt.optional(),requires_voltage:Nzt.optional(),required_voltage_tolerance:E.number().finite().min(0).max(1).optional(),do_not_connect:E.boolean().optional(),include_in_board_pinout:E.boolean().optional(),can_use_internal_pullup:E.boolean().optional(),is_using_internal_pullup:E.boolean().optional(),needs_external_pullup:E.boolean().optional(),can_use_internal_pulldown:E.boolean().optional(),is_using_internal_pulldown:E.boolean().optional(),needs_external_pulldown:E.boolean().optional(),can_use_open_drain:E.boolean().optional(),is_using_open_drain:E.boolean().optional(),can_use_push_pull:E.boolean().optional(),is_using_push_pull:E.boolean().optional(),should_have_decoupling_capacitor:E.boolean().optional(),recommended_decoupling_capacitor_capacitance:E.union([E.string(),E.number()]).optional(),is_configured_for_i2c_sda:E.boolean().optional(),is_configured_for_i2c_scl:E.boolean().optional(),is_configured_for_spi_mosi:E.boolean().optional(),is_configured_for_spi_miso:E.boolean().optional(),is_configured_for_spi_sck:E.boolean().optional(),is_configured_for_spi_cs:E.boolean().optional(),is_configured_for_uart_tx:E.boolean().optional(),is_configured_for_uart_rx:E.boolean().optional(),supports_i2c_sda:E.boolean().optional(),supports_i2c_scl:E.boolean().optional(),supports_spi_mosi:E.boolean().optional(),supports_spi_miso:E.boolean().optional(),supports_spi_sck:E.boolean().optional(),supports_spi_cs:E.boolean().optional(),supports_uart_tx:E.boolean().optional(),supports_uart_rx:E.boolean().optional()}),bqe=ql.extend({ftype:E.literal("simple_battery"),capacity:Rqt}),Iqe=ql.extend({ftype:E.literal("simple_inductor"),inductance:Dqt,display_inductance:E.string().optional(),max_current_rating:E.number().optional()}),vqe=ql.extend({ftype:E.literal("simple_push_button")}),Sqe=ql.extend({ftype:E.literal("simple_potentiometer"),max_resistance:Wbe,display_max_resistance:E.string().optional()}),tJt=ql.extend({ftype:E.literal("simple_crystal"),frequency:E.number().describe("Frequency in Hz"),load_capacitance:E.number().optional().describe("Load capacitance in pF"),pin_variant:E.enum(["two_pin","four_pin"]).optional()}),Pqe=ql.extend({ftype:E.literal("simple_pin_header"),pin_count:E.number(),gender:E.enum(["male","female"]).optional().default("male")}),nJt=["usb_c","m2","jst_sh","jst_gh","jst_zh","jst_ph","jst_xh","jst_vh"],oJt=ql.extend({ftype:E.literal("simple_connector"),standard:E.enum(nJt).optional(),pin_count:E.number().int().positive().optional()}),Eqe=ql.extend({ftype:E.literal("simple_pinout")}),Mqe=ql.extend({ftype:E.literal("simple_resonator"),load_capacitance:pqe,equivalent_series_resistance:Wbe.optional(),frequency:IV}),wqe=ql.extend({ftype:E.literal("simple_transistor"),transistor_type:E.enum(["npn","pnp"])}),Bqe=ql.extend({ftype:E.literal("simple_test_point"),footprint_variant:E.enum(["pad","through_hole"]).optional(),pad_shape:E.enum(["rect","circle"]).optional(),pad_diameter:E.union([E.number(),E.string()]).optional(),hole_diameter:E.union([E.number(),E.string()]).optional(),width:E.union([E.number(),E.string()]).optional(),height:E.union([E.number(),E.string()]).optional()}),Tqe=ql.extend({ftype:E.literal("simple_mosfet"),channel_type:E.enum(["n","p"]),mosfet_mode:E.enum(["enhancement","depletion"])}),Dqe=ql.extend({ftype:E.literal("simple_op_amp")}),Nqe=ql.extend({ftype:E.literal("simple_switch")}),Rqe=E.object({type:E.literal("source_project_metadata"),name:E.string().optional(),software_used_string:E.string().optional(),project_url:E.string().optional(),source_filesystem_md5_hash:E.string().optional(),created_at:Nqt.optional()}),rJt=_c.extend({type:E.literal("source_missing_property_error"),source_missing_property_error_id:vn("source_missing_property_error"),source_component_id:E.string(),property_name:E.string(),subcircuit_id:E.string().optional(),error_type:E.literal("source_missing_property_error").default("source_missing_property_error")}).describe("The source code is missing a property"),iJt=_c.extend({type:E.literal("source_failed_to_create_component_error"),source_failed_to_create_component_error_id:vn("source_failed_to_create_component_error"),error_type:E.literal("source_failed_to_create_component_error").default("source_failed_to_create_component_error"),component_name:E.string().optional(),subcircuit_id:E.string().optional(),parent_source_component_id:E.string().optional(),pcb_center:E.object({x:E.number().optional(),y:E.number().optional()}).optional(),schematic_center:E.object({x:E.number().optional(),y:E.number().optional()}).optional()}).describe("Error emitted when a component fails to be constructed"),Qqe=_c.extend({type:E.literal("source_invalid_component_property_error"),source_invalid_component_property_error_id:vn("source_invalid_component_property_error"),source_component_id:E.string(),property_name:E.string(),property_value:E.unknown().optional(),expected_format:E.string().optional(),subcircuit_id:E.string().optional(),error_type:E.literal("source_invalid_component_property_error").default("source_invalid_component_property_error")}).describe("The source component property is invalid"),kqe=_c.extend({type:E.literal("source_trace_not_connected_error"),source_trace_not_connected_error_id:vn("source_trace_not_connected_error"),error_type:E.literal("source_trace_not_connected_error").default("source_trace_not_connected_error"),subcircuit_id:E.string().optional(),source_group_id:E.string().optional(),source_trace_id:E.string().optional(),connected_source_port_ids:E.array(E.string()).optional(),selectors_not_found:E.array(E.string()).optional()}).describe("Occurs when a source trace selector does not match any ports"),sJt=E.object({type:E.literal("source_property_ignored_warning"),source_property_ignored_warning_id:vn("source_property_ignored_warning"),source_component_id:E.string(),property_name:E.string(),subcircuit_id:E.string().optional(),error_type:E.literal("source_property_ignored_warning").default("source_property_ignored_warning"),message:E.string()}).describe("The source property was ignored"),Lqe=E.object({type:E.literal("source_pin_missing_trace_warning"),source_pin_missing_trace_warning_id:vn("source_pin_missing_trace_warning"),warning_type:E.literal("source_pin_missing_trace_warning").default("source_pin_missing_trace_warning"),message:E.string(),source_component_id:E.string(),source_port_id:E.string(),subcircuit_id:E.string().optional()}).describe("Warning emitted when a source component pin is missing a trace connection"),Hqe=E.object({type:E.literal("source_missing_manufacturer_part_number_warning"),source_missing_manufacturer_part_number_warning_id:vn("source_missing_manufacturer_part_number_warning"),warning_type:E.literal("source_missing_manufacturer_part_number_warning").default("source_missing_manufacturer_part_number_warning"),message:E.string(),source_component_id:E.string(),standard:E.string().optional(),subcircuit_id:E.string().optional()}).describe("Warning emitted when a source component is missing its manufacturer part number"),Fqe=E.object({type:E.literal("source_refdes_convention_warning"),source_refdes_convention_warning_id:vn("source_refdes_convention_warning"),warning_type:E.literal("source_refdes_convention_warning").default("source_refdes_convention_warning"),message:E.string(),source_component_id:E.string(),refdes:E.string(),source_component_ftype:E.string(),expected_prefixes:E.array(E.string()),actual_prefix:E.string().optional(),subcircuit_id:E.string().optional()}).describe("Warning emitted when a source component reference designator does not match the component type convention"),zqe=E.object({type:E.literal("source_component_availability_warning"),source_component_availability_warning_id:vn("source_component_availability_warning"),warning_type:E.literal("source_component_availability_warning").default("source_component_availability_warning"),message:E.string(),source_component_id:E.string(),subcircuit_id:E.string().optional(),supplier_name:Rq,supplier_part_numbers:E.array(E.string()).nonempty()}).describe("Warning emitted when no supplier alternative can be confirmed in stock. Availability may be unknown or change over time."),aJt=ql.extend({ftype:E.literal("simple_voltage_probe")}),cJt=ql.extend({ftype:E.literal("interconnect")}),Oqe=_c.extend({type:E.literal("source_i2c_misconfigured_error"),source_i2c_misconfigured_error_id:vn("source_i2c_misconfigured_error"),error_type:E.literal("source_i2c_misconfigured_error").default("source_i2c_misconfigured_error"),source_port_ids:E.array(E.string())}).describe("Error emitted when incompatible I2C pins (e.g. SDA and SCL) are connected to the same net"),Vqe=_c.extend({type:E.literal("source_component_misconfigured_error"),source_component_misconfigured_error_id:vn("source_component_misconfigured_error"),error_type:E.literal("source_component_misconfigured_error").default("source_component_misconfigured_error"),source_component_ids:E.array(E.string()),source_port_ids:E.array(E.string()).optional()}).describe("Error emitted when one or more source components have an invalid or conflicting configuration"),lJt=ql.extend({ftype:E.literal("simple_voltage_source"),voltage:gb,frequency:IV.optional(),peak_to_peak_voltage:gb.optional(),wave_shape:E.enum(["sinewave","square","triangle","sawtooth"]).optional(),phase:Rh.optional(),duty_cycle:E.number().optional().describe("Duty cycle as a fraction (0 to 1)"),pulse_delay:hg.optional(),rise_time:hg.optional(),fall_time:hg.optional(),pulse_width:hg.optional(),period:hg.optional()}),hJt=E.union([fqe,Aqe,$be,Wqt,yqe,Xqt,xqe,jqt,Kqt,$qt,Cqe,qqt,Zqt,bqe,Iqe,vqe,Sqe,tJt,Pqe,oJt,Eqe,Mqe,Nqe,wqe,Bqe,Tqe,Dqe,Jqt,aJt,cJt,lJt,Rqe,rJt,Qqe,iJt,kqe,sJt,Lqe,Hqe,Fqe,zqe,Oqe,Vqe]),dJt=E.object({type:E.literal("source_port"),pin_number:E.number().optional(),port_hints:E.array(E.string()).optional(),name:E.string(),source_port_id:E.string(),source_component_id:E.string().optional(),source_group_id:E.string().optional(),most_frequently_referenced_by_name:E.string().optional(),subcircuit_id:E.string().optional(),subcircuit_connectivity_map_key:E.string().optional()}).merge(eJt),uJt=E.object({type:E.literal("source_component_internal_connection"),source_component_internal_connection_id:E.string(),source_component_id:E.string(),source_port_ids:E.array(E.string()),subcircuit_id:E.string().optional()}),pJt=E.object({type:E.literal("source_trace"),source_trace_id:E.string(),connected_source_port_ids:E.array(E.string()),connected_source_net_ids:E.array(E.string()),subcircuit_id:E.string().optional(),subcircuit_connectivity_map_key:E.string().optional(),max_length:E.number().optional(),max_via_count:E.number().int().nonnegative().optional(),name:E.string().optional(),min_trace_thickness:E.number().optional(),display_name:E.string().optional()}),mJt=E.object({type:E.literal("source_group"),source_group_id:E.string(),subcircuit_id:E.string().optional(),parent_subcircuit_id:E.string().optional(),parent_source_group_id:E.string().optional(),is_subcircuit:E.boolean().optional(),show_as_schematic_box:E.boolean().optional(),name:E.string().optional(),was_automatically_named:E.boolean().optional()}),_Jt=E.object({type:E.literal("source_net"),source_net_id:E.string(),name:E.string(),member_source_group_ids:E.array(E.string()),is_power:E.boolean().optional(),is_ground:E.boolean().optional(),is_digital_signal:E.boolean().optional(),is_analog_signal:E.boolean().optional(),is_positive_voltage_source:E.boolean().optional(),trace_width:E.number().optional(),subcircuit_id:E.string().optional(),subcircuit_connectivity_map_key:E.string().optional()}),gJt=E.object({type:E.literal("source_board"),source_board_id:E.string(),source_group_id:E.string(),title:E.string().optional()}).describe("Defines a board in the source domain"),AJt=_c.extend({type:E.literal("source_ambiguous_port_reference"),source_ambiguous_port_reference_id:vn("source_ambiguous_port_reference"),error_type:E.literal("source_ambiguous_port_reference").default("source_ambiguous_port_reference"),source_port_id:E.string().optional(),source_component_id:E.string().optional()}).describe("Error emitted when a port hint matches multiple non-overlapping pads, making the port reference ambiguous"),fJt=E.object({type:E.literal("source_pcb_ground_plane"),source_pcb_ground_plane_id:E.string(),source_group_id:E.string(),source_net_id:E.string(),subcircuit_id:E.string().optional()}).describe("Defines a ground plane in the source domain"),tS=["top","bottom","inner1","inner2","inner3","inner4","inner5","inner6","inner7","inner8"],Nje=E.enum(tS),Oi=Nje.or(E.object({name:Nje})).transform((e)=>typeof e=="string"?e:e.name),a_=E.enum(["top","bottom"]),yJt=E.object({type:E.literal("source_manually_placed_via"),source_manually_placed_via_id:E.string(),source_group_id:E.string(),source_net_id:E.string().min(1).optional(),subcircuit_id:E.string().optional(),source_trace_id:E.string().optional()}).describe("Defines a via that is manually placed in the source domain"),xJt=E.object({type:E.literal("source_unnamed_trace_warning"),source_unnamed_trace_warning_id:vn("source_unnamed_trace_warning"),warning_type:E.literal("source_unnamed_trace_warning").default("source_unnamed_trace_warning"),message:E.string(),source_trace_id:E.string(),subcircuit_id:E.string().optional()}).describe("Warning emitted when a source trace is missing a name"),CJt=E.object({type:E.literal("source_no_power_pin_defined_warning"),source_no_power_pin_defined_warning_id:vn("source_no_power_pin_defined_warning"),warning_type:E.literal("source_no_power_pin_defined_warning").default("source_no_power_pin_defined_warning"),message:E.string(),source_component_id:E.string(),source_port_ids:E.array(E.string()),subcircuit_id:E.string().optional()}).describe("Warning emitted when a chip has no source ports with requires_power=true"),bJt=E.object({type:E.literal("source_no_ground_pin_defined_warning"),source_no_ground_pin_defined_warning_id:vn("source_no_ground_pin_defined_warning"),warning_type:E.literal("source_no_ground_pin_defined_warning").default("source_no_ground_pin_defined_warning"),message:E.string(),source_component_id:E.string(),source_port_ids:E.array(E.string()),subcircuit_id:E.string().optional()}).describe("Warning emitted when a chip has no source ports marked as ground pins"),IJt=E.object({type:E.literal("source_component_pins_underspecified_warning"),source_component_pins_underspecified_warning_id:vn("source_component_pins_underspecified_warning"),warning_type:E.literal("source_component_pins_underspecified_warning").default("source_component_pins_underspecified_warning"),message:E.string(),source_component_id:E.string(),source_port_ids:E.array(E.string()),subcircuit_id:E.string().optional()}).describe("Warning emitted when all ports on a source component are underspecified"),vJt=_c.extend({type:E.literal("source_pin_must_be_connected_error"),source_pin_must_be_connected_error_id:vn("source_pin_must_be_connected_error"),error_type:E.literal("source_pin_must_be_connected_error").default("source_pin_must_be_connected_error"),source_component_id:E.string(),source_port_id:E.string(),subcircuit_id:E.string().optional()}).describe("Error emitted when a pin with mustBeConnected attribute is not connected to any trace"),SJt=_c.extend({type:E.literal("unknown_error_finding_part"),unknown_error_finding_part_id:vn("unknown_error_finding_part"),error_type:E.literal("unknown_error_finding_part").default("unknown_error_finding_part"),source_component_id:E.string().optional(),subcircuit_id:E.string().optional()}).describe("Error emitted when an unexpected error occurs while finding a part"),PJt=E.object({type:E.literal("source_part_not_found_warning"),source_part_not_found_warning_id:vn("source_part_not_found_warning"),warning_type:E.literal("source_part_not_found_warning").default("source_part_not_found_warning"),message:E.string(),source_component_id:E.string().optional(),subcircuit_id:E.string().optional(),supplier_name:Rq.optional(),manufacturer_part_number:E.string().optional(),supplier_part_number:E.string().optional(),part_name:E.string().optional()}).describe("Warning emitted when a requested part can not be found"),EJt=E.object({type:E.literal("source_confusing_net_name_warning"),source_confusing_net_name_warning_id:vn("source_confusing_net_name_warning"),warning_type:E.literal("source_confusing_net_name_warning").default("source_confusing_net_name_warning"),message:E.string(),source_net_ids:E.array(E.string()).min(2),net_name:E.string(),subcircuit_id:E.string().optional()}).describe("Warning emitted when electrically disconnected source nets share a name"),fWe=E.union([E.number().nonnegative().finite(),E.object({reference:E.literal("longest_manhattan"),source_trace_ids:E.array(E.string()).min(1).optional(),offset:E.number().finite().optional()})]),Rzt=E.union([E.number().positive().finite(),E.object({width_multiplier:E.number().positive().finite()})]),MJt=E.object({type:E.literal("source_bus"),source_bus_id:E.string(),name:E.string().optional(),source_trace_ids:E.array(E.string()).min(1),max_length_skew:E.number().nonnegative().finite().optional(),target_impedance:E.number().positive().finite().optional(),target_differential_impedance:E.number().positive().finite().optional(),differential_pair:E.object({positive_source_trace_id:E.string(),negative_source_trace_id:E.string(),trace_gap:E.number().positive().finite().optional(),max_uncoupled_length:E.number().nonnegative().finite().optional()}).optional(),length_match_source_trace_ids:E.array(E.string()).min(1).optional(),min_length:fWe.optional(),max_length:fWe.optional(),target_length:fWe.optional(),length_tolerance:E.number().nonnegative().finite().optional(),pcb_trace_spacing:Rzt.optional(),pcb_spacing_to_other_signals:Rzt.optional(),target_impedance_min:E.number().positive().finite().optional(),target_impedance_max:E.number().positive().finite().optional(),target_differential_impedance_min:E.number().positive().finite().optional(),target_differential_impedance_max:E.number().positive().finite().optional(),subcircuit_id:E.string().optional()}),wJt=_c.pick({message:!0,error_type:!0}).extend({type:E.literal("source_runtime_error"),source_runtime_error_id:vn("source_runtime_error"),error_type:E.literal("source_runtime_error").default("source_runtime_error"),phase_name:E.string().optional()}).describe("An unexpected runtime failure while generating or validating a circuit"),BJt=E.object({type:E.literal("schematic_box"),schematic_sheet_id:E.string().optional(),schematic_component_id:E.string().optional(),schematic_symbol_id:E.string().optional(),width:Bn,height:Bn,is_dashed:E.boolean().default(!1),x:Bn,y:Bn,subcircuit_id:E.string().optional()}).describe("Draws a box on the schematic"),TJt=E.object({type:E.literal("schematic_path"),schematic_path_id:vn("schematic_path"),schematic_sheet_id:E.string().optional(),schematic_component_id:E.string().optional(),schematic_symbol_id:E.string().optional(),fill_color:E.string().optional(),is_filled:E.boolean().optional(),is_dashed:E.boolean().default(!1),stroke_width:Bn.nullable().optional(),stroke_color:E.string().optional(),dash_length:Bn.optional(),dash_gap:Bn.optional(),points:E.array(tr),subcircuit_id:E.string().optional()}),DJt=E.record(E.object({left_margin:Go.optional(),right_margin:Go.optional(),top_margin:Go.optional(),bottom_margin:Go.optional()})),NJt=E.object({left_size:E.number(),right_size:E.number(),top_size:E.number().optional(),bottom_size:E.number().optional()}),RJt=E.object({left_side:E.object({pins:E.array(E.number()),direction:E.enum(["top-to-bottom","bottom-to-top"]).optional()}).optional(),right_side:E.object({pins:E.array(E.number()),direction:E.enum(["top-to-bottom","bottom-to-top"]).optional()}).optional(),top_side:E.object({pins:E.array(E.number()),direction:E.enum(["left-to-right","right-to-left"]).optional()}).optional(),bottom_side:E.object({pins:E.array(E.number()),direction:E.enum(["left-to-right","right-to-left"]).optional()}).optional()}),QJt=E.union([NJt,RJt]),kJt=E.object({type:E.literal("schematic_component"),size:Xbe,center:tr,source_component_id:E.string().optional(),schematic_component_id:E.string(),schematic_sheet_id:E.string().optional(),schematic_symbol_id:E.string().optional(),pin_spacing:Go.optional(),pin_styles:DJt.optional(),box_width:Go.optional(),symbol_name:E.string().optional(),port_arrangement:QJt.optional(),port_labels:E.record(E.string()).optional(),symbol_display_value:E.string().optional(),subcircuit_id:E.string().optional(),schematic_group_id:E.string().optional(),is_schematic_group:E.boolean().optional(),source_group_id:E.string().optional(),is_box_with_pins:E.boolean().optional().default(!0)}),ffr=E.object({kicad_symbol:Uqt.optional()}).catchall(E.unknown()),LJt=E.object({type:E.literal("schematic_symbol"),schematic_symbol_id:E.string(),name:E.string().optional(),metadata:ffr.optional()}).describe("Defines a named schematic symbol that can be referenced by components."),HJt=E.object({type:E.literal("schematic_line"),schematic_line_id:vn("schematic_line"),schematic_sheet_id:E.string().optional(),schematic_component_id:E.string().optional(),schematic_symbol_id:E.string().optional(),x1:Bn,y1:Bn,x2:Bn,y2:Bn,stroke_width:Bn.nullable().optional(),color:E.string().default("#000000"),is_dashed:E.boolean().default(!1),dash_length:Bn.optional(),dash_gap:Bn.optional(),subcircuit_id:E.string().optional()}).describe("Draws a styled line on the schematic"),FJt=E.object({type:E.literal("schematic_rect"),schematic_rect_id:vn("schematic_rect"),schematic_sheet_id:E.string().optional(),schematic_component_id:E.string().optional(),schematic_symbol_id:E.string().optional(),center:tr,width:Bn,height:Bn,rotation:Rh.default(0),stroke_width:Bn.nullable().optional(),color:E.string().default("#000000"),is_filled:E.boolean().default(!1),fill_color:E.string().optional(),is_dashed:E.boolean().default(!1),subcircuit_id:E.string().optional()}).describe("Draws a styled rectangle on the schematic"),zJt=E.object({type:E.literal("schematic_circle"),schematic_circle_id:vn("schematic_circle"),schematic_sheet_id:E.string().optional(),schematic_component_id:E.string().optional(),schematic_symbol_id:E.string().optional(),center:tr,radius:Bn,stroke_width:Bn.nullable().optional(),color:E.string().default("#000000"),is_filled:E.boolean().default(!1),fill_color:E.string().optional(),is_dashed:E.boolean().default(!1),subcircuit_id:E.string().optional()}).describe("Draws a styled circle on the schematic"),OJt=E.object({type:E.literal("schematic_arc"),schematic_arc_id:vn("schematic_arc"),schematic_sheet_id:E.string().optional(),schematic_component_id:E.string().optional(),schematic_symbol_id:E.string().optional(),center:tr,radius:Bn,start_angle_degrees:Rh,end_angle_degrees:Rh,direction:E.enum(["clockwise","counterclockwise"]).default("counterclockwise"),stroke_width:Bn.nullable().optional(),color:E.string().default("#000000"),is_dashed:E.boolean().default(!1),subcircuit_id:E.string().optional()}).describe("Draws a styled arc on the schematic"),VJt=E.object({type:E.literal("schematic_trace"),schematic_trace_id:E.string(),schematic_sheet_id:E.string().optional(),source_trace_id:E.string().optional(),junctions:E.array(E.object({x:E.number(),y:E.number()})),edges:E.array(E.object({from:E.object({x:E.number(),y:E.number()}),to:E.object({x:E.number(),y:E.number()}),is_crossing:E.boolean().optional(),from_schematic_port_id:E.string().optional(),to_schematic_port_id:E.string().optional()})),subcircuit_id:E.string().optional(),subcircuit_connectivity_map_key:E.string().optional()}),yfr=E.enum(["center","left","right","top","bottom"]),Yqe=E.object({text:E.string(),is_overlined:E.boolean().optional()}),YJt=E.object({type:E.literal("schematic_text"),schematic_sheet_id:E.string().optional(),schematic_component_id:E.string().optional(),schematic_symbol_id:E.string().optional(),schematic_text_id:E.string(),source_trace_id:E.string().optional(),text:E.string(),text_parts:E.array(Yqe).min(1).optional(),display_superscript:E.string().optional(),font_size:E.number().default(0.18),position:E.object({x:Bn,y:Bn}),rotation:E.number().default(0),anchor:E.union([yfr.describe("legacy"),kw]).default("center"),color:E.string().default("#000000"),subcircuit_id:E.string().optional()}),GJt=E.object({type:E.literal("schematic_port"),schematic_port_id:E.string(),source_port_id:E.string(),schematic_sheet_id:E.string().optional(),schematic_component_id:E.string().optional(),center:tr,facing_direction:E.enum(["up","down","left","right"]).optional(),distance_from_component_edge:E.number().optional(),side_of_component:E.enum(["top","bottom","left","right"]).optional(),true_ccw_index:E.number().optional(),pin_number:E.number().optional(),display_pin_label:E.string().optional(),display_pin_label_text_parts:E.array(Yqe).min(1).optional(),display_pin_label_font_size:E.number().positive().finite().optional(),subcircuit_id:E.string().optional(),is_connected:E.boolean().optional(),is_internal_circuit_port:E.boolean().optional(),is_overlapping_internal_circuit_port:E.boolean().optional(),has_input_arrow:E.boolean().optional(),has_output_arrow:E.boolean().optional(),is_drawn_with_inversion_circle:E.boolean().optional()}).describe("Defines a port on a schematic component"),UJt=E.object({type:E.literal("schematic_net_label"),schematic_net_label_id:vn("schematic_net_label"),schematic_sheet_id:E.string().optional(),schematic_trace_id:E.string().optional(),source_trace_id:E.string().optional(),source_net_id:E.string(),center:tr,anchor_position:tr.optional(),anchor_side:E.enum(["top","bottom","left","right"]),text:E.string(),display_superscript:E.string().optional(),symbol_name:E.string().optional(),is_movable:E.boolean().optional(),subcircuit_id:E.string().optional()}),WJt=_c.extend({type:E.literal("schematic_error"),schematic_error_id:E.string(),error_type:E.literal("schematic_port_not_found").default("schematic_port_not_found"),subcircuit_id:E.string().optional()}).describe("Defines a schematic error on the schematic"),XJt=_c.extend({type:E.literal("schematic_layout_error"),schematic_layout_error_id:vn("schematic_layout_error"),error_type:E.literal("schematic_layout_error").default("schematic_layout_error"),source_group_id:E.string(),schematic_group_id:E.string(),subcircuit_id:E.string().optional()}).describe("Error emitted when schematic layout fails for a group"),qbe=E.object({type:E.literal("schematic_debug_object"),label:E.string().optional(),subcircuit_id:E.string().optional()}),jJt=qbe.extend({shape:E.literal("rect"),center:tr,size:Xbe}),KJt=qbe.extend({shape:E.literal("line"),start:tr,end:tr}),$Jt=qbe.extend({shape:E.literal("point"),center:tr}),qJt=E.discriminatedUnion("shape",[jJt,KJt,$Jt]),JJt=E.object({type:E.literal("schematic_voltage_probe"),schematic_voltage_probe_id:E.string(),schematic_sheet_id:E.string().optional(),source_component_id:E.string().optional(),name:E.string().optional(),position:tr,schematic_trace_id:E.string(),voltage:gb.optional(),subcircuit_id:E.string().optional(),color:E.string().optional(),label_alignment:kw.optional()}).describe("Defines a voltage probe measurement point on a schematic trace"),ZJt=E.object({type:E.literal("schematic_manual_edit_conflict_warning"),schematic_manual_edit_conflict_warning_id:vn("schematic_manual_edit_conflict_warning"),warning_type:E.literal("schematic_manual_edit_conflict_warning").default("schematic_manual_edit_conflict_warning"),message:E.string(),schematic_component_id:E.string(),schematic_group_id:E.string().optional(),subcircuit_id:E.string().optional(),source_component_id:E.string()}).describe("Warning emitted when a component has both manual placement and explicit schX/schY coordinates"),eZt=E.object({type:E.literal("schematic_component_overlap_warning"),schematic_component_overlap_warning_id:vn("schematic_component_overlap_warning"),warning_type:E.literal("schematic_component_overlap_warning").default("schematic_component_overlap_warning"),message:E.string(),schematic_component_ids:E.tuple([E.string(),E.string()]),schematic_sheet_id:E.string().optional()}).describe("Warning emitted when the rendered bounds of two schematic components overlap"),tZt=E.object({type:E.literal("schematic_component_styling_warning"),schematic_component_styling_warning_id:vn("schematic_component_styling_warning"),warning_type:E.literal("schematic_component_styling_warning").default("schematic_component_styling_warning"),message:E.string(),schematic_component_id:E.string(),styling_issue_type:E.string(),schematic_port_ids:E.array(E.string()).optional(),source_component_id:E.string().optional(),schematic_sheet_id:E.string().optional(),subcircuit_id:E.string().optional()}).describe("Warning emitted when a schematic component has a visual styling issue"),nZt=E.object({type:E.literal("schematic_sheet_styling_warning"),schematic_sheet_styling_warning_id:vn("schematic_sheet_styling_warning"),warning_type:E.literal("schematic_sheet_styling_warning").default("schematic_sheet_styling_warning"),message:E.string(),schematic_sheet_id:E.string(),styling_issue_type:E.literal("non_default_sheet_size"),subcircuit_id:E.string().optional()}).describe("Style warning emitted when a schematic sheet uses a non-default size"),oZt=E.object({type:E.literal("schematic_element_outside_sheet_warning"),schematic_element_outside_sheet_warning_id:vn("schematic_element_outside_sheet_warning"),warning_type:E.literal("schematic_element_outside_sheet_warning").default("schematic_element_outside_sheet_warning"),message:E.string(),schematic_sheet_id:E.string(),schematic_element_type:E.enum(["schematic_component","schematic_net_label","schematic_trace"]),schematic_element_id:E.string()}).describe("Warning emitted when a schematic component, net label, or trace extends outside its schematic sheet"),Qzt=Bn.pipe(E.number().positive().finite()),rZt=E.object({type:E.literal("schematic_graphic"),schematic_graphic_id:vn("schematic_graphic"),schematic_sheet_id:E.string().optional(),asset:Tle.optional(),svg_content:E.string().optional(),width:Qzt.optional(),height:Qzt.optional()}).describe("References a graphic asset or inline SVG content with optional centered layout bounds on a schematic sheet").superRefine(({asset:e,svg_content:t},n)=>{e===void 0&&t===void 0&&n.addIssue({code:E.ZodIssueCode.custom,message:"At least one of asset or svg_content is required"})}),iZt=E.object({type:E.literal("schematic_group"),schematic_group_id:vn("schematic_group"),schematic_sheet_id:E.string().optional(),source_group_id:E.string(),is_subcircuit:E.boolean().optional(),subcircuit_id:E.string().optional(),width:Go,height:Go,center:tr,schematic_component_ids:E.array(E.string()),show_as_schematic_box:E.boolean().optional(),name:E.string().optional(),description:E.string().optional()}).describe("Defines a group of components on the schematic"),sZt=E.object({type:E.literal("schematic_table"),schematic_table_id:vn("schematic_table"),schematic_sheet_id:E.string().optional(),anchor_position:tr,column_widths:E.array(Bn),row_heights:E.array(Bn),cell_padding:Bn.optional(),border_width:Bn.optional(),subcircuit_id:E.string().optional(),schematic_component_id:E.string().optional(),anchor:kw.optional()}).describe("Defines a table on the schematic"),aZt=E.object({type:E.literal("schematic_table_cell"),schematic_table_cell_id:vn("schematic_table_cell"),schematic_sheet_id:E.string().optional(),schematic_table_id:E.string(),start_row_index:E.number(),end_row_index:E.number(),start_column_index:E.number(),end_column_index:E.number(),text:E.string().optional(),center:tr,width:Bn,height:Bn,horizontal_align:E.enum(["left","center","right"]).optional(),vertical_align:E.enum(["top","middle","bottom"]).optional(),font_size:Bn.optional(),subcircuit_id:E.string().optional()}).describe("Defines a cell within a schematic_table"),cZt=E.enum(["a4","ansi_b"]),lZt=E.object({type:E.literal("schematic_sheet"),schematic_sheet_id:vn("schematic_sheet"),name:E.string().optional(),sheet_index:E.number().optional(),sheet_size:cZt.optional(),sheet_width:E.number().positive().optional(),sheet_height:E.number().positive().optional(),subcircuit_id:E.string().optional(),outline_color:E.string().optional()}).describe("Defines a schematic sheet or page that components can be placed on"),hZt=E.object({type:E.literal("schematic_missing_sheet_warning"),schematic_missing_sheet_warning_id:vn("schematic_missing_sheet_warning"),warning_type:E.literal("schematic_missing_sheet_warning").default("schematic_missing_sheet_warning"),message:E.string()}).describe("Circuit-wide warning emitted when a schematic has no schematic sheet. Display as a banner without attaching it to a component or drawing a target outline or leader line."),dZt=E.object({x:Bn,y:Bn,bulge:E.number().optional()}),Rje=E.object({vertices:E.array(dZt)}),Gqe=E.object({outer_ring:Rje,inner_rings:E.array(Rje).default([])}),uZt={from_left:"from_left",from_right:"from_right",from_top:"from_top",from_bottom:"from_bottom",from_above:"from_above",from_below:"from_below",from_x_neg:"from_left",from_x_pos:"from_right",from_y_pos:"from_top",from_y_neg:"from_bottom",from_z_pos:"from_above",from_z_neg:"from_below",from_front:"from_top",from_back:"from_bottom"},xfr={from_left:{x:-1,y:0,z:0},from_right:{x:1,y:0,z:0},from_top:{x:0,y:1,z:0},from_bottom:{x:0,y:-1,z:0},from_above:{x:0,y:0,z:1},from_below:{x:0,y:0,z:-1}},pZt=E.enum(["from_left","from_right","from_top","from_bottom","from_above","from_below","from_x_neg","from_x_pos","from_y_pos","from_y_neg","from_z_pos","from_z_neg","from_front","from_back"]).transform((e)=>uZt[e]).describe('The side exposing the receptacle where the cable or mating part is attached, following the 2D PCB diagram convention, not a 3D viewport frame. In project coordinate space, "from_top" is +Y, "from_bottom" -Y, "from_left" -X, "from_right" +X, "from_above" +Z and "from_below" -Z. A receptacle on the +Y edge is "from_top" even though the plug moves in -Y as it seats. Cartesian spellings such as "from_y_pos" are accepted and normalized to the named values, as are the deprecated "from_front" (now "from_top") and "from_back" (now "from_bottom").'),Qje=E.enum(["leftside_top","leftside_bottom","rightside_top","rightside_bottom","topside_left","topside_right","bottomside_left","bottomside_right"]),Cfr=[["leftside_top","bottomside_left","rightside_bottom","topside_right"],["leftside_bottom","bottomside_right","rightside_top","topside_left"]],bfr=(e,t)=>{for(let n of Cfr){let o=n.indexOf(e),r=n.indexOf(t);if(o!==-1&&r!==-1)return(r-o+n.length)%n.length*90}return null},mZt=E.object({x:Bn,y:Bn,via:E.boolean().optional(),via_to_layer:Oi.optional()}),Ifr=E.array(mZt),_Zt=E.object({x:Bn,y:Bn,via:E.boolean().optional(),to_layer:Oi.optional(),trace_width:Bn.optional()}),gZt=E.object({min_trace_width:Go.optional(),min_board_edge_clearance:Go.optional(),min_via_hole_edge_to_via_hole_edge_clearance:Go.optional(),min_plated_hole_drill_edge_to_drill_edge_clearance:Go.optional(),min_trace_to_pad_edge_clearance:Go.optional(),min_trace_to_hole_edge_clearance:Go.optional().describe("Minimum distance from a trace copper edge to a non-plated hole edge, in mm. No default is applied when omitted."),min_pad_edge_to_pad_edge_clearance:Go.optional(),min_same_net_trace_edge_to_trace_edge_clearance:Go.optional(),min_different_net_trace_edge_to_trace_edge_clearance:Go.optional(),min_via_edge_to_pad_edge_clearance:Go.optional(),min_via_hole_diameter:Go.optional(),min_via_pad_diameter:Go.optional()}),AZt=E.object({type:E.literal("pcb_component"),pcb_component_id:vn("pcb_component"),source_component_id:E.string(),center:tr,layer:Oi,rotation:Rh,display_offset_x:E.string().optional().describe("How to display the x offset for this part, usually corresponding with how the user specified it"),display_offset_y:E.string().optional().describe("How to display the y offset for this part, usually corresponding with how the user specified it"),width:Go,height:Go,do_not_place:E.boolean().optional(),is_allowed_to_be_off_board:E.boolean().optional(),subcircuit_id:E.string().optional(),pcb_group_id:E.string().optional(),position_mode:E.enum(["packed","relative_to_group_anchor","relative_to_another_component","none"]).optional(),anchor_position:tr.optional(),anchor_alignment:kw.optional(),positioned_relative_to_pcb_group_id:E.string().optional(),positioned_relative_to_pcb_board_id:E.string().optional(),cable_insertion_center:tr.optional(),insertion_direction:pZt.optional(),pin1_location:Qje.optional().describe("Location of pin 1 on the unrotated, top-view component footprint"),supplier_pin1_location_map:E.record(Rq,Qje).optional().describe("Pin 1 location for each supplier's unrotated, top-view footprint"),metadata:E.object({kicad_footprint:zqt.optional()}).optional(),obstructs_within_bounds:E.boolean().default(!0).describe("Does this component take up all the space within its bounds on a layer. This is generally true except for when separated pin headers are being represented by a single component (in which case, chips can be placed between the pin headers) or for tall modules where chips fit underneath")}).describe("Defines a component on the PCB"),Jbe=E.object({type:E.literal("pcb_debug_object"),pcb_debug_object_id:vn("pcb_debug_object"),label:E.string().optional(),subcircuit_id:E.string().optional()}),fZt=Jbe.extend({shape:E.literal("rect"),center:tr,size:Xbe}),yZt=Jbe.extend({shape:E.literal("line"),start:tr,end:tr}),xZt=Jbe.extend({shape:E.literal("point"),center:tr}),CZt=E.discriminatedUnion("shape",[fZt,yZt,xZt]),bZt=E.object({type:E.literal("pcb_hole"),pcb_hole_id:vn("pcb_hole"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),pcb_component_id:E.string().optional(),hole_shape:E.literal("circle"),hole_diameter:E.number(),x:Bn,y:Bn,is_covered_with_solder_mask:E.boolean().optional(),soldermask_margin:E.number().optional()}),vfr=bZt.describe("Defines a circular hole on the PCB"),IZt=E.object({type:E.literal("pcb_hole"),pcb_hole_id:vn("pcb_hole"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),pcb_component_id:E.string().optional(),hole_shape:E.literal("rect"),hole_width:E.number(),hole_height:E.number(),x:Bn,y:Bn,is_covered_with_solder_mask:E.boolean().optional(),soldermask_margin:E.number().optional()}),Sfr=IZt.describe("Defines a rectangular (square-capable) hole on the PCB. Use equal width/height for square."),vZt=E.object({type:E.literal("pcb_hole"),pcb_hole_id:vn("pcb_hole"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),pcb_component_id:E.string().optional(),hole_shape:E.enum(["circle","square"]),hole_diameter:E.number(),x:Bn,y:Bn,is_covered_with_solder_mask:E.boolean().optional(),soldermask_margin:E.number().optional()}),Pfr=vZt.describe("Defines a circular or square hole on the PCB"),SZt=E.object({type:E.literal("pcb_hole"),pcb_hole_id:vn("pcb_hole"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),pcb_component_id:E.string().optional(),hole_shape:E.literal("oval"),hole_width:E.number(),hole_height:E.number(),x:Bn,y:Bn,is_covered_with_solder_mask:E.boolean().optional(),soldermask_margin:E.number().optional()}),Efr=SZt.describe("Defines an oval hole on the PCB"),PZt=E.object({type:E.literal("pcb_hole"),pcb_hole_id:vn("pcb_hole"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),pcb_component_id:E.string().optional(),hole_shape:E.literal("pill"),hole_width:E.number(),hole_height:E.number(),x:Bn,y:Bn,is_covered_with_solder_mask:E.boolean().optional(),soldermask_margin:E.number().optional()}),Mfr=PZt.describe("Defines a pill-shaped hole on the PCB"),EZt=E.object({type:E.literal("pcb_hole"),pcb_hole_id:vn("pcb_hole"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),pcb_component_id:E.string().optional(),hole_shape:E.literal("rotated_pill"),hole_width:E.number(),hole_height:E.number(),x:Bn,y:Bn,ccw_rotation:Rh,is_covered_with_solder_mask:E.boolean().optional(),soldermask_margin:E.number().optional()}),wfr=EZt.describe("Defines a rotated pill-shaped hole on the PCB"),MZt=vZt.or(SZt).or(PZt).or(EZt).or(bZt).or(IZt),Bfr=E.object({type:E.literal("pcb_plated_hole"),shape:E.literal("circle"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),outer_diameter:E.number(),hole_diameter:E.number(),is_covered_with_solder_mask:E.boolean().optional(),x:Bn,y:Bn,layers:E.array(Oi),port_hints:E.array(E.string()).optional(),pcb_component_id:E.string().optional(),pcb_port_id:E.string().optional(),pcb_plated_hole_id:vn("pcb_plated_hole"),soldermask_margin:E.number().optional()}),Tfr=E.object({type:E.literal("pcb_plated_hole"),shape:E.enum(["oval","pill"]),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),outer_width:E.number(),outer_height:E.number(),hole_width:E.number(),hole_height:E.number(),is_covered_with_solder_mask:E.boolean().optional(),x:Bn,y:Bn,ccw_rotation:Rh,layers:E.array(Oi),port_hints:E.array(E.string()).optional(),pcb_component_id:E.string().optional(),pcb_port_id:E.string().optional(),pcb_plated_hole_id:vn("pcb_plated_hole"),soldermask_margin:E.number().optional()}),Dfr=E.object({type:E.literal("pcb_plated_hole"),shape:E.literal("circular_hole_with_rect_pad"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),hole_shape:E.literal("circle"),pad_shape:E.literal("rect"),hole_diameter:E.number(),rect_pad_width:E.number(),rect_pad_height:E.number(),rect_border_radius:E.number().optional(),hole_offset_x:Bn.default(0),hole_offset_y:Bn.default(0),is_covered_with_solder_mask:E.boolean().optional(),x:Bn,y:Bn,layers:E.array(Oi),port_hints:E.array(E.string()).optional(),pcb_component_id:E.string().optional(),pcb_port_id:E.string().optional(),pcb_plated_hole_id:vn("pcb_plated_hole"),soldermask_margin:E.number().optional(),rect_ccw_rotation:Rh.optional()}),Nfr=E.object({type:E.literal("pcb_plated_hole"),shape:E.literal("pill_hole_with_rect_pad"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),hole_shape:E.literal("pill"),pad_shape:E.literal("rect"),hole_width:E.number(),hole_height:E.number(),rect_pad_width:E.number(),rect_pad_height:E.number(),rect_border_radius:E.number().optional(),hole_offset_x:Bn.default(0),hole_offset_y:Bn.default(0),is_covered_with_solder_mask:E.boolean().optional(),x:Bn,y:Bn,layers:E.array(Oi),port_hints:E.array(E.string()).optional(),pcb_component_id:E.string().optional(),pcb_port_id:E.string().optional(),pcb_plated_hole_id:vn("pcb_plated_hole"),soldermask_margin:E.number().optional()}),Rfr=E.object({type:E.literal("pcb_plated_hole"),shape:E.literal("rotated_pill_hole_with_rect_pad"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),hole_shape:E.literal("rotated_pill"),pad_shape:E.literal("rect"),hole_width:E.number(),hole_height:E.number(),hole_ccw_rotation:Rh,rect_pad_width:E.number(),rect_pad_height:E.number(),rect_border_radius:E.number().optional(),rect_ccw_rotation:Rh,hole_offset_x:Bn.default(0),hole_offset_y:Bn.default(0),is_covered_with_solder_mask:E.boolean().optional(),x:Bn,y:Bn,layers:E.array(Oi),port_hints:E.array(E.string()).optional(),pcb_component_id:E.string().optional(),pcb_port_id:E.string().optional(),pcb_plated_hole_id:vn("pcb_plated_hole"),soldermask_margin:E.number().optional()}),Qfr=E.object({type:E.literal("pcb_plated_hole"),shape:E.literal("hole_with_polygon_pad"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),hole_shape:E.enum(["circle","oval","pill","rotated_pill"]),hole_diameter:E.number().optional(),hole_width:E.number().optional(),hole_height:E.number().optional(),pad_outline:E.array(E.object({x:Bn,y:Bn})).min(3),hole_offset_x:Bn.default(0),hole_offset_y:Bn.default(0),is_covered_with_solder_mask:E.boolean().optional(),x:Bn,y:Bn,layers:E.array(Oi),port_hints:E.array(E.string()).optional(),pcb_component_id:E.string().optional(),pcb_port_id:E.string().optional(),pcb_plated_hole_id:vn("pcb_plated_hole"),soldermask_margin:E.number().optional(),ccw_rotation:Rh.optional()}),wZt=E.union([Bfr,Tfr,Dfr,Nfr,Rfr,Qfr]),BZt=E.object({type:E.literal("pcb_port"),pcb_port_id:vn("pcb_port"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),source_port_id:E.string(),pcb_component_id:E.string().optional(),x:Bn,y:Bn,layers:E.array(Oi),is_board_pinout:E.boolean().optional()}).describe("Defines a port on the PCB"),kfr=E.object({type:E.literal("pcb_smtpad"),shape:E.literal("circle"),pcb_smtpad_id:vn("pcb_smtpad"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),x:Bn,y:Bn,radius:E.number(),layer:Oi,port_hints:E.array(E.string()).optional(),pcb_component_id:E.string().optional(),pcb_port_id:E.string().optional(),is_covered_with_solder_mask:E.boolean().optional(),soldermask_margin:E.number().optional(),solderpaste_margin:E.number().optional()}),Lfr=E.object({type:E.literal("pcb_smtpad"),shape:E.literal("rect"),pcb_smtpad_id:vn("pcb_smtpad"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),x:Bn,y:Bn,width:E.number(),height:E.number(),rect_border_radius:E.number().optional(),corner_radius:E.number().optional(),layer:Oi,port_hints:E.array(E.string()).optional(),pcb_component_id:E.string().optional(),pcb_port_id:E.string().optional(),is_covered_with_solder_mask:E.boolean().optional(),soldermask_margin:E.number().optional(),soldermask_margin_left:E.number().optional(),soldermask_margin_top:E.number().optional(),soldermask_margin_right:E.number().optional(),soldermask_margin_bottom:E.number().optional(),solderpaste_margin:E.number().optional()}),Hfr=E.object({type:E.literal("pcb_smtpad"),shape:E.literal("rotated_rect"),pcb_smtpad_id:vn("pcb_smtpad"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),x:Bn,y:Bn,width:E.number(),height:E.number(),rect_border_radius:E.number().optional(),corner_radius:E.number().optional(),ccw_rotation:Rh,layer:Oi,port_hints:E.array(E.string()).optional(),pcb_component_id:E.string().optional(),pcb_port_id:E.string().optional(),is_covered_with_solder_mask:E.boolean().optional(),soldermask_margin:E.number().optional(),soldermask_margin_left:E.number().optional(),soldermask_margin_top:E.number().optional(),soldermask_margin_right:E.number().optional(),soldermask_margin_bottom:E.number().optional(),solderpaste_margin:E.number().optional()}),TZt=E.object({type:E.literal("pcb_smtpad"),shape:E.literal("pill"),pcb_smtpad_id:vn("pcb_smtpad"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),x:Bn,y:Bn,width:E.number(),height:E.number(),radius:E.number(),layer:Oi,port_hints:E.array(E.string()).optional(),pcb_component_id:E.string().optional(),pcb_port_id:E.string().optional(),is_covered_with_solder_mask:E.boolean().optional(),soldermask_margin:E.number().optional(),solderpaste_margin:E.number().optional()}),Ffr=E.object({type:E.literal("pcb_smtpad"),shape:E.literal("rotated_pill"),pcb_smtpad_id:vn("pcb_smtpad"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),x:Bn,y:Bn,width:E.number(),height:E.number(),radius:E.number(),ccw_rotation:Rh,layer:Oi,port_hints:E.array(E.string()).optional(),pcb_component_id:E.string().optional(),pcb_port_id:E.string().optional(),is_covered_with_solder_mask:E.boolean().optional(),soldermask_margin:E.number().optional(),solderpaste_margin:E.number().optional()}),zfr=E.object({type:E.literal("pcb_smtpad"),shape:E.literal("polygon"),pcb_smtpad_id:vn("pcb_smtpad"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),points:E.array(tr),layer:Oi,port_hints:E.array(E.string()).optional(),pcb_component_id:E.string().optional(),pcb_port_id:E.string().optional(),is_covered_with_solder_mask:E.boolean().optional(),soldermask_margin:E.number().optional(),solderpaste_margin:E.number().optional()}),DZt=E.discriminatedUnion("shape",[kfr,Lfr,Hfr,Ffr,TZt,zfr]).describe("Defines an SMT pad on the PCB"),Ofr=E.object({type:E.literal("pcb_solder_paste"),shape:E.literal("circle"),pcb_solder_paste_id:vn("pcb_solder_paste"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),x:Bn,y:Bn,radius:E.number(),layer:Oi,pcb_component_id:E.string().optional(),pcb_smtpad_id:E.string().optional()}),Vfr=E.object({type:E.literal("pcb_solder_paste"),shape:E.literal("rect"),pcb_solder_paste_id:vn("pcb_solder_paste"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),x:Bn,y:Bn,width:E.number(),height:E.number(),layer:Oi,pcb_component_id:E.string().optional(),pcb_smtpad_id:E.string().optional()}),Yfr=E.object({type:E.literal("pcb_solder_paste"),shape:E.literal("pill"),pcb_solder_paste_id:vn("pcb_solder_paste"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),x:Bn,y:Bn,width:E.number(),height:E.number(),radius:E.number(),layer:Oi,pcb_component_id:E.string().optional(),pcb_smtpad_id:E.string().optional()}),Gfr=E.object({type:E.literal("pcb_solder_paste"),shape:E.literal("rotated_rect"),pcb_solder_paste_id:vn("pcb_solder_paste"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),x:Bn,y:Bn,width:E.number(),height:E.number(),ccw_rotation:Bn,layer:Oi,pcb_component_id:E.string().optional(),pcb_smtpad_id:E.string().optional()}),Ufr=E.object({type:E.literal("pcb_solder_paste"),shape:E.literal("rotated_pill"),pcb_solder_paste_id:vn("pcb_solder_paste"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),x:Bn,y:Bn,width:E.number(),height:E.number(),radius:E.number(),ccw_rotation:Rh,layer:Oi,pcb_component_id:E.string().optional(),pcb_smtpad_id:E.string().optional()}),Wfr=E.object({type:E.literal("pcb_solder_paste"),shape:E.literal("oval"),pcb_solder_paste_id:vn("pcb_solder_paste"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),x:Bn,y:Bn,width:E.number(),height:E.number(),layer:Oi,pcb_component_id:E.string().optional(),pcb_smtpad_id:E.string().optional()}),Xfr=Zce.extend({type:E.literal("pcb_solder_paste"),pcb_solder_paste_id:vn("pcb_solder_paste"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),holes:E.array(Zce.shape.points).optional(),layer:Oi,pcb_component_id:E.string().optional(),pcb_smtpad_id:E.string().optional()}),NZt=E.union([Ofr,Vfr,Yfr,Gfr,Ufr,Wfr,Xfr]).describe("Defines solderpaste on the PCB"),X4e=E.object({type:E.literal("pcb_soldermask_opening"),pcb_soldermask_opening_id:vn("pcb_soldermask_opening"),layer:Oi.pipe(a_),pcb_component_id:E.string().optional(),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional()}),RZt=E.discriminatedUnion("shape",[mqe.extend(X4e.shape),jbe.extend(X4e.shape),_qe.extend(X4e.shape),Zce.extend(X4e.shape)]).describe("An explicit opening in top or bottom solder mask or flex coverlay, independent of pads. Removes mask without adding copper or solder paste."),QZt=E.object({type:E.literal("pcb_text"),pcb_text_id:vn("pcb_text"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),text:E.string(),center:tr,layer:Oi,width:Go,height:Go,lines:E.number(),align:E.enum(["bottom-left"])}).describe("Defines text on the PCB"),kzt=Bn.pipe(E.number().finite().positive()),kZt=E.object({route_type:E.literal("wire"),x:Bn,y:Bn,width:Bn,start_width:kzt.optional(),end_width:kzt.optional(),width_interpolation_mode:E.enum(["linear","quadratic"]).optional(),copper_pour_id:E.string().optional(),is_inside_copper_pour:E.boolean().optional(),start_pcb_port_id:E.string().optional(),end_pcb_port_id:E.string().optional(),layer:Oi}).superRefine((e,t)=>{let n=[e.start_width,e.end_width,e.width_interpolation_mode].filter((o)=>o!==void 0).length;n!==0&&(n!==3&&t.addIssue({code:E.ZodIssueCode.custom,message:"Wire taper requires start_width, end_width and width_interpolation_mode together"}),e.width!==e.start_width&&t.addIssue({code:E.ZodIssueCode.custom,path:["start_width"],message:"start_width must equal width"}),Number.isFinite(e.x)&&Number.isFinite(e.y)||t.addIssue({code:E.ZodIssueCode.custom,message:"Tapered wire coordinates must be finite"}))}),LZt=E.object({route_type:E.literal("via"),x:Bn,y:Bn,copper_pour_id:E.string().optional(),is_inside_copper_pour:E.boolean().optional(),hole_diameter:Bn.optional(),outer_diameter:Bn.optional(),tented_on_top:E.boolean().optional(),tented_on_bottom:E.boolean().optional(),from_layer:Oi,to_layer:Oi}),HZt=E.object({route_type:E.literal("through_pad"),start:tr,end:tr,width:Bn,start_layer:Oi,end_layer:Oi,pcb_smtpad_id:E.string().optional(),pcb_plated_hole_id:E.string().optional()}),FZt=E.union([kZt,LZt,HZt]),zZt=E.object({type:E.literal("pcb_trace"),source_trace_id:E.string().optional(),pcb_component_id:E.string().optional(),pcb_trace_id:vn("pcb_trace"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),route_thickness_mode:E.enum(["constant","interpolated"]).default("constant").optional(),route_order_index:E.number().optional(),should_round_corners:E.boolean().optional(),trace_length:E.number().optional(),is_antenna_trace:E.boolean().optional(),highlight_color:E.string().optional(),route:E.array(FZt).superRefine((e,t)=>{for(let[n,o]of e.entries()){if(o.route_type!=="wire"||o.width_interpolation_mode===void 0)continue;let r=e[n+1],i=r?.route_type==="through_pad"?r.start:r,s=r?.route_type==="wire"?r.layer:r?.route_type==="via"?r.from_layer:r?.start_layer,a=i?Math.hypot(i.x-o.x,i.y-o.y):NaN;(!Number.isFinite(a)||a<=0||s!==o.layer)&&t.addIssue({code:E.ZodIssueCode.custom,path:[n],message:"Tapered wire must lead to a distinct finite next point on the same layer"})}})}).describe("Defines a trace on the PCB"),OZt=E.object({type:E.literal("pcb_trace_warning"),pcb_trace_warning_id:vn("pcb_trace_warning"),warning_type:E.literal("pcb_trace_warning").default("pcb_trace_warning"),message:E.string(),center:tr.optional(),pcb_trace_id:E.string(),source_trace_id:E.string(),pcb_component_ids:E.array(E.string()),pcb_port_ids:E.array(E.string()),subcircuit_id:E.string().optional()}).describe("Defines a trace warning on the PCB"),VZt=E.object({type:E.literal("pcb_trace_style_warning"),pcb_trace_style_warning_id:vn("pcb_trace_style_warning"),warning_type:E.literal("pcb_trace_style_warning").default("pcb_trace_style_warning"),message:E.string(),styling_issue_type:E.literal("long_segment_at_odd_angle"),pcb_trace_id:E.string(),source_trace_id:E.string().optional(),subcircuit_id:E.string().optional(),layer:Oi,start_route_index:E.number().int().nonnegative(),end_route_index:E.number().int().nonnegative(),segment_start:tr,segment_end:tr,center:tr,segment_length:Bn,minimum_segment_length:Bn,angle_degrees:E.number().min(0).lt(360),nearest_allowed_angle_degrees:E.number().min(0).lt(360).multipleOf(45),angle_deviation_degrees:E.number().min(0).max(22.5),angle_tolerance_degrees:E.number().min(0).lt(22.5)}).describe("Warning for a long PCB trace segment whose direction deviates from a multiple of 45 degrees"),YZt=E.object({type:E.literal("pcb_trace_too_long_error"),pcb_trace_too_long_error_id:vn("pcb_trace_too_long_error"),error_type:E.literal("pcb_trace_too_long_error").default("pcb_trace_too_long_error"),message:E.string(),pcb_trace_id:E.string(),source_net_id:E.string().optional(),source_trace_id:E.string().optional(),actual_trace_length:Bn,maximum_trace_length:Bn,subcircuit_id:E.string().optional()}).describe("Error emitted when a PCB trace is longer than its maximum allowed length"),GZt=_c.extend({type:E.literal("pcb_bus_length_skew_error"),pcb_bus_length_skew_error_id:vn("pcb_bus_length_skew_error"),error_type:E.literal("pcb_bus_length_skew_error").default("pcb_bus_length_skew_error"),source_bus_id:E.string(),source_trace_ids:E.array(E.string()),pcb_trace_ids:E.array(E.string()),actual_length_skew:E.number().nonnegative().finite(),maximum_length_skew:E.number().nonnegative().finite(),subcircuit_id:E.string().optional()}),UZt=E.object({type:E.literal("pcb_trace_too_long_warning"),pcb_trace_too_long_warning_id:vn("pcb_trace_too_long_warning"),warning_type:E.literal("pcb_trace_too_long_warning").default("pcb_trace_too_long_warning"),message:E.string(),pcb_trace_id:E.string(),source_net_id:E.string().optional(),source_trace_id:E.string().optional(),actual_trace_length:Bn,maximum_trace_length:Bn,subcircuit_id:E.string().optional()}).describe("Warning emitted when a PCB trace is longer than its maximum allowed length"),WZt=E.object({type:E.literal("pcb_trace_too_many_vias_warning"),pcb_trace_too_many_vias_warning_id:vn("pcb_trace_too_many_vias_warning"),warning_type:E.literal("pcb_trace_too_many_vias_warning").default("pcb_trace_too_many_vias_warning"),message:E.string(),pcb_trace_id:E.string(),source_net_id:E.string().optional(),source_trace_id:E.string().optional(),actual_via_count:E.number().int().nonnegative(),maximum_via_count:E.number().int().nonnegative(),subcircuit_id:E.string().optional()}).describe("Warning emitted when a PCB trace has more vias than its maximum allowed count"),uO=_c.extend({type:E.literal("pcb_bus_routing_constraint_error"),pcb_bus_routing_constraint_error_id:vn("pcb_bus_routing_constraint_error"),error_type:E.literal("pcb_bus_routing_constraint_error").default("pcb_bus_routing_constraint_error"),source_bus_id:E.string(),source_trace_ids:E.array(E.string()).min(1),pcb_trace_ids:E.array(E.string()),subcircuit_id:E.string().optional()}),XZt=E.discriminatedUnion("routing_rule",[uO.extend({routing_rule:E.literal("length_skew"),actual_length_skew:E.number().nonnegative().finite(),maximum_length_skew:E.number().nonnegative().finite()}),uO.extend({routing_rule:E.literal("min_length"),actual_trace_length:E.number().nonnegative().finite(),minimum_trace_length:E.number().finite()}),uO.extend({routing_rule:E.literal("max_length"),actual_trace_length:E.number().nonnegative().finite(),maximum_trace_length:E.number().finite()}),uO.extend({routing_rule:E.literal("target_length"),actual_trace_length:E.number().nonnegative().finite(),target_trace_length:E.number().finite(),length_tolerance:E.number().nonnegative().finite()}),uO.extend({routing_rule:E.literal("pcb_trace_spacing"),other_pcb_trace_id:E.string(),other_source_trace_id:E.string().optional(),actual_centerline_spacing:E.number().nonnegative().finite(),minimum_centerline_spacing:E.number().positive().finite()}),uO.extend({routing_rule:E.literal("pcb_spacing_to_other_signals"),other_pcb_trace_id:E.string(),other_source_trace_id:E.string().optional(),actual_centerline_spacing:E.number().nonnegative().finite(),minimum_centerline_spacing:E.number().positive().finite()}),uO.extend({routing_rule:E.literal("impedance_target"),target_impedance:E.number().positive().finite(),minimum_impedance:E.number().positive().finite().optional(),maximum_impedance:E.number().positive().finite().optional()})]).superRefine((e,t)=>{e.routing_rule==="impedance_target"&&(e.minimum_impedance===void 0&&e.maximum_impedance===void 0&&t.addIssue({code:E.ZodIssueCode.custom,path:["minimum_impedance"],message:"Provide an impedance bound"}),e.minimum_impedance!==void 0&&e.maximum_impedance!==void 0&&e.minimum_impedance>e.maximum_impedance&&t.addIssue({code:E.ZodIssueCode.custom,path:["maximum_impedance"],message:"Impedance bounds must be ordered"}))}).describe("A declared bus or differential-pair routing constraint is violated."),xae=E.object({type:E.literal("pcb_bus_routing_constraint_warning"),pcb_bus_routing_constraint_warning_id:vn("pcb_bus_routing_constraint_warning"),warning_type:E.literal("pcb_bus_routing_constraint_warning").default("pcb_bus_routing_constraint_warning"),source_bus_id:E.string(),source_trace_ids:E.array(E.string()).min(1),pcb_trace_ids:E.array(E.string()),message:E.string(),subcircuit_id:E.string().optional()}).describe("A declared bus or pair constraint could not be verified; this is not a pass."),jZt=E.discriminatedUnion("routing_rule",[xae.extend({routing_rule:E.literal("route_geometry")}),xae.extend({routing_rule:E.literal("reference_geometry")}),xae.extend({routing_rule:E.literal("spacing_geometry")}),xae.extend({routing_rule:E.literal("target_length")}),xae.extend({routing_rule:E.literal("physical_impedance")})]),KZt=_c.extend({type:E.literal("pcb_trace_error"),pcb_trace_error_id:vn("pcb_trace_error"),error_type:E.literal("pcb_trace_error").default("pcb_trace_error"),center:tr.optional(),pcb_trace_id:E.string(),source_trace_id:E.string(),pcb_component_ids:E.array(E.string()),pcb_port_ids:E.array(E.string()),subcircuit_id:E.string().optional()}).describe("Defines a trace error on the PCB"),$Zt=_c.extend({type:E.literal("pcb_trace_missing_error"),pcb_trace_missing_error_id:vn("pcb_trace_missing_error"),error_type:E.literal("pcb_trace_missing_error").default("pcb_trace_missing_error"),center:tr.optional(),source_trace_id:E.string(),pcb_component_ids:E.array(E.string()),pcb_port_ids:E.array(E.string()),subcircuit_id:E.string().optional()}).describe("Defines an error when a source trace has no corresponding PCB trace"),qZt=_c.extend({type:E.literal("pcb_port_not_matched_error"),pcb_error_id:vn("pcb_error"),error_type:E.literal("pcb_port_not_matched_error").default("pcb_port_not_matched_error"),pcb_component_ids:E.array(E.string()),subcircuit_id:E.string().optional()}).describe("Defines a trace error on the PCB where a port is not matched"),JZt=_c.extend({type:E.literal("pcb_port_not_connected_error"),pcb_port_not_connected_error_id:vn("pcb_port_not_connected_error"),error_type:E.literal("pcb_port_not_connected_error").default("pcb_port_not_connected_error"),pcb_port_ids:E.array(E.string()),pcb_component_ids:E.array(E.string()),subcircuit_id:E.string().optional()}).describe("Defines an error when a pcb port is not connected to any trace"),ZZt=E.object({type:E.literal("pcb_net"),pcb_net_id:vn("pcb_net"),source_net_id:E.string().optional(),highlight_color:E.string().optional()}).describe("Defines a net on the PCB"),een=E.object({type:E.literal("pcb_via"),pcb_via_id:vn("pcb_via"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),subcircuit_connectivity_map_key:E.string().optional(),x:Bn,y:Bn,outer_diameter:Bn.default("0.6mm"),hole_diameter:Bn.default("0.25mm"),topmost_drill_layer:Oi.optional(),bottommost_drill_layer:Oi.optional(),through_hole:E.boolean().optional(),from_layer:Oi.optional(),to_layer:Oi.optional(),layers:E.array(Oi),pcb_port_ids:E.array(E.string()).optional(),pcb_trace_id:E.string().optional(),source_trace_id:E.string().optional(),source_net_id:E.string().min(1).optional(),net_is_assignable:E.boolean().optional(),net_assigned:E.boolean().optional(),is_tented:E.boolean().optional(),tented_on_top:E.boolean().optional(),tented_on_bottom:E.boolean().optional()}).transform(({is_tented:e,...t})=>(e!==void 0&&(t.tented_on_top??=e,t.tented_on_bottom??=e),t)).describe("Defines a via on the PCB"),ten=E.object({type:E.literal("pcb_board"),pcb_board_id:vn("pcb_board"),pcb_panel_id:E.string().optional(),carrier_pcb_board_id:E.string().optional(),is_subcircuit:E.boolean().optional(),subcircuit_id:E.string().optional(),is_mounted_to_carrier_board:E.boolean().optional(),is_via_in_pad_allowed:E.boolean().optional(),default_via_tented_on_top:E.boolean().optional(),default_via_tented_on_bottom:E.boolean().optional(),default_via_plugged:E.boolean().optional(),width:Go.optional(),height:Go.optional(),center:tr,display_offset_x:E.string().optional().describe("How to display the x offset for this board, usually corresponding with how the user specified it"),display_offset_y:E.string().optional().describe("How to display the y offset for this board, usually corresponding with how the user specified it"),thickness:Go.optional().default(1.4),num_layers:E.number().optional().default(4),allow_blind_and_buried_vias:E.boolean().optional().describe("Whether autorouters may generate blind and buried vias. False restricts newly generated vias to the full board stack."),outline:E.array(tr).optional(),shape:E.enum(["rect","polygon"]).optional(),material:E.enum(["fr4","fr1","flex"]).default("fr4"),solder_mask_color:E.string().optional(),silkscreen_color:E.string().optional(),anchor_position:tr.optional(),anchor_alignment:kw.optional(),position_mode:E.enum(["relative_to_panel_anchor","none"]).optional()}).merge(gZt).describe("Defines the board outline of the PCB"),Lzt=tr.extend({x:Go.pipe(E.number().finite()),y:Go.pipe(E.number().finite())}),nen=E.object({type:E.literal("pcb_bend"),pcb_bend_id:vn("pcb_bend"),pcb_board_id:E.string(),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),name:E.string().optional(),start:Lzt,end:Lzt,bend_angle:Rh.pipe(E.number().finite()),bend_radius:Go.pipe(E.number().finite().positive()),bend_side:E.enum(["left","right"])}).refine(({start:e,end:t})=>e.x!==t.x||e.y!==t.y,{message:"Bend centerline endpoints must be distinct",path:["end"]}).describe("Defines a finite-radius bend on a flat PCB for runtime CAD folding"),kje=Go.pipe(E.number().finite().positive()),oen=tr.extend({x:Go.pipe(E.number().finite()),y:Go.pipe(E.number().finite())}),ren=E.object({type:E.literal("pcb_stiffener"),pcb_stiffener_id:vn("pcb_stiffener"),pcb_board_id:E.string(),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),name:E.string().optional(),layer:E.enum(["top","bottom"]),material:E.enum(["fr4","polyimide","stainless_steel","aluminum"]),thickness:kje,adhesive_thickness:Go.pipe(E.number().finite().nonnegative()).optional()}),ien=ren.extend({shape:E.literal("rect"),center:oen,rotation:Rh.pipe(E.number().finite()).optional(),width:kje,height:kje,outline:E.never().optional()}),sen=ren.extend({shape:E.literal("polygon"),outline:E.array(oen).min(3).refine((e)=>{let t=e.reduce((n,o,r)=>{let i=e[(r+1)%e.length];return n+o.x*i.y-i.x*o.y},0);return Number.isFinite(t)&&t!==0},"Stiffener outline must enclose a nonzero area"),center:E.never().optional(),rotation:E.never().optional(),width:E.never().optional(),height:E.never().optional()}),aen=E.discriminatedUnion("shape",[ien,sen]).describe("Defines bonded mechanical PCB reinforcement without adding copper layers"),cen=E.object({type:E.literal("pcb_panel"),pcb_panel_id:vn("pcb_panel"),width:Go,height:Go,center:tr,thickness:Go.optional().default(1.4),covered_with_solder_mask:E.boolean().optional().default(!0)}).describe("Defines a PCB panel that can contain multiple boards"),len=_c.extend({type:E.literal("pcb_placement_error"),pcb_placement_error_id:vn("pcb_placement_error"),error_type:E.literal("pcb_placement_error").default("pcb_placement_error"),subcircuit_id:E.string().optional()}).describe("Defines a placement error on the PCB"),hen=_c.extend({type:E.literal("pcb_packing_error"),pcb_packing_error_id:vn("pcb_packing_error"),error_type:E.literal("pcb_packing_error").default("pcb_packing_error"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional()}).describe("Defines a failure to pack PCB components within layout bounds"),den=_c.extend({type:E.literal("pcb_panelization_placement_error"),pcb_panelization_placement_error_id:vn("pcb_panelization_placement_error"),error_type:E.literal("pcb_panelization_placement_error").default("pcb_panelization_placement_error"),pcb_panel_id:E.string().optional(),pcb_board_id:E.string().optional(),subcircuit_id:E.string().optional()}).describe("Defines a panelization placement error on the PCB"),uen=E.object({type:E.literal("pcb_trace_hint"),pcb_trace_hint_id:vn("pcb_trace_hint"),pcb_port_id:E.string(),pcb_component_id:E.string(),route:E.array(_Zt),subcircuit_id:E.string().optional()}).describe("A hint that can be used during generation of a PCB trace"),pen=E.object({type:E.literal("pcb_silkscreen_line"),pcb_silkscreen_line_id:vn("pcb_silkscreen_line"),pcb_component_id:E.string(),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),stroke_width:Bn.default("0.1mm"),x1:Bn,y1:Bn,x2:Bn,y2:Bn,layer:a_}).describe("Defines a silkscreen line on the PCB"),men=E.object({type:E.literal("pcb_silkscreen_path"),pcb_silkscreen_path_id:vn("pcb_silkscreen_path"),pcb_component_id:E.string(),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),layer:a_,route:E.array(tr),stroke_width:Go}).describe("Defines a silkscreen path on the PCB"),_en=E.object({type:E.literal("pcb_silkscreen_text"),pcb_silkscreen_text_id:vn("pcb_silkscreen_text"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),font:E.literal("tscircuit2024").default("tscircuit2024"),font_size:Bn.default("0.2mm"),pcb_component_id:E.string(),text:E.string(),is_knockout:E.boolean().default(!1).optional(),knockout_padding:E.object({left:Go,top:Go,bottom:Go,right:Go}).default({left:"0.2mm",top:"0.2mm",bottom:"0.2mm",right:"0.2mm"}).optional(),ccw_rotation:E.number().optional(),layer:Oi,is_mirrored:E.boolean().default(!1).optional(),anchor_position:tr.default({x:0,y:0}),anchor_alignment:kw.default("center")}).describe("Defines silkscreen text on the PCB"),gen=E.object({type:E.literal("pcb_copper_text"),pcb_copper_text_id:vn("pcb_copper_text"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),font:E.literal("tscircuit2024").default("tscircuit2024"),font_size:Bn.default("0.2mm"),pcb_component_id:E.string(),text:E.string(),is_knockout:E.boolean().default(!1).optional(),knockout_padding:E.object({left:Go,top:Go,bottom:Go,right:Go}).default({left:"0.2mm",top:"0.2mm",bottom:"0.2mm",right:"0.2mm"}).optional(),ccw_rotation:E.number().optional(),layer:Oi,is_mirrored:E.boolean().default(!1).optional(),anchor_position:tr.default({x:0,y:0}),anchor_alignment:kw.default("center")}).describe("Defines copper text on the PCB"),Aen=E.object({type:E.literal("pcb_silkscreen_rect"),pcb_silkscreen_rect_id:vn("pcb_silkscreen_rect"),pcb_component_id:E.string(),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),center:tr,width:Go,height:Go,layer:Oi,stroke_width:Go.default("1mm"),corner_radius:Go.optional(),is_filled:E.boolean().default(!0).optional(),has_stroke:E.boolean().optional(),is_stroke_dashed:E.boolean().optional(),ccw_rotation:E.number().optional()}).describe("Defines a silkscreen rect on the PCB"),fen=E.object({type:E.literal("pcb_silkscreen_circle"),pcb_silkscreen_circle_id:vn("pcb_silkscreen_circle"),pcb_component_id:E.string(),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),center:tr,radius:Go,layer:a_,stroke_width:Go.default("1mm"),is_filled:E.boolean().optional()}).describe("Defines a silkscreen circle on the PCB"),yen=E.object({type:E.literal("pcb_silkscreen_oval"),pcb_silkscreen_oval_id:vn("pcb_silkscreen_oval"),pcb_component_id:E.string(),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),center:tr,radius_x:Bn,radius_y:Bn,layer:a_,ccw_rotation:Rh.optional()}).describe("Defines a silkscreen oval on the PCB"),xen=E.object({type:E.literal("pcb_silkscreen_graphic"),pcb_silkscreen_graphic_id:vn("pcb_silkscreen_graphic"),pcb_component_id:E.string(),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),layer:a_,image_asset:Tle.optional()}).extend({shape:E.literal("brep"),brep_shape:Gqe}).describe("Defines a BRep silkscreen graphic on the PCB"),Cen=E.discriminatedUnion("shape",[xen]).describe("Defines a silkscreen graphic on the PCB"),ben=E.object({type:E.literal("pcb_silkscreen_pill"),pcb_silkscreen_pill_id:vn("pcb_silkscreen_pill"),pcb_component_id:E.string(),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),center:tr,width:Go,height:Go,layer:Oi,ccw_rotation:E.number().optional()}).describe("Defines a silkscreen pill on the PCB"),Ien=E.object({type:E.literal("pcb_fabrication_note_text"),pcb_fabrication_note_text_id:vn("pcb_fabrication_note_text"),subcircuit_id:E.string().optional(),pcb_group_id:E.string().optional(),font:E.literal("tscircuit2024").default("tscircuit2024"),font_size:Bn.default("1mm"),pcb_component_id:E.string(),text:E.string(),ccw_rotation:E.number().optional(),layer:a_,anchor_position:tr.default({x:0,y:0}),anchor_alignment:E.enum(["center","top_left","top_right","bottom_left","bottom_right"]).default("center"),color:E.string().optional()}).describe("Defines a fabrication note in text on the PCB, useful for leaving notes for assemblers or fabricators"),ven=E.object({type:E.literal("pcb_fabrication_note_path"),pcb_fabrication_note_path_id:vn("pcb_fabrication_note_path"),pcb_component_id:E.string(),subcircuit_id:E.string().optional(),layer:Oi,route:E.array(tr),stroke_width:Go,color:E.string().optional(),is_filled:E.boolean().optional(),has_stroke:E.boolean().optional()}).describe("Defines a fabrication path on the PCB for fabricators or assemblers"),Sen=E.object({type:E.literal("pcb_fabrication_note_rect"),pcb_fabrication_note_rect_id:vn("pcb_fabrication_note_rect"),pcb_component_id:E.string(),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),center:tr,width:Go,height:Go,layer:a_,stroke_width:Go.default("0.1mm"),corner_radius:Go.optional(),is_filled:E.boolean().optional(),has_stroke:E.boolean().optional(),is_stroke_dashed:E.boolean().optional(),color:E.string().optional()}).describe("Defines a fabrication note rectangle on the PCB"),Pen=E.object({type:E.literal("pcb_fabrication_note_dimension"),pcb_fabrication_note_dimension_id:vn("pcb_fabrication_note_dimension"),pcb_component_id:E.string(),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),layer:a_,from:tr,to:tr,text:E.string().optional(),text_ccw_rotation:E.number().optional(),offset:Go.optional(),offset_distance:Go.optional(),offset_direction:E.object({x:E.number(),y:E.number()}).optional(),font:E.literal("tscircuit2024").default("tscircuit2024"),font_size:Go.default("1mm"),color:E.string().optional(),arrow_size:Go.default("1mm")}).describe("Defines a measurement annotation within PCB fabrication notes"),Een=E.object({type:E.literal("pcb_note_text"),pcb_note_text_id:vn("pcb_note_text"),pcb_component_id:E.string().optional(),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),name:E.string().optional(),font:E.literal("tscircuit2024").default("tscircuit2024"),font_size:Bn.default("1mm"),text:E.string().optional(),anchor_position:tr.default({x:0,y:0}),anchor_alignment:E.enum(["center","top_left","top_right","bottom_left","bottom_right"]).default("center"),layer:a_.default("top"),is_mirrored_from_top_view:E.boolean().optional(),color:E.string().optional()}).describe("Defines a documentation note in text on the PCB"),Men=E.object({type:E.literal("pcb_note_rect"),pcb_note_rect_id:vn("pcb_note_rect"),pcb_component_id:E.string().optional(),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),name:E.string().optional(),text:E.string().optional(),center:tr,width:Go,height:Go,layer:a_.default("top"),stroke_width:Go.default("0.1mm"),corner_radius:Go.optional(),is_filled:E.boolean().optional(),has_stroke:E.boolean().optional(),is_stroke_dashed:E.boolean().optional(),color:E.string().optional()}).describe("Defines a rectangular documentation note on the PCB"),wen=E.object({type:E.literal("pcb_note_path"),pcb_note_path_id:vn("pcb_note_path"),pcb_component_id:E.string().optional(),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),name:E.string().optional(),text:E.string().optional(),route:E.array(tr),layer:a_.default("top"),stroke_width:Go.default("0.1mm"),color:E.string().optional()}).describe("Defines a polyline documentation note on the PCB"),Ben=E.object({type:E.literal("pcb_note_line"),pcb_note_line_id:vn("pcb_note_line"),pcb_component_id:E.string().optional(),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),name:E.string().optional(),text:E.string().optional(),x1:Bn,y1:Bn,x2:Bn,y2:Bn,layer:a_.default("top"),stroke_width:Bn.default("0.1mm"),color:E.string().optional(),is_dashed:E.boolean().optional()}).describe("Defines a straight documentation note line on the PCB"),Ten=E.object({type:E.literal("pcb_note_dimension"),pcb_note_dimension_id:vn("pcb_note_dimension"),pcb_component_id:E.string().optional(),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),name:E.string().optional(),from:tr,to:tr,text:E.string().optional(),text_ccw_rotation:E.number().optional(),offset_distance:Go.optional(),offset_direction:E.object({x:E.number(),y:E.number()}).optional(),font:E.literal("tscircuit2024").default("tscircuit2024"),font_size:Go.default("1mm"),layer:a_.default("top"),color:E.string().optional(),arrow_size:Go.default("1mm")}).describe("Defines a measurement annotation within PCB documentation notes"),Den=_c.extend({type:E.literal("pcb_footprint_overlap_error"),pcb_error_id:vn("pcb_error"),error_type:E.literal("pcb_footprint_overlap_error").default("pcb_footprint_overlap_error"),pcb_smtpad_ids:E.array(E.string()).optional(),pcb_plated_hole_ids:E.array(E.string()).optional(),pcb_hole_ids:E.array(E.string()).optional(),pcb_keepout_ids:E.array(E.string()).optional()}).describe("Error emitted when a pcb footprint overlaps with another element"),Nen=_c.extend({type:E.literal("pcb_courtyard_overlap_error"),pcb_error_id:vn("pcb_error"),error_type:E.literal("pcb_courtyard_overlap_error").default("pcb_courtyard_overlap_error"),pcb_component_ids:E.tuple([E.string(),E.string()])}).describe("Error emitted when the courtyard (CrtYd) of one PCB component overlaps with the courtyard of another"),Ren=E.object({type:E.literal("pcb_keepout"),shape:E.literal("outline"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),outline:E.array(tr).min(2),stroke_width:Go,pcb_keepout_id:E.string(),layers:E.array(E.string()),description:E.string().optional(),excluded_pcb_component_ids:E.array(E.string()).optional(),warning_only:E.boolean().optional(),allow_traces:E.boolean().optional(),allow_placements:E.boolean().optional()}),Qen=E.object({type:E.literal("pcb_keepout"),shape:E.literal("rect"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),center:tr,width:Bn,height:Bn,pcb_keepout_id:E.string(),layers:E.array(E.string()),description:E.string().optional(),excluded_pcb_component_ids:E.array(E.string()).optional(),warning_only:E.boolean().optional(),allow_traces:E.boolean().optional(),allow_placements:E.boolean().optional()}).or(E.object({type:E.literal("pcb_keepout"),shape:E.literal("circle"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),center:tr,radius:Bn,pcb_keepout_id:E.string(),layers:E.array(E.string()),description:E.string().optional(),excluded_pcb_component_ids:E.array(E.string()).optional(),warning_only:E.boolean().optional(),allow_traces:E.boolean().optional(),allow_placements:E.boolean().optional()})).or(Ren),ken=E.object({type:E.literal("pcb_keepout_overlap_warning"),pcb_keepout_overlap_warning_id:vn("pcb_keepout_overlap_warning"),warning_type:E.literal("pcb_keepout_overlap_warning").default("pcb_keepout_overlap_warning"),message:E.string(),pcb_keepout_id:E.string(),pcb_component_ids:E.array(E.string()).optional(),pcb_trace_ids:E.array(E.string()).optional(),pcb_smtpad_ids:E.array(E.string()).optional(),pcb_plated_hole_ids:E.array(E.string()).optional(),pcb_via_ids:E.array(E.string()).optional(),center:tr.optional(),subcircuit_id:E.string().optional()}).describe("Warning emitted when copper overlaps a PCB keepout with warning_only enabled"),Zbe=E.object({type:E.literal("pcb_cutout"),pcb_cutout_id:vn("pcb_cutout"),pcb_component_id:E.string().optional(),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),pcb_board_id:E.string().optional(),pcb_panel_id:E.string().optional()}),Len=Zbe.extend({shape:E.literal("rect"),center:tr,width:Go,height:Go,rotation:Rh.optional(),corner_radius:Go.optional()}),Hen=Zbe.extend({shape:E.literal("circle"),center:tr,radius:Go}),Fen=Zbe.extend({shape:E.literal("polygon"),points:E.array(tr)}),zen=Zbe.extend({shape:E.literal("path"),route:E.array(tr),slot_width:Go,slot_length:Go.optional(),space_between_slots:Go.optional(),slot_corner_radius:Go.optional()}),Oen=E.discriminatedUnion("shape",[Len,Hen,Fen,zen]).describe("Defines a cutout on the PCB, removing board material."),Ven=_c.extend({type:E.literal("pcb_missing_footprint_error"),pcb_missing_footprint_error_id:vn("pcb_missing_footprint_error"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),error_type:E.literal("pcb_missing_footprint_error").default("pcb_missing_footprint_error"),source_component_id:E.string()}).describe("Defines a missing footprint error on the PCB"),Yen=_c.extend({type:E.literal("external_footprint_load_error"),external_footprint_load_error_id:vn("external_footprint_load_error"),pcb_component_id:E.string(),source_component_id:E.string(),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),footprinter_string:E.string().optional(),error_type:E.literal("external_footprint_load_error").default("external_footprint_load_error")}).describe("Defines an error when an external footprint fails to load"),Gen=_c.extend({type:E.literal("circuit_json_footprint_load_error"),circuit_json_footprint_load_error_id:vn("circuit_json_footprint_load_error"),pcb_component_id:E.string(),source_component_id:E.string(),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),error_type:E.literal("circuit_json_footprint_load_error").default("circuit_json_footprint_load_error"),circuit_json:E.array(E.any()).optional()}).describe("Defines an error when a circuit JSON footprint fails to load"),Uen=E.object({type:E.literal("pcb_group"),pcb_group_id:vn("pcb_group"),source_group_id:E.string(),is_subcircuit:E.boolean().optional(),subcircuit_id:E.string().optional(),width:Go.optional(),height:Go.optional(),center:tr,display_offset_x:E.string().optional().describe("How to display the x offset for this group, usually corresponding with how the user specified it"),display_offset_y:E.string().optional().describe("How to display the y offset for this group, usually corresponding with how the user specified it"),outline:E.array(tr).optional(),anchor_position:tr.optional(),anchor_alignment:kw.default("center"),position_mode:E.enum(["packed","relative_to_group_anchor","none"]).optional(),positioned_relative_to_pcb_group_id:E.string().optional(),positioned_relative_to_pcb_board_id:E.string().optional(),pcb_component_ids:E.array(E.string()),child_layout_mode:E.enum(["packed","none"]).optional(),name:E.string().optional(),description:E.string().optional(),layout_mode:E.string().optional(),autorouter_configuration:E.object({trace_clearance:Go}).optional(),autorouter_used_string:E.string().optional()}).describe("Defines a group of components on the PCB"),Wen=_c.extend({type:E.literal("pcb_autorouting_error"),pcb_error_id:vn("pcb_autorouting_error"),error_type:E.literal("pcb_autorouting_error").default("pcb_autorouting_error"),subcircuit_id:E.string().optional()}).describe("The autorouting has failed to route a portion of the board"),Xen=_c.extend({type:E.literal("pcb_preflight_routing_error"),pcb_preflight_routing_error_id:vn("pcb_preflight_routing_error"),error_type:E.literal("pcb_preflight_routing_error").default("pcb_preflight_routing_error"),error_code:E.string(),subcircuit_id:E.string().optional(),pcb_group_id:E.string().optional(),routing_phase_index:E.number().int().optional(),phase_name:E.string().optional(),source_trace_ids:E.array(E.string()).optional(),pcb_component_ids:E.array(E.string()).optional(),pcb_port_ids:E.array(E.string()).optional(),related_error_ids:E.array(E.string()).optional(),measurements:E.record(E.number().finite()).optional()}),jen=E.object({type:E.literal("pcb_manual_edit_conflict_warning"),pcb_manual_edit_conflict_warning_id:vn("pcb_manual_edit_conflict_warning"),warning_type:E.literal("pcb_manual_edit_conflict_warning").default("pcb_manual_edit_conflict_warning"),message:E.string(),pcb_component_id:E.string(),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),source_component_id:E.string()}).describe("Warning emitted when a component has both manual placement and explicit pcbX/pcbY coordinates"),Hzt=E.enum(["x-","x+","y+","y-"]),Ken=E.object({type:E.literal("pcb_connector_not_in_accessible_orientation_warning"),pcb_connector_not_in_accessible_orientation_warning_id:vn("pcb_connector_not_in_accessible_orientation_warning"),warning_type:E.literal("pcb_connector_not_in_accessible_orientation_warning").default("pcb_connector_not_in_accessible_orientation_warning"),message:E.string(),pcb_component_id:E.string(),source_component_id:E.string().optional(),pcb_board_id:E.string().optional(),facing_direction:Hzt,recommended_facing_direction:Hzt,subcircuit_id:E.string().optional()}).describe("Warning emitted when a connector PCB component is facing inward toward the board and should be reoriented to an outward-facing direction"),$en=E.object({type:E.literal("pcb_component_missing_courtyard_warning"),pcb_component_missing_courtyard_warning_id:vn("pcb_component_missing_courtyard_warning"),warning_type:E.literal("pcb_component_missing_courtyard_warning").default("pcb_component_missing_courtyard_warning"),message:E.string(),pcb_component_id:E.string(),source_component_id:E.string().optional(),subcircuit_id:E.string().optional()}).describe("Warning emitted when a PCB component has no courtyard geometry"),qen=E.object({type:E.literal("supplier_footprint_mismatch_warning"),supplier_footprint_mismatch_warning_id:vn("supplier_footprint_mismatch_warning"),warning_type:E.literal("supplier_footprint_mismatch_warning").default("supplier_footprint_mismatch_warning"),message:E.string(),source_component_id:E.string(),pcb_component_id:E.string().optional(),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),supplier_name:Rq.optional(),supplier_part_number:E.string().optional(),supplier_footprint_url:E.string().optional(),footprint_copper_intersection_over_union:E.number()}).describe("Warning emitted when a supplier part footprint does not match the expected footprint"),Jen=E.object({type:E.literal("pcb_fabricator_extra_charge_warning"),pcb_fabricator_extra_charge_warning_id:vn("pcb_fabricator_extra_charge_warning"),warning_type:E.literal("pcb_fabricator_extra_charge_warning").default("pcb_fabricator_extra_charge_warning"),message:E.string(),fabricator_preset:E.string(),pcb_board_id:E.string().optional(),pcb_via_ids:E.array(E.string()).optional(),subcircuit_id:E.string().optional()}).describe("Warning that a design feature incurs an extra charge for the selected fabricator preset, such as via hole diameters below 0.3 mm with JLCPCB economy or standard presets."),Zen=E.object({type:E.literal("pcb_breakout_point"),pcb_breakout_point_id:vn("pcb_breakout_point"),pcb_group_id:E.string(),subcircuit_id:E.string().optional(),source_trace_id:E.string().optional(),source_port_id:E.string().optional(),source_net_id:E.string().optional(),layer:Oi.optional(),x:Bn,y:Bn}).describe("Defines a routing target within a pcb_group for a source_trace or source_net"),etn=E.object({type:E.literal("pcb_ground_plane"),pcb_ground_plane_id:vn("pcb_ground_plane"),source_pcb_ground_plane_id:E.string(),source_net_id:E.string(),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional()}).describe("Defines a ground plane on the PCB"),ttn=E.object({type:E.literal("pcb_ground_plane_region"),pcb_ground_plane_region_id:vn("pcb_ground_plane_region"),pcb_ground_plane_id:E.string(),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),layer:Oi,points:E.array(tr)}).describe("Defines a polygon region of a ground plane"),ntn=E.object({type:E.literal("pcb_thermal_spoke"),pcb_thermal_spoke_id:vn("pcb_thermal_spoke"),pcb_ground_plane_id:E.string(),shape:E.string(),spoke_count:E.number(),spoke_thickness:Bn,spoke_inner_diameter:Bn,spoke_outer_diameter:Bn,pcb_plated_hole_id:E.string().optional(),subcircuit_id:E.string().optional()}).describe("Pattern for connecting a ground plane to a plated hole"),Uqe=E.object({type:E.literal("pcb_copper_pour"),pcb_copper_pour_id:vn("pcb_copper_pour"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),layer:Oi,source_net_id:E.string().optional(),covered_with_solder_mask:E.boolean().optional().default(!0)}),otn=Uqe.extend({shape:E.literal("rect"),center:tr,width:Go,height:Go,rotation:Rh.optional()}),rtn=Uqe.extend({shape:E.literal("brep"),brep_shape:Gqe}),itn=Uqe.extend({shape:E.literal("polygon"),points:E.array(tr)}),stn=E.discriminatedUnion("shape",[otn,rtn,itn]).describe("Defines a copper pour on the PCB."),atn=_c.extend({type:E.literal("pcb_component_outside_board_error"),pcb_component_outside_board_error_id:vn("pcb_component_outside_board_error"),error_type:E.literal("pcb_component_outside_board_error").default("pcb_component_outside_board_error"),pcb_component_id:E.string(),pcb_board_id:E.string(),component_center:tr,component_bounds:E.object({min_x:E.number(),max_x:E.number(),min_y:E.number(),max_y:E.number()}),subcircuit_id:E.string().optional(),source_component_id:E.string().optional()}).describe("Error emitted when a PCB component is placed outside the board boundaries"),ctn=_c.extend({type:E.literal("pcb_component_not_on_board_edge_error"),pcb_component_not_on_board_edge_error_id:vn("pcb_component_not_on_board_edge_error"),error_type:E.literal("pcb_component_not_on_board_edge_error").default("pcb_component_not_on_board_edge_error"),pcb_component_id:E.string(),pcb_board_id:E.string(),component_center:tr,pad_to_nearest_board_edge_distance:E.number(),source_component_id:E.string().optional(),subcircuit_id:E.string().optional()}).describe("Error emitted when a component that must be placed on the board edge is centered away from the edge"),ltn=_c.extend({type:E.literal("pcb_component_invalid_layer_error"),pcb_component_invalid_layer_error_id:vn("pcb_component_invalid_layer_error"),error_type:E.literal("pcb_component_invalid_layer_error").default("pcb_component_invalid_layer_error"),pcb_component_id:E.string().optional(),source_component_id:E.string(),layer:Oi,subcircuit_id:E.string().optional()}).describe("Error emitted when a component is placed on an invalid layer (components can only be on 'top' or 'bottom' layers)"),htn=_c.extend({type:E.literal("pcb_via_clearance_error"),pcb_error_id:vn("pcb_error"),error_type:E.literal("pcb_via_clearance_error").default("pcb_via_clearance_error"),pcb_via_ids:E.array(E.string()).min(2),minimum_clearance:Bn.optional(),actual_clearance:Bn.optional(),pcb_center:E.object({x:E.number().optional(),y:E.number().optional()}).optional(),subcircuit_id:E.string().optional()}).describe("Error emitted when vias are closer than the allowed clearance"),dtn=_c.extend({type:E.literal("pcb_via_trace_clearance_error"),pcb_via_trace_clearance_error_id:vn("pcb_via_trace_clearance_error"),error_type:E.literal("pcb_via_trace_clearance_error").default("pcb_via_trace_clearance_error"),pcb_via_id:E.string(),pcb_trace_id:E.string(),minimum_clearance:Bn.optional(),actual_clearance:Bn.optional(),center:E.object({x:E.number().optional(),y:E.number().optional()}).optional(),subcircuit_id:E.string().optional()}).describe("Error emitted when a via and trace are closer than the allowed clearance"),utn=_c.extend({type:E.literal("pcb_pad_pad_clearance_error"),pcb_pad_pad_clearance_error_id:vn("pcb_pad_pad_clearance_error"),error_type:E.literal("pcb_pad_pad_clearance_error").default("pcb_pad_pad_clearance_error"),pcb_pad_ids:E.array(E.string()).min(2),minimum_clearance:Bn.optional(),actual_clearance:Bn.optional(),center:E.object({x:E.number().optional(),y:E.number().optional()}).optional(),subcircuit_id:E.string().optional()}).describe("Error emitted when pads are closer than the allowed clearance"),ptn=_c.extend({type:E.literal("pcb_pad_trace_clearance_error"),pcb_pad_trace_clearance_error_id:vn("pcb_pad_trace_clearance_error"),error_type:E.literal("pcb_pad_trace_clearance_error").default("pcb_pad_trace_clearance_error"),pcb_pad_id:E.string(),pcb_trace_id:E.string(),minimum_clearance:Bn.optional(),actual_clearance:Bn.optional(),center:E.object({x:E.number().optional(),y:E.number().optional()}).optional(),subcircuit_id:E.string().optional()}).describe("Error emitted when a pad and trace are closer than allowed clearance"),mtn=E.object({type:E.literal("pcb_courtyard_rect"),pcb_courtyard_rect_id:vn("pcb_courtyard_rect"),pcb_component_id:E.string(),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),center:tr,width:Go,height:Go,layer:a_,ccw_rotation:Rh.optional(),color:E.string().optional()}).describe("Defines a courtyard rectangle on the PCB"),_tn=E.object({type:E.literal("pcb_courtyard_outline"),pcb_courtyard_outline_id:vn("pcb_courtyard_outline"),pcb_component_id:E.string(),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),layer:a_,outline:E.array(tr).min(2)}).describe("Defines a courtyard outline on the PCB"),gtn=E.object({type:E.literal("pcb_courtyard_polygon"),pcb_courtyard_polygon_id:vn("pcb_courtyard_polygon"),pcb_component_id:E.string(),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),layer:a_,points:E.array(tr).min(3),color:E.string().optional()}).describe("Defines a courtyard polygon on the PCB"),Atn=E.object({type:E.literal("pcb_courtyard_circle"),pcb_courtyard_circle_id:vn("pcb_courtyard_circle"),pcb_component_id:E.string(),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),center:tr,radius:Go,layer:a_,color:E.string().optional()}).describe("Defines a courtyard circle on the PCB"),ftn=E.object({type:E.literal("pcb_courtyard_pill"),pcb_courtyard_pill_id:vn("pcb_courtyard_pill"),pcb_component_id:E.string(),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),center:tr,width:Go,height:Go,radius:Go,layer:a_,color:E.string().optional()}).describe("Defines a courtyard pill on the PCB"),jfr=["obj","stl","3mf","gltf","glb","step","wrl"],ytn=["x+","x-","y+","y-","z+","z-"],Kfr={obj:"z+",stl:"z+","3mf":"z+",gltf:"y+",glb:"y+",step:"z+",wrl:"y+"},xtn=E.object({type:E.literal("cad_component"),cad_component_id:E.string(),pcb_component_id:E.string().optional().describe("Optional PCB component reference; omit for CAD geometry without a PCB component"),source_component_id:E.string(),position:pb,rotation:pb.optional(),is_on_folded_board:E.boolean().optional().describe("True when position and rotation describe the assembled folded board pose. False or omitted means the flat board pose. PCB records remain flat; pcb_component_id identifies the flat mount and owning board for reversible transforms."),size:pb.optional(),layer:Oi.optional(),subcircuit_id:E.string().optional(),footprinter_string:E.string().optional(),model_obj_url:E.string().optional(),model_stl_url:E.string().optional(),model_3mf_url:E.string().optional(),model_gltf_url:E.string().optional(),model_glb_url:E.string().optional(),model_step_url:E.string().optional(),model_wrl_url:E.string().optional(),model_asset:Tle.optional(),model_unit_to_mm_scale_factor:E.number().optional(),model_board_normal_direction:E.enum(ytn).optional().describe(`The direction in the model's coordinate space that is considered "up" or "coming out of the board surface"`),model_origin_position:pb.optional(),model_origin_alignment:E.enum(["unknown","center","center_of_component_on_board_surface","bottom_center_of_component"]).optional(),model_object_fit:E.enum(["contain_within_bounds","fill_bounds"]).optional().default("contain_within_bounds"),model_jscad:E.any().optional(),color:E.string().trim().min(1).optional().describe("Explicit color override for CAD geometry, including authored JSCAD material colors. Omit to preserve model materials."),show_as_translucent_model:E.boolean().optional(),show_as_bounding_box:E.boolean().optional(),show_hidden_edges:E.boolean().optional(),anchor_alignment:E.enum(["center","center_of_component_on_board_surface"]).optional().default("center")}).describe("Defines CAD geometry, optionally associated with a PCB component"),Ctn=_c.extend({type:E.literal("cad_collision_error"),cad_collision_error_id:vn("cad_collision_error"),error_type:E.literal("cad_collision_error").default("cad_collision_error"),cad_component_ids:E.array(E.string()).min(1),pcb_component_ids:E.array(E.string()).optional(),source_component_ids:E.array(E.string()).min(1),intersection_area_mm2:E.number().finite().nonnegative(),threshold_area_mm2:E.number().finite().nonnegative()}).describe("An aperture-bearing part intersects the finished enclosure. The intersection_area_mm2 is the union silhouette area of the solid intersection projected along the aperture face normal, in the right-handed Circuit JSON world frame (+X right, +Y top, +Z above). It is an area in square millimetres, not intersection volume or surface area. This indicates possible aperture misplacement, insufficient size/depth, or body clearance problems; it does not prove which cause applies."),Fzt=pb.refine((e)=>[e.x,e.y,e.z].every(Number.isFinite),"Connector pin 1 positions must be finite").describe("Resolved pin 1 position at the connector mating face, in right-handed circuit world, millimeters: +X right, +Y top, +Z above. An absolute point, not a direction. Computed by the circuit producer from endpoint geometry. Together with the endpoint path tangent, fixes connector roll and identifies its pin 1 side; renderers must not infer it from footprints."),btn=E.object({type:E.literal("cad_cable"),cad_cable_id:E.string(),name:E.string().min(1),from_source_component_id:E.string(),to_source_component_id:E.string(),from_connector_pin1_position:Fzt.optional(),to_connector_pin1_position:Fzt.optional(),cableprinter_string:E.string().min(1).describe('Physical cable definition, e.g. "usb_c" or "jst_ph_pins6". Independent of the route.'),path:E.array(pb).min(2).refine((e)=>e.every((t,n)=>[t.x,t.y,t.z].every(Number.isFinite)&&(n===0||Math.hypot(t.x-e[n-1].x,t.y-e[n-1].y,t.z-e[n-1].z)>0.00000001)),"Cable paths require finite, distinct consecutive points").describe("Resolved cable centerline points in right-handed circuit world, millimeters: +X right, +Y top, +Z above. First/last samples are connector wire exits; their tangents point into/out of the cable. Includes routing/slack; renderers must not recompute the path.")}).describe("A physical assembly cable with a resolved 3D route. Several cables are independent cad_cable records, each with its own endpoints, definition and path. Does not imply electrical pin mapping."),Itn=0.000001,zzt=E.object({x:E.number().finite(),y:E.number().finite(),z:E.number().finite()}).refine((e)=>Math.abs(Math.hypot(e.x,e.y,e.z)-1)<=Itn,"Reference surface directions must be unit vectors"),Ozt=Bn.pipe(E.number().finite().positive()),vtn=E.object({type:E.literal("cad_reference_surface"),cad_reference_surface_id:E.string().min(1),source_component_id:E.string().min(1).describe("Owning assembly part's source component ID. The part may have no CAD geometry."),name:E.string().trim().min(1).describe("Reference name, unique within the owning part, e.g. shade in STEM.shade."),shape:E.literal("rect"),center:pb.refine((e)=>[e.x,e.y,e.z].every(Number.isFinite),"Reference surface centers must be finite").describe("Resolved surface center in right-handed circuit-world XYZ, millimeters: +X right, +Y top, +Z above. An absolute point after assembly placement."),normal:zzt.describe("Outward unit normal in circuit-world XYZ. Dimensionless direction; transform with the part's rotation, without translation."),x_axis:zzt.describe("In-plane unit X direction in circuit-world XYZ, perpendicular to normal. The second tangent is normal cross x_axis, giving a right-handed frame."),width:Ozt.optional().describe("Rectangular extent along x_axis in millimeters. Supply together with height. Omission leaves the surface's display size unspecified."),height:Ozt.optional().describe("Rectangular extent along normal cross x_axis in millimeters. Supply together with width."),subcircuit_id:E.string().optional()}).superRefine((e,t)=>{e.width===void 0!=(e.height===void 0)&&t.addIssue({code:E.ZodIssueCode.custom,path:["width"],message:"Provide width and height together"});let{normal:n,x_axis:o}=e;Math.abs(n.x*o.x+n.y*o.y+n.z*o.z)>Itn&&t.addIssue({code:E.ZodIssueCode.custom,path:["x_axis"],message:"x_axis must be perpendicular to normal"})}).describe("A named assembly mounting surface with a resolved world-space frame. Reference geometry for optional visualization; does not add solid material or electrical connectivity. The producer resolves part placement independently of CAD-model offsets; renderers consume the world frame without reapplying the owning model's transform."),Wqe=E.enum(["sinewave","square","triangle","sawtooth"]),$fr=E.union([E.string(),E.number()]).transform((e)=>typeof e=="string"?e.endsWith("%")?parseFloat(e.slice(0,-1))/100:parseFloat(e):e).pipe(E.number().min(0,"Duty cycle must be non-negative").max(1,"Duty cycle cannot be greater than 100%")),Stn=E.object({type:E.literal("simulation_voltage_source"),simulation_voltage_source_id:vn("simulation_voltage_source"),is_dc_source:E.literal(!0).optional().default(!0),positive_source_port_id:E.string().optional(),negative_source_port_id:E.string().optional(),positive_source_net_id:E.string().optional(),negative_source_net_id:E.string().optional(),voltage:gb,ac_magnitude:gb.optional(),ac_phase:Rh.optional()}).describe("Defines a DC voltage source for simulation"),Ptn=E.object({type:E.literal("simulation_voltage_source"),simulation_voltage_source_id:vn("simulation_voltage_source"),is_dc_source:E.literal(!1),terminal1_source_port_id:E.string().optional(),terminal2_source_port_id:E.string().optional(),terminal1_source_net_id:E.string().optional(),terminal2_source_net_id:E.string().optional(),voltage:gb.optional(),frequency:IV.optional(),peak_to_peak_voltage:gb.optional(),wave_shape:Wqe.optional(),phase:Rh.optional(),duty_cycle:$fr.optional(),pulse_delay:hg.optional(),rise_time:hg.optional(),fall_time:hg.optional(),pulse_width:hg.optional(),period:hg.optional(),ac_magnitude:gb.optional(),ac_phase:Rh.optional()}).describe("Defines an AC voltage source for simulation"),Etn=E.union([Stn,Ptn]).describe("Defines a voltage source for simulation"),qfr=E.union([E.string(),E.number()]).transform((e)=>typeof e=="string"?e.endsWith("%")?parseFloat(e.slice(0,-1))/100:parseFloat(e):e).pipe(E.number().min(0,"Duty cycle must be non-negative").max(1,"Duty cycle cannot be greater than 100%")),Mtn=E.object({type:E.literal("simulation_current_source"),simulation_current_source_id:vn("simulation_current_source"),is_dc_source:E.literal(!0).optional().default(!0),positive_source_port_id:E.string().optional(),negative_source_port_id:E.string().optional(),positive_source_net_id:E.string().optional(),negative_source_net_id:E.string().optional(),current:cQ,ac_magnitude:cQ.optional(),ac_phase:Rh.optional()}).describe("Defines a DC current source for simulation"),wtn=E.object({type:E.literal("simulation_current_source"),simulation_current_source_id:vn("simulation_current_source"),is_dc_source:E.literal(!1),terminal1_source_port_id:E.string().optional(),terminal2_source_port_id:E.string().optional(),terminal1_source_net_id:E.string().optional(),terminal2_source_net_id:E.string().optional(),current:cQ.optional(),frequency:IV.optional(),peak_to_peak_current:cQ.optional(),wave_shape:Wqe.optional(),phase:Rh.optional(),duty_cycle:qfr.optional(),ac_magnitude:cQ.optional(),ac_phase:Rh.optional()}).describe("Defines an AC current source for simulation"),Btn=E.union([Mtn,wtn]).describe("Defines a current source for simulation"),e6e=E.custom((e)=>e==="V"||e==="A"),Xqe=E.custom((e)=>e==="Ω"||e==="F"||e==="H"||e==="V"||e==="A"),Ttn=E.union([E.literal("spice_dc_sweep"),E.literal("spice_dc_operating_point"),E.literal("spice_transient_analysis"),E.literal("spice_ac_analysis"),E.literal("pcb_return_current")]),Dtn=E.object({method:E.enum(["trap","gear"]).optional(),reltol:E.union([E.number(),E.string()]).optional(),abstol:E.union([E.number(),E.string()]).optional(),vntol:E.union([E.number(),E.string()]).optional()}).describe("SPICE solver options for a simulation experiment"),Ntn=E.object({type:E.literal("simulation_experiment"),simulation_experiment_id:vn("simulation_experiment"),name:E.string(),experiment_type:Ttn,time_per_step:Nq.optional(),start_time_ms:hg.optional(),end_time_ms:hg.optional(),spice_options:Dtn.optional(),dc_sweep_voltage_source_id:E.string().optional(),dc_sweep_current_source_id:E.string().optional(),dc_sweep_start:E.number().optional(),dc_sweep_stop:E.number().optional(),dc_sweep_step:E.number().refine((e)=>e!==0).optional(),dc_sweep_unit:e6e.optional(),ac_sweep_type:E.enum(["linear","decade","octave"]).optional(),ac_samples_per_interval:E.number().int().positive().optional(),ac_sample_count:E.number().int().positive().optional(),ac_start_frequency_hz:E.number().positive().optional(),ac_stop_frequency_hz:E.number().positive().optional()}).superRefine((e,t)=>{if(e.experiment_type==="spice_dc_sweep"){let n=["dc_sweep_start","dc_sweep_stop","dc_sweep_step","dc_sweep_unit"];for(let o of n)e[o]===void 0&&t.addIssue({code:E.ZodIssueCode.custom,path:[o],message:`${o} is required for a DC sweep`});e.dc_sweep_voltage_source_id!==void 0===(e.dc_sweep_current_source_id!==void 0)&&t.addIssue({code:E.ZodIssueCode.custom,path:["dc_sweep_voltage_source_id"],message:"Exactly one DC sweep voltage or current source ID is required"})}e.experiment_type==="spice_ac_analysis"&&(e.ac_sweep_type===void 0&&t.addIssue({code:E.ZodIssueCode.custom,path:["ac_sweep_type"],message:"ac_sweep_type is required for an AC analysis"}),e.ac_start_frequency_hz===void 0&&t.addIssue({code:E.ZodIssueCode.custom,path:["ac_start_frequency_hz"],message:"ac_start_frequency_hz is required for an AC analysis"}),e.ac_stop_frequency_hz===void 0&&t.addIssue({code:E.ZodIssueCode.custom,path:["ac_stop_frequency_hz"],message:"ac_stop_frequency_hz is required for an AC analysis"}),e.ac_sweep_type==="linear"&&e.ac_sample_count===void 0&&t.addIssue({code:E.ZodIssueCode.custom,path:["ac_sample_count"],message:"ac_sample_count is required for a linear AC analysis"}),e.ac_sweep_type!=="decade"&&e.ac_sweep_type!=="octave"||e.ac_samples_per_interval!==void 0||t.addIssue({code:E.ZodIssueCode.custom,path:["ac_samples_per_interval"],message:"ac_samples_per_interval is required for decade and octave AC analyses"}))}).describe("Defines a simulation experiment configuration"),Lw=E.object({simulation_parameter_sweep_id:E.string(),sweep_index:E.number().int().nonnegative(),parameter_value:E.number(),parameter_unit:Xqe}),Rtn=E.object({type:E.literal("simulation_transient_voltage_graph"),simulation_transient_voltage_graph_id:vn("simulation_transient_voltage_graph"),simulation_experiment_id:E.string(),simulation_parameter_sweep_coordinate:Lw.optional(),timestamps_ms:E.array(E.number()).optional(),voltage_levels:E.array(E.number()),source_component_id:E.string().optional(),subcircuit_connectivity_map_key:E.string().optional(),time_per_step:Nq,start_time_ms:hg,end_time_ms:hg,name:E.string().optional(),color:E.string().optional()}).describe("Stores voltage measurements over time for a simulation"),Qtn=E.object({type:E.literal("simulation_transient_current_graph"),simulation_transient_current_graph_id:vn("simulation_transient_current_graph"),simulation_experiment_id:E.string(),simulation_parameter_sweep_coordinate:Lw.optional(),timestamps_ms:E.array(E.number()).optional(),current_levels:E.array(E.number()),source_component_id:E.string().optional(),subcircuit_connectivity_map_key:E.string().optional(),time_per_step:Nq,start_time_ms:hg,end_time_ms:hg,name:E.string().optional(),color:E.string().optional()}).describe("Stores current measurements over time for a simulation"),ktn=E.object({type:E.literal("simulation_switch"),simulation_switch_id:vn("simulation_switch"),source_component_id:E.string().optional(),closes_at:hg.optional(),opens_at:hg.optional(),starts_closed:E.boolean().optional(),switching_frequency:IV.optional()}).describe("Defines a switch for simulation timing control"),Ltn=E.object({type:E.literal("simulation_voltage_probe"),simulation_voltage_probe_id:vn("simulation_voltage_probe"),source_component_id:E.string().optional(),name:E.string().optional(),signal_input_source_port_id:E.string().optional(),signal_input_source_net_id:E.string().optional(),reference_input_source_port_id:E.string().optional(),reference_input_source_net_id:E.string().optional(),subcircuit_id:E.string().optional(),color:E.string().optional()}).describe("Defines a voltage probe for simulation. If a reference input is not provided, it measures against ground. If a reference input is provided, it measures the differential voltage between two points.").superRefine((e,t)=>{if(e.reference_input_source_port_id||e.reference_input_source_net_id){let n=!!e.signal_input_source_port_id||!!e.reference_input_source_port_id,o=!!e.signal_input_source_net_id||!!e.reference_input_source_net_id;n&&o?t.addIssue({code:E.ZodIssueCode.custom,message:"Cannot mix port and net connections in a differential probe."}):n?e.signal_input_source_port_id&&e.reference_input_source_port_id||t.addIssue({code:E.ZodIssueCode.custom,message:"Differential port probe requires both signal_input_source_port_id and reference_input_source_port_id."}):o&&(e.signal_input_source_net_id&&e.reference_input_source_net_id||t.addIssue({code:E.ZodIssueCode.custom,message:"Differential net probe requires both signal_input_source_net_id and reference_input_source_net_id."}))}else!!e.signal_input_source_port_id==!!e.signal_input_source_net_id&&t.addIssue({code:E.ZodIssueCode.custom,message:"A voltage probe must have exactly one of signal_input_source_port_id or signal_input_source_net_id."})}),Htn=E.object({type:E.literal("simulation_current_probe"),simulation_current_probe_id:vn("simulation_current_probe"),source_component_id:E.string().optional(),name:E.string().optional(),positive_source_port_id:E.string().optional(),negative_source_port_id:E.string().optional(),positive_source_net_id:E.string().optional(),negative_source_net_id:E.string().optional(),subcircuit_id:E.string().optional(),color:E.string().optional()}).describe("Defines a current probe for simulation. It measures current flowing from the positive endpoint to the negative endpoint.").superRefine((e,t)=>{let n=!!e.positive_source_port_id,o=!!e.negative_source_port_id,r=!!e.positive_source_net_id,i=!!e.negative_source_net_id,s=n||o,a=r||i;s&&a?t.addIssue({code:E.ZodIssueCode.custom,message:"Cannot mix port and net connections in a current probe."}):s?n&&o||t.addIssue({code:E.ZodIssueCode.custom,message:"Current probe using source ports requires both positive_source_port_id and negative_source_port_id."}):a?r&&i||t.addIssue({code:E.ZodIssueCode.custom,message:"Current probe using source nets requires both positive_source_net_id and negative_source_net_id."}):t.addIssue({code:E.ZodIssueCode.custom,message:"A current probe must have either positive/negative source port ids or positive/negative source net ids."})}),Ftn=_c.extend({type:E.literal("simulation_unknown_experiment_error"),simulation_unknown_experiment_error_id:vn("simulation_unknown_experiment_error"),error_type:E.literal("simulation_unknown_experiment_error").default("simulation_unknown_experiment_error"),simulation_experiment_id:E.string().optional(),subcircuit_id:E.string().optional()}).describe("An unknown error occurred during the simulation experiment."),Jfr=E.enum(["resistance","capacitance","inductance","voltage","current"]),Cae=E.object({type:E.literal("simulation_parameter_sweep"),simulation_parameter_sweep_id:vn("simulation_parameter_sweep"),simulation_experiment_id:E.string(),name:E.string().optional(),parameter_values:E.array(E.number()).min(1),parameter_unit:Xqe}),ztn=E.discriminatedUnion("parameter_type",[Cae.extend({parameter_type:E.literal("resistance"),resistor_source_component_id:E.string()}),Cae.extend({parameter_type:E.literal("capacitance"),capacitor_source_component_id:E.string()}),Cae.extend({parameter_type:E.literal("inductance"),inductor_source_component_id:E.string()}),Cae.extend({parameter_type:E.literal("voltage"),source_net_id:E.string()}),Cae.extend({parameter_type:E.literal("current"),current_source_component_id:E.string()})]).describe("Repeats a simulation experiment over component parameter values"),Otn=E.object({type:E.literal("simulation_dc_operating_point_voltage"),simulation_dc_operating_point_voltage_id:vn("simulation_dc_operating_point_voltage"),simulation_experiment_id:E.string(),simulation_parameter_sweep_coordinate:Lw.optional(),simulation_voltage_probe_id:E.string(),voltage:E.number(),name:E.string().optional(),color:E.string().optional()}),Vtn=E.object({type:E.literal("simulation_dc_operating_point_current"),simulation_dc_operating_point_current_id:vn("simulation_dc_operating_point_current"),simulation_experiment_id:E.string(),simulation_parameter_sweep_coordinate:Lw.optional(),simulation_current_probe_id:E.string(),current:E.number(),name:E.string().optional(),color:E.string().optional()}),Ytn=E.object({type:E.literal("simulation_dc_sweep_voltage_graph"),simulation_dc_sweep_voltage_graph_id:vn("simulation_dc_sweep_voltage_graph"),simulation_experiment_id:E.string(),simulation_parameter_sweep_coordinate:Lw.optional(),simulation_voltage_probe_id:E.string(),sweep_values:E.array(E.number()),sweep_unit:e6e,voltage_levels:E.array(E.number()),name:E.string().optional(),color:E.string().optional()}).refine((e)=>e.sweep_values.length===e.voltage_levels.length,{message:"sweep_values and voltage_levels must have the same length"}),Gtn=E.object({type:E.literal("simulation_dc_sweep_current_graph"),simulation_dc_sweep_current_graph_id:vn("simulation_dc_sweep_current_graph"),simulation_experiment_id:E.string(),simulation_parameter_sweep_coordinate:Lw.optional(),simulation_current_probe_id:E.string(),sweep_values:E.array(E.number()),sweep_unit:e6e,current_levels:E.array(E.number()),name:E.string().optional(),color:E.string().optional()}).refine((e)=>e.sweep_values.length===e.current_levels.length,{message:"sweep_values and current_levels must have the same length"}),jqe=E.object({re:E.number(),im:E.number()}),Utn=E.object({type:E.literal("simulation_ac_sweep_voltage_graph"),simulation_ac_sweep_voltage_graph_id:vn("simulation_ac_sweep_voltage_graph"),simulation_experiment_id:E.string(),simulation_parameter_sweep_coordinate:Lw.optional(),simulation_voltage_probe_id:E.string(),frequencies_hz:E.array(E.number()),complex_voltages:E.array(jqe),name:E.string().optional(),color:E.string().optional()}).refine((e)=>e.frequencies_hz.length===e.complex_voltages.length,{message:"frequencies_hz and complex_voltages must have the same length"}),Wtn=E.object({type:E.literal("simulation_ac_sweep_current_graph"),simulation_ac_sweep_current_graph_id:vn("simulation_ac_sweep_current_graph"),simulation_experiment_id:E.string(),simulation_parameter_sweep_coordinate:Lw.optional(),simulation_current_probe_id:E.string(),frequencies_hz:E.array(E.number()),complex_currents:E.array(jqe),name:E.string().optional(),color:E.string().optional()}).refine((e)=>e.frequencies_hz.length===e.complex_currents.length,{message:"frequencies_hz and complex_currents must have the same length"}),Xtn=E.object({type:E.literal("simulation_op_amp"),simulation_op_amp_id:vn("simulation_op_amp"),source_component_id:E.string().optional(),inverting_input_source_port_id:E.string(),non_inverting_input_source_port_id:E.string(),output_source_port_id:E.string(),positive_supply_source_port_id:E.string(),negative_supply_source_port_id:E.string()}).describe("Defines a simple ideal operational amplifier for simulation"),jtn=E.object({type:E.literal("simulation_spice_subcircuit"),simulation_spice_subcircuit_id:vn("simulation_spice_subcircuit"),source_component_id:E.string(),spice_pin_to_source_port_map:E.record(E.string(),E.string()),subcircuit_source:E.string()}).describe("Defines a custom SPICE subcircuit model for simulation"),Vzt=(e)=>e!==void 0,Ktn=E.object({type:E.literal("simulation_oscilloscope_trace"),simulation_oscilloscope_trace_id:vn("simulation_oscilloscope_trace"),simulation_transient_voltage_graph_id:E.string().optional(),simulation_transient_current_graph_id:E.string().optional(),simulation_voltage_probe_id:E.string().optional(),simulation_current_probe_id:E.string().optional(),display_name:E.string().optional(),color:E.string().optional(),display_center_value:E.number().optional(),display_center_offset_divs:E.number().optional(),volts_per_div:E.number().positive().optional(),amps_per_div:E.number().positive().optional()}).describe("Defines how a simulation measurement is rendered as an oscilloscope-style trace.").superRefine((e,t)=>{let n=[e.simulation_transient_voltage_graph_id,e.simulation_voltage_probe_id].filter(Vzt).length,o=[e.simulation_transient_current_graph_id,e.simulation_current_probe_id].filter(Vzt).length;n+o!==1&&t.addIssue({code:E.ZodIssueCode.custom,message:"An oscilloscope trace must reference exactly one voltage graph, current graph, voltage probe, or current probe."}),n>0&&e.amps_per_div!==void 0&&t.addIssue({code:E.ZodIssueCode.custom,message:"Voltage oscilloscope traces must use volts_per_div, not amps_per_div."}),o>0&&e.volts_per_div!==void 0&&t.addIssue({code:E.ZodIssueCode.custom,message:"Current oscilloscope traces must use amps_per_div, not volts_per_div."})}),yWe=E.object({x:E.number().finite(),y:E.number().finite(),layer:Oi}),Lje=E.discriminatedUnion("contact_type",[yWe.extend({contact_type:E.literal("pcb_port"),pcb_port_id:E.string().min(1)}),yWe.extend({contact_type:E.literal("pcb_via"),pcb_via_id:E.string().min(1)}),yWe.extend({contact_type:E.literal("pcb_copper_pour"),pcb_copper_pour_id:E.string().min(1)})]).describe("Identifies the reference conductor at a return-current contact"),Hje=E.object({signal_pcb_port_id:E.string().min(1),reference_pcb_port_id:E.string().min(1).optional(),reference_layer:Oi,resistance:E.number().finite().positive()}).describe("A two-terminal return-current excitation port with resistance in ohms"),$tn=E.object({type:E.literal("simulation_return_current_excitation"),simulation_return_current_excitation_id:vn("simulation_return_current_excitation"),simulation_experiment_id:E.string().min(1),pcb_trace_id:E.string().min(1),ground_source_net_id:E.string().min(1),current:E.number().finite(),return_source:Lje,return_sink:Lje,source_port:Hje.optional(),load_port:Hje.optional()}).describe("Excites a signal trace with signed current in amperes, peak for AC; return_source is near the load and return_sink near the driver for positive current"),qtn=E.object({type:E.literal("simulation_pcb_return_current_result"),simulation_pcb_return_current_result_id:vn("simulation_pcb_return_current_result"),simulation_experiment_id:E.string().min(1),pcb_board_id:E.string().min(1),simulation_return_current_excitation_ids:E.array(E.string().min(1)).min(1).refine((e)=>new Set(e).size===e.length,"Excitation IDs must be unique"),frequency_hz:E.number().finite().positive().optional()}).describe("A PCB return-current result at one frequency, or a frequency-independent result when frequency_hz is absent");function Jtn(e){return Tle.extend({project_relative_path:E.string().min(1),url:E.string().url()}).superRefine((t,n)=>{if(e.includes(t.mimetype)||n.addIssue({code:E.ZodIssueCode.custom,path:["mimetype"],message:`Expected one of: ${e.join(", ")}`}),t.url.startsWith("data:"))/^data:([^;,]*)(?:;[^,]*)?,/i.exec(t.url)?.[1]?.toLowerCase()!==t.mimetype&&n.addIssue({code:E.ZodIssueCode.custom,path:["url"],message:"Data URL media type must match asset.mimetype"})})}var Ztn=Jtn(["application/json","application/gzip"]),enn=Jtn(["image/png","image/webp"]),tnn=E.object({type:E.literal("simulation_pcb_return_current_field"),simulation_pcb_return_current_field_id:vn("simulation_pcb_return_current_field"),simulation_pcb_return_current_result_id:E.string().min(1),layer:Oi,source_net_id:E.string().min(1),field_type:E.enum(["real","complex_phasor"]),min_x:E.number().finite(),min_y:E.number().finite(),columns:E.number().int().positive().safe(),rows:E.number().int().positive().safe(),cell_width:E.number().finite().positive(),cell_height:E.number().finite().positive(),copper_thickness:E.number().finite().positive(),data_format:E.literal("simulation_return_current_grid_json_v1"),field_asset:Ztn}).superRefine((e,t)=>{Number.isSafeInteger(e.columns*e.rows)||t.addIssue({code:E.ZodIssueCode.custom,path:["columns"],message:"The grid cell count must be a safe integer"})}).describe("A sampled sheet-current field in A/mm, using plain or gzipped JSON Asset URLs; dimensions are PCB millimeters"),zK=E.array(E.number().finite().nullable()).min(1),nnn=E.discriminatedUnion("field_type",[E.object({field_type:E.literal("real"),sheet_current_x:zK,sheet_current_y:zK}),E.object({field_type:E.literal("complex_phasor"),sheet_current_x_real:zK,sheet_current_x_imag:zK,sheet_current_y_real:zK,sheet_current_y_imag:zK})]).superRefine((e,t)=>{let n=e.field_type==="real"?[e.sheet_current_x,e.sheet_current_y]:[e.sheet_current_x_real,e.sheet_current_x_imag,e.sheet_current_y_real,e.sheet_current_y_imag],o=n[0];if(n.some((r)=>r.length!==o.length))t.addIssue({code:E.ZodIssueCode.custom,message:"Current channels must have equal lengths"});else for(let r=0;r<o.length;r++){let i=o[r]===null;if(n.some((s)=>s[r]===null!==i))return void t.addIssue({code:E.ZodIssueCode.custom,message:`Cell ${r} must be null in every channel or finite in every channel`})}}).describe("Decoded real or complex sheet-current arrays with a shared conductor mask");function Zfr(e){let t=e.columns*e.rows;if(!Number.isSafeInteger(e.columns)||e.columns<=0||!Number.isSafeInteger(e.rows)||e.rows<=0||!Number.isSafeInteger(t))throw Error("Grid dimensions must be positive safe integers");return nnn.superRefine((n,o)=>{n.field_type!==e.field_type&&o.addIssue({code:E.ZodIssueCode.custom,path:["field_type"],message:"Decoded field_type must match the parent field"}),(n.field_type==="real"?n.sheet_current_x:n.sheet_current_x_real).length!==t&&o.addIssue({code:E.ZodIssueCode.custom,message:`Each current channel must have ${t} entries (columns * rows)`})})}var onn=E.object({type:E.literal("simulation_pcb_return_current_heatmap"),simulation_pcb_return_current_heatmap_id:vn("simulation_pcb_return_current_heatmap"),simulation_pcb_return_current_result_id:E.string().min(1),layer:Oi,source_net_id:E.string().min(1),min_x:E.number().finite(),min_y:E.number().finite(),max_x:E.number().finite(),max_y:E.number().finite(),image_asset:enn}).superRefine((e,t)=>{for(let n of["x","y"])e[`max_${n}`]<=e[`min_${n}`]&&t.addIssue({code:E.ZodIssueCode.custom,path:[`max_${n}`],message:"Heatmap bounds must have positive width and height"})}).describe("A transparent PNG/WebP current-density overlay in A/mm²; the top-left pixel maps to (min_x, max_y)"),Yzt=E.object({type:E.literal("simulation_pcb_return_current_marker"),simulation_pcb_return_current_marker_id:vn("simulation_pcb_return_current_marker"),simulation_pcb_return_current_result_id:E.string().min(1),role:E.enum(["signal_source","signal_load","return_source","return_sink","signal_transition","return_transition"]),label:E.string().optional(),label_x:E.number().finite().optional(),label_y:E.number().finite().optional()}),rnn=E.discriminatedUnion("target_type",[Yzt.extend({target_type:E.literal("pcb_port"),pcb_port_id:E.string().min(1),layer:Oi}),Yzt.extend({target_type:E.literal("pcb_via"),pcb_via_id:E.string().min(1),from_layer:Oi,to_layer:Oi})]).superRefine((e,t)=>{e.label_x===void 0!=(e.label_y===void 0)&&t.addIssue({code:E.ZodIssueCode.custom,path:["label_x"],message:"label_x and label_y must be provided together"}),e.target_type==="pcb_via"&&e.from_layer===e.to_layer&&t.addIssue({code:E.ZodIssueCode.custom,path:["to_layer"],message:"A via transition must connect distinct layers"})}).describe("A signal/return port or via highlight; markers do not assert measured via-transfer currents"),inn=E.union([wJt,pJt,MJt,dJt,uJt,hJt,_Jt,mJt,xqe,Aqe,$be,yqe,fqe,Cqe,bqe,Iqe,Pqe,Eqe,Mqe,Nqe,wqe,Bqe,Tqe,Dqe,Sqe,vqe,fJt,yJt,gJt,Rqe,Qqe,kqe,Lqe,xJt,EJt,Hqe,zqe,Fqe,CJt,bJt,IJt,vJt,SJt,PJt,Oqe,Vqe,AJt,AZt,CZt,MZt,Ven,Yen,Gen,jen,Ken,$en,qen,Jen,wZt,Qen,ken,BZt,ZZt,QZt,zZt,OZt,VZt,UZt,YZt,GZt,WZt,een,DZt,NZt,RZt,ten,nen,aen,cen,Uen,uen,pen,men,_en,ben,gen,Aen,fen,yen,Cen,XZt,jZt,KZt,$Zt,len,hen,den,qZt,JZt,htn,dtn,utn,ptn,ven,Ien,Sen,Pen,Een,Men,wen,Ben,Ten,Wen,Xen,Den,Nen,Zen,Oen,etn,ttn,ntn,stn,atn,ctn,ltn,mtn,_tn,gtn,Atn,ftn,BJt,YJt,HJt,FJt,zJt,OJt,kJt,LJt,GJt,VJt,TJt,WJt,XJt,UJt,qJt,JJt,ZJt,eZt,tZt,nZt,hZt,oZt,rZt,iZt,lZt,sZt,aZt,xtn,btn,vtn,Ctn,Etn,Btn,Ntn,$tn,qtn,tnn,onn,rnn,Rtn,Qtn,Otn,Vtn,Ytn,Gtn,Utn,Wtn,ztn,ktn,Ltn,Htn,Ktn,Ftn,Xtn,jtn]),FCe=inn;function Gzt(e,t,n){if(!t||!n)return;let o=e.get(t);o||(o=new Set,e.set(t,o)),o.add(n);let r=e.get(n);r||(r=new Set,e.set(n,r)),r.add(t)}var Rx=(e,t={})=>{let n=e,o=n._internal_store;if(!o){o={counts:{},editCount:0},n._internal_store=o;for(let i of n){let s=i.type,a=i[`${s}_id`];if(!a)continue;let c=Number.parseInt(a.split("_").pop());Number.isNaN(c)||(o.counts[s]=Math.max(o.counts[s]??0,c))}}let r=new Proxy({},{get:(i,s)=>{if(s==="toArray")return()=>(n.editCount=o.editCount,n);if(s==="editCount")return o.editCount;if(s==="subtree")return(c)=>Rx(function(l,h){if(!h.subcircuit_id&&!h.source_group_id)return[...l];let d=h;if(h.subcircuit_id){let A=new Set([h.subcircuit_id]),g=new Map,f=new Map;for(let x of l)if(x.type==="source_group"){let{source_group_id:C,subcircuit_id:b}=x;b&&f.set(C,b);let I=x.parent_source_group_id;I&&(g.has(I)||g.set(I,[]),g.get(I).push(C))}let y;for(let[x,C]of f)if(C===h.subcircuit_id){y=x;break}if(y){let x=(C)=>{let b=g.get(C)||[];for(let I of b){let v=f.get(I);v&&A.add(v),x(I)}};x(y),d={...h,subcircuit_ids:Array.from(A)}}}let u=new Map;for(let A of l){let g=A[`${A.type}_id`];typeof g=="string"&&u.set(g,A)}let _=new Map;for(let A of l){let g=Object.entries(A);for(let[f,y]of g)if(f!=="parent_source_group_id"){if(f.endsWith("_id")&&typeof y=="string")Gzt(_,A,u.get(y));else if(f.endsWith("_ids")&&Array.isArray(y))for(let x of y)typeof x=="string"&&Gzt(_,A,u.get(x))}}let p=[],m=new Set;for(let A of l){let g=!1;(d.subcircuit_id&&("subcircuit_id"in A)&&A.subcircuit_id===d.subcircuit_id||d.subcircuit_ids&&("subcircuit_id"in A)&&A.subcircuit_id&&d.subcircuit_ids.includes(A.subcircuit_id)||d.source_group_id&&("source_group_id"in A)&&A.source_group_id===d.source_group_id||d.source_group_id&&("member_source_group_ids"in A)&&Array.isArray(A.member_source_group_ids)&&A.member_source_group_ids.includes(d.source_group_id))&&(g=!0),g&&(p.push(A),m.add(A))}for(;p.length>0;){let A=p.shift(),g=_.get(A);if(g)for(let f of g)m.has(f)||(m.add(f),p.push(f))}return l.filter((A)=>m.has(A))}(n,c),t);if(s==="insert")return(c)=>{let l=c.type;if(!l)throw Error("insert requires an element with a type");o.counts[l]??=-1,o.counts[l]++;let h=o.counts[l],d={...c,type:l,[`${l}_id`]:`${l}_${h}`};if(t.validateInserts)(LCe[l]??FCe).parse(d);return n.push(d),o.editCount++,d};if(s==="insertAll")return(c)=>c.map((l)=>r.insert(l));let a=s;return{get:(c)=>n.find((l)=>l.type===a&&l[`${a}_id`]===c),getUsing:(c)=>{let l=Object.keys(c);if(l.length!==1)throw Error("getUsing requires exactly one key, e.g. { pcb_component_id }");let h=l[0],d=h.replace("_id",""),u=n.find((_)=>_.type===d&&_[h]===c[h]);return u?n.find((_)=>_.type===a&&_[`${a}_id`]===u[`${a}_id`]):null},getWhere:(c)=>{let l=Object.keys(c);return n.find((h)=>h.type===a&&l.every((d)=>h[d]===c[d]))},list:(c)=>{let l=c?Object.keys(c):[];return n.filter((h)=>h.type===a&&l.every((d)=>h[d]===c[d]))},insert:(c)=>{o.counts[a]??=-1,o.counts[a]++;let l=o.counts[a],h={type:a,[`${a}_id`]:`${a}_${l}`,...c};if(t.validateInserts)(LCe[a]??FCe).parse(h);return n.push(h),o.editCount++,h},delete:(c)=>{let l=n.find((h)=>h[`${a}_id`]===c);l&&(n.splice(n.indexOf(l),1),o.editCount++)},update:(c,l)=>{let h=n.find((d)=>d.type===a&&d[`${a}_id`]===c);return h?(Object.assign(h,l),o.editCount++,h):null},select:(c)=>{if(a==="source_component")return n.find((l)=>l.type==="source_component"&&l.name===c.replace(/\./g,""));if(a==="pcb_port"||a==="source_port"||a==="schematic_port"){let[l,h]=c.replace(/\./g,"").split(/[\s\>]+/),d=n.find((_)=>_.type==="source_component"&&_.name===l);if(!d)return null;let u=n.find((_)=>_.type==="source_port"&&_.source_component_id===d.source_component_id&&(_.name===h||(_.port_hints??[]).includes(h)));if(!u)return null;if(a==="source_port")return u;if(a==="pcb_port")return n.find((_)=>_.type==="pcb_port"&&_.source_port_id===u.source_port_id);if(a==="schematic_port")return n.find((_)=>_.type==="schematic_port"&&_.source_port_id===u.source_port_id)}}}}});return r};Rx.unparsed=Rx;var sb=Rx;function xWe(e){let t=e.type;return`${t}:${e[`${t}_id`]}`}var Uzt=(e,t={})=>{let n=e._internal_store_indexed;if(!n){n={counts:{},editCount:0,indexes:{}};for(let i of e){let s=i.type,a=i[`${s}_id`];if(!a)continue;let c=Number.parseInt(a.split("_").pop()||"");Number.isNaN(c)||(n.counts[s]=Math.max(n.counts[s]??0,c))}let o=t.indexConfig||{},r=n.indexes;if(o.byId&&(r.byId=new Map),o.byType&&(r.byType=new Map),o.byRelation&&(r.byRelation=new Map),o.bySubcircuit&&(r.bySubcircuit=new Map),o.byCustomField&&o.byCustomField.length>0){r.byCustomField=new Map;for(let i of o.byCustomField)r.byCustomField.set(i,new Map)}for(let i of e){if(o.byId){let s=xWe(i);r.byId.set(s,i)}if(o.byType){let s=r.byType.get(i.type)||[];s.push(i),r.byType.set(i.type,s)}if(o.byRelation){let s=Object.entries(i);for(let[a,c]of s)if(a.endsWith("_id")&&a!==`${i.type}_id`&&typeof c=="string"){let l=r.byRelation.get(a)||new Map,h=l.get(c)||[];h.push(i),l.set(c,h),r.byRelation.set(a,l)}}if(o.bySubcircuit&&"subcircuit_id"in i){let s=i.subcircuit_id;if(s&&typeof s=="string"){let a=r.bySubcircuit.get(s)||[];a.push(i),r.bySubcircuit.set(s,a)}}if(o.byCustomField&&r.byCustomField){for(let s of o.byCustomField)if(s in i){let a=i[s];if(a!==void 0&&(typeof a=="string"||typeof a=="number")){let c=String(a),l=r.byCustomField.get(s),h=l.get(c)||[];h.push(i),l.set(c,h)}}}}e._internal_store_indexed=n}return new Proxy({},{get:(o,r)=>{if(r==="toArray")return()=>(e.editCount=n.editCount,e);if(r==="editCount")return n.editCount;let i=r;return{get:(s)=>{let a=t.indexConfig||{};if(a.byId&&n.indexes.byId)return n.indexes.byId.get(`${i}:${s}`)||null;if(a.byType&&n.indexes.byType)return(n.indexes.byType.get(i)||[]).find((c)=>c[`${i}_id`]===s)||null;return e.find((c)=>c.type===i&&c[`${i}_id`]===s)||null},getUsing:(s)=>{let a=t.indexConfig||{},c=Object.keys(s);if(c.length!==1)throw Error("getUsing requires exactly one key, e.g. { pcb_component_id }");let l=c[0],h=l.replace("_id","");if(a.byRelation&&n.indexes.byRelation){let u=n.indexes.byRelation.get(l);if(u){let _=(u.get(s[l])||[]).find((m)=>m.type===h);if(!_)return null;let p=_[`${i}_id`];if(a.byId&&n.indexes.byId)return n.indexes.byId.get(`${i}:${p}`)||null;if(a.byType&&n.indexes.byType)return(n.indexes.byType.get(i)||[]).find((m)=>m[`${i}_id`]===p)||null;return e.find((m)=>m.type===i&&m[`${i}_id`]===p)||null}}let d=e.find((u)=>u.type===h&&u[l]===s[l]);return d&&e.find((u)=>u.type===i&&u[`${i}_id`]===d[`${i}_id`])||null},getWhere:(s)=>{let a=t.indexConfig||{},c=Object.keys(s);if(c.length===1&&a.byCustomField&&n.indexes.byCustomField){let l=c[0],h=n.indexes.byCustomField.get(l);if(h){let d=String(s[l]);return(h.get(d)||[]).find((u)=>u.type===i)||null}}if("subcircuit_id"in s&&a.bySubcircuit&&n.indexes.bySubcircuit){let l=s.subcircuit_id;return(n.indexes.bySubcircuit.get(l)||[]).find((h)=>h.type===i&&c.every((d)=>h[d]===s[d]))||null}if(a.byType&&n.indexes.byType)return(n.indexes.byType.get(i)||[]).find((l)=>c.every((h)=>l[h]===s[h]))||null;return e.find((l)=>l.type===i&&c.every((h)=>l[h]===s[h]))||null},list:(s)=>{let a=t.indexConfig||{},c=s?Object.keys(s):[];if(c.length===0&&a.byType&&n.indexes.byType)return n.indexes.byType.get(i)||[];if(c.length===1&&c[0]==="subcircuit_id"&&a.bySubcircuit&&n.indexes.bySubcircuit){let h=s.subcircuit_id;return(n.indexes.bySubcircuit.get(h)||[]).filter((d)=>d.type===i)}let l;return l=a.byType&&n.indexes.byType?n.indexes.byType.get(i)||[]:e.filter((h)=>h.type===i),c.length>0?l.filter((h)=>c.every((d)=>h[d]===s[d])):l},insert:(s)=>{n.counts[i]??=-1,n.counts[i]++;let a=n.counts[i],c={type:i,[`${i}_id`]:`${i}_${a}`,...s};if(t.validateInserts)(LCe[i]??FCe).parse(c);e.push(c),n.editCount++;let l=t.indexConfig||{};if(l.byId&&n.indexes.byId){let h=xWe(c);n.indexes.byId.set(h,c)}if(l.byType&&n.indexes.byType){let h=n.indexes.byType.get(i)||[];h.push(c),n.indexes.byType.set(i,h)}if(l.byRelation&&n.indexes.byRelation){let h=Object.entries(c);for(let[d,u]of h)if(d.endsWith("_id")&&d!==`${c.type}_id`&&typeof u=="string"){let _=n.indexes.byRelation.get(d)||new Map,p=_.get(u)||[];p.push(c),_.set(u,p),n.indexes.byRelation.set(d,_)}}if(l.bySubcircuit&&n.indexes.bySubcircuit&&"subcircuit_id"in c){let h=c.subcircuit_id;if(h&&typeof h=="string"){let d=n.indexes.bySubcircuit.get(h)||[];d.push(c),n.indexes.bySubcircuit.set(h,d)}}if(l.byCustomField&&n.indexes.byCustomField){for(let h of l.byCustomField)if(h in c){let d=c[h];if(d!==void 0&&(typeof d=="string"||typeof d=="number")){let u=String(d),_=n.indexes.byCustomField.get(h),p=_.get(u)||[];p.push(c),_.set(u,p)}}}return c},delete:(s)=>{let a=t.indexConfig||{},c;if(a.byId&&n.indexes.byId)c=n.indexes.byId.get(`${i}:${s}`);else if(a.byType&&n.indexes.byType)c=(n.indexes.byType.get(i)||[]).find((d)=>d[`${i}_id`]===s);else c=e.find((h)=>h[`${i}_id`]===s);if(!c)return;let l=e.indexOf(c);if(l>=0&&(e.splice(l,1),n.editCount++),a.byId&&n.indexes.byId){let h=xWe(c);n.indexes.byId.delete(h)}if(a.byType&&n.indexes.byType){let h=(n.indexes.byType.get(i)||[]).filter((d)=>d[`${i}_id`]!==s);n.indexes.byType.set(i,h)}if(a.byRelation&&n.indexes.byRelation)for(let[h,d]of n.indexes.byRelation.entries())for(let[u,_]of d.entries()){let p=_.filter((m)=>m!==c);p.length===0?d.delete(u):d.set(u,p)}if(a.bySubcircuit&&n.indexes.bySubcircuit&&"subcircuit_id"in c){let h=c.subcircuit_id;if(h){let d=(n.indexes.bySubcircuit.get(h)||[]).filter((u)=>u!==c);d.length===0?n.indexes.bySubcircuit.delete(h):n.indexes.bySubcircuit.set(h,d)}}if(a.byCustomField&&n.indexes.byCustomField)for(let h of n.indexes.byCustomField.values())for(let[d,u]of h.entries()){let _=u.filter((p)=>p!==c);_.length===0?h.delete(d):h.set(d,_)}},update:(s,a)=>{let c=t.indexConfig||{},l;if(c.byId&&n.indexes.byId)l=n.indexes.byId.get(`${i}:${s}`);else if(c.byType&&n.indexes.byType)l=(n.indexes.byType.get(i)||[]).find((d)=>d[`${i}_id`]===s);else l=e.find((h)=>h.type===i&&h[`${i}_id`]===s);if(!l)return null;if(c.byRelation&&n.indexes.byRelation){let h=Object.entries(l);for(let[d,u]of h)if(d.endsWith("_id")&&d!==`${l.type}_id`&&typeof u=="string"&&d in a&&a[d]!==u){let _=n.indexes.byRelation.get(d);if(_){let p=(_.get(u)||[]).filter((m)=>m!==l);p.length===0?_.delete(u):_.set(u,p)}}}if(c.bySubcircuit&&n.indexes.bySubcircuit&&"subcircuit_id"in l&&"subcircuit_id"in a){let h=l.subcircuit_id;if(h!==a.subcircuit_id){let d=(n.indexes.bySubcircuit.get(h)||[]).filter((u)=>u!==l);d.length===0?n.indexes.bySubcircuit.delete(h):n.indexes.bySubcircuit.set(h,d)}}if(c.byCustomField&&n.indexes.byCustomField){for(let h of c.byCustomField)if(h in l&&h in a&&l[h]!==a[h]){let d=n.indexes.byCustomField.get(h);if(d){let u=String(l[h]),_=(d.get(u)||[]).filter((p)=>p!==l);_.length===0?d.delete(u):d.set(u,_)}}}if(Object.assign(l,a),n.editCount++,c.byRelation&&n.indexes.byRelation){let h=Object.entries(l);for(let[d,u]of h)if(d.endsWith("_id")&&d!==`${l.type}_id`&&typeof u=="string"&&d in a){let _=n.indexes.byRelation.get(d)||new Map,p=_.get(u)||[];p.includes(l)||(p.push(l),_.set(u,p),n.indexes.byRelation.set(d,_))}}if(c.bySubcircuit&&n.indexes.bySubcircuit&&"subcircuit_id"in l&&"subcircuit_id"in a){let h=l.subcircuit_id;if(h&&typeof h=="string"){let d=n.indexes.bySubcircuit.get(h)||[];d.includes(l)||(d.push(l),n.indexes.bySubcircuit.set(h,d))}}if(c.byCustomField&&n.indexes.byCustomField){for(let h of c.byCustomField)if(h in l&&h in a){let d=l[h];if(d!==void 0&&(typeof d=="string"||typeof d=="number")){let u=String(d),_=n.indexes.byCustomField.get(h),p=_.get(u)||[];p.includes(l)||(p.push(l),_.set(u,p))}}}return l},select:(s)=>{if(i==="source_component")return e.find((a)=>a.type==="source_component"&&a.name===s.replace(/\./g,""))||null;if(i==="pcb_port"||i==="source_port"||i==="schematic_port"){let[a,c]=s.replace(/\./g,"").split(/[\s\>]+/),l=e.find((d)=>d.type==="source_component"&&d.name===a);if(!l)return null;let h=e.find((d)=>d.type==="source_port"&&d.source_component_id===l.source_component_id&&(d.name===c||(d.port_hints??[]).includes(c)));if(!h)return null;if(i==="source_port")return h;if(i==="pcb_port")return e.find((d)=>d.type==="pcb_port"&&d.source_port_id===h.source_port_id)||null;if(i==="schematic_port")return e.find((d)=>d.type==="schematic_port"&&d.source_port_id===h.source_port_id)||null}return null}}}})};Uzt.unparsed=Uzt;var Wzt=(e)=>e[`${e.type}_id`],Xzt=(e,t)=>{let n=Rx(e).pcb_port.get(t);if(!n)return`pcb_port[#${t}]`;let o=n.pcb_component_id?Rx(e).pcb_component.get(n.pcb_component_id):void 0;if(!o)return`pcb_port[#${t}]`;let r=Rx(e).source_component.get(o.source_component_id);if(!r)return`pcb_port[#${t}]`;let i=Rx(e).source_port.get(n.source_port_id);if(!i)return`pcb_port[#${t}]`;let s;return s=i?.port_hints&&i.port_hints.length>0||i.port_hints&&i.port_hints.length>0?i.port_hints[0]:t,`pcb_port[.${r.name} > .${s}]`};function e2r(e,t){let n=Rx(e).pcb_trace.get(t);if(!n)return`trace[${t}]`;let o=n.route.flatMap((r)=>[r.start_pcb_port_id,r.end_pcb_port_id]).filter(Boolean);if(o.length===0)return`trace[${t}]`;return`trace[${o.map((r)=>{let i=function(s){let a=Rx(e).pcb_port.get(s);if(!a)return null;let c=a.pcb_component_id?Rx(e).pcb_component.get(a.pcb_component_id):void 0;if(!c)return null;let l=Rx(e).source_component.get(c.source_component_id);if(!l)return null;let h=Rx(e).source_port.get(a.source_port_id),d=h?.port_hints?h.port_hints[1]:"";return{componentName:l.name,portHint:d}}(r);return i?`.${i.componentName} > port.${i.portHint}`:`port[${r}]`}).join(", ")}]`}var snn=(e,t)=>{if(typeof t=="string"){let n=((o,r)=>o.find((i)=>Wzt(i)===r)??null)(e,t);return snn(e,n)}switch(t.type){case"pcb_port":return Xzt(e,t.pcb_port_id);case"pcb_smtpad":return function(n,o){let r=Rx(n).pcb_smtpad.get(o);return r&&r.pcb_port_id?Xzt(n,r.pcb_port_id):`smtpad[${o}]`}(e,t.pcb_smtpad_id);case"pcb_trace":return e2r(e,t.pcb_trace_id);case"source_component":return`source_component[${t.name}]`;default:return`${t.type}[#${Wzt(t)}]`}},Fje=(e,t)=>({minX:Math.min(e.minX,t.minX),minY:Math.min(e.minY,t.minY),maxX:Math.max(e.maxX,t.maxX),maxY:Math.max(e.maxY,t.maxY)}),bae=(e,t,n)=>{let o=n/2;return{minX:e-o,minY:t-o,maxX:e+o,maxY:t+o}},jzt=(e,t,n,o,r)=>{let i=n/2,s=o/2,a=r*Math.PI/180,c=Math.cos(a),l=Math.sin(a),h=[{x:-i,y:-s},{x:i,y:-s},{x:i,y:s},{x:-i,y:s}].map((d)=>({x:e+d.x*c-d.y*l,y:t+d.x*l+d.y*c}));return{minX:Math.min(...h.map((d)=>d.x)),minY:Math.min(...h.map((d)=>d.y)),maxX:Math.max(...h.map((d)=>d.x)),maxY:Math.max(...h.map((d)=>d.y))}},t2r=(e,t,n,o,r)=>{let i=n/2,s=o/2,a=r*Math.PI/180,c=Math.cos(a),l=Math.sin(a),h=Math.hypot(i*c,s*l),d=Math.hypot(i*l,s*c);return{minX:e-h,minY:t-d,maxX:e+h,maxY:t+d}},n2r=(e,t,n,o,r)=>{let i=Math.min(n,o)/2,s=Math.max(n,o)/2-i,a=r*Math.PI/180,c=n>=o?{x:s,y:0}:{x:0,y:s},l={x:c.x*Math.cos(a)-c.y*Math.sin(a),y:c.x*Math.sin(a)+c.y*Math.cos(a)},h=Math.abs(l.x)+i,d=Math.abs(l.y)+i;return{minX:e-h,minY:t-d,maxX:e+h,maxY:t+d}},j4e=(e)=>e.length===0?null:{minX:Math.min(...e.map((t)=>t.x)),minY:Math.min(...e.map((t)=>t.y)),maxX:Math.max(...e.map((t)=>t.x)),maxY:Math.max(...e.map((t)=>t.y))},CWe=(e)=>Array.isArray(e)?e.flatMap((t)=>{if(!t||typeof t!="object")return[];if("x"in t&&"y"in t&&typeof t.x=="number"&&typeof t.y=="number")return[{x:t.x,y:t.y}];if("start"in t&&"end"in t)return[t.start,t.end].filter((n)=>Boolean(n&&typeof n=="object"&&"x"in n&&"y"in n&&typeof n.x=="number"&&typeof n.y=="number"));return[]}):[],o2r=(e)=>{if(!e.type.startsWith("pcb_"))return null;if(e.type==="pcb_smtpad"&&e.shape==="polygon"&&Array.isArray(e.points))return j4e(e.points);if(e.type==="pcb_hole"&&e.hole_shape==="circle")return bae(e.x,e.y,e.hole_diameter);if(e.type==="pcb_plated_hole"){let d;if("outer_diameter"in e&&typeof e.outer_diameter=="number"?d=bae(e.x,e.y,e.outer_diameter):("hole_diameter"in e)&&typeof e.hole_diameter=="number"&&(d=bae(e.x,e.y,e.hole_diameter)),(e.shape==="oval"||e.shape==="pill")&&typeof e.outer_width=="number"&&typeof e.outer_height=="number")d=(e.shape==="pill"?n2r:t2r)(e.x,e.y,e.outer_width,e.outer_height,e.ccw_rotation??0);if("rect_pad_width"in e&&typeof e.rect_pad_width=="number"&&"rect_pad_height"in e&&typeof e.rect_pad_height=="number"){let u=jzt(e.x,e.y,e.rect_pad_width,e.rect_pad_height,"rect_ccw_rotation"in e?e.rect_ccw_rotation??0:0);d=d?Fje(d,u):u}if("hole_diameter"in e&&typeof e.hole_diameter=="number"){let u=bae(e.x+("hole_offset_x"in e?e.hole_offset_x??0:0),e.y+("hole_offset_y"in e?e.hole_offset_y??0:0),e.hole_diameter);d=d?Fje(d,u):u}if(d)return d}let t=e,n=j4e(CWe(t.route));if(n)return n;let o=j4e(CWe(t.outline));if(o)return o;let r=j4e(CWe(t.points));if(r)return r;let i,s,a,c;"x"in e&&"y"in e&&(i=Number(e.x),s=Number(e.y)),"outer_diameter"in e&&(a=Number(e.outer_diameter),c=Number(e.outer_diameter)),"width"in e&&(a=Number(e.width)),"height"in e&&(c=Number(e.height)),"center"in e&&e.center&&typeof e.center=="object"&&"x"in e.center&&"y"in e.center&&(i=Number(e.center.x),s=Number(e.center.y));let l=0;if("rotation"in e&&typeof e.rotation=="number"&&(l=e.rotation),"ccw_rotation"in e&&typeof e.ccw_rotation=="number"&&(l=e.ccw_rotation),i!==void 0&&s!==void 0)return a!==void 0&&c!==void 0?l?jzt(i,s,a,c,l):{minX:i-a/2,minY:s-c/2,maxX:i+a/2,maxY:s+c/2}:("radius"in e)&&typeof e.radius=="number"?bae(i,s,2*e.radius):{minX:i,minY:s,maxX:i,maxY:s};let h=[t.anchor_position,t.position].filter((d)=>Boolean(d&&typeof d=="object"&&"x"in d&&"y"in d&&typeof d.x=="number"&&typeof d.y=="number")).at(0);return h?{minX:h.x,minY:h.y,maxX:h.x,maxY:h.y}:null},ann=(e)=>{let t={minX:Number.POSITIVE_INFINITY,minY:Number.POSITIVE_INFINITY,maxX:Number.NEGATIVE_INFINITY,maxY:Number.NEGATIVE_INFINITY};for(let n of e){let o=o2r(n);o&&(t=Fje(t,o))}return t},cq=(e)=>e[`${e.type}_id`],V7=0.000000001,jae=(e,t,n)=>{let o=n.x-t.x,r=n.y-t.y,i=o*o+r*r;if(i<=V7)return((h,d)=>Math.hypot(h.x-d.x,h.y-d.y))(e,t);let s=(a=((e.x-t.x)*o+(e.y-t.y)*r)/i,c=0,l=1,Math.max(c,Math.min(l,a)));var a,c,l;return Math.hypot(e.x-(t.x+s*o),e.y-(t.y+s*r))},Kae=(e,t,n)=>(t.x-e.x)*(n.y-e.y)-(t.y-e.y)*(n.x-e.x),$ae=(e,t,n)=>!(Math.abs(Kae(t,n,e))>V7)&&(e.x>=Math.min(t.x,n.x)-V7&&e.x<=Math.max(t.x,n.x)+V7&&e.y>=Math.min(t.y,n.y)-V7&&e.y<=Math.max(t.y,n.y)+V7),r2r=(e,t,n,o)=>{let r=Kae(e,t,n),i=Kae(e,t,o),s=Kae(n,o,e),a=Kae(n,o,t);return(r>V7&&i<-0.000000001||r<-0.000000001&&i>V7)&&(s>V7&&a<-0.000000001||s<-0.000000001&&a>V7)||($ae(n,e,t)||$ae(o,e,t)||$ae(e,n,o)||$ae(t,n,o))},_$=(e)=>{let t=[];if(e.points.length<2)return t;for(let n=0;n<e.points.length;n+=1){let o=e.points[n],r=e.points[(n+1)%e.points.length];o&&r&&t.push([o,r])}return t},zje=(e,t)=>{for(let[o,r]of _$(t))if($ae(e,o,r))return!0;let n=!1;for(let o=0,r=t.points.length-1;o<t.points.length;r=o++){let i=t.points[o],s=t.points[r];if(!i||!s)continue;i.y>e.y!=s.y>e.y&&e.x<(s.x-i.x)*(e.y-i.y)/(s.y-i.y)+i.x&&(n=!n)}return n},Kzt=(e,t)=>{if(t.points.length<3)return Number.POSITIVE_INFINITY;if(zje({x:e.x,y:e.y},t))return 0;let n=Number.POSITIVE_INFINITY;for(let[o,r]of _$(t))n=Math.min(n,jae({x:e.x,y:e.y},o,r));return Math.max(0,n-e.radius)},Oje=(Object.keys({leftside_top:{side:"leftside",alignment:"top"},leftside_bottom:{side:"leftside",alignment:"bottom"},rightside_top:{side:"rightside",alignment:"top"},rightside_bottom:{side:"rightside",alignment:"bottom"},topside_left:{side:"topside",alignment:"left"},topside_right:{side:"topside",alignment:"right"},bottomside_left:{side:"bottomside",alignment:"left"},bottomside_right:{side:"bottomside",alignment:"right"}}),(e,t,n=0)=>{let{a:o,b:r,c:i,d:s,e:a,f:c}=d$e($O(t.x,t.y),qWt(n*Math.PI/180));return e.transform(new aQ(o,r,i,s,a,c))}),aV=(e)=>e.orientation()===D$.CCW?e:e.reverse(),R$=(e,t)=>aV(new xb(new hqe(new U0(e.x,e.y),t))),qae=(e,t,n,o=0,r=0)=>{let i=t/2,s=n/2,a=Math.max(0,Math.min(o,i,s));if(a===0)return Oje(aV(new xb(new dqe(-i,-s,i,s))),e,r);let c=[new ub(new U0(i-a,-s+a),a,-Math.PI/2,0,!0),new ub(new U0(i-a,s-a),a,0,Math.PI/2,!0),new ub(new U0(-i+a,s-a),a,Math.PI/2,Math.PI,!0),new ub(new U0(-i+a,-s+a),a,Math.PI,1.5*Math.PI,!0)],l=[];for(let h=0;h<c.length;h++){let d=c[h],u=c[(h+1)%c.length];l.push(d),d.end.distanceTo(u.start)[0]>0.000000000001&&l.push(new lS(d.end,u.start))}return Oje(aV(new xb(l)),e,r)},$zt=(e)=>{let t=[];for(let n=0;n<e.vertices.length;n++){let o=e.vertices[n],r=e.vertices[(n+1)%e.vertices.length],i=r.x-o.x,s=r.y-o.y;if(i===0&&s===0)continue;let a=o.bulge??0;if(a===0)t.push(new lS(new U0(o.x,o.y),new U0(r.x,r.y)));else{let c=(1-a*a)/(4*a),l=new U0((o.x+r.x)/2-s*c,(o.y+r.y)/2+i*c);t.push(new ub(l,Math.hypot(i,s)*(1+a*a)/(4*Math.abs(a)),Math.atan2(o.y-l.y,o.x-l.x),Math.atan2(r.y-l.y,r.x-l.x),a>0))}}return aV(new xb(t))},Jae=(e,t)=>{for(let n of t.reverse().faces)e.addFace(n.shapes);return e},i2r=(e)=>{if(e.shape==="rect")return qae(e.center,e.width,e.height,0,e.rotation);if(e.shape==="polygon")return aV(new xb(e.points.map((n)=>new U0(n.x,n.y))));let t=$zt(e.brep_shape.outer_ring);for(let n of e.brep_shape.inner_rings)Jae(t,$zt(n));return t},s2r=(e,t=0)=>{if(e.shape==="circle")return((r,i,s)=>Jae(R$(r,i/2),R$(r,s/2)))(e,e.outer_diameter,e.hole_diameter);if("outer_width"in e)return Jae(qae(e,e.outer_width,e.outer_height,Math.min(e.outer_width,e.outer_height)/2,e.ccw_rotation),qae(e,e.hole_width,e.hole_height,Math.min(e.hole_width,e.hole_height)/2,e.ccw_rotation));let n={x:e.x+e.hole_offset_x,y:e.y+e.hole_offset_y},o=e.shape==="hole_with_polygon_pad"?Oje(aV(new xb(e.pad_outline.map((r)=>new U0(r.x,r.y)))),e,e.ccw_rotation??t):qae(e,e.rect_pad_width,e.rect_pad_height,e.rect_border_radius,"rect_ccw_rotation"in e?e.rect_ccw_rotation:0);if(e.shape==="circular_hole_with_rect_pad"||e.shape==="hole_with_polygon_pad"&&e.hole_shape==="circle"){if(e.hole_diameter===void 0)throw Error("Circular plated hole requires hole_diameter");return Jae(o,R$(n,e.hole_diameter/2))}if(!("hole_width"in e)||e.hole_width===void 0||e.hole_height===void 0)throw Error("Slotted plated hole requires hole_width and hole_height");return Jae(o,qae(n,e.hole_width,e.hole_height,Math.min(e.hole_width,e.hole_height)/2,"hole_ccw_rotation"in e?e.hole_ccw_rotation:e.shape==="hole_with_polygon_pad"?e.ccw_rotation??t:0))},qzt=(e,t,n,o=n)=>{let r=Math.hypot(t.x-e.x,t.y-e.y),i=n/2,s=o/2;if(r<=Math.abs(s-i))return R$(i>=s?e:t,Math.max(i,s));let a=Math.atan2(t.y-e.y,t.x-e.x),c=Math.acos((i-s)/r),l=new ub(new U0(e.x,e.y),i,a+c,a-c,!0),h=new ub(new U0(t.x,t.y),s,a-c,a+c,!0);return aV(new xb([l,new lS(l.end,h.start),h,new lS(h.end,l.start)]))},a2r=/\b(?:pcb|source|schematic|subcircuit)_[a-z0-9_]+\b/i,zCe=(e,t,n)=>!e||e===t||t.length>0&&e.includes(t)||a2r.test(e)?n:e,OCe=(e,t)=>{for(let n of e){let o=zCe(n,t,"");if(o)return o}return""},ele=(e,t)=>{let n=e.find((o)=>o.type==="pcb_port"&&o.pcb_port_id===t);if(n?.type==="pcb_port"){let o=e.find((a)=>a.type==="source_port"&&a.source_port_id===n.source_port_id),r=o?.type==="source_port"?e.find((a)=>a.type==="source_component"&&a.source_component_id===o.source_component_id):null,i=OCe([r?.type==="source_component"?r.name:null],r?.type==="source_component"?r.source_component_id:""),s=OCe([o?.type==="source_port"?o.name:null,o?.type==="source_port"?o.pin_number?.toString():null,o?.type==="source_port"?o.port_hints?.[0]:null],o?.type==="source_port"?o.source_port_id:"");if(i&&s)return`${i}.${s}`;if(s)return s}return"unnamed port"},u9=(e,t)=>{let n=e.find((s)=>cq(s)===t);if(!n)return"unnamed element";if(n.type==="pcb_component"||n.type==="schematic_component"){let s=e.find((a)=>a.type==="source_component"&&a.source_component_id===n.source_component_id);if(s?.type==="source_component")return zCe(s.name,s.source_component_id,"unnamed component")}if((n.type==="pcb_smtpad"||n.type==="pcb_plated_hole")&&n.pcb_port_id){let s=ele(e,n.pcb_port_id);if(s!=="unnamed port")return s}if(n.type==="pcb_trace")return PO(e,t);let o={pcb_smtpad:"SMD pad",pcb_plated_hole:"through-hole pad",pcb_via:"via",pcb_hole:"hole",pcb_bend:"bend",pcb_stiffener:"stiffener",pcb_keepout:"keepout",pcb_cutout:"cutout",pcb_copper_pour:"copper pour"}[n.type]??n.type.replace(/^(pcb|source|schematic)_/,"").replaceAll("_"," "),r="name"in n?n.name:void 0,i="description"in n?n.description:void 0;return OCe([r,i,snn(e,t)],t)||`unnamed ${o}`},PO=(e,t)=>{let n=e.find((r)=>r.type==="pcb_trace"&&r.pcb_trace_id===t);if(n?.type==="pcb_trace"&&n.source_trace_id){let r=e.find((i)=>i.type==="source_trace"&&i.source_trace_id===n.source_trace_id);if(r?.type==="source_trace")return((i,s)=>{let a=zCe(s.display_name,s.source_trace_id,"");if(a)return a;let c=[];for(let l of s.connected_source_port_ids??[]){let h=i.find((d)=>d.type==="pcb_port"&&d.source_port_id===l);if(h?.type==="pcb_port"){let d=ele(i,h.pcb_port_id);d!=="unnamed port"&&c.push(d)}else{let d=i.find((m)=>m.type==="source_port"&&m.source_port_id===l);if(d?.type!=="source_port")continue;let u=i.find((m)=>m.type==="source_component"&&m.source_component_id===d.source_component_id),_=u?.type==="source_component"?zCe(u.name,u.source_component_id,""):"",p=OCe([d.name,d.pin_number?.toString(),d.port_hints?.[0]],d.source_port_id);_&&p?c.push(`${_}.${p}`):p&&c.push(p)}if(c.length===2)return`${c[0]} to ${c[1]}`}return c.length===1?`trace connected to ${c[0]}`:"unnamed trace"})(e,r)}if(n?.type!=="pcb_trace")return"unnamed trace";let o=[...new Set(n.route.flatMap((r)=>r.route_type==="wire"?[r.start_pcb_port_id,r.end_pcb_port_id]:[]).filter((r)=>Boolean(r)))].map((r)=>ele(e,r)).filter((r)=>r!=="unnamed port");return o.length>=2?`${o[0]} to ${o[1]}`:o.length===1?`trace connected to ${o[0]}`:"unnamed trace"},cnn=(e,t)=>{let n=t*Math.PI/180;return{x:e.x*Math.cos(n)-e.y*Math.sin(n),y:e.x*Math.sin(n)+e.y*Math.cos(n)}},Jzt=({x:e,y:t,width:n,height:o,ccwRotation:r})=>{let i=n/2,s=o/2;return[{x:-i,y:-s},{x:i,y:-s},{x:i,y:s},{x:-i,y:s}].map((a)=>{let c=cnn(a,r);return{x:e+c.x,y:t+c.y}})},dw=(e)=>{let t,n,o,r=0;e.type==="pcb_hole"?(t=e.hole_width,n=e.hole_height,o=Math.min(t,n)/2,e.hole_shape==="rotated_pill"&&(r=e.ccw_rotation)):e.type==="pcb_plated_hole"?(t=e.outer_width,n=e.outer_height,o=Math.min(t,n)/2,r=e.ccw_rotation):(t=e.width,n=e.height,o=e.radius,e.shape==="rotated_pill"&&(r=e.ccw_rotation));let i=Math.max(Math.max(t,n)/2-o,0),s=cnn(t>=n?{x:i,y:0}:{x:0,y:i},r);return{start:{x:e.x-s.x,y:e.y-s.y},end:{x:e.x+s.x,y:e.y+s.y},radius:o}},tle=(e)=>{if(e.type==="pcb_smtpad"){if(e.shape==="polygon")return e.points;if(e.shape==="rotated_rect")return Jzt({x:e.x,y:e.y,width:e.width,height:e.height,ccwRotation:e.ccw_rotation})}if(e.type==="pcb_plated_hole"&&"rect_pad_width"in e&&"rect_pad_height"in e)return Jzt({x:e.x,y:e.y,width:e.rect_pad_width,height:e.rect_pad_height,ccwRotation:"rect_ccw_rotation"in e&&typeof e.rect_ccw_rotation=="number"?e.rect_ccw_rotation:0});throw Error(`Expected polygonal pad geometry, got ${e.type} with shape "${e.shape}"`)},Zzt=(e)=>e.map((t,n)=>[t,e[(n+1)%e.length]]),Vje=(e,t,n,o)=>{let r=vw(e,t,n,o);if(r)return{distance:0,pointOnA:r,pointOnB:r,center:r};let i=[{pointOnA:e,pointOnB:mm(e,n,o)},{pointOnA:t,pointOnB:mm(t,n,o)},{pointOnA:mm(n,e,t),pointOnB:n},{pointOnA:mm(o,e,t),pointOnB:o}],s=i[0],a=z7(s.pointOnA,s.pointOnB);for(let c of i.slice(1)){let l=z7(c.pointOnA,c.pointOnB);l<a&&(s=c,a=l)}return{distance:s_(e,t,n,o),pointOnA:s.pointOnA,pointOnB:s.pointOnB,center:{x:(s.pointOnA.x+s.pointOnB.x)/2,y:(s.pointOnA.y+s.pointOnB.y)/2}}},Yje=(e,t,n)=>{if(n.length<3)return{distance:Number.POSITIVE_INFINITY,center:e,tracePoint:e,obstaclePoint:e};let o=Zzt(n).map(([i,s])=>vw(e,t,i,s)).filter((i)=>i!==null);if(o.length>0){let i=t.x-e.x,s=t.y-e.y,a=i*i+s*s;return o.sort((c,l)=>((c.x-e.x)*i+(c.y-e.y)*s)/a-((l.x-e.x)*i+(l.y-e.y)*s)/a),{distance:0,center:o[0],tracePoint:o[0],obstaclePoint:o[0]}}if(Nce(e,n)||Nce(t,n)){let i={x:(e.x+t.x)/2,y:(e.y+t.y)/2};return{distance:0,center:i,tracePoint:i,obstaclePoint:i}}let r=Vje(e,t,n[0],n[1]);for(let[i,s]of Zzt(n).slice(1)){let a=Vje(e,t,i,s);a.distance<r.distance&&(r=a)}return{distance:r.distance,center:r.center,tracePoint:r.pointOnA,obstaclePoint:r.pointOnB}};function eOt(e,t){return Math.sqrt((t.x-e.x)**2+(t.y-e.y)**2)}var tOt=0.000000001,B7=0.000000001;function c2r(e,t){let n=(e.y-t.start.y)*(t.end.x-t.start.x)-(e.x-t.start.x)*(t.end.y-t.start.y);if(Math.abs(n)>tOt)return!1;let o=(e.x-t.start.x)*(t.end.x-t.start.x)+(e.y-t.start.y)*(t.end.y-t.start.y);if(o<-0.000000001)return!1;return o<=(t.end.x-t.start.x)**2+(t.end.y-t.start.y)**2+tOt}function bWe(e,t){let n=!1;for(let o=0,r=t.length-1;o<t.length;r=o++){let i=t[o],s=t[r];if(c2r(e,{start:i,end:s}))return!0;i.y>e.y!=s.y>e.y&&e.x<(s.x-i.x)*(e.y-i.y)/(s.y-i.y)+i.x&&(n=!n)}return n}function t6e(e,t){if(t.type==="pcb_smtpad"){if(t.shape==="circle")return eOt(e,t)<=t.radius+B7;if(t.shape==="rect"){let n=t.width/2,o=t.height/2;return Math.abs(e.x-t.x)<=n+B7&&Math.abs(e.y-t.y)<=o+B7}if(t.shape==="rotated_rect")return bWe(e,tle(t));if(t.shape==="pill"||t.shape==="rotated_pill"){if(t.shape==="rotated_pill"){let c=dw(t);return oc(e,c.start,c.end)<=c.radius+B7}let n=t.width/2,o=t.height/2,r=t.radius;if(Math.abs(e.x-t.x)<=n-r+B7&&Math.abs(e.y-t.y)<=o+B7)return!0;let i=Math.max(Math.abs(e.x-t.x)-(n-r),0),s=Math.max(Math.abs(e.y-t.y)-(o-r),0),a=r+B7;return i*i+s*s<=a*a}if(t.shape==="polygon")return bWe(e,t.points)}if(t.type==="pcb_plated_hole"){if(t.shape==="circle")return eOt(e,t)<=t.outer_diameter/2+B7;if("rect_pad_width"in t&&"rect_pad_height"in t)return bWe(e,tle(t));if(t.shape==="oval"||t.shape==="pill")return Math.abs(e.x-t.x)<=t.outer_width/2+B7&&Math.abs(e.y-t.y)<=t.outer_height/2+B7}return!1}function yQ(e){return e.type==="pcb_trace_segment"||e.type==="pcb_smtpad"?[e.layer]:e.type==="pcb_plated_hole"?Array.isArray(e.layers)?e.layers:[...tS]:e.type==="pcb_hole"?[...tS]:e.type==="pcb_via"?Array.isArray(e.layers)?e.layers:[...tS]:e.type==="pcb_keepout"&&Array.isArray(e.layers)?e.layers:[]}var lnn=0.1,l2r=0.2,hnn=0.1,h2r=0.1,d2r=0.2,Gje=0.1,Mw=0.005,vV=(e)=>e.find((t)=>t.type==="pcb_board"),xQ=(e,t)=>e?.[t],n6e=(e)=>e.type==="pcb_keepout"?e.shape==="outline"?{minX:Math.min(...e.outline.map((t)=>t.x)),minY:Math.min(...e.outline.map((t)=>t.y)),maxX:Math.max(...e.outline.map((t)=>t.x)),maxY:Math.max(...e.outline.map((t)=>t.y))}:e.shape==="circle"?{minX:e.center.x-e.radius,minY:e.center.y-e.radius,maxX:e.center.x+e.radius,maxY:e.center.y+e.radius}:{minX:e.center.x-e.width/2,minY:e.center.y-e.height/2,maxX:e.center.x+e.width/2,maxY:e.center.y+e.height/2}:ann([e]),u2r=(e)=>{if(e.type==="pcb_keepout"&&e.shape==="circle")return e.radius;let t=n6e(e);return Math.min(t.maxX-t.minX,t.maxY-t.minY)/2},fO=(e)=>e.type==="pcb_via"||e.shape==="circle",yO=(e)=>e.type==="pcb_smtpad"&&(e.shape==="pill"||e.shape==="rotated_pill")||e.type==="pcb_plated_hole"&&(e.shape==="oval"||e.shape==="pill"),xO=(e)=>{let t=((n)=>{if(n.type==="pcb_keepout"&&n.shape!=="outline")return n.center;let o=n6e(n);return JO({x:o.minX,y:o.minY},{x:o.maxX,y:o.maxY})})(e);return{kind:"circle",x:t.x,y:t.y,radius:u2r(e)}},CO=(e)=>{if(e.type==="pcb_keepout"){if(e.shape==="outline")return{kind:"polygon",points:e.outline};if(e.shape!=="rect")throw Error(`Expected rectangular keepout, got ${e.shape}`);return{kind:"polygon",points:[{x:e.center.x-e.width/2,y:e.center.y-e.height/2},{x:e.center.x+e.width/2,y:e.center.y-e.height/2},{x:e.center.x+e.width/2,y:e.center.y+e.height/2},{x:e.center.x-e.width/2,y:e.center.y+e.height/2}]}}if(e.type==="pcb_smtpad"&&(e.shape==="polygon"||e.shape==="rotated_rect"))return{kind:"polygon",points:tle(e)};if(e.type==="pcb_plated_hole"&&"rect_pad_width"in e&&"rect_pad_height"in e)return{kind:"polygon",points:tle(e)};let t=n6e(e);return{kind:"polygon",points:[{x:t.minX,y:t.minY},{x:t.maxX,y:t.minY},{x:t.maxX,y:t.maxY},{x:t.minX,y:t.maxY}]}},Uje=(e)=>{if(e.type!=="pcb_smtpad"||e.shape!=="rect"&&e.shape!=="rotated_rect"||!e.corner_radius||e.corner_radius<=0)return null;let t=Math.min(e.corner_radius,e.width/2,e.height/2);if(t===Math.min(e.width,e.height)/2)return{core:{...e,shape:"rotated_pill",radius:t,ccw_rotation:e.shape==="rotated_rect"?e.ccw_rotation:0},radius:0};return{core:{...e,width:e.width-2*t,height:e.height-2*t,corner_radius:0},radius:t}},Kqe=(e,t)=>{let n=Uje(e),o=Uje(t);if(n||o)return Kqe(n?.core??e,o?.core??t)-(n?.radius??0)-(o?.radius??0);if(yO(e)&&yO(t)){let s=dw(e),a=dw(t);return s_(s.start,s.end,a.start,a.end)-s.radius-a.radius}if(yO(e)&&fO(t)){let s=dw(e);return gQ(s.start,s.end,xO(t))-s.radius}if(fO(e)&&yO(t)){let s=dw(t);return gQ(s.start,s.end,xO(e))-s.radius}if(yO(e)){let s=dw(e);return Yje(s.start,s.end,CO(t).points).distance-s.radius}if(yO(t)){let s=dw(t);return Yje(s.start,s.end,CO(e).points).distance-s.radius}return fO(e)&&fO(t)?(r=xO(e),i=xO(t),Math.max(0,Math.hypot(r.x-i.x,r.y-i.y)-r.radius-i.radius)):fO(e)?Kzt(xO(e),CO(t)):fO(t)?Kzt(xO(t),CO(e)):((s,a)=>{if(s.points.length<3||a.points.length<3)return Number.POSITIVE_INFINITY;for(let[d,u]of _$(s))for(let[_,p]of _$(a))if(r2r(d,u,_,p))return 0;let c=s.points[0],l=a.points[0];if(c&&zje(c,a)||l&&zje(l,s))return 0;let h=Number.POSITIVE_INFINITY;for(let[d,u]of _$(s))for(let[_,p]of _$(a))h=Math.min(h,jae(d,_,p),jae(u,_,p),jae(_,d,u),jae(p,d,u));return h})(CO(e),CO(t));var r,i},dnn=(e)=>[...sb(e).pcb_smtpad.list(),...sb(e).pcb_plated_hole.list()],unn=(e)=>sb(e).pcb_trace.list().flatMap((t)=>{let n=[];for(let o=0;o<t.route.length-1;o++){let r=t.route[o],i=t.route[o+1];r.route_type==="wire"&&(i.route_type==="wire"&&r.layer===i.layer&&n.push({type:"pcb_trace_segment",pcb_trace_id:t.pcb_trace_id,_pcbTrace:t,thickness:"width"in r?r.width:("width"in i)?i.width:Gje,layer:r.layer,x1:r.x,y1:r.y,x2:i.x,y2:i.y}))}return n}),IWe=({tracePoint:e,obstaclePoint:t,traceRadius:n,obstacleRadius:o})=>{let r=t.x-e.x,i=t.y-e.y,s=Math.hypot(r,i);if(s===0)return JO(e,t);let a=r/s,c=i/s;if(s<=n+o){let l=(Math.max(-n,s-o)+Math.min(n,s+o))/2;return{x:e.x+a*l,y:e.y+c*l}}return JO({x:e.x+a*n,y:e.y+c*n},{x:t.x-a*o,y:t.y-c*o})},$qe=(e,t)=>{let n=Uje(t);n&&(t=n.core);let o=n?.radius??0,r={x:e.x1,y:e.y1},i={x:e.x2,y:e.y2},s=e.thickness/2;if(t.type==="pcb_via"||fO(t)){let c=t.type==="pcb_via"?{x:t.x,y:t.y,radius:t.outer_diameter/2}:xO(t),l=mm(c,r,i);return{gap:gQ(r,i,c)-s,center:IWe({tracePoint:l,obstaclePoint:c,traceRadius:s,obstacleRadius:c.radius})}}if(yO(t)){let c=((l,h)=>{let d=dw(h),u=Vje({x:l.x1,y:l.y1},{x:l.x2,y:l.y2},d.start,d.end);return{distance:u.distance,center:u.center,radius:d.radius,tracePoint:u.pointOnA,obstaclePoint:u.pointOnB}})(e,t);return{gap:c.distance-s-c.radius,center:IWe({tracePoint:c.tracePoint,obstaclePoint:c.obstaclePoint,traceRadius:s,obstacleRadius:c.radius})}}let a=Yje(r,i,CO(t).points);return{gap:a.distance-s-o,center:IWe({tracePoint:a.tracePoint,obstaclePoint:a.obstaclePoint,traceRadius:s,obstacleRadius:o})}},Q$=(e)=>e<=0,vWe=(e,t)=>{let n={x:e.x1,y:e.y1},o={x:e.x2,y:e.y2},r={x:t.x1,y:t.y1},i={x:t.x2,y:t.y2},s={x:o.x-n.x,y:o.y-n.y},a={x:i.x-r.x,y:i.y-r.y},c=s.x*s.x+s.y*s.y,l=a.x*a.x+a.y*a.y;if(c===0||l===0){if(c===0&&l===0)return{x:(n.x+r.x)/2,y:(n.y+r.y)/2};if(c===0){let T=H7(((n.x-r.x)*a.x+(n.y-r.y)*a.y)/l,0,1),N={x:r.x+T*a.x,y:r.y+T*a.y};return{x:(n.x+N.x)/2,y:(n.y+N.y)/2}}let M=H7(((r.x-n.x)*s.x+(r.y-n.y)*s.y)/c,0,1),B={x:n.x+M*s.x,y:n.y+M*s.y};return{x:(B.x+r.x)/2,y:(B.y+r.y)/2}}let h=n.x-r.x,d=n.y-r.y,u=s.x*s.x+s.y*s.y,_=s.x*a.x+s.y*a.y,p=s.x*h+s.y*d,m=a.x*a.x+a.y*a.y,A=a.x*h+a.y*d,g=u*m-_*_;if(g<0.0000000001)return p2r(n,o,r,i,s,a,c,l);let f=(_*A-m*p)/g,y=(u*A-_*p)/g;f=H7(f,0,1),y=H7(y,0,1),y=(f*_+A)/m,y=H7(y,0,1),f=(y*_-p)/u,f=H7(f,0,1);let x=n.x+f*s.x,C=n.y+f*s.y,b=r.x+y*a.x,I=r.y+y*a.y,v=x-b,P=C-I;return Math.sqrt(v*v+P*P),{x:(x+b)/2,y:(C+I)/2}},p2r=(e,t,n,o,r,i,s,a)=>{let c=((n.x-e.x)*r.x+(n.y-e.y)*r.y)/s;c=H7(c,0,1);let l={x:e.x+c*r.x,y:e.y+c*r.y},h=((o.x-e.x)*r.x+(o.y-e.y)*r.y)/s;h=H7(h,0,1);let d={x:e.x+h*r.x,y:e.y+h*r.y},u=((e.x-n.x)*i.x+(e.y-n.y)*i.y)/a;u=H7(u,0,1);let _={x:n.x+u*i.x,y:n.y+u*i.y},p=((t.x-n.x)*i.x+(t.y-n.y)*i.y)/a;p=H7(p,0,1);let m={x:n.x+p*i.x,y:n.y+p*i.y},A=[{pointA:l,pointB:n,distance:Math.sqrt((l.x-n.x)**2+(l.y-n.y)**2)},{pointA:d,pointB:o,distance:Math.sqrt((d.x-o.x)**2+(d.y-o.y)**2)},{pointA:e,pointB:_,distance:Math.sqrt((e.x-_.x)**2+(e.y-_.y)**2)},{pointA:t,pointB:m,distance:Math.sqrt((t.x-m.x)**2+(t.y-m.y)**2)}].reduce((g,f)=>f.distance<g.distance?f:g);return{x:(A.pointA.x+A.pointB.x)/2,y:(A.pointA.y+A.pointB.y)/2}},H7=(e,t,n)=>Math.max(t,Math.min(n,e));function Wje(e){return e.route_type!=="wire"?[]:[e.start_pcb_port_id,e.end_pcb_port_id].filter((t)=>Boolean(t))}function m2r(e){let t=new Set;for(let n of e.route)for(let o of Wje(n))t.add(o);return Array.from(t)}function Iae(e){let t=new Set;for(let n of e)for(let o of m2r(n))t.add(o);return Array.from(t)}var eQ=0.000000001,r9=(e)=>new U0(e.x,e.y);function Iw(e,t){if(!Number.isFinite(e)||e<=0)throw Error(`${t} must be finite and positive`);return e}function ay(e,t){return Iw(t,"radius"),new xb(new hqe(r9(e),t))}function F4(e){let t=e.filter((r,i)=>i===0||r9(r).distanceTo(r9(e[i-1]))[0]>eQ);if(t.length>1&&r9(t[0]).distanceTo(r9(t.at(-1)))[0]<=eQ&&t.pop(),t.length<2)throw Error("A ring needs at least two distinct vertices");let n=t.map((r,i)=>{let s=t[(i+1)%t.length];if(![r.x,r.y,r.bulge??0].every(Number.isFinite))throw Error("Non-finite ring vertex");let a=r.bulge??0;if(Math.abs(a)<=eQ)return new lS(r9(r),r9(s));let c=s.x-r.x,l=s.y-r.y,h=Math.hypot(c,l),d=h*(1-a*a)/(4*a),u=new U0((r.x+s.x)/2-l/h*d,(r.y+s.y)/2+c/h*d);return new ub(u,h*(1+a*a)/(4*Math.abs(a)),Math.atan2(r.y-u.y,r.x-u.x),Math.atan2(s.y-u.y,s.x-u.x),a>0)}),o=new xb;if(o.addFace(n),o.area()<=eQ)throw Error("A ring must enclose a non-zero area");return o}function k2(e,t,n,o=0,r=0){if(Iw(t,"width"),Iw(n,"height"),!Number.isFinite(o)||!Number.isFinite(r)||r<0)throw Error("Invalid rectangle rotation or corner radius");let i=Math.min(r,t/2,n/2),s=t/2,a=n/2,c;if(i<=eQ)c=F4([{x:-s,y:-a},{x:s,y:-a},{x:s,y:a},{x:-s,y:a}]);else{let l=[new U0(s-i,-a+i),new U0(s-i,a-i),new U0(-s+i,a-i),new U0(-s+i,-a+i)],h=[];for(let d=0;d<4;d++){let u=-Math.PI/2+d*Math.PI/2,_=new ub(l[d],i,u,u+Math.PI/2,!0),p=l[(d+1)%4],m=new U0(p.x+i*Math.cos(u+Math.PI/2),p.y+i*Math.sin(u+Math.PI/2));h.push(_),_.end.distanceTo(m)[0]>eQ&&h.push(new lS(_.end,m))}c=new xb,c.addFace(h)}return c.rotate(o*Math.PI/180).translate(new Ybe(e.x,e.y))}function Xje(e,t,n,o=n){let r=Iw(n,"trace width")/2,i=Iw(o,"trace width")/2,s=r9(e).distanceTo(r9(t))[0];if(s<=Math.abs(r-i)+eQ)return ay(r>=i?e:t,Math.max(r,i));let a=Math.atan2(t.y-e.y,t.x-e.x),c=Math.acos((r-i)/s),l=a-c,h=a+c,d=(_,p,m)=>new U0(_.x+p*Math.cos(m),_.y+p*Math.sin(m)),u=new xb;return u.addFace([new lS(d(e,r,l),d(t,i,l)),new ub(r9(t),i,l,h,!0),new lS(d(t,i,h),d(e,r,h)),new ub(r9(e),r,h,l,!0)]),u}function VCe(e,t){let n=e.clone(),o=[...n.faces][0].orientation();for(let r of t){let i=r.clone();[...i.faces][0].orientation()===o&&i.reverse();for(let s of i.faces)n.addFace(s.shapes)}return n}function rCe(e,t,n,o=0,r=0.001){if(Iw(t,"ellipse width"),Iw(n,"ellipse height"),Iw(r,"curveTolerance"),Math.abs(t-n)<eQ)return ay(e,t/2);let i=Math.max(t,n)/2,s=Math.max(16,Math.ceil(Math.PI/Math.acos(Math.max(-1,1-r/i))));if(s>1e5)throw Error("curveTolerance requires more than 100000 ellipse segments");return F4(Array.from({length:s},(a,c)=>({x:t/2*Math.cos(2*c*Math.PI/s),y:n/2*Math.sin(2*c*Math.PI/s)}))).rotate(o*Math.PI/180).translate(new Ybe(e.x,e.y))}function Ace(e,t){if(!e.length)return[];let n=e.map((o)=>t.indexOf(o));if(n.some((o)=>o<0))throw Error(`Layer is missing from copperLayers: ${e.join(", ")}`);return t.slice(Math.min(...n),Math.max(...n)+1)}function _2r(e){switch(e.shape){case"circle":return ay(e,e.radius);case"polygon":return F4(e.points);case"rect":case"rotated_rect":return k2(e,e.width,e.height,"ccw_rotation"in e?e.ccw_rotation:0,e.rect_border_radius??e.corner_radius??0);case"pill":case"rotated_pill":return k2(e,e.width,e.height,"ccw_rotation"in e?e.ccw_rotation:0,e.radius)}}function g2r(e,t){switch(e.hole_shape){case"circle":return ay(e,e.hole_diameter/2);case"square":return k2(e,e.hole_diameter,e.hole_diameter);case"rect":return k2(e,e.hole_width,e.hole_height);case"oval":return rCe(e,e.hole_width,e.hole_height,0,t);case"pill":case"rotated_pill":return k2(e,e.hole_width,e.hole_height,"ccw_rotation"in e?e.ccw_rotation:0,Math.min(e.hole_width,e.hole_height)/2)}}function A2r(e,t,n,o){let r,i,s={x:e.x+("hole_offset_x"in e?e.hole_offset_x??0:0),y:e.y+("hole_offset_y"in e?e.hole_offset_y??0:0)};switch(e.shape){case"circle":r=ay(e,e.outer_diameter/2),i=ay(e,e.hole_diameter/2);break;case"oval":r=rCe(e,e.outer_width,e.outer_height,e.ccw_rotation,o),i=rCe(e,e.hole_width,e.hole_height,e.ccw_rotation,o);break;case"pill":r=k2(e,e.outer_width,e.outer_height,e.ccw_rotation,Math.min(e.outer_width,e.outer_height)/2),i=k2(e,e.hole_width,e.hole_height,e.ccw_rotation,Math.min(e.hole_width,e.hole_height)/2);break;case"circular_hole_with_rect_pad":case"pill_hole_with_rect_pad":case"rotated_pill_hole_with_rect_pad":r=k2(e,e.rect_pad_width,e.rect_pad_height,"rect_ccw_rotation"in e?e.rect_ccw_rotation:0,e.rect_border_radius??0),i=e.shape==="circular_hole_with_rect_pad"?ay(s,e.hole_diameter/2):k2(s,e.hole_width,e.hole_height,"hole_ccw_rotation"in e?e.hole_ccw_rotation:0,Math.min(e.hole_width,e.hole_height)/2);break;case"hole_with_polygon_pad":{let a=e.ccw_rotation??t;r=F4(e.pad_outline).rotate(a*Math.PI/180).translate(new Ybe(e.x,e.y)),i=e.hole_shape==="circle"?ay(s,e.hole_diameter/2):e.hole_shape==="oval"?rCe(s,e.hole_width,e.hole_height,a,o):k2(s,e.hole_width,e.hole_height,a,Math.min(e.hole_width,e.hole_height)/2);break}}return n?VCe(r,[i]):r}var SWe=(e,t)=>e.x===t.x&&e.y===t.y,nOt=(e,t)=>{let n=Math.hypot(e,t);return n?{x:e/n,y:t/n}:{x:1,y:0}};function f2r(e,t){try{return Mje.subtract(e,t)}catch(n){if(!(n instanceof Error)||n.message!=="Unresolved boundary conflict in boolean operation")throw n;let o=new aQ(1000,0,0,1000,0,0),r=new aQ(0.001,0,0,0.001,0,0);return Mje.subtract(e.transform(o),t.transform(o)).transform(r)}}function y2r(e,t,n){let o=new Map,r=new Map,i=[],s=(a,c)=>o.set(a,[...o.get(a)??[],c]);for(let a of e.route){if(a.route_type==="via"){let c=a,l=a.outer_diameter??c.via_diameter;if(l===void 0)continue;let h=a.hole_diameter??c.via_hole_diameter,d=ay(a,l/2),u=n&&h?ay(a,h/2):void 0;for(let _ of Ace([a.from_layer,a.to_layer],t))s(_,u?VCe(d,[u]):d),u&&r.set(_,[...r.get(_)??[],u])}if(a.route_type==="through_pad")for(let c of new Set([a.start_layer,a.end_layer]))s(c,Xje(a.start,a.end,a.width))}for(let a=0;a<e.route.length-1;a++){let c=e.route[a],l=e.route[a+1],h=c.route_type==="through_pad"?c.end:c,d=l.route_type==="through_pad"?l.start:l;if(SWe(h,d))continue;let u=c.route_type==="wire"?[c.layer]:c.route_type==="via"?Ace([c.from_layer,c.to_layer],t):[c.end_layer],_=l.route_type==="wire"?[l.layer]:l.route_type==="via"?Ace([l.from_layer,l.to_layer],t):[l.start_layer],p=u.filter((g)=>_.includes(g));if(p.length!==1)throw Error(`Cannot determine one wire layer between route points ${a} and ${a+1}`);let m=p[0],A="width"in c?c.width:("width"in l)?l.width:void 0;A===void 0||SWe(h,d)||i.push({start:h,end:d,layer:m,startWidth:A,endWidth:"width"in l?l.width:A})}if(e.route_thickness_mode==="interpolated"){let a=[],c=()=>{a.length&&(s(a[0].layer,function(l){let h=[{...l[0].start,width:l[0].startWidth},...l.map((p)=>({...p.end,width:p.endWidth}))],d=l.map((p)=>nOt(p.end.x-p.start.x,p.end.y-p.start.y)),u=[],_=[];for(let p=0;p<h.length;p++){let m=h[p];Iw(m.width,"interpolated trace width");let A=d[Math.max(0,p-1)],g=d[Math.min(p,d.length-1)],f=nOt(A.x+g.x,A.y+g.y),y=-f.y*m.width/2,x=f.x*m.width/2;u.push({x:m.x+y,y:m.y+x}),_.push({x:m.x-y,y:m.y-x})}return F4([...u,..._.reverse()])}(a)),a=[])};for(let l of i){let h=a.at(-1);!h||h.layer===l.layer&&SWe(h.end,l.start)&&h.endWidth===l.startWidth||c(),a.push(l)}c()}else for(let a of i)s(a.layer,Xje(a.start,a.end,a.startWidth));for(let[a,c]of r)o.set(a,o.get(a).map((l)=>c.reduce((h,d)=>f2r(h,d),l)).filter((l)=>l.faces.size>0));return o}var x2r=["pcb_board","pcb_smtpad","pcb_plated_hole","pcb_hole","pcb_via","pcb_trace","pcb_copper_pour","pcb_cutout","pcb_keepout","pcb_courtyard_rect","pcb_courtyard_circle","pcb_courtyard_pill","pcb_courtyard_polygon","pcb_courtyard_outline"];function C2r(e){switch(e.shape){case"circle":return[ay(e.center,e.radius)];case"rect":return[k2(e.center,e.width,e.height,e.rotation,e.corner_radius)];case"polygon":return[F4(e.points)];case"path":if(e.slot_length!==void 0||e.space_between_slots!==void 0||e.slot_corner_radius!==void 0)throw Error("Patterned/custom-corner path cutouts are not supported; use explicit rect/polygon cutouts");return e.route.slice(1).map((t,n)=>Xje(e.route[n],t,e.slot_width))}}function b2r(e,t={}){if(t.layer&&t.layers)throw Error("Specify layer or layers, not both");let n=t.layer?[t.layer]:t.layers,o=function(c,l){if(l.copperLayers){if(!l.copperLayers.length||new Set(l.copperLayers).size!==l.copperLayers.length)throw Error("copperLayers must be a non-empty list without duplicates");return[...l.copperLayers]}let d=c.find((u)=>u.type==="pcb_board")?.num_layers??2;for(let u of c){let _="layers"in u?u.layers:("layer"in u)?[u.layer]:[];if(Array.isArray(_))for(let p of _){let m=typeof p=="string"&&/^inner(\d+)$/.exec(p);m&&(d=Math.max(d,Number(m[1])+2))}if(u.type==="pcb_trace")for(let p of u.route)for(let m of p.route_type==="wire"?[p.layer]:p.route_type==="via"?[p.from_layer,p.to_layer]:[p.start_layer,p.end_layer]){let A=/^inner(\d+)$/.exec(m);A&&(d=Math.max(d,Number(A[1])+2))}}if(!Number.isInteger(d)||d<1||d>10)throw Error("Supported copper layer count is 1–10");return d===1?["top"]:["top",...Array.from({length:d-2},(u,_)=>`inner${_+1}`),"bottom"]}(e,t),r={elements:[],warnings:[],bounds:void 0,copperLayers:o},i=new Map(e.filter((c)=>c.type==="pcb_component").map((c)=>[c.pcb_component_id,c.rotation])),s=t.curveTolerance??0.001;if(!Number.isFinite(s)||s<=0)throw Error("curveTolerance must be finite and positive");let a=t.includeDrillHoles!==!1;for(let c of e){if(!x2r.includes(c.type))continue;let l=c[`${c.type}_id`];if(t.elementTypes&&!t.elementTypes.includes(c.type))continue;if(t.elementIds&&!t.elementIds.includes(l))continue;let h,d="copper",u=[null],_=[];try{switch(c.type){case"pcb_smtpad":u=[c.layer],_=[_2r(c)];break;case"pcb_plated_hole":u=Ace(c.layers,o),_=[A2r(c,i.get(c.pcb_component_id??"")??0,a,s)];break;case"pcb_via":{u=Ace(c.layers,o);let m=ay(c,c.outer_diameter/2);_=[a?VCe(m,[ay(c,c.hole_diameter/2)]):m];break}case"pcb_trace":h=y2r(c,o,a),u=[...h.keys()];break;case"pcb_copper_pour":u=[c.layer],_=[c.shape==="rect"?k2(c.center,c.width,c.height,c.rotation):c.shape==="polygon"?F4(c.points):VCe(F4(c.brep_shape.outer_ring.vertices),c.brep_shape.inner_rings.map((m)=>F4(m.vertices)))];break;case"pcb_board":d="board",_=[c.outline?.length?F4(c.outline):k2(c.center,c.width,c.height)];break;case"pcb_hole":d="drill",_=[g2r(c,s)];break;case"pcb_cutout":d="cutout",_=C2r(c);break;case"pcb_keepout":d="keepout",u=c.layers,_=[c.shape==="circle"?ay(c.center,c.radius):c.shape==="rect"?k2(c.center,c.width,c.height):F4(c.outline)];break;case"pcb_courtyard_rect":d="courtyard",u=[c.layer],_=[k2(c.center,c.width,c.height,c.ccw_rotation)];break;case"pcb_courtyard_circle":d="courtyard",u=[c.layer],_=[ay(c.center,c.radius)];break;case"pcb_courtyard_pill":d="courtyard",u=[c.layer],_=[k2(c.center,c.width,c.height,0,c.radius)];break;case"pcb_courtyard_polygon":d="courtyard",u=[c.layer],_=[F4(c.points)];break;case"pcb_courtyard_outline":d="courtyard",u=[c.layer],_=[F4(c.outline)]}if(t.roles&&!t.roles.includes(d))continue;let p=[];for(let m of new Set(u)){if(m===null?t.includeLayerless===!1:n&&!n.includes(m))continue;let A=h?.get(m)??_;if(!A.length)continue;let g=A.reduce((y,x)=>y.merge(x.box),A[0].box);if(![g.xmin,g.ymin,g.xmax,g.ymax].every(Number.isFinite))throw Error("Non-finite geometry bounds");let f={elementId:l,elementType:c.type,sourceElement:c,role:d,layer:m,shapes:A,bounds:g};p.push(f)}for(let m of p)r.elements.push(m),r.bounds=r.bounds?r.bounds.merge(m.bounds):m.bounds}catch(p){let m=p instanceof Error?p.message:String(p);if(t.strict)throw Error(`${l}: ${m}`);r.warnings.push({elementId:l,elementType:c.type,message:m})}}return r}var K4e=0.000000001;function oOt(e){let t=new Map(e.filter((a)=>a.type==="pcb_port").map((a)=>[a.pcb_port_id,a])),n=e.filter((a)=>a.type==="pcb_smtpad"||a.type==="pcb_plated_hole"),o=new Map;for(let a of n){if(!a.pcb_port_id)continue;let c=o.get(a.pcb_port_id)??[];c.push(a),o.set(a.pcb_port_id,c)}let r=e.filter((a)=>a.type==="pcb_via"),i,s=(a)=>{let c=o.get(a.pcb_port_id);return c?.length?[...new Set(c.flatMap(yQ))]:a.layers};return{ports:t,layersForPort:s,canConnect:(a,c)=>{let l=t.get(c);if(!l)return!0;let h=s(l);if(h.includes(a.layer))return!0;let d=o.get(c)??[];return(()=>{if(i)return i;i=r.map((p)=>({...p,diameter:p.outer_diameter}));let u=e.find((p)=>p.type==="pcb_board"),_=["top",...tS.filter((p)=>p.startsWith("inner")).slice(0,u?Math.max(0,u.num_layers-2):void 0),...u?.num_layers===1?[]:["bottom"]];for(let p of e)if(p.type==="pcb_trace")for(let m of p.route){if(m.route_type!=="via")continue;if(r.some((f)=>Math.hypot(f.x-m.x,f.y-m.y)<=K4e))continue;let A=_.indexOf(m.from_layer),g=_.indexOf(m.to_layer);A<0||g<0||i.push({...m,layers:_.slice(Math.min(A,g),Math.max(A,g)+1),diameter:m.outer_diameter})}return i})().some((u)=>{if(!u.layers.includes(a.layer)||!h.some((p)=>u.layers.includes(p)))return!1;if(u.diameter!==void 0&&(!Number.isFinite(u.diameter)||u.diameter<=0))return!1;let _=u.diameter===void 0?0:u.diameter/2+a.width/2;return!(Math.hypot(a.x-u.x,a.y-u.y)>_+K4e)&&(d.length===0?Math.hypot(l.x-u.x,l.y-u.y)<=K4e:d.some((p)=>!!yQ(p).some((m)=>u.layers.includes(m))&&(u.diameter===void 0?t6e(u,p):Kqe({type:"pcb_via",pcb_via_id:"layer-contact",x:u.x,y:u.y,outer_diameter:u.diameter,hole_diameter:0,layers:u.layers},p)<=K4e)))})}}}function I2r(e){if(!e.some((p)=>p.type==="pcb_via"||p.type==="pcb_plated_hole"||p.type==="pcb_copper_pour"||p.type==="pcb_trace"&&p.route.some((m)=>m.route_type==="via")))return[];let t=[],n=[],o=1e6,r=0.0000001*o,i=function(p){let m=new WeakMap,A=(g)=>{let f=m.get(g);return f||(f={box:g.box,facePoints:[...g.faces].map((y)=>y.first.start),edges:[...g.edges].map((y)=>y.shape),edgeIndex:g.edges},m.set(g,f)),f};return(g,f)=>{if(g.isEmpty()||f.isEmpty())return!1;let y=A(g),x=A(f);if(y.box.xmin>x.box.xmax+p||y.box.xmax<x.box.xmin-p||y.box.ymin>x.box.ymax+p||y.box.ymax<x.box.ymin-p)return!1;if(y.facePoints.some((I)=>x.box.contains(I)&&f.contains(I))||x.facePoints.some((I)=>y.box.contains(I)&&g.contains(I)))return!0;let[C,b]=y.edges.length<=x.edges.length?[y,x]:[x,y];for(let I of C.edges){let v=I.box,P=new dqe(v.xmin-p,v.ymin-p,v.xmax+p,v.ymax+p),M=b.edgeIndex.search(P);for(let B of M)if(I.distanceTo(B.shape)[0]<=p)return!0}return!1}}(r),s=(p,m,A,g=!1,f=!1)=>{if(!A.isEmpty()){let y=A.scale(o,o);t.push({id:p,layers:m,geometry:{polygon:y},box:y.box,bridges:g,platedPort:f})}},a=new Map,c=(p)=>{if("polygon"in p.geometry)return p.geometry.polygon;let m=a.get(p);if(!m){let{start:A,end:g}=p.geometry;m=qzt(A,g,A.width).scale(o,o),a.set(p,m)}return m},l=e.filter((p)=>p.type==="pcb_via"),h=new Map(e.filter((p)=>p.type==="pcb_component").map((p)=>[p.pcb_component_id,p])),d=e.find((p)=>p.type==="pcb_board"),u=["top",...tS.filter((p)=>p.startsWith("inner")).slice(0,d?Math.max(0,d.num_layers-2):void 0),...d?.num_layers===1?[]:["bottom"]];for(let p of e)if(p.type==="pcb_via")s(p.pcb_via_id,p.layers,R$(p,p.outer_diameter/2),!0),p.pcb_trace_id&&n.push([p.pcb_via_id,p.pcb_trace_id]);else if(p.type==="pcb_plated_hole"){if(!p.pcb_port_id)continue;let m={...p,hole_offset_x:"hole_offset_x"in p?p.hole_offset_x??0:0,hole_offset_y:"hole_offset_y"in p?p.hole_offset_y??0:0};s(p.pcb_port_id,p.layers,s2r(m,p.pcb_component_id?h.get(p.pcb_component_id)?.rotation:0),!0,!0)}else if(p.type==="pcb_copper_pour")s(p.pcb_copper_pour_id,[p.layer],i2r(p),!0);else if(p.type==="pcb_trace"){if(p.route_thickness_mode==="interpolated")continue;for(let m=0;m<p.route.length;m++){let A=p.route[m],g=p.route[m+1];if(A.route_type!=="wire"||g?.route_type!=="wire"||A.layer!==g.layer||A.x===g.x&&A.y===g.y){if(A.route_type==="via"){if(l.some((C)=>C.pcb_trace_id===p.pcb_trace_id&&Math.hypot(C.x-A.x,C.y-A.y)<0.000000001))continue;let f=u.indexOf(A.from_layer),y=u.indexOf(A.to_layer);if(f<0||y<0||!A.outer_diameter)continue;let x={type:"pcb_via",pcb_via_id:`${p.pcb_trace_id}_via_${m}`,x:A.x,y:A.y,outer_diameter:A.outer_diameter,hole_diameter:0,layers:u.slice(Math.min(f,y),Math.max(f,y)+1)};s(p.pcb_trace_id,x.layers,R$(x,x.outer_diameter/2),!0)}}else if(A.width>0){let f=A.width/2;t.push({id:p.pcb_trace_id,layers:[A.layer],geometry:{start:A,end:g},box:{xmin:(Math.min(A.x,g.x)-f)*o,ymin:(Math.min(A.y,g.y)-f)*o,xmax:(Math.max(A.x,g.x)+f)*o,ymax:(Math.max(A.y,g.y)+f)*o},bridges:!1,platedPort:!1})}else s(p.pcb_trace_id,[A.layer],qzt(A,g,A.width))}}if(!t.length)return n;let _=new i_(t.length);for(let{box:p}of t)_.add(p.xmin,p.ymin,p.xmax,p.ymax);_.finish();for(let[p,m]of t.entries()){if(!m.bridges)continue;let A=m.box;for(let g of _.search(A.xmin-r,A.ymin-r,A.xmax+r,A.ymax+r)){let f=t[g];m.platedPort&&f.bridges||f.platedPort&&m.bridges||p===g||m.id===f.id||f.bridges&&g<p||!m.layers.some((y)=>f.layers.includes(y))||i(c(m),c(f))&&n.push([m.id,f.id])}}return n}function rOt(e,t,n,o){return Math.sqrt((n-e)**2+(o-t)**2)}var pnn=(e)=>b2r(e.filter((t)=>t.type==="pcb_hole"),{elementTypes:["pcb_hole"],strict:!0,curveTolerance:0.000001}).elements,mnn=(e,t)=>{let n=t.sourceElement;if(n.type!=="pcb_hole")throw Error("Expected hole geometry");let o=new U0(e.x1,e.y1),r=new U0(e.x2,e.y2),i=1/0,s=mm(n,o,r);if(n.hole_shape==="circle")i=oc(n,o,r)-n.hole_diameter/2;else{let a=new lS(o,r);for(let c of t.shapes){let[l,h]=c.distanceTo(a),d=c.contains(o)||c.contains(r)?0:l;d<i&&(i=d,s=h.end)}}return{gap:i-e.thickness/2,center:s}},qqe=class{buckets;objectsById;getBounds;getId;CELL_SIZE=0.4;constructor({objects:e,getBounds:t,getId:n,CELL_SIZE:o}){this.buckets=new Map,this.objectsById=new Map,this.getBounds=t,this.getId=n??(()=>this._getNextId()),this.CELL_SIZE=o??this.CELL_SIZE;for(let r of e)this.addObject(r)}_idCounter=0;_getNextId(){return""+this._idCounter++}addObject(e){let t=this.getBounds(e),n=this.getId(e),o={...e,spatialIndexId:n};this.objectsById.set(n,o);let r=Math.floor(t.minX/this.CELL_SIZE),i=Math.floor(t.minY/this.CELL_SIZE),s=Math.floor(t.maxX/this.CELL_SIZE),a=Math.floor(t.maxY/this.CELL_SIZE);for(let c=r;c<=s;c++)for(let l=i;l<=a;l++){let h=`${c}x${l}`,d=this.buckets.get(h);d?d.push(o):this.buckets.set(h,[o])}}removeObject(e){let t=this.objectsById.get(e);if(!t)return!1;this.objectsById.delete(e);let n=this.getBounds(t),o=Math.floor(n.minX/this.CELL_SIZE),r=Math.floor(n.minY/this.CELL_SIZE),i=Math.floor(n.maxX/this.CELL_SIZE),s=Math.floor(n.maxY/this.CELL_SIZE);for(let a=o;a<=i;a++)for(let c=r;c<=s;c++){let l=`${a}x${c}`,h=this.buckets.get(l);if(h){let d=h.findIndex((u)=>u.spatialIndexId===e);d!==-1&&(h.splice(d,1),h.length===0&&this.buckets.delete(l))}}return!0}getBucketKey(e,t){return`${Math.floor(e/this.CELL_SIZE)}x${Math.floor(t/this.CELL_SIZE)}`}getObjectsInBounds(e,t=0){let n=[],o=new Set,r=Math.floor((e.minX-t)/this.CELL_SIZE),i=Math.floor((e.minY-t)/this.CELL_SIZE),s=Math.floor((e.maxX+t)/this.CELL_SIZE),a=Math.floor((e.maxY+t)/this.CELL_SIZE);for(let c=r;c<=s;c++)for(let l=i;l<=a;l++){let h=`${c}x${l}`,d=this.buckets.get(h)||[];for(let u of d){let _=u.spatialIndexId;o.has(_)||(o.add(_),n.push(u))}}return n}},iOt=(e,t)=>{let n={x:e.x1,y:e.y1},o={x:e.x2,y:e.y2},{minX:r,minY:i,maxX:s,maxY:a}=t;if(n.x===o.x&&n.y===o.y){let v=Math.max(r,Math.min(s,n.x)),P=Math.max(i,Math.min(a,n.y));return v===n.x&&P===n.y?{x:n.x,y:n.y}:{x:v,y:P}}let c=o.x-n.x,l=o.y-n.y,h=c!==0?(r-n.x)/c:Number.NEGATIVE_INFINITY,d=c!==0?(s-n.x)/c:Number.POSITIVE_INFINITY,u=l!==0?(i-n.y)/l:Number.NEGATIVE_INFINITY,_=l!==0?(a-n.y)/l:Number.POSITIVE_INFINITY,p=Math.max(Math.min(h,d),Math.min(u,_)),m=Math.min(Math.max(h,d),Math.max(u,_));if(p<=m&&m>=0&&p<=1){let v=Math.max(0,Math.min(1,p));return{x:n.x+v*c,y:n.y+v*l}}let A={x:Math.max(r,Math.min(s,n.x)),y:Math.max(i,Math.min(a,n.y))},g={x:Math.max(r,Math.min(s,o.x)),y:Math.max(i,Math.min(a,o.y))},f=(A.x-n.x)**2+(A.y-n.y)**2,y=(g.x-o.x)**2+(g.y-o.y)**2,x=[{start:{x:r,y:i},end:{x:s,y:i}},{start:{x:s,y:i},end:{x:s,y:a}},{start:{x:s,y:a},end:{x:r,y:a}},{start:{x:r,y:a},end:{x:r,y:i}}],C=Math.min(f,y),b=f<=y?A:g,I=(v,P,M)=>Math.max(P,Math.min(M,v));for(let v of x){let P={x:o.x-n.x,y:o.y-n.y},M={x:v.end.x-v.start.x,y:v.end.y-v.start.y},B={x:n.x-v.start.x,y:n.y-v.start.y},T=P.x*P.x+P.y*P.y,N=P.x*M.x+P.y*M.y,D=P.x*B.x+P.y*B.y,L=M.x*M.x+M.y*M.y,H=M.x*B.x+M.y*B.y,V=T*L-N*N;if(Math.abs(V)<0.0000000001)continue;let O=(N*H-L*D)/V,U=(T*H-N*D)/V;O=I(O,0,1),U=I(U,0,1);let j={x:n.x+O*P.x,y:n.y+O*P.y},Y={x:v.start.x+U*M.x,y:v.start.y+U*M.y},X=j.x-Y.x,K=j.y-Y.y,J=X*X+K*K;J<C&&(C=J,b={x:(j.x+Y.x)/2,y:(j.y+Y.y)/2})}return b},o$=(e)=>{if(e.type==="pcb_hole"&&(e.hole_shape==="pill"||e.hole_shape==="rotated_pill")||e.type==="pcb_smtpad"&&e.shape==="rotated_pill"){let t=dw(e);return{minX:Math.min(t.start.x,t.end.x)-t.radius,minY:Math.min(t.start.y,t.end.y)-t.radius,maxX:Math.max(t.start.x,t.end.x)+t.radius,maxY:Math.max(t.start.y,t.end.y)+t.radius}}if(e.type==="pcb_trace_segment")return{minX:Math.min(e.x1,e.x2),minY:Math.min(e.y1,e.y2),maxX:Math.max(e.x1,e.x2),maxY:Math.max(e.y1,e.y2)};if(e.type==="pcb_smtpad"||e.type==="pcb_plated_hole"){if(e.type==="pcb_smtpad"&&(e.shape==="rotated_rect"||e.shape==="polygon")||e.type==="pcb_plated_hole"&&"rect_pad_width"in e&&"rect_pad_height"in e){let t=tle(e);return{minX:Math.min(...t.map((n)=>n.x)),minY:Math.min(...t.map((n)=>n.y)),maxX:Math.max(...t.map((n)=>n.x)),maxY:Math.max(...t.map((n)=>n.y))}}}return ann([e])},v2r=(e)=>e.type==="pcb_port"?e.pcb_port_id:e.type==="pcb_smtpad"?e.pcb_smtpad_id:e.pcb_plated_hole_id;function S2r(e,{connMap:t,minClearance:n}={}){let o=function(x){let C=new Set(x.flatMap((v)=>v.type==="source_bus"&&v.max_length_skew!==void 0?v.source_trace_ids:[])),b=sb(x),I=[];for(let v of x){if(v.type!=="pcb_trace")continue;if(!v.source_trace_id||!C.has(v.source_trace_id))continue;let P=[],M=[],B,T=0,N=0;for(let D=0;D<v.route.length-1;D++){M[D]=T;let L=v.route[D],H=v.route[D+1];if(L.route_type!=="wire"||H.route_type!=="wire"||L.layer!==H.layer){N++;continue}let V=Math.hypot(H.x-L.x,H.y-L.y);V!==0&&(P.push({type:"pcb_trace_segment",_pcbTrace:v,pcb_trace_id:v.pcb_trace_id,thickness:L.width,layer:L.layer,x1:L.x,y1:L.y,x2:H.x,y2:H.y,run:N,startDistance:T,endDistance:T+V}),T+=V)}M[v.route.length-1]=T;e:for(let D=0;D<P.length;D++){let L=P[D];for(let H=D+1;H<P.length;H++){let V=P[H];if(L.layer!==V.layer)continue;let O=(L.thickness+V.thickness)/2,U=(L.x2-L.x1)*(V.x2-V.x1)+(L.y2-L.y1)*(V.y2-V.y1),j=(L.x2-L.x1)*(V.y2-V.y1)-(L.y2-L.y1)*(V.x2-V.x1),Y=U>=Math.hypot(L.x2-L.x1,L.y2-L.y1)*Math.hypot(V.x2-V.x1,V.y2-V.y1)*-0.000000001,X=L.run===V.run&&V.startDistance===L.endDistance;if((!X||U<0&&Math.abs(j)<0.000000001)&&!(!X&&L.run===V.run&&V.startDistance-L.endDistance<=Math.SQRT2*O&&Y||s_({x:L.x1,y:L.y1},{x:L.x2,y:L.y2},{x:V.x1,y:V.y1},{x:V.x2,y:V.y2})-O>0.000000001)){B=vWe(L,V);break e}}}if(!B){let D=x.find((H)=>H.type==="pcb_board"),L=["top",...tS.filter((H)=>H.startsWith("inner")).slice(0,D?Math.max(0,D.num_layers-2):void 0),...D?.num_layers===1?[]:["bottom"]];e:for(let H=0;H<v.route.length;H++){let V=v.route[H];if(V.route_type!=="via")continue;let O=b.pcb_via.list().find((K)=>(K.pcb_trace_id===v.pcb_trace_id||!K.pcb_trace_id&&K.source_trace_id===v.source_trace_id)&&Math.hypot(K.x-V.x,K.y-V.y)<=0.000000001),U=O?.outer_diameter??V.outer_diameter;if(U===void 0||!Number.isFinite(U)||U<=0)continue;let j=L.indexOf(V.from_layer),Y=L.indexOf(V.to_layer),X=O?.layers??(j>=0&&Y>=0?L.slice(Math.min(j,Y),Math.max(j,Y)+1):[]);for(let K of P){if(!X.includes(K.layer))continue;let J=(U+K.thickness)/2;if(Math.max(K.startDistance-M[H],M[H]-K.endDistance,0)<=J+0.000000001)continue;let ee={...K,x1:V.x,y1:V.y,x2:V.x,y2:V.y};if(!(s_(V,V,{x:K.x1,y:K.y1},{x:K.x2,y:K.y2})-J>0.000000001)){B=vWe(K,ee);break e}}}}if(B){let D=b.source_trace.get(v.source_trace_id),L=(D?.connected_source_port_ids??[]).map((V)=>{let O=b.source_port.get(V),U=O?.source_component_id?b.source_component.get(O.source_component_id):void 0;return U?.name&&O?.name?`${U.name}.${O.name}`:void 0}).filter((V)=>Boolean(V)),H=D?.name||D?.display_name||L.join(" → ")||"unnamed";I.push({type:"pcb_trace_error",error_type:"pcb_trace_error",pcb_trace_error_id:`self_short_${v.pcb_trace_id}`,pcb_trace_id:v.pcb_trace_id,source_trace_id:v.source_trace_id,message:`PCB trace "${H}" shorts to itself, bypassing part of its length-matched route`,center:B,pcb_component_ids:[],pcb_port_ids:Iae([v]),subcircuit_id:v.subcircuit_id})}}return I}(e);((x)=>{let C=x.filter((P)=>P.type==="pcb_port"),b=x.filter((P)=>P.type==="pcb_smtpad"),I=x.filter((P)=>P.type==="pcb_trace");function v(P,M={}){let B=M.traceWidth||0,T=C.find((N)=>N.layers.includes(P.layer)&&rOt(N.x,N.y,P.x,P.y)<0.01);if(T)return T.pcb_port_id;if(M.isFirstOrLastPoint){let N=b.find((D)=>D.layer===P.layer&&(D.shape==="rect"?Math.abs(P.x-D.x)<D.width/2+B/2&&Math.abs(P.y-D.y)<D.height/2+B/2:D.shape==="circle"?rOt(P.x,P.y,D.x,D.y)<D.radius:D.shape==="pill"||D.shape==="rotated_pill"?t6e(P,D):void 0));if(N)return N.pcb_port_id??null}return null}for(let P of I)for(let M=0;M<P.route.length;M++){let B=P.route[M],T=M===0||M===P.route.length-1;if(B.route_type==="wire"){if(!B.start_pcb_port_id&&M===0){let N=v(B,{isFirstOrLastPoint:T,traceWidth:B.width});N&&(B.start_pcb_port_id=N)}if(!B.end_pcb_port_id&&M===P.route.length-1){let N=v(B,{isFirstOrLastPoint:T,traceWidth:B.width});N&&(B.end_pcb_port_id=N)}}}})(e),t??=fV(e);let r=vV(e);n??=xQ(r,"min_trace_to_pad_edge_clearance")??0.1;let i=sb(e).pcb_trace.list().flatMap((x)=>{let C=[];for(let b=0;b<x.route.length-1;b++){let I=x.route[b],v=x.route[b+1];if(I.route_type!=="wire"&&I.route_type!=="via"||v.route_type!=="wire"&&v.route_type!=="via")continue;let P=I.route_type==="wire"?I:v;P.route_type==="wire"&&(I.route_type==="wire"&&v.route_type==="wire"&&I.layer!==v.layer||C.push({type:"pcb_trace_segment",pcb_trace_id:x.pcb_trace_id,_pcbTrace:x,thickness:Math.max(I.route_type==="wire"?I.width??Gje:0,v.route_type==="wire"?v.width??Gje:0),layer:P.layer,x1:I.x,y1:I.y,x2:v.x,y2:v.y}))}return C}),s=sb(e).pcb_smtpad.list(),a=sb(e).pcb_plated_hole.list(),c=sb(e).pcb_port.list(),l=sb(e).pcb_hole.list(),h=new Map(pnn(e).map((x)=>[x.elementId,x])),d=sb(e).pcb_via.list(),u=sb(e).pcb_keepout.list().filter((x)=>!x.allow_traces),_=[...c,...s,...a],p=new Map;for(let x of u){let C=new Set(x.excluded_pcb_component_ids??[]);C.size!==0&&p.set(x.pcb_keepout_id,_.filter((b)=>b.pcb_component_id&&C.has(b.pcb_component_id)).map(v2r))}let m=[...i,...s,...a,...l,...d,...u],A=new qqe({objects:m,getBounds:o$}),g=(x)=>u9(e,x),f=(x,C,b)=>Q$(b)?`PCB trace ${x} overlaps with ${C} (accidental contact)`:`PCB trace ${x} is too close to ${C} (gap: ${b.toFixed(3)}mm)`,y=new Set;for(let x of i){let C=n,b=o$(x),I=A.getObjectsInBounds(b,C+x.thickness/2);if(x.x1!==x.x2||x.y1!==x.y2)for(let v of I){if(!yQ(v).includes(x.layer))continue;if(v.type==="pcb_keepout"&&(p.get(v.pcb_keepout_id)??[]).some((B)=>t.areIdsConnected(x.pcb_trace_id,B)))continue;if(v.type==="pcb_trace_segment"){let B=v;if(x.layer!==B.layer)continue;if(t.areIdsConnected(x.pcb_trace_id,B.pcb_trace_id))continue;let T=s_({x:x.x1,y:x.y1},{x:x.x2,y:x.y2},{x:B.x1,y:B.y1},{x:B.x2,y:B.y2})-x.thickness/2-B.thickness/2;if(T>n-Mw)continue;let N=`overlap_${x.pcb_trace_id}_${B.pcb_trace_id}`,D=`overlap_${B.pcb_trace_id}_${x.pcb_trace_id}`;if(y.has(N))continue;if(y.has(D))continue;y.add(N),o.push({type:"pcb_trace_error",error_type:"pcb_trace_error",message:f(g(x.pcb_trace_id),g(B.pcb_trace_id),T),pcb_trace_id:x.pcb_trace_id,source_trace_id:"",pcb_trace_error_id:N,pcb_component_ids:[],center:vWe(x,B),pcb_port_ids:Iae([x._pcbTrace,B._pcbTrace])});continue}let P=cq(v);if(t.areIdsConnected(x.pcb_trace_id,"pcb_trace_id"in v?v.pcb_trace_id:P))continue;if(v.type==="pcb_smtpad"||v.type==="pcb_plated_hole"||v.type==="pcb_via"){let{gap:B,center:T}=$qe(x,v);if(!Q$(B))continue;let N=`overlap_${x.pcb_trace_id}_${P}`;if(y.has(N))continue;y.add(N),o.push({type:"pcb_trace_error",error_type:"pcb_trace_error",message:f(g(x.pcb_trace_id),`${v.type} "${g(P)}"`,B),pcb_trace_id:x.pcb_trace_id,center:T,source_trace_id:"",pcb_trace_error_id:N,pcb_component_ids:["pcb_component_id"in v?v.pcb_component_id:void 0].filter(Boolean),pcb_port_ids:[...Iae([x._pcbTrace]),"pcb_port_id"in v?v.pcb_port_id:void 0].filter(Boolean)});continue}if(v.type==="pcb_hole"){let{gap:B,center:T}=mnn(x,h.get(v.pcb_hole_id));if(!Q$(B))continue;let N=`overlap_${x.pcb_trace_id}_${P}`;if(y.has(N))continue;y.add(N),o.push({type:"pcb_trace_error",error_type:"pcb_trace_error",message:f(g(x.pcb_trace_id),`${v.type} "${g(P)}"`,B),pcb_trace_id:x.pcb_trace_id,source_trace_id:x._pcbTrace.source_trace_id??"",pcb_trace_error_id:N,pcb_component_ids:v.pcb_component_id?[v.pcb_component_id]:[],pcb_port_ids:Iae([x._pcbTrace]),center:T});continue}let M=AV({x:x.x1,y:x.y1},{x:x.x2,y:x.y2},o$(v))-x.thickness/2;if(M+Mw<C){let B=`overlap_${x.pcb_trace_id}_${P}`;if(y.has(B))continue;if(y.add(B),v.type==="pcb_keepout"&&v.warning_only){o.push({type:"pcb_keepout_overlap_warning",warning_type:"pcb_keepout_overlap_warning",pcb_keepout_overlap_warning_id:`pcb_keepout_overlap_warning_${B}`,pcb_keepout_id:v.pcb_keepout_id,pcb_trace_ids:[x.pcb_trace_id],message:`PCB trace ${g(x.pcb_trace_id)} violates advisory PCB keepout "${u9(e,v.pcb_keepout_id)}"`,center:iOt(x,o$(v)),subcircuit_id:x._pcbTrace.subcircuit_id??v.subcircuit_id});continue}o.push({type:"pcb_trace_error",error_type:"pcb_trace_error",message:f(g(x.pcb_trace_id),`${v.type} "${g(cq(v))}"`,M),pcb_trace_id:x.pcb_trace_id,source_trace_id:"",pcb_trace_error_id:B,pcb_component_ids:["pcb_component_id"in v?v.pcb_component_id:void 0].filter(Boolean),center:iOt(x,o$(v)),pcb_port_ids:[...Iae([x._pcbTrace]),"pcb_port_id"in v?v.pcb_port_id:void 0].filter(Boolean)})}}}return o}function nle(e,t){return Math.hypot(e.x-t.x,e.y-t.y)}function P2r(e,t){return nle(e,t)<=Mw}function E2r(e,{connMap:t,minClearance:n}={}){let o=e.filter((a)=>a.type==="pcb_via");if(o.length<2)return[];let r=vV(e);n??=xQ(r,"min_via_hole_edge_to_via_hole_edge_clearance")??lnn,t??=fV(e);let i=[],s=new Set;for(let a=0;a<o.length;a++)for(let c=a+1;c<o.length;c++){let l=o[a],h=o[c];if(P2r(l,h))continue;if(!t.areIdsConnected(l.pcb_via_id,h.pcb_via_id))continue;let d=nle(l,h)-l.hole_diameter/2-h.hole_diameter/2;if(d+Mw>=n)continue;let u=[l.pcb_via_id,h.pcb_via_id].sort().join("_");s.has(u)||(s.add(u),i.push({type:"pcb_via_clearance_error",pcb_error_id:`same_net_vias_close_${u}`,message:`Vias ${u9(e,l.pcb_via_id)} and ${u9(e,h.pcb_via_id)} are too close together (gap: ${d.toFixed(3)}mm)`,error_type:"pcb_via_clearance_error",pcb_via_ids:[l.pcb_via_id,h.pcb_via_id],minimum_clearance:n,actual_clearance:d,pcb_center:{x:(l.x+h.x)/2,y:(l.y+h.y)/2}}))}return i}function M2r(e,{connMap:t,minClearance:n}={}){let o=e.filter((c)=>c.type==="pcb_via");if(o.length<2)return[];let r=vV(e);n??=xQ(r,"min_via_hole_edge_to_via_hole_edge_clearance")??lnn;let i=xQ(r,"min_pad_edge_to_pad_edge_clearance")??h2r;t??=fV(e);let s=[],a=new Set;for(let c=0;c<o.length;c++)for(let l=c+1;l<o.length;l++){let h=o[c],d=o[l];if(t.areIdsConnected(h.pcb_via_id,d.pcb_via_id))continue;let u=nle(h,d),_=u-h.hole_diameter/2-d.hole_diameter/2,p=n;if(_+Mw>=p){if(!h.layers.some((A)=>d.layers.includes(A)))continue;if(_=u-h.outer_diameter/2-d.outer_diameter/2,p=i,_>=0&&_+Mw>=p)continue}let m=[h.pcb_via_id,d.pcb_via_id].sort().join("_");a.has(m)||(a.add(m),s.push({type:"pcb_via_clearance_error",pcb_error_id:`different_net_vias_close_${m}`,message:`Vias ${u9(e,h.pcb_via_id)} and ${u9(e,d.pcb_via_id)} from different nets are too close together (gap: ${_.toFixed(3)}mm)`,error_type:"pcb_via_clearance_error",pcb_via_ids:[h.pcb_via_id,d.pcb_via_id],minimum_clearance:p,actual_clearance:_,pcb_center:{x:(h.x+d.x)/2,y:(h.y+d.y)/2}}))}return s}var Zae=0.000000001;function sOt({point:e,width:t,ownerTrace:n,index:o,connectivity:r}){if(e.route_type!=="wire"||!Number.isFinite(t)||t<=0)return!1;let i=r.getNetConnectedToId(n.pcb_trace_id);return!!i&&(o.get(i)?.get(e.layer)??[]).some((s)=>{if(s.ownerTraceId===n.pcb_trace_id)return!1;if(!s.touchesPad&&![...s.touchingTraceIds].some((c)=>c!==n.pcb_trace_id))return!1;let a=s.radius===void 0?0:s.radius+t/2;return Math.hypot(e.x-s.x,e.y-s.y)<=a+Zae})}var OK=0.01;function w2r({via:e,incoming:t,outgoing:n,traceId:o,context:{stack:r,ownedViasByTrace:i}}){let s=r.indexOf(e.from_layer),a=r.indexOf(e.to_layer);if(s<0||a<0)return!1;let c=i.get(o)?.filter((u)=>Math.abs(u.x-e.x)<OK&&Math.abs(u.y-e.y)<OK)??[],l=c.length>0?c.map((u)=>u.layers):[r.slice(Math.min(s,a),Math.max(s,a)+1)],h=Math.abs(t.x-e.x)<OK&&Math.abs(t.y-e.y)<OK,d=Math.abs(n.x-e.x)<OK&&Math.abs(n.y-e.y)<OK;return r.includes(t.layer)&&r.includes(n.layer)&&l.some((u)=>u.includes(t.layer)&&u.includes(n.layer))&&(h||t.layer===e.from_layer)&&(d||n.layer===e.to_layer)}function r$(e,t){return e.route_type==="wire"&&yQ(t).includes(e.layer)&&t6e(e,t)}function aOt(e,t){if(e.route_thickness_mode==="interpolated")return;let n=t==="start"?0:e.route.length-2,o=t==="start"?1:-1;for(;n>=0&&n<e.route.length-1;){let r=e.route[n],i=e.route[n+1];if(r?.route_type!=="wire"||i?.route_type!=="wire"||r.layer!==i.layer)return;if(Math.hypot(r.x-i.x,r.y-i.y)>0.000000001)return r.width;n+=o}}function cOt({point:e,endpointTraceCopperWidth:t,ownerTrace:n,traceWireSegmentsByNetAndLayer:o,fullConnectivityMap:r}){if(e.route_type!=="wire")return!1;let i=r.getNetConnectedToId(n.pcb_trace_id);if(!i)return!1;let s=o.get(i)?.get(e.layer)??[];for(let a of s){if(a.trace.pcb_trace_id===n.pcb_trace_id)continue;let c=t/2+a.start.width/2+0.000000001;if(oc(e,a.start,a.end)<=c)return!0}return!1}function lOt(e){return e.route_type==="through_pad"?{x:(e.start.x+e.end.x)/2,y:(e.start.y+e.end.y)/2}:{x:e.x,y:e.y}}function hOt(e,t,n,o){return t.some((r)=>{if(!r.pcb_port_id||r.pcb_port_id===n)return!1;return o.get(r.pcb_port_id)?.some((s)=>r$(e,s))??!1})}function B2r({firstPoint:e,lastPoint:t,port:n,expectedPorts:o,padMap:r}){let i,s=e.route_type==="wire"?e:void 0,a=t.route_type==="wire"?t:void 0,c=Wje(e).includes(n.pcb_port_id),l=Wje(t).includes(n.pcb_port_id);c&&s?i=s:l&&a||hOt(e,o,n.pcb_port_id,r)&&a?i=a:hOt(t,o,n.pcb_port_id,r)&&s?i=s:s&&a?i=nle(s,n)<=nle(a,n)?s:a:s?i=s:a&&(i=a);let h=lOt(e),d=lOt(t);return i?{x:i.x,y:i.y}:{x:(h.x+d.x)/2,y:(h.y+d.y)/2}}function T2r(e,{connMap:t,pcbConnectivityMap:n}={}){let o=function(b){let I=b.find((M)=>M.type==="pcb_board"),v=["top",...tS.filter((M)=>M.startsWith("inner")).slice(0,I?Math.max(0,I.num_layers-2):void 0),...I?.num_layers===1?[]:["bottom"]],P=new Map;for(let M of b){if(M.type!=="pcb_via"||!M.pcb_trace_id)continue;let B=P.get(M.pcb_trace_id);B?B.push(M):P.set(M.pcb_trace_id,[M])}return{stack:v,ownedViasByTrace:P}}(e),r=function(b){let I=oOt(b);return b.flatMap((v)=>v.type!=="pcb_trace"?[]:v.route.flatMap((P,M)=>P.route_type!=="wire"?[]:[...new Set([P.start_pcb_port_id,P.end_pcb_port_id])].flatMap((B)=>{if(!B||I.canConnect(P,B))return[];let T=I.ports.get(B);return[{trace:v,point:P,index:M,port:T,padLayers:I.layersForPort(T)}]})))}(e).map(({trace:b,point:I,index:v,port:P,padLayers:M})=>({type:"pcb_trace_error",error_type:"pcb_trace_error",pcb_trace_error_id:`missing_layer_connection_${b.pcb_trace_id}_${v}_${P.pcb_port_id}`,pcb_trace_id:b.pcb_trace_id,source_trace_id:b.source_trace_id??`!${b.pcb_trace_id}`,pcb_port_ids:[P.pcb_port_id],pcb_component_ids:P.pcb_component_id?[P.pcb_component_id]:[],center:{x:I.x,y:I.y},message:`Trace [${PO(e,b.pcb_trace_id)}] on ${I.layer} is missing a via connection to port [${ele(e,P.pcb_port_id)}] on ${M.join(", ")}.`})),i=e.filter((b)=>b.type==="pcb_port"),s=e.filter((b)=>b.type==="pcb_trace"),a=e.filter((b)=>b.type==="source_trace"),c=e.filter((b)=>b.type==="pcb_smtpad"),l=e.filter((b)=>b.type==="pcb_plated_hole"),h=new Map,d,u=t,_=()=>(u??=fV(e),u),p=()=>(d??=function(b,I){let v=new Map;for(let P of b){if(P.route_thickness_mode==="interpolated")continue;let M=I.getNetConnectedToId(P.pcb_trace_id);if(M)for(let B=0;B<P.route.length-1;B++){let T=P.route[B],N=P.route[B+1];if(T.route_type!=="wire"||N.route_type!=="wire")continue;if(T.layer!==N.layer)continue;if(Math.hypot(T.x-N.x,T.y-N.y)<=0.000000001)continue;let D=v.get(M)??new Map,L=D.get(T.layer)??[];L.push({trace:P,start:T,end:N}),D.set(T.layer,L),v.set(M,D)}}return v}(s,_()),d),m,A=()=>(m??=function(b,I){let v=new Map,P=dnn(b),M=b.filter((H)=>H.type==="pcb_trace"),B=b.filter((H)=>H.type==="pcb_via"),T=b.find((H)=>H.type==="pcb_board"),N=T?.num_layers,D=["top",...tS.filter((H)=>H.startsWith("inner")).slice(0,N===void 0?void 0:Math.max(0,N-2)),...N===1?[]:["bottom"]],L=(H,V,O)=>{if(![O.x,O.y].every(Number.isFinite))return;let U=I.getNetConnectedToId(H);if(!U)return;let j=P.some((J)=>{if(I.getNetConnectedToId(cq(J))!==U||!yQ(J).some((se)=>V.includes(se)))return!1;if(O.radius===void 0)return t6e(O,J);let ee={type:"pcb_via",pcb_via_id:H,x:O.x,y:O.y,outer_diameter:2*O.radius,hole_diameter:0,layers:V};return Kqe(ee,J)<=Zae}),Y=new Set;for(let J of M)if(J.route_thickness_mode!=="interpolated"&&I.getNetConnectedToId(J.pcb_trace_id)===U)for(let ee=1;ee<J.route.length;ee++){let se=J.route[ee-1],ne=J.route[ee];if(se.route_type!=="wire"||ne.route_type!=="wire"||se.layer!==ne.layer||!V.includes(se.layer)||!Number.isFinite(se.width)||se.width<=0||Math.hypot(se.x-ne.x,se.y-ne.y)<=Zae)continue;let re=O.radius===void 0?0:O.radius+se.width/2;if(oc(O,se,ne)<=re+Zae){Y.add(J.pcb_trace_id);break}}let X={...O,touchesPad:j,touchingTraceIds:Y},K=v.get(U)??new Map;for(let J of V){let ee=K.get(J)??[];ee.push(X),K.set(J,ee)}v.set(U,K)};for(let H of B)!Number.isFinite(H.outer_diameter)||H.outer_diameter<=0||L(H.pcb_via_id,yQ(H),{x:H.x,y:H.y,ownerTraceId:H.pcb_trace_id,radius:H.outer_diameter/2});for(let H of b)if(H.type==="pcb_trace")for(let V of H.route){if(V.route_type!=="via")continue;if(B.some((Y)=>Math.hypot(Y.x-V.x,Y.y-V.y)<=Zae&&(Y.pcb_trace_id===H.pcb_trace_id||!Y.pcb_trace_id&&I.areIdsConnected(Y.pcb_via_id,H.pcb_trace_id))))continue;let O=D.indexOf(V.from_layer),U=D.indexOf(V.to_layer);if(O<0||U<0)continue;let j=V.outer_diameter;j!==void 0&&(!Number.isFinite(j)||j<=0)||L(H.pcb_trace_id,D.slice(Math.min(O,U),Math.max(O,U)+1),{x:V.x,y:V.y,ownerTraceId:H.pcb_trace_id,radius:j===void 0?void 0:j/2})}return v}(e,_()),m),g=new Set;for(let b of c)b.pcb_port_id&&h.set(b.pcb_port_id,[...h.get(b.pcb_port_id)??[],b]);for(let b of l)b.pcb_port_id&&h.set(b.pcb_port_id,[...h.get(b.pcb_port_id)??[],b]);let f=new Map,y=new Map;for(let b of s){let I=new Set,v=b.route[0],P=b.route.at(-1);for(let M of[v,P])if(M)for(let[B,T]of h)T.some((N)=>r$(M,N))&&I.add(B);f.set(b.pcb_trace_id,I);for(let M of I){let B=y.get(M)??new Set;B.add(b.pcb_trace_id),y.set(M,B)}}let x=new Map,C=(b)=>{let I=x.get(b.pcb_trace_id);if(I)return I;n??=function(B){let T=new Ymr;T.circuitJson=B;for(let U of B)U.type==="pcb_trace"?T.traceIdToElm.set(U.pcb_trace_id,U):U.type==="pcb_port"&&T.portIdToElm.set(U.pcb_port_id,U);let N=[...T.traceIdToElm.values()],D=new Map;for(let[U,j]of N.entries())for(let Y=0;Y<j.route.length-1;Y++){let X=j.route[Y],K=j.route[Y+1];if(X.route_type!=="wire"||K.route_type!=="wire"||X.layer!==K.layer)continue;let J=X.width/2+0.000000001,ee=D.get(X.layer)??[];ee.push({traceIndex:U,segmentTrace:{...j,route:[X,K]},minX:Math.min(X.x,K.x)-J,minY:Math.min(X.y,K.y)-J,maxX:Math.max(X.x,K.x)+J,maxY:Math.max(X.y,K.y)+J}),D.set(X.layer,ee)}let L=N.map(()=>new Set);for(let U of D.values()){let j=new i_(U.length);for(let Y of U)j.add(Y.minX,Y.minY,Y.maxX,Y.maxY);j.finish();for(let Y of U)for(let X of j.search(Y.minX,Y.minY,Y.maxX,Y.maxY)){let K=U[X],J=K.traceIndex,ee=L[Y.traceIndex];J>Y.traceIndex&&!ee.has(J)&&T._arePcbTracesConnected(Y.segmentTrace,K.segmentTrace)&&ee.add(J)}}let H=[];for(let[U,j]of L.entries())for(let Y of[...j].sort((X,K)=>X-K))H.push([N[U].pcb_trace_id,N[Y].pcb_trace_id]);let V=oOt(B),O=new Map;for(let U of N)for(let j of U.route)if(j.route_type==="wire")for(let Y of new Set([j.start_pcb_port_id,j.end_pcb_port_id])){if(!Y||!T.portIdToElm.has(Y))continue;if(!V.canConnect(j,Y))continue;let X=O.get(Y)??[];X.push(j.start_pcb_port_id===Y?[Y,U.pcb_trace_id]:[U.pcb_trace_id,Y]),O.set(Y,X)}for(let U of T.portIdToElm.keys())for(let j of O.get(U)??[])H.push(j);return H.push(...I2r(B)),T.connMap=new eV(f$e(H)),T}(e);let v=new Set,P=[b.pcb_trace_id];for(;P.length>0;){let B=P.pop();if(!v.has(B)){v.add(B);for(let T of n.getAllTracesConnectedToTrace(B))v.has(T.pcb_trace_id)||P.push(T.pcb_trace_id);for(let T of f.get(B)??[])for(let N of y.get(T)??[])v.has(N)||P.push(N)}}let M=s.filter((B)=>v.has(B.pcb_trace_id));for(let B of M)x.set(B.pcb_trace_id,M);return M};for(let b of s){if(b.route.length===0)continue;let I=b.route[0],v=b.route[b.route.length-1],P=a.find((T)=>T.source_trace_id===b.source_trace_id),M=P?i.filter((T)=>P.connected_source_port_ids?.includes(T.source_port_id)):[],B;for(let T=1;T<b.route.length-1;T++){let N=b.route[T-1],D=b.route[T],L=b.route[T+1];if(D.route_type==="via"){let H=N.route_type==="wire",V=L.route_type==="wire";H&&V&&(w2r({via:D,incoming:N,outgoing:L,traceId:b.pcb_trace_id,context:o})||(B??=PO(e,b.pcb_trace_id),r.push({type:"pcb_trace_error",message:`Via in trace [${B}] does not connect its adjacent wire layers at position {x: ${D.x}, y: ${D.y}}.`,source_trace_id:P?.source_trace_id||b.source_trace_id||`!${b.pcb_trace_id}`,error_type:"pcb_trace_error",pcb_trace_id:b.pcb_trace_id,pcb_trace_error_id:`misaligned_via_${b.pcb_trace_id}_${T}`,pcb_component_ids:[],pcb_port_ids:[]})))}}if(P&&M.length>0){if(g.has(P.source_trace_id))continue;g.add(P.source_trace_id)}for(let T of M){if(!T.pcb_port_id)continue;let N=h.get(T.pcb_port_id);if(!N?.length)continue;let D=N.some((H)=>r$(I,H)),L=N.some((H)=>r$(v,H));if(D||L)continue;if(!C(b).some((H)=>f.get(H.pcb_trace_id)?.has(T.pcb_port_id))&&(!D&&!L)){B??=PO(e,b.pcb_trace_id);let H=ele(e,T.pcb_port_id),V=N[0].type==="pcb_smtpad"?"SMD pad":"through-hole pad",O=B2r({firstPoint:I,lastPoint:v,port:T,expectedPorts:M,padMap:h});r.push({type:"pcb_trace_error",message:`Trace [${B}] is missing a connection to ${V} ${H}`,source_trace_id:P?.source_trace_id||b.source_trace_id||`!${b.pcb_trace_id}`,error_type:"pcb_trace_error",pcb_trace_id:b.pcb_trace_id,pcb_trace_error_id:`missing_connection_${b.pcb_trace_id}_${T.pcb_port_id}`,center:O,pcb_component_ids:[],pcb_port_ids:[T.pcb_port_id]})}}if(M.length===0){let T=!1,N=!1;for(let Y of h.values())Y.some((X)=>r$(I,X))&&(T=!0),Y.some((X)=>r$(v,X))&&(N=!0);let D=T?void 0:aOt(b,"start"),L=N?void 0:aOt(b,"end"),H=D!==void 0&&cOt({point:I,endpointTraceCopperWidth:D,ownerTrace:b,traceWireSegmentsByNetAndLayer:p(),fullConnectivityMap:_()}),V=L!==void 0&&cOt({point:v,endpointTraceCopperWidth:L,ownerTrace:b,traceWireSegmentsByNetAndLayer:p(),fullConnectivityMap:_()}),O=T||H||D!==void 0&&sOt({point:I,width:D,ownerTrace:b,index:A(),connectivity:_()}),U=N||V||L!==void 0&&sOt({point:v,width:L,ownerTrace:b,index:A(),connectivity:_()}),j=I.route_type==="wire"&&v.route_type==="wire"&&I.layer===v.layer&&Math.hypot(I.x-v.x,I.y-v.y)<=0.000000001;O||I.route_type!=="wire"||(B??=PO(e,b.pcb_trace_id),r.push({type:"pcb_trace_error",message:`Trace [${B}] has disconnected endpoint at (${I.x.toFixed(2)}, ${I.y.toFixed(2)})`,source_trace_id:P?.source_trace_id||b.source_trace_id||`!${b.pcb_trace_id}`,error_type:"pcb_trace_error",pcb_trace_id:b.pcb_trace_id,pcb_trace_error_id:`disconnected_endpoint_${b.pcb_trace_id}_start`,center:{x:I.x,y:I.y},pcb_component_ids:[],pcb_port_ids:[]})),U||v.route_type!=="wire"||j&&!O||(B??=PO(e,b.pcb_trace_id),r.push({type:"pcb_trace_error",message:`Trace [${B}] has disconnected endpoint at (${v.x.toFixed(2)}, ${v.y.toFixed(2)})`,source_trace_id:P?.source_trace_id||b.source_trace_id||`!${b.pcb_trace_id}`,error_type:"pcb_trace_error",pcb_trace_id:b.pcb_trace_id,pcb_trace_error_id:`disconnected_endpoint_${b.pcb_trace_id}_end`,center:{x:v.x,y:v.y},pcb_component_ids:[],pcb_port_ids:[]}))}}return r}function D2r(e,t={}){let n=[],o=vV(e);if(!o)return n;let r=t.margin??xQ(o,"min_board_edge_clearance")??d2r,i=function(a){if(a.outline&&a.outline.length>0)return a.outline.map((c)=>({x:c.x,y:c.y}));if(a.center&&typeof a.width=="number"&&typeof a.height=="number"){let c=a.center.x,l=a.center.y,h=a.width/2,d=a.height/2;return[{x:c-h,y:l-d},{x:c+h,y:l-d},{x:c+h,y:l+d},{x:c-h,y:l+d}]}return null}(o);if(!i)return n;let s=sb(e).pcb_trace.list();for(let a of s)if(!(a.route.length<2))for(let c=0;c<a.route.length-1;c++){let l=a.route[c],h=a.route[c+1];if(l.route_type!=="wire"||h.route_type!=="wire")continue;let d="width"in l?l.width:("width"in h)?h.width:0.1,u={x:l.x,y:l.y},_={x:h.x,y:h.y},p=Number.POSITIVE_INFINITY;for(let A=0;A<i.length;A++){let g=s_(u,_,i[A],i[(A+1)%i.length]);g<p&&(p=g)}let m=d/2+r;if(p<m){let A={type:"pcb_trace_error",error_type:"pcb_trace_error",pcb_trace_error_id:`trace_too_close_to_board_${a.pcb_trace_id}_segment_${c}`,message:`Trace too close to board edge (${p.toFixed(3)}mm < ${m.toFixed(3)}mm required, margin: ${r}mm)`,pcb_trace_id:a.pcb_trace_id,source_trace_id:a.source_trace_id||"",center:{x:(u.x+_.x)/2,y:(u.y+_.y)/2},pcb_component_ids:[],pcb_port_ids:[]};n.push(A)}}return n}function _nn(e,{connMap:t,minClearance:n}={}){let o=dnn(e),r=unn(e);if(o.length===0||r.length===0)return[];let i=vV(e);n??=xQ(i,"min_trace_to_pad_edge_clearance")??hnn,t??=fV(e);let s=new qqe({objects:o,getBounds:n6e,getId:(l)=>cq(l)}),a=new Map,c=new Set;for(let l of r){let h=s.getObjectsInBounds(o$(l),n+l.thickness/2);for(let d of h){let u=cq(d);if(!yQ(d).includes(l.layer))continue;if(t.areIdsConnected(l.pcb_trace_id,u))continue;let _=`${u}_${l.pcb_trace_id}`,{gap:p,center:m}=$qe(l,d);if(Q$(p)){a.delete(_),c.add(_);continue}if(c.has(_))continue;if(p+Mw>=n)continue;let A={type:"pcb_pad_trace_clearance_error",pcb_pad_trace_clearance_error_id:`pad_trace_clearance_${_}`,error_type:"pcb_pad_trace_clearance_error",message:`Pad ${u9(e,u)} and trace ${u9(e,l.pcb_trace_id)} are too close (clearance: ${HCe(p)}, minimum: ${HCe(n)})`,pcb_pad_id:u,pcb_trace_id:l.pcb_trace_id,minimum_clearance:n,actual_clearance:p,center:m},g=a.get(_);(!g||p<g.gap)&&a.set(_,{error:A,gap:p})}}return Array.from(a.values()).map(({error:l})=>l)}function gnn(e,{connMap:t,minClearance:n}={}){let o=e.filter((c)=>c.type==="pcb_via"),r=unn(e).map((c)=>({...c,minX:Math.min(c.x1,c.x2),maxX:Math.max(c.x1,c.x2),minY:Math.min(c.y1,c.y2),maxY:Math.max(c.y1,c.y2),radius:Math.max(0,c.thickness/2),finiteBounds:Number.isFinite(c.x1)&&Number.isFinite(c.x2)&&Number.isFinite(c.y1)&&Number.isFinite(c.y2)&&Number.isFinite(c.thickness)}));if(o.length===0||r.length===0)return[];let i=vV(e);n??=xQ(i,"min_trace_to_pad_edge_clearance")??hnn,t??=fV(e);let s=new Map,a=new Set;for(let c of o){let l=yQ(c),h=Number.isFinite(c.x)&&Number.isFinite(c.y)&&Number.isFinite(c.outer_diameter)&&Number.isFinite(n),d=Math.max(0,c.outer_diameter/2)+Math.max(0,n)+Mw;for(let u of r){let _=d+u.radius;if(h&&u.finiteBounds&&(c.x<u.minX-_||c.x>u.maxX+_||c.y<u.minY-_||c.y>u.maxY+_))continue;if(!l.includes(u.layer))continue;if(t.areIdsConnected(u.pcb_trace_id,c.pcb_via_id))continue;let p=`${c.pcb_via_id}_${u.pcb_trace_id}`,{gap:m,center:A}=$qe(u,c);if(Q$(m)){s.delete(p),a.add(p);continue}if(a.has(p))continue;if(m+Mw>=n)continue;let g={type:"pcb_via_trace_clearance_error",pcb_via_trace_clearance_error_id:`via_trace_clearance_${p}`,error_type:"pcb_via_trace_clearance_error",message:`Via ${u9(e,c.pcb_via_id)} and trace ${u9(e,u.pcb_trace_id)} are too close (clearance: ${HCe(m)}, minimum: ${HCe(n)})`,pcb_via_id:c.pcb_via_id,pcb_trace_id:u.pcb_trace_id,minimum_clearance:n,actual_clearance:m,center:A},f=s.get(p);(!f||m<f.gap)&&s.set(p,{error:g,gap:m})}}return Array.from(s.values()).map(({error:c})=>c)}var N2r,R2r,Q2r=Object.create,{getPrototypeOf:k2r,defineProperty:dOt,getOwnPropertyNames:L2r}=Object,uOt=Object.prototype.hasOwnProperty;function H2r(e){return this[e]}var pOt,$4e,F2r=(pOt=function(e,t){var n,o;n=e,o=function(){var r=function(L){return L!=null&&(i(L)||function(H){return typeof H.readFloatLE=="function"&&typeof H.slice=="function"&&i(H.slice(0,0))}(L)||!!L._isBuffer)};function i(L){return!!L.constructor&&typeof L.constructor.isBuffer=="function"&&L.constructor.isBuffer(L)}var s=Object.prototype.toString,a=function(L){if(typeof L>"u")return"undefined";if(L===null)return"null";if(L===!0||L===!1||L instanceof Boolean)return"boolean";if(typeof L=="string"||L instanceof String)return"string";if(typeof L=="number"||L instanceof Number)return"number";if(typeof L=="function"||L instanceof Function)return"function";if(typeof Array.isArray<"u"&&Array.isArray(L))return"array";if(L instanceof RegExp)return"regexp";if(L instanceof Date)return"date";var H=s.call(L);return H==="[object RegExp]"?"regexp":H==="[object Date]"?"date":H==="[object Arguments]"?"arguments":H==="[object Error]"?"error":r(L)?"buffer":H==="[object Set]"?"set":H==="[object WeakSet]"?"weakset":H==="[object Map]"?"map":H==="[object WeakMap]"?"weakmap":H==="[object Symbol]"?"symbol":H==="[object Int8Array]"?"int8array":H==="[object Uint8Array]"?"uint8array":H==="[object Uint8ClampedArray]"?"uint8clampedarray":H==="[object Int16Array]"?"int16array":H==="[object Uint16Array]"?"uint16array":H==="[object Int32Array]"?"int32array":H==="[object Uint32Array]"?"uint32array":H==="[object Float32Array]"?"float32array":H==="[object Float64Array]"?"float64array":"object"};function c(L,H){return L(H={exports:{}},H.exports),H.exports}var l=c(function(L){(function(){function H(V,O){if(typeof O!="function")return V;var U={};for(var j in V)Object.prototype.hasOwnProperty.call(V,j)&&(U[O(j,V[j])||j]=V[j]);return U}L.exports?L.exports=H:window.rename=H})()}),h=function L(H,V){var O=a(H);if(O!=="object"&&O!=="array")throw Error("expected an object");var U=[];for(var j in O==="object"&&(H=l(H,V),U={}),H)if(H.hasOwnProperty(j)){var Y=H[j];a(Y)==="object"||a(Y)==="array"?U[j]=L(Y,V):U[j]=Y}return U},d=c(function(L){var H=Object.prototype.hasOwnProperty,V="~";function O(){}function U(Y,X,K){this.fn=Y,this.context=X,this.once=K||!1}function j(){this._events=new O,this._eventsCount=0}Object.create&&(O.prototype=Object.create(null),new O().__proto__||(V=!1)),j.prototype.eventNames=function(){var Y,X,K=[];if(this._eventsCount===0)return K;for(X in Y=this._events)H.call(Y,X)&&K.push(V?X.slice(1):X);return Object.getOwnPropertySymbols?K.concat(Object.getOwnPropertySymbols(Y)):K},j.prototype.listeners=function(Y,X){var K=V?V+Y:Y,J=this._events[K];if(X)return!!J;if(!J)return[];if(J.fn)return[J.fn];for(var ee=0,se=J.length,ne=Array(se);ee<se;ee++)ne[ee]=J[ee].fn;return ne},j.prototype.emit=function(Y,X,K,J,ee,se){var ne=V?V+Y:Y;if(!this._events[ne])return!1;var re,Z,te=this._events[ne],ie=arguments.length;if(te.fn){switch(te.once&&this.removeListener(Y,te.fn,void 0,!0),ie){case 1:return te.fn.call(te.context),!0;case 2:return te.fn.call(te.context,X),!0;case 3:return te.fn.call(te.context,X,K),!0;case 4:return te.fn.call(te.context,X,K,J),!0;case 5:return te.fn.call(te.context,X,K,J,ee),!0;case 6:return te.fn.call(te.context,X,K,J,ee,se),!0}for(Z=1,re=Array(ie-1);Z<ie;Z++)re[Z-1]=arguments[Z];te.fn.apply(te.context,re)}else{var ce,ue=te.length;for(Z=0;Z<ue;Z++)switch(te[Z].once&&this.removeListener(Y,te[Z].fn,void 0,!0),ie){case 1:te[Z].fn.call(te[Z].context);break;case 2:te[Z].fn.call(te[Z].context,X);break;case 3:te[Z].fn.call(te[Z].context,X,K);break;case 4:te[Z].fn.call(te[Z].context,X,K,J);break;default:if(!re)for(ce=1,re=Array(ie-1);ce<ie;ce++)re[ce-1]=arguments[ce];te[Z].fn.apply(te[Z].context,re)}}return!0},j.prototype.on=function(Y,X,K){var J=new U(X,K||this),ee=V?V+Y:Y;return this._events[ee]?this._events[ee].fn?this._events[ee]=[this._events[ee],J]:this._events[ee].push(J):(this._events[ee]=J,this._eventsCount++),this},j.prototype.once=function(Y,X,K){var J=new U(X,K||this,!0),ee=V?V+Y:Y;return this._events[ee]?this._events[ee].fn?this._events[ee]=[this._events[ee],J]:this._events[ee].push(J):(this._events[ee]=J,this._eventsCount++),this},j.prototype.removeListener=function(Y,X,K,J){var ee=V?V+Y:Y;if(!this._events[ee])return this;if(!X)return--this._eventsCount===0?this._events=new O:delete this._events[ee],this;var se=this._events[ee];if(se.fn)se.fn!==X||J&&!se.once||K&&se.context!==K||(--this._eventsCount===0?this._events=new O:delete this._events[ee]);else{for(var ne=0,re=[],Z=se.length;ne<Z;ne++)(se[ne].fn!==X||J&&!se[ne].once||K&&se[ne].context!==K)&&re.push(se[ne]);re.length?this._events[ee]=re.length===1?re[0]:re:--this._eventsCount===0?this._events=new O:delete this._events[ee]}return this},j.prototype.removeAllListeners=function(Y){var X;return Y?(X=V?V+Y:Y,this._events[X]&&(--this._eventsCount===0?this._events=new O:delete this._events[X])):(this._events=new O,this._eventsCount=0),this},j.prototype.off=j.prototype.removeListener,j.prototype.addListener=j.prototype.on,j.prototype.setMaxListeners=function(){return this},j.prefixed=V,j.EventEmitter=j,L.exports=j});function u(L,H,V){return H in L?Object.defineProperty(L,H,{value:V,enumerable:!0,configurable:!0,writable:!0}):L[H]=V,L}var _=function(){},p={data:"state-data",cdata:"state-cdata",tagBegin:"state-tag-begin",tagName:"state-tag-name",tagEnd:"state-tag-end",attributeNameStart:"state-attribute-name-start",attributeName:"state-attribute-name",attributeNameEnd:"state-attribute-name-end",attributeValueBegin:"state-attribute-value-begin",attributeValue:"state-attribute-value"},m={lt:"action-lt",gt:"action-gt",space:"action-space",equal:"action-equal",quote:"action-quote",slash:"action-slash",char:"action-char",error:"action-error"},A={text:"text",openTag:"open-tag",closeTag:"close-tag",attributeName:"attribute-name",attributeValue:"attribute-value"},g={" ":m.space,"\t":m.space,"\n":m.space,"\r":m.space,"<":m.lt,">":m.gt,'"':m.quote,"'":m.quote,"=":m.equal,"/":m.slash},f=function(L){var H,V,O,U,j,Y,X,K,J,ee;L=Object.assign({debug:!1},L);var se=new d,ne=p.data,re="",Z="",te="",ie="",ce="",ue="",de=function(ge,xe){if(Z[0]!=="?"&&Z[0]!=="!"){var Ee={type:ge,value:xe};L.debug&&console.log("emit:",Ee),se.emit("data",Ee)}};se.stateMachine=(u(ee={},p.data,(u(H={},m.lt,function(){re.trim()&&de(A.text,re),Z="",ce=!1,ne=p.tagBegin}),u(H,m.char,function(ge){re+=ge}),H)),u(ee,p.cdata,u({},m.char,function(ge){(re+=ge).substr(-3)==="]]>"&&(de(A.text,re.slice(0,-3)),re="",ne=p.data)})),u(ee,p.tagBegin,(u(V={},m.space,_),u(V,m.char,function(ge){Z=ge,ne=p.tagName}),u(V,m.slash,function(){Z="",ce=!0}),V)),u(ee,p.tagName,(u(O={},m.space,function(){ce?ne=p.tagEnd:(ne=p.attributeNameStart,de(A.openTag,Z))}),u(O,m.gt,function(){de(ce?A.closeTag:A.openTag,Z),re="",ne=p.data}),u(O,m.slash,function(){ne=p.tagEnd,de(A.openTag,Z)}),u(O,m.char,function(ge){(Z+=ge)==="![CDATA["&&(ne=p.cdata,re="",Z="")}),O)),u(ee,p.tagEnd,(u(U={},m.gt,function(){de(A.closeTag,Z),re="",ne=p.data}),u(U,m.char,_),U)),u(ee,p.attributeNameStart,(u(j={},m.char,function(ge){te=ge,ne=p.attributeName}),u(j,m.gt,function(){re="",ne=p.data}),u(j,m.space,_),u(j,m.slash,function(){ce=!0,ne=p.tagEnd}),j)),u(ee,p.attributeName,(u(Y={},m.space,function(){ne=p.attributeNameEnd}),u(Y,m.equal,function(){de(A.attributeName,te),ne=p.attributeValueBegin}),u(Y,m.gt,function(){ie="",de(A.attributeName,te),de(A.attributeValue,ie),re="",ne=p.data}),u(Y,m.slash,function(){ce=!0,ie="",de(A.attributeName,te),de(A.attributeValue,ie),ne=p.tagEnd}),u(Y,m.char,function(ge){te+=ge}),Y)),u(ee,p.attributeNameEnd,(u(X={},m.space,_),u(X,m.equal,function(){de(A.attributeName,te),ne=p.attributeValueBegin}),u(X,m.gt,function(){ie="",de(A.attributeName,te),de(A.attributeValue,ie),re="",ne=p.data}),u(X,m.char,function(ge){ie="",de(A.attributeName,te),de(A.attributeValue,ie),te=ge,ne=p.attributeName}),X)),u(ee,p.attributeValueBegin,(u(K={},m.space,_),u(K,m.quote,function(ge){ue=ge,ie="",ne=p.attributeValue}),u(K,m.gt,function(){de(A.attributeValue,ie=""),re="",ne=p.data}),u(K,m.char,function(ge){ue="",ie=ge,ne=p.attributeValue}),K)),u(ee,p.attributeValue,(u(J={},m.space,function(ge){ue?ie+=ge:(de(A.attributeValue,ie),ne=p.attributeNameStart)}),u(J,m.quote,function(ge){ue===ge?(de(A.attributeValue,ie),ne=p.attributeNameStart):ie+=ge}),u(J,m.gt,function(ge){ue?ie+=ge:(de(A.attributeValue,ie),re="",ne=p.data)}),u(J,m.slash,function(ge){ue?ie+=ge:(de(A.attributeValue,ie),ce=!0,ne=p.tagEnd)}),u(J,m.char,function(ge){ie+=ge}),J)),ee);var me=function(ge){L.debug&&console.log(ne,ge);var xe=se.stateMachine[ne],Ee=xe[function(Re){return g[Re]||m.char}(ge)]||xe[m.error]||xe[m.char];Ee(ge)};return se.write=function(ge){for(var xe=ge.length,Ee=0;Ee<xe;Ee++)me(ge[Ee])},se},y=A,x={element:"element",text:"text"},C=function(L){return Object.assign({name:"",type:x.element,value:"",parent:null,attributes:{},children:[]},L)},b=function(L){L=Object.assign({stream:!1,parentNodes:!0,doneEvent:"done",tagPrefix:"tag:",emitTopLevelOnly:!1,debug:!1},L);var H=void 0,V=void 0,O=void 0,U=void 0,j=new d,Y=function(X){switch(X.type){case y.openTag:if(O===null)(O=V).name=X.value;else{var K=C({name:X.value,parent:O});O.children.push(K),O=K}break;case y.closeTag:var J=O.parent;if(L.parentNodes||(O.parent=null),O.name!==X.value)break;L.stream&&J===V&&(V.children=[],O.parent=null),L.emitTopLevelOnly&&J!==V||(j.emit(L.tagPrefix+O.name,O),j.emit("tag",O.name,O)),O===V&&(H.removeAllListeners("data"),j.emit(L.doneEvent,O),V=null),O=J;break;case y.text:O&&O.children.push(C({type:x.text,value:X.value,parent:L.parentNodes?O:null}));break;case y.attributeName:U=X.value,O.attributes[U]="";break;case y.attributeValue:O.attributes[U]=X.value}};return j.reset=function(){(H=f({debug:L.debug})).on("data",Y),V=C(),O=null,U="",j.parse=H.write},j.reset(),j},I=function(L,H){H=Object.assign({},H,{stream:!1,tagPrefix:":"});var V=b(H),O=void 0;return V.on("done",function(U){O=U}),V.parse(L),O},v=I,P=function(L){return h(L,function(H){return B(H)?H:M(H)})},M=function(L){return L.replace(/[-|:]([a-z])/gi,function(H,V){return V.toUpperCase()})},B=function(L){return/^(data|aria)(-\w+)/.test(L)},T=function(L){return String(L).replace(/&/g,"&amp;").replace(/'/g,"&apos;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")},N=function(L){var H,V,O=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},U=O.transformNode,j=U===void 0?function(K){return K}:U,Y=O.camelcase,X=Y!==void 0&&Y;return H=function(K){var J=v("<root>".concat(K,"</root>"),{parentNodes:!1});if(J.children&&J.children.length>0&&J.children.every(function(ee){return ee.name==="svg"}))return J.children.length===1?J.children[0]:J.children;throw Error("nothing to parse")}(L),V=j(H),X&&(V=P(V)),V},D=Object.assign({},{parse:function(){for(var L=arguments.length,H=Array(L),V=0;V<L;V++)H[V]=arguments[V];return new Promise(function(O,U){try{O(N.apply(void 0,H))}catch(j){U(j)}})},parseSync:N,stringify:function L(H){var V=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},O=V.transformAttr,U=O===void 0?function(re,Z,te){return"".concat(re,'="').concat(te(Z),'"')}:O,j=V.transformNode,Y=j===void 0?function(re){return re}:j,X=V.selfClose,K=X===void 0||X;if(Array.isArray(H))return H.map(function(re){return L(re,{transformAttr:U,selfClose:K,transformNode:Y})}).join("");var J=Y(H);if(J.type==="text")return function(re){if(re){var Z=String(re);return/[&<>]/.test(Z)?"<![CDATA[".concat(Z.replace(/]]>/,"]]]]><![CDATA[>"),"]]>"):Z}return""}(J.value);var ee="";for(var se in J.attributes){var ne=U(se,J.attributes[se],T,J.name);ee+=ne?" ".concat(ne):""}return J.children&&J.children.length>0||!K?"<".concat(J.name).concat(ee,">").concat(L(J.children,{transformAttr:U,transformNode:Y,selfClose:K}),"</").concat(J.name,">"):"<".concat(J.name).concat(ee,"/>")}});return D},typeof e=="object"&&typeof t<"u"?t.exports=o():typeof define=="function"&&define.amd?define(o):(n=typeof globalThis<"u"?globalThis:n||self).svgson=o()},()=>($4e||pOt(($4e={exports:{}}).exports,$4e),$4e.exports)),mOt={0:"M0.301025 0.257813 L0.206593 0.283385 L0.122042 0.361307 L0.075923 0.474441 L0.064942 0.642221 L0.091296 0.78289 L0.159376 0.899463 L0.257104 0.961214 L0.344948 0.961214 L0.442678 0.899463 L0.510757 0.78289 L0.537111 0.642221 L0.526131 0.474441 L0.480012 0.361307 L0.39546 0.283385 L0.301025 0.257813",1:"M0.220426 0.40845 L0.381626 0.270996 L0.381626 0.948966",2:"M0.110409 0.39212 L0.125621 0.342293 L0.170571 0.295823 L0.244237 0.26431 L0.291518 0.257813 L0.373319 0.263799 L0.434683 0.290705 L0.468239 0.331966 L0.480292 0.379913 L0.479492 0.411806 L0.465088 0.465192 L0.402571 0.568988 L0.245134 0.766438 L0.07959 0.948045 L0.522462 0.948045",3:"M0.081606 0.345073 L0.119154 0.315633 L0.178996 0.284091 L0.255265 0.257813 L0.349133 0.263062 L0.43127 0.289348 L0.48994 0.336662 L0.525141 0.394491 L0.513407 0.457577 L0.466472 0.504892 L0.384334 0.541692 L0.290464 0.56272 L0.20833 0.573235 L0.290464 0.583749 L0.384334 0.610035 L0.466472 0.652092 L0.519274 0.709922 L0.531007 0.773007 L0.50754 0.841351 L0.454738 0.899179 L0.3726 0.946494 L0.310412 0.961214 L0.209503 0.959111 L0.127367 0.946494 L0.071046 0.929671",4:"M0.418494 0.270996 L0.048828 0.724199 L0.553224 0.724199 M0.414181 0.578167 L0.414181 0.94897",5:"M0.074951 0.270996 L0.074951 0.614701 L0.267655 0.5695 L0.405247 0.586502 L0.460002 0.617189 L0.498028 0.660731 L0.527101 0.779401 L0.513352 0.841049 L0.477274 0.889568 L0.406378 0.93463 L0.324445 0.958337 L0.247399 0.962139 L0.182516 0.949767 L0.130068 0.925508 L0.074951 0.875607 M0.074951 0.270996 L0.527101 0.270996",6:"M0.428549 0.257813 L0.341433 0.285053 L0.26073 0.312099 L0.192188 0.360182 L0.138902 0.410969 L0.098219 0.500422 L0.070249 0.584267 L0.067264 0.670716 L0.065164 0.756863 L0.087163 0.820973 L0.108168 0.861042 L0.157916 0.913131 L0.210981 0.948192 L0.29279 0.961214 L0.384548 0.956206 L0.456409 0.924151 L0.507262 0.881077 L0.5349 0.821975 L0.537111 0.771889 L0.521634 0.718798 L0.498418 0.67372 L0.463042 0.636657 L0.414398 0.613617 L0.34696 0.598591 L0.28284 0.595587 L0.215403 0.605604 L0.145756 0.641665 L0.109274 0.678729 L0.064942 0.724006",7:"M0.071534 0.270996 L0.530519 0.270996 L0.495935 0.291702 L0.477752 0.305407 L0.435186 0.346112 L0.412067 0.374136 L0.388565 0.40796 L0.365315 0.448098 L0.342943 0.495062 L0.322081 0.549366 L0.303364 0.611524 L0.287416 0.68205 L0.270077 0.80465 L0.26253 0.94897",8:"M0.286761 0.257813 L0.210684 0.27162 L0.1414 0.305622 L0.092494 0.382125 L0.111513 0.450128 L0.16857 0.502193 L0.228345 0.539382 L0.377781 0.594635 L0.470161 0.645637 L0.52586 0.706203 L0.538087 0.792269 L0.506841 0.87621 L0.438915 0.927212 L0.339743 0.961214 L0.263666 0.959089 L0.174004 0.929337 L0.102003 0.881523 L0.063965 0.811395 L0.066682 0.741266 L0.102003 0.671139 L0.180797 0.608448 L0.259591 0.580822 L0.358762 0.548945 L0.456576 0.49688 L0.486463 0.446941 L0.487822 0.362999 L0.453859 0.302434 L0.384574 0.265245 L0.286761 0.257813",9:"M0.511026 0.437812 L0.491026 0.347812 L0.451026 0.297812 L0.391026 0.267812 L0.311026 0.257813 L0.231026 0.267812 L0.161026 0.297812 L0.111026 0.347812 L0.091026 0.417812 L0.111026 0.487812 L0.161026 0.537812 L0.231026 0.567812 L0.311026 0.577812 L0.391026 0.557812 L0.451026 0.517812 L0.491026 0.477812 L0.511026 0.437812 M0.510026 0.438812 L0.434026 0.636812 L0.381026 0.777812 L0.337026 0.879812 L0.301026 0.957812","!":"M0.301026 0.270996 L0.301026 0.749566 M0.251466 0.94897 L0.350587 0.94897",'"':"M0.16504 0.270996 L0.16504 0.523022 M0.437013 0.270996 L0.437013 0.523022","#":"M0.20958 0.282227 L0.146515 0.949754 M0.461844 0.282227 L0.398779 0.949754 M0.032999 0.526969 L0.600587 0.452796 M0.001465 0.82366 L0.569055 0.749486",$:"M0.307121 0.240234 L0.307121 1.083502 M0.490031 0.415915 L0.404676 0.328075 L0.23396 0.310507 L0.136407 0.398347 L0.099828 0.521324 L0.124213 0.591596 L0.197379 0.644299 L0.429061 0.697003 L0.502224 0.749708 L0.526613 0.837547 L0.477836 0.960526 L0.355897 1.013228 L0.197379 0.99566 L0.112021 0.942957 L0.07544 0.837547","'":"M0.301026 0.270996 L0.301026 0.523022","(":"M0.413087 0.241211 L0.372337 0.28347 L0.331589 0.334184 L0.290838 0.393349 L0.25009 0.460965 L0.219528 0.528584 L0.199153 0.5962 L0.188966 0.655364 L0.199153 0.714529 L0.219528 0.782146 L0.25009 0.849764 L0.290838 0.91738 L0.331589 0.976544 L0.372337 1.027258 L0.413087 1.069491",")":"M0.188966 0.241211 L0.229716 0.28347 L0.270466 0.334184 L0.311213 0.393349 L0.351964 0.460965 L0.382526 0.528584 L0.4029 0.5962 L0.413087 0.655364 L0.4029 0.714529 L0.382526 0.782146 L0.351964 0.849764 L0.311213 0.91738 L0.270466 0.976544 L0.229716 1.027258 L0.188966 1.069491","*":"M0.301026 0.458702 L0.301026 0.681942 M0.301026 0.458702 L0.520997 0.536834 M0.301026 0.458702 L0.439954 0.257813 M0.301026 0.458702 L0.162098 0.257813 M0.301026 0.458702 L0.081055 0.536834","+":"M0.042969 0.66845 L0.559083 0.66845 M0.301023 0.428223 L0.301023 0.908661",",":"M0.38672 0.852051 L0.215333 1.030661 L0.301025 1.119971","-":"M0.173829 0.686035 L0.428224 0.686035",".":"M0.362549 0.851074 L0.239503 0.851074","/":"M0.062501 1.035249 L0.539551 0.270996","<":"M0.559083 0.441895 L0.042969 0.66939 L0.042969 0.66939 L0.559083 0.896902","=":"M0.042969 0.545898 L0.559083 0.545898 M0.042969 0.80837 L0.559083 0.80837",">":"M0.042969 0.441895 L0.559083 0.66939 L0.559083 0.66939 L0.042969 0.896902",A:"M0.018067 0.94897 L0.290179 0.270996 L0.583986 0.94897 M0.155303 0.684521 L0.433548 0.684521",B:"M0.063965 0.94897 L0.063965 0.278953 L0.209356 0.270996 L0.342486 0.294394 L0.432179 0.37292 L0.418224 0.48773 L0.312686 0.549166 L0.084728 0.575531 L0.306377 0.589434 L0.468877 0.647456 L0.538087 0.736658 L0.5324 0.85202 L0.501247 0.902983 L0.42355 0.944398 L0.063965 0.94897",C:"M0.529054 0.419847 L0.498425 0.345196 L0.442238 0.292341 L0.33583 0.257813 L0.257199 0.268357 L0.187906 0.303748 L0.120243 0.385432 L0.072998 0.599844 L0.110073 0.815385 L0.165381 0.902183 L0.222883 0.942801 L0.334904 0.961214 L0.43253 0.937679 L0.504816 0.868999 L0.529054 0.772065",D:"M0.064454 0.94897 L0.071838 0.285078 L0.171217 0.270996 L0.247348 0.272633 L0.37101 0.306078 L0.462461 0.378304 L0.514748 0.475555 L0.535591 0.576392 L0.537599 0.652313 L0.528065 0.717381 L0.508562 0.772419 L0.445948 0.855695 L0.362356 0.90871 L0.225203 0.945862 L0.064454 0.94897",E:"M0.080078 0.270996 L0.080078 0.94897 M0.080078 0.270996 L0.521974 0.270996 M0.080078 0.609981 L0.389405 0.609981 M0.080078 0.94897 L0.521974 0.94897",F:"M0.086426 0.270996 L0.086426 0.94897 M0.091304 0.275607 L0.515626 0.275607 M0.091304 0.607677 L0.447344 0.607677",G:"M0.498034 0.284943 L0.374621 0.257813 L0.244219 0.268648 L0.160577 0.311997 L0.094556 0.398116 L0.056397 0.58404 L0.076752 0.785532 L0.120865 0.858197 L0.188947 0.916734 L0.271008 0.953591 L0.357069 0.961214 L0.43715 0.932047 L0.501262 0.858539 L0.545656 0.648611 L0.329595 0.648131",H:"M0.066895 0.270996 L0.066895 0.94897 M0.066895 0.595658 L0.530009 0.595658 M0.535157 0.270996 L0.535157 0.94897",I:"M0.301026 0.270996 L0.301026 0.94897",J:"M0.506839 0.270996 L0.507814 0.782193 L0.498468 0.846168 L0.480733 0.880789 L0.455864 0.90832 L0.426095 0.929408 L0.360746 0.954812 L0.302508 0.962139 L0.223573 0.953638 L0.16538 0.930312 L0.137072 0.907715 L0.116428 0.880312 L0.102822 0.848819 L0.095633 0.813947 L0.094239 0.776413",K:"M0.035401 0.270996 L0.035401 0.94897 M0.502258 0.316194 L0.035401 0.687823 M0.212484 0.582361 L0.566652 0.933903",L:"M0.07544 0.270996 L0.07544 0.94897 L0.526613 0.94897",M:"M0.042481 0.94897 L0.042481 0.270996 L0.301027 0.712492 L0.559571 0.270996 L0.559571 0.94897",N:"M0.067871 0.94897 L0.067871 0.270996 L0.534181 0.94897 L0.525031 0.270996",O:"M0.287293 0.961214 L0.19843 0.933567 L0.1172 0.849451 L0.057129 0.563945 L0.114348 0.350255 L0.18455 0.289392 L0.306101 0.257813 L0.42054 0.29572 L0.487543 0.365003 L0.544923 0.625294 L0.516366 0.789624 L0.465476 0.884596 L0.375084 0.949287 L0.287293 0.961214",P:"M0.070557 0.94897 L0.070557 0.28379 L0.20704 0.270996 L0.329134 0.278993 L0.408525 0.300514 L0.444022 0.317908 L0.500637 0.368929 L0.525796 0.423728 L0.531496 0.50384 L0.508934 0.554205 L0.473724 0.582043 L0.417577 0.604365 L0.336375 0.620372 L0.226014 0.629268 L0.082368 0.630258",Q:"M0.282435 1.050813 L0.195447 1.019646 L0.115933 0.924817 L0.057129 0.602943 L0.113139 0.362034 L0.18186 0.293418 L0.300844 0.257813 L0.412868 0.300553 L0.478457 0.37866 L0.534625 0.672103 L0.506671 0.857367 L0.456855 0.964437 L0.368371 1.037368 L0.282435 1.050813 M0.341225 0.815559 L0.544923 1.070653",R:"M0.034912 0.944112 L0.034912 0.288556 L0.227127 0.270996 L0.362038 0.276867 L0.443423 0.294907 L0.477644 0.309614 L0.505809 0.328757 L0.526616 0.352817 L0.544963 0.418061 L0.543241 0.475921 L0.524463 0.517817 L0.49076 0.546518 L0.444265 0.564799 L0.355195 0.578739 L0.047653 0.589627 M0.303054 0.617306 L0.56714 0.94897",S:"M0.483037 0.364333 L0.407613 0.267477 L0.22883 0.257813 L0.128623 0.327565 L0.087712 0.455539 L0.104656 0.518727 L0.168054 0.573307 L0.41928 0.617318 L0.503796 0.669342 L0.535157 0.759324 L0.493846 0.900055 L0.367668 0.961214 L0.205436 0.956661 L0.116711 0.907038 L0.066895 0.790334",T:"M0.022949 0.270996 L0.579103 0.270996 M0.309284 0.270996 L0.309284 0.94897",U:"M0.072022 0.270996 L0.07308 0.648875 L0.080372 0.75167 L0.099024 0.827813 L0.134786 0.885729 L0.181571 0.924023 L0.251464 0.95168 L0.339655 0.962139 L0.401553 0.951668 L0.45232 0.924086 L0.482701 0.891771 L0.495745 0.870529 L0.515699 0.81637 L0.525014 0.744626 L0.530031 0.272017",V:"M0.027832 0.270996 L0.320083 0.94897 L0.57422 0.270996",W:"M0 0.270996 L0.079799 0.940377 L0.285198 0.472884 L0.505255 0.94897 L0.602052 0.270996",X:"M0.009034 0.270996 L0.586805 0.94897 M0.593019 0.270996 L0.015246 0.94897",Y:"M0.018067 0.270996 L0.293132 0.574135 M0.583986 0.271959 L0.294954 0.57606 L0.305277 0.94897",Z:"M0.053711 0.270996 L0.548341 0.270996 L0.053711 0.94897 L0.548341 0.94897","[":"M0.404542 0.240234 L0.197511 0.240234 L0.197511 1.069424 L0.404542 1.069424","\\":"M0.062501 0.270996 L0.539551 1.035249","]":"M0.19751 0.240234 L0.404542 0.240234 L0.404542 1.069424 L0.19751 1.069424","^":"M0.035156 0.523931 L0.301024 0.270996 L0.566896 0.523931",_:"M0 1.160601 L0.602052 1.160601",a:"M0.527101 0.439941 L0.527101 0.973965 M0.527101 0.553824 L0.451366 0.477535 L0.376759 0.439941 L0.263722 0.439941 L0.187989 0.477535 L0.112255 0.553824 L0.074951 0.66881 L0.074951 0.745099 L0.112255 0.85898 L0.187989 0.93527 L0.263722 0.973965 L0.376759 0.973965 L0.451366 0.93527 L0.527101 0.85898",b:"M0.07666 0.240234 L0.07666 0.959985 M0.07666 0.582737 L0.151822 0.514237 L0.225865 0.480483 L0.338045 0.480483 L0.413211 0.514237 L0.488374 0.582737 L0.525392 0.685983 L0.525392 0.754485 L0.488374 0.856739 L0.413211 0.92524 L0.338045 0.959985 L0.225865 0.959985 L0.151822 0.92524 L0.07666 0.856739",c:"M0.512452 0.553823 L0.441624 0.477535 L0.371854 0.439941 L0.26614 0.439941 L0.195312 0.477535 L0.124486 0.553823 L0.0896 0.668808 L0.0896 0.745099 L0.124486 0.858979 L0.195312 0.93527 L0.26614 0.973965 L0.371854 0.973965 L0.441624 0.93527 L0.512452 0.858979",d:"M0.525392 0.240234 L0.525392 0.959985 M0.525392 0.582737 L0.450232 0.514237 L0.376189 0.480483 L0.264006 0.480483 L0.188844 0.514237 L0.11368 0.582737 L0.076661 0.685983 L0.076661 0.754485 L0.11368 0.856739 L0.188844 0.92524 L0.264006 0.959985 L0.376189 0.959985 L0.450232 0.92524 L0.525392 0.856739",e:"M0.059571 0.668808 L0.542482 0.668808 M0.542482 0.592521 L0.502641 0.516231 L0.461594 0.477535 L0.381914 0.439941 L0.261186 0.439941 L0.180299 0.477535 L0.099412 0.553823 L0.059571 0.668808 L0.059571 0.745099 L0.099412 0.858979 L0.180299 0.93527 L0.261186 0.973965 L0.381914 0.973965 L0.461594 0.93527 L0.542482 0.858979",f:"M0.512941 0.240234 L0.406984 0.240234 L0.301026 0.274346 L0.248047 0.374731 L0.248047 0.946817 M0.089112 0.476088 L0.459965 0.476088",g:"M0.525392 0.439941 L0.525392 0.989395 L0.488373 1.091918 L0.45023 1.126757 L0.376189 1.160601 L0.264004 1.160601 L0.188844 1.126757 L0.113681 1.058075 L0.076661 0.954555 M0.525392 0.542467 L0.45023 0.473786 L0.376189 0.439941 L0.264004 0.439941 L0.188844 0.473786 L0.113681 0.542467 L0.076661 0.645988 L0.076661 0.714669 L0.113681 0.817193 L0.188844 0.885875 L0.264004 0.920713 L0.376189 0.920713 L0.45023 0.885875 L0.525392 0.817193",h:"M0.092041 0.240234 L0.092041 0.946817 M0.092041 0.61058 L0.205937 0.509225 L0.282214 0.476086 L0.396109 0.476086 L0.47187 0.509225 L0.510011 0.61058 L0.510011 0.946817",i:"M0.261026 0.240234 L0.341026 0.240234 M0.300978 0.476089 L0.300978 0.946817",j:"M0.3853 0.240234 L0.447023 0.240234 M0.416159 0.465708 L0.416159 1.011689 L0.383887 1.108586 L0.252832 1.140264 L0.15503 1.108586",k:"M0.065186 0.240234 L0.065186 0.946817 M0.493824 0.476086 L0.065186 0.812323 M0.236758 0.677829 L0.536867 0.946817",l:"M0.301026 0.234863 L0.301026 0.946441",m:"M0.050538 0.439941 L0.050538 0.960796 M0.050538 0.588758 L0.114405 0.476607 L0.157178 0.439941 L0.236864 0.439941 L0.279637 0.476607 L0.32241 0.588758 L0.32241 0.960796 M0.32241 0.588758 L0.386281 0.476607 L0.428467 0.439941 L0.50874 0.439941 L0.551515 0.476607 L0.551515 0.960796",n:"M0.092041 0.439941 L0.092041 0.960796 M0.092041 0.588758 L0.205936 0.476607 L0.282216 0.439941 L0.396113 0.439941 L0.471871 0.476607 L0.510011 0.588758 L0.510011 0.960796",o:"M0.247175 0.439941 L0.175178 0.477535 L0.103186 0.553823 L0.066895 0.668808 L0.066895 0.745099 L0.103186 0.858979 L0.175178 0.93527 L0.247175 0.973965 L0.354874 0.973965 L0.426872 0.93527 L0.498866 0.858979 L0.535157 0.745099 L0.535157 0.668808 L0.498866 0.553823 L0.426872 0.477535 L0.354874 0.439941 L0.247175 0.439941",p:"M0.076904 0.439941 L0.076904 1.154244 M0.076904 0.541563 L0.151986 0.473487 L0.225944 0.439941 L0.338005 0.439941 L0.413087 0.473487 L0.488166 0.541563 L0.525148 0.644169 L0.525148 0.712246 L0.488166 0.813866 L0.413087 0.881942 L0.338005 0.916471 L0.225944 0.916471 L0.151986 0.881942 L0.076904 0.813866",q:"M0.525148 0.441895 L0.525148 1.156195 M0.525148 0.5435 L0.450067 0.47544 L0.376106 0.441895 L0.264042 0.441895 L0.188966 0.47544 L0.113885 0.5435 L0.076905 0.646108 L0.076905 0.714187 L0.113885 0.815809 L0.188966 0.883886 L0.264042 0.918418 L0.376106 0.918418 L0.450067 0.883886 L0.525148 0.815809",r:"M0.107422 0.439941 L0.107422 0.960796 M0.107422 0.663164 L0.155824 0.551014 L0.252626 0.476607 L0.349428 0.439941 L0.49463 0.439941",s:"M0.475556 0.477535 L0.400757 0.439941 L0.276092 0.439941 L0.176361 0.477535 L0.101563 0.553823 L0.101563 0.630112 L0.176361 0.668808 L0.301024 0.668808 L0.425688 0.745099 L0.50049 0.821387 L0.50049 0.897677 L0.425688 0.93527 L0.325956 0.973965 L0.201295 0.973965 L0.126496 0.93527 L0.101563 0.858979",t:"M0.246032 0.297852 L0.246032 0.826549 L0.301023 0.919323 L0.411011 0.950848 L0.520997 0.950848 M0.081055 0.515799 L0.466004 0.515799",u:"M0.092041 0.454102 L0.092041 0.826134 L0.13018 0.937211 L0.205936 0.974954 L0.319832 0.974954 L0.396113 0.937211 L0.510011 0.826134 M0.510011 0.454102 L0.510011 0.974954",v:"M0.048828 0.453125 L0.301026 0.961719 M0.553224 0.453125 L0.301026 0.961719",w:"M0 0.453125 L0.150512 0.961719 M0.301024 0.453125 L0.150512 0.961719 M0.301024 0.453125 L0.451539 0.961719 M0.602052 0.453125 L0.451539 0.961719",x:"M0.03711 0.453125 L0.564943 0.961719 M0.564943 0.453125 L0.03711 0.961719",y:"M0.084618 0.453125 L0.320232 0.921476 M0.55713 0.453125 L0.320232 0.921476 L0.242119 1.055289 L0.163369 1.122196 L0.084618 1.155166 L0.044922 1.155166",z:"M0.505373 0.452148 L0.09668 0.961651 M0.09668 0.452148 L0.505373 0.452148 M0.09668 0.961651 L0.505373 0.961651"},_Ot={};for(let e in mOt){_Ot[e]=[];let t=mOt[e].split("M").slice(1).map((n)=>n.split("L").map((o)=>o.trim().split(" ").map(parseFloat)));for(let n of t)for(let o=0;o<n.length-1;o++)_Ot[e].push({x1:n[o][0],y1:1-n[o][1],x2:n[o+1][0],y2:1-n[o+1][1]})}(()=>{let e=new Uint8Array(4);new Uint32Array(e.buffer)[0]=1,e[0]})(),globalThis.Int8Array,globalThis.Uint8Array,globalThis.Int16Array,globalThis.Uint16Array,globalThis.Int32Array,globalThis.Uint32Array,globalThis.BigUint64Array,globalThis.BigInt64Array,globalThis.Float32Array,globalThis.Float64Array;var z2r=[];for(let e=0;e<256;e++){let t=e;for(let n=0;n<8;n++)1&t?t=3988292384^t>>>1:t>>>=1;z2r[e]=t}var O2r=new Uint16Array([255]),V2r=(new Uint8Array(O2r.buffer)[0],new Uint16Array([255])),{cos:wNs,sin:BNs,PI:TNs}=(new Uint8Array(V2r.buffer)[0],new Uint8Array(0),Uint8Array.of(137,80,78,71,13,10,26,10),new TextDecoder("latin1"),Math),{tan:DNs}=Math;((e,t,n)=>{var o=e!=null&&typeof e=="object";if(o){var r=t?N2r??=new WeakMap:R2r??=new WeakMap,i=r.get(e);if(i)return i}n=e!=null?Q2r(k2r(e)):{};let s=!t&&e&&e.__esModule&&uOt.call(e,"default")?n:dOt(n,"default",{value:e,enumerable:!0});if(e&&typeof e=="object"||typeof e=="function")for(let a of L2r(e))uOt.call(s,a)||dOt(s,a,{get:H2r.bind(e,a),enumerable:!0});o&&r.set(e,s)})(F2r(),1);var Ann=(e,t={})=>{let n=((m)=>{let A=fV(m),g=m.filter((f)=>f.type==="pcb_via"&&typeof f.pcb_trace_id=="string").map((f)=>[f.pcb_via_id,f.pcb_trace_id]);return A.addConnections(g),A})(e),o=Math.max(t.viaClearance??0.1,0.1),r=S2r(e,{connMap:n,minClearance:t.traceClearance}).filter((m)=>m.type!=="pcb_keepout_overlap_warning"),i=t.includeTypedTraceClearance!==!1,s=i?gnn(e,{connMap:n,minClearance:t.traceClearance}):[],a=i?_nn(e,{connMap:n,minClearance:t.traceClearance}):[],c=function(m,{minClearance:A}={}){let g=A??xQ(vV(m),"min_trace_to_hole_edge_clearance")??l2r;if(!Number.isFinite(g)||g<0)throw Error("Trace-to-hole clearance must be finite and non-negative");let f=pnn(m);if(f.length===0)return[];let y=new qqe({objects:f,getId:(b)=>b.elementId,getBounds:(b)=>({minX:b.bounds.xmin,minY:b.bounds.ymin,maxX:b.bounds.xmax,maxY:b.bounds.ymax})}),x=new Map,C=new Set;for(let b of m)if(b.type==="pcb_trace")for(let I=1;I<b.route.length;I++){let v=b.route[I-1],P=b.route[I];if(v.route_type!=="wire"&&v.route_type!=="via"||P.route_type!=="wire"&&P.route_type!=="via")continue;if(v.route_type!=="wire"&&P.route_type!=="wire")continue;if(v.route_type==="wire"&&P.route_type==="wire"&&v.layer!==P.layer)continue;let M=Math.max(v.route_type==="wire"?v.width:0,P.route_type==="wire"?P.width:0)/2,B=y.getObjectsInBounds({minX:Math.min(v.x,P.x),minY:Math.min(v.y,P.y),maxX:Math.max(v.x,P.x),maxY:Math.max(v.y,P.y)},g+M);for(let T of B){let N=T.sourceElement;if(N.type!=="pcb_hole")continue;let{gap:D,center:L}=mnn({x1:v.x,y1:v.y,x2:P.x,y2:P.y,thickness:2*M},T),H=`${b.pcb_trace_id}_${N.pcb_hole_id}`;Q$(D)?(x.delete(H),C.add(H)):C.has(H)||D+0.000001>=g||(x.get(H)?.gap??1/0)<=D||x.set(H,{gap:D,error:{type:"pcb_trace_error",error_type:"pcb_trace_error",pcb_trace_error_id:`overlap_${H}`,pcb_trace_id:b.pcb_trace_id,source_trace_id:b.source_trace_id??"",pcb_component_ids:N.pcb_component_id?[N.pcb_component_id]:[],pcb_port_ids:[],center:L,message:`Trace ${PO(m,b.pcb_trace_id)} is too close to non-plated hole ${u9(m,N.pcb_hole_id)} (gap: ${D.toFixed(6)}mm, required: ${g}mm)`}})}}return Array.from(x.values(),({error:b})=>b)}(e,{minClearance:t.holeClearance}),l=[...E2r(e,{connMap:n,minClearance:o}),...M2r(e,{connMap:n,minClearance:o})],h=[...r,...D2r(e),...t.includeTraceContinuity===!1?[]:T2r(e),...s,...a,...c,...l],d=e.filter((m)=>m.type==="pcb_via"),u=new Map(d.map((m)=>[m.pcb_via_id,m])),_=h.map((m)=>{if(m.type==="pcb_via_trace_clearance_error"&&typeof m.pcb_via_id=="string"){let A=u.get(m.pcb_via_id);if(A)return{...m,center:{x:A.x,y:A.y}}}if("center"in m&&m.center)return m;if("pcb_center"in m&&m.pcb_center)return{...m,center:m.pcb_center};if("pcb_via_ids"in m&&Array.isArray(m.pcb_via_ids)){let[A,g]=m.pcb_via_ids,f=u.get(A),y=u.get(g);if(f&&y)return{...m,center:{x:(f.x+y.x)/2,y:(f.y+y.y)/2}}}if("pcb_error_id"in m&&typeof m.pcb_error_id=="string"&&(m.pcb_error_id.startsWith("same_net_vias_close_")||m.pcb_error_id.startsWith("different_net_vias_close_"))){let A=m.pcb_error_id.replace("same_net_vias_close_","").replace("different_net_vias_close_","").split("_").filter(Boolean);if(A.length===2){let g=u.get(A[0]),f=u.get(A[1]);if(g&&f)return{...m,center:{x:(g.x+f.x)/2,y:(g.y+f.y)/2}}}}return m}),p=_.filter((m)=>Boolean(m.center));return{errors:h,errorsWithCenters:_,locationAwareErrors:p}},iy=(e,t)=>e===0?"top":e===t-1?"bottom":`inner${e}`,fnn=(e,t)=>{if(e.layers!==void 0)return e.layers;if(!Number.isInteger(t)||t<1)throw Error(`Invalid board layer count: ${t}`);let n=Array.from({length:t},(i,s)=>iy(s,t)),o=n.findIndex((i)=>i===e.from_layer),r=n.findIndex((i)=>i===e.to_layer);if(o<0||r<0)throw Error(`Via span ${e.from_layer} -> ${e.to_layer} is outside the board`);return n.slice(Math.min(o,r),Math.max(o,r)+1)},jje=(e,t,n=!1)=>{let o=n?e:{from_layer:"top",to_layer:iy(t-1,t)};return fnn(o,t)},vae=0.005,PWe=0.000001,iCe=(e,t)=>({minX:e.minX-t,minY:e.minY-t,maxX:e.maxX+t,maxY:e.maxY+t}),gOt=(e)=>iCe({minX:Math.min(e.start.x,e.end.x),minY:Math.min(e.start.y,e.end.y),maxX:Math.max(e.start.x,e.end.x),maxY:Math.max(e.start.y,e.end.y)},e.width/2),q4e=(e)=>{let t=e.diameter/2;return{minX:e.x-t,minY:e.y-t,maxX:e.x+t,maxY:e.y+t}},Y2r=(e)=>p$e(KWt(e.localToWorld,[{x:-e.width/2,y:-e.height/2},{x:e.width/2,y:-e.height/2},{x:e.width/2,y:e.height/2},{x:-e.width/2,y:e.height/2}])),AOt=(e)=>({minX:-e.width/2,minY:-e.height/2,maxX:e.width/2,maxY:e.height/2}),EWe=class{constructor(e){this.cellSize=e}cellSize;cells=new Map;itemIds=new Map;rowItems=[];visitedGenerations=new Uint32Array(0);queryGeneration=0;registerItem(e){let t=this.itemIds.get(e);if(t!==void 0)return t;let n=this.rowItems.length;if(n>=this.visitedGenerations.length){let o=new Uint32Array(this.visitedGenerations.length===0?16:2*this.visitedGenerations.length);o.set(this.visitedGenerations),this.visitedGenerations=o}return this.itemIds.set(e,n),this.rowItems.push(e===0?0:e),n}insert(e,t){let n=Math.floor(t.minX/this.cellSize),o=Math.floor(t.maxX/this.cellSize),r=Math.floor(t.minY/this.cellSize),i=Math.floor(t.maxY/this.cellSize),s;for(let a=n;a<=o;a+=1){let c=this.cells.get(a);!c&&r<=i&&(c=new Map,this.cells.set(a,c));for(let l=r;l<=i;l+=1){let h=c.get(l);s===void 0&&(s=this.registerItem(e)),h?h.push(s):c.set(l,[s])}}}query(e){let t=Math.floor(e.minX/this.cellSize),n=Math.floor(e.maxX/this.cellSize),o=Math.floor(e.minY/this.cellSize),r=Math.floor(e.maxY/this.cellSize),i=this.queryGeneration+1;i>4294967295&&(this.visitedGenerations.fill(0),i=1),this.queryGeneration=i;let s=[];for(let a=t;a<=n;a+=1){let c=this.cells.get(a);if(!(!c&&o>=-9007199254740991&&r<=9007199254740991))for(let l=o;l<=r;l+=1){let h=c?.get(l);if(h)for(let d of h)this.visitedGenerations[d]!==i&&(this.visitedGenerations[d]=i,s.push(this.rowItems[d]))}}return s}},G2r=(e,t)=>{let n=vw(e.start,e.end,t.start,t.end);if(n)return n;let o=[{left:e.start,right:mm(e.start,t.start,t.end)},{left:e.end,right:mm(e.end,t.start,t.end)},{left:mm(t.start,e.start,e.end),right:t.start},{left:mm(t.end,e.start,e.end),right:t.end}],r={left:e.start,right:t.start},i=Number.POSITIVE_INFINITY;for(let s of o){let a=Math.hypot(s.left.x-s.right.x,s.left.y-s.right.y);a<i&&(r=s,i=a)}return{x:(r.left.x+r.right.x)/2,y:(r.left.y+r.right.y)/2}},fOt=(e,t)=>{let n=mm(t,e.start,e.end);return{x:(n.x+t.x)/2,y:(n.y+t.y)/2}},U2r=(e,t)=>{let n=mm({x:(t.minX+t.maxX)/2,y:(t.minY+t.maxY)/2},e.start,e.end),o=Math.max(t.minX,Math.min(t.maxX,n.x)),r=Math.max(t.minY,Math.min(t.maxY,n.y));return{x:(n.x+o)/2,y:(n.y+r)/2}},W2r=(e)=>{let t=new Set;for(let n of e.route)n.route_type==="wire"&&(n.start_pcb_port_id&&t.add(n.start_pcb_port_id),n.end_pcb_port_id&&t.add(n.end_pcb_port_id));return[...t]},MWe=(e,t,n)=>n<0?`PCB trace ${e} overlaps with ${t} (accidental contact)`:`PCB trace ${e} is too close to ${t} (gap: ${n.toFixed(3)}mm)`,Dle=class{constructor(e,t={}){this.srj=e;let n=t.queryResultCacheBudget??8000000;if(!Number.isSafeInteger(n)||n<0)throw Error("queryResultCacheBudget must be a nonnegative safe integer");if(this.primitiveKeyBudget=Math.floor(n/4),this.queryResultBudget=n-this.primitiveKeyBudget,this.traceClearance=t.traceClearance??0.1,this.viaClearance=Math.max(t.viaClearance??0.1,0.1),this.viaToPadClearance=t.viaToPadClearance??this.srj.minViaEdgeToPadEdgeClearance??0.1,this.connMap=t.connMap,this.includeTraceViaOwnerMetadata=t.includeTraceViaOwnerMetadata??!1,this.cellSize=t.spatialCellSize??this.getDefaultSpatialCellSize(),!Number.isFinite(this.traceClearance)||this.traceClearance<0)throw Error("traceClearance must be a non-negative finite number");if(!Number.isFinite(this.viaClearance))throw Error("viaClearance must be a finite number");if(!Number.isFinite(this.viaToPadClearance)||this.viaToPadClearance<0)throw Error("viaToPadClearance must be a non-negative finite number");if(!Number.isFinite(this.cellSize)||this.cellSize<=0)throw Error("spatialCellSize must be a positive finite number");this.compileConnectionAliases(),this.obstacles=this.compileStaticObstacles(),this.obstacles.forEach((o,r)=>this.staticObstacleIds.set(o,r)),this.indexStaticObstacles()}srj;traceClearance;viaClearance;viaToPadClearance;cellSize;connMap;includeTraceViaOwnerMetadata;canonicalNetByAlias=new Map;connMapNetByCanonicalNet=new Map;obstacles;queryResultBudget;primitiveKeyBudget;primitiveIdsByKey=new Map;primitiveKeyUnits=0;nextPrimitiveId=0;staticObstacleIds=new WeakMap;queryResultCache=new Map;queryResultUnits=0;cachedConnectivityKey;obstacleIndexesByLayer=new Map;lastRunStats={traceCount:0,segmentCount:0,viaCount:0,obstacleCount:0,broadPhaseCandidateCount:0,exactCheckCount:0};getDefaultSpatialCellSize(){let e=Math.max(0,this.srj.bounds.maxX-this.srj.bounds.minX),t=Math.max(0,this.srj.bounds.maxY-this.srj.bounds.minY);return Math.max(0.25,Math.max(e,t)/64,(this.srj.minViaDiameter??0.3)+Math.max(this.traceClearance,this.viaToPadClearance))}compileConnectionAliases(){let e=new Map;for(let t of this.srj.connections){let n=t.netConnectionName??t.rootConnectionName??t.name,o=[t.name,t.rootConnectionName,t.netConnectionName,...t.mergedConnectionNames??[],...t.pointsToConnect.flatMap((r)=>[r.pointId,r.pcb_port_id])];for(let r of o){if(!r)continue;this.canonicalNetByAlias.set(r,n);let i=this.connMap?.getNetConnectedToId(r);if(!i)continue;let s=e.get(n);s||(s=new Set,e.set(n,s)),s.add(i)}this.canonicalNetByAlias.set(n,n)}for(let[t,n]of e)n.size===1&&this.connMapNetByCanonicalNet.set(t,n.values().next().value)}resolveNetId(e){let t=this.connMap?.getNetConnectedToId(e);if(t)return t;let n=this.canonicalNetByAlias.get(e);return n?this.connMapNetByCanonicalNet.get(n)??n:e}areConnected(e,t){return e===t||(!!this.connMap?.areIdsConnected(e,t)||this.resolveNetId(e)===this.resolveNetId(t))}compileStaticObstacles(){let e=[],t=new Set,n=new Set;for(let o of this.srj.obstacles){if(o.layers.length===0)continue;let r=o.connectedTo.find((p)=>p.startsWith("pcb_smtpad_")),i=o.connectedTo.find((p)=>p.startsWith("pcb_plated_hole_")),s=o.connectedTo.find((p)=>p.startsWith("pcb_port_"));if(!r&&!i&&!s)continue;let a=o.layers.length>1,c=a?"pcb_plated_hole":"pcb_smtpad",l=a?i??`pcb_plated_hole_${o.center.x.toFixed(3)}_${o.center.y.toFixed(3)}`:r??`pcb_smtpad_${o.center.x.toFixed(3)}_${o.center.y.toFixed(3)}`,h=a?n:t;if(h.has(l))continue;h.add(l);let d=typeof o.ccwRotationDegrees=="number"&&Number.isFinite(o.ccwRotationDegrees),u=d$e($O(o.center.x,o.center.y),JWt(d?o.ccwRotationDegrees:0)),_=!d&&a&&Math.abs(o.width-o.height)<0.001;e.push({kind:"obstacle",obstacleType:c,obstacleId:l,connectedTo:o.connectedTo,x:o.center.x,y:o.center.y,width:o.width,height:o.height,localToWorld:u,worldToLocal:$Wt(u),..._?{radius:Math.max(o.width,o.height)/2}:{},layers:o.layers,...s?{pcbPortId:s}:{}})}return e}indexStaticObstacles(){for(let e of this.obstacles){let t=iCe(Y2r(e),Math.max(this.traceClearance,this.viaToPadClearance));for(let n of e.layers){let o=this.obstacleIndexesByLayer.get(n);o||(o=new EWe(this.cellSize),this.obstacleIndexesByLayer.set(n,o)),o.insert(e,t)}}}collectDynamicGeometry(e){let t=[],n=[],o=new Set;for(let r of e){let i=this.resolveNetId(r.connection_name),s=W2r(r),a=this.queryResultBudget?JSON.stringify([r.pcb_trace_id,i,s]):void 0;for(let c=0;c<r.route.length-1;c+=1){let l=r.route[c],h=r.route[c+1];l?.route_type==="wire"&&h?.route_type==="wire"&&l.layer===h.layer&&(Math.abs(l.x-h.x)<=PWe&&Math.abs(l.y-h.y)<=PWe||t.push({kind:"trace_segment",order:t.length,traceId:r.pcb_trace_id,netId:i,start:{x:l.x,y:l.y},end:{x:h.x,y:h.y},width:yOt(l,h),layer:l.layer,pcbPortIds:s,primitiveId:a===void 0?void 0:this.getPrimitiveId(["trace",a,l.x,l.y,h.x,h.y,yOt(l,h),l.layer])}))}for(let c of r.route){if(c.route_type!=="via")continue;let l=`${c.x},${c.y},${c.from_layer},${c.to_layer}`;if(o.has(l))continue;o.add(l);let h=`via_${n.length}`,d=c.via_diameter??this.srj.minViaDiameter??0.3,u=jje(c,this.srj.layerCount,this.srj.allowBlindAndBuriedVias);n.push({kind:"via",order:n.length,viaId:h,traceId:r.pcb_trace_id,netId:i,x:c.x,y:c.y,diameter:d,layers:u,primitiveId:this.queryResultBudget?this.getPrimitiveId(["via",h,r.pcb_trace_id,i,c.x,c.y,d,u]):void 0})}}return{segments:t,vias:n}}buildDynamicIndexes(e,t){let n=new Map,o=(r,i,s)=>{let a=n.get(r);a||(a=new EWe(this.cellSize),n.set(r,a)),a.insert(i,iCe(s,this.traceClearance))};for(let r of e)o(r.layer,r,gOt(r));for(let r of t)for(let i of r.layers)o(i,r,q4e(r));return n}obstacleSharesNet(e,t){return t.connectedTo.some((n)=>this.areConnected(e,n))}getPrimitiveId(e){if(!this.primitiveKeyBudget)return;let t=JSON.stringify(e.map((i)=>typeof i!="number"?i:Object.is(i,-0)?"-0":Number.isNaN(i)?"NaN":i===1/0?"+Infinity":i===-1/0?"-Infinity":i)),n=this.primitiveIdsByKey.get(t);if(n)return n.id;let o=t.length+64;if(o>this.primitiveKeyBudget||this.nextPrimitiveId>=Number.MAX_SAFE_INTEGER)return;for(;this.primitiveKeyUnits+o>this.primitiveKeyBudget;){let i=this.primitiveIdsByKey.keys().next().value;this.primitiveKeyUnits-=this.primitiveIdsByKey.get(i).units,this.primitiveIdsByKey.delete(i)}let r=this.nextPrimitiveId++;return this.primitiveIdsByKey.set(t,{id:r,units:o}),this.primitiveKeyUnits+=o,r}getQueryCacheKey(e,t){if(this.queryResultBudget&&!t.some((n)=>n===void 0))return`${e}:${t.join(",")}`}runCachedQuery(e,t){let n=e===void 0?void 0:this.queryResultCache.get(e);if(n)return this.lastRunStats.exactCheckCount+=n.exactCheckCount,this.lastRunStats.broadPhaseCandidateCount+=n.broadPhaseCandidateCount,n.errors.length?structuredClone(n.errors):[];let o=this.lastRunStats.exactCheckCount,r=this.lastRunStats.broadPhaseCandidateCount,i=t();if(e===void 0)return i;let s=e.length+(i.length?JSON.stringify(i).length:0)+64*i.length+64;if(s>this.queryResultBudget)return i;for(;this.queryResultUnits+s>this.queryResultBudget;){let a=this.queryResultCache.keys().next().value;this.queryResultUnits-=this.queryResultCache.get(a).units,this.queryResultCache.delete(a)}return this.queryResultCache.set(e,{errors:i.length?structuredClone(i):[],exactCheckCount:this.lastRunStats.exactCheckCount-o,broadPhaseCandidateCount:this.lastRunStats.broadPhaseCandidateCount-r,units:s}),this.queryResultUnits+=s,i}checkTraceQuery(e,t,n){let o;if(this.lastRunStats.broadPhaseCandidateCount+=t.length+n.length,this.queryResultBudget){let r=[e.primitiveId];for(let i of t)i.kind==="trace_segment"&&i.order<=e.order||r.push(i.primitiveId);r.push(-1);for(let i of n)r.push(this.staticObstacleIds.get(i));o=this.getQueryCacheKey("trace",r)}return this.runCachedQuery(o,()=>{let r=[];for(let i of t){if(i.kind==="trace_segment"&&i.order<=e.order)continue;let s=i.kind==="trace_segment"?this.checkTracePair(e,i):this.checkTraceVia(e,i);s&&r.push(s)}for(let i of n){let s=this.checkTraceObstacle(e,i);s&&r.push(s)}return r})}checkTracePair(e,t){if(this.areConnected(e.netId,t.netId))return;this.lastRunStats.exactCheckCount+=1;let n=s_(e.start,e.end,t.start,t.end)-e.width/2-t.width/2;if(n>this.traceClearance-vae)return;let o=`overlap_${e.traceId}_${t.traceId}`;return{type:"pcb_trace_error",error_type:"pcb_trace_error",message:MWe(e.traceId,`PCB trace ${t.traceId}`,n),pcb_trace_id:e.traceId,source_trace_id:"",pcb_trace_error_id:o,minimum_clearance:this.traceClearance,actual_clearance:n,pcb_component_ids:[],pcb_port_ids:[...new Set([...e.pcbPortIds,...t.pcbPortIds])],center:G2r(e,t)}}checkTraceVia(e,t){if(this.areConnected(e.netId,t.netId))return;this.lastRunStats.exactCheckCount+=1;let n=gQ(e.start,e.end,{x:t.x,y:t.y,radius:t.diameter/2})-e.width/2;if(n>this.traceClearance-vae)return;let o=`overlap_${e.traceId}_${t.viaId}`;return{type:"pcb_trace_error",error_type:"pcb_trace_error",message:MWe(e.traceId,`pcb_via "${t.viaId}"`,n),pcb_trace_id:e.traceId,...this.includeTraceViaOwnerMetadata?{pcb_trace_ids:[e.traceId,t.traceId],pcb_via_id:t.viaId,pcb_via_ids:[t.viaId]}:{},source_trace_id:"",pcb_trace_error_id:o,minimum_clearance:this.traceClearance,actual_clearance:n,pcb_component_ids:[],pcb_port_ids:e.pcbPortIds,center:fOt(e,t)}}checkTraceObstacle(e,t){if(this.obstacleSharesNet(e.netId,t))return;this.lastRunStats.exactCheckCount+=1;let n=AOt(t),o={...e,start:mw(t.worldToLocal,e.start),end:mw(t.worldToLocal,e.end)},r=(t.radius===void 0?AV(o.start,o.end,n):gQ(e.start,e.end,{x:t.x,y:t.y,radius:t.radius}))-e.width/2;if(r+vae>=this.traceClearance)return;let i=`overlap_${e.traceId}_${t.obstacleId}`;return{type:"pcb_trace_error",error_type:"pcb_trace_error",message:MWe(e.traceId,`${t.obstacleType} "${t.obstacleId}"`,r),pcb_trace_id:e.traceId,source_trace_id:"",pcb_trace_error_id:i,minimum_clearance:this.traceClearance,actual_clearance:r,pcb_component_ids:[],pcb_port_ids:[...new Set([...e.pcbPortIds,...t.pcbPortId?[t.pcbPortId]:[]])],center:t.radius===void 0?mw(t.localToWorld,U2r(o,n)):fOt(e,t)}}checkViaObstacle(e,t){if(this.obstacleSharesNet(e.netId,t))return;this.lastRunStats.exactCheckCount+=1;let n=AOt(t),o=mw(t.worldToLocal,e),r=(t.radius===void 0?Math.hypot(Math.max(n.minX-o.x,0,o.x-n.maxX),Math.max(n.minY-o.y,0,o.y-n.maxY)):Math.hypot(e.x-t.x,e.y-t.y)-t.radius)-e.diameter/2;if(r+vae>=this.viaToPadClearance)return;let i=`via_pad_clearance_${e.viaId}_${t.obstacleId}`,s={x:(e.x+t.x)/2,y:(e.y+t.y)/2};return{type:"pcb_pad_pad_clearance_error",error_type:"pcb_pad_pad_clearance_error",pcb_pad_pad_clearance_error_id:i,message:`pcb_via "${e.viaId}" and ${t.obstacleType} "${t.obstacleId}" are too close (gap: ${r.toFixed(3)}mm)`,pcb_trace_id:e.traceId,pcb_pad_ids:[e.viaId,t.obstacleId],pcb_via_ids:[e.viaId],minimum_clearance:this.viaToPadClearance,actual_clearance:r,center:s}}checkViaPairs(e){let t=this.queryResultBudget?this.getQueryCacheKey("via-pairs",e.map((n)=>n.primitiveId)):void 0;return this.runCachedQuery(t,()=>this.computeViaPairs(e))}computeViaPairs(e){if(e.length<2)return[];let t=[],n=new EWe(this.cellSize);for(let o of e)n.insert(o,iCe(q4e(o),this.viaClearance));for(let o of e)for(let r of n.query(q4e(o))){if(this.lastRunStats.broadPhaseCandidateCount+=1,r.order<=o.order)continue;this.lastRunStats.exactCheckCount+=1;let i=Math.hypot(o.x-r.x,o.y-r.y);if(i<=PWe)continue;let s=i-o.diameter/2-r.diameter/2;if(s+vae>=this.viaClearance)continue;let a=this.areConnected(o.netId,r.netId),c=[o.viaId,r.viaId].sort().join("_"),l={x:(o.x+r.x)/2,y:(o.y+r.y)/2};t.push({type:"pcb_via_clearance_error",error_type:"pcb_via_clearance_error",pcb_error_id:`${a?"same_net":"different_net"}_vias_close_${c}`,message:`Vias ${o.viaId} and ${r.viaId}${a?"":" from different nets"} are too close together (gap: ${s.toFixed(3)}mm)`,pcb_via_ids:[o.viaId,r.viaId],...this.includeTraceViaOwnerMetadata?{pcb_trace_ids:[o.traceId,r.traceId]}:{},pcb_via_pair_net_relation:a?"same_net":"different_net",minimum_clearance:this.viaClearance,actual_clearance:s,pcb_center:l,center:l})}return t}checkViaPadQuery(e){let t=this.getQueryCacheKey("via-pad",[e.primitiveId]);return this.runCachedQuery(t,()=>{let n=[],o=new Set;for(let r of e.layers){let i=this.obstacleIndexesByLayer.get(r)?.query(q4e(e))??[];for(let s of i){if(o.has(s))continue;o.add(s),this.lastRunStats.broadPhaseCandidateCount+=1;let a=this.checkViaObstacle(e,s);a&&n.push(a)}}return n})}evaluate(e){return this.evaluateInternal(e,!0)}evaluateLegacy(e){return this.evaluateInternal(e,!1)}evaluateInternal(e,t){if(this.queryResultBudget){let d=JSON.stringify([this.connMap?.idToNetMap,this.obstacles.map((u)=>u.connectedTo)]);d!==this.cachedConnectivityKey&&(this.queryResultCache.clear(),this.queryResultUnits=0,this.cachedConnectivityKey=d)}let{segments:n,vias:o}=this.collectDynamicGeometry(e),r=this.buildDynamicIndexes(n,o),i=[],s=[];this.lastRunStats={traceCount:e.length,segmentCount:n.length,viaCount:o.length,obstacleCount:this.obstacles.length,broadPhaseCandidateCount:0,exactCheckCount:0};for(let d of n){let u=gOt(d),_=r.get(d.layer)?.query(u)??[],p=this.obstacleIndexesByLayer.get(d.layer)?.query(u)??[];i.push(...this.checkTraceQuery(d,_,p))}let a=this.checkViaPairs(o);if(t)for(let d of o)s.push(...this.checkViaPadQuery(d));let c=new Map;for(let d of i){let u=String(d.pcb_trace_error_id),_=c.get(u),p=Number(d.actual_clearance);if(!_){c.set(u,{...d,first_contact_center:d.center,first_contact_message:d.message,first_actual_clearance:p,worst_contact_center:d.center,worst_contact_message:d.message,worst_actual_clearance:p});continue}let m=Number(_.worst_actual_clearance);(p<m||!Number.isFinite(m))&&(_.worst_contact_center=d.center,_.worst_contact_message=d.message,_.worst_actual_clearance=p)}let l=[...c.values()].map((d)=>({...d,center:typeof d.worst_contact_center=="object"?d.worst_contact_center:d.center,message:typeof d.worst_contact_message=="string"?d.worst_contact_message:d.message,actual_clearance:typeof d.worst_actual_clearance=="number"?d.worst_actual_clearance:d.actual_clearance}));l.push(...s),l.push(...a);let h=l.filter((d)=>d.center);return{errors:l,errorsWithCenters:h,locationAwareErrors:h}}},yOt=(e,t)=>e.width??t.width??0.1,X2r=[1,1.75,-1],j2r=[1,1.75,-1],K2r=2.6666666666666665,Dr=0.000001,Ba=0.001,lQ=0.14,g$=0.035,L2=0.015,Jqe=(e)=>e.minTraceToPadEdgeClearance??0.16,o6e=(e)=>e.minViaEdgeToPadEdgeClearance??0.1,xOt=(e)=>Math.max(48,Math.round(48*Math.max(1,e))),$2r=(e)=>e>=2?X2r:j2r,q2r=class{netMap;idToNetMap;constructor(e){this.netMap=e,this.idToNetMap={};for(let[t,n]of Object.entries(e))for(let o of n)this.idToNetMap[o]=t}addConnections(e){for(let t of e){let n=new Set;for(let r of t){let i=this.idToNetMap[r];i&&n.add(i)}let o;if(n.size===0)o=`connectivity_net${Object.keys(this.netMap).length}`,this.netMap[o]=[];else if(n.size===1)o=n.values().next().value??`connectivity_net${Object.keys(this.netMap).length}`;else{o=n.values().next().value??`connectivity_net${Object.keys(this.netMap).length}`;for(let r of n)if(r!==o){this.netMap[o].push(...this.netMap[r]),this.netMap[r]=this.netMap[o];for(let i of this.netMap[o])this.idToNetMap[i]=o}}for(let r of t)this.netMap[o].includes(r)||this.netMap[o].push(r),this.idToNetMap[r]=o}}getIdsConnectedToNet(e){return this.netMap[e]||[]}getNetConnectedToId(e){return this.idToNetMap[e]}areIdsConnected(e,t){if(e===t)return!0;let n=this.getNetConnectedToId(e);if(!n)return!1;let o=this.getNetConnectedToId(t);return!!o&&(n===o||o===e||o===e)}areAllIdsConnected(e){let t=this.getNetConnectedToId(e[0]);for(let n of e){let o=this.getNetConnectedToId(n);if(o===void 0)return!1;if(o!==t)return!1}return!0}},Zqe=(e)=>{let t=[];for(let o of e)if(o.type==="source_trace")t.push([o.source_trace_id,...o.connected_source_port_ids??[],...o.connected_source_net_ids??[]].filter(Boolean));else if(o.type==="pcb_port"){let{pcb_port_id:r,source_port_id:i}=o;i&&r&&t.push([i,r])}else if(o.type==="pcb_smtpad"){let{pcb_smtpad_id:r,pcb_port_id:i}=o;i&&r&&t.push([r,i])}else if(o.type==="pcb_plated_hole"){let{pcb_plated_hole_id:r,pcb_port_id:i}=o;i&&r&&t.push([r,i])}else if(o.type==="pcb_trace"){let{pcb_trace_id:r,source_trace_id:i}=o,s=Array.isArray(o.route)?o.route.filter((a)=>a&&a.route_type==="wire"):[];if(i&&r&&t.push([r,i]),Array.isArray(s)){let a=s.find((l)=>l?.start_pcb_port_id)?.start_pcb_port_id,c=s.find((l)=>l?.end_pcb_port_id)?.end_pcb_port_id;a&&r&&c&&t.push([a,r,c])}}else if(o.type==="pcb_via"){let{pcb_via_id:r,pcb_trace_id:i}=o;i&&r&&t.push([r,i])}else if(o.type==="source_component"&&o.internally_connected_source_port_ids)for(let r of o.internally_connected_source_port_ids)t.push(r);let n=function(o){let r=new Map,i=0;function s(a){for(let[,l]of r)if(l.has(a))return l;let c=new Set;return r.set("connectivity_net"+i++,c),c}for(let a of o){let c=null;for(let l of a){if(c){if(!c.has(l)){let h=s(l);if(h!==c){for(let d of h)c.add(d);r.delete(Array.from(r.entries()).find(([,d])=>d===h)[0])}}}else c=s(l);c.add(l)}}return Object.fromEntries(Array.from(r.entries()).map(([a,c])=>[a,Array.from(c)]))}(t);return new q2r(n)},YCe={};wbe(YCe,{all_layers:()=>fce,any_circuit_element:()=>Bin,any_soup_element:()=>GCe,any_source_component:()=>Xnn,asset:()=>Inn,base_circuit_json_error:()=>Jl,battery_capacity:()=>bnn,brep_shape:()=>Lon,cadModelDefaultDirectionMap:()=>w1r,cad_component:()=>gin,cad_model_axis_directions:()=>_in,cad_model_formats:()=>M1r,capacitance:()=>eJe,circuit_json_footprint_load_error:()=>Grn,current:()=>lq,distance:()=>Xn,duration_ms:()=>Nle,experiment_type:()=>Iin,external_footprint_load_error:()=>Yrn,frequency:()=>SV,getZodPrefixedIdWithDefault:()=>mo,inductance:()=>xnn,kicadAt:()=>i6e,kicadEffects:()=>vnn,kicadFont:()=>nJe,kicadFootprintAttributes:()=>Pnn,kicadFootprintMetadata:()=>wnn,kicadFootprintModel:()=>Mnn,kicadFootprintPad:()=>Enn,kicadFootprintProperties:()=>Snn,kicadProperty:()=>ece,kicadSymbolEffects:()=>Dnn,kicadSymbolMetadata:()=>Rnn,kicadSymbolPinNames:()=>Tnn,kicadSymbolPinNumbers:()=>Bnn,kicadSymbolProperties:()=>Nnn,kicadSymbolProperty:()=>WR,layer_ref:()=>mc,layer_string:()=>$je,length:()=>ar,manufacturing_drc_properties:()=>zon,ms:()=>cV,ninePointAnchor:()=>Hw,pcbRenderLayer:()=>t1r,pcb_autorouting_error:()=>Wrn,pcb_board:()=>urn,pcb_breakout_point:()=>$rn,pcb_component:()=>Oon,pcb_component_invalid_layer_error:()=>sin,pcb_component_not_on_board_edge_error:()=>iin,pcb_component_outside_board_error:()=>rin,pcb_connector_not_in_accessible_orientation_warning:()=>jrn,pcb_copper_pour:()=>oin,pcb_copper_pour_brep:()=>tin,pcb_copper_pour_polygon:()=>nin,pcb_copper_pour_rect:()=>ein,pcb_copper_text:()=>xrn,pcb_courtyard_circle:()=>min,pcb_courtyard_outline:()=>uin,pcb_courtyard_overlap_error:()=>Qrn,pcb_courtyard_polygon:()=>pin,pcb_courtyard_rect:()=>din,pcb_cutout:()=>Orn,pcb_cutout_circle:()=>Hrn,pcb_cutout_path:()=>zrn,pcb_cutout_polygon:()=>Frn,pcb_cutout_rect:()=>Lrn,pcb_fabrication_note_dimension:()=>Mrn,pcb_fabrication_note_path:()=>Prn,pcb_fabrication_note_rect:()=>Ern,pcb_fabrication_note_text:()=>Srn,pcb_footprint_overlap_error:()=>Rrn,pcb_ground_plane:()=>qrn,pcb_ground_plane_region:()=>Jrn,pcb_group:()=>Urn,pcb_hole:()=>jon,pcb_hole_circle_or_square_shape:()=>c1r,pcb_hole_circle_shape:()=>s1r,pcb_hole_oval_shape:()=>l1r,pcb_hole_pill_shape:()=>h1r,pcb_hole_rect_shape:()=>a1r,pcb_hole_rotated_pill_shape:()=>d1r,pcb_keepout:()=>krn,pcb_manual_edit_conflict_warning:()=>Xrn,pcb_missing_footprint_error:()=>Vrn,pcb_net:()=>hrn,pcb_note_dimension:()=>Nrn,pcb_note_line:()=>Drn,pcb_note_path:()=>Trn,pcb_note_rect:()=>Brn,pcb_note_text:()=>wrn,pcb_pad_pad_clearance_error:()=>lin,pcb_pad_trace_clearance_error:()=>hin,pcb_panel:()=>prn,pcb_panelization_placement_error:()=>_rn,pcb_placement_error:()=>mrn,pcb_plated_hole:()=>Kon,pcb_port:()=>$on,pcb_port_not_connected_error:()=>lrn,pcb_port_not_matched_error:()=>crn,pcb_route_hint:()=>Hon,pcb_route_hints:()=>i1r,pcb_silkscreen_circle:()=>brn,pcb_silkscreen_line:()=>Arn,pcb_silkscreen_oval:()=>Irn,pcb_silkscreen_path:()=>frn,pcb_silkscreen_pill:()=>vrn,pcb_silkscreen_rect:()=>Crn,pcb_silkscreen_text:()=>yrn,pcb_smtpad:()=>Jon,pcb_smtpad_pill:()=>qon,pcb_solder_paste:()=>Zon,pcb_text:()=>ern,pcb_thermal_spoke:()=>Zrn,pcb_trace:()=>rrn,pcb_trace_error:()=>srn,pcb_trace_hint:()=>grn,pcb_trace_missing_error:()=>arn,pcb_trace_route_point:()=>orn,pcb_trace_route_point_via:()=>nrn,pcb_trace_route_point_wire:()=>trn,pcb_trace_warning:()=>irn,pcb_via:()=>drn,pcb_via_clearance_error:()=>ain,pcb_via_trace_clearance_error:()=>cin,point:()=>Xr,point3:()=>gw,point_with_bulge:()=>kon,port_arrangement:()=>pon,position:()=>Z2r,position3:()=>e1r,resistance:()=>r6e,ring:()=>qje,rotation:()=>gm,route_hint_point:()=>Fon,schematic_arc:()=>yon,schematic_box:()=>con,schematic_circle:()=>fon,schematic_component:()=>mon,schematic_component_port_arrangement_by_sides:()=>uon,schematic_component_port_arrangement_by_size:()=>don,schematic_debug_line:()=>Eon,schematic_debug_object:()=>won,schematic_debug_object_base:()=>a6e,schematic_debug_point:()=>Mon,schematic_debug_rect:()=>Pon,schematic_error:()=>von,schematic_group:()=>Don,schematic_layout_error:()=>Son,schematic_line:()=>gon,schematic_manual_edit_conflict_warning:()=>Ton,schematic_net_label:()=>Ion,schematic_path:()=>lon,schematic_pin_styles:()=>hon,schematic_port:()=>bon,schematic_rect:()=>Aon,schematic_sheet:()=>Qon,schematic_symbol:()=>_on,schematic_table:()=>Non,schematic_table_cell:()=>Ron,schematic_text:()=>Con,schematic_trace:()=>xon,schematic_voltage_probe:()=>Bon,simulation_ac_current_source:()=>Cin,simulation_ac_voltage_source:()=>fin,simulation_current_source:()=>bin,simulation_dc_current_source:()=>xin,simulation_dc_voltage_source:()=>Ain,simulation_experiment:()=>vin,simulation_op_amp:()=>win,simulation_switch:()=>Pin,simulation_transient_voltage_graph:()=>Sin,simulation_unknown_experiment_error:()=>Min,simulation_voltage_probe:()=>Ein,simulation_voltage_source:()=>yin,size:()=>tJe,source_ambiguous_port_reference:()=>eon,source_board:()=>Znn,source_component_base:()=>Td,source_component_internal_connection:()=>Knn,source_component_pins_underspecified_warning:()=>ion,source_failed_to_create_component_error:()=>Vnn,source_group:()=>qnn,source_i2c_misconfigured_error:()=>PJe,source_interconnect:()=>Unn,source_invalid_component_property_error:()=>bJe,source_manually_placed_via:()=>non,source_missing_manufacturer_part_number_warning:()=>SJe,source_missing_property_error:()=>Onn,source_net:()=>Jnn,source_no_ground_pin_defined_warning:()=>ron,source_no_power_pin_defined_warning:()=>oon,source_pcb_ground_plane:()=>ton,source_pin_attributes:()=>Hnn,source_pin_missing_trace_warning:()=>vJe,source_pin_must_be_connected_error:()=>son,source_port:()=>jnn,source_project_metadata:()=>CJe,source_property_ignored_warning:()=>Ynn,source_simple_battery:()=>lJe,source_simple_capacitor:()=>rJe,source_simple_chip:()=>aJe,source_simple_connector:()=>znn,source_simple_crystal:()=>Fnn,source_simple_current_source:()=>Lnn,source_simple_diode:()=>s6e,source_simple_fiducial:()=>Qnn,source_simple_ground:()=>knn,source_simple_inductor:()=>hJe,source_simple_led:()=>sJe,source_simple_mosfet:()=>fJe,source_simple_op_amp:()=>yJe,source_simple_pin_header:()=>pJe,source_simple_pinout:()=>mJe,source_simple_potentiometer:()=>uJe,source_simple_power_source:()=>cJe,source_simple_push_button:()=>dJe,source_simple_resistor:()=>iJe,source_simple_resonator:()=>_Je,source_simple_switch:()=>xJe,source_simple_test_point:()=>AJe,source_simple_transistor:()=>gJe,source_simple_voltage_probe:()=>Gnn,source_simple_voltage_source:()=>Wnn,source_trace:()=>$nn,source_trace_not_connected_error:()=>IJe,supplier_footprint_mismatch_warning:()=>Krn,supplier_name:()=>oJe,time:()=>J2r,timestamp:()=>Cnn,unknown_error_finding_part:()=>aon,visible_layer:()=>Bf,voltage:()=>ww,wave_shape:()=>MJe});var ynn={Hz:{baseUnit:"Hz",variants:{MHz:1e6,kHz:1000,Hz:1}},g:{baseUnit:"g",variants:{kg:1000,g:1}},"Ω":{baseUnit:"Ω",variants:{"mΩ":0.001,"Ω":1,"kΩ":1000,"KΩ":1000,kohm:1000,"MΩ":1e6,"GΩ":1e9,"TΩ":1000000000000}},V:{baseUnit:"V",variants:{mV:0.001,V:1,kV:1000,KV:1000,MV:1e6,GV:1e9,TV:1000000000000}},A:{baseUnit:"A",variants:{"µA":0.000001,mA:0.001,ma:0.001,A:1,kA:1000,MA:1e6}},F:{baseUnit:"F",variants:{pF:0.000000000001,nF:0.000000001,"µF":0.000001,uF:0.000001,mF:0.001,F:1}},ml:{baseUnit:"ml",variants:{ml:1,mL:1,l:1000,L:1000}},deg:{baseUnit:"deg",variants:{rad:180/Math.PI}},ms:{baseUnit:"ms",variants:{fs:0.000000000001,ps:0.000000001,ns:0.000001,us:0.001,"µs":0.001,ms:1,s:1000}},mm:{baseUnit:"mm",variants:{nm:0.000001,"µm":0.001,um:0.001,mm:1,cm:10,dm:100,m:1000,km:1e6,in:25.4,ft:304.8,IN:25.4,FT:304.8,yd:914.4,mi:1609344,mil:0.0254}}},Kje=new Set;for(let[e,t]of Object.entries(ynn)){Kje.add(e);for(let n of Object.keys(t.variants))Kje.add(n)}var COt={tera:1000000000000,T:1000000000000,giga:1e9,G:1e9,mega:1e6,M:1e6,kilo:1000,k:1000,deci:0.1,d:0.1,centi:0.01,c:0.01,milli:0.001,m:0.001,micro:0.000001,u:0.000001,"µ":0.000001,nano:0.000000001,n:0.000000001,pico:0.000000000001,p:0.000000000001};function h9(e){if(e==null)return{parsedUnit:null,unitOfValue:null,value:null};if(typeof e=="string"&&e.match(/^-?[\d\.]+$/))return{value:Number.parseFloat(e),parsedUnit:null,unitOfValue:null};if(typeof e=="number")return{value:e,parsedUnit:null,unitOfValue:null};if(typeof e=="object"&&"x"in e&&"y"in e){let{parsedUnit:a,unitOfValue:c}=h9(e.x),l=h9(e.x),h=h9(e.y);return l.value===null||h.value===null?{parsedUnit:null,unitOfValue:null,value:null}:{parsedUnit:a,unitOfValue:c,value:{x:l.value,y:h.value}}}let t=e.toString().split("").reverse().join(""),n=t.match(/[^\d\s]+/)?.[0];if(!n)throw Error(`Could not determine unit: "${e}"`);let o=n.split("").reverse().join(""),r=e.slice(0,-o.length);if(o in COt&&!Kje.has(o)){let a=COt[o];return{parsedUnit:null,unitOfValue:null,value:Number.parseFloat(r)*a}}let{baseUnit:i,conversionFactor:s}=function(a){for(let[c,l]of Object.entries(ynn))if(a in l.variants)return{baseUnit:l.baseUnit,conversionFactor:l.variants[a]};return{baseUnit:a,conversionFactor:1}}(o);return{parsedUnit:o,unitOfValue:i,value:s*Number.parseFloat(r)}}var r6e=E.string().or(E.number()).transform((e)=>h9(e).value),eJe=E.string().or(E.number()).transform((e)=>h9(e).value).transform((e)=>Number.parseFloat(e.toPrecision(12))),xnn=E.string().or(E.number()).transform((e)=>h9(e).value),ww=E.string().or(E.number()).transform((e)=>h9(e).value),ar=E.string().or(E.number()).transform((e)=>h9(e).value),SV=E.string().or(E.number()).transform((e)=>h9(e).value),Xn=ar,lq=E.string().or(E.number()).transform((e)=>h9(e).value),Nle=E.string().or(E.number()).transform((e)=>h9(e).value),J2r=Nle,cV=Nle,Cnn=E.string().datetime(),gm=E.string().or(E.number()).transform((e)=>typeof e=="number"?e:e.endsWith("deg")?Number.parseFloat(e.split("deg")[0]):e.endsWith("rad")?180*Number.parseFloat(e.split("rad")[0])/Math.PI:Number.parseFloat(e)),bnn=E.number().or(E.string().endsWith("mAh")).transform((e)=>{if(typeof e=="string"){let t=e.replace("mAh",""),n=Number.parseFloat(t);if(Number.isNaN(n))throw Error("Invalid capacity");return n}return e}).describe("Battery capacity in mAh"),Xr=E.object({x:Xn,y:Xn}),Z2r=Xr,gw=E.object({x:Xn,y:Xn,z:Xn}),e1r=gw,tJe=E.object({width:E.number(),height:E.number()}),mo=(e)=>E.string().optional().default(()=>`${e}_${((t)=>Array.from({length:t},()=>"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"[Math.floor(62*Math.random())]).join(""))(10)}`),Hw=E.enum(["top_left","top_center","top_right","center_left","center","center_right","bottom_left","bottom_center","bottom_right"]),t1r=E.enum(["top_silkscreen","bottom_silkscreen","top_copper","bottom_copper","top_soldermask","bottom_soldermask","top_fabrication_note","bottom_fabrication_note","top_user_note","bottom_user_note","top_courtyard","bottom_courtyard","inner1_copper","inner2_copper","inner3_copper","inner4_copper","inner5_copper","inner6_copper","edge_cuts","drill"]),Inn=E.object({project_relative_path:E.string(),url:E.string(),mimetype:E.string()}),i6e=Xr.extend({rotation:gm.optional()}),nJe=E.object({size:Xr.optional(),thickness:Xn.optional()}),vnn=E.object({font:nJe.optional()}),ece=E.object({value:E.string(),at:i6e.optional(),layer:E.string().optional(),uuid:E.string().optional(),hide:E.boolean().optional(),effects:vnn.optional()}),Snn=E.object({Reference:ece.optional(),Value:ece.optional(),Datasheet:ece.optional(),Description:ece.optional()}),Pnn=E.object({through_hole:E.boolean().optional(),smd:E.boolean().optional(),exclude_from_pos_files:E.boolean().optional(),exclude_from_bom:E.boolean().optional()}),Enn=E.object({name:E.string(),type:E.string(),shape:E.string().optional(),at:i6e.optional(),size:Xr.optional(),drill:Xn.optional(),layers:E.array(E.string()).optional(),removeUnusedLayers:E.boolean().optional(),uuid:E.string().optional()}),Mnn=E.object({path:E.string(),offset:gw.optional(),scale:gw.optional(),rotate:gw.optional()}),wnn=E.object({footprintName:E.string().optional(),version:E.union([E.number(),E.string()]).optional(),generator:E.string().optional(),generatorVersion:E.union([E.number(),E.string()]).optional(),layer:E.string().optional(),properties:Snn.optional(),attributes:Pnn.optional(),pads:E.array(Enn).optional(),embeddedFonts:E.boolean().optional(),model:Mnn.optional()}),Bnn=E.object({hide:E.boolean().optional()}),Tnn=E.object({offset:Xn.optional(),hide:E.boolean().optional()}),Dnn=E.object({font:nJe.optional(),justify:E.union([E.string(),E.array(E.string())]).optional(),hide:E.boolean().optional()}),WR=E.object({value:E.string(),id:E.union([E.number(),E.string()]).optional(),at:i6e.optional(),effects:Dnn.optional()}),Nnn=E.object({Reference:WR.optional(),Value:WR.optional(),Footprint:WR.optional(),Datasheet:WR.optional(),Description:WR.optional(),ki_keywords:WR.optional(),ki_fp_filters:WR.optional()}),Rnn=E.object({symbolName:E.string().optional(),extends:E.string().optional(),pinNumbers:Bnn.optional(),pinNames:Tnn.optional(),excludeFromSim:E.boolean().optional(),inBom:E.boolean().optional(),onBoard:E.boolean().optional(),properties:Nnn.optional(),embeddedFonts:E.boolean().optional()}),Jl=E.object({error_type:E.string(),message:E.string(),is_fatal:E.boolean().optional()}),oJe=E.enum(["jlcpcb","macrofab","pcbway","digikey","mouser","lcsc"]),Td=E.object({type:E.literal("source_component"),ftype:E.string().optional(),source_component_id:E.string(),name:E.string(),manufacturer_part_number:E.string().optional(),supplier_part_numbers:E.record(oJe,E.array(E.string())).optional(),display_value:E.string().optional(),display_name:E.string().optional(),are_pins_interchangeable:E.boolean().optional(),internally_connected_source_port_ids:E.array(E.array(E.string())).optional(),source_group_id:E.string().optional(),subcircuit_id:E.string().optional()}),rJe=Td.extend({ftype:E.literal("simple_capacitor"),capacitance:eJe,max_voltage_rating:ww.optional(),display_capacitance:E.string().optional(),max_decoupling_trace_length:Xn.optional()}),iJe=Td.extend({ftype:E.literal("simple_resistor"),resistance:r6e,display_resistance:E.string().optional()}),s6e=Td.extend({ftype:E.literal("simple_diode")}),Qnn=Td.extend({ftype:E.literal("simple_fiducial")}),sJe=s6e.extend({ftype:E.literal("simple_led"),color:E.string().optional(),wavelength:E.string().optional()}),knn=Td.extend({ftype:E.literal("simple_ground")}),aJe=Td.extend({ftype:E.literal("simple_chip")}),cJe=Td.extend({ftype:E.literal("simple_power_source"),voltage:ww}),Lnn=Td.extend({ftype:E.literal("simple_current_source"),current:lq,frequency:SV.optional(),peak_to_peak_current:lq.optional(),wave_shape:E.enum(["sine","square","triangle","sawtooth","dc"]).optional().default("dc"),phase:E.number().optional(),duty_cycle:E.number().min(0).max(1).optional()}),Hnn=E.object({must_be_connected:E.boolean().optional(),provides_power:E.boolean().optional(),requires_power:E.boolean().optional(),provides_ground:E.boolean().optional(),requires_ground:E.boolean().optional(),provides_voltage:E.union([E.string(),E.number()]).optional(),requires_voltage:E.union([E.string(),E.number()]).optional(),do_not_connect:E.boolean().optional(),include_in_board_pinout:E.boolean().optional(),can_use_internal_pullup:E.boolean().optional(),is_using_internal_pullup:E.boolean().optional(),needs_external_pullup:E.boolean().optional(),can_use_internal_pulldown:E.boolean().optional(),is_using_internal_pulldown:E.boolean().optional(),needs_external_pulldown:E.boolean().optional(),can_use_open_drain:E.boolean().optional(),is_using_open_drain:E.boolean().optional(),can_use_push_pull:E.boolean().optional(),is_using_push_pull:E.boolean().optional(),should_have_decoupling_capacitor:E.boolean().optional(),recommended_decoupling_capacitor_capacitance:E.union([E.string(),E.number()]).optional(),is_configured_for_i2c_sda:E.boolean().optional(),is_configured_for_i2c_scl:E.boolean().optional(),is_configured_for_spi_mosi:E.boolean().optional(),is_configured_for_spi_miso:E.boolean().optional(),is_configured_for_spi_sck:E.boolean().optional(),is_configured_for_spi_cs:E.boolean().optional(),is_configured_for_uart_tx:E.boolean().optional(),is_configured_for_uart_rx:E.boolean().optional(),supports_i2c_sda:E.boolean().optional(),supports_i2c_scl:E.boolean().optional(),supports_spi_mosi:E.boolean().optional(),supports_spi_miso:E.boolean().optional(),supports_spi_sck:E.boolean().optional(),supports_spi_cs:E.boolean().optional(),supports_uart_tx:E.boolean().optional(),supports_uart_rx:E.boolean().optional()}),n1r=Td.extend({ftype:E.literal("simple_fuse"),current_rating_amps:E.number().describe("Nominal current in amps the fuse is rated for"),voltage_rating_volts:E.number().describe("Voltage rating in volts, e.g. ±5V would be 5")}),lJe=Td.extend({ftype:E.literal("simple_battery"),capacity:bnn}),hJe=Td.extend({ftype:E.literal("simple_inductor"),inductance:xnn,display_inductance:E.string().optional(),max_current_rating:E.number().optional()}),dJe=Td.extend({ftype:E.literal("simple_push_button")}),uJe=Td.extend({ftype:E.literal("simple_potentiometer"),max_resistance:r6e,display_max_resistance:E.string().optional()}),Fnn=Td.extend({ftype:E.literal("simple_crystal"),frequency:E.number().describe("Frequency in Hz"),load_capacitance:E.number().optional().describe("Load capacitance in pF"),pin_variant:E.enum(["two_pin","four_pin"]).optional()}),pJe=Td.extend({ftype:E.literal("simple_pin_header"),pin_count:E.number(),gender:E.enum(["male","female"]).optional().default("male")}),znn=Td.extend({ftype:E.literal("simple_connector"),standard:E.enum(["usb_c","m2"]).optional()}),mJe=Td.extend({ftype:E.literal("simple_pinout")}),_Je=Td.extend({ftype:E.literal("simple_resonator"),load_capacitance:eJe,equivalent_series_resistance:r6e.optional(),frequency:SV}),gJe=Td.extend({ftype:E.literal("simple_transistor"),transistor_type:E.enum(["npn","pnp"])}),AJe=Td.extend({ftype:E.literal("simple_test_point"),footprint_variant:E.enum(["pad","through_hole"]).optional(),pad_shape:E.enum(["rect","circle"]).optional(),pad_diameter:E.union([E.number(),E.string()]).optional(),hole_diameter:E.union([E.number(),E.string()]).optional(),width:E.union([E.number(),E.string()]).optional(),height:E.union([E.number(),E.string()]).optional()}),fJe=Td.extend({ftype:E.literal("simple_mosfet"),channel_type:E.enum(["n","p"]),mosfet_mode:E.enum(["enhancement","depletion"])}),yJe=Td.extend({ftype:E.literal("simple_op_amp")}),xJe=Td.extend({ftype:E.literal("simple_switch")}),CJe=E.object({type:E.literal("source_project_metadata"),name:E.string().optional(),software_used_string:E.string().optional(),project_url:E.string().optional(),created_at:Cnn.optional()}),Onn=Jl.extend({type:E.literal("source_missing_property_error"),source_missing_property_error_id:mo("source_missing_property_error"),source_component_id:E.string(),property_name:E.string(),subcircuit_id:E.string().optional(),error_type:E.literal("source_missing_property_error").default("source_missing_property_error")}).describe("The source code is missing a property"),Vnn=Jl.extend({type:E.literal("source_failed_to_create_component_error"),source_failed_to_create_component_error_id:mo("source_failed_to_create_component_error"),error_type:E.literal("source_failed_to_create_component_error").default("source_failed_to_create_component_error"),component_name:E.string().optional(),subcircuit_id:E.string().optional(),parent_source_component_id:E.string().optional(),pcb_center:E.object({x:E.number().optional(),y:E.number().optional()}).optional(),schematic_center:E.object({x:E.number().optional(),y:E.number().optional()}).optional()}).describe("Error emitted when a component fails to be constructed"),bJe=Jl.extend({type:E.literal("source_invalid_component_property_error"),source_invalid_component_property_error_id:mo("source_invalid_component_property_error"),source_component_id:E.string(),property_name:E.string(),property_value:E.unknown().optional(),expected_format:E.string().optional(),subcircuit_id:E.string().optional(),error_type:E.literal("source_invalid_component_property_error").default("source_invalid_component_property_error")}).describe("The source component property is invalid"),IJe=Jl.extend({type:E.literal("source_trace_not_connected_error"),source_trace_not_connected_error_id:mo("source_trace_not_connected_error"),error_type:E.literal("source_trace_not_connected_error").default("source_trace_not_connected_error"),subcircuit_id:E.string().optional(),source_group_id:E.string().optional(),source_trace_id:E.string().optional(),connected_source_port_ids:E.array(E.string()).optional(),selectors_not_found:E.array(E.string()).optional()}).describe("Occurs when a source trace selector does not match any ports"),Ynn=E.object({type:E.literal("source_property_ignored_warning"),source_property_ignored_warning_id:mo("source_property_ignored_warning"),source_component_id:E.string(),property_name:E.string(),subcircuit_id:E.string().optional(),error_type:E.literal("source_property_ignored_warning").default("source_property_ignored_warning"),message:E.string()}).describe("The source property was ignored"),vJe=E.object({type:E.literal("source_pin_missing_trace_warning"),source_pin_missing_trace_warning_id:mo("source_pin_missing_trace_warning"),warning_type:E.literal("source_pin_missing_trace_warning").default("source_pin_missing_trace_warning"),message:E.string(),source_component_id:E.string(),source_port_id:E.string(),subcircuit_id:E.string().optional()}).describe("Warning emitted when a source component pin is missing a trace connection"),SJe=E.object({type:E.literal("source_missing_manufacturer_part_number_warning"),source_missing_manufacturer_part_number_warning_id:mo("source_missing_manufacturer_part_number_warning"),warning_type:E.literal("source_missing_manufacturer_part_number_warning").default("source_missing_manufacturer_part_number_warning"),message:E.string(),source_component_id:E.string(),standard:E.string(),subcircuit_id:E.string().optional()}).describe("Warning emitted when a standard connector is missing manufacturer part number"),Gnn=Td.extend({ftype:E.literal("simple_voltage_probe")}),Unn=Td.extend({ftype:E.literal("interconnect")}),PJe=Jl.extend({type:E.literal("source_i2c_misconfigured_error"),source_i2c_misconfigured_error_id:mo("source_i2c_misconfigured_error"),error_type:E.literal("source_i2c_misconfigured_error").default("source_i2c_misconfigured_error"),source_port_ids:E.array(E.string())}).describe("Error emitted when incompatible I2C pins (e.g. SDA and SCL) are connected to the same net"),Wnn=Td.extend({ftype:E.literal("simple_voltage_source"),voltage:ww,frequency:SV.optional(),peak_to_peak_voltage:ww.optional(),wave_shape:E.enum(["sinewave","square","triangle","sawtooth"]).optional(),phase:gm.optional(),duty_cycle:E.number().optional().describe("Duty cycle as a fraction (0 to 1)")}),Xnn=E.union([iJe,rJe,s6e,Qnn,sJe,knn,aJe,cJe,Lnn,lJe,hJe,dJe,uJe,Fnn,pJe,znn,mJe,_Je,xJe,gJe,AJe,fJe,yJe,n1r,Gnn,Unn,Wnn,CJe,Onn,bJe,Vnn,IJe,Ynn,vJe,SJe,PJe]),jnn=E.object({type:E.literal("source_port"),pin_number:E.number().optional(),port_hints:E.array(E.string()).optional(),name:E.string(),source_port_id:E.string(),source_component_id:E.string().optional(),source_group_id:E.string().optional(),most_frequently_referenced_by_name:E.string().optional(),subcircuit_id:E.string().optional(),subcircuit_connectivity_map_key:E.string().optional()}).merge(Hnn),Knn=E.object({type:E.literal("source_component_internal_connection"),source_component_internal_connection_id:E.string(),source_component_id:E.string(),source_port_ids:E.array(E.string()),subcircuit_id:E.string().optional()}),$nn=E.object({type:E.literal("source_trace"),source_trace_id:E.string(),connected_source_port_ids:E.array(E.string()),connected_source_net_ids:E.array(E.string()),subcircuit_id:E.string().optional(),subcircuit_connectivity_map_key:E.string().optional(),max_length:E.number().optional(),min_trace_thickness:E.number().optional(),display_name:E.string().optional()}),qnn=E.object({type:E.literal("source_group"),source_group_id:E.string(),subcircuit_id:E.string().optional(),parent_subcircuit_id:E.string().optional(),parent_source_group_id:E.string().optional(),is_subcircuit:E.boolean().optional(),show_as_schematic_box:E.boolean().optional(),name:E.string().optional(),was_automatically_named:E.boolean().optional()}),Jnn=E.object({type:E.literal("source_net"),source_net_id:E.string(),name:E.string(),member_source_group_ids:E.array(E.string()),is_power:E.boolean().optional(),is_ground:E.boolean().optional(),is_digital_signal:E.boolean().optional(),is_analog_signal:E.boolean().optional(),is_positive_voltage_source:E.boolean().optional(),trace_width:E.number().optional(),subcircuit_id:E.string().optional(),subcircuit_connectivity_map_key:E.string().optional()}),Znn=E.object({type:E.literal("source_board"),source_board_id:E.string(),source_group_id:E.string(),title:E.string().optional()}).describe("Defines a board in the source domain"),eon=Jl.extend({type:E.literal("source_ambiguous_port_reference"),source_ambiguous_port_reference_id:mo("source_ambiguous_port_reference"),error_type:E.literal("source_ambiguous_port_reference").default("source_ambiguous_port_reference"),source_port_id:E.string().optional(),source_component_id:E.string().optional()}).describe("Error emitted when a port hint matches multiple non-overlapping pads, making the port reference ambiguous"),ton=E.object({type:E.literal("source_pcb_ground_plane"),source_pcb_ground_plane_id:E.string(),source_group_id:E.string(),source_net_id:E.string(),subcircuit_id:E.string().optional()}).describe("Defines a ground plane in the source domain"),fce=["top","bottom","inner1","inner2","inner3","inner4","inner5","inner6"],$je=E.enum(fce),mc=$je.or(E.object({name:$je})).transform((e)=>typeof e=="string"?e:e.name),Bf=E.enum(["top","bottom"]),non=E.object({type:E.literal("source_manually_placed_via"),source_manually_placed_via_id:E.string(),source_group_id:E.string(),source_net_id:E.string(),subcircuit_id:E.string().optional(),source_trace_id:E.string().optional()}).describe("Defines a via that is manually placed in the source domain"),oon=E.object({type:E.literal("source_no_power_pin_defined_warning"),source_no_power_pin_defined_warning_id:mo("source_no_power_pin_defined_warning"),warning_type:E.literal("source_no_power_pin_defined_warning").default("source_no_power_pin_defined_warning"),message:E.string(),source_component_id:E.string(),source_port_ids:E.array(E.string()),subcircuit_id:E.string().optional()}).describe("Warning emitted when a chip has no source ports with requires_power=true"),ron=E.object({type:E.literal("source_no_ground_pin_defined_warning"),source_no_ground_pin_defined_warning_id:mo("source_no_ground_pin_defined_warning"),warning_type:E.literal("source_no_ground_pin_defined_warning").default("source_no_ground_pin_defined_warning"),message:E.string(),source_component_id:E.string(),source_port_ids:E.array(E.string()),subcircuit_id:E.string().optional()}).describe("Warning emitted when a chip has no source ports marked as ground pins"),ion=E.object({type:E.literal("source_component_pins_underspecified_warning"),source_component_pins_underspecified_warning_id:mo("source_component_pins_underspecified_warning"),warning_type:E.literal("source_component_pins_underspecified_warning").default("source_component_pins_underspecified_warning"),message:E.string(),source_component_id:E.string(),source_port_ids:E.array(E.string()),subcircuit_id:E.string().optional()}).describe("Warning emitted when all ports on a source component are underspecified"),son=Jl.extend({type:E.literal("source_pin_must_be_connected_error"),source_pin_must_be_connected_error_id:mo("source_pin_must_be_connected_error"),error_type:E.literal("source_pin_must_be_connected_error").default("source_pin_must_be_connected_error"),source_component_id:E.string(),source_port_id:E.string(),subcircuit_id:E.string().optional()}).describe("Error emitted when a pin with mustBeConnected attribute is not connected to any trace"),aon=Jl.extend({type:E.literal("unknown_error_finding_part"),unknown_error_finding_part_id:mo("unknown_error_finding_part"),error_type:E.literal("unknown_error_finding_part").default("unknown_error_finding_part"),source_component_id:E.string().optional(),subcircuit_id:E.string().optional()}).describe("Error emitted when an unexpected error occurs while finding a part"),con=E.object({type:E.literal("schematic_box"),schematic_component_id:E.string().optional(),schematic_symbol_id:E.string().optional(),width:Xn,height:Xn,is_dashed:E.boolean().default(!1),x:Xn,y:Xn,subcircuit_id:E.string().optional()}).describe("Draws a box on the schematic"),lon=E.object({type:E.literal("schematic_path"),schematic_path_id:mo("schematic_path"),schematic_component_id:E.string().optional(),schematic_symbol_id:E.string().optional(),fill_color:E.string().optional(),is_filled:E.boolean().optional(),stroke_width:Xn.nullable().optional(),stroke_color:E.string().optional(),points:E.array(Xr),subcircuit_id:E.string().optional()}),hon=E.record(E.object({left_margin:ar.optional(),right_margin:ar.optional(),top_margin:ar.optional(),bottom_margin:ar.optional()})),don=E.object({left_size:E.number(),right_size:E.number(),top_size:E.number().optional(),bottom_size:E.number().optional()}),uon=E.object({left_side:E.object({pins:E.array(E.number()),direction:E.enum(["top-to-bottom","bottom-to-top"]).optional()}).optional(),right_side:E.object({pins:E.array(E.number()),direction:E.enum(["top-to-bottom","bottom-to-top"]).optional()}).optional(),top_side:E.object({pins:E.array(E.number()),direction:E.enum(["left-to-right","right-to-left"]).optional()}).optional(),bottom_side:E.object({pins:E.array(E.number()),direction:E.enum(["left-to-right","right-to-left"]).optional()}).optional()}),pon=E.union([don,uon]),mon=E.object({type:E.literal("schematic_component"),size:tJe,center:Xr,source_component_id:E.string().optional(),schematic_component_id:E.string(),schematic_symbol_id:E.string().optional(),pin_spacing:ar.optional(),pin_styles:hon.optional(),box_width:ar.optional(),symbol_name:E.string().optional(),port_arrangement:pon.optional(),port_labels:E.record(E.string()).optional(),symbol_display_value:E.string().optional(),subcircuit_id:E.string().optional(),schematic_group_id:E.string().optional(),is_schematic_group:E.boolean().optional(),source_group_id:E.string().optional(),is_box_with_pins:E.boolean().optional().default(!0)}),o1r=E.object({kicad_symbol:Rnn.optional()}).catchall(E.unknown()),_on=E.object({type:E.literal("schematic_symbol"),schematic_symbol_id:E.string(),name:E.string().optional(),metadata:o1r.optional()}).describe("Defines a named schematic symbol that can be referenced by components."),gon=E.object({type:E.literal("schematic_line"),schematic_line_id:mo("schematic_line"),schematic_component_id:E.string().optional(),schematic_symbol_id:E.string().optional(),x1:Xn,y1:Xn,x2:Xn,y2:Xn,stroke_width:Xn.nullable().optional(),color:E.string().default("#000000"),is_dashed:E.boolean().default(!1),subcircuit_id:E.string().optional()}).describe("Draws a styled line on the schematic"),Aon=E.object({type:E.literal("schematic_rect"),schematic_rect_id:mo("schematic_rect"),schematic_component_id:E.string().optional(),schematic_symbol_id:E.string().optional(),center:Xr,width:Xn,height:Xn,rotation:gm.default(0),stroke_width:Xn.nullable().optional(),color:E.string().default("#000000"),is_filled:E.boolean().default(!1),fill_color:E.string().optional(),is_dashed:E.boolean().default(!1),subcircuit_id:E.string().optional()}).describe("Draws a styled rectangle on the schematic"),fon=E.object({type:E.literal("schematic_circle"),schematic_circle_id:mo("schematic_circle"),schematic_component_id:E.string().optional(),schematic_symbol_id:E.string().optional(),center:Xr,radius:Xn,stroke_width:Xn.nullable().optional(),color:E.string().default("#000000"),is_filled:E.boolean().default(!1),fill_color:E.string().optional(),is_dashed:E.boolean().default(!1),subcircuit_id:E.string().optional()}).describe("Draws a styled circle on the schematic"),yon=E.object({type:E.literal("schematic_arc"),schematic_arc_id:mo("schematic_arc"),schematic_component_id:E.string().optional(),schematic_symbol_id:E.string().optional(),center:Xr,radius:Xn,start_angle_degrees:gm,end_angle_degrees:gm,direction:E.enum(["clockwise","counterclockwise"]).default("counterclockwise"),stroke_width:Xn.nullable().optional(),color:E.string().default("#000000"),is_dashed:E.boolean().default(!1),subcircuit_id:E.string().optional()}).describe("Draws a styled arc on the schematic"),xon=E.object({type:E.literal("schematic_trace"),schematic_trace_id:E.string(),source_trace_id:E.string().optional(),junctions:E.array(E.object({x:E.number(),y:E.number()})),edges:E.array(E.object({from:E.object({x:E.number(),y:E.number()}),to:E.object({x:E.number(),y:E.number()}),is_crossing:E.boolean().optional(),from_schematic_port_id:E.string().optional(),to_schematic_port_id:E.string().optional()})),subcircuit_id:E.string().optional(),subcircuit_connectivity_map_key:E.string().optional()}),r1r=E.enum(["center","left","right","top","bottom"]),Con=E.object({type:E.literal("schematic_text"),schematic_component_id:E.string().optional(),schematic_symbol_id:E.string().optional(),schematic_text_id:E.string(),text:E.string(),font_size:E.number().default(0.18),position:E.object({x:Xn,y:Xn}),rotation:E.number().default(0),anchor:E.union([r1r.describe("legacy"),Hw]).default("center"),color:E.string().default("#000000"),subcircuit_id:E.string().optional()}),bon=E.object({type:E.literal("schematic_port"),schematic_port_id:E.string(),source_port_id:E.string(),schematic_component_id:E.string().optional(),center:Xr,facing_direction:E.enum(["up","down","left","right"]).optional(),distance_from_component_edge:E.number().optional(),side_of_component:E.enum(["top","bottom","left","right"]).optional(),true_ccw_index:E.number().optional(),pin_number:E.number().optional(),display_pin_label:E.string().optional(),subcircuit_id:E.string().optional(),is_connected:E.boolean().optional(),has_input_arrow:E.boolean().optional(),has_output_arrow:E.boolean().optional(),is_drawn_with_inversion_circle:E.boolean().optional()}).describe("Defines a port on a schematic component"),Ion=E.object({type:E.literal("schematic_net_label"),schematic_net_label_id:mo("schematic_net_label"),schematic_trace_id:E.string().optional(),source_trace_id:E.string().optional(),source_net_id:E.string(),center:Xr,anchor_position:Xr.optional(),anchor_side:E.enum(["top","bottom","left","right"]),text:E.string(),symbol_name:E.string().optional(),is_movable:E.boolean().optional(),subcircuit_id:E.string().optional()}),von=Jl.extend({type:E.literal("schematic_error"),schematic_error_id:E.string(),error_type:E.literal("schematic_port_not_found").default("schematic_port_not_found"),subcircuit_id:E.string().optional()}).describe("Defines a schematic error on the schematic"),Son=Jl.extend({type:E.literal("schematic_layout_error"),schematic_layout_error_id:mo("schematic_layout_error"),error_type:E.literal("schematic_layout_error").default("schematic_layout_error"),source_group_id:E.string(),schematic_group_id:E.string(),subcircuit_id:E.string().optional()}).describe("Error emitted when schematic layout fails for a group"),a6e=E.object({type:E.literal("schematic_debug_object"),label:E.string().optional(),subcircuit_id:E.string().optional()}),Pon=a6e.extend({shape:E.literal("rect"),center:Xr,size:tJe}),Eon=a6e.extend({shape:E.literal("line"),start:Xr,end:Xr}),Mon=a6e.extend({shape:E.literal("point"),center:Xr}),won=E.discriminatedUnion("shape",[Pon,Eon,Mon]),Bon=E.object({type:E.literal("schematic_voltage_probe"),schematic_voltage_probe_id:E.string(),source_component_id:E.string().optional(),name:E.string().optional(),position:Xr,schematic_trace_id:E.string(),voltage:ww.optional(),subcircuit_id:E.string().optional(),color:E.string().optional(),label_alignment:Hw.optional()}).describe("Defines a voltage probe measurement point on a schematic trace"),Ton=E.object({type:E.literal("schematic_manual_edit_conflict_warning"),schematic_manual_edit_conflict_warning_id:mo("schematic_manual_edit_conflict_warning"),warning_type:E.literal("schematic_manual_edit_conflict_warning").default("schematic_manual_edit_conflict_warning"),message:E.string(),schematic_component_id:E.string(),schematic_group_id:E.string().optional(),subcircuit_id:E.string().optional(),source_component_id:E.string()}).describe("Warning emitted when a component has both manual placement and explicit schX/schY coordinates"),Don=E.object({type:E.literal("schematic_group"),schematic_group_id:mo("schematic_group"),source_group_id:E.string(),is_subcircuit:E.boolean().optional(),subcircuit_id:E.string().optional(),width:ar,height:ar,center:Xr,schematic_component_ids:E.array(E.string()),show_as_schematic_box:E.boolean().optional(),name:E.string().optional(),description:E.string().optional()}).describe("Defines a group of components on the schematic"),Non=E.object({type:E.literal("schematic_table"),schematic_table_id:mo("schematic_table"),anchor_position:Xr,column_widths:E.array(Xn),row_heights:E.array(Xn),cell_padding:Xn.optional(),border_width:Xn.optional(),subcircuit_id:E.string().optional(),schematic_component_id:E.string().optional(),anchor:Hw.optional()}).describe("Defines a table on the schematic"),Ron=E.object({type:E.literal("schematic_table_cell"),schematic_table_cell_id:mo("schematic_table_cell"),schematic_table_id:E.string(),start_row_index:E.number(),end_row_index:E.number(),start_column_index:E.number(),end_column_index:E.number(),text:E.string().optional(),center:Xr,width:Xn,height:Xn,horizontal_align:E.enum(["left","center","right"]).optional(),vertical_align:E.enum(["top","middle","bottom"]).optional(),font_size:Xn.optional(),subcircuit_id:E.string().optional()}).describe("Defines a cell within a schematic_table"),Qon=E.object({type:E.literal("schematic_sheet"),schematic_sheet_id:mo("schematic_sheet"),name:E.string().optional(),subcircuit_id:E.string().optional()}).describe("Defines a schematic sheet or page that components can be placed on"),kon=E.object({x:Xn,y:Xn,bulge:E.number().optional()}),qje=E.object({vertices:E.array(kon)}),Lon=E.object({outer_ring:qje,inner_rings:E.array(qje).default([])}),Hon=E.object({x:Xn,y:Xn,via:E.boolean().optional(),via_to_layer:mc.optional()}),i1r=E.array(Hon),Fon=E.object({x:Xn,y:Xn,via:E.boolean().optional(),to_layer:mc.optional(),trace_width:Xn.optional()}),zon=E.object({min_trace_width:ar.optional(),min_board_edge_clearance:ar.optional(),min_via_hole_edge_to_via_hole_edge_clearance:ar.optional(),min_plated_hole_drill_edge_to_drill_edge_clearance:ar.optional(),min_trace_to_pad_edge_clearance:ar.optional(),min_pad_edge_to_pad_edge_clearance:ar.optional(),min_same_net_trace_edge_to_trace_edge_clearance:ar.optional(),min_different_net_trace_edge_to_trace_edge_clearance:ar.optional(),min_via_hole_diameter:ar.optional(),min_via_pad_diameter:ar.optional()}),Oon=E.object({type:E.literal("pcb_component"),pcb_component_id:mo("pcb_component"),source_component_id:E.string(),center:Xr,layer:mc,rotation:gm,display_offset_x:E.string().optional().describe("How to display the x offset for this part, usually corresponding with how the user specified it"),display_offset_y:E.string().optional().describe("How to display the y offset for this part, usually corresponding with how the user specified it"),width:ar,height:ar,do_not_place:E.boolean().optional(),is_allowed_to_be_off_board:E.boolean().optional(),subcircuit_id:E.string().optional(),pcb_group_id:E.string().optional(),position_mode:E.enum(["packed","relative_to_group_anchor","relative_to_another_component","none"]).optional(),anchor_position:Xr.optional(),anchor_alignment:Hw.optional(),positioned_relative_to_pcb_group_id:E.string().optional(),positioned_relative_to_pcb_board_id:E.string().optional(),cable_insertion_center:Xr.optional(),insertion_direction:E.enum(["from_above","from_left","from_right","from_front","from_back"]).optional(),metadata:E.object({kicad_footprint:wnn.optional()}).optional(),obstructs_within_bounds:E.boolean().default(!0).describe("Does this component take up all the space within its bounds on a layer. This is generally true except for when separated pin headers are being represented by a single component (in which case, chips can be placed between the pin headers) or for tall modules where chips fit underneath")}).describe("Defines a component on the PCB"),Von=E.object({type:E.literal("pcb_hole"),pcb_hole_id:mo("pcb_hole"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),pcb_component_id:E.string().optional(),hole_shape:E.literal("circle"),hole_diameter:E.number(),x:Xn,y:Xn,is_covered_with_solder_mask:E.boolean().optional(),soldermask_margin:E.number().optional()}),s1r=Von.describe("Defines a circular hole on the PCB"),Yon=E.object({type:E.literal("pcb_hole"),pcb_hole_id:mo("pcb_hole"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),pcb_component_id:E.string().optional(),hole_shape:E.literal("rect"),hole_width:E.number(),hole_height:E.number(),x:Xn,y:Xn,is_covered_with_solder_mask:E.boolean().optional(),soldermask_margin:E.number().optional()}),a1r=Yon.describe("Defines a rectangular (square-capable) hole on the PCB. Use equal width/height for square."),Gon=E.object({type:E.literal("pcb_hole"),pcb_hole_id:mo("pcb_hole"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),pcb_component_id:E.string().optional(),hole_shape:E.enum(["circle","square"]),hole_diameter:E.number(),x:Xn,y:Xn,is_covered_with_solder_mask:E.boolean().optional(),soldermask_margin:E.number().optional()}),c1r=Gon.describe("Defines a circular or square hole on the PCB"),Uon=E.object({type:E.literal("pcb_hole"),pcb_hole_id:mo("pcb_hole"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),pcb_component_id:E.string().optional(),hole_shape:E.literal("oval"),hole_width:E.number(),hole_height:E.number(),x:Xn,y:Xn,is_covered_with_solder_mask:E.boolean().optional(),soldermask_margin:E.number().optional()}),l1r=Uon.describe("Defines an oval hole on the PCB"),Won=E.object({type:E.literal("pcb_hole"),pcb_hole_id:mo("pcb_hole"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),pcb_component_id:E.string().optional(),hole_shape:E.literal("pill"),hole_width:E.number(),hole_height:E.number(),x:Xn,y:Xn,is_covered_with_solder_mask:E.boolean().optional(),soldermask_margin:E.number().optional()}),h1r=Won.describe("Defines a pill-shaped hole on the PCB"),Xon=E.object({type:E.literal("pcb_hole"),pcb_hole_id:mo("pcb_hole"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),pcb_component_id:E.string().optional(),hole_shape:E.literal("rotated_pill"),hole_width:E.number(),hole_height:E.number(),x:Xn,y:Xn,ccw_rotation:gm,is_covered_with_solder_mask:E.boolean().optional(),soldermask_margin:E.number().optional()}),d1r=Xon.describe("Defines a rotated pill-shaped hole on the PCB"),jon=Gon.or(Uon).or(Won).or(Xon).or(Von).or(Yon),u1r=E.object({type:E.literal("pcb_plated_hole"),shape:E.literal("circle"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),outer_diameter:E.number(),hole_diameter:E.number(),is_covered_with_solder_mask:E.boolean().optional(),x:Xn,y:Xn,layers:E.array(mc),port_hints:E.array(E.string()).optional(),pcb_component_id:E.string().optional(),pcb_port_id:E.string().optional(),pcb_plated_hole_id:mo("pcb_plated_hole"),soldermask_margin:E.number().optional()}),p1r=E.object({type:E.literal("pcb_plated_hole"),shape:E.enum(["oval","pill"]),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),outer_width:E.number(),outer_height:E.number(),hole_width:E.number(),hole_height:E.number(),is_covered_with_solder_mask:E.boolean().optional(),x:Xn,y:Xn,ccw_rotation:gm,layers:E.array(mc),port_hints:E.array(E.string()).optional(),pcb_component_id:E.string().optional(),pcb_port_id:E.string().optional(),pcb_plated_hole_id:mo("pcb_plated_hole"),soldermask_margin:E.number().optional()}),m1r=E.object({type:E.literal("pcb_plated_hole"),shape:E.literal("circular_hole_with_rect_pad"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),hole_shape:E.literal("circle"),pad_shape:E.literal("rect"),hole_diameter:E.number(),rect_pad_width:E.number(),rect_pad_height:E.number(),rect_border_radius:E.number().optional(),hole_offset_x:Xn.default(0),hole_offset_y:Xn.default(0),is_covered_with_solder_mask:E.boolean().optional(),x:Xn,y:Xn,layers:E.array(mc),port_hints:E.array(E.string()).optional(),pcb_component_id:E.string().optional(),pcb_port_id:E.string().optional(),pcb_plated_hole_id:mo("pcb_plated_hole"),soldermask_margin:E.number().optional(),rect_ccw_rotation:gm.optional()}),_1r=E.object({type:E.literal("pcb_plated_hole"),shape:E.literal("pill_hole_with_rect_pad"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),hole_shape:E.literal("pill"),pad_shape:E.literal("rect"),hole_width:E.number(),hole_height:E.number(),rect_pad_width:E.number(),rect_pad_height:E.number(),rect_border_radius:E.number().optional(),hole_offset_x:Xn.default(0),hole_offset_y:Xn.default(0),is_covered_with_solder_mask:E.boolean().optional(),x:Xn,y:Xn,layers:E.array(mc),port_hints:E.array(E.string()).optional(),pcb_component_id:E.string().optional(),pcb_port_id:E.string().optional(),pcb_plated_hole_id:mo("pcb_plated_hole"),soldermask_margin:E.number().optional()}),g1r=E.object({type:E.literal("pcb_plated_hole"),shape:E.literal("rotated_pill_hole_with_rect_pad"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),hole_shape:E.literal("rotated_pill"),pad_shape:E.literal("rect"),hole_width:E.number(),hole_height:E.number(),hole_ccw_rotation:gm,rect_pad_width:E.number(),rect_pad_height:E.number(),rect_border_radius:E.number().optional(),rect_ccw_rotation:gm,hole_offset_x:Xn.default(0),hole_offset_y:Xn.default(0),is_covered_with_solder_mask:E.boolean().optional(),x:Xn,y:Xn,layers:E.array(mc),port_hints:E.array(E.string()).optional(),pcb_component_id:E.string().optional(),pcb_port_id:E.string().optional(),pcb_plated_hole_id:mo("pcb_plated_hole"),soldermask_margin:E.number().optional()}),A1r=E.object({type:E.literal("pcb_plated_hole"),shape:E.literal("hole_with_polygon_pad"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),hole_shape:E.enum(["circle","oval","pill","rotated_pill"]),hole_diameter:E.number().optional(),hole_width:E.number().optional(),hole_height:E.number().optional(),pad_outline:E.array(E.object({x:Xn,y:Xn})).min(3),hole_offset_x:Xn.default(0),hole_offset_y:Xn.default(0),is_covered_with_solder_mask:E.boolean().optional(),x:Xn,y:Xn,layers:E.array(mc),port_hints:E.array(E.string()).optional(),pcb_component_id:E.string().optional(),pcb_port_id:E.string().optional(),pcb_plated_hole_id:mo("pcb_plated_hole"),soldermask_margin:E.number().optional(),ccw_rotation:gm.optional()}),Kon=E.union([u1r,p1r,m1r,_1r,g1r,A1r]),$on=E.object({type:E.literal("pcb_port"),pcb_port_id:mo("pcb_port"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),source_port_id:E.string(),pcb_component_id:E.string().optional(),x:Xn,y:Xn,layers:E.array(mc),is_board_pinout:E.boolean().optional()}).describe("Defines a port on the PCB"),f1r=E.object({type:E.literal("pcb_smtpad"),shape:E.literal("circle"),pcb_smtpad_id:mo("pcb_smtpad"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),x:Xn,y:Xn,radius:E.number(),layer:mc,port_hints:E.array(E.string()).optional(),pcb_component_id:E.string().optional(),pcb_port_id:E.string().optional(),is_covered_with_solder_mask:E.boolean().optional(),soldermask_margin:E.number().optional()}),y1r=E.object({type:E.literal("pcb_smtpad"),shape:E.literal("rect"),pcb_smtpad_id:mo("pcb_smtpad"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),x:Xn,y:Xn,width:E.number(),height:E.number(),rect_border_radius:E.number().optional(),corner_radius:E.number().optional(),layer:mc,port_hints:E.array(E.string()).optional(),pcb_component_id:E.string().optional(),pcb_port_id:E.string().optional(),is_covered_with_solder_mask:E.boolean().optional(),soldermask_margin:E.number().optional(),soldermask_margin_left:E.number().optional(),soldermask_margin_top:E.number().optional(),soldermask_margin_right:E.number().optional(),soldermask_margin_bottom:E.number().optional()}),x1r=E.object({type:E.literal("pcb_smtpad"),shape:E.literal("rotated_rect"),pcb_smtpad_id:mo("pcb_smtpad"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),x:Xn,y:Xn,width:E.number(),height:E.number(),rect_border_radius:E.number().optional(),corner_radius:E.number().optional(),ccw_rotation:gm,layer:mc,port_hints:E.array(E.string()).optional(),pcb_component_id:E.string().optional(),pcb_port_id:E.string().optional(),is_covered_with_solder_mask:E.boolean().optional(),soldermask_margin:E.number().optional(),soldermask_margin_left:E.number().optional(),soldermask_margin_top:E.number().optional(),soldermask_margin_right:E.number().optional(),soldermask_margin_bottom:E.number().optional()}),qon=E.object({type:E.literal("pcb_smtpad"),shape:E.literal("pill"),pcb_smtpad_id:mo("pcb_smtpad"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),x:Xn,y:Xn,width:E.number(),height:E.number(),radius:E.number(),layer:mc,port_hints:E.array(E.string()).optional(),pcb_component_id:E.string().optional(),pcb_port_id:E.string().optional(),is_covered_with_solder_mask:E.boolean().optional(),soldermask_margin:E.number().optional()}),C1r=E.object({type:E.literal("pcb_smtpad"),shape:E.literal("rotated_pill"),pcb_smtpad_id:mo("pcb_smtpad"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),x:Xn,y:Xn,width:E.number(),height:E.number(),radius:E.number(),ccw_rotation:gm,layer:mc,port_hints:E.array(E.string()).optional(),pcb_component_id:E.string().optional(),pcb_port_id:E.string().optional(),is_covered_with_solder_mask:E.boolean().optional(),soldermask_margin:E.number().optional()}),b1r=E.object({type:E.literal("pcb_smtpad"),shape:E.literal("polygon"),pcb_smtpad_id:mo("pcb_smtpad"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),points:E.array(Xr),layer:mc,port_hints:E.array(E.string()).optional(),pcb_component_id:E.string().optional(),pcb_port_id:E.string().optional(),is_covered_with_solder_mask:E.boolean().optional(),soldermask_margin:E.number().optional()}),Jon=E.discriminatedUnion("shape",[f1r,y1r,x1r,C1r,qon,b1r]).describe("Defines an SMT pad on the PCB"),I1r=E.object({type:E.literal("pcb_solder_paste"),shape:E.literal("circle"),pcb_solder_paste_id:mo("pcb_solder_paste"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),x:Xn,y:Xn,radius:E.number(),layer:mc,pcb_component_id:E.string().optional(),pcb_smtpad_id:E.string().optional()}),v1r=E.object({type:E.literal("pcb_solder_paste"),shape:E.literal("rect"),pcb_solder_paste_id:mo("pcb_solder_paste"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),x:Xn,y:Xn,width:E.number(),height:E.number(),layer:mc,pcb_component_id:E.string().optional(),pcb_smtpad_id:E.string().optional()}),S1r=E.object({type:E.literal("pcb_solder_paste"),shape:E.literal("pill"),pcb_solder_paste_id:mo("pcb_solder_paste"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),x:Xn,y:Xn,width:E.number(),height:E.number(),radius:E.number(),layer:mc,pcb_component_id:E.string().optional(),pcb_smtpad_id:E.string().optional()}),P1r=E.object({type:E.literal("pcb_solder_paste"),shape:E.literal("rotated_rect"),pcb_solder_paste_id:mo("pcb_solder_paste"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),x:Xn,y:Xn,width:E.number(),height:E.number(),ccw_rotation:Xn,layer:mc,pcb_component_id:E.string().optional(),pcb_smtpad_id:E.string().optional()}),E1r=E.object({type:E.literal("pcb_solder_paste"),shape:E.literal("oval"),pcb_solder_paste_id:mo("pcb_solder_paste"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),x:Xn,y:Xn,width:E.number(),height:E.number(),layer:mc,pcb_component_id:E.string().optional(),pcb_smtpad_id:E.string().optional()}),Zon=E.union([I1r,v1r,S1r,P1r,E1r]).describe("Defines solderpaste on the PCB"),ern=E.object({type:E.literal("pcb_text"),pcb_text_id:mo("pcb_text"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),text:E.string(),center:Xr,layer:mc,width:ar,height:ar,lines:E.number(),align:E.enum(["bottom-left"])}).describe("Defines text on the PCB"),trn=E.object({route_type:E.literal("wire"),x:Xn,y:Xn,width:Xn,copper_pour_id:E.string().optional(),is_inside_copper_pour:E.boolean().optional(),start_pcb_port_id:E.string().optional(),end_pcb_port_id:E.string().optional(),layer:mc}),nrn=E.object({route_type:E.literal("via"),x:Xn,y:Xn,copper_pour_id:E.string().optional(),is_inside_copper_pour:E.boolean().optional(),hole_diameter:Xn.optional(),outer_diameter:Xn.optional(),from_layer:mc,to_layer:mc}),orn=E.union([trn,nrn]),rrn=E.object({type:E.literal("pcb_trace"),source_trace_id:E.string().optional(),pcb_component_id:E.string().optional(),pcb_trace_id:mo("pcb_trace"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),route_thickness_mode:E.enum(["constant","interpolated"]).default("constant").optional(),route_order_index:E.number().optional(),should_round_corners:E.boolean().optional(),trace_length:E.number().optional(),highlight_color:E.string().optional(),route:E.array(orn)}).describe("Defines a trace on the PCB"),irn=E.object({type:E.literal("pcb_trace_warning"),pcb_trace_warning_id:mo("pcb_trace_warning"),warning_type:E.literal("pcb_trace_warning").default("pcb_trace_warning"),message:E.string(),center:Xr.optional(),pcb_trace_id:E.string(),source_trace_id:E.string(),pcb_component_ids:E.array(E.string()),pcb_port_ids:E.array(E.string()),subcircuit_id:E.string().optional()}).describe("Defines a trace warning on the PCB"),srn=Jl.extend({type:E.literal("pcb_trace_error"),pcb_trace_error_id:mo("pcb_trace_error"),error_type:E.literal("pcb_trace_error").default("pcb_trace_error"),center:Xr.optional(),pcb_trace_id:E.string(),source_trace_id:E.string(),pcb_component_ids:E.array(E.string()),pcb_port_ids:E.array(E.string()),subcircuit_id:E.string().optional()}).describe("Defines a trace error on the PCB"),arn=Jl.extend({type:E.literal("pcb_trace_missing_error"),pcb_trace_missing_error_id:mo("pcb_trace_missing_error"),error_type:E.literal("pcb_trace_missing_error").default("pcb_trace_missing_error"),center:Xr.optional(),source_trace_id:E.string(),pcb_component_ids:E.array(E.string()),pcb_port_ids:E.array(E.string()),subcircuit_id:E.string().optional()}).describe("Defines an error when a source trace has no corresponding PCB trace"),crn=Jl.extend({type:E.literal("pcb_port_not_matched_error"),pcb_error_id:mo("pcb_error"),error_type:E.literal("pcb_port_not_matched_error").default("pcb_port_not_matched_error"),pcb_component_ids:E.array(E.string()),subcircuit_id:E.string().optional()}).describe("Defines a trace error on the PCB where a port is not matched"),lrn=Jl.extend({type:E.literal("pcb_port_not_connected_error"),pcb_port_not_connected_error_id:mo("pcb_port_not_connected_error"),error_type:E.literal("pcb_port_not_connected_error").default("pcb_port_not_connected_error"),pcb_port_ids:E.array(E.string()),pcb_component_ids:E.array(E.string()),subcircuit_id:E.string().optional()}).describe("Defines an error when a pcb port is not connected to any trace"),hrn=E.object({type:E.literal("pcb_net"),pcb_net_id:mo("pcb_net"),source_net_id:E.string().optional(),highlight_color:E.string().optional()}).describe("Defines a net on the PCB"),drn=E.object({type:E.literal("pcb_via"),pcb_via_id:mo("pcb_via"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),subcircuit_connectivity_map_key:E.string().optional(),x:Xn,y:Xn,outer_diameter:Xn.default("0.6mm"),hole_diameter:Xn.default("0.25mm"),from_layer:mc.optional(),to_layer:mc.optional(),layers:E.array(mc),pcb_trace_id:E.string().optional(),net_is_assignable:E.boolean().optional(),net_assigned:E.boolean().optional(),is_tented:E.boolean().optional()}).describe("Defines a via on the PCB"),urn=E.object({type:E.literal("pcb_board"),pcb_board_id:mo("pcb_board"),pcb_panel_id:E.string().optional(),carrier_pcb_board_id:E.string().optional(),is_subcircuit:E.boolean().optional(),subcircuit_id:E.string().optional(),is_mounted_to_carrier_board:E.boolean().optional(),width:ar.optional(),height:ar.optional(),center:Xr,display_offset_x:E.string().optional().describe("How to display the x offset for this board, usually corresponding with how the user specified it"),display_offset_y:E.string().optional().describe("How to display the y offset for this board, usually corresponding with how the user specified it"),thickness:ar.optional().default(1.4),num_layers:E.number().optional().default(4),outline:E.array(Xr).optional(),shape:E.enum(["rect","polygon"]).optional(),material:E.enum(["fr4","fr1"]).default("fr4"),anchor_position:Xr.optional(),anchor_alignment:Hw.optional(),position_mode:E.enum(["relative_to_panel_anchor","none"]).optional()}).merge(zon).describe("Defines the board outline of the PCB"),prn=E.object({type:E.literal("pcb_panel"),pcb_panel_id:mo("pcb_panel"),width:ar,height:ar,center:Xr,thickness:ar.optional().default(1.4),covered_with_solder_mask:E.boolean().optional().default(!0)}).describe("Defines a PCB panel that can contain multiple boards"),mrn=Jl.extend({type:E.literal("pcb_placement_error"),pcb_placement_error_id:mo("pcb_placement_error"),error_type:E.literal("pcb_placement_error").default("pcb_placement_error"),subcircuit_id:E.string().optional()}).describe("Defines a placement error on the PCB"),_rn=Jl.extend({type:E.literal("pcb_panelization_placement_error"),pcb_panelization_placement_error_id:mo("pcb_panelization_placement_error"),error_type:E.literal("pcb_panelization_placement_error").default("pcb_panelization_placement_error"),pcb_panel_id:E.string().optional(),pcb_board_id:E.string().optional(),subcircuit_id:E.string().optional()}).describe("Defines a panelization placement error on the PCB"),grn=E.object({type:E.literal("pcb_trace_hint"),pcb_trace_hint_id:mo("pcb_trace_hint"),pcb_port_id:E.string(),pcb_component_id:E.string(),route:E.array(Fon),subcircuit_id:E.string().optional()}).describe("A hint that can be used during generation of a PCB trace"),Arn=E.object({type:E.literal("pcb_silkscreen_line"),pcb_silkscreen_line_id:mo("pcb_silkscreen_line"),pcb_component_id:E.string(),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),stroke_width:Xn.default("0.1mm"),x1:Xn,y1:Xn,x2:Xn,y2:Xn,layer:Bf}).describe("Defines a silkscreen line on the PCB"),frn=E.object({type:E.literal("pcb_silkscreen_path"),pcb_silkscreen_path_id:mo("pcb_silkscreen_path"),pcb_component_id:E.string(),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),layer:Bf,route:E.array(Xr),stroke_width:ar}).describe("Defines a silkscreen path on the PCB"),yrn=E.object({type:E.literal("pcb_silkscreen_text"),pcb_silkscreen_text_id:mo("pcb_silkscreen_text"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),font:E.literal("tscircuit2024").default("tscircuit2024"),font_size:Xn.default("0.2mm"),pcb_component_id:E.string(),text:E.string(),is_knockout:E.boolean().default(!1).optional(),knockout_padding:E.object({left:ar,top:ar,bottom:ar,right:ar}).default({left:"0.2mm",top:"0.2mm",bottom:"0.2mm",right:"0.2mm"}).optional(),ccw_rotation:E.number().optional(),layer:mc,is_mirrored:E.boolean().default(!1).optional(),anchor_position:Xr.default({x:0,y:0}),anchor_alignment:Hw.default("center")}).describe("Defines silkscreen text on the PCB"),xrn=E.object({type:E.literal("pcb_copper_text"),pcb_copper_text_id:mo("pcb_copper_text"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),font:E.literal("tscircuit2024").default("tscircuit2024"),font_size:Xn.default("0.2mm"),pcb_component_id:E.string(),text:E.string(),is_knockout:E.boolean().default(!1).optional(),knockout_padding:E.object({left:ar,top:ar,bottom:ar,right:ar}).default({left:"0.2mm",top:"0.2mm",bottom:"0.2mm",right:"0.2mm"}).optional(),ccw_rotation:E.number().optional(),layer:mc,is_mirrored:E.boolean().default(!1).optional(),anchor_position:Xr.default({x:0,y:0}),anchor_alignment:Hw.default("center")}).describe("Defines copper text on the PCB"),Crn=E.object({type:E.literal("pcb_silkscreen_rect"),pcb_silkscreen_rect_id:mo("pcb_silkscreen_rect"),pcb_component_id:E.string(),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),center:Xr,width:ar,height:ar,layer:mc,stroke_width:ar.default("1mm"),corner_radius:ar.optional(),is_filled:E.boolean().default(!0).optional(),has_stroke:E.boolean().optional(),is_stroke_dashed:E.boolean().optional(),ccw_rotation:E.number().optional()}).describe("Defines a silkscreen rect on the PCB"),brn=E.object({type:E.literal("pcb_silkscreen_circle"),pcb_silkscreen_circle_id:mo("pcb_silkscreen_circle"),pcb_component_id:E.string(),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),center:Xr,radius:ar,layer:Bf,stroke_width:ar.default("1mm"),is_filled:E.boolean().optional()}).describe("Defines a silkscreen circle on the PCB"),Irn=E.object({type:E.literal("pcb_silkscreen_oval"),pcb_silkscreen_oval_id:mo("pcb_silkscreen_oval"),pcb_component_id:E.string(),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),center:Xr,radius_x:Xn,radius_y:Xn,layer:Bf,ccw_rotation:gm.optional()}).describe("Defines a silkscreen oval on the PCB"),vrn=E.object({type:E.literal("pcb_silkscreen_pill"),pcb_silkscreen_pill_id:mo("pcb_silkscreen_pill"),pcb_component_id:E.string(),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),center:Xr,width:ar,height:ar,layer:mc,ccw_rotation:E.number().optional()}).describe("Defines a silkscreen pill on the PCB"),Srn=E.object({type:E.literal("pcb_fabrication_note_text"),pcb_fabrication_note_text_id:mo("pcb_fabrication_note_text"),subcircuit_id:E.string().optional(),pcb_group_id:E.string().optional(),font:E.literal("tscircuit2024").default("tscircuit2024"),font_size:Xn.default("1mm"),pcb_component_id:E.string(),text:E.string(),layer:Bf,anchor_position:Xr.default({x:0,y:0}),anchor_alignment:E.enum(["center","top_left","top_right","bottom_left","bottom_right"]).default("center"),color:E.string().optional()}).describe("Defines a fabrication note in text on the PCB, useful for leaving notes for assemblers or fabricators"),Prn=E.object({type:E.literal("pcb_fabrication_note_path"),pcb_fabrication_note_path_id:mo("pcb_fabrication_note_path"),pcb_component_id:E.string(),subcircuit_id:E.string().optional(),layer:mc,route:E.array(Xr),stroke_width:ar,color:E.string().optional()}).describe("Defines a fabrication path on the PCB for fabricators or assemblers"),Ern=E.object({type:E.literal("pcb_fabrication_note_rect"),pcb_fabrication_note_rect_id:mo("pcb_fabrication_note_rect"),pcb_component_id:E.string(),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),center:Xr,width:ar,height:ar,layer:Bf,stroke_width:ar.default("0.1mm"),corner_radius:ar.optional(),is_filled:E.boolean().optional(),has_stroke:E.boolean().optional(),is_stroke_dashed:E.boolean().optional(),color:E.string().optional()}).describe("Defines a fabrication note rectangle on the PCB"),Mrn=E.object({type:E.literal("pcb_fabrication_note_dimension"),pcb_fabrication_note_dimension_id:mo("pcb_fabrication_note_dimension"),pcb_component_id:E.string(),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),layer:Bf,from:Xr,to:Xr,text:E.string().optional(),text_ccw_rotation:E.number().optional(),offset:ar.optional(),offset_distance:ar.optional(),offset_direction:E.object({x:E.number(),y:E.number()}).optional(),font:E.literal("tscircuit2024").default("tscircuit2024"),font_size:ar.default("1mm"),color:E.string().optional(),arrow_size:ar.default("1mm")}).describe("Defines a measurement annotation within PCB fabrication notes"),wrn=E.object({type:E.literal("pcb_note_text"),pcb_note_text_id:mo("pcb_note_text"),pcb_component_id:E.string().optional(),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),name:E.string().optional(),font:E.literal("tscircuit2024").default("tscircuit2024"),font_size:Xn.default("1mm"),text:E.string().optional(),anchor_position:Xr.default({x:0,y:0}),anchor_alignment:E.enum(["center","top_left","top_right","bottom_left","bottom_right"]).default("center"),layer:Bf.default("top"),is_mirrored_from_top_view:E.boolean().optional(),color:E.string().optional()}).describe("Defines a documentation note in text on the PCB"),Brn=E.object({type:E.literal("pcb_note_rect"),pcb_note_rect_id:mo("pcb_note_rect"),pcb_component_id:E.string().optional(),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),name:E.string().optional(),text:E.string().optional(),center:Xr,width:ar,height:ar,layer:Bf.default("top"),stroke_width:ar.default("0.1mm"),corner_radius:ar.optional(),is_filled:E.boolean().optional(),has_stroke:E.boolean().optional(),is_stroke_dashed:E.boolean().optional(),color:E.string().optional()}).describe("Defines a rectangular documentation note on the PCB"),Trn=E.object({type:E.literal("pcb_note_path"),pcb_note_path_id:mo("pcb_note_path"),pcb_component_id:E.string().optional(),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),name:E.string().optional(),text:E.string().optional(),route:E.array(Xr),layer:Bf.default("top"),stroke_width:ar.default("0.1mm"),color:E.string().optional()}).describe("Defines a polyline documentation note on the PCB"),Drn=E.object({type:E.literal("pcb_note_line"),pcb_note_line_id:mo("pcb_note_line"),pcb_component_id:E.string().optional(),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),name:E.string().optional(),text:E.string().optional(),x1:Xn,y1:Xn,x2:Xn,y2:Xn,layer:Bf.default("top"),stroke_width:Xn.default("0.1mm"),color:E.string().optional(),is_dashed:E.boolean().optional()}).describe("Defines a straight documentation note line on the PCB"),Nrn=E.object({type:E.literal("pcb_note_dimension"),pcb_note_dimension_id:mo("pcb_note_dimension"),pcb_component_id:E.string().optional(),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),name:E.string().optional(),from:Xr,to:Xr,text:E.string().optional(),text_ccw_rotation:E.number().optional(),offset_distance:ar.optional(),offset_direction:E.object({x:E.number(),y:E.number()}).optional(),font:E.literal("tscircuit2024").default("tscircuit2024"),font_size:ar.default("1mm"),layer:Bf.default("top"),color:E.string().optional(),arrow_size:ar.default("1mm")}).describe("Defines a measurement annotation within PCB documentation notes"),Rrn=Jl.extend({type:E.literal("pcb_footprint_overlap_error"),pcb_error_id:mo("pcb_error"),error_type:E.literal("pcb_footprint_overlap_error").default("pcb_footprint_overlap_error"),pcb_smtpad_ids:E.array(E.string()).optional(),pcb_plated_hole_ids:E.array(E.string()).optional(),pcb_hole_ids:E.array(E.string()).optional(),pcb_keepout_ids:E.array(E.string()).optional()}).describe("Error emitted when a pcb footprint overlaps with another element"),Qrn=Jl.extend({type:E.literal("pcb_courtyard_overlap_error"),pcb_error_id:mo("pcb_error"),error_type:E.literal("pcb_courtyard_overlap_error").default("pcb_courtyard_overlap_error"),pcb_component_ids:E.tuple([E.string(),E.string()])}).describe("Error emitted when the courtyard (CrtYd) of one PCB component overlaps with the courtyard of another"),krn=E.object({type:E.literal("pcb_keepout"),shape:E.literal("rect"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),center:Xr,width:Xn,height:Xn,pcb_keepout_id:E.string(),layers:E.array(E.string()),description:E.string().optional()}).or(E.object({type:E.literal("pcb_keepout"),shape:E.literal("circle"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),center:Xr,radius:Xn,pcb_keepout_id:E.string(),layers:E.array(E.string()),description:E.string().optional()})),c6e=E.object({type:E.literal("pcb_cutout"),pcb_cutout_id:mo("pcb_cutout"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),pcb_board_id:E.string().optional(),pcb_panel_id:E.string().optional()}),Lrn=c6e.extend({shape:E.literal("rect"),center:Xr,width:ar,height:ar,rotation:gm.optional(),corner_radius:ar.optional()}),Hrn=c6e.extend({shape:E.literal("circle"),center:Xr,radius:ar}),Frn=c6e.extend({shape:E.literal("polygon"),points:E.array(Xr)}),zrn=c6e.extend({shape:E.literal("path"),route:E.array(Xr),slot_width:ar,slot_length:ar.optional(),space_between_slots:ar.optional(),slot_corner_radius:ar.optional()}),Orn=E.discriminatedUnion("shape",[Lrn,Hrn,Frn,zrn]).describe("Defines a cutout on the PCB, removing board material."),Vrn=Jl.extend({type:E.literal("pcb_missing_footprint_error"),pcb_missing_footprint_error_id:mo("pcb_missing_footprint_error"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),error_type:E.literal("pcb_missing_footprint_error").default("pcb_missing_footprint_error"),source_component_id:E.string()}).describe("Defines a missing footprint error on the PCB"),Yrn=Jl.extend({type:E.literal("external_footprint_load_error"),external_footprint_load_error_id:mo("external_footprint_load_error"),pcb_component_id:E.string(),source_component_id:E.string(),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),footprinter_string:E.string().optional(),error_type:E.literal("external_footprint_load_error").default("external_footprint_load_error")}).describe("Defines an error when an external footprint fails to load"),Grn=Jl.extend({type:E.literal("circuit_json_footprint_load_error"),circuit_json_footprint_load_error_id:mo("circuit_json_footprint_load_error"),pcb_component_id:E.string(),source_component_id:E.string(),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),error_type:E.literal("circuit_json_footprint_load_error").default("circuit_json_footprint_load_error"),circuit_json:E.array(E.any()).optional()}).describe("Defines an error when a circuit JSON footprint fails to load"),Urn=E.object({type:E.literal("pcb_group"),pcb_group_id:mo("pcb_group"),source_group_id:E.string(),is_subcircuit:E.boolean().optional(),subcircuit_id:E.string().optional(),width:ar.optional(),height:ar.optional(),center:Xr,display_offset_x:E.string().optional().describe("How to display the x offset for this group, usually corresponding with how the user specified it"),display_offset_y:E.string().optional().describe("How to display the y offset for this group, usually corresponding with how the user specified it"),outline:E.array(Xr).optional(),anchor_position:Xr.optional(),anchor_alignment:Hw.default("center"),position_mode:E.enum(["packed","relative_to_group_anchor","none"]).optional(),positioned_relative_to_pcb_group_id:E.string().optional(),positioned_relative_to_pcb_board_id:E.string().optional(),pcb_component_ids:E.array(E.string()),child_layout_mode:E.enum(["packed","none"]).optional(),name:E.string().optional(),description:E.string().optional(),layout_mode:E.string().optional(),autorouter_configuration:E.object({trace_clearance:ar}).optional(),autorouter_used_string:E.string().optional()}).describe("Defines a group of components on the PCB"),Wrn=Jl.extend({type:E.literal("pcb_autorouting_error"),pcb_error_id:mo("pcb_autorouting_error"),error_type:E.literal("pcb_autorouting_error").default("pcb_autorouting_error"),subcircuit_id:E.string().optional()}).describe("The autorouting has failed to route a portion of the board"),Xrn=E.object({type:E.literal("pcb_manual_edit_conflict_warning"),pcb_manual_edit_conflict_warning_id:mo("pcb_manual_edit_conflict_warning"),warning_type:E.literal("pcb_manual_edit_conflict_warning").default("pcb_manual_edit_conflict_warning"),message:E.string(),pcb_component_id:E.string(),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),source_component_id:E.string()}).describe("Warning emitted when a component has both manual placement and explicit pcbX/pcbY coordinates"),bOt=E.enum(["x-","x+","y+","y-"]),jrn=E.object({type:E.literal("pcb_connector_not_in_accessible_orientation_warning"),pcb_connector_not_in_accessible_orientation_warning_id:mo("pcb_connector_not_in_accessible_orientation_warning"),warning_type:E.literal("pcb_connector_not_in_accessible_orientation_warning").default("pcb_connector_not_in_accessible_orientation_warning"),message:E.string(),pcb_component_id:E.string(),source_component_id:E.string().optional(),pcb_board_id:E.string().optional(),facing_direction:bOt,recommended_facing_direction:bOt,subcircuit_id:E.string().optional()}).describe("Warning emitted when a connector PCB component is facing inward toward the board and should be reoriented to an outward-facing direction"),Krn=E.object({type:E.literal("supplier_footprint_mismatch_warning"),supplier_footprint_mismatch_warning_id:mo("supplier_footprint_mismatch_warning"),warning_type:E.literal("supplier_footprint_mismatch_warning").default("supplier_footprint_mismatch_warning"),message:E.string(),source_component_id:E.string(),pcb_component_id:E.string().optional(),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),supplier_name:oJe.optional(),supplier_part_number:E.string().optional(),supplier_footprint_url:E.string().optional(),footprint_copper_intersection_over_union:E.number()}).describe("Warning emitted when a supplier part footprint does not match the expected footprint"),$rn=E.object({type:E.literal("pcb_breakout_point"),pcb_breakout_point_id:mo("pcb_breakout_point"),pcb_group_id:E.string(),subcircuit_id:E.string().optional(),source_trace_id:E.string().optional(),source_port_id:E.string().optional(),source_net_id:E.string().optional(),x:Xn,y:Xn}).describe("Defines a routing target within a pcb_group for a source_trace or source_net"),qrn=E.object({type:E.literal("pcb_ground_plane"),pcb_ground_plane_id:mo("pcb_ground_plane"),source_pcb_ground_plane_id:E.string(),source_net_id:E.string(),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional()}).describe("Defines a ground plane on the PCB"),Jrn=E.object({type:E.literal("pcb_ground_plane_region"),pcb_ground_plane_region_id:mo("pcb_ground_plane_region"),pcb_ground_plane_id:E.string(),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),layer:mc,points:E.array(Xr)}).describe("Defines a polygon region of a ground plane"),Zrn=E.object({type:E.literal("pcb_thermal_spoke"),pcb_thermal_spoke_id:mo("pcb_thermal_spoke"),pcb_ground_plane_id:E.string(),shape:E.string(),spoke_count:E.number(),spoke_thickness:Xn,spoke_inner_diameter:Xn,spoke_outer_diameter:Xn,pcb_plated_hole_id:E.string().optional(),subcircuit_id:E.string().optional()}).describe("Pattern for connecting a ground plane to a plated hole"),EJe=E.object({type:E.literal("pcb_copper_pour"),pcb_copper_pour_id:mo("pcb_copper_pour"),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),layer:mc,source_net_id:E.string().optional(),covered_with_solder_mask:E.boolean().optional().default(!0)}),ein=EJe.extend({shape:E.literal("rect"),center:Xr,width:ar,height:ar,rotation:gm.optional()}),tin=EJe.extend({shape:E.literal("brep"),brep_shape:Lon}),nin=EJe.extend({shape:E.literal("polygon"),points:E.array(Xr)}),oin=E.discriminatedUnion("shape",[ein,tin,nin]).describe("Defines a copper pour on the PCB."),rin=Jl.extend({type:E.literal("pcb_component_outside_board_error"),pcb_component_outside_board_error_id:mo("pcb_component_outside_board_error"),error_type:E.literal("pcb_component_outside_board_error").default("pcb_component_outside_board_error"),pcb_component_id:E.string(),pcb_board_id:E.string(),component_center:Xr,component_bounds:E.object({min_x:E.number(),max_x:E.number(),min_y:E.number(),max_y:E.number()}),subcircuit_id:E.string().optional(),source_component_id:E.string().optional()}).describe("Error emitted when a PCB component is placed outside the board boundaries"),iin=Jl.extend({type:E.literal("pcb_component_not_on_board_edge_error"),pcb_component_not_on_board_edge_error_id:mo("pcb_component_not_on_board_edge_error"),error_type:E.literal("pcb_component_not_on_board_edge_error").default("pcb_component_not_on_board_edge_error"),pcb_component_id:E.string(),pcb_board_id:E.string(),component_center:Xr,pad_to_nearest_board_edge_distance:E.number(),source_component_id:E.string().optional(),subcircuit_id:E.string().optional()}).describe("Error emitted when a component that must be placed on the board edge is centered away from the edge"),sin=Jl.extend({type:E.literal("pcb_component_invalid_layer_error"),pcb_component_invalid_layer_error_id:mo("pcb_component_invalid_layer_error"),error_type:E.literal("pcb_component_invalid_layer_error").default("pcb_component_invalid_layer_error"),pcb_component_id:E.string().optional(),source_component_id:E.string(),layer:mc,subcircuit_id:E.string().optional()}).describe("Error emitted when a component is placed on an invalid layer (components can only be on 'top' or 'bottom' layers)"),ain=Jl.extend({type:E.literal("pcb_via_clearance_error"),pcb_error_id:mo("pcb_error"),error_type:E.literal("pcb_via_clearance_error").default("pcb_via_clearance_error"),pcb_via_ids:E.array(E.string()).min(2),minimum_clearance:Xn.optional(),actual_clearance:Xn.optional(),pcb_center:E.object({x:E.number().optional(),y:E.number().optional()}).optional(),subcircuit_id:E.string().optional()}).describe("Error emitted when vias are closer than the allowed clearance"),cin=Jl.extend({type:E.literal("pcb_via_trace_clearance_error"),pcb_via_trace_clearance_error_id:mo("pcb_via_trace_clearance_error"),error_type:E.literal("pcb_via_trace_clearance_error").default("pcb_via_trace_clearance_error"),pcb_via_id:E.string(),pcb_trace_id:E.string(),minimum_clearance:Xn.optional(),actual_clearance:Xn.optional(),center:E.object({x:E.number().optional(),y:E.number().optional()}).optional(),subcircuit_id:E.string().optional()}).describe("Error emitted when a via and trace are closer than the allowed clearance"),lin=Jl.extend({type:E.literal("pcb_pad_pad_clearance_error"),pcb_pad_pad_clearance_error_id:mo("pcb_pad_pad_clearance_error"),error_type:E.literal("pcb_pad_pad_clearance_error").default("pcb_pad_pad_clearance_error"),pcb_pad_ids:E.array(E.string()).min(2),minimum_clearance:Xn.optional(),actual_clearance:Xn.optional(),center:E.object({x:E.number().optional(),y:E.number().optional()}).optional(),subcircuit_id:E.string().optional()}).describe("Error emitted when pads are closer than the allowed clearance"),hin=Jl.extend({type:E.literal("pcb_pad_trace_clearance_error"),pcb_pad_trace_clearance_error_id:mo("pcb_pad_trace_clearance_error"),error_type:E.literal("pcb_pad_trace_clearance_error").default("pcb_pad_trace_clearance_error"),pcb_pad_id:E.string(),pcb_trace_id:E.string(),minimum_clearance:Xn.optional(),actual_clearance:Xn.optional(),center:E.object({x:E.number().optional(),y:E.number().optional()}).optional(),subcircuit_id:E.string().optional()}).describe("Error emitted when a pad and trace are closer than allowed clearance"),din=E.object({type:E.literal("pcb_courtyard_rect"),pcb_courtyard_rect_id:mo("pcb_courtyard_rect"),pcb_component_id:E.string(),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),center:Xr,width:ar,height:ar,layer:Bf,ccw_rotation:gm.optional(),color:E.string().optional()}).describe("Defines a courtyard rectangle on the PCB"),uin=E.object({type:E.literal("pcb_courtyard_outline"),pcb_courtyard_outline_id:mo("pcb_courtyard_outline"),pcb_component_id:E.string(),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),layer:Bf,outline:E.array(Xr).min(2)}).describe("Defines a courtyard outline on the PCB"),pin=E.object({type:E.literal("pcb_courtyard_polygon"),pcb_courtyard_polygon_id:mo("pcb_courtyard_polygon"),pcb_component_id:E.string(),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),layer:Bf,points:E.array(Xr).min(3),color:E.string().optional()}).describe("Defines a courtyard polygon on the PCB"),min=E.object({type:E.literal("pcb_courtyard_circle"),pcb_courtyard_circle_id:mo("pcb_courtyard_circle"),pcb_component_id:E.string(),pcb_group_id:E.string().optional(),subcircuit_id:E.string().optional(),center:Xr,radius:ar,layer:Bf,color:E.string().optional()}).describe("Defines a courtyard circle on the PCB"),M1r=["obj","stl","3mf","gltf","glb","step","wrl"],_in=["x+","x-","y+","y-","z+","z-"],w1r={obj:"z+",stl:"z+","3mf":"z+",gltf:"y+",glb:"y+",step:"z+",wrl:"y+"},gin=E.object({type:E.literal("cad_component"),cad_component_id:E.string(),pcb_component_id:E.string(),source_component_id:E.string(),position:gw,rotation:gw.optional(),size:gw.optional(),layer:mc.optional(),subcircuit_id:E.string().optional(),footprinter_string:E.string().optional(),model_obj_url:E.string().optional(),model_stl_url:E.string().optional(),model_3mf_url:E.string().optional(),model_gltf_url:E.string().optional(),model_glb_url:E.string().optional(),model_step_url:E.string().optional(),model_wrl_url:E.string().optional(),model_asset:Inn.optional(),model_unit_to_mm_scale_factor:E.number().optional(),model_board_normal_direction:E.enum(_in).optional().describe(`The direction in the model's coordinate space that is considered "up" or "coming out of the board surface"`),model_origin_position:gw.optional(),model_origin_alignment:E.enum(["unknown","center","center_of_component_on_board_surface","bottom_center_of_component"]).optional(),model_object_fit:E.enum(["contain_within_bounds","fill_bounds"]).optional().default("contain_within_bounds"),model_jscad:E.any().optional(),show_as_translucent_model:E.boolean().optional(),anchor_alignment:E.enum(["center","center_of_component_on_board_surface"]).optional().default("center")}).describe("Defines a component on the PCB"),MJe=E.enum(["sinewave","square","triangle","sawtooth"]),B1r=E.union([E.string(),E.number()]).transform((e)=>typeof e=="string"?e.endsWith("%")?parseFloat(e.slice(0,-1))/100:parseFloat(e):e).pipe(E.number().min(0,"Duty cycle must be non-negative").max(1,"Duty cycle cannot be greater than 100%")),Ain=E.object({type:E.literal("simulation_voltage_source"),simulation_voltage_source_id:mo("simulation_voltage_source"),is_dc_source:E.literal(!0).optional().default(!0),positive_source_port_id:E.string().optional(),negative_source_port_id:E.string().optional(),positive_source_net_id:E.string().optional(),negative_source_net_id:E.string().optional(),voltage:ww}).describe("Defines a DC voltage source for simulation"),fin=E.object({type:E.literal("simulation_voltage_source"),simulation_voltage_source_id:mo("simulation_voltage_source"),is_dc_source:E.literal(!1),terminal1_source_port_id:E.string().optional(),terminal2_source_port_id:E.string().optional(),terminal1_source_net_id:E.string().optional(),terminal2_source_net_id:E.string().optional(),voltage:ww.optional(),frequency:SV.optional(),peak_to_peak_voltage:ww.optional(),wave_shape:MJe.optional(),phase:gm.optional(),duty_cycle:B1r.optional()}).describe("Defines an AC voltage source for simulation"),yin=E.union([Ain,fin]).describe("Defines a voltage source for simulation"),T1r=E.union([E.string(),E.number()]).transform((e)=>typeof e=="string"?e.endsWith("%")?parseFloat(e.slice(0,-1))/100:parseFloat(e):e).pipe(E.number().min(0,"Duty cycle must be non-negative").max(1,"Duty cycle cannot be greater than 100%")),xin=E.object({type:E.literal("simulation_current_source"),simulation_current_source_id:mo("simulation_current_source"),is_dc_source:E.literal(!0).optional().default(!0),positive_source_port_id:E.string().optional(),negative_source_port_id:E.string().optional(),positive_source_net_id:E.string().optional(),negative_source_net_id:E.string().optional(),current:lq}).describe("Defines a DC current source for simulation"),Cin=E.object({type:E.literal("simulation_current_source"),simulation_current_source_id:mo("simulation_current_source"),is_dc_source:E.literal(!1),terminal1_source_port_id:E.string().optional(),terminal2_source_port_id:E.string().optional(),terminal1_source_net_id:E.string().optional(),terminal2_source_net_id:E.string().optional(),current:lq.optional(),frequency:SV.optional(),peak_to_peak_current:lq.optional(),wave_shape:MJe.optional(),phase:gm.optional(),duty_cycle:T1r.optional()}).describe("Defines an AC current source for simulation"),bin=E.union([xin,Cin]).describe("Defines a current source for simulation"),Iin=E.union([E.literal("spice_dc_sweep"),E.literal("spice_dc_operating_point"),E.literal("spice_transient_analysis"),E.literal("spice_ac_analysis")]),vin=E.object({type:E.literal("simulation_experiment"),simulation_experiment_id:mo("simulation_experiment"),name:E.string(),experiment_type:Iin,time_per_step:Nle.optional(),start_time_ms:cV.optional(),end_time_ms:cV.optional()}).describe("Defines a simulation experiment configuration"),Sin=E.object({type:E.literal("simulation_transient_voltage_graph"),simulation_transient_voltage_graph_id:mo("simulation_transient_voltage_graph"),simulation_experiment_id:E.string(),timestamps_ms:E.array(E.number()).optional(),voltage_levels:E.array(E.number()),source_component_id:E.string().optional(),subcircuit_connectivity_map_key:E.string().optional(),time_per_step:Nle,start_time_ms:cV,end_time_ms:cV,name:E.string().optional(),color:E.string().optional()}).describe("Stores voltage measurements over time for a simulation"),Pin=E.object({type:E.literal("simulation_switch"),simulation_switch_id:mo("simulation_switch"),source_component_id:E.string().optional(),closes_at:cV.optional(),opens_at:cV.optional(),starts_closed:E.boolean().optional(),switching_frequency:SV.optional()}).describe("Defines a switch for simulation timing control"),Ein=E.object({type:E.literal("simulation_voltage_probe"),simulation_voltage_probe_id:mo("simulation_voltage_probe"),source_component_id:E.string().optional(),name:E.string().optional(),signal_input_source_port_id:E.string().optional(),signal_input_source_net_id:E.string().optional(),reference_input_source_port_id:E.string().optional(),reference_input_source_net_id:E.string().optional(),subcircuit_id:E.string().optional(),color:E.string().optional()}).describe("Defines a voltage probe for simulation. If a reference input is not provided, it measures against ground. If a reference input is provided, it measures the differential voltage between two points.").superRefine((e,t)=>{if(e.reference_input_source_port_id||e.reference_input_source_net_id){let n=!!e.signal_input_source_port_id||!!e.reference_input_source_port_id,o=!!e.signal_input_source_net_id||!!e.reference_input_source_net_id;n&&o?t.addIssue({code:E.ZodIssueCode.custom,message:"Cannot mix port and net connections in a differential probe."}):n?e.signal_input_source_port_id&&e.reference_input_source_port_id||t.addIssue({code:E.ZodIssueCode.custom,message:"Differential port probe requires both signal_input_source_port_id and reference_input_source_port_id."}):o&&(e.signal_input_source_net_id&&e.reference_input_source_net_id||t.addIssue({code:E.ZodIssueCode.custom,message:"Differential net probe requires both signal_input_source_net_id and reference_input_source_net_id."}))}else!!e.signal_input_source_port_id==!!e.signal_input_source_net_id&&t.addIssue({code:E.ZodIssueCode.custom,message:"A voltage probe must have exactly one of signal_input_source_port_id or signal_input_source_net_id."})}),Min=Jl.extend({type:E.literal("simulation_unknown_experiment_error"),simulation_unknown_experiment_error_id:mo("simulation_unknown_experiment_error"),error_type:E.literal("simulation_unknown_experiment_error").default("simulation_unknown_experiment_error"),simulation_experiment_id:E.string().optional(),subcircuit_id:E.string().optional()}).describe("An unknown error occurred during the simulation experiment."),win=E.object({type:E.literal("simulation_op_amp"),simulation_op_amp_id:mo("simulation_op_amp"),source_component_id:E.string().optional(),inverting_input_source_port_id:E.string(),non_inverting_input_source_port_id:E.string(),output_source_port_id:E.string(),positive_supply_source_port_id:E.string(),negative_supply_source_port_id:E.string()}).describe("Defines a simple ideal operational amplifier for simulation"),Bin=E.union([$nn,jnn,Knn,Xnn,Jnn,qnn,aJe,rJe,s6e,sJe,iJe,cJe,lJe,hJe,pJe,mJe,_Je,xJe,gJe,AJe,fJe,yJe,uJe,dJe,ton,non,Znn,CJe,bJe,IJe,vJe,SJe,oon,ron,ion,son,aon,PJe,eon,Oon,jon,Vrn,Yrn,Grn,Xrn,jrn,Krn,Kon,krn,$on,hrn,ern,rrn,irn,drn,Jon,Zon,urn,prn,Urn,grn,Arn,frn,yrn,vrn,xrn,Crn,brn,Irn,srn,arn,mrn,_rn,crn,lrn,ain,cin,lin,hin,Prn,Srn,Ern,Mrn,wrn,Brn,Trn,Drn,Nrn,Wrn,Rrn,Qrn,$rn,Orn,qrn,Jrn,Zrn,oin,rin,iin,sin,din,uin,pin,min,con,Con,gon,Aon,fon,yon,mon,_on,bon,xon,lon,von,Son,Ion,won,Bon,Ton,Don,Qon,Non,Ron,gin,yin,bin,vin,Sin,Pin,Ein,Min,win]),GCe=Bin;function IOt(e,t,n){if(!t||!n)return;let o=e.get(t);o||(o=new Set,e.set(t,o)),o.add(n);let r=e.get(n);r||(r=new Set,e.set(n,r)),r.add(t)}var Qx=(e,t={})=>{let n=e,o=n._internal_store;if(!o){o={counts:{},editCount:0},n._internal_store=o;for(let i of n){let s=i.type,a=i[`${s}_id`];if(!a)continue;let c=Number.parseInt(a.split("_").pop());Number.isNaN(c)||(o.counts[s]=Math.max(o.counts[s]??0,c))}}let r=new Proxy({},{get:(i,s)=>{if(s==="toArray")return()=>(n.editCount=o.editCount,n);if(s==="editCount")return o.editCount;if(s==="subtree")return(c)=>Qx(function(l,h){if(!h.subcircuit_id&&!h.source_group_id)return[...l];let d=h;if(h.subcircuit_id){let A=new Set([h.subcircuit_id]),g=new Map,f=new Map;for(let x of l)if(x.type==="source_group"){let{source_group_id:C,subcircuit_id:b}=x;b&&f.set(C,b);let I=x.parent_source_group_id;I&&(g.has(I)||g.set(I,[]),g.get(I).push(C))}let y;for(let[x,C]of f)if(C===h.subcircuit_id){y=x;break}if(y){let x=(C)=>{let b=g.get(C)||[];for(let I of b){let v=f.get(I);v&&A.add(v),x(I)}};x(y),d={...h,subcircuit_ids:Array.from(A)}}}let u=new Map;for(let A of l){let g=A[`${A.type}_id`];typeof g=="string"&&u.set(g,A)}let _=new Map;for(let A of l){let g=Object.entries(A);for(let[f,y]of g)if(f!=="parent_source_group_id"){if(f.endsWith("_id")&&typeof y=="string")IOt(_,A,u.get(y));else if(f.endsWith("_ids")&&Array.isArray(y))for(let x of y)typeof x=="string"&&IOt(_,A,u.get(x))}}let p=[],m=new Set;for(let A of l){let g=!1;(d.subcircuit_id&&("subcircuit_id"in A)&&A.subcircuit_id===d.subcircuit_id||d.subcircuit_ids&&("subcircuit_id"in A)&&A.subcircuit_id&&d.subcircuit_ids.includes(A.subcircuit_id)||d.source_group_id&&("source_group_id"in A)&&A.source_group_id===d.source_group_id||d.source_group_id&&("member_source_group_ids"in A)&&Array.isArray(A.member_source_group_ids)&&A.member_source_group_ids.includes(d.source_group_id))&&(g=!0),g&&(p.push(A),m.add(A))}for(;p.length>0;){let A=p.shift(),g=_.get(A);if(g)for(let f of g)m.has(f)||(m.add(f),p.push(f))}return l.filter((A)=>m.has(A))}(n,c),t);if(s==="insert")return(c)=>{let l=c.type;if(!l)throw Error("insert requires an element with a type");o.counts[l]??=-1,o.counts[l]++;let h=o.counts[l],d={...c,type:l,[`${l}_id`]:`${l}_${h}`};if(t.validateInserts)(YCe[l]??GCe).parse(d);return n.push(d),o.editCount++,d};if(s==="insertAll")return(c)=>c.map((l)=>r.insert(l));let a=s;return{get:(c)=>n.find((l)=>l.type===a&&l[`${a}_id`]===c),getUsing:(c)=>{let l=Object.keys(c);if(l.length!==1)throw Error("getUsing requires exactly one key, e.g. { pcb_component_id }");let h=l[0],d=h.replace("_id",""),u=n.find((_)=>_.type===d&&_[h]===c[h]);return u?n.find((_)=>_.type===a&&_[`${a}_id`]===u[`${a}_id`]):null},getWhere:(c)=>{let l=Object.keys(c);return n.find((h)=>h.type===a&&l.every((d)=>h[d]===c[d]))},list:(c)=>{let l=c?Object.keys(c):[];return n.filter((h)=>h.type===a&&l.every((d)=>h[d]===c[d]))},insert:(c)=>{o.counts[a]??=-1,o.counts[a]++;let l=o.counts[a],h={type:a,[`${a}_id`]:`${a}_${l}`,...c};if(t.validateInserts)(YCe[a]??GCe).parse(h);return n.push(h),o.editCount++,h},delete:(c)=>{let l=n.find((h)=>h[`${a}_id`]===c);l&&(n.splice(n.indexOf(l),1),o.editCount++)},update:(c,l)=>{let h=n.find((d)=>d.type===a&&d[`${a}_id`]===c);return h?(Object.assign(h,l),o.editCount++,h):null},select:(c)=>{if(a==="source_component")return n.find((l)=>l.type==="source_component"&&l.name===c.replace(/\./g,""));if(a==="pcb_port"||a==="source_port"||a==="schematic_port"){let[l,h]=c.replace(/\./g,"").split(/[\s\>]+/),d=n.find((_)=>_.type==="source_component"&&_.name===l);if(!d)return null;let u=n.find((_)=>_.type==="source_port"&&_.source_component_id===d.source_component_id&&(_.name===h||(_.port_hints??[]).includes(h)));if(!u)return null;if(a==="source_port")return u;if(a==="pcb_port")return n.find((_)=>_.type==="pcb_port"&&_.source_port_id===u.source_port_id);if(a==="schematic_port")return n.find((_)=>_.type==="schematic_port"&&_.source_port_id===u.source_port_id)}}}}});return r};Qx.unparsed=Qx;var VK=Qx;function wWe(e){let t=e.type;return`${t}:${e[`${t}_id`]}`}var vOt=(e,t={})=>{let n=e._internal_store_indexed;if(!n){n={counts:{},editCount:0,indexes:{}};for(let s of e){let a=s.type,c=s[`${a}_id`];if(!c)continue;let l=Number.parseInt(c.split("_").pop()||"");Number.isNaN(l)||(n.counts[a]=Math.max(n.counts[a]??0,l))}let r=t.indexConfig||{},i=n.indexes;if(r.byId&&(i.byId=new Map),r.byType&&(i.byType=new Map),r.byRelation&&(i.byRelation=new Map),r.bySubcircuit&&(i.bySubcircuit=new Map),r.byCustomField&&r.byCustomField.length>0){i.byCustomField=new Map;for(let s of r.byCustomField)i.byCustomField.set(s,new Map)}for(let s of e){if(r.byId){let a=wWe(s);i.byId.set(a,s)}if(r.byType){let a=i.byType.get(s.type)||[];a.push(s),i.byType.set(s.type,a)}if(r.byRelation){let a=Object.entries(s);for(let[c,l]of a)if(c.endsWith("_id")&&c!==`${s.type}_id`&&typeof l=="string"){let h=i.byRelation.get(c)||new Map,d=h.get(l)||[];d.push(s),h.set(l,d),i.byRelation.set(c,h)}}if(r.bySubcircuit&&"subcircuit_id"in s){let a=s.subcircuit_id;if(a&&typeof a=="string"){let c=i.bySubcircuit.get(a)||[];c.push(s),i.bySubcircuit.set(a,c)}}if(r.byCustomField&&i.byCustomField){for(let a of r.byCustomField)if(a in s){let c=s[a];if(c!==void 0&&(typeof c=="string"||typeof c=="number")){let l=String(c),h=i.byCustomField.get(a),d=h.get(l)||[];d.push(s),h.set(l,d)}}}}e._internal_store_indexed=n}return new Proxy({},{get:(r,i)=>{if(i==="toArray")return()=>(e.editCount=n.editCount,e);if(i==="editCount")return n.editCount;let s=i;return{get:(a)=>{let c=t.indexConfig||{};if(c.byId&&n.indexes.byId)return n.indexes.byId.get(`${s}:${a}`)||null;if(c.byType&&n.indexes.byType)return(n.indexes.byType.get(s)||[]).find((l)=>l[`${s}_id`]===a)||null;return e.find((l)=>l.type===s&&l[`${s}_id`]===a)||null},getUsing:(a)=>{let c=t.indexConfig||{},l=Object.keys(a);if(l.length!==1)throw Error("getUsing requires exactly one key, e.g. { pcb_component_id }");let h=l[0],d=h.replace("_id","");if(c.byRelation&&n.indexes.byRelation){let _=n.indexes.byRelation.get(h);if(_){let p=(_.get(a[h])||[]).find((A)=>A.type===d);if(!p)return null;let m=p[`${s}_id`];if(c.byId&&n.indexes.byId)return n.indexes.byId.get(`${s}:${m}`)||null;if(c.byType&&n.indexes.byType)return(n.indexes.byType.get(s)||[]).find((A)=>A[`${s}_id`]===m)||null;return e.find((A)=>A.type===s&&A[`${s}_id`]===m)||null}}let u=e.find((_)=>_.type===d&&_[h]===a[h]);return u&&e.find((_)=>_.type===s&&_[`${s}_id`]===u[`${s}_id`])||null},getWhere:(a)=>{let c=t.indexConfig||{},l=Object.keys(a);if(l.length===1&&c.byCustomField&&n.indexes.byCustomField){let h=l[0],d=n.indexes.byCustomField.get(h);if(d){let u=String(a[h]);return(d.get(u)||[]).find((_)=>_.type===s)||null}}if("subcircuit_id"in a&&c.bySubcircuit&&n.indexes.bySubcircuit){let h=a.subcircuit_id;return(n.indexes.bySubcircuit.get(h)||[]).find((d)=>d.type===s&&l.every((u)=>d[u]===a[u]))||null}if(c.byType&&n.indexes.byType)return(n.indexes.byType.get(s)||[]).find((h)=>l.every((d)=>h[d]===a[d]))||null;return e.find((h)=>h.type===s&&l.every((d)=>h[d]===a[d]))||null},list:(a)=>{let c=t.indexConfig||{},l=a?Object.keys(a):[];if(l.length===0&&c.byType&&n.indexes.byType)return n.indexes.byType.get(s)||[];if(l.length===1&&l[0]==="subcircuit_id"&&c.bySubcircuit&&n.indexes.bySubcircuit){let d=a.subcircuit_id;return(n.indexes.bySubcircuit.get(d)||[]).filter((u)=>u.type===s)}let h;return h=c.byType&&n.indexes.byType?n.indexes.byType.get(s)||[]:e.filter((d)=>d.type===s),l.length>0?h.filter((d)=>l.every((u)=>d[u]===a[u])):h},insert:(a)=>{n.counts[s]??=-1,n.counts[s]++;let c=n.counts[s],l={type:s,[`${s}_id`]:`${s}_${c}`,...a};if(t.validateInserts)(YCe[s]??GCe).parse(l);e.push(l),n.editCount++;let h=t.indexConfig||{};if(h.byId&&n.indexes.byId){let d=wWe(l);n.indexes.byId.set(d,l)}if(h.byType&&n.indexes.byType){let d=n.indexes.byType.get(s)||[];d.push(l),n.indexes.byType.set(s,d)}if(h.byRelation&&n.indexes.byRelation){let d=Object.entries(l);for(let[u,_]of d)if(u.endsWith("_id")&&u!==`${l.type}_id`&&typeof _=="string"){let p=n.indexes.byRelation.get(u)||new Map,m=p.get(_)||[];m.push(l),p.set(_,m),n.indexes.byRelation.set(u,p)}}if(h.bySubcircuit&&n.indexes.bySubcircuit&&"subcircuit_id"in l){let d=l.subcircuit_id;if(d&&typeof d=="string"){let u=n.indexes.bySubcircuit.get(d)||[];u.push(l),n.indexes.bySubcircuit.set(d,u)}}if(h.byCustomField&&n.indexes.byCustomField){for(let d of h.byCustomField)if(d in l){let u=l[d];if(u!==void 0&&(typeof u=="string"||typeof u=="number")){let _=String(u),p=n.indexes.byCustomField.get(d),m=p.get(_)||[];m.push(l),p.set(_,m)}}}return l},delete:(a)=>{let c=t.indexConfig||{},l;if(c.byId&&n.indexes.byId)l=n.indexes.byId.get(`${s}:${a}`);else if(c.byType&&n.indexes.byType)l=(n.indexes.byType.get(s)||[]).find((u)=>u[`${s}_id`]===a);else l=e.find((d)=>d[`${s}_id`]===a);if(!l)return;let h=e.indexOf(l);if(h>=0&&(e.splice(h,1),n.editCount++),c.byId&&n.indexes.byId){let d=wWe(l);n.indexes.byId.delete(d)}if(c.byType&&n.indexes.byType){let d=(n.indexes.byType.get(s)||[]).filter((u)=>u[`${s}_id`]!==a);n.indexes.byType.set(s,d)}if(c.byRelation&&n.indexes.byRelation)for(let[d,u]of n.indexes.byRelation.entries())for(let[_,p]of u.entries()){let m=p.filter((A)=>A!==l);m.length===0?u.delete(_):u.set(_,m)}if(c.bySubcircuit&&n.indexes.bySubcircuit&&"subcircuit_id"in l){let d=l.subcircuit_id;if(d){let u=(n.indexes.bySubcircuit.get(d)||[]).filter((_)=>_!==l);u.length===0?n.indexes.bySubcircuit.delete(d):n.indexes.bySubcircuit.set(d,u)}}if(c.byCustomField&&n.indexes.byCustomField)for(let d of n.indexes.byCustomField.values())for(let[u,_]of d.entries()){let p=_.filter((m)=>m!==l);p.length===0?d.delete(u):d.set(u,p)}},update:(a,c)=>{let l=t.indexConfig||{},h;if(l.byId&&n.indexes.byId)h=n.indexes.byId.get(`${s}:${a}`);else if(l.byType&&n.indexes.byType)h=(n.indexes.byType.get(s)||[]).find((u)=>u[`${s}_id`]===a);else h=e.find((d)=>d.type===s&&d[`${s}_id`]===a);if(!h)return null;if(l.byRelation&&n.indexes.byRelation){let d=Object.entries(h);for(let[u,_]of d)if(u.endsWith("_id")&&u!==`${h.type}_id`&&typeof _=="string"&&u in c&&c[u]!==_){let p=n.indexes.byRelation.get(u);if(p){let m=(p.get(_)||[]).filter((A)=>A!==h);m.length===0?p.delete(_):p.set(_,m)}}}if(l.bySubcircuit&&n.indexes.bySubcircuit&&"subcircuit_id"in h&&"subcircuit_id"in c){let d=h.subcircuit_id;if(d!==c.subcircuit_id){let u=(n.indexes.bySubcircuit.get(d)||[]).filter((_)=>_!==h);u.length===0?n.indexes.bySubcircuit.delete(d):n.indexes.bySubcircuit.set(d,u)}}if(l.byCustomField&&n.indexes.byCustomField){for(let d of l.byCustomField)if(d in h&&d in c&&h[d]!==c[d]){let u=n.indexes.byCustomField.get(d);if(u){let _=String(h[d]),p=(u.get(_)||[]).filter((m)=>m!==h);p.length===0?u.delete(_):u.set(_,p)}}}if(Object.assign(h,c),n.editCount++,l.byRelation&&n.indexes.byRelation){let d=Object.entries(h);for(let[u,_]of d)if(u.endsWith("_id")&&u!==`${h.type}_id`&&typeof _=="string"&&u in c){let p=n.indexes.byRelation.get(u)||new Map,m=p.get(_)||[];m.includes(h)||(m.push(h),p.set(_,m),n.indexes.byRelation.set(u,p))}}if(l.bySubcircuit&&n.indexes.bySubcircuit&&"subcircuit_id"in h&&"subcircuit_id"in c){let d=h.subcircuit_id;if(d&&typeof d=="string"){let u=n.indexes.bySubcircuit.get(d)||[];u.includes(h)||(u.push(h),n.indexes.bySubcircuit.set(d,u))}}if(l.byCustomField&&n.indexes.byCustomField){for(let d of l.byCustomField)if(d in h&&d in c){let u=h[d];if(u!==void 0&&(typeof u=="string"||typeof u=="number")){let _=String(u),p=n.indexes.byCustomField.get(d),m=p.get(_)||[];m.includes(h)||(m.push(h),p.set(_,m))}}}return h},select:(a)=>{if(s==="source_component")return e.find((c)=>c.type==="source_component"&&c.name===a.replace(/\./g,""))||null;if(s==="pcb_port"||s==="source_port"||s==="schematic_port"){let[c,l]=a.replace(/\./g,"").split(/[\s\>]+/),h=e.find((u)=>u.type==="source_component"&&u.name===c);if(!h)return null;let d=e.find((u)=>u.type==="source_port"&&u.source_component_id===h.source_component_id&&(u.name===l||(u.port_hints??[]).includes(l)));if(!d)return null;if(s==="source_port")return d;if(s==="pcb_port")return e.find((u)=>u.type==="pcb_port"&&u.source_port_id===d.source_port_id)||null;if(s==="schematic_port")return e.find((u)=>u.type==="schematic_port"&&u.source_port_id===d.source_port_id)||null}return null}}}})};vOt.unparsed=vOt;var SOt=(e)=>e[`${e.type}_id`];function D1r(e,t){let n=Qx(e).pcb_trace.get(t);if(!n)return`trace[${t}]`;let o=n.route.flatMap((r)=>[r.start_pcb_port_id,r.end_pcb_port_id]).filter(Boolean);if(o.length===0)return`trace[${t}]`;return`trace[${o.map((r)=>{let i=function(s){let a=Qx(e).pcb_port.get(s);if(!a)return null;let c=a.pcb_component_id?Qx(e).pcb_component.get(a.pcb_component_id):void 0;if(!c)return null;let l=Qx(e).source_component.get(c.source_component_id);if(!l)return null;let h=Qx(e).source_port.get(a.source_port_id),d=h?.port_hints?h.port_hints[1]:"";return{componentName:l.name,portHint:d}}(r);return i?`.${i.componentName} > port.${i.portHint}`:`port[${r}]`}).join(", ")}]`}var POt=(e,t)=>{let n=Qx(e).pcb_port.get(t);if(!n)return`pcb_port[#${t}]`;let o=n.pcb_component_id?Qx(e).pcb_component.get(n.pcb_component_id):void 0;if(!o)return`pcb_port[#${t}]`;let r=Qx(e).source_component.get(o.source_component_id);if(!r)return`pcb_port[#${t}]`;let i=Qx(e).source_port.get(n.source_port_id);if(!i)return`pcb_port[#${t}]`;let s;return s=i?.port_hints&&i.port_hints.length>0||i.port_hints&&i.port_hints.length>0?i.port_hints[0]:t,`pcb_port[.${r.name} > .${s}]`},hq=(e,t)=>{if(typeof t=="string"){let n=((o,r)=>o.find((i)=>SOt(i)===r)??null)(e,t);return hq(e,n)}switch(t.type){case"pcb_port":return POt(e,t.pcb_port_id);case"pcb_smtpad":return function(n,o){let r=Qx(n).pcb_smtpad.get(o);return r&&r.pcb_port_id?POt(n,r.pcb_port_id):`smtpad[${o}]`}(e,t.pcb_smtpad_id);case"pcb_trace":return D1r(e,t.pcb_trace_id);case"source_component":return`source_component[${t.name}]`;default:return`${t.type}[#${SOt(t)}]`}},EOt=(e,t)=>({minX:Math.min(e.minX,t.minX),minY:Math.min(e.minY,t.minY),maxX:Math.max(e.maxX,t.maxX),maxY:Math.max(e.maxY,t.maxY)}),J4e=(e,t,n)=>{let o=n/2;return{minX:e-o,minY:t-o,maxX:e+o,maxY:t+o}},N1r=(e,t,n,o,r)=>{let i=n/2,s=o/2,a=r*Math.PI/180,c=Math.cos(a),l=Math.sin(a),h=[{x:-i,y:-s},{x:i,y:-s},{x:i,y:s},{x:-i,y:s}].map((d)=>({x:e+d.x*c-d.y*l,y:t+d.x*l+d.y*c}));return{minX:Math.min(...h.map((d)=>d.x)),minY:Math.min(...h.map((d)=>d.y)),maxX:Math.max(...h.map((d)=>d.x)),maxY:Math.max(...h.map((d)=>d.y))}},BWe=(e)=>e[`${e.type}_id`];function MOt(e,t,n,o){return Math.sqrt((n-e)**2+(o-t)**2)}var R1r=class{buckets;objectsById;getBounds;getId;CELL_SIZE=0.4;constructor({objects:e,getBounds:t,getId:n,CELL_SIZE:o}){this.buckets=new Map,this.objectsById=new Map,this.getBounds=t,this.getId=n??(()=>this._getNextId()),this.CELL_SIZE=o??this.CELL_SIZE;for(let r of e)this.addObject(r)}_idCounter=0;_getNextId(){return""+this._idCounter++}addObject(e){let t=this.getBounds(e),n=this.getId(e),o={...e,spatialIndexId:n};this.objectsById.set(n,o);let r=Math.floor(t.minX/this.CELL_SIZE),i=Math.floor(t.minY/this.CELL_SIZE),s=Math.floor(t.maxX/this.CELL_SIZE),a=Math.floor(t.maxY/this.CELL_SIZE);for(let c=r;c<=s;c++)for(let l=i;l<=a;l++){let h=`${c}x${l}`,d=this.buckets.get(h);d?d.push(o):this.buckets.set(h,[o])}}removeObject(e){let t=this.objectsById.get(e);if(!t)return!1;this.objectsById.delete(e);let n=this.getBounds(t),o=Math.floor(n.minX/this.CELL_SIZE),r=Math.floor(n.minY/this.CELL_SIZE),i=Math.floor(n.maxX/this.CELL_SIZE),s=Math.floor(n.maxY/this.CELL_SIZE);for(let a=o;a<=i;a++)for(let c=r;c<=s;c++){let l=`${a}x${c}`,h=this.buckets.get(l);if(h){let d=h.findIndex((u)=>u.spatialIndexId===e);d!==-1&&(h.splice(d,1),h.length===0&&this.buckets.delete(l))}}return!0}getBucketKey(e,t){return`${Math.floor(e/this.CELL_SIZE)}x${Math.floor(t/this.CELL_SIZE)}`}getObjectsInBounds(e,t=0){let n=[],o=new Set,r=Math.floor((e.minX-t)/this.CELL_SIZE),i=Math.floor((e.minY-t)/this.CELL_SIZE),s=Math.floor((e.maxX+t)/this.CELL_SIZE),a=Math.floor((e.maxY+t)/this.CELL_SIZE);for(let c=r;c<=s;c++)for(let l=i;l<=a;l++){let h=`${c}x${l}`,d=this.buckets.get(h)||[];for(let u of d){let _=u.spatialIndexId;o.has(_)||(o.add(_),n.push(u))}}return n}},Tin=0.1,Q1r=0.1,k1r=Tin,L1r=Tin,k$=0.005;function H1r(e){return e.type==="pcb_trace_segment"||e.type==="pcb_smtpad"?[e.layer]:e.type==="pcb_plated_hole"?Array.isArray(e.layers)?e.layers:[...fce]:e.type==="pcb_hole"?[...fce]:e.type==="pcb_via"?Array.isArray(e.layers)?e.layers:[...fce]:e.type==="pcb_keepout"&&Array.isArray(e.layers)?e.layers:[]}var wOt=(e,t)=>{let n={x:e.x1,y:e.y1},o={x:e.x2,y:e.y2},{minX:r,minY:i,maxX:s,maxY:a}=t;if(n.x===o.x&&n.y===o.y){let v=Math.max(r,Math.min(s,n.x)),P=Math.max(i,Math.min(a,n.y));return v===n.x&&P===n.y?{x:n.x,y:n.y}:{x:v,y:P}}let c=o.x-n.x,l=o.y-n.y,h=c!==0?(r-n.x)/c:Number.NEGATIVE_INFINITY,d=c!==0?(s-n.x)/c:Number.POSITIVE_INFINITY,u=l!==0?(i-n.y)/l:Number.NEGATIVE_INFINITY,_=l!==0?(a-n.y)/l:Number.POSITIVE_INFINITY,p=Math.max(Math.min(h,d),Math.min(u,_)),m=Math.min(Math.max(h,d),Math.max(u,_));if(p<=m&&m>=0&&p<=1){let v=Math.max(0,Math.min(1,p));return{x:n.x+v*c,y:n.y+v*l}}let A={x:Math.max(r,Math.min(s,n.x)),y:Math.max(i,Math.min(a,n.y))},g={x:Math.max(r,Math.min(s,o.x)),y:Math.max(i,Math.min(a,o.y))},f=(A.x-n.x)**2+(A.y-n.y)**2,y=(g.x-o.x)**2+(g.y-o.y)**2,x=[{start:{x:r,y:i},end:{x:s,y:i}},{start:{x:s,y:i},end:{x:s,y:a}},{start:{x:s,y:a},end:{x:r,y:a}},{start:{x:r,y:a},end:{x:r,y:i}}],C=Math.min(f,y),b=f<=y?A:g,I=(v,P,M)=>Math.max(P,Math.min(M,v));for(let v of x){let P={x:o.x-n.x,y:o.y-n.y},M={x:v.end.x-v.start.x,y:v.end.y-v.start.y},B={x:n.x-v.start.x,y:n.y-v.start.y},T=P.x*P.x+P.y*P.y,N=P.x*M.x+P.y*M.y,D=P.x*B.x+P.y*B.y,L=M.x*M.x+M.y*M.y,H=M.x*B.x+M.y*B.y,V=T*L-N*N;if(Math.abs(V)<0.0000000001)continue;let O=(N*H-L*D)/V,U=(T*H-N*D)/V;O=I(O,0,1),U=I(U,0,1);let j={x:n.x+O*P.x,y:n.y+O*P.y},Y={x:v.start.x+U*M.x,y:v.start.y+U*M.y},X=j.x-Y.x,K=j.y-Y.y,J=X*X+K*K;J<C&&(C=J,b={x:(j.x+Y.x)/2,y:(j.y+Y.y)/2})}return b},F1r=(e,t)=>{let n={x:e.x1,y:e.y1},o={x:e.x2,y:e.y2},r={x:t.x1,y:t.y1},i={x:t.x2,y:t.y2},s={x:o.x-n.x,y:o.y-n.y},a={x:i.x-r.x,y:i.y-r.y},c=s.x*s.x+s.y*s.y,l=a.x*a.x+a.y*a.y;if(c===0||l===0){if(c===0&&l===0)return{x:(n.x+r.x)/2,y:(n.y+r.y)/2};if(c===0){let T=F7(((n.x-r.x)*a.x+(n.y-r.y)*a.y)/l,0,1),N={x:r.x+T*a.x,y:r.y+T*a.y};return{x:(n.x+N.x)/2,y:(n.y+N.y)/2}}let M=F7(((r.x-n.x)*s.x+(r.y-n.y)*s.y)/c,0,1),B={x:n.x+M*s.x,y:n.y+M*s.y};return{x:(B.x+r.x)/2,y:(B.y+r.y)/2}}let h=n.x-r.x,d=n.y-r.y,u=s.x*s.x+s.y*s.y,_=s.x*a.x+s.y*a.y,p=s.x*h+s.y*d,m=a.x*a.x+a.y*a.y,A=a.x*h+a.y*d,g=u*m-_*_;if(g<0.0000000001)return z1r(n,o,r,i,s,a,c,l);let f=(_*A-m*p)/g,y=(u*A-_*p)/g;f=F7(f,0,1),y=F7(y,0,1),y=(f*_+A)/m,y=F7(y,0,1),f=(y*_-p)/u,f=F7(f,0,1);let x=n.x+f*s.x,C=n.y+f*s.y,b=r.x+y*a.x,I=r.y+y*a.y,v=x-b,P=C-I;return Math.sqrt(v*v+P*P),{x:(x+b)/2,y:(C+I)/2}},z1r=(e,t,n,o,r,i,s,a)=>{let c=((n.x-e.x)*r.x+(n.y-e.y)*r.y)/s;c=F7(c,0,1);let l={x:e.x+c*r.x,y:e.y+c*r.y},h=((o.x-e.x)*r.x+(o.y-e.y)*r.y)/s;h=F7(h,0,1);let d={x:e.x+h*r.x,y:e.y+h*r.y},u=((e.x-n.x)*i.x+(e.y-n.y)*i.y)/a;u=F7(u,0,1);let _={x:n.x+u*i.x,y:n.y+u*i.y},p=((t.x-n.x)*i.x+(t.y-n.y)*i.y)/a;p=F7(p,0,1);let m={x:n.x+p*i.x,y:n.y+p*i.y},A=[{pointA:l,pointB:n,distance:Math.sqrt((l.x-n.x)**2+(l.y-n.y)**2)},{pointA:d,pointB:o,distance:Math.sqrt((d.x-o.x)**2+(d.y-o.y)**2)},{pointA:e,pointB:_,distance:Math.sqrt((e.x-_.x)**2+(e.y-_.y)**2)},{pointA:t,pointB:m,distance:Math.sqrt((t.x-m.x)**2+(t.y-m.y)**2)}].reduce((g,f)=>f.distance<g.distance?f:g);return{x:(A.pointA.x+A.pointB.x)/2,y:(A.pointA.y+A.pointB.y)/2}},F7=(e,t,n)=>Math.max(t,Math.min(n,e)),Sae=(e)=>e.type==="pcb_trace_segment"?{minX:Math.min(e.x1,e.x2),minY:Math.min(e.y1,e.y2),maxX:Math.max(e.x1,e.x2),maxY:Math.max(e.y1,e.y2)}:((t)=>{let{POSITIVE_INFINITY:n,POSITIVE_INFINITY:o,NEGATIVE_INFINITY:r,NEGATIVE_INFINITY:i}=Number;for(let s of t){if(!s.type.startsWith("pcb_"))continue;if(s.type==="pcb_smtpad"&&s.shape==="polygon"&&Array.isArray(s.points)){for(let d of s.points)n=Math.min(n,d.x),o=Math.min(o,d.y),r=Math.max(r,d.x),i=Math.max(i,d.y);continue}if(s.type==="pcb_hole"&&s.hole_shape==="circle"){let d=J4e(s.x,s.y,s.hole_diameter);n=Math.min(n,d.minX),o=Math.min(o,d.minY),r=Math.max(r,d.maxX),i=Math.max(i,d.maxY);continue}if(s.type==="pcb_plated_hole"){let d;if("outer_diameter"in s&&typeof s.outer_diameter=="number"?d=J4e(s.x,s.y,s.outer_diameter):("hole_diameter"in s)&&typeof s.hole_diameter=="number"&&(d=J4e(s.x,s.y,s.hole_diameter)),"rect_pad_width"in s&&typeof s.rect_pad_width=="number"&&"rect_pad_height"in s&&typeof s.rect_pad_height=="number"){let u=N1r(s.x,s.y,s.rect_pad_width,s.rect_pad_height,"rect_ccw_rotation"in s?s.rect_ccw_rotation??0:0);d=d?EOt(d,u):u}if("hole_diameter"in s&&typeof s.hole_diameter=="number"){let u=J4e(s.x+("hole_offset_x"in s?s.hole_offset_x??0:0),s.y+("hole_offset_y"in s?s.hole_offset_y??0:0),s.hole_diameter);d=d?EOt(d,u):u}if(d){n=Math.min(n,d.minX),o=Math.min(o,d.minY),r=Math.max(r,d.maxX),i=Math.max(i,d.maxY);continue}}let a,c,l,h;if("x"in s&&"y"in s&&(a=Number(s.x),c=Number(s.y)),"outer_diameter"in s&&(l=Number(s.outer_diameter),h=Number(s.outer_diameter)),"width"in s&&(l=Number(s.width)),"height"in s&&(h=Number(s.height)),"center"in s&&(a=s.center.x,c=s.center.y),a!==void 0&&c!==void 0)n=Math.min(n,a),o=Math.min(o,c),r=Math.max(r,a),i=Math.max(i,c),l!==void 0&&h!==void 0&&(n=Math.min(n,a-l/2),o=Math.min(o,c-h/2),r=Math.max(r,a+l/2),i=Math.max(i,c+h/2)),"radius"in s&&(n=Math.min(n,a-s.radius),o=Math.min(o,c-s.radius),r=Math.max(r,a+s.radius),i=Math.max(i,c+s.radius));else if(s.type==="pcb_trace")for(let d of s.route)n=Math.min(n,d.x),o=Math.min(o,d.y),r=Math.max(r,d.x),i=Math.max(i,d.y);else if(s.type==="pcb_courtyard_outline")for(let d of s.outline)n=Math.min(n,d.x),o=Math.min(o,d.y),r=Math.max(r,d.x),i=Math.max(i,d.y);else if(s.type==="pcb_courtyard_polygon")for(let d of s.points)n=Math.min(n,d.x),o=Math.min(o,d.y),r=Math.max(r,d.x),i=Math.max(i,d.y)}return{minX:n,minY:o,maxX:r,maxY:i}})([e]);function O1r(e){let t=new Set;for(let n of e.route)n.route_type==="wire"&&(n.start_pcb_port_id&&t.add(n.start_pcb_port_id),n.end_pcb_port_id&&t.add(n.end_pcb_port_id));return Array.from(t)}function TWe(e){let t=new Set;for(let n of e)for(let o of O1r(n))t.add(o);return Array.from(t)}var V1r=(e)=>{if(e.type==="pcb_via")return e.outer_diameter/2;if(e.type==="pcb_plated_hole"&&e.shape==="circle")return e.outer_diameter/2;if(e.type==="pcb_hole"&&e.hole_shape==="circle")return e.hole_diameter/2;if(e.type==="pcb_smtpad"&&e.shape==="circle")return e.radius;throw Error(`Could not determine radius of element: ${JSON.stringify(e)}`)};function Y1r(e,{connMap:t,minClearance:n=0.1}={}){let o=[];((m)=>{let A=m.filter((x)=>x.type==="pcb_port"),g=m.filter((x)=>x.type==="pcb_smtpad"),f=m.filter((x)=>x.type==="pcb_trace");function y(x,C={}){let b=C.traceWidth||0,I=A.find((v)=>MOt(v.x,v.y,x.x,x.y)<0.01);if(I)return I.pcb_port_id;if(C.isFirstOrLastPoint){let v=g.find((P)=>P.shape==="rect"?Math.abs(x.x-P.x)<P.width/2+b/2&&Math.abs(x.y-P.y)<P.height/2+b/2:P.shape==="circle"?MOt(x.x,x.y,P.x,P.y)<P.radius:void 0);if(v)return v.pcb_port_id??null}return null}for(let x of f)for(let C=0;C<x.route.length;C++){let b=x.route[C],I=C===0||C===x.route.length-1;if(b.route_type==="wire"){if(!b.start_pcb_port_id&&C===0){let v=y(b,{isFirstOrLastPoint:I,traceWidth:b.width});v&&(b.start_pcb_port_id=v)}if(!b.end_pcb_port_id&&C===x.route.length-1){let v=y(b,{isFirstOrLastPoint:I,traceWidth:b.width});v&&(b.end_pcb_port_id=v)}}}})(e),t??=Zqe(e);let r=VK(e).pcb_trace.list().flatMap((m)=>{let A=[];for(let g=0;g<m.route.length-1;g++){let f=m.route[g],y=m.route[g+1];f.route_type==="wire"&&(y.route_type==="wire"&&f.layer===y.layer&&A.push({type:"pcb_trace_segment",pcb_trace_id:m.pcb_trace_id,_pcbTrace:m,thickness:"width"in f?f.width:("width"in y)?y.width:Q1r,layer:f.layer,x1:f.x,y1:f.y,x2:y.x,y2:y.y}))}return A}),i=VK(e).pcb_smtpad.list(),s=VK(e).pcb_plated_hole.list(),a=VK(e).pcb_hole.list(),c=VK(e).pcb_via.list(),l=VK(e).pcb_keepout.list(),h=[...r,...i,...s,...a,...c,...l],d=new R1r({objects:h,getBounds:Sae}),u=(m)=>hq(e,m),_=(m,A,g)=>g<0?`PCB trace ${m} overlaps with ${A} (accidental contact)`:`PCB trace ${m} is too close to ${A} (gap: ${g.toFixed(3)}mm)`,p=new Set;for(let m of r){let A=n,g=Sae(m),f=d.getObjectsInBounds(g,A+m.thickness/2);if(m.x1!==m.x2||m.y1!==m.y2)for(let y of f){if(!H1r(y).includes(m.layer))continue;if(y.type==="pcb_trace_segment"){let b=y;if(m.layer!==b.layer)continue;if(t.areIdsConnected(m.pcb_trace_id,b.pcb_trace_id))continue;let I=s_({x:m.x1,y:m.y1},{x:m.x2,y:m.y2},{x:b.x1,y:b.y1},{x:b.x2,y:b.y2})-m.thickness/2-b.thickness/2;if(I>n-k$)continue;let v=`overlap_${m.pcb_trace_id}_${b.pcb_trace_id}`,P=`overlap_${b.pcb_trace_id}_${m.pcb_trace_id}`;if(p.has(v))continue;if(p.has(P))continue;p.add(v),o.push({type:"pcb_trace_error",error_type:"pcb_trace_error",message:_(u(m.pcb_trace_id),u(b.pcb_trace_id),I),pcb_trace_id:m.pcb_trace_id,source_trace_id:"",pcb_trace_error_id:v,pcb_component_ids:[],center:F1r(m,b),pcb_port_ids:TWe([m._pcbTrace,b._pcbTrace])});continue}let x=BWe(y);if(t.areIdsConnected(m.pcb_trace_id,"pcb_trace_id"in y?y.pcb_trace_id:x))continue;if(y.type==="pcb_via"||y.type==="pcb_plated_hole"&&y.shape==="circle"||y.type==="pcb_hole"||y.type==="pcb_smtpad"&&y.shape==="circle"){let b=V1r(y),I=gQ({x:m.x1,y:m.y1},{x:m.x2,y:m.y2},{x:y.x,y:y.y,radius:b})-m.thickness/2;if(I>n-k$)continue;let v=`overlap_${m.pcb_trace_id}_${x}`;if(p.has(v))continue;p.add(v),o.push({type:"pcb_trace_error",error_type:"pcb_trace_error",message:_(u(m.pcb_trace_id),`${y.type} "${u(BWe(y))}"`,I),pcb_trace_id:m.pcb_trace_id,center:wOt(m,Sae(y)),source_trace_id:"",pcb_trace_error_id:v,pcb_component_ids:["pcb_component_id"in y?y.pcb_component_id:void 0].filter(Boolean),pcb_port_ids:[...TWe([m._pcbTrace]),"pcb_port_id"in y?y.pcb_port_id:void 0].filter(Boolean)})}let C=AV({x:m.x1,y:m.y1},{x:m.x2,y:m.y2},Sae(y))-m.thickness/2;if(C+k$<A){let b=`overlap_${m.pcb_trace_id}_${x}`;if(p.has(b))continue;p.add(b),o.push({type:"pcb_trace_error",error_type:"pcb_trace_error",message:_(u(m.pcb_trace_id),`${y.type} "${u(BWe(y))}"`,C),pcb_trace_id:m.pcb_trace_id,source_trace_id:"",pcb_trace_error_id:b,pcb_component_ids:["pcb_component_id"in y?y.pcb_component_id:void 0].filter(Boolean),center:wOt(m,Sae(y)),pcb_port_ids:[...TWe([m._pcbTrace]),"pcb_port_id"in y?y.pcb_port_id:void 0].filter(Boolean)})}}}return o}function wJe(e,t){return Math.hypot(e.x-t.x,e.y-t.y)}function Din(e,t){return wJe(e,t)<=k$}function G1r(e,{connMap:t,minClearance:n=k1r}={}){let o=e.filter((s)=>s.type==="pcb_via");if(o.length<2)return[];t??=Zqe(e);let r=[],i=new Set;for(let s=0;s<o.length;s++)for(let a=s+1;a<o.length;a++){let c=o[s],l=o[a];if(Din(c,l))continue;if(!t.areIdsConnected(c.pcb_via_id,l.pcb_via_id))continue;let h=wJe(c,l)-c.outer_diameter/2-l.outer_diameter/2;if(h+k$>=n)continue;let d=[c.pcb_via_id,l.pcb_via_id].sort().join("_");i.has(d)||(i.add(d),r.push({type:"pcb_via_clearance_error",pcb_error_id:`same_net_vias_close_${d}`,message:`Vias ${hq(e,c.pcb_via_id)} and ${hq(e,l.pcb_via_id)} are too close together (gap: ${h.toFixed(3)}mm)`,error_type:"pcb_via_clearance_error",pcb_via_ids:[c.pcb_via_id,l.pcb_via_id],minimum_clearance:n,actual_clearance:h,pcb_center:{x:(c.x+l.x)/2,y:(c.y+l.y)/2}}))}return r}function U1r(e,{connMap:t,minClearance:n=L1r}={}){let o=e.filter((s)=>s.type==="pcb_via");if(o.length<2)return[];t??=Zqe(e);let r=[],i=new Set;for(let s=0;s<o.length;s++)for(let a=s+1;a<o.length;a++){let c=o[s],l=o[a];if(Din(c,l))continue;if(t.areIdsConnected(c.pcb_via_id,l.pcb_via_id))continue;let h=wJe(c,l)-c.outer_diameter/2-l.outer_diameter/2;if(h+k$>=n)continue;let d=[c.pcb_via_id,l.pcb_via_id].sort().join("_");i.has(d)||(i.add(d),r.push({type:"pcb_via_clearance_error",pcb_error_id:`different_net_vias_close_${d}`,message:`Vias ${hq(e,c.pcb_via_id)} and ${hq(e,l.pcb_via_id)} from different nets are too close together (gap: ${h.toFixed(3)}mm)`,error_type:"pcb_via_clearance_error",pcb_via_ids:[c.pcb_via_id,l.pcb_via_id],minimum_clearance:n,actual_clearance:h,pcb_center:{x:(c.x+l.x)/2,y:(c.y+l.y)/2}}))}return r}var DWe=(e)=>({minSpacing:e,minClearance:e}),uy={traceClearance:0.1,viaClearance:0.1},Nin=(e)=>((t)=>("layer"in t))(e)?[e.layer]:e.layers;function W1r(e,t,n){let o,r=Number.POSITIVE_INFINITY;for(let i of t){let s=n.get(i);if(!s)continue;let a=Math.hypot(s.x-e.x,s.y-e.y);a<r&&(r=a,o=i)}return o??t[0]}function X1r(e){let t=[],n=new Set,o=new Set,r=function(i){let s=new Map;for(let a of i.connections)for(let c of a.pointsToConnect)c.pcb_port_id&&s.set(c.pcb_port_id,{x:c.x,y:c.y});return s}(e);for(let i of e.obstacles){let s=i.connectedTo,a=s.find((y)=>y.startsWith("pcb_smtpad_")),c=s.find((y)=>y.startsWith("pcb_plated_hole_")),l=s.filter((y)=>y.startsWith("pcb_port_")),h=W1r(i.center,l,r);if(!a&&!c&&!h)continue;let d=i.layers;if(d.length===0)continue;let{width:u,height:_}=i,p=i.center.x,m=i.center.y,A=i.ccwRotationDegrees,g=typeof A=="number"&&Number.isFinite(A);if(d.length>1){let y=c??`pcb_plated_hole_${p.toFixed(3)}_${m.toFixed(3)}`;if(o.has(y))continue;if(o.add(y),g){let x=Math.max(0.5*Math.min(u,_),0.1);t.push({type:"pcb_plated_hole",pcb_plated_hole_id:y,shape:"rotated_pill_hole_with_rect_pad",hole_shape:"rotated_pill",pad_shape:"rect",hole_width:x,hole_height:x,hole_ccw_rotation:A,rect_pad_width:u,rect_pad_height:_,rect_ccw_rotation:A,hole_offset_x:0,hole_offset_y:0,x:p,y:m,layers:d,...h?{pcb_port_id:h}:{}});continue}if(Math.abs(u-_)<0.001){t.push({type:"pcb_plated_hole",pcb_plated_hole_id:y,shape:"circle",outer_diameter:Math.max(u,_),hole_diameter:Math.max(0.5*Math.min(u,_),0.1),x:p,y:m,layers:d,...h?{pcb_port_id:h}:{}});continue}t.push({type:"pcb_plated_hole",pcb_plated_hole_id:y,shape:"circular_hole_with_rect_pad",hole_shape:"circle",hole_diameter:Math.max(0.5*Math.min(u,_),0.1),rect_pad_width:u,rect_pad_height:_,hole_offset_x:0,hole_offset_y:0,x:p,y:m,layers:d,...h?{pcb_port_id:h}:{}});continue}let f=a??`pcb_smtpad_${p.toFixed(3)}_${m.toFixed(3)}`;n.has(f)||(n.add(f),g?t.push({type:"pcb_smtpad",pcb_smtpad_id:f,layer:d[0],shape:"rotated_rect",x:p,y:m,width:u,height:_,ccw_rotation:A,...h?{pcb_port_id:h}:{}}):t.push({type:"pcb_smtpad",pcb_smtpad_id:f,layer:d[0],shape:"rect",width:u,height:_,x:p,y:m,...h?{pcb_port_id:h}:{}}))}return t}function j1r(e,t,n=0.1,o=e.minViaDiameter??0.3){let r=[];r.push(...function(s,a){let c=[];return s.connections.forEach((l)=>{let h=l.pointsToConnect.filter((m)=>m.pcb_port_id).map((m)=>m.pcb_port_id).filter(Boolean),d=l.netConnectionName||l.rootConnectionName||l.name,u=[],_=a.find((m)=>(m.connection_name??m.connectionName)===l.name);if(_){let m=(g)=>("route_type"in g)&&g.route_type==="jumper"?g.start:("x"in g)&&("y"in g)?{x:g.x,y:g.y}:{x:0,y:0},A=[m(_.route[0]),m(_.route[_.route.length-1])];for(let g of A)for(let f of s.obstacles)_S(g,f)<=0&&u.push(f)}let p=c.find((m)=>m.type==="source_trace"&&m.source_trace_id===d);if(p){let m=p;m.connected_source_port_ids=[...new Set([...m.connected_source_port_ids,...h])]}else c.push({type:"source_trace",source_trace_id:d,connected_source_port_ids:h.concat(u.flatMap((m)=>[`obstacle_${m.center.x.toFixed(3)}_${m.center.y.toFixed(3)}_${m.layers.join(".")}`,...m.connectedTo])),connected_source_net_ids:[]})}),c}(e,t)),r.push(...function(s){let a=new Map;return s.connections.forEach((c)=>{c.pointsToConnect.forEach((l)=>{l.pcb_port_id&&a.set(l.pcb_port_id,{type:"pcb_port",pcb_port_id:l.pcb_port_id,source_port_id:l.pcb_port_id,x:l.x,y:l.y,layers:Nin(l)})})}),Array.from(a.values())}(e)),r.push(...X1r(e)),r.push(...function(s,a,c=0.3,l=!1){let h=[],d=new Set;return s.length>0&&("type"in s[0]&&s[0].type==="pcb_trace"?s.forEach((u)=>{u.route.forEach((_)=>{if(_.route_type==="via"){let p=_.via_diameter??c,m=`${_.x},${_.y},${_.from_layer},${_.to_layer}`;d.has(m)||(h.push({type:"pcb_via",pcb_via_id:`via_${h.length}`,pcb_trace_id:u.pcb_trace_id,x:_.x,y:_.y,outer_diameter:p,hole_diameter:0.5*p,layers:jje(_,a,l)}),d.add(m))}})}):s.forEach((u,_)=>{let p=`trace_${_}`,m=u.viaDiameter??c;for(let A=1;A<u.route.length;A++){let g=u.route[A-1],f=u.route[A];if(g.z!==f.z&&Math.abs(g.x-f.x)<0.01&&Math.abs(g.y-f.y)<0.01){let y=iy(g.z,a),x=iy(f.z,a),C=`${f.x},${f.y},${y},${x}`;d.has(C)||(h.push({type:"pcb_via",pcb_via_id:`via_${h.length}`,pcb_trace_id:p,x:f.x,y:f.y,outer_diameter:m,hole_diameter:0.5*m,layers:jje({from_layer:y,to_layer:x},a,l)}),d.add(C))}}})),h}(t,e.layerCount,o,e.allowBlindAndBuriedVias));let i=new Map;return e.connections.forEach((s)=>{i.set(s.name,s.netConnectionName||s.rootConnectionName||s.name)}),t.length>0&&("type"in t[0]&&t[0].type==="pcb_trace"?t.forEach((s)=>{let a=s.connection_name;r.push(function(c,l){return{type:"pcb_trace",pcb_trace_id:c.pcb_trace_id,source_trace_id:l,route:c.route.map((h)=>h.route_type==="wire"?{route_type:"wire",x:h.x,y:h.y,width:h.width,layer:h.layer,start_pcb_port_id:h.start_pcb_port_id,end_pcb_port_id:h.end_pcb_port_id}:h.route_type==="via"?{route_type:"via",x:h.x,y:h.y,from_layer:h.from_layer,to_layer:h.to_layer}:null).filter((h)=>h!==null)}}(s,i.get(a)||a))}):t.forEach((s,a)=>{let c=s.connectionName,l=function(h,d,u,_=0.1,p){let m=[];if(!h.jumpers||h.jumpers.length===0)return[{type:"pcb_trace",pcb_trace_id:d,source_trace_id:u,route:h.route.map((y,x)=>{let C=x===0,b=x===h.route.length-1;return{route_type:"wire",x:y.x,y:y.y,width:_,layer:iy(y.z,p),...C&&y.pcb_port_id?{start_pcb_port_id:y.pcb_port_id}:{},...b&&y.pcb_port_id?{end_pcb_port_id:y.pcb_port_id}:{}}})}];let A=[];for(let y of h.jumpers){let x=-1,C=-1;for(let b=0;b<h.route.length;b++){let I=h.route[b];Math.abs(I.x-y.start.x)<0.01&&Math.abs(I.y-y.start.y)<0.01&&(x=b),Math.abs(I.x-y.end.x)<0.01&&Math.abs(I.y-y.end.y)<0.01&&(C=b)}x!==-1&&C!==-1&&(x>C&&([x,C]=[C,x]),A.push({startIdx:x,endIdx:C}))}A.sort((y,x)=>y.startIdx-x.startIdx);let g=0,f=0;for(let{startIdx:y,endIdx:x}of A){if(y>=g){let C=h.route.slice(g,y+1);C.length>0&&(m.push({type:"pcb_trace",pcb_trace_id:`${d}_${f}`,source_trace_id:u,route:C.map((b,I)=>{let v=I===0&&g===0;return{route_type:"wire",x:b.x,y:b.y,width:_,layer:iy(b.z,p),...v&&b.pcb_port_id?{start_pcb_port_id:b.pcb_port_id}:{}}})}),f++)}g=x}if(g<h.route.length){let y=h.route.slice(g);if(y.length>0)m.push({type:"pcb_trace",pcb_trace_id:`${d}_${f}`,source_trace_id:u,route:y.map((C,b)=>{let I=b===y.length-1;return{route_type:"wire",x:C.x,y:C.y,width:_,layer:iy(C.z,p),...I&&C.pcb_port_id?{end_pcb_port_id:C.pcb_port_id}:{}}})})}return m}(s,`trace_${a}`,i.get(c)||c,n,e.layerCount);r.push(...l)})),r}var O4=(e)=>e.rootConnectionName??e.connectionName,NWe=(e,t)=>{if(e&&t)return e.getNetConnectedToId(t)},BOt=(e,t)=>t?{...e,connections:e.connections.map((n)=>{let o=NWe(t,n.name)??NWe(t,n.rootConnectionName)??n.netConnectionName;return o?{...n,netConnectionName:o}:n}),obstacles:e.obstacles.map((n)=>{let o=new Set(n.connectedTo);for(let r of n.connectedTo){let i=NWe(t,r);i&&o.add(i)}return{...n,connectedTo:[...o]}})}:e,Lx=(e,t,n)=>{if(!t)return!1;if(e===t)return!0;let o=n?.getNetConnectedToId(e),r=n?.getNetConnectedToId(t);return!(!o||!(o===r||e&&o===t))||!(!r||r!==e)},xA=(e,t,n)=>t.connectedTo?.some((o)=>Lx(e,o,n))??!1,hS=(e,t,n)=>Math.max(t,Math.min(e,n)),lV=(e,t)=>{e.x=hS(e.x,t.minX,t.maxX),e.y=hS(e.y,t.minY,t.maxY)},EO=(e,t)=>({minX:e.minX-t,minY:e.minY-t,maxX:e.maxX+t,maxY:e.maxY+t}),Rin=(e,t)=>({minCellX:Math.floor(e.minX/t),maxCellX:Math.floor(e.maxX/t),minCellY:Math.floor(e.minY/t),maxCellY:Math.floor(e.maxY/t)}),Qin=(e,t)=>`${e}:${t}`,Jje=new WeakMap,Zje=(e,t,n)=>{let o=new Map,r=Math.ceil(e.length/32);Jje.set(o,{bits:new Uint32Array(r),wordGenerations:new Uint32Array(r),generation:0});for(let i=0;i<e.length;i+=1){let s=e[i];if(!s)continue;let a=Rin(t(s),n);for(let c=a.minCellX;c<=a.maxCellX;c+=1)for(let l=a.minCellY;l<=a.maxCellY;l+=1){let h=Qin(c,l),d=o.get(h);d?d.push(i):o.set(h,[i])}}return o},i$=(e,t,n)=>{let o=Jje.get(e);o||(o={bits:new Uint32Array(0),wordGenerations:new Uint32Array(0),generation:0},Jje.set(e,o)),o.generation+=1,o.generation>4294967295&&(o.wordGenerations.fill(0),o.generation=1);let r=o.generation,i=Rin(t,n),s=1/0,a=-1;for(let l=i.minCellX;l<=i.maxCellX;l+=1)for(let h=i.minCellY;h<=i.maxCellY;h+=1){let d=e.get(Qin(l,h));if(d)for(let u of d){let _=u>>>5;if(_>=o.bits.length){let p=Math.max(_+1,2*o.bits.length),m=new Uint32Array(p);m.set(o.bits);let A=new Uint32Array(p);A.set(o.wordGenerations),o.bits=m,o.wordGenerations=A}o.wordGenerations[_]!==r&&(o.wordGenerations[_]=r,o.bits[_]=0),o.bits[_]=o.bits[_]|1<<(31&u),_<s&&(s=_),_>a&&(a=_)}}let c=[];for(let l=s;l<=a;l+=1){if(o.wordGenerations[l]!==r)continue;let h=o.bits[l];for(;h!==0;){let d=31-Math.clz32(h&-h);c.push(32*l+d),h&=h-1}}return c},TOt=0.000001,K1r=(e,t,n)=>{if(e.length===0)return[];let o=n?.traceThickness??0.1,r=e[0],i=e.at(-1),s=(h)=>{if(h.pcb_port_id)return h.pcb_port_id;let d=iy(h.z,t);return n?.connectionPoints?.find((u)=>{return u.pcb_port_id&&(_=u,p=h,Math.abs(_.x-p.x)<=TOt&&Math.abs(_.y-p.y)<=TOt)&&Nin(u).includes(d);var _,p})?.pcb_port_id},a=s(r),c=s(i),l=[{route_type:"wire",x:r.x,y:r.y,width:o,layer:iy(r.z,t),...a?{start_pcb_port_id:a}:{},...e.length===1&&c?{end_pcb_port_id:c}:{}}];for(let h=1;h<e.length;h+=1){let d=e[h-1],u=e[h];d&&u&&(d.z!==u.z&&d.x===u.x&&d.y===u.y&&l.push({route_type:"via",x:u.x,y:u.y,from_layer:iy(d.z,t),to_layer:iy(u.z,t),...n?.viaDiameter?{via_diameter:n.viaDiameter}:{}}),l.push({route_type:"wire",x:u.x,y:u.y,width:o,layer:iy(u.z,t),...h===e.length-1&&c?{end_pcb_port_id:c}:{}}))}return l},RWe=(e,t)=>({x:Mf(e.x,t.minX,t.maxX),y:Mf(e.y,t.minY,t.maxY)}),DOt=(e,t)=>{let n=e.x-t.center.x,o=e.y-t.center.y;return t.circular?Math.max(0,Math.hypot(n,o)-t.halfWidth):cXt(mw(t.worldToLocal,e),{minX:-t.halfWidth,maxX:t.halfWidth,minY:-t.halfHeight,maxY:t.halfHeight})},j7=(e,t)=>({kind:"line",start:e,end:t,bounds:p$e([e,t])}),MO=(e,t)=>({kind:"circle",center:e,radius:t,bounds:Md({center:e,width:2*t,height:2*t})}),$1r=(e)=>{let t=e.clearance+Dr;if(e.circular)return[MO(e.center,e.halfWidth+t)];let n=(i,s)=>mw(e.localToWorld,{x:i,y:s}),{halfWidth:o,halfHeight:r}=e;return[j7(n(-o,-r-t),n(o,-r-t)),j7(n(o+t,-r),n(o+t,r)),j7(n(o,r+t),n(-o,r+t)),j7(n(-o-t,r),n(-o-t,-r)),MO(n(-o,-r),t),MO(n(o,-r),t),MO(n(o,r),t),MO(n(-o,r),t)]},kin=(e,t)=>{if(t.kind==="circle"){let n=e.x-t.center.x,o=e.y-t.center.y,r=Math.hypot(n,o);return r===0?[{x:t.center.x+t.radius,y:t.center.y},{x:t.center.x-t.radius,y:t.center.y},{x:t.center.x,y:t.center.y+t.radius},{x:t.center.x,y:t.center.y-t.radius}]:[{x:t.center.x+n*t.radius/r,y:t.center.y+o*t.radius/r}]}return[t.start,t.end,mm(e,t.start,t.end)]},NOt=(e,t)=>{let n=e.end.x-e.start.x,o=e.end.y-e.start.y,r=e.start.x-t.center.x,i=e.start.y-t.center.y,s=n*n+o*o;if(s===0)return[];let a=2*(r*n+i*o),c=a*a-4*s*(r*r+i*i-t.radius*t.radius);if(c<0)return[];let l=Math.sqrt(c);return[(-a-l)/(2*s),(-a+l)/(2*s)].filter((h)=>h>=0&&h<=1).map((h)=>({x:e.start.x+n*h,y:e.start.y+o*h}))},Lin=(e,t)=>{if(e.kind==="line"&&t.kind==="circle")return NOt(e,t);if(e.kind==="circle"&&t.kind==="line")return NOt(t,e);if(e.kind==="line"&&t.kind==="line"){let l=vw(e.start,e.end,t.start,t.end);return l?[l]:[]}if(e.kind!=="circle"||t.kind!=="circle")return[];let n=t.center.x-e.center.x,o=t.center.y-e.center.y,r=Math.hypot(n,o);if(r===0||r>e.radius+t.radius||r<Math.abs(e.radius-t.radius))return[];let i=(e.radius**2-t.radius**2+r**2)/(2*r),s=Math.sqrt(Math.max(0,e.radius**2-i**2)),a=e.center.x+n*i/r,c=e.center.y+o*i/r;return[{x:a-o*s/r,y:c+n*s/r},{x:a+o*s/r,y:c-n*s/r}]},q1r=(e,t,n,o,r)=>{let i=new Set(function(s,a,c=1){if(c===0)throw Error("step cannot be 0");let l,h;a===void 0?(l=0,h=s):(l=s,h=a);let d=[];if(c>0)for(let u=l;u<h;u+=c)d.push(u);else for(let u=l;u>h;u+=c)d.push(u);return d}(e.allowBlindAndBuriedVias?Math.min(...o):0,e.allowBlindAndBuriedVias?Math.max(...o)+1:e.layerCount).map((s)=>iy(s,e.layerCount)));return e.obstacles.filter((s)=>!s.isCopperPour&&s.layers.some((a)=>i.has(a))).map((s)=>{let a=typeof s.ccwRotationDegrees=="number"&&Number.isFinite(s.ccwRotationDegrees),c=!a&&s.layers.length>1&&Math.abs(s.width-s.height)<0.001,l=d$e($O(s.center.x,s.center.y),JWt(a?s.ccwRotationDegrees:0)),h=c?Math.max(s.width,s.height)/2:s.width/2,d=c?h:s.height/2,u=xA(O4(t),s,r)||xA(t.connectionName,s,r),_=n+(u?0:o6e(e)),p=p$e(KWt(l,[{x:-h,y:-d},{x:h,y:-d},{x:h,y:d},{x:-h,y:d}])),m=_+Dr;return{center:s.center,halfWidth:h,halfHeight:d,localToWorld:l,worldToLocal:$Wt(l),circular:c,clearance:_,bounds:{minX:p.minX-m,maxX:p.maxX+m,minY:p.minY-m,maxY:p.maxY+m}}})},J1r=(e,t,n,o)=>{let r=Math.min(...e.zLayers),i=Math.max(...e.zLayers),s=t.filter((h)=>h.z>=r&&h.z<=i&&!Lx(e.rootConnectionName,h.rootConnectionName,o)).map((h)=>({segment:h,required:e.radius+h.radius+n})).filter(({segment:h,required:d})=>oc(e,h.start,h.end)<=d+lQ),a=s.flatMap(({segment:h,required:d})=>{let{start:u,end:_}=h,p=Math.sqrt(z7(u,_));if(p<=Dr)return[];let m=d+Dr,A=(_.y-u.y)/p*m,g=(u.x-_.x)/p*m;return[j7({x:u.x+A,y:u.y+g},{x:_.x+A,y:_.y+g}),j7({x:u.x-A,y:u.y-g},{x:_.x-A,y:_.y-g}),MO(u,m),MO(_,m)]}).filter((h)=>cXt(e,h.bounds)<=lQ),c=[],l=(h)=>{z7(h,e)>lQ**2||c.some((d)=>z7(d,h)<0.000000000001)||s.some(({segment:d,required:u})=>oc(h,d.start,d.end)<u)||c.push(h)};l(e);for(let h=0;h<a.length;h+=1){let d=a[h];for(let u of kin(e,d))l(u);for(let u=h+1;u<a.length;u+=1){let _=a[u];if(Sw(d.bounds,_.bounds))for(let p of Lin(d,_))l(p)}}return c.sort((h,d)=>z7(h,e)-z7(d,e))},ROt=1048576,Hin=(e)=>({...e,route:e.route.map((t)=>({...t})),vias:e.vias.map((t)=>({...t}))}),ib=(e)=>e.map(Hin),YK=(e,t)=>{let n=new Set(t);return e.map((o,r)=>n.has(r)?Hin(o):o)},r_=(e,t)=>Math.abs(e.x-t.x)<=Ba&&Math.abs(e.y-t.y)<=Ba,Z1r=["pcb_smtpad","pcb_plated_hole","pcb_hole","pcb_keepout"],cy=(e)=>typeof e.type=="string"?e.type:typeof e.error_type=="string"?e.error_type:void 0,BJe=(e)=>{if(cy(e)==="pcb_pad_trace_clearance_error")return!0;let t=typeof e.message=="string"?e.message.toLowerCase():"";return(t.includes("pcb_trace")||t.includes("pcb trace"))&&Z1r.some((n)=>t.includes(n))},QOt=(e,t,n=!0)=>{let o=[],r=new Map,i=new Map;for(let s=0;s<t.length;s+=1){let a=t[s];if(!a)continue;let c=i.get(a.connectionName);c?c.push({route:a,routeIndex:s}):i.set(a.connectionName,[{route:a,routeIndex:s}])}for(let s of e.connections){let a=i.get(s.name)??[];for(let c=0;c<a.length;c+=1){let l=a[c];if(!l)continue;let h=`${s.name}_${c}`;n&&o.push({type:"pcb_trace",pcb_trace_id:h,connection_name:s.netConnectionName??s.rootConnectionName??s.name,route:K1r(l.route.route,e.layerCount,{traceThickness:l.route.traceThickness??s.nominalTraceWidth??e.nominalTraceWidth??e.minTraceWidth,viaDiameter:l.route.viaDiameter??e.minViaDiameter,connectionPoints:s.pointsToConnect})}),r.set(h,l.routeIndex)}}return{traces:o,traceRouteIndexById:r}},TJe=(e)=>{let t=typeof e.message=="string"?e.message:"",n=t.match(/gap: (-?\d+(?:\.\d+)?)mm/),o=t.match(/required: (-?\d+(?:\.\d+)?)mm/);if(n&&o){let r=Number.parseFloat(n[1]),i=Number.parseFloat(o[1]);if(Number.isFinite(r)&&Number.isFinite(i))return Math.max(0,i-r)}if(n){let r=Number.parseFloat(n[1]),i=uy.traceClearance??0.1;if(Number.isFinite(r))return Math.max(0,i-r)}return 1},Fin={projectEngineError:(e)=>({...e,center:typeof e.first_contact_center=="object"?e.first_contact_center:e.center,message:typeof e.first_contact_message=="string"?e.first_contact_message:e.message,actual_clearance:typeof e.first_actual_clearance=="number"?e.first_actual_clearance:e.actual_clearance}),getErrorSeverity:TJe},eyr={projectEngineError:(e)=>e,getErrorSeverity:(e)=>{let t=Number(e.minimum_clearance),n=Number(e.worst_actual_clearance);return Number.isFinite(t)&&Number.isFinite(n)?Math.max(0,t-n):TJe(e)}},A$=(e,t=TJe)=>e.reduce((n,o)=>n+t(o),0),zin=(e,t,n,o,r,i=Fin)=>{let s=n?.inputMode==="routes-only",a=r&&!n||s?e:BOt(e,o),{traces:c,traceRouteIndexById:l}=QOt(a,t,!s),h=n?.({srj:a,routes:t,traces:c});if(h){let p=Array.isArray(h)?h:h.errors,m=Array.isArray(h)?h:h.errorsWithCenters??h.errors;return{errors:m,count:p.length,issueScore:A$(m,i.getErrorSeverity),legacyIssueScore:A$(m.filter((A)=>!Hx(A)),i.getErrorSeverity),traceRouteIndexById:l}}if(s){a=BOt(e,o);let p=QOt(a,t);c=p.traces,l=p.traceRouteIndexById}let d=r?.evaluate(c)??((p,m={})=>{let A=Math.max(m.viaClearance??0.1,0.1),g=[...Y1r(p,DWe(m.traceClearance)),...G1r(p,DWe(A)),...U1r(p,DWe(A))],f=p.filter((b)=>b.type==="pcb_via"),y=new Map(f.map((b)=>[b.pcb_via_id,b])),x=g.map((b)=>{if("center"in b&&b.center)return b;if("pcb_center"in b&&b.pcb_center)return{...b,center:b.pcb_center};if("pcb_via_ids"in b&&Array.isArray(b.pcb_via_ids)){let[I,v]=b.pcb_via_ids;if(typeof I!="string"||typeof v!="string")return b;let P=y.get(I),M=y.get(v);if(P&&M)return{...b,center:{x:(P.x+M.x)/2,y:(P.y+M.y)/2}}}if("pcb_error_id"in b&&typeof b.pcb_error_id=="string"&&(b.pcb_error_id.startsWith("same_net_vias_close_")||b.pcb_error_id.startsWith("different_net_vias_close_"))){let I=b.pcb_error_id.replace("same_net_vias_close_","").replace("different_net_vias_close_","").split("_").filter(Boolean);if(I.length===2){let v=I[0],P=I[1];if(!v||!P)return b;let M=y.get(v),B=y.get(P);if(M&&B)return{...b,center:{x:(M.x+B.x)/2,y:(M.y+B.y)/2}}}}return b}),C=x.filter((b)=>Boolean(b.center));return{errors:g,errorsWithCenters:x,locationAwareErrors:C}})(j1r(a,c,a.minTraceWidth,a.minViaDiameter),{...uy,traceClearance:a.minTraceToPadEdgeClearance??uy.traceClearance,viaClearance:a.minTraceToPadEdgeClearance??uy.viaClearance}),u=d.errors,_=(d.errorsWithCenters.length>0?d.errorsWithCenters:d.errors).map((p)=>i.projectEngineError(p));return{errors:_,count:u.length,issueScore:A$(_,i.getErrorSeverity),legacyIssueScore:A$(_.filter((p)=>!Hx(p)),i.getErrorSeverity),traceRouteIndexById:l}},k7=(e,t,n,o,r)=>zin(e,t,n,o,r,Fin),tyr=(e,t,n,o,r)=>zin(e,t,n,o,r,eyr),p9=(e,t)=>{let n=[];for(let o=0;o<e.length;o+=1){let r=e[o];if(!r)continue;let i;for(let s=0;s<r.route.length-1;s+=1){let a=r.route[s],c=r.route[s+1];if(!a||!c)continue;if(a.z===c.z||!r_(a,c))continue;let l=i??=new Set,h=[s,s+1];for(let A=s-1;A>=0;A-=1){let g=r.route[A];if(!g||!r_(g,a))break;h.push(A)}for(let A=s+2;A<r.route.length;A+=1){let g=r.route[A];if(!g||!r_(g,a))break;h.push(A)}let d=h;if(d.some((A)=>l.has(A)))continue;for(let A of d)l.add(A);let u=d.filter((A)=>A===0||A===r.route.length-1),_=u.some((A)=>Boolean(r.route[A]?.pcb_port_id)),p=0,m=t.layerCount-1;if(t.allowBlindAndBuriedVias){let A=d.map((g)=>r.route[g].z);p=Math.min(...A),m=Math.max(...A)}n.push({routeIndex:o,rootConnectionName:O4(r),pointIndexes:d,zLayers:Array.from({length:m-p+1},(A,g)=>p+g),x:a.x,y:a.y,radius:(r.viaDiameter??t.minViaDiameter??0.3)/2,movable:u.length===0,canCanonicalize:u.length===0||!_})}}return n},ole=(e,t)=>{let n=[];for(let o=0;o<e.route.length-1;o+=1){let r=e.route[o],i=e.route[o+1];r&&i&&(r.z!==i.z||r_(r,i)||n.push({routeIndex:t,rootConnectionName:O4(e),startIndex:o,endIndex:o+1,start:r,end:i,z:r.z,radius:(e.traceThickness??0.1)/2}))}return n},Rle=(e)=>e.flatMap((t,n)=>ole(t,n)),sCe=(e)=>({minX:e.x,minY:e.y,maxX:e.x,maxY:e.y}),RO=(e)=>({minX:Math.min(e.start.x,e.end.x),minY:Math.min(e.start.y,e.end.y),maxX:Math.max(e.start.x,e.end.x),maxY:Math.max(e.start.y,e.end.y)}),Oin=(e)=>({minX:e.center.x-e.width/2,minY:e.center.y-e.height/2,maxX:e.center.x+e.width/2,maxY:e.center.y+e.height/2}),Qq=(e,t)=>{if(e.zLayers&&e.zLayers.length>0)return e.zLayers;let n=Array.from({length:t},(o,r)=>r).filter((o)=>e.layers.includes(iy(o,t)));return n.length>0?n:Array.from({length:t},(o,r)=>r)},Vin=(e,t,n)=>{let o=t.reduce((s,a)=>Math.max(s,a.radius),(e.minViaDiameter??0.3)/2),r=n.reduce((s,a)=>Math.max(s,a.radius),e.minTraceWidth/2),i=(uy.traceClearance??0.1)+L2;return Math.max(2*o+0.2+L2,o+r+i,2*r+i,r+Jqe(e)+L2,o+o6e(e)+L2)},Yin=(e,t,n)=>{let o=n.x-t.x,r=n.y-t.y,i=o*o+r*r;if(i<=Dr)return{x:t.x,y:t.y,t:0};let s=hS(((e.x-t.x)*o+(e.y-t.y)*r)/i,0,1);return{x:t.x+o*s,y:t.y+r*s,t:s}},mb=(e,t)=>Yin(e,t.start,t.end),hQ=(e,t)=>{let n=t.width/2,o=t.height/2,r=Math.max(Math.abs(e.x-t.center.x)-n,0),i=Math.max(Math.abs(e.y-t.center.y)-o,0);return Math.hypot(r,i)},l6e=(e,t)=>e.x>=t.center.x-t.width/2-Ba&&e.x<=t.center.x+t.width/2+Ba&&e.y>=t.center.y-t.height/2-Ba&&e.y<=t.center.y+t.height/2+Ba,DJe=(e,t,n,o)=>e.obstacles.find((r)=>xA(O4(t),r,o)&&Qq(r,e.layerCount).includes(n.z)&&l6e(n,r)),UCe=(e,t,n=0.6,o)=>{let r;for(let i of e.obstacles){let s=hQ(t,i);s>n||(o&&!o(i)||(!r||s<r.distance)&&(r={obstacle:i,distance:s}))}return r?.obstacle},h6e=(e,t,n)=>{let o=t.width/2,r=t.height/2,i=hS(e.x,t.center.x-o,t.center.x+o),s=hS(e.y,t.center.y-r,t.center.y+r),a=e.x-i,c=e.y-s,l=Math.hypot(a,c);if(l<=Dr)o-Math.abs(e.x-t.center.x)<r-Math.abs(e.y-t.center.y)?(a=e.x>=t.center.x?1:-1,c=0,l=0):(a=0,c=e.y>=t.center.y?1:-1,l=0);let h=n-l;if(h<=0)return;let d=Math.hypot(a,c);return{direction:{x:d>Dr?a/d:1,y:d>Dr?c/d:0},penetration:h}},kOt=(e,t,n,o)=>{let r=t.message;if(typeof r!="string"||!r.includes("pcb_"))return n;let i=Array.isArray(t.pcb_pad_ids)?t.pcb_pad_ids.filter((a)=>typeof a=="string"):[],s=e.obstacles.find((a)=>i.some((c)=>a.connectedTo.includes(c))&&(o?.(a)??!0));return s?s.center:UCe(e,n,0.6,o)?.center??n},Gin=(e,t)=>{let n=e.route[t];if(!n)return[];let o=[t];for(let r=t-1;r>=0;r-=1){let i=e.route[r];if(!i||!r_(i,n))break;o.push(r)}for(let r=t+1;r<e.route.length;r+=1){let i=e.route[r];if(!i||!r_(i,n))break;o.push(r)}return[...new Set(o)]},NJe=(e,t)=>{if(t<=0||t>=e.route.length-1)return;let n=Gin(e,t);return n.includes(0)||n.includes(e.route.length-1)?void 0:n},dq=(e,t)=>e.x>=t.minX-Ba&&e.x<=t.maxX+Ba&&e.y>=t.minY-Ba&&e.y<=t.maxY+Ba,eKe=(e,t)=>Math.min(e.x-t.minX,t.maxX-e.x,e.y-t.minY,t.maxY-e.y),tKe=(e,t,n)=>{let o=n.x-t.x,r=n.y-t.y,i=e.x-t.x,s=o*(e.y-t.y)-r*i;if(Math.abs(s)>Ba)return!1;let a=Math.min(t.x,n.x)-Ba,c=Math.max(t.x,n.x)+Ba,l=Math.min(t.y,n.y)-Ba,h=Math.max(t.y,n.y)+Ba;return e.x>=a&&e.x<=c&&e.y>=l&&e.y<=h},rle=(e,t)=>{if(t.length<3)return!0;for(let o=0;o<t.length;o+=1){let r=t[o],i=t[(o+1)%t.length];if(r&&i&&tKe(e,r,i))return!0}let n=!1;for(let o=0,r=t.length-1;o<t.length;r=o,o+=1){let i=t[o],s=t[r];if(!i||!s)continue;i.y>e.y!=s.y>e.y&&e.x<(s.x-i.x)*(e.y-i.y)/(s.y-i.y)+i.x&&(n=!n)}return n},LOt=(e,t)=>{let n=Math.hypot(e,t);if(!(n<=Dr))return{x:e/n,y:t/n}},Uin=(e,t)=>e.outline&&e.outline.length>=3?((n,o)=>{let r=rle(n,o),i;for(let d=0;d<o.length;d+=1){let u=o[d],_=o[(d+1)%o.length];if(!u||!_)continue;let p=Yin(n,u,_),m=Math.hypot(n.x-p.x,n.y-p.y);(!i||m<i.distance)&&(i={projection:p,start:u,end:_,distance:m})}if(!i)return;let s=LOt(r?n.x-i.projection.x:i.projection.x-n.x,r?n.y-i.projection.y:i.projection.y-n.y);if(s)return s;let a=i.end.x-i.start.x,c=i.end.y-i.start.y,l=Math.hypot(a,c);if(l<=Dr)return;let h=((d)=>{let u=0;for(let _=0;_<d.length;_+=1){let p=d[_],m=d[(_+1)%d.length];p&&m&&(u+=p.x*m.y-m.x*p.y)}return u/2})(o)>=0;return{x:h?-c/l:c/l,y:h?a/l:-a/l}})(t,e.outline):((n,o)=>{let r=n.x-o.minX,i=o.maxX-n.x,s=n.y-o.minY,a=o.maxY-n.y,c=Math.min(r,i,s,a),l=0,h=0;return r<=c+Ba&&(l+=1),i<=c+Ba&&(l-=1),s<=c+Ba&&(h+=1),a<=c+Ba&&(h-=1),LOt(l,h)})(t,e.bounds),Win=(e,t)=>e.outline&&e.outline.length>=3?rle(t,e.outline):dq(t,e.bounds),R2=(e,t)=>{if(e.outline&&e.outline.length>=3){let n=((o,r)=>{let i=Number.POSITIVE_INFINITY;for(let s=0;s<r.length;s+=1){let a=r[s],c=r[(s+1)%r.length];a&&c&&(i=Math.min(i,oc(o,a,c)))}return i})(t,e.outline);return rle(t,e.outline)?n:-n}return eKe(t,e.bounds)},K7=(e,t,n)=>{if(Math.abs(t.x-n.x)<=Ba&&Math.abs(t.y-n.y)<=Ba)return Math.min(R2(e,t),R2(e,n));if(e.outline&&e.outline.length>=3){if(!rle(t,e.outline)||!rle(n,e.outline))return Math.min(R2(e,t),R2(e,n));let o=Number.POSITIVE_INFINITY;for(let r=0;r<e.outline.length;r+=1){let i=e.outline[r],s=e.outline[(r+1)%e.outline.length];i&&s&&(o=Math.min(o,s_(t,n,i,s)))}return o}return dq(t,e.bounds)&&dq(n,e.bounds)?Math.min(eKe(t,e.bounds),eKe(n,e.bounds)):Math.min(R2(e,t),R2(e,n))},uq=(e,t)=>t+Math.max(0.16,e.defaultObstacleMargin??0,uy.traceClearance??0.1),d6e=(e,t,n)=>t<e-Ba&&Math.min(e,t)<=n+Ba,Xin=(e,t,n,o,r)=>{let i=e*n.x+t*n.y,s=-Math.max(0,o-r);if(i>=s-Ba)return{x:e,y:t};let a=s-i;return{x:e+n.x*a,y:t+n.y*a}},RJe=(e,t,n,o,r)=>{let i=Uin(e,t);return i?Xin(n,o,i,R2(e,t),uq(e,r)):{x:n,y:o}},HOt=(e,t,n,o)=>{let r=[...new Set(n)].sort((c,l)=>c-l);if(r.length===0)return Number.POSITIVE_INFINITY;let i=new Set(r),s=(c)=>o?.get(c)??t.route[c],a=Number.POSITIVE_INFINITY;for(let c of r){let l=s(c);l&&(a=Math.min(a,R2(e,l)))}for(let c=0;c<t.route.length-1;c+=1){if(!i.has(c)&&!i.has(c+1))continue;let l=s(c),h=s(c+1);l&&h&&(a=Math.min(a,K7(e,l,h)))}return a},u6e=(e,t,n,o,r,i)=>{let s=[...new Set(n)].sort((u,_)=>u-_);if(s.length===0)return;let a=((u,_,p,m,A,g)=>{let f=[...new Set(p)].sort((C,b)=>C-b),y={x:m,y:A},x=uq(u,g);for(let C=0;C<Math.max(1,f.length);C+=1){let b=!1;for(let I of f){let v=_.route[I];if(!v)continue;let P=Uin(u,v);if(!P)continue;let M=Xin(y.x,y.y,P,R2(u,v),x);(Math.abs(M.x-y.x)>Dr||Math.abs(M.y-y.y)>Dr)&&(y=M,b=!0)}if(!b)break}return y})(e,t,s,o,r,i);if(Math.abs(a.x)<=Dr&&Math.abs(a.y)<=Dr)return;let c=new Map;for(let u of s){let _=t.route[u];if(!_)continue;let p={x:_.x+a.x,y:_.y+a.y};c.set(u,p)}let l=HOt(e,t,s),h=HOt(e,t,s,c);if(h<i-Ba)return;let d=uq(e,i);return d6e(l,h,d)?void 0:a},WCe=(e,t,n,o,r,i,s)=>{let a=e[t];if(!a)return!1;let c=NJe(a,n);if(!c)return!1;let l=u6e(i,a,c,o,r,s);if(!l)return!1;let h=!1;for(let d of c){let u=a.route[d];u&&(u.x+=l.x,u.y+=l.y,lV(u,i.bounds),h=!0)}return h},FOt=(e,t,n,o,r,i)=>NJe(t,n)??((s,a,c,l,h,d)=>{let u=a.route[c];if(!u||u.pcb_port_id||c!==0&&c!==a.route.length-1)return;let _=DJe(s,a,u,d);if(!_)return;let p={...u,x:u.x+l,y:u.y+h};return Win(s,p)&&l6e(p,_)?Gin(a,c):void 0})(e,t,n,o,r,i),jin=(e,t,n,o,r,i)=>{let s=u6e(r,e,t,n,o,i);if(!s)return!1;let a=!1;for(let c of t){let l=e.route[c];l&&(l.x+=s.x,l.y+=s.y,lV(l,r.bounds),a=!0)}return a},zOt=(e,t,n,o,r,i)=>{let s=t.route[n];if(!s)return!1;if(s.pcb_port_id)return!1;let a=DJe(e,t,s,i);return!!a&&l6e({...s,x:s.x+o,y:s.y+r},a)},nyr=(e,t,n,o)=>{let r=t.route[n];if(r&&!r.pcb_port_id)return DJe(e,t,r,o)},OOt=(e,t,n,o,r,i,s)=>{let a=e[t];if(!a||a.route.length===0)return!1;let c=((_,p,m,A,g)=>{let{NEGATIVE_INFINITY:f,POSITIVE_INFINITY:y,NEGATIVE_INFINITY:x,POSITIVE_INFINITY:C}=Number;for(let b of[0,p.route.length-1]){let I=p.route[b],v=nyr(_,p,b,g);if(!I||!v)return;f=Math.max(f,v.center.x-v.width/2-I.x),y=Math.min(y,v.center.x+v.width/2-I.x),x=Math.max(x,v.center.y-v.height/2-I.y),C=Math.min(C,v.center.y+v.height/2-I.y)}if(!(f>y||x>C))return{x:hS(m,f,y),y:hS(A,x,C)}})(r,a,n,o,s);if(!c)return!1;let l=a.route.map((_,p)=>p),h=u6e(r,a,l,c.x,c.y,i);if(!h)return!1;let d=a.route.length-1;if(!zOt(r,a,0,h.x,h.y,s)||!zOt(r,a,d,h.x,h.y,s))return!1;let u=!1;for(let _ of a.route)_.x+=h.x,_.y+=h.y,lV(_,r.bounds),u=!0;return u},VOt=(e,t,n)=>{let o=t.x-e.x,r=t.y-e.y,i=n.x-t.x,s=n.y-t.y;return Math.abs(o*s-r*i)<=Ba},YOt=(e,t)=>{if(e.z!==t.z)return!1;let n=t.end.x-t.start.x,o=t.end.y-t.start.y,r=e.x-t.start.x,i=e.y-t.start.y;return Math.abs(n*i-o*r)<=Ba},oyr=(e,t)=>{let n=((r,i)=>{let s=i.end.x-i.start.x,a=i.end.y-i.start.y,c=Math.max(Ba,0.12*(r.traceThickness??0.1)),l=Math.abs(a)<=c,h=Math.abs(s)<=c,{startIndex:d,endIndex:u}=i;if(l||h){let _=l?(i.start.y+i.end.y)/2:(i.start.x+i.end.x)/2;for(;d>0;){let p=r.route[d-1];if(!p||p.z!==i.z||Math.abs((l?p.y:p.x)-_)>c)break;d-=1}for(;u<r.route.length-1;){let p=r.route[u+1];if(!p||p.z!==i.z||Math.abs((l?p.y:p.x)-_)>c)break;u+=1}return Array.from({length:u-d+1},(p,m)=>d+m)}for(;d>0;){let _=r.route[d-1],p=r.route[d],m=r.route[d+1];if(!(_&&p&&m&&_.z===i.z&&YOt(_,i)&&VOt(_,p,m)))break;d-=1}for(;u<r.route.length-1;){let _=r.route[u-1],p=r.route[u],m=r.route[u+1];if(!(_&&p&&m&&m.z===i.z&&YOt(m,i)&&VOt(_,p,m)))break;u+=1}return Array.from({length:u-d+1},(_,p)=>d+p)})(e,t);if(n.length<=2)return;let o=[];for(let r of n){let i=NJe(e,r);if(!i)return;o.push(...i)}return[...new Set(o)]},nKe=(e,t)=>t>0&&t<e.route.length-1&&!((n,o)=>{let r=n.route[o];if(!r)return!1;let i=n.route[o-1],s=n.route[o+1];return i&&i.z!==r.z&&r_(i,r)||s&&s.z!==r.z&&r_(s,r)})(e,t),GOt=(e,t,n)=>{let o=e.route[t.startIndex],r=e.route[t.endIndex];return!(!o||!r)&&(o.z===t.z&&r.z===t.z&&(!!((i,s)=>RO(i).maxX>=s.minX-Ba&&RO(i).minX<=s.maxX+Ba&&RO(i).maxY>=s.minY-Ba&&RO(i).minY<=s.maxY+Ba)(t,n)&&(nKe(e,t.startIndex)||nKe(e,t.endIndex))))},ryr=(e,t,n,o,r,i,s)=>{let a=e[t.routeIndex];if(!a)return!1;let c=((l,h,d,u)=>{let _=EO(Oin(d),u),{startIndex:p,startIndex:m}=h;for(;p>0;){let g={...h,startIndex:p-1,endIndex:p,start:l.route[p-1],end:l.route[p]};if(!l.route[p-1]||!GOt(l,g,_))break;p-=1}for(;m<l.route.length-2;){let g={...h,startIndex:m+1,endIndex:m+2,start:l.route[m+1],end:l.route[m+2]};if(!l.route[m+2]||!GOt(l,g,_))break;m+=1}let A=[];for(let g=p;g<=m+1;g+=1)nKe(l,g)&&A.push(g);return[...new Set(A)]})(a,t,n,o);return!(c.length<=2)&&jin(a,c,r,i,s,t.radius)},UOt=(e,t)=>{let n=mb(t,e),o=n.x-t.x,r=n.y-t.y,i=Math.hypot(o,r),s=e.end.x-e.start.x,a=e.end.y-e.start.y,c=Math.hypot(s,a),l=e.routeIndex%2==0?1:-1;return{projection:n,direction:i>Dr?{x:o/i,y:r/i}:c>Dr?{x:-a/c*l,y:s/c*l}:{x:1,y:0}}},QJe=(e,t,n,o,r)=>{let i=e[t.routeIndex];if(!i)return!1;let s=RJe(r,t,n,o,t.radius);if(Math.abs(s.x)<=Dr&&Math.abs(s.y)<=Dr)return!1;let a={x:t.x+s.x,y:t.y+s.y},c=R2(r,t),l=R2(r,a);if(l<t.radius-Ba)return!1;let h=uq(r,t.radius);if(d6e(c,l,h))return!1;t.x+=s.x,t.y+=s.y,lV(t,r.bounds);for(let d of t.pointIndexes){let u=i.route[d];u&&(u.x=t.x,u.y=t.y)}return!0},Kin=(e,t,n)=>{if(!Number.isInteger(t.routeIndex))return[];let o=e[t.routeIndex];if(!o||t.routeIndex<0||t.routeIndex>=e.length)return[];let r=p9([o],n),i=r.find((a)=>a.pointIndexes.some((c)=>t.pointIndexes.includes(c)));if(!i)return[];let s=[];for(let a=0;a<e.length;a+=1){let c=e[a];if(!c||O4(c)!==i.rootConnectionName)continue;let l=a===t.routeIndex?r:p9([c],n);for(let h of l)h.routeIndex=a,h.rootConnectionName===i.rootConnectionName&&Math.hypot(h.x-i.x,h.y-i.y)<=Ba&&s.push(h)}return s},pq=(e,t,n,o,r)=>t.movable&&Kin(e,t,r).length<=1&&QJe(e,t,n,o,r),iyr=(e,t,n,o,r=1)=>{let{projection:i,direction:s}=UOt(t,n),a=lQ*r,c=1-i.t,l=i.t,h=WCe(e,t.routeIndex,t.startIndex,s.x*a*c,s.y*a*c,o,t.radius),d=WCe(e,t.routeIndex,t.endIndex,s.x*a*l,s.y*a*l,o,t.radius);return!(!h&&!d)||((u,_,p,m,A)=>{let g=u[_.routeIndex];if(!g)return!1;let{projection:f,direction:y}=UOt(_,p),x=RJe(m,f,y.x*lQ*A,y.y*lQ*A,_.radius);if(Math.abs(x.x)<=Dr&&Math.abs(x.y)<=Dr)return!1;let C={...g.route[_.startIndex],x:f.x+x.x,y:f.y+x.y};if(lV(C,m.bounds),oc(C,_.start,_.end)<=Ba)return!1;let b=g.route[_.startIndex],I=g.route[_.endIndex];if(!b||!I)return!1;let v=K7(m,b,I),P=Math.min(R2(m,C),K7(m,b,C),K7(m,C,I));if(P<_.radius-Ba)return!1;let M=uq(m,_.radius);return!d6e(v,P,M)&&(g.route.splice(_.endIndex,0,C),!0)})(e,t,n,o,r)},syr=(e,t,n,o,r,i=1)=>{let s=t.radius+Jqe(o)+L2,a=esn(t,n,s);if(!a)return!1;let c=Math.min(0.3*Math.abs(i),a.penetration+L2),l=a.direction.x*c,h=a.direction.y*c,d=e[t.routeIndex];if(!d)return!1;let u=!((P)=>{for(let M=0;M<P.route.length-1;M+=1){let B=P.route[M],T=P.route[M+1];if(B&&T&&B.z!==T.z&&r_(B,T))return!0}return!1})(d);if(u&&OOt(e,t.routeIndex,l,h,o,t.radius,r))return!0;if(ryr(e,t,n,s,l,h,o)||((P,M,B,T,N)=>{let D=P[M.routeIndex];if(!D)return!1;let L=oyr(D,M);return!!L&&jin(D,L,B,T,N,M.radius)})(e,t,l,h,o)||((P,M,B,T,N,D)=>{let L=P[M.routeIndex];if(!L)return!1;let H=FOt(N,L,M.startIndex,B,T,D),V=FOt(N,L,M.endIndex,B,T,D);if(!H||!V)return!1;let O=[...new Set([...H,...V])],U=u6e(N,L,O,B,T,M.radius);if(!U)return!1;let j=!1;for(let Y of O){let X=L.route[Y];X&&(X.x+=U.x,X.y+=U.y,lV(X,N.bounds),j=!0)}return j})(e,t,l,h,o,r))return!0;if(!u&&OOt(e,t.routeIndex,l,h,o,t.radius,r))return!0;let p=n.width/2,m=n.height/2,A=(Math.abs(a.direction.y)>=Math.abs(a.direction.x)?[{...d.route[t.startIndex],x:n.center.x-p-s,y:n.center.y+a.direction.y*(m+s)},{...d.route[t.startIndex],x:n.center.x+p+s,y:n.center.y+a.direction.y*(m+s)}]:[{...d.route[t.startIndex],x:n.center.x+a.direction.x*(p+s),y:n.center.y-m-s},{...d.route[t.startIndex],x:n.center.x+a.direction.x*(p+s),y:n.center.y+m+s}]).map((P)=>{let{t:M}=mb(P,t),B={x:t.start.x+(t.end.x-t.start.x)*M,y:t.start.y+(t.end.y-t.start.y)*M},T=RJe(o,B,P.x-B.x,P.y-B.y,t.radius);return P.x=B.x+T.x,P.y=B.y+T.y,lV(P,o.bounds),{point:P,t:M,moved:Math.abs(T.x)>Dr||Math.abs(T.y)>Dr,awayFromObstacleMotion:T.x*a.direction.x+T.y*a.direction.y}}).sort((P,M)=>P.t-M.t);if(!A.some(({moved:P})=>P))return!1;if(!A.some(({awayFromObstacleMotion:P})=>P>Ba))return!1;let g=A.map(({point:P})=>P);if(g.every((P)=>oc(P,t.start,t.end)<=Ba))return!1;if(g.some((P)=>!Win(o,P)))return!1;let f=d.route[t.startIndex],y=d.route[t.endIndex],x=g[0],C=g[1];if(!(f&&y&&x&&C))return!1;let b=K7(o,f,y),I=Math.min(R2(o,x),R2(o,C),K7(o,f,x),K7(o,x,C),K7(o,C,y));if(I<t.radius-Ba)return!1;let v=uq(o,t.radius);return!d6e(b,I,v)&&(d.route.splice(t.endIndex,0,...g),!0)},nS=(e,t,n)=>{let o;for(let r of e){if(n!==void 0&&r.routeIndex!==n)continue;let i=mb(t,r),s=Math.hypot(i.x-t.x,i.y-t.y);(!o||s<o.distance)&&(o={segment:r,distance:s})}return o?.segment},tce=(e,t,n)=>{let o;for(let r of e){if(n!==void 0&&r.routeIndex!==n)continue;let i=Math.hypot(r.x-t.x,r.y-t.y);(!o||i<o.distance)&&(o={via:r,distance:i})}return o?.via},ayr=(e,t)=>{let n=e.map((o)=>({via:o,distance:Math.hypot(o.x-t.x,o.y-t.y)})).sort((o,r)=>o.distance-r.distance).slice(0,2).map(({via:o})=>o);return n.length===2?n:void 0},QWe=(e,t,n,o)=>{let r=t.x-n.x,i=t.y-n.y,s=Math.hypot(r,i);return pq(e,t,(s>Dr?r/s:1)*lQ,(s>Dr?i/s:0)*lQ,o)},$in=(e,t)=>{let n=mb(e.start,t),o=mb(e.end,t),r=mb(t.start,e),i=mb(t.end,e),s=[{leftT:0,rightT:n.t,leftPoint:e.start,rightPoint:n},{leftT:1,rightT:o.t,leftPoint:e.end,rightPoint:o},{leftT:r.t,rightT:0,leftPoint:r,rightPoint:t.start},{leftT:i.t,rightT:1,leftPoint:i,rightPoint:t.end}],a=s[0],c=Math.hypot(a.leftPoint.x-a.rightPoint.x,a.leftPoint.y-a.rightPoint.y);for(let l=1;l<s.length;l+=1){let h=s[l],d=Math.hypot(h.leftPoint.x-h.rightPoint.x,h.leftPoint.y-h.rightPoint.y);d<c&&(a=h,c=d)}return a},ile=(e,t,n,o,r,i)=>{let s=hS(i,0,1),a=1-s,c=s,l=WCe(e,t.routeIndex,t.startIndex,n*a,o*a,r,t.radius),h=WCe(e,t.routeIndex,t.endIndex,n*c,o*c,r,t.radius);return l||h},qin=(e,t,n,o,r,i=0.035,s=!1,a)=>{if(!s&&(a?a.routesShareNet(t,n):Lx(t.rootConnectionName,n.rootConnectionName,r)))return!1;let c=t.radius+n.radius+0.2+L2,l=t.x-n.x,h=t.y-n.y,d=Math.hypot(l,h),u=c-d;if(u<=0)return!1;let _=1.618*(97*t.routeIndex+13*n.routeIndex),p=d>Dr?l/d:Math.cos(_),m=d>Dr?h/d:Math.sin(_),A=Number(t.movable)+Number(n.movable);if(A===0)return!1;let g=Math.min(i,u/A),f=pq(e,t,p*g,m*g,o),y=pq(e,n,-p*g,-m*g,o);return f||y},cyr=(e,t,n,o,r)=>{if(!Lx(t.rootConnectionName,n.rootConnectionName,r))return!1;let[i,s]=t.canCanonicalize?n.canCanonicalize&&t.routeIndex<=n.routeIndex?[t,n]:[n,t]:[t,n];return((a,c,l,h)=>{if(!l.canCanonicalize)return!1;let d=c.x-l.x,u=c.y-l.y;if(!l.movable&&Math.hypot(d,u)>l.radius+Ba)return!1;let _=a[l.routeIndex];if(!_)return!1;let p={x:l.x,y:l.y},m=l.pointIndexes.map((A)=>{let g=_.route[A];return g?{pointIndex:A,x:g.x,y:g.y}:void 0});if(QJe(a,l,d,u,h)&&r_(l,c))return!0;l.x=p.x,l.y=p.y;for(let A of m){if(!A)continue;let g=_.route[A.pointIndex];g&&(g.x=A.x,g.y=A.y)}return!1})(e,i,s,o)},kJe=(e,t,n,o,r,i=0.035,s=2,a=!1,c)=>{if(c?c.routesShareNet(t,n):Lx(t.rootConnectionName,n.rootConnectionName,r))return!1;let l=mb(t,n),h=t.x-l.x,d=t.y-l.y,u=Math.hypot(h,d),_=t.radius+n.radius+(uy.traceClearance??0.1)+L2-u;if(_<=0)return!1;let p=n.end.x-n.start.x,m=n.end.y-n.start.y,A=Math.hypot(p,m),g=t.routeIndex%2==0?1:-1,f=u>Dr?h/u:A>Dr?-m/A*g:1,y=u>Dr?d/u:A>Dr?p/A*g:0,x=Math.min(i,_/s),C=a?((I,v,P,M,B)=>{let T=Kin(I,v,B);if(T.length===0||T.some((D)=>!D.movable||I[D.routeIndex]===void 0))return!1;let N=T.reduce((D,L)=>L.radius>D.radius?L:D);if(!QJe(I,N,P,M,B))return!1;for(let D of T){if(D===N)continue;D.x=N.x,D.y=N.y;let L=I[D.routeIndex];for(let H of D.pointIndexes){let V=L.route[H];V&&(V.x=N.x,V.y=N.y)}}return!0})(e,t,f*x,y*x,o):pq(e,t,f*x,y*x,o),b=ile(e,n,-f*x,-y*x,o,l.t);return C||b},Jin=(e,t,n,o,r,i)=>{if(t.z!==n.z||(i?i.routesShareNet(t,n):Lx(t.rootConnectionName,n.rootConnectionName,r)))return!1;let s=$in(t,n),a=s.leftPoint.x-s.rightPoint.x,c=s.leftPoint.y-s.rightPoint.y,l=Math.hypot(a,c),h=t.radius+n.radius+(uy.traceClearance??0.1)+L2-l;if(h<=0)return!1;let d=t.end.x-t.start.x,u=t.end.y-t.start.y,_=Math.hypot(d,u),p=(t.routeIndex+n.routeIndex)%2==0?1:-1,m=l>Dr?a/l:_>Dr?-u/_*p:1,A=l>Dr?c/l:_>Dr?d/_*p:0,g=Math.min(g$,h/2),f=ile(e,t,m*g,A*g,o,s.leftT),y=ile(e,n,-m*g,-A*g,o,s.rightT);return f||y},yce=(e,t,n)=>Qq(e,n).includes(t.z),Zin=(e,t,n,o,r)=>{let i=t[n];if(!i)return;let s=ole(i,n);if(s.length===0)return;let a=O4(i),c=nS(s,o);if(!c)return;let l=UCe(e,o,0.6,(u)=>!xA(a,u,r)&&yce(u,c,e.layerCount));if(l)return{obstacle:l,segment:c};let h=UCe(e,o,0.6,(u)=>!xA(a,u,r)&&s.some((_)=>yce(u,_,e.layerCount)));if(!h)return;let d=nS(s.filter((u)=>yce(h,u,e.layerCount)),o);return d?{obstacle:h,segment:d}:void 0},esn=(e,t,n)=>{let o=t.width/2,r=t.height/2,i=[{x:t.center.x-o,y:t.center.y-r},{x:t.center.x+o,y:t.center.y-r},{x:t.center.x+o,y:t.center.y+r},{x:t.center.x-o,y:t.center.y+r}],s=[t.center,...i].map((h)=>mb(h,e)),a=[{point:e.start,t:0},{point:e.end,t:1},{point:{x:(e.start.x+e.end.x)/2,y:(e.start.y+e.end.y)/2},t:0.5},...s.map((h)=>({point:{x:h.x,y:h.y},t:h.t}))],c,l=Math.hypot(e.end.x-e.start.x,e.end.y-e.start.y);for(let h of a){let d=h6e(h.point,t,n);if(!d)continue;let u=l>Dr?Math.abs(((e.end.x-e.start.x)*d.direction.y-(e.end.y-e.start.y)*d.direction.x)/l):0;(!c||d.penetration>c.penetration+Dr||Math.abs(d.penetration-c.penetration)<=Dr&&u>c.normality)&&(c={...d,normality:u,t:h.t})}return c},lyr=(e,t,n,o=!1,r)=>{let i=!1,s=p9(t,e),a=Rle(t),c=Vin(e,s,a),l=Math.max(1,2*c),h=Zje(s,sCe,l),d=Zje(a,RO,l);for(let u=0;u<s.length;u+=1){let _=s[u];if(!_)continue;let p=i$(h,EO(sCe(_),c),l);for(let m of p){if(m<=u)continue;let A=s[m];A&&(i=qin(t,_,A,e,n,g$,o,r)||i)}}for(let u=0;u<s.length;u+=1){let _=s[u];if(!_)continue;let p=i$(d,EO(sCe(_),c),l);for(let m of p){let A=a[m];A&&(i=kJe(t,_,A,e,n,g$,2,!1,r)||i)}}for(let u=0;u<a.length;u+=1){let _=a[u];if(!_)continue;let p=i$(d,EO(RO(_),c),l);for(let m of p){if(m<=u)continue;let A=a[m];A&&(i=Jin(t,_,A,e,n,r)||i)}}return((u,_,p,m,A,g,f,y,x)=>{let C=!1,b=Jqe(u),I=m.reduce((M,B)=>Math.max(M,B.radius),0)+b+L2,v=o6e(u),P=p.reduce((M,B)=>Math.max(M,B.radius),0)+v+L2;for(let M of u.obstacles){if(M.isCopperPour)continue;let B=Oin(M),T=x?.forObstacle(M),N=i$(A,EO(B,P),f);for(let L of N){let H=p[L];if(!H)continue;if(T?T(H):xA(H.rootConnectionName,M,y))continue;let V=h6e(H,M,H.radius+v+L2);if(!V)continue;let O=Math.min(g$,V.penetration);C=pq(_,H,V.direction.x*O,V.direction.y*O,u)||C}let D=i$(g,EO(B,I),f);for(let L of D){let H=m[L];if(!H)continue;if((T?T(H):xA(H.rootConnectionName,M,y))||!yce(M,H,u.layerCount))continue;let V=esn(H,M,H.radius+b+L2);if(!V)continue;let O=Math.min(g$,V.penetration);C=ile(_,H,V.direction.x*O,V.direction.y*O,u,V.t)||C}}return C})(e,t,s,a,h,d,l,n,r)||i},LJe=(e,t,n,o=1,r,i=!1,s=!0)=>{let a=ib(t),c=((d,u,_)=>{let p=d*d<=ROt?new Uint8Array(d*d):void 0,m=d*u<=ROt,A=new WeakMap;return{routesShareNet:(g,f)=>{let y=g.routeIndex*d+f.routeIndex,x=p?.[y];if(x)return x===2;let C=Lx(g.rootConnectionName,f.rootConnectionName,_);return p&&(p[y]=C?2:1),C},forObstacle:(g)=>{let f=A.get(g);if(f)return f;let y=m?new Uint8Array(d):void 0;return f=(x)=>{let C=y?.[x.routeIndex];if(C)return C===2;let b=xA(x.rootConnectionName,g,_);return y&&(y[x.routeIndex]=b?2:1),b},A.set(g,f),f}}})(a.length,e.obstacles.length,r),l=Math.max(2,Math.round(12*Math.max(1,n)*o)),h=!1;for(let d=0;d<l;d+=1){if(!lyr(e,a,r,i,c))break;h=!0}return h&&s&&((d,u,_,p)=>{let m=!1,A=p9(u,d),g=Rle(u),f=Vin(d,A,g),y=Math.max(1,2*f),x=Zje(g,RO,y);for(let C of A){let b=i$(x,EO(sCe(C),f),y);for(let I of b){let v=g[I];v&&(m=kJe(u,C,v,d,_,g$,1.75,!1,p)||m)}}})(e,a,r,c),h?n9(a):t},hyr=(e)=>{let t=[];for(let n=0;n<e.route.length-1;n+=1){let o=e.route[n],r=e.route[n+1];if(!o||!r)continue;if(o.toNextSegmentType==="through_obstacle")continue;if(o.z===r.z||!r_(o,r))continue;let i={x:o.x,y:o.y},s=t.at(-1);s&&r_(s,i)||t.push(i)}return t},tsn=(e)=>({...e,vias:hyr(e)}),n9=(e)=>e.map(tsn),GK=(e,t)=>{let n=new Set(t);return e.map((o,r)=>n.has(r)?tsn(o):o)},WOt=(e)=>{let t=e.pcb_trace_id;if(typeof t!="string")return;let n=t.match(/^trace_(\d+)/);return n?Number.parseInt(n[1],10):void 0},Qle=(e)=>{let t=e.center??e.pcb_center;if(!t||typeof t!="object")return;let n=t;return typeof n.x=="number"&&typeof n.y=="number"?{x:n.x,y:n.y}:void 0},oKe=(e,t=!0)=>e.errors.filter((n)=>((o)=>cy(o)==="pcb_via_clearance_error"||Array.isArray(o.pcb_via_ids))(n)&&(t||!Hx(n))).length,Hx=(e)=>cy(e)==="pcb_pad_pad_clearance_error"&&Array.isArray(e.pcb_via_ids)&&e.pcb_via_ids.length===1,XOt=(e)=>{let t=Object.entries(e).filter(([o,r])=>o!=="source_trace_id"&&(o.endsWith("_id")||o.endsWith("_ids"))&&r!==void 0&&r!=="").sort(([o],[r])=>o.localeCompare(r)),n=typeof e.message=="string"?e.message.replace(/-?\d+\.\d+/g,"#"):"";return JSON.stringify([cy(e),t,n])},Nx=(e)=>Math.max(e.errors.filter((t)=>!Hx(t)).length,e.count-e.errors.filter(Hx).length),aCe=(e)=>{let t=Nx(e);return t>0?t:e.count},nsn=(e)=>{if(Nx(e)===0)return e.issueScore;let t=e.errors.filter((n)=>!Hx(n));return e.errors.some(Hx)?A$(t):e.legacyIssueScore??A$(t)},QO=(e,t)=>{let n=Nx(e),o=Nx(t);return n!==o?n<o:!(n>0)&&e.count<t.count},jOt=(e)=>{let t=e.filter((n)=>!Hx(n));return t.length>0?t:e},hV=(e,t)=>{let n=e.pcb_trace_id;return typeof n=="string"?t.get(n)??WOt(e):WOt(e)},mq=(e,t,n,o,r)=>{let i=n.pcb_port_id;if(!i)return!1;let s=(r??t.viaDiameter)/2;return e.obstacles.some((a)=>{let c=Qq(a,e.layerCount);return!(c.length!==1||c[0]!==n.z||!a.connectedTo.includes(i)||n.x-s<a.center.x-a.width/2-Dr||n.x+s>a.center.x+a.width/2+Dr||n.y-s<a.center.y-a.height/2-Dr||n.y+s>a.center.y+a.height/2+Dr)&&(xA(O4(t),a,o)||xA(t.connectionName,a,o))})},KOt=[0,1,-1,2,-2,3,-3,4],osn=KOt.flatMap((e)=>KOt.map((t)=>[e,t])).sort(([e,t],[n,o])=>Math.abs(e)+Math.abs(t)-Math.abs(n)-Math.abs(o)),rsn=osn.length,isn=(e,t,n)=>e.x-t>=n.minX-Dr&&e.x+t<=n.maxX+Dr&&e.y-t>=n.minY-Dr&&e.y+t<=n.maxY+Dr,tb=(e,t)=>{let n=e.at(-1);n&&r_(n,t)&&n.z===t.z&&n.pcb_port_id===t.pcb_port_id||e.push(t)},dyr=(e,t,n,o,r,i,s,a=0,c=!1)=>{let l=cy(n);if(l!=="pcb_pad_trace_clearance_error"&&l!=="pcb_trace_error")return!1;if(r<0||r>=e.layerCount)return!1;let h=t[o];if(!h||h.route.length<2)return!1;let d=h.route.map((X)=>({...X})),u=d[0],_=d.at(-1);if(!u||!_)return!1;let p=Qle(n);if(!p)return!1;let m=BJe(n),A=m?Zin(e,t,o,p,s):void 0,g=m?A?.segment:nS(ole(h,o),p);if(!g||g.z===r)return!1;let{startIndex:f,endIndex:y}=g,x=i==="full"?d.length:i;for(let X=0;X<x;X+=1){let K=!1;if(d[f-1]?.z===g.z&&(f-=1,K=!0),d[y+1]?.z===g.z&&(y+=1,K=!0),!K)break}let C=f===0&&u.pcb_port_id,b=y===d.length-1&&_.pcb_port_id,I=h.viaDiameter/2,v=osn[a%rsn],P=!1,M=(X)=>{let K=X==="start"?u:_,J=((re,Z,te,ie)=>{let ce=te.pcb_port_id;if(ce)return re.obstacles.find((ue)=>{let de=Qq(ue,re.layerCount);return!(de.length!==1||de[0]!==te.z||!ue.connectedTo.includes(ce)||!l6e(te,ue))&&(xA(O4(Z),ue,ie)||xA(Z.connectionName,ue,ie))})})(e,h,K,s),ee=((re,Z)=>{let te=Z==="start"?re[0]:re.at(-1);if(!te)return;let ie=Z==="start"?Array.from({length:re.length-1},(ce,ue)=>ue+1):Array.from({length:re.length-1},(ce,ue)=>re.length-ue-2);for(let ce of ie){let ue=re[ce];if(!ue)continue;let de=ue.x-te.x,me=ue.y-te.y,ge=Math.hypot(de,me);if(!(ge<=Dr))return{x:de/ge,y:me/ge}}})(d,X);if(!J||!ee)return;let se=((re,Z,te,ie)=>{let ce=0,ue=Math.hypot(Z.width,Z.height)+2*ie,de=ie+Dr,me=(ge)=>({x:re.x+te.x*ge,y:re.y+te.y*ge});if(!(hQ(me(ue),Z)<de)){for(;ue-ce>Dr;){let ge=(ce+ue)/2;hQ(me(ge),Z)>=de?ue=ge:ce=ge}return me(ue)}})(K,J,((re,Z)=>{let te=Z*Math.PI/4,ie=Math.cos(te),ce=Math.sin(te);return{x:re.x*ie-re.y*ce,y:re.x*ce+re.y*ie}})(ee,X==="start"?v[0]:v[1]),I);if(!se||!isn(se,I,e.bounds)||hQ(se,J)+Dr<I)return;if(!c)return se;let ne=((re,Z,te,ie,ce,ue)=>{let de=ie+(re.minBoardEdgeClearance??0),me={minX:re.bounds.minX+de,maxX:re.bounds.maxX-de,minY:re.bounds.minY+de,maxY:re.bounds.maxY-de};if(me.minX>me.maxX||me.minY>me.maxY)return;let ge=q1r(re,Z,ie,ce,ue),xe=(pt)=>fCe(pt,me)&&ge.every((ct)=>DOt(pt,ct)>=ct.clearance),Ee=RWe(te,me);if(xe(Ee))return fCe(te,me)?te:Ee;let Re=ge.filter((pt)=>DOt(Ee,pt)<pt.clearance),Me=new Set(Re);for(let pt=0;pt<Re.length;pt+=1)for(let ct of ge)!Me.has(ct)&&Sw(Re[pt].bounds,ct.bounds)&&(Me.add(ct),Re.push(ct));let _e=Re.flatMap($1r),ye={x:me.minX,y:me.minY},Se={x:me.maxX,y:me.minY},Ne={x:me.maxX,y:me.maxY},Le={x:me.minX,y:me.maxY},nt;_e.push(j7(ye,Se),j7(Se,Ne),j7(Ne,Le),j7(Le,ye));let dt=Number.POSITIVE_INFINITY,rt=(pt)=>{let ct=z7(pt,te);ct<dt&&xe(pt)&&(nt=pt,dt=ct)};for(let pt of _e)for(let ct of kin(te,pt))rt(ct);for(let pt=0;pt<_e.length;pt+=1){let ct=_e[pt];if(!(z7(te,RWe(te,ct.bounds))>dt))for(let Ct=pt+1;Ct<_e.length;Ct+=1){let kt=_e[Ct];if(Sw(ct.bounds,kt.bounds)&&!(z7(te,RWe(te,kt.bounds))>dt))for(let Lt of Lin(ct,kt))rt(Lt)}}return nt})(e,h,se,I,[g.z,r],s);return P||=ne!==void 0&&ne!==se,ne},B=C?M("start"):void 0,T=b?M("end"):void 0;if(C&&!B||b&&!T||c&&!P)return!1;let N=[];for(let X=0;X<f;X+=1)tb(N,d[X]);let D=d[f],L=f>0&&r_(d[f-1],D),H=d[y],V=y<d.length-1&&r_(d[y+1],H);C?(tb(N,u),tb(N,{...u,...B,pcb_port_id:void 0}),tb(N,{...u,...B,z:r,pcb_port_id:void 0})):(L||tb(N,{...D,pcb_port_id:void 0}),tb(N,{...D,z:r,pcb_port_id:void 0}));let O=b?y-1:y;for(let X=f+1;X<=O;X+=1)tb(N,{...d[X],z:r,pcb_port_id:void 0});b?(tb(N,{..._,...T,z:r,pcb_port_id:void 0}),tb(N,{..._,...T,pcb_port_id:void 0}),tb(N,_)):V||tb(N,{...H,pcb_port_id:void 0});for(let X=y+1;X<d.length;X+=1)tb(N,d[X]);for(let X=1;X<N.length-1;X+=1)N[X].pcb_port_id=void 0;let U=e.minBoardEdgeClearance??0.2,j=ole(h,o),Y=p9([h],e);for(let X=1;X<N.length;X+=1){let K=N[X-1],J=N[X];if(K.z===J.z&&!j.some((ee)=>tKe(K,ee.start,ee.end)&&tKe(J,ee.start,ee.end))&&K7(e,K,J)<h.traceThickness/2+U)return!1;if(K.z!==J.z&&K.toNextSegmentType!=="through_obstacle"&&!Y.some((ee)=>r_(ee,J)&&ee.radius>=I)&&R2(e,J)<I+U)return!1}return h.route=N,!0},uyr=(e,t,n,o,r,i,s)=>{let a=cy(n);if(a!=="pcb_pad_trace_clearance_error"&&a!=="pcb_trace_error")return!1;if(r<0||r>=e.layerCount)return!1;let c=hV(n,o);if(c===void 0)return!1;let l=t[c];if(!l||l.route.length<2)return!1;let h=l.route[0],d=l.route.at(-1);if(!h||!d||h.z!==d.z||r===h.z)return!1;if(l.route.some((_)=>_.z!==h.z))return!1;if(!h.pcb_port_id||!d.pcb_port_id)return!1;if(!mq(e,l,h,i,s)||!mq(e,l,d,i,s))return!1;let u=l.route.map((_)=>({..._}));return l.route=[u[0],{...u[0],z:r,pcb_port_id:void 0},...u.slice(1,-1).map((_)=>({..._,z:r})),{...u.at(-1),z:r,pcb_port_id:void 0},u.at(-1)],!0},pyr=(e,t,n,o,r,i,s)=>{if(cy(n)!=="pcb_pad_trace_clearance_error")return!1;let a=hV(n,o);if(a===void 0)return!1;let c=t[a];if(!c||c.route.length<4)return!1;let l=c.route.map((A)=>({...A}));if(r==="start"){let A=l[0];if(!mq(e,c,A,i,s))return!1;let g=-1;for(let b=1;b<l.length;b+=1)if(l[b].z!==A.z){g=b;break}if(g<=0)return!1;let f=g-1;if(!r_(l[f],l[g]))return!1;let y=g;for(;y+1<l.length&&r_(l[g],l[y+1]);)y+=1;let x=l[y].z,C=l.slice(f,y+1).map((b)=>b.z);return c.route=[A,...C.slice(1).map((b)=>({...A,z:b,pcb_port_id:void 0})),...l.slice(1,f+1).map((b)=>({...b,z:x})),...l.slice(y+1)],!0}let h=l.at(-1);if(!mq(e,c,h,i,s))return!1;let d=-1;for(let A=l.length-2;A>=0;A-=1)if(l[A].z!==h.z){d=A;break}if(d<0||d>=l.length-1)return!1;let u=d+1;if(!r_(l[d],l[u]))return!1;let _=d;for(;_-1>=0&&r_(l[d],l[_-1]);)_-=1;let p=l[_].z,m=l.slice(_,u+1).map((A)=>A.z);return c.route=[...l.slice(0,_+1),...l.slice(u+1,-1).map((A)=>({...A,z:p})),{...h,z:p,pcb_port_id:void 0},...m.slice(1,-1).map((A)=>({...h,z:A,pcb_port_id:void 0})),h],!0},kle=(e,t)=>{let n=e.pcb_trace_id;if(typeof n!="string")return;if(Array.isArray(e.pcb_via_ids)&&e.pcb_via_ids.length>0)return;let o=Array.isArray(e.pcb_trace_ids)?e.pcb_trace_ids.filter((l)=>typeof l=="string"):[],r=e.pcb_trace_error_id,i=`overlap_${n}_`,s=typeof r=="string"&&r.startsWith(i)?r.slice(i.length):void 0,a=[n,...o,...s?[s]:[]],c=[...new Set(a.map((l)=>t.get(l)).filter((l)=>l!==void 0))];return c.length>=2?[c[0],c[1]]:void 0},myr=(e,t,n,o,r)=>{if(cy(n)!=="pcb_trace_error")return;let i=kle(n,o);if(!i)return;let s=n.worst_contact_center??n.center;if(!s||typeof s!="object")return;let a=s;if(typeof a.x!="number"||typeof a.y!="number")return;let c={x:a.x,y:a.y},l=Rle(t),h=nS(l,c,i[0]),d=nS(l,c,i[1]);if(!h||!d||h.z!==d.z)return;let u=$in(h,d),_=u.leftPoint.x-u.rightPoint.x,p=u.leftPoint.y-u.rightPoint.y,m=Math.hypot(_,p),A=Number(n.minimum_clearance),g=Number.isFinite(A)?A:uy.traceClearance??0.1,f=h.radius+d.radius+g-m;if(f<=Dr)return;let y=r===0?h:d,x=r===0?u.leftT:u.rightT,C=(1-x)**2+x**2;if(C<=Dr)return;let b=f/C,I=r===0?u.leftPoint:u.rightPoint,v=r===0?u.rightPoint:u.leftPoint,P=r===0?1:-1,M=y.end.x-y.start.x,B=y.end.y-y.start.y,T=Math.hypot(M,B),N=(y.routeIndex+(r===0?d.routeIndex:h.routeIndex))%2==0?1:-1,D=m>Dr?(I.x-v.x)/m:T>Dr?-B/T*N*P:P,L=m>Dr?(I.y-v.y)/m:T>Dr?M/T*N*P:0;return ile(t,y,D*b,L*b,e,x)?{movedRouteIndex:y.routeIndex}:void 0},_yr=(e)=>{let{srj:t,via:n,segment:o,segments:r,initialTarget:i,requiredTraceDistance:s,requiredObstacleDistance:a,connMap:c}=e,l=Math.min(...n.zLayers),h=Math.max(...n.zLayers),d=t.obstacles.filter((p)=>!p.isCopperPour&&!xA(n.rootConnectionName,p,c)&&Qq(p,t.layerCount).some((m)=>m>=l&&m<=h)),u=d.filter((p)=>Boolean(h6e(i,p,a)));return[i,...J1r(n,r,s-n.radius-o.radius,c),...u.flatMap((p)=>((m)=>{let{point:A,obstacle:g,requiredDistance:f}=m,y=g.center.x-g.width/2,x=g.center.x+g.width/2,C=g.center.y-g.height/2,b=g.center.y+g.height/2,I=Math.max(y-A.x,A.x-x,0),v=Math.max(C-A.y,A.y-b,0),P=[];if(I<f){let M=Math.sqrt(f*f-I*I);P.push({x:A.x,y:C-M-Dr},{x:A.x,y:b+M+Dr})}if(v<f){let M=Math.sqrt(f*f-v*v);P.push({x:y-M-Dr,y:A.y},{x:x+M+Dr,y:A.y})}return P})({point:i,obstacle:p,requiredDistance:a}))].filter((p)=>{if(!isn(p,n.radius,t.bounds))return!1;let m=mb(p,o);return!(Math.hypot(p.x-m.x,p.y-m.y)<s-Dr)&&(!r.some((A)=>A.z>=l&&A.z<=h&&!Lx(n.rootConnectionName,A.rootConnectionName,c)&&oc(p,A.start,A.end)<s+A.radius-o.radius-Dr)&&d.every((A)=>hQ(p,A)>=a-Dr))}).sort((p,m)=>Math.hypot(p.x-n.x,p.y-n.y)-Math.hypot(m.x-n.x,m.y-n.y))[0]},$Ot=(e,t,n,o,r,i)=>{if(cy(n)!=="pcb_trace_error")return!1;let s=typeof n.pcb_trace_error_id=="string"?n.pcb_trace_error_id.toLowerCase():"",a=typeof n.message=="string"?n.message.toLowerCase():"";if(!(typeof n.pcb_via_id=="string"||Array.isArray(n.pcb_via_ids)||s.includes("_via_")||a.includes("via")))return!1;if(hV(n,o)!==r)return!1;if(kle(n,o))return!1;let c=n.worst_contact_center??n.center;if(!c||typeof c!="object")return!1;let l=c;if(typeof l.x!="number"||typeof l.y!="number")return!1;let h={x:l.x,y:l.y},d=Rle(t),u=nS(d,h,r),_=Array.isArray(n.pcb_trace_ids)?n.pcb_trace_ids.filter((O)=>typeof O=="string"&&O!==n.pcb_trace_id):[],p=_.map((O)=>o.get(O)).filter((O)=>O!==void 0),m=p9(t,e),A=tce(_.length>0?m.filter((O)=>p.includes(O.routeIndex)):m,h);if(!u||!A||!A.movable||Lx(A.rootConnectionName,u.rootConnectionName,i))return!1;let g=mb(A,u),f=A.x-g.x,y=A.y-g.y,x=Math.hypot(f,y),C=Number(n.minimum_clearance),b=Number.isFinite(C)?C:uy.traceClearance??0.1,I=A.radius+u.radius+b-x;if(I<=Dr)return!1;let v=u.end.x-u.start.x,P=u.end.y-u.start.y,M=Math.hypot(v,P),B=A.routeIndex%2==0?1:-1,T=x>Dr?f/x:M>Dr?-P/M*B:1,N=x>Dr?y/x:M>Dr?v/M*B:0,D=A.radius+u.radius+b,L=A.radius+o6e(e)+L2,H={x:A.x+T*(I+L2),y:A.y+N*(I+L2)},V=_yr({srj:e,via:A,segment:u,segments:d,initialTarget:H,requiredTraceDistance:D,requiredObstacleDistance:L,connMap:i});return!!V&&pq(t,A,V.x-A.x,V.y-A.y,e)},HJe=(e,t,n)=>{if(cy(t)!=="pcb_trace_error")return;let o=Qle(t),r=e[n];if(!o||!r)return;let i=nS(ole(r,n),o);return i?{center:o,route:r,segment:i}:void 0},ssn=(e,t,n,o)=>{let r=HJe(e,t,n);if(!r)return;let{route:i,segment:s}=r,a=Math.max(0,s.startIndex-o),c=Math.min(i.route.length-1,s.endIndex+o),l=i.route.slice(a,c+1),h=l[0],d=l.at(-1);return h&&d&&!l.some((u)=>u.z!==h.z)&&h.z===d.z?{route:i,spanStartIndex:a,spanEndIndex:c,start:h,end:d}:void 0},gyr=(e,t,n,o,r,i,s=0,a,c)=>{if(i<0||i>=e.layerCount)return!1;let l=kle(n,o);if(!l)return!1;let h=l[r],d=HJe(t,n,h);if(!d||d.segment.z===i)return!1;let{route:u,segment:_}=d,{startIndex:p,endIndex:m}=_;for(let y=0;y<s;y+=1)u.route[p-1]?.z===_.z&&(p-=1),u.route[m+1]?.z===_.z&&(m+=1);if(p===0&&u.route[0]?.pcb_port_id&&!mq(e,u,u.route[0],a,c)||m===u.route.length-1&&u.route.at(-1)?.pcb_port_id&&!mq(e,u,u.route.at(-1),a,c))return!1;let A=u.route[p],g=u.route[m];if(!A||!g||A.z!==g.z)return!1;let f=u.route.slice(p,m+1).map((y)=>({...y,z:i,pcb_port_id:void 0}));return u.route.splice(p,m-p+1,{...A},...f,{...g}),!0},Ayr=(e,t,n,o,r,i)=>{if(o<=0||r<=0)return!1;let s=HJe(e,t,n);if(!s)return!1;let{center:a,route:c,segment:l}=s,h=l.end.x-l.start.x,d=l.end.y-l.start.y,u=Math.hypot(h,d);if(u<=Dr)return!1;let _=mb(a,l),p=hS(_.t-o/u,0.02,0.98),m=hS(_.t+o/u,0.02,0.98);if(p>=m)return!1;let A=(I)=>({x:l.start.x+h*I,y:l.start.y+d*I,z:l.z}),g=A(p),f=A(m),y=-d/u*i,x=h/u*i,C=c.route[l.startIndex],b=c.route[l.endIndex];return c.route.splice(l.startIndex,2,{...C},g,{...g,x:g.x+y*r,y:g.y+x*r},{...f,x:f.x+y*r,y:f.y+x*r},f,{...b}),!0},fyr=(e,t,n,o,r,i,s,a=!1)=>{if(!Number.isInteger(r)||r<0||r>=e.layerCount)return!1;let c=Qle(n),l=t[o],h=l?.route[0],d=l?.route.at(-1);if(!l||!c||!h||!d||h.z!==d.z||h.z===r||l.jumpers?.length||l.route.some((O)=>O.z!==h.z||O.toNextSegmentType==="through_obstacle"))return!1;let u=d.x-h.x,_=d.y-h.y,p=Math.hypot(u,_);if(p<=Dr||p>8)return!1;let m=u/p,A=_/p,g=A*i,f=-m*i,y=(O)=>(O.x-c.x)*m+(O.y-c.y)*A,x=(O,U,j)=>({x:c.x+m*O+g*U,y:c.y+A*O+f*U,z:j}),C=(l.viaDiameter??e.minViaDiameter??0.3)+(e.minTraceToPadEdgeClearance??uy.traceClearance??0.1),b=(a?1.25:-0.75)*C,I=(a?-0.75:1.25)*C,v=y(h)+0.5*C*s,P=y(d)+C*s,M=x(v,b,h.z),B=x(P,I,h.z),T=x(v,2*C,r),N=x(P,2*C,r),D=[{...h},M,{...M,z:r},T,N,{...B,z:r},B,{...d}],L=e.minBoardEdgeClearance??0,H=(l.viaDiameter??e.minViaDiameter??0.3)/2,V=l.traceThickness/2;if([M,B].some((O)=>R2(e,O)+Ba<H+L))return!1;for(let O=0;O<D.length-1;O+=1){let U=D[O],j=D[O+1];if(U.z===j.z&&K7(e,U,j)+Ba<V+L)return!1}return l.route.splice(0,l.route.length,...D),!0},yyr=(e,t,n,o,r,i,s)=>{if(!Number.isInteger(r)||r<1||i<=0)return!1;let a=ssn(t,n,o,r);if(!a)return!1;let{route:c,spanStartIndex:l,spanEndIndex:h,start:d,end:u}=a,_=u.x-d.x,p=u.y-d.y,m=Math.hypot(_,p);if(m<=Dr)return!1;let A=-p/m*s*i,g=_/m*s*i,f={...d,x:d.x+A,y:d.y+g,pcb_port_id:void 0},y={...u,x:u.x+A,y:u.y+g,pcb_port_id:void 0};return!(!dq(f,e.bounds)||!dq(y,e.bounds))&&(c.route.splice(l,h-l+1,{...d},f,y,{...u}),!0)},xyr=(e,t,n,o,r,i)=>{if(!Number.isInteger(r)||r<0)return!1;let s=ssn(t,n,o,r);if(!s)return!1;let{route:a,spanStartIndex:c,spanEndIndex:l,start:h,end:d}=s;return!(Math.hypot(i.x-h.x,i.y-h.y)<=Dr||Math.hypot(i.x-d.x,i.y-d.y)<=Dr||!dq(i,e.bounds))&&(a.route.splice(c,l-c+1,{...h},{x:i.x,y:i.y,z:h.z},{...d}),!0)},R7=(e,t,n,o,r,i)=>{if(i){let c=Nx(e),l=Nx(i);if(c!==l)return c<l}let s=aCe(e),a=nsn(e);return s<n||s===n&&a<o||s===n&&t<r},rKe=(e,t,n,o,r,i,s=!0,a=!1,c=!0,l=!1)=>{let h=!1;for(let d of n){let u=p9(t,e),_=Rle(t),p=Qle(d);if(!p)continue;let m=p,A=d.pcb_via_ids,g=cy(d)==="pcb_via_clearance_error",f=Hx(d),y=Array.isArray(A)&&A.length>0,x=!g&&!f&&y&&(typeof d.pcb_trace_id=="string"||Array.isArray(d.pcb_trace_ids)),C=l&&x;if(y&&!x){m=kOt(e,d,p);let D=hV(d,o),L=A.length>1?ayr(u,p):void 0;if(L){let H=a&&cy(d)==="pcb_via_clearance_error"&&d.pcb_via_pair_net_relation==="same_net",V=s&&cy(d)==="pcb_via_clearance_error";h=(H?cyr(t,L[0],L[1],e,i):qin(t,L[0],L[1],e,i,0.16*Math.abs(r),V))||h}else{let H=tce(u,p,D);H&&(h=QWe(t,H,m,e)||h)}continue}let b=d.pcb_trace_id,I=hV(d,o);if(C&&I===void 0)continue;let v=Array.isArray(d.pcb_trace_ids)?d.pcb_trace_ids.filter((D)=>typeof D=="string"):[];if(C&&typeof b=="string"&&I!==void 0&&v.includes(b)&&v.some((D)=>D!==b&&!o.has(D))){let D=tce(u,p,I);if(D){h=QWe(t,D,p,e)||h;continue}}let P=s&&!x?kle(d,o):void 0;if(P){let D=nS(_,p,P[0]),L=nS(_,p,P[1]);if(D&&L&&Jin(t,D,L,e,i)){h=!0;continue}}let M=BJe(d),B=M&&I!==void 0?Zin(e,t,I,p,i):void 0,T=M?B?.segment:nS(_,p,I);if(T){let D=M?B?.obstacle:UCe(e,p);if(M&&!D)continue;m=M?D?.center??p:kOt(e,d,p);let L=C?void 0:tce(u,p),H=cy(d)==="pcb_via_trace_clearance_error",V=typeof d.pcb_trace_error_id=="string"?d.pcb_trace_error_id.toLowerCase():"",O=typeof d.message=="string"?d.message.toLowerCase():"",U=H||typeof d.pcb_via_id=="string"||Array.isArray(d.pcb_via_ids)||V.includes("_via_")||O.includes("via"),j=Array.isArray(d.pcb_port_ids)&&d.pcb_port_ids.length>0;if(L&&!Lx(L.rootConnectionName,T.rootConnectionName,i)&&(H||Math.hypot(L.x-p.x,L.y-p.y)<0.45)){if(kJe(t,L,T,e,i,0.3*Math.abs(r),1,c)&&(h=!0,U&&!j))continue}h=(D!==void 0&&(M||!xA(T.rootConnectionName,D,i)&&yce(D,T,e.layerCount))?syr(t,T,D,e,i,r):iyr(t,T,m,e,r))||h}let N=C?void 0:tce(p9(t,e),p);N&&Math.hypot(N.x-p.x,N.y-p.y)<0.35&&(h=QWe(t,N,m,e)||h)}return h},dg=0.000001,sle=0.006,Cyr=[1,0.5,0.25,0.1,0.05,0.025],L$=(e,t)=>(t.traceThickness??e.minTraceWidth)/2,XCe=(e)=>e.minTraceToPadEdgeClearance??0.1,asn=(e,t)=>t.viaDiameter??e.minViaDiameter??0.3,CQ=(e,t)=>Dn(e,t)<dg,csn=(e)=>{let t=[],n=(o)=>{t.some((r)=>CQ(r,o))||t.push({x:o.x,y:o.y})};for(let o of e.vias)n(o);for(let o=0;o<e.route.length-1;o+=1){let r=e.route[o],i=e.route[o+1];r&&i&&r.z!==i.z&&(CQ(r,i)&&n(r))}return t},jCe=(e)=>Dn({x:0,y:0},e)<dg?{x:0,y:0}:tje({x:0,y:0},e),lsn=(e,t)=>{if(e.zLayers&&e.zLayers.length>0)return e.zLayers;let n=Array.from({length:t},(o,r)=>r).filter((o)=>e.layers.includes(iy(o,t)));return n.length>0?n:Array.from({length:t},(o,r)=>r)},FJe=(e,t,n)=>Lx(O4(e),O4(t),n)||Lx(O4(e),t.connectionName,n)||Lx(e.connectionName,O4(t),n)||Lx(e.connectionName,t.connectionName,n),hsn=(e,t,n)=>xA(O4(e),t,n)||xA(e.connectionName,t,n),byr=(e,t,n,o)=>!n.pcb_port_id&&e.obstacles.some((r)=>hsn(t,r,o)&&lsn(r,e.layerCount).includes(n.z)&&((i,s)=>i.x>=s.center.x-s.width/2-dg&&i.x<=s.center.x+s.width/2+dg&&i.y>=s.center.y-s.height/2-dg&&i.y<=s.center.y+s.height/2+dg)(n,r)),dsn=(e,t,n,o,r)=>{if(!((s,a)=>s.zLayers.includes(a))(r,n.z))return Number.POSITIVE_INFINITY;let i=L$(e,t);return r.kind==="pad"?iS(n,o,r.obstacle)-(XCe(e)+i+sle):oc(r.center,n,o)-(XCe(e)+i+r.diameter/2+sle)},Iyr=(e,t,n)=>{let o=n.kind==="pad"?n.obstacle.center:n.center,r=mm(o,e,t),i=jCe({x:r.x-o.x,y:r.y-o.y});if(Math.abs(i.x)<dg&&Math.abs(i.y)<dg){let s=t.x-e.x,a=t.y-e.y,c=JO(e,t),l=jCe({x:-a,y:s}),h={x:-l.x,y:-l.y};i=Dn({x:c.x+l.x,y:c.y+l.y},o)>=Dn({x:c.x+h.x,y:c.y+h.y},o)?l:h}return i},nce=(e,t,n,o)=>{if(n<=0||n>=t.route.length-1){let a=t.route[n];return!a||!byr(e,t,a,o)}let r=t.route[n];if(!r||r.insideJumperPad)return!0;let i=t.route[n-1],s=t.route[n+1];return!(!i||i.z===r.z)||(!(!s||s.z===r.z)||t.vias.some((a)=>CQ(a,r)))},qOt=(e,t,n)=>{let o=0;for(let r=0;r<t.route.length-1;r+=1){let i=t.route[r],s=t.route[r+1];if(i&&s&&i.z===s.z&&!CQ(i,s))for(let a of n){let c=dsn(e,t,i,s,a);if(!(c>=0)&&(o+=c*c,a.kind==="pad")){if(iS(i,s,a.obstacle)<dg)o+=0.01/(oc(a.obstacle.center,i,s)+0.01)}}}return o},JOt=(e,t,n,o)=>{let r=0;for(let i=0;i<t.route.length-1;i+=1){let s=t.route[i],a=t.route[i+1];if(s&&a&&s.z===a.z&&!CQ(s,a)){for(let c of n)if(!FJe(t,c,o)){for(let l=0;l<c.route.length-1;l+=1){let h=c.route[l],d=c.route[l+1];if(!h||!d||h.z!==s.z||d.z!==s.z||CQ(h,d))continue;let u=s_(s,a,h,d)-L$(e,t)-L$(e,c),_=XCe(e)+sle-u;_>0&&(r+=_*_)}for(let l of csn(c)){let h=oc(l,s,a)-L$(e,t)-asn(e,c)/2,d=XCe(e)+sle-h;d>0&&(r+=d*d)}}}}return r},vyr=(e,t,n,o,r)=>{let i=t.route.map(()=>({x:0,y:0}));for(let s=0;s<t.route.length-1;s+=1){let a=t.route[s],c=t.route[s+1];if(a&&c&&a.z===c.z&&!CQ(a,c)){for(let l of n){let h=dsn(e,t,a,c,l);if(h>=0)continue;let d=Iyr(a,c,l);if(Math.abs(d.x)<dg&&Math.abs(d.y)<dg)continue;let u=!nce(e,t,s,r),_=!nce(e,t,s+1,r);if(!u&&!_)continue;let p=-h,m=u&&_?0.5:u?1:0,A=u&&_?0.5:_?1:0;i[s].x+=d.x*p*m,i[s].y+=d.y*p*m,i[s+1].x+=d.x*p*A,i[s+1].y+=d.y*p*A}for(let l of o)if(!FJe(t,l,r))for(let h=0;h<l.route.length-1;h+=1){let d=l.route[h],u=l.route[h+1];if(!d||!u||d.z!==a.z||u.z!==a.z||CQ(d,u))continue;let _=s_(a,c,d,u)-L$(e,t)-L$(e,l),p=e.minTraceToPadEdgeClearance+sle-_;if(p<=0)continue;let m=JO(a,c),A=mm(m,d,u),g=jCe({x:m.x-A.x,y:m.y-A.y});if(Math.abs(g.x)<dg&&Math.abs(g.y)<dg){let b=c.x-a.x,I=c.y-a.y;g=jCe({x:-I,y:b})}let f=!nce(e,t,s,r),y=!nce(e,t,s+1,r);if(!f&&!y)continue;let x=f&&y?0.5:f?1:0,C=f&&y?0.5:y?1:0;i[s].x+=g.x*p*x,i[s].y+=g.y*p*x,i[s+1].x+=g.x*p*C,i[s+1].y+=g.y*p*C}}}return i},Syr=(e,t,n,o,r)=>({...t,route:t.route.map((i,s)=>{if(nce(e,t,s,r))return{...i};let a=((c,l)=>{let h=Dn({x:0,y:0},c);if(h<=l||h<dg)return c;let d=l/h;return{x:c.x*d,y:c.y*d}})(n[s]??{x:0,y:0},0.5);return{...i,x:i.x+a.x*o,y:i.y+a.y*o}}),vias:t.vias.map((i)=>({...i})),jumpers:t.jumpers?[...t.jumpers]:void 0}),Pyr=(e,t)=>t.route.every((n)=>n.x>=e.bounds.minX-dg&&n.x<=e.bounds.maxX+dg&&n.y>=e.bounds.minY-dg&&n.y<=e.bounds.maxY+dg),Eyr=(e,t,n,o,r)=>{let i=((l,h,d,u)=>{let _=[];for(let m of l.obstacles)m.isCopperPour||hsn(d,m,u)||_.push({kind:"pad",obstacle:m,zLayers:lsn(m,l.layerCount)});let p=Array.from({length:l.layerCount},(m,A)=>A);for(let m of h)if(m!==d&&!FJe(d,m,u))for(let A of csn(m))_.push({kind:"via",center:{x:A.x,y:A.y},diameter:asn(l,m),zLayers:p,connectionName:m.connectionName,rootConnectionName:m.rootConnectionName});return _})(e,t,n,r),s=t.filter((l,h)=>h!==o&&l!==n),a=n,c=qOt(e,a,i)+JOt(e,a,s,r);for(let l=0;l<160&&!(c<=dg);l+=1){let h=vyr(e,a,i,s,r);if(h.every((_)=>Dn(_,{x:0,y:0})<0.000000001))break;let d=null,u=c;for(let _ of Cyr){let p=Syr(e,a,h,_,r),m=qOt(e,p,i)+JOt(e,p,s,r);if(m<c-0.000001&&Pyr(e,p)){d=p,u=m;break}}if(!d)break;a=d,c=u}return a},tQ=0.000001,Myr=[1,0.5,0.25,0.1,0.05,0.025],wyr=(e,t)=>e.some((n)=>t.includes(n)),Byr=(e,t,n,o)=>(xA(e.rootConnectionName,n,o)||xA(t.connectionName,n,o))&&hQ(e,n)<=tQ,usn=(e,t,n,o)=>{let r=[],i=t[n.routeIndex];if(!i)return r;for(let s of e.obstacles){if(s.isCopperPour||Byr(n,i,s,o))continue;let a=Qq(s,e.layerCount);wyr(n.zLayers,a)&&r.push({obstacle:s})}return r},Tyr=(e,t,n)=>hQ(t,n.obstacle)-(t.radius+e.minViaEdgeToPadEdgeClearance+0.006),ZOt=(e,t,n,o)=>p9(t,e).filter((r)=>r.routeIndex===n).reduce((r,i)=>r+((s,a,c,l)=>{let h=0;for(let d of usn(s,a,c,l)){let u=Tyr(s,c,d);!(u>=0)&&(h+=u*u,hQ(c,d.obstacle)<tQ)&&(h+=0.01/(Dn(c,d.obstacle.center)+0.01))}return h})(e,t,i,o),0),Dyr=(e,t,n,o)=>{let r=t[n];if(!r)return[];let i=r.route.map(()=>({x:0,y:0})),s=p9(t,e).filter((a)=>a.routeIndex===n);for(let a of s)if(a.movable)for(let c of usn(e,t,a,o)){let l=a.radius+e.minViaEdgeToPadEdgeClearance+0.006,h=h6e(a,c.obstacle,l);if(h)for(let d of a.pointIndexes)i[d].x+=h.direction.x*h.penetration,i[d].y+=h.direction.y*h.penetration}return i},Nyr=(e,t,n,o)=>{let r=new Set(p9([t],e).flatMap((i)=>i.movable?i.pointIndexes:[]));return{...t,route:t.route.map((i,s)=>{if(!r.has(s))return{...i};let a=((c,l)=>{let h=Dn({x:0,y:0},c);if(h<=l||h<tQ)return c;let d=l/h;return{x:c.x*d,y:c.y*d}})(n[s]??{x:0,y:0},0.5);return{...i,x:i.x+a.x*o,y:i.y+a.y*o}}),vias:t.vias.map((i)=>({...i})),jumpers:t.jumpers?[...t.jumpers]:void 0}},Ryr=(e,t)=>t.route.every((n)=>n.x>=e.bounds.minX-tQ&&n.x<=e.bounds.maxX+tQ&&n.y>=e.bounds.minY-tQ&&n.y<=e.bounds.maxY+tQ),Qyr=(e,t,n,o,r)=>{let i=n,s=ZOt(e,t,o,r);for(let a=0;a<160&&!(s<=tQ);a+=1){let c=Dyr(e,t,o,r);if(c.every((d)=>Dn(d,{x:0,y:0})<0.000000001))break;let l=null,h=s;for(let d of Myr){let u=Nyr(e,i,c,d),_=[...t];_[o]=u;let p=ZOt(e,_,o,r);if(p<s-0.000001&&Ryr(e,u)){l=u,h=p;break}}if(!l)break;t[o]=l,i=l,s=h}return i},psn=[0.2,0.4,0.8,1.2].flatMap((e)=>[0.2,0.3,0.45,0.6].flatMap((t)=>[-1,1].map((n)=>({halfSpan:e,offset:t,directionSign:n})))).flatMap((e)=>[0,1].map((t)=>({kind:"segment",routeSide:t,...e}))),kWe=[1,-1].flatMap((e)=>[1,-1].flatMap((t)=>[!1,!0].flatMap((n)=>[0,1].map((o)=>({routeSide:o,normalDirectionSign:e,tangentDirectionSign:t,reverseEndpointOffsets:n}))))),iKe=[0,1].map((e)=>({kind:"displacementChain",routeSide:e})),kyr=[...iKe,...[-1,1].flatMap((e)=>[0,1].map((t)=>({kind:"segment",routeSide:t,halfSpan:0.4,offset:1.2,directionSign:e}))),...[-1,1].flatMap((e)=>[0,1].map((t)=>({kind:"span",routeSide:t,spanExpansion:3,offset:1.8,directionSign:e}))),...[{dx:-2.4,dy:-0.4},{dx:-2.4,dy:0.4},{dx:2.4,dy:-0.4},{dx:2.4,dy:0.4},{dx:-0.4,dy:-2.4},{dx:-0.4,dy:2.4},{dx:0.4,dy:-2.4},{dx:0.4,dy:2.4}].flatMap((e)=>[0,1].map((t)=>({kind:"waypoint",routeSide:t,spanExpansion:2,...e}))),...[{dx:-0.17,dy:0},{dx:0.17,dy:0},{dx:0,dy:-0.17},{dx:0,dy:0.17}].flatMap((e)=>[0,1].map((t)=>({kind:"waypoint",routeSide:t,spanExpansion:0,...e}))),...psn],LWe=[0,1,2],Y7=class extends fa{srj;inputHdRoutes;guardedInputHdRoutes;connMap;effort;drcEvaluator;referenceDrcEvaluator;autoroutingDrcEngine;viaHoleDiameter;configuredMaxIterations;enableBroadFallback;enableLargeBoardBroadFallback;enableTargetedErrorSweep;enablePostSolveClearanceRelaxation;enableSafeTraceLayerMoves;enableViaInPadLayerMoves;enableTraceViaOwnerTargeting;outputHdRoutes;initialDrcIssueCount;initialRepairDrcIssueCount;initialLowCountErrorsHaveMovableTraces=!1;broadForceAccepted=!1;targetedForceAccepted=!1;candidateAttempts=0;viaInPadCandidateAttempts=0;viaInPadCandidatesAccepted=0;padTopologyErrorCursor=0;safeTraceLayerCursorByErrorId=new Map;traceLayerCorridorCursorByErrorId=new Map;tracePairDetourCursorByErrorId=new Map;errorCursor=0;stalledIterations=0;bestDrcIssueCountSeen;bestDrcIssueScoreSeen;lastDrcCountImprovementCheckIteration=0;drcCountPlateauChecks=0;largeBoardBroadFallbackMisses=0;outputSnapshot;legacyCleanCheckpoint;viaPadRepairRolledBack=!1;referenceInputDrcIssueCount;referenceCandidateDrcIssueCount;referenceCandidateRolledBack=!1;referenceInputSnapshot;inputSnapshot;constructor(e){if(super(),this.srj=e.srj,this.inputHdRoutes=e.hdRoutes,this.guardedInputHdRoutes=n9(ib(e.hdRoutes)),this.connMap=e.connMap,this.effort=e.effort??1,this.drcEvaluator=e.drcEvaluator,this.referenceDrcEvaluator=e.referenceDrcEvaluator,this.autoroutingDrcEngine=e.autoroutingDrcEngine??(e.drcEvaluator?void 0:new Dle(e.srj,{connMap:e.connMap,traceClearance:e.srj.minTraceToPadEdgeClearance??uy.traceClearance,viaClearance:e.srj.minTraceToPadEdgeClearance??uy.viaClearance,includeTraceViaOwnerMetadata:e.enableTraceViaOwnerTargeting??!1})),e.viaHoleDiameter!==void 0&&(!Number.isFinite(e.viaHoleDiameter)||e.viaHoleDiameter<=0))throw Error("viaHoleDiameter must be a positive finite number");this.viaHoleDiameter=e.viaHoleDiameter,this.configuredMaxIterations=e.maxIterations,this.enableBroadFallback=e.enableBroadFallback??!0,this.enableLargeBoardBroadFallback=e.enableLargeBoardBroadFallback??!0,this.enableTargetedErrorSweep=e.enableTargetedErrorSweep??!1,this.enablePostSolveClearanceRelaxation=e.enablePostSolveClearanceRelaxation??!0,this.enableSafeTraceLayerMoves=e.enableSafeTraceLayerMoves??!1,this.enableViaInPadLayerMoves=e.enableViaInPadLayerMoves??!1,this.enableTraceViaOwnerTargeting=e.enableTraceViaOwnerTargeting??!1,this.outputHdRoutes=e.hdRoutes,this.referenceDrcEvaluator&&(this.referenceInputSnapshot=this.getReferenceDrcSnapshot(this.inputHdRoutes)),this.MAX_ITERATIONS=this.configuredMaxIterations??xOt(this.effort)}getConstructorParams(){return[{srj:this.srj,hdRoutes:this.inputHdRoutes,connMap:this.connMap,effort:this.effort,drcEvaluator:this.drcEvaluator,referenceDrcEvaluator:this.referenceDrcEvaluator,autoroutingDrcEngine:this.autoroutingDrcEngine,viaHoleDiameter:this.viaHoleDiameter,maxIterations:this.configuredMaxIterations,enableBroadFallback:this.enableBroadFallback,enableLargeBoardBroadFallback:this.enableLargeBoardBroadFallback,enableTargetedErrorSweep:this.enableTargetedErrorSweep,enablePostSolveClearanceRelaxation:this.enablePostSolveClearanceRelaxation,enableSafeTraceLayerMoves:this.enableSafeTraceLayerMoves,enableViaInPadLayerMoves:this.enableViaInPadLayerMoves,enableTraceViaOwnerTargeting:this.enableTraceViaOwnerTargeting}]}updateStats(e){this.stats={initialDrcIssueCount:this.initialDrcIssueCount??e.count,finalDrcIssueCount:e.count,globalDrcForceImproveMaxIterations:this.MAX_ITERATIONS,globalDrcForceImproveBroadForceAccepted:this.broadForceAccepted,globalDrcForceImproveTargetedForceAccepted:this.targetedForceAccepted,globalDrcForceImproveCandidateAttempts:this.candidateAttempts,globalDrcForceImproveViaInPadCandidateAttempts:this.viaInPadCandidateAttempts,globalDrcForceImproveViaInPadCandidatesAccepted:this.viaInPadCandidatesAccepted,globalDrcForceImproveStalledIterations:this.stalledIterations,globalDrcForceImproveBestDrcIssueCountSeen:this.bestDrcIssueCountSeen??e.count,globalDrcForceImproveBestDrcIssueScoreSeen:this.bestDrcIssueScoreSeen??e.issueScore,globalDrcForceImproveDrcCountPlateauChecks:this.drcCountPlateauChecks,globalDrcForceImproveLargeBoardBroadFallbackMisses:this.largeBoardBroadFallbackMisses,globalDrcForceImproveViaPadRepairRolledBack:this.viaPadRepairRolledBack,globalDrcForceImproveReferenceInputDrcIssueCount:this.referenceInputDrcIssueCount,globalDrcForceImproveReferenceCandidateDrcIssueCount:this.referenceCandidateDrcIssueCount,globalDrcForceImproveReferenceCandidateRolledBack:this.referenceCandidateRolledBack}}finishAtLegacyCleanCheckpoint(){let e=this.legacyCleanCheckpoint;return!!e&&(this.outputHdRoutes=e.routes,this.outputSnapshot=e.snapshot,this.viaPadRepairRolledBack=!0,this.updateStats(e.snapshot),this.solved=!0,!0)}increaseMaxIterationsForDrcIssueCount(e){this.configuredMaxIterations===void 0?this.MAX_ITERATIONS=Math.max(this.MAX_ITERATIONS,((t,n)=>Math.max(xOt(n),Math.ceil(t*K2r*Math.max(1,n))))(e,this.effort),((t,n)=>t>120&&n>0?192:48)(this.inputHdRoutes.length,e)):this.MAX_ITERATIONS=this.configuredMaxIterations}getSnapshot(e){return(this.initialLowCountErrorsHaveMovableTraces?tyr:k7)(this.srj,e,this.drcEvaluator,this.connMap,this.autoroutingDrcEngine)}getReferenceDrcSnapshot(e){let t={traces:[],srj:this.srj,routes:e,hdRoutes:e},n=this.referenceDrcEvaluator?.getCachedResult?.(t);if(n){let o=Array.isArray(n)?n:n.errors;return{errors:o,count:o.length}}return k7(this.srj,e,this.referenceDrcEvaluator,this.connMap,this.autoroutingDrcEngine)}getViaIssueCount(e){return oKe(e)}getRepairIssueCount(e){return aCe(e)}getRepairIssueScore(e){return nsn(e)}acceptSolvedRoutes(e,t){let n=this.enablePostSolveClearanceRelaxation?((l,h,d)=>{if(l.minTraceToPadEdgeClearance===void 0||l.minTraceToPadEdgeClearance<=0)return h;let u=!1,_=ib(h);for(let p=0;p<4;p+=1)for(let m=0;m<_.length;m+=1){let A=_[m];if(!A)continue;let g=Eyr(l,_,A,m,d);g!==A&&(_[m]=g,u=!0)}return u?_:h})(this.srj,e,this.connMap):e,o=this.enablePostSolveClearanceRelaxation?((l,h,d)=>{if(l.minViaEdgeToPadEdgeClearance===void 0||l.minViaEdgeToPadEdgeClearance<=0)return h;let u=!1,_=ib(h);for(let p=0;p<4;p+=1)for(let m=0;m<_.length;m+=1){let A=_[m];if(!A)continue;let g=Qyr(l,_,A,m,d);g!==A&&(_[m]=g,u=!0)}return u?n9(_):h})(this.srj,n,this.connMap):e,r=o===e?t:this.getSnapshot(o),i=r.count<t.count||r.count===t.count&&r.issueScore<=t.issueScore,s=i?o:e,a=i?r:t,c=this.inputSnapshot??this.getSnapshot(this.guardedInputHdRoutes);if(this.referenceDrcEvaluator){let l=this.referenceInputSnapshot,h=this.getReferenceDrcSnapshot(s);this.referenceInputDrcIssueCount=l.count,this.referenceCandidateDrcIssueCount=h.count,h.count>l.count&&(s=this.guardedInputHdRoutes,a=c,this.referenceCandidateRolledBack=!0)}this.outputHdRoutes=s,this.outputSnapshot=a,this.stalledIterations=0,this.updateStats(a),this.solved=!0}updateDrcCountPlateauState(e){let t=this.getRepairIssueCount(e),n=this.getRepairIssueScore(e);this.bestDrcIssueCountSeen??=t,this.bestDrcIssueScoreSeen??=n;let o=this.initialRepairDrcIssueCount??t,r=this.inputHdRoutes.length>120&&o>0;if((o>=20||r)&&this.iterations<192)return(t<this.bestDrcIssueCountSeen||t===this.bestDrcIssueCountSeen&&n<this.bestDrcIssueScoreSeen)&&(this.bestDrcIssueCountSeen=t,this.bestDrcIssueScoreSeen=n),void(r&&this.largeBoardBroadFallbackMisses>=2&&(this.solved=!0));let i=((s)=>s>=20?8:s<=2?1:2)(o);if(!(this.iterations-this.lastDrcCountImprovementCheckIteration<i)){if(this.lastDrcCountImprovementCheckIteration=this.iterations,t<this.bestDrcIssueCountSeen||t===this.bestDrcIssueCountSeen&&n<this.bestDrcIssueScoreSeen)return this.bestDrcIssueCountSeen=t,this.bestDrcIssueScoreSeen=n,void(this.drcCountPlateauChecks=0);this.drcCountPlateauChecks+=1,this.drcCountPlateauChecks>=2&&(this.solved=!0)}}_step(){let e=this.outputHdRoutes,t=this.outputSnapshot??this.getSnapshot(e),n=Nx(t);if(this.legacyCleanCheckpoint&&n>0)return void this.finishAtLegacyCleanCheckpoint();if(!this.legacyCleanCheckpoint&&n===0&&t.errors.some(Hx)&&(this.legacyCleanCheckpoint={routes:n9(ib(e)),snapshot:t}),this.initialDrcIssueCount===void 0){this.inputSnapshot=t,this.initialDrcIssueCount=t.count,this.initialRepairDrcIssueCount=this.getRepairIssueCount(t);let D=jOt(t.errors);this.initialLowCountErrorsHaveMovableTraces=this.initialRepairDrcIssueCount>0&&this.initialRepairDrcIssueCount<=3&&D.every((L)=>hV(L,t.traceRouteIndexById)!==void 0),this.initialLowCountErrorsHaveMovableTraces&&(t=this.getSnapshot(e)),this.bestDrcIssueCountSeen=this.getRepairIssueCount(t),this.bestDrcIssueScoreSeen=this.getRepairIssueScore(t),this.increaseMaxIterationsForDrcIssueCount(this.getRepairIssueCount(t))}if(t.count===0)return void this.acceptSolvedRoutes(e,t);let o=this.getRepairIssueCount(t),r=this.getRepairIssueScore(t),i=this.getViaIssueCount(t),s=t.errors.filter((D)=>Boolean(Qle(D)));if(s.length===0)return void this.acceptSolvedRoutes(e,t);let a=(c=this.effort,Math.max(1,Math.round(3*Math.max(1,c))));var c;let l=0,h=0,d=!1,u=!1,_=!1,p=jOt(s),m=this.enableTargetedErrorSweep?p.find((D)=>D.type==="pcb_via_clearance_error"&&D.pcb_via_pair_net_relation==="same_net"):void 0,A=this.enableTargetedErrorSweep&&(this.iterations-1)%8==0,g=m??(A?p.find((D)=>D.type==="pcb_via_clearance_error"):void 0),f=g?[g,...p.filter((D)=>D!==g)]:p,y=Math.min(f.length,Math.max(1,Math.ceil(this.effort))),x=g?0:this.errorCursor%f.length,C=this.enableTargetedErrorSweep?((D,L)=>{let H=Math.max(2,Math.round(12*Math.max(1,L)));return D.filter((V)=>cy(V)==="pcb_trace_error").slice(0,H)})(s,this.effort):[],b=o<=1||this.initialLowCountErrorsHaveMovableTraces,I=!this.initialLowCountErrorsHaveMovableTraces&&o<=8&&this.srj.layerCount>1,v=g?[]:s.filter((D)=>D.type==="pcb_pad_trace_clearance_error"||(this.enableSafeTraceLayerMoves||b||I)&&D.type==="pcb_trace_error"),P=v.map((D,L)=>v[(this.padTopologyErrorCursor+L)%v.length]);for(let D of this.enableSafeTraceLayerMoves||this.enableViaInPadLayerMoves?P:[]){let L=!this.enableSafeTraceLayerMoves||h>=a,H=!this.enableViaInPadLayerMoves||l>=a;if(u||L&&H)break;let V;this.padTopologyErrorCursor=(v.indexOf(D)+1)%v.length;let O=typeof D.pcb_trace_error_id=="string"?D.pcb_trace_error_id:typeof D.pcb_trace_id=="string"?D.pcb_trace_id:void 0,U=hV(D,t.traceRouteIndexById),j=kle(D,t.traceRouteIndexById);if(this.enableTraceViaOwnerTargeting&&U!==void 0&&Array.isArray(D.pcb_via_ids)&&D.pcb_via_ids.length===1&&l<a){let X=ib(e);if($Ot(this.srj,X,D,t.traceRouteIndexById,U,this.connMap)){let K=n9(X),J=this.getSnapshot(K),ee=this.getViaIssueCount(J);l+=1,this.candidateAttempts+=1,ee<=i&&QO(J,t)&&(V={routes:K,snapshot:J,viaIssueCount:ee,usesViaInPad:!1})}}if(this.enableSafeTraceLayerMoves&&U!==void 0){let X=j??[U],K=X.length*this.srj.layerCount*LWe.length,J=X.length*this.srj.layerCount*rsn,ee=K+J,se=BJe(D),ne=se?0:K,re=se?J:0,Z=O?this.safeTraceLayerCursorByErrorId.get(O)??0:0,te=0;for(;h<a&&te<ee;){let ie=Z;Z=(Z+1)%ee,te+=1;let ce=ie>=ne&&ie<ne+J,ue=ie-(ce?ne:re),de=ue%X.length,me=Math.floor(ue/X.length),ge=me%this.srj.layerCount,xe=ce?"full":LWe[Math.floor(me/this.srj.layerCount)%LWe.length],Ee=ce?Math.floor(me/this.srj.layerCount):0,Re=X[de],Me=!1;for(let _e of[!1,!0]){let ye=YK(e,[Re]);if(!dyr(this.srj,ye,D,Re,ge,xe,this.connMap,Ee,_e))continue;let Se=GK(ye,[Re]);Me=!0,this.candidateAttempts+=1;let Ne=this.getSnapshot(Se),Le=this.getViaIssueCount(Ne),nt=V?.snapshot??t;Le<=(V?.viaIssueCount??i)&&(QO(Ne,nt)||V!==void 0&&aCe(Ne)===aCe(nt)&&Ne.count<nt.count)&&(V={routes:Se,snapshot:Ne,viaIssueCount:Le,usesViaInPad:!1})}Me&&(h+=1)}O&&this.safeTraceLayerCursorByErrorId.set(O,Z)}if(this.enableSafeTraceLayerMoves&&I&&O&&j){let X=this.traceLayerCorridorCursorByErrorId.get(O)??0,K=0;for(;l<a&&K<kWe.length;){let J=kWe[X%kWe.length];X+=1,K+=1;let ee=j[J.routeSide],se=e[ee]?.route[0]?.z;if(se===void 0)continue;let ne=(se+1)%this.srj.layerCount,re=YK(e,[ee]);if(!fyr(this.srj,re,D,ee,ne,J.normalDirectionSign,J.tangentDirectionSign,J.reverseEndpointOffsets))continue;let Z=GK(re,[ee]);l+=1,this.candidateAttempts+=1;let te=this.getSnapshot(Z),ie=this.getViaIssueCount(te),ce=V?.snapshot??t;ie<=(V?.viaIssueCount??i)&&QO(te,ce)&&(V={routes:Z,snapshot:te,viaIssueCount:ie,usesViaInPad:!1})}this.traceLayerCorridorCursorByErrorId.set(O,X)}if(this.enableSafeTraceLayerMoves&&O&&(this.initialLowCountErrorsHaveMovableTraces&&(j||U!==void 0)||!this.initialLowCountErrorsHaveMovableTraces&&j)){let X=this.initialLowCountErrorsHaveMovableTraces?kyr:b?[...iKe,...psn]:iKe,K=j??[U],J=this.tracePairDetourCursorByErrorId.get(O)??0,ee=0;for(;l<a&&ee<X.length;){let se=X[J%X.length];J+=1,ee+=1;let ne=K[se.routeSide];if(ne===void 0)continue;let re=this.initialLowCountErrorsHaveMovableTraces&&D.worst_contact_center?{...D,center:D.worst_contact_center,message:D.worst_contact_message??D.message,actual_clearance:D.worst_actual_clearance??D.actual_clearance}:D;if(se.kind==="displacementChain"){let ge=ib(e),xe=myr(this.srj,ge,re,t.traceRouteIndexById,se.routeSide);if(!xe)continue;d=!0,l+=1,this.candidateAttempts+=1;let Ee=n9(ge),Re=this.getSnapshot(Ee),Me=this.getViaIssueCount(Re),_e=this.getRepairIssueCount(Re);if(_e>0&&l<a){let Le=ib(Ee),nt=!1;for(let dt of Re.errors)nt=$Ot(this.srj,Le,dt,Re.traceRouteIndexById,xe.movedRouteIndex,this.connMap)||nt;if(nt){l+=1,this.candidateAttempts+=1;let dt=n9(Le),rt=this.getSnapshot(dt),pt=this.getViaIssueCount(rt);R7(rt,pt,_e,this.getRepairIssueScore(Re),Me,Re)&&(Ee=dt,Re=rt,Me=pt,_e=this.getRepairIssueCount(Re))}}let ye=V?this.getRepairIssueCount(V.snapshot):o,Se=V?this.getRepairIssueScore(V.snapshot):r,Ne=V?.viaIssueCount??i;if(Me<=Ne&&R7(Re,Me,ye,Se,Ne,V?.snapshot??t)&&(V={routes:Ee,snapshot:Re,viaIssueCount:Me,usesViaInPad:!1}),_e===0)break;continue}let Z=YK(e,[ne]);if(!(se.kind==="segment"?Ayr(Z,re,ne,se.halfSpan,se.offset,se.directionSign):se.kind==="span"?yyr(this.srj,Z,re,ne,se.spanExpansion,se.offset,se.directionSign):xyr(this.srj,Z,re,ne,se.spanExpansion,{x:re.center.x+se.dx,y:re.center.y+se.dy})))continue;let te=GK(Z,[ne]);d=!0,l+=1,this.candidateAttempts+=1;let ie=this.getSnapshot(te),ce=this.getViaIssueCount(ie),ue=V?this.getRepairIssueCount(V.snapshot):o,de=V?this.getRepairIssueScore(V.snapshot):r,me=V?.viaIssueCount??i;(this.initialLowCountErrorsHaveMovableTraces?R7(ie,ce,ue,de,me,V?.snapshot??t):ce<=me&&QO(ie,V?.snapshot??t))&&(V={routes:te,snapshot:ie,viaIssueCount:ce,usesViaInPad:!1})}this.tracePairDetourCursorByErrorId.set(O,J)}for(let X of this.enableViaInPadLayerMoves?["start","end"]:[]){if(l>=a)break;if(U===void 0)break;let K=YK(e,[U]);if(!pyr(this.srj,K,D,t.traceRouteIndexById,X,this.connMap,this.viaHoleDiameter))continue;let J=GK(K,[U]);this.viaInPadCandidateAttempts+=1,l+=1,this.candidateAttempts+=1;let ee=this.getSnapshot(J),se=this.getViaIssueCount(ee),ne=V?this.getRepairIssueCount(V.snapshot):o,re=V?this.getRepairIssueScore(V.snapshot):r;R7(ee,se,ne,re,V?.viaIssueCount??i,V?.snapshot??t)&&(V={routes:J,snapshot:ee,viaIssueCount:se,usesViaInPad:!0})}let Y=this.enableViaInPadLayerMoves?this.srj.layerCount:0;for(let X=0;X<Y&&!(l>=a)&&U!==void 0;X+=1){let K=YK(e,[U]);if(!uyr(this.srj,K,D,t.traceRouteIndexById,X,this.connMap,this.viaHoleDiameter))continue;let J=GK(K,[U]);this.viaInPadCandidateAttempts+=1,l+=1,this.candidateAttempts+=1;let ee=this.getSnapshot(J),se=this.getViaIssueCount(ee),ne=V?this.getRepairIssueCount(V.snapshot):o,re=V?this.getRepairIssueScore(V.snapshot):r;R7(ee,se,ne,re,V?.viaIssueCount??i,V?.snapshot??t)&&(V={routes:J,snapshot:ee,viaIssueCount:se,usesViaInPad:!0})}if(this.enableViaInPadLayerMoves&&b&&j){let X=this.iterations%2==0?[0,1]:[1,0],K=this.iterations%3;for(let J of X)for(let ee=0;ee<this.srj.layerCount&&!(l>=a);ee+=1){let se=j[J],ne=YK(e,[se]);if(!gyr(this.srj,ne,D,t.traceRouteIndexById,J,ee,K,this.connMap,this.viaHoleDiameter))continue;let re=GK(ne,[se]);this.viaInPadCandidateAttempts+=1,l+=1,this.candidateAttempts+=1;let Z=this.getSnapshot(re),te=this.getViaIssueCount(Z),ie=V?this.getRepairIssueCount(V.snapshot):o,ce=V?this.getRepairIssueScore(V.snapshot):r;R7(Z,te,ie,ce,V?.viaIssueCount??i,V?.snapshot??t)&&(V={routes:re,snapshot:Z,viaIssueCount:te,usesViaInPad:!0})}}V&&(e=V.routes,t=V.snapshot,o=this.getRepairIssueCount(t),r=this.getRepairIssueScore(t),i=V.viaIssueCount,this.targetedForceAccepted=!0,V.usesViaInPad&&(this.viaInPadCandidatesAccepted+=1),u=!0)}if(!u&&C.length>=2){let D=ib(e),L=!1;for(let H of C)L=rKe(this.srj,D,[H],t.traceRouteIndexById,1,this.connMap,!0,this.enableTargetedErrorSweep,!1,this.enableTraceViaOwnerTargeting)||L;if(L){let H=n9(D);l+=1,this.candidateAttempts+=1;let V=this.getSnapshot(H),O=this.getViaIssueCount(V);if(R7(V,O,o,r,i,t)&&(e=H,t=V,o=this.getRepairIssueCount(V),r=this.getRepairIssueScore(V),i=O,this.targetedForceAccepted=!0,u=!0,V.count===0))return void this.acceptSolvedRoutes(e,t)}}for(let D=0;D<y&&l<a&&!u;D+=1){let L=(x+D)%f.length,H=f[L];if(!H)continue;this.errorCursor=(L+1)%f.length;let V=o===1;for(let O of $2r(this.effort)){if(l>=a)break;let U=ib(e);if(!rKe(this.srj,U,[H],t.traceRouteIndexById,O,this.connMap,!0,this.enableTargetedErrorSweep,V,this.enableTraceViaOwnerTargeting))continue;let j=n9(U);l+=1,this.candidateAttempts+=1;let Y=this.getSnapshot(j),X=this.getViaIssueCount(Y);if(R7(Y,X,o,r,i,t)){if(e=j,t=Y,o=this.getRepairIssueCount(Y),r=this.getRepairIssueScore(Y),i=X,this.targetedForceAccepted=!0,u=!0,Y.count===0)return void this.acceptSolvedRoutes(e,t);break}}if(u)break}let M=e.length<=120,B=(T=s.length,Math.max(16,Math.min(64,2*T)));var T;let N=this.enableLargeBoardBroadFallback&&this.MAX_ITERATIONS>=192&&!M&&this.stalledIterations>0&&this.stalledIterations%B===0;if(this.enableBroadFallback&&!u&&(M||this.effort>=2&&this.stalledIterations>=2||N)){_=N;for(let D of[1,2]){let L=LJe(this.srj,e,this.effort,D,this.connMap,this.drcEvaluator===void 0,!1);if(L===e)continue;let H=this.getSnapshot(L),V=this.getViaIssueCount(H);if(R7(H,V,o,r,i,t)&&(e=L,t=H,o=this.getRepairIssueCount(H),r=this.getRepairIssueScore(H),i=V,this.broadForceAccepted=!0,u=!0,H.count===0))return void this.acceptSolvedRoutes(e,t)}}u?this.largeBoardBroadFallbackMisses=0:_&&(this.largeBoardBroadFallbackMisses+=1),this.outputHdRoutes=e,this.outputSnapshot=t,this.stalledIterations=u?0:this.stalledIterations+1,d||this.updateDrcCountPlateauState(t),this.updateStats(t),(this.solved||o===0)&&this.acceptSolvedRoutes(e,t)}tryFinalAcceptance(){let e=this.outputSnapshot??this.getSnapshot(this.outputHdRoutes);this.legacyCleanCheckpoint&&Nx(e)>0&&this.finishAtLegacyCleanCheckpoint()||this.acceptSolvedRoutes(this.outputHdRoutes,e)}getOutput(){return this.outputHdRoutes}visualize(){return super.visualize()}preview(){return this.visualize()}},msn=class extends fa{params;inputHdRoutes;guardedInputHdRoutes;broadMaxIterations;broadPassMultiplier;autoroutingDrcEngine;legacyDrcEvaluator;outputHdRoutes;phase="start";inputSnapshot;baselineSolver;baselineSnapshot;broadInputSnapshot;broadSnapshot;broadSolver;preBroadCandidate;safeTraceLayerInputRoutes;safeTraceLayerInputSnapshot;safeTraceLayerSolver;safeTraceLayerPhaseAccepted=!1;mixedSafeTraceLayerSolver;mixedSafeTraceLayerPhaseAccepted=!1;legacySafeTraceLayerRoutes;legacySafeTraceLayerSnapshot;legacySafeTraceLayerSelectedSolver;viaInPadSolver;portfolioSelectedSolver;selectedSolver;referenceInputDrcIssueCount;referenceCandidateDrcIssueCount;referenceCandidateRolledBack=!1;mixedReferenceInputDrcIssueCount;mixedReferenceCandidateDrcIssueCount;referenceInputSnapshot;constructor(e){if(super(),!Number.isFinite(e.broadPassMultiplier))throw Error("broadPassMultiplier must be a finite number");if(e.broadPassMultiplier<=0)throw Error("broadPassMultiplier must be greater than zero");if(!Number.isInteger(e.broadMaxIterations))throw Error("broadMaxIterations must be an integer");if(e.broadMaxIterations<=0)throw Error("broadMaxIterations must be greater than zero");if(e.viaInPadMaxIterations!==void 0&&!Number.isInteger(e.viaInPadMaxIterations))throw Error("viaInPadMaxIterations must be an integer");if(e.viaInPadMaxIterations!==void 0&&e.viaInPadMaxIterations<=0)throw Error("viaInPadMaxIterations must be greater than zero");this.autoroutingDrcEngine=e.autoroutingDrcEngine??(e.drcEvaluator?void 0:new Dle(e.srj,{connMap:e.connMap,traceClearance:e.srj.minTraceToPadEdgeClearance??uy.traceClearance,viaClearance:e.srj.minTraceToPadEdgeClearance??uy.viaClearance,includeTraceViaOwnerMetadata:e.enableTraceViaOwnerTargeting??!1})),this.legacyDrcEvaluator=(t)=>{let n=e.drcEvaluator?.evaluateLegacy??e.drcEvaluator,o=n?n(t):this.autoroutingDrcEngine.evaluateLegacy(t.traces),r=Array.isArray(o)?o:o.errors,i=Array.isArray(o)?o:o.errorsWithCenters??o.errors;return{errors:r.filter((s)=>!Hx(s)),errorsWithCenters:i.filter((s)=>!Hx(s))}},Object.defineProperty(this.legacyDrcEvaluator,"inputMode",{get:()=>(e.drcEvaluator?.evaluateLegacy??e.drcEvaluator)?.inputMode}),this.params={...e,autoroutingDrcEngine:this.autoroutingDrcEngine},this.inputHdRoutes=e.hdRoutes,this.guardedInputHdRoutes=n9(ib(e.hdRoutes)),this.broadMaxIterations=e.broadMaxIterations,this.broadPassMultiplier=e.broadPassMultiplier,this.outputHdRoutes=e.hdRoutes,this.params.referenceDrcEvaluator&&(this.referenceInputSnapshot=this.getReferenceDrcSnapshot(this.inputHdRoutes))}getConstructorParams(){return[{...this.params,hdRoutes:this.inputHdRoutes}]}stepBranch(e,t){if(this.activeSubSolver=e,e.step(),e.failed)throw Error(`${t} DRC repair branch failed: ${e.error}`)}getReferenceDrcSnapshot(e){let t={traces:[],srj:this.params.srj,routes:e,hdRoutes:e},n=this.params.referenceDrcEvaluator?.getCachedResult?.(t);if(n){let o=Array.isArray(n)?n:n.errors;return{errors:o,count:o.length}}return k7(this.params.srj,e,this.params.referenceDrcEvaluator,this.params.connMap,this.autoroutingDrcEngine)}finishWithOutput(e,t,n){let o=e,r=t;if(this.params.referenceDrcEvaluator){let i=this.referenceInputSnapshot,s=this.getReferenceDrcSnapshot(o);this.referenceInputDrcIssueCount=i.count,this.referenceCandidateDrcIssueCount=s.count,(s.count>i.count||s.count===i.count&&((a,c)=>{let l=new Set(c.map(XOt));return a.some((h)=>!l.has(XOt(h)))})(s.errors,i.errors))&&(o=this.guardedInputHdRoutes,r=this.inputSnapshot,this.referenceCandidateRolledBack=!0)}this.outputHdRoutes=o,this.selectedSolver=n,this.activeSubSolver=null,this.phase="done",this.progress=1,this.stats={...this.portfolioSelectedSolver?.stats??{},...n?.stats??{},finalDrcIssueCount:r.count,drcBranchPortfolioInitialDrcIssueCount:this.inputSnapshot?.count??t.count,drcBranchPortfolioBaselineDrcIssueCount:this.baselineSnapshot?.count??t.count,drcBranchPortfolioBroadInitialDrcIssueCount:this.broadInputSnapshot?.count,drcBranchPortfolioBroadFinalDrcIssueCount:this.broadSnapshot?.count,drcBranchPortfolioBroadMaxIterations:this.broadMaxIterations,drcBranchPortfolioBroadBranchAttempted:Boolean(this.broadSolver),drcBranchPortfolioBroadBranchAccepted:this.portfolioSelectedSolver!==void 0&&this.portfolioSelectedSolver===this.broadSolver,drcBranchPortfolioSafeTraceLayerPhaseAttempted:Boolean(this.safeTraceLayerSolver),drcBranchPortfolioSafeTraceLayerPhaseAccepted:this.safeTraceLayerPhaseAccepted,drcBranchPortfolioMixedSafeTraceLayerPhaseAttempted:Boolean(this.mixedSafeTraceLayerSolver),drcBranchPortfolioMixedSafeTraceLayerPhaseAccepted:this.mixedSafeTraceLayerPhaseAccepted,drcBranchPortfolioViaInPadPhaseAttempted:Boolean(this.viaInPadSolver),drcBranchPortfolioViaInPadMaxIterations:this.params.viaInPadMaxIterations,drcBranchPortfolioFinalNonViaPadDrcIssueCount:Nx(r),drcBranchPortfolioReferenceInputDrcIssueCount:this.referenceInputDrcIssueCount,drcBranchPortfolioReferenceCandidateDrcIssueCount:this.referenceCandidateDrcIssueCount,drcBranchPortfolioReferenceCandidateRolledBack:this.referenceCandidateRolledBack,drcBranchPortfolioMixedReferenceInputDrcIssueCount:this.mixedReferenceInputDrcIssueCount,drcBranchPortfolioMixedReferenceCandidateDrcIssueCount:this.mixedReferenceCandidateDrcIssueCount},this.solved=!0}startBaselineBranch(){this.baselineSolver=new Y7({...this.params,hdRoutes:this.inputHdRoutes,drcEvaluator:this.legacyDrcEvaluator,referenceDrcEvaluator:void 0,enableSafeTraceLayerMoves:!1,enableViaInPadLayerMoves:!1}),this.activeSubSolver=this.baselineSolver,this.phase="baseline"}startSafeTraceLayerPhase(e,t,n){this.portfolioSelectedSolver=n,this.params.enableSafeTraceLayerMoves?(this.safeTraceLayerInputRoutes=e,this.safeTraceLayerInputSnapshot=t,this.safeTraceLayerSolver=new Y7({...this.params,hdRoutes:e,drcEvaluator:this.legacyDrcEvaluator,referenceDrcEvaluator:void 0,maxIterations:this.params.viaInPadMaxIterations??this.params.maxIterations,enableLargeBoardBroadFallback:!1,enableTargetedErrorSweep:!1,enablePostSolveClearanceRelaxation:!1,enableSafeTraceLayerMoves:!0,enableViaInPadLayerMoves:!1}),this.activeSubSolver=this.safeTraceLayerSolver,this.phase="safeTraceLayer"):this.startViaInPadPhase(e,t,n)}startViaInPadPhase(e,t,n){this.portfolioSelectedSolver=n;let o=this.params.enableViaInPadLayerMoves&&this.params.viaInPadDrcEvaluator!==void 0;t.errors.some(Hx)||o?(this.viaInPadSolver=new Y7({...this.params,hdRoutes:e,drcEvaluator:this.params.viaInPadDrcEvaluator??this.params.drcEvaluator,maxIterations:this.params.viaInPadMaxIterations??this.params.maxIterations,enableLargeBoardBroadFallback:!1,enableTargetedErrorSweep:!1,enablePostSolveClearanceRelaxation:!1,enableSafeTraceLayerMoves:!1,enableViaInPadLayerMoves:this.params.enableViaInPadLayerMoves}),this.activeSubSolver=this.viaInPadSolver,this.phase="viaInPad"):this.finishWithOutput(e,t,n)}startMixedSafeTraceLayerPhase(e,t,n){this.legacySafeTraceLayerRoutes=e,this.legacySafeTraceLayerSnapshot=t,this.legacySafeTraceLayerSelectedSolver=n,this.mixedSafeTraceLayerSolver=new Y7({...this.params,hdRoutes:this.safeTraceLayerInputRoutes,drcEvaluator:this.params.drcEvaluator,referenceDrcEvaluator:void 0,maxIterations:this.params.viaInPadMaxIterations??this.params.maxIterations,enableLargeBoardBroadFallback:!1,enableTargetedErrorSweep:!1,enablePostSolveClearanceRelaxation:!1,enableSafeTraceLayerMoves:!0,enableViaInPadLayerMoves:!1}),this.activeSubSolver=this.mixedSafeTraceLayerSolver,this.phase="mixedSafeTraceLayer"}startBroadBranch(){let e=LJe(this.params.srj,this.inputHdRoutes,this.params.effort??1,this.broadPassMultiplier,this.params.connMap);this.broadInputSnapshot=k7(this.params.srj,e,this.params.drcEvaluator,this.params.connMap,this.autoroutingDrcEngine),QO(this.broadInputSnapshot,this.baselineSnapshot)?(this.broadSolver=new Y7({...this.params,hdRoutes:e,drcEvaluator:this.legacyDrcEvaluator,referenceDrcEvaluator:void 0,maxIterations:this.broadMaxIterations,enableSafeTraceLayerMoves:!1,enableViaInPadLayerMoves:!1}),this.activeSubSolver=this.broadSolver,this.phase="broad"):this.startSafeTraceLayerPhase(this.baselineSolver.getOutput(),this.baselineSnapshot,this.baselineSolver)}_step(){if(this.phase==="start")return this.inputSnapshot=k7(this.params.srj,this.inputHdRoutes,this.params.drcEvaluator,this.params.connMap,this.autoroutingDrcEngine),Nx(this.inputSnapshot)===0?void this.startViaInPadPhase(this.inputHdRoutes,this.inputSnapshot):void this.startBaselineBranch();if(this.phase==="baseline"){if(this.stepBranch(this.baselineSolver,"baseline"),!this.baselineSolver.solved)return;let e=this.baselineSolver.getOutput();return this.baselineSnapshot=k7(this.params.srj,e,this.params.drcEvaluator,this.params.connMap,this.autoroutingDrcEngine),Nx(this.baselineSnapshot)===0?void this.startViaInPadPhase(e,this.baselineSnapshot,this.baselineSolver):void(this.params.enableSafeTraceLayerMoves&&this.baselineSnapshot.count<=3?this.startSafeTraceLayerPhase(e,this.baselineSnapshot,this.baselineSolver):this.startBroadBranch())}if(this.phase==="broad"){if(this.stepBranch(this.broadSolver,"broad"),!this.broadSolver.solved)return;let e=this.broadSolver.getOutput();return this.broadSnapshot=k7(this.params.srj,e,this.params.drcEvaluator,this.params.connMap,this.autoroutingDrcEngine),QO(this.broadSnapshot,this.baselineSnapshot)?void this.startSafeTraceLayerPhase(e,this.broadSnapshot,this.broadSolver):void this.startSafeTraceLayerPhase(this.baselineSolver.getOutput(),this.baselineSnapshot,this.baselineSolver)}if(this.phase==="safeTraceLayer"){if(this.stepBranch(this.safeTraceLayerSolver,"safe trace-layer"),!this.safeTraceLayerSolver.solved)return;let e=this.safeTraceLayerSolver.getOutput(),t=k7(this.params.srj,e,this.params.drcEvaluator,this.params.connMap,this.autoroutingDrcEngine),n=oKe(this.safeTraceLayerInputSnapshot,!1),o=oKe(t,!1);this.safeTraceLayerPhaseAccepted=o<=n&&R7(t,o,this.safeTraceLayerInputSnapshot.count,this.safeTraceLayerInputSnapshot.issueScore,n,this.safeTraceLayerInputSnapshot);let r=this.safeTraceLayerPhaseAccepted?e:this.safeTraceLayerInputRoutes,i=this.safeTraceLayerPhaseAccepted?t:this.safeTraceLayerInputSnapshot,s=this.safeTraceLayerPhaseAccepted?this.safeTraceLayerSolver:this.portfolioSelectedSolver;return this.preBroadCandidate&&!QO(i,this.preBroadCandidate.snapshot)&&(r=this.preBroadCandidate.routes,i=this.preBroadCandidate.snapshot,s=this.preBroadCandidate.solver,this.safeTraceLayerPhaseAccepted=this.preBroadCandidate.safeTraceLayerPhaseAccepted),i.count>0&&!this.broadInputSnapshot?(this.preBroadCandidate={routes:r,snapshot:i,solver:s,safeTraceLayerPhaseAccepted:this.safeTraceLayerPhaseAccepted},void this.startBroadBranch()):Nx(i)>0&&this.safeTraceLayerInputSnapshot.errors.some(Hx)?void this.startMixedSafeTraceLayerPhase(r,i,s):void this.startViaInPadPhase(r,i,s)}if(this.phase==="mixedSafeTraceLayer"){if(this.stepBranch(this.mixedSafeTraceLayerSolver,"mixed safe trace-layer"),!this.mixedSafeTraceLayerSolver.solved)return;let e=this.mixedSafeTraceLayerSolver.getOutput(),t=k7(this.params.srj,e,this.params.drcEvaluator,this.params.connMap,this.autoroutingDrcEngine),n=Nx(t)<=Nx(this.legacySafeTraceLayerSnapshot),o=!0;if(this.params.referenceDrcEvaluator){let r=this.getReferenceDrcSnapshot(this.legacySafeTraceLayerRoutes),i=this.getReferenceDrcSnapshot(e);this.mixedReferenceInputDrcIssueCount=r.count,this.mixedReferenceCandidateDrcIssueCount=i.count,o=i.count<=r.count}return this.mixedSafeTraceLayerPhaseAccepted=n&&o,void this.startViaInPadPhase(this.mixedSafeTraceLayerPhaseAccepted?e:this.legacySafeTraceLayerRoutes,this.mixedSafeTraceLayerPhaseAccepted?t:this.legacySafeTraceLayerSnapshot,this.mixedSafeTraceLayerPhaseAccepted?this.mixedSafeTraceLayerSolver:this.legacySafeTraceLayerSelectedSolver)}if(this.phase==="viaInPad"){if(this.stepBranch(this.viaInPadSolver,"via-in-pad"),!this.viaInPadSolver.solved)return;let e=this.viaInPadSolver.getOutput(),t=k7(this.params.srj,e,this.params.viaInPadDrcEvaluator??this.params.drcEvaluator,this.params.connMap,this.autoroutingDrcEngine);this.finishWithOutput(e,t,this.viaInPadSolver)}}getOutput(){return this.outputHdRoutes}visualize(){return(this.activeSubSolver??this.selectedSolver)?.visualize()??super.visualize()}preview(){return(this.activeSubSolver??this.selectedSolver)?.preview()??this.visualize()}},_sn=(e)=>e.circuitJsonMetadata??{},gsn=({connections:e,obstacles:t})=>new Set([...e.flatMap((n)=>n.pointsToConnect.flatMap((o)=>o.pcb_port_id?[o.pcb_port_id]:[])),...t.flatMap((n)=>{let o=_sn(n).pcb_port_id;return o?[o]:[]})]),sKe=(e)=>e.__netConnectionName??e.__rootConnectionNames?.[0]??e.name,zJe=(e)=>Array.from(new Set([e.name,e.__netConnectionName,...e.__rootConnectionNames??[],...e.pointsToConnect.flatMap((t)=>[t.pointId,t.pcb_port_id])])).filter((t)=>Boolean(t)),Asn=(e,t)=>{let n=new Map,o=new Set,r=new Map;for(let i of e){let s=sKe(i);for(let h of zJe(i)){let d=n.get(h);d&&d!==s?(n.delete(h),o.add(h)):o.has(h)||n.set(h,s)}let a=t.getNetConnectedToId(i.name);if(!a)continue;let c=a,l=r.get(c)??new Set;l.add(s),r.set(c,l)}return{connMap:t,circuitJsonSourceTraceIdBySrjDeclaredConnectionReference:n,circuitJsonSourceTraceIdsByConnectivityNetId:r}},H$=(e,t)=>{let n=e.circuitJsonSourceTraceIdBySrjDeclaredConnectionReference.get(t);if(n)return n;let o=e.connMap.getNetConnectedToId(t);if(!o)return;let r=e.circuitJsonSourceTraceIdsByConnectivityNetId.get(o);return r?.size===1?r.values().next().value:void 0};function Lyr(e,t,n=e,o){let r=[],i=n===e?e.connections:[...e.connections,...n.connections],s=n===e?e.obstacles:n.obstacles,a=Asn(i,o??Ep(n===e?e:{...n,connections:i})),c=gsn({connections:i,obstacles:s});if(i.forEach((l)=>{let h=l.pointsToConnect.map((f)=>f.pcb_port_id).filter((f)=>Boolean(f)),d=new Set(h),u=(f)=>((y)=>Array.from(new Set(y.flatMap((x)=>x.connectedTo))))(f).filter((y)=>!d.has(y)),_=l.pointsToConnect.map((f)=>f.pointId).filter((f)=>Boolean(f)),p=H$(a,l.name)??sKe(l),m=[],A=t.find((f)=>(f.connection_name??f.connectionName)===l.name);if(A){let f=(x)=>("route_type"in x)&&x.route_type==="jumper"?x.start:("x"in x)&&("y"in x)?{x:x.x,y:x.y}:{x:0,y:0},y=[f(A.route[0]),f(A.route[A.route.length-1])];for(let x of y)for(let C of s)_S(x,C)<=0&&m.push(C)}let g=r.find((f)=>f.type==="source_trace"&&f.source_trace_id===p);if(g){let f=g;f.connected_source_port_ids=[...new Set([...f.connected_source_port_ids,...h])],f.connected_source_net_ids=[...new Set([...f.connected_source_net_ids??[],..._,...u(m)])]}else r.push({type:"source_trace",source_trace_id:p,connected_source_port_ids:h,connected_source_net_ids:u(m).concat(_)})}),t[0]&&"type"in t[0]){let l=new Map(i.map((h)=>[h.name,h]));for(let h of t){let d=[...new Set((h.connectsTo??[]).filter((g)=>c.has(g)))],u=new Set(d),_=[...new Set((h.connectsTo??[]).filter((g)=>!u.has(g)))];if(d.length===0&&_.length===0)continue;let p=l.get(h.connection_name),m=H$(a,h.connection_name)??h.connectsTo?.map((g)=>H$(a,g)).find((g)=>g!==void 0)??(p?sKe(p):h.connection_name),A=r.find((g)=>g.type==="source_trace"&&g.source_trace_id===m);A?.type!=="source_trace"?r.push({type:"source_trace",source_trace_id:m,connected_source_port_ids:d,connected_source_net_ids:_}):(A.connected_source_port_ids=[...new Set([...A.connected_source_port_ids,...d])],A.connected_source_net_ids=[...new Set([...A.connected_source_net_ids??[],..._])])}}return r}function Hyr(e,t,n){let o,r=Number.POSITIVE_INFINITY;for(let i of t){let s=n.get(i);if(!s)continue;let a=Math.hypot(s.x-e.x,s.y-e.y);a<r&&(r=a,o=i)}return o??t[0]}var Fyr=new Set(["top","bottom","inner1","inner2","inner3","inner4","inner5","inner6","inner7","inner8"]),s$=(e)=>Fyr.has(e);function eVt(e,t,n,o){let r=JSON.stringify([t.center.x,t.center.y,t.width,t.height,t.ccwRotationDegrees??0,[...t.layers].sort()]),i=o.get(e)??new Set;if(i.has(r))return;let s=i.size===0?e:`${e}_fragment_${n}`;return i.add(r),o.set(e,i),s}function zyr(e){let t=[],n=new Map,o=new Map,r=function(s){let a=new Map;for(let c of s.connections)for(let l of c.pointsToConnect)l.pcb_port_id&&a.set(l.pcb_port_id,{x:l.x,y:l.y});return a}(e),i=gsn(e);for(let[s,a]of e.obstacles.entries()){if(a.isNonPlatedHole){let C={type:"pcb_hole",pcb_hole_id:a.obstacleId??`pcb_hole_${s}`,x:a.center.x,y:a.center.y};if(a.shape==="circle")t.push({...C,hole_shape:"circle",hole_diameter:a.width});else{let b=a.ccwRotationDegrees??0;if(b%90!=0)throw Error(`Cannot represent rotated rectangular hole ${C.pcb_hole_id} in Circuit JSON`);let I=b%180!=0;t.push({...C,hole_shape:"rect",hole_width:I?a.height:a.width,hole_height:I?a.width:a.height})}continue}let c=a.connectedTo,l=_sn(a);if(l.pcb_via_id)continue;let{pcb_smtpad_id:h,pcb_plated_hole_id:d}=l,u=[...new Set([...l.pcb_port_id?[l.pcb_port_id]:[],...c.filter((C)=>i.has(C))])];if(u.length===0){for(let C of e.connections)if(a.netIsAssignable||zJe(C).some((b)=>c.includes(b)))for(let b of C.pointsToConnect)b.pcb_port_id&&Math.hypot(b.x-a.center.x,b.y-a.center.y)<0.000001&&u.push(b.pcb_port_id)}let _=l.pcb_port_id&&r.has(l.pcb_port_id)?l.pcb_port_id:Hyr(a.center,u,r);if(!h&&!d&&!_)continue;let p=a.layers.filter(s$);if(p.length===0)continue;let{width:m,height:A}=a,g=a.center.x,f=a.center.y,y=a.ccwRotationDegrees;if(Boolean(d)||p.length>1){let C=eVt(d??`pcb_plated_hole_${g.toFixed(3)}_${f.toFixed(3)}`,a,s,o);if(C===void 0)continue;if(typeof y=="number"&&Number.isFinite(y)){let b=Math.max(0.5*Math.min(m,A),0.1);t.push({type:"pcb_plated_hole",pcb_plated_hole_id:C,shape:"rotated_pill_hole_with_rect_pad",hole_shape:"rotated_pill",pad_shape:"rect",hole_width:b,hole_height:b,hole_ccw_rotation:y,rect_pad_width:m,rect_pad_height:A,rect_ccw_rotation:y,hole_offset_x:0,hole_offset_y:0,x:g,y:f,layers:p,..._?{pcb_port_id:_}:{}});continue}if(Math.abs(m-A)<0.001){t.push({type:"pcb_plated_hole",pcb_plated_hole_id:C,shape:"circle",outer_diameter:Math.max(m,A),hole_diameter:Math.max(0.5*Math.min(m,A),0.1),x:g,y:f,layers:p,..._?{pcb_port_id:_}:{}});continue}t.push({type:"pcb_plated_hole",pcb_plated_hole_id:C,shape:"circular_hole_with_rect_pad",hole_shape:"circle",hole_diameter:Math.max(0.5*Math.min(m,A),0.1),rect_pad_width:m,rect_pad_height:A,hole_offset_x:0,hole_offset_y:0,x:g,y:f,layers:p,..._?{pcb_port_id:_}:{}});continue}let x=eVt(h??`pcb_smtpad_${g.toFixed(3)}_${f.toFixed(3)}`,a,s,n);x!==void 0&&(typeof y=="number"&&Number.isFinite(y)?t.push({type:"pcb_smtpad",pcb_smtpad_id:x,layer:p[0],shape:"rotated_rect",x:g,y:f,width:m,height:A,ccw_rotation:y,..._?{pcb_port_id:_}:{}}):t.push({type:"pcb_smtpad",pcb_smtpad_id:x,layer:p[0],shape:"rect",width:m,height:A,x:g,y:f,..._?{pcb_port_id:_}:{}}))}return t}function tVt(e,t,n){if(n&&e.layers!==void 0)return e.layers;let o=n?e:{from_layer:"top",to_layer:Nh(t-1,t)};return fnn(o,t)}function fsn(e){let{minX:t,maxX:n,minY:o,maxY:r}=e.bounds;return{type:"pcb_board",pcb_board_id:"__autorouting_board__",thickness:1.6,num_layers:e.layerCount,center:{x:(t+n)/2,y:(o+r)/2},width:n-t,height:r-o,...e.outline?{outline:e.outline,shape:"polygon"}:{shape:"rect"},material:"fr4",min_trace_to_hole_edge_clearance:e.minTraceToHoleEdgeClearance,min_pad_edge_to_pad_edge_clearance:e.minPadEdgeToPadEdgeClearance,...e.minBoardEdgeClearance!==void 0?{min_board_edge_clearance:e.minBoardEdgeClearance}:{}}}function OJe(e,t,n={}){let{minTraceWidth:o=0.1,minViaDiameter:r,minViaHoleDiameter:i,originalSrj:s,includeOriginalConnections:a=!1}=n,c=Pp(e),l=r??c.padDiameter,h=e.min_via_hole_diameter??e.minViaHoleDiameter,d=i??h??(r!==void 0?0.5*l:c.holeDiameter),u=[];u.push(...Lyr(e,t,a&&s?s:e,n.connectivityMaps?.source)),u.push(...function(m){let A=new Map;return m.connections.forEach((g)=>{g.pointsToConnect.forEach((f)=>{f.pcb_port_id&&A.set(f.pcb_port_id,{type:"pcb_port",pcb_port_id:f.pcb_port_id,source_port_id:f.pcb_port_id,x:f.x,y:f.y,layers:zx(f)})})}),Array.from(A.values())}(a&&s?s:e)),u.push(...zyr(s??e)),u.push(...function(m,A,g=0.3,f=0.5*g,y=!1){let x=[],C=new Set;return m.length>0&&("type"in m[0]&&m[0].type==="pcb_trace"?m.forEach((b)=>{b.route.forEach((I)=>{if(I.route_type==="via"){if(!s$(I.from_layer)||!s$(I.to_layer))return;let v=I.via_diameter??g,P=I.via_hole_diameter??f,M=`${I.x},${I.y},${I.from_layer},${I.to_layer}`;C.has(M)||(x.push({type:"pcb_via",pcb_via_id:`via_${x.length}`,pcb_trace_id:b.pcb_trace_id,x:I.x,y:I.y,outer_diameter:v,hole_diameter:P,layers:tVt(I,A,y)}),C.add(M))}})}):m.forEach((b,I)=>{let v=`trace_${I}`,P=b.viaDiameter??g,M=f;for(let B=1;B<b.route.length;B++){let T=b.route[B-1],N=b.route[B];if(T.z!==N.z&&Math.abs(T.x-N.x)<0.01&&Math.abs(T.y-N.y)<0.01){let D=Nh(T.z,A),L=Nh(N.z,A),H=`${N.x},${N.y},${D},${L}`;C.has(H)||(x.push({type:"pcb_via",pcb_via_id:`via_${x.length}`,pcb_trace_id:v,x:N.x,y:N.y,outer_diameter:P,hole_diameter:M,layers:tVt({from_layer:D,to_layer:L},A,y)}),C.add(H))}}})),x}(t,e.layerCount,l,d,(s??e).allowBlindAndBuriedVias===!0));let _=new Set(e.connections.flatMap(zJe)),p=Asn(a&&s?[...e.connections,...s.connections.filter((m)=>!_.has(m.name))]:e.connections,n.connectivityMaps?.route??Ep(e));return t.length>0&&("type"in t[0]&&t[0].type==="pcb_trace"?t.forEach((m)=>{let A=H$(p,m.connection_name)??m.connectsTo?.map((g)=>H$(p,g)).find((g)=>Boolean(g))??m.connection_name;u.push(function(g,f){return{type:"pcb_trace",pcb_trace_id:g.pcb_trace_id,source_trace_id:f,route:g.route.map((y)=>{if(y.route_type==="wire"){if(!s$(y.layer))return null;let x="start_pcb_port_id"in y&&typeof y.start_pcb_port_id=="string"?y.start_pcb_port_id:void 0,C="end_pcb_port_id"in y&&typeof y.end_pcb_port_id=="string"?y.end_pcb_port_id:void 0;return{route_type:"wire",x:y.x,y:y.y,width:y.width,layer:y.layer,...x?{start_pcb_port_id:x}:{},...C?{end_pcb_port_id:C}:{}}}return y.route_type==="via"&&s$(y.from_layer)&&s$(y.to_layer)?{route_type:"via",x:y.x,y:y.y,from_layer:y.from_layer,to_layer:y.to_layer}:null}).filter((y)=>y!==null)}}(m,A))}):t.forEach((m,A)=>{let g=function(f,y,x,C,b=0.1){let I=[];if(!f.jumpers||f.jumpers.length===0)return[{type:"pcb_trace",pcb_trace_id:y,source_trace_id:x,route:f.route.map((B,T)=>{let N=T===0,D=T===f.route.length-1;return{route_type:"wire",x:B.x,y:B.y,width:B.traceThickness??b,layer:Nh(B.z,C),...N&&B.pcb_port_id?{start_pcb_port_id:B.pcb_port_id}:{},...D&&B.pcb_port_id?{end_pcb_port_id:B.pcb_port_id}:{}}})}];let v=[];for(let B of f.jumpers){let T=-1,N=-1;for(let D=0;D<f.route.length;D++){let L=f.route[D];Math.abs(L.x-B.start.x)<0.01&&Math.abs(L.y-B.start.y)<0.01&&(T=D),Math.abs(L.x-B.end.x)<0.01&&Math.abs(L.y-B.end.y)<0.01&&(N=D)}T!==-1&&N!==-1&&(T>N&&([T,N]=[N,T]),v.push({startIdx:T,endIdx:N}))}v.sort((B,T)=>B.startIdx-T.startIdx);let P=0,M=0;for(let{startIdx:B,endIdx:T}of v){if(B>=P){let N=f.route.slice(P,B+1);N.length>0&&(I.push({type:"pcb_trace",pcb_trace_id:`${y}_${M}`,source_trace_id:x,route:N.map((D,L)=>{let H=L===0&&P===0;return{route_type:"wire",x:D.x,y:D.y,width:D.traceThickness??b,layer:Nh(D.z,C),...H&&D.pcb_port_id?{start_pcb_port_id:D.pcb_port_id}:{}}})}),M++)}P=T}if(P<f.route.length){let B=f.route.slice(P);if(B.length>0)I.push({type:"pcb_trace",pcb_trace_id:`${y}_${M}`,source_trace_id:x,route:B.map((N,D)=>{let L=D===B.length-1;return{route_type:"wire",x:N.x,y:N.y,width:N.traceThickness??b,layer:Nh(N.z,C),...L&&N.pcb_port_id?{end_pcb_port_id:N.pcb_port_id}:{}}})})}return I}(m,`trace_${A}`,H$(p,m.connectionName)??m.connectionName,e.layerCount,o);u.push(...g)})),u}var UK=Symbol("originalPortPoint"),Oyr=class extends N7{constructor(e){let t=e.nodeWithPortPoints,n=(e.traceThickness??0.1)/2+(e.traceMargin??0.1),o=t.width>2*n&&t.height>2*n,r=t.center.x-t.width/2+n,i=t.center.x+t.width/2-n,s=t.center.y-t.height/2+n,a=t.center.y+t.height/2-n,c=t.portPoints.map((d)=>({...d,x:Math.max(r,Math.min(i,d.x)),y:Math.max(s,Math.min(a,d.y)),[UK]:d})),l=new Map,h=!1;for(let d of c){let u=`${d.x},${d.y},${d.z}`,_=l.get(u),p=d[UK];!_||_.x===p.x&&_.y===p.y||(h=!0),l.set(u,p)}super({...e,nodeWithPortPoints:o?{...t,width:t.width-2*n,height:t.height-2*n,portPoints:c}:t}),h&&(this.failed=!0,this.error="Boundary clearance collapses distinct terminals"),o||(this.failed=!0,this.error="Node has no interior after copper boundary clearance")}getOutput(){return super.getOutput().map((e)=>{let t=e.route[0],n=e.route[e.route.length-1];if(!t[UK]||!n[UK])throw Error("A13 route lost its original terminal metadata");return{...e,route:[{...t[UK]},...e.route,{...n[UK]}]}})}},Vyr=class extends Oyr{constructor(e){super(e),this.validationParams=e}validationParams;_step(){if(super._step(),!this.solved)return;let e=this.getOutput(),{connMap:t,layerCount:n}=this.validationParams,o=this.nodeWithPortPoints,r=e.flatMap((g)=>g.route),i=Math.max(this.traceThickness,this.viaDiameter)/2+Math.max(this.traceMargin,0.1)+0.000001,s=Math.min(...r.map((g)=>g.x))-i,a=Math.max(...r.map((g)=>g.x))+i,c=Math.min(...r.map((g)=>g.y))-i,l=Math.max(...r.map((g)=>g.y))+i,h=this.validationParams.obstacles.filter((g)=>{let f=Math.hypot(g.width,g.height)/2;return g.center.x+f>=s&&g.center.x-f<=a&&g.center.y+f>=c&&g.center.y-f<=l});this.stats.boardObstaclesChecked=h.length;let{connectedRouteNamesByObstacle:d,connectedObstaclesByRoute:u}=(({obstacles:g,routes:f,connMap:y})=>{let x=g.map(()=>[]),C=f.map(()=>[]);for(let b=0;b<g.length;b++){let I=g[b],v={...I,connectedTo:[...new Set(I.connectedTo)]};for(let P=0;P<f.length;P++){let M=f[P];Pw(v,M,y)&&(x[b].push(M.connectionName),C[P].push(I))}}return{connectedRouteNamesByObstacle:x,connectedObstaclesByRoute:C}})({obstacles:h,routes:e,connMap:t}),_={layerCount:n,minTraceWidth:this.traceThickness,minViaDiameter:this.viaDiameter,bounds:{minX:o.center.x-o.width/2,maxX:o.center.x+o.width/2,minY:o.center.y-o.height/2,maxY:o.center.y+o.height/2},...this.validationParams.boardGeometry,obstacles:h.map((g,f)=>({...g,connectedTo:[...g.connectedTo,...d[f]]})),connections:e.map((g,f)=>({name:g.connectionName,rootConnectionName:g.rootConnectionName,__netConnectionName:g.rootConnectionName??g.connectionName,pointsToConnect:[...[g.route[0],g.route.at(-1)].map((y)=>({x:y.x,y:y.y,layer:Nh(y.z,n)})),...u[f].flatMap((y)=>{let x=y.circuitJsonMetadata?.pcb_port_id;return x?[{...y.center,layer:Nh(0,n),pcb_port_id:x}]:[]})]}))},p=OJe(_,e.map((g,f)=>({type:"pcb_trace",pcb_trace_id:`${g.connectionName}_${f}`,connection_name:g.connectionName,route:V4(g,n)})));this.validationParams.boardGeometry&&p.push(fsn(_));let{errors:m}=Ann(p,{traceClearance:this.traceMargin,viaClearance:this.traceMargin,includeTraceContinuity:!1}),A=sV({srj:{..._,traces:void 0},routes:e});this.stats.boardDrcIssueCount=m.length+A.length,(m.length>0||A.length>0)&&(this.solved=!1,this.failed=!0,this.error=`A13 candidate fails board copper validation: ${m[0]?.message??"fixed obstacle clearance violation"}`)}},z4=(e)=>`${e.x.toFixed(6)},${e.y.toFixed(6)},${e.z}`,Yyr=(e)=>[e.route[0],e.route[e.route.length-1]],KCe=(e,t,n)=>{let o=new Map,r=(a,c)=>{o.has(a)||o.set(a,new Set),o.has(c)||o.set(c,new Set),o.get(a).add(c),o.get(c).add(a)};for(let a of e)if(a.connectionName===t&&a.route.length!==0){if(a.route.length===1){let c=z4(a.route[0]);o.has(c)||o.set(c,new Set);continue}for(let c=0;c<a.route.length-1;c++)r(z4(a.route[c]),z4(a.route[c+1]))}let i=new Set([n]),s=[n];for(;s.length>0;){let a=s.pop();for(let c of o.get(a)??[])i.has(c)||(i.add(c),s.push(c))}return i},HWe=Array.from({length:6},(e,t)=>t),dV=class extends kbe{getSolverName(){return"PortfolioSingleIntraNodeSolver"}constructorParams;solvedRoutes=[];nodeWithPortPoints;connMap;effort;adaptiveSearchExpanded=!1;negotiatedSearchStarted=!1;enableNegotiatedSearch;gridSearchSegmentWork;gridSearchWorkScale;rejectOverlappingTerminals;precomputedIntraNodeRouteParams;nodeSegmentCount;totalCandidateWork=0;dynamicExpansionWorkBudget=1;candidateWorkBySolver=new WeakMap;getSolvedSegmentCount(e){let t=e.solvedConnectionsMap;if(!(t instanceof Map))return null;let n=0;for(let o of t.values())Array.isArray(o)&&(n+=o.length);return n}getNodeSegmentCount(){return this.nodeSegmentCount??=Math.max(1,this.nodeWithPortPoints.portPointsInPairs?.length??new Set(this.nodeWithPortPoints.portPoints.map((e)=>e.connectionName)).size),this.nodeSegmentCount}getCandidateProgress(e){if(e instanceof N7){if(e.solved)return 1;let n=e.connections.length;if(n===0)return 0;let o=e.routedCount/n,r=Math.max(0,(e.routedCount-e.conflictCount)/n);return Math.min(0.99,(o+r)/2)}let t=this.getSolvedSegmentCount(e);return t!==null?Math.min(1,t/this.getNodeSegmentCount()):Math.max(0,Math.min(1,e.progress||0))}constructor(e){if(super(),this.nodeWithPortPoints=e.nodeWithPortPoints,this.connMap=e.connMap,this.constructorParams=e,this.effort=e.effort??1,this.gridSearchSegmentWork=e.gridSearchSegmentWork??1e4,this.gridSearchWorkScale=e.gridSearchWorkScale??1,this.rejectOverlappingTerminals=e.rejectOverlappingTerminals??!1,this.enableNegotiatedSearch=e.enableNegotiatedSearch??!1,this.MAX_ITERATIONS=20000000*this.effort,this.GREEDY_MULTIPLIER=5,this.MIN_SUBSTEPS=100,this.rejectOverlappingTerminals){let t=this.nodeWithPortPoints.portPoints,n=e.traceWidth??0.15;for(let o=0;o<t.length;o++)for(let r=o+1;r<t.length;r++){let i=t[o],s=t[r];if(i.z===s.z&&(i.rootConnectionName??i.connectionName)!==(s.rootConnectionName??s.connectionName)&&!this.connMap?.areIdsConnected(i.connectionName,s.connectionName)&&Math.hypot(i.x-s.x,i.y-s.y)<n-0.000001)return this.failed=!0,void(this.error="Unrelated route terminals overlap at the requested trace width")}}}getGridSearchIterationBudget(){let e=this.nodeWithPortPoints,t=e.availableZ?.length??new Set(e.portPoints.map((r)=>r.z)).size,n=Math.floor(e.width/0.1)*Math.floor(e.height/0.1)*t,o=t>2?this.gridSearchWorkScale:1;return Math.round(o*Math.max(150000,(t<=2?1e4:this.gridSearchSegmentWork)*this.getNodeSegmentCount()**2,Math.round(n*(8+1.2*Math.sqrt(this.getNodeSegmentCount()))*this.effort)))}getCombinationDefs(){return[["throughObstacle"],["singleLayerNoDifferentRootIntersections"],["multiHeadPolyLine"],["majorCombinations","orderings6","cellSizeFactor"],["noVias"],["orderings50"],["flipTraceAlignmentDirection","orderings6"],["closedFormSingleTrace"],["highDensityA01"],["highDensityA03"],...this.enableNegotiatedSearch?[["highDensityA13"]]:[]]}getHyperParameterDefs(){return[{name:"singleLayerNoDifferentRootIntersections",possibleValues:[{SINGLE_LAYER_NO_DIFFERENT_ROOT_INTERSECTIONS:!0}]},{name:"majorCombinations",possibleValues:[{FUTURE_CONNECTION_PROX_TRACE_PENALTY_FACTOR:2,FUTURE_CONNECTION_PROX_VIA_PENALTY_FACTOR:1,FUTURE_CONNECTION_PROXIMITY_VD:10,MISALIGNED_DIST_PENALTY_FACTOR:5},{FUTURE_CONNECTION_PROX_TRACE_PENALTY_FACTOR:1,FUTURE_CONNECTION_PROX_VIA_PENALTY_FACTOR:0.5,FUTURE_CONNECTION_PROXIMITY_VD:5,MISALIGNED_DIST_PENALTY_FACTOR:2},{FUTURE_CONNECTION_PROX_TRACE_PENALTY_FACTOR:10,FUTURE_CONNECTION_PROX_VIA_PENALTY_FACTOR:1,FUTURE_CONNECTION_PROXIMITY_VD:5,MISALIGNED_DIST_PENALTY_FACTOR:10,VIA_PENALTY_FACTOR_2:1}]},{name:"orderings6",possibleValues:HWe.map((e)=>({SHUFFLE_SEED:e}))},{name:"cellSizeFactor",possibleValues:[{CELL_SIZE_FACTOR:0.5},{CELL_SIZE_FACTOR:1}]},{name:"flipTraceAlignmentDirection",possibleValues:[{FLIP_TRACE_ALIGNMENT_DIRECTION:!0}]},{name:"noVias",possibleValues:[{CELL_SIZE_FACTOR:2,VIA_PENALTY_FACTOR_2:10}]},{name:"orderings50",possibleValues:Array.from({length:20},(e,t)=>({SHUFFLE_SEED:100+t}))},{name:"throughObstacle",possibleValues:[{THROUGH_OBSTACLE:!0}]},{name:"closedFormSingleTrace",possibleValues:[{CLOSED_FORM_SINGLE_TRANSITION:!0}]},{name:"multiHeadPolyLine",possibleValues:[{MULTI_HEAD_POLYLINE_SOLVER:!0,SEGMENTS_PER_POLYLINE:6,BOUNDARY_PADDING:0.05},{MULTI_HEAD_POLYLINE_SOLVER:!0,SEGMENTS_PER_POLYLINE:6,BOUNDARY_PADDING:-0.05,ITERATION_PENALTY:1e4,MINIMUM_FINAL_ACCEPTANCE_GAP:0.001}]},{name:"highDensityA01",possibleValues:[{HIGH_DENSITY_A01:!0,SHUFFLE_SEED:HWe[0]}]},{name:"highDensityA03",possibleValues:[{HIGH_DENSITY_A03:!0}]},{name:"highDensityA13",possibleValues:[{HIGH_DENSITY_A13:!0,SHUFFLE_SEED:0}]}]}initializeCandidateBudget(e){if(e instanceof N7)return;let t=e.setup;typeof t=="function"&&t.call(e),(e instanceof k4e||e instanceof H4e)&&(e.MAX_ITERATIONS=Math.min(e.MAX_ITERATIONS,this.getGridSearchIterationBudget()))}refreshDynamicIterationLimit(){this.totalCandidateWork=0,this.dynamicExpansionWorkBudget=1;let e=(this.supervisedSolvers??[]).reduce((t,{solver:n})=>{if(n instanceof N7||(this.totalCandidateWork+=n.iterations,this.dynamicExpansionWorkBudget=Math.max(this.dynamicExpansionWorkBudget,n.MAX_ITERATIONS),this.candidateWorkBySolver.set(n,{iterations:n.iterations,maxIterations:n.MAX_ITERATIONS})),n.solved||n.failed)return t;let o=Math.max(0,n.MAX_ITERATIONS-n.iterations+1);return t+Math.ceil(o/this.MIN_SUBSTEPS)},0);this.MAX_ITERATIONS=Math.max(this.iterations+1,this.iterations+e),this.stats.dynamicSupervisorIterationLimit=this.MAX_ITERATIONS}initializeSolvers(){super.initializeSolvers();for(let{solver:e}of this.supervisedSolvers??[])this.initializeCandidateBudget(e);this.refreshDynamicIterationLimit(),this.stats.dynamicExpansionWorkBudget=this.dynamicExpansionWorkBudget}addSupervisedCandidate(e){let t=this.generateSolver(e);this.initializeCandidateBudget(t);let n=this.computeG(t);this.supervisedSolvers.push({hyperParameters:e,solver:t,h:0,g:n,f:n})}expandAdaptiveSearch(){if(!this.adaptiveSearchExpanded){this.adaptiveSearchExpanded=!0;for(let e of HWe.slice(1))this.addSupervisedCandidate({HIGH_DENSITY_A01:!0,SHUFFLE_SEED:e});this.refreshDynamicIterationLimit(),this.stats.adaptiveSearchExpanded=!0,this.stats.adaptiveSearchExpandedAtIteration=this.iterations,this.stats.candidateWorkAtExpansion=this.totalCandidateWork,this.stats.bestProgressAtExpansion=Math.max(0,...(this.supervisedSolvers??[]).map(({solver:e})=>this.getCandidateProgress(e)))}}shouldExpandPortfolio(){if(this.adaptiveSearchExpanded)return!1;let e=this.dynamicExpansionWorkBudget;return this.stats.dynamicExpansionWorkBudget=e,this.totalCandidateWork>=e}_step(){this.supervisedSolvers||this.initializeSolvers(),this.adaptiveSearchExpanded||this.getSupervisedSolverWithBestFitness()||this.expandAdaptiveSearch(),super._step(),!this.negotiatedSearchStarted&&this.activeSubSolver instanceof N7&&(this.negotiatedSearchStarted=!0,this.stats.negotiatedSearchStartedAtIteration=this.iterations),this.solved||this.failed||!this.shouldExpandPortfolio()||this.expandAdaptiveSearch()}computeG(e){if(e instanceof N7)return e.routingIterations/1e6;let t=this.candidateWorkBySolver.get(e);if(t&&(this.totalCandidateWork+=e.iterations-t.iterations,t.iterations=e.iterations,t.maxIterations!==e.MAX_ITERATIONS)){t.maxIterations=e.MAX_ITERATIONS,this.dynamicExpansionWorkBudget=1;for(let{solver:n}of this.supervisedSolvers??[])n instanceof N7||(this.dynamicExpansionWorkBudget=Math.max(this.dynamicExpansionWorkBudget,n.MAX_ITERATIONS))}return e instanceof k4e||e instanceof H4e||e instanceof N7?e.iterations/1e6:e?.hyperParameters?.MULTI_HEAD_POLYLINE_SOLVER?1000+((e.hyperParameters?.ITERATION_PENALTY??0)+e.iterations)/1e4+1e4*(e.hyperParameters.SEGMENTS_PER_POLYLINE-3):e.iterations/1e4}computeH(e){return e instanceof N7||this.adaptiveSearchExpanded?1-this.getCandidateProgress(e):1-(e.progress||0)}generateSolver(e){if(this.precomputedIntraNodeRouteParams??=CXt(this.nodeWithPortPoints),e.SINGLE_LAYER_NO_DIFFERENT_ROOT_INTERSECTIONS){if(!UFt.isApplicable(this.nodeWithPortPoints)){let t=new Qbe({nodeWithPortPoints:this.nodeWithPortPoints,connMap:this.connMap,traceWidth:this.constructorParams.traceWidth,viaDiameter:this.constructorParams.viaDiameter,obstacleMargin:this.constructorParams.obstacleMargin,precomputedIntraNodeRouteParams:this.precomputedIntraNodeRouteParams});return t.failed=!0,t.error="Single-layer no-different-root-intersection solver not applicable",t}return new UFt({nodeWithPortPoints:this.nodeWithPortPoints,traceWidth:this.constructorParams.traceWidth,viaDiameter:this.constructorParams.viaDiameter})}if(e.HIGH_DENSITY_A13){let t=Math.max(1,Math.round(50000000*this.effort)),n=new Vyr({obstacles:this.constructorParams.obstacles??[],boardGeometry:this.constructorParams.boardGeometry,connMap:this.connMap,layerCount:this.constructorParams.layerCount??2,nodeWithPortPoints:this.nodeWithPortPoints,cellSizeMm:0.1,viaDiameter:this.constructorParams.viaDiameter??0.3,viaMinDistFromBorder:(this.constructorParams.viaDiameter??0.3)/2,traceThickness:this.constructorParams.traceWidth??0.15,traceMargin:0.1,stepMultiplier:1000,maxSearchIterations:t,maxRounds:Math.max(1,Math.round(200*this.effort)),hyperParameters:{shuffleSeed:e.SHUFFLE_SEED??0}});return n.MAX_ITERATIONS=2*t,n}if(e.HIGH_DENSITY_A01)return new k4e({nodeWithPortPoints:this.nodeWithPortPoints,cellSizeMm:0.1,viaDiameter:this.constructorParams.viaDiameter??0.3,viaMinDistFromBorder:(this.constructorParams.viaDiameter??0.3)/2,traceMargin:0.1,traceThickness:this.constructorParams.traceWidth??0.15,effort:this.effort,hyperParameters:{shuffleSeed:e.SHUFFLE_SEED??0}});if(e.HIGH_DENSITY_A03)return new H4e({nodeWithPortPoints:this.nodeWithPortPoints,highResolutionCellSize:0.1,highResolutionCellThickness:8,lowResolutionCellSize:0.4,viaDiameter:this.constructorParams.viaDiameter??0.3,viaMinDistFromBorder:(this.constructorParams.viaDiameter??0.3)/2,traceMargin:0.1,traceThickness:0.1,effort:this.effort,hyperParameters:e});return e.CLOSED_FORM_TWO_TRACE_SAME_LAYER?new z_r({nodeWithPortPoints:this.nodeWithPortPoints,viaDiameter:this.constructorParams.viaDiameter}):e.CLOSED_FORM_TWO_TRACE_TRANSITION_CROSSING?new H_r({nodeWithPortPoints:this.nodeWithPortPoints,viaDiameter:this.constructorParams.viaDiameter}):e.CLOSED_FORM_SINGLE_TRANSITION?new R_r({nodeWithPortPoints:this.nodeWithPortPoints,viaDiameter:this.constructorParams.viaDiameter}):e.THROUGH_OBSTACLE?new Q_r({nodeWithPortPoints:this.nodeWithPortPoints,obstacles:this.constructorParams.obstacles,connMap:this.connMap,layerCount:this.constructorParams.layerCount,viaDiameter:this.constructorParams.viaDiameter,traceThickness:this.constructorParams.traceWidth}):e.MULTI_HEAD_POLYLINE_SOLVER?new PXt({nodeWithPortPoints:this.nodeWithPortPoints,connMap:this.connMap,hyperParameters:e,viaDiameter:this.constructorParams.viaDiameter}):new b$e({...this.constructorParams,hyperParameters:e,precomputedIntraNodeRouteParams:this.precomputedIntraNodeRouteParams})}onSolve(e){let t;t=e.solver instanceof k4e||e.solver instanceof H4e||e.solver instanceof N7?e.solver.getOutput():e.solver.solvedRoutes;let n=t.map((o)=>{let r=this.nodeWithPortPoints.portPoints.find((i)=>i.connectionName===o.connectionName);return r?.rootConnectionName?{...o,rootConnectionName:r.rootConnectionName}:o});this.solvedRoutes=((o,r)=>{let i=[...o],s=new Map;for(let a of r.portPoints){let c=s.get(a.connectionName)??[];c.push(a),s.set(a.connectionName,c)}for(let[a,c]of s){if(c.length<=1)continue;let l=c[0]?.rootConnectionName??a,h=new Set(c.map(z4)),d=KCe(i,a,z4(c[0]));for(let u of c.slice(1)){let _=z4(u);if(d.has(_))continue;let p=i.find((m)=>{if((m.rootConnectionName??m.connectionName)!==l)return!1;if(m.connectionName===a)return!1;let[A,g]=Yyr(m);if(!A||!g)return!1;let f=z4(A),y=z4(g);return d.has(f)&&y===_||d.has(y)&&f===_||h.has(f)&&h.has(y)&&(f===_||y===_)});p&&(i.push({...p,connectionName:a,rootConnectionName:l,route:p.route.map((m)=>({...m,connectionName:a,rootConnectionName:l})),vias:p.vias.map((m)=>({...m})),jumpers:p.jumpers?.map((m)=>({...m,start:{...m.start},end:{...m.end}}))}),d=KCe(i,a,z4(c[0])))}}return i})(n,this.nodeWithPortPoints)}};function nVt(e,t,n,o,r){let i=n-t,s=r-o;if(Math.abs(e.y-r)<0.000001)return e.x-t;if(Math.abs(e.x-n)<0.000001)return i+(r-e.y);if(Math.abs(e.y-o)<0.000001)return i+s+(n-e.x);if(Math.abs(e.x-t)<0.000001)return 2*i+s+(e.y-o);let c=Math.abs(e.y-r),l=Math.abs(e.x-n),h=Math.abs(e.y-o),d=Math.abs(e.x-t),u=Math.min(c,l,h,d);return u===c?Math.max(0,Math.min(i,e.x-t)):u===l?i+Math.max(0,Math.min(s,r-e.y)):u===h?i+s+Math.max(0,Math.min(i,n-e.x)):2*i+s+Math.max(0,Math.min(s,e.y-o))}function Z4e(e,t,n=0.000001){return Math.abs(e-t)<n}function oVt(e){if(e.length<2)return 0;let t=e.map(([o,r])=>o<r?[o,r]:[r,o]),n=0;for(let o=0;o<t.length;o++){let[r,i]=t[o];for(let s=o+1;s<t.length;s++){let[a,c]=t[s];Z4e(r,a)||Z4e(r,c)||Z4e(i,a)||Z4e(i,c)||(r<a&&a<i&&i<c||a<r&&r<c&&c<i)&&n++}}return n}var o_=(e)=>{let t=e.center.x-e.width/2,n=e.center.x+e.width/2,o=e.center.y-e.height/2,r=e.center.y+e.height/2,i=new Map;for(let h of e.portPoints){let d=i.get(h.connectionName)??[];d.some((u)=>u.x===h.x&&u.y===h.y&&u.z===h.z)||d.push({x:h.x,y:h.y,z:h.z}),i.set(h.connectionName,d)}let s=new Map,a=[],c=0;for(let[h,d]of i){if(d.length<2)continue;let u=d[0],_=d[1],p=nVt(u,t,n,o,r),m=nVt(_,t,n,o,r);if(u.z===_.z){let A=u.z,g=s.get(A)??[];g.push([p,m]),s.set(A,g)}else c++,a.push([p,m])}let l=0;for(let[h,d]of s)l+=oVt(d);return{numSameLayerCrossings:l,numEntryExitLayerChanges:c,numTransitionPairCrossings:oVt(a)}},ysn=(e)=>e.availableZ?.length?[...new Set(e.availableZ)].sort((t,n)=>t-n):[...new Set(e.portPoints.map((t)=>t.z??0))].sort((t,n)=>t-n),xsn=(e)=>ysn(e).length===1&&o_(e).numSameLayerCrossings>0,Csn=(e,t,n)=>{let o=new Map,[r]=ysn(e);for(let i of e.portPoints)o.set(i.connectionName,[...o.get(i.connectionName)??[],i]);return Array.from(o.entries()).flatMap(([i,s])=>{if(s.length<2)return[];let a=s[0],c=s[s.length-1];return[{connectionName:i,rootConnectionName:a.rootConnectionName,regionId:e.capacityMeshNodeId,traceThickness:t,viaDiameter:n,route:[{x:a.x,y:a.y,z:r??a.z??0},{x:c.x,y:c.y,z:r??c.z??0}],vias:[]}]})},Gyr=Csn,oce=(e,t,n)=>({...e,x:t.x+(e.x-t.x)*n,y:t.y+(e.y-t.y)*n}),FWe=(e,t,n)=>oce(e,t,n),e3e=["#dc2626","#2563eb","#16a34a","#ca8a04","#9333ea","#0891b2"],rVt=(e,t,n=[])=>[e,t?`rootConnectionName: ${t}`:void 0,...n].filter(Boolean).join(`
`),zWe=class extends Kr{getSolverName(){return"GrowShrinkHighDensityIntraNodeSolver"}constructorParams;nodeWithPortPoints;solvedRoutes=[];failedSolvers=[];activeSubSolver=null;winningSolver;scaleFactor=1;growthAttempts=0;maxGrowthAttempts;minimumGrowthAttempts;constructor(e){super(),this.constructorParams=e,this.nodeWithPortPoints=e.nodeWithPortPoints;let t=Math.min(this.nodeWithPortPoints.width,this.nodeWithPortPoints.height),n=t>0?Math.max(0,Math.ceil(Math.log2((e.viaDiameter??0.3)/t))):0,o=Number.POSITIVE_INFINITY,r=this.nodeWithPortPoints.portPoints;for(let a=0;a<r.length;a++)for(let c=a+1;c<r.length;c++){let l=r[a],h=r[c];if(l.z!==h.z||(l.rootConnectionName??l.connectionName)===(h.rootConnectionName??h.connectionName))continue;let d=Math.hypot(l.x-h.x,l.y-h.y);d>0.000000001&&(o=Math.min(o,d))}let i=Math.max(0,Math.ceil(Math.log2((e.traceWidth??0.15)/o))),s=Math.max(n,i);if(this.maxGrowthAttempts=e.maxGrowthAttempts??3+s,this.minimumGrowthAttempts=Math.min(e.maxGrowthAttempts??3+n,Math.max(n,0,i-1)),this.MAX_ITERATIONS=20000000*(e.effort??1)*(this.maxGrowthAttempts+1),xsn(this.nodeWithPortPoints)){if(!e.fallbackToInvalidGeometryOnFailure)return this.failed=!0,this.progress=1,void(this.error="GrowShrinkHighDensityIntraNodeSolver cannot route an impossible single-layer crossing");this.solvedRoutes=Gyr(this.nodeWithPortPoints,e.traceWidth??0.15,e.viaDiameter??0.3),this.solved=!0,this.progress=1,this.stats={invalidGeometryFallback:!0,reason:"single-layer node has same-layer crossings"}}}getConstructorParams(){return this.constructorParams}createActiveSubSolver(){let{growShrinkSolutionValidator:e,...t}=this.constructorParams;var n,o;this.activeSubSolver=new dV({...t,enableNegotiatedSearch:this.scaleFactor===1&&(t.enableNegotiatedSearch??!0),nodeWithPortPoints:(n=this.nodeWithPortPoints,o=this.scaleFactor,{...n,width:n.width*o,height:n.height*o,portPoints:n.portPoints.map((r)=>FWe(r,n.center,o)),portPointsInPairs:n.portPointsInPairs?.map(([r,i])=>[FWe(r,n.center,o),FWe(i,n.center,o)])})}),this.constructorParams.maxInnerIterationsPerGrowthAttempt&&(this.activeSubSolver.MAX_ITERATIONS=this.constructorParams.maxInnerIterationsPerGrowthAttempt)}acceptSolution(e){let t=this.scaleFactor===1?e.solvedRoutes:e.solvedRoutes.map((n)=>((o,r,i)=>({...o,route:o.route.map((s)=>oce(s,r,i)),vias:o.vias.map((s)=>oce(s,r,i)),jumpers:o.jumpers?.map((s)=>({...s,start:oce(s.start,r,i),end:oce(s.end,r,i)}))}))(n,this.nodeWithPortPoints.center,1/this.scaleFactor));return this.constructorParams.growShrinkSolutionValidator&&!this.constructorParams.growShrinkSolutionValidator(t)?(e.solved=!1,e.failed=!0,e.error="High-density scale solution rejected by validator",!1):(this.winningSolver=e,this.error=null,this.solvedRoutes=t,this.solved=!0,this.failed=!1,!0)}computeProgress(){return Math.min(0.99,(this.growthAttempts+(this.activeSubSolver?.progress??0))/(this.maxGrowthAttempts+1))}_step(){if(this.activeSubSolver||this.createActiveSubSolver(),this.activeSubSolver.step(),this.activeSubSolver.solved&&this.acceptSolution(this.activeSubSolver))this.activeSubSolver=null;else if(this.activeSubSolver.failed){if(this.failedSolvers.push(this.activeSubSolver),this.error=this.activeSubSolver.error,this.activeSubSolver=null,this.growthAttempts>=this.maxGrowthAttempts)return this.constructorParams.fallbackToInvalidGeometryOnFailure?(this.solvedRoutes=Csn(this.nodeWithPortPoints,this.constructorParams.traceWidth??0.15,this.constructorParams.viaDiameter??0.3),this.solved=!0,this.failed=!1,this.progress=1,this.stats={...this.stats,invalidGeometryFallback:!0,reason:"growth attempts exhausted",lastError:this.error},void(this.error=null)):(this.failed=!0,void(this.error=`GrowShrinkHighDensityIntraNodeSolver failed after resizing to ${this.scaleFactor}x. Last error: ${this.error}`));this.growthAttempts=Math.max(this.growthAttempts+1,this.minimumGrowthAttempts),this.scaleFactor=2**this.growthAttempts}}visualize(){let e=this.activeSubSolver?.visualize()??this.winningSolver?.visualize();return e||(this.solvedRoutes.length>0?{title:this.stats.invalidGeometryFallback?"Invalid same-layer crossing geometry":"Grow/shrink high density routes",lines:this.solvedRoutes.flatMap((t,n)=>t.route.slice(0,-1).map((o,r)=>({points:[o,t.route[r+1]],strokeColor:e3e[n%e3e.length],strokeWidth:t.traceThickness,layer:`z${o.z}`,label:rVt(t.connectionName,t.rootConnectionName,[`z${o.z}`,this.stats.invalidGeometryFallback?"invalid fallback route":void 0].filter(Boolean))}))),points:this.nodeWithPortPoints.portPoints.map((t)=>({x:t.x,y:t.y,color:e3e[Math.max(0,this.solvedRoutes.findIndex((n)=>n.connectionName===t.connectionName))%e3e.length],label:rVt(t.connectionName,t.rootConnectionName,[`z${t.z}`])})),rects:[{center:this.nodeWithPortPoints.center,width:this.nodeWithPortPoints.width,height:this.nodeWithPortPoints.height,fill:this.stats.invalidGeometryFallback?"rgba(245, 158, 11, 0.12)":"rgba(14, 165, 233, 0.08)",stroke:this.stats.invalidGeometryFallback?"rgba(217, 119, 6, 0.8)":"rgba(14, 165, 233, 0.55)",label:[this.nodeWithPortPoints.capacityMeshNodeId,this.stats.reason].filter(Boolean).join(`
`)}],circles:[]}:e??{lines:[],points:[],rects:[],circles:[]})}},iVt=(e,t,n=[])=>[e,t?`rootConnectionName: ${t}`:void 0,...n].filter(Boolean).join(`
`),PV=class extends Kr{getSolverName(){return"HighDensitySolver"}unsolvedNodePortPoints;routes;colorMap;defaultViaDiameter=0.3;defaultTraceThickness=0.15;viaDiameter;traceWidth;obstacleMargin;effort;obstacles;layerCount;useGrowShrinkHighDensityIntraNodeSolver;enableNegotiatedSearch;gridSearchSegmentWork;gridSearchWorkScale;rejectOverlappingTerminals;boardGeometry;preserveTerminalPcbPortIds;growShrinkMaxInnerIterationsPerGrowthAttempt;growShrinkFallbackToInvalidGeometryOnFailure;growShrinkSolutionValidator;captureSearchDebug;failedSolvers;activeSubSolver=null;connMap;nodePfById;nodeSolveMetadataById;constructor({nodePortPoints:e,colorMap:t,connMap:n,viaDiameter:o,traceWidth:r,obstacleMargin:i,effort:s,nodePfById:a,obstacles:c,layerCount:l,useGrowShrinkHighDensityIntraNodeSolver:h,enableNegotiatedSearch:d=!1,gridSearchSegmentWork:u=1e4,gridSearchWorkScale:_=1,rejectOverlappingTerminals:p=!1,boardGeometry:m,preserveTerminalPcbPortIds:A,growShrinkMaxInnerIterationsPerGrowthAttempt:g,growShrinkFallbackToInvalidGeometryOnFailure:f,growShrinkSolutionValidator:y,captureSearchDebug:x}){super(),this.unsolvedNodePortPoints=e,this.colorMap=t??{},this.connMap=n,this.routes=[],this.failedSolvers=[],this.effort=s??1,this.viaDiameter=o??this.defaultViaDiameter,this.traceWidth=r??this.defaultTraceThickness,this.obstacleMargin=i??0.15,this.obstacles=c??[],this.layerCount=l??2,this.enableNegotiatedSearch=d,this.gridSearchSegmentWork=u,this.gridSearchWorkScale=_,this.rejectOverlappingTerminals=p,this.boardGeometry=m,this.useGrowShrinkHighDensityIntraNodeSolver=h??!1,this.preserveTerminalPcbPortIds=A??!1,this.growShrinkMaxInnerIterationsPerGrowthAttempt=g,this.growShrinkFallbackToInvalidGeometryOnFailure=f??!1,this.growShrinkSolutionValidator=y,this.captureSearchDebug=x??!0,this.MAX_ITERATIONS=1e7*this.effort*(this.useGrowShrinkHighDensityIntraNodeSolver?4:1),this.nodePfById=a instanceof Map?new Map(a):new Map(Object.entries(a??{})),this.nodeSolveMetadataById=new Map,this.stats={solverNodeCount:{},difficultNodePfs:{},highDensityResizeCount:0}}getSolvedNodeSolverType(e){return e instanceof zWe&&e.winningSolver?this.getSolvedNodeSolverType(e.winningSolver):e instanceof dV&&e.winningSolver?this.getConcreteSolverTypeName(e.winningSolver):this.getConcreteSolverTypeName(e)}recordNodeSolveMetadata(e,t){let n=e.nodeWithPortPoints,o=this.nodePfById.get(n.capacityMeshNodeId)??null;this.nodeSolveMetadataById.set(n.capacityMeshNodeId,{node:n,status:t,solverType:this.getSolvedNodeSolverType(e),iterations:e.iterations,routeCount:e.solvedRoutes.length,nodePf:o,error:e.error??void 0})}createNodeMarkerLabel(e,t){return["hd_node_marker",`node: ${e}`,`status: ${t.status}`,`solver: ${t.solverType}`,`iterations: ${t.iterations}`,`routes: ${t.routeCount}`,`nodePf: ${t.nodePf??"n/a"}`,`portPoints: ${t.node.portPoints.length}`,...t.error?[`error: ${t.error}`]:[]].join(`
`)}getConcreteSolverTypeName(e){if(e instanceof b$e){let t=this.getIntraNodeStrategyName(e.hyperParameters);return e.cacheHit?`${t} [cached]`:t}return e instanceof Qbe?this.getIntraNodeStrategyName(e.hyperParameters):e.getSolverName()}getIntraNodeStrategyName(e){return e?.MULTI_HEAD_POLYLINE_SOLVER?"MultiHeadPolyLineIntraNodeSolver3":e?.SINGLE_LAYER_NO_DIFFERENT_ROOT_INTERSECTIONS?"SingleLayerNoDifferentRootIntersectionsIntraNodeSolver":e?.CLOSED_FORM_SINGLE_TRANSITION?"SingleTransitionIntraNodeSolver":e?.CLOSED_FORM_TWO_TRACE_SAME_LAYER?"TwoCrossingRoutesHighDensitySolver":e?.CLOSED_FORM_TWO_TRACE_TRANSITION_CROSSING?"SingleTransitionCrossingRouteSolver":e?.HIGH_DENSITY_A01?"HighDensitySolverA01":e?.HIGH_DENSITY_A03?"HighDensitySolverA03":"SingleHighDensityRouteSolver6_VertHorzLayer_FutureCost"}recordSolvedNodeStats(e,t){let n=this.getSolvedNodeSolverType(e),o=this.stats.solverNodeCount,r=this.stats.difficultNodePfs;o[n]=(o[n]??0)+1;let i=this.nodePfById.get(t.capacityMeshNodeId)??null;i!==null&&i>0.05&&(r[n]||(r[n]=[]),r[n].push(i))}recordResizeStats(e){e instanceof zWe&&(this.stats.highDensityResizeCount=(this.stats.highDensityResizeCount??0)+e.growthAttempts)}getSolvedRoutesWithTerminalPcbPortIds(e){let t=e.nodeWithPortPoints.portPoints.filter((o)=>o.pcb_port_id!==void 0);if(t.length===0)return e.solvedRoutes;let n=(o,r)=>{let i=t.filter((a)=>a.connectionName===o.connectionName&&a.x===r.x&&a.y===r.y&&a.z===r.z);if(i.length>1)throw Error(`HighDensitySolver found multiple PCB terminals at an endpoint of "${o.connectionName}"`);let s=i[0];if(s?.pcb_port_id)return s.pcb_port_id};return e.solvedRoutes.map((o)=>({...o,startPcbPortId:o.route[0]?n(o,o.route[0]):void 0,endPcbPortId:o.route.length>1?n(o,o.route[o.route.length-1]):void 0}))}_step(){if(this.updateCacheStats(),this.activeSubSolver)return this.activeSubSolver.step(),this.activeSubSolver.solved?(this.routes.push(...this.preserveTerminalPcbPortIds?this.getSolvedRoutesWithTerminalPcbPortIds(this.activeSubSolver):this.activeSubSolver.solvedRoutes),this.recordNodeSolveMetadata(this.activeSubSolver,"solved"),this.recordSolvedNodeStats(this.activeSubSolver,this.activeSubSolver.nodeWithPortPoints),this.recordResizeStats(this.activeSubSolver),this.activeSubSolver=null):this.activeSubSolver.failed&&(this.recordNodeSolveMetadata(this.activeSubSolver,"failed"),this.recordResizeStats(this.activeSubSolver),this.failedSolvers.push(this.activeSubSolver),this.activeSubSolver=null),void this.updateCacheStats();if(this.unsolvedNodePortPoints.length===0)return this.failedSolvers.length>0?(this.solved=!1,this.failed=!0,this.error=`Failed to solve ${this.failedSolvers.length} nodes, ${this.failedSolvers.slice(0,5).map((t)=>t.nodeWithPortPoints.capacityMeshNodeId)}. err0: ${this.failedSolvers[0].error}.`,void this.updateCacheStats()):(this.solved=!0,void this.updateCacheStats());let e={nodeWithPortPoints:this.unsolvedNodePortPoints.pop(),enableNegotiatedSearch:this.enableNegotiatedSearch,gridSearchSegmentWork:this.gridSearchSegmentWork,gridSearchWorkScale:this.gridSearchWorkScale,rejectOverlappingTerminals:this.rejectOverlappingTerminals,boardGeometry:this.boardGeometry,colorMap:this.colorMap,connMap:this.connMap,viaDiameter:this.viaDiameter,traceWidth:this.traceWidth,obstacleMargin:this.obstacleMargin,effort:this.effort,obstacles:this.obstacles,layerCount:this.layerCount,maxInnerIterationsPerGrowthAttempt:this.growShrinkMaxInnerIterationsPerGrowthAttempt,fallbackToInvalidGeometryOnFailure:this.growShrinkFallbackToInvalidGeometryOnFailure,growShrinkSolutionValidator:this.growShrinkSolutionValidator,captureSearchDebug:this.captureSearchDebug};this.activeSubSolver=this.useGrowShrinkHighDensityIntraNodeSolver?new zWe(e):new dV(e),this.updateCacheStats()}updateCacheStats(){let e=_9();this.stats.intraNodeCacheHits=e.cacheHits,this.stats.intraNodeCacheMisses=e.cacheMisses}visualize(){let e={lines:[],points:[],rects:[],circles:[]};for(let t of this.routes){let n=Rbe(t.route,t.connectionName,this.colorMap[t.connectionName]);for(let o of n)e.lines.push({points:o.points,label:iVt(t.connectionName,t.rootConnectionName),strokeColor:o.z===0?o.color:Qi(o.color,0.5),layer:`z${o.z}`,strokeWidth:t.traceThickness,strokeDash:o.z!==0?[0.1,0.3]:void 0});for(let o of t.vias)e.circles.push({center:o,layer:"z0,1",radius:t.viaDiameter/2,fill:this.colorMap[t.connectionName],label:iVt(t.connectionName,t.rootConnectionName,["via"])})}if(this.solved||this.failed)for(let[t,n]of this.nodeSolveMetadataById){let o=n.node.center.x-n.node.width/2,r=n.node.center.x+n.node.width/2,i=n.node.center.y-n.node.height/2,s=n.node.center.y+n.node.height/2,a=this.createNodeMarkerLabel(t,n),c=n.status==="solved"?"blue":"red";if(e.lines.push({points:[{x:o,y:i},{x:r,y:i}],layer:"hd_node_boundaries",strokeColor:c,strokeDash:"6, 4",strokeWidth:0.03,label:a},{points:[{x:r,y:i},{x:r,y:s}],layer:"hd_node_boundaries",strokeColor:c,strokeDash:"6, 4",strokeWidth:0.03,label:a},{points:[{x:r,y:s},{x:o,y:s}],layer:"hd_node_boundaries",strokeColor:c,strokeDash:"6, 4",strokeWidth:0.03,label:a},{points:[{x:o,y:s},{x:o,y:i}],layer:"hd_node_boundaries",strokeColor:c,strokeDash:"6, 4",strokeWidth:0.03,label:a}),n.status==="solved")e.points.push({x:n.node.center.x,y:n.node.center.y,color:c,layer:"hd_node_markers",label:a});else{e.lines.push({points:[{x:0,y:0},{x:n.node.center.x,y:n.node.center.y}],layer:"hd_failed_node_guides",strokeColor:"red",strokeDash:"8, 6",strokeWidth:0.05,label:a});let l=Math.max(0.1*n.node.width,0.12),h=Math.max(0.1*n.node.height,0.12);e.rects.push({center:n.node.center,layer:"hd_node_markers",width:l,height:h,fill:"red",label:a})}}return this.activeSubSolver&&(e=sl(e,this.activeSubSolver.visualize())),e}};function bsn(e,t){let n=[],o=t.filter((i)=>i._containsTarget),r=new Map;for(let i of e.connections){let s=[];for(let a of i.pointsToConnect){let c=t[0],l=Number.MAX_VALUE;for(let h of o){let d=Math.sqrt((h.center.x-a.x)**2+(h.center.y-a.y)**2);d<l&&(l=d,c=h)}s.push(c)}if(s.length<2)throw Error(`Not enough nodes for connection "${i.name}", only ${s.length} found`);r.set(i.name,s.map((a)=>a.capacityMeshNodeId)),n.push({connection:i,nodeIds:[s[0].capacityMeshNodeId,s[s.length-1].capacityMeshNodeId],straightLineDistance:Dn(s[0].center,s[s.length-1].center)})}return{unshuffledConnectionsWithResults:n,connectionNameToGoalNodeIds:r}}function Isn(e,t){let n=new Map(t.map((d)=>[d.capacityMeshNodeId,d])),o=t.map((d)=>(d.width+d.height)/2).filter((d)=>Number.isFinite(d)&&d>0),r=o.length>0?o.reduce((d,u)=>d+u,0)/o.length:1,i=t.filter((d)=>d._offBoardConnectionId),s=new Map,a=new Map,c=new Map;for(let d of t)a.set(d.capacityMeshNodeId,[]),c.set(d.capacityMeshNodeId,[]);for(let d of t)for(let u of d.portPoints){s.set(u.portPointId,u);for(let _ of u.connectionNodeIds){let p=a.get(_);p&&!p.some((m)=>m.portPointId===u.portPointId)&&p.push(u)}}let{unshuffledConnectionsWithResults:l,connectionNameToGoalNodeIds:h}=bsn(e,t);return{nodeMap:n,avgNodePitch:r,offBoardNodes:i,portPointMap:s,nodePortPointsMap:a,nodeAssignedPortPoints:c,unshuffledConnectionsWithResults:l,connectionNameToGoalNodeIds:h}}var dS=(e,t=1,n={})=>{let o=n.viaDiameter??0.3,r="width"in e?e.width:e,i=n.obstacleMargin??0.2,s="height"in e&&typeof e.height=="number"?e.height:r;if(!Number.isFinite(r)||!Number.isFinite(s))return 0;if(r<=0||s<=0)return 0;let a=Math.min(r,s)/(o+i),c=(Math.sqrt(r*s)*Math.min(1.2,Math.max(0.85,a**0.05))/(o/2+i)/2)**1.1*t;return Number.isFinite(c)?e.availableZ?.length===1&&c>1?1:c:0},MQ=(e,t=0.5,n=16)=>{let o=0,r=e;for(;o<n;){if(dS({width:r})<=t)break;r/=2,o++}return Math.max(1,o)},ly=(e,t,n,o)=>{if(e?._containsTarget)return 0;if((e.availableZ?.length??2)===1&&(t>0||n>0||o>0))return 1;let r=((0.82*t+0.41*n+0.2*o)/2)**1.1;if(!Number.isFinite(r))return 1;let i=dS(e);if(!Number.isFinite(i)||i<=0)return r>0?1:0;let s=r/i;if(Number.isNaN(s))throw Error("calculateNodeProbabilityOfFailure returned NaN");return Number.isFinite(s)?s:r>0?1:0};function vsn(e,t,n){let o=0,r=n?.NODE_MAX_PF??0.99999;for(let i of e){let s=t.get(i.capacityMeshNodeId);if(!s)continue;if(s._containsTarget)continue;let a=o_(i),c=Math.min(ly(s,a.numSameLayerCrossings,a.numEntryExitLayerChanges,a.numTransitionPairCrossings),r);o+=Math.log(1-c)}return o}function sVt(e,t){if(t._containsTarget)return 0;let n=o_(e);return ly(t,n.numSameLayerCrossings,n.numEntryExitLayerChanges,n.numTransitionPairCrossings)}function aVt(e,t,n,o,r){let i=n-t,s=r-o;if(Math.abs(e.y-r)<0.000001)return e.x-t;if(Math.abs(e.x-n)<0.000001)return i+(r-e.y);if(Math.abs(e.y-o)<0.000001)return i+s+(n-e.x);if(Math.abs(e.x-t)<0.000001)return 2*i+s+(e.y-o);let c=Math.abs(e.y-r),l=Math.abs(e.x-n),h=Math.abs(e.y-o),d=Math.abs(e.x-t),u=Math.min(c,l,h,d);return u===c?Math.max(0,Math.min(i,e.x-t)):u===l?i+Math.max(0,Math.min(s,r-e.y)):u===h?i+s+Math.max(0,Math.min(i,n-e.x)):2*i+s+Math.max(0,Math.min(s,e.y-o))}var Uyr=5.120000000000001,ale=(e,t)=>{let n=Math.ceil(t/2),o=Math.min(e.width,e.height),r=Math.max(e.width,e.height),i=(Math.floor(o/1.6)+0.1)*(Math.floor(r/3.2)+0.1)/Uyr;return Math.min(1,n/i)};function aKe(e,t,n,o){let r=t.x-n/2,i=t.x+n/2,s=t.y-o/2,a=t.y+o/2,c=Math.abs(e.y-a),l=Math.abs(e.x-i),h=Math.abs(e.y-s),d=Math.abs(e.x-r),u=Math.min(c,l,h,d);return u>0.001?"interior":u===c?"top":u===l?"right":u===h?"bottom":"left"}function cVt(e,t,n,o,r){let i=aKe(e,n,o,r),s=aKe(t,n,o,r);return i!=="interior"&&i===s}function lVt(e,t,n,o,r){let i=aKe(e,n,o,r),s;if(i==="top"||i==="bottom"){let l=o;s=Math.abs(t.x-e.x)/l}else{let l=r;s=Math.abs(t.y-e.y)/l}s=Math.min(1,Math.max(0,s));let a=(e.x+t.x)/2,c=(e.y+t.y)/2;return{x:a+(n.x-a)*s,y:c+(n.y-c)*s}}function t3e(e){return"computeNodePf"in e&&typeof e.computeNodePf=="function"}function cKe(e){let t={lines:[],points:[],rects:[],circles:[]};for(let o of e.inputNodes){let r=0,i=0,s={numSameLayerCrossings:0,numEntryExitLayerChanges:0,numTransitionPairCrossings:0},a=0;if(t3e(e)){r=e.computeNodePf(o),i=e.nodeMemoryPfMap.get(o.capacityMeshNodeId)??0;let d=e.buildNodeWithPortPointsForCrossing(o);s=o_(d);let u=new Set,_=e.nodeAssignedPortPoints.get(o.capacityMeshNodeId)??[];for(let p of _)p.connectionName&&u.add(p.connectionName);a=u.size}else{r=e.nodePfMap.get(o.capacityMeshNodeId)??0;let d=e.nodeAssignedPortPoints.get(o.capacityMeshNodeId)??[],u={capacityMeshNodeId:o.capacityMeshNodeId,center:o.center,width:o.width,height:o.height,portPoints:d,availableZ:o.availableZ};s=o_(u);let _=new Set;for(let p of d)p.connectionName&&_.add(p.connectionName);a=_.size}let c=Math.min(255,Math.floor(512*r)),l=Math.max(0,255-Math.floor(512*r)),h=`rgba(${c}, ${l}, ${l}, ${r<0.001?"0.1":"0.3"})`;o._containsObstacle&&(h="rgba(255, 0, 0, 0.3)"),o._offBoardConnectedCapacityMeshNodeIds?.length&&(h="rgba(255, 165, 0, 0.3)"),t.rects.push({center:o.center,width:o.width-0.2,height:o.height-0.2,layer:`z${o.availableZ.join(",")}`,fill:h,label:`${o.capacityMeshNodeId}
pf: ${r.toFixed(3)}, memPf: ${i.toFixed(3)}
C#: ${a}
xSame: ${s.numSameLayerCrossings}, xLC: ${s.numEntryExitLayerChanges}, xTransition: ${s.numTransitionPairCrossings}
obCmid: ${o._offBoardConnectedCapacityMeshNodeIds?.join(",")}
obs: ${o._containsObstacle?"yes":"no"}`})}if(t3e(e))for(let[o,r]of e.portPointMap){let i=e.assignedPortPoints.get(o),s=i?e.colorMap[i.connectionName]??"blue":"rgba(150, 150, 150, 0.5)";t.circles.push({center:{x:r.x,y:r.y},radius:0.05,fill:s,layer:`z${r.z}`,label:[o,`conn: ${i?.connectionName}`,`cd: ${r.distToCentermostPortOnZ}`,`connects: ${r.connectionNodeIds.join(",")}`,`rootConn: ${i?.rootConnectionName}`].filter(Boolean).join(`
`)})}let n=t3e(e)?e.connectionsWithResults:e.connectionResults;for(let o of n){if(!o.path)continue;let r=o.connection,i=e.colorMap[r.name]??"blue",s=[];for(let a of o.path)s.push({x:a.point.x,y:a.point.y,z:a.z,nodeId:a.currentNodeId});for(let a=0;a<s.length-1;a++){let c=s[a],l=s[a+1],h=c.z===l.z,d=c.z,u;u=h?d===0?void 0:"10 5":"3 3 10";let _=c.nodeId?e.nodeMap.get(c.nodeId):null;if(_&&cVt(c,l,_.center,_.width,_.height)){let p=lVt(c,l,_.center,_.width,_.height);t.lines.push({points:[{x:c.x,y:c.y},{x:p.x,y:p.y}],strokeColor:i,strokeDash:u}),t.lines.push({points:[{x:p.x,y:p.y},{x:l.x,y:l.y}],strokeColor:i,strokeDash:u})}else t.lines.push({points:[{x:c.x,y:c.y},{x:l.x,y:l.y}],strokeColor:i,strokeDash:u})}}if(t3e(e)&&!e.solved&&e.candidates&&e.candidates.length>0){let o=e.currentConnection,r=o?e.colorMap[o.connection.name]??"blue":"blue";if(o){let[s,a]=o.nodeIds,c=e.nodeMap.get(s),l=e.nodeMap.get(a),h=o.connection.pointsToConnect[0],d=o.connection.pointsToConnect[o.connection.pointsToConnect.length-1];if(c&&l){let u=h?{x:h.x,y:h.y}:c.center,_=d?{x:d.x,y:d.y}:l.center;t.lines.push({points:[u,_],strokeColor:Qi(r,0.5),strokeDash:"5 5"}),t.points.push({x:u.x,y:u.y,color:r,label:[`Start: ${o.connection.name}`,`${o.connection.__rootConnectionNames?.[0]}`].join(`
`)}),t.points.push({x:_.x,y:_.y,color:r,label:[`End: ${o.connection.name}`,`${o.connection.__rootConnectionNames?.[0]}`].join(`
`)}),t.circles.push({center:_,radius:0.08,stroke:r,label:`Goal: ${o.connection.name}`})}}let i=[...e.candidates].sort((s,a)=>s.f-a.f).slice(0,1);for(let s of i){let a=[],c=s;for(;c;)a.unshift({x:c.point.x,y:c.point.y,z:c.z,lastMoveWasOffBoard:c.lastMoveWasOffBoard,nodeId:c.currentNodeId}),c=c.prevCandidate;for(let l=0;l<a.length-1;l++){let h=a[l],d=a[l+1],u=h.z===d.z,_=h.z,p;p=d.lastMoveWasOffBoard?"2 2":u?_===0?void 0:"10 5":"3 3 10";let m=h.nodeId?e.nodeMap.get(h.nodeId):null,A=0.02*h.z;if(m&&cVt(h,d,m.center,m.width,m.height)){let g=lVt(h,d,m.center,m.width,m.height);t.lines.push({points:[{x:h.x+A,y:h.y+A},{x:g.x+A,y:g.y+A}],strokeColor:Qi(r,0.25),strokeDash:p}),t.lines.push({points:[{x:g.x+A,y:g.y+A},{x:d.x+A,y:d.y+A}],strokeColor:Qi(r,0.25),strokeDash:p})}else t.lines.push({points:[{x:h.x+A,y:h.y+A},{x:d.x+A,y:d.y+A}],strokeColor:Qi(r,0.25),strokeDash:p})}if(a.length>=1){let l=a[a.length-1],h=0,d=0,u=0,_=0,p=0,m=0,A=e.nodeMap.get(s.prevCandidate?.currentNodeId);if(A&&s.prevCandidate&&s.portPoint&&o){let P=o.connection.name,M={x:s.prevCandidate.point.x,y:s.prevCandidate.point.y,z:s.prevCandidate.z,connectionName:P},B={x:s.portPoint.x,y:s.portPoint.y,z:s.portPoint.z,connectionName:P},T=e.buildNodeWithPortPointsForCrossing(A,[M,B]),N=IXt(T);u=N.numSameLayerCrossings,_=N.numTransitionPairCrossings,p=N.numEntryExitLayerChanges;let D=e.capacityMeshNodeMap.get(A.capacityMeshNodeId);D&&(d=e.JUMPER_PF_FN_ENABLED&&A.availableZ.length===1?ale(D,u):ly(D,u,p,_),h=d**2*e.NODE_PF_FACTOR),m=s.prevCandidate.g>0?s.g-s.prevCandidate.g:s.g}if(!o)continue;let[g,f]=o.nodeIds,y=e.nodeMap.get(f),x=y?Math.sqrt((l.x-y.center.x)**2+(l.y-y.center.y)**2):0,C=e.avgNodePitch>0?x/e.avgNodePitch:0,b=C*e.BASE_CANDIDATE_COST,I=e.nodeMemoryPfMap.get(s.currentNodeId)??0,v=-Math.log(1-I)*e.MEMORY_PF_FACTOR;t.circles.push({center:l,radius:0.03,fill:Qi(r,0.25),layer:`z${s.z}`,label:[`f: ${s.f.toFixed(2)}`,`g: ${s.g.toFixed(2)} (nodeDelta: ${m.toFixed(2)})`,`h: ${s.h.toFixed(2)}`,`  dist: ${x.toFixed(2)}`,`  estHops: ${C.toFixed(1)}`,`  estStepCost: ${b.toFixed(2)}`,`  memRiskCost: ${v.toFixed(2)}`,`z: ${s.z}`,`node: ${s.currentNodeId}`,`Cost(Pf): ${h.toFixed(3)}`,`Pf: ${d.toFixed(3)}`,`xSame: ${u}, xTrans: ${_}, xLC: ${p}`,`routeOffBoard=${e.currentConnectionShouldRouteOffBoard}`,`offBoardTouched=${s.hasTouchedOffBoardNode??!1}`,`lastMoveWasOffBoard=${s.lastMoveWasOffBoard??!1}`].join(`
`)})}}}return t}function Ssn(e,t,n){let o=0,r=n?.NODE_MAX_PF??0.99999;for(let i of e){let s=t.get(i.capacityMeshNodeId);if(!s)continue;if(s._containsTarget)continue;let a=o_(i),c=Math.min(ale(s,a.numSameLayerCrossings),r);o+=Math.log(1-c)}return o}var Wyr=class extends Kr{constructor(e){super(),this.input=e;let{simpleRouteJson:t,capacityMeshNodes:n,inputNodes:o,colorMap:r,nodeMemoryPfMap:i,hyperParameters:s,precomputedInitialParams:a,fixedRoutes:c}=e;if(this.input=structuredClone(e),this.MAX_ITERATIONS=1e8,this.simpleRouteJson=t,this.inputNodes=o,this.colorMap=r??{},this.capacityMeshNodeMap=new Map(n.map((l)=>[l.capacityMeshNodeId,l])),this.nodeMemoryPfMap=i??new Map,this.hyperParameters=s??{},a){this.nodeMap=a.nodeMap,this.avgNodePitch=a.avgNodePitch,this.offBoardNodes=a.offBoardNodes,this.portPointMap=a.portPointMap,this.nodePortPointsMap=a.nodePortPointsMap,this.connectionNameToGoalNodeIds=a.connectionNameToGoalNodeIds;let{nodeAssignedPortPoints:l}=function(h){let d=new Map;for(let[u,_]of h.nodeAssignedPortPoints)d.set(u,[..._]);return{nodeAssignedPortPoints:d}}(a);this.nodeAssignedPortPoints=l,this.connectionsWithResults=db(structuredClone(a.unshuffledConnectionsWithResults),this.hyperParameters.SHUFFLE_SEED??0)}else{this.nodeMap=new Map(o.map((u)=>[u.capacityMeshNodeId,u]));let l=o.map((u)=>(u.width+u.height)/2).filter((u)=>Number.isFinite(u)&&u>0);this.avgNodePitch=l.length>0?l.reduce((u,_)=>u+_,0)/l.length:1,this.offBoardNodes=o.filter((u)=>u._offBoardConnectionId),this.portPointMap=new Map,this.nodePortPointsMap=new Map;for(let u of o)this.nodePortPointsMap.set(u.capacityMeshNodeId,[]),this.nodeAssignedPortPoints.set(u.capacityMeshNodeId,[]);for(let u of o)for(let _ of u.portPoints){this.portPointMap.set(_.portPointId,_);for(let p of _.connectionNodeIds){let m=this.nodePortPointsMap.get(p);m&&!m.some((A)=>A.portPointId===_.portPointId)&&m.push(_)}}let{connectionsWithResults:h,connectionNameToGoalNodeIds:d}=this.getConnectionsWithNodes();this.connectionsWithResults=h,this.connectionNameToGoalNodeIds=d}if(c&&c.length>0){for(let l of c)if(this.connectionsWithResults.push(l),l.portPoints)for(let h of l.portPoints)h.portPointId&&this.assignedPortPoints.set(h.portPointId,{connectionName:h.connectionName,rootConnectionName:h.rootConnectionName})}for(let l of this.connectionsWithResults)l.path?this.processedConnectionQueue.push(l):this.unprocessedConnectionQueue.push(l);this.totalConnectionCount=this.connectionsWithResults.length}input;getSolverName(){return"PortPointPathingSolver"}hyperParameters;simpleRouteJson;inputNodes;nodeMap;nodePortPointsMap;portPointMap;connectionsWithResults=[];failedConnection=null;assignedPortPoints=new Map;nodeAssignedPortPoints=new Map;PORT_POINT_REUSE_FACTOR=1000;BASE_COST_FOR_NOT_GOING_OFF_BOARD=100;get NODE_PF_FACTOR(){return this.hyperParameters.NODE_PF_FACTOR??50}get RANDOM_WALK_DISTANCE(){return this.hyperParameters.RANDOM_WALK_DISTANCE??0}get MEMORY_PF_FACTOR(){return this.hyperParameters.MEMORY_PF_FACTOR??0}get CENTER_OFFSET_FOCUS_SHIFT(){return this.hyperParameters.CENTER_OFFSET_FOCUS_SHIFT??0}get RANDOM_COST_MAGNITUDE(){return this.hyperParameters.RANDOM_COST_MAGNITUDE??0}get BASE_CANDIDATE_COST(){return this.hyperParameters.BASE_CANDIDATE_COST??0}get NODE_PF_MAX_PENALTY(){return this.hyperParameters.NODE_PF_MAX_PENALTY??1e4}get FORCE_CENTER_FIRST(){return this.hyperParameters.FORCE_CENTER_FIRST??!0}get FORCE_OFF_BOARD_FREQUENCY(){return this.offBoardNodes.length===0?0:this.hyperParameters.FORCE_OFF_BOARD_FREQUENCY??0}get FORCE_OFF_BOARD_SEED(){return this.hyperParameters.FORCE_OFF_BOARD_SEED??0}get NODE_MAX_PF(){return Math.min(0.99999,1-Math.exp(-this.NODE_PF_MAX_PENALTY))}get CENTER_OFFSET_DIST_PENALTY_FACTOR(){return this.hyperParameters.CENTER_OFFSET_DIST_PENALTY_FACTOR??0}get STRAIGHT_LINE_DEVIATION_PENALTY_FACTOR(){return this.hyperParameters.STRAIGHT_LINE_DEVIATION_PENALTY_FACTOR??0}colorMap;get GREEDY_MULTIPLIER(){return this.hyperParameters.GREEDY_MULTIPLIER??1.3}MAX_CANDIDATES_IN_MEMORY=5000;get MAX_ITERATIONS_PER_PATH(){return this.hyperParameters.MAX_ITERATIONS_PER_PATH??1e4}ITERATIONS_PER_MM_FOR_PATH=30;BASE_ITERATIONS_PER_PATH=1e4;get RIPPING_ENABLED(){return this.hyperParameters.RIPPING_ENABLED??!1}get RIPPING_PF_THRESHOLD(){let e=this.hyperParameters.START_RIPPING_PF_THRESHOLD,t=this.hyperParameters.END_RIPPING_PF_THRESHOLD;if(e!==void 0&&t!==void 0){let n=this.MAX_RIPS;return e+(n>0?this.totalRipCount/n:0)*(t-e)}return this.hyperParameters.RIPPING_PF_THRESHOLD??0.3}get MAX_RIPS(){return this.hyperParameters.MAX_RIPS??100}get RANDOM_RIP_FRACTION(){return this.hyperParameters.RANDOM_RIP_FRACTION??0}get JUMPER_PF_FN_ENABLED(){return this.hyperParameters.JUMPER_PF_FN_ENABLED??!1}jumpersPerMmSquared=0.1;testedRipConnections=new Map;totalRipCount=0;get MIN_ALLOWED_BOARD_SCORE(){return this.hyperParameters.MIN_ALLOWED_BOARD_SCORE??-1e4}nodeMemoryPfMap;unprocessedConnectionQueue=[];processedConnectionQueue=[];currentConnection=null;totalConnectionCount=0;currentPathIterations=0;candidates;visitedPortPoints;connectionNameToGoalNodeIds;capacityMeshNodeMap;avgNodePitch;currentConnectionShouldRouteOffBoard=!1;activeCandidateStraightLineDistance;offBoardNodes=[];baseNodeCostCache=new Map;getConstructorParams(){return this.input}clearCostCaches(){this.baseNodeCostCache.clear()}clampPf(e){return Number.isFinite(e)?Math.min(Math.max(e,0),0.999999):0.999999}pfToFailureCost(e){let t=this.clampPf(e);return t>=this.NODE_MAX_PF?this.NODE_PF_MAX_PENALTY:-Math.log(1-t)}getBaseNodeFailureCost(e){let t=this.baseNodeCostCache.get(e);if(t!=null)return t;let n=this.nodeMap.get(e);if(!n)return 0;let o=this.computeNodePf(n),r=this.pfToFailureCost(o);return this.baseNodeCostCache.set(e,r),r}computeBoardScore(){let e=this.getNodesWithPortPoints();return this.JUMPER_PF_FN_ENABLED?Ssn(e,this.capacityMeshNodeMap):vsn(e,this.capacityMeshNodeMap)}getMaxIterationsForCurrentPath(){let e=this.activeCandidateStraightLineDistance??0;return Math.min(this.BASE_ITERATIONS_PER_PATH+this.ITERATIONS_PER_MM_FOR_PATH*e,this.MAX_ITERATIONS_PER_PATH)}getNodeDeltaFailureCostForSegment(e,t,n){let o=this.nodeMap.get(e);if(!o)return 0;let r=this.getBaseNodeFailureCost(e),i=this.computeNodePf(o,[t,n]),s=this.pfToFailureCost(i),a=Math.max(0,s-r);return i>=this.NODE_MAX_PF?this.NODE_PF_MAX_PENALTY:a*this.NODE_PF_FACTOR}getConnectionsWithNodes(){let{unshuffledConnectionsWithResults:e,connectionNameToGoalNodeIds:t}=bsn(this.simpleRouteJson,this.inputNodes);return{connectionsWithResults:db(e,this.hyperParameters.SHUFFLE_SEED??0),connectionNameToGoalNodeIds:t}}buildNodeWithPortPointsForCrossing(e,t){let n=this.nodeAssignedPortPoints.get(e.capacityMeshNodeId)??[],o=t?[...n,...t]:n;return{capacityMeshNodeId:e.capacityMeshNodeId,center:e.center,width:e.width,height:e.height,portPoints:o,availableZ:e.availableZ}}computeNodePf(e,t){if(e._containsTarget)return 0;let n=this.buildNodeWithPortPointsForCrossing(e,t),o=o_(n);return this.JUMPER_PF_FN_ENABLED&&e.availableZ.length===1?ale(this.capacityMeshNodeMap.get(e.capacityMeshNodeId),o.numSameLayerCrossings):ly(this.capacityMeshNodeMap.get(e.capacityMeshNodeId),o.numSameLayerCrossings,o.numEntryExitLayerChanges,o.numTransitionPairCrossings)}getPortPointReusePenalty(e,t){let n=this.assignedPortPoints.get(e);return n?t===n.rootConnectionName?0:this.PORT_POINT_REUSE_FACTOR:0}getOtherNodeId(e,t){let[n,o]=e.connectionNodeIds;return n===t?o:o===t?n:null}computeG(e,t,n,o,r){let{currentNodeId:i,point:s}=e,a={x:s.x,y:s.y,z:e.z,connectionName:o,rootConnectionName:r},c={x:t.x,y:t.y,z:t.z,connectionName:o,rootConnectionName:r},l=this.getNodeDeltaFailureCostForSegment(i,a,c);return e.g+l}computeGToEndTarget(e,t,n,o){let r=e.currentNodeId,i={x:e.point.x,y:e.point.y,z:e.z,connectionName:n,rootConnectionName:o},s={x:t.x,y:t.y,z:e.z,connectionName:n,rootConnectionName:o},a=this.getNodeDeltaFailureCostForSegment(r,i,s);return e.g+a}computeDistanceToNearestOffBoardNode(e){if(this.offBoardNodes.length===0)return 1/0;let t=1/0;for(let n of this.offBoardNodes){let o=Dn(e,n.center);o<t&&(t=o)}return t}computeH(e,t,n,o,r,i){if(this.RANDOM_WALK_DISTANCE>0&&r<this.RANDOM_WALK_DISTANCE)return 0;if(this.currentConnectionShouldRouteOffBoard&&!i)return this.BASE_COST_FOR_NOT_GOING_OFF_BOARD+this.computeDistanceToNearestOffBoardNode(e);let s=this.nodeMap.get(n);if(!s)return 0;let a=Dn(e,s.center),c=this.avgNodePitch>0?a/this.avgNodePitch:0,l=this.clampPf(this.nodeMemoryPfMap.get(t)??0),h=this.pfToFailureCost(l)*this.MEMORY_PF_FACTOR,d=c*this.BASE_CANDIDATE_COST,u=this.CENTER_OFFSET_DIST_PENALTY_FACTOR*e.distToCentermostPortOnZ**2,_=0;if(this.STRAIGHT_LINE_DEVIATION_PENALTY_FACTOR>0&&this.currentConnection){let p=oc(e,this.currentConnection.connection.pointsToConnect[0],this.currentConnection.connection.pointsToConnect[1]);_=this.STRAIGHT_LINE_DEVIATION_PENALTY_FACTOR*p}return a+d+h+u+_}getVisitedPortPointKey(e,t){return this.currentConnectionShouldRouteOffBoard&&t?`${e}:touched_off_board`:e}getAvailableExitPortPoints(e,t){let n=this.currentConnection?.connection.__rootConnectionNames?.[0],o=this.nodePortPointsMap.get(e)??[],r=[];for(let i of o){let s=this.getVisitedPortPointKey(i.portPointId,t);if(this.visitedPortPoints?.has(s))continue;let a=this.assignedPortPoints.get(i.portPointId);a&&a?.rootConnectionName!==n||r.push(i)}return r}getAvailableExitPortPointsWithOmissions(e,t,n){let o=this.nodePortPointsMap.get(e)??[],r=this.currentConnection?.connection.__rootConnectionNames?.[0],i=new Map;for(let a of o){let c=this.getVisitedPortPointKey(a.portPointId,n);if(this.visitedPortPoints?.has(c))continue;let l=this.getOtherNodeId(a,e);if(!l)continue;this.nodeMap.get(l);let h=`${l}|${a.z}`,d=i.get(h)??[];d.push(a),i.set(h,d)}let s=[];for(let[,a]of i){a.sort((p,m)=>p.distToCentermostPortOnZ-m.distToCentermostPortOnZ);let c=a[0];if(!c)continue;let l=this.assignedPortPoints.get(c.portPointId),h=l&&l.rootConnectionName===r;if(!l||h){s.push(c);continue}let d=[...a].sort((p,m)=>p.x!==m.x?p.x-m.x:p.y-m.y),u=[],_=[];for(let p of d){let m=this.assignedPortPoints.get(p.portPointId);!m||m.rootConnectionName===r?_.push(p):_.length>0&&(u.push(_),_=[])}_.length>0&&u.push(_);for(let p of u){let m=Math.floor(p.length/2);s.push(p[m])}}return s}getAvailableExitPortPointsForOffboardConnection(e,t){let n=this.nodeMap.get(e);if(!n)return[];let o=this.currentConnection?.connection.__rootConnectionNames?.[0],r=[];for(let i of n?._offBoardConnectedCapacityMeshNodeIds??[]){if(i===e)continue;if(!this.nodeMap.get(i))continue;let s=this.nodePortPointsMap.get(i)??[];for(let a of s){let c=this.getVisitedPortPointKey(a.portPointId,t);if(this.visitedPortPoints?.has(c))continue;let l=this.assignedPortPoints.get(a.portPointId);l&&l.rootConnectionName!==o||r.push({...a,throughNodeId:i})}}return r}canTravelThroughObstacle(e,t,n){return this.connectionNameToGoalNodeIds.get(t)?.includes(e.capacityMeshNodeId)||Boolean(e._offBoardConnectionId)}isAtEndGoal(e,t){return e===t}getBacktrackedPath(e){let t=[],n=e;for(;n;){if(n.lastMoveWasOffBoard&&n.throughNodeId){let o=this.nodeMap.get(n.throughNodeId),r=n.prevCandidate?this.nodeMap.get(n.prevCandidate.currentNodeId):null;t.push(n),o&&t.push({prevCandidate:null,portPoint:null,currentNodeId:n.throughNodeId,point:o.center,z:n.z,f:0,g:0,h:0,distanceTraveled:0}),r&&r._offBoardConnectionId&&t.push({prevCandidate:null,portPoint:null,currentNodeId:n.prevCandidate.currentNodeId,point:r.center,z:n.z,f:0,g:0,h:0,distanceTraveled:0})}else t.push(n);n=n.prevCandidate}return t.reverse()}assignPortPointsForPath(e,t,n){let o=[];for(let a=0;a<e.length;a++){let c=e[a];if(!c.portPoint){let d=a===0,u=a===e.length-1;if(!d&&!u){let _={x:c.point.x,y:c.point.y,z:c.z,connectionName:t,rootConnectionName:n};o.push(_);let p=this.nodeAssignedPortPoints.get(c.currentNodeId)??[];p.push(_),this.nodeAssignedPortPoints.set(c.currentNodeId,p)}continue}let l=c.portPoint;this.assignedPortPoints.set(l.portPointId,{connectionName:t,rootConnectionName:n});let h={portPointId:l.portPointId,x:l.x,y:l.y,z:l.z,connectionName:t,rootConnectionName:n,prevPortPointId:l.prevPortPointId,nextPortPointId:l.nextPortPointId};o.push(h);for(let d of l.connectionNodeIds){let u=this.nodeAssignedPortPoints.get(d)??[];u.push(h),this.nodeAssignedPortPoints.set(d,u)}}let r=o.map((a)=>a.portPointId).filter((a)=>Boolean(a)),i=0;for(let a of o)a.portPointId&&(a.prevPortPointId=r[i-1],a.nextPortPointId=r[i+1],i+=1);let s=Array.from(new Set(e.map((a)=>a.currentNodeId)));for(let a of s){let c=this.nodeMap.get(a);if(c&&c._offBoardConnectionId)for(let l of c?._offBoardConnectedCapacityMeshNodeIds??[]){let h=this.nodePortPointsMap.get(l)??[];for(let d of h)this.assignedPortPoints.set(d.portPointId,{connectionName:t,rootConnectionName:n})}}return o}addTargetPointsToNodes(e,t){let n=e[0],o=e[e.length-1],r=t.pointsToConnect[0],i=t.pointsToConnect[t.pointsToConnect.length-1];if(n&&r){let s=this.nodeAssignedPortPoints.get(n.currentNodeId)??[];s.push({x:r.x,y:r.y,z:n.z,connectionName:t.name,rootConnectionName:t.__rootConnectionNames?.[0]}),this.nodeAssignedPortPoints.set(n.currentNodeId,s)}if(o&&i){let s=this.nodeAssignedPortPoints.get(o.currentNodeId)??[];s.push({x:i.x,y:i.y,z:o.z,connectionName:t.name,rootConnectionName:t.__rootConnectionNames?.[0]}),this.nodeAssignedPortPoints.set(o.currentNodeId,s)}}isPortPointInPathChain(e,t){let n=e;for(;n;){if(n.portPoint?.portPointId===t)return!0;n=n.prevCandidate}return!1}isNodeInPathChain(e,t){let n=e;for(;n;){if(n.currentNodeId===t)return!0;n=n.prevCandidate}return!1}_step(){if(this.currentConnection||(this.currentConnection=this.unprocessedConnectionQueue.shift()??null),!this.currentConnection){let u=this.computeBoardScore();return this.stats={boardScore:u,totalRipCount:this.totalRipCount},u<this.MIN_ALLOWED_BOARD_SCORE?(this.failedConnection=null,this.failed=!0,void(this.error=`Board score ${u.toFixed(2)} is less than MIN_ALLOWED_BOARD_SCORE ${this.MIN_ALLOWED_BOARD_SCORE.toFixed(2)}`)):void(this.solved=!0)}let e=this.currentConnection;this.activeCandidateStraightLineDistance=e.straightLineDistance,this.currentPathIterations++;let t=this.getMaxIterationsForCurrentPath();if(this.currentPathIterations>t)return this.failedConnection=e,this.processedConnectionQueue.push(e),this.currentConnection=null,this.candidates=null,this.visitedPortPoints=null,this.currentPathIterations=0,this.failed=!0,void(this.error=`Exceeded max iterations for path (${t}) on connection ${e.connection.name}`);let[n,o]=e.nodeIds,r=this.nodeMap.get(n),i=this.nodeMap.get(o);if(!r||!i)return this.processedConnectionQueue.push(e),this.currentConnection=null,void(this.currentPathIterations=0);let s=e.connection.name,a=e.connection.__rootConnectionNames?.[0],c=e.connection.pointsToConnect[0];if(!this.candidates){if(this.clearCostCaches(),this.FORCE_OFF_BOARD_FREQUENCY>0){let u=C$e(17*(this.hyperParameters.SHUFFLE_SEED??0)+this.FORCE_OFF_BOARD_SEED+this.processedConnectionQueue.length);this.currentConnectionShouldRouteOffBoard=u()<this.FORCE_OFF_BOARD_FREQUENCY}else this.currentConnectionShouldRouteOffBoard=!1;this.candidates=[],this.visitedPortPoints=new Set;for(let u of r.availableZ){let _=c?{x:c.x,y:c.y}:r.center,p={portPointId:`start:${n}:${u}`,x:_.x,y:_.y,z:u,connectionNodeIds:[n,n],distToCentermostPortOnZ:0},m=this.computeH(p,n,o,u,0,!1),A=0+m*this.GREEDY_MULTIPLIER;this.candidates.push({prevCandidate:null,portPoint:null,currentNodeId:n,point:_,z:u,f:A,g:0,h:m,distanceTraveled:0,hasTouchedOffBoardNode:!1})}}this.candidates.sort((u,_)=>u.f-_.f);let l,h=this.candidates.shift();for(;h?.portPoint&&this.visitedPortPoints;){let u=this.getVisitedPortPointKey(h.portPoint.portPointId,h.hasTouchedOffBoardNode);if(!this.visitedPortPoints.has(u))break;h=this.candidates.shift()}if(this.candidates.length>this.MAX_CANDIDATES_IN_MEMORY&&this.candidates.splice(this.MAX_CANDIDATES_IN_MEMORY,this.candidates.length-this.MAX_CANDIDATES_IN_MEMORY),!h)return this.error=`Ran out of candidates on connection ${s}`,this.failedConnection=e,this.processedConnectionQueue.push(e),this.currentConnection=null,this.candidates=null,this.visitedPortPoints=null,this.currentPathIterations=0,void(this.failed=!0);if(h.portPoint&&this.visitedPortPoints){let u=this.getVisitedPortPointKey(h.portPoint.portPointId,h.hasTouchedOffBoardNode);this.visitedPortPoints.add(u)}if(this.isAtEndGoal(h.currentNodeId,o)){let u=e.connection.pointsToConnect[e.connection.pointsToConnect.length-1],_=u?{x:u.x,y:u.y}:i.center,p=this.computeGToEndTarget(h,_,s,a),m={prevCandidate:h,portPoint:null,currentNodeId:o,point:_,z:h.z,g:p,h:0,f:p,distanceTraveled:h.distanceTraveled+Dn(h.point,_)},A=this.getBacktrackedPath(m);return e.path=A,e.portPoints=this.assignPortPointsForPath(A,s,a),this.addTargetPointsToNodes(A,e.connection),this.clearCostCaches(),this.RIPPING_ENABLED&&this.processRippingForPath(A,s),this.processedConnectionQueue.push(e),this.currentConnection=null,this.progress=this.processedConnectionQueue.length/this.totalConnectionCount,this.candidates=null,this.visitedPortPoints=null,void(this.currentPathIterations=0)}let d=this.nodeMap.get(h.currentNodeId);l=d?._offBoardConnectionId?this.getAvailableExitPortPointsForOffboardConnection(h.currentNodeId,h.hasTouchedOffBoardNode):this.FORCE_CENTER_FIRST?this.getAvailableExitPortPointsWithOmissions(h.currentNodeId,o,h.hasTouchedOffBoardNode):this.getAvailableExitPortPoints(h.currentNodeId,h.hasTouchedOffBoardNode);for(let u of l){if(this.isPortPointInPathChain(h,u.portPointId))continue;if(this.visitedPortPoints?.has(u.portPointId))continue;let _=this.getOtherNodeId(u,u.throughNodeId??h.currentNodeId);if(!_)continue;if(this.isNodeInPathChain(h,_))continue;let p="throughNodeId"in u?u.throughNodeId:void 0,m=p?this.nodeMap.get(p):null,A=this.nodeMap.get(_);if(!A)continue;if(A._containsObstacle&&!this.canTravelThroughObstacle(A,s,a))continue;let g=this.computeG(h,u,_,s,a);if(!this.RIPPING_ENABLED&&g>-this.MIN_ALLOWED_BOARD_SCORE)continue;let f=h.distanceTraveled+Dn(h.point,u),y=h.hasTouchedOffBoardNode||Boolean(A._offBoardConnectionId),x=this.computeH(u,_,o,u.z,f,y),C=g+x*this.GREEDY_MULTIPLIER,b=Boolean(d?._offBoardConnectionId)&&Boolean(m?._offBoardConnectionId);this.candidates.push({prevCandidate:h,portPoint:u,currentNodeId:_,point:{x:u.x,y:u.y},z:u.z,f:C,g,h:x,distanceTraveled:f,lastMoveWasOffBoard:b,throughNodeId:b?p:void 0,hasTouchedOffBoardNode:y||Boolean(A._offBoardConnectionId)||Boolean(d?._offBoardConnectionId)})}}getNodesWithPortPoints(){let e=[];for(let t of this.inputNodes){let n=this.nodeAssignedPortPoints.get(t.capacityMeshNodeId)??[];n.length>0&&e.push({capacityMeshNodeId:t.capacityMeshNodeId,center:t.center,width:t.width,height:t.height,portPoints:n,availableZ:t.availableZ})}return e}getConnectionsInNode(e,t){let n=[],o=new Set;for(let r of this.connectionsWithResults)if(r.path&&r.connection.name!==t&&!o.has(r.connection.name)){for(let i of r.path)if(i.currentNodeId===e){n.push(r),o.add(r.connection.name);break}}return n}computeNodePfWithoutConnection(e,t){if(e._containsTarget)return{pf:0,totalCrossings:0};let n=(this.nodeAssignedPortPoints.get(e.capacityMeshNodeId)??[]).filter((s)=>s.connectionName!==t),o={capacityMeshNodeId:e.capacityMeshNodeId,center:e.center,width:e.width,height:e.height,portPoints:n,availableZ:e.availableZ},r=o_(o),i=r.numSameLayerCrossings+r.numEntryExitLayerChanges+r.numTransitionPairCrossings;return{pf:ly(this.capacityMeshNodeMap.get(e.capacityMeshNodeId),r.numSameLayerCrossings,r.numEntryExitLayerChanges,r.numTransitionPairCrossings),totalCrossings:i}}computeNodeCrossings(e){if(e._containsTarget)return 0;let t=this.buildNodeWithPortPointsForCrossing(e),n=o_(t);return n.numSameLayerCrossings+n.numEntryExitLayerChanges+n.numTransitionPairCrossings}ripConnection(e){let t=e.connection.name;for(let[n,o]of this.assignedPortPoints.entries())o.connectionName===t&&this.assignedPortPoints.delete(n);for(let[n,o]of this.nodeAssignedPortPoints.entries()){let r=o.filter((i)=>i.connectionName!==t);this.nodeAssignedPortPoints.set(n,r)}e.path=void 0,e.portPoints=void 0}requeueConnection(e){this.totalRipCount++;let t=this.processedConnectionQueue.indexOf(e);if(t!==-1)return this.processedConnectionQueue.splice(t,1),this.unprocessedConnectionQueue.push(e),!0;let n=this.unprocessedConnectionQueue.indexOf(e);return n!==-1&&(this.unprocessedConnectionQueue.splice(n,1),this.unprocessedConnectionQueue.unshift(e)),!0}processRippingForPath(e,t){let n=Array.from(new Set(e.map((r)=>r.currentNodeId))),o=!1;for(let r of n){if(this.totalRipCount>this.MAX_RIPS)break;let i=this.nodeMap.get(r);if(!i)continue;let s=this.computeNodePf(i);if(s<=this.RIPPING_PF_THRESHOLD)continue;this.testedRipConnections.has(r)||this.testedRipConnections.set(r,new Set);let a=this.testedRipConnections.get(r),c=db(this.getConnectionsInNode(r,t),(this.hyperParameters.SHUFFLE_SEED??0)+this.processedConnectionQueue.length);for(let l of c){if(s<=this.RIPPING_PF_THRESHOLD)break;let h=l.connection.name;a.add(h);let{pf:d}=this.computeNodePfWithoutConnection(i,h);if(this.ripConnection(l),!this.requeueConnection(l))return;s=d,o=!0,this.clearCostCaches()}}o&&this.RANDOM_RIP_FRACTION>0&&this.processRandomRipping(t)}processRandomRipping(e){let t=this.processedConnectionQueue.filter((r)=>r.path!==void 0&&r.connection.name!==e);if(t.length===0)return;let n=Math.max(1,Math.floor(this.RANDOM_RIP_FRACTION*t.length)),o=db(t,(this.hyperParameters.SHUFFLE_SEED??0)+this.totalRipCount+this.processedConnectionQueue.length);for(let r=0;r<n&&r<o.length&&!(this.totalRipCount>this.MAX_RIPS);r++){let i=o[r];if(this.ripConnection(i),!this.requeueConnection(i))return;this.clearCostCaches()}}visualize(){let e={};if(this.failed){let t=this.failedConnection?.connection.pointsToConnect[0],n=this.failedConnection?.connection.pointsToConnect[1];t&&n&&(e={lines:[{points:[t,n],label:`Failed Connection ${this.failedConnection?.connection.name}`,strokeWidth:1,strokeColor:"red",strokeDash:[2,2]}]})}return TO(cKe(this),e)}},VJe=class extends kbe{getSolverName(){return"HyperPortPointPathingSolver"}params;precomputedInitialParams;constructor(e){super(),this.params=e,this.MAX_ITERATIONS=1e8,this.GREEDY_MULTIPLIER=1.2,this.MIN_SUBSTEPS=50,this.precomputedInitialParams=e.precomputedInitialParams??Isn(e.simpleRouteJson,e.inputNodes)}getHyperParameterDefs(){let e=this.params.numShuffleSeeds??50;return[{name:"SHUFFLE_SEED",possibleValues:Array.from({length:e},(t,n)=>({SHUFFLE_SEED:n+1700*(this.params.hyperParameters?.SHUFFLE_SEED??0)}))}]}getCombinationDefs(){return[["SHUFFLE_SEED"]]}generateSolver(e){return new Wyr({simpleRouteJson:this.params.simpleRouteJson,capacityMeshNodes:this.params.capacityMeshNodes,inputNodes:this.params.inputNodes,colorMap:this.params.colorMap,nodeMemoryPfMap:this.params.nodeMemoryPfMap,hyperParameters:{...this.params.hyperParameters,...e,MIN_ALLOWED_BOARD_SCORE:this.params.minAllowedBoardScore??e.MIN_ALLOWED_BOARD_SCORE??this.params.hyperParameters?.MIN_ALLOWED_BOARD_SCORE},precomputedInitialParams:this.precomputedInitialParams,fixedRoutes:this.params.fixedRoutes})}computeG(e){return-e.computeBoardScore()}computeH(e){let t=e.progress||0;if(t<0.1)return 0;return-(e.computeBoardScore()/t)*(1-t)}getNodesWithPortPoints(){if(this.winningSolver)return this.winningSolver.getNodesWithPortPoints();let e=this.getSupervisedSolverWithBestFitness();return e?e.solver.getNodesWithPortPoints():[]}get connectionsWithResults(){if(this.winningSolver)return this.winningSolver.connectionsWithResults;let e=this.getSupervisedSolverWithBestFitness();return e?e.solver.connectionsWithResults:[]}get inputNodes(){if(this.winningSolver)return this.winningSolver.inputNodes;let e=this.getSupervisedSolverWithBestFitness();return e?e.solver.inputNodes:this.params.inputNodes}get nodeMap(){if(this.winningSolver)return this.winningSolver.nodeMap;let e=this.getSupervisedSolverWithBestFitness();return e?e.solver.nodeMap:new Map(this.params.inputNodes.map((t)=>[t.capacityMeshNodeId,t]))}get assignedPortPoints(){if(this.winningSolver)return this.winningSolver.assignedPortPoints;let e=this.getSupervisedSolverWithBestFitness();return e?e.solver.assignedPortPoints:new Map}get nodeAssignedPortPoints(){if(this.winningSolver)return this.winningSolver.nodeAssignedPortPoints;let e=this.getSupervisedSolverWithBestFitness();return e?e.solver.nodeAssignedPortPoints:new Map}computeNodePf(e){if(this.winningSolver)return this.winningSolver.computeNodePf(e);let t=this.getSupervisedSolverWithBestFitness();return t?t.solver.computeNodePf(e):null}computeBoardScore(){if(this.winningSolver)return this.winningSolver.computeBoardScore();let e=this.getSupervisedSolverWithBestFitness();return e?e.solver.computeBoardScore():0}onSolve(e){this.stats={...e.solver.stats,winningHyperParameters:this.winningSolver?.hyperParameters}}visualize(){return this.winningSolver?this.winningSolver.visualize():super.visualize()}};function hVt(e){let t=e;return()=>{t+=1831565813;let n=t;return n=Math.imul(n^n>>>15,1|n),n^=n+Math.imul(n^n>>>7,61|n),((n^n>>>14)>>>0)/4294967296}}var Xyr=[{SHUFFLE_SEED:100,NODE_PF_FACTOR:100,NODE_PF_MAX_PENALTY:100,MEMORY_PF_FACTOR:0,EXPANSION_DEGREES:10,FORCE_CENTER_FIRST:!0,FORCE_OFF_BOARD_FREQUENCY:0,CENTER_OFFSET_DIST_PENALTY_FACTOR:0}],jyr=class extends Kr{getSolverName(){return"MultiSectionPortPointOptimizer"}simpleRouteJson;inputNodes;capacityMeshNodes;capacityMeshEdges;colorMap;nodeMap;capacityMeshNodeMap;connectionResults;assignedPortPoints;nodeAssignedPortPoints;sections=[];activeSubSolver=null;currentSection=null;sectionScoreBeforeOptimization=0;currentSectionCenterNodeId=null;currentScheduleIndex=0;nodePfMap=new Map;attemptsToFixNode=new Map;sectionAttempts=0;MAX_ATTEMPTS_PER_NODE=100;MAX_SECTION_ATTEMPTS=15;ACCEPTABLE_PF=0.05;FRACTION_TO_REPLACE=0.2;JUMPER_PF_FN_ENABLED=!1;SHUFFLE_SEEDS_PER_SECTION=null;ALWAYS_RIP_INTERSECTIONS=!0;effort=1;HYPERPARAMETER_SCHEDULE=Xyr;constructor(e){super(),this.MAX_ITERATIONS=1e6,this.simpleRouteJson=e.simpleRouteJson,this.inputNodes=e.inputNodes,this.capacityMeshNodes=e.capacityMeshNodes,this.capacityMeshEdges=e.capacityMeshEdges,this.colorMap=e.colorMap??{},this.effort=e.effort??1,e.FRACTION_TO_REPLACE!==void 0&&(this.FRACTION_TO_REPLACE=e.FRACTION_TO_REPLACE),e.ALWAYS_RIP_INTERSECTIONS!==void 0&&(this.ALWAYS_RIP_INTERSECTIONS=e.ALWAYS_RIP_INTERSECTIONS),e.MAX_ATTEMPTS_PER_NODE!==void 0&&(this.MAX_ATTEMPTS_PER_NODE=e.MAX_ATTEMPTS_PER_NODE),e.MAX_SECTION_ATTEMPTS!==void 0&&(this.MAX_SECTION_ATTEMPTS=e.MAX_SECTION_ATTEMPTS),e.HYPERPARAMETER_SCHEDULE!==void 0&&(this.HYPERPARAMETER_SCHEDULE=e.HYPERPARAMETER_SCHEDULE),this.JUMPER_PF_FN_ENABLED=e.JUMPER_PF_FN_ENABLED??this.JUMPER_PF_FN_ENABLED,this.SHUFFLE_SEEDS_PER_SECTION=e.SHUFFLE_SEEDS_PER_SECTION,this.nodeMap=new Map(e.inputNodes.map((n)=>[n.capacityMeshNodeId,n])),this.capacityMeshNodeMap=new Map(e.capacityMeshNodes.map((n)=>[n.capacityMeshNodeId,n])),this.connectionResults=[...e.initialConnectionResults],this.assignedPortPoints=new Map(e.initialAssignedPortPoints),this.nodeAssignedPortPoints=new Map(e.initialNodeAssignedPortPoints),this.nodePfMap=this.computeInitialPfMap();let t=this.computeBoardScore();this.stats.successfulOptimizations=0,this.stats.failedOptimizations=0,this.stats.nodesExamined=0,this.stats.sectionAttempts=0,this.stats.sectionScores={},this.stats.initialBoardScore=t,this.stats.currentBoardScore=t,this.stats.errors=0}computeInitialPfMap(){let e=new Map;for(let t of this.capacityMeshNodes){let n=this.nodeAssignedPortPoints.get(t.capacityMeshNodeId)??[];if(n.length===0)continue;let o={capacityMeshNodeId:t.capacityMeshNodeId,center:t.center,width:t.width,height:t.height,portPoints:n,availableZ:t.availableZ},r=this.JUMPER_PF_FN_ENABLED&&t.availableZ.length===1?ale(t,o_(o).numSameLayerCrossings):sVt(o,t);e.set(t.capacityMeshNodeId,r)}return e}computeBoardScore(){let e=this.getNodesWithPortPoints();return this.computeScoreForNodes(e)}computeScoreForNodes(e){return this.JUMPER_PF_FN_ENABLED?Ssn(e,this.capacityMeshNodeMap):vsn(e,this.capacityMeshNodeMap)}recomputePfForNodes(e){for(let t of e){let n=this.capacityMeshNodeMap.get(t);if(!n)continue;let o=this.nodeAssignedPortPoints.get(t)??[];if(o.length===0){this.nodePfMap.set(t,0);continue}let r={capacityMeshNodeId:t,center:n.center,width:n.width,height:n.height,portPoints:o,availableZ:n.availableZ},i=this.JUMPER_PF_FN_ENABLED&&n.availableZ.length===1?ale(n,o_(r).numSameLayerCrossings):sVt(r,n);this.nodePfMap.set(t,i)}}getCreatePortPointSectionInput(){return{inputNodes:this.inputNodes,capacityMeshNodes:this.capacityMeshNodes,capacityMeshEdges:this.capacityMeshEdges,nodeMap:this.nodeMap,connectionResults:this.connectionResults}}createSection(e){return function(t,n){let{inputNodes:o,capacityMeshNodes:r,capacityMeshEdges:i,connectionResults:s}=t,{centerOfSectionCapacityNodeId:a,expansionDegrees:c}=n,l=new Map;for(let y of i){let[x,C]=y.nodeIds;l.has(x)||l.set(x,new Set),l.has(C)||l.set(C,new Set),l.get(x).add(C),l.get(C).add(x)}let h=new Set,d=new Set,u=[];for(u.push({nodeId:a,depth:0}),d.add(a);u.length>0;){let{nodeId:y,depth:x}=u.shift();if(h.add(y),x<c){let C=l.get(y)??new Set;for(let b of C)d.has(b)||(d.add(b),u.push({nodeId:b,depth:x+1}))}}let _=o.filter((y)=>h.has(y.capacityMeshNodeId)),p=r.filter((y)=>h.has(y.capacityMeshNodeId)),m=[],A=[];for(let y of i){let[x,C]=y.nodeIds,b=h.has(x),I=h.has(C);b&&I?m.push(y):(b||I)&&A.push(y)}let g=_.map((y)=>{let x=y.portPoints.filter((C)=>{let[b,I]=C.connectionNodeIds,v=h.has(b),P=h.has(I);return v||P});return{...y,portPoints:x}}),f=function(y,x){let C=[];for(let b of y){if(!b.path||b.path.length===0)continue;let I=b.connection.name,v=b.connection.__rootConnectionNames?.[0],P=[];for(let V=0;V<b.path.length;V++){let O=b.path[V];x.has(O.currentNodeId)&&P.push(V)}if(P.length===0)continue;let M=P[0],B=P[P.length-1],T=M,N=B;if(M>0){let V=b.path[0].currentNodeId;(b.nodeIds[0]===V||b.nodeIds[1]===V)&&(T=0)}if(B<b.path.length-1){let V=b.path.length-1,O=b.path[V].currentNodeId;(b.nodeIds[0]===O||b.nodeIds[1]===O)&&(N=V)}let D=b.path.slice(T,N+1),L=T>0,H=N<b.path.length-1;C.push({connectionName:I,rootConnectionName:v,points:D.map((V)=>({x:V.point.x,y:V.point.y,z:V.z,nodeId:V.currentNodeId,portPointId:V.portPoint?.portPointId})),originalStartIndex:T,originalEndIndex:N,hasEntryFromOutside:L,hasExitToOutside:H})}return C}(s??[],h);return{centerNodeId:a,expansionDegrees:c,nodeIds:h,inputNodes:g,capacityMeshNodes:p,internalEdges:m,boundaryEdges:A,sectionPaths:f}}(this.getCreatePortPointSectionInput(),e)}getSectionNodesWithPortPoints(e){let t=[];for(let n of e.nodeIds){let o=this.nodeMap.get(n),r=this.capacityMeshNodeMap.get(n);if(!o||!r)continue;let i=this.nodeAssignedPortPoints.get(n)??[];i.length>0&&t.push({capacityMeshNodeId:n,center:o.center,width:o.width,height:o.height,portPoints:i,availableZ:o.availableZ})}return t}getNodesWithPortPoints(){let e=[];for(let t of this.inputNodes){let n=this.nodeAssignedPortPoints.get(t.capacityMeshNodeId)??[];n.length>0&&e.push({capacityMeshNodeId:t.capacityMeshNodeId,center:t.center,width:t.width,height:t.height,portPoints:n,availableZ:t.availableZ})}return e}findHighestPfNode(){let e=null,t=0;for(let[n,o]of this.nodePfMap.entries())o*(1-(this.attemptsToFixNode.get(n)??0)/this.MAX_ATTEMPTS_PER_NODE)**2>t&&(t=o,e=n);return!e||t<this.ACCEPTABLE_PF?null:e}currentSectionCutPathInfo=new Map;currentSectionKeptPortPoints=new Map;currentSectionFixedRoutes=[];determineConnectionsToRip(e,t){let n=31337*this.sectionAttempts,o=hVt(n);if(this.FRACTION_TO_REPLACE>=1)return new Set(t);let r=function(a,c){let l=hVt(c),h=[...a];for(let d=h.length-1;d>0;d--){let u=Math.floor(l()*(d+1));[h[d],h[u]]=[h[u],h[d]]}return h}(t,n),i=Math.max(1,Math.ceil(r.length*this.FRACTION_TO_REPLACE)),s=new Set(r.slice(0,i));if(this.ALWAYS_RIP_INTERSECTIONS){let a=function(c){let{section:l,nodePfMap:h,capacityMeshNodeMap:d,nodeAssignedPortPoints:u,acceptablePf:_}=c,p=[];for(let m of l.nodeIds){if((h.get(m)??0)<=_)continue;let A=d.get(m);if(!A)continue;let g=u.get(m)??[];if(g.length<2)continue;let f=A.center.x-A.width/2,y=A.center.x+A.width/2,x=A.center.y-A.height/2,C=A.center.y+A.height/2,b=new Map;for(let P of g){let M=b.get(P.connectionName)??[];M.some((B)=>B.x===P.x&&B.y===P.y&&B.z===P.z)||M.push({x:P.x,y:P.y,z:P.z}),b.set(P.connectionName,M)}let I=new Map;for(let[P,M]of b){if(M.length<2)continue;let B=M[0],T=M[1];if(B.z!==T.z)continue;let N=aVt(B,f,y,x,C),D=aVt(T,f,y,x,C),L=B.z,H=I.get(L)??[];H.push({connectionName:P,t1:N,t2:D}),I.set(L,H)}let v=0.000001;for(let[,P]of I){let M=P.map((B)=>({connectionName:B.connectionName,a:Math.min(B.t1,B.t2),b:Math.max(B.t1,B.t2)}));for(let B=0;B<M.length;B++){let{connectionName:T,a:N,b:D}=M[B];for(let L=B+1;L<M.length;L++){let{connectionName:H,a:V,b:O}=M[L];Math.abs(N-V)<v||Math.abs(N-O)<v||Math.abs(D-V)<v||Math.abs(D-O)<v||(N<V&&V<D&&D<O||V<N&&N<O&&O<D)&&p.push([T,H])}}}}return p}({section:e,nodePfMap:this.nodePfMap,capacityMeshNodeMap:this.capacityMeshNodeMap,nodeAssignedPortPoints:this.nodeAssignedPortPoints,acceptablePf:this.ACCEPTABLE_PF});for(let[c,l]of a){if(s.has(c)||s.has(l))continue;let h=t.includes(c),d=t.includes(l);if(h&&d){let u=o()<0.5;s.add(u?c:l)}else h?s.add(c):d&&s.add(l)}}return this.stats.lastRipCount=s.size,s}createSectionSimpleRouteJson(e){let t=[];this.currentSectionCutPathInfo.clear(),this.currentSectionKeptPortPoints.clear(),this.currentSectionFixedRoutes=[];let n=[],o=[];for(let a of this.connectionResults){if(!a.path||a.path.length===0)continue;let[c,l]=a.nodeIds,h=e.nodeIds.has(c),d=e.nodeIds.has(l);h&&d&&(o.push(a),n.push(a.connection.name))}let r=[];for(let a of e.sectionPaths){if(!a.hasEntryFromOutside&&!a.hasExitToOutside)continue;if(a.points.length<2)continue;let c=this.connectionResults.find((l)=>l.connection.name===a.connectionName);c&&(r.push({sectionPath:a,originalResult:c}),n.includes(a.connectionName)||n.push(a.connectionName))}let i=this.determineConnectionsToRip(e,n);for(let a of o)i.has(a.connection.name)&&t.push(a.connection);for(let{sectionPath:a,originalResult:c}of r){if(!i.has(a.connectionName))continue;let l=`__cut__${a.connectionName}__${a.originalStartIndex}`;this.colorMap[l]=this.colorMap[a.connectionName];let h=a.points[0],d=a.points[a.points.length-1],u={name:l,__rootConnectionNames:[a.rootConnectionName??a.connectionName],pointsToConnect:[{x:h.x,y:h.y,layers:[`layer${h.z+1}`]},{x:d.x,y:d.y,layers:[`layer${d.z+1}`]}]};t.push(u),this.currentSectionCutPathInfo.set(l,{sectionPath:a,originalConnectionResult:c})}let s=new Set(n.filter((a)=>!i.has(a)));if(s.size>0){for(let a of e.nodeIds){let c=(this.nodeAssignedPortPoints.get(a)??[]).filter((l)=>s.has(l.connectionName));c.length>0&&this.currentSectionKeptPortPoints.set(a,c)}for(let a of o)s.has(a.connection.name)&&this.currentSectionFixedRoutes.push(a);for(let{sectionPath:a,originalResult:c}of r)if(s.has(a.connectionName)){let l={connection:{name:a.connectionName,__rootConnectionNames:a.rootConnectionName?[a.rootConnectionName]:void 0,pointsToConnect:c.connection.pointsToConnect},path:a.points.map((h)=>({prevCandidate:null,portPoint:null,currentNodeId:h.nodeId,point:{x:h.x,y:h.y},z:h.z,f:0,g:0,h:0,distanceTraveled:0})),portPoints:a.points.map((h)=>({portPointId:h.portPointId,x:h.x,y:h.y,z:h.z,connectionName:a.connectionName,rootConnectionName:a.rootConnectionName})),nodeIds:c.nodeIds,straightLineDistance:c.straightLineDistance};this.currentSectionFixedRoutes.push(l)}}return{...this.simpleRouteJson,connections:t}}prepareSectionInputNodesForCutPaths(e){let t=new Set;for(let[,n]of this.currentSectionCutPathInfo.entries()){let{sectionPath:o}=n;if(o.points.length===0)continue;let r=o.points[0].nodeId;t.add(r);let i=o.points[o.points.length-1].nodeId;t.add(i)}return e.inputNodes.map((n)=>t.has(n.capacityMeshNodeId)?{...n,_containsTarget:!0}:n)}getHyperParametersForScheduleIndex(e,t){let n=this.HYPERPARAMETER_SCHEDULE[e];return{...n,SHUFFLE_SEED:(n.SHUFFLE_SEED??0)+17*t}}createSectionSolver(e){let t=this.createSectionSimpleRouteJson(e),n=this.prepareSectionInputNodesForCutPaths(e),o=Isn(t,n);for(let[r,i]of this.currentSectionKeptPortPoints){let s=o.nodeAssignedPortPoints.get(r)??[];o.nodeAssignedPortPoints.set(r,[...s,...i])}return new VJe({simpleRouteJson:t,inputNodes:n,capacityMeshNodes:e.capacityMeshNodes,colorMap:this.colorMap,nodeMemoryPfMap:this.nodePfMap,numShuffleSeeds:this.SHUFFLE_SEEDS_PER_SECTION??2*t.connections.length*this.effort,hyperParameters:{...this.getHyperParametersForScheduleIndex(this.currentScheduleIndex,this.sectionAttempts)},precomputedInitialParams:o,fixedRoutes:this.currentSectionFixedRoutes})}reattachSection(e,t,n,o){let r=[],i=[];for(let a of t)a.connection.name.startsWith("__cut__")?i.push(a):r.push(a);let s=new Set(r.map((a)=>a.connection.name));this.connectionResults=this.connectionResults.filter((a)=>!s.has(a.connection.name)),this.connectionResults.push(...r);for(let[a,c]of this.nodeAssignedPortPoints.entries()){if(!e.nodeIds.has(a))continue;let l=c.filter((h)=>!s.has(h.connectionName));this.nodeAssignedPortPoints.set(a,l)}for(let[a,c]of this.assignedPortPoints.entries())s.has(c.connectionName)&&this.assignedPortPoints.delete(a);for(let a of i){let c=this.currentSectionCutPathInfo.get(a.connection.name);if(!c||!a.path)continue;let{sectionPath:l,originalConnectionResult:h}=c,d=h.path;if(!d)continue;let u=l.connectionName;for(let[g,f]of this.nodeAssignedPortPoints.entries()){let y=f.filter((x)=>x.connectionName!==u||!e.nodeIds.has(g));this.nodeAssignedPortPoints.set(g,y)}let _=d.slice(0,l.originalStartIndex),p=d.slice(l.originalEndIndex+1),m=[],A=_.length>0?_[_.length-1]:null;for(let g of a.path){let f={...g,prevCandidate:A};m.push(f),A=f}if(p.length>0&&m.length>0&&(p[0]={...p[0],prevCandidate:m[m.length-1]}),h.path=[..._,...m,...p],a.portPoints)for(let g of a.portPoints){let f={...g,connectionName:u,rootConnectionName:l.rootConnectionName??u};for(let y of e.inputNodes)for(let x of y.portPoints)if(Math.abs(x.x-g.x)<0.001&&Math.abs(x.y-g.y)<0.001&&x.z===g.z){for(let C of x.connectionNodeIds){let b=this.nodeAssignedPortPoints.get(C)??[];b.push(f),this.nodeAssignedPortPoints.set(C,b)}break}}}for(let[a,c]of n.entries())c.connectionName.startsWith("__cut__")||this.assignedPortPoints.set(a,c);for(let[a,c]of o.entries()){let l=c.filter((h)=>!h.connectionName.startsWith("__cut__"));if(l.length>0){let h=this.nodeAssignedPortPoints.get(a)??[];this.nodeAssignedPortPoints.set(a,[...h,...l])}}}_step(){if(this.activeSubSolver){if(this.activeSubSolver.step(),this.activeSubSolver.solved||this.activeSubSolver.failed){if(this.activeSubSolver.failed){if(this.currentScheduleIndex++,this.activeSubSolver.error&&this.stats.errors++,this.currentScheduleIndex<this.HYPERPARAMETER_SCHEDULE.length&&this.currentSectionCenterNodeId){let l=this.HYPERPARAMETER_SCHEDULE[this.currentScheduleIndex];this.currentSection=this.createSection({centerOfSectionCapacityNodeId:this.currentSectionCenterNodeId,expansionDegrees:l.EXPANSION_DEGREES}),this.activeSubSolver=this.createSectionSolver(this.currentSection)}else this.stats.failedOptimizations++,this.activeSubSolver=null,this.currentSection=null,this.currentSectionCenterNodeId=null,this.currentScheduleIndex=0;return}let o=this.activeSubSolver.getNodesWithPortPoints().map((l)=>({...l,portPoints:l.portPoints.map((h)=>{if(h.connectionName.startsWith("__cut__")){let d=h.connectionName.slice(7),u=d.lastIndexOf("__"),_=u>=0?d.slice(0,u):d;return{...h,connectionName:_}}return h})})),r=new Set;for(let l of o)for(let h of l.portPoints)r.add(h.connectionName);let i=this.getSectionNodesWithPortPoints(this.currentSection).map((l)=>({...l,portPoints:l.portPoints.filter((h)=>r.has(h.connectionName))})).filter((l)=>l.portPoints.length>0),s=this.computeScoreForNodes(i),a=this.computeScoreForNodes(o),c=`attempt${this.sectionAttempts}`;if(this.stats.lastSectionScore=a,a>s){let l=this.stats.currentBoardScore;this.stats.lastBoardScore=l;let h=[...this.connectionResults],d=new Map(this.assignedPortPoints),u=new Map(Array.from(this.nodeAssignedPortPoints.entries()).map(([p,m])=>[p,[...m]]));this.reattachSection(this.currentSection,this.activeSubSolver.connectionsWithResults,this.activeSubSolver.assignedPortPoints,this.activeSubSolver.nodeAssignedPortPoints),this.recomputePfForNodes(this.currentSection.nodeIds);let _=this.computeBoardScore();this.stats.sectionScores[c]=_,_>l?(this.stats.successfulOptimizations++,this.stats.currentBoardScore=_):(this.connectionResults=h,this.assignedPortPoints=d,this.nodeAssignedPortPoints=u,this.recomputePfForNodes(this.currentSection.nodeIds),this.stats.failedOptimizations++),this.activeSubSolver=null,this.currentSection=null,this.currentSectionCenterNodeId=null,this.currentScheduleIndex=0}else if(this.currentScheduleIndex++,this.currentScheduleIndex<this.HYPERPARAMETER_SCHEDULE.length&&this.currentSectionCenterNodeId){let l=this.HYPERPARAMETER_SCHEDULE[this.currentScheduleIndex];this.currentSection=this.createSection({centerOfSectionCapacityNodeId:this.currentSectionCenterNodeId,expansionDegrees:l.EXPANSION_DEGREES}),this.activeSubSolver=this.createSectionSolver(this.currentSection)}else this.stats.failedOptimizations++,this.activeSubSolver=null,this.currentSection=null,this.currentSectionCenterNodeId=null,this.currentScheduleIndex=0}return}if(this.sectionAttempts>=this.MAX_SECTION_ATTEMPTS)return void(this.solved=!0);let e=this.findHighestPfNode();if(!e)return void(this.solved=!0);this.sectionAttempts++,this.stats.sectionAttempts=this.sectionAttempts,this.stats.nodesExamined++,this.attemptsToFixNode.set(e,(this.attemptsToFixNode.get(e)??0)+1),this.currentSectionCenterNodeId=e,this.currentScheduleIndex=0;let t=this.HYPERPARAMETER_SCHEDULE[this.currentScheduleIndex];this.currentSection=this.createSection({centerOfSectionCapacityNodeId:e,expansionDegrees:t.EXPANSION_DEGREES});let n=this.getSectionNodesWithPortPoints(this.currentSection);if(this.sectionScoreBeforeOptimization=this.computeScoreForNodes(n),this.createSectionSimpleRouteJson(this.currentSection).connections.length===0)return this.currentSection=null,void(this.currentSectionCenterNodeId=null);this.activeSubSolver=this.createSectionSolver(this.currentSection)}computeProgress(){return this.sectionAttempts/this.MAX_SECTION_ATTEMPTS}visualize(){return this.solved?cKe(this):this.activeSubSolver?this.activeSubSolver.visualize():this.currentSection?function(e,t){let n={lines:[],points:[],rects:[],circles:[]};for(let o of e.inputNodes){let r=o.capacityMeshNodeId===e.centerNodeId,i=r?"rgba(0, 200, 0, 0.3)":"rgba(200, 200, 200, 0.3)";n.rects.push({center:o.center,width:0.9*o.width,height:0.9*o.height,layer:`z${o.availableZ.join(",")}`,fill:i,label:`${o.capacityMeshNodeId}${r?" (CENTER)":""}`})}for(let o of e.inputNodes)for(let r of o.portPoints)n.circles.push({center:{x:r.x,y:r.y},radius:0.05,fill:"rgba(150, 150, 150, 0.5)",layer:`z${r.z}`,label:[r.portPointId,`cd: ${r.distToCentermostPortOnZ}`,`connects: ${r.connectionNodeIds.join(",")}`].filter(Boolean).join(`
`)});for(let o of e.sectionPaths){let r=t?.[o.connectionName]??"blue";for(let i=0;i<o.points.length-1;i++){let s=o.points[i],a=o.points[i+1],c=s.z===a.z,l=s.z,h;h=c?l===0?"5 5":"10 5":"3 3 10",n.lines.push({points:[{x:s.x,y:s.y},{x:a.x,y:a.y}],strokeColor:r,strokeDash:h})}}return n}(this.currentSection,this.colorMap):cKe(this)}},Psn=class{parent={};constructor(e){for(let t of e)this.parent[t]=t}find(e){return this.parent[e]===e?e:this.parent[e]=this.find(this.parent[e])}union(e,t){let n=this.find(e),o=this.find(t);n!==o&&(this.parent[o]=n)}getGroup(e){let t=this.find(e),n=[];for(let o in this.parent)this.find(o)===t&&n.push(o);return n}},Kyr=class{point;left=null;right=null;constructor(e){this.point=e}},$yr=class{root=null;constructor(e){e.length>0&&(this.root=this.buildTree(e,0))}buildTree(e,t){let n=t%2==0?"x":"y";e.sort((i,s)=>i[n]-s[n]);let o=Math.floor(e.length/2),r=new Kyr(e[o]);return o>0&&(r.left=this.buildTree(e.slice(0,o),t+1)),o<e.length-1&&(r.right=this.buildTree(e.slice(o+1),t+1)),r}findNearestNeighbor(e){if(!this.root)throw Error("Tree is empty");let t=this.root.point,n=this.distance(e,t);return this.nearestNeighborSearch(this.root,e,0,t,n),t}nearestNeighborSearch(e,t,n,o,r){if(!e)return o;let i=n%2?"x":"y",s=this.distance(t,e.point);s<r&&(o=e.point,r=s);let a=t[i]-e.point[i],c=a<=0?e.left:e.right,l=a<=0?e.right:e.left;return o=this.nearestNeighborSearch(c,t,n+1,o,r),r=this.distance(t,o),Math.abs(a)<r&&(o=this.nearestNeighborSearch(l,t,n+1,o,r)),o}findKNearestNeighbors(e,t){if(!this.root)return[];let n=[];return this.kNearestNeighborSearch(this.root,e,0,n,t),n.sort((o,r)=>o.distance-r.distance).slice(0,t).map((o)=>o.point)}kNearestNeighborSearch(e,t,n,o,r){if(!e)return;let i=n%2?"x":"y",s=this.distance(t,e.point);o.push({point:e.point,distance:s});let a=t[i]-e.point[i],c=a<=0?e.left:e.right,l=a<=0?e.right:e.left;this.kNearestNeighborSearch(c,t,n+1,o,r);let h=1/0;o.length>=r&&(o.sort((d,u)=>d.distance-u.distance),h=o[r-1]?.distance||1/0),(Math.abs(a)<h||o.length<r)&&this.kNearestNeighborSearch(l,t,n+1,o,r)}distance(e,t){return Math.sqrt((e.x-t.x)**2+(e.y-t.y)**2)}},qyr=class{parent=new Map;rank=new Map;constructor(e){for(let t of e){let n=this.pointToKey(t);this.parent.set(n,n),this.rank.set(n,0)}}pointToKey(e){return`${e.x},${e.y}`}find(e){let t=this.pointToKey(e);if(!this.parent.has(t))throw Error(`Point ${t} not found in DisjointSet`);let n=t;for(;n!==this.parent.get(n);)n=this.parent.get(n);let o=t;for(;o!==n;){let r=this.parent.get(o);this.parent.set(o,n),o=r}return n}union(e,t){let n=this.find(e),o=this.find(t);if(n===o)return!1;let r=this.rank.get(n)||0,i=this.rank.get(o)||0;return r<i?this.parent.set(n,o):r>i?this.parent.set(o,n):(this.parent.set(o,n),this.rank.set(n,r+1)),!0}};function Esn(e,t={}){if(e.length<=1)return[];let n=[...e],o=new $yr(n),r=[],i=Math.min(10,e.length-1);for(let c of n){let l=o.findKNearestNeighbors(c,i+1);for(let h of l){if(c.x===h.x&&c.y===h.y)continue;let d=Math.sqrt((c.x-h.x)**2+(c.y-h.y)**2);r.push({from:c,to:h,weight:d})}}t.extraEdges&&r.push(...t.extraEdges),r.sort((c,l)=>c.weight-l.weight);let s=new qyr(n),a=[];for(let c of r)if(s.union(c.from,c.to)&&(a.push(c),a.length===n.length-1))break;return a}var Jyr=(e,t)=>{let n=new Map;for(let r of e.pointsToConnect){if(!r.pointId)continue;let i=t.getNetConnectedToId(r.pointId);if(!i)continue;let s=n.get(i)??[];s.push(r),n.set(i,s)}let o=[];for(let r of n.values()){let i=r[0];if(i)for(let s of r.slice(1))o.push({from:i,to:s,weight:0})}return o},Msn=(e,t)=>({zeroWeightEdges:Jyr(e,t),arePointsConnected:(n,o)=>Boolean(n.pointId&&o.pointId&&((r,i,s)=>{let a=r.getNetConnectedToId(i);return!!a&&a===r.getNetConnectedToId(s)})(t,n.pointId,o.pointId))});function $Ce(e){if(e.pointId)return e.pointId;let t=[...zx(e)].sort().join("-");return`${e.x.toFixed(4)},${e.y.toFixed(4)},${t}`}function wsn(e){if(e.length===0)return[];let t=e.map((s,a)=>`conn_${a}`),n=new Psn(t),o=new Map;e.forEach((s,a)=>{let c=`conn_${a}`;s.pointsToConnect.forEach((l)=>{let h=$Ce(l);o.has(h)||o.set(h,[]),o.get(h).push(c)})});for(let s of o.values())if(s.length>1){let a=s[0];for(let c=1;c<s.length;c++)n.union(a,s[c])}let r=new Map;e.forEach((s,a)=>{let c=`conn_${a}`,l=n.find(c);r.has(l)||r.set(l,[]),r.get(l).push(s)});let i=[];for(let s of r.values()){if(s.length===1){i.push(s[0]);continue}let a=new Map,c=new Set,l=!1,h=[],d=new Set,u;s.forEach((p)=>{p.pointsToConnect.forEach((A)=>a.set($Ce(A),A));let m=p.__rootConnectionNames;if(m&&m.length>0)for(let A of m)c.add(A);else c.add(p.name);p.isOffBoard&&(l=!0),p.externallyConnectedPointIds&&h.push(...p.externallyConnectedPointIds),p.__netConnectionName&&d.add(p.__netConnectionName),u===void 0&&p.nominalTraceWidth!==void 0&&(u=p.nominalTraceWidth)});let _={name:s.map((p)=>p.name).join("__"),pointsToConnect:Array.from(a.values()),isOffBoard:l,externallyConnectedPointIds:h.length>0?h:void 0,__netConnectionName:d.size>0?Array.from(d).join("__"):void 0,__rootConnectionNames:Array.from(c),nominalTraceWidth:u};i.push(_)}return i}var YJe=class extends Kr{constructor(e,t={},n){super(),this.ogSrj=e,this.colorMap=t;let o=new Map;for(let i of e.buses??[])if(i.traceWidth!==void 0)for(let s of i.connectionNames)o.set(s,Math.max(o.get(s)??0,i.traceWidth));let r=e.connections.map((i)=>{let s=o.get(i.name);return s===void 0?i:{...i,nominalTraceWidth:Math.max(i.nominalTraceWidth??0,s)}});this.unprocessedConnections=wsn(r),this.newConnections=[],this.initiallyConnectedMap=n}ogSrj;colorMap;getSolverName(){return"NetToPointPairsSolver"}unprocessedConnections;newConnections;initiallyConnectedMap;_step(){if(this.unprocessedConnections.length===0)return void(this.solved=!0);let e=this.unprocessedConnections.pop(),{zeroWeightEdges:t,arePointsConnected:n}=Msn(e,this.initiallyConnectedMap);if(e.pointsToConnect.length===2){let[i,s]=e.pointsToConnect;if(i&&s&&n(i,s))return;return void this.newConnections.push({...e,__rootConnectionNames:e.__rootConnectionNames??[e.name]})}let o=Esn(e.pointsToConnect,{extraEdges:t}),r=0;for(let i of o)n(i.from,i.to)||this.newConnections.push({...e,pointsToConnect:[i.from,i.to],name:`${e.name}_mst${r++}`,__rootConnectionNames:e.__rootConnectionNames??[e.name],__netConnectionName:e.__netConnectionName})}getNewSimpleRouteJson(){return{...structuredClone(this.ogSrj),connections:structuredClone(this.newConnections)}}visualize(){let e={lines:[],points:[],rects:[],circles:[],coordinateSystem:"cartesian",title:"Net To Point Pairs Visualization"};return this.unprocessedConnections.forEach((t)=>{t.pointsToConnect.forEach((i)=>{e.points.push({x:i.x,y:i.y,color:"red",label:i.pcb_port_id??i.pointId})});let n=t.pointsToConnect.length**2,o=C$e(0),r=new Set;for(let i=0;i<Math.max(n,2*t.pointsToConnect.length);i++){let s=Math.floor(o()*t.pointsToConnect.length),a=Math.floor(o()*t.pointsToConnect.length);r.has(`${s}-${a}`)||(r.add(`${s}-${a}`),e.lines.push({points:[t.pointsToConnect[s],t.pointsToConnect[a]],strokeColor:"rgba(255,0,0,0.25)",label:t.name}))}}),this.newConnections.forEach((t)=>{let n=this.colorMap?.[t.name]||"blue";t.pointsToConnect.forEach((o)=>{e.points.push({x:o.x,y:o.y,color:n,label:o.pcb_port_id??o.pointId})});for(let o=0;o<t.pointsToConnect.length-1;o++)for(let r=o+1;r<t.pointsToConnect.length;r++)e.lines.push({points:[t.pointsToConnect[o],t.pointsToConnect[r]],strokeColor:n,label:t.name})}),e}},kq=class extends YJe{constructor(e,t={},n){let o=e.connections.flatMap((c)=>c.pointsToConnect),r=new Map;for(let c of o)c.pointId&&r.set(c.pointId,c);let i=o.map((c)=>c.pointId).filter((c)=>!!c),s=new Psn(i),a=[];for(let c of e.connections)c.isOffBoard?c.pointsToConnect.length>=2&&c.pointsToConnect[0].pointId&&c.pointsToConnect[1].pointId&&s.union(c.pointsToConnect[0].pointId,c.pointsToConnect[1].pointId):a.push(c);super({...e,connections:a},t,n),this.ogSrj=e,this.colorMap=t,this.connectionPointDsu=s,this.connectionPointMap=r,this.ogSrj=e}ogSrj;colorMap;getSolverName(){return"NetToPointPairsSolver2_OffBoardConnection"}connectionPointDsu;connectionPointMap;_findBestConnectionPointsFromDisjointSets(e,t){if(!e.pointId||!t.pointId)return{pointsToConnect:[e,t]};let n=this.connectionPointDsu.getGroup(e.pointId).map((a)=>this.connectionPointMap.get(a)),o=this.connectionPointDsu.getGroup(t.pointId).map((a)=>this.connectionPointMap.get(a)),r=e,i=t,s=1/0;for(let a of n)for(let c of o){let l=Math.sqrt(Math.pow(a.x-c.x,2)+Math.pow(a.y-c.y,2));l<s&&(s=l,r=a,i=c)}return{pointsToConnect:[r,i]}}_step(){if(this.unprocessedConnections.length===0)return void(this.solved=!0);let e=this.unprocessedConnections.pop(),{zeroWeightEdges:t,arePointsConnected:n}=Msn(e,this.initiallyConnectedMap);if(e.pointsToConnect.length===2){let[i,s]=e.pointsToConnect;if(i&&s&&n(i,s))return;let a=this._findBestConnectionPointsFromDisjointSets(e.pointsToConnect[0],e.pointsToConnect[1]);return void this.newConnections.push({...e,pointsToConnect:a.pointsToConnect,__rootConnectionNames:e.__rootConnectionNames??[e.name]})}let o=Esn(e.pointsToConnect,{extraEdges:t}),r=0;for(let i of o){if(n(i.from,i.to))continue;let s=this._findBestConnectionPointsFromDisjointSets(i.from,i.to);this.newConnections.push({...e,pointsToConnect:s.pointsToConnect,name:`${e.name}_mst${r++}`,__rootConnectionNames:e.__rootConnectionNames??[e.name],__netConnectionName:e.__netConnectionName})}}},GJe=class{netMap;idToNetMap;constructor(e){this.netMap=e,this.idToNetMap={};for(let[t,n]of Object.entries(e))for(let o of n)this.idToNetMap[o]=t}addConnections(e){for(let t of e){let n=new Set;for(let r of t){let i=this.idToNetMap[r];i&&n.add(i)}let o;if(n.size===0)o=`connectivity_net${Object.keys(this.netMap).length}`,this.netMap[o]=[];else if(n.size===1)o=n.values().next().value??`connectivity_net${Object.keys(this.netMap).length}`;else{o=n.values().next().value??`connectivity_net${Object.keys(this.netMap).length}`;for(let r of n)if(r!==o){let i=this.netMap[o],s=this.netMap[r];if(i&&s){i.push(...s),this.netMap[r]=i;for(let a of i)this.idToNetMap[a]=o}}}for(let r of t){let i=this.netMap[o];i&&!i.includes(r)&&i.push(r),this.idToNetMap[r]=o}}}getIdsConnectedToNet(e){return this.netMap[e]||[]}getNetConnectedToId(e){return this.idToNetMap[e]}areIdsConnected(e,t){if(e===t)return!0;let n=this.getNetConnectedToId(e);if(!n)return!1;let o=this.getNetConnectedToId(t);return!!o&&(n===o||o===e||o===e)}areAllIdsConnected(e){if(e.length===0)return!0;let t=this.getNetConnectedToId(e[0]);if(!t)return!1;for(let n of e){let o=this.getNetConnectedToId(n);if(o===void 0)return!1;if(o!==t)return!1}return!0}};function Zyr(e,t={}){let n=[],o=[],r=t.color??"gray",i=t.label,s=ZO[e.footprint]??ZO["0603"],a=e.end.x-e.start.x,c=e.end.y-e.start.y,l=Math.abs(a)>Math.abs(c),h=l?s.padLength:s.padWidth,d=l?s.padWidth:s.padLength;return n.push({center:e.start,width:h,height:d,fill:Qi(r,0.5),stroke:"rgba(0, 0, 0, 0.5)",layer:"jumper",label:i?`${i} (start)`:void 0}),n.push({center:e.end,width:h,height:d,fill:Qi(r,0.5),stroke:"rgba(0, 0, 0, 0.5)",layer:"jumper",label:i?`${i} (end)`:void 0}),o.push({points:[e.start,e.end],strokeColor:"rgba(100, 100, 100, 0.8)",strokeWidth:0.3*s.padWidth,layer:"jumper-body"}),{rects:n,lines:o}}function m9(e,t={}){let n={rects:[],lines:[]};for(let o of e){let{rects:r,lines:i}=Zyr(o,t);n.rects.push(...r),n.lines.push(...i)}return n}var n3e=1e5,Pae=0.001,dVt=class extends Kr{getSolverName(){return"SingleHighDensityRouteStitchSolver"}mergedHdRoute;remainingHdRoutes;start;end;colorMap;constructor(e){if(super(),this.remainingHdRoutes=[...e.hdRoutes],this.colorMap=e.colorMap??{},e.hdRoutes.length===0){this.start=e.start,this.end=e.end;let a=[{x:e.start.x,y:e.start.y,z:e.start.z}],c=[];return e.start.z!==e.end.z&&(a.push({x:e.start.x,y:e.start.y,z:e.end.z}),c.push({x:e.start.x,y:e.start.y})),a.push({x:e.end.x,y:e.end.y,z:e.end.z}),this.mergedHdRoute={connectionName:e.connectionName,rootConnectionName:e.hdRoutes[0]?.rootConnectionName,route:a,vias:c,jumpers:[],viaDiameter:e.defaultViaDiameter??0.3,traceThickness:e.defaultTraceThickness??0.15},void(this.solved=!0)}let t=1/0,n=e.hdRoutes[0],o="start-to-end";for(let a of e.hdRoutes){let c=a.route[0],l=a.route[a.route.length-1],h=Dn(e.start,c),d=Dn(e.start,l),u=Dn(e.end,c),_=Dn(e.end,l),p=Math.min(h,d,u,_);p<t&&(t=p,n=a,o=Math.min(u,_)<Math.min(h,d)?"end-to-start":"start-to-end")}o==="start-to-end"?(this.start=e.start,this.end=e.end):(this.start=e.end,this.end=e.start);let r=n.route[0],i=n.route[n.route.length-1],s=Dn(this.start,r)<=Dn(this.start,i)?r:i;this.mergedHdRoute={connectionName:e.connectionName,rootConnectionName:n.rootConnectionName,route:[{x:this.start.x,y:this.start.y,z:s.z}],vias:[],jumpers:[],viaDiameter:n.viaDiameter,traceThickness:n.traceThickness}}getDisjointedRoute(){for(let e of this.remainingHdRoutes)if([e.route[0],e.route[e.route.length-1]].some((t)=>!this.remainingHdRoutes.some((n)=>{if(n===e)return!1;return[n.route[0],n.route[n.route.length-1]].some((o)=>o.z===t.z&&Dn(t,o)<0.001)})))return{firstRoute:e};return{firstRoute:this.remainingHdRoutes[0]}}_step(){if(this.remainingHdRoutes.length===0){let s=this.mergedHdRoute.route[this.mergedHdRoute.route.length-1];return this.mergedHdRoute.route.push({x:this.end.x,y:this.end.y,z:s.z}),void(this.solved=!0)}let e=this.mergedHdRoute.route[this.mergedHdRoute.route.length-1],t=-1,n="first",o=1/0;for(let s=0;s<this.remainingHdRoutes.length;s++){let a=this.remainingHdRoutes[s],c=a.route[0],l=a.route[a.route.length-1],h=Dn(e,c),d=Dn(e,l),u=1/0;u=e.z===c.z?h<Pae?h:n3e+h:h<Pae?1000+h:n3e+h,u<o&&(o=u,t=s,n="first");let _=1/0;_=e.z===l.z?d<Pae?d:n3e+d:d<Pae?1000+d:n3e+d,_<o&&(o=_,t=s,n="last")}if(t===-1)return void(this.remainingHdRoutes=[]);let r=this.remainingHdRoutes[t],i;this.remainingHdRoutes.splice(t,1),i=n==="first"?r.route:[...r.route].reverse(),Dn(e,i[0])<Pae&&e.z===i[0].z?this.mergedHdRoute.route.push(...i.slice(1)):this.mergedHdRoute.route.push(...i),this.mergedHdRoute.vias.push(...r.vias),r.jumpers&&this.mergedHdRoute.jumpers.push(...r.jumpers)}visualize(){let e={points:[],lines:[],circles:[],rects:[],title:"Single High Density Route Stitch Solver"};if(e.points?.push({x:this.start.x,y:this.start.y,color:"green",label:"Start"},{x:this.end.x,y:this.end.y,color:"red",label:"End"}),this.mergedHdRoute&&this.mergedHdRoute.route.length>1){e.lines?.push({points:this.mergedHdRoute.route.map((t)=>({x:t.x,y:t.y})),strokeColor:"green"});for(let t of this.mergedHdRoute.route)e.points?.push({x:t.x,y:t.y,color:"green"});for(let t of this.mergedHdRoute.vias)e.circles?.push({center:{x:t.x,y:t.y},radius:this.mergedHdRoute.viaDiameter/2,fill:"green"});if(this.mergedHdRoute.jumpers&&this.mergedHdRoute.jumpers.length>0){let t=m9(this.mergedHdRoute.jumpers,{color:"green",label:this.mergedHdRoute.connectionName});e.rects.push(...t.rects??[]),e.lines.push(...t.lines??[])}}for(let[t,n]of this.remainingHdRoutes.entries()){let o=this.colorMap[n.connectionName]??"gray";e.lines?.push({points:n.route.map((r)=>({x:r.x,y:r.y})),strokeColor:o});for(let r=0;r<n.route.length;r++){let i=n.route[r];e.points?.push({x:i.x+(t%2-0.5)/500+(r%8-4)/1000,y:i.y+(t%2-0.5)/500+(r%8-4)/1000,color:o,label:`Route ${n.connectionName} ${i===n.route[0]?"First":i===n.route[n.route.length-1]?"Last":""}`})}for(let r of n.vias)e.circles?.push({center:{x:r.x,y:r.y},radius:n.viaDiameter/2,fill:o});if(n.jumpers&&n.jumpers.length>0){let r=m9(n.jumpers,{color:o,label:n.connectionName});e.rects.push(...r.rects??[]),e.lines.push(...r.lines??[])}}return e}},f$=(e)=>`${Math.round(100*e.x)},${Math.round(100*e.y)},${Math.round(100*e.z)}`,exr=(e)=>({startHash:f$(e.route[0]),endHash:f$(e.route[e.route.length-1])}),UJe=class extends Kr{getSolverName(){return"MultipleHighDensityRouteStitchSolver"}unsolvedRoutes;activeSolver=null;mergedHdRoutes=[];colorMap={};defaultTraceThickness;defaultViaDiameter;getClosestEndpointHash(e,t){let n=null,o=1/0;for(let r of e){let i=[r.route[0],r.route[r.route.length-1]];for(let s of i){let a=Dn(t,s);a<o&&(o=a,n=f$(s))}}return n}selectRoutesAlongEndpointPath(e,t,n){if(e.length<=2)return e;let o=this.getClosestEndpointHash(e,t),r=this.getClosestEndpointHash(e,n);if(!o||!r||o===r)return e;let i=new Map;for(let d=0;d<e.length;d++){let{startHash:u,endHash:_}=exr(e[d]),p=i.get(u)??[];p.push({nextHash:_,routeIndex:d}),i.set(u,p);let m=i.get(_)??[];m.push({nextHash:u,routeIndex:d}),i.set(_,m)}let s=[o],a=new Set([o]),c=new Map;for(;s.length>0;){let d=s.shift();if(d===r)break;for(let u of i.get(d)??[])a.has(u.nextHash)||(a.add(u.nextHash),c.set(u.nextHash,{prevHash:d,routeIndex:u.routeIndex}),s.push(u.nextHash))}if(!a.has(r))return e;let l=new Set,h=r;for(;h!==o;){let d=c.get(h);if(!d)return e;l.add(d.routeIndex),h=d.prevHash}if(l.size===0)return e;return e.filter((d,u)=>l.has(u))}constructor(e){super(),this.colorMap=e.colorMap??{};let t=e.hdRoutes[0];this.defaultTraceThickness=t?.traceThickness??0.15,this.defaultViaDiameter=t?.viaDiameter??e.defaultViaDiameter??0.3;let n=new GJe({}),o=[],r=new Map;for(let a=0;a<e.hdRoutes.length;a++){let c=e.hdRoutes[a],l=c.route[0],h=c.route[c.route.length-1];o.push([`route_island_${a}`,`${c.connectionName}:${f$(l)}`,`${c.connectionName}:${f$(h)}`])}n.addConnections(o);for(let a of o)for(let c of a.slice(1))r.set(c,(r.get(c)??0)+1);this.unsolvedRoutes=[];let i=Array.from(new Set(Object.values(n.idToNetMap)));for(let a of i){let c=n.getIdsConnectedToNet(a),l=e.hdRoutes.filter((A,g)=>c.includes(`route_island_${g}`));if(l.length===0)continue;let h=e.connections.find((A)=>A.name===l[0].connectionName),d=l.flatMap((A)=>[A.route[0],A.route[A.route.length-1]]),u=[];for(let A of d){let g=`${l[0].connectionName}:${f$(A)}`;r.get(g)===1&&u.push(A)}if(u.length===0){console.log("no possible endpoints, can't stitch");continue}let _,p;u.length!==2?(_={...h.pointsToConnect[0],z:ti(Ef(h.pointsToConnect[0]),e.layerCount)},p={...h.pointsToConnect[1],z:ti(Ef(h.pointsToConnect[1]),e.layerCount)}):(_=u[0],p=u[1],Dn(_,h.pointsToConnect[1])<Dn(p,h.pointsToConnect[0])&&([_,p]=[p,_]));let m=this.selectRoutesAlongEndpointPath(l,_,p);this.unsolvedRoutes.push({connectionName:l[0].connectionName,hdRoutes:m,start:_,end:p})}let s=new Map;for(let a of this.unsolvedRoutes){let c=s.get(a.connectionName);c?c.push(a):s.set(a.connectionName,[a])}this.unsolvedRoutes=Array.from(s.entries()).flatMap(([a,c])=>{if(!c.some((_)=>_.hdRoutes.some((p)=>p.route.length<2)))return c;let l=e.connections.find((_)=>_.name===a);if(!l)return c;let h={...l.pointsToConnect[0],z:ti(Ef(l.pointsToConnect[0]),e.layerCount)},d={...l.pointsToConnect[1],z:ti(Ef(l.pointsToConnect[1]),e.layerCount)},u=c.flatMap((_)=>_.hdRoutes);return[{connectionName:a,hdRoutes:this.selectRoutesAlongEndpointPath(u,h,d),start:h,end:d}]}),this.MAX_ITERATIONS=1e5}_step(){if(this.activeSolver)return this.activeSolver.step(),void(this.activeSolver.solved?(this.activeSolver instanceof dVt&&this.mergedHdRoutes.push(this.activeSolver.mergedHdRoute),this.activeSolver=null):this.activeSolver.failed&&(this.failed=!0,this.error=this.activeSolver.error));let e=this.unsolvedRoutes.pop();e?this.activeSolver=new dVt({connectionName:e.connectionName,hdRoutes:e.hdRoutes,start:e.start,end:e.end,colorMap:this.colorMap,defaultTraceThickness:this.defaultTraceThickness,defaultViaDiameter:this.defaultViaDiameter}):this.solved=!0}visualize(){let e={points:[],lines:[],circles:[],rects:[],title:"Multiple High Density Route Stitch Solver"};if(this.activeSolver){let t=this.activeSolver.visualize();t.points?.length&&e.points?.push(...t.points),t.lines?.length&&e.lines?.push(...t.lines),t.circles?.length&&e.circles?.push(...t.circles),t.rects?.length&&(e.rects||(e.rects=[]),e.rects.push(...t.rects))}for(let[t,n]of this.mergedHdRoutes.entries()){let o=this.colorMap[n.connectionName]??`hsl(120, 100%, ${40+10*t%40}%)`;for(let r=0;r<n.route.length-1;r++){let i=n.route[r],s=n.route[r+1],a=i.z!==0?Qi(o,0.5):o;e.lines?.push({points:[{x:i.x,y:i.y},{x:s.x,y:s.y}],strokeColor:a,strokeWidth:n.traceThickness})}for(let r of n.route){let i=r.z!==0?Qi(o,0.5):o;e.points?.push({x:r.x,y:r.y,color:i})}for(let r of n.vias)e.circles?.push({center:{x:r.x,y:r.y},radius:n.viaDiameter/2,fill:o});if(n.jumpers&&n.jumpers.length>0){let r=m9(n.jumpers,{color:o,label:n.connectionName});e.rects.push(...r.rects??[]),e.lines.push(...r.lines??[])}}for(let t of this.unsolvedRoutes){let n=this.colorMap[t.connectionName]??"gray";e.points?.push({x:t.start.x,y:t.start.y,color:n,label:`${t.connectionName} Start (z=${t.start.z})`},{x:t.end.x,y:t.end.y,color:n,label:`${t.connectionName} End (z=${t.end.z})`}),e.lines?.push({points:[{x:t.start.x,y:t.start.y},{x:t.end.x,y:t.end.y}],strokeColor:n,strokeDash:"2 2"});for(let o of t.hdRoutes){o.route.length>1&&e.lines?.push({points:o.route.map((r)=>({x:r.x,y:r.y})),strokeColor:Qi(n,0.5),strokeDash:"10 5"});for(let r of o.vias)e.circles?.push({center:{x:r.x,y:r.y},radius:o.viaDiameter/2,fill:n});if(o.jumpers&&o.jumpers.length>0){let r=m9(o.jumpers,{color:n,label:o.connectionName});e.rects.push(...r.rects??[]),e.lines.push(...r.lines??[])}}}return e}},EV=class{MAX_ITERATIONS=1000;solved=!1;failed=!1;iterations=0;progress=0;error=null;activeSubSolver;failedSubSolvers;timeToSolve;stats={};pendingEffects;cacheHit;cacheKey;cacheToSolveSpaceTransform;getSolverName(){return this.constructor.name}step(){if(!this.solved&&!this.failed){this.iterations++;try{this._step()}catch(e){throw this.error=`${this.getSolverName()} error: ${e}`,console.error(this.error),this.failed=!0,e}!this.solved&&this.iterations>this.MAX_ITERATIONS&&this.tryFinalAcceptance(),!this.solved&&this.iterations>this.MAX_ITERATIONS&&(this.error=`${this.getSolverName()} ran out of iterations (MAX_ITERATIONS=${this.MAX_ITERATIONS})`,this.failed=!0),"computeProgress"in this&&(this.progress=this.computeProgress())}}_step(){}getConstructorParams(){throw Error("getConstructorParams not implemented")}solve(){let e=Date.now();for(;!this.solved&&!this.failed;)this.step();let t=Date.now();this.timeToSolve=t-e}visualize(){return{lines:[],points:[],rects:[],circles:[]}}tryFinalAcceptance(){}preview(){return{lines:[],points:[],rects:[],circles:[]}}},uVt=class{tree;constructor(e=9){this.tree=new gV(e)}insert(e,t,n,o,r){this.tree.insert({minX:t,minY:n,maxX:o,maxY:r,data:e})}bulkLoad(e){let t=e.map(({item:n,minX:o,minY:r,maxX:i,maxY:s})=>({minX:o,minY:r,maxX:i,maxY:s,data:n}));this.tree.load(t)}search(e,t,n,o){return this.tree.search({minX:e,minY:t,maxX:n,maxY:o}).map((r)=>r.data)}clear(){this.tree.clear()}},Bsn=class{index;items=[];currentIndex=0;capacity;constructor(e){this.capacity=Math.max(1,e),this.index=new i_(this.capacity)}insert(e,t,n,o,r){if(this.currentIndex>=this.index.numItems)throw Error("Exceeded initial capacity");this.items[this.currentIndex]=e,this.index.add(t,n,o,r),this.currentIndex++}finish(){this.index.finish()}search(e,t,n,o){return this.index.search(e,t,n,o).map((r)=>this.items[r]||null).filter(Boolean)}clear(){this.items=[],this.currentIndex=0,this.index=new i_(this.capacity)}},WJe=class{idx;storage=[];constructor(e="native",t=[]){e==="flatbush"?t.length===0?(this.idx=new uVt,e="rbush"):this.idx=new Bsn(t.length):this.idx=e==="rbush"?new uVt:new class{shi=new txr(t);insert(n){}search(n,o,r,i){let s=(n+r)/2,a=(o+i)/2,c=r-n,l=i-o;return this.shi.getNodesInArea(s,a,c,l)}clear(){}},t.forEach((n)=>this.insert(n)),e==="flatbush"&&t.length>0&&this.idx.finish?.()}insert(e){this.storage.push(e),this.idx.insert(e,e.center.x-e.width/2,e.center.y-e.height/2,e.center.x+e.width/2,e.center.y+e.height/2)}search(e){return this.idx.search(e.minX,e.minY,e.maxX,e.maxY)}searchArea(e,t,n,o){return this.search({minX:e-n/2,minY:t-o/2,maxX:e+n/2,maxY:t+o/2})}},txr=class{constructor(e){this.obstacles=e,this.buckets=new Map;for(let t=0;t<e.length;t++){let n=e[t],o=n.center.x-n.width/2,r=n.center.y-n.height/2,i=n.center.x+n.width/2,s=n.center.y+n.height/2;for(let a=o;a<=i;a+=this.CELL_SIZE)for(let c=r;c<=s;c+=this.CELL_SIZE){let l=this.getBucketKey(a,c),h=this.buckets.get(l);h?h.push([n,t]):this.buckets.set(l,[[n,t]])}}}obstacles;buckets;CELL_SIZE=0.4;getBucketKey(e,t){return`${Math.floor(e/this.CELL_SIZE)}x${Math.floor(t/this.CELL_SIZE)}`}getNodesInArea(e,t,n,o){let r=[],i=new Set,s=t-o/2,a=e+n/2,c=t+o/2;for(let l=e-n/2;l<=a;l+=this.CELL_SIZE)for(let h=s;h<=c;h+=this.CELL_SIZE){let d=this.getBucketKey(l,h),u=this.buckets.get(d)||[];for(let _ of u)i.has(_[1])||(i.add(_[1]),r.push(_[0]))}return r}},o3e=(e)=>({minX:Math.min(e[0].x,e[1].x),maxX:Math.max(e[0].x,e[1].x),minY:Math.min(e[0].y,e[1].y),maxY:Math.max(e[0].y,e[1].y)});function cCe(e,t){let n=e.x-t.x,o=e.y-t.y;return n*n+o*o}function kO(e,t,n){let o=cCe(t,n);if(o===0)return cCe(e,t);let r=((e.x-t.x)*(n.x-t.x)+(e.y-t.y)*(n.y-t.y))/o;return r=Math.max(0,Math.min(1,r)),cCe(e,{x:t.x+r*(n.x-t.x),y:t.y+r*(n.y-t.y)})}function pVt(e,t,n,o){if(su(e,t,n,o))return 0;let r={x:e.x,y:e.y},i={x:t.x,y:t.y},s={x:n.x,y:n.y},a={x:o.x,y:o.y};return Math.min(kO(r,s,a),kO(i,s,a),kO(s,r,i),kO(a,r,i))}var LO=class{segmentBuckets;viaBuckets;CELL_SIZE;maximumCopperRadius=0;constructor(e,t=1){this.segmentBuckets=new Map,this.viaBuckets=new Map,this.CELL_SIZE=t;for(let n of e)if(n&&n.connectionName){if(this.maximumCopperRadius=Math.max(this.maximumCopperRadius,n.traceThickness/2,n.viaDiameter/2),n.route&&n.route.length>=2)for(let o=0;o<n.route.length-1;o++){let r=n.route[o],i=n.route[o+1];if(r.x===i.x&&r.y===i.y)continue;if(r.insideJumperPad&&i.insideJumperPad)continue;let s=[r,i],a=o3e(s),c={segmentId:`${n.connectionName}-seg-${o}`,segment:s,parentRoute:n},l=Math.floor(a.minX/this.CELL_SIZE),h=Math.floor((a.maxX+0.000000001)/this.CELL_SIZE),d=Math.floor(a.minY/this.CELL_SIZE),u=Math.floor((a.maxY+0.000000001)/this.CELL_SIZE);for(let _=l;_<=h;_++)for(let p=d;p<=u;p++){let m=`${_}x${p}`,A=this.segmentBuckets.get(m);A||(A=[],this.segmentBuckets.set(m,A)),A.push(c)}}if(n.vias&&n.vias.length>0)for(let o=0;o<n.vias.length;o++){let r=n.vias[o];if(r==null)continue;let i={viaId:`${n.connectionName}-via-${o}`,x:r.x,y:r.y,parentRoute:n},s=`${Math.floor(r.x/this.CELL_SIZE)}x${Math.floor(r.y/this.CELL_SIZE)}`,a=this.viaBuckets.get(s);a||(a=[],this.viaBuckets.set(s,a)),a.push(i)}}else console.warn("Skipping route with missing data:",n)}hasConflictingRoutesForSegment(e,t,n,o,r){let i=o3e([e,t]),s=n+this.maximumCopperRadius,a=Math.floor((i.minX-s)/this.CELL_SIZE),c=Math.floor((i.maxX+s+0.000000001)/this.CELL_SIZE),l=Math.floor((i.minY-s)/this.CELL_SIZE),h=Math.floor((i.maxY+s+0.000000001)/this.CELL_SIZE),d=new Set,u=new Set;for(let _=a;_<=c;_++)for(let p=l;p<=h;p++){let m=`${_}x${p}`,A=this.segmentBuckets.get(m);if(A)for(let f of A){let y=f.parentRoute,[x,C]=f.segment;if(e.z!==t.z||x.z!==C.z||x.z!==e.z||o(y)||d.has(f.segmentId))continue;d.add(f.segmentId);let b=n+y.traceThickness/2,I=pVt(e,t,x,C);if(I<b*b&&(!r||Math.sqrt(I)<r(y)))return!0}let g=this.viaBuckets.get(m);if(g)for(let f of g){let y=f.parentRoute;if(o(y)||u.has(f.viaId))continue;u.add(f.viaId);let x=n+y.viaDiameter/2,C=kO(f,e,t);if(C<x*x&&(!r||Math.sqrt(C)<r(y)))return!0}}return!1}getConflictingRoutesForSegment(e,t,n,o){let r=o3e([e,t]),i=n+this.maximumCopperRadius,s=r.minX-i,a=r.minY-i,c=r.maxX+i,l=r.maxY+i,h=Math.floor(s/this.CELL_SIZE),d=Math.floor((c+0.000000001)/this.CELL_SIZE),u=Math.floor(a/this.CELL_SIZE),_=Math.floor((l+0.000000001)/this.CELL_SIZE),p=new Map,m=new Set,A=new Set,g={x:e.x,y:e.y},f={x:t.x,y:t.y};for(let x=h;x<=d;x++)for(let C=u;C<=_;C++){let b=`${x}x${C}`,I=this.segmentBuckets.get(b);if(I)for(let P of I){if(m.has(P.segmentId))continue;m.add(P.segmentId);let M=P.parentRoute,[B,T]=P.segment;if(e.z!==t.z||B.z!==T.z||B.z!==e.z)continue;if(o?.(M))continue;let N=n+M.traceThickness/2,D=N*N,L=pVt(e,t,B,T);if(L<D){let H=M.connectionName,V=p.get(H);(!V||L<V.minDistSq)&&p.set(H,{route:M,minDistSq:L})}}let v=this.viaBuckets.get(b);if(v)for(let P of v){if(A.has(P.viaId))continue;A.add(P.viaId);let M=P.parentRoute;if(o?.(M))continue;let B={x:P.x,y:P.y},T=n+M.viaDiameter/2,N=T*T,D=kO(B,g,f);if(D<N){let L=M.connectionName,H=p.get(L);(!H||D<H.minDistSq)&&p.set(L,{route:M,minDistSq:D})}}}let y=[];for(let x of p.values())y.push({conflictingRoute:x.route,distance:Math.sqrt(x.minDistSq)});return y}removeRoute(e){for(let[t,n]of this.segmentBuckets){let o=n.filter((r)=>r.parentRoute.connectionName!==e);o.length===0?this.segmentBuckets.delete(t):o.length!==n.length&&this.segmentBuckets.set(t,o)}for(let[t,n]of this.viaBuckets){let o=n.filter((r)=>r.parentRoute.connectionName!==e);o.length===0?this.viaBuckets.delete(t):o.length!==n.length&&this.viaBuckets.set(t,o)}}addRoute(e){if(!e||!e.connectionName)return void console.warn("Skipping route with missing data:",e);if(this.maximumCopperRadius=Math.max(this.maximumCopperRadius,e.traceThickness/2,e.viaDiameter/2),e.route&&e.route.length>=2)for(let t=0;t<e.route.length-1;t++){let n=e.route[t],o=e.route[t+1];if(n.x===o.x&&n.y===o.y)continue;if(n.insideJumperPad&&o.insideJumperPad)continue;let r=[n,o],i=o3e(r),s={segmentId:`${e.connectionName}-seg-${t}`,segment:r,parentRoute:e},a=Math.floor(i.minX/this.CELL_SIZE),c=Math.floor((i.maxX+0.000000001)/this.CELL_SIZE),l=Math.floor(i.minY/this.CELL_SIZE),h=Math.floor((i.maxY+0.000000001)/this.CELL_SIZE);for(let d=a;d<=c;d++)for(let u=l;u<=h;u++){let _=`${d}x${u}`,p=this.segmentBuckets.get(_);p||(p=[],this.segmentBuckets.set(_,p)),p.push(s)}}if(e.vias&&e.vias.length>0)for(let t=0;t<e.vias.length;t++){let n=e.vias[t];if(n==null)continue;let o={viaId:`${e.connectionName}-via-${t}`,x:n.x,y:n.y,parentRoute:e},r=`${Math.floor(n.x/this.CELL_SIZE)}x${Math.floor(n.y/this.CELL_SIZE)}`,i=this.viaBuckets.get(r);i||(i=[],this.viaBuckets.set(r,i)),i.push(o)}}getConflictingRoutesNearPoint(e,t,n){let o=t+this.maximumCopperRadius,r=e.x-o,i=e.y-o,s=e.x+o,a=e.y+o,c=Math.floor(r/this.CELL_SIZE),l=Math.floor((s+0.000000001)/this.CELL_SIZE),h=Math.floor(i/this.CELL_SIZE),d=Math.floor((a+0.000000001)/this.CELL_SIZE),u=new Map,_=new Set,p=new Set;for(let A=c;A<=l;A++)for(let g=h;g<=d;g++){let f=`${A}x${g}`,y=this.segmentBuckets.get(f);if(y)for(let C of y){if(_.has(C.segmentId))continue;_.add(C.segmentId);let b=C.segment[0],I=C.segment[1];if(b.z!==I.z||b.z!==e.z)continue;let v=C.parentRoute,P={x:C.segment[0].x,y:C.segment[0].y},M={x:C.segment[1].x,y:C.segment[1].y},B=t+v.traceThickness/2,T=B*B,N=kO(e,P,M);if(N<T){let D=v.connectionName,L=u.get(D);(!L||N<L.minDistSq)&&u.set(D,{route:v,minDistSq:N})}}let x=this.viaBuckets.get(f);if(x)for(let C of x){if(p.has(C.viaId))continue;p.add(C.viaId);let b=C.parentRoute,I={x:C.x,y:C.y},v=t+b.viaDiameter/2,P=v*v,M=cCe(e,I);if(M<P){let B=b.connectionName,T=u.get(B);(!T||M<T.minDistSq)&&u.set(B,{route:b,minDistSq:M})}}}let m=[];for(let A of u.values())m.push({conflictingRoute:A.route,distance:Math.sqrt(A.minDistSq)});return m}},xce=(e,t)=>{let n=[],o=Math.abs(t.x-e.x),r=Math.abs(t.y-e.y),i=t.x>e.x?1:-1,s=t.y>e.y?1:-1,a={x:t.x-i*Math.abs(t.y-e.y),y:e.y};(a.x-e.x)*i>=0&&(a.x-t.x)*i<=0&&n.push([e,a,t]);let c={x:e.x,y:t.y-s*Math.abs(t.x-e.x)};(c.y-e.y)*s>=0&&(c.y-t.y)*s<=0&&n.push([e,c,t]);let l=Math.min(o,r),h={x:e.x+i*l,y:e.y+s*l};return(h.x-e.x)*i>=0&&(h.x-t.x)*i<=0&&(h.y-e.y)*s>=0&&(h.y-t.y)*s<=0&&n.push([e,h,t]),n},mVt=(e,t)=>{let n=Math.max(Math.abs(e),Math.abs(t));if(n===0||n===Number.POSITIVE_INFINITY)return n;let o=e/n,r=t/n;return n*Math.sqrt(o*o+r*r)};function Tsn(e,t,n,o){if(su(e,t,n,o))return 0;let r=r3e(e,n,o),i=r3e(t,n,o),s=r3e(n,e,t),a=r3e(o,e,t);return Math.min(r,i,s,a)}function r3e(e,t,n){let o={x:n.x-t.x,y:n.y-t.y},r=_Vt({x:e.x-t.x,y:e.y-t.y},o);if(r<=0)return OWe(e,t);let i=_Vt(o,o);if(i<=r)return OWe(e,n);let s=r/i;return OWe(e,{x:t.x+s*o.x,y:t.y+s*o.y})}function _Vt(e,t){return e.x*t.x+e.y*t.y}function OWe(e,t){let n=t.x-e.x,o=t.y-e.y;return Math.sqrt(n*n+o*o)}var qCe=0.000001,lKe=(e,t,n)=>oc(e,t,n)<=qCe,i3e=(e,t)=>Math.abs(e.x-t.x)<=qCe&&Math.abs(e.y-t.y)<=qCe,gVt=(e,t)=>{if(!t||t.length<3)return!1;for(let o=0;o<t.length;o++){let r=t[o],i=t[(o+1)%t.length];if(lKe(e,r,i))return!0}let n=!1;for(let o=0,r=t.length-1;o<t.length;r=o++){let i=t[o],s=t[r];i.y>e.y!=s.y>e.y&&e.x<(s.x-i.x)*(e.y-i.y)/(s.y-i.y)+i.x&&(n=!n)}return n},JCe=({start:e,end:t,polygon:n,margin:o=0.2})=>{if(!n||n.length<3)return!1;let r=gVt(e,n),i=gVt(t,n);if(!r||!i)return!0;for(let s=0;s<n.length;s++){let a=n[s],c=n[(s+1)%n.length],l=lKe(e,a,c),h=lKe(t,a,c);if(l&&h)continue;if(!su(e,t,a,c)){if(!l&&!h){if(Tsn(e,t,a,c)<o-qCe)return!0}continue}let d=vw(e,t,a,c);if((!d||!(l&&i3e(d,e)||h&&i3e(d,t)))&&(!d||!i3e(d,e)&&!i3e(d,t)))return!0}return!1},rce=(e)=>{let t=[],n=e.route;if(n.length===0)return[];let o={startIndex:0,endIndex:-1,z:n[0].z,points:[n[0]]};for(let r=1;r<n.length;r++)n[r].z===o.z?o.points.push(n[r]):(o.endIndex=r-1,t.push(o),o={startIndex:r,endIndex:-1,z:n[r].z,points:[n[r]]});return o.endIndex=n.length-1,t.push(o),t},AVt=({endpointX:e,endpointY:t,targetZ:n,endpointPcbPortId:o,terminalLayerIndicesByPcbPortId:r,obstacleSHI:i,route:s,connMap:a})=>{let c=o?r?.get(o):void 0;if(c&&!c.has(n))return!1;let l=[s.connectionName,s.rootConnectionName].filter((d)=>d!==void 0),h=i.searchArea(e,t,2,2).filter((d)=>{if(!l.some((A)=>d.connectedTo.some((g)=>g===A||a.areIdsConnected(A,g))))return!1;let u=d.width/2+0.05,_=d.height/2+0.05,p=Math.abs(e-d.center.x)<=u,m=Math.abs(t-d.center.y)<=_;return p&&m});return h.length>0&&h.some((d)=>d.__zLayers?.includes(n))},y$=({currentSection:e,targetZ:t,route:n,hdRouteSHI:o,obstacleSHI:r,connMap:i,defaultTraceThickness:s,obstacleMargin:a,traceMargin:c,shouldCheckStaticGeometryForSegment:l})=>{let h=n.traceThickness??s,d=c??0,u=[n.connectionName,n.rootConnectionName].filter((_)=>_!==void 0);for(let _=0;_<e.points.length-1;_++){let p={...e.points[_],z:t},m={...e.points[_+1],z:t},A=o.getConflictingRoutesForSegment(p,m,h/2+d);for(let{conflictingRoute:x,distance:C}of A){let b=[x.connectionName,x.rootConnectionName].filter((v)=>v!==void 0);if(u.some((v)=>b.some((P)=>P===v||i.areIdsConnected(P,v))))continue;let I=x.traceThickness??s;if(C<h/2+(d>0?Math.max(I/2,x.viaDiameter/2):I/2)+d)return!1}if(l?.(p,m)===!1)continue;let g={centerX:(p.x+m.x)/2,centerY:(p.y+m.y)/2,width:Math.abs(p.x-m.x),height:Math.abs(p.y-m.y)},f=h/2+a,y=r.searchArea(g.centerX,g.centerY,g.width+2*f,g.height+2*f);for(let x of y){if(u.some((C)=>x.connectedTo.some((b)=>b===C||i.areIdsConnected(b,C))))continue;if(x.__zLayers?.includes(t)){if(Math.abs(p.x-x.center.x)<0.01&&Math.abs(p.y-x.center.y)<0.01||Math.abs(m.x-x.center.x)<0.01&&Math.abs(m.y-x.center.y)<0.01)continue}if(iS(p,m,x)<f)return!1}}return!0},VWe=({targetZ:e,route:t,hdRouteSHI:n,obstacleSHI:o,connMap:r,defaultTraceThickness:i,obstacleMargin:s,traceMargin:a,useNumericSegmentKeys:c})=>{let l=t.traceThickness??i,h=l/2+a,d=l/2+s,{connectionName:u,rootConnectionName:_}=t,p=new Map,m=new WeakMap,A=new WeakMap,g=c?new Map:void 0,f=0,y=(v)=>{let P=g.get(v.x);P||(P=new Map,g.set(v.x,P));let M=P.get(v.y);return M===void 0&&(M=f++,P.set(v.y,M)),M},x=(v,P)=>{if(c){let M=y(v),B=y(P),T=Math.max(M,B);return T*(T+1)/2+Math.min(M,B)}return v.x<P.x||v.x===P.x&&v.y<=P.y?`${v.x}:${v.y}|${P.x}:${P.y}`:`${P.x}:${P.y}|${v.x}:${v.y}`},C=(v)=>v===u||r.areIdsConnected(v,u)||_!==void 0&&(v===_||r.areIdsConnected(v,_)),b=(v)=>{let P=A.get(v);return P===void 0&&(P=C(v.connectionName)||v.rootConnectionName!==void 0&&C(v.rootConnectionName),A.set(v,P)),P},I=(v)=>l/2+Math.max((v.traceThickness??i)/2,v.viaDiameter/2)+a;return(v,P)=>{let M=v.length-1;for(let B=0;B<M;B++){let T=B-1,N=P===0?B:B===0?P:T>=P?T+1:T,D=v[N],L=v[N+1],H=x(D,L),V=p.get(H);if(V!==void 0){if(!V)return!1;continue}let O=D.z===e?D:{...D,z:e},U=L.z===e?L:{...L,z:e},j={centerX:(O.x+U.x)/2,centerY:(O.y+U.y)/2,width:Math.abs(O.x-U.x),height:Math.abs(O.y-U.y)},Y=o.searchArea(j.centerX,j.centerY,j.width+2*d,j.height+2*d);for(let X of Y){let K=m.get(X);if(K===void 0&&(K=X.connectedTo.some(C),m.set(X,K)),K)continue;if(X.__zLayers?.includes(e)){if(Math.abs(O.x-X.center.x)<0.01&&Math.abs(O.y-X.center.y)<0.01||Math.abs(U.x-X.center.x)<0.01&&Math.abs(U.y-X.center.y)<0.01)continue}if(iS(O,U,X)<d)return p.set(H,!1),!1}if(n.hasConflictingRoutesForSegment(O,U,h,b,I))return p.set(H,!1),!1;p.set(H,!0)}return!0}},nxr=class extends EV{getSolverName(){return"SingleRouteUselessViaRemovalSolver"}obstacleSHI;hdRouteSHI;unsimplifiedRoute;connMap;outline;terminalLayerIndicesByPcbPortId;routeSections;currentSectionIndex;sameNetRouteCache=new WeakMap;detourContexts=new WeakMap;TRACE_THICKNESS=0.15;OBSTACLE_MARGIN=0.1;GEOMETRY_SHORTCUT_TRACE_MARGIN=0.1;GEOMETRY_SHORTCUT_OBSTACLE_MARGIN=0.15;MAX_GEOMETRY_SHORTCUT_ADDED_LENGTH=4;ENABLE_GEOMETRY_SHORTCUTS=!0;ENABLE_OBSTACLE_DETOUR_SHORTCUTS=!1;ENABLE_ROUTED_TRACE_DETOURS=!1;PRESERVE_ROUTE_ENDPOINTS=!1;geometryShortcutsApplied=0;multilayerSectionsCollapsed=0;obstacleDetourCandidatesValidated=0;constructor(e){super(),this.currentSectionIndex=0,this.obstacleSHI=e.obstacleSHI,this.hdRouteSHI=e.hdRouteSHI,this.unsimplifiedRoute=e.unsimplifiedRoute,this.connMap=e.connMap,this.outline=e.outline,this.terminalLayerIndicesByPcbPortId=e.terminalLayerIndicesByPcbPortId,this.GEOMETRY_SHORTCUT_TRACE_MARGIN=e.geometryShortcutTraceMargin??this.GEOMETRY_SHORTCUT_TRACE_MARGIN,this.GEOMETRY_SHORTCUT_OBSTACLE_MARGIN=e.geometryShortcutObstacleMargin??this.GEOMETRY_SHORTCUT_OBSTACLE_MARGIN,this.ENABLE_GEOMETRY_SHORTCUTS=e.enableGeometryShortcuts??!0,this.ENABLE_OBSTACLE_DETOUR_SHORTCUTS=e.enableObstacleDetourShortcuts??!1,this.ENABLE_ROUTED_TRACE_DETOURS=e.enableRoutedTraceDetours??!1,this.PRESERVE_ROUTE_ENDPOINTS=e.preserveRouteEndpoints??!1,this.routeSections=rce(this.unsimplifiedRoute)}getPathLength(e){let t=0;for(let n=1;n<e.length;n++)t+=mVt(e[n].x-e[n-1].x,e[n].y-e[n-1].y);return t}normalizeShortcutPath(e,t,n){let o=e.filter((r,i)=>{let s=e[i-1];return!s||r.x!==s.x||r.y!==s.y});return o.map((r,i)=>i===0?{...t}:i===o.length-1?{...n}:{x:r.x,y:r.y,z:t.z})}shortcutCrossesOutline(e){if(!this.outline||this.outline.length<3)return!1;for(let t=1;t<e.length;t++)if(JCe({start:e[t-1],end:e[t],polygon:this.outline}))return!0;return!1}isRouteOnSameNet(e){let t=this.sameNetRouteCache.get(e);if(t!==void 0)return t;let n=[this.unsimplifiedRoute.connectionName,this.unsimplifiedRoute.rootConnectionName].filter((i)=>i!==void 0),o=[e.connectionName,e.rootConnectionName].filter((i)=>i!==void 0),r=n.some((i)=>o.some((s)=>i===s||this.connMap.areIdsConnected(i,s)));return this.sameNetRouteCache.set(e,r),r}getObstacleDetourContext(e,t,n){let o=this.ENABLE_ROUTED_TRACE_DETOURS?this.detourContexts.get(e)?.get(t):void 0;if(o?.targetZ===n)return o;let r=this.unsimplifiedRoute.traceThickness??this.TRACE_THICKNESS,i=r/2+this.GEOMETRY_SHORTCUT_OBSTACLE_MARGIN+0.000001,s=this.MAX_GEOMETRY_SHORTCUT_ADDED_LENGTH/2+i,a=Math.min(e.x,t.x)-s,c=Math.max(e.x,t.x)+s,l=Math.min(e.y,t.y)-s,h=Math.max(e.y,t.y)+s,d=this.obstacleSHI.search({minX:a,minY:l,maxX:c,maxY:h}).filter((g)=>g.__zLayers?.includes(n)),u=this.ENABLE_ROUTED_TRACE_DETOURS?this.hdRouteSHI.getConflictingRoutesForSegment({...e,z:n},{...t,z:n},r/2+this.GEOMETRY_SHORTCUT_TRACE_MARGIN,(g)=>this.isRouteOnSameNet(g)):[],_=[],p=new Set,m=new Set;for(let g of d)p.add(g.center.x-g.width/2-i),p.add(g.center.x+g.width/2+i),m.add(g.center.y-g.height/2-i),m.add(g.center.y+g.height/2+i);for(let{conflictingRoute:g}of u){let f=g.route.filter((x)=>x.z===n&&x.x>=a&&x.x<=c&&x.y>=l&&x.y<=h);if(f.length===0)continue;let y=r/2+Math.max(g.traceThickness/2,g.viaDiameter/2)+this.GEOMETRY_SHORTCUT_TRACE_MARGIN+0.000001;p.add(Math.min(...f.map((x)=>x.x))-y),p.add(Math.max(...f.map((x)=>x.x))+y),m.add(Math.min(...f.map((x)=>x.y))-y),m.add(Math.max(...f.map((x)=>x.y))+y);{let x=Math.min(...f.map((v)=>v.x))-y,C=Math.max(...f.map((v)=>v.x))+y,b=Math.min(...f.map((v)=>v.y))-y,I=Math.max(...f.map((v)=>v.y))+y;_.push({x,y:b},{x,y:I},{x:C,y:b},{x:C,y:I})}}let A={targetZ:n,traceCorners:_,corridorXs:p,corridorYs:m};if(this.ENABLE_ROUTED_TRACE_DETOURS){let g=this.detourContexts.get(e)??new WeakMap;g.set(t,A),this.detourContexts.set(e,g)}return A}getObstacleDetourPaths(e,t,n,o,r=!1,i){let{traceCorners:s,corridorXs:a,corridorYs:c}=this.getObstacleDetourContext(e,t,n),l=[],h=new Set,d=(u)=>{let _=0;for(let f=1;f<u.length;f++)_+=mVt(u[f].x-u[f-1].x,u[f].y-u[f-1].y);if(_>o)return;if(i){let f=0,y=-1;for(let x=0;x<u.length-1;x++){let C=u[x+1].x-u[x].x,b=u[x+1].y-u[x].y,I=C*C+b*b;I>y&&(f=x,y=I)}if(!i([{...u[f],z:e.z},{...u[f+1],z:e.z}],0))return}let p=this.normalizeShortcutPath(u,e,t),m=0,A=-1;for(let f=0;f<p.length-1;f++){let y=p[f+1].x-p[f].x,x=p[f+1].y-p[f].y,C=y*y+x*x;C>A&&(m=f,A=C)}let g=p.map((f)=>`${f.x}:${f.y}`).join("|");h.has(g)||(h.add(g),l.push({path:p,length:_,longestSegmentIndex:m}))};if(r){for(let u of s)for(let _ of xce(e,u))for(let p of xce(u,t))d([..._,...p.slice(1)]);return l}for(let u of c)d([e,{x:e.x,y:u},{x:t.x,y:u},t]);for(let u of a)d([e,{x:u,y:e.y},{x:u,y:t.y},t]);return l}getDirectGeometryShortcut(e,t,n){let o=null,r=VWe({targetZ:e.z,route:this.unsimplifiedRoute,hdRouteSHI:this.hdRouteSHI,obstacleSHI:this.obstacleSHI,connMap:this.connMap,defaultTraceThickness:this.TRACE_THICKNESS,obstacleMargin:this.GEOMETRY_SHORTCUT_OBSTACLE_MARGIN,traceMargin:this.GEOMETRY_SHORTCUT_TRACE_MARGIN,useNumericSegmentKeys:!0});for(let i=0;i<e.points.length;i++){let s=e.points[i];for(let a=0;a<n.points.length;a++){let c=n.points[a],l=[...e.points.slice(i),...t.points,...n.points.slice(0,a+1)];if(!l.some((h)=>h.insideJumperPad||h.toNextSegmentType))for(let h of xce(s,c)){let d=this.normalizeShortcutPath(h,s,c),u=this.getPathLength(l)-this.getPathLength(d);if(u<-0.000001)continue;r(d,0)&&!this.shortcutCrossesOutline(d)&&((!o||u>o.savedLength)&&(o={path:d,previousPointIndex:i,nextPointIndex:a,savedLength:u}))}}}return o}getObstacleDetourShortcut(e,t,n,o=!1){let r=e.points.length-1,i=[];for(let d=0;d<=r;d++)i.push([d,0]);for(let d=1;d<n.points.length;d++)i.push([r,d]);let s=this.ENABLE_ROUTED_TRACE_DETOURS?VWe({targetZ:e.z,route:this.unsimplifiedRoute,hdRouteSHI:this.hdRouteSHI,obstacleSHI:this.obstacleSHI,connMap:this.connMap,defaultTraceThickness:this.TRACE_THICKNESS,obstacleMargin:this.GEOMETRY_SHORTCUT_OBSTACLE_MARGIN,traceMargin:this.GEOMETRY_SHORTCUT_TRACE_MARGIN,useNumericSegmentKeys:!0}):void 0,a=[];for(let[d,u]of i){let _=e.points[d],p=n.points[u],m=[...e.points.slice(d),...t.points,...n.points.slice(0,u+1)];if(m.some((g)=>g.insideJumperPad||g.toNextSegmentType))continue;let A=this.getPathLength(m);for(let{path:g,length:f,longestSegmentIndex:y}of this.getObstacleDetourPaths(_,p,e.z,A+this.MAX_GEOMETRY_SHORTCUT_ADDED_LENGTH+0.000001,o,s)){let x=A-f;x<-this.MAX_GEOMETRY_SHORTCUT_ADDED_LENGTH-0.000001||a.push({path:g,previousPointIndex:d,nextPointIndex:u,savedLength:x,validationFirstSegmentIndex:y})}}a.sort((d,u)=>u.savedLength-d.savedLength);let c=0,l=a.length>=256,h=s??VWe({targetZ:e.z,route:this.unsimplifiedRoute,hdRouteSHI:this.hdRouteSHI,obstacleSHI:this.obstacleSHI,connMap:this.connMap,defaultTraceThickness:this.TRACE_THICKNESS,obstacleMargin:this.GEOMETRY_SHORTCUT_OBSTACLE_MARGIN,traceMargin:this.GEOMETRY_SHORTCUT_TRACE_MARGIN,useNumericSegmentKeys:l});for(let d of a){c++;let{path:u}=d;if(h(u,d.validationFirstSegmentIndex??0)&&!this.shortcutCrossesOutline(u))return this.obstacleDetourCandidatesValidated+=c,this.stats.obstacleDetourCandidatesValidated=this.obstacleDetourCandidatesValidated,d}return this.obstacleDetourCandidatesValidated+=c,this.stats.obstacleDetourCandidatesValidated=this.obstacleDetourCandidatesValidated,null}findGeometryShortcut(e,t,n){if(this.detourContexts=new WeakMap,this.unsimplifiedRoute.jumpers?.length)return null;if(this.ENABLE_GEOMETRY_SHORTCUTS){let r=this.getDirectGeometryShortcut(e,t,n);if(r)return r}if(!this.ENABLE_OBSTACLE_DETOUR_SHORTCUTS)return null;let o=this.getObstacleDetourShortcut(e,t,n);return o||!this.ENABLE_ROUTED_TRACE_DETOURS?o:this.getObstacleDetourShortcut(e,t,n,!0)}applyGeometryShortcut(e){let t=this.routeSections[this.currentSectionIndex-1],n=this.routeSections[this.currentSectionIndex+1],o=[...t.points.slice(0,e.previousPointIndex),...e.path,...n.points.slice(e.nextPointIndex+1)].filter((r,i,s)=>{let a=s[i-1];return!a||r.x!==a.x||r.y!==a.y||r.z!==a.z});this.routeSections.splice(this.currentSectionIndex-1,3,{startIndex:t.startIndex,endIndex:n.endIndex,z:t.z,points:o}),this.geometryShortcutsApplied++,this.stats.geometryShortcutsApplied=this.geometryShortcutsApplied,this.stats.viasRemovedByGeometryShortcuts=2*this.geometryShortcutsApplied,this.currentSectionIndex=Math.max(0,this.currentSectionIndex-1)}findMultilayerSectionCollapse(e,t,n){if(e.z===n.z||this.unsimplifiedRoute.jumpers?.length)return null;let o=e.points[e.points.length-1];if(o?.insideJumperPad||o?.toNextSegmentType||t.points.some((i)=>i.insideJumperPad||i.toNextSegmentType))return null;let r=[{targetZ:e.z,mergeWith:"previous"},{targetZ:n.z,mergeWith:"next"}];for(let i of r)if(i.targetZ!==t.z&&y$({currentSection:t,targetZ:i.targetZ,route:this.unsimplifiedRoute,hdRouteSHI:this.hdRouteSHI,obstacleSHI:this.obstacleSHI,connMap:this.connMap,defaultTraceThickness:this.TRACE_THICKNESS,obstacleMargin:this.GEOMETRY_SHORTCUT_OBSTACLE_MARGIN,traceMargin:this.GEOMETRY_SHORTCUT_TRACE_MARGIN}))return i;return null}applyMultilayerSectionCollapse(e){let t=this.routeSections[this.currentSectionIndex-1],n=this.routeSections[this.currentSectionIndex],o=this.routeSections[this.currentSectionIndex+1],r=n.points.map((s)=>({...s,z:e.targetZ})),i=(s)=>s.filter((a,c)=>{let l=s[c-1];return!l||a.x!==l.x||a.y!==l.y||a.z!==l.z});e.mergeWith==="previous"?this.routeSections.splice(this.currentSectionIndex-1,2,{startIndex:t.startIndex,endIndex:n.endIndex,z:e.targetZ,points:i([...t.points,...r])}):this.routeSections.splice(this.currentSectionIndex,2,{startIndex:n.startIndex,endIndex:o.endIndex,z:e.targetZ,points:i([...r,...o.points])}),this.multilayerSectionsCollapsed++,this.stats.multilayerSectionsCollapsed=this.multilayerSectionsCollapsed,this.stats.viasRemovedByMultilayerSectionCollapses=this.multilayerSectionsCollapsed,this.currentSectionIndex=Math.max(0,this.currentSectionIndex-1)}_step(){if(this.currentSectionIndex>=this.routeSections.length)return void(this.solved=!0);if(this.currentSectionIndex===0&&this.routeSections.length>1){let i=this.routeSections[0],s=this.routeSections[1];if(!this.PRESERVE_ROUTE_ENDPOINTS&&i.z!==s.z){let a=s.z,c=i.points[0];if(AVt({endpointX:c.x,endpointY:c.y,targetZ:a,endpointPcbPortId:this.unsimplifiedRoute.startPcbPortId,terminalLayerIndicesByPcbPortId:this.terminalLayerIndicesByPcbPortId,obstacleSHI:this.obstacleSHI,route:this.unsimplifiedRoute,connMap:this.connMap})&&y$({currentSection:i,targetZ:a,route:this.unsimplifiedRoute,hdRouteSHI:this.hdRouteSHI,obstacleSHI:this.obstacleSHI,connMap:this.connMap,defaultTraceThickness:this.TRACE_THICKNESS,obstacleMargin:this.OBSTACLE_MARGIN}))return i.z=a,i.points=i.points.map((l)=>({...l,z:a})),void(this.currentSectionIndex=2)}return void this.currentSectionIndex++}if(this.currentSectionIndex===this.routeSections.length-1){if(!this.PRESERVE_ROUTE_ENDPOINTS&&this.routeSections.length>=2){let i=this.routeSections[this.routeSections.length-1],s=this.routeSections[this.routeSections.length-2];if(i.z!==s.z){let a=s.z,c=i.points[i.points.length-1];AVt({endpointX:c.x,endpointY:c.y,targetZ:a,endpointPcbPortId:this.unsimplifiedRoute.endPcbPortId,terminalLayerIndicesByPcbPortId:this.terminalLayerIndicesByPcbPortId,obstacleSHI:this.obstacleSHI,route:this.unsimplifiedRoute,connMap:this.connMap})&&y$({currentSection:i,targetZ:a,route:this.unsimplifiedRoute,hdRouteSHI:this.hdRouteSHI,obstacleSHI:this.obstacleSHI,connMap:this.connMap,defaultTraceThickness:this.TRACE_THICKNESS,obstacleMargin:this.OBSTACLE_MARGIN})&&(i.z=a,i.points=i.points.map((l)=>({...l,z:a})))}}return void(this.solved=!0)}let e=this.routeSections[this.currentSectionIndex-1],t=this.routeSections[this.currentSectionIndex],n=this.routeSections[this.currentSectionIndex+1];if(e.z!==n.z){let i=this.findMultilayerSectionCollapse(e,t,n);return i?void this.applyMultilayerSectionCollapse(i):void this.currentSectionIndex++}let o=e.z;if(y$({currentSection:t,targetZ:o,route:this.unsimplifiedRoute,hdRouteSHI:this.hdRouteSHI,obstacleSHI:this.obstacleSHI,connMap:this.connMap,defaultTraceThickness:this.TRACE_THICKNESS,obstacleMargin:this.OBSTACLE_MARGIN}))return t.z=o,t.points=t.points.map((i)=>({...i,z:o})),void(this.currentSectionIndex+=2);let r=this.findGeometryShortcut(e,t,n);r?this.applyGeometryShortcut(r):this.currentSectionIndex++}getConstructorParams(){return{obstacleSHI:this.obstacleSHI,hdRouteSHI:this.hdRouteSHI,unsimplifiedRoute:this.unsimplifiedRoute,connMap:this.connMap,outline:this.outline,geometryShortcutTraceMargin:this.GEOMETRY_SHORTCUT_TRACE_MARGIN,geometryShortcutObstacleMargin:this.GEOMETRY_SHORTCUT_OBSTACLE_MARGIN,enableGeometryShortcuts:this.ENABLE_GEOMETRY_SHORTCUTS,enableObstacleDetourShortcuts:this.ENABLE_OBSTACLE_DETOUR_SHORTCUTS,enableRoutedTraceDetours:this.ENABLE_ROUTED_TRACE_DETOURS,preserveRouteEndpoints:this.PRESERVE_ROUTE_ENDPOINTS,terminalLayerIndicesByPcbPortId:this.terminalLayerIndicesByPcbPortId}}getOptimizedHdRoute(){let e=this.routeSections.flatMap((n)=>n.points),t=[];for(let n=0;n<e.length-1;n++)e[n].z!==e[n+1].z&&t.push({x:e[n].x,y:e[n].y});return{connectionName:this.unsimplifiedRoute.connectionName,rootConnectionName:this.unsimplifiedRoute.rootConnectionName,startPcbPortId:this.unsimplifiedRoute.startPcbPortId,endPcbPortId:this.unsimplifiedRoute.endPcbPortId,route:e,traceThickness:this.unsimplifiedRoute.traceThickness,vias:t,viaDiameter:this.unsimplifiedRoute.viaDiameter,jumpers:this.unsimplifiedRoute.jumpers}}visualize(){let e={circles:[],lines:[],points:[],rects:[],coordinateSystem:"cartesian",title:"Single Route Useless Via Removal Solver"};for(let t=0;t<this.routeSections.length;t++){let n=this.routeSections[t];e.lines.push({points:n.points,strokeWidth:this.TRACE_THICKNESS,strokeColor:t===this.currentSectionIndex?"orange":n.z===0?"red":"blue"})}return e}},fVt=(e,t)=>{try{return d$(t,e)}catch(n){return console.error(n),e}},_q={"0603":{length:1.65,width:0.95,padLength:0.8,padWidth:0.95},1206:{length:3.2,width:1.6,padLength:0.6,padWidth:1.6},"1206x4_pair":{length:2.7,width:0.5,padLength:0.8,padWidth:0.5}};function oxr(e,t={}){let n=[],o=[],r=t.color??"gray",i=t.label,s=_q[e.footprint]??_q["0603"],a=e.end.x-e.start.x,c=e.end.y-e.start.y,l=Math.abs(a)>Math.abs(c),h=l?s.padLength:s.padWidth,d=l?s.padWidth:s.padLength;return n.push({center:e.start,width:h,height:d,fill:fVt(r,0.5),stroke:"rgba(0, 0, 0, 0.5)",layer:"jumper",label:i?`${i} (start)`:void 0}),n.push({center:e.end,width:h,height:d,fill:fVt(r,0.5),stroke:"rgba(0, 0, 0, 0.5)",layer:"jumper",label:i?`${i} (end)`:void 0}),o.push({points:[e.start,e.end],strokeColor:"rgba(100, 100, 100, 0.8)",strokeWidth:0.3*s.padWidth,layer:"jumper-body"}),{rects:n,lines:o}}function XJe(e,t={}){let n={rects:[],lines:[]};for(let o of e){let{rects:r,lines:i}=oxr(o,t);n.rects.push(...r),n.lines.push(...i)}return n}function Dsn(e,t){return[...new Set(e)].filter((n)=>Number.isInteger(n)&&n>=0&&n<t).sort((n,o)=>n-o)}function rxr(e,t){return Dsn(e.map((n)=>((o,r)=>o==="top"?0:o==="bottom"?r-1:parseInt(o.slice(5)))(n,t)),t)}var Lle=(e,t=2)=>{let n=Array.from({length:t},(o,r)=>r);return e.map((o)=>{let r=Dsn(o.__zLayers??(o.layers?rxr(o.layers,t):void 0)??n,t);return{...o,__zLayers:r.length>0?r:n}})},Nsn=class extends EV{constructor(e){super(),this.input=e,this.input={...e,obstacles:Lle(e.obstacles,e.layerCount)},this.MAX_ITERATIONS=1e6,this.unsimplifiedHdRoutes=e.unsimplifiedHdRoutes,this.optimizedHdRoutes=[],this.unprocessedRoutes=[...e.unsimplifiedHdRoutes],this.obstacleSHI=new WJe("flatbush",this.input.obstacles),this.hdRouteSHI=new LO([...this.unsimplifiedHdRoutes,...e.otherHdRoutes??[]])}input;getSolverName(){return"UselessViaRemovalSolver"}unsimplifiedHdRoutes;optimizedHdRoutes;unprocessedRoutes;activeSubSolver=null;obstacleSHI=null;hdRouteSHI=null;_step(){if(this.activeSubSolver){if(this.activeSubSolver.step(),this.activeSubSolver.solved){let t=this.activeSubSolver.getOptimizedHdRoute();this.hdRouteSHI.removeRoute(t.connectionName),this.hdRouteSHI.addRoute(t),this.optimizedHdRoutes.push(t),this.activeSubSolver=null}else(this.activeSubSolver.failed||this.activeSubSolver.error)&&(this.error=this.activeSubSolver.error,this.failed=!0);return}let e=this.unprocessedRoutes.shift();e?this.activeSubSolver=new nxr({hdRouteSHI:this.hdRouteSHI,obstacleSHI:this.obstacleSHI,unsimplifiedRoute:e,connMap:this.input.connMap,outline:this.input.outline,geometryShortcutTraceMargin:this.input.geometryShortcutTraceMargin,geometryShortcutObstacleMargin:this.input.geometryShortcutObstacleMargin,enableGeometryShortcuts:this.input.enableGeometryShortcuts,enableObstacleDetourShortcuts:this.input.enableObstacleDetourShortcuts,enableRoutedTraceDetours:this.input.enableRoutedTraceDetours,preserveRouteEndpoints:this.input.preserveRouteEndpoints,terminalLayerIndicesByPcbPortId:this.input.terminalLayerIndicesByPcbPortId}):this.solved=!0}getOptimizedHdRoutes(){return this.optimizedHdRoutes}visualize(){let e={lines:[],points:[],rects:[],circles:[],coordinateSystem:"cartesian",title:"Useless Via Removal Solver"};for(let t of this.input.obstacles){let n="rgba(128, 128, 128, 0.2)",o=t.__zLayers?.includes(0),r=t.__zLayers?.includes(1);o&&r?n="rgba(128, 0, 128, 0.2)":o?n="rgba(255, 0, 0, 0.2)":r&&(n="rgba(0, 0, 255, 0.2)"),e.rects.push({center:t.center,width:t.width,height:t.height,fill:n,label:`Obstacle (Z: ${t.__zLayers?.join(", ")})`})}for(let t of this.optimizedHdRoutes){if(t.route.length===0)continue;let n=this.input.colorMap[t.connectionName]||"#888888";for(let o=0;o<t.route.length-1;o++){let r=t.route[o],i=t.route[o+1];r.z===i.z&&e.lines.push({points:[{x:r.x,y:r.y},{x:i.x,y:i.y}],strokeColor:r.z===0?"red":"blue",strokeWidth:t.traceThickness,label:`${t.connectionName} (z=${r.z})`})}for(let o of t.vias)e.circles.push({center:{x:o.x,y:o.y},radius:t.viaDiameter/2,fill:"rgba(255, 0, 255, 0.5)",label:`${t.connectionName} via`});if(t.jumpers&&t.jumpers.length>0){let o=XJe(t.jumpers,{color:n,label:t.connectionName});e.rects.push(...o.rects??[]),e.lines.push(...o.lines??[])}}return this.activeSubSolver&&e.lines.push(...this.activeSubSolver.visualize().lines??[]),e}},ixr=class{netMap;idToNetMap;constructor(e){this.netMap=e,this.idToNetMap={};for(let[t,n]of Object.entries(e))for(let o of n)this.idToNetMap[o]=t}addConnections(e){for(let t of e){let n=new Set;for(let r of t){let i=this.idToNetMap[r];i&&n.add(i)}let o;if(n.size===0)o=`connectivity_net${Object.keys(this.netMap).length}`,this.netMap[o]=[];else if(n.size===1)o=n.values().next().value??`connectivity_net${Object.keys(this.netMap).length}`;else{o=n.values().next().value??`connectivity_net${Object.keys(this.netMap).length}`;for(let r of n)if(r!==o){this.netMap[o].push(...this.netMap[r]),this.netMap[r]=this.netMap[o];for(let i of this.netMap[o])this.idToNetMap[i]=o}}for(let r of t)this.netMap[o].includes(r)||this.netMap[o].push(r),this.idToNetMap[r]=o}}getIdsConnectedToNet(e){return this.netMap[e]||[]}getNetConnectedToId(e){return this.idToNetMap[e]}areIdsConnected(e,t){if(e===t)return!0;let n=this.getNetConnectedToId(e);if(!n)return!1;let o=this.getNetConnectedToId(t);return!!o&&(n===o||o===e||o===e)}areAllIdsConnected(e){let t=this.getNetConnectedToId(e[0]);for(let n of e){let o=this.getNetConnectedToId(n);if(o===void 0)return!1;if(o!==t)return!1}return!0}},sxr=class extends EV{getSolverName(){return"SingleSimplifiedPathSolver"}newRoute;newVias;headIndex=0;tailIndex=0;inputRoute;otherHdRoutes;obstacles;connMap;colorMap;outline;minBoardEdgeClearance;constructor(e){super(),this.inputRoute=e.inputRoute,this.otherHdRoutes=e.otherHdRoutes,this.obstacles=e.obstacles,this.connMap=e.connMap,this.colorMap=e.colorMap,this.outline=e.outline,this.minBoardEdgeClearance=e.minBoardEdgeClearance??0.2,this.newRoute=[this.inputRoute.route[0]],this.newVias=[]}getConstructorParams(){return{inputRoute:this.inputRoute,otherHdRoutes:this.otherHdRoutes,obstacles:this.obstacles,connMap:this.connMap.netMap,colorMap:this.colorMap,outline:this.outline,minBoardEdgeClearance:this.minBoardEdgeClearance}}get simplifiedRoute(){return{connectionName:this.inputRoute.connectionName,rootConnectionName:this.inputRoute.rootConnectionName,startPcbPortId:this.inputRoute.startPcbPortId,endPcbPortId:this.inputRoute.endPcbPortId,traceThickness:this.inputRoute.traceThickness,viaDiameter:this.inputRoute.viaDiameter,route:this.newRoute,vias:this.newVias,jumpers:this.inputRoute.jumpers}}isValidPath(e){throw Error("Not implemented")}_step(){throw Error("Not implemented")}getVisualsForNewRouteAndObstacles(){let e={lines:[],points:[],circles:[],rects:[],coordinateSystem:"cartesian",title:"Simplified Path Solver"};for(let t=0;t<this.inputRoute.route.length-1;t++)e.lines.push({points:[{x:this.inputRoute.route[t].x,y:this.inputRoute.route[t].y},{x:this.inputRoute.route[t+1].x,y:this.inputRoute.route[t+1].y}],strokeColor:"rgba(255, 0, 0, 0.8)",strokeDash:this.inputRoute.route[t].z===1?"5, 5":void 0,layer:`z${this.inputRoute.route[t].z.toString()}`});for(let t=0;t<this.newRoute.length;t++)t<this.newRoute.length-1&&e.lines.push({points:[{x:this.newRoute[t].x,y:this.newRoute[t].y},{x:this.newRoute[t+1].x,y:this.newRoute[t+1].y}],strokeWidth:0.15,strokeColor:"rgba(0, 255, 0, 0.8)",strokeDash:this.newRoute[t].z===1?[0.4,0.4]:void 0,layer:`z${this.newRoute[t].z.toString()}`}),e.points.push({x:this.newRoute[t].x,y:this.newRoute[t].y,color:"rgba(0, 255, 0, 0.8)",label:`z: ${this.newRoute[t].z}`,layer:`z${this.newRoute[t].z.toString()}`});for(let t of this.newVias)e.circles.push({center:t,radius:this.inputRoute.viaDiameter/2,fill:"rgba(0, 0, 255, 0.5)"});for(let t of this.obstacles)e.rects.push({center:t.center,width:t.width,height:t.height,fill:t.layers?.includes("top")?"rgba(255, 0, 0, 0.3)":t.layers?.includes("bottom")?"rgba(0, 0, 255, 0.3)":"rgba(128, 128, 128, 0.3)"});for(let t of this.otherHdRoutes)for(let n=0;n<t.route.length-1;n++)e.lines.push({points:[{x:t.route[n].x,y:t.route[n].y},{x:t.route[n+1].x,y:t.route[n+1].y}],strokeWidth:0.15,strokeColor:t.route[n].z===0?"rgba(255, 0, 255, 0.5)":t.route[n].z===1?"rgba(128, 0, 128, 0.5)":"rgba(0, 0, 255, 0.5)",layer:`z${t.route[n].z.toString()}`});if("filteredObstaclePathSegments"in this){let t=this.filteredObstaclePathSegments;for(let[n,o]of t)e.lines.push({points:[n,o]})}return e}},axr=(e)=>({minX:Math.min(e[0].x,e[1].x),maxX:Math.max(e[0].x,e[1].x),minY:Math.min(e[0].y,e[1].y),maxY:Math.max(e[0].y,e[1].y)}),yVt=class{constructor(e,t=0.4){this.segments=e,this.buckets=new Map,this.SEGMENT_MARGIN=t;let n=new Map;for(let o of e){let r=this.getSegmentKey(o);if(n.has(r))continue;n.set(r,o);let i=axr(o),s=Math.floor(i.minX/this.CELL_SIZE),a=Math.floor(i.maxX/this.CELL_SIZE),c=Math.floor(i.minY/this.CELL_SIZE),l=Math.floor(i.maxY/this.CELL_SIZE);for(let h=s;h<=a;h++)for(let d=c;d<=l;d++){let u=`${h}x${d}`,_=this.buckets.get(u),p=[o[0],o[1],r];_?_.push(p):this.buckets.set(u,[p])}}}segments;buckets;CELL_SIZE=0.4;SEGMENT_MARGIN;getBucketKey(e,t){return`${Math.floor(e/this.CELL_SIZE)}x${Math.floor(t/this.CELL_SIZE)}`}getSegmentKey(e){return`${e[0].x}-${e[0].y}-${e[0].z}-${e[1].x}-${e[1].y}-${e[1].z}`}getSegmentsThatCouldIntersect(e,t){let n=[],o=new Set,r=Math.min(e.x,t.x)-this.SEGMENT_MARGIN,i=Math.min(e.y,t.y)-this.SEGMENT_MARGIN,s=Math.max(e.x,t.x)+this.SEGMENT_MARGIN,a=Math.max(e.y,t.y)+this.SEGMENT_MARGIN,c=Math.floor(r/this.CELL_SIZE),l=Math.floor(s/this.CELL_SIZE),h=Math.floor(i/this.CELL_SIZE),d=Math.floor(a/this.CELL_SIZE);for(let u=c;u<=l;u++)for(let _=h;_<=d;_++){let p=`${u}x${_}`,m=this.buckets.get(p);if(m)for(let A of m){let g=A[2];o.has(g)||(o.add(g),n.push(A))}}return n}},Rsn=class extends sxr{pathSegments=[];totalPathLength=0;headDistanceAlongPath=0;tailDistanceAlongPath=0;minStepSize=0.25;lastValidPath=null;lastValidPathHeadDistance=0;STEP_SIZE_REDUCTION_FACTOR=0.25;maxStepSize=4;currentStepSize=this.maxStepSize;lastHeadMoveDistance=0;cachedValidPathSegments;filteredObstacles=[];filteredObstaclePathSegments=[];traceThicknessByObstacleSegmentId=new Map;filteredVias=[];filteredJumperPads=[];jumperPadPointIndices=new Set;segmentTree;OBSTACLE_MARGIN=0.1;TRACE_THICKNESS=0.15;useTraceWidthAwareClearance=!1;clearanceTraceThickness=this.TRACE_THICKNESS;TAIL_JUMP_RATIO=0.8;isSameNetRoute(e){let t=[this.inputRoute.connectionName,this.inputRoute.rootConnectionName].filter((o)=>o!==void 0),n=[e.connectionName,e.rootConnectionName].filter((o)=>o!==void 0);return t.some((o)=>n.some((r)=>o===r||this.connMap.areIdsConnected(o,r)))}constructor(e){if(super(e),this.cachedValidPathSegments=new Set,this.useTraceWidthAwareClearance=e.useTraceWidthAwareClearance??!1,this.clearanceTraceThickness=this.useTraceWidthAwareClearance?this.inputRoute.traceThickness:this.TRACE_THICKNESS,this.inputRoute.route.length<=1)return this.newRoute=[...this.inputRoute.route],void(this.solved=!0);let t=this.inputRoute.route.reduce((l,h)=>(l.minX=Math.min(l.minX,h.x),l.maxX=Math.max(l.maxX,h.x),l.minY=Math.min(l.minY,h.y),l.maxY=Math.max(l.maxY,h.y),l),{minX:1/0,maxX:-1/0,minY:1/0,maxY:-1/0}),n=this.useTraceWidthAwareClearance?Math.max(0,...this.otherHdRoutes.flatMap((l)=>[l.traceThickness,...l.route.map((h)=>h.traceThickness??l.traceThickness)])):this.TRACE_THICKNESS,o=this.useTraceWidthAwareClearance?this.OBSTACLE_MARGIN+this.clearanceTraceThickness/2+n/2:this.OBSTACLE_MARGIN+this.TRACE_THICKNESS,r={center:{x:(t.minX+t.maxX)/2,y:(t.minY+t.maxY)/2},width:t.maxX-t.minX,height:t.maxY-t.minY},i=this.OBSTACLE_MARGIN+this.clearanceTraceThickness/2,s=e.geometryQuery?e.geometryQuery.index.getCandidateObstacles({minX:r.center.x-r.width/2,minY:r.center.y-r.height/2,maxX:r.center.x+r.width/2,maxY:r.center.y+r.height/2},i):this.obstacles,a=e.geometryQuery?e.geometryQuery.index.getCandidateRoutes(t,Math.max(o,i),e.geometryQuery.routeIndex):this.otherHdRoutes;this.filteredObstacles=s.filter((l)=>!l.connectedTo.some((h)=>this.connMap.areIdsConnected(this.inputRoute.connectionName,h))).filter((l)=>{if(l.connectedTo.some((h)=>this.connMap.areIdsConnected(this.inputRoute.connectionName,h)))return!1;return function(h,d){let u=Pi(h),_=Pi(d),p=Math.max(u.minX-_.maxX,_.minX-u.maxX,0),m=Math.max(u.minY-_.maxY,_.minY-u.maxY,0);return Math.hypot(p,m)}(r,l)<this.OBSTACLE_MARGIN+this.clearanceTraceThickness/2}),this.filteredObstaclePathSegments=a.flatMap((l)=>{if(this.isSameNetRoute(l))return[];let h=l.route,d=[];for(let u=0;u<h.length-1;u++){let _=h[u],p=h[u+1];if(AV(_,p,t)<=o){d.push([_,p]);let m=`${_.x}-${_.y}-${_.z}-${p.x}-${p.y}-${p.z}`;if(this.useTraceWidthAwareClearance){let A=Math.max(_.traceThickness??l.traceThickness,p.traceThickness??l.traceThickness);this.traceThicknessByObstacleSegmentId.set(m,Math.max(this.traceThicknessByObstacleSegmentId.get(m)??0,A))}}}return d}),this.segmentTree=this.useTraceWidthAwareClearance?new yVt(this.filteredObstaclePathSegments,o):new yVt(this.filteredObstaclePathSegments),this.filteredVias=a.flatMap((l)=>{if(this.isSameNetRoute(l))return[];let h=l.vias,d=[];for(let u of h){let _=this.OBSTACLE_MARGIN+this.clearanceTraceThickness/2+l.viaDiameter/2,p=u.x-_,m=u.x+_,A=u.y-_,g=u.y+_;p<=t.maxX&&m>=t.minX&&A<=t.maxY&&g>=t.minY&&d.push({...u,diameter:l.viaDiameter})}return d});let c=(l,h)=>{let d=[];for(let u of l){let _=_q[u.footprint]??_q["0603"],p=u.end.x-u.start.x,m=u.end.y-u.start.y,A=Math.abs(p)>Math.abs(m),g=A?_.padLength:_.padWidth,f=A?_.padWidth:_.padLength,y=this.OBSTACLE_MARGIN+this.clearanceTraceThickness/2;u.start.x-g/2-y<=t.maxX&&u.start.x+g/2+y>=t.minX&&u.start.y-f/2-y<=t.maxY&&u.start.y+f/2+y>=t.minY&&d.push({center:u.start,width:g,height:f,connectionName:h}),u.end.x-g/2-y<=t.maxX&&u.end.x+g/2+y>=t.minX&&u.end.y-f/2-y<=t.maxY&&u.end.y+f/2+y>=t.minY&&d.push({center:u.end,width:g,height:f,connectionName:h})}return d};if(this.filteredJumperPads=a.flatMap((l)=>this.isSameNetRoute(l)?[]:c(l.jumpers??[],l.connectionName)),this.inputRoute.jumpers&&this.inputRoute.jumpers.length>0){this.filteredJumperPads.push(...c(this.inputRoute.jumpers,this.inputRoute.connectionName));for(let l of this.inputRoute.jumpers)for(let h=0;h<this.inputRoute.route.length;h++){let d=this.inputRoute.route[h];(Math.abs(d.x-l.start.x)<0.01&&Math.abs(d.y-l.start.y)<0.01||Math.abs(d.x-l.end.x)<0.01&&Math.abs(d.y-l.end.y)<0.01)&&this.jumperPadPointIndices.add(h)}}this.computePathSegments()}computePathSegments(){let e=0;for(let t=0;t<this.inputRoute.route.length-1;t++){let n=this.inputRoute.route[t],o=this.inputRoute.route[t+1],r=Math.sqrt((o.x-n.x)**2+(o.y-n.y)**2)+t/1e4;this.pathSegments.push({start:n,end:o,length:r,startDistance:e,endDistance:e+r}),e+=r}this.totalPathLength=e}arePointsEqual(e,t){return e.x===t.x&&e.y===t.y&&e.z===t.z}getPointAtDistance(e){e=Math.max(0,Math.min(e,this.totalPathLength));let t=this.pathSegments.find((o)=>e>=o.startDistance&&e<=o.endDistance);if(!t)return this.inputRoute.route[this.inputRoute.route.length-1];let n=(e-t.startDistance)/t.length;return{x:t.start.x+n*(t.end.x-t.start.x),y:t.start.y+n*(t.end.y-t.start.y),z:n<0.5?t.start.z:t.end.z}}getNearestIndexForDistance(e){if(e<=0)return 0;if(e>=this.totalPathLength)return this.inputRoute.route.length-1;let t=this.pathSegments.findIndex((r)=>e>=r.startDistance&&e<=r.endDistance);if(t===-1)return 0;let n=this.pathSegments[t],o=(n.startDistance+n.endDistance)/2;return e>o?t+1:t}isValidPathSegment(e,t){for(let o of this.filteredObstacles){if(!o.__zLayers?.includes(e.z))continue;if(iS(e,t,o)<this.OBSTACLE_MARGIN+this.clearanceTraceThickness/2)return!1}let n=this.segmentTree.getSegmentsThatCouldIntersect(e,t);for(let[o,r,i]of n)if(o.z===e.z&&r.z===e.z){let s=Tsn({x:e.x,y:e.y},{x:t.x,y:t.y},{x:o.x,y:o.y},{x:r.x,y:r.y});if(!this.useTraceWidthAwareClearance){if(s<this.OBSTACLE_MARGIN+this.TRACE_THICKNESS)return!1;continue}let a=this.traceThicknessByObstacleSegmentId.get(i);if(a===void 0)throw Error(`Missing trace thickness for segment "${i}"`);if(s<this.OBSTACLE_MARGIN+this.clearanceTraceThickness/2+a/2)return!1}for(let o of this.filteredVias)if(oc(o,e,t)<this.OBSTACLE_MARGIN+o.diameter/2+this.clearanceTraceThickness/2)return!1;for(let o of this.filteredJumperPads)if(iS(e,t,o)<this.OBSTACLE_MARGIN+this.clearanceTraceThickness/2)return!1;if(this.outline&&this.outline.length>=3){if(JCe({start:{x:e.x,y:e.y},end:{x:t.x,y:t.y},polygon:this.outline,margin:this.minBoardEdgeClearance+this.inputRoute.traceThickness/2}))return!1}return!0}isValidPath(e){if(e.length<2)return!0;for(let t=0;t<e.length-1;t++)if(e[t].z!==e[t+1].z)return!1;for(let t=0;t<e.length-1;t++)if(!this.isValidPathSegment(e[t],e[t+1]))return!1;return!0}find45DegreePath(e,t){if(this.arePointsEqual(e,t))return[e];if(e.z!==t.z)return null;let n=xce({x:e.x,y:e.y},{x:t.x,y:t.y});for(let o of n){let r=o.map((i)=>({x:i.x,y:i.y,z:e.z}));if(this.isValidPath(r))return r}return null}addPathToResult(e){if(e.length!==0){for(let t=0;t<e.length;t++)t===0&&this.newRoute.length>0&&this.arePointsEqual(this.newRoute[this.newRoute.length-1],e[t])||this.newRoute.push(e[t]);this.currentStepSize=this.maxStepSize}}appendOriginalRouteSlice(e,t){let n=this.pathSegments.findIndex((o)=>e>=o.startDistance&&e<=o.endDistance);if(n===-1)throw Error(`Could not find path segment containing distance ${e}`);for(let o=n+1;o<=t&&o<this.inputRoute.route.length;o++){let r=this.inputRoute.route[o],i=this.newRoute[this.newRoute.length-1];i&&this.arePointsEqual(i,r)||this.newRoute.push({...r})}}moveHead(e){this.lastHeadMoveDistance=e,this.headDistanceAlongPath=Math.min(this.headDistanceAlongPath+e,this.totalPathLength)}stepBackAndReduceStepSize(){this.headDistanceAlongPath=Math.max(this.tailDistanceAlongPath,this.headDistanceAlongPath-this.lastHeadMoveDistance),this.currentStepSize=Math.max(this.minStepSize,this.currentStepSize*this.STEP_SIZE_REDUCTION_FACTOR)}_step(){let e=this.tailDistanceAlongPath>=this.totalPathLength,t=this.headDistanceAlongPath>=this.totalPathLength;if(e){let u=this.inputRoute.route[this.inputRoute.route.length-1];return this.newRoute.length!==0&&this.arePointsEqual(this.newRoute[this.newRoute.length-1],u)||this.newRoute.push(u),void(this.solved=!0)}if(t){let u=this.getPointAtDistance(this.tailDistanceAlongPath),_=this.inputRoute.route[this.inputRoute.route.length-1],p=this.find45DegreePath(u,_);if(p)return this.addPathToResult(p),void(this.solved=!0);let m=this.lastValidPath?this.lastValidPathHeadDistance:this.tailDistanceAlongPath;return this.lastValidPath&&(this.addPathToResult(this.lastValidPath),this.lastValidPath=null),this.getNearestIndexForDistance(m),this.appendOriginalRouteSlice(m,this.inputRoute.route.length-1),this.tailDistanceAlongPath=this.totalPathLength,this.headDistanceAlongPath=this.totalPathLength,void(this.solved=!0)}this.moveHead(this.currentStepSize);let n=this.getPointAtDistance(this.tailDistanceAlongPath),o=this.getPointAtDistance(this.headDistanceAlongPath),r=this.getNearestIndexForDistance(this.tailDistanceAlongPath),i=this.getNearestIndexForDistance(this.headDistanceAlongPath),s=!1,a=-1;for(let u=r;u<i;u++)if(u+1<this.inputRoute.route.length&&this.inputRoute.route[u].z!==this.inputRoute.route[u+1].z){s=!0;let _=u;a=this.pathSegments[_].startDistance;break}if(s&&this.lastHeadMoveDistance>this.minStepSize)return void this.stepBackAndReduceStepSize();let c=!1,l=-1,h=-1;for(let u=r+1;u<=i;u++)if(this.jumperPadPointIndices.has(u)){c=!0,l=u,h=u>0&&u-1<this.pathSegments.length?this.pathSegments[u-1].endDistance:this.pathSegments[0]?.startDistance??0;break}if(c&&this.lastHeadMoveDistance>this.minStepSize)return void this.stepBackAndReduceStepSize();if(c&&l>=0){let u=this.inputRoute.route[l];this.lastValidPath&&(this.addPathToResult(this.lastValidPath),this.lastValidPath=null);let _=this.newRoute[this.newRoute.length-1];return _&&_.x===u.x&&_.y===u.y||this.newRoute.push({x:u.x,y:u.y,z:u.z}),this.currentStepSize=this.maxStepSize,this.tailDistanceAlongPath=h,this.headDistanceAlongPath=this.tailDistanceAlongPath,this.lastValidPath=null,void(this.lastValidPathHeadDistance=this.tailDistanceAlongPath)}if(s&&a>0){let u=this.lastValidPath?this.lastValidPathHeadDistance:this.tailDistanceAlongPath,_=this.getNearestIndexForDistance(a)+1,p=this.inputRoute.route[_],m={x:p.x,y:p.y};this.lastValidPath&&(this.addPathToResult(this.lastValidPath),this.lastValidPath=null);let A=this.newRoute[this.newRoute.length-1],g={x:m.x,y:m.y,z:A.z};if(!this.arePointsEqual(A,g)){let y=this.find45DegreePath(A,g);y?this.addPathToResult(y):this.appendOriginalRouteSlice(u,_-1)}this.newVias.push(m),this.newRoute.push({x:m.x,y:m.y,z:p.z}),this.currentStepSize=this.maxStepSize;let f=this.pathSegments.findIndex((y)=>y.start===p);if(f!==-1)this.tailDistanceAlongPath=this.pathSegments[f].startDistance,this.headDistanceAlongPath=this.tailDistanceAlongPath,this.lastValidPath=null,this.lastValidPathHeadDistance=this.tailDistanceAlongPath;else if(_<this.inputRoute.route.length){if(_===this.inputRoute.route.length-1)return void(this.solved=!0);console.warn("Fallback used for tailDistanceAlongPath after layer change");let y=this.pathSegments.find((x)=>x.start===this.inputRoute.route[_]);y?(this.tailDistanceAlongPath=y.startDistance,this.headDistanceAlongPath=this.tailDistanceAlongPath,this.lastValidPath=null,this.lastValidPathHeadDistance=this.tailDistanceAlongPath):(console.error(`[${this.inputRoute.connectionName}] Could not find segment start after layer change. Path might be incomplete.
            Index sought: ${_}, Point: (${this.inputRoute.route[_].x.toFixed(3)}, ${this.inputRoute.route[_].y.toFixed(3)}, z=${this.inputRoute.route[_].z})
            Route Length: ${this.inputRoute.route.length}, Path Segments: ${this.pathSegments.length}`),this.solved=!0)}else console.warn("Layer change occurred at the end of the path."),this.solved=!0;return}let d=this.find45DegreePath(n,o);if(!d&&this.lastHeadMoveDistance>this.minStepSize)this.stepBackAndReduceStepSize();else{if(!d&&!this.lastValidPath){let u=this.getPointAtDistance(this.tailDistanceAlongPath);this.tailDistanceAlongPath+=this.minStepSize,this.moveHead(this.minStepSize);let _=this.getNearestIndexForDistance(this.tailDistanceAlongPath);for(let A=r;A<_;A++)if(this.inputRoute.route[A].z!==this.inputRoute.route[A+1].z){_=A;break}let p=this.inputRoute.route[_],m=this.inputRoute.route[this.inputRoute.route.length-1];return void(this.arePointsEqual(u,p)||this.arePointsEqual(p,m)||(this.newRoute.push(p),this.tailDistanceAlongPath=_===0?0:this.pathSegments[_-1].endDistance))}if(d)return this.lastValidPath=d,void(this.lastValidPathHeadDistance=this.headDistanceAlongPath);this.lastValidPath&&(this.addPathToResult(this.lastValidPath),this.lastValidPath=null,this.tailDistanceAlongPath=this.lastValidPathHeadDistance,this.moveHead(this.minStepSize))}}visualize(){let e=this.getVisualsForNewRouteAndObstacles(),t=this.getPointAtDistance(this.tailDistanceAlongPath),n=this.getPointAtDistance(this.headDistanceAlongPath);e.points.push({x:t.x,y:t.y,color:"yellow",label:["Tail",`z: ${t.z}`].join(`
`)}),e.points.push({x:n.x,y:n.y,color:"orange",label:["Head",`z: ${n.z}`].join(`
`)});let o=this.getPointAtDistance(this.headDistanceAlongPath+this.currentStepSize);e.points.push({x:o.x,y:o.y,color:"red",label:["Tentative Head",`z: ${o.z}`].join(`
`)});let r=0;for(;r<this.totalPathLength;){let i=this.getPointAtDistance(r);e.circles.push({center:{x:i.x,y:i.y},radius:0.05,fill:"rgba(100, 100, 100, 0.5)"}),r+=this.totalPathLength/20}if(this.lastValidPath&&this.lastValidPath.length>1)for(let i=0;i<this.lastValidPath.length-1;i++)e.lines.push({points:[{x:this.lastValidPath[i].x,y:this.lastValidPath[i].y},{x:this.lastValidPath[i+1].x,y:this.lastValidPath[i+1].y}],strokeColor:"rgba(0, 255, 255, 0.9)",strokeDash:"3, 3"});return e}},xVt=class extends Rsn{vertexIndex=0;constructor(e){super(e),this.newRoute=this.inputRoute.route.slice(0,1).map((t)=>({...t})),this.newVias=this.inputRoute.vias.map((t)=>({...t}))}getSolverName(){return"VertexShortcutPathSolver"}_step(){let e=this.inputRoute.route,t=e[this.vertexIndex];if(this.vertexIndex>=e.length-1)return void(this.solved=!0);let n=this.vertexIndex+1,o=[0];for(let r=this.vertexIndex;r<e.length-1;r++){let i=e[r],s=e[r+1];if(i.z!==s.z||i.toNextSegmentType||i.traceThickness!==s.traceThickness||i.traceThickness!==void 0&&i.traceThickness!==this.inputRoute.traceThickness||i.insideJumperPad||s.insideJumperPad)break;if(o.push(o.at(-1)+Math.hypot(s.x-i.x,s.y-i.y)),n=r+1,s.pcb_port_id||this.jumperPadPointIndices.has(n))break}for(let r=n;r>this.vertexIndex+1;r--){let i=e[r],s=o[r-this.vertexIndex];for(let a of xce(t,i)){let c=a.filter((h,d)=>d===0||h.x!==a[d-1].x||h.y!==a[d-1].y).map((h)=>({...h,z:t.z,traceThickness:t.traceThickness})),l=c.reduce((h,d,u)=>u===0?h:h+Math.hypot(d.x-c[u-1].x,d.y-c[u-1].y),0);if(!(c.length<2||l>s+0.000000001||l>=s-0.000000001&&c.length>=r-this.vertexIndex+1)&&this.isValidPath(c))return c[c.length-1]={...i},this.newRoute.push(...c.slice(1)),void(this.vertexIndex=r)}}this.vertexIndex++,this.newRoute.push({...e[this.vertexIndex]})}},hKe=new Float64Array(1),cxr=new BigUint64Array(hKe.buffer);function T7(e,t){return Number.isFinite(e)?e===0?t?Number.MIN_VALUE:-Number.MIN_VALUE:(hKe[0]=e,cxr[0]+=e>0===t?1n:-1n,hKe[0]):e}function Cce(e,t,n=t){let o=T7(t,!0),r=T7(n,!0);return{minX:T7(T7(e.minX,!1)-o,!1),minY:T7(T7(e.minY,!1)-r,!1),maxX:T7(T7(e.maxX,!0)+o,!0),maxY:T7(T7(e.maxY,!0)+r,!0)}}function YWe(e,t,n){let o={minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};for(let r of e.route)o.minX=Math.min(o.minX,r.x),o.minY=Math.min(o.minY,r.y),o.maxX=Math.max(o.maxX,r.x),o.maxY=Math.max(o.maxY,r.y);for(let r of e.vias){let i=Cce({minX:r.x,minY:r.y,maxX:r.x,maxY:r.y},Math.abs(e.viaDiameter/2));o.minX=Math.min(o.minX,i.minX),o.minY=Math.min(o.minY,i.minY),o.maxX=Math.max(o.maxX,i.maxX),o.maxY=Math.max(o.maxY,i.maxY)}for(let r of e.jumpers??[]){let i=_q[r.footprint]??_q["0603"],s=Math.abs(r.end.x-r.start.x)>Math.abs(r.end.y-r.start.y),a=(s?i.padLength:i.padWidth)/2,c=(s?i.padWidth:i.padLength)/2;for(let l of[r.start,r.end]){let h=Cce({minX:l.x,minY:l.y,maxX:l.x,maxY:l.y},a,c);o.minX=Math.min(o.minX,h.minX),o.minY=Math.min(o.minY,h.minY),o.maxX=Math.max(o.maxX,h.maxX),o.maxY=Math.max(o.maxY,h.maxY)}}if(e.route.length!==0||e.vias.length!==0||e.jumpers?.length)return[o.minX,o.minY,o.maxX,o.maxY].every(Number.isFinite)?{...Cce(o,0),route:e,routeIndex:t,immutable:n}:{minX:-1/0,minY:-1/0,maxX:1/0,maxY:1/0,route:e,routeIndex:t,immutable:n}}var lxr=class{constructor(e,t,n){this.obstacles=n,this.mutableRoutes=e.map((i,s)=>YWe(i,s,!1));let o=t.map((i,s)=>YWe(i,s,!0)).concat(this.mutableRoutes).filter((i)=>i!==void 0);this.routeIndex.load(o);let r=n.map((i,s)=>{let a={minX:i.center.x-i.width/2,minY:i.center.y-i.height/2,maxX:i.center.x+i.width/2,maxY:i.center.y+i.height/2};return Object.values(a).every(Number.isFinite)?this.indexedObstacleIds.push(s):this.unindexedObstacleIds.push(s),a});if(this.indexedObstacleIds.length>0){this.obstacleIndex=new i_(this.indexedObstacleIds.length);for(let i of this.indexedObstacleIds){let s=r[i];this.obstacleIndex.add(s.minX,s.minY,s.maxX,s.maxY)}this.obstacleIndex.finish()}}obstacles;routeIndex=new gV;mutableRoutes;obstacleIndex;indexedObstacleIds=[];unindexedObstacleIds=[];getCandidateObstacles(e,t){if(!Number.isFinite(t)||!Object.values(e).every(Number.isFinite))return[...this.obstacles];let n=Cce(e,Math.max(0,t));return(this.obstacleIndex?this.obstacleIndex.search(n.minX,n.minY,n.maxX,n.maxY).map((o)=>this.indexedObstacleIds[o]):[]).concat(this.unindexedObstacleIds).sort((o,r)=>o-r).map((o)=>this.obstacles[o])}getCandidateRoutes(e,t,n){return(Number.isFinite(t)&&Object.values(e).every(Number.isFinite)?this.routeIndex.search(Cce(e,Math.max(0,t))):this.routeIndex.all()).filter((o)=>o.immutable||o.routeIndex!==n).sort((o,r)=>(o.immutable?0:o.routeIndex>n?1:2)-(r.immutable?0:r.routeIndex>n?1:2)||o.routeIndex-r.routeIndex).map((o)=>o.route)}replaceRoute(e,t){if(!Number.isInteger(e)||e<0||e>=this.mutableRoutes.length)throw Error(`Cannot replace path simplification route ${e}`);let n=this.mutableRoutes[e];n&&this.routeIndex.remove(n);let o=YWe(t,e,!1);this.mutableRoutes[e]=o,o&&this.routeIndex.insert(o)}},hxr=class extends EV{getSolverName(){return"MultiSimplifiedPathSolver"}simplifiedHdRoutes;currentUnsimplifiedHdRouteIndex=0;activeSubSolver=null;unsimplifiedHdRoutes;otherHdRoutes;obstacles;connMap;colorMap;outline;minBoardEdgeClearance;defaultViaDiameter;useTraceWidthAwareClearance;enableVertexShortcuts;geometryIndex;constructor(e){super(),this.MAX_ITERATIONS=1e8,this.unsimplifiedHdRoutes=e.unsimplifiedHdRoutes,this.otherHdRoutes=e.otherHdRoutes??[];let t=Math.max(2,...[...e.unsimplifiedHdRoutes,...this.otherHdRoutes].flatMap((n)=>n.route.map((o)=>o.z+1)))||2;this.obstacles=Lle(e.obstacles,t),this.connMap=e.connMap||new ixr({}),this.colorMap=e.colorMap||{},this.outline=e.outline,this.minBoardEdgeClearance=e.minBoardEdgeClearance??0.2,this.defaultViaDiameter=e.defaultViaDiameter??0.3,this.useTraceWidthAwareClearance=e.useTraceWidthAwareClearance??!1,this.enableVertexShortcuts=e.enableVertexShortcuts??!1,this.geometryIndex=new lxr(this.unsimplifiedHdRoutes,this.otherHdRoutes,this.obstacles),this.simplifiedHdRoutes=[]}_step(){let e=this.unsimplifiedHdRoutes[this.currentUnsimplifiedHdRouteIndex];if(!this.activeSubSolver)return e?(this.activeSubSolver=new Rsn({inputRoute:e,otherHdRoutes:this.otherHdRoutes.concat(this.unsimplifiedHdRoutes.slice(this.currentUnsimplifiedHdRouteIndex+1).concat(this.simplifiedHdRoutes)),obstacles:this.obstacles,connMap:this.connMap,colorMap:this.colorMap,outline:this.outline,minBoardEdgeClearance:this.minBoardEdgeClearance,useTraceWidthAwareClearance:this.useTraceWidthAwareClearance,geometryQuery:{index:this.geometryIndex,routeIndex:this.currentUnsimplifiedHdRouteIndex}}),void this.currentUnsimplifiedHdRouteIndex++):void(this.solved=!0);if(this.activeSubSolver.step(),this.activeSubSolver.solved){if(this.enableVertexShortcuts&&!(this.activeSubSolver instanceof xVt))return void(this.activeSubSolver=new xVt({inputRoute:this.activeSubSolver.simplifiedRoute,otherHdRoutes:this.activeSubSolver.otherHdRoutes,obstacles:this.obstacles,connMap:this.connMap,colorMap:this.colorMap,outline:this.outline,minBoardEdgeClearance:this.minBoardEdgeClearance,useTraceWidthAwareClearance:this.useTraceWidthAwareClearance,geometryQuery:{index:this.geometryIndex,routeIndex:this.currentUnsimplifiedHdRouteIndex-1}}));let t=this.activeSubSolver.simplifiedRoute;this.geometryIndex.replaceRoute(this.currentUnsimplifiedHdRouteIndex-1,t),this.simplifiedHdRoutes.push(t),this.activeSubSolver=null}}visualize(){if(this.activeSubSolver)return this.activeSubSolver.visualize();let e={lines:[],points:[],circles:[],rects:[],coordinateSystem:"cartesian",title:"Multi Simplified Path Solver"};for(let t of this.unsimplifiedHdRoutes)if(!this.simplifiedHdRoutes.some((n)=>n.connectionName===t.connectionName)){for(let n=0;n<t.route.length-1;n++)e.lines.push({points:[{x:t.route[n].x,y:t.route[n].y},{x:t.route[n+1].x,y:t.route[n+1].y}],strokeColor:t.route[n].z===1?"rgba(0, 0, 255, 0.4)":"rgba(255, 0, 0, 0.4)",strokeWidth:0.15,strokeDash:t.route[n].z===1?[0.5,0.5]:void 0});for(let n of t.vias||[])e.circles.push({center:n,radius:(t.viaDiameter??this.defaultViaDiameter)/2,fill:"rgba(0, 0, 255, 0.4)"})}for(let t of this.simplifiedHdRoutes){let n=this.colorMap?.[t.connectionName]||"rgba(128, 128, 128, 0.8)";for(let o=0;o<t.route.length-1;o++)e.lines.push({points:[{x:t.route[o].x,y:t.route[o].y},{x:t.route[o+1].x,y:t.route[o+1].y}],strokeWidth:0.15,strokeColor:n,strokeDash:t.route[o].z===1?[0.5,0.5]:void 0,step:1});for(let o of t.vias||[])e.circles.push({center:o,radius:t.viaDiameter/2,fill:"rgba(0, 0, 255, 0.5)",step:1})}for(let t of this.unsimplifiedHdRoutes){for(let n=0;n<t.route.length-1;n++)e.lines.push({points:[{x:t.route[n].x,y:t.route[n].y},{x:t.route[n+1].x,y:t.route[n+1].y}],strokeWidth:0.15,strokeColor:"rgba(255, 0, 0, 0.2)",strokeDash:[0.5,0.5],step:0,layer:`z${t.route[n].z.toString()}`});for(let n of t.vias)e.circles.push({center:{x:n.x,y:n.y},radius:t.viaDiameter/2,fill:"rgba(255, 0, 0, 0.2)",step:0})}for(let t of this.obstacles)e.rects.push({center:t.center,width:t.width,height:t.height,fill:t.layers?.includes("top")?"rgba(255, 0, 0, 0.3)":t.layers?.includes("bottom")?"rgba(0, 0, 255, 0.3)":"rgba(128, 128, 128, 0.3)"});if(this.currentUnsimplifiedHdRouteIndex<this.unsimplifiedHdRoutes.length){let t=this.unsimplifiedHdRoutes[this.currentUnsimplifiedHdRouteIndex];t.route.length>0&&e.circles.push({center:{x:t.route[0].x,y:t.route[0].y},radius:0.2,fill:"yellow",label:"Current"})}return e}},dxr=(e,t)=>{for(let n=0;n<e.route.length-1;n++){let o=e.route[n],r=e.route[n+1];if(o.z===r.z||o.x!==t.x||o.y!==t.y||r.x!==t.x||r.y!==t.y)continue;let i=n;for(;i>0&&e.route[i-1].x===t.x&&e.route[i-1].y===t.y;)i--;let s=n+1;for(;s<e.route.length-1&&e.route[s+1].x===t.x&&e.route[s+1].y===t.y;)s++;if(i===0||s===e.route.length-1)return!0}return!1},dKe=(e,t,n)=>n?.get(t.connectionName)??e.idToNetMap[t.connectionName]??(t.rootConnectionName?e.idToNetMap[t.rootConnectionName]:void 0),uxr=(e,t,n)=>{for(let o of t.connectedTo){if(o===n.net)return!0;if(e.idToNetMap[o]===n.net)return!0;if(e.areIdsConnected(o,n.net))return!0}return!1},pxr=(e,t,n)=>{let o=n.mergedViaHdRoutes[e.routeIndex];if(!o)throw Error(`SameNetViaMergerSolver could not find route for via at index ${e.routeIndex}`);let r=new Set;for(let i=1;i<o.route.length;i++){let s=o.route[i-1],a=o.route[i];s.z!==a.z&&(s.x===e.x&&s.y===e.y&&a.x===e.x&&a.y===e.y&&(r.add(s.z),r.add(a.z)))}if(r.size===0)throw Error(`SameNetViaMergerSolver could not find transition layers for via at (${e.x}, ${e.y})`);for(let i of r){let s=o.traceThickness,a={x:e.x,y:e.y,z:i},c={x:t.x,y:t.y,z:i};if(a.x===c.x&&a.y===c.y)continue;let l=n.hdRouteSHI.getConflictingRoutesForSegment(a,c,s/2);for(let{conflictingRoute:_,distance:p}of l){if(_.connectionName===o.connectionName)continue;if(dKe(n.connMap,_,n.netByConnectionName)===e.net)continue;if(p<s/2+_.traceThickness/2)return!1}let h={centerX:(a.x+c.x)/2,centerY:(a.y+c.y)/2,width:Math.abs(a.x-c.x),height:Math.abs(a.y-c.y)},d=s/2+0.1,u=n.obstacleSHI.searchArea(h.centerX,h.centerY,h.width+2*d,h.height+2*d);for(let _ of u){if(!_.__zLayers)throw Error(`SameNetViaMergerSolver found obstacle without zLayers near via at (${e.x}, ${e.y})`);if(_.__zLayers.includes(i)&&(!uxr(n.connMap,_,e)&&iS(a,c,_)<d))return!1}}return!0},jJe=class extends EV{constructor(e){if(super(),this.input=e,!e.connMap)throw Error("SameNetViaMergerSolver requires connMap");this.input={...e,obstacles:Lle(e.obstacles,e.layerCount)},this.MAX_ITERATIONS=1e6,this.inputHdRoutes=this.input.inputHdRoutes,this.mergedViaHdRoutes=structuredClone(this.inputHdRoutes);for(let t of this.mergedViaHdRoutes)this.dedupeRouteVias(t);this.unprocessedRoutes=[...this.input.inputHdRoutes],this.colorMap=this.input.colorMap,this.outline=this.input.outline,this.obstacles=this.input.obstacles,this.obstacleSHI=new WJe("flatbush",this.input.obstacles),this.hdRouteSHI=this.createHdRouteSpatialIndex(),this.vias=[],this.offendingVias=[],this.connMap=e.connMap,this.netByConnectionName=e.netByConnectionName,this.viasByNet=new Map,this.rebuildVias()}input;getSolverName(){return"SameNetViaMergerSolver"}inputHdRoutes;mergedViaHdRoutes;unprocessedRoutes;vias;offendingVias;currentViaRoutes=[];connMap;colorMap;outline;obstacles;viasByNet;netByConnectionName;obstacleSHI;hdRouteSHI;createHdRouteSpatialIndex(){return new LO([...this.mergedViaHdRoutes,...this.input.otherHdRoutes??[]])}rebuildVias(){this.vias=[],this.viasByNet=new Map;let e=(t,n,o)=>{if(t.vias.length===0)return;let r=o?((i,s,a)=>{let c=dKe(i,s,a);if(!c)throw Error(`SameNetViaMergerSolver could not find net for route "${s.connectionName}"`);return c})(this.connMap,t,this.netByConnectionName):dKe(this.connMap,t,this.netByConnectionName);if(r)for(let i=0;i<t.vias.length;i++){let s=t.vias[i],a=[...new Set(t.route.map((h)=>h.z))];if(a.length===0)throw Error(`SameNetViaMergerSolver found via on route "${t.connectionName}" with no route points`);let c={x:s.x,y:s.y,diameter:t.viaDiameter,net:r,layers:a,routeIndex:n,mutable:o&&!(this.input.preserveRouteEndpoints&&dxr(t,s))};this.vias.push(c);let l=this.viasByNet.get(c.net);l?l.push(c):this.viasByNet.set(c.net,[c])}};for(let t=0;t<this.mergedViaHdRoutes.length;t++)e(this.mergedViaHdRoutes[t],t,!0);for(let t=0;t<(this.input.otherHdRoutes?.length??0);t++)e(this.input.otherHdRoutes[t],this.mergedViaHdRoutes.length+t,!1)}getViaLocationKey(e){return[e.net,e.x,e.y].join(":")}dedupeRouteVias(e){let t=new Set;e.vias=e.vias.filter((n)=>{let o=`${n.x}:${n.y}`;return!t.has(o)&&(t.add(o),!0)})}getOffendingViaGroupsBatch(){let e=[],t=new Set,n=[];for(let o of this.viasByNet.values()){if(o.length<2)continue;let r=Math.max(0.000001,...o.map((a)=>a.diameter)),i=new Map,s=new Map;for(let a=0;a<o.length;a++){let c=o[a],l=this.getViaLocationKey(c),h=s.get(l);h?h.push(c):s.set(l,[c]);let d=`${Math.floor(c.x/r)}:${Math.floor(c.y/r)}`,u=i.get(d);u?u.push(a):i.set(d,[a])}for(let a=0;a<o.length;a++){let c=o[a],l=Math.floor(c.x/r),h=Math.floor(c.y/r),d=Math.ceil(2.5),u=[];for(let m=-d;m<=d;m++)for(let A=-d;A<=d;A++){let g=i.get(`${l+m}:${h+A}`);if(g)for(let f of g){if(f===a)continue;let y=o[f];if(!y.mutable)continue;let x=c.x-y.x,C=c.y-y.y,b=x*x+C*C,I=c.diameter/2+y.diameter/2,v=2.5*I;b!==0&&((b<=I*I||b<=v*v&&pxr(y,c,{connMap:this.connMap,mergedViaHdRoutes:this.mergedViaHdRoutes,hdRouteSHI:this.hdRouteSHI,obstacleSHI:this.obstacleSHI,netByConnectionName:this.netByConnectionName}))&&u.push(y))}}let _=new Set(u),p=u.filter((m)=>m.x===c.x&&m.y===c.y||s.get(this.getViaLocationKey(m)).every((A)=>A.mutable&&_.has(A)));p.length>0&&n.push({keep:c,remove:p})}}n.sort((o,r)=>r.remove.length!==o.remove.length?r.remove.length-o.remove.length:o.keep.mutable!==r.keep.mutable?o.keep.mutable?1:-1:r.keep.layers.length!==o.keep.layers.length?r.keep.layers.length-o.keep.layers.length:o.keep.routeIndex-r.keep.routeIndex);for(let o of n){let r=this.getViaLocationKey(o.keep);if(t.has(r))continue;let i=o.remove.filter((s)=>!t.has(this.getViaLocationKey(s)));if(i.length!==0){e.push({keep:o.keep,remove:i}),t.add(r);for(let s of i)t.add(this.getViaLocationKey(s))}}return e}moveViaTo(e,t,n=!0){if(!e.mutable)throw Error("SameNetViaMergerSolver cannot mutate an immutable via anchor");let o=this.mergedViaHdRoutes[e.routeIndex];if(!o)throw Error(`SameNetViaMergerSolver could not find route for via at index ${e.routeIndex}`);let r=o.route,i=new Set,s=!1;for(let a=r.length-1;a>=1;a--){let c=r[a-1],l=r[a];if(c.z===l.z)continue;if(c.x!==e.x||c.y!==e.y)continue;if(l.x!==e.x||l.y!==e.y)continue;let h=a-1;for(;h>0&&r[h-1].x===e.x&&r[h-1].y===e.y;)h--;let d=a;for(;d<r.length-1&&r[d+1].x===e.x&&r[d+1].y===e.y;)d++;for(let u=h;u<=d;u++)i.add(u)}if(i.size===0)throw Error(`SameNetViaMergerSolver could not find route transition for via at (${e.x}, ${e.y}) on route "${o.connectionName}"`);for(let a of i){let c=r[a];r[a]={...c,x:t.x,y:t.y}}if(o.vias=o.vias.map((a)=>a.x!==e.x||a.y!==e.y?a:(s=!0,{x:t.x,y:t.y})),!s)throw Error(`SameNetViaMergerSolver could not find via at (${e.x}, ${e.y}) on route "${o.connectionName}"`);this.dedupeRouteVias(o),n&&this.rebuildVias()}_step(){let e=this.getOffendingViaGroupsBatch();if(e.length===0)return void(this.solved=!0);let t=0;for(let n of e)for(let o of n.remove)this.moveViaTo(o,n.keep,!1),t++;this.rebuildVias(),this.hdRouteSHI=this.createHdRouteSpatialIndex(),this.stats.mergedViaGroups=e.length,this.stats.mergedViaCount=t}getMergedViaHdRoutes(){return this.mergedViaHdRoutes}visualize(){let e={lines:[],points:[],rects:[],circles:[],coordinateSystem:"cartesian",title:"Same Net Via Merger Solver"};for(let t of this.input.obstacles){if(!t.__zLayers)throw Error("SameNetViaMergerSolver found obstacle without zLayers while visualizing");let n="rgba(128, 128, 128, 0.2)",o=t.__zLayers.includes(0),r=t.__zLayers.includes(1);o&&r?n="rgba(128, 0, 128, 0.2)":o?n="rgba(255, 0, 0, 0.2)":r&&(n="rgba(0, 0, 255, 0.2)"),e.rects.push({center:t.center,width:t.width,height:t.height,fill:n,label:`Obstacle (Z: ${t.__zLayers?.join(", ")})`})}for(let t of this.mergedViaHdRoutes){if(t.route.length===0)continue;let n=this.input.colorMap[t.connectionName];if(!n)throw Error(`SameNetViaMergerSolver could not find color for route "${t.connectionName}"`);for(let o=0;o<t.route.length-1;o++){let r=t.route[o],i=t.route[o+1];r.z===i.z&&e.lines.push({points:[{x:r.x,y:r.y},{x:i.x,y:i.y}],strokeColor:r.z===0?"rgba(255, 0, 0, 0.5)":"rgba(0, 0, 255, 0.5)",strokeWidth:t.traceThickness,label:`${t.connectionName} (z=${r.z})`})}for(let o of t.vias)e.circles.push({center:{x:o.x,y:o.y},radius:t.viaDiameter/2,fill:"rgba(255, 0, 255, 0.5)",label:`${t.connectionName} via`});if(t.jumpers&&t.jumpers.length>0){let o=XJe(t.jumpers,{color:n,label:t.connectionName});if(!o.rects||!o.lines)throw Error(`SameNetViaMergerSolver expected jumper graphics for route "${t.connectionName}"`);e.rects.push(...o.rects),e.lines.push(...o.lines)}}return e}},mxr={getConflictingRoutesForSegment:()=>[],getConflictingRoutesNearPoint:()=>[]},oy=0.000001,bce=(e,t)=>{let n=`${e.x}:${e.y}:${e.z}`,o=`${t.x}:${t.y}:${t.z}`;return n<o?`${n}|${o}`:`${o}|${n}`},CVt=(e)=>{let t=new Set;for(let n=1;n<e.route.length;n++){let o=e.route[n-1],r=e.route[n];o.z===r.z&&t.add(bce(o,r))}return t},GWe=(e)=>e.filter((t,n)=>{let o=e[n-1];return!o||t.x!==o.x||t.y!==o.y||t.z!==o.z}),UWe=(e)=>{let t=[],n=new Set;for(let o=1;o<e.length;o++){let r=e[o-1],i=e[o];if(r.z===i.z)continue;if(r.toNextSegmentType==="through_obstacle")continue;if(r.x!==i.x||r.y!==i.y)throw Error(`CrossingViaReductionSolver found a layer transition without a via at route point ${o}`);let s=`${i.x}:${i.y}`;n.has(s)||(n.add(s),t.push({x:i.x,y:i.y}))}return t},uKe=(e)=>{let t=[e.connectionName];return e.rootConnectionName&&t.push(e.rootConnectionName),t},WWe=(e,t,n)=>{let o=uKe(e),r=uKe(t);return o.some((i)=>r.some((s)=>i===s||n.areIdsConnected(i,s)))},_xr=(e,t,n)=>{let o=uKe(t);return e.connectedTo.some((r)=>o.some((i)=>r===i||n.areIdsConnected(r,i)))},Qsn=(e)=>{let t=0;for(let n=1;n<e.length;n++)t+=Math.hypot(e[n].x-e[n-1].x,e[n].y-e[n-1].y);return t},bVt=(e,t)=>{let n=Qsn(e);if(t<=oy||t>=n-oy)return null;let o=0;for(let r=1;r<e.length;r++){let i=e[r-1],s=e[r],a=Math.hypot(s.x-i.x,s.y-i.y);if(o+a<t-oy){o+=a;continue}let c=t-o;if(c<=oy)return{prefix:e.slice(0,r).map((d)=>({...d})),suffix:e.slice(r-1).map((d)=>({...d})),point:{...i}};if(a-c<=oy)return{prefix:e.slice(0,r+1).map((d)=>({...d})),suffix:e.slice(r).map((d)=>({...d})),point:{...s}};let l=c/a,h={x:i.x+(s.x-i.x)*l,y:i.y+(s.y-i.y)*l,z:i.z};return{prefix:[...e.slice(0,r),h].map((d)=>({...d})),suffix:[h,...e.slice(r)].map((d)=>({...d})),point:h}}return null},gxr=(e,t,n,o)=>{let r=vw(e,t,n,o);if(!r)return null;let i=Math.hypot(r.x-e.x,r.y-e.y),s=Math.hypot(r.x-t.x,r.y-t.y),a=Math.hypot(r.x-n.x,r.y-n.y),c=Math.hypot(r.x-o.x,r.y-o.y);return Math.min(i,s,a,c)<=oy?null:i},IVt=(e)=>e.points.some((t)=>t.insideJumperPad||t.toNextSegmentType),ksn=({sections:e,sectionIndex:t,side:n})=>{let o=e[t],r=n==="start"?e[t-1]:e[t+1];if(!r)return null;let i=n==="start"?o.points[0]:o.points.at(-1),s=n==="start"?r.points.at(-1):r.points[0];return i.x!==s.x||i.y!==s.y?null:r.z},vVt=({sections:e,sectionIndex:t,targetZ:n,side:o})=>ksn({sections:e,sectionIndex:t,side:o})===n,SVt=({baseIndexes:e,otherCandidateRoutes:t,ignoredConnectionNames:n,originalRouteSegmentKeys:o})=>{let r=new LO([...t]);return{getConflictingRoutesForSegment:(i,s,a)=>{let c=o.has(bce(i,s));return[...c?[]:e.mutableRoutes.getConflictingRoutesForSegment(i,s,a).filter(({conflictingRoute:l})=>!n.has(l.connectionName)),...c?[]:e.immutableRoutes?.getConflictingRoutesForSegment(i,s,a)??[],...r.getConflictingRoutesForSegment(i,s,a)]},getConflictingRoutesNearPoint:(i,s)=>[...e.mutableRoutes.getConflictingRoutesNearPoint(i,s).filter(({conflictingRoute:a})=>!n.has(a.connectionName)),...e.immutableRoutes?.getConflictingRoutesNearPoint(i,s)??[],...r.getConflictingRoutesNearPoint(i,s)]}},Axr=class extends EV{input;obstacleSHI;traceMargin;obstacleMargin;reducedHdRoutes;getSolverName(){return"CrossingViaReductionSolver"}constructor(e){super(),this.input={...e,obstacles:Lle(e.obstacles,e.layerCount)},this.traceMargin=e.traceMargin??0.1,this.obstacleMargin=e.obstacleMargin??0.15,this.reducedHdRoutes=structuredClone([...e.inputHdRoutes]),this.obstacleSHI=new WJe("flatbush",[...this.input.obstacles]),this.MAX_ITERATIONS=1e6}collapseDetourSection({route:e,section:t,targetZ:n}){let o=t.points.map((i)=>({...i,z:n})),r=GWe([...e.route.slice(0,t.startIndex).map((i)=>({...i})),...o,...e.route.slice(t.endIndex+1).map((i)=>({...i}))]);return{...e,route:r,vias:UWe(r)}}relocateTransitionVia({route:e,section:t,targetZ:n,side:o,newViaDistance:r}){let i=bVt(t.points,r);if(!i)return null;let s=o==="start"?n:t.z,a=o==="start"?t.z:n,c=[...i.prefix.map((h)=>({...h,z:s})),...i.suffix.map((h)=>({...h,z:a}))],l=GWe([...e.route.slice(0,t.startIndex).map((h)=>({...h})),...c,...e.route.slice(t.endIndex+1).map((h)=>({...h}))]);return{route:{...e,route:l,vias:UWe(l)},relocatedVia:{x:i.point.x,y:i.point.y}}}relocateTransitionVias({route:e,sections:t,crossingGroups:n,detourZ:o,detourTraceThickness:r}){let i=new Map;for(let h of n){let d=i.get(h.transitionSectionIndex)??[];d.push(h),i.set(h.transitionSectionIndex,d)}let s=[],a=[],c=e.viaDiameter/2+r/2+this.traceMargin+oy;for(let[h,d]of i){if(d.length!==1)return null;let u=t[h],_=d[0];if(!vVt({sections:t,sectionIndex:h,targetZ:o,side:_.side}))return null;let p=_.side==="start"?Math.max(..._.crossingDistances)+c:Math.min(..._.crossingDistances)-c,m=bVt(u.points,p);if(!m)return null;let A=_.side==="start"?o:u.z,g=_.side==="start"?u.z:o;s.push({section:u,points:[...m.prefix.map((f)=>({...f,z:A})),...m.suffix.map((f)=>({...f,z:g}))]}),a.push({x:m.point.x,y:m.point.y})}let l=e.route.map((h)=>({...h}));for(let h of s.sort((d,u)=>u.section.startIndex-d.section.startIndex))l=[...l.slice(0,h.section.startIndex),...h.points,...l.slice(h.section.endIndex+1)];return l=GWe(l),{route:{...e,route:l,vias:UWe(l)},relocatedVias:a}}routeIsClear(e,t,n){for(let o of rce(e)){for(let r=1;r<o.points.length;r++){let i=o.points[r-1],s=o.points[r];if(!n.has(bce(i,s))&&this.input.outline&&JCe({start:i,end:s,polygon:[...this.input.outline],margin:e.traceThickness/2}))return!1}if(!y$({currentSection:o,targetZ:o.z,route:e,hdRouteSHI:t,obstacleSHI:this.obstacleSHI,connMap:this.input.connMap,defaultTraceThickness:e.traceThickness,obstacleMargin:this.obstacleMargin,traceMargin:this.traceMargin,shouldCheckStaticGeometryForSegment:(r,i)=>!n.has(bce(r,i))}))return!1}return!0}relocatedViaIsClear(e,t,n){let o=e.viaDiameter/2;for(let s=0;s<this.input.layerCount;s++)if(n.getConflictingRoutesNearPoint({...t,z:s},o+this.traceMargin).some(({conflictingRoute:a})=>!WWe(e,a,this.input.connMap)))return!1;let r=o+this.obstacleMargin,i=this.obstacleSHI.searchArea(t.x,t.y,2*r,2*r);for(let s of i)if(!_xr(s,e,this.input.connMap)&&iS(t,t,s)<r)return!1;if(this.input.outline){for(let s=0;s<this.input.outline.length;s++)if(oc(t,this.input.outline[s],this.input.outline[(s+1)%this.input.outline.length])<o+this.traceMargin)return!1}return!0}changedSectionsAreStaticallyClear(e,t){for(let n of rce(e))if(n.points.some((o,r)=>{let i=n.points[r-1];return i!==void 0&&!t.has(bce(i,o))})){if(this.input.outline){for(let o=1;o<n.points.length;o++)if(JCe({start:n.points[o-1],end:n.points[o],polygon:[...this.input.outline],margin:e.traceThickness/2}))return!1}if(!y$({currentSection:n,targetZ:n.z,route:e,hdRouteSHI:mxr,obstacleSHI:this.obstacleSHI,connMap:this.input.connMap,defaultTraceThickness:e.traceThickness,obstacleMargin:Math.min(this.obstacleMargin,0.1),traceMargin:this.traceMargin}))return!1}return!0}candidateIsClear(e,t){let n=[{routeIndex:e.detourRouteIndex,route:e.detourRoute},...e.transitionUpdates],o=new Set(n.map(({routeIndex:s})=>this.reducedHdRoutes[s].connectionName)),r=CVt(this.reducedHdRoutes[e.detourRouteIndex]),i=SVt({baseIndexes:t,otherCandidateRoutes:e.transitionUpdates.map(({route:s})=>s),ignoredConnectionNames:o,originalRouteSegmentKeys:r});if(this.stats.candidateClearanceChecks=(this.stats.candidateClearanceChecks??0)+1,!this.routeIsClear(e.detourRoute,i,r))return!1;for(let s of e.transitionUpdates){let a=CVt(this.reducedHdRoutes[s.routeIndex]),c=SVt({baseIndexes:t,otherCandidateRoutes:n.filter(({routeIndex:l})=>l!==s.routeIndex).map(({route:l})=>l),ignoredConnectionNames:o,originalRouteSegmentKeys:a});if(!this.routeIsClear(s.route,c,a)||s.relocatedVias.some((l)=>!this.relocatedViaIsClear(s.route,l,c)))return!1}return this.changedSectionsAreStaticallyClear(e.detourRoute,r)}candidateRoutesHaveNoExternalCopperConflicts(e,t){let n=[e.detourRoute,...e.transitionUpdates.map(({route:i})=>i)],o=new Set(n.map(({connectionName:i})=>i)),r=[t.mutableRoutes,...t.immutableRoutes?[t.immutableRoutes]:[]];for(let i of n)for(let s of rce(i))for(let a=1;a<s.points.length;a++){let c=s.points[a-1],l=s.points[a];for(let h of r)if(h.getConflictingRoutesForSegment(c,l,i.traceThickness/2+this.traceMargin).some(({conflictingRoute:d})=>!o.has(d.connectionName)&&!WWe(i,d,this.input.connMap)))return!1}return!0}buildTransitionSegmentIndex(e,t){let n=[];for(let r=0;r<this.reducedHdRoutes.length;r++){if(this.reducedHdRoutes[r].jumpers?.length)continue;let i=e[r];for(let s=0;s<i.length;s++){let a=i[s];if(!IVt(a))for(let c of["start","end"]){let l=ksn({sections:i,sectionIndex:s,side:c});if(l===null||l===a.z)continue;if(!t.has(`${a.z}:${l}`))continue;let h=0;for(let d=1;d<a.points.length;d++){let u=a.points[d-1],_=a.points[d],p=Math.hypot(_.x-u.x,_.y-u.y);p>oy&&n.push({routeIndex:r,sectionIndex:s,side:c,adjacentZ:l,start:u,end:_,distanceFromSectionStart:h}),h+=p}}}}if(this.stats.transitionSegmentsIndexed=(this.stats.transitionSegmentsIndexed??0)+n.length,n.length===0)return null;let o=new Bsn(n.length);for(let r of n)o.insert(r,Math.min(r.start.x,r.end.x),Math.min(r.start.y,r.end.y),Math.max(r.start.x,r.end.x),Math.max(r.start.y,r.end.y));return o.finish(),o}getIndexedCrossingGroups({detourRouteIndex:e,detourSection:t,targetZ:n,transitionSegmentIndex:o}){let r=new Map;for(let i=1;i<t.points.length;i++){let s=t.points[i-1],a=t.points[i];if(Math.hypot(a.x-s.x,a.y-s.y)<=oy)continue;this.stats.indexedDetourSegmentQueries=(this.stats.indexedDetourSegmentQueries??0)+1;let c=o.search(Math.min(s.x,a.x)-oy,Math.min(s.y,a.y)-oy,Math.max(s.x,a.x)+oy,Math.max(s.y,a.y)+oy);for(let l of c){if(l.routeIndex===e||l.start.z!==n||l.adjacentZ!==t.z)continue;this.stats.exactSegmentIntersectionChecks=(this.stats.exactSegmentIntersectionChecks??0)+1;let h=gxr(l.start,l.end,s,a);if(h===null)continue;let d=`${l.routeIndex}:${l.sectionIndex}:${l.side}`,u=r.get(d);u||(u={transitionRouteIndex:l.routeIndex,transitionSectionIndex:l.sectionIndex,side:l.side,crossingDistances:[]},r.set(d,u)),u.crossingDistances.push(l.distanceFromSectionStart+h)}}return[...r.values()].sort((i,s)=>i.transitionRouteIndex!==s.transitionRouteIndex?i.transitionRouteIndex-s.transitionRouteIndex:i.transitionSectionIndex!==s.transitionSectionIndex?i.transitionSectionIndex-s.transitionSectionIndex:i.side===s.side?0:i.side==="start"?-1:1)}tryCreateCandidate({detourRouteIndex:e,detourSection:t,targetZ:n,transitionRouteIndex:o,transitionSection:r,transitionSections:i,transitionSectionIndex:s,side:a,crossingDistances:c,baseClearanceIndexes:l}){if(!vVt({sections:i,sectionIndex:s,targetZ:t.z,side:a}))return null;let h=this.reducedHdRoutes[e],d=this.reducedHdRoutes[o];if(c.length===0)return null;let u=d.viaDiameter/2+h.traceThickness/2+this.traceMargin+oy,_=a==="start"?Math.max(...c)+u:Math.min(...c)-u,p=this.relocateTransitionVia({route:d,section:r,targetZ:t.z,side:a,newViaDistance:_});if(!p)return null;let m=this.collapseDetourSection({route:h,section:t,targetZ:n});if(h.vias.length+d.vias.length-m.vias.length-p.route.vias.length!==2)return null;let A={detourRouteIndex:e,detourRoute:m,transitionUpdates:[{routeIndex:o,route:p.route,relocatedVias:[p.relocatedVia]}]};return this.candidateIsClear(A,l)?A:null}tryCreateMultiCrossingCandidate({detourRouteIndex:e,detourSection:t,targetZ:n,crossingGroups:o,sectionsByRoute:r,baseClearanceIndexes:i}){if(o.length<2)return null;let s=this.reducedHdRoutes[e],a=[],c=new Map;for(let d of o){let u=c.get(d.transitionRouteIndex)??[];u.push(d),c.set(d.transitionRouteIndex,u)}for(let[d,u]of c){let _=this.reducedHdRoutes[d],p=this.relocateTransitionVias({route:_,sections:r[d],crossingGroups:u,detourZ:t.z,detourTraceThickness:s.traceThickness});if(!p)return null;a.push({routeIndex:d,route:p.route,relocatedVias:p.relocatedVias})}let l=this.collapseDetourSection({route:s,section:t,targetZ:n});if(s.vias.length+[...c.keys()].reduce((d,u)=>d+this.reducedHdRoutes[u].vias.length,0)-(l.vias.length+a.reduce((d,{route:u})=>d+u.vias.length,0))!==2)return null;this.stats.multiCrossingCandidates=(this.stats.multiCrossingCandidates??0)+1;let h={detourRouteIndex:e,detourRoute:l,transitionUpdates:a};return this.candidateIsClear(h,i)?this.candidateRoutesHaveNoExternalCopperConflicts(h,i)?(this.stats.multiCrossingReductions=(this.stats.multiCrossingReductions??0)+1,this.stats.transitionRoutesMovedByMultiCrossingReductions=(this.stats.transitionRoutesMovedByMultiCrossingReductions??0)+a.length,h):(this.stats.multiCrossingPreexistingConflictRejections=(this.stats.multiCrossingPreexistingConflictRejections??0)+1,null):null}findCrossingReduction(){let e=this.reducedHdRoutes.map((i)=>rce(i)),t=[],n=new Set;for(let i=0;i<this.reducedHdRoutes.length;i++){if(this.reducedHdRoutes[i].jumpers?.length)continue;let s=e[i];for(let a=1;a<s.length-1;a++){let c=s[a-1],l=s[a],h=s[a+1];c.z!==h.z||c.z===l.z||IVt(l)||(t.push({routeIndex:i,section:l,targetZ:c.z}),n.add(`${c.z}:${l.z}`))}}if(t.length===0)return null;let o=this.buildTransitionSegmentIndex(e,n);if(!o)return null;let r=null;for(let i of t){let{routeIndex:s,section:a}=i,c=this.reducedHdRoutes[s],l=this.getIndexedCrossingGroups({detourRouteIndex:s,detourSection:a,targetZ:i.targetZ,transitionSegmentIndex:o}).filter(({transitionRouteIndex:u})=>{let _=this.reducedHdRoutes[u];return!_.jumpers?.length&&!WWe(c,_,this.input.connMap)}),h=new Map;for(let u of l){let _=`${u.transitionRouteIndex}:${u.transitionSectionIndex}`,p=h.get(_)??[];p.push(u),h.set(_,p)}if(h.size>1){r??={mutableRoutes:new LO(this.reducedHdRoutes),immutableRoutes:this.input.otherHdRoutes?.length?new LO([...this.input.otherHdRoutes]):null};let u=[{groups:[],movement:0}],_=(p)=>{let m=this.reducedHdRoutes[p.transitionRouteIndex],A=e[p.transitionRouteIndex][p.transitionSectionIndex],g=m.viaDiameter/2+c.traceThickness/2+this.traceMargin+oy,f=p.side==="start"?Math.max(...p.crossingDistances)+g:Math.min(...p.crossingDistances)-g;return p.side==="start"?f:Qsn(A.points)-f};for(let p of h.values()){let m=p.map((A)=>({group:A,movement:_(A)})).sort((A,g)=>A.movement-g.movement);u=u.flatMap((A)=>m.map((g)=>({groups:[...A.groups,g.group],movement:A.movement+g.movement}))).sort((A,g)=>A.movement-g.movement).slice(0,4)}for(let p of u){let m=this.tryCreateMultiCrossingCandidate({detourRouteIndex:s,detourSection:a,targetZ:i.targetZ,crossingGroups:p.groups,sectionsByRoute:e,baseClearanceIndexes:r});if(m)return m}continue}let d=h.values().next().value??[];for(let u of d){let _=u.transitionRouteIndex,p=e[_],m=p[u.transitionSectionIndex];r??={mutableRoutes:new LO(this.reducedHdRoutes),immutableRoutes:this.input.otherHdRoutes?.length?new LO([...this.input.otherHdRoutes]):null};let A=this.tryCreateCandidate({detourRouteIndex:s,detourSection:a,targetZ:i.targetZ,transitionRouteIndex:_,transitionSection:m,transitionSections:p,transitionSectionIndex:u.transitionSectionIndex,side:u.side,crossingDistances:u.crossingDistances,baseClearanceIndexes:r});if(A)return A}}return null}_step(){let e=this.findCrossingReduction();if(e){this.reducedHdRoutes[e.detourRouteIndex]=e.detourRoute;for(let t of e.transitionUpdates)this.reducedHdRoutes[t.routeIndex]=t.route;this.stats.crossingViaReductions=(this.stats.crossingViaReductions??0)+1,this.stats.viasRemovedByCrossingReductions=(this.stats.viasRemovedByCrossingReductions??0)+2}else this.solved=!0}getReducedHdRoutes(){return this.reducedHdRoutes}visualize(){let e={lines:[],circles:[],rects:[],coordinateSystem:"cartesian",title:"Crossing Via Reduction Solver"};for(let t of this.input.obstacles)e.rects.push({center:t.center,width:t.width,height:t.height,fill:"rgba(128, 128, 128, 0.2)"});for(let t of this.reducedHdRoutes){for(let n=1;n<t.route.length;n++){let o=t.route[n-1],r=t.route[n];o.z===r.z&&e.lines.push({points:[o,r],strokeColor:o.z===0?"#d32f2f":"#3367a8",strokeWidth:t.traceThickness,label:`${t.connectionName} (z=${o.z})`})}for(let n of t.vias)e.circles.push({center:n,radius:t.viaDiameter/2,fill:"#ff20d6",label:`${t.connectionName} via`})}return e}},ZCe=0.000001,XWe=(e,t)=>Math.abs(e.x-t.center.x)<=t.width/2+ZCe&&Math.abs(e.y-t.center.y)<=t.height/2+ZCe,PVt=(e)=>(e.__zLayers?.length??e.layers?.length??0)>1,Ab=class extends EV{constructor(e){if(super(),this.simplificationConfig=e,this.simplificationConfig={...e,obstacles:Lle(e.obstacles,e.layerCount)},this.hdRoutes=this.markThroughObstacleSegments(e.hdRoutes),e.preserveRouteEndpoints){let t=new Map;for(let n of e.hdRoutes){let o=n.route[0],r=n.route.at(-1);if(!o||!r)throw Error(`TraceSimplificationSolver cannot preserve endpoints for empty route "${n.connectionName}"`);if(t.has(n.connectionName))throw Error(`TraceSimplificationSolver cannot preserve endpoints for duplicate route "${n.connectionName}"`);t.set(n.connectionName,{start:{...o},end:{...r}})}this.preservedRouteEndpoints=t}this.MAX_ITERATIONS=1e8}simplificationConfig;getSolverName(){return"TraceSimplificationSolver"}hdRoutes=[];preservedRouteEndpoints;simplificationPipelineLoops=0;MAX_SIMPLIFICATION_PIPELINE_LOOPS=2;PHASE_ORDER=["via_removal","crossing_via_reduction","via_merging","path_simplification"];currentPhase="via_removal";extractResult=null;get simplifiedHdRoutes(){return this.hdRoutes}validatePreservedRouteEndpoints(e){if(!this.preservedRouteEndpoints)return;if(e.length!==this.preservedRouteEndpoints.size)throw Error(`TraceSimplificationSolver changed the preserved route set (expected ${this.preservedRouteEndpoints.size}, got ${e.length})`);let t=new Set,n=(o,r)=>Math.abs(o.x-r.x)<=ZCe&&Math.abs(o.y-r.y)<=ZCe&&o.z===r.z;for(let o of e){if(t.has(o.connectionName))throw Error(`TraceSimplificationSolver produced duplicate preserved route "${o.connectionName}"`);t.add(o.connectionName);let r=this.preservedRouteEndpoints.get(o.connectionName),i=o.route[0],s=o.route.at(-1);if(!(r&&i&&s&&n(i,r.start)&&n(s,r.end)))throw Error(`TraceSimplificationSolver changed a preserved endpoint for route "${o.connectionName}"`)}}isSameNetObstacle(e,t){return t.connectedTo.some((n)=>n===e.connectionName||n===e.rootConnectionName||this.simplificationConfig.connMap.areIdsConnected(e.connectionName,n)||e.rootConnectionName!==void 0&&this.simplificationConfig.connMap.areIdsConnected(e.rootConnectionName,n))}getSameNetObstacleForSegment(e,t,n){return this.simplificationConfig.obstacles.find((o)=>PVt(o)&&this.isSameNetObstacle(e,o)&&XWe(t,o)&&XWe(n,o))}isViaInsideSameNetObstacle(e,t){return this.simplificationConfig.obstacles.some((n)=>PVt(n)&&this.isSameNetObstacle(e,n)&&XWe(t,n))}markThroughObstacleSegments(e){return e.map((t)=>({...t,route:t.route.map((n,o,r)=>{let i=r[o+1],s=i&&n.z!==i.z&&this.getSameNetObstacleForSegment(t,n,i);if(s)return{...n,toNextSegmentType:"through_obstacle",...s.circuitJsonMetadata?{toNextSegmentCircuitJsonMetadata:s.circuitJsonMetadata}:{}};let a={...n};return delete a.toNextSegmentType,delete a.toNextSegmentCircuitJsonMetadata,a}),vias:t.vias.filter((n)=>!this.isViaInsideSameNetObstacle(t,n))}))}_step(){if(this.simplificationPipelineLoops>=this.MAX_SIMPLIFICATION_PIPELINE_LOOPS)this.solved=!0;else{if(this.activeSubSolver){if(this.activeSubSolver.step(),!this.activeSubSolver.failed&&!this.activeSubSolver.solved)return;if(this.activeSubSolver.solved){if(this.extractResult){let e=this.extractResult(this.activeSubSolver);this.validatePreservedRouteEndpoints(e),this.hdRoutes=this.markThroughObstacleSegments(e)}if(this.activeSubSolver=null,this.extractResult=null,this.currentPhase==="via_removal"?this.currentPhase=this.simplificationConfig.enableCrossingViaReduction?"crossing_via_reduction":"via_merging":this.currentPhase==="crossing_via_reduction"?this.currentPhase="via_merging":this.currentPhase==="via_merging"?this.currentPhase="path_simplification":(this.currentPhase="via_removal",this.simplificationPipelineLoops++),this.simplificationPipelineLoops>=this.MAX_SIMPLIFICATION_PIPELINE_LOOPS)return void(this.solved=!0)}else if(this.activeSubSolver.failed)return this.failed=!0,void(this.error=this.activeSubSolver.error??"Sub-solver failed without error message")}if(!this.activeSubSolver&&!this.solved)switch(this.currentPhase){case"via_removal":this.activeSubSolver=new Nsn({enableRoutedTraceDetours:this.simplificationConfig.enableRoutedTraceDetours,unsimplifiedHdRoutes:this.hdRoutes,otherHdRoutes:[...this.simplificationConfig.otherHdRoutes??[]],obstacles:[...this.simplificationConfig.obstacles],colorMap:{...this.simplificationConfig.colorMap},layerCount:this.simplificationConfig.layerCount,connMap:this.simplificationConfig.connMap,outline:this.simplificationConfig.outline?[...this.simplificationConfig.outline]:void 0,geometryShortcutTraceMargin:0.1,geometryShortcutObstacleMargin:this.simplificationConfig.minTraceToPadEdgeClearance??0.15,enableGeometryShortcuts:this.simplificationPipelineLoops>0,enableObstacleDetourShortcuts:this.simplificationConfig.enableCrossingViaReduction===!0&&this.simplificationPipelineLoops>0,preserveRouteEndpoints:this.simplificationConfig.preserveRouteEndpoints,terminalLayerIndicesByPcbPortId:this.simplificationConfig.terminalLayerIndicesByPcbPortId}),this.extractResult=(e)=>e.getOptimizedHdRoutes()??[];break;case"crossing_via_reduction":this.activeSubSolver=new Axr({inputHdRoutes:this.hdRoutes,otherHdRoutes:[...this.simplificationConfig.otherHdRoutes??[]],obstacles:[...this.simplificationConfig.obstacles],connMap:this.simplificationConfig.connMap,layerCount:this.simplificationConfig.layerCount,outline:this.simplificationConfig.outline?[...this.simplificationConfig.outline]:void 0,traceMargin:0.1,obstacleMargin:this.simplificationConfig.minTraceToPadEdgeClearance??0.15}),this.extractResult=(e)=>e.getReducedHdRoutes();break;case"via_merging":this.activeSubSolver=new jJe({inputHdRoutes:this.hdRoutes,otherHdRoutes:[...this.simplificationConfig.otherHdRoutes??[]],netByConnectionName:this.simplificationConfig.netByConnectionName,obstacles:[...this.simplificationConfig.obstacles],colorMap:{...this.simplificationConfig.colorMap},layerCount:this.simplificationConfig.layerCount,connMap:this.simplificationConfig.connMap,outline:this.simplificationConfig.outline?[...this.simplificationConfig.outline]:void 0,preserveRouteEndpoints:this.simplificationConfig.preserveRouteEndpoints}),this.extractResult=(e)=>e.getMergedViaHdRoutes()??[];break;case"path_simplification":this.activeSubSolver=new hxr({unsimplifiedHdRoutes:this.hdRoutes,otherHdRoutes:[...this.simplificationConfig.otherHdRoutes??[]],obstacles:[...this.simplificationConfig.obstacles],connMap:this.simplificationConfig.connMap,colorMap:{...this.simplificationConfig.colorMap},outline:this.simplificationConfig.outline?[...this.simplificationConfig.outline]:void 0,minBoardEdgeClearance:this.simplificationConfig.minBoardEdgeClearance,defaultViaDiameter:this.simplificationConfig.defaultViaDiameter,useTraceWidthAwareClearance:this.simplificationConfig.useTraceWidthAwareClearance,enableVertexShortcuts:this.simplificationConfig.enableVertexShortcuts}),this.extractResult=(e)=>e.simplifiedHdRoutes;break;default:this.failed=!0,this.error=`Unknown phase: ${this.currentPhase}`}}}visualize(){if(this.activeSubSolver)return this.activeSubSolver.visualize();let e={lines:[],points:[],rects:[],circles:[],coordinateSystem:"cartesian",title:"Trace Simplification Solver"};for(let t of this.simplificationConfig.obstacles){let n="rgba(128, 128, 128, 0.2)",o=t.__zLayers?.includes(0),r=t.__zLayers?.includes(1);o&&r?n="rgba(128, 0, 128, 0.2)":o?n="rgba(255, 0, 0, 0.2)":r&&(n="rgba(0, 0, 255, 0.2)"),e.rects.push({center:t.center,width:t.width,height:t.height,fill:n,label:`Obstacle (Z: ${t.__zLayers?.join(", ")})`})}for(let t of this.simplificationConfig.otherHdRoutes??[]){for(let n=0;n<t.route.length-1;n++){let o=t.route[n],r=t.route[n+1];o.z===r.z&&e.lines.push({points:[{x:o.x,y:o.y},{x:r.x,y:r.y}],strokeColor:o.z===0?"rgba(160, 32, 32, 0.55)":"rgba(32, 32, 160, 0.55)",strokeWidth:t.traceThickness,strokeDash:[0.08,0.08],label:`${t.connectionName} immutable (z=${o.z})`})}for(let n of t.vias)e.circles.push({center:{x:n.x,y:n.y},radius:t.viaDiameter/2,fill:"rgba(96, 96, 96, 0.45)",label:`${t.connectionName} immutable via`})}for(let t of this.hdRoutes)if(t.route.length!==0){for(let n=0;n<t.route.length-1;n++){let o=t.route[n],r=t.route[n+1];o.z===r.z&&e.lines.push({points:[{x:o.x,y:o.y},{x:r.x,y:r.y}],strokeColor:o.z===0?"red":"blue",strokeWidth:t.traceThickness,label:`${t.connectionName} (z=${o.z})`})}for(let n of t.vias)e.circles.push({center:{x:n.x,y:n.y},radius:t.viaDiameter/2,fill:"rgba(255, 0, 255, 0.5)",label:`${t.connectionName} via`});if(t.jumpers&&t.jumpers.length>0){let n=XJe(t.jumpers,{color:"orange",label:t.connectionName});e.rects.push(...n.rects??[]),e.lines.push(...n.lines??[])}}return e}},Ice=class{tree;constructor(e=9){this.tree=new gV(e)}insert(e,t,n,o,r){this.tree.insert({minX:t,minY:n,maxX:o,maxY:r,data:e})}bulkLoad(e){let t=e.map(({item:n,minX:o,minY:r,maxX:i,maxY:s})=>({minX:o,minY:r,maxX:i,maxY:s,data:n}));this.tree.load(t)}search(e,t,n,o){return this.tree.search({minX:e,minY:t,maxX:n,maxY:o}).map((r)=>r.data)}clear(){this.tree.clear()}},Lsn=class{index;items=[];currentIndex=0;capacity;constructor(e){this.capacity=Math.max(1,e),this.index=new i_(this.capacity)}insert(e,t,n,o,r){if(this.currentIndex>=this.index.numItems)throw Error("Exceeded initial capacity");this.items[this.currentIndex]=e,this.index.add(t,n,o,r),this.currentIndex++}finish(){this.index.finish()}search(e,t,n,o){return this.index.search(e,t,n,o).map((r)=>this.items[r]||null).filter(Boolean)}clear(){this.items=[],this.currentIndex=0,this.index=new i_(this.capacity)}},p6e=class{idx;storage=[];constructor(e="native",t=[]){e==="flatbush"?t.length===0?(this.idx=new Ice,e="rbush"):this.idx=new Lsn(t.length):this.idx=e==="rbush"?new Ice:new class{shi=new fxr(t);insert(n){}search(n,o,r,i){let s=(n+r)/2,a=(o+i)/2,c=r-n,l=i-o;return this.shi.getNodesInArea(s,a,c,l)}clear(){}},t.forEach((n)=>this.insert(n)),e==="flatbush"&&t.length>0&&this.idx.finish?.()}insert(e){this.storage.push(e),this.idx.insert(e,e.center.x-e.width/2,e.center.y-e.height/2,e.center.x+e.width/2,e.center.y+e.height/2)}search(e){return this.idx.search(e.minX,e.minY,e.maxX,e.maxY)}searchArea(e,t,n,o){return this.search({minX:e-n/2,minY:t-o/2,maxX:e+n/2,maxY:t+o/2})}},fxr=class{constructor(e){this.obstacles=e,this.buckets=new Map;for(let t=0;t<e.length;t++){let n=e[t],o=n.center.x-n.width/2,r=n.center.y-n.height/2,i=n.center.x+n.width/2,s=n.center.y+n.height/2;for(let a=o;a<=i;a+=this.CELL_SIZE)for(let c=r;c<=s;c+=this.CELL_SIZE){let l=this.getBucketKey(a,c),h=this.buckets.get(l);h?h.push([n,t]):this.buckets.set(l,[[n,t]])}}}obstacles;buckets;CELL_SIZE=0.4;getBucketKey(e,t){return`${Math.floor(e/this.CELL_SIZE)}x${Math.floor(t/this.CELL_SIZE)}`}getNodesInArea(e,t,n,o){let r=[],i=new Set,s=t-o/2,a=e+n/2,c=t+o/2;for(let l=e-n/2;l<=a;l+=this.CELL_SIZE)for(let h=s;h<=c;h+=this.CELL_SIZE){let d=this.getBucketKey(l,h),u=this.buckets.get(d)||[];for(let _ of u)i.has(_[1])||(i.add(_[1]),r.push(_[0]))}return r}},N4=0.000000001,Lq=class extends Kr{getSolverName(){return"TraceWidthSolver"}hdRoutes;hdRoutesWithWidths=[];nominalTraceWidth;minTraceWidth;obstacleMargin;minTraceToHoleEdgeClearance;TRACE_WIDTH_SCHEDULE;connectionNominalTraceWidthMap;unprocessedRoutes=[];processedRoutes=[];currentTrace=null;cursorPosition=null;currentTraceSegmentIndex=0;currentTraceSegmentT=0;currentScheduleIndex=0;currentTargetWidth=0;hasInsufficientClearance=!1;lastCollidingObstacles=[];lastCollidingRoutes=[];lastClearance=1/0;obstacles=[];obstacleSHI;hdRouteSHI;connMap;colorMap;constructor(e){super(),this.MAX_ITERATIONS=1e6,this.hdRoutes=[...e.hdRoutes],this.minTraceWidth=e.minTraceWidth,this.obstacleMargin=e.obstacleMargin??0.15,this.minTraceToHoleEdgeClearance=e.minTraceToHoleEdgeClearance,this.nominalTraceWidth=0,this.TRACE_WIDTH_SCHEDULE=[],this.unprocessedRoutes=[...this.hdRoutes],this.connMap=e.connMap,this.colorMap=e.colorMap;let t=e.layerCount;this.obstacles=Bq(e.obstacles??[],t),this.connectionNominalTraceWidthMap=new Map;for(let n of e.connection)n.nominalTraceWidth!==void 0&&this.connectionNominalTraceWidthMap.set(n.name,n.nominalTraceWidth);this.obstacles.length>0&&(this.obstacleSHI=new p6e("flatbush",this.obstacles)),this.hdRouteSHI=new CCe(this.hdRoutes)}getNominalTraceWidthForRoute(e){let t=this.connectionNominalTraceWidthMap.get(e.connectionName);return t!==void 0?t:e.rootConnectionName?this.connectionNominalTraceWidthMap.get(e.rootConnectionName):void 0}_step(){if(!this.currentTrace){let t=this.unprocessedRoutes.shift();if(!t)return this.hdRoutesWithWidths=this.processedRoutes,void(this.solved=!0);let n=this.getNominalTraceWidthForRoute(t);if(n===void 0){let r=t.traceThickness??this.minTraceWidth;return this.processedRoutes.push(this.createRouteWithWidth(t,r)),void(this.currentTrace=null)}this.currentTrace=t,this.nominalTraceWidth=n;let o=(this.nominalTraceWidth+this.minTraceWidth)/2;return this.TRACE_WIDTH_SCHEDULE=[this.nominalTraceWidth,o],this.currentTrace.route.length<2?(this.processedRoutes.push(this.createRouteWithWidth(this.currentTrace,this.minTraceWidth)),void(this.currentTrace=null)):(this.currentScheduleIndex=0,this.currentTargetWidth=this.TRACE_WIDTH_SCHEDULE[0],void this.initializeCursor())}let e=this.stepCursorForward();(e?this.getClearanceForSegment(this.cursorPosition,this.cursorPosition):this.getMinimumRouteClearance())<this.currentTargetWidth/2+this.obstacleMargin?(this.hasInsufficientClearance=!0,this.currentScheduleIndex++,this.currentScheduleIndex<this.TRACE_WIDTH_SCHEDULE.length?(this.currentTargetWidth=this.TRACE_WIDTH_SCHEDULE[this.currentScheduleIndex],this.initializeCursor()):this.finalizeCurrentTrace(this.minTraceWidth)):e||this.finalizeCurrentTrace(this.currentTargetWidth)}initializeCursor(){if(!this.currentTrace)return;let e=this.currentTrace.route[0];this.cursorPosition={...e},this.currentTraceSegmentIndex=0,this.currentTraceSegmentT=0,this.hasInsufficientClearance=!1}stepCursorForward(){if(!this.currentTrace||!this.cursorPosition)return!1;let e=this.currentTrace.route,t=0.1;for(;t>0;){if(this.currentTraceSegmentIndex>=e.length-1)return!1;let n=e[this.currentTraceSegmentIndex],o=e[this.currentTraceSegmentIndex+1];if(n.insideJumperPad&&o.insideJumperPad){this.currentTraceSegmentIndex++,this.currentTraceSegmentT=0;continue}let r=o.x-n.x,i=o.y-n.y,s=Math.sqrt(r*r+i*i);if(s===0){this.currentTraceSegmentIndex++,this.currentTraceSegmentT=0;continue}let a=this.currentTraceSegmentT*s,c=s-a;if(t<=c){let l=a+t;return this.currentTraceSegmentT=l/s,this.cursorPosition={x:n.x+r*this.currentTraceSegmentT,y:n.y+i*this.currentTraceSegmentT,z:n.z},!0}if(t-=c,this.currentTraceSegmentIndex++,this.currentTraceSegmentT=0,this.currentTraceSegmentIndex>=e.length-1){let l=e[e.length-1];return this.cursorPosition={...l},!1}}return!0}isObstacleOwnJumperPad(e){if(!this.currentTrace?.jumpers)return!1;for(let t of this.currentTrace.jumpers){let n=Math.sqrt((e.center.x-t.start.x)**2+(e.center.y-t.start.y)**2),o=Math.sqrt((e.center.x-t.end.x)**2+(e.center.y-t.end.y)**2),r=Math.max(e.width,e.height)/2+0.01;if(n<r||o<r)return!0}return!1}getMinimumRouteClearance(){if(!this.currentTrace)return 1/0;let e=1/0,t=this.currentTrace.route;for(let n=0;n<t.length-1;n++){let o=t[n],r=t[n+1];o.z===r.z&&(o.insideJumperPad&&r.insideJumperPad||o.toNextSegmentType!=="through_obstacle"&&(e=Math.min(e,this.getClearanceForSegment(o,r))))}return e}getClearanceForSegment(e,t){if(!this.currentTrace)return 1/0;let n=this.currentTrace.rootConnectionName??this.currentTrace.connectionName,o=this.currentTargetWidth/2+this.obstacleMargin,r=1/0;this.lastCollidingObstacles=[],this.lastCollidingRoutes=[];let i=this.currentTargetWidth/2+Math.max(this.obstacleMargin,this.minTraceToHoleEdgeClearance??0),s=new Set(this.obstacleSHI?.search({minX:Math.min(e.x,t.x)-i,minY:Math.min(e.y,t.y)-i,maxX:Math.max(e.x,t.x)+i,maxY:Math.max(e.y,t.y)+i}));for(let c of this.obstacles)c.ccwRotationDegrees&&s.add(c);for(let c of s){if(!this.isObstacleOnPointLayer(c,e))continue;if(Pw(c,this.currentTrace,this.connMap))continue;if(c.obstacleId&&this.connMap?.areIdsConnected(n,c.obstacleId))continue;if(this.isObstacleOwnJumperPad(c))continue;let l=-(c.ccwRotationDegrees??0)*Math.PI/180,h=Math.cos(l),d=Math.sin(l),u={x:(e.x-c.center.x)*h-(e.y-c.center.y)*d,y:(e.x-c.center.x)*d+(e.y-c.center.y)*h},_={x:(t.x-c.center.x)*h-(t.y-c.center.y)*d,y:(t.x-c.center.x)*d+(t.y-c.center.y)*h},p=(c.isNonPlatedHole&&c.shape==="circle"?gQ(e,t,{...c.center,radius:c.width/2}):iS(u,_,{center:{x:0,y:0},width:c.width,height:c.height}))-((c.isNonPlatedHole?this.minTraceToHoleEdgeClearance??this.obstacleMargin:this.obstacleMargin)-this.obstacleMargin);r=Math.min(r,p),p<o&&this.lastCollidingObstacles.push(c)}let a=this.hdRouteSHI.getConflictingRoutesForSegment(e,t,o);for(let{conflictingRoute:c}of a){let l=c,h=l.rootConnectionName??l.connectionName;if(h===n)continue;if(this.connMap?.areIdsConnected(n,h))continue;let d=1/0;for(let u=0;u<l.route.length-1;u++){let _=l.route[u],p=l.route[u+1];_.z===p.z&&_.z===e.z&&(_.insideJumperPad&&p.insideJumperPad||_.toNextSegmentType!=="through_obstacle"&&(d=Math.min(d,s_(e,t,_,p)-(_.traceThickness??l.traceThickness)/2)))}for(let u of l.vias)d=Math.min(d,gQ(e,t,{...u,radius:l.viaDiameter/2}));r=Math.min(r,d),d<o&&this.lastCollidingRoutes.push(l)}return this.lastClearance=r,r}isObstacleOnPointLayer(e,t){return!e.__zLayers||e.__zLayers.includes(t.z)}getAdjacentNonCoincidentRoutePoint(e,t){let n=e.route[t];if(!n)return;let o=t===0?1:-1;for(let r=t+o;r>=0&&r<e.route.length;r+=o){let i=e.route[r];if(Dn(i,n)>N4)return i}}getObstacleWidthAlongVector(e,t){let n=(e.ccwRotationDegrees??0)*Math.PI/180,o=Math.cos(n),r=Math.sin(n),i=o,s=r,a=-r,c=o;return Math.abs(t.x*i+t.y*s)*e.width+Math.abs(t.x*a+t.y*c)*e.height}getTerminalPadWidthLimit(e,t,n){let o=e.route[t];if(!o)return;let r=this.getAdjacentNonCoincidentRoutePoint(e,t);if(!r)return;let i=t===0?tje(o,r):tje(r,o);if(Dn(i,{x:0,y:0})<=N4)return;let s={x:-i.y,y:i.x},a;for(let c of this.obstacles){if(!this.isObstacleOnPointLayer(c,o))continue;if(_S(o,c)>N4)continue;if(!Pw(c,e,this.connMap))continue;let l=this.getObstacleWidthAlongVector(c,s);if(l<=N4)continue;let h=this.getObstacleWidthAlongVector(c,i)/2;(!a||l<a.width||Math.abs(l-a.width)<=N4&&h>a.neckDistance)&&(a={width:l,neckDistance:h})}return!a||a.width>=n-N4?void 0:a}getRouteDistanceInfo(e){let t=[0],n=0;for(let o=1;o<e.length;o++){let r=e[o-1];n+=Dn(e[o],r),t.push(n)}return{distances:t,totalDistance:n}}interpolateRoutePointAtDistance(e,t,n){for(let o=1;o<e.length;o++){let r=t[o-1],i=t[o],s=i-r;if(n>i+N4)continue;let a=e[o-1],c=e[o];if(s<=N4)return{...c};let l=Math.max(0,Math.min(1,(n-r)/s));return{x:a.x+(c.x-a.x)*l,y:a.y+(c.y-a.y)*l,z:a.z}}return{...e[e.length-1]}}getTaperWidthAtDistance({distanceFromStart:e,totalDistance:t,startLimit:n,endLimit:o,taperDistance:r,traceWidth:i}){let s=i;if(n!==void 0&&e<=r){let a=Math.min(n.neckDistance,r);if(e<=a)s=Math.min(s,n.width);else{let c=(e-a)/Math.max(r-a,N4);s=Math.min(s,n.width+(i-n.width)*c)}}if(o!==void 0){let a=t-e;if(a<=r){let c=Math.min(o.neckDistance,r);if(a<=c)s=Math.min(s,o.width);else{let l=(a-c)/Math.max(r-c,N4);s=Math.min(s,o.width+(i-o.width)*l)}}}return s}createTerminalTaperedRoute(e,t){if(e.route.length<2)return e.route.map((l)=>({...l,traceThickness:l.traceThickness??t}));let n=this.getTerminalPadWidthLimit(e,0,t),o=this.getTerminalPadWidthLimit(e,e.route.length-1,t),{distances:r,totalDistance:i}=this.getRouteDistanceInfo(e.route);if(i<=N4){let l=Math.min(n?.width??t,o?.width??t);return e.route.map((h)=>({...h,traceThickness:l}))}let s=Math.min(Math.max(2*t,0.75),i/2),a=r.map((l,h)=>({distanceFromStart:l,originalPointIndex:h})),c=[];if(n!==void 0){c.push(n.neckDistance);for(let l=0;l<=8;l++)c.push(s*l/8)}if(o!==void 0){c.push(i-o.neckDistance);for(let l=0;l<=8;l++)c.push(i-s+s*l/8)}for(let l of c){let h=Math.max(0,Math.min(i,l));a.some((d)=>Math.abs(d.distanceFromStart-h)<=N4)||a.push({distanceFromStart:h})}return a.sort((l,h)=>{let d=l.distanceFromStart-h.distanceFromStart;return Math.abs(d)>N4?d:(l.originalPointIndex??1/0)-(h.originalPointIndex??1/0)}),a.map((l)=>{let{distanceFromStart:h}=l,d=l.originalPointIndex!==void 0?{...e.route[l.originalPointIndex]}:this.interpolateRoutePointAtDistance(e.route,r,h);return d.traceThickness=this.getTaperWidthAtDistance({distanceFromStart:h,totalDistance:i,startLimit:n,endLimit:o,taperDistance:s,traceWidth:t}),d})}createRouteWithWidth(e,t){return{connectionName:e.connectionName,rootConnectionName:e.rootConnectionName,startPcbPortId:e.startPcbPortId,endPcbPortId:e.endPcbPortId,traceThickness:t,viaDiameter:e.viaDiameter,route:this.createTerminalTaperedRoute(e,t),vias:[...e.vias],jumpers:e.jumpers}}finalizeCurrentTrace(e){if(!this.currentTrace)return;let t=this.createRouteWithWidth(this.currentTrace,e);this.processedRoutes.push(t),this.hdRouteSHI.removeRoute(t.connectionName),this.hdRouteSHI.addRoute(t),this.currentTrace=null,this.cursorPosition=null,this.hasInsufficientClearance=!1}visualize(){let e={lines:[],points:[],circles:[],rects:[],coordinateSystem:"cartesian",title:`Trace Width Solver (schedule: [${this.TRACE_WIDTH_SCHEDULE.map((o)=>o.toFixed(2)).join(", ")}]mm, fallback: ${this.minTraceWidth.toFixed(2)}mm, margin: ${this.obstacleMargin.toFixed(2)}mm)`},t=new Set(this.lastCollidingObstacles.map((o)=>o.obstacleId)),n=new Set(this.lastCollidingRoutes.map((o)=>o.connectionName));for(let o of this.obstacles){let r=t.has(o.obstacleId),i=o.__zLayers?.includes(0),s=o.__zLayers?.includes(1),a;a=r?"rgba(255, 0, 0, 0.6)":i&&s?"rgba(128, 0, 128, 0.15)":i?"rgba(255, 0, 0, 0.15)":s?"rgba(0, 0, 255, 0.15)":"rgba(128, 128, 128, 0.15)",e.rects.push({center:o.center,width:o.width,height:o.height,fill:a,stroke:r?"red":void 0,label:r?`COLLIDING: ${o.obstacleId??"obstacle"}`:`${o.obstacleId??"obstacle"} (Z: ${o.__zLayers?.join(", ")})`})}for(let o of this.processedRoutes){if(o.route.length===0)continue;let r=o.traceThickness===this.nominalTraceWidth,i=o.traceThickness===this.TRACE_WIDTH_SCHEDULE[1],s=r?"green":i?"yellow":"orange";for(let a=0;a<o.route.length-1;a++){let c=o.route[a],l=o.route[a+1];c.insideJumperPad&&l.insideJumperPad||c.z===l.z&&e.lines.push({points:[{x:c.x,y:c.y},{x:l.x,y:l.y}],strokeColor:s,strokeWidth:c.traceThickness??o.traceThickness,label:`${o.connectionName} (w=${(c.traceThickness??o.traceThickness).toFixed(2)})`})}for(let a of o.vias)e.circles.push({center:{x:a.x,y:a.y},radius:o.viaDiameter/2,fill:"rgba(255, 0, 255, 0.5)",label:`${o.connectionName} via`});if(o.jumpers&&o.jumpers.length>0){let a=m9(o.jumpers,{color:s,label:o.connectionName});e.rects.push(...a.rects??[]),e.lines.push(...a.lines??[])}}if(this.currentTrace){for(let o=0;o<this.currentTrace.route.length-1;o++){let r=this.currentTrace.route[o],i=this.currentTrace.route[o+1];r.insideJumperPad&&i.insideJumperPad||r.z===i.z&&e.lines.push({points:[{x:r.x,y:r.y},{x:i.x,y:i.y}],strokeColor:"cyan",strokeWidth:this.currentTrace.traceThickness??this.minTraceWidth,label:`Processing: ${this.currentTrace.connectionName}`})}this.cursorPosition&&(e.circles.push({center:{x:this.cursorPosition.x,y:this.cursorPosition.y},radius:this.currentTargetWidth/2,stroke:this.hasInsufficientClearance?"red":"green",fill:"none",label:`Testing width: ${this.currentTargetWidth.toFixed(2)}mm (clearance: ${this.lastClearance.toFixed(2)}mm)`}),e.points.push({x:this.cursorPosition.x,y:this.cursorPosition.y,color:"orange",label:"Cursor"}))}for(let o of this.unprocessedRoutes){if(o.route.length===0)continue;let r=n.has(o.connectionName);for(let i=0;i<o.route.length-1;i++){let s=o.route[i],a=o.route[i+1];s.z===a.z&&e.lines.push({points:[{x:s.x,y:s.y},{x:a.x,y:a.y}],strokeColor:r?"rgba(255, 0, 0, 0.8)":"rgba(128, 128, 128, 0.3)",strokeWidth:o.traceThickness??this.minTraceWidth,label:r?`COLLIDING: ${o.connectionName}`:o.connectionName})}}return e}getHdRoutesWithWidths(){return this.hdRoutesWithWidths}};var yxr=class extends Kr{getSolverName(){return"CapacityEdgeToPortSegmentSolver"}nodes;edges;capacityPaths;nodeMap;nodeEdgeMap;unprocessedNodeIds;nodePortSegments;colorMap;constructor({nodes:e,edges:t,capacityPaths:n,colorMap:o}){super(),this.nodes=e,this.edges=t,this.nodeMap=new Map(e.map((r)=>[r.capacityMeshNodeId,r])),this.nodeEdgeMap=j$(t),this.capacityPaths=n,this.colorMap=o??{},this.unprocessedNodeIds=[...new Set(n.flatMap((r)=>r.nodeIds))],this.nodePortSegments=new Map}step(){let e=this.unprocessedNodeIds.pop();if(!e)return void(this.solved=!0);let t=[];for(let i of this.capacityPaths){let s=i.nodeIds.indexOf(e);s!==-1&&t.push({path:i,indexOfNodeInPath:s})}let n=this.nodeMap.get(e),o=[];for(let{path:i,indexOfNodeInPath:s}of t){let a=i.nodeIds[s-1],c=i.nodeIds[s+1];for(let l of[a,c]){let h=this.nodeMap.get(l);if(!h)continue;let d=xxr(n,h),u=h.availableZ.filter((p)=>n.availableZ.includes(p));if(u.length===0)continue;let _={capacityMeshNodeId:e,start:d.start,end:d.end,connectionNames:[i.connectionName],rootConnectionNames:i.rootConnectionName?[i.rootConnectionName]:void 0,availableZ:u};o.push(_)}}let r=function(i){let s=[],a=i.map((c)=>({...c,connectionNames:[...c.connectionNames],rootConnectionNames:c.rootConnectionNames?[...c.rootConnectionNames]:[],availableZ:[...c.availableZ].sort((l,h)=>l-h)}));for(;a.length>0;){let c=a.pop(),l=!1;for(let h=0;h<s.length;h++){let d=s[h],u=s3e(d.start,c.start)&&s3e(d.end,c.end)||s3e(d.start,c.end)&&s3e(d.end,c.start),_=Cxr(d.availableZ,c.availableZ);if(u&&_){let p=new Set(d.connectionNames);c.connectionNames.forEach((A)=>p.add(A)),d.connectionNames=Array.from(p);let m=new Set(d.rootConnectionNames||[]);c.rootConnectionNames?.forEach((A)=>m.add(A)),d.rootConnectionNames=Array.from(m),l=!0;break}}l||s.push(c)}return s}(o);this.nodePortSegments.set(e,r)}visualize(){let e={lines:[],points:[],rects:[],circles:[]};return this.nodePortSegments.forEach((t,n)=>{this.nodeMap.get(n),t.forEach((o)=>{o.start.x,o.end.x;for(let r=0;r<o.connectionNames.length;r++){let i={x:0.05*Math.max(...o.availableZ),y:0.05*Math.max(...o.availableZ)},s={x:(o.start.x+o.end.x)/2,y:(o.start.y+o.end.y)/2},a={x:s.x+i.x,y:s.y+i.y};i.x>0&&e.lines.push({points:[s,a],strokeColor:"rgba(0, 0, 0, 0.25)",strokeDash:"5 5"}),e.points.push({x:a.x,y:a.y,label:`${n}: ${o.connectionNames.join(", ")}
availableZ: ${o.availableZ.join(",")}
nodePortSegmentId: ${o.nodePortSegmentId}`}),e.lines.push({points:[o.start,o.end],strokeColor:Qi(this.colorMap[o.connectionNames[r]],0.6)})}})}),e}};function xxr(e,t){let n={start:Math.max(e.center.x-e.width/2,t.center.x-t.width/2),end:Math.min(e.center.x+e.width/2,t.center.x+t.width/2)},o={start:Math.max(e.center.y-e.height/2,t.center.y-t.height/2),end:Math.min(e.center.y+e.height/2,t.center.y+t.height/2)};if(n.end-n.start<o.end-o.start){let r=(n.start+n.end)/2;return{start:{x:r,y:o.start},end:{x:r,y:o.end}}}{let r=(o.start+o.end)/2;return{start:{x:n.start,y:r},end:{x:n.end,y:r}}}}var EVt=0.000000001;function s3e(e,t){return Math.abs(e.x-t.x)<EVt&&Math.abs(e.y-t.y)<EVt}function Cxr(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}var bxr=class{constructor(e){this.targets=e,this.buckets=new Map;for(let t=0;t<e.length;t++){let n=e[t],o=Math.floor(n.bounds.minX/this.CELL_SIZE)*this.CELL_SIZE,r=Math.floor(n.bounds.minY/this.CELL_SIZE)*this.CELL_SIZE,i=n.bounds.maxX,s=n.bounds.maxY;for(let a=o;a<=i;a+=this.CELL_SIZE)for(let c=r;c<=s;c+=this.CELL_SIZE){let l=this.getBucketKey(a,c),h=this.buckets.get(l);h?h.push([n,t]):this.buckets.set(l,[[n,t]])}}}targets;buckets;CELL_SIZE=5;getBucketKey(e,t){return`${Math.floor(e/this.CELL_SIZE)}x${Math.floor(t/this.CELL_SIZE)}`}getTargetsInArea(e,t,n,o){let r=[],i=new Set,s=Math.floor((e-n/2)/this.CELL_SIZE)*this.CELL_SIZE,a=Math.floor((t-o/2)/this.CELL_SIZE)*this.CELL_SIZE,c=e+n/2,l=t+o/2;for(let h=s;h<=c;h+=this.CELL_SIZE)for(let d=a;d<=l;d+=this.CELL_SIZE){let u=this.getBucketKey(h,d),_=this.buckets.get(u)||[];for(let p of _)i.has(p[1])||(i.add(p[1]),r.push(p[0]))}return r}},Ixr=class extends Kr{constructor(e,t={}){super(),this.srj=e,this.opts=t,this.MAX_DEPTH=t?.capacityDepth??this.MAX_DEPTH,this.MAX_ITERATIONS=1e5,this.layerCount=e.layerCount??2,this.outlinePolygon=e.outline&&e.outline.length>=3?e.outline:void 0;let n={x:(e.bounds.minX+e.bounds.maxX)/2,y:(e.bounds.minY+e.bounds.maxY)/2},o={width:e.bounds.maxX-e.bounds.minX,height:e.bounds.maxY-e.bounds.minY},r=Math.max(o.width,o.height);this.unfinishedNodes=[{capacityMeshNodeId:this.getNextNodeId(),center:n,width:r,height:r,layer:"top",availableZ:Array.from({length:this.layerCount},(s,a)=>a),_depth:0,_containsTarget:!0,_containsObstacle:!0,_completelyInsideObstacle:!1}],this.finishedNodes=[],this.nodeToXYOverlappingObstaclesMap=new Map,this.obstacleZLayersByObstacle=new WeakMap;let i=Bq(this.srj.obstacles,this.layerCount);for(let[s,a]of this.srj.obstacles.entries())this.obstacleZLayersByObstacle.set(a,i[s].__zLayers);this.obstacleTree=new p6e("flatbush",this.srj.obstacles),this.targets=this.computeTargets(),this.targetTree=new bxr(this.targets)}srj;opts;getSolverName(){return"CapacityMeshNodeSolver"}unfinishedNodes;finishedNodes;nodeToXYOverlappingObstaclesMap;layerCount;outlinePolygon;MAX_DEPTH=4;targets;targetTree;obstacleTree;obstacleZLayersByObstacle;computeTargets(){let e=[];for(let t of this.srj.connections)for(let n of t.pointsToConnect){let o=zx(n),r=this.obstacleTree.searchArea(n.x,n.y,0.01,0.01).filter((a)=>{let c=this.getObstacleZLayers(a);return!(!c||c.length===0)&&c.some((l)=>o.some((h)=>l===ti(h,this.layerCount)))}),i={minX:n.x-0.005,minY:n.y-0.005,maxX:n.x+0.005,maxY:n.y+0.005};r.length>0&&(i={minX:Math.min(...r.map((a)=>a.center.x-a.width/2)),minY:Math.min(...r.map((a)=>a.center.y-a.height/2)),maxX:Math.max(...r.map((a)=>a.center.x+a.width/2)),maxY:Math.max(...r.map((a)=>a.center.y+a.height/2))});let s={...n,connectionName:t.name,availableZ:o.map((a)=>ti(a,this.layerCount)),bounds:i};e.push(s)}return e}getNodeBounds(e){let t=e.width/2,n=e.height/2;return{minX:e.center.x-t,maxX:e.center.x+t,minY:e.center.y-n,maxY:e.center.y+n}}getNodeRect(e){return{center:{x:e.center.x,y:e.center.y},width:e.width,height:e.height}}_nextNodeCounter=0;getNextNodeId(){return"cn"+this._nextNodeCounter++}getCapacityFromDepth(e){return(this.MAX_DEPTH-e+1)**2}getTargetIfNodeContainsTarget(e){let t=e.width>4*this.targetTree.CELL_SIZE?this.targets:this.targetTree.getTargetsInArea(e.center.x,e.center.y,e.width,e.height);for(let n of t)if(n.bounds.minX<=e.center.x+e.width/2&&n.bounds.maxX>=e.center.x-e.width/2&&n.bounds.minY<=e.center.y+e.height/2&&n.bounds.maxY>=e.center.y-e.height/2&&n.availableZ.some((o)=>e.availableZ.includes(o)))return n;return null}getXYOverlappingObstacles(e){let t=this.nodeToXYOverlappingObstaclesMap.get(e.capacityMeshNodeId);if(t)return t;let n=[],o=this.getNodeBounds(e),{minX:r,maxX:i,minY:s,maxY:a}=o,c=e._parent?this.getXYOverlappingObstacles(e._parent):this.srj.obstacles;for(let l of c){let h=l.center.x-l.width/2,d=l.center.x+l.width/2,u=l.center.y-l.height/2,_=l.center.y+l.height/2;i>=h&&r<=d&&a>=u&&s<=_?n.push(l):(r>=h&&i<=d&&s>=u&&a<=_||h>=r&&d<=i&&u>=s&&_<=a)&&n.push(l)}return this.nodeToXYOverlappingObstaclesMap.set(e.capacityMeshNodeId,n),n}getXYZOverlappingObstacles(e){let t=this.getXYOverlappingObstacles(e),n=[];for(let o of t)e.availableZ.some((r)=>this.getObstacleZLayers(o).includes(r))&&n.push(o);return n}doesNodeOverlapObstacle(e){if(this.getXYZOverlappingObstacles(e).length>0)return!0;let t=this.getNodeBounds(e);if(this.outlinePolygon){let n=this.getNodeRect(e);if(!aXt(n,this.outlinePolygon))return!0}return t.minX<this.srj.bounds.minX||t.maxX>this.srj.bounds.maxX||t.minY<this.srj.bounds.minY||t.maxY>this.srj.bounds.maxY}isNodeCompletelyInsideObstacle(e){let t=this.getXYZOverlappingObstacles(e),n=this.getNodeBounds(e);if(this.outlinePolygon){let o=this.getNodeRect(e);if(!yCe(o,this.outlinePolygon))return!0}for(let o of t){let r=o.center.x-o.width/2,i=o.center.x+o.width/2,s=o.center.y-o.height/2,a=o.center.y+o.height/2;if(n.minX>=r&&n.maxX<=i&&n.minY>=s&&n.maxY<=a)return!0}return!1}getChildNodes(e){if(e._depth===this.MAX_DEPTH)return[];let t=[],n={width:e.width/2,height:e.height/2},o=[{x:e.center.x-n.width/2,y:e.center.y-n.height/2},{x:e.center.x+n.width/2,y:e.center.y-n.height/2},{x:e.center.x-n.width/2,y:e.center.y+n.height/2},{x:e.center.x+n.width/2,y:e.center.y+n.height/2}];for(let r of o){let i={capacityMeshNodeId:this.getNextNodeId(),center:r,width:n.width,height:n.height,layer:e.layer,availableZ:e.availableZ,_depth:(e._depth??0)+1,_parent:e};i._containsObstacle=this.doesNodeOverlapObstacle(i);let s=this.getTargetIfNodeContainsTarget(i);s&&(i._targetConnectionName=s.connectionName,i.availableZ=s.availableZ,i._containsTarget=!0),i._containsObstacle&&(i._completelyInsideObstacle=this.isNodeCompletelyInsideObstacle(i)),i._completelyInsideObstacle&&!i._containsTarget||t.push(i)}return t}shouldNodeBeXYSubdivided(e){return!(e._depth>=this.MAX_DEPTH)&&(!!e._containsTarget||!(!e._containsObstacle||e._completelyInsideObstacle))}_step(){let e=this.unfinishedNodes.pop();if(!e)return void(this.solved=!0);let t=this.getChildNodes(e),n=[],o=[];for(let r of t){let i=this.shouldNodeBeXYSubdivided(r);i?o.push(r):i||r._containsObstacle?!i&&r._containsTarget&&n.push(r):n.push(r)}this.unfinishedNodes.push(...o),this.finishedNodes.push(...n)}visualize(){let e={lines:[],points:[],rects:[],circles:[],coordinateSystem:"cartesian",title:"Capacity Mesh Visualization"};if(this.outlinePolygon&&this.outlinePolygon.length>=2){let n=this.outlinePolygon.map((o)=>({x:o.x,y:o.y}));n.push({...n[0]}),e.lines.push({points:n,strokeColor:"rgba(0, 136, 255, 0.95)",label:"outline"});for(let o of this.outlinePolygon)e.points.push({x:o.x,y:o.y,color:"rgba(0, 136, 255, 0.95)"})}for(let n of this.srj.obstacles){if(n.isCopperPour)continue;let o=this.getObstacleZLayers(n);e.rects.push({center:n.center,width:n.width,height:n.height,fill:o.length===1&&o.includes(1)?"rgba(0,0,255,0.3)":"rgba(255,0,0,0.3)",stroke:"red",label:["obstacle",`z: ${o.join(",")}`].join(`
`)})}let t=[...this.finishedNodes,...this.unfinishedNodes];for(let n of t){let o=Math.min(...n.availableZ),r=this.unfinishedNodes.length>0&&n===this.unfinishedNodes[this.unfinishedNodes.length-1];e.rects.push({center:{x:n.center.x+o*n.width*0.05,y:n.center.y-o*n.width*0.05},width:Math.max(n.width-2,0.8*n.width),height:Math.max(n.height-2,0.8*n.height),fill:n._containsObstacle?"rgba(255,0,0,0.1)":{"0,1":"rgba(0,0,0,0.1)",0:"rgba(0,200,200, 0.1)",1:"rgba(0,0,200, 0.1)"}[n.availableZ.join(",")]??"rgba(0,200,200,0.1)",stroke:r?"rgba(255,165,0,0.5)":void 0,label:[n.capacityMeshNodeId,`availableZ: ${n.availableZ.join(",")}`,`target? ${n._containsTarget??!1}`,`obs? ${n._containsObstacle??!1}`,`${n.width.toFixed(2)}x${n.height.toFixed(2)}`,`capacity: ${dS(n).toFixed(2)}`].join(`
`)})}return e.rects.sort((n,o)=>n.center.y-o.center.y),this.srj.connections.forEach((n,o)=>{let r=bFt[o%bFt.length];for(let i of n.pointsToConnect){let s=zx(i);e.points.push({x:i.x,y:i.y,label:`conn-${o} (${s.join(",")})`,color:r})}}),e}getObstacleZLayers(e){return this.obstacleZLayersByObstacle.get(e)??[]}},vxr=class extends Ixr{constructor(e,t={}){super(e,t),this.srj=e,this.opts=t,this.VIA_DIAMETER=Pp(e).padDiameter}srj;opts;getSolverName(){return"CapacityMeshNodeSolver2_NodeUnderObstacle"}VIA_DIAMETER=0.6;OBSTACLE_MARGIN=0.1;OVERLAP_THRESHOLD_FOR_SINGLE_LAYER_NODES=0.2;isNodeCompletelyOutsideBounds(e){if(this.outlinePolygon){let t=this.getNodeRect(e);if(!yCe(t,this.outlinePolygon))return!0}return e.center.x+e.width/2<this.srj.bounds.minX||e.center.x-e.width/2>this.srj.bounds.maxX||e.center.y+e.height/2<this.srj.bounds.minY||e.center.y-e.height/2>this.srj.bounds.maxY}isNodePartiallyOutsideBounds(e){if(this.outlinePolygon){let t=this.getNodeRect(e);return!!yCe(t,this.outlinePolygon)&&!aXt(t,this.outlinePolygon)}return e.center.x-e.width/2<this.srj.bounds.minX||e.center.x+e.width/2>this.srj.bounds.maxX||e.center.y-e.height/2<this.srj.bounds.minY||e.center.y+e.height/2>this.srj.bounds.maxY}getObstacleCoveragePercentage(e){let t=this.getXYZOverlappingObstacles(e);if(t.length===0)return 0;let n=e.center.x-e.width/2,o=e.center.x+e.width/2,r=e.center.y-e.height/2,i=e.center.y+e.height/2,s=e.width*e.height,a=0;for(let c of t){let l=Math.max(n,c.center.x-c.width/2),h=Math.min(o,c.center.x+c.width/2),d=Math.max(r,c.center.y-c.height/2),u=Math.min(i,c.center.y+c.height/2);if(l<h&&d<u)a+=(h-l)*(u-d)}return a/s}shouldFilterSingleLayerNodeForObstacle(e){if(e.availableZ.length!==1)return!1;if(!e._containsObstacle)return!1;return this.getObstacleCoveragePercentage(e)>this.OVERLAP_THRESHOLD_FOR_SINGLE_LAYER_NODES}shouldFilterNodeForObstacle(e){return!!e._containsObstacle&&(e.availableZ.length!==1||this.shouldFilterSingleLayerNodeForObstacle(e))}createChildNodeAtPosition(e,t){let n={capacityMeshNodeId:this.getNextNodeId(),center:t.center,width:t.width,height:t.height,layer:e.layer,availableZ:t.availableZ,_depth:t._depth??(e._depth??0)+1,_parent:e},o=this.getXYZOverlappingObstacles(n);n._containsObstacle=o.length>0||this.isNodePartiallyOutsideBounds(n);let r=this.getTargetIfNodeContainsTarget(n);return r&&(n._targetConnectionName=r.connectionName,n._containsTarget=!0),n._containsObstacle&&(n._completelyInsideObstacle=this.isNodeCompletelyInsideObstacle(n)),n}getZSubdivisionChildNodes(e){if(e.availableZ.length===1)return[];let t=[],n=e.availableZ.map((o)=>[o]);for(let o of n){let r=this.createChildNodeAtPosition(e,{center:{...e.center},width:e.width,height:e.height,availableZ:o,_depth:e._depth});this.isNodeCompletelyOutsideBounds(r)||t.push(r)}return t}getChildNodes(e){if(e._depth>=this.MAX_DEPTH)return[];let t=[],n={width:e.width/2,height:e.height/2},o=[{x:e.center.x-n.width/2,y:e.center.y-n.height/2},{x:e.center.x+n.width/2,y:e.center.y-n.height/2},{x:e.center.x-n.width/2,y:e.center.y+n.height/2},{x:e.center.x+n.width/2,y:e.center.y+n.height/2}];for(let r of o){let i=this.createChildNodeAtPosition(e,{center:r,width:n.width,height:n.height,availableZ:e.availableZ});this.isNodeCompletelyOutsideBounds(i)||t.push(i)}return t}shouldNodeBeXYSubdivided(e){return!(e._depth>=this.MAX_DEPTH)&&(!!e._containsTarget||(e.availableZ.length===1&&e._depth<=this.MAX_DEPTH||!(!e._containsObstacle||e._completelyInsideObstacle)))}_step(){let e=this.unfinishedNodes.pop();if(!e)return void(this.solved=!0);let t=this.getChildNodes(e),n=[],o=[];for(let r of t){let i=this.shouldNodeBeXYSubdivided(r),s=r.availableZ.length>1&&!i&&(r._containsObstacle||r.width<this.VIA_DIAMETER+this.OBSTACLE_MARGIN);if(i)o.push(r);else if(i||this.shouldFilterNodeForObstacle(r)||s)if(!i&&r._containsTarget)if(s){let a=this.getZSubdivisionChildNodes(r);n.push(...a.filter((c)=>c._containsTarget||!this.shouldFilterNodeForObstacle(c)))}else n.push(r);else s&&n.push(...this.getZSubdivisionChildNodes(r).filter((a)=>!this.shouldFilterNodeForObstacle(a)));else n.push(r)}this.unfinishedNodes.push(...o),this.finishedNodes.push(...n)}},Sxr=class extends Kr{getSolverName(){return"CapacitySegmentToPointSolver"}unsolvedSegments;solvedSegments;nodeMap;colorMap;constructor({segments:e,colorMap:t,nodes:n}){super(),this.MAX_ITERATIONS=1e5,this.unsolvedSegments=e,this.solvedSegments=[],this.colorMap=t??{},this.nodeMap=Object.fromEntries(n.map((o)=>[o.capacityMeshNodeId,o]))}_step(){let e=!1,t=[...this.unsolvedSegments];for(let n of t){let o=n.connectionNames.length;if((!("assignedPoints"in n)||n.assignedPoints?.length!==o)&&o===1){let r={x:(n.start.x+n.end.x)/2,y:(n.start.y+n.end.y)/2,z:n.availableZ[0]};n.assignedPoints=[{connectionName:n.connectionNames[0],rootConnectionName:n.rootConnectionNames?.[0],point:r}],this.unsolvedSegments.splice(this.unsolvedSegments.indexOf(n),1),this.solvedSegments.push(n),e=!0}}if(!e&&t.length>0){let n=t[0];for(let c of t)c.connectionNames.length<n.connectionNames.length&&(n=c);let o=[...n.connectionNames].sort(),r=n.end.x-n.start.x,i=n.end.y-n.start.y,s=o.length,a=[];for(let c=1;c<=s;c++){let l=c/(s+1);a.push({x:n.start.x+r*l,y:n.start.y+i*l,z:n.availableZ[0]})}n.assignedPoints=o.map((c,l)=>({connectionName:c,rootConnectionName:n.rootConnectionNames?.[n.connectionNames.indexOf(c)],point:a[l]})),this.unsolvedSegments.splice(this.unsolvedSegments.indexOf(n),1),this.solvedSegments.push(n),e=!0}this.unsolvedSegments.length===0&&(this.solved=!0)}getNodesWithPortPoints(){if(!this.solved)throw Error("CapacitySegmentToPointSolver not solved, can't give port points yet");let e=new Map;for(let t of this.solvedSegments){let n=t.capacityMeshNodeId,o=this.nodeMap[n];e.has(n)||e.set(n,{capacityMeshNodeId:n,portPoints:[],center:o.center,width:o.width,height:o.height}),e.get(n).portPoints.push(...t.assignedPoints.map((r)=>({...r.point,connectionName:r.connectionName})))}return Array.from(e.values())}visualize(){let e={points:[],lines:this.solvedSegments.map((o)=>({points:[o.start,o.end],step:4})),rects:[],circles:[],coordinateSystem:"cartesian",title:"Capacity Segment to Point Solver"};for(let o=0;o<this.solvedSegments.length;o++){let r=this.solvedSegments[o];for(let i=0;i<r.assignedPoints.length;i++){let s=r.assignedPoints[i],a={x:s.point.x,y:s.point.y},c={x:s.point.x+0.05*s.point.z,y:s.point.y+0.05*s.point.z};s.point.z!==0&&e.lines.push({points:[a,c],strokeColor:"rgba(0, 0, 0, 0.25)",strokeDash:"5 5",step:4}),e.points.push({x:c.x,y:c.y,label:[`${r.capacityMeshNodeId}-${s.connectionName}`,`z: ${r.availableZ.join(",")}`,`nodePortSegmentId: ${r.nodePortSegmentId}`].join(`
`),color:this.colorMap[s.connectionName],step:4})}}let t=[],n={};for(let o of this.solvedSegments){let r=o.capacityMeshNodeId;n[r]||(n[r]={});for(let i of o.assignedPoints)n[r][i.connectionName]||(n[r][i.connectionName]=[]),n[r][i.connectionName].push({x:i.point.x,y:i.point.y})}for(let o in n)for(let r in n[o]){let i=n[o][r];i.length>1&&t.push({points:i,step:4,strokeDash:"5 5",strokeColor:this.colorMap[r]||"#000"})}return e.lines.push(...t),e}},fA=(e,t={})=>{let n=Math.min(...e.availableZ);return{center:!t.rectMargin||t.zOffset?{x:e.center.x+n*e.width*(t.zOffset??0.05),y:e.center.y-n*e.width*(t.zOffset??0.05)}:e.center,width:t.rectMargin?e.width-2*t.rectMargin:Math.max(e.width-0.5,0.8*e.width),height:t.rectMargin?e.height-2*t.rectMargin:Math.max(e.height-0.5,0.8*e.height),fill:e._containsObstacle?"rgba(255,0,0,0.1)":{"0,1":"rgba(0,0,0,0.1)",0:"rgba(0,200,200, 0.1)",1:"rgba(0,0,200, 0.1)"}[e.availableZ.join(",")]??"rgba(0,200,200,0.1)",layer:`z${e.availableZ.join(",")}`,label:[e.capacityMeshNodeId,`availableZ: ${e.availableZ.join(",")}`,e._containsTarget?"containsTarget":"",e._containsObstacle?"containsObstacle":""].filter(Boolean).join(`
`)}},Pxr=class extends Kr{getSolverName(){return"CapacityPathingSolver"}connectionsWithNodes;usedNodeCapacityMap;simpleRouteJson;nodes;edges;GREEDY_MULTIPLIER=1.1;MAX_CANDIDATES_IN_MEMORY=1e5;nodeMap;nodeEdgeMap;connectionNameToGoalNodeIds;colorMap;maxDepthOfNodes;activeCandidateStraightLineDistance;debug_lastNodeCostMap;hyperParameters;constructor({simpleRouteJson:e,nodes:t,edges:n,colorMap:o,MAX_ITERATIONS:r=1e6,hyperParameters:i={}}){super(),this.MAX_ITERATIONS=r,this.simpleRouteJson=e,this.nodes=t,this.edges=n,this.colorMap=o??{};let{connectionsWithNodes:s,connectionNameToGoalNodeIds:a}=this.getConnectionsWithNodes();this.connectionsWithNodes=s,this.connectionNameToGoalNodeIds=a,this.hyperParameters=i,this.usedNodeCapacityMap=new Map(this.nodes.map((c)=>[c.capacityMeshNodeId,0])),this.nodeMap=new Map(this.nodes.map((c)=>[c.capacityMeshNodeId,c])),this.nodeEdgeMap=j$(this.edges),this.maxDepthOfNodes=Math.max(...this.nodes.map((c)=>c._depth??0)),this.debug_lastNodeCostMap=new Map}getTotalCapacity(e){let t=e._depth??0;return(this.maxDepthOfNodes-t+1)**2}getConnectionsWithNodes(){let e=[],t=this.nodes.filter((o)=>o._containsTarget),n=new Map;for(let o of this.simpleRouteJson.connections){let r=[];for(let i of o.pointsToConnect){let s=this.nodes[0],a=Number.MAX_VALUE;for(let c of t){let l=Math.sqrt((c.center.x-i.x)**2+(c.center.y-i.y)**2);l<a&&(a=l,s=c)}r.push(s)}if(r.length<2)throw Error(`Not enough nodes for connection "${o.name}", only ${r.length} found`);n.set(o.name,r.map((i)=>i.capacityMeshNodeId)),e.push({connection:o,nodes:r,pathFound:!1,straightLineDistance:Dn(r[0].center,r[r.length-1].center)})}return e.sort((o,r)=>o.straightLineDistance-r.straightLineDistance),{connectionsWithNodes:e,connectionNameToGoalNodeIds:n}}currentConnectionIndex=0;candidates;visitedNodes;computeG(e,t,n){return e.g+this.getDistanceBetweenNodes(e.node,t)}computeH(e,t,n){return this.getDistanceBetweenNodes(t,n)}getBacktrackedPath(e){let t=[],n=e;for(;n;)t.push(n.node),n=n.prevCandidate;return t}getNeighboringNodes(e){return this.nodeEdgeMap.get(e.capacityMeshNodeId).flatMap((t)=>t.nodeIds.filter((n)=>n!==e.capacityMeshNodeId)).map((t)=>this.nodeMap.get(t))}getCapacityPaths(){let e=[];for(let t of this.connectionsWithNodes){let n=t.path;n&&e.push({capacityPathId:t.connection.name,connectionName:t.connection.name,rootConnectionName:t.connection.__rootConnectionNames?.[0],nodeIds:n.map((o)=>o.capacityMeshNodeId)})}return e}doesNodeHaveCapacityForTrace(e,t){let n=this.usedNodeCapacityMap.get(e.capacityMeshNodeId)??0,o=this.getTotalCapacity(e);if(e.availableZ.length===1&&!e._containsTarget&&n>0)return!1;let r=0;return e.availableZ.length>1&&t.availableZ.length===1&&(r+=0.5),n+r<o}canTravelThroughObstacle(e,t){return this.connectionNameToGoalNodeIds.get(t)?.includes(e.capacityMeshNodeId)??!1}getDistanceBetweenNodes(e,t){return Math.sqrt((e.center.x-t.center.x)**2+(e.center.y-t.center.y)**2)}reduceCapacityAlongPath(e){for(let t of e.path??[])this.usedNodeCapacityMap.set(t.capacityMeshNodeId,this.usedNodeCapacityMap.get(t.capacityMeshNodeId)+1)}isConnectedToEndGoal(e,t){return this.nodeEdgeMap.get(e.capacityMeshNodeId).some((n)=>n.nodeIds.includes(t.capacityMeshNodeId))}_step(){let e=this.connectionsWithNodes[this.currentConnectionIndex];if(!e)return void(this.solved=!0);let[t,n]=e.nodes;this.candidates||(this.candidates=[{prevCandidate:null,node:t,f:0,g:0,h:0}],this.debug_lastNodeCostMap=new Map,this.visitedNodes=new Set([t.capacityMeshNodeId]),this.activeCandidateStraightLineDistance=Dn(t.center,n.center)),this.candidates.sort((i,s)=>i.f-s.f);let o=this.candidates.shift();if(this.candidates.length>this.MAX_CANDIDATES_IN_MEMORY&&this.candidates.splice(this.MAX_CANDIDATES_IN_MEMORY,this.candidates.length-this.MAX_CANDIDATES_IN_MEMORY),!o)return console.error(`Ran out of candidates on connection ${e.connection.name}`),this.currentConnectionIndex++,this.candidates=null,this.visitedNodes=null,void(this.failed=!0);if(this.isConnectedToEndGoal(o.node,n))return e.path=this.getBacktrackedPath({prevCandidate:o,node:n,f:0,g:0,h:0}),this.reduceCapacityAlongPath(e),this.currentConnectionIndex++,this.candidates=null,void(this.visitedNodes=null);let r=this.getNeighboringNodes(o.node);for(let i of r){if(this.visitedNodes?.has(i.capacityMeshNodeId))continue;if(!this.doesNodeHaveCapacityForTrace(i,o.node))continue;let s=this.connectionsWithNodes[this.currentConnectionIndex].connection.name;if(i._containsObstacle&&!this.canTravelThroughObstacle(i,s))continue;let a=this.computeG(o,i,n),c=this.computeH(o,i,n),l=a+c*this.GREEDY_MULTIPLIER;this.debug_lastNodeCostMap.set(i.capacityMeshNodeId,{f:l,g:a,h:c});let h={prevCandidate:o,node:i,f:l,g:a,h:c};this.candidates.push(h)}this.visitedNodes.add(o.node.capacityMeshNodeId)}visualize(){let e={lines:[],points:[],rects:[],circles:[]};if(this.connectionsWithNodes)for(let n=0;n<this.connectionsWithNodes.length;n++){let o=this.connectionsWithNodes[n];if(o.path&&o.path.length>0){let r=o.path.map(({center:{x:i,y:s},width:a,availableZ:c})=>({x:i+0.005*a*(n%10+n%19),y:s+0.005*a*(n%10+n%19),availableZ:c}));e.lines.push({points:r,strokeColor:this.colorMap[o.connection.name]});for(let i=0;i<r.length;i++){let s=r[i];e.points.push({x:s.x,y:s.y,label:[`conn: ${o.connection.name}`,`node: ${o.path[i].capacityMeshNodeId}`,`z: ${s.availableZ.join(",")}`].join(`
`)})}}}for(let n of this.nodes){let o=this.usedNodeCapacityMap.get(n.capacityMeshNodeId)??0,r=this.getTotalCapacity(n),i=this.debug_lastNodeCostMap.get(n.capacityMeshNodeId);e.rects.push({...fA(n,{rectMargin:0.025,zOffset:0.01}),label:[`${n.capacityMeshNodeId}`,`${o}/${r}`,`${n.width.toFixed(2)}x${n.height.toFixed(2)}`,`g: ${i?.g!==void 0?i.g.toFixed(2):"?"}`,`h: ${i?.h!==void 0?i.h.toFixed(2):"?"}`,`f: ${i?.f!==void 0?i.f.toFixed(2):"?"}`,`z: ${n.availableZ.join(", ")}`].join(`
`),stroke:o>r+0.5?"red":void 0})}if(this.connectionsWithNodes){for(let n of this.connectionsWithNodes)if(n.connection?.pointsToConnect)for(let o of n.connection.pointsToConnect)e.points.push({x:o.x,y:o.y,label:[`pointsToConnect ${n.connection.name}`].join(`
`)})}let t=this.connectionsWithNodes[this.currentConnectionIndex];if(!this.candidates&&this.currentConnectionIndex>0&&!this.connectionsWithNodes[this.currentConnectionIndex-1].path&&(t=this.connectionsWithNodes[this.currentConnectionIndex-1]),t){let[n,o]=t.connection.pointsToConnect;e.lines.push({points:[{x:n.x,y:n.y},{x:o.x,y:o.y}],strokeColor:"red",strokeDash:"10 5"})}if(this.candidates){let n=this.candidates.slice(0,5),o=this.connectionsWithNodes[this.currentConnectionIndex].connection.name;n.forEach((r,i)=>{let s=0.5*(1-i/5),a=this.getBacktrackedPath(r);e.lines.push({points:a.map(({center:{x:c,y:l}})=>({x:c,y:l})),strokeColor:Qi(this.colorMap[o]??"red",1-s)})})}return e}},Exr=class extends Pxr{getSolverName(){return"CapacityPathingSolver5"}NEGATIVE_CAPACITY_PENALTY_FACTOR=1;REDUCED_CAPACITY_PENALTY_FACTOR=1;constructor(...e){super(...e),this.GREEDY_MULTIPLIER=2.5}get maxCapacityFactor(){return this.hyperParameters.MAX_CAPACITY_FACTOR??1}getTotalCapacity(e){return dS(e,this.maxCapacityFactor)}getNodeCapacityPenalty(e){let t=e.width+e.height,o=this.getTotalCapacity(e)-(this.usedNodeCapacityMap.get(e.capacityMeshNodeId)??0);if(o>2)return 0.05;return(t-0.05)*Math.max(1,(2-o)/(t-0.05))+0.05}getDistanceBetweenNodes(e,t){let n=e.center.x-t.center.x,o=e.center.y-t.center.y;return Math.sqrt(n**2+o**2)}computeG(e,t,n){return e.g+this.getDistanceBetweenNodes(e.node,t)+this.getNodeCapacityPenalty(t)}computeH(e,t,n){return this.getDistanceBetweenNodes(t,n)+this.getNodeCapacityPenalty(t)}},Hsn=class extends Exr{getSolverName(){return"CapacityPathingGreedySolver"}doesNodeHaveCapacityForTrace(e,t){return!0}getNodeCapacityPenalty(e){let t=this.getTotalCapacity(e)-(this.usedNodeCapacityMap.get(e.capacityMeshNodeId)??0)-1;if(t>0)return 0;let n=1;return e.availableZ.length===1&&(n=10),(0.05+2*Math.abs(t))*n}};function MVt(e,t,n){let o=t.x-e.x,r=t.y-e.y;if(Math.abs(o)<0.000000001&&Math.abs(r)<0.000000001)return e;let i=n.width/2,s=n.height/2,a=n.center.x-i,c=n.center.x+i,l=n.center.y-s,h=n.center.y+s,d=0,u=1/0;if(Math.abs(o)>0.000000001){let _=(a-e.x)/o,p=(c-e.x)/o;d=Math.max(d,Math.min(_,p)),u=Math.min(u,Math.max(_,p))}else if(e.x<a||e.x>c)return e;if(Math.abs(r)>0.000000001){let _=(l-e.y)/r,p=(h-e.y)/r;d=Math.max(d,Math.min(_,p)),u=Math.min(u,Math.max(_,p))}else if(e.y<l||e.y>h)return e;if(u<d||d===1/0||d<-1e9)return e;return{x:e.x+o*d,y:e.y+r*d}}function Mxr(e,t){let n=e.center,o=t.center,r=MVt(n,o,e),i=MVt(o,n,t),s=o.x-n.x,a=o.y-n.y,c=Math.sqrt(s*s+a*a),l=r,h=i;if(c>0.000000001){let d={x:s/c,y:a/c},u=0.3*e.width,_=0.3*t.width;u+_<Math.sqrt((i.x-r.x)**2+(i.y-r.y)**2)?(l={x:r.x+d.x*u,y:r.y+d.y*u},h={x:i.x-d.x*_,y:i.y-d.y*_}):(l=r,h=i)}return{lineStart:l,lineEnd:h}}var ebe=(e)=>{let{usedCapacity:t,totalCapacity:n,layerCount:o}=e;if(t<n)return 0;if(n<1&&t<=1)return 0;if(o===1&&t>1)return 1-0.01**t;let r=t/n-1;return 1-Math.exp(-2*r)},pKe=(e,t,n)=>{if(n._containsTarget)return 0;if(e<=t)return 0;let o=1-ebe({usedCapacity:e,totalCapacity:t,layerCount:n.availableZ.length});return o<=0?-1e9:Math.log(o)},ice=({totalNodeCapacityMap:e,usedNodeCapacityMap:t,nodeMap:n,sectionNodeIds:o})=>{let r=0,i=o??new Set(t.keys());for(let s of i){if(!e.has(s))continue;let a=n.get(s);if(!a)continue;let c=e.get(s),l=t.get(s)??0;r+=pKe(l,c,a)}return r};function KJe({sectionNodes:e,sectionEdges:t,sectionConnectionTerminals:n,completedPaths:o,nodeMap:r,colorMap:i,centerNodeId:s,title:a,nodeOpacity:c=0.1,usedNodeCapacityMap:l,totalCapacityMap:h}){let d={points:[],lines:[],rects:[],circles:[],title:a},u=new Set(e.map((_)=>_.capacityMeshNodeId));for(let _ of e){let p=`rgba(128, 128, 128, ${c})`,m=`rgba(128, 128, 128, ${c})`,A=_.availableZ??[],g=A.includes(0),f=A.includes(1);g&&f?(p=`rgba(128, 0, 128, ${c})`,m=`rgba(128, 0, 128, ${c})`):g?(p=`rgba(0, 0, 255, ${c})`,m=`rgba(0, 0, 255, ${c})`):f&&(p=`rgba(255, 0, 0, ${c})`,m=`rgba(255, 0, 0, ${c})`),s&&_.capacityMeshNodeId===s&&(p=`rgba(0, 255, 0, ${c})`,m=`rgba(0, 128, 0, ${c})`),d.rects.push({...fA(_),fill:p,stroke:m,label:`${_.capacityMeshNodeId}
(Section Node)
Z: ${A.join(",")}`});let y=d.rects.length-1;if(l&&h){let x=l.get(_.capacityMeshNodeId)??0,C=h.get(_.capacityMeshNodeId)??0,b=C>0?(x/C*100).toFixed(1):"N/A",I=ebe({usedCapacity:x,totalCapacity:C,layerCount:_.availableZ.length});d.rects[y].label+=`
${x.toFixed(1)} / ${C.toFixed(1)}
${b}% (Pf: ${(100*I).toFixed(1)}%)`,I>0.2&&(d.rects[y].stroke=Qi("red",0.7*(0.8+c)))}}for(let _ of t){let[p,m]=_.nodeIds,A=r.get(p),g=r.get(m);if(A&&g){let{lineStart:f,lineEnd:y}=Mxr(A,g);d.lines.push({points:[f,y],strokeColor:`rgba(0, 0, 0, ${0.2*Math.min(1,c/0.1)})`})}}return n.forEach((_,p)=>{let m=r.get(_.startNodeId),A=r.get(_.endNodeId),g=i[_.connectionName]??"black",f=m&&u.has(m.capacityMeshNodeId),y=A&&u.has(A.capacityMeshNodeId),x=(p+p/50)%5,C=0,b=0,I=0,v=0;if(f&&m){let P=0.02*Math.min(m.width,m.height);C=P*x,b=P*x,d.points.push({x:m.center.x+C,y:m.center.y+b,color:g,label:`Start: ${_.connectionName}
(${_.startNodeId})`}),d.lines.push({points:[{x:m.center.x,y:m.center.y},{x:m.center.x+C,y:m.center.y+b}],strokeColor:"gray",strokeDash:"2 2"})}if(y&&A){let P=0.02*Math.min(A.width,A.height);I=P*x,v=P*x,d.points.push({x:A.center.x+I,y:A.center.y+v,color:g,label:`End: ${_.connectionName}
(${_.endNodeId})`}),d.lines.push({points:[{x:A.center.x,y:A.center.y},{x:A.center.x+I,y:A.center.y+v}],strokeColor:"gray",strokeDash:"2 2"})}f&&y&&m&&A&&d.lines.push({points:[{x:m.center.x+C,y:m.center.y+b},{x:A.center.x+I,y:A.center.y+v}],strokeColor:g,strokeDash:"5 5"})}),o&&o.forEach((_,p)=>{if(_.path&&_.path.length>0){let m=i[_.connectionName]??"gray",A={x:(p+p/50)%5*0.03,y:(p+p/50)%5*0.03};d.lines.push({points:_.path.map(({center:{x:g,y:f}})=>({x:g+A.x,y:f+A.y})),strokeColor:Qi(m,0.2)})}}),d}var wxr=class extends Kr{getSolverName(){return"CapacityPathingSingleSectionSolver"}GREEDY_MULTIPLIER=1.5;sectionNodes;sectionEdges;sectionConnectionTerminals;nodeMap;nodeEdgeMap;colorMap;usedNodeCapacityMap;totalNodeCapacityMap;centerNodeId;currentSectionScore=0;MAX_CANDIDATES_IN_MEMORY=1e4;currentConnectionIndex=0;candidates=null;visitedNodes=null;queuedNodes=null;activeCandidateStraightLineDistance;debug_lastNodeCostMap=new Map;maxCapacityFactor=1;constructor(e){super(),this.MAX_ITERATIONS=1e4,this.centerNodeId=e.centerNodeId,this.sectionNodes=e.sectionNodes,this.sectionEdges=e.sectionEdges,this.sectionConnectionTerminals=e.sectionConnectionTerminals.map((n)=>({...n,path:void 0})),this.nodeMap=e.nodeMap??new Map(this.sectionNodes.map((n)=>[n.capacityMeshNodeId,n])),this.nodeEdgeMap=e.nodeEdgeMap??j$(this.sectionEdges),this.colorMap=e.colorMap??{},this.usedNodeCapacityMap=new Map(this.sectionNodes.map((n)=>[n.capacityMeshNodeId,0])),this.totalNodeCapacityMap=new Map(this.sectionNodes.map((n)=>[n.capacityMeshNodeId,this.getTotalCapacity(n)]));let t=new Set(this.sectionNodes.map((n)=>n.capacityMeshNodeId));this.currentSectionScore=ice({totalNodeCapacityMap:this.totalNodeCapacityMap,usedNodeCapacityMap:this.usedNodeCapacityMap,nodeMap:this.nodeMap,sectionNodeIds:t}),e.hyperParameters?.SHUFFLE_SEED&&(this.sectionConnectionTerminals=db(this.sectionConnectionTerminals,e.hyperParameters?.SHUFFLE_SEED))}getTotalCapacity(e){return dS(e,this.maxCapacityFactor)}getNodeCapacityPenalty(e){if(!this.nodeMap.has(e.capacityMeshNodeId))return 1/0;let t=this.getTotalCapacity(e)-(this.usedNodeCapacityMap.get(e.capacityMeshNodeId)??0)-1;if(t>0)return 0;let n=1;return e.availableZ.length===1&&(n=10),(0.05+t**2*4)*n}getDistanceBetweenNodes(e,t){let n=e.center.x-t.center.x,o=e.center.y-t.center.y;return Math.sqrt(n**2+o**2)}computeG(e,t,n){return e.g+this.getDistanceBetweenNodes(e.node,t)+this.getNodeCapacityPenalty(t)}computeH(e,t,n){return this.getDistanceBetweenNodes(t,n)+this.getNodeCapacityPenalty(t)}getBacktrackedPath(e){let t=[],n=e;for(;n;){if(t.push(n.node),!this.nodeMap.has(n.node.capacityMeshNodeId)){console.warn("Backtracked path went outside section bounds");break}n=n.prevCandidate}return t.reverse()}getNeighboringNodes(e){return this.nodeMap.has(e.capacityMeshNodeId)?this.nodeEdgeMap.get(e.capacityMeshNodeId)?.flatMap((t)=>t.nodeIds.filter((n)=>n!==e.capacityMeshNodeId)).map((t)=>this.nodeMap.get(t)).filter(Boolean)??[]:[]}isConnectedToEndGoal(e,t){return!(!this.nodeMap.has(e.capacityMeshNodeId)||!this.nodeMap.has(t.capacityMeshNodeId))&&(this.nodeEdgeMap.get(e.capacityMeshNodeId)??[]).some((n)=>n.nodeIds.includes(t.capacityMeshNodeId))}doesNodeHaveCapacityForTrace(e,t){return!0}reduceCapacityAlongPath(e){for(let t of e)if(this.usedNodeCapacityMap.has(t.capacityMeshNodeId)){let n=t.capacityMeshNodeId,o=this.nodeMap.get(n);if(!o){console.warn(`Node ${n} from path not found in section's nodeMap during score update.`);continue}let r=this.totalNodeCapacityMap.get(n),i=this.usedNodeCapacityMap.get(n)??0,s=pKe(i,r,o);this.currentSectionScore-=s;let a=i+1;this.usedNodeCapacityMap.set(n,a);let c=pKe(a,r,o);this.currentSectionScore+=c}}getSolvedSectionScore(){return this.currentSectionScore}_step(){let e=this.sectionConnectionTerminals[this.currentConnectionIndex];if(!e)return void(this.solved=!0);let t=this.nodeMap.get(e.startNodeId),n=this.nodeMap.get(e.endNodeId);if(!t||!n)return console.error(`Start or end node not found in section for connection ${e.connectionName}`),this.currentConnectionIndex++,this.candidates=null,void(this.visitedNodes=null);this.candidates||this._setupAStar(t,n);let o=this.candidates;if(o.length===0)return void this._handleCandidatesExhausted(e);o.sort((s,a)=>s.f-a.f);let r=o.shift();if(o.length>this.MAX_CANDIDATES_IN_MEMORY&&o.splice(this.MAX_CANDIDATES_IN_MEMORY,o.length-this.MAX_CANDIDATES_IN_MEMORY),this.visitedNodes.add(r.node.capacityMeshNodeId),r.node.capacityMeshNodeId===n.capacityMeshNodeId)return void this._handleGoalReached(r,e,n);let i=this.getNeighboringNodes(r.node);for(let s of i){if(this.queuedNodes?.has(s.capacityMeshNodeId))continue;if(!this.doesNodeHaveCapacityForTrace(s,r.node))continue;if(s._containsObstacle){let d=s.capacityMeshNodeId===e.startNodeId,u=s.capacityMeshNodeId===e.endNodeId;if(!d&&!u)continue}let a=this.computeG(r,s,n),c=this.computeH(r,s,n),l=a+c*this.GREEDY_MULTIPLIER;this.debug_lastNodeCostMap.set(s.capacityMeshNodeId,{f:l,g:a,h:c});let h={prevCandidate:r,node:s,f:l,g:a,h:c};this.queuedNodes?.add(s.capacityMeshNodeId),o.push(h)}}computeProgress(){let e=this.sectionConnectionTerminals.length;if(e===0)return 1;let t=this.currentConnectionIndex/e;if(this.currentConnectionIndex<e&&this.candidates&&this.candidates.length>0&&this.activeCandidateStraightLineDistance&&this.activeCandidateStraightLineDistance>0){let n=this.candidates.reduce((o,r)=>r.f<o.f?r:o);t+=Math.max(0,Math.min(1,1-n.h/this.activeCandidateStraightLineDistance))/e}else this.solved&&(t=1);return Math.min(1,t)}_setupAStar(e,t){this.candidates=[{prevCandidate:null,node:e,f:0,g:0,h:0}],this.visitedNodes=new Set([e.capacityMeshNodeId]),this.debug_lastNodeCostMap=new Map,this.activeCandidateStraightLineDistance=Dn(e.center,t.center);let n=this.computeH(null,e,t);this.candidates[0].h=n,this.candidates[0].f=n*this.GREEDY_MULTIPLIER,this.debug_lastNodeCostMap.set(e.capacityMeshNodeId,{f:this.candidates[0].f,g:0,h:n}),this.queuedNodes=new Set([e.capacityMeshNodeId])}_handleCandidatesExhausted(e){console.error(`Ran out of candidates for section connection ${e.connectionName}`),this.currentConnectionIndex++,this.candidates=null,this.visitedNodes=null,this.queuedNodes=null}_handleGoalReached(e,t,n){let o=this.getBacktrackedPath(e);t.path=o,this.reduceCapacityAlongPath(o),this.currentConnectionIndex++,this.candidates=null,this.visitedNodes=null,this.queuedNodes=null}visualize(){let e=this.sectionConnectionTerminals.filter((n)=>n.path&&n.path.length>0).map((n)=>({connectionName:n.connectionName,path:n.path})),t=KJe({sectionNodes:this.sectionNodes,sectionEdges:this.sectionEdges,sectionConnectionTerminals:this.sectionConnectionTerminals,completedPaths:e,nodeMap:this.nodeMap,colorMap:this.colorMap,centerNodeId:null,title:`Section Pathing: Conn ${this.currentConnectionIndex+1}/${this.sectionConnectionTerminals.length} (${this.sectionNodes.length} nodes)`,nodeOpacity:0.1});for(let n of this.sectionNodes){let o=t.rects.findIndex((r)=>r.label?.includes(n.capacityMeshNodeId));if(o!==-1){let r=this.debug_lastNodeCostMap.get(n.capacityMeshNodeId),i=this.usedNodeCapacityMap.get(n.capacityMeshNodeId)??0,s=this.getTotalCapacity(n),a=`${i.toFixed(1)}/${s.toFixed(1)}`,c=r?`f:${r.f.toFixed(1)} g:${r.g.toFixed(1)} h:${r.h.toFixed(1)}`:"cost:?";t.rects[o].label=[n.capacityMeshNodeId,`Cap: ${a}`,c,`Z: ${n.availableZ.join(",")}`].join(`
`),i>s&&(t.rects[o].stroke=Qi("red",0.7))}}if(this.candidates&&this.candidates.length>0){let n=this.candidates.slice().sort((s,a)=>s.f-a.f).slice(0,5),o=this.sectionConnectionTerminals[this.currentConnectionIndex],r=o?.connectionName??"unknown",i=this.colorMap[r]??"purple";n.forEach((s,a)=>{let c=0.8*(1-a/5),l=this.getBacktrackedPath(s);l.length>0&&t.lines.push({points:l.map(({center:{x:h,y:d}})=>({x:h,y:d})),strokeColor:Qi(i,1-c),strokeWidth:0.05})})}return t}},a3e=(e)=>Array.from({length:e},(t,n)=>n),Bxr=class extends kbe{getSolverName(){return"HyperCapacityPathingSingleSectionSolver"}constructorParams;constructor(e){super(),this.MAX_ITERATIONS=1e5,this.constructorParams=e}computeG(e){return-e.getSolvedSectionScore()}computeH(e){return 0}getCombinationDefs(){let e=this.constructorParams.sectionConnectionTerminals.length;return e===2?[["orderings2_for2"]]:e===3?[["orderings6_for3"]]:e===4?[["orderings24_for4"]]:[["orderings30"]]}getFailureMessage(){return`All CapacityPathingSingleSection solvers failed for "${this.centerNodeId}"`}getHyperParameterDefs(){return[{name:"orderings2_for2",possibleValues:a3e(2).map((e)=>({SHUFFLE_SEED:e}))},{name:"orderings6_for3",possibleValues:a3e(6).map((e)=>({SHUFFLE_SEED:e}))},{name:"orderings24_for4",possibleValues:a3e(24).map((e)=>({SHUFFLE_SEED:e}))},{name:"orderings30",possibleValues:a3e(30).map((e)=>({SHUFFLE_SEED:e}))}]}generateSolver(e){return new wxr({...this.constructorParams,hyperParameters:{...this.constructorParams.hyperParameters,...e}})}onSolve({solver:e}){this.winningSolver=e}get centerNodeId(){return this.constructorParams.centerNodeId}get sectionNodes(){return this.constructorParams.sectionNodes}get sectionConnectionTerminals(){return this.winningSolver?.sectionConnectionTerminals}},Txr=(e)=>Math.floor(10*e)/10,Dxr=class extends Bxr{cacheHit=!1;cacheProvider;hasAttemptedToUseCache=!1;sectionNodeIdSet;cachedSectionConnectionTerminals=null;sectionScore=0;constructor(e){e.nodeMap=e.nodeMap??new Map(e.sectionNodes.map((t)=>[t.capacityMeshNodeId,t])),super(e),this.sectionNodeIdSet=new Set(e.sectionNodes.map((t)=>t.capacityMeshNodeId)),this.cacheProvider=e.cacheProvider===void 0?_9():e.cacheProvider}_step(){!this.hasAttemptedToUseCache&&this.cacheProvider&&this.attemptToUseCacheSync()||(super._step(),(this.solved||this.failed)&&this.cacheProvider&&this.saveToCacheSync())}_computeBfsOrderingOfNodesInSection(){let e=new Set(this.constructorParams.centerNodeId),t=[],n=[{ancestorCapacitySum:0,capacity:0,g:0,capacityMeshNodeId:this.constructorParams.centerNodeId}];for(;n.length>0;){n.sort((i,s)=>s.g-i.g);let o=n.pop();if(!o)break;t.push(o.capacityMeshNodeId);let r=this.constructorParams.nodeEdgeMap.get(o.capacityMeshNodeId).flatMap((i)=>i.nodeIds).filter((i)=>!e.has(i)).filter((i)=>this.sectionNodeIdSet.has(i));for(let i of r){e.add(i);let s=this.constructorParams.nodeMap.get(i),a=dS(s);n.push({ancestorCapacitySum:o.g,capacity:a,g:o.g+a,capacityMeshNodeId:i})}}return t}computeCacheKeyAndTransform(){let e=this._computeBfsOrderingOfNodesInSection(),t=new Map,n=new Map;e.forEach((d,u)=>{let _=`node${u}`;t.set(d,_),n.set(_,d)});let o={};for(let d of e){let u=t.get(d),_=this.constructorParams.nodeMap.get(d),p=dS(_);o[u]=Txr(p).toFixed(1)}let r=new Set,i=[];for(let d of e){let u=t.get(d),_=this.constructorParams.nodeEdgeMap.get(d)??[];for(let p of _){let m=p.nodeIds.find((A)=>A!==d);if(this.sectionNodeIdSet.has(m)){let A=[u,t.get(m)].sort(),g=`${A[0]}-${A[1]}`;r.has(g)||(i.push(A),r.add(g))}}}i.sort((d,u)=>d[0]!==u[0]?d[0].localeCompare(u[0]):d[1].localeCompare(u[1]));let s={},a=new Map,c=new Map;for(let d of this.constructorParams.sectionConnectionTerminals){let u=t.get(d.startNodeId),_=t.get(d.endNodeId),[p,m]=[u,_].sort(),A=`${p}->${m}`,g=c.get(A)??0;c.set(A,g+1);let f=`${p}->${m}::${g}`;s[f]={start:p,end:m},a.set(f,d.connectionName)}let l=`capacitypathing:${Fsn.default({node_capacity_map:o,node_edge_map:i,terminals:s})}`,h={cacheSpaceToRealConnectionId:a,cacheSpaceToRealNodeId:n};return this.cacheKey=l,this.cacheToSolveSpaceTransform=h,{cacheKey:l,cacheToSolveSpaceTransform:h}}applyCachedSolution(e){if(!this.cacheToSolveSpaceTransform)return console.error("Cache transform not available, cannot apply cached solution."),void(this.failed=!0);if(!e.success)return this.failed=!0,void(this.cacheHit=!0);this.cachedSectionConnectionTerminals=[];let{cacheSpaceToRealNodeId:t,cacheSpaceToRealConnectionId:n}=this.cacheToSolveSpaceTransform;for(let[o,r]of Object.entries(e.solutionPaths)){let i=n.get(o);if(!i){console.warn(`Could not find real connection name for ${o}`);continue}let s=this.constructorParams.sectionConnectionTerminals.find((c)=>c.connectionName===i);if(!s){console.warn(`Could not find original terminal for connection name ${i}`);continue}let a=r.map((c)=>{let l=t.get(c);if(!l)throw Error(`Could not map cache node ID ${c} to real node ID for connection ${i}`);let h=this.constructorParams.nodeMap.get(l);if(!h)throw Error(`Could not find node with ID ${l} in nodeMap for connection ${i}`);return h});this.cachedSectionConnectionTerminals.push({...s,path:a})}this.sectionScore=e.sectionScore,this.solved=!0,this.cacheHit=!0}attemptToUseCacheSync(){if(this.hasAttemptedToUseCache=!0,!this.cacheProvider?.isSyncCache)return console.log("Cache provider is not synchronous, skipping sync cache check."),!1;if(this.cacheKey||this.computeCacheKeyAndTransform(),!this.cacheKey)return console.error("Failed to compute cache key."),!1;try{let e=this.cacheProvider.getCachedSolutionSync(this.cacheKey);if(e)return this.applyCachedSolution(e),!0}catch(e){console.error("Error attempting to use cache:",e)}return!1}saveToCacheSync(){if(!this.cacheKey)return void console.error("Cannot save to cache without cache key.");if(!this.cacheToSolveSpaceTransform)return void console.error("Cache transform not available, cannot save solution to cache.");let e;if(this.failed)e={success:!1};else{if(!this.solved)return;{let t={},{cacheSpaceToRealNodeId:n,cacheSpaceToRealConnectionId:o}=this.cacheToSolveSpaceTransform,r=new Map;for(let[a,c]of n)r.set(c,a);let i=new Map;for(let[a,c]of o)i.set(c,a);let s=[];if(super.sectionConnectionTerminals){for(let a of super.sectionConnectionTerminals)if(a.path&&a.path.length>0){let c=a.path.map((l)=>l.capacityMeshNodeId);s.push([a.connectionName,c])}}for(let[a,c]of s){let l=i.get(a);if(!l){console.warn(`Could not find cache space connection ID for ${a} when saving to cache.`);continue}let h=c.map((d)=>{let u=r.get(d);if(!u)throw Error(`Could not map real node ID ${d} to cache node ID for connection ${a} when saving to cache.`);return u});t[l]=h}e={success:!0,sectionScore:this.sectionScore,solutionPaths:t}}}try{this.cacheProvider?.setCachedSolutionSync(this.cacheKey,e)}catch(t){console.error("Error saving solution to cache:",t)}}get sectionConnectionTerminals(){return this.cacheHit&&this.solved&&this.cachedSectionConnectionTerminals?(console.log("returning the cached section connection terminals"),this.cachedSectionConnectionTerminals):super.sectionConnectionTerminals}visualize(){if(!this.cacheHit)return super.visualize();return KJe({sectionNodes:this.constructorParams.sectionNodes,sectionEdges:this.constructorParams.sectionEdges,sectionConnectionTerminals:this.cachedSectionConnectionTerminals,completedPaths:this.cachedSectionConnectionTerminals.map((t)=>({connectionName:t.connectionName,path:t.path})),nodeMap:this.constructorParams.nodeMap,colorMap:this.constructorParams.colorMap,title:"CachedHyperCapacityPathingSingleSectionSolver"})}},Nxr=class extends Kr{getSolverName(){return"CapacityPathingMultiSectionSolver"}simpleRouteJson;nodes;edges;nodeEdgeMap;connectionsWithNodes=[];colorMap;initialSolver;cacheProvider;stage="initialization";nodeMap=new Map;allNodeIdsSet;usedNodeCapacityMap=new Map;totalNodeCapacityMap=new Map;nodeCapacityPercentMap=new Map;nodeOptimizationAttemptCountMap=new Map;currentSection=null;sectionSolver=null;currentScheduleIndex=0;stats;OPTIMIZATION_SCHEDULE=[{MAX_ATTEMPTS_PER_NODE:1,MAX_EXPANSION_DEGREES:3,MINIMUM_PROBABILITY_OF_FAILURE_TO_OPTIMIZE:0.05},{MAX_ATTEMPTS_PER_NODE:2,MAX_EXPANSION_DEGREES:5,MINIMUM_PROBABILITY_OF_FAILURE_TO_OPTIMIZE:0.2},{MAX_ATTEMPTS_PER_NODE:3,MAX_EXPANSION_DEGREES:7,MINIMUM_PROBABILITY_OF_FAILURE_TO_OPTIMIZE:0.9}];get currentSchedule(){return this.OPTIMIZATION_SCHEDULE[this.currentScheduleIndex]??null}constructor(e){super(),this.stats={successfulOptimizations:0,failedOptimizations:0,failedSectionSolvers:0,startingScore:0,scheduleScores:this.OPTIMIZATION_SCHEDULE.map(({MAX_EXPANSION_DEGREES:t})=>({maxExpansionDegrees:t,endingScore:0,endingHighestNodePf:0,sectionAttempts:0})),cacheHits:0,cacheMisses:0},this.MAX_ITERATIONS=e.MAX_ITERATIONS??1e7,this.cacheProvider=e.cacheProvider,this.simpleRouteJson=e.simpleRouteJson,this.nodes=e.nodes,this.edges=e.edges,this.nodeEdgeMap=j$(this.edges),this.colorMap=e.colorMap??{},this.nodeMap=new Map(this.nodes.map((t)=>[t.capacityMeshNodeId,t])),this.nodeEdgeMap=j$(this.edges),this.initialSolver=e.initialPathingSolver||new Hsn({simpleRouteJson:this.simpleRouteJson,nodes:this.nodes,edges:this.edges,colorMap:this.colorMap}),this.activeSubSolver=this.initialSolver;for(let t of this.nodes){let n=this.initialSolver.getTotalCapacity(t);this.totalNodeCapacityMap.set(t.capacityMeshNodeId,n)}this.allNodeIdsSet=new Set(this.nodes.map((t)=>t.capacityMeshNodeId))}_stepInitialization(){if(this.initialSolver?.step(),this.initialSolver?.failed)return this.failed=!0,void(this.error=this.initialSolver.error);if(this.initialSolver?.solved){this.usedNodeCapacityMap=new Map(this.initialSolver.usedNodeCapacityMap);for(let e of this.nodes){let t=this.totalNodeCapacityMap.get(e.capacityMeshNodeId)??0,n=this.usedNodeCapacityMap.get(e.capacityMeshNodeId)??0,o=t>0?n/t:0;this.nodeCapacityPercentMap.set(e.capacityMeshNodeId,o),this.nodeOptimizationAttemptCountMap.set(e.capacityMeshNodeId,0)}this.connectionsWithNodes=this.initialSolver.connectionsWithNodes,this.stats.startingScore=ice({totalNodeCapacityMap:this.totalNodeCapacityMap,usedNodeCapacityMap:this.usedNodeCapacityMap,nodeMap:this.nodeMap,sectionNodeIds:this.allNodeIdsSet}),this.stage="section-optimization"}}_getNextNodeToOptimize(){let e=0,t=0,n=null;for(let o of this.nodes){if(o._containsTarget)continue;let r=this.nodeOptimizationAttemptCountMap.get(o.capacityMeshNodeId),i=this.totalNodeCapacityMap.get(o.capacityMeshNodeId),s=ebe({usedCapacity:this.usedNodeCapacityMap.get(o.capacityMeshNodeId)??0,totalCapacity:i,layerCount:o.availableZ.length}),a=s/(r+1);r<this.currentSchedule.MAX_ATTEMPTS_PER_NODE&&a>e&&s>this.currentSchedule.MINIMUM_PROBABILITY_OF_FAILURE_TO_OPTIMIZE&&(e=a,t=s,n=o.capacityMeshNodeId)}return n}getOverallScore(){let e=0;for(let t of this.nodes){if(t._containsTarget)continue;let n=this.totalNodeCapacityMap.get(t.capacityMeshNodeId),o=ebe({usedCapacity:this.usedNodeCapacityMap.get(t.capacityMeshNodeId)??0,totalCapacity:n,layerCount:t.availableZ.length});o>e&&(e=o)}return{highestNodePf:e,score:ice({totalNodeCapacityMap:this.totalNodeCapacityMap,usedNodeCapacityMap:this.usedNodeCapacityMap,nodeMap:this.nodeMap,sectionNodeIds:this.allNodeIdsSet})}}_stepSectionOptimization(){if(!this.sectionSolver){let e=this._getNextNodeToOptimize();if(!e){let{highestNodePf:n,score:o}=this.getOverallScore();return this.stats.scheduleScores[this.currentScheduleIndex].endingHighestNodePf=n,this.stats.scheduleScores[this.currentScheduleIndex].endingScore=o,this.currentScheduleIndex++,void(this.currentSchedule||(this.solved=!0))}let t=((n)=>{let{centerNodeId:o,connectionsWithNodes:r,nodeMap:i,edges:s,nodeEdgeMap:a,expansionDegrees:c}=n,l=new Set,h=[{nodeId:o,depth:0}];l.add(o);let d=0;for(;d<h.length;){let{nodeId:m,depth:A}=h[d++];if(A>=c)continue;let g=a.get(m)?.flatMap((f)=>f.nodeIds.filter((y)=>y!==m))??[];for(let f of g)l.has(f)||(l.add(f),h.push({nodeId:f,depth:A+1}))}let u=Array.from(l).map((m)=>i.get(m)),_=s.filter((m)=>{let[A,g]=m.nodeIds;return l.has(A)&&l.has(g)}),p=[];for(let m of r){if(!m.path)continue;let A=null,g=null;for(let f of m.path)if(l.has(f.capacityMeshNodeId)){A=f.capacityMeshNodeId;break}for(let f=m.path.length-1;f>=0;f--){let y=m.path[f];if(l.has(y.capacityMeshNodeId)){g=y.capacityMeshNodeId;break}}A&&g&&p.push({connectionName:m.connection.name,startNodeId:A,endNodeId:g})}return{sectionConnectionTerminals:p,sectionNodes:u,sectionEdges:_,centerNodeId:o}})({centerNodeId:e,connectionsWithNodes:this.connectionsWithNodes,nodeMap:this.nodeMap,edges:this.edges,expansionDegrees:this.currentSchedule.MAX_EXPANSION_DEGREES,nodeEdgeMap:this.nodeEdgeMap});this.stats.scheduleScores[this.currentScheduleIndex].sectionAttempts++,this.currentSection=t,this.sectionSolver=new Dxr({sectionNodes:this.currentSection.sectionNodes,sectionEdges:this.currentSection.sectionEdges,sectionConnectionTerminals:this.currentSection.sectionConnectionTerminals,colorMap:this.colorMap,centerNodeId:this.currentSection.centerNodeId,nodeEdgeMap:this.nodeEdgeMap,hyperParameters:{EXPANSION_DEGREES:this.currentSchedule.MAX_EXPANSION_DEGREES},cacheProvider:this.cacheProvider}),this.activeSubSolver=this.sectionSolver,this.nodeOptimizationAttemptCountMap.set(e,(this.nodeOptimizationAttemptCountMap.get(e)??0)+1)}if(this.sectionSolver.step(),(this.sectionSolver.failed||this.sectionSolver.solved)&&(this.sectionSolver.cacheHit?this.stats.cacheHits++:this.stats.cacheMisses++),this.sectionSolver.failed)return console.warn(`Section solver failed for node ${this.currentSection.centerNodeId}. Error: ${this.sectionSolver.error}`),this.stats.failedSectionSolvers++,this.stats.failedOptimizations++,this.sectionSolver=null,void(this.activeSubSolver=null);if(this.sectionSolver.solved){let e=this.sectionSolver.sectionConnectionTerminals,t=this.sectionSolver.sectionNodes,n=this.sectionSolver.centerNodeId;if(this.sectionSolver=null,this.activeSubSolver=null,!e)return void console.warn(`Pathing sub-solver for section ${this.currentSection.centerNodeId} did not complete successfully. Discarding results.`);let o=new Set(t.map((a)=>a.capacityMeshNodeId)),r=ice({totalNodeCapacityMap:this.totalNodeCapacityMap,usedNodeCapacityMap:this.usedNodeCapacityMap,nodeMap:this.nodeMap,sectionNodeIds:o}),i=new Map(this.usedNodeCapacityMap),s=e;for(let a of s){let c=this.connectionsWithNodes.find((l)=>l.connection.name===a.connectionName);if(c?.path){for(let l of c.path)if(o.has(l.capacityMeshNodeId)){let h=i.get(l.capacityMeshNodeId)??0;i.set(l.capacityMeshNodeId,Math.max(0,h-1))}}}for(let a of s)if(a.path)for(let c of a.path)o.has(c.capacityMeshNodeId)&&i.set(c.capacityMeshNodeId,(i.get(c.capacityMeshNodeId)??0)+1);ice({totalNodeCapacityMap:this.totalNodeCapacityMap,usedNodeCapacityMap:i,nodeMap:this.nodeMap,sectionNodeIds:o})>r?(this.stats.successfulOptimizations++,this._mergeSolvedSectionPaths({centerNodeId:n,sectionConnectionTerminals:e}),this._recalculateNodeCapacityUsage()):this.stats.failedOptimizations++}}_mergeSolvedSectionPaths({centerNodeId:e,sectionConnectionTerminals:t}){for(let n of t){if(!n.path){console.warn(`No path found for connection ${n.connectionName} in section ${e}`);continue}let o=this.connectionsWithNodes.find((_)=>_.connection.name===n.connectionName);if(!o||!o.path){console.warn(`Original connection or path not found for ${n.connectionName} while merging section ${e}`);continue}let r=o.path,i=n.path,s=r.findIndex((_)=>_.capacityMeshNodeId===n.startNodeId),a=r.findIndex((_)=>_.capacityMeshNodeId===n.endNodeId);if(s===-1||a===-1){console.warn(`Could not find start/end nodes (${n.startNodeId}/${n.endNodeId}) in original path for ${n.connectionName}`);continue}let[c,l]=s<=a?[s,a]:[a,s],h=r.slice(0,c),d=r.slice(l+1),u=i;if(i.length>0&&r[c]&&i[0].capacityMeshNodeId!==r[c].capacityMeshNodeId){if(i[i.length-1].capacityMeshNodeId!==r[c].capacityMeshNodeId){console.warn(`New section path for ${n.connectionName} doesn't align with original path boundaries. Skipping merge for this connection.`);continue}u=[...i].reverse()}o.path=[...h,...u,...d]}}_recalculateNodeCapacityUsage(){this.usedNodeCapacityMap.clear();for(let e of this.connectionsWithNodes)if(e.path)for(let t of e.path)this.usedNodeCapacityMap.set(t.capacityMeshNodeId,(this.usedNodeCapacityMap.get(t.capacityMeshNodeId)??0)+1);for(let e of this.nodes){let t=this.totalNodeCapacityMap.get(e.capacityMeshNodeId)??0,n=this.usedNodeCapacityMap.get(e.capacityMeshNodeId)??0,o=t>0?n/t:0;this.nodeCapacityPercentMap.set(e.capacityMeshNodeId,o)}}getCapacityPaths(){let e=[];for(let t of this.connectionsWithNodes){let n=t.path;n&&e.push({capacityPathId:t.connection.name,connectionName:t.connection.name,nodeIds:n.map((o)=>o.capacityMeshNodeId)})}return e}_step(){this.iterations>=this.MAX_ITERATIONS-1?this.solved=!0:this.stage==="initialization"?this._stepInitialization():this.stage==="section-optimization"&&this._stepSectionOptimization()}visualize(){let e=this.connectionsWithNodes.filter((t)=>t.path&&t.path.length>0).map((t)=>({connectionName:t.connection.name,path:t.path}));return KJe({nodeMap:this.nodeMap,sectionConnectionTerminals:this.connectionsWithNodes.map((t)=>({connectionName:t.connection.name,startNodeId:t.path?.[0]?.capacityMeshNodeId,endNodeId:t.path?.[t.path.length-1]?.capacityMeshNodeId})),completedPaths:e,sectionNodes:this.nodes,sectionEdges:this.edges,colorMap:this.colorMap,totalCapacityMap:this.totalNodeCapacityMap,usedNodeCapacityMap:this.usedNodeCapacityMap,nodeOpacity:0.05,title:"Capacity Pathing Multi-Section Solver (Solved)"})}},Rxr=class extends Kr{getSolverName(){return"DeadEndSolver"}removedNodeIds;targetNodeIds;leaves;leavesIndex;adjacencyList;nodeMap;nodes;edges;constructor({nodes:e,edges:t}){super(),this.MAX_ITERATIONS=e.length,this.nodes=e,this.edges=t,this.removedNodeIds=new Set,this.targetNodeIds=new Set(e.filter((n)=>n._containsTarget).map((n)=>n.capacityMeshNodeId)),this.adjacencyList=new Map(e.map(({capacityMeshNodeId:n})=>[n,new Set]));for(let{nodeIds:[n,o]}of t)this.adjacencyList.get(n).add(o),this.adjacencyList.get(o).add(n);this.leavesIndex=0,this.leaves=[...this.adjacencyList.entries()].filter(([n,o])=>o.size===1).filter(([n,o])=>!this.targetNodeIds.has(n)).map(([n,o])=>n)}_step(){if(this.leavesIndex===this.leaves.length)return void(this.solved=!0);let e=this.leaves[this.leavesIndex],t=this.adjacencyList.get(e);if(!t||t.size===0)return this.removedNodeIds.add(e),this.adjacencyList.delete(e),this.leavesIndex+=1,void(this.leavesIndex===this.leaves.length&&(this.solved=!0));let[n]=t,o=n?this.adjacencyList.get(n):void 0;if(!n||!o)return this.removedNodeIds.add(e),this.adjacencyList.delete(e),this.leavesIndex+=1,void(this.leavesIndex===this.leaves.length&&(this.solved=!0));o.delete(e),this.removedNodeIds.add(e),this.adjacencyList.delete(e),o.size!==1||this.targetNodeIds.has(n)||this.leaves.push(n),this.leavesIndex+=1,this.leavesIndex===this.leaves.length&&(this.solved=!0)}visualize(){if(!this.nodeMap){this.nodeMap=new Map;for(let n of this.nodes)this.nodeMap.set(n.capacityMeshNodeId,n)}let e=new Map;for(let n of this.edges)for(let o of n.nodeIds)e.set(o,1+(e.get(o)??0));let t={lines:[],points:[],rects:this.nodes.map((n)=>{let o=Math.min(...n.availableZ);return{width:Math.max(n.width-2,0.8*n.width),height:Math.max(n.height-2,0.8*n.height),center:{x:n.center.x+o*n.width*0.05,y:n.center.y-o*n.width*0.05},fill:n._containsObstacle?"rgba(255,0,0,0.1)":{"0,1":"rgba(0,0,0,0.1)",0:"rgba(0,200,200, 0.1)",1:"rgba(0,0,200, 0.1)"}[n.availableZ.join(",")]??"rgba(0,200,200,0.1)",label:[n.capacityMeshNodeId,`availableZ: ${n.availableZ.join(",")}`,`target? ${n._containsTarget??!1}`,`obs? ${n._containsObstacle??!1}`,`conn: ${e.get(n.capacityMeshNodeId)??0}`].join(`
`),layer:`z${n.availableZ.join(",")}`}}),circles:[]};for(let n of this.edges){let o=this.nodeMap.get(n.nodeIds[0]),r=this.nodeMap.get(n.nodeIds[1]);if(o?.center&&r?.center){let i=Math.min(...o.availableZ),s=Math.min(...r.availableZ),a={x:o.center.x+i*o.width*0.05,y:o.center.y-i*o.width*0.05},c={x:r.center.x+s*r.width*0.05,y:r.center.y-s*r.width*0.05},l=Array.from(new Set([...o.availableZ,...r.availableZ])).sort();t.lines.push({layer:`z${l.join(",")}`,points:[a,c],strokeDash:o.availableZ.join(",")===r.availableZ.join(",")?void 0:"10 5",strokeColor:n.nodeIds.some((h)=>this.removedNodeIds.has(h))?Qi("black",0.9):void 0})}}return t}},Qxr=class extends UJe{getSolverName(){return"NoOffBoardMultipleHighDensityRouteStitchSolver"}constructor(e){super(e),this.unsolvedRoutes=[];let t=new Map;for(let n of e.hdRoutes){let o=t.get(n.connectionName)||[];o.push(n),t.set(n.connectionName,o)}for(let[n,o]of t.entries()){let r=e.connections.find((a)=>a.name===n);if(!r)continue;let i={...r.pointsToConnect[0],z:ti(Ef(r.pointsToConnect[0]),e.layerCount)},s={...r.pointsToConnect[1],z:ti(Ef(r.pointsToConnect[1]),e.layerCount)};this.unsolvedRoutes.push({connectionName:n,hdRoutes:o,start:i,end:s})}for(let n of e.connections)t.has(n.name)||this.unsolvedRoutes.push({connectionName:n.name,hdRoutes:[],start:{...n.pointsToConnect[0],z:ti(Ef(n.pointsToConnect[0]),e.layerCount)},end:{...n.pointsToConnect[1],z:ti(Ef(n.pointsToConnect[1]),e.layerCount)}})}},c3e=0.005,kxr=class extends Kr{getSolverName(){return"SingleLayerNodeMergerSolver"}nodeMap;currentBatchNodeIds;absorbedNodeIds;nextBatchNodeIds;batchHadModifications;hasComputedAdjacentNodeIds=!1;newNodes;constructor(e){super(),this.nodeMap=new Map,this.MAX_ITERATIONS=1e5;for(let n of e)this.nodeMap.set(n.capacityMeshNodeId,n);this.newNodes=[],this.absorbedNodeIds=new Set;let t=[];for(let n of e)n.availableZ.length>1?(this.newNodes.push(n),this.absorbedNodeIds.add(n.capacityMeshNodeId)):t.push([n,n.width*n.height]);t.sort((n,o)=>n[1]-o[1]);for(let[n,o]of t){let r={...n,center:{...n.center}};this.nodeMap.set(n.capacityMeshNodeId,r)}this.currentBatchNodeIds=t.map(([n])=>n.capacityMeshNodeId),this.nextBatchNodeIds=[],this.batchHadModifications=!1}computeAdjacentNodeIdsForFirstBatch(e){let t=Math.max(...e.map((o)=>Math.max(...o.availableZ))),n=[];for(let o=0;o<=t;o++)n.push(new y$e(e.filter((r)=>r.availableZ[0]===o)));for(let o of e){let r=[],i=n[o.availableZ[0]].getNodesInArea(o.center.x,o.center.y,4*o.width,4*o.height);for(let s of i)s._containsTarget&&s._targetConnectionName!==o._targetConnectionName||o._containsTarget&&(!s._containsTarget||s._targetConnectionName!==o._targetConnectionName)||s.capacityMeshNodeId!==o.capacityMeshNodeId&&Nbe(o,s)&&r.push(s);o._adjacentNodeIds=r.map((s)=>s.capacityMeshNodeId)}}getAdjacentSameLayerUnprocessedNodes(e){return this.getAdjacentSameLayerUnprocessedNodes2(e)}getAdjacentSameLayerUnprocessedNodes2(e){let t=[],n=Array.from(new Set((e._adjacentNodeIds??[]).map((o)=>this.nodeMap.get(o)))).filter((o)=>o&&o.capacityMeshNodeId!==e.capacityMeshNodeId);n.sort((o,r)=>o.width*o.height-r.width*r.height);for(let o of n)this.absorbedNodeIds.has(o.capacityMeshNodeId)||t.push(o);return t}_step(){this.hasComputedAdjacentNodeIds||(this.computeAdjacentNodeIdsForFirstBatch(this.currentBatchNodeIds.map((l)=>this.nodeMap.get(l))),this.hasComputedAdjacentNodeIds=!0);let e=this.currentBatchNodeIds.pop();for(;e&&this.absorbedNodeIds.has(e);)e=this.currentBatchNodeIds.pop();if(!e)return this.batchHadModifications?(this.currentBatchNodeIds=this.nextBatchNodeIds.sort((l,h)=>{let d=this.nodeMap.get(l),u=this.nodeMap.get(h);return d.width*d.height-u.width*u.height}),this.nextBatchNodeIds=[],void(this.batchHadModifications=!1)):(this.solved=!0,void this.newNodes.push(...this.nextBatchNodeIds.map((l)=>this.nodeMap.get(l))));let t=this.nodeMap.get(e),n=!1,o=this.getAdjacentSameLayerUnprocessedNodes(t);if(o.length===0)return void this.nextBatchNodeIds.push(e);let r=(l)=>{for(let h of l)this.absorbedNodeIds.add(h.capacityMeshNodeId);t._adjacentNodeIds=Array.from(new Set([...t._adjacentNodeIds??[],...l.flatMap((h)=>h._adjacentNodeIds??[])].filter((h)=>h!==t.capacityMeshNodeId&&!this.absorbedNodeIds.has(h))))},i=o.filter((l)=>l.center.x<t.center.x&&Math.abs(l.center.y-t.center.y)<t.height/2);if(i.length>0){let{width:l,height:h}=i[0],d=i.every((u)=>u.width===l&&u.height===h);Math.abs(i.reduce((u,_)=>u+_.height,0)-t.height)<c3e&&d&&(t.width+=l,t.center.x=t.center.x-l/2,r(i),n=!0)}let s=o.filter((l)=>l.center.x>t.center.x&&Math.abs(l.center.y-t.center.y)<t.height/2);if(s.length>0&&!n){let{width:l,height:h}=s[0],d=s.every((u)=>u.width===l&&u.height===h);Math.abs(s.reduce((u,_)=>u+_.height,0)-t.height)<c3e&&d&&(t.width+=l,t.center.x=t.center.x+l/2,r(s),n=!0)}let a=o.filter((l)=>l.center.y>t.center.y&&Math.abs(l.center.x-t.center.x)<t.width/2);if(a.length>0&&!n){let{width:l,height:h}=a[0],d=a.every((u)=>u.width===l&&u.height===h);Math.abs(a.reduce((u,_)=>u+_.width,0)-t.width)<c3e&&d&&(t.height+=h,t.center.y=t.center.y+h/2,r(a),n=!0)}let c=o.filter((l)=>l.center.y<t.center.y&&Math.abs(l.center.x-t.center.x)<t.width/2);if(c.length>0&&!n){let{width:l,height:h}=c[0],d=c.every((u)=>u.width===l&&u.height===h);Math.abs(c.reduce((u,_)=>u+_.width,0)-t.width)<c3e&&d&&(t.height+=h,t.center.y=t.center.y-h/2,r(c),n=!0)}n?(this.batchHadModifications=!0,this.currentBatchNodeIds.push(e)):this.nextBatchNodeIds.unshift(e)}visualize(){let e={circles:[],lines:[],points:[],rects:[],coordinateSystem:"cartesian",title:"Same Layer Node Merger"};for(let o of this.newNodes)e.rects.push(fA(o));let t=this.currentBatchNodeIds[this.currentBatchNodeIds.length-1],n;t&&(n=this.getAdjacentSameLayerUnprocessedNodes(this.nodeMap.get(t)));for(let o of this.currentBatchNodeIds){let r=this.nodeMap.get(o);if(!this.absorbedNodeIds.has(o)&&r){let i=fA(r,{rectMargin:0.01});o===t?i.stroke="rgba(0, 255, 0, 0.8)":n?.some((s)=>s.capacityMeshNodeId===o)?i.stroke="rgba(128, 0, 128, 0.8)":i.stroke="rgba(255, 165, 0, 0.8)",i.layer=`z${r.availableZ.join(",")}`,i.label=`${i.label}
(unprocessed)`,e.rects.push(i)}}for(let o of this.nextBatchNodeIds){let r=this.nodeMap.get(o);if(!this.absorbedNodeIds.has(o)&&r){let i=fA(r,{rectMargin:0.01});i.layer=`z${r.availableZ.join(",")}`,i.stroke="rgba(0, 217, 255, 0.8)",i.label=`${i.label}
x: ${r.center.x}, y: ${r.center.y}
${r.width}x${r.height}
(next batch)`,e.rects.push(i)}}return e}},Lxr=class extends Kr{getSolverName(){return"StrawSolver"}multiLayerNodes;strawNodes;skippedNodes;unprocessedNodes;strawSize;nodeIdCounter;constructor(e){super(),this.MAX_ITERATIONS=1e5,this.strawSize=e.strawSize??0.5,this.multiLayerNodes=[],this.strawNodes=[],this.skippedNodes=[],this.nodeIdCounter=0,this.unprocessedNodes=[];for(let t of e.nodes)t.availableZ.length===1?this.unprocessedNodes.push(t):this.multiLayerNodes.push(t)}getCapacityOfMultiLayerNodesWithinBounds(e){let t=0;for(let n of this.multiLayerNodes){let o=n.center.x-n.width/2,r=n.center.x+n.width/2,i=n.center.y-n.height/2,s=n.center.y+n.height/2,a=Math.max(e.minX,o),c=Math.min(e.maxX,r),l=Math.max(e.minY,i),h=Math.min(e.maxY,s);if(a<c&&l<h){let d=(c-a)*(h-l)/(n.width*n.height);t+=dS(n)*d}}return t}getSurroundingCapacities(e){let t=Math.min(e.width,e.height);return{leftSurroundingCapacity:this.getCapacityOfMultiLayerNodesWithinBounds({minX:e.center.x-e.width/2-t,maxX:e.center.x-e.width/2,minY:e.center.y-e.height/2,maxY:e.center.y+e.height/2}),rightSurroundingCapacity:this.getCapacityOfMultiLayerNodesWithinBounds({minX:e.center.x+e.width/2,maxX:e.center.x+e.width/2+t,minY:e.center.y-e.height/2,maxY:e.center.y+e.height/2}),topSurroundingCapacity:this.getCapacityOfMultiLayerNodesWithinBounds({minX:e.center.x-e.width/2,maxX:e.center.x+e.width/2,minY:e.center.y-e.height/2-t,maxY:e.center.y-e.height/2}),bottomSurroundingCapacity:this.getCapacityOfMultiLayerNodesWithinBounds({minX:e.center.x-e.width/2,maxX:e.center.x+e.width/2,minY:e.center.y+e.height/2,maxY:e.center.y+e.height/2+t})}}createStrawsForNode(e){let t=[],{leftSurroundingCapacity:n,rightSurroundingCapacity:o,topSurroundingCapacity:r,bottomSurroundingCapacity:i}=this.getSurroundingCapacities(e);if(1*(n+o)>r+i){let s=Math.floor(e.height/this.strawSize),a=e.height/s;for(let c=0;c<s;c++){let l=e.center.y-e.height/2+c*a+a/2;t.push({capacityMeshNodeId:`${e.capacityMeshNodeId}_straw${c}`,center:{x:e.center.x,y:l},width:e.width,height:a,layer:e.layer,availableZ:[...e.availableZ],_depth:e._depth,_strawNode:!0,_strawParentCapacityMeshNodeId:e.capacityMeshNodeId})}}else{let s=Math.floor(e.width/this.strawSize),a=e.width/s;for(let c=0;c<s;c++){let l=e.center.x-e.width/2+c*a+a/2;t.push({capacityMeshNodeId:`${e.capacityMeshNodeId}_straw${c}`,center:{x:l,y:e.center.y},width:a,height:e.height,layer:e.layer,availableZ:[...e.availableZ],_depth:e._depth,_strawNode:!0,_strawParentCapacityMeshNodeId:e.capacityMeshNodeId})}}return t}getResultNodes(){return[...this.multiLayerNodes,...this.strawNodes,...this.skippedNodes]}_step(){let e=this.unprocessedNodes.pop();if(!e)return void(this.solved=!0);if(e.width<this.strawSize&&e.height<this.strawSize)return void this.skippedNodes.push(e);if(e._containsTarget)return void this.skippedNodes.push(e);let t=this.createStrawsForNode(e);this.strawNodes.push(...t),t.length===0&&this.strawNodes.push(e)}visualize(){let e={rects:[],lines:[],points:[],circles:[],title:"Straw Solver"};for(let t of this.unprocessedNodes)e.rects.push({center:t.center,width:t.width,height:t.height,fill:"rgba(200, 200, 200, 0.5)",stroke:"rgba(0, 0, 0, 0.5)",label:`${t.capacityMeshNodeId}
Unprocessed
${t.width}x${t.height}`});for(let t of this.strawNodes){let n=t.availableZ[0]===0?"rgba(0, 150, 255, 0.5)":"rgba(255, 100, 0, 0.5)";e.rects.push({center:t.center,width:t.width,height:t.height,fill:n,stroke:"rgba(0, 0, 0, 0.5)",label:`${t.capacityMeshNodeId}
Layer: ${t.availableZ[0]}
${t.width}x${t.height}`,layer:`z${t.availableZ.join(",")}`})}for(let t of this.multiLayerNodes)e.rects.push({center:t.center,width:0.9*t.width,height:0.9*t.height,fill:"rgba(100, 255, 100, 0.5)",stroke:"rgba(0, 0, 0, 0.5)",layer:`z${t.availableZ.join(",")}`,label:`${t.capacityMeshNodeId}
Layers: ${t.availableZ.join(",")}
${t.width}x${t.height}`});return e}};function wVt(e){let{nodeId:t,nodeIdToSegmentIds:n,segmentIdToNodeIds:o,hops:r}=e;if(r===0)return[t];let i=new Set([t]),s=[{nodeId:t,remainingHops:r}];for(;s.length>0;){let{nodeId:a,remainingHops:c}=s.shift();if(c===0)continue;let l=n.get(a)||[];for(let h of l){let d=o.get(h)||[];for(let u of d)i.has(u)||(i.add(u),s.push({nodeId:u,remainingHops:c-1}))}}return Array.from(i)}var mKe=(e)=>Array.from(e.entries()).map(([t,{x:n,y:o,z:r}])=>`${t}(${n?.toFixed(3)??""},${o?.toFixed(3)??""},${r??""})`).sort().join("&"),Hxr=(e,t,n,o)=>{let r=Math.min(e,t),i=Math.max(e,t),s=Math.min(n,o);return r<=Math.max(n,o)&&i>=s},lCe=(e,t,n,o)=>{let r=[],i=new Map(e.originalPointMap);for(let[s,a]of n.entries()){let c=i.get(s);i.set(s,{x:a.x??c.x,y:a.y??c.y,z:a.z??c.z})}for(let s of e.allNodeIds){if(!t.get(s))continue;let a=e.segmentPairsInNode.get(s);for(let c of a){let l=i.get(c[0]),h=i.get(c[1]);l.z!==h.z&&r.push({type:"transition_via",segmentPoints:c,capacityMeshNodeId:s,probabilityOfFailure:0})}for(let c=0;c<a.length;c++)for(let l=c+1;l<a.length;l++){if(o?.areIdsConnected(a[c][0],a[c][1]))continue;let h=a[c],d=a[l],u=i.get(h[0]),_=i.get(h[1]),p=i.get(d[0]),m=i.get(d[1]);if(!Hxr(u.z,_.z,p.z,m.z))continue;let A=su(u,_,p,m),g=u.z===_.z&&p.z===m.z&&u.z===p.z;A&&(g?r.push({type:"same_layer_crossing",segmentPoints:[h,d],capacityMeshNodeId:s,crossingLine1:h,crossingLine2:d,probabilityOfFailure:0}):u.z===_.z&&p.z!==m.z?r.push({type:"single_transition_crossing",segmentPoints:[h,d],capacityMeshNodeId:s,sameLayerCrossingLine:h,transitionCrossingLine:d,probabilityOfFailure:0}):u.z!==_.z&&p.z===m.z?r.push({type:"single_transition_crossing",segmentPoints:[h,d],capacityMeshNodeId:s,sameLayerCrossingLine:d,transitionCrossingLine:h,probabilityOfFailure:0}):u.z!==_.z&&p.z!==m.z&&r.push({type:"double_transition_crossing",segmentPoints:[h,d],capacityMeshNodeId:s,crossingLine1:h,crossingLine2:d,probabilityOfFailure:0}))}}return r},zsn=(e,t,n)=>{if(t.type==="change_layer")for(let o of t.segmentPointIds){let r=e.get(o)||{};e.set(o,{...r,z:t.newZ})}else if(t.type==="swap_position_on_segment"){let[o,r]=t.segmentPointIds,i=n(o),s=n(r),a=e.get(o)||{},c=e.get(r)||{};e.set(o,{...a,x:s.x,y:s.y}),e.set(r,{...c,x:i.x,y:i.y})}else if(t.type==="combined")for(let o of t.operations)zsn(e,o,n)},Osn=(e,t)=>{let n=new Map,o=new Map,r=new Map,i=[],s=0;for(let a of e)for(let c of a.assignedPoints){let l={segmentPointId:"SP"+s++,segmentId:a.nodePortSegmentId,capacityMeshNodeIds:t.get(a.nodePortSegmentId),connectionName:c.connectionName,rootConnectionName:c.rootConnectionName,x:c.point.x,y:c.point.y,z:c.point.z,directlyConnectedSegmentPointIds:[]};n.set(l.segmentPointId,l);for(let h of l.capacityMeshNodeIds)o.set(h,[...o.get(h)??[],l.segmentPointId]);r.set(a.nodePortSegmentId,[...r.get(a.nodePortSegmentId)??[],l.segmentPointId]),i.push(l)}return{segmentPointMap:n,nodeToSegmentPointMap:o,segmentToSegmentPointMap:r}},Fxr=class extends Kr{getSolverName(){return"UnravelSectionSolver"}nodeMap;dedupedSegments;dedupedSegmentMap;MUTABLE_HOPS=1;unravelSection;candidates=[];lastProcessedCandidate=null;bestCandidate=null;originalCandidate;rootNodeId;nodeIdToSegmentIds;segmentIdToNodeIds;colorMap;tunedNodeCapacityMap;MAX_CANDIDATES=500;iterationsSinceImprovement=0;hyperParameters;selectedCandidateIndex=null;queuedOrExploredCandidatePointModificationHashes=new Set;constructorParams;constructor(e){if(super(),this.constructorParams=e,this.MUTABLE_HOPS=e.MUTABLE_HOPS??this.MUTABLE_HOPS,this.MAX_ITERATIONS=50000,this.hyperParameters={...e.hyperParameters,MAX_ITERATIONS_WITHOUT_IMPROVEMENT:200},this.nodeMap=e.nodeMap,this.dedupedSegments=e.dedupedSegments,e.dedupedSegmentMap)this.dedupedSegmentMap=e.dedupedSegmentMap;else{this.dedupedSegmentMap=new Map;for(let t of this.dedupedSegments)this.dedupedSegmentMap.set(t.nodePortSegmentId,t)}this.nodeIdToSegmentIds=e.nodeIdToSegmentIds,this.segmentIdToNodeIds=e.segmentIdToNodeIds,this.rootNodeId=e.rootNodeId,this.colorMap=e.colorMap??{},this.unravelSection=this.createUnravelSection({segmentPointMap:e.segmentPointMap,nodeToSegmentPointMap:e.nodeToSegmentPointMap,segmentToSegmentPointMap:e.segmentToSegmentPointMap}),this.tunedNodeCapacityMap=new Map;for(let t of this.unravelSection.allNodeIds)this.tunedNodeCapacityMap.set(t,dS(this.nodeMap.get(t)));this.originalCandidate=this.createInitialCandidate(),this.candidates=[this.originalCandidate]}getConstructorParams(){return{...this.constructorParams,segmentPointMap:this.unravelSection.segmentPointMap,nodeToSegmentPointMap:this.unravelSection.segmentPointsInNode,segmentToSegmentPointMap:this.unravelSection.segmentPointsInSegment}}createUnravelSection(e){let t=wVt({nodeId:this.rootNodeId,nodeIdToSegmentIds:this.nodeIdToSegmentIds,segmentIdToNodeIds:this.segmentIdToNodeIds,hops:this.MUTABLE_HOPS}),n=wVt({nodeId:this.rootNodeId,nodeIdToSegmentIds:this.nodeIdToSegmentIds,segmentIdToNodeIds:this.segmentIdToNodeIds,hops:this.MUTABLE_HOPS+1}),o=Array.from(new Set(n).difference(new Set(t)));e?.segmentPointMap||(e=Osn(this.dedupedSegments,this.segmentIdToNodeIds));let r=new Map;for(let u of n)r.set(u,e.nodeToSegmentPointMap.get(u));let i=new Map;for(let u of n)for(let _ of r.get(u)){let p=e.segmentPointMap.get(_);i.set(_,p)}let s=Array.from(i.values()),a=new Map;for(let u of s)a.set(u.segmentId,[...a.get(u.segmentId)??[],u.segmentPointId]);for(let[u,_]of r.entries())for(let p=0;p<_.length;p++){let m=e.segmentPointMap.get(_[p]);for(let A=p+1;A<_.length;A++){let g=e.segmentPointMap.get(_[A]);g.segmentPointId!==m.segmentPointId&&(g.segmentId!==m.segmentId&&g.connectionName===m.connectionName&&(g.directlyConnectedSegmentPointIds.includes(m.segmentPointId)||(m.directlyConnectedSegmentPointIds.push(g.segmentPointId),g.directlyConnectedSegmentPointIds.push(m.segmentPointId))))}}let c=new Map;for(let u of n)c.set(u,[]);for(let u of s)for(let _ of u.capacityMeshNodeIds){let p=c.get(_);if(p)for(let m of u.directlyConnectedSegmentPointIds){let A=e.segmentPointMap.get(m);A.segmentPointId!==u.segmentPointId&&(A.capacityMeshNodeIds.some((g)=>g===_)&&(p.some(([g,f])=>g===u.segmentPointId&&f===A.segmentPointId||g===A.segmentPointId&&f===u.segmentPointId)||p.push([u.segmentPointId,A.segmentPointId])))}}let l=new Set;for(let u of t)for(let _ of this.nodeIdToSegmentIds.get(u))this.segmentIdToNodeIds.get(_).every((p)=>!this.nodeMap.get(p)._containsTarget)&&l.add(_);let h=new Set;for(let u of s){let _=u.capacityMeshNodeIds.some((A)=>t.includes(A)),p=this.dedupedSegmentMap.get(u.segmentId),m=p&&p.availableZ.length>1;(_||m)&&h.add(u.segmentPointId)}let d=new Set;for(let u of s)if(u.capacityMeshNodeIds.some((_)=>this.nodeMap.get(_)?._containsTarget)){let _=this.dedupedSegmentMap.get(u.segmentId);_&&_.availableZ.length===1&&d.add(u.segmentPointId)}return{allNodeIds:n,mutableNodeIds:t,immutableNodeIds:o,mutableSegmentIds:l,segmentPairsInNode:c,segmentPointMap:i,segmentPointsInNode:r,segmentPointsInSegment:a,originalPointMap:i,mutableSegmentPointIds:h,zLockedSegmentPointIds:d}}createInitialCandidate(){let e=new Map,t=lCe(this.unravelSection,this.nodeMap,e),n=this.computeG({issues:t,originalCandidate:{},operationsPerformed:0,operation:{}});return{pointModifications:e,g:n,h:0,f:n,operationsPerformed:0,candidateHash:mKe(e),issues:lCe(this.unravelSection,this.nodeMap,e)}}get nextCandidate(){return this.candidates[0]??null}getPointInCandidate(e,t){let n=this.unravelSection.segmentPointMap.get(t),o=e.pointModifications.get(t);return{x:o?.x??n.x,y:o?.y??n.y,z:o?.z??n.z,segmentId:n.segmentId}}getConnectionSegmentPointIds(e){let t=[];for(let[n,o]of this.unravelSection.segmentPointMap.entries())o.connectionName===e&&t.push(n);return t}canConnectionUseLayer(e,t){for(let n of e){let o=this.unravelSection.segmentPointMap.get(n),r=this.dedupedSegmentMap.get(o.segmentId);if(!r||!r.availableZ.includes(t))return!1}return!0}getOperationsForIssue(e,t){let n=[];if(t.type==="transition_via"){let[o,r]=t.segmentPoints,i=this.getPointInCandidate(e,o),s=this.getPointInCandidate(e,r),a=this.unravelSection.segmentPointMap.get(o),c=(this.unravelSection.segmentPointMap.get(r),this.dedupedSegmentMap.get(i.segmentId).availableZ),l=this.dedupedSegmentMap.get(s.segmentId).availableZ,h=this.unravelSection.zLockedSegmentPointIds.has(o),d=this.unravelSection.zLockedSegmentPointIds.has(r),u=this.getConnectionSegmentPointIds(a.connectionName);if(this.canConnectionUseLayer(u,s.z)){let _=u.filter((p)=>this.unravelSection.mutableSegmentPointIds.has(p)&&!this.unravelSection.zLockedSegmentPointIds.has(p));_.length>0&&n.push({type:"change_layer",newZ:s.z,segmentPointIds:_})}if(this.canConnectionUseLayer(u,i.z)){let _=u.filter((p)=>this.unravelSection.mutableSegmentPointIds.has(p)&&!this.unravelSection.zLockedSegmentPointIds.has(p));_.length>0&&n.push({type:"change_layer",newZ:i.z,segmentPointIds:_})}this.unravelSection.mutableSegmentPointIds.has(o)&&!h&&c.includes(s.z)&&n.push({type:"change_layer",newZ:s.z,segmentPointIds:[o]}),this.unravelSection.mutableSegmentPointIds.has(r)&&!d&&l.includes(i.z)&&n.push({type:"change_layer",newZ:i.z,segmentPointIds:[r]})}if(t.type==="same_layer_crossing"){let[o,r]=t.crossingLine1,[i,s]=t.crossingLine2,a=[],c=this.unravelSection.segmentPointMap.get(o),l=this.unravelSection.segmentPointMap.get(r),h=this.unravelSection.segmentPointMap.get(i),d=this.unravelSection.segmentPointMap.get(s),u=this.unravelSection.mutableSegmentPointIds.has(o),_=this.unravelSection.mutableSegmentPointIds.has(r),p=this.unravelSection.mutableSegmentPointIds.has(i),m=this.unravelSection.mutableSegmentPointIds.has(s),A=this.unravelSection.zLockedSegmentPointIds.has(o),g=this.unravelSection.zLockedSegmentPointIds.has(r),f=this.unravelSection.zLockedSegmentPointIds.has(i),y=this.unravelSection.zLockedSegmentPointIds.has(s);u&&p&&c.segmentId===h.segmentId&&a.push([o,i]),u&&m&&c.segmentId===d.segmentId&&a.push([o,s]),_&&p&&l.segmentId===h.segmentId&&a.push([r,i]),_&&m&&l.segmentId===d.segmentId&&a.push([r,s]);for(let[T,N]of a)n.push({type:"swap_position_on_segment",segmentPointIds:[T,N]});let x=this.getConnectionSegmentPointIds(c.connectionName),C=this.getConnectionSegmentPointIds(h.connectionName),b=new Set;for(let T of this.unravelSection.segmentPointMap.values()){let N=this.dedupedSegmentMap.get(T.segmentId);if(N)for(let D of N.availableZ)b.add(D)}for(let T of b)if(T!==c.z&&this.canConnectionUseLayer(x,T)){let N=x.filter((D)=>this.unravelSection.mutableSegmentPointIds.has(D)&&!this.unravelSection.zLockedSegmentPointIds.has(D));N.length>0&&n.push({type:"change_layer",newZ:T,segmentPointIds:N})}for(let T of b)if(T!==h.z&&this.canConnectionUseLayer(C,T)){let N=C.filter((D)=>this.unravelSection.mutableSegmentPointIds.has(D)&&!this.unravelSection.zLockedSegmentPointIds.has(D));N.length>0&&n.push({type:"change_layer",newZ:T,segmentPointIds:N})}let I=this.dedupedSegmentMap.get(c.segmentId),v=this.dedupedSegmentMap.get(l.segmentId),P=this.dedupedSegmentMap.get(h.segmentId),M=this.dedupedSegmentMap.get(d.segmentId),B=(T,N)=>T.every((D)=>D.availableZ.includes(N));if(u&&_&&!A&&!g){let T=c.z===0?1:0;B([I,v],T)&&n.push({type:"change_layer",newZ:T,segmentPointIds:[o,r]})}if(p&&m&&!f&&!y){let T=h.z===0?1:0;B([P,M],T)&&n.push({type:"change_layer",newZ:T,segmentPointIds:[i,s]})}if(u&&!A){let T=c.z===0?1:0;I.availableZ.includes(T)&&n.push({type:"change_layer",newZ:T,segmentPointIds:[o]})}if(_&&!g){let T=l.z===0?1:0;v.availableZ.includes(T)&&n.push({type:"change_layer",newZ:T,segmentPointIds:[r]})}if(p&&!f){let T=h.z===0?1:0;P.availableZ.includes(T)&&n.push({type:"change_layer",newZ:T,segmentPointIds:[i]})}if(m&&!y){let T=d.z===0?1:0;M.availableZ.includes(T)&&n.push({type:"change_layer",newZ:T,segmentPointIds:[s]})}}return n}computeG(e){let{issues:t,originalCandidate:n,operationsPerformed:o,operation:r}=e,i=new Map;for(let c of t){i.has(c.capacityMeshNodeId)||i.set(c.capacityMeshNodeId,{numTransitionCrossings:0,numSameLayerCrossings:0,numEntryExitLayerChanges:0});let l=i.get(c.capacityMeshNodeId);c.type==="transition_via"?l.numTransitionCrossings++:c.type==="same_layer_crossing"?l.numSameLayerCrossings++:c.type==="double_transition_crossing"||c.type==="single_transition_crossing"?l.numEntryExitLayerChanges++:c.type}let s=0;for(let[c,{numEntryExitLayerChanges:l,numSameLayerCrossings:h,numTransitionCrossings:d}]of i){let u=this.nodeMap.get(c),_=Math.min(ly(u,h,l,d),0.999999);s+=Math.log(1-_)}var a;return(a=s)<-Math.LN2?Math.log(1-Math.exp(a)):Math.log(-Math.expm1(a))}getUnexploredNeighborByApplyingOperation(e,t){let n=new Map(e.pointModifications);zsn(n,t,(a)=>this.getPointInCandidate(e,a));let o=mKe(n);if(this.queuedOrExploredCandidatePointModificationHashes.has(o))return null;let r=lCe(this.unravelSection,this.nodeMap,n),i=e.operationsPerformed+1,s=this.computeG({issues:r,originalCandidate:e,operationsPerformed:i,operation:t});return{issues:r,g:s,h:0,f:s,pointModifications:n,candidateHash:o,operationsPerformed:i}}getNeighborOperationsForCandidate(e){return e.issues.flatMap((t)=>this.getOperationsForIssue(e,t))}getNeighbors(e){let t=[],n=this.getNeighborOperationsForCandidate(e);for(let o of n){let r=this.getUnexploredNeighborByApplyingOperation(e,o);r&&t.push(r)}return t}_step(){let e=this.candidates.shift();this.iterationsSinceImprovement++,this.iterationsSinceImprovement>this.hyperParameters.MAX_ITERATIONS_WITHOUT_IMPROVEMENT?this.solved=!0:e?(this.lastProcessedCandidate=e,e.f<(this.bestCandidate?.f??1/0)&&(this.bestCandidate=e,this.iterationsSinceImprovement=0),this.getNeighbors(e).forEach((t)=>{this.queuedOrExploredCandidatePointModificationHashes.has(t.candidateHash)||(this.queuedOrExploredCandidatePointModificationHashes.add(t.candidateHash),this.candidates.push(t))}),this.candidates.sort((t,n)=>t.f-n.f),this.candidates.length=Math.min(this.candidates.length,this.MAX_CANDIDATES)):this.solved=!0}visualize(){let e={points:[],lines:[],rects:[],circles:[],coordinateSystem:"cartesian",title:"Unravel Section Solver"},t=null;if(t=this.selectedCandidateIndex!==null?this.selectedCandidateIndex==="best"?this.bestCandidate:this.selectedCandidateIndex==="original"?this.originalCandidate:this.candidates[this.selectedCandidateIndex]:this.solved?this.bestCandidate:this.lastProcessedCandidate||this.candidates[0],!t)return e;let n=new Map;for(let[r,i]of this.unravelSection.segmentPointMap){let s={...i},a=t.pointModifications.get(r);a&&(a.x!==void 0&&(s.x=a.x),a.y!==void 0&&(s.y=a.y),a.z!==void 0&&(s.z=a.z)),n.set(r,s)}for(let[r,i]of n)e.points.push({x:i.x,y:i.y,label:`${r}
Segment: ${i.segmentId} ${this.unravelSection.mutableSegmentIds.has(i.segmentId)?"MUTABLE":"IMMUTABLE"}
Layer: ${i.z}`,color:this.colorMap[i.connectionName]||"#000"});let o=new Map;for(let r of this.unravelSection.allNodeIds)o.set(r,{numTransitionCrossings:0,numSameLayerCrossings:0,numEntryExitLayerChanges:0,estPf:0});for(let r of t.issues){let i=o.get(r.capacityMeshNodeId);r.type==="transition_via"?i.numTransitionCrossings++:r.type==="same_layer_crossing"?i.numSameLayerCrossings++:r.type!=="double_transition_crossing"&&r.type!=="single_transition_crossing"||i.numEntryExitLayerChanges++}for(let[r,i]of o.entries()){let s=this.nodeMap.get(r);i.estPf=ly(s,i.numSameLayerCrossings,i.numEntryExitLayerChanges,i.numTransitionCrossings)}for(let r of this.unravelSection.allNodeIds){let i=this.nodeMap.get(r),s=this.unravelSection.mutableNodeIds.includes(r),a=o.get(r),c=[`${r} (${s?"MUT":"IMM"})`,`${i.width.toFixed(2)}x${i.height.toFixed(2)}`,`Pf: ${a.estPf.toFixed(3)}`,`TC: ${a.numTransitionCrossings}`,`SLC: ${a.numSameLayerCrossings}`,`EELC: ${a.numEntryExitLayerChanges}`].join(`
`);e.rects.push({center:i.center,label:c,color:s?"green":"red",width:i.width/8,height:i.height/8})}for(let[r,i]of this.unravelSection.segmentPointsInSegment){if(i.length<=1)continue;let s=i.map((a)=>n.get(a));for(let a=0;a<s.length-1;a++)e.lines.push({points:[{x:s[a].x,y:s[a].y},{x:s[a+1].x,y:s[a+1].y}],strokeColor:this.colorMap[r]||"#000"})}for(let[r,i]of n)for(let s of i.directlyConnectedSegmentPointIds)if(r<s){let a=n.get(s);if(!a)continue;let c=i.z===a.z,l=i.z,h;h=c?l===0?void 0:"10 5":"3 3 10",e.lines.push({points:[{x:i.x,y:i.y},{x:a.x,y:a.y}],strokeDash:h,strokeColor:this.colorMap[i.connectionName]||"#000"})}for(let r of t.issues){let i=this.nodeMap.get(r.capacityMeshNodeId);if(r.type==="transition_via")for(let s of r.segmentPoints){let a=n.get(s);e.circles.push({center:{x:a.x,y:a.y},radius:i.width/16,stroke:"#ff0000",fill:"rgba(255, 0, 0, 0.2)",label:`Via Issue
${s}
Layer: ${a.z}`})}else if(r.type==="same_layer_crossing")for(let[s,a]of[r.crossingLine1,r.crossingLine2]){let c=n.get(s),l=n.get(a);e.lines.push({points:[{x:c.x,y:c.y},{x:l.x,y:l.y}],strokeColor:"rgba(255,0,0,0.2)",strokeWidth:i.width/32})}}for(let[r,i]of t.pointModifications){let s=n.get(r),a=this.unravelSection.segmentPointMap.get(r);e.circles.push({center:{x:s.x,y:s.y},radius:0.05,stroke:"#0000ff",fill:"rgba(0, 0, 255, 0.2)",label:`${r}
Original: (${a.x.toFixed(2)}, ${a.y.toFixed(2)}, ${a.z})
New: (${s.x.toFixed(2)}, ${s.y.toFixed(2)}, ${s.z})`})}return e}},l3e=(e)=>(Math.round(20*e)/20).toFixed(2),BVt=(e)=>(Math.round(1000*e)/1000).toFixed(3);Dbe();var zxr=class extends Fxr{cacheHit=!1;cacheProvider;hasAttemptedToUseCache=!1;constructor(e){super(e),this.cacheProvider=e.cacheProvider===void 0?Lmr():e.cacheProvider}_step(){!this.hasAttemptedToUseCache&&this.cacheProvider&&this.attemptToUseCacheSync()||(super._step(),(this.solved||this.failed)&&this.cacheProvider&&this.saveToCacheSync())}computeCacheKeyAndTransform(){let e=this.nodeMap.get(this.rootNodeId),t=$O(-e.center.x,-e.center.y),n=new Map,o=new Map,r=new Map,i=new Map,s=new Map,a=new Map,c=0,l=0,h=0,d=[...this.unravelSection.allNodeIds].sort((f,y)=>{let x=this.nodeMap.get(f),C=this.nodeMap.get(y);return x.center.x!==C.center.x?x.center.x-C.center.x:x.center.y-C.center.y});for(let f of d){let y="node_"+c++;n.set(f,y),o.set(y,f)}let u=[...Array.from(this.unravelSection.segmentPointMap.entries()).sort(([,f],[,y])=>f.x!==y.x?f.x-y.x:f.y-y.y).map(([f])=>f)].sort();for(let f of u){let y="sp_"+h++;s.set(f,y),a.set(y,f);let x=this.unravelSection.segmentPointMap.get(f).segmentId;if(!r.has(x)){let C="seg_"+l++;r.set(x,C),i.set(C,x)}}let _={};for(let[f,y]of n.entries()){let x=this.nodeMap.get(f),C=mw(t,x.center);_[y]={width:x.width,height:x.height,availableZ:x.availableZ,center:{x:l3e(C.x),y:l3e(C.y)}}}let p={};for(let[f,y]of s.entries()){let x=this.unravelSection.segmentPointMap.get(f),C=mw(t,{x:x.x,y:x.y});p[y]={x:l3e(C.x),y:l3e(C.y),z:x.z}}let m={hyperParameters:this.hyperParameters,normalizedNodes:_,normalizedSegmentPoints:p,mutableHops:this.MUTABLE_HOPS},A=`unravelsec:${Vsn.default(m)}`,g={realToCacheTransform:t,nodeIdMap:n,segmentIdMap:r,segmentPointIdMap:s,reverseNodeIdMap:o,reverseSegmentIdMap:i,reverseSegmentPointIdMap:a};return this.cacheKey=A,this.cacheToSolveSpaceTransform=g,{cacheKey:A,cacheToSolveSpaceTransform:g}}applyCachedSolution(e){if(e.success===!1)return void(this.failed=!0);if(!this.cacheToSolveSpaceTransform)return void console.error("Cache transform not available to apply cached solution.");let{reverseSegmentPointIdMap:t,reverseNodeIdMap:n}=this.cacheToSolveSpaceTransform,o=new Map;for(let[i,s]of e.bestCandidatePointModificationsDelta){let a=t.get(i);if(!a){console.warn(`Could not find original ID for normalized SP ID: ${i} when applying cache.`);continue}let c=this.unravelSection.segmentPointMap.get(a);if(!c){console.warn(`Could not find original segment point for ID: ${a} when applying cache.`);continue}let l={};if(s.dx!==void 0){let h=parseFloat(s.dx);Number.isNaN(h)?console.warn(`Failed to parse cached dx coordinate: ${s.dx}`):l.x=c.x+h}if(s.dy!==void 0){let h=parseFloat(s.dy);Number.isNaN(h)?console.warn(`Failed to parse cached dy coordinate: ${s.dy}`):l.y=c.y+h}s.dz!==void 0&&(l.z=c.z+s.dz),Object.keys(l).length>0&&o.set(a,l)}let r=lCe(this.unravelSection,this.nodeMap,o);this.bestCandidate={pointModifications:o,issues:r,f:e.bestCandidateF,g:e.bestCandidateF,h:0,operationsPerformed:-1,candidateHash:mKe(o)},this.cacheHit=!0,this.solved=!0}attemptToUseCacheSync(){if(this.hasAttemptedToUseCache=!0,!this.cacheProvider?.isSyncCache)return console.log("Cache provider is not synchronous, skipping sync cache check."),!1;if(this.cacheKey||this.computeCacheKeyAndTransform(),!this.cacheKey)return console.error("Failed to compute cache key."),!1;try{let e=this.cacheProvider.getCachedSolutionSync(this.cacheKey);if(e)return this.applyCachedSolution(e),!0}catch(e){console.error("Error attempting to use cache:",e)}return!1}saveToCacheSync(){if(this.failed)return void this.cacheProvider?.setCachedSolutionSync(this.cacheKey,{success:!1});if(!this.bestCandidate)return;let{segmentPointIdMap:e}=this.cacheToSolveSpaceTransform,t=[];for(let[o,r]of this.bestCandidate.pointModifications.entries()){let i=e.get(o);if(!i){console.warn(`Could not find normalized ID for original SP ID: ${o} when saving to cache.`);continue}let s=this.unravelSection.segmentPointMap.get(o);if(!s){console.warn(`Could not find original segment point for ID: ${o} when saving cache.`);continue}let a={},c=!1;if(r.x!==void 0){let l=r.x-s.x,h=BVt(l);parseFloat(h)!==0&&(a.dx=h,c=!0)}if(r.y!==void 0){let l=r.y-s.y,h=BVt(l);parseFloat(h)!==0&&(a.dy=h,c=!0)}if(r.z!==void 0){let l=r.z-s.z;l!==0&&(a.dz=l,c=!0)}c&&t.push([i,a])}let n={success:!0,bestCandidatePointModificationsDelta:t,bestCandidateF:this.bestCandidate.f};this.cacheProvider?.setCachedSolutionSync(this.cacheKey,n)}},Oxr=class extends Kr{getSolverName(){return"UnravelMultiSectionSolver"}nodeMap;dedupedSegmentMap;dedupedSegments;nodeIdToSegmentIds;segmentIdToNodeIds;nodeToSegmentPointMap;segmentToSegmentPointMap;colorMap;tunedNodeCapacityMap;MAX_NODE_ATTEMPTS=2;MUTABLE_HOPS=1;ACCEPTABLE_PF=0.05;MAX_ITERATIONS_WITHOUT_IMPROVEMENT=200;nodePfMap;attemptsToFixNode;activeSubSolver=null;segmentPointMap;cacheProvider=null;constructor({assignedSegments:e,colorMap:t,nodes:n,cacheProvider:o}){super(),this.stats.successfulOptimizations=0,this.stats.failedOptimizations=0,this.stats.cacheHits=0,this.stats.cacheMisses=0,this.cacheProvider=o??null,this.MAX_ITERATIONS=1e6,this.dedupedSegments=((a)=>{let c=[],l=new Map,h=-1;for(let d of a){let u=`${d.start.x}-${d.start.y}-${d.end.x}-${d.end.y}-${d.availableZ.join(",")}`,_=l.get(u);_?d.nodePortSegmentId=_.nodePortSegmentId:(h++,d.nodePortSegmentId=`SEG${h}`,l.set(u,d),c.push(d))}return c})(e),this.dedupedSegmentMap=new Map;for(let a of this.dedupedSegments)this.dedupedSegmentMap.set(a.nodePortSegmentId,a);this.nodeMap=new Map;for(let a of n)this.nodeMap.set(a.capacityMeshNodeId,a);this.nodeIdToSegmentIds=new Map,this.segmentIdToNodeIds=new Map,this.attemptsToFixNode=new Map;for(let a of e)this.segmentIdToNodeIds.set(a.nodePortSegmentId,[...this.segmentIdToNodeIds.get(a.nodePortSegmentId)??[],a.capacityMeshNodeId]),this.nodeIdToSegmentIds.set(a.capacityMeshNodeId,[...this.nodeIdToSegmentIds.get(a.capacityMeshNodeId)??[],a.nodePortSegmentId]);this.colorMap=t??{},this.tunedNodeCapacityMap=new Map;for(let[a,c]of this.nodeMap)this.tunedNodeCapacityMap.set(a,dS(c));let{segmentPointMap:r,nodeToSegmentPointMap:i,segmentToSegmentPointMap:s}=Osn(this.dedupedSegments,this.segmentIdToNodeIds);this.segmentPointMap=r,this.nodeToSegmentPointMap=i,this.segmentToSegmentPointMap=s,this.nodePfMap=this.computeInitialPfMap()}computeInitialPfMap(){let e=new Map;for(let[t,n]of this.nodeMap.entries())e.set(t,this.computeNodePf(n));return e}computeNodePf(e){let{numSameLayerCrossings:t,numEntryExitLayerChanges:n,numTransitionCrossings:o}=((r)=>{let i=0,s=0,a=0,c=new Map;for(let d of r)c.has(d.connectionName)||c.set(d.connectionName,[]),c.get(d.connectionName).push(d);let l=[],h=[];for(let[d,u]of c.entries()){if(u.length<2)continue;let _=u[0];for(let p=1;p<u.length;p++){let m=u[p],A={connectionName:d,z:_.z,points:[_,m]};_.z!==m.z?(s++,h.push({connectionName:d,points:[_,m]})):l.push(A)}}for(let d=0;d<l.length;d++)for(let u=d+1;u<l.length;u++){let _=l[d],p=l[u];_.z===p.z&&su(_.points[0],_.points[1],p.points[0],p.points[1])&&i++}for(let d=0;d<h.length;d++)for(let u=d+1;u<h.length;u++){let _=h[d],p=h[u];su(_.points[0],_.points[1],p.points[0],p.points[1])&&a++}for(let d=0;d<h.length;d++)for(let u=0;u<l.length;u++){let _=h[d],p=l[u];su(_.points[0],_.points[1],p.points[0],p.points[1])&&a++}return{numSameLayerCrossings:i,numEntryExitLayerChanges:s,numTransitionCrossings:a}})((this.nodeToSegmentPointMap.get(e.capacityMeshNodeId)??[]).map((r)=>this.segmentPointMap.get(r)));return ly(e,t,n,o)}_step(){if(this.iterations>=this.MAX_ITERATIONS-1)return void(this.solved=!0);if(!this.activeSubSolver){let o=null,r=0;for(let[i,s]of this.nodePfMap.entries())s*(1-(this.attemptsToFixNode.get(i)??0)/this.MAX_NODE_ATTEMPTS)>r&&(r=s,o=i);if(!o||r<this.ACCEPTABLE_PF)return void(this.solved=!0);this.attemptsToFixNode.set(o,(this.attemptsToFixNode.get(o)??0)+1),this.activeSubSolver=new zxr({dedupedSegments:this.dedupedSegments,dedupedSegmentMap:this.dedupedSegmentMap,nodeMap:this.nodeMap,nodeIdToSegmentIds:this.nodeIdToSegmentIds,segmentIdToNodeIds:this.segmentIdToNodeIds,colorMap:this.colorMap,rootNodeId:o,MUTABLE_HOPS:this.MUTABLE_HOPS,segmentPointMap:this.segmentPointMap,nodeToSegmentPointMap:this.nodeToSegmentPointMap,segmentToSegmentPointMap:this.segmentToSegmentPointMap,cacheProvider:this.cacheProvider})}this.activeSubSolver.step();let{bestCandidate:e,originalCandidate:t,lastProcessedCandidate:n}=this.activeSubSolver;if(this.activeSubSolver.failed)return this.stats.failedOptimizations+=1,void(this.activeSubSolver=null);if(this.activeSubSolver.solved){if(this.activeSubSolver.cacheHit?this.stats.cacheHits+=1:this.stats.cacheMisses+=1,e&&e.g<t.g){this.stats.successfulOptimizations+=1;for(let[o,r]of e.pointModifications.entries()){let i=this.segmentPointMap.get(o);i.x=r.x??i.x,i.y=r.y??i.y,i.z=r.z??i.z}for(let o of this.activeSubSolver.unravelSection.allNodeIds)this.nodePfMap.set(o,this.computeNodePf(this.nodeMap.get(o)))}else this.stats.failedOptimizations+=1;this.activeSubSolver=null}}visualize(){if(this.activeSubSolver)return this.activeSubSolver.visualize();let e={lines:[],points:[],rects:[],circles:[],coordinateSystem:"cartesian",title:"Unravel Multi Section Solver"};for(let[r,i]of this.nodeMap.entries()){let s=this.nodePfMap.get(r)||0,a=Math.min(s,1),c=`rgb(${Math.floor(255*a)}, ${Math.floor(255*(1-a))}, 0)`;(this.attemptsToFixNode.get(r)??0)===0&&a===0||e.rects.push({center:i.center,label:[r,`${i.width.toFixed(2)}x${i.height.toFixed(2)}`,`Pf: ${s.toFixed(3)}`].join(`
`),color:c,width:i.width/8,height:i.height/8})}for(let r of this.segmentPointMap.values()){let i=this.dedupedSegmentMap.get(r.segmentId);e.points.push({x:r.x,y:r.y,label:[r.segmentPointId,r.segmentId,`z: ${r.z}`,`segment.availableZ: ${i?.availableZ.join(",")}`].join(`
`),color:this.colorMap[r.connectionName]||"#000"})}let t=new Map;for(let r of this.segmentPointMap.values())t.has(r.segmentId)||t.set(r.segmentId,[]),t.get(r.segmentId).push(r);for(let[r,i]of t.entries()){if(i.length<2)continue;let s=[...i].sort((a,c)=>a.x!==c.x?a.x-c.x:a.y-c.y);for(let a=0;a<s.length-1;a++)e.lines.push({points:[{x:s[a].x,y:s[a].y},{x:s[a+1].x,y:s[a+1].y}],strokeColor:this.colorMap[r]||"#000"})}let n=new Set,o=Array.from(this.segmentPointMap.values());for(let r=0;r<o.length;r++){let i=o[r];for(let s=r+1;s<o.length;s++){let a=o[s];if(i.connectionName!==a.connectionName||i.segmentId===a.segmentId)continue;if(i.capacityMeshNodeIds.some((c)=>a.capacityMeshNodeIds.includes(c))){let c=`${i.segmentPointId}-${a.segmentPointId}`;if(n.has(c))continue;n.add(c);let l=i.z===a.z,h=i.z,d;d=l?h===0?void 0:"10 5":"3 3 10",e.lines.push({points:[{x:i.x,y:i.y},{x:a.x,y:a.y}],strokeDash:d,strokeColor:this.colorMap[i.connectionName]||"#666"})}}}return e}getNodesWithPortPoints(){if(!this.solved)throw Error("CapacitySegmentToPointSolver not solved, can't give port points yet");let e=new Map;for(let t of this.dedupedSegments){let n=t.nodePortSegmentId;for(let o of this.segmentIdToNodeIds.get(n)){let r=this.nodeMap.get(o);e.has(o)||e.set(o,{capacityMeshNodeId:o,portPoints:[],center:r.center,width:r.width,height:r.height})}}for(let t of this.segmentPointMap.values())for(let n of t.capacityMeshNodeIds){let o=e.get(n);o&&o.portPoints.push({x:t.x,y:t.y,z:t.z,connectionName:t.connectionName,rootConnectionName:t.rootConnectionName})}return Array.from(e.values())}};function Tx(e,t,n,o={}){return{solverName:e,solverClass:t,getConstructorParams:n,onSolved:o.onSolved}}var Ysn=class extends Kr{constructor(e,t={}){super(),this.srj=e,this.opts=t,this.srj=e,this.opts={...t},this.MAX_ITERATIONS=1e8,this.viaDiameter=Pp(e).padDiameter,this.minTraceWidth=e.minTraceWidth;let n=this.opts;if(n.capacityDepth===void 0){let o=e.bounds.maxX-e.bounds.minX,r=e.bounds.maxY-e.bounds.minY,i=Math.max(o,r),s=n.targetMinCapacity??0.5;n.capacityDepth=MQ(i,s)}this.connMap=Ep(e),this.colorMap=yA(e,this.connMap),this.cacheProvider=n.cacheProvider===void 0?_9():n.cacheProvider===null?null:n.cacheProvider,this.startTimeOfPhase={},this.endTimeOfPhase={},this.timeSpentOnPhase={}}srj;opts;getSolverName(){return"AutoroutingPipeline1_OriginalUnravel"}netToPointPairsSolver;nodeSolver;nodeTargetMerger;edgeSolver;initialPathingSolver;pathingOptimizer;edgeToPortSegmentSolver;colorMap;segmentToPointSolver;unravelMultiSectionSolver;segmentToPointOptimizer;highDensityRouteSolver;highDensityStitchSolver;singleLayerNodeMerger;strawSolver;deadEndSolver;traceSimplificationSolver;viaDiameter;minTraceWidth;startTimeOfPhase;endTimeOfPhase;timeSpentOnPhase;activeSubSolver=null;connMap;srjWithPointPairs;capacityNodes=null;capacityEdges=null;cacheProvider=null;pipelineDef=[Tx("netToPointPairsSolver",kq,(e)=>[e.srj,e.colorMap,SQ(e.srj)],{onSolved:(e)=>{e.srjWithPointPairs=e.netToPointPairsSolver?.getNewSimpleRouteJson(),e.colorMap=yA(e.srjWithPointPairs,this.connMap),e.connMap=Ep(e.srjWithPointPairs)}}),Tx("nodeSolver",vxr,(e)=>[e.netToPointPairsSolver?.getNewSimpleRouteJson()||e.srj,e.opts],{onSolved:(e)=>{e.capacityNodes=e.nodeSolver?.finishedNodes}}),Tx("singleLayerNodeMerger",kxr,(e)=>[e.nodeSolver?.finishedNodes],{onSolved:(e)=>{e.capacityNodes=e.singleLayerNodeMerger?.newNodes}}),Tx("strawSolver",Lxr,(e)=>[{nodes:e.singleLayerNodeMerger?.newNodes}],{onSolved:(e)=>{e.capacityNodes=e.strawSolver?.getResultNodes()}}),Tx("edgeSolver",PQ,(e)=>[e.capacityNodes],{onSolved:(e)=>{e.capacityEdges=e.edgeSolver?.edges}}),Tx("deadEndSolver",Rxr,(e)=>[{nodes:e.capacityNodes,edges:e.capacityEdges}],{onSolved:(e)=>{let t=e.deadEndSolver?.removedNodeIds;e.capacityNodes=e.capacityNodes.filter((n)=>!t.has(n.capacityMeshNodeId)),e.capacityEdges=e.capacityEdges.filter((n)=>n.nodeIds.every((o)=>!t.has(o)))}}),Tx("initialPathingSolver",Hsn,(e)=>[{simpleRouteJson:e.srjWithPointPairs,nodes:e.capacityNodes,edges:e.capacityEdges||[],colorMap:e.colorMap,hyperParameters:{MAX_CAPACITY_FACTOR:1}}]),Tx("pathingOptimizer",Nxr,(e)=>[{initialPathingSolver:e.initialPathingSolver,simpleRouteJson:e.srjWithPointPairs,nodes:e.capacityNodes,edges:e.capacityEdges||[],colorMap:e.colorMap,cacheProvider:e.cacheProvider,hyperParameters:{MAX_CAPACITY_FACTOR:1}}]),Tx("edgeToPortSegmentSolver",yxr,(e)=>[{nodes:e.capacityNodes,edges:e.capacityEdges||[],capacityPaths:e.pathingOptimizer?.getCapacityPaths()||[],colorMap:e.colorMap}]),Tx("segmentToPointSolver",Sxr,(e)=>{let t=[];return e.edgeToPortSegmentSolver?.nodePortSegments&&e.edgeToPortSegmentSolver.nodePortSegments.forEach((n)=>{t.push(...n)}),[{segments:t,colorMap:e.colorMap,nodes:e.capacityNodes}]}),Tx("unravelMultiSectionSolver",Oxr,(e)=>[{assignedSegments:e.segmentToPointSolver?.solvedSegments||[],colorMap:e.colorMap,nodes:e.capacityNodes,cacheProvider:this.cacheProvider}]),Tx("highDensityRouteSolver",PV,(e)=>[{nodePortPoints:e.unravelMultiSectionSolver?.getNodesWithPortPoints()??e.segmentToPointOptimizer?.getNodesWithPortPoints()??[],colorMap:e.colorMap,connMap:e.connMap,viaDiameter:e.viaDiameter,traceWidth:e.minTraceWidth}]),Tx("highDensityStitchSolver",Qxr,(e)=>[{connections:e.srjWithPointPairs.connections,hdRoutes:e.highDensityRouteSolver.routes,colorMap:e.colorMap,layerCount:e.srj.layerCount,defaultViaDiameter:e.viaDiameter}]),Tx("traceSimplificationSolver",Ab,(e)=>[{hdRoutes:e.highDensityStitchSolver.mergedHdRoutes,obstacles:e.srj.obstacles,connMap:e.connMap,colorMap:e.colorMap,outline:e.srj.outline,defaultViaDiameter:e.viaDiameter,layerCount:e.srj.layerCount}])];getConstructorParams(){return[this.srj,this.opts]}currentPipelineStepIndex=0;_step(){let e=this.pipelineDef[this.currentPipelineStepIndex];if(!e)return void(this.solved=!0);if(this.activeSubSolver)return this.activeSubSolver.step(),void(this.activeSubSolver.solved?(this.endTimeOfPhase[e.solverName]=performance.now(),this.timeSpentOnPhase[e.solverName]=this.endTimeOfPhase[e.solverName]-this.startTimeOfPhase[e.solverName],e.onSolved?.(this),this.activeSubSolver=null,this.currentPipelineStepIndex++):this.activeSubSolver.failed&&(this.error=this.activeSubSolver?.error,this.failed=!0,this.activeSubSolver=null));let t=e.getConstructorParams(this);this.activeSubSolver=new e.solverClass(...t),this[e.solverName]=this.activeSubSolver,this.timeSpentOnPhase[e.solverName]=0,this.startTimeOfPhase[e.solverName]=performance.now()}solveUntilPhase(e){for(;this.getCurrentPhase()!==e;)this.step()}getCurrentPhase(){return this.pipelineDef[this.currentPipelineStepIndex]?.solverName??"none"}visualize(){if(!this.solved&&this.activeSubSolver)return this.activeSubSolver.visualize();let e=this.netToPointPairsSolver?.visualize(),t=this.nodeSolver?.visualize(),n=this.nodeTargetMerger?.visualize(),o=this.singleLayerNodeMerger?.visualize(),r=this.strawSolver?.visualize(),i=this.edgeSolver?.visualize(),s=this.deadEndSolver?.visualize(),a=this.initialPathingSolver?.visualize(),c=this.pathingOptimizer?.visualize(),l=this.edgeToPortSegmentSolver?.visualize(),h=this.segmentToPointSolver?.visualize(),d=this.unravelMultiSectionSolver?.visualize()??this.segmentToPointOptimizer?.visualize(),u=this.highDensityRouteSolver?.visualize(),_=this.highDensityStitchSolver?.visualize(),p=this.traceSimplificationSolver?.visualize(),m=this.srj.outline,A=[];if(A.push({points:[{x:this.srj.bounds?.minX??-50,y:this.srj.bounds?.minY??-50},{x:this.srj.bounds?.maxX??50,y:this.srj.bounds?.minY??-50},{x:this.srj.bounds?.maxX??50,y:this.srj.bounds?.maxY??50},{x:this.srj.bounds?.minX??-50,y:this.srj.bounds?.maxY??50},{x:this.srj.bounds?.minX??-50,y:this.srj.bounds?.minY??-50}],strokeColor:"rgba(255,0,0,0.25)"}),m&&m.length>=2){let x=m.map((C)=>({x:C.x,y:C.y}));x.push({...x[0]}),A.push({points:x,strokeColor:"rgba(0, 136, 255, 0.95)"})}let g=Nw(this.srj),f={points:[...this.srj.connections.flatMap((x)=>x.pointsToConnect.map((C)=>({...C,layer:Rw(C,this.srj.layerCount),label:`${x.name} ${C.pcb_port_id??""}`})))],rects:[...(this.srj.obstacles??[]).filter((x)=>!x.isCopperPour).map((x)=>({...x,fill:x.layers?.includes("top")?"rgba(255,0,0,0.25)":x.layers?.includes("bottom")?"rgba(0,0,255,0.25)":"rgba(255,0,0,0.25)",layer:sS(x,this.srj.layerCount),label:g(x)}))],lines:A},y=[f,e,t,n,o,r,i,s,a,c,l,h,d,u?sl(f,u):null,_,p,this.solved?sl({lines:A},py(this.getOutputSimpleRouteJson())):null].filter(Boolean);return sl(...y)}preview(){if(this.highDensityRouteSolver){let e=[];for(let t=this.highDensityRouteSolver.routes.length-1;t>=0;t--){let n=this.highDensityRouteSolver.routes[t];if(e.push({points:n.route.map((o)=>({x:o.x,y:o.y})),strokeColor:this.colorMap[n.connectionName]}),e.length>200)break}return{lines:e}}if(this.pathingOptimizer){let e=[];for(let t of this.pathingOptimizer.connectionsWithNodes)t.path&&e.push({points:t.path.map((n)=>({x:n.center.x,y:n.center.y})),strokeColor:this.colorMap[t.connection.name]});return{lines:e}}return this.netToPointPairsSolver?this.netToPointPairsSolver?.visualize():{}}_getOutputHdRoutes(){return this.traceSimplificationSolver?.simplifiedHdRoutes??this.highDensityStitchSolver.mergedHdRoutes}getOutputSimplifiedPcbTraces(){if(!this.solved||!this.highDensityRouteSolver)throw Error("Cannot get output before solving is complete");let e=[],t=this._getOutputHdRoutes();for(let n of this.netToPointPairsSolver?.newConnections??[]){let o=n.__netConnectionName??this.srj.connections.find((i)=>i.name===n.name)?.__netConnectionName,r=t.filter((i)=>i.connectionName===n.name);for(let i=0;i<r.length;i++){let s=r[i],a={type:"pcb_trace",pcb_trace_id:`${n.name}_${i}`,connection_name:o??n.__rootConnectionNames?.[0]??n.name,route:V4(s,this.srj.layerCount)};e.push(a)}}return e}getOutputSimpleRouteJson(){return{...this.srj,traces:this.getOutputSimplifiedPcbTraces()}}};function h3e(e){let{pos:t,segments:n,dir:o,keepoutRadius:r}=e,i=1/0,s=r/4,a={x:t.x-o.x*s,y:t.y-o.y*s},c={x:t.x+o.x*s,y:t.y+o.y*s};for(let l of n){let h=s_(a,c,l.start,l.end);i=Math.min(i,h)}return i}function Vxr(e,t,n,o){let r=d3e(n,o,e),i=d3e(n,o,t),s=d3e(e,t,n),a=d3e(e,t,o);if((r>0&&i<0||r<0&&i>0)&&(s>0&&a<0||s<0&&a>0))return!0;let c=0.0001;return!!(Math.abs(r)<c&&u3e(n,o,e))||(!!(Math.abs(i)<c&&u3e(n,o,t))||(!!(Math.abs(s)<c&&u3e(e,t,n))||!!(Math.abs(a)<c&&u3e(e,t,o))))}function d3e(e,t,n){return(n.x-e.x)*(t.y-e.y)-(t.x-e.x)*(n.y-e.y)}function u3e(e,t,n){return n.x>=Math.min(e.x,t.x)-0.0001&&n.x<=Math.max(e.x,t.x)+0.0001&&n.y>=Math.min(e.y,t.y)-0.0001&&n.y<=Math.max(e.y,t.y)+0.0001}function jWe(e,t,n){for(let o of n)if(Vxr(e,t,o.start,o.end))return!1;return!0}var QR=0.0001;function _Ke(e){let t=e.width/2,n=e.height/2,o=e.center.x,r=e.center.y,i={x:o-t,y:r+n},s={x:o+t,y:r+n},a={x:o-t,y:r-n},c={x:o+t,y:r-n};return[{start:i,end:s},{start:s,end:c},{start:c,end:a},{start:a,end:i}]}function Yxr(e,t,n=0.1){let o=t.x-e.x,r=t.y-e.y,i=Math.sqrt(o*o+r*r);if(i===0)return[];let s=-(r/i),a=o/i,c=n/2;return[{start:{x:e.x+s*c,y:e.y+a*c},end:{x:t.x+s*c,y:t.y+a*c}},{start:{x:e.x-s*c,y:e.y-a*c},end:{x:t.x-s*c,y:t.y-a*c}}]}function Gxr(e,t,n){let o=Math.hypot(e.start.x-t.x,e.start.y-t.y),r=Math.hypot(e.end.x-t.x,e.end.y-t.y);if(o<=n||r<=n)return!0;let i=e.end.x-e.start.x,s=e.end.y-e.start.y,a=i*i+s*s;if(a===0)return!1;let c=Math.max(0,Math.min(1,((t.x-e.start.x)*i+(t.y-e.start.y)*s)/a)),l=e.start.x+c*i,h=e.start.y+c*s;return Math.hypot(l-t.x,h-t.y)<=n}function Uxr(e,t,n){if(!n||n.length===0)return!1;for(let o of n){let r=Math.abs(e.x-o.start.x)<QR&&Math.abs(e.y-o.start.y)<QR&&Math.abs(t.x-o.end.x)<QR&&Math.abs(t.y-o.end.y)<QR,i=Math.abs(e.x-o.end.x)<QR&&Math.abs(e.y-o.end.y)<QR&&Math.abs(t.x-o.start.x)<QR&&Math.abs(t.y-o.start.y)<QR;if(r||i)return!0}return!1}function Wxr(e,t,n,o,r){let i=[];for(let s=0;s<e.length-1;s++){let a=e[s],c=e[s+1];Uxr(a,c,r)||Gxr({start:a,end:c},n,o+t)&&i.push(...Yxr(a,c,t))}return i}var p3e=0.0001;function Xxr(e,t,n,o){let r=t.x-e.x,i=t.y-e.y,s=o.x-n.x,a=o.y-n.y,c=r*a-i*s;if(Math.abs(c)<0.0000000001)return null;let l=n.x-e.x,h=n.y-e.y,d=(l*a-h*s)/c,u=(l*i-h*r)/c,_=0.000001;return d>_&&d<0.999999&&u>_&&u<0.999999?{x:e.x+d*r,y:e.y+d*i}:null}function jxr(e,t){if(!t||t.length===0)return!1;for(let n of t)if(Math.abs(e.x-n.start.x)<p3e&&Math.abs(e.y-n.start.y)<p3e||Math.abs(e.x-n.end.x)<p3e&&Math.abs(e.y-n.end.y)<p3e)return!0;return!1}function Kxr(e,t,n,o){if(!o||o.length===0)return!1;for(let r=t;r<=n;r++)if(r>=0&&r<e.length&&jxr(e[r],o))return!0;return!1}var R4=0.0001,Gsn=class extends Kr{constructor(e){super(),this.input=e;let t=e.srj?.layerCount??2;this.input={...e,obstacles:Bq(e.obstacles,t)},this.MAX_ITERATIONS=1e6,this.originalHdRoutes=[...this.input.hdRoutes],this.hdRoutes=this.input.hdRoutes,this.KEEPOUT_RADIUS_SCHEDULE=e.keepoutRadiusSchedule??[0.3,0.5,0.5],this.currentKeepoutRadius=this.KEEPOUT_RADIUS_SCHEDULE[0]??0.15,this.unprocessedRoutes=[...this.hdRoutes],this.smoothedCursorRoutes=[...this.unprocessedRoutes];let n=[...this.input.obstacles,...this.getJumperPadObstacles()];this.obstacleSHI=new p6e("flatbush",n),this.boardOutlineRoutes=this.createBoardOutlineRoutes(),this.hdRouteSHI=new CCe([...this.hdRoutes,...this.boardOutlineRoutes]);for(let[o,r,i]of this.hdRoutes.flatMap((s)=>[[s.route[0],s.connectionName,s.rootConnectionName],[s.route[s.route.length-1],s.connectionName,s.rootConnectionName]])){let s=this.obstacleSHI.searchArea(o.x,o.y,0.01,0.01).filter((c)=>c.__zLayers?.includes(o.z));if(s.length===0)continue;let a=s[0];this.input.connMap.addConnections([[r,i,...a.offBoardConnectsTo??[],a.obstacleId,...a.connectedTo].filter(Boolean)])}}input;getSolverName(){return"TraceKeepoutSolver"}originalHdRoutes;hdRoutes;redrawnHdRoutes=[];KEEPOUT_RADIUS_SCHEDULE;currentScheduleIndex=0;currentKeepoutRadius;unprocessedRoutes=[];smoothedCursorRoutes=[];processedRoutes=[];currentTrace=null;cursorPosition=null;lastCursorPosition=null;drawPosition=null;currentTraceSegmentIndex=0;currentTraceSegmentT=0;recordedDrawPositions=[];lastCollidingSegments=[];currentTraceJumperSegments=new Map;obstacleSHI;hdRouteSHI;boardOutlineRoutes=[];getSmoothDistance(){return this.currentKeepoutRadius}getJumperPadObstacles(){let e=[];if(!this.input.jumpers)return e;for(let t of this.input.jumpers)for(let n of t.pads)e.push({...n,__zLayers:[0]});return e}buildJumperSegmentMap(e){let t=new Map;if(!e.jumpers||e.jumpers.length===0)return t;let n=e.route;for(let o of e.jumpers){let r=-1,i=1/0;for(let s=0;s<n.length-1;s++){let a=n[s],c=n[s+1],l=Math.sqrt((a.x-o.start.x)**2+(a.y-o.start.y)**2),h=Math.sqrt((c.x-o.end.x)**2+(c.y-o.end.y)**2),d=l+h,u=Math.sqrt((a.x-o.end.x)**2+(a.y-o.end.y)**2),_=Math.sqrt((c.x-o.start.x)**2+(c.y-o.start.y)**2),p=u+_,m=Math.min(d,p);(d<=p?l:u)<1&&(d<=p?h:_)<1&&m<i&&(i=m,r=s)}r>=0&&t.set(r,o)}return t}_step(){if(!this.currentTrace){let r=this.unprocessedRoutes.shift();if(!r)return this.currentScheduleIndex++,this.currentScheduleIndex<this.KEEPOUT_RADIUS_SCHEDULE.length?(this.currentKeepoutRadius=this.KEEPOUT_RADIUS_SCHEDULE[this.currentScheduleIndex],this.unprocessedRoutes=db([...this.processedRoutes],this.currentScheduleIndex),this.smoothedCursorRoutes=[...this.unprocessedRoutes],this.processedRoutes=[],void(this.hdRouteSHI=new CCe([...this.unprocessedRoutes,...this.boardOutlineRoutes]))):(this.redrawnHdRoutes=this.processedRoutes,void(this.solved=!0));if(this.currentTrace=r,this.currentTrace.route.length<2)return this.processedRoutes.push(this.currentTrace),void(this.currentTrace=null);this.currentTraceJumperSegments=this.buildJumperSegmentMap(this.currentTrace);let i=this.currentTrace.route[0];return this.cursorPosition={...i},this.lastCursorPosition={...i},this.drawPosition={x:i.x,y:i.y},this.currentTraceSegmentIndex=0,this.currentTraceSegmentT=0,void(this.recordedDrawPositions=[{...i}])}this.lastCursorPosition={...this.cursorPosition};let e=this.stepCursorForward();if(e==="end")return void this.finalizeCurrentTrace();if(e==="jumper")return void(this.drawPosition={x:this.cursorPosition.x,y:this.cursorPosition.y});let t=this.getCollidingSegments(this.cursorPosition);this.lastCollidingSegments=t;let n=function(r){let{cursorPosition:i,lastCursorPosition:s,collidingSegments:a,keepoutRadius:c}=r;if(a.length===0)return null;let l=0.0001,h=i.x-s.x,d=i.y-s.y,u=Math.sqrt(h*h+d*d),_=u>l?{x:h/u,y:d/u}:{x:1,y:0},p=-_.y,m=_.x,A=h3e({pos:i,segments:a,dir:_,keepoutRadius:c});if(A>=c)return null;for(let D=1;D<=20;D++){let L=D/20*c,H={x:i.x+p*L,y:i.y+m*L},V=h3e({pos:H,segments:a,dir:_,keepoutRadius:c}),O={x:i.x-p*L,y:i.y-m*L},U=h3e({pos:O,segments:a,dir:_,keepoutRadius:c}),j=V>=c&&jWe(i,H,a),Y=U>=c&&jWe(i,O,a);if(j&&Y)return V>=U?H:O;if(j)return H;if(Y)return O}let g=c,f=[];for(let D=-60;D<=60;D++){let L=D/60*g,H={x:i.x+p*L,y:i.y+m*L},V=h3e({pos:H,segments:a,dir:_,keepoutRadius:c}),O=jWe(i,H,a);f.push({pos:H,clearance:V,dist:Math.abs(L),pathClear:O,index:D})}let y=f.filter((D)=>D.pathClear),x=f.findIndex((D)=>D.index===0),C=x>=0?x:Math.floor(f.length/2),b=null;for(let D=C+1;D<f.length-1;D++){let L=f[D-1],H=f[D],V=f[D+1];if(H.clearance>=L.clearance&&H.clearance>=V.clearance){b=H;break}}let I=null;for(let D=C-1;D>0;D--){let L=f[D-1],H=f[D],V=f[D+1];if(H.clearance>=L.clearance&&H.clearance>=V.clearance){I=H;break}}let v=null,P=null;if(y.length>0){let D=y.findIndex((H)=>H.index===0),L=D>=0?D:Math.floor(y.length/2);for(let H=L+1;H<y.length-1;H++){let V=y[H-1],O=y[H],U=y[H+1];if(O.clearance>=V.clearance&&O.clearance>=U.clearance){v=O;break}}for(let H=L-1;H>0;H--){let V=y[H-1],O=y[H],U=y[H+1];if(O.clearance>=V.clearance&&O.clearance>=U.clearance){P=O;break}}}let M=[b,I,v,P,f.find((D)=>D.index===0)].filter((D)=>D!=null),B=new Set,T=M.filter((D)=>{let L=`${D.pos.x.toFixed(6)},${D.pos.y.toFixed(6)}`;return!B.has(L)&&(B.add(L),!0)});if(T.length===0){let D=f[0];if(!D)return null;for(let L of f)L.clearance>D.clearance&&(D=L);return Math.sqrt((D.pos.x-i.x)**2+(D.pos.y-i.y)**2)>l?D.pos:null}let N;if(A<0.15*c){N=T[0];for(let D of T)D.clearance>N.clearance&&(N=D)}else{let D=T.filter((H)=>H.pathClear),L=D.length>0?D:T;N=L[0];for(let H of L)H.clearance>N.clearance&&(N=H)}return Math.sqrt((N.pos.x-i.x)**2+(N.pos.y-i.y)**2)>l?N.pos:null}({cursorPosition:this.cursorPosition,lastCursorPosition:this.lastCursorPosition,collidingSegments:t,keepoutRadius:this.currentKeepoutRadius});this.drawPosition=n??{...this.cursorPosition};let o=this.recordedDrawPositions[this.recordedDrawPositions.length-1];if(o&&this.drawPosition){let r={x:o.x,y:o.y,z:o.z},i={x:this.drawPosition.x,y:this.drawPosition.y,z:this.cursorPosition.z};this.segmentIntersectsOtherRoutes(r,i)&&(this.drawPosition={...this.cursorPosition})}this.recordedDrawPositions.push({x:this.drawPosition.x,y:this.drawPosition.y,z:this.cursorPosition.z})}getStepDistance(){return this.currentKeepoutRadius/2}getJumperAtCurrentSegmentStart(){return this.currentTraceSegmentT>R4?null:this.currentTraceJumperSegments.get(this.currentTraceSegmentIndex)??null}stepCursorForward(){if(!this.currentTrace||!this.cursorPosition)return"end";let e=this.currentTrace.route,t=this.getStepDistance();for(;t>0;){if(this.currentTraceSegmentIndex>=e.length-1)return"end";let n=this.getJumperAtCurrentSegmentStart();if(n){let h=e[this.currentTraceSegmentIndex],d=e[this.currentTraceSegmentIndex+1],u=Math.sqrt((h.x-n.start.x)**2+(h.y-n.start.y)**2),_=Math.sqrt((h.x-n.end.x)**2+(h.y-n.end.y)**2),p=u<=_?n.start:n.end,m=u<=_?n.end:n.start;return this.recordedDrawPositions.push({x:p.x,y:p.y,z:h.z,insideJumperPad:!0}),this.recordedDrawPositions.push({x:m.x,y:m.y,z:d.z,insideJumperPad:!0}),this.cursorPosition={x:m.x,y:m.y,z:d.z},this.currentTraceSegmentIndex++,this.currentTraceSegmentT=0,"jumper"}let o=e[this.currentTraceSegmentIndex],r=e[this.currentTraceSegmentIndex+1],i=r.x-o.x,s=r.y-o.y,a=Math.sqrt(i*i+s*s);if(a===0){this.currentTraceSegmentIndex++,this.currentTraceSegmentT=0;continue}let c=this.currentTraceSegmentT*a,l=a-c;if(t<=l){let h=c+t;return this.currentTraceSegmentT=h/a,this.cursorPosition={x:o.x+i*this.currentTraceSegmentT,y:o.y+s*this.currentTraceSegmentT,z:o.z},"stepped"}if(t-=l,this.currentTraceSegmentIndex++,this.currentTraceSegmentT=0,this.currentTraceSegmentIndex>=e.length-1){let h=e[e.length-1];return this.cursorPosition={...h},"end"}}return"stepped"}getCollidingSegments(e){if(!this.currentTrace)return[];let t=this.currentTrace.rootConnectionName??this.currentTrace.connectionName,n=2*this.currentKeepoutRadius,o=[],r=this.obstacleSHI.searchArea(e.x,e.y,n,n).filter((s)=>s.__zLayers?.includes(e.z));for(let s of r){if(s.__zLayers&&!s.__zLayers.includes(e.z))continue;if(s.connectedTo.includes(t))continue;if(s.obstacleId&&this.input.connMap.areIdsConnected(t,s.obstacleId))continue;let a=!1;for(let c of s.connectedTo)if(this.input.connMap.areIdsConnected(t,c)){a=!0;break}a||o.push(..._Ke(s))}let i=this.hdRouteSHI.getConflictingRoutesNearPoint({x:e.x,y:e.y,z:e.z},n);for(let{conflictingRoute:s}of i){let a=s.rootConnectionName??s.connectionName;if(a===t)continue;if(this.input.connMap.areIdsConnected(t,a))continue;let c=s.traceThickness??0.15;o.push(...Wxr(s.route,c,{x:e.x,y:e.y},n,s.jumpers))}return o}positionHasCollision(e,t=0){let n=this.getCollidingSegments(e);for(let o of n)if(oc(e,o.start,o.end)<=this.currentKeepoutRadius+t)return!0;return!1}segmentIntersectsOtherRoutes(e,t){if(!this.currentTrace)return!1;let n=this.currentTrace.rootConnectionName??this.currentTrace.connectionName,o=[...this.unprocessedRoutes,...this.smoothedCursorRoutes,...this.processedRoutes];for(let r of o)if((r.rootConnectionName??r.connectionName)!==n)for(let i=0;i<r.route.length-1;i++){let s=r.route[i],a=r.route[i+1];if((s.z===e.z||a.z===e.z)&&((!s.insideJumperPad||!a.insideJumperPad)&&su({x:e.x,y:e.y},{x:t.x,y:t.y},{x:s.x,y:s.y},{x:a.x,y:a.y})))return!0}return!1}finalizeCurrentTrace(){if(!this.currentTrace)return;let e=this.currentTrace.route[this.currentTrace.route.length-1],t=this.recordedDrawPositions[this.recordedDrawPositions.length-1];t&&t.x===e.x&&t.y===e.y||this.recordedDrawPositions.push({...e});let n=function(r,i){if(r.length<4)return r;let s=[...r],a=!0;for(;a;){a=!1;for(let c=0;c<s.length-1&&!a;c++){let l=s[c],h=s[c+1];if(l.z===h.z)for(let d=c+2;d<s.length-1&&!a;d++){if(d===c+1)continue;let u=s[d],_=s[d+1];if(u.z!==_.z||l.z!==u.z)continue;let p=Xxr(l,h,u,_);if(p){if(Kxr(s,c+1,d,i))continue;let m=[];for(let A=0;A<=c;A++)m.push(s[A]);m.push({x:p.x,y:p.y,z:l.z});for(let A=d+1;A<s.length;A++)m.push(s[A]);s=m,a=!0}}}}return s}(this.simplifyRoute(this.recordedDrawPositions,this.currentTrace.jumpers),this.currentTrace.jumpers),o={connectionName:this.currentTrace.connectionName,rootConnectionName:this.currentTrace.rootConnectionName,traceThickness:this.currentTrace.traceThickness,viaDiameter:this.currentTrace.viaDiameter,route:n,vias:[...this.currentTrace.vias],jumpers:this.currentTrace.jumpers};this.processedRoutes.push(o),this.hdRouteSHI.removeRoute(this.currentTrace.connectionName),this.hdRouteSHI.addRoute(o),this.currentTrace=null,this.cursorPosition=null,this.lastCursorPosition=null,this.drawPosition=null,this.recordedDrawPositions=[]}isJumperEndpoint(e,t){if(!t||t.length===0)return!1;for(let n of t)if(Math.abs(e.x-n.start.x)<R4&&Math.abs(e.y-n.start.y)<R4||Math.abs(e.x-n.end.x)<R4&&Math.abs(e.y-n.end.y)<R4)return!0;return!1}simplifyRoute(e,t){if(e.length<=2)return e;let n=[e[0]];for(let o=1;o<e.length-1;o++){let r=n[n.length-1],i=e[o],s=e[o+1];if(this.isJumperEndpoint(i,t)){n.push(i);continue}if(i.z!==r.z||i.z!==s.z){n.push(i);continue}let a=i.x-r.x,c=i.y-r.y,l=s.x-i.x,h=a*(s.y-i.y)-c*l,d=0.000001;Math.abs(h)>d&&n.push(i)}return n.push(e[e.length-1]),n}createBoardOutlineRoutes(){let e=[];if(!this.input.srj)return e;let{outline:t,bounds:n}=this.input.srj,o;o=t&&t.length>=3?t:[{x:n.minX,y:n.minY},{x:n.maxX,y:n.minY},{x:n.maxX,y:n.maxY},{x:n.minX,y:n.maxY}];let r=this.input.srj.layerCount??2;for(let i=0;i<o.length;i++){let s=o[i],a=o[(i+1)%o.length];for(let c=0;c<r;c++)e.push({connectionName:`__board_outline___${i}_z${c}`,traceThickness:0.01,viaDiameter:0,route:[{x:s.x,y:s.y,z:c},{x:a.x,y:a.y,z:c}],vias:[]})}return e}visualize(){let e={lines:[],points:[],rects:[],circles:[],coordinateSystem:"cartesian",title:`Trace Keepout Solver (radius: ${this.currentKeepoutRadius.toFixed(2)})`};for(let t of this.originalHdRoutes)if(t.route.length!==0)for(let n=0;n<t.route.length-1;n++){let o=t.route[n],r=t.route[n+1];o.z===r.z&&e.lines.push({points:[{x:o.x,y:o.y},{x:r.x,y:r.y}],strokeColor:"rgba(0,0,0,0.25)",strokeWidth:1.5*(t.traceThickness??0.15)})}if(this.input.jumpers)for(let t of this.input.jumpers){for(let n of t.pads){let o=n.connectedTo.length>0?n.connectedTo.join(", "):"unused",r=n.connectedTo.length>0?this.input.colorMap[n.connectedTo[0]]||"#888888":"rgba(128, 128, 128, 0.5)";e.rects.push({center:n.center,width:n.width,height:n.height,fill:r,stroke:"rgba(0, 0, 0, 0.5)",label:`Jumper pad (${o})`})}t.pads.length>=2&&e.lines.push({points:[t.pads[0].center,t.pads[1].center],strokeColor:"rgba(100, 100, 100, 0.8)",strokeWidth:0.2,label:"Jumper body"})}for(let t of this.input.obstacles){let n="rgba(128, 128, 128, 0.2)",o=t.__zLayers?.includes(0),r=t.__zLayers?.includes(1);o&&r?n="rgba(128, 0, 128, 0.2)":o?n="rgba(255, 0, 0, 0.2)":r&&(n="rgba(0, 0, 255, 0.2)"),e.rects.push({center:t.center,width:t.width,height:t.height,fill:n,label:`Obstacle (Z: ${t.__zLayers?.join(", ")})`})}if(this.input.srj){let{outline:t,bounds:n}=this.input.srj,o;o=t&&t.length>=3?t:[{x:n.minX,y:n.minY},{x:n.maxX,y:n.minY},{x:n.maxX,y:n.maxY},{x:n.minX,y:n.maxY}];for(let r=0;r<o.length;r++){let i=o[r],s=o[(r+1)%o.length];e.lines.push({points:[{x:i.x,y:i.y},{x:s.x,y:s.y}],strokeColor:"rgba(0, 128, 0, 0.6)",strokeWidth:0.1,label:"Board outline"})}}for(let t of this.processedRoutes){if(t.route.length===0)continue;let n=this.input.colorMap[t.connectionName]||"#888888",o=new Set;if(t.jumpers&&t.jumpers.length>0)for(let r of t.jumpers)for(let i=0;i<t.route.length-1;i++){let s=t.route[i],a=t.route[i+1],c=Math.abs(s.x-r.start.x)<R4&&Math.abs(s.y-r.start.y)<R4&&Math.abs(a.x-r.end.x)<R4&&Math.abs(a.y-r.end.y)<R4,l=Math.abs(s.x-r.end.x)<R4&&Math.abs(s.y-r.end.y)<R4&&Math.abs(a.x-r.start.x)<R4&&Math.abs(a.y-r.start.y)<R4;if(c||l){o.add(i);break}}for(let r=0;r<t.route.length-1;r++){let i=t.route[r],s=t.route[r+1];o.has(r)?e.lines.push({points:[{x:i.x,y:i.y},{x:s.x,y:s.y}],strokeColor:"rgba(128, 128, 128, 0.6)",strokeDash:"2 2",label:`${t.connectionName} (jumper segment - fixed)`}):i.z===s.z&&e.lines.push({points:[{x:i.x,y:i.y},{x:s.x,y:s.y}],strokeColor:i.z===0?"red":"blue",strokeWidth:t.traceThickness,label:`${t.connectionName} (z=${i.z})`})}for(let r of t.vias)e.circles.push({center:{x:r.x,y:r.y},radius:t.viaDiameter/2,fill:"rgba(255, 0, 255, 0.5)",label:`${t.connectionName} via`});if(t.jumpers&&t.jumpers.length>0){let r=m9(t.jumpers,{color:n,label:t.connectionName});e.rects.push(...r.rects??[]),e.lines.push(...r.lines??[])}}if(this.currentTrace&&this.recordedDrawPositions.length>0){this.input.colorMap[this.currentTrace.connectionName];for(let t=0;t<this.recordedDrawPositions.length-1;t++){let n=this.recordedDrawPositions[t],o=this.recordedDrawPositions[t+1];e.lines.push({points:[{x:n.x,y:n.y},{x:o.x,y:o.y}],strokeColor:"green",strokeWidth:this.currentTrace.traceThickness})}if(this.cursorPosition&&(e.circles.push({center:{x:this.cursorPosition.x,y:this.cursorPosition.y},radius:this.currentKeepoutRadius,stroke:"orange",fill:"none"}),e.points.push({x:this.cursorPosition.x,y:this.cursorPosition.y,color:"orange",label:"Cursor"}),this.lastCursorPosition)){let t=this.cursorPosition.x-this.lastCursorPosition.x,n=this.cursorPosition.y-this.lastCursorPosition.y,o=Math.sqrt(t*t+n*n),r=o>0.0001?{x:t/o,y:n/o}:{x:1,y:0},i=this.currentKeepoutRadius/4,s={x:this.cursorPosition.x-r.x*i,y:this.cursorPosition.y-r.y*i},a={x:this.cursorPosition.x+r.x*i,y:this.cursorPosition.y+r.y*i};e.lines.push({points:[s,a],strokeColor:"cyan",strokeWidth:0.05,label:"Projected segment"})}this.drawPosition&&e.points.push({x:this.drawPosition.x,y:this.drawPosition.y,color:"lime",label:"Draw"});for(let t of this.lastCollidingSegments)e.lines.push({points:[{x:t.start.x,y:t.start.y},{x:t.end.x,y:t.end.y}],strokeColor:"rgba(255, 0, 255, 0.8)",strokeWidth:0.02,label:"Colliding segment"})}if(!this.solved){for(let t of this.smoothedCursorRoutes)if(t.route.length!==0)for(let n=0;n<t.route.length-1;n++){let o=t.route[n],r=t.route[n+1];o.z===r.z&&e.lines.push({points:[{x:o.x,y:o.y},{x:r.x,y:r.y}],strokeColor:"gray"})}}return e}getRedrawnHdRoutes(){return this.redrawnHdRoutes}},Usn=class extends Kr{constructor(e){super(),this.input=e,this.unprocessedObstacles=Bq(this.input.srj.obstacles,this.input.srj.layerCount).filter((t)=>t.offBoardConnectsTo&&t.offBoardConnectsTo.length>0),this.unprocessedObstacles.forEach((t,n)=>{t.obstacleId=t.obstacleId??`__obs${n}`}),this.offBoardConnMap=new GJe({}),this.offBoardConnMap.addConnections(this.unprocessedObstacles.filter((t)=>t.offBoardConnectsTo?.length).map((t)=>[t.obstacleId,...t.offBoardConnectsTo??[]])),this.nodeTree=new y$e(this.input.capacityMeshNodes)}input;getSolverName(){return"RelateNodesToOffBoardConnectionsSolver"}unprocessedObstacles;nodeTree;offBoardConnMap;nodesInNet=new Map;lastProcessedObstacle;_step(){let e=this.unprocessedObstacles.pop();if(this.lastProcessedObstacle=e,!e)return void(this.solved=!0);let t=this.offBoardConnMap.getNetConnectedToId(e.obstacleId),n=this.nodeTree.getNodesInArea(e.center.x,e.center.y,0.01,0.01).filter((s)=>s.availableZ.some((a)=>e.__zLayers?.includes(a))).filter((s)=>Math.abs(s.center.x-e.center.x)<0.01&&Math.abs(s.center.y-e.center.y)<0.01),o=n.map((s)=>s.capacityMeshNodeId),r=this.nodesInNet.get(t)??[],i=[...r.map((s)=>s.capacityMeshNodeId),...o];for(let s of r)s._offBoardConnectedCapacityMeshNodeIds=i;for(let s of n)s._offBoardConnectedCapacityMeshNodeIds=i,s._offBoardConnectionId=t;this.nodesInNet.set(t,[...r,...n])}getOutput(){return{capacityNodes:this.input.capacityMeshNodes}}visualize(){let e={rects:[],lines:[],points:[],circles:[]},t=new Set;for(let[n,o]of this.nodesInNet)for(let r of o)t.add(r.capacityMeshNodeId);for(let n of this.input.capacityMeshNodes)t.has(n.capacityMeshNodeId)||e.rects.push({center:n.center,width:n.width-0.1,height:n.height-0.1,fill:"rgba(0, 0, 0, 0.2)"});this.lastProcessedObstacle&&e.rects.push({center:this.lastProcessedObstacle.center,width:this.lastProcessedObstacle.width,height:this.lastProcessedObstacle.height,fill:"rgba(255, 0, 0, 0.5)"});for(let[n,o]of this.nodesInNet.entries()){for(let r of o)e.rects.push({center:r.center,width:r.width,height:r.height,fill:Qce(n,0.2),label:`OffBoardConn: ${n}`});for(let r of o)for(let i of o)r.capacityMeshNodeId!==i.capacityMeshNodeId&&e.lines.push({points:[r.center,i.center],strokeColor:Qce(n,1)})}return e}},m3e=0.1,_3e=0.1;function g3e(e,t,n,o,r,i){return(r-e)*(o-t)-(i-t)*(n-e)}function A3e(e,t,n,o,r,i){return Math.min(e,n)<=r&&r<=Math.max(e,n)&&Math.min(t,o)<=i&&i<=Math.max(t,o)}function $xr(e,t,n,o,r,i,s,a){let c=g3e(r,i,s,a,e,t),l=g3e(r,i,s,a,n,o),h=g3e(e,t,n,o,r,i),d=g3e(e,t,n,o,s,a);return(c>0&&l<0||c<0&&l>0)&&(h>0&&d<0||h<0&&d>0)||(!(c!==0||!A3e(r,i,s,a,e,t))||(!(l!==0||!A3e(r,i,s,a,n,o))||(!(h!==0||!A3e(e,t,n,o,r,i))||!(d!==0||!A3e(e,t,n,o,s,a)))))}function qxr(e,t,n,o,r,i){let s=r-n,a=i-o,c=e-n,l=t-o,h=s*s+a*a;if(h===0)return{x:n,y:o,distSq:c*c+l*l};let d=(c*s+l*a)/h;d=Math.max(0,Math.min(1,d));let u=n+d*s,_=o+d*a,p=e-u,m=t-_;return{x:u,y:_,distSq:p*p+m*m}}var Jxr=class extends Kr{getSolverName(){return"SimpleHighDensitySolver"}unsolvedNodes;allNodes;routes;colorMap;traceWidth;viaDiameter;numMovablePoints;currentNode=null;lastNode=null;currentNodeStep=0;routesInProgress=[];pushMargin;currentNodeBounds=null;constructor({nodePortPoints:e,colorMap:t,traceWidth:n=0.1,viaDiameter:o=0.3,pushMargin:r=0.3,numMovablePoints:i=2}){if(super(),i<1||i>3)throw Error(`numMovablePoints must be 1, 2, or 3, got ${i}`);this.allNodes=[...e],this.unsolvedNodes=[...e],this.colorMap=t??{},this.routes=[],this.traceWidth=n,this.viaDiameter=o,this.numMovablePoints=i,this.pushMargin=r,this.MAX_ITERATIONS=10*e.length+1}_step(){if(this.currentNode===null){if(this.unsolvedNodes.length===0)return void(this.solved=!0);this.lastNode=this.currentNode,this.currentNode=this.unsolvedNodes.pop(),this.currentNodeStep=0,this.routesInProgress=[],this._initializeRoutesForCurrentNode()}this.currentNodeStep>0&&this._runForceDirectedStep(),this.currentNodeStep++,this.currentNodeStep>=10&&(this._finalizeRoutesForCurrentNode(),this.lastNode=this.currentNode,this.currentNode=null)}_initializeRoutesForCurrentNode(){let e=this.currentNode,t=e.center.x-e.width/2,n=e.center.x+e.width/2,o=e.center.y-e.height/2,r=e.center.y+e.height/2;this.currentNodeBounds={minX:t,maxX:n,minY:o,maxY:r};let i=new Map;for(let s of e.portPoints)i.has(s.connectionName)||i.set(s.connectionName,[]),i.get(s.connectionName).push({x:s.x,y:s.y,z:s.z,rootConnectionName:s.rootConnectionName});for(let[s,a]of i){if(a.length<2)continue;let c=a[0],l=a[a.length-1],h=c.z,d=l.x-c.x,u=l.y-c.y,_=Math.sqrt(d*d+u*u),p=_>0?d/_:0,m=_>0?u/_:0,A=[];this.numMovablePoints>=1&&A.push({x:c.x+p*_3e,y:c.y+m*_3e,z:h,rootConnectionName:c.rootConnectionName,connectionName:s}),this.numMovablePoints>=2&&A.push({x:l.x-p*_3e,y:l.y-m*_3e,z:h,rootConnectionName:c.rootConnectionName,connectionName:s}),this.numMovablePoints>=3&&A.push({x:c.x+d/2,y:c.y+u/2,z:h,rootConnectionName:c.rootConnectionName,connectionName:s}),this.routesInProgress.push({connectionName:s,rootConnectionName:c.rootConnectionName,startPoint:{x:c.x,y:c.y,z:h},endPoint:{x:l.x,y:l.y,z:h},movablePoints:A})}}_runForceDirectedStep(){let e=this.currentNodeBounds,t=[];for(let a of this.routesInProgress)t.push(...a.movablePoints);let n=new Map;for(let a of t)n.set(a,{fx:0,fy:0});let o=0.3+this.pushMargin,r=new Map;for(let a of this.routesInProgress){let c=[{x:a.startPoint.x,y:a.startPoint.y,movablePoint:null}];a.movablePoints.length===1?c.push({x:a.movablePoints[0].x,y:a.movablePoints[0].y,movablePoint:a.movablePoints[0]}):a.movablePoints.length===2?(c.push({x:a.movablePoints[0].x,y:a.movablePoints[0].y,movablePoint:a.movablePoints[0]}),c.push({x:a.movablePoints[1].x,y:a.movablePoints[1].y,movablePoint:a.movablePoints[1]})):a.movablePoints.length===3&&(c.push({x:a.movablePoints[0].x,y:a.movablePoints[0].y,movablePoint:a.movablePoints[0]}),c.push({x:a.movablePoints[2].x,y:a.movablePoints[2].y,movablePoint:a.movablePoints[2]}),c.push({x:a.movablePoints[1].x,y:a.movablePoints[1].y,movablePoint:a.movablePoints[1]})),c.push({x:a.endPoint.x,y:a.endPoint.y,movablePoint:null}),r.set(a,c)}for(let a of t){let c=n.get(a),l=a.x-e.minX,h=e.maxX-a.x,d=e.maxY-a.y,u=a.y-e.minY;l<o&&(c.fx+=m3e*(o-l)),h<o&&(c.fx-=m3e*(o-h)),u<o&&(c.fy+=m3e*(o-u)),d<o&&(c.fy-=m3e*(o-d));for(let _ of this.routesInProgress){if(_.rootConnectionName===a.rootConnectionName)continue;let p=r.get(_);for(let m=0;m<p.length-1;m++){let A=p[m],g=p[m+1],f=qxr(a.x,a.y,A.x,A.y,g.x,g.y),y=Math.sqrt(f.distSq);if(y>0&&y<2*o){let x=a.x-f.x,C=a.y-f.y,b=0.002/f.distSq,I=b*x,v=b*C;c.fx+=I,c.fy+=v;let P=A.movablePoint,M=g.movablePoint;if(P&&M){let B=n.get(P),T=n.get(M);B.fx-=I/2,B.fy-=v/2,T.fx-=I/2,T.fy-=v/2}else if(P){let B=n.get(P);B.fx-=I,B.fy-=v}else if(M){let B=n.get(M);B.fx-=I,B.fy-=v}}}}}let i=(a)=>a.movablePoint?{x:a.movablePoint.x,y:a.movablePoint.y}:{x:a.x,y:a.y},s=(a)=>{let c=null;for(let u of this.routesInProgress)if(u.movablePoints.includes(a)){c=u;break}if(!c)return!1;let l=r.get(c),h=-1;for(let u=0;u<l.length;u++)if(l[u].movablePoint===a){h=u;break}if(h===-1)return!1;let d=[];if(h>0){let u=i(l[h-1]);d.push({ax:u.x,ay:u.y,bx:a.x,by:a.y})}if(h<l.length-1){let u=i(l[h+1]);d.push({ax:a.x,ay:a.y,bx:u.x,by:u.y})}for(let u of this.routesInProgress){if(u.rootConnectionName===c.rootConnectionName)continue;let _=r.get(u);for(let p=0;p<_.length-1;p++){let m=i(_[p]),A=i(_[p+1]);for(let g of d)if($xr(g.ax,g.ay,g.bx,g.by,m.x,m.y,A.x,A.y))return!0}}return!1};for(let a of t){let c=n.get(a);a.forceX=c.fx,a.forceY=c.fy;let{x:l,y:h}=a;a.x+=c.fx,a.y+=c.fy,a.x=Math.max(e.minX,Math.min(e.maxX,a.x)),a.y=Math.max(e.minY,Math.min(e.maxY,a.y)),s(a)&&(a.x=l,a.y=h)}}_finalizeRoutesForCurrentNode(){for(let e of this.routesInProgress){let{connectionName:t,rootConnectionName:n,startPoint:o,endPoint:r,movablePoints:i}=e,s=[{x:o.x,y:o.y,z:o.z}];i.length===1?s.push({x:i[0].x,y:i[0].y,z:i[0].z}):i.length===2?(s.push({x:i[0].x,y:i[0].y,z:i[0].z}),s.push({x:i[1].x,y:i[1].y,z:i[1].z})):i.length===3&&(s.push({x:i[0].x,y:i[0].y,z:i[0].z}),s.push({x:i[2].x,y:i[2].y,z:i[2].z}),s.push({x:i[1].x,y:i[1].y,z:i[1].z})),s.push({x:r.x,y:r.y,z:r.z});let a={connectionName:t,rootConnectionName:n,traceThickness:this.traceWidth,viaDiameter:this.viaDiameter,route:s,vias:[]};this.routes.push(a)}this.routesInProgress=[]}_getNodeBounds(e){return{minX:e.center.x-e.width/2,maxX:e.center.x+e.width/2,minY:e.center.y-e.height/2,maxY:e.center.y+e.height/2}}visualize(){let e={lines:[],points:[],rects:[],circles:[]};for(let t of this.unsolvedNodes){if(t===this.currentNode)continue;let n=this._getNodeBounds(t);e.rects.push({center:{x:(n.minX+n.maxX)/2,y:(n.minY+n.maxY)/2},width:n.maxX-n.minX,height:n.maxY-n.minY,fill:"rgba(0, 0, 0, 0.08)",stroke:"rgba(0, 0, 0, 0.2)",label:t.capacityMeshNodeId})}if(this.lastNode){let t=this._getNodeBounds(this.lastNode);e.rects.push({center:{x:(t.minX+t.maxX)/2,y:(t.minY+t.maxY)/2},width:t.maxX-t.minX,height:t.maxY-t.minY,fill:"rgba(0, 200, 0, 0.15)",stroke:"rgba(0, 0, 255, 0.6)"})}if(this.currentNode){let t=this._getNodeBounds(this.currentNode);e.rects.push({center:{x:(t.minX+t.maxX)/2,y:(t.minY+t.maxY)/2},width:t.maxX-t.minX,height:t.maxY-t.minY,fill:"rgba(0, 200, 0, 0.15)",stroke:"rgba(0, 200, 0, 0.6)"})}for(let t of this.unsolvedNodes){let n=new Map;for(let o of t.portPoints)n.has(o.connectionName)||n.set(o.connectionName,[]),n.get(o.connectionName).push({x:o.x,y:o.y});for(let[o,r]of n)r.length<2||e.lines.push({points:r.map((i)=>({x:i.x,y:i.y})),label:o,strokeColor:"gray",strokeWidth:this.traceWidth})}for(let t of this.routes){let n=Rbe(t.route,t.connectionName,this.colorMap[t.connectionName]);for(let r of n)e.lines.push({points:r.points,label:r.connectionName,strokeColor:r.z===0?r.color:Qi(r.color,0.75),layer:`z${r.z}`,strokeWidth:t.traceThickness,strokeDash:r.z!==0?"10, 5":void 0});let o=t.route;for(let r=0;r<o.length;r++){let i=o[r],s=r===0,a=r===o.length-1,c=!s&&!a,l;l=s?"start":a?"end":`M${r}`,e.points.push({x:i.x,y:i.y,label:l,color:c?"orange":"blue"})}}for(let t of this.routesInProgress){let{startPoint:n,endPoint:o,movablePoints:r,connectionName:i}=t,s=this.colorMap[i]??"gray",a=[{x:n.x,y:n.y}];r.length===1?a.push({x:r[0].x,y:r[0].y}):r.length===2?(a.push({x:r[0].x,y:r[0].y}),a.push({x:r[1].x,y:r[1].y})):r.length===3&&(a.push({x:r[0].x,y:r[0].y}),a.push({x:r[2].x,y:r[2].y}),a.push({x:r[1].x,y:r[1].y})),a.push({x:o.x,y:o.y}),e.lines.push({points:a,label:i,strokeColor:s,strokeWidth:this.traceWidth}),e.points.push({x:n.x,y:n.y,label:"start",color:"blue"});for(let c=0;c<r.length;c++){let l=r[c];if(e.points.push({x:l.x,y:l.y,label:`M${c+1}`,color:"orange"}),l.forceX!==void 0&&l.forceY!==void 0){if(Math.sqrt(l.forceX*l.forceX+l.forceY*l.forceY)>0.001){e.lines.push({points:[{x:l.x,y:l.y},{x:l.x+l.forceX*5,y:l.y+l.forceY*5}],strokeColor:"red",strokeWidth:0.02,label:`F${c+1}`});let d=0.05,u=l.x+l.forceX*5,_=l.y+l.forceY*5,p=Math.atan2(l.forceY,l.forceX);e.lines.push({points:[{x:u,y:_},{x:u-d*Math.cos(p-Math.PI/6),y:_-d*Math.sin(p-Math.PI/6)}],strokeColor:"red",strokeWidth:0.02}),e.lines.push({points:[{x:u,y:_},{x:u-d*Math.cos(p+Math.PI/6),y:_-d*Math.sin(p+Math.PI/6)}],strokeColor:"purple",strokeWidth:0.02})}}}e.points.push({x:o.x,y:o.y,label:"end",color:"blue"})}return e}},Wsn=({connMap:e,connectionsWithResults:t,inputNodes:n,obstacles:o})=>{let r=o.filter((a)=>a.offBoardConnectsTo?.length);if(r.length===0)return;let i=new eV({});i.addConnections(r.map((a,c)=>[a.obstacleId??`__obs${c}`,...a.offBoardConnectsTo??[]]));let s=new Map(n.map((a)=>[a.capacityMeshNodeId,a]));for(let a of t){if(!a.path)continue;let c=a.connection.rootConnectionName??a.connection.name,l=new Set;for(let h of a.path){let d=s.get(h.currentNodeId);if(d?._offBoardConnectionId&&l.add(d._offBoardConnectionId),h.throughNodeId){let u=s.get(h.throughNodeId);u?._offBoardConnectionId&&l.add(u._offBoardConnectionId)}}for(let h of l){let d=i.getIdsConnectedToNet(h);d?.length&&e.addConnections([[c,...d]])}}};function nb(e,t,n,o={}){return{solverName:e,solverClass:t,getConstructorParams:n,onSolved:o.onSolved}}var Xsn=class extends Kr{constructor(e,t={}){super(),this.srj=e,this.opts=t,this.srj=e,this.opts={...t},this.viaDiameter=Pp(e).padDiameter,this.minTraceWidth=e.minTraceWidth;let n=this.opts;if(this.effort=n.effort??1,this.MAX_ITERATIONS=1e8*this.effort,n.capacityDepth===void 0){let o=e.bounds.maxX-e.bounds.minX,r=e.bounds.maxY-e.bounds.minY,i=Math.max(o,r),s=n.targetMinCapacity??0.5;n.capacityDepth=MQ(i,s)}this.connMap=Ep(e),this.colorMap=yA(e,this.connMap),this.cacheProvider=n.cacheProvider===void 0?_9():n.cacheProvider===null?null:n.cacheProvider,this.startTimeOfPhase={},this.endTimeOfPhase={},this.timeSpentOnPhase={}}srj;opts;getSolverName(){return"AssignableAutoroutingPipeline2"}netToPointPairsSolver;nodeSolver;nodeTargetMerger;edgeSolver;relateNodesToOffBoardConnections;colorMap;highDensityRouteSolver;simpleHighDensityRouteSolver;highDensitySolver;highDensityStitchSolver;singleLayerNodeMerger;offboardPathFragmentSolver;strawSolver;deadEndSolver;traceSimplificationSolver;traceKeepoutSolver;traceWidthSolver;availableSegmentPointSolver;portPointPathingSolver;multiSectionPortPointOptimizer;viaDiameter;minTraceWidth;effort;startTimeOfPhase;endTimeOfPhase;timeSpentOnPhase;activeSubSolver=null;connMap;srjWithPointPairs;capacityNodes=null;capacityEdges=null;cacheProvider=null;pipelineDef=[nb("netToPointPairsSolver",YJe,(e)=>[e.srj,e.colorMap,SQ(e.srj)],{onSolved:(e)=>{e.srjWithPointPairs=e.netToPointPairsSolver?.getNewSimpleRouteJson(),e.colorMap=yA(e.srjWithPointPairs,this.connMap),e.connMap=Ep(e.srjWithPointPairs)}}),nb("nodeSolver",wq,(e)=>[{simpleRouteJson:e.srjWithPointPairs,maxGapFillPasses:4}],{onSolved:(e)=>{e.capacityNodes=e.nodeSolver?.getOutput().meshNodes??[]}}),nb("relateNodesToOffBoardConnections",Usn,(e)=>[{capacityMeshNodes:e.capacityNodes,srj:e.srj}],{onSolved:(e)=>{e.capacityNodes=e.relateNodesToOffBoardConnections?.getOutput().capacityNodes}}),nb("edgeSolver",PQ,(e)=>[e.capacityNodes],{onSolved:(e)=>{e.capacityEdges=e.edgeSolver?.edges}}),nb("availableSegmentPointSolver",yV,(e)=>[{nodes:e.capacityNodes,edges:e.capacityEdges||[],traceWidth:e.minTraceWidth,colorMap:e.colorMap,shouldReturnCrampedPortPoints:!1}]),nb("portPointPathingSolver",VJe,(e)=>{let t=e.capacityNodes.map((r)=>({capacityMeshNodeId:r.capacityMeshNodeId,center:r.center,width:r.width,height:r.height,portPoints:[],availableZ:r.availableZ,_containsTarget:r._containsTarget,_containsObstacle:r._containsObstacle,_offBoardConnectionId:r._offBoardConnectionId,_offBoardConnectedCapacityMeshNodeIds:r._offBoardConnectedCapacityMeshNodeIds})),n=new Map(t.map((r)=>[r.capacityMeshNodeId,r])),o=e.availableSegmentPointSolver;for(let r of o.sharedEdgeSegments)for(let i of r.portPoints){let[s,a]=i.nodeIds,c={portPointId:i.segmentPortPointId,x:i.x,y:i.y,z:i.availableZ[0]??0,connectionNodeIds:[s,a],distToCentermostPortOnZ:i.distToCentermostPortOnZ,connectsToOffBoardNode:r.nodeIds.some((h)=>n.get(h)?._offBoardConnectionId)},l=n.get(s);l&&l.portPoints.push(c)}return[{simpleRouteJson:e.srjWithPointPairs,inputNodes:t,capacityMeshNodes:e.capacityNodes,colorMap:e.colorMap,numShuffleSeeds:100*Math.min(1,e.effort),hyperParameters:{JUMPER_PF_FN_ENABLED:!1,NODE_PF_FACTOR:100,NODE_PF_MAX_PENALTY:100,CENTER_OFFSET_DIST_PENALTY_FACTOR:0,FORCE_CENTER_FIRST:!0}}]},{onSolved:(e)=>{let t=e.portPointPathingSolver;t&&Wsn({connMap:e.connMap,connectionsWithResults:t.connectionsWithResults,inputNodes:t.inputNodes,obstacles:e.srj.obstacles})}}),nb("multiSectionPortPointOptimizer",jyr,(e)=>{let t=e.portPointPathingSolver;return[{simpleRouteJson:e.srjWithPointPairs,inputNodes:t.inputNodes,capacityMeshNodes:e.capacityNodes,capacityMeshEdges:e.capacityEdges,colorMap:e.colorMap,initialConnectionResults:t.connectionsWithResults,initialAssignedPortPoints:t.assignedPortPoints,initialNodeAssignedPortPoints:t.nodeAssignedPortPoints}]}),nb("highDensitySolver",Jxr,(e)=>[{nodePortPoints:e.multiSectionPortPointOptimizer?.getNodesWithPortPoints()??e.portPointPathingSolver?.getNodesWithPortPoints()??[],colorMap:e.colorMap,viaDiameter:e.viaDiameter,traceWidth:e.minTraceWidth,connMap:e.connMap}]),nb("highDensityStitchSolver",UJe,(e)=>[{connections:e.srjWithPointPairs.connections,hdRoutes:e.highDensitySolver.routes,colorMap:e.colorMap,layerCount:e.srj.layerCount,defaultViaDiameter:e.viaDiameter}]),nb("traceSimplificationSolver",Ab,(e)=>[{hdRoutes:e.highDensityStitchSolver?.mergedHdRoutes??e.highDensitySolver?.routes??e.highDensityRouteSolver?.routes,obstacles:e.srj.obstacles,connMap:e.connMap,colorMap:e.colorMap,outline:e.srj.outline,defaultViaDiameter:e.viaDiameter,layerCount:e.srj.layerCount,iterations:2}]),nb("traceKeepoutSolver",Gsn,(e)=>[{hdRoutes:e.traceSimplificationSolver?.simplifiedHdRoutes??[],obstacles:e.srj.obstacles,connMap:e.connMap,colorMap:e.colorMap,srj:e.srj}]),nb("traceWidthSolver",Lq,(e)=>[{hdRoutes:e.traceKeepoutSolver?.redrawnHdRoutes??[],connection:e.srj.connections,obstacles:e.srj.obstacles,connMap:e.connMap,colorMap:e.colorMap,minTraceWidth:e.minTraceWidth,obstacleMargin:e.srj.defaultObstacleMargin??0.15,layerCount:e.srj.layerCount}])];getConstructorParams(){return[this.srj,this.opts]}currentPipelineStepIndex=0;_step(){let e=this.pipelineDef[this.currentPipelineStepIndex];if(!e)return void(this.solved=!0);if(this.activeSubSolver)return this.activeSubSolver.step(),void(this.activeSubSolver.solved?(this.endTimeOfPhase[e.solverName]=performance.now(),this.timeSpentOnPhase[e.solverName]=this.endTimeOfPhase[e.solverName]-this.startTimeOfPhase[e.solverName],e.onSolved?.(this),this.activeSubSolver=null,this.currentPipelineStepIndex++):this.activeSubSolver.failed&&(this.error=this.activeSubSolver?.error,this.failed=!0,this.activeSubSolver=null));let t=e.getConstructorParams(this);this.activeSubSolver=new e.solverClass(...t),this[e.solverName]=this.activeSubSolver,this.timeSpentOnPhase[e.solverName]=0,this.startTimeOfPhase[e.solverName]=performance.now()}solveUntilPhase(e){for(;this.getCurrentPhase()!==e;)this.step()}getCurrentPhase(){return this.pipelineDef[this.currentPipelineStepIndex]?.solverName??"none"}visualize(){if(!this.solved&&this.activeSubSolver)return this.activeSubSolver.visualize();let e=this.netToPointPairsSolver?.visualize(),t=this.nodeSolver?.visualize(),n=this.nodeTargetMerger?.visualize(),o=this.singleLayerNodeMerger?.visualize(),r=this.strawSolver?.visualize(),i=this.edgeSolver?.visualize(),s=this.deadEndSolver?.visualize(),a=this.availableSegmentPointSolver?.visualize(),c=this.offboardPathFragmentSolver?.visualize(),l=this.portPointPathingSolver?.visualize(),h=this.multiSectionPortPointOptimizer?.visualize(),d=this.highDensityRouteSolver?.visualize(),u=this.highDensitySolver?.visualize(),_=this.simpleHighDensityRouteSolver?.visualize(),p=this.highDensityStitchSolver?.visualize(),m=this.traceSimplificationSolver?.visualize(),A=this.traceKeepoutSolver?.visualize(),g=this.traceWidthSolver?.visualize(),f=this.srj.outline,y=[];if(y.push({points:[{x:this.srj.bounds?.minX??-50,y:this.srj.bounds?.minY??-50},{x:this.srj.bounds?.maxX??50,y:this.srj.bounds?.minY??-50},{x:this.srj.bounds?.maxX??50,y:this.srj.bounds?.maxY??50},{x:this.srj.bounds?.minX??-50,y:this.srj.bounds?.maxY??50},{x:this.srj.bounds?.minX??-50,y:this.srj.bounds?.minY??-50}],strokeColor:"rgba(255,0,0,0.25)"}),f&&f.length>=2){let I=f.map((v)=>({x:v.x,y:v.y}));I.push({...I[0]}),y.push({points:I,strokeColor:"rgba(0, 136, 255, 0.95)"})}let x=Nw(this.srj),C={points:[...this.srj.connections.flatMap((I)=>I.pointsToConnect.map((v)=>({...v,layer:Rw(v,this.srj.layerCount),label:`${I.name} ${v.pcb_port_id??""}`})))],rects:[...(this.srj.obstacles??[]).filter((I)=>!I.isCopperPour).map((I)=>({...I,fill:I.layers?.includes("top")?"rgba(255,0,0,0.25)":I.layers?.includes("bottom")?"rgba(0,0,255,0.25)":"rgba(255,0,0,0.25)",layer:sS(I,this.srj.layerCount),label:x(I)}))],lines:y},b=[C,e,t,n,o,r,i,s,a,c,l,h,d?sl(C,d):null,u?sl(C,u):null,_?sl(C,_):null,p,m,A,g,this.solved?sl({lines:y},py(this.getOutputSimpleRouteJson())):null].filter(Boolean);return sl(...b)}preview(){let e=this.highDensitySolver?.routes??this.simpleHighDensityRouteSolver?.routes??this.highDensityRouteSolver?.routes;if(e){let t=[];for(let n=e.length-1;n>=0;n--){let o=e[n];if(t.push({points:o.route.map((r)=>({x:r.x,y:r.y})),strokeColor:this.colorMap[o.connectionName]}),t.length>200)break}return{lines:t}}if(this.portPointPathingSolver){let t=[];for(let n of this.portPointPathingSolver.connectionsWithResults)n.path&&t.push({points:n.path.map((o)=>({x:o.point.x,y:o.point.y})),strokeColor:this.colorMap[n.connection.name]});return{lines:t}}return this.netToPointPairsSolver?this.netToPointPairsSolver?.visualize():{}}_getOutputHdRoutes(){return this.traceWidthSolver?.hdRoutesWithWidths??this.traceKeepoutSolver?.redrawnHdRoutes??this.traceSimplificationSolver?.simplifiedHdRoutes??this.highDensityStitchSolver?.mergedHdRoutes??this.highDensitySolver?.routes??this.simpleHighDensityRouteSolver?.routes??this.highDensityRouteSolver?.routes}getConnectedOffboardObstacles(){let e={},t=new Set(this.srj.connections.flatMap((n)=>n.__rootConnectionNames??[n.name]));for(let[n,o]of this.srj.obstacles.entries()){if(!o.offBoardConnectsTo?.length)continue;let r=o.obstacleId??`__obs${n}`,i=this.connMap.getNetConnectedToId(r);if(!i)continue;let s=this.connMap.getIdsConnectedToNet(i).find((a)=>t.has(a));s&&(e[r]=s)}return e}getOutputSimplifiedPcbTraces(){if(!this.solved||!this.highDensityRouteSolver&&!this.simpleHighDensityRouteSolver&&!this.highDensitySolver)throw Error("Cannot get output before solving is complete");let e=[],t=this._getOutputHdRoutes();for(let n of this.netToPointPairsSolver?.newConnections??[]){let o=n.__netConnectionName??this.srj.connections.find((i)=>i.name===n.name)?.__netConnectionName,r=t.filter((i)=>i.connectionName===n.name);for(let i=0;i<r.length;i++){let s=r[i],a={type:"pcb_trace",pcb_trace_id:`${n.name}_${i}`,connection_name:o??n.__rootConnectionNames?.[0]??n.name,route:V4(s,this.srj.layerCount)};e.push(a)}}return e}getOutputSimpleRouteJson(){return{...this.srj,traces:this.getOutputSimplifiedPcbTraces()}}},Zxr=class extends Kr{getSolverName(){return"MultipleHighDensityRouteStitchSolver2"}unsolvedRoutes;mergedHdRoutes=[];colorMap={};defaultTraceThickness;defaultViaDiameter;constructor(e){super(),this.colorMap=e.colorMap??{};let t=e.hdRoutes[0];this.defaultTraceThickness=t?.traceThickness??0.15,this.defaultViaDiameter=t?.viaDiameter??e.defaultViaDiameter??0.3;let n=new Map;for(let r of e.connectionPathResults)n.set(r.connection.name,r);let o=new Map;for(let r of e.hdRoutes){let i=o.get(r.connectionName);i?i.push(r):o.set(r.connectionName,[r])}this.unsolvedRoutes=[];for(let[r,i]of o.entries()){let s=e.connections.find((d)=>d.name===r);if(!s)continue;let a=n.get(r),c=[];a?.path&&(c=a.path.map((d)=>d.currentNodeId));let l={...s.pointsToConnect[0],z:ti(Ef(s.pointsToConnect[0]),e.layerCount)},h={...s.pointsToConnect[1],z:ti(Ef(s.pointsToConnect[1]),e.layerCount)};this.unsolvedRoutes.push({connectionName:r,hdRoutes:i,nodeOrder:c,start:l,end:h})}this.MAX_ITERATIONS=1e5}_step(){let e=this.unsolvedRoutes.pop();if(!e)return void(this.solved=!0);let t=this.stitchOrderedRoutes(e);this.mergedHdRoutes.push(t)}stitchOrderedRoutes(e){let{connectionName:t,hdRoutes:n,nodeOrder:o,start:r,end:i}=e;if(n.length===0)return{connectionName:t,traceThickness:this.defaultTraceThickness,viaDiameter:this.defaultViaDiameter,route:[r,i],vias:[],jumpers:[]};let s;s=o.length>0?this.orderRoutesByNodePath(n,o,r,t):this.orderRoutesByProximity(n,r);let a=[],c=[],l=[];a.push({x:r.x,y:r.y,z:r.z});for(let d=0;d<s.length;d++){let u=s[d],_=a[a.length-1],p=u.route[0],m=u.route[u.route.length-1],A=Dn(_,p),g=Dn(_,m),f=Math.min(A,g);if(d>0&&f>1)continue;let y;y=A<=g?[...u.route]:[...u.route].reverse();let x=0.001;y.length>0&&Dn(_,y[0])<x&&(y=y.slice(1)),a.push(...y),c.push(...u.vias),u.jumpers&&l.push(...u.jumpers)}let h=Dn(a[a.length-1],i);return h>0.001&&h<1&&a.push({x:i.x,y:i.y,z:i.z}),{connectionName:t,rootConnectionName:n[0]?.rootConnectionName,traceThickness:n[0]?.traceThickness??this.defaultTraceThickness,viaDiameter:n[0]?.viaDiameter??this.defaultViaDiameter,route:a,vias:c,jumpers:l}}orderRoutesByNodePath(e,t,n,o){if(e.length===0)return[];let r=new Set(e),i=null,s=1/0;for(let A of r){let g=A.route[0],f=A.route[A.route.length-1],y=Math.min(Dn(n,g),Dn(n,f));y<s&&(s=y,i=A)}if(!i)return[];r.delete(i);let a=i.route[0],c=i.route[i.route.length-1],l,h;Dn(n,a)<=Dn(n,c)?(l=a,h=c):(l=c,h=a);let d=(A,g)=>{let f=0;for(let y of r){if(y===g)continue;let x=y.route[0],C=y.route[y.route.length-1];(Dn(A,x)<10||Dn(A,C)<10)&&f++}return f},u=[i],_=h;for(;r.size>0;){let A=null,g=1/0,f=-1;for(let y of r){let x=y.route[0],C=y.route[y.route.length-1],b=Dn(_,x),I=Dn(_,C),v=Math.min(b,I);if(v>=10)continue;let P=d(b<=I?C:x,y),M=P===0,B=f===0,T=v-g,N=!1;N=A===null||(!!(!M&&B&&T<5)||!(M&&!B&&T>-5)&&v<g),N&&(g=v,A=y,f=P)}if(!A)break;{u.push(A),r.delete(A);let y=A.route[0],x=A.route[A.route.length-1];_=Dn(_,y)<=Dn(_,x)?x:y}}let p=[];for(_=l;r.size>0;){let A=null,g=1/0,f=-1,y=Dn(_,n);for(let x of r){let C=x.route[0],b=x.route[x.route.length-1],I=Dn(_,C),v=Dn(_,b),P=Math.min(I,v);if(P>=10)continue;let M=I<=v?b:C;if(Dn(M,n)>y+2)continue;let B=d(M,x),T=B===0,N=f===0,D=P-g,L=!1;L=A===null||(!!(!T&&N&&D<5)||!(T&&!N&&D>-5)&&P<g),L&&(g=P,A=x,f=B)}if(!A)break;{p.unshift(A),r.delete(A);let x=A.route[0],C=A.route[A.route.length-1];_=Dn(_,x)<=Dn(_,C)?C:x}}let m=[...p,...u];if(r.size>0){let A=[...r].map((g)=>{let f=g.route[0],y=g.route[g.route.length-1];return`start=(${f.x.toFixed(2)},${f.y.toFixed(2)}) end=(${y.x.toFixed(2)},${y.y.toFixed(2)})`});console.warn(`[StitchSolver] Skipped ${r.size} routes for connection ${e[0]?.connectionName??"?"}, skipped routes: ${A.join("; ")}`)}return m}orderRoutesByProximity(e,t){let n=new Set(e),o=[],r=t;for(;n.size>0;){let i=null,s=1/0,a=!1;for(let c of n){let l=c.route[0],h=c.route[c.route.length-1],d=Dn(r,l),u=Dn(r,h);d<s&&(s=d,i=c,a=!1),u<s&&(s=u,i=c,a=!0)}if(!i)break;{o.push(i),n.delete(i);let c=i.route[0],l=i.route[i.route.length-1];r=a?c:l}}return o}visualize(){let e={points:[],lines:[],circles:[],rects:[],title:"Multiple High Density Route Stitch Solver 2"};for(let[t,n]of this.mergedHdRoutes.entries()){let o=this.colorMap[n.connectionName]??`hsl(120, 100%, ${40+10*t%40}%)`;for(let r=0;r<n.route.length-1;r++){let i=n.route[r],s=n.route[r+1],a=i.z!==0?Qi(o,0.5):o;e.lines?.push({points:[{x:i.x,y:i.y},{x:s.x,y:s.y}],strokeColor:a,strokeWidth:n.traceThickness})}for(let r of n.route){let i=r.z!==0?Qi(o,0.5):o;e.points?.push({x:r.x,y:r.y,color:i})}for(let r of n.vias)e.circles?.push({center:{x:r.x,y:r.y},radius:n.viaDiameter/2,fill:o});if(n.jumpers&&n.jumpers.length>0){let r=m9(n.jumpers,{color:o,label:n.connectionName});e.rects.push(...r.rects??[]),e.lines.push(...r.lines??[])}}for(let t of this.unsolvedRoutes){let n=this.colorMap[t.connectionName]??"gray";e.points?.push({x:t.start.x,y:t.start.y,color:n,label:`${t.connectionName} Start`},{x:t.end.x,y:t.end.y,color:n,label:`${t.connectionName} End`});for(let o=0;o<t.hdRoutes.length;o++){let r=t.hdRoutes[o];if(r.route.length>1&&e.lines?.push({points:r.route.map((i)=>({x:i.x,y:i.y})),strokeColor:Qi(n,0.5),strokeDash:"10 5",label:`segment ${o}`}),r.jumpers&&r.jumpers.length>0){let i=m9(r.jumpers,{color:n,label:r.connectionName});e.rects.push(...i.rects??[]),e.lines.push(...i.lines??[])}}}return e}},{create:e5r,defineProperty:TVt,getOwnPropertyDescriptor:t5r,getOwnPropertyNames:jsn,getPrototypeOf:n5r}=Object,o5r=Object.prototype.hasOwnProperty,MV=(e,t)=>function(){return t||(0,e[jsn(e)[0]])((t={exports:{}}).exports,t),t.exports},DVt=(e,t,n)=>(n=e!=null?e5r(n5r(e)):{},((o,r,i,s)=>{if(r&&typeof r=="object"||typeof r=="function")for(let a of jsn(r))o5r.call(o,a)||a===i||TVt(o,a,{get:()=>r[a],enumerable:!(s=t5r(r,a))||s.enumerable});return o})(!t&&e&&e.__esModule?n:TVt(n,"default",{value:e,enumerable:!0}),e)),r5r=MV({"node_modules/is-buffer/index.js"(e,t){function n(o){return!!o.constructor&&typeof o.constructor.isBuffer=="function"&&o.constructor.isBuffer(o)}t.exports=function(o){return o!=null&&(n(o)||function(r){return typeof r.readFloatLE=="function"&&typeof r.slice=="function"&&n(r.slice(0,0))}(o)||!!o._isBuffer)}}}),i5r=MV({"node_modules/kind-of/index.js"(e,t){var n=r5r(),o=Object.prototype.toString;t.exports=function(r){if(r===void 0)return"undefined";if(r===null)return"null";if(r===!0||r===!1||r instanceof Boolean)return"boolean";if(typeof r=="string"||r instanceof String)return"string";if(typeof r=="number"||r instanceof Number)return"number";if(typeof r=="function"||r instanceof Function)return"function";if(Array.isArray!==void 0&&Array.isArray(r))return"array";if(r instanceof RegExp)return"regexp";if(r instanceof Date)return"date";var i=o.call(r);return i==="[object RegExp]"?"regexp":i==="[object Date]"?"date":i==="[object Arguments]"?"arguments":i==="[object Error]"?"error":n(r)?"buffer":i==="[object Set]"?"set":i==="[object WeakSet]"?"weakset":i==="[object Map]"?"map":i==="[object WeakMap]"?"weakmap":i==="[object Symbol]"?"symbol":i==="[object Int8Array]"?"int8array":i==="[object Uint8Array]"?"uint8array":i==="[object Uint8ClampedArray]"?"uint8clampedarray":i==="[object Int16Array]"?"int16array":i==="[object Uint16Array]"?"uint16array":i==="[object Int32Array]"?"int32array":i==="[object Uint32Array]"?"uint32array":i==="[object Float32Array]"?"float32array":i==="[object Float64Array]"?"float64array":"object"}}}),s5r=MV({"node_modules/rename-keys/index.js"(e,t){(function(){function n(o,r){if(typeof r!="function")return o;var i={};for(var s in o)Object.prototype.hasOwnProperty.call(o,s)&&(i[r(s,o[s])||s]=o[s]);return i}t!==void 0&&t.exports?t.exports=n:typeof define=="function"&&define.amd?define([],function(){return n}):window.rename=n})()}}),a5r=MV({"node_modules/deep-rename-keys/index.js"(e,t){var n=i5r(),o=s5r();t.exports=function r(i,s){var a=n(i);if(a!=="object"&&a!=="array")throw Error("expected an object");var c=[];for(var l in a==="object"&&(i=o(i,s),c={}),i)if(i.hasOwnProperty(l)){var h=i[l];n(h)==="object"||n(h)==="array"?c[l]=r(h,s):c[l]=h}return c}}}),Ksn=MV({"node_modules/eventemitter3/index.js"(e,t){var n=Object.prototype.hasOwnProperty,o="~";function r(){}function i(a,c,l){this.fn=a,this.context=c,this.once=l||!1}function s(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),new r().__proto__||(o=!1)),s.prototype.eventNames=function(){var a,c,l=[];if(this._eventsCount===0)return l;for(c in a=this._events)n.call(a,c)&&l.push(o?c.slice(1):c);return Object.getOwnPropertySymbols?l.concat(Object.getOwnPropertySymbols(a)):l},s.prototype.listeners=function(a,c){var l=o?o+a:a,h=this._events[l];if(c)return!!h;if(!h)return[];if(h.fn)return[h.fn];for(var d=0,u=h.length,_=Array(u);d<u;d++)_[d]=h[d].fn;return _},s.prototype.emit=function(a,c,l,h,d,u){var _=o?o+a:a;if(!this._events[_])return!1;var p,m,A=this._events[_],g=arguments.length;if(A.fn){switch(A.once&&this.removeListener(a,A.fn,void 0,!0),g){case 1:return A.fn.call(A.context),!0;case 2:return A.fn.call(A.context,c),!0;case 3:return A.fn.call(A.context,c,l),!0;case 4:return A.fn.call(A.context,c,l,h),!0;case 5:return A.fn.call(A.context,c,l,h,d),!0;case 6:return A.fn.call(A.context,c,l,h,d,u),!0}for(m=1,p=Array(g-1);m<g;m++)p[m-1]=arguments[m];A.fn.apply(A.context,p)}else{var f,y=A.length;for(m=0;m<y;m++)switch(A[m].once&&this.removeListener(a,A[m].fn,void 0,!0),g){case 1:A[m].fn.call(A[m].context);break;case 2:A[m].fn.call(A[m].context,c);break;case 3:A[m].fn.call(A[m].context,c,l);break;case 4:A[m].fn.call(A[m].context,c,l,h);break;default:if(!p)for(f=1,p=Array(g-1);f<g;f++)p[f-1]=arguments[f];A[m].fn.apply(A[m].context,p)}}return!0},s.prototype.on=function(a,c,l){var h=new i(c,l||this),d=o?o+a:a;return this._events[d]?this._events[d].fn?this._events[d]=[this._events[d],h]:this._events[d].push(h):(this._events[d]=h,this._eventsCount++),this},s.prototype.once=function(a,c,l){var h=new i(c,l||this,!0),d=o?o+a:a;return this._events[d]?this._events[d].fn?this._events[d]=[this._events[d],h]:this._events[d].push(h):(this._events[d]=h,this._eventsCount++),this},s.prototype.removeListener=function(a,c,l,h){var d=o?o+a:a;if(!this._events[d])return this;if(!c)return--this._eventsCount===0?this._events=new r:delete this._events[d],this;var u=this._events[d];if(u.fn)u.fn!==c||h&&!u.once||l&&u.context!==l||(--this._eventsCount===0?this._events=new r:delete this._events[d]);else{for(var _=0,p=[],m=u.length;_<m;_++)(u[_].fn!==c||h&&!u[_].once||l&&u[_].context!==l)&&p.push(u[_]);p.length?this._events[d]=p.length===1?p[0]:p:--this._eventsCount===0?this._events=new r:delete this._events[d]}return this},s.prototype.removeAllListeners=function(a){var c;return a?(c=o?o+a:a,this._events[c]&&(--this._eventsCount===0?this._events=new r:delete this._events[c])):(this._events=new r,this._eventsCount=0),this},s.prototype.off=s.prototype.removeListener,s.prototype.addListener=s.prototype.on,s.prototype.setMaxListeners=function(){return this},s.prefixed=o,s.EventEmitter=s,t!==void 0&&(t.exports=s)}}),c5r=MV({"node_modules/xml-lexer/dist/lexer.js"(e,t){function n(l,h,d){return h in l?Object.defineProperty(l,h,{value:d,enumerable:!0,configurable:!0,writable:!0}):l[h]=d,l}var o=Ksn(),r=function(){},i={data:"state-data",cdata:"state-cdata",tagBegin:"state-tag-begin",tagName:"state-tag-name",tagEnd:"state-tag-end",attributeNameStart:"state-attribute-name-start",attributeName:"state-attribute-name",attributeNameEnd:"state-attribute-name-end",attributeValueBegin:"state-attribute-value-begin",attributeValue:"state-attribute-value"},s={lt:"action-lt",gt:"action-gt",space:"action-space",equal:"action-equal",quote:"action-quote",slash:"action-slash",char:"action-char",error:"action-error"},a={text:"text",openTag:"open-tag",closeTag:"close-tag",attributeName:"attribute-name",attributeValue:"attribute-value"},c={" ":s.space,"\t":s.space,"\n":s.space,"\r":s.space,"<":s.lt,">":s.gt,'"':s.quote,"'":s.quote,"=":s.equal,"/":s.slash};t.exports={State:i,Action:s,Type:a,create:function(l){var h,d,u,_,p,m,A,g,f,y;l=Object.assign({debug:!1},l);var x=new o,C=i.data,b="",I="",v="",P="",M="",B="",T=function(D,L){if(I[0]!=="?"&&I[0]!=="!"){var H={type:D,value:L};l.debug&&console.log("emit:",H),x.emit("data",H)}};x.stateMachine=(n(y={},i.data,(n(h={},s.lt,function(){b.trim()&&T(a.text,b),I="",M=!1,C=i.tagBegin}),n(h,s.char,function(D){b+=D}),h)),n(y,i.cdata,n({},s.char,function(D){(b+=D).substr(-3)==="]]>"&&(T(a.text,b.slice(0,-3)),b="",C=i.data)})),n(y,i.tagBegin,(n(d={},s.space,r),n(d,s.char,function(D){I=D,C=i.tagName}),n(d,s.slash,function(){I="",M=!0}),d)),n(y,i.tagName,(n(u={},s.space,function(){M?C=i.tagEnd:(C=i.attributeNameStart,T(a.openTag,I))}),n(u,s.gt,function(){T(M?a.closeTag:a.openTag,I),b="",C=i.data}),n(u,s.slash,function(){C=i.tagEnd,T(a.openTag,I)}),n(u,s.char,function(D){(I+=D)==="![CDATA["&&(C=i.cdata,b="",I="")}),u)),n(y,i.tagEnd,(n(_={},s.gt,function(){T(a.closeTag,I),b="",C=i.data}),n(_,s.char,r),_)),n(y,i.attributeNameStart,(n(p={},s.char,function(D){v=D,C=i.attributeName}),n(p,s.gt,function(){b="",C=i.data}),n(p,s.space,r),n(p,s.slash,function(){M=!0,C=i.tagEnd}),p)),n(y,i.attributeName,(n(m={},s.space,function(){C=i.attributeNameEnd}),n(m,s.equal,function(){T(a.attributeName,v),C=i.attributeValueBegin}),n(m,s.gt,function(){P="",T(a.attributeName,v),T(a.attributeValue,P),b="",C=i.data}),n(m,s.slash,function(){M=!0,P="",T(a.attributeName,v),T(a.attributeValue,P),C=i.tagEnd}),n(m,s.char,function(D){v+=D}),m)),n(y,i.attributeNameEnd,(n(A={},s.space,r),n(A,s.equal,function(){T(a.attributeName,v),C=i.attributeValueBegin}),n(A,s.gt,function(){P="",T(a.attributeName,v),T(a.attributeValue,P),b="",C=i.data}),n(A,s.char,function(D){P="",T(a.attributeName,v),T(a.attributeValue,P),v=D,C=i.attributeName}),A)),n(y,i.attributeValueBegin,(n(g={},s.space,r),n(g,s.quote,function(D){B=D,P="",C=i.attributeValue}),n(g,s.gt,function(){T(a.attributeValue,P=""),b="",C=i.data}),n(g,s.char,function(D){B="",P=D,C=i.attributeValue}),g)),n(y,i.attributeValue,(n(f={},s.space,function(D){B?P+=D:(T(a.attributeValue,P),C=i.attributeNameStart)}),n(f,s.quote,function(D){B===D?(T(a.attributeValue,P),C=i.attributeNameStart):P+=D}),n(f,s.gt,function(D){B?P+=D:(T(a.attributeValue,P),b="",C=i.data)}),n(f,s.slash,function(D){B?P+=D:(T(a.attributeValue,P),M=!0,C=i.tagEnd)}),n(f,s.char,function(D){P+=D}),f)),y);var N=function(D){l.debug&&console.log(C,D);var L=x.stateMachine[C],H=L[function(V){return c[V]||s.char}(D)]||L[s.error]||L[s.char];H(D)};return x.write=function(D){for(var L=D.length,H=0;H<L;H++)N(D[H])},x}}}}),l5r=MV({"node_modules/xml-reader/dist/reader.js"(e,t){var n=Ksn(),o=c5r(),r=o.Type,i={element:"element",text:"text"},s=function(c){return Object.assign({name:"",type:i.element,value:"",parent:null,attributes:{},children:[]},c)},a=function(c){c=Object.assign({stream:!1,parentNodes:!0,doneEvent:"done",tagPrefix:"tag:",emitTopLevelOnly:!1,debug:!1},c);var l=void 0,h=void 0,d=void 0,u=void 0,_=new n,p=function(m){switch(m.type){case r.openTag:if(d===null)(d=h).name=m.value;else{var A=s({name:m.value,parent:d});d.children.push(A),d=A}break;case r.closeTag:var g=d.parent;if(c.parentNodes||(d.parent=null),d.name!==m.value)break;c.stream&&g===h&&(h.children=[],d.parent=null),c.emitTopLevelOnly&&g!==h||(_.emit(c.tagPrefix+d.name,d),_.emit("tag",d.name,d)),d===h&&(l.removeAllListeners("data"),_.emit(c.doneEvent,d),h=null),d=g;break;case r.text:d&&d.children.push(s({type:i.text,value:m.value,parent:c.parentNodes?d:null}));break;case r.attributeName:u=m.value,d.attributes[u]="";break;case r.attributeValue:d.attributes[u]=m.value}};return _.reset=function(){(l=o.create({debug:c.debug})).on("data",p),h=s(),d=null,u="",_.parse=l.write},_.reset(),_};t.exports={parseSync:function(c,l){l=Object.assign({},l,{stream:!1,tagPrefix:":"});var h=a(l),d=void 0;return h.on("done",function(u){d=u}),h.parse(c),d},create:a,NodeType:i}}}),{cos:NNs,sin:RNs,PI:QNs}=Math,{tan:kNs}=Math,h5r=(DVt(a5r()),DVt(l5r()),class{MAX_ITERATIONS=1e5;solved=!1;failed=!1;iterations=0;progress=0;error=null;activeSubSolver;failedSubSolvers;timeToSolve;stats={};_setupDone=!1;setup(){this._setupDone||(this._setup(),this._setupDone=!0)}_setup(){}step(){if(this._setupDone||this.setup(),!this.solved&&!this.failed){this.iterations++;try{this._step()}catch(e){throw this.error=`${this.constructor.name} error: ${e}`,this.failed=!0,e}!this.solved&&this.iterations>=this.MAX_ITERATIONS&&this.tryFinalAcceptance(),!this.solved&&this.iterations>=this.MAX_ITERATIONS&&(this.error=`${this.constructor.name} ran out of iterations`,this.failed=!0),"computeProgress"in this&&(this.progress=this.computeProgress())}}_step(){}getConstructorParams(){throw Error("getConstructorParams not implemented")}getOutput(){return null}solve(){let e=Date.now();for(;!this.solved&&!this.failed;)this.step();let t=Date.now();this.timeToSolve=t-e}visualize(){return{lines:[],points:[],rects:[],circles:[]}}tryFinalAcceptance(){}preview(){return{lines:[],points:[],rects:[],circles:[]}}}),KWe=(e)=>e?`hsl(${((t)=>{let n=0;for(let o=0;o<t.length;o++)n=779*t.charCodeAt(o)+((n<<5)-n);return n})(e)%360}, 100%, 50%)`:"rgba(0, 0, 0, 0.5)",d5r=(e)=>[[{x:e.minX,y:e.minY},{x:e.maxX,y:e.minY}],[{x:e.maxX,y:e.minY},{x:e.maxX,y:e.maxY}],[{x:e.maxX,y:e.maxY},{x:e.minX,y:e.maxY}],[{x:e.minX,y:e.maxY},{x:e.minX,y:e.minY}]];function NVt(e,t){let{minX:n,maxX:o,minY:r,maxY:i}=t,s=o-n,a=i-r;return Math.abs(e.y-i)<0.000001?e.x-n:Math.abs(e.x-o)<0.000001?s+(i-e.y):Math.abs(e.y-r)<0.000001?s+a+(o-e.x):Math.abs(e.x-n)<0.000001?2*s+a+(e.y-r):0}function RVt(e,t){let{minX:n,maxX:o,minY:r,maxY:i}=t,a=Math.abs(e.y-i)<0.000001,c=Math.abs(e.y-r)<0.000001,l=Math.abs(e.x-o)<0.000001,h=Math.abs(e.x-n)<0.000001;if(a&&l)return{x:-Math.SQRT1_2,y:-Math.SQRT1_2};if(a&&h)return{x:Math.SQRT1_2,y:-Math.SQRT1_2};if(c&&l)return{x:-Math.SQRT1_2,y:Math.SQRT1_2};if(c&&h)return{x:Math.SQRT1_2,y:Math.SQRT1_2};if(a)return{x:0,y:-1};if(c)return{x:0,y:1};if(l)return{x:-1,y:0};if(h)return{x:1,y:0};let d=(r+i)/2,u=(n+o)/2-e.x,_=d-e.y,p=Math.hypot(u,_);return p>0?{x:u/p,y:_/p}:{x:0,y:-1}}function f3e(e,t,n,o,r,i,s,a,c,l){for(let h=0;h<=l;h++){let d=h/l,u=1-d,_=u*u,p=_*u,m=d*d,A=m*d,g=2*h;c[g]=p*e+3*_*d*n+3*u*m*r+A*s,c[g+1]=p*t+3*_*d*o+3*u*m*i+A*a}}function u5r(e,t,n,o,r){let i=[];for(let s=0;s<=r;s++){let a=s/r,c=1-a,l=c*c,h=l*c,d=a*a,u=d*a;i.push({x:h*e.x+3*l*a*t.x+3*c*d*n.x+u*o.x,y:h*e.y+3*l*a*t.y+3*c*d*n.y+u*o.y})}return i}function y3e(e,t,n,o,r,i){let s=r-n,a=i-o,c=s*s+a*a;if(c===0){let u=e-n,_=t-o;return u*u+_*_}let l=Math.max(0,Math.min(1,((e-n)*s+(t-o)*a)/c)),h=e-(n+l*s),d=t-(o+l*a);return h*h+d*d}function x3e(e,t,n,o,r,i,s,a){let c=(s-r)*(t-i)-(a-i)*(e-r),l=(s-r)*(o-i)-(a-i)*(n-r),h=(n-e)*(i-t)-(o-t)*(r-e),d=(n-e)*(a-t)-(o-t)*(s-e);return(c>0&&l<0||c<0&&l>0)&&(h>0&&d<0||h<0&&d>0)?0:Math.min(y3e(e,t,r,i,s,a),y3e(n,o,r,i,s,a),y3e(r,i,e,t,n,o),y3e(s,a,e,t,n,o))}function p5r(e,t,n,o,r,i,s,a){let c=(s-r)*(t-i)-(a-i)*(e-r),l=(s-r)*(o-i)-(a-i)*(n-r),h=(n-e)*(i-t)-(o-t)*(r-e),d=(n-e)*(a-t)-(o-t)*(s-e);return(c>0&&l<0||c<0&&l>0)&&(h>0&&d<0||h<0&&d>0)}function m5r(e,t,n,o,r){let i=(u)=>(u%r+r)%r,s=i(e),a=i(t),c=i(n),l=i(o),[h,d]=s<a?[s,a]:[a,s];return c>h&&c<d&&l>h&&l<d}function QVt(e,t){let n=1/0,o=-1/0,r=1/0,i=-1/0;for(let s=0;s<t;s++){let a=e[2*s],c=e[2*s+1];a<n&&(n=a),a>o&&(o=a),c<r&&(r=c),c>i&&(i=c)}return{minX:n,maxX:o,minY:r,maxY:i}}var $sn=class extends h5r{constructor(e){super(),this.problem=e;for(let t of this.problem.obstacles)t.outerSegments=d5r(t);this.precomputeObstacles()}outputTraces=[];traces=[];optimizationStep=0;maxOptimizationSteps=100;sampledPoints=[];traceBounds=[];obstacleSegments=new Float64Array(0);obstacleNetworkIds=[];numObstacleSegments=0;collisionPairs=[];lastCost=1/0;stagnantSteps=0;effectiveTraceToTraceSpacing=0;getConstructorParams(){return this.problem}precomputeObstacles(){let{obstacles:e}=this.problem,t=0;for(let o of e)o.outerSegments&&(t+=o.outerSegments.length);this.obstacleSegments=new Float64Array(4*t),this.obstacleNetworkIds=[],this.numObstacleSegments=t;let n=0;for(let o of e)if(o.outerSegments)for(let r of o.outerSegments)this.obstacleSegments[n++]=r[0].x,this.obstacleSegments[n++]=r[0].y,this.obstacleSegments[n++]=r[1].x,this.obstacleSegments[n++]=r[1].y,this.obstacleNetworkIds.push(o.networkId)}initializeTraces(){let{bounds:e,waypointPairs:t}=this.problem,{minX:n,maxX:o,minY:r,maxY:i}=e,s=o-n,a=i-r,c=2*s+2*a,l=function(m){return{x:(m.minX+m.maxX)/2,y:(m.minY+m.maxY)/2}}(e),h=t.map((m,A)=>({pair:m,t1:NVt(m.start,e),t2:NVt(m.end,e),idx:A})),d=h.map(()=>[]),u=h.map(()=>[]);for(let m of h)for(let A of h)if(m.idx!==A.idx){if(m.pair.networkId&&A.pair.networkId&&m.pair.networkId===A.pair.networkId)continue;m5r(A.t1,A.t2,m.t1,m.t2,c)&&(d[m.idx].push(A.idx),u[A.idx].push(m.idx))}let _=d.map((m)=>m.length),p=Math.max(..._,1);this.traces=h.map(({pair:m,t1:A,t2:g,idx:f})=>{let y=RVt(m.start,e),x=RVt(m.end,e),C=Math.hypot(m.end.x-m.start.x,m.end.y-m.start.y),b=_[f]/p,I=(m.start.x+m.end.x)/2,v=(m.start.y+m.end.y)/2,P=C*(0.25+0.15*(1-Math.hypot(I-l.x,v-l.y)/Math.hypot(s/2,a/2)))*(1-0.3*b),M=0.05*Math.min(s,a),B=Math.max(M,P),T=Math.max(M,P);return{waypointPair:m,ctrl1:{x:m.start.x+B*y.x,y:m.start.y+B*y.y},ctrl2:{x:m.end.x+T*x.x,y:m.end.y+T*x.y},networkId:m.networkId,t1:A,t2:g,perpDir1:y,perpDir2:x,d1:B,d2:T,containedBy:d[f],contains:u[f]}}),this.sampledPoints=this.traces.map(()=>new Float64Array(12)),this.traceBounds=this.traces.map(()=>({minX:0,maxX:0,minY:0,maxY:0})),this.updateSampledTraces(),this.updateCollisionPairs()}updateSampledTraces(){for(let e=0;e<this.traces.length;e++){let t=this.traces[e];f3e(t.waypointPair.start.x,t.waypointPair.start.y,t.ctrl1.x,t.ctrl1.y,t.ctrl2.x,t.ctrl2.y,t.waypointPair.end.x,t.waypointPair.end.y,this.sampledPoints[e],5),this.traceBounds[e]=QVt(this.sampledPoints[e],6)}}updateSingleTraceSample(e){let t=this.traces[e];f3e(t.waypointPair.start.x,t.waypointPair.start.y,t.ctrl1.x,t.ctrl1.y,t.ctrl2.x,t.ctrl2.y,t.waypointPair.end.x,t.waypointPair.end.y,this.sampledPoints[e],5),this.traceBounds[e]=QVt(this.sampledPoints[e],6)}updateControlPointsFromDistances(e){let t=this.traces[e],{minX:n,maxX:o,minY:r,maxY:i}=this.problem.bounds,a=t.waypointPair.start.x+t.d1*t.perpDir1.x,c=t.waypointPair.start.y+t.d1*t.perpDir1.y,l=t.waypointPair.end.x+t.d2*t.perpDir2.x,h=t.waypointPair.end.y+t.d2*t.perpDir2.y,d=t.waypointPair.start;Math.abs(d.x-n)<0.000001&&(a=Math.max(a,n)),Math.abs(d.x-o)<0.000001&&(a=Math.min(a,o)),Math.abs(d.y-r)<0.000001&&(c=Math.max(c,r)),Math.abs(d.y-i)<0.000001&&(c=Math.min(c,i));let u=t.waypointPair.end;Math.abs(u.x-n)<0.000001&&(l=Math.max(l,n)),Math.abs(u.x-o)<0.000001&&(l=Math.min(l,o)),Math.abs(u.y-r)<0.000001&&(h=Math.max(h,r)),Math.abs(u.y-i)<0.000001&&(h=Math.min(h,i)),a=Math.max(n,Math.min(o,a)),c=Math.max(r,Math.min(i,c)),l=Math.max(n,Math.min(o,l)),h=Math.max(r,Math.min(i,h)),t.ctrl1.x=a,t.ctrl1.y=c,t.ctrl2.x=l,t.ctrl2.y=h}updateCollisionPairs(){let e=this.effectiveTraceToTraceSpacing;this.collisionPairs=[];for(let t=0;t<this.traces.length;t++)for(let n=t+1;n<this.traces.length;n++){let o=this.traces[t],r=this.traces[n];if(o.networkId&&r.networkId&&o.networkId===r.networkId)continue;let i=this.traceBounds[t],s=this.traceBounds[n];i.maxX+e>=s.minX&&s.maxX+e>=i.minX&&i.maxY+e>=s.minY&&s.maxY+e>=i.minY&&this.collisionPairs.push([t,n])}}computeTotalCost(){let{preferredObstacleToTraceSpacing:e}=this.problem,t=this.effectiveTraceToTraceSpacing,n=t**2,o=e**2,r=0;for(let[i,s]of this.collisionPairs){let a=this.sampledPoints[i],c=this.sampledPoints[s];for(let l=0;l<5;l++){let h=a[2*l],d=a[2*l+1],u=a[2*(l+1)],_=a[2*(l+1)+1];for(let p=0;p<5;p++){let m=x3e(h,d,u,_,c[2*p],c[2*p+1],c[2*(p+1)],c[2*(p+1)+1]);if(m<n)r+=(t-Math.sqrt(m))**2,m<0.000000000000000001&&(r+=20*n)}}}for(let i=0;i<this.traces.length;i++){let s=this.traces[i],a=this.sampledPoints[i],c=this.traceBounds[i];for(let l=0;l<this.numObstacleSegments;l++){if(s.networkId&&this.obstacleNetworkIds[l]&&s.networkId===this.obstacleNetworkIds[l])continue;let h=4*l,d=this.obstacleSegments[h],u=this.obstacleSegments[h+1],_=this.obstacleSegments[h+2],p=this.obstacleSegments[h+3],m=Math.min(d,_),A=Math.max(d,_),g=Math.min(u,p),f=Math.max(u,p);if(!(c.maxX+e<m||A+e<c.minX||c.maxY+e<g||f+e<c.minY))for(let y=0;y<5;y++){let x=x3e(a[2*y],a[2*y+1],a[2*(y+1)],a[2*(y+1)+1],d,u,_,p);if(x<o)r+=(e-Math.sqrt(x))**2,x<0.000000000000000001&&(r+=20*o)}}}return r}computeCostForTrace(e){let{preferredObstacleToTraceSpacing:t}=this.problem,n=this.effectiveTraceToTraceSpacing,o=n**2,r=t**2,i=this.traces[e],s=this.sampledPoints[e],a=this.traceBounds[e],c=0;for(let l=0;l<this.traces.length;l++){if(l===e)continue;let h=this.traces[l];if(i.networkId&&h.networkId&&i.networkId===h.networkId)continue;let d=this.traceBounds[l];if(a.maxX+n<d.minX||d.maxX+n<a.minX||a.maxY+n<d.minY||d.maxY+n<a.minY)continue;let u=this.sampledPoints[l];for(let _=0;_<5;_++){let p=s[2*_],m=s[2*_+1],A=s[2*(_+1)],g=s[2*(_+1)+1];for(let f=0;f<5;f++){let y=x3e(p,m,A,g,u[2*f],u[2*f+1],u[2*(f+1)],u[2*(f+1)+1]);if(y<o)c+=(n-Math.sqrt(y))**2,y<0.000000000000000001&&(c+=20*o)}}}for(let l=0;l<this.numObstacleSegments;l++){if(i.networkId&&this.obstacleNetworkIds[l]&&i.networkId===this.obstacleNetworkIds[l])continue;let h=4*l,d=this.obstacleSegments[h],u=this.obstacleSegments[h+1],_=this.obstacleSegments[h+2],p=this.obstacleSegments[h+3],m=Math.min(d,_),A=Math.max(d,_),g=Math.min(u,p),f=Math.max(u,p);if(!(a.maxX+t<m||A+t<a.minX||a.maxY+t<g||f+t<a.minY))for(let y=0;y<5;y++){let x=x3e(s[2*y],s[2*y+1],s[2*(y+1)],s[2*(y+1)+1],d,u,_,p);if(x<r)c+=(t-Math.sqrt(x))**2,x<0.000000000000000001&&(c+=20*r)}}return c}tracesIntersect(e,t){let n=this.traces[e],o=this.traces[t],i=new Float64Array(32),s=new Float64Array(32);f3e(n.waypointPair.start.x,n.waypointPair.start.y,n.ctrl1.x,n.ctrl1.y,n.ctrl2.x,n.ctrl2.y,n.waypointPair.end.x,n.waypointPair.end.y,i,15),f3e(o.waypointPair.start.x,o.waypointPair.start.y,o.ctrl1.x,o.ctrl1.y,o.ctrl2.x,o.ctrl2.y,o.waypointPair.end.x,o.waypointPair.end.y,s,15);for(let a=0;a<15;a++){let c=i[2*a],l=i[2*a+1],h=i[2*(a+1)],d=i[2*(a+1)+1];for(let u=0;u<15;u++)if(p5r(c,l,h,d,s[2*u],s[2*u+1],s[2*(u+1)],s[2*(u+1)+1]))return!0}return!1}findIntersectingPairs(){let e=[];for(let t=0;t<this.traces.length;t++)for(let n=t+1;n<this.traces.length;n++){let o=this.traces[t],r=this.traces[n];if(o.networkId&&r.networkId&&o.networkId===r.networkId)continue;let i=this.traceBounds[t],s=this.traceBounds[n];i.maxX<s.minX||s.maxX<i.minX||i.maxY<s.minY||s.maxY<i.minY||this.tracesIntersect(t,n)&&e.push([t,n])}return e}resolveIntersections(){let{bounds:e,preferredTraceToTraceSpacing:t}=this.problem,{minX:n,maxX:o,minY:r,maxY:i}=e,s=Math.min(o-n,i-r),a=0.02*s,c=1.5*s,l=this.findIntersectingPairs();if(l.length===0)return 0;let h=0;for(let[d,u]of l){let _=this.traces[d],p=this.traces[u];if(!this.tracesIntersect(d,u))continue;let m,A;if(_.containedBy.includes(u))m=u,A=d;else if(p.containedBy.includes(d))m=d,A=u;else(_.d1+_.d2)/2<(p.d1+p.d2)/2?(m=d,A=u):(m=u,A=d);let g=this.traces[m],f=this.traces[A],{d1:y,d2:x}=g,{d1:C,d2:b}=f,I=2*t,v=[{innerMult:1,outerMult:0},{innerMult:0,outerMult:1},{innerMult:0.5,outerMult:0.5},{innerMult:2,outerMult:0},{innerMult:1,outerMult:1},{innerMult:3,outerMult:0},{innerMult:2,outerMult:1},{innerMult:4,outerMult:0}],P=this.computeTotalCost(),M=null;for(let B of v)if(g.d1=y,g.d2=x,f.d1=C,f.d2=b,f.d1=Math.min(c,C+I*B.innerMult),f.d2=Math.min(c,b+I*B.innerMult),g.d1=Math.max(a,y-I*B.outerMult),g.d2=Math.max(a,x-I*B.outerMult),this.updateControlPointsFromDistances(A),this.updateControlPointsFromDistances(m),this.updateSingleTraceSample(A),this.updateSingleTraceSample(m),!this.tracesIntersect(m,A)){let T=this.computeTotalCost();(M===null||T<P)&&(P=T,M=B)}M?(f.d1=Math.min(c,C+I*M.innerMult),f.d2=Math.min(c,b+I*M.innerMult),g.d1=Math.max(a,y-I*M.outerMult),g.d2=Math.max(a,x-I*M.outerMult),this.updateControlPointsFromDistances(A),this.updateControlPointsFromDistances(m),this.updateSingleTraceSample(A),this.updateSingleTraceSample(m),h++):(g.d1=y,g.d2=x,f.d1=C,f.d2=b,this.updateControlPointsFromDistances(m),this.updateControlPointsFromDistances(A),this.updateSingleTraceSample(m),this.updateSingleTraceSample(A))}return h}optimizeStep(){let{bounds:e}=this.problem,{minX:t,maxX:n,minY:o,maxY:r}=e,i=Math.min(n-t,r-o),s=this.effectiveTraceToTraceSpacing,a=4*(1-this.optimizationStep/this.maxOptimizationSteps)+0.5,c=0.02*i,l=1.5*i,h=[];for(let d=0;d<this.traces.length;d++)h.push({idx:d,cost:this.computeCostForTrace(d)});h.sort((d,u)=>u.cost-d.cost);for(let{idx:d,cost:u}of h){if(u===0)continue;let _=this.traces[d],p=u>100?2:1,m=[a*p,1.5*a*p,0.5*a];for(let A of m){let g=u>100?[A,-A,2*A,2*-A,3*A,3*-A,2*s,2*-s]:[A,-A,2*A,2*-A],f=this.computeCostForTrace(d),{d1:y,d2:x,d1:C,d2:b}=_;for(let I of g){_.d1=Math.max(c,Math.min(l,C+I)),this.updateControlPointsFromDistances(d),this.updateSingleTraceSample(d);let v=this.computeCostForTrace(d);v<f&&(f=v,y=_.d1,x=b),_.d1=C,this.updateControlPointsFromDistances(d),_.d2=Math.max(c,Math.min(l,b+I)),this.updateControlPointsFromDistances(d),this.updateSingleTraceSample(d);let P=this.computeCostForTrace(d);P<f&&(f=P,y=C,x=_.d2),_.d2=b,this.updateControlPointsFromDistances(d),_.d1=Math.max(c,Math.min(l,C+I)),_.d2=Math.max(c,Math.min(l,b+I)),this.updateControlPointsFromDistances(d),this.updateSingleTraceSample(d);let M=this.computeCostForTrace(d);M<f&&(f=M,y=_.d1,x=_.d2),_.d1=C,_.d2=b,this.updateControlPointsFromDistances(d),_.d1=Math.max(c,Math.min(l,C+I)),_.d2=Math.max(c,Math.min(l,b-I)),this.updateControlPointsFromDistances(d),this.updateSingleTraceSample(d);let B=this.computeCostForTrace(d);B<f&&(f=B,y=_.d1,x=_.d2),_.d1=C,_.d2=b,this.updateControlPointsFromDistances(d)}if(_.d1=y,_.d2=x,this.updateControlPointsFromDistances(d),this.updateSingleTraceSample(d),f<0.9*u)break}}this.optimizationStep%10==0&&this.updateCollisionPairs()}buildOutputTraces(){this.outputTraces=this.traces.map((e)=>({waypointPair:e.waypointPair,points:u5r(e.waypointPair.start,e.ctrl1,e.ctrl2,e.waypointPair.end,20),networkId:e.networkId}))}_step(){if(this.traces.length===0&&(this.effectiveTraceToTraceSpacing=3*this.problem.preferredTraceToTraceSpacing,this.initializeTraces(),this.lastCost=this.computeTotalCost(),this.stagnantSteps=0),this.optimizationStep<this.maxOptimizationSteps){let t=3+-2*(this.optimizationStep/this.maxOptimizationSteps);if(this.effectiveTraceToTraceSpacing=this.problem.preferredTraceToTraceSpacing*t,this.optimizeStep(),this.optimizationStep++,this.optimizationStep%10==0)this.resolveIntersections()>0&&this.updateCollisionPairs();let n=this.computeTotalCost();if(n===0)this.optimizationStep=this.maxOptimizationSteps;else if(n>=0.99*this.lastCost){if(this.stagnantSteps++,this.stagnantSteps>10)this.resolveIntersections()>0?(this.updateCollisionPairs(),this.stagnantSteps=0):this.stagnantSteps>15&&(this.optimizationStep=this.maxOptimizationSteps)}else this.stagnantSteps=0;this.lastCost=n}this.optimizationStep>=this.maxOptimizationSteps&&(this.resolveIntersections(),this.buildOutputTraces(),this.solved=!0)}visualize(){return this.traces.length>0&&this.buildOutputTraces(),((e,t=[])=>{let n={arrows:[],circles:[],lines:[],rects:[],coordinateSystem:"cartesian",points:[],texts:[],title:"Curvy Trace Problem"};n.lines.push({points:[{x:e.bounds.minX,y:e.bounds.minY},{x:e.bounds.maxX,y:e.bounds.minY},{x:e.bounds.maxX,y:e.bounds.maxY},{x:e.bounds.minX,y:e.bounds.maxY},{x:e.bounds.minX,y:e.bounds.minY}],strokeColor:"rgba(0, 0, 0, 0.1)"});for(let o of e.waypointPairs)n.points.push({...o.start,label:`start ${o.networkId??""}`,color:KWe(o.networkId)}),n.points.push({...o.end,label:`end ${o.networkId??""}`,color:KWe(o.networkId)});for(let o of e.obstacles)n.rects.push({center:o.center,width:o.maxX-o.minX,height:o.maxY-o.minY,fill:"rgba(128, 128, 128, 0.3)",stroke:"rgba(128, 128, 128, 0.8)",label:`netId: ${o.networkId}`});for(let o of t)n.lines.push({points:o.points,strokeColor:KWe(o.networkId)});return n})(this.problem,this.outputTraces)}},kVt=class extends Kr{getSolverName(){return"CurvyIntraNodeSolver"}nodeWithPortPoints;colorMap;traceWidth;viaDiameter;adjacentObstacles;routes=[];curvyTraceSolver;phase="initializing";constructor(e){super(),this.nodeWithPortPoints=e.nodeWithPortPoints,this.colorMap=e.colorMap??{},this.traceWidth=e.traceWidth??0.15,this.viaDiameter=e.viaDiameter??0.3,this.adjacentObstacles=e.adjacentObstacles??[],this.MAX_ITERATIONS=1000}_step(){switch(this.phase){case"initializing":this._initializeCurvySolver();break;case"solving":this._stepCurvySolver();break;case"done":this.solved=!0}}_initializeCurvySolver(){let e=this.nodeWithPortPoints,t={minX:e.center.x-e.width/2,minY:e.center.y-e.height/2,maxX:e.center.x+e.width/2,maxY:e.center.y+e.height/2},n=new Map;for(let i of e.portPoints)n.has(i.connectionName)||n.set(i.connectionName,[]),n.get(i.connectionName).push(i);let o=[];for(let[i,s]of n){if(s.length<2)continue;let a=s[0],c=s[s.length-1];o.push({start:{x:a.x,y:a.y},end:{x:c.x,y:c.y},networkId:i})}if(o.length===0)return void(this.phase="done");let r={bounds:t,waypointPairs:o,obstacles:this.adjacentObstacles.map((i)=>({minX:i.minX,minY:i.minY,maxX:i.maxX,maxY:i.maxY,center:{x:(i.minX+i.maxX)/2,y:(i.minY+i.maxY)/2},networkId:i.networkId})),preferredTraceToTraceSpacing:2*this.traceWidth,preferredObstacleToTraceSpacing:2*this.traceWidth};this.curvyTraceSolver=new $sn(r),this.phase="solving"}_stepCurvySolver(){this.curvyTraceSolver?(this.activeSubSolver=this.curvyTraceSolver,this.curvyTraceSolver.step(),this.curvyTraceSolver.solved?(this._convertOutputTraces(),this.phase="done"):this.curvyTraceSolver.failed&&(this.error=this.curvyTraceSolver.error,this.failed=!0)):this.phase="done"}_convertOutputTraces(){if(!this.curvyTraceSolver)return;let e=this.nodeWithPortPoints,t=new Map;for(let n of e.portPoints){let o=n.connectionName;t.has(o)||t.set(o,{connectionName:n.connectionName,rootConnectionName:n.rootConnectionName,z:n.z})}for(let n of this.curvyTraceSolver.outputTraces){let o=n.networkId??"",r=t.get(o);if(!r)continue;let i={connectionName:r.connectionName,rootConnectionName:r.rootConnectionName,traceThickness:this.traceWidth,viaDiameter:this.viaDiameter,route:n.points.map((s)=>({x:s.x,y:s.y,z:r.z})),vias:[]};this.routes.push(i)}}getConstructorParams(){return{nodeWithPortPoints:this.nodeWithPortPoints,colorMap:this.colorMap,traceWidth:this.traceWidth,viaDiameter:this.viaDiameter,adjacentObstacles:this.adjacentObstacles}}visualize(){let e={lines:[],points:[],rects:[],circles:[]},t=this.nodeWithPortPoints;e.rects.push({center:t.center,width:t.width,height:t.height,fill:"rgba(0, 200, 0, 0.1)",stroke:"rgba(0, 200, 0, 0.5)",label:t.capacityMeshNodeId});for(let n of this.adjacentObstacles)e.rects.push({center:{x:(n.minX+n.maxX)/2,y:(n.minY+n.maxY)/2},width:n.maxX-n.minX,height:n.maxY-n.minY,fill:"rgba(255, 0, 0, 0.1)",stroke:"rgba(255, 0, 0, 0.3)",label:`obstacle: ${n.networkId??""}`});if(this.curvyTraceSolver){let n=this.curvyTraceSolver.visualize();n.lines&&e.lines.push(...n.lines),n.points&&e.points.push(...n.points),n.rects&&e.rects.push(...n.rects),n.circles&&e.circles.push(...n.circles)}for(let n of this.routes){let o=this.colorMap[n.connectionName]??"gray";e.lines.push({points:n.route.map((r)=>({x:r.x,y:r.y})),strokeColor:o,strokeWidth:this.traceWidth,label:n.connectionName})}for(let n of t.portPoints){let o=this.colorMap[n.connectionName]??"gray";e.points.push({x:n.x,y:n.y,color:o,label:n.connectionName})}return e}},{create:_5r,defineProperty:LVt,getOwnPropertyDescriptor:g5r,getOwnPropertyNames:qsn,getPrototypeOf:A5r}=Object,f5r=Object.prototype.hasOwnProperty,G4=(e,t)=>function(){return t||(0,e[qsn(e)[0]])((t={exports:{}}).exports,t),t.exports},m6e=G4({"node_modules/binary-search-bounds/search-bounds.js"(e,t){function n(c,l,h,d,u){for(var _=u+1;d<=u;){var p=d+u>>>1,m=c[p];(h!==void 0?h(m,l):m-l)>=0?(_=p,u=p-1):d=p+1}return _}function o(c,l,h,d,u){for(var _=u+1;d<=u;){var p=d+u>>>1,m=c[p];(h!==void 0?h(m,l):m-l)>0?(_=p,u=p-1):d=p+1}return _}function r(c,l,h,d,u){for(var _=d-1;d<=u;){var p=d+u>>>1,m=c[p];(h!==void 0?h(m,l):m-l)<0?(_=p,d=p+1):u=p-1}return _}function i(c,l,h,d,u){for(var _=d-1;d<=u;){var p=d+u>>>1,m=c[p];(h!==void 0?h(m,l):m-l)<=0?(_=p,d=p+1):u=p-1}return _}function s(c,l,h,d,u){for(;d<=u;){var _=d+u>>>1,p=c[_],m=h!==void 0?h(p,l):p-l;if(m===0)return _;m<=0?d=_+1:u=_-1}return-1}function a(c,l,h,d,u,_){return typeof h=="function"?_(c,l,h,d===void 0?0:0|d,u===void 0?c.length-1:0|u):_(c,l,void 0,h===void 0?0:0|h,d===void 0?c.length-1:0|d)}t.exports={ge:function(c,l,h,d,u){return a(c,l,h,d,u,n)},gt:function(c,l,h,d,u){return a(c,l,h,d,u,o)},lt:function(c,l,h,d,u){return a(c,l,h,d,u,r)},le:function(c,l,h,d,u){return a(c,l,h,d,u,i)},eq:function(c,l,h,d,u){return a(c,l,h,d,u,s)}}}}),$Je=G4({"node_modules/two-product/two-product.js"(e,t){t.exports=function(o,r,i){var s=o*r,a=n*o,c=a-(a-o),l=o-c,h=n*r,d=h-(h-r),u=r-d,_=l*u-(s-c*d-l*d-c*u);if(i)return i[0]=_,i[1]=s,i;return[_,s]};var n=+(Math.pow(2,27)+1)}}),Jsn=G4({"node_modules/robust-sum/robust-sum.js"(e,t){t.exports=function(n,o){var r=0|n.length,i=0|o.length;if(r===1&&i===1)return function(v,P){var M=v+P,B=M-v,T=M-B,N=P-B,D=v-T,L=D+N;if(L)return[L,M];return[M]}(n[0],o[0]);var s,a,c=Array(r+i),l=0,h=0,d=0,u=Math.abs,_=n[h],p=u(_),m=o[d],A=u(m);p<A?(a=_,(h+=1)<r&&(p=u(_=n[h]))):(a=m,(d+=1)<i&&(A=u(m=o[d]))),h<r&&p<A||d>=i?(s=_,(h+=1)<r&&(p=u(_=n[h]))):(s=m,(d+=1)<i&&(A=u(m=o[d])));var g,f,y=s+a,x=y-s,C=a-x,b=C,I=y;for(;h<r&&d<i;)p<A?(s=_,(h+=1)<r&&(p=u(_=n[h]))):(s=m,(d+=1)<i&&(A=u(m=o[d]))),(C=(a=b)-(x=(y=s+a)-s))&&(c[l++]=C),b=I-((g=I+y)-(f=g-I))+(y-f),I=g;for(;h<r;)(C=(a=b)-(x=(y=(s=_)+a)-s))&&(c[l++]=C),b=I-((g=I+y)-(f=g-I))+(y-f),I=g,(h+=1)<r&&(_=n[h]);for(;d<i;)(C=(a=b)-(x=(y=(s=m)+a)-s))&&(c[l++]=C),b=I-((g=I+y)-(f=g-I))+(y-f),I=g,(d+=1)<i&&(m=o[d]);return b&&(c[l++]=b),I&&(c[l++]=I),l||(c[l++]=0),c.length=l,c}}}),y5r=G4({"node_modules/two-sum/two-sum.js"(e,t){t.exports=function(n,o,r){var i=n+o,s=i-n,a=o-s,c=n-(i-s);if(r)return r[0]=c+a,r[1]=i,r;return[c+a,i]}}}),Zsn=G4({"node_modules/robust-scale/robust-scale.js"(e,t){var n=$Je(),o=y5r();t.exports=function(r,i){var s=r.length;if(s===1){var a=n(r[0],i);return a[0]?a:[a[1]]}var c=Array(2*s),l=[0.1,0.1],h=[0.1,0.1],d=0;n(r[0],i,l),l[0]&&(c[d++]=l[0]);for(var u=1;u<s;++u){n(r[u],i,h);var _=l[1];o(_,h[0],l),l[0]&&(c[d++]=l[0]);var p=h[1],m=l[1],A=p+m,g=m-(A-p);l[1]=A,g&&(c[d++]=g)}return l[1]&&(c[d++]=l[1]),d===0&&(c[d++]=0),c.length=d,c}}}),ean=G4({"node_modules/robust-subtract/robust-diff.js"(e,t){t.exports=function(n,o){var r=0|n.length,i=0|o.length;if(r===1&&i===1)return function(v,P){var M=v+P,B=M-v,T=M-B,N=P-B,D=v-T,L=D+N;if(L)return[L,M];return[M]}(n[0],-o[0]);var s,a,c=Array(r+i),l=0,h=0,d=0,u=Math.abs,_=n[h],p=u(_),m=-o[d],A=u(m);p<A?(a=_,(h+=1)<r&&(p=u(_=n[h]))):(a=m,(d+=1)<i&&(A=u(m=-o[d]))),h<r&&p<A||d>=i?(s=_,(h+=1)<r&&(p=u(_=n[h]))):(s=m,(d+=1)<i&&(A=u(m=-o[d])));var g,f,y=s+a,x=y-s,C=a-x,b=C,I=y;for(;h<r&&d<i;)p<A?(s=_,(h+=1)<r&&(p=u(_=n[h]))):(s=m,(d+=1)<i&&(A=u(m=-o[d]))),(C=(a=b)-(x=(y=s+a)-s))&&(c[l++]=C),b=I-((g=I+y)-(f=g-I))+(y-f),I=g;for(;h<r;)(C=(a=b)-(x=(y=(s=_)+a)-s))&&(c[l++]=C),b=I-((g=I+y)-(f=g-I))+(y-f),I=g,(h+=1)<r&&(_=n[h]);for(;d<i;)(C=(a=b)-(x=(y=(s=m)+a)-s))&&(c[l++]=C),b=I-((g=I+y)-(f=g-I))+(y-f),I=g,(d+=1)<i&&(m=-o[d]);return b&&(c[l++]=b),I&&(c[l++]=I),l||(c[l++]=0),c.length=l,c}}}),x5r=G4({"node_modules/robust-orientation/orientation.js"(e,t){var n=$Je(),o=Jsn(),r=Zsn(),i=ean();function s(m,A,g,f){return function(y,x,C){var b=m(m(A(x[1],C[0]),A(-C[1],x[0])),m(A(y[1],x[0]),A(-x[1],y[0]))),I=m(A(y[1],C[0]),A(-C[1],y[0])),v=f(b,I);return v[v.length-1]}}function a(m,A,g,f){return function(y,x,C,b){var I=m(m(g(m(A(C[1],b[0]),A(-b[1],C[0])),x[2]),m(g(m(A(x[1],b[0]),A(-b[1],x[0])),-C[2]),g(m(A(x[1],C[0]),A(-C[1],x[0])),b[2]))),m(g(m(A(x[1],b[0]),A(-b[1],x[0])),y[2]),m(g(m(A(y[1],b[0]),A(-b[1],y[0])),-x[2]),g(m(A(y[1],x[0]),A(-x[1],y[0])),b[2])))),v=m(m(g(m(A(C[1],b[0]),A(-b[1],C[0])),y[2]),m(g(m(A(y[1],b[0]),A(-b[1],y[0])),-C[2]),g(m(A(y[1],C[0]),A(-C[1],y[0])),b[2]))),m(g(m(A(x[1],C[0]),A(-C[1],x[0])),y[2]),m(g(m(A(y[1],C[0]),A(-C[1],y[0])),-x[2]),g(m(A(y[1],x[0]),A(-x[1],y[0])),C[2])))),P=f(I,v);return P[P.length-1]}}function c(m,A,g,f){return function(y,x,C,b,I){var v=m(m(m(g(m(g(m(A(b[1],I[0]),A(-I[1],b[0])),C[2]),m(g(m(A(C[1],I[0]),A(-I[1],C[0])),-b[2]),g(m(A(C[1],b[0]),A(-b[1],C[0])),I[2]))),x[3]),m(g(m(g(m(A(b[1],I[0]),A(-I[1],b[0])),x[2]),m(g(m(A(x[1],I[0]),A(-I[1],x[0])),-b[2]),g(m(A(x[1],b[0]),A(-b[1],x[0])),I[2]))),-C[3]),g(m(g(m(A(C[1],I[0]),A(-I[1],C[0])),x[2]),m(g(m(A(x[1],I[0]),A(-I[1],x[0])),-C[2]),g(m(A(x[1],C[0]),A(-C[1],x[0])),I[2]))),b[3]))),m(g(m(g(m(A(C[1],b[0]),A(-b[1],C[0])),x[2]),m(g(m(A(x[1],b[0]),A(-b[1],x[0])),-C[2]),g(m(A(x[1],C[0]),A(-C[1],x[0])),b[2]))),-I[3]),m(g(m(g(m(A(b[1],I[0]),A(-I[1],b[0])),x[2]),m(g(m(A(x[1],I[0]),A(-I[1],x[0])),-b[2]),g(m(A(x[1],b[0]),A(-b[1],x[0])),I[2]))),y[3]),g(m(g(m(A(b[1],I[0]),A(-I[1],b[0])),y[2]),m(g(m(A(y[1],I[0]),A(-I[1],y[0])),-b[2]),g(m(A(y[1],b[0]),A(-b[1],y[0])),I[2]))),-x[3])))),m(m(g(m(g(m(A(x[1],I[0]),A(-I[1],x[0])),y[2]),m(g(m(A(y[1],I[0]),A(-I[1],y[0])),-x[2]),g(m(A(y[1],x[0]),A(-x[1],y[0])),I[2]))),b[3]),m(g(m(g(m(A(x[1],b[0]),A(-b[1],x[0])),y[2]),m(g(m(A(y[1],b[0]),A(-b[1],y[0])),-x[2]),g(m(A(y[1],x[0]),A(-x[1],y[0])),b[2]))),-I[3]),g(m(g(m(A(C[1],b[0]),A(-b[1],C[0])),x[2]),m(g(m(A(x[1],b[0]),A(-b[1],x[0])),-C[2]),g(m(A(x[1],C[0]),A(-C[1],x[0])),b[2]))),y[3]))),m(g(m(g(m(A(C[1],b[0]),A(-b[1],C[0])),y[2]),m(g(m(A(y[1],b[0]),A(-b[1],y[0])),-C[2]),g(m(A(y[1],C[0]),A(-C[1],y[0])),b[2]))),-x[3]),m(g(m(g(m(A(x[1],b[0]),A(-b[1],x[0])),y[2]),m(g(m(A(y[1],b[0]),A(-b[1],y[0])),-x[2]),g(m(A(y[1],x[0]),A(-x[1],y[0])),b[2]))),C[3]),g(m(g(m(A(x[1],C[0]),A(-C[1],x[0])),y[2]),m(g(m(A(y[1],C[0]),A(-C[1],y[0])),-x[2]),g(m(A(y[1],x[0]),A(-x[1],y[0])),C[2]))),-b[3]))))),P=m(m(m(g(m(g(m(A(b[1],I[0]),A(-I[1],b[0])),C[2]),m(g(m(A(C[1],I[0]),A(-I[1],C[0])),-b[2]),g(m(A(C[1],b[0]),A(-b[1],C[0])),I[2]))),y[3]),g(m(g(m(A(b[1],I[0]),A(-I[1],b[0])),y[2]),m(g(m(A(y[1],I[0]),A(-I[1],y[0])),-b[2]),g(m(A(y[1],b[0]),A(-b[1],y[0])),I[2]))),-C[3])),m(g(m(g(m(A(C[1],I[0]),A(-I[1],C[0])),y[2]),m(g(m(A(y[1],I[0]),A(-I[1],y[0])),-C[2]),g(m(A(y[1],C[0]),A(-C[1],y[0])),I[2]))),b[3]),g(m(g(m(A(C[1],b[0]),A(-b[1],C[0])),y[2]),m(g(m(A(y[1],b[0]),A(-b[1],y[0])),-C[2]),g(m(A(y[1],C[0]),A(-C[1],y[0])),b[2]))),-I[3]))),m(m(g(m(g(m(A(C[1],I[0]),A(-I[1],C[0])),x[2]),m(g(m(A(x[1],I[0]),A(-I[1],x[0])),-C[2]),g(m(A(x[1],C[0]),A(-C[1],x[0])),I[2]))),y[3]),g(m(g(m(A(C[1],I[0]),A(-I[1],C[0])),y[2]),m(g(m(A(y[1],I[0]),A(-I[1],y[0])),-C[2]),g(m(A(y[1],C[0]),A(-C[1],y[0])),I[2]))),-x[3])),m(g(m(g(m(A(x[1],I[0]),A(-I[1],x[0])),y[2]),m(g(m(A(y[1],I[0]),A(-I[1],y[0])),-x[2]),g(m(A(y[1],x[0]),A(-x[1],y[0])),I[2]))),C[3]),g(m(g(m(A(x[1],C[0]),A(-C[1],x[0])),y[2]),m(g(m(A(y[1],C[0]),A(-C[1],y[0])),-x[2]),g(m(A(y[1],x[0]),A(-x[1],y[0])),C[2]))),-I[3])))),M=f(v,P);return M[M.length-1]}}function l(m){return(m===3?s:m===4?a:c)(o,n,r,i)}var h=l(3),d=l(4),u=[function(){return 0},function(){return 0},function(m,A){return A[0]-m[0]},function(m,A,g){var f,y=(m[1]-g[1])*(A[0]-g[0]),x=(m[0]-g[0])*(A[1]-g[1]),C=y-x;if(y>0){if(x<=0)return C;f=y+x}else{if(!(y<0))return C;if(x>=0)return C;f=-(y+x)}var b=0.00000000000000033306690738754716*f;return C>=b||C<=-b?C:h(m,A,g)},function(m,A,g,f){var y=m[0]-f[0],x=A[0]-f[0],C=g[0]-f[0],b=m[1]-f[1],I=A[1]-f[1],v=g[1]-f[1],P=m[2]-f[2],M=A[2]-f[2],B=g[2]-f[2],T=x*v,N=C*I,D=C*b,L=y*v,H=y*I,V=x*b,O=P*(T-N)+M*(D-L)+B*(H-V),U=0.0000000000000007771561172376103*((Math.abs(T)+Math.abs(N))*Math.abs(P)+(Math.abs(D)+Math.abs(L))*Math.abs(M)+(Math.abs(H)+Math.abs(V))*Math.abs(B));return O>U||-O>U?O:d(m,A,g,f)}];function _(m){var A=u[m.length];return A||(A=u[m.length]=l(m.length)),A.apply(void 0,m)}function p(m,A,g,f,y,x,C){return function(b,I,v,P,M){switch(arguments.length){case 0:case 1:return 0;case 2:return f(b,I);case 3:return y(b,I,v);case 4:return x(b,I,v,P);case 5:return C(b,I,v,P,M)}for(var B=Array(arguments.length),T=0;T<arguments.length;++T)B[T]=arguments[T];return m(B)}}(function(){for(;u.length<=5;)u.push(l(u.length));t.exports=p.apply(void 0,[_].concat(u));for(var m=0;m<=5;++m)t.exports[m]=u[m]})()}}),C5r=G4({"node_modules/cdt2d/lib/monotone.js"(e,t){var n=m6e(),o=x5r()[3];function r(u,_,p,m,A){this.a=u,this.b=_,this.idx=p,this.lowerIds=m,this.upperIds=A}function i(u,_,p,m){this.a=u,this.b=_,this.type=p,this.idx=m}function s(u,_){var p=u.a[0]-_.a[0]||u.a[1]-_.a[1]||u.type-_.type;return p||(u.type!==0&&(p=o(u.a,u.b,_.b))?p:u.idx-_.idx)}function a(u,_){return o(u.a,u.b,_)}function c(u,_,p,m,A){for(var g=n.lt(_,m,a),f=n.gt(_,m,a),y=g;y<f;++y){for(var x=_[y],C=x.lowerIds,b=C.length;b>1&&o(p[C[b-2]],p[C[b-1]],m)>0;)u.push([C[b-1],C[b-2],A]),b-=1;C.length=b,C.push(A);var I=x.upperIds;for(b=I.length;b>1&&o(p[I[b-2]],p[I[b-1]],m)<0;)u.push([I[b-2],I[b-1],A]),b-=1;I.length=b,I.push(A)}}function l(u,_){var p;return(p=u.a[0]<_.a[0]?o(u.a,u.b,_.a):o(_.b,_.a,u.a))?p:(p=_.b[0]<u.b[0]?o(u.a,u.b,_.b):o(_.b,_.a,u.b))||u.idx-_.idx}function h(u,_,p){var m=n.le(u,p,l),A=u[m],g=A.upperIds,f=g[g.length-1];A.upperIds=[f],u.splice(m+1,0,new r(p.a,p.b,p.idx,[f],g))}function d(u,_,p){var m=p.a;p.a=p.b,p.b=m;var A=n.eq(u,p,l),g=u[A];u[A-1].upperIds=g.upperIds,u.splice(A,1)}t.exports=function(u,_){for(var p=u.length,m=_.length,A=[],g=0;g<p;++g)A.push(new i(u[g],null,0,g));for(g=0;g<m;++g){var f=_[g],y=u[f[0]],x=u[f[1]];y[0]<x[0]?A.push(new i(y,x,2,g),new i(x,y,1,g)):y[0]>x[0]&&A.push(new i(x,y,2,g),new i(y,x,1,g))}A.sort(s);for(var C=A[0].a[0]-(1+Math.abs(A[0].a[0]))*Math.pow(2,-52),b=[new r([C,1],[C,0],-1,[],[],[],[])],I=[],v=(g=0,A.length);g<v;++g){var P=A[g],M=P.type;M===0?c(I,b,u,P.a,P.idx):M===2?h(b,u,P):d(b,u,P)}return I}}}),b5r=G4({"node_modules/cdt2d/lib/triangulation.js"(e,t){var n=m6e();function o(s,a){this.stars=s,this.edges=a}t.exports=function(s,a){for(var c=Array(s),l=0;l<s;++l)c[l]=[];return new o(c,a)};var r=o.prototype;function i(s,a,c){for(var l=1,h=s.length;l<h;l+=2)if(s[l-1]===a&&s[l]===c)return s[l-1]=s[h-2],s[l]=s[h-1],void(s.length=h-2)}r.isConstraint=function(){var s=[0,0];function a(c,l){return c[0]-l[0]||c[1]-l[1]}return function(c,l){return s[0]=Math.min(c,l),s[1]=Math.max(c,l),n.eq(this.edges,s,a)>=0}}(),r.removeTriangle=function(s,a,c){var l=this.stars;i(l[s],a,c),i(l[a],c,s),i(l[c],s,a)},r.addTriangle=function(s,a,c){var l=this.stars;l[s].push(a,c),l[a].push(c,s),l[c].push(s,a)},r.opposite=function(s,a){for(var c=this.stars[a],l=1,h=c.length;l<h;l+=2)if(c[l]===s)return c[l-1];return-1},r.flip=function(s,a){var c=this.opposite(s,a),l=this.opposite(a,s);this.removeTriangle(s,a,c),this.removeTriangle(a,s,l),this.addTriangle(s,l,c),this.addTriangle(a,c,l)},r.edges=function(){for(var s=this.stars,a=[],c=0,l=s.length;c<l;++c)for(var h=s[c],d=0,u=h.length;d<u;d+=2)a.push([h[d],h[d+1]]);return a},r.cells=function(){for(var s=this.stars,a=[],c=0,l=s.length;c<l;++c)for(var h=s[c],d=0,u=h.length;d<u;d+=2){var _=h[d],p=h[d+1];c<Math.min(_,p)&&a.push([c,_,p])}return a}}}),I5r=G4({"node_modules/robust-in-sphere/in-sphere.js"(e,t){var n=$Je(),o=Jsn(),r=ean(),i=Zsn();function s(p){return(p===3?a:p===4?c:p===5?l:h)(o,r,n,i)}function a(p,m,A,g){return function(f,y,x){var C=A(f[0],f[0]),b=g(C,y[0]),I=g(C,x[0]),v=A(y[0],y[0]),P=g(v,f[0]),M=g(v,x[0]),B=A(x[0],x[0]),T=g(B,f[0]),N=g(B,y[0]),D=p(m(N,M),m(P,b)),L=m(T,I),H=m(D,L);return H[H.length-1]}}function c(p,m,A,g){return function(f,y,x,C){var b=p(A(f[0],f[0]),A(f[1],f[1])),I=g(b,y[0]),v=g(b,x[0]),P=g(b,C[0]),M=p(A(y[0],y[0]),A(y[1],y[1])),B=g(M,f[0]),T=g(M,x[0]),N=g(M,C[0]),D=p(A(x[0],x[0]),A(x[1],x[1])),L=g(D,f[0]),H=g(D,y[0]),V=g(D,C[0]),O=p(A(C[0],C[0]),A(C[1],C[1])),U=g(O,f[0]),j=g(O,y[0]),Y=g(O,x[0]),X=p(p(g(m(Y,V),y[1]),p(g(m(j,N),-x[1]),g(m(H,T),C[1]))),p(g(m(j,N),f[1]),p(g(m(U,P),-y[1]),g(m(B,I),C[1])))),K=p(p(g(m(Y,V),f[1]),p(g(m(U,P),-x[1]),g(m(L,v),C[1]))),p(g(m(H,T),f[1]),p(g(m(L,v),-y[1]),g(m(B,I),x[1])))),J=m(X,K);return J[J.length-1]}}function l(p,m,A,g){return function(f,y,x,C,b){var I=p(A(f[0],f[0]),p(A(f[1],f[1]),A(f[2],f[2]))),v=g(I,y[0]),P=g(I,x[0]),M=g(I,C[0]),B=g(I,b[0]),T=p(A(y[0],y[0]),p(A(y[1],y[1]),A(y[2],y[2]))),N=g(T,f[0]),D=g(T,x[0]),L=g(T,C[0]),H=g(T,b[0]),V=p(A(x[0],x[0]),p(A(x[1],x[1]),A(x[2],x[2]))),O=g(V,f[0]),U=g(V,y[0]),j=g(V,C[0]),Y=g(V,b[0]),X=p(A(C[0],C[0]),p(A(C[1],C[1]),A(C[2],C[2]))),K=g(X,f[0]),J=g(X,y[0]),ee=g(X,x[0]),se=g(X,b[0]),ne=p(A(b[0],b[0]),p(A(b[1],b[1]),A(b[2],b[2]))),re=g(ne,f[0]),Z=g(ne,y[0]),te=g(ne,x[0]),ie=g(ne,C[0]),ce=p(p(p(g(p(g(m(ie,se),x[1]),p(g(m(te,Y),-C[1]),g(m(ee,j),b[1]))),y[2]),p(g(p(g(m(ie,se),y[1]),p(g(m(Z,H),-C[1]),g(m(J,L),b[1]))),-x[2]),g(p(g(m(te,Y),y[1]),p(g(m(Z,H),-x[1]),g(m(U,D),b[1]))),C[2]))),p(g(p(g(m(ee,j),y[1]),p(g(m(J,L),-x[1]),g(m(U,D),C[1]))),-b[2]),p(g(p(g(m(ie,se),y[1]),p(g(m(Z,H),-C[1]),g(m(J,L),b[1]))),f[2]),g(p(g(m(ie,se),f[1]),p(g(m(re,B),-C[1]),g(m(K,M),b[1]))),-y[2])))),p(p(g(p(g(m(Z,H),f[1]),p(g(m(re,B),-y[1]),g(m(N,v),b[1]))),C[2]),p(g(p(g(m(J,L),f[1]),p(g(m(K,M),-y[1]),g(m(N,v),C[1]))),-b[2]),g(p(g(m(ee,j),y[1]),p(g(m(J,L),-x[1]),g(m(U,D),C[1]))),f[2]))),p(g(p(g(m(ee,j),f[1]),p(g(m(K,M),-x[1]),g(m(O,P),C[1]))),-y[2]),p(g(p(g(m(J,L),f[1]),p(g(m(K,M),-y[1]),g(m(N,v),C[1]))),x[2]),g(p(g(m(U,D),f[1]),p(g(m(O,P),-y[1]),g(m(N,v),x[1]))),-C[2]))))),ue=p(p(p(g(p(g(m(ie,se),x[1]),p(g(m(te,Y),-C[1]),g(m(ee,j),b[1]))),f[2]),g(p(g(m(ie,se),f[1]),p(g(m(re,B),-C[1]),g(m(K,M),b[1]))),-x[2])),p(g(p(g(m(te,Y),f[1]),p(g(m(re,B),-x[1]),g(m(O,P),b[1]))),C[2]),g(p(g(m(ee,j),f[1]),p(g(m(K,M),-x[1]),g(m(O,P),C[1]))),-b[2]))),p(p(g(p(g(m(te,Y),y[1]),p(g(m(Z,H),-x[1]),g(m(U,D),b[1]))),f[2]),g(p(g(m(te,Y),f[1]),p(g(m(re,B),-x[1]),g(m(O,P),b[1]))),-y[2])),p(g(p(g(m(Z,H),f[1]),p(g(m(re,B),-y[1]),g(m(N,v),b[1]))),x[2]),g(p(g(m(U,D),f[1]),p(g(m(O,P),-y[1]),g(m(N,v),x[1]))),-b[2])))),de=m(ce,ue);return de[de.length-1]}}function h(p,m,A,g){return function(f,y,x,C,b,I){var v=p(p(A(f[0],f[0]),A(f[1],f[1])),p(A(f[2],f[2]),A(f[3],f[3]))),P=g(v,y[0]),M=g(v,x[0]),B=g(v,C[0]),T=g(v,b[0]),N=g(v,I[0]),D=p(p(A(y[0],y[0]),A(y[1],y[1])),p(A(y[2],y[2]),A(y[3],y[3]))),L=g(D,f[0]),H=g(D,x[0]),V=g(D,C[0]),O=g(D,b[0]),U=g(D,I[0]),j=p(p(A(x[0],x[0]),A(x[1],x[1])),p(A(x[2],x[2]),A(x[3],x[3]))),Y=g(j,f[0]),X=g(j,y[0]),K=g(j,C[0]),J=g(j,b[0]),ee=g(j,I[0]),se=p(p(A(C[0],C[0]),A(C[1],C[1])),p(A(C[2],C[2]),A(C[3],C[3]))),ne=g(se,f[0]),re=g(se,y[0]),Z=g(se,x[0]),te=g(se,b[0]),ie=g(se,I[0]),ce=p(p(A(b[0],b[0]),A(b[1],b[1])),p(A(b[2],b[2]),A(b[3],b[3]))),ue=g(ce,f[0]),de=g(ce,y[0]),me=g(ce,x[0]),ge=g(ce,C[0]),xe=g(ce,I[0]),Ee=p(p(A(I[0],I[0]),A(I[1],I[1])),p(A(I[2],I[2]),A(I[3],I[3]))),Re=g(Ee,f[0]),Me=g(Ee,y[0]),_e=g(Ee,x[0]),ye=g(Ee,C[0]),Se=g(Ee,b[0]),Ne=p(p(p(g(p(p(g(p(g(m(Se,xe),C[1]),p(g(m(ye,ie),-b[1]),g(m(ge,te),I[1]))),x[2]),g(p(g(m(Se,xe),x[1]),p(g(m(_e,ee),-b[1]),g(m(me,J),I[1]))),-C[2])),p(g(p(g(m(ye,ie),x[1]),p(g(m(_e,ee),-C[1]),g(m(Z,K),I[1]))),b[2]),g(p(g(m(ge,te),x[1]),p(g(m(me,J),-C[1]),g(m(Z,K),b[1]))),-I[2]))),y[3]),p(g(p(p(g(p(g(m(Se,xe),C[1]),p(g(m(ye,ie),-b[1]),g(m(ge,te),I[1]))),y[2]),g(p(g(m(Se,xe),y[1]),p(g(m(Me,U),-b[1]),g(m(de,O),I[1]))),-C[2])),p(g(p(g(m(ye,ie),y[1]),p(g(m(Me,U),-C[1]),g(m(re,V),I[1]))),b[2]),g(p(g(m(ge,te),y[1]),p(g(m(de,O),-C[1]),g(m(re,V),b[1]))),-I[2]))),-x[3]),g(p(p(g(p(g(m(Se,xe),x[1]),p(g(m(_e,ee),-b[1]),g(m(me,J),I[1]))),y[2]),g(p(g(m(Se,xe),y[1]),p(g(m(Me,U),-b[1]),g(m(de,O),I[1]))),-x[2])),p(g(p(g(m(_e,ee),y[1]),p(g(m(Me,U),-x[1]),g(m(X,H),I[1]))),b[2]),g(p(g(m(me,J),y[1]),p(g(m(de,O),-x[1]),g(m(X,H),b[1]))),-I[2]))),C[3]))),p(p(g(p(p(g(p(g(m(ye,ie),x[1]),p(g(m(_e,ee),-C[1]),g(m(Z,K),I[1]))),y[2]),g(p(g(m(ye,ie),y[1]),p(g(m(Me,U),-C[1]),g(m(re,V),I[1]))),-x[2])),p(g(p(g(m(_e,ee),y[1]),p(g(m(Me,U),-x[1]),g(m(X,H),I[1]))),C[2]),g(p(g(m(Z,K),y[1]),p(g(m(re,V),-x[1]),g(m(X,H),C[1]))),-I[2]))),-b[3]),g(p(p(g(p(g(m(ge,te),x[1]),p(g(m(me,J),-C[1]),g(m(Z,K),b[1]))),y[2]),g(p(g(m(ge,te),y[1]),p(g(m(de,O),-C[1]),g(m(re,V),b[1]))),-x[2])),p(g(p(g(m(me,J),y[1]),p(g(m(de,O),-x[1]),g(m(X,H),b[1]))),C[2]),g(p(g(m(Z,K),y[1]),p(g(m(re,V),-x[1]),g(m(X,H),C[1]))),-b[2]))),I[3])),p(g(p(p(g(p(g(m(Se,xe),C[1]),p(g(m(ye,ie),-b[1]),g(m(ge,te),I[1]))),y[2]),g(p(g(m(Se,xe),y[1]),p(g(m(Me,U),-b[1]),g(m(de,O),I[1]))),-C[2])),p(g(p(g(m(ye,ie),y[1]),p(g(m(Me,U),-C[1]),g(m(re,V),I[1]))),b[2]),g(p(g(m(ge,te),y[1]),p(g(m(de,O),-C[1]),g(m(re,V),b[1]))),-I[2]))),f[3]),g(p(p(g(p(g(m(Se,xe),C[1]),p(g(m(ye,ie),-b[1]),g(m(ge,te),I[1]))),f[2]),g(p(g(m(Se,xe),f[1]),p(g(m(Re,N),-b[1]),g(m(ue,T),I[1]))),-C[2])),p(g(p(g(m(ye,ie),f[1]),p(g(m(Re,N),-C[1]),g(m(ne,B),I[1]))),b[2]),g(p(g(m(ge,te),f[1]),p(g(m(ue,T),-C[1]),g(m(ne,B),b[1]))),-I[2]))),-y[3])))),p(p(p(g(p(p(g(p(g(m(Se,xe),y[1]),p(g(m(Me,U),-b[1]),g(m(de,O),I[1]))),f[2]),g(p(g(m(Se,xe),f[1]),p(g(m(Re,N),-b[1]),g(m(ue,T),I[1]))),-y[2])),p(g(p(g(m(Me,U),f[1]),p(g(m(Re,N),-y[1]),g(m(L,P),I[1]))),b[2]),g(p(g(m(de,O),f[1]),p(g(m(ue,T),-y[1]),g(m(L,P),b[1]))),-I[2]))),C[3]),g(p(p(g(p(g(m(ye,ie),y[1]),p(g(m(Me,U),-C[1]),g(m(re,V),I[1]))),f[2]),g(p(g(m(ye,ie),f[1]),p(g(m(Re,N),-C[1]),g(m(ne,B),I[1]))),-y[2])),p(g(p(g(m(Me,U),f[1]),p(g(m(Re,N),-y[1]),g(m(L,P),I[1]))),C[2]),g(p(g(m(re,V),f[1]),p(g(m(ne,B),-y[1]),g(m(L,P),C[1]))),-I[2]))),-b[3])),p(g(p(p(g(p(g(m(ge,te),y[1]),p(g(m(de,O),-C[1]),g(m(re,V),b[1]))),f[2]),g(p(g(m(ge,te),f[1]),p(g(m(ue,T),-C[1]),g(m(ne,B),b[1]))),-y[2])),p(g(p(g(m(de,O),f[1]),p(g(m(ue,T),-y[1]),g(m(L,P),b[1]))),C[2]),g(p(g(m(re,V),f[1]),p(g(m(ne,B),-y[1]),g(m(L,P),C[1]))),-b[2]))),I[3]),g(p(p(g(p(g(m(ye,ie),x[1]),p(g(m(_e,ee),-C[1]),g(m(Z,K),I[1]))),y[2]),g(p(g(m(ye,ie),y[1]),p(g(m(Me,U),-C[1]),g(m(re,V),I[1]))),-x[2])),p(g(p(g(m(_e,ee),y[1]),p(g(m(Me,U),-x[1]),g(m(X,H),I[1]))),C[2]),g(p(g(m(Z,K),y[1]),p(g(m(re,V),-x[1]),g(m(X,H),C[1]))),-I[2]))),f[3]))),p(p(g(p(p(g(p(g(m(ye,ie),x[1]),p(g(m(_e,ee),-C[1]),g(m(Z,K),I[1]))),f[2]),g(p(g(m(ye,ie),f[1]),p(g(m(Re,N),-C[1]),g(m(ne,B),I[1]))),-x[2])),p(g(p(g(m(_e,ee),f[1]),p(g(m(Re,N),-x[1]),g(m(Y,M),I[1]))),C[2]),g(p(g(m(Z,K),f[1]),p(g(m(ne,B),-x[1]),g(m(Y,M),C[1]))),-I[2]))),-y[3]),g(p(p(g(p(g(m(ye,ie),y[1]),p(g(m(Me,U),-C[1]),g(m(re,V),I[1]))),f[2]),g(p(g(m(ye,ie),f[1]),p(g(m(Re,N),-C[1]),g(m(ne,B),I[1]))),-y[2])),p(g(p(g(m(Me,U),f[1]),p(g(m(Re,N),-y[1]),g(m(L,P),I[1]))),C[2]),g(p(g(m(re,V),f[1]),p(g(m(ne,B),-y[1]),g(m(L,P),C[1]))),-I[2]))),x[3])),p(g(p(p(g(p(g(m(_e,ee),y[1]),p(g(m(Me,U),-x[1]),g(m(X,H),I[1]))),f[2]),g(p(g(m(_e,ee),f[1]),p(g(m(Re,N),-x[1]),g(m(Y,M),I[1]))),-y[2])),p(g(p(g(m(Me,U),f[1]),p(g(m(Re,N),-y[1]),g(m(L,P),I[1]))),x[2]),g(p(g(m(X,H),f[1]),p(g(m(Y,M),-y[1]),g(m(L,P),x[1]))),-I[2]))),-C[3]),g(p(p(g(p(g(m(Z,K),y[1]),p(g(m(re,V),-x[1]),g(m(X,H),C[1]))),f[2]),g(p(g(m(Z,K),f[1]),p(g(m(ne,B),-x[1]),g(m(Y,M),C[1]))),-y[2])),p(g(p(g(m(re,V),f[1]),p(g(m(ne,B),-y[1]),g(m(L,P),C[1]))),x[2]),g(p(g(m(X,H),f[1]),p(g(m(Y,M),-y[1]),g(m(L,P),x[1]))),-C[2]))),I[3]))))),Le=p(p(p(g(p(p(g(p(g(m(Se,xe),C[1]),p(g(m(ye,ie),-b[1]),g(m(ge,te),I[1]))),x[2]),g(p(g(m(Se,xe),x[1]),p(g(m(_e,ee),-b[1]),g(m(me,J),I[1]))),-C[2])),p(g(p(g(m(ye,ie),x[1]),p(g(m(_e,ee),-C[1]),g(m(Z,K),I[1]))),b[2]),g(p(g(m(ge,te),x[1]),p(g(m(me,J),-C[1]),g(m(Z,K),b[1]))),-I[2]))),f[3]),p(g(p(p(g(p(g(m(Se,xe),C[1]),p(g(m(ye,ie),-b[1]),g(m(ge,te),I[1]))),f[2]),g(p(g(m(Se,xe),f[1]),p(g(m(Re,N),-b[1]),g(m(ue,T),I[1]))),-C[2])),p(g(p(g(m(ye,ie),f[1]),p(g(m(Re,N),-C[1]),g(m(ne,B),I[1]))),b[2]),g(p(g(m(ge,te),f[1]),p(g(m(ue,T),-C[1]),g(m(ne,B),b[1]))),-I[2]))),-x[3]),g(p(p(g(p(g(m(Se,xe),x[1]),p(g(m(_e,ee),-b[1]),g(m(me,J),I[1]))),f[2]),g(p(g(m(Se,xe),f[1]),p(g(m(Re,N),-b[1]),g(m(ue,T),I[1]))),-x[2])),p(g(p(g(m(_e,ee),f[1]),p(g(m(Re,N),-x[1]),g(m(Y,M),I[1]))),b[2]),g(p(g(m(me,J),f[1]),p(g(m(ue,T),-x[1]),g(m(Y,M),b[1]))),-I[2]))),C[3]))),p(p(g(p(p(g(p(g(m(ye,ie),x[1]),p(g(m(_e,ee),-C[1]),g(m(Z,K),I[1]))),f[2]),g(p(g(m(ye,ie),f[1]),p(g(m(Re,N),-C[1]),g(m(ne,B),I[1]))),-x[2])),p(g(p(g(m(_e,ee),f[1]),p(g(m(Re,N),-x[1]),g(m(Y,M),I[1]))),C[2]),g(p(g(m(Z,K),f[1]),p(g(m(ne,B),-x[1]),g(m(Y,M),C[1]))),-I[2]))),-b[3]),g(p(p(g(p(g(m(ge,te),x[1]),p(g(m(me,J),-C[1]),g(m(Z,K),b[1]))),f[2]),g(p(g(m(ge,te),f[1]),p(g(m(ue,T),-C[1]),g(m(ne,B),b[1]))),-x[2])),p(g(p(g(m(me,J),f[1]),p(g(m(ue,T),-x[1]),g(m(Y,M),b[1]))),C[2]),g(p(g(m(Z,K),f[1]),p(g(m(ne,B),-x[1]),g(m(Y,M),C[1]))),-b[2]))),I[3])),p(g(p(p(g(p(g(m(Se,xe),x[1]),p(g(m(_e,ee),-b[1]),g(m(me,J),I[1]))),y[2]),g(p(g(m(Se,xe),y[1]),p(g(m(Me,U),-b[1]),g(m(de,O),I[1]))),-x[2])),p(g(p(g(m(_e,ee),y[1]),p(g(m(Me,U),-x[1]),g(m(X,H),I[1]))),b[2]),g(p(g(m(me,J),y[1]),p(g(m(de,O),-x[1]),g(m(X,H),b[1]))),-I[2]))),f[3]),g(p(p(g(p(g(m(Se,xe),x[1]),p(g(m(_e,ee),-b[1]),g(m(me,J),I[1]))),f[2]),g(p(g(m(Se,xe),f[1]),p(g(m(Re,N),-b[1]),g(m(ue,T),I[1]))),-x[2])),p(g(p(g(m(_e,ee),f[1]),p(g(m(Re,N),-x[1]),g(m(Y,M),I[1]))),b[2]),g(p(g(m(me,J),f[1]),p(g(m(ue,T),-x[1]),g(m(Y,M),b[1]))),-I[2]))),-y[3])))),p(p(p(g(p(p(g(p(g(m(Se,xe),y[1]),p(g(m(Me,U),-b[1]),g(m(de,O),I[1]))),f[2]),g(p(g(m(Se,xe),f[1]),p(g(m(Re,N),-b[1]),g(m(ue,T),I[1]))),-y[2])),p(g(p(g(m(Me,U),f[1]),p(g(m(Re,N),-y[1]),g(m(L,P),I[1]))),b[2]),g(p(g(m(de,O),f[1]),p(g(m(ue,T),-y[1]),g(m(L,P),b[1]))),-I[2]))),x[3]),g(p(p(g(p(g(m(_e,ee),y[1]),p(g(m(Me,U),-x[1]),g(m(X,H),I[1]))),f[2]),g(p(g(m(_e,ee),f[1]),p(g(m(Re,N),-x[1]),g(m(Y,M),I[1]))),-y[2])),p(g(p(g(m(Me,U),f[1]),p(g(m(Re,N),-y[1]),g(m(L,P),I[1]))),x[2]),g(p(g(m(X,H),f[1]),p(g(m(Y,M),-y[1]),g(m(L,P),x[1]))),-I[2]))),-b[3])),p(g(p(p(g(p(g(m(me,J),y[1]),p(g(m(de,O),-x[1]),g(m(X,H),b[1]))),f[2]),g(p(g(m(me,J),f[1]),p(g(m(ue,T),-x[1]),g(m(Y,M),b[1]))),-y[2])),p(g(p(g(m(de,O),f[1]),p(g(m(ue,T),-y[1]),g(m(L,P),b[1]))),x[2]),g(p(g(m(X,H),f[1]),p(g(m(Y,M),-y[1]),g(m(L,P),x[1]))),-b[2]))),I[3]),g(p(p(g(p(g(m(ge,te),x[1]),p(g(m(me,J),-C[1]),g(m(Z,K),b[1]))),y[2]),g(p(g(m(ge,te),y[1]),p(g(m(de,O),-C[1]),g(m(re,V),b[1]))),-x[2])),p(g(p(g(m(me,J),y[1]),p(g(m(de,O),-x[1]),g(m(X,H),b[1]))),C[2]),g(p(g(m(Z,K),y[1]),p(g(m(re,V),-x[1]),g(m(X,H),C[1]))),-b[2]))),f[3]))),p(p(g(p(p(g(p(g(m(ge,te),x[1]),p(g(m(me,J),-C[1]),g(m(Z,K),b[1]))),f[2]),g(p(g(m(ge,te),f[1]),p(g(m(ue,T),-C[1]),g(m(ne,B),b[1]))),-x[2])),p(g(p(g(m(me,J),f[1]),p(g(m(ue,T),-x[1]),g(m(Y,M),b[1]))),C[2]),g(p(g(m(Z,K),f[1]),p(g(m(ne,B),-x[1]),g(m(Y,M),C[1]))),-b[2]))),-y[3]),g(p(p(g(p(g(m(ge,te),y[1]),p(g(m(de,O),-C[1]),g(m(re,V),b[1]))),f[2]),g(p(g(m(ge,te),f[1]),p(g(m(ue,T),-C[1]),g(m(ne,B),b[1]))),-y[2])),p(g(p(g(m(de,O),f[1]),p(g(m(ue,T),-y[1]),g(m(L,P),b[1]))),C[2]),g(p(g(m(re,V),f[1]),p(g(m(ne,B),-y[1]),g(m(L,P),C[1]))),-b[2]))),x[3])),p(g(p(p(g(p(g(m(me,J),y[1]),p(g(m(de,O),-x[1]),g(m(X,H),b[1]))),f[2]),g(p(g(m(me,J),f[1]),p(g(m(ue,T),-x[1]),g(m(Y,M),b[1]))),-y[2])),p(g(p(g(m(de,O),f[1]),p(g(m(ue,T),-y[1]),g(m(L,P),b[1]))),x[2]),g(p(g(m(X,H),f[1]),p(g(m(Y,M),-y[1]),g(m(L,P),x[1]))),-b[2]))),-C[3]),g(p(p(g(p(g(m(Z,K),y[1]),p(g(m(re,V),-x[1]),g(m(X,H),C[1]))),f[2]),g(p(g(m(Z,K),f[1]),p(g(m(ne,B),-x[1]),g(m(Y,M),C[1]))),-y[2])),p(g(p(g(m(re,V),f[1]),p(g(m(ne,B),-y[1]),g(m(L,P),C[1]))),x[2]),g(p(g(m(X,H),f[1]),p(g(m(Y,M),-y[1]),g(m(L,P),x[1]))),-C[2]))),b[3]))))),nt=m(Ne,Le);return nt[nt.length-1]}}var d=[function(){return 0},function(){return 0},function(){return 0}];function u(p){var m=d[p.length];return m||(m=d[p.length]=s(p.length)),m.apply(void 0,p)}function _(p,m,A,g,f,y,x,C){return function(b,I,v,P,M,B){switch(arguments.length){case 0:case 1:return 0;case 2:return g(b,I);case 3:return f(b,I,v);case 4:return y(b,I,v,P);case 5:return x(b,I,v,P,M);case 6:return C(b,I,v,P,M,B)}for(var T=Array(arguments.length),N=0;N<arguments.length;++N)T[N]=arguments[N];return p(T)}}(function(){for(;d.length<=6;)d.push(s(d.length));t.exports=_.apply(void 0,[u].concat(d));for(var p=0;p<=6;++p)t.exports[p]=d[p]})()}}),v5r=G4({"node_modules/cdt2d/lib/delaunay.js"(e,t){var n=I5r()[4];m6e();function o(r,i,s,a,c,l){var h=i.opposite(a,c);if(!(h<0)){if(c<a){var d=a;a=c,c=d,d=l,l=h,h=d}i.isConstraint(a,c)||n(r[a],r[c],r[l],r[h])<0&&s.push(a,c)}}t.exports=function(r,i){for(var s=[],a=r.length,c=i.stars,l=0;l<a;++l)for(var h=c[l],d=1;d<h.length;d+=2)if(!((m=h[d])<l)&&!i.isConstraint(l,m)){for(var u=h[d-1],_=-1,p=1;p<h.length;p+=2)if(h[p-1]===m){_=h[p];break}_<0||n(r[l],r[m],r[u],r[_])<0&&s.push(l,m)}for(;s.length>0;){for(var m=s.pop(),A=(u=-1,_=-1,h=c[l=s.pop()],1);A<h.length;A+=2){var g=h[A-1],f=h[A];g===m?_=f:f===m&&(u=g)}u<0||_<0||(n(r[l],r[m],r[u],r[_])>=0||(i.flip(l,m),o(r,i,s,u,l,_),o(r,i,s,l,_,u),o(r,i,s,_,m,u),o(r,i,s,m,u,_)))}}}}),S5r=G4({"node_modules/cdt2d/lib/filter.js"(e,t){var n=m6e();function o(i,s,a,c,l,h,d){this.cells=i,this.neighbor=s,this.flags=c,this.constraint=a,this.active=l,this.next=h,this.boundary=d}function r(i,s){return i[0]-s[0]||i[1]-s[1]||i[2]-s[2]}t.exports=function(i,s,a){var c=function(C,b){for(var I=C.cells(),v=I.length,P=0;P<v;++P){var M=(j=I[P])[0],B=j[1],T=j[2];B<T?B<M&&(j[0]=B,j[1]=T,j[2]=M):T<M&&(j[0]=T,j[1]=M,j[2]=B)}I.sort(r);var N=Array(v);for(P=0;P<N.length;++P)N[P]=0;var D=[],L=[],H=Array(3*v),V=Array(3*v),O=null;b&&(O=[]);var U=new o(I,H,V,N,D,L,O);for(P=0;P<v;++P)for(var j=I[P],Y=0;Y<3;++Y){M=j[Y],B=j[(Y+1)%3];var X=H[3*P+Y]=U.locate(B,M,C.opposite(B,M)),K=V[3*P+Y]=C.isConstraint(M,B);X<0&&(K?L.push(P):(D.push(P),N[P]=1),b&&O.push([B,M,-1]))}return U}(i,a);if(s===0)return a?c.cells.concat(c.boundary):c.cells;var l=1,{active:h,next:d,flags:u,cells:_,constraint:p,neighbor:m}=c;for(;h.length>0||d.length>0;){for(;h.length>0;){var A=h.pop();if(u[A]!==-l){u[A]=l,_[A];for(var g=0;g<3;++g){var f=m[3*A+g];f>=0&&u[f]===0&&(p[3*A+g]?d.push(f):(h.push(f),u[f]=l))}}}var y=d;d=h,h=y,d.length=0,l=-l}var x=function(C,b,I){for(var v=0,P=0;P<C.length;++P)b[P]===I&&(C[v++]=C[P]);return C.length=v,C}(_,u,s);if(a)return x.concat(c.boundary);return x},o.prototype.locate=function(){var i=[0,0,0];return function(s,a,c){var l=s,h=a,d=c;return a<c?a<s&&(l=a,h=c,d=s):c<s&&(l=c,h=s,d=a),l<0?-1:(i[0]=l,i[1]=h,i[2]=d,n.eq(this.cells,i,r))}}()}}),P5r=G4({"node_modules/cdt2d/cdt2d.js"(e,t){var n=C5r(),o=b5r(),r=v5r(),i=S5r();function s(l){return[Math.min(l[0],l[1]),Math.max(l[0],l[1])]}function a(l,h){return l[0]-h[0]||l[1]-h[1]}function c(l,h,d){return h in l?l[h]:d}t.exports=function(l,h,d){Array.isArray(h)?(d=d||{},h=h||[]):(d=h||{},h=[]);var u=!!c(d,"delaunay",!0),_=!!c(d,"interior",!0),p=!!c(d,"exterior",!0),m=!!c(d,"infinity",!1);if(!_&&!p||l.length===0)return[];var A=n(l,h);if(u||_!==p||m){for(var g=o(l.length,function(x){return x.map(s).sort(a)}(h)),f=0;f<A.length;++f){var y=A[f];g.addTriangle(y[0],y[1],y[2])}return u&&r(l,g),p?_?m?i(g,0,m):g.cells():i(g,1,m):i(g,-1)}return A}}}),tan=(e)=>e.map((t)=>({connectionId:t.connectionId,startRegionId:t.startRegion.regionId,endRegionId:t.endRegion.regionId,mutuallyConnectedNetworkId:t.mutuallyConnectedNetworkId})),nan=(e)=>({ports:e.ports.map((t)=>({portId:t.portId,region1Id:t.region1.regionId,region2Id:t.region2.regionId,d:t.d})),regions:e.regions.map((t)=>({regionId:t.regionId,pointIds:t.ports.map((n)=>n.portId),d:t.d}))}),$We=({port:e,boundaryRegionMap:t})=>{let n=t.get(e.portId);if(!n){let o=typeof e.d?.x=="number"?e.d.x:0,r=typeof e.d?.y=="number"?e.d.y:0;n={regionId:`__section_boundary__${e.portId}`,ports:[],d:{isBoundaryRegion:!0,boundaryPortId:e.portId,...e.d,center:{x:o,y:r},bounds:{minX:o-0.05,maxX:o+0.05,minY:r-0.05,maxY:r+0.05}},assignments:[]},t.set(e.portId,n)}return n},E5r=(e)=>{let{sectionRoute:t,graph:n}=e,o=new Set(n.ports.map((a)=>a.portId)),r=t.globalRoute.path.slice(t.sectionStartIndex,t.sectionEndIndex+1).filter((a)=>o.has(a.port.portId)),i=[],s=t.sectionConnection.startRegion;for(let a=0;a<r.length;a++){let c=r[a],l=n.ports.find((d)=>d.portId===c.port.portId),h=l.region1===s?l.region2:l.region1;i.push({port:l,g:0,h:0,f:0,hops:a,ripRequired:c.ripRequired,parent:a>0?i[a-1]:void 0,lastPort:a>0?i[a-1].port:void 0,lastRegion:a>0?s:void 0,nextRegion:h}),s=h}return{connection:t.sectionConnection,path:i,requiredRip:t.globalRoute.requiredRip}},M5r=(e,t)=>{let n=-1,o=-1;for(let r=0;r<e.path.length;r++){let i=e.path[r];(i.lastRegion&&t.has(i.lastRegion.regionId)||i.nextRegion&&t.has(i.nextRegion.regionId))&&(n===-1&&(n=r),o=r)}return n===-1?null:{startIndex:n,endIndex:o}},w5r=(e)=>{let{graph:t,solvedRoutes:n,centralRegion:o,expansionHopsFromCentralRegion:r}=e,i=(({centralRegion:p,expansionHopsFromCentralRegion:m})=>{let A=new Set([p.regionId]),g=[{region:p,hops:0}];for(;g.length>0;){let{region:f,hops:y}=g.shift();if(!(y>=m+1))for(let x of f.ports){let C=x.region1===f?x.region2:x.region1;A.has(C.regionId)||(A.add(C.regionId),g.push({region:C,hops:y+1}))}}return A})({graph:t,centralRegion:o,expansionHopsFromCentralRegion:r}),s=new Map,a=new Map,c=[];for(let p of t.regions)i.has(p.regionId)&&s.set(p.regionId,{regionId:p.regionId,ports:[],d:p.d?structuredClone(p.d):p.d,assignments:[]});for(let p of t.ports){let m=i.has(p.region1.regionId),A=i.has(p.region2.regionId);if(!m&&!A)continue;if(m&&A){let x={portId:p.portId,region1:s.get(p.region1.regionId),region2:s.get(p.region2.regionId),d:p.d};x.region1.ports.push(x),x.region2.ports.push(x),c.push(x);continue}let g=m?p.region1:p.region2,f=$We({port:p,boundaryRegionMap:a}),y={portId:p.portId,region1:s.get(g.regionId),region2:f,d:p.d};y.region1.ports.push(y),y.region2.ports.push(y),c.push(y)}let l={regions:[...s.values(),...a.values()],ports:c},h=[],d=[],u=[];for(let p of n){let m=M5r(p,i);if(!m)continue;let A=p.path[m.startIndex],g=p.path[m.endIndex];u.push({solvedRoute:p,solvedPathStartIndex:m.startIndex,solvedPathEndIndex:m.endIndex,startCandidate:A,endCandidate:g})}let _=new Map(l.regions.map((p)=>[p.regionId,p]));for(let{solvedRoute:p,solvedPathStartIndex:m,solvedPathEndIndex:A,startCandidate:g,endCandidate:f}of u){let y,x,C,b;if(i.has(p.connection.startRegion.regionId))y=p.connection.startRegion.regionId,x=_.get(y);else{let M=$We({port:g.port,boundaryRegionMap:a});y=M.regionId,x=M,_.has(y)||_.set(y,M)}if(i.has(p.connection.endRegion.regionId))C=p.connection.endRegion.regionId,b=_.get(C);else{let M=$We({port:f.port,boundaryRegionMap:a});C=M.regionId,b=M,_.has(C)||_.set(C,M)}if(!x)throw console.error("[getSectionOfHyperGraphAsHyperGraph] CRITICAL ERROR: startRegion not found!"),console.error(`  Looking for: ${y}`),console.error(`  Route connection: ${p.connection.connectionId}`),console.error(`  Original startRegion: ${p.connection.startRegion.regionId}`),console.error(`  startCandidate port: ${g.port.portId}`),console.error("  Available regions in sectionRegionMap:",Array.from(_.keys())),Error(`startRegion ${y} not found in sectionRegionMap`);if(!b)throw console.error("[getSectionOfHyperGraphAsHyperGraph] CRITICAL ERROR: endRegion not found!"),console.error(`  Looking for: ${C}`),console.error(`  Route connection: ${p.connection.connectionId}`),console.error(`  Original endRegion: ${p.connection.endRegion.regionId}`),console.error(`  endCandidate port: ${f.port.portId}`),console.error("  Available regions in sectionRegionMap:",Array.from(_.keys())),Error(`endRegion ${C} not found in sectionRegionMap`);let I={connectionId:p.connection.connectionId,mutuallyConnectedNetworkId:p.connection.mutuallyConnectedNetworkId,startRegion:x,endRegion:b},v=p.path.slice(m,A+1),P={globalRoute:p,globalConnection:p.connection,sectionConnection:I,sectionStartIndex:m,sectionEndIndex:A};h.push({...P,canRemainFixedInSectionSolve:v.every((M)=>l.ports.some((B)=>B.portId===M.port.portId)),sectionRoute:E5r({sectionRoute:P,graph:l})}),d.push(I)}return{centralRegionId:o.regionId,sectionRegionIds:i,graph:l,connections:d,sectionRoutes:h}},HVt=class{heap=[];maxSize;constructor(e=[],t=1e4){if(this.maxSize=t,e.length>0){this.heap=[...e].sort((n,o)=>n.f-o.f).slice(0,this.maxSize);for(let n=Math.floor(this.heap.length/2)-1;n>=0;n--)this._siftDown(n)}}get size(){return this.heap.length}isEmpty(){return this.heap.length===0}peek(){return this.isEmpty()?null:this.heap[0]??null}peekMany(e){return[...this.heap].sort((t,n)=>t.f-n.f).slice(0,e)}dequeue(){if(this.isEmpty())return null;let e=this.heap[0],t=this.heap.pop();return this.heap.length===0&&t!==void 0||t!==void 0&&(this.heap[0]=t,this._siftDown(0)),e}enqueue(e){this.heap.length>=this.maxSize||(this.heap.push(e),this._siftUp(this.heap.length-1))}_siftUp(e){let t=e;for(;t>0;){let n=this._parentIndex(t);if(this.heap[n].f<=this.heap[t].f)break;this._swap(t,n),t=n}}_siftDown(e){let t=e,n=this.heap.length;for(;;){let o=this._leftChildIndex(t),r=this._rightChildIndex(t),i=t;if(o<n&&this.heap[o].f<this.heap[i].f&&(i=o),r<n&&this.heap[r].f<this.heap[i].f&&(i=r),i===t)break;this._swap(t,i),t=i}}_swap(e,t){[this.heap[e],this.heap[t]]=[this.heap[t],this.heap[e]]}_parentIndex(e){return Math.floor((e-1)/2)}_leftChildIndex(e){return 2*e+1}_rightChildIndex(e){return 2*e+2}},oan=(e)=>{for(let t of e.regions)t.assignments=[];for(let t of e.ports)t.assignment=void 0},gKe=({graph:e,connections:t,solvedRoutes:n})=>{let o=new Map(e.ports.map((a)=>[a.portId,a])),r=new Map(e.regions.map((a)=>[a.regionId,a])),i=new Map(t.map((a)=>[a.connectionId,a])),s=n.map((a)=>{let c=[];for(let l of a.path){let h={port:o.get(l.port.portId),g:l.g,h:l.h,f:l.f,hops:l.hops,ripRequired:l.ripRequired};l.lastPort&&(h.lastPort=o.get(l.lastPort.portId)),l.lastRegion&&(h.lastRegion=r.get(l.lastRegion.regionId)),l.nextRegion&&(h.nextRegion=r.get(l.nextRegion.regionId));let d=c[c.length-1];d&&(h.parent=d),c.push(h)}return{path:c,connection:i.get(a.connection.connectionId),requiredRip:a.requiredRip}});oan(e),e.solvedRoutes=s;for(let a of s)for(let c of a.path){if(c.port.assignment={solvedRoute:a,connection:a.connection},!c.lastPort||!c.lastRegion)continue;let l={regionPort1:c.lastPort,regionPort2:c.port,region:c.lastRegion,connection:a.connection,solvedRoute:a};c.lastRegion.assignments??=[],c.lastRegion.assignments.push(l)}return s},ran=class extends fa{constructor(e){super(),this.input=e,this.graph=((n)=>{if(n.ports.length>0&&"region1"in n.ports[0]&&typeof n.ports[0].region1=="object")return n;let o=new Map,r=new Map;for(let i of n.regions){let{assignments:s,...a}=i;r.set(i.regionId,{...a,d:a.d?structuredClone(a.d):a.d,ports:[],assignments:void 0})}for(let i of n.ports){let s=r.get(i.region1Id??i.region1?.regionId),a=r.get(i.region2Id??i.region2?.regionId),c={portId:i.portId,region1:s,region2:a,d:i.d};o.set(i.portId,c),s.ports.push(c),a.ports.push(c)}return{ports:Array.from(o.values()),regions:Array.from(r.values())}})(e.inputGraph),oan(this.graph),this.connections=((n,o)=>{let r=[];for(let i of n)"startRegionId"in i?r.push({connectionId:i.connectionId,mutuallyConnectedNetworkId:i.mutuallyConnectedNetworkId??i.connectionId,startRegion:o.regions.find((s)=>s.regionId===i.startRegionId),endRegion:o.regions.find((s)=>s.regionId===i.endRegionId)}):r.push(i);return r})(e.inputConnections,this.graph),e.inputSolvedRoutes?this.solvedRoutes=gKe({graph:this.graph,connections:this.connections,solvedRoutes:e.inputSolvedRoutes}):this.graph.solvedRoutes=this.solvedRoutes,e.greedyMultiplier!==void 0&&(this.greedyMultiplier=e.greedyMultiplier),e.rippingEnabled!==void 0&&(this.rippingEnabled=e.rippingEnabled),e.ripCost!==void 0&&(this.ripCost=e.ripCost);let t=new Set(this.solvedRoutes.map((n)=>n.connection.connectionId));this.unprocessedConnections=this.connections.filter((n)=>!t.has(n.connectionId)),this.candidateQueue=new HVt,this.unprocessedConnections.length===0?this.solved=!0:this.beginNewConnection()}getSolverName(){return"HyperGraphSolver"}graph;connections;candidateQueue;unprocessedConnections;solvedRoutes=[];currentConnection=null;currentEndRegion=null;greedyMultiplier=1;rippingEnabled=!1;ripCost=0;lastCandidate=null;visitedPointsForCurrentConnection=new Map;getConstructorParams(){return{inputGraph:nan(this.graph),inputConnections:tan(this.connections),greedyMultiplier:this.greedyMultiplier,rippingEnabled:this.rippingEnabled,ripCost:this.ripCost,inputSolvedRoutes:this.solvedRoutes}}computeH(e){return this.estimateCostToEnd(e.port)}estimateCostToEnd(e){return 0}getPortUsagePenalty(e){return 0}computeIncreasedRegionCostIfPortsAreUsed(e,t,n){return 0}getRipsRequiredForPortUsage(e,t,n){return[]}isRipRequiredForPortUsage(e,t,n){return!1}isTransitionAllowed(e,t,n){return!0}computeG(e){return e.parent.g+this.computeIncreasedRegionCostIfPortsAreUsed(e.lastRegion,e.lastPort,e.port)+(e.ripRequired?this.ripCost:0)+this.getPortUsagePenalty(e.port)}selectCandidatesForEnteringRegion(e){return e}computeRoutesToRip(e){let t=this.computeCrossingRoutes(e),n=this.computePortOverlapRoutes(e);return new Set([...t,...n])}computePortOverlapRoutes(e){let t=new Set;for(let n of e.path)n.port.assignment&&n.port.assignment.connection.mutuallyConnectedNetworkId!==e.connection.mutuallyConnectedNetworkId&&t.add(n.port.assignment.solvedRoute);return t}computeCrossingRoutes(e){let t=new Set;for(let n of e.path){if(!n.lastPort||!n.lastRegion)continue;let o=this.getRipsRequiredForPortUsage(n.lastRegion,n.lastPort,n.port);for(let r of o)t.add(r.solvedRoute)}return t}getNextCandidates(e){let{nextRegion:t,port:n}=e,o={};for(let i of t.ports){if(i===e.port)continue;if(!this.isTransitionAllowed(t,n,i))continue;let s=i.assignment&&i.assignment.connection.mutuallyConnectedNetworkId!==this.currentConnection.mutuallyConnectedNetworkId||this.isRipRequiredForPortUsage(t,n,i),a={port:i,hops:e.hops+1,parent:e,lastRegion:t,nextRegion:i.region1===t?i.region2:i.region1,lastPort:n,ripRequired:s};!this.rippingEnabled&&a.ripRequired||(o[a.nextRegion.regionId]??=[],o[a.nextRegion.regionId].push(a))}let r=[];for(let i in o){let s=o[i];r.push(...this.selectCandidatesForEnteringRegion(s))}for(let i of r)i.g=this.computeG(i),i.h=this.computeH(i),i.f=i.g+i.h*this.greedyMultiplier;return r}processSolvedRoute(e){let t={path:[],connection:this.currentConnection,requiredRip:!1},n=e,o=!1;for(;n;)o||=!!n.ripRequired,t.path.unshift(n),n=n.parent;o&&(t.requiredRip=!0);let r=this.computeRoutesToRip(t);if(r.size>0){t.requiredRip=!0;for(let i of r)this.ripSolvedRoute(i)}for(let i of t.path){if(i.port.assignment={solvedRoute:t,connection:this.currentConnection},!i.lastPort)continue;let s={regionPort1:i.lastPort,regionPort2:i.port,region:i.lastRegion,connection:this.currentConnection,solvedRoute:t};i.lastRegion.assignments?.push(s)}this.solvedRoutes.push(t),this.routeSolvedHook(t)}routeSolvedHook(e){}routeStartedHook(e){}ripSolvedRoute(e){for(let t of e.path.map((n)=>n.port))t.ripCount=(t.ripCount??0)+1,t.region1.assignments=t.region1.assignments?.filter((n)=>n.regionPort1!==t&&n.regionPort2!==t),t.region2.assignments=t.region2.assignments?.filter((n)=>n.regionPort1!==t&&n.regionPort2!==t),t.assignment=void 0;this.solvedRoutes=this.solvedRoutes.filter((t)=>t!==e),this.unprocessedConnections.push(e.connection)}beginNewConnection(){this.currentConnection=this.unprocessedConnections.shift(),this.currentEndRegion=this.currentConnection.endRegion,this.candidateQueue=new HVt,this.visitedPointsForCurrentConnection.clear(),this.routeStartedHook(this.currentConnection);for(let e of this.currentConnection.startRegion.ports)this.candidateQueue.enqueue({port:e,g:0,h:0,f:0,hops:0,ripRequired:!1,nextRegion:e.region1===this.currentConnection.startRegion?e.region2:e.region1})}_step(){let e=this.candidateQueue.dequeue();if(!e)return this.failed=!0,void(this.error="Ran out of candidates");let t=this.visitedPointsForCurrentConnection.get(e.port.portId);for(;e&&t!==void 0&&!(e.g<t)&&(e=this.candidateQueue.dequeue(),e);)t=this.visitedPointsForCurrentConnection.get(e.port.portId);if(!e)return this.failed=!0,void(this.error="Ran out of candidates");if(this.lastCandidate=e,this.visitedPointsForCurrentConnection.set(e.port.portId,e.g),e.nextRegion===this.currentEndRegion)return this.processSolvedRoute(e),this.unprocessedConnections.length===0?void(this.solved=!0):void this.beginNewConnection();let n=this.getNextCandidates(e);for(let o of n)this.candidateQueue.enqueue(o)}};function B5r(e,t){let n=e.x-t.x,o=e.y-t.y;return n*n+o*o}function AKe(e,t,n,o,r){let i=n-t,s=r-o;if(Math.abs(e.y-r)<0.000001)return e.x-t;if(Math.abs(e.x-n)<0.000001)return i+(r-e.y);if(Math.abs(e.y-o)<0.000001)return i+s+(n-e.x);if(Math.abs(e.x-t)<0.000001)return 2*i+s+(e.y-o);let c=Math.abs(e.y-r),l=Math.abs(e.x-n),h=Math.abs(e.y-o),d=Math.abs(e.x-t),u=Math.min(c,l,h,d);return u===c?Math.max(0,Math.min(i,e.x-t)):u===l?i+Math.max(0,Math.min(s,r-e.y)):u===h?i+s+Math.max(0,Math.min(i,n-e.x)):2*i+s+Math.max(0,Math.min(s,e.y-o))}function T5r(e,t,n){let o=n.x-t.x,r=n.y-t.y,i=e.x-t.x,s=e.y-t.y,a=o*o+r*r,c=a>0?(l=(i*o+s*r)/a,h=0,d=1,Math.max(h,Math.min(d,l))):0;var l,h,d;return{u:c,d2:B5r(e,{x:t.x+c*o,y:t.y+c*r})}}function ian(e){let t=e.d.polygon;if(!t||t.length<3)return null;let n=e.d.polygonPerimeterCache;if(n)return n;let o=function(r){let i=r.length,s=Array(i),a=Array(i+1);a[0]=0;for(let c=0;c<i;c++){let l=r[c],h=r[(c+1)%i],d=Math.hypot(h.x-l.x,h.y-l.y);s[c]=d,a[c+1]=a[c]+d}return{edgeLengths:s,cumulative:a,perimeter:a[i]}}(t);return e.d.polygonPerimeterCache=o,o}function FVt(e){let t=ian(e);if(t)return t.perimeter;let{minX:n,maxX:o,minY:r,maxY:i}=e.d.bounds;return 2*(o-n)+2*(i-r)}function kR(e,t){if(e.region1===t){if(typeof e.region1T=="number")return e.region1T;let n=qWe(e.d,t);return e.region1T=n,n}if(e.region2===t){if(typeof e.region2T=="number")return e.region2T;let n=qWe(e.d,t);return e.region2T=n,n}return qWe(e.d,t)}function qWe(e,t){let n=t.d.polygon;if(n&&n.length>=3){let a=ian(t);if(a)return function(c,l,h,d=0.000001){let u=0,_=0,p=Number.POSITIVE_INFINITY,m=d*d;for(let A=0;A<l.length;A++){let g=T5r(c,l[A],l[(A+1)%l.length]);if(g.d2<=m){u=A,_=g.u,p=g.d2;break}g.d2<p&&(u=A,_=g.u,p=g.d2)}return h.cumulative[u]+_*h.edgeLengths[u]}(e,n,a)}let{minX:o,maxX:r,minY:i,maxY:s}=t.d.bounds;return AKe(e,o,r,i,s)}function C3e(e,t,n=0.000001){return Math.abs(e-t)<n}function nQ(e,t){return(e%t+t)%t}function b3e(e,t,n,o){let r=Math.abs(nQ(e-t,n));return r<o||n-r<o}function zVt(e,t,n,o,r){let i=nQ(e,o),s=nQ(t,o),a=nQ(n,o);return!(Math.abs(s-a)<r)&&(s<a?s<i&&i<a:i>s||i<a)}function JWe(e,t,n){if(typeof n=="number"&&n>0){let[a,c]=e,[l,h]=t;if(a=nQ(a,n),c=nQ(c,n),l=nQ(l,n),h=nQ(h,n),b3e(a,l,n,0.000001)||b3e(a,h,n,0.000001)||b3e(c,l,n,0.000001)||b3e(c,h,n,0.000001))return!1;return zVt(l,a,c,n,0.000000000001)!==zVt(h,a,c,n,0.000000000001)}let[o,r]=e[0]<e[1]?e:[e[1],e[0]],[i,s]=t[0]<t[1]?t:[t[1],t[0]];return!(C3e(o,i)||C3e(o,s)||C3e(r,i)||C3e(r,s))&&(o<i&&i<r&&r<s||i<o&&o<s&&s<r)}var san=(e)=>{let{POSITIVE_INFINITY:t,NEGATIVE_INFINITY:n,POSITIVE_INFINITY:o,NEGATIVE_INFINITY:r}=Number;for(let i of e){let{bounds:s}=i.d;t=Math.min(t,s.minX),n=Math.max(n,s.maxX),o=Math.min(o,s.minY),r=Math.max(r,s.maxY)}return{minX:t,maxX:n,minY:o,maxY:r}},OVt=(e,t,n,o)=>{let r={portId:e,region1:t,region2:n,d:{x:o.x,y:o.y}};return t.ports.push(r),n.ports.push(r),r},VVt=(e,t,n)=>({regionId:e,ports:[],d:{bounds:{minX:t-0.2,maxX:t+0.2,minY:n-0.2,maxY:n+0.2},center:{x:t,y:n},isPad:!1,isConnectionRegion:!0}}),oQ=0.01,cw=(e,t,n)=>Math.max(t,Math.min(n,e)),YVt=(e,t,n)=>t==="left"?Math.abs(e.x-n.minX)<oQ:t==="right"?Math.abs(e.x-n.maxX)<oQ:t==="top"?Math.abs(e.y-n.maxY)<oQ:Math.abs(e.y-n.minY)<oQ,D5r=(e,t,n,o)=>{let r=o.x-n.x,i=o.y-n.y,s=e-n.x,a=t-n.y,c=r*r+i*i,l=c>0?cw((s*r+a*i)/c,0,1):0,h=n.x+l*r,d=n.y+l*i,u=e-h,_=t-d;return{x:h,y:d,d2:u*u+_*_}},N5r=(e,t,n,o,r)=>{let i=n.d.polygon;if(i&&i.length>=3){let l=new Set(r),h=null;for(let d=0;d<i.length;d++){let u=i[d],_=i[(d+1)%i.length];if(r.length>0){if(!r.some((m)=>YVt(u,m,o)&&YVt(_,m,o)&&l.has(m)))continue}let p=D5r(e,t,u,_);(!h||p.d2<h.d2)&&(h=p)}if(h)return h}let s=n.d.bounds,a=[];if(r.length>0)for(let l of r)l==="left"?a.push({side:l,x:s.minX,y:cw(t,s.minY,s.maxY)}):l==="right"?a.push({side:l,x:s.maxX,y:cw(t,s.minY,s.maxY)}):l==="top"?a.push({side:l,x:cw(e,s.minX,s.maxX),y:s.maxY}):a.push({side:l,x:cw(e,s.minX,s.maxX),y:s.minY});a.length===0&&a.push({side:"left",x:s.minX,y:cw(t,s.minY,s.maxY)},{side:"right",x:s.maxX,y:cw(t,s.minY,s.maxY)},{side:"top",x:cw(e,s.minX,s.maxX),y:s.maxY},{side:"bottom",x:cw(e,s.minX,s.maxX),y:s.minY});let c=null;for(let l of a){if(r.length>0&&!r.includes(l.side))continue;let h=e-l.x,d=t-l.y,u=h*h+d*d;(!c||u<c.d2)&&(c={x:l.x,y:l.y,d2:u})}return c},GVt=(e,t,n,o)=>{let r=((c,l,h)=>{let d=[];return Math.abs(c-h.minX)<oQ&&d.push("left"),Math.abs(c-h.maxX)<oQ&&d.push("right"),Math.abs(l-h.maxY)<oQ&&d.push("top"),Math.abs(l-h.minY)<oQ&&d.push("bottom"),d})(e,t,o),i=null,s=Number.POSITIVE_INFINITY,a={x:e,y:t};for(let c of n){if(c.d.isPad||c.d.isThroughJumper)continue;let l=c.d.bounds;if(!(Math.abs(l.minX-o.minX)<0.01||Math.abs(l.maxX-o.maxX)<0.01||Math.abs(l.minY-o.minY)<0.01||Math.abs(l.maxY-o.maxY)<0.01))continue;let h=N5r(e,t,c,o,r);if(!h)continue;let d=Math.sqrt(h.d2);d<s&&(s=d,i=c,a={x:h.x,y:h.y})}return i?{region:i,portPosition:a}:null},R5r=class extends fa{constructor(e){super(),this.input=e,this.graph=e.hyperGraphSolver.graph;let t=e.inputSolvedRoutes,n=e.hyperGraphSolver.connections;this.connections=n,this.solvedRoutes=gKe({graph:this.graph,connections:this.connections,solvedRoutes:t}),this.maxAttemptsPerRegion=e.MAX_ATTEMPTS_PER_REGION,this.maxSectionAttempts=e.MAX_ATTEMPTS_PER_SECTION??500,this.iterations+=this.iterations*(e.effort??1),this.fractionToReplace=e.FRACTION_TO_REPLACE??0.2,this.alwaysRipConflicts=e.alwaysRipConflicts??!0}graph;connections;solvedRoutes;activeSection=null;baselineSectionCost=1/0;baselineGlobalCost=1/0;regionAttemptCounts=new Map;sectionAttempts=0;maxAttemptsPerRegion;maxSectionAttempts;fractionToReplace;alwaysRipConflicts;random=((e)=>{let t=e;return()=>(t=1664525*t+1013904223>>>0,t/4294967295)})(31337);getSolverName(){return"HyperGraphSectionOptimizer"}getConstructorParams(){return{inputGraph:nan(this.graph),inputConnections:tan(this.connections),inputSolvedRoutes:this.solvedRoutes,expansionHopsFromCentralRegion:this.input.expansionHopsFromCentralRegion,maxAttemptsPerRegion:this.maxAttemptsPerRegion,maxSectionAttempts:this.maxSectionAttempts,effort:this.input.effort,fractionToReplace:this.fractionToReplace,alwaysRipConflicts:this.alwaysRipConflicts,ACCEPTABLE_COST:this.input.ACCEPTABLE_REGION_COST}}getOutput(){return this.solvedRoutes}_setup(){this.beginSectionSolve()}visualize(){return this.activeSubSolver?this.activeSubSolver.visualize():{title:"HyperGraphSectionOptimizer",points:[],lines:[],rects:[],circles:[],texts:[],polygons:[],arrows:[]}}getCostOfRegionWithAttempts(e){let t=this.regionAttemptCounts.get(e.regionId)??0;return this.input.regionCost(e)+1e4*t}computeCostOfSection({section:e,solvedRoutes:t}){if(this.input.computeSolvedGraphCost)return this.input.computeSolvedGraphCost(t);let n=this.input.createHyperGraphSolver({inputGraph:e.graph,inputConnections:e.connections,inputSolvedRoutes:t}),o=0;for(let r of n.graph.regions)o+=this.input.regionCost(r);return o}computeSolvedGraphCost(e){if(this.input.computeSolvedGraphCost)return this.input.computeSolvedGraphCost(e);let t=this.input.createHyperGraphSolver({inputGraph:this.graph,inputConnections:this.connections,inputSolvedRoutes:e}),n=0;for(let o of t.graph.regions)n+=this.input.regionCost(o);return n}determineConnectionsToRip(e,t){let n=e.sectionRoutes.map((a)=>a.globalConnection.connectionId);if(this.fractionToReplace>=1)return new Set(n);let o=[...n];for(let a=o.length-1;a>0;a--){let c=Math.floor(this.random()*(a+1));[o[a],o[c]]=[o[c],o[a]]}let r=Math.max(1,Math.ceil(o.length*this.fractionToReplace)),i=new Set(o.slice(0,r));if(!this.alwaysRipConflicts)return i;let s=new Map(e.graph.regions.map((a)=>[a.regionId,a]));for(let a of e.sectionRoutes)for(let c of a.sectionRoute.path){if(!c.lastPort||!c.lastRegion)continue;let l=s.get(c.lastRegion.regionId);if(!l)continue;t.currentConnection=a.globalConnection;let h=t.getRipsRequiredForPortUsage(l,c.lastPort,c.port);for(let d of h){let u=a.globalConnection.connectionId,_=d.connection.connectionId;i.has(u)||i.has(_)||i.add(this.random()<0.5?u:_)}}return i}getNextCentralRegion(){let e=null,t=1/0;for(let n of this.graph.regions){if((n.assignments?.length??0)===0)continue;if((this.regionAttemptCounts.get(n.regionId)??0)>=this.maxAttemptsPerRegion)continue;if(this.input.regionCost(n)<this.input.ACCEPTABLE_REGION_COST)continue;let o=this.getCostOfRegionWithAttempts(n);o>=t||(t=o,e=n)}return e}beginSectionSolve(){if(this.sectionAttempts>=this.maxSectionAttempts)return console.log(`Reached max section attempts (${this.maxSectionAttempts}), stopping optimization`),void(this.solved=!0);let e=this.getNextCentralRegion();if(!e)return void(this.solved=!0);if(this.sectionAttempts++,this.activeSection=w5r({graph:this.graph,solvedRoutes:this.solvedRoutes,centralRegion:e,expansionHopsFromCentralRegion:this.input.expansionHopsFromCentralRegion}),!this.activeSection)return;if(this.activeSection.connections.length===0)return this.regionAttemptCounts.set(e.regionId,(this.regionAttemptCounts.get(e.regionId)??0)+1),void(this.activeSection=null);let t=this.activeSection.sectionRoutes.filter((s)=>s.canRemainFixedInSectionSolve),n=this.input.createHyperGraphSolver({inputGraph:this.activeSection.graph,inputConnections:this.activeSection.connections,inputSolvedRoutes:t.map((s)=>s.sectionRoute)}),o=this.determineConnectionsToRip(this.activeSection,n);for(let s of this.activeSection.sectionRoutes)s.canRemainFixedInSectionSolve||o.add(s.globalConnection.connectionId);let r=this.activeSection.sectionRoutes.filter((s)=>s.canRemainFixedInSectionSolve&&!o.has(s.globalConnection.connectionId)).map((s)=>s.sectionRoute),i=[...r,...this.activeSection.sectionRoutes.filter((s)=>o.has(s.globalConnection.connectionId)).map((s)=>s.sectionRoute)];this.baselineSectionCost=this.computeCostOfSection({section:this.activeSection,solvedRoutes:i}),this.baselineGlobalCost=this.computeSolvedGraphCost(this.solvedRoutes),this.activeSubSolver=this.input.createHyperGraphSolver({inputGraph:this.activeSection.graph,inputConnections:this.activeSection.connections,inputSolvedRoutes:r});for(let s of this.activeSubSolver.connections)s.startRegion&&s.endRegion||console.error({startRegion:s.startRegion?.regionId,endRegion:s.endRegion?.regionId})}_step(){if(!this.activeSubSolver)return void this.beginSectionSolve();if(this.activeSubSolver.step(),!this.activeSection)return;if(this.activeSubSolver.failed){this.failedSubSolvers??=[],this.failedSubSolvers.push(this.activeSubSolver);let s=this.regionAttemptCounts.get(this.activeSection.centralRegionId)??0;return this.regionAttemptCounts.set(this.activeSection.centralRegionId,s+1),this.activeSubSolver=null,this.activeSection=null,this.baselineSectionCost=1/0,void(this.baselineGlobalCost=1/0)}if(!this.activeSubSolver.solved)return;let e=this.activeSubSolver.solvedRoutes,t=this.computeCostOfSection({section:this.activeSection,solvedRoutes:e}),n=((s)=>{let{solvedRoutes:a,section:c,replacementSolvedRoutes:l}=s,h=new Map(l.map((d)=>[d.connection.connectionId,d]));return a.map((d)=>{let u=c.sectionRoutes.find((m)=>m.globalConnection.connectionId===d.connection.connectionId);if(!u)return d;let _=h.get(d.connection.connectionId);if(!_)return d;let p=[...d.path.slice(0,u.sectionStartIndex),..._.path,...d.path.slice(u.sectionEndIndex+1)].map((m)=>({port:m.port,g:m.g,h:m.h,f:m.f,hops:m.hops,ripRequired:m.ripRequired,lastPort:m.lastPort,lastRegion:m.lastRegion,nextRegion:m.nextRegion}));for(let m=0;m<p.length;m++)p[m].parent=m>0?p[m-1]:void 0;return{connection:d.connection,path:p,requiredRip:d.requiredRip||_.requiredRip}})})({solvedRoutes:this.solvedRoutes,section:this.activeSection,replacementSolvedRoutes:e}),o=this.computeSolvedGraphCost(n),r=t<=this.baselineSectionCost,i=o<this.baselineGlobalCost;if(r&&i){this.solvedRoutes=n;let s=this.input.hyperGraphSolver;if(!s)return;s.solvedRoutes=gKe({graph:s.graph,connections:s.connections,solvedRoutes:this.solvedRoutes});for(let a of this.activeSection.sectionRegionIds)this.regionAttemptCounts.set(a,0);this.baselineSectionCost=t,this.baselineGlobalCost=o}else{let s=this.regionAttemptCounts.get(this.activeSection.centralRegionId)??0;this.regionAttemptCounts.set(this.activeSection.centralRegionId,s+1)}this.activeSubSolver=null,this.activeSection=null,this.baselineSectionCost=1/0,this.baselineGlobalCost=1/0}};function WK(e,t){return Array.isArray(t)?[e.a*t[0]+e.c*t[1]+e.e,e.b*t[0]+e.d*t[1]+e.f]:{x:e.a*t.x+e.c*t.y+e.e,y:e.b*t.x+e.d*t.y+e.f}}function UVt(e){return e===void 0}function I3e(e,t=0){return{a:1,c:0,e,b:0,d:1,f:t}}function fKe(...e){let t=(n,o)=>({a:n.a*o.a+n.c*o.b,c:n.a*o.c+n.c*o.d,e:n.a*o.e+n.c*o.f+n.e,b:n.b*o.a+n.d*o.b,d:n.b*o.c+n.d*o.d,f:n.b*o.e+n.d*o.f+n.f});switch((e=Array.isArray(e[0])?e[0]:e).length){case 0:throw Error("no matrices provided");case 1:return e[0];case 2:return t(e[0],e[1]);default:{let[n,o,...r]=e;return fKe(t(n,o),...r)}}}var{cos:Q5r,sin:k5r,PI:LNs}=Math,{tan:HNs}=Math,ZWe=(e)=>({x:(e.minX+e.maxX)/2,y:(e.minY+e.maxY)/2}),aan=(e,t)=>{let n=e.regions.map((s)=>{let{bounds:a,center:c,...l}=s.d,h=[{x:a.minX,y:a.minY},{x:a.maxX,y:a.minY},{x:a.minX,y:a.maxY},{x:a.maxX,y:a.maxY}].map((_)=>WK(t,_)),d={minX:Math.min(...h.map((_)=>_.x)),maxX:Math.max(...h.map((_)=>_.x)),minY:Math.min(...h.map((_)=>_.y)),maxY:Math.max(...h.map((_)=>_.y))},u=WK(t,c);return{...s,ports:[],d:{...l,bounds:d,center:u}}}),o=new Map;for(let s=0;s<e.regions.length;s++)o.set(e.regions[s],n[s]);let r=e.ports.map((s)=>{let a=WK(t,s.d),c=o.get(s.region1),l=o.get(s.region2),h={...s,region1:c,region2:l,d:a};return c.ports.push(h),l.ports.push(h),h}),i=e.jumperLocations?.map((s)=>{let a=WK(t,s.center),c=s.padRegions.map((_)=>o.get(_)),l=WK(t,{x:1,y:0}),h=WK(t,{x:0,y:0}),d=l.x-h.x,u=l.y-h.y;return{center:a,orientation:Math.abs(u)>Math.abs(d)?s.orientation==="horizontal"?"vertical":"horizontal":s.orientation,padRegions:c}});return{regions:n,ports:r,...i&&{jumperLocations:i}}},eXe=(e,t=0.8)=>{let n=0;for(let o=0;o<e.length;o++)n=17777*e.charCodeAt(o)+((n<<5)-n);return`hsla(${Math.abs(n)%360}, 70%, 50%, ${t})`},L5r=(e)=>{let t=((r)=>{let i=((s,a)=>{let c={arrows:[],circles:[],title:"Jumper Graph",lines:[],points:[],rects:[],texts:[],polygons:[],coordinateSystem:"cartesian"};for(let l of s.regions){let{bounds:h,isPad:d,isThroughJumper:u,isConnectionRegion:_,polygon:p}=l.d,m=(h.minX+h.maxX)/2,A=(h.minY+h.maxY)/2,g=h.maxX-h.minX,f=h.maxY-h.minY,y;if(y=_?"rgba(255, 100, 255, 0.6)":u?"rgba(100, 200, 100, 0.5)":d?"rgba(255, 200, 100, 0.5)":"rgba(200, 200, 255, 0.1)",p&&p.length>=3){let x=p;c.polygons.push({points:x,fill:y})}else c.rects.push({center:{x:m,y:A},width:g-0.1,height:f-0.1,fill:y})}if(!a?.hidePortPoints)for(let l of s.ports){let h=l.region1.regionId.split(":").pop()??l.region1.regionId,d=l.region2.regionId.split(":").pop()??l.region2.regionId;c.circles.push({center:{x:l.d.x,y:l.d.y},radius:0.05,fill:"rgba(128, 128, 128, 0.5)",label:`${h}-${d}`})}if(!a?.hideRegionPortLines)for(let l of s.ports){let h={x:(l.region1.d.bounds.minX+l.region1.d.bounds.maxX)/2,y:(l.region1.d.bounds.minY+l.region1.d.bounds.maxY)/2},d={x:(l.region2.d.bounds.minX+l.region2.d.bounds.maxX)/2,y:(l.region2.d.bounds.minY+l.region2.d.bounds.maxY)/2};c.lines.push({points:[h,{x:l.d.x,y:l.d.y},d],strokeColor:"rgba(100, 100, 100, 0.3)"})}if(a?.connections&&!a?.hideConnectionLines)for(let l of a.connections){let{startRegion:h,endRegion:d}=l,u={x:(h.d.bounds.minX+h.d.bounds.maxX)/2,y:(h.d.bounds.minY+h.d.bounds.maxY)/2},_={x:(d.d.bounds.minX+d.d.bounds.maxX)/2,y:(d.d.bounds.minY+d.d.bounds.maxY)/2},p=(u.x+_.x)/2,m=(u.y+_.y)/2;c.lines.push({points:[u,_],strokeColor:"rgba(255, 50, 150, 0.8)",strokeDash:"3 3"}),c.points.push({x:p,y:m,color:"rgba(200, 0, 100, 1)",label:l.connectionId})}return c})(r.graph,{connections:r.connections,...r.hideInitialGeometry?{hideRegionPortLines:!0,hideConnectionLines:!0,hidePortPoints:!0}:{}});if(!r.hideInitialGeometry)for(let s of i.polygons)s.stroke="rgba(128, 128, 128, 0.5)",s.strokeWidth=0.03;r.title&&(i.title=r.title);for(let s of r.priorSolvedRoutes??[]){let a=s.path.map((c)=>{let l=c.port;return{x:l.d.x,y:l.d.y}});a.length!==0&&i.lines.push({points:a,strokeColor:"rgba(80, 80, 80, 0.45)",strokeDash:"4 4"})}for(let s of r.solvedRoutes){let a=eXe(s.connection.connectionId),c=[];for(let l of s.path){let h=l.port;c.push({x:h.d.x,y:h.d.y})}c.length>0&&i.lines.push({points:c,strokeColor:a})}return i})({graph:{regions:e.graph.regions,ports:e.graph.ports},connections:e.connections,solvedRoutes:e.solvedRoutes,hideInitialGeometry:e.iterations>0});if(e.currentConnection&&!e.solved){let r=eXe(e.currentConnection.connectionId),i=e.currentConnection.startRegion,s=e.currentConnection.endRegion;if(!i?.d||!s?.d)return t;let a={x:(i.d.bounds.minX+i.d.bounds.maxX)/2,y:(i.d.bounds.minY+i.d.bounds.maxY)/2},c={x:(s.d.bounds.minX+s.d.bounds.maxX)/2,y:(s.d.bounds.minY+s.d.bounds.maxY)/2};t.lines.push({points:[a,c],strokeColor:r,strokeDash:"10 5"}),t.points.push({x:a.x-0.1,y:a.y+0.1,color:r,label:[e.currentConnection.connectionId,"start"].join(`
`)}),t.points.push({x:c.x-0.1,y:c.y+0.1,color:r,label:[e.currentConnection.connectionId,"end"].join(`
`)})}let n=e.candidateQueue.peekMany(10);for(let r=0;r<n.length;r++){let i=n[r],s=i.port,a=r===0;t.points.push({x:s.d.x,y:s.d.y,color:a?"green":"rgba(128, 128, 128, 0.25)",label:[i.port.portId,`g: ${i.g.toFixed(2)}`,`h: ${i.h.toFixed(2)}`,`f: ${i.f.toFixed(2)}`].join(`
`)})}let o=n[0];if(!e.solved&&o&&e.currentConnection){let r=eXe(e.currentConnection.connectionId),i=[],s=o;for(;s;){let a=s.port;i.unshift({x:a.d.x,y:a.d.y}),s=s.parent}i.length>1&&t.lines.push({points:i,strokeColor:r})}return t},H5r=0.034685181009478865,F5r=0,z5r=4.072520483177124,O5r=0,V5r=35.38577539020022,Y5r=0.5518001238069296,G5r=class extends ran{getSolverName(){return"JumperGraphSolver"}UNIT_OF_COST="hops";portUsagePenalty=H5r;portUsagePenaltySq=F5r;crossingPenalty=z5r;crossingPenaltySq=O5r;ripCost=V5r;baseMaxIterations=4000;additionalMaxIterationsPerConnection=2000;additionalMaxIterationsPerCrossing=2000;constructor(e){super({greedyMultiplier:Y5r,rippingEnabled:!0,...e}),this.ripCost=e.ripCost??this.ripCost,this.portUsagePenalty=e.portUsagePenalty??this.portUsagePenalty,this.crossingPenalty=e.crossingPenalty??this.crossingPenalty,this.baseMaxIterations=e.baseMaxIterations??this.baseMaxIterations,this.additionalMaxIterationsPerConnection=e.additionalMaxIterationsPerConnection??this.additionalMaxIterationsPerConnection;let t=function(n,o){if(o.length<2)return 0;let r=1/0,i=-1/0,s=1/0,a=-1/0;for(let u of n.regions){let _=u;_.d?.bounds?(r=Math.min(r,_.d.bounds.minX),i=Math.max(i,_.d.bounds.maxX),s=Math.min(s,_.d.bounds.minY),a=Math.max(a,_.d.bounds.maxY)):_.d?.center&&(r=Math.min(r,_.d.center.x),i=Math.max(i,_.d.center.x),s=Math.min(s,_.d.center.y),a=Math.max(a,_.d.center.y))}let c=new Map;for(let u of n.regions){let _=u;_.d?.center&&c.set(u.regionId,_.d.center)}let l=[],h=2*(i-r)+2*(a-s);for(let u of o){let _,p;if("startRegion"in u&&u.startRegion){let{startRegion:g,endRegion:f}=u;_=g.d?.center,p=f.d?.center}else"startRegionId"in u&&(_=c.get(u.startRegionId),p=c.get(u.endRegionId));if(!_||!p)continue;let m=AKe(_,r,i,s,a),A=AKe(p,r,i,s,a);l.push([m,A])}let d=0;for(let u=0;u<l.length;u++)for(let _=u+1;_<l.length;_++)JWe(l[u],l[_],h)&&d++;return d}(this.graph,e.inputConnections);this.MAX_ITERATIONS=this.baseMaxIterations+e.inputConnections.length*this.additionalMaxIterationsPerConnection+t*this.additionalMaxIterationsPerCrossing,this.populateDistanceToEndMaps()}populateDistanceToEndMaps(){let e=new Set(this.connections.map((t)=>t.endRegion));for(let t of e){let n=new Map,o=[];for(n.set(t.regionId,0),o.push({region:t,distance:0});o.length>0;){let{region:r,distance:i}=o.shift();for(let s of r.ports){let a=s.region1===r?s.region2:s.region1;n.has(a.regionId)||(n.set(a.regionId,i+1),o.push({region:a,distance:i+1}))}}for(let r of this.graph.ports){r.distanceToEndMap||(r.distanceToEndMap={});let i=n.get(r.region1.regionId)??1/0,s=n.get(r.region2.regionId)??1/0;r.distanceToEndMap[t.regionId]=Math.min(i,s)}}}estimateCostToEnd(e){let t=this.currentEndRegion.regionId;return e.distanceToEndMap[t]}getPortUsagePenalty(e){let t=e.ripCount??0;return t*this.portUsagePenalty+t*this.portUsagePenaltySq}isTransitionAllowed(e,t,n){if(!e.d.isPad)return!0;let o=(r)=>{let i=r.region1===e?r.region2:r.region1;return Boolean(i.d.isThroughJumper)};return o(t)||o(n)}computeIncreasedRegionCostIfPortsAreUsed(e,t,n){if(e.d.isPad){let r=(e.assignments??[]).filter((i)=>i.connection.mutuallyConnectedNetworkId!==this.currentConnection.mutuallyConnectedNetworkId).length;return r>0?r*this.crossingPenalty+r*this.crossingPenaltySq:0}let o=function(r,i,s){let a=FVt(r),c=[kR(i,r),kR(s,r)],l=0,h=r.assignments??[];for(let d of h)JWe(c,[kR(d.regionPort1,r),kR(d.regionPort2,r)],a)&&l++;return l}(e,t,n);return o*this.crossingPenalty+o*this.crossingPenaltySq}getRipsRequiredForPortUsage(e,t,n){if(e.d.isPad)return(e.assignments??[]).filter((i)=>i.connection.mutuallyConnectedNetworkId!==this.currentConnection.mutuallyConnectedNetworkId);let o=function(i,s,a){let c=FVt(i),l=[kR(s,i),kR(a,i)],h=[],d=i.assignments??[];for(let u of d)JWe(l,[kR(u.regionPort1,i),kR(u.regionPort2,i)],c)&&h.push(u);return h}(e,t,n),r=o.filter((i)=>i.connection.mutuallyConnectedNetworkId!==this.currentConnection.mutuallyConnectedNetworkId);if(!e.d.isThroughJumper)return r;for(let i of e.assignments??[])i.connection.mutuallyConnectedNetworkId!==this.currentConnection.mutuallyConnectedNetworkId&&r.push(i);return r}isRipRequiredForPortUsage(e,t,n){if(!e.d.isThroughJumper&&!e.d.isPad)return!1;for(let o of e.assignments??[])if(o.connection.mutuallyConnectedNetworkId!==this.currentConnection.mutuallyConnectedNetworkId)return!0;return!1}routeSolvedHook(e){}routeStartedHook(e){}visualize(){return L5r(this)}},U5r={padWidth:0.8,outerPadHeight:0.5,innerPadHeight:0.4,leftPadCenterX:-0.9,rightPadCenterX:0.9,row1CenterY:-1.2,row2CenterY:-0.4,row3CenterY:0.4,row4CenterY:1.2},W5r=({cols:e,rows:t,marginX:n,marginY:o,innerColChannelPointCount:r=1,innerRowChannelPointCount:i=1,regionsBetweenPads:s=!1,outerPaddingX:a=0.5,outerPaddingY:c=0.5,outerChannelXPointCount:l,outerChannelYPointCount:h,orientation:d="vertical",center:u,bounds:_,parallelTracesUnderJumperCount:p=2})=>{let m=[],A=[],{padWidth:g,outerPadHeight:f,innerPadHeight:y,leftPadCenterX:x,rightPadCenterX:C,row1CenterY:b,row2CenterY:I,row3CenterY:v,row4CenterY:P}=U5r,M=g/2,B=f/2,T=y/2,N=C-x+g,D=N+n,L=P-b+f,H=L+o,V=a,O=c;if(_){let re=e*N+(e-1)*n,Z=t*L+(t-1)*o;V=((d==="horizontal"?_.maxY-_.minY:_.maxX-_.minX)-re)/2,O=((d==="horizontal"?_.maxX-_.minX:_.maxY-_.minY)-Z)/2}let U=l??Math.max(1,Math.floor(V/0.4)),j=h??Math.max(1,Math.floor(O/0.4)),Y=[],X=[],K=(re,Z,te,ie)=>({regionId:re,ports:[],d:{bounds:Z,center:ZWe(Z),isPad:te,isThroughJumper:ie}}),J=(re,Z,te)=>{let ie=Z.d.bounds,ce=te.d.bounds,ue,de;Math.abs(ie.maxX-ce.minX)<0.001?(ue=ie.maxX,de=(Math.max(ie.minY,ce.minY)+Math.min(ie.maxY,ce.maxY))/2):Math.abs(ie.minX-ce.maxX)<0.001?(ue=ie.minX,de=(Math.max(ie.minY,ce.minY)+Math.min(ie.maxY,ce.maxY))/2):Math.abs(ie.maxY-ce.minY)<0.001?(ue=(Math.max(ie.minX,ce.minX)+Math.min(ie.maxX,ce.maxX))/2,de=ie.maxY):(ue=(Math.max(ie.minX,ce.minX)+Math.min(ie.maxX,ce.maxX))/2,de=ie.minY);let me={portId:re,region1:Z,region2:te,d:{x:ue,y:de}};return Z.ports.push(me),te.ports.push(me),me},ee=(re,Z,te,ie)=>{if(ie<=0)return[];if(ie===1)return[J(re,Z,te)];let ce=Z.d.bounds,ue=te.d.bounds,de=[],me,ge,xe,Ee;Math.abs(ce.maxX-ue.minX)<0.001?(me=!0,ge=ce.maxX,xe=Math.max(ce.minY,ue.minY),Ee=Math.min(ce.maxY,ue.maxY)):Math.abs(ce.minX-ue.maxX)<0.001?(me=!0,ge=ce.minX,xe=Math.max(ce.minY,ue.minY),Ee=Math.min(ce.maxY,ue.maxY)):Math.abs(ce.maxY-ue.minY)<0.001?(me=!1,ge=ce.maxY,xe=Math.max(ce.minX,ue.minX),Ee=Math.min(ce.maxX,ue.maxX)):(me=!1,ge=ce.minY,xe=Math.max(ce.minX,ue.minX),Ee=Math.min(ce.maxX,ue.maxX));for(let Re=0;Re<ie;Re++){let Me=xe+(Re+0.5)/ie*(Ee-xe),_e={portId:`${re}:${Re}`,region1:Z,region2:te,d:{x:me?ge:Me,y:me?Me:ge}};Z.ports.push(_e),te.ports.push(_e),de.push(_e)}return de};for(let re=0;re<t;re++){Y[re]=[];for(let Z=0;Z<e;Z++){let te=`cell_${re}_${Z}`,ie=Z*D,ce=-re*H,ue=ie+x,de=ce+b,me=ie+x,ge=ce+I,xe=ie+x,Ee=ce+v,Re=ie+x,Me=ce+P,_e=ie+C,ye=ce+P,Se=ie+C,Ne=ce+v,Le=ie+C,nt=ce+I,dt=ie+C,rt=ce+b,pt=(Lo,Gi,bi)=>({minX:Lo-M,maxX:Lo+M,minY:Gi-bi,maxY:Gi+bi}),ct=pt(ue,de,B),Ct=pt(me,ge,T),kt=pt(xe,Ee,T),Lt=pt(Re,Me,B),Bt=pt(_e,ye,B),xt=pt(Se,Ne,T),Yt=pt(Le,nt,T),ut=pt(dt,rt,B),Ze={minX:ct.maxX,maxX:ut.minX,minY:ct.minY,maxY:Lt.maxY},tt={minX:ue,maxX:dt,minY:de-0.15,maxY:de+0.15},Je={minX:me,maxX:Le,minY:ge-0.15,maxY:ge+0.15},$e={minX:xe,maxX:Se,minY:Ee-0.15,maxY:Ee+0.15},ft={minX:Re,maxX:_e,minY:Me-0.15,maxY:Me+0.15},vt=ct.minX,Ye=ut.maxX,je=ct.minY,st=Lt.maxY,St=K(`${te}:pad1`,ct,!0),Nt=K(`${te}:pad2`,Ct,!0),Ot=K(`${te}:pad3`,kt,!0),Ut=K(`${te}:pad4`,Lt,!0),mn=K(`${te}:pad5`,Bt,!0),_n=K(`${te}:pad6`,xt,!0),En=K(`${te}:pad7`,Yt,!0),Qn=K(`${te}:pad8`,ut,!0),ln=K(`${te}:underjumper`,Ze,!1),hn=K(`${te}:throughjumper1`,tt,!1,!0),Zn=K(`${te}:throughjumper2`,Je,!1,!0),bo=K(`${te}:throughjumper3`,$e,!1,!0),ir=K(`${te}:throughjumper4`,ft,!1,!0);m.push(St,Nt,Ot,Ut,mn,_n,En,Qn,ln,hn,Zn,bo,ir);let gt=(ue+dt)/2,Oe=(de+Me)/2;X.push({center:{x:gt,y:Oe},orientation:"vertical",padRegions:[St,Nt,Ot,Ut,mn,_n,En,Qn]});let mt=null,It=null,bt=null,cn=null,dn=null,wn=null;s&&(mt=K(`${te}:L-BP12`,{minX:ct.minX,maxX:ct.maxX,minY:ct.maxY,maxY:Ct.minY},!1),It=K(`${te}:L-BP23`,{minX:Ct.minX,maxX:Ct.maxX,minY:Ct.maxY,maxY:kt.minY},!1),bt=K(`${te}:L-BP34`,{minX:kt.minX,maxX:kt.maxX,minY:kt.maxY,maxY:Lt.minY},!1),cn=K(`${te}:R-BP87`,{minX:ut.minX,maxX:ut.maxX,minY:ut.maxY,maxY:Yt.minY},!1),dn=K(`${te}:R-BP76`,{minX:Yt.minX,maxX:Yt.maxX,minY:Yt.maxY,maxY:xt.minY},!1),wn=K(`${te}:R-BP65`,{minX:xt.minX,maxX:xt.maxX,minY:xt.maxY,maxY:Bt.minY},!1),m.push(mt,It,bt,cn,dn,wn));let eo=Z===0,_o=re===t-1,$n=Z===e-1,qn;if($n)qn=Ye+V;else qn=(Z+1)*D+x-M;let Po=null;re===0&&(Po=K(`${te}:T`,{minX:eo?vt-V:vt,maxX:qn,minY:st,maxY:st+O},!1),m.push(Po));let To=null;To=K(`${te}:B`,{minX:eo?vt-V:vt,maxX:qn,minY:je-(_o?O:o),maxY:je},!1),m.push(To);let Tn=null;eo&&(Tn=K(`${te}:L`,{minX:vt-V,maxX:vt,minY:je,maxY:st},!1),m.push(Tn));let lo=K(`${te}:R`,{minX:Ye,maxX:qn,minY:je,maxY:st},!1);if(m.push(lo),Y[re][Z]={pad1:St,pad2:Nt,pad3:Ot,pad4:Ut,pad5:mn,pad6:_n,pad7:En,pad8:Qn,underjumper:ln,throughjumper1:hn,throughjumper2:Zn,throughjumper3:bo,throughjumper4:ir,top:Po,bottom:To,left:Tn,right:lo,leftBP12:mt,leftBP23:It,leftBP34:bt,rightBP87:cn,rightBP76:dn,rightBP65:wn},Po)if(Tn&&A.push(...ee(`${te}:T-L`,Po,Tn,U)),A.push(...ee(`${te}:T-R`,Po,lo,$n?U:r)),A.push(J(`${te}:T-P4`,Po,Ut)),A.push(J(`${te}:T-P5`,Po,mn)),s){let Lo=ln.d.bounds,Gi=(Lo.maxX-Lo.minX)/(p+1);for(let bi=1;bi<=p;bi++){let os={portId:`${te}:T-UJ${bi}`,region1:Po,region2:ln,d:{x:Lo.minX+Gi*bi,y:Lo.maxY}};Po.ports.push(os),ln.ports.push(os),A.push(os)}}else A.push(J(`${te}:T-UJ`,Po,ln));if(To)if(Tn&&A.push(...ee(`${te}:B-L`,To,Tn,U)),A.push(...ee(`${te}:B-R`,To,lo,$n?U:r)),A.push(J(`${te}:B-P1`,To,St)),A.push(J(`${te}:B-P8`,To,Qn)),s){let Lo=ln.d.bounds,Gi=(Lo.maxX-Lo.minX)/(p+1);for(let bi=1;bi<=p;bi++){let os={portId:`${te}:B-UJ${bi}`,region1:To,region2:ln,d:{x:Lo.minX+Gi*bi,y:Lo.minY}};To.ports.push(os),ln.ports.push(os),A.push(os)}}else A.push(J(`${te}:B-UJ`,To,ln));Tn&&(A.push(J(`${te}:L-P1`,Tn,St)),A.push(J(`${te}:L-P2`,Tn,Nt)),A.push(J(`${te}:L-P3`,Tn,Ot)),A.push(J(`${te}:L-P4`,Tn,Ut))),A.push(J(`${te}:R-P5`,lo,mn)),A.push(J(`${te}:R-P6`,lo,_n)),A.push(J(`${te}:R-P7`,lo,En)),A.push(J(`${te}:R-P8`,lo,Qn)),s&&(Tn&&(A.push(J(`${te}:L-BP12`,Tn,mt)),A.push(J(`${te}:L-BP23`,Tn,It)),A.push(J(`${te}:L-BP34`,Tn,bt))),A.push(J(`${te}:UJ-LBP12`,mt,ln)),A.push(J(`${te}:UJ-LBP23`,It,ln)),A.push(J(`${te}:UJ-LBP34`,bt,ln)),A.push(J(`${te}:R-BP87`,lo,cn)),A.push(J(`${te}:R-BP76`,lo,dn)),A.push(J(`${te}:R-BP65`,lo,wn)),A.push(J(`${te}:UJ-RBP87`,cn,ln)),A.push(J(`${te}:UJ-RBP76`,dn,ln)),A.push(J(`${te}:UJ-RBP65`,wn,ln)));let fo={portId:`${te}:TJ1-P1`,region1:hn,region2:St,d:{x:ue,y:de}};hn.ports.push(fo),St.ports.push(fo),A.push(fo);let oo={portId:`${te}:TJ1-P8`,region1:hn,region2:Qn,d:{x:dt,y:rt}};hn.ports.push(oo),Qn.ports.push(oo),A.push(oo);let Ro={portId:`${te}:TJ2-P2`,region1:Zn,region2:Nt,d:{x:me,y:ge}};Zn.ports.push(Ro),Nt.ports.push(Ro),A.push(Ro);let or={portId:`${te}:TJ2-P7`,region1:Zn,region2:En,d:{x:Le,y:nt}};Zn.ports.push(or),En.ports.push(or),A.push(or);let Er={portId:`${te}:TJ3-P3`,region1:bo,region2:Ot,d:{x:xe,y:Ee}};bo.ports.push(Er),Ot.ports.push(Er),A.push(Er);let Xi={portId:`${te}:TJ3-P6`,region1:bo,region2:_n,d:{x:Se,y:Ne}};bo.ports.push(Xi),_n.ports.push(Xi),A.push(Xi);let Ys={portId:`${te}:TJ4-P4`,region1:ir,region2:Ut,d:{x:Re,y:Me}};ir.ports.push(Ys),Ut.ports.push(Ys),A.push(Ys);let aa={portId:`${te}:TJ4-P5`,region1:ir,region2:mn,d:{x:_e,y:ye}};if(ir.ports.push(aa),mn.ports.push(aa),A.push(aa),Z>0){let Lo=Y[re][Z-1];A.push(J(`cell_${re}_${Z-1}->cell_${re}_${Z}:R-P1`,Lo.right,St)),A.push(J(`cell_${re}_${Z-1}->cell_${re}_${Z}:R-P2`,Lo.right,Nt)),A.push(J(`cell_${re}_${Z-1}->cell_${re}_${Z}:R-P3`,Lo.right,Ot)),A.push(J(`cell_${re}_${Z-1}->cell_${re}_${Z}:R-P4`,Lo.right,Ut)),s&&(A.push(J(`cell_${re}_${Z-1}->cell_${re}_${Z}:R-LBP12`,Lo.right,mt)),A.push(J(`cell_${re}_${Z-1}->cell_${re}_${Z}:R-LBP23`,Lo.right,It)),A.push(J(`cell_${re}_${Z-1}->cell_${re}_${Z}:R-LBP34`,Lo.right,bt))),Po&&Lo.top&&A.push(...ee(`cell_${re}_${Z-1}->cell_${re}_${Z}:T-T`,Lo.top,Po,j)),To&&Lo.bottom&&A.push(...ee(`cell_${re}_${Z-1}->cell_${re}_${Z}:B-B`,Lo.bottom,To,_o?j:i))}if(re>0){let Lo=Y[re-1][Z];if(Tn&&A.push(...ee(`cell_${re-1}_${Z}->cell_${re}_${Z}:B-L`,Lo.bottom,Tn,U)),A.push(J(`cell_${re-1}_${Z}->cell_${re}_${Z}:B-P4`,Lo.bottom,Ut)),s){let Gi=ln.d.bounds,bi=(Gi.maxX-Gi.minX)/(p+1);for(let os=1;os<=p;os++){let Lc=Gi.minX+bi*os,dl={portId:`cell_${re-1}_${Z}->cell_${re}_${Z}:B-UJ${os}`,region1:Lo.bottom,region2:ln,d:{x:Lc,y:Gi.maxY}};Lo.bottom.ports.push(dl),ln.ports.push(dl),A.push(dl)}}else A.push(J(`cell_${re-1}_${Z}->cell_${re}_${Z}:B-UJ`,Lo.bottom,ln));A.push(J(`cell_${re-1}_${Z}->cell_${re}_${Z}:B-P5`,Lo.bottom,mn)),A.push(...ee(`cell_${re-1}_${Z}->cell_${re}_${Z}:B-R`,Lo.bottom,lo,$n?U:r))}}}let se={regions:m,ports:A,jumperLocations:X},ne=d==="horizontal";if(ne||u!==void 0||_!==void 0){let re=san(se.regions),Z=ZWe(re),te=[],ie;ie=u||(_?ZWe(_):Z),te.push(I3e(ie.x,ie.y)),ne&&te.push(function(ue,de,me){let ge=Q5r(ue),xe=k5r(ue),Ee={a:ge,c:-xe,e:0,b:xe,d:ge,f:0};return UVt(de)||UVt(me)?Ee:fKe([I3e(de,me),Ee,I3e(-de,-me)])}(-Math.PI/2)),te.push(I3e(-Z.x,-Z.y));let ce=function(...ue){return fKe(...ue)}(...te);se=aan(se,ce)}return se},can=!0,vce={CCW:-1,CW:1,NOT_ORIENTABLE:0},X5r=2*Math.PI,tbe=Object.freeze({__proto__:null,BOUNDARY:2,CCW:can,CONTAINS:3,CW:!1,END_VERTEX:2,INSIDE:1,INTERLACE:4,NOT_VERTEX:0,ORIENTATION:vce,OUTSIDE:0,OVERLAP_OPPOSITE:2,OVERLAP_SAME:1,PIx2:X5r,START_VERTEX:1}),uS=0.000001;function lan(e){uS=e}function han(){return uS}function yKe(e){return e<uS&&e>-uS}function uV(e,t){return e-t<uS&&e-t>-uS}function dan(e,t){return e-t>uS}function uan(e,t){return e-t<-uS}var We={Utils:Object.freeze({__proto__:null,DECIMALS:3,EQ:uV,EQ_0:yKe,GE:function(e,t){return e-t>-uS},GT:dan,LE:function(e,t){return e-t<uS},LT:uan,getTolerance:han,setTolerance:lan}),Errors:void 0,Matrix:void 0,Planar_set:void 0,Point:void 0,Vector:void 0,Line:void 0,Circle:void 0,Segment:void 0,Arc:void 0,Box:void 0,Edge:void 0,Face:void 0,Ray:void 0,Ray_shooting:void 0,Multiline:void 0,Polygon:void 0,Distance:void 0,Inversion:void 0};for(let e in tbe)We[e]=tbe[e];Object.defineProperty(We,"DP_TOL",{get:function(){return han()},set:function(e){lan(e)}});var zu=class{static get ILLEGAL_PARAMETERS(){return ReferenceError("Illegal Parameters")}static get ZERO_DIVISION(){return Error("Zero division")}static get UNRESOLVED_BOUNDARY_CONFLICT(){return Error("Unresolved boundary conflict in boolean operation")}static get INFINITE_LOOP(){return Error("Infinite loop")}static get CANNOT_COMPLETE_BOOLEAN_OPERATION(){return Error("Cannot complete boolean operation")}static get CANNOT_INVOKE_ABSTRACT_METHOD(){return Error("Abstract method cannot be invoked")}static get OPERATION_IS_NOT_SUPPORTED(){return Error("Operation is not supported")}static get UNSUPPORTED_SHAPE_TYPE(){return Error("Unsupported shape type")}};We.Errors=zu;var qJe=class{constructor(e,t){this.first=e,this.last=t||this.first}[Symbol.iterator](){let e;return{next:()=>(e=e?e.next:this.first,{value:e,done:e===void 0})}}get size(){let e=0;for(let t of this)e++;return e}toArray(e=void 0,t=void 0){let n=[],o=e||this.first,r=t||this.last,i=o;if(i===void 0)return n;do n.push(i),i=i.next;while(i!==r.next);return n}append(e){return this.isEmpty()?this.first=e:(e.prev=this.last,this.last.next=e),this.last=e,this.last.next=void 0,this.first.prev=void 0,this}insert(e,t){if(this.isEmpty())this.first=e,this.last=e;else if(t==null)e.next=this.first,this.first.prev=e,this.first=e;else{let n=t.next;t.next=e,n&&(n.prev=e),e.prev=t,e.next=n,this.last===t&&(this.last=e)}return this.last.next=void 0,this.first.prev=void 0,this}remove(e){return e===this.first&&e===this.last?(this.first=void 0,this.last=void 0):(e.prev&&(e.prev.next=e.next),e.next&&(e.next.prev=e.prev),e===this.first&&(this.first=e.next),e===this.last&&(this.last=e.prev)),this}isEmpty(){return this.first===void 0}static testInfiniteLoop(e){let t=e,n=e;do{if(t!=e&&t===n)throw zu.INFINITE_LOOP;t=t.next,n=n.next.next}while(t!=e)}},WVt={stroke:"black"},j5r=class{constructor(e=WVt){for(let t in e)this[t]=e[t];this.stroke=e.stroke??WVt.stroke}toAttributesString(){return Object.keys(this).reduce((e,t)=>e+(this[t]!==void 0?this.toAttrString(t,this[t]):""),"")}toAttrString(e,t){let n=e==="className"?"class":this.convertCamelToKebabCase(e);return t===null?`${n} `:`${n}="${t.toString()}" `}convertCamelToKebabCase(e){return e.match(/[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[0-9]+/g).join("-").toLowerCase()}};function wV(e){return new j5r(e).toAttributesString()}function Hq(e,t){let n=[],[o,r,i]=e.standard,[s,a,c]=t.standard,l=o*a-r*s,h=i*a-r*c,d=o*c-i*s;if(!We.Utils.EQ_0(l)){let u,_;r===0?(u=i/o,_=d/l):a===0?(u=c/s,_=d/l):o===0?(u=h/l,_=i/r):s===0?(u=h/l,_=c/a):(u=h/l,_=d/l),n.push(new We.Point(u,_))}return n}function BV(e,t){let n=[],o=t.pc.projectionOn(e),r=t.pc.distanceTo(o)[0];if(We.Utils.EQ(r,t.r))n.push(o);else if(We.Utils.LT(r,t.r)){let i,s,a=Math.sqrt(t.r*t.r-r*r);i=e.norm.rotate90CCW().multiply(a),s=o.translate(i),n.push(s),i=e.norm.rotate90CW().multiply(a),s=o.translate(i),n.push(s)}return n}function gq(e,t){let n=[];for(let o of t.toSegments()){let r=Hle(o,e);for(let i of r)xan(i,n)||n.push(i)}return n}function _6e(e,t){let n=[];if(gq(e,t.box).length===0)return n;let o=BV(e,new We.Circle(t.pc,t.r));for(let r of o)r.on(t)&&n.push(r);return n}function Hle(e,t){let n=[];return e.ps.on(t)&&n.push(e.ps),e.pe.on(t)&&!e.isZeroLength()&&n.push(e.pe),n.length>0||e.isZeroLength()||e.ps.leftTo(t)&&e.pe.leftTo(t)||!e.ps.leftTo(t)&&!e.pe.leftTo(t)?n:Hq(new We.Line(e.ps,e.pe),t)}function nbe(e,t){let n=[];if(e.isZeroLength())return e.ps.on(t)&&n.push(e.ps),n;if(t.isZeroLength())return t.ps.on(e)&&n.push(t.ps),n;let o=new We.Line(e.ps,e.pe),r=new We.Line(t.ps,t.pe);if(o.incidentTo(r))e.ps.on(t)&&n.push(e.ps),e.pe.on(t)&&n.push(e.pe),!t.ps.on(e)||t.ps.equalTo(e.ps)||t.ps.equalTo(e.pe)||n.push(t.ps),!t.pe.on(e)||t.pe.equalTo(e.ps)||t.pe.equalTo(e.pe)||n.push(t.pe);else{let i=Hq(o,r);i.length>0&&XVt(i[0],e)&&XVt(i[0],t)&&n.push(i[0])}return n}function XVt(e,t){let n=t.box;return We.Utils.LE(e.x,n.xmax)&&We.Utils.GE(e.x,n.xmin)&&We.Utils.LE(e.y,n.ymax)&&We.Utils.GE(e.y,n.ymin)}function obe(e,t){let n=[];if(e.isZeroLength()){let[r,i]=e.ps.distanceTo(t.pc);return We.Utils.EQ(r,t.r)&&n.push(e.ps),n}let o=BV(new We.Line(e.ps,e.pe),t);for(let r of o)r.on(e)&&n.push(r);return n}function Aq(e,t){let n=[];if(e.isZeroLength())return e.ps.on(t)&&n.push(e.ps),n;let o=BV(new We.Line(e.ps,e.pe),new We.Circle(t.pc,t.r));for(let r of o)r.on(e)&&r.on(t)&&n.push(r);return n}function pan(e,t){let n=[],o=new We.Vector(e.pc,t.pc),r=e.r,i=t.r;if(We.Utils.EQ_0(r)||We.Utils.EQ_0(i))return n;if(We.Utils.EQ_0(o.x)&&We.Utils.EQ_0(o.y)&&We.Utils.EQ(r,i))return n.push(e.pc.translate(-r,0)),n;let s,a=e.pc.distanceTo(t.pc)[0];if(We.Utils.GT(a,r+i))return n;if(We.Utils.LT(a,Math.abs(r-i)))return n;if(o.x/=a,o.y/=a,We.Utils.EQ(a,r+i)||We.Utils.EQ(a,Math.abs(r-i)))return s=e.pc.translate(r*o.x,r*o.y),n.push(s),n;let c=r*r/(2*a)-i*i/(2*a)+a/2,l=e.pc.translate(c*o.x,c*o.y),h=Math.sqrt(r*r-c*c);return s=l.translate(o.rotate90CCW().multiply(h)),n.push(s),s=l.translate(o.rotate90CW().multiply(h)),n.push(s),n}function man(e,t){let n=[];if(e.pc.equalTo(t.pc)&&We.Utils.EQ(e.r,t.r)){let s;return s=e.start,s.on(t)&&n.push(s),s=e.end,s.on(t)&&n.push(s),s=t.start,s.on(e)&&n.push(s),s=t.end,s.on(e)&&n.push(s),n}let o=new We.Circle(e.pc,e.r),r=new We.Circle(t.pc,t.r),i=o.intersect(r);for(let s of i)s.on(e)&&s.on(t)&&n.push(s);return n}function JJe(e,t){let n=[];if(t.pc.equalTo(e.pc)&&We.Utils.EQ(t.r,e.r))return n.push(e.start),n.push(e.end),n;let o=pan(t,new We.Circle(e.pc,e.r));for(let r of o)r.on(e)&&n.push(r);return n}function _an(e,t){return e.isSegment?nbe(e.shape,t):Aq(t,e.shape)}function gan(e,t){return e.isSegment?Aq(e.shape,t):man(e.shape,t)}function Aan(e,t){return e.isSegment?Hle(e.shape,t):_6e(t,e.shape)}function K5r(e,t){return e.isSegment?obe(e.shape,t):JJe(e.shape,t)}function ZJe(e,t){let n=[];for(let o of t.edges)for(let r of _an(o,e))n.push(r);return n}function eZe(e,t){let n=[];for(let o of t.edges)for(let r of gan(o,e))n.push(r);return n}function Fle(e,t){let n=[];if(t.isEmpty())return n;for(let o of t.edges)for(let r of Aan(o,e))xan(r,n)||n.push(r);return e.sortPoints(n)}function fan(e,t){let n=[];if(t.isEmpty())return n;for(let o of t.edges)for(let r of K5r(o,e))n.push(r);return n}function yan(e,t){return e.isSegment?_an(t,e.shape):e.isArc?gan(t,e.shape):e.isLine?Aan(t,e.shape):e.isRay?(n=t,o=e.shape,n.isSegment?tZe(o,n.shape):nZe(o,n.shape)):[];var n,o}function jVt(e,t){let n=[];if(t.isEmpty()||e.shape.box.not_intersect(t.box))return n;let o=t.edges.search(e.shape.box);for(let r of o)n=[...n,...yan(e,r)];return n}function xan(e,t){return t.some((n)=>n.equalTo(e))}function dQ(e){return new We.Line(e.start,e.norm)}function tZe(e,t){return Hle(t,dQ(e)).filter((n)=>e.contains(n))}function nZe(e,t){return _6e(dQ(e),t).filter((n)=>e.contains(n))}function Can(e,t){return BV(dQ(e),t).filter((n)=>e.contains(n))}function ban(e,t){return Hq(dQ(e),t).filter((n)=>e.contains(n))}function Ian(e,t){return Fle(dQ(e),t).filter((n)=>e.contains(n))}function van(e,t){if(e.intersect&&e.intersect instanceof Function)return e.intersect(t);throw zu.UNSUPPORTED_SHAPE_TYPE}function Fq(e,t){let n=[];for(let o of t)n=[...n,...van(e,o.shape)];return n}var UO=class e extends qJe{constructor(...t){if(super(),this.isInfinite=!1,t.length===1&&t[0]instanceof Array&&t[0].length>0){let n=t[0],o=n.length,r=(s)=>s instanceof We.Segment||s instanceof We.Arc||s instanceof We.Ray,i=(s)=>s instanceof We.Segment||s instanceof We.Arc;if(!(o===1&&((s)=>s instanceof We.Segment||s instanceof We.Arc||s instanceof We.Ray||s instanceof We.Line)(n[0])||o>1&&r(n[0])&&r(n[o-1])&&n.slice(1,o-1).every(i)))throw We.Errors.ILLEGAL_PARAMETERS;this.isInfinite=n.some((s)=>s instanceof We.Ray||s instanceof We.Line);for(let s of n){let a=new We.Edge(s);this.append(a)}this.setArcLength()}}get edges(){return[...this]}get box(){return this.edges.reduce((t,n)=>t.merge(n.box),new We.Box)}get vertices(){let t=this.edges.map((n)=>n.start);return t.push(this.last.end),t}get length(){if(this.isEmpty())return 0;if(this.isInfinite)return Number.POSITIVE_INFINITY;let t=0;for(let n of this)t+=n.length;return t}clone(){return new e(this.toShapes())}setArcLength(){for(let t of this)this.setOneEdgeArcLength(t)}setOneEdgeArcLength(t){t===this.first?t.arc_length=0:t.arc_length=t.prev.arc_length+t.prev.length}pointAtLength(t){if(t>this.length||t<0)return null;if(this.isInfinite)return null;let n=null;for(let o of this)if(t>=o.arc_length&&(o===this.last||t<o.next.arc_length)){n=o.pointAtLength(t-o.arc_length);break}return n}addVertex(t,n){let o=n.shape.split(t);if(o[0]===null)return n.prev;if(o[1]===null)return n;let r=new We.Edge(o[0]),i=n.prev;return this.insert(r,i),n.shape=o[1],r}getChain(t,n){let o=[];for(let r=t;r!==n.next;r=r.next)o.push(r);return o}split(t){for(let n of t){let o=this.findEdgeByPoint(n);this.addVertex(n,o)}return this}findEdgeByPoint(t){let n;for(let o of this)if(o.shape.contains(t)){n=o;break}return n}distanceTo(t){if(t instanceof Point){let[n,o]=We.Distance.shape2multiline(t,this);return[n,o.reverse()]}if(t instanceof We.Line){let[n,o]=We.Distance.shape2multiline(t,this);return[n,o.reverse()]}if(t instanceof We.Circle){let[n,o]=We.Distance.shape2multiline(t,this);return[n,o.reverse()]}if(t instanceof We.Segment){let[n,o]=We.Distance.shape2multiline(t,this);return[n,o.reverse()]}if(t instanceof We.Arc){let[n,o]=We.Distance.shape2multiline(t,this);return[n,o.reverse()]}if(t instanceof We.Multiline)return We.Distance.multiline2multiline(this,t);throw We.Errors.UNSUPPORTED_SHAPE_TYPE}intersect(t){return t instanceof We.Multiline?function(n,o){let r=[];for(let i of n)for(let s of o)r=[...r,...van(i.shape,s.shape)];return r}(this,t):Fq(t,this)}contains(t){if(t instanceof We.Point)return this.edges.some((n)=>n.shape.contains(t));throw We.Errors.UNSUPPORTED_SHAPE_TYPE}translate(t){return new e(this.edges.map((n)=>n.shape.translate(t)))}rotate(t=0,n=new We.Point){return new e(this.edges.map((o)=>o.shape.rotate(t,n)))}transform(t=new We.Matrix){return new e(this.edges.map((n)=>n.shape.transform(t)))}toShapes(){return this.edges.map((t)=>t.shape.clone())}toJSON(){return this.edges.map((t)=>t.toJSON())}svgPoints(){return this.vertices.map((t)=>`${t.x},${t.y}`).join(" ")}dpath(){let t=`M${this.first.start.x},${this.first.start.y}`;for(let n of this)t+=n.svg();return t}svg(t={}){let n=`
<path ${wV({fill:"none",...t})} d="`;n+=`
M${this.first.start.x},${this.first.start.y}`;for(let o of this)n+=o.svg();return n+=`" >
</path>`,n}};We.Multiline=UO;function fq(e,t,n){let o=n.length,r=e.shape.split(t);if(r.length===0)return;let i=0;i=r[0]===null?0:r[1]===null?e.shape.length:r[0].length;let s,a=0;uV(i,0)&&(a|=1),uV(i,e.shape.length)&&(a|=2),s=i===1/0?r[0].coord(t):2&a&&e.next&&e.next.arc_length===0?0:e.arc_length+i,n.push({id:o,pt:t,arc_length:s,edge_before:e,edge_after:void 0,face:e.face,is_vertex:a})}function cle(e){e.int_points1_sorted=jR(e.int_points1),e.int_points2_sorted=jR(e.int_points2)}function jR(e){let t=new Map,n=0;for(let o of e)t.has(o.face)||(t.set(o.face,n),n++);for(let o of e)o.faceId=t.get(o.face);return e.slice().sort($5r)}function $5r(e,t){return e.faceId<t.faceId?-1:e.faceId>t.faceId?1:e.arc_length<t.arc_length?-1:e.arc_length>t.arc_length?1:0}function oZe(e){if(e.int_points1.length<2)return;let t,n,o,r,i=!1;for(let s=0;s<e.int_points1_sorted.length;s++)if(e.int_points1_sorted[s].id!==-1){t=e.int_points1_sorted[s],n=e.int_points2[t.id];for(let a=s+1;a<e.int_points1_sorted.length&&(o=e.int_points1_sorted[a],uV(o.arc_length,t.arc_length));a++)o.id!==-1&&(r=e.int_points2[o.id],r.id!==-1&&o.edge_before===t.edge_before&&o.edge_after===t.edge_after&&r.edge_before===n.edge_before&&r.edge_after===n.edge_after&&(o.id=-1,r.id=-1,i=!0))}n=e.int_points2_sorted[0],t=e.int_points1[n.id];for(let s=1;s<e.int_points2_sorted.length;s++){let a=e.int_points2_sorted[s];if(a.id===-1)continue;if(n.id===-1||!uV(a.arc_length,n.arc_length)){n=a,t=e.int_points1[n.id];continue}let c=e.int_points1[a.id];c.edge_before===t.edge_before&&c.edge_after===t.edge_after&&a.edge_before===n.edge_before&&a.edge_after===n.edge_after&&(c.id=-1,a.id=-1,i=!0)}i&&(e.int_points1=e.int_points1.filter((s)=>s.id>=0),e.int_points2=e.int_points2.filter((s)=>s.id>=0),e.int_points1.forEach((s,a)=>s.id=a),e.int_points2.forEach((s,a)=>s.id=a))}function xKe(e){for(let t of e)t.edge_before&&(t.edge_before.bvStart=void 0,t.edge_before.bvEnd=void 0,t.edge_before.bv=void 0,t.edge_before.overlap=void 0),t.edge_after&&(t.edge_after.bvStart=void 0,t.edge_after.bvEnd=void 0,t.edge_after.bv=void 0,t.edge_after.overlap=void 0);for(let t of e)t.edge_before&&(t.edge_before.bvEnd=2),t.edge_after&&(t.edge_after.bvStart=2)}function CKe(e,t){for(let n of e)n.edge_before&&n.edge_before.setInclusion(t),n.edge_after&&n.edge_after.setInclusion(t)}function yq(e,t,n){let o,r,i=1;if(e.length===1)return 1;o=e[t];for(let s=t+1;s<e.length&&o.face===n&&(r=e[s],r.pt.equalTo(o.pt)&&r.edge_before===o.edge_before&&r.edge_after===o.edge_after);s++)i++;return i}function xq(e,t){if(t){for(let n of t){let o=n.edge_before;if(n.is_vertex=0,o.shape.start&&o.shape.start.equalTo(n.pt)&&(n.is_vertex|=1),o.shape.end&&o.shape.end.equalTo(n.pt)&&(n.is_vertex|=2),1&n.is_vertex){n.edge_before=o.prev,o.prev&&(n.is_vertex=2);continue}if(2&n.is_vertex)continue;let r=e.addVertex(n.pt,o);n.edge_before=r}for(let n of t)n.edge_before?n.edge_after=n.edge_before.next:e instanceof UO&&1&n.is_vertex&&(n.edge_after=e.first)}}function KVt(e,t,n){let o=e.edge_before,r=t.edge_after,i=n.length;o.next=n[0],n[0].prev=o,n[i-1].next=r,r.prev=n[i-1]}We.multiline=(...e)=>new We.Multiline(...e);var{INSIDE:$7,OUTSIDE:q7,BOUNDARY:AA,OVERLAP_SAME:q5r,OVERLAP_OPPOSITE:J5r}=tbe,{NOT_VERTEX:FNs,START_VERTEX:$Vt,END_VERTEX:qVt}=tbe;function bKe(e,t){let n=t.clone().reverse(),[o,r]=zle(e,n,3,!0);return o}function San(e,t){let[n,o]=zle(e,t,2,!0);return n}function Pan(e,t){let[n,o]=zle(e,t,2,!1),r=[];for(let s of n.faces)r=[...r,...[...s.edges].map((a)=>a.shape)];let i=[];for(let s of o.faces)i=[...i,...[...s.edges].map((a)=>a.shape)];return[r,i]}function IKe(e,t){let[n,o]=zle(e,t,3,!1),r=[];for(let i of n.faces)r=[...r,...[...i.edges].map((s)=>s.shape)];return r}function Ean(e,t){let n=e.clone(),o=t.clone(),r=Man(n,o);return cle(r),xq(n,r.int_points1_sorted),xq(o,r.int_points2_sorted),oZe(r),cle(r),[r.int_points1_sorted.map((i)=>i.pt),r.int_points2_sorted.map((i)=>i.pt)]}function Z5r(e,t,n,o){let r=JVt(e,n.int_points1),i=JVt(t,n.int_points2);for(ZVt(r,t),ZVt(i,e),xKe(n.int_points1),xKe(n.int_points2),CKe(n.int_points1,t),CKe(n.int_points2,e);e4r(e,t,n.int_points1,n.int_points1_sorted,n.int_points2,n););(function(s){let a,c,l,h=s.int_points1.length;for(let d=0;d<h;d++){let u=s.int_points1_sorted[d];u.face!==a&&(c=d,a=u.face);let _,p=d,m=yq(s.int_points1_sorted,d,a);_=p+m<h&&s.int_points1_sorted[p+m].face===a?p+m:c;let A=yq(s.int_points1_sorted,_,a);l=null;for(let I=_;I<_+A;I++){let v=s.int_points1_sorted[I];if(v.face===a&&s.int_points2[v.id].face===s.int_points2[u.id].face){l=v;break}}if(l===null)continue;let g=u.edge_after,f=l.edge_before;if(g.bv!==2||f.bv!==2)continue;if(g!==f)continue;let y=s.int_points2[u.id],x=s.int_points2[l.id],C=y.edge_after,b=x.edge_before;C.bv===2&&b.bv===2&&C===b||(y=s.int_points2[l.id],x=s.int_points2[u.id],C=y.edge_after,b=x.edge_before),C.bv===2&&b.bv===2&&C===b&&g.setOverlap(C)}})(n),vKe(e,o,n.int_points1_sorted,!0),vKe(t,o,n.int_points2_sorted,!1),eYt(e,r,o,!0),eYt(t,i,o,!1)}function zle(e,t,n,o){let r=e.clone(),i=t.clone(),s=Man(r,i);return cle(s),xq(r,s.int_points1_sorted),xq(i,s.int_points2_sorted),oZe(s),cle(s),Z5r(r,i,s,n),o&&function(a,c,l){(function(h,d,u,_){for(let p of d.faces){for(let m of p)h.edges.add(m);_.find((m)=>m.face===p)===void 0&&h.addFace(p.first,p.last)}})(a,c,0,l.int_points2),function(h,d,u){if(u.int_points1.length!==0)for(let _=0;_<u.int_points1.length;_++){let p=u.int_points1[_],m=u.int_points2[_];if(p.edge_before!==void 0&&p.edge_after===void 0&&m.edge_before===void 0&&m.edge_after!==void 0&&(p.edge_before.next=m.edge_after,m.edge_after.prev=p.edge_before,p.edge_after=m.edge_after,m.edge_before=p.edge_before),m.edge_before!==void 0&&m.edge_after===void 0&&p.edge_before===void 0&&p.edge_after!==void 0&&(m.edge_before.next=p.edge_after,p.edge_after.prev=m.edge_before,m.edge_after=p.edge_after,p.edge_before=m.edge_before),p.edge_before!==void 0&&p.edge_after===void 0)for(let A of u.int_points1_sorted)A!==p&&A.edge_before===void 0&&A.edge_after!==void 0&&A.pt.equalTo(p.pt)&&(p.edge_before.next=A.edge_after,A.edge_after.prev=p.edge_before,p.edge_after=A.edge_after,A.edge_before=p.edge_before);if(m.edge_before!==void 0&&m.edge_after===void 0)for(let A of u.int_points2_sorted)A!==m&&A.edge_before===void 0&&A.edge_after!==void 0&&A.pt.equalTo(m.pt)&&(m.edge_before.next=A.edge_after,A.edge_after.prev=m.edge_before,m.edge_after=A.edge_after,A.edge_before=m.edge_before)}}(0,0,l),SKe(a,l.int_points1),SKe(c,l.int_points2),PKe(a,l.int_points1,l.int_points2),PKe(a,l.int_points2,l.int_points1)}(r,i,s),[r,i]}function Man(e,t){let n={int_points1:[],int_points2:[]};for(let o of e.edges){let r=t.edges.search(o.box);for(let i of r){let s=o.shape.intersect(i.shape);for(let a of s)fq(o,a,n.int_points1),fq(i,a,n.int_points2)}}return n}function JVt(e,t){let n=[];for(let o of e.faces)t.find((r)=>r.face===o)||n.push(o);return n}function ZVt(e,t){for(let n of e)n.first.bv=n.first.bvStart=n.first.bvEnd=void 0,n.first.setInclusion(t)}function e4r(e,t,n,o,r,i){let s,a,c,l=o.length,h=!1;for(let d=0;d<l;d++){let u=o[d];u.face!==s&&(a=d,s=u.face);let _,p=d,m=yq(o,d,s);_=p+m<l&&o[p+m].face===s?p+m:a;let A=yq(o,_,s);c=null;for(let y=_;y<_+A;y++){let x=o[y];if(x.face===s&&r[x.id].face===r[u.id].face){c=x;break}}if(c===null)continue;let g=u.edge_after,f=c.edge_before;if(g.bv!==AA||f.bv==AA)if(g.bv==AA||f.bv!==AA){if(g.bv===AA&&f.bv===AA&&g!=f||g.bv===$7&&f.bv===q7||g.bv===q7&&f.bv===$7){let y=g.next;for(;y!=f;)y.bvStart=void 0,y.bvEnd=void 0,y.bv=void 0,y.setInclusion(t),y=y.next}if(g.bv===AA&&f.bv===AA&&g!=f){let y,x=g.next;for(;x!=f;){if(x.bv!=AA){if(y===void 0)y=x.bv;else if(x.bv!=y)throw zu.UNRESOLVED_BOUNDARY_CONFLICT}x=x.next}y!=null&&(g.bv=y,f.bv=y);continue}if(g.bv===$7&&f.bv===q7||g.bv===q7&&f.bv===$7){let y=g;for(;y!=f;){if(y.bvStart===g.bv&&y.bvEnd===f.bv){let[x,C]=y.shape.distanceTo(t);if(x<10*We.DP_TOL){fq(y,C.ps,n);let b=n[n.length-1];if(b.is_vertex&$Vt)b.edge_after=y,b.edge_before=y.prev,y.bvStart=AA,y.bv=void 0,y.setInclusion(t);else if(b.is_vertex&qVt)b.edge_after=y.next,y.bvEnd=AA,y.bv=void 0,y.setInclusion(t);else{let P=t.addVertex(b.pt,y);b.edge_before=P,b.edge_after=P.next,P.setInclusion(t),P.next.bvStart=AA,P.next.bvEnd=void 0,P.next.bv=void 0,P.next.setInclusion(t)}let I=t.findEdgeByPoint(C.pe);fq(I,C.pe,r);let v=r[r.length-1];if(v.is_vertex&$Vt)v.edge_after=I,v.edge_before=I.prev;else if(v.is_vertex&qVt)v.edge_after=I.next;else{let P=r.find((B)=>B.edge_after===I),M=t.addVertex(v.pt,I);v.edge_before=M,v.edge_after=M.next,P&&(P.edge_after=M),M.bvStart=void 0,M.bvEnd=AA,M.bv=void 0,M.setInclusion(e),M.next.bvStart=AA,M.next.bvEnd=void 0,M.next.bv=void 0,M.next.setInclusion(e)}cle(i),h=!0;break}}y=y.next}if(h)break;throw zu.UNRESOLVED_BOUNDARY_CONFLICT}}else f.bv=g.bv;else g.bv=f.bv}return h}function vKe(e,t,n,o){if(!n)return;let r,i,s,a;for(let c=0;c<n.length;c++){if(s=n[c],s.face!==r&&(i=c,r=s.face),r.isEmpty())continue;let l,h=c,d=yq(n,c,r);l=h+d<n.length&&n[h+d].face===s.face?h+d:i,a=n[l];let u=l,_=yq(n,u,r),p=s.edge_after,m=a.edge_before;if(p.bv===$7&&m.bv===$7&&t===1||p.bv===q7&&m.bv===q7&&t===2||(p.bv===q7||m.bv===q7)&&t===3&&!o||(p.bv===$7||m.bv===$7)&&t===3&&o||p.bv===AA&&m.bv===AA&&p.overlap&q5r&&o||p.bv===AA&&m.bv===AA&&p.overlap&J5r){e.removeChain(r,p,m);for(let A=h;A<h+d;A++)n[A].edge_after=void 0;for(let A=u;A<u+_;A++)n[A].edge_before=void 0}c+=d-1}}function SKe(e,t){for(let n of t)e.faces.delete(n.face),n.face=void 0,n.edge_before&&(n.edge_before.face=void 0),n.edge_after&&(n.edge_after.face=void 0)}function PKe(e,t,n){for(let o of t){if(o.edge_before===void 0||o.edge_after===void 0)continue;if(o.face)continue;if(o.edge_after.face||o.edge_before.face)continue;let{edge_after:r,edge_before:i}=o;try{qJe.testInfiniteLoop(r)}catch(a){throw zu.CANNOT_COMPLETE_BOOLEAN_OPERATION}let s=e.addFace(r,i);for(let a of t)a.edge_before&&a.edge_after&&a.edge_before.face===s&&a.edge_after.face===s&&(a.face=s);for(let a of n)a.edge_before&&a.edge_after&&a.edge_before.face===s&&a.edge_after.face===s&&(a.face=s)}}function eYt(e,t,n,o){for(let r of t){let i=r.first.bv;(n===1&&i===$7||n===3&&i===$7&&o||n===3&&i===q7&&!o||n===2&&i===q7)&&e.deleteFace(r)}}var t4r=Object.freeze({__proto__:null,BOOLEAN_INTERSECT:2,BOOLEAN_SUBTRACT:3,BOOLEAN_UNION:1,calculateIntersections:Ean,innerClip:Pan,intersect:San,outerClip:IKe,removeNotRelevantChains:vKe,removeOldFaces:SKe,restoreFaces:PKe,subtract:bKe,unify:function(e,t){let[n,o]=zle(e,t,1,!0);return n}}),n4r=RegExp("T.F..FFF.|T.F...F.."),o4r=RegExp("T........|.T.......|...T.....|....T...."),r4r=RegExp("FT.......|F..T.....|F...T...."),i4r=RegExp("T.F..F..."),s4r=RegExp("T.F..F...|.TF..F...|..FT.F...|..F.TF..."),x$=class{constructor(){this.m=[,,,,,,,,,].fill(void 0)}get I2I(){return this.m[0]}set I2I(e){this.m[0]=e}get I2B(){return this.m[1]}set I2B(e){this.m[1]=e}get I2E(){return this.m[2]}set I2E(e){this.m[2]=e}get B2I(){return this.m[3]}set B2I(e){this.m[3]=e}get B2B(){return this.m[4]}set B2B(e){this.m[4]=e}get B2E(){return this.m[5]}set B2E(e){this.m[5]=e}get E2I(){return this.m[6]}set E2I(e){this.m[6]=e}get E2B(){return this.m[7]}set E2B(e){this.m[7]=e}get E2E(){return this.m[8]}set E2E(e){this.m[8]=e}toString(){return this.m.map((e)=>e instanceof Array&&e.length>0?"T":e instanceof Array&&e.length===0?"F":"*").join("")}equal(){return n4r.test(this.toString())}intersect(){return o4r.test(this.toString())}touch(){return r4r.test(this.toString())}inside(){return i4r.test(this.toString())}covered(){return s4r.test(this.toString())}};function Sce(e,t){let n,o=new We.Ray(t),r=new We.Line(o.pt,o.norm),i=new We.Box(o.box.xmin-We.DP_TOL,o.box.ymin-We.DP_TOL,o.box.xmax+We.DP_TOL,o.box.ymax+We.DP_TOL);if(e.box.not_intersect(i))return We.OUTSIDE;let s=e.edges.search(i);if(s.length===0)return We.OUTSIDE;for(let h of s)if(h.shape.contains(t))return We.BOUNDARY;let a=[...e.faces],c=[];for(let h of s)for(let d of o.intersect(h.shape)){if(d.equalTo(t))return We.BOUNDARY;c.push({pt:d,edge:h,face_index:a.indexOf(h.face)})}c.sort((h,d)=>uan(h.pt.x,d.pt.x)?-1:dan(h.pt.x,d.pt.x)?1:h.face_index<d.face_index?-1:h.face_index>d.face_index?1:h.edge.arc_length<d.edge.arc_length?-1:h.edge.arc_length>d.edge.arc_length?1:0);let l=0;for(let h=0;h<c.length;h++){let d=c[h];if(d.pt.equalTo(d.edge.shape.start)){if(h>0&&d.pt.equalTo(c[h-1].pt)&&d.face_index===c[h-1].face_index&&d.edge.prev===c[h-1].edge)continue;let u=d.edge.prev;for(;yKe(u.length);)u=u.prev;let _=u.shape.tangentInEnd(),p=d.pt.translate(_),m=d.edge.shape.tangentInStart(),A=d.pt.translate(m),g=p.leftTo(r),f=A.leftTo(r);(g&&!f||!g&&f)&&l++}else if(d.pt.equalTo(d.edge.shape.end)){if(h>0&&d.pt.equalTo(c[h-1].pt)&&d.face_index===c[h-1].face_index&&d.edge.next===c[h-1].edge)continue;let u=d.edge.next;for(;yKe(u.length);)u=u.next;let _=u.shape.tangentInStart(),p=d.pt.translate(_),m=d.edge.shape.tangentInEnd(),A=d.pt.translate(m),g=p.leftTo(r),f=A.leftTo(r);(g&&!f||!g&&f)&&l++}else if(d.edge.shape instanceof We.Segment)l++;else{let u=d.edge.shape.box;uV(d.pt.y,u.ymin)||uV(d.pt.y,u.ymax)||l++}}return n=l%2==1?1:0,n}function tYt(e,t){return F$(e,t).intersect()}function nYt(e,t){return F$(e,t).inside()}function wan(e,t){return F$(e,t).covered()}function Ban(e,t){return wan(t,e)}function F$(e,t){return e instanceof We.Line&&t instanceof We.Line?function(n,o){let r=new x$,i=Hq(n,o);return i.length===0?n.contains(o.pt)&&o.contains(n.pt)?(r.I2I=[n],r.I2E=[],r.E2I=[]):(r.I2I=[],r.I2E=[n],r.E2I=[o]):(r.I2I=i,r.I2E=n.split(i),r.E2I=o.split(i)),r}(e,t):e instanceof We.Line&&t instanceof We.Circle?function(n,o){let r=new x$,i=BV(n,o);if(i.length===0)r.I2I=[],r.I2B=[],r.I2E=[n],r.E2I=[o];else if(i.length===1)r.I2I=[],r.I2B=i,r.I2E=n.split(i),r.E2I=[o];else{let s=new UO([n]),a=n.sortPoints(i);s.split(a);let c=s.toShapes();r.I2I=[c[1]],r.I2B=a,r.I2E=[c[0],c[2]],r.E2I=new We.Polygon([o.toArc()]).cutWithLine(n)}return r}(e,t):e instanceof We.Line&&t instanceof We.Box?function(n,o){let r=new x$,i=gq(n,o);if(i.length===0)r.I2I=[],r.I2B=[],r.I2E=[n],r.E2I=[o];else if(i.length===1)r.I2I=[],r.I2B=i,r.I2E=n.split(i),r.E2I=[o];else{let s=new UO([n]),a=n.sortPoints(i);s.split(a);let c=s.toShapes();o.toSegments().some((l)=>l.contains(i[0])&&l.contains(i[1]))?(r.I2I=[],r.I2B=[c[1]],r.I2E=[c[0],c[2]],r.E2I=[o]):(r.I2I=[c[1]],r.I2B=a,r.I2E=[c[0],c[2]],r.E2I=new We.Polygon(o.toSegments()).cutWithLine(n))}return r}(e,t):e instanceof We.Line&&t instanceof We.Polygon?function(n,o){let r=new x$,i=Fle(n,o),s=new UO([n]),a=i.length>0?i.slice():n.sortPoints(i);return s.split(a),[...s].forEach((c)=>c.setInclusion(o)),r.I2I=[...s].filter((c)=>c.bv===We.INSIDE).map((c)=>c.shape),r.I2B=[...s].slice(1).map((c)=>c.bv===We.BOUNDARY?c.shape:c.shape.start),r.I2E=[...s].filter((c)=>c.bv===We.OUTSIDE).map((c)=>c.shape),r.E2I=o.cutWithLine(n),r}(e,t):(e instanceof We.Segment||e instanceof We.Arc)&&t instanceof We.Polygon?oYt(e,t):(e instanceof We.Segment||e instanceof We.Arc)&&(t instanceof We.Circle||t instanceof We.Box)?oYt(e,new We.Polygon(t)):e instanceof We.Polygon&&t instanceof We.Polygon?v3e(e,t):(e instanceof We.Circle||e instanceof We.Box)&&(t instanceof We.Circle||t instanceof We.Box)?v3e(new We.Polygon(e),new We.Polygon(t)):(e instanceof We.Circle||e instanceof We.Box)&&t instanceof We.Polygon?v3e(new We.Polygon(e),t):e instanceof We.Polygon&&(t instanceof We.Circle||t instanceof We.Box)?v3e(e,new We.Polygon(t)):void 0}function oYt(e,t){let n=new x$,o=function(s,a){return s instanceof We.Line?Fle(s,a):s instanceof We.Segment?ZJe(s,a):s instanceof We.Arc?eZe(s,a):[]}(e,t),r=o.length>0?o.slice():e.sortPoints(o),i=new UO([e]);i.split(r),[...i].forEach((s)=>s.setInclusion(t)),n.I2I=[...i].filter((s)=>s.bv===We.INSIDE).map((s)=>s.shape),n.I2B=[...i].slice(1).map((s)=>s.bv===We.BOUNDARY?s.shape:s.shape.start),n.I2E=[...i].filter((s)=>s.bv===We.OUTSIDE).map((s)=>s.shape),n.B2I=[],n.B2B=[],n.B2E=[];for(let s of[e.start,e.end])switch(Sce(t,s)){case We.INSIDE:n.B2I.push(s);break;case We.BOUNDARY:n.B2B.push(s);break;case We.OUTSIDE:n.B2E.push(s)}return n}function v3e(e,t){let n=new x$,[o,r]=Ean(e,t),i=San(e,t),s=bKe(e,t),a=bKe(t,e),[c,l]=Pan(e,t),h=IKe(e,t),d=IKe(t,e);return n.I2I=i.isEmpty()?[]:[i],n.I2B=l,n.I2E=s.isEmpty()?[]:[s],n.B2I=c,n.B2B=o,n.B2E=h,n.E2I=a.isEmpty()?[]:[a],n.E2B=d,n}var a4r=Object.freeze({__proto__:null,contain:function(e,t){return nYt(t,e)},cover:Ban,covered:wan,disjoint:function(e,t){return!tYt(e,t)},equal:function(e,t){return F$(e,t).equal()},inside:nYt,intersect:tYt,relate:F$,touch:function(e,t){return F$(e,t).touch()}}),Pce=class e{constructor(t=1,n=0,o=0,r=1,i=0,s=0){this.a=t,this.b=n,this.c=o,this.d=r,this.tx=i,this.ty=s}fromMatrix3x3(t){let[n,o,r]=t[0],[i,s,a]=t[1];return new e(n,i,o,s,r,a)}toMatrix3x3(){return[[this.a,this.c,this.tx],[this.b,this.d,this.ty],[0,0,1]]}clone(){return new e(this.a,this.b,this.c,this.d,this.tx,this.ty)}transform(t){return[t[0]*this.a+t[1]*this.c+this.tx,t[0]*this.b+t[1]*this.d+this.ty]}multiply(t){return new e(this.a*t.a+this.c*t.b,this.b*t.a+this.d*t.b,this.a*t.c+this.c*t.d,this.b*t.c+this.d*t.d,this.a*t.tx+this.c*t.ty+this.tx,this.b*t.tx+this.d*t.ty+this.ty)}translate(...t){let n,o;if(t.length!=1||isNaN(t[0].x)||isNaN(t[0].y)){if(t.length!==2||typeof t[0]!="number"||typeof t[1]!="number")throw zu.ILLEGAL_PARAMETERS;n=t[0],o=t[1]}else n=t[0].x,o=t[0].y;return this.multiply(new e(1,0,0,1,n,o))}rotate(t,n=0,o=0){let r=Math.cos(t),i=Math.sin(t);return this.translate(n,o).multiply(new e(r,i,-i,r,0,0)).translate(-n,-o)}scale(t,n){return this.multiply(new e(t,0,0,n,0,0))}equalTo(t){return!!We.Utils.EQ(this.tx,t.tx)&&(!!We.Utils.EQ(this.ty,t.ty)&&(!!We.Utils.EQ(this.a,t.a)&&(!!We.Utils.EQ(this.b,t.b)&&(!!We.Utils.EQ(this.c,t.c)&&!!We.Utils.EQ(this.d,t.d)))))}};We.Matrix=Pce;We.matrix=(...e)=>new We.Matrix(...e);var c4r=class{constructor(e,t){this.low=e,this.high=t}get max(){return this.clone()}less_than(e){return this.low<e.low||this.low===e.low&&this.high<e.high}equal_to(e){return this.low===e.low&&this.high===e.high}intersect(e){return!this.not_intersect(e)}not_intersect(e){return this.high<e.low||e.high<this.low}merge(e){let t=this.low===void 0?e.low:this.low<e.low?this.low:e.low,n=this.high===void 0?e.high:this.high>e.high?this.high:e.high,o=this.clone();return o.low=t,o.high=n,o}output(){return[this.low,this.high]}comparable_less_than(e,t){return e<t}},l4r=class e extends c4r{clone(){return new e(this.low,this.high)}},LR=class{constructor(e,t,n=null,o=null,r=null,i=0){if(this.left=n,this.right=o,this.parent=r,this.color=i,this.item={key:void 0,values:[]},t!==void 0&&this.item.values.push(t),e!==void 0)if(Array.isArray(e)){let[s,a]=e;if(!Number.isNaN(s)&&!Number.isNaN(a)){let c=s,l=a;c>l&&([c,l]=[l,c]),this.item.key=new l4r(c,l)}}else this.item.key=e;this.max=this.item.key?this.item.key.max:void 0}isNil(){return this.item.key===void 0&&this.item.values.length===0&&this.left===null&&this.right===null&&this.color===0}requireKey(){if(!this.item.key)throw Error("Node key is undefined (nil/sentinel). Operation is not applicable.");return this.item.key}less_than(e){let t=this.requireKey(),n=e.requireKey();return t.less_than(n)}_value_equal(e){let t=this.item.values[0],n=e.item.values[0];return t&&n&&t.equal_to?t.equal_to(n):t===n}equal_to(e){let t=this.requireKey(),n=e.requireKey();return t.equal_to(n)}intersect(e){let t=this.requireKey(),n=e.requireKey();return t.intersect(n)}copy_data(e){this.item.key=e.item.key,this.item.values=e.item.values.slice()}update_max(){this.max=this.item.key?this.item.key.max:void 0,this.right&&this.right.max&&(this.max=this.max?this.max.merge(this.right.max):this.right.max),this.left&&this.left.max&&(this.max=this.max?this.max.merge(this.left.max):this.left.max)}not_intersect_left_subtree(e){if(!this.left)return!0;let t=this.left.max?this.left.max.high:this.left.item.key.high,n=this.requireKey(),o=e.requireKey();return n.comparable_less_than(t,o.low)}not_intersect_right_subtree(e){if(!this.right)return!0;let t=this.right.max?this.right.max.low:this.right.item.key.low,n=this.requireKey(),o=e.requireKey();return n.comparable_less_than(o.high,t)}},EKe=class e{constructor(){this.root=null,this.nil_node=new LR}get size(){let t=0;return this.tree_walk(this.root,(n)=>t+=n.item.values.length),t}get keys(){let t=[];return this.tree_walk(this.root,(n)=>t.push(n.item.key.output())),t}get values(){let t=[];return this.tree_walk(this.root,(n)=>{for(let o of n.item.values)t.push(o)}),t}get items(){let t=[];return this.tree_walk(this.root,(n)=>{let o=n.item.key.output();for(let r of n.item.values)t.push({key:o,value:r})}),t}isEmpty(){return this.root==null||this.root===this.nil_node}clear(){this.root=null}insert(t,n=t){if(t===void 0)return;let o=this.tree_search(this.root,new LR(t));if(o)return o.item.values.push(n),o;let r=new LR(t,n,this.nil_node,this.nil_node,null,1);return this.tree_insert(r),this.recalc_max(r),r}exist(t,n=t){let o=this.tree_search(this.root,new LR(t));return!!o&&(arguments.length<2||n===t||o.item.values.some((r)=>r&&r.equal_to?r.equal_to(n):r===n))}remove(t,n=t){let o=this.tree_search(this.root,new LR(t));if(!o)return;if(arguments.length<2)return this.tree_delete(o),o;let r=o.item.values.findIndex((i)=>i&&i.equal_to?i.equal_to(n):i===n);return r>=0?(o.item.values.splice(r,1),o.item.values.length===0&&this.tree_delete(o),o):void 0}search(t,n=(o,r)=>o===r?r.output():o){let o=new LR(t),r=[];this.tree_search_interval(this.root,o,r);let i=[];for(let s of r)for(let a of s.item.values)i.push(n(a,s.item.key));return i}intersect_any(t){let n=new LR(t);return this.tree_find_any_interval(this.root,n)}forEach(t){this.tree_walk(this.root,(n)=>{for(let o of n.item.values)t(n.item.key,o)})}map(t){let n=new e;return this.tree_walk(this.root,(o)=>{for(let r of o.item.values)n.insert(o.item.key,t(r,o.item.key))}),n}*iterate(t,n=(o,r)=>o===r?r.output():o){let o=null;for(t?o=this.tree_search_nearest_forward(this.root,new LR(t)):this.root&&(o=this.local_minimum(this.root));o;){for(let r of o.item.values)yield n(r,o.item.key);o=this.tree_successor(o)}}recalc_max(t){let n=t;for(;n.parent!=null;)n.parent.update_max(),n=n.parent}tree_insert(t){let n=this.root,o=null;if(this.root==null||this.root===this.nil_node)this.root=t;else{for(;n!==this.nil_node;)o=n,n=t.less_than(n)?n.left:n.right;t.parent=o,t.less_than(o)?o.left=t:o.right=t}this.insert_fixup(t)}insert_fixup(t){let n,o;for(n=t;n!==this.root&&n.parent.color===1;)n.parent===n.parent.parent.left?(o=n.parent.parent.right,o.color===1?(n.parent.color=0,o.color=0,n.parent.parent.color=1,n=n.parent.parent):(n===n.parent.right&&(n=n.parent,this.rotate_left(n)),n.parent.color=0,n.parent.parent.color=1,this.rotate_right(n.parent.parent))):(o=n.parent.parent.left,o.color===1?(n.parent.color=0,o.color=0,n.parent.parent.color=1,n=n.parent.parent):(n===n.parent.left&&(n=n.parent,this.rotate_right(n)),n.parent.color=0,n.parent.parent.color=1,this.rotate_left(n.parent.parent)));this.root.color=0}tree_delete(t){let n,o;n=t.left===this.nil_node||t.right===this.nil_node?t:this.tree_successor(t),o=n.left!==this.nil_node?n.left:n.right,o.parent=n.parent,n===this.root?this.root=o:(n===n.parent.left?n.parent.left=o:n.parent.right=o,n.parent.update_max()),this.recalc_max(o),n!==t&&(t.copy_data(n),t.update_max(),this.recalc_max(t)),n.color===0&&this.delete_fixup(o)}delete_fixup(t){let n,o=t;for(;o!==this.root&&o.parent!=null&&o.color===0;)o===o.parent.left?(n=o.parent.right,n.color===1&&(n.color=0,o.parent.color=1,this.rotate_left(o.parent),n=o.parent.right),n.left.color===0&&n.right.color===0?(n.color=1,o=o.parent):(n.right.color===0&&(n.color=1,n.left.color=0,this.rotate_right(n),n=o.parent.right),n.color=o.parent.color,o.parent.color=0,n.right.color=0,this.rotate_left(o.parent),o=this.root)):(n=o.parent.left,n.color===1&&(n.color=0,o.parent.color=1,this.rotate_right(o.parent),n=o.parent.left),n.left.color===0&&n.right.color===0?(n.color=1,o=o.parent):(n.left.color===0&&(n.color=1,n.right.color=0,this.rotate_left(n),n=o.parent.left),n.color=o.parent.color,o.parent.color=0,n.left.color=0,this.rotate_right(o.parent),o=this.root));o.color=0}tree_search(t,n){if(t!=null&&t!==this.nil_node)return n.equal_to(t)?t:n.less_than(t)?this.tree_search(t.left,n):this.tree_search(t.right,n)}tree_search_nearest_forward(t,n){let o=null,r=t;for(;r&&r!==this.nil_node;)r.less_than(n)?r.intersect(n)?(o=r,r=r.left):r=r.right:(o&&!r.less_than(o)||(o=r),r=r.left);return o||null}tree_search_interval(t,n,o){t!=null&&t!==this.nil_node&&(t.left===this.nil_node||t.not_intersect_left_subtree(n)||this.tree_search_interval(t.left,n,o),t.intersect(n)&&o.push(t),t.right===this.nil_node||t.not_intersect_right_subtree(n)||this.tree_search_interval(t.right,n,o))}tree_find_any_interval(t,n){let o=!1;return t!=null&&t!==this.nil_node&&(t.left===this.nil_node||t.not_intersect_left_subtree(n)||(o=this.tree_find_any_interval(t.left,n)),o||(o=t.intersect(n)),o||t.right===this.nil_node||t.not_intersect_right_subtree(n)||(o=this.tree_find_any_interval(t.right,n))),o}local_minimum(t){let n=t;for(;n.left!=null&&n.left!==this.nil_node;)n=n.left;return n}local_maximum(t){let n=t;for(;n.right!=null&&n.right!==this.nil_node;)n=n.right;return n}tree_successor(t){let n,o,r;if(t.right!==this.nil_node)n=this.local_minimum(t.right);else{for(o=t,r=t.parent;r!=null&&r.right===o;)o=r,r=r.parent;n=r}return n}rotate_left(t){let n=t.right;t.right=n.left,n.left!==this.nil_node&&(n.left.parent=t),n.parent=t.parent,t===this.root?this.root=n:t===t.parent.left?t.parent.left=n:t.parent.right=n,n.left=t,t.parent=n,t!==null&&t!==this.nil_node&&t.update_max(),n!=null&&n!==this.nil_node&&n.update_max()}rotate_right(t){let n=t.left;t.left=n.right,n.right!==this.nil_node&&(n.right.parent=t),n.parent=t.parent,t===this.root?this.root=n:t===t.parent.left?t.parent.left=n:t.parent.right=n,n.right=t,t.parent=n,t!==null&&t!==this.nil_node&&t.update_max(),n!=null&&n!==this.nil_node&&n.update_max()}tree_walk(t,n){t!=null&&t!==this.nil_node&&(this.tree_walk(t.left,n),n(t),this.tree_walk(t.right,n))}testRedBlackProperty(){let t=!0;return this.tree_walk(this.root,function(n){n.color===1&&(n.left.color===0&&n.right.color===0||(t=!1))}),t}testBlackHeightProperty(t){let n=0,o=0,r=0;if(t.color===0&&n++,o=t.left!==this.nil_node?this.testBlackHeightProperty(t.left):1,r=t.right!==this.nil_node?this.testBlackHeightProperty(t.right):1,o!==r)throw Error("Red-black height property violated");return n+=o,n}},h4r=class extends Set{constructor(e){super(e),this.index=new EKe,this.forEach((t)=>this.index.insert(t))}add(e){let t=this.size,{key:n,value:o}=e,r=n||e.box,i=o||e;return super.add(i),this.size>t&&this.index.insert(r,i),this}delete(e){let{key:t,value:n}=e,o=t||e.box,r=n||e,i=super.delete(r);return i&&this.index.remove(o,r),i}clear(){super.clear(),this.index=new EKe}search(e){return this.index.search(e)}hit(e){let t=new We.Box(e.x-1,e.y-1,e.x+1,e.y+1);return this.index.search(t).filter((n)=>e.on(n))}svg(){return[...this].reduce((e,t)=>e+t.svg(),"")}};We.PlanarSet=h4r;var wQ=class{get name(){throw zu.CANNOT_INVOKE_ABSTRACT_METHOD}get box(){throw zu.CANNOT_INVOKE_ABSTRACT_METHOD}clone(){throw zu.CANNOT_INVOKE_ABSTRACT_METHOD}translate(...e){return this.transform(new Pce().translate(...e))}rotate(e,t=new We.Point){return this.transform(new Pce().rotate(e,t.x,t.y))}scale(e,t){return this.transform(new Pce().scale(e,t))}transform(...e){throw zu.CANNOT_INVOKE_ABSTRACT_METHOD}toJSON(){return Object.assign({},this,{name:this.name})}svg(e={}){throw zu.CANNOT_INVOKE_ABSTRACT_METHOD}};We.Point=class e extends wQ{constructor(...t){if(super(),this.x=0,this.y=0,t.length!==0){if(t.length===1&&t[0]instanceof Array&&t[0].length===2){let n=t[0];if(typeof n[0]=="number"&&typeof n[1]=="number")return this.x=n[0],void(this.y=n[1])}if(t.length===1&&t[0]instanceof Object&&t[0].name==="point"){let{x:n,y:o}=t[0];return this.x=n,void(this.y=o)}if(t.length===2&&typeof t[0]=="number"&&typeof t[1]=="number")return this.x=t[0],void(this.y=t[1]);throw zu.ILLEGAL_PARAMETERS}}get box(){return new We.Box(this.x,this.y,this.x,this.y)}clone(){return new We.Point(this.x,this.y)}get vertices(){return[this.clone()]}equalTo(t){return We.Utils.EQ(this.x,t.x)&&We.Utils.EQ(this.y,t.y)}lessThan(t){return!!We.Utils.LT(this.y,t.y)||!(!We.Utils.EQ(this.y,t.y)||!We.Utils.LT(this.x,t.x))}transform(t){return new We.Point(t.transform([this.x,this.y]))}projectionOn(t){if(this.equalTo(t.pt))return this.clone();let n=new We.Vector(this,t.pt);if(We.Utils.EQ_0(n.cross(t.norm)))return t.pt.clone();let o=n.dot(t.norm),r=t.norm.multiply(o);return this.translate(r)}leftTo(t){let n=new We.Vector(t.pt,this);return We.Utils.GT(n.dot(t.norm),0)}distanceTo(t){if(t instanceof e){let n=t.x-this.x,o=t.y-this.y;return[Math.sqrt(n*n+o*o),new We.Segment(this,t)]}return t instanceof We.Line?We.Distance.point2line(this,t):t instanceof We.Circle?We.Distance.point2circle(this,t):t instanceof We.Segment?We.Distance.point2segment(this,t):t instanceof We.Arc?We.Distance.point2arc(this,t):t instanceof We.Polygon?We.Distance.point2polygon(this,t):t instanceof We.PlanarSet?We.Distance.shape2planarSet(this,t):t instanceof We.Multiline?We.Distance.shape2multiline(this,t):void 0}on(t){if(t instanceof We.Point)return this.equalTo(t);if(t.contains&&t.contains instanceof Function)return t.contains(this);throw We.Errors.UNSUPPORTED_SHAPE_TYPE}get name(){return"point"}svg(t={}){let n=t.r??3;return`
<circle cx="${this.x}" cy="${this.y}" r="${n}"
            ${wV({fill:"red",...t})} />`}};We.point=(...e)=>new We.Point(...e);We.Vector=class extends wQ{constructor(...e){if(super(),this.x=0,this.y=0,e.length!==0){if(e.length===1&&e[0]instanceof Array&&e[0].length===2){let t=e[0];if(typeof t[0]=="number"&&typeof t[1]=="number")return this.x=t[0],void(this.y=t[1])}if(e.length===1&&e[0]instanceof Object&&e[0].name==="vector"){let{x:t,y:n}=e[0];return this.x=t,void(this.y=n)}if(e.length===1&&e[0]instanceof Object&&e[0].name==="segment"){let{start:t,end:n}=e[0];return this.x=n.x-t.x,void(this.y=n.y-t.y)}if(e.length===2){let t=e[0],n=e[1];if(typeof t=="number"&&typeof n=="number")return this.x=t,void(this.y=n);if(t instanceof We.Point&&n instanceof We.Point)return this.x=n.x-t.x,void(this.y=n.y-t.y)}throw zu.ILLEGAL_PARAMETERS}}clone(){return new We.Vector(this.x,this.y)}get slope(){let e=Math.atan2(this.y,this.x);return e<0&&(e=2*Math.PI+e),e}get length(){return Math.sqrt(this.dot(this))}isZeroLength(){return We.Utils.EQ_0(this.length)}equalTo(e){return We.Utils.EQ(this.x,e.x)&&We.Utils.EQ(this.y,e.y)}multiply(e){return new We.Vector(e*this.x,e*this.y)}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}normalize(){if(this.isZeroLength())throw zu.ZERO_DIVISION;return new We.Vector(this.x/this.length,this.y/this.length)}rotate(e,t=new We.Point){if(t.x===0&&t.y===0)return this.transform(new Pce().rotate(e));throw zu.OPERATION_IS_NOT_SUPPORTED}transform(e){return new We.Vector(e.transform([this.x,this.y]))}rotate90CCW(){return new We.Vector(-this.y,this.x)}rotate90CW(){return new We.Vector(this.y,-this.x)}invert(){return new We.Vector(-this.x,-this.y)}add(e){return new We.Vector(this.x+e.x,this.y+e.y)}subtract(e){return new We.Vector(this.x-e.x,this.y-e.y)}angleTo(e){let t=this.normalize(),n=e.normalize(),o=Math.atan2(t.cross(n),t.dot(n));return o<0&&(o+=2*Math.PI),o}projectionOn(e){let t=e.normalize(),n=this.dot(t);return t.multiply(n)}get name(){return"vector"}};var Tan=(...e)=>new We.Vector(...e);We.vector=Tan;We.Segment=class e extends wQ{constructor(...t){if(super(),this.ps=new We.Point,this.pe=new We.Point,t.length!==0){if(t.length===1&&t[0]instanceof Array&&t[0].length===4){let n=t[0];return this.ps=new We.Point(n[0],n[1]),void(this.pe=new We.Point(n[2],n[3]))}if(t.length===1&&t[0]instanceof Object&&t[0].name==="segment"){let{ps:n,pe:o}=t[0];return this.ps=new We.Point(n.x,n.y),void(this.pe=new We.Point(o.x,o.y))}if(!(t.length===1&&t[0]instanceof We.Point)){if(t.length===2&&t[0]instanceof We.Point&&t[1]instanceof We.Point)return this.ps=t[0].clone(),void(this.pe=t[1].clone());if(t.length===4)return this.ps=new We.Point(t[0],t[1]),void(this.pe=new We.Point(t[2],t[3]));throw zu.ILLEGAL_PARAMETERS}this.ps=t[0].clone()}}clone(){return new We.Segment(this.start,this.end)}get start(){return this.ps}get end(){return this.pe}get vertices(){return[this.ps.clone(),this.pe.clone()]}get length(){return this.start.distanceTo(this.end)[0]}get slope(){return new We.Vector(this.start,this.end).slope}get box(){return new We.Box(Math.min(this.start.x,this.end.x),Math.min(this.start.y,this.end.y),Math.max(this.start.x,this.end.x),Math.max(this.start.y,this.end.y))}equalTo(t){return this.ps.equalTo(t.ps)&&this.pe.equalTo(t.pe)}contains(t){return We.Utils.EQ_0(this.distanceToPoint(t))}intersect(t){return t instanceof We.Point?this.contains(t)?[t]:[]:t instanceof We.Line?Hle(this,t):t instanceof We.Ray?tZe(t,this):t instanceof We.Segment?nbe(this,t):t instanceof We.Circle?obe(this,t):t instanceof We.Box?function(n,o){let r=[];for(let i of o.toSegments()){let s=nbe(i,n);for(let a of s)r.push(a)}return r}(this,t):t instanceof We.Arc?Aq(this,t):t instanceof We.Polygon?ZJe(this,t):t instanceof We.Multiline?Fq(this,t):void 0}distanceTo(t){if(t instanceof We.Point){let[n,o]=We.Distance.point2segment(t,this);return o=o.reverse(),[n,o]}if(t instanceof We.Circle){let[n,o]=We.Distance.segment2circle(this,t);return[n,o]}if(t instanceof We.Line){let[n,o]=We.Distance.segment2line(this,t);return[n,o]}if(t instanceof We.Segment){let[n,o]=We.Distance.segment2segment(this,t);return[n,o]}if(t instanceof We.Arc){let[n,o]=We.Distance.segment2arc(this,t);return[n,o]}if(t instanceof We.Polygon){let[n,o]=We.Distance.shape2polygon(this,t);return[n,o]}if(t instanceof We.PlanarSet){let[n,o]=We.Distance.shape2planarSet(this,t);return[n,o]}if(t instanceof We.Multiline)return We.Distance.shape2multiline(this,t)}tangentInStart(){return new We.Vector(this.start,this.end).normalize()}tangentInEnd(){return new We.Vector(this.end,this.start).normalize()}reverse(){return new e(this.end,this.start)}split(t){return this.start.equalTo(t)?[null,this.clone()]:this.end.equalTo(t)?[this.clone(),null]:[new We.Segment(this.start,t),new We.Segment(t,this.end)]}middle(){return new We.Point((this.start.x+this.end.x)/2,(this.start.y+this.end.y)/2)}pointAtLength(t){if(t>this.length||t<0)return null;if(t==0)return this.start;if(t==this.length)return this.end;let n=t/this.length;return new We.Point((this.end.x-this.start.x)*n+this.start.x,(this.end.y-this.start.y)*n+this.start.y)}distanceToPoint(t){let[n,...o]=We.Distance.point2segment(t,this);return n}definiteIntegral(t=0){return(this.end.x-this.start.x)*(this.start.y-t+(this.end.y-t))/2}transform(t=new We.Matrix){return new e(this.ps.transform(t),this.pe.transform(t))}isZeroLength(){return this.ps.equalTo(this.pe)}sortPoints(t){return new We.Line(this.start,this.end).sortPoints(t)}get name(){return"segment"}svg(t={}){return`
<line x1="${this.start.x}" y1="${this.start.y}" x2="${this.end.x}" y2="${this.end.y}" ${wV(t)} />`}};We.segment=(...e)=>new We.Segment(...e);var{vector:Eae}=We;We.Line=class e extends wQ{constructor(...t){if(super(),this.pt=new We.Point,this.norm=new We.Vector(0,1),t.length!==0){if(t.length===1&&t[0]instanceof Object&&t[0].name==="line"){let{pt:n,norm:o}=t[0];return this.pt=new We.Point(n),void(this.norm=new We.Vector(o))}if(t.length===2){let n=t[0],o=t[1];if(n instanceof We.Point&&o instanceof We.Point)return this.pt=n,this.norm=e.points2norm(n,o),void(this.norm.dot(Eae(this.pt.x,this.pt.y))>=0&&this.norm.invert());if(n instanceof We.Point&&o instanceof We.Vector){if(We.Utils.EQ_0(o.x)&&We.Utils.EQ_0(o.y))throw zu.ILLEGAL_PARAMETERS;return this.pt=n.clone(),this.norm=o.clone(),this.norm=this.norm.normalize(),void(this.norm.dot(Eae(this.pt.x,this.pt.y))>=0&&this.norm.invert())}if(n instanceof We.Vector&&o instanceof We.Point){if(We.Utils.EQ_0(n.x)&&We.Utils.EQ_0(n.y))throw zu.ILLEGAL_PARAMETERS;return this.pt=o.clone(),this.norm=n.clone(),this.norm=this.norm.normalize(),void(this.norm.dot(Eae(this.pt.x,this.pt.y))>=0&&this.norm.invert())}}throw zu.ILLEGAL_PARAMETERS}}clone(){return new We.Line(this.pt,this.norm)}get start(){}get end(){}get length(){return Number.POSITIVE_INFINITY}get box(){return new We.Box(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY)}get middle(){}get slope(){return new We.Vector(this.norm.y,-this.norm.x).slope}get standard(){return[this.norm.x,this.norm.y,this.norm.dot(Eae(this.pt.x,this.pt.y))]}parallelTo(t){return We.Utils.EQ_0(this.norm.cross(t.norm))}incidentTo(t){return this.parallelTo(t)&&this.pt.on(t)}contains(t){if(this.pt.equalTo(t))return!0;let n=new We.Vector(this.pt,t);return We.Utils.EQ_0(this.norm.dot(n))}coord(t){return Eae(t.x,t.y).cross(this.norm)}intersect(t){return t instanceof We.Point?this.contains(t)?[t]:[]:t instanceof We.Line?Hq(this,t):t instanceof We.Ray?ban(t,this):t instanceof We.Circle?BV(this,t):t instanceof We.Box?gq(this,t):t instanceof We.Segment?Hle(t,this):t instanceof We.Arc?_6e(this,t):t instanceof We.Polygon?Fle(this,t):t instanceof We.Multiline?Fq(this,t):void 0}distanceTo(t){if(t instanceof We.Point){let[n,o]=We.Distance.point2line(t,this);return o=o.reverse(),[n,o]}if(t instanceof We.Circle){let[n,o]=We.Distance.circle2line(t,this);return o=o.reverse(),[n,o]}if(t instanceof We.Segment){let[n,o]=We.Distance.segment2line(t,this);return[n,o.reverse()]}if(t instanceof We.Arc){let[n,o]=We.Distance.arc2line(t,this);return[n,o.reverse()]}if(t instanceof We.Polygon){let[n,o]=We.Distance.shape2polygon(this,t);return[n,o]}}split(t){if(t instanceof We.Point)return[new We.Ray(t,this.norm),new We.Ray(t,this.norm)];{let n=new We.Multiline([this]),o=this.sortPoints(t);return n.split(o),n.toShapes()}}rotate(t,n=new We.Point){return new We.Line(this.pt.rotate(t,n),this.norm.rotate(t))}transform(t){return new We.Line(this.pt.transform(t),this.norm.clone())}sortPoints(t){return t.slice().sort((n,o)=>this.coord(n)<this.coord(o)?-1:this.coord(n)>this.coord(o)?1:0)}get name(){return"line"}svg(t,n={}){let o=gq(this,t);if(o.length===0)return"";let r=o[0],i=o.length===2?o[1]:o.find((s)=>!s.equalTo(r));return i===void 0&&(i=r),new We.Segment(r,i).svg(n)}static points2norm(t,n){if(t.equalTo(n))throw zu.ILLEGAL_PARAMETERS;return new We.Vector(t,n).normalize().rotate90CCW()}};We.line=(...e)=>new We.Line(...e);We.Circle=class extends wQ{constructor(...e){if(super(),this.pc=new We.Point,this.r=1,e.length===1&&e[0]instanceof Object&&e[0].name==="circle"){let{pc:t,r:n}=e[0];this.pc=new We.Point(t),this.r=n}else{let[t,n]=[...e];t&&t instanceof We.Point&&(this.pc=t.clone()),n!==void 0&&(this.r=n)}}clone(){return new We.Circle(this.pc.clone(),this.r)}get center(){return this.pc}get box(){return new We.Box(this.pc.x-this.r,this.pc.y-this.r,this.pc.x+this.r,this.pc.y+this.r)}contains(e){return e instanceof We.Point?We.Utils.LE(e.distanceTo(this.center)[0],this.r):e instanceof We.Segment?We.Utils.LE(e.start.distanceTo(this.center)[0],this.r)&&We.Utils.LE(e.end.distanceTo(this.center)[0],this.r):e instanceof We.Arc?this.intersect(e).length===0&&We.Utils.LE(e.start.distanceTo(this.center)[0],this.r)&&We.Utils.LE(e.end.distanceTo(this.center)[0],this.r):e instanceof We.Circle?this.intersect(e).length===0&&We.Utils.LE(e.r,this.r)&&We.Utils.LE(e.center.distanceTo(this.center)[0],this.r):void 0}toArc(e=!0){return new We.Arc(this.center,this.r,Math.PI,-Math.PI,e)}scale(e,t){if(e!==t)throw zu.OPERATION_IS_NOT_SUPPORTED;if(this.pc.x!==0||this.pc.y!==0)throw zu.OPERATION_IS_NOT_SUPPORTED;return new We.Circle(this.pc,this.r*e)}transform(e=new We.Matrix){return new We.Circle(this.pc.transform(e),this.r)}intersect(e){return e instanceof We.Point?this.contains(e)?[e]:[]:e instanceof We.Line?BV(e,this):e instanceof We.Ray?Can(e,this):e instanceof We.Segment?obe(e,this):e instanceof We.Circle?pan(e,this):e instanceof We.Box?function(t,n){let o=[];for(let r of n.toSegments()){let i=obe(r,t);for(let s of i)o.push(s)}return o}(this,e):e instanceof We.Arc?JJe(e,this):e instanceof We.Polygon?fan(this,e):e instanceof We.Multiline?Fq(this,e):void 0}distanceTo(e){if(e instanceof We.Point){let[t,n]=We.Distance.point2circle(e,this);return n=n.reverse(),[t,n]}if(e instanceof We.Circle){let[t,n]=We.Distance.circle2circle(this,e);return[t,n]}if(e instanceof We.Line){let[t,n]=We.Distance.circle2line(this,e);return[t,n]}if(e instanceof We.Segment){let[t,n]=We.Distance.segment2circle(e,this);return n=n.reverse(),[t,n]}if(e instanceof We.Arc){let[t,n]=We.Distance.arc2circle(e,this);return n=n.reverse(),[t,n]}if(e instanceof We.Polygon){let[t,n]=We.Distance.shape2polygon(this,e);return[t,n]}if(e instanceof We.PlanarSet){let[t,n]=We.Distance.shape2planarSet(this,e);return[t,n]}if(e instanceof We.Multiline){let[t,n]=We.Distance.shape2multiline(this,e);return[t,n]}}get name(){return"circle"}svg(e={}){return`
<circle cx="${this.pc.x}" cy="${this.pc.y}" r="${this.r}"
                ${wV({fill:"none",...e})} />`}};We.circle=(...e)=>new We.Circle(...e);We.Arc=class extends wQ{constructor(...e){if(super(),this.pc=new We.Point,this.r=1,this.startAngle=0,this.endAngle=2*Math.PI,this.counterClockwise=!0,e.length!==0)if(e.length===1&&e[0]instanceof Object&&e[0].name==="arc"){let{pc:t,r:n,startAngle:o,endAngle:r,counterClockwise:i}=e[0];this.pc=new We.Point(t.x,t.y),this.r=n,this.startAngle=o,this.endAngle=r,this.counterClockwise=i}else{let[t,n,o,r,i]=[...e];t&&t instanceof We.Point&&(this.pc=t.clone()),n!==void 0&&(this.r=n),o!==void 0&&(this.startAngle=o),r!==void 0&&(this.endAngle=r),i!==void 0&&(this.counterClockwise=i)}}clone(){return new We.Arc(this.pc.clone(),this.r,this.startAngle,this.endAngle,this.counterClockwise)}get sweep(){let e=this.startAngle,t=this.endAngle;if(We.Utils.EQ(Math.abs(e-t),We.PIx2))return We.PIx2;Math.abs(e)>We.PIx2&&(e-=Math.trunc(e/We.PIx2)*We.PIx2),e<0&&(e+=We.PIx2),Math.abs(t)>We.PIx2&&(t-=Math.trunc(t/We.PIx2)*We.PIx2),t<0&&(t+=We.PIx2);let n=this.counterClockwise?t-e:e-t;return n<0&&(n+=We.PIx2),n}get start(){return new We.Point(this.pc.x+this.r,this.pc.y).rotate(this.startAngle,this.pc)}get end(){return new We.Point(this.pc.x+this.r,this.pc.y).rotate(this.endAngle,this.pc)}get center(){return this.pc.clone()}get vertices(){return[this.start.clone(),this.end.clone()]}get length(){return Math.abs(this.sweep*this.r)}get box(){let e=this.breakToFunctional().reduce((t,n)=>t.merge(n.start.box),new We.Box);return e=e.merge(this.end.box),e}contains(e){if(!We.Utils.EQ(this.pc.distanceTo(e)[0],this.r))return!1;if(e.equalTo(this.start))return!0;let t=new We.Vector(this.pc,e).slope,n=new We.Arc(this.pc,this.r,this.startAngle,t,this.counterClockwise);return We.Utils.LE(n.length,this.length)}split(e){if(this.start.equalTo(e))return[null,this.clone()];if(this.end.equalTo(e))return[this.clone(),null];let t=new We.Vector(this.pc,e).slope;return[new We.Arc(this.pc,this.r,this.startAngle,t,this.counterClockwise),new We.Arc(this.pc,this.r,t,this.endAngle,this.counterClockwise)]}middle(){let e=this.counterClockwise?this.startAngle+this.sweep/2:this.startAngle-this.sweep/2;return new We.Arc(this.pc,this.r,this.startAngle,e,this.counterClockwise).end}pointAtLength(e){if(e>this.length||e<0)return null;if(e===0)return this.start;if(e===this.length)return this.end;let t=e/this.length,n=this.counterClockwise?this.startAngle+this.sweep*t:this.startAngle-this.sweep*t;return new We.Arc(this.pc,this.r,this.startAngle,n,this.counterClockwise).end}chordHeight(){return(1-Math.cos(Math.abs(this.sweep/2)))*this.r}intersect(e){return e instanceof We.Point?this.contains(e)?[e]:[]:e instanceof We.Line?_6e(e,this):e instanceof We.Ray?nZe(e,this):e instanceof We.Circle?JJe(this,e):e instanceof We.Segment?Aq(e,this):e instanceof We.Box?function(t,n){let o=[];for(let r of n.toSegments()){let i=Aq(r,t);for(let s of i)o.push(s)}return o}(this,e):e instanceof We.Arc?man(this,e):e instanceof We.Polygon?eZe(this,e):e instanceof We.Multiline?Fq(this,e):void 0}distanceTo(e){if(e instanceof We.Point){let[t,n]=We.Distance.point2arc(e,this);return n=n.reverse(),[t,n]}if(e instanceof We.Circle){let[t,n]=We.Distance.arc2circle(this,e);return[t,n]}if(e instanceof We.Line){let[t,n]=We.Distance.arc2line(this,e);return[t,n]}if(e instanceof We.Segment){let[t,n]=We.Distance.segment2arc(e,this);return n=n.reverse(),[t,n]}if(e instanceof We.Arc){let[t,n]=We.Distance.arc2arc(this,e);return[t,n]}if(e instanceof We.Polygon){let[t,n]=We.Distance.shape2polygon(this,e);return[t,n]}if(e instanceof We.PlanarSet){let[t,n]=We.Distance.shape2planarSet(this,e);return[t,n]}if(e instanceof We.Multiline)return We.Distance.shape2multiline(this,e)}breakToFunctional(){let e=[],t=[0,Math.PI/2,Math.PI,3*Math.PI/2],n=this.startAngle,o=this.endAngle;We.Utils.EQ(Math.abs(n-o),We.PIx2)&&(o=n),Math.abs(n)>We.PIx2&&(n-=Math.trunc(n/We.PIx2)*We.PIx2),n<0&&(n+=We.PIx2),Math.abs(o)>We.PIx2&&(o-=Math.trunc(o/We.PIx2)*We.PIx2),o<0&&(o+=We.PIx2);let r,i,s,a=n;this.counterClockwise?(i=Math.ceil(n/(Math.PI/2))%4,s=1):(i=Math.floor(n/(Math.PI/2))%4,s=-1);for(let c=0,l=i;c<4;c++,l=(l+s+4)%4){if(r=t[l],r===a)continue;let h=this.counterClockwise?r-n:n-r;if(h<0&&(h+=We.PIx2),h>this.sweep)break;e.push(new We.Arc(this.pc,this.r,a,r,this.counterClockwise)),a=r}return e.length===0?(e.push(this),e):(r=o,a!==r&&e.push(new We.Arc(this.pc,this.r,a,r,this.counterClockwise)),e)}tangentInStart(){let e=new We.Vector(this.pc,this.start),t=this.counterClockwise?Math.PI/2:-Math.PI/2;return e.rotate(t).normalize()}tangentInEnd(){let e=new We.Vector(this.pc,this.end),t=this.counterClockwise?-Math.PI/2:Math.PI/2;return e.rotate(t).normalize()}reverse(){return new We.Arc(this.pc,this.r,this.endAngle,this.startAngle,!this.counterClockwise)}transform(e=new We.Matrix){let t=this.start.transform(e),n=this.end.transform(e),o=this.pc.transform(e),r=this.counterClockwise;return e.a*e.d<0&&(r=!r),We.Arc.arcSE(o,t,n,r)}static arcSE(e,t,n,o){let{vector:r}=We,i=r(e,t).slope,s=r(e,n).slope;We.Utils.EQ(i,s)&&(s+=2*Math.PI,o=!0);let a=r(e,t).length;return new We.Arc(e,a,i,s,o)}definiteIntegral(e=0){return this.breakToFunctional().reduce((t,n)=>t+n.circularSegmentDefiniteIntegral(e),0)}circularSegmentDefiniteIntegral(e){let t=new We.Segment(this.start,this.end).definiteIntegral(e),n=We.Utils.EQ(this.sweep,We.PIx2)?0:this.circularSegmentArea();return this.counterClockwise?t-n:t+n}circularSegmentArea(){return 0.5*this.r*this.r*(this.sweep-Math.sin(this.sweep))}sortPoints(e){let{vector:t}=We;return e.slice().sort((n,o)=>{let r=t(this.pc,n).slope,i=t(this.pc,o).slope;return r<i?-1:r>i?1:0})}get name(){return"arc"}svg(e={}){let t=this.sweep<=Math.PI?"0":"1",n=this.counterClockwise?"1":"0";if(We.Utils.EQ(this.sweep,2*Math.PI))return new We.Circle(this.pc,this.r).svg(e);return`
<path d="M${this.start.x},${this.start.y}
                             A${this.r},${this.r} 0 ${t},${n} ${this.end.x},${this.end.y}"
                    ${wV({fill:"none",...e})} />`}};We.arc=(...e)=>new We.Arc(...e);We.Box=class e extends wQ{constructor(t=void 0,n=void 0,o=void 0,r=void 0){super(),this.xmin=t,this.ymin=n,this.xmax=o,this.ymax=r}clone(){return new e(this.xmin,this.ymin,this.xmax,this.ymax)}get low(){return new We.Point(this.xmin,this.ymin)}get high(){return new We.Point(this.xmax,this.ymax)}get max(){return this.clone()}get center(){return new We.Point((this.xmin+this.xmax)/2,(this.ymin+this.ymax)/2)}get width(){return Math.abs(this.xmax-this.xmin)}get height(){return Math.abs(this.ymax-this.ymin)}get box(){return this.clone()}not_intersect(t){return this.xmax<t.xmin||this.xmin>t.xmax||this.ymax<t.ymin||this.ymin>t.ymax}intersect(t){return!this.not_intersect(t)}merge(t){return new e(this.xmin===void 0?t.xmin:Math.min(this.xmin,t.xmin),this.ymin===void 0?t.ymin:Math.min(this.ymin,t.ymin),this.xmax===void 0?t.xmax:Math.max(this.xmax,t.xmax),this.ymax===void 0?t.ymax:Math.max(this.ymax,t.ymax))}less_than(t){return!!this.low.lessThan(t.low)||!(!this.low.equalTo(t.low)||!this.high.lessThan(t.high))}equal_to(t){return this.low.equalTo(t.low)&&this.high.equalTo(t.high)}output(){return this.clone()}comparable_less_than(t,n){return t.lessThan(n)}set(t,n,o,r){this.xmin=t,this.ymin=n,this.xmax=o,this.ymax=r}extend(t){return t<=0?this.clone():new e(this.xmin-t,this.ymin-t,this.xmax+t,this.ymax+t)}toPoints(){return[new We.Point(this.xmin,this.ymin),new We.Point(this.xmax,this.ymin),new We.Point(this.xmax,this.ymax),new We.Point(this.xmin,this.ymax)]}toSegments(){let t=this.toPoints();return[new We.Segment(t[0],t[1]),new We.Segment(t[1],t[2]),new We.Segment(t[2],t[3]),new We.Segment(t[3],t[0])]}rotate(t,n=new We.Point){throw zu.OPERATION_IS_NOT_SUPPORTED}transform(t=new We.Matrix){return this.toPoints().map((n)=>n.transform(t)).reduce((n,o)=>n.merge(o.box),new e)}contains(t){return t instanceof We.Point?t.x>=this.xmin&&t.x<=this.xmax&&t.y>=this.ymin&&t.y<=this.ymax:t instanceof We.Segment?t.vertices.every((n)=>this.contains(n)):t instanceof We.Box?t.toSegments().every((n)=>this.contains(n)):t instanceof We.Circle?this.contains(t.box):t instanceof We.Arc?t.vertices.every((n)=>this.contains(n))&&this.toSegments().every((n)=>Aq(n,t).length===0):!(t instanceof We.Line||t instanceof We.Ray)&&(t instanceof We.Multiline?t.toShapes().every((n)=>this.contains(n)):t instanceof We.Polygon?this.contains(t.box):void 0)}distanceTo(t){let n=this.toSegments().map((r)=>r.distanceTo(t)),o=[Number.MAX_SAFE_INTEGER,null];return n.forEach((r)=>{r[0]<o[0]&&(o=r)}),o}get name(){return"box"}svg(t={}){let n=this.xmax-this.xmin,o=this.ymax-this.ymin;return`
<rect x="${this.xmin}" y="${this.ymin}" width="${n}" height="${o}"
                ${wV({fill:"none",...t})} />`}};We.box=(...e)=>new We.Box(...e);We.Edge=class{constructor(e){this.shape=e,this.next=void 0,this.prev=void 0,this.face=void 0,this.arc_length=0,this.bvStart=void 0,this.bvEnd=void 0,this.bv=void 0,this.overlap=void 0}get start(){return this.shape.start}get end(){return this.shape.end}get length(){return this.shape.length}get box(){return this.shape.box}get isSegment(){return this.shape instanceof We.Segment}get isArc(){return this.shape instanceof We.Arc}get isLine(){return this.shape instanceof We.Line}get isRay(){return this.shape instanceof We.Ray}middle(){return this.shape.middle()}pointAtLength(e){return this.shape.pointAtLength(e)}contains(e){return this.shape.contains(e)}setInclusion(e){if(this.bv!==void 0)return this.bv;if(this.shape instanceof We.Line||this.shape instanceof We.Ray)return this.bv=We.OUTSIDE,this.bv;if(this.bvStart===void 0&&(this.bvStart=Sce(e,this.start)),this.bvEnd===void 0&&(this.bvEnd=Sce(e,this.end)),this.bvStart===We.OUTSIDE||this.bvEnd==We.OUTSIDE)this.bv=We.OUTSIDE;else if(this.bvStart===We.INSIDE||this.bvEnd==We.INSIDE)this.bv=We.INSIDE;else{let t=Sce(e,this.middle());this.bv=t}return this.bv}setOverlap(e){let t,n=this.shape,o=e.shape;n instanceof We.Segment&&o instanceof We.Segment?n.start.equalTo(o.start)&&n.end.equalTo(o.end)?t=We.OVERLAP_SAME:n.start.equalTo(o.end)&&n.end.equalTo(o.start)&&(t=We.OVERLAP_OPPOSITE):(n instanceof We.Arc&&o instanceof We.Arc||n instanceof We.Segment&&o instanceof We.Arc||n instanceof We.Arc&&o instanceof We.Segment)&&(n.start.equalTo(o.start)&&n.end.equalTo(o.end)&&n.middle().equalTo(o.middle())?t=We.OVERLAP_SAME:n.start.equalTo(o.end)&&n.end.equalTo(o.start)&&n.middle().equalTo(o.middle())&&(t=We.OVERLAP_OPPOSITE)),this.overlap===void 0&&(this.overlap=t),e.overlap===void 0&&(e.overlap=t)}svg(){if(this.shape instanceof We.Segment)return` L${this.shape.end.x},${this.shape.end.y}`;if(this.shape instanceof We.Arc){let e,t=this.shape,n=t.counterClockwise?"1":"0";if(We.Utils.EQ(t.sweep,2*Math.PI)){let o=t.counterClockwise?1:-1,r=new We.Arc(t.pc,t.r,t.startAngle,t.startAngle+o*Math.PI,t.counterClockwise),i=new We.Arc(t.pc,t.r,t.startAngle+o*Math.PI,t.endAngle,t.counterClockwise);return e="0",` A${r.r},${r.r} 0 ${e},${n} ${r.end.x},${r.end.y}
                    A${i.r},${i.r} 0 ${e},${n} ${i.end.x},${i.end.y}`}return e=t.sweep<=Math.PI?"0":"1",` A${t.r},${t.r} 0 ${e},${n} ${t.end.x},${t.end.y}`}}toJSON(){return this.shape.toJSON()}};var d4r=class extends qJe{constructor(e,t){super(e,t),this.setCircularLinks()}setCircularLinks(){this.isEmpty()||(this.last.next=this.first,this.first.prev=this.last)}[Symbol.iterator](){let e;return{next:()=>{let t=e||this.first,n=!this.first||!!e&&e===this.first;return e=t?t.next:void 0,{value:t,done:n}}}}append(e){return super.append(e),this.setCircularLinks(),this}insert(e,t){return super.insert(e,t),this.setCircularLinks(),this}remove(e){return super.remove(e),this}};We.Face=class e extends d4r{constructor(t,...n){if(super(),this._box=void 0,this._orientation=void 0,n.length!==0){if(n.length===1){if(n[0]instanceof Array){let o=n[0];if(o.length===0)return;if(o.every((r)=>r instanceof We.Point)){let r=e.points2segments(o);this.shapes2face(t.edges,r)}else if(o.every((r)=>r instanceof Array&&r.length===2)){let r=o.map((s)=>new We.Point(s[0],s[1])),i=e.points2segments(r);this.shapes2face(t.edges,i)}else if(o.every((r)=>r instanceof We.Segment||r instanceof We.Arc))this.shapes2face(t.edges,o);else if(o.every((r)=>r.name==="segment"||r.name==="arc")){let r=[];for(let i of o){let s;s=i.name==="segment"?new We.Segment(i):new We.Arc(i),r.push(s)}this.shapes2face(t.edges,r)}}else if(n[0]instanceof e){let o=n[0];this.first=o.first,this.last=o.last;for(let r of o)t.edges.add(r)}else if(n[0]instanceof We.Circle)this.shapes2face(t.edges,[n[0].toArc(can)]);else if(n[0]instanceof We.Box){let o=n[0];this.shapes2face(t.edges,[new We.Segment(new We.Point(o.xmin,o.ymin),new We.Point(o.xmax,o.ymin)),new We.Segment(new We.Point(o.xmax,o.ymin),new We.Point(o.xmax,o.ymax)),new We.Segment(new We.Point(o.xmax,o.ymax),new We.Point(o.xmin,o.ymax)),new We.Segment(new We.Point(o.xmin,o.ymax),new We.Point(o.xmin,o.ymin))])}}n.length===2&&n[0]instanceof We.Edge&&n[1]instanceof We.Edge&&(this.first=n[0],this.last=n[1],this.last.next=this.first,this.first.prev=this.last,this.setArcLength())}}get edges(){return this.toArray()}get vertices(){return this.edges.map((t)=>t.shape.start.clone())}get shapes(){return this.edges.map((t)=>t.shape.clone())}get box(){if(this._box===void 0){let t=new We.Box;for(let n of this)t=t.merge(n.box);this._box=t}return this._box}get perimeter(){return this.last.arc_length+this.last.length}pointAtLength(t){if(t>this.perimeter||t<0)return null;let n=null;for(let o of this)if(t>=o.arc_length&&(o===this.last||t<o.next.arc_length)){n=o.pointAtLength(t-o.arc_length);break}return n}static points2segments(t){let n=[];for(let o=0;o<t.length;o++)t[o].equalTo(t[(o+1)%t.length])||n.push(new We.Segment(t[o],t[(o+1)%t.length]));return n}shapes2face(t,n){for(let o of n){let r=new We.Edge(o);this.append(r),t.add(r)}}append(t){return super.append(t),this.setOneEdgeArcLength(t),t.face=this,this}insert(t,n){return super.insert(t,n),this.setOneEdgeArcLength(t),t.face=this,this}remove(t){return super.remove(t),this.setArcLength(),this}merge_with_next_edge(t){return t.shape.end.x=t.next.shape.end.x,t.shape.end.y=t.next.shape.end.y,this.remove(t.next),this}reverse(){let t=[],n=this.last;do n.shape=n.shape.reverse(),t.push(n),n=n.prev;while(n!==this.last);this.first=void 0,this.last=void 0;for(let o of t)this.first===void 0?(o.prev=o,o.next=o,this.first=o,this.last=o):(o.prev=this.last,this.last.next=o,this.last=o,this.last.next=this.first,this.first.prev=this.last),this.setOneEdgeArcLength(o);this._orientation!==void 0&&(this._orientation=void 0,this._orientation=this.orientation())}setArcLength(){for(let t of this)this.setOneEdgeArcLength(t),t.face=this}setOneEdgeArcLength(t){t===this.first?t.arc_length=0:t.arc_length=t.prev.arc_length+t.prev.length}area(){return Math.abs(this.signedArea())}signedArea(){let t=0,n=this.box.ymin;for(let o of this)t+=o.shape.definiteIntegral(n);return t}orientation(){if(this._orientation===void 0){let t=this.signedArea();We.Utils.EQ_0(t)?this._orientation=vce.NOT_ORIENTABLE:We.Utils.LT(t,0)?this._orientation=vce.CCW:this._orientation=vce.CW}return this._orientation}isSimple(t){return e.getSelfIntersections(this,t,!0).length===0}static getSelfIntersections(t,n,o=!1){let r=[];for(let i of t){let s=n.search(i.box);for(let a of s){if(i===a)continue;if(a.face!==t)continue;if(i.shape instanceof We.Segment&&a.shape instanceof We.Segment&&(i.next===a||i.prev===a))continue;let c=i.shape.intersect(a.shape);for(let l of c)if((!l.equalTo(i.start)||!l.equalTo(a.end)||a!==i.prev)&&(!l.equalTo(i.end)||!l.equalTo(a.start)||a!==i.next)&&(r.push(l),o))break;if(r.length>0&&o)break}if(r.length>0&&o)break}return r}findEdgeByPoint(t){let n;for(let o of this)if(!t.equalTo(o.shape.start)&&(t.equalTo(o.shape.end)||o.shape.contains(t))){n=o;break}return n}toPolygon(){return new We.Polygon(this.shapes)}toJSON(){return this.edges.map((t)=>t.toJSON())}svg(){let t=`M${this.first.start.x},${this.first.start.y}`;for(let n of this)t+=n.svg();return t+=" z",t}};We.Ray=class e extends wQ{constructor(...t){if(super(),this.pt=new We.Point,this.norm=new We.Vector(0,1),t.length!==0&&(t.length>=1&&t[0]instanceof We.Point&&(this.pt=t[0].clone()),t.length!==1)){if(!(t.length===2&&t[1]instanceof We.Vector))throw zu.ILLEGAL_PARAMETERS;this.norm=t[1].clone()}}clone(){return new e(this.pt,this.norm)}get slope(){return new We.Vector(this.norm.y,-this.norm.x).slope}get box(){let t=this.slope;return new We.Box(t>Math.PI/2&&t<3*Math.PI/2?Number.NEGATIVE_INFINITY:this.pt.x,t>=0&&t<=Math.PI?this.pt.y:Number.NEGATIVE_INFINITY,t>=Math.PI/2&&t<=3*Math.PI/2?this.pt.x:Number.POSITIVE_INFINITY,t>=Math.PI&&t<=2*Math.PI||t===0?this.pt.y:Number.POSITIVE_INFINITY)}get start(){return this.pt}get end(){}get length(){return Number.POSITIVE_INFINITY}contains(t){if(this.pt.equalTo(t))return!0;let n=new We.Vector(this.pt,t);return We.Utils.EQ_0(this.norm.dot(n))&&We.Utils.GE(n.cross(this.norm),0)}coord(t){return Tan(t.x,t.y).cross(this.norm)}split(t){return this.contains(t)?this.pt.equalTo(t)?[this]:[new We.Segment(this.pt,t),new We.Ray(t,this.norm)]:[]}intersect(t){return t instanceof We.Point?this.contains(t)?[t]:[]:t instanceof We.Segment?tZe(this,t):t instanceof We.Arc?nZe(this,t):t instanceof We.Line?ban(this,t):t instanceof We.Ray?(o=t,Hq(dQ(n=this),dQ(o)).filter((r)=>n.contains(r)).filter((r)=>o.contains(r))):t instanceof We.Circle?Can(this,t):t instanceof We.Box?function(r,i){return gq(dQ(r),i).filter((s)=>r.contains(s))}(this,t):t instanceof We.Polygon?Ian(this,t):t instanceof We.Multiline?Fq(this,t):void 0;var n,o}rotate(t,n=new We.Point){return new We.Ray(this.pt.rotate(t,n),this.norm.rotate(t))}transform(t){return new We.Ray(this.pt.transform(t),this.norm.clone())}get name(){return"ray"}svg(t,n={}){let o=gq(new We.Line(this.pt,this.norm),t);return o=o.filter((r)=>this.contains(r)),o.length===0||o.length===2?"":new We.Segment(this.pt,o[0]).svg(n)}};We.ray=(...e)=>new We.Ray(...e);We.Polygon=class e{constructor(){this.faces=new We.PlanarSet,this.edges=new We.PlanarSet;let t=[...arguments];if(t.length===1&&(t[0]instanceof Array&&t[0].length>0||t[0]instanceof We.Circle||t[0]instanceof We.Box)){let n=t[0];if(t[0]instanceof Array&&t[0].every((o)=>o instanceof Array))if(n.every((o)=>o instanceof Array&&o.length===2&&typeof o[0]=="number"&&typeof o[1]=="number"))this.faces.add(new We.Face(this,n));else for(let o of n)if(o instanceof Array&&o[0]instanceof Array&&o[0].every((r)=>r instanceof Array&&r.length===2&&typeof r[0]=="number"&&typeof r[1]=="number"))for(let r of o)this.faces.add(new We.Face(this,r));else this.faces.add(new We.Face(this,o));else this.faces.add(new We.Face(this,n))}}get box(){return[...this.faces].reduce((t,n)=>t.merge(n.box),new We.Box)}get vertices(){return[...this.faces].flatMap((t)=>t.vertices)}clone(){let t=new e;for(let n of this.faces)t.addFace(n.shapes);return t}createFromArray(t){let n=new e;return t.forEach((o)=>[...o.faces].forEach((r)=>n.addFace(r.shapes))),n}isEmpty(){return this.edges.size===0||this.faces.size===0}isValid(){let t=!0;for(let n of this.faces)if(!n.isSimple(this.edges)){t=!1;break}return t}area(){let t=[...this.faces].reduce((n,o)=>n+o.signedArea(),0);return Math.abs(t)}addFace(...t){let n=new We.Face(this,...t);return this.faces.add(n),n}deleteFace(t){for(let n of t)this.edges.delete(n);return this.faces.delete(t)}recreateFaces(){this.faces.clear();for(let o of this.edges)o.face=null;let t,n=!0;for(;n;){n=!1;for(let o of this.edges)if(o.face===null){t=o,n=!0;break}if(n){let o=t;do o=o.next;while(o.next!==t);this.addFace(t,o)}}}removeChain(t,n,o){if(o.next!==n){for(let r=n;r!==o.next;r=r.next)if(t.remove(r),this.edges.delete(r),t.isEmpty()){this.deleteFace(t);break}}else this.deleteFace(t)}addVertex(t,n){let o=n.shape.split(t);if(o[0]===null)return n.prev;if(o[1]===null)return n;let r=new We.Edge(o[0]),i=n.prev;return n.face.insert(r,i),this.edges.delete(n),this.edges.add(r),n.shape=o[1],this.edges.add(n),r}removeEndVertex(t){let n=t.next;n!==t&&(t.face.merge_with_next_edge(t),this.edges.delete(n))}cut(t){let n=this.splitToIslands().flatMap((o)=>o._cutSingleIsland(t)).filter((o)=>o.isValid()&&o.isEmpty()===!1);return this.createFromArray(n)}_cutSingleIsland(t){let n=this.clone(),o=t.clone(),r,i,s={int_points1:[],int_points2:[],int_points1_sorted:[],int_points2_sorted:[]};for(let a of o.edges)for(let c of n.edges){let l=yan(a,c);for(let h of l)fq(a,h,s.int_points1),fq(c,h,s.int_points2)}if(s.int_points1.length===0)return n;s.int_points1_sorted=jR(s.int_points1),s.int_points2_sorted=jR(s.int_points2),xq(o,s.int_points1_sorted),xq(n,s.int_points2_sorted),oZe(s),s.int_points1_sorted=jR(s.int_points1),s.int_points2_sorted=jR(s.int_points2),xKe(s.int_points1),CKe(s.int_points1,n);for(let a of s.int_points1_sorted)a.edge_before&&a.edge_after&&a.edge_before.bv===a.edge_after.bv&&(s.int_points2[a.id]=-1,a.id=-1);if(s.int_points1=s.int_points1.filter((a)=>a.id>=0),s.int_points2=s.int_points2.filter((a)=>a.id>=0),s.int_points1.forEach((a,c)=>{a.id=c}),s.int_points2.forEach((a,c)=>{a.id=c}),s.int_points1.length===0)return n;s.int_points1_sorted=jR(s.int_points1),s.int_points2_sorted=jR(s.int_points2);for(let a=1;a<s.int_points1_sorted.length;a++)if(i=s.int_points1_sorted[a],r=s.int_points1_sorted[a-1],i.edge_before&&i.edge_before.bv===1){let c=r.edge_after,l=i.edge_before,h=o.getChain(c,l);KVt(s.int_points2[r.id],s.int_points2[i.id],h),h.forEach((d)=>n.edges.add(d)),h=h.reverse().map((d)=>new We.Edge(d.shape.reverse()));for(let d=0;d<h.length-1;d++)h[d].next=h[d+1],h[d+1].prev=h[d];KVt(s.int_points2[i.id],s.int_points2[r.id],h),h.forEach((d)=>n.edges.add(d))}return n.recreateFaces(),n}cutWithLine(t){let n=new UO([t]);return this.cut(n)}findEdgeByPoint(t){let n;for(let o of this.faces)if(n=o.findEdgeByPoint(t),n!==void 0)break;return n}splitToIslands(){if(this.isEmpty())return[];let t=this.toArray();t.sort((r,i)=>i.area()-r.area());let n=[...t[0].faces][0].orientation(),o=t.filter((r)=>[...r.faces][0].orientation()===n);for(let r of t){let i=[...r.faces][0];if(i.orientation()!==n){for(let s of o)if(i.shapes.every((a)=>s.contains(a))){s.addFace(i.shapes);break}}}return o}rearrange(){if(this.faces.size<=1)return this.clone();let t=this.splitToIslands(),n=new e;return t.forEach((o)=>{o.faces.forEach((r)=>n.addFace(r.shapes))}),n}orientation(){return this.isEmpty()?vce.NOT_ORIENTABLE:[...this.faces][0].orientation()}isOuter(t){return t.orientation()===this.orientation()}isMultiPolygon(){let t=0;return this.faces.forEach((n)=>{this.isOuter(n)&&t++}),t>1}reverse(){for(let t of this.faces)t.reverse();return this}contains(t){if(t instanceof We.Point){let n=Sce(this,t);return n===1||n===2}return Ban(this,t)}distanceTo(t){if(t instanceof We.Point){let[n,o]=We.Distance.point2polygon(t,this);return o=o.reverse(),[n,o]}if(t instanceof We.Circle||t instanceof We.Line||t instanceof We.Segment||t instanceof We.Arc){let[n,o]=We.Distance.shape2polygon(t,this);return o=o.reverse(),[n,o]}if(t instanceof We.Polygon){let n,o,r=[Number.POSITIVE_INFINITY,new We.Segment];for(let i of this.edges){let s=r[0];[n,o]=We.Distance.shape2planarSet(i.shape,t.edges,s),We.Utils.LT(n,s)&&(r=[n,o])}return r}}intersect(t){return t instanceof We.Point?this.contains(t)?[t]:[]:t instanceof We.Line?Fle(t,this):t instanceof We.Ray?Ian(t,this):t instanceof We.Circle?fan(t,this):t instanceof We.Segment?ZJe(t,this):t instanceof We.Arc?eZe(t,this):t instanceof We.Polygon?function(n,o){let r=[];if(n.isEmpty()||o.isEmpty())return r;if(n.box.not_intersect(o.box))return r;for(let i of n.edges)r=[...r,...jVt(i,o)];return r}(t,this):t instanceof We.Multiline?function(n,o){let r=[];if(o.isEmpty()||n.size===0)return r;for(let i of n)r=[...r,...jVt(i,o)];return r}(t,this):void 0}translate(t){let n=new e;for(let o of this.faces)n.addFace(o.shapes.map((r)=>r.translate(t)));return n}rotate(t=0,n=new We.Point){let o=new e;for(let r of this.faces)o.addFace(r.shapes.map((i)=>i.rotate(t,n)));return o}scale(t,n){let o=new e;for(let r of this.faces)o.addFace(r.shapes.map((i)=>i.scale(t,n)));return o}transform(t=new We.Matrix){let n=new e;for(let o of this.faces)n.addFace(o.shapes.map((r)=>r.transform(t)));return n}toJSON(){return[...this.faces].map((t)=>t.toJSON())}toArray(){return[...this.faces].map((t)=>t.toPolygon())}dpath(){return[...this.faces].reduce((t,n)=>t+n.svg(),"")}svg(t={}){let n=`
<path ${wV({fillRule:"evenodd",fill:"lightcyan",...t})} d="`;for(let o of this.faces)n+=`
${o.svg()}`;return n+=`" >
</path>`,n}};We.polygon=(...e)=>new We.Polygon(...e);var{Circle:tXe,Line:rYt,Point:iYt,Vector:S3e,Utils:nXe}=We;We.Inversion=class e{constructor(t){this.circle=t}get inversion_circle(){return this.circle}static inversePoint(t,n){let o=new S3e(t.pc,n),r=t.r*t.r,i=o.dot(o);return nXe.EQ_0(i)?new iYt(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY):t.pc.translate(o.multiply(r/i))}static inverseCircle(t,n){let o=t.pc.distanceTo(n.pc)[0];if(nXe.EQ(o,n.r)){let r=t.r*t.r/(2*n.r),i=new S3e(t.pc,n.pc);i=i.normalize();let s=t.pc.translate(i.multiply(r));return new rYt(s,i)}{let r=new S3e(t.pc,n.pc),i=t.r*t.r/(r.dot(r)-n.r*n.r),s=t.pc.translate(r.multiply(i)),a=Math.abs(i)*n.r;return new tXe(s,a)}}static inverseLine(t,n){let[o,r]=t.pc.distanceTo(n);if(nXe.EQ_0(o))return n.clone();{let i=t.r*t.r/(2*o),s=new S3e(t.pc,r.end);return s=s.multiply(i/o),new tXe(t.pc.translate(s),i)}}inverse(t){return t instanceof iYt?e.inversePoint(this.circle,t):t instanceof tXe?e.inverseCircle(this.circle,t):t instanceof rYt?e.inverseLine(this.circle,t):void 0}};We.inversion=(e)=>new We.Inversion(e);We.Distance=class e{static point2point(t,n){return t.distanceTo(n)}static point2line(t,n){let o=t.projectionOn(n);return[new We.Vector(t,o).length,new We.Segment(t,o)]}static point2circle(t,n){let[o,r]=t.distanceTo(n.center);if(We.Utils.EQ_0(o))return[n.r,new We.Segment(t,n.toArc().start)];{let i=Math.abs(o-n.r),s=new We.Vector(n.pc,t).normalize().multiply(n.r),a=n.pc.translate(s);return[i,new We.Segment(t,a)]}}static point2segment(t,n){if(n.start.equalTo(n.end))return e.point2point(t,n.start);let o,r,i=new We.Vector(n.start,n.end),s=new We.Vector(n.start,t),a=new We.Vector(n.end,t),c=i.dot(s),l=-i.dot(a);if(We.Utils.GE(c,0)&&We.Utils.GE(l,0)){let h=n.tangentInStart();return o=Math.abs(h.cross(s)),r=n.start.translate(h.multiply(h.dot(s))),[o,new We.Segment(t,r)]}return c<0?t.distanceTo(n.start):t.distanceTo(n.end)}static point2arc(t,n){let o,r,i=new We.Circle(n.pc,n.r),s=[];return[o,r]=e.point2circle(t,i),r.end.on(n)&&s.push(e.point2circle(t,i)),s.push(e.point2point(t,n.start)),s.push(e.point2point(t,n.end)),e.sort(s),s[0]}static point2edge(t,n){return n.shape instanceof We.Segment?e.point2segment(t,n.shape):e.point2arc(t,n.shape)}static segment2line(t,n){let o=t.intersect(n);if(o.length>0)return[0,new We.Segment(o[0],o[0])];let r=[];return r.push(e.point2line(t.start,n)),r.push(e.point2line(t.end,n)),e.sort(r),r[0]}static segment2segment(t,n){let o=nbe(t,n);if(o.length>0)return[0,new We.Segment(o[0],o[0])];let r,i,s=[];return[r,i]=e.point2segment(n.start,t),s.push([r,i.reverse()]),[r,i]=e.point2segment(n.end,t),s.push([r,i.reverse()]),s.push(e.point2segment(t.start,n)),s.push(e.point2segment(t.end,n)),e.sort(s),s[0]}static segment2circle(t,n){let o=t.intersect(n);if(o.length>0)return[0,new We.Segment(o[0],o[0])];let r=new We.Line(t.ps,t.pe),[i,s]=e.point2line(n.center,r);if(We.Utils.GE(i,n.r)&&s.end.on(t))return e.point2circle(s.end,n);{let[a,c]=e.point2circle(t.start,n),[l,h]=e.point2circle(t.end,n);return We.Utils.LT(a,l)?[a,c]:[l,h]}}static segment2arc(t,n){let o=t.intersect(n);if(o.length>0)return[0,new We.Segment(o[0],o[0])];let r=new We.Line(t.ps,t.pe),i=new We.Circle(n.pc,n.r),[s,a]=e.point2line(i.center,r);if(We.Utils.GE(s,i.r)&&a.end.on(t)){let[d,u]=e.point2circle(a.end,i);if(u.end.on(n))return[d,u]}let c,l,h=[];return h.push(e.point2arc(t.start,n)),h.push(e.point2arc(t.end,n)),[c,l]=e.point2segment(n.start,t),h.push([c,l.reverse()]),[c,l]=e.point2segment(n.end,t),h.push([c,l.reverse()]),e.sort(h),h[0]}static circle2circle(t,n){let o=t.intersect(n);if(o.length>0)return[0,new We.Segment(o[0],o[0])];if(t.center.equalTo(n.center)){let r=t.toArc(),i=n.toArc();return e.point2point(r.start,i.start)}{let r=new We.Line(t.center,n.center),i=r.intersect(t),s=r.intersect(n),a=[];return a.push(e.point2point(i[0],s[0])),a.push(e.point2point(i[0],s[1])),a.push(e.point2point(i[1],s[0])),a.push(e.point2point(i[1],s[1])),e.sort(a),a[0]}}static circle2line(t,n){let o=t.intersect(n);if(o.length>0)return[0,new We.Segment(o[0],o[0])];let[r,i]=e.point2line(t.center,n),[s,a]=e.point2circle(i.end,t);return a=a.reverse(),[s,a]}static arc2line(t,n){let o=n.intersect(t);if(o.length>0)return[0,new We.Segment(o[0],o[0])];let r=new We.Circle(t.center,t.r),[i,s]=e.point2line(r.center,n);if(!We.Utils.GE(i,r.r)){let a=[];return a.push(e.point2line(t.start,n)),a.push(e.point2line(t.end,n)),e.sort(a),a[0]}{let[a,c]=e.point2circle(s.end,r);if(c.end.on(t))return[a,c]}}static arc2circle(t,n){let o=t.intersect(n);if(o.length>0)return[0,new We.Segment(o[0],o[0])];let r=new We.Circle(t.center,t.r),[i,s]=e.circle2circle(r,n);if(s.start.on(t))return[i,s];{let a=[];return a.push(e.point2circle(t.start,n)),a.push(e.point2circle(t.end,n)),e.sort(a),a[0]}}static arc2arc(t,n){let o=t.intersect(n);if(o.length>0)return[0,new We.Segment(o[0],o[0])];let r=new We.Circle(t.center,t.r),i=new We.Circle(n.center,n.r),[s,a]=e.circle2circle(r,i);if(a.start.on(t)&&a.end.on(n))return[s,a];{let c,l,h=[];return[c,l]=e.point2arc(t.start,n),l.end.on(n)&&h.push([c,l]),[c,l]=e.point2arc(t.end,n),l.end.on(n)&&h.push([c,l]),[c,l]=e.point2arc(n.start,t),l.end.on(t)&&h.push([c,l.reverse()]),[c,l]=e.point2arc(n.end,t),l.end.on(t)&&h.push([c,l.reverse()]),[c,l]=e.point2point(t.start,n.start),h.push([c,l]),[c,l]=e.point2point(t.start,n.end),h.push([c,l]),[c,l]=e.point2point(t.end,n.start),h.push([c,l]),[c,l]=e.point2point(t.end,n.end),h.push([c,l]),e.sort(h),h[0]}}static point2polygon(t,n){let o=[Number.POSITIVE_INFINITY,new We.Segment];for(let r of n.edges){let[i,s]=e.point2edge(t,r);We.Utils.LT(i,o[0])&&(o=[i,s])}return o}static shape2polygon(t,n){let o=[Number.POSITIVE_INFINITY,new We.Segment];for(let r of n.edges){let[i,s]=t.distanceTo(r.shape);We.Utils.LT(i,o[0])&&(o=[i,s])}return o}static polygon2polygon(t,n){let o=[Number.POSITIVE_INFINITY,new We.Segment];for(let r of t.edges)for(let i of n.edges){let[s,a]=r.shape.distanceTo(i.shape);We.Utils.LT(s,o[0])&&(o=[s,a])}return o}static box2box_minmax(t,n){let o=Math.max(Math.max(t.xmin-n.xmax,0),Math.max(n.xmin-t.xmax,0)),r=Math.max(Math.max(t.ymin-n.ymax,0),Math.max(n.ymin-t.ymax,0)),i=o*o+r*r,s=t.merge(n),a=s.xmax-s.xmin,c=s.ymax-s.ymin;return[i,a*a+c*c]}static minmax_tree_process_level(t,n,o,r){let i,s;for(let c of n){[i,s]=e.box2box_minmax(t.box,c.item.key);for(let l of c.item.values)l instanceof We.Edge?r.insert([i,s],l.shape):r.insert([i,s],l);We.Utils.LT(s,o)&&(o=s)}if(n.length===0)return o;let a=[...n.map((c)=>c.left.isNil()?void 0:c.left).filter((c)=>c!==void 0),...n.map((c)=>c.right.isNil()?void 0:c.right).filter((c)=>c!==void 0)].filter((c)=>{let[l,h]=e.box2box_minmax(t.box,c.max);return We.Utils.LE(l,o)});return o=e.minmax_tree_process_level(t,a,o,r)}static minmax_tree(t,n,o){let r=new EKe,i=[n.index.root],s=o<Number.POSITIVE_INFINITY?o*o:Number.POSITIVE_INFINITY;return s=e.minmax_tree_process_level(t,i,s,r),r}static minmax_tree_calc_distance(t,n,o){let r,i;if(n!=null&&!n.isNil()){if([r,i]=e.minmax_tree_calc_distance(t,n.left,o),i)return[r,i];if(We.Utils.LT(r[0],Math.sqrt(n.item.key.low)))return[r,!0];let[s,a]=e.distanceToArray(t,n.item.values);return We.Utils.LT(s,r[0])&&(r=[s,a]),[r,i]=e.minmax_tree_calc_distance(t,n.right,r),[r,i]}return[o,!1]}static shape2planarSet(t,n,o=Number.POSITIVE_INFINITY){let r=[o,new We.Segment],i=!1;if(n instanceof We.PlanarSet){let s=e.minmax_tree(t,n,o);[r,i]=e.minmax_tree_calc_distance(t,s.root,r)}return r}static sort(t){t.sort((n,o)=>We.Utils.LT(n[0],o[0])?-1:We.Utils.GT(n[0],o[0])?1:0)}static distance(t,n){return t.distanceTo(n)}static distanceToArray(t,n){let o=[Number.POSITIVE_INFINITY,new We.Segment];for(let r of n){let[i,s]=t.distanceTo(r);We.Utils.LT(i,o[0])&&(o=[i,s])}return o}static shape2multiline(t,n){let o=[Number.POSITIVE_INFINITY,new We.Segment];for(let r of n){let[i,s]=e.distance(t,r.shape);We.Utils.LT(i,o[0])&&(o=[i,s])}return o}static multiline2multiline(t,n){let o=[Number.POSITIVE_INFINITY,new We.Segment];for(let r of t)for(let i of n){let[s,a]=e.distance(r.shape,i.shape);We.Utils.LT(s,o[0])&&(o=[s,a])}return o}};var{Multiline:u4r,Point:Dan,Segment:p4r,Polygon:Nan}=We;function MKe(e){return new Dan(e.split(" ").map(Number))}function Ran(e){return e.split(", ").map(MKe)}function oXe(e){let t=Ran(e),n=[];for(let o=0;o<t.length-1;o++)n.push(new p4r(t[o],t[o+1]));return new u4r(n)}function sYt(e){let t=e.replace(/\(\(/,"").replace(/\)\)$/,"").split("), ("),n=new Nan,o;return t.forEach((r,i)=>{let s=r.split(", ").map((c)=>new Dan(c.split(" ").map(Number))),a=n.addFace(s);i===0?o=a.orientation():a.orientation()===o&&a.reverse()}),n}function m4r(e){if(e.startsWith("POLYGON"))return sYt(e.replace(/^POLYGON /,""));return function(t){let n=t.split(/\)\), \(\(/).map((r)=>"(("+r+"))").map(sYt),o=new Nan;return n.reduce((r,i)=>[...r,...i?.faces],[]).forEach((r)=>o.addFace([...r?.shapes])),o}(e.replace(/^MULTIPOLYGON \(\(\((.*)\)\)\)$/,"$1"))}function aYt(e){return e.split(`
`)?.every((t)=>t.includes("POINT"))}function cYt(e){return e.split(`
`)?.every((t)=>t.includes("LINESTRING"))}We.isWktString=function(e){return e.startsWith("POINT")||aYt(e)||e.startsWith("LINESTRING")||cYt(e)||e.startsWith("MULTILINESTRING")||e.startsWith("POLYGON")||e.startsWith("MULTIPOINT")||e.startsWith("MULTIPOLYGON")||e.startsWith("GEOMETRYCOLLECTION")},We.parseWKT=function e(t){if(t.startsWith("POINT"))return MKe(t.replace(/^POINT \(/,"").replace(/\)$/,""));if(t.startsWith("MULTIPOINT"))return Ran(t.replace(/^MULTIPOINT \(/,"").replace(/\)$/,""));if(t.startsWith("LINESTRING"))return oXe(t.replace(/^LINESTRING \(/,"").replace(/\)$/,""));if(t.startsWith("MULTILINESTRING"))return function(n){return n.replace(/\(\(/,"").replace(/\)\)$/,"").split("), (").map(oXe)}(t.replace(/^MULTILINESTRING /,""));if(t.startsWith("POLYGON")||t.startsWith("MULTIPOLYGON"))return m4r(t);if(t.startsWith("GEOMETRYCOLLECTION")){let n=/(?<type>POINT|LINESTRING|POLYGON|MULTIPOINT|MULTILINESTRING|MULTIPOLYGON) \((?:[^\(\)]|\([^\)]*\))*\)/g,o=t.match(n);return o[0].startsWith("GEOMETRYCOLLECTION")&&(o[0]=o[0].replace("GEOMETRYCOLLECTION (","")),o.map(e).map((r)=>r instanceof Array?r:[r]).reduce((r,i)=>[...r,...i],[])}return aYt(t)?function(n){return n.split(`
`).map((o)=>o.match(/\(([^)]+)\)/)[1]).map(MKe)}(t):cYt(t)?function(n){return n.split(`
`).map((o)=>o.match(/\(([^)]+)\)/)[1]).map(oXe).reduce((o,r)=>[...o,...r],[])}(t):[]},We.BooleanOperations=t4r,We.Relations=a4r;pO=P5r(),lYt=1,rXe=pO!=null?_5r(A5r(pO)):{},((e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of qsn(t))f5r.call(e,r)||r===n||LVt(e,r,{get:()=>t[r],enumerable:!(o=g5r(t,r))||o.enumerable})})(!lYt&&pO&&pO.__esModule?rXe:LVt(rXe,"default",{value:pO,enumerable:!0}),pO);var pO,lYt,rXe,{create:_4r,defineProperty:hYt,getOwnPropertyDescriptor:g4r,getOwnPropertyNames:Qan,getPrototypeOf:A4r}=Object,f4r=Object.prototype.hasOwnProperty,TV=(e,t)=>function(){return t||(0,e[Qan(e)[0]])((t={exports:{}}).exports,t),t.exports},dYt=(e,t,n)=>(n=e!=null?_4r(A4r(e)):{},((o,r,i,s)=>{if(r&&typeof r=="object"||typeof r=="function")for(let a of Qan(r))f4r.call(o,a)||a===i||hYt(o,a,{get:()=>r[a],enumerable:!(s=g4r(r,a))||s.enumerable});return o})(!t&&e&&e.__esModule?n:hYt(n,"default",{value:e,enumerable:!0}),e)),y4r=TV({"node_modules/is-buffer/index.js"(e,t){function n(o){return!!o.constructor&&typeof o.constructor.isBuffer=="function"&&o.constructor.isBuffer(o)}t.exports=function(o){return o!=null&&(n(o)||function(r){return typeof r.readFloatLE=="function"&&typeof r.slice=="function"&&n(r.slice(0,0))}(o)||!!o._isBuffer)}}}),x4r=TV({"node_modules/kind-of/index.js"(e,t){var n=y4r(),o=Object.prototype.toString;t.exports=function(r){if(r===void 0)return"undefined";if(r===null)return"null";if(r===!0||r===!1||r instanceof Boolean)return"boolean";if(typeof r=="string"||r instanceof String)return"string";if(typeof r=="number"||r instanceof Number)return"number";if(typeof r=="function"||r instanceof Function)return"function";if(Array.isArray!==void 0&&Array.isArray(r))return"array";if(r instanceof RegExp)return"regexp";if(r instanceof Date)return"date";var i=o.call(r);return i==="[object RegExp]"?"regexp":i==="[object Date]"?"date":i==="[object Arguments]"?"arguments":i==="[object Error]"?"error":n(r)?"buffer":i==="[object Set]"?"set":i==="[object WeakSet]"?"weakset":i==="[object Map]"?"map":i==="[object WeakMap]"?"weakmap":i==="[object Symbol]"?"symbol":i==="[object Int8Array]"?"int8array":i==="[object Uint8Array]"?"uint8array":i==="[object Uint8ClampedArray]"?"uint8clampedarray":i==="[object Int16Array]"?"int16array":i==="[object Uint16Array]"?"uint16array":i==="[object Int32Array]"?"int32array":i==="[object Uint32Array]"?"uint32array":i==="[object Float32Array]"?"float32array":i==="[object Float64Array]"?"float64array":"object"}}}),C4r=TV({"node_modules/rename-keys/index.js"(e,t){(function(){function n(o,r){if(typeof r!="function")return o;var i={};for(var s in o)Object.prototype.hasOwnProperty.call(o,s)&&(i[r(s,o[s])||s]=o[s]);return i}t!==void 0&&t.exports?t.exports=n:typeof define=="function"&&define.amd?define([],function(){return n}):window.rename=n})()}}),b4r=TV({"node_modules/deep-rename-keys/index.js"(e,t){var n=x4r(),o=C4r();t.exports=function r(i,s){var a=n(i);if(a!=="object"&&a!=="array")throw Error("expected an object");var c=[];for(var l in a==="object"&&(i=o(i,s),c={}),i)if(i.hasOwnProperty(l)){var h=i[l];n(h)==="object"||n(h)==="array"?c[l]=r(h,s):c[l]=h}return c}}}),kan=TV({"node_modules/eventemitter3/index.js"(e,t){var n=Object.prototype.hasOwnProperty,o="~";function r(){}function i(a,c,l){this.fn=a,this.context=c,this.once=l||!1}function s(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),new r().__proto__||(o=!1)),s.prototype.eventNames=function(){var a,c,l=[];if(this._eventsCount===0)return l;for(c in a=this._events)n.call(a,c)&&l.push(o?c.slice(1):c);return Object.getOwnPropertySymbols?l.concat(Object.getOwnPropertySymbols(a)):l},s.prototype.listeners=function(a,c){var l=o?o+a:a,h=this._events[l];if(c)return!!h;if(!h)return[];if(h.fn)return[h.fn];for(var d=0,u=h.length,_=Array(u);d<u;d++)_[d]=h[d].fn;return _},s.prototype.emit=function(a,c,l,h,d,u){var _=o?o+a:a;if(!this._events[_])return!1;var p,m,A=this._events[_],g=arguments.length;if(A.fn){switch(A.once&&this.removeListener(a,A.fn,void 0,!0),g){case 1:return A.fn.call(A.context),!0;case 2:return A.fn.call(A.context,c),!0;case 3:return A.fn.call(A.context,c,l),!0;case 4:return A.fn.call(A.context,c,l,h),!0;case 5:return A.fn.call(A.context,c,l,h,d),!0;case 6:return A.fn.call(A.context,c,l,h,d,u),!0}for(m=1,p=Array(g-1);m<g;m++)p[m-1]=arguments[m];A.fn.apply(A.context,p)}else{var f,y=A.length;for(m=0;m<y;m++)switch(A[m].once&&this.removeListener(a,A[m].fn,void 0,!0),g){case 1:A[m].fn.call(A[m].context);break;case 2:A[m].fn.call(A[m].context,c);break;case 3:A[m].fn.call(A[m].context,c,l);break;case 4:A[m].fn.call(A[m].context,c,l,h);break;default:if(!p)for(f=1,p=Array(g-1);f<g;f++)p[f-1]=arguments[f];A[m].fn.apply(A[m].context,p)}}return!0},s.prototype.on=function(a,c,l){var h=new i(c,l||this),d=o?o+a:a;return this._events[d]?this._events[d].fn?this._events[d]=[this._events[d],h]:this._events[d].push(h):(this._events[d]=h,this._eventsCount++),this},s.prototype.once=function(a,c,l){var h=new i(c,l||this,!0),d=o?o+a:a;return this._events[d]?this._events[d].fn?this._events[d]=[this._events[d],h]:this._events[d].push(h):(this._events[d]=h,this._eventsCount++),this},s.prototype.removeListener=function(a,c,l,h){var d=o?o+a:a;if(!this._events[d])return this;if(!c)return--this._eventsCount===0?this._events=new r:delete this._events[d],this;var u=this._events[d];if(u.fn)u.fn!==c||h&&!u.once||l&&u.context!==l||(--this._eventsCount===0?this._events=new r:delete this._events[d]);else{for(var _=0,p=[],m=u.length;_<m;_++)(u[_].fn!==c||h&&!u[_].once||l&&u[_].context!==l)&&p.push(u[_]);p.length?this._events[d]=p.length===1?p[0]:p:--this._eventsCount===0?this._events=new r:delete this._events[d]}return this},s.prototype.removeAllListeners=function(a){var c;return a?(c=o?o+a:a,this._events[c]&&(--this._eventsCount===0?this._events=new r:delete this._events[c])):(this._events=new r,this._eventsCount=0),this},s.prototype.off=s.prototype.removeListener,s.prototype.addListener=s.prototype.on,s.prototype.setMaxListeners=function(){return this},s.prefixed=o,s.EventEmitter=s,t!==void 0&&(t.exports=s)}}),I4r=TV({"node_modules/xml-lexer/dist/lexer.js"(e,t){function n(l,h,d){return h in l?Object.defineProperty(l,h,{value:d,enumerable:!0,configurable:!0,writable:!0}):l[h]=d,l}var o=kan(),r=function(){},i={data:"state-data",cdata:"state-cdata",tagBegin:"state-tag-begin",tagName:"state-tag-name",tagEnd:"state-tag-end",attributeNameStart:"state-attribute-name-start",attributeName:"state-attribute-name",attributeNameEnd:"state-attribute-name-end",attributeValueBegin:"state-attribute-value-begin",attributeValue:"state-attribute-value"},s={lt:"action-lt",gt:"action-gt",space:"action-space",equal:"action-equal",quote:"action-quote",slash:"action-slash",char:"action-char",error:"action-error"},a={text:"text",openTag:"open-tag",closeTag:"close-tag",attributeName:"attribute-name",attributeValue:"attribute-value"},c={" ":s.space,"\t":s.space,"\n":s.space,"\r":s.space,"<":s.lt,">":s.gt,'"':s.quote,"'":s.quote,"=":s.equal,"/":s.slash};t.exports={State:i,Action:s,Type:a,create:function(l){var h,d,u,_,p,m,A,g,f,y;l=Object.assign({debug:!1},l);var x=new o,C=i.data,b="",I="",v="",P="",M="",B="",T=function(D,L){if(I[0]!=="?"&&I[0]!=="!"){var H={type:D,value:L};l.debug&&console.log("emit:",H),x.emit("data",H)}};x.stateMachine=(n(y={},i.data,(n(h={},s.lt,function(){b.trim()&&T(a.text,b),I="",M=!1,C=i.tagBegin}),n(h,s.char,function(D){b+=D}),h)),n(y,i.cdata,n({},s.char,function(D){(b+=D).substr(-3)==="]]>"&&(T(a.text,b.slice(0,-3)),b="",C=i.data)})),n(y,i.tagBegin,(n(d={},s.space,r),n(d,s.char,function(D){I=D,C=i.tagName}),n(d,s.slash,function(){I="",M=!0}),d)),n(y,i.tagName,(n(u={},s.space,function(){M?C=i.tagEnd:(C=i.attributeNameStart,T(a.openTag,I))}),n(u,s.gt,function(){T(M?a.closeTag:a.openTag,I),b="",C=i.data}),n(u,s.slash,function(){C=i.tagEnd,T(a.openTag,I)}),n(u,s.char,function(D){(I+=D)==="![CDATA["&&(C=i.cdata,b="",I="")}),u)),n(y,i.tagEnd,(n(_={},s.gt,function(){T(a.closeTag,I),b="",C=i.data}),n(_,s.char,r),_)),n(y,i.attributeNameStart,(n(p={},s.char,function(D){v=D,C=i.attributeName}),n(p,s.gt,function(){b="",C=i.data}),n(p,s.space,r),n(p,s.slash,function(){M=!0,C=i.tagEnd}),p)),n(y,i.attributeName,(n(m={},s.space,function(){C=i.attributeNameEnd}),n(m,s.equal,function(){T(a.attributeName,v),C=i.attributeValueBegin}),n(m,s.gt,function(){P="",T(a.attributeName,v),T(a.attributeValue,P),b="",C=i.data}),n(m,s.slash,function(){M=!0,P="",T(a.attributeName,v),T(a.attributeValue,P),C=i.tagEnd}),n(m,s.char,function(D){v+=D}),m)),n(y,i.attributeNameEnd,(n(A={},s.space,r),n(A,s.equal,function(){T(a.attributeName,v),C=i.attributeValueBegin}),n(A,s.gt,function(){P="",T(a.attributeName,v),T(a.attributeValue,P),b="",C=i.data}),n(A,s.char,function(D){P="",T(a.attributeName,v),T(a.attributeValue,P),v=D,C=i.attributeName}),A)),n(y,i.attributeValueBegin,(n(g={},s.space,r),n(g,s.quote,function(D){B=D,P="",C=i.attributeValue}),n(g,s.gt,function(){T(a.attributeValue,P=""),b="",C=i.data}),n(g,s.char,function(D){B="",P=D,C=i.attributeValue}),g)),n(y,i.attributeValue,(n(f={},s.space,function(D){B?P+=D:(T(a.attributeValue,P),C=i.attributeNameStart)}),n(f,s.quote,function(D){B===D?(T(a.attributeValue,P),C=i.attributeNameStart):P+=D}),n(f,s.gt,function(D){B?P+=D:(T(a.attributeValue,P),b="",C=i.data)}),n(f,s.slash,function(D){B?P+=D:(T(a.attributeValue,P),M=!0,C=i.tagEnd)}),n(f,s.char,function(D){P+=D}),f)),y);var N=function(D){l.debug&&console.log(C,D);var L=x.stateMachine[C],H=L[function(V){return c[V]||s.char}(D)]||L[s.error]||L[s.char];H(D)};return x.write=function(D){for(var L=D.length,H=0;H<L;H++)N(D[H])},x}}}}),v4r=TV({"node_modules/xml-reader/dist/reader.js"(e,t){var n=kan(),o=I4r(),r=o.Type,i={element:"element",text:"text"},s=function(c){return Object.assign({name:"",type:i.element,value:"",parent:null,attributes:{},children:[]},c)},a=function(c){c=Object.assign({stream:!1,parentNodes:!0,doneEvent:"done",tagPrefix:"tag:",emitTopLevelOnly:!1,debug:!1},c);var l=void 0,h=void 0,d=void 0,u=void 0,_=new n,p=function(m){switch(m.type){case r.openTag:if(d===null)(d=h).name=m.value;else{var A=s({name:m.value,parent:d});d.children.push(A),d=A}break;case r.closeTag:var g=d.parent;if(c.parentNodes||(d.parent=null),d.name!==m.value)break;c.stream&&g===h&&(h.children=[],d.parent=null),c.emitTopLevelOnly&&g!==h||(_.emit(c.tagPrefix+d.name,d),_.emit("tag",d.name,d)),d===h&&(l.removeAllListeners("data"),_.emit(c.doneEvent,d),h=null),d=g;break;case r.text:d&&d.children.push(s({type:i.text,value:m.value,parent:c.parentNodes?d:null}));break;case r.attributeName:u=m.value,d.attributes[u]="";break;case r.attributeValue:d.attributes[u]=m.value}};return _.reset=function(){(l=o.create({debug:c.debug})).on("data",p),h=s(),d=null,u="",_.parse=l.write},_.reset(),_};t.exports={parseSync:function(c,l){l=Object.assign({},l,{stream:!1,tagPrefix:":"});var h=a(l),d=void 0;return h.on("done",function(u){d=u}),h.parse(c),d},create:a,NodeType:i}}}),{cos:zNs,sin:ONs,PI:VNs}=Math,{tan:YNs}=Math,S4r=(dYt(b4r()),dYt(v4r()),Object.create),{defineProperty:uYt,getOwnPropertyDescriptor:P4r,getOwnPropertyNames:Lan,getPrototypeOf:E4r}=Object,M4r=Object.prototype.hasOwnProperty,DV=(e,t)=>function(){return t||(0,e[Lan(e)[0]])((t={exports:{}}).exports,t),t.exports},pYt=(e,t,n)=>(n=e!=null?S4r(E4r(e)):{},((o,r,i,s)=>{if(r&&typeof r=="object"||typeof r=="function")for(let a of Lan(r))M4r.call(o,a)||a===i||uYt(o,a,{get:()=>r[a],enumerable:!(s=P4r(r,a))||s.enumerable});return o})(!t&&e&&e.__esModule?n:uYt(n,"default",{value:e,enumerable:!0}),e)),w4r=DV({"node_modules/is-buffer/index.js"(e,t){function n(o){return!!o.constructor&&typeof o.constructor.isBuffer=="function"&&o.constructor.isBuffer(o)}t.exports=function(o){return o!=null&&(n(o)||function(r){return typeof r.readFloatLE=="function"&&typeof r.slice=="function"&&n(r.slice(0,0))}(o)||!!o._isBuffer)}}}),B4r=DV({"node_modules/kind-of/index.js"(e,t){var n=w4r(),o=Object.prototype.toString;t.exports=function(r){if(r===void 0)return"undefined";if(r===null)return"null";if(r===!0||r===!1||r instanceof Boolean)return"boolean";if(typeof r=="string"||r instanceof String)return"string";if(typeof r=="number"||r instanceof Number)return"number";if(typeof r=="function"||r instanceof Function)return"function";if(Array.isArray!==void 0&&Array.isArray(r))return"array";if(r instanceof RegExp)return"regexp";if(r instanceof Date)return"date";var i=o.call(r);return i==="[object RegExp]"?"regexp":i==="[object Date]"?"date":i==="[object Arguments]"?"arguments":i==="[object Error]"?"error":n(r)?"buffer":i==="[object Set]"?"set":i==="[object WeakSet]"?"weakset":i==="[object Map]"?"map":i==="[object WeakMap]"?"weakmap":i==="[object Symbol]"?"symbol":i==="[object Int8Array]"?"int8array":i==="[object Uint8Array]"?"uint8array":i==="[object Uint8ClampedArray]"?"uint8clampedarray":i==="[object Int16Array]"?"int16array":i==="[object Uint16Array]"?"uint16array":i==="[object Int32Array]"?"int32array":i==="[object Uint32Array]"?"uint32array":i==="[object Float32Array]"?"float32array":i==="[object Float64Array]"?"float64array":"object"}}}),T4r=DV({"node_modules/rename-keys/index.js"(e,t){(function(){function n(o,r){if(typeof r!="function")return o;var i={};for(var s in o)Object.prototype.hasOwnProperty.call(o,s)&&(i[r(s,o[s])||s]=o[s]);return i}t!==void 0&&t.exports?t.exports=n:typeof define=="function"&&define.amd?define([],function(){return n}):window.rename=n})()}}),D4r=DV({"node_modules/deep-rename-keys/index.js"(e,t){var n=B4r(),o=T4r();t.exports=function r(i,s){var a=n(i);if(a!=="object"&&a!=="array")throw Error("expected an object");var c=[];for(var l in a==="object"&&(i=o(i,s),c={}),i)if(i.hasOwnProperty(l)){var h=i[l];n(h)==="object"||n(h)==="array"?c[l]=r(h,s):c[l]=h}return c}}}),Han=DV({"node_modules/eventemitter3/index.js"(e,t){var n=Object.prototype.hasOwnProperty,o="~";function r(){}function i(a,c,l){this.fn=a,this.context=c,this.once=l||!1}function s(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),new r().__proto__||(o=!1)),s.prototype.eventNames=function(){var a,c,l=[];if(this._eventsCount===0)return l;for(c in a=this._events)n.call(a,c)&&l.push(o?c.slice(1):c);return Object.getOwnPropertySymbols?l.concat(Object.getOwnPropertySymbols(a)):l},s.prototype.listeners=function(a,c){var l=o?o+a:a,h=this._events[l];if(c)return!!h;if(!h)return[];if(h.fn)return[h.fn];for(var d=0,u=h.length,_=Array(u);d<u;d++)_[d]=h[d].fn;return _},s.prototype.emit=function(a,c,l,h,d,u){var _=o?o+a:a;if(!this._events[_])return!1;var p,m,A=this._events[_],g=arguments.length;if(A.fn){switch(A.once&&this.removeListener(a,A.fn,void 0,!0),g){case 1:return A.fn.call(A.context),!0;case 2:return A.fn.call(A.context,c),!0;case 3:return A.fn.call(A.context,c,l),!0;case 4:return A.fn.call(A.context,c,l,h),!0;case 5:return A.fn.call(A.context,c,l,h,d),!0;case 6:return A.fn.call(A.context,c,l,h,d,u),!0}for(m=1,p=Array(g-1);m<g;m++)p[m-1]=arguments[m];A.fn.apply(A.context,p)}else{var f,y=A.length;for(m=0;m<y;m++)switch(A[m].once&&this.removeListener(a,A[m].fn,void 0,!0),g){case 1:A[m].fn.call(A[m].context);break;case 2:A[m].fn.call(A[m].context,c);break;case 3:A[m].fn.call(A[m].context,c,l);break;case 4:A[m].fn.call(A[m].context,c,l,h);break;default:if(!p)for(f=1,p=Array(g-1);f<g;f++)p[f-1]=arguments[f];A[m].fn.apply(A[m].context,p)}}return!0},s.prototype.on=function(a,c,l){var h=new i(c,l||this),d=o?o+a:a;return this._events[d]?this._events[d].fn?this._events[d]=[this._events[d],h]:this._events[d].push(h):(this._events[d]=h,this._eventsCount++),this},s.prototype.once=function(a,c,l){var h=new i(c,l||this,!0),d=o?o+a:a;return this._events[d]?this._events[d].fn?this._events[d]=[this._events[d],h]:this._events[d].push(h):(this._events[d]=h,this._eventsCount++),this},s.prototype.removeListener=function(a,c,l,h){var d=o?o+a:a;if(!this._events[d])return this;if(!c)return--this._eventsCount===0?this._events=new r:delete this._events[d],this;var u=this._events[d];if(u.fn)u.fn!==c||h&&!u.once||l&&u.context!==l||(--this._eventsCount===0?this._events=new r:delete this._events[d]);else{for(var _=0,p=[],m=u.length;_<m;_++)(u[_].fn!==c||h&&!u[_].once||l&&u[_].context!==l)&&p.push(u[_]);p.length?this._events[d]=p.length===1?p[0]:p:--this._eventsCount===0?this._events=new r:delete this._events[d]}return this},s.prototype.removeAllListeners=function(a){var c;return a?(c=o?o+a:a,this._events[c]&&(--this._eventsCount===0?this._events=new r:delete this._events[c])):(this._events=new r,this._eventsCount=0),this},s.prototype.off=s.prototype.removeListener,s.prototype.addListener=s.prototype.on,s.prototype.setMaxListeners=function(){return this},s.prefixed=o,s.EventEmitter=s,t!==void 0&&(t.exports=s)}}),N4r=DV({"node_modules/xml-lexer/dist/lexer.js"(e,t){function n(l,h,d){return h in l?Object.defineProperty(l,h,{value:d,enumerable:!0,configurable:!0,writable:!0}):l[h]=d,l}var o=Han(),r=function(){},i={data:"state-data",cdata:"state-cdata",tagBegin:"state-tag-begin",tagName:"state-tag-name",tagEnd:"state-tag-end",attributeNameStart:"state-attribute-name-start",attributeName:"state-attribute-name",attributeNameEnd:"state-attribute-name-end",attributeValueBegin:"state-attribute-value-begin",attributeValue:"state-attribute-value"},s={lt:"action-lt",gt:"action-gt",space:"action-space",equal:"action-equal",quote:"action-quote",slash:"action-slash",char:"action-char",error:"action-error"},a={text:"text",openTag:"open-tag",closeTag:"close-tag",attributeName:"attribute-name",attributeValue:"attribute-value"},c={" ":s.space,"\t":s.space,"\n":s.space,"\r":s.space,"<":s.lt,">":s.gt,'"':s.quote,"'":s.quote,"=":s.equal,"/":s.slash};t.exports={State:i,Action:s,Type:a,create:function(l){var h,d,u,_,p,m,A,g,f,y;l=Object.assign({debug:!1},l);var x=new o,C=i.data,b="",I="",v="",P="",M="",B="",T=function(D,L){if(I[0]!=="?"&&I[0]!=="!"){var H={type:D,value:L};l.debug&&console.log("emit:",H),x.emit("data",H)}};x.stateMachine=(n(y={},i.data,(n(h={},s.lt,function(){b.trim()&&T(a.text,b),I="",M=!1,C=i.tagBegin}),n(h,s.char,function(D){b+=D}),h)),n(y,i.cdata,n({},s.char,function(D){(b+=D).substr(-3)==="]]>"&&(T(a.text,b.slice(0,-3)),b="",C=i.data)})),n(y,i.tagBegin,(n(d={},s.space,r),n(d,s.char,function(D){I=D,C=i.tagName}),n(d,s.slash,function(){I="",M=!0}),d)),n(y,i.tagName,(n(u={},s.space,function(){M?C=i.tagEnd:(C=i.attributeNameStart,T(a.openTag,I))}),n(u,s.gt,function(){T(M?a.closeTag:a.openTag,I),b="",C=i.data}),n(u,s.slash,function(){C=i.tagEnd,T(a.openTag,I)}),n(u,s.char,function(D){(I+=D)==="![CDATA["&&(C=i.cdata,b="",I="")}),u)),n(y,i.tagEnd,(n(_={},s.gt,function(){T(a.closeTag,I),b="",C=i.data}),n(_,s.char,r),_)),n(y,i.attributeNameStart,(n(p={},s.char,function(D){v=D,C=i.attributeName}),n(p,s.gt,function(){b="",C=i.data}),n(p,s.space,r),n(p,s.slash,function(){M=!0,C=i.tagEnd}),p)),n(y,i.attributeName,(n(m={},s.space,function(){C=i.attributeNameEnd}),n(m,s.equal,function(){T(a.attributeName,v),C=i.attributeValueBegin}),n(m,s.gt,function(){P="",T(a.attributeName,v),T(a.attributeValue,P),b="",C=i.data}),n(m,s.slash,function(){M=!0,P="",T(a.attributeName,v),T(a.attributeValue,P),C=i.tagEnd}),n(m,s.char,function(D){v+=D}),m)),n(y,i.attributeNameEnd,(n(A={},s.space,r),n(A,s.equal,function(){T(a.attributeName,v),C=i.attributeValueBegin}),n(A,s.gt,function(){P="",T(a.attributeName,v),T(a.attributeValue,P),b="",C=i.data}),n(A,s.char,function(D){P="",T(a.attributeName,v),T(a.attributeValue,P),v=D,C=i.attributeName}),A)),n(y,i.attributeValueBegin,(n(g={},s.space,r),n(g,s.quote,function(D){B=D,P="",C=i.attributeValue}),n(g,s.gt,function(){T(a.attributeValue,P=""),b="",C=i.data}),n(g,s.char,function(D){B="",P=D,C=i.attributeValue}),g)),n(y,i.attributeValue,(n(f={},s.space,function(D){B?P+=D:(T(a.attributeValue,P),C=i.attributeNameStart)}),n(f,s.quote,function(D){B===D?(T(a.attributeValue,P),C=i.attributeNameStart):P+=D}),n(f,s.gt,function(D){B?P+=D:(T(a.attributeValue,P),b="",C=i.data)}),n(f,s.slash,function(D){B?P+=D:(T(a.attributeValue,P),M=!0,C=i.tagEnd)}),n(f,s.char,function(D){P+=D}),f)),y);var N=function(D){l.debug&&console.log(C,D);var L=x.stateMachine[C],H=L[function(V){return c[V]||s.char}(D)]||L[s.error]||L[s.char];H(D)};return x.write=function(D){for(var L=D.length,H=0;H<L;H++)N(D[H])},x}}}}),R4r=DV({"node_modules/xml-reader/dist/reader.js"(e,t){var n=Han(),o=N4r(),r=o.Type,i={element:"element",text:"text"},s=function(c){return Object.assign({name:"",type:i.element,value:"",parent:null,attributes:{},children:[]},c)},a=function(c){c=Object.assign({stream:!1,parentNodes:!0,doneEvent:"done",tagPrefix:"tag:",emitTopLevelOnly:!1,debug:!1},c);var l=void 0,h=void 0,d=void 0,u=void 0,_=new n,p=function(m){switch(m.type){case r.openTag:if(d===null)(d=h).name=m.value;else{var A=s({name:m.value,parent:d});d.children.push(A),d=A}break;case r.closeTag:var g=d.parent;if(c.parentNodes||(d.parent=null),d.name!==m.value)break;c.stream&&g===h&&(h.children=[],d.parent=null),c.emitTopLevelOnly&&g!==h||(_.emit(c.tagPrefix+d.name,d),_.emit("tag",d.name,d)),d===h&&(l.removeAllListeners("data"),_.emit(c.doneEvent,d),h=null),d=g;break;case r.text:d&&d.children.push(s({type:i.text,value:m.value,parent:c.parentNodes?d:null}));break;case r.attributeName:u=m.value,d.attributes[u]="";break;case r.attributeValue:d.attributes[u]=m.value}};return _.reset=function(){(l=o.create({debug:c.debug})).on("data",p),h=s(),d=null,u="",_.parse=l.write},_.reset(),_};t.exports={parseSync:function(c,l){l=Object.assign({},l,{stream:!1,tagPrefix:":"});var h=a(l),d=void 0;return h.on("done",function(u){d=u}),h.parse(c),d},create:a,NodeType:i}}}),{cos:GNs,sin:UNs,PI:WNs}=Math,{tan:XNs}=Math;pYt(D4r()),pYt(R4r());function iXe(e,t){if(e.points)for(let n of e.points)n.step=t;if(e.lines)for(let n of e.lines)n.step=t;if(e.infiniteLines)for(let n of e.infiniteLines)n.step=t;if(e.polygons)for(let n of e.polygons)n.step=t;if(e.rects)for(let n of e.rects)n.step=t;if(e.circles)for(let n of e.circles)n.step=t;if(e.texts)for(let n of e.texts)n.step=t;return e}var Ole=class{MAX_ITERATIONS=1e5;solved=!1;failed=!1;iterations=0;progress=0;error=null;activeSubSolver;failedSubSolvers;timeToSolve;stats={};_setupDone=!1;getSolverName(){return this.constructor.name}setup(){this._setupDone||(this._setup(),this._setupDone=!0)}_setup(){}step(){if(this._setupDone||this.setup(),!this.solved&&!this.failed){this.iterations++;try{this._step()}catch(e){throw this.error=`${this.getSolverName()} error: ${e}`,this.failed=!0,e}!this.solved&&this.iterations>=this.MAX_ITERATIONS&&this.tryFinalAcceptance(),!this.solved&&this.iterations>=this.MAX_ITERATIONS&&(this.error=`${this.getSolverName()} ran out of iterations`,this.failed=!0),"computeProgress"in this&&(this.progress=this.computeProgress())}}_step(){}getConstructorParams(){throw Error("getConstructorParams not implemented")}getOutput(){return null}solve(){let e=Date.now();for(;!this.solved&&!this.failed;)this.step();let t=Date.now();this.timeToSolve=t-e}visualize(){return{lines:[],points:[],rects:[],circles:[]}}tryFinalAcceptance(){}preview(){return{lines:[],points:[],rects:[],circles:[]}}};function P3e(e,t,n,o={}){return{solverName:e,solverClass:t,getConstructorParams:n,onSolved:o.onSolved}}var Q4r=class extends Ole{startTimeOfStage={};endTimeOfStage={};timeSpentOnStage={};firstIterationOfStage={};currentPipelineStageIndex=0;inputProblem;pipelineOutputs={};constructor(e){super(),this.inputProblem=e,this.MAX_ITERATIONS=1e6}_step(){let e=this.pipelineDef[this.currentPipelineStageIndex];if(!e)return void(this.solved=!0);if(this.activeSubSolver){if(this.activeSubSolver.step(),this.activeSubSolver.solved){this.endTimeOfStage[e.solverName]=performance.now(),this.timeSpentOnStage[e.solverName]=this.endTimeOfStage[e.solverName]-this.startTimeOfStage[e.solverName];let n=this.activeSubSolver.getOutput();n!==null&&(this.pipelineOutputs[e.solverName]=n),e.onSolved?.(this),this.activeSubSolver=null,this.currentPipelineStageIndex++}else this.activeSubSolver.failed&&(this.error=this.activeSubSolver?.error,this.failed=!0,this.activeSubSolver=null);return}let t=e.getConstructorParams(this);this.activeSubSolver=new e.solverClass(...t),this[e.solverName]=this.activeSubSolver,this.timeSpentOnStage[e.solverName]=0,this.startTimeOfStage[e.solverName]=performance.now(),this.firstIterationOfStage[e.solverName]=this.iterations}solveUntilStage(e){for(;this.getCurrentStageName().toLowerCase()!==e.toLowerCase()&&(this.step(),!this.failed&&!this.solved););}getCurrentStageName(){return this.pipelineDef[this.currentPipelineStageIndex]?.solverName??"none"}getStageProgress(){let e=this.pipelineDef.length;if(e===0)return 1;let t=this.activeSubSolver?.progress??0;return(this.currentPipelineStageIndex+t)/e}getStageStats(){let e={};for(let t of this.pipelineDef){let n=this.timeSpentOnStage[t.solverName]||0,o=this.firstIterationOfStage[t.solverName]||0,r=this.iterations,i=t.solverName===this.getCurrentStageName()?r-o:0,s=this.currentPipelineStageIndex>this.pipelineDef.findIndex((a)=>a.solverName===t.solverName);e[t.solverName]={timeSpent:n,iterations:i,completed:s}}return e}initialVisualize(){return null}finalVisualize(){return null}visualize(){if(!this.solved&&this.activeSubSolver)return this.activeSubSolver.visualize();let e=0,t=this.initialVisualize();t&&(iXe(t,0),e=1);let n=null;this.solved&&(n=this.finalVisualize());let o=[t].filter(Boolean).concat(this.pipelineDef.map((r,i)=>{let s=this[r.solverName],a=s?.visualize();return a?(iXe(a,i+e),a):null}).filter(Boolean));return o.length===0?{points:[],rects:[],lines:[],circles:[],texts:[]}:(this.solved&&n&&(iXe(n,o.length+e+1),o.push(n)),o.length===1?o[0]:{points:o.flatMap((r)=>r.points||[]),rects:o.flatMap((r)=>r.rects||[]),lines:o.flatMap((r)=>r.lines||[]),circles:o.flatMap((r)=>r.circles||[]),texts:o.flatMap((r)=>r.texts||[])})}preview(){return this.activeSubSolver?this.activeSubSolver.preview():super.preview()}computeProgress(){return this.getStageProgress()}getStageOutput(e){return this.pipelineOutputs[e]}getAllOutputs(){return{...this.pipelineOutputs}}hasStageOutput(e){return e in this.pipelineOutputs}getSolver(e){return this[e]}},wKe=(e,t,n)=>(t.x-e.x)*(n.y-e.y)-(t.y-e.y)*(n.x-e.x),Fan=(e,t)=>{let n=[...new Set(e)].map((i)=>{let s=t[i];return s?{i,x:s.x,y:s.y}:null}).filter((i)=>i!==null);if(n.sort((i,s)=>i.x-s.x||i.y-s.y),n.length<=2)return n.map((i)=>i.i);let o=[],r=[];for(let i of n){for(;o.length>=2;){let s=o[o.length-2],a=o[o.length-1];if(!s||!a||wKe(s,a,i)>0.0000000001)break;o.pop()}o.push(i)}for(let i=n.length-1;i>=0;i--){let s=n[i];if(s){for(;r.length>=2;){let a=r[r.length-2],c=r[r.length-1];if(!a||!c||wKe(a,c,s)>0.0000000001)break;r.pop()}r.push(s)}}return o.pop(),r.pop(),o.concat(r).map((i)=>i.i)},mYt=(e)=>e!==void 0,k4r=class extends Ole{input;output=null;constructor(e){super(),this.input=e}_step(){let{regions:e,hulls:t}={regions:(n=this.input).cells.map((o)=>o.map((r)=>n.pts[r]).filter(mYt)),hulls:n.cells.map((o)=>Fan(o,n.pts).map((r)=>n.pts[r]).filter(mYt))};var n;this.output={pts:this.input.pts,validTris:this.input.validTris,regions:e,hulls:t,depths:this.input.depths},this.stats={regions:e.length},this.solved=!0}getConstructorParams(){return[this.input]}getOutput(){return this.output}visualize(){let e=this.output;return e?{points:e.pts.map((t)=>({x:t.x,y:t.y,color:"#3b82f6"})),lines:e.regions.flatMap((t)=>t.flatMap((n,o)=>{let r=t[(o+1)%t.length];return r?[{points:[n,r],strokeColor:"#0f766e"}]:[]})),rects:[],circles:[],texts:[{x:4,y:12,text:`regions: ${e.regions.length}`,color:"#1f2937"}]}:{points:[],lines:[],rects:[],circles:[],texts:[]}}},E3e=(e,t,n)=>{let o=Math.cos(n.ccwRotation),r=Math.sin(n.ccwRotation);return{x:n.center.x+e*o-t*r,y:n.center.y+e*r+t*o}},L4r=(e,t=[],n,o=[])=>{let r=[],{minX:i,maxX:s,minY:a,maxY:c}=e;r.push({x:i,y:a},{x:s,y:a},{x:s,y:c},{x:i,y:c});for(let l=1;l<10;l++){let h=l/10;r.push({x:i+h*(s-i),y:a}),r.push({x:s,y:a+h*(c-a)}),r.push({x:s-h*(s-i),y:c}),r.push({x:i,y:c-h*(c-a)})}for(let l of t){let h=l.diameter/2+n;for(let d=0;d<24;d++){let u=2*Math.PI*d/24;r.push({x:l.center.x+h*Math.cos(u),y:l.center.y+h*Math.sin(u)})}}for(let l of o){let h=l.width/2+n,d=l.height/2+n,u=Math.max(2,Math.ceil(Math.max(2*h,2*d)/20));for(let _=0;_<u;_++){let p=_/u;r.push(E3e(2*p*h-h,-d,l)),r.push(E3e(h,2*p*d-d,l)),r.push(E3e(h-2*p*h,d,l)),r.push(E3e(-h,d-2*p*d,l))}}return r.map((l,h)=>({x:l.x+0.000001*(h%7-3),y:l.y+0.000001*(h%5-2)}))},H4r=class extends Ole{input;output=null;constructor(e){super(),this.input=e}_step(){let e=this.input.vias??[],t=this.input.rects??[];this.output={pts:L4r(this.input.bounds,e,this.input.clearance,t)},this.stats={points:this.output.pts.length},this.solved=!0}getConstructorParams(){return[this.input]}getOutput(){return this.output}visualize(){let e=(this.output?.pts??[]).map((t)=>({x:t.x,y:t.y,color:"#2563eb"}));return{points:e,lines:[],rects:[],circles:(this.input.vias??[]).map((t)=>({center:{x:t.center.x,y:t.center.y},radius:t.diameter/2+this.input.clearance,stroke:"#ef4444"})),texts:[{x:this.input.bounds.minX+6,y:this.input.bounds.minY+12,text:`sample points: ${e.length}`,color:"#1f2937"}]}}},F4r=(e,t,n)=>{let o=n.x-t.x,r=n.y-t.y,i=o*o+r*r;if(i<0.0000000001)return Math.hypot(e.x-t.x,e.y-t.y);let s=((e.x-t.x)*o+(e.y-t.y)*r)/i;return s=Math.max(0,Math.min(1,s)),Math.hypot(e.x-t.x-s*o,e.y-t.y-s*r)},_Yt=(e,t)=>{if(e.length<=3)return 0;let n=Fan(e,t),o=new Set(n),r=n.map((s)=>t[s]).filter((s)=>Boolean(s)),i=0;for(let s of e){if(o.has(s))continue;let a=t[s];if(!a)continue;let c=Number.POSITIVE_INFINITY;for(let l=0;l<r.length;l++){let h=r[l],d=r[(l+1)%r.length];h&&d&&(c=Math.min(c,F4r(a,h,d)))}i=Math.max(i,c)}return i},sXe=(e,t)=>e<t?1e5*e+t:1e5*t+e,z4r=(e,t)=>{let n=e.map((d,u)=>[d,e[(u+1)%e.length]]),o=t.map((d,u)=>[d,t[(u+1)%t.length]]),r=new Set;for(let[d,u]of n)if(u!==void 0)for(let[_,p]of o)p!==void 0&&d===p&&u===_&&r.add(sXe(d,u));if(r.size===0)return null;let i=[];for(let[d,u]of n)u!==void 0&&(r.has(sXe(d,u))||i.push([d,u]));for(let[d,u]of o)u!==void 0&&(r.has(sXe(d,u))||i.push([d,u]));if(i.length===0)return null;let s=new Map;for(let[d,u]of i)s.set(d,u);let a=i[0]?.[0];if(a===void 0)return null;let c=[a],l=s.get(a),h=0;for(;l!==void 0&&l!==a&&h++<i.length+5;)c.push(l),l=s.get(l);return l!==a||c.length!==i.length?null:c},O4r=(e,t)=>e<t?1e5*e+t:1e5*t+e,V4r=class extends Ole{input;output=null;constructor(e){super(),this.input=e}_step(){let e=((t,n,o)=>{if(!t.length)return{cells:[],depths:[]};let r=t.map(([c,l,h])=>{let d=n[c],u=n[l],_=n[h];return d&&u&&_&&wKe(d,u,_)<0?[c,h,l]:[c,l,h]}),i=!0,s=0;for(;i&&s++<800;){i=!1;let c=new Map,l=r.map(()=>new Set);for(let p=0;p<r.length;p++){let m=r[p];if(m)for(let A=0;A<m.length;A++){let g=m[A],f=m[(A+1)%m.length];if(g===void 0||f===void 0)continue;let y=O4r(g,f);if(c.has(y)){let x=c.get(y);x!==void 0&&(l[p]?.add(x),l[x]?.add(p))}else c.set(y,p)}}let h=-1,d=-1,u=null,_=Number.POSITIVE_INFINITY;for(let p=0;p<r.length;p++){let m=l[p];if(m)for(let A of m){if(A<=p)continue;let g=z4r(r[p]??[],r[A]??[]);if(!g)continue;let f=_Yt(g,n);f<=o+0.000001&&f<_&&(_=f,h=p,d=A,u=g)}}if(h<0||d<0||!u)break;r[h]=u,r.splice(d,1),i=!0}let a=r.map((c)=>_Yt(c,n));return{cells:r,depths:a}})(this.input.validTris,this.input.pts,this.input.concavityTolerance);this.output={pts:this.input.pts,validTris:this.input.validTris,cells:e.cells,depths:e.depths},this.stats={mergedCells:e.cells.length,maxDepth:e.depths.length?Math.max(...e.depths):0},this.solved=!0}getConstructorParams(){return[this.input]}getOutput(){return this.output}visualize(){let e=this.output?.cells??[];return{points:this.input.pts.map((t)=>({x:t.x,y:t.y,color:"#3b82f6"})),lines:e.flatMap((t)=>t.flatMap((n,o)=>{let r=this.input.pts[n],i=t[(o+1)%t.length],s=i===void 0?void 0:this.input.pts[i];return r&&s?[{points:[r,s],strokeColor:"#10b981"}]:[]})),rects:[],circles:[],texts:[{x:4,y:12,text:`merged cells: ${e.length}`,color:"#1f2937"}]}}},gYt=(e,t,n)=>{let o=2*(e.x*(t.y-n.y)+t.x*(n.y-e.y)+n.x*(e.y-t.y));if(Math.abs(o)<0.0000000001)return{x:0,y:0,r2:1000000000000000000};let r=e.x*e.x+e.y*e.y,i=t.x*t.x+t.y*t.y,s=n.x*n.x+n.y*n.y,a=(r*(t.y-n.y)+i*(n.y-e.y)+s*(e.y-t.y))/o,c=(r*(n.x-t.x)+i*(e.x-n.x)+s*(t.x-e.x))/o;return{x:a,y:c,r2:(e.x-a)**2+(e.y-c)**2}},Y4r=(e,t,n)=>[e.a,e.b,e.c].includes(t)&&[e.a,e.b,e.c].includes(n),G4r=(e,t,n,o=[],r,i=[])=>e.filter(([s,a,c])=>{let l=t[s],h=t[a],d=t[c];if(!l||!h||!d)return!1;return((u,_,p,m=[],A,g=[])=>{let{minX:f,maxX:y,minY:x,maxY:C}=p;if(u<f-0.1||u>y+0.1||_<x-0.1||_>C+0.1)return!1;for(let b of m){let I=b.diameter/2+A;if((u-b.center.x)**2+(_-b.center.y)**2<I*I-0.1)return!1}for(let b of g){let I=b.width/2+A,v=b.height/2+A,P=u-b.center.x,M=_-b.center.y,B=Math.cos(b.ccwRotation),T=Math.sin(b.ccwRotation),N=P*B+M*T,D=-P*T+M*B;if(Math.abs(N)<I-0.1&&Math.abs(D)<v-0.1)return!1}return!0})((l.x+h.x+d.x)/3,(l.y+h.y+d.y)/3,n,o,r,i)}),U4r=class extends Ole{input;output=null;constructor(e){super(),this.input=e}_step(){let e=this.input.vias??[],t=this.input.rects??[],n=((r)=>{let i=r.map((g,f)=>({...g,i:f}));if(i.length<3)return[];let{POSITIVE_INFINITY:s,POSITIVE_INFINITY:a,NEGATIVE_INFINITY:c,NEGATIVE_INFINITY:l}=Number;for(let g of i)s=Math.min(s,g.x),a=Math.min(a,g.y),c=Math.max(c,g.x),l=Math.max(l,g.y);let h=Math.max(c-s,l-a)||1,d=(s+c)/2,u=(a+l)/2,_={x:d-30*h,y:u-h,i:-1},p={x:d,y:u+30*h,i:-2},m={x:d+30*h,y:u-h,i:-3},A=[{a:_,b:p,c:m,cc:gYt(_,p,m)}];for(let g of i){let f=A.filter((C)=>{let b=g.x-C.cc.x,I=g.y-C.cc.y;return b*b+I*I<C.cc.r2+0.000001}),y=new Set(f),x=[];for(let C of f){let b=[[C.a,C.b],[C.b,C.c],[C.c,C.a]];for(let[I,v]of b){let P=!1;for(let M of f)if(M!==C&&Y4r(M,I,v)){P=!0;break}P||x.push([I,v])}}A=A.filter((C)=>!y.has(C));for(let[C,b]of x)A.push({a:C,b,c:g,cc:gYt(C,b,g)})}return A.filter((g)=>g.a.i>=0&&g.b.i>=0&&g.c.i>=0).map((g)=>[g.a.i,g.b.i,g.c.i])})(this.input.pts),o=G4r(n,this.input.pts,this.input.bounds,e,this.input.clearance,t);this.output={pts:this.input.pts,validTris:o},this.stats={candidateTriangles:n.length,validTriangles:o.length},this.solved=!0}getConstructorParams(){return[this.input]}getOutput(){return this.output}visualize(){let e=this.output?.validTris??[];return{points:this.input.pts.map((t)=>({x:t.x,y:t.y,color:"#2563eb"})),lines:e.flatMap(([t,n,o])=>{let r=this.input.pts[t],i=this.input.pts[n],s=this.input.pts[o];return r&&i&&s?[{points:[r,i],strokeColor:"#64748b"},{points:[i,s],strokeColor:"#64748b"},{points:[s,r],strokeColor:"#64748b"}]:[]}),rects:[],circles:[],texts:[{x:this.input.bounds.minX+6,y:this.input.bounds.minY+12,text:`valid triangles: ${e.length}`,color:"#1f2937"}]}}},W4r=class extends Q4r{pipelineDef=[P3e("generatePoints",H4r,(e)=>[e.inputProblem]),P3e("triangulate",U4r,(e)=>{let t=e.getStageOutput("generatePoints");if(!t)throw Error("generatePoints output missing");return[{pts:t.pts,bounds:e.inputProblem.bounds,vias:e.inputProblem.vias,rects:e.inputProblem.rects,clearance:e.inputProblem.clearance}]}),P3e("mergeCells",V4r,(e)=>{let t=e.getStageOutput("triangulate");if(!t)throw Error("triangulate output missing");return[{pts:t.pts,validTris:t.validTris,concavityTolerance:e.inputProblem.concavityTolerance}]}),P3e("buildRegions",k4r,(e)=>{let t=e.getStageOutput("mergeCells");if(!t)throw Error("mergeCells output missing");return[t]})];getConstructorParams(){return[this.inputProblem]}getOutput(){return this.getStageOutput("buildRegions")??null}visualize(){let e=this.getOutput();return e?{points:e.pts.map((t)=>({x:t.x,y:t.y,color:"#38b6ff"})),lines:e.regions.flatMap((t)=>t.map((n,o)=>{let r=t[(o+1)%t.length]??n;return{points:[{x:n.x,y:n.y},{x:r.x,y:r.y}],strokeColor:"#4ecb82"}})),rects:[],circles:(this.inputProblem.vias??[]).map((t)=>({center:{x:t.center.x,y:t.center.y},radius:t.diameter/2,stroke:"#ff6b6b"})),texts:[{x:this.inputProblem.bounds.minX+8,y:this.inputProblem.bounds.minY+16,text:`regions=${e.regions.length}`,color:"#ffffff"}]}:{points:[],lines:[],rects:[],circles:[],texts:[]}}},BKe=0.000000001,X4r=(e,t)=>{let n=[Oan(e)],o=[],r=t.maxSplitsPerRegion??32;for(;n.length>0;){let i=n.pop();if(!i)continue;if(i.length<4){o.push(i);continue}let s=j4r(i,t);if(!s||r<=0){o.push(i);continue}let[a,c]=$4r(i,s.i,s.j);r-=1,n.push(a,c)}return o},j4r=(e,t)=>{let n=q4r(e);if(!n)return null;let{triangles:o}=n,r=t3r(e);if(r<=BKe)return null;let i=Math.sqrt(r),s=o.map((c)=>n3r(e[c[0]],e[c[1]],e[c[2]])),a=null;for(let c of n.internalEdges){let{i:l,j:h,triA:d,triB:u}=c,_=o3r(e[l],e[h])/i;if(_>t.maxNeckRatio)continue;let p=K4r(d,u,o.length,n.triangleAdjacency,s),m=r-p,A=Math.min(p,m)/r;if(A<t.minSplitBalanceRatio)continue;let g=_/Math.max(A,BKe);(!a||g<a.score)&&(a={i:l,j:h,score:g})}return a?{i:a.i,j:a.j}:null},K4r=(e,t,n,o,r)=>{let i=Array(n).fill(!1),s=[e];i[t]=!0;let a=0;for(;s.length>0;){let c=s.pop();if(c===void 0||i[c])continue;i[c]=!0,a+=r[c]??0;let l=o[c]??[];for(let h of l)i[h]||s.push(h)}return a},$4r=(e,t,n)=>[AYt(e,t,n),AYt(e,n,t)],AYt=(e,t,n)=>{let o=[],r=e.length,i=t;for(o.push(e[i]);i!==n;)i=(i+1)%r,o.push(e[i]);return Oan(o)},q4r=(e)=>{let t=e.length;if(t<3)return null;let n=new Set;for(let a=0;a<t;a++){let c=(a+1)%t;n.add(fYt(a,c))}let o=J4r(e);if(!o||o.length===0)return null;let r=new Map;o.forEach((a,c)=>{for(let l=0;l<3;l++){let h=a[l],d=a[(l+1)%3],u=fYt(h,d),_=r.get(u);_?_.push(c):r.set(u,[c])}});let i=Array.from({length:o.length},()=>[]),s=[];for(let[a,c]of r.entries()){if(n.has(a))continue;if(c.length!==2)continue;let[l,h]=a.split("_"),d=Number(l),u=Number(h),_=c[0],p=c[1];s.push({i:d,j:u,triA:_,triB:p});let m=i[_],A=i[p];m&&m.push(p),A&&A.push(_)}return{triangles:o,internalEdges:s,triangleAdjacency:i}},J4r=(e)=>{let t=e.length;if(t<3)return null;let n=Math.sign(zan(e));if(n===0)return null;let o=[...Array(t).keys()];n<0&&o.reverse();let r=[],i=0;for(;o.length>3&&i<t*t;){let s=!1;for(let a=0;a<o.length;a++){let c=o[(a-1+o.length)%o.length],l=o[a],h=o[(a+1)%o.length];if(c===void 0||l===void 0||h===void 0)continue;let d=e[c],u=e[l],_=e[h];if(!d||!u||!_)continue;if(!Z4r(d,u,_))continue;let p=!1;for(let m of o){if(m===c||m===l||m===h)continue;let A=e[m];if(A&&e3r(A,d,u,_)){p=!0;break}}if(!p){r.push([c,l,h]),o.splice(a,1),s=!0;break}}if(!s)return null;i+=1}if(o.length===3){let[s,a,c]=o;s!==void 0&&a!==void 0&&c!==void 0&&r.push([s,a,c])}return r},Z4r=(e,t,n)=>Ece(e,t,n)>BKe,e3r=(e,t,n,o)=>{let r=Ece(t,n,e),i=Ece(n,o,e),s=Ece(o,t,e);return r>=-0.000000001&&i>=-0.000000001&&s>=-0.000000001},Ece=(e,t,n)=>(t.x-e.x)*(n.y-e.y)-(t.y-e.y)*(n.x-e.x),zan=(e)=>{let t=0;for(let n=0;n<e.length;n++){let o=e[n],r=e[(n+1)%e.length];o&&r&&(t+=o.x*r.y-r.x*o.y)}return t/2},t3r=(e)=>Math.abs(zan(e)),n3r=(e,t,n)=>Math.abs(Ece(e,t,n))/2,o3r=(e,t)=>Math.hypot(e.x-t.x,e.y-t.y),fYt=(e,t)=>e<t?`${e}_${t}`:`${t}_${e}`,Oan=(e)=>{if(e.length<2)return e;let t=e[0],n=e[e.length-1];return t&&n&&t.x===n.x&&t.y===n.y?e.slice(0,-1):e},Q4={pattern:"grid",pitchX:2.2,pitchY:1.8,staggerAxis:"x",staggerOffset:1.1,staggerOffsetX:1.1,padWidth:0.9,padHeight:1,padGap:0.35,viaDiameter:0.3,clearance:0.2,concavityTolerance:0.3,boundsPadding:1.2,orientation:"horizontal",portSpacing:0.25,maxNeckRatio:0,minSplitBalanceRatio:0.2},r3r=(e,t)=>{let{POSITIVE_INFINITY:n,POSITIVE_INFINITY:o,NEGATIVE_INFINITY:r,NEGATIVE_INFINITY:i}=Number;for(let s of e)for(let a of s.padCenters){let c=t.orientation==="horizontal"?t.padWidth/2:t.padHeight/2,l=t.orientation==="horizontal"?t.padHeight/2:t.padWidth/2;a.x-c<n&&(n=a.x-c),a.y-l<o&&(o=a.y-l),a.x+c>r&&(r=a.x+c),a.y+l>i&&(i=a.y+l)}return{minX:n-t.boundsPadding,minY:o-t.boundsPadding,maxX:r+t.boundsPadding,maxY:i+t.boundsPadding}},i3r=(e)=>e.pattern==="staggered"?((t)=>{let n=[],o=[],r=t.padGap/2+t.padWidth/2,i=-(t.cols-1)*t.pitchX/2,s=-(t.rows-1)*t.pitchY/2;for(let a=0;a<t.rows;a++){let c=t.staggerAxis==="x"&&a%2==1?t.staggerOffset:0;for(let l=0;l<t.cols;l++){let h=t.staggerAxis==="y"&&l%2==1?t.staggerOffset:0,d={x:i+l*t.pitchX+c,y:s+a*t.pitchY+h},u=t.orientation==="horizontal"?{x:d.x-r,y:d.y}:{x:d.x,y:d.y-r},_=t.orientation==="horizontal"?{x:d.x+r,y:d.y}:{x:d.x,y:d.y+r};n.push({jumperId:`jumper_r${a}_c${l}`,center:d,orientation:t.orientation,padCenters:[u,_]}),o.push({center:u,diameter:t.viaDiameter},{center:_,diameter:t.viaDiameter})}}return{jumpers:n,vias:o,bounds:r3r(n,t)}})(e):((t)=>{let n=[],o=[],r=t.padGap/2+t.padWidth/2,i=-(t.cols-1)*t.pitchX/2,s=-(t.rows-1)*t.pitchY/2;for(let a=0;a<t.rows;a++)for(let c=0;c<t.cols;c++){let l={x:i+c*t.pitchX,y:s+a*t.pitchY},h=t.orientation==="horizontal"?{x:l.x-r,y:l.y}:{x:l.x,y:l.y-r},d=t.orientation==="horizontal"?{x:l.x+r,y:l.y}:{x:l.x,y:l.y+r},u=`jumper_r${a}_c${c}`;n.push({jumperId:u,center:l,orientation:t.orientation,padCenters:[h,d]}),o.push({center:h,diameter:t.viaDiameter},{center:d,diameter:t.viaDiameter})}return{jumpers:n,vias:o,bounds:{minX:i-r-t.padWidth/2-t.boundsPadding,maxX:i+(t.cols-1)*t.pitchX+r+t.padWidth/2+t.boundsPadding,minY:s-r-t.padHeight/2-t.boundsPadding,maxY:s+(t.rows-1)*t.pitchY+r+t.padHeight/2+t.boundsPadding}}})(e),Van=(e)=>({x:(e.minX+e.maxX)/2,y:(e.minY+e.maxY)/2}),aXe=(e)=>[{x:e.minX,y:e.minY},{x:e.maxX,y:e.minY},{x:e.maxX,y:e.maxY},{x:e.minX,y:e.maxY}],uQ=(e,t,n)=>Math.abs(e-t)<=n,M3e=(e,t,n)=>uQ(e.x,t.x,n)&&uQ(e.y,t.y,n),s3r=(e)=>e.map((t,n)=>{let o=((r)=>{let{POSITIVE_INFINITY:i,POSITIVE_INFINITY:s,NEGATIVE_INFINITY:a,NEGATIVE_INFINITY:c}=Number;for(let l of r)l.x<i&&(i=l.x),l.y<s&&(s=l.y),l.x>a&&(a=l.x),l.y>c&&(c=l.y);return{minX:i,minY:s,maxX:a,maxY:c}})(t);return{regionId:`top_${n}`,ports:[],d:{bounds:o,center:Van(o),polygon:t,isPad:!1}}}),a3r=(e)=>{let t=e.end.x-e.start.x,n=e.end.y-e.start.y;return Math.hypot(t,n)},Cq=(e,t)=>({x:e.start.x+(e.end.x-e.start.x)*t,y:e.start.y+(e.end.y-e.start.y)*t}),yYt=(e,t,n)=>{let o=[];if(!e.d.polygon||!t.d.polygon)return o;for(let r=0;r<e.d.polygon.length;r++){let i=e.d.polygon[r],s=e.d.polygon[(r+1)%e.d.polygon.length];if(i&&s)for(let a=0;a<t.d.polygon.length;a++){let c=t.d.polygon[a],l=t.d.polygon[(a+1)%t.d.polygon.length];if(!c||!l)continue;let h=d3r({start:i,end:s},{start:c,end:l},n);if(!h)continue;o.some((d)=>h3r(d,h,n))||o.push(h)}}return o},c3r=(e,t)=>{let n=[];for(let o of e){let r=o,i=!0;for(;i;){i=!1;for(let s=0;s<n.length;s++){let a=n[s];if(!a)continue;let c=l3r(r,a,t);if(c){r=c,n.splice(s,1),i=!0;break}}}n.push(r)}return n},l3r=(e,t,n)=>{let o=e.end.x-e.start.x,r=e.end.y-e.start.y,i=t.end.x-t.start.x,s=t.end.y-t.start.y,a=o**2+r**2;if(a<=n**2)return null;if(!uQ(o*s-r*i,0,n))return null;let c=t.start.x-e.start.x,l=t.start.y-e.start.y,h=t.end.x-e.start.x,d=t.end.y-e.start.y,u=o*d-r*h;if(!uQ(o*l-r*c,0,n)||!uQ(u,0,n))return null;let _=(c*o+l*r)/a,p=(h*o+d*r)/a,m=Math.min(_,p),A=Math.max(_,p),g=n/Math.sqrt(a);if(m>1+g||A<0-g)return null;let f=Math.min(0,m),y=Math.max(1,A);return{start:Cq(e,f),end:Cq(e,y)}},h3r=(e,t,n)=>M3e(e.start,t.start,n)&&M3e(e.end,t.end,n)||M3e(e.start,t.end,n)&&M3e(e.end,t.start,n),d3r=(e,t,n)=>{let o=e.end.x-e.start.x,r=e.end.y-e.start.y,i=t.end.x-t.start.x,s=t.end.y-t.start.y,a=o**2+r**2;if(a<=n**2)return null;if(!uQ(o*s-r*i,0,n))return null;let c=t.start.x-e.start.x,l=t.start.y-e.start.y,h=t.end.x-e.start.x,d=t.end.y-e.start.y,u=o*d-r*h;if(!uQ(o*l-r*c,0,n)||!uQ(u,0,n))return null;let _=(c*o+l*r)/a,p=(h*o+d*r)/a,m=Math.max(0,Math.min(_,p)),A=Math.min(1,Math.max(_,p));return A-m<=n/Math.sqrt(a)?null:{start:Cq(e,m),end:Cq(e,A)}},u3r=(e,t,n)=>{let o=Math.max(e.minX,t.minX),r=Math.min(e.maxX,t.maxX),i=Math.max(e.minY,t.minY),s=Math.min(e.maxY,t.maxY);return r<o-n||s<i-n?null:{minX:o,maxX:r,minY:i,maxY:s}},p3r=(e)=>{let t=((p)=>{let m=p.orientation??Q4.orientation,A=p.staggerAxis??Q4.staggerAxis,g=p.padWidth??Q4.padWidth,f=p.padHeight??Q4.padHeight,y=p.padGap??Q4.padGap,x=p.clearance??Q4.clearance,C=p.colSpacing??p.pitchX??Q4.pitchX,b=p.rowSpacing??p.pitchY??Q4.pitchY,I=(v=g,P=f,M=y,m==="horizontal"?{x:M+2*v,y:P}:{x:P,y:M+2*v});var v,P,M;let B=x,T=((L,H,V,O,U)=>L==="horizontal"?H==="x"?U+2*V:O:H==="x"?O:U+2*V)(m,A,g,f,y)/2,N=p.staggerOffset??p.staggerOffsetX??T,D={...Q4,...p,orientation:m,staggerAxis:A,pitchX:Math.max(C,I.x+B),pitchY:Math.max(b,I.y+B),padWidth:g,padHeight:f,padGap:y,staggerOffset:N,staggerOffsetX:N,concavityTolerance:p.concavityTolerance??Q4.concavityTolerance,clearance:x,portSpacing:p.portSpacing??Q4.portSpacing,maxNeckRatio:p.maxNeckRatio??Q4.maxNeckRatio,minSplitBalanceRatio:p.minSplitBalanceRatio??Q4.minSplitBalanceRatio};if(D.cols<=0||D.rows<=0)throw Error("rows and cols must be > 0");if(!Number.isFinite(D.portSpacing)||D.portSpacing<=0)throw Error("portSpacing must be > 0");if(!Number.isFinite(D.maxNeckRatio)||D.maxNeckRatio<0)throw Error("maxNeckRatio must be >= 0");if(!Number.isFinite(D.minSplitBalanceRatio)||D.minSplitBalanceRatio<0||D.minSplitBalanceRatio>0.5)throw Error("minSplitBalanceRatio must be between 0 and 0.5");return D})(e),n=i3r(t),o=t.orientation==="horizontal"?t.padWidth:t.padHeight,r=t.orientation==="horizontal"?t.padHeight:t.padWidth,i=n.jumpers.flatMap((p)=>p.padCenters.map((m)=>({center:m,width:o,height:r,ccwRotation:0}))),s=new W4r({bounds:n.bounds,rects:i,clearance:0,concavityTolerance:t.concavityTolerance});s.solve();let a=s.getOutput();if(!a)throw Error(s.error??"ConvexRegionsSolver failed");let c=((p,m)=>{if(m.maxNeckRatio<=0)return p;let A=[];for(let g of p)A.push(...X4r(g,m));return A})(a.regions,{maxNeckRatio:t.maxNeckRatio,minSplitBalanceRatio:t.minSplitBalanceRatio}),l=s3r(c),h=((p,m)=>p.flatMap((A)=>{let[g,f]=A.padCenters,y=m.orientation==="horizontal"?m.padWidth/2:m.padHeight/2,x=m.orientation==="horizontal"?m.padHeight/2:m.padWidth/2,C={minX:g.x-y,maxX:g.x+y,minY:g.y-x,maxY:g.y+x},b={minX:f.x-y,maxX:f.x+y,minY:f.y-x,maxY:f.y+x},I=y/2,v=x/2,P=m.orientation==="horizontal"?{minX:Math.min(g.x,f.x),maxX:Math.max(g.x,f.x),minY:A.center.y-v,maxY:A.center.y+v}:{minX:A.center.x-I,maxX:A.center.x+I,minY:Math.min(g.y,f.y),maxY:Math.max(g.y,f.y)};return[{regionId:`${A.jumperId}_pad1`,ports:[],d:{bounds:C,center:g,polygon:aXe(C),isPad:!0,isThroughJumper:!1}},{regionId:`${A.jumperId}_bridge`,ports:[],d:{bounds:P,center:A.center,polygon:aXe(P),isPad:!1,isThroughJumper:!0}},{regionId:`${A.jumperId}_pad2`,ports:[],d:{bounds:b,center:f,polygon:aXe(b),isPad:!0,isThroughJumper:!1}}]}))(n.jumpers,{orientation:t.orientation,padWidth:t.padWidth,padHeight:t.padHeight}),d=((p,m,A=0.00001)=>{let g=[],f=0;for(let y=0;y<p.length;y++){let x=p[y];if(x?.d.polygon)for(let C=y+1;C<p.length;C++){let b=p[C];if(!b?.d.polygon)continue;let I=yYt(x,b,A);for(let v of I){let P=a3r(v),M=Math.floor(P/m),B=Math.max(1,M-1);for(let T=0;T<B;T++){let N=Cq(v,(T+1)/(B+1));g.push({portId:"tp_"+f++,region1:x,region2:b,d:{x:N.x,y:N.y}})}}}}return g})(l,t.portSpacing),u=((p,m,A=0.00001)=>{let g=[],f=0,y=0,x=p.filter((b)=>b.d.isPad),C=p.filter((b)=>b.d.isThroughJumper&&!b.d.isPad);for(let b of x)for(let I of m){let v=yYt(b,I,A),P=c3r(v,A);for(let M of P){let B=Cq(M,0.5);g.push({portId:"jp_"+f++,region1:b,region2:I,d:{x:B.x,y:B.y}})}}for(let b of C)for(let I of x){let v=u3r(b.d.bounds,I.d.bounds,A);if(!v)continue;let P=Van(v);g.push({portId:"jip_"+y++,region1:I,region2:b,d:{x:P.x,y:P.y}})}return g})(h,l),_=[...d,...u];return((p)=>{for(let m of p)m.region1.ports.push(m),m.region2.ports.push(m)})(_),{regions:[...l,...h],ports:_,jumperLocations:n.jumpers.map((p,m)=>({center:p.center,orientation:p.orientation,padRegions:[h[3*m],h[3*m+2]].filter((A)=>Boolean(A))})),topLayerRegions:l,jumperRegions:h,jumpers:n.jumpers,vias:n.vias,bounds:n.bounds}},m3r=class extends Kr{getSolverName(){return"JumperPrepatternSolver2_HyperGraph"}constructorParams;nodeWithPortPoints;colorMap;traceWidth;obstacleMargin;hyperParameters;jumperGraphSolver=null;xyConnections=[];graphBounds=null;jumperLocations=[];solvedRoutes=[];jumpers=[];phase="jumperGraph";curvySolvers=[];currentCurvySolverIndex=0;routeInfos=[];regionCurvedPaths=new Map;constructor(e){super(),this.constructorParams=e,this.nodeWithPortPoints=e.nodeWithPortPoints,this.colorMap=e.colorMap??{},this.traceWidth=e.traceWidth??0.15,this.obstacleMargin=e.obstacleMargin??0.15,this.hyperParameters=e.hyperParameters??{},this.MAX_ITERATIONS=1e6,Object.keys(this.colorMap).length===0&&(this.colorMap=this._buildColorMap())}getConstructorParams(){return this.constructorParams}_buildColorMap(){let e=["#e6194b","#3cb44b","#ffe119","#4363d8","#f58231","#911eb4","#46f0f0","#f032e6","#bcf60c","#fabebe"],t={},n=new Set;for(let r of this.nodeWithPortPoints.portPoints)n.add(r.connectionName);let o=0;for(let r of Array.from(n))t[r]=e[o%e.length],o++;return t}_normalizeRegionPolygonsToBounds(e){for(let t of e.regions){let n=t.d,o=n?.polygon,r=n?.bounds;if(!o||o.length===0||!r)continue;let i=1/0,s=1/0;for(let l of o)i=Math.min(i,l.x),s=Math.min(s,l.y);let a=r.minX-i,c=r.minY-s;(Math.abs(a)>0.000000000001||Math.abs(c)>0.000000000001)&&(n.polygon=o.map((l)=>({x:l.x+a,y:l.y+c}))),n.polygonPerimeterCache&&(n.polygonPerimeterCache=void 0)}return e}_getPatternConfig(){return{cols:this.hyperParameters.COLS??1,rows:this.hyperParameters.ROWS??1}}_generate0603Grid(e,t,n,o){let r=t==="horizontal"?e.rows:e.cols,i=t==="horizontal"?e.cols:e.rows,s=o.maxX-o.minX,a=o.maxY-o.minY,l=this.hyperParameters.TRACE_CHANNELS_BETWEEN_JUMPERS??1,h=this.traceWidth*l+2*this.obstacleMargin,d=t==="horizontal"?2.15:1,u=t==="horizontal"?1:2.15,_=t==="horizontal"?"x":"y",p=n==="staggered",m=p&&_==="x"?d/2:p?u/2:0,A=Math.max(0,s-1),g=Math.max(0,a-1),f=Math.max(0,A-(p&&_==="x"?m:0)),y=Math.max(0,g-(p&&_==="y"?m:0)),x=r>1?Math.max(d+h,(f-d)/(r-1)):d,C=i>1?Math.max(u+h,(y-u)/(i-1)):u,b=p3r({cols:r,rows:i,orientation:t,pattern:n,staggerAxis:_,colSpacing:x,rowSpacing:C,padWidth:0.9,padHeight:1,padGap:0.35,clearance:h,boundsPadding:0,maxNeckRatio:0.4,minSplitBalanceRatio:0.2}),I=b.bounds,v=(I.minX+I.maxX)/2,P=(I.minY+I.maxY)/2,M=$O((o.minX+o.maxX)/2-v,(o.minY+o.maxY)/2-P);return this._normalizeRegionPolygonsToBounds(aan(b,M))}_initializeGraph(){let e=this.nodeWithPortPoints,t=this._getPatternConfig(),n=this.hyperParameters.ORIENTATION??"vertical",o=this.hyperParameters.JUMPER_TYPE??"1206x4",r=this.hyperParameters.PATTERN??"grid",i={minX:e.center.x-e.width/2,maxX:e.center.x+e.width/2,minY:e.center.y-e.height/2,maxY:e.center.y+e.height/2},s;if(this.graphBounds=i,o==="0603"){let l=this._generate0603Grid(t,n,r,i);if(!l)return this.error=`0603 grid (${t.cols}x${t.rows}) is too large to fit in node bounds`,this.failed=!0,!1;s=l}else s=W5r({cols:t.cols,rows:t.rows,marginX:Math.max(1.2,0.3*t.cols),marginY:Math.max(1.2,0.3*t.rows),outerPaddingX:0.4,outerPaddingY:0.4,parallelTracesUnderJumperCount:2,innerColChannelPointCount:3,innerRowChannelPointCount:3,outerChannelXPointCount:3,outerChannelYPointCount:3,regionsBetweenPads:!0,orientation:n,bounds:i});if(s.regions.length>0){let l=1/0,h=-1/0,d=1/0,u=-1/0;for(let p of s.regions){if(!p.d?.isPad)continue;let m=p.d?.bounds;m&&(l=Math.min(l,m.minX),h=Math.max(h,m.maxX),d=Math.min(d,m.minY),u=Math.max(u,m.maxY))}let _=o==="0603"?0.5:1;if(l-_<i.minX||h+_>i.maxX||d-_<i.minY||u+_>i.maxY)return this.error=`baseGraph bounds (${l.toFixed(2)}, ${d.toFixed(2)}, ${h.toFixed(2)}, ${u.toFixed(2)}) exceed node bounds (${i.minX.toFixed(2)}, ${i.minY.toFixed(2)}, ${i.maxX.toFixed(2)}, ${i.maxY.toFixed(2)})`,this.failed=!0,!1}this.jumperLocations=s.jumperLocations?.map((l)=>({center:l.center,orientation:l.orientation,padRegions:l.padRegions}))??[];let a=new Map;for(let l of e.portPoints){let h=a.get(l.connectionName);h?h.points.push(l):a.set(l.connectionName,{points:[l],rootConnectionName:l.rootConnectionName})}this.xyConnections=[];for(let[l,h]of Array.from(a.entries()))h.points.length<2||this.xyConnections.push({start:{x:h.points[0].x,y:h.points[0].y},end:{x:h.points[1].x,y:h.points[1].y},connectionId:l});if(this.xyConnections.length===0)return this.solved=!0,!0;let c=((l,h)=>{let d=[...l.regions],u=[...l.ports],_=[],p=san(l.regions);for(let m of h){let{start:A,end:g,connectionId:f}=m,y=VVt(`conn:${f}:start`,A.x,A.y);d.push(y);let x=VVt(`conn:${f}:end`,g.x,g.y);d.push(x);let C=GVt(A.x,A.y,l.regions,p);if(C){let v=OVt(`conn:${f}:start-port`,y,C.region,C.portPosition);u.push(v)}let b=GVt(g.x,g.y,l.regions,p);if(b){let v=OVt(`conn:${f}:end-port`,x,b.region,b.portPosition);u.push(v)}let I={connectionId:f,mutuallyConnectedNetworkId:f,startRegion:y,endRegion:x};_.push(I)}return{regions:d,ports:u,connections:_}})(s,this.xyConnections);return this.jumperGraphSolver=new G5r({inputGraph:{regions:c.regions,ports:c.ports},inputConnections:c.connections}),this.jumperGraphSolver.MAX_ITERATIONS*=3,!0}_step(){switch(this.phase){case"jumperGraph":this._stepJumperGraph();break;case"curvyTrace":this._stepCurvyTrace();break;case"done":this.solved=!0}}_stepJumperGraph(){if(!this.jumperGraphSolver){if(this._initializeGraph(),this.solved)return;if(!this.jumperGraphSolver)return void(this.failed=!0)}this.activeSubSolver=this.jumperGraphSolver,this.jumperGraphSolver.step(),this.jumperGraphSolver.solved?(this._initializeCurvyTraceSolvers(),this.curvySolvers.length>0?this.phase="curvyTrace":(this._finalizeCurvyTraceResults(),this.phase="done",this.solved=!0)):this.jumperGraphSolver.failed&&(this.error=this.jumperGraphSolver.error,this.failed=!0)}_stepCurvyTrace(){if(this.currentCurvySolverIndex>=this.curvySolvers.length)return this._finalizeCurvyTraceResults(),this.phase="done",void(this.solved=!0);let e=this.curvySolvers[this.currentCurvySolverIndex],t=e.solver;if(this.activeSubSolver=t,t.step(),t.solved){let n=e.regionId;this.regionCurvedPaths.has(n)||this.regionCurvedPaths.set(n,new Map);for(let o of t.outputTraces){let r=o.networkId??"",i=o.points.map((a)=>({x:a.x,y:a.y})),s={path:i,start:i[0]??{x:0,y:0},end:i[i.length-1]??{x:0,y:0}};this.regionCurvedPaths.get(n).has(r)||this.regionCurvedPaths.get(n).set(r,[]),this.regionCurvedPaths.get(n).get(r).push(s)}this.currentCurvySolverIndex++}else t.failed&&this.currentCurvySolverIndex++}_initializeCurvyTraceSolvers(){if(!this.jumperGraphSolver)return;let e=new Set,t=[];for(let o of this.jumperLocations)for(let r of o.padRegions){let i=r.d.bounds,s=r.d.center;t.push({minX:i.minX,minY:i.minY,maxX:i.maxX,maxY:i.maxY,center:{x:s.x,y:s.y},networkIds:[]})}let n=new Map;for(let o=0;o<this.jumperGraphSolver.solvedRoutes.length;o++){let r=this.jumperGraphSolver.solvedRoutes[o],i=r.connection.connectionId,s=this.nodeWithPortPoints.portPoints.find((d)=>d.connectionName===i)?.rootConnectionName,a=[],c=[],l=null,h=null;for(let d=0;d<r.path.length;d++){let u=r.path[d],{port:_,lastRegion:p}=u,{region1:m,region2:A}=_,g;if(p)m&&m.regionId!==p.regionId?g=m:A&&A.regionId!==p.regionId&&(g=A);else{let f=r.path[d+1],y=f?.lastRegion;if(y&&(m&&m.regionId===y.regionId?g=m:A&&A.regionId===y.regionId&&(g=A)),!g){let x=(C)=>C?.regionId?.startsWith("conn:");g=!m||x(m)||m.d?.isPad||m.d?.isThroughJumper?!A||x(A)||A.d?.isPad||A.d?.isThroughJumper?!m||m.d?.isPad||m.d?.isThroughJumper?(!A||A.d?.isPad||A.d?.isThroughJumper)&&m||A:m:A:m}}if(g&&(!l||g.regionId!==l.regionId)){if(l&&h){c.push({regionId:l.regionId,region:l,entryPort:h,exitPort:_});let f=l.regionId;n.has(f)||n.set(f,[]),n.get(f).push({regionId:l.regionId,region:l,routeIndex:o,connectionName:i,rootConnectionName:s,entryPort:h,exitPort:_})}l=g,h=_}if(p?.d?.isThroughJumper&&!e.has(p.regionId)){e.add(p.regionId);let f=p.d.bounds,y=p.d.center,x=f.maxX-f.minX>f.maxY-f.minY,C=(this.hyperParameters.JUMPER_TYPE??"1206x4")==="0603"?"0603":"1206x4_pair";x?a.push({route_type:"jumper",start:{x:f.minX,y:y.y},end:{x:f.maxX,y:y.y},footprint:C}):a.push({route_type:"jumper",start:{x:y.x,y:f.minY},end:{x:y.x,y:f.maxY},footprint:C})}}if(l&&h){let d=r.path[r.path.length-1];c.push({regionId:l.regionId,region:l,entryPort:h,exitPort:d?.port||null})}this.routeInfos.push({connectionId:i,rootConnectionName:s,jumpers:a,traversals:c})}for(let o=0;o<this.routeInfos.length;o++){let r=this.routeInfos[o],i=r.rootConnectionName??r.connectionId;for(let s of r.jumpers){let a=[s.start,s.end];for(let c of a)for(let l of t){let h=Math.abs(l.center.x-c.x),d=Math.abs(l.center.y-c.y);h<0.1&&d<0.1&&(l.networkIds.includes(i)||l.networkIds.push(i))}}}for(let[o,r]of n){if(r.length===0)continue;let i=r[0].region;if(i.d.isPad||i.d.isThroughJumper)continue;let s=i.d.bounds,a=[];for(let u of r)a.push({start:{x:u.entryPort.d.x,y:u.entryPort.d.y},end:{x:u.exitPort.d.x,y:u.exitPort.d.y},networkId:u.rootConnectionName??u.connectionName});let c=0.01,l=t.filter((u)=>u.minX<=s.maxX+c&&u.maxX>=s.minX-c&&u.minY<=s.maxY+c&&u.maxY>=s.minY-c).map((u)=>{let _=r.map((m)=>m.rootConnectionName??m.connectionName),p=u.networkIds.find((m)=>_.includes(m));return{minX:u.minX,minY:u.minY,maxX:u.maxX,maxY:u.maxY,center:u.center,networkId:p}}),h={bounds:s,waypointPairs:a,obstacles:l,preferredTraceToTraceSpacing:2*this.traceWidth,preferredObstacleToTraceSpacing:2*this.traceWidth},d=new $sn(h);this.curvySolvers.push({solver:d,regionId:o,traversals:r.map((u)=>({routeIndex:u.routeIndex,connectionName:u.connectionName,rootConnectionName:u.rootConnectionName}))})}}_finalizeCurvyTraceResults(){let e=(t,n)=>Math.sqrt((t.x-n.x)**2+(t.y-n.y)**2);for(let t=0;t<this.routeInfos.length;t++){let n=this.routeInfos[t],o=[];for(let r of n.traversals){let i=r.regionId,s=n.rootConnectionName??n.connectionId,a=this.regionCurvedPaths.get(i)?.get(s),c=null;if(a&&a.length>0){let l={x:r.entryPort.d.x,y:r.entryPort.d.y},h=r.exitPort?{x:r.exitPort.d.x,y:r.exitPort.d.y}:null,d=null,u=1/0;for(let _ of a){let p=e(_.start,l)+(h?e(_.end,h):0);p<u&&(u=p,d=_)}d&&u<0.5&&(c=d.path)}if(c&&c.length>0)for(let l=o.length>0?1:0;l<c.length;l++)o.push({x:c[l].x,y:c[l].y,z:0});else o.length===0&&o.push({x:r.entryPort.d.x,y:r.entryPort.d.y,z:0}),r.exitPort&&o.push({x:r.exitPort.d.x,y:r.exitPort.d.y,z:0})}this.solvedRoutes.push({connectionName:n.connectionId,rootConnectionName:n.rootConnectionName,traceThickness:this.traceWidth,route:o,jumpers:n.jumpers})}}getOutput(){return this.solvedRoutes}getOutputJumpers(){if(this.jumpers.length>0)return this.jumpers;let e=new Map;for(let o of this.solvedRoutes)for(let r of o.jumpers){let i=[r.start,r.end];for(let s of i){let a=`${s.x.toFixed(3)},${s.y.toFixed(3)}`,c=e.get(a)??[];o.rootConnectionName&&!c.includes(o.rootConnectionName)&&c.push(o.rootConnectionName),c.includes(o.connectionName)||c.push(o.connectionName),e.set(a,c)}}let t=this.hyperParameters.JUMPER_TYPE??"1206x4",n=ZO[t==="0603"?"0603":"1206x4_pair"];for(let o of this.jumperLocations){let r=o.orientation==="horizontal",i=o.padRegions.map((a)=>{let c=a.d.bounds,l=a.d.center,h=c.maxX-c.minX,d=c.maxY-c.minY,u=`${l.x.toFixed(3)},${l.y.toFixed(3)}`;return{type:"rect",center:l,width:h,height:d,layers:["top"],connectedTo:[...e.get(u)??[]]}}),s={jumper_footprint:t,center:o.center,orientation:o.orientation,width:r?n.length:n.width,height:r?n.width:n.length,pads:i};this.jumpers.push(s)}return this.jumpers=this.jumpers.filter((o)=>o.pads.some((r)=>r.connectedTo.length>0)),this.jumpers}visualize(){if(this.jumperGraphSolver&&!this.solved)return this.jumperGraphSolver.visualize();let e={lines:[],points:[],rects:[],circles:[]},t=this.nodeWithPortPoints,n={minX:t.center.x-t.width/2,maxX:t.center.x+t.width/2,minY:t.center.y-t.height/2,maxY:t.center.y+t.height/2};e.lines.push({points:[{x:n.minX,y:n.minY},{x:n.maxX,y:n.minY},{x:n.maxX,y:n.maxY},{x:n.minX,y:n.maxY},{x:n.minX,y:n.minY}],strokeColor:"rgba(255, 0, 0, 0.25)",strokeDash:"4 4",layer:"border"});for(let o of t.portPoints)e.points.push({x:o.x,y:o.y,label:o.connectionName,color:this.colorMap[o.connectionName]??"blue"});for(let o of this.solvedRoutes){let r=this.colorMap[o.connectionName]??"blue";for(let i=0;i<o.route.length-1;i++){let s=o.route[i],a=o.route[i+1];e.lines.push({points:[s,a],strokeColor:Qi(r,0.2),strokeWidth:o.traceThickness,layer:"route-layer-0"})}for(let i of o.jumpers)this._drawJumperPads(e,i,Qi(r,0.5))}return e}_drawJumperPads(e,t,n){let o=ZO[t.footprint],r=t.end.x-t.start.x,i=t.end.y-t.start.y,s=Math.abs(r)>Math.abs(i),a=s?o.padLength:o.padWidth,c=s?o.padWidth:o.padLength;e.rects.push({center:{x:t.start.x,y:t.start.y},width:a,height:c,fill:n,stroke:"rgba(0, 0, 0, 0.5)",layer:"jumper"}),e.rects.push({center:{x:t.end.x,y:t.end.y},width:a,height:c,fill:n,stroke:"rgba(0, 0, 0, 0.5)",layer:"jumper"}),e.lines.push({points:[t.start,t.end],strokeColor:"rgba(100, 100, 100, 0.8)",strokeWidth:0.3*o.padWidth,layer:"jumper-body"})}},_3r=class extends kbe{constructorParams;nodeWithPortPoints;colorMap;traceWidth;obstacleMargin;connMap;baseHyperParameters;availableJumperTypes;solvedRoutes=[];jumpers=[];constructor(e){super(),this.constructorParams=e,this.nodeWithPortPoints=e.nodeWithPortPoints,this.colorMap=e.colorMap??{},this.traceWidth=e.traceWidth??0.15,this.obstacleMargin=e.obstacleMargin??0.15,this.connMap=e.connMap,this.baseHyperParameters=e.hyperParameters??{},this.availableJumperTypes=e.availableJumperTypes??["0603"],this.MAX_ITERATIONS=1e6,this.GREEDY_MULTIPLIER=1,this.MIN_SUBSTEPS=1000}getConstructorParams(){return this.constructorParams}getHyperParameterDefs(){let e=[],t=this.nodeWithPortPoints,n=this.calculateMax0603ConfigWithTraceChannels(t.width,t.height,"vertical",1);e.push({name:"0603_max_rows_and_cols_vert_1trace_grid",possibleValues:[{JUMPER_TYPE:"0603",COLS:n.cols,ROWS:n.rows,ORIENTATION:"vertical",PATTERN:"grid",TRACE_CHANNELS_BETWEEN_JUMPERS:1}]});let o=this.calculateMax0603ConfigWithTraceChannels(t.width,t.height,"vertical",1,"staggered");e.push({name:"0603_max_rows_and_cols_vert_1trace_staggered",possibleValues:[{JUMPER_TYPE:"0603",COLS:o.cols,ROWS:o.rows,ORIENTATION:"vertical",PATTERN:"staggered",TRACE_CHANNELS_BETWEEN_JUMPERS:1}]});let r=this.calculateMax0603ConfigWithTraceChannels(t.width,t.height,"vertical",2);e.push({name:"0603_max_rows_and_cols_vert_2trace_grid",possibleValues:[{JUMPER_TYPE:"0603",COLS:r.cols,ROWS:r.rows,ORIENTATION:"vertical",PATTERN:"grid",TRACE_CHANNELS_BETWEEN_JUMPERS:2}]});let i=this.calculateMax0603ConfigWithTraceChannels(t.width,t.height,"vertical",2,"staggered");e.push({name:"0603_max_rows_and_cols_vert_2trace_staggered",possibleValues:[{JUMPER_TYPE:"0603",COLS:i.cols,ROWS:i.rows,ORIENTATION:"vertical",PATTERN:"staggered",TRACE_CHANNELS_BETWEEN_JUMPERS:2}]});let s=this.calculateMax0603ConfigWithTraceChannels(t.width,t.height,"horizontal",1);e.push({name:"0603_max_rows_and_cols_horz_1trace_grid",possibleValues:[{JUMPER_TYPE:"0603",COLS:s.cols,ROWS:s.rows,ORIENTATION:"horizontal",PATTERN:"grid",TRACE_CHANNELS_BETWEEN_JUMPERS:1}]});let a=this.calculateMax0603ConfigWithTraceChannels(t.width,t.height,"horizontal",1,"staggered");e.push({name:"0603_max_rows_and_cols_horz_1trace_staggered",possibleValues:[{JUMPER_TYPE:"0603",COLS:a.cols,ROWS:a.rows,ORIENTATION:"horizontal",PATTERN:"staggered",TRACE_CHANNELS_BETWEEN_JUMPERS:1}]});let c=this.calculateMax0603ConfigWithTraceChannels(t.width,t.height,"horizontal",2);e.push({name:"0603_max_rows_and_cols_horz_2trace_grid",possibleValues:[{JUMPER_TYPE:"0603",COLS:c.cols,ROWS:c.rows,ORIENTATION:"horizontal",PATTERN:"grid",TRACE_CHANNELS_BETWEEN_JUMPERS:2}]});let l=this.calculateMax0603ConfigWithTraceChannels(t.width,t.height,"horizontal",2,"staggered");return e.push({name:"0603_max_rows_and_cols_horz_2trace_staggered",possibleValues:[{JUMPER_TYPE:"0603",COLS:l.cols,ROWS:l.rows,ORIENTATION:"horizontal",PATTERN:"staggered",TRACE_CHANNELS_BETWEEN_JUMPERS:2}]}),e.push({name:"1206x4",possibleValues:[{JUMPER_TYPE:"1206x4"}]}),e.push({name:"1206x4_cols",possibleValues:[1,2,3,4,6,8,10].map((h)=>({COLS:h}))}),e.push({name:"1206x4_rows",possibleValues:[1,2,3,4,8].map((h)=>({ROWS:h}))}),e.push({name:"orientation",possibleValues:[{ORIENTATION:"vertical"},{ORIENTATION:"horizontal"}]}),e}isValidCombination(e){let{JUMPER_TYPE:t,COLS:n,ROWS:o}=e,r=[1,2,4,6,8],i=[1,2,3,4,6,8,10],s=[1,2,3,4,8];return t==="0603"?r.includes(n)&&r.includes(o):t==="1206x4"&&(i.includes(n)&&s.includes(o))}getCombinationDefs(){return[["0603_max_rows_and_cols_vert_1trace_grid"],["0603_max_rows_and_cols_vert_1trace_staggered"],["0603_max_rows_and_cols_horz_1trace_grid"],["0603_max_rows_and_cols_horz_1trace_staggered"],["0603_max_rows_and_cols_vert_2trace_grid"],["0603_max_rows_and_cols_vert_2trace_staggered"],["0603_max_rows_and_cols_horz_2trace_grid"],["0603_max_rows_and_cols_horz_2trace_staggered"],["1206x4","1206x4_cols","1206x4_rows","orientation"]]}calculateMax0603ConfigWithTraceChannels(e,t,n,o,r="grid"){let i=this.traceWidth*o+2*this.obstacleMargin,s=n==="horizontal"?2.15:1,a=n==="horizontal"?1:2.15,c=n==="horizontal"?"x":"y",l=r==="staggered"&&c==="x"?s/2:r==="staggered"?a/2:0,h=Math.max(0,e-1),d=Math.max(0,t-1),u=Math.max(0,h-(r==="staggered"&&c==="x"?l:0)),_=Math.max(0,d-(r==="staggered"&&c==="y"?l:0)),p=s+i,m=a+i,A=Math.max(1,Math.floor(1+(u-s)/p)),g=Math.max(1,Math.floor(1+(_-a)/m));return n==="vertical"?{cols:A,rows:g}:{cols:g,rows:A}}initializeSolvers(){let e=this.getHyperParameterDefs(),t=this.getCombinationDefs();this.supervisedSolvers=[];for(let n of t){let o=n.some((s)=>s.startsWith("0603_max_rows_and_cols_")),r=n.includes("1206x4");if(o&&!this.availableJumperTypes.includes("0603"))continue;if(r&&!this.availableJumperTypes.includes("1206x4"))continue;let i=this.getHyperParameterCombinations(e.filter((s)=>n.includes(s.name)));for(let s of i){let a=this.generateSolver(s),c=this.computeG(a);this.supervisedSolvers.push({hyperParameters:s,solver:a,h:0,g:c,f:c})}}}generateSolver(e){return new m3r({nodeWithPortPoints:this.nodeWithPortPoints,colorMap:this.colorMap,traceWidth:this.traceWidth,hyperParameters:{COLS:e.COLS,ROWS:e.ROWS,ORIENTATION:e.ORIENTATION,JUMPER_TYPE:e.JUMPER_TYPE,PATTERN:e.PATTERN,TRACE_CHANNELS_BETWEEN_JUMPERS:e.TRACE_CHANNELS_BETWEEN_JUMPERS},obstacleMargin:this.obstacleMargin})}computeG(e){let t=e.hyperParameters.COLS*e.hyperParameters.ROWS;return e.iterations/1e4+0.25*t}computeH(e){return 1-(e.progress||0)}onSolve(e){this.solvedRoutes=e.solver.solvedRoutes,this.jumpers=e.solver.getOutputJumpers()}getOutput(){return this.solvedRoutes}getOutputJumpers(){return this.jumpers}visualize(){return this.winningSolver?this.winningSolver.visualize():super.visualize()}};function g3r(e){return{connectionName:e.connectionName,rootConnectionName:e.rootConnectionName,regionId:e.regionId,traceThickness:e.traceThickness,viaDiameter:0,route:e.route,vias:[],jumpers:e.jumpers}}var A3r=class extends Kr{getSolverName(){return"JumperHighDensitySolver"}allNodes;nodeAnalyses;routes;colorMap;traceWidth;obstacleMargin;viaDiameter;connMap;hyperParameters;availableJumperTypes;capacityMeshNodes;capacityMeshEdges;capacityMeshNodeMap;nodeAdjacencyMap;nodesWithoutCrossings;nodesWithCrossings;curvyIntraNodeSolvers;currentCurvySolverIndex;jumperSolvers;currentJumperSolverIndex;phase;jumpers=[];constructor({nodePortPoints:e,colorMap:t,traceWidth:n=0.15,obstacleMargin:o=0.15,viaDiameter:r=0.3,connMap:i,hyperParameters:s,capacityMeshNodes:a=[],capacityMeshEdges:c=[],availableJumperTypes:l}){super(),this.allNodes=[...e],this.colorMap=t??{},this.routes=[],this.traceWidth=n,this.obstacleMargin=o,this.viaDiameter=r,this.connMap=i,this.hyperParameters=s,this.capacityMeshNodes=a,this.capacityMeshEdges=c,this.availableJumperTypes=l??["0603"],this.capacityMeshNodeMap=new Map(a.map((u)=>[u.capacityMeshNodeId,u])),this.nodeAdjacencyMap=this._buildNodeAdjacencyMap(),this.nodesWithoutCrossings=[],this.nodesWithCrossings=[],this.nodeAnalyses=[],this.curvyIntraNodeSolvers=[],this.currentCurvySolverIndex=0,this.jumperSolvers=[],this.currentJumperSolverIndex=0,this.phase="analyzing",this._analyzeNodes();let h=1000*this.nodesWithoutCrossings.length,d=1e5*this.nodesWithCrossings.length;this.MAX_ITERATIONS=h+d+100}_buildNodeAdjacencyMap(){let e=new Map;for(let t of this.capacityMeshEdges){let[n,o]=t.nodeIds;e.has(n)||e.set(n,new Set),e.has(o)||e.set(o,new Set),e.get(n).add(o),e.get(o).add(n)}return e}_analyzeNodes(){for(let e of this.allNodes){let t=o_(e),n={node:e,hasCrossings:t.numSameLayerCrossings>0,numSameLayerCrossings:t.numSameLayerCrossings};this.nodeAnalyses.push(n),t.numSameLayerCrossings>0?this.nodesWithCrossings.push(e):this.nodesWithoutCrossings.push(e)}this.nodesWithoutCrossings.length>0?(this.phase="curvy",this._initializeCurvySolvers()):this.nodesWithCrossings.length>0?(this.phase="jumpers",this._initializeJumperSolvers()):this.phase="done"}_step(){switch(this.phase){case"analyzing":this.nodesWithoutCrossings.length>0?(this.phase="curvy",this._initializeCurvySolvers()):this.nodesWithCrossings.length>0?(this.phase="jumpers",this._initializeJumperSolvers()):this.phase="done";break;case"curvy":this._stepCurvySolvers();break;case"jumpers":this._stepJumperSolvers();break;case"done":this.solved=!0}}_getAdjacentObstacles(e){let t=[],n=this.nodeAdjacencyMap.get(e.capacityMeshNodeId);if(!n||n.size===0)return t;let o=new Map(this.allNodes.map((r)=>[r.capacityMeshNodeId,r]));for(let r of n){let i=this.capacityMeshNodeMap.get(r);if(!i)continue;if(!i._containsObstacle&&!i._containsTarget)continue;let s=i.center.x-i.width/2,a=i.center.y-i.height/2,c=i.center.x+i.width/2,l=i.center.y+i.height/2,h;if(i._containsTarget)if(i._targetConnectionName)h=i._targetConnectionName;else{let d=o.get(r);d&&d.portPoints.length>0&&(h=d.portPoints[0].rootConnectionName??d.portPoints[0].connectionName)}t.push({minX:s,minY:a,maxX:c,maxY:l,networkId:h})}return t}_initializeCurvySolvers(){for(let e of this.nodesWithoutCrossings){let t=this._getAdjacentObstacles(e),n=new kVt({nodeWithPortPoints:e,colorMap:this.colorMap,traceWidth:this.traceWidth,viaDiameter:this.viaDiameter,adjacentObstacles:t});this.curvyIntraNodeSolvers.push(n)}}_stepCurvySolvers(){if(this.curvyIntraNodeSolvers.length===0)return this.phase=this.nodesWithCrossings.length>0?"jumpers":"done",void(this.phase==="jumpers"&&this._initializeJumperSolvers());let e=this.curvyIntraNodeSolvers[this.currentCurvySolverIndex];if(this.activeSubSolver=e,!e)return this.phase=this.nodesWithCrossings.length>0?"jumpers":"done",void(this.phase==="jumpers"&&this._initializeJumperSolvers());if(e.step(),e.solved){this.routes.push(...e.routes),this.currentCurvySolverIndex++;for(let t=this.currentCurvySolverIndex;t<this.curvyIntraNodeSolvers.length;t++){this.curvyIntraNodeSolvers[t];let n=this.nodesWithoutCrossings[t],o=this._getAdjacentObstacles(n),r=new kVt({nodeWithPortPoints:n,colorMap:this.colorMap,traceWidth:this.traceWidth,viaDiameter:this.viaDiameter,adjacentObstacles:o});this.curvyIntraNodeSolvers[t]=r}this.currentCurvySolverIndex>=this.curvyIntraNodeSolvers.length&&(this.phase=this.nodesWithCrossings.length>0?"jumpers":"done",this.phase==="jumpers"&&this._initializeJumperSolvers())}else e.failed&&(this.error=`CurvyIntraNodeSolver failed for node: ${e.nodeWithPortPoints.capacityMeshNodeId}: ${e.error}`,this.failed=!0)}_initializeJumperSolvers(){for(let e of this.nodesWithCrossings){let t=new _3r({nodeWithPortPoints:e,colorMap:this.colorMap,traceWidth:this.traceWidth,obstacleMargin:this.obstacleMargin,connMap:this.connMap,availableJumperTypes:this.availableJumperTypes});this.jumperSolvers.push(t)}}_stepJumperSolvers(){if(this.jumperSolvers.length===0)return this.phase="done",void(this.solved=!0);let e=this.jumperSolvers[this.currentJumperSolverIndex];if(this.activeSubSolver=e,!e)return this.phase="done",void(this.solved=!0);if(e.step(),e.solved){for(let t of e.solvedRoutes)this.routes.push(g3r(t));this.jumpers.push(...e.getOutputJumpers()),this.currentJumperSolverIndex++,this.currentJumperSolverIndex>=this.jumperSolvers.length&&(this.phase="done",this.solved=!0)}else e.failed&&(this.error=`HyperJumperPrepatternSolver2 failed for node: ${e.nodeWithPortPoints.capacityMeshNodeId}: ${e.error}`,this.failed=!0)}computeProgress(){let e=this.allNodes.length;if(e===0)return 1;let t=0;t+=this.currentCurvySolverIndex;let n=this.curvyIntraNodeSolvers[this.currentCurvySolverIndex];n&&(t+=n.progress),t+=this.currentJumperSolverIndex;let o=this.jumperSolvers[this.currentJumperSolverIndex];return o&&(t+=o.progress),t/e}getConstructorParams(){return{nodePortPoints:this.allNodes,colorMap:this.colorMap,traceWidth:this.traceWidth,obstacleMargin:this.obstacleMargin,viaDiameter:this.viaDiameter,connMap:this.connMap,hyperParameters:this.hyperParameters,capacityMeshNodes:this.capacityMeshNodes,capacityMeshEdges:this.capacityMeshEdges,availableJumperTypes:this.availableJumperTypes}}getOutputJumpers(){return this.jumpers}visualize(){let e={lines:[],points:[],rects:[],circles:[]};if(this.failed&&this.activeSubSolver)return this.activeSubSolver.visualize();if(this.phase==="curvy"&&this.curvyIntraNodeSolvers[this.currentCurvySolverIndex])return this.curvyIntraNodeSolvers[this.currentCurvySolverIndex].visualize();if(this.phase==="jumpers"&&this.jumperSolvers[this.currentJumperSolverIndex])return this.jumperSolvers[this.currentJumperSolverIndex].visualize();for(let t of this.routes){let n=t.rootConnectionName??t.connectionName,o=Rbe(t.route,t.connectionName,this.colorMap[n]);for(let r of o)e.lines.push({points:r.points,label:r.connectionName,strokeColor:r.z===0?r.color:Qi(r.color??"gray",0.75),layer:`z${r.z}`,strokeWidth:t.traceThickness,strokeDash:r.z!==0?"10, 5":void 0});for(let r of t.vias)e.circles.push({center:r,radius:t.viaDiameter/2,fill:Qi(this.colorMap[n]??"gray",0.5),layer:"via"});if("jumpers"in t&&t.jumpers)for(let r of t.jumpers){let i=this.colorMap[n]??"gray",s=r.footprint??"1206",a=ZO[s],c=r.end.x-r.start.x,l=r.end.y-r.start.y,h=Math.abs(c)>Math.abs(l),d=h?a.padLength:a.padWidth,u=h?a.padWidth:a.padLength;e.rects.push({center:r.start,width:d,height:u,fill:Qi(i,0.5),stroke:"rgba(0, 0, 0, 0.5)",layer:"jumper"}),e.rects.push({center:r.end,width:d,height:u,fill:Qi(i,0.5),stroke:"rgba(0, 0, 0, 0.5)",layer:"jumper"}),e.lines.push({points:[r.start,r.end],strokeColor:"rgba(100, 100, 100, 0.8)",strokeWidth:0.3*a.padWidth,layer:"jumper-body"})}}for(let t of this.nodeAnalyses){let n=t.node;n.center.x,n.width,n.center.x,n.width,n.center.y,n.height,n.center.y,n.height,e.rects.push({center:n.center,width:n.width,height:n.height,fill:t.hasCrossings?"rgba(255, 200, 0, 0.1)":"rgba(0, 200, 0, 0.1)",stroke:t.hasCrossings?"rgba(255, 150, 0, 0.5)":"rgba(0, 150, 0, 0.5)",label:[n.capacityMeshNodeId,t.hasCrossings?`crossings: ${t.numSameLayerCrossings}`:"no crossings"].join(`
`)})}return e}};function aw(e,t,n,o={}){return{solverName:e,solverClass:t,getConstructorParams:n,onSolved:o.onSolved}}var Yan=class extends Kr{constructor(e,t={}){super(),this.srj=e,this.opts=t,this.srj=e,this.opts={...t},this.viaDiameter=Pp(e).padDiameter,this.minTraceWidth=e.minTraceWidth;let n=this.opts;if(this.effort=n.effort??1,this.MAX_ITERATIONS=1e8*this.effort,n.capacityDepth===void 0){let o=e.bounds.maxX-e.bounds.minX,r=e.bounds.maxY-e.bounds.minY,i=Math.max(o,r),s=n.targetMinCapacity??0.5;n.capacityDepth=MQ(i,s)}this.connMap=Ep(e),this.colorMap=yA(e,this.connMap),this.cacheProvider=n.cacheProvider===void 0?_9():n.cacheProvider===null?null:n.cacheProvider,this.startTimeOfPhase={},this.endTimeOfPhase={},this.timeSpentOnPhase={}}srj;opts;getSolverName(){return"AssignableAutoroutingPipeline3"}netToPointPairsSolver;traceKeepoutSolver;nodeSolver;nodeTargetMerger;edgeSolver;relateNodesToOffBoardConnections;colorMap;highDensityRouteSolver;simpleHighDensityRouteSolver;highDensitySolver;highDensityStitchSolver;singleLayerNodeMerger;offboardPathFragmentSolver;strawSolver;deadEndSolver;traceSimplificationSolver;traceWidthSolver;availableSegmentPointSolver;portPointPathingSolver;multiSectionPortPointOptimizer;viaDiameter;minTraceWidth;effort;startTimeOfPhase;endTimeOfPhase;timeSpentOnPhase;activeSubSolver=null;connMap;srjWithPointPairs;capacityNodes=null;capacityEdges=null;cacheProvider=null;pipelineDef=[aw("netToPointPairsSolver",YJe,(e)=>[e.srj,e.colorMap,SQ(e.srj)],{onSolved:(e)=>{e.srjWithPointPairs=e.netToPointPairsSolver?.getNewSimpleRouteJson(),e.colorMap=yA(e.srjWithPointPairs,this.connMap),e.connMap=Ep(e.srjWithPointPairs)}}),aw("nodeSolver",wq,(e)=>[{simpleRouteJson:e.srjWithPointPairs,maxGapFillPasses:4}],{onSolved:(e)=>{e.capacityNodes=e.nodeSolver?.getOutput().meshNodes??[]}}),aw("relateNodesToOffBoardConnections",Usn,(e)=>[{capacityMeshNodes:e.capacityNodes,srj:e.srj}],{onSolved:(e)=>{e.capacityNodes=e.relateNodesToOffBoardConnections?.getOutput().capacityNodes}}),aw("edgeSolver",PQ,(e)=>[e.capacityNodes],{onSolved:(e)=>{e.capacityEdges=e.edgeSolver?.edges}}),aw("availableSegmentPointSolver",yV,(e)=>[{nodes:e.capacityNodes,edges:e.capacityEdges||[],traceWidth:e.minTraceWidth,colorMap:e.colorMap,shouldReturnCrampedPortPoints:!1}]),aw("portPointPathingSolver",VJe,(e)=>{let t=e.capacityNodes.map((r)=>({capacityMeshNodeId:r.capacityMeshNodeId,center:r.center,width:r.width,height:r.height,portPoints:[],availableZ:r.availableZ,_containsTarget:r._containsTarget,_containsObstacle:r._containsObstacle,_offBoardConnectionId:r._offBoardConnectionId,_offBoardConnectedCapacityMeshNodeIds:r._offBoardConnectedCapacityMeshNodeIds})),n=new Map(t.map((r)=>[r.capacityMeshNodeId,r])),o=e.availableSegmentPointSolver;for(let r of o.sharedEdgeSegments)for(let i of r.portPoints){let[s,a]=i.nodeIds,c={portPointId:i.segmentPortPointId,x:i.x,y:i.y,z:i.availableZ[0]??0,connectionNodeIds:[s,a],distToCentermostPortOnZ:i.distToCentermostPortOnZ,connectsToOffBoardNode:r.nodeIds.some((h)=>n.get(h)?._offBoardConnectionId)},l=n.get(s);l&&l.portPoints.push(c)}return[{simpleRouteJson:e.srjWithPointPairs,inputNodes:t,capacityMeshNodes:e.capacityNodes,colorMap:e.colorMap,numShuffleSeeds:10*Math.min(1,e.effort),hyperParameters:{JUMPER_PF_FN_ENABLED:!0,NODE_PF_FACTOR:100,MAX_RIPS:100*Math.min(1,e.effort),RIPPING_ENABLED:!0,MAX_RIPPING_PF_THRESHOLD:0.9,MIN_RIPPING_PF_THRESHOLD:0.1,RANDOM_RIP_FRACTION:0.05,NODE_PF_MAX_PENALTY:1000,STRAIGHT_LINE_DEVIATION_PENALTY_FACTOR:0,CENTER_OFFSET_DIST_PENALTY_FACTOR:0,FORCE_CENTER_FIRST:!0}}]},{onSolved:(e)=>{let t=e.portPointPathingSolver;t&&Wsn({connMap:e.connMap,connectionsWithResults:t.connectionsWithResults,inputNodes:t.inputNodes,obstacles:e.srj.obstacles})}}),aw("highDensitySolver",A3r,(e)=>[{nodePortPoints:e.multiSectionPortPointOptimizer?.getNodesWithPortPoints()??e.portPointPathingSolver?.getNodesWithPortPoints()??[],colorMap:e.colorMap,viaDiameter:e.viaDiameter,traceWidth:e.minTraceWidth,obstacleMargin:e.srj.defaultObstacleMargin??0.15,connMap:e.connMap,capacityMeshNodes:e.capacityNodes??[],capacityMeshEdges:e.capacityEdges??[],availableJumperTypes:e.srj.availableJumperTypes}]),aw("highDensityStitchSolver",Zxr,(e)=>[{connections:e.srjWithPointPairs.connections,hdRoutes:e.highDensitySolver.routes,connectionPathResults:e.multiSectionPortPointOptimizer?.connectionResults??e.portPointPathingSolver?.connectionsWithResults??[],colorMap:e.colorMap,layerCount:e.srj.layerCount,defaultViaDiameter:e.viaDiameter}]),aw("traceKeepoutSolver",Gsn,(e)=>[{hdRoutes:e.traceSimplificationSolver?.simplifiedHdRoutes??e.highDensityStitchSolver?.mergedHdRoutes??[],obstacles:e.srj.obstacles,jumpers:e.highDensitySolver?.getOutputJumpers()??[],connMap:e.connMap,colorMap:e.colorMap,srj:e.srj}])];getConstructorParams(){return[this.srj,this.opts]}currentPipelineStepIndex=0;_step(){let e=this.pipelineDef[this.currentPipelineStepIndex];if(!e)return void(this.solved=!0);if(this.activeSubSolver)return this.activeSubSolver.step(),void(this.activeSubSolver.solved?(this.endTimeOfPhase[e.solverName]=performance.now(),this.timeSpentOnPhase[e.solverName]=this.endTimeOfPhase[e.solverName]-this.startTimeOfPhase[e.solverName],e.onSolved?.(this),this.activeSubSolver=null,this.currentPipelineStepIndex++):this.activeSubSolver.failed&&(this.error=this.activeSubSolver?.error,this.failed=!0,this.activeSubSolver=null));let t=e.getConstructorParams(this);this.activeSubSolver=new e.solverClass(...t),this[e.solverName]=this.activeSubSolver,this.timeSpentOnPhase[e.solverName]=0,this.startTimeOfPhase[e.solverName]=performance.now()}solveUntilPhase(e){for(;this.getCurrentPhase()!==e;)this.step()}getCurrentPhase(){return this.pipelineDef[this.currentPipelineStepIndex]?.solverName??"none"}visualize(){if(!this.solved&&this.activeSubSolver)return this.activeSubSolver.visualize();let e=this.netToPointPairsSolver?.visualize(),t=this.nodeSolver?.visualize(),n=this.nodeTargetMerger?.visualize(),o=this.singleLayerNodeMerger?.visualize(),r=this.strawSolver?.visualize(),i=this.edgeSolver?.visualize(),s=this.traceKeepoutSolver?.visualize(),a=this.deadEndSolver?.visualize(),c=this.availableSegmentPointSolver?.visualize(),l=this.offboardPathFragmentSolver?.visualize(),h=this.portPointPathingSolver?.visualize(),d=this.multiSectionPortPointOptimizer?.visualize(),u=this.highDensityRouteSolver?.visualize(),_=this.highDensitySolver?.visualize(),p=this.simpleHighDensityRouteSolver?.visualize(),m=this.highDensityStitchSolver?.visualize(),A=this.traceSimplificationSolver?.visualize(),g=this.traceWidthSolver?.visualize(),f=this.srj.outline,y=[];if(y.push({points:[{x:this.srj.bounds?.minX??-50,y:this.srj.bounds?.minY??-50},{x:this.srj.bounds?.maxX??50,y:this.srj.bounds?.minY??-50},{x:this.srj.bounds?.maxX??50,y:this.srj.bounds?.maxY??50},{x:this.srj.bounds?.minX??-50,y:this.srj.bounds?.maxY??50},{x:this.srj.bounds?.minX??-50,y:this.srj.bounds?.minY??-50}],strokeColor:"rgba(255,0,0,0.25)"}),f&&f.length>=2){let I=f.map((v)=>({x:v.x,y:v.y}));I.push({...I[0]}),y.push({points:I,strokeColor:"rgba(0, 136, 255, 0.95)"})}let x=Nw(this.srj),C={points:[...this.srj.connections.flatMap((I)=>I.pointsToConnect.map((v)=>({...v,layer:Rw(v,this.srj.layerCount),label:`${I.name} ${v.pcb_port_id??""}`})))],rects:[...(this.srj.obstacles??[]).filter((I)=>!I.isCopperPour).map((I)=>({...I,fill:I.layers?.includes("top")?"rgba(255,0,0,0.25)":I.layers?.includes("bottom")?"rgba(0,0,255,0.25)":"rgba(255,0,0,0.25)",layer:sS(I,this.srj.layerCount),label:x(I)}))],lines:y},b=[C,e,t,n,o,r,i,a,c,l,h,d,u?sl(C,u):null,_?sl(C,_):null,p?sl(C,p):null,m,A,s,g,this.solved?sl({lines:y},py(this.getOutputSimpleRouteJson())):null].filter(Boolean);return sl(...b)}preview(){let e=this.highDensitySolver?.routes??this.simpleHighDensityRouteSolver?.routes??this.highDensityRouteSolver?.routes;if(e){let t=[];for(let n=e.length-1;n>=0;n--){let o=e[n];if(t.push({points:o.route.map((r)=>({x:r.x,y:r.y})),strokeColor:this.colorMap[o.connectionName]}),t.length>200)break}return{lines:t}}if(this.portPointPathingSolver){let t=[];for(let n of this.portPointPathingSolver.connectionsWithResults)n.path&&t.push({points:n.path.map((o)=>({x:o.point.x,y:o.point.y})),strokeColor:this.colorMap[n.connection.name]});return{lines:t}}return this.netToPointPairsSolver?this.netToPointPairsSolver?.visualize():{}}_getOutputHdRoutes(){return this.traceWidthSolver?.hdRoutesWithWidths??this.traceKeepoutSolver?.redrawnHdRoutes??this.traceSimplificationSolver?.simplifiedHdRoutes??this.highDensityStitchSolver?.mergedHdRoutes??this.highDensitySolver?.routes??this.simpleHighDensityRouteSolver?.routes??this.highDensityRouteSolver?.routes}getConnectedOffboardObstacles(){let e={},t=new Set(this.srj.connections.flatMap((n)=>n.__rootConnectionNames??[n.name]));for(let[n,o]of this.srj.obstacles.entries()){if(!o.offBoardConnectsTo?.length)continue;let r=o.obstacleId??`__obs${n}`;o.obstacleId=r;let i=this.connMap.getNetConnectedToId(r);if(!i)continue;let s=this.connMap.getIdsConnectedToNet(i).find((a)=>t.has(a));s&&(e[r]=s)}return e}getOutputSimplifiedPcbTraces(){if(!this.solved||!this.highDensityRouteSolver&&!this.simpleHighDensityRouteSolver&&!this.highDensitySolver)throw Error("Cannot get output before solving is complete");let e=[],t=this._getOutputHdRoutes();for(let n of this.netToPointPairsSolver?.newConnections??[]){let o=n.__netConnectionName??this.srj.connections.find((i)=>i.name===n.name)?.__netConnectionName,r=t.filter((i)=>i.connectionName===n.name);for(let i=0;i<r.length;i++){let s=r[i],a={type:"pcb_trace",pcb_trace_id:`${n.name}_${i}`,connection_name:o??n.__rootConnectionNames?.[0]??n.name,route:V4(s,this.srj.layerCount)};e.push(a)}}return e}getOutputJumpers(){return this.highDensitySolver?this.highDensitySolver.getOutputJumpers():[]}getOutputSimpleRouteJson(){let e=this.getOutputJumpers();return{...this.srj,traces:this.getOutputSimplifiedPcbTraces(),jumpers:e.length>0?e:void 0}}},xYt=(e)=>{let{candidates:t,mapOfCapacityMeshNodeIdToRef:n}=e,o=!0;for(let r of t){let i=!1;r.port.nodeIds.forEach((s)=>{let a=n.get(s);if(!a)throw Error(`Could not find capacity mesh node for id ${s}`);a._containsObstacle&&(i=!0)}),i||(o=!1)}return o},CYt=(e)=>e.depth+1000*e.countOfCrampedPortPointsInPath,bYt=class extends fa{constructor(e){if(super(),this.input=e,this.input.depthLimit<1)throw Error("Depth limit must be at least 1");this._setup()}input;queue=[];resultExploredPortPoints=[];currentExploredPortPoints=null;visitedExploredPortPoints=new Map;getSolverName(){return"singleTargetNecessaryCrampedPortPointSolver"}_setup(){let e=this.input.mapOfCapacityMeshNodeIdToSegmentPortPoints.get(this.input.target.capacityMeshNodeId)??[];for(let t of e){if(this.input.shouldIgnoreCrampedPortPoints&&t.cramped)continue;let n={port:t,depth:1,parent:null,countOfCrampedPortPointsInPath:t.cramped?1:0},o=this.visitedExploredPortPoints.get(t);(!o||this.getCandidateCost(n)<this.getCandidateCost(o))&&(this.visitedExploredPortPoints.set(t,n),this.queue.push(n))}}_step(){if(this.queue.length===0)return this.currentExploredPortPoints=null,void(this.solved=!0);for(;this.queue.length>0;){if(this.currentExploredPortPoints=this.queue.shift(),this.visitedExploredPortPoints.get(this.currentExploredPortPoints.port)!==this.currentExploredPortPoints)continue;if(this.currentExploredPortPoints.depth===this.input.depthLimit){this.resultExploredPortPoints.push(this.currentExploredPortPoints);continue}let e=this.currentExploredPortPoints.port.nodeIds.map((t)=>{let n=this.input.mapOfCapacityMeshNodeIdToRef.get(t);if(!n)throw Error(`Could not find capacity mesh node for id ${t}`);return n}).flatMap((t)=>this.input.mapOfCapacityMeshNodeIdToSegmentPortPoints.get(t.capacityMeshNodeId)??[]);for(let t of e){if(this.input.shouldIgnoreCrampedPortPoints&&t.cramped)continue;let n={port:t,depth:this.currentExploredPortPoints.depth+1,parent:this.currentExploredPortPoints,countOfCrampedPortPointsInPath:this.currentExploredPortPoints.countOfCrampedPortPointsInPath+(t.cramped?1:0)},o=this.visitedExploredPortPoints.get(t);o&&this.getCandidateCost(o)<=this.getCandidateCost(n)||(this.visitedExploredPortPoints.set(t,n),this.queue.push(n))}}this.solved=!0}getCandidateCost(e){return e.depth+1000*e.countOfCrampedPortPointsInPath}getOutput(){return this.resultExploredPortPoints}visualize(){let e={points:[],rects:[]};for(let t of this.visitedExploredPortPoints.keys())e.points.push({...t,color:t.cramped?"blue":"green"});return e}},Vle=class extends fa{constructor(e){super(),this.input=e,this._setup()}input;unprocessedTargets=[];targetNode=[];currentTarget;crampedPortPointsToKeep=new Set;candidatesAtDepth=[];isRunningCrampedPass=!1;filteredOutput;activeSubSolver=null;nodeMap=new Map;mapOfCapacityMeshNodeIdToSegmentPortPoints=new Map;getSolverName(){return"multiTargetNecessaryCrampedPortPointSolver"}_setup(){this.targetNode=this.input.capacityMeshNodes.filter((e)=>e._containsObstacle),this.targetNode=this.targetNode.filter((e)=>{for(let t of this.input.simpleRouteJson.connections)for(let n of t.pointsToConnect)if(_S(n,e)<=0)return!0;return!1}),this.unprocessedTargets=[...this.targetNode],this.unprocessedTargets.sort((e,t)=>e.center.x-t.center.x);for(let e of this.input.capacityMeshNodes)this.nodeMap.set(e.capacityMeshNodeId,e);for(let e of this.input.sharedEdgeSegments)for(let t of e.portPoints){let n=t.nodeIds;for(let o of n){if(!this.nodeMap.get(o))throw Error(`Could not find capacity mesh node for id ${o}`);let r=this.mapOfCapacityMeshNodeIdToSegmentPortPoints.get(o)||[];this.mapOfCapacityMeshNodeIdToSegmentPortPoints.set(o,[...r,t])}}}_step(){if(this.activeSubSolver){if(this.activeSubSolver._step(),!this.activeSubSolver.solved)return;if(this.activeSubSolver.failed)return this.failed=!0,void(this.error=this.activeSubSolver.error);if(this.candidatesAtDepth=this.activeSubSolver.getOutput(),this.activeSubSolver=null,!this.currentTarget)return this.failed=!0,void(this.error="Missing current capacity mesh node while finishing BFS");if(!this.isRunningCrampedPass)return xYt({candidates:this.candidatesAtDepth,mapOfCapacityMeshNodeIdToRef:this.nodeMap})||this.candidatesAtDepth.length===0?(this.isRunningCrampedPass=!0,void(this.activeSubSolver=new bYt({target:this.currentTarget,depthLimit:3,shouldIgnoreCrampedPortPoints:!1,mapOfCapacityMeshNodeIdToSegmentPortPoints:this.mapOfCapacityMeshNodeIdToSegmentPortPoints,mapOfCapacityMeshNodeIdToRef:this.nodeMap}))):void(this.currentTarget=void 0);let e=this.candidatesAtDepth.filter((t)=>{let n=t.port;return n.nodeIds.map((o)=>{let r=this.nodeMap.get(o);if(!r)throw this.failed=!0,this.error=`Could not find capacity mesh node for id ${o}`,Error(`Could not find capacity mesh node for id ${o}`);return r}).every((o)=>!o._containsObstacle)&&n.cramped});if(xYt({candidates:e,mapOfCapacityMeshNodeIdToRef:this.nodeMap})&&(this.error=`All candidates are blocked by obstacles even after including cramped port points for capacity mesh node ${this.currentTarget.capacityMeshNodeId}`),this.candidatesAtDepth=[...e].sort((t,n)=>{let o=CYt(t)-CYt(n);return o!==0?o:this.getCandidateExitCapacity(n)-this.getCandidateExitCapacity(t)}),this.candidatesAtDepth.length===0)this.error=`No candidates found for capacity mesh node ${this.currentTarget.capacityMeshNodeId} even after including cramped port points`;else{let t=new Map;for(let o of this.candidatesAtDepth){if(!o.parent)throw Error(`Missing parent for cramped escape candidate ${o.port.segmentPortPointId}`);let r=`${o.parent.port.segmentPortPointId}->${o.port.segmentPortPointId}`;if(!t.has(r)&&(t.set(r,o),t.size===5))break}let n=[...t.values()];for(let o of n)this.keepCandidatePath(o)}return this.isRunningCrampedPass=!1,void(this.currentTarget=void 0)}if(!this.currentTarget)return this.currentTarget=this.unprocessedTargets.shift(),this.currentTarget?(this.isRunningCrampedPass=!1,this.candidatesAtDepth=[],void(this.activeSubSolver=new bYt({target:this.currentTarget,depthLimit:2,shouldIgnoreCrampedPortPoints:!0,mapOfCapacityMeshNodeIdToSegmentPortPoints:this.mapOfCapacityMeshNodeIdToSegmentPortPoints,mapOfCapacityMeshNodeIdToRef:this.nodeMap}))):void(this.solved=!0)}getOutput(){return this.filteredOutput||(this.filteredOutput=this.input.sharedEdgeSegments.map((e)=>({...e,portPoints:e.portPoints.flatMap((t)=>!t.cramped||this.crampedPortPointsToKeep.has(t)?[t]:this.isMultilayerEscapePort(t)?[{...t,tinyHypergraphPortPenalty:1000}]:[])}))),this.filteredOutput}getCandidateExitCapacity(e){if(!e.parent)throw Error(`Missing parent for cramped escape candidate ${e.port.segmentPortPointId}`);let t=new Set(e.parent.port.nodeIds),n=e.port.nodeIds.filter((o)=>!t.has(o)).map((o)=>{let r=this.nodeMap.get(o);if(!r)throw Error(`Could not find capacity mesh node for id ${o}`);return r});if(n.length===0)throw Error(`Could not find exit node for cramped escape candidate ${e.port.segmentPortPointId}`);return Math.max(0,...n.map((o)=>o.width*o.height*o.availableZ.length))}keepCandidatePath(e){this.crampedPortPointsToKeep.add(e.port);let t=e.parent;for(;t;)this.crampedPortPointsToKeep.add(t.port),t=t.parent}isMultilayerEscapePort(e){return e.nodeIds.some((t)=>(this.nodeMap.get(t)?.availableZ.length??0)>1)}visualize(){let e={rects:[],points:[]};for(let t of this.targetNode)e.rects.push({...t,fill:this.currentTarget?.capacityMeshNodeId===t.capacityMeshNodeId?"rgba(255, 0, 0, 0.5)":"rgba(255, 0, 0, 0.2)"});for(let t of this.candidatesAtDepth)e.points.push({...t.port,color:t.port.cramped?"blue":"green"});for(let t of this.crampedPortPointsToKeep)e.points.push({...t,color:"blue"});return this.activeSubSolver?TO(e,this.activeSubSolver.visualize()):e}},C$=(e)=>`${e.x.toFixed(4)},${e.y.toFixed(4)}`,Gan=(e)=>e.netIsAssignable===!0&&(e.layers?.length??0)>1,f3r=(e,t)=>e.connectedTo?.find((n)=>n.startsWith("pcb_via"))??e.obstacleId??`assignable_via_${t}`,y3r=(e)=>[...new Set(e.obstacle.layers.map((t)=>ti(t,e.layerCount)))].sort((t,n)=>t-n),x3r=(e)=>C$(e.center),IYt=(e)=>new Set(e.filter(Gan).map(x3r));function ab(e,t){if(e==null)throw Error(t)}function rZe({point:e,layerCount:t}){let n=zx(e).map((o)=>ti(o,t));return[...new Set(n)]}function Uan(e){if(_S(e.point,e.region.d)<=0.001)return(e.pointZLayers??rZe(e)).some((t)=>e.region.d.availableZ.includes(t));return!1}function C3r({region:e,pointZLayers:t}){return e.ports.some((n)=>t.includes(n.d.z)&&t.some((o)=>n.region1.d.availableZ.includes(o))&&t.some((o)=>n.region2.d.availableZ.includes(o)))}function vYt({graph:e,point:t,layerCount:n}){let o=rZe({point:t,layerCount:n}),r;for(let i of e.regions)if(Uan({point:t,region:i,layerCount:n,pointZLayers:o})&&(r??=i,C3r({region:i,pointZLayers:o})))return i;return r}var SYt=(e,t)=>{let n=e.getNetConnectedToId(t);if(!n)throw Error(`Could not resolve net ID for connection "${t}"`);return n},b3r=(e)=>{let t=e.graph.regions.filter((r)=>r.d.availableZ.includes(e.z)&&!r.d._assignableVia).map((r)=>({region:r,distance:_S(e.point,r.d)})).sort((r,i)=>r.distance-i.distance||r.region.d.width*r.region.d.height-i.region.d.width*i.region.d.height),n=t[0]?.distance;if(n===void 0)return[];let o=Math.max(n+0.000001,e.viaRadius+0.15);return t.filter((r)=>r.distance<=o).slice(0,4).map((r)=>r.region)};function Yle(e){let t={ports:[],regions:[]},n=[],o=new Map;for(let r of e.capacityMeshNodes){let i=r._connectedTo?.map((a)=>SYt(e.connectivityMap,a)),s={regionId:r.capacityMeshNodeId,d:i?{...r,_connectedTo:[...new Set(i)]}:r,ports:[]};t.regions.push(s),o.has(s.regionId)||o.set(s.regionId,s)}for(let r of e.segmentPortPoints){let[i,s]=r.nodeIds,a=o.get(i),c=o.get(s);ab(a,`Could not find region with id ${i} for segment port point ${r.segmentPortPointId}`),ab(c,`Could not find region with id ${s} for segment port point ${r.segmentPortPointId}`);for(let l of r.availableZ){let h=r._preloadedTracePortAssignments?.filter((_)=>_.z===l),d={portId:`${r.segmentPortPointId}::${l}`,x:r.x,y:r.y,z:l,distToCentermostPortOnZ:r.distToCentermostPortOnZ,cramped:r.cramped,regions:[a,c],tinyHypergraphPortPenalty:r.tinyHypergraphPortPenalty,_preloadedFixedNetIds:h&&h.length>0?[...new Set(h.map((_)=>_.fixedNetId))].sort():void 0,_preloadedTracePortAssignments:h},u={portId:r.segmentPortPointId,d,region1:a,region2:c};t.ports.push(u),a.ports.push(u),c.ports.push(u)}}((r)=>{for(let[i,s]of r.assignableViaObstacles.entries()){if(!Gan(s))continue;let a=y3r({obstacle:s,layerCount:r.layerCount});if(a.length<2)continue;let c=`assignable-via:${f3r(s,i)}`,l=Math.min(s.width,s.height)/2,h={regionId:c,d:{capacityMeshNodeId:c,center:{...s.center},width:s.width,height:s.height,layer:`z${a.join(",")}`,availableZ:a,_containsObstacle:!1,_completelyInsideObstacle:!1,_containsTarget:!1,_assignableVia:!0,_assignedViaObstacle:s},ports:[]},d=[];for(let u of a)for(let _ of b3r({graph:r.graph,point:s.center,z:u,viaRadius:l})){let p={portId:`${c}:port:${_.regionId}:z${u}`,x:s.center.x,y:s.center.y,z:u,distToCentermostPortOnZ:0,cramped:!1,regions:[_,h]},m={portId:p.portId,d:p,region1:_,region2:h};d.push(m),_.ports.push(m)}if(new Set(d.map((u)=>u.d.z)).size<2)for(let u of d)u.region1.ports=u.region1.ports.filter((_)=>_!==u);else h.ports.push(...d),r.graph.regions.push(h),r.graph.ports.push(...d)}})({graph:t,assignableViaObstacles:e.assignableViaObstacles??[],layerCount:e.layerCount});for(let r of e.simpleRouteJsonConnections){let[i,s]=r.pointsToConnect,a=vYt({graph:t,point:i,layerCount:e.layerCount}),c=vYt({graph:t,point:s,layerCount:e.layerCount});ab(a,`Could not find start region for connection "${r.name}"`),ab(c,`Could not find end region for connection "${r.name}"`),n.push({connectionId:r.name,mutuallyConnectedNetworkId:SYt(e.connectivityMap,r.name),startRegion:a,endRegion:c,simpleRouteConnection:r})}return{graph:t,connections:n}}function I3r(e,t){let n={lines:[],points:[]};if(!e)return n;let o=e.shift();if(!o)return n;let r=[];n.points.push({...o.port.d,color:"rgb(255, 50, 50)",label:`g: ${o.g}
h: ${o.h}
f: ${o.f}
ripRequired: ${o.ripRequired}`});do r.push({x:o.port.d.x,y:o.port.d.y,z:o.port.d.z}),o=o.parent;while(o);r.reverse();let i=r[0]?.z??0;r.unshift({x:t.x,y:t.y,z:i});for(let s=0;s<r.length-1;s++){let a=r[s],c=r[s+1],l;l=a.z===c.z?a.z===0?void 0:"10 5":"3 3 10",n.lines.push({points:[{x:a.x,y:a.y},{x:c.x,y:c.y}],strokeColor:"rgba(255, 250, 50, 1)",strokeWidth:0.01,strokeDash:l})}for(let s of e)n.points.push({...s.port.d,color:"rgb(0, 64, 255)",label:`${s.port.portId}
g: ${s.g}
h: ${s.h}
f: ${s.f}
ripRequired: ${s.ripRequired}`});return n}function v3r(e,t){let n={lines:[],points:[]};for(let o of e){let r=t[o.connection.connectionId]??"rgba(255, 50, 50, 1)",i=[{x:o.connection.startRegion.d.center.x,y:o.connection.startRegion.d.center.y,z:o.connection.startRegion.d?.availableZ?.[0]??0}];for(let s of o.path)i.push({x:s.port.d.x,y:s.port.d.y,z:s.port.d.z});i.push({x:o.connection.endRegion.d.center.x,y:o.connection.endRegion.d.center.y,z:o.connection.endRegion.d?.availableZ?.[0]??0});for(let s=0;s<i.length-1;s++){let a=i[s],c=i[s+1],l;l=a.z===c.z?a.z===0?void 0:"10 5":"3 3 10";let h={points:[{x:a.x,y:a.y},{x:c.x,y:c.y}],strokeColor:r,strokeWidth:0.01,strokeDash:l};n.lines.push(h)}}return n}function S3r(e,t){let n={lines:[],points:[]};for(let o of e){let r=o.startRegion.d.center,i=o.endRegion.d.center,s=(r.x+i.x)/2,a=(r.y+i.y)/2,c=t[o.connectionId]??"rgba(255, 50, 150, 0.8)";n.points.push({x:s,y:a,color:c,label:o.connectionId}),n.lines.push({points:[r,i],strokeColor:c,strokeWidth:0.1,strokeDash:(o.startRegion.d?.availableZ?.[0]??0)===0?void 0:"10 5"})}return n}function P3r(e){let t={rects:[],points:[]};for(let n of e.regions)t.rects.push({center:n.d.center,width:n.d.width,height:n.d.height,fill:"rgba(200, 200, 200, 0.5)",label:n.regionId});for(let n of e.ports)t.points.push({x:n.d.x,y:n.d.y,color:"rgba(4, 90, 20, 0.3)",label:n.portId});return t}var PYt=class extends ran{constructor(e){super({inputConnections:e.connections,inputGraph:e.graph,inputSolvedRoutes:e.inputSolvedRoutes,greedyMultiplier:e.weights.GREEDY_MULTIPLIER,ripCost:e.weights.RIPPING_PF_COST,rippingEnabled:e.flags.RIPPING_ENABLED}),this.params=e,this.regionMemoryPfMap=e.opts?.regionMemoryPfMap??new Map,this.baseRegionFailureCostMap=new Map,this.regionRipCountMap=new Map,this.totalRipCount=0,e.weights.MAX_ITERATIONS_PER_PATH>0&&(this.MAX_ITERATIONS=e.weights.MAX_ITERATIONS_PER_PATH*e.effort)}params;regionMemoryPfMap;baseRegionFailureCostMap;regionRipCountMap;totalRipCount;estimateCostToEnd(e){let t=this.currentEndRegion;return ab(t,"Current end region is undefined"),Dn(e.d,t.d.center)}computeH(e){let t=e,n=this.computeDistanceTraveled(t);if(this.params.weights.RANDOM_WALK_DISTANCE>0&&n<this.params.weights.RANDOM_WALK_DISTANCE)return 0;let o=this.estimateCostToEnd(e.port),r=(e.port.d.distToCentermostPortOnZ-this.params.weights.CENTER_OFFSET_FOCUS_SHIFT)*this.params.weights.CENTER_OFFSET_DIST_PENALTY_FACTOR,i=e.nextRegion?.regionId??e.lastRegion?.regionId,s=i?this.regionMemoryPfMap.get(i)??0:0;return o+r+this.computeMemoryPfPenalty(s)+this.computeDeviation(e)*this.params.weights.STRAIGHT_LINE_DEVIATION_PENALTY_FACTOR}computeIncreasedRegionCostIfPortsAreUsed(e,t,n){let o=this.currentConnection;ab(o,"Current connection is undefined");let r=this.getBaseRegionFailureCost(e),i=this.computeRegionPfWithAdditionalSegment(e,t,n,o.connectionId,o.mutuallyConnectedNetworkId);if(i>=this.NODE_MAX_PF)return this.params.weights.NODE_PF_MAX_PENALTY;let s=this.pfToFailureCost(i),a=Math.max(0,s-r);return Math.min(this.params.weights.NODE_PF_MAX_PENALTY,a*this.params.weights.NODE_PF_FACTOR)}computeG(e){let t=e,n=super.computeG(e);return t.lastPort&&t.lastPort.d.z!==t.port.d.z&&(n+=this.params.weights.LAYER_CHANGE_COST),t.nextRegion!==this.currentEndRegion?n:n+this.computeEndRegionCloseCost(t)}getPortUsagePenalty(e){let t=e.assignment;if(!t)return 0;let n=this.currentConnection?.mutuallyConnectedNetworkId;return t.connection.mutuallyConnectedNetworkId===n?0:0.5*Math.max(1,this.params.weights.NODE_PF_FACTOR)+this.params.weights.BASE_CANDIDATE_COST}getRipsRequiredForPortUsage(e,t,n){let o=e.assignments??[];if(o.length===0)return[];return o.filter((r)=>r.connection.mutuallyConnectedNetworkId!==this.currentConnection?.mutuallyConnectedNetworkId&&(r.regionPort1!==t&&r.regionPort2!==t&&(r.regionPort1!==n&&r.regionPort2!==n&&su(r.regionPort1.d,r.regionPort2.d,t.d,n.d))))}selectCandidatesForEnteringRegion(e){let t=this.currentConnection?.startRegion,n=this.currentConnection?.endRegion;ab(t,"Current connection or start region is undefined"),ab(n,"Current connection or end region is undefined");let o=e.filter((s)=>{let a=s.nextRegion;return!a?.d._containsObstacle||(a===t||a===n)}),r=this.params.flags.FORCE_CENTER_FIRST?this.getCenterFirstEnteringRegionCandidates(o):o,i=-this.params.weights.MIN_ALLOWED_BOARD_SCORE;if(i>0){let s=r.filter((a)=>a.g+a.h<=i);s.length>0&&(r=s)}return r}routeSolvedHook(e){this.baseRegionFailureCostMap.clear();let t=new Set;for(let r of e.path){let i=r.lastRegion;i&&t.add(i)}for(let r of t){let i=this.computeRegionPfFromAssignments(r);this.regionMemoryPfMap.set(r.regionId,i)}if(!e.requiredRip)return;if(this.unprocessedConnections.length<2)return;let[n,...o]=this.unprocessedConnections;this.unprocessedConnections=[...o,n]}computeRoutesToRip(e){let t=super.computePortOverlapRoutes(e),n=new Set(t),o=new Map;e.path.map((c)=>{if(!c.lastPort||!c.lastRegion)return;let l=this.getRipsRequiredForPortUsage(c.lastRegion,c.lastPort,c.port);if(l.length===0)return null;let h=o.get(c.lastRegion)??new Set;for(let d of l)h.add(d.solvedRoute);o.set(c.lastRegion,h)});let r=e.path.flatMap((c)=>c.lastRegion?[c.lastRegion]:[]),i=Array.from(new Set([...o.keys(),...r])),s=this.params.weights.SHUFFLE_SEED+this.iterations+this.solvedRoutes.length+this.totalRipCount,a=db(i,s);for(let c of a){if(this.totalRipCount>=this.params.weights.MAX_RIPS)break;let l=this.getRegionRippingPfThreshold(c.regionId),h=this.computeRegionPf({region:c,newlySolvedRoute:e,routesToRip:n});if(this.regionMemoryPfMap.set(c.regionId,h),h<=l)continue;let d=new Set,u=0;for(;h>l&&!(this.totalRipCount>=this.params.weights.MAX_RIPS);){if(!c.assignments||c.assignments.length===0)throw Error("We are trying to rip a region with no assignments, this should not happen");let _=c.assignments.map((m)=>{let A=m.solvedRoute;return m.connection.connectionId===e.connection.connectionId?null:n.has(A)?void 0:A}).filter((m)=>!!m);if(_.length===0)break;let p=db(_,s+u+d.size)[0];if(!p)break;d.add(p.connection),n.add(p),this.totalRipCount++,u++,this.regionRipCountMap.set(c.regionId,(this.regionRipCountMap.get(c.regionId)??0)+1),h=this.computeRegionPf({region:c,newlySolvedRoute:e,routesToRip:n}),this.regionMemoryPfMap.set(c.regionId,h)}}if(n.size>t.size){if(this.totalRipCount>=this.params.weights.MAX_RIPS)return n;let c=this.solvedRoutes.filter((u)=>!n.has(u)&&u.connection.connectionId!==e.connection.connectionId);if(c.length===0)return n;let l=Math.max(1,Math.floor(this.params.weights.RANDOM_RIP_FRACTION*c.length)),h=db(c,s),d=0;for(let u of h){if(d>=l)break;if(this.totalRipCount>=this.params.weights.MAX_RIPS)break;n.has(u)||(n.add(u),d++,this.totalRipCount++)}}return n}computeDeviation(e){let t=this.currentConnection?.startRegion.d.center,n=this.currentConnection?.endRegion.d.center;return ab(t,"Current connection or start region is undefined"),ab(n,"Current connection or end region is undefined"),oc(e.port.d,t,n)}computeDistanceTraveled(e){let t=0,n=e;for(;n?.parent;)t+=Dn(n.parent.port.d,n.port.d),n=n.parent;return t}computeMemoryPfPenalty(e){let t=Math.min(Math.max(e,0),0.999999),n=Math.min(this.params.weights.NODE_PF_MAX_PENALTY,-Math.log(1-t));return n*this.params.weights.MEMORY_PF_FACTOR+n*this.params.weights.NODE_PF_FACTOR*0.01}computeEndRegionCloseCost(e){let t=this.currentConnection,n=this.currentEndRegion;ab(t,"Current connection is undefined"),ab(n,"Current end region is undefined");let o=t.endRegion.d.center,r={portId:`end-target:${t.connectionId}`,region1:n,region2:n,d:{portId:`end-target:${t.connectionId}`,x:o.x,y:o.y,z:e.port.d.z,distToCentermostPortOnZ:0,regions:[n,n]}};return this.computeIncreasedRegionCostIfPortsAreUsed(n,e.port,r)}getCenterFirstEnteringRegionCandidates(e){let t=new Map;for(let o of e){let r=o.port.d.z,i=t.get(r)??[];i.push(o),t.set(r,i)}let n=[];for(let o of t.values()){let r=o.sort((c,l)=>c.port.d.distToCentermostPortOnZ-l.port.d.distToCentermostPortOnZ)[0];if(!r)continue;if(this.isPortAvailableForCurrentNet(r.port)){n.push(r);continue}let i=o.sort((c,l)=>c.port.d.x!==l.port.d.x?c.port.d.x-l.port.d.x:c.port.d.y-l.port.d.y),s=[],a=[];for(let c of i)this.isPortAvailableForCurrentNet(c.port)?a.push(c):a.length>0&&(s.push(a),a=[]);a.length>0&&s.push(a);for(let c of s)n.push(c[Math.floor(c.length/2)])}return n}isPortAvailableForCurrentNet(e){let t=e.assignment;if(!t)return!0;let n=this.currentConnection?.mutuallyConnectedNetworkId;return t.connection.mutuallyConnectedNetworkId===n}computeRegionPfFromAssignments(e){let t=this.getRegionAssignedPortPoints(e),n={...e.d,portPoints:t},o=o_(n),r=e.d;return ly(r,o.numSameLayerCrossings,o.numEntryExitLayerChanges,o.numTransitionPairCrossings)}clampPf(e){return Math.min(Math.max(e,0),0.999999)}get NODE_MAX_PF(){return Math.min(0.99999,1-Math.exp(-this.params.weights.NODE_PF_MAX_PENALTY))}pfToFailureCost(e){let t=this.clampPf(e);return t>=this.NODE_MAX_PF?this.params.weights.NODE_PF_MAX_PENALTY:-Math.log(1-t)}getBaseRegionFailureCost(e){let t=this.baseRegionFailureCostMap.get(e.regionId);if(t!=null)return t;let n=this.computeRegionPfFromAssignments(e),o=this.pfToFailureCost(n);return this.baseRegionFailureCostMap.set(e.regionId,o),o}getRegionAssignedPortPoints(e){return(e.assignments??[]).flatMap((t)=>{let n=t.regionPort1.d,o=t.regionPort2.d,r=t.connection.connectionId,i=t.connection.simpleRouteConnection?.__rootConnectionNames?.[0];return[{x:n.x,y:n.y,z:n.z,connectionName:r,rootConnectionName:i},{x:o.x,y:o.y,z:o.z,connectionName:r,rootConnectionName:i}]})}computeRegionPfWithAdditionalSegment(e,t,n,o,r){let i=this.getRegionAssignedPortPoints(e),s=[{x:t.d.x,y:t.d.y,z:t.d.z,connectionName:o,rootConnectionName:r},{x:n.d.x,y:n.d.y,z:n.d.z,connectionName:o,rootConnectionName:r}],a={...e.d,portPoints:[...i,...s]},c=o_(a);return ly(e.d,c.numSameLayerCrossings,c.numEntryExitLayerChanges,c.numTransitionPairCrossings)}getRegionRippingPfThreshold(e){let t=this.regionRipCountMap.get(e)??0,n=Math.max(1,Math.floor(this.params.weights.MAX_RIPS/10)),o=Math.min(1,t/n);return(this.params.weights.START_RIPPING_PF_THRESHOLD||0.3)*(1-o)+(this.params.weights.END_RIPPING_PF_THRESHOLD||1)*o}computeRegionPf({region:e,newlySolvedRoute:t,routesToRip:n}){let o=[...(e.assignments??[]).filter((a)=>!n.has(a.solvedRoute)).flatMap((a)=>{let{regionPort1:c,regionPort2:l}=a,h=a.connection.connectionId,d=a.connection.simpleRouteConnection?.__rootConnectionNames?.[0];return[{x:c.d.x,y:c.d.y,z:c.d.z,connectionName:h,rootConnectionName:d},{x:l.d.x,y:l.d.y,z:l.d.z,connectionName:h,rootConnectionName:d}]}),...t.path.flatMap((a)=>{if(!a.lastPort||a.lastRegion!==e)return[];let{lastPort:c,port:l}=a;return[{x:c.d.x,y:c.d.y,z:c.d.z,connectionName:t.connection.connectionId,rootConnectionName:t.connection.simpleRouteConnection?.__rootConnectionNames?.[0]},{x:l.d.x,y:l.d.y,z:l.d.z,connectionName:t.connection.connectionId,rootConnectionName:t.connection.simpleRouteConnection?.__rootConnectionNames?.[0]}]})],r={capacityMeshNodeId:e.d.capacityMeshNodeId,center:e.d.center,width:e.d.width,height:e.d.height,portPoints:o,availableZ:e.d.availableZ},i=o_(r),s=e.d;return ly(s,i.numSameLayerCrossings,i.numEntryExitLayerChanges,i.numTransitionPairCrossings)}computeNodePf(e){let t=this.getOutput().nodesWithPortPoints.find((r)=>r.capacityMeshNodeId===e.capacityMeshNodeId),n=this.params.graph.regions.find((r)=>r.d.capacityMeshNodeId===e.capacityMeshNodeId);if(!t||!n)return null;let o=o_(t);return ly(n.d,o.numSameLayerCrossings,o.numEntryExitLayerChanges,o.numTransitionPairCrossings)}getOutput(){new Map(this.params.graph.regions.map((r)=>[r.regionId,r]));let e=new Set;for(let r of this.params.connections)e.add(r.startRegion.regionId),e.add(r.endRegion.regionId);let t=new Map;for(let r of this.solvedRoutes){let i=r.path;if(i.length===0)continue;let s=i[0]?.port,a=i[i.length-1]?.port;if(!s||!a)continue;let c=r.connection.connectionId,l=r.connection,h=l.simpleRouteConnection?.__rootConnectionNames?.[0],d=r.connection.startRegion.regionId,u=r.connection.endRegion.regionId,_=t.get(d)??[];_.push({portPointId:s.d.portId,x:s.d.x,y:s.d.y,z:s.d.z,connectionName:c,rootConnectionName:h}),t.set(d,_);let p=t.get(u)??[];p.push({portPointId:a.d.portId,x:a.d.x,y:a.d.y,z:a.d.z,connectionName:c,rootConnectionName:h}),t.set(u,p)}let n=[],o=[];for(let r of this.params.graph.regions){let i=(r.assignments??[]).flatMap((l)=>{let h=l.connection.connectionId,d=l.connection.simpleRouteConnection?.__rootConnectionNames?.[0];return[{portPointId:l.regionPort1.d.portId,x:l.regionPort1.d.x,y:l.regionPort1.d.y,z:l.regionPort1.d.z,connectionName:h,rootConnectionName:d,nextPortPointId:l.regionPort2.d.portId},{portPointId:l.regionPort2.d.portId,x:l.regionPort2.d.x,y:l.regionPort2.d.y,z:l.regionPort2.d.z,connectionName:h,rootConnectionName:d,prevPortPointId:l.regionPort1.d.portId}]}),s=[];if(r.d._containsObstacle&&e.has(r.regionId)){let l=t.get(r.regionId)??[],h=[];for(let u of l)i.some((_)=>_.connectionName===u.connectionName&&_.rootConnectionName===u.rootConnectionName&&_.portPointId===u.portPointId)||h.push(u);i.push(...h);let d=new Map;for(let u of i){let _=`${u.connectionName}::${u.rootConnectionName??""}`,p=d.get(_)??[];p.push(u),d.set(_,p)}for(let[u,_]of d.entries()){let[p,m=""]=u.split("::"),A=_[0];if(!A)continue;let g={portPointId:`center:${r.regionId}:${p}:${m}`,x:r.d.center.x,y:r.d.center.y,z:A.z,connectionName:p,rootConnectionName:m||void 0};if(_.length>=2){let f=_[_.length-1];A.portPointId&&(A.nextPortPointId=g.portPointId,g.prevPortPointId=A.portPointId),f.portPointId&&(f.prevPortPointId=g.portPointId,g.nextPortPointId=f.portPointId)}s.push(g)}}let a=[...i,...s];a.length>0&&n.push({capacityMeshNodeId:r.d.capacityMeshNodeId,center:r.d.center,width:r.d.width,height:r.d.height,portPoints:a,availableZ:r.d.availableZ});let c=r.ports.map((l)=>{let h=l.d,d=l.d.regions.some((u)=>Boolean(u.d._offBoardConnectionId));return{portPointId:l.d.portId,x:l.d.x,y:l.d.y,z:l.d.z,prevPortPointId:h.prevPortPointId,nextPortPointId:h.nextPortPointId,connectionNodeIds:l.d.regions.map((u)=>u.regionId),distToCentermostPortOnZ:l.d.distToCentermostPortOnZ,connectsToOffBoardNode:d}});o.push({capacityMeshNodeId:r.d.capacityMeshNodeId,center:r.d.center,width:r.d.width,height:r.d.height,portPoints:c,availableZ:r.d.availableZ,_containsObstacle:r.d._containsObstacle,_containsTarget:r.d._containsTarget,_offBoardConnectionId:r.d._offBoardConnectionId,_offBoardConnectedCapacityMeshNodeIds:r.d._offBoardConnectedCapacityMeshNodeIds})}return{nodesWithPortPoints:n,inputNodeWithPortPoints:o}}visualize(){return function(e){let t={};return t=e.reduce((n,o)=>n&&o?TO(n,o):{},t),t||{}}([P3r(this.params.graph),this.visualizePfOverlay(),S3r(this.params.connections,this.params.colorMap??{}),I3r(this.candidateQueue.peekMany(100),this.currentConnection?.startRegion.d.center),v3r(this.solvedRoutes,this.params.colorMap??{})])}visualizePfOverlay(){let e=this.getOutput(),t=e?.inputNodeWithPortPoints??[],n=new Map((e?.nodesWithPortPoints??[]).map((r)=>[r.capacityMeshNodeId,r])),o={rects:[]};for(let r of t){let i=this.computeNodePf(r),s=i??0,a=n.get(r.capacityMeshNodeId),c=a?o_(a):{numSameLayerCrossings:0,numEntryExitLayerChanges:0,numTransitionPairCrossings:0},l=Math.min(255,Math.floor(512*s)),h=Math.max(0,255-Math.floor(512*s)),d=`rgba(${l}, ${h}, ${h}, ${s<0.001?"0.1":"0.3"})`;r._containsObstacle&&(d="rgba(255, 0, 0, 0.3)"),r._offBoardConnectedCapacityMeshNodeIds?.length&&(d="rgba(255, 165, 0, 0.3)"),o.rects.push({center:r.center,width:r.width-0.2,height:r.height-0.2,layer:`z${r?.availableZ?.join(",")}`,fill:d,label:`${r.capacityMeshNodeId}
pf: ${i===null?"n/a":i.toFixed(3)}
xSame: ${c.numSameLayerCrossings}, xLC: ${c.numEntryExitLayerChanges}, xTransition: ${c.numTransitionPairCrossings}`})}return o}},E3r=(e)=>{if(!e.assignments||e.assignments.length===0)return e.d?.assignment?0:1;let t=e.assignments.flatMap((r)=>{let i=r.regionPort1.d,s=r.regionPort2.d,a=r.connection.connectionId,c=r.connection,l=c.simpleRouteConnection?.__rootConnectionNames?.[0];return[{x:i.x,y:i.y,z:i.z,connectionName:a,rootConnectionName:l},{x:s.x,y:s.y,z:s.z,connectionName:a,rootConnectionName:l}]}),n={...e.d,portPoints:t},o=o_(n);return ly(e.d,o.numSameLayerCrossings,o.numEntryExitLayerChanges,o.numTransitionPairCrossings)};function ob(e,t,n,o={}){return{solverName:e,solverClass:t,getConstructorParams:n,onSolved:o.onSolved}}var Wan=class extends Kr{constructor(e,t={}){super(),this.srj=e,this.opts=t,this.srj=e,this.opts={...t},this.viaDiameter=Pp(e).padDiameter,this.minTraceWidth=e.minTraceWidth;let n=this.opts;if(this.effort=n.effort??1,this.MAX_ITERATIONS=1e8*this.effort,n.capacityDepth===void 0){let o=e.bounds.maxX-e.bounds.minX,r=e.bounds.maxY-e.bounds.minY,i=Math.max(o,r),s=n.targetMinCapacity??0.5;n.capacityDepth=MQ(i,s)}this.connMap=Ep(e),this.colorMap=yA(e,this.connMap),this.cacheProvider=n.cacheProvider===void 0?_9():n.cacheProvider===null?null:n.cacheProvider,this.startTimeOfPhase={},this.endTimeOfPhase={},this.timeSpentOnPhase={}}srj;opts;netToPointPairsSolver;nodeSolver;nodeTargetMerger;edgeSolver;colorMap;highDensityRouteSolver;highDensityStitchSolver;singleLayerNodeMerger;strawSolver;deadEndSolver;traceSimplificationSolver;availableSegmentPointSolver;portPointPathingSolver;multiSectionPortPointOptimizer;uniformPortDistributionSolver;traceWidthSolver;necessaryCrampedPortPointSolver;hyperGraphSectionOptimizer;viaDiameter;minTraceWidth;effort;startTimeOfPhase;endTimeOfPhase;timeSpentOnPhase;activeSubSolver=null;connMap;srjWithPointPairs;capacityNodes=null;capacityEdges=null;cacheProvider=null;pipelineDef=[ob("netToPointPairsSolver",kq,(e)=>[e.srj,e.colorMap,SQ(e.srj)],{onSolved:(e)=>{e.srjWithPointPairs=e.netToPointPairsSolver?.getNewSimpleRouteJson(),e.colorMap=yA(e.srjWithPointPairs,this.connMap),e.connMap=Ep(e.srjWithPointPairs)}}),ob("nodeSolver",wq,(e)=>[{simpleRouteJson:e.srjWithPointPairs,maxGapFillPasses:4}],{onSolved:(e)=>{e.capacityNodes=e.nodeSolver?.getOutput().meshNodes??[]}}),ob("edgeSolver",PQ,(e)=>[e.capacityNodes],{onSolved:(e)=>{e.capacityEdges=e.edgeSolver?.edges}}),ob("availableSegmentPointSolver",yV,(e)=>[{nodes:e.capacityNodes,edges:e.capacityEdges||[],traceWidth:e.minTraceWidth,colorMap:e.colorMap,shouldReturnCrampedPortPoints:!0}]),ob("necessaryCrampedPortPointSolver",Vle,(e)=>[{capacityMeshNodes:e.capacityNodes,sharedEdgeSegments:e.availableSegmentPointSolver.getOutput(),simpleRouteJson:e.srjWithPointPairs}]),ob("portPointPathingSolver",PYt,(e)=>{let t=e.necessaryCrampedPortPointSolver?.getOutput()??e.availableSegmentPointSolver.getOutput(),{graph:n,connections:o}=Yle({capacityMeshNodes:e.capacityNodes,layerCount:e.srj.layerCount,connectivityMap:e.connMap,segmentPortPoints:t.flatMap((r)=>r.portPoints),simpleRouteJsonConnections:e.srjWithPointPairs.connections});return[{graph:n,connections:o,layerCount:e.srj.layerCount,effort:Math.min(1,e.effort),flags:{FORCE_CENTER_FIRST:!0,RIPPING_ENABLED:!0},weights:{SHUFFLE_SEED:0,MEMORY_PF_FACTOR:4,CENTER_OFFSET_DIST_PENALTY_FACTOR:0,CENTER_OFFSET_FOCUS_SHIFT:0,NODE_PF_FACTOR:0,LAYER_CHANGE_COST:0,RIPPING_PF_COST:0,NODE_PF_MAX_PENALTY:100,BASE_CANDIDATE_COST:0.6,MAX_ITERATIONS_PER_PATH:0,RANDOM_WALK_DISTANCE:0,START_RIPPING_PF_THRESHOLD:0.3,END_RIPPING_PF_THRESHOLD:1,MAX_RIPS:1000,RANDOM_RIP_FRACTION:0.3,STRAIGHT_LINE_DEVIATION_PENALTY_FACTOR:4,GREEDY_MULTIPLIER:0.7,MIN_ALLOWED_BOARD_SCORE:-1e4}}]}),ob("hyperGraphSectionOptimizer",R5r,(e)=>{let t=e.portPointPathingSolver;return[{hyperGraphSolver:t,inputSolvedRoutes:t.solvedRoutes,expansionHopsFromCentralRegion:1,createHyperGraphSolver:(n)=>new PYt({graph:n.inputGraph,connections:n.inputConnections,inputSolvedRoutes:n.inputSolvedRoutes,layerCount:e.srj.layerCount,effort:Math.min(1,e.effort),flags:{FORCE_CENTER_FIRST:!0,RIPPING_ENABLED:!0},weights:{SHUFFLE_SEED:0,MEMORY_PF_FACTOR:4,CENTER_OFFSET_DIST_PENALTY_FACTOR:0,CENTER_OFFSET_FOCUS_SHIFT:0,NODE_PF_FACTOR:0,LAYER_CHANGE_COST:0,RIPPING_PF_COST:0,NODE_PF_MAX_PENALTY:100,BASE_CANDIDATE_COST:0.6,MAX_ITERATIONS_PER_PATH:0,RANDOM_WALK_DISTANCE:0,START_RIPPING_PF_THRESHOLD:0.3,END_RIPPING_PF_THRESHOLD:1,MAX_RIPS:1000,RANDOM_RIP_FRACTION:0.3,STRAIGHT_LINE_DEVIATION_PENALTY_FACTOR:4,GREEDY_MULTIPLIER:0.7,MIN_ALLOWED_BOARD_SCORE:-1e4}}),regionCost:E3r,effort:Math.min(1,e.effort),ACCEPTABLE_REGION_COST:0.1,MAX_ATTEMPTS_PER_REGION:Math.max(3,3*Math.min(1,e.effort)),MAX_ATTEMPTS_PER_SECTION:Math.max(50,50*Math.min(1,e.effort)),FRACTION_TO_REPLACE:1,alwaysRipConflicts:!0}]}),ob("uniformPortDistributionSolver",Sle,(e)=>[{nodeWithPortPoints:e.portPointPathingSolver?.getOutput().nodesWithPortPoints??[],inputNodesWithPortPoints:e.portPointPathingSolver?.getOutput().inputNodeWithPortPoints??[],minTraceWidth:e.minTraceWidth,obstacles:e.srj.obstacles,layerCount:e.srj.layerCount}]),ob("highDensityRouteSolver",PV,(e)=>[{nodePortPoints:e.uniformPortDistributionSolver?.getOutput()??[],nodePfById:new Map((e.portPointPathingSolver?.getOutput().inputNodeWithPortPoints??[]).map((t)=>[t.capacityMeshNodeId,e.portPointPathingSolver?.computeNodePf(t)??null])),colorMap:e.colorMap,connMap:e.connMap,viaDiameter:e.viaDiameter,traceWidth:e.minTraceWidth}]),ob("highDensityStitchSolver",UJe,(e)=>[{connections:e.srjWithPointPairs.connections,hdRoutes:e.highDensityRouteSolver.routes,colorMap:e.colorMap,layerCount:e.srj.layerCount,defaultViaDiameter:e.viaDiameter}]),ob("traceSimplificationSolver",Ab,(e)=>[{hdRoutes:e.highDensityStitchSolver.mergedHdRoutes,obstacles:e.srj.obstacles,connMap:e.connMap,colorMap:e.colorMap,outline:e.srj.outline,defaultViaDiameter:e.viaDiameter,layerCount:e.srj.layerCount,iterations:2}]),ob("traceWidthSolver",Lq,(e)=>[{hdRoutes:e.traceSimplificationSolver.simplifiedHdRoutes,obstacles:e.srj.obstacles,connMap:e.connMap,colorMap:e.colorMap,minTraceWidth:e.minTraceWidth,connection:e.srj.connections,layerCount:e.srj.layerCount}])];getConstructorParams(){return[this.srj,this.opts]}currentPipelineStepIndex=0;_step(){let e=this.pipelineDef[this.currentPipelineStepIndex];if(!e)return void(this.solved=!0);if(this.activeSubSolver)return this.activeSubSolver.step(),void(this.activeSubSolver.solved?(this.endTimeOfPhase[e.solverName]=performance.now(),this.timeSpentOnPhase[e.solverName]=this.endTimeOfPhase[e.solverName]-this.startTimeOfPhase[e.solverName],e.onSolved?.(this),this.activeSubSolver=null,this.currentPipelineStepIndex++):this.activeSubSolver.failed&&(this.error=this.activeSubSolver?.error,this.failed=!0,this.activeSubSolver=null));let t=e.getConstructorParams(this);this.activeSubSolver=new e.solverClass(...t),this[e.solverName]=this.activeSubSolver,this.timeSpentOnPhase[e.solverName]=0,this.startTimeOfPhase[e.solverName]=performance.now()}solveUntilPhase(e){for(;this.getCurrentPhase()!==e;)this.step()}getCurrentPhase(){return this.pipelineDef[this.currentPipelineStepIndex]?.solverName??"none"}visualize(){if(!this.solved&&this.activeSubSolver)return this.activeSubSolver.visualize();let e=this.netToPointPairsSolver?.visualize(),t=this.nodeSolver?.visualize(),n=this.nodeTargetMerger?.visualize(),o=this.singleLayerNodeMerger?.visualize(),r=this.strawSolver?.visualize(),i=this.edgeSolver?.visualize(),s=this.deadEndSolver?.visualize(),a=this.availableSegmentPointSolver?.visualize(),c=this.portPointPathingSolver?.visualize(),l=this.multiSectionPortPointOptimizer?.visualize(),h=this.uniformPortDistributionSolver?.visualize(),d=this.highDensityRouteSolver?.visualize(),u=this.highDensityStitchSolver?.visualize(),_=this.traceSimplificationSolver?.visualize(),p=this.necessaryCrampedPortPointSolver?.visualize(),m=this.highDensityRouteSolver?.visualize(),A=this.srj.outline,g=[];if(g.push({points:[{x:this.srj.bounds?.minX??-50,y:this.srj.bounds?.minY??-50},{x:this.srj.bounds?.maxX??50,y:this.srj.bounds?.minY??-50},{x:this.srj.bounds?.maxX??50,y:this.srj.bounds?.maxY??50},{x:this.srj.bounds?.minX??-50,y:this.srj.bounds?.maxY??50},{x:this.srj.bounds?.minX??-50,y:this.srj.bounds?.minY??-50}],strokeColor:"rgba(255,0,0,0.25)"}),A&&A.length>=2){let C=A.map((b)=>({x:b.x,y:b.y}));C.push({...C[0]}),g.push({points:C,strokeColor:"rgba(0, 136, 255, 0.95)"})}let f=Nw(this.srj),y={points:[...this.srj.connections.flatMap((C)=>C.pointsToConnect.map((b)=>({...b,layer:Rw(b,this.srj.layerCount),label:`${C.name} ${b.pcb_port_id??""}`})))],rects:[...(this.srj.obstacles??[]).filter((C)=>!C.isCopperPour).map((C)=>({...C,fill:C.layers?.includes("top")?"rgba(255,0,0,0.25)":C.layers?.includes("bottom")?"rgba(0,0,255,0.25)":"rgba(255,0,0,0.25)",layer:sS(C,this.srj.layerCount),label:f(C)}))],lines:g},x=[y,e,t,n,o,r,i,s,a,p,c,m,l,h,d?sl(y,d):null,u,_,this.solved?sl({lines:g},py(this.getOutputSimpleRouteJson())):null].filter(Boolean);return sl(...x)}preview(){if(this.highDensityRouteSolver){let e=[];for(let t=this.highDensityRouteSolver.routes.length-1;t>=0;t--){let n=this.highDensityRouteSolver.routes[t];if(e.push({points:n.route.map((o)=>({x:o.x,y:o.y})),strokeColor:this.colorMap[n.connectionName]}),e.length>200)break}return{lines:e}}return this.netToPointPairsSolver?this.netToPointPairsSolver.visualize():{}}_getOutputHdRoutes(){return this.traceWidthSolver?.getHdRoutesWithWidths()??this.traceSimplificationSolver?.simplifiedHdRoutes??this.highDensityStitchSolver.mergedHdRoutes}getOutputSimplifiedPcbTraces(){if(!this.solved||!this.highDensityRouteSolver)throw Error("Cannot get output before solving is complete");let e=[],t=this._getOutputHdRoutes();for(let n of this.netToPointPairsSolver?.newConnections??[]){let o=n.__netConnectionName??this.srj.connections.find((i)=>i.name===n.name)?.__netConnectionName,r=t.filter((i)=>i.connectionName===n.name);for(let i=0;i<r.length;i++){let s=r[i],a={type:"pcb_trace",pcb_trace_id:`${n.name}_${i}`,connection_name:o??n.__rootConnectionNames?.[0]??n.name,route:V4(s,this.srj.layerCount)};e.push(a)}}return e}getOutputSimpleRouteJson(){return{...this.srj,traces:this.getOutputSimplifiedPcbTraces()}}},M3r=class{MAX_ITERATIONS=1000;solved=!1;failed=!1;iterations=0;progress=0;error=null;activeSubSolver;failedSubSolvers;timeToSolve;stats={};pendingEffects;cacheHit;cacheKey;cacheToSolveSpaceTransform;getSolverName(){return this.constructor.name}step(){if(!this.solved&&!this.failed){this.iterations++;try{this._step()}catch(e){throw this.error=`${this.getSolverName()} error: ${e}`,console.error(this.error),this.failed=!0,e}!this.solved&&this.iterations>this.MAX_ITERATIONS&&this.tryFinalAcceptance(),!this.solved&&this.iterations>this.MAX_ITERATIONS&&(this.error=`${this.getSolverName()} ran out of iterations (MAX_ITERATIONS=${this.MAX_ITERATIONS})`,this.failed=!0),"computeProgress"in this&&(this.progress=this.computeProgress())}}_step(){}getConstructorParams(){throw Error("getConstructorParams not implemented")}solve(){let e=Date.now();for(;!this.solved&&!this.failed;)this.step();let t=Date.now();this.timeToSolve=t-e}visualize(){return{lines:[],points:[],rects:[],circles:[]}}tryFinalAcceptance(){}preview(){return{lines:[],points:[],rects:[],circles:[]}}},w3r=(e,t)=>{let n=(h)=>h===" "||h===`
`||h==="\r"||h==="\t",o=(h)=>{let d=0,u=h.length;for(;d<u&&n(h[d]);)d+=1;for(;u>d&&n(h[u-1]);)u-=1;return h.slice(d,u)},r=(h)=>{let d=[],u=0,_=0;for(let p=0;p<h.length;p+=1){let m=h[p];m!=="("?m!==")"?m===","&&_===0&&(d.push(o(h.slice(u,p))),u=p+1):_>0&&(_-=1):_+=1}return d.push(o(h.slice(u))),d},i=(h)=>{return`${d=h,Math.min(1,Math.max(0,d))}`;var d},s=((h)=>{let d=o(h);if(!d.startsWith("#"))return null;let u=d.slice(1);if(u.length!==3&&u.length!==6)return null;for(let _ of u){let p=_.toLowerCase();if(!(p>="0"&&p<="9")&&!(p>="a"&&p<="f"))return null}if(u.length===3){let[_,p,m]=u;return{r:Number.parseInt(_+_,16),g:Number.parseInt(p+p,16),b:Number.parseInt(m+m,16)}}return{r:Number.parseInt(u.slice(0,2),16),g:Number.parseInt(u.slice(2,4),16),b:Number.parseInt(u.slice(4,6),16)}})(t);if(s)return`rgba(${s.r}, ${s.g}, ${s.b}, ${i(1-e)})`;let a=((h)=>{let d=o(h),u=d.indexOf("(");return u<=0||d[d.length-1]!==")"?null:{name:o(d.slice(0,u)).toLowerCase(),args:r(d.slice(u+1,-1))}})(t);if(!a)return t;let{name:c,args:l}=a;if(c==="hsl"||c==="rgb")return l.length!==3?t:`${c}a(${l[0]}, ${l[1]}, ${l[2]}, ${i(1-e)})`;if(c==="hsla"||c==="rgba"){if(l.length!==4)return t;let h=((d)=>{let u=o(d);if(!u)return null;let _=Number.parseFloat(u);return Number.isFinite(_)?_:null})(l[3]);return h===null?t:`${c}(${l[0]}, ${l[1]}, ${l[2]}, ${i(h-e)})`}return t},B3r=(e,t)=>{try{return w3r(t,e)}catch(n){return console.error(n),e}},Xan=(e)=>e.rootConnectionName??e.connectionName,lle=(e)=>{let t=[];for(let n=0;n<e.route.length-1;n+=1){let o=e.route[n],r=e.route[n+1];if(!o||!r||o.z===r.z)continue;if(Math.abs(o.x-r.x)>0.000001||Math.abs(o.y-r.y)>0.000001)continue;let i={x:Math.round(1000*o.x)/1000,y:Math.round(1000*o.y)/1000},s=t.at(-1);s&&s.x===i.x&&s.y===i.y||t.push(i)}return t},z$=(e,t,n=0.001)=>Math.abs(e.x-t.x)<=n&&Math.abs(e.y-t.y)<=n,iZe=(e,t)=>({minX:e.center.x-e.width/2+t,maxX:e.center.x+e.width/2-t,minY:e.center.y-e.height/2+t,maxY:e.center.y+e.height/2-t}),Sp=(e,t)=>{let n=Math.max(Math.abs(e),Math.abs(t));if(n===0||n===Number.POSITIVE_INFINITY)return n;let o=e/n,r=t/n;return n*Math.sqrt(o*o+r*r)},cXe=(e,t)=>({x:e.x-t.x,y:e.y-t.y}),Mae=(e,t)=>e.x*t.x+e.y*t.y,EYt=(e,t,n)=>({x:e.x+(t.x-e.x)*n,y:e.y+(t.y-e.y)*n}),Aw=(e)=>{let t=[];for(let n=0;n<e.length;n+=1){let o=e[n];if(o)for(let r=0;r<o.route.length-1;r+=1){let i=o.route[r],s=o.route[r+1];i&&s&&(i.z!==s.z||z$(i,s)||t.push({routeIndex:n,rootConnectionName:Xan(o),startIndex:r,endIndex:r+1,start:i,end:s,z:i.z,traceRadius:(o.traceThickness??0.1)/2}))}}return t},sce=(e,t,n=0.000001)=>{let o=t.end.x-t.start.x,r=t.end.y-t.start.y,i=o*o+r*r;if(i<=n)return{x:t.start.x,y:t.start.y,t:0};let s=((e.x-t.start.x)*o+(e.y-t.start.y)*r)/i,a=(c=s,Math.max(0,Math.min(c,1)));var c;return{x:t.start.x+o*a,y:t.start.y+r*a,t:a}},pQ=(e,t,n=0.000001)=>{let o=cXe(e.end,e.start),r=cXe(t.end,t.start),i=cXe(e.start,t.start),s=Mae(o,o),a=Mae(o,r),c=Mae(r,r),l=Mae(o,i),h=Mae(r,i),d=s*c-a*a,u=n,_,p,m=d,A=d;d<=u?(_=0,m=1,p=h,A=c):(_=a*h-c*l,p=s*h-a*l,_<0?(_=0,p=h,A=c):_>m&&(_=m,p=h+a,A=c)),p<0?(p=0,-l<0?_=0:-l>s?_=m:(_=-l,m=s)):p>A&&(p=A,-l+a<0?_=0:-l+a>s?_=m:(_=-l+a,m=s));let g=Math.abs(_)<=u?0:_/m,f=Math.abs(p)<=u?0:p/A,y=EYt(e.start,e.end,g),x=EYt(t.start,t.end,f),C=sce(e.start,t,n),b=sce(e.end,t,n),I=sce(t.start,e,n),v=sce(t.end,e,n);return[{leftT:g,rightT:f,leftPoint:y,rightPoint:x},{leftT:0,rightT:C.t,leftPoint:e.start,rightPoint:C},{leftT:1,rightT:b.t,leftPoint:e.end,rightPoint:b},{leftT:I.t,rightT:0,leftPoint:I,rightPoint:t.start},{leftT:v.t,rightT:1,leftPoint:v,rightPoint:t.end}].sort((P,M)=>Sp(P.leftPoint.x-P.rightPoint.x,P.leftPoint.y-P.rightPoint.y)-Sp(M.leftPoint.x-M.rightPoint.x,M.leftPoint.y-M.rightPoint.y))},G7=0.000001,ace=(e)=>{let t=[];for(let n of e){let o=t[n.routeIndex]??[];o[n.startIndex]=n,t[n.routeIndex]=o}return t},jan=(e,t)=>e<t?[e,t]:[t,e],hCe=(e,t)=>e.some(([n,o])=>n===t[0]&&o===t[1]),MYt=(e,t,n)=>{let o,r=Number.POSITIVE_INFINITY;for(let i of e){if(i.routeIndex!==t.routeIndex||i.z!==t.z||i.endIndex!==t.startIndex&&i.startIndex!==t.endIndex)continue;let[s]=pQ(i,n);if(!s)continue;let a=Sp(s.leftPoint.x-s.rightPoint.x,s.leftPoint.y-s.rightPoint.y);a>=r||(r=a,o=i)}return o},wYt=(e,t)=>{let n=Aw(t),o=Aw(e),r=ace(o),i=[];for(let s=0;s<n.length;s+=1){let a=n[s];if(a)for(let c=s+1;c<n.length;c+=1){let l=n[c];if(!l||a.z!==l.z||a.rootConnectionName===l.rootConnectionName||Math.max(a.start.x,a.end.x)<Math.min(l.start.x,l.end.x)||Math.max(l.start.x,l.end.x)<Math.min(a.start.x,a.end.x)||Math.max(a.start.y,a.end.y)<Math.min(l.start.y,l.end.y)||Math.max(l.start.y,l.end.y)<Math.min(a.start.y,a.end.y))continue;let[h]=pQ(a,l);if(!h||Sp(h.leftPoint.x-h.rightPoint.x,h.leftPoint.y-h.rightPoint.y)>G7||h.leftT<=G7||h.leftT>=0.999999||h.rightT<=G7||h.rightT>=0.999999)continue;let d=r[a.routeIndex]?.[a.startIndex],u=r[l.routeIndex]?.[l.startIndex];if(!d||!u)continue;let[_]=pQ(d,u);if(!_||Sp(_.leftPoint.x-_.rightPoint.x,_.leftPoint.y-_.rightPoint.y)<=G7)continue;let p=MYt(o,d,u),m=MYt(o,u,d),A=p?[d,p]:[d],g=m?[u,m]:[u];for(let f of A)for(let y of g){let x={leftRouteIndex:a.routeIndex,leftStartPointIndex:f.startIndex,rightRouteIndex:l.routeIndex,rightStartPointIndex:y.startIndex};i.some((C)=>C.leftRouteIndex===x.leftRouteIndex&&C.leftStartPointIndex===x.leftStartPointIndex&&C.rightRouteIndex===x.rightRouteIndex&&C.rightStartPointIndex===x.rightStartPointIndex)||i.push(x)}}}return i},lXe=(e)=>{let t=Aw(e),n=[];for(let o=0;o<t.length;o+=1){let r=t[o];if(r)for(let i=o+1;i<t.length;i+=1){let s=t[i];if(!s||r.z!==s.z||r.rootConnectionName===s.rootConnectionName)continue;let[a]=pQ(r,s);if(!a)continue;if(Sp(a.leftPoint.x-a.rightPoint.x,a.leftPoint.y-a.rightPoint.y)+G7<r.traceRadius+s.traceRadius){let c=jan(r.routeIndex,s.routeIndex);hCe(n,c)||n.push(c)}}}return n},TKe=(e,t)=>t<=1||t>=e-2,Kan=(e,t)=>t.some((n)=>TKe(e,n)),dCe=0.2,DKe=0.4,T3r=0.7000000000000001,w3e=0.03,BYt=1000,wd=0.000001,sZe=0.015,TYt=(e)=>Math.round(e*BYt)/BYt,hXe=(e,t)=>({x:e.x-t.x,y:e.y-t.y}),$an=(e,t)=>({x:e.x*t,y:e.y*t}),DYt=(e,t)=>e.x*t.x+e.y*t.y,D3r=(e,t,n)=>({x:e.x+(t.x-e.x)*n,y:e.y+(t.y-e.y)*n}),pV=(e)=>Math.max(0,Math.min(e,1)),bq=(e,t,n)=>Math.max(t,Math.min(e,n)),qan=(e,t)=>{let n=((o)=>Sp(o.x,o.y))(e);return n<=t||n<=wd?e:$an(e,t/n)},Jan=(e,t=0)=>({minX:e.center.x-e.width/2-t,maxX:e.center.x+e.width/2+t,minY:e.center.y-e.height/2-t,maxY:e.center.y+e.height/2+t}),N3r=(e,t,n=0)=>{let o=Jan(t,n);return e.x>=o.minX&&e.x<=o.maxX&&e.y>=o.minY&&e.y<=o.maxY},R3r=(e,t,n)=>{if(e.regionId){let s=t.findIndex((a)=>a.capacityMeshNodeId===e.regionId);if(s!==-1)return s}let o=[...e.route.map(({x:s,y:a})=>({x:s,y:a})),...e.vias.map(({x:s,y:a})=>({x:s,y:a}))],r=-1,i=Number.POSITIVE_INFINITY;for(let s=0;s<t.length;s++){let a=t[s];if(!a||!o.every((l)=>N3r(l,a,n)))continue;let c=a.width*a.height;c<i&&(i=c,r=s)}return r},NYt=(e,t,n,o)=>{let r=((i,s,a)=>{let c=Math.min(Math.abs(i.originalX-a.minX),Math.abs(a.maxX-i.originalX)),l=Math.min(Math.abs(i.originalY-a.minY),Math.abs(a.maxY-i.originalY));if(Math.abs(c-l)<=wd)return Math.abs(s.x-i.x)>=Math.abs(s.y-i.y)?"y":"x";return c<l?"y":"x"})(e,t,n);return qan(r==="x"?{x:1.1*(e.x-t.x)*o,y:0}:{x:0,y:1.1*(e.y-t.y)*o},0.06*o)},b$=(e,t,n,o,r=3.5,i=0.2,s=0.4)=>{let a=Math.max(e,0);if(a>=s)return 0;let c=a/i;if(c<1){let d=1-c;return t*d**3*(1+d*r)}let l=(a-i)/Math.max(s-i,wd),h=t*n*Math.exp(-l*o);return h<0.00001?0:h},Q3r=(e,t)=>{let n=e.boundaryPadding>0?0.001:0,o=t.minX+e.boundaryPadding+n,r=t.maxX-e.boundaryPadding-n,i=t.minY+e.boundaryPadding+n,s=t.maxY-e.boundaryPadding-n;e.x=bq(e.x,o,r),e.y=bq(e.y,i,s)},NKe=(e,t)=>{for(let n of e)for(let o of n.nodes)Q3r(o,t)},Zan=(e)=>e.kind==="via"?0.4:0.25,k3r=(e)=>(e.kind,0.5),ecn=(e)=>e.kind==="via"?12:3.5,L3r=(e)=>e.kind==="via"?0.18:0.06,H3r=(e)=>e.kind==="via"?1.35:1.05,F3r=(e,t)=>e.kind==="via"?3*t:t,RKe=(e,t,n,o)=>{let r=2*t;e[r]=(e[r]??0)+n,e[r+1]=(e[r+1]??0)+o},HO=(e,t,n,o,r,i)=>{if(e.fixed||RKe(o,e.node.forceIndex,t,n),!e.fixed&&r&&i!==void 0){let s=2*i;r[s]=(r[s]??0)+t,r[s+1]=(r[s+1]??0)+n}},tcn=(e,t,n,o,r=0.5)=>{let{startNode:i,endNode:s}=e,a=1-pV(r),c=pV(r),l=i.fixed?0:a,h=s.fixed?0:c,d=l+h;if(!(d<=wd)){if(!i.fixed&&l>0){let u=l/d;RKe(o,i.forceIndex,t*u,n*u)}if(!s.fixed&&h>0){let u=h/d;RKe(o,s.forceIndex,t*u,n*u)}}},z3r=(e,t,n,o,r)=>{if(t.fixed)return{x:0,y:0};let{minX:i,maxX:s,minY:a,maxY:c}=e,l=((p)=>p.kind==="via"?0.65:dCe)(t),h=((p)=>p.kind==="via"?T3r:DKe)(t),d=((p)=>p.kind==="via"?0.015:0.08)(t),u=((p)=>p.kind==="via"?80:20)(t),_=ecn(t);return{x:b$(n-i,w3e,d,u,_,l,h)*r-b$(s-n,w3e,d,u,_,l,h)*r,y:b$(o-a,w3e,d,u,_,l,h)*r-b$(c-o,w3e,d,u,_,l,h)*r}},O3r=(e)=>{if(e.length===0)return null;let t=new i_(e.length);for(let n of e){let{startNode:o,endNode:r}=n;t.add(Math.min(o.x,r.x),Math.min(o.y,r.y),Math.max(o.x,r.x),Math.max(o.y,r.y))}return t.finish(),{index:t,segments:e}},ncn=(e)=>{let t=new Map,n=new Map;for(let o of e){let r=n.get(o.z)??[];r.push(o),n.set(o.z,r)}for(let[o,r]of n){let i=O3r(r);i&&t.set(o,i)}return{byLayer:t}},ocn=(e,t,n,o,r)=>{let i=(a)=>({candidateIndexes:a.index.search(n-r,o-r,n+r,o+r),segments:a.segments});if(t.kind==="point"){let a=e.byLayer.get(t.z);return a?[i(a)]:[]}let s=[];for(let a of e.byLayer.values())s.push(i(a));return s},V3r=(e)=>{let t=[];for(let n=0;n<e.length;n+=1){let o=e[n];if(!o)continue;let r=new Set;for(let i=0;i<o.route.length-1;i+=1){let s=o.route[i],a=o.route[i+1];if(!s||!a)continue;if(s.z===a.z||!z$(s,a))continue;let c=[i,i+1];for(let d=i-1;d>=0;d-=1){let u=o.route[d];if(!u||!z$(u,s))break;c.push(d)}for(let d=i+2;d<o.route.length;d+=1){let u=o.route[d];if(!u||!z$(u,s))break;c.push(d)}let l=[...new Set(c)].sort((d,u)=>d-u),h=!1;for(let d of l)if(r.has(d)){h=!0;break}if(!h){for(let d of l)r.add(d);t.push({routeIndex:n,rootConnectionName:Xan(o),pointIndexes:l,x:s.x,y:s.y,radius:(o.viaDiameter??0.3)/2,movable:!Kan(o.route.length,l)})}}}return t},QKe=(e)=>{let{routes:t,via:n,dx:o,dy:r,node:i}=e;if(!n.movable)return!1;n.x+=o,n.y+=r,((a,c)=>{let l=iZe(c,a.radius+wd);a.x=bq(a.x,l.minX,l.maxX),a.y=bq(a.y,l.minY,l.maxY)})(n,i);let s=t[n.routeIndex];if(!s)return!1;for(let a of n.pointIndexes){let c=s.route[a];c&&(c.x=n.x,c.y=n.y)}return!0},Y3r=(e)=>{let{routes:t,node:n,vias:o}=e,r=!1;for(let i=0;i<o.length;i+=1){let s=o[i];if(s)for(let a=i+1;a<o.length;a+=1){let c=o[a];if(!c)continue;let l=s.radius+c.radius+0.1+sZe,h=s.x-c.x,d=s.y-c.y,u=Sp(h,d),_=l-u;if(_<=0)continue;let p=1.61803398875*(97*i+13*a),m=u>wd?h/u:Math.cos(p),A=u>wd?d/u:Math.sin(p),g=Number(s.movable)+Number(c.movable);if(g===0)continue;let f=Math.min(0.04,_/g);r=QKe({routes:t,via:s,dx:m*f,dy:A*f,node:n})||r,r=QKe({routes:t,via:c,dx:-m*f,dy:-A*f,node:n})||r}}return r},G3r=(e)=>{let{routes:t,node:n,vias:o,segments:r}=e,i=!1;for(let s=0;s<o.length;s+=1){let a=o[s];if(a?.movable)for(let c of r){if(a.rootConnectionName===c.rootConnectionName)continue;let l=sce(a,c),h=a.x-l.x,d=a.y-l.y,u=Sp(h,d),_=a.radius+c.traceRadius+0.1+sZe-u;if(_<=0)continue;let p=c.end.x-c.start.x,m=c.end.y-c.start.y,A=Sp(p,m),g=s%2==0?1:-1,f=u>wd?h/u:A>wd?-m/A*g:1,y=u>wd?d/u:A>wd?p/A*g:0,x=Math.min(0.04,_);i=QKe({routes:t,via:a,dx:f*x,dy:y*x,node:n})||i}}return i},RYt=(e)=>{let{routes:t,routeIndex:n,pointIndex:o,dx:r,dy:i,node:s}=e,a=t[n];if(!a||o<=0||o>=a.route.length-1)return!1;let c=((d,u,_=0.001)=>{let p=d[u];if(!p)return[];let m=[u];for(let A=u-1;A>=0;A-=1){let g=d[A];if(!g||!z$(g,p,_))break;m.push(A)}for(let A=u+1;A<d.length;A+=1){let g=d[A];if(!g||!z$(g,p,_))break;m.push(A)}return[...new Set(m)]})(a.route,o);if(Kan(a.route.length,c))return!1;let l=iZe(s,wd),h=!1;for(let d of c){let u=a.route[d];u&&(u.x=bq(u.x+r,l.minX,l.maxX),u.y=bq(u.y+i,l.minY,l.maxY),h=!0)}return h},kKe=(e)=>{let{routes:t,segment:n,dx:o,dy:r,node:i,t:s}=e,a=1-pV(s),c=pV(s),l=RYt({routes:t,routeIndex:n.routeIndex,pointIndex:n.startIndex,dx:o*a,dy:r*a,node:i}),h=RYt({routes:t,routeIndex:n.routeIndex,pointIndex:n.endIndex,dx:o*c,dy:r*c,node:i});return l||h},rcn=(e)=>{let{routes:t,node:n,segments:o,movableRouteIndexes:r}=e,i=!1;for(let s=0;s<o.length;s+=1){let a=o[s];if(a)for(let c=s+1;c<o.length;c+=1){let l=o[c];if(!l||a.z!==l.z||a.rootConnectionName===l.rootConnectionName)continue;let h=a.traceRadius+l.traceRadius+0.1+sZe;if(Math.max(a.start.x,a.end.x)+h<=Math.min(l.start.x,l.end.x)||Math.max(l.start.x,l.end.x)+h<=Math.min(a.start.x,a.end.x)||Math.max(a.start.y,a.end.y)+h<=Math.min(l.start.y,l.end.y)||Math.max(l.start.y,l.end.y)+h<=Math.min(a.start.y,a.end.y))continue;let[d]=pQ(a,l);if(!d)continue;let u=d.leftPoint.x-d.rightPoint.x,_=d.leftPoint.y-d.rightPoint.y,p=Sp(u,_),m=h-p;if(m<=0)continue;let A=!r||r.has(a.routeIndex),g=!r||r.has(l.routeIndex),f=Number(A)+Number(g);if(f===0)continue;let y=a.end.x-a.start.x,x=a.end.y-a.start.y,C=Sp(y,x),b=(s+c)%2==0?1:-1,I=p>wd?u/p:C>wd?-x/C*b:1,v=p>wd?_/p:C>wd?y/C*b:0,P=Math.min(0.025,m/f);A&&(i=kKe({routes:t,segment:a,dx:I*P,dy:v*P,node:n,t:d.leftT})||i),g&&(i=kKe({routes:t,segment:l,dx:-I*P,dy:-v*P,node:n,t:d.rightT})||i)}}return i},QYt=(e,t)=>{for(let n=0;n<10;n+=1){let o=V3r(t),r=Aw(t),i=Y3r({routes:t,node:e,vias:o}),s=G3r({routes:t,node:e,vias:o,segments:r}),a=rcn({routes:t,node:e,segments:r});if(!i&&!s&&!a)break}for(let n of t)n.vias=lle(n);return t},U3r=(e,t,n)=>{for(let o=0;o<10;o+=1)if(!rcn({routes:t,node:e,segments:Aw(t),movableRouteIndexes:n}))break;for(let o of n){let r=t[o];r&&(r.vias=lle(r))}return t},kYt=(e,t,n,o,r,i=3,s=0.02)=>{for(let a=0;a<i;a+=1){r.fill(0);let c=ncn(o);for(let l=0;l<n.length;l+=1){let h=n[l];if(!h||h.kind!=="via")continue;let d=h.node;for(let u=l+1;u<n.length;u+=1){let _=n[u];if(!_||_.kind!=="via")continue;if(h.rootConnectionName===_.rootConnectionName)continue;let p=_.node,m=d.x-p.x,A=d.y-p.y;if(Math.abs(m)>=dCe||Math.abs(A)>=dCe)continue;let g=Sp(m,A),f=dCe-g;if(f<=0)continue;let y=0,x=0;if(g>wd){let v=1/g;y=m*v,x=A*v}else{let v=1.61803398875*(1009*a+97*l+13*u);y=Math.cos(v),x=Math.sin(v)}let C=Math.min(s,0.9*f),b=y*C,I=x*C;HO(h,b,I,r),HO(_,-b,-I,r)}}for(let l=0;l<n.length;l+=1){let h=n[l];if(!h)continue;let d=h.node,u=Zan(h),_=ocn(c,h,d.x,d.y,u);for(let p of _)for(let m of p.candidateIndexes){let A=p.segments[m];if(!A)continue;if(h.rootConnectionName===A.rootConnectionName)continue;let{startNode:g,endNode:f}=A,y=f.x-g.x,x=f.y-g.y,C=y*y+x*x;if(C<=wd)continue;let b=d.x-g.x,I=d.y-g.y,v=pV((b*y+I*x)/C),P=g.x+y*v,M=g.y+x*v,B=d.x-P,T=d.y-M,N=Sp(B,T),D=u-N;if(D<=0)continue;let L=1009*a+97*l+13*A.obstacleIndex,H=0,V=0;if(N>wd){let Y=1/N;H=B*Y,V=T*Y}else{let Y=-x,X=y,K=Sp(Y,X);if(K>wd){let J=(L%2==0?1:-1)/K;H=Y*J,V=X*J}else{let J=1.61803398875*L;H=Math.cos(J),V=Math.sin(J)}}let O=Math.min(F3r(h,s),D*H3r(h)),U=H*O,j=V*O;HO(h,U,j,r),tcn(A,-U,-j,r,v)}}for(let l=0;l<t.length;l+=1){let h=t[l];if(h)for(let d=0;d<h.nodes.length;d+=1){let u=h.nodes[d];if(!u||u.fixed)continue;let _=2*u.forceIndex,p=r[_]??0,m=r[_+1]??0,A=Sp(p,m);if(A>s&&A>wd){let g=s/A;p*=g,m*=g}u.x+=p,u.y+=m}}NKe(t,e)}},LYt=(e,t,n,o)=>{let{mutableRoutes:r,totalNodeCount:i}=((_)=>{let p=0;return{mutableRoutes:_.map((m)=>{let A=[],g=new Int32Array(m.route.length);g.fill(-1);for(let f=0;f<m.route.length;f+=1){let y=m.route[f];if(!y)continue;let x=m.route[f-1],C=A.at(-1),b=A.length-1;C&&x&&x.x===y.x&&x.y===y.y?(x.z!==y.z&&(C.boundaryPadding=Math.max(C.boundaryPadding,m.viaDiameter/2)),C.pointIndexes.push(f),C.fixed||=TKe(m.route.length,f),g[f]=b):(A.push({x:y.x,y:y.y,originalX:y.x,originalY:y.y,boundaryPadding:0,pointIndexes:[f],fixed:TKe(m.route.length,f),forceIndex:p}),g[f]=A.length-1,p+=1)}return{route:m,rootConnectionName:m.rootConnectionName??m.connectionName,nodes:A,pointNodeIndexes:g}}),totalNodeCount:p}})(t),s=((_)=>{let p=[];for(let m=0;m<_.length;m+=1){let A=_[m];if(A)for(let g=0;g<A.nodes.length;g+=1){let f=A.nodes[g],y=f?.pointIndexes[0],x=y===void 0?void 0:A.route.route[y];f&&x&&(f.pointIndexes.length>1?p.push({kind:"via",routeIndex:m,rootConnectionName:A.rootConnectionName,node:f,fixed:f.fixed}):p.push({kind:"point",routeIndex:m,rootConnectionName:A.rootConnectionName,node:f,z:x.z,fixed:f.fixed}))}}return p})(r),a=((_)=>{let p=[];for(let m=0;m<_.length;m+=1){let A=_[m];if(A)for(let g=0;g<A.nodes.length-1;g+=1){let f=A.nodes[g],y=A.nodes[g+1],x=f?.pointIndexes[0],C=x===void 0?void 0:A.route.route[x];f&&y&&C&&p.push({obstacleIndex:p.length,rootConnectionName:A.rootConnectionName,z:C.z,startNode:f,endNode:y})}}return p})(r),c=new Float64Array(2*i),l=new Float64Array(2*i),h=o?.includeForceVectors??!0;NKe(r,e);let d=[];for(let _=0;_<n;_+=1){let p=n<=1?0:_/Math.max(n-1,1),m=0.25+0.75*(1-p),A=1-p,g=h&&_===n-1,f=g?new Float64Array(2*s.length):void 0;c.fill(0);for(let x=0;x<s.length;x+=1){let C=s[x];if(!C||C.kind!=="via")continue;let b=C.node;for(let I=x+1;I<s.length;I+=1){let v=s[I];if(!v||v.kind!=="via")continue;if(C.rootConnectionName===v.rootConnectionName)continue;let P=v.node,M=b.x-P.x,B=b.y-P.y;if(Math.abs(M)>=DKe||Math.abs(B)>=DKe)continue;let T=Sp(M,B),N=0,D=0;if(T>wd){let O=1/T;N=M*O,D=B*O}else{let O=1.61803398875*(97*x+13*I);N=Math.cos(O),D=Math.sin(O)}let L=b$(T,0.034,0.08,18)*m;if(L<=0)continue;let H=N*L,V=D*L;HO(C,H,V,c,f,x),HO(v,-H,-V,c,f,I)}}let y=ncn(a);for(let x=0;x<s.length;x+=1){let C=s[x];if(!C)continue;let b=C.node,I=k3r(C),v=ocn(y,C,b.x,b.y,I);for(let P of v)for(let M of P.candidateIndexes){let B=P.segments[M];if(!B)continue;if(C.rootConnectionName===B.rootConnectionName)continue;let{startNode:T,endNode:N}=B,D=N.x-T.x,L=N.y-T.y,H=D*D+L*L;if(H<=wd)continue;let V=b.x-T.x,O=b.y-T.y,U=pV((V*D+O*L)/H),j=T.x+D*U,Y=T.y+L*U,X=b.x-j,K=b.y-Y,J=Sp(X,K),ee=97*x+13*B.obstacleIndex,se=0,ne=0;if(J>wd){let ie=1/J;se=X*ie,ne=K*ie}else{let ie=-L,ce=D,ue=Sp(ie,ce);if(ue>wd){let de=(ee%2==0?1:-1)/ue;se=ie*de,ne=ce*de}else{let de=1.61803398875*ee;se=Math.cos(de),ne=Math.sin(de)}}let re=b$(J,L3r(C),0.08,18,ecn(C),Zan(C),I)*m;if(re<=0)continue;let Z=se*re,te=ne*re;HO(C,Z,te,c,f,x),tcn(B,-Z,-te,c,U)}}g&&(d=Array(s.length));for(let x=0;x<s.length;x+=1){let C=s[x];if(!C)continue;let b=C.node,I=z3r(e,C,b.x,b.y,m);if(HO(C,I.x,I.y,c,f,x),g&&f){let v=2*x;d[x]={kind:C.kind,routeIndex:C.routeIndex,rootConnectionName:C.rootConnectionName,x:b.x,y:b.y,dx:f[v]??0,dy:f[v+1]??0}}}for(let x=0;x<r.length;x+=1){let C=r[x];if(!C)continue;let b=C.nodes.length-2;for(let I=0;I<C.nodes.length;I+=1){let v=C.nodes[I];if(!v||v.fixed)continue;let P=2*v.forceIndex,M=(c[P]??0)+0.14*(v.originalX-v.x),B=(c[P+1]??0)+0.14*(v.originalY-v.y),T=0,N=0,D=0,L=0,H=C.nodes[I-1],V=C.nodes[I+1];if(H||V){let X=0,K=0,J=0;if(H&&(X+=H.x,K+=H.y,J+=1),V&&(X+=V.x,K+=V.y,J+=1),J>0){let ee=1/J;M+=0.22*(X*ee-v.x),B+=0.22*(K*ee-v.y)}}if(H&&V&&A>0){let X=hXe(V,H),K=DYt(X,X);if(K>wd){let J=pV(DYt(hXe(v,H),X)/K),ee=D3r(H,V,J),se=qan($an(hXe(ee,v),0.55*A),0.02*A);T=se.x,N=se.y}}if(A>0){if(I===1&&H?.fixed){let X=NYt(H,v,e,A);D+=X.x,L+=X.y}if(I===b&&V?.fixed){let X=NYt(V,v,e,A);D+=X.x,L+=X.y}}let O=0.85*M*m,U=0.85*B*m,j=Sp(O,U),Y=0.012*m;if(j>Y&&j>wd){let X=Y/j;O*=X,U*=X}v.x+=O+T+D,v.y+=U+N+L}}NKe(r,e),kYt(e,r,s,a,l,3,0.02)}return kYt(e,r,s,a,l,8,0.03),{routes:((_)=>_.map(({route:p,nodes:m,pointNodeIndexes:A})=>{let g=p.route.map((y,x)=>{let C=A[x]??-1,b=C>=0?m[C]:void 0;return b?{...y,x:TYt(b.x),y:TYt(b.y)}:y}),f={...p,route:g,vias:[]};return f.vias=lle(f),f}))(r),forceVectors:d,stepsCompleted:n}},Gle=class extends M3r{sampleEntries;originalHdRoutes;originalNodeWithPortPoints;colorMap;totalStepsPerNode;nodeAssignmentMargin;improvedRoutesByIndex=new Map;activeSampleIndex=0;latestVisualization={};constructor(e){super(),this.originalHdRoutes=e.hdRoutes,this.originalNodeWithPortPoints=e.nodeWithPortPoints,this.colorMap=e.colorMap??{},this.totalStepsPerNode=e.totalStepsPerNode??60,this.nodeAssignmentMargin=e.nodeAssignmentMargin??0.2;let t=new Map;for(let n=0;n<e.hdRoutes.length;n++){let o=R3r(e.hdRoutes[n],e.nodeWithPortPoints,this.nodeAssignmentMargin);if(o===-1)continue;let r=t.get(o)??[];r.push(n),t.set(o,r)}this.sampleEntries=Array.from(t.entries()).map(([n,o])=>({node:e.nodeWithPortPoints[n],routeIndexes:o})),this.MAX_ITERATIONS=Math.max(10*this.sampleEntries.length,1000),this.stats={nodeAssignmentMargin:this.nodeAssignmentMargin,sampleCount:this.sampleEntries.length,improvedNodeCount:0,improvedRouteCount:0,totalStepsPerNode:this.totalStepsPerNode}}getSolverName(){return"HighDensityForceImproveSolver"}getConstructorParams(){return[{nodeWithPortPoints:this.originalNodeWithPortPoints,hdRoutes:this.originalHdRoutes,totalStepsPerNode:this.totalStepsPerNode,nodeAssignmentMargin:this.nodeAssignmentMargin,colorMap:this.colorMap}]}_step(){let e=this.sampleEntries[this.activeSampleIndex];if(!e)return void(this.solved=!0);let t=Jan(e.node),n=e.routeIndexes.map((s)=>this.originalHdRoutes[s]),o=LYt(t,n,this.totalStepsPerNode,{includeForceVectors:!0});QYt(e.node,o.routes);let r=wYt(n,o.routes),i=r.length===0?o:LYt(t,((s,a)=>{let{routes:c,node:l,selectors:h}=s,d=structuredClone(c),u=Aw(c),_=ace(u),p=h.flatMap((m)=>{let A=_[m.leftRouteIndex]?.[m.leftStartPointIndex],g=_[m.rightRouteIndex]?.[m.rightStartPointIndex];if(!A||!g)return[];let[f]=pQ(A,g);if(!f)return[];let y=f.leftPoint.x-f.rightPoint.x,x=f.leftPoint.y-f.rightPoint.y,C=Sp(y,x);return C<=G7?[]:[{selector:m,directionX:y/C,directionY:x/C,requiredDistance:A.traceRadius+g.traceRadius+0.015}]});for(let m=0;m<3;m+=1){let A=Aw(d),g=ace(A);for(let f of p){let y=g[f.selector.leftRouteIndex]?.[f.selector.leftStartPointIndex],x=g[f.selector.rightRouteIndex]?.[f.selector.rightStartPointIndex];if(!y||!x)continue;let[C]=pQ(y,x);if(!C)continue;let b=(C.leftPoint.x-C.rightPoint.x)*f.directionX+(C.leftPoint.y-C.rightPoint.y)*f.directionY,I=f.requiredDistance-b;if(I<=0)continue;let v=Math.min(0.025,I/2);a({routes:d,segment:y,dx:f.directionX*v,dy:f.directionY*v,node:l,t:C.leftT}),a({routes:d,segment:x,dx:-f.directionX*v,dy:-f.directionY*v,node:l,t:C.rightT})}}for(let m of d)m.vias=lle(m);return d})({routes:n,node:e.node,selectors:r},kKe),this.totalStepsPerNode,{includeForceVectors:!0});if(i!==o){QYt(e.node,i.routes);let s=wYt(n,i.routes);if(s.length>0){let a=((c,l)=>{let{originalRoutes:h,guardedRoutes:d,node:u,crossingSelectors:_,protectedSelectors:p}=c,m=ace(Aw(h)),A=ace(Aw(d)),g=lXe(d),f=p.map(({leftRouteIndex:x,rightRouteIndex:C})=>jan(x,C)),y=iZe(u,G7);for(let x of _){let C=A[x.leftRouteIndex]?.[x.leftStartPointIndex],b=A[x.rightRouteIndex]?.[x.rightStartPointIndex];if(!C||!b)continue;let[I]=pQ(C,b);if(!(!I||Sp(I.leftPoint.x-I.rightPoint.x,I.leftPoint.y-I.rightPoint.y)>G7||I.leftT<=G7||I.leftT>=0.999999||I.rightT<=G7||I.rightT>=0.999999))for(let v of["right","left"]){let P=v==="left"?x.leftRouteIndex:x.rightRouteIndex,M=v==="left"?x.leftStartPointIndex:x.rightStartPointIndex,B=v==="left"?x.rightRouteIndex:x.leftRouteIndex,T=v==="left"?x.rightStartPointIndex:x.leftStartPointIndex,N=h[P],D=d[P],L=m[B]?.[T],H=A[B]?.[T];if(!(N&&D&&L&&H))continue;let V=N.route[M]?.z,O=[];for(let U=M-2;U<=M+3;U+=1){let j=N.route[U];!j||U<=0||U>=N.route.length-1||j.z!==V||[N.route[U-1],N.route[U+1]].some((Y)=>Y&&Y.z!==j.z)||O.push(U)}if(O.length!==0)for(let[U,j]of[[L.start,H.start],[L.end,H.end]])for(let Y of[1.51,1.25,1.75,2]){let X=[...d],K=structuredClone(D);X[P]=K;let J=!0;for(let re of O){let Z=N.route[re],te=K.route[re];if(!Z||!te)continue;let ie=j.x+(Z.x-U.x)*Y,ce=j.y+(Z.y-U.y)*Y;if(ie<=y.minX||ie>=y.maxX||ce<=y.minY||ce>=y.maxY){J=!1;break}te.x=ie,te.y=ce}if(!J)continue;K.vias=lle(K);let ee=X,se=lXe(ee),ne=new Set;for(let[re,Z]of se)hCe(g,[re,Z])||(re===P&&Z!==P?ne.add(Z):Z===P&&re!==P&&ne.add(re));if(ne.size>0){let re=l(u,structuredClone(X),ne),Z=lXe(re);f.every((te)=>!hCe(Z,te))&&Z.length<se.length&&(ee=re,se=Z)}if(f.every((re)=>!hCe(se,re))&&se.length<g.length)return ee}}}})({originalRoutes:n,guardedRoutes:i.routes,node:e.node,crossingSelectors:s,protectedSelectors:[...r,...s]},U3r);a&&(i={...i,routes:a})}}for(let s=0;s<e.routeIndexes.length;s++)this.improvedRoutesByIndex.set(e.routeIndexes[s],i.routes[s]);this.latestVisualization=HYt({node:e.node,routes:i.routes,forceVectors:i.forceVectors,colorMap:this.colorMap}),this.activeSampleIndex+=1,this.stats={nodeAssignmentMargin:this.nodeAssignmentMargin,sampleCount:this.sampleEntries.length,improvedNodeCount:this.activeSampleIndex,improvedRouteCount:this.improvedRoutesByIndex.size,totalStepsPerNode:this.totalStepsPerNode},this.activeSampleIndex>=this.sampleEntries.length&&(this.solved=!0)}getOutput(){return this.originalHdRoutes.map((e,t)=>this.improvedRoutesByIndex.get(t)??e)}visualize(){return this.solved?HYt({routes:this.getOutput(),colorMap:this.colorMap}):this.latestVisualization}},HYt=(e)=>{let t=[],n=[],o=[];e.node&&o.push({center:e.node.center,width:e.node.width,height:e.node.height,stroke:"rgba(14,165,233,0.7)",fill:"rgba(14,165,233,0.04)",label:e.node.capacityMeshNodeId});for(let r of e.routes){let i=e.colorMap?.[r.connectionName]??"#0ea5e9";for(let s=0;s<r.route.length-1;s++){let a=r.route[s],c=r.route[s+1];a.z===c.z&&t.push({points:[{x:a.x,y:a.y},{x:c.x,y:c.y}],strokeColor:a.z===0?i:B3r(i,0.5),strokeWidth:r.traceThickness,layer:`z${a.z}`,strokeDash:a.z!==0?[0.1,0.3]:void 0})}for(let s of r.vias)n.push({center:{x:s.x,y:s.y},radius:r.viaDiameter/2,stroke:i,fill:"rgba(14,165,233,0.12)"})}for(let r of e.forceVectors??[])t.push({points:[{x:r.x,y:r.y},{x:r.x+5*r.dx,y:r.y+5*r.dy}],strokeColor:"rgba(244,63,94,0.85)",strokeWidth:0.06,strokeDash:[0.08,0.08]});return{lines:t,circles:n,rects:o}},g6e=class extends Kr{constructor(e,t,n=Number.POSITIVE_INFINITY,o=0.010000000000000002){super(),this.nodes=e,this.maxNodeDimension=t,this.maxNodeRatio=n,this.minNodeArea=o,this.outputNodes=[]}nodes;maxNodeDimension;maxNodeRatio;minNodeArea;outputNodes;getSolverName(){return"NodeDimensionSubdivisionSolver"}getSubdivisionGrid(e){let t=Number.isFinite(this.maxNodeDimension)&&this.maxNodeDimension>0,n=Number.isFinite(this.maxNodeRatio)&&this.maxNodeRatio>0,o=t?Math.max(1,Math.ceil(e.width/this.maxNodeDimension)):1,r=t?Math.max(1,Math.ceil(e.height/this.maxNodeDimension)):1;if(n&&e.width>0&&e.height>0)for(;;){let i=e.width/o,s=e.height/r;if((i>=s?i/s:s/i)<=this.maxNodeRatio)break;i>=s?o++:r++}return{cols:o,rows:r}}shouldRemoveNode(e){let t=Number.isFinite(this.minNodeArea)&&this.minNodeArea>0;if(!Number.isFinite(e.width)||!Number.isFinite(e.height))return!0;if(!t||e.width*e.height>=this.minNodeArea)return!1;if(Math.min(e.width,e.height)<0.002)return!0;if(e._containsTarget)return!1;let n=0;for(let o of this.nodes)if(o.capacityMeshNodeId!==e.capacityMeshNodeId&&e.availableZ.some((r)=>o.availableZ.includes(r))&&Nbe(e,o)){if(o._containsTarget)return!1;if(n++,n>=2)return!1}return!0}subdivideNode(e){if(this.shouldRemoveNode(e))return[];let{cols:t,rows:n}=this.getSubdivisionGrid(e);if(t===1&&n===1)return[e];let o=e.width/t,r=e.height/n,i=e.center.x-e.width/2,s=e.center.y-e.height/2,a=[];for(let c=0;c<n;c++)for(let l=0;l<t;l++)a.push({...e,capacityMeshNodeId:`${e.capacityMeshNodeId}__sub_${c}_${l}`,center:{x:i+o*(l+0.5),y:s+r*(c+0.5)},width:o,height:r,availableZ:[...e.availableZ]});return a}_step(){let e=this.nodes.length,t=0,n=0,o=0;for(let r of this.nodes){let i=!Number.isFinite(r.width)||!Number.isFinite(r.height),s=this.subdivideNode(r);s.length!==0?(s.length>1&&t++,this.outputNodes.push(...s)):i?o++:n++}this.stats={inputNodeCount:e,outputNodeCount:this.outputNodes.length,subdividedNodeCount:t,removedSmallNodeCount:n,removedInvalidNodeCount:o,maxNodeDimension:this.maxNodeDimension,maxNodeRatio:this.maxNodeRatio,minNodeArea:this.minNodeArea},this.solved=!0}visualize(){return{rects:this.outputNodes.map((e)=>({center:e.center,width:e.width,height:e.height,label:`${e.capacityMeshNodeId}
${e.width.toFixed(2)}x${e.height.toFixed(2)}`,layer:`z${e.availableZ.join(",")}`,fill:"rgba(0, 200, 255, 0.08)",stroke:"rgba(0, 120, 180, 0.5)"}))}}},d9=(e)=>{let t=[...new Set(e.filter((n)=>typeof n=="number"&&Number.isInteger(n)&&n>=0))].sort((n,o)=>n-o);if(t.length!==0)return`z${t.join(",")}`},aZe=(e)=>{let t=[];for(let n=0;n<31;n++)e&1<<n&&t.push(n);return t},mQ=(e)=>typeof e=="object"&&e!==null,icn=(e)=>mQ(e)?{...e}:e===void 0?{}:{value:e},FO=(e,t)=>{let n=e.topology.regionMetadata?.[t];if(mQ(n)){if(typeof n.serializedRegionId=="string")return n.serializedRegionId;if(typeof n.regionId=="string")return n.regionId;if(typeof n.capacityMeshNodeId=="string")return n.capacityMeshNodeId}return`region-${t}`},I$=(e,t)=>{let n=e.topology.portMetadata?.[t];if(mQ(n)){if(typeof n.serializedPortId=="string")return n.serializedPortId;if(typeof n.portId=="string")return(o=n.portId).includes("::")?o.slice(0,o.indexOf("::")):o}var o;return`port-${t}`},scn=(e,t)=>{let n=e.problem.routeMetadata?.[t];return mQ(n)&&typeof n.connectionId=="string"?n.connectionId:`route-${t}`},W3r=(e,t)=>{let n=icn(e.topology.regionMetadata?.[t]);if(mQ(n.center)||(n.center={x:e.topology.regionCenterX[t],y:e.topology.regionCenterY[t]}),typeof n.width!="number"&&(n.width=e.topology.regionWidth[t]),typeof n.height!="number"&&(n.height=e.topology.regionHeight[t]),!Array.isArray(n.availableZ)){let o=e.topology.regionAvailableZMask?.[t]??0;o!==0&&(n.availableZ=aZe(o))}return n.layer=d9(Array.isArray(n.availableZ)?n.availableZ:[])??d9((e.topology.regionIncidentPorts[t]??[]).map((o)=>e.topology.portZ[o]))??"z0",n},X3r=(e,t)=>{let n=icn(e.topology.portMetadata?.[t]);return typeof n.x!="number"&&(n.x=e.topology.portX[t]),typeof n.y!="number"&&(n.y=e.topology.portY[t]),typeof n.z!="number"&&(n.z=e.topology.portZ[t]),n.layer=d9([e.topology.portZ[t]])??"z0",n},FYt=(e,t,n)=>{let o=(e.topology.incidentPortRegion[t]??[]).find((r)=>r!==n);if(o===void 0)throw Error(`Port ${t} is not incident to a region outside route region ${n}`);return o},j3r=(e,t,n)=>{let{orderedPortIds:o,orderedRegionIds:r}=((d,u,_)=>{if(_.length===0)throw Error(`Route ${u} has no solved segments`);let p=d.problem.routeStartPort[u],m=d.problem.routeEndPort[u],A=p===m,g=new Map;_.forEach((C,b)=>{let I={...C,segmentIndex:b},v=g.get(C.fromPortId)??[];v.push(I),g.set(C.fromPortId,v);let P=g.get(C.toPortId)??[];P.push(I),g.set(C.toPortId,P)});let f=[p],y=[],x=(C,b,I)=>{if(C===m&&(!A||b.size===_.length))return!0;for(let v of g.get(C)??[]){if(b.has(v.segmentIndex))continue;let P=v.fromPortId===C?v.toPortId:v.fromPortId,M=A&&P===m&&b.size+1===_.length;if(I.has(P)&&!M)continue;b.add(v.segmentIndex);let B=!I.has(P);if(B&&I.add(P),y.push(v.regionId),f.push(P),x(P,b,I))return!0;f.pop(),y.pop(),B&&I.delete(P),b.delete(v.segmentIndex)}return!1};if(!x(p,new Set,new Set([p])))throw Error(`Route ${u} is not a single ordered path from ${p} to ${m}`);return{orderedPortIds:f,orderedRegionIds:y}})(e,t,n),i=r[0],s=r[r.length-1];if(i===void 0||s===void 0)throw Error(`Route ${t} could not determine endpoint regions`);let a=FO(e,FYt(e,o[0],i)),c=FO(e,FYt(e,o[o.length-1],s)),l=((d,u,_,p)=>{let m=d.problem.routeMetadata?.[u];return{connectionId:scn(d,u),startRegionId:(mQ(m)&&typeof m.startRegionId=="string"?m.startRegionId:void 0)??_,endRegionId:(mQ(m)&&typeof m.endRegionId=="string"?m.endRegionId:void 0)??p,mutuallyConnectedNetworkId:(mQ(m)&&typeof m.mutuallyConnectedNetworkId=="string"?m.mutuallyConnectedNetworkId:void 0)??`net-${d.problem.routeNet[u]}`}})(e,t,a,c),h=o.map((d,u)=>{let _={portId:I$(e,d),g:u,h:0,f:u,hops:u,ripRequired:!1,nextRegionId:u<r.length?FO(e,r[u]):l.endRegionId};return u>0&&(_.lastPortId=I$(e,o[u-1]),_.lastRegionId=FO(e,r[u-1])),_});return{connection:l,solvedRoute:{connection:l,path:h,requiredRip:!1}}},K3r=(e)=>{if(!e.solved||e.failed)throw Error("convertToSerializedHyperGraph requires a solved, non-failed solver");let{topology:t}=e,n=((s)=>{let a=Array.from({length:s.problem.routeCount},()=>[]);return s.state.regionSegments.forEach((c,l)=>{for(let[h,d,u]of c)a[h].push({regionId:l,fromPortId:d,toPortId:u})}),a})(e),o=Array.from({length:t.regionCount},(s,a)=>{let c=e.state.regionSegments[a].map(([l,h,d])=>({regionPort1Id:I$(e,h),regionPort2Id:I$(e,d),connectionId:scn(e,l)}));return{regionId:FO(e,a),pointIds:t.regionIncidentPorts[a].map((l)=>I$(e,l)),d:W3r(e,a),...c.length>0&&{assignments:c}}}),r=Array.from({length:t.portCount},(s,a)=>{let[c,l]=t.incidentPortRegion[a]??[];if(c===void 0||l===void 0)throw Error(`Port ${a} is missing incident regions`);return{portId:I$(e,a),region1Id:FO(e,c),region2Id:FO(e,l),d:X3r(e,a)}}),i=n.map((s,a)=>j3r(e,a,s));return{regions:o,ports:r,connections:i.map(({connection:s})=>s),solvedRoutes:i.map(({solvedRoute:s})=>s)}},acn=0.3,ccn=(e)=>e>0&&!(e&e-1),$3r=(e,t,n,o,r,i=0,s=0.3,a=0)=>(2*t+1*n+1*o)*(s+0.15)**2*(1+r/5)/e+(ccn(i)?10*t:0)+a*(r/q3r(i))**2*0.010000000000000002/e,q3r=(e)=>{if(e===0)return 2;let t=e>>>0,n=0;for(;t!==0;)n+=1&t,t>>>=1;return n},zYt=(e,t)=>{let{netIds:n,lesserAngles:o,greaterAngles:r,layerMasks:i}=e,{netId:s,lesserAngle:a,greaterAngle:c,layerMask:l}=t,h=0,d=0;for(let u=0;u<n.length;u++){if(s===n[u])continue;(a<o[u]&&o[u]<c)!==(a<r[u]&&r[u]<c)&&((l&i[u])!==0?h++:d++)}t.sameLayerIntersectionCount=h,t.crossingLayerIntersectionCount=d},J3r=(e,t,n)=>{let o=e.routeStartPort[t],r=e.routeEndPort[t],i=new Map;for(let{fromPortId:c,toPortId:l}of n){let h=i.get(c)??new Set;h.add(l),i.set(c,h);let d=i.get(l)??new Set;d.add(c),i.set(l,d)}let s=new Set,a=[o];for(;a.length>0;){let c=a.pop();if(!s.has(c)){s.add(c);for(let l of i.get(c)??[])a.push(l)}}if(!s.has(r))throw Error(`Initial assignments for route ${t} do not connect ${o} to ${r}`);if(n.some(({fromPortId:c,toPortId:l})=>!s.has(c)||!s.has(l)))throw Error(`Initial assignments for route ${t} contain disconnected segments`)},LKe=({topology:e,problem:t,state:n,routeSuccessCountByRouteId:o,appendSegmentToRegionCache:r})=>{let i=t.initialAssignments??[];if(i.length===0)return;let s=new Map;for(let c of i){let{routeId:l,regionId:h,fromPortId:d,toPortId:u}=c;if(!Number.isInteger(l)||l<0||l>=t.routeCount)throw Error(`Initial assignment references invalid route ${l}`);if(!Number.isInteger(h)||h<0||h>=e.regionCount)throw Error(`Initial assignment references invalid region ${h}`);for(let p of[d,u]){if(!Number.isInteger(p)||p<0||p>=e.portCount)throw Error(`Initial assignment references invalid port ${p}`);if(!e.incidentPortRegion[p]?.includes(h))throw Error(`Initial assignment port ${p} is not incident to region ${h}`)}let _=s.get(l)??[];_.push(c),s.set(l,_)}for(let[c,l]of s)J3r(t,c,l);let a=new Set(s.keys());for(let{routeId:c,regionId:l,fromPortId:h,toPortId:d}of i){let u=t.routeNet[c];for(let _ of[h,d]){let p=n.portAssignment[_];if(p!==-1&&p!==u)throw Error(`Initial assignment port ${_} is assigned to multiple nets`);n.portAssignment[_]=u}n.currentRouteNetId=u,n.regionSegments[l].push([c,h,d]),r(l,h,d)}n.currentRouteNetId=void 0,n.unroutedRoutes=n.unroutedRoutes.filter((c)=>!a.has(c));for(let c of a)o[c]=1;return{initialAssignmentCount:i.length,initiallyRoutedRouteCount:a.size}},lcn=class{constructor(e,t){this.items=e,this.compare=t}items;compare;get length(){return this.items.length}toArray(){return[...this.items]}clear(){this.items.length=0}queue(e){this.items.push(e),this.siftUp(this.items.length-1)}dequeue(){let e=this.items[0];if(e===void 0)return;let t=this.items.pop();return this.items.length>0&&(this.items[0]=t,this.siftDown(0)),e}siftUp(e){let t=e;for(;t>0;){let n=t-1>>1,o=this.items[n],r=this.items[t];if(this.compare(o,r)<=0)return;this.items[n]=r,this.items[t]=o,t=n}}siftDown(e){let t=e,n=this.items.length;for(;;){let o=2*t+1;if(o>=n)return;let r=o+1,i=o;r<n&&this.compare(this.items[r],this.items[o])<0&&(i=r);let s=this.items[t],a=this.items[i];if(this.compare(s,a)<=0)return;this.items[t]=a,this.items[i]=s,t=i}}},hcn=class{constructor(e,t){this.regionCount=e,this.compactHopIndex=t,t&&(this.hopStateGeneration=new Uint32Array(t.hopCapacity),this.hopIndexOrClosed=new Int32Array(t.hopCapacity))}regionCount;compactHopIndex;items=[];indexByHopId=new Map;closedHopIds=new Set;hopStateGeneration;hopIndexOrClosed;currentHopStateGeneration=1;closureEpochToken={};get closureEpoch(){return this.closureEpochToken}get length(){return this.items.length}toArray(){return[...this.items]}clear(){this.closureEpochToken={},this.items.length=0,this.indexByHopId.clear(),this.closedHopIds.clear(),this.hopStateGeneration&&(this.currentHopStateGeneration===4294967295?(this.hopStateGeneration.fill(0),this.currentHopStateGeneration=1):this.currentHopStateGeneration+=1)}isClosedHop(e,t){return this.isClosedHopId(this.getHopIdFromValues(e,t))}isClosedHopId(e){return this.isHopClosed(e)}queue(e){let t=this.getHopId(e);if(this.isHopClosed(t))return;let n=this.getQueuedHopIndex(t);if(n!==void 0){let r=this.items[n];if(e.g>=r.g)return;return this.items[n]=e,void(e.f<=r.f?this.siftUp(n):this.siftDown(n))}let o=this.items.length;this.items.push(e),this.siftUp(o)}dequeue(){let e=this.items[0];if(!e)return;let t=this.getHopId(e);this.closeHop(t);let n=this.items.pop();return this.items.length>0&&(this.items[0]=n,this.siftDown(0)),e}getHopId(e){if(e.hopId!==void 0)return e.hopId;let t=this.getHopIdFromValues(e.portId,e.nextRegionId);return e.hopId=t,t}getHopIdFromValues(e,t){let n=this.compactHopIndex;if(!n)return e*this.regionCount+t;let o=e*n.hopSlotStride;if(n.firstRegionByPortId[e]===t)return o;if(n.secondRegionByPortId[e]===t)return o+1;let r=n.incidentPortRegion[e];for(let i=2;i<(r?.length??0);i++)if(r[i]===t)return o+i;return-(e*this.regionCount+t)-1}getQueuedHopIndex(e){if(e>=0&&this.hopStateGeneration){if(this.hopStateGeneration[e]!==this.currentHopStateGeneration)return;let t=this.hopIndexOrClosed[e];return t>=0?t:void 0}return this.indexByHopId.get(e)}isHopClosed(e){return e>=0&&this.hopStateGeneration?this.hopStateGeneration[e]===this.currentHopStateGeneration&&this.hopIndexOrClosed[e]===-1:this.closedHopIds.has(e)}setQueuedHopIndex(e,t){if(e>=0&&this.hopStateGeneration)return this.hopStateGeneration[e]=this.currentHopStateGeneration,void(this.hopIndexOrClosed[e]=t);this.indexByHopId.set(e,t)}closeHop(e){if(e>=0&&this.hopStateGeneration)return this.hopStateGeneration[e]=this.currentHopStateGeneration,void(this.hopIndexOrClosed[e]=-1);this.indexByHopId.delete(e),this.closedHopIds.add(e)}siftUp(e){let t=this.items[e],n=e;for(;n>0;){let o=n-1>>1,r=this.items[o];if(r.f<=t.f)break;this.items[n]=r,this.setQueuedHopIndex(this.getHopId(r),n),n=o}this.items[n]=t,this.setQueuedHopIndex(this.getHopId(t),n)}siftDown(e){let t=this.items[e],n=e;for(;;){let o=2*n+1;if(o>=this.items.length)break;let r=o+1,i=r<this.items.length&&this.items[r].f<this.items[o].f?r:o,s=this.items[i];if(t.f<=s.f)break;this.items[n]=s,this.setQueuedHopIndex(this.getHopId(s),n),n=i}this.items[n]=t,this.setQueuedHopIndex(this.getHopId(t),n)}},rbe=(e,t)=>{let n=[...e],o=((r)=>{let i=r>>>0;return()=>{i+=1831565813;let s=i;return s=Math.imul(s^s>>>15,1|s),s^=s+Math.imul(s^s>>>7,61|s),((s^s>>>14)>>>0)/4294967296}})(t);for(let r=n.length-1;r>0;r--){let i=Math.floor(o()*(r+1));[n[r],n[i]]=[n[i],n[r]]}return n},dcn=(e,t)=>e.routeMetadata?.[t],Z3r=(e)=>e?.simpleRouteConnection?.pointsToConnect?.map(({pointId:t})=>typeof t=="string"?t:null).filter((t)=>t!==null)??[],eCr=(e,t)=>{let n=dcn(e,t)?.connectionId;return typeof n=="string"?n:`route-${t}`},tCr=(e,t,n)=>{let o=e.portEndpointNetIds[n];if(!o)return!1;for(let r of o)if(r!==t)return!0;return!1},OYt=(e,t,n)=>{let o=e.regionNetId[n];return o!==-1&&o!==t},nCr=(e)=>[...new Set(e.routeIds)].filter((t)=>!((n,o)=>{let{topology:r,problem:i,problemSetup:s,portAssignment:a,maxPrecheckHops:c}=n,l=i.routeNet[o],h=i.routeStartPort[o],d=i.routeEndPort[o];if(h===d)return!0;let u=n.getStartingNextRegionId(o,h);if(u===void 0)return!1;let _=[{portId:h,nextRegionId:u}],p=new Set([h*r.regionCount+u]);for(let m=0;m<_.length;m++){let A=_[m];if(!OYt(i,l,A.nextRegionId))for(let g of r.regionIncidentPorts[A.nextRegionId]??[]){let f=a[g];if(tCr(s,l,g))continue;if(g===d){if(f!==-1&&f!==l)continue;return!0}if(g===A.portId)continue;if(f!==-1&&f!==l)continue;if(i.portSectionMask[g]===0)continue;let y=r.incidentPortRegion[g]??[],x=y[0]===A.nextRegionId?y[1]:y[0];if(x===void 0||OYt(i,l,x))continue;let C=g*r.regionCount+x;if(!p.has(C)){if(p.size>=c)return!0;p.add(C),_.push({portId:g,nextRegionId:x})}}}return!1})(e,t)).map((t)=>e.getRouteSummary(t)),dXe=(e)=>{let t=Array(e);for(let n=0;n<e;n++)t[n]=n;return t},uXe="rgba(220, 38, 38, 0.98)",VYt="rgba(220, 38, 38, 0.18)",pXe=(...e)=>e.filter((t)=>Boolean(t)).join(`
`),YYt=(e,t)=>{let n=0.005*e.topology.portZ[t];return{x:e.topology.portX[t]+n,y:e.topology.portY[t]+n}},GYt=(e,t)=>d9([e.topology.portZ[t]])??"z0",UYt=(e,t)=>{let n=e.topology.portMetadata?.[t];return`port: ${n?.serializedPortId??n?.portId??`port-${t}`}`},WYt=(e,t)=>`z: ${e.topology.portZ[t]}`,oCr=(e,t)=>((n,o,r)=>{let i=n.topology.portZ[o],s=n.topology.portZ[r];return i===s?`z: ${i}`:`z: ${i} -> ${s}`})(e,e.problem.routeStartPort[t],e.problem.routeEndPort[t]),rCr=(e,t)=>`net: ${e.problem.routeNet[t]}`,ibe=0.05,iCr={r:255,g:64,b:64,a:0.72},B3e="rgba(220, 38, 38, 0.98)",XYt="rgba(220, 38, 38, 0.12)",jYt="10 6",lg=(...e)=>e.filter((t)=>Boolean(t)).join(`
`),ucn=(e)=>Math.min(1,Math.max(0,e)),mXe=(e,t,n)=>Math.round(e+(t-e)*n),pcn=({r:e,g:t,b:n,a:o})=>`rgba(${e}, ${t}, ${n}, ${o})`,zO=(e,t)=>{let n=e.problem.routeMetadata?.[t];return n?.connectionId??n?.mutuallyConnectedNetworkId??`route-${t}`},HKe=(e)=>typeof e.centerRouteId=="number",FKe=(e,t)=>HKe(e)?t===e.centerRouteId?1:0.5:1,KYt=(e,t)=>{let n=e.match(/^(rgba|hsla)\((.*),\s*([0-9]*\.?[0-9]+)\)$/);if(!n)return e;let[,o,r,i]=n,s=ucn(Number(i)*t);return`${o}(${r}, ${Number(s.toFixed(3))})`},wO=(e,t,n=0.8)=>((o,r,i=0.8)=>{let s=`${o.problem.routeNet[r]}:${zO(o,r)}`,a=0;for(let c=0;c<s.length;c++)a=17777*s.charCodeAt(c)+((a<<5)-a);return`hsla(${Math.abs(a)%360}, 70%, 50%, ${i})`})(e,t,n*FKe(e,t)),$Yt=(e,t)=>`net: ${e.problem.routeNet[t]}`,mcn=(e,t)=>{let n=e.topology.regionMetadata?.[t],o=n?.polygon;if(Array.isArray(o)&&o.length>=3){let l=o.map((d)=>d.x),h=o.map((d)=>d.y);return{minX:Math.min(...l),maxX:Math.max(...l),minY:Math.min(...h),maxY:Math.max(...h)}}let r=n?.bounds;if(r&&typeof r.minX=="number"&&typeof r.maxX=="number"&&typeof r.minY=="number"&&typeof r.maxY=="number")return r;let i=e.topology.regionWidth[t],s=e.topology.regionHeight[t],a=e.topology.regionCenterX[t],c=e.topology.regionCenterY[t];return{minX:a-i/2,maxX:a+i/2,minY:c-s/2,maxY:c+s/2}},_cn=(e,t)=>({x:e.topology.regionCenterX[t],y:e.topology.regionCenterY[t]}),gcn=(e,t)=>{let n=e.topology.regionMetadata?.[t],o=Array.isArray(n?.availableZ)?n.availableZ.filter((s)=>typeof s=="number"&&Number.isInteger(s)&&s>=0):[];if(o.length>0)return d9(o)??"z0";let r=aZe(e.topology.regionAvailableZMask?.[t]??0);if(r.length>0)return d9(r)??"z0";let i=[...new Set((e.topology.regionIncidentPorts[t]??[]).map((s)=>e.topology.portZ[s]))].sort((s,a)=>s-a);return d9(i)??"z0"},Acn=(e,t)=>{let n=e.state.regionIntersectionCaches[t],o=n?.existingRegionCost??0,r=e.state.regionCongestionCost[t]??0,i=e.problem.regionNetId[t];return lg(`region: region-${t}`,`net: ${i===-1?"free":`${i}`}`,e.getAdditionalRegionLabel(t),`cost: ${o.toFixed(3)}`,`congestion: ${r.toFixed(3)}`,`same layer X: ${n?.existingSameLayerIntersections??0}`,`trans X: ${n?.existingCrossingLayerIntersections??0}`,`entry exit X: ${n?.existingEntryExitLayerChanges??0}`)},fcn=(e,t)=>{let n=e.topology.regionMetadata?.[t];return n?.isConnectionRegion?{r:255,g:100,b:255,a:0.6}:n?.isThroughJumper?{r:100,g:200,b:100,a:0.5}:n?.isPad?{r:255,g:200,b:100,a:0.5}:n?.layer==="bottom"?{r:52,g:152,b:219,a:0.08}:{r:200,g:200,b:255,a:0.1}},sCr=(e,t)=>{let n=fcn(e,t),o=ucn(e.state.regionIntersectionCaches[t]?.existingRegionCost??0);return pcn((i=iCr,s=o**0.8,{r:mXe((r=n).r,i.r,s),g:mXe(r.g,i.g,s),b:mXe(r.b,i.b,s),a:Number((r.a+(i.a-r.a)*s).toFixed(3))}));var r,i,s},cb=(e,t)=>{let n=((r,i)=>({x:r.topology.portX[i],y:r.topology.portY[i]}))(e,t),o=0.005*e.topology.portZ[t];return{x:n.x+o,y:n.y+o}},cce=cb,Dx=(e,t)=>d9([e.topology.portZ[t]])??"z0",v$=(e,t)=>{let n=e.topology.portMetadata?.[t];return`port: ${n?.serializedPortId??n?.portId??`port-${t}`}`},ycn=(e,t,n)=>{if(n!==void 0)return`net: ${e.problem.routeNet[n]}`;let o=e.state.portAssignment[t];if(o>=0)return`net: ${o}`;let r=new Set;for(let i=0;i<e.problem.routeCount;i++)e.problem.routeStartPort[i]!==t&&e.problem.routeEndPort[i]!==t||r.add(e.problem.routeNet[i]);return r.size!==0?`net: ${Array.from(r).sort((i,s)=>i-s).join(", ")}`:void 0},lw=(e,t)=>`z: ${e.topology.portZ[t]}`,xcn=(e,t,n)=>{let o=e.topology.portZ[t],r=e.topology.portZ[n];return o===r?`z: ${o}`:`z: ${o} -> ${r}`},_Xe=(e,t)=>xcn(e,e.problem.routeStartPort[t],e.problem.routeEndPort[t]),uCe=(e,t,n)=>lg(v$(e,t),((o,r)=>{let i=o.topology.incidentPortRegion[r]?.[0],s=o.topology.incidentPortRegion[r]?.[1];return`connects: region-${i??"?"} <-> region-${s??"?"}`})(e,t),ycn(e,t,n)),aCr=(e,t,n,o)=>{let r=e.topology.portZ[n];return r!==e.topology.portZ[o]?{strokeColor:KYt("rgba(22, 160, 133, 0.95)",FKe(e,t)),strokeDash:"2 4 2"}:r>0?{strokeColor:KYt("rgba(52, 152, 219, 0.95)",FKe(e,t)),strokeDash:"3 2"}:{strokeColor:wO(e,t)}},qYt=(e,t)=>{for(let n=0;n<e.state.regionSegments.length;n++){let o=e.state.regionSegments[n]??[];for(let[r,i,s]of o)t.lines.push({points:[cb(e,i),cb(e,s)],label:lg(`route: ${zO(e,r)}`,`region: region-${n}`,xcn(e,i,s)),layer:Dx(e,i),...aCr(e,r,i,s)})}},JYt=(e,t)=>{let n=new Set;for(let o=0;o<e.state.regionSegments.length;o++){let r=e.state.regionSegments[o]??[];for(let[i,s,a]of r)for(let c of[s,a]){let l=`${i}:${c}`;if(n.has(l))continue;n.add(l);let h=cb(e,c);t.points.push({x:h.x,y:h.y,color:wO(e,i,1),layer:Dx(e,c),label:lg(`route: ${zO(e,i)}`,v$(e,c),ycn(e,c,i),lw(e,c))})}}},cCr=(e,t)=>{for(let n=0;n<e.problem.routeCount;n++)if(e.problem.routeStartPort[n]===t||e.problem.routeEndPort[n]===t)return!0;return!1},lCr=(e,t,n)=>{let o=((s,a)=>{let c=new Set;for(let l=0;l<a.length;l++)if(a[l]===1)for(let h of s.topology.incidentPortRegion[l]??[])c.add(h);return c})(e,n);for(let s of o){let a=e.topology.regionMetadata?.[s],c=a?.polygon,l=mcn(e,s),h=_cn(e,s),d=l.maxX-l.minX,u=l.maxY-l.minY,_=gcn(e,s),p=lg("section region",Acn(e,s));Array.isArray(c)&&c.length>=3?t.polygons.push({points:c,fill:"rgba(245, 158, 11, 0.08)",stroke:"rgba(245, 158, 11, 0.95)",strokeWidth:2,layer:_,label:p}):t.rects.push({center:h,width:Math.max(d-ibe,0.05),height:Math.max(u-ibe,0.05),fill:"rgba(245, 158, 11, 0.08)",stroke:"rgba(245, 158, 11, 0.95)",layer:_,label:p})}for(let s=0;s<n.length;s++)n[s]===1&&t.circles.push({center:cce(e,s),radius:0.07,fill:"rgba(251, 191, 36, 0.18)",stroke:"rgba(245, 158, 11, 0.95)",layer:Dx(e,s),label:lg(uCe(e,s),lw(e,s),"section port")})},sbe=(e,t={})=>{let n={arrows:[],circles:[],infiniteLines:[],lines:[],points:[],polygons:[],rects:[],texts:[],title:"Tiny HyperGraph",coordinateSystem:"cartesian"},o=((a,c)=>{if(!c?.highlightSectionMask)return;let l=c.sectionPortMask??a.problem.portSectionMask;if(l.length!==a.topology.portCount)return;let h=0,d=0;for(let u=0;u<l.length;u++)l[u]===1?h+=1:d+=1;return h!==0&&d!==0?l:void 0})(e,t),r=((a)=>{let c=a.getStaticallyUnroutableRoutes();if(c.length!==0)return new Set(c.map((l)=>l.routeId))})(e);for(let a=0;a<e.topology.regionCount;a++){let c=e.topology.regionMetadata?.[a],l=c?.polygon,h=mcn(e,a),d=_cn(e,a),u=h.maxX-h.minX,_=h.maxY-h.minY,p=gcn(e,a),m=pcn(fcn(e,a));Array.isArray(l)&&l.length>=3?n.polygons.push({points:l,fill:m,layer:p}):n.rects.push({center:d,width:Math.max(u-ibe,0.05),height:Math.max(_-ibe,0.05),fill:sCr(e,a),layer:p,label:Acn(e,a)})}if(((a,c,l)=>{for(let h=0;h<a.problem.routeCount;h++){if(l&&!l.has(h))continue;let d=a.problem.routeStartPort[h],u=a.problem.routeEndPort[h],_=cb(a,d),p=cb(a,u),m=wO(a,h),A=zO(a,h),g=$Yt(a,h);c.points.push({x:_.x,y:_.y,color:m,layer:Dx(a,d),label:lg(`route: ${A}`,g,"endpoint: start",v$(a,d),lw(a,d))}),c.points.push({x:p.x,y:p.y,color:m,layer:Dx(a,u),label:lg(`route: ${A}`,g,"endpoint: end",v$(a,u),lw(a,u))})}})(e,n,r),e.iterations===0){for(let a of n.polygons)a.stroke="rgba(128, 128, 128, 0.5)";for(let a of n.rects)a.stroke="rgba(128, 128, 128, 0.5)"}if(e.iterations===0){for(let a=0;a<e.topology.portCount;a++){let c=o?.[a]===1;t.showOnlySectionPortsOnIdle&&!c||n.circles.push({center:cce(e,a),radius:0.05,fill:e.topology.portZ[a]>0?"rgba(52, 152, 219, 0.55)":"rgba(128, 128, 128, 0.5)",layer:Dx(e,a),label:lg(uCe(e,a),lw(e,a))})}if(r)((a,c)=>{for(let l of a.getStaticallyUnroutableRoutes()){let{routeId:h,connectionId:d,startPortId:u,endPortId:_}=l,p=YYt(a,u),m=YYt(a,_),A=pXe(`static reachability failed: ${d}`,rCr(a,h),l.startRegionId?`startRegionId: ${l.startRegionId}`:void 0,l.endRegionId?`endRegionId: ${l.endRegionId}`:void 0,l.pointIds.length>=2?`points: ${l.pointIds.join(" -> ")}`:void 0,oCr(a,h));c.lines.push({points:[p,m],strokeColor:uXe,strokeDash:"8 4",label:A}),c.circles.push({center:p,radius:0.12,fill:VYt,stroke:uXe,layer:GYt(a,u),label:pXe(A,"endpoint: start",UYt(a,u),WYt(a,u))}),c.circles.push({center:m,radius:0.12,fill:VYt,stroke:uXe,layer:GYt(a,_),label:pXe(A,"endpoint: end",UYt(a,_),WYt(a,_))})}})(e,n);else{let a=new Set;for(let c of e.state.regionSegments)for(let[l]of c)a.add(l);if(a.size>0&&(qYt(e,n),JYt(e,n)),t.showInitialRouteHints!==!1){let c=new Set(e.state.unroutedRoutes);e.state.currentRouteId!==void 0&&c.add(e.state.currentRouteId),((l,h,d)=>{for(let u=0;u<l.problem.routeCount;u++){if(d&&!d.has(u))continue;let _=l.problem.routeStartPort[u],p=l.problem.routeEndPort[u],m=cb(l,_),A=cb(l,p),g={x:(m.x+A.x)/2,y:(m.y+A.y)/2};h.lines.push({points:[m,A],strokeColor:wO(l,u),strokeDash:"3 3",layer:Dx(l,_),label:lg(zO(l,u),_Xe(l,u))}),h.points.push({x:g.x,y:g.y,color:wO(l,u,1),layer:Dx(l,_),label:lg(zO(l,u),_Xe(l,u))})}})(e,n,c)}}}else qYt(e,n),JYt(e,n),((a)=>HKe(a)&&a.showUnassignedPortsInVisualization===!0)(e)&&((a,c)=>{for(let l=0;l<a.topology.portCount;l++)a.state.portAssignment[l]>=0||cCr(a,l)||c.circles.push({center:cce(a,l),radius:0.04,fill:a.topology.portZ[l]>0?"rgba(52, 152, 219, 0.2)":"rgba(128, 128, 128, 0.2)",stroke:a.topology.portZ[l]>0?"rgba(52, 152, 219, 0.6)":"rgba(128, 128, 128, 0.6)",layer:Dx(a,l),label:lg(uCe(a,l),lw(a,l),"state: unassigned")})})(e,n),HKe(e)||(((a,c)=>{let l=a.state.currentRouteId;if(l===void 0||a.solved)return;let h=a.problem.routeStartPort[l],d=a.problem.routeEndPort[l],u=cb(a,h),_=cb(a,d),p=wO(a,l),m=zO(a,l);c.lines.push({points:[u,_],strokeColor:p,strokeDash:"10 5",label:lg(m,_Xe(a,l))})})(e,n),((a,c)=>{if(a.solved)return;let l=a.state.currentRouteId,h=a.state.candidateQueue.toArray().sort((p,m)=>p.f-m.f).slice(0,10);for(let p=0;p<h.length;p++){let m=h[p],A=cb(a,m.portId),g=p===0;c.points.push({x:A.x,y:A.y,color:g?"green":"rgba(128, 128, 128, 0.25)",layer:Dx(a,m.portId),label:lg(uCe(a,m.portId,l),lw(a,m.portId),`g: ${m.g.toFixed(2)}`,`h: ${m.h.toFixed(2)}`,`f: ${m.f.toFixed(2)}`)})}let d=h[0];if(!d)return;let u=[],_=d;for(;_;)u.unshift(cb(a,_.portId)),_=_.prevCandidate;u.length>1&&c.lines.push({points:u,strokeColor:l!==void 0?wO(a,l):"rgba(0, 160, 120, 0.9)"})})(e,n));o&&lCr(e,n,o),((a,c)=>{if(a.failed)for(let l of a.getNeverSuccessfullyRoutedRoutes()){let{routeId:h,connectionId:d,attempts:u,startPortId:_,endPortId:p}=l,m=$Yt(a,h),A=cce(a,_),g=cce(a,p),f=lg(`never routed: ${d}`,`attempts: ${u}`,m,l.startRegionId?`startRegionId: ${l.startRegionId}`:void 0,l.endRegionId?`endRegionId: ${l.endRegionId}`:void 0);c.lines.push({points:[{x:0,y:0},{x:A.x,y:A.y}],strokeColor:B3e,strokeDash:jYt,layer:Dx(a,_),label:lg(f,"origin guide","endpoint: start")}),c.circles.push({center:A,radius:1,fill:XYt,stroke:B3e,layer:Dx(a,_),label:lg(f,"endpoint: start",v$(a,_),lw(a,_))}),c.lines.push({points:[{x:0,y:0},{x:g.x,y:g.y}],strokeColor:B3e,strokeDash:jYt,layer:Dx(a,p),label:lg(f,"origin guide","endpoint: end")}),c.circles.push({center:g,radius:1,fill:XYt,stroke:B3e,layer:Dx(a,p),label:lg(f,"endpoint: end",v$(a,p),lw(a,p))})}})(e,n);let i=e.state.unroutedRoutes.length+(e.state.currentRouteId===void 0?0:1),s=o?o.reduce((a,c)=>a+Number(c===1),0):0;return n.title=["Tiny HyperGraph",`iter=${e.iterations}`,`pending=${i}`,o?`sectionPorts=${s}`:void 0,r?`staticReachabilityFailed=${r.size}`:void 0,e.failed?"failed":e.solved?"solved":"running"].filter(Boolean).join(" | "),n},O$=()=>({netIds:new Int32Array(0),lesserAngles:new Int32Array(0),greaterAngles:new Int32Array(0),layerMasks:new Int32Array(0),existingCrossingLayerIntersections:0,existingSameLayerIntersections:0,existingEntryExitLayerChanges:0,existingRegionCost:0,existingSegmentCount:0}),hCr=(e)=>({netIds:new Int32Array(e.netIds),lesserAngles:new Int32Array(e.lesserAngles),greaterAngles:new Int32Array(e.greaterAngles),layerMasks:new Int32Array(e.layerMasks),existingCrossingLayerIntersections:e.existingCrossingLayerIntersections,existingSameLayerIntersections:e.existingSameLayerIntersections,existingEntryExitLayerChanges:e.existingEntryExitLayerChanges,existingRegionCost:e.existingRegionCost,existingSegmentCount:e.existingSegmentCount}),wae=(e)=>{return{portAssignment:new Int32Array(e.portAssignment),regionSegments:(t=e.regionSegments,t.map((n)=>n.map(([o,r,i])=>[o,r,i]))),regionIntersectionCaches:e.regionIntersectionCaches.map(hCr),regionCongestionCost:new Float64Array(e.regionCongestionCost),ripCount:e.ripCount};var t},Ccn=(e,t)=>{t&&(t.minViaPadDiameter!==void 0&&(e.minViaPadDiameter=t.minViaPadDiameter),t.DISTANCE_TO_COST!==void 0&&(e.DISTANCE_TO_COST=t.DISTANCE_TO_COST),t.RIP_THRESHOLD_START!==void 0&&(e.RIP_THRESHOLD_START=t.RIP_THRESHOLD_START),t.RIP_THRESHOLD_END!==void 0&&(e.RIP_THRESHOLD_END=t.RIP_THRESHOLD_END),t.RIP_THRESHOLD_RAMP_ATTEMPTS!==void 0&&(e.RIP_THRESHOLD_RAMP_ATTEMPTS=t.RIP_THRESHOLD_RAMP_ATTEMPTS),t.RIP_CONGESTION_REGION_COST_FACTOR!==void 0&&(e.RIP_CONGESTION_REGION_COST_FACTOR=t.RIP_CONGESTION_REGION_COST_FACTOR),t.TRACE_DENSITY_COST_FACTOR!==void 0&&(e.TRACE_DENSITY_COST_FACTOR=Math.max(0,t.TRACE_DENSITY_COST_FACTOR)),t.USE_LAZY_ROUTE_HEURISTIC!==void 0&&(e.USE_LAZY_ROUTE_HEURISTIC=t.USE_LAZY_ROUTE_HEURISTIC),t.USE_SPARSE_CANDIDATE_STORAGE!==void 0&&(e.USE_SPARSE_CANDIDATE_STORAGE=t.USE_SPARSE_CANDIDATE_STORAGE),t.OWNED_REGIONAL_HOP_FRONTIER!==void 0&&(e.OWNED_REGIONAL_HOP_FRONTIER=t.OWNED_REGIONAL_HOP_FRONTIER),t.MAX_ITERATIONS!==void 0&&(e.MAX_ITERATIONS=t.MAX_ITERATIONS),t.VERBOSE!==void 0&&(e.VERBOSE=t.VERBOSE),t.STATIC_REACHABILITY_PRECHECK!==void 0&&(e.STATIC_REACHABILITY_PRECHECK=t.STATIC_REACHABILITY_PRECHECK),t.STATIC_REACHABILITY_PRECHECK_MAX_HOPS!==void 0&&(e.STATIC_REACHABILITY_PRECHECK_MAX_HOPS=t.STATIC_REACHABILITY_PRECHECK_MAX_HOPS),t.ACCEPT_BEST_SOLUTION_ON_TIMEOUT!==void 0&&(e.ACCEPT_BEST_SOLUTION_ON_TIMEOUT=t.ACCEPT_BEST_SOLUTION_ON_TIMEOUT),t.GREEDY_FINAL_ROUTE_ITERS!==void 0&&(e.GREEDY_FINAL_ROUTE_ITERS=t.GREEDY_FINAL_ROUTE_ITERS),t.PARTIAL_RIP_ENABLED!==void 0&&(e.PARTIAL_RIP_ENABLED=t.PARTIAL_RIP_ENABLED),t.PARTIAL_RIP_MIN_ROUTE_COUNT!==void 0&&(e.PARTIAL_RIP_MIN_ROUTE_COUNT=t.PARTIAL_RIP_MIN_ROUTE_COUNT),t.PARTIAL_RIP_MAX_ROUTE_COUNT!==void 0&&(e.PARTIAL_RIP_MAX_ROUTE_COUNT=t.PARTIAL_RIP_MAX_ROUTE_COUNT),t.PARTIAL_RIP_MAX_DISTANCE!==void 0&&(e.PARTIAL_RIP_MAX_DISTANCE=t.PARTIAL_RIP_MAX_DISTANCE),t.PARTIAL_RIP_QUALITY_MAX_DISTANCE!==void 0&&(e.PARTIAL_RIP_QUALITY_MAX_DISTANCE=t.PARTIAL_RIP_QUALITY_MAX_DISTANCE),t.PARTIAL_RIP_MAX_ATTEMPTS!==void 0&&(e.PARTIAL_RIP_MAX_ATTEMPTS=t.PARTIAL_RIP_MAX_ATTEMPTS),t.PARTIAL_RIP_WARMUP_FULL_RIP_ATTEMPTS!==void 0&&(e.PARTIAL_RIP_WARMUP_FULL_RIP_ATTEMPTS=t.PARTIAL_RIP_WARMUP_FULL_RIP_ATTEMPTS),t.PARTIAL_RIP_COMPLEXITY_SELECTION_MIN_ROUTE_COUNT!==void 0&&(e.PARTIAL_RIP_COMPLEXITY_SELECTION_MIN_ROUTE_COUNT=t.PARTIAL_RIP_COMPLEXITY_SELECTION_MIN_ROUTE_COUNT),t.PARTIAL_RIP_TARGET_MAX_COST_IMPROVEMENT_RATIO!==void 0&&(e.PARTIAL_RIP_TARGET_MAX_COST_IMPROVEMENT_RATIO=t.PARTIAL_RIP_TARGET_MAX_COST_IMPROVEMENT_RATIO),t.PARTIAL_RIP_MAX_REGION_COST_GROWTH_RATIO!==void 0&&(e.PARTIAL_RIP_MAX_REGION_COST_GROWTH_RATIO=t.PARTIAL_RIP_MAX_REGION_COST_GROWTH_RATIO),t.PARTIAL_RIP_MAX_TOTAL_COST_GROWTH_RATIO!==void 0&&(e.PARTIAL_RIP_MAX_TOTAL_COST_GROWTH_RATIO=t.PARTIAL_RIP_MAX_TOTAL_COST_GROWTH_RATIO),t.OUTSIDE_IN_ROUTING!==void 0&&(e.OUTSIDE_IN_ROUTING=t.OUTSIDE_IN_ROUTING),t.OUTSIDE_IN_MAX_DISTANCE!==void 0&&(e.OUTSIDE_IN_MAX_DISTANCE=t.OUTSIDE_IN_MAX_DISTANCE))},pCe=(e)=>({minViaPadDiameter:e.minViaPadDiameter,DISTANCE_TO_COST:e.DISTANCE_TO_COST,RIP_THRESHOLD_START:e.RIP_THRESHOLD_START,RIP_THRESHOLD_END:e.RIP_THRESHOLD_END,RIP_THRESHOLD_RAMP_ATTEMPTS:e.RIP_THRESHOLD_RAMP_ATTEMPTS,RIP_CONGESTION_REGION_COST_FACTOR:e.RIP_CONGESTION_REGION_COST_FACTOR,TRACE_DENSITY_COST_FACTOR:e.TRACE_DENSITY_COST_FACTOR,USE_LAZY_ROUTE_HEURISTIC:e.USE_LAZY_ROUTE_HEURISTIC,USE_SPARSE_CANDIDATE_STORAGE:e.USE_SPARSE_CANDIDATE_STORAGE,OWNED_REGIONAL_HOP_FRONTIER:e.OWNED_REGIONAL_HOP_FRONTIER,MAX_ITERATIONS:e.MAX_ITERATIONS,VERBOSE:e.VERBOSE,STATIC_REACHABILITY_PRECHECK:e.STATIC_REACHABILITY_PRECHECK,STATIC_REACHABILITY_PRECHECK_MAX_HOPS:e.STATIC_REACHABILITY_PRECHECK_MAX_HOPS,ACCEPT_BEST_SOLUTION_ON_TIMEOUT:e.ACCEPT_BEST_SOLUTION_ON_TIMEOUT,GREEDY_FINAL_ROUTE_ITERS:e.GREEDY_FINAL_ROUTE_ITERS,PARTIAL_RIP_ENABLED:e.PARTIAL_RIP_ENABLED,PARTIAL_RIP_MIN_ROUTE_COUNT:e.PARTIAL_RIP_MIN_ROUTE_COUNT,PARTIAL_RIP_MAX_ROUTE_COUNT:e.PARTIAL_RIP_MAX_ROUTE_COUNT,PARTIAL_RIP_MAX_DISTANCE:e.PARTIAL_RIP_MAX_DISTANCE,PARTIAL_RIP_QUALITY_MAX_DISTANCE:e.PARTIAL_RIP_QUALITY_MAX_DISTANCE,PARTIAL_RIP_MAX_ATTEMPTS:e.PARTIAL_RIP_MAX_ATTEMPTS,PARTIAL_RIP_WARMUP_FULL_RIP_ATTEMPTS:e.PARTIAL_RIP_WARMUP_FULL_RIP_ATTEMPTS,PARTIAL_RIP_COMPLEXITY_SELECTION_MIN_ROUTE_COUNT:e.PARTIAL_RIP_COMPLEXITY_SELECTION_MIN_ROUTE_COUNT,PARTIAL_RIP_TARGET_MAX_COST_IMPROVEMENT_RATIO:e.PARTIAL_RIP_TARGET_MAX_COST_IMPROVEMENT_RATIO,PARTIAL_RIP_MAX_REGION_COST_GROWTH_RATIO:e.PARTIAL_RIP_MAX_REGION_COST_GROWTH_RATIO,PARTIAL_RIP_MAX_TOTAL_COST_GROWTH_RATIO:e.PARTIAL_RIP_MAX_TOTAL_COST_GROWTH_RATIO,OUTSIDE_IN_ROUTING:e.OUTSIDE_IN_ROUTING,OUTSIDE_IN_MAX_DISTANCE:e.OUTSIDE_IN_MAX_DISTANCE}),dCr=(e,t)=>e.f-t.f,bQ=class e extends fa{constructor(t,n,o){super(),this.topology=t,this.problem=n,Ccn(this,o);let r=1,i=new Int32Array(t.portCount).fill(-1),s=new Int32Array(t.portCount).fill(-1);for(let l=0;l<t.portCount;l++){let h=t.incidentPortRegion[l]??[];h.length>r&&(r=h.length),i[l]=h[0]??-1,s[l]=h[1]??-1}this.candidateHopSlotStride=r,this.candidateFirstRegionByPortId=i,this.candidateSecondRegionByPortId=s,this.hCostByPortId=new Float64Array(t.portCount),this.hCostRouteIdByPortId=new Int32Array(t.portCount).fill(-1);let a=t.portCount*r;this.candidateHopCapacity=a,this.state={portAssignment:new Int32Array(t.portCount).fill(-1),regionSegments:Array.from({length:t.regionCount},()=>[]),regionIntersectionCaches:Array.from({length:t.regionCount},()=>O$()),currentRouteId:void 0,currentRouteNetId:void 0,unroutedRoutes:dXe(n.routeCount),candidateQueue:new lcn([],dCr),candidateBestCostByHopId:this.USE_SPARSE_CANDIDATE_STORAGE?new Map:new Float64Array(a),candidateBestCostGenerationByHopId:this.USE_SPARSE_CANDIDATE_STORAGE?new Map:new Uint32Array(a),candidateBestCostGeneration:1,goalPortId:-1,ripCount:0,regionCongestionCost:new Float64Array(t.regionCount).fill(0)},this.routeAttemptCountByRouteId=new Uint32Array(n.routeCount),this.routeSuccessCountByRouteId=new Uint32Array(n.routeCount);let c=LKe({topology:t,problem:n,state:this.state,routeSuccessCountByRouteId:this.routeSuccessCountByRouteId,appendSegmentToRegionCache:(l,h,d)=>this.appendSegmentToRegionCache(l,h,d)});c&&(this.stats={...this.stats,...c})}topology;problem;state;candidateHopSlotStride;candidateHopCapacity;candidateFirstRegionByPortId;candidateSecondRegionByPortId;candidateOverflowBestCost;regionalHopFrontierQueue;regionalHopFrontierEpoch;regionalHopFrontierGoalPortId;regionalHopFrontierRouteId;regionalHopFrontierNetId;regionalHopFrontiers=new Map;_problemSetup;hCostByPortId;hCostRouteIdByPortId;hCostEndRouteId;hCostEndX=0;hCostEndY=0;routeAttemptCountByRouteId;routeSuccessCountByRouteId;bestSolvedStateSnapshot;bestSolvedStateSummary;hasLoggedNeverSuccessfullyRoutedRoutes=!1;staticallyUnroutableRoutes=[];segmentGeometryScratch={netId:0,lesserAngle:0,greaterAngle:0,layerMask:0,entryExitLayerChanges:0,sameLayerIntersectionCount:0,crossingLayerIntersectionCount:0};ADD_SEGMENT_DISTANCE_TO_G=!1;costAwareFinalReripBudget=0;DISTANCE_TO_COST=0.05;minViaPadDiameter=acn;RIP_THRESHOLD_START=0.05;RIP_THRESHOLD_END=0.8;RIP_THRESHOLD_RAMP_ATTEMPTS=50;RIP_CONGESTION_REGION_COST_FACTOR=0.1;TRACE_DENSITY_COST_FACTOR=0;USE_LAZY_ROUTE_HEURISTIC=!0;USE_SPARSE_CANDIDATE_STORAGE=!1;OWNED_REGIONAL_HOP_FRONTIER=!1;MAX_ITERATIONS=1e6;VERBOSE=!1;STATIC_REACHABILITY_PRECHECK=!0;STATIC_REACHABILITY_PRECHECK_MAX_HOPS=16;ACCEPT_BEST_SOLUTION_ON_TIMEOUT=!0;GREEDY_FINAL_ROUTE_ITERS=4;PARTIAL_RIP_ENABLED=!1;PARTIAL_RIP_MIN_ROUTE_COUNT=0;PARTIAL_RIP_MAX_ROUTE_COUNT=Number.POSITIVE_INFINITY;PARTIAL_RIP_MAX_DISTANCE=12;PARTIAL_RIP_QUALITY_MAX_DISTANCE;PARTIAL_RIP_MAX_ATTEMPTS=Number.POSITIVE_INFINITY;PARTIAL_RIP_WARMUP_FULL_RIP_ATTEMPTS=0;PARTIAL_RIP_COMPLEXITY_SELECTION_MIN_ROUTE_COUNT=Number.POSITIVE_INFINITY;PARTIAL_RIP_TARGET_MAX_COST_IMPROVEMENT_RATIO=0;PARTIAL_RIP_MAX_REGION_COST_GROWTH_RATIO=0.2;PARTIAL_RIP_MAX_TOTAL_COST_GROWTH_RATIO=0.1;OUTSIDE_IN_ROUTING=!1;OUTSIDE_IN_MAX_DISTANCE=24;resetForProblem(t){if(this.constructor!==e)throw Error("TinyHyperGraphSolver.resetForProblem cannot reset subclass routing state");this.problem=t,this._problemSetup=void 0,this.hCostEndRouteId=void 0,this.hCostRouteIdByPortId.fill(-1),this.state.portAssignment.fill(-1);for(let o of this.state.regionSegments)o.length=0;this.state.regionIntersectionCaches.fill(O$()),this.state.currentRouteId=void 0,this.state.currentRouteNetId=void 0,this.state.unroutedRoutes=dXe(t.routeCount),this.state.candidateQueue.clear(),this.state.candidateBestCostGeneration=1,this.state.candidateBestCostByHopId instanceof Map?this.state.candidateBestCostByHopId.clear():this.state.candidateBestCostByHopId.fill(0),this.state.candidateBestCostGenerationByHopId instanceof Map?this.state.candidateBestCostGenerationByHopId.clear():this.state.candidateBestCostGenerationByHopId.fill(0),this.state.goalPortId=-1,this.state.ripCount=0,this.state.regionCongestionCost.fill(0),this.routeAttemptCountByRouteId=new Uint32Array(t.routeCount),this.routeSuccessCountByRouteId=new Uint32Array(t.routeCount),this.bestSolvedStateSnapshot=void 0,this.bestSolvedStateSummary=void 0,this.hasLoggedNeverSuccessfullyRoutedRoutes=!1,this.staticallyUnroutableRoutes=[],this.candidateOverflowBestCost?.clear(),this.solved=!1,this.failed=!1,this.iterations=0,this.progress=0,this.error=null,this.activeSubSolver=void 0,this.failedSubSolvers=void 0,this.timeToSolve=void 0,this.stats={},this._setupDone=!1;let n=LKe({topology:this.topology,problem:t,state:this.state,routeSuccessCountByRouteId:this.routeSuccessCountByRouteId,appendSegmentToRegionCache:(o,r,i)=>this.appendSegmentToRegionCache(o,r,i)});n&&(this.stats={...this.stats,...n})}get problemSetup(){return this._problemSetup||(this._problemSetup=this.computeProblemSetup()),this._problemSetup}computeProblemSetup(){let{topology:t,problem:n}=this,o=this.USE_LAZY_ROUTE_HEURISTIC?void 0:new Float64Array(t.portCount*n.routeCount),{portX:r,portY:i}=t,s=[],a=new Int32Array(t.portCount).fill(-1),c=(l,h)=>{let d=s[l]??new Set;d.add(h),s[l]=d;let u=a[l];u===-1?a[l]=h:u!==h&&(a[l]=-2)};for(let l=0;l<n.routeCount;l++){let h=n.routeNet[l];if(c(n.routeStartPort[l],h),c(n.routeEndPort[l],h),o){let d=n.routeEndPort[l],u=r[d],_=i[d];for(let p=0;p<t.portCount;p++){let m=r[p]-u,A=i[p]-_;o[p*n.routeCount+l]=Math.sqrt(m*m+A*A)*this.DISTANCE_TO_COST}}}return{...o?{portHCostToEndOfRoute:o}:{},portEndpointNetIds:s,portEndpointReservationNetId:a}}_setup(){if(this.problemSetup,this.STATIC_REACHABILITY_PRECHECK){let t=nCr({topology:this.topology,problem:this.problem,problemSetup:this.problemSetup,portAssignment:this.state.portAssignment,routeIds:this.state.unroutedRoutes,maxPrecheckHops:Math.max(0,this.STATIC_REACHABILITY_PRECHECK_MAX_HOPS),getStartingNextRegionId:(n,o)=>this.getStartingNextRegionId(n,o),getRouteSummary:(n)=>this.getRouteSummary(n)});this.staticallyUnroutableRoutes=t,t.length>0&&(this.failed=!0,this.error=((n)=>{let o=n.slice(0,5).map((i)=>{let s=i.pointIds.length>=2?`${i.pointIds[0]}->${i.pointIds[1]}`:`${i.startPortId}->${i.endPortId}`;return`${i.connectionId} (${s})`}).join(", "),r=n.length-5;return["Static reachability precheck failed:",`${n.length} route(s) have no legal path under the current reservation and start-region rules`,r>0?`${o}, +${r} more`:o].join(" ")})(t),this.stats={...this.stats,staticallyUnroutableRouteCount:t.length})}}_step(){let{problem:t,topology:n,state:o}=this;if(o.currentRouteId===void 0){if(o.unroutedRoutes.length===0)return void this.onAllRoutesRouted();o.currentRouteId=o.unroutedRoutes.shift(),o.currentRouteNetId=t.routeNet[o.currentRouteId],this.routeAttemptCountByRouteId[o.currentRouteId]+=1,this.resetCandidateBestCosts();let a=this.getRouteStartPortId(o.currentRouteId);o.candidateQueue.clear();let c=this.getStartingNextRegionId(o.currentRouteId,a);if(c===void 0)return this.failed=!0,void(this.error=`Start port ${a} has no incident regions`);let l=this.getHopId(a,c);this.setCandidateBestCost(l,0),o.candidateQueue.queue({hopId:l,nextRegionId:c,portId:a,f:0,g:0,h:0}),o.goalPortId=this.getRouteEndPortId(o.currentRouteId)}let r=o.candidateQueue.dequeue();if(!r)return void this.onOutOfCandidates();let i=r.hopId??this.getHopId(r.portId,r.nextRegionId);if(r.g>this.getCandidateBestCost(i))return;if(this.isRegionReservedForDifferentNet(r.nextRegionId))return;let s=n.regionIncidentPorts[r.nextRegionId];if(this.OWNED_REGIONAL_HOP_FRONTIER){let a=this.getRegionalHopFrontier(r.nextRegionId,s);if(a)return void this.expandRegionalHopFrontier(r,a)}for(let a of s){if(a===o.goalPortId){let g=o.portAssignment[a];if(this.isPortReservedForDifferentNet(a))continue;if(g!==-1&&g!==o.currentRouteNetId)continue;return void this.onPathFound(r)}if(a===r.portId)continue;if(t.portSectionMask[a]===0)continue;let c=n.incidentPortRegion[a][0]===r.nextRegionId?n.incidentPortRegion[a][1]:n.incidentPortRegion[a][0];if(c===void 0)continue;let l=this.getHopId(a,c);if((o.candidateQueue.isClosedHopId?o.candidateQueue.isClosedHopId(l):o.candidateQueue.isClosedHop?.(a,c))===!0)continue;let h=o.portAssignment[a];if(this.isPortReservedForDifferentNet(a))continue;if(h!==-1&&h!==o.currentRouteNetId)continue;if(this.isRegionReservedForDifferentNet(c))continue;let d=this.getCandidateBestCost(l);if(r.g>=d)continue;let u,_=r.g+o.regionCongestionCost[r.nextRegionId]+(t.portPenalty?.[a]??0);if(this.ADD_SEGMENT_DISTANCE_TO_G){let g=n.portX[r.portId]-n.portX[a],f=n.portY[r.portId]-n.portY[a];u=Math.sqrt(g*g+f*f),_+=u*this.DISTANCE_TO_COST}if(_>=d)continue;let p=this.computeG(r,a,d,u);if(!Number.isFinite(p)||p>=d)continue;let m=this.computeH(a),A={hopId:l,prevRegionId:r.nextRegionId,nextRegionId:c,portId:a,g:p,h:m,f:p+m,prevCandidate:r};if(a===o.goalPortId)return void this.onPathFound(A);this.setCandidateBestCost(l,p),o.candidateQueue.queue(A)}}getRegionalHopFrontier(t,n){let{state:o}=this,r=o.candidateQueue;if(!(r instanceof hcn))return this.regionalHopFrontierQueue=void 0,this.regionalHopFrontierEpoch=void 0,void this.regionalHopFrontiers.clear();let i=r.closureEpoch;if(r===this.regionalHopFrontierQueue&&i===this.regionalHopFrontierEpoch&&o.goalPortId===this.regionalHopFrontierGoalPortId&&o.currentRouteId===this.regionalHopFrontierRouteId&&o.currentRouteNetId===this.regionalHopFrontierNetId||(this.regionalHopFrontierQueue=r,this.regionalHopFrontierEpoch=i,this.regionalHopFrontierGoalPortId=o.goalPortId,this.regionalHopFrontierRouteId=o.currentRouteId,this.regionalHopFrontierNetId=o.currentRouteNetId,this.regionalHopFrontiers.clear()),!Array.isArray(n)||n.length>2147483647)return;let s=this.regionalHopFrontiers.get(t);if(!s||s.neighbors!==n){let a=new Int32Array(n.length);for(let c=0;c<n.length;c++)a[c]=c+1<n.length?c+1:-1;s={neighbors:n,next:a,head:n.length>0?0:-1},this.regionalHopFrontiers.set(t,s)}return s}expandRegionalHopFrontier(t,n){let{problem:o,topology:r,state:i}=this,{neighbors:s,next:a}=n,c=n.head,l=-1;for(;c!==-1;){let h=c;c=a[h];let d=l;l=h;let u=s[h];if(u===i.goalPortId){let b=i.portAssignment[u];if(this.isPortReservedForDifferentNet(u))continue;if(b!==-1&&b!==i.currentRouteNetId)continue;return void this.onPathFound(t)}if(u===t.portId)continue;if(o.portSectionMask[u]===0)continue;let _=r.incidentPortRegion[u][0]===t.nextRegionId?r.incidentPortRegion[u][1]:r.incidentPortRegion[u][0];if(_===void 0)continue;let p=this.getHopId(u,_);if((i.candidateQueue.isClosedHopId?i.candidateQueue.isClosedHopId(p):i.candidateQueue.isClosedHop?.(u,_))===!0){d===-1?n.head=c:a[d]=c,l=d;continue}let m=i.portAssignment[u];if(this.isPortReservedForDifferentNet(u))continue;if(m!==-1&&m!==i.currentRouteNetId)continue;if(this.isRegionReservedForDifferentNet(_))continue;let A=this.getCandidateBestCost(p);if(t.g>=A)continue;let g,f=t.g+i.regionCongestionCost[t.nextRegionId]+(o.portPenalty?.[u]??0);if(this.ADD_SEGMENT_DISTANCE_TO_G){let b=r.portX[t.portId]-r.portX[u],I=r.portY[t.portId]-r.portY[u];g=Math.sqrt(b*b+I*I),f+=g*this.DISTANCE_TO_COST}if(f>=A)continue;let y=this.computeG(t,u,A,g);if(!Number.isFinite(y)||y>=A)continue;let x=this.computeH(u),C={hopId:p,prevRegionId:t.nextRegionId,nextRegionId:_,portId:u,g:y,h:x,f:y+x,prevCandidate:t};if(u===i.goalPortId)return void this.onPathFound(C);this.setCandidateBestCost(p,y),i.candidateQueue.queue(C)}}resetCandidateBestCosts(){let{state:t}=this;if(this.candidateOverflowBestCost?.clear(),t.candidateBestCostGeneration===4294967295)return t.candidateBestCostByHopId instanceof Map&&t.candidateBestCostByHopId.clear(),t.candidateBestCostGenerationByHopId instanceof Map?t.candidateBestCostGenerationByHopId.clear():t.candidateBestCostGenerationByHopId.fill(0),void(t.candidateBestCostGeneration=1);t.candidateBestCostGeneration+=1}getCandidateBestCost(t){if(t<0)return this.candidateOverflowBestCost?.get(t)??Number.POSITIVE_INFINITY;let{state:n}=this,o=n.candidateBestCostGenerationByHopId;return(o instanceof Map?o.get(t):o[t])===n.candidateBestCostGeneration?n.candidateBestCostByHopId instanceof Map?n.candidateBestCostByHopId.get(t):n.candidateBestCostByHopId[t]:Number.POSITIVE_INFINITY}setCandidateBestCost(t,n){if(t<0)return this.candidateOverflowBestCost||(this.candidateOverflowBestCost=new Map),void this.candidateOverflowBestCost.set(t,n);let{state:o}=this;o.candidateBestCostGenerationByHopId instanceof Map?o.candidateBestCostGenerationByHopId.set(t,o.candidateBestCostGeneration):o.candidateBestCostGenerationByHopId[t]=o.candidateBestCostGeneration,o.candidateBestCostByHopId instanceof Map?o.candidateBestCostByHopId.set(t,n):o.candidateBestCostByHopId[t]=n}getHopId(t,n){let o=t*this.candidateHopSlotStride;if(this.candidateFirstRegionByPortId[t]===n)return o;if(this.candidateSecondRegionByPortId[t]===n)return o+1;let r=this.topology.incidentPortRegion[t];for(let i=2;i<(r?.length??0);i++)if(r[i]===n)return o+i;return-(t*this.topology.regionCount+n)-1}getStartingNextRegionId(t,n){let o=this.topology.incidentPortRegion[n]??[],r=this.problem.routeNet[t];return o.find((i)=>this.problem.regionNetId[i]===-1)??o.find((i)=>this.problem.regionNetId[i]===r)??o[0]}getRouteStartPortId(t){return this.problem.routeStartPort[t]}getRouteEndPortId(t){return this.problem.routeEndPort[t]}isPortReservedForDifferentNet(t){let n=this.problemSetup.portEndpointReservationNetId[t]??-1;return n===-2||n!==-1&&n!==this.state.currentRouteNetId}isRegionReservedForDifferentNet(t){let n=this.problem.regionNetId[t];return n!==-1&&n!==this.state.currentRouteNetId}isKnownSingleLayerRegion(t){let n=this.topology.regionAvailableZMask?.[t]??0;return ccn(n)}computeRegionCostForRegion(t,n,o,r,i){return((s,a,c,l,h,d,u=0,_=0.3,p=0)=>$3r(s*a,c,l,h,d,u,_,p))(this.topology.regionWidth[t],this.topology.regionHeight[t],n,o,r,i,this.topology.regionAvailableZMask?.[t]??0,this.minViaPadDiameter,this.TRACE_DENSITY_COST_FACTOR)}populateSegmentGeometryScratch(t,n,o){return this.populateBaseSegmentGeometryScratch(t,n,o)}populateBaseSegmentGeometryScratch(t,n,o){let{state:r,topology:i}=this,s=this.segmentGeometryScratch,a=this.candidateFirstRegionByPortId[n]===t||this.candidateSecondRegionByPortId[n]!==t?i.portAngleForRegion1[n]:i.portAngleForRegion2?.[n]??i.portAngleForRegion1[n],c=this.candidateFirstRegionByPortId[o]===t||this.candidateSecondRegionByPortId[o]!==t?i.portAngleForRegion1[o]:i.portAngleForRegion2?.[o]??i.portAngleForRegion1[o],l=i.portZ[n],h=i.portZ[o];return s.lesserAngle=a<c?a:c,s.greaterAngle=a<c?c:a,s.layerMask=1<<l|1<<h,s.entryExitLayerChanges=l!==h?1:0,s.netId=r.currentRouteNetId,s}appendSegmentToRegionCache(t,n,o){let{state:r}=this,i=r.regionIntersectionCaches[t],s=this.populateSegmentGeometryScratch(t,n,o);zYt(i,s);let{sameLayerIntersectionCount:a,crossingLayerIntersectionCount:c,entryExitLayerChanges:l}=s,h=i.netIds.length+1,d=new Int32Array(h);d.set(i.netIds),d[h-1]=r.currentRouteNetId;let u=new Int32Array(h);u.set(i.lesserAngles),u[h-1]=s.lesserAngle;let _=new Int32Array(h);_.set(i.greaterAngles),_[h-1]=s.greaterAngle;let p=new Int32Array(h);p.set(i.layerMasks),p[h-1]=s.layerMask;let m=i.existingSameLayerIntersections+a,A=i.existingCrossingLayerIntersections+c,g=i.existingEntryExitLayerChanges+l,f=u.length;r.regionIntersectionCaches[t]={netIds:d,lesserAngles:u,greaterAngles:_,layerMasks:p,existingSameLayerIntersections:m,existingCrossingLayerIntersections:A,existingEntryExitLayerChanges:g,existingSegmentCount:f,existingRegionCost:this.computeRegionCostForRegion(t,m,A,g,f)}}getSolvedPathSegments(t){let{state:n}=this,o=[],r=t;for(;r;)o.unshift(r),r=r.prevCandidate;let i=[];for(let a=1;a<o.length;a++)i.push({regionId:o[a-1].nextRegionId,fromPortId:o[a-1].portId,toPortId:o[a].portId});let s=o[o.length-1];return s&&s.portId!==n.goalPortId&&i.push({regionId:s.nextRegionId,fromPortId:s.portId,toPortId:n.goalPortId}),i}resetRoutingStateForRerip(){let{topology:t,problem:n,state:o}=this;o.portAssignment.fill(-1),o.regionSegments=Array.from({length:t.regionCount},()=>[]),o.regionIntersectionCaches=Array.from({length:t.regionCount},()=>O$()),o.currentRouteNetId=void 0,o.currentRouteId=void 0,o.unroutedRoutes=rbe(dXe(n.routeCount),o.ripCount),o.candidateQueue.clear(),this.resetCandidateBestCosts(),o.goalPortId=-1}getMaxRegionCost(){let{topology:t,state:n}=this,o=0;for(let r=0;r<t.regionCount;r++){let i=n.regionIntersectionCaches[r]?.existingRegionCost??0;o=Math.max(o,i)}return o}getRouteMetadata(t){return this.problem.routeMetadata?.[t]}getRouteConnectionId(t){let n=this.getRouteMetadata(t)?.connectionId;return typeof n=="string"?n:`route-${t}`}getRouteSummary(t){return(({problem:n,routeId:o,getRouteMetadata:r,getRouteConnectionId:i})=>{let s=r?.(o)??dcn(n,o);return{routeId:o,connectionId:i?.(o)??eCr(n,o),startPortId:n.routeStartPort[o],endPortId:n.routeEndPort[o],startRegionId:typeof s?.startRegionId=="string"?s.startRegionId:void 0,endRegionId:typeof s?.endRegionId=="string"?s.endRegionId:void 0,pointIds:Z3r(s)}})({problem:this.problem,routeId:t,getRouteMetadata:(n)=>this.getRouteMetadata(n),getRouteConnectionId:(n)=>this.getRouteConnectionId(n)})}getAdditionalRegionLabel(t){}getNeverSuccessfullyRoutedRoutes(){let t=[];for(let n=0;n<this.problem.routeCount;n++){let o=this.routeAttemptCountByRouteId[n];o===0||this.routeSuccessCountByRouteId[n]>0||t.push({...this.getRouteSummary(n),attempts:o})}return t}getStaticallyUnroutableRoutes(){return this.staticallyUnroutableRoutes}logNeverSuccessfullyRoutedRoutes(){if(!this.VERBOSE||this.hasLoggedNeverSuccessfullyRoutedRoutes)return;let t=this.getNeverSuccessfullyRoutedRoutes();if(this.hasLoggedNeverSuccessfullyRoutedRoutes=!0,t.length!==0){console.log(["[TinyHyperGraphSolver:never-routed-summary]",`count=${t.length}`].join(" "));for(let n of t){let o=n.pointIds.length>=2?`${n.pointIds[0]}->${n.pointIds[1]}`:"unknown";console.log(["[TinyHyperGraphSolver:never-routed]",`routeId=${n.routeId}`,`connectionId=${n.connectionId}`,`attempts=${n.attempts}`,`pointPath=${o}`,`startRegionId=${n.startRegionId??"unknown"}`,`endRegionId=${n.endRegionId??"unknown"}`].join(" "))}}}logRipEvent(t,n,o={}){this.VERBOSE&&console.log(["[TinyHyperGraphSolver:rip]",`ripCount=${this.state.ripCount}`,`maxRegionCostBeforeRip=${n.toFixed(3)}`,`reason=${t}`,...Object.entries(o).map(([r,i])=>`${r}=${typeof i=="number"?Number.isInteger(i)?String(i):i.toFixed(3):i}`)].join(" "))}compareRegionCostSummaries(t,n){return t.maxRegionCost!==n.maxRegionCost?t.maxRegionCost-n.maxRegionCost:t.totalRegionCost-n.totalRegionCost}captureBestSolvedState(t){this.bestSolvedStateSummary&&this.compareRegionCostSummaries(t,this.bestSolvedStateSummary)>=0||this.replaceBestSolvedState(t)}replaceBestSolvedState(t){this.bestSolvedStateSummary=t,this.bestSolvedStateSnapshot=wae({portAssignment:this.state.portAssignment,regionSegments:this.state.regionSegments,regionIntersectionCaches:this.state.regionIntersectionCaches,regionCongestionCost:this.state.regionCongestionCost,ripCount:this.state.ripCount})}restoreBestSolvedState(){if(!this.bestSolvedStateSnapshot)return;let t=wae(this.bestSolvedStateSnapshot);this.state.portAssignment=t.portAssignment,this.state.regionSegments=t.regionSegments,this.state.regionIntersectionCaches=t.regionIntersectionCaches,this.state.regionCongestionCost=t.regionCongestionCost,this.state.ripCount=t.ripCount,this.state.currentRouteId=void 0,this.state.currentRouteNetId=void 0,this.state.unroutedRoutes=[],this.state.candidateQueue.clear(),this.resetCandidateBestCosts(),this.state.goalPortId=-1}getRemainingRouteIdsForGreedyFinalRoute(){let t=new Set(this.state.unroutedRoutes);return this.state.currentRouteId!==void 0&&t.add(this.state.currentRouteId),[...t]}applySnapshotToGreedyFinalRouteSolver(t,n,o){let r=wae(n);t.state.portAssignment=r.portAssignment,t.state.regionSegments=r.regionSegments,t.state.regionIntersectionCaches=r.regionIntersectionCaches,t.state.regionCongestionCost=r.regionCongestionCost,t.state.ripCount=0,t.state.currentRouteId=void 0,t.state.currentRouteNetId=void 0,t.state.unroutedRoutes=[...o],t.state.candidateQueue.clear(),t.resetCandidateBestCosts(),t.state.goalPortId=-1}summarizeSolvedState(t){let n=0,o=0;for(let r of t.state.regionIntersectionCaches){let i=r.existingRegionCost;n=Math.max(n,i),o+=i}return{maxRegionCost:n,totalRegionCost:o}}createGreedyFinalRouteSolver(t,n){return new uCr(this.topology,this.problem,t)}tryGreedyFinalRouteAcceptance(){let t=Math.max(0,Math.floor(this.GREEDY_FINAL_ROUTE_ITERS));if(t===0)return!1;let n=this.getRemainingRouteIdsForGreedyFinalRoute();if(n.length===0)return!1;let o=wae({portAssignment:this.state.portAssignment,regionSegments:this.state.regionSegments,regionIntersectionCaches:this.state.regionIntersectionCaches,regionCongestionCost:this.state.regionCongestionCost,ripCount:this.state.ripCount}),r=50000;for(let i=this.state.ripCount<this.costAwareFinalReripBudget?-1:0;i<t;i++){let s=i<=0?n:rbe(n,this.state.ripCount+i),a=this.createGreedyFinalRouteSolver({...pCe(this),ACCEPT_BEST_SOLUTION_ON_TIMEOUT:!1,GREEDY_FINAL_ROUTE_ITERS:0,MAX_ITERATIONS:50000,RIP_THRESHOLD_RAMP_ATTEMPTS:0,STATIC_REACHABILITY_PRECHECK:!1,OUTSIDE_IN_ROUTING:!1,PARTIAL_RIP_ENABLED:!1},i);if(r=a.MAX_ITERATIONS,this.applySnapshotToGreedyFinalRouteSolver(a,o,s),a.solve(),a.solved&&!a.failed)return this.bestSolvedStateSnapshot=wae({portAssignment:a.state.portAssignment,regionSegments:a.state.regionSegments,regionIntersectionCaches:a.state.regionIntersectionCaches,regionCongestionCost:a.state.regionCongestionCost,ripCount:a.state.ripCount}),this.bestSolvedStateSummary=this.summarizeSolvedState(a),this.restoreBestSolvedState(),this.stats={...this.stats,acceptedGreedyFinalRouteOnTimeout:!0,greedyFinalRouteIter:Math.max(0,i),finalRoutingStrategy:i<0?"congestion-aware":"greedy",greedyFinalRouteRemainingRouteCount:n.length,greedyFinalRouteMaxIterations:r,neverSuccessfullyRoutedRouteCount:0,maxRegionCost:this.bestSolvedStateSummary.maxRegionCost,totalRegionCost:this.bestSolvedStateSummary.totalRegionCost,bestMaxRegionCost:this.bestSolvedStateSummary.maxRegionCost,bestTotalRegionCost:this.bestSolvedStateSummary.totalRegionCost},this.solved=!0,this.failed=!1,this.error=null,!0}return this.stats={...this.stats,greedyFinalRouteAttemptCount:t,greedyFinalRouteRemainingRouteCount:n.length,greedyFinalRouteMaxIterations:r},!1}onAllRoutesRouted(){let{topology:t,state:n}=this,o=this.RIP_THRESHOLD_RAMP_ATTEMPTS<=0?1:Math.min(1,n.ripCount/this.RIP_THRESHOLD_RAMP_ATTEMPTS),r=this.RIP_THRESHOLD_START+(this.RIP_THRESHOLD_END-this.RIP_THRESHOLD_START)*o,i=[],s=new Float64Array(t.regionCount),a=0,c=0;for(let d=0;d<t.regionCount;d++){let u=n.regionIntersectionCaches[d]?.existingRegionCost??0;s[d]=u,a=Math.max(a,u),c+=u,u>r&&i.push(d)}let l={maxRegionCost:a,totalRegionCost:c},h=i.length===0||n.ripCount>=this.RIP_THRESHOLD_RAMP_ATTEMPTS;if(h?(!this.bestSolvedStateSummary||this.compareRegionCostSummaries(l,this.bestSolvedStateSummary)<0)&&(this.bestSolvedStateSummary=l):this.captureBestSolvedState(l),this.stats={...this.stats,currentRipThreshold:r,hotRegionCount:i.length,maxRegionCost:a,totalRegionCost:c,bestMaxRegionCost:this.bestSolvedStateSummary?.maxRegionCost,bestTotalRegionCost:this.bestSolvedStateSummary?.totalRegionCost,ripCount:n.ripCount},h)this.solved=!0;else{for(let d=0;d<t.regionCount;d++)n.regionCongestionCost[d]+=s[d]*this.RIP_CONGESTION_REGION_COST_FACTOR;n.ripCount+=1,this.resetRoutingStateForRerip(),this.stats={...this.stats,ripCount:n.ripCount,maxRegionCostBeforeRip:a,reripRegionCount:i.length},this.logRipEvent("hot_regions",a,{hotRegionCount:i.length,currentRipThreshold:r})}}onOutOfCandidates(){let{topology:t,state:n}=this,o=n.currentRouteId,r=this.getMaxRegionCost();for(let i=0;i<t.regionCount;i++){let s=n.regionIntersectionCaches[i]?.existingRegionCost??0;n.regionCongestionCost[i]+=s*this.RIP_CONGESTION_REGION_COST_FACTOR}n.ripCount+=1,this.resetRoutingStateForRerip(),this.stats={...this.stats,ripCount:n.ripCount,maxRegionCost:r,maxRegionCostBeforeRip:r,reripReason:"out_of_candidates"},this.logRipEvent("out_of_candidates",r,{...o===void 0?{}:{routeId:o,connectionId:this.getRouteConnectionId(o)}})}onPathFound(t){let{state:n}=this,o=n.currentRouteId;if(o===void 0)return;this.routeSuccessCountByRouteId[o]+=1;let r=this.getSolvedPathSegments(t);for(let{regionId:i,fromPortId:s,toPortId:a}of r)n.regionSegments[i].push([o,s,a]),n.portAssignment[s]=n.currentRouteNetId,n.portAssignment[a]=n.currentRouteNetId,this.appendSegmentToRegionCache(i,s,a);n.candidateQueue.clear(),n.currentRouteNetId=void 0,n.currentRouteId=void 0}computeG(t,n,o=Number.POSITIVE_INFINITY,r){let{state:i,topology:s}=this,a=t.nextRegionId,c=i.regionIntersectionCaches[a],l=i.regionCongestionCost[a],h=this.problem.portPenalty?.[n]??0,d=0;if(this.ADD_SEGMENT_DISTANCE_TO_G){let A=r;if(A===void 0){let g=s.portX[t.portId]-s.portX[n],f=s.portY[t.portId]-s.portY[n];A=Math.sqrt(g*g+f*f)}d=A*this.DISTANCE_TO_COST}if(t.g+l+h+d>o+0.000000001)return Number.POSITIVE_INFINITY;let u=0,_=0,p=s.portZ[t.portId]!==s.portZ[n]?1:0;if(c.existingSegmentCount>0){let A=this.populateBaseSegmentGeometryScratch(a,t.portId,n);zYt(c,A),u=A.sameLayerIntersectionCount,_=A.crossingLayerIntersectionCount,p=A.entryExitLayerChanges}if(u>0&&this.isKnownSingleLayerRegion(a))return Number.POSITIVE_INFINITY;let m=this.computeRegionCostForRegion(a,c.existingSameLayerIntersections+u,c.existingCrossingLayerIntersections+_,c.existingEntryExitLayerChanges+p,c.existingSegmentCount+1)-c.existingRegionCost;return t.g+m+l+h+d}tryFinalAcceptance(){let t=this.getNeverSuccessfullyRoutedRoutes();if(this.stats={...this.stats,neverSuccessfullyRoutedRouteCount:t.length},this.ACCEPT_BEST_SOLUTION_ON_TIMEOUT&&this.bestSolvedStateSnapshot&&this.bestSolvedStateSummary)return this.restoreBestSolvedState(),this.stats={...this.stats,acceptedBestSolutionOnTimeout:!0,maxRegionCost:this.bestSolvedStateSummary.maxRegionCost,totalRegionCost:this.bestSolvedStateSummary.totalRegionCost,bestMaxRegionCost:this.bestSolvedStateSummary.maxRegionCost,bestTotalRegionCost:this.bestSolvedStateSummary.totalRegionCost},this.solved=!0,this.failed=!1,void(this.error=null);this.ACCEPT_BEST_SOLUTION_ON_TIMEOUT&&this.tryGreedyFinalRouteAcceptance()||this.logNeverSuccessfullyRoutedRoutes()}getRouteHeuristic(t,n){let o=this.problemSetup.portHCostToEndOfRoute;if(o)return o[n*this.problem.routeCount+t];if(this.hCostEndRouteId!==t){this.hCostEndRouteId=t;let r=this.getRouteEndPortId(t);this.hCostEndX=this.topology.portX[r],this.hCostEndY=this.topology.portY[r]}if(this.hCostRouteIdByPortId[n]!==t){let r=this.topology.portX[n]-this.hCostEndX,i=this.topology.portY[n]-this.hCostEndY;this.hCostByPortId[n]=Math.sqrt(r*r+i*i)*this.DISTANCE_TO_COST,this.hCostRouteIdByPortId[n]=t}return this.hCostByPortId[n]}computeH(t){return this.getRouteHeuristic(this.state.currentRouteId,t)}visualize(){return sbe(this)}getOutput(){return K3r(this)}},uCr=class extends bQ{computeG(e,t){return e.g}},pCr=class extends bQ{constructor(e,t,n){super(e,t,n),this.ADD_SEGMENT_DISTANCE_TO_G=!0}_setup(){super._setup(),this.state.candidateQueue=new hcn(this.topology.regionCount,{hopCapacity:this.candidateHopCapacity,hopSlotStride:this.candidateHopSlotStride,firstRegionByPortId:this.candidateFirstRegionByPortId,secondRegionByPortId:this.candidateSecondRegionByPortId,incidentPortRegion:this.topology.incidentPortRegion})}onPathFound(e){let t=this.state.goalPortId;if(e.portId===t)return void super.onPathFound(e);let n=this.computeG(e,t);if(!Number.isFinite(n))return;let o=this.getHopId(t,e.nextRegionId);n>=this.getCandidateBestCost(o)||(this.setCandidateBestCost(o,n),this.state.candidateQueue.queue({hopId:o,prevRegionId:e.nextRegionId,nextRegionId:e.nextRegionId,portId:t,g:n,h:0,f:n,prevCandidate:e}))}},mCr=new Set,_Cr=class extends pCr{partialRipRoutePlans=new Map;outsideInRouteSearch;oneSidedFallbackRouteId;partialRipWindowDistance;partialRipCount=0;partiallyRippedRouteCount=0;partiallyRippedSegmentCount=0;retainedPartialRipSegmentCount=0;outsideInRouteCount=0;outsideInCompletedRouteCount=0;outsideInFallbackRouteCount=0;outsideInForwardExpansionCount=0;outsideInReverseExpansionCount=0;outsideInDistancePruneCount=0;completedRoundSummaries=[];firstCompletedRoundSummary;partialRipQualityBaselineSummary;bestSolvedRoundSummary;partialRipTargetReached=!1;useComplexityAwareSelection=!1;constructor(e,t,n){super(e,t,n),n?.PARTIAL_RIP_ENABLED===void 0&&(this.PARTIAL_RIP_ENABLED=!0),n?.OUTSIDE_IN_ROUTING===void 0&&(this.OUTSIDE_IN_ROUTING=!0),this.PARTIAL_RIP_ENABLED&&n?.PARTIAL_RIP_MAX_ATTEMPTS===void 0&&(this.PARTIAL_RIP_MAX_ATTEMPTS=10),(t.routeCount<Math.max(0,this.PARTIAL_RIP_MIN_ROUTE_COUNT)||t.routeCount>Math.max(0,this.PARTIAL_RIP_MAX_ROUTE_COUNT))&&(this.PARTIAL_RIP_ENABLED=!1,this.OUTSIDE_IN_ROUTING=!1),this.useComplexityAwareSelection=t.routeCount>=Math.max(0,this.PARTIAL_RIP_COMPLEXITY_SELECTION_MIN_ROUTE_COUNT)}getRouteStartPortId(e){return this.PARTIAL_RIP_ENABLED?this.partialRipRoutePlans.get(e)?.activeStartPortId??super.getRouteStartPortId(e):super.getRouteStartPortId(e)}getRouteEndPortId(e){return this.PARTIAL_RIP_ENABLED?this.partialRipRoutePlans.get(e)?.activeEndPortId??super.getRouteEndPortId(e):super.getRouteEndPortId(e)}getStartingNextRegionId(e,t){if(!this.PARTIAL_RIP_ENABLED)return super.getStartingNextRegionId(e,t);let n=this.partialRipRoutePlans.get(e);return n&&n.activeStartPortId===t?n.forcedStartRegionId:super.getStartingNextRegionId(e,t)}getEndingNextRegionId(e,t){let n=this.partialRipRoutePlans.get(e);return n&&n.activeEndPortId===t?n.forcedEndRegionId:super.getStartingNextRegionId(e,t)}computeH(e){if(!this.PARTIAL_RIP_ENABLED)return super.computeH(e);let t=this.state.currentRouteId;if(t===void 0||!this.partialRipRoutePlans.has(t))return super.computeH(e);let n=this.getRouteEndPortId(t),o=this.topology.portX[e]-this.topology.portX[n],r=this.topology.portY[e]-this.topology.portY[n];return Math.sqrt(o*o+r*r)*this.DISTANCE_TO_COST}onPathFound(e){if(!this.PARTIAL_RIP_ENABLED&&!this.OUTSIDE_IN_ROUTING)return void super.onPathFound(e);let t=this.state.currentRouteId,n=t!==void 0&&this.outsideInRouteSearch?.routeId===t;super.onPathFound(e),t!==void 0&&this.state.currentRouteId===void 0&&(this.partialRipRoutePlans.delete(t),n&&(this.outsideInCompletedRouteCount+=1),this.oneSidedFallbackRouteId===t&&(this.oneSidedFallbackRouteId=void 0)),this.outsideInRouteSearch=void 0,this.publishOutsideInStats()}resetRoutingStateForRerip(){this.PARTIAL_RIP_ENABLED||this.OUTSIDE_IN_ROUTING?(this.partialRipRoutePlans.clear(),this.outsideInRouteSearch=void 0,this.oneSidedFallbackRouteId=void 0,super.resetRoutingStateForRerip()):super.resetRoutingStateForRerip()}clearPartialRipPlans(e){for(let t of e)this.partialRipRoutePlans.delete(t)}getRouteIdsPreferredForPreservation(){return mCr}getCommittedRouteSegments(e){let t=[];for(let c=0;c<this.state.regionSegments.length;c++)for(let[l,h,d]of this.state.regionSegments[c]??[])l===e&&t.push({segmentIndex:t.length,regionId:c,fromPortId:h,toPortId:d});if(t.length===0)return;let n=new Map;for(let c of t)for(let l of[c.fromPortId,c.toPortId]){let h=n.get(l)??[];h.push(c.segmentIndex),n.set(l,h)}let o=this.problem.routeEndPort[e],r=[],i=new Set,s=new Set([this.problem.routeStartPort[e]]),a=(c)=>{if(c===o)return!0;for(let l of n.get(c)??[]){if(i.has(l))continue;let h=t[l],d=h.fromPortId===c?h.toPortId:h.fromPortId;if(!s.has(d)){if(i.add(l),s.add(d),r.push({regionId:h.regionId,fromPortId:c,toPortId:d}),a(d))return!0;r.pop(),s.delete(d),i.delete(l)}}return!1};return a(this.problem.routeStartPort[e])&&i.size===t.length?r:void 0}getSegmentDistance(e){let t=this.topology.portX[e.fromPortId]-this.topology.portX[e.toPortId],n=this.topology.portY[e.fromPortId]-this.topology.portY[e.toPortId];return Math.sqrt(t*t+n*n)}getPartialRipWindow(e,t,n){let o,r=Number.NEGATIVE_INFINITY;for(let h=0;h<e.length;h++){let d=e[h];if(!t.has(d.regionId))continue;let u=n[d.regionId]??0;u>r&&(r=u,o=h)}if(o===void 0)return;let i=Math.max(0,this.partialRipWindowDistance??this.PARTIAL_RIP_MAX_DISTANCE),s=o,a=o,c=this.getSegmentDistance(e[o])/2,l=c;for(;s>0;){let h=this.getSegmentDistance(e[s-1]);if(c+h>i)break;s-=1,c+=h}for(;a+1<e.length;){let h=this.getSegmentDistance(e[a+1]);if(l+h>i)break;a+=1,l+=h}return{startIndex:s,endIndex:a}}appendRetainedSegment(e,t,n){e[n.regionId].push([t,n.fromPortId,n.toPortId])}preparePartialRip(e,t){if(!this.PARTIAL_RIP_ENABLED||e.length===0)return!1;let n=new Set(e);if(this.partialRipWindowDistance===void 0){let h=0;for(let _ of e)h=Math.max(h,t[_]??0);let d=Math.max(0,this.PARTIAL_RIP_MAX_DISTANCE),u=Math.max(d,this.PARTIAL_RIP_QUALITY_MAX_DISTANCE??2*d);this.partialRipWindowDistance=h<=1.5*this.RIP_THRESHOLD_END?u:d}let o=new Set;for(let h of e)for(let[d]of this.state.regionSegments[h]??[])o.add(d);if(o.size===0)return!1;let r=this.getRouteIdsPreferredForPreservation(),i=[...o].some((h)=>!r.has(h)),s=Array.from({length:this.topology.regionCount},()=>[]),a=new Map,c=0,l=0;for(let h=0;h<this.problem.routeCount;h++){let d=this.getCommittedRouteSegments(h);if(!d)return!1;if(!o.has(h)||i&&r.has(h)){for(let m of d)this.appendRetainedSegment(s,h,m),l+=1;continue}let u=this.getPartialRipWindow(d,n,t);if(!u)return!1;for(let m=0;m<d.length;m++){let A=d[m];m>=u.startIndex&&m<=u.endIndex?c+=1:(this.appendRetainedSegment(s,h,A),l+=1)}let _=d[u.startIndex],p=d[u.endIndex];a.set(h,{routeId:h,activeStartPortId:_.fromPortId,activeEndPortId:p.toPortId,forcedStartRegionId:_.regionId,forcedEndRegionId:p.regionId,rippedSegmentCount:u.endIndex-u.startIndex+1,retainedSegmentCount:d.length-(u.endIndex-u.startIndex+1)})}return a.size!==0&&c!==0&&(this.partialRipRoutePlans=a,this.rebuildRetainedRoutingState(s,[...a.keys()]),this.partialRipCount+=1,this.partiallyRippedRouteCount+=a.size,this.partiallyRippedSegmentCount+=c,this.retainedPartialRipSegmentCount+=l,this.publishPartialRipStats(),!0)}rebuildRetainedRoutingState(e,t){this.state.portAssignment.fill(-1),this.state.regionSegments=Array.from({length:this.topology.regionCount},()=>[]),this.state.regionIntersectionCaches=Array.from({length:this.topology.regionCount},()=>O$()),this.state.currentRouteId=void 0,this.state.currentRouteNetId=void 0,this.state.unroutedRoutes=t,this.state.candidateQueue.clear(),this.resetCandidateBestCosts(),this.state.goalPortId=-1,this.outsideInRouteSearch=void 0,this.oneSidedFallbackRouteId=void 0;for(let n=0;n<e.length;n++)for(let[o,r,i]of e[n]??[]){let s=this.problem.routeNet[o];this.state.currentRouteNetId=s;for(let a of[r,i]){let c=this.state.portAssignment[a];if(c!==-1&&c!==s)throw Error(`OutsideInPartialRipTinyHyperGraphSolver: retained port ${a} belongs to multiple nets`);this.state.portAssignment[a]=s}this.state.regionSegments[n].push([o,r,i]),this.appendSegmentToRegionCache(n,r,i)}this.state.currentRouteNetId=void 0}publishPartialRipStats(){this.stats={...this.stats,partialRipCount:this.partialRipCount,partiallyRippedRouteCount:this.partiallyRippedRouteCount,partiallyRippedSegmentCount:this.partiallyRippedSegmentCount,retainedPartialRipSegmentCount:this.retainedPartialRipSegmentCount,partialRipMaxDistance:this.partialRipWindowDistance??this.PARTIAL_RIP_MAX_DISTANCE,partialRipBaseMaxDistance:this.PARTIAL_RIP_MAX_DISTANCE,partialRipQualityMaxDistance:this.PARTIAL_RIP_QUALITY_MAX_DISTANCE??2*this.PARTIAL_RIP_MAX_DISTANCE,partialRipMaxAttempts:this.PARTIAL_RIP_MAX_ATTEMPTS}}publishOutsideInStats(){this.stats={...this.stats,outsideInRouteCount:this.outsideInRouteCount,outsideInCompletedRouteCount:this.outsideInCompletedRouteCount,outsideInFallbackRouteCount:this.outsideInFallbackRouteCount,outsideInForwardExpansionCount:this.outsideInForwardExpansionCount,outsideInReverseExpansionCount:this.outsideInReverseExpansionCount,outsideInDistancePruneCount:this.outsideInDistancePruneCount,outsideInMaxDistance:this.OUTSIDE_IN_MAX_DISTANCE}}createOutsideInFrontier(e,t,n){let o=new lcn([],(c,l)=>c.f===l.f?c.g-l.g:c.f-l.f),r=this.topology.portX[e]-this.topology.portX[n],i=this.topology.portY[e]-this.topology.portY[n],s=Math.sqrt(r*r+i*i)*this.DISTANCE_TO_COST,a={portId:e,nextRegionId:t,f:s,g:0,h:s,travelDistance:0};return o.queue(a),{queue:o,bestCostByHopId:new Map([[this.getHopId(e,t),0]]),settledByPortId:new Map,settledByRegionId:new Map,targetPortId:n}}startOutsideInRouteSearch(e){let t=this.getRouteStartPortId(e),n=this.getRouteEndPortId(e),o=this.getStartingNextRegionId(e,t),r=this.getEndingNextRegionId(e,n);return o!==void 0&&r!==void 0&&(this.state.goalPortId=n,this.state.candidateQueue.clear(),this.resetCandidateBestCosts(),this.outsideInRouteSearch={routeId:e,forward:this.createOutsideInFrontier(t,o,n),reverse:this.createOutsideInFrontier(n,r,t),expandForwardNext:!0,distanceLimitHit:!1,bestJoinedCost:Number.POSITIVE_INFINITY},this.outsideInRouteCount+=1,this.publishOutsideInStats(),!0)}dequeueFreshCandidate(e){for(;e.queue.length>0;){let t=e.queue.dequeue(),n=this.getHopId(t.portId,t.nextRegionId);if(t.g<=(e.bestCostByHopId.get(n)??1/0))return t}}recordSettledCandidate(e,t){let n=e.settledByPortId.get(t.portId);(!n||t.g<n.g)&&e.settledByPortId.set(t.portId,t);let o=e.settledByRegionId.get(t.nextRegionId)??[];o.push(t),o.sort((r,i)=>r.g-i.g),o.length>16&&(o.length=16),e.settledByRegionId.set(t.nextRegionId,o)}getCandidatePath(e){let t=[],n=e;for(;n;)t.push(n),n=n.prevCandidate;return t.reverse(),t}buildJoinedCandidate(e,t){let n=this.getCandidatePath(e),o=this.getCandidatePath(t),r=n.map(({portId:c})=>c),i=n.slice(0,-1).map(({nextRegionId:c})=>c);if(e.portId!==t.portId){if(e.nextRegionId!==t.nextRegionId)return;let c=this.topology.portX[e.portId]-this.topology.portX[t.portId],l=this.topology.portY[e.portId]-this.topology.portY[t.portId],h=Math.sqrt(c*c+l*l);if(e.travelDistance+t.travelDistance+h>2*this.OUTSIDE_IN_MAX_DISTANCE)return;let d=this.computeG(e,t.portId);if(!Number.isFinite(d))return;i.push(e.nextRegionId),r.push(t.portId)}for(let c=o.length-2;c>=0;c--){let l=o[c];i.push(l.nextRegionId),r.push(l.portId)}if(new Set(r).size!==r.length||i.length+1!==r.length)return;let s={portId:r[0],nextRegionId:i[0],f:0,g:0,h:0};for(let c=1;c<r.length;c++)s={portId:r[c],prevRegionId:i[c-1],nextRegionId:i[c]??i[c-1],prevCandidate:s,f:0,g:0,h:0};let a=e.portId===t.portId?0:this.computeG(e,t.portId)-e.g;return{candidate:s,cost:e.g+t.g+a}}considerOutsideInJoins(e,t){let n=this.outsideInRouteSearch,o=t?n.reverse:n.forward,r=(s)=>{!s||s.cost>=n.bestJoinedCost||(n.bestJoinedCandidate=s.candidate,n.bestJoinedCost=s.cost,n.remainingPostMeetingExpansions=24)},i=o.settledByPortId.get(e.portId);i&&r(t?this.buildJoinedCandidate(e,i):this.buildJoinedCandidate(i,e));for(let s of o.settledByRegionId.get(e.nextRegionId)??[])r(t?this.buildJoinedCandidate(e,s):this.buildJoinedCandidate(s,e))}commitBestOutsideInJoin(){let e=this.outsideInRouteSearch?.bestJoinedCandidate;return!!e&&(this.onPathFound(e),!0)}expandOutsideInFrontier(e){let t=this.outsideInRouteSearch,n=e?t.forward:t.reverse,o=this.dequeueFreshCandidate(n);if(!o)return!1;if(e?this.outsideInForwardExpansionCount+=1:this.outsideInReverseExpansionCount+=1,this.isRegionReservedForDifferentNet(o.nextRegionId))return!0;this.recordSettledCandidate(n,o),this.considerOutsideInJoins(o,e);for(let r of this.topology.regionIncidentPorts[o.nextRegionId]??[]){if(r===o.portId)continue;if(this.isPortReservedForDifferentNet(r))continue;let i=this.state.portAssignment[r];if(i!==-1&&i!==this.state.currentRouteNetId)continue;if(r!==n.targetPortId&&this.problem.portSectionMask[r]===0)continue;let s=this.topology.portX[o.portId]-this.topology.portX[r],a=this.topology.portY[o.portId]-this.topology.portY[r],c=Math.sqrt(s*s+a*a),l=o.travelDistance+c;if(l>this.OUTSIDE_IN_MAX_DISTANCE){t.distanceLimitHit=!0,this.outsideInDistancePruneCount+=1;continue}let h=this.topology.incidentPortRegion[r]?.[0]===o.nextRegionId?this.topology.incidentPortRegion[r]?.[1]:this.topology.incidentPortRegion[r]?.[0];if(h===void 0||this.isRegionReservedForDifferentNet(h))continue;let d=this.getHopId(r,h),u=n.bestCostByHopId.get(d)??1/0;if(o.g>=u)continue;let _=this.computeG(o,r,u,c);if(!Number.isFinite(_)||_>=u)continue;n.bestCostByHopId.set(d,_);let p=this.topology.portX[r]-this.topology.portX[n.targetPortId],m=this.topology.portY[r]-this.topology.portY[n.targetPortId],A=Math.sqrt(p*p+m*m)*this.DISTANCE_TO_COST;n.queue.queue({portId:r,prevRegionId:o.nextRegionId,nextRegionId:h,prevCandidate:o,f:_+A,g:_,h:A,travelDistance:l})}return!0}fallBackToOneSidedRouteSearch(){let e=this.state.currentRouteId;e!==void 0&&(this.outsideInRouteSearch=void 0,this.outsideInFallbackRouteCount+=1,this.oneSidedFallbackRouteId=e,this.state.currentRouteId=void 0,this.state.currentRouteNetId=void 0,this.state.goalPortId=-1,this.state.candidateQueue.clear(),this.resetCandidateBestCosts(),this.state.unroutedRoutes.unshift(e),this.publishOutsideInStats())}_step(){if(!this.OUTSIDE_IN_ROUTING)return void super._step();let e=this.state.currentRouteId??this.state.unroutedRoutes[0];if(e!==void 0&&!this.partialRipRoutePlans.has(e))return void super._step();if(this.oneSidedFallbackRouteId!==void 0)return void super._step();if(this.state.currentRouteId===void 0){if(this.state.unroutedRoutes.length===0)return void this.onAllRoutesRouted();let o=this.state.unroutedRoutes.shift();if(this.state.currentRouteId=o,this.state.currentRouteNetId=this.problem.routeNet[o],this.routeAttemptCountByRouteId[o]+=1,!this.startOutsideInRouteSearch(o))return this.failed=!0,void(this.error=`Route ${o} has an endpoint without an incident region`)}let t=this.outsideInRouteSearch;if(!t)return;let n=this.expandOutsideInFrontier(t.expandForwardNext);if(this.state.currentRouteId!==void 0&&(n||(n=this.expandOutsideInFrontier(!t.expandForwardNext),this.state.currentRouteId!==void 0)))if(t.expandForwardNext=!t.expandForwardNext,t.bestJoinedCandidate&&(t.remainingPostMeetingExpansions=(t.remainingPostMeetingExpansions??1)-1,(t.remainingPostMeetingExpansions??0)<=0))this.commitBestOutsideInJoin();else{if(!n&&t.forward.queue.length===0&&t.reverse.queue.length===0){if(this.commitBestOutsideInJoin())return;this.outsideInRouteSearch=void 0,t.distanceLimitHit?this.fallBackToOneSidedRouteSearch():this.onOutOfCandidates()}this.publishOutsideInStats()}}shouldReplaceBestSolvedState(e){let t=this.bestSolvedRoundSummary;if(!t)return!0;if(!this.useComplexityAwareSelection)return this.compareRegionCostSummaries(e,t)<0;let n=this.partialRipQualityBaselineSummary;if(!n)return this.compareRegionCostSummaries(e,t)<0;let o=this.firstCompletedRoundSummary??n,r=o.maxRegionCost*(1+Math.max(0,this.PARTIAL_RIP_MAX_REGION_COST_GROWTH_RATIO)),i=o.totalRegionCost*(1+Math.max(0,this.PARTIAL_RIP_MAX_TOTAL_COST_GROWTH_RATIO)),s=e.maxRegionCost<=r&&e.totalRegionCost<=i;return s!==(t.maxRegionCost<=r&&t.totalRegionCost<=i)?s:s&&e.segmentCount!==t.segmentCount?e.segmentCount<t.segmentCount:this.compareRegionCostSummaries(e,t)<0}onAllRoutesRouted(){if(!this.PARTIAL_RIP_ENABLED)return void super.onAllRoutesRouted();let{state:e,topology:t}=this,n=Math.min(this.RIP_THRESHOLD_RAMP_ATTEMPTS,this.PARTIAL_RIP_MAX_ATTEMPTS),o=Math.max(0,this.RIP_THRESHOLD_RAMP_ATTEMPTS),r=o<=0?1:Math.min(1,e.ripCount/o),i=this.RIP_THRESHOLD_START+(this.RIP_THRESHOLD_END-this.RIP_THRESHOLD_START)*r,s=new Float64Array(t.regionCount),a=[],c=0,l=0,h=0,d=0,u=0;for(let P=0;P<t.regionCount;P++){let M=e.regionIntersectionCaches[P]?.existingRegionCost??0;s[P]=M,c=Math.max(c,M),l+=M;let B=e.regionSegments[P]?.length??0;h+=B,d=Math.max(d,B),u+=B*B,M>i&&a.push(P)}let _={maxRegionCost:c,totalRegionCost:l},p={..._,ripCount:e.ripCount,segmentCount:h,maxRegionSegmentCount:d,squaredRegionSegmentCount:u};this.completedRoundSummaries.push(p),this.firstCompletedRoundSummary??=p,this.partialRipQualityBaselineSummary===void 0&&e.ripCount>=Math.max(0,this.PARTIAL_RIP_WARMUP_FULL_RIP_ATTEMPTS)&&(this.partialRipQualityBaselineSummary=p),this.shouldReplaceBestSolvedState(p)&&(this.replaceBestSolvedState(_),this.bestSolvedRoundSummary=p);let m=this.firstCompletedRoundSummary,A=this.partialRipQualityBaselineSummary??m,g=Math.max(0,this.PARTIAL_RIP_TARGET_MAX_COST_IMPROVEMENT_RATIO),f=Math.max(0,this.PARTIAL_RIP_MAX_TOTAL_COST_GROWTH_RATIO),y=A.maxRegionCost*(1-g),x=A.totalRegionCost*(1+f),C=this.useComplexityAwareSelection&&e.ripCount>A.ripCount&&g>0&&c<=y&&l<=x&&h<=A.segmentCount;if(C&&(this.partialRipTargetReached=!0),this.stats={...this.stats,currentRipThreshold:i,hotRegionCount:a.length,maxRegionCost:c,totalRegionCost:l,bestMaxRegionCost:this.bestSolvedStateSummary?.maxRegionCost,bestTotalRegionCost:this.bestSolvedStateSummary?.totalRegionCost,ripCount:e.ripCount,completedRoundSummaries:this.completedRoundSummaries.map((P)=>({...P})),firstMaxRegionCost:m.maxRegionCost,firstTotalRegionCost:m.totalRegionCost,firstSegmentCount:m.segmentCount,firstMaxRegionSegmentCount:m.maxRegionSegmentCount,firstSquaredRegionSegmentCount:m.squaredRegionSegmentCount,partialRipQualityBaselineRipCount:A.ripCount,partialRipQualityBaselineMaxRegionCost:A.maxRegionCost,partialRipQualityBaselineTotalRegionCost:A.totalRegionCost,partialRipQualityBaselineSegmentCount:A.segmentCount,partialRipQualityBaselineMaxRegionSegmentCount:A.maxRegionSegmentCount,partialRipQualityBaselineSquaredRegionSegmentCount:A.squaredRegionSegmentCount,bestSolvedSegmentCount:this.bestSolvedRoundSummary?.segmentCount,bestSolvedMaxRegionSegmentCount:this.bestSolvedRoundSummary?.maxRegionSegmentCount,bestSolvedSquaredRegionSegmentCount:this.bestSolvedRoundSummary?.squaredRegionSegmentCount,partialRipTargetMaxRegionCost:y,partialRipMaxTargetTotalRegionCost:x,partialRipComplexityAwareSelection:this.useComplexityAwareSelection,partialRipComplexitySelectionMinRouteCount:this.PARTIAL_RIP_COMPLEXITY_SELECTION_MIN_ROUTE_COUNT,partialRipMaxRegionCostGrowthRatio:this.PARTIAL_RIP_MAX_REGION_COST_GROWTH_RATIO,partialRipTargetReached:this.partialRipTargetReached},this.publishPartialRipStats(),a.length===0||C||e.ripCount>=n)return this.restoreBestSolvedState(),void(this.solved=!0);for(let P=0;P<t.regionCount;P++)e.regionCongestionCost[P]+=s[P]*this.RIP_CONGESTION_REGION_COST_FACTOR;let b=e.ripCount<Math.max(0,this.PARTIAL_RIP_WARMUP_FULL_RIP_ATTEMPTS);e.ripCount+=1;let I=!b&&this.preparePartialRip(a,s);I||this.resetRoutingStateForRerip();let v=b?"warmup_full":I?"partial":"full_fallback";this.stats={...this.stats,ripCount:e.ripCount,maxRegionCostBeforeRip:c,reripRegionCount:a.length,reripMode:v,partialRipWarmupFullRipAttempts:this.PARTIAL_RIP_WARMUP_FULL_RIP_ATTEMPTS},this.logRipEvent("hot_regions",c,{hotRegionCount:a.length,currentRipThreshold:i,reripMode:v,partialRouteCount:I?this.partialRipRoutePlans.size:0})}},bcn=(e)=>{let t=typeof e.d?.netId=="number"?e.d.netId:typeof e.d?.NetId=="number"?e.d.NetId:void 0;return Number.isFinite(t)?t:void 0},gCr=(e)=>{let t=new Set;for(let i of e.connections??[])t.add(i.startRegionId),t.add(i.endRegionId);let n=new Set(e.regions.filter((i)=>((s)=>{if(s.d?._containsObstacle!==!0)return!1;let a=bcn(s);return a===void 0||a===-1})(i)&&!t.has(i.regionId)).map((i)=>i.regionId));if(n.size===0)return e;let o=e.ports.filter((i)=>!n.has(i.region1Id)&&!n.has(i.region2Id)),r=(e.connections??[]).find((i)=>n.has(i.startRegionId)||n.has(i.endRegionId));if(r)throw Error(`Connection "${r.connectionId}" references full-obstacle region`);return{...e,regions:e.regions.filter((i)=>!n.has(i.regionId)),ports:o}},Icn=(e)=>{let t=e.d?.bounds;if(t)return t;let n=e.d?.center,o=e.d?.width,r=e.d?.height;return n&&typeof n.x=="number"&&typeof n.y=="number"&&typeof o=="number"&&typeof r=="number"?{minX:n.x-o/2,maxX:n.x+o/2,minY:n.y-r/2,maxY:n.y+r/2}:{minX:0,maxX:0,minY:0,maxY:0}},vcn=(e)=>Number(e.d?.x??0),Scn=(e)=>Number(e.d?.y??0),ZYt=(e,t)=>{if(!t)return 0;let n=Icn(t),o=vcn(e),r=Scn(e),i=n.minX<=o&&o<=n.maxX,s=n.minY<=r&&r<=n.maxY;if(s&&o>=n.maxX){let m=Math.max(n.maxY-n.minY,0.000000001),A=(r-n.minY)/m;return Math.round(9000*A)}if(i&&r>=n.maxY){let m=Math.max(n.maxX-n.minX,0.000000001),A=(n.maxX-o)/m;return 9000+Math.round(9000*A)}if(s&&o<=n.minX){let m=Math.max(n.maxY-n.minY,0.000000001),A=(n.maxY-r)/m;return 18000+Math.round(9000*A)}if(i&&r<=n.minY){let m=Math.max(n.maxX-n.minX,0.000000001),A=(o-n.minX)/m;return 27000+Math.round(9000*A)}let a=Math.abs(o-n.minX),c=Math.abs(o-n.maxX),l=Math.abs(r-n.minY),h=Math.abs(r-n.maxY),d=Math.min(a,c,l,h),u=Math.max(n.maxX-n.minX,0.000000001),_=Math.max(n.maxY-n.minY,0.000000001);if(d===c){let m=(r-n.minY)/_;return Math.round(9000*m)}if(d===h){let m=(n.maxX-o)/u;return 9000+Math.round(9000*m)}if(d===a){let m=(n.maxY-r)/_;return 18000+Math.round(9000*m)}let p=(o-n.minX)/u;return 27000+Math.round(9000*p)},eGt=(e,t)=>{if(!e)return;return[...e.pointIds].sort((n,o)=>{let r=t.get(n),i=t.get(o),s=Number(r?.d?.distToCentermostPortOnZ??Number.POSITIVE_INFINITY),a=Number(i?.d?.distToCentermostPortOnZ??Number.POSITIVE_INFINITY);if(s!==a)return s-a;let c=Number(r?.d?.z??0),l=Number(i?.d?.z??0);return c!==l?c-l:n.localeCompare(o)})[0]},cZe=(e)=>{let t=gCr(e),n=new Map,o=new Map,r=new Map,i=new Map((t.solvedRoutes??[]).map((re)=>[re.connection.connectionId,re]));t.regions.forEach((re,Z)=>{n.set(re.regionId,Z)}),t.ports.forEach((re,Z)=>{o.set(re.portId,Z),r.set(re.portId,re)});let s=t.regions.length,a=t.ports.length,c=t.regions.map((re)=>re.pointIds.map((Z)=>o.get(Z)).filter((Z)=>Z!==void 0)),l=Array.from({length:a},()=>[]),h=new Float64Array(s),d=new Float64Array(s),u=new Float64Array(s),_=new Float64Array(s),p=new Int32Array(s),m=new Int32Array(s).fill(-1),A=new Int8Array(s);t.regions.forEach((re,Z)=>{let te=((ce)=>{let ue=Icn(ce),de=typeof ce.d?.width=="number"?ce.d.width:ue.maxX-ue.minX,me=typeof ce.d?.height=="number"?ce.d.height:ue.maxY-ue.minY;return{centerX:typeof ce.d?.center?.x=="number"?ce.d.center.x:(ue.minX+ue.maxX)/2,centerY:typeof ce.d?.center?.y=="number"?ce.d.center.y:(ue.minY+ue.maxY)/2,width:de,height:me}})(re);h[Z]=te.width,d[Z]=te.height,u[Z]=te.centerX,_[Z]=te.centerY,p[Z]=((ce)=>{let ue=ce.d?.availableZ;if(!Array.isArray(ue))return 0;let de=0;for(let me of ue)!Number.isInteger(me)||me<0||me>=31||(de|=1<<me);return de})(re);let ie=bcn(re);ie!==void 0&&(m[Z]=ie,A[Z]=1)});let g=new Int32Array(a),f=new Int32Array(a),y=new Float64Array(a),x=new Float64Array(a),C=new Int32Array(a);t.ports.forEach((re,Z)=>{let te=n.get(re.region1Id),ie=n.get(re.region2Id);if(te===void 0||ie===void 0)throw Error(`Port "${re.portId}" references missing regions "${re.region1Id}" or "${re.region2Id}"`);l[Z]=[te,ie],y[Z]=vcn(re),x[Z]=Scn(re),C[Z]=((ce)=>{let ue=Number(ce.d?.z??0);return Number.isFinite(ue)?ue:0})(re),g[Z]=ZYt(re,t.regions[te]),f[Z]=ZYt(re,t.regions[ie])});let b=t.regions.map((re,Z)=>((te,ie)=>{let ce=te.d&&typeof te.d=="object"&&!Array.isArray(te.d)?{...te.d}:{value:te.d};return ce.layer=ie,Object.defineProperty(ce,"serializedRegionId",{value:te.regionId,enumerable:!1,configurable:!0,writable:!0}),ce})(re,((te)=>d9(aZe(p[te]))??d9((c[te]??[]).map((ie)=>C[ie]))??"z0")(Z))),I=t.ports.map((re,Z)=>((te,ie)=>{let ce=te.d&&typeof te.d=="object"&&!Array.isArray(te.d)?{...te.d}:{value:te.d};return ce.layer=ie,Object.defineProperty(ce,"serializedPortId",{value:te.portId,enumerable:!1,configurable:!0,writable:!0}),ce})(re,d9([C[Z]])??"z0")),v=t.connections??[],P=new Map,M=0,B=(re)=>{let Z=re.mutuallyConnectedNetworkId??re.connectionId,te=P.get(Z);return te===void 0&&(te=M++,P.set(Z,te)),te},T=Array.from({length:s},()=>new Set),N=(re,Z)=>{let te=n.get(re);if(te===void 0)throw Error(`Connection references missing region "${re}"`);T[te].add(Z)};v.forEach((re)=>{let Z=B(re);N(re.startRegionId,Z),N(re.endRegionId,Z)}),T.forEach((re,Z)=>{A[Z]!==1&&re.size===1&&(m[Z]=[...re][0])});let D=v.map((re)=>{let Z=i.get(re.connectionId),te=((ie,ce)=>ie.ports.filter((ue)=>ue.region1Id===ce.startRegionId&&ue.region2Id===ce.endRegionId||ue.region2Id===ce.startRegionId&&ue.region1Id===ce.endRegionId).map((ue)=>ue.portId))(t,re);return{connection:re,solvedRoute:Z,sharedPortIds:te}}).filter(({solvedRoute:re,sharedPortIds:Z})=>Z.length===0||(re?.path.length??0)>1),L=D.length,H=new Map(D.map(({connection:re},Z)=>[re.connectionId,Z])),V=new Int8Array(a).fill(1),O=new Int32Array(L),U=new Int32Array(L),j=new Int32Array(L);D.forEach(({connection:re,solvedRoute:Z},te)=>{let ie=eGt(t.regions.find((xe)=>xe.regionId===re.startRegionId),r),ce=eGt(t.regions.find((xe)=>xe.regionId===re.endRegionId),r),ue=Z?.path[0]?.portId??ie,de=Z?.path[Z.path.length-1]?.portId??ce,me=ue!==void 0?o.get(ue):void 0,ge=de!==void 0?o.get(de):void 0;if(me===void 0||ge===void 0)throw Error(`Connection "${re.connectionId}" could not be mapped to route endpoints`);O[te]=me,U[te]=ge,j[te]=B(re)});let Y={portCount:a,regionCount:s,regionIncidentPorts:c,incidentPortRegion:l,regionWidth:h,regionHeight:d,regionCenterX:u,regionCenterY:_,regionAvailableZMask:p,regionMetadata:b,portAngleForRegion1:g,portAngleForRegion2:f,portX:y,portY:x,portZ:C,portMetadata:I},X=t.regions.flatMap((re,Z)=>(re.assignments??[]).map((te)=>{let ie=H.get(te.connectionId);if(ie===void 0)throw Error(`Region "${re.regionId}" assignment references unknown routable connection "${te.connectionId}"`);let ce=o.get(te.regionPort1Id),ue=o.get(te.regionPort2Id);if(ce===void 0||ue===void 0)throw Error(`Region "${re.regionId}" assignment references missing port "${ce===void 0?te.regionPort1Id:te.regionPort2Id}"`);if(!c[Z]?.includes(ce)||!c[Z]?.includes(ue))throw Error(`Region "${re.regionId}" assignment ports must both belong to the region`);return{routeId:ie,regionId:Z,fromPortId:ce,toPortId:ue}})),K=Float64Array.from(t.ports,(re)=>{let Z=Number(re.d?.tinyHypergraphPortPenalty??0);return Number.isFinite(Z)&&Z>0?Z:0}),J=K.some((re)=>re>0),ee={routeCount:L,portSectionMask:V,routeMetadata:D.map(({connection:re})=>re),routeStartPort:O,routeEndPort:U,routeNet:j,regionNetId:m,...X.length>0&&{initialAssignments:X},...J&&{portPenalty:K}},se=[],ne=[];for(let{solvedRoute:re}of D){if(!re){se.push([]),ne.push([]);continue}let Z=[],te=[];for(let ie=1;ie<re.path.length;ie++){let ce=re.path[ie-1],ue=re.path[ie],de=ce?.portId,me=ue?.portId,ge=de!==void 0?o.get(de):void 0,xe=me!==void 0?o.get(me):void 0;if(ge===void 0||xe===void 0)continue;let Ee=typeof ce?.nextRegionId=="string"?ce.nextRegionId:typeof ue?.lastRegionId=="string"?ue.lastRegionId:void 0;Z.push([ge,xe]),te.push(Ee!==void 0?n.get(Ee):void 0)}se.push(Z),ne.push(te)}return{topology:Y,problem:ee,solution:{solvedRoutePathSegments:se,solvedRoutePathRegionIds:ne}}},V$=(e)=>typeof e=="object"&&e!==null,S$=(e)=>Array.isArray(e)?e.map((t)=>S$(t)):V$(e)?Object.fromEntries(Object.entries(e).map(([t,n])=>[t,S$(n)])):e,ACr=(e)=>V$(e)?{...e}:e===void 0?{}:{value:e},KR=(e,t=0)=>typeof e=="number"&&Number.isFinite(e)?e:t,hle=(e)=>({x:KR(e.d?.x),y:KR(e.d?.y)}),tGt=(e)=>[e.region1Id,e.region2Id].sort().join("\x00"),fCr=(e,t)=>Math.hypot(e.x-t.x,e.y-t.y),nGt=(e)=>{let t=Math.hypot(e.x,e.y);if(!(t<=0.000000001))return{x:e.x/t,y:e.y/t}},oGt=(e)=>{let t=e?.d?.center;if(V$(t))return{x:KR(t.x),y:KR(t.y)};let n=((o)=>{let r=o?.d?.bounds;if(V$(r)&&typeof r.minX=="number"&&typeof r.maxX=="number"&&typeof r.minY=="number"&&typeof r.maxY=="number")return{minX:r.minX,maxX:r.maxX,minY:r.minY,maxY:r.maxY};let i=o?.d?.center,s=KR(o?.d?.width),a=KR(o?.d?.height);if(V$(i)){let c=KR(i.x),l=KR(i.y);return{minX:c-s/2,maxX:c+s/2,minY:l-a/2,maxY:l+a/2}}return{minX:0,maxX:0,minY:0,maxY:0}})(e);return{x:(n.minX+n.maxX)/2,y:(n.minY+n.maxY)/2}},yCr=(e,t)=>{let n=hle(e),o,r=Number.POSITIVE_INFINITY;for(let i of t){if(i.portId===e.portId)continue;let s=fCr(n,hle(i));s<=0.000000001||s>=r||(o=i,r=s)}return o},xCr=(e,t,n)=>{let o=hle(e);if(t){let r=hle(t),i=nGt({x:o.x-r.x,y:o.y-r.y});if(i)return i}return((r,i)=>{let s=oGt(i.get(r.region1Id)),a=oGt(i.get(r.region2Id));return nGt({x:-(a.y-s.y),y:a.x-s.x})??{x:1,y:0}})(e,n)},CCr=(e,t,n)=>{let o=`${e}::dup${t}`;if(!n.has(o))return n.add(o),o;for(let r=2;;r++){let i=`${o}-${r}`;if(!n.has(i))return n.add(i),i}},bCr=(e,t,n)=>{let o=e.indexOf(t);o!==-1?e.splice(o+1,0,...n):e.push(...n)},ICr=(e,t)=>{let n=e.portMetadata?.[t];if(V$(n)){if(typeof n.serializedPortId=="string")return n.serializedPortId;if(typeof n.portId=="string")return n.portId}return`port-${t}`},vCr=(e,t)=>({routeCount:1,portSectionMask:e.portSectionMask,routeMetadata:e.routeMetadata===void 0?void 0:[e.routeMetadata[t]],routeStartPort:Int32Array.from([e.routeStartPort[t]]),routeEndPort:Int32Array.from([e.routeEndPort[t]]),routeNet:Int32Array.from([e.routeNet[t]]),regionNetId:e.regionNetId,portPenalty:e.portPenalty}),SCr=(e)=>{let t=new Set;for(let n of e.state.regionSegments)for(let[,o,r]of n)t.add(o),t.add(r);return t.size===0&&e.problem.routeCount===1&&(t.add(e.problem.routeStartPort[0]),t.add(e.problem.routeEndPort[0])),t},PCr=class extends fa{constructor(e,t={}){super(),this.serializedHyperGraph=e,this.options=t}serializedHyperGraph;options;revisedSerializedHyperGraph;report={portUseCounts:{},duplicatedPorts:[]};getDuplicatePortProximity(){return this.options.duplicatePortProximity??0.05}getIndividualRouteSolveOptions(){return{RIP_THRESHOLD_RAMP_ATTEMPTS:0,STATIC_REACHABILITY_PRECHECK:!1,...this.options.routeSolveOptions}}getPortUseCounts(){let{topology:e,problem:t}=cZe(this.serializedHyperGraph);this.options.useSerializedPortPenalties===!1&&(t.portPenalty=void 0);let n=new Map,o;for(let r=0;r<t.routeCount;r++){let i=vCr(t,r);if(o?o.resetForProblem(i):o=new bQ(e,i,this.getIndividualRouteSolveOptions()),o.solve(),!o.solved||o.failed)throw Error(`Route ${r} could not be solved independently: ${o.error??"unknown error"}`);for(let s of SCr(o)){let a=ICr(e,s);n.set(a,(n.get(a)??0)+1)}}return n}duplicateCongestedPorts(e){let t=this.getDuplicatePortProximity();if(!(t>0))throw Error("duplicatePortProximity must be greater than zero");let{solvedRoutes:n,...o}=this.serializedHyperGraph,r=this.serializedHyperGraph.regions.map((d)=>({...d,pointIds:[...d.pointIds],d:S$(d.d)})),i=this.serializedHyperGraph.ports.map((d)=>({...d,d:S$(d.d)})),s=new Map(r.map((d)=>[d.regionId,d])),a=new Map(i.map((d)=>[d.portId,d])),c=((d)=>{let u=new Map;for(let _ of d){let p=tGt(_),m=u.get(p);m?m.push(_):u.set(p,[_])}return u})(this.serializedHyperGraph.ports),l=new Set(i.map((d)=>d.portId)),h=[];for(let[d,u]of[...e.entries()].sort(([_],[p])=>_.localeCompare(p))){if(u<=1)continue;let _=a.get(d);if(!_)continue;let p=u-1,m=c.get(tGt(_));if(!m)throw Error(`No boundary ports found for "${d}"`);let A=yCr(_,m),g=xCr(_,A,s),f=hle(_),y=[];for(let x=1;x<=p;x++){let C=CCr(d,x,l),b=t*x/(p+1),I=ACr(S$(_.d));I.x=f.x+g.x*b,I.y=f.y+g.y*b,I.duplicatedFromPortId=d,I.duplicateIndex=x,I.duplicatePortUseCount=u,I.duplicatePortProximity=t,I.repairReason="congested-port",i.push({..._,portId:C,d:I}),y.push(C)}for(let x of[_.region1Id,_.region2Id]){let C=s.get(x);C&&bCr(C.pointIds,d,y)}h.push({sourcePortId:d,duplicatePortIds:y,useCount:u})}return this.report={portUseCounts:Object.fromEntries([...e.entries()].sort()),duplicatedPorts:h},{...o,regions:r,ports:i,connections:this.serializedHyperGraph.connections===void 0?void 0:S$(this.serializedHyperGraph.connections)}}_setup(){try{let e=this.getPortUseCounts();this.revisedSerializedHyperGraph=this.duplicateCongestedPorts(e),this.stats={...this.stats,duplicateSourcePortCount:this.report.duplicatedPorts.length,duplicatedPortCount:this.report.duplicatedPorts.reduce((t,n)=>t+n.duplicatePortIds.length,0)},this.solved=!0}catch(e){this.failed=!0,this.error=e instanceof Error?e.message:String(e)}}_step(){this.failed||(this.solved=!0)}getOutput(){if(!this.revisedSerializedHyperGraph||this.failed)throw Error("DuplicateCongestedPortSolver does not have a repaired topology output");return this.revisedSerializedHyperGraph}},gXe=(e,t)=>{let n=e.owners.size-t.owners.size;if(n!==0)return n;let o=e.distance-t.distance;return o!==0?o:e.queueOrder-t.queueOrder},ECr=class{heap=[];push(e){this.heap.push(e);let t=this.heap.length-1;for(;t>0;){let n=Math.floor((t-1)/2);if(gXe(this.heap[n],this.heap[t])<=0)break;[this.heap[n],this.heap[t]]=[this.heap[t],this.heap[n]],t=n}}pop(){let e=this.heap[0],t=this.heap.pop();if(!e||!t)return null;if(this.heap.length===0)return e;this.heap[0]=t;let n=0;for(;;){let o=2*n+1,r=o+1,i=n;if(o<this.heap.length&&gXe(this.heap[o],this.heap[i])<0&&(i=o),r<this.heap.length&&gXe(this.heap[r],this.heap[i])<0&&(i=r),i===n)break;[this.heap[n],this.heap[i]]=[this.heap[i],this.heap[n]],n=i}return e}},MCr=(e,t,n)=>{if(e===t)return!0;if(e.size>t.size+n.length)return!1;for(let o of e)if(!t.has(o)&&!n.includes(o))return!1;return!0},wCr=(e,t)=>!(e.distance>t.distance)&&((n,o)=>{if(n.size>o.size)return!1;for(let r of n)if(!o.has(r))return!1;return!0})(e.owners,t.owners),BCr=(e,t)=>{let n=[],o=[],r=e;for(;r!==null;)n.push(r.state),r.incomingHop!==null&&o.push(r.incomingHop),r=r.parent;return n.reverse(),o.reverse(),{found:!0,states:n,hops:o,owners:new Set(e.owners),distance:e.distance,expandedLabelCount:t}},TCr=(e)=>{for(;;){let t=e.pop();if(t===null)return null;if(t.active)return t}},DCr=(e)=>{let t=e.maxExpandedLabels??Number.POSITIVE_INFINITY;if(t!==Number.POSITIVE_INFINITY&&(!Number.isInteger(t)||t<0))throw Error("maxExpandedLabels must be a non-negative integer");if(e.checkReachability){let a=((c,l)=>{let h=[c.start],d=new Set([c.getStateKey(c.start)]),u=0,_=0;for(let p=0;p<h.length;p++){let m=h[p];if(c.isGoal(m))return;if(u>=l)return;u++;for(let A of c.getHops(m)){if(_+=A.distance,A.distance<0||!Number.isFinite(_))return;let g=c.getStateKey(A.state);d.has(g)||(d.add(g),h.push(A.state))}}return{found:!1,reason:"no_path",expandedLabelCount:u}})(e,t);if(a)return a}let n=new Map,o=new ECr,r=0,i=0,s={state:e.start,stateKey:e.getStateKey(e.start),owners:new Set,distance:0,parent:null,incomingHop:null,queueOrder:r++,active:!0};for(n.set(s.stateKey,[s]),o.push(s);;){let a=TCr(o);if(a===null)return{found:!1,reason:"no_path",expandedLabelCount:i};if(e.isGoal(a.state))return BCr(a,i);if(i>=t)return{found:!1,reason:"expansion_limit",expandedLabelCount:i};i++;for(let c of e.getHops(a.state)){if(!Number.isFinite(c.distance)||c.distance<0)throw Error("Distinct-owner blocker hops require finite distances >= 0");let l=a.distance+c.distance;if(!Number.isFinite(l))throw Error("Distinct-owner blocker path distance overflowed");let h=e.getStateKey(c.state),d=r++,u=n.get(h)??[],_=c.owners??[],p=!1;for(let f of u)if(f.distance<=l&&MCr(f.owners,a.owners,_)){p=!0;break}if(p)continue;let m=a.owners;for(let f of _)m.has(f)||(m===a.owners&&(m=new Set(a.owners)),m.add(f));let A={state:c.state,stateKey:h,owners:m,distance:l,parent:a,incomingHop:c,queueOrder:d,active:!0},g=[];for(let f of u)wCr(A,f)?f.active=!1:g.push(f);g.push(A),n.set(A.stateKey,g),o.push(A)}}},Pcn=(e,t)=>{Ccn(e,t),t&&(t.MAX_RIPS!==void 0&&(e.MAX_RIPS=t.MAX_RIPS),t.MAX_RIPS_WITHOUT_MAX_REGION_COST_IMPROVEMENT!==void 0&&(e.MAX_RIPS_WITHOUT_MAX_REGION_COST_IMPROVEMENT=t.MAX_RIPS_WITHOUT_MAX_REGION_COST_IMPROVEMENT),t.EXTRA_RIPS_AFTER_BEATING_BASELINE_MAX_REGION_COST!==void 0&&(e.EXTRA_RIPS_AFTER_BEATING_BASELINE_MAX_REGION_COST=t.EXTRA_RIPS_AFTER_BEATING_BASELINE_MAX_REGION_COST))},Ecn=(e)=>e.map((t)=>t.map(([n,o,r])=>[n,o,r])),NCr=(e)=>({netIds:new Int32Array(e.netIds),lesserAngles:new Int32Array(e.lesserAngles),greaterAngles:new Int32Array(e.greaterAngles),layerMasks:new Int32Array(e.layerMasks),existingCrossingLayerIntersections:e.existingCrossingLayerIntersections,existingSameLayerIntersections:e.existingSameLayerIntersections,existingEntryExitLayerChanges:e.existingEntryExitLayerChanges,existingRegionCost:e.existingRegionCost,existingSegmentCount:e.existingSegmentCount}),zKe=(e)=>({portAssignment:new Int32Array(e.portAssignment),regionSegments:Ecn(e.regionSegments),regionIntersectionCaches:e.regionIntersectionCaches.map(NCr)}),AXe=(e,t)=>{let n=zKe(t);e.state.portAssignment=n.portAssignment,e.state.regionSegments=n.regionSegments,e.state.regionIntersectionCaches=n.regionIntersectionCaches},rGt=(e)=>{let t=0,n=0;for(let o=0;o<e.length;o++){let r=e[o]?.existingRegionCost??0;t=Math.max(t,r),n+=r}return{maxRegionCost:t,totalRegionCost:n}},Mcn=(e,t)=>e.maxRegionCost!==t.maxRegionCost?e.maxRegionCost-t.maxRegionCost:e.totalRegionCost-t.totalRegionCost,RCr=(e,t,n)=>{let o=e.incidentPortRegion[t]??[],r=e.incidentPortRegion[n]??[],i=o.find((s)=>r.includes(s));if(i===void 0)throw Error(`Ports ${t} and ${n} do not share a region`);return i},wcn=(e,t,n,o)=>{let r=n.solvedRoutePathSegments[o]??[],i=n.solvedRoutePathRegionIds?.[o]??[],s=t.routeStartPort[o],a=t.routeEndPort[o];if(r.length===0){if(s===a)return{orderedPortIds:[s],orderedRegionIds:[]};throw Error(`Route ${o} does not have an existing solved path`)}let c=new Map;r.forEach(([p,m],A)=>{let g={segmentIndex:A,fromPortId:p,toPortId:m,regionId:i[A]},f=c.get(p)??[];f.push(g),c.set(p,f);let y=c.get(m)??[];y.push(g),c.set(m,y)});let l=[s],h=[],d=new Set,u,_=s;for(;_!==a||d.size<r.length;){let p=(c.get(_)??[]).filter(({segmentIndex:g,fromPortId:f,toPortId:y})=>{if(d.has(g))return!1;let x=f===_?y:f,C=x===a&&d.size+1===r.length;return x!==u||C}),m=_===a&&d.size===0&&p.length===2||p.length===1?p[0]:void 0;if(!m)throw Error(`Route ${o} is not a single ordered path from ${s} to ${a}`);let A=m.fromPortId===_?m.toPortId:m.fromPortId;d.add(m.segmentIndex),h.push(m.regionId??RCr(e,m.fromPortId,m.toPortId)),l.push(A),u=_,_=A}if(d.size!==r.length)throw Error(`Route ${o} contains disconnected solved segments`);return{orderedPortIds:l,orderedRegionIds:h}},iGt=(e,t,n,o)=>{let r=new bQ(e,t,o);return((i,s)=>{i.state.portAssignment.fill(-1),i.state.regionSegments=Array.from({length:i.topology.regionCount},()=>[]),i.state.regionIntersectionCaches=Array.from({length:i.topology.regionCount},()=>O$()),i.state.currentRouteId=void 0,i.state.currentRouteNetId=void 0,i.state.unroutedRoutes=[],i.state.candidateQueue.clear(),i.resetCandidateBestCosts(),i.state.goalPortId=-1,i.state.ripCount=0,i.state.regionCongestionCost.fill(0);for(let a=0;a<s.length;a++)for(let[c,l,h]of s[a]??[])i.state.currentRouteNetId=i.problem.routeNet[c],i.state.regionSegments[a].push([c,l,h]),i.state.portAssignment[l]=i.state.currentRouteNetId,i.state.portAssignment[h]=i.state.currentRouteNetId,i.appendSegmentToRegionCache(a,l,h);i.state.currentRouteId=void 0,i.state.currentRouteNetId=void 0,i.solved=!0,i.failed=!1,i.error=null})(r,n),r},Bcn=(e,t,n)=>{let o=new Int32Array(t.routeStartPort),r=new Int32Array(t.routeEndPort),i=Array.from({length:t.routeCount},(a,c)=>({routeId:c,fixedSegments:[]})),s=[];for(let a=0;a<t.routeCount;a++){let c=i[a],{orderedPortIds:l,orderedRegionIds:h}=wcn(e,t,n,a),d=[],u;for(let A=0;A<l.length;A++){let g=l[A],f=t.portSectionMask[g]===1;f&&u===void 0?u=A:f||u===void 0||(d.push({startIndex:u,endIndex:A-1}),u=void 0)}if(u!==void 0&&d.push({startIndex:u,endIndex:l.length-1}),d.length===0){for(let A=1;A<l.length;A++)c.fixedSegments.push({regionId:h[A-1],fromPortId:l[A-1],toPortId:l[A]});continue}if(d.length>1)throw Error(`Route ${a} enters the section multiple times; only one contiguous section span is currently supported`);let _=d[0],p=Math.max(0,_.startIndex-1),m=Math.min(l.length-1,_.endIndex+1);if(m<=p)throw Error(`Route ${a} does not have a valid section span`);for(let A=1;A<=p;A++)c.fixedSegments.push({regionId:h[A-1],fromPortId:l[A-1],toPortId:l[A]});for(let A=m+1;A<l.length;A++)c.fixedSegments.push({regionId:h[A-1],fromPortId:l[A-1],toPortId:l[A]});c.activeStartPortId=l[p],c.activeEndPortId=l[m],c.forcedStartRegionId=h[p],o[a]=c.activeStartPortId,r[a]=c.activeEndPortId,s.push(a)}return{sectionProblem:{routeCount:t.routeCount,portSectionMask:new Int8Array(t.portSectionMask),routeMetadata:t.routeMetadata,routeStartPort:o,routeEndPort:r,routeNet:new Int32Array(t.routeNet),regionNetId:new Int32Array(t.regionNetId),portPenalty:t.portPenalty===void 0?void 0:new Float64Array(t.portPenalty)},routePlans:i,activeRouteIds:s}},QCr=(e,t,n)=>Bcn(e,t,n).activeRouteIds,kCr=class extends bQ{constructor(e,t,n,o,r,i,s,a){super(e,t,a),this.routePlans=n,this.activeRouteIds=o,this.mutableRegionIds=r,this.immutableRegionSummary=i,this.baselineSummary=s,Pcn(this,a),this.state.unroutedRoutes=[...o],this.applyFixedSegments(),this.fixedSnapshot=zKe({portAssignment:this.state.portAssignment,regionSegments:this.state.regionSegments,regionIntersectionCaches:this.state.regionIntersectionCaches})}routePlans;activeRouteIds;mutableRegionIds;immutableRegionSummary;baselineSummary;bestSnapshot;fixedSnapshot;bestSummary;baselineBeatRipCount;previousBestMaxRegionCost=Number.POSITIVE_INFINITY;ripsSinceBestMaxRegionCostImprovement=0;MAX_RIPS=Number.POSITIVE_INFINITY;MAX_RIPS_WITHOUT_MAX_REGION_COST_IMPROVEMENT=Number.POSITIVE_INFINITY;EXTRA_RIPS_AFTER_BEATING_BASELINE_MAX_REGION_COST=Number.POSITIVE_INFINITY;applyFixedSegments(){for(let e of this.routePlans)for(let{regionId:t,fromPortId:n,toPortId:o}of e.fixedSegments)this.state.currentRouteNetId=this.problem.routeNet[e.routeId],this.state.regionSegments[t].push([e.routeId,n,o]),this.state.portAssignment[n]=this.state.currentRouteNetId,this.state.portAssignment[o]=this.state.currentRouteNetId,this.appendSegmentToRegionCache(t,n,o);this.state.currentRouteId=void 0,this.state.currentRouteNetId=void 0}captureBestState(e){this.bestSummary&&Mcn(e,this.bestSummary)>=0||(this.bestSummary=e,this.bestSnapshot=zKe({portAssignment:this.state.portAssignment,regionSegments:this.state.regionSegments,regionIntersectionCaches:this.state.regionIntersectionCaches}))}restoreBestState(){this.bestSnapshot&&(AXe(this,this.bestSnapshot),this.state.currentRouteId=void 0,this.state.currentRouteNetId=void 0,this.state.unroutedRoutes=[],this.state.candidateQueue.clear(),this.resetCandidateBestCosts(),this.state.goalPortId=-1)}getStartingNextRegionId(e,t){let n=this.routePlans[e]?.forcedStartRegionId;return n!==void 0?n:super.getStartingNextRegionId(e,t)}resetRoutingStateForRerip(){if(!this.fixedSnapshot)return super.resetRoutingStateForRerip(),this.state.unroutedRoutes=rbe([...this.activeRouteIds],this.state.ripCount),void this.applyFixedSegments();AXe(this,this.fixedSnapshot),this.state.currentRouteId=void 0,this.state.currentRouteNetId=void 0,this.state.unroutedRoutes=rbe([...this.activeRouteIds],this.state.ripCount),this.state.candidateQueue.clear(),this.resetCandidateBestCosts(),this.state.goalPortId=-1}onAllRoutesRouted(){let{state:e}=this,t=Math.min(this.MAX_RIPS,this.RIP_THRESHOLD_RAMP_ATTEMPTS),n=t<=0?1:Math.min(1,e.ripCount/t),o=this.RIP_THRESHOLD_START+(this.RIP_THRESHOLD_END-this.RIP_THRESHOLD_START)*n,r=[],i=new Float64Array(this.mutableRegionIds.length),s=0,a=0;for(let d=0;d<this.mutableRegionIds.length;d++){let u=this.mutableRegionIds[d],_=e.regionIntersectionCaches[u]?.existingRegionCost??0;i[d]=_,s=Math.max(s,_),a+=_,_>o&&r.push(u)}let c=Math.max(this.immutableRegionSummary.maxRegionCost,s),l=this.immutableRegionSummary.totalRegionCost+a;this.captureBestState({maxRegionCost:c,totalRegionCost:l});let h=this.bestSummary??{maxRegionCost:c,totalRegionCost:l};if(h.maxRegionCost<this.previousBestMaxRegionCost-Number.EPSILON?(this.previousBestMaxRegionCost=h.maxRegionCost,this.ripsSinceBestMaxRegionCostImprovement=0):this.ripsSinceBestMaxRegionCostImprovement+=1,this.baselineBeatRipCount===void 0&&h.maxRegionCost<this.baselineSummary.maxRegionCost-Number.EPSILON&&(this.baselineBeatRipCount=e.ripCount),this.stats={...this.stats,activeRouteCount:this.activeRouteIds.length,currentRipThreshold:o,hotRegionCount:r.length,maxRegionCost:c,totalRegionCost:l,bestMaxRegionCost:h.maxRegionCost,bestTotalRegionCost:h.totalRegionCost,ripCount:e.ripCount},r.length===0||e.ripCount>=t||this.ripsSinceBestMaxRegionCostImprovement>=this.MAX_RIPS_WITHOUT_MAX_REGION_COST_IMPROVEMENT||this.baselineBeatRipCount!==void 0&&e.ripCount-this.baselineBeatRipCount>=this.EXTRA_RIPS_AFTER_BEATING_BASELINE_MAX_REGION_COST)return this.restoreBestState(),void(this.solved=!0);for(let d=0;d<this.mutableRegionIds.length;d++){let u=this.mutableRegionIds[d];e.regionCongestionCost[u]+=i[d]*this.RIP_CONGESTION_REGION_COST_FACTOR}e.ripCount+=1,this.resetRoutingStateForRerip(),this.stats={...this.stats,ripCount:e.ripCount,reripRegionCount:r.length}}onOutOfCandidates(){let{state:e}=this;for(let t of this.mutableRegionIds){let n=e.regionIntersectionCaches[t]?.existingRegionCost??0;e.regionCongestionCost[t]+=n*this.RIP_CONGESTION_REGION_COST_FACTOR}e.ripCount+=1,this.resetRoutingStateForRerip(),this.stats={...this.stats,ripCount:e.ripCount,reripReason:"out_of_candidates"}}tryFinalAcceptance(){if(this.bestSnapshot)return this.restoreBestState(),void(this.solved=!0);this.fixedSnapshot&&AXe(this,this.fixedSnapshot),this.state.currentRouteId=void 0,this.state.currentRouteNetId=void 0,this.state.unroutedRoutes=[...this.activeRouteIds],this.state.candidateQueue.clear(),this.resetCandidateBestCosts(),this.state.goalPortId=-1,this.stats={...this.stats,acceptedFixedSectionStateOnTimeout:!0},this.solved=!0}visualize(){return sbe(this,{highlightSectionMask:!0,showInitialRouteHints:!1,showOnlySectionPortsOnIdle:!0})}},dle=class extends fa{constructor(e,t,n,o){super(),this.topology=e,this.problem=t,this.initialSolution=n,Pcn(this,o),this.baselineSolver=((r,i,s,a)=>{let c=Array.from({length:r.regionCount},()=>[]);for(let l=0;l<i.routeCount;l++){let{orderedPortIds:h,orderedRegionIds:d}=wcn(r,i,s,l);for(let u=1;u<h.length;u++){let _=h[u-1],p=h[u];c[d[u-1]].push([l,_,p])}}return iGt(r,i,c,a)})(e,t,n,pCe(this)),this.baselineSummary=rGt(this.baselineSolver.state.regionIntersectionCaches),this.sectionRegionIds=((r,i)=>{let s=new Set;for(let a=0;a<i.portSectionMask.length;a++)if(i.portSectionMask[a]===1)for(let c of r.incidentPortRegion[a]??[])s.add(c);return[...s]})(e,t),this.sectionBaselineSummary=((r,i)=>{let s=0,a=0;for(let c of i){let l=r[c]?.existingRegionCost??0;s=Math.max(s,l),a+=l}return{maxRegionCost:s,totalRegionCost:a}})(this.baselineSolver.state.regionIntersectionCaches,this.sectionRegionIds),this.outsideSectionBaselineSummary=((r,i)=>{let s=new Set(i),a=0,c=0;for(let l=0;l<r.length;l++){if(s.has(l))continue;let h=r[l]?.existingRegionCost??0;a=Math.max(a,h),c+=h}return{maxRegionCost:a,totalRegionCost:c}})(this.baselineSolver.state.regionIntersectionCaches,this.sectionRegionIds),this.applySectionRipPolicy()}topology;problem;initialSolution;baselineSolver;baselineSummary;sectionBaselineSummary;outsideSectionBaselineSummary;sectionRegionIds;optimizedSolver;sectionSolver;activeRouteIds=[];DISTANCE_TO_COST=0.05;minViaPadDiameter=acn;VERBOSE=!1;RIP_THRESHOLD_START=0.05;RIP_THRESHOLD_END=0.8;RIP_THRESHOLD_RAMP_ATTEMPTS=50;MAX_RIPS=Number.POSITIVE_INFINITY;MAX_RIPS_WITHOUT_MAX_REGION_COST_IMPROVEMENT=10;EXTRA_RIPS_AFTER_BEATING_BASELINE_MAX_REGION_COST=10;RIP_CONGESTION_REGION_COST_FACTOR=0.1;MAX_ITERATIONS=1e6;STATIC_REACHABILITY_PRECHECK=!1;STATIC_REACHABILITY_PRECHECK_MAX_HOPS=16;ACCEPT_BEST_SOLUTION_ON_TIMEOUT=!0;GREEDY_FINAL_ROUTE_ITERS=4;applySectionRipPolicy(){this.RIP_THRESHOLD_START=0.05,this.RIP_THRESHOLD_END=Math.max(this.RIP_THRESHOLD_START,this.sectionBaselineSummary.maxRegionCost),this.MAX_RIPS=Math.min(this.MAX_RIPS,20)}_setup(){this.applySectionRipPolicy();let{sectionProblem:e,routePlans:t,activeRouteIds:n}=Bcn(this.topology,this.problem,this.initialSolution);if(this.activeRouteIds=n,n.length===0)return this.optimizedSolver=this.baselineSolver,this.stats={...this.stats,activeRouteCount:0,initialMaxRegionCost:this.baselineSummary.maxRegionCost,finalMaxRegionCost:this.baselineSummary.maxRegionCost,optimized:!1},void(this.solved=!0);var o;this.sectionSolver=new kCr(this.topology,e,t,n,this.sectionRegionIds,this.outsideSectionBaselineSummary,this.baselineSummary,{...pCe(o=this),MAX_RIPS:o.MAX_RIPS,MAX_RIPS_WITHOUT_MAX_REGION_COST_IMPROVEMENT:o.MAX_RIPS_WITHOUT_MAX_REGION_COST_IMPROVEMENT,EXTRA_RIPS_AFTER_BEATING_BASELINE_MAX_REGION_COST:o.EXTRA_RIPS_AFTER_BEATING_BASELINE_MAX_REGION_COST}),this.activeSubSolver=this.sectionSolver,this.stats={...this.stats,sectionBaselineMaxRegionCost:this.sectionBaselineSummary.maxRegionCost,sectionBaselineTotalRegionCost:this.sectionBaselineSummary.totalRegionCost,effectiveRipThresholdStart:this.RIP_THRESHOLD_START,effectiveRipThresholdEnd:this.RIP_THRESHOLD_END,effectiveMaxRips:this.MAX_RIPS}}_step(){if(!this.sectionSolver)return void(this.solved=!0);if(this.sectionSolver.step(),this.stats={...this.stats,...this.sectionSolver.stats,activeRouteCount:this.activeRouteIds.length},this.sectionSolver.failed)return this.optimizedSolver=this.baselineSolver,this.stats={...this.stats,initialMaxRegionCost:this.baselineSummary.maxRegionCost,initialTotalRegionCost:this.baselineSummary.totalRegionCost,finalMaxRegionCost:this.baselineSummary.maxRegionCost,finalTotalRegionCost:this.baselineSummary.totalRegionCost,optimized:!1,sectionSearchFailedFallbackToBaseline:!0,sectionSearchError:this.sectionSolver.error},void(this.solved=!0);if(!this.sectionSolver.solved)return;let e=iGt(this.topology,this.problem,Ecn(this.sectionSolver.state.regionSegments),pCe(this)),t=rGt(e.state.regionIntersectionCaches),n=Mcn(t,this.baselineSummary)<0;this.optimizedSolver=n?e:this.baselineSolver;let o=n?t:this.baselineSummary;this.stats={...this.stats,initialMaxRegionCost:this.baselineSummary.maxRegionCost,initialTotalRegionCost:this.baselineSummary.totalRegionCost,candidateMaxRegionCost:t.maxRegionCost,candidateTotalRegionCost:t.totalRegionCost,finalMaxRegionCost:o.maxRegionCost,finalTotalRegionCost:o.totalRegionCost,optimized:n},this.solved=!0}tryFinalAcceptance(){this.optimizedSolver=this.baselineSolver,this.stats={...this.stats,initialMaxRegionCost:this.baselineSummary.maxRegionCost,initialTotalRegionCost:this.baselineSummary.totalRegionCost,finalMaxRegionCost:this.baselineSummary.maxRegionCost,finalTotalRegionCost:this.baselineSummary.totalRegionCost,optimized:!1,sectionSolverTimeoutFallbackToBaseline:!0},this.solved=!0,this.failed=!1,this.error=null}getSolvedSolver(){if(!this.solved||this.failed||!this.optimizedSolver)throw Error("TinyHyperGraphSectionSolver does not have a solved output yet");return this.optimizedSolver}visualize(){return this.optimizedSolver?sbe(this.optimizedSolver,{highlightSectionMask:!0}):this.sectionSolver?this.sectionSolver.visualize():sbe(this.baselineSolver,{highlightSectionMask:!0,showInitialRouteHints:!1,showOnlySectionPortsOnIdle:!0})}getOutput(){return this.getSolvedSolver().getOutput()}},LCr=["self-touch","onehop-all","onehop-touch","twohop-all","twohop-touch"],HCr={"self-all":0,"self-touch":0,"onehop-all":1,"onehop-touch":1,"twohop-all":2,"twohop-touch":2,"threehop-all":3,"threehop-touch":3,"fourhop-all":4,"fourhop-touch":4},FCr=(e,t)=>{let n=new Set(t);for(let o of t)for(let r of e.regionIncidentPorts[o]??[])for(let i of e.incidentPortRegion[r]??[])n.add(i);return[...n]},zCr=(e,t,n)=>{let o=[...new Set(t)];for(let r=0;r<n;r+=1)o=FCr(e,o);return o},OCr=(e,t,n)=>t.flatMap((o)=>n.map((r)=>((i,s,a)=>({label:`hot-${s}-${a}`,family:a,regionIds:zCr(i,[s],HCr[a]),portSelectionRule:a.endsWith("-all")?"all-incident-regions-selected":"touches-selected-region"}))(e,o,r))),VCr={RIP_THRESHOLD_RAMP_ATTEMPTS:5},YCr={DISTANCE_TO_COST:0.05,RIP_THRESHOLD_RAMP_ATTEMPTS:16,RIP_CONGESTION_REGION_COST_FACTOR:0.1,MAX_ITERATIONS:50000,MAX_RIPS_WITHOUT_MAX_REGION_COST_IMPROVEMENT:6,EXTRA_RIPS_AFTER_BEATING_BASELINE_MAX_REGION_COST:Number.POSITIVE_INFINITY},OKe=(e)=>e.state.regionIntersectionCaches.reduce((t,n)=>Math.max(t,n.existingRegionCost),0),GCr=(e,t)=>{let n=cZe(e),o=new dle(n.topology,n.problem,n.solution,t);return OKe(o.baselineSolver)},UCr=(e,t,n)=>{let o=new Set(t);return Int8Array.from({length:e.portCount},(r,i)=>{let s=e.incidentPortRegion[i]??[];return n==="touches-selected-region"?s.some((a)=>o.has(a))?1:0:s.length>0&&s.every((a)=>o.has(a))?1:0})},WCr=(e,t)=>({routeCount:e.routeCount,portSectionMask:t,routeMetadata:e.routeMetadata,routeStartPort:new Int32Array(e.routeStartPort),routeEndPort:new Int32Array(e.routeEndPort),routeNet:new Int32Array(e.routeNet),regionNetId:new Int32Array(e.regionNetId),portPenalty:e.portPenalty===void 0?void 0:new Float64Array(e.portPenalty)}),XCr=(e,t,n,o,r,i)=>{let s=performance.now(),a=performance.now(),c=new dle(t,n,o,i),l=OKe(c.baselineSolver),h=performance.now()-a,d,u,_=l,p=new Int8Array(t.portCount),m=0,A=0,g=0,f=0,y=0,x=0,C=0,b=new Set,I=r?.maxHotRegions??i.MAX_HOT_REGIONS??2;for(let v of((P,M,B,T)=>{let N=P.state.regionIntersectionCaches.map((D,L)=>({regionId:L,regionCost:D.existingRegionCost})).filter(({regionCost:D})=>D>0).sort((D,L)=>L.regionCost-D.regionCost).slice(0,B).map(({regionId:D})=>D);return OCr(M,N,T)})(e,t,I,r?.candidateFamilies??[...LCr])){let P=WCr(n,UCr(t,v.regionIds,v.portSelectionRule));m+=1;let M=P.portSectionMask.join(",");if(b.has(M))g+=1;else{b.add(M);try{let B=performance.now(),T=QCr(t,P,o);if(f+=performance.now()-B,T.length===0)continue;A+=1;let N=performance.now(),D=new dle(t,P,o,i);y+=performance.now()-N;let L=performance.now();if(D.solve(),x+=performance.now()-L,D.failed||!D.solved)continue;if(Number(D.stats.finalMaxRegionCost??OKe(D.getSolvedSolver()))<_-0.000000001){let H=performance.now(),V=GCr(D.getOutput(),i);C+=performance.now()-H,V<_-0.000000001&&(_=V,p=new Int8Array(P.portSectionMask),d=v.label,u=v.family)}}catch{}}}return{portSectionMask:p,baselineMaxRegionCost:l,finalMaxRegionCost:_,generatedCandidateCount:m,candidateCount:A,duplicateCandidateCount:g,totalMs:performance.now()-s,baselineEvaluationMs:h,candidateEligibilityMs:f,candidateInitMs:y,candidateSolveMs:x,candidateReplayScoreMs:C,winningCandidateLabel:d,winningCandidateFamily:u}},jCr=class extends mS{initialVisualizationSolver;selectedSectionMask;selectedSectionCandidateLabel;selectedSectionCandidateFamily;constructor(e){super(e),this.MAX_ITERATIONS=200000}loadHyperGraph(e){return cZe(e)}getSolveGraphOptions(){return{...VCr,...this.inputProblem.minViaPadDiameter===void 0?{}:{minViaPadDiameter:this.inputProblem.minViaPadDiameter},...this.inputProblem.solveGraphOptions}}getSectionSolverOptions(){return{...YCr,...this.inputProblem.minViaPadDiameter===void 0?{}:{minViaPadDiameter:this.inputProblem.minViaPadDiameter},...this.inputProblem.sectionSolverOptions}}pipelineDef=[{solverName:"solveGraph",solverClass:bQ,getConstructorParams:(e)=>{let{topology:t,problem:n}=e.loadHyperGraph(e.inputProblem.serializedHyperGraph);return[t,n,e.getSolveGraphOptions()]}},{solverName:"optimizeSection",solverClass:dle,getConstructorParams:(e)=>e.getSectionStageParams()}];getSectionStageParams(){let e=this.getStageOutput("solveGraph");if(!e)throw Error("solveGraph did not produce a solved serialized hypergraph");let t=this.getSolver("solveGraph");if(!t)throw Error("solveGraph solver is unavailable");let n=this.getSectionSolverOptions(),{topology:o,problem:r,solution:i}=this.loadHyperGraph(e),s=this.inputProblem.createSectionMask?this.inputProblem.createSectionMask({serializedHyperGraph:this.inputProblem.serializedHyperGraph,solvedSerializedHyperGraph:e,solvedSolver:t,topology:o,problem:r,solution:i}):(()=>{let a=XCr(t,o,r,i,this.inputProblem.sectionSearchConfig,n);return this.selectedSectionCandidateLabel=a.winningCandidateLabel,this.selectedSectionCandidateFamily=a.winningCandidateFamily,this.stats={...this.stats,sectionSearchGeneratedCandidateCount:a.generatedCandidateCount,sectionSearchCandidateCount:a.candidateCount,sectionSearchDuplicateCandidateCount:a.duplicateCandidateCount,sectionSearchBaselineMaxRegionCost:a.baselineMaxRegionCost,sectionSearchFinalMaxRegionCost:a.finalMaxRegionCost,sectionSearchDelta:a.baselineMaxRegionCost-a.finalMaxRegionCost,selectedSectionCandidateLabel:a.winningCandidateLabel??null,selectedSectionCandidateFamily:a.winningCandidateFamily??null,sectionSearchMs:a.totalMs,sectionSearchBaselineEvaluationMs:a.baselineEvaluationMs,sectionSearchCandidateEligibilityMs:a.candidateEligibilityMs,sectionSearchCandidateInitMs:a.candidateInitMs,sectionSearchCandidateSolveMs:a.candidateSolveMs,sectionSearchCandidateReplayScoreMs:a.candidateReplayScoreMs},a.portSectionMask})();return this.selectedSectionMask=new Int8Array(s),r.portSectionMask=new Int8Array(s),this.stats={...this.stats,sectionMaskPortCount:[...s].filter((a)=>a===1).length},[o,r,i,n]}getInitialVisualizationSolver(){if(!this.initialVisualizationSolver){let{topology:e,problem:t}=this.loadHyperGraph(this.inputProblem.serializedHyperGraph);this.initialVisualizationSolver=new bQ(e,t,this.getSolveGraphOptions())}return this.initialVisualizationSolver}initialVisualize(){return this.getInitialVisualizationSolver().visualize()}visualize(){return this.iterations===0?this.initialVisualize()??super.visualize():super.visualize()}getOutput(){return this.getStageOutput("optimizeSection")??this.getStageOutput("solveGraph")??null}tryFinalAcceptance(){this.getStageOutput("solveGraph")&&(this.stats={...this.stats,acceptedSolveGraphOutputOnSectionPipelineTimeout:!0},this.activeSubSolver=void 0,this.solved=!0,this.failed=!1,this.error=null)}};var Tcn=class extends _Cr{costAwareFinalReripBudget=8;failedOwnerPairCounts=new Map;selectiveReripStats={selectiveRipCount:0,selectivelyRippedRouteCount:0,globalReripCount:0,alternateBlockerSearchCount:0,alternateOwnerCount:0,failedOwnerPairCount:0,maxFailedOwnerPairCount:0,failedOwnerPairs:[],lastDirectOwnerRouteIds:[],lastRepeatedOwnerRouteIds:[],lastAlternateOwnerRouteIds:[],lastRippedRouteIds:[],lastRelaxedSearchExpandedLabelCount:0,lastAlternateSearchExpandedLabelCount:0};selectiveReripCongestionUpdateCount=0;constructor(e,t,n){super(e,t,n)}getSelectiveReripStats(){return{...this.selectiveReripStats,failedOwnerPairs:this.selectiveReripStats.failedOwnerPairs.map((e)=>({...e})),lastDirectOwnerRouteIds:[...this.selectiveReripStats.lastDirectOwnerRouteIds],lastRepeatedOwnerRouteIds:[...this.selectiveReripStats.lastRepeatedOwnerRouteIds],lastAlternateOwnerRouteIds:[...this.selectiveReripStats.lastAlternateOwnerRouteIds],lastRippedRouteIds:[...this.selectiveReripStats.lastRippedRouteIds]}}createGreedyFinalRouteSolver(e,t){if(t>=0)return super.createGreedyFinalRouteSolver(e,t);let n=new KCr(this.topology,this.problem,{...e,MAX_ITERATIONS:Math.max(e.MAX_ITERATIONS??50000,2*this.MAX_ITERATIONS)});return n.remainingReripBudget=this.costAwareFinalReripBudget-this.state.ripCount,n}onOutOfCandidates(){let e=this.state.currentRouteId;if(e===void 0)throw Error("SelectiveReripTinyHyperGraphSolver: candidate search exhausted without a current route");let t=this.findRelaxedBlockerPathPreferringPreservedRoutes();if(!t.found||t.owners.size===0)return this.selectiveReripStats.globalReripCount+=1,this.selectiveReripStats.globalReripReason=t.found?"no_blocker_path":t.reason,this.selectiveReripStats.lastFailedRouteId=e,this.selectiveReripStats.lastDirectOwnerRouteIds=[],this.selectiveReripStats.lastRepeatedOwnerRouteIds=[],this.selectiveReripStats.lastAlternateOwnerRouteIds=[],this.selectiveReripStats.lastRippedRouteIds=[],this.selectiveReripStats.lastRelaxedSearchExpandedLabelCount=t.expandedLabelCount,this.selectiveReripStats.lastAlternateSearchExpandedLabelCount=0,super.onOutOfCandidates(),void this.publishSelectiveReripStats();let n=[...t.owners],o=[];for(let c of n)this.incrementFailedOwnerPair(e,c)>=2&&o.push(c);if(n.some((c)=>this.hasFailedOwnerPath(c,e)))return this.selectiveReripStats.globalReripCount+=1,this.selectiveReripStats.globalReripReason="failed_owner_cycle",this.selectiveReripStats.lastFailedRouteId=e,this.selectiveReripStats.lastDirectOwnerRouteIds=n,this.selectiveReripStats.lastRepeatedOwnerRouteIds=o,this.selectiveReripStats.lastAlternateOwnerRouteIds=[],this.selectiveReripStats.lastRippedRouteIds=[],this.selectiveReripStats.lastRelaxedSearchExpandedLabelCount=t.expandedLabelCount,this.selectiveReripStats.lastAlternateSearchExpandedLabelCount=0,this.failedOwnerPairCounts.clear(),super.onOutOfCandidates(),void this.publishSelectiveReripStats();let r;if(o.length>0&&(this.selectiveReripStats.alternateBlockerSearchCount+=1,r=this.findRelaxedBlockerPathPreferringPreservedRoutes(new Set(o)),!r.found))return this.selectiveReripStats.globalReripCount+=1,this.selectiveReripStats.globalReripReason=r.reason,this.selectiveReripStats.lastFailedRouteId=e,this.selectiveReripStats.lastDirectOwnerRouteIds=n,this.selectiveReripStats.lastRepeatedOwnerRouteIds=o,this.selectiveReripStats.lastAlternateOwnerRouteIds=[],this.selectiveReripStats.lastRippedRouteIds=[],this.selectiveReripStats.lastRelaxedSearchExpandedLabelCount=t.expandedLabelCount,this.selectiveReripStats.lastAlternateSearchExpandedLabelCount=r.expandedLabelCount,super.onOutOfCandidates(),void this.publishSelectiveReripStats();let i=r?.found?[...r.owners]:void 0,s=function(c){let l=new Set(c.alternateOwnerRouteIds??c.directOwnerRouteIds);if(l.delete(c.failedRouteId),l.size===0)throw Error(`SelectiveReripTinyHyperGraphSolver: route ${c.failedRouteId} has blocker resources but no distinct committed owner can be reripped`);return l}({failedRouteId:e,directOwnerRouteIds:n,alternateOwnerRouteIds:i});this.clearPartialRipPlans(s);let a=(i??[]).filter((c)=>!t.owners.has(c));this.selectiveReripCongestionUpdateCount<1&&(this.addCongestionCostForSelectiveRerip(),this.selectiveReripCongestionUpdateCount+=1),this.rebuildCommittedState(s),this.state.ripCount+=1,this.state.currentRouteId=void 0,this.state.currentRouteNetId=void 0,this.state.unroutedRoutes=function(c){let l=c.pendingRouteIds.filter((d)=>d!==c.failedRouteId&&!c.rippedRouteIds.has(d)),h=[...c.rippedRouteIds].filter((d)=>d!==c.failedRouteId);return[c.failedRouteId,...l,...h]}({failedRouteId:e,pendingRouteIds:this.state.unroutedRoutes,rippedRouteIds:s}),this.state.candidateQueue.clear(),this.resetCandidateBestCosts(),this.state.goalPortId=-1,this.selectiveReripStats.selectiveRipCount+=1,this.selectiveReripStats.selectivelyRippedRouteCount+=s.size,this.selectiveReripStats.alternateOwnerCount+=a.length,this.selectiveReripStats.lastFailedRouteId=e,this.selectiveReripStats.lastDirectOwnerRouteIds=n,this.selectiveReripStats.lastRepeatedOwnerRouteIds=o,this.selectiveReripStats.lastAlternateOwnerRouteIds=a,this.selectiveReripStats.lastRippedRouteIds=[...s],this.selectiveReripStats.lastRelaxedSearchExpandedLabelCount=t.expandedLabelCount,this.selectiveReripStats.lastAlternateSearchExpandedLabelCount=r?.expandedLabelCount??0,this.publishSelectiveReripStats()}addCongestionCostForSelectiveRerip(){for(let e=0;e<this.topology.regionCount;e++){let t=this.state.regionIntersectionCaches[e]?.existingRegionCost??0;this.state.regionCongestionCost[e]+=t*this.RIP_CONGESTION_REGION_COST_FACTOR}}findRelaxedBlockerPath(e=new Set){let t=this.state.currentRouteId,n=this.state.currentRouteNetId;if(t===void 0||n===void 0)throw Error("SelectiveReripTinyHyperGraphSolver: blocker search requires a current route and net");let o=this.getRouteStartPortId(t),r=this.getRouteEndPortId(t),i=this.getStartingNextRegionId(t,o);if(i===void 0)throw Error(`SelectiveReripTinyHyperGraphSolver: route ${this.describeRoute(t)} has no starting region for blocker search`);let s=this.getPortOwners(),a=new Map,c=new Map,l=new Map;return DCr({start:{portId:o,nextRegionId:i},getStateKey:({portId:h,nextRegionId:d})=>this.getHopId(h,d),isGoal:({portId:h})=>h===r,getHops:(h)=>{let d=this.getHopId(h.portId,h.nextRegionId),u=l.get(d);if(u)return u;let _=this.getRelaxedSearchHops({state:h,goalPortId:r,routeNetId:n,portOwners:s,portResources:a,hopTemplatesByRegion:c,forbiddenOwnerRouteIds:e});return l.set(d,_),_},maxExpandedLabels:this.getRelaxedSearchExpansionLimit(),checkReachability:!0})}findRelaxedBlockerPathPreferringPreservedRoutes(e=new Set){let t=this.getRouteIdsPreferredForPreservation();if(t.size===0)return this.findRelaxedBlockerPath(e);let n=new Set(e);for(let r of t)n.add(r);let o=this.findRelaxedBlockerPath(n);return o.found&&o.owners.size>0?o:this.findRelaxedBlockerPath(e)}getRelaxedSearchExpansionLimit(){let e=0;for(let n of this.topology.incidentPortRegion)e+=n.length;let t=Math.max(4,Math.ceil(Math.log2(this.problem.routeCount+1)));return Math.max(4096,e*t*4)}getRelaxedSearchHops(e){let{state:t,goalPortId:n,routeNetId:o}=e;if(this.isRegionReservedForDifferentNet(t.nextRegionId))return[];if(!e.buildRegionTemplates&&!this.isKnownSingleLayerRegion(t.nextRegionId)){let i=e.hopTemplatesByRegion.get(t.nextRegionId);i||(i=this.getRelaxedSearchHops({...e,buildRegionTemplates:!0}),e.hopTemplatesByRegion.set(t.nextRegionId,i));let s=[];for(let a of i)a.state.portId!==t.portId&&s.push({state:a.state,owners:a.owners,data:a.data,distance:Math.hypot(this.topology.portX[t.portId]-this.topology.portX[a.state.portId],this.topology.portY[t.portId]-this.topology.portY[a.state.portId])});return s}let r=[];for(let i of this.topology.regionIncidentPorts[t.nextRegionId]??[]){if(i===t.portId&&!e.buildRegionTemplates)continue;if(this.isPortReservedForDifferentNet(i))continue;if(i!==n&&this.problem.portSectionMask[i]===0)continue;let s=this.getHopBlockerResources({regionId:t.nextRegionId,fromPortId:t.portId,toPortId:i,routeNetId:o,portOwners:e.portOwners,portResources:e.portResources}),a=[];for(let l of s)for(let h of l.owners)a.includes(h)||a.push(h);if(a.some((l)=>e.forbiddenOwnerRouteIds.has(l)))continue;let c=t.nextRegionId;if(i!==n){let[l,h]=this.topology.incidentPortRegion[i]??[];if(c=l===t.nextRegionId?h:l,c===void 0||this.isRegionReservedForDifferentNet(c))continue}r.push({state:{portId:i,nextRegionId:c},distance:Math.hypot(this.topology.portX[t.portId]-this.topology.portX[i],this.topology.portY[t.portId]-this.topology.portY[i]),owners:a,data:{resources:s}})}return r}getHopBlockerResources(e){let t=[],n=this.state.portAssignment[e.toPortId];if(n!==-1&&n!==e.routeNetId){let r=e.portResources.get(e.toPortId);if(!r){let i=[...e.portOwners.get(e.toPortId)??new Set].filter((s)=>this.problem.routeNet[s]!==e.routeNetId);if(i.length===0)throw Error(`SelectiveReripTinyHyperGraphSolver: port ${e.toPortId} is assigned to foreign net ${n} without a committed route owner`);r={kind:"port",portId:e.toPortId,owners:i},e.portResources.set(e.toPortId,r)}t.push(r)}let o=this.getHardBlockedCrossingOwners(e.regionId,e.fromPortId,e.toPortId);return o.length>0&&t.push({kind:"same_layer_intersection",regionId:e.regionId,fromPortId:e.fromPortId,toPortId:e.toPortId,owners:o}),t}getPortOwners(){let e=new Map;for(let t of this.state.regionSegments)for(let[n,o,r]of t)for(let i of[o,r]){let s=e.get(i)??new Set;s.add(n),e.set(i,s)}return e}getHardBlockedCrossingOwners(e,t,n){if(!this.isKnownSingleLayerRegion(e))return[];let o=this.state.currentRouteNetId;if(o===void 0)throw Error("SelectiveReripTinyHyperGraphSolver: crossing ownership requires a current route net");let r=new Set;for(let[i,s,a]of this.state.regionSegments[e]??[])this.problem.routeNet[i]!==o&&this.segmentsCrossOnSameLayer(e,t,n,s,a)&&r.add(i);return[...r]}segmentsCrossOnSameLayer(e,t,n,o,r){let i=this.populateSegmentGeometryScratch(e,t,n),{lesserAngle:s,greaterAngle:a,layerMask:c}=i,l=this.populateSegmentGeometryScratch(e,o,r);if((c&l.layerMask)===0)return!1;if(s===l.lesserAngle||s===l.greaterAngle||a===l.lesserAngle||a===l.greaterAngle)return!1;return(s<l.lesserAngle&&l.lesserAngle<a)!==(s<l.greaterAngle&&l.greaterAngle<a)}rebuildCommittedState(e){this.state.regionSegments=this.state.regionSegments.map((t)=>t.filter(([n])=>!e.has(n))),this.state.portAssignment.fill(-1),this.state.regionIntersectionCaches=Array.from({length:this.topology.regionCount},()=>O$());for(let t=0;t<this.state.regionSegments.length;t++)for(let[n,o,r]of this.state.regionSegments[t]){let i=this.problem.routeNet[n];this.state.currentRouteNetId=i;for(let s of[o,r]){let a=this.state.portAssignment[s];if(a!==-1&&a!==i)throw Error(`SelectiveReripTinyHyperGraphSolver: rebuilding committed routes found cross-net ownership at port ${s} between net ${a} and net ${i}`);this.state.portAssignment[s]=i}this.appendSegmentToRegionCache(t,o,r)}this.state.currentRouteNetId=void 0}incrementFailedOwnerPair(e,t){let n=this.failedOwnerPairCounts.get(e)??new Map,o=(n.get(t)??0)+1;return n.set(t,o),this.failedOwnerPairCounts.set(e,n),o}hasFailedOwnerPath(e,t){let n=[e],o=new Set;for(;n.length>0;){let r=n.pop();if(r===t)return!0;o.has(r)||(o.add(r),n.push(...this.failedOwnerPairCounts.get(r)?.keys()??[]))}return!1}publishSelectiveReripStats(){let e=[];for(let[t,n]of this.failedOwnerPairCounts)for(let[o,r]of n)e.push({failedRouteId:t,ownerRouteId:o,count:r});e.sort((t,n)=>t.failedRouteId-n.failedRouteId||t.ownerRouteId-n.ownerRouteId),this.selectiveReripStats.failedOwnerPairs=e,this.selectiveReripStats.failedOwnerPairCount=e.length,this.selectiveReripStats.maxFailedOwnerPairCount=Math.max(0,...e.map(({count:t})=>t)),this.stats={...this.stats,...this.getSelectiveReripStats()}}describeRoute(e){let t=this.problem.routeMetadata?.[e]?.connectionId;return t===void 0?String(e):`${e} (${String(t)})`}},KCr=class extends Tcn{remainingReripBudget=0;onOutOfCandidates(){super.onOutOfCandidates(),this.state.ripCount>=this.remainingReripBudget&&(this.failed=!0,this.error="Congestion-aware final routing exhausted its rerip budget")}};new Int32Array(0);var sGt=class extends Tcn{initialAssignmentRouteIds;getRouteIdsPreferredForPreservation(){return this.initialAssignmentRouteIds||(this.initialAssignmentRouteIds=new Set((this.problem.initialAssignments??[]).map((e)=>e.routeId))),this.initialAssignmentRouteIds}resetRoutingStateForRerip(){super.resetRoutingStateForRerip(),this.problem.initialAssignments?.length&&LKe({topology:this.topology,problem:this.problem,state:this.state,routeSuccessCountByRouteId:this.routeSuccessCountByRouteId,appendSegmentToRegionCache:(e,t,n)=>this.appendSegmentToRegionCache(e,t,n)})}},rQ=(e)=>{if(typeof e!="object"||e===null)return!1;let t=e,n=t.preloadedTraceSection;return typeof t.connectionId=="string"&&typeof n?.traceId=="string"&&typeof n.startRoutePosition=="number"&&typeof n.endRoutePosition=="number"&&typeof n.startPoint?.x=="number"&&typeof n.startPoint.y=="number"&&typeof n.startPoint.z=="number"&&typeof n.endPoint?.x=="number"&&typeof n.endPoint.y=="number"&&typeof n.endPoint.z=="number"},$Cr=(e,t)=>`__tscircuit_preloaded_trace__:${JSON.stringify([e,t])}`,VKe=(e)=>[e.region1Id,e.region2Id],aGt=(e,t)=>{let n=new Set(VKe(t));return VKe(e).filter((o)=>n.has(o))},qCr=(e,t,n)=>{let o=e[t],r=e[t+1],i=aGt(o.port,r.port);if(i.length===0)return;if(i.length===1)return i[0];let s=e[t+2];if(s){let a=new Set(aGt(r.port,s.port)),c=i.find((l)=>a.has(l));if(c)return c}return n&&i.includes(n)?n:[...i].sort()[0]},cGt=(e,t)=>VKe(e).find((n)=>n!==t)??t,Dcn=(e)=>{let t=new Set((e.connections??[]).filter(rQ).map((r)=>r.connectionId)),n=e.ports.filter((r)=>(r.d?._preloadedTracePortAssignments?.length??0)>0).length,o=e.regions.reduce((r,i)=>r+(i.assignments??[]).filter((s)=>t.has(s.connectionId)).length,0);return{preloadedTraceCount:t.size,preloadedPortCount:n,preloadedAssignmentCount:o}},lGt=(e)=>typeof e=="object"&&e!==null?e:{},fXe=(e)=>typeof e=="object"&&e!==null?e:{},T3e=0.000001,YKe={DISTANCE_TO_COST:0.05,RIP_THRESHOLD_START:0.05,RIP_THRESHOLD_END:0.8,RIP_CONGESTION_REGION_COST_FACTOR:0.1,ACCEPT_BEST_SOLUTION_ON_TIMEOUT:!0,GREEDY_FINAL_ROUTE_ITERS:4,PARTIAL_RIP_MIN_ROUTE_COUNT:100,PARTIAL_RIP_MAX_ROUTE_COUNT:350,PARTIAL_RIP_MAX_ATTEMPTS:7,PARTIAL_RIP_WARMUP_FULL_RIP_ATTEMPTS:1,PARTIAL_RIP_COMPLEXITY_SELECTION_MIN_ROUTE_COUNT:100,PARTIAL_RIP_TARGET_MAX_COST_IMPROVEMENT_RATIO:0.02,PARTIAL_RIP_MAX_REGION_COST_GROWTH_RATIO:0.05,PARTIAL_RIP_MAX_TOTAL_COST_GROWTH_RATIO:0.1},JCr={DISTANCE_TO_COST:0.05,RIP_THRESHOLD_START:0.05,RIP_THRESHOLD_END:0.8,RIP_CONGESTION_REGION_COST_FACTOR:0.1,ACCEPT_BEST_SOLUTION_ON_TIMEOUT:!0,GREEDY_FINAL_ROUTE_ITERS:4,MAX_RIPS_WITHOUT_MAX_REGION_COST_IMPROVEMENT:6,EXTRA_RIPS_AFTER_BEATING_BASELINE_MAX_REGION_COST:Number.POSITIVE_INFINITY},lZe=(e)=>Math.max(e,0.01),hZe=(e)=>Number.isFinite(e)?{minViaPadDiameter:e}:{},ZCr=(e,t)=>{let n=lZe(e);return{...YKe,...hZe(t),OWNED_REGIONAL_HOP_FRONTIER:!0,USE_SPARSE_CANDIDATE_STORAGE:!1,RIP_THRESHOLD_RAMP_ATTEMPTS:Math.ceil(10*n),MAX_ITERATIONS:Math.ceil(2000000*n)}},ebr=(e,t)=>{let n=lZe(e);return{...JCr,...hZe(t),USE_SPARSE_CANDIDATE_STORAGE:!1,RIP_THRESHOLD_RAMP_ATTEMPTS:Math.ceil(16*n),MAX_ITERATIONS:Math.ceil(1e6*n)}},Ncn=(e)=>(e.solveGraphOptions?.MAX_ITERATIONS??1e6)+(e.sectionSolverOptions?.MAX_ITERATIONS??1e6)+1e6,tbr=(e)=>e.mutuallyConnectedNetworkId,GKe=(e,t)=>e.simpleRouteConnection?.pointsToConnect[t],hGt=(e)=>{let t=GKe(e.routeMetadata,e.endpointIndex);if(!t)return e.fallbackZ;let n=zx(t).map((o)=>ti(o,e.layerCount));return e.regionAvailableZ.find((o)=>n.includes(o))??e.fallbackZ},nbr=(e,t)=>{let n=e.d,o=n.bounds;return{capacityMeshNodeId:e.d.capacityMeshNodeId,center:{x:e.d.center.x,y:e.d.center.y},width:e.d.width,height:e.d.height,availableZ:[...e.d.availableZ],...o?{bounds:{minX:o.minX,maxX:o.maxX,minY:o.minY,maxY:o.maxY}}:{},_containsObstacle:e.d._containsObstacle,_containsTarget:e.d._containsTarget,_offBoardConnectionId:e.d._offBoardConnectionId,_offBoardConnectedCapacityMeshNodeIds:e.d._offBoardConnectedCapacityMeshNodeIds===void 0?void 0:[...e.d._offBoardConnectedCapacityMeshNodeIds],_qfpRegionType:n._qfpRegionType,_isNarrowQfpPadGap:n._isNarrowQfpPadGap,...t!==void 0?{netId:t}:{}}},obr=(e)=>{let t=e.d;return{portId:e.d.portId,x:e.d.x,y:e.d.y,z:e.d.z,prevPortPointId:t.prevPortPointId,nextPortPointId:t.nextPortPointId,distToCentermostPortOnZ:e.d.distToCentermostPortOnZ,tinyHypergraphPortPenalty:e.d.tinyHypergraphPortPenalty,cramped:e.d.cramped,_preloadedFixedNetIds:e.d._preloadedFixedNetIds,_preloadedTracePortAssignments:e.d._preloadedTracePortAssignments}},rbr=(e)=>{let t=function(){let l=new Map;return(h)=>{let d=h.mutuallyConnectedNetworkId,u=l.get(d);return u===void 0&&(u=l.size,l.set(d,u)),u}}(),n=function(l){let h=new Map,d=new Set,u=new Map;for(let p of l.params.connections){let m=p.mutuallyConnectedNetworkId,A=l.getNetIndex({connectionId:p.connectionId,mutuallyConnectedNetworkId:m});for(let g of[p.connectionId,m])u.set(g,A);for(let g of p.simpleRouteConnection.pointsToConnect){let f=rZe({point:g,layerCount:l.params.layerCount});for(let y of l.params.graph.regions){if(!Uan({point:g,region:y,layerCount:l.params.layerCount,pointZLayers:f}))continue;if(g.pcb_port_id===void 0&&y.d._containsTarget!==!0){d.add(y.regionId);continue}let x=h.get(y.regionId);x||(x=new Set,h.set(y.regionId,x)),x.add(A)}}}for(let p of l.params.graph.regions)for(let m of p.d._connectedTo??[]){let A=u.get(m);if(A===void 0)continue;let g=h.get(p.regionId);g||(g=new Set,h.set(p.regionId,g)),g.add(A)}let _=new Map;for(let p of d)_.set(p,-1);for(let[p,m]of h)m.size===1&&_.set(p,[...m][0]);return _}({params:e,getNetIndex:t}),o=e.graph.regions.map((l)=>({regionId:l.regionId,pointIds:l.ports.map((h)=>h.d.portId),d:nbr(l,n.get(l.regionId))})),r=new Map;for(let l of o)r.has(l.regionId)||r.set(l.regionId,l);let i=e.graph.ports.map((l)=>({portId:l.d.portId,region1Id:l.region1.regionId,region2Id:l.region2.regionId,d:obr(l)})),s=e.connections.map((l)=>({connectionId:l.connectionId,mutuallyConnectedNetworkId:l.mutuallyConnectedNetworkId,startRegionId:l.startRegion.regionId,endRegionId:l.endRegion.regionId,simpleRouteConnection:l.simpleRouteConnection})),a=[];for(let l of e.connections){let h={connectionId:l.connectionId,mutuallyConnectedNetworkId:l.mutuallyConnectedNetworkId,simpleRouteConnection:l.simpleRouteConnection},d=t(h),u=GKe(h,0),_=GKe(h,1),p=l.startRegion.d.availableZ[0]??0,m=l.endRegion.d.availableZ[0]??0,A=hGt({routeMetadata:h,endpointIndex:0,fallbackZ:p,regionAvailableZ:l.startRegion.d.availableZ,layerCount:e.layerCount}),g=hGt({routeMetadata:h,endpointIndex:1,fallbackZ:m,regionAvailableZ:l.endRegion.d.availableZ,layerCount:e.layerCount}),f=`tiny-terminal:start-region:${l.connectionId}`,y=`tiny-terminal:end-region:${l.connectionId}`,x=`tiny-terminal:start-port:${l.connectionId}`,C=`tiny-terminal:end-port:${l.connectionId}`;o.push({regionId:f,pointIds:[x],d:{capacityMeshNodeId:f,center:{x:u?.x??l.startRegion.d.center.x,y:u?.y??l.startRegion.d.center.y},width:T3e,height:T3e,availableZ:[A],_containsTarget:!0,_tinyTerminal:!0,_tinyTerminalNetId:l.mutuallyConnectedNetworkId,netId:d}}),o.push({regionId:y,pointIds:[C],d:{capacityMeshNodeId:y,center:{x:_?.x??l.endRegion.d.center.x,y:_?.y??l.endRegion.d.center.y},width:T3e,height:T3e,availableZ:[g],_containsTarget:!0,_tinyTerminal:!0,_tinyTerminalNetId:l.mutuallyConnectedNetworkId,netId:d}}),i.push({portId:x,region1Id:l.startRegion.regionId,region2Id:f,d:{portId:x,x:u?.x??l.startRegion.d.center.x,y:u?.y??l.startRegion.d.center.y,z:A,distToCentermostPortOnZ:0,_tinyTerminal:!0,...e.preserveTerminalPcbPortIds&&u?.pcb_port_id?{pcb_port_id:u.pcb_port_id}:{}}}),i.push({portId:C,region1Id:l.endRegion.regionId,region2Id:y,d:{portId:C,x:_?.x??l.endRegion.d.center.x,y:_?.y??l.endRegion.d.center.y,z:g,distToCentermostPortOnZ:0,_tinyTerminal:!0,...e.preserveTerminalPcbPortIds&&_?.pcb_port_id?{pcb_port_id:_.pcb_port_id}:{}}});let b=r.get(l.startRegion.regionId),I=r.get(l.endRegion.regionId);b?.pointIds.push(x),I?.pointIds.push(C),a.push({connection:{connectionId:l.connectionId},path:[{portId:x},{portId:C}]})}let c={regions:o,ports:i,connections:s,solvedRoutes:a};return((l)=>{let h=new Map,d=new Map,u=new Set((l.connections??[]).flatMap((x)=>[x.startRegionId,x.endRegionId])),_=new Set(l.regions.filter((x)=>{let C=typeof x.d?.netId=="number"?x.d.netId:typeof x.d?.NetId=="number"?x.d.NetId:void 0;return x.d?._containsObstacle===!0&&(C===void 0||C===-1)&&!u.has(x.regionId)}).map((x)=>x.regionId)),p=0;for(let x of l.ports){let C=x.d,b=C?._preloadedTracePortAssignments??[];if(b.length>0&&p++,!_.has(x.region1Id)&&!_.has(x.region2Id))for(let I of b){let v=d.get(I.traceId);if(v!==void 0&&v!==I.fixedNetId)throw Error(`Preloaded trace "${I.traceId}" maps to multiple canonical nets`);d.set(I.traceId,I.fixedNetId);let P=h.get(I.traceId)??[];P.push({port:x,assignment:I}),h.set(I.traceId,P)}}let m=new Map(l.regions.map((x)=>[x.regionId,x])),A=l.connections??=[],g=l.solvedRoutes??=[],f=0,y=0;for(let[x,C]of h){C.sort((M,B)=>M.assignment.routePosition-B.assignment.routePosition||M.assignment.z-B.assignment.z||M.port.portId.localeCompare(B.port.portId));let b=C.filter(({port:M},B)=>B===0||M.portId!==C[B-1].port.portId);if(b.length<2)continue;let I=[],v;for(let M=0;M<b.length-1;M++){let B=b[M],T=b[M+1];if(B.assignment.z===T.assignment.z&&Math.abs(B.assignment.routePosition-T.assignment.routePosition)<=0.000001){v=void 0;continue}let N=qCr(b,M,v);N?(I.push({regionId:N,from:B,to:T}),v=N):v=void 0}let P=[];for(let M of I){let B=P.at(-1);B&&B.at(-1).to.port.portId===M.from.port.portId?B.push(M):P.push([M])}for(let[M,B]of P.entries()){let T=$Cr(x,M);for(let O of B){let U=m.get(O.regionId);if(!U)throw Error(`Preloaded trace "${x}" references missing region "${O.regionId}"`);U.assignments=[...U.assignments??[],{regionPort1Id:O.from.port.portId,regionPort2Id:O.to.port.portId,connectionId:T}],y++}let N=B[0],D=B.at(-1),L=N.from.port,H=D.to.port,V={connectionId:T,mutuallyConnectedNetworkId:d.get(x)??x,startRegionId:cGt(L,N.regionId),endRegionId:cGt(H,D.regionId),preloadedTraceSection:{traceId:x,startRoutePosition:N.from.assignment.routePosition,endRoutePosition:D.to.assignment.routePosition,startPoint:{x:N.from.assignment.tracePoint.x,y:N.from.assignment.tracePoint.y,z:N.from.assignment.z},endPoint:{x:D.to.assignment.tracePoint.x,y:D.to.assignment.tracePoint.y,z:D.to.assignment.z}}};A.push(V),g.push({requiredRip:!1,connection:V,path:[L,H].map((O)=>({portId:O.portId,g:0,h:0,f:0,hops:0,ripRequired:!1}))})}P.length>0&&f++}})(c),c},dGt=(e)=>{let t=new Map;for(let n=0;n<e.problem.routeNet.length;n++){let o=e.problem.routeMetadata?.[n],r=o?.mutuallyConnectedNetworkId;if(typeof r!="string"||r.length===0)throw Error(`Tiny hypergraph route ${n} is missing a net ID`);t.set(r,e.problem.routeNet[n])}for(let n=0;n<e.problem.regionNetId.length;n++){let o=e.topology.regionMetadata?.[n]?._tinyTerminalNetId;if(typeof o!="string")continue;let r=t.get(o);r!==void 0&&(e.problem.regionNetId[n]=r)}},uGt=(e)=>{let t=new Map;e.topology.regionMetadata?.forEach((o,r)=>{typeof o.serializedRegionId=="string"&&t.set(o.serializedRegionId,r)});let n=new Set;for(let o of e.problem.routeMetadata??[])rQ(o)||(typeof o.startRegionId=="string"&&n.add(o.startRegionId),typeof o.endRegionId=="string"&&n.add(o.endRegionId));for(let o of e.problem.routeMetadata??[])if(rQ(o))for(let r of[o.startRegionId,o.endRegionId]){if(typeof r!="string"||n.has(r))continue;let i=t.get(r);if(i===void 0)continue;let s=e.topology.regionMetadata?.[i];typeof s?.netId=="number"||typeof s?.NetId=="number"||(e.problem.regionNetId[i]=-1)}},pGt=(e)=>{if(e.problem.metadataPortPenaltiesApplied)return 0;let t=0,n=e.problem.portPenalty!==void 0;for(let r=0;r<e.topology.portCount;r++){let i=Number(e.topology.portMetadata?.[r]?.tinyHypergraphPortPenalty),s=Number.isFinite(i)&&i>0?i:0;s>0&&t++,e.problem.portPenalty?.[r]!==s&&(n=!1)}if(n)return e.problem.metadataPortPenaltiesApplied=!0,t;t=0;let o=e.problem.portPenalty?new Float64Array(e.problem.portPenalty):new Float64Array(e.topology.portCount);for(let r=0;r<e.topology.portCount;r++){let i=Number(e.topology.portMetadata?.[r]?.tinyHypergraphPortPenalty);!Number.isFinite(i)||i<=0||(o[r]+=i,t++)}return t>0&&(e.problem.portPenalty=o),e.problem.metadataPortPenaltiesApplied=!0,t},mGt=class extends jCr{configuredSolvers=new WeakSet;duplicatePortPenaltyCount=0;metadataPortPenaltyCount=0;crampedPortPenaltyCount=0;preloadedPortCount=0;preloadedFixedSegmentCount=0;crampedPortTraversalPenalty;useSelectiveReripRouting;constructor(e,t){super(e),this.useSelectiveReripRouting=t,this.crampedPortTraversalPenalty=150;let n=Dcn(e.serializedHyperGraph);if(this.preloadedPortCount=n.preloadedPortCount,this.preloadedFixedSegmentCount=n.preloadedAssignmentCount,t){let o=this.pipelineDef.find((r)=>r.solverName==="solveGraph");if(!o)throw Error("Tiny hypergraph pipeline is missing the solveGraph stage");o.solverClass=sGt}this.MAX_ITERATIONS=Ncn(e)}loadHyperGraph(e){let t=super.loadHyperGraph(e);((i,s)=>{let a=new Map;for(let c of s.connections??[])rQ(c)&&a.set(c.connectionId,c.preloadedTraceSection);for(let c of i.problem.routeMetadata??[]){let l=a.get(c.connectionId);l&&(c.preloadedTraceSection=l)}})(t,this.inputProblem.serializedHyperGraph);let n=pGt(t),{duplicatePortPenaltyCount:o,crampedPortPenaltyCount:r}=((i,s)=>{let a=0,c=0,l=i.problem.portPenalty?new Float64Array(i.problem.portPenalty):new Float64Array(i.topology.portCount);for(let h=0;h<i.topology.portCount;h++){let d=i.topology.portMetadata?.[h];typeof d?.duplicatedFromPortId=="string"&&(l[h]+=150,a++),d?.cramped&&s>0&&(l[h]+=s,c++)}return(a>0||c>0)&&(i.problem.portPenalty=l),{duplicatePortPenaltyCount:a,crampedPortPenaltyCount:c}})(t,this.crampedPortTraversalPenalty);return dGt(t),uGt(t),this.metadataPortPenaltyCount=Math.max(this.metadataPortPenaltyCount,n),this.duplicatePortPenaltyCount=Math.max(this.duplicatePortPenaltyCount,o),this.crampedPortPenaltyCount=Math.max(this.crampedPortPenaltyCount,r),t}_step(){super._step(),this.configureSolver(this.activeSubSolver)}getInitialVisualizationSolver(){if(this.useSelectiveReripRouting&&!this.initialVisualizationSolver){let{topology:t,problem:n}=this.loadHyperGraph(this.inputProblem.serializedHyperGraph);this.initialVisualizationSolver=new sGt(t,n,this.getSolveGraphOptions())}let e=super.getInitialVisualizationSolver();return this.configureSolver(e),e}getSolvedTinySolver(){let e=this.getSolver("optimizeSection");if(e?.solved&&!e.failed)return e.getSolvedSolver();let t=this.getSolver("solveGraph");if(t?.solved&&!t.failed)return t;throw Error("TinyHyperGraph section pipeline does not have a solved graph")}configureSolver(e){if(e&&!this.configuredSolvers.has(e)){if(e instanceof dle||e instanceof bQ){let t=e;pGt(t),dGt(t),uGt(t)}this.configuredSolvers.add(e)}}},A6e=class extends Kr{constructor(e){super(),this.params=e;let t=((d)=>d.map((u)=>{let _=u.simpleRouteConnection;if(!_)throw Error(`TinyHypergraphPortPointPathingSolver requires a SimpleRouteConnection for "${u.connectionId}"`);let p=u.mutuallyConnectedNetworkId;if(!p)throw Error(`TinyHypergraphPortPointPathingSolver requires a net ID for "${u.connectionId}"`);return{...u,mutuallyConnectedNetworkId:p,simpleRouteConnection:_}}))(e.connections),n=e.flags.USE_SELECTIVE_RERIP_ROUTING?function(d,u){let _=new Map;for(let p of d){let m=u(p);_.set(m,(_.get(m)??0)+1)}return d.map((p,m)=>({connection:p,index:m})).sort((p,m)=>(_.get(u(m.connection))??0)-(_.get(u(p.connection))??0)||p.index-m.index).map(({connection:p})=>p)}(t,tbr):t;this.rootConnectionNameByConnectionId=new Map(n.map((d)=>[d.connectionId,d.simpleRouteConnection.__rootConnectionNames?.[0]]));let o=rbr({...e,connections:n});this.originalPreloadedSegmentKeysByConnectionId=((d)=>{let u=new Map;for(let _ of d.connections??[])rQ(_)&&u.set(_.connectionId,new Set);for(let _ of d.regions)for(let p of _.assignments??[]){let m=u.get(p.connectionId);if(!m)continue;let[A,g]=[p.regionPort1Id,p.regionPort2Id].sort();m.add(JSON.stringify([_.regionId,A,g]))}return u})(o);let r=Dcn(o),i=r.preloadedPortCount>0,s=i&&e.flags.USE_PARTIAL_RIP_ROUTING_WITH_PRELOADED_TRACES===!0,a=s?Math.max(o.connections?.length??0,r.preloadedAssignmentCount):void 0,c=o,l=new PCr(o,{duplicatePortProximity:0.05,useSerializedPortPenalties:!1,routeSolveOptions:{...hZe(e.minViaPadDiameter),USE_SPARSE_CANDIDATE_STORAGE:!1,ACCEPT_BEST_SOLUTION_ON_TIMEOUT:!0,GREEDY_FINAL_ROUTE_ITERS:4,MAX_ITERATIONS:Math.ceil(2000000*lZe(e.effort)),RIP_THRESHOLD_RAMP_ATTEMPTS:0,STATIC_REACHABILITY_PRECHECK:!0}});if(l.solve(),l.failed)this.duplicateCongestedPortError=l.error??"unknown error";else{this.duplicateCongestedPortReport=l.report,c=l.getOutput();for(let d of c.ports){let u=fXe(d.d);typeof u.duplicatedFromPortId=="string"&&(delete u._preloadedFixedNetIds,delete u._preloadedTracePortAssignments)}}this.duplicatedPortCount=this.duplicateCongestedPortReport?.duplicatedPorts.reduce((d,u)=>d+u.duplicatePortIds.length,0)??0;let h=((d,u,_,p=!0,m)=>{let A=d.connections?.length??0,g=m??A,f=YKe.PARTIAL_RIP_MIN_ROUTE_COUNT??0,y=YKe.PARTIAL_RIP_MAX_ROUTE_COUNT??Number.POSITIVE_INFINITY,x=p&&g>=f&&g<=y;return{serializedHyperGraph:d,createSectionMask:({topology:C})=>new Int8Array(C.portCount),solveGraphOptions:{...ZCr(u,_),...x?{PARTIAL_RIP_MIN_ROUTE_COUNT:0,PARTIAL_RIP_MAX_ROUTE_COUNT:Number.POSITIVE_INFINITY,PARTIAL_RIP_COMPLEXITY_SELECTION_MIN_ROUTE_COUNT:0}:{PARTIAL_RIP_ENABLED:!1,OUTSIDE_IN_ROUTING:!1}},sectionSolverOptions:ebr(u,_)}})({...c,solvedRoutes:o.solvedRoutes},e.effort,e.minViaPadDiameter,!i||s,a);this.tinyPipelineSolver=new mGt(h,e.flags.USE_SELECTIVE_RERIP_ROUTING===!0),this.primaryTinyPipelineSolver=this.tinyPipelineSolver,n.length>=30&&n.length<=99&&(this.alternativeTinyPipelineInput={...h,solveGraphOptions:{...h.solveGraphOptions,TRACE_DENSITY_COST_FACTOR:1}}),this.MAX_ITERATIONS=Ncn(h)*(this.alternativeTinyPipelineInput?2:1),this.originalRegionById=new Map(e.graph.regions.map((d)=>[d.regionId,d])),this.originalRegionIds=new Set(this.originalRegionById.keys()),this.inputNodeWithPortPoints=((d,u)=>{let _=new Map(u.regions.map((m)=>[m.regionId,m])),p=new Map(u.ports.map((m)=>[m.portId,m]));return d.graph.regions.map((m)=>{let A=_.get(m.regionId),g=(A?.pointIds??m.ports.map((f)=>f.d.portId)).map((f)=>p.get(f)).filter((f)=>f&&!fXe(f.d)._tinyTerminal).map((f)=>{let y=f,x=fXe(y.d),C=_.get(y.region1Id),b=_.get(y.region2Id),I=Boolean(lGt(C?.d)._offBoardConnectionId??lGt(b?.d)._offBoardConnectionId);return{portPointId:y.portId,x:Number(x.x??0),y:Number(x.y??0),z:Number(x.z??0),prevPortPointId:typeof x.prevPortPointId=="string"?x.prevPortPointId:void 0,nextPortPointId:typeof x.nextPortPointId=="string"?x.nextPortPointId:void 0,connectionNodeIds:[y.region1Id,y.region2Id],distToCentermostPortOnZ:Number(x.distToCentermostPortOnZ??0),cramped:Boolean(x.cramped),connectsToOffBoardNode:I}});return{capacityMeshNodeId:m.d.capacityMeshNodeId,center:m.d.center,width:m.d.width,height:m.d.height,portPoints:g,availableZ:m.d.availableZ,_containsObstacle:m.d._containsObstacle,_containsTarget:m.d._containsTarget,_offBoardConnectionId:m.d._offBoardConnectionId,_offBoardConnectedCapacityMeshNodeIds:m.d._offBoardConnectedCapacityMeshNodeIds,_qfpRegionType:m.d._qfpRegionType,_isNarrowQfpPadGap:m.d._isNarrowQfpPadGap}})})(e,c),Object.defineProperty(this,"stats",{configurable:!0,enumerable:!0,get:()=>this.getStatsSnapshot(),set:(d)=>{this.statsSnapshot=d,this.statsSnapshotDirty=!1}})}params;tinyPipelineSolver;primaryTinyPipelineSolver;alternativeTinyPipelineSolver;alternativeTinyPipelineInput;candidatePortfolioPhase="primary";primaryCandidateSummary;alternativeCandidateSummary;alternativeCandidateEvaluated=!1;selectedCandidate="primary";duplicateCongestedPortReport;duplicateCongestedPortError;duplicatedPortCount=0;inputNodeWithPortPoints;originalRegionById;originalRegionIds;rootConnectionNameByConnectionId;originalPreloadedSegmentKeysByConnectionId;statsSnapshot={};statsSnapshotDirty=!1;getSolverName(){return"TinyHypergraphPortPointPathingSolver"}getChangedPreloadedRouteIds(e){let t=new Map,n=new Map;for(let r=0;r<e.problem.routeCount;r++){let i=this.getRouteMetadata(e,r);rQ(i)&&(t.set(i.connectionId,r),n.set(r,new Set))}for(let r=0;r<e.state.regionSegments.length;r++){let i=e.topology.regionMetadata?.[r]?.serializedRegionId;for(let[s,a,c]of e.state.regionSegments[r]??[]){let l=n.get(s);if(!l)continue;let h=e.topology.portMetadata?.[a]?.serializedPortId,d=e.topology.portMetadata?.[c]?.serializedPortId;if(typeof i!="string"||typeof h!="string"||typeof d!="string")throw Error(`Tiny hypergraph preloaded route ${s} has a segment without serialized topology IDs`);let[u,_]=[h,d].sort();l.add(JSON.stringify([i,u,_]))}}let o=new Set;for(let[r,i]of this.originalPreloadedSegmentKeysByConnectionId){let s=t.get(r);if(s===void 0)throw Error(`Tiny hypergraph lost preloaded trace section "${r}"`);let a=n.get(s);if(i.size>0&&a.size===0)throw Error(`Tiny hypergraph lost preloaded trace section "${r}"`);(i.size!==a.size||[...i].some((c)=>!a.has(c)))&&o.add(s)}return o}summarizePipelineCandidate(e){let t=e.getSolvedTinySolver(),n=0,o=0,r=0,i=0,s=0,a=0,c=t.topology.regionMetadata??[];for(let l=0;l<t.state.regionSegments.length;l++){let h=t.state.regionSegments[l];s+=h.length;for(let[,g,f]of h)t.topology.portZ[g]!==t.topology.portZ[f]&&(a+=1);let d=c[l]?.capacityMeshNodeId;if(!d||!this.originalRegionIds.has(d))continue;let u=this.originalRegionById.get(d);if(!u||h.length===0)continue;let _=h.map(([g,f,y])=>[this.createAssignedPortPoint(t,g,f),this.createAssignedPortPoint(t,g,y)]),p={capacityMeshNodeId:u.d.capacityMeshNodeId,center:u.d.center,width:u.d.width,height:u.d.height,portPoints:_.flat(),portPointsInPairs:_,availableZ:u.d.availableZ},m=o_(p),A=ly(u.d,m.numSameLayerCrossings,m.numEntryExitLayerChanges,m.numTransitionPairCrossings);n+=A,o+=A*A,r=Math.max(r,A),i+=p.portPoints.length**2}return{nodePfSum:n,nodePfSquaredSum:o,nodePfMax:r,squaredNodePortPointCount:i,segmentCount:s,layerChangeCount:a,changedPreloadedTraceSectionCount:this.getChangedPreloadedRouteIds(t).size}}shouldEvaluateAlternative(e){let t=this.primaryTinyPipelineSolver.getSolvedTinySolver().problem.routeCount;return this.alternativeTinyPipelineInput!==void 0&&((n,o)=>n.nodePfSum>4&&n.nodePfMax>1&&n.squaredNodePortPointCount/Math.max(1,o)>=125)(e,t)}shouldSelectAlternative(e,t){return((n,o,r)=>{if(o.changedPreloadedTraceSectionCount>n.changedPreloadedTraceSectionCount)return!1;let i=r>40?0.92:0.95,s=o.nodePfSum<=0.9*n.nodePfSum&&o.nodePfSquaredSum<=0.85*n.nodePfSquaredSum&&o.nodePfMax<=0.85*n.nodePfMax&&o.squaredNodePortPointCount<0.98*n.squaredNodePortPointCount&&o.segmentCount<=0.97*n.segmentCount;return o.nodePfSum<=1.03*n.nodePfSum&&o.nodePfSquaredSum<=1.06*n.nodePfSquaredSum&&(o.squaredNodePortPointCount<n.squaredNodePortPointCount*i||s)})(e,t,this.primaryTinyPipelineSolver.getSolvedTinySolver().problem.routeCount)}finishCandidatePortfolio(){this.candidatePortfolioPhase="complete",this.solved=this.tinyPipelineSolver.solved,this.failed=this.tinyPipelineSolver.failed,this.error=this.tinyPipelineSolver.error??null}getSolveGraphBenchmarkMetrics(){let e=this.tinyPipelineSolver.getSolver("solveGraph");if(!e)return;let t=e.state.regionSegments.map((i)=>i.length),n=this.selectedCandidate==="alternative"?this.alternativeCandidateSummary:this.primaryCandidateSummary,o=e.stats,r=this.tinyPipelineSolver.getStageStats().solveGraph;return{routeCount:e.problem.routeCount,traceDensityCandidateEvaluated:this.alternativeCandidateEvaluated,traceDensityCandidateSelected:this.selectedCandidate==="alternative",downstreamNodePfSum:n?.nodePfSum,downstreamNodePfSquaredSum:n?.nodePfSquaredSum,downstreamNodePfMax:n?.nodePfMax,downstreamSquaredNodePortPointCount:n?.squaredNodePortPointCount,changedPreloadedTraceSectionCount:n?.changedPreloadedTraceSectionCount,iterations:e.iterations,timeMs:r?.timeSpent,ripCount:o.ripCount,partialRipCount:o.partialRipCount,partiallyRippedRouteCount:o.partiallyRippedRouteCount,partiallyRippedSegmentCount:o.partiallyRippedSegmentCount,retainedPartialRipSegmentCount:o.retainedPartialRipSegmentCount,firstMaxRegionCost:o.firstMaxRegionCost,bestMaxRegionCost:o.bestMaxRegionCost,firstTotalRegionCost:o.firstTotalRegionCost,bestTotalRegionCost:o.bestTotalRegionCost,firstSegmentCount:o.firstSegmentCount,bestSolvedSegmentCount:o.bestSolvedSegmentCount,bestSolvedMaxRegionSegmentCount:o.bestSolvedMaxRegionSegmentCount,bestSolvedSquaredRegionSegmentCount:o.bestSolvedSquaredRegionSegmentCount,finalMaxRegionSegmentCount:Math.max(0,...t),finalSquaredRegionSegmentCount:t.reduce((i,s)=>i+s*s,0),finalSegmentCount:n?.segmentCount,finalLayerChangeCount:n?.layerChangeCount,warmupFullRipAttempts:o.partialRipWarmupFullRipAttempts,complexityAwareSelection:o.partialRipComplexityAwareSelection,targetReached:o.partialRipTargetReached,outsideInCompletedRouteCount:o.outsideInCompletedRouteCount,outsideInFallbackRouteCount:o.outsideInFallbackRouteCount,outsideInForwardExpansionCount:o.outsideInForwardExpansionCount,outsideInReverseExpansionCount:o.outsideInReverseExpansionCount}}_step(){this.tinyPipelineSolver.step(),this.candidatePortfolioPhase==="primary"&&this.primaryTinyPipelineSolver.failed?(this.alternativeTinyPipelineInput=void 0,this.finishCandidatePortfolio()):this.candidatePortfolioPhase==="primary"&&this.primaryTinyPipelineSolver.solved?(this.primaryCandidateSummary=this.summarizePipelineCandidate(this.primaryTinyPipelineSolver),this.shouldEvaluateAlternative(this.primaryCandidateSummary)?(this.alternativeCandidateEvaluated=!0,this.alternativeTinyPipelineSolver=new mGt(this.alternativeTinyPipelineInput,this.params.flags.USE_SELECTIVE_RERIP_ROUTING===!0),this.tinyPipelineSolver=this.alternativeTinyPipelineSolver,this.candidatePortfolioPhase="alternative"):(this.alternativeTinyPipelineInput=void 0,this.finishCandidatePortfolio())):this.candidatePortfolioPhase==="alternative"&&(this.tinyPipelineSolver.solved||this.tinyPipelineSolver.failed)&&(this.tinyPipelineSolver.solved&&!this.tinyPipelineSolver.failed&&(this.alternativeCandidateSummary=this.summarizePipelineCandidate(this.tinyPipelineSolver)),this.alternativeCandidateSummary&&this.primaryCandidateSummary&&this.shouldSelectAlternative(this.primaryCandidateSummary,this.alternativeCandidateSummary)?(this.selectedCandidate="alternative",this.primaryTinyPipelineSolver=void 0,this.alternativeTinyPipelineSolver=void 0):(this.tinyPipelineSolver=this.primaryTinyPipelineSolver,this.alternativeTinyPipelineSolver=void 0),this.alternativeTinyPipelineInput=void 0,this.finishCandidatePortfolio()),this.solved=this.candidatePortfolioPhase==="complete"&&this.tinyPipelineSolver.solved,this.failed=this.candidatePortfolioPhase==="complete"&&this.tinyPipelineSolver.failed,this.error=this.failed?this.tinyPipelineSolver.error??null:null,this.progress=this.candidatePortfolioPhase==="complete"?1:this.candidatePortfolioPhase==="alternative"?0.5+0.5*this.tinyPipelineSolver.progress:this.alternativeTinyPipelineInput?0.5*this.tinyPipelineSolver.progress:this.tinyPipelineSolver.progress,this.statsSnapshotDirty=!0,this.activeSubSolver=this.tinyPipelineSolver.activeSubSolver??null}getStatsSnapshot(){if(!this.statsSnapshotDirty)return this.statsSnapshot;let e=this.tinyPipelineSolver.getSolver("optimizeSection"),t=this.getCurrentTinySolver();return this.statsSnapshot={duplicateCongestedPortSourceCount:this.duplicateCongestedPortReport?.duplicatedPorts.length??0,duplicateCongestedPortCount:this.duplicatedPortCount,duplicateCongestedPortFallbackToOriginal:Boolean(this.duplicateCongestedPortError),duplicateCongestedPortPenalty:this.duplicatedPortCount>0?150:0,duplicateCongestedPortPenaltyCount:this.tinyPipelineSolver.duplicatePortPenaltyCount,metadataPortPenaltyCount:this.tinyPipelineSolver.metadataPortPenaltyCount,crampedPortPenalty:this.tinyPipelineSolver.crampedPortTraversalPenalty,crampedPortPenaltyCount:this.tinyPipelineSolver.crampedPortPenaltyCount,preloadedPortCount:this.tinyPipelineSolver.preloadedPortCount,preloadedFixedSegmentCount:this.tinyPipelineSolver.preloadedFixedSegmentCount,duplicateCongestedPortError:this.duplicateCongestedPortError,candidatePortfolioPhase:this.candidatePortfolioPhase,candidatePortfolioSelectedCandidate:this.selectedCandidate,candidatePortfolioPrimarySummary:this.primaryCandidateSummary,candidatePortfolioAlternativeSummary:this.alternativeCandidateSummary,...this.tinyPipelineSolver.stats??{},...t?.stats??{},...e?.stats??{},currentStage:this.tinyPipelineSolver.getCurrentStageName(),stageStats:this.tinyPipelineSolver.getStageStats()},this.statsSnapshotDirty=!1,this.statsSnapshot}preview(){return this.visualize()}getCurrentTinySolver(){let e=this.tinyPipelineSolver.getSolver("optimizeSection");if(e?.solved&&!e.failed)return e.getSolvedSolver();return this.tinyPipelineSolver.getSolver("solveGraph")||void 0}getSolvedTinySolver(){return this.tinyPipelineSolver.getSolvedTinySolver()}getRouteMetadata(e,t){return e.problem.routeMetadata?.[t]}createAssignedPortPoint(e,t,n){let o=this.getRouteMetadata(e,t),r=o?((a)=>a.simpleRouteConnection?.name??a.connectionId)(o):`route-${t}`,i=o?this.rootConnectionNameByConnectionId.get(o.connectionId)??o.mutuallyConnectedNetworkId:void 0,s=e.topology.portMetadata?.[n];return{portPointId:String(s?.serializedPortId??s?.portId??`tiny-port-${n}`),x:e.topology.portX[n],y:e.topology.portY[n],z:e.topology.portZ[n],connectionName:r,rootConnectionName:i,...this.params.preserveTerminalPcbPortIds&&typeof s?.pcb_port_id=="string"?{pcb_port_id:s.pcb_port_id}:{},prevPortPointId:typeof s?.prevPortPointId=="string"?s.prevPortPointId:void 0,nextPortPointId:typeof s?.nextPortPointId=="string"?s.nextPortPointId:void 0}}getOutput(){let e=this.getSolvedTinySolver(),t=[],n=e.state.regionSegments,o=e.topology.regionMetadata??[],r=this.getChangedPreloadedRouteIds(e);for(let s=0;s<n.length;s++){let a=o[s]?.capacityMeshNodeId;if(!a||!this.originalRegionIds.has(a))continue;let c=this.originalRegionById.get(a);if(!c)continue;let l=n[s].filter(([d])=>{let u=this.getRouteMetadata(e,d);return!rQ(u)||r.has(d)}).map(([d,u,_])=>{let p=this.createAssignedPortPoint(e,d,u),m=this.createAssignedPortPoint(e,d,_);return p.portPointId&&m.portPointId&&(p.nextPortPointId=m.portPointId,m.prevPortPointId=p.portPointId),[p,m]}),h=l.flat();h.length!==0&&t.push({capacityMeshNodeId:c.d.capacityMeshNodeId,center:c.d.center,width:c.d.width,height:c.d.height,portPoints:h,portPointsInPairs:l,availableZ:c.d.availableZ})}let i=[...r].map((s)=>{let a=this.getRouteMetadata(e,s);if(!rQ(a))throw Error(`Changed preloaded hypergraph route ${s} is missing section metadata`);let c=a.preloadedTraceSection;return{connectionName:a.connectionId,traceId:c.traceId,startRoutePosition:c.startRoutePosition,endRoutePosition:c.endRoutePosition,connection:{name:a.connectionId,__rootConnectionNames:[a.mutuallyConnectedNetworkId],pointsToConnect:[{x:c.startPoint.x,y:c.startPoint.y,layer:Nh(c.startPoint.z,this.params.layerCount)},{x:c.endPoint.x,y:c.endPoint.y,layer:Nh(c.endPoint.z,this.params.layerCount)}]}}});return this.stats.changedPreloadedTraceSectionCount=i.length,{nodesWithPortPoints:t,inputNodeWithPortPoints:this.inputNodeWithPortPoints,changedPreloadedTraceSections:i}}computeNodePf(e){let t=this.getOutput().nodesWithPortPoints.find((n)=>n.capacityMeshNodeId===e.capacityMeshNodeId);return this.computeSolvedNodePf(e.capacityMeshNodeId,t)}computeNodePfMap(){let e=new Map(this.getOutput().nodesWithPortPoints.map((t)=>[t.capacityMeshNodeId,t]));return new Map(this.inputNodeWithPortPoints.map((t)=>[t.capacityMeshNodeId,this.computeSolvedNodePf(t.capacityMeshNodeId,e.get(t.capacityMeshNodeId))]))}computeSolvedNodePf(e,t){let n=this.originalRegionById.get(e);if(!t||!n)return null;let o=o_(t);return ly(n.d,o.numSameLayerCrossings,o.numEntryExitLayerChanges,o.numTransitionPairCrossings)}tryFinalAcceptance(){}getConstructorParams(){return[this.params]}visualize(){return this.tinyPipelineSolver.visualize()}},Bae=(e,t)=>{if(!e||e==="none")return e;try{let n=qO(e);return`rgba(${n.red},${n.green},${n.blue},${t})`}catch{return Qi(e,1-t)}},Bw=({srj:e,opacity:t=0.25,visualizationOptions:n={}})=>{let o=py({...e,obstacles:[]},n);return{...o,points:[],lines:o.lines?.map((r)=>({...r,strokeColor:Bae(r.strokeColor,t)})),rects:o.rects?.map((r)=>({...r,fill:Bae(r.fill,t),stroke:Bae(r.stroke,t)})),circles:o.circles?.map((r)=>({...r,fill:Bae(r.fill,t),stroke:Bae(r.stroke,t)}))}};function WO(e,t,n,o){if(su(e,t,n,o))return 0;let r=D3e(e,n,o),i=D3e(t,n,o),s=D3e(n,e,t),a=D3e(o,e,t);return Math.min(r,i,s,a)}function D3e(e,t,n){let o={x:n.x-t.x,y:n.y-t.y},r=_Gt({x:e.x-t.x,y:e.y-t.y},o);if(r<=0)return yXe(e,t);let i=_Gt(o,o);if(i<=r)return yXe(e,n);let s=r/i;return yXe(e,{x:t.x+s*o.x,y:t.y+s*o.y})}function _Gt(e,t){return e.x*t.x+e.y*t.y}function yXe(e,t){let n=t.x-e.x,o=t.y-e.y;return Math.sqrt(n*n+o*o)}function xXe(e,t){return e.x>=t.center.x-t.width/2&&e.x<=t.center.x+t.width/2&&e.y>=t.center.y-t.height/2&&e.y<=t.center.y+t.height/2}var abe=0.000001,UKe=(e,t,n)=>oc(e,t,n)<=abe,N3e=(e,t)=>Math.abs(e.x-t.x)<=abe&&Math.abs(e.y-t.y)<=abe,CXe=(e,t)=>{if(!t||t.length<3)return!1;for(let o=0;o<t.length;o++){let r=t[o],i=t[(o+1)%t.length];if(UKe(e,r,i))return!0}let n=!1;for(let o=0,r=t.length-1;o<t.length;r=o++){let i=t[o],s=t[r];i.y>e.y!=s.y>e.y&&e.x<(s.x-i.x)*(e.y-i.y)/(s.y-i.y)+i.x&&(n=!n)}return n},bXe="escape-via:",k4=0.0001,ibr=(e)=>e.obstacleId??[e.layers.join("."),e.center.x.toFixed(4),e.center.y.toFixed(4),e.width.toFixed(4),e.height.toFixed(4)].join(":"),gGt=(e,t,n=0.0001)=>Dn(e,t)<=n,f6e=class extends Kr{constructor(e,t={}){super(),this.ogSrj=e,this.viaDiameter=t.viaDiameter??Pp(e).padDiameter,this.viaRadius=this.viaDiameter/2,this.minTraceWidth=t.minTraceWidth??e.minTraceWidth,this.obstacleMargin=t.obstacleMargin??e.defaultObstacleMargin??0.15,this.requiredViaToPadClearance=Math.max(this.obstacleMargin,e.minViaEdgeToPadEdgeClearance??0),this.escapeOffset=this.viaRadius+Math.max(this.minTraceWidth/2,this.requiredViaToPadClearance),this.requiredTraceClearance=this.minTraceWidth/2+this.obstacleMargin/2,this.requiredViaToViaClearance=this.viaDiameter+this.obstacleMargin,this.outputSrj=e,this.escapeViaMetadataByPointId=new Map,this.createdEscapeVias=[]}ogSrj;getSolverName(){return"EscapeViaLocationSolver"}viaDiameter;viaRadius;minTraceWidth;obstacleMargin;escapeOffset;requiredTraceClearance;requiredViaToPadClearance;requiredViaToViaClearance;outputSrj;escapeViaMetadataByPointId;createdEscapeVias;nextEscapeViaIndex=0;getConnectionNetIds(e){return new Set([e.name,...e.__rootConnectionNames??[],e.__netConnectionName].filter((t)=>Boolean(t)))}obstacleMatchesConnectionNet(e,t){return e.connectedTo.some((n)=>t.has(n))}getObstacleZs(e){return e.__zLayers&&e.__zLayers.length>0?e.__zLayers:e.layers.map((t)=>ti(t,this.ogSrj.layerCount))}getViaSpanLayers(e,t){let n=ti(e,this.ogSrj.layerCount),o=ti(t,this.ogSrj.layerCount),r=Math.min(n,o),i=Math.max(n,o),s=Array.from({length:i-r+1},(a,c)=>r+c);return{__zLayers:s,layers:s.map((a)=>Nh(a,this.ogSrj.layerCount))}}createEscapeViaObstacle(e){let{escapeVia:t,connectionNetIds:n}=e,{layers:o,__zLayers:r}=this.getViaSpanLayers(t.sourceLayer,t.targetLayer);return{obstacleId:`escape-via-obstacle:${t.pointId}`,type:"rect",layers:o,__zLayers:r,center:{x:t.x,y:t.y},width:this.viaDiameter,height:this.viaDiameter,connectedTo:Array.from(n)}}selectSourceObstacle(e){let{point:t,sourceLayer:n,connectionNetIds:o}=e;return this.ogSrj.obstacles.filter((r)=>!r.isCopperPour&&r.layers.includes(n)&&xXe(t,r)).sort((r,i)=>{let s=r.connectedTo.includes(t.pointId??"")||r.connectedTo.includes(t.pcb_port_id??"")||this.obstacleMatchesConnectionNet(r,o);return s!==(i.connectedTo.includes(t.pointId??"")||i.connectedTo.includes(t.pcb_port_id??"")||this.obstacleMatchesConnectionNet(i,o))?s?-1:1:r.width*r.height-i.width*i.height})[0]}getCandidatePositions(e,t){if(!t)return this.dedupeCandidatePositions([{x:e.x+this.escapeOffset,y:e.y},{x:e.x-this.escapeOffset,y:e.y},{x:e.x,y:e.y+this.escapeOffset},{x:e.x,y:e.y-this.escapeOffset},{x:e.x+this.escapeOffset,y:e.y+this.escapeOffset},{x:e.x+this.escapeOffset,y:e.y-this.escapeOffset},{x:e.x-this.escapeOffset,y:e.y+this.escapeOffset},{x:e.x-this.escapeOffset,y:e.y-this.escapeOffset}]);let n=t.center.x-t.width/2,o=t.center.x+t.width/2,r=t.center.y-t.height/2,i=t.center.y+t.height/2,s=n-this.escapeOffset,a=o+this.escapeOffset,c=r-this.escapeOffset,l=i+this.escapeOffset,h=this.getEdgeSamples(r,i,e.y),d=this.getEdgeSamples(n,o,e.x),u=[];for(let _ of h)u.push({x:s,y:_},{x:a,y:_});for(let _ of d)u.push({x:_,y:c},{x:_,y:l});return this.dedupeCandidatePositions(u)}dedupeCandidatePositions(e){let t=[];for(let n of e)t.some((o)=>gGt(o,n))||t.push(n);return t}pushEdgeSample(e,t,n,o){let r=Math.max(n,Math.min(o,t));e.some((i)=>Math.abs(i-r)<=k4)||e.push(r)}getEdgeSamples(e,t,n){let o=[],r=t-e;if(this.pushEdgeSample(o,n,e,t),r<=k4)return o;this.pushEdgeSample(o,e,e,t),this.pushEdgeSample(o,t,e,t),this.pushEdgeSample(o,(e+t)/2,e,t);let i=Math.max(e,Math.min(t,n)),s=Math.max(this.requiredViaToViaClearance,k4),a=Math.ceil(r/s);for(let c=1;c<=a;c++){let l=c*s;this.pushEdgeSample(o,i+l,e,t),this.pushEdgeSample(o,i-l,e,t)}return o}isInsideBoard(e){return e.x>=this.ogSrj.bounds.minX+this.viaRadius&&e.x<=this.ogSrj.bounds.maxX-this.viaRadius&&e.y>=this.ogSrj.bounds.minY+this.viaRadius&&e.y<=this.ogSrj.bounds.maxY-this.viaRadius&&(!(this.ogSrj.outline&&this.ogSrj.outline.length>=3)||CXe(e,this.ogSrj.outline))}hasClearEscapePath(e){let{sourcePoint:t,candidate:n,sourceLayer:o,sourceObstacle:r}=e;if(this.ogSrj.outline&&this.ogSrj.outline.length>=3){if((({start:i,end:s,polygon:a,margin:c=0.2})=>{if(!a||a.length<3)return!1;let l=CXe(i,a),h=CXe(s,a);if(!l||!h)return!0;for(let d=0;d<a.length;d++){let u=a[d],_=a[(d+1)%a.length],p=UKe(i,u,_),m=UKe(s,u,_);if(p&&m)continue;if(!su(i,s,u,_)){if(!p&&!m&&WO(i,s,u,_)<c-abe)return!0;continue}let A=vw(i,s,u,_);if(!(A&&(p&&N3e(A,i)||m&&N3e(A,s))||A&&(N3e(A,i)||N3e(A,s))))return!0}return!1})({start:t,end:n,polygon:this.ogSrj.outline,margin:this.requiredTraceClearance}))return!1}for(let i of this.ogSrj.obstacles){if(i===r)continue;if(!i.layers.includes(o))continue;if(xXe(n,i))return!1;let s=_Ke(i);if(Math.min(...s.map((a)=>WO(t,n,a.start,a.end)))+k4<this.requiredTraceClearance)return!1}return!0}getBoardBoundarySegments(){if(this.ogSrj.outline&&this.ogSrj.outline.length>=3)return this.ogSrj.outline.map((r,i)=>({start:r,end:this.ogSrj.outline[(i+1)%this.ogSrj.outline.length]}));let{minX:e,maxX:t,minY:n,maxY:o}=this.ogSrj.bounds;return[{start:{x:e,y:n},end:{x:t,y:n}},{start:{x:t,y:n},end:{x:t,y:o}},{start:{x:t,y:o},end:{x:e,y:o}},{start:{x:e,y:o},end:{x:e,y:n}}]}getRayProbeDistance(){let{minX:e,maxX:t,minY:n,maxY:o}=this.ogSrj.bounds;return 2*Math.hypot(t-e,o-n)+this.viaDiameter}getRayIntersectionDistance(e){let{rayStart:t,rayEnd:n,segmentStart:o,segmentEnd:r}=e;if(!su(t,n,o,r))return null;let i=vw(t,n,o,r);if(!i)return null;let s=Dn(t,i);return s<=k4?null:s}getProjectedFreeSpace(e){let{sourcePoint:t,candidate:n}=e,o=n.x-t.x,r=n.y-t.y;return Math.abs(o)<=k4||Math.abs(r)<=k4?this.getProjectedFreeSpaceAlongDirection({...e,direction:{x:o,y:r},travelDistance:Dn(t,n)}):Math.min(this.getProjectedFreeSpaceAlongDirection({...e,direction:{x:0,y:Math.sign(r)},travelDistance:Math.abs(r)}),this.getProjectedFreeSpaceAlongDirection({...e,direction:{x:Math.sign(o),y:Math.sign(r)},travelDistance:Dn(t,n)}),this.getProjectedFreeSpaceAlongDirection({...e,direction:{x:Math.sign(o),y:0},travelDistance:Math.abs(o)}))}getProjectedFreeSpaceAlongDirection(e){let{sourcePoint:t,sourceLayer:n,sourceObstacle:o,direction:r,travelDistance:i}=e,s=Math.hypot(r.x,r.y);if(s<=k4||i<=k4)return 0;let a=this.getRayProbeDistance(),c=r.x/s,l=r.y/s,h={x:t.x+c*a,y:t.y+l*a},d=Number.POSITIVE_INFINITY;for(let u of this.ogSrj.obstacles)if(u!==o&&u.layers.includes(n))for(let _ of _Ke(u)){let p=this.getRayIntersectionDistance({rayStart:t,rayEnd:h,segmentStart:_.start,segmentEnd:_.end});p!==null&&(d=Math.min(d,p))}for(let u of this.getBoardBoundarySegments()){let _=this.getRayIntersectionDistance({rayStart:t,rayEnd:h,segmentStart:u.start,segmentEnd:u.end});_!==null&&(d=Math.min(d,_))}return Number.isFinite(d)?Math.max(0,d-i):0}getMinBlockingClearance(e){let{candidate:t,connectionNetIds:n,sourceZ:o,targetZ:r}=e,i=Math.min(o,r),s=Math.max(o,r),a=Number.POSITIVE_INFINITY;for(let c of this.ogSrj.obstacles){let l=this.getObstacleZs(c);if(!l.some((d)=>d>=i&&d<=s))continue;if(c.isCopperPour&&!l.includes(o))continue;let h=_S(t,c)-this.viaRadius;if(a=Math.min(a,h),a+k4<this.requiredViaToPadClearance)return a}return a}getMinPlacedEscapeViaClearance(e){let t=Number.POSITIVE_INFINITY;for(let n of this.createdEscapeVias){let o=Dn(e,n)-this.viaDiameter;if(t=Math.min(t,o),t+k4<this.obstacleMargin)return t}return t}selectPointOwner(e){let{point:t,groupConnections:n,matchingCopperPours:o}=e,r=$Ce(t),i=n.map((s)=>({connection:s,pointIndex:s.pointsToConnect.findIndex((a)=>$Ce(a)===r)})).filter((s)=>s.pointIndex!==-1);return i.length===0?null:(i.sort((s,a)=>{let c=o.some((l)=>this.obstacleMatchesConnectionNet(l,this.getConnectionNetIds(s.connection)));return c!==o.some((l)=>this.obstacleMatchesConnectionNet(l,this.getConnectionNetIds(a.connection)))?c?-1:1:s.pointIndex-a.pointIndex}),i[0])}findBestEscapeViaCandidate(e){let{connection:t,point:n,pointIndex:o,matchingCopperPours:r,connectionNetIds:i,sourceObstacle:s}=e;if(!DO(n))return null;let a=n.layer,c=ti(a,this.ogSrj.layerCount),l=s??this.selectSourceObstacle({point:n,sourceLayer:a,connectionNetIds:i}),h=this.getCandidatePositions(n,l),d=null;for(let u of r){let _=u.layers[0];if(!_||_===a)continue;let p=ti(_,this.ogSrj.layerCount),m=ibr(u);for(let A of h){if(!this.isInsideBoard(A))continue;if(!xXe(A,u))continue;if(!this.hasClearEscapePath({sourcePoint:n,candidate:A,sourceLayer:a,sourceObstacle:l}))continue;let g=this.getMinBlockingClearance({candidate:A,connectionNetIds:i,sourceZ:c,targetZ:p});if(g+k4<this.requiredViaToPadClearance)continue;let f=this.getMinPlacedEscapeViaClearance(A);if(f+k4<this.obstacleMargin)continue;let y=this.getProjectedFreeSpace({sourcePoint:n,candidate:A,sourceLayer:a,sourceObstacle:l}),x=Math.min(y,3),C=100*g-Dn(n,A)-0.5*Math.abs(p-c)+2*x+(Number.isFinite(f)?10*Math.min(f,this.requiredViaToViaClearance):0);(!d||C>d.score)&&(d={pointId:`${bXe}${t.name}:${n.pointId??`p${o}`}:${_}:${this.nextEscapeViaIndex++}`,x:A.x,y:A.y,connectionName:t.name,rootConnectionName:t.__rootConnectionNames?.[0]??t.name,sourcePointIndex:o,sourcePointId:n.pointId,sourceLayer:a,targetLayer:_,targetPourKey:m,score:C})}}return d}buildPointPlacementPlans(e){let{mergedConnection:t,groupConnections:n,matchingCopperPours:o,connectionNetIds:r}=e,i=[];for(let s of t.pointsToConnect){let a=this.selectPointOwner({point:s,groupConnections:n,matchingCopperPours:o});if(!a)continue;let c=DO(s)?this.selectSourceObstacle({point:s,sourceLayer:s.layer,connectionNetIds:r}):void 0,l=DO(s)?this.getCandidatePositions(s,c).length:0;i.push({point:s,pointOwner:a,sourceObstacle:c,candidateCount:l})}return i.sort((s,a)=>{if(s.candidateCount!==a.candidateCount)return s.candidateCount-a.candidateCount;let c=(s.sourceObstacle?.width??0)*(s.sourceObstacle?.height??0),l=(a.sourceObstacle?.width??0)*(a.sourceObstacle?.height??0);return c!==l?c-l:s.pointOwner.pointIndex-a.pointOwner.pointIndex})}_step(){let e=this.ogSrj.obstacles.filter((s)=>s.isCopperPour),t=this.ogSrj.connections,n=t.map((s)=>structuredClone(s)),o=new Map(n.map((s)=>[s.name,s])),r=structuredClone(this.ogSrj.obstacles),i=wsn([...t]);for(let s of i){let a=new Set(s.__rootConnectionNames??[s.name]),c=t.filter((p)=>(p.__rootConnectionNames??[p.name]).some((m)=>a.has(m)));if(c.length===0)continue;let l=new Set;for(let p of c)for(let m of this.getConnectionNetIds(p))l.add(m);let h=e.filter((p)=>this.obstacleMatchesConnectionNet(p,l));if(h.length===0)continue;let d=new Map,u=new Map,_=this.buildPointPlacementPlans({mergedConnection:s,groupConnections:c,matchingCopperPours:h,connectionNetIds:l});for(let{point:p,pointOwner:m,sourceObstacle:A}of _){let g=this.findBestEscapeViaCandidate({connection:m.connection,point:p,pointIndex:m.pointIndex,matchingCopperPours:h,connectionNetIds:l,sourceObstacle:A});if(!g)continue;let f=o.get(m.connection.name);if(!f)continue;if(f.pointsToConnect.some((x)=>DO(x)&&x.layer===g.sourceLayer&&gGt(x,g)))continue;f.pointsToConnect.push({x:g.x,y:g.y,layer:g.sourceLayer,pointId:g.pointId,terminalVia:{toLayer:g.targetLayer,viaDiameter:this.viaDiameter}}),this.escapeViaMetadataByPointId.set(g.pointId,g),this.createdEscapeVias.push(g),r.push(this.createEscapeViaObstacle({escapeVia:g,connectionNetIds:this.getConnectionNetIds(m.connection)}));let y=d.get(g.targetPourKey);y?y.push(g.pointId):d.set(g.targetPourKey,[g.pointId]),u.has(g.targetPourKey)||u.set(g.targetPourKey,m.connection.name)}for(let[p,m]of d.entries()){if(m.length<=1)continue;let A=u.get(p);if(!A)continue;let g=o.get(A);g&&(g.externallyConnectedPointIds=[...g.externallyConnectedPointIds??[],m])}}this.outputSrj={...structuredClone(this.ogSrj),connections:n,obstacles:r},this.solved=!0}getOutputSimpleRouteJson(){return structuredClone(this.outputSrj)}getEscapeViaMetadataByPointId(){return new Map(this.escapeViaMetadataByPointId)}visualize(){return{title:"Escape Via Location Solver",points:this.outputSrj.connections.flatMap((e)=>e.pointsToConnect.map((t)=>({x:t.x,y:t.y,color:t.pointId?.startsWith(bXe)===!0?"#0f766e":"#dc2626",label:t.pointId?.startsWith(bXe)===!0?`${e.name}
escape via`:e.name}))),lines:this.createdEscapeVias.map((e)=>{let t=this.outputSrj.connections.find((n)=>n.name===e.connectionName)?.pointsToConnect[e.sourcePointIndex]??null;return{points:t?[{x:t.x,y:t.y},{x:e.x,y:e.y}]:[{x:e.x,y:e.y}],strokeColor:"#0f766e"}}),circles:this.createdEscapeVias.map((e)=>({center:{x:e.x,y:e.y},radius:this.viaRadius,strokeColor:"#0f766e",label:`${e.connectionName}
${e.targetLayer}`})),rects:this.outputSrj.obstacles.filter((e)=>!e.isCopperPour).map((e)=>({...e,fill:"rgba(220,38,38,0.12)"}))}}},sbr=(e)=>({...e}),J7=(e)=>({...e,route:e.route?.map(sbr),vias:e.vias?.map((t)=>({...t}))}),o9=(e)=>e.map(J7),Rcn="#0000FF",ule=0.15,mr=0.000001,Iq=0.1,vq=["top","bottom","left","right"],IXe=(e)=>e.x*e.x+e.y*e.y,R3e=(e,t)=>({x:e.x-t.x,y:e.y-t.y}),iQ=(e,t,n)=>{let o=R3e(n,t),r=IXe(o);if(r<=mr)return Math.sqrt(IXe(R3e(e,t)));let i=(a=R3e(e,t),c=o,s=(a.x*c.x+a.y*c.y)/r,Math.max(0,Math.min(1,s)));var s,a,c;let l={x:t.x+o.x*i,y:t.y+o.y*i};return Math.sqrt(IXe(R3e(e,l)))},pw=(e)=>e?.z===1?"bottom":"top",abr=(e,t,n)=>(e.z??0)===(t.z??0)&&((t.z??0)===(n.z??0)&&(e.x===t.x&&t.x===n.x||e.y===t.y&&t.y===n.y)),cbe=(e,t,n)=>{let o=n?.get(e);if(o)return o;let r=e.route??[],i=e.traceThickness??ule,{POSITIVE_INFINITY:s,POSITIVE_INFINITY:a,NEGATIVE_INFINITY:c,NEGATIVE_INFINITY:l}=Number,h=!1,d=(_,p,m)=>{s=Math.min(s,_-m),a=Math.min(a,p-m),c=Math.max(c,_+m),l=Math.max(l,p+m),h=!0},u={segments:[],segmentsByLayer:{top:[],bottom:[]},vias:(e.vias??[]).map((_)=>{let p=(_.diameter??e.viaDiameter??0.3)/2;return d(_.x,_.y,p),{center:{x:_.x,y:_.y},radius:p,routeIndex:t}}),bounds:{minX:0,minY:0,maxX:0,maxY:0}};for(let _=0;_<r.length-1;){let p=r[_],m=_+1,A=r[m],g=i/2;for(p&&d(p.x,p.y,g),A&&d(A.x,A.y,g);m<r.length-1;){let x=r[m],C=r[m+1];if(!p||!x||!C)break;if(pw(p)!==pw(x))break;if(pw(x)!==pw(C))break;if(!abr(p,x,C))break;m+=1,A=C,d(C.x,C.y,g)}if(!p||!A){_+=1;continue}let f=pw(p),y={start:p,end:A,routeIndex:t,pointIndex:_,endPointIndex:m,thickness:i,halfThickness:g,layer:f,minX:Math.min(p.x,A.x)-g,maxX:Math.max(p.x,A.x)+g,minY:Math.min(p.y,A.y)-g,maxY:Math.max(p.y,A.y)+g};u.segments.push(y),u.segmentsByLayer[f].push(y),_=m}if(!h)for(let _ of r)d(_.x,_.y,i/2);return u.bounds=h?{minX:s,minY:a,maxX:c,maxY:l}:{minX:0,minY:0,maxX:0,maxY:0},n?.set(e,u),u},Q3e=(e,t,n)=>t.x<=Math.max(e.x,n.x)+mr&&t.x>=Math.min(e.x,n.x)-mr&&t.y<=Math.max(e.y,n.y)+mr&&t.y>=Math.min(e.y,n.y)-mr,k3e=(e,t,n)=>(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y),zq=(e,t,n,o)=>((r,i,s,a)=>{let c=k3e(r,i,s),l=k3e(r,i,a),h=k3e(s,a,r),d=k3e(s,a,i);return!!(Math.abs(c)<=mr&&Q3e(r,s,i))||!!(Math.abs(l)<=mr&&Q3e(r,a,i))||!!(Math.abs(h)<=mr&&Q3e(s,r,a))||!!(Math.abs(d)<=mr&&Q3e(s,i,a))||c>0!=l>0&&h>0!=d>0})(e,t,n,o)?0:Math.min(iQ(e,n,o),iQ(t,n,o),iQ(n,e,t),iQ(o,e,t)),Z7=(e,t)=>Math.abs(e.x-t.x)<=mr&&Math.abs(e.y-t.y)<=mr,Qcn=(e,t)=>Z7(e.start,t.start)||Z7(e.start,t.end)||Z7(e.end,t.start)||Z7(e.end,t.end),AGt=(e)=>{if(!e)return[];let t=[e.connectionName,e.rootConnectionName].filter((n)=>Boolean(n));return Array.from(new Set(t))},cbr=(e,t)=>{let n=AGt(e),o=AGt(t);return n.length!==0&&o.length!==0&&n.some((r)=>o.includes(r))},lbr=(e,t,n)=>e.minX-n<=t.maxX&&e.maxX+n>=t.minX&&e.minY-n<=t.maxY&&e.maxY+n>=t.minY,hbr=(e,t,n)=>{let o=n+e.halfThickness+t.halfThickness-mr;return e.minX-n<=t.maxX&&e.maxX+n>=t.minX&&e.minY-n<=t.maxY&&e.maxY+n>=t.minY&&o>0},fGt=(e,t,n,o)=>{let r=o+n.halfThickness+t-mr,i=e.x-r,s=e.x+r,a=e.y-r,c=e.y+r;return i<=n.maxX&&s>=n.minX&&a<=n.maxY&&c>=n.minY},dbr=(e,t)=>{let n=new WeakMap,o=e.map((a,c)=>cbe(a,c,n)),r=[],i=new Set,s=(a)=>{i.has(a.label)||(i.add(a.label),r.push(a))};for(let a=0;a<o.length;a+=1){let c=o[a];if(c)for(let l=a+1;l<o.length;l+=1){let h=o[l];if(h&&(!cbr(e[a],e[l])&&lbr(c.bounds,h.bounds,t))){for(let d of["top","bottom"]){let u=c.segmentsByLayer[d],_=h.segmentsByLayer[d];for(let p of u)for(let m of _){if(Qcn(p,m))continue;if(!hbr(p,m,t))continue;let A=t+(p.thickness+m.thickness)/2-mr;if(zq(p.start,p.end,m.start,m.end)>=A)continue;s({center:{x:(Math.max(p.minX-t,m.minX-t)+Math.min(p.maxX+t,m.maxX+t))/2,y:(Math.max(p.minY-t,m.minY-t)+Math.min(p.maxY+t,m.maxY+t))/2},label:`trace-violation:${a}:s${p.pointIndex}:${l}:s${m.pointIndex}:${d}`})}}for(let d of c.segments)for(let[u,_]of h.vias.entries()){if(!fGt(_.center,_.radius,d,t))continue;let p=t+d.halfThickness+_.radius-mr;iQ(_.center,d.start,d.end)>=p||s({center:_.center,label:`trace-violation:${a}:s${d.pointIndex}:${l}:v${u}`})}for(let d of h.segments)for(let[u,_]of c.vias.entries()){if(!fGt(_.center,_.radius,d,t))continue;let p=t+d.halfThickness+_.radius-mr;iQ(_.center,d.start,d.end)>=p||s({center:_.center,label:`trace-violation:${a}:v${u}:${l}:s${d.pointIndex}`})}}}}return((a)=>{let c=[];for(let l of a){let h=c.find((d)=>{return u=d.center,_=l.center,Math.hypot(u.x-_.x,u.y-_.y)<=0.28;var u,_});h?(h.center={x:(h.center.x*h.count+l.center.x)/(h.count+1),y:(h.center.y*h.count+l.center.y)/(h.count+1)},h.labels.push(l.label),h.count+=1):c.push({center:l.center,labels:[l.label],count:1})}return c.map((l,h)=>({center:l.center,radius:Math.min(0.3,0.2+0.035*Math.sqrt(l.count-1)),stroke:"#f59e0b",fill:"rgba(245, 158, 11, 0.46)",label:l.count===1?l.labels[0]:`trace-violations:${h}:count-${l.count}`}))})(r)},yGt=new WeakMap,xGt=new WeakMap,CGt=new WeakMap,P$=(e)=>{let t=yGt.get(e);return t===void 0&&(t=e.length>2&&e[e.length-1]-e[0]===e.length-1?`${e[0]}..${e[e.length-1]}`:e.join(","),yGt.set(e,t)),t},$R=({routeIndexes:e,layers:t,routePointIndexes:n})=>`${e[0]}:${t[0]}:${P$(n[0])}:${e[1]}:${t[1]}:${P$(n[1])}`,L3e=(e,t,n,o,r,i,s)=>{let a=((c,l,h,d,u,_)=>c<h?`${c}:${l}:${P$(u)}:${h}:${d}:${P$(_)}`:`${h}:${d}:${P$(_)}:${c}:${l}:${P$(u)}`)(t,n,o,r,i,s);e.has(a)||(t<o?e.set(a,{routeIndexes:[t,o],layers:[n,r],routePointIndexes:[i,s]}):e.set(a,{routeIndexes:[o,t],layers:[r,n],routePointIndexes:[s,i]}))},H3e=(e)=>{let t=xGt.get(e);if(t)return t;let n=[];for(let o=e.pointIndex;o<=e.endPointIndex;o+=1)n.push(o);return xGt.set(e,n),n},HR=(e,t)=>!t||e.some((n)=>t.has(n)),F3e=(e,t)=>{let n=CGt.get(t);if(n)return n;let o=e.route??[],r=[];for(let i=0;i<o.length;i+=1){let s=o[i];s&&(Math.abs(s.x-t.center.x)<=mr&&Math.abs(s.y-t.center.y)<=mr&&r.push(i))}return CGt.set(t,r),r},ubr=(e,t,n)=>e.minX-n<=t.maxX&&e.maxX+n>=t.minX&&e.minY-n<=t.maxY&&e.maxY+n>=t.minY,pbr=(e,t,n)=>{let o=n+e.halfThickness+t.halfThickness-mr;return e.minX-n<=t.maxX&&e.maxX+n>=t.minX&&e.minY-n<=t.maxY&&e.maxY+n>=t.minY&&o>0},bGt=(e,t,n,o)=>{let r=o+n.halfThickness+t-mr,i=e.x-r,s=e.x+r,a=e.y-r,c=e.y+r;return i<=n.maxX&&s>=n.minX&&a<=n.maxY&&c>=n.minY},mbr=(e,t,n)=>{let o=n+e.radius+t.radius-mr;return Math.abs(e.center.x-t.center.x)<=o&&Math.abs(e.center.y-t.center.y)<=o},ry=(e,t,n,o,r)=>{let i=e.map((h,d)=>cbe(h,d,o)),s=new Map;if(t.size===0)return[];let a=Array.from(t),c=new Map,l=(h)=>{let d=c.get(h);if(d)return d;let u=i[h];if(!u)return[];let _=[];for(let p=0;p<i.length;p+=1){if(p===h)continue;let m=i[p];m&&(ubr(u.bounds,m.bounds,n)&&_.push(p))}return c.set(h,_),_};for(let h of a){let d=i[h];if(!d)continue;let u=l(h),_=r?.get(h);for(let p of d.segments){let m=H3e(p);if(HR(m,_))for(let A of u){if(h>A&&t.has(A))continue;let g=i[A];if(!g)continue;let f=r?.get(A),y=g.segmentsByLayer[p.layer];for(let x of y){let C=H3e(x);if(!HR(C,f))continue;if(Qcn(p,x))continue;if(!pbr(p,x,n))continue;let b=n+(p.thickness+x.thickness)/2-mr;zq(p.start,p.end,x.start,x.end)<b&&L3e(s,p.routeIndex,p.layer,x.routeIndex,x.layer,m,C)}}}}for(let h of a){let d=i[h];if(!d)continue;let u=l(h),_=r?.get(h);for(let p of d.vias){let m=F3e(e[p.routeIndex],p);if(HR(m,_))for(let A of u){if(h>A&&t.has(A))continue;let g=i[A];if(!g)continue;let f=r?.get(A);for(let y of g.segments){let x=H3e(y);if(!HR(x,f))continue;if(!bGt(p.center,p.radius,y,n))continue;let C=n+y.thickness/2+p.radius-mr;iQ(p.center,y.start,y.end)<C&&L3e(s,y.routeIndex,y.layer,p.routeIndex,"via",x,m)}}}}for(let h of a){let d=i[h];if(!d)continue;let u=l(h),_=r?.get(h);for(let p of d.segments){let m=H3e(p);if(HR(m,_))for(let A of u){let g=i[A];if(!g)continue;let f=r?.get(A);for(let y of g.vias){let x=F3e(e[y.routeIndex],y);if(!HR(x,f))continue;if(!bGt(y.center,y.radius,p,n))continue;let C=n+p.thickness/2+y.radius-mr;iQ(y.center,p.start,p.end)<C&&L3e(s,p.routeIndex,p.layer,y.routeIndex,"via",m,x)}}}}for(let h of a){let d=i[h];if(!d)continue;let u=l(h),_=r?.get(h);for(let p of d.vias){let m=F3e(e[p.routeIndex],p);if(HR(m,_))for(let A of u){if(h>A&&t.has(A))continue;let g=i[A];if(!g)continue;let f=r?.get(A);for(let y of g.vias){let x=F3e(e[y.routeIndex],y);if(!HR(x,f))continue;if(!mbr(p,y,n))continue;let C=n+p.radius+y.radius-mr;Math.hypot(p.center.x-y.center.x,p.center.y-y.center.y)<C&&L3e(s,p.routeIndex,"via",y.routeIndex,"via",m,x)}}}}return Array.from(s.values())},IGt=(e,t)=>e.x>=t.minX-mr&&e.x<=t.maxX+mr&&e.y>=t.minY-mr&&e.y<=t.maxY+mr,_br=(e,t,n)=>{switch(t){case"left":return{minX:e.minX,maxX:e.minX+n,minY:e.minY,maxY:e.maxY};case"right":return{minX:e.maxX-n,maxX:e.maxX,minY:e.minY,maxY:e.maxY};case"top":return{minX:e.minX,maxX:e.maxX,minY:e.maxY-n,maxY:e.maxY};case"bottom":return{minX:e.minX,maxX:e.maxX,minY:e.minY,maxY:e.minY+n}}},gbr=(e,t,n)=>{let o=t.x-e.x,r=t.y-e.y,i=0,s=1,a=(l,h)=>{if(Math.abs(l)<=mr)return h>=-0.000001;let d=h/l;return l<0?!(d>s)&&(d>i&&(i=d),!0):!(d<i)&&(d<s&&(s=d),!0)};if(!(a(-o,e.x-n.minX)&&a(o,n.maxX-e.x)&&a(-r,e.y-n.minY)&&a(r,n.maxY-e.y)))return 0;let c=Math.hypot(o,r);return Math.max(0,s-i)*c},vGt=(e,t)=>vq.filter((n)=>{switch(n){case"left":return Math.abs(e.x-t.minX)<=mr;case"right":return Math.abs(e.x-t.maxX)<=mr;case"top":return Math.abs(e.y-t.maxY)<=mr;case"bottom":return Math.abs(e.y-t.minY)<=mr}return!1}),SGt=(e,t)=>{let n=[];return e.x<t.minX-mr&&n.push("left"),e.x>t.maxX+mr&&n.push("right"),e.y>t.maxY+mr&&n.push("top"),e.y<t.minY-mr&&n.push("bottom"),n},Abr=(e,t,n)=>{let o=t.x-e.x,r=t.y-e.y;switch(n){case"left":case"right":return Math.abs(o)<=mr&&Math.abs(r)>mr;case"top":case"bottom":return Math.abs(r)<=mr&&Math.abs(o)>mr}},Y$=(e,t,n)=>{let o=[],r=Math.max(n,mr),i=Math.min(0.1,r/4);for(let s=0;s<e.length;s+=1){let a=e[s],c=a?.route??[];for(let l=0;l<c.length-1;l+=1){let h=c[l],d=c[l+1];if(!h||!d)continue;let u=SGt(h,t),_=SGt(d,t),p=vGt(h,t),m=vGt(d,t),A=vq.filter((y)=>{if(a.connectedPadSides?.includes(y))return!1;return!(gbr(h,d,_br(t,y,r))<=i)&&!!Abr(h,d,y)}),g=!IGt(h,t)||!IGt(d,t),f=Array.from(new Set([...A,...u,..._]));(g||f.length!==0)&&o.push({routeIndex:s,connectionName:a.connectionName??a.rootConnectionName??`route-${s}`,segmentIndex:l,touchedSides:f,startSides:p,endSides:m,start:h,end:d})}}return o},WKe=(e)=>e?.center&&e.width&&e.height?{minX:e.center.x-e.width/2,maxX:e.center.x+e.width/2,minY:e.center.y-e.height/2,maxY:e.center.y+e.height/2,width:e.width,height:e.height,center:e.center}:null,PGt=(e)=>e==="bottom"?Rcn:"#FF0000",XKe=(e)=>{let t=e.route??[],n=[];if(t.length<2)return n;let o=pw(t[0]),r=[t[0]];for(let i=1;i<t.length;i+=1){let s=t[i],a=pw(s);a===o?r.push(s):(r.length>=2&&n.push({points:r,strokeColor:PGt(o),strokeWidth:e.traceThickness??ule,label:e.connectionName??"route"}),o=a,r=[t[i-1],s])}return r.length>=2&&n.push({points:r,strokeColor:PGt(o),strokeWidth:e.traceThickness??ule,label:e.connectionName??"route"}),n},fbr=(e)=>{let t=J7(e),n=t.route??[],o=t.vias??[];for(let r=1;r<n.length;r++){let i=n[r-1],s=n[r];if((i.z??0)===(s.z??0))continue;if(i.x!==s.x||i.y!==s.y)throw Error("Node repair requires coincident via transition endpoints");let a=-1,c=0.001;for(let l=0;l<o.length;l++){let h=o[l],d=Math.hypot(h.x-i.x,h.y-i.y);d<=c&&(a=l,c=d)}a===-1?o.push({x:i.x,y:i.y,diameter:t.viaDiameter}):o[a]={...o[a],x:i.x,y:i.y}}return(o.length||t.vias)&&(t.vias=o),t},kcn=class{scenes=new WeakMap;retainedBytes=0;maximumBytes=33554432;getCandidatePairs(e,t,n,o,r){if(!Number.isFinite(r)||r<0)return;let i=o[n];for(let l of i)if(!Number.isFinite(l.start.x)||!Number.isFinite(l.start.y)||!Number.isFinite(l.end.x)||!Number.isFinite(l.end.y)||!Number.isFinite(l.radius)||l.radius<0)return;let s=this.scenes.get(e),a=s?.get(n);if(a?.fixedRoutes!==t&&(a=void 0),!a){let l=0,h=1;for(let A=0;A<o.length;A++)if(A!==n)for(let g=0;g<o[A].length;g++){let f=o[A][g];if(!Number.isFinite(f.start.x)||!Number.isFinite(f.start.y)||!Number.isFinite(f.end.x)||!Number.isFinite(f.end.y)||!Number.isFinite(f.radius)||f.radius<0)return;h=Math.max(h,Math.abs(f.start.x),Math.abs(f.start.y),Math.abs(f.end.x),Math.abs(f.end.y),f.radius),l++}if(l<32)return;let d=new i_(l),u=new Uint32Array(l),_=new Uint32Array(l),p=0;for(let A=0;A<o.length;A++)if(A!==n)for(let g=0;g<o[A].length;g++){let f=o[A][g],y=Math.min(f.start.x,f.end.x)-f.radius,x=Math.min(f.start.y,f.end.y)-f.radius,C=Math.max(f.start.x,f.end.x)+f.radius,b=Math.max(f.start.y,f.end.y)+f.radius;if(!(Number.isFinite(y)&&Number.isFinite(x)&&Number.isFinite(C)&&Number.isFinite(b)))return;d.add(y,x,C,b),u[p]=A,_[p]=g,p++}d.finish(),a={index:d,routeIndexes:u,copperIndexes:_,maxMagnitude:h,fixedRoutes:t,queries:[],queryHitCount:0};let m=d.data.byteLength+u.byteLength+_.byteLength;this.retainedBytes+m>this.maximumBytes&&(this.scenes=new WeakMap,this.retainedBytes=0,s=void 0),m<=this.maximumBytes&&(s||(s=new Map,this.scenes.set(e,s)),s.set(n,a),this.retainedBytes+=m)}let c=new Map;for(let l=0;l<i.length;l++){let h=i[l],d=r+h.radius,u=8*Number.EPSILON*(a.maxMagnitude+Math.abs(h.start.x)+Math.abs(h.start.y)+Math.abs(h.end.x)+Math.abs(h.end.y)+d+1);if(!Number.isFinite(u+d))return;let _=Math.min(h.start.x,h.end.x)-d-u,p=Math.min(h.start.y,h.end.y)-d-u,m=Math.max(h.start.x,h.end.x)+d+u,A=Math.max(h.start.y,h.end.y)+d+u,g=a.queries[l],f;if(g&&g.minX===_&&g.minY===p&&g.maxX===m&&g.maxY===A)f=g.hits;else{f=a.index.search(_,p,m,A).sort((x,C)=>x-C);let y=a.queryHitCount-(g?.hits.length??0)+f.length;y<=65536&&(a.queries[l]={minX:_,minY:p,maxX:m,maxY:A,hits:f},a.queryHitCount=y)}for(let y of f){let x=a.routeIndexes[y],C=a.copperIndexes[y],b=c.get(x);b||(b=[],c.set(x,b));let I=x<n?C:l,v=x<n?l:C;(b[I]??=[]).push(v)}}return c}},Lcn=(e)=>{let t=e.route??[],n=[];for(let o=1;o<t.length;o++){let r=t[o-1],i=t[o];(r.z??0)===(i.z??0)&&n.push({start:r,end:i,minX:Math.min(r.x,i.x),minY:Math.min(r.y,i.y),maxX:Math.max(r.x,i.x),maxY:Math.max(r.y,i.y),magnitude:1+Math.abs(r.x)+Math.abs(r.y)+Math.abs(i.x)+Math.abs(i.y),radius:(e.traceThickness??ule)/2,minZ:r.z??0,maxZ:r.z??0,indexes:[o-1,o],via:!1})}for(let[o,r]of(e.vias??[]).entries()){let i=t.flatMap((a,c)=>a.x===r.x&&a.y===r.y?[c]:[]),s=i.map((a)=>t[a].z??0);n.push({start:r,end:r,minX:r.x,minY:r.y,maxX:r.x,maxY:r.y,magnitude:1+2*(Math.abs(r.x)+Math.abs(r.y)),radius:(r.diameter??e.viaDiameter??0.3)/2,minZ:s.length?Math.min(...s):0,maxZ:s.length?Math.max(...s):1,indexes:i,via:!0,viaIndex:o})}return n},lbe=(e,t,n,o=[],r,i=new WeakMap,s=new kcn,a=new WeakMap,c=new WeakMap)=>{let l=[...e,...o],h=l.map((p)=>{let m=i.get(p);return m||(m=Lcn(p),i.set(p,m)),m}),d=r?s.getCandidatePairs(r.routes,o,r.changedRoute,h,t):void 0,u=r?r.evaluation.conflicts.filter((p)=>p.firstRoute!==r.changedRoute&&p.secondRoute!==r.changedRoute):[],_=u.reduce((p,m)=>p+m.penetration**2,0);for(let p=0;p<e.length&&!(r&&p>r.changedRoute);p++){let m=e[p],A=c.get(m);if(A||(A=new Set([m.connectionName,m.rootConnectionName].filter(Boolean)),c.set(m,A)),!r||p===r.changedRoute){let x=h[p].filter((C)=>C.via);for(let C=0;C<x.length;C++){let b=x[C];for(let I=C+1;I<x.length;I++){let v=x[I];if(b.maxZ<v.minZ||v.maxZ<b.minZ)continue;let P=Math.hypot(b.start.x-v.start.x,b.start.y-v.start.y);if(P===0)continue;let M=t+b.radius+v.radius-P;M<=mr||(u.push({key:`${p}:vias:${C}:${I}`,firstRoute:p,secondRoute:p,first:b,second:v,penetration:M}),_+=M**2)}}for(let[C,b]of n.entries()){if(b.connectedTo?.some((P)=>A.has(P)))continue;let I,v=a.get(b);!v&&b.center&&b.width!==void 0&&b.height!==void 0&&b.width>=0&&b.height>=0&&(v={minX:b.center.x-b.width/2,minY:b.center.y-b.height/2,maxX:b.center.x+b.width/2,maxY:b.center.y+b.height/2,magnitude:Math.abs(b.center.x)+Math.abs(b.center.y)+Math.abs(b.width)+Math.abs(b.height)},a.set(b,v));for(let P of h[p]){if(b.zLayers&&!b.zLayers.some((B)=>B>=P.minZ&&B<=P.maxZ))continue;if(v&&t+P.radius>=0){let B=t+P.radius,T=32*Number.EPSILON*(P.magnitude+v.magnitude+Math.abs(B));if(P.minX>v.maxX+B+T||P.maxX<v.minX-B-T||P.minY>v.maxY+B+T||P.maxY<v.minY-B-T)continue}let M=t-hbe(P,b);M<=mr||M<=(I?.penetration??0)||(I={key:`${p}:pad:${C}`,firstRoute:p,secondRoute:-1,first:P,second:P,penetration:M})}I&&(u.push(I),_+=I.penetration**2)}}let g=r&&p!==r.changedRoute,f=g?r.changedRoute:p+1,y=g?r.changedRoute+1:l.length;for(let x=f;x<y;x++){let C=l[x],b=A.has(C.connectionName)||A.has(C.rootConnectionName),I=new Map,v=d?.get(p===r?.changedRoute?x:p);if(d&&!v)continue;let P=h[p],M=h[x];for(let B=0;B<P.length;B++){let T=P[B],N=v?.[B];if(d&&!N)continue;let D=N?N.length:M.length;for(let L=0;L<D;L++){let H=M[N?N[L]:L];if(b&&(!T.via||!H.via))continue;if(T.maxZ<H.minZ||H.maxZ<T.minZ)continue;if(b&&T.start.x===H.start.x&&T.start.y===H.start.y)continue;let V=t+T.radius+H.radius;if(Math.min(T.start.x,T.end.x)>Math.max(H.start.x,H.end.x)+V||Math.min(H.start.x,H.end.x)>Math.max(T.start.x,T.end.x)+V||Math.min(T.start.y,T.end.y)>Math.max(H.start.y,H.end.y)+V||Math.min(H.start.y,H.end.y)>Math.max(T.start.y,T.end.y)+V)continue;let O=V-zq(T.start,T.end,H.start,H.end);if(O<=mr)continue;let U=`${T.via?`via:${T.viaIndex}`:`trace:${T.minZ}`}:${H.via?`via:${H.viaIndex}`:`trace:${H.minZ}`}`;O<=(I.get(U)?.penetration??0)||I.set(U,{key:`${p}:${x}:${U}`,firstRoute:p,secondRoute:x,first:T,second:H,penetration:O})}}for(let B of I.values())u.push(B),_+=B.penetration**2}}return u.sort((p,m)=>m.penetration-p.penetration),{conflicts:u,score:_}},hbe=(e,t)=>{if(!t.center||t.width===void 0||t.height===void 0)return 1/0;let n=t.center.x-t.width/2,o=t.center.x+t.width/2,r=t.center.y-t.height/2,i=t.center.y+t.height/2,s=0;for(let c of[e.start,e.end])c.x>=n&&c.x<=o&&c.y>=r&&c.y<=i&&(s=Math.max(s,e.radius+Math.min(c.x-n,o-c.x,c.y-r,i-c.y)));if(s>0)return-s;let a=[{x:n,y:r},{x:o,y:r},{x:o,y:i},{x:n,y:i}];return Math.min(...a.map((c,l)=>zq(e.start,e.end,c,a[(l+1)%4])))-e.radius},EGt=(e,t)=>{let n=Lcn(e).filter((o)=>!t.zLayers||t.zLayers.some((r)=>r>=o.minZ&&r<=o.maxZ));return Math.min(...n.map((o)=>hbe(o,t)))},ybr=(e,t,n,o,r)=>{let i=J7(e),s=i.route??[],a=e.route??[],c=(h)=>h===0||h===s.length-1,l=new Set;for(let h of t.indexes){if(c(h))continue;let d=a[h];a.forEach((u,_)=>{u.x===d.x&&u.y===d.y&&l.add(_)})}if(!([...l].some(c)||t.via&&t.indexes.some(c))){if(l.size===0){if(t.via||t.indexes.length!==2)return;let[h,d]=t.indexes,u=s[h],_=s[d],p=[0.25,0.75].map((m)=>({...u,x:u.x+(_.x-u.x)*m+n,y:u.y+(_.y-u.y)*m+o}));s.splice(d,0,...p)}else{for(let h of l)s[h].x+=n,s[h].y+=o;for(let h of i.vias??[])[...l].some((d)=>a[d].x===h.x&&a[d].y===h.y)&&(h.x+=n,h.y+=o)}if(!s.some((h,d)=>d>0&&d<s.length-1&&(h.x<r.minX||h.x>r.maxX||h.y<r.minY||h.y>r.maxY)))return i}},vXe=(e)=>{let t=[],n=e.route??[];for(let o=1;o<n.length;o++){let r=n[o-1],i=n[o];(r.z??0)===(i.z??0)&&t.push({start:r,end:i,radius:(e.traceThickness??ule)/2,minZ:r.z??0,maxZ:r.z??0})}for(let o of e.vias??[]){let r=1/0,i=-1/0;for(let s=1;s<n.length;s++){let a=n[s-1],c=n[s];Math.hypot(a.x-o.x,a.y-o.y)>0.001||Math.hypot(c.x-o.x,c.y-o.y)>0.001||a.z===c.z||(r=Math.min(r,a.z??0,c.z??0),i=Math.max(i,a.z??0,c.z??0))}t.push({start:o,end:o,radius:(o.diameter??e.viaDiameter??0.3)/2,minZ:r===1/0?0:r,maxZ:i===-1/0?1:i})}return t},MGt=(e,t)=>{let n=1/0;for(let o of e)o.maxZ<t.minZ||t.maxZ<o.minZ||(n=Math.min(n,zq(o.start,o.end,t.start,t.end)-o.radius-t.radius));return n},xbr=class{constructor(e,t,n=[]){this.minimumClearance=t,this.obstacles=n,this.fixedCopper=e.map((o)=>({route:o,copper:vXe(o)}))}minimumClearance;obstacles;fixedCopper;cache=new WeakMap;allows(e,t,n,o=!0){if(o&&((r,i,s)=>{let a=new Map(lbe(r,s,[]).conflicts.map((c)=>[c.key,c.penetration]));return lbe(i,s,[]).conflicts.some((c)=>c.penetration>(a.get(c.key)??0)+mr)})(e,t,this.minimumClearance))return!1;if(this.fixedCopper.length===0&&this.obstacles.length===0)return!0;for(let r of n){let i=e[r],s=t[r];if(i===s)continue;let a=this.cache.get(i)??vXe(i),c=this.cache.get(s)??vXe(s);this.cache.set(i,a),this.cache.set(s,c);let l=new Set([i.connectionName,i.rootConnectionName].filter(Boolean));for(let h of this.obstacles){if(h.connectedTo?.some((_)=>l.has(_)))continue;let d=EGt(s,h);if(d>=this.minimumClearance-mr)continue;let u=EGt(i,h);if(d<Math.min(u,this.minimumClearance)-mr)return!1}for(let h of this.fixedCopper)if(!l.has(h.route.connectionName)&&!l.has(h.route.rootConnectionName))for(let d of h.copper){let u=MGt(c,d);if(u>=this.minimumClearance-mr)continue;let _=MGt(a,d);if(u<Math.min(_,this.minimumClearance)-mr)return!1}}return!0}},Cbr=(e,t)=>({title:`HighDensityRepair02 Initial State (margin=${t})`,routes:e}),dbe=(e)=>{let t=[];for(let n of e){let o=t[t.length-1];o&&o.z===n.z&&Z7(o,n)||t.push(n)}return t},bbr=(e,t,n)=>{let o=Math.max(0,e.minX-t.maxX,t.minX-e.maxX),r=Math.max(0,e.minY-t.maxY,t.minY-e.maxY);return Math.hypot(o,r)<=n+mr},wGt=(e,t)=>{let n=Number.POSITIVE_INFINITY;for(let o of e.segments)for(let r of t.segments){if(o.layer!==r.layer)continue;let i=zq(o.start,o.end,r.start,r.end)-(o.thickness+r.thickness)/2;n=Math.min(n,i)}return n},jKe=({currentRoutes:e,candidateRoutes:t,candidateRouteIndexes:n,maximumAllowedClearance:o})=>{let r=new WeakMap,i=new WeakMap,s=[],a=Array.from(n).sort((d,u)=>d-u),c=e.map((d,u)=>cbe(d,u,r)),l=t.map((d,u)=>cbe(d,u,i)),h=new Set;for(let d of a)for(let u=0;u<t.length;u+=1){if(u===d)continue;let _=Math.min(d,u),p=Math.max(d,u),m=`${_}:${p}`;if(h.has(m))continue;h.add(m);let A=l[_],g=l[p];if(!A||!g||!bbr(A.bounds,g.bounds,o))continue;let f=wGt(A,g);if(!Number.isFinite(f)||f>o+mr||!c[_]||!c[p])continue;let y=wGt(c[_],c[p]);!Number.isFinite(y)||f>=y-mr||s.push({routeIndexes:[_,p],previousClearance:y,nextClearance:f})}return s},z3e=0.001,Ibr=(e,t)=>e.map((n)=>{let o=n.route??[];return o.length===0?n:{...n,route:o.map((r,i)=>i===0||i===o.length-1?((s,a)=>{let c={...s};return Math.abs(c.x-a.minX)<=z3e?c.x=a.minX:Math.abs(c.x-a.maxX)<=z3e&&(c.x=a.maxX),Math.abs(c.y-a.minY)<=z3e?c.y=a.minY:Math.abs(c.y-a.maxY)<=z3e&&(c.y=a.maxY),c})(r,t):r)}}),vbr=(e,t)=>Array.from(t).flatMap((n)=>XKe(e[n]).map((o)=>({...o,strokeColor:"#000000",strokeWidth:o.strokeWidth,label:`candidate:${o.label}`}))),Hcn=(e,t,n,o,r)=>{switch(t){case"left":return{center:{x:e.minX+n/2,y:e.center.y},width:n,height:e.height,stroke:"rgba(0, 0, 0, 0)",fill:o,label:r};case"right":return{center:{x:e.maxX-n/2,y:e.center.y},width:n,height:e.height,stroke:"rgba(0, 0, 0, 0)",fill:o,label:r};case"top":return{center:{x:e.center.x,y:e.maxY-n/2},width:e.width,height:n,stroke:"rgba(0, 0, 0, 0)",fill:o,label:r};case"bottom":return{center:{x:e.center.x,y:e.minY+n/2},width:e.width,height:n,stroke:"rgba(0, 0, 0, 0)",fill:o,label:r}}},Sbr=({routes:e,candidateRoutes:t,candidateRouteIndexes:n,originalRoutes:o,boundary:r,side:i,margin:s,rejected:a,rejectionReason:c})=>{let l=Array.from(n).map((h)=>t[h].connectionName??`route-${h}`);return{title:a?`${i} move rejected (${c})`:`${i} move accepted`,routes:a?e:t,originalRoutes:o,activeSide:i,candidateRouteNames:l,overlayLines:a?vbr(t,n):[],overlayRects:[Hcn(r,i,s,a?"rgba(220, 38, 38, 0.14)":"rgba(16, 185, 129, 0.14)",a?`rejected:${i}`:`accepted:${i}`)]}},Pbr=(e,t,n,o)=>{let r=(e?.adjacentObstacles??[]).some((i)=>((s,a,c,l)=>{let h=((d)=>d.center&&d.width&&d.height?{minX:d.center.x-d.width/2,maxX:d.center.x+d.width/2,minY:d.center.y-d.height/2,maxY:d.center.y+d.height/2}:null)(s);if(!h)return!1;switch(c){case"left":return h.maxX>=a.minX-mr&&h.minX<=a.minX+l+mr;case"right":return h.minX<=a.maxX+mr&&h.maxX>=a.maxX-l-mr;case"top":return h.minY<=a.maxY+mr&&h.maxY>=a.maxY-l-mr;case"bottom":return h.maxY>=a.minY-mr&&h.minY<=a.minY+l+mr}})(i,t,n,o));return{hasObstacle:r,moveAmount:r?o:o/2}},Ebr=({start:e,end:t,side:n,boundary:o,amount:r,targetAxisValue:i})=>{let s=(({side:a,boundary:c,amount:l,targetAxisValue:h})=>{let d=h??(()=>{switch(a){case"left":return c.minX+l;case"right":return c.maxX-l;case"top":return c.maxY-l;case"bottom":return c.minY+l}})();switch(a){case"left":case"right":return Math.min(Math.max(d,c.minX),c.maxX);case"top":case"bottom":return Math.min(Math.max(d,c.minY),c.maxY)}})({side:n,boundary:o,amount:r,targetAxisValue:i});switch(n){case"left":case"right":return dbe([e,{x:s,y:e.y,z:e.z},{x:s,y:t.y,z:t.z},t]);case"top":case"bottom":return dbe([e,{x:e.x,y:s,z:e.z},{x:t.x,y:s,z:t.z},t])}},Mbr=(e,t,n,o,r,i,s,a=!1)=>{let c=e.route??[];if(c.length<2||t.length===0)return J7(e);let l=a?r:Math.max(r,i),h=((u,_)=>{switch(u){case"left":return{x:_,y:0};case"right":return{x:-_,y:0};case"top":return{x:0,y:-_};case"bottom":return{x:0,y:_}}})(o,l);if(a||(e.vias?.length??0)>0||c.length>2){let u=J7(e),_=u.route??[];for(let p of t){let m=_[p];m&&(_[p]={...m,x:m.x+h.x,y:m.y+h.y})}for(let p of u.vias??[])t.some((m)=>{let A=e.route?.[m];return!!A&&Z7(A,p)})&&(p.x+=h.x,p.y+=h.y);return u}let d=J7(e);if(c.length===2&&t.length===2&&t[0]===0&&t[1]===1){let u=c[0],_=c[1];return J7({...e,route:Ebr({start:u,end:_,side:o,boundary:n,amount:l,targetAxisValue:s})})}return d},y6e=(e,t,n)=>{switch(n){case"left":return e.x-t.minX;case"right":return t.maxX-e.x;case"top":return t.maxY-e.y;case"bottom":return e.y-t.minY}},BGt=(e,t,n)=>{let o=((r)=>{let i=r.route??[];if(i.length===0)return[];let s=[];for(let a=0;a<i.length;a+=1){let c=i[a];if(!c)continue;a===0||a===i.length-1||s.push(c);let l=i[a+1];l&&s.push({x:(c.x+l.x)/2,y:(c.y+l.y)/2})}return s})(e);return o.length===0?Number.POSITIVE_INFINITY:o.reduce((r,i)=>Math.min(r,y6e(i,t,n)),Number.POSITIVE_INFINITY)},KKe=(e,t,n=[])=>{let o=e.route??[],r=[],i=new Set,s=t.length===0||t.includes("via");if(o.length===2)return[0,1];let a=(c)=>{if(c<=0||c>=o.length-1)return;if(i.has(c))return;let l=o[c];l&&(s||t.includes(pw(l)))&&(i.add(c),r.push(c))};if(n.length>0)for(let c of n)a(c);else for(let c=1;c<o.length-1;c+=1)a(c);for(let c=0;c<r.length;c+=1){let l=r[c],h=o[l];if(h)for(let d=1;d<o.length-1;d+=1){if(i.has(d))continue;let u=o[d];u&&(u.z!==h.z&&Z7(u,h)&&(i.add(d),r.push(d)))}}return r.sort((c,l)=>c-l),r},TGt=(e,t)=>Math.max(0,...(e.route??[]).map((n)=>Math.max(t.minX-n.x,n.x-t.maxX,t.minY-n.y,n.y-t.maxY,0))),G$=(e,t,n,o)=>y6e(e,t,n)<=o+mr,DGt=(e,t,n,o)=>{let r=e.route??[],i=[],s=new Set,a=1,c=r.length-2;for(;a<r.length-1&&Z7(r[a],r[0]);)a+=1;for(;c>0&&Z7(r[c],r[r.length-1]);)c-=1;for(let l=a;l<=c;l+=1)G$(r[l],t,n,o)&&(s.add(l),i.push(l));for(let l=0;l<i.length;l+=1){let h=r[i[l]];if(h)for(let d=a;d<=c;d+=1){if(s.has(d))continue;let u=r[d];u&&(u.z!==h.z&&Z7(u,h)&&(s.add(d),i.push(d)))}}return i.length===0&&r.length===2&&r.some((l)=>G$(l,t,n,o))?[0,1]:(i.sort((l,h)=>l-h),i)},wbr=(e,t,n)=>{let o=e.route??[],r=n===0?o[0]:o[o.length-1];return r?vq.filter((i)=>y6e(r,t,i)<=mr):[]},Bbr=(e,t,n)=>{let o=e.route??[],r=t.route??[];if(o.length===0||r.length===0)return!0;for(let i of[0,-1]){let s=wbr(e,n,i);if(s.length===0)continue;let a=i===0?r[0]:r[r.length-1];if(!a)return!1;for(let c of s)if(y6e(a,n,c)>mr)return!1}return!0},Tbr=(e,t)=>Math.hypot(t.x-e.x,t.y-e.y),NGt=(e,t,n,o)=>{let r=e.route??[];if(r.length===0)return"none";let i=!1;for(let s=0;s<r.length;s+=1){let a=r[s];if(a&&G$(a,t,n,o)){if(s!==0&&s!==r.length-1)return"interior";i=!0}}for(let s=0;s<r.length-1;s+=1){let a=r[s],c=r[s+1];if(a&&c&&(G$(a,t,n,o)&&G$(c,t,n,o)&&!(Tbr(a,c)<=mr)))return"interior"}return i?"endpoint":"none"},RGt=({currentRoutes:e,routeIndex:t,side:n,moveSide:o=n,boundary:r,margin:i,moveAmount:s,geometryCache:a,fixedCopperGuard:c})=>{let l=e[t],h=(l.route?.length??0)===2,d=DGt(l,r,n,i);if(d.length===0)return null;let u=new Set,_=new Map,p=new Set,m=e.slice(),A=!1,g="overlap",f=new Set([t]),y=new Map([[t,new Set]]),x=new Map([[t,new Set]]),C=[t],b=0,I=null,v=null,P=null,M=null,B=(L)=>new Set(L.map((H)=>$R(H))),T=()=>I||(I=ry(e,u,i,a,_),I),N=()=>P||(P=ry(e,u,0,a,_),P),D=()=>M||(M=ry(m,u,0,a,_),M);for(;b<C.length&&!A;){let L=C[b];if(b+=1,f.delete(L),u.has(L))continue;let H=m[L],V=Array.from(y.get(L)??[]),O=Array.from(x.get(L)??[]);y.delete(L),x.delete(L);let U=L===t?DGt(H,r,n,i):KKe(H,V,O);if(U.length===0){if(L===t)return null;A=!0,g="eventual-overlap";break}let j=H.route??[],Y=L===t?void 0:o==="left"||o==="right"?(j[U[0]]?.x??0)+(o==="left"?s:-s):(j[U[0]]?.y??0)+(o==="top"?-s:s);m[L]=Mbr(H,U,r,o,s,i,Y,L!==t),u.add(L),_.set(L,new Set(U)),I=null,v=null,P=null,M=null,(H.route?.length??0)===2&&p.add(L);let X=TGt(e[L],r);if(TGt(m[L],r)>X+0.000001){A=!0,g="boundary";break}if(!Bbr(e[L],m[L],r)){A=!0,g="endpoint-boundary";break}let K=ry(m,new Set([L]),i,a,new Map([[L,new Set(U)]]));for(let J of K){if(B(T()).has($R(J)))continue;let[ee,se]=J.routeIndexes,ne=u.has(ee),re=u.has(se);if(ne&&re)continue;let Z=ne?se:ee,te=ne?J.layers[1]:J.layers[0],ie=ne?J.routePointIndexes[1]:J.routePointIndexes[0];if(u.has(Z)||f.has(Z)){if(f.has(Z)){let ce=y.get(Z)??new Set;ce.add(te),y.set(Z,ce);let ue=x.get(Z)??new Set;for(let de of ie)ue.add(de);x.set(Z,ue)}}else f.add(Z),C.push(Z),y.set(Z,new Set([te])),x.set(Z,new Set(ie))}}if(!A&&u.size>1){let L=B(T()),H=B(v||(v=ry(m,u,i,a,_),v));for(let V of H)if(!L.has(V)){A=!0,g="eventual-overlap";break}}if(!A&&u.size>1){let L=B(N()),H=B(D());for(let V of H)if(!L.has(V)){A=!0,g="eventual-overlap";break}}if(!A){let L=new Set(ry(e,u,0,a).map((V)=>$R(V))),H=ry(m,u,0,a);for(let V of H){let O=$R(V);if(!L.has(O)){A=!0,g="eventual-overlap";break}}}if(!A)(({currentRoutes:H,candidateRoutes:V,candidateRouteIndexes:O,boundary:U,activeSide:j})=>{let Y=vq.filter((K)=>K!==j),X=[];for(let K of O){let J=H[K],ee=V[K];if(J&&ee)for(let se of Y){let ne=BGt(J,U,se),re=BGt(ee,U,se);ne>mr&&re<=mr&&X.push({routeIndex:K,side:se,previousClearance:ne,nextClearance:re})}}return X})({currentRoutes:e,candidateRoutes:m,candidateRouteIndexes:u,boundary:r,activeSide:n}).length>0&&(A=!0,g="boundary-touch");if(!A)(({currentRoutes:H,candidateRoutes:V,candidateRouteIndexes:O,geometryCache:U,currentConflicts:j,candidateConflicts:Y})=>{let X=j??ry(H,O,0,U),K=Y??ry(V,O,0,U),J=new Set(X.map((ee)=>$R(ee)));return K.filter((ee)=>{let se=$R(ee);if(J.has(se))return!1;let[ne,re]=ee.routeIndexes,[Z,te]=ee.layers,ie=O.has(ne),ce=O.has(re);if(ie&&ce)return!1;let ue=ie?te:Z,de=V[ie?re:ne];return!!de&&KKe(de,[ue]).length===0})})({currentRoutes:e,candidateRoutes:m,candidateRouteIndexes:u,geometryCache:a,currentConflicts:N(),candidateConflicts:D()}).length>0&&(A=!0,g="fixed-trace-touch");if(!A)jKe({currentRoutes:e,candidateRoutes:m,candidateRouteIndexes:u,maximumAllowedClearance:Math.min(i/2,Iq)}).length>0&&(A=!0,g="trace-clearance");return!A&&((L,H,V,O,U,j)=>Array.from(V).some((Y)=>{let X=L[Y],K=H[Y];return vq.filter((J)=>J!==U).some((J)=>{let ee=NGt(X,O,J,j),se=NGt(K,O,J,j);return ee==="none"&&se!=="none"})}))(e,m,u,r,n,i)&&(A=!0,g="side-regression"),A||!c||c.allows(e,m,u)||(A=!0,g="fixed-copper-clearance"),{isTwoPointRoute:h,movableIndexes:d,candidateRouteIndexes:u,movedTwoPointRouteIndexes:p,candidateRoutes:m,rejected:A,rejectionReason:g}},Dbr=(e,t,n,o,r)=>{let i=e.route??[];if(t.length===0)return null;if(o==="top"||o==="bottom"){let a=t.reduce((c,l)=>c+(i[l]?.x??n.center.x),0)/t.length;return a<n.center.x-r/2?"right":a>n.center.x+r/2?"left":null}let s=t.reduce((a,c)=>a+(i[c]?.y??n.center.y),0)/t.length;return s>n.center.y+r/2?"bottom":s<n.center.y-r/2?"top":null},Nbr=({side:e,sample:t,boundary:n,margin:o,repairedRoutes:r,frames:i,captureProgressFrames:s,lockedTwoPointRoutes:a,geometryCache:c,fixedCopperGuard:l,allowTwoPointWithoutObstacle:h=!1})=>{let{hasObstacle:d,moveAmount:u}=Pbr(t,n,e,o);s&&i.push(((m,A,g,f,y,x)=>({title:`${g} boundary analysis: move=${y.toFixed(3)} (${x?"obstacle-side":"clear-side"})`,routes:m,activeSide:g,overlayRects:[Hcn(A,g,f,"rgba(245, 158, 11, 0.16)",`strip:${g}`)]}))(o9(r),n,e,o,u,d));let _=new Set,p=0;for(let m=0;m<r.length;m+=1){if(_.has(m))continue;if(a.has(m))continue;let A=r[m];if(A.connectedPadSides?.includes(e))continue;if((A.route?.length??0)===2&&!d&&!h)continue;let g=RGt({currentRoutes:r,routeIndex:m,side:e,boundary:n,margin:o,moveAmount:u,geometryCache:c,fixedCopperGuard:l});if(g){if(g.rejected){let f=Dbr(A,g.movableIndexes,n,e,o);if(f){let y=RGt({currentRoutes:r,routeIndex:m,side:e,moveSide:f,boundary:n,margin:o,moveAmount:u,geometryCache:c,fixedCopperGuard:l});y&&!y.rejected&&(g=y)}}if(s&&i.push(Sbr({routes:o9(r),candidateRoutes:g.candidateRoutes,candidateRouteIndexes:g.candidateRouteIndexes,originalRoutes:g.rejected?void 0:Array.from(g.candidateRouteIndexes).map((f)=>J7(r[f])),boundary:n,side:e,margin:o,rejected:g.rejected,rejectionReason:g.rejectionReason})),!g.rejected){r.splice(0,r.length,...g.candidateRoutes);for(let f of g.movedTwoPointRouteIndexes)a.add(f);p+=1}_.add(m)}}return{movesAccepted:p}},Tae=(e,t,n,o)=>G$(e,t,n,o),Dae=(e,t,n,o)=>{switch(n){case"left":return{...e,x:Math.min(t.minX+o,t.maxX)};case"right":return{...e,x:Math.max(t.maxX-o,t.minX)};case"top":return{...e,y:Math.max(t.maxY-o,t.minY)};case"bottom":return{...e,y:Math.min(t.minY+o,t.maxY)}}},QGt=(e)=>`${e.routeIndexes[0]}:${e.layers[0]}:${e.routeIndexes[1]}:${e.layers[1]}`,kGt=(e)=>{if(!e)return[];let t=[e.connectionName,e.rootConnectionName].filter((n)=>Boolean(n));return Array.from(new Set(t))},LGt=(e,t)=>{let n=kGt(e),o=kGt(t);return n.length!==0&&o.length!==0&&n.some((r)=>o.includes(r))},XK=(e,t,n)=>e?Y$([e],t,n).length:0,HGt=(e,t,n,o)=>{let r=new Set(ry(e,new Set([n]),o).map($R));return ry(t,new Set([n]),o).some((i)=>!r.has($R(i)))},FGt=(e,t,n)=>Y$(e,t,n).length,zGt=(e)=>{if(!e)return[];let t=[e.connectionName,e.rootConnectionName].filter((n)=>Boolean(n));return Array.from(new Set(t))},OGt=(e,t)=>ry(e,new Set(e.map((n,o)=>o)),Iq,t).filter((n)=>!(n.layers[0]==="via"&&n.layers[1]==="via"||((o,r)=>{let i=zGt(o),s=zGt(r);return i.length!==0&&s.length!==0&&i.some((a)=>s.includes(a))})(e[n.routeIndexes[0]],e[n.routeIndexes[1]]))).length,Rbr=(e)=>{let t=vq;return[...t.slice(e%t.length),...t.slice(0,e%t.length)]},Qbr=(e,t,n=!1,o=!0)=>{let r=WKe(e?.nodeWithPortPoints),i=(e?.nodeHdRoutes??[]).map(fbr),s=Math.max(t??0.4,0.05),a=new xbr(e?.fixedHdRoutes??[],Math.min(s/2,Iq),e?.clearanceObstacles??e?.adjacentObstacles),c=r&&o?((_,p)=>_.map((m)=>{let A=m.route??[],g=!1,f=A.map((y)=>{let{x,y:C}=y;return x<p.minX?x=p.minX:x>p.maxX&&(x=p.maxX),C<p.minY?C=p.minY:C>p.maxY&&(C=p.maxY),x===y.x&&C===y.y?y:(g=!0,{...y,x,y:C})});return g?{...m,route:f}:m}))(Ibr(o9(i),r),r):o9(i),l=o&&a.allows(i,c,i.keys())?c:i,h=o9(l);if(!r)return{boundary:null,baseRoutes:l,repairedRoutes:h,margin:s,frames:[{title:"HighDensityRepair02 Missing Boundary",routes:h}]};let d=n?[Cbr(o9(h),s)]:[];if(o){let _=new WeakMap,p=FGt(h,r,s);for(let g=0;g<1;g+=1){let f=new Set,y=0;for(let C of Rbr(g)){let{movesAccepted:b}=Nbr({side:C,sample:e,boundary:r,frames:d,margin:s,repairedRoutes:h,captureProgressFrames:n,lockedTwoPointRoutes:f,geometryCache:_,fixedCopperGuard:a,allowTwoPointWithoutObstacle:g>=1});y+=b}let x=FGt(h,r,s);if(y===0)break;if(x===0)break;if(x>=p)break;p=x}let m=o9(h),A=OGt(h,_);(({routes:g,boundary:f,margin:y,geometryCache:x,fixedCopperGuard:C})=>{let b=Y$(g,f,y);if(b.length===0)return{movesAccepted:0};let I=new Map;for(let D of b){let L=I.get(D.routeIndex)??new Set;for(let H of D.touchedSides)L.add(H);I.set(D.routeIndex,L)}let v=[0.000008,0.01,y/4,y/2,y+0.000008],P=0,M=(D,L,H)=>{let V=L.route??[];if(V.length<2)return!1;let O={...L,route:dbe(V)};if((O.route?.length??0)<2)return!1;let U=g.slice();if(U[D]=O,C&&!C.allows(g,U,[D]))return!1;if(XK(U[D],f,y)>=H)return!1;let j=(X)=>LGt(g[X.routeIndexes[0]],g[X.routeIndexes[1]]),Y=new Set(ry(g,new Set([D]),0,x).filter((X)=>!j(X)).map(QGt));return!ry(U,new Set([D]),0,x).filter((X)=>!j(X)).some((X)=>!Y.has(QGt(X)))&&!(jKe({currentRoutes:g,candidateRoutes:U,candidateRouteIndexes:new Set([D]),maximumAllowedClearance:Math.min(y/2,Iq)}).filter((X)=>!LGt(g[X.routeIndexes[0]],g[X.routeIndexes[1]])).length>0||(g[D]=O,0))},B=(D,L,H,V)=>{if(L.length===0)return!1;for(let O of v){let U=g[D],j=J7(U),Y=j.route??[],X=!1;for(let K of KKe(U,[],L)){let J=Y[K];J&&(Y[K]=Dae(J,f,H,O),X=!0)}if(!X)return!1;if(M(D,j,V))return!0}return!1},T=(D,L)=>{let H=[];return L==="top"||L==="bottom"?(Math.abs(D.x-f.minX)<=mr&&H.push("left"),Math.abs(D.x-f.maxX)<=mr&&H.push("right")):(Math.abs(D.y-f.minY)<=mr&&H.push("bottom"),Math.abs(D.y-f.maxY)<=mr&&H.push("top")),H},N=(D,L,H)=>{let V=g[D],O=V.route??[];if(O.length!==2)return!1;let[U,j]=O;if(!Tae(U,f,L,y))return!1;if(!Tae(j,f,L,y))return!1;let Y=T(U,L),X=T(j,L);for(let K of v){let J=Dae(U,f,L,K),ee=Dae(j,f,L,K);for(let ne of Y)J=Dae(J,f,ne,K);for(let ne of X)ee=Dae(ee,f,ne,K);let se={...V,route:[U,J,ee,j]};if(M(D,se,H))return!0}return!1};for(let[D,L]of I)if(g[D])for(let H of L){let V=!0;for(;V;){V=!1;let O=g[D].route??[];if(O.length===2){let J=XK(g[D],f,y);J>0&&N(D,H,J)&&(P+=1);break}if(O.length<3)break;let U=XK(g[D],f,y);if(U===0)break;let j=[];for(let J=1;J<O.length-1;J+=1){let ee=O[J];ee&&Tae(ee,f,H,y)&&j.push(J)}if(j.length===0)break;if(B(D,j,H,U)){P+=1,V=!0;continue}let Y=!1,X=U,K=0;for(;K<j.length;){let J=K;for(;J+1<j.length&&j[J+1]===j[J]+1;)J+=1;B(D,j.slice(K,J+1),H,X)&&(P+=1,Y=!0,X=XK(g[D],f,y)),K=J+1}if(!Y){let J=g[D].route??[],ee=U;for(let se=1;se<J.length-1;se+=1){let ne=J[se];ne&&Tae(ne,f,H,y)&&B(D,[se],H,ee)&&(P+=1,Y=!0,ee=XK(g[D],f,y))}}Y&&(V=!0)}}for(let[D,L]of I){let H=g[D];if(!H)continue;let V=H.route??[];if(V.length<=2)continue;let O=XK(g[D],f,y);if(O!==0)for(let U of L){if(!V.every((K)=>Tae(K,f,U,y)))continue;let j=V[0]?.z;if(!V.every((K)=>K.z===j))continue;let Y={...H,route:[V[0],V[V.length-1]]},X=g[D];g[D]=Y,N(D,U,O)?P+=1:g[D]=X;break}}})({routes:m,boundary:r,margin:s,geometryCache:_,fixedCopperGuard:a}),OGt(m,_)<=A&&h.splice(0,h.length,...m),(({routes:g,boundary:f,clearanceMargin:y,fixedCopperGuard:x})=>{for(let C=0;C<g.length;C+=1){let b=g[C];if((b.route??[]).length<=2)continue;let I=y,v=Math.max(f.width/2-mr,0),P=Math.max(f.height/2-mr,0),M=Math.min(I,v),B=Math.min(I,P),T=b.connectedPadSides??[],N=f.minX+(T.includes("left")?0:M),D=f.maxX-(T.includes("right")?0:M),L=f.minY+(T.includes("bottom")?0:B),H=f.maxY-(T.includes("top")?0:B),V=J7(b),O=V.route??[],U=!1;for(let J=1;J<O.length-1;J+=1){let ee=O[J];if(!ee)continue;let se=Math.min(Math.max(ee.x,N),D),ne=Math.min(Math.max(ee.y,L),H);(Math.abs(se-ee.x)>mr||Math.abs(ne-ee.y)>mr)&&(ee.x=se,ee.y=ne,U=!0)}if(!U)continue;if(V.route=dbe(O),(V.route?.length??0)<2)continue;let j=o9(g);j[C]=V;let Y=HGt(g,j,C,0),X=HGt(g,j,C,y),K=jKe({currentRoutes:g,candidateRoutes:j,candidateRouteIndexes:new Set([C]),maximumAllowedClearance:y}).length>0;Y||X||K||!x.allows(g,j,[C])||(g[C]=V)}})({routes:h,boundary:r,clearanceMargin:s,fixedCopperGuard:a})}let u=(({routes:_,fixedRoutes:p=[],boundary:m,fixedCopperGuard:A,adjacentObstacles:g=[],clearanceObstacles:f=g,clearance:y=0.1,boundaryMargin:x=0.2,maxCandidates:C})=>{let b=_,I=new WeakMap,v=new kcn,P=new WeakMap,M=new WeakMap,B=new WeakMap,T=new WeakMap,N=lbe(b,y,f,p,void 0,I,v,M,T),D=C??Math.max(256,96*N.conflicts.length),L={routes:_,initialConflictCount:N.conflicts.length,finalConflictCount:N.conflicts.length,candidateCount:0};for(;N.conflicts.length&&L.candidateCount<D;){let H=!1,V=new Map(N.conflicts.map((O)=>[O.key,O.penetration]));for(let O of N.conflicts){for(let[U,j]of[[O.firstRoute,O.first],[O.secondRoute,O.second]]){if(U<0||U>=b.length)continue;let Y=b[U],X=new Set([Y.connectionName,Y.rootConnectionName].filter(Boolean)),K=f.filter((re)=>!re.connectedTo?.some((Z)=>X.has(Z))),J=I.get(Y),ee=B.get(Y);ee===void 0&&(ee=Y$([Y],m,x).length,B.set(Y,ee));let se=P.get(Y);se||(se=new Map,P.set(Y,se));let ne=K.map((re)=>{let Z=se.get(re);if(Z!==void 0)return Z;let te=Math.min(...J.filter((ie)=>!re.zLayers||re.zLayers.some((ce)=>ce>=ie.minZ&&ce<=ie.maxZ)).map((ie)=>hbe(ie,re)));return se.set(re,te),te});for(let re of[1.01,2,4]){let Z=Math.max(0.01,O.penetration*re);for(let[te,ie]of[[1,0],[-1,0],[0,1],[0,-1],[Math.SQRT1_2,Math.SQRT1_2],[-Math.SQRT1_2,Math.SQRT1_2],[Math.SQRT1_2,-Math.SQRT1_2],[-Math.SQRT1_2,-Math.SQRT1_2]]){if(L.candidateCount>=D)break;L.candidateCount++;let ce=ybr(Y,j,te*Z,ie*Z,m);if(!ce)continue;if(Y$([ce],m,x).length>ee)continue;let ue=[...b];ue[U]=ce;let de=lbe(ue,y,f,p,{evaluation:N,changedRoute:U,routes:b},I,v,M,T);if(de.conflicts.length>N.conflicts.length||de.score>=N.score-0.000000000001)continue;if(de.conflicts.some((ge)=>ge.penetration>(V.get(ge.key)??0)+mr))continue;if(!A.allows(b,ue,[U],!1))continue;let me=I.get(ce);if(!K.some((ge,xe)=>Math.min(...me.filter((Ee)=>!ge.zLayers||ge.zLayers.some((Re)=>Re>=Ee.minZ&&Re<=Ee.maxZ)).map((Ee)=>hbe(Ee,ge)))<Math.min(y,ne[xe])-mr)){b=ue,N=de,H=!0;break}}if(H||L.candidateCount>=D)break}if(H||L.candidateCount>=D)break}if(H||L.candidateCount>=D)break}if(!H)break}return{...L,routes:b,finalConflictCount:N.conflicts.length}})({fixedRoutes:e?.fixedHdRoutes,routes:h,boundary:r,fixedCopperGuard:a,adjacentObstacles:e?.adjacentObstacles,clearanceObstacles:e?.clearanceObstacles,boundaryMargin:s});return h.splice(0,h.length,...u.routes),d.push(((_,p,m)=>({title:`HighDensityRepair02 Final State (margin=${m})`,routes:_,originalRoutes:p}))(o9(h),o9(l),s)),{boundary:r,baseRoutes:l,repairedRoutes:h,frames:d,margin:s,clearanceRepairStats:{nodeClearanceInitialConflictCount:u.initialConflictCount,nodeClearanceFinalConflictCount:u.finalConflictCount,nodeClearanceCandidateCount:u.candidateCount}}},kbr=class extends fa{constructor(e={}){super(),this.params=e,this.showBoundryViolationMarkers=e.showBoundryViolationMarkers??!1}params;frames=[];traceViolationCounts=new WeakMap;clearanceRepairStats={};currentFrameIndex=0;showBoundryViolationMarkers;repairedRoutes=[];_setup(){this.buildFrames();let e=this.getCurrentBoundryViolationCount(),t=this.getCurrentTraceViolationCount();this.stats={...this.clearanceRepairStats,boundryViolationCount:e,traceViolationCount:t,margin:this.params.margin??0.4,frames:this.frames.length,currentFrame:this.currentFrameIndex}}_step(){if(this.frames.length<=1){let n=this.getCurrentBoundryViolationCount(),o=this.getCurrentTraceViolationCount();return this.showBoundryViolationMarkers=!0,this.stats={...this.stats,boundryViolationCount:n,traceViolationCount:o},void(this.solved=!0)}this.currentFrameIndex<this.frames.length-1&&(this.currentFrameIndex+=1);let e=this.getCurrentBoundryViolationCount(),t=this.getCurrentTraceViolationCount();this.stats={...this.clearanceRepairStats,boundryViolationCount:e,traceViolationCount:t,margin:this.params.margin??0.4,frames:this.frames.length,currentFrame:this.currentFrameIndex,title:this.frames[this.currentFrameIndex]?.title},this.currentFrameIndex>=this.frames.length-1&&(this.showBoundryViolationMarkers=!0,this.solved=!0)}getConstructorParams(){return[this.params]}getOutput(){let e=this.getCurrentTraceViolationCount();return{...this.clearanceRepairStats,margin:this.params.margin??0.4,repairedRoutes:this.repairedRoutes,frameCount:this.frames.length,traceViolationCount:e}}setShowBoundryViolationMarkers(e){this.showBoundryViolationMarkers=e}buildFrames(){let e=Qbr(this.params.sample,this.params.margin,this.params.captureProgressFrames??!1,this.params.repairBoundaryDiagonals??!0);this.clearanceRepairStats=e.clearanceRepairStats??{},this.frames=e.frames,this.repairedRoutes=e.repairedRoutes}getCurrentFrame(){let e=this.params.sample;return this.frames[this.currentFrameIndex]??{title:"HighDensityRepair02",routes:o9(e?.nodeHdRoutes??[])}}getBoundryViolationsForFrame(e){let t=WKe(this.params.sample?.nodeWithPortPoints);return t?Y$(e.routes,t,this.params.margin??0.4):[]}getCurrentBoundryViolationCount(){return this.getBoundryViolationsForFrame(this.getCurrentFrame()).length}getRouteNetNames(e){if(!e)return[];let t=[e.connectionName,e.rootConnectionName].filter((n)=>Boolean(n));return Array.from(new Set(t))}areRoutesSameNet(e,t){let n=this.getRouteNetNames(e),o=this.getRouteNetNames(t);return n.length!==0&&o.length!==0&&n.some((r)=>o.includes(r))}getCurrentTraceViolationCount(){let e=this.getCurrentFrame(),t=this.traceViolationCounts.get(e);if(t!==void 0)return t;let n=e.routes,o=new Set(n.map((i,s)=>s)),r=ry(n,o,Iq).filter((i)=>!(i.layers[0]==="via"&&i.layers[1]==="via"||this.areRoutesSameNet(n[i.routeIndexes[0]],n[i.routeIndexes[1]]))).length;return this.traceViolationCounts.set(e,r),r}visualize(){let e=this.params.sample,t=e?.nodeWithPortPoints,n=e?.adjacentObstacles??[],o=this.getCurrentFrame(),r=WKe(t),i=r&&t?.capacityMeshNodeId?[{center:r.center,width:r.width,height:r.height,stroke:"#1d4ed8",fill:"rgba(29, 78, 216, 0.08)",label:t.capacityMeshNodeId}]:r?[{center:r.center,width:r.width,height:r.height,stroke:"#1d4ed8",fill:"rgba(29, 78, 216, 0.08)",label:"capacity-node"}]:[],s=n.filter((u)=>u.center&&u.width&&u.height).map((u,_)=>({center:u.center,width:u.width,height:u.height,stroke:u.type==="oval"?"#a855f7":"#dc2626",fill:u.type==="oval"?"rgba(168, 85, 247, 0.12)":"rgba(220, 38, 38, 0.08)",label:u.type?`obstacle:${u.type}:${_}`:`obstacle:${_}`})),a=this.showBoundryViolationMarkers&&r?this.getBoundryViolationsForFrame(o).map((u)=>{let _=u.end.x-u.start.x,p=u.end.y-u.start.y,m=Math.max(Math.hypot(_,p),0.2),A=Math.abs(_)>=Math.abs(p);return{center:{x:(u.start.x+u.end.x)/2,y:(u.start.y+u.end.y)/2},width:A?m:0.18,height:A?0.18:m,stroke:"#b45309",fill:"rgba(250, 204, 21, 0.45)",label:`boundry-violation:${u.routeIndex}:${u.segmentIndex}`}}):[],c=this.showBoundryViolationMarkers?dbr(o.routes,Iq):[],l=[...(t?.portPoints??[]).map((u)=>({x:u.x,y:u.y,color:"#0f766e",label:u.connectionName??u.portPointId??"port-point"})),...o.routes.flatMap((u)=>u.route??[]).map((u)=>({x:u.x,y:u.y,color:pw(u)==="bottom"?Rcn:"#0ea5e9",label:""})),...o.overlayPoints??[]],h=[...(o.originalRoutes??[]).flatMap((u)=>XKe(u).map((_)=>({..._,strokeColor:"#111111",strokeWidth:Math.max(0.6*_.strokeWidth,0.05),label:`original:${_.label}`}))),...o.routes.filter((u)=>(u.route?.length??0)>=2).flatMap((u)=>XKe(u)),...o.overlayLines??[]],d=o.routes.flatMap((u)=>(u.vias??[]).map((_)=>({center:{x:_.x,y:_.y},radius:(_.diameter??u.viaDiameter??0.3)/2,stroke:"#7c3aed",fill:"rgba(124, 58, 237, 0.2)",label:u.connectionName?`via:${u.connectionName}`:"via"})));return d.push(...c),{coordinateSystem:"cartesian",title:o.title,rects:[...i,...s,...o.overlayRects??[],...a],points:l,lines:h,circles:d,arrows:o.overlayArrows}}},Lbr=(e,t,n,o)=>{let i=new Set;for(let s of[t.route[0],t.route.at(-1)]){if(!s)continue;n.some((a)=>a.__zLayers.includes(s.z)&&Math.abs(s.x-a.center.x)<=a.width/2+0.001&&Math.abs(s.y-a.center.y)<=a.height/2+0.001&&Pw(a,t,o))&&(Math.abs(s.x-(e.center.x-e.width/2))<=0.001&&i.add("left"),Math.abs(s.x-(e.center.x+e.width/2))<=0.001&&i.add("right"),Math.abs(s.y-(e.center.y-e.height/2))<=0.001&&i.add("bottom"),Math.abs(s.y-(e.center.y+e.height/2))<=0.001&&i.add("top"))}return[...i]},Fcn=(e,t)=>e.minX<=t.maxX&&e.maxX>=t.minX&&e.minY<=t.maxY&&e.maxY>=t.minY,dZe=(e,t=0)=>({minX:e.center.x-e.width/2-t,maxX:e.center.x+e.width/2+t,minY:e.center.y-e.height/2-t,maxY:e.center.y+e.height/2+t}),zcn=(e)=>({minX:e.center.x-e.width/2,maxX:e.center.x+e.width/2,minY:e.center.y-e.height/2,maxY:e.center.y+e.height/2}),Hbr=(e,t,n=0)=>{let o=dZe(t,n);return e.x>=o.minX&&e.x<=o.maxX&&e.y>=o.minY&&e.y<=o.maxY},Fbr=(e,t,n)=>e.route.length>0&&t.some((o)=>((r)=>(r.__zLayers?.length??r.layers?.length??0)>1)(o)&&Pw(o,e,n)&&e.route.every((r)=>((i,s)=>{let a=s.width/2,c=s.height/2;return Math.abs(i.x-s.center.x)<=a+0.001&&Math.abs(i.y-s.center.y)<=c+0.001})(r,o))),zbr=(e,t,n)=>{if(e.regionId){let r=t.findIndex((i)=>i.capacityMeshNodeId===e.regionId);if(r!==-1)return r}let o=[...e.route.map(({x:r,y:i})=>({x:r,y:i})),...e.vias.map(({x:r,y:i})=>({x:r,y:i}))];for(let r=0;r<t.length;r++){let i=t[r];if(o.every((s)=>Hbr(s,i,n)))return r}return-1},Obr=(e,t)=>({connectionName:e.connectionName??t.connectionName,rootConnectionName:t.rootConnectionName,...t.startPcbPortId?{startPcbPortId:t.startPcbPortId}:{},...t.endPcbPortId?{endPcbPortId:t.endPcbPortId}:{},regionId:e.capacityMeshNodeId??t.regionId,traceThickness:t.traceThickness,viaDiameter:e.viaDiameter??t.viaDiameter,route:e.route?.map((n)=>({x:n.x,y:n.y,z:n.z??0}))??t.route,vias:e.vias?.map((n)=>({x:n.x,y:n.y}))??t.vias,jumpers:t.jumpers}),Vbr=(e,t,n,o,r)=>{let i=dZe(e,n);return t.search(i).filter((s)=>Fcn(i,zcn(s))).filter((s)=>!r||!o.some((a)=>Pw(s,a,r))).map((s)=>({type:s.type,center:s.center,width:s.width,height:s.height}))},Ule=class extends Kr{repairMargin;minimumTraceWidth;sampleEntries;originalHdRoutes;originalNodeWithPortPoints;originalObstacles;obstacleSHI;colorMap;connMap;repairedRoutesByIndex=new Map;activeSampleIndex=0;activeSubSolver=null;latestVisualization={};constructor(e){super(),this.repairMargin=e.repairMargin??0.2,this.minimumTraceWidth=e.minimumTraceWidth,this.originalHdRoutes=e.hdRoutes,this.originalNodeWithPortPoints=e.nodeWithPortPoints,this.originalObstacles=e.obstacles,this.obstacleSHI=new p6e("flatbush",this.originalObstacles),this.colorMap=e.colorMap??{},this.connMap=e.connMap;let t=new Map;for(let s=0;s<e.hdRoutes.length;s++){if(Fbr(e.hdRoutes[s],e.obstacles,e.connMap))continue;let a=zbr(e.hdRoutes[s],e.nodeWithPortPoints,this.repairMargin);if(a===-1)continue;let c=t.get(a)??[];c.push(s),t.set(a,c)}let n=Bq(e.obstacles,Math.max(2,...e.nodeWithPortPoints.flatMap((s)=>s.availableZ?.map((a)=>a+1)??[]))),o=e.hdRoutes.map((s)=>((a,c,l)=>({capacityMeshNodeId:a.regionId,connectionName:a.connectionName,rootConnectionName:c?.getNetConnectedToId(a.connectionName)??a.rootConnectionName,route:a.route.map((h)=>({x:h.x,y:h.y,z:h.z})),traceThickness:Math.max(a.traceThickness,l??a.traceThickness),vias:a.vias.map((h)=>({x:h.x,y:h.y,diameter:a.viaDiameter})),viaDiameter:a.viaDiameter}))(s,e.connMap,e.minimumTraceWidth)),r=new Lsn(e.hdRoutes.length);for(let[s,a]of e.hdRoutes.entries()){let c=[...a.route,...a.vias];if(c.length===0)throw Error(`High density repair route "${a.connectionName}" has no points`);let l=Math.max(o[s].traceThickness,a.viaDiameter)/2;r.insert({routeIndex:s},Math.min(...c.map((h)=>h.x))-l,Math.min(...c.map((h)=>h.y))-l,Math.max(...c.map((h)=>h.x))+l,Math.max(...c.map((h)=>h.y))+l)}e.hdRoutes.length>0&&r.finish();let i=Array.from(t.entries()).map(([s,a])=>{let c=e.nodeWithPortPoints[s],l=Math.max(...a.map((u)=>Math.max(o[u].traceThickness,e.hdRoutes[u].viaDiameter)/2)),h=dZe(c,Math.max(this.repairMargin,l+0.1)),d=new Set(a);return{node:c,routeIndexes:a,sample:{nodeWithPortPoints:{capacityMeshNodeId:c.capacityMeshNodeId,center:c.center,width:c.width,height:c.height,portPoints:c.portPoints.map((u)=>({x:u.x,y:u.y,z:u.z,connectionName:u.connectionName,portPointId:u.portPointId,prevPortPointId:u.prevPortPointId,nextPortPointId:u.nextPortPointId}))},nodeHdRoutes:a.map((u)=>({...o[u],...e.connMap?{connectedPadSides:Lbr(c,e.hdRoutes[u],n,e.connMap)}:{}})),fixedHdRoutes:r.search(h.minX,h.minY,h.maxX,h.maxY).filter(({routeIndex:u})=>!d.has(u)).map(({routeIndex:u})=>o[u]),clearanceObstacles:n.filter((u)=>Fcn(h,zcn(u))).map((u)=>({type:u.type,center:u.center,width:u.width,height:u.height,zLayers:u.__zLayers,connectedTo:[...new Set(u.connectedTo.flatMap((_)=>{let p=e.connMap?.getNetConnectedToId(_);return p?[_,p]:[_]}))]})),adjacentObstacles:Vbr(c,this.obstacleSHI,this.repairMargin,a.map((u)=>e.hdRoutes[u]),e.connMap)}}});this.sampleEntries=i,this.MAX_ITERATIONS=Math.max(1000*this.sampleEntries.length,1e5),this.stats={sampleCount:this.sampleEntries.length,repairedNodeCount:0,repairedRouteCount:0}}getSolverName(){return"Pipeline4HighDensityRepairSolver"}getConstructorParams(){return[{nodeWithPortPoints:this.sampleEntries.map((e)=>e.node),hdRoutes:this.originalHdRoutes,obstacles:this.originalObstacles,repairMargin:this.repairMargin,minimumTraceWidth:this.minimumTraceWidth,colorMap:this.colorMap,connMap:this.connMap}]}_step(){let e=this.sampleEntries[this.activeSampleIndex];if(e){if(this.activeSubSolver){if(this.activeSubSolver.step(),this.latestVisualization=this.activeSubSolver.visualize(),this.activeSubSolver.failed)return this.failed=!0,this.error=this.activeSubSolver.error??`High density repair failed for node ${e.node.capacityMeshNodeId}`,void(this.activeSubSolver=null);if(!this.activeSubSolver.solved)return;let t=this.activeSubSolver.getOutput().repairedRoutes,n={nodeClearanceInitialConflictCount:Number(this.stats.nodeClearanceInitialConflictCount??0)+Number(this.activeSubSolver.stats.nodeClearanceInitialConflictCount??0),nodeClearanceFinalConflictCount:Number(this.stats.nodeClearanceFinalConflictCount??0)+Number(this.activeSubSolver.stats.nodeClearanceFinalConflictCount??0),nodeClearanceCandidateCount:Number(this.stats.nodeClearanceCandidateCount??0)+Number(this.activeSubSolver.stats.nodeClearanceCandidateCount??0)};for(let o=0;o<e.routeIndexes.length;o++){let r=e.routeIndexes[o],i=this.originalHdRoutes[r],s=t[o];this.repairedRoutesByIndex.set(r,s?Obr(s,i):i)}return this.activeSubSolver=null,this.activeSampleIndex+=1,this.stats={...n,sampleCount:this.sampleEntries.length,repairedNodeCount:this.activeSampleIndex,repairedRouteCount:this.repairedRoutesByIndex.size},void(this.activeSampleIndex>=this.sampleEntries.length&&(this.solved=!0))}this.activeSubSolver=new kbr({repairBoundaryDiagonals:!1,sample:e.sample,margin:this.repairMargin}),this.latestVisualization=this.activeSubSolver.visualize()}else this.solved=!0}getOutput(){return this.originalHdRoutes.map((e,t)=>this.repairedRoutesByIndex.get(t)??e)}visualize(){if(this.activeSubSolver)return this.activeSubSolver.visualize();if(!this.solved)return this.latestVisualization;let e=[],t=[];for(let n of this.getOutput()){let o=this.colorMap[n.connectionName]??"#0ea5e9";for(let r=0;r<n.route.length-1;r++){let i=n.route[r],s=n.route[r+1];i.z===s.z&&e.push({points:[{x:i.x,y:i.y},{x:s.x,y:s.y}],strokeColor:i.z===0?o:Qi(o,0.5),strokeWidth:n.traceThickness,layer:`z${i.z}`,strokeDash:i.z!==0?[0.1,0.3]:void 0})}for(let r of n.vias)t.push({center:{x:r.x,y:r.y},radius:n.viaDiameter/2,stroke:o,fill:"rgba(14,165,233,0.12)"})}return{title:"Pipeline4 High Density Repair",lines:e,circles:t}}},Nae=0.000001,VGt=({startGap:e,endGap:t,segmentGap:n,requiredGap:o})=>{let r=e<o&&t>=o-Nae&&n>=e-Nae,i=t<o&&e>=o-Nae&&n>=t-Nae,s=e<o&&t<o&&n>=Math.min(e,t)-Nae;return r||i||s},Ybr=class{minClearance;rootsByConnection=new Map;sameNetCache=new Map;segments=[];vias=[];segmentIndexesByLayer;viaIndex;constructor({hdRoutes:e,minClearance:t=0.1}){this.minClearance=t;for(let n of e)this.addRoute(n);this.buildSpatialIndexes()}addRoute(e){let t=this.rootsByConnection.get(e.connectionName)??new Set;t.add(e.rootConnectionName??e.connectionName),this.rootsByConnection.set(e.connectionName,t),this.sameNetCache.clear();for(let n=0;n<e.route.length-1;n+=1){let o=e.route[n],r=e.route[n+1];if(o.z!==r.z)continue;if(o.insideJumperPad&&r.insideJumperPad)continue;let i={connectionName:e.connectionName,start:o,end:r,traceThickness:e.traceThickness};this.segments.push(i),this.insertSegmentIntoSpatialIndex(i)}for(let n of e.vias){let o={connectionName:e.connectionName,x:n.x,y:n.y,diameter:e.viaDiameter};this.vias.push(o),this.insertViaIntoSpatialIndex(o)}}insertSegmentIntoSpatialIndex(e){if(!this.segmentIndexesByLayer)return;let t=this.segmentIndexesByLayer.get(e.start.z);t||(t=new Ice,this.segmentIndexesByLayer.set(e.start.z,t));let n=e.traceThickness/2;t.insert(e,Math.min(e.start.x,e.end.x)-n,Math.min(e.start.y,e.end.y)-n,Math.max(e.start.x,e.end.x)+n,Math.max(e.start.y,e.end.y)+n)}insertViaIntoSpatialIndex(e){if(!this.viaIndex)return;let t=e.diameter/2;this.viaIndex.insert(e,e.x-t,e.y-t,e.x+t,e.y+t)}buildSpatialIndexes(){this.segmentIndexesByLayer=new Map;let e=new Map;for(let t of this.segments){let n=e.get(t.start.z);n?n.push(t):e.set(t.start.z,[t])}for(let[t,n]of e){let o=new Ice;o.bulkLoad(n.map((r)=>{let i=r.traceThickness/2;return{item:r,minX:Math.min(r.start.x,r.end.x)-i,minY:Math.min(r.start.y,r.end.y)-i,maxX:Math.max(r.start.x,r.end.x)+i,maxY:Math.max(r.start.y,r.end.y)+i}})),this.segmentIndexesByLayer.set(t,o)}this.viaIndex=new Ice,this.viaIndex.bulkLoad(this.vias.map((t)=>{let n=t.diameter/2;return{item:t,minX:t.x-n,minY:t.y-n,maxX:t.x+n,maxY:t.y+n}}))}areSameNet(e,t){if(e===t)return!0;let n=this.sameNetCache.get(e)?.get(t);if(n!==void 0)return n;let o=this.rootsByConnection.get(e),r=this.rootsByConnection.get(t),i=!1;if(o&&r){for(let a of o)if(r.has(a)){i=!0;break}}let s=this.sameNetCache.get(e);return s||(s=new Map,this.sameNetCache.set(e,s)),s.set(t,i),i}isSegmentClear({connectionName:e,start:t,end:n,traceThickness:o}){let r=o/2,i=this.minClearance+r,s=Math.min(t.x,n.x)-i,a=Math.min(t.y,n.y)-i,c=Math.max(t.x,n.x)+i,l=Math.max(t.y,n.y)+i,h=this.segmentIndexesByLayer?.get(t.z)?.search(s,a,c,l)??[];for(let u of h){if(this.areSameNet(e,u.connectionName))continue;let _=this.minClearance+r+u.traceThickness/2,p=WO(t,n,u.start,u.end);if(p<_&&!VGt({startGap:oc(t,u.start,u.end),endGap:oc(n,u.start,u.end),segmentGap:p,requiredGap:_}))return!1}let d=this.viaIndex?.search(s,a,c,l)??[];for(let u of d){if(this.areSameNet(e,u.connectionName))continue;let _=this.minClearance+r+u.diameter/2,p=oc(u,t,n);if(p<_&&!VGt({startGap:Math.hypot(t.x-u.x,t.y-u.y),endGap:Math.hypot(n.x-u.x,n.y-u.y),segmentGap:p,requiredGap:_}))return!1}return!0}},Q2=0.000000001,uZe=1.25,JR=(e,t)=>e<t?-1:e>t?1:0,oS=(e,t)=>JR(e.z,t.z)||JR(e.x,t.x)||JR(e.y,t.y),YGt=(e)=>`${e.z.toFixed(6)}:${e.x.toFixed(6)}:${e.y.toFixed(6)}`,GGt=(e)=>{let t=e.route.map(YGt).join("|"),n=[...e.route].reverse().map(YGt).join("|");return t<=n?t:n},ple=(e,t)=>{let n=e.connectionName.localeCompare(t.connectionName);if(n!==0)return n;let o=(e.rootConnectionName??"").localeCompare(t.rootConnectionName??"");if(o!==0)return o;let r=GGt(e).localeCompare(GGt(t));return r!==0?r:JR(e.traceThickness,t.traceThickness)||JR(e.viaDiameter,t.viaDiameter)||JR(e.route.length,t.route.length)||JR(e.vias.length,t.vias.length)||JR(e.jumpers?.length??0,t.jumpers?.length??0)},UGt=1e5,FR=0.001,WGt=1.000000001,SXe=class extends Kr{getSolverName(){return"SingleHighDensityRouteStitchSolver3"}mergedHdRoute;remainingHdRoutes;start;end;colorMap;allowedLayerTransitionPointKeys;isStitchSegmentClear;stitchClearanceMode;isPlanarStitchClear(e,t){return this.isStitchSegmentClear({connectionName:this.mergedHdRoute.connectionName,start:e,end:t,traceThickness:this.mergedHdRoute.traceThickness})}constructor(e){super();let t=[...e.hdRoutes].sort(ple);if(this.remainingHdRoutes=t,this.colorMap=e.colorMap??{},this.allowedLayerTransitionPointKeys=e.allowedLayerTransitionPointKeys,this.isStitchSegmentClear=e.isStitchSegmentClear,this.stitchClearanceMode=e.stitchClearanceMode,t.length===0){this.start=e.start,this.end=e.end;let _=e.defaultTraceThickness??0.15,p=[{x:e.start.x,y:e.start.y,z:e.start.z}],m=[];if(e.start.z!==e.end.z){if(e.allowedLayerTransitionPointKeys&&!e.allowedLayerTransitionPointKeys.has(C$(e.start)))return this.failed=!0,void(this.error=`Layer transition at ${C$(e.start)} is not allowed`);p.push({x:e.start.x,y:e.start.y,z:e.end.z}),m.push({x:e.start.x,y:e.start.y})}let A=p[p.length-1],g={x:e.end.x,y:e.end.y,z:e.end.z},f={connectionName:e.connectionName,start:A,end:g,traceThickness:_};return Dn(A,g)>FR&&!this.isStitchSegmentClear(f)&&this.stitchClearanceMode==="require_clear"?(this.failed=!0,void(this.error=`Terminal stitch for "${e.connectionName}" violates copper clearance`)):(p.push(g),this.mergedHdRoute={connectionName:e.connectionName,...e.preserveTerminalPcbPortIds&&e.start.pcb_port_id?{startPcbPortId:e.start.pcb_port_id}:{},...e.preserveTerminalPcbPortIds&&e.end.pcb_port_id?{endPcbPortId:e.end.pcb_port_id}:{},rootConnectionName:t[0]?.rootConnectionName,route:p,vias:m,jumpers:[],viaDiameter:e.defaultViaDiameter??0.3,traceThickness:_},void(this.solved=!0))}let n=new Set((e.preserveTerminalPcbPortIds?[e.start.pcb_port_id,e.end.pcb_port_id]:[]).filter((_)=>_!==void 0));if(e.preserveTerminalPcbPortIds&&e.start.pcb_port_id&&e.start.pcb_port_id===e.end.pcb_port_id)throw Error(`SingleHighDensityRouteStitchSolver3 received duplicate PCB terminal "${e.start.pcb_port_id}" for "${e.connectionName}"`);let o=t.flatMap((_)=>[_.startPcbPortId,_.endPcbPortId]).filter((_)=>_!==void 0);if(n.size>0){for(let _ of o)if(!n.has(_))throw Error(`SingleHighDensityRouteStitchSolver3 found unknown PCB terminal "${_}" on "${e.connectionName}"`)}let r=1/0,i=t[0],s="start-to-end";for(let _ of t){let p=_.route[0],m=_.route[_.route.length-1],A=Dn(e.start,p),g=Dn(e.start,m),f=Dn(e.end,p),y=Dn(e.end,m),x=Math.min(A,g,f,y);(x<r-Q2||Math.abs(x-r)<=Q2&&ple(_,i)<0)&&(r=x,i=_,s=Math.min(f,y)<Math.min(A,g)-Q2||Math.abs(Math.min(f,y)-Math.min(A,g))<=Q2&&oS(e.end,e.start)<0?"end-to-start":"start-to-end")}s==="start-to-end"?(this.start=e.start,this.end=e.end):(this.start=e.end,this.end=e.start);let a=i.route[0],c=i.route[i.route.length-1],l=Dn(this.start,a),h=Dn(this.start,c),d=l<h-Q2||Math.abs(l-h)<=Q2&&oS(a,c)<=0?a:c,u=d===a?i.startPcbPortId:i.endPcbPortId;if(u&&this.start.pcb_port_id&&u!==this.start.pcb_port_id)throw Error(`SingleHighDensityRouteStitchSolver3 terminal identity disagrees with route orientation for "${e.connectionName}"`);this.mergedHdRoute={connectionName:e.connectionName,...e.preserveTerminalPcbPortIds&&this.start.pcb_port_id?{startPcbPortId:this.start.pcb_port_id}:{},...e.preserveTerminalPcbPortIds&&this.end.pcb_port_id?{endPcbPortId:this.end.pcb_port_id}:{},rootConnectionName:i.rootConnectionName,route:[{x:this.start.x,y:this.start.y,z:d.z}],vias:[],jumpers:[],viaDiameter:i.viaDiameter,traceThickness:i.traceThickness}}getDisjointedRoute(){for(let e of this.remainingHdRoutes)if([e.route[0],e.route[e.route.length-1]].some((t)=>!this.remainingHdRoutes.some((n)=>{if(n===e)return!1;return[n.route[0],n.route[n.route.length-1]].some((o)=>o.z===t.z&&Dn(t,o)<0.001)})))return{firstRoute:e};return{firstRoute:this.remainingHdRoutes[0]}}_step(){let e=this.mergedHdRoute.route.at(-1),t=this.mergedHdRoute.endPcbPortId!==void 0&&e.z===this.end.z&&Dn(e,this.end)<FR;if(this.remainingHdRoutes.length===0||t){let l=this.mergedHdRoute.route[this.mergedHdRoute.route.length-1],h={...this.end,z:l.z},d=Dn(l,h);if(d>FR&&d<=uZe){if(!this.isPlanarStitchClear(l,h)&&this.stitchClearanceMode==="require_clear")return this.failed=!0,void(this.error=`Terminal stitch for "${this.mergedHdRoute.connectionName}" violates copper clearance`);this.mergedHdRoute.route.push({x:this.end.x,y:this.end.y,z:l.z})}return void(this.solved=!0)}let n=this.mergedHdRoute.route[this.mergedHdRoute.route.length-1],o=-1,r="first",i=1/0,s=!1;for(let l=0;l<this.remainingHdRoutes.length;l++){let h=this.remainingHdRoutes[l],d=h.route[0],u=h.route[h.route.length-1],_=Dn(n,d),p=Dn(n,u),m=1/0;if(n.z===d.z){if(_<FR)m=_;else if(_<=1){let g=this.isPlanarStitchClear(n,d);if(g||this.stitchClearanceMode==="prefer_clear")m=UGt+(g?0:WGt)+_;else s=!0}}else _<FR&&(!this.allowedLayerTransitionPointKeys||this.allowedLayerTransitionPointKeys.has(C$(d)))&&(m=1000+_);m<i&&(i=m,o=l,r="first");let A=1/0;if(n.z===u.z){if(p<FR)A=p;else if(p<=1){let g=this.isPlanarStitchClear(n,u);if(g||this.stitchClearanceMode==="prefer_clear")A=UGt+(g?0:WGt)+p;else s=!0}}else p<FR&&(!this.allowedLayerTransitionPointKeys||this.allowedLayerTransitionPointKeys.has(C$(u)))&&(A=1000+p);A<i&&(i=A,o=l,r="last")}if(o===-1)return s?(this.failed=!0,void(this.error=`Route stitch for "${this.mergedHdRoute.connectionName}" violates copper clearance`)):void(this.remainingHdRoutes=[]);let a=this.remainingHdRoutes[o],c;this.remainingHdRoutes.splice(o,1),c=r==="first"?a.route:((l)=>{let h=[...l].reverse().map((d)=>{let{toNextSegmentType:u,..._}=d;return _});for(let d=0;d<l.length-1;d++){let u=l[d]?.toNextSegmentType;if(!u)continue;let _=l.length-d-2;h[_]={...h[_],toNextSegmentType:u}}return h})(a.route),c.length>0&&Dn(n,c[0])<FR&&n.z===c[0].z?(c[0].toNextSegmentType&&(n.toNextSegmentType=c[0].toNextSegmentType),this.mergedHdRoute.route.push(...c.slice(1))):this.mergedHdRoute.route.push(...c),this.mergedHdRoute.vias.push(...a.vias),a.jumpers&&this.mergedHdRoute.jumpers.push(...a.jumpers)}visualize(){let e={points:[],lines:[],circles:[],rects:[],title:"Single High Density Route Stitch Solver 3"};if(e.points?.push({x:this.start.x,y:this.start.y,color:"green",label:"Start"},{x:this.end.x,y:this.end.y,color:"red",label:"End"}),this.mergedHdRoute&&this.mergedHdRoute.route.length>1){e.lines?.push({points:this.mergedHdRoute.route.map((t)=>({x:t.x,y:t.y})),strokeColor:"green"});for(let t of this.mergedHdRoute.route)e.points?.push({x:t.x,y:t.y,color:"green"});for(let t of this.mergedHdRoute.vias)e.circles?.push({center:{x:t.x,y:t.y},radius:this.mergedHdRoute.viaDiameter/2,fill:"green"});if(this.mergedHdRoute.jumpers&&this.mergedHdRoute.jumpers.length>0){let t=m9(this.mergedHdRoute.jumpers,{color:"green",label:this.mergedHdRoute.connectionName});e.rects.push(...t.rects??[]),e.lines.push(...t.lines??[])}}for(let t of this.remainingHdRoutes){e.lines?.push({points:t.route.map((n)=>({x:n.x,y:n.y})),strokeColor:"orange"});for(let n of t.route)e.points?.push({x:n.x,y:n.y,color:"orange"});for(let n of t.vias)e.circles?.push({center:{x:n.x,y:n.y},radius:t.viaDiameter/2,fill:"orange"});if(t.jumpers&&t.jumpers.length>0){let n=m9(t.jumpers,{color:"orange",label:t.connectionName});e.rects.push(...n.rects??[]),e.lines.push(...n.lines??[])}}return e}},Gbr=class{constructor(e=!1){this.preferSameLayerTerminalEndpoints=e}preferSameLayerTerminalEndpoints;endpointClusters=new Map;getEndpointKey(e,t){let n=this.endpointClusters.get(e)??[],o,r=1/0;for(let s of n){if(s.point.z!==t.z)continue;let a=Dn(s.point,t);a<=0.1&&(a<r-Q2||Math.abs(a-r)<=Q2&&(!o||oS(s.point,o.point)<0))&&(o=s,r=a)}if(o)return o.key;let i=`${e}:endpoint_${n.length}`;return n.push({key:i,point:{x:t.x,y:t.y,z:t.z}}),this.endpointClusters.set(e,n),i}getClusters(e){return this.endpointClusters.get(e)??[]}getClosestEndpointKey(e,t,n){let o=t.flatMap((l)=>[l.route[0],l.route[l.route.length-1]]),r=o.filter((l)=>l.z===n.z),i=this.preferSameLayerTerminalEndpoints&&r.length>0?r:o,s=null,a=null,c=1/0;for(let l of i){let h=Dn(n,l),d=this.getEndpointKey(e,l);(h<c-Q2||Math.abs(h-c)<=Q2&&(s===null||d.localeCompare(s)<0||d===s&&a!==null&&oS(l,a)<0))&&(c=h,s=d,a=l)}return s}},O3e=(e,t,n)=>{let o=e.get(t)??[];o.some((r)=>r.nextHash===n.nextHash&&r.routeIndex===n.routeIndex)||(o.push(n),e.set(t,o))},Ubr=(e)=>{let t=[...e.possibleEndpoints].sort(oS),n=t.reduce((i,s)=>{let a=Dn(s,e.globalStart),c=Dn(i,e.globalStart);return a<c-Q2||Math.abs(a-c)<=Q2&&oS(s,i)<0?s:i}),o=t.filter((i)=>i!==n),r=(o.length>0?o:e.possibleEndpoints).reduce((i,s)=>{let a=Dn(s,e.globalEnd),c=Dn(i,e.globalEnd);return a<c-Q2||Math.abs(a-c)<=Q2&&oS(s,i)<0?s:i});return{start:n,end:r}},XGt=(e)=>{let t=[...e.terminals].sort(oS),n=t[0],o=Dn(e.islandEndpoint,n);for(let r of t.slice(1)){let i=Dn(e.islandEndpoint,r);(i<o-Q2||Math.abs(i-o)<=Q2&&oS(r,n)<0)&&(n=r,o=i)}return o<=uZe?n:e.islandEndpoint},PXe=(e)=>{if(e.hdRoutes.length<=2)return e.hdRoutes;let t=[...e.hdRoutes].sort(ple),n=e.endpointIndex.getClosestEndpointKey(e.connectionName,t,e.start),o=e.endpointIndex.getClosestEndpointKey(e.connectionName,t,e.end);if(!n||!o||n===o)return t;let r=new Map;for(let u=0;u<t.length;u++){let _=t[u],p=e.endpointIndex.getEndpointKey(e.connectionName,_.route[0]),m=e.endpointIndex.getEndpointKey(e.connectionName,_.route[_.route.length-1]);O3e(r,p,{nextHash:m,routeIndex:u}),O3e(r,m,{nextHash:p,routeIndex:u})}let i=[...e.endpointIndex.getClusters(e.connectionName)].sort((u,_)=>oS(u.point,_.point));for(let u=0;u<i.length;u++){let _=i[u];for(let p=u+1;p<i.length;p++){let m=i[p];_.point.z===m.point.z&&(Dn(_.point,m.point)>1||(O3e(r,_.key,{nextHash:m.key,routeIndex:null}),O3e(r,m.key,{nextHash:_.key,routeIndex:null})))}}for(let[u,_]of r.entries())r.set(u,[..._].sort((p,m)=>{if(p.routeIndex===null&&m.routeIndex!==null)return 1;if(p.routeIndex!==null&&m.routeIndex===null)return-1;if(p.routeIndex!==null&&m.routeIndex!==null){let A=ple(t[p.routeIndex],t[m.routeIndex]);if(A!==0)return A}return p.nextHash.localeCompare(m.nextHash)}));let s=[n],a=new Set([n]),c=new Map;for(;s.length>0;){let u=s.shift();if(u===o)break;for(let _ of r.get(u)??[])a.has(_.nextHash)||(a.add(_.nextHash),c.set(_.nextHash,{prevHash:u,routeIndex:_.routeIndex}),s.push(_.nextHash))}if(!a.has(o))return t;let l=[],h=o;for(;h!==n;){let u=c.get(h);if(!u)return t;u.routeIndex!==null&&l.push(u.routeIndex),h=u.prevHash}if(l.length===0)return e.hdRoutes;let d=l.reverse().map((u)=>t[u]);return d.length>0&&!e.canStitchBetweenTerminals({connectionName:e.connectionName,hdRoutes:d,start:e.start,end:e.end})?t:d},x6e=class extends Kr{getSolverName(){return"MultipleHighDensityRouteStitchSolver3"}unsolvedRoutes;activeSolver=null;mergedHdRoutes=[];colorMap={};defaultTraceThickness;defaultViaDiameter;allowedLayerTransitionPointKeys;preserveTerminalPcbPortIds;endpointIndex;clearanceValidator;canStitchBetweenTerminals(e){let t=new SXe({connectionName:e.connectionName,hdRoutes:e.hdRoutes,start:e.start,end:e.end,colorMap:this.colorMap,defaultTraceThickness:this.defaultTraceThickness,defaultViaDiameter:this.defaultViaDiameter,allowedLayerTransitionPointKeys:this.allowedLayerTransitionPointKeys,preserveTerminalPcbPortIds:this.preserveTerminalPcbPortIds,isStitchSegmentClear:(r)=>this.clearanceValidator.isSegmentClear(r),stitchClearanceMode:"require_clear"});for(;!t.solved&&!t.failed&&t.iterations<t.MAX_ITERATIONS;)t.step();if(t.failed)return!1;let n=t.mergedHdRoute.route[0],o=t.mergedHdRoute.route[t.mergedHdRoute.route.length-1];return n.z===t.start.z&&o.z===t.end.z&&Dn(n,t.start)+Dn(o,t.end)<=uZe}getSharedRootPathRoutes(e){let t=e.rootConnectionName;if(!t)return null;let n=new Set(e.hdRoutes),o=e.allHdRoutes.filter((i)=>(i.rootConnectionName??i.connectionName)===t);if(o.every((i)=>n.has(i)))return null;let r=PXe({connectionName:e.connectionName,hdRoutes:o,start:e.start,end:e.end,endpointIndex:this.endpointIndex,canStitchBetweenTerminals:(i)=>this.canStitchBetweenTerminals(i)});return!r.some((i)=>!n.has(i))||r.length>=o.length?null:r}constructor(e){super(),this.endpointIndex=new Gbr(e.preferSameLayerTerminalEndpoints),this.colorMap=e.colorMap??{},this.allowedLayerTransitionPointKeys=e.allowedLayerTransitionPointKeys,this.preserveTerminalPcbPortIds=e.preserveTerminalPcbPortIds??!1;let t=[...e.hdRoutes].sort(ple);this.clearanceValidator=new Ybr({hdRoutes:t});let n=t[0];this.defaultTraceThickness=n?.traceThickness??0.15,this.defaultViaDiameter=n?.viaDiameter??e.defaultViaDiameter??0.3;let o=new GJe({}),r=[],i=new Map;for(let c=0;c<t.length;c++){let l=t[c],h=l.route[0],d=l.route[l.route.length-1];r.push([`route_island_${c}`,this.endpointIndex.getEndpointKey(l.connectionName,h),this.endpointIndex.getEndpointKey(l.connectionName,d)])}o.addConnections(r);for(let c of r)for(let l of c.slice(1))i.set(l,(i.get(l)??0)+1);this.unsolvedRoutes=[];let s=Array.from(new Set(Object.values(o.idToNetMap)));for(let c of s){let l=o.getIdsConnectedToNet(c),h=t.filter((y,x)=>l.includes(`route_island_${x}`));if(h.length===0)continue;let d=e.connections.find((y)=>y.name===h[0].connectionName),u=h.flatMap((y)=>[y.route[0],y.route[y.route.length-1]]),_=new Map,p=[];for(let y of u){let x=this.endpointIndex.getEndpointKey(h[0].connectionName,y);_.has(x)||_.set(x,y),i.get(x)===1&&p.push(y)}let m=p.length>0?p:[..._.values()];if(m.length===0)continue;let A,g;if(m.length>=2){let y={...d.pointsToConnect[0],z:ti(Ef(d.pointsToConnect[0]),e.layerCount)},x={...d.pointsToConnect[1],z:ti(Ef(d.pointsToConnect[1]),e.layerCount)};({start:A,end:g}=Ubr({possibleEndpoints:m,globalStart:y,globalEnd:x})),Dn(A,d.pointsToConnect[1])<Dn(g,d.pointsToConnect[0])&&([A,g]=[g,A]),A=XGt({islandEndpoint:A,terminals:[y,x]}),g=XGt({islandEndpoint:g,terminals:[y,x]})}else A={...d.pointsToConnect[0],z:ti(Ef(d.pointsToConnect[0]),e.layerCount)},g={...d.pointsToConnect[1],z:ti(Ef(d.pointsToConnect[1]),e.layerCount)};let f=PXe({connectionName:h[0].connectionName,hdRoutes:h,start:A,end:g,endpointIndex:this.endpointIndex,canStitchBetweenTerminals:(y)=>this.canStitchBetweenTerminals(y)});this.unsolvedRoutes.push({connectionName:h[0].connectionName,hdRoutes:f,start:A,end:g})}let a=new Map;for(let c of this.unsolvedRoutes){let l=a.get(c.connectionName);l?l.push(c):a.set(c.connectionName,[c])}this.unsolvedRoutes=Array.from(a.entries()).flatMap(([c,l])=>{let h=e.connections.find((g)=>g.name===c),d=l.some((g)=>g.hdRoutes.some((f)=>f.route.length<2)),u=l.length>1&&((g)=>{for(let f=0;f<g.length;f++)for(let y=f+1;y<g.length;y++){let x=[g[f].start,g[f].end],C=[g[y].start,g[y].end];for(let b of x)for(let I of C)if(b.z===I.z&&Dn(b,I)<=1)return!0}return!1})(l);if(!h)return l;let _={...h.pointsToConnect[0],z:ti(Ef(h.pointsToConnect[0]),e.layerCount)},p={...h.pointsToConnect[1],z:ti(Ef(h.pointsToConnect[1]),e.layerCount)},m=l.flatMap((g)=>g.hdRoutes),A=l.length>1?this.getSharedRootPathRoutes({connectionName:c,rootConnectionName:h.__rootConnectionNames?.[0]??m[0]?.rootConnectionName,hdRoutes:m,allHdRoutes:t,start:_,end:p}):null;return d||u||A?[{connectionName:c,hdRoutes:A??PXe({connectionName:c,hdRoutes:m,start:_,end:p,endpointIndex:this.endpointIndex,canStitchBetweenTerminals:(g)=>this.canStitchBetweenTerminals(g)}),start:_,end:p}]:l}),this.MAX_ITERATIONS=1e5}_step(){if(this.activeSolver)return this.activeSolver.step(),void(this.activeSolver.solved?(this.activeSolver instanceof SXe&&(this.clearanceValidator.addRoute(this.activeSolver.mergedHdRoute),this.mergedHdRoutes.push(this.activeSolver.mergedHdRoute)),this.activeSolver=null):this.activeSolver.failed&&(this.failed=!0,this.error=this.activeSolver.error));let e=this.unsolvedRoutes.pop();if(!e){let t=new Set;for(let n of this.mergedHdRoutes)n.startPcbPortId&&n.endPcbPortId&&t.add(n.connectionName);return this.mergedHdRoutes=this.mergedHdRoutes.filter((n)=>!t.has(n.connectionName)||Boolean(n.startPcbPortId&&n.endPcbPortId)),void(this.solved=!0)}this.activeSolver=new SXe({connectionName:e.connectionName,hdRoutes:e.hdRoutes,start:e.start,end:e.end,colorMap:this.colorMap,defaultTraceThickness:this.defaultTraceThickness,defaultViaDiameter:this.defaultViaDiameter,allowedLayerTransitionPointKeys:this.allowedLayerTransitionPointKeys,preserveTerminalPcbPortIds:this.preserveTerminalPcbPortIds,isStitchSegmentClear:(t)=>this.clearanceValidator.isSegmentClear(t),stitchClearanceMode:"prefer_clear"})}visualize(){let e={points:[],lines:[],circles:[],rects:[],title:"Multiple High Density Route Stitch Solver 3"};if(this.activeSolver){let t=this.activeSolver.visualize();t.points?.length&&e.points?.push(...t.points),t.lines?.length&&e.lines?.push(...t.lines),t.circles?.length&&e.circles?.push(...t.circles),t.rects?.length&&(e.rects||(e.rects=[]),e.rects.push(...t.rects))}for(let[t,n]of this.mergedHdRoutes.entries()){let o=this.colorMap[n.connectionName]??`hsl(120, 100%, ${40+10*t%40}%)`;for(let r=0;r<n.route.length-1;r++){let i=n.route[r],s=n.route[r+1],a=i.z!==0?Qi(o,0.5):o;e.lines?.push({points:[{x:i.x,y:i.y},{x:s.x,y:s.y}],strokeColor:a,strokeWidth:n.traceThickness})}for(let r of n.route){let i=r.z!==0?Qi(o,0.5):o;e.points?.push({x:r.x,y:r.y,color:i})}for(let r of n.vias)e.circles?.push({center:{x:r.x,y:r.y},radius:n.viaDiameter/2,fill:o});if(n.jumpers&&n.jumpers.length>0){let r=m9(n.jumpers,{color:o,label:n.connectionName});e.rects.push(...r.rects??[]),e.lines.push(...r.lines??[])}}return e}},Ocn=(e)=>(e%360+360)%360,Wbr=(e,t)=>{let{ccwRotationDegrees:n,...o}=e,r=((i)=>{let s=Ocn(i),a=[0,90,180,270];for(let c of a)if(Math.min(Math.abs(s-c),360-Math.abs(s-c))<=0.01)return c;return null})(t);return r===90||r===270?{...o,width:e.height,height:e.width}:o},jGt=(e,t)=>!(zx(e).length>0&&!zx(e).some((n)=>t.layers.includes(n)))&&fCe(e,Md(t)),KGt=(e,t)=>{let{minX:n,maxX:o,minY:r,maxY:i}=Md(t);return{x:Math.max(n,Math.min(o,e.x)),y:Math.max(r,Math.min(i,e.y))}},Xbr=(e,t)=>e.obstacleId??`${e.componentId??"obstacle"}_${t}`;function Vcn(e,t=2){let{center:n,width:o,height:r,rotation:i}=e,s=[],a=Math.max(1,Math.ceil(t)),c=i*Math.PI/180,l=Math.cos(c),h=Math.sin(c);if(o>=r){let d=o/a;for(let u=0;u<a;u++){let _=(u-a/2+0.5)*d,p=_*l,m=_*h,A=Math.abs(d*l)+Math.abs(r*h),g=Math.abs(d*h)+Math.abs(r*l);s.push({center:{x:n.x+p,y:n.y+m},width:A,height:g})}}else{let d=r/a;for(let u=0;u<a;u++){let _=(u-a/2+0.5)*d,p=-_*h,m=_*l,A=Math.abs(o*l)+Math.abs(d*h),g=Math.abs(o*h)+Math.abs(d*l);s.push({center:{x:n.x+p,y:n.y+m},width:A,height:g})}}return s}var Ycn=(e)=>{if(e.type==="oval")return Ycn({...e,type:"rect"});let t=e.ccwRotationDegrees;if(typeof t!="number"||!Number.isFinite(t))return[e];if(((l)=>{let h=Ocn(l);return[0,90,180,270].some((d)=>Math.min(Math.abs(h-d),360-Math.abs(h-d))<=0.01)})(t))return[Wbr(e,t)];let{ccwRotationDegrees:n,...o}=e,r={center:e.center,width:e.width,height:e.height,rotation:t},i=((l)=>{let h=Math.max(l.width,l.height),d=Math.min(l.width,l.height);return l.obstacleId?.startsWith("trace_obstacle_")?Math.max(2,Math.ceil(h/0.75)):d<=0?2:h/d<2||d>=0.9?null:Math.max(2,Math.ceil(h/0.75))})(e),s=e.connectedTo.length>0&&!e.obstacleId?.startsWith("trace_obstacle_"),a=e.isNonPlatedHole||s?((l)=>{let h=l.rotation*Math.PI/180,d=Math.cos(h),u=Math.sin(h),_=[-1,1].flatMap((M)=>[-1,1].map((B)=>{let T=M*(l.width/2),N=B*(l.height/2);return{x:l.center.x+T*d-N*u,y:l.center.y+T*u+N*d}})),p=[_[0],_[2],_[3],_[1]],m=Math.min(...p.map((M)=>M.x)),A=Math.max(...p.map((M)=>M.x)),g=Math.min(...p.map((M)=>M.y)),f=Math.max(...p.map((M)=>M.y)),y=A-m<=f-g?"x":"y",x=y==="x"?m:g,C=y==="x"?A:f,b=Math.max(1,Math.ceil((C-x)/0.4)),I=(C-x)/b,v=(M,B,T)=>{let N=[],D=(L)=>L[y];for(let L=0;L<M.length;L++){let H=M[L],V=M[(L+1)%M.length],O=D(H),U=D(V),j=T?O>=B:O<=B,Y=T?U>=B:U<=B;if(j&&N.push(H),j===Y)continue;let X=(B-O)/(U-O);N.push({x:H.x+(V.x-H.x)*X,y:H.y+(V.y-H.y)*X})}return N},P=[];for(let M=0;M<b;M++){let B=x+M*I,T=M===b-1?C:B+I,N=v(v(p,B,!0),T,!1);if(N.length===0)continue;let D=Math.min(...N.map((O)=>O.x)),L=Math.max(...N.map((O)=>O.x)),H=Math.min(...N.map((O)=>O.y)),V=Math.max(...N.map((O)=>O.y));P.push({center:{x:(D+L)/2,y:(H+V)/2},width:L-D,height:V-H})}return P})(r):i===null?((l,h)=>{let{center:d,width:u,height:_,rotation:p}=l,m=Math.max(1,Math.ceil(u/h)),A=Math.max(1,Math.ceil(_/h)),g=u/m,f=_/A,y=p*Math.PI/180,x=Math.cos(y),C=Math.sin(y),b=[];for(let I=0;I<m;I++){let v=(I-m/2+0.5)*g;for(let P=0;P<A;P++){let M=(P-A/2+0.5)*f;b.push({center:{x:d.x+v*x-M*C,y:d.y+v*C+M*x},width:Math.abs(g*x)+Math.abs(f*C),height:Math.abs(g*C)+Math.abs(f*x)})}}return b})(r,((l)=>l.obstacleId?.startsWith("trace_obstacle_")?0.75:0.4)(e)):Vcn(r,i),c=e.connectedTo.length>0?a.reduce((l,h,d)=>{let u=a[l],_=(u.center.x-e.center.x)**2+(u.center.y-e.center.y)**2;return(h.center.x-e.center.x)**2+(h.center.y-e.center.y)**2<_?d:l},0):-1;return a.map((l,h)=>({...o,obstacleId:h===c?o.obstacleId:o.obstacleId?`${o.obstacleId}_approx_${h}`:void 0,connectedTo:o.connectedTo,center:l.center,width:l.width,height:l.height}))},Gcn=(e)=>{let t=new Map,n=new Map,o=new Map;for(let[i,s]of e.obstacles.entries()){let a=Ycn(s),c=Xbr(s,i);n.set(c,a),o.set(c,s);for(let l of a){let h=[l.center.x.toFixed(6),l.center.y.toFixed(6),l.width.toFixed(6),l.height.toFixed(6),l.layers.join(","),l.isNonPlatedHole?"hole":""].join(":"),d=t.get(h);d?d.connectedTo=[...new Set([...d.connectedTo,...l.connectedTo])]:t.set(h,l)}}let r=e.connections.map((i)=>({...i,pointsToConnect:i.pointsToConnect.map((s)=>{let a=((c)=>[c.pointId,c.pcb_port_id].filter((l)=>Boolean(l)))(s);if(a.length===0)return s;for(let[c,l]of o){if(!a.some((_)=>l.connectedTo.includes(_)))continue;if(!jGt(s,l))continue;let h=n.get(c)??[];if(h.length===0)continue;if(h.some((_)=>jGt(s,_)))return s;let d=h[0],u=Number.POSITIVE_INFINITY;for(let _ of h){let p=Dn(KGt(s,_),s);p<u&&(u=p,d=_)}return{...s,...KGt(s,d)}}return s})}));return{...e,connections:r,obstacles:[...t.values()]}},ube=0.001,$Gt=(e)=>e.route_type==="wire",jbr=(e)=>e.route_type==="via",Kbr=(e)=>e.route_type==="through_obstacle",qGt=(e,t,n)=>{let o=ti(e,n),r=ti(t,n),i=Math.min(o,r),s=Math.max(o,r);return Array.from({length:s-i+1},(a,c)=>Nh(i+c,n))},JGt=({obstacleId:e,start:t,end:n,width:o,layer:r,connectedTo:i})=>{let s=n.x-t.x,a=n.y-t.y,c=Math.hypot(s,a);return c<=ube?null:{obstacleId:e,type:"rect",layers:[r],center:{x:(t.x+n.x)/2,y:(t.y+n.y)/2},width:c,height:Math.max(o,ube),ccwRotationDegrees:180*Math.atan2(a,s)/Math.PI,connectedTo:i}};function $br(e){if(!e)return e;let t=((n)=>{if(!n)return[];let o=[],r=Pp(n);for(let[i,s]of(n.traces??[]).entries()){let a=s.connectsTo??[];for(let c=0;c<s.route.length;c++){let l=s.route[c];if(jbr(l)){let h=l.via_diameter??r.padDiameter;o.push({obstacleId:`trace_obstacle_${s.pcb_trace_id}_${i}_${c}_via`,type:"rect",layers:qGt(l.from_layer,l.to_layer,n.layerCount),center:{x:l.x,y:l.y},width:Math.max(h,ube),height:Math.max(h,ube),connectedTo:a});continue}if(Kbr(l)){let h=JGt({obstacleId:`trace_obstacle_${s.pcb_trace_id}_${i}_${c}_through`,start:l.start,end:l.end,width:l.width,layer:l.from_layer,connectedTo:a});h&&(h.layers=qGt(l.from_layer,l.to_layer,n.layerCount),o.push(h))}}for(let c=0;c<s.route.length-1;c++){let l=s.route[c],h=s.route[c+1];if(!$Gt(l)||!$Gt(h)||l.layer!==h.layer)continue;let d=JGt({obstacleId:`trace_obstacle_${s.pcb_trace_id}_${i}_${c}_wire`,start:l,end:h,width:l.width,layer:l.layer,connectedTo:a});d&&o.push(d)}}return o})(e);return t.length===0?e:{...e,obstacles:[...e.obstacles??[],...t]}}function ZGt(e,t){let n=function(o,r){let i=Ile(o.__zLayers??o.zLayers??[],r);if(i.length>0)return i;let s=vle(o.layers,r);if(s.length>0)return s;throw Error(`Obstacle "${o.obstacleId??"unknown"}" has no layers on this ${r}-layer board`)}(e,t);return{...e,layers:n.map((o)=>Nh(o,t)),zLayers:n,__zLayers:n}}function pS(e){return{...e,obstacles:e.obstacles.map((t)=>ZGt(t,e.layerCount)),jumpers:e.jumpers?.map((t)=>({...t,pads:t.pads.map((n)=>ZGt(n,e.layerCount))}))}}var Ucn=(e)=>{let t=e.obstacles.filter((r)=>!((i,s)=>!((a)=>(a.connectedTo?.length??0)>0||(a.offBoardConnectsTo?.length??0)>0||a.netIsAssignable===!0)(i)&&(s.outline&&s.outline.length>=3?!yCe(i,s.outline):!Sw({minX:i.center.x-i.width/2,maxX:i.center.x+i.width/2,minY:i.center.y-i.height/2,maxY:i.center.y+i.height/2},s.bounds)))(r,e)),n=t.length!==e.obstacles.length,o=n&&e.outline&&e.outline.length>=3?((r)=>{if(r.width&&r.height&&r.center){let d=r.width/2,u=r.height/2;return{minX:r.center.x-d,minY:r.center.y-u,maxX:r.center.x+d,maxY:r.center.y+u,width:r.width,height:r.height,center:{x:r.center.x,y:r.center.y}}}if(!r.outline||r.outline.length===0)throw Error("Unable to compute board bounds. pcb_board must include width/height/center or a non-empty outline.");let{POSITIVE_INFINITY:i,POSITIVE_INFINITY:s,NEGATIVE_INFINITY:a,NEGATIVE_INFINITY:c}=Number;for(let d of r.outline)i=Math.min(i,d.x),s=Math.min(s,d.y),a=Math.max(a,d.x),c=Math.max(c,d.y);let l=a-i,h=c-s;return{minX:i,minY:s,maxX:a,maxY:c,width:l,height:h,center:{x:i+l/2,y:s+h/2}}})({type:"pcb_board",pcb_board_id:"__autorouting_board_outline__",center:{x:0,y:0},thickness:1,num_layers:e.layerCount,material:"fr4",outline:e.outline}):e.bounds;return n?{...e,obstacles:t,bounds:o}:e};function $Ke(e){let{minX:t,maxX:n,minY:o,maxY:r}=e.bounds;for(let i of e.connections)if(!i.isOffBoard){for(let[s,a]of i.pointsToConnect.entries())if(!(a.x>=t&&a.x<=n&&a.y>=o&&a.y<=r))return`Connection "${i.name}" point "${a.pointId??s}" at (${a.x}, ${a.y}) is outside routing bounds: x [${t}, ${n}], y [${o}, ${r}]`}return null}var C6e=class extends Kr{constructor(e,t={}){super(),this.inputSrj=e,this.visualizationOptions=t,this.MAX_ITERATIONS=1}inputSrj;visualizationOptions;outputSrj;_step(){if(this.error=$Ke(this.inputSrj),this.error)return void(this.failed=!0);let e=pS(this.inputSrj),t=$br(e)??e,n=Gcn(Ucn(t));this.outputSrj=pS(n),this.solved=!0}getOutputSimpleRouteJson(){if(!this.outputSrj)throw Error("PreprocessSimpleRouteJsonSolver has not solved yet");return this.outputSrj}getConstructorParams(){return[this.inputSrj,this.visualizationOptions]}visualize(){return this.outputSrj?sl(py({...this.outputSrj,traces:[]},this.visualizationOptions),Bw({srj:this.outputSrj,visualizationOptions:this.visualizationOptions})):{lines:[],points:[],rects:[],circles:[]}}};function Pf(e,t,n,o={}){return{solverName:e,solverClass:t,getConstructorParams:n,onSolved:o.onSolved}}var pZe=class extends Kr{constructor(e,t={}){super(),this.srj=e,this.opts=t,this.originalSrj=e,this.opts={...t};let n=this.opts;if(this.effort=n.effort??1,this.MAX_ITERATIONS=1e8*this.effort,this.maxNodeDimension=n.maxNodeDimension??16,this.maxNodeRatio=n.maxNodeRatio??6,this.minNodeArea=n.minNodeArea??0.010000000000000002,this.setSimpleRouteJson(e),n.capacityDepth===void 0){let o=this.srj.bounds.maxX-this.srj.bounds.minX,r=this.srj.bounds.maxY-this.srj.bounds.minY,i=Math.max(o,r),s=n.targetMinCapacity??0.5;n.capacityDepth=MQ(i,s)}this.cacheProvider=n.cacheProvider===void 0?_9():n.cacheProvider===null?null:n.cacheProvider,this.startTimeOfPhase={},this.endTimeOfPhase={},this.timeSpentOnPhase={}}srj;opts;preprocessSimpleRouteJsonSolver;escapeViaLocationSolver;netToPointPairsSolver;nodeSolver;nodeDimensionSubdivisionSolver;nodeTargetMerger;edgeSolver;colorMap;highDensityRouteSolver;highDensityForceImproveSolver;highDensityRepairSolver;highDensityStitchSolver;globalDrcForceImproveSolver;singleLayerNodeMerger;strawSolver;deadEndSolver;traceSimplificationSolver;availableSegmentPointSolver;portPointPathingSolver;multiSectionPortPointOptimizer;uniformPortDistributionSolver;traceWidthSolver;necessaryCrampedPortPointSolver;viaDiameter;viaHoleDiameter;minTraceWidth;effort;maxNodeDimension;maxNodeRatio;minNodeArea;startTimeOfPhase;endTimeOfPhase;timeSpentOnPhase;activeSubSolver=null;connMap;srjWithEscapeViaLocations;srjWithPointPairs;originalSrj;capacityNodes=null;capacityEdges=null;highDensityNodePortPoints;cacheProvider=null;pipelineDef=[Pf("preprocessSimpleRouteJsonSolver",C6e,(e)=>[e.originalSrj],{onSolved:(e)=>{e.setSimpleRouteJson(e.preprocessSimpleRouteJsonSolver.getOutputSimpleRouteJson())}}),Pf("escapeViaLocationSolver",f6e,(e)=>[e.srj,{viaDiameter:e.viaDiameter,minTraceWidth:e.minTraceWidth,obstacleMargin:e.srj.defaultObstacleMargin??0.15}],{onSolved:(e)=>{e.srjWithEscapeViaLocations=e.escapeViaLocationSolver?.getOutputSimpleRouteJson()}}),Pf("netToPointPairsSolver",kq,(e)=>{let t=e.srjWithEscapeViaLocations??e.srj;return[t,e.colorMap,SQ(t)]},{onSolved:(e)=>{e.srjWithPointPairs=e.netToPointPairsSolver?.getNewSimpleRouteJson(),e.colorMap=yA(e.srjWithPointPairs,e.connMap),e.connMap=Ep(e.srjWithPointPairs)}}),Pf("nodeSolver",wq,(e)=>[{simpleRouteJson:e.srjWithPointPairs,maxGapFillPasses:4}],{onSolved:(e)=>{e.capacityNodes=e.nodeSolver?.getOutput().meshNodes??[]}}),Pf("nodeDimensionSubdivisionSolver",g6e,(e)=>[e.capacityNodes,e.maxNodeDimension,e.maxNodeRatio,e.minNodeArea],{onSolved:(e)=>{e.capacityNodes=e.nodeDimensionSubdivisionSolver?.outputNodes??[]}}),Pf("edgeSolver",PQ,(e)=>[e.capacityNodes],{onSolved:(e)=>{e.capacityEdges=e.edgeSolver?.edges}}),Pf("availableSegmentPointSolver",yV,(e)=>[{nodes:e.capacityNodes,edges:e.capacityEdges||[],traceWidth:e.minTraceWidth,colorMap:e.colorMap,shouldReturnCrampedPortPoints:!0}]),Pf("necessaryCrampedPortPointSolver",Vle,(e)=>[{capacityMeshNodes:e.capacityNodes,sharedEdgeSegments:e.availableSegmentPointSolver.getOutput(),simpleRouteJson:e.srjWithPointPairs}]),Pf("portPointPathingSolver",A6e,(e)=>{let t=e.necessaryCrampedPortPointSolver?.getOutput()??e.availableSegmentPointSolver.getOutput(),{graph:n,connections:o}=Yle({capacityMeshNodes:e.capacityNodes,layerCount:e.srj.layerCount,connectivityMap:e.connMap,segmentPortPoints:t.flatMap((r)=>r.portPoints),simpleRouteJsonConnections:e.srjWithPointPairs.connections});return[{graph:n,connections:o,layerCount:e.srj.layerCount,effort:Math.min(1,e.effort),minViaPadDiameter:e.viaDiameter,flags:{FORCE_CENTER_FIRST:!0,RIPPING_ENABLED:!0},weights:{SHUFFLE_SEED:0,MEMORY_PF_FACTOR:4,CENTER_OFFSET_DIST_PENALTY_FACTOR:0,CENTER_OFFSET_FOCUS_SHIFT:0,NODE_PF_FACTOR:0,LAYER_CHANGE_COST:0,RIPPING_PF_COST:0,NODE_PF_MAX_PENALTY:100,BASE_CANDIDATE_COST:0.6,MAX_ITERATIONS_PER_PATH:0,RANDOM_WALK_DISTANCE:0,START_RIPPING_PF_THRESHOLD:0.3,END_RIPPING_PF_THRESHOLD:1,MAX_RIPS:1000,RANDOM_RIP_FRACTION:0.3,STRAIGHT_LINE_DEVIATION_PENALTY_FACTOR:4,GREEDY_MULTIPLIER:0.7,MIN_ALLOWED_BOARD_SCORE:-1e4}}]}),Pf("uniformPortDistributionSolver",Sle,(e)=>[{nodeWithPortPoints:e.portPointPathingSolver?.getOutput().nodesWithPortPoints??[],inputNodesWithPortPoints:e.portPointPathingSolver?.getOutput().inputNodeWithPortPoints??[],minTraceWidth:e.minTraceWidth,obstacles:e.srj.obstacles,layerCount:e.srj.layerCount}]),Pf("highDensityRouteSolver",PV,(e)=>{let t=e.uniformPortDistributionSolver?.getOutput()??[],n=e.portPointPathingSolver?.getOutput().nodesWithPortPoints??[],o=(t.length>0?t:n).map((r)=>xsn(r)?{...r,availableZ:Array.from({length:e.srj.layerCount},(i,s)=>s)}:r);return e.highDensityNodePortPoints=structuredClone(o),[{nodePortPoints:o,nodePfById:new Map((e.portPointPathingSolver?.getOutput().inputNodeWithPortPoints??[]).map((r)=>[r.capacityMeshNodeId,e.portPointPathingSolver?.computeNodePf(r)??null])),colorMap:e.colorMap,connMap:e.connMap,viaDiameter:e.viaDiameter,traceWidth:e.minTraceWidth,obstacleMargin:e.srj.defaultObstacleMargin??0.15,obstacles:e.srj.obstacles,layerCount:e.srj.layerCount,useGrowShrinkHighDensityIntraNodeSolver:!0}]}),Pf("highDensityForceImproveSolver",Gle,(e)=>[{nodeWithPortPoints:e.highDensityNodePortPoints??[],hdRoutes:e.highDensityRouteSolver.routes,colorMap:e.colorMap,totalStepsPerNode:Math.max(20,Math.round(60*Math.min(1,e.effort))),nodeAssignmentMargin:e.srj.defaultObstacleMargin??0.2}]),Pf("highDensityRepairSolver",Ule,(e)=>[{nodeWithPortPoints:e.highDensityNodePortPoints??[],hdRoutes:e.highDensityForceImproveSolver?.getOutput()??e.highDensityRouteSolver.routes,obstacles:e.srj.obstacles,colorMap:e.colorMap,repairMargin:e.srj.defaultObstacleMargin??0.2,minimumTraceWidth:e.srj.minTraceWidth,connMap:e.connMap}]),Pf("highDensityStitchSolver",x6e,(e)=>[{connections:e.srjWithPointPairs.connections,hdRoutes:e.highDensityRepairSolver?.getOutput()??e.highDensityForceImproveSolver?.getOutput()??e.highDensityRouteSolver.routes,colorMap:e.colorMap,layerCount:e.srj.layerCount,defaultViaDiameter:e.viaDiameter}]),Pf("traceSimplificationSolver",Ab,(e)=>[{hdRoutes:e.highDensityStitchSolver.mergedHdRoutes,obstacles:e.srj.obstacles,connMap:e.connMap,colorMap:e.colorMap,outline:e.srj.outline,defaultViaDiameter:e.viaDiameter,layerCount:e.srj.layerCount,minTraceToPadEdgeClearance:e.srj.minTraceToPadEdgeClearance,iterations:2}]),Pf("traceWidthSolver",Lq,(e)=>[{hdRoutes:e.traceSimplificationSolver.simplifiedHdRoutes,obstacles:e.srj.obstacles,connMap:e.connMap,colorMap:e.colorMap,minTraceWidth:e.minTraceWidth,connection:e.srj.connections,obstacleMargin:e.srj.minTraceToPadEdgeClearance??0.15,layerCount:e.srj.layerCount}]),Pf("globalDrcForceImproveSolver",Y7,(e)=>[{srj:e.srjWithPointPairs,hdRoutes:e.traceWidthSolver.getHdRoutesWithWidths(),effort:Math.min(1,e.effort)}])];setSimpleRouteJson(e){this.srj=e;let t=Pp(this.srj);this.viaDiameter=t.padDiameter,this.viaHoleDiameter=t.holeDiameter,this.minTraceWidth=this.srj.minTraceWidth,this.connMap=Ep(this.srj),this.colorMap=yA(this.srj,this.connMap)}getConstructorParams(){return[this.srj,this.opts]}currentPipelineStepIndex=0;_step(){let e=this.pipelineDef[this.currentPipelineStepIndex];if(!e)return void(this.solved=!0);if(this.activeSubSolver)return this.activeSubSolver.step(),void(this.activeSubSolver.solved?(this.endTimeOfPhase[e.solverName]=performance.now(),this.timeSpentOnPhase[e.solverName]=this.endTimeOfPhase[e.solverName]-this.startTimeOfPhase[e.solverName],e.onSolved?.(this),this.activeSubSolver=null,this.currentPipelineStepIndex++):this.activeSubSolver.failed&&(this.error=this.activeSubSolver?.error,this.failed=!0,this.activeSubSolver=null));let t=e.getConstructorParams(this);this.activeSubSolver=new e.solverClass(...t),this[e.solverName]=this.activeSubSolver,this.timeSpentOnPhase[e.solverName]=0,this.startTimeOfPhase[e.solverName]=performance.now()}solveUntilPhase(e){for(;this.getCurrentPhase()!==e;)this.step()}getCurrentPhase(){return this.pipelineDef[this.currentPipelineStepIndex]?.solverName??"none"}visualize(){if(!this.solved&&this.activeSubSolver)return this.activeSubSolver.visualize();let e=this.escapeViaLocationSolver?.visualize(),t=this.netToPointPairsSolver?.visualize(),n=this.nodeSolver?.visualize(),o=this.nodeDimensionSubdivisionSolver?.visualize(),r=this.nodeTargetMerger?.visualize(),i=this.singleLayerNodeMerger?.visualize(),s=this.strawSolver?.visualize(),a=this.edgeSolver?.visualize(),c=this.deadEndSolver?.visualize(),l=this.availableSegmentPointSolver?.visualize(),h=this.portPointPathingSolver?.visualize(),d=this.multiSectionPortPointOptimizer?.visualize(),u=this.uniformPortDistributionSolver?.visualize(),_=this.highDensityRouteSolver?.visualize(),p=this.highDensityForceImproveSolver?.visualize(),m=this.highDensityRepairSolver?.visualize(),A=this.highDensityStitchSolver?.visualize(),g=this.traceSimplificationSolver?.visualize(),f=this.necessaryCrampedPortPointSolver?.visualize(),y=(this.highDensityRouteSolver?.visualize(),this.originalSrj),x=y.outline,C=[];if(C.push({points:[{x:y.bounds?.minX??-50,y:y.bounds?.minY??-50},{x:y.bounds?.maxX??50,y:y.bounds?.minY??-50},{x:y.bounds?.maxX??50,y:y.bounds?.maxY??50},{x:y.bounds?.minX??-50,y:y.bounds?.maxY??50},{x:y.bounds?.minX??-50,y:y.bounds?.minY??-50}],strokeColor:"rgba(255,0,0,0.25)"}),x&&x.length>=2){let M=x.map((B)=>({x:B.x,y:B.y}));M.push({...M[0]}),C.push({points:M,strokeColor:"rgba(0, 136, 255, 0.95)"})}let b=Nw(y),I={points:[...y.connections.flatMap((M)=>M.pointsToConnect.map((B)=>({...B,layer:Rw(B,y.layerCount),label:`${M.name} ${B.pcb_port_id??""}`})))],rects:[...(y.obstacles??[]).filter((M)=>!M.isCopperPour).map((M)=>({...M,fill:M.layers?.includes("top")?"rgba(255,0,0,0.25)":M.layers?.includes("bottom")?"rgba(0,0,255,0.25)":"rgba(255,0,0,0.25)",layer:sS(M,y.layerCount),label:b(M)}))],lines:C},v=Bw({srj:y}),P=[sl(I,v),e,t,n,o,r,i,s,a,c,l,f,h,d,u,_?sl(I,_):null,p,m,A,g,this.solved?sl({lines:C},Bw({srj:this.originalSrj}),py(this.getOutputSimpleRouteJson())):null].filter(Boolean);return sl(...P)}preview(){if(this.highDensityRouteSolver){let e=[];for(let t=this.highDensityRouteSolver.routes.length-1;t>=0;t--){let n=this.highDensityRouteSolver.routes[t];if(e.push({points:n.route.map((o)=>({x:o.x,y:o.y})),strokeColor:this.colorMap[n.connectionName]}),e.length>200)break}return{lines:e}}return this.portPointPathingSolver?this.portPointPathingSolver.preview():this.netToPointPairsSolver?this.netToPointPairsSolver.visualize():this.escapeViaLocationSolver?this.escapeViaLocationSolver.visualize():this.preprocessSimpleRouteJsonSolver?this.preprocessSimpleRouteJsonSolver.visualize():{}}_getOutputHdRoutes(){return this.globalDrcForceImproveSolver?.getOutput()??this.traceWidthSolver?.getHdRoutesWithWidths()??this.traceSimplificationSolver?.simplifiedHdRoutes??this.highDensityStitchSolver.mergedHdRoutes}getOutputSimplifiedPcbTraces(){if(!this.solved||!this.highDensityRouteSolver)throw Error("Cannot get output before solving is complete");let e=[],t=this._getOutputHdRoutes();for(let n of this.netToPointPairsSolver?.newConnections??[]){let o=n.__netConnectionName??this.originalSrj.connections.find((i)=>i.name===n.name)?.__netConnectionName,r=t.filter((i)=>i.connectionName===n.name);for(let i=0;i<r.length;i++){let s=r[i],a={type:"pcb_trace",pcb_trace_id:`${n.name}_${i}`,connection_name:o??n.__rootConnectionNames?.[0]??n.name,route:V4(s,this.srj.layerCount,{connectionPoints:n.pointsToConnect,defaultViaHoleDiameter:this.viaHoleDiameter,obstacles:this.srj.obstacles,connMap:this.connMap})};e.push(a)}}return e}getOutputSimpleRouteJson(){return{...this.originalSrj,traces:this.getOutputSimplifiedPcbTraces()}}},Wcn=(e)=>{let t=[],n=e;for(;n;)t.push(n),n=n.activeSubSolver;for(let o=t.length-1;o>=0;o--){let r=t[o]?.pendingEffects?.filter(Boolean)??[];if(r.length>0)return r}return[]},V3e=(e)=>/\/solve\/?$/.test(e)?e.replace(/\/+$/,""):`${e.replace(/\/+$/,"")}/solve`,qbr=(e,t,n)=>{let o=((r)=>{let i=new Map;for(let s of r.portPoints)s.rootConnectionName&&!i.has(s.connectionName)&&i.set(s.connectionName,s.rootConnectionName);return i})(e);return t.map((r)=>({connectionName:r.connectionName,rootConnectionName:r.rootConnectionName??o.get(r.connectionName)??void 0,traceThickness:r.traceThickness??n.traceWidth,viaDiameter:r.viaDiameter??n.viaDiameter,route:(r.route??[]).map((i)=>({x:i.x,y:i.y,z:i.z,...i.insideJumperPad?{insideJumperPad:!0}:{}})),vias:(r.vias??[]).map((i)=>({x:i.x,y:i.y})),...r.jumpers?{jumpers:r.jumpers}:{}}))},EXe=(e,t)=>{if(e.length===0)return null;let n=Math.min(Math.max(t,0),1),o=(e.length-1)*n,r=Math.floor(o),i=Math.ceil(o),s=e[r],a=e[i];return r===i?s:s+(a-s)*(o-r)},a$=(e)=>new Set(e.portPoints.map((t)=>t.connectionName)).size,eUt=(e)=>!(a$(e)<3)&&(e.availableZ?.length??0)!==1,tUt=(e)=>e?.MULTI_HEAD_POLYLINE_SOLVER?"MultiHeadPolyLineIntraNodeSolver3":e?.CLOSED_FORM_SINGLE_TRANSITION?"SingleTransitionIntraNodeSolver":e?.CLOSED_FORM_TWO_TRACE_SAME_LAYER?"TwoCrossingRoutesHighDensitySolver":e?.CLOSED_FORM_TWO_TRACE_TRANSITION_CROSSING?"SingleTransitionCrossingRouteSolver":e?.HIGH_DENSITY_A01?"HighDensitySolverA01":e?.HIGH_DENSITY_A03?"HighDensitySolverA03":"SingleHighDensityRouteSolver6_VertHorzLayer_FutureCost",nUt=(e)=>{if(e instanceof b$e){let n=tUt(e.hyperParameters);return e.cacheHit?`${n} [cached]`:n}if(e instanceof Qbe)return tUt(e.hyperParameters);if(e&&typeof e=="object"&&"getSolverName"in e&&typeof e.getSolverName=="function")return e.getSolverName();let t=e?.constructor;return typeof t?.name=="string"?t.name:"unknown"},oUt=(e)=>e.winningSolver?nUt(e.winningSolver):nUt(e),Jbr=class extends Kr{getSolverName(){return"Pipeline5HdCacheHighDensitySolver"}unsolvedNodePortPoints;colorMap;connMap;viaDiameter;traceWidth;obstacleMargin;obstacles;layerCount;hdCacheBaseUrl;fetchImpl;nodePfById;routes=[];nodeSolveMetadataById=new Map;launchedRemoteSolves=!1;solvedRoutesByNodeIndex=new Map;failedNodeResults=[];remoteResponseMeasurements=[];constructor({nodePortPoints:e,colorMap:t,connMap:n,viaDiameter:o,traceWidth:r,obstacleMargin:i,obstacles:s,layerCount:a,nodePfById:c,hdCacheBaseUrl:l,fetchImpl:h}){super(),this.unsolvedNodePortPoints=e,this.colorMap=t??{},this.connMap=n,this.viaDiameter=o??0.3,this.traceWidth=r??0.15,this.obstacleMargin=i??0.15,this.obstacles=s??[],this.layerCount=a??2,this.hdCacheBaseUrl=l??"https://hd-cache.tscircuit.com",this.fetchImpl=(h??globalThis.fetch).bind(globalThis),this.nodePfById=c instanceof Map?new Map(c):new Map(Object.entries(c??{})),this.pendingEffects=[],this.stats={localDirectNodeCount:0,localSolvedNodeCount:0,localFallbackNodeCount:0,remoteFallbackNodeCount:0,remoteRequestsStarted:0,remoteRequestsCompleted:0,remoteResponseSampleCount:0,remoteKOrderSampleCount:0,slowestRemoteResponseMs:null,slowestRemoteResponseNodeId:null,p50RemoteResponseMs:null,p50RemoteKOrder:null,p95RemoteKOrder:null,remoteSources:{}}}computeProgress(){return this.unsolvedNodePortPoints.length===0?1:this.nodeSolveMetadataById.size/this.unsolvedNodePortPoints.length}solveNodeLocally(e,t,n={}){let o=new dV({nodeWithPortPoints:e,colorMap:this.colorMap,connMap:this.connMap,viaDiameter:this.viaDiameter,traceWidth:this.traceWidth,obstacleMargin:this.obstacleMargin,obstacles:this.obstacles,layerCount:this.layerCount});if(o.solve(),o.failed){let i=o.error??`Local intra-node solver failed for ${e.capacityMeshNodeId}`,s=a$(e);return this.failedNodeResults.push({node:e,error:n.remoteFailure&&n.resolution==="local-fallback"?`Remote solve failed (${n.remoteFailure}); local fallback failed (${i})`:i}),void this.recordNodeSolveMetadata(e,{status:"failed",resolution:"failed",solverType:oUt(o),supervisorType:o.getSolverName(),iterations:o.iterations,pairCount:s,routeCount:0,remoteAttempt:n.resolution==="local-fallback"?{attempted:!0,endpoint:V3e(this.hdCacheBaseUrl),source:"error",durationMs:n.remoteDurationMs,error:n.remoteFailure??i}:{attempted:!1},error:i})}this.solvedRoutesByNodeIndex.set(t,o.solvedRoutes);let r=a$(e);this.recordNodeSolveMetadata(e,{status:"solved",resolution:n.resolution??"local",solverType:oUt(o),supervisorType:o.getSolverName(),iterations:o.iterations,pairCount:r,routeCount:o.solvedRoutes.length,remoteAttempt:n.resolution==="local-fallback"?{attempted:!0,endpoint:V3e(this.hdCacheBaseUrl),source:"error",durationMs:n.remoteDurationMs,error:n.remoteFailure}:{attempted:!1}}),n.resolution==="local-fallback"?(this.stats.localFallbackNodeCount+=1,this.stats.remoteFallbackNodeCount+=1):this.stats.localDirectNodeCount+=1,this.stats.localSolvedNodeCount+=1}async solveNodeViaHdCache(e,t){let n=V3e(this.hdCacheBaseUrl),o={"content-type":"application/json"},r={nodeWithPortPoints:e},i=JSON.stringify(r),s=Date.now(),a,c,l,h=null,d=null;try{let _=await this.fetchImpl(n,{method:"POST",headers:o,body:i});if(a=_.status,c=_.ok,l=await _.text(),h=Date.now()-s,d=l?JSON.parse(l):null,!_.ok)throw Error(d?.message??l??`hd-cache request failed with status ${_.status}`);if(!d?.ok||d.routes===null)throw Error(d?.message??`hd-cache returned no routes for ${e.capacityMeshNodeId}`);let p=qbr(e,d.routes,{traceWidth:this.traceWidth,viaDiameter:this.viaDiameter});this.solvedRoutesByNodeIndex.set(t,p),this.recordNodeSolveMetadata(e,{status:"solved",resolution:"remote",solverType:`hd-cache.tscircuit.com [${d.source}]`,iterations:null,pairCount:a$(e),routeCount:p.length,remoteAttempt:{attempted:!0,endpoint:V3e(this.hdCacheBaseUrl),source:d.source,durationMs:h}}),this.recordRemoteSource(d.source)}catch(_){h??=Date.now()-s;let p=((m)=>m instanceof Error?m.message:String(m))(_);this.recordFailedHdCacheRequest({nodeId:e.capacityMeshNodeId,pairCount:a$(e),failedAt:new Date().toISOString(),durationMs:h,error:p,url:n,request:{method:"POST",headers:o,body:i,bodyJson:r},response:a!==void 0||c!==void 0||l!==void 0||d!==null?{status:a,ok:c,text:l,body:d}:void 0}),this.recordRemoteSource("error"),this.solveNodeLocally(e,t,{resolution:"local-fallback",remoteFailure:p,remoteDurationMs:h})}finally{this.recordRemoteResponseMetrics(e.capacityMeshNodeId,h??Date.now()-s,(u=d?.kOrder,typeof u=="number"&&Number.isFinite(u)?d.kOrder:null)),this.stats.remoteRequestsCompleted+=1}var u}launchRemoteSolves(){let e=[];this.unsolvedNodePortPoints.forEach((t,n)=>{if(!eUt(t))return void this.solveNodeLocally(t,n);let o={name:`hd-cache:${t.capacityMeshNodeId}`,promise:Promise.resolve()};o.promise=this.solveNodeViaHdCache(t,n).finally(()=>{this.pendingEffects=this.pendingEffects?.filter((r)=>r!==o)}),e.push(o)}),this.pendingEffects=e,this.stats.remoteRequestsStarted=e.length}recordRemoteSource(e){this.stats.remoteSources[e]=(this.stats.remoteSources[e]??0)+1}recordRemoteResponseMetrics(e,t,n){this.remoteResponseMeasurements.push({nodeId:e,durationMs:t,kOrder:n}),this.stats.remoteResponseSampleCount=this.remoteResponseMeasurements.length,this.stats.remoteKOrderSampleCount=this.remoteResponseMeasurements.filter((s)=>s.kOrder!==null).length;let o=null;for(let s of this.remoteResponseMeasurements)(!o||s.durationMs>o.durationMs)&&(o=s);this.stats.slowestRemoteResponseMs=o?.durationMs??null,this.stats.slowestRemoteResponseNodeId=o?.nodeId??null;let r=this.remoteResponseMeasurements.map((s)=>s.durationMs).sort((s,a)=>s-a);this.stats.p50RemoteResponseMs=EXe(r,0.5);let i=this.remoteResponseMeasurements.map((s)=>s.kOrder).filter((s)=>s!==null).sort((s,a)=>s-a);this.stats.p50RemoteKOrder=EXe(i,0.5),this.stats.p95RemoteKOrder=EXe(i,0.95)}recordFailedHdCacheRequest(e){let t=(()=>{if(typeof window>"u")return null;let n=window;return Array.isArray(n.__FAILED_HD_CACHE_REQUESTS)||(n.__FAILED_HD_CACHE_REQUESTS=[]),n.__FAILED_HD_CACHE_REQUESTS})();t&&t.push(e)}recordNodeSolveMetadata(e,t){this.nodeSolveMetadataById.set(e.capacityMeshNodeId,{...t,node:e,nodePf:this.nodePfById.get(e.capacityMeshNodeId)??null})}ensureFailedNodeMetadata(){for(let e of this.failedNodeResults)this.nodeSolveMetadataById.has(e.node.capacityMeshNodeId)||this.recordNodeSolveMetadata(e.node,{status:"failed",resolution:"failed",solverType:"unknown",iterations:null,pairCount:a$(e.node),routeCount:0,remoteAttempt:{attempted:eUt(e.node),source:"error",error:e.error},error:e.error})}getVisibleRoutes(){if(this.solved)return this.routes;let e=[];for(let t=0;t<this.unsolvedNodePortPoints.length;t++)e.push(...this.solvedRoutesByNodeIndex.get(t)??[]);return e}createNodeMarkerLabel(e,t){return["hd_node_marker",`node: ${e}`,`status: ${t.status}`,`resolution: ${t.resolution}`,`solver: ${t.solverType}`,...t.supervisorType?[`supervisor: ${t.supervisorType}`]:[],...t.iterations!==null?[`iterations: ${t.iterations}`]:[],`pairCount: ${t.pairCount}`,`routes: ${t.routeCount}`,`nodePf: ${t.nodePf??"n/a"}`,"remoteAttempted: "+(t.remoteAttempt.attempted?"yes":"no"),...t.remoteAttempt.source?[`remoteSource: ${t.remoteAttempt.source}`]:[],...t.remoteAttempt.durationMs!==void 0?[`remoteDurationMs: ${t.remoteAttempt.durationMs}`]:[],...t.remoteAttempt.error?[`remoteError: ${t.remoteAttempt.error}`]:[],`portPoints: ${t.node.portPoints.length}`,...t.error?[`error: ${t.error}`]:[]].join(`
`)}_step(){if(!this.launchedRemoteSolves)return this.launchedRemoteSolves=!0,void this.launchRemoteSolves();if(!((this.pendingEffects?.length??0)>0)){if(this.failedNodeResults.length>0){this.ensureFailedNodeMetadata();let e=this.failedNodeResults[0];return this.failed=!0,void(this.error=`Failed to solve ${this.failedNodeResults.length} nodes via hd-cache. First failure: ${e?.node.capacityMeshNodeId} (${e?.error})`)}this.routes=[];for(let e=0;e<this.unsolvedNodePortPoints.length;e++)this.routes.push(...this.solvedRoutesByNodeIndex.get(e)??[]);this.solved=!0}}visualize(){let e={lines:[],points:[],rects:[],circles:[]};for(let t of this.getVisibleRoutes()){let n=Rbe(t.route,t.connectionName,this.colorMap[t.connectionName]);for(let o of n)e.lines.push({points:o.points,label:o.connectionName,strokeColor:o.z===0?o.color:Qi(o.color,0.75),layer:`z${o.z}`,strokeWidth:t.traceThickness,strokeDash:o.z!==0?"10, 5":void 0});for(let o of t.vias)e.circles.push({center:o,layer:"z0,1",radius:t.viaDiameter/2,fill:this.colorMap[t.connectionName],label:`${t.connectionName} via`})}for(let[t,n]of this.nodeSolveMetadataById){let o=n.node.center.x-n.node.width/2,r=n.node.center.x+n.node.width/2,i=n.node.center.y-n.node.height/2,s=n.node.center.y+n.node.height/2,a=this.createNodeMarkerLabel(t,n),c=n.status==="solved"?"blue":"red",l=n.status==="solved"?0.03:0.08;if(e.lines.push({points:[{x:o,y:i},{x:r,y:i}],layer:"hd_node_boundaries",strokeColor:c,strokeDash:"6, 4",strokeWidth:l,label:a},{points:[{x:r,y:i},{x:r,y:s}],layer:"hd_node_boundaries",strokeColor:c,strokeDash:"6, 4",strokeWidth:l,label:a},{points:[{x:r,y:s},{x:o,y:s}],layer:"hd_node_boundaries",strokeColor:c,strokeDash:"6, 4",strokeWidth:l,label:a},{points:[{x:o,y:s},{x:o,y:i}],layer:"hd_node_boundaries",strokeColor:c,strokeDash:"6, 4",strokeWidth:l,label:a}),n.status==="solved")e.points.push({x:n.node.center.x,y:n.node.center.y,color:c,layer:"hd_node_markers",label:a});else{e.lines.push({points:[{x:0,y:0},{x:n.node.center.x,y:n.node.center.y}],layer:"hd_failed_node_guides",strokeColor:c,strokeDash:"8, 6",strokeWidth:0.05,label:a});let h=Math.max(n.node.width,1.2),d=Math.max(n.node.height,1.2),u=h/2,_=d/2;e.rects.push({center:n.node.center,layer:"hd_node_markers",width:h,height:d,fill:"rgba(255, 0, 0, 0.3)",stroke:c,label:a}),e.circles.push({center:n.node.center,radius:Math.max(0.6*Math.max(h,d),1.1),layer:"hd_node_markers",fill:"rgba(255, 0, 0, 0.08)",stroke:c,label:a}),e.lines.push({points:[{x:n.node.center.x-u,y:n.node.center.y-_},{x:n.node.center.x+u,y:n.node.center.y+_}],layer:"hd_node_markers",strokeColor:c,strokeWidth:0.16,label:a},{points:[{x:n.node.center.x-u,y:n.node.center.y+_},{x:n.node.center.x+u,y:n.node.center.y-_}],layer:"hd_node_markers",strokeColor:c,strokeWidth:0.16,label:a})}}return e}},Xcn=class extends pZe{hdCacheBaseUrl;hdCacheFetch;constructor(e,t={}){super(e,{...t,maxNodeDimension:t.maxNodeDimension??7,maxNodeRatio:t.maxNodeRatio??4}),this.hdCacheBaseUrl=t.hdCacheBaseUrl??"https://hd-cache.tscircuit.com",this.hdCacheFetch=t.hdCacheFetch,this.replaceHighDensityPipelineStep()}replaceHighDensityPipelineStep(){let e=this.pipelineDef.findIndex((t)=>t.solverName==="highDensityRouteSolver");if(e===-1)throw Error("Pipeline4 highDensityRouteSolver step is missing");this.pipelineDef[e]={...this.pipelineDef[e],solverClass:Jbr,getConstructorParams:(t)=>{let n=t.uniformPortDistributionSolver?.getOutput()??[],o=t.portPointPathingSolver?.getOutput().nodesWithPortPoints??[],r=n.length>0?n:o;return t.highDensityNodePortPoints=structuredClone(r),[{nodePortPoints:r,nodePfById:new Map((t.portPointPathingSolver?.getOutput().inputNodeWithPortPoints??[]).map((i)=>[i.capacityMeshNodeId,t.portPointPathingSolver?.computeNodePf(i)??null])),colorMap:t.colorMap,connMap:t.connMap,viaDiameter:t.viaDiameter,traceWidth:t.minTraceWidth,obstacleMargin:t.srj.defaultObstacleMargin??0.15,obstacles:t.srj.obstacles,layerCount:t.srj.layerCount,hdCacheBaseUrl:t.hdCacheBaseUrl,fetchImpl:t.hdCacheFetch}]}}}async stepAsync(){if(this.solved||this.failed)return;this.step();let e=Wcn(this);e.length!==0&&(await Promise.race(e.map((t)=>t.promise.then(()=>t.name,()=>t.name))),this.solved||this.failed||this.step())}async solveAsync(){let e=Date.now();for(;!this.solved&&!this.failed;)await this.stepAsync();this.timeToSolve=Date.now()-e}solve(){throw Error("AutoroutingPipelineSolver5_HdCache requires async execution. Use solveAsync() or stepAsync().")}};var jNs=Math.PI/2;var Zbr=0.1,e6r=0.15,t6r=Zbr+e6r,KNs=3*t6r/4;var $Ns=qXe(Npr(),1);var qNs=(Number.POSITIVE_INFINITY,0.000000001);var JNs=(new Int32Array(0),(e)=>(e.ccwRotationDegrees??0)*Math.PI/180);var W0=(e,t)=>{if(e==="top")return 0;if(e==="bottom")return t-1;let n=/^inner(\d+)$/.exec(e);if(!n)return-1;let o=Number(n[1]);return o>0&&o<t-1?o:-1},i9=(e,t)=>e===0?"top":e===t-1?"bottom":`inner${e}`,Sq=(e,t,n)=>{let o=W0(e,n),r=W0(t,n);if(o<0||r<0)return[];let i=Math.min(o,r),s=Math.max(o,r);return Array.from({length:s-i+1},(a,c)=>i9(i+c,n))},Wle=(e,t)=>{let n=[],o=[],r=e.route.find((c)=>c.route_type==="wire"),i=r?.route_type==="wire"?r.width:null,s={"0603":0.95,1206:1.8,"1206x4_pair":1.8},a=null;for(let c=0;c<e.route.length;c++){let l=e.route[c];if(l.route_type==="wire"){if(!Number.isFinite(l.x)||!Number.isFinite(l.y)||!Number.isFinite(l.width)||l.width<=0||W0(l.layer,t)<0)throw Error(`PostProcessingSolver: immutable trace "${e.connection_name}" has an invalid wire`);if(a&&a.layer!==l.layer)throw Error(`PostProcessingSolver: immutable trace "${e.connection_name}" changes layer without a transition`);a&&n.push({start:a,end:l,layer:l.layer,width:Math.max(a.width,l.width),connectionName:e.connection_name,terminal:null}),a=l;continue}if(l.route_type==="via"){let _=Sq(l.from_layer,l.to_layer,t),p=a,m=l.via_diameter??p?.width??i;if(!Number.isFinite(l.x)||!Number.isFinite(l.y)||_.length<2||m===null||!Number.isFinite(m)||m<=0||l.via_hole_diameter!==void 0&&(!Number.isFinite(l.via_hole_diameter)||l.via_hole_diameter<=0||m!==null&&l.via_hole_diameter>=m))throw Error(`PostProcessingSolver: immutable trace "${e.connection_name}" has an invalid via`);p&&Math.hypot(p.x-l.x,p.y-l.y)>0.00000001&&n.push({start:p,end:l,layer:p.layer,width:p.width,connectionName:e.connection_name,terminal:null}),o.push({x:l.x,y:l.y,layers:_,diameter:m,connectionName:e.connection_name,terminal:c===0?"start":c===e.route.length-1?"end":null});let A=e.route.slice(c+1).find((f)=>f.route_type==="wire"),g=p?.layer===l.from_layer?l.to_layer:p?.layer===l.to_layer?l.from_layer:A?.route_type!=="wire"||A.layer!==l.from_layer&&A.layer!==l.to_layer?null:A.layer;if(!g)throw Error(`PostProcessingSolver: immutable trace "${e.connection_name}" has a discontinuous via`);a={x:l.x,y:l.y,layer:g,width:p?.width??i??m};continue}if(l.route_type==="jumper"){let _=s[l.footprint];if(!Number.isFinite(l.start.x)||!Number.isFinite(l.start.y)||!Number.isFinite(l.end.x)||!Number.isFinite(l.end.y)||W0(l.layer,t)<0)throw Error(`PostProcessingSolver: immutable trace "${e.connection_name}" has an invalid jumper`);if(a&&(a.layer!==l.layer||Math.hypot(a.x-l.start.x,a.y-l.start.y)>0.00000001))throw Error(`PostProcessingSolver: immutable trace "${e.connection_name}" has a discontinuous jumper`);n.push({start:l.start,end:l.end,layer:l.layer,width:_,connectionName:e.connection_name,terminal:null}),a={...l.end,layer:l.layer,width:_};continue}let h=Sq(l.from_layer,l.to_layer,t);if(!Number.isFinite(l.start.x)||!Number.isFinite(l.start.y)||!Number.isFinite(l.end.x)||!Number.isFinite(l.end.y)||!Number.isFinite(l.width)||l.width<=0||h.length<2)throw Error(`PostProcessingSolver: immutable trace "${e.connection_name}" has invalid through-obstacle copper`);if(a&&(a.layer!==l.from_layer&&a.layer!==l.to_layer||Math.hypot(a.x-l.start.x,a.y-l.start.y)>0.00000001))throw Error(`PostProcessingSolver: immutable trace "${e.connection_name}" has discontinuous through-obstacle copper`);for(let _ of h)n.push({start:l.start,end:l.end,layer:_,width:l.width,connectionName:e.connection_name,terminal:null});let d=a,u=d?.layer===l.to_layer?l.from_layer:l.to_layer;a={...l.end,layer:u,width:l.width}}return{segments:n,vias:o}},mV=(e)=>e.rootConnectionName??e.connectionName,jK=(e,t)=>e.flatMap((n,o)=>mV(n)===t?[o]:[]),fb=(e,t,n,o)=>{let r=(u,_,p)=>{let m=p.x-_.x,A=p.y-_.y,g=u.x-_.x,f=u.y-_.y,y=m**2+A**2,x=y===0?0:Math.max(0,Math.min(1,(g*m+f*A)/y));return Math.hypot(u.x-(_.x+x*m),u.y-(_.y+x*A))},i={x:t.x-e.x,y:t.y-e.y},s={x:o.x-n.x,y:o.y-n.y},a={x:n.x-e.x,y:n.y-e.y},c=(u,_)=>u.x*_.y-u.y*_.x,l=c(i,s),h=Math.hypot(i.x,i.y),d=0.000000000001*(h*Math.hypot(s.x,s.y)+1);if(Math.abs(l)>d){let u=c(a,s)/l,_=c(a,i)/l;if(u>=-0.000000000001&&u<=1.000000000001&&_>=-0.000000000001&&_<=1.000000000001)return 0}else if(h>0.000000000001&&Math.abs(c(a,i))<=d){let u=Math.abs(i.x)>=Math.abs(i.y),_=Math.min(u?e.x:e.y,u?t.x:t.y),p=Math.max(u?e.x:e.y,u?t.x:t.y),m=Math.min(u?n.x:n.y,u?o.x:o.y),A=Math.max(u?n.x:n.y,u?o.x:o.y);if(Math.max(_,m)<=Math.min(p,A)+0.000000000001)return 0}return Math.min(r(e,n,o),r(t,n,o),r(n,e,t),r(o,e,t))},mZe=(e,t)=>Math.hypot(t.x-e.x,t.y-e.y),uw=(e)=>{let t=0;for(let n=0;n<e.route.length-1;n++)t+=mZe(e.route[n],e.route[n+1]);return t},KK=(e,t)=>t.reduce((n,o)=>n+uw(e[o]),0),Oq=(e,t)=>{let{__zLayers:n,zLayers:o}=e,r=n!==void 0?n:o;if(r!==void 0){if(!Array.isArray(r)||r.length===0||r.some((i)=>!Number.isInteger(i)||i<0||i>=t))throw Error("Obstacle has invalid z-layer indexes");return r}if(e.layers.length===0)throw Error("Obstacle has no declared layers");return e.layers.map((i)=>{if(i==="top")return 0;if(i==="bottom")return t-1;let s=/^inner(\d+)$/.exec(i),a=s?Number(s[1]):-1;if(a<=0||a>=t-1)throw Error(`Obstacle has invalid layer name "${i}"`);return a})},c$=(e)=>{let t=(a,c,l,h)=>{let d=l.center.x-l.width/2-h,u=l.center.x+l.width/2+h,_=l.center.y-l.height/2-h,p=l.center.y+l.height/2+h;if(a.x>=d&&a.x<=u&&a.y>=_&&a.y<=p||c.x>=d&&c.x<=u&&c.y>=_&&c.y<=p)return!0;let m=[{x:d,y:_},{x:u,y:_},{x:u,y:p},{x:d,y:p}];return m.some((A,g)=>fb(a,c,A,m[(g+1)%m.length])===0)};if(e.bounds&&e.meanderPoints.some((a)=>a.x<e.bounds.minX||a.x>e.bounds.maxX||a.y<e.bounds.minY||a.y>e.bounds.maxY))return!1;let n=(a,c,l)=>{let h=l.x-c.x,d=l.y-c.y,u=h*h+d*d,_=u===0?0:Math.max(0,Math.min(1,((a.x-c.x)*h+(a.y-c.y)*d)/u));return Math.hypot(a.x-(c.x+_*h),a.y-(c.y+_*d))},o=e.meanderPoints.some((a)=>!e.route.route.slice(1).some((c,l)=>{let h=e.route.route[l];return h.z===a.z&&c.z===a.z&&n(a,h,c)<=0.000000001})),r=(e.traces??[]).map((a)=>Wle(a,e.layerCount)),i=mV(e.route),s=e.route.traceThickness/2+e.obstacleMargin;for(let a=0;a<e.meanderPoints.length-1;a++){let c=e.meanderPoints[a],l=e.meanderPoints[a+1],h=e.route.route.slice(1).some((u,_)=>{let p=e.route.route[_];return c.z===l.z&&p.z===c.z&&u.z===l.z&&n(c,p,u)<=0.000000001&&n(l,p,u)<=0.000000001});if(o&&h)continue;for(let u of e.obstacles){if(!Oq(u,e.layerCount).includes(c.z))continue;let _=a===0||a===e.meanderPoints.length-2;if((!u.connectedTo.includes(i)||!_)&&t(c,l,u,s))return!1}let d=i9(c.z,e.layerCount);for(let{segments:u,vias:_}of r){for(let p of u)if(p.layer===d&&fb(c,l,p.start,p.end)<s+p.width/2)return!1;for(let p of _)if(p.layers.includes(d)&&n(p,c,l)<s+p.diameter/2)return!1}for(let u of e.routedRoutes){let _=mV(u)===i;for(let p of u.vias){if(p.zLayers&&!p.zLayers.includes(c.z))continue;let m=Math.hypot(p.x-c.x,p.y-c.y)<=0.00000001||Math.hypot(p.x-l.x,p.y-l.y)<=0.00000001,A=e.route.traceThickness/2+u.viaDiameter/2+e.obstacleMargin;if((!_||!m)&&n(p,c,l)<A)return!1}if(!_)for(let p=0;p<u.route.length-1;p++){let m=u.route[p],A=u.route[p+1];if(c.z!==m.z||c.z!==A.z)continue;let g=e.route.traceThickness/2+u.traceThickness/2+e.obstacleMargin;if(fb(c,l,m,A)<g)return!1}}}return!0},rUt=(e)=>{let t=[];for(let o of e.routeIndexes){let r=e.routes[o],i=e.minMeanderGap??Math.max(0.3,2*r.traceThickness),s=r.traceThickness+i,a=Math.max(e.minimumToothPitch??0,2*s),c=e.minMeanderHeight??s;for(let l=0;l<r.route.length-1;l++){let h=r.route[l],d=r.route[l+1],u=mZe(h,d);if(u<=0||h.z!==d.z)continue;let _=Math.min(Math.max(0,Math.floor(u/a)-1),e.maxToothCount);for(let p=1;p<=_;p++){let m=u/(p+1),A=[m,Math.sqrt(a*m),a].filter((f,y,x)=>x.findIndex((C)=>Math.abs(C-f)<0.000000001)===y),g=p%2==0?["balanced","negative","positive"]:["negative","positive"];for(let f of A)for(let y of g)t.push({routeIndex:o,segmentIndex:l,segmentLength:u,toothCount:p,maximumDepth:e.maximumDepth,minimumHeight:c,toothPitch:f,placement:y,heightProfile:p>1?"tapered":"uniform"})}}}let n={balanced:0,negative:1,positive:2};return t.sort((o,r)=>o.toothCount-r.toothCount||n[o.placement]-n[r.placement]||r.toothPitch-o.toothPitch||r.segmentLength-o.segmentLength)},n6r=(e)=>{if(e.centerlineDistanceCost===null)return 0;let t=e.predictedToothDepths.flatMap((g,f)=>g>0?[f]:[]);if(t.length===0)return 0;let n=t.map((g)=>e.predictedToothDepths[g]),o=Math.max(...n),r=n.reduce((g,f)=>g+f,0)/n.length,i=Math.sqrt(n.reduce((g,f)=>g+(f-r)**2,0)/n.length),s=t[0],a=(t.at(-1)-s+1)*e.toothPitch,c=o/(e.toothPitch/2),l=e.addedLength/a,h=c/(1+c)*40,d=l/(1+l)*30,u=e.predictedToothDepths.map((g,f)=>Math.sin(Math.PI*(f+1)/(e.predictedToothDepths.length+1))),_=Math.max(...u),p=Math.sqrt(e.predictedToothDepths.reduce((g,f,y)=>g+(f-o*u[y]/_)**2,0)/e.predictedToothDepths.length),m=100-h-d-Math.min(10,(e.heightProfile==="tapered"?p:i)/r*10)-2*(n.length-1)-7*Math.min(1,e.addedLength/e.segmentLength)-100*e.centerlineDistanceCost,A=e.centerlineDistanceCost>0?m:Math.max(0,m);return Math.round(1e6*A)/1e6},E$=(e)=>{if(e.toothDepths.length!==e.toothCount)throw Error(`LengthMatchingSolver: expected ${e.toothCount} tooth depths, received ${e.toothDepths.length}`);if(e.toothDepths.some((c)=>!Number.isFinite(c)||c<0))throw Error("LengthMatchingSolver: every meander tooth depth must be a non-negative finite number");let t=e.route.route[e.segmentIndex],n=e.route.route[e.segmentIndex+1],o=mZe(t,n),r=(n.x-t.x)/o,i=(n.y-t.y)/o,s=(o-(e.toothCount-0.5)*e.toothPitch)/2,a=[{...t}];for(let c=0;c<e.toothCount;c++){let l=e.toothDepths[c];if(l===0)continue;let h=e.placement==="balanced"?c%2==0?-1:1:e.placement==="negative"?-1:1,d={x:-i*h,y:r*h},u=s+c*e.toothPitch,_=u+e.toothPitch/2,p={...t,x:t.x+r*u,y:t.y+i*u};a.push(p,{...p,x:p.x+d.x*l,y:p.y+d.y*l},{...t,x:t.x+r*_+d.x*l,y:t.y+i*_+d.y*l},{...t,x:t.x+r*_,y:t.y+i*_})}return a.push({...n}),((c)=>{if(c.length<3)return c;let l=[{...c[0]}];for(let h=1;h<c.length-1;h++){let d=c[h-1],u=c[h],_=c[h+1],p=Math.hypot(u.x-d.x,u.y-d.y),m=Math.hypot(_.x-u.x,_.y-u.y);if(p===0||m===0)throw Error("LengthMatchingSolver: meander contains a zero-length segment");let A={x:(u.x-d.x)/p,y:(u.y-d.y)/p},g={x:(_.x-u.x)/m,y:(_.y-u.y)/m};if(Math.abs(A.x*g.y-A.y*g.x)<0.000000001){l.push({...u});continue}let f=Math.min(p,m)/2,y={...u,x:u.x-A.x*f,y:u.y-A.y*f},x={...u,x:u.x+g.x*f,y:u.y+g.y*f},C=l.at(-1);y.x===C.x&&y.y===C.y||l.push(y);for(let b=1;b<6;b++){let I=b/6,v=1-I;l.push({...u,x:v**2*y.x+2*v*I*u.x+I**2*x.x,y:v**2*y.y+2*v*I*u.y+I**2*x.y})}l.push(x)}return l.push({...c[c.length-1]}),l})(a)},l$=(e)=>[...e.route.route.slice(0,e.segmentIndex),...E$(e),...e.route.route.slice(e.segmentIndex+2)],Mce=(e)=>{let t=uw(e.route),n=(()=>{let H=[];for(let V=0;V<e.candidate.toothCount;V++){let O=Array(e.candidate.toothCount).fill(0);O[V]=e.candidate.maximumDepth;let U=E$({...e.candidate,route:e.route,toothDepths:O});if(e.isGeometryValid(U)){H.push(e.candidate.maximumDepth);continue}let j=0,Y=e.candidate.maximumDepth;for(let X=0;X<32;X++){let K=(j+Y)/2,J=Array(e.candidate.toothCount).fill(0);J[V]=K;let ee=E$({...e.candidate,route:e.route,toothDepths:J});e.isGeometryValid(ee)?j=K:Y=K}H.push(j)}return H})(),o=((H)=>{if(H.heightProfile!=="tapered")return Array(H.toothCount).fill(1);let V=Array.from({length:H.toothCount},(U,j)=>Math.sin(Math.PI*(j+1)/(H.toothCount+1))),O=Math.max(...V);return V.map((U)=>U/O)})(e.candidate),r=e.candidate.maximumDepth,i=n.map((H,V)=>Math.min(H,r*o[V])),s=[0.25,0.75],a=i.map((H)=>H*s[0]),c=i.map((H)=>H*s[1]),l=l$({...e.candidate,route:e.route,toothDepths:a}),h=l$({...e.candidate,route:e.route,toothDepths:c}),d=[uw({...e.route,route:l})-t,uw({...e.route,route:h})-t],u=l$({...e.candidate,route:e.route,toothDepths:i}),_=uw({...e.route,route:u})-t,p=(d[1]-d[0])/(s[1]-s[0]),m=d[0]-p*s[0],A=p>0&&Number.isFinite(p)?(e.targetAddedLength-m)/p:0,g=Math.min(e.targetAddedLength,_),f=e.targetAddedLength>0&&g>0?((H)=>{let V=0,O=e.candidate.maximumDepth;for(let j=0;j<32;j++){let Y=(V+O)/2,X=H.maximumToothDepths.map((se,ne)=>Math.min(se,Y*H.toothHeightWeights[ne])),K=l$({...e.candidate,route:e.route,toothDepths:X}),J=uw({...e.route,route:K})-H.originalLength,ee=E$({...e.candidate,route:e.route,toothDepths:X});e.isGeometryValid(ee)?J<H.targetAddedLength?V=Y:O=Y:O=Y}let U=(V+O)/2;return{depthLevel:U,toothDepths:H.maximumToothDepths.map((j,Y)=>Math.min(j,U*H.toothHeightWeights[Y]))}})({maximumToothDepths:n,toothHeightWeights:o,originalLength:t,targetAddedLength:g}):{depthLevel:A*r,toothDepths:i.map((H)=>Math.max(0,H*A))},y=f.depthLevel/r,x=f.toothDepths,C=l$({...e.candidate,route:e.route,toothDepths:x}),b=uw({...e.route,route:C})-t,I=Math.abs(g-b),v=E$({...e.candidate,route:e.route,toothDepths:x}),P=0;if(e.getCenterlineDistanceCost&&(P=e.getCenterlineDistanceCost(v)),P!==null&&(!Number.isFinite(P)||P<0))throw Error("LengthMatchingSolver: meander centerline distance cost must be a non-negative finite number");let M=Number.isFinite(y)&&y>0&&y<=1,B=x.every((H)=>H===0||H>=e.candidate.minimumHeight),T=e.isGeometryValid(v),N,D=null;P===null?D="no-paired-same-layer-geometry":M?I>e.lengthTolerance?D="target-error":T?B||(D="below-minimum-height"):D="invalid-geometry":D="invalid-scale",N=D?{valid:!1,invalidReason:D}:{valid:!0,invalidReason:null};let L={...e.candidate,connectionName:e.connectionName,maximumToothDepths:n,sampleScaleFactors:s,sampleAddedLengths:d,slope:p,intercept:m,predictedScaleFactor:y,predictedToothDepths:x,predictedRoute:C,addedLength:b,maximumAddedLength:_,resultingError:I,testedSegment:[{...e.route.route[e.candidate.segmentIndex]},{...e.route.route[e.candidate.segmentIndex+1]}],meanderPoints:v,centerlineDistanceCost:P,qualityScore:0,...N};return{...L,qualityScore:n6r(L)}},o6r=(e)=>{let t=((l)=>{if(l.heightProfile!=="tapered")return Array(l.toothCount).fill(1);let h=Array.from({length:l.toothCount},(u,_)=>Math.sin(Math.PI*(_+1)/(l.toothCount+1))),d=Math.max(...h);return h.map((u)=>u/d)})(e.candidate),n=Math.max(...t.map((l)=>e.candidate.minimumHeight/l)),o=e.candidate.maximumDepth/1073741824,r=t.map((l)=>l*(n+o));if(r.some((l)=>l>e.candidate.maximumDepth))return null;let i=E$({...e.candidate,route:e.route,toothDepths:r});if(!e.isGeometryValid(i))return null;let s=l$({...e.candidate,route:e.route,toothDepths:r}),a=uw({...e.route,route:s})-uw(e.route),c=Mce({...e,targetAddedLength:a});return c.valid?c:null},iUt=(e)=>{let t=(c,l)=>{let h=c[l.routeIndex];if(!h)throw Error(`LengthMatchingSolver: dual meander references missing route ${l.routeIndex}`);let d=[...c];return d[l.routeIndex]={...h,route:l.predictedRoute},d},n=(()=>{if(e.targetAddedLength+e.config.lengthTolerance<e.plan.minimumAddedLength||e.targetAddedLength-e.config.lengthTolerance>e.plan.maximumAddedLength)return null;let c=e.plan.attemptOptions.map((d)=>Math.min(...d.map((u)=>u.attempt.addedLength))),l=Math.max(0,e.targetAddedLength-e.plan.minimumAddedLength),h=c.map((d,u)=>u);for(;l>0.000000001&&h.length>0;){let d=l/h.length,u=0,_=[];for(let p of h){let m=Math.max(...e.plan.attemptOptions[p].map((g)=>g.attempt.maximumAddedLength))-c[p],A=Math.min(m,d);c[p]+=A,u+=A,m-A>0.000000001&&_.push(p)}if(u<=0.000000001)break;l-=u,h=_}return l<=e.config.lengthTolerance?c:null})();if(!n)return null;let o=e.plan.attemptOptions.map((c,l)=>({attemptOptions:c,targetAddedLength:n[l]})).sort((c,l)=>l.attemptOptions[0].candidate.routeIndex-c.attemptOptions[0].candidate.routeIndex||l.attemptOptions[0].candidate.segmentIndex-c.attemptOptions[0].candidate.segmentIndex),r=[...e.routes],i=[];for(let c of o){let l=c.attemptOptions[0]?.candidate;if(!l)throw Error("LengthMatchingSolver: empty dual-meander segment options");let h=r[l.routeIndex];if(!h)throw Error(`LengthMatchingSolver: missing planned dual-meander route ${l.routeIndex}`);let d=null;for(let u of c.attemptOptions){if(u.attempt.addedLength-e.config.lengthTolerance>c.targetAddedLength||u.attempt.maximumAddedLength+e.config.lengthTolerance<c.targetAddedLength)continue;let _=Mce({candidate:u.candidate,route:h,connectionName:e.connectionName,targetAddedLength:c.targetAddedLength,lengthTolerance:e.config.lengthTolerance,isGeometryValid:(p)=>c$({route:h,meanderPoints:p,routedRoutes:e.excludedConnectionName?r.filter((m)=>mV(m)!==e.excludedConnectionName):r,...e.config})});_.valid&&(!d||_.qualityScore>d.qualityScore)&&(d=_)}if(!d)return null;r=t(r,d),i.push(d)}let s=i.reduce((c,l)=>c+l.addedLength,0);if(Math.abs(s-e.targetAddedLength)>e.config.lengthTolerance)return null;let a=i[0];if(!a)throw Error("LengthMatchingSolver: fitted an empty dual-meander plan");return{attempts:[a,...i.slice(1)],routes:r,addedLength:s}},mCe=(e)=>{if(e.length===0)throw Error("LengthMatchingSolver: cannot score an empty meander plan");return e.reduce((t,n)=>t+n.qualityScore,0)/e.length-3*(e.length-1)},sUt=(e)=>{let t=(r)=>[r.candidate.toothCount,r.candidate.placement,r.candidate.heightProfile].join(":"),n=new Map;for(let r of e){let i=t(r),s=`${r.candidate.routeIndex}:${r.candidate.segmentIndex}`,a=n.get(i);if(!a){n.set(i,new Map([[s,[r]]]));continue}let c=a.get(s);c?c.push(r):a.set(s,[r])}let o=[];for(let r of n.values()){let i=[...r.values()].map((s)=>({attempts:s,maximumAddedLength:Math.max(...s.map((a)=>a.attempt.maximumAddedLength)),minimumAddedLength:Math.min(...s.map((a)=>a.attempt.addedLength)),rankingAttempt:s.reduce((a,c)=>c.attempt.qualityScore>a.attempt.qualityScore?c:a)})).sort((s,a)=>a.maximumAddedLength-s.maximumAddedLength);for(let s of i)o.push({attempts:[s.rankingAttempt],attemptOptions:[s.attempts],minimumAddedLength:s.minimumAddedLength,maximumAddedLength:s.maximumAddedLength,rankingQualityScore:s.rankingAttempt.attempt.qualityScore});for(let s=2;s<=i.length;s++){let a=i.slice(0,s),c=a.map((l)=>l.rankingAttempt);o.push({attempts:c,attemptOptions:a.map((l)=>l.attempts),minimumAddedLength:a.reduce((l,h)=>l+h.minimumAddedLength,0),maximumAddedLength:a.reduce((l,h)=>l+h.maximumAddedLength,0),rankingQualityScore:mCe(c.map((l)=>l.attempt))})}}return o},_Ce=class extends Error{connectionName;reason;constructor(e){super(e.message),this.name="LengthMatchingNoSolutionError",this.connectionName=e.connectionName,this.reason=e.reason}},bO=(e)=>[e.routeIndex,e.segmentIndex,e.toothCount,e.placement,e.toothPitch,e.heightProfile,e.maximumDepth,e.minimumHeight].join(":"),aUt=(e)=>{let t=new Map,n=[...e.attempts].sort((r,i)=>r.addedLength-i.addedLength),o=e.targetAddedLength;for(let r=0;r<n.length;r++){let i=n[r],s=Math.min(i.addedLength,o/(n.length-r));t.set(bO(i),{routeIndex:i.routeIndex,segmentIndex:i.segmentIndex,targetAddedLength:s}),o-=s}return t},r6r=(e,t)=>`z${Oq(e,t).join(",")}`,IO=(e)=>`z${e}`,i6r=(e)=>{if(!e.showAttempt)return;if(!e.attempt)return void((i)=>{let s=i.activePair?.candidates[i.activePair.candidateIndex];if(!s)return;let a=i.routes[s.routeIndex];if(!a)return;let c=a.route[s.segmentIndex],l=a.route[s.segmentIndex+1];c&&l&&i.graphics.lines.push({points:[c,l],strokeColor:"rgba(234, 179, 8, 0.6)",strokeWidth:2*a.traceThickness,strokeDash:[0.1,0.1],layer:IO(c.z)})})(e);let t=e.routes[e.attempt.routeIndex],[n,o]=e.attempt.testedSegment,r=e.theme.getConnectionColor(e.attempt.connectionName);e.graphics.lines.push({points:[n,o],strokeColor:e.theme.getTestedSegmentColor(r),strokeWidth:t.traceThickness,strokeDash:[0.15,0.15],layer:IO(n.z)}),e.attempt.valid?e.graphics.lines.push({points:e.attempt.meanderPoints.map(({x:i,y:s})=>({x:i,y:s})),strokeColor:"rgba(234, 179, 8, 0.6)",strokeWidth:2*t.traceThickness,strokeDash:[0.1,0.1],layer:IO(n.z)}):e.graphics.lines.push({points:e.attempt.meanderPoints.map(({x:i,y:s})=>({x:i,y:s})),strokeColor:e.theme.getRejectedCandidateColor(r),strokeWidth:t.traceThickness,strokeDash:[0.1,0.1],layer:IO(n.z)}),e.graphics.points.push({x:n.x,y:n.y,color:r,layer:IO(n.z)},{x:o.x,y:o.y,color:r,layer:IO(o.z)})},s6r=(e)=>{let t={lines:[],points:[],rects:[],circles:[]},n=((o)=>{for(let r of Object.values(o))d$(0,r);return{getConnectionColor:(r,i)=>o[r]??(i?o[i]:void 0)??((s)=>s?`hsl(${300*s.split("").reduce((a,c)=>a+c.charCodeAt(0),0)/s.length%360}, 100%, 50%)`:"rgba(0, 0, 0, 0.5)")(r),getInnerLayerConnectionColor:(r)=>d$(0.5,r),getTestedSegmentColor:(r)=>d$(0.55,r),getRejectedCandidateColor:(r)=>d$(0.45,r),boardBounds:{fill:"rgba(30,41,59,0.03)",stroke:"rgba(30,41,59,0.55)"},obstacle:{fill:"rgba(255,0,0,0.25)",stroke:"rgba(255,0,0,0.5)"},via:{fill:"blue",stroke:"none"}}})(e.colorMap);return((o)=>{for(let r of o.routes){let i=mV(r),s=o.theme.getConnectionColor(i,r.connectionName);for(let c=0;c<r.route.length-1;c++){let l=r.route[c],h=r.route[c+1];l.z===h.z&&o.graphics.lines.push({points:[l,h],strokeColor:l.z===0?s:o.theme.getInnerLayerConnectionColor(s),strokeWidth:r.traceThickness,...l.z===0?{}:{strokeDash:[0.2,0.2]},layer:IO(l.z)})}let a=[...new Set(r.route.map((c)=>c.z))];for(let c of r.vias)o.graphics.circles.push({center:c,radius:r.viaDiameter/2,fill:o.theme.via.fill,stroke:o.theme.via.stroke,layer:`z${(c.zLayers??a).join(",")}`})}})({routes:e.routes,theme:n,graphics:t}),((o)=>{if(o.bounds){let{minX:r,maxX:i,minY:s,maxY:a}=o.bounds;o.graphics.rects.push({center:{x:(r+i)/2,y:(s+a)/2},width:i-r,height:a-s,fill:o.theme.boardBounds.fill,stroke:o.theme.boardBounds.stroke,layer:`z${Array.from({length:o.layerCount},(c,l)=>l).join(",")}`})}for(let r of o.obstacles)o.graphics.rects.push({center:r.center,width:r.width,height:r.height,ccwRotationDegrees:r.ccwRotationDegrees,fill:o.theme.obstacle.fill,stroke:o.theme.obstacle.stroke,layer:r6r(r,o.layerCount)})})({obstacles:e.obstacles,bounds:e.bounds,layerCount:e.layerCount,theme:n,graphics:t}),i6r({routes:e.routes,attempt:e.currentAttempt,activePair:e.activePair,showAttempt:!e.solved,theme:n,graphics:t}),{...t}},jcn=class extends fa{constructor(e){super(),this.params=e,this.MAX_ITERATIONS=1e5,this.matchedHdRoutes=e.hdRoutes.map((t)=>({...t,route:t.route.map((n)=>({...n}))})),this.pairs=e.differentialPairs??[]}params;matchedHdRoutes;pairs;nextPairIndex=0;activePair=null;currentAttempt=null;config=null;candidatesTried=0;getSolverName(){return"LengthMatchingSolver"}startNextPair(){let e=this.pairs[this.nextPairIndex++];if(!e)return void(this.solved=!0);((h,d)=>{if(h.connectionNames[0]===h.connectionNames[1])throw Error("LengthMatchingSolver: a differential pair must reference two distinct connections");if(!Number.isFinite(h.lengthTolerance)||h.lengthTolerance<0)throw Error("LengthMatchingSolver: differential pair lengthTolerance must be a non-negative finite number");for(let _ of[h.minimumCenterlineDistance,h.maximumCenterlineDistance])if(_!==void 0&&(!Number.isFinite(_)||_<=0))throw Error("LengthMatchingSolver: differential pair centerline distances must be positive finite numbers");if(h.minimumCenterlineDistance!==void 0&&h.maximumCenterlineDistance!==void 0&&h.minimumCenterlineDistance>h.maximumCenterlineDistance)throw Error("LengthMatchingSolver: differential pair minimumCenterlineDistance cannot exceed maximumCenterlineDistance");let u=new Map(d.map((_)=>[_.name,_]));for(let _ of h.connectionNames){let p=u.get(_);if(!p)throw Error(`LengthMatchingSolver: differential pair references unknown connection "${_}"`);if(p.pointsToConnect.length!==2)throw Error(`LengthMatchingSolver: differential pair connection "${_}" must have exactly two points before MST splitting`)}})(e,this.params.originalConnections);let t=jK(this.matchedHdRoutes,e.connectionNames[0]),n=jK(this.matchedHdRoutes,e.connectionNames[1]);if(t.length===0&&n.length===0)return;if(t.length===0||n.length===0)throw Error(`LengthMatchingSolver: differential pair ${e.connectionNames.join("/")} has routed geometry for only one connection`);let o=KK(this.matchedHdRoutes,t),r=KK(this.matchedHdRoutes,n),i=Math.abs(o-r);if(i<=e.lengthTolerance)return;let s=o<r,a=e.connectionNames[s?0:1],c=e.connectionNames[s?1:0],l=rUt({routes:this.matchedHdRoutes,routeIndexes:s?t:n,maximumDepth:this.getConfig().maximumMeanderDepth,minimumToothPitch:this.getConfig().minimumToothPitch,minMeanderGap:this.getConfig().minMeanderGap,minMeanderHeight:this.getConfig().minMeanderHeight,maxToothCount:this.getConfig().maxToothCount});if(l.length===0)throw new _Ce({message:`LengthMatchingSolver: no same-layer straight segment can tune connection "${a}"`,connectionName:a,reason:"no-meander-candidate"});this.activePair={pair:e,longerConnectionName:c,longerRouteIndexes:s?n:t,shorterConnectionName:a,targetAddedLength:i,remainingAddedLength:i,candidates:l,candidateIndex:0,lastMatchedSegmentIndexByRoute:new Map,partialAttempts:[],fullAttempts:[],plannedAttemptTargets:null,hasMinimumHeightBlockedAttempt:!1}}acceptAttempt(e,t){let n=this.matchedHdRoutes[t.routeIndex];this.matchedHdRoutes[t.routeIndex]={...n,route:t.predictedRoute},e.remainingAddedLength-=t.addedLength,e.lastMatchedSegmentIndexByRoute.set(t.routeIndex,t.segmentIndex),e.candidateIndex=0,e.partialAttempts=[],e.fullAttempts=[],e.plannedAttemptTargets?.delete(bO(t)),e.plannedAttemptTargets?.size===0&&(e.plannedAttemptTargets=null),e.remainingAddedLength<=e.pair.lengthTolerance&&(this.activePair=null)}tryCandidate(e){let t;for(;!t;){let i=e.candidates[e.candidateIndex++];if(!i)break;let s=e.lastMatchedSegmentIndexByRoute.get(i.routeIndex);(s===void 0||i.segmentIndex<s)&&(!e.plannedAttemptTargets||e.plannedAttemptTargets.has(bO(i))&&![...e.plannedAttemptTargets.values()].some((a)=>a.routeIndex===i.routeIndex&&a.segmentIndex>i.segmentIndex))&&(t=i)}if(!t){let i=e.fullAttempts.reduce((a,c)=>!a||c.qualityScore>a.qualityScore?c:a,null),s=((a)=>{let c=(d)=>[d.toothCount,d.placement,d.heightProfile].join(":"),l=new Map;for(let d of a.attempts){let u=`${d.routeIndex}:${d.segmentIndex}`,_=c(d),p=l.get(_);if(!p){l.set(_,new Map([[u,[d]]]));continue}let m=p.get(u);m?m.push(d):p.set(u,[d])}let h=null;for(let d of l.values()){let u=[...d.values()].map((p)=>({attempts:p,maximumCapacityAttempt:p.reduce((m,A)=>A.addedLength>m.addedLength?A:m)})).sort((p,m)=>m.maximumCapacityAttempt.addedLength-p.maximumCapacityAttempt.addedLength),_=0;for(let p=0;p<u.length;p++){if(_+=u[p].maximumCapacityAttempt.addedLength,_+a.lengthTolerance<a.targetAddedLength)continue;let m=u.slice(0,p+1),A=m.map((C)=>C.maximumCapacityAttempt),g=aUt({attempts:A,targetAddedLength:a.targetAddedLength}),f=m.map((C)=>{let b=g.get(bO(C.maximumCapacityAttempt));if(!b)throw Error(`LengthMatchingSolver: missing capacity target for ${bO(C.maximumCapacityAttempt)}`);let I=C.attempts.filter((v)=>v.addedLength+a.lengthTolerance>=b.targetAddedLength);if(I.length===0)throw Error(`LengthMatchingSolver: no pitch can supply planned target for route ${C.maximumCapacityAttempt.routeIndex} segment ${C.maximumCapacityAttempt.segmentIndex}`);return I.reduce((v,P)=>P.qualityScore>v.qualityScore||P.qualityScore===v.qualityScore&&P.toothPitch>v.toothPitch?P:v)}),y=mCe(f);if(!h){h={attempts:f};break}let x=mCe(h.attempts);(f.length<h.attempts.length||f.length===h.attempts.length&&y>x)&&(h={attempts:f});break}}return h})({attempts:e.partialAttempts,targetAddedLength:e.remainingAddedLength,lengthTolerance:e.pair.lengthTolerance});if(i&&(!s||i.qualityScore>=mCe(s.attempts)))return void this.acceptAttempt(e,i);if(!s){if(!(e.hasMinimumHeightBlockedAttempt&&e.plannedAttemptTargets===null&&e.lastMatchedSegmentIndexByRoute.size===0))throw new _Ce({message:`LengthMatchingSolver: linear regression exhausted all segment/tooth combinations for "${e.shorterConnectionName}"; required ${e.targetAddedLength.toFixed(4)}mm`,connectionName:e.shorterConnectionName,reason:"meander-search-exhausted"});return this.tryDualMeanderPlan(e)}return e.plannedAttemptTargets=aUt({attempts:s.attempts,targetAddedLength:e.remainingAddedLength}),e.candidateIndex=0,e.partialAttempts=[],void(e.fullAttempts=[])}let n=this.matchedHdRoutes[t.routeIndex],o=this.getConfig(),r=e.plannedAttemptTargets?.get(bO(t));if(e.plannedAttemptTargets!==null&&r===void 0)throw Error(`LengthMatchingSolver: missing planned target for ${bO(t)}`);this.currentAttempt=Mce({candidate:t,route:n,connectionName:e.shorterConnectionName,targetAddedLength:r===void 0?e.remainingAddedLength:r.targetAddedLength,lengthTolerance:e.pair.lengthTolerance,isGeometryValid:(i)=>c$({route:n,meanderPoints:i,routedRoutes:this.matchedHdRoutes,traces:o.traces,obstacles:o.obstacles,bounds:o.bounds,layerCount:o.layerCount,obstacleMargin:o.obstacleMargin}),getCenterlineDistanceCost:e.pair.minimumCenterlineDistance===void 0&&e.pair.maximumCenterlineDistance===void 0?void 0:(i)=>((s)=>{let a=0,c=0;for(let l=0;l<s.meanderPoints.length-1;l++){let h=s.meanderPoints[l],d=s.meanderPoints[l+1],u=Math.hypot(d.x-h.x,d.y-h.y);if(u!==0){for(let _=0;_<4;_++){let p=(_+0.5)/4,m={x:h.x+(d.x-h.x)*p,y:h.y+(d.y-h.y)*p},A=[];for(let f of s.pairedRoutes)for(let y=0;y<f.route.length-1;y++){let x=f.route[y],C=f.route[y+1];h.z===x.z&&h.z===C.z&&A.push(fb(m,m,x,C))}if(A.length===0)return null;let g=Math.min(...A);c+=u*Math.max(0,(s.minimumCenterlineDistance??Number.NEGATIVE_INFINITY)-g,g-(s.maximumCenterlineDistance??Number.POSITIVE_INFINITY))/4}a+=u}}if(a===0)throw Error("LengthMatchingSolver: cannot measure a zero-length meander centerline");return c/a})({meanderPoints:i,pairedRoutes:e.longerRouteIndexes.map((s)=>this.matchedHdRoutes[s]),minimumCenterlineDistance:e.pair.minimumCenterlineDistance,maximumCenterlineDistance:e.pair.maximumCenterlineDistance})}),this.candidatesTried++,this.currentAttempt.invalidReason==="below-minimum-height"&&(e.hasMinimumHeightBlockedAttempt=!0),this.stats={pair:`${e.pair.connectionNames[0]}/${e.pair.connectionNames[1]}`,candidatesTried:this.candidatesTried,segmentIndex:t.segmentIndex,toothCount:t.toothCount,toothPitch:t.toothPitch,placement:t.placement,predictedScaleFactor:this.currentAttempt.predictedScaleFactor,predictedToothDepths:this.currentAttempt.predictedToothDepths,resultingError:this.currentAttempt.resultingError,qualityScore:this.currentAttempt.qualityScore,accepted:this.currentAttempt.valid},this.currentAttempt.valid&&(e.plannedAttemptTargets===null?e.remainingAddedLength-this.currentAttempt.addedLength<=e.pair.lengthTolerance?e.fullAttempts.push(this.currentAttempt):e.partialAttempts.push(this.currentAttempt):this.acceptAttempt(e,this.currentAttempt))}tryDualMeanderPlan(e){if(e.remainingAddedLength!==e.targetAddedLength)throw Error(`LengthMatchingSolver: cannot start a dual-meander plan after partially tuning "${e.shorterConnectionName}"`);let t=this.getConfig(),n=rUt({routes:this.matchedHdRoutes,routeIndexes:e.longerRouteIndexes,maximumDepth:t.maximumMeanderDepth,minimumToothPitch:t.minimumToothPitch,minMeanderGap:t.minMeanderGap,minMeanderHeight:t.minMeanderHeight,maxToothCount:t.maxToothCount}),o=((a)=>{let c=(x,C)=>x.rankingQualityScore!==C.rankingQualityScore?x.rankingQualityScore>C.rankingQualityScore:x.leftIndex!==C.leftIndex?x.leftIndex<C.leftIndex:x.rightIndex<C.rightIndex,l=(x,C)=>{x.push(C);let b=x.length-1;for(;b>0;){let I=Math.floor((b-1)/2),v=x[I];if(c(v,C))break;x[b]=v,b=I}x[b]=C},h=(x)=>{let C=x[0],b=x.pop();if(!C||!b||x.length===0)return C;let I=0;for(;;){let v=2*I+1,P=v+1;if(v>=x.length)break;let M=P<x.length&&c(x[P],x[v])?P:v,B=x[M];if(c(b,B))break;x[I]=B,I=M}return x[I]=b,C},d=function*(x){let C=[...x.leftOptions].sort((v,P)=>x.getLeftQualityScore(P)-x.getLeftQualityScore(v)),b=[...x.rightOptions].sort((v,P)=>x.getRightQualityScore(P)-x.getRightQualityScore(v)),I=[];for(let v=0;v<C.length;v++){let P=b[0];if(!P)break;l(I,{leftIndex:v,rightIndex:0,rankingQualityScore:(x.getLeftQualityScore(C[v])+x.getRightQualityScore(P))/2})}for(;I.length>0;){let v=h(I);yield[C[v.leftIndex],b[v.rightIndex]];let P=v.rightIndex+1,M=b[P];M&&l(I,{leftIndex:v.leftIndex,rightIndex:P,rankingQualityScore:(x.getLeftQualityScore(C[v.leftIndex])+x.getRightQualityScore(M))/2})}},u=(x,C)=>{let b=x[C.routeIndex];if(!b)throw Error(`LengthMatchingSolver: dual meander references missing route ${C.routeIndex}`);let I=[...x];return I[C.routeIndex]={...b,route:C.predictedRoute},I},_=(x)=>{let C=x.routes[x.attempt.routeIndex];if(!C)throw Error(`LengthMatchingSolver: cannot validate missing dual-meander route ${x.attempt.routeIndex}`);return c$({route:C,meanderPoints:x.attempt.meanderPoints,routedRoutes:x.routes,...x.config})},p=(x)=>{let C=x.routes.filter((I)=>mV(I)!==x.counterpartConnectionName),b=[];for(let I of x.candidates){let v=x.routes[I.routeIndex];if(!v)throw Error(`LengthMatchingSolver: dual-meander candidate references missing route ${I.routeIndex}`);let P=o6r({candidate:I,route:v,connectionName:x.connectionName,lengthTolerance:x.config.lengthTolerance,isGeometryValid:(M)=>c$({route:v,meanderPoints:M,routedRoutes:C,...x.config})});P&&b.push({candidate:I,attempt:P})}return b},m={traces:a.traces,obstacles:a.obstacles,bounds:a.bounds,layerCount:a.layerCount,obstacleMargin:a.obstacleMargin},A=p({candidates:a.shorterCandidates,routes:a.routes,connectionName:a.shorterConnectionName,counterpartConnectionName:a.longerConnectionName,config:{...m,lengthTolerance:a.lengthTolerance}});if(A.length===0)return null;let g=p({candidates:a.longerCandidates,routes:a.routes,connectionName:a.longerConnectionName,counterpartConnectionName:a.shorterConnectionName,config:{...m,lengthTolerance:a.lengthTolerance}}),f=d({leftOptions:g,rightOptions:A,getLeftQualityScore:(x)=>x.attempt.qualityScore,getRightQualityScore:(x)=>x.attempt.qualityScore});for(let[x,C]of f){let b=Math.max(x.attempt.addedLength,C.attempt.addedLength-a.originalLengthDifference),I=b+a.originalLengthDifference;if(b-a.lengthTolerance>x.attempt.maximumAddedLength||I-a.lengthTolerance>C.attempt.maximumAddedLength)continue;let v=a.routes[x.candidate.routeIndex];if(!v)throw Error(`LengthMatchingSolver: missing longer route ${x.candidate.routeIndex}`);let P=a.routes[C.candidate.routeIndex];if(!P)throw Error(`LengthMatchingSolver: missing shorter route ${C.candidate.routeIndex}`);let M=a.routes.filter((O)=>mV(O)!==a.shorterConnectionName),B=Mce({candidate:x.candidate,route:v,connectionName:a.longerConnectionName,targetAddedLength:b,lengthTolerance:a.lengthTolerance,isGeometryValid:(O)=>c$({route:v,meanderPoints:O,routedRoutes:M,...m})});if(!B.valid||Math.abs(B.addedLength-b)>a.lengthTolerance)continue;let T=u(a.routes,B),N=B.addedLength+a.originalLengthDifference,D=Mce({candidate:C.candidate,route:P,connectionName:a.shorterConnectionName,targetAddedLength:N,lengthTolerance:a.lengthTolerance,isGeometryValid:(O)=>c$({route:P,meanderPoints:O,routedRoutes:T,...m})});if(!D.valid)continue;let L=u(T,D),H=jK(L,a.longerConnectionName),V=jK(L,a.shorterConnectionName);if(!(Math.abs(KK(L,V)-KK(L,H))>a.lengthTolerance)&&_({attempt:B,routes:L,config:m})&&_({attempt:D,routes:L,config:m}))return{longerAttempts:[B],shorterAttempts:[D]}}let y=d({leftOptions:sUt(g),rightOptions:sUt(A),getLeftQualityScore:(x)=>x.rankingQualityScore,getRightQualityScore:(x)=>x.rankingQualityScore});for(let[x,C]of y){if(x.attempts.length===1&&C.attempts.length===1)continue;let b=Math.max(x.minimumAddedLength,C.minimumAddedLength-a.originalLengthDifference),I=b+a.originalLengthDifference;if(b-a.lengthTolerance>x.maximumAddedLength||I-a.lengthTolerance>C.maximumAddedLength)continue;let v=iUt({plan:x,targetAddedLength:b,routes:a.routes,connectionName:a.longerConnectionName,excludedConnectionName:a.shorterConnectionName,config:{...m,lengthTolerance:a.lengthTolerance}});if(!v)continue;let P=iUt({plan:C,targetAddedLength:v.addedLength+a.originalLengthDifference,routes:v.routes,connectionName:a.shorterConnectionName,config:{...m,lengthTolerance:a.lengthTolerance}});if(!P)continue;let M=jK(P.routes,a.longerConnectionName),B=jK(P.routes,a.shorterConnectionName),T=Math.abs(KK(P.routes,B)-KK(P.routes,M)),N=[...v.attempts,...P.attempts];if(!(T>a.lengthTolerance||N.some((D)=>!_({attempt:D,routes:P.routes,config:m}))))return{longerAttempts:v.attempts,shorterAttempts:P.attempts}}return null})({routes:this.matchedHdRoutes,longerConnectionName:e.longerConnectionName,shorterConnectionName:e.shorterConnectionName,originalLengthDifference:e.targetAddedLength,lengthTolerance:e.pair.lengthTolerance,longerCandidates:n,shorterCandidates:e.candidates,traces:t.traces,obstacles:t.obstacles,bounds:t.bounds,layerCount:t.layerCount,obstacleMargin:t.obstacleMargin});if(!o)throw new _Ce({message:`LengthMatchingSolver: linear regression exhausted all segment/tooth combinations for "${e.shorterConnectionName}"; required ${e.targetAddedLength.toFixed(4)}mm`,connectionName:e.shorterConnectionName,reason:"meander-search-exhausted"});let r=[...this.matchedHdRoutes];for(let a of[...o.longerAttempts,...o.shorterAttempts]){let c=this.matchedHdRoutes[a.routeIndex];if(!c)throw Error(`LengthMatchingSolver: cannot commit dual meander to missing route ${a.routeIndex}`);r[a.routeIndex]={...c,route:a.predictedRoute}}this.matchedHdRoutes=r,this.currentAttempt=o.shorterAttempts[0];let i=o.longerAttempts.reduce((a,c)=>a+c.addedLength,0),s=o.shorterAttempts.reduce((a,c)=>a+c.addedLength,0);this.stats={pair:`${e.pair.connectionNames[0]}/${e.pair.connectionNames[1]}`,mode:"dual-meander",longerAddedLength:i,shorterAddedLength:s,resultingError:Math.abs(s-i-e.targetAddedLength)},this.activePair=null}getConfig(){return this.config||(this.config=((e)=>{let t=e.maximumMeanderDepth??5,n=e.maxToothCount??12;if(!Number.isFinite(t)||t<=0)throw Error("LengthMatchingSolver: maximumMeanderDepth must be a positive finite number");if(e.minimumToothPitch!==void 0&&(!Number.isFinite(e.minimumToothPitch)||e.minimumToothPitch<=0))throw Error("LengthMatchingSolver: minimumToothPitch must be a positive finite number");if(e.minMeanderGap!==void 0&&(!Number.isFinite(e.minMeanderGap)||e.minMeanderGap<=0))throw Error("LengthMatchingSolver: minMeanderGap must be a positive finite number");if(e.minMeanderHeight!==void 0&&(!Number.isFinite(e.minMeanderHeight)||e.minMeanderHeight<=0))throw Error("LengthMatchingSolver: minMeanderHeight must be a positive finite number");if(e.minMeanderHeight!==void 0&&e.minMeanderHeight>t)throw Error("LengthMatchingSolver: minMeanderHeight cannot exceed maximumMeanderDepth");if(!Number.isFinite(n)||!Number.isInteger(n)||n<=0)throw Error("LengthMatchingSolver: maxToothCount must be a positive finite integer");for(let o of e.traces??[])Wle(o,e.layerCount??2);return{maximumMeanderDepth:t,minimumToothPitch:e.minimumToothPitch,minMeanderGap:e.minMeanderGap,minMeanderHeight:e.minMeanderHeight,maxToothCount:n,traces:e.traces??[],obstacles:e.obstacles??[],bounds:e.bounds,obstacleMargin:e.obstacleMargin??0.15,layerCount:e.layerCount??2,colorMap:e.colorMap??{}}})(this.params)),this.config}_step(){this.getConfig(),this.activePair?this.tryCandidate(this.activePair):this.startNextPair()}getConstructorParams(){return[this.params]}getOutput(){if(!this.solved)throw Error("LengthMatchingSolver: getOutput() called before the solver completed");return{matchedHdRoutes:this.matchedHdRoutes}}getBestEffortOutput(){let e=structuredClone(this.matchedHdRoutes),t=this.activePair?.fullAttempts??[],n=null;for(let o of t)(!n||o.qualityScore>n.qualityScore)&&(n=o);if(!n)for(let o of this.activePair?.partialAttempts??[])(!n||o.addedLength>n.addedLength||o.addedLength===n.addedLength&&o.qualityScore>n.qualityScore)&&(n=o);if(n){let o=e[n.routeIndex];o&&(e[n.routeIndex]={...o,route:structuredClone(n.predictedRoute)})}return{matchedHdRoutes:e}}computeProgress(){if(this.solved)return 1;if(this.pairs.length===0)return this.config?1:0;let e=Math.max(0,this.nextPairIndex-1),t=this.activePair?this.activePair.candidateIndex/this.activePair.candidates.length:0;return Math.min(0.99,(e+t)/this.pairs.length)}visualize(){let e=this.getConfig();return s6r({routes:this.matchedHdRoutes,obstacles:e.obstacles,bounds:e.bounds,layerCount:e.layerCount,colorMap:e.colorMap,activePair:this.activePair,currentAttempt:this.currentAttempt,solved:this.solved})}},MXe=0.00000001,t_=(e,t)=>{if(e.route.length===0)throw Error(`trace "${e.connection_name}" has an empty route`);if(e.route.some((u)=>u.route_type!=="wire"&&u.route_type!=="via"))throw Error(`trace "${e.connection_name}" contains unsupported jumper or through-obstacle geometry`);let n=e.route.findIndex((u)=>u.route_type==="wire"),o=e.route[n],r=e.route.findLast((u)=>u.route_type==="wire");if(o?.route_type!=="wire"||!r)throw Error(`trace "${e.connection_name}" must contain a wire point`);let i=[],s=[],a=[],c=[],l=null,h=o.width;if(n>0){let u=o.layer;for(let p=n-1;p>=0;p--){let m=e.route[p];if(m?.route_type!=="via")throw Error(`trace "${e.connection_name}" has unsupported geometry before its first wire`);if(u===m.to_layer)u=m.from_layer;else{if(u!==m.from_layer)throw Error(`trace "${e.connection_name}" has discontinuous leading vias`);u=m.to_layer}}let _=e.route[0];if(_.route_type!=="via")throw Error(`trace "${e.connection_name}" has an invalid leading entry`);l={x:_.x,y:_.y,layer:u,width:o.width},i.push(l)}for(let u of e.route){if(u.route_type==="wire"){if(!Number.isFinite(u.x)||!Number.isFinite(u.y)||!Number.isFinite(u.width)||u.width<=0||W0(u.layer,t)<0)throw Error(`trace "${e.connection_name}" has an invalid wire point`);h=Math.max(h,u.width);let f={x:u.x,y:u.y,layer:u.layer,width:u.width};if(l){if(l.layer!==f.layer)throw Error(`trace "${e.connection_name}" changes layers without a via`);Math.hypot(l.x-f.x,l.y-f.y)>MXe&&s.push({start:l,end:f,layer:f.layer,width:Math.max(l.width,f.width),connectionName:e.connection_name,terminal:null})}i.push(f),l=f;continue}if(u.route_type!=="via")throw Error(`trace "${e.connection_name}" contains unsupported route geometry`);if(!l)throw Error(`trace "${e.connection_name}" has a leading via`);let _=W0(u.from_layer,t),p=W0(u.to_layer,t),m=u.via_diameter??l.width;if(!Number.isFinite(u.x)||!Number.isFinite(u.y)||_<0||p<0||_===p||u.via_diameter!==void 0&&(!Number.isFinite(u.via_diameter)||u.via_diameter<=0)||u.via_hole_diameter!==void 0&&(!Number.isFinite(u.via_hole_diameter)||u.via_hole_diameter<=0||u.via_hole_diameter>=m))throw Error(`trace "${e.connection_name}" has an invalid via`);let A=l.layer===u.from_layer?u.from_layer:l.layer===u.to_layer?u.to_layer:null;if(!A)throw Error(`trace "${e.connection_name}" has a discontinuous via transition`);Math.hypot(l.x-u.x,l.y-u.y)>MXe&&s.push({start:l,end:u,layer:l.layer,width:l.width,connectionName:e.connection_name,terminal:null});let g=A===u.from_layer?u.to_layer:u.from_layer;c.push({...u,from_layer:A,to_layer:g}),a.push({x:u.x,y:u.y,layers:Sq(A,g,t),diameter:m,connectionName:e.connection_name,terminal:i.length===1?"start":null}),l={x:u.x,y:u.y,layer:g,width:l.width},i.push(l)}if(i.length<2||s.length===0)throw Error(`trace "${e.connection_name}" does not contain a routable path`);s[0].terminal=s.length===1?"both":"start",s[s.length-1].terminal=s.length===1?"both":"end";let d=a.at(-1);return d&&Math.hypot(d.x-r.x,d.y-r.y)<=MXe&&(d.terminal="end"),{source:e,points:i,segments:s,vias:a,transitions:c,width:h,viaDiameter:e.__postProcessingViaDiameter??h,...o.start_pcb_port_id?{startPortId:o.start_pcb_port_id}:{},...r.end_pcb_port_id?{endPortId:r.end_pcb_port_id}:{}}},fw=(e)=>e.segments.reduce((t,n)=>t+Math.hypot(n.end.x-n.start.x,n.end.y-n.start.y),0),cUt=(e)=>{let{simpleRouteJson:t}=e.params,n=((h)=>{let d=new Set(h.reroutedPairs.map((u)=>u.connectionNames.join("\x00")));return h.declaredPairs.filter((u)=>{let _=u.connectionNames.map((A)=>h.traces.filter((g)=>g.connection_name===A));if(_.some((A)=>A.length!==1))return!1;if(d.has(u.connectionNames.join("\x00")))return!0;let p=_.map((A)=>A[0]);if(p.some((A)=>A.route.length<2||A.route[0]?.route_type!=="wire"||!A.route.every((g)=>g.route_type==="wire"||g.route_type==="via")))return!1;let m=p.map((A)=>fw(t_(A,h.layerCount)));return Math.abs(m[0]-m[1])>u.lengthTolerance+0.0000001}).map((u)=>structuredClone(u))})({traces:e.result.traces,declaredPairs:t.differentialPairs,reroutedPairs:e.result.reroutedPairs,layerCount:t.layerCount}),o=new Set(n.flatMap((h)=>h.connectionNames)),r=[],i=[],s=[],a=new Set;for(let h=0;h<e.result.traces.length;h++){let d=e.result.traces[h];if(!o.has(d.connection_name))continue;let u=d.route.every((M)=>M.route_type==="wire"||M.route_type==="via"),_=d.route[0]?.route_type==="wire";if(!u||!_)throw Error(`PostProcessingSolver: rerouted connection "${d.connection_name}" cannot be bound to LengthMatchingSolver`);let p=t_(d,t.layerCount),m=d.route[0];if(m.route_type!=="wire")throw Error(`PostProcessingSolver: trace "${d.connection_name}" lost its first wire during binding`);let A=[{x:m.x,y:m.y,z:W0(m.layer,t.layerCount),traceThickness:m.width}],g=[],f=[],{layer:y,width:x}=m;for(let M of d.route.slice(1)){if(M.route_type==="wire"){if(M.layer!==y)throw Error(`PostProcessingSolver: trace "${d.connection_name}" changes layers without a via while binding`);A.push({x:M.x,y:M.y,z:W0(M.layer,t.layerCount),traceThickness:M.width}),x=M.width;continue}if(M.route_type!=="via")throw Error(`PostProcessingSolver: trace "${d.connection_name}" contains unsupported bound geometry`);let B=y===M.from_layer?M.to_layer:y===M.to_layer?M.from_layer:null;if(!B)throw Error(`PostProcessingSolver: trace "${d.connection_name}" has a discontinuous bound via`);let T=A.at(-1);Math.hypot(T.x-M.x,T.y-M.y)>0.00000001&&A.push({x:M.x,y:M.y,z:W0(y,t.layerCount),traceThickness:x}),A.push({x:M.x,y:M.y,z:W0(B,t.layerCount),traceThickness:x}),g.push({x:M.x,y:M.y,zLayers:Sq(M.from_layer,M.to_layer,t.layerCount).map((N)=>W0(N,t.layerCount))}),f.push({...M}),y=B}if(A.length<2)throw Error(`PostProcessingSolver: trace "${d.connection_name}" has no bound copper segments`);let C=Math.max(...A.map((M)=>M.traceThickness??p.width)),b=p.viaDiameter,I=r.length;r.push({connectionName:d.connection_name,traceThickness:C,viaDiameter:b,route:A,vias:g});let v=A[0],P=A.at(-1);i.push({name:d.connection_name,pointsToConnect:[{x:v.x,y:v.y,layer:m.layer,...p.startPortId?{pcb_port_id:p.startPortId}:{}},{x:P.x,y:P.y,layer:p.points.at(-1).layer,...p.endPortId?{pcb_port_id:p.endPortId}:{}}]}),s.push({traceIndex:h,matchedRouteIndex:I,viaTemplates:f,startEndpoint:{...v},endEndpoint:{...P},...p.startPortId?{startPortId:p.startPortId}:{},...p.endPortId?{endPortId:p.endPortId}:{}}),a.add(d.connection_name)}for(let h of o)if(!a.has(h))throw Error(`PostProcessingSolver: missing LengthMatchingSolver binding for rerouted connection "${h}"`);let c=e.result.traces.filter((h)=>!o.has(h.connection_name)),l=t.minTraceToPadEdgeClearance??Math.max(0,...r.filter((h)=>h.route.length>=2).map((h)=>h.traceThickness),...c.flatMap((h)=>Wle(h,t.layerCount).segments.map((d)=>d.width)));return{solverParams:{hdRoutes:r,traces:c,originalConnections:i,differentialPairs:n,obstacles:t.obstacles,bounds:t.bounds,layerCount:t.layerCount,obstacleMargin:l},traceBindings:s,baseTraces:structuredClone(e.result.traces)}},lUt=(e)=>{let t=new Map;for(let a of e.differentialPairs)for(let c of a.connectionNames){let l=e.hdRoutes.map((h,d)=>({route:h,hdRouteIndex:d})).filter(({route:h})=>h.connectionName===c);l.length===1&&t.set(l[0].hdRouteIndex,c)}let n=e.hdRoutes.map((a,c)=>{let l=[],h=new Map;for(let d=0;d<(a.jumpers?.length??0);d++){let u=a.jumpers[d],_=a.route.map((g,f)=>({point:g,index:f})).filter(({point:g})=>Math.hypot(g.x-u.start.x,g.y-u.start.y)<=0.00000001).map(({index:g})=>g),p=a.route.map((g,f)=>({point:g,index:f})).filter(({point:g})=>Math.hypot(g.x-u.end.x,g.y-u.end.y)<=0.00000001).map(({index:g})=>g),m=[..._.flatMap((g)=>p.filter((f)=>f>g).map((f)=>({startIndex:g,endIndex:f}))),...p.flatMap((g)=>_.filter((f)=>f>g).map((f)=>({startIndex:g,endIndex:f})))];if(m.length!==1)throw Error(`PostProcessingSolver: immutable HD route "${a.connectionName}" has an ambiguous jumper traversal`);let A=m[0];if(h.has(A.startIndex)||[...h.values()].some(({endIndex:g})=>A.startIndex<g||A.endIndex<=g))throw Error(`PostProcessingSolver: immutable HD route "${a.connectionName}" has overlapping or unordered jumpers`);h.set(A.startIndex,{endIndex:A.endIndex,jumperIndex:d})}if(a.route.length>0){let d=a.route[0];l.push({route_type:"wire",x:d.x,y:d.y,width:d.traceThickness??a.traceThickness,layer:i9(d.z,e.layerCount)});for(let m=0;m<a.route.length-1;m++){let A=a.route[m],g=h.get(m);if(g){let C=a.route[g.endIndex],b=a.jumpers[g.jumperIndex];if(A.z!==C.z)throw Error(`PostProcessingSolver: immutable HD route "${a.connectionName}" changes layers through a jumper`);l.push({route_type:"jumper",start:{x:A.x,y:A.y},end:{x:C.x,y:C.y},footprint:b.footprint,layer:i9(A.z,e.layerCount)}),l.push({route_type:"wire",x:C.x,y:C.y,width:C.traceThickness??a.traceThickness,layer:i9(C.z,e.layerCount)}),m=g.endIndex-1;continue}let f=a.route[m+1],y=i9(A.z,e.layerCount),x=i9(f.z,e.layerCount);A.z!==f.z&&(A.toNextSegmentType==="through_obstacle"?l.push({route_type:"through_obstacle",start:{x:A.x,y:A.y},end:{x:f.x,y:f.y},from_layer:y,to_layer:x,width:A.traceThickness??a.traceThickness}):l.push({route_type:"via",x:f.x,y:f.y,from_layer:y,to_layer:x,via_diameter:a.viaDiameter})),l.push({route_type:"wire",x:f.x,y:f.y,width:f.traceThickness??a.traceThickness,layer:x})}let u=l.filter((m)=>m.route_type==="wire"),_=a.startPcbPortId??a.route[0]?.pcb_port_id,p=a.endPcbPortId??a.route.at(-1)?.pcb_port_id;_&&u[0]&&(u[0].start_pcb_port_id=_),p&&u.at(-1)&&(u.at(-1).end_pcb_port_id=p)}return{type:"pcb_trace",pcb_trace_id:`post_processing_hd_route_${c}`,connection_name:a.connectionName,__postProcessingViaDiameter:a.viaDiameter,route:l}}),o=new Set(n.map((a)=>a.connection_name));for(let[a,c]of(e.traces??[]).entries()){let l=`post_processing_fixed_trace_${a}`;for(;o.has(l);)l+="_";o.add(l),n.push({...structuredClone(c),connection_name:l})}let r=structuredClone(e.obstacles),i=new Map,s=new Map;for(let a of r)for(let c of a.connectedTo){let l=i.get(c);l||(l=new Set,i.set(c,l)),l.add(a)}for(let a=0;a<e.hdRoutes.length;a++){let c=e.hdRoutes[a],l=new Set([c.connectionName,c.rootConnectionName,c.startPcbPortId,c.endPcbPortId,c.route[0]?.pcb_port_id,c.route.at(-1)?.pcb_port_id,t.get(a)].filter((d)=>d!==void 0)),h=new Set;for(let d of l){let u=i.get(d);if(u)for(let _ of u)h.add(_)}for(let d of h){let u=s.get(d);u||(u=new Set(d.connectedTo),s.set(d,u),d.connectedTo=[...u]);for(let _ of l){if(u.has(_))continue;u.add(_),d.connectedTo.push(_);let p=i.get(_);p||(p=new Set,i.set(_,p)),p.add(d)}}}return{params:{simpleRouteJson:{traces:n,differentialPairs:structuredClone(e.differentialPairs),obstacles:r,bounds:structuredClone(e.bounds),layerCount:e.layerCount,minTraceToPadEdgeClearance:e.minTraceToPadEdgeClearance},...e.routingGrid?{routingGrid:structuredClone(e.routingGrid)}:{}},routeBindings:[...t.entries()].map(([a,c])=>({hdRouteIndex:a,traceIndex:a,internalConnectionName:c})),sourceHdRoutes:structuredClone(e.hdRoutes)}};function Kcn(e){let t=structuredClone(e.model.sourceHdRoutes);for(let n of e.model.routeBindings){let o=e.binding.traceBindings.find((c)=>c.traceIndex===n.traceIndex);if(!o)continue;let r=e.result.matchedHdRoutes[o.matchedRouteIndex],i=t[n.hdRouteIndex];if(!r||!i)throw Error(`PostProcessingSolver: missing matched or source HD route for "${n.internalConnectionName}"`);if(r.connectionName!==n.internalConnectionName)throw Error(`PostProcessingSolver: matched HD binding changed "${n.internalConnectionName}" to "${r.connectionName}"`);let s=r.route.map((c)=>({...c})),a=(c,l)=>{if(c&&l&&(l.pcb_port_id&&(c.pcb_port_id=l.pcb_port_id),l.insideJumperPad&&e.rejectInsideJumperPad))throw Error(`PostProcessingSolver: cannot restore jumper-pad metadata on rerouted connection "${n.internalConnectionName}"`)};a(s[0],i.route[0]),a(s.at(-1),i.route.at(-1)),t[n.hdRouteIndex]={...i,route:s,vias:structuredClone(r.vias)}}return{hdRoutes:t,postProcessingErrors:[]}}var qR=class extends Error{connectionNames;reason;constructor(e){super(`PostProcessingSolver: differential pair ${e.connectionNames.join("/")} ${e.message}`),this.name="DifferentialPairRoutingError",this.connectionNames=[e.connectionNames[0],e.connectionNames[1]],this.reason=e.reason}},qKe=class extends Error{connectionNames;reason;constructor(e){super(e.message),this.name="PostProcessingConstraintError",this.connectionNames=[...e.connectionNames],this.reason=e.reason}},$cn=class extends Error{reason="grid-capacity-exhausted";constructor(e){super(e),this.name="PostProcessingGridCapacityError"}},qcn=(e)=>{let t=75000*e.simpleRouteJson.differentialPairs.length;if(!Number.isSafeInteger(t))throw Error("PostProcessingSolver: derived rerouting iteration bound exceeds the safe integer range");let n=Math.min(t,80000);return Math.max(1,n)},pbe=(e)=>structuredClone(e),Jcn=(e,t,n)=>{let o=(l)=>{let h=-(t.ccwRotationDegrees??0)*Math.PI/180,d=l.x-t.center.x,u=l.y-t.center.y;return{x:d*Math.cos(h)-u*Math.sin(h),y:d*Math.sin(h)+u*Math.cos(h)}},r=o(e.start),i=o(e.end),s=t.width/2+n,a=t.height/2+n;if(Math.abs(r.x)<=s&&Math.abs(r.y)<=a||Math.abs(i.x)<=s&&Math.abs(i.y)<=a)return!0;let c=[{x:-s,y:-a},{x:s,y:-a},{x:s,y:a},{x:-s,y:a}];return c.some((l,h)=>fb(r,i,l,c[(h+1)%c.length])<=0.0000001)},a6r=(e)=>{let t=[],n=[];for(let d of e.immutableTraces){let u=Wle(d,e.layerCount);t.push(...u.segments),n.push(...u.vias)}let o=Array.from({length:e.layerCount},()=>[]);for(let d of t){let u=W0(d.layer,e.layerCount);o[u].push(d)}let r=(d,u)=>Math.hypot(d.x-u.x,d.y-u.y)<=0.00000001,i=(d,u,_)=>{let p=_.x-u.x,m=_.y-u.y,A=p*p+m*m,g=A===0?0:Math.max(0,Math.min(1,((d.x-u.x)*p+(d.y-u.y)*m)/A));return Math.hypot(d.x-u.x-p*g,d.y-u.y-m*g)},s=(d,u,_)=>{let p=-(u.ccwRotationDegrees??0)*Math.PI/180,m=d.x-u.center.x,A=d.y-u.center.y,g=m*Math.cos(p)-A*Math.sin(p),f=m*Math.sin(p)+A*Math.cos(p);return Math.abs(g)<=u.width/2+_&&Math.abs(f)<=u.height/2+_},a=(d,u)=>{let _=W0(u,e.layerCount);return Oq(d,e.layerCount).includes(_)},c=(d,u,_)=>{let p=((A,g,f)=>{let y=Math.hypot(g.x,g.y);if(y<=0.0000000001)throw Error("PostProcessingSolver: cannot orient terminal fanout on a zero-length spine");let x=-g.y/y*e.side*e.centerlineSpacing/2,C=g.x/y*e.side*e.centerlineSpacing/2,b=f==="start"?[e.firstStartTerminal,e.secondStartTerminal]:[e.firstEndTerminal,e.secondEndTerminal],I=[e.firstWidth,e.secondWidth],v=[e.firstConnectionName,e.secondConnectionName];return b.map((P,M)=>{let B=M===0?1:-1,T={x:A.x+x*B,y:A.y+C*B};return{start:f==="start"?P:T,end:f==="start"?T:P,layer:A.layer,width:I[M],connectionName:v[M],terminal:f}})})(d,u,_),m=p.map((A)=>_==="start"?A.end:A.start);return p.every(l)&&m.every((A,g)=>e.obstacles.every((f)=>!a(f,d.layer)||!s(A,f,1.5*p[g].width+(e.terminalMiterMargin??0))))&&fb(p[0].start,p[0].end,p[1].start,p[1].end)>=p[0].width/2+p[1].width/2-0.0000001},l=(d)=>{let u=d.width/2,_=u+(e.minTraceToPadEdgeClearance??d.width),p=W0(d.layer,e.layerCount),m=Math.min(d.start.x,d.end.x),A=Math.max(d.start.x,d.end.x),g=Math.min(d.start.y,d.end.y),f=Math.max(d.start.y,d.end.y);for(let y of[d.start,d.end])if(y.x-u<e.bounds.minX||y.x+u>e.bounds.maxX||y.y-u<e.bounds.minY||y.y+u>e.bounds.maxY)return!1;for(let y of e.obstacles){if(!a(y,d.layer))continue;let x=Math.hypot(y.width/2+_,y.height/2+_);if(A<y.center.x-x||m>y.center.x+x||f<y.center.y-x||g>y.center.y+x)continue;let[C,b]=d.connectionName===e.firstConnectionName?[e.firstStartTerminal,e.firstEndTerminal]:[e.secondStartTerminal,e.secondEndTerminal],I=s(C,y,0)&&(s(d.start,y,_)||s(d.end,y,_))&&Math.hypot(d.end.x-C.x,d.end.y-C.y)>=Math.hypot(d.start.x-C.x,d.start.y-C.y),v=s(b,y,0)&&(s(d.start,y,_)||s(d.end,y,_))&&Math.hypot(d.end.x-b.x,d.end.y-b.y)<=Math.hypot(d.start.x-b.x,d.start.y-b.y);if(!(y.connectedTo.includes(d.connectionName)&&(I||v))&&Jcn(d,y,_))return!1}for(let y of o[p]){let x=d.width/2+y.width/2+Math.max(d.width,y.width);if(!(A+x<Math.min(y.start.x,y.end.x)||m-x>Math.max(y.start.x,y.end.x)||f+x<Math.min(y.start.y,y.end.y)||g-x>Math.max(y.start.y,y.end.y))&&fb(d.start,d.end,y.start,y.end)<x)return!1}for(let y of n)if(y.layers.includes(d.layer)&&i(y,d.start,d.end)<d.width/2+y.diameter/2+d.width)return!1;return!0},h=(d)=>{let u=d.diameter/2;if(d.x-u<e.bounds.minX||d.x+u>e.bounds.maxX||d.y-u<e.bounds.minY||d.y+u>e.bounds.maxY)return!1;for(let _ of e.obstacles){if(!d.layers.some((p)=>a(_,p)))continue;if(!(d.terminal!==null&&_.connectedTo.includes(d.connectionName)&&s(d,_,0))&&s(d,_,u+d.diameter))return!1}for(let _ of t){if(!d.layers.includes(_.layer))continue;let p=u+_.width/2+Math.max(d.diameter,_.width);if(i(d,_.start,_.end)<p)return!1}for(let _ of n){if(!_.layers.some((m)=>d.layers.includes(m)))continue;let p=u+_.diameter/2+Math.max(d.diameter,_.diameter);if(Math.hypot(d.x-_.x,d.y-_.y)<p)return!1}return!0};return{isEdgeValid:(d,u)=>{if(d.layer!==u.layer||!((p,m)=>{let A=Math.hypot(m.x-p.x,m.y-p.y);if(A===0)return[];let g=-(m.y-p.y)/A*e.side*e.centerlineSpacing/2,f=(m.x-p.x)/A*e.side*e.centerlineSpacing/2,y=r(p,e.start),x=r(m,e.end),C=e.terminalFanout?y&&x?"both":y?"start":x?"end":null:null,b=y&&e.terminalFanout?e.firstStartTerminal:{x:p.x+g,y:p.y+f},I=x&&e.terminalFanout?e.firstEndTerminal:{x:m.x+g,y:m.y+f},v=y&&e.terminalFanout?e.secondStartTerminal:{x:p.x-g,y:p.y-f},P=x&&e.terminalFanout?e.secondEndTerminal:{x:m.x-g,y:m.y-f};return[{start:b,end:I,layer:p.layer,width:e.firstWidth,connectionName:e.firstConnectionName,terminal:C},{start:v,end:P,layer:p.layer,width:e.secondWidth,connectionName:e.secondConnectionName,terminal:C}]})(d,u).every(l))return!1;if(e.terminalFanout||e.terminalMiterMargin===void 0)return!0;let _={x:u.x-d.x,y:u.y-d.y};return!(r(d,e.start)&&!c(d,_,"start"))&&!(r(u,e.end)&&!c(u,_,"end"))},isTerminalFanoutValid:c,isViaValid:(d,u,_)=>{let p=Math.hypot(_.x,_.y);if(p<=0.0000000001)throw Error("PostProcessingSolver: cannot orient a coupled via on a zero-length spine");let m=Sq(d.layer,u,e.layerCount),A=-_.y/p*e.side*e.centerlineSpacing/2,g=_.x/p*e.side*e.centerlineSpacing/2,f=r(d,e.start)?"start":r(d,e.end)?"end":null;return[{x:d.x+A,y:d.y+g,layers:m,diameter:e.firstViaDiameter,connectionName:e.firstConnectionName,terminal:f},{x:d.x-A,y:d.y-g,layers:m,diameter:e.secondViaDiameter,connectionName:e.secondConnectionName,terminal:f}].every(h)}}},mbe=(e,t,n)=>{let r=(d,u)=>{let _=-(u.ccwRotationDegrees??0)*Math.PI/180,p=d.x-u.center.x,m=d.y-u.center.y;return{x:p*Math.cos(_)-m*Math.sin(_),y:p*Math.sin(_)+m*Math.cos(_)}},i=(d,u,_)=>{let p=_.x-u.x,m=_.y-u.y,A=p*p+m*m,g=A===0?0:Math.max(0,Math.min(1,((d.x-u.x)*p+(d.y-u.y)*m)/A));return Math.hypot(d.x-(u.x+g*p),d.y-(u.y+g*m))},s=(d,u,_)=>{let p=W0(u,_);return Oq(d,_).includes(p)},a=(d,u,_)=>{let p=d.width/2;if(d.start.x-p<u.bounds.minX-0.0000001||d.start.x+p>u.bounds.maxX+0.0000001||d.start.y-p<u.bounds.minY-0.0000001||d.start.y+p>u.bounds.maxY+0.0000001||d.end.x-p<u.bounds.minX-0.0000001||d.end.x+p>u.bounds.maxX+0.0000001||d.end.y-p<u.bounds.minY-0.0000001||d.end.y+p>u.bounds.maxY+0.0000001)return!1;for(let m of u.obstacles){if(!s(m,d.layer,u.layerCount))continue;let A=d.terminal==="both"?[d.start,d.end]:d.terminal==="start"?[d.start]:d.terminal==="end"?[d.end]:[];if(!(m.connectedTo.includes(d.connectionName)&&A.some((g)=>{let f=r(g,m);return Math.abs(f.x)<=m.width/2+0.0000001&&Math.abs(f.y)<=m.height/2+0.0000001}))&&Jcn(d,m,p+(u.minTraceToPadEdgeClearance??d.width)))return!1}for(let m of _.segments){if(m.layer!==d.layer)continue;let A=d.width/2+m.width/2+Math.max(d.width,m.width);if(fb(d.start,d.end,m.start,m.end)<A-0.0000001)return!1}for(let m of _.vias){if(!m.layers.includes(d.layer))continue;let A=d.width/2+m.diameter/2+d.width;if(i(m,d.start,d.end)<A-0.0000001)return!1}return!0},c=(d,u,_)=>{let p=d.diameter/2;if(d.x-p<u.bounds.minX-0.0000001||d.x+p>u.bounds.maxX+0.0000001||d.y-p<u.bounds.minY-0.0000001||d.y+p>u.bounds.maxY+0.0000001)return!1;for(let m of u.obstacles){if(!d.layers.some((g)=>s(m,g,u.layerCount)))continue;let A=r(d,m);if(!(d.terminal!==null&&m.connectedTo.includes(d.connectionName)&&Math.abs(A.x)<=m.width/2+0.0000001&&Math.abs(A.y)<=m.height/2+0.0000001)&&Math.abs(A.x)<=m.width/2+p+d.diameter&&Math.abs(A.y)<=m.height/2+p+d.diameter)return!1}for(let m of _.segments){if(!d.layers.includes(m.layer))continue;let A=p+m.width/2+Math.max(d.diameter,m.width);if(i(d,m.start,m.end)<A-0.0000001)return!1}for(let m of _.vias){if(!m.layers.some((g)=>d.layers.includes(g)))continue;let A=p+m.diameter/2+Math.max(d.diameter,m.diameter);if(Math.hypot(d.x-m.x,d.y-m.y)<A-0.0000001)return!1}return!0},l=(d)=>{for(let u=0;u<d.segments.length;u++){let _=d.segments[u];for(let p=u+2;p<d.segments.length;p++){let m=d.segments[p];if(_.layer!==m.layer)continue;if(!(d.segments.slice(u+1,p).reduce((A,g)=>A+Math.hypot(g.end.x-g.start.x,g.end.y-g.start.y),0)<=_.width+m.width+0.0000001)&&fb(_.start,_.end,m.start,m.end)<_.width/2+m.width/2-0.0000001)return!0}}for(let u of d.vias)for(let _ of d.segments){if(!u.layers.includes(_.layer))continue;if(!(Math.hypot(u.x-_.start.x,u.y-_.start.y)<=0.0000001||Math.hypot(u.x-_.end.x,u.y-_.end.y)<=0.0000001)&&i(u,_.start,_.end)<u.diameter/2+_.width/2-0.0000001)return!0}return!1},h=((d,u)=>{let _=[],p=[];for(let m of d){let A=Wle(m,u);_.push(...A.segments),p.push(...A.vias)}return{segments:_,vias:p}})(n.immutableTraces,n.layerCount);if(!((d,u)=>{for(let _ of d.segments)for(let p of u.segments){if(_.layer!==p.layer)continue;let m=_.width/2+p.width/2;if(fb(_.start,_.end,p.start,p.end)<m-0.0000001)return!1}for(let[_,p]of[[d.vias,u.segments],[u.vias,d.segments]])for(let m of _)for(let A of p)if(m.layers.includes(A.layer)&&i(m,A.start,A.end)<m.diameter/2+A.width/2-0.0000001)return!1;for(let _ of d.vias)for(let p of u.vias)if(_.layers.some((m)=>p.layers.includes(m))&&Math.hypot(_.x-p.x,_.y-p.y)<_.diameter/2+p.diameter/2-0.0000001)return!1;return!0})(e,t)||l(e)||l(t))return!1;for(let d of[e,t])if(d.segments.some((u)=>!a(u,n,h))||d.vias.some((u)=>!c(u,n,h)))return!1;return!0},hUt=[{x:1,y:0},{x:1,y:1},{x:0,y:1},{x:-1,y:1},{x:-1,y:0},{x:-1,y:-1},{x:0,y:-1},{x:1,y:-1}],c6r=class{constructor(e){this.input=e;let{bounds:t,grid:n}=e,o={minX:t.minX+n.outerPerimeterWidth,maxX:t.maxX-n.outerPerimeterWidth,minY:t.minY+n.outerPerimeterWidth,maxY:t.maxY-n.outerPerimeterWidth},r=this.createAxis(t.minX,t.maxX,n.outerGridStep,[o.minX,o.maxX]),i=this.createAxis(t.minY,t.maxY,n.outerGridStep,[o.minY,o.maxY]),s=this.createAxis(o.minX,o.maxX,n.innerGridStep,[],e.start.x),a=this.createAxis(o.minY,o.maxY,n.innerGridStep,[],e.start.y),c=this.createGrid(r,i,(d)=>d.x<=o.minX||d.x>=o.maxX||d.y<=o.minY||d.y>=o.maxY),l=this.createGrid(s,a,()=>!0);this.connectLocalNeighbors(c),this.connectLocalNeighbors(l);for(let d of["left","right","bottom","top"])this.connectBoundaries(d,c,l,o);let h=this.nodes.map((d,u)=>u);this.connectEndpoint(e.start,h),this.connectEndpoint(e.end,h)}input;nodes=[];nodeIdByPoint=new Map;endpointNodeIdByPoint=new Map;getPlanarNeighbors(e){let t=this.endpointNodeIdByPoint.get(this.exactKeyFor(e))??this.nodeIdByPoint.get(this.keyFor(e));if(t===void 0)throw Error(`PostProcessingSolver: coupled path point (${e.x}, ${e.y}) is not on the composite grid`);return[...this.nodes[t].neighborIds].map((n)=>({...this.nodes[n].point,layer:e.layer}))}getNodeCount(){return this.nodes.length}getSearchStateCountUpperBound(e){let t=this.nodes.reduce((n,o)=>n+o.neighborIds.size,0)*e+1;if(!Number.isSafeInteger(t))throw Error("PostProcessingSolver: composite-grid search-state bound exceeds the safe integer range");return t}createAxis(e,t,n,o,r=e){let i=[e,t,...o].map((a)=>({value:a,fixed:!0}));for(let a=Math.ceil((e-r)/n);r+a*n<t-0.00000001;a++)i.push({value:r+a*n,fixed:!1});i.sort((a,c)=>a.value-c.value||Number(c.fixed)-Number(a.fixed));let s=[];for(let a of i){let c=s.at(-1);!c||Math.abs(a.value-c.value)>0.00000001?s.push(a):a.fixed&&!c.fixed&&(s[s.length-1]=a)}return s.map((a)=>a.value)}createGrid(e,t,n){return t.map((o)=>e.map((r)=>{let i={x:r,y:o};return n(i)?this.addNode(i):null}))}connectLocalNeighbors(e){for(let t=0;t<e.length;t++)for(let n=0;n<(e[t]?.length??0);n++){let o=e[t][n];if(o!==null)for(let r of hUt){let i=e[t+r.y]?.[n+r.x];i!=null&&this.connect(o,i)}}}connectBoundaries(e,t,n,o){let r=e==="left"?o.minX:e==="right"?o.maxX:e==="bottom"?o.minY:o.maxY,i=e==="left"||e==="right",s=(h)=>Math.abs((i?h.x:h.y)-r)<=0.00000001,a=(h)=>{let d=new Set;for(let u of h)for(let _ of u)_!==null&&s(this.nodes[_].point)&&d.add(_);return[...d].sort((u,_)=>{let p=this.nodes[u].point,m=this.nodes[_].point;return(i?p.y-m.y:p.x-m.x)||u-_})},c=a(t),l=a(n);if(c.length===0||l.length===0)throw Error(`PostProcessingSolver: composite grid has no ${e} boundary bridge candidates`);for(let h of c)this.connect(h,this.findNearestAlongBoundary(h,l,i));for(let h of l)this.connect(h,this.findNearestAlongBoundary(h,c,i))}findNearestAlongBoundary(e,t,n){let o=this.nodes[e].point,r=t[0],i=Number.POSITIVE_INFINITY;for(let s of t){let a=this.nodes[s].point,c=Math.abs(n?o.y-a.y:o.x-a.x);(c<i-0.00000001||Math.abs(c-i)<=0.00000001&&s<r)&&(i=c,r=s)}return r}connectEndpoint(e,t){let n=this.nodeIdByPoint.get(this.keyFor(e)),o=n===void 0?null:this.nodes[n].point,r=o?.x===e.x&&o.y===e.y?n:this.nodes.push({point:{x:e.x,y:e.y},neighborIds:new Set})-1;this.endpointNodeIdByPoint.set(this.exactKeyFor(e),r);let i=(s,a)=>{let c=this.nodes[s].point,l=t.filter((h)=>h!==s).map((h)=>({nodeId:h,distance:Math.hypot(this.nodes[h].point.x-c.x,this.nodes[h].point.y-c.y)})).filter(({distance:h})=>h>0.0000000001).sort((h,d)=>h.distance-d.distance||h.nodeId-d.nodeId).slice(0,a);if(l.length===0)throw Error("PostProcessingSolver: composite grid has no endpoint connection candidates");for(let{nodeId:h}of l)this.connect(s,h)};i(r,8);for(let s of hUt){let a={x:e.x+s.x*this.input.grid.innerGridStep,y:e.y+s.y*this.input.grid.innerGridStep};if(a.x<this.input.bounds.minX||a.x>this.input.bounds.maxX||a.y<this.input.bounds.minY||a.y>this.input.bounds.maxY)continue;let c=this.addNode(a);this.connect(r,c),i(c,4)}}addNode(e){let t=this.keyFor(e),n=this.nodeIdByPoint.get(t);if(n!==void 0)return n;let o=this.nodes.length;return this.nodes.push({point:{x:e.x,y:e.y},neighborIds:new Set}),this.nodeIdByPoint.set(t,o),o}connect(e,t){if(e===t)return;let n=this.nodes[e],o=this.nodes[t];n.neighborIds.add(t),o.neighborIds.add(e)}keyFor(e){let t=Object.is(e.x,-0)?0:e.x,n=Object.is(e.y,-0)?0:e.y;return`${t.toFixed(12)}:${n.toFixed(12)}`}exactKeyFor(e){return`${Object.is(e.x,-0)?0:e.x}:${Object.is(e.y,-0)?0:e.y}`}},l6r=class{constructor(e){if(this.input=e,this.startLayer=W0(e.start.layer,e.layerCount),this.endLayer=W0(e.end.layer,e.layerCount),this.grid=new c6r(e),this.maxSearchStates=this.grid.getSearchStateCountUpperBound(e.layerCount),this.exploredStateLimit=Math.min(this.maxSearchStates,20000),this.startLayer<0||this.endLayer<0)return this.queue=[],void(this.status="exhausted");let t={point:e.start,direction:null,cost:0,estimate:this.estimate(e.start),parent:null,sequence:0};this.queue=[t],this.bestCosts.set(this.keyFor(e.start,null),0)}input;queue;bestCosts=new Map;startLayer;endLayer;grid;maxSearchStates;exploredStateLimit;current=null;result=null;status="searching";explored=0;nextSequence=1;isComplete(){return this.status!=="searching"}getPath(){return this.result}getPreviewPath(){return this.current?this.createPath(this.current):[this.input.start]}getExploredCount(){return this.explored}getProgress(){return this.status!=="searching"?1:Math.min(0.99,this.explored/this.exploredStateLimit)}getGridNodeCount(){return this.grid.getNodeCount()}step(){if(this.status!=="searching")return;let e=this.popQueue();if(!e)return void(this.status="exhausted");let t=this.bestCosts.get(this.keyFor(e.point,e.direction));if(t===void 0)throw Error("PostProcessingSolver: coupled path queue contains an untracked state");if(e.cost>t+0.0000000001)this.queue.length===0&&(this.status="exhausted");else{if(this.current=e,this.explored++,this.explored>this.maxSearchStates)throw Error(`PostProcessingSolver: coupled path search exceeded its ${this.maxSearchStates}-state graph invariant limit`);if(this.isEnd(e.point)){let n=this.createPath(e);return n[n.length-1]=this.input.end,this.result=this.simplifyPath(n),void(this.status="found")}this.explored>=this.exploredStateLimit?this.status="exhausted":(this.enqueuePlanarNeighbors(e),this.enqueueViaNeighbors(e),this.queue.length===0&&(this.status="exhausted"))}}isEnd(e){return e.layer===this.input.end.layer&&e.x===this.input.end.x&&e.y===this.input.end.y}estimate(e){return Math.hypot(e.x-this.input.end.x,e.y-this.input.end.y)+3*Math.abs(W0(e.layer,this.input.layerCount)-this.endLayer)}keyFor(e,t){return`${Object.is(e.x,-0)?0:e.x}:${Object.is(e.y,-0)?0:e.y}:${e.layer}:${t?.key??"start"}`}createDirection(e,t){let n=t.x-e.x,o=t.y-e.y,r=Math.hypot(n,o);if(r<=0.0000000001)throw Error("PostProcessingSolver: composite grid produced a zero-length planar edge");let i=n/r,s=o/r;return{x:i,y:s,key:`${i.toFixed(6)}:${s.toFixed(6)}`}}createPath(e){let t=[],n=e;for(;n;)t.push(n.point),n=n.parent;return t.reverse()}simplifyPath(e){return e.filter((t,n)=>{if(n===0||n===e.length-1)return!0;let o=e[n-1],r=e[n+1],i={x:t.x-o.x,y:t.y-o.y},s={x:r.x-t.x,y:r.y-t.y},a=i.x*s.y-i.y*s.x,c=Math.hypot(i.x,i.y)*Math.hypot(s.x,s.y);return Math.abs(a)>0.0000000001*c||t.layer!==o.layer||t.layer!==r.layer})}hasHigherQueuePriority(e,t){return e.estimate!==t.estimate?e.estimate<t.estimate:e.cost!==t.cost?e.cost<t.cost:e.point.x!==t.point.x?e.point.x<t.point.x:e.point.y!==t.point.y?e.point.y<t.point.y:e.point.layer!==t.point.layer?e.point.layer<t.point.layer:e.sequence<t.sequence}pushQueue(e){this.queue.push(e);let t=this.queue.length-1;for(;t>0;){let n=Math.floor((t-1)/2),o=this.queue[n];if(!this.hasHigherQueuePriority(e,o))break;this.queue[t]=o,t=n}this.queue[t]=e}popQueue(){let e=this.queue[0],t=this.queue.pop();if(!e||!t||this.queue.length===0)return e;let n=0;for(;;){let o=2*n+1;if(o>=this.queue.length)break;let r=o+1,i=o;r<this.queue.length&&this.hasHigherQueuePriority(this.queue[r],this.queue[o])&&(i=r);let s=this.queue[i];if(!this.hasHigherQueuePriority(s,t))break;this.queue[n]=s,n=i}return this.queue[n]=t,e}enqueuePlanarNeighbors(e){for(let t of this.grid.getPlanarNeighbors(e.point)){if(!this.input.isEdgeValid(e.point,t))continue;let n=this.createDirection(e.point,t),o=e.direction===null||e.direction.key===n.key?0:0.18,r=e.cost+Math.hypot(t.x-e.point.x,t.y-e.point.y)+o,i=this.keyFor(t,n);(this.bestCosts.get(i)??Number.POSITIVE_INFINITY)<=r||(this.bestCosts.set(i,r),this.pushQueue({point:t,direction:n,cost:r,estimate:r+this.estimate(t),parent:e,sequence:this.nextSequence++}))}}enqueueViaNeighbors(e){if(!e.direction)return;let t=W0(e.point.layer,this.input.layerCount);for(let n of[t-1,t+1]){if(n<0||n>=this.input.layerCount)continue;let o=i9(n,this.input.layerCount);if(!this.input.isViaValid(e.point,o,e.direction))continue;let r={...e.point,layer:o},i=e.cost+4,s=this.keyFor(r,e.direction);(this.bestCosts.get(s)??Number.POSITIVE_INFINITY)<=i||(this.bestCosts.set(s,i),this.pushQueue({point:r,direction:e.direction,cost:i,estimate:i+this.estimate(r),parent:e,sequence:this.nextSequence++}))}}},Zcn=(e)=>{let t=Math.min(e.bounds.maxX-e.bounds.minX,e.bounds.maxY-e.bounds.minY),n=e.config?.innerGridStep??e.defaultInnerGridStep,o=e.config?.outerGridStep??4*n,r=e.config?.outerPerimeterWidth??Math.min(o,t/4);if(!Number.isFinite(n)||n<0.0001)throw Error("PostProcessingSolver: routingGrid.innerGridStep must be finite and at least 0.0001");if(!Number.isFinite(o)||o<=n)throw Error("PostProcessingSolver: routingGrid.outerGridStep must be finite and greater than innerGridStep");if(!Number.isFinite(r)||r<=0||2*r>=t)throw Error("PostProcessingSolver: routingGrid.outerPerimeterWidth must be finite, positive, and less than half the smaller board extent");let i=e.bounds.maxX-e.bounds.minX,s=e.bounds.maxY-e.bounds.minY;if((Math.ceil(i/o)+4)*(Math.ceil(s/o)+4)+(Math.ceil((i-2*r)/n)+2)*(Math.ceil((s-2*r)/n)+2)+18>250000)throw new $cn("PostProcessingSolver: valid input exceeds the 250000-node optimization grid capacity");return{innerGridStep:n,outerGridStep:o,outerPerimeterWidth:r}},dUt=(e)=>{let t=-e.pathDirection.y,n=e.pathDirection.x,o=Math.tan(e.maximumTurnDegrees*Math.PI/180),r=Math.max(0,...e.lanes.map(({point:c,polarity:l})=>{let h=c.x-e.anchor.x,d=c.y-e.anchor.y,u=h*e.escapeDirection.x+d*e.escapeDirection.y,_=h*t+d*n,p=l*e.side*e.centerlineSpacing/2;return u+Math.abs(_-p)/o})),i=e.maxUncoupledLength??r;if(r>i+0.00000001)return null;let s=Math.max(0.05,Math.min(0.25,e.searchStep/2)),a=Math.max(1,Math.ceil((i-r)/s)+1);for(let c=0;c<a;c++){let l=Math.min(i,r+c*s),h={x:e.anchor.x+e.escapeDirection.x*l,y:e.anchor.y+e.escapeDirection.y*l,layer:e.anchor.layer};if(e.lanes.every(({point:d,polarity:u})=>{let _=u*e.side*e.centerlineSpacing/2,p=h.x+t*_,m=h.y+n*_;return e.maxUncoupledLength===void 0||Math.hypot(p-d.x,m-d.y)<=e.maxUncoupledLength+0.00000001})&&e.isValid(h))return h}return null},h6r=[0.75,0.5,1,0.25,1.25],Y3e=100,d6r=class{constructor(e){this.input=e,this.pairName=e.pair.connectionNames.join("/"),this.prepared=this.prepare()}input;pairName;prepared;candidates=[];result=null;search=null;nextAttempt=0;exploredNodeCount=0;isComplete(){return this.result!==null}getResult(){if(!this.result)throw Error(`PostProcessingSolver: differential pair ${this.pairName} is not complete`);return this.result}getPreviewPath(){return this.search?.getPreviewPath()??null}getProgress(){if(this.result)return 1;let e=this.prepared.attempts.length,t=this.search?.getProgress()??0;return Math.min(0.99,(this.nextAttempt+t)/e)}getStats(){return{phase:this.search?"searching":"candidate-selection",pair:this.pairName,attemptIndex:this.nextAttempt,attemptCount:this.prepared.attempts.length,exploredNodeCount:this.exploredNodeCount+(this.search?.getExploredCount()??0),gridNodeCount:this.search?.getGridNodeCount()??0,acceptedCandidateCount:this.candidates.length}}step(){if(this.result)return;let e=this.prepared;if(!this.search){let r=e.attempts[this.nextAttempt];return r?void(this.search=new l6r(r.input)):void this.complete()}if(this.search.step(),!this.search.isComplete())return;let t=this.search.getPath();this.exploredNodeCount+=this.search.getExploredCount();let n=e.attempts[this.nextAttempt];if(!n)throw Error(`PostProcessingSolver: differential pair ${this.pairName} lost its active attempt`);if(this.search=null,this.nextAttempt++,!t)return;let o=((r)=>{let i=(P,M)=>Math.hypot(P.x-M.x,P.y-M.y)<=0.00000001;if(r.path.length<2)throw Error("PostProcessingSolver: coupled path has fewer than two stations");let s=(P,M)=>{for(let B=P+M;B>=0&&B<r.path.length;B+=M){let T=r.path[B];if(!i(T,r.path[P]))return T}return null},a=(P)=>{let M=r.path[P],B=s(P,-1),T=s(P,1),N=(X,K)=>{let J=K.x-X.x,ee=K.y-X.y,se=Math.hypot(J,ee);if(se<=0.0000000001)throw Error("PostProcessingSolver: cannot offset a zero-length spine");return{x:-ee/se,y:J/se}},D=r.side*r.centerlineSpacing/2;if(!B||!T){let X=N(B??M,T??M);return{x:X.x*D,y:X.y*D}}if(r.terminalFanout&&P===1)return N(B,M);if(r.terminalFanout&&P===r.path.length-2)return N(M,T);if(r.terminalFanout&&r.path[P+1]?.layer!==M.layer)return N(B,M);let L=N(B,M),H=N(M,T),V={x:L.x+H.x,y:L.y+H.y},O=Math.hypot(V.x,V.y);if(O<=0.0000000001)return null;let U=V.x/O,j=V.y/O,Y=D/(U*L.x+j*L.y);return{x:U*Y,y:j*Y}},c=r.first.points[0],l=r.first.points.at(-1),h=r.reverseSecond?r.second.points.at(-1):r.second.points[0],d=r.reverseSecond?r.second.points[0]:r.second.points.at(-1),u=[[{route_type:"wire",x:c.x,y:c.y,width:c.width,layer:c.layer}],[{route_type:"wire",x:h.x,y:h.y,width:h.width,layer:h.layer}]],_=[r.first.transitions[0],r.second.transitions[0]],p=0,m=r.terminalFanout?1:0,A=r.path.length-2,g=r.path[A],f=r.path[A-1],y=r.terminalFanout&&g?.layer===l.layer&&f?.layer===g.layer,x=r.terminalFanout?y?A-1:r.path.length-1:r.path.length;for(let P=m;P<x;P++){let M=r.path[P],B=a(P);if(!B)return null;for(let T of[0,1]){let N=T===0?1:-1,D={x:M.x+B.x*N,y:M.y+B.y*N},L=u[T],H=r.path[P-1];if(H&&H.layer!==M.layer){if(!i(H,M))throw Error("PostProcessingSolver: a coupled layer transition moved in the plane");let V=[...L].reverse().find((U)=>U.route_type==="wire");if(!V)throw Error("PostProcessingSolver: generated via has no preceding wire");let O=_[T];L.push({route_type:"via",x:V.x,y:V.y,from_layer:H.layer,to_layer:M.layer,via_diameter:O?.via_diameter??(T===0?r.first.viaDiameter:r.second.viaDiameter),...O?.via_hole_diameter!==void 0?{via_hole_diameter:O.via_hole_diameter}:{}}),L.push({route_type:"wire",x:V.x,y:V.y,width:T===0?r.first.width:r.second.width,layer:M.layer})}else{let V=L.at(-1);V?.route_type==="wire"&&i(V,D)&&V.layer===M.layer||L.push({route_type:"wire",...D,width:T===0?r.first.width:r.second.width,layer:M.layer})}}r.path[P-1]?.layer!==M.layer&&P>0&&p++}let C=(P,M)=>{let B=P.at(-1);if(!B||B.route_type!=="wire")throw Error("PostProcessingSolver: terminal fanout has no preceding wire");let T=P.at(-2),N=!1;if(T?.route_type==="wire"&&T.layer===B.layer&&B.layer===M.layer){let D={x:B.x-T.x,y:B.y-T.y},L={x:M.x-B.x,y:M.y-B.y},H=Math.hypot(D.x,D.y),V=Math.hypot(L.x,L.y);if(H>0.00000001&&V>0.00000001&&Math.abs(D.x*L.x+D.y*L.y)<=0.00000001){let O={x:B.x-D.x/H*V,y:B.y-D.y/H*V};(O.x-T.x)*(D.x/H)+(O.y-T.y)*(D.y/H)>0.00000001&&(B.x=O.x,B.y=O.y,N=!0)}}r.terminalFanout&&!N&&B.x!==M.x&&B.y!==M.y&&P.push({route_type:"wire",x:M.x,y:B.y,width:M.width,layer:M.layer}),P.push({route_type:"wire",x:M.x,y:M.y,width:M.width,layer:M.layer})};C(u[0],l),C(u[1],d),r.reverseSecond&&(u[1]=u[1].reverse().map((P)=>P.route_type==="via"?{...P,from_layer:P.to_layer,to_layer:P.from_layer}:P));let b=(P,M)=>{let B=P.filter((T)=>T.route_type==="wire");for(let T of B)delete T.start_pcb_port_id,delete T.end_pcb_port_id;M.startPortId&&(B[0].start_pcb_port_id=M.startPortId),M.endPortId&&(B.at(-1).end_pcb_port_id=M.endPortId)};b(u[0],r.first),b(u[1],r.second);let I={...r.first.source,route:u[0]},v={...r.second.source,route:u[1]};return{first:I,second:v,firstParsed:t_(I,r.layerCount),secondParsed:t_(v,r.layerCount),edgeGap:r.edgeGap,centerlineDistance:r.centerlineSpacing,bendCount:Math.max(0,r.path.length-p-2),viaPairCount:p}})({first:e.first,second:e.second,reverseSecond:e.reverseSecond,path:t,centerlineSpacing:n.edgeGap+e.first.width/2+e.second.width/2,edgeGap:n.edgeGap,side:n.side,layerCount:this.input.layerCount,terminalFanout:e.terminalFanout});o&&mbe(o.firstParsed,o.secondParsed,e.context)&&this.candidates.push(o)}prepare(){let e=this.input.traces.map((I,v)=>({trace:I,index:v})).filter(({trace:I})=>I.connection_name===this.input.pair.connectionNames[0]),t=this.input.traces.map((I,v)=>({trace:I,index:v})).filter(({trace:I})=>I.connection_name===this.input.pair.connectionNames[1]);if(e.length!==1||t.length!==1)throw new qR({connectionNames:this.input.pair.connectionNames,reason:"trace-resolution-failure",message:"must resolve each connection_name to exactly one non-branching trace"});if(e[0].index===t[0].index)throw new qR({connectionNames:this.input.pair.connectionNames,reason:"trace-resolution-failure",message:"resolved both members to one trace"});let n,o;try{n=t_(e[0].trace,this.input.layerCount),o=t_(t[0].trace,this.input.layerCount)}catch(I){throw new qR({connectionNames:this.input.pair.connectionNames,reason:"invalid-routed-geometry",message:`has unsupported or invalid routed geometry: ${I instanceof Error?I.message:String(I)}`})}let r=n.points[0],i=n.points.at(-1),s=Math.hypot(r.x-o.points[0].x,r.y-o.points[0].y)+Math.hypot(i.x-o.points.at(-1).x,i.y-o.points.at(-1).y),a=Math.hypot(r.x-o.points.at(-1).x,r.y-o.points.at(-1).y)+Math.hypot(i.x-o.points[0].x,i.y-o.points[0].y)+0.00000001<s,c=a?o.points.at(-1):o.points[0],l=a?o.points[0]:o.points.at(-1);if(r.layer!==c.layer||i.layer!==l.layer)throw new qR({connectionNames:this.input.pair.connectionNames,reason:"terminal-layer-mismatch",message:"does not have common paired layers at both terminal stations"});let h={x:(r.x+c.x)/2,y:(r.y+c.y)/2,layer:r.layer},d={x:(i.x+l.x)/2,y:(i.y+l.y)/2,layer:i.layer},u=Math.hypot(d.x-h.x,d.y-h.y);if(u<0.000001)throw new qR({connectionNames:this.input.pair.connectionNames,reason:"coincident-terminal-midpoints",message:"has coincident terminal-pair midpoints"});let _={x:-(d.y-h.y)/u,y:(d.x-h.x)/u},p=r.x-c.x,m=r.y-c.y,A=p*_.x+m*_.y>=0?1:-1,g=(I,v)=>{let P=I.x-v.x,M=I.y-v.y,B=Math.hypot(P,M);return B>0.00000001&&Math.abs(P*_.x+M*_.y)/B<0.5},f=g(r,c)&&g(i,l),y={x:_.y,y:-_.x},x=[r,c].some((I)=>(I.x-h.x)*y.x+(I.y-h.y)*y.y>0.00000001),C={immutableTraces:this.input.traces.filter((I,v)=>v!==e[0].index&&v!==t[0].index),obstacles:this.input.obstacles,bounds:this.input.bounds,layerCount:this.input.layerCount,minTraceToPadEdgeClearance:this.input.minTraceToPadEdgeClearance},b=((I)=>{let{minimumCenterlineDistance:v,maximumCenterlineDistance:P}=I;if(v===void 0&&P===void 0)return I.legacyCenterlineDistances;let M=[...v!==void 0&&P!==void 0?[(v+P)/2,v,P,v-0.25,P+0.25]:v!==void 0?[v,v+0.25,v+0.5,v-0.25,v+1]:[P,P-0.25,P-0.5,P+0.25,P-1],...I.legacyCenterlineDistances];return M.filter((B,T)=>B>I.minimumPhysicalDistance&&M.findIndex((N)=>Math.abs(N-B)<0.00000001)===T)})({minimumCenterlineDistance:this.input.pair.minimumCenterlineDistance,maximumCenterlineDistance:this.input.pair.maximumCenterlineDistance,minimumPhysicalDistance:n.width/2+o.width/2,legacyCenterlineDistances:h6r.map((I)=>I+n.width/2+o.width/2)}).flatMap((I)=>{let v=I-n.width/2-o.width/2;return[A,A===1?-1:1].flatMap((P)=>{let M=Zcn({config:this.input.routingGrid,bounds:this.input.bounds,defaultInnerGridStep:Math.max(0.25,Math.min(0.5,I/2))}),B=(L,H)=>a6r({...C,start:L,end:H,firstConnectionName:n.source.connection_name,secondConnectionName:o.source.connection_name,firstStartTerminal:r,firstEndTerminal:i,secondStartTerminal:c,secondEndTerminal:l,firstWidth:n.width,secondWidth:o.width,firstViaDiameter:n.transitions[0]?.via_diameter??n.viaDiameter,secondViaDiameter:o.transitions[0]?.via_diameter??o.viaDiameter,centerlineSpacing:I,side:P,terminalFanout:f,terminalMiterMargin:this.input.pair.maxUncoupledLength===void 0?void 0:I/2}),T=this.input.pair.maxUncoupledLength===void 0?((L,H)=>{if(!x||f)return h;let V=[{terminal:r,offset:H*L/2},{terminal:c,offset:-H*L/2}],O=Math.tan(55*Math.PI/180),U=Math.max(...V.map(({terminal:j,offset:Y})=>{let X=(j.x-h.x)*y.x+(j.y-h.y)*y.y,K=(j.x-h.x)*_.x+(j.y-h.y)*_.y;return X+Math.abs(K-Y)/O}));return{x:h.x+y.x*U,y:h.y+y.y*U,layer:h.layer}})(I,P):h,N=d;if(!f&&this.input.pair.maxUncoupledLength!==void 0){let L=B(h,d),H=dUt({anchor:h,escapeDirection:y,pathDirection:y,centerlineSpacing:I,side:P,lanes:[{point:r,polarity:1},{point:c,polarity:-1}],maxUncoupledLength:this.input.pair.maxUncoupledLength,maximumTurnDegrees:55,searchStep:M.innerGridStep,isValid:(O)=>L.isTerminalFanoutValid(O,y,"start")}),V=dUt({anchor:d,escapeDirection:{x:-y.x,y:-y.y},pathDirection:y,centerlineSpacing:I,side:P,lanes:[{point:i,polarity:1},{point:l,polarity:-1}],maxUncoupledLength:this.input.pair.maxUncoupledLength,maximumTurnDegrees:45,searchStep:M.innerGridStep,isValid:(O)=>L.isTerminalFanoutValid(O,y,"end")});if(!H||!V)return[];if(T=H,N=V,(N.x-T.x)*y.x+(N.y-T.y)*y.y<=M.innerGridStep)return[]}let D=B(T,N);return[{edgeGap:v,side:P,input:{start:T,end:N,bounds:this.input.bounds,layerCount:this.input.layerCount,grid:M,...D}}]})});return{first:n,second:o,reverseSecond:a,terminalFanout:f,context:C,attempts:b}}complete(){if(this.candidates.length===0)throw new qR({connectionNames:this.input.pair.connectionNames,reason:"no-valid-candidate",message:"could not be improved without violating bounds, copper clearance, or coupled-via constraints"});this.candidates.sort((e,t)=>this.score(e)-this.score(t)||e.edgeGap-t.edgeGap),this.result={status:"accepted",candidate:this.candidates[0]}}score(e){return(this.input.pair.minimumCenterlineDistance!==void 0||this.input.pair.maximumCenterlineDistance!==void 0?Math.max(0,(this.input.pair.minimumCenterlineDistance??Number.NEGATIVE_INFINITY)-e.centerlineDistance)*Y3e+Math.max(0,e.centerlineDistance-(this.input.pair.maximumCenterlineDistance??Number.POSITIVE_INFINITY))*Y3e:e.edgeGap<0.5?(0.5-e.edgeGap)*Y3e:e.edgeGap>1?(e.edgeGap-1)*Y3e:0)+fw(e.firstParsed)+fw(e.secondParsed)+0.15*e.bendCount+8*e.viaPairCount}},mle=(e)=>{let t={lines:[],points:[],rects:[],circles:[]};t.rects.push({center:{x:(e.bounds.minX+e.bounds.maxX)/2,y:(e.bounds.minY+e.bounds.maxY)/2},width:e.bounds.maxX-e.bounds.minX,height:e.bounds.maxY-e.bounds.minY,fill:"rgba(30, 70, 120, 0.04)",stroke:"rgba(30, 70, 120, 0.55)",layer:`z${Array.from({length:e.layerCount},(n,o)=>o).join(",")}`});for(let n of e.obstacles){let o=Oq(n,e.layerCount);t.rects.push({center:n.center,width:n.width,height:n.height,ccwRotationDegrees:n.ccwRotationDegrees,fill:"rgba(220, 60, 60, 0.16)",stroke:"rgba(190, 40, 40, 0.75)",layer:`z${o.join(",")}`})}for(let n=0;n<(e.previewPath?.length??0)-1;n++){let o=e.previewPath[n],r=e.previewPath[n+1];if(o.layer!==r.layer)continue;let i=W0(o.layer,e.layerCount);t.lines.push({points:[o,r],strokeColor:"#16a34a",strokeWidth:0.08,strokeDash:[0.18,0.12],layer:`z${i}`})}for(let n of e.traces){if(e.activeConnectionNames?.includes(n.connection_name))continue;let o="#2563eb",r=null;for(let i of n.route)if(i.route_type==="wire"){if(r&&r.layer===i.layer){let s=W0(i.layer,e.layerCount);t.lines.push({points:[r,i],strokeColor:o,strokeWidth:Math.max(r.width,i.width),...s===0?{}:{strokeDash:[0.2,0.16]},layer:`z${s}`})}r=i}else if(i.route_type==="via"){let s=Sq(i.from_layer,i.to_layer,e.layerCount).map((a)=>W0(a,e.layerCount));if(t.circles.push({center:i,radius:(i.via_diameter??r?.width??0.2)/2,fill:"rgba(37, 99, 235, 0.45)",stroke:o,layer:`z${s.join(",")}`}),r){let a=r.width;r={x:i.x,y:i.y,layer:i.to_layer,width:a}}}}return t},u6r=class extends fa{constructor(e){super(),this.params=e,this.outputTraces=pbe(e.simpleRouteJson.traces),this.MAX_ITERATIONS=qcn(e)}params;outputTraces;reroutedPairs=[];failures=[];nextPairIndex=0;activeConnectionNames=null;activeSession=null;getSolverName(){return"DifferentialPairReroutingSolver"}_step(){let e=this.params.simpleRouteJson.differentialPairs[this.nextPairIndex];if(!e)return void this.finish();this.activeConnectionNames=e.connectionNames;try{if(!this.activeSession)return this.activeSession=new d6r({pair:e,traces:this.outputTraces,obstacles:this.params.simpleRouteJson.obstacles,bounds:this.params.simpleRouteJson.bounds,layerCount:this.params.simpleRouteJson.layerCount,minTraceToPadEdgeClearance:this.params.simpleRouteJson.minTraceToPadEdgeClearance,routingGrid:this.params.routingGrid}),void(this.stats=this.activeSession.getStats());this.activeSession.step()}catch(n){if(!(n instanceof qR))throw n;return void this.skipFailedPair(e,n)}if(this.stats=this.activeSession.getStats(),!this.activeSession.isComplete())return;let t=this.activeSession.getResult();this.activeSession=null;for(let n of[t.candidate.first,t.candidate.second]){let o=this.outputTraces.findIndex((r)=>r.connection_name===n.connection_name);if(o<0)throw Error(`DifferentialPairReroutingSolver: accepted replacement for unknown connection "${n.connection_name}"`);this.outputTraces[o]=n}this.reroutedPairs.push(e),this.nextPairIndex++,this.nextPairIndex!==this.params.simpleRouteJson.differentialPairs.length?this.stats={phase:"accepted",pair:e.connectionNames.join("/"),pairIndex:this.nextPairIndex-1,pairCount:this.params.simpleRouteJson.differentialPairs.length}:this.finish()}finish(){this.activeConnectionNames=null,this.solved=!0,this.stats={phase:"complete",acceptedPairCount:this.reroutedPairs.length,skippedPairCount:this.failures.length}}skipFailedPair(e,t){this.failures.push({connectionNames:[...e.connectionNames],reason:t.reason,message:t.message}),this.activeSession=null,this.nextPairIndex++,this.nextPairIndex!==this.params.simpleRouteJson.differentialPairs.length?this.stats={phase:"skipped",pair:e.connectionNames.join("/"),pairIndex:this.nextPairIndex-1,pairCount:this.params.simpleRouteJson.differentialPairs.length,skippedPairCount:this.failures.length}:this.finish()}getConstructorParams(){return[this.params]}getOutput(){if(!this.solved)throw Error("DifferentialPairReroutingSolver: getOutput() called before completion");return this.getBestEffortOutput()}getBestEffortOutput(){return{traces:pbe(this.outputTraces),reroutedPairs:this.reroutedPairs.map((e)=>({...e,connectionNames:[...e.connectionNames]})),failures:this.failures.map((e)=>({...e,connectionNames:[...e.connectionNames]}))}}computeProgress(){return this.solved?1:this.params.simpleRouteJson.differentialPairs.length===0?0:(this.nextPairIndex+(this.activeSession?.getProgress()??0))/this.params.simpleRouteJson.differentialPairs.length}visualize(){return mle({traces:this.outputTraces,obstacles:this.params.simpleRouteJson.obstacles,bounds:this.params.simpleRouteJson.bounds,layerCount:this.params.simpleRouteJson.layerCount,activeConnectionNames:this.activeConnectionNames,previewPath:this.activeSession?.getPreviewPath()??null})}},rb=0.00000001,p6r=class extends fa{constructor(e){super(),this.input=e,this.traces=pbe(e.traces),this.MAX_ITERATIONS=Math.max(1,e.reroutedPairs.length+1)}input;traces;nextPairIndex=0;getSolverName(){return"FortyFiveDegreeSimplificationSolver"}_step(){let e=this.input.reroutedPairs[this.nextPairIndex];if(!e)return this.solved=!0,void(this.stats={phase:"complete",simplifiedPairCount:this.nextPairIndex});this.traces=((t)=>{let n=t.pair.connectionNames.join("/"),o=t.pair.connectionNames.map((v)=>t.traces.map((P,M)=>({trace:P,index:M})).filter(({trace:P})=>P.connection_name===v));if(o[0].length!==1||o[1].length!==1)throw Error(`FortyFiveDegreeSimplificationSolver: pair ${n} must resolve to exactly two traces`);let r=o[0][0].index,i=o[1][0].index;if(r===i)throw Error(`FortyFiveDegreeSimplificationSolver: pair ${n} resolved both members to one trace`);let s=structuredClone(t.traces),a={immutableTraces:s.filter((v,P)=>P!==r&&P!==i),obstacles:t.obstacles,bounds:t.bounds,layerCount:t.layerCount,minTraceToPadEdgeClearance:t.minTraceToPadEdgeClearance},c=(v)=>{let P=t_(v[r],t.layerCount),M=t_(v[i],t.layerCount),B=0;for(let[T,N]of[[P.segments,M.segments],[M.segments,P.segments]])for(let D of T){if(D.terminal!==null)continue;let L=N.filter((H)=>H.layer===D.layer);if(L.length===0)throw Error(`FortyFiveDegreeSimplificationSolver: pair ${n} lost common-layer interior copper`);B=Math.max(B,Math.min(...L.map((H)=>fb(D.start,D.end,H.start,H.end))))}return B},l=(v)=>{let P=t_(v[r],t.layerCount),M=t_(v[i],t.layerCount),B=Number.POSITIVE_INFINITY;for(let[T,N]of[[P.segments,M.segments],[M.segments,P.segments]])for(let D of T)if(D.terminal===null)for(let L of N)L.layer===D.layer&&(B=Math.min(B,fb(D.start,D.end,L.start,L.end)-D.width/2-L.width/2));return Number.isFinite(B)?B:null},h=(v)=>{let P=t_(v[r],t.layerCount),M=t_(v[i],t.layerCount);return mbe(P,M,a)};if(!h(s))throw Error(`FortyFiveDegreeSimplificationSolver: rerouted pair ${n} has invalid complete copper before simplification`);if(t.pair.maxUncoupledLength!==void 0&&t.pair.minimumCenterlineDistance!==void 0&&t.pair.maximumCenterlineDistance!==void 0&&Math.abs(t.pair.minimumCenterlineDistance-t.pair.maximumCenterlineDistance)<=rb)return s;let d=t_(s[r],t.layerCount),u=t_(s[i],t.layerCount),_=Math.abs(fw(d)-fw(u)),p=l(s),m=t.pair.maximumCenterlineDistance??1+d.width/2+u.width/2,A=Math.min(c(s),m),g=(v)=>{if(!h(v))return!1;if(c(v)>A+rb)return!1;let P=l(v);return p===null||P===null||P>=p-rb},f=(v,P)=>{let M=Math.abs(P.x-v.x),B=Math.abs(P.y-v.y),T=P.x>=v.x?1:-1,N=P.y>=v.y?1:-1,D=[],L={x:P.x-T*B,y:v.y};(L.x-v.x)*T>=-0.00000001&&(L.x-P.x)*T<=rb&&D.push([v,L,P]);let H={x:v.x,y:P.y-N*M};(H.y-v.y)*N>=-0.00000001&&(H.y-P.y)*N<=rb&&D.push([v,H,P]);let V={x:v.x+T*Math.min(M,B),y:v.y+N*Math.min(M,B)};return D.push([v,V,P]),D.map((O,U)=>{let j=O.filter((X,K)=>K===0||Math.hypot(X.x-O[K-1].x,X.y-O[K-1].y)>rb),Y=j.slice(0,-1).map((X,K)=>{let J=j[K+1],ee=Math.abs(J.x-X.x),se=Math.abs(J.y-X.y);return{length:Math.hypot(ee,se),straight:ee<=rb||se<=rb?Math.hypot(ee,se):0}});return{points:j,usableStraightLength:Math.max(0,...Y.map((X)=>X.straight)),bendCount:Math.max(0,j.length-2),priority:U}}).filter((O,U,j)=>j.findIndex((Y)=>JSON.stringify(Y.points)===JSON.stringify(O.points))===U).sort((O,U)=>U.usableStraightLength-O.usableStraightLength||O.bendCount-U.bendCount||O.priority-U.priority)},y=(v)=>{let P=[];for(let M=0;M<v.route.length-1;M++){let B=v.route[M];if(B?.route_type==="wire")for(let T=v.route.length-1;T>=M+1;T--){if(M===0||T===v.route.length-1)continue;let N=v.route[T];N?.route_type==="wire"&&N.layer===B.layer&&(v.route.slice(M+1,T).some((D)=>D.route_type!=="wire"||D.layer!==B.layer)||P.push({startIndex:M,endIndex:T,skippedPointCount:T-M-1}))}}return P.sort((M,B)=>B.skippedPointCount-M.skippedPointCount||M.startIndex-B.startIndex||B.endIndex-M.endIndex)},x=(v,P,M)=>{let B=v.route[P.startIndex],T=v.route[P.endIndex],N=Math.max(B.width,T.width),D=M.points.slice(1,-1).map((L)=>({route_type:"wire",...L,width:N,layer:B.layer}));return{...v,route:[...v.route.slice(0,P.startIndex+1),...D,...v.route.slice(P.endIndex)]}};for(let v of[r,i]){let P=!0;for(;P;){P=!1;let M=s[v];for(let B of y(M)){let T=M.route[B.startIndex],N=M.route[B.endIndex],D=M.route.slice(B.startIndex,B.endIndex+1),L=D.slice(0,-1).every((H,V)=>{let O=D[V+1],U=Math.abs(O.x-H.x),j=Math.abs(O.y-H.y);return U<=rb||j<=rb||Math.abs(U-j)<=rb});for(let H of f(T,N)){if(H.points.length>=D.length&&L)continue;let V=x(M,B,H),O=[...s];if(O[v]=V,JSON.stringify(V.route)===JSON.stringify(M.route))continue;if(g(O)){s[v]=V,P=!0;break}let U=v===r?i:r,j=s[U],Y=y(j).find((J)=>J.startIndex===B.startIndex&&J.endIndex===B.endIndex);if(!Y)continue;let X=j.route[Y.startIndex],K=j.route[Y.endIndex];for(let J of f(X,K)){let ee=x(j,Y,J),se=[...O];if(se[U]=ee,g(se)){s[v]=V,s[U]=ee,P=!0;break}}if(P)break}if(P)break}}}if(!g(s))throw Error(`FortyFiveDegreeSimplificationSolver: pair ${n} produced invalid complete copper`);let C=t_(s[r],t.layerCount),b=t_(s[i],t.layerCount),I=Math.abs(fw(C)-fw(b));return Math.abs(I-_)>t.pair.lengthTolerance+rb?structuredClone(t.traces):s})({traces:this.traces,pair:e,obstacles:this.input.obstacles,bounds:this.input.bounds,layerCount:this.input.layerCount,minTraceToPadEdgeClearance:this.input.minTraceToPadEdgeClearance}),this.nextPairIndex++,this.stats={phase:"simplifying",pair:e.connectionNames.join("/"),pairIndex:this.nextPairIndex-1,pairCount:this.input.reroutedPairs.length}}getConstructorParams(){return[this.input]}getOutput(){if(!this.solved)throw Error("FortyFiveDegreeSimplificationSolver: getOutput() called before completion");return this.getBestEffortOutput()}getBestEffortOutput(){return{traces:pbe(this.traces),reroutedPairs:this.input.reroutedPairs.map((e)=>({...e,connectionNames:[...e.connectionNames]}))}}computeProgress(){return this.solved?1:this.input.reroutedPairs.length===0?0:this.nextPairIndex/this.input.reroutedPairs.length}visualize(){return mle({traces:this.traces,obstacles:this.input.obstacles,bounds:this.input.bounds,layerCount:this.input.layerCount,activeConnectionNames:this.input.reroutedPairs[this.nextPairIndex]?.connectionNames??null,previewPath:null})}},_be=(e,t)=>Math.abs(e-t)<=0.0000001,wXe=(e,t)=>_be(e.x,t.x)&&_be(e.y,t.y),m6r=(e)=>{let t=e.candidatePair.map((n,o)=>{let r=e.originalPair[o];return{...n,segments:n.segments.filter((i)=>!r.segments.some((s)=>{return c=i,(a=s).layer===c.layer&&!!_be(a.width,c.width)&&!!wXe(a.start,c.start)&&!!wXe(a.end,c.end);var a,c})),vias:n.vias.filter((i)=>!r.vias.some((s)=>{return!!wXe(a=s,c=i)&&!!_be(a.diameter,c.diameter)&&a.layers.length===c.layers.length&&!!a.layers.every((l)=>c.layers.includes(l));var a,c}))}});return[t[0],t[1]]},_6r=class extends fa{constructor(e){super(),this.input=e}input;output=null;visualizationTraces=null;getSolverName(){return"HdRouteReconstructionSolver"}_step(){this.visualizationTraces=((e)=>{let{simpleRouteJson:t}=e.params;if(e.result.matchedHdRoutes.length!==e.binding.solverParams.hdRoutes.length)throw Error("PostProcessingSolver: LengthMatchingSolver changed the search route count");let n=structuredClone(e.binding.baseTraces);for(let o of e.binding.traceBindings){let r=e.result.matchedHdRoutes[o.matchedRouteIndex];if(!r)throw Error(`PostProcessingSolver: missing matched route at index ${o.matchedRouteIndex}`);let i=n[o.traceIndex];if(!i)throw Error(`PostProcessingSolver: missing simplified trace binding at index ${o.traceIndex}`);if(i.connection_name!==r.connectionName)throw Error(`PostProcessingSolver: route binding changed connection "${i.connection_name}" to "${r.connectionName}"`);if(r.route.length<2)throw Error(`PostProcessingSolver: matched connection "${r.connectionName}" has incomplete geometry`);let s=r.route[0],a=r.route.at(-1);if(Math.hypot(s.x-o.startEndpoint.x,s.y-o.startEndpoint.y)>0.00000001||s.z!==o.startEndpoint.z||Math.hypot(a.x-o.endEndpoint.x,a.y-o.endEndpoint.y)>0.00000001||a.z!==o.endEndpoint.z)throw Error(`PostProcessingSolver: matched connection "${r.connectionName}" moved a preserved endpoint`);let c=[],l=0,h=(u)=>({route_type:"wire",x:u.x,y:u.y,width:u.traceThickness??r.traceThickness,layer:i9(u.z,t.layerCount)});c.push(h(r.route[0]));for(let u=1;u<r.route.length;u++){let _=r.route[u-1],p=r.route[u];if(_.z===p.z){c.push(h(p));continue}if(Math.hypot(_.x-p.x,_.y-p.y)>0.00000001)throw Error(`PostProcessingSolver: matched connection "${r.connectionName}" moves while changing layers`);let m=o.viaTemplates[l++];if(!m)throw Error(`PostProcessingSolver: matched connection "${r.connectionName}" added an unbound via`);if(Math.hypot(m.x-p.x,m.y-p.y)>0.00000001)throw Error(`PostProcessingSolver: matched connection "${r.connectionName}" moved a preserved via`);let A=i9(_.z,t.layerCount),g=i9(p.z,t.layerCount),f=new Set([m.from_layer,m.to_layer]);if(!f.has(A)||!f.has(g))throw Error(`PostProcessingSolver: matched connection "${r.connectionName}" changed a preserved via span`);c.push({...m}),c.push(h(p))}if(l!==o.viaTemplates.length)throw Error(`PostProcessingSolver: matched connection "${r.connectionName}" removed a preserved via`);let d=c.filter((u)=>u.route_type==="wire");for(let u of d)delete u.start_pcb_port_id,delete u.end_pcb_port_id;o.startPortId&&(d[0].start_pcb_port_id=o.startPortId),o.endPortId&&(d.at(-1).end_pcb_port_id=o.endPortId),n[o.traceIndex]={...i,route:c}}for(let o of e.binding.solverParams.differentialPairs){let r=o.connectionNames.join("/"),i=o.connectionNames.map((f)=>n.map((y,x)=>({trace:y,index:x})).filter(({trace:y})=>y.connection_name===f));if(i[0].length!==1||i[1].length!==1)throw Error(`PostProcessingSolver: reconstructed pair ${r} does not resolve to complete copper`);let s=i[0][0],a=i[1][0],c=o.connectionNames.map((f)=>{let y=e.binding.baseTraces.filter((x)=>x.connection_name===f);if(y.length!==1)throw Error(`PostProcessingSolver: original pair ${r} does not resolve to complete copper`);return y[0]}),l=t_(s.trace,t.layerCount),h=t_(a.trace,t.layerCount),d=t_(c[0],t.layerCount),u=t_(c[1],t.layerCount),_=Math.abs(fw(l)-fw(h));if(_>o.lengthTolerance+0.0000001)throw new qKe({message:`PostProcessingSolver: reconstructed pair ${r} exceeds length tolerance ${o.lengthTolerance} with error ${_}`,connectionNames:[...o.connectionNames],reason:"length-tolerance-unsatisfied"});let p={immutableTraces:n.filter((f,y)=>y!==s.index&&y!==a.index),obstacles:t.obstacles,bounds:t.bounds,layerCount:t.layerCount,minTraceToPadEdgeClearance:t.minTraceToPadEdgeClearance},m=mbe(l,h,{...p,obstacles:[]}),A=m6r({candidatePair:[l,h],originalPair:[d,u]}),g=mbe(A[0],A[1],{...p,immutableTraces:[]});if(!m||!g)throw new qKe({message:`PostProcessingSolver: length matching produced invalid complete copper for pair ${r}`,connectionNames:[...o.connectionNames],reason:"invalid-final-copper"})}return n})(this.input),this.output=Kcn({...this.input,rejectInsideJumperPad:!0}),this.stats={phase:"complete",routeCount:this.output.hdRoutes.length},this.solved=!0}getConstructorParams(){return[this.input]}getOutput(){if(!this.output||!this.solved)throw Error("HdRouteReconstructionSolver: getOutput() called before completion");return structuredClone(this.output)}visualize(){let e=this.visualizationTraces??this.input.simplified.traces,{obstacles:t,bounds:n,layerCount:o}=this.input.params.simpleRouteJson;return mle({traces:e,obstacles:t,bounds:n,layerCount:o,activeConnectionNames:null,previewPath:null})}},eln=class extends mS{differentialPairReroutingSolver;fortyFiveDegreeSimplificationSolver;lengthMatchingSolver;hdRouteReconstructionSolver;lengthMatchingBinding=null;model;fallbackOutput=null;postProcessingErrors=[];pipelineDef=[b0("differentialPairReroutingSolver",u6r,(e)=>[e.model.params]),b0("fortyFiveDegreeSimplificationSolver",p6r,(e)=>{let t=e.getStageOutput("differentialPairReroutingSolver");if(!t)throw Error("PostProcessingSolver: rerouting stage completed without output");let{obstacles:n,bounds:o,layerCount:r,minTraceToPadEdgeClearance:i}=e.model.params.simpleRouteJson;return[{...t,obstacles:n,bounds:o,layerCount:r,minTraceToPadEdgeClearance:i}]}),b0("lengthMatchingSolver",jcn,(e)=>{let t=e.getStageOutput("fortyFiveDegreeSimplificationSolver");if(!t)throw Error("PostProcessingSolver: 45-degree simplification stage completed without output");return e.lengthMatchingBinding=cUt({result:t,params:e.model.params}),[e.lengthMatchingBinding.solverParams]}),b0("hdRouteReconstructionSolver",_6r,(e)=>{let t=e.getStageOutput("fortyFiveDegreeSimplificationSolver"),n=e.getStageOutput("lengthMatchingSolver");if(!t||!n||!e.lengthMatchingBinding)throw Error("PostProcessingSolver: reconstruction stage is missing a required binding or output");return[{binding:e.lengthMatchingBinding,result:n,simplified:t,params:e.model.params,model:e.model}]},{onSolved:(e)=>{let t=e.getStageOutput("differentialPairReroutingSolver");if(!t)throw Error("PostProcessingSolver: cannot summarize missing rerouting output");e.stats={phase:"complete",acceptedPairCount:t.reroutedPairs.length},t.failures.length>0&&(e.stats.skippedPairCount=t.failures.length,e.stats.postProcessingErrorCount=t.failures.length)}})];constructor(e){super(structuredClone(e));let t=null;try{(function(o){if(!o||typeof o!="object")throw Error("PostProcessingSolver: params must be an object");if(!Array.isArray(o.hdRoutes))throw Error("PostProcessingSolver: hdRoutes must be an array");if(!Array.isArray(o.differentialPairs))throw Error("PostProcessingSolver: differentialPairs must be an array");if(!Array.isArray(o.obstacles))throw Error("PostProcessingSolver: obstacles must be an array");if(o.minTraceToPadEdgeClearance!==void 0&&(!Number.isFinite(o.minTraceToPadEdgeClearance)||o.minTraceToPadEdgeClearance<0))throw Error("PostProcessingSolver: minTraceToPadEdgeClearance must be finite and nonnegative");if(!Number.isInteger(o.layerCount)||o.layerCount<1)throw Error("PostProcessingSolver: layerCount must be a positive integer");for(let h of o.obstacles){if(!h||typeof h!="object"||h.type!=="rect"||!h.center||!Number.isFinite(h.center.x)||!Number.isFinite(h.center.y)||!Number.isFinite(h.width)||h.width<=0||!Number.isFinite(h.height)||h.height<=0||!Array.isArray(h.layers)||h.layers.some((d)=>typeof d!="string")||!Array.isArray(h.connectedTo)||h.connectedTo.some((d)=>typeof d!="string"||d.length===0)||h.ccwRotationDegrees!==void 0&&!Number.isFinite(h.ccwRotationDegrees))throw Error("PostProcessingSolver: obstacle declaration is invalid");Oq(h,o.layerCount)}let{minX:r,maxX:i,minY:s,maxY:a}=o.bounds??{};if(![r,i,s,a].every(Number.isFinite)||r>=i||s>=a)throw Error("PostProcessingSolver: bounds must have finite positive extents");let c=new Set(o.differentialPairs.flatMap((h)=>h.connectionNames));for(let h of o.hdRoutes){if(!h||typeof h!="object"||typeof h.connectionName!="string"||h.connectionName.length===0||h.rootConnectionName!==void 0&&(typeof h.rootConnectionName!="string"||h.rootConnectionName.length===0)||!Number.isFinite(h.traceThickness)||h.traceThickness<=0||!Number.isFinite(h.viaDiameter)||h.viaDiameter<0||h.viaDiameter===0&&c.has(h.connectionName)||!Array.isArray(h.route)||!Array.isArray(h.vias)||h.jumpers!==void 0&&!Array.isArray(h.jumpers))throw Error("PostProcessingSolver: HD route declaration is invalid");if(h.startPcbPortId!==void 0&&(typeof h.startPcbPortId!="string"||h.startPcbPortId.length===0)||h.endPcbPortId!==void 0&&(typeof h.endPcbPortId!="string"||h.endPcbPortId.length===0))throw Error(`PostProcessingSolver: HD route "${h.connectionName}" has invalid terminal metadata`);for(let d of h.route)if(!d||typeof d!="object"||!Number.isFinite(d.x)||!Number.isFinite(d.y)||!Number.isInteger(d.z)||d.z<0||d.z>=o.layerCount||d.traceThickness!==void 0&&(!Number.isFinite(d.traceThickness)||d.traceThickness<=0))throw Error(`PostProcessingSolver: HD route "${h.connectionName}" has an invalid route point`);for(let d of h.vias)if(!d||typeof d!="object"||!Number.isFinite(d.x)||!Number.isFinite(d.y)||d.zLayers!==void 0&&(!Array.isArray(d.zLayers)||d.zLayers.some((u)=>!Number.isInteger(u)||u<0||u>=o.layerCount)))throw Error(`PostProcessingSolver: HD route "${h.connectionName}" has an invalid via`);if(h.vias.length>0&&h.viaDiameter<=0)throw Error(`PostProcessingSolver: HD route "${h.connectionName}" has a non-positive via diameter`);for(let d of h.jumpers??[])if(!(d&&typeof d=="object"&&d.route_type==="jumper"&&Number.isFinite(d.start?.x)&&Number.isFinite(d.start?.y)&&Number.isFinite(d.end?.x)&&Number.isFinite(d.end?.y)&&["0603","1206","1206x4_pair"].includes(d.footprint)))throw Error(`PostProcessingSolver: HD route "${h.connectionName}" has an invalid jumper`)}let l=new Set;for(let h of o.differentialPairs){if(!h||typeof h!="object"||!Array.isArray(h.connectionNames)||h.connectionNames.length!==2||h.connectionNames[0]===h.connectionNames[1]||!h.connectionNames.every((d)=>typeof d=="string"&&d.length>0)||!Number.isFinite(h.lengthTolerance)||h.lengthTolerance<0)throw Error("PostProcessingSolver: differential pair declaration is invalid");for(let d of[h.minimumCenterlineDistance,h.maximumCenterlineDistance])if(d!==void 0&&(!Number.isFinite(d)||d<=0))throw Error("PostProcessingSolver: differential pair centerline distances must be positive finite numbers");if(h.maxUncoupledLength!==void 0&&(!Number.isFinite(h.maxUncoupledLength)||h.maxUncoupledLength<0))throw Error("PostProcessingSolver: differential pair maxUncoupledLength must be a non-negative finite number");if(h.minimumCenterlineDistance!==void 0&&h.maximumCenterlineDistance!==void 0&&h.minimumCenterlineDistance>h.maximumCenterlineDistance)throw Error("PostProcessingSolver: differential pair minimumCenterlineDistance cannot exceed maximumCenterlineDistance");for(let d of h.connectionNames){if(l.has(d))throw Error(`PostProcessingSolver: connection "${d}" belongs to multiple differential pairs`);l.add(d)}}for(let h of[0.25,0.5])Zcn({config:o.routingGrid,bounds:o.bounds,defaultInnerGridStep:h})})(e)}catch(o){if(!(o instanceof $cn))throw o;t=o}if(this.model=lUt(e),t)return void this.finishWithBestEffortOutput({stage:"differentialPairReroutingSolver",message:t.message,reason:t.reason});let n=qcn(this.model.params)+Math.max(1,e.differentialPairs.length+1)+1e5+10;if(!Number.isSafeInteger(n))throw Error("PostProcessingSolver: derived pipeline iteration bound exceeds the safe integer range");this.MAX_ITERATIONS=n}getSolverName(){return"PostProcessingSolver"}getConstructorParams(){return[structuredClone(this.inputProblem)]}_step(){let e=this.getCurrentStageName();try{super._step()}catch(n){let o=this.classifyOptimizationFailure(n,e);if(!o)throw n;return void this.finishWithBestEffortOutput(o)}if(!this.failed)return;let t=this.classifyIterationFailure(this.error,e);if(!t)throw Error(this.error??"PostProcessingSolver failed without an error message");this.finishWithBestEffortOutput(t)}tryFinalAcceptance(){let e=this.getCurrentStageName();e!=="differentialPairReroutingSolver"&&e!=="lengthMatchingSolver"||this.finishWithBestEffortOutput({stage:e,message:"PostProcessingSolver reached its iteration limit",reason:"iteration-limit-exhausted"})}classifyOptimizationFailure(e,t){return t==="lengthMatchingSolver"&&e instanceof _Ce?{stage:t,message:e.message,connectionName:e.connectionName,reason:e.reason}:t==="hdRouteReconstructionSolver"&&e instanceof qKe||t==="differentialPairReroutingSolver"&&e instanceof qR&&e.reason==="no-valid-candidate"?{stage:t,message:e.message,connectionNames:[...e.connectionNames],reason:e.reason}:null}classifyIterationFailure(e,t){return t!=="differentialPairReroutingSolver"&&t!=="lengthMatchingSolver"?null:e&&e.endsWith("ran out of iterations")?{stage:t,message:e,reason:"iteration-limit-exhausted"}:null}createBestEffortOutput(e){let t=this.lengthMatchingBinding;if(!t){let o=this.getStageOutput("fortyFiveDegreeSimplificationSolver")??this.fortyFiveDegreeSimplificationSolver?.getBestEffortOutput(),r=this.getStageOutput("differentialPairReroutingSolver")??this.differentialPairReroutingSolver?.getBestEffortOutput(),i=o??r;i&&(t=cUt({result:i,params:this.model.params}))}if(!t)return{output:{hdRoutes:structuredClone(this.inputProblem.hdRoutes),postProcessingErrors:[]},source:"input-hd-routes"};let n=this.getStageOutput("lengthMatchingSolver");return n||(n=this.lengthMatchingSolver?.getBestEffortOutput()),n&&e.reason!=="invalid-final-copper"||(n={matchedHdRoutes:t.solverParams.hdRoutes}),{output:Kcn({binding:t,result:n,model:this.model}),source:"best-effort-hd-routes"}}finishWithBestEffortOutput(e){let t=this.createBestEffortOutput(e),n={type:"post_processing_error",...e,returnedRouteSource:t.source};this.postProcessingErrors.push(n),this.fallbackOutput=t.output,this.activeSubSolver=null,this.error=null,this.failed=!1,this.solved=!0,this.progress=1,this.stats={phase:"complete",postProcessingErrorCount:this.postProcessingErrors.length}}getOutput(){if(!this.solved)throw Error("PostProcessingSolver: getOutput() called before the solver completed");let e=this.fallbackOutput??this.getStageOutput("hdRouteReconstructionSolver");if(!e)throw Error("PostProcessingSolver: completed pipeline is missing reconstruction output");let t=this.getStageOutput("differentialPairReroutingSolver")??this.differentialPairReroutingSolver?.getBestEffortOutput(),n=t?.failures??[],o="input-hd-routes";(t?.reroutedPairs.length??0)>0&&(o="best-effort-hd-routes");let r=[...n.map((s)=>({type:"post_processing_error",stage:"differentialPairReroutingSolver",message:s.message,connectionNames:[...s.connectionNames],reason:s.reason,returnedRouteSource:o})),...this.postProcessingErrors],i=structuredClone(e);return i.postProcessingErrors=structuredClone(r),i}initialVisualize(){if(this.fallbackOutput)return{lines:this.fallbackOutput.hdRoutes.map((r)=>({points:r.route.map(({x:i,y:s})=>({x:i,y:s})),strokeWidth:r.traceThickness}))};let{traces:e,obstacles:t,bounds:n,layerCount:o}=this.model.params.simpleRouteJson;return mle({traces:structuredClone(e),obstacles:t,bounds:n,layerCount:o,activeConnectionNames:null,previewPath:null})}finalVisualize(){if(this.fallbackOutput)return this.initialVisualize();let e=lUt({...this.inputProblem,hdRoutes:this.getOutput().hdRoutes}),{traces:t,obstacles:n,bounds:o,layerCount:r}=e.params.simpleRouteJson;return mle({traces:t,obstacles:n,bounds:o,layerCount:r,activeConnectionNames:null,previewPath:null})}},Xle=class e{static generators=new Map;static register(t){e.generators.set(t.componentKind,t)}static create(t){let n=t.detectedComponent.componentKind,o=e.generators.get(n);if(!o)throw Error(`No topology generator registered for component kind "${n}"`);return new o(t)}},_le=(e)=>[e.obstacle.obstacleId??e.obstacle.componentId??"obstacle",e.start.x.toFixed(4),e.start.y.toFixed(4),e.end.x.toFixed(4),e.end.y.toFixed(4),e.expansionDirection.x,e.expansionDirection.y].join(":"),tln=(e)=>{let t=0;for(let n of e)t=31*t+n.charCodeAt(0)>>>0;return t},n_=(e,t)=>`hsla(${tln(_le(e))%360},72%,36%,${t})`,gle=(e)=>{let t=e.expansionDirection;return t.x<0?"left":t.x>0?"right":t.y<0?"bottom":"top"},rS=(e)=>({x:(e.start.x+e.end.x)/2,y:(e.start.y+e.end.y)/2}),JKe=(e)=>{let t=/^bga-gapfill-(\d+)-/.exec(e.capacityMeshNodeId);return t?Number.parseInt(t[1],10):null},uUt=(e,t)=>{let n=rS(e),o=rS(t),r=n.y-o.y;if(Math.abs(r)>0.000001)return r;let i=n.x-o.x;return Math.abs(i)>0.000001?i:_le(e).localeCompare(_le(t))},gbe=(e)=>{let t=[...e].sort(uUt),n=[],o=t.shift();for(;o&&(n.push(o),t.length!==0);){let r=rS(o),i=0,s=Number.POSITIVE_INFINITY;for(let a=0;a<t.length;a++){let c=t[a],l=rS(c),h=(l.x-r.x)**2+(l.y-r.y)**2;h<s-0.000000001?(s=h,i=a):Math.abs(h-s)<=0.000000001&&uUt(c,t[i])<0&&(i=a)}o=t.splice(i,1)[0]}return n},a9=(e,t)=>{let n=_le(e),o=t.findIndex((r)=>_le(r)===n);return o>=0?`E${o+1}`:`E${tln(n).toString(36).slice(0,4)}`},ZKe=(e)=>e.flatMap((t)=>{let n=Md(t);return[{obstacle:t,start:{x:n.minX,y:n.minY},end:{x:n.minX,y:n.maxY},expansionDirection:{x:-1,y:0}},{obstacle:t,start:{x:n.maxX,y:n.minY},end:{x:n.maxX,y:n.maxY},expansionDirection:{x:1,y:0}},{obstacle:t,start:{x:n.minX,y:n.minY},end:{x:n.maxX,y:n.minY},expansionDirection:{x:0,y:-1}},{obstacle:t,start:{x:n.minX,y:n.maxY},end:{x:n.maxX,y:n.maxY},expansionDirection:{x:0,y:1}}]}),mO=0.001,G3e=0.001,g6r=class extends fa{constructor(e){super(),this.inputProblem=e}inputProblem;meshIndex;allEdges=[];queueEdges=[];disconnectedEdges=[];currentEdge=null;lastSearchBounds=null;lastCandidateMeshNodes=[];lastMatchedMeshNode=null;_setup(){let e=Math.max(this.inputProblem.meshNodes.length,1);this.meshIndex=new i_(e);for(let n of this.inputProblem.meshNodes){let o=Md(n);this.meshIndex.add(o.minX,o.minY,o.maxX,o.maxY)}this.meshIndex.finish();let t=ZKe(this.inputProblem.unmarkedComponentObstacles);this.queueEdges=t,this.allEdges=gbe(t),this.currentEdge=null,this.lastSearchBounds=null,this.lastCandidateMeshNodes=[],this.lastMatchedMeshNode=null}_step(){let e=this.queueEdges.shift();if(!e)return this.currentEdge=null,this.lastSearchBounds=null,this.lastCandidateMeshNodes=[],this.lastMatchedMeshNode=null,void(this.solved=!0);this.currentEdge=e,this.lastMatchedMeshNode=null;let t=Math.abs(e.start.x-e.end.x)<=mO,n=t?{minX:e.start.x-G3e,maxX:e.start.x+G3e,minY:Math.min(e.start.y,e.end.y),maxY:Math.max(e.start.y,e.end.y)}:{minX:Math.min(e.start.x,e.end.x),maxX:Math.max(e.start.x,e.end.x),minY:e.start.y-G3e,maxY:e.start.y+G3e};this.lastSearchBounds=n;let o=this.meshIndex.search(n.minX,n.minY,n.maxX,n.maxY);this.lastCandidateMeshNodes=o.map((i)=>this.inputProblem.meshNodes[i]);let r=!1;for(let i of o){let s=this.inputProblem.meshNodes[i],a=Md(s);if(t){if(!(Math.min(a.maxY,Math.max(e.start.y,e.end.y))-Math.max(a.minY,Math.min(e.start.y,e.end.y))>mO))continue;if(e.expansionDirection.x===-1&&Math.abs(a.maxX-e.start.x)<=mO){r=!0,this.lastMatchedMeshNode=s;break}if(e.expansionDirection.x===1&&Math.abs(a.minX-e.start.x)<=mO){r=!0,this.lastMatchedMeshNode=s;break}continue}if(Math.min(a.maxX,Math.max(e.start.x,e.end.x))-Math.max(a.minX,Math.min(e.start.x,e.end.x))>mO){if(e.expansionDirection.y===-1&&Math.abs(a.maxY-e.start.y)<=mO){r=!0,this.lastMatchedMeshNode=s;break}if(e.expansionDirection.y===1&&Math.abs(a.minY-e.start.y)<=mO){r=!0,this.lastMatchedMeshNode=s;break}}}r||this.disconnectedEdges.push(e)}getOutput(){return this.disconnectedEdges}visualize(){let e=this.disconnectedEdges,t=this.allEdges.length>0?this.allEdges:[...e,...this.currentEdge?[this.currentEdge]:[]],n=this.currentEdge?n_(this.currentEdge,0.88):"rgba(40,40,40,0.4)",o=this.inputProblem.meshNodes.map((d)=>({...fA(d,{rectMargin:0.01}),fill:d._containsObstacle?"rgba(120,120,120,0.18)":"rgba(120,120,120,0.08)",stroke:d._containsObstacle?"rgba(120,120,120,0.42)":"rgba(120,120,120,0.24)"})),r=this.lastSearchBounds&&this.currentEdge?[{center:(i=this.lastSearchBounds,{x:(i.minX+i.maxX)/2,y:(i.minY+i.maxY)/2}),width:this.lastSearchBounds.maxX-this.lastSearchBounds.minX,height:this.lastSearchBounds.maxY-this.lastSearchBounds.minY,fill:n_(this.currentEdge,0.1),stroke:n_(this.currentEdge,0.36),label:[a9(this.currentEdge,t),"search band"].join(" ")}]:[];var i;let s=this.lastCandidateMeshNodes.map((d)=>({...fA(d,{rectMargin:0.018}),fill:d===this.lastMatchedMeshNode?"rgba(0,180,90,0.24)":this.currentEdge?n_(this.currentEdge,0.16):"rgba(80,120,160,0.16)",stroke:d===this.lastMatchedMeshNode?"rgba(0,150,80,0.88)":n,label:[d===this.lastMatchedMeshNode?"matched":"candidate",d.capacityMeshNodeId,`z:${d.availableZ.join(",")}`].join(`
`)})),a=this.inputProblem.unmarkedComponentObstacles.map((d)=>({center:d.center,width:d.width,height:d.height,fill:"rgba(160,160,160,0.10)",stroke:"rgba(160,160,160,0.40)",label:d.obstacleId??d.componentId??"obstacle"})),c=e.map((d)=>({points:[d.start,d.end],strokeColor:n_(d,0.14),strokeWidth:0.01,strokeDash:"5 4",label:[a9(d,t),gle(d),"disconnected"].join(" ")})),l=[],h=[];if(this.currentEdge){let d=rS(this.currentEdge);l.push({points:[this.currentEdge.start,this.currentEdge.end],strokeColor:n_(this.currentEdge,1),strokeWidth:0.06,label:[a9(this.currentEdge,t),gle(this.currentEdge),"checking"].join(" ")},{points:[d,{x:d.x+0.16*this.currentEdge.expansionDirection.x,y:d.y+0.16*this.currentEdge.expansionDirection.y}],strokeColor:n_(this.currentEdge,0.82),strokeWidth:0.02,strokeDash:"3 3"}),h.push({...d,color:n_(this.currentEdge,1),label:a9(this.currentEdge,t)})}return{rects:[...o,...r,...s,...a],lines:[...c,...l],points:h}}},zR=0.001,OR=0.001,U3e=0.000001,A6r=class extends fa{constructor(e){super(),this.inputProblem=e}inputProblem;meshIndex;meshBounds;expandedNodes=[];_setup(){let e=Math.max(this.inputProblem.meshNodes.length,1);this.meshIndex=new i_(e);let{POSITIVE_INFINITY:t,NEGATIVE_INFINITY:n,POSITIVE_INFINITY:o,NEGATIVE_INFINITY:r}=Number;for(let i of this.inputProblem.meshNodes){let s=Md(i);this.meshIndex.add(s.minX,s.minY,s.maxX,s.maxY),t=Math.min(t,s.minX),n=Math.max(n,s.maxX),o=Math.min(o,s.minY),r=Math.max(r,s.maxY)}this.meshIndex.finish(),this.meshBounds=this.inputProblem.meshNodes.length?{minX:t,maxX:n,minY:o,maxY:r}:{minX:0,maxX:0,minY:0,maxY:0}}getObstacleAvailableZ(e){return e.__zLayers??e.layers.map((t)=>ti(t,this.inputProblem.layerCount))}getSharedOverlapArea(e,t){if(!e.availableZ.some((s)=>t.availableZ.includes(s)))return 0;let n=Md(e),o=Md(t),r=Math.min(n.maxX,o.maxX)-Math.max(n.minX,o.minX),i=Math.min(n.maxY,o.maxY)-Math.max(n.minY,o.minY);return r<=U3e||i<=U3e?0:r*i}getNodeObstacleOverlapArea(e,t){let n=this.getObstacleAvailableZ(t);if(!e.availableZ.some((a)=>n.includes(a)))return 0;let o=Md(e),r=Md(t),i=Math.min(o.maxX,r.maxX)-Math.max(o.minX,r.minX),s=Math.min(o.maxY,r.maxY)-Math.max(o.minY,r.minY);return i<=U3e||s<=U3e?0:i*s}getClosestMeshNode(e,t){let n=Math.abs(e.start.x-e.end.x)<=zR,o=this.getObstacleAvailableZ(e.obstacle),r=n?e.expansionDirection.x<0?{minX:this.meshBounds.minX,maxX:e.start.x,minY:Math.min(e.start.y,e.end.y)-OR,maxY:Math.max(e.start.y,e.end.y)+OR}:{minX:e.start.x,maxX:this.meshBounds.maxX,minY:Math.min(e.start.y,e.end.y)-OR,maxY:Math.max(e.start.y,e.end.y)+OR}:e.expansionDirection.y<0?{minX:Math.min(e.start.x,e.end.x)-OR,maxX:Math.max(e.start.x,e.end.x)+OR,minY:this.meshBounds.minY,maxY:e.start.y}:{minX:Math.min(e.start.x,e.end.x)-OR,maxX:Math.max(e.start.x,e.end.x)+OR,minY:e.start.y,maxY:this.meshBounds.maxY},i=this.meshIndex.search(r.minX,r.minY,r.maxX,r.maxY),s=null,a=Number.POSITIVE_INFINITY,c=[...i.map((l)=>this.inputProblem.meshNodes[l]),...t];for(let l of c){if(l._containsObstacle)continue;if(!l.availableZ.some((u)=>o.includes(u)))continue;let h=Md(l);if((n?Math.min(Math.max(e.start.y,e.end.y),h.maxY)-Math.max(Math.min(e.start.y,e.end.y),h.minY):Math.min(Math.max(e.start.x,e.end.x),h.maxX)-Math.max(Math.min(e.start.x,e.end.x),h.minX))<=zR)continue;let d=n?e.expansionDirection.x<0?e.start.x-h.maxX:h.minX-e.start.x:e.expansionDirection.y<0?e.start.y-h.maxY:h.minY-e.start.y;d<zR||(d>=a||(a=d,s=l))}return s}createExpandedNode(e,t,n){let o=Md(t),r=this.getObstacleAvailableZ(e.obstacle);if(Math.abs(e.start.x-e.end.x)<=zR){let l=Math.max(Math.min(e.start.y,e.end.y),o.minY),h=Math.min(Math.max(e.start.y,e.end.y),o.maxY),d=e.expansionDirection.x<0?o.maxX:e.start.x,u=e.expansionDirection.x<0?e.start.x:o.minX;return u-d<=zR||h-l<=zR?null:{capacityMeshNodeId:`bga-gapfill-${n}-${e.obstacle.obstacleId??"no-obstacle"}-${t.capacityMeshNodeId}`,center:{x:(d+u)/2,y:(l+h)/2},width:u-d,height:h-l,layer:`z${r.join(",")}`,availableZ:r}}let i=Math.max(Math.min(e.start.x,e.end.x),o.minX),s=Math.min(Math.max(e.start.x,e.end.x),o.maxX),a=e.expansionDirection.y<0?o.maxY:e.start.y,c=e.expansionDirection.y<0?e.start.y:o.minY;return s-i<=zR||c-a<=zR?null:{capacityMeshNodeId:`bga-gapfill-${n}-${e.obstacle.obstacleId??"no-obstacle"}-${t.capacityMeshNodeId}`,center:{x:(i+s)/2,y:(a+c)/2},width:s-i,height:c-a,layer:`z${r.join(",")}`,availableZ:r}}overlapsExistingGeometry(e,t){for(let n of this.inputProblem.meshNodes)if(this.getSharedOverlapArea(e,n)>0)return!0;for(let n of t)if(this.getSharedOverlapArea(e,n)>0)return!0;for(let n of this.inputProblem.edgesWithObstacle)if(this.getNodeObstacleOverlapArea(e,n.obstacle)>0)return!0;return!1}_step(){let e=[];for(let[t,n]of this.inputProblem.edgesWithObstacle.entries()){let o=this.getClosestMeshNode(n,e);if(!o)continue;let r=this.createExpandedNode(n,o,t);r&&(this.overlapsExistingGeometry(r,e)||e.push(r))}this.expandedNodes=e,this.solved=!0}getOutput(){return this.expandedNodes}visualize(){let e=this.inputProblem.edgesWithObstacle,t=gbe(e);return{rects:[...this.inputProblem.meshNodes.map((n)=>({...fA(n,{rectMargin:0.01}),fill:n._containsObstacle?"rgba(255,0,0,0.16)":"rgba(0,120,255,0.08)",stroke:n._containsObstacle?"rgba(255,0,0,0.35)":"rgba(0,120,255,0.28)"})),...this.expandedNodes.map((n)=>{let o=JKe(n),r=o===null?null:e[o]??null;return{...fA(n,{rectMargin:0.012,zOffset:0.01}),fill:r?n_(r,0.24):"rgba(0,160,100,0.24)",stroke:r?n_(r,0.72):"rgba(0,160,100,0.68)",label:[r?a9(r,t):"E?","expanded",n.capacityMeshNodeId,`z:${n.availableZ.join(",")}`].join(`
`)}})],lines:[...this.inputProblem.edgesWithObstacle.map((n)=>({points:[n.start,n.end],strokeColor:n_(n,0.9),strokeWidth:0.034,label:[a9(n,t),gle(n)].join(" ")})),...this.inputProblem.edgesWithObstacle.map((n)=>{let o=rS(n);return{points:[o,{x:o.x+0.16*n.expansionDirection.x,y:o.y+0.16*n.expansionDirection.y}],strokeColor:n_(n,0.7),strokeWidth:0.016,strokeDash:"3 3"}})],points:this.inputProblem.edgesWithObstacle.map((n)=>({...rS(n),color:n_(n,0.95),label:a9(n,t)}))}}},_O=0.001,f6r=class extends mS{constructor(e){super(e),this.inputProblem=e}inputProblem;detectEdgesNotConnectedToMesh;expandUnconnectedEdgesToMesh;pipelineDef=[b0("detectEdgesNotConnectedToMesh",g6r,(e)=>[e.inputProblem]),b0("expandUnconnectedEdgesToMesh",A6r,(e)=>[{meshNodes:e.inputProblem.meshNodes,edgesWithObstacle:e.detectEdgesNotConnectedToMesh.getOutput(),layerCount:e.inputProblem.layerCount}])];getOutput(){return[...this.inputProblem.meshNodes,...this.expandUnconnectedEdgesToMesh.getOutput()]}getExpandedNodes(){return this.expandUnconnectedEdgesToMesh.getOutput()}getObstacleLayer(e){return`z${(e.obstacle.__zLayers??e.obstacle.layers.map((t)=>ti(t,this.inputProblem.layerCount))).join(",")}`}getObstacleRects(){return this.inputProblem.unmarkedComponentObstacles.map((e)=>{let t=e.__zLayers??e.layers.map((n)=>ti(n,this.inputProblem.layerCount));return{center:e.center,width:e.width,height:e.height,fill:"rgba(150,150,150,0.08)",stroke:"rgba(90,90,90,0.42)",label:e.obstacleId??e.componentId??"bga obstacle",layer:`z${t.join(",")}`}})}getBaseMeshRects(){return this.inputProblem.meshNodes.map((e)=>({...fA(e,{rectMargin:0.025,zOffset:0.01}),fill:e._containsObstacle?"rgba(210,60,60,0.14)":"rgba(80,120,160,0.08)",stroke:e._containsObstacle?"rgba(190,40,40,0.42)":"rgba(80,120,160,0.28)",label:`mesh ${e.capacityMeshNodeId}
z:${e.availableZ.join(",")}`}))}initialVisualize(){let e=ZKe(this.inputProblem.unmarkedComponentObstacles),t=gbe(e),n=[...e.map((o)=>({points:[o.start,o.end],strokeColor:n_(o,0.72),strokeWidth:0.018,strokeDash:"0.05 0.035",layer:this.getObstacleLayer(o),label:[a9(o,t),gle(o)].join(" ")})),...e.map((o)=>{let r=rS(o);return{points:[r,{x:r.x+0.18*o.expansionDirection.x,y:r.y+0.18*o.expansionDirection.y}],strokeColor:n_(o,0.64),strokeWidth:0.012,strokeDash:"0.035 0.025",layer:this.getObstacleLayer(o)}})];return{title:"BGA GapFill: candidate obstacle edges",rects:[...this.getBaseMeshRects(),...this.getObstacleRects()],lines:n}}finalVisualize(){let e=this.getStageOutput("detectEdgesNotConnectedToMesh")??[],t=this.getStageOutput("expandUnconnectedEdgesToMesh")??[],n=gbe(ZKe(this.inputProblem.unmarkedComponentObstacles)),o=new Map;for(let c of t){let l=JKe(c);l!==null&&o.set(l,c)}let r=t.map((c)=>{let l=JKe(c),h=l===null?null:e[l]??null,d=h?(({expandedNode:p,edge:m,meshNodes:A})=>{let g=Md(p),f=Math.abs(m.start.x-m.end.x)<=_O;return A.filter((y)=>{if(y._containsObstacle)return!1;if(!p.availableZ.some((C)=>y.availableZ.includes(C)))return!1;let x=Md(y);return f?!(Math.min(g.maxY,x.maxY)-Math.max(g.minY,x.minY)<=_O)&&(m.expansionDirection.x<0?Math.abs(x.maxX-g.minX)<=_O:Math.abs(x.minX-g.maxX)<=_O):!(Math.min(g.maxX,x.maxX)-Math.max(g.minX,x.minX)<=_O)&&(m.expansionDirection.y<0?Math.abs(x.maxY-g.minY)<=_O:Math.abs(x.minY-g.maxY)<=_O)}).map((y)=>y.capacityMeshNodeId)})({expandedNode:c,edge:h,meshNodes:this.inputProblem.meshNodes}):[],u=h?a9(h,n):"E?",_=h===null?"rgba(0,160,100,0.72)":n_(h,0.72);return{...fA(c,{rectMargin:0.012,zOffset:0.01}),fill:h===null?"rgba(0,160,100,0.24)":n_(h,0.16),stroke:_,label:[`${u} gap fill`,d.length>0?`to ${d.join(",")}`:"target mesh not adjacent",`z:${c.availableZ.join(",")}`].join(`
`)}}),i=e.map((c,l)=>{let h=o.get(l);return{points:[c.start,c.end],strokeColor:h?n_(c,0.68):"rgba(80,80,80,0.14)",strokeWidth:h?0.026:0.008,...h?{}:{strokeDash:"5 4"},layer:this.getObstacleLayer(c),label:[[a9(c,n),gle(c)].join(" "),h?"filled":"no fill created"].join(`
`)}}),s=e.flatMap((c,l)=>{let h=rS(c),d=o.get(l);return d?[{points:[h,d.center],strokeColor:n_(c,0.42),strokeWidth:0.012,strokeDash:"0.035 0.025",layer:this.getObstacleLayer(c)}]:[]}),a=e.flatMap((c,l)=>o.has(l)?[{...rS(c),color:n_(c,0.82),label:a9(c,n),layer:this.getObstacleLayer(c)}]:[]);return{title:"BGA GapFill: disconnected edges and created mesh",rects:[...this.getBaseMeshRects(),...this.getObstacleRects(),...r],lines:[...i,...s],points:a}}};function pUt(e,t){let n=[];for(let o=0;o<e.length;o++){let r=e[o];n.push(r);let i=e[o+1];if(i===void 0)continue;let s=Math.round((i-r)/t);if(!(s<=1))for(let a=1;a<s;a++){let c=a/s;n.push(Number((r+(i-r)*c).toFixed(6)))}}return n}var h$=0.001;function mUt(e){let t=[];for(let i=1;i<e.length;i++){let s=e[i]-e[i-1];s>h$&&t.push(s)}if(t.length===0)return null;let n=Math.min(...t),o=t.filter((i)=>i<=1.5*n).sort((i,s)=>i-s),r=Math.floor(o.length/2);return o.length%2==0?(o[r-1]+o[r])/2:o[r]}function _Ut(e){return[...new Set(e)].sort((t,n)=>t-n)}function W3e(e){return Number(e.toFixed(6))}var y6r=class e{static fromObstacles(t){if(t.length===0)return null;let n=_Ut(t.map((s)=>s.center.x)),o=_Ut(t.map((s)=>s.center.y)),r=mUt(n),i=mUt(o);return r===null||i===null?null:new e({obstacles:t,xCoordinates:pUt(n,r),yCoordinates:pUt(o,i),pitchX:r,pitchY:i})}xCoordinates;yCoordinates;pitchX;pitchY;originX;originY;rowCount;colCount;padWidth;padHeight;slots=new Map;constructor(t){this.xCoordinates=t.xCoordinates,this.yCoordinates=t.yCoordinates,this.pitchX=t.pitchX,this.pitchY=t.pitchY,this.originX=this.xCoordinates[0],this.originY=this.yCoordinates[0],this.colCount=this.xCoordinates.length,this.rowCount=this.yCoordinates.length,this.padWidth=t.obstacles[0].width,this.padHeight=t.obstacles[0].height;for(let n of t.obstacles){let o=this.getSlotForObstacle(n);o&&this.slots.set(this.getSlotKey(o.row,o.col),{...o,obstacle:n})}}getSlotKey(t,n){return`${t}:${n}`}getAxisIndex(t,n){let o=-1,r=Number.POSITIVE_INFINITY;for(let i=0;i<t.length;i++){let s=Math.abs(t[i]-n);s<r&&(r=s,o=i)}return r<=h$?o:null}getAxisCoordinate(t,n){return t[n]}hasPadAt(t,n){return this.slots.has(this.getSlotKey(t,n))}getSlotForObstacle(t){let n=this.getAxisIndex(this.yCoordinates,t.center.y),o=this.getAxisIndex(this.xCoordinates,t.center.x);return n===null||o===null||n<0||n>=this.rowCount||o<0||o>=this.colCount?null:{row:n,col:o}}getSlotCenter(t,n){return{x:this.getAxisCoordinate(this.xCoordinates,n),y:this.getAxisCoordinate(this.yCoordinates,t)}}getHorizontalGap(t,n){let o=this.getSlotCenter(t,n),r=this.getSlotCenter(t,n+1),i=Math.abs(r.x-o.x);return{orientation:"horizontal",row:t,col:n,center:{x:W3e((o.x+r.x)/2),y:o.y},width:i-this.padWidth,height:this.padHeight,isBetweenTwoPads:this.hasPadAt(t,n)&&this.hasPadAt(t,n+1)}}getVerticalGap(t,n){let o=this.getSlotCenter(t,n),r=this.getSlotCenter(t+1,n),i=Math.abs(r.y-o.y);return{orientation:"vertical",row:t,col:n,center:{x:o.x,y:W3e((o.y+r.y)/2)},width:this.padWidth,height:i-this.padHeight,isBetweenTwoPads:this.hasPadAt(t,n)&&this.hasPadAt(t+1,n)}}getDiagonalGap(t,n){let o=this.getSlotCenter(t,n),r=this.getSlotCenter(t+1,n+1),i=Math.abs(r.x-o.x),s=Math.abs(r.y-o.y);return{orientation:"diagonal",row:t,col:n,center:{x:W3e((o.x+r.x)/2),y:W3e((o.y+r.y)/2)},width:i-this.padWidth,height:s-this.padHeight,isBetweenTwoPads:this.hasPadAt(t,n)&&this.hasPadAt(t+1,n+1)}}getDiagonalGaps(){let t=[];for(let n=0;n<this.rowCount-1;n++)for(let o=0;o<this.colCount-1;o++)t.push(this.getDiagonalGap(n,o));return t.filter((n)=>n.width>h$&&n.height>h$)}getAxisGaps(){let t=[];for(let n=0;n<this.rowCount;n++)for(let o=0;o<this.colCount-1;o++)t.push(this.getHorizontalGap(n,o));for(let n=0;n<this.rowCount-1;n++)for(let o=0;o<this.colCount;o++)t.push(this.getVerticalGap(n,o));return t.filter((n)=>n.width>h$&&n.height>h$)}getMissingSlots(){let t=[];for(let n=0;n<this.rowCount;n++)for(let o=0;o<this.colCount;o++)this.hasPadAt(n,o)||t.push({row:n,col:o,center:this.getSlotCenter(n,o),width:this.padWidth,height:this.padHeight});return t}};function x6r(e){if([e.point.pointId,e.point.pcb_port_id].filter((o)=>typeof o=="string").some((o)=>e.obstacle.connectedTo.includes(o)))return!0;if(e.obstacle.connectedTo.length===0)return!1;if(_S(e.point,e.obstacle)>0.001)return!1;let t=zx(e.point).map((o)=>ti(o,e.layerCount)),n=e.obstacle.layers.map((o)=>ti(o,e.layerCount));return t.some((o)=>n.includes(o))}function nln(e){return e.obstacleId??[e.componentId??"no-component",e.center.x,e.center.y,e.width,e.height,e.layers.join(",")].join(":")}function oln({componentId:e,orientationKey:t,row:n,col:o,center:r,width:i,height:s}){return["cmn",t,e,n,o,r.x,r.y,i,s].join("_")}function gUt(e){let{componentId:t,bgaGap:n,freeLayers:o,multiLayerThreshold:r}=e,i=n.width>r&&n.height>r,s="d";n.orientation==="horizontal"&&(s="h"),n.orientation==="vertical"&&(s="v");let a=oln({componentId:t,orientationKey:s,row:n.row,col:n.col,center:n.center,width:n.width,height:n.height});return n.orientation==="diagonal"&&i||!n.isBetweenTwoPads&&i?[{center:n.center,width:n.width,height:n.height,availableZ:[...o],capacityMeshNodeId:`${a}_all`,layer:""}]:o.map((c)=>({center:n.center,width:n.width,height:n.height,availableZ:[c],capacityMeshNodeId:`${a}_${c}`,layer:""}))}function C6r(e){let{componentId:t,obstacle:n,freeLayers:o,layerCount:r}=e,i=n.layers.map((c)=>ti(c,r)),s=o.filter((c)=>!i.includes(c)),a=nln(n);return s.map((c)=>({capacityMeshNodeId:`free-${t}-${a}-${c}`,center:n.center,width:n.width,height:n.height,layer:`z${c}`,availableZ:[c]}))}function AUt(e,t,n){let o=t.layers.map((s)=>ti(s,n.layerCount)),r=nln(t),i=function(s){for(let a of s.srj.connections)for(let c of a.pointsToConnect)if(x6r({point:c,obstacle:s.obstacle,layerCount:s.srj.layerCount}))return a.__rootConnectionNames?.[0]??a.name}({obstacle:t,srj:n});return{capacityMeshNodeId:`obstacle-${e}-${r}-${o.join(",")}-${t.center.x}-${t.center.y}`,_containsObstacle:!0,...i?{_containsTarget:!0,_targetConnectionName:i}:{},center:t.center,width:t.width,height:t.height,layer:`z${o.join(",")}`,availableZ:o}}var b6r=class extends fa{constructor(e){super(),this.inputProblem=e}inputProblem;componentObstacles=[];meshNodes=[];getConstructorParams(){return[this.inputProblem]}_step(){let{srj:e,componentBounds:t,componentId:n,markedComponentObstacles:o,unmarkedComponentObstacles:r}=this.inputProblem,i=e.obstacles.filter((u)=>u.isCopperPour===!0).filter((u)=>Sw(Md(u),t)).flatMap((u)=>u.layers.map((_)=>ti(_,e.layerCount))),s=Array.from({length:e.layerCount},(u,_)=>_).filter((u)=>!i.includes(u));if(this.componentObstacles=o,o.length===0||s.length===0)return void(this.solved=!0);let a=y6r.fromObstacles(o);if(!a)return void(this.solved=!0);let c=a.getAxisGaps(),l=a.getDiagonalGaps(),h=a.getMissingSlots(),d=1.2*(this.inputProblem.viaDiameter??Pp(e).padDiameter);this.meshNodes=[...c.flatMap((u)=>gUt({componentId:n,bgaGap:u,freeLayers:s,multiLayerThreshold:d})),...l.flatMap((u)=>gUt({componentId:n,bgaGap:u,freeLayers:s,multiLayerThreshold:d})),...h.flatMap((u)=>function(_){let{componentId:p,missingBgaSlot:m,freeLayers:A,multiLayerThreshold:g}=_,f=oln({componentId:p,orientationKey:"missing",row:m.row,col:m.col,center:m.center,width:m.width,height:m.height});return m.width>g&&m.height>g?[{center:m.center,width:m.width,height:m.height,availableZ:[...A],capacityMeshNodeId:`${f}_all`,layer:""}]:A.map((y)=>({center:m.center,width:m.width,height:m.height,availableZ:[y],capacityMeshNodeId:`${f}_${y}`,layer:""}))}({componentId:n,missingBgaSlot:u,freeLayers:s,multiLayerThreshold:d})),...o.flatMap((u)=>[...C6r({componentId:n,obstacle:u,freeLayers:s,layerCount:e.layerCount}),AUt(n,u,e)]),...r.flatMap((u)=>[AUt(n,u,e)])],this.meshNodes=function(u){let _=new Map;return u.map((p)=>{let m=_.get(p.capacityMeshNodeId)??0;return _.set(p.capacityMeshNodeId,m+1),m===0?p:{...p,capacityMeshNodeId:`${p.capacityMeshNodeId}__dup${m}`}})}(this.meshNodes),this.solved=!0}getOutput(){return this.meshNodes}visualize(){return{rects:[{center:{x:(this.inputProblem.componentBounds.minX+this.inputProblem.componentBounds.maxX)/2,y:(this.inputProblem.componentBounds.minY+this.inputProblem.componentBounds.maxY)/2},width:this.inputProblem.componentBounds.maxX-this.inputProblem.componentBounds.minX,height:this.inputProblem.componentBounds.maxY-this.inputProblem.componentBounds.minY,fill:"rgba(0,0,0,0)",stroke:"rgba(30,30,30,0.65)",label:`component ${this.inputProblem.componentId}`},...this.inputProblem.markedComponentObstacles.map((e)=>({center:e.center,width:e.width,height:e.height,fill:"rgba(255,0,0,0.18)",stroke:"rgba(255,0,0,0.52)",label:`pad ${e.obstacleId??"obstacle"}`})),...this.inputProblem.unmarkedComponentObstacles.map((e)=>({center:e.center,width:e.width,height:e.height,fill:"rgba(255,140,0,0.14)",stroke:"rgba(255,140,0,0.42)",label:`foreign ${e.obstacleId??"obstacle"}`})),...this.meshNodes.map((e)=>({...fA(e,{rectMargin:0.01}),fill:e._containsObstacle?"rgba(255,0,0,0.14)":e.capacityMeshNodeId.includes("missing")?"rgba(0,200,120,0.18)":"rgba(0,120,255,0.12)",stroke:e._containsObstacle?"rgba(255,0,0,0.36)":e.capacityMeshNodeId.includes("missing")?"rgba(0,200,120,0.52)":"rgba(0,120,255,0.38)"}))]}}};function BXe(e){return e.capacityMeshNodeId.startsWith("bga-gapfill-")}function I6r(e){return JSON.stringify({availableZ:[...e.availableZ].sort((t,n)=>t-n),_containsTarget:e._containsTarget??!1,_targetConnectionName:e._targetConnectionName??null,_depth:e._depth??null,_strawNode:e._strawNode??!1,_strawParentCapacityMeshNodeId:e._strawParentCapacityMeshNodeId??null,_qfpRegionType:e._qfpRegionType??null,_isNarrowQfpPadGap:e._isNarrowQfpPadGap??!1,_soicRegionType:e._soicRegionType??null,_offBoardConnectionId:e._offBoardConnectionId??null,_offboardNetName:e._offboardNetName??null,_isVirtualOffboard:e._isVirtualOffboard??!1,_containsObstacle:e._containsObstacle??!1})}function v6r(e,t){let n=Md(e);for(let o of t){if(!e.availableZ.some((i)=>o.availableZ.includes(i)))continue;let r=Md(o);if(Sw(n,r))return!0}return!1}function S6r(e){let t=e[0];if(!t)throw Error("createMergedNode requires at least one source node");let{POSITIVE_INFINITY:n,NEGATIVE_INFINITY:o,POSITIVE_INFINITY:r,NEGATIVE_INFINITY:i}=Number;for(let s of e){let a=Md(s);n=Math.min(n,a.minX),o=Math.max(o,a.maxX),r=Math.min(r,a.minY),i=Math.max(i,a.maxY)}return{...t,capacityMeshNodeId:`merge:${e.map((s)=>s.capacityMeshNodeId).join(":")}`,center:{x:(n+o)/2,y:(r+i)/2},width:o-n,height:i-r}}function Rae(e,t,n){return{center:e.center,width:e.width,height:e.height,fill:t,stroke:t,label:n}}var P6r=class extends fa{constructor(e){super(),this.inputProblem=e}inputProblem;obstacleNodes=[];passthroughNodes=[];mergedNodes=[];pendingGroups=[];totalGroupCount=0;processedGroupCount=0;debugFilteredNodes=[];debugMergeEvents=[];currentGroupKey=null;currentRootNodeId=null;lastMergedNodeId=null;_setup(){this.obstacleNodes=this.inputProblem.meshNodes.filter((t)=>t._containsObstacle===!0),this.passthroughNodes=[],this.mergedNodes=[],this.pendingGroups=[],this.totalGroupCount=0,this.processedGroupCount=0,this.debugFilteredNodes=[],this.debugMergeEvents=[],this.currentGroupKey=null,this.currentRootNodeId=null,this.lastMergedNodeId=null;let e=new Map;for(let t of this.inputProblem.meshNodes){if(t._containsObstacle===!0){this.passthroughNodes.push(t),this.debugFilteredNodes.push({type:"preserved-obstacle",node:t,reason:"contains-obstacle"});continue}if(BXe(t)){this.passthroughNodes.push(t);continue}if(t.availableZ.length!==this.inputProblem.layerCount){this.passthroughNodes.push(t);continue}let n=!1;for(let i=0;i<this.inputProblem.layerCount;i+=1)if(!t.availableZ.includes(i)){n=!0;break}if(n){this.passthroughNodes.push(t);continue}if(v6r(t,this.obstacleNodes)){this.passthroughNodes.push(t),this.debugFilteredNodes.push({type:"preserved-overlap",node:t,reason:"overlaps-obstacle"});continue}let o=I6r(t),r=e.get(o);r?r.push(t):e.set(o,[t])}for(let[t,n]of e.entries())n.length<=1?this.passthroughNodes.push(...n):this.pendingGroups.push({groupKey:t,nodes:n});this.pendingGroups.sort((t,n)=>n.nodes.length-t.nodes.length),this.totalGroupCount=this.pendingGroups.length,this.updateStats("setup")}_step(){let e=this.pendingGroups.shift();if(!e)return this.currentGroupKey=null,this.currentRootNodeId=null,this.solved=!0,void this.updateStats("done");let t=e.nodes[0];this.currentGroupKey=e.groupKey,this.currentRootNodeId=t?t.capacityMeshNodeId:null;let n=function(r){if(!r.nodes[0])return{outputNodes:[],mergeEvents:[]};let{POSITIVE_INFINITY:i,POSITIVE_INFINITY:s,POSITIVE_INFINITY:a,POSITIVE_INFINITY:c}=Number;for(let p of r.nodes){i=Math.min(i,p.width),s=Math.min(s,p.height);let m=Md(p);a=Math.min(a,m.minX),c=Math.min(c,m.minY)}let l=new Map,h=[];for(let p of r.nodes){let m=Md(p),A=Math.round((m.minX-a)/i),g=Math.round((m.minY-c)/s),f=Math.max(1,Math.round(p.width/i)),y=Math.max(1,Math.round(p.height/s));for(let x=0;x<y;x+=1)for(let C=0;C<f;C+=1)l.set(`${A+C},${g+x}`,p);h.push({col:A,row:g})}h.sort((p,m)=>p.row-m.row||p.col-m.col);let d=new Set,u=[],_=[];for(let p of h){let m=`${p.col},${p.row}`;if(d.has(m))continue;let A=0;for(;;){let v=`${p.col+A},${p.row}`;if(!l.has(v))break;if(d.has(v))break;A+=1}let g=A,f=1,y=1,x=1;for(let v=1;;v+=1){let P=p.row+v-1,M=0;for(;M<g;){let B=`${p.col+M},${P}`;if(!l.has(B))break;if(d.has(B))break;M+=1}if(M===0)break;g=Math.min(g,M);for(let B=g;B>=1;B-=1){let T=B*i,N=v*s,D=Math.min(T,N);if((D<=0.000001?Number.POSITIVE_INFINITY:Math.max(T,N)/D)>4)continue;let L=B*v;L>x&&(x=L,f=B,y=v);break}}let C=new Map;for(let v=0;v<y;v+=1)for(let P=0;P<f;P+=1){let M=`${p.col+P},${p.row+v}`,B=l.get(M);B&&(d.add(M),C.set(B.capacityMeshNodeId,B))}let b=[...C.values()];if(b.length<=1){let v=b[0];v&&u.push(v);continue}let I=S6r(b);u.push(I),_.push({type:"merge",groupKey:r.groupKey,sourceNodes:b,mergedNode:I})}return{outputNodes:u,mergeEvents:_}}(e);this.mergedNodes.push(...n.outputNodes),this.processedGroupCount+=1,this.debugMergeEvents.push(...n.mergeEvents);let o=n.mergeEvents[n.mergeEvents.length-1];o&&(this.lastMergedNodeId=o.mergedNode.capacityMeshNodeId),this.updateStats(n.mergeEvents.length>0?"merged-group":"passthrough-group")}computeProgress(){return this.totalGroupCount===0?1:this.processedGroupCount/this.totalGroupCount}updateStats(e){let t=new Set(this.debugMergeEvents.map((o)=>o.groupKey)),n={lastAction:e,totalGroupCount:this.totalGroupCount,processedGroupCount:this.processedGroupCount,pendingGroupCount:this.pendingGroups.length,mergedNodeCount:this.mergedNodes.length,passthroughNodeCount:this.passthroughNodes.length,gapFillNodeCount:this.passthroughNodes.filter(BXe).length,preservedObstacleNodeCount:this.debugFilteredNodes.filter((o)=>o.type==="preserved-obstacle").length,preservedOverlapNodeCount:this.debugFilteredNodes.filter((o)=>o.type==="preserved-overlap").length,mergeCount:this.debugMergeEvents.length,mergedGroupCount:t.size,currentGroupKey:this.currentGroupKey,currentRootNodeId:this.currentRootNodeId,lastMergedNodeId:this.lastMergedNodeId};this.stats=n}getConstructorParams(){return[this.inputProblem]}getOutput(){return[...this.mergedNodes,...this.passthroughNodes]}visualize(){let e=this.getOutput(),t=this.currentRootNodeId?e.find((o)=>o.capacityMeshNodeId===this.currentRootNodeId)??null:null,n=this.lastMergedNodeId?e.find((o)=>o.capacityMeshNodeId===this.lastMergedNodeId)??null:null;return{rects:[...this.debugFilteredNodes.map((o)=>Rae(o.node,o.type==="preserved-obstacle"?"rgba(255,64,64,0.35)":"rgba(255,160,64,0.35)",o.reason)),...this.passthroughNodes.map((o)=>Rae(o,o._containsObstacle?"rgba(255,0,0,0.35)":BXe(o)?"rgba(0,120,255,0.18)":"rgba(160,160,160,0.12)")),...this.mergedNodes.map((o)=>Rae(o,"rgba(120,120,120,0.14)")),...t?[Rae(t,"rgba(255,215,0,0.35)","active-group")]:[],...n?[Rae(n,"rgba(0,200,120,0.28)","merged")]:[]]}}},E6r=class extends fa{constructor(e){super(),this.inputProblem=e}inputProblem;obstacleQueue=[];obstacleQueueIndex=0;meshNodes=[];_setup(){this.obstacleQueue=this.inputProblem.obstacles,this.obstacleQueueIndex=0,this.meshNodes=[...this.inputProblem.meshNodes]}_step(){if(this.obstacleQueueIndex>=this.obstacleQueue.length)return void(this.solved=!0);let e=this.obstacleQueue[this.obstacleQueueIndex],t=e.layers.map((o)=>ti(o,this.inputProblem.layerCount)),n=[];for(let o of this.meshNodes){if(o._containsObstacle){n.push(o);continue}if(!t.some((i)=>o.availableZ.includes(i))){n.push(o);continue}if(!Sw(Md(o),Md(e))){n.push(o);continue}if(o.availableZ.length===1)continue;let r=o.availableZ.filter((i)=>!t.includes(i));for(let i of r){let s={...o,capacityMeshNodeId:`${o.capacityMeshNodeId}:z${i}`,availableZ:[i],layer:`z${i}`};n.push(s)}}this.meshNodes=n,this.obstacleQueueIndex+=1,this.stats={obstaclesProcessed:this.obstacleQueueIndex,obstacleCount:this.obstacleQueue.length,meshNodeCount:this.meshNodes.length}}computeProgress(){return this.obstacleQueue.length===0?1:this.obstacleQueueIndex/this.obstacleQueue.length}getConstructorParams(){return[this.inputProblem]}getOutput(){return this.meshNodes}visualize(){let e=this.obstacleQueueIndex<this.obstacleQueue.length?this.obstacleQueue[this.obstacleQueueIndex]??null:null,t=this.obstacleQueue.slice(0,this.obstacleQueueIndex),n=e?this.obstacleQueue.slice(this.obstacleQueueIndex+1):[];return{rects:[...t.map((o)=>({center:o.center,width:o.width,height:o.height,fill:"rgba(160,160,160,0.10)",stroke:"rgba(160,160,160,0.35)",label:`processed ${o.obstacleId??"obstacle"}`})),...e?[{center:e.center,width:e.width,height:e.height,fill:"rgba(255,140,0,0.22)",stroke:"rgba(255,140,0,0.75)",label:`active ${e.obstacleId??"obstacle"}`}]:[],...n.map((o)=>({center:o.center,width:o.width,height:o.height,fill:"rgba(255,0,0,0.05)",stroke:"rgba(255,0,0,0.22)",label:`pending ${o.obstacleId??"obstacle"}`})),...this.meshNodes.map((o)=>({...fA(o,{rectMargin:0.01}),fill:o._containsObstacle?"rgba(255,0,0,0.18)":"rgba(0,120,255,0.12)",stroke:o._containsObstacle?"rgba(255,0,0,0.45)":"rgba(0,120,255,0.45)"}))]}}};Xle.register(class extends mS{constructor(e){super(e),this.inputProblem=e}inputProblem;static componentKind="bga";initialTopologySolver;removeMeshNodeOverlappingWithUnmarkedObstacle;gapfillDueToNodeRemoval;mergeMeshNodes;markedComponentObstacles=[];unmarkedComponentObstacles=[];pipelineDef=[b0("initialTopologySolver",b6r,(e)=>[{srj:e.inputProblem.inputSrj,componentBounds:e.inputProblem.detectedComponent.bounds,componentId:e.inputProblem.detectedComponent.componentId,markedComponentObstacles:e.markedComponentObstacles,unmarkedComponentObstacles:e.unmarkedComponentObstacles,viaDiameter:e.inputProblem.viaDiameter}]),b0("removeMeshNodeOverlappingWithUnmarkedObstacle",E6r,(e)=>[{meshNodes:e.initialTopologySolver.getOutput(),obstacles:e.unmarkedComponentObstacles,layerCount:e.inputProblem.inputSrj.layerCount}]),b0("gapfillDueToNodeRemoval",f6r,(e)=>[{meshNodes:e.removeMeshNodeOverlappingWithUnmarkedObstacle.getOutput(),unmarkedComponentObstacles:e.unmarkedComponentObstacles,layerCount:e.inputProblem.inputSrj.layerCount}]),b0("mergeMeshNodes",P6r,(e)=>[{meshNodes:e.gapfillDueToNodeRemoval.getOutput(),layerCount:e.inputProblem.inputSrj.layerCount}])];_setup(){let e=this.inputProblem.detectedComponent.bounds,t=this.inputProblem.detectedComponent.componentId,n=[],o=[];for(let r of this.inputProblem.inputSrj.obstacles){let i=Md(r);Sw(e,i)&&(r.componentId!==t?o.push(r):n.push(r))}this.markedComponentObstacles=n,this.unmarkedComponentObstacles=o}getConstructorParams(){return[this.inputProblem]}getOutput(){return{routingRegions:this.mergeMeshNodes?.getOutput()??this.gapfillDueToNodeRemoval?.getOutput()??this.removeMeshNodeOverlappingWithUnmarkedObstacle?.getOutput()??[]}}initialVisualize(){return{rects:[{center:{x:(this.inputProblem.detectedComponent.bounds.minX+this.inputProblem.detectedComponent.bounds.maxX)/2,y:(this.inputProblem.detectedComponent.bounds.minY+this.inputProblem.detectedComponent.bounds.maxY)/2},width:this.inputProblem.detectedComponent.bounds.maxX-this.inputProblem.detectedComponent.bounds.minX,height:this.inputProblem.detectedComponent.bounds.maxY-this.inputProblem.detectedComponent.bounds.minY,fill:"rgba(0,0,0,0)",stroke:"rgba(30,30,30,0.65)",label:`bga ${this.inputProblem.detectedComponent.componentId}`},...this.markedComponentObstacles.map((e)=>({center:e.center,width:e.width,height:e.height,fill:"rgba(255,0,0,0.18)",stroke:"rgba(255,0,0,0.52)",label:`pad ${e.obstacleId??"obstacle"}`})),...this.unmarkedComponentObstacles.map((e)=>({center:e.center,width:e.width,height:e.height,fill:"rgba(255,140,0,0.14)",stroke:"rgba(255,140,0,0.42)",label:`foreign ${e.obstacleId??"obstacle"}`}))]}}finalVisualize(){return{rects:this.getOutput().routingRegions.map((e)=>({...fA(e,{rectMargin:0.01}),fill:e._containsObstacle?"rgba(255,0,0,0.16)":"rgba(0,120,255,0.12)",stroke:e._containsObstacle?"rgba(255,0,0,0.36)":"rgba(0,120,255,0.42)"}))}}});var fUt=0.000001;function b6e(e,t){return e.__zLayers&&e.__zLayers.length>0?Ile(e.__zLayers,t):vle(e.layers,t)}function X3e(e){let t=[...e].sort((i,s)=>i-s),n=[];for(let i=1;i<t.length;i++){let s=t[i]-t[i-1];s>fUt&&n.push(s)}let o=n.length>0?Math.max(fUt,Math.min(...n)/4):0.001,r=[];for(let i of t){let s=r[r.length-1];(s===void 0||Math.abs(i-s)>o)&&r.push(i)}return r}function _Ze(e){return Array.from({length:Math.max(0,e)},(t,n)=>n)}var yUt=0.000001;function rln(e){return e.maxX-e.minX>yUt&&e.maxY-e.minY>yUt}function xUt(e){return function(t){let n=Math.min(t.width,t.height),o=Math.max(t.width,t.height);return n<=0?0:o/n}(e)>=1.5}function M6r(e,t){let n=[{side:"top",distance:Math.abs(e.center.y-t.minY)},{side:"right",distance:Math.abs(t.maxX-e.center.x)},{side:"bottom",distance:Math.abs(t.maxY-e.center.y)},{side:"left",distance:Math.abs(e.center.x-t.minX)}];return n.sort((o,r)=>o.distance-r.distance),n[0].side}function w6r(e,t){return e.map((n,o)=>({key:`pad:${n.obstacleId??o}`,bounds:Pi(n),regionType:"pad",obstacleZ:b6e(n,t),connectedTo:[...n.connectedTo]}))}function B6r(e,t){return e.map((n,o)=>({key:`thermal-pad:${n.obstacleId??o}`,bounds:Pi(n),regionType:"pad",obstacleZ:b6e(n,t),connectedTo:[...n.connectedTo]}))}function iln(e,t){return!!rln(e)&&Math.min(e.maxX-e.minX,e.maxY-e.minY)<=t}function j3e({side:e,sideObstacles:t,bounds:n,innerBounds:o,narrowThreshold:r}){let i=[];for(let s=0;s<t.length-1;s++){let a=Pi(t[s]),c=Pi(t[s+1]),l;l=e==="top"?{minX:a.maxX,maxX:c.minX,minY:n.minY,maxY:o.minY}:e==="right"?{minX:o.maxX,maxX:n.maxX,minY:a.maxY,maxY:c.minY}:e==="bottom"?{minX:a.maxX,maxX:c.minX,minY:o.maxY,maxY:n.maxY}:{minX:n.minX,maxX:o.minX,minY:a.maxY,maxY:c.minY},i.push({key:`${e}-gap-${s}`,bounds:l,regionType:"pad-gap",isNarrowPadGap:iln(l,r)})}return i}function K3e({side:e,sideObstacles:t,thermalPadBounds:n,narrowThreshold:o}){let r=[];for(let i=0;i<t.length;i++){let s=Pi(t[i]),a=t[i-1]?Pi(t[i-1]):null,c=t[i+1]?Pi(t[i+1]):null,l;l=e==="top"?{minX:a?(a.maxX+s.minX)/2:s.minX,maxX:c?(s.maxX+c.minX)/2:s.maxX,minY:s.maxY,maxY:n.minY}:e==="right"?{minX:n.maxX,maxX:s.minX,minY:a?(a.maxY+s.minY)/2:s.minY,maxY:c?(s.maxY+c.minY)/2:s.maxY}:e==="bottom"?{minX:a?(a.maxX+s.minX)/2:s.minX,maxX:c?(s.maxX+c.minX)/2:s.maxX,minY:n.maxY,maxY:s.minY}:{minX:s.maxX,maxX:n.minX,minY:a?(a.maxY+s.minY)/2:s.minY,maxY:c?(s.maxY+c.minY)/2:s.maxY},r.push({key:`inner-${e}-pad-${i}`,bounds:l,regionType:"pad-gap",isNarrowPadGap:iln(l,o)})}return r}function T6r({bounds:e,innerBounds:t,sideGroups:n}){let o=n.top[0]?Pi(n.top[0]):null,r=n.top.at(-1)?Pi(n.top.at(-1)):null,i=n.right[0]?Pi(n.right[0]):null,s=n.right.at(-1)?Pi(n.right.at(-1)):null,a=n.bottom[0]?Pi(n.bottom[0]):null,c=n.bottom.at(-1)?Pi(n.bottom.at(-1)):null,l=n.left[0]?Pi(n.left[0]):null,h=n.left.at(-1)?Pi(n.left.at(-1)):null;return[{key:"corner-nw-outer",regionType:"corner",bounds:{minX:e.minX,maxX:t.minX,minY:e.minY,maxY:t.minY}},{key:"corner-nw-top",regionType:"corner",bounds:{minX:t.minX,maxX:o?.minX??t.minX,minY:e.minY,maxY:t.minY}},{key:"corner-nw-left",regionType:"corner",bounds:{minX:e.minX,maxX:t.minX,minY:t.minY,maxY:l?.minY??t.minY}},{key:"corner-ne-outer",regionType:"corner",bounds:{minX:t.maxX,maxX:e.maxX,minY:e.minY,maxY:t.minY}},{key:"corner-ne-top",regionType:"corner",bounds:{minX:r?.maxX??t.maxX,maxX:t.maxX,minY:e.minY,maxY:t.minY}},{key:"corner-ne-right",regionType:"corner",bounds:{minX:t.maxX,maxX:e.maxX,minY:t.minY,maxY:i?.minY??t.minY}},{key:"corner-se-outer",regionType:"corner",bounds:{minX:t.maxX,maxX:e.maxX,minY:t.maxY,maxY:e.maxY}},{key:"corner-se-right",regionType:"corner",bounds:{minX:t.maxX,maxX:e.maxX,minY:s?.maxY??t.maxY,maxY:t.maxY}},{key:"corner-se-bottom",regionType:"corner",bounds:{minX:c?.maxX??t.maxX,maxX:t.maxX,minY:t.maxY,maxY:e.maxY}},{key:"corner-sw-outer",regionType:"corner",bounds:{minX:e.minX,maxX:t.minX,minY:t.maxY,maxY:e.maxY}},{key:"corner-sw-bottom",regionType:"corner",bounds:{minX:t.minX,maxX:a?.minX??t.minX,minY:t.maxY,maxY:e.maxY}},{key:"corner-sw-left",regionType:"corner",bounds:{minX:e.minX,maxX:t.minX,minY:h?.maxY??t.maxY,maxY:t.maxY}}]}function D6r({innerBounds:e,thermalPadBounds:t,sideGroups:n}){let o=n.top[0]?Pi(n.top[0]):null,r=n.top.at(-1)?Pi(n.top.at(-1)):null,i=n.right[0]?Pi(n.right[0]):null,s=n.right.at(-1)?Pi(n.right.at(-1)):null,a=n.bottom[0]?Pi(n.bottom[0]):null,c=n.bottom.at(-1)?Pi(n.bottom.at(-1)):null,l=n.left[0]?Pi(n.left[0]):null,h=n.left.at(-1)?Pi(n.left.at(-1)):null;return[{key:"inner-corner-nw-core",regionType:"corner",bounds:{minX:e.minX,maxX:t.minX,minY:e.minY,maxY:t.minY}},{key:"inner-corner-nw-top",regionType:"corner",bounds:{minX:t.minX,maxX:o?.minX??t.minX,minY:e.minY,maxY:t.minY}},{key:"inner-corner-nw-left",regionType:"corner",bounds:{minX:e.minX,maxX:t.minX,minY:t.minY,maxY:l?.minY??t.minY}},{key:"inner-corner-ne-core",regionType:"corner",bounds:{minX:t.maxX,maxX:e.maxX,minY:e.minY,maxY:t.minY}},{key:"inner-corner-ne-top",regionType:"corner",bounds:{minX:r?.maxX??t.maxX,maxX:t.maxX,minY:e.minY,maxY:t.minY}},{key:"inner-corner-ne-right",regionType:"corner",bounds:{minX:t.maxX,maxX:e.maxX,minY:t.minY,maxY:i?.minY??t.minY}},{key:"inner-corner-se-core",regionType:"corner",bounds:{minX:t.maxX,maxX:e.maxX,minY:t.maxY,maxY:e.maxY}},{key:"inner-corner-se-right",regionType:"corner",bounds:{minX:t.maxX,maxX:e.maxX,minY:s?.maxY??t.maxY,maxY:t.maxY}},{key:"inner-corner-se-bottom",regionType:"corner",bounds:{minX:c?.maxX??t.maxX,maxX:t.maxX,minY:t.maxY,maxY:e.maxY}},{key:"inner-corner-sw-core",regionType:"corner",bounds:{minX:e.minX,maxX:t.minX,minY:t.maxY,maxY:e.maxY}},{key:"inner-corner-sw-bottom",regionType:"corner",bounds:{minX:t.minX,maxX:a?.minX??t.minX,minY:t.maxY,maxY:e.maxY}},{key:"inner-corner-sw-left",regionType:"corner",bounds:{minX:e.minX,maxX:t.minX,minY:h?.maxY??t.maxY,maxY:t.maxY}}]}Xle.register(class extends fa{constructor(e){super(),this.inputProblem=e}inputProblem;static componentKind="qfp_thermalpad";output=null;getConstructorParams(){return[this.inputProblem]}_step(){if(this.output)return void(this.solved=!0);let{layerCount:e,obstacles:t}=this.inputProblem.inputSrj,{bounds:n,componentId:o}=this.inputProblem.detectedComponent,r=_Ze(e),i=t.filter((f)=>f.componentId===o),s=i.length>0?i:t,{padRingObstacles:a,thermalPadObstacles:c}=function(f){return{padRingObstacles:f.filter(xUt),thermalPadObstacles:f.filter((y)=>!xUt(y))}}(s),l=function(f,y){let x={top:[],right:[],bottom:[],left:[]};for(let C of f)x[M6r(C,y)].push(C);return x.top.sort((C,b)=>C.center.x-b.center.x),x.bottom.sort((C,b)=>C.center.x-b.center.x),x.left.sort((C,b)=>C.center.y-b.center.y),x.right.sort((C,b)=>C.center.y-b.center.y),x}(a,n),h=function({bounds:f,sideGroups:y}){return{minX:y.left.length>0?Math.max(...y.left.map((x)=>Pi(x).maxX)):f.minX,maxX:y.right.length>0?Math.min(...y.right.map((x)=>Pi(x).minX)):f.maxX,minY:y.top.length>0?Math.max(...y.top.map((x)=>Pi(x).maxY)):f.minY,maxY:y.bottom.length>0?Math.min(...y.bottom.map((x)=>Pi(x).minY)):f.maxY}}({bounds:n,sideGroups:l}),d=function(f){return f.length===0?null:f.reduce((y,x)=>{let C=Pi(x);return{minX:Math.min(y.minX,C.minX),maxX:Math.max(y.maxX,C.maxX),minY:Math.min(y.minY,C.minY),maxY:Math.max(y.maxY,C.maxY)}},Pi(f[0]))}(c);if(!d)return this.failed=!0,void(this.error="QfpThermalPadTopologyGeneratorSolver requires a thermal pad");let u=o,_=this.inputProblem.viaDiameter??Pp(this.inputProblem.inputSrj).padDiameter,p=this.inputProblem.obstacleMargin??this.inputProblem.inputSrj.defaultObstacleMargin??0.15,m=_+2*p,A=this.inputProblem.inputSrj.minTraceWidth+2*p,g=[...w6r(a,e),...B6r(c,e),...j3e({side:"top",sideObstacles:l.top,bounds:n,innerBounds:h,narrowThreshold:A}),...j3e({side:"right",sideObstacles:l.right,bounds:n,innerBounds:h,narrowThreshold:A}),...j3e({side:"bottom",sideObstacles:l.bottom,bounds:n,innerBounds:h,narrowThreshold:A}),...j3e({side:"left",sideObstacles:l.left,bounds:n,innerBounds:h,narrowThreshold:A}),...K3e({side:"top",sideObstacles:l.top,thermalPadBounds:d,narrowThreshold:A}),...K3e({side:"right",sideObstacles:l.right,thermalPadBounds:d,narrowThreshold:A}),...K3e({side:"bottom",sideObstacles:l.bottom,thermalPadBounds:d,narrowThreshold:A}),...K3e({side:"left",sideObstacles:l.left,thermalPadBounds:d,narrowThreshold:A}),...D6r({innerBounds:h,thermalPadBounds:d,sideGroups:l}),...T6r({bounds:n,innerBounds:h,sideGroups:l})].flatMap((f)=>function({nodeId:y,bounds:x,availableZ:C,multiLayerThreshold:b,regionType:I,isNarrowPadGap:v=!1,obstacleZ:P=[],connectedTo:M}){if(!rln(x))return[];let B=function(D){return{center:{x:(D.minX+D.maxX)/2,y:(D.minY+D.maxY)/2},width:D.maxX-D.minX,height:D.maxY-D.minY}}(x),T=Math.min(B.width,B.height)>b,N=T?[{availableZ:C.filter((D)=>!P.includes(D)),containsObstacle:!1},{availableZ:C.filter((D)=>P.includes(D)),containsObstacle:!0}].filter((D)=>D.availableZ.length>0):C.map((D)=>({availableZ:[D],containsObstacle:P.includes(D)}));return N.map((D)=>({capacityMeshNodeId:N.length===1?y:T?`${y}:${D.containsObstacle?"obstacle":"free"}`:`${y}:z${D.availableZ[0]}`,center:B.center,width:B.width,height:B.height,layer:`z${D.availableZ.join(",")}`,availableZ:D.availableZ,_qfpRegionType:I,_isNarrowQfpPadGap:v,_containsObstacle:D.containsObstacle,_connectedTo:D.containsObstacle?M:void 0}))}({nodeId:`qfp_thermalpad:${u}:${f.key}`,bounds:f.bounds,availableZ:r,multiLayerThreshold:m,regionType:f.regionType,isNarrowPadGap:f.isNarrowPadGap,obstacleZ:f.obstacleZ,connectedTo:f.connectedTo}));this.output={routingRegions:g},this.stats={componentId:o,layerCount:e,viaDiameter:_,obstacleMargin:p,multiLayerThreshold:m,narrowPadGapThreshold:A,thermalPadCount:c.length,perimeterPadCount:a.length,innerCornerRectCount:g.filter((f)=>f.capacityMeshNodeId.includes(":inner-corner-")).length,narrowPadGapNodeCount:g.filter((f)=>f._isNarrowQfpPadGap).length,topPadCount:l.top.length,rightPadCount:l.right.length,bottomPadCount:l.bottom.length,leftPadCount:l.left.length,multiLayerNodeCount:g.filter((f)=>f.availableZ.length>1).length,totalMeshNodeCount:g.length},this.solved=!0}getOutput(){if(!this.output)throw Error("QfpThermalPadTopologyGeneratorSolver has not solved yet");return this.output}});var CUt=0.000001;function sln(e){return e.maxX-e.minX>CUt&&e.maxY-e.minY>CUt}function N6r(e,t){let n=[{side:"top",distance:Math.abs(e.center.y-t.minY)},{side:"right",distance:Math.abs(t.maxX-e.center.x)},{side:"bottom",distance:Math.abs(t.maxY-e.center.y)},{side:"left",distance:Math.abs(e.center.x-t.minX)}];return n.sort((o,r)=>o.distance-r.distance),n[0].side}function R6r(e,t){return e.map((n,o)=>({key:`pad:${n.obstacleId??o}`,bounds:Pi(n),regionType:"pad",obstacleZ:b6e(n,t),connectedTo:[...n.connectedTo]}))}function Q6r(e,t){return!!sln(e)&&Math.min(e.maxX-e.minX,e.maxY-e.minY)<=t}function $3e({side:e,sideObstacles:t,bounds:n,centralBounds:o,narrowThreshold:r}){let i=[];for(let s=0;s<t.length-1;s++){let a=Pi(t[s]),c=Pi(t[s+1]),l;l=e==="top"?{minX:a.maxX,maxX:c.minX,minY:n.minY,maxY:o.minY}:e==="right"?{minX:o.maxX,maxX:n.maxX,minY:a.maxY,maxY:c.minY}:e==="bottom"?{minX:a.maxX,maxX:c.minX,minY:o.maxY,maxY:n.maxY}:{minX:n.minX,maxX:o.minX,minY:a.maxY,maxY:c.minY},i.push({key:`${e}-gap-${s}`,bounds:l,regionType:"pad-gap",isNarrowPadGap:Q6r(l,r)})}return i}function k6r({bounds:e,centralBounds:t,sideGroups:n}){let o=n.top[0]?Pi(n.top[0]):null,r=n.top.at(-1)?Pi(n.top.at(-1)):null,i=n.right[0]?Pi(n.right[0]):null,s=n.right.at(-1)?Pi(n.right.at(-1)):null,a=n.bottom[0]?Pi(n.bottom[0]):null,c=n.bottom.at(-1)?Pi(n.bottom.at(-1)):null,l=n.left[0]?Pi(n.left[0]):null,h=n.left.at(-1)?Pi(n.left.at(-1)):null;return[{key:"corner-nw-outer",regionType:"corner",bounds:{minX:e.minX,maxX:t.minX,minY:e.minY,maxY:t.minY}},{key:"corner-nw-top",regionType:"corner",bounds:{minX:t.minX,maxX:o?.minX??t.minX,minY:e.minY,maxY:t.minY}},{key:"corner-nw-left",regionType:"corner",bounds:{minX:e.minX,maxX:t.minX,minY:t.minY,maxY:l?.minY??t.minY}},{key:"corner-ne-outer",regionType:"corner",bounds:{minX:t.maxX,maxX:e.maxX,minY:e.minY,maxY:t.minY}},{key:"corner-ne-top",regionType:"corner",bounds:{minX:r?.maxX??t.maxX,maxX:t.maxX,minY:e.minY,maxY:t.minY}},{key:"corner-ne-right",regionType:"corner",bounds:{minX:t.maxX,maxX:e.maxX,minY:t.minY,maxY:i?.minY??t.minY}},{key:"corner-se-outer",regionType:"corner",bounds:{minX:t.maxX,maxX:e.maxX,minY:t.maxY,maxY:e.maxY}},{key:"corner-se-right",regionType:"corner",bounds:{minX:t.maxX,maxX:e.maxX,minY:s?.maxY??t.maxY,maxY:t.maxY}},{key:"corner-se-bottom",regionType:"corner",bounds:{minX:c?.maxX??t.maxX,maxX:t.maxX,minY:t.maxY,maxY:e.maxY}},{key:"corner-sw-outer",regionType:"corner",bounds:{minX:e.minX,maxX:t.minX,minY:t.maxY,maxY:e.maxY}},{key:"corner-sw-bottom",regionType:"corner",bounds:{minX:t.minX,maxX:a?.minX??t.minX,minY:t.maxY,maxY:e.maxY}},{key:"corner-sw-left",regionType:"corner",bounds:{minX:e.minX,maxX:t.minX,minY:h?.maxY??t.maxY,maxY:t.maxY}}]}Xle.register(class extends fa{constructor(e){super(),this.inputProblem=e}inputProblem;static componentKind="qfp";output=null;getConstructorParams(){return[this.inputProblem]}_step(){if(this.output)return void(this.solved=!0);let{layerCount:e,obstacles:t}=this.inputProblem.inputSrj,{bounds:n,componentId:o}=this.inputProblem.detectedComponent,r=_Ze(e),i=t.filter((m)=>m.componentId===o),s=i.length>0?i:t,a=function(m,A){let g={top:[],right:[],bottom:[],left:[]};for(let f of m)g[N6r(f,A)].push(f);return g.top.sort((f,y)=>f.center.x-y.center.x),g.bottom.sort((f,y)=>f.center.x-y.center.x),g.left.sort((f,y)=>f.center.y-y.center.y),g.right.sort((f,y)=>f.center.y-y.center.y),g}(s,n),c=function({bounds:m,sideGroups:A}){return{minX:A.left.length>0?Math.max(...A.left.map((g)=>Pi(g).maxX)):m.minX,maxX:A.right.length>0?Math.min(...A.right.map((g)=>Pi(g).minX)):m.maxX,minY:A.top.length>0?Math.max(...A.top.map((g)=>Pi(g).maxY)):m.minY,maxY:A.bottom.length>0?Math.min(...A.bottom.map((g)=>Pi(g).minY)):m.maxY}}({bounds:n,sideGroups:a}),l=o,h=this.inputProblem.viaDiameter??Pp(this.inputProblem.inputSrj).padDiameter,d=this.inputProblem.obstacleMargin??this.inputProblem.inputSrj.defaultObstacleMargin??0.15,u=h+2*d,_=this.inputProblem.inputSrj.minTraceWidth+2*d,p=[{key:"center",bounds:c,regionType:"center"},...R6r(s,e),...$3e({side:"top",sideObstacles:a.top,bounds:n,centralBounds:c,narrowThreshold:_}),...$3e({side:"right",sideObstacles:a.right,bounds:n,centralBounds:c,narrowThreshold:_}),...$3e({side:"bottom",sideObstacles:a.bottom,bounds:n,centralBounds:c,narrowThreshold:_}),...$3e({side:"left",sideObstacles:a.left,bounds:n,centralBounds:c,narrowThreshold:_}),...k6r({bounds:n,centralBounds:c,sideGroups:a})].flatMap((m)=>function({nodeId:A,bounds:g,availableZ:f,multiLayerThreshold:y,regionType:x,isNarrowPadGap:C=!1,obstacleZ:b=[],connectedTo:I}){if(!sln(g))return[];let v=function(B){return{center:{x:(B.minX+B.maxX)/2,y:(B.minY+B.maxY)/2},width:B.maxX-B.minX,height:B.maxY-B.minY}}(g),P=Math.min(v.width,v.height)>y,M=P?[{availableZ:f.filter((B)=>!b.includes(B)),containsObstacle:!1},{availableZ:f.filter((B)=>b.includes(B)),containsObstacle:!0}].filter((B)=>B.availableZ.length>0):f.map((B)=>({availableZ:[B],containsObstacle:b.includes(B)}));return M.map((B)=>({capacityMeshNodeId:M.length===1?A:P?`${A}:${B.containsObstacle?"obstacle":"free"}`:`${A}:z${B.availableZ[0]}`,center:v.center,width:v.width,height:v.height,layer:`z${B.availableZ.join(",")}`,availableZ:B.availableZ,_qfpRegionType:x,_isNarrowQfpPadGap:C,_containsObstacle:B.containsObstacle,_connectedTo:B.containsObstacle?I:void 0}))}({nodeId:`qfp:${l}:${m.key}`,bounds:m.bounds,availableZ:r,multiLayerThreshold:u,regionType:m.regionType,isNarrowPadGap:m.isNarrowPadGap,obstacleZ:m.obstacleZ,connectedTo:m.connectedTo}));this.output={routingRegions:p},this.stats={componentId:o,layerCount:e,viaDiameter:h,obstacleMargin:d,multiLayerThreshold:u,narrowPadGapThreshold:_,narrowPadGapNodeCount:p.filter((m)=>m._isNarrowQfpPadGap).length,topPadCount:a.top.length,rightPadCount:a.right.length,bottomPadCount:a.bottom.length,leftPadCount:a.left.length,multiLayerNodeCount:p.filter((m)=>m.availableZ.length>1).length,totalMeshNodeCount:p.length},this.solved=!0}getOutput(){if(!this.output)throw Error("QfpTopologyGeneratorSolver has not solved yet");return this.output}});var bUt=0.000001;function L6r({nodeId:e,bounds:t,availableZ:n,multiLayerThreshold:o,regionType:r,obstacleZ:i=[],connectedTo:s}){if(!function(h){return h.maxX-h.minX>bUt&&h.maxY-h.minY>bUt}(t))return[];let a=function(h){return{center:{x:(h.minX+h.maxX)/2,y:(h.minY+h.maxY)/2},width:h.maxX-h.minX,height:h.maxY-h.minY}}(t),c=Math.min(a.width,a.height)>o,l=c?[{availableZ:n.filter((h)=>!i.includes(h)),containsObstacle:!1},{availableZ:n.filter((h)=>i.includes(h)),containsObstacle:!0}].filter((h)=>h.availableZ.length>0):n.map((h)=>({availableZ:[h],containsObstacle:i.includes(h)}));return l.map((h)=>({capacityMeshNodeId:l.length===1?e:c?`${e}:${h.containsObstacle?"obstacle":"free"}`:`${e}:z${h.availableZ[0]}`,center:a.center,width:a.width,height:a.height,layer:`z${h.availableZ.join(",")}`,availableZ:h.availableZ,_soicRegionType:r,_containsObstacle:h.containsObstacle,_connectedTo:h.containsObstacle?s:void 0}))}function IUt(e,t){let n=0,o=Number.POSITIVE_INFINITY;for(let r=0;r<t.length;r++){let i=Math.abs(e-t[r]);i<o&&(n=r,o=i)}return n}function H6r(e,t){return e.map((n,o)=>({key:`pad:${n.obstacleId??o}`,bounds:Pi(n),regionType:"pad",obstacleZ:b6e(n,t),connectedTo:[...n.connectedTo]}))}function e$e(e,t){if(e.componentId!==t.componentId)return!1;let{bounds:n}=t;return e.center.x>=n.minX&&e.center.x<=n.maxX&&e.center.y>=n.minY&&e.center.y<=n.maxY}function vUt({detectedComponent:e,inputSrj:t}){let n=t.obstacles.filter((a)=>e$e(a,e)),o=Array.from({length:t.layerCount},(a,c)=>c),r=o.map((a)=>Nh(a,t.layerCount)),i=Array.from(new Set(n.flatMap((a)=>a.connectedTo))),{bounds:s}=e;return{obstacleId:`${e.componentId}_component_bounds`,componentId:e.componentId,type:"rect",layers:r,__zLayers:o,center:{x:(s.minX+s.maxX)/2,y:(s.minY+s.maxY)/2},width:s.maxX-s.minX,height:s.maxY-s.minY,connectedTo:i}}function I6e(e){if(e.length===0)return{minX:0,maxX:0,minY:0,maxY:0};let{POSITIVE_INFINITY:t,NEGATIVE_INFINITY:n,POSITIVE_INFINITY:o,NEGATIVE_INFINITY:r}=Number;for(let i of e){let s=Pi(i);t=Math.min(t,s.minX),n=Math.max(n,s.maxX),o=Math.min(o,s.minY),r=Math.max(r,s.maxY)}return{minX:t,maxX:n,minY:o,maxY:r}}function F6r(e){let t=e.componentDetectionOutput??[],n=function({detectedComponents:i,inputSrj:s}){return i.map((a)=>{let c=s.obstacles.filter((l)=>e$e(l,a));return{componentId:a.componentId,componentKind:a.componentKind,memberObstacleIds:c.map((l,h)=>l.obstacleId??`${a.componentId}:member:${h}`),memberObstacles:c,replacementObstacle:vUt({detectedComponent:a,inputSrj:s})}})}({detectedComponents:t,inputSrj:e.inputSrj}),o=e.globalNoConnectionSrj??(t.length>0?function({detectedComponents:i,inputSrj:s}){return{...structuredClone(s),obstacles:[...s.obstacles.filter((a)=>!i.some((c)=>e$e(a,c))),...i.map((a)=>vUt({detectedComponent:a,inputSrj:s}))]}}({detectedComponents:t,inputSrj:e.inputSrj}):e.inputSrj)??e.brokenSrj?.componentsAsObstaclesSrj,r=e.components??n??e.brokenSrj?.components??[];if(!o)throw Error("MultiGraphTopologyPlannerSolver requires globalNoConnectionSrj or detected components");return{globalNoConnectionSrj:o,components:r}}function z6r({rects:e,components:t}){return e&&t.length!==0?e.filter((n)=>!function(o){return typeof o.label=="string"&&o.label.startsWith("node ")}(n)||!t.some((o)=>function({rect:r,obstacle:i}){if(!r.center||r.width===void 0||r.height===void 0)return!1;let s=0.000000001,a=Md({center:r.center,width:r.width,height:r.height}),c=Md({center:i.center,width:i.width,height:i.height});return aln({bounds:a,outerBounds:c,epsilon:s})}({rect:n,obstacle:o.replacementObstacle}))):e}function aln({bounds:e,outerBounds:t,epsilon:n}){return e.minX>=t.minX-n&&e.maxX<=t.maxX+n&&e.minY>=t.minY-n&&e.maxY<=t.maxY+n}Xle.register(class extends fa{constructor(e){super(),this.inputProblem=e}inputProblem;static componentKind="soic";output=null;getConstructorParams(){return[this.inputProblem]}_step(){if(this.output)return void(this.solved=!0);let{layerCount:e,obstacles:t}=this.inputProblem.inputSrj,{bounds:n,componentId:o}=this.inputProblem.detectedComponent,r=_Ze(e),i=t.filter((g)=>g.componentId===o),s=i.length>0?i:t,a=function(g){let f=X3e(g.map((y)=>y.center.y)).length;return X3e(g.map((y)=>y.center.x)).length===2&&f!==2?"vertical-columns":"horizontal-rows"}(s),c=function({obstacles:g,orientation:f}){let y={left:[],right:[],top:[],bottom:[]};if(f==="vertical-columns"){let C=X3e(g.map((b)=>b.center.x));for(let b of g)y[IUt(b.center.x,C)===0?"left":"right"].push(b);return y.left.sort((b,I)=>b.center.y-I.center.y),y.right.sort((b,I)=>b.center.y-I.center.y),y}let x=X3e(g.map((C)=>C.center.y));for(let C of g)y[IUt(C.center.y,x)===0?"top":"bottom"].push(C);return y.top.sort((C,b)=>C.center.x-b.center.x),y.bottom.sort((C,b)=>C.center.x-b.center.x),y}({obstacles:s,orientation:a}),l=function({bounds:g,orientation:f,sideGroups:y}){return f==="vertical-columns"?{minX:Math.max(...y.left.map((x)=>Pi(x).maxX)),maxX:Math.min(...y.right.map((x)=>Pi(x).minX)),minY:g.minY,maxY:g.maxY}:{minX:g.minX,maxX:g.maxX,minY:Math.max(...y.top.map((x)=>Pi(x).maxY)),maxY:Math.min(...y.bottom.map((x)=>Pi(x).minY))}}({bounds:n,orientation:a,sideGroups:c}),h=o,d=this.inputProblem.viaDiameter??Pp(this.inputProblem.inputSrj).padDiameter,u=this.inputProblem.obstacleMargin??this.inputProblem.inputSrj.defaultObstacleMargin??0.15,_=2*(d+u),p=a==="vertical-columns"?["left","right"]:["top","bottom"],m=[{key:"center",bounds:l,regionType:"center"},...H6r(s,e),...p.flatMap((g)=>function({side:f,sideObstacles:y,bounds:x,centralBounds:C}){let b=[];for(let I=0;I<y.length-1;I++){let v=Pi(y[I]),P=Pi(y[I+1]),M;M=f==="left"?{minX:x.minX,maxX:C.minX,minY:v.maxY,maxY:P.minY}:f==="right"?{minX:C.maxX,maxX:x.maxX,minY:v.maxY,maxY:P.minY}:f==="top"?{minX:v.maxX,maxX:P.minX,minY:x.minY,maxY:C.minY}:{minX:v.maxX,maxX:P.minX,minY:C.maxY,maxY:x.maxY},b.push({key:`${f}-gap-${I}`,bounds:M,regionType:"pad-gap"})}return b}({side:g,sideObstacles:c[g],bounds:n,centralBounds:l}))],A=m.flatMap((g)=>L6r({nodeId:`soic:${h}:${g.key}`,bounds:g.bounds,availableZ:r,multiLayerThreshold:_,regionType:g.regionType,obstacleZ:g.obstacleZ,connectedTo:g.connectedTo}));this.output={routingRegions:A},this.stats={componentId:o,layerCount:e,orientation:a,viaDiameter:d,obstacleMargin:u,multiLayerThreshold:_,firstSidePadCount:c[p[0]].length,secondSidePadCount:c[p[1]].length,multiLayerNodeCount:A.filter((g)=>g.availableZ.length>1).length,totalMeshNodeCount:A.length},this.solved=!0}getOutput(){if(!this.output)throw Error("SoicTopologyGeneratorSolver has not solved yet");return this.output}});var O6r=class extends fa{constructor(e){super(),this.inputProblem=e}inputProblem;activeSubSolver=null;currentIndex=0;componentMeshNodes=[];getConstructorParams(){return[this.inputProblem]}_step(){if(this.activeSubSolver){if(this.activeSubSolver.step(),this.activeSubSolver.failed)return this.error=this.activeSubSolver.error,this.failed=!0,void(this.activeSubSolver=null);if(!this.activeSubSolver.solved)return;return this.componentMeshNodes.push(this.activeSubSolver.getOutput().routingRegions),this.currentIndex+=1,void(this.activeSubSolver=null)}if(this.currentIndex>=this.inputProblem.componentSrjs.length)return void(this.solved=!0);let e=this.inputProblem.componentKinds[this.currentIndex],t=this.inputProblem.componentSrjs[this.currentIndex],n={inputSrj:t,detectedComponent:{componentId:this.inputProblem.componentIds[this.currentIndex],componentKind:e,bounds:{__type:"rect",...t.bounds}},viaDiameter:this.inputProblem.viaDiameter,obstacleMargin:this.inputProblem.obstacleMargin};this.activeSubSolver=Xle.create(n)}getOutput(){return{componentMeshNodes:this.componentMeshNodes}}visualize(){if(this.activeSubSolver)return this.activeSubSolver.visualize();let e=this.inputProblem.componentSrjs[this.currentIndex]??null,t=this.componentMeshNodes.flatMap((n)=>n);return{rects:[...e?[{center:{x:(e.bounds.minX+e.bounds.maxX)/2,y:(e.bounds.minY+e.bounds.maxY)/2},width:e.bounds.maxX-e.bounds.minX,height:e.bounds.maxY-e.bounds.minY,fill:"rgba(0,0,0,0)",stroke:"rgba(255,140,0,0.72)",label:`active component ${this.inputProblem.componentIds[this.currentIndex]??this.currentIndex}`},...e.obstacles.map((n)=>({center:n.center,width:n.width,height:n.height,fill:"rgba(255,140,0,0.10)",stroke:"rgba(255,140,0,0.30)",label:n.obstacleId??n.componentId??"obstacle"}))]:[],...t.map((n)=>({...fA(n,{rectMargin:0.01}),fill:n._containsObstacle?"rgba(255,0,0,0.14)":"rgba(0,120,255,0.12)",stroke:n._containsObstacle?"rgba(255,0,0,0.34)":"rgba(0,120,255,0.38)"}))]}}},_V=0.001;function Abe(e){let t=[...e].sort((o,r)=>o-r),n=[];for(let o of t){let r=n[n.length-1];(r===void 0||Math.abs(o-r)>_V)&&n.push(o)}return n}function SUt(e){let t=Math.min(...e),n=Math.max(...e);return!(t<=0)&&n/t<=1.01}function V6r(e){if(!function(s){return SUt(s.map((a)=>a.width))&&SUt(s.map((a)=>a.height))}(e))return!1;if(!function(s){return s.every((a)=>{let c=Math.min(a.width,a.height),l=Math.max(a.width,a.height);return!(c<=0)&&l/c<=1.5})}(e))return!1;let t=Abe(e.map((s)=>s.center.y)),n=Abe(e.map((s)=>s.center.x)),o=t.length,r=n.length;if(o<3||r<3)return!1;let i=o*r;return!((i>0?e.length/i:0)<0.5)&&!!function(s,a,c){if(a.length<3)return!1;if(c.length<3)return!1;let l=new Set(a.slice(1,-1)),h=new Set(c.slice(1,-1)),d=0;for(let u of s)l.has(u.center.y)&&h.has(u.center.x)&&(d+=1);return d>=1}(e,t,n)}function Y6r(e){return[Math.round(e.width/_V),Math.round(e.height/_V),e.layers.join(",")].join(":")}function PUt(e){if(e.length<3)return!1;let t=[...e].sort((o,r)=>o-r),n=t[1]-t[0];return!(n<=_V)&&t.every((o,r)=>r===0||Math.abs(o-t[r-1]-n)<=_V)}function G6r(e){let t=function(o){let r=new Map;for(let i of o){let s=Math.round(i.center.y/_V),a=Math.round(i.center.x/_V),c=r.get(s)??{y:i.center.y,obstaclesByX:new Map};c.obstaclesByX.set(a,i),r.set(s,c)}return[...r.values()]}(e),n=[];for(let o of t){let r=[...o.obstaclesByX.keys()];if(!PUt([...o.obstaclesByX.values()].map((a)=>a.center.x)))continue;let i=t.filter((a)=>r.every((c)=>a.obstaclesByX.has(c)));if(!PUt(i.map((a)=>a.y)))continue;let s=i.flatMap((a)=>r.map((c)=>a.obstaclesByX.get(c)));s.length>n.length&&(n=s)}return n}function cln(e){if(V6r(e))return e;let t=Map.groupBy(e,Y6r),n=[];for(let o of t.values()){let r=G6r(o);r.length>n.length&&(n=r)}return n.length>0?n:null}function EUt(e){let t=Math.min(e.width,e.height),n=Math.max(e.width,e.height);return t>0&&n/t>=1.5}function MUt({perimeterPadObstacles:e,thermalPadObstacles:t}){if(t.length===0)return!0;if(t.length>4)return!1;let n=I6e(e),o=n.maxX-n.minX,r=n.maxY-n.minY,i=n.minX+0.2*o,s=n.maxX-0.2*o,a=n.minY+0.2*r,c=n.maxY-0.2*r,l=Math.min(...e.map((h)=>Math.min(h.width,h.height)));return t.every((h)=>{let d=Math.min(h.width,h.height);return h.center.x>=i&&h.center.x<=s&&h.center.y>=a&&h.center.y<=c&&d>l})}function wUt(e){if(e.length<12)return!1;if(e.length>32)return!1;let{counts:t,maxNearestSideRatio:n}=function(o){let r=I6e(o),i=r.maxX-r.minX,s=r.maxY-r.minY,a={top:0,right:0,bottom:0,left:0};if(i<=0||s<=0)return{counts:a,maxNearestSideRatio:1};let c=0;for(let l of o){let h=l.width>l.height,d=[{side:"top",distance:Math.abs(l.center.y-r.minY),axisSpan:s,orientationMatches:!h},{side:"right",distance:Math.abs(r.maxX-l.center.x),axisSpan:i,orientationMatches:h},{side:"bottom",distance:Math.abs(r.maxY-l.center.y),axisSpan:s,orientationMatches:!h},{side:"left",distance:Math.abs(l.center.x-r.minX),axisSpan:i,orientationMatches:h}].filter((u)=>u.orientationMatches).sort((u,_)=>u.distance-_.distance)[0];a[d.side]+=1,c=Math.max(c,d.distance/d.axisSpan)}return{counts:a,maxNearestSideRatio:c}}(e);return t.top>=3&&t.right>=3&&t.bottom>=3&&t.left>=3&&n<=0.25}function BUt(e){return{perimeterPadObstacles:function(n){return n.filter(EUt)}(e),thermalPadObstacles:e.filter((n)=>!EUt(n))}}function TUt(e){let t=Math.min(...e),n=Math.max(...e);return!(t<=0)&&n/t<=1.01}function DUt(e,t){let n=0,o=Number.POSITIVE_INFINITY;for(let r=0;r<t.length;r++){let i=Math.abs(e-t[r]);i<o&&(n=r,o=i)}return n}function U6r({memberObstacles:e,inputSrj:t}){if(!function(i){return TUt(i.map((s)=>s.width))&&TUt(i.map((s)=>s.height))}(e))return!1;let n=Abe(e.map((i)=>i.center.y)),o=Abe(e.map((i)=>i.center.x));if(!(n.length===2&&o.length>=4||o.length===2&&n.length>=4))return!1;let r=function({memberObstacles:i,rowAxisValues:s,columnAxisValues:a}){if(s.length===2&&a.length>=4){let c=[[],[]];for(let l of i)c[DUt(l.center.y,s)].push(l);return Math.min(...c[1].map((l)=>l.center.y-l.height/2))-Math.max(...c[0].map((l)=>l.center.y+l.height/2))}if(a.length===2&&s.length>=4){let c=[[],[]];for(let l of i)c[DUt(l.center.x,a)].push(l);return Math.min(...c[1].map((l)=>l.center.x-l.width/2))-Math.max(...c[0].map((l)=>l.center.x+l.width/2))}return null}({memberObstacles:e,rowAxisValues:n,columnAxisValues:o});if(r===null)return!1;return r>2*(Pp(t).padDiameter+(t.defaultObstacleMargin??0.15))}var W6r=[class e{constructor(t){this.params=t}params;static componentKind="qfp_thermalpad";componentKind=e.componentKind;static isMatch({memberObstacles:t}){return function(n){let{perimeterPadObstacles:o,thermalPadObstacles:r}=BUt(n);return r.length!==0&&!!wUt(o)&&MUt({perimeterPadObstacles:o,thermalPadObstacles:r})}(t)}},class e{constructor(t){this.params=t}params;static componentKind="qfp";componentKind=e.componentKind;static isMatch({memberObstacles:t}){return function(n){let{perimeterPadObstacles:o,thermalPadObstacles:r}=BUt(n);return!(r.length>0)&&!!MUt({perimeterPadObstacles:o,thermalPadObstacles:r})&&wUt(o)}(t)}},class e{constructor(t){this.params=t}params;static componentKind="soic";componentKind=e.componentKind;static isMatch(t){return U6r(t)}},class e{constructor(t){this.params=t}params;static componentKind="bga";componentKind=e.componentKind;static isMatch({memberObstacles:t}){return function(n){return cln(n)!==null}(t)}}];function X6r(e){return function(t){for(let n of W6r)if(n.isMatch(t))return new n(t);return null}(e)?.componentKind??null}var j6r=class extends fa{inputSrj;initialized=!1;groupedComponentObstacles={};groupedComponentKinds={};unprocessedComponentIds=[];detectedComponents=[];currentComponentId=null;currentMemberObstacles=[];output=null;constructor({inputSrj:e}){super(),this.inputSrj=e}getConstructorParams(){return[{inputSrj:this.inputSrj}]}_step(){this.initialized?this.output?this.solved=!0:this.currentComponentId!==null||this.unprocessedComponentIds.length>0?this.processNextComponent():(this.finalizeOutput(),this.solved=!0):this.initializeDetectionState()}getOutput(){if(!this.output)throw Error("ComponentDetectionSolver has not solved yet");return this.output}visualize(){let e=[];e.push(...this.inputSrj.obstacles.filter((n)=>!n.componentId).map((n)=>({center:n.center,width:n.width,height:n.height,fill:"rgba(120, 120, 120, 0.10)",stroke:"rgba(120, 120, 120, 0.40)",label:n.obstacleId,layer:n.layers.join(","),step:0})));let t=new Set(this.detectedComponents.map((n)=>n.componentId));for(let n of this.inputSrj.obstacles){if(!n.componentId)continue;if(t.has(n.componentId))continue;let o=n.componentId===this.currentComponentId,r=Qce(n.componentId),i=this.groupedComponentKinds[n.componentId];e.push({center:n.center,width:n.width,height:n.height,fill:Qi(r,o?0.55:0.82),stroke:Qi(r,o?0.1:0.45),label:i?`${n.componentId} ${i.toUpperCase()}`:n.componentId,layer:n.layers.join(","),step:o?1:0})}for(let n of this.detectedComponents){let o=Qce(n.componentId);e.push({center:{x:(n.bounds.minX+n.bounds.maxX)/2,y:(n.bounds.minY+n.bounds.maxY)/2},width:n.bounds.maxX-n.bounds.minX,height:n.bounds.maxY-n.bounds.minY,fill:Qi(o,0.88),stroke:Qi(o,0.1),label:`${n.componentId} ${n.componentKind.toUpperCase()} region`,step:2})}return{title:this.getVisualizationTitle(),rects:e,lines:[],points:[],circles:[]}}preview(){return this.visualize()}initializeDetectionState(){this.initialized=!0,this.groupedComponentKinds={},this.groupedComponentObstacles=this.groupObstaclesByComponentId({obstacles:this.inputSrj.obstacles}),this.unprocessedComponentIds=Object.keys(this.groupedComponentObstacles).sort(),this.detectedComponents=[],this.currentComponentId=null,this.currentMemberObstacles=[],this.output=null}processNextComponent(){if(!this.currentComponentId){let e=this.unprocessedComponentIds.shift();return e?(this.currentComponentId=e,void(this.currentMemberObstacles=this.groupedComponentObstacles[e]??[])):(this.currentComponentId=null,void(this.currentMemberObstacles=[]))}if(this.currentMemberObstacles.length===0)return this.currentComponentId=null,void(this.currentMemberObstacles=[]);this.detectedComponents.push(this.createDetectedComponent({componentId:this.currentComponentId,componentKind:this.groupedComponentKinds[this.currentComponentId],memberObstacles:this.currentMemberObstacles})),this.currentComponentId=null,this.currentMemberObstacles=[]}finalizeOutput(){this.output=this.detectedComponents.map((e)=>({...e,bounds:{...e.bounds}})),this.stats={initialized:this.initialized,totalComponentCount:Object.keys(this.groupedComponentObstacles).length,detectedComponentCount:this.detectedComponents.length,detectedBgaComponentCount:this.detectedComponents.filter((e)=>e.componentKind==="bga").length,detectedQfpComponentCount:this.detectedComponents.filter((e)=>e.componentKind==="qfp").length,detectedQfpComponentIds:this.detectedComponents.filter((e)=>e.componentKind==="qfp").map((e)=>e.componentId),detectedQfpThermalPadComponentCount:this.detectedComponents.filter((e)=>e.componentKind==="qfp_thermalpad").length,detectedQfpThermalPadComponentIds:this.detectedComponents.filter((e)=>e.componentKind==="qfp_thermalpad").map((e)=>e.componentId),detectedSoicComponentCount:this.detectedComponents.filter((e)=>e.componentKind==="soic").length,detectedSoicComponentIds:this.detectedComponents.filter((e)=>e.componentKind==="soic").map((e)=>e.componentId),remainingComponentCount:this.unprocessedComponentIds.length,hasActiveComponent:this.currentComponentId!==null}}groupObstaclesByComponentId({obstacles:e}){let t={},n={};for(let r of e)r.componentId&&(t[r.componentId]??=[],t[r.componentId].push(r));let o=Object.entries(t).flatMap(([r,i])=>{let s=this.inputSrj.bounds;if(i.some((c)=>!aln({bounds:Pi(c),outerBounds:s,epsilon:0})))return[];let a=X6r({memberObstacles:i,inputSrj:this.inputSrj});if(!a)return[];return n[r]=a,[[r,a==="bga"?cln(i):i]]});return this.groupedComponentKinds=n,Object.fromEntries(o)}createDetectedComponent({componentId:e,componentKind:t,memberObstacles:n}){return{componentId:e,componentKind:t,bounds:{__type:"rect",...I6e(n)}}}getVisualizationTitle(){let e=Object.keys(this.groupedComponentObstacles).length||new Set(this.inputSrj.obstacles.map((n)=>n.componentId).filter((n)=>Boolean(n))).size,t=this.detectedComponents.length;return this.initialized?this.output||this.solved?`Component Detection: done ${t}/${e}`:this.currentComponentId!==null||this.unprocessedComponentIds.length>0?`Component Detection: ${t}/${e} processed`:`Component Detection: finalizing ${t}/${e}`:"Component Detection: setup"}},K6r=(e)=>e.componentId&&e.obstacleId?`${e.componentId}
${e.obstacleId}`:e.componentId??e.obstacleId??"obstacle",lln=class extends mS{rectBoundsComponentDetection;pipelineDef=[b0("rectBoundsComponentDetection",j6r,(e)=>[{inputSrj:e.inputProblem.inputSrj}])];getConstructorParams(){return[this.inputProblem]}getOutput(){let e=this.getStageOutput("rectBoundsComponentDetection");if(!e)throw Error("ComponentDetectionSolver has not solved yet");return e}initialVisualize(){let{bounds:e}=this.inputProblem.inputSrj;return{title:"Component Detection: board and grouped component pads",rects:[{center:{x:(e.minX+e.maxX)/2,y:(e.minY+e.maxY)/2},width:e.maxX-e.minX,height:e.maxY-e.minY,fill:"rgba(0, 0, 0, 0)",stroke:"rgba(40, 40, 40, 0.7)",label:"Board bounds",step:0},...this.inputProblem.inputSrj.obstacles.map((t)=>{let n=t.componentId?Qce(t.componentId):null;return{center:t.center,width:t.width,height:t.height,fill:n?Qi(n,0.72):"rgba(120, 120, 120, 0.10)",stroke:n?Qi(n,0.28):"rgba(120, 120, 120, 0.40)",label:K6r(t),layer:t.layers.join(","),step:t.componentId?1:0}})],lines:[],points:[],circles:[]}}},L7=0.000000001;function XO(e){return Md({center:e.center,width:e.width,height:e.height})}function hln(e,t){let n={minX:Math.max(e.minX,t.minX),maxX:Math.min(e.maxX,t.maxX),minY:Math.max(e.minY,t.minY),maxY:Math.min(e.maxY,t.maxY)};return gZe(n)?n:null}function gZe(e){let t=e.maxX-e.minX,n=e.maxY-e.minY,o=Number.isFinite(t)&&t>L7,r=Number.isFinite(n)&&n>L7;return o&&r}function $6r(e){(function(o){if(!Number.isInteger(o.layerCount))throw Error("TopologyMergingSolver: layerCount must be an integer");if(o.layerCount<=0)throw Error("TopologyMergingSolver: layerCount must be positive");if(o.nodeGroups.length===0)throw Error("TopologyMergingSolver: at least one node group is required");let r=new Set,i=0;for(let s of o.nodeGroups){if(r.has(s.groupId))throw Error(`TopologyMergingSolver: duplicate topology group id "${s.groupId}"`);if(r.add(s.groupId),i+=s.nodes.length,s.nodes.length===0)throw Error(`TopologyMergingSolver: topology group "${s.groupId}" is empty`);let a=new Set;for(let c of s.nodes){if(a.has(c.capacityMeshNodeId))throw Error(`TopologyMergingSolver: duplicate node id "${c.capacityMeshNodeId}" in group "${s.groupId}"`);a.add(c.capacityMeshNodeId),q6r({node:c,groupId:s.groupId,layerCount:o.layerCount})}}if(i===0)throw Error("TopologyMergingSolver: topology node groups are empty")})(e);let t=[],n=new Map;for(let o=0;o<e.nodeGroups.length;o++){let r=e.nodeGroups[o];for(let i of r.nodes){let s={sourceKey:`${r.groupId}:${i.capacityMeshNodeId}`,groupIndex:o,node:i,bounds:XO(i)};t.push(s),n.set(s.sourceKey,s)}}return{preparedNodes:t,preparedNodeBySourceKey:n}}function q6r({node:e,groupId:t,layerCount:n}){if(!gZe(XO(e)))throw Error(`TopologyMergingSolver: node "${e.capacityMeshNodeId}" in group "${t}" has invalid bounds`);if(e.availableZ.length===0)throw Error(`TopologyMergingSolver: node "${e.capacityMeshNodeId}" in group "${t}" has no available layers`);let o=[...new Set(e.availableZ)].sort((s,a)=>s-a),r=o.some((s)=>!Number.isInteger(s)||s<0||s>=n),i=o.length===e.availableZ.length&&o.every((s,a)=>s===e.availableZ[a]);if(r||!i)throw Error(`TopologyMergingSolver: node "${e.capacityMeshNodeId}" in group "${t}" has invalid or unsorted availableZ`)}var hy=0.00001,M$=0.00004;function NUt({regions:e,preparedNodeBySourceKey:t,nodeGroups:n,provenance:o,preserveSourceIds:r=!0}){r&&(o.groupIndexesByNodeId.clear(),o.sourceKeysByNodeId.clear());let i=[...e].sort((a,c)=>a.bounds.minX-c.bounds.minX||a.bounds.minY-c.bounds.minY||a.bounds.maxX-c.bounds.maxX||a.bounds.maxY-c.bounds.maxY||a.availableZ[0]-c.availableZ[0]),s=new Set;return i.map((a,c)=>{let l=a.sourceKeys.map((m)=>{let A=t.get(m);if(!A)throw Error(`TopologyMergingSolver: missing source node for "${m}"`);return A}),h=l.map(({node:m})=>m),d=function({sourceNodes:m,isComponentTopologyNode:A}){if(m.length===1)return{_isComponentTopologyNode:!!A||m[0]._isComponentTopologyNode};let g=m.map((I)=>I.capacityMeshNodeId),f=TXe(m.map((I)=>I._targetConnectionName),"target connection",g),y=TXe(m.map((I)=>I._offBoardConnectionId),"off-board connection",g),x=TXe(m.map((I)=>I._offboardNetName),"off-board net",g),C=Array.from(new Set(m.flatMap((I)=>I._offBoardConnectedCapacityMeshNodeIds??[]))),b=Array.from(new Set(m.flatMap((I)=>I._connectedTo??[])));return{_containsObstacle:m.some((I)=>I._containsObstacle)||void 0,_completelyInsideObstacle:m.some((I)=>I._completelyInsideObstacle)||void 0,_containsTarget:m.some((I)=>I._containsTarget)||void 0,_targetConnectionName:f,_isVirtualOffboard:m.some((I)=>I._isVirtualOffboard)||void 0,_offboardNetName:x,_offBoardConnectionId:y,_offBoardConnectedCapacityMeshNodeIds:C.length>0?C:void 0,_qfpRegionType:RUt(m.map((I)=>I._qfpRegionType)),_isNarrowQfpPadGap:m.some((I)=>I._isNarrowQfpPadGap)||void 0,_soicRegionType:RUt(m.map((I)=>I._soicRegionType)),_isComponentTopologyNode:A||void 0,_connectedTo:b.length>0?b:void 0}}({sourceNodes:h,isComponentTopologyNode:l.some(({groupIndex:m})=>n[m].isComponent)}),u=r&&l.length===1?l[0].node:null,p=Boolean(u&&function({region:m,sourceNode:A,usedNodeIds:g}){let f=XO(A),y=Math.abs(m.bounds.minX-f.minX)<=hy&&Math.abs(m.bounds.maxX-f.maxX)<=hy&&Math.abs(m.bounds.minY-f.minY)<=hy&&Math.abs(m.bounds.maxY-f.maxY)<=hy,x=m.availableZ.length===A.availableZ.length&&m.availableZ.every((C,b)=>C===A.availableZ[b]);return y&&x&&!g.has(A.capacityMeshNodeId)}({region:a,sourceNode:u,usedNodeIds:s}))?u.capacityMeshNodeId:`topology_merge_${c}`;for(;s.has(p);)p=`${p}_next`;return s.add(p),r&&(o.groupIndexesByNodeId.set(p,[...new Set(l.map(({groupIndex:m})=>m))]),o.sourceKeysByNodeId.set(p,[...a.sourceKeys])),{...u??h[0],...d,capacityMeshNodeId:p,center:{x:(a.bounds.minX+a.bounds.maxX)/2,y:(a.bounds.minY+a.bounds.maxY)/2},width:a.bounds.maxX-a.bounds.minX,height:a.bounds.maxY-a.bounds.minY,layer:`z${a.availableZ.join(",")}`,availableZ:[...a.availableZ],_adjacentNodeIds:void 0,_parent:void 0,_strawNode:void 0,_strawParentCapacityMeshNodeId:void 0}})}function TXe(e,t,n){let o=Array.from(new Set(e.filter((r)=>r!==void 0)));if(o.length>1)throw Error(`TopologyMergingSolver: conflicting ${t} values for overlapping source nodes ${n.join(", ")}`);return o[0]}function RUt(e){let t=Array.from(new Set(e.filter((n)=>n!==void 0)));return t.length===1?t[0]:void 0}function J6r({node:e,sourceKey:t,preparedNodeBySourceKey:n}){let o=n.get(t);if(!o)throw Error(`TopologyMergingSolver: missing source node for output "${e.capacityMeshNodeId}"`);let r=XO(e),i=r.minX>=o.bounds.minX-M$&&r.maxX<=o.bounds.maxX+M$&&r.minY>=o.bounds.minY-M$&&r.maxY<=o.bounds.maxY+M$,s=e.availableZ.every((a)=>o.node.availableZ.includes(a));if(!i||!s)throw Error(`TopologyMergingSolver: output node "${e.capacityMeshNodeId}" escapes its source geometry or layers`)}function Z6r({groupIndexesA:e,groupIndexesB:t,sourceKeysA:n,sourceKeysB:o,sharedLayers:r,preparedNodeBySourceKey:i}){if(e.length!==1||t.length!==1||e[0]!==t[0]||n.length!==1||o.length!==1||n[0]===o[0])return!1;let s=i.get(n[0]),a=i.get(o[0]);if(!s||!a||r.length===0)return!1;return r.some((c)=>s.node.availableZ.includes(c)&&a.node.availableZ.includes(c))&&hln(s.bounds,a.bounds)!==null}function QUt(e){let t=[...e].sort((o,r)=>o-r),n=[];for(let o of t){let r=n[n.length-1];(r===void 0||Math.abs(o-r)>hy)&&n.push(o)}return n}function eIr(e,t){return t.x>=e.minX-hy&&t.x<=e.maxX+hy&&t.y>=e.minY-hy&&t.y<=e.maxY+hy}function tIr({coveringNodes:e,nodeGroups:t,layerCount:n}){let o=new Map;for(let r=0;r<n;r++){let i=e.filter(({node:u})=>u.availableZ.includes(r)).sort((u,_)=>u.sourceKey.localeCompare(_.sourceKey));if(i.length===0)continue;let s=new Set(i.map(({groupIndex:u})=>u)),a=i.filter(({node:u})=>u._containsObstacle&&u._containsTarget),c=a.filter(({groupIndex:u})=>!t[u].isComponent),l=new Set(a.map(({groupIndex:u})=>u)),h=a.length>0?c.length>0||l.size===1?"target-passthrough":"target-merged":s.size===1?"passthrough":"merged",d=rIr({topologyMode:h,nodesOnLayer:i,targetObstacleNodes:a,globalTargetObstacleNodes:c});for(let u of d){let _=JSON.stringify({mode:h,sourceKeys:u}),p=o.get(_);p?p.availableZ.push(r):o.set(_,{availableZ:[r],sourceKeys:u,topologyMode:h,topologySignature:_})}}return[...o.values()]}function dln(e){return JSON.stringify({availableZ:e.availableZ,topologySignature:e.topologySignature})}function nIr(e){return JSON.stringify({mergeKey:dln(e),minY:e.bounds.minY.toPrecision(15),maxY:e.bounds.maxY.toPrecision(15)})}function oIr(e){return JSON.stringify({mergeKey:dln(e),minX:e.bounds.minX.toPrecision(15),maxX:e.bounds.maxX.toPrecision(15)})}function kUt(e,t){let n=new Map;for(let o of e){let r=t==="horizontal"?nIr(o):oIr(o),i=n.get(r)??[];i.push(o),n.set(r,i)}return[...n.values()].flatMap((o)=>function(r,i){let s=[...r].sort((c,l)=>i==="horizontal"?c.bounds.minX-l.bounds.minX:c.bounds.minY-l.bounds.minY),a=[];for(let c of s){let l=a[a.length-1],h=l!==void 0&&(i==="horizontal"?Math.abs(l.bounds.maxX-c.bounds.minX)<=hy:Math.abs(l.bounds.maxY-c.bounds.minY)<=hy);l&&h?i==="horizontal"?l.bounds.maxX=c.bounds.maxX:l.bounds.maxY=c.bounds.maxY:a.push({...c,bounds:{...c.bounds},availableZ:[...c.availableZ],sourceKeys:[...c.sourceKeys]})}return a}(o,t))}function rIr({topologyMode:e,nodesOnLayer:t,targetObstacleNodes:n,globalTargetObstacleNodes:o}){if(e==="target-passthrough")return(o.length>0?o:n).map(({sourceKey:r})=>[r]);return e==="target-merged"?[n.map(({sourceKey:r})=>r).sort()]:e==="passthrough"?t.map(({sourceKey:r})=>[r]):[t.map(({sourceKey:r})=>r).sort()]}var uln=class extends fa{constructor(e){super(),this.inputProblem=e,this.MAX_ITERATIONS=1e5;let{preparedNodes:t,preparedNodeBySourceKey:n}=$6r(e);this.preparedNodes=t,this.preparedNodeBySourceKey=n,this.xCoordinates=QUt(this.preparedNodes.flatMap(({bounds:o})=>[o.minX,o.maxX])),this.stats={inputNodeCount:this.preparedNodes.length,xSlabCount:Math.max(0,this.xCoordinates.length-1),processedXSlabCount:0,atomicRegionCount:0,outputNodeCount:0}}inputProblem;preparedNodes;preparedNodeBySourceKey;outputProvenance={groupIndexesByNodeId:new Map,sourceKeysByNodeId:new Map};xCoordinates;atomicRegions=[];outputNodes=[];currentXIndex=0;getConstructorParams(){return[this.inputProblem]}_step(){if(this.inputProblem.nodeGroups.length===1)return void this.completePassthroughTopology();if(this.currentXIndex<this.xCoordinates.length-1)return this.processCurrentXSlab(),this.currentXIndex+=1,this.stats.processedXSlabCount=this.currentXIndex,void(this.stats.atomicRegionCount=this.atomicRegions.length);let e=function(t){let n=t;for(;;){let o=kUt(n,"horizontal"),r=kUt(o,"vertical");if(r.length===n.length)return r;n=r}}(function({regions:t,preparedNodeBySourceKey:n}){let o=new Map;for(let i of t)for(let s of i.sourceKeys){let a=o.get(s)??new Set;a.add(i.topologyMode),o.set(s,a)}let r=new Set([...o.entries()].filter(([,i])=>i.size===1&&i.has("target-passthrough")).map(([i])=>i));return r.size===0?t:[...t.filter((i)=>i.topologyMode!=="target-passthrough"||!r.has(i.sourceKeys[0])),...[...r].map((i)=>{let s=n.get(i);if(!s)throw Error(`TopologyMergingSolver: missing authoritative target source "${i}"`);return{bounds:{...s.bounds},availableZ:[...s.node.availableZ],sourceKeys:[i],topologyMode:"target-passthrough",topologySignature:JSON.stringify({mode:"target-passthrough",sourceKeys:[i]})}})]}({regions:this.atomicRegions,preparedNodeBySourceKey:this.preparedNodeBySourceKey}));this.outputNodes=NUt({regions:e,preparedNodeBySourceKey:this.preparedNodeBySourceKey,nodeGroups:this.inputProblem.nodeGroups,provenance:this.outputProvenance}),function({nodes:t,preparedNodeBySourceKey:n,provenance:o}){let r=new Set;for(let i of t){if(r.has(i.capacityMeshNodeId))throw Error(`TopologyMergingSolver: duplicate output node id "${i.capacityMeshNodeId}"`);if(r.add(i.capacityMeshNodeId),!gZe(XO(i)))throw Error(`TopologyMergingSolver: output node "${i.capacityMeshNodeId}" has invalid bounds`);if(i.availableZ.length===0)throw Error(`TopologyMergingSolver: output node "${i.capacityMeshNodeId}" has no available layers`);let s=o.sourceKeysByNodeId.get(i.capacityMeshNodeId);if(!s)throw Error(`TopologyMergingSolver: missing output provenance for node "${i.capacityMeshNodeId}"`);s.length===1&&J6r({node:i,sourceKey:s[0],preparedNodeBySourceKey:n})}for(let i=0;i<t.length;i++){let s=t[i],a=XO(s);for(let c=i+1;c<t.length;c++){let l=t[c];if(l.center.x-l.width/2>a.maxX||l.center.x+l.width/2<a.minX||l.center.y-l.height/2>a.maxY||l.center.y+l.height/2<a.minY)continue;let h=s.availableZ.filter((f)=>l.availableZ.includes(f));if(h.length===0)continue;let d=hln(a,XO(l));if(!d)continue;let u=d.maxX-d.minX,_=d.maxY-d.minY;if(u<=M$||_<=M$)continue;let p=o.groupIndexesByNodeId.get(s.capacityMeshNodeId),m=o.groupIndexesByNodeId.get(l.capacityMeshNodeId);if(!p||!m)throw Error(`TopologyMergingSolver: missing output provenance for overlapping nodes "${s.capacityMeshNodeId}" and "${l.capacityMeshNodeId}"`);let A=o.sourceKeysByNodeId.get(s.capacityMeshNodeId),g=o.sourceKeysByNodeId.get(l.capacityMeshNodeId);if(!A||!g)throw Error(`TopologyMergingSolver: missing source provenance for overlapping nodes "${s.capacityMeshNodeId}" and "${l.capacityMeshNodeId}"`);if(!Z6r({groupIndexesA:p,groupIndexesB:m,sourceKeysA:A,sourceKeysB:g,sharedLayers:h,preparedNodeBySourceKey:n}))throw Error(`TopologyMergingSolver: output nodes "${s.capacityMeshNodeId}" and "${l.capacityMeshNodeId}" have an unresolved inter-group overlap on a shared layer`)}}}({nodes:this.outputNodes,preparedNodeBySourceKey:this.preparedNodeBySourceKey,provenance:this.outputProvenance}),this.stats.outputNodeCount=this.outputNodes.length,this.stats.compactedRegionCount=e.length,this.solved=!0}getOutput(){if(!this.solved)throw Error("TopologyMergingSolver: getOutput() called before the solver completed");return this.outputNodes}computeProgress(){let e=Math.max(1,this.xCoordinates.length-1);return this.solved?1:Math.min(0.99,this.currentXIndex/e)}visualize(){let e=this.solved?this.outputNodes:NUt({regions:this.atomicRegions,preparedNodeBySourceKey:this.preparedNodeBySourceKey,nodeGroups:this.inputProblem.nodeGroups,provenance:this.outputProvenance,preserveSourceIds:!1});return{title:`Topology Merging: ${e.length} refined regions`,coordinateSystem:"cartesian",rects:e.map((t)=>({...fA(t,{rectMargin:0.01,zOffset:0.02}),label:`${t.capacityMeshNodeId}
availableZ: ${t.availableZ.join(",")}
component: ${t._isComponentTopologyNode?"yes":"no"}`})),lines:[],points:[],circles:[],texts:[]}}completePassthroughTopology(){let e=this.inputProblem.nodeGroups[0];this.outputNodes=e.nodes;for(let t of this.outputNodes)this.outputProvenance.groupIndexesByNodeId.set(t.capacityMeshNodeId,[0]),this.outputProvenance.sourceKeysByNodeId.set(t.capacityMeshNodeId,[`${e.groupId}:${t.capacityMeshNodeId}`]);this.stats.processedXSlabCount=this.stats.xSlabCount,this.stats.atomicRegionCount=0,this.stats.compactedRegionCount=0,this.stats.outputNodeCount=this.outputNodes.length,this.stats.passthroughNodeCount=this.outputNodes.length,this.solved=!0}processCurrentXSlab(){let e=this.xCoordinates[this.currentXIndex],t=this.xCoordinates[this.currentXIndex+1];if(t-e<=hy)return;let n=(e+t)/2,o=this.preparedNodes.filter(({bounds:i})=>n>=i.minX-hy&&n<=i.maxX+hy),r=QUt(o.flatMap(({bounds:i})=>[i.minY,i.maxY]));for(let i=0;i<r.length-1;i++){let s=r[i],a=r[i+1];if(a-s<=hy)continue;let c={x:n,y:(s+a)/2},l=o.filter(({bounds:d})=>eIr(d,c));if(l.length===0)continue;let h=tIr({coveringNodes:l,nodeGroups:this.inputProblem.nodeGroups,layerCount:this.inputProblem.layerCount});for(let d of h)this.atomicRegions.push({bounds:{minX:e,maxX:t,minY:s,maxY:a},availableZ:d.availableZ,sourceKeys:d.sourceKeys,topologyMode:d.topologyMode,topologySignature:d.topologySignature})}}};function iIr({meshNodes:e,components:t}){return t.length===0?e:e.map((n)=>t.some((r)=>function({node:i,component:s}){let{replacementObstacle:a}=s,c=Math.abs(i.center.x-a.center.x)<=L7&&Math.abs(i.center.y-a.center.y)<=L7&&Math.abs(i.width-a.width)<=L7&&Math.abs(i.height-a.height)<=L7;if(s.componentKind!=="qfp"&&s.componentKind!=="qfp_thermalpad"&&s.componentKind!=="soic")return c;let l=a.center.x-a.width/2,h=a.center.x+a.width/2,d=a.center.y-a.height/2,u=a.center.y+a.height/2,_=i.center.x>=l-L7&&i.center.x<=h+L7&&i.center.y>=d-L7&&i.center.y<=u+L7,p=i.width*i.height,m=a.width*a.height,A=_&&p>=0.2*m;return c||A}({node:n,component:r}))?{...n,_containsObstacle:void 0,_completelyInsideObstacle:void 0,_containsTarget:void 0,_targetConnectionName:void 0,_connectedTo:void 0}:n)}var pln=class extends mS{globalTopologySolver;componentTopologyBatchSolver;normalizedInput;pipelineDef=[b0("globalTopologySolver",wq,(e)=>[e.getGlobalTopologySolverInput()]),b0("componentTopologyBatchSolver",O6r,(e)=>[{componentSrjs:e.getComponentNoConnectionSrjs(),componentIds:e.normalizedInput.components.map((t)=>t.componentId),componentKinds:e.normalizedInput.components.map((t)=>t.componentKind),viaDiameter:e.inputProblem.viaDiameter,obstacleMargin:e.inputProblem.obstacleMargin}])];constructor(e){super(e),this.normalizedInput=F6r(e)}getConstructorParams(){return[this.inputProblem]}getOutput(){let e=iIr({meshNodes:this.getStageOutput("globalTopologySolver")?.meshNodes??[],components:this.normalizedInput.components}),t=this.getStageOutput("componentTopologyBatchSolver")?.componentMeshNodes??[],n=this.getComponentNoConnectionSrjs();return{globalNoConnectionSrj:this.normalizedInput.globalNoConnectionSrj,componentNoConnectionSrjs:n,globalMeshNodes:e,componentMeshNodes:t}}finalVisualize(){let e=this.getOutput();return{title:"Topology Planning: generated topology groups",rects:[...e.componentNoConnectionSrjs.flatMap((t,n)=>{let o=this.normalizedInput.components[n]??null;return t.obstacles.map((r)=>({center:r.center,width:r.width,height:r.height,fill:"rgba(120, 120, 120, 0.06)",stroke:"rgba(120, 120, 120, 0.35)",label:r.obstacleId??o?.componentId??"component-pad",layer:r.layers.join(",")}))}),...[...e.globalMeshNodes,...e.componentMeshNodes.flat()].map((t)=>{let n=this.normalizedInput.components.find((o)=>t.capacityMeshNodeId.includes(o.componentId));return{...fA(t,{rectMargin:0.01}),fill:t._containsObstacle?Qi("red",0.82):"rgba(0, 120, 255, 0.12)",stroke:t._containsObstacle?Qi("red",0.3):"rgba(0, 120, 255, 0.55)",label:n?`${n.componentKind.toUpperCase()} ${t.capacityMeshNodeId}`:t.capacityMeshNodeId}})],lines:[],points:[],circles:[],texts:[]}}visualize(){return this.filterGlobalRectDiffNodesFromVisualization({visualization:super.visualize()})}preview(){return this.filterGlobalRectDiffNodesFromVisualization({visualization:super.preview()})}getComponentNoConnectionSrjs(){return this.normalizedInput.components.map((e)=>function({inputSrj:t,component:n}){let o=I6e(n.memberObstacles),r=Math.max(t.minViaPadDiameter??t.min_via_pad_diameter??t.minViaDiameter??0.3,t.defaultObstacleMargin??0.15,2*t.minTraceWidth),i=new Set(n.memberObstacles.flatMap((c)=>c.connectedTo)),s=t.connections.flatMap((c)=>c.pointsToConnect.filter((l)=>{let h=[l.pointId,l.pcb_port_id].filter((u)=>typeof u=="string").some((u)=>i.has(u)),d=l.x>=o.minX-r&&l.x<=o.maxX+r&&l.y>=o.minY-r&&l.y<=o.maxY+r;return h&&d})).reduce((c,l)=>({minX:Math.min(c.minX,l.x),maxX:Math.max(c.maxX,l.x),minY:Math.min(c.minY,l.y),maxY:Math.max(c.maxY,l.y)}),o),a=t.obstacles.filter((c)=>Sw(Pi(c),s)).map((c)=>({...c}));return{...structuredClone(t),bounds:s,obstacles:a}}({inputSrj:this.inputProblem.inputSrj,component:e}))}getGlobalTopologySolverInput(){return{simpleRouteJson:this.normalizedInput.globalNoConnectionSrj,maxGapFillPasses:4}}filterGlobalRectDiffNodesFromVisualization({visualization:e}){return{...e,rects:z6r({rects:e.rects,components:this.normalizedInput.components})}}},DXe=(e,t)=>{if(e)return Object.entries(t).sort(([n],[o])=>o.length-n.length).find(([n])=>e.includes(n))?.[1]},fbe=(e,t)=>({...e,points:e.points?.map((n)=>({...n,color:DXe(n.label,t)??n.color})),lines:e.lines?.map((n)=>({...n,strokeColor:DXe(n.label,t)??n.strokeColor})),circles:e.circles?.map((n)=>{let o=DXe(n.label,t);return o?{...n,fill:o,stroke:o}:n})}),mln=class extends Kr{constructor(e){super(),this.topologyPlanningSolver=e,this.solved=e.solved,this.failed=e.failed,this.error=e.error,this.stats=e.stats}topologyPlanningSolver;getOutput(){return this.topologyPlanningSolver.getOutput().componentMeshNodes.flat()}visualize(){return this.topologyPlanningSolver.finalVisualize()??this.topologyPlanningSolver.visualize()}preview(){return this.visualize()}},NV=class{MAX_ITERATIONS=1e5;solved=!1;failed=!1;iterations=0;progress=0;error=null;activeSubSolver;failedSubSolvers;timeToSolve;stats={};_setupDone=!1;getSolverName(){return this.constructor.name}setup(){this._setupDone||(this._setup(),this._setupDone=!0)}_setup(){}step(){if(this._setupDone||this.setup(),!this.solved&&!this.failed){this.iterations++;try{this._step()}catch(e){throw this.error=`${this.getSolverName()} error: ${e}`,this.failed=!0,e}!this.solved&&this.iterations>=this.MAX_ITERATIONS&&this.tryFinalAcceptance(),!this.solved&&this.iterations>=this.MAX_ITERATIONS&&(this.error=`${this.getSolverName()} ran out of iterations`,this.failed=!0),"computeProgress"in this&&(this.progress=this.computeProgress())}}_step(){}getConstructorParams(){throw Error("getConstructorParams not implemented")}getOutput(){return null}solve(){let e=Date.now();for(;!this.solved&&!this.failed;)this.step();let t=Date.now();this.timeToSolve=t-e}visualize(){return{lines:[],points:[],rects:[],circles:[]}}tryFinalAcceptance(){}preview(){return{lines:[],points:[],rects:[],circles:[]}}},NXe=(e)=>e.filter((t)=>Boolean(t)),LUt=(e,t,n)=>{let o=`${Math.round(100*e.x)},${Math.round(100*e.y)}`,r=t.map((i)=>((s,a)=>s==="top"?0:s==="bottom"?a-1:Number.parseInt(s.slice(5),10))(i,n)).sort().join("-");return`${o}:${r}`},Tw=class{parent=new Map;cachedObstacles;canonicalSetsByAliases=new Map;constructor(e,t=e.traces??[],n={}){for(let o of e.connections)this.unionAll(NXe([o.name,o.source_trace_id,o.rootConnectionName,o.netConnectionName,...o.mergedConnectionNames??[],...o.pointsToConnect.flatMap((r)=>[r.pointId,r.pcb_port_id,...n.includePhysicalPositionAliases?[LUt(r,r.layers??[r.layer],e.layerCount)]:[]])]));for(let o of[...t,...e.fixedTraces??[]])this.unionAll(NXe([o.pcb_trace_id,o.connection_name,o.source_trace_id,o.rootConnectionName,...o.mergedConnectionNames??[],...o.connectsTo??[]]));for(let o of e.obstacles)this.unionAll(n.includePhysicalPositionAliases?NXe([o.obstacleId,...o.connectedTo,...o.offBoardConnectsTo??[],LUt(o.center,o.layers,e.layerCount)]):o.connectedTo);this.setCacheableObstacles(e.obstacles)}setCacheableObstacles(e){if(this.cachedObstacles!==e){this.cachedObstacles=e,this.canonicalSetsByAliases.clear();for(let t of e)this.canonicalSetsByAliases.set(t.connectedTo,null)}}canonicalize(e){return[...new Set(e.map((t)=>this.find(t)))]}canonicalizeToSet(e){let t=this.canonicalSetsByAliases.get(e);if(t&&e.length===t.aliases.length&&e.every((o,r)=>o===t.aliases[r]))return t.canonicalNames;let n=new Set(this.canonicalize(e));return this.canonicalSetsByAliases.has(e)&&this.canonicalSetsByAliases.set(e,{aliases:[...e],canonicalNames:n}),n}unionAll(e){let t=e[0];if(t){this.add(t);for(let n=1;n<e.length;n++)this.union(t,e[n])}}add(e){this.parent.has(e)||this.parent.set(e,e)}find(e){this.add(e);let t=this.parent.get(e);if(t===e)return e;let n=this.find(t);return this.parent.set(e,n),n}union(e,t){let n=this.find(e),o=this.find(t);n!==o&&this.parent.set(o,n)}},hr=0.000001,ys=(e,t)=>Math.hypot(t.x-e.x,t.y-e.y),OO=(e,t,n)=>{let o=n.x-t.x,r=n.y-t.y,i=o*o+r*r;if(i<=0.000000000001)return ys(e,t);let s=C0(((e.x-t.x)*o+(e.y-t.y)*r)/i,0,1);return Math.hypot(e.x-(t.x+o*s),e.y-(t.y+r*s))},jO=(e,t,n=0.000001)=>Math.abs(e.x-t.x)<=n&&Math.abs(e.y-t.y)<=n,C0=(e,t,n)=>Math.max(t,Math.min(n,e)),lce=(e,t,n)=>(t.x-e.x)*(n.y-e.y)-(t.y-e.y)*(n.x-e.x),hce=(e,t,n)=>Math.abs(lce(t,n,e))<=0.000000001&&e.x>=Math.min(t.x,n.x)-0.000000001&&e.x<=Math.max(t.x,n.x)+0.000000001&&e.y>=Math.min(t.y,n.y)-0.000000001&&e.y<=Math.max(t.y,n.y)+0.000000001,t$e=(e,t,n,o)=>((r,i,s,a)=>{let c=lce(r,i,s),l=lce(r,i,a),h=lce(s,a,r),d=lce(s,a,i);return c*l<0&&h*d<0||Math.abs(c)<=0.000000001&&hce(s,r,i)||Math.abs(l)<=0.000000001&&hce(a,r,i)||Math.abs(h)<=0.000000001&&hce(r,s,a)||Math.abs(d)<=0.000000001&&hce(i,s,a)})(e,t,n,o)?0:Math.min(OO(e,n,o),OO(t,n,o),OO(n,e,t),OO(o,e,t)),HUt=(e,t)=>{let n=!1;for(let o=0,r=t.length-1;o<t.length;r=o++){let i=t[o],s=t[r];if(hce(e,s,i))return!0;i.y>e.y!=s.y>e.y&&e.x<(s.x-i.x)*(e.y-i.y)/(s.y-i.y)+i.x&&(n=!n)}return n},RXe=(e,t,n)=>{if(HUt(e,n)||HUt(t,n))return 0;let o=Number.POSITIVE_INFINITY;for(let r=0;r<n.length;r++){let i=n[r],s=n[(r+1)%n.length];o=Math.min(o,t$e(e,t,i,s))}return o};function FUt(e,t,n){let o=0,r=1,i=t.x-e.x,s=t.y-e.y,a=[[-i,e.x-n.minX],[i,n.maxX-e.x],[-s,e.y-n.minY],[s,n.maxY-e.y]];for(let[c,l]of a){if(Math.abs(c)<0.000000000001){if(l<0)return!1;continue}let h=l/c;if(c<0?o=Math.max(o,h):r=Math.min(r,h),o>r)return!1}return!0}function _ln({start:e,end:t,width:n,base:o}){let r=ys(e,t),i=((l)=>C0(1.25*l,0.25,0.75))(n),s=Math.max(1,Math.ceil(r/i)),a=n/2,c=[];for(let l=0;l<s;l++){let h=l/s,d=(l+1)/s,u=e.x+(t.x-e.x)*h,_=e.y+(t.y-e.y)*h,p=e.x+(t.x-e.x)*d,m=e.y+(t.y-e.y)*d;c.push({...o,minX:Math.min(u,p)-a,minY:Math.min(_,m)-a,maxX:Math.max(u,p)+a,maxY:Math.max(_,m)+a,exactShape:{type:"segment",start:{x:u,y:_},end:{x:p,y:m},width:n}})}return c}var sIr=(e,t,n)=>{let o=Math.cos(n),r=Math.sin(n),i=e.x-t.x,s=e.y-t.y;return{x:t.x+i*o-s*r,y:t.y+i*r+s*o}},aIr=class{nodeIndices=[];priorities=[];get size(){return this.nodeIndices.length}push(e,t){let n=this.nodeIndices.length;for(this.nodeIndices.push(e),this.priorities.push(t);n>0;){let o=n-1>>1;if(this.priorities[o]<=t)break;this.swap(n,o),n=o}}pop(){let e=this.nodeIndices[0],t=this.nodeIndices.pop(),n=this.priorities.pop();if(this.nodeIndices.length===0)return e;this.nodeIndices[0]=t,this.priorities[0]=n;let o=0;for(;;){let r=2*o+1,i=r+1;if(r>=this.nodeIndices.length)break;let s=r;if(i<this.nodeIndices.length&&this.priorities[i]<this.priorities[r]&&(s=i),this.priorities[o]<=this.priorities[s])break;this.swap(o,s),o=s}return e}swap(e,t){[this.nodeIndices[e],this.nodeIndices[t]]=[this.nodeIndices[t],this.nodeIndices[e]],[this.priorities[e],this.priorities[t]]=[this.priorities[t],this.priorities[e]]}},cIr=[[-1,-1],[-1,0],[-1,1],[0,-1],[0,1],[1,-1],[1,0],[1,1]],q3e=["#d53535","#3478c8","#8e44ad","#15956f"],zUt=class extends NV{problem;searchBounds;rows;columns;origin;nodes=[];open=new aIr;bestCost=new Map;closed=new Set;baseStateCount;stateSpaceUpperBound;endLayerIndices;targetCell;segmentWidthCache=new Map;closedStateCount=0;output=null;constructor(e){super(),this.problem=e;let t=Math.max(e.traceWidth,e.viaDiameter)/2+e.obstacleIndex.clearance,n=C0(Math.min(e.start.x,e.end.x)-e.searchPadding,e.bounds.minX+t,e.bounds.maxX-t),o=C0(Math.max(e.start.x,e.end.x)+e.searchPadding,e.bounds.minX+t,e.bounds.maxX-t),r=C0(Math.min(e.start.y,e.end.y)-e.searchPadding,e.bounds.minY+t,e.bounds.maxY-t),i=C0(Math.max(e.start.y,e.end.y)+e.searchPadding,e.bounds.minY+t,e.bounds.maxY-t),s=Math.floor((n-e.gridOffset.x)/e.gridSize)*e.gridSize+e.gridOffset.x,a=Math.floor((r-e.gridOffset.y)/e.gridSize)*e.gridSize+e.gridOffset.y;this.origin={x:s,y:a},this.columns=Math.max(2,Math.floor((o-s)/e.gridSize)+1),this.rows=Math.max(2,Math.floor((i-a)/e.gridSize)+1),this.searchBounds={minX:s,minY:a,maxX:s+(this.columns-1)*e.gridSize,maxY:a+(this.rows-1)*e.gridSize};let c=this.rows*this.columns*e.layers.length*(e.maxViaCount+1);this.baseStateCount=c,this.stateSpaceUpperBound=c*(this.rows*this.columns+1),this.targetCell=this.pointToCell(e.end),this.endLayerIndices=new Set(e.endLayers.map((h)=>e.layers.indexOf(h)).filter((h)=>h>=0));let l=this.pointToCell(e.start);for(let h of e.startLayers){let d=e.layers.indexOf(h);if(d<0||this.endpointCollides(e.start,d))continue;let u={...l,...e.start,layerIndex:d,viaCount:0,viaPoints:[],g:0,f:this.heuristic(e.start),parentIndex:-1},_=this.nodes.length;this.nodes.push(u),this.open.push(_,u.f),this.bestCost.set(this.toStateIndex(u),0)}this.open.size!==0&&this.endLayerIndices.size!==0||(this.failed=!0,this.error="No collision-free multilayer route endpoint"),this.MAX_ITERATIONS=Math.min(15000,Math.max(2000,2*c)),this.stats=this.createStats()}getSolverName(){return`LayerAwareGridRouteSolver(${this.problem.gridSize.toFixed(3)}mm)`}_step(){if(this.open.size===0)return this.failed=!0,void(this.error="No collision-free multilayer grid route found");let e=this.open.pop(),t=this.nodes[e],n=this.toStateIndex(t);if(!this.closed.has(n)){if(this.closed.add(n),this.closedStateCount++,t.row===this.targetCell.row&&t.column===this.targetCell.column&&this.endLayerIndices.has(t.layerIndex)&&t.viaCount>=this.problem.minViaCount&&!this.segmentCollides(t,this.problem.end))return this.output=this.reconstructRoute(e),this.solved=!0,void(this.stats=this.createStats());this.expandPlanarMoves(e,t),this.expandViaMoves(e,t),this.stats=this.createStats()}}expandPlanarMoves(e,t){for(let[n,o]of cIr){let r=t.row+n,i=t.column+o;if(r<0||r>=this.rows||i<0||i>=this.columns)continue;let s=this.cellToPoint(r,i),a=this.getSafeSegmentWidth(t,s);if(a<=0)continue;let c=this.problem.gridSize*(n!==0&&o!==0?Math.SQRT2:1)*Math.max(1,(this.problem.traceWidth/a)**this.problem.neckPenaltyExponent);this.enqueueNode({row:r,column:i,...s,layerIndex:t.layerIndex,viaCount:t.viaCount,viaPoints:t.viaPoints,g:t.g+c,parentIndex:e})}}expandViaMoves(e,t){if(t.viaCount>=this.problem.maxViaCount)return;let n=0.5*this.problem.gridSize;if(ys(t,this.problem.start)<n-0.000000001||ys(t,this.problem.end)<n-0.000000001)return;let o=t.parentIndex>=0?this.nodes[t.parentIndex]:void 0;if(!o||o.layerIndex===t.layerIndex||!jO(o,t))for(let r=0;r<this.problem.layers.length;r++)r!==t.layerIndex&&(this.problem.obstacleIndex.collidesVia({point:t,layers:this.problem.layers,padDiameter:this.problem.viaDiameter,holeDiameter:this.problem.viaHoleDiameter,connectionNames:this.problem.connectionNames,ignoreTraceIndex:this.problem.ignoreTraceIndex,ignoreTraceIndices:this.problem.softTraceIndices,ignoreRouteRange:this.problem.ignoreRouteRange,obstacleClearance:this.problem.obstacleClearance,blockSameNetObstacles:!0,sameNetObstacleClearance:0,otherNewViaPoints:t.viaPoints,fixedVias:this.problem.fixedVias})||this.enqueueNode({row:t.row,column:t.column,x:t.x,y:t.y,layerIndex:r,viaCount:t.viaCount+1,viaPoints:[...t.viaPoints,{x:t.x,y:t.y}],g:t.g+this.problem.viaCost,parentIndex:e}))}enqueueNode(e){let t=this.toStateIndex(e);if(this.closed.has(t)||e.g>=(this.bestCost.get(t)??Number.POSITIVE_INFINITY))return;this.bestCost.set(t,e.g);let n=e.g+this.heuristic(e),o=this.nodes.length;this.nodes.push({...e,f:n}),this.open.push(o,n)}endpointCollides(e,t){return this.getSafeSegmentWidth({...e,layerIndex:t,viaCount:0},e)<=0}segmentCollides(e,t){return this.getSafeSegmentWidth(e,t)<=0}getSafeSegmentWidth(e,t){let n=this.problem.layers[e.layerIndex],o=this.problem.startLayers.length===1&&e.viaCount===0&&n===this.problem.originalStartLayer&&ys(this.problem.start,e)<=this.problem.maxStartNeckLength+0.000000001&&ys(this.problem.start,t)<=this.problem.maxStartNeckLength+0.000000001,r=this.problem.endLayers.length===1&&n===this.problem.originalEndLayer&&ys(this.problem.end,e)<=this.problem.maxEndNeckLength+0.000000001&&ys(this.problem.end,t)<=this.problem.maxEndNeckLength+0.000000001,i=Math.max(o?this.problem.startNeckWidth:0,r?this.problem.endNeckWidth:0),s=[e.x,e.y,t.x,t.y,e.layerIndex,e.viaCount,i].join(":"),a=this.segmentWidthCache.get(s);if(a!==void 0)return a;let c=(h)=>!this.problem.obstacleIndex.collides({start:e,end:t,layer:n,width:h,connectionNames:this.problem.connectionNames,ignoreTraceIndex:this.problem.ignoreTraceIndex,ignoreTraceIndices:this.problem.softTraceIndices,ignoreRouteRange:this.problem.ignoreRouteRange,obstacleClearance:this.problem.obstacleClearance}),l=0;if(o||r){let d=Math.ceil((i-0.000000001)/0.025),u=Math.floor((this.problem.traceWidth+0.000000001)/0.025);for(;d<=u;){let _=Math.floor((d+u)/2),p=Number((_*0.025).toFixed(6));c(p)?(l=p,d=_+1):u=_-1}l<i-0.000000001&&c(i)&&(l=i)}else l=c(this.problem.traceWidth)?this.problem.traceWidth:0;return this.segmentWidthCache.set(s,l),l}reconstructRoute(e){let t=[],n=e;for(;n>=0;){let a=this.nodes[n];t.push(a),n=a.parentIndex}t.reverse();let o=t[t.length-1];jO(o,this.problem.end)||t.push({...o,...this.problem.end,row:this.targetCell.row,column:this.targetCell.column,parentIndex:-1});let r=[],i=[t[0]];for(let a=1;a<t.length;a++){let c=t[a-1],l=t[a];l.layerIndex!==c.layerIndex?(r.push(i),i=[l]):i.push(l)}r.push(i);let s=[];for(let a=0;a<r.length;a++){let c=this.simplifySection(r[a]),l=c.slice(0,-1).map((u,_)=>this.getSafeSegmentWidth(u,c[_+1])),h=c.map((u,_)=>({route_type:"wire",x:u.x,y:u.y,layer:this.problem.layers[u.layerIndex],width:l.length===0?Math.min(this.problem.startNeckWidth,this.problem.endNeckWidth):_===0?l[0]:_===c.length-1?l[l.length-1]:Math.min(l[_-1],l[_])}));s.push(...h);let d=r[a+1];if(d){let u=this.problem.layers[c.at(-1).layerIndex],_=this.problem.layers[d[0].layerIndex],p=c.at(-1);s.push({route_type:"via",x:p.x,y:p.y,from_layer:u,to_layer:_,via_diameter:this.problem.viaDiameter,via_hole_diameter:this.problem.viaHoleDiameter})}}return{route:s,traceWidth:this.problem.traceWidth,startNeckWidth:this.problem.startNeckWidth,endNeckWidth:this.problem.endNeckWidth,gridSize:this.problem.gridSize,gridOffset:this.problem.gridOffset,viaCount:r.length-1}}simplifySection(e){return e.length<=2?e:this.problem.neckPenaltyExponent>1?this.simplifyStrictSection(e):this.simplifyWidthPreservingSection(e)}simplifyStrictSection(e){let t=e.slice(0,-1).map((i,s)=>this.getSafeSegmentWidth(i,e[s+1])),n=[0];for(let i=0;i<t.length;i++)n.push(n[i]+this.getWidthPenalizedCost(e[i],e[i+1],t[i]));let o=[e[0]],r=0;for(;r<e.length-1;){let i=e.length-1;for(;i>r+1&&!this.shortcutPreservesRouteQuality(e,t,n,r,i);)i--;o.push(e[i]),r=i}return this.removeRedundantCollinearPoints(o)}shortcutPreservesRouteQuality(e,t,n,o,r){let i=this.getSafeSegmentWidth(e[o],e[r]);if(i<=0)return!1;let s=Number.POSITIVE_INFINITY;for(let c=o;c<r;c++)s=Math.min(s,t[c]);let a=n[r]-n[o];return i>=s-0.000000001&&this.getWidthPenalizedCost(e[o],e[r],i)<=a+0.000000001}getWidthPenalizedCost(e,t,n){return ys(e,t)*Math.max(1,(this.problem.traceWidth/n)**this.problem.neckPenaltyExponent)}simplifyWidthPreservingSection(e){let t=e.slice(0,-1).map((c,l)=>this.getSafeSegmentWidth(c,e[l+1])),n=[0];for(let c=0;c<t.length;c++)n.push(n[c]+ys(e[c],e[c+1])*Math.max(1,(this.problem.traceWidth/t[c])**this.problem.neckPenaltyExponent));let o=new Float64Array(e.length).fill(Number.POSITIVE_INFINITY),r=new Float64Array(e.length).fill(Number.POSITIVE_INFINITY),i=new Int32Array(e.length).fill(-1);o[0]=0,r[0]=0;for(let c=1;c<e.length;c++){let l=Number.POSITIVE_INFINITY;for(let h=c-1;h>=0;h--){if(l=Math.min(l,t[h]),!Number.isFinite(o[h]))continue;let d=this.getSafeSegmentWidth(e[h],e[c]);if(d<l-0.000000001)continue;let u=ys(e[h],e[c]);if(u*Math.max(1,(this.problem.traceWidth/d)**this.problem.neckPenaltyExponent)>n[c]-n[h]+0.000000001)continue;let _=o[h]+u*Math.max(0,this.problem.traceWidth-d),p=r[h]+u;(_<o[c]-0.000000001||Math.abs(_-o[c])<=0.000000001&&p<r[c]-0.000000001)&&(o[c]=_,r[c]=p,i[c]=h)}}let s=[],a=e.length-1;for(;a>=0&&(s.push(e[a]),a!==0);)if(a=i[a],a<0)return e;return s.reverse(),this.removeRedundantCollinearPoints(s)}removeRedundantCollinearPoints(e){return e.filter((t,n,o)=>{if(n===0||n===o.length-1)return!0;let r=o[n-1],i=o[n+1],s=(t.x-r.x)*(i.y-t.y)-(t.y-r.y)*(i.x-t.x),a=Math.abs(this.getSafeSegmentWidth(r,t)-this.getSafeSegmentWidth(t,i))<0.000000001;return Math.abs(s)>0.00000001||!a})}pointToCell(e){return{column:C0(Math.round((e.x-this.origin.x)/this.problem.gridSize),0,this.columns-1),row:C0(Math.round((e.y-this.origin.y)/this.problem.gridSize),0,this.rows-1)}}cellToPoint(e,t){return{x:this.origin.x+t*this.problem.gridSize,y:this.origin.y+e*this.problem.gridSize}}toStateIndex(e){let t=((e.viaCount*this.problem.layers.length+e.layerIndex)*this.rows+e.row)*this.columns+e.column;if(e.viaCount!==1||e.viaPoints.length===0||ys(e,e.viaPoints[0])>=this.problem.viaHoleDiameter+this.problem.obstacleIndex.minViaHoleEdgeToViaHoleEdgeClearance-0.000000001)return t;let n=this.pointToCell(e.viaPoints[0]);return t+(1+n.row*this.columns+n.column)*this.baseStateCount}heuristic(e){return ys(e,this.problem.end)}createStats(){return{phase:"layer-aware-grid-search",gridSize:this.problem.gridSize,traceWidth:this.problem.traceWidth,startNeckWidth:this.problem.startNeckWidth,endNeckWidth:this.problem.endNeckWidth,maxViaCount:this.problem.maxViaCount,minViaCount:this.problem.minViaCount,openStates:this.open.size,closedStates:this.closedStateCount,trackedStates:this.bestCost.size,stateSpaceUpperBound:this.stateSpaceUpperBound}}computeProgress(){return Math.min(0.99,this.iterations/this.MAX_ITERATIONS)}getOutput(){return this.output}getConstructorParams(){let{obstacleIndex:e,...t}=this.problem;return[t]}visualize(){let e=this.nodes.filter((r)=>this.closed.has(this.toStateIndex(r))).slice(-2000).map((r)=>({x:r.x,y:r.y,color:`${q3e[r.layerIndex%q3e.length]}55`})),t=[],n=[],o=this.output?.route??[];for(let r=0;r<o.length-1;r++){let i=o[r],s=o[r+1];if(i?.route_type==="wire"&&s?.route_type==="wire"&&i.layer===s.layer){let a=this.problem.layers.indexOf(i.layer);t.push({points:[i,s],strokeColor:q3e[a%q3e.length]??"#333",strokeWidth:i.width})}i?.route_type==="via"&&n.push({center:i,radius:(i.via_diameter??this.problem.viaDiameter)/2,fill:"#d4a017"})}return{coordinateSystem:"cartesian",title:this.getSolverName(),rects:[{center:{x:(this.searchBounds.minX+this.searchBounds.maxX)/2,y:(this.searchBounds.minY+this.searchBounds.maxY)/2},width:this.searchBounds.maxX-this.searchBounds.minX,height:this.searchBounds.maxY-this.searchBounds.minY,stroke:"#777"}],points:[...e,{...this.problem.start,color:"green",label:"reroute start"},{...this.problem.end,color:"purple",label:"reroute target"}],lines:t,circles:n,texts:[]}}},J3e=[{direction:1,strength:0.7},{direction:-1,strength:0.7},{direction:1,strength:1},{direction:-1,strength:1}],lIr=(e,t,n)=>{let o=n.x-t.x,r=n.y-t.y,i=o*o+r*r;if(i<=0.000000000001)return{...t};let s=C0(((e.x-t.x)*o+(e.y-t.y)*r)/i,0,1);return{x:t.x+o*s,y:t.y+r*s}},QXe=class extends NV{problem;phase="prepare-candidate";variantCursor=0;relaxationIteration=0;candidatePoints=[];sampledPoints;output=null;constructor(e){super(),this.problem=e,this.sampledPoints=this.sampleRoute(),this.MAX_ITERATIONS=100,this.stats=this.createStats()}getSolverName(){return"ElasticTracePushSolver"}_step(){switch(this.phase){case"prepare-candidate":if(this.variantCursor>=J3e.length)return this.failed=!0,void(this.error="No collision-free elastic displacement found");this.candidatePoints=this.sampledPoints.map((e)=>({...e})),this.relaxationIteration=0,this.phase="relax-candidate";break;case"relax-candidate":this.relaxCandidate(),this.relaxationIteration++,this.relaxationIteration>=10&&(this.phase="validate-candidate");break;case"validate-candidate":{let e=this.simplifyCandidate(this.candidatePoints);this.pathCollides(e)?(this.variantCursor++,this.phase="prepare-candidate"):(this.output={points:e,traceWidth:this.problem.traceWidth},this.phase="complete");break}case"complete":this.solved=!0}this.stats=this.createStats()}sampleRoute(){let e=[],t=C0(2*this.problem.traceWidth,0.2,0.45),n=this.problem.trace.route;for(let o=this.problem.range.startIndex;o<this.problem.range.endIndex;o++){let r=n[o],i=n[o+1];if(r?.route_type!=="wire"||i?.route_type!=="wire"||r.layer!==i.layer)continue;e.length===0&&e.push({x:r.x,y:r.y});let s=ys(r,i),a=Math.max(1,Math.ceil(s/t));for(let c=1;c<=a;c++){let l=c/a;e.push({x:r.x+(i.x-r.x)*l,y:r.y+(i.y-r.y)*l})}}return e}relaxCandidate(){let e=J3e[this.variantCursor],t=this.candidatePoints.map((o)=>({...o})),n=new Uint8Array(this.candidatePoints.length);for(let o=1;o<this.candidatePoints.length-1;o++){let r=this.candidatePoints[o],i=this.findNearestCorridorSegment(r);if(!i)continue;let s=ys(i.segment.start,i.segment.end);if(s<=0.000000001)continue;let a=i.segment.width/2+this.problem.traceWidth/2+this.problem.obstacleIndex.clearance+0.025;if(i.distance>a+0.35)continue;let c={x:(i.segment.start.y-i.segment.end.y)/s*e.direction,y:(i.segment.end.x-i.segment.start.x)/s*e.direction},l=a-((r.x-i.closest.x)*c.x+(r.y-i.closest.y)*c.y);if(l<=0)continue;let h=Math.min(0.35,l*e.strength);t[o]={x:r.x+c.x*h,y:r.y+c.y*h},n[o]=1}for(let o=1;o<t.length-1;o++){if(!n[o])continue;let r=t[o-1],i=t[o],s=t[o+1];t[o]={x:0.85*i.x+(r.x+s.x)/2*0.15,y:0.85*i.y+(r.y+s.y)/2*0.15}}this.candidatePoints=t}findNearestCorridorSegment(e){let t;for(let n of this.problem.corridor){if(n.layer!==this.problem.layer)continue;let o=lIr(e,n.start,n.end),r=ys(e,o);(!t||r<t.distance)&&(t={segment:n,closest:o,distance:r})}return t}simplifyCandidate(e){if(e.length<=2)return e;let t=[e[0]],n=0;for(;n<e.length-1;){let o=e.length-1;for(;o>n+1&&this.segmentCollides(e[n],e[o]);)o--;t.push(e[o]),n=o}return t.filter((o,r,i)=>r===0||!jO(o,i[r-1]))}pathCollides(e){if(e.length<2)return!0;for(let t=0;t<e.length-1;t++)if(this.segmentCollides(e[t],e[t+1]))return!0;return!1}segmentCollides(e,t){return this.problem.obstacleIndex.collides({start:e,end:t,layer:this.problem.layer,width:this.problem.traceWidth,connectionNames:this.problem.connectionNames,ignoreTraceIndex:-1})}createStats(){let e=J3e[this.variantCursor];return{phase:this.phase,direction:e?.direction,strength:e?.strength,variantCursor:this.variantCursor,relaxationIteration:this.relaxationIteration,sampledPointCount:this.sampledPoints.length}}computeProgress(){return Math.min(0.99,(this.variantCursor+this.relaxationIteration/12)/J3e.length)}getOutput(){return this.output}getConstructorParams(){return[this.problem]}visualize(){return{coordinateSystem:"cartesian",title:`Elastic trace push: ${this.phase}`,lines:[...this.problem.corridor.map((e)=>({points:[e.start,e.end],strokeColor:"rgba(255, 128, 0, 0.6)",strokeWidth:e.width})),...this.candidatePoints.length>1?[{points:this.candidatePoints,strokeColor:"#1769d2",strokeWidth:this.problem.traceWidth}]:[]],points:[],rects:[],circles:[],texts:[]}}},ybe=(e,t)=>{let n=Math.abs(t.x-e.x),o=Math.abs(t.y-e.y);return n<=hr||o<=hr||Math.abs(n-o)<=hr},kXe=(e)=>{let t=0;for(let n=0;n<e.length-1;n++)ybe(e[n],e[n+1])||t++;return t},Ale=(e)=>{let t=0;for(let n=0;n<e.length-1;n++)t+=ys(e[n],e[n+1]);return t},hIr=(e)=>e.filter((t,n)=>n===0||!jO(t,e[n-1])),gln=(e,t)=>{let n=t.x-e.x,o=t.y-e.y,r=Math.abs(n),i=Math.abs(o),s=Math.sign(n),a=Math.sign(o),c=[];ybe(e,t)&&c.push([e,t]),c.push([e,{x:t.x,y:e.y},t],[e,{x:e.x,y:t.y},t]),r>=i?c.push([e,{x:t.x-s*i,y:e.y},t],[e,{x:e.x+s*i,y:t.y},t]):c.push([e,{x:e.x,y:t.y-a*r},t],[e,{x:t.x,y:e.y+a*r},t]);let l=new Map;for(let h of c){let d=hIr(h);if(d.length<2||d.some((_,p)=>p<d.length-1&&!ybe(_,d[p+1])))continue;let u=d.map((_)=>`${_.x.toFixed(6)},${_.y.toFixed(6)}`).join(";");l.set(u,d)}return[...l.values()].sort((h,d)=>Ale(h)-Ale(d)||h.length-d.length)},dIr=class{nodeIndices=[];priorities=[];get size(){return this.nodeIndices.length}push(e,t){let n=this.nodeIndices.length;for(this.nodeIndices.push(e),this.priorities.push(t);n>0;){let o=n-1>>1;if(this.priorities[o]<=t)break;this.swap(n,o),n=o}}pop(){let e=this.nodeIndices[0],t=this.nodeIndices.pop(),n=this.priorities.pop();if(this.nodeIndices.length===0)return e;this.nodeIndices[0]=t,this.priorities[0]=n;let o=0;for(;;){let r=2*o+1,i=r+1;if(r>=this.nodeIndices.length)break;let s=r;if(i<this.nodeIndices.length&&this.priorities[i]<this.priorities[r]&&(s=i),this.priorities[o]<=this.priorities[s])break;this.swap(o,s),o=s}return e}swap(e,t){[this.nodeIndices[e],this.nodeIndices[t]]=[this.nodeIndices[t],this.nodeIndices[e]],[this.priorities[e],this.priorities[t]]=[this.priorities[t],this.priorities[e]]}},uIr=[[-1,-1],[-1,0],[-1,1],[0,-1],[0,1],[1,-1],[1,0],[1,1]],xbe=class extends NV{problem;searchBounds;rows;columns;origin;nodes=[];open=new dIr;bestCost;closed;closedCellCount=0;targetCell;output=null;constructor(e){super(),this.problem=e;let t=e.traceWidth/2+e.obstacleIndex.clearance,n=C0(Math.min(e.start.x,e.end.x)-e.searchPadding,e.bounds.minX+t,e.bounds.maxX-t),o=C0(Math.max(e.start.x,e.end.x)+e.searchPadding,e.bounds.minX+t,e.bounds.maxX-t),r=C0(Math.min(e.start.y,e.end.y)-e.searchPadding,e.bounds.minY+t,e.bounds.maxY-t),i=C0(Math.max(e.start.y,e.end.y)+e.searchPadding,e.bounds.minY+t,e.bounds.maxY-t),s=Math.floor((n-e.gridOffset.x)/e.gridSize)*e.gridSize+e.gridOffset.x,a=Math.floor((r-e.gridOffset.y)/e.gridSize)*e.gridSize+e.gridOffset.y;if(this.origin={x:s,y:a},this.columns=Math.max(2,Math.floor((o-s)/e.gridSize)+1),this.rows=Math.max(2,Math.floor((i-a)/e.gridSize)+1),this.searchBounds={minX:s,minY:a,maxX:s+(this.columns-1)*e.gridSize,maxY:a+(this.rows-1)*e.gridSize},this.bestCost=new Float64Array(this.rows*this.columns).fill(Number.POSITIVE_INFINITY),this.closed=new Uint8Array(this.rows*this.columns),this.endpointCollides(e.start)||this.endpointCollides(e.end))return this.failed=!0,this.error="Grid-route endpoint violates obstacle clearance",this.targetCell={row:0,column:0},this.MAX_ITERATIONS=1,void(this.stats=this.createStats());let c=this.pointToCell(e.start);this.targetCell=this.pointToCell(e.end);let l={...c,x:e.start.x,y:e.start.y,g:0,f:this.heuristic(e.start),parentIndex:-1};this.nodes.push(l),this.open.push(0,l.f),this.bestCost[this.toFlatIndex(c.row,c.column)]=0,this.MAX_ITERATIONS=Math.min(5000,Math.max(1000,this.rows*this.columns*2)),this.stats=this.createStats()}endpointCollides(e){return this.problem.obstacleIndex.collides({start:e,end:e,layer:this.problem.layer,width:this.problem.traceWidth,connectionNames:this.problem.connectionNames,ignoreTraceIndex:this.problem.ignoreTraceIndex,ignoreRouteRange:this.problem.ignoreRouteRange,obstacleClearance:this.problem.obstacleClearance})}getSolverName(){return`ObstacleAwareGridRouteSolver(${this.problem.gridSize.toFixed(3)}mm)`}_step(){if(this.open.size===0)return this.failed=!0,void(this.error="No collision-free grid route found");let e=this.open.pop(),t=this.nodes[e],n=this.toFlatIndex(t.row,t.column);if(!this.closed[n]){if(this.closed[n]=1,this.closedCellCount++,t.row===this.targetCell.row&&t.column===this.targetCell.column&&this.getAllowedConnector(t,this.problem.end)!==null)return this.output={points:this.reconstructPath(e),traceWidth:this.problem.traceWidth,gridSize:this.problem.gridSize,gridOffset:this.problem.gridOffset},this.solved=!0,void(this.stats=this.createStats());for(let[o,r]of uIr){let i=t.row+o,s=t.column+r;if(i<0||i>=this.rows||s<0||s>=this.columns)continue;let a=this.toFlatIndex(i,s);if(this.closed[a])continue;let c=t.parentIndex===-1&&this.problem.requireOctilinear,l=this.problem.gridSize*(o!==0&&r!==0?Math.SQRT2:1);if(!c&&t.g+l>=this.bestCost[a])continue;let h=this.cellToPoint(i,s),d=this.getAllowedConnector(t,h);if(d===null)continue;c&&(l=Ale(d));let u=t.g+l;if(u>=this.bestCost[a])continue;this.bestCost[a]=u;let _=u+this.heuristic(h),p=this.nodes.length;this.nodes.push({row:i,column:s,...h,g:u,f:_,parentIndex:e}),this.open.push(p,_)}this.stats=this.createStats()}}segmentCollides(e,t){return this.problem.obstacleIndex.collides({start:e,end:t,layer:this.problem.layer,width:this.problem.traceWidth,connectionNames:this.problem.connectionNames,ignoreTraceIndex:this.problem.ignoreTraceIndex,ignoreRouteRange:this.problem.ignoreRouteRange,obstacleClearance:this.problem.obstacleClearance})}getAllowedConnector(e,t){return this.problem.requireOctilinear&&(("parentIndex"in e)&&e.parentIndex===-1||jO(t,this.problem.end))?gln(e,t).find((n)=>n.slice(0,-1).every((o,r)=>!this.segmentCollides(o,n[r+1])))??null:this.segmentCollides(e,t)?null:[e,t]}pointToCell(e){return{column:C0(Math.round((e.x-this.origin.x)/this.problem.gridSize),0,this.columns-1),row:C0(Math.round((e.y-this.origin.y)/this.problem.gridSize),0,this.rows-1)}}cellToPoint(e,t){return{x:this.origin.x+t*this.problem.gridSize,y:this.origin.y+e*this.problem.gridSize}}toFlatIndex(e,t){return e*this.columns+t}heuristic(e){return Math.hypot(this.problem.end.x-e.x,this.problem.end.y-e.y)}reconstructPath(e){let t=[],n=e;for(;n>=0;){let i=this.nodes[n];t.push({x:i.x,y:i.y}),n=i.parentIndex}if(t.reverse(),jO(t[0],this.problem.start)||t.unshift({...this.problem.start}),jO(t[t.length-1],this.problem.end)||t.push({...this.problem.end}),this.problem.requireOctilinear){let i=[t[0]];for(let s=0;s<t.length-1;s++){let a=t[s],c=t[s+1],l=s===0||s===t.length-2?this.getAllowedConnector(s===0?{...a,parentIndex:-1}:a,c):[a,c];if(!l)return t;i.push(...l.slice(1))}return i.filter((s,a,c)=>{if(a===0||a===c.length-1)return!0;let l=c[a-1],h=c[a+1],d=(s.x-l.x)*(h.y-s.y)-(s.y-l.y)*(h.x-s.x);return Math.abs(d)>0.00000001||!ybe(l,h)})}let o=[t[0]],r=0;for(;r<t.length-1;){let i=t.length-1;for(;i>r+1&&this.segmentCollides(t[r],t[i]);)i--;o.push(t[i]),r=i}return o.filter((i,s,a)=>{if(s===0||s===a.length-1)return!0;let c=a[s-1],l=a[s+1],h=(i.x-c.x)*(l.y-i.y)-(i.y-c.y)*(l.x-i.x);return Math.abs(h)>0.00000001})}createStats(){return{phase:"obstacle-aware-grid-search",gridSize:this.problem.gridSize,traceWidth:this.problem.traceWidth,gridOffset:this.problem.gridOffset,openCells:this.open.size,closedCells:this.closedCellCount,gridCells:this.rows*this.columns}}computeProgress(){return Math.min(0.99,this.iterations/this.MAX_ITERATIONS)}getOutput(){return this.output}getConstructorParams(){let{obstacleIndex:e,...t}=this.problem;return[t]}visualize(){let e=this.nodes.filter((n)=>this.closed[this.toFlatIndex(n.row,n.column)]).slice(-2000).map((n)=>({x:n.x,y:n.y,color:"rgba(0,90,255,0.22)"})),t=this.output?.points??[];return{coordinateSystem:"cartesian",title:this.getSolverName(),rects:[{center:{x:(this.searchBounds.minX+this.searchBounds.maxX)/2,y:(this.searchBounds.minY+this.searchBounds.maxY)/2},width:this.searchBounds.maxX-this.searchBounds.minX,height:this.searchBounds.maxY-this.searchBounds.minY,stroke:"#777"}],points:[...e,{...this.problem.start,color:"green",label:"reroute start"},{...this.problem.end,color:"purple",label:"reroute target"}],lines:t.length>1?[{points:t,strokeColor:"#00a050",strokeWidth:this.problem.traceWidth}]:[],circles:[],texts:[]}}},yb=class{items;clearance;minPadEdgeToPadEdgeClearance;holeClearance;boardEdgeClearance;boardLayers;minViaHoleEdgeToViaHoleEdgeClearance;defaultViaHoleDiameter;bounds;maxIndexedViaHoleDiameter;index;connectionNameSets;copperObjectIds;connectionNameResolver;connectedPads;dynamicTraceIndex;constructor(e,t,n,o=[],r=new Tw(e,t)){var i;this.bounds=e.bounds,this.boardLayers=(i=e.layerCount,["top",...Array.from({length:Math.max(0,i-2)},(a,c)=>`inner${c+1}`),...i>1?["bottom"]:[]]),this.dynamicTraceIndex=n,this.clearance=Math.max(e.defaultObstacleMargin??0,e.minTraceToPadEdgeClearance??0,0.1),this.holeClearance=e.minTraceToHoleEdgeClearance??this.clearance,this.minPadEdgeToPadEdgeClearance=e.minPadEdgeToPadEdgeClearance??this.clearance,this.boardEdgeClearance=e.minBoardEdgeClearance??this.clearance,this.minViaHoleEdgeToViaHoleEdgeClearance=Math.max(e.minViaHoleEdgeToViaHoleEdgeClearance??0,0.1),this.defaultViaHoleDiameter=e.min_via_hole_diameter??e.minViaHoleDiameter??0.3,this.items=[...e.obstacles.flatMap((a,c)=>function(l,h=0.6){if(l.isNonPlatedHole&&l.shape==="circle"){let g=l.width/2;return[{minX:l.center.x-g,minY:l.center.y-g,maxX:l.center.x+g,maxY:l.center.y+g,layers:l.layers,kind:"obstacle",obstacleKind:"hole",connectionNames:l.connectedTo,exactShape:{type:"circle",center:l.center,radius:g}}]}let d=(l.ccwRotationDegrees??0)*Math.PI/180,u=Math.max(1,Math.ceil(l.width/h)),_=Math.max(1,Math.ceil(l.height/h)),p=l.width/u,m=l.height/_,A=[];for(let g=0;g<_;g++)for(let f=0;f<u;f++){let y={x:l.center.x-l.width/2+(f+0.5)*p,y:l.center.y-l.height/2+(g+0.5)*m},x=p/2,C=m/2,b=[{x:y.x-x,y:y.y-C},{x:y.x+x,y:y.y-C},{x:y.x+x,y:y.y+C},{x:y.x-x,y:y.y+C}].map((I)=>sIr(I,l.center,d));A.push({minX:Math.min(...b.map((I)=>I.x)),minY:Math.min(...b.map((I)=>I.y)),maxX:Math.max(...b.map((I)=>I.x)),maxY:Math.max(...b.map((I)=>I.y)),layers:l.layers,kind:"obstacle",obstacleKind:l.isNonPlatedHole?"hole":l.connectedTo[0]?.startsWith("pcb_via_")?"via":l.connectedTo[0]?.startsWith("pcb_smtpad_")||l.connectedTo[0]?.startsWith("pcb_plated_hole_")?"pad":"other",connectionNames:l.connectedTo,exactShape:{type:"polygon",points:b}})}return A}(a).map((l)=>({...l,copperObjectId:`obstacle:${c}`}))),...this.createTraceItems(e.fixedTraces??[],!0),...this.createTraceItems(t),...o],this.maxIndexedViaHoleDiameter=this.items.reduce((a,c)=>c.kind==="via"?Math.max(a,c.viaHoleDiameter??this.defaultViaHoleDiameter):a,this.defaultViaHoleDiameter),this.connectionNameResolver=r,r.setCacheableObstacles(e.obstacles);let s=new Map;this.connectionNameSets=this.items.map((a)=>{let c=s.get(a.connectionNames);return c||(c=r.canonicalizeToSet(a.connectionNames),s.set(a.connectionNames,c)),c}),this.copperObjectIds=this.items.map((a,c)=>a.copperObjectId??`indexed-item:${c}`),this.connectedPads=e.obstacles.flatMap((a)=>a.connectedTo.some((c)=>c.startsWith("pcb_smtpad_")||c.startsWith("pcb_plated_hole_"))?[{obstacle:a,canonicalConnectionNames:r.canonicalizeToSet(a.connectedTo)}]:[]),this.index=this.items.length>0?new i_(this.items.length):null;for(let a of this.items)this.index.add(a.minX,a.minY,a.maxX,a.maxY);this.index?.finish()}createTraceItems(e,t=!1){let n=[];for(let o=0;o<e.length;o++){let r=e[o],i=t?void 0:o,s=`${t?"fixed-trace":"trace"}:${o}`,a=!t&&o===this.dynamicTraceIndex,c=[r.connection_name,r.source_trace_id,r.rootConnectionName,...r.mergedConnectionNames??[],...r.connectsTo??[]].filter((l)=>Boolean(l));for(let l=0;l<r.route.length;l++){let h=r.route[l];if(h.route_type==="via"){let u=h.via_diameter??0.6;n.push({minX:h.x-u/2,minY:h.y-u/2,maxX:h.x+u/2,maxY:h.y+u/2,layers:this.boardLayers,kind:"via",connectionNames:c,copperObjectId:s,traceIndex:i,routeStartIndex:l,routeEndIndex:l,viaHoleDiameter:h.via_hole_diameter??this.defaultViaHoleDiameter,exactShape:{type:"circle",center:{x:h.x,y:h.y},radius:u/2}});continue}if(a)continue;let d=r.route[l+1];h.route_type==="wire"&&d?.route_type==="wire"&&h.layer===d.layer&&n.push(..._ln({start:h,end:d,width:h.width,base:{layers:[h.layer],kind:"trace",connectionNames:c,copperObjectId:s,traceIndex:i,routeStartIndex:l,routeEndIndex:l+1}}))}}return n}collides(e){if(this.isOutsideBounds(e))return!0;let{radius:t,candidates:n,canonicalConnectionNames:o}=this.getCollisionCandidates(e);for(let r of n)if(this.itemCollides(r,e,t,o))return!0;return!1}findCollisions(e){let{radius:t,candidates:n,canonicalConnectionNames:o}=this.getCollisionCandidates(e),r=[];for(let i of n)this.itemCollides(i,e,t,o)&&r.push(this.items[i]);return r}getSameNetCopperContactIds(e){let t=e.width/2,n=this.index?.search(Math.min(e.start.x,e.end.x)-t,Math.min(e.start.y,e.end.y)-t,Math.max(e.start.x,e.end.x)+t,Math.max(e.start.y,e.end.y)+t)??[],o=new Set(this.connectionNameResolver.canonicalize(e.connectionNames)),r=new Set;for(let i of n){let s=this.items[i];s.layers.includes(e.layer)&&(s.traceIndex===e.ignoreTraceIndex||e.ignoreTraceIndices?.includes(s.traceIndex??-1)||[...this.connectionNameSets[i]].some((a)=>o.has(a))&&this.itemCopperTouches(s,e,t)&&r.add(this.copperObjectIds[i]))}return r}getConnectedPadWidthLimit(e){if(Math.hypot(e.end.x-e.start.x,e.end.y-e.start.y)<=0.00001)return null;let t=this.getConnectedPadWidthLimitAtPoint(e,e.start),n=this.getConnectedPadWidthLimitAtPoint(e,e.end);return t===null?n:n===null?t:Math.min(t,n)}getConnectedPadWidthLimitAtPoint(e,t){let n=this.getConnectedPadsAtPoint(e,t);return n.length===0?null:Math.max(...n.map(({obstacle:o})=>this.getPadWidthNormalToQuery(o,e)))}getConnectedPadEndpointWidthLimitAtPoint(e,t){let n=this.getConnectedPadsAtPoint(e,t);return n.length===0?null:Math.max(...n.map(({obstacle:o})=>{let r=this.getObstacleLocalPoint(t,o);return Math.max(0,2*Math.min(o.width/2-Math.abs(r.x),o.height/2-Math.abs(r.y)))}))}getConnectedPadBoundaryPoint(e,t){let n=t==="start"?e.start:e.end,o=t==="start"?e.end:e.start,r=this.getConnectedPadsAtPoint(e,n).sort((i,s)=>this.getPadWidthNormalToQuery(s.obstacle,e)-this.getPadWidthNormalToQuery(i.obstacle,e))[0];return!r||this.pointIsInsideObstacle(o,r.obstacle)?null:this.getObstacleBoundaryPoint(n,o,r.obstacle)}getConnectedPadsAtPoint(e,t){let n=new Set(this.connectionNameResolver.canonicalize(e.connectionNames));return this.connectedPads.filter(({obstacle:o,canonicalConnectionNames:r})=>o.layers.includes(e.layer)&&[...r].some((i)=>n.has(i))&&this.pointIsInsideObstacle(t,o))}pointIsInsideObstacle(e,t){let{x:n,y:o}=this.getObstacleLocalPoint(e,t);return Math.abs(n)<=t.width/2+0.000000001&&Math.abs(o)<=t.height/2+0.000000001}getObstacleLocalPoint(e,t){let n=-(t.ccwRotationDegrees??0)*Math.PI/180,o=Math.cos(n),r=Math.sin(n),i=e.x-t.center.x,s=e.y-t.center.y;return{x:i*o-s*r,y:i*r+s*o}}getPadWidthNormalToQuery(e,t){let n=t.end.x-t.start.x,o=t.end.y-t.start.y,r=Math.hypot(n,o);if(r<=0.000000001)return Math.min(e.width,e.height);let i=-o/r,s=n/r,a=-(e.ccwRotationDegrees??0)*Math.PI/180,c=Math.cos(a),l=Math.sin(a),h=i*c-s*l,d=i*l+s*c;return Math.abs(h)*e.width+Math.abs(d)*e.height}getObstacleBoundaryPoint(e,t,n){let o=-(n.ccwRotationDegrees??0)*Math.PI/180,r=Math.cos(o),i=Math.sin(o),s=(u)=>{let _=u.x-n.center.x,p=u.y-n.center.y;return{x:_*r-p*i,y:_*i+p*r}},a=s(e),c=s(t),l={x:c.x-a.x,y:c.y-a.y},h=[];if(Math.abs(l.x)>0.000000000001){let u=l.x>0?n.width/2:-n.width/2;h.push((u-a.x)/l.x)}if(Math.abs(l.y)>0.000000000001){let u=l.y>0?n.height/2:-n.height/2;h.push((u-a.y)/l.y)}let d=Math.min(...h.filter((u)=>u>=0&&u<=1));return Number.isFinite(d)?{x:e.x+(t.x-e.x)*d,y:e.y+(t.y-e.y)*d}:null}getConnectedLayersAtPoint(e,t){let n=new Set(this.connectionNameResolver.canonicalize(t)),o=new Set,r=this.index?.search(e.x,e.y,e.x,e.y)??[];for(let i of r){let s=this.items[i];if(s.kind!=="obstacle")continue;if(![...this.connectionNameSets[i]].some((a)=>n.has(a)))continue;if(s.exactShape?.type==="polygon"?RXe(e,e,s.exactShape.points)<=0.000000001:s.exactShape?.type==="circle"?Math.hypot(s.exactShape.center.x-e.x,s.exactShape.center.y-e.y)<=s.exactShape.radius+0.000000001:e.x>=s.minX-0.000000001&&e.x<=s.maxX+0.000000001&&e.y>=s.minY-0.000000001&&e.y<=s.maxY+0.000000001)for(let a of s.layers)o.add(a)}return[...o]}collidesVia(e){return this.getViaViolationSignatures(e).size>0}getViaViolationSignatures(e){let t=new Set;for(let a of e.layers){let c={isVia:!0,start:e.point,end:e.point,layer:a,width:e.padDiameter,connectionNames:e.connectionNames,ignoreTraceIndex:e.ignoreTraceIndex,ignoreTraceIndices:e.ignoreTraceIndices,ignoreRouteRange:e.ignoreRouteRange,obstacleClearance:e.obstacleClearance,blockSameNetObstacles:e.blockSameNetObstacles,sameNetObstacleClearance:e.sameNetObstacleClearance};this.isOutsideBounds(c)&&t.add(`board-edge:${a}`);let{radius:l,candidates:h,canonicalConnectionNames:d}=this.getCollisionCandidates(c);for(let u of h)this.itemCollides(u,c,l,d)&&t.add(`copper:${a}:${this.getViolationObjectId(u)}`)}let n=e.holeDiameter+this.minViaHoleEdgeToViaHoleEdgeClearance;for(let a of e.otherNewViaPoints??[])Math.hypot(a.x-e.point.x,a.y-e.point.y)<n-0.000000001&&t.add(`new-via-drill:${a.x},${a.y}:${e.holeDiameter}`);let o=e.fixedVias??[];for(let a=0;a<o.length;a++){let c=o[a],l=e.holeDiameter/2+c.holeDiameter/2+this.minViaHoleEdgeToViaHoleEdgeClearance;Math.hypot(c.point.x-e.point.x,c.point.y-e.point.y)<l-0.000000001&&t.add(`fixed-via-drill:${a}:${c.point.x},${c.point.y}:${c.holeDiameter}`)}let r=e.holeDiameter/2+this.maxIndexedViaHoleDiameter/2+this.minViaHoleEdgeToViaHoleEdgeClearance,i=this.index?.search(e.point.x-r,e.point.y-r,e.point.x+r,e.point.y+r)??[],s=new Set;for(let a of i){let c=this.items[a];if(c.kind!=="via"||c.exactShape?.type!=="circle")continue;if(c.traceIndex===e.ignoreTraceIndex&&e.ignoreRouteRange&&(c.routeEndIndex??-1)>=e.ignoreRouteRange.start&&(c.routeStartIndex??Number.POSITIVE_INFINITY)<=e.ignoreRouteRange.end)continue;if(e.ignoreTraceIndices?.includes(c.traceIndex??-1))continue;let l=`${this.copperObjectIds[a]??"unknown"}:${c.routeStartIndex??-1}`;if(s.has(l))continue;s.add(l);let h=c.viaHoleDiameter??this.defaultViaHoleDiameter,d=e.holeDiameter/2+h/2+this.minViaHoleEdgeToViaHoleEdgeClearance;Math.hypot(c.exactShape.center.x-e.point.x,c.exactShape.center.y-e.point.y)<d-0.000000001&&t.add(`indexed-via-drill:${this.getViolationObjectId(a)}`)}return t}getViolationObjectId(e){let t=this.items[e],n=this.copperObjectIds[e],o=`${t.routeStartIndex??""}-${t.routeEndIndex??""}`;if(t.kind==="obstacle")return n;if(t.exactShape?.type==="segment"){let{start:r,end:i,width:s}=t.exactShape;return`${n}:${t.kind}:${o}:${r.x},${r.y}:${i.x},${i.y}:${s}`}if(t.exactShape?.type==="circle"){let{center:r,radius:i}=t.exactShape;return`${n}:${t.kind}:${o}:${r.x},${r.y}:${i}`}return t.exactShape?.type==="polygon"?`${n}:${t.kind}:${o}:${t.exactShape.points.map((r)=>`${r.x},${r.y}`).join(";")}`:`${n}:${t.kind}:${o}:${t.minX},${t.minY},${t.maxX},${t.maxY}`}getCollisionCandidates(e){let t=Math.max(this.clearance,this.holeClearance,e.isVia?this.minPadEdgeToPadEdgeClearance:0,e.obstacleClearance??this.clearance,e.sameNetObstacleClearance??0),n=e.width/2+t,o={minX:Math.min(e.start.x,e.end.x)-n,minY:Math.min(e.start.y,e.end.y)-n,maxX:Math.max(e.start.x,e.end.x)+n,maxY:Math.max(e.start.y,e.end.y)+n};return{radius:n,candidates:this.index?.search(o.minX,o.minY,o.maxX,o.maxY)??[],canonicalConnectionNames:this.connectionNameResolver.canonicalize(e.connectionNames)}}itemCollides(e,t,n,o){let r=this.items[e];if(!r.layers.includes(t.layer))return!1;let i=this.connectionNameSets[e],s=o.some((l)=>i.has(l));if(s&&(!t.blockSameNetObstacles||r.kind!=="obstacle"||r.obstacleKind==="via"))return!1;if(r.kind==="trace"&&t.ignoreTraceIndices?.includes(r.traceIndex??-1))return!1;if(r.kind==="trace"&&r.traceIndex===t.ignoreTraceIndex&&t.ignoreRouteRange&&(r.routeEndIndex??-1)>=t.ignoreRouteRange.start&&(r.routeStartIndex??Number.POSITIVE_INFINITY)<=t.ignoreRouteRange.end)return!1;let a=t.isVia&&(r.kind==="via"||r.kind==="obstacle"&&r.obstacleKind==="via")?this.minPadEdgeToPadEdgeClearance:r.kind!=="obstacle"||r.obstacleKind!=="hole"||t.isVia?r.kind==="obstacle"&&r.obstacleKind==="pad"?s&&t.blockSameNetObstacles?t.sameNetObstacleClearance??t.obstacleClearance??this.clearance:t.obstacleClearance??this.clearance:this.clearance:this.holeClearance,c=t.width/2+a;return r.exactShape?.type==="segment"?t$e(t.start,t.end,r.exactShape.start,r.exactShape.end)<=c+r.exactShape.width/2+0.000000001:r.exactShape?.type==="polygon"?RXe(t.start,t.end,r.exactShape.points)<=c+0.000000001:r.exactShape?.type==="circle"?OO(r.exactShape.center,t.start,t.end)<=c+r.exactShape.radius+0.000000001:FUt(t.start,t.end,{minX:r.minX-c,minY:r.minY-c,maxX:r.maxX+c,maxY:r.maxY+c})}itemCopperTouches(e,t,n){return e.exactShape?.type==="segment"?t$e(t.start,t.end,e.exactShape.start,e.exactShape.end)<=n+e.exactShape.width/2+0.000000001:e.exactShape?.type==="polygon"?RXe(t.start,t.end,e.exactShape.points)<=n+0.000000001:e.exactShape?.type==="circle"?OO(e.exactShape.center,t.start,t.end)<=n+e.exactShape.radius+0.000000001:FUt(t.start,t.end,{minX:e.minX-n,minY:e.minY-n,maxX:e.maxX+n,maxY:e.maxY+n})}isOutsideBounds(e){let t=e.width/2+this.boardEdgeClearance;return Math.min(e.start.x,e.end.x)-t<this.bounds.minX||Math.max(e.start.x,e.end.x)+t>this.bounds.maxX||Math.min(e.start.y,e.end.y)-t<this.bounds.minY||Math.max(e.start.y,e.end.y)+t>this.bounds.maxY}},OUt=[{x:0,y:0},{x:0.5,y:0},{x:0,y:0.5},{x:0.5,y:0.5}],e9=(e)=>e?.route_type==="wire",U$=class extends NV{inputProblem;traces;corridor;phase="scan-corridor";corridorCursor=0;blockerCursor=0;offsetCursor=0;resolutionCursor=0;attemptedGridCount=0;blockerIndex;connectionNameResolver;connectionByTraceId=new Map;mutableTraceIndices;blockersByTrace=new Map;blockers=[];currentBlocker=null;currentRange=null;currentTraceWidth=0;gridResolutions=[];currentObstacleIndex=null;output=null;constructor(e,t=new Tw(e.simpleRouteJson,e.traces)){super(),this.inputProblem=structuredClone(e),this.traces=structuredClone(e.traces),this.corridor=structuredClone(e.corridor),this.mutableTraceIndices=e.mutableTraceIndices?new Set(e.mutableTraceIndices):null,this.connectionNameResolver=t,this.blockerIndex=new yb(this.inputProblem.simpleRouteJson,this.traces,e.powerTraceIndex,[],this.connectionNameResolver),this.activeSubSolver=null,this.MAX_ITERATIONS=25000,this.stats=this.createStats()}getSolverName(){return"LocalTraceInflationSolver"}_step(){if(this.activeSubSolver)return this.stepActiveSubSolver(),void(this.stats=this.createStats());switch(this.phase){case"scan-corridor":this.scanNextCorridorSegment();break;case"select-blocker":this.selectNextBlocker();break;case"try-elastic-push":break;case"try-grid-candidate":this.startNextGridCandidate();break;case"complete":this.output?this.solved=!0:(this.failed=!0,this.error="No locally reroutable trace blocks the power corridor")}this.stats=this.createStats()}scanNextCorridorSegment(){let e=this.corridor[this.corridorCursor];if(!e)return this.blockers=[...this.blockersByTrace.values()].sort((o,r)=>o.traceIndex-r.traceIndex),void(this.phase="select-blocker");let t=this.traces[this.inputProblem.powerTraceIndex],n=this.blockerIndex.findCollisions({start:e.start,end:e.end,layer:e.layer,width:e.width,connectionNames:t?this.getTraceConnectionNames(t):[]});for(let o of n)this.recordBlockingTrace(o);this.corridorCursor++}recordBlockingTrace(e){if(e.kind!=="trace"||e.traceIndex===void 0||e.routeStartIndex===void 0||e.routeEndIndex===void 0||e.traceIndex===this.inputProblem.powerTraceIndex||this.mutableTraceIndices!==null&&!this.mutableTraceIndices.has(e.traceIndex))return;let t=this.traces[e.traceIndex];if(!t)return;let n=this.findConnectionForTrace(t);if((n?this.resolveNominalTraceWidth(n):this.getTraceNominalWidth(t))>=(this.inputProblem.pushOnlyNominalWidthsBelow??this.inputProblem.nominalPowerWidth)-hr)return;let o=this.blockersByTrace.get(e.traceIndex);if(o)return o.firstRouteIndex=Math.min(o.firstRouteIndex,e.routeStartIndex),void(o.lastRouteIndex=Math.max(o.lastRouteIndex,e.routeEndIndex));this.blockersByTrace.set(e.traceIndex,{traceIndex:e.traceIndex,firstRouteIndex:e.routeStartIndex,lastRouteIndex:e.routeEndIndex})}selectNextBlocker(){if(this.currentBlocker=this.blockers[this.blockerCursor]??null,!this.currentBlocker)return void(this.phase="complete");let e=this.findStableAnchorRange(this.currentBlocker);if(!e)return void this.blockerCursor++;let t=this.traces[this.currentBlocker.traceIndex];this.currentRange=e,this.currentTraceWidth=this.getRangeWidth(t,e),this.gridResolutions=this.getGridResolutions(this.currentTraceWidth),this.resolutionCursor=0,this.offsetCursor=0,this.currentObstacleIndex=new yb(this.inputProblem.simpleRouteJson,this.traces,this.currentBlocker.traceIndex,this.createInflatedCorridorItems(),this.connectionNameResolver),this.activeSubSolver=new QXe({trace:t,range:e,layer:t.route[e.startIndex].layer,traceWidth:this.currentTraceWidth,corridor:this.corridor,obstacleIndex:this.currentObstacleIndex,connectionNames:this.getTraceConnectionNames(t)}),this.phase="try-elastic-push"}findStableAnchorRange(e){let t=this.traces[e.traceIndex];if(!t)return null;let{firstRouteIndex:n,lastRouteIndex:o}=e;for(;n>0;){let c=t.route[n];if(e9(c)&&this.pointClearsCorridor(c))break;n--}for(;o<t.route.length-1;){let c=t.route[o];if(e9(c)&&this.pointClearsCorridor(c))break;o++}let r=t.route[n],i=t.route[o];if(!e9(r)||!e9(i)||r.layer!==i.layer||!this.pointClearsCorridor(r)||!this.pointClearsCorridor(i)||n>=o)return null;let s={startIndex:n,endIndex:o},a=this.getRangeLength(t,s);return!Number.isFinite(a)||a>(this.inputProblem.maxRerouteLength??10)+hr?null:s}pointClearsCorridor(e){return this.corridor.every((t)=>{if(t.layer!==e.layer)return!0;let n=t.width/2+e.width/2+this.blockerIndex.clearance;return OO(e,t.start,t.end)>=n-hr})}startNextGridCandidate(){if(!this.currentBlocker||!this.currentRange)return void(this.phase="select-blocker");if(this.resolutionCursor>=this.gridResolutions.length)return this.blockerCursor++,void(this.phase="select-blocker");if(this.offsetCursor>=OUt.length)return this.resolutionCursor++,void(this.offsetCursor=0);let e=this.traces[this.currentBlocker.traceIndex],t=e.route[this.currentRange.startIndex],n=e.route[this.currentRange.endIndex];if(!e9(t)||!e9(n))return this.blockerCursor++,void(this.phase="select-blocker");let o=this.gridResolutions[this.resolutionCursor],r=OUt[this.offsetCursor],i=this.currentObstacleIndex;if(!i)return this.blockerCursor++,void(this.phase="select-blocker");this.attemptedGridCount++,this.activeSubSolver=new xbe({start:t,end:n,layer:t.layer,traceWidth:this.currentTraceWidth,gridSize:o,gridOffset:{x:r.x*o,y:r.y*o},connectionNames:this.getTraceConnectionNames(e),obstacleIndex:i,ignoreTraceIndex:this.currentBlocker.traceIndex,ignoreRouteRange:{start:this.currentRange.startIndex,end:this.currentRange.endIndex},bounds:this.inputProblem.simpleRouteJson.bounds,searchPadding:C0(2.5*this.inputProblem.nominalPowerWidth,1.5,4)})}stepActiveSubSolver(){let e=this.activeSubSolver;if(e.step(),e.solved||e.failed){if(e.solved){let t=e.getOutput();if(t)return this.applyRoute(t,e instanceof QXe?"elastic":"grid"),this.activeSubSolver=null,void(this.phase="complete")}this.failedSubSolvers??=[],this.failedSubSolvers.push(e),this.activeSubSolver=null,e instanceof QXe?this.phase="try-grid-candidate":this.offsetCursor++}}applyRoute(e,t){let n=this.currentBlocker,o=this.currentRange,r=this.traces[n.traceIndex],i=r.route[o.startIndex],s=r.route[o.endIndex],a=e.points.map((c)=>({route_type:"wire",x:c.x,y:c.y,width:this.currentTraceWidth,layer:i.layer}));a[0].width=Math.max(a[0].width,i.width),a[a.length-1].width=Math.max(a[a.length-1].width,s.width),r.route.splice(o.startIndex,o.endIndex-o.startIndex+1,...a),this.output={traces:this.traces,pushedTraceIndex:n.traceIndex,replacedRange:o,strategy:t}}createInflatedCorridorItems(){return this.corridor.flatMap((e)=>_ln({start:e.start,end:e.end,width:e.width,base:{layers:[e.layer],kind:"obstacle",connectionNames:[]}}))}getGridResolutions(e){return[C0(1.5*e,0.1,0.3),C0(0.75*e,0.08,0.18)].filter((t,n,o)=>o.findIndex((r)=>Math.abs(r-t)<hr)===n)}getRangeWidth(e,t){let n=this.inputProblem.simpleRouteJson.minTraceWidth;for(let o=t.startIndex;o<=t.endIndex;o++){let r=e.route[o];e9(r)&&(n=Math.max(n,r.width))}return n}getRangeLength(e,t){let n=0;for(let o=t.startIndex;o<t.endIndex;o++){let r=e.route[o],i=e.route[o+1];if(!e9(r)||!e9(i)||r.layer!==i.layer)return Number.POSITIVE_INFINITY;n+=ys(r,i)}return n}resolveNominalTraceWidth(e){return Math.max(e.nominalTraceWidth??e.width??this.inputProblem.simpleRouteJson.nominalTraceWidth??this.inputProblem.simpleRouteJson.minTraceWidth,this.inputProblem.simpleRouteJson.minTraceWidth)}getTraceNominalWidth(e){return e.route.reduce((t,n)=>n.route_type==="wire"?Math.max(t,n.width):t,this.inputProblem.simpleRouteJson.minTraceWidth)}findConnectionForTrace(e){let t=this.connectionByTraceId.get(e.pcb_trace_id);if(t!==void 0)return t??void 0;let n=this.getTraceConnectionNames(e),o=this.inputProblem.simpleRouteJson.connections.find((r)=>[r.name,r.source_trace_id,r.rootConnectionName,r.netConnectionName,...r.mergedConnectionNames??[]].filter((i)=>Boolean(i)).some((i)=>n.includes(i)))??null;return this.connectionByTraceId.set(e.pcb_trace_id,o),o??void 0}getTraceConnectionNames(e){return[e.connection_name,e.source_trace_id,e.rootConnectionName,...e.mergedConnectionNames??[]].filter((t)=>Boolean(t))}createStats(){return{phase:this.phase,corridorSegment:this.corridorCursor,corridorSegmentCount:this.corridor.length,blockingTraceCount:this.blockersByTrace.size,blockerCursor:this.blockerCursor,pushedTraceIndex:this.currentBlocker?.traceIndex,anchorRange:this.currentRange,traceWidth:this.currentTraceWidth,gridSize:this.gridResolutions[this.resolutionCursor],gridOffsetVariant:this.offsetCursor,attemptedGridCount:this.attemptedGridCount}}computeProgress(){return this.phase==="scan-corridor"?this.corridor.length===0?0.25:this.corridorCursor/this.corridor.length*0.25:this.blockers.length===0?0.5:Math.min(0.99,0.25+this.blockerCursor/this.blockers.length)}getOutput(){return this.output}getConstructorParams(){return[this.inputProblem]}visualize(){let e=[];for(let t=0;t<this.traces.length;t++){let n=this.traces[t];for(let o=0;o<n.route.length-1;o++){let r=n.route[o],i=n.route[o+1];e9(r)&&e9(i)&&r.layer===i.layer&&e.push({points:[r,i],strokeColor:t===this.currentBlocker?.traceIndex?"#1769d2":"#777",strokeWidth:Math.max(r.width,i.width)})}}for(let t of this.corridor)e.push({points:[t.start,t.end],strokeColor:"rgba(255, 128, 0, 0.55)",strokeWidth:t.width});return{coordinateSystem:"cartesian",title:this.getSolverName(),lines:e,points:[],rects:[],circles:[],texts:[]}}},x0=0.000001,KO=(e,t)=>Math.hypot(e.x-t.x,e.y-t.y),yw=(e,t,n)=>{let o=n.x-t.x,r=n.y-t.y,i=o*o+r*r,s=i<=0.000000000001?0:Math.max(0,Math.min(1,((e.x-t.x)*o+(e.y-t.y)*r)/i));return Math.hypot(e.x-(t.x+s*o),e.y-(t.y+s*r))},Z3e=(e,t,n)=>(t.x-e.x)*(n.y-e.y)-(t.y-e.y)*(n.x-e.x),n$e=(e,t,n,o)=>((r,i,s,a)=>{let c=Z3e(s,a,r),l=Z3e(s,a,i),h=Z3e(r,i,s),d=Z3e(r,i,a);return(c>0&&l<0||c<0&&l>0)&&(h>0&&d<0||h<0&&d>0)})(e,t,n,o)?0:Math.min(yw(e,n,o),yw(t,n,o),yw(n,e,t),yw(o,e,t)),fle=(e)=>{let t=(e.ccwRotationDegrees??0)*Math.PI/180,n=Math.cos(t),o=Math.sin(t);return[{x:-e.width/2,y:-e.height/2},{x:e.width/2,y:-e.height/2},{x:e.width/2,y:e.height/2},{x:-e.width/2,y:e.height/2}].map((r)=>({x:e.center.x+r.x*n-r.y*o,y:e.center.y+r.x*o+r.y*n}))},W$=(e)=>{if(!(e.type==="oval"||e.shape==="circle"))return!1;if(Math.abs(e.width-e.height)>x0)throw Error(`Physical connectivity does not yet support non-circular oval obstacle ${e.obstacleId??"<unknown>"}`);return!0},yle=(e,t)=>{for(let o=0;o<t.length;o++)if(yw(e,t[o],t[(o+1)%t.length])<=x0)return!0;let n=!1;for(let o=0,r=t.length-1;o<t.length;r=o++){let i=t[o],s=t[r];i.y>e.y!=s.y>e.y&&e.x<(s.x-i.x)*(e.y-i.y)/(s.y-i.y)+i.x&&(n=!n)}return n},xle=(e,t)=>{if(W$(t))return Math.max(0,KO(e,t.center)-t.width/2);let n=fle(t);return yle(e,n)?0:Math.min(...n.map((o,r)=>yw(e,o,n[(r+1)%n.length])))},Aln=(e,t)=>{if(W$(e))return W$(t)?Math.max(0,KO(e.center,t.center)-e.width/2-t.width/2):Math.max(0,xle(e.center,t)-e.width/2);if(W$(t))return Aln(t,e);let n=fle(e),o=fle(t);if(yle(n[0],o)||yle(o[0],n))return 0;let r=Number.POSITIVE_INFINITY;for(let i=0;i<n.length;i++)for(let s=0;s<o.length;s++)r=Math.min(r,n$e(n[i],n[(i+1)%n.length],o[s],o[(s+1)%o.length]));return r},Cbe=(e,t)=>({minX:e.minX-t,minY:e.minY-t,maxX:e.maxX+t,maxY:e.maxY+t}),v6e=(e)=>({minX:e.x,minY:e.y,maxX:e.x,maxY:e.y}),fln=(e)=>{if(W$(e))return Cbe(v6e(e.center),e.width/2);let t=fle(e);return{minX:Math.min(...t.map((n)=>n.x)),minY:Math.min(...t.map((n)=>n.y)),maxX:Math.max(...t.map((n)=>n.x)),maxY:Math.max(...t.map((n)=>n.y))}},vO=(e,t)=>{if(!((n,o)=>n.layers.some((r)=>o.layers.includes(r)))(e,t)||!((n,o)=>n.maxX+x0>=o.minX&&o.maxX+x0>=n.minX&&n.maxY+x0>=o.minY&&o.maxY+x0>=n.minY)(e.bounds,t.bounds))return!1;if(e.kind==="bridge-pad"){let n={kind:"obstacle",obstacle:e.obstacle,layers:e.layers,bounds:e.bounds};return t.kind==="bridge-pad"?vO(n,{kind:"obstacle",obstacle:t.obstacle,layers:t.layers,bounds:t.bounds}):vO(n,t)}return t.kind==="bridge-pad"?vO(t,e):e.kind==="endpoint"?t.kind==="endpoint"?KO(e.point,t.point)<=x0:t.kind==="obstacle"?xle(e.point,t.obstacle)<=x0:t.kind==="segment"?yw(e.point,t.start,t.end)<=t.width/2+x0:KO(e.point,t.center)<=t.diameter/2+x0:t.kind==="endpoint"?vO(t,e):e.kind==="obstacle"?t.kind==="obstacle"?Aln(e.obstacle,t.obstacle)<=x0:t.kind==="segment"?((n,o,r)=>{if(W$(r))return Math.max(0,yw(r.center,n,o)-r.width/2);let i=fle(r);return yle(n,i)||yle(o,i)?0:Math.min(...i.map((s,a)=>n$e(n,o,s,i[(a+1)%i.length])))})(t.start,t.end,e.obstacle)<=t.width/2+x0:xle(t.center,e.obstacle)<=t.diameter/2+x0:t.kind==="obstacle"?vO(t,e):e.kind==="segment"?t.kind==="segment"?n$e(e.start,e.end,t.start,t.end)<=(e.width+t.width)/2+x0:yw(t.center,e.start,e.end)<=e.width/2+t.diameter/2+x0:t.kind==="segment"?vO(t,e):KO(e.center,t.center)<=(e.diameter+t.diameter)/2+x0},pIr=class{parent;constructor(e){this.parent=Array.from({length:e},(t,n)=>n)}find(e){let t=this.parent[e];if(t===e)return e;let n=this.find(t);return this.parent[e]=n,n}union(e,t){let n=this.find(e),o=this.find(t);n!==o&&(this.parent[o]=n)}},mIr=(e,t)=>{let n=t.indexOf(e.from_layer),o=t.indexOf(e.to_layer);return n<0||o<0?[...new Set([e.from_layer,e.to_layer])]:t.slice(Math.min(n,o),Math.max(n,o)+1)},_Ir=(e)=>[e.pcb_trace_id,e.connection_name,e.source_trace_id,e.rootConnectionName,...e.mergedConnectionNames??[],...e.connectsTo??[]].filter((t)=>Boolean(t)),gIr=(e)=>[e.name,e.source_trace_id,e.rootConnectionName,...e.mergedConnectionNames??[],e.netConnectionName,...e.pointsToConnect.flatMap((t)=>[t.pointId,t.pcb_port_id])].filter((t)=>Boolean(t)),AIr=(e)=>[e.obstacleId,...e.connectedTo,...e.offBoardConnectsTo??[]].filter((t)=>Boolean(t)),VUt=(e,t,n,o)=>({kind:"bridge-contact",center:{x:e.x,y:e.y},diameter:t,layers:n,bridgeId:o,bounds:Cbe(v6e(e),t/2)}),wce=0.01,fIr={"0603":{horizontalWidth:0.8,horizontalHeight:0.95,centerSpacings:[1.65,1.8]},1206:{horizontalWidth:0.6,horizontalHeight:1.6,centerSpacings:[3.2]},"1206x4_pair":{horizontalWidth:0.8,horizontalHeight:0.5,centerSpacings:[2.7]}},YUt=(e,t,n)=>{if(!e.layer)throw Error(`Jumper ${n} is missing its layer`);let o=fIr[e.footprint];if(!o)throw Error(`Unsupported jumper footprint ${String(e.footprint)} on ${n}`);let r=Math.abs(e.end.x-e.start.x),i=Math.abs(e.end.y-e.start.y),s=(h)=>o.centerSpacings.some((d)=>Math.abs(h-d)<wce),a=i<wce&&s(r),c=r<wce&&s(i);if(!a&&!c)throw Error(`Jumper ${n} does not match ${e.footprint} pad spacing`);let l={type:"rect",center:{...t},width:a?o.horizontalWidth:o.horizontalHeight,height:a?o.horizontalHeight:o.horizontalWidth,layers:[e.layer],connectedTo:[]};return{kind:"bridge-pad",obstacle:l,layers:l.layers,bridgeId:n,bounds:fln(l)}},yIr=(e,t,n)=>{if(e.layer!==n.layer||t.layer!==n.layer)return!1;let o=(s,a)=>Math.abs(s.x-a.x)<wce&&Math.abs(s.y-a.y)<wce,r=o(e,n.start)&&o(t,n.end),i=o(e,n.end)&&o(t,n.start);return r||i},xIr=(e,t,n,o)=>{let r=[],i=e.route.flatMap((c,l)=>c.route_type==="jumper"?[{routePoint:c,routePointIndex:l}]:[]),s=new Map;for(let c of i){let l=[];for(let d=1;d<e.route.length;d++){let u=e.route[d-1],_=e.route[d];u?.route_type==="wire"&&_?.route_type==="wire"&&yIr(u,_,c.routePoint)&&l.push(d)}if(l.length!==1)throw Error(`Jumper ${e.pcb_trace_id}:${c.routePointIndex} matched ${l.length} placeholder wire segments`);let h=l[0];if(s.has(h))throw Error(`Multiple jumpers matched placeholder segment ${h} on ${e.pcb_trace_id}`);s.set(h,c)}let a;for(let c=0;c<e.route.length;c++){let l=e.route[c];if(l.route_type==="wire"){if(a&&a.layer===l.layer&&KO(a,l)>x0){let d=a;if(s.get(c));else{let u=d.width/2;r.push({kind:"segment",start:{x:d.x,y:d.y},end:{x:l.x,y:l.y},width:d.width,layers:[d.layer],bounds:Cbe({minX:Math.min(d.x,l.x),minY:Math.min(d.y,l.y),maxX:Math.max(d.x,l.x),maxY:Math.max(d.y,l.y)},u)})}}a=l;continue}if(a=void 0,l.route_type==="via"){let d=e.route[c-1],u=e.route[c+1];for(let p of[d,u])if(p?.route_type==="wire"&&KO(p,l)>x0)throw Error(`Via ${e.pcb_trace_id}:${c} is adjacent to a non-colocated wire endpoint`);let _=l.via_diameter??n;r.push({kind:"via",center:{x:l.x,y:l.y},diameter:_,layers:mIr(l,t),bounds:Cbe(v6e(l),_/2)});continue}let h=`${e.pcb_trace_id}:${c}:${l.route_type}`;if(l.route_type==="jumper"){r.push(YUt(l,l.start,h),YUt(l,l.end,h));continue}if(l.route_type==="through_obstacle"){if(!o.find((d)=>d.layers.includes(l.from_layer)&&d.layers.includes(l.to_layer)&&xle(l.start,d)<=x0&&xle(l.end,d)<=x0))throw Error(`Through-obstacle marker ${h} has no same-net multilayer obstacle witness`);r.push(VUt(l.start,0,[l.from_layer],h),VUt(l.end,0,[l.to_layer],h));continue}throw Error(`Unsupported route primitive: ${String(l.route_type)}`)}return r},yln=(e,t,n)=>{let o=e.pointsToConnect[n];return o.pointId??o.pcb_port_id??`${e.name}[${t}:${n}]`},GUt=(e)=>{let t={},n={},o=[];for(let r=0;r<e.connections.length;r++){let i=e.connections[r];for(let s=0;s<i.pointsToConnect.length;s++){let a=`${r}:${s}`;t[a]=yln(i,r,s),n[a]=a,o.push([a])}}return{endpointCount:Object.keys(t).length,endpointLabels:t,componentByEndpointKey:n,endpointComponents:o}},bbe=(e)=>{if(e===null||typeof e!="object")return JSON.stringify(e)??String(e);if(Array.isArray(e))return`[${e.map((n)=>bbe(n)).join(",")}]`;let t=e;return`{${Object.keys(t).sort().map((n)=>`${JSON.stringify(n)}:${bbe(t[n])}`).join(",")}}`},UUt=(e,t)=>{let n=new Tw(e,t,{includePhysicalPositionAliases:!0}),o=(r=e.layerCount)<=1?["top"]:r===2?["top","bottom"]:["top",...Array.from({length:r-2},(u,_)=>`inner${_+1}`),"bottom"];var r;let i=((u)=>{let _=u.min_via_hole_diameter??u.minViaHoleDiameter??0;return Math.max(_,u.min_via_pad_diameter??u.minViaPadDiameter??u.minViaDiameter??0.6)})(e),s=new Map,a=new Map,c={},l=(u,_)=>{let p=s.get(u)??[];p.push(_),s.set(u,p)};for(let u=0;u<e.connections.length;u++){let _=e.connections[u],p=n.canonicalize(gIr(_));if(p.length!==1)throw Error(`Connection ${_.name} resolved to ${p.length} canonical nets`);for(let m=0;m<_.pointsToConnect.length;m++){let A=_.pointsToConnect[m],g=`${u}:${m}`,f=yln(_,u,m);c[g]=f;let y={kind:"endpoint",endpointKey:g,endpointLabel:f,point:{x:A.x,y:A.y},layers:A.layers??[A.layer],bounds:v6e(A)};for(let x of p)l(x,y)}}for(let u of e.obstacles){let _={kind:"obstacle",obstacle:u,layers:u.layers,bounds:fln(u)};for(let p of n.canonicalize(AIr(u))){let m=a.get(p)??[];m.push(u),a.set(p,m),s.has(p)&&l(p,_)}}for(let u of[...t,...e.fixedTraces??[]]){let _=n.canonicalize(_Ir(u));if(_.length!==1)throw Error(`Trace ${u.pcb_trace_id} resolved to ${_.length} canonical nets`);let p=a.get(_[0])??[],m=xIr(u,o,i,p);for(let A of _)if(s.has(A))for(let g of m)l(A,g)}let h={},d=[];for(let u of s.values()){let _=new pIr(u.length),p=new Map;for(let g=0;g<u.length;g++){let f=u[g];if(f.kind!=="bridge-contact"&&f.kind!=="bridge-pad")continue;let y=p.get(f.bridgeId);y===void 0?p.set(f.bridgeId,g):_.union(y,g)}let m=u.length>0?new i_(u.length):null;if(m){for(let g of u)m.add(g.bounds.minX,g.bounds.minY,g.bounds.maxX,g.bounds.maxY);m.finish()}for(let g=0;g<u.length;g++){let f=u[g],y=m?.search(f.bounds.minX-x0,f.bounds.minY-x0,f.bounds.maxX+x0,f.bounds.maxY+x0)??[];for(let x of y)x<=g||vO(f,u[x])&&_.union(g,x)}let A=new Map;for(let g=0;g<u.length;g++){let f=u[g];if(f.kind!=="endpoint")continue;let y=_.find(g),x=A.get(y)??[];x.push(f.endpointKey),A.set(y,x)}for(let g of A.values()){g.sort();let f=g[0];d.push(g);for(let y of g){if(h[y]!==void 0)throw Error(`Endpoint ${y} was assigned to multiple canonical nets`);h[y]=f}}}return d.sort(([u=""],[_=""])=>u.localeCompare(_)),{endpointCount:Object.keys(c).length,endpointLabels:c,componentByEndpointKey:h,endpointComponents:d}},Ibe=class{baseline;inputProblem;baselineCaptureError;baselineTraceSignature;constructor(e,t){this.inputProblem=e,this.baselineTraceSignature=bbe(t);try{this.baseline=UUt(e,t),this.baselineCaptureError=null}catch(n){this.baseline=GUt(e),this.baselineCaptureError=n instanceof Error?n.message:String(n)}}validate(e){if(this.baselineCaptureError){let o=bbe(e)===this.baselineTraceSignature;return{safe:o,candidate:this.baseline,regressions:[],validationError:o?`Connectivity validation is limited to exact trace preservation: ${this.baselineCaptureError}`:`Connectivity validation failed closed: ${this.baselineCaptureError}`}}let t;try{t=UUt(this.inputProblem,e)}catch(o){return{safe:!1,candidate:GUt(this.inputProblem),regressions:[],validationError:`Connectivity validation failed closed: ${o instanceof Error?o.message:String(o)}`}}let n=[];for(let o of this.baseline.endpointComponents){if(o.length<2)continue;let r=new Map;for(let i of o){let s=t.componentByEndpointKey[i]??`missing:${i}`,a=r.get(s)??[];a.push(i),r.set(s,a)}r.size<=1||n.push({baselineEndpointKeys:[...o],baselineEndpointLabels:o.map((i)=>this.baseline.endpointLabels[i]),candidateComponents:[...r.values()]})}return{safe:n.length===0,candidate:t,regressions:n}}},WUt=[{x:0,y:0},{x:0.5,y:0.5}],CIr=[0.15,0.2,0.25,0.3,0.4,0.5],Xa=(e)=>e?.route_type==="wire",LXe=(e)=>e?.route_type==="via",bIr=Array.from({length:24},(e,t)=>{let n=t*Math.PI/12;return{x:Math.cos(n),y:Math.sin(n)}}),$K=(e)=>[...new Set(e.map((t)=>Number(t.toFixed(6))))].sort((t,n)=>n-t),HXe=class extends NV{inputProblem;traces;obstacleIndex;phase="repair-vias";traceCursor=0;routeCursor=0;candidateCursor=0;clearanceTierCursor=0;attemptedCandidateCount=0;attemptedClearanceShoveCount=0;attemptedViaGridCount=0;committedClearanceShoveCount=0;viaPairCountRemoved=0;viaCountRemoved=0;simplifiedPathCount=0;normalizedSegmentCount=0;achievedExtraClearanceCount=0;relocatedViaCount=0;unresolvedViaCount=0;attemptedPushedViaRepairCount=0;committedPushedViaRepairCount=0;padClearanceRerouteCount=0;unresolvedPadClearanceCount=0;initialPadClearanceViolationCount=0;remainingPadClearanceViolationCount=0;initialPadClearanceViolationCountByClearance={};remainingPadClearanceViolationCountByClearance={};budgetLimited=!1;connectivityValidationCount=0;connectivityRollbackCount=0;connectivityRegressionEndpointIds=[];connectivityValidationError=null;connectivityRollbackMutationStats=null;connectionNameResolver;connectionByTraceId=new Map;connectivityInvariant;initialConnectivitySafeTraces;mutableTraceIndices;mutableTraceIndexSet;viaRepairTraceIndices;traceIndices;maxRerouteLength;clearancePaddingTiers;desiredPadClearance;initialTraceLengths=new Map;candidates=[];candidateShoveCount=0;rollbackTraces=null;baseCandidateValidated=!1;activeShovePadding=0;viaGridAttempt=null;candidateSetMayUseGridFallback=!1;pendingPushedViaRepair=null;alternatePushedViaRepairs=[];pushedViaRepairRollbackTraces=null;connectivityFinalized=!1;finalizedMutatedTraceIndices=[];resumePhase="scan-via-pairs";constructor(e){super(),this.inputProblem=structuredClone(e),this.traces=structuredClone(e.traces),this.initialConnectivitySafeTraces=structuredClone(e.traces),this.connectivityInvariant=new Ibe(this.inputProblem.simpleRouteJson,this.initialConnectivitySafeTraces),this.connectionNameResolver=new Tw(e.simpleRouteJson,this.traces),this.maxRerouteLength=e.maxRerouteLength??10,this.desiredPadClearance=e.desiredPadClearance,this.clearancePaddingTiers=$K([...e.clearancePaddingTiers??[0.1,0.05,0],0]).filter((r)=>r>=0);let t=this.traces.map((r,i)=>i),n=(r,i,s)=>{let a=[...new Set(r??s)];for(let c of a)if(!Number.isInteger(c)||c<0||c>=this.traces.length)throw RangeError(`Invalid cleanup ${i} index: ${c}`);return a},o=n(e.traceIndices,"trace",t);this.viaRepairTraceIndices=n(e.viaRepairTraceIndices,"via repair trace",o),this.mutableTraceIndices=n(e.mutableTraceIndices,"mutable trace",o),this.mutableTraceIndexSet=new Set(this.mutableTraceIndices),this.traceIndices=o.filter((r)=>this.resolveNominalTraceWidth(this.traces[r])>=0.499999);for(let r of this.traceIndices)this.initialTraceLengths.set(r,this.measureTraceLength(this.traces[r]));this.obstacleIndex=this.createObstacleIndex(),this.initialPadClearanceViolationCount=this.countPadClearanceViolations(),this.remainingPadClearanceViolationCount=this.initialPadClearanceViolationCount,this.initialPadClearanceViolationCountByClearance=this.countPadClearanceViolationsByTier(),this.remainingPadClearanceViolationCountByClearance={...this.initialPadClearanceViolationCountByClearance},this.activeSubSolver=null,this.MAX_ITERATIONS=1e6,this.stats=this.createStats()}getSolverName(){return"PowerTraceCleanupSolver"}_step(){if(this.activeSubSolver)return this.stepActiveShoveSolver(),void(this.stats=this.createStats());switch(this.phase){case"repair-vias":this.repairNextVia();break;case"scan-via-pairs":this.scanNextViaPair();break;case"scan-pad-clearance":this.scanNextPadClearance();break;case"scan-simplification":this.scanNextSimplification();break;case"evaluate-candidate":this.evaluateCurrentCandidate();break;case"shove-clearance":break;case"route-via-pair":this.startNextViaGridCandidate();break;case"complete":this.ensureConnectivitySafeOutput(),this.solved=!0}this.stats=this.createStats()}repairNextVia(){let e=this.viaRepairTraceIndices[this.traceCursor],t=e===void 0?void 0:this.traces[e];if(!t)return this.traceCursor=0,this.routeCursor=0,this.phase="scan-via-pairs",void this.rebuildObstacleIndex();let n=t.route.findIndex((l,h)=>h>=this.routeCursor&&LXe(l));if(n===-1)return this.traceCursor++,void(this.routeCursor=0);this.routeCursor=n+1;let o=t.route[n],r=t.route[n-1],i=t.route[n+1];if(!LXe(o)||!Xa(r)||!Xa(i))return;let s=this.getTraceConnectionNames(t),a=this.getBaseObstacleClearance();if(!this.obstacleIndex.collidesVia({point:o,layers:this.obstacleIndex.boardLayers,padDiameter:o.via_diameter??0.6,holeDiameter:o.via_hole_diameter??this.obstacleIndex.defaultViaHoleDiameter,connectionNames:s,ignoreTraceIndex:e,ignoreRouteRange:{start:n,end:n},obstacleClearance:a,blockSameNetObstacles:!0,sameNetObstacleClearance:0}))return;let c=this.findViaRepair(t,n,a);if(!c){let l=this.findPushableViaRepairs(t,n,a),h=l.shift();return h?(this.alternatePushedViaRepairs=l,void this.startPushedViaRepair(h)):void this.unresolvedViaCount++}t.route.splice(c.startIndex,c.endIndex-c.startIndex+1,...c.route),this.relocatedViaCount++,this.routeCursor=c.startIndex+c.route.length,this.rebuildObstacleIndex()}findViaRepair(e,t,n){let o=this.createViaRepairContext(e,t);if(!o)return null;let r=o.candidates.map((i)=>({point:i,movedLength:ys(o.leftAnchor,i)+ys(i,o.rightAnchor)})).filter(({movedLength:i})=>i<=o.originalLength+Math.min(6,this.maxRerouteLength)+hr);r.sort((i,s)=>i.movedLength-s.movedLength||ys(i.point,o.via)-ys(s.point,o.via));for(let i of r)if(this.isViaRepairPointSafe(o,i.point,n))return this.createViaRepairReplacement(o,i.point);return null}findPushableViaRepairs(e,t,n){let o=this.viaRepairTraceIndices[this.traceCursor];if(o===void 0)return[];let r=this.createViaRepairContext(e,t);if(!r)return[];let i=r.candidates.flatMap((s)=>{let a=ys(r.leftAnchor,s)+ys(s,r.rightAnchor);if(a>r.originalLength+Math.min(6,this.maxRerouteLength)+hr)return[];let c=new Set,l=this.getViaRepairCollisionQueries(r,s,n);for(let d of l)for(let u of this.obstacleIndex.findCollisions(d)){if(u.kind!=="trace"||u.traceIndex===void 0||u.traceIndex===o||!this.mutableTraceIndexSet.has(u.traceIndex))return[];c.add(u.traceIndex)}if(c.size===0||c.size>2)return[];let h=[...c];return this.isViaRepairPointSafe(r,s,n,h)?[{point:s,movedLength:a,blockerCount:c.size,blockerKey:[...c].sort((d,u)=>d-u).join(",")}]:[]});return i.sort((s,a)=>s.blockerCount-a.blockerCount||s.movedLength-a.movedLength||ys(s.point,r.via)-ys(a.point,r.via)),[...new Map([...i].reverse().map((s)=>[s.blockerKey,s])).values(),...i].filter((s,a,c)=>c.findIndex((l)=>l.point.x===s.point.x&&l.point.y===s.point.y)===a).slice(0,12).map((s)=>({traceIndex:o,viaIndex:t,point:s.point,padClearance:n,corridor:[{start:r.leftAnchor,end:s.point,layer:r.leftWire.layer,width:r.leftWire.width},{start:s.point,end:r.rightAnchor,layer:r.rightWire.layer,width:r.rightWire.width},...this.obstacleIndex.boardLayers.map((a)=>({start:s.point,end:s.point,layer:a,width:r.viaDiameter}))]}))}createViaRepairContext(e,t){let n=e.route[t],o=e.route[t-1],r=e.route[t+1];if(!LXe(n)||!Xa(o)||!Xa(r))return null;let i=t-1==0||!Xa(e.route[t-2]),s=t+1===e.route.length-1||!Xa(e.route[t+2]),a=i?o:e.route[t-2],c=s?r:e.route[t+2],l=ys(a,n)+ys(n,c),h=this.getTraceConnectionNames(e),d=n.via_diameter??0.6,u=n.via_hole_diameter??this.obstacleIndex.defaultViaHoleDiameter,_=Math.max(0.3,u+this.obstacleIndex.minViaHoleEdgeToViaHoleEdgeClearance+0.05),p=[_,_+0.15,_+0.3,_+0.5,_+0.75,_+1,_+1.5,_+2].flatMap((A)=>bIr.map((g)=>({x:0.025*Math.round((n.x+g.x*A)/0.025),y:0.025*Math.round((n.y+g.y*A)/0.025)}))),m=[...p,...p.flatMap((A)=>[{x:A.x,y:Math.floor(10*n.y)/10},{x:A.x,y:Math.ceil(10*n.y)/10},{x:Math.floor(10*n.x)/10,y:A.y},{x:Math.ceil(10*n.x)/10,y:A.y}])].filter((A,g,f)=>f.findIndex((y)=>y.x===A.x&&y.y===A.y)===g);return{trace:e,viaIndex:t,via:n,leftWire:o,rightWire:r,leftIsEndpoint:i,rightIsEndpoint:s,leftAnchor:a,rightAnchor:c,originalLength:l,connectionNames:h,viaDiameter:d,holeDiameter:u,ignoreRouteRange:{start:Math.max(0,t-2),end:Math.min(e.route.length-1,t+2)},candidates:m}}getViaRepairCollisionQueries(e,t,n,o){let r=this.viaRepairTraceIndices[this.traceCursor],i={connectionNames:e.connectionNames,ignoreTraceIndex:r,ignoreTraceIndices:o,ignoreRouteRange:e.ignoreRouteRange,obstacleClearance:n};return[...this.obstacleIndex.boardLayers.map((s)=>({...i,start:t,end:t,layer:s,width:e.viaDiameter,blockSameNetObstacles:!0,sameNetObstacleClearance:0})),{...i,start:e.leftAnchor,end:t,layer:e.leftWire.layer,width:e.leftWire.width},{...i,start:t,end:e.rightAnchor,layer:e.rightWire.layer,width:e.rightWire.width}]}isViaRepairPointSafe(e,t,n,o){let r=this.viaRepairTraceIndices[this.traceCursor];return!this.obstacleIndex.collidesVia({point:t,layers:this.obstacleIndex.boardLayers,padDiameter:e.viaDiameter,holeDiameter:e.holeDiameter,connectionNames:e.connectionNames,ignoreTraceIndex:r,ignoreTraceIndices:o,ignoreRouteRange:{start:e.viaIndex,end:e.viaIndex},obstacleClearance:n,blockSameNetObstacles:!0,sameNetObstacleClearance:0})&&!this.getViaRepairCollisionQueries(e,t,n,o).slice(this.obstacleIndex.boardLayers.length).some((i)=>this.obstacleIndex.collides(i))}createViaRepairReplacement(e,t){let n={...e.leftWire,...t},o={...e.via,...t},r={...e.rightWire,...t};return{startIndex:e.viaIndex-1,endIndex:e.viaIndex+1,route:[...e.leftIsEndpoint?[e.leftWire]:[],n,o,r,...e.rightIsEndpoint?[e.rightWire]:[]]}}startPushedViaRepair(e){this.pendingPushedViaRepair=e,this.pushedViaRepairRollbackTraces=structuredClone(this.traces),this.attemptedPushedViaRepairCount++,this.activeSubSolver=new U$({simpleRouteJson:this.inputProblem.simpleRouteJson,traces:this.traces,powerTraceIndex:e.traceIndex,nominalPowerWidth:Math.max(...e.corridor.map((t)=>t.width)),pushOnlyNominalWidthsBelow:Number.POSITIVE_INFINITY,mutableTraceIndices:this.mutableTraceIndices,corridor:e.corridor,maxRerouteLength:this.maxRerouteLength},this.connectionNameResolver)}finishPushedViaRepairSolver(e){let t=this.pendingPushedViaRepair;if(this.activeSubSolver=null,!t)return;if(e.solved){let o=e.getOutput();if(o){this.traces=o.traces,this.rebuildObstacleIndex();let r=this.traces[t.traceIndex],i=r?this.createViaRepairContext(r,t.viaIndex):null;if(i&&this.isViaRepairPointSafe(i,t.point,t.padClearance)){let s=this.createViaRepairReplacement(i,t.point);return r.route.splice(s.startIndex,s.endIndex-s.startIndex+1,...s.route),this.relocatedViaCount++,this.committedPushedViaRepairCount++,this.routeCursor=s.startIndex+s.route.length,this.pendingPushedViaRepair=null,this.alternatePushedViaRepairs=[],this.pushedViaRepairRollbackTraces=null,void this.rebuildObstacleIndex()}}}this.pushedViaRepairRollbackTraces&&(this.traces=this.pushedViaRepairRollbackTraces),this.pendingPushedViaRepair=null,this.pushedViaRepairRollbackTraces=null;let n=this.alternatePushedViaRepairs.shift();if(n)return this.rebuildObstacleIndex(),void this.startPushedViaRepair(n);this.alternatePushedViaRepairs=[],this.unresolvedViaCount++,this.rebuildObstacleIndex()}scanNextViaPair(){let e=this.traceIndices[this.traceCursor];if(e===void 0)return this.traceCursor=0,this.routeCursor=0,void(this.phase="scan-pad-clearance");let t=this.traces[e],n=t.route.findIndex((g,f)=>f>=this.routeCursor&&g.route_type==="via");if(n===-1)return void this.advanceTrace();let o=t.route.slice(n+1).findIndex((g)=>g.route_type==="via");if(o===-1)return void this.advanceTrace();let r=n-1,i=n+1+o+1,s=t.route[r],a=t.route[i];if(this.routeCursor=n+1,!Xa(s)||!Xa(a)||s.layer!==a.layer||ys(s,a)>this.maxRerouteLength+hr)return;let c=this.createCandidates({kind:"via-pair",traceIndex:e,startIndex:r,endIndex:i}),l=c[0]?.width??Math.max(s.width,a.width),h=c[0]?.padClearance??this.getCandidatePadClearance("via-pair",e,r,i),d=(g)=>{let f=t.route[g];return!!Xa(f)&&this.obstacleIndex.findCollisions({start:f,end:f,layer:f.layer,width:l,connectionNames:this.getTraceConnectionNames(t),ignoreTraceIndex:e,ignoreRouteRange:{start:Math.max(0,r-1),end:Math.min(t.route.length-1,i+1)},obstacleClearance:h}).some((y)=>y.kind==="obstacle"&&y.obstacleKind==="pad")},u=t.route[r-1],_=t.route[i+1],p=c.length>0&&d(r)&&Xa(u)&&u.layer===s.layer?r-1:r,m=c.length>0&&d(i)&&Xa(_)&&_.layer===a.layer?i+1:i,A=[{startIndex:r,endIndex:i},{startIndex:p,endIndex:i},{startIndex:r,endIndex:m},{startIndex:p,endIndex:m}].filter((g,f,y)=>y.findIndex((x)=>x.startIndex===g.startIndex&&x.endIndex===g.endIndex)===f).flatMap((g)=>g.startIndex===r&&g.endIndex===i?c:this.createCandidates({kind:"via-pair",traceIndex:e,startIndex:g.startIndex,endIndex:g.endIndex}));A.length!==0&&this.beginCandidates(A,"scan-via-pairs",!0)}scanNextPadClearance(){let e=this.traceIndices[this.traceCursor];if(e===void 0)return this.traceCursor=0,this.routeCursor=0,void(this.phase="scan-simplification");let t=this.traces[e];if(this.resolveNominalTraceWidth(t)<0.499999)return void this.advanceTrace();let n=this.routeCursor,o=t.route[n],r=t.route[n+1];if(!Xa(o)||!Xa(r)||o.layer!==r.layer)return void(n>=t.route.length-1?this.advanceTrace():this.routeCursor++);if(this.routeCursor++,!this.segmentHasPadClearanceViolation(e,n))return;let i=this.getPadClearanceIntervals(t,n).flatMap((s)=>this.getImprovedPadClearanceTiers(e,s.startIndex,s.endIndex).flatMap((a)=>this.createCandidates({kind:"pad-clearance",traceIndex:e,startIndex:s.startIndex,endIndex:s.endIndex,padClearance:a}).slice(0,8)));i.length!==0?this.beginCandidates(i.slice(0,72),"scan-pad-clearance",!0):this.unresolvedPadClearanceCount++}segmentHasPadClearanceViolation(e,t){let n=this.traces[e],o=n.route[t],r=n.route[t+1];return!(!Xa(o)||!Xa(r)||o.layer!==r.layer)&&this.obstacleIndex.findCollisions({start:o,end:r,layer:o.layer,width:Math.max(o.width,r.width),connectionNames:this.getTraceConnectionNames(n),ignoreTraceIndex:e,ignoreRouteRange:{start:Math.max(0,t-1),end:Math.min(n.route.length-1,t+2)},obstacleClearance:this.getPadClearanceForTrace(n)}).some((i)=>i.kind==="obstacle"&&i.obstacleKind==="pad")}getPadClearanceIntervals(e,t){let n=e.route[t];if(!Xa(n))return[];let o=[t],r=0;for(let s=t-1;s>=0;s--){let a=e.route[s],c=e.route[s+1];if(!Xa(a)||!Xa(c)||a.layer!==n.layer||c.layer!==n.layer)break;if(r+=ys(a,c),r>this.maxRerouteLength/2+hr)break;o.push(s)}let i=[t+1];r=0;for(let s=t+1;s<e.route.length-1;s++){let a=e.route[s],c=e.route[s+1];if(!Xa(a)||!Xa(c)||a.layer!==n.layer||c.layer!==n.layer)break;if(r+=ys(a,c),r>this.maxRerouteLength/2+hr)break;i.push(s+1)}return o.flatMap((s)=>i.map((a)=>({startIndex:s,endIndex:a,length:this.measureRouteRange(e,s,a).length}))).filter((s)=>s.length<=this.maxRerouteLength+hr&&s.startIndex<s.endIndex).sort((s,a)=>a.length-s.length).slice(0,8)}scanNextSimplification(){let e=this.traceIndices[this.traceCursor];if(e===void 0)return this.remainingPadClearanceViolationCount=this.countPadClearanceViolations(),this.remainingPadClearanceViolationCountByClearance=this.countPadClearanceViolationsByTier(),void(this.phase="complete");let t=this.traces[e],n=this.routeCursor,o=t.route[n];if(!Xa(o)||n>=t.route.length-1)return void(n>=t.route.length-1?this.advanceTrace():this.routeCursor++);let r=0,i=[];for(let a=n+1;a<t.route.length;a++){let c=t.route[a-1],l=t.route[a];if(!Xa(c)||!Xa(l)||c.layer!==o.layer||l.layer!==o.layer)break;if(r+=ys(c,l),r>this.maxRerouteLength+hr)break;let h=this.measureRouteRange(t,n,a);(h.nonOctilinearSegmentCount>0||h.pointCount>3)&&i.push(a)}let s=i.slice(-6).reverse().flatMap((a)=>this.createCandidates({kind:"simplification",traceIndex:e,startIndex:n,endIndex:a}));s.length!==0?this.beginCandidates(s,"scan-simplification"):this.routeCursor++}createCandidates({kind:e,traceIndex:t,startIndex:n,endIndex:o,padClearance:r}){let i=this.traces[t],s=i.route[n],a=i.route[o];if(!Xa(s)||!Xa(a)||s.layer!==a.layer)return[];let c=this.resolveNominalTraceWidth(i),l=this.measureRouteRange(i,n,o),h=r??this.getCandidatePadClearance(e,t,n,o),d=[],u=gln(s,a);if(e==="pad-clearance"&&kXe([s,a])===0){let p=ys(s,a);if(p>hr){let m={x:-(a.y-s.y)/p,y:(a.x-s.x)/p};for(let A of[0.25,0.5,0.75,1,1.5,2])for(let g of[-1,1])u.push([s,{x:s.x+m.x*A*g,y:s.y+m.y*A*g},{x:a.x+m.x*A*g,y:a.y+m.y*A*g},a])}}let _=new Map(u.map((p)=>[p.map((m)=>`${m.x.toFixed(6)},${m.y.toFixed(6)}`).join(";"),p]));for(let p of _.values()){let m=Ale(p);if(m>this.maxRerouteLength+hr||e==="pad-clearance"&&m>1.35*l.length+0.5||e==="simplification"&&(m>1.1*l.length+hr||this.measureTraceLength(i)-l.length+m>1.01*(this.initialTraceLengths.get(t)??this.measureTraceLength(i))+hr))continue;let A=m<=hr?c:c-l.deficitArea/m;if(A>c+hr)continue;let g=0.05*Math.ceil(Math.max(this.inputProblem.simpleRouteJson.minTraceWidth,A)/0.05-hr),f=$K([c,Math.min(c,g),Math.min(c,Math.max(this.inputProblem.simpleRouteJson.minTraceWidth,A))].map((y)=>Math.max(y,s.width)));for(let y of f){let x=this.measureCandidate(p,y,c,a.width,s.width);x.deficitArea>l.deficitArea+hr||x.conservativeDeficitArea>l.conservativeDeficitArea+hr||!this.preservesCoverage(x,l)||(e!=="simplification"||l.nonOctilinearSegmentCount!==0||x.pointCount<l.pointCount&&x.length<l.length-hr)&&d.push({kind:e,traceIndex:t,startIndex:n,endIndex:o,layer:s.layer,points:p,width:y,padClearance:h,originalQuality:l})}}return d.slice(0,18)}beginCandidates(e,t,n=!1){this.candidates=e,this.candidateCursor=0,this.clearanceTierCursor=0,this.candidateShoveCount=0,this.rollbackTraces=null,this.baseCandidateValidated=!1,this.resumePhase=t,this.candidateSetMayUseGridFallback=n,this.phase="evaluate-candidate"}evaluateCurrentCandidate(){let e=this.candidates[this.candidateCursor];if(!e)return void this.finishCandidateSet(!1);if(!this.baseCandidateValidated){if(!this.candidateCollides(e,0))return this.candidateShoveCount>0?void this.applyCandidate(e,0):(this.baseCandidateValidated=!0,void(this.clearanceTierCursor=0));return this.getPushableTraceIndices(e,0)&&this.candidateShoveCount<2&&this.attemptedClearanceShoveCount<48?void this.startClearanceShove(e,0):void this.advanceCandidate()}let t=this.clearancePaddingTiers[this.clearanceTierCursor];if(t===void 0||t<=hr)return void this.applyCandidate(e,0);if(this.attemptedCandidateCount++,!this.candidateCollides(e,t))return void this.applyCandidate(e,t);this.getPushableTraceIndices(e,t)&&this.candidateShoveCount<2&&this.attemptedClearanceShoveCount<48?this.startClearanceShove(e,t):(this.rollbackCandidateShoves(),this.clearanceTierCursor++,this.candidateShoveCount=0)}advanceCandidate(){this.rollbackCandidateShoves(),this.candidateCursor++,this.clearanceTierCursor=0,this.candidateShoveCount=0,this.baseCandidateValidated=!1}candidateCollides(e,t){let n=this.traces[e.traceIndex],o=this.getTraceConnectionNames(n);for(let r=0;r<e.points.length-1;r++){let i=this.getCandidateSegmentWidth(e,r);if(this.obstacleIndex.collides({start:e.points[r],end:e.points[r+1],layer:e.layer,width:i+2*t,connectionNames:o,ignoreTraceIndex:e.traceIndex,ignoreRouteRange:{start:Math.max(0,e.startIndex-1),end:Math.min(n.route.length-1,e.endIndex+1)},obstacleClearance:e.padClearance}))return!0}return!1}getPushableTraceIndices(e,t){let n=this.traces[e.traceIndex],o=this.getTraceConnectionNames(n),r=new Set;for(let i=0;i<e.points.length-1;i++){let s=this.getCandidateSegmentWidth(e,i),a={start:e.points[i],end:e.points[i+1],layer:e.layer,width:s+2*t,connectionNames:o,ignoreTraceIndex:e.traceIndex,ignoreRouteRange:{start:Math.max(0,e.startIndex-1),end:Math.min(n.route.length-1,e.endIndex+1)},obstacleClearance:e.padClearance};if(!this.obstacleIndex.collides(a))continue;let c=this.obstacleIndex.findCollisions(a);if(c.length===0)return null;for(let l of c){if(l.kind!=="trace"||l.traceIndex===void 0||l.traceIndex===e.traceIndex||!this.mutableTraceIndexSet.has(l.traceIndex))return null;let h=this.traces[l.traceIndex];if(!h||this.resolveNominalTraceWidth(h)>=e.width-hr)return null;r.add(l.traceIndex)}}return r.size>0&&r.size<=2?[...r]:null}startClearanceShove(e,t){this.rollbackTraces??=structuredClone(this.traces),this.activeShovePadding=t;let n=e.width+2*t,o=e.points.slice(0,-1).map((r,i)=>({start:r,end:e.points[i+1],layer:e.layer,width:this.getCandidateSegmentWidth(e,i)+2*t}));this.attemptedClearanceShoveCount++,this.activeSubSolver=new U$({simpleRouteJson:this.inputProblem.simpleRouteJson,traces:this.traces,powerTraceIndex:e.traceIndex,nominalPowerWidth:n,pushOnlyNominalWidthsBelow:e.width,mutableTraceIndices:this.mutableTraceIndices,corridor:o,maxRerouteLength:this.maxRerouteLength},this.connectionNameResolver),this.phase="shove-clearance"}getCandidateSegmentWidth(e,t){let n=this.traces[e.traceIndex],o=n.route[e.startIndex],r=n.route[e.endIndex],i=t===0&&Xa(o)?o.width:e.width,s=t===e.points.length-2&&Xa(r)?r.width:e.width;return Math.max(i,s)}stepActiveShoveSolver(){let e=this.activeSubSolver;if(e.step(),e.solved||e.failed)if(this.pendingPushedViaRepair&&e instanceof U$)this.finishPushedViaRepairSolver(e);else if(e instanceof xbe)this.finishViaGridSolver(e);else{if(this.activeSubSolver=null,this.phase="evaluate-candidate",e.solved){let t=e.getOutput();if(t)return this.traces=t.traces,this.candidateShoveCount++,void this.rebuildObstacleIndex()}this.failedSubSolvers??=[],this.failedSubSolvers.push(e),this.rollbackCandidateShoves(),this.activeShovePadding<=hr?this.advanceCandidate():this.clearanceTierCursor++,this.candidateShoveCount=0}}rollbackCandidateShoves(){this.rollbackTraces&&(this.traces=this.rollbackTraces,this.rollbackTraces=null,this.rebuildObstacleIndex())}applyCandidate(e,t){let n=this.traces[e.traceIndex],o=n.route[e.startIndex],r=n.route[e.endIndex],i=e.points.map((c,l)=>({...l===0?o:l===e.points.length-1?r:{route_type:"wire",layer:e.layer,width:e.width},x:c.x,y:c.y,layer:e.layer,width:l===0?o.width:l===e.points.length-1?r.width:e.width})),s=n.route.slice(e.startIndex,e.endIndex+1),a=e.originalQuality.nonOctilinearSegmentCount;if(n.route.splice(e.startIndex,e.endIndex-e.startIndex+1,...i),e.kind==="via-pair"){let c=s.filter((l)=>l.route_type==="via").length;this.viaPairCountRemoved++,this.viaCountRemoved+=c,this.routeCursor=Math.max(0,e.startIndex-1)}else e.kind==="pad-clearance"?(this.padClearanceRerouteCount++,this.routeCursor=e.startIndex+Math.max(1,i.length-1)):(this.simplifiedPathCount++,this.normalizedSegmentCount+=a,this.routeCursor=e.startIndex+Math.max(1,i.length-1));this.committedClearanceShoveCount+=this.candidateShoveCount,t>hr&&this.achievedExtraClearanceCount++,this.rollbackTraces=null,this.candidateShoveCount=0,this.rebuildObstacleIndex(),this.finishCandidateSet(!0)}finishCandidateSet(e){let t=this.candidates[0],n=$K(this.candidates.filter((r)=>r.kind===t?.kind).map((r)=>r.width)),o=$K(this.candidates.filter((r)=>r.kind===t?.kind&&r.traceIndex===t.traceIndex&&r.startIndex===t.startIndex&&r.endIndex===t.endIndex).map((r)=>r.padClearance));if(this.rollbackCandidateShoves(),this.candidates=[],this.candidateCursor=0,this.clearanceTierCursor=0,this.candidateShoveCount=0,this.baseCandidateValidated=!1,!e&&this.candidateSetMayUseGridFallback&&t)return this.candidateSetMayUseGridFallback=!1,void this.beginViaGridAttempt(t,n,o);this.candidateSetMayUseGridFallback=!1,e||this.routeCursor++,this.phase=this.resumePhase}beginViaGridAttempt(e,t,n=[e.padClearance]){this.viaGridAttempt={kind:e.kind,traceIndex:e.traceIndex,startIndex:e.startIndex,endIndex:e.endIndex,layer:e.layer,padClearances:n,padClearanceCursor:0,originalQuality:e.originalQuality,widths:t,widthCursor:0,gridSizes:[],gridSizeCursor:0,offsetCursor:0},this.phase="route-via-pair"}startNextViaGridCandidate(){let e=this.viaGridAttempt;if(!e)return void(this.phase=this.resumePhase);if(e.padClearanceCursor>=e.padClearances.length)return e.kind==="pad-clearance"&&this.unresolvedPadClearanceCount++,this.viaGridAttempt=null,this.routeCursor++,void(this.phase=this.resumePhase);if(e.widthCursor>=e.widths.length)return e.padClearanceCursor++,e.widthCursor=0,e.gridSizes=[],e.gridSizeCursor=0,void(e.offsetCursor=0);let t=e.widths[e.widthCursor],n=e.padClearances[e.padClearanceCursor];if(e.gridSizes.length===0&&(e.gridSizes=$K([C0(t/2,0.2,0.4),C0(t/3,0.15,0.25)])),e.gridSizeCursor>=e.gridSizes.length)return e.widthCursor++,e.gridSizes=[],e.gridSizeCursor=0,void(e.offsetCursor=0);if(e.offsetCursor>=WUt.length)return e.gridSizeCursor++,void(e.offsetCursor=0);let o=this.traces[e.traceIndex],r=o.route[e.startIndex],i=o.route[e.endIndex];if(!Xa(r)||!Xa(i))return this.viaGridAttempt=null,this.routeCursor++,void(this.phase=this.resumePhase);let s=e.gridSizes[e.gridSizeCursor],a=WUt[e.offsetCursor];this.attemptedViaGridCount++,this.activeSubSolver=new xbe({start:r,end:i,layer:e.layer,traceWidth:t,gridSize:s,gridOffset:{x:a.x*s,y:a.y*s},connectionNames:this.getTraceConnectionNames(o),obstacleIndex:this.obstacleIndex,ignoreTraceIndex:e.traceIndex,ignoreRouteRange:{start:Math.max(0,e.startIndex-1),end:Math.min(o.route.length-1,e.endIndex+1)},bounds:this.inputProblem.simpleRouteJson.bounds,obstacleClearance:n,searchPadding:Math.min(4,Math.max(2,ys(r,i)/2,3*t)),requireOctilinear:!0})}finishViaGridSolver(e){let t=this.viaGridAttempt;if(this.activeSubSolver=null,e.solved&&t){let n=e.getOutput(),o=this.traces[t.traceIndex];if(n&&o){let r=this.resolveNominalTraceWidth(o),i=this.measureCandidate(n.points,n.traceWidth,r,o.route[t.endIndex].width,o.route[t.startIndex].width);if(i.nonOctilinearSegmentCount===0&&i.length<=this.maxRerouteLength+hr&&i.deficitArea<=t.originalQuality.deficitArea+hr&&i.conservativeDeficitArea<=t.originalQuality.conservativeDeficitArea+hr&&this.preservesCoverage(i,t.originalQuality)){let s={kind:t.kind,traceIndex:t.traceIndex,startIndex:t.startIndex,endIndex:t.endIndex,layer:t.layer,points:n.points,width:n.traceWidth,padClearance:t.padClearances[t.padClearanceCursor],originalQuality:t.originalQuality};return this.viaGridAttempt=null,void this.beginCandidates([s],this.resumePhase,!1)}}}e.failed&&(this.failedSubSolvers??=[],this.failedSubSolvers.push(e)),t&&t.offsetCursor++,this.phase="route-via-pair"}measureRouteRange(e,t,n){let o=this.resolveNominalTraceWidth(e),r=0,i=0,s=0,a=0,c=0,l=0,h=0;for(let d=t;d<=n;d++){if(Xa(e.route[d])&&h++,d>=n)continue;let u=e.route[d],_=e.route[d+1];if(!Xa(u)||!Xa(_)||u.layer!==_.layer)continue;let p=ys(u,_);r+=p,i+=p*Math.max(0,o-u.width),u.width>=o-hr&&(a+=p),s+=p*Math.max(0,o-Math.min(u.width,_.width)),Math.min(u.width,_.width)>=o-hr&&(c+=p),l+=kXe([u,_])}return{length:r,deficitArea:i,conservativeDeficitArea:s,nominalLength:a,conservativeNominalLength:c,nonOctilinearSegmentCount:l,pointCount:h}}measureTraceLength(e){let t=0;for(let n=0;n<e.route.length-1;n++){let o=e.route[n],r=e.route[n+1];Xa(o)&&Xa(r)&&o.layer===r.layer&&(t+=ys(o,r))}return t}measureCandidate(e,t,n,o=t,r=t){let i=Ale(e),s=0,a=0,c=0,l=0;for(let h=0;h<e.length-1;h++){let d=ys(e[h],e[h+1]),u=h===0?r:t,_=h===e.length-2?o:t,p=Math.min(u,_);s+=d*Math.max(0,n-u),a+=d*Math.max(0,n-p),u>=n-hr&&(c+=d),p>=n-hr&&(l+=d)}return{length:i,deficitArea:s,conservativeDeficitArea:a,nominalLength:c,conservativeNominalLength:l,nonOctilinearSegmentCount:kXe(e),pointCount:e.length}}preservesCoverage(e,t){let n=t.length<=hr?1:t.nominalLength/t.length,o=e.length<=hr?1:e.nominalLength/e.length,r=t.length<=hr?1:t.conservativeNominalLength/t.length,i=e.length<=hr?1:e.conservativeNominalLength/e.length;return!(o+hr<n||i+hr<r)&&!(e.length>t.length+hr&&o<0.999999)}advanceTrace(){this.traceCursor++,this.routeCursor=0,this.rebuildObstacleIndex()}createObstacleIndex(){return new yb(this.inputProblem.simpleRouteJson,this.traces,this.phase==="repair-vias"?void 0:this.traceIndices?.[this.traceCursor],[],this.connectionNameResolver)}rebuildObstacleIndex(){this.obstacleIndex=this.createObstacleIndex()}resolveNominalTraceWidth(e){let t=this.findConnectionForTrace(e);return Math.max(t?.nominalTraceWidth??t?.width??this.inputProblem.simpleRouteJson.nominalTraceWidth??this.inputProblem.simpleRouteJson.minTraceWidth,this.inputProblem.simpleRouteJson.minTraceWidth)}getPadClearanceForTrace(e){let t=this.getBaseObstacleClearance();return this.resolveNominalTraceWidth(e)>=0.499999?Math.max(t,this.desiredPadClearance??this.resolveNominalTraceWidth(e)/2):t}getBaseObstacleClearance(){return Math.max(this.inputProblem.simpleRouteJson.defaultObstacleMargin??0,this.inputProblem.simpleRouteJson.minTraceToPadEdgeClearance??0,0.1)}getCandidatePadClearance(e,t,n,o){let r=this.traces[t],i=this.getBaseObstacleClearance(),s=this.getPadClearanceForTrace(r);if(e==="pad-clearance")return s;let a=e==="via-pair"?Math.min(s,Math.max(i,0.15)):s;return this.findExistingPadClearance(t,n,o,i,a)}getImprovedPadClearanceTiers(e,t,n){let o=this.traces[e],r=this.getBaseObstacleClearance(),i=this.getPadClearanceForTrace(o),s=this.findExistingPadClearance(e,t,n,r,i),a=Math.max(0.025,Math.min(0.05,i/10)),c=[i];for(let l=i-a;l>s+a/2;l-=a)c.push(l);return $K(c).filter((l)=>l>s+hr)}findExistingPadClearance(e,t,n,o,r){if(this.routeRangeHasPadClearanceViolation(e,t,n,o))return o;if(!this.routeRangeHasPadClearanceViolation(e,t,n,r))return r;let i=o,s=r;for(let a=0;a<7;a++){let c=(i+s)/2;this.routeRangeHasPadClearanceViolation(e,t,n,c)?s=c:i=c}return Math.max(o,Number((i-0.001).toFixed(6)))}routeRangeHasPadClearanceViolation(e,t,n,o){let r=this.traces[e],i=this.getTraceConnectionNames(r);for(let s=t;s<n;s++){let a=r.route[s],c=r.route[s+1];if(!Xa(a)||!Xa(c)||a.layer!==c.layer)continue;if(this.obstacleIndex.findCollisions({start:a,end:c,layer:a.layer,width:Math.max(a.width,c.width),connectionNames:i,ignoreTraceIndex:e,ignoreRouteRange:{start:Math.max(0,t-1),end:Math.min(r.route.length-1,n+1)},obstacleClearance:o}).some((l)=>l.kind==="obstacle"&&l.obstacleKind==="pad"))return!0}return!1}countPadClearanceViolations(e){let t=0;for(let n of this.traceIndices){let o=this.traces[n];if(!o)continue;let r=this.getTraceConnectionNames(o);for(let i=0;i<o.route.length-1;i++){let s=o.route[i],a=o.route[i+1];if(!Xa(s)||!Xa(a)||s.layer!==a.layer)continue;this.obstacleIndex.findCollisions({start:s,end:a,layer:s.layer,width:Math.max(s.width,a.width),connectionNames:r,ignoreTraceIndex:n,ignoreRouteRange:{start:Math.max(0,i-1),end:Math.min(o.route.length-1,i+2)},obstacleClearance:e??this.getPadClearanceForTrace(o)}).some((c)=>c.kind==="obstacle"&&c.obstacleKind==="pad")&&t++}}return t}countPadClearanceViolationsByTier(){return Object.fromEntries(CIr.map((e)=>[e.toFixed(2),this.countPadClearanceViolations(e)]))}findConnectionForTrace(e){let t=this.connectionByTraceId.get(e.pcb_trace_id);if(t!==void 0)return t??void 0;let n=new Set(this.connectionNameResolver.canonicalize(this.getTraceConnectionNames(e))),o=this.inputProblem.simpleRouteJson.connections.find((r)=>this.connectionNameResolver.canonicalize(this.getConnectionNames(r)).some((i)=>n.has(i)))??null;return this.connectionByTraceId.set(e.pcb_trace_id,o),o??void 0}getConnectionNames(e){return[e.name,e.source_trace_id,e.rootConnectionName,e.netConnectionName,...e.mergedConnectionNames??[]].filter((t)=>Boolean(t))}getTraceConnectionNames(e){return[e.pcb_trace_id,e.connection_name,e.source_trace_id,e.rootConnectionName,...e.mergedConnectionNames??[],...e.connectsTo??[]].filter((t)=>Boolean(t))}ensureConnectivitySafeOutput(){if(!this.connectivityFinalized){this.connectivityFinalized=!0,this.connectivityValidationCount++;try{let e=this.connectivityInvariant.validate(this.traces);if(this.connectivityValidationError??=e.validationError??null,e.safe)return void(this.finalizedMutatedTraceIndices=this.getMutatedTraceIndices());this.connectivityRegressionEndpointIds=[...new Set(e.regressions.flatMap((t)=>t.baselineEndpointLabels))]}catch(e){this.connectivityValidationError=e instanceof Error?e.message:String(e)}this.connectivityRollbackCount++,this.connectivityRollbackMutationStats={committedClearanceShoveCount:this.committedClearanceShoveCount,viaPairCountRemoved:this.viaPairCountRemoved,viaCountRemoved:this.viaCountRemoved,simplifiedPathCount:this.simplifiedPathCount,normalizedSegmentCount:this.normalizedSegmentCount,achievedExtraClearanceCount:this.achievedExtraClearanceCount,relocatedViaCount:this.relocatedViaCount,committedPushedViaRepairCount:this.committedPushedViaRepairCount,padClearanceRerouteCount:this.padClearanceRerouteCount},this.committedClearanceShoveCount=0,this.viaPairCountRemoved=0,this.viaCountRemoved=0,this.simplifiedPathCount=0,this.normalizedSegmentCount=0,this.achievedExtraClearanceCount=0,this.relocatedViaCount=0,this.committedPushedViaRepairCount=0,this.padClearanceRerouteCount=0,this.traces=structuredClone(this.initialConnectivitySafeTraces),this.obstacleIndex=new yb(this.inputProblem.simpleRouteJson,this.traces,void 0,[],this.connectionNameResolver),this.remainingPadClearanceViolationCount=this.countPadClearanceViolations(),this.remainingPadClearanceViolationCountByClearance=this.countPadClearanceViolationsByTier(),this.finalizedMutatedTraceIndices=this.getMutatedTraceIndices()}}getMutatedTraceIndices(){let e=Math.max(this.initialConnectivitySafeTraces.length,this.traces.length);return Array.from({length:e},(t,n)=>n).filter((t)=>JSON.stringify(this.initialConnectivitySafeTraces[t])!==JSON.stringify(this.traces[t]))}createStats(){let e=this.candidates[this.candidateCursor],t=this.phase==="repair-vias"?this.viaRepairTraceIndices:this.traceIndices;return{phase:this.phase,budgetLimited:this.budgetLimited,completionReason:this.phase==="complete"||this.solved?this.connectivityRollbackCount>0?"connectivity_rollback":this.budgetLimited?"iteration_budget":this.connectivityValidationError?"connectivity_validation_unavailable":"completed":null,resultStatus:this.connectivityRollbackCount>0||this.budgetLimited||this.connectivityValidationError!==null?"best_effort":"complete",traceCursor:this.traceCursor,traceCount:t.length,traceIndex:t[this.traceCursor],routeCursor:this.routeCursor,candidateCursor:this.candidateCursor,candidateCount:this.candidates.length,candidateKind:e?.kind,candidateWidth:e?.width,candidatePointCount:e?.points.length,clearancePadding:this.clearancePaddingTiers[this.clearanceTierCursor],candidateShoveCount:this.candidateShoveCount,attemptedCandidateCount:this.attemptedCandidateCount,attemptedClearanceShoveCount:this.attemptedClearanceShoveCount,attemptedViaGridCount:this.attemptedViaGridCount,committedClearanceShoveCount:this.committedClearanceShoveCount,viaPairCountRemoved:this.viaPairCountRemoved,viaCountRemoved:this.viaCountRemoved,simplifiedPathCount:this.simplifiedPathCount,normalizedSegmentCount:this.normalizedSegmentCount,achievedExtraClearanceCount:this.achievedExtraClearanceCount,relocatedViaCount:this.relocatedViaCount,unresolvedViaCount:this.unresolvedViaCount,attemptedPushedViaRepairCount:this.attemptedPushedViaRepairCount,committedPushedViaRepairCount:this.committedPushedViaRepairCount,padClearanceRerouteCount:this.padClearanceRerouteCount,unresolvedPadClearanceCount:this.unresolvedPadClearanceCount,initialPadClearanceViolationCount:this.initialPadClearanceViolationCount,remainingPadClearanceViolationCount:this.remainingPadClearanceViolationCount,initialPadClearanceViolationCountByClearance:{...this.initialPadClearanceViolationCountByClearance},remainingPadClearanceViolationCountByClearance:{...this.remainingPadClearanceViolationCountByClearance},connectivityValidationCount:this.connectivityValidationCount,connectivityRollbackCount:this.connectivityRollbackCount,connectivityRegressionEndpointIds:[...this.connectivityRegressionEndpointIds],connectivityValidationError:this.connectivityValidationError,connectivityRollbackMutationStats:this.connectivityRollbackMutationStats===null?null:{...this.connectivityRollbackMutationStats},mutatedTraceIndices:[...this.finalizedMutatedTraceIndices],spatialIndexRectCount:this.obstacleIndex.items.length}}computeProgress(){if(this.solved||this.phase==="complete")return 1;let e=this.phase==="repair-vias"?this.viaRepairTraceIndices:this.traceIndices;if(e.length===0)return 1;let t=this.resumePhase==="scan-via-pairs"?0:0.5;return Math.min(0.99,t+this.traceCursor/e.length*0.5)}getConstructorParams(){return[this.inputProblem]}tryFinalAcceptance(){let e=this.pushedViaRepairRollbackTraces??this.rollbackTraces;e&&(this.traces=e),this.activeSubSolver=null,this.rollbackTraces=null,this.pushedViaRepairRollbackTraces=null,this.pendingPushedViaRepair=null,this.alternatePushedViaRepairs=[],this.viaGridAttempt=null,this.candidates=[],this.candidateCursor=0,this.clearanceTierCursor=0,this.candidateShoveCount=0,this.baseCandidateValidated=!1,this.candidateSetMayUseGridFallback=!1,this.ensureConnectivitySafeOutput(),this.obstacleIndex=new yb(this.inputProblem.simpleRouteJson,this.traces,void 0,[],this.connectionNameResolver),this.remainingPadClearanceViolationCount=this.countPadClearanceViolations(),this.remainingPadClearanceViolationCountByClearance=this.countPadClearanceViolationsByTier(),this.budgetLimited=!0,this.phase="complete",this.solved=!0,this.progress=1,this.stats=this.createStats()}getOutput(){return structuredClone(this.solved?this.traces:this.initialConnectivitySafeTraces)}visualize(){let e=[],t=[],n=this.candidates[this.candidateCursor];for(let o=0;o<this.traces.length;o++){let r=this.traces[o];for(let i of r.route)i.route_type==="via"&&t.push({center:i,radius:(i.via_diameter??0.6)/2,fill:"#d4a017",stroke:"#7a5700"});for(let i=0;i<r.route.length-1;i++){let s=r.route[i],a=r.route[i+1];Xa(s)&&Xa(a)&&s.layer===a.layer&&e.push({points:[s,a],strokeColor:s.layer==="bottom"?"#376fc4":"#777",strokeWidth:s.width})}}if(n)for(let o=0;o<n.points.length-1;o++)e.push({points:[n.points[o],n.points[o+1]],strokeColor:"#ff7400",strokeWidth:n.width+2*(this.clearancePaddingTiers[this.clearanceTierCursor]??0)});return{coordinateSystem:"cartesian",title:`Power trace cleanup: ${this.phase}`,lines:e,points:[],circles:t,rects:[],texts:[]}}},t9=(e)=>e?.route_type==="wire",FXe=class extends NV{inputProblem;traces;obstacleIndex;traceCursor=0;routeCursor=0;repairedSegmentCount=0;repairedPadNeckSegmentCount=0;unresolvedSegmentCount=0;totalWidthReduction=0;budgetLimited=!1;connectivityValidationCount=0;connectivityRollbackCount=0;connectivityRegressionEndpointIds=[];connectivityValidationError=null;connectivityRollbackMutationStats=null;connectionNameResolver;nominalWidthByTraceId=new Map;connectivityInvariant;initialConnectivitySafeTraces;minimumTraceWidth;traceIndices;connectivityFinalized=!1;constructor(e){super(),this.inputProblem=structuredClone(e),this.traces=structuredClone(e.traces),this.initialConnectivitySafeTraces=structuredClone(e.traces),this.connectivityInvariant=new Ibe(this.inputProblem.simpleRouteJson,this.initialConnectivitySafeTraces),this.connectionNameResolver=new Tw(e.simpleRouteJson,this.traces),this.minimumTraceWidth=e.simpleRouteJson.minTraceWidth;let t=e.traceIndices?[...new Set(e.traceIndices)]:this.traces.map((o,r)=>r);for(let o of t)if(!Number.isInteger(o)||o<0||o>=this.traces.length)throw RangeError(`Invalid clearance-repair trace index: ${o}`);this.traceIndices=t,this.obstacleIndex=this.createConservativeObstacleIndex();let n=this.traceIndices.reduce((o,r)=>o+Math.max(0,this.traces[r].route.length-1),0);this.MAX_ITERATIONS=Math.max(10,8*n+2*this.traceIndices.length),this.stats=this.createStats()}getSolverName(){return"PowerTraceClearanceRepairSolver"}_step(){let e=this.traceIndices[this.traceCursor],t=e===void 0?void 0:this.traces[e];if(!t)return this.ensureConnectivitySafeOutput(),this.solved=!0,void(this.stats=this.createStats());if(this.routeCursor>=t.route.length-1)return this.traceCursor++,this.routeCursor=0,void(this.stats=this.createStats());let n=this.routeCursor++,o=t.route[n],r=t.route[n+1];if(!t9(o)||!t9(r)||o.layer!==r.layer)return void(this.stats=this.createStats());let i=Math.max(o.width,r.width),s={start:o,end:r,layer:o.layer,width:i,connectionNames:this.getTraceConnectionNames(t),ignoreTraceIndex:e,ignoreRouteRange:{start:n,end:n+1}};if(this.repairConnectedPadNeck(t,n,s))return void(this.stats=this.createStats());if(!this.segmentHasForeignTraceCollision(n,i))return void(this.stats=this.createStats());if(this.segmentHasForeignTraceCollision(n,this.minimumTraceWidth))return this.unresolvedSegmentCount++,void(this.stats=this.createStats());let a=this.minimumTraceWidth,c=i;for(let m=0;m<10;m++){let A=(a+c)/2;this.segmentHasForeignTraceCollision(n,A)?c=A:a=A}let l=i>=0.5?0.025:0.0125,h=Math.max(this.minimumTraceWidth,Math.floor((a+hr)/l)*l),d=this.segmentHasForeignTraceCollision(n,h)?a:h,u=o.width,_=r.width;o.width=Math.min(o.width,d),r.width=Math.min(r.width,d);let p=u-o.width+(_-r.width);if(p<=hr)return this.unresolvedSegmentCount++,void(this.stats=this.createStats());this.repairedSegmentCount++,this.totalWidthReduction+=p,this.obstacleIndex=this.createConservativeObstacleIndex(),this.routeCursor=Math.max(0,n-1),this.stats=this.createStats()}repairConnectedPadNeck(e,t,n){let o=e.route[t],r=e.route[t+1];if(!t9(o)||!t9(r))return!1;let i=this.obstacleIndex.getConnectedPadWidthLimitAtPoint(n,o),s=this.obstacleIndex.getConnectedPadWidthLimitAtPoint(n,r);t===0&&(i=this.getSmallerLimit(i,this.obstacleIndex.getConnectedPadEndpointWidthLimitAtPoint(n,o))),t+1===e.route.length-1&&(s=this.getSmallerLimit(s,this.obstacleIndex.getConnectedPadEndpointWidthLimitAtPoint(n,r)));let a=i,c=s;if((a===null||o.width<=a+hr)&&(c===null||r.width<=c+hr))return!1;let l=o.width,h=r.width;if(a!==null&&(o.width=Math.min(o.width,a)),c!==null&&(r.width=Math.min(r.width,c)),a!==null&&c===null)this.insertPadBoundaryTransition(e,t,n,"start",o.width,h);else if(a===null&&c!==null)this.insertPadBoundaryTransition(e,t,n,"end",r.width,l);else if(a!==null&&c!==null){let d=this.obstacleIndex.getConnectedPadBoundaryPoint(n,"start"),u=this.obstacleIndex.getConnectedPadBoundaryPoint(n,"end");d&&u&&(this.insertPadBoundaryTransition(e,t,n,"start",o.width,h),this.insertPadBoundaryTransition(e,t+2,n,"end",r.width,l))}return this.totalWidthReduction+=l-o.width+(h-r.width),this.repairedPadNeckSegmentCount++,this.obstacleIndex=this.createConservativeObstacleIndex(),this.routeCursor=Math.max(0,t-1),!0}getSmallerLimit(e,t){return e===null?t:t===null?e:Math.min(e,t)}insertPadBoundaryTransition(e,t,n,o,r,i){let s=this.obstacleIndex.getConnectedPadBoundaryPoint(n,o);if(!s)return;let a=o==="start"?n.start:n.end,c=o==="start"?n.end:n.start,l=Math.hypot(c.x-a.x,c.y-a.y);if(l<=0.000000001)return;let h=Math.min(0.000001,l/4),d=(c.x-a.x)/l,u=(c.y-a.y)/l,_={route_type:"wire",x:s.x-d*h,y:s.y-u*h,width:r,layer:n.layer},p={..._,x:s.x+d*h,y:s.y+u*h,width:i},m=o==="start"?e.route[t+1]:e.route[t],A=o==="start"?e.route[t+2]:e.route[t-1];if(t9(m)&&A?.route_type==="via"){let g=this.resolveNominalTraceWidth(e);this.obstacleIndex.collides({...n,start:m,end:p,width:g})||(m.width=Math.max(m.width,g),p.width=m.width)}e.route.splice(t+1,0,...o==="start"?[_,p]:[p,_])}resolveNominalTraceWidth(e){let t=this.nominalWidthByTraceId.get(e.pcb_trace_id);if(t!==void 0)return t;let n=new Set(this.connectionNameResolver.canonicalize(this.getTraceConnectionNames(e))),o=this.inputProblem.simpleRouteJson.connections.find((i)=>this.connectionNameResolver.canonicalize([i.name,i.source_trace_id,i.rootConnectionName,i.netConnectionName,...i.mergedConnectionNames??[]].filter((s)=>Boolean(s))).some((s)=>n.has(s))),r=Math.max(o?.nominalTraceWidth??o?.width??this.inputProblem.simpleRouteJson.nominalTraceWidth??this.minimumTraceWidth,this.minimumTraceWidth);return this.nominalWidthByTraceId.set(e.pcb_trace_id,r),r}segmentHasForeignTraceCollision(e,t){let n=this.traceIndices[this.traceCursor],o=n===void 0?void 0:this.traces[n],r=o?.route[e],i=o?.route[e+1];return!!(o&&t9(r)&&t9(i)&&r.layer===i.layer)&&this.obstacleIndex.findCollisions({start:r,end:i,layer:r.layer,width:t,connectionNames:this.getTraceConnectionNames(o),ignoreTraceIndex:n,ignoreRouteRange:{start:e,end:e+1}}).some((s)=>s.kind==="trace"&&s.traceIndex!==void 0&&s.traceIndex!==n)}createConservativeObstacleIndex(){let e=structuredClone(this.traces);for(let t of e)for(let n=0;n<t.route.length-1;n++){let o=t.route[n],r=t.route[n+1];t9(o)&&t9(r)&&o.layer===r.layer&&(o.width=Math.max(o.width,r.width))}return new yb(this.inputProblem.simpleRouteJson,e,void 0,[],this.connectionNameResolver)}getTraceConnectionNames(e){return[e.pcb_trace_id,e.connection_name,e.source_trace_id,e.rootConnectionName,...e.mergedConnectionNames??[],...e.connectsTo??[]].filter((t)=>Boolean(t))}ensureConnectivitySafeOutput(){if(!this.connectivityFinalized){this.connectivityFinalized=!0,this.connectivityValidationCount++;try{let e=this.connectivityInvariant.validate(this.traces);if(this.connectivityValidationError??=e.validationError??null,e.safe)return;this.connectivityRegressionEndpointIds=[...new Set(e.regressions.flatMap((t)=>t.baselineEndpointLabels))]}catch(e){this.connectivityValidationError=e instanceof Error?e.message:String(e)}this.connectivityRollbackCount++,this.connectivityRollbackMutationStats={repairedSegmentCount:this.repairedSegmentCount,repairedPadNeckSegmentCount:this.repairedPadNeckSegmentCount,totalWidthReduction:this.totalWidthReduction},this.repairedSegmentCount=0,this.repairedPadNeckSegmentCount=0,this.totalWidthReduction=0,this.traces=structuredClone(this.initialConnectivitySafeTraces),this.obstacleIndex=this.createConservativeObstacleIndex()}}createStats(){return{phase:this.solved?"complete":"repair-trace-clearance",budgetLimited:this.budgetLimited,completionReason:this.solved?this.connectivityRollbackCount>0?"connectivity_rollback":this.budgetLimited?"iteration_budget":this.connectivityValidationError?"connectivity_validation_unavailable":"completed":null,resultStatus:this.connectivityRollbackCount>0||this.budgetLimited||this.connectivityValidationError!==null?"best_effort":"complete",traceCursor:this.traceCursor,traceCount:this.traceIndices.length,traceIndex:this.traceIndices[this.traceCursor],routeCursor:this.routeCursor,repairedSegmentCount:this.repairedSegmentCount,repairedPadNeckSegmentCount:this.repairedPadNeckSegmentCount,unresolvedSegmentCount:this.unresolvedSegmentCount,totalWidthReduction:this.totalWidthReduction,connectivityValidationCount:this.connectivityValidationCount,connectivityRollbackCount:this.connectivityRollbackCount,connectivityRegressionEndpointIds:[...this.connectivityRegressionEndpointIds],connectivityValidationError:this.connectivityValidationError,connectivityRollbackMutationStats:this.connectivityRollbackMutationStats===null?null:{...this.connectivityRollbackMutationStats},spatialIndexRectCount:this.obstacleIndex.items.length}}computeProgress(){return this.solved||this.traceIndices.length===0?1:Math.min(0.99,this.traceCursor/this.traceIndices.length)}tryFinalAcceptance(){this.ensureConnectivitySafeOutput(),this.budgetLimited=!0,this.solved=!0,this.progress=1,this.stats=this.createStats()}getConstructorParams(){return[this.inputProblem]}getOutput(){return structuredClone(this.solved?this.traces:this.initialConnectivitySafeTraces)}visualize(){let e=[];for(let t=0;t<this.traces.length;t++){let n=this.traces[t];for(let o=0;o<n.route.length-1;o++){let r=n.route[o],i=n.route[o+1];t9(r)&&t9(i)&&r.layer===i.layer&&e.push({points:[r,i],strokeColor:t===this.traceIndices[this.traceCursor]&&o===this.routeCursor?"#ff7400":r.layer==="bottom"?"#376fc4":"#777",strokeWidth:Math.max(r.width,i.width)})}}return{coordinateSystem:"cartesian",title:"Power trace direction-independent clearance repair",lines:e,points:[],circles:[],rects:[],texts:[]}}},XUt=[{x:0,y:0},{x:0.5,y:0},{x:0,y:0.5},{x:0.5,y:0.5}],jUt=[{offset:{x:0,y:0},strictNecking:!0},{offset:{x:0.5,y:0.5},strictNecking:!0},{offset:{x:0,y:0},strictNecking:!1},{offset:{x:0.5,y:0.5},strictNecking:!1}],KUt=(e)=>[...new Set(e.map((t)=>Number(t.toFixed(6))))].sort((t,n)=>n-t),Bs=(e)=>e?.route_type==="wire",IIr=class extends NV{inputProblem;options;traces;obstacleIndex;connectionNameResolver;connectionByTraceId=new Map;connectivityInvariant;lastConnectivitySafeTraces;traceOrder;selectedOwnedTraceIndices;selectedCleanupTraceIndices;selectedViaRepairTraceIndices;mutableBlockerTraceIndices;immutableTraceIndices;initialImmutableTraceSignatures=new Map;traceOrderCursor=-1;maxPassCount=4;previousWidthDeficit=0;passIndex=0;completedPassCount=0;lastNormalizedWidthDeficitGain=0;normalizedWidthDeficitGainByPass=[];plateauReached=!1;phase="scan-trace";traceIndex=-1;routeSegmentIndex=0;nominalTraceWidth=0;currentIntervals=[];intervalCursor=0;candidateWidths=[];widthCursor=0;gridResolutions=[];resolutionCursor=0;offsetCursor=0;keptTraceCount=0;recreatedTraceCount=0;expandedSegmentCount=0;intermediateExpandedSegmentCount=0;pathWidthUpgradeCount=0;inPlaceWidthProbeCount=0;reroutedSegmentCount=0;unresolvedSegmentCount=0;attemptedGridCount=0;attemptedLayerGridCount=0;attemptedInflationCount=0;pushedTraceCount=0;elasticPushedTraceCount=0;layerReroutedTraceCount=0;insertedViaCount=0;neckedLayerSegmentCount=0;removedViaPairCount=0;removedViaCount=0;simplifiedPathCount=0;normalizedSegmentCount=0;cleanupClearanceShoveCount=0;relocatedViaCount=0;unresolvedViaCount=0;initialImmutableViaViolationCount=0;remainingImmutableViaViolationCount=0;initialImmutableViaViolationPairCount=0;remainingImmutableViaViolationPairCount=0;immutableTraceMutationIds=[];lastSafeImmutableViaViolationSignatures=new Set;immutableViaViolationRollbackCount=0;attemptedImmutableViaViolationCount=null;attemptedImmutableViaViolationPairCount=null;immutableViaViolationRegressionIds=[];padClearanceRerouteCount=0;unresolvedPadClearanceCount=0;repairedTraceClearanceSegmentCount=0;repairedPadNeckSegmentCount=0;unresolvedTraceClearanceSegmentCount=0;sameNetContactRejectionCount=0;connectivityValidationCount=0;connectivityRollbackCount=0;connectivityRollbackPhases=[];immutableSafetyRollbackCount=0;immutableSafetyRollbackPhases=[];connectivityRegressionEndpointIds=[];connectivityValidationError=null;connectivityRollbackMutationStats=null;immutableSafetyRollbackMutationStats=null;discardedExpansionMutationStats=null;initialPadClearanceViolationCount=0;remainingPadClearanceViolationCount=0;initialPadClearanceViolationCountByClearance={};remainingPadClearanceViolationCountByClearance={};budgetLimitedExpansion=!1;finalAcceptanceUsed=!1;cleanupCompleted=!1;clearanceRepairCompleted=!1;cleanupBestEffortAccepted=!1;clearanceRepairBestEffortAccepted=!1;cleanupIterationBudget=0;clearanceRepairIterationBudget=0;expansionPushedTraceIndices=new Set;cleanupMutatedTraceIndices=[];failedSubSolverCount=0;inflationAttemptsBySegment=new Map;layerAttemptCountByTrace=new Map;layerRerouteCountByTrace=new Map;activeInflationKey=null;activeInflationWidth=null;layerAttempt=null;pendingLayerOutput=null;pendingLayerPushCount=0;constructor(e,t={}){super(),this.inputProblem=structuredClone(e),this.options=structuredClone(t),this.traces=structuredClone(e.traces??[]),this.connectionNameResolver=new Tw(this.inputProblem,this.traces),this.lastConnectivitySafeTraces=structuredClone(this.traces),this.connectivityInvariant=new Ibe(this.inputProblem,this.lastConnectivitySafeTraces);let n=t.onlyConnectionNames?new Set(this.connectionNameResolver.canonicalize([...t.onlyConnectionNames])):null,o=this.traces.flatMap((s,a)=>{if(!n)return[a];return this.connectionNameResolver.canonicalize(this.getTraceConnectionNames(s)).some((c)=>n.has(c))?[a]:[]}),r=new Map(o.map((s)=>[s,this.getInitialTracePriority(this.traces[s])]));this.traceOrder=o.sort((s,a)=>r.get(a)-r.get(s)||s-a),this.selectedOwnedTraceIndices=this.traceOrder.filter((s)=>this.findConnectionForTrace(this.traces[s])),this.selectedCleanupTraceIndices=[...this.selectedOwnedTraceIndices],this.selectedViaRepairTraceIndices=[...this.selectedOwnedTraceIndices],this.mutableBlockerTraceIndices=this.traces.flatMap((s,a)=>this.findConnectionForTrace(s)?[a]:[]);let i=new Set(this.mutableBlockerTraceIndices);this.immutableTraceIndices=this.traces.flatMap((s,a)=>i.has(a)?[]:(this.initialImmutableTraceSignatures.set(a,JSON.stringify(s)),[a])),this.previousWidthDeficit=this.calculateWidthDeficit().deficit,this.obstacleIndex=new yb(this.inputProblem,this.traces,this.traceIndex>=0?this.traceIndex:void 0,[],this.connectionNameResolver),this.lastSafeImmutableViaViolationSignatures=this.getImmutableViaViolationSignatures(this.traces),this.initialImmutableViaViolationCount=this.countViolatingImmutableVias(this.lastSafeImmutableViaViolationSignatures),this.remainingImmutableViaViolationCount=this.initialImmutableViaViolationCount,this.initialImmutableViaViolationPairCount=this.lastSafeImmutableViaViolationSignatures.size,this.remainingImmutableViaViolationPairCount=this.initialImmutableViaViolationPairCount,this.activeSubSolver=null,this.MAX_ITERATIONS=8000000,this.stats=this.createStats()}getSolverName(){return"PowerTraceExpanderSolver"}_step(){if(this.shouldStartBudgetFinalization())return this.startBudgetFinalization(),void(this.stats=this.createStats());if(this.activeSubSolver)return this.stepActiveGridSolver(),void(this.stats=this.createStats());switch(this.phase){case"scan-trace":this.scanNextTrace();break;case"evaluate-segment":this.evaluateNextSegment();break;case"try-trace-inflation":case"cleanup":case"repair-trace-clearance":break;case"try-layer-candidate":this.startNextLayerCandidate();break;case"try-grid-candidate":this.startNextGridCandidate();break;case"complete":this.acceptConnectivityCheckpoint(this.traces,"final"),this.solved=!0}this.stats=this.createStats()}scanNextTrace(){if(this.traceOrderCursor++,this.routeSegmentIndex=0,this.traceOrderCursor>=this.traceOrder.length)return void this.finishOrStartNextPass();this.traceIndex=this.traceOrder[this.traceOrderCursor];let e=this.traces[this.traceIndex];this.findConnectionForTrace(e)?(this.nominalTraceWidth=this.resolveNominalTraceWidth(e),this.traceMeetsNominalWidth(e,this.nominalTraceWidth)?this.keptTraceCount++:(this.rebuildObstacleIndex(),e.route=function(t,n){if(t.length<2)return t.map((r)=>({...r}));let o=[];for(let r=0;r<t.length-1;r++){let i=t[r],s=t[r+1];if(o.push({...i}),i.route_type!=="wire"||s.route_type!=="wire"||i.layer!==s.layer||i.width>=n-hr)continue;let a=ys(i,s),c=Math.max(1,Math.ceil(a/n));for(let l=1;l<c;l++){let h=l/c;o.push({route_type:"wire",x:i.x+(s.x-i.x)*h,y:i.y+(s.y-i.y)*h,width:i.width,layer:i.layer})}}return o.push({...t[t.length-1]}),o}(e.route,this.nominalTraceWidth),this.recreatedTraceCount++,this.phase="evaluate-segment")):this.keptTraceCount++}finishOrStartNextPass(){let{deficit:e,nominalArea:t}=this.calculateWidthDeficit(),n=this.previousWidthDeficit-e;if(this.lastNormalizedWidthDeficitGain=t<=hr?0:n/t,this.normalizedWidthDeficitGainByPass.push(this.lastNormalizedWidthDeficitGain),this.plateauReached=this.lastNormalizedWidthDeficitGain<0.001,this.completedPassCount=this.passIndex+1,this.passIndex+1<this.maxPassCount&&this.lastNormalizedWidthDeficitGain>=0.001)return this.previousWidthDeficit=e,this.passIndex++,this.traceOrderCursor=-1,this.traceIndex=-1,this.routeSegmentIndex=0,this.inflationAttemptsBySegment.clear(),void(this.phase="scan-trace");this.startCleanup()}startCleanup(){this.acceptConnectivityCheckpoint(this.traces,"expansion"),this.traceIndex=this.traces.length,this.phase="cleanup";let e=new HXe({simpleRouteJson:this.inputProblem,traces:this.traces,traceIndices:this.selectedCleanupTraceIndices,viaRepairTraceIndices:this.selectedViaRepairTraceIndices,mutableTraceIndices:this.mutableBlockerTraceIndices,maxRerouteLength:10,desiredPadClearance:this.options.powerTraceToPadClearance}),t=this.getRemainingParentIterationsAfterCurrentStep(),n=t===0?0:Math.max(1,Math.floor(0.75*t));e.MAX_ITERATIONS=Math.min(e.MAX_ITERATIONS,n),this.cleanupIterationBudget=e.MAX_ITERATIONS,this.activeSubSolver=e}shouldStartBudgetFinalization(){return!this.budgetLimitedExpansion&&(this.phase!=="cleanup"&&this.phase!=="repair-trace-clearance"&&this.phase!=="complete"&&this.iterations>=this.getExpansionIterationBudget())}getFinalizationIterationReserve(){return Math.min(Math.max(0,this.MAX_ITERATIONS-1),Math.max(1,Math.floor(0.125*this.MAX_ITERATIONS)))}getExpansionIterationBudget(){return Math.max(1,this.MAX_ITERATIONS-this.getFinalizationIterationReserve())}startBudgetFinalization(){this.budgetLimitedExpansion=!0,this.activeSubSolver=null,this.pendingLayerOutput=null,this.pendingLayerPushCount=0,this.activeInflationKey=null,this.activeInflationWidth=null,this.layerAttempt=null,this.discardInFlightExpansion(),this.startCleanup()}discardInFlightExpansion(){this.discardedExpansionMutationStats=this.captureAndResetExpansionMutationStats(),this.restoreLastConnectivitySafeTraces()}rollbackConnectivityRegressedExpansion(){this.connectivityRollbackMutationStats=this.captureAndResetExpansionMutationStats(),this.restoreLastConnectivitySafeTraces()}rollbackImmutableUnsafeExpansion(){this.immutableSafetyRollbackMutationStats=this.captureAndResetExpansionMutationStats(),this.restoreLastConnectivitySafeTraces()}captureAndResetExpansionMutationStats(){let e={recreatedTraceCount:this.recreatedTraceCount,expandedSegmentCount:this.expandedSegmentCount,intermediateExpandedSegmentCount:this.intermediateExpandedSegmentCount,pathWidthUpgradeCount:this.pathWidthUpgradeCount,reroutedSegmentCount:this.reroutedSegmentCount,pushedTraceCount:this.pushedTraceCount,elasticPushedTraceCount:this.elasticPushedTraceCount,layerReroutedTraceCount:this.layerReroutedTraceCount,insertedViaCount:this.insertedViaCount,neckedLayerSegmentCount:this.neckedLayerSegmentCount};return this.recreatedTraceCount=0,this.expandedSegmentCount=0,this.intermediateExpandedSegmentCount=0,this.pathWidthUpgradeCount=0,this.reroutedSegmentCount=0,this.pushedTraceCount=0,this.elasticPushedTraceCount=0,this.layerReroutedTraceCount=0,this.insertedViaCount=0,this.neckedLayerSegmentCount=0,this.expansionPushedTraceIndices.clear(),e}restoreLastConnectivitySafeTraces(){this.traces=structuredClone(this.lastConnectivitySafeTraces),this.rebuildObstacleIndex()}getRemainingParentIterationsAfterCurrentStep(){return Math.max(0,this.MAX_ITERATIONS-this.iterations-1)}calculateWidthDeficit(){let e=0,t=0;for(let n of this.traceOrder){let o=this.traces[n];if(!this.findConnectionForTrace(o))continue;let r=this.resolveNominalTraceWidth(o);for(let i=0;i<o.route.length-1;i++){let s=o.route[i],a=o.route[i+1];if(!Bs(s)||!Bs(a)||s.layer!==a.layer)continue;let c=ys(s,a),l=s.width;t+=c*r,e+=c*Math.max(0,r-l)}}return{deficit:e,nominalArea:t}}getInitialTracePriority(e){let t=this.resolveNominalTraceWidth(e),n=0;for(let o=0;o<e.route.length-1;o++){let r=e.route[o],i=e.route[o+1];Bs(r)&&Bs(i)&&r.layer===i.layer&&(n+=ys(r,i)*Math.max(0,t-Math.min(r.width,i.width)))}return t*n}evaluateNextSegment(){let e=this.traces[this.traceIndex];if(!e)return void(this.phase="scan-trace");let t=this.findNextUnderWidthSegment(e,this.routeSegmentIndex,this.nominalTraceWidth);if(t===-1)return void(this.phase="scan-trace");this.routeSegmentIndex=t;let n=e.route[t],o=e.route[t+1];if(!Bs(n)||!Bs(o))return void this.routeSegmentIndex++;let r=this.getTraceConnectionNames(e),i=Math.min(n.width,o.width),s=this.findMaximumSafeInPlaceWidth(e,t,r);if(s>i+hr){if(n.width=Math.max(n.width,s),o.width=Math.max(o.width,s),s>=this.nominalTraceWidth-hr)return this.expandedSegmentCount++,void this.routeSegmentIndex++;this.intermediateExpandedSegmentCount++}this.startTraceInflation(e,t)||this.prepareLayerRouteAttempt(e,t)||this.prepareRegularGridCandidates(e,t)}prepareRegularGridCandidates(e,t){if(this.currentIntervals=this.getExponentialIntervalCandidates(e,t,this.nominalTraceWidth),this.intervalCursor=0,this.candidateWidths=this.getCandidateWidths(this.nominalTraceWidth),this.widthCursor=0,this.gridResolutions=[],this.resolutionCursor=0,this.offsetCursor=0,this.currentIntervals.length===0)return this.unresolvedSegmentCount++,void this.routeSegmentIndex++;this.phase="try-grid-candidate"}prepareLayerRouteAttempt(e,t){if(this.nominalTraceWidth<0.499999)return!1;let n=this.options.allowNewVias!==!1&&this.inputProblem.layerCount>=2,o=n?2:this.maxPassCount,r=this.layerAttemptCountByTrace.get(this.traceIndex)??0,i=this.layerRerouteCountByTrace.get(this.traceIndex)??0;if(i>=o||r>=o||r>this.passIndex||r>0&&i===0)return!1;let s=e.route[t],a=e.route[t+1];if(!Bs(s)||!Bs(a)||Math.min(s.width,a.width)>=0.5*this.nominalTraceWidth-hr)return!1;let c=this.getExponentialIntervalCandidates(e,t,this.nominalTraceWidth).filter((f)=>this.intervalSupportsLayerRouting(e,f)).sort((f,y)=>y.endIndex-f.endIndex||f.startIndex-y.startIndex||this.getRouteIntervalLength(e,y.startIndex,y.endIndex)-this.getRouteIntervalLength(e,f.startIndex,f.endIndex))[0];if(!c)return!1;let l=this.getRouteQuality(e.route.slice(c.startIndex,c.endIndex+1));if(l.deficitArea<this.nominalTraceWidth)return!1;if(r>0&&l.deficitArea/Math.max(l.length,hr)<0.25)return!1;let h=e.route[c.startIndex],d=e.route[c.endIndex],u=this.getTraceConnectionNames(e),_=n?this.getEndpointLayers(h,u):[h.layer],p=n?this.getEndpointLayers(d,u):[d.layer],m=Math.min(this.nominalTraceWidth,Math.max(h.width,this.findMaximumSafeInPlaceWidth(e,c.startIndex,u))),A=Math.min(this.nominalTraceWidth,Math.max(d.width,this.findMaximumSafeInPlaceWidth(e,c.endIndex-1,u))),g=this.getSoftTraceIndices(this.nominalTraceWidth);return this.layerAttemptCountByTrace.set(this.traceIndex,r+1),this.layerAttempt={interval:c,minViaCount:n?1:0,maxViaCount:n?2:0,candidateWidths:[this.nominalTraceWidth],widthCursor:0,gridResolutions:[C0(this.nominalTraceWidth/4,0.2,0.3)],resolutionCursor:0,offsetCursor:0,startLayers:_,endLayers:p,startNeckWidth:m,endNeckWidth:A,softTraceIndices:g},this.phase="try-layer-candidate",!0}intervalSupportsLayerRouting(e,t){if(t.startIndex>=t.endIndex)return!1;for(let r=t.startIndex;r<=t.endIndex;r++){let i=e.route[r];if(!Bs(i))return!1}let n=e.route[t.startIndex],o=e.route[t.endIndex];return n.layer===o.layer}getEndpointLayers(e,t){return[...new Set([e.layer,...this.obstacleIndex.getConnectedLayersAtPoint({x:e.x,y:e.y},t)])].filter((n)=>this.obstacleIndex.boardLayers.includes(n))}getSoftTraceIndices(e){let t=[];for(let n=0;n<this.traces.length;n++){if(n===this.traceIndex)continue;let o=this.traces[n],r=this.findConnectionForTrace(o);if(!r)continue;Math.max(r.nominalTraceWidth??r.width??this.inputProblem.nominalTraceWidth??this.inputProblem.minTraceWidth,this.inputProblem.minTraceWidth)<e-hr&&t.push(n)}return t}startNextLayerCandidate(){let e=this.layerAttempt,t=this.traces[this.traceIndex];if(!e||!t)return this.layerAttempt=null,void(this.phase="evaluate-segment");if(e.widthCursor>=e.candidateWidths.length){let p=this.routeSegmentIndex;return this.layerAttempt=null,void this.prepareRegularGridCandidates(t,p)}let n=e.candidateWidths[e.widthCursor];if(e.gridResolutions.length===0&&(e.gridResolutions=this.getGridResolutions(n)),e.resolutionCursor>=e.gridResolutions.length)return e.widthCursor++,e.gridResolutions=[],e.resolutionCursor=0,void(e.offsetCursor=0);if(e.offsetCursor>=jUt.length)return e.resolutionCursor++,void(e.offsetCursor=0);let o=t.route[e.interval.startIndex],r=t.route[e.interval.endIndex];if(!Bs(o)||!Bs(r))return this.layerAttempt=null,void this.prepareRegularGridCandidates(t,this.routeSegmentIndex);let i=e.gridResolutions[e.resolutionCursor],s=jUt[e.offsetCursor],a=s.offset,c=Math.min(e.startNeckWidth,e.endNeckWidth),l=this.inputProblem.min_via_hole_diameter??this.inputProblem.minViaHoleDiameter??0.3,h=Math.max(l,this.inputProblem.min_via_pad_diameter??this.inputProblem.minViaPadDiameter??this.inputProblem.minViaDiameter??0.6),d=Math.max(this.inputProblem.minTraceWidth,Math.min(s.strictNecking?e.startNeckWidth:c,n)),u=Math.max(this.inputProblem.minTraceWidth,Math.min(s.strictNecking?e.endNeckWidth:c,n)),_=C0(3*this.nominalTraceWidth,1.5,3);e.maxViaCount>0?this.attemptedLayerGridCount++:this.attemptedGridCount++,this.activeSubSolver=new zUt({start:o,end:r,originalStartLayer:o.layer,originalEndLayer:r.layer,startLayers:e.startLayers,endLayers:e.endLayers,layers:this.obstacleIndex.boardLayers,traceWidth:n,startNeckWidth:d,endNeckWidth:u,maxStartNeckLength:_,maxEndNeckLength:_,neckPenaltyExponent:s.strictNecking?2:1,viaDiameter:h,viaHoleDiameter:l,minViaCount:e.minViaCount,maxViaCount:e.maxViaCount,viaCost:Math.max(1,2*this.nominalTraceWidth),gridSize:i,gridOffset:{x:a.x*i,y:a.y*i},connectionNames:this.getTraceConnectionNames(t),obstacleIndex:this.obstacleIndex,ignoreTraceIndex:this.traceIndex,ignoreRouteRange:{start:Math.max(0,e.interval.startIndex-1),end:Math.min(t.route.length-1,e.interval.endIndex+1)},softTraceIndices:e.softTraceIndices,fixedVias:this.getFixedViasOutsideInterval(t,e.interval),bounds:this.inputProblem.bounds,obstacleClearance:this.getDesiredPadClearance(n),searchPadding:Math.min(5,Math.max(2.5,ys(o,r)/2,4*n))})}startNextGridCandidate(){let e=this.traces[this.traceIndex];if(!e)return void(this.phase="scan-trace");if(this.widthCursor>=this.candidateWidths.length)return this.unresolvedSegmentCount++,this.routeSegmentIndex++,void(this.phase="evaluate-segment");if(this.intervalCursor>=this.currentIntervals.length)return this.widthCursor++,this.intervalCursor=0,this.gridResolutions=[],this.resolutionCursor=0,void(this.offsetCursor=0);let t=this.candidateWidths[this.widthCursor],n=e.route[this.routeSegmentIndex],o=e.route[this.routeSegmentIndex+1];if(Bs(n)&&Bs(o)&&t<=Math.min(n.width,o.width)+hr)return void(this.widthCursor=this.candidateWidths.length);if(this.gridResolutions.length===0&&(this.gridResolutions=this.getGridResolutions(t)),this.resolutionCursor>=this.gridResolutions.length)return this.intervalCursor++,this.resolutionCursor=0,void(this.offsetCursor=0);if(this.offsetCursor>=XUt.length)return this.resolutionCursor++,void(this.offsetCursor=0);let r=this.currentIntervals[this.intervalCursor],i=e.route[r.startIndex],s=e.route[r.endIndex];if(!Bs(i)||!Bs(s)||i.layer!==s.layer)return this.intervalCursor++,this.resolutionCursor=0,void(this.offsetCursor=0);if(this.endpointCollides(e,r,i,t)||this.endpointCollides(e,r,s,t))return this.intervalCursor++,this.resolutionCursor=0,void(this.offsetCursor=0);let a=this.gridResolutions[this.resolutionCursor],c=XUt[this.offsetCursor],l={x:c.x*a,y:c.y*a};this.attemptedGridCount++,this.activeSubSolver=new xbe({start:i,end:s,layer:i.layer,traceWidth:t,gridSize:a,gridOffset:l,connectionNames:this.getTraceConnectionNames(e),obstacleIndex:this.obstacleIndex,ignoreTraceIndex:this.traceIndex,ignoreRouteRange:{start:Math.max(0,r.startIndex-1),end:Math.min(e.route.length-1,r.endIndex+1)},bounds:this.inputProblem.bounds,obstacleClearance:this.getDesiredPadClearance(t),searchPadding:Math.min(5,Math.max(1.5,ys(i,s)/2,3*t))})}endpointCollides(e,t,n,o){return this.obstacleIndex.collides({start:n,end:n,layer:n.layer,width:o,connectionNames:this.getTraceConnectionNames(e),ignoreTraceIndex:this.traceIndex,ignoreRouteRange:{start:Math.max(0,t.startIndex-1),end:Math.min(e.route.length-1,t.endIndex+1)},obstacleClearance:this.getDesiredPadClearance(o)})}stepActiveGridSolver(){if(this.activeSubSolver instanceof FXe)return void this.stepActiveTraceClearanceRepairSolver();if(this.activeSubSolver instanceof HXe)return void this.stepActiveCleanupSolver();if(this.activeSubSolver instanceof U$)return void this.stepActiveInflationSolver();if(this.activeSubSolver instanceof zUt)return void this.stepActiveLayerSolver();let e=this.activeSubSolver;if(e.step(),e.solved||e.failed){if(e.solved){let t=e.getOutput();if(t){let n=this.gridRouteReplacementCollides(t)||this.gridRouteBoundaryCollides(t);if(!n&&this.gridRoutePreservesSameNetContacts(t))return this.applyGridRoute(this.maximizeGridRouteWidth(t)),void(this.activeSubSolver=null);n||this.sameNetContactRejectionCount++}}this.retainFailedSubSolver(e),this.activeSubSolver=null,this.offsetCursor++}}stepActiveCleanupSolver(){let e=this.activeSubSolver;if(e.step(),e.solved||e.failed){if(e.solved)return this.adoptCleanupOutput(e),this.activeSubSolver=null,void this.startTraceClearanceRepair();this.retainFailedSubSolver(e),this.activeSubSolver=null,this.startTraceClearanceRepair()}}adoptCleanupOutput(e){let t=this.acceptConnectivityCheckpoint(e.getOutput(),"cleanup");this.cleanupCompleted=!e.budgetLimited;let n=e.stats;this.connectivityValidationError??=n.connectivityValidationError??null,this.connectivityValidationCount+=Number(n.connectivityValidationCount??0);let o=Number(n.connectivityRollbackCount??0);o>0&&(this.connectivityRollbackCount+=o,this.connectivityRollbackPhases.includes("cleanup")||this.connectivityRollbackPhases.push("cleanup"),this.connectivityRegressionEndpointIds=[...new Set([...this.connectivityRegressionEndpointIds,...n.connectivityRegressionEndpointIds??[]])]);let r=t&&o===0;this.cleanupBestEffortAccepted=e.budgetLimited&&r,this.cleanupMutatedTraceIndices=r?[...n.mutatedTraceIndices??[]]:[],this.removedViaPairCount=r?Number(n.viaPairCountRemoved??0):0,this.removedViaCount=r?Number(n.viaCountRemoved??0):0,this.simplifiedPathCount=r?Number(n.simplifiedPathCount??0):0,this.normalizedSegmentCount=r?Number(n.normalizedSegmentCount??0):0,this.cleanupClearanceShoveCount=r?Number(n.committedClearanceShoveCount??0):0,this.relocatedViaCount=r?Number(n.relocatedViaCount??0):0,this.unresolvedViaCount=Number(n.unresolvedViaCount??0),this.padClearanceRerouteCount=r?Number(n.padClearanceRerouteCount??0):0,this.unresolvedPadClearanceCount=Number(n.unresolvedPadClearanceCount??0),this.initialPadClearanceViolationCount=Number(n.initialPadClearanceViolationCount??0),this.remainingPadClearanceViolationCount=Number(n.remainingPadClearanceViolationCount??0),this.initialPadClearanceViolationCountByClearance={...n.initialPadClearanceViolationCountByClearance??{}},this.remainingPadClearanceViolationCountByClearance={...n.remainingPadClearanceViolationCountByClearance??{}},this.rebuildObstacleIndex()}startTraceClearanceRepair(){this.phase="repair-trace-clearance";let e=[...new Set([...this.getOwnedTraceIndices(),...this.expansionPushedTraceIndices,...this.cleanupMutatedTraceIndices])],t=new FXe({simpleRouteJson:this.inputProblem,traces:this.traces,traceIndices:e});t.MAX_ITERATIONS=Math.min(t.MAX_ITERATIONS,this.getRemainingParentIterationsAfterCurrentStep()),this.clearanceRepairIterationBudget=t.MAX_ITERATIONS,this.activeSubSolver=t}stepActiveTraceClearanceRepairSolver(){let e=this.activeSubSolver;if(e.step(),e.solved||e.failed){if(e.solved)return this.adoptClearanceRepairOutput(e),this.activeSubSolver=null,void(this.phase="complete");this.retainFailedSubSolver(e),this.activeSubSolver=null,this.phase="complete"}}adoptClearanceRepairOutput(e){let t=this.acceptConnectivityCheckpoint(e.getOutput(),"clearance-repair");this.clearanceRepairCompleted=!e.budgetLimited;let n=e.stats;this.connectivityValidationError??=n.connectivityValidationError??null,this.connectivityValidationCount+=Number(n.connectivityValidationCount??0);let o=Number(n.connectivityRollbackCount??0);o>0&&(this.connectivityRollbackCount+=o,this.connectivityRollbackPhases.includes("clearance-repair")||this.connectivityRollbackPhases.push("clearance-repair"),this.connectivityRegressionEndpointIds=[...new Set([...this.connectivityRegressionEndpointIds,...n.connectivityRegressionEndpointIds??[]])]);let r=t&&o===0;this.clearanceRepairBestEffortAccepted=e.budgetLimited&&r,this.repairedTraceClearanceSegmentCount=r?Number(n.repairedSegmentCount??0):0,this.repairedPadNeckSegmentCount=r?Number(n.repairedPadNeckSegmentCount??0):0,this.unresolvedTraceClearanceSegmentCount=Number(n.unresolvedSegmentCount??0),this.rebuildObstacleIndex()}stepActiveLayerSolver(){let e=this.activeSubSolver;if(e.step(),e.solved||e.failed){if(e.solved){let t=e.getOutput();if(t){let n=!this.layerRouteReplacementCollides(t,!0)&&this.layerRouteImprovesInterval(t),o=n&&this.layerRoutePreservesSameNetContacts(t);if(o){if(this.activeSubSolver=null,this.pendingLayerOutput=t,this.pendingLayerPushCount=0,!this.layerRouteReplacementCollides(t,!1))return void this.applyLayerRoute(t);if(this.startPendingLayerInflation())return;this.pendingLayerOutput=null}n&&!o&&this.sameNetContactRejectionCount++}}this.retainFailedSubSolver(e),this.activeSubSolver=null,this.layerAttempt&&this.layerAttempt.offsetCursor++,this.phase="try-layer-candidate"}}layerRouteReplacementCollides(e,t){let n=this.traces[this.traceIndex],o=this.layerAttempt;if(!n||!o)return!0;let r=this.getTraceConnectionNames(n),i=t?o.softTraceIndices:void 0,s={start:Math.max(0,o.interval.startIndex-1),end:Math.min(n.route.length-1,o.interval.endIndex+1)},a=this.getFixedViasOutsideInterval(n,o.interval);for(let c=0;c<e.route.length;c++){let l=e.route[c];if(l?.route_type==="via"){if(this.obstacleIndex.collidesVia({point:l,layers:this.obstacleIndex.boardLayers,padDiameter:l.via_diameter??0.6,holeDiameter:l.via_hole_diameter??this.obstacleIndex.defaultViaHoleDiameter,connectionNames:r,ignoreTraceIndex:this.traceIndex,ignoreTraceIndices:i,otherNewViaPoints:e.route.slice(0,c).filter((d)=>d.route_type==="via").map((d)=>({x:d.x,y:d.y})),fixedVias:a,ignoreRouteRange:s,obstacleClearance:this.getDesiredPadClearance(e.traceWidth),blockSameNetObstacles:!0,sameNetObstacleClearance:0}))return!0;continue}let h=e.route[c+1];if(l?.route_type==="wire"&&h?.route_type==="wire"&&l.layer===h.layer&&this.obstacleIndex.collides({start:l,end:h,layer:l.layer,width:Math.max(l.width,h.width),connectionNames:r,ignoreTraceIndex:this.traceIndex,ignoreTraceIndices:i,ignoreRouteRange:s,obstacleClearance:this.getDesiredPadClearance(e.traceWidth)}))return!0}return this.layerRouteBoundaryCollides(e,t)}getFixedViasOutsideInterval(e,t){return e.route.flatMap((n,o)=>n.route_type!=="via"||o>=t.startIndex&&o<=t.endIndex?[]:[{point:{x:n.x,y:n.y},padDiameter:n.via_diameter??0.6,holeDiameter:n.via_hole_diameter??this.obstacleIndex.defaultViaHoleDiameter}])}layerRouteBoundaryCollides(e,t){let n=this.traces[this.traceIndex],o=this.layerAttempt,r=e.route.find((a)=>a.route_type==="wire"),i;for(let a=e.route.length-1;a>=0;a--){let c=e.route[a];if(c?.route_type==="wire"){i=c;break}}if(!r||!i)return!0;let s=[{outside:n.route[o.interval.startIndex-1],inside:r},{outside:n.route[o.interval.endIndex+1],inside:i}];for(let a of s)if(Bs(a.outside)&&a.outside.layer===a.inside.layer&&this.obstacleIndex.collides({start:a.outside,end:a.inside,layer:a.inside.layer,width:Math.max(a.outside.width,a.inside.width),connectionNames:this.getTraceConnectionNames(n),ignoreTraceIndex:this.traceIndex,ignoreTraceIndices:t?o.softTraceIndices:void 0,ignoreRouteRange:{start:Math.max(0,o.interval.startIndex-1),end:Math.min(n.route.length-1,o.interval.endIndex+1)},obstacleClearance:this.getDesiredPadClearance(e.traceWidth)}))return!0;return!1}layerRouteImprovesInterval(e){let t=this.traces[this.traceIndex],n=this.layerAttempt.interval,o=this.getRouteQuality(t.route.slice(n.startIndex,n.endIndex+1)),r=this.getRouteQuality(e.route);return r.length<=o.length+10+hr&&r.deficitArea<=o.deficitArea-Math.max(0.05,0.1*o.deficitArea)}getRouteQuality(e){let t=0,n=0;for(let o=0;o<e.length-1;o++){let r=e[o],i=e[o+1];if(!Bs(r)||!Bs(i)||r.layer!==i.layer)continue;let s=ys(r,i),a=Math.min(r.width,i.width);t+=s,n+=s*Math.max(0,this.nominalTraceWidth-a)}return{length:t,deficitArea:n}}getLayerInflationCorridor(e){let t=[];for(let n=0;n<e.route.length;n++){let o=e.route[n];if(o?.route_type==="via"){for(let i of this.obstacleIndex.boardLayers)t.push({start:o,end:o,layer:i,width:o.via_diameter??0.6});continue}let r=e.route[n+1];o?.route_type==="wire"&&r?.route_type==="wire"&&o.layer===r.layer&&t.push({start:o,end:r,layer:o.layer,width:Math.max(o.width,r.width)})}return t}startPendingLayerInflation(){let e=this.pendingLayerOutput;if(!e||this.pendingLayerPushCount>=2)return!1;let t=this.getLayerInflationCorridor(e);return t.length!==0&&(this.pendingLayerPushCount++,this.attemptedInflationCount++,this.activeSubSolver=new U$({simpleRouteJson:this.inputProblem,traces:this.traces,powerTraceIndex:this.traceIndex,nominalPowerWidth:e.traceWidth,mutableTraceIndices:this.mutableBlockerTraceIndices,corridor:t,maxRerouteLength:10},this.connectionNameResolver),this.phase="try-trace-inflation",!0)}applyLayerRoute(e){let t=this.traces[this.traceIndex],n=this.layerAttempt.interval,o=this.createLayerRouteReplacement(e);t.route.splice(n.startIndex,n.endIndex-n.startIndex+1,...o),e.viaCount>0&&this.layerReroutedTraceCount++,this.layerRerouteCountByTrace.set(this.traceIndex,(this.layerRerouteCountByTrace.get(this.traceIndex)??0)+1),this.reroutedSegmentCount++,this.insertedViaCount+=e.viaCount,e.viaCount>0&&(this.neckedLayerSegmentCount+=o.filter((r)=>r.route_type==="wire"&&r.width<this.nominalTraceWidth-hr).length),this.routeSegmentIndex=n.startIndex,this.currentIntervals=[],this.layerAttempt=null,this.pendingLayerOutput=null,this.pendingLayerPushCount=0,this.phase="evaluate-segment"}createLayerRouteReplacement(e){let t=this.traces[this.traceIndex],n=this.layerAttempt.interval,o=t.route[n.startIndex],r=t.route[n.endIndex],i=structuredClone(e.route),s=i.findIndex((c)=>c.route_type==="wire"),a=-1;for(let c=i.length-1;c>=0;c--)if(i[c]?.route_type==="wire"){a=c;break}return s>=0&&(i[s]={...o,...i[s]}),a>=0&&(i[a]={...r,...i[a]}),i}layerRoutePreservesSameNetContacts(e){let t=this.traces[this.traceIndex],n=this.layerAttempt.interval;return this.routeReplacementPreservesSameNetContacts(t,n,this.createLayerRouteReplacement(e))}startTraceInflation(e,t){let n=e.route[t],o=e.route[t+1];if(!Bs(n)||!Bs(o))return!1;let r=Math.min(n.width,o.width),i=this.findBestPushableInflationWidth(e,t,r);if(!i)return!1;let s=this.getLocalInflationCorridor(e,t,i);if(s.length===0)return!1;let a=[this.traceIndex,n.x,n.y,o.x,o.y].join(":"),c=this.inflationAttemptsBySegment.get(a)??0;return!(c>=2)&&(this.inflationAttemptsBySegment.set(a,c+1),this.activeInflationKey=a,this.activeInflationWidth=i,this.attemptedInflationCount++,this.activeSubSolver=new U$({simpleRouteJson:this.inputProblem,traces:this.traces,powerTraceIndex:this.traceIndex,nominalPowerWidth:i,mutableTraceIndices:this.mutableBlockerTraceIndices,corridor:s,maxRerouteLength:10},this.connectionNameResolver),this.phase="try-trace-inflation",!0)}hasOnlyPushableTraceBlockers(e,t,n){let o=Math.max(0,t-1),r=Math.min(e.route.length-2,t+1),i=new Set;for(let s=o;s<=r;s++){let a=e.route[s],c=e.route[s+1];if(!Bs(a)||!Bs(c)||a.layer!==c.layer)continue;let l={start:a,end:c,layer:a.layer,width:n,connectionNames:this.getTraceConnectionNames(e),ignoreTraceIndex:this.traceIndex,ignoreRouteRange:{start:o,end:r+1},obstacleClearance:this.getDesiredPadClearance(n)},h=this.obstacleIndex.findCollisions(l);if(h.length===0&&this.obstacleIndex.collides(l))return!1;for(let d of h){if(d.kind!=="trace"||d.traceIndex===void 0)return!1;let u=this.traces[d.traceIndex];if(!u)return!1;let _=this.findConnectionForTrace(u);if(!_||(_.nominalTraceWidth??_.width??this.inputProblem.nominalTraceWidth??this.inputProblem.minTraceWidth)>=n-hr)return!1;i.add(d.traceIndex)}}return i.size>0&&i.size<=2}findBestPushableInflationWidth(e,t,n){let o=this.nominalTraceWidth>=0.5?0.05:0.0125;for(let r=this.nominalTraceWidth;r>n+hr;r-=o){let i=Number(r.toFixed(6));if(this.hasOnlyPushableTraceBlockers(e,t,i))return i}return null}stepActiveInflationSolver(){let e=this.activeSubSolver;if(e.step(),e.solved||e.failed){if(e.solved){let t=e.getOutput(),n=t&&this.sameNetContactsArePreserved(this.traces[t.pushedTraceIndex].route,t.traces[t.pushedTraceIndex].route,this.getTraceConnectionNames(this.traces[t.pushedTraceIndex]),t.pushedTraceIndex);if(t&&n){if(this.traces=t.traces,this.pushedTraceCount++,this.expansionPushedTraceIndices.add(t.pushedTraceIndex),t.strategy==="elastic"&&this.elasticPushedTraceCount++,this.activeSubSolver=null,this.activeInflationKey=null,this.activeInflationWidth=null,this.rebuildObstacleIndex(),this.pendingLayerOutput){if(!this.layerRouteReplacementCollides(this.pendingLayerOutput,!1)&&this.layerRoutePreservesSameNetContacts(this.pendingLayerOutput))return void this.applyLayerRoute(this.pendingLayerOutput);if(this.startPendingLayerInflation())return;return this.pendingLayerOutput=null,this.pendingLayerPushCount=0,this.layerAttempt&&this.layerAttempt.offsetCursor++,void(this.phase="try-layer-candidate")}return void(this.phase="evaluate-segment")}t&&!n&&this.sameNetContactRejectionCount++}if(this.retainFailedSubSolver(e),this.activeInflationKey&&this.inflationAttemptsBySegment.set(this.activeInflationKey,2),this.activeInflationKey=null,this.activeInflationWidth=null,this.activeSubSolver=null,this.pendingLayerOutput)return this.pendingLayerOutput=null,this.pendingLayerPushCount=0,this.layerAttempt&&this.layerAttempt.offsetCursor++,void(this.phase="try-layer-candidate");this.phase="evaluate-segment"}}getLocalInflationCorridor(e,t,n){let o=e.route[t],r=e.route[t+1];if(!Bs(o)||!Bs(r)||o.layer!==r.layer)return[];let i=C0(4*n,2,4),s=i/2,a=t,c=0;for(;a>0;){let _=e.route[a-1],p=e.route[a];if(!Bs(_)||!Bs(p)||_.layer!==p.layer)break;let m=ys(_,p);if(c+m>s+hr)break;c+=m,a--}let l=t+1,h=0;for(;l<e.route.length-1;){let _=e.route[l],p=e.route[l+1];if(!Bs(_)||!Bs(p)||_.layer!==p.layer)break;let m=ys(_,p);if(h+m>s+hr)break;h+=m,l++}let d=i-c-h;for(;d>hr&&a>0;){let _=e.route[a-1],p=e.route[a];if(!Bs(_)||!Bs(p)||_.layer!==p.layer)break;let m=ys(_,p);if(m>d+hr)break;d-=m,a--}for(;d>hr&&l<e.route.length-1;){let _=e.route[l],p=e.route[l+1];if(!Bs(_)||!Bs(p)||_.layer!==p.layer)break;let m=ys(_,p);if(m>d+hr)break;d-=m,l++}let u=[];for(let _=a;_<l;_++){let p=e.route[_],m=e.route[_+1];Bs(p)&&Bs(m)&&p.layer===m.layer&&u.push({start:p,end:m,layer:p.layer,width:n})}return u}applyGridRoute(e){let t=this.traces[this.traceIndex],n=this.currentIntervals[this.intervalCursor],o=this.createGridRouteReplacement(e);t.route.splice(n.startIndex,n.endIndex-n.startIndex+1,...o),this.reroutedSegmentCount++,this.routeSegmentIndex=n.startIndex+o.length-1,this.currentIntervals=[],this.phase="evaluate-segment"}createGridRouteReplacement(e){let t=this.traces[this.traceIndex],n=this.currentIntervals[this.intervalCursor],o=t.route[n.startIndex],r=t.route[n.endIndex],i=e.points.map((s)=>({route_type:"wire",x:s.x,y:s.y,width:e.traceWidth,layer:o.layer}));return i[0].width=Math.max(o.width,e.traceWidth),i[i.length-1].width=Math.max(r.width,e.traceWidth),i}gridRoutePreservesSameNetContacts(e){let t=this.traces[this.traceIndex],n=this.currentIntervals[this.intervalCursor];return this.routeReplacementPreservesSameNetContacts(t,n,this.createGridRouteReplacement(e))}routeReplacementPreservesSameNetContacts(e,t,n){let o=this.getTraceConnectionNames(e),r=this.getSameNetContactIds(e.route.slice(t.startIndex,t.endIndex+1),o,this.traceIndex),i=new Set([...this.getSameNetContactIds(e.route.slice(0,t.startIndex+1),o,this.traceIndex),...this.getSameNetContactIds(e.route.slice(t.endIndex),o,this.traceIndex)]),s=new Set([...r].filter((c)=>!i.has(c)));if(s.size===0)return!0;let a=this.getSameNetContactIds(n,o,this.traceIndex);return[...s].every((c)=>a.has(c))}sameNetContactsArePreserved(e,t,n,o){let r=this.getSameNetContactIds(e,n,o);if(r.size===0)return!0;let i=this.getSameNetContactIds(t,n,o);return[...r].every((s)=>i.has(s))}getSameNetContactIds(e,t,n){let o=new Set;for(let r=0;r<e.length;r++){let i=e[r];if(i?.route_type==="via"){for(let a of this.getViaLayers(i))for(let c of this.obstacleIndex.getSameNetCopperContactIds({start:i,end:i,layer:a,width:i.via_diameter??0.6,connectionNames:t,ignoreTraceIndex:n}))o.add(c);continue}let s=e[r+1];if(i?.route_type==="wire"&&s?.route_type==="wire"&&i.layer===s.layer)for(let a of this.obstacleIndex.getSameNetCopperContactIds({start:i,end:s,layer:i.layer,width:Math.min(i.width,s.width),connectionNames:t,ignoreTraceIndex:n}))o.add(a)}return o}getViaLayers(e){let t=this.obstacleIndex.boardLayers.indexOf(e.from_layer),n=this.obstacleIndex.boardLayers.indexOf(e.to_layer);return t<0||n<0?this.obstacleIndex.boardLayers:this.obstacleIndex.boardLayers.slice(Math.min(t,n),Math.max(t,n)+1)}gridRouteReplacementCollides(e){let t=this.traces[this.traceIndex],n=this.currentIntervals[this.intervalCursor],o=t.route[n.startIndex],r=t.route[n.endIndex],i=this.getTraceConnectionNames(t);for(let s=0;s<e.points.length-1;s++){let a=Math.max(e.traceWidth,s===0?o.width:0,s===e.points.length-2?r.width:0);if(this.obstacleIndex.collides({start:e.points[s],end:e.points[s+1],layer:o.layer,width:a,connectionNames:i,ignoreTraceIndex:this.traceIndex,ignoreRouteRange:{start:Math.max(0,n.startIndex-1),end:Math.min(t.route.length-1,n.endIndex+1)},obstacleClearance:this.getDesiredPadClearance(a)}))return!0}return!1}gridRouteBoundaryCollides(e){let t=this.traces[this.traceIndex],n=this.currentIntervals[this.intervalCursor],o=this.getTraceConnectionNames(t),r=[{startIndex:n.startIndex-1,endIndex:n.startIndex},{startIndex:n.endIndex,endIndex:n.endIndex+1}];for(let i of r){let s=t.route[i.startIndex],a=t.route[i.endIndex];if(Bs(s)&&Bs(a)&&s.layer===a.layer&&this.obstacleIndex.collides({start:s,end:a,layer:s.layer,width:Math.max(s.width,a.width,e.traceWidth),connectionNames:o,ignoreTraceIndex:this.traceIndex,ignoreRouteRange:{start:i.startIndex,end:i.endIndex},obstacleClearance:this.getDesiredPadClearance(Math.max(s.width,a.width,e.traceWidth))}))return!0}return!1}canExpandSegmentAndEndpoints(e,t,n,o=this.nominalTraceWidth){let r=Math.max(0,t-1),i=Math.min(e.route.length-2,t+1);for(let s=r;s<=i;s++){let a=e.route[s],c=e.route[s+1];if(!Bs(a)||!Bs(c)||a.layer!==c.layer)continue;let l=s<=t+1&&s+1>=t,h=Math.max(a.width,c.width,l?o:0);if(this.obstacleIndex.collides({start:a,end:c,layer:a.layer,width:h,connectionNames:n,ignoreTraceIndex:this.traceIndex,ignoreRouteRange:{start:r,end:i+1},obstacleClearance:this.getDesiredPadClearance(h)}))return!1}return!0}findMaximumSafeInPlaceWidth(e,t,n){let o=e.route[t],r=e.route[t+1];if(!Bs(o)||!Bs(r))return 0;let i=Math.min(o.width,r.width);if(this.probeInPlaceWidth(e,t,n,this.nominalTraceWidth))return this.nominalTraceWidth;let s=i,a=this.nominalTraceWidth;for(let h=0;h<7;h++){let d=(s+a)/2;if(d<=s+hr)break;this.probeInPlaceWidth(e,t,n,d)?s=d:a=d}let c=this.nominalTraceWidth>=0.5?0.025:0.0125,l=Math.max(i,Math.floor((s+hr)/c)*c);return l>i+hr&&this.probeInPlaceWidth(e,t,n,l)?l:i}probeInPlaceWidth(e,t,n,o){return this.inPlaceWidthProbeCount++,this.canExpandSegmentAndEndpoints(e,t,n,o)}maximizeGridRouteWidth(e){if(e.traceWidth>=this.nominalTraceWidth-hr)return e;let t=e.traceWidth,n=this.nominalTraceWidth;for(let i=0;i<7;i++){let s=(t+n)/2,a={...e,traceWidth:s};this.gridRouteReplacementCollides(a)||this.gridRouteBoundaryCollides(a)?n=s:t=s}let o=this.nominalTraceWidth>=0.5?0.025:0.0125,r=Math.max(e.traceWidth,Math.floor((t+hr)/o)*o);if(r>e.traceWidth+hr){let i={...e,traceWidth:r};if(!this.gridRouteReplacementCollides(i)&&!this.gridRouteBoundaryCollides(i))return this.pathWidthUpgradeCount++,i}return e}getExponentialIntervalCandidates(e,t,n){let o=this.getExponentialIndices(e,t,-1,n,5),r=this.getExponentialIndices(e,t,1,n,10).filter((s)=>s>t),i=[];for(let s of o)for(let a of r){let c=this.getRouteIntervalLength(e,s,a);c>10.000001||i.push({startIndex:s,endIndex:a,routeLength:c})}return i.sort((s,a)=>s.routeLength-a.routeLength).filter((s,a,c)=>c.findIndex((l)=>l.startIndex===s.startIndex&&l.endIndex===s.endIndex)===a).slice(0,10).map(({startIndex:s,endIndex:a})=>({startIndex:s,endIndex:a}))}getExponentialIndices(e,t,n,o,r){let i=[t],s=0,a=Math.max(o,0.3),c=t,l=t;for(;;){let h=c+n;if(h<0||h>=e.route.length)break;let d=e.route[c],u=e.route[h];if(!Bs(d)||!Bs(u)||d.layer!==u.layer)break;let _=ys(d,u);if(s+_>r+hr)break;s+=_,c=h,l=h,s+hr>=a&&(i.push(h),a*=2)}return i.includes(l)||i.push(l),i}getRouteIntervalLength(e,t,n){let o=0;for(let r=t;r<n;r++){let i=e.route[r],s=e.route[r+1];if(!Bs(i)||!Bs(s)||i.layer!==s.layer)return Number.POSITIVE_INFINITY;o+=ys(i,s)}return o}getCandidateWidths(e){let t=this.inputProblem.minTraceWidth;return KUt([e,0.875*e,0.75*e,0.625*e,0.5*e,0.375*e,0.25*e,t]).filter((n)=>n>=t-hr)}getGridResolutions(e){return KUt([Math.max(0.1,Math.min(0.5,e/2)),Math.max(0.1,Math.min(0.25,e/3))])}resolveNominalTraceWidth(e){let t=this.findConnectionForTrace(e);return Math.max(t?.nominalTraceWidth??t?.width??this.inputProblem.nominalTraceWidth??this.inputProblem.minTraceWidth,this.inputProblem.minTraceWidth)}getDesiredPadClearance(e=this.nominalTraceWidth){let t=Math.max(this.inputProblem.defaultObstacleMargin??0,this.inputProblem.minTraceToPadEdgeClearance??0,0.1);return e<0.499999||this.phase!=="cleanup"?t:Math.max(t,this.options.powerTraceToPadClearance??e/2)}findConnectionForTrace(e){let t=this.connectionByTraceId.get(e.pcb_trace_id);if(t!==void 0)return t??void 0;let n=this.getTraceConnectionNames(e),o=this.inputProblem.connections.find((r)=>this.connectionMatchesTrace(r,n))??null;return this.connectionByTraceId.set(e.pcb_trace_id,o),o??void 0}getOwnedTraceIndices(){return[...this.selectedOwnedTraceIndices]}connectionMatchesTrace(e,t){return[e.name,e.source_trace_id,e.rootConnectionName,e.netConnectionName,...e.mergedConnectionNames??[]].filter((n)=>Boolean(n)).some((n)=>t.includes(n))}getTraceConnectionNames(e){return[e.connection_name,e.source_trace_id,e.rootConnectionName,...e.mergedConnectionNames??[]].filter((t)=>Boolean(t))}traceMeetsNominalWidth(e,t){return e.route.every((n)=>n.route_type!=="wire"||n.width>=t-hr)}findNextUnderWidthSegment(e,t,n){for(let o=t;o<e.route.length-1;o++){let r=e.route[o],i=e.route[o+1];if(Bs(r)&&Bs(i)&&r.layer===i.layer&&(r.width<n-hr||i.width<n-hr))return o}return-1}getMutatedImmutableTraceIds(e){return this.immutableTraceIndices.flatMap((t)=>{let n=e[t];return JSON.stringify(n)===this.initialImmutableTraceSignatures.get(t)?[]:[n?.pcb_trace_id??this.traces[t]?.pcb_trace_id??String(t)]})}getImmutableViaViolationSignatures(e){let t=new Set;if(this.immutableTraceIndices.length===0)return t;let n=new Tw(this.inputProblem,e),o=new yb(this.inputProblem,e,void 0,[],n);for(let r of this.immutableTraceIndices){let i=e[r];if(!i)continue;let s=[i.pcb_trace_id,i.connection_name,i.source_trace_id,i.rootConnectionName,...i.mergedConnectionNames??[],...i.connectsTo??[]].filter((a)=>Boolean(a));for(let a=0;a<i.route.length;a++){let c=i.route[a];if(c?.route_type!=="via")continue;let l=`${i.pcb_trace_id}:${a}`,h=o.getViaViolationSignatures({point:c,layers:o.boardLayers,padDiameter:c.via_diameter??this.inputProblem.min_via_pad_diameter??this.inputProblem.minViaPadDiameter??this.inputProblem.minViaDiameter??0.6,holeDiameter:c.via_hole_diameter??o.defaultViaHoleDiameter,connectionNames:s,ignoreTraceIndex:r,ignoreRouteRange:{start:a,end:a},blockSameNetObstacles:!0,sameNetObstacleClearance:0});for(let d of h)t.add(`${l}|${d}`)}}return t}countViolatingImmutableVias(e){return new Set([...e].map((t)=>t.split("|")[0])).size}acceptConnectivityCheckpoint(e,t){this.connectivityValidationCount++;let n=!1,o=!1;try{let r=this.connectivityInvariant.validate(e),i=this.getMutatedImmutableTraceIds(e),s=this.getImmutableViaViolationSignatures(e),a=[...s].filter((l)=>!this.lastSafeImmutableViaViolationSignatures.has(l)),c=a.length>0;if(n=!r.safe,o=i.length>0||c,this.connectivityValidationError??=r.validationError??null,!n&&!o)return this.traces=structuredClone(e),this.lastConnectivitySafeTraces=structuredClone(e),this.remainingImmutableViaViolationCount=this.countViolatingImmutableVias(s),this.remainingImmutableViaViolationPairCount=s.size,this.lastSafeImmutableViaViolationSignatures=s,this.connectivityInvariant=new Ibe(this.inputProblem,this.lastConnectivitySafeTraces),!0;this.immutableTraceMutationIds=[...new Set([...this.immutableTraceMutationIds,...i])],c&&(this.immutableViaViolationRollbackCount++,this.attemptedImmutableViaViolationCount=this.countViolatingImmutableVias(s),this.attemptedImmutableViaViolationPairCount=s.size,this.immutableViaViolationRegressionIds=[...new Set([...this.immutableViaViolationRegressionIds,...a])]),this.connectivityRegressionEndpointIds=[...new Set([...this.connectivityRegressionEndpointIds,...r.regressions.flatMap((l)=>l.baselineEndpointLabels)])]}catch(r){n=!0,this.connectivityValidationError=r instanceof Error?r.message:String(r)}return n&&(this.connectivityRollbackCount++,this.connectivityRollbackPhases.includes(t)||this.connectivityRollbackPhases.push(t)),o&&(this.immutableSafetyRollbackCount++,this.immutableSafetyRollbackPhases.includes(t)||this.immutableSafetyRollbackPhases.push(t)),t==="expansion"?n?this.rollbackConnectivityRegressedExpansion():this.rollbackImmutableUnsafeExpansion():this.restoreLastConnectivitySafeTraces(),this.remainingImmutableViaViolationCount=this.countViolatingImmutableVias(this.lastSafeImmutableViaViolationSignatures),this.remainingImmutableViaViolationPairCount=this.lastSafeImmutableViaViolationSignatures.size,!1}rebuildObstacleIndex(){this.obstacleIndex=new yb(this.inputProblem,this.traces,this.traceIndex,[],this.connectionNameResolver)}retainFailedSubSolver(e){this.failedSubSolverCount++,this.failedSubSolvers??=[],this.failedSubSolvers.length<16?this.failedSubSolvers.push(e):this.failedSubSolvers[15]=e}tryFinalAcceptance(){this.finalAcceptanceUsed=!0;let e=!1;this.activeSubSolver instanceof HXe?(this.activeSubSolver.tryFinalAcceptance(),this.adoptCleanupOutput(this.activeSubSolver),e=!0):this.activeSubSolver instanceof FXe&&(this.activeSubSolver.tryFinalAcceptance(),this.adoptClearanceRepairOutput(this.activeSubSolver),e=!0),e||this.phase==="cleanup"||this.phase==="repair-trace-clearance"||this.phase==="complete"||this.discardInFlightExpansion(),this.activeSubSolver=null,this.pendingLayerOutput=null,this.pendingLayerPushCount=0,this.activeInflationKey=null,this.activeInflationWidth=null,this.layerAttempt=null,this.acceptConnectivityCheckpoint(this.traces,"final"),this.traceIndex=this.traces.length,this.phase="complete",this.rebuildObstacleIndex(),this.progress=1,this.solved=!0,this.stats=this.createStats()}createStats(){return{phase:this.phase,pass:this.passIndex+1,completedPassCount:this.completedPassCount,lastNormalizedWidthDeficitGain:this.lastNormalizedWidthDeficitGain,normalizedWidthDeficitGainByPass:[...this.normalizedWidthDeficitGainByPass],plateauReached:this.plateauReached,traceIndex:this.traceIndex,traceCount:this.traces.length,selectedTraceCount:this.traceOrder.length,routeSegmentIndex:this.routeSegmentIndex,nominalTraceWidth:this.nominalTraceWidth,intervalCursor:this.intervalCursor,intervalCount:this.currentIntervals.length,candidateWidth:this.candidateWidths[this.widthCursor],gridSize:this.gridResolutions[this.resolutionCursor],gridOffsetVariant:this.offsetCursor,keptTraceCount:this.keptTraceCount,recreatedTraceCount:this.recreatedTraceCount,expandedSegmentCount:this.expandedSegmentCount,intermediateExpandedSegmentCount:this.intermediateExpandedSegmentCount,pathWidthUpgradeCount:this.pathWidthUpgradeCount,inPlaceWidthProbeCount:this.inPlaceWidthProbeCount,reroutedSegmentCount:this.reroutedSegmentCount,unresolvedSegmentCount:this.unresolvedSegmentCount,attemptedGridCount:this.attemptedGridCount,attemptedLayerGridCount:this.attemptedLayerGridCount,attemptedInflationCount:this.attemptedInflationCount,activeInflationWidth:this.activeInflationWidth,pushedTraceCount:this.pushedTraceCount,elasticPushedTraceCount:this.elasticPushedTraceCount,layerReroutedTraceCount:this.layerReroutedTraceCount,insertedViaCount:this.insertedViaCount,neckedLayerSegmentCount:this.neckedLayerSegmentCount,removedViaPairCount:this.removedViaPairCount,removedViaCount:this.removedViaCount,simplifiedPathCount:this.simplifiedPathCount,normalizedSegmentCount:this.normalizedSegmentCount,cleanupClearanceShoveCount:this.cleanupClearanceShoveCount,relocatedViaCount:this.relocatedViaCount,unresolvedViaCount:this.unresolvedViaCount,initialImmutableViaViolationCount:this.initialImmutableViaViolationCount,remainingImmutableViaViolationCount:this.remainingImmutableViaViolationCount,initialImmutableViaViolationPairCount:this.initialImmutableViaViolationPairCount,remainingImmutableViaViolationPairCount:this.remainingImmutableViaViolationPairCount,skippedImmutableViaRepairCount:this.remainingImmutableViaViolationCount,immutableViaViolationRollbackCount:this.immutableViaViolationRollbackCount,attemptedImmutableViaViolationCount:this.attemptedImmutableViaViolationCount,attemptedImmutableViaViolationPairCount:this.attemptedImmutableViaViolationPairCount,immutableViaViolationRegressionIds:[...this.immutableViaViolationRegressionIds],immutableTraceMutationIds:[...this.immutableTraceMutationIds],padClearanceRerouteCount:this.padClearanceRerouteCount,unresolvedPadClearanceCount:this.unresolvedPadClearanceCount,repairedTraceClearanceSegmentCount:this.repairedTraceClearanceSegmentCount,repairedPadNeckSegmentCount:this.repairedPadNeckSegmentCount,unresolvedTraceClearanceSegmentCount:this.unresolvedTraceClearanceSegmentCount,sameNetContactRejectionCount:this.sameNetContactRejectionCount,connectivityValidationCount:this.connectivityValidationCount,connectivityRollbackCount:this.connectivityRollbackCount,connectivityRollbackPhases:[...this.connectivityRollbackPhases],immutableSafetyRollbackCount:this.immutableSafetyRollbackCount,immutableSafetyRollbackPhases:[...this.immutableSafetyRollbackPhases],connectivityRegressionEndpointIds:[...this.connectivityRegressionEndpointIds],connectivityValidationError:this.connectivityValidationError,connectivityRollbackMutationStats:this.connectivityRollbackMutationStats===null?null:{...this.connectivityRollbackMutationStats},immutableSafetyRollbackMutationStats:this.immutableSafetyRollbackMutationStats===null?null:{...this.immutableSafetyRollbackMutationStats},expansionPushedTraceIndices:[...this.expansionPushedTraceIndices],cleanupMutatedTraceIndices:[...this.cleanupMutatedTraceIndices],discardedExpansionMutationStats:this.discardedExpansionMutationStats===null?null:{...this.discardedExpansionMutationStats},initialPadClearanceViolationCount:this.initialPadClearanceViolationCount,remainingPadClearanceViolationCount:this.remainingPadClearanceViolationCount,initialPadClearanceViolationCountByClearance:{...this.initialPadClearanceViolationCountByClearance},remainingPadClearanceViolationCountByClearance:{...this.remainingPadClearanceViolationCountByClearance},budgetLimitedExpansion:this.budgetLimitedExpansion,finalAcceptanceUsed:this.finalAcceptanceUsed,cleanupCompleted:this.cleanupCompleted,clearanceRepairCompleted:this.clearanceRepairCompleted,cleanupBestEffortAccepted:this.cleanupBestEffortAccepted,clearanceRepairBestEffortAccepted:this.clearanceRepairBestEffortAccepted,cleanupStatus:this.connectivityRollbackPhases.includes("cleanup")?"connectivity_rollback":this.immutableSafetyRollbackPhases.includes("cleanup")?"immutable_safety_rollback":this.cleanupBestEffortAccepted?"budget_limited":this.cleanupCompleted?"completed":this.phase==="cleanup"?"in_progress":"not_started",clearanceRepairStatus:this.connectivityRollbackPhases.includes("clearance-repair")?"connectivity_rollback":this.immutableSafetyRollbackPhases.includes("clearance-repair")?"immutable_safety_rollback":this.clearanceRepairBestEffortAccepted?"budget_limited":this.clearanceRepairCompleted?"completed":this.phase==="repair-trace-clearance"?"in_progress":"not_started",cleanupIterationBudget:this.cleanupIterationBudget,clearanceRepairIterationBudget:this.clearanceRepairIterationBudget,completionReason:this.phase==="complete"||this.solved?this.connectivityRollbackCount>0?"connectivity_rollback":this.immutableSafetyRollbackCount>0?"immutable_safety_rollback":this.connectivityValidationError?"connectivity_validation_unavailable":this.finalAcceptanceUsed?"total_iteration_budget":this.budgetLimitedExpansion?"expansion_budget":this.cleanupBestEffortAccepted?"cleanup_budget":this.clearanceRepairBestEffortAccepted?"clearance_repair_budget":this.remainingImmutableViaViolationCount>0?"immutable_via_violations_preserved":"completed":null,resultStatus:this.finalAcceptanceUsed||this.budgetLimitedExpansion||this.cleanupBestEffortAccepted||this.clearanceRepairBestEffortAccepted||this.connectivityRollbackCount>0||this.immutableSafetyRollbackCount>0||this.connectivityValidationError!==null||this.remainingImmutableViaViolationCount>0?"best_effort":"complete",failedSubSolverCount:this.failedSubSolverCount,retainedFailedSubSolverCount:this.failedSubSolvers?.length??0,expansionIterationBudget:this.getExpansionIterationBudget(),finalizationIterationReserve:this.getFinalizationIterationReserve(),spatialIndexRectCount:this.obstacleIndex.items.length}}computeProgress(){return this.solved||this.phase==="complete"?1:this.budgetLimitedExpansion?0.99:this.traceOrder.length===0?1:Math.min(0.99,(this.passIndex+Math.max(0,this.traceOrderCursor)/this.traceOrder.length)/this.maxPassCount)}getConstructorParams(){return[this.inputProblem,this.options]}getOutput(){return structuredClone(this.lastConnectivitySafeTraces)}visualize(){let e=[],t=[];for(let n=0;n<this.traces.length;n++){let o=this.traces[n],r=this.resolveNominalTraceWidth(o);for(let i of o.route)i.route_type==="via"&&t.push({center:i,radius:(i.via_diameter??0.6)/2,fill:"#d4a017",stroke:"#7a5700"});for(let i=0;i<o.route.length-1;i++){let s=o.route[i],a=o.route[i+1];if(!Bs(s)||!Bs(a)||s.layer!==a.layer)continue;let c=n===this.traceIndex&&i===this.routeSegmentIndex,l=s.width>=r-hr&&a.width>=r-hr,h=s.layer==="bottom";e.push({points:[s,a],strokeColor:c?"#ff8c00":l?h?"#2468c7":"#169c45":h?"#8b4bb8":"#cc3344",strokeWidth:Math.max(s.width,a.width)})}}return{coordinateSystem:"cartesian",title:`Power trace expander: ${this.phase}`,lines:e,points:[],circles:t,rects:this.obstacleIndex.items.filter((n)=>n.kind==="obstacle").slice(0,2000).map((n)=>({center:{x:(n.minX+n.maxX)/2,y:(n.minY+n.maxY)/2},width:n.maxX-n.minX,height:n.maxY-n.minY,fill:"rgba(80,80,80,0.12)",stroke:"rgba(80,80,80,0.35)"})),texts:[]}}},xln=class extends Kr{constructor(e,t={}){if(super(),this.inputSrj=e,this.options=t,this.powerTraceExpanderSolver=new IIr(e,t),t.onlyConnectionNames?.length===0)return this.MAX_ITERATIONS=1,this.progress=1,this.solved=!0,void(this.stats={selectedTraceCount:0,bypassed:!0});this.MAX_ITERATIONS=this.powerTraceExpanderSolver.MAX_ITERATIONS+1}inputSrj;options;powerTraceExpanderSolver;_step(){let e=this.powerTraceExpanderSolver;if(e.step(),this.progress=e.progress,this.stats=e.stats,e.failed)return this.error=e.error,void(this.failed=!0);e.solved&&(this.solved=!0)}getConstructorParams(){return[this.inputSrj,this.options]}getOutput(){if(!this.solved)throw Error("Cannot get power trace expansion output before solving");return this.powerTraceExpanderSolver.getOutput()}visualize(){return py({...this.inputSrj,traces:this.getOutput()},{traceColorMode:"layer"})}},AZe=({connections:e,originalConnections:t,layerCount:n,obstacles:o,defaultViaHoleDiameter:r,connMap:i})=>{let s=new Map;for(let d of t)s.has(d.name)||s.set(d.name,d.__netConnectionName);let a=e.map((d)=>{if(d.pointsToConnect.length!==2)throw Error(`Expected Pipeline7 output connection "${d.name}" to have two points, got ${d.pointsToConnect.length}`);let[u,_]=d.pointsToConnect;return{connection:d,connectsTo:[u?.pointId,_?.pointId].filter((p)=>Boolean(p)),outputConnectionName:d.__netConnectionName??s.get(d.name)??d.__rootConnectionNames?.[0]??d.name}}),c=o.filter((d)=>(d.__zLayers?.length??d.layers?.length??0)>1),l=new Map,h=(d)=>{let u=l.get(d.connectionName);u||(u=new Map,l.set(d.connectionName,u));let _=u.get(d.rootConnectionName);if(_)return _;let p=c.filter((m)=>Pw(m,d,i));return u.set(d.rootConnectionName,p),p};return(d)=>{let u=[],_=new Map;for(let p of d){let m=_.get(p.connectionName);m?m.push(p):_.set(p.connectionName,[p])}for(let{connection:p,connectsTo:m,outputConnectionName:A}of a){let g=_.get(p.name)??[];for(let f=0;f<g.length;f+=1){let y=g[f];u.push({type:"pcb_trace",pcb_trace_id:`${p.name}_${f}`,connection_name:A,connectsTo:m,route:V4(y,n,{connectionPoints:p.pointsToConnect,defaultViaHoleDiameter:r,connectedMultilayerObstacles:h(y),connMap:i})})}}return u}},o$e=({connections:e,originalConnections:t,hdRoutes:n,layerCount:o,obstacles:r,defaultViaHoleDiameter:i,connMap:s})=>AZe({connections:e,originalConnections:t,layerCount:o,obstacles:r,defaultViaHoleDiameter:i,connMap:s})(n),Cln=(e)=>{let t=Math.max(e.minTraceWidth+0.1,2*e.minTraceWidth);return e.connections.flatMap((n)=>(n.nominalTraceWidth??e.nominalTraceWidth??e.minTraceWidth)+0.000001>=t?[n.name]:[])},bln=({hdRoutes:e,connections:t})=>{let n=new Map(t.map((o)=>[o.name,o]));return e.map((o)=>{if(o.route.length===0)throw Error(`Cannot lock PCB terminals for empty route "${o.connectionName}"`);let r=n.get(o.connectionName);if(!r)throw Error(`Cannot lock PCB terminals: connection "${o.connectionName}" was not found`);if(r.pointsToConnect.length!==2)throw Error(`Cannot lock PCB terminals for "${o.connectionName}": expected 2 connection points, found ${r.pointsToConnect.length}`);let i=new Map;for(let h of r.pointsToConnect)if(h.pcb_port_id){if(i.has(h.pcb_port_id))throw Error(`Cannot lock duplicate PCB terminal "${h.pcb_port_id}" for "${o.connectionName}"`);i.set(h.pcb_port_id,h)}if(i.size===0)return o;let s=[o.startPcbPortId,o.endPcbPortId].filter((h)=>h!==void 0);if(s.length===0)return o;if(new Set(s).size!==s.length||s.some((h)=>!i.has(h)))throw Error(`Cannot lock PCB terminals for "${o.connectionName}": route endpoint IDs do not match connection terminal IDs`);let a=o.startPcbPortId?i.get(o.startPcbPortId):void 0,c=o.endPcbPortId?i.get(o.endPcbPortId):void 0,l=o.route.map((h,d)=>{if(d===0&&a)return{...h,x:a.x,y:a.y,pcb_port_id:a.pcb_port_id};if(d===o.route.length-1&&c)return{...h,x:c.x,y:c.y,pcb_port_id:c.pcb_port_id};let u={...h};return delete u.pcb_port_id,u});return{...o,route:l}})},Iln=({originalSrj:e,newlyRoutedTraces:t,currentPreloadedTraces:n,expandedConnectionNames:o,resolveConnectedTraceAliases:r=!1})=>{let i=n??e.traces??[],s=r?vIr({originalSrj:e,newlyRoutedTraces:t,preloadedTraces:i,expandedConnectionNames:o}):new Set(i.filter((h)=>o.includes(h.connection_name))),a=i.filter((h)=>!s.has(h)),c=new Set([...t.map((h)=>h.pcb_trace_id),...a.map((h)=>h.pcb_trace_id)]),l=i.filter((h)=>s.has(h)).map((h)=>{let d=h.pcb_trace_id,u=d,_=2;for(;c.has(u);)u=`${d}_power_expansion_${_++}`;return c.add(u),{...h,pcb_trace_id:u,__replaces_pcb_trace_id:h.__replaces_pcb_trace_id??h.pcb_trace_id}});return{...e,traces:[...t,...l],fixedTraces:a}},vIr=({originalSrj:e,newlyRoutedTraces:t,preloadedTraces:n,expandedConnectionNames:o})=>{let r=new Set(n.map((l)=>l.pcb_trace_id)),i=new Set([...r,...t.map((l)=>l.pcb_trace_id)]),s=t.map((l,h)=>{if(!r.has(l.pcb_trace_id))return l;let d=`__pipeline7_new_trace_${h}_${l.pcb_trace_id}`,u=d,_=2;for(;i.has(u);)u=`${d}_${_++}`;return i.add(u),{...l,pcb_trace_id:u}}),a=new Tw({...e,traces:[...s,...n]}),c=new Set(a.canonicalize([...o]));return new Set(n.filter((l)=>a.canonicalize([l.connection_name]).some((h)=>c.has(h))))};function $Ut(e){return new Set((e??[]).filter((t)=>t._isComponentTopologyNode).map((t)=>t.capacityMeshNodeId))}function vln(e,t){return e.nodeIds.some((n)=>t.has(n))}function SIr({sharedEdgeSegments:e,componentCapacityMeshNodeIds:t}){return e.filter((n)=>!vln(n,t))}function vp(e,t,n,o={}){return{solverName:e,solverClass:t,getConstructorParams:n,onSolved:o.onSolved}}var Sln=class extends Kr{constructor(e,t={}){super(),this.srj=e,this.opts=t;let n=pS(e);this.originalSrj=n,this.opts={...t};let o=this.opts;if(this.effort=o.effort??1,this.MAX_ITERATIONS=1e8*this.effort,this.maxNodeDimension=o.maxNodeDimension??16,this.maxNodeRatio=o.maxNodeRatio??6,this.minNodeArea=o.minNodeArea??0.010000000000000002,this.visualizationTraceColorMode=o.visualizationTraceColorMode??"layer",this.setSimpleRouteJson(n),o.capacityDepth===void 0){let r=this.srj.bounds.maxX-this.srj.bounds.minX,i=this.srj.bounds.maxY-this.srj.bounds.minY,s=Math.max(r,i),a=o.targetMinCapacity??0.5;o.capacityDepth=MQ(s,a)}this.cacheProvider=o.cacheProvider===void 0?_9():o.cacheProvider===null?null:o.cacheProvider,this.startTimeOfPhase={},this.endTimeOfPhase={},this.timeSpentOnPhase={}}srj;opts;getSolverName(){return"AutoroutingPipelineSolver7_MultiGraph"}preprocessSimpleRouteJsonSolver;escapeViaLocationSolver;netToPointPairsSolver;componentTopologyGeneratorSolver;topologyPlanningSolver;topologyMergingSolver;globalTopologyGeneratorSolver;nodeDimensionSubdivisionSolver;nodeTargetMerger;edgeSolver;colorMap;highDensityRouteSolver;highDensityForceImproveSolver;highDensityRepairSolver;highDensityStitchSolver;globalDrcForceImproveSolver;exactGeometryDrcForceImproveSolver;singleLayerNodeMerger;strawSolver;deadEndSolver;traceSimplificationSolver;lengthMatchingPostProcessingSolver;powerTraceExpansionSolver;availableSegmentPointSolver;portPointPathingSolver;multiSectionPortPointOptimizer;uniformPortDistributionSolver;traceWidthSolver;necessaryCrampedPortPointSolver;componentDetectionSolver;viaDiameter;viaHoleDiameter;minTraceWidth;effort;maxNodeDimension;maxNodeRatio;minNodeArea;visualizationTraceColorMode;startTimeOfPhase;endTimeOfPhase;timeSpentOnPhase;activeSubSolver=null;connMap;srjWithEscapeViaLocations;srjWithPointPairs;originalSrj;capacityNodes=null;capacityEdges=null;sharedEdgeSegmentsWithNecessaryCrampedPortPoints;highDensityNodePortPoints;cacheProvider=null;pipelineDef=[vp("preprocessSimpleRouteJsonSolver",C6e,(e)=>[e.originalSrj,{traceColorMode:e.visualizationTraceColorMode}],{onSolved:(e)=>{e.setSimpleRouteJson(e.preprocessSimpleRouteJsonSolver.getOutputSimpleRouteJson())}}),vp("componentDetectionSolver",lln,(e)=>[{inputSrj:e.srj}]),vp("escapeViaLocationSolver",f6e,(e)=>[e.srj,{viaDiameter:e.viaDiameter,minTraceWidth:e.minTraceWidth,obstacleMargin:e.srj.defaultObstacleMargin??0.15}],{onSolved:(e)=>{e.srjWithEscapeViaLocations=e.escapeViaLocationSolver?.getOutputSimpleRouteJson()}}),vp("netToPointPairsSolver",kq,(e)=>{let t=e.srjWithEscapeViaLocations??e.srj;return[t,e.colorMap,SQ(t)]},{onSolved:(e)=>{e.srjWithPointPairs=e.netToPointPairsSolver?.getNewSimpleRouteJson(),e.colorMap=yA(e.srjWithPointPairs,e.connMap),e.connMap=Ep(e.srjWithPointPairs)}}),vp("topologyPlanningSolver",pln,(e)=>[{inputSrj:e.srjWithPointPairs,componentDetectionOutput:e.componentDetectionSolver.getOutput(),viaDiameter:e.viaDiameter,obstacleMargin:e.srj.defaultObstacleMargin??0.15}],{onSolved:(e)=>{e.topologyPlanningSolver.getOutput(),e.globalTopologyGeneratorSolver=e.topologyPlanningSolver.globalTopologySolver,e.componentTopologyGeneratorSolver=new mln(e.topologyPlanningSolver)}}),vp("topologyMergingSolver",uln,(e)=>{let t=e.topologyPlanningSolver.getOutput();return[{layerCount:e.srj.layerCount,nodeGroups:[{groupId:"global",nodes:t.globalMeshNodes,isComponent:!1},...t.componentMeshNodes.map((n,o)=>({groupId:`component-${o}`,nodes:n,isComponent:!0}))]}]},{onSolved:(e)=>{e.capacityNodes=e.topologyMergingSolver.getOutput()}}),vp("nodeDimensionSubdivisionSolver",g6e,(e)=>[e.capacityNodes,e.maxNodeDimension,e.maxNodeRatio,e.minNodeArea],{onSolved:(e)=>{e.capacityNodes=e.nodeDimensionSubdivisionSolver.outputNodes}}),vp("edgeSolver",PQ,(e)=>[e.capacityNodes],{onSolved:(e)=>{e.capacityEdges=e.edgeSolver?.edges}}),vp("availableSegmentPointSolver",yV,(e)=>[{nodes:e.capacityNodes,edges:e.capacityEdges||[],traceWidth:e.minTraceWidth,colorMap:e.colorMap,shouldReturnCrampedPortPoints:!0}]),vp("necessaryCrampedPortPointSolver",Vle,(e)=>{let t=$Ut(e.capacityNodes);return[{capacityMeshNodes:e.capacityNodes.filter((n)=>!t.has(n.capacityMeshNodeId)),sharedEdgeSegments:SIr({sharedEdgeSegments:e.availableSegmentPointSolver.getOutput(),componentCapacityMeshNodeIds:t}),simpleRouteJson:e.srjWithPointPairs}]},{onSolved:(e)=>{let t=$Ut(e.capacityNodes);e.sharedEdgeSegmentsWithNecessaryCrampedPortPoints=function({originalSharedEdgeSegments:n,filteredSharedEdgeSegments:o,componentCapacityMeshNodeIds:r}){let i=new Map(o.map((s)=>[s.edgeId,s]));return n.map((s)=>vln(s,r)?s:i.get(s.edgeId)??s)}({originalSharedEdgeSegments:e.availableSegmentPointSolver.getOutput(),filteredSharedEdgeSegments:e.necessaryCrampedPortPointSolver.getOutput(),componentCapacityMeshNodeIds:t})}}),vp("portPointPathingSolver",A6e,(e)=>{let t=e.sharedEdgeSegmentsWithNecessaryCrampedPortPoints??e.necessaryCrampedPortPointSolver?.getOutput()??e.availableSegmentPointSolver.getOutput(),{graph:n,connections:o}=Yle({capacityMeshNodes:e.capacityNodes,layerCount:e.srj.layerCount,connectivityMap:e.connMap,segmentPortPoints:t.flatMap((r)=>r.portPoints),simpleRouteJsonConnections:e.srjWithPointPairs.connections});return[{graph:n,connections:o,layerCount:e.srj.layerCount,effort:Math.min(1,e.effort),preserveTerminalPcbPortIds:!0,minViaPadDiameter:e.viaDiameter,flags:{FORCE_CENTER_FIRST:!0,RIPPING_ENABLED:!0,USE_SELECTIVE_RERIP_ROUTING:!0},weights:{SHUFFLE_SEED:0,MEMORY_PF_FACTOR:4,CENTER_OFFSET_DIST_PENALTY_FACTOR:0,CENTER_OFFSET_FOCUS_SHIFT:0,NODE_PF_FACTOR:0,LAYER_CHANGE_COST:0,RIPPING_PF_COST:0,NODE_PF_MAX_PENALTY:100,BASE_CANDIDATE_COST:0.6,MAX_ITERATIONS_PER_PATH:0,RANDOM_WALK_DISTANCE:0,START_RIPPING_PF_THRESHOLD:0.3,END_RIPPING_PF_THRESHOLD:1,MAX_RIPS:1000,RANDOM_RIP_FRACTION:0.3,STRAIGHT_LINE_DEVIATION_PENALTY_FACTOR:4,GREEDY_MULTIPLIER:0.7,MIN_ALLOWED_BOARD_SCORE:-1e4}}]}),vp("uniformPortDistributionSolver",Sle,(e)=>[{nodeWithPortPoints:e.portPointPathingSolver?.getOutput().nodesWithPortPoints??[],inputNodesWithPortPoints:e.portPointPathingSolver?.getOutput().inputNodeWithPortPoints??[],minTraceWidth:e.minTraceWidth,obstacles:e.srj.obstacles,layerCount:e.srj.layerCount}]),vp("highDensityRouteSolver",PV,(e)=>{let t=e.uniformPortDistributionSolver?.getOutput()??[],n=e.portPointPathingSolver?.getOutput().nodesWithPortPoints??[],o=t.length>0?t:n;return e.highDensityNodePortPoints=structuredClone(o),[{nodePortPoints:o,nodePfById:new Map((e.portPointPathingSolver?.getOutput().inputNodeWithPortPoints??[]).map((r)=>[r.capacityMeshNodeId,e.portPointPathingSolver?.computeNodePf(r)??null])),colorMap:e.colorMap,connMap:e.connMap,viaDiameter:e.viaDiameter,traceWidth:e.minTraceWidth,obstacleMargin:e.srj.defaultObstacleMargin??0.15,obstacles:e.srj.obstacles,layerCount:e.srj.layerCount,useGrowShrinkHighDensityIntraNodeSolver:!0,preserveTerminalPcbPortIds:!0,growShrinkFallbackToInvalidGeometryOnFailure:!0,captureSearchDebug:!1}]}),vp("highDensityForceImproveSolver",Gle,(e)=>[{nodeWithPortPoints:e.highDensityNodePortPoints??[],hdRoutes:e.highDensityRouteSolver.routes,colorMap:e.colorMap,totalStepsPerNode:Math.max(12,Math.round(20*Math.min(1,e.effort))),nodeAssignmentMargin:e.srj.defaultObstacleMargin??0.2}]),vp("highDensityRepairSolver",Ule,(e)=>[{nodeWithPortPoints:e.highDensityNodePortPoints??[],hdRoutes:e.highDensityForceImproveSolver?.getOutput()??e.highDensityRouteSolver.routes,obstacles:e.srj.obstacles,colorMap:e.colorMap,repairMargin:e.srj.defaultObstacleMargin??0.2,minimumTraceWidth:e.srj.minTraceWidth,connMap:e.connMap}]),vp("highDensityStitchSolver",x6e,(e)=>[{connections:e.srjWithPointPairs.connections,hdRoutes:e.highDensityRepairSolver?.getOutput()??e.highDensityForceImproveSolver?.getOutput()??e.highDensityRouteSolver.routes,colorMap:e.colorMap,layerCount:e.srj.layerCount,defaultViaDiameter:e.viaDiameter,preserveTerminalPcbPortIds:!0}]),vp("traceSimplificationSolver",Ab,(e)=>[{hdRoutes:e.highDensityStitchSolver.mergedHdRoutes,obstacles:e.srj.obstacles,connMap:e.connMap,colorMap:e.colorMap,outline:e.srj.outline,defaultViaDiameter:e.viaDiameter,layerCount:e.srj.layerCount,minTraceToPadEdgeClearance:e.srj.minTraceToPadEdgeClearance,minBoardEdgeClearance:e.srj.minBoardEdgeClearance,enableCrossingViaReduction:!0,iterations:2}]),vp("traceWidthSolver",Lq,(e)=>[{hdRoutes:e.traceSimplificationSolver.simplifiedHdRoutes,obstacles:e.srj.obstacles,connMap:e.connMap,colorMap:e.colorMap,minTraceWidth:e.minTraceWidth,connection:e.srj.connections,obstacleMargin:e.srj.minTraceToPadEdgeClearance??0.15,layerCount:e.srj.layerCount}]),vp("globalDrcForceImproveSolver",Y7,(e)=>[{srj:e.srjWithPointPairs,hdRoutes:bln({hdRoutes:e.traceWidthSolver.getHdRoutesWithWidths(),connections:e.netToPointPairsSolver?.newConnections??[]}),connMap:e.connMap,effort:Math.min(1,e.effort),maxIterations:16,enableLargeBoardBroadFallback:!1,enablePostSolveClearanceRelaxation:!1}]),vp("exactGeometryDrcForceImproveSolver",msn,(e)=>{let t=e.globalDrcForceImproveSolver.getOutput(),n=((o)=>{let r={...o.srjWithPointPairs,obstacles:o.originalSrj.obstacles,minTraceWidth:o.originalSrj.minTraceWidth,minViaDiameter:o.originalSrj.minViaDiameter??o.srjWithPointPairs.minViaDiameter},i=Math.max(Pp(o.originalSrj).padDiameter,r.minTraceWidth)+Math.max(0.1,0.1),s=new Dle(r,{connMap:o.connMap,includeTraceViaOwnerMetadata:!0,traceClearance:0.1,viaClearance:0.1,spatialCellSize:i}),a=AZe(o),c=o.originalSrj.traces??[];return({routes:l,hdRoutes:h})=>{let d=l??h;if(!d)throw Error("Pipeline7 autorouting DRC evaluation requires HD routes");let u=a(d),_=c.length?[...c,...u]:u;return s.evaluate(_)}})({connections:e.netToPointPairsSolver?.newConnections??[],originalConnections:e.originalSrj.connections,layerCount:e.srj.layerCount,obstacles:e.srj.obstacles,defaultViaHoleDiameter:e.viaHoleDiameter,connMap:e.connMap,srjWithPointPairs:e.srjWithPointPairs,originalSrj:e.originalSrj});return[{srj:e.srjWithPointPairs,hdRoutes:t,connMap:e.connMap,effort:Math.min(1,e.effort),viaHoleDiameter:e.viaHoleDiameter,drcEvaluator:n,viaInPadDrcEvaluator:n,maxIterations:32,enableLargeBoardBroadFallback:!1,enableBroadFallback:!1,enableTargetedErrorSweep:!0,enablePostSolveClearanceRelaxation:!1,enableSafeTraceLayerMoves:!0,enableViaInPadLayerMoves:e.originalSrj.allowViaInPad??!1,viaInPadMaxIterations:32,broadMaxIterations:12,broadPassMultiplier:3}]}),vp("lengthMatchingPostProcessingSolver",eln,(e)=>{let t=e.netToPointPairsSolver;if(!t)throw Error("Pipeline7: length-matching post-processing requires NetToPointPairsSolver output");let n=t.newConnections,o=new Map;for(let s of e.srj.differentialPairs??[])for(let a of s.connectionNames){let c=n.filter((l)=>l.name===a||l.__rootConnectionNames?.includes(a)||l.__netConnectionName===a);if(c.length!==1)throw Error(`Pipeline7: differential pair connection "${a}" must resolve to exactly one final point-pair connection, got ${c.length}`);o.set(a,c[0].name)}let r=e.exactGeometryDrcForceImproveSolver.getOutput(),i=(e.srj.differentialPairs??[]).map((s)=>{let a=s.connectionNames.map((h)=>{let d=o.get(h);if(!d)throw Error(`Pipeline7: differential pair connection "${h}" is missing from final routed output`);return d});if(a[0]===a[1])throw Error(`Pipeline7: differential pair ${s.connectionNames.join("/")} resolves both members to "${a[0]}"`);if(s.traceGap===void 0)return{connectionNames:a,lengthTolerance:s.lengthTolerance,maxUncoupledLength:s.maxUncoupledLength};let c=a.map((h)=>{let d=r.filter((u)=>u.connectionName===h);if(d.length!==1)throw Error(`Pipeline7: differential pair connection "${h}" must resolve to exactly one final HD route, got ${d.length}`);return d[0]}),l=s.traceGap+c.reduce((h,d)=>h+d.traceThickness/2,0);return{connectionNames:a,lengthTolerance:s.lengthTolerance,maxUncoupledLength:s.maxUncoupledLength,minimumCenterlineDistance:l,maximumCenterlineDistance:l}});return[{hdRoutes:r,differentialPairs:i,obstacles:e.srj.obstacles,bounds:e.srj.bounds,layerCount:e.srj.layerCount}]}),vp("powerTraceExpansionSolver",xln,(e)=>{let t=e.opts.powerTraceExpansion??{},n=t.onlyConnectionNames??Cln(e.originalSrj);return[Iln({originalSrj:e.originalSrj,newlyRoutedTraces:e.getPrePowerTraceOutputSimplifiedPcbTraces(),expandedConnectionNames:n}),{allowNewVias:!1,...t,onlyConnectionNames:n}]})];setSimpleRouteJson(e){this.srj=e;let t=Pp(this.srj);this.viaDiameter=t.padDiameter,this.viaHoleDiameter=t.holeDiameter,this.minTraceWidth=this.srj.minTraceWidth,this.connMap=Ep(this.srj),this.colorMap=yA(this.srj,this.connMap)}getConstructorParams(){return[this.srj,this.opts]}currentPipelineStepIndex=0;computeProgress(){let e=this.activeSubSolver?.progress??0;return(this.currentPipelineStepIndex+e)/this.pipelineDef.length}_step(){let e=this.pipelineDef[this.currentPipelineStepIndex];if(!e)return void(this.solved=!0);if(this.activeSubSolver)return this.activeSubSolver.step(),void(this.activeSubSolver.solved?(this.endTimeOfPhase[e.solverName]=performance.now(),this.timeSpentOnPhase[e.solverName]=this.endTimeOfPhase[e.solverName]-this.startTimeOfPhase[e.solverName],e.onSolved?.(this),this.activeSubSolver=null,this.currentPipelineStepIndex++):this.activeSubSolver.failed&&(this.error=this.activeSubSolver?.error,this.failed=!0,this.activeSubSolver=null));let t=e.getConstructorParams(this);this.activeSubSolver=new e.solverClass(...t),this.activeSubSolver instanceof Ab&&(this.activeSubSolver.MAX_SIMPLIFICATION_PIPELINE_LOOPS=Math.ceil(this.activeSubSolver.MAX_SIMPLIFICATION_PIPELINE_LOOPS*Math.min(1,this.effort))),e.solverName!=="lengthMatchingPostProcessingSolver"&&e.solverName!=="powerTraceExpansionSolver"||(this.MAX_ITERATIONS=Math.max(this.MAX_ITERATIONS,this.iterations+this.activeSubSolver.MAX_ITERATIONS+1)),this[e.solverName]=this.activeSubSolver,this.timeSpentOnPhase[e.solverName]=0,this.startTimeOfPhase[e.solverName]=performance.now()}solveUntilPhase(e){for(;this.getCurrentPhase()!==e;)this.step()}getCurrentPhase(){return this.pipelineDef[this.currentPipelineStepIndex]?.solverName??"none"}visualize(){if(!this.solved&&this.activeSubSolver)return this.visualizeStage(this.activeSubSolver);let e=this.escapeViaLocationSolver?.visualize(),t=this.netToPointPairsSolver?.visualize(),n=this.componentDetectionSolver?.visualize(),o=this.componentTopologyGeneratorSolver?.visualize(),r=this.globalTopologyGeneratorSolver?.visualize(),i=this.topologyMergingSolver?.visualize(),s=this.nodeDimensionSubdivisionSolver?.visualize(),a=this.nodeTargetMerger?.visualize(),c=this.singleLayerNodeMerger?.visualize(),l=this.strawSolver?.visualize(),h=this.edgeSolver?.visualize(),d=this.deadEndSolver?.visualize(),u=this.availableSegmentPointSolver?.visualize(),_=this.portPointPathingSolver?.visualize(),p=this.multiSectionPortPointOptimizer?.visualize(),m=this.uniformPortDistributionSolver?.visualize(),A=this.highDensityRouteSolver?.visualize(),g=this.highDensityForceImproveSolver?.visualize(),f=this.highDensityRepairSolver?.visualize(),y=this.highDensityStitchSolver?.visualize(),x=this.traceSimplificationSolver?.visualize(),C=this.lengthMatchingPostProcessingSolver?.visualize(),b=this.traceWidthSolver?.visualize(),I=this.necessaryCrampedPortPointSolver?.visualize(),v=(this.highDensityRouteSolver?.visualize(),this.originalSrj),P=v.outline,M=[];if(M.push({points:[{x:v.bounds?.minX??-50,y:v.bounds?.minY??-50},{x:v.bounds?.maxX??50,y:v.bounds?.minY??-50},{x:v.bounds?.maxX??50,y:v.bounds?.maxY??50},{x:v.bounds?.minX??-50,y:v.bounds?.maxY??50},{x:v.bounds?.minX??-50,y:v.bounds?.minY??-50}],strokeColor:"rgba(255,0,0,0.25)"}),P&&P.length>=2){let Y=P.map((X)=>({x:X.x,y:X.y}));Y.push({...Y[0]}),M.push({points:Y,strokeColor:"rgba(0, 136, 255, 0.95)"})}let B=Nw(v),T={points:[...v.connections.flatMap((Y)=>Y.pointsToConnect.map((X)=>({...X,layer:Rw(X,v.layerCount),label:`${Y.name} ${X.pcb_port_id??""}`})))],rects:[...(v.obstacles??[]).filter((Y)=>!Y.isCopperPour).map((Y)=>({...Y,fill:Y.layers?.includes("top")?"rgba(255,0,0,0.25)":Y.layers?.includes("bottom")?"rgba(0,0,255,0.25)":"rgba(255,0,0,0.25)",layer:sS(Y,v.layerCount),label:B(Y)}))],lines:M},N={traceColorMode:this.visualizationTraceColorMode},D=Bw({srj:v,visualizationOptions:N}),L=sl(T,D),H=this.preprocessSimpleRouteJsonSolver?.visualize(),V=this.globalDrcForceImproveSolver?.visualize(),O=this.exactGeometryDrcForceImproveSolver?.visualize(),U=[L,H,n,o,e,t,r,i,s,a,c,l,h,d,u,I,_,p,m,A?sl(T,A):null,g,f,y,x,b,V,O,C,this.solved?sl({lines:M},Bw({srj:this.originalSrj,visualizationOptions:N}),this.visualizeFinalOutput()):null].filter(Boolean),j=sl(...U);return this.visualizationTraceColorMode==="net"?fbe(j,this.colorMap):j}visualizeStage(e){let t=e.visualize();return this.visualizationTraceColorMode==="net"?fbe(t,this.colorMap):t}visualizeFinalOutput(){let e=this.visualizationTraceColorMode,t=this.getOutputSimpleRouteJson();return py(t,{traceColorMode:e})}preview(){if(this.highDensityRouteSolver){let e=[];for(let t=this.highDensityRouteSolver.routes.length-1;t>=0;t--){let n=this.highDensityRouteSolver.routes[t];if(e.push({points:n.route.map((o)=>({x:o.x,y:o.y})),strokeColor:this.colorMap[n.connectionName]}),e.length>200)break}return{lines:e}}return this.portPointPathingSolver?this.portPointPathingSolver.preview():this.netToPointPairsSolver?this.netToPointPairsSolver.visualize():this.escapeViaLocationSolver?this.escapeViaLocationSolver.visualize():this.componentTopologyGeneratorSolver?this.componentTopologyGeneratorSolver.visualize():this.componentDetectionSolver?this.componentDetectionSolver.visualize():this.preprocessSimpleRouteJsonSolver?this.preprocessSimpleRouteJsonSolver.visualize():{}}_getOutputHdRoutes(){if(this.lengthMatchingPostProcessingSolver){let{hdRoutes:e}=this.lengthMatchingPostProcessingSolver.getOutput();return e}return this.exactGeometryDrcForceImproveSolver?.getOutput()??this.globalDrcForceImproveSolver?.getOutput()??this.traceWidthSolver?.getHdRoutesWithWidths()??this.traceSimplificationSolver?.simplifiedHdRoutes??this.highDensityStitchSolver.mergedHdRoutes}getOutputSimplifiedPcbTraces(){if(!this.solved||!this.highDensityRouteSolver)throw Error("Cannot get output before solving is complete");return this.powerTraceExpansionSolver?this.powerTraceExpansionSolver.getOutput():this.getPrePowerTraceOutputSimplifiedPcbTraces()}getPrePowerTraceOutputSimplifiedPcbTraces(){return o$e({connections:this.netToPointPairsSolver?.newConnections??[],originalConnections:this.originalSrj.connections,hdRoutes:this._getOutputHdRoutes(),layerCount:this.srj.layerCount,obstacles:this.srj.obstacles,defaultViaHoleDiameter:this.viaHoleDiameter,connMap:this.connMap})}getOutputSimpleRouteJson(){return{...this.originalSrj,traces:this.getOutputSimplifiedPcbTraces()}}},qUt=(e)=>[...new Set(e)].sort((t,n)=>t-n),PIr=class extends Kr{constructor(e){super(),this.params=e,this.MAX_ITERATIONS=1}params;outputNodes=[];outputSharedEdgeSegments=[];nodeIdByOriginalAndZ=new Map;getSolverName(){return"SplitNodesIntoSingleLayerNodeSolver"}_step(){this.outputNodes=this.params.capacityMeshNodes.flatMap((e)=>qUt(e.availableZ).map((t)=>{let n=((o,r)=>`${o}__z${r}`)(e.capacityMeshNodeId,t);return this.nodeIdByOriginalAndZ.set(`${e.capacityMeshNodeId}:${t}`,n),{...e,capacityMeshNodeId:n,layer:`z${t}`,availableZ:[t],_parent:e}})),this.outputSharedEdgeSegments=this.params.sharedEdgeSegments.flatMap((e)=>this.splitSharedEdgeSegment(e)),this.stats={inputNodeCount:this.params.capacityMeshNodes.length,outputNodeCount:this.outputNodes.length,inputPortPointCount:this.params.sharedEdgeSegments.reduce((e,t)=>e+t.portPoints.length,0),outputPortPointCount:this.outputSharedEdgeSegments.reduce((e,t)=>e+t.portPoints.length,0)},this.solved=!0}getSplitNodeId(e,t){return this.nodeIdByOriginalAndZ.get(`${e}:${t}`)}splitPortPoint(e){return qUt(e.availableZ).flatMap((t)=>{let n=e.nodeIds.map((o)=>this.getSplitNodeId(o,t));return n[0]&&n[1]?[{...e,segmentPortPointId:`${e.segmentPortPointId}__z${t}`,availableZ:[t],nodeIds:[n[0],n[1]]}]:[]})}splitSharedEdgeSegment(e){let t=new Map;for(let n of e.portPoints.flatMap((o)=>this.splitPortPoint(o))){let o=n.availableZ[0];if(o===void 0)continue;let r=t.get(o)??[];r.push(n),t.set(o,r)}return[...t.entries()].map(([n,o])=>({...e,edgeId:`${e.edgeId}__z${n}`,nodeIds:o[0].nodeIds,availableZ:[n],portPoints:o}))}getOutput(){return{capacityMeshNodes:this.outputNodes,sharedEdgeSegments:this.outputSharedEdgeSegments}}getConstructorParams(){return[this.params]}visualize(){return{rects:this.outputNodes.map((e)=>({...fA(e),label:`${e.capacityMeshNodeId}
${e.layer}`})),points:this.outputSharedEdgeSegments.flatMap((e)=>e.portPoints.map((t)=>({x:t.x,y:t.y,label:`${t.segmentPortPointId}
z${t.availableZ.join(",")}`})))}}};function _A(e,t,n,o={}){return{solverName:e,solverClass:t,getConstructorParams:n,onSolved:o.onSolved}}var Pln=class extends Kr{constructor(e,t={}){super(),this.srj=e,this.opts=t,this.originalSrj=e,this.opts={...t};let n=this.opts;if(this.effort=n.effort??1,this.MAX_ITERATIONS=1e8*this.effort,this.maxNodeDimension=n.maxNodeDimension??16,this.maxNodeRatio=n.maxNodeRatio??6,this.minNodeArea=n.minNodeArea??0.010000000000000002,this.setSimpleRouteJson(e),n.capacityDepth===void 0){let o=this.srj.bounds.maxX-this.srj.bounds.minX,r=this.srj.bounds.maxY-this.srj.bounds.minY,i=Math.max(o,r),s=n.targetMinCapacity??0.5;n.capacityDepth=MQ(i,s)}this.cacheProvider=n.cacheProvider===void 0?_9():n.cacheProvider===null?null:n.cacheProvider,this.startTimeOfPhase={},this.endTimeOfPhase={},this.timeSpentOnPhase={}}srj;opts;preprocessSimpleRouteJsonSolver;escapeViaLocationSolver;netToPointPairsSolver;nodeSolver;nodeDimensionSubdivisionSolver;nodeTargetMerger;edgeSolver;colorMap;highDensityRouteSolver;highDensityForceImproveSolver;highDensityForceImproveRoutes;highDensityRepairSolver;highDensityRepairRoutes;highDensityStitchSolver;globalDrcForceImproveSolver;singleLayerNodeMerger;strawSolver;deadEndSolver;traceSimplificationSolver;availableSegmentPointSolver;splitNodesIntoSingleLayerNodeSolver;portPointPathingSolver;multiSectionPortPointOptimizer;uniformPortDistributionSolver;traceWidthSolver;necessaryCrampedPortPointSolver;viaDiameter;viaHoleDiameter;minTraceWidth;effort;maxNodeDimension;maxNodeRatio;minNodeArea;startTimeOfPhase;endTimeOfPhase;timeSpentOnPhase;activeSubSolver=null;connMap;srjWithEscapeViaLocations;srjWithPointPairs;originalSrj;capacityNodes=null;capacityEdges=null;highDensityNodePortPoints;cacheProvider=null;pipelineDef=[_A("preprocessSimpleRouteJsonSolver",C6e,(e)=>[e.originalSrj],{onSolved:(e)=>{e.setSimpleRouteJson(e.preprocessSimpleRouteJsonSolver.getOutputSimpleRouteJson())}}),_A("escapeViaLocationSolver",f6e,(e)=>[e.srj,{viaDiameter:e.viaDiameter,minTraceWidth:e.minTraceWidth,obstacleMargin:e.srj.defaultObstacleMargin??0.15}],{onSolved:(e)=>{e.srjWithEscapeViaLocations=e.escapeViaLocationSolver?.getOutputSimpleRouteJson()}}),_A("netToPointPairsSolver",kq,(e)=>{let t=e.srjWithEscapeViaLocations??e.srj;return[t,e.colorMap,SQ(t)]},{onSolved:(e)=>{e.srjWithPointPairs=e.netToPointPairsSolver?.getNewSimpleRouteJson(),e.colorMap=yA(e.srjWithPointPairs,e.connMap),e.connMap=Ep(e.srjWithPointPairs)}}),_A("nodeSolver",wq,(e)=>[{simpleRouteJson:e.srjWithPointPairs,maxGapFillPasses:4}],{onSolved:(e)=>{e.capacityNodes=e.nodeSolver?.getOutput().meshNodes??[]}}),_A("nodeDimensionSubdivisionSolver",g6e,(e)=>[e.capacityNodes,e.maxNodeDimension,e.maxNodeRatio,e.minNodeArea],{onSolved:(e)=>{e.capacityNodes=e.nodeDimensionSubdivisionSolver?.outputNodes??[]}}),_A("edgeSolver",PQ,(e)=>[e.capacityNodes],{onSolved:(e)=>{e.capacityEdges=e.edgeSolver?.edges}}),_A("availableSegmentPointSolver",yV,(e)=>[{nodes:e.capacityNodes,edges:e.capacityEdges||[],traceWidth:e.minTraceWidth,colorMap:e.colorMap,shouldReturnCrampedPortPoints:!0}]),_A("necessaryCrampedPortPointSolver",Vle,(e)=>[{capacityMeshNodes:e.capacityNodes,sharedEdgeSegments:e.availableSegmentPointSolver.getOutput(),simpleRouteJson:e.srjWithPointPairs}]),_A("splitNodesIntoSingleLayerNodeSolver",PIr,(e)=>[{capacityMeshNodes:e.capacityNodes,sharedEdgeSegments:e.necessaryCrampedPortPointSolver?.getOutput()??e.availableSegmentPointSolver.getOutput()}],{onSolved:(e)=>{e.capacityNodes=e.splitNodesIntoSingleLayerNodeSolver.getOutput().capacityMeshNodes}}),_A("portPointPathingSolver",A6e,(e)=>{let t=e.splitNodesIntoSingleLayerNodeSolver.getOutput(),{graph:n,connections:o}=Yle({capacityMeshNodes:t.capacityMeshNodes,layerCount:e.srj.layerCount,connectivityMap:e.connMap,segmentPortPoints:t.sharedEdgeSegments.flatMap((r)=>r.portPoints),simpleRouteJsonConnections:e.srjWithPointPairs.connections,assignableViaObstacles:e.originalSrj.obstacles});return[{graph:n,connections:o,layerCount:e.srj.layerCount,effort:Math.min(1,e.effort),minViaPadDiameter:e.viaDiameter,flags:{FORCE_CENTER_FIRST:!0,RIPPING_ENABLED:!0},weights:{SHUFFLE_SEED:0,MEMORY_PF_FACTOR:4,CENTER_OFFSET_DIST_PENALTY_FACTOR:0,CENTER_OFFSET_FOCUS_SHIFT:0,NODE_PF_FACTOR:0,LAYER_CHANGE_COST:0,RIPPING_PF_COST:0,NODE_PF_MAX_PENALTY:100,BASE_CANDIDATE_COST:0.6,MAX_ITERATIONS_PER_PATH:0,RANDOM_WALK_DISTANCE:0,START_RIPPING_PF_THRESHOLD:0.3,END_RIPPING_PF_THRESHOLD:1,MAX_RIPS:1000,RANDOM_RIP_FRACTION:0.3,STRAIGHT_LINE_DEVIATION_PENALTY_FACTOR:4,GREEDY_MULTIPLIER:0.7,MIN_ALLOWED_BOARD_SCORE:-1e4}}]}),_A("uniformPortDistributionSolver",Sle,(e)=>[{nodeWithPortPoints:e.portPointPathingSolver?.getOutput().nodesWithPortPoints??[],inputNodesWithPortPoints:e.portPointPathingSolver?.getOutput().inputNodeWithPortPoints??[],minTraceWidth:e.minTraceWidth,obstacles:e.srj.obstacles,layerCount:e.srj.layerCount}]),_A("highDensityRouteSolver",PV,(e)=>{let t=e.uniformPortDistributionSolver?.getOutput()??[],n=e.portPointPathingSolver?.getOutput().nodesWithPortPoints??[],o=t.length>0?t:n;return e.highDensityNodePortPoints=structuredClone(o),[{nodePortPoints:o,nodePfById:new Map((e.portPointPathingSolver?.getOutput().inputNodeWithPortPoints??[]).map((r)=>[r.capacityMeshNodeId,e.portPointPathingSolver?.computeNodePf(r)??null])),colorMap:e.colorMap,connMap:e.connMap,viaDiameter:e.viaDiameter,traceWidth:e.minTraceWidth,obstacleMargin:e.srj.defaultObstacleMargin??0.15,obstacles:e.srj.obstacles,layerCount:e.srj.layerCount}]}),_A("highDensityForceImproveSolver",Gle,(e)=>[{nodeWithPortPoints:e.getHighDensityNodePortPointsWithAssignableViasFirst(),hdRoutes:e.getMovableHighDensityRoutes(e.highDensityRouteSolver.routes),colorMap:e.colorMap,totalStepsPerNode:Math.max(20,Math.round(60*Math.min(1,e.effort))),nodeAssignmentMargin:e.srj.defaultObstacleMargin??0.2}],{onSolved:(e)=>{e.highDensityForceImproveRoutes=e.mergeMovableHighDensityRoutesBack(e.highDensityRouteSolver.routes,e.highDensityForceImproveSolver.getOutput())}}),_A("highDensityRepairSolver",Ule,(e)=>[{nodeWithPortPoints:e.getHighDensityNodePortPointsWithAssignableViasFirst(),hdRoutes:e.getMovableHighDensityRoutes(e.highDensityForceImproveRoutes??e.highDensityForceImproveSolver?.getOutput()??e.highDensityRouteSolver.routes),obstacles:e.srj.obstacles,colorMap:e.colorMap,repairMargin:e.srj.defaultObstacleMargin??0.2,minimumTraceWidth:e.srj.minTraceWidth,connMap:e.connMap}],{onSolved:(e)=>{let t=e.highDensityForceImproveRoutes??e.highDensityForceImproveSolver?.getOutput()??e.highDensityRouteSolver.routes;e.highDensityRepairRoutes=e.mergeMovableHighDensityRoutesBack(t,e.highDensityRepairSolver.getOutput())}}),_A("highDensityStitchSolver",x6e,(e)=>[{connections:e.srjWithPointPairs.connections,hdRoutes:e.highDensityRepairRoutes??e.highDensityRepairSolver?.getOutput()??e.highDensityForceImproveRoutes??e.highDensityForceImproveSolver?.getOutput()??e.highDensityRouteSolver.routes,colorMap:e.colorMap,layerCount:e.srj.layerCount,defaultViaDiameter:e.viaDiameter,allowedLayerTransitionPointKeys:IYt(e.originalSrj.obstacles)}]),_A("traceSimplificationSolver",Ab,(e)=>[{hdRoutes:e.highDensityStitchSolver.mergedHdRoutes,obstacles:e.srj.obstacles,connMap:e.connMap,colorMap:e.colorMap,outline:e.srj.outline,defaultViaDiameter:e.viaDiameter,layerCount:e.srj.layerCount,minTraceToPadEdgeClearance:e.srj.minTraceToPadEdgeClearance,iterations:2}]),_A("traceWidthSolver",Lq,(e)=>[{hdRoutes:e.traceSimplificationSolver.simplifiedHdRoutes,obstacles:e.srj.obstacles,connMap:e.connMap,colorMap:e.colorMap,minTraceWidth:e.minTraceWidth,connection:e.srj.connections,obstacleMargin:e.srj.minTraceToPadEdgeClearance??0.15,layerCount:e.srj.layerCount}]),_A("globalDrcForceImproveSolver",Y7,(e)=>[{srj:e.srjWithPointPairs,hdRoutes:e.traceWidthSolver.getHdRoutesWithWidths(),effort:Math.min(1,e.effort)}])];setSimpleRouteJson(e){this.srj=e;let t=Pp(this.srj);this.viaDiameter=t.padDiameter,this.viaHoleDiameter=t.holeDiameter,this.minTraceWidth=this.srj.minTraceWidth,this.connMap=Ep(this.srj),this.colorMap=yA(this.srj,this.connMap)}getConstructorParams(){return[this.srj,this.opts]}currentPipelineStepIndex=0;_step(){let e=this.pipelineDef[this.currentPipelineStepIndex];if(!e)return void(this.solved=!0);if(this.activeSubSolver)return this.activeSubSolver.step(),void(this.activeSubSolver.solved?(this.endTimeOfPhase[e.solverName]=performance.now(),this.timeSpentOnPhase[e.solverName]=this.endTimeOfPhase[e.solverName]-this.startTimeOfPhase[e.solverName],e.onSolved?.(this),this.activeSubSolver=null,this.currentPipelineStepIndex++):this.activeSubSolver.failed&&(this.error=this.activeSubSolver?.error,this.failed=!0,this.activeSubSolver=null));let t=e.getConstructorParams(this);this.activeSubSolver=new e.solverClass(...t),this[e.solverName]=this.activeSubSolver,this.timeSpentOnPhase[e.solverName]=0,this.startTimeOfPhase[e.solverName]=performance.now()}solveUntilPhase(e){for(;this.getCurrentPhase()!==e;)this.step()}getCurrentPhase(){return this.pipelineDef[this.currentPipelineStepIndex]?.solverName??"none"}visualize(){if(!this.solved&&this.activeSubSolver)return this.activeSubSolver.visualize();let e=this.escapeViaLocationSolver?.visualize(),t=this.netToPointPairsSolver?.visualize(),n=this.nodeSolver?.visualize(),o=this.nodeDimensionSubdivisionSolver?.visualize(),r=this.nodeTargetMerger?.visualize(),i=this.singleLayerNodeMerger?.visualize(),s=this.strawSolver?.visualize(),a=this.edgeSolver?.visualize(),c=this.deadEndSolver?.visualize(),l=this.availableSegmentPointSolver?.visualize(),h=this.splitNodesIntoSingleLayerNodeSolver?.visualize(),d=this.portPointPathingSolver?.visualize(),u=this.multiSectionPortPointOptimizer?.visualize(),_=this.uniformPortDistributionSolver?.visualize(),p=this.highDensityRouteSolver?.visualize(),m=this.highDensityForceImproveSolver?.visualize(),A=this.highDensityRepairSolver?.visualize(),g=this.highDensityStitchSolver?.visualize(),f=this.traceSimplificationSolver?.visualize(),y=this.necessaryCrampedPortPointSolver?.visualize(),x=(this.highDensityRouteSolver?.visualize(),this.originalSrj),C=x.outline,b=[];if(b.push({points:[{x:x.bounds?.minX??-50,y:x.bounds?.minY??-50},{x:x.bounds?.maxX??50,y:x.bounds?.minY??-50},{x:x.bounds?.maxX??50,y:x.bounds?.maxY??50},{x:x.bounds?.minX??-50,y:x.bounds?.maxY??50},{x:x.bounds?.minX??-50,y:x.bounds?.minY??-50}],strokeColor:"rgba(255,0,0,0.25)"}),C&&C.length>=2){let B=C.map((T)=>({x:T.x,y:T.y}));B.push({...B[0]}),b.push({points:B,strokeColor:"rgba(0, 136, 255, 0.95)"})}let I=Nw(x),v={points:[...x.connections.flatMap((B)=>B.pointsToConnect.map((T)=>({...T,layer:Rw(T,x.layerCount),label:`${B.name} ${T.pcb_port_id??""}`})))],rects:[...(x.obstacles??[]).filter((B)=>!B.isCopperPour).map((B)=>({...B,fill:B.layers?.includes("top")?"rgba(255,0,0,0.25)":B.layers?.includes("bottom")?"rgba(0,0,255,0.25)":"rgba(255,0,0,0.25)",layer:sS(B,x.layerCount),label:I(B)}))],lines:b},P=Bw({srj:x}),M=[sl(v,P),e,t,n,o,r,i,s,a,c,l,y,h,d,u,_,p?sl(v,p):null,m,A,g,f,this.solved?sl({lines:b},Bw({srj:this.originalSrj}),py(this.getOutputSimpleRouteJson())):null].filter(Boolean);return sl(...M)}preview(){if(this.highDensityRouteSolver){let e=[];for(let t=this.highDensityRouteSolver.routes.length-1;t>=0;t--){let n=this.highDensityRouteSolver.routes[t];if(e.push({points:n.route.map((o)=>({x:o.x,y:o.y})),strokeColor:this.colorMap[n.connectionName]}),e.length>200)break}return{lines:e}}return this.portPointPathingSolver?this.portPointPathingSolver.preview():this.netToPointPairsSolver?this.netToPointPairsSolver.visualize():this.escapeViaLocationSolver?this.escapeViaLocationSolver.visualize():this.preprocessSimpleRouteJsonSolver?this.preprocessSimpleRouteJsonSolver.visualize():{}}_getOutputHdRoutes(){let e=this.globalDrcForceImproveSolver?.getOutput();return e&&this.routesOnlyUsePreplacedVias(e)?e:this.traceWidthSolver?.getHdRoutesWithWidths()??this.traceSimplificationSolver?.simplifiedHdRoutes??this.highDensityRepairRoutes??this.highDensityForceImproveRoutes??this.highDensityStitchSolver.mergedHdRoutes}routesOnlyUsePreplacedVias(e){let t=IYt(this.originalSrj.obstacles);return t.size===0||e.every((n)=>n.vias.every((o)=>t.has(C$(o))))}getHighDensityNodePortPointsWithAssignableViasFirst(){return[...this.highDensityNodePortPoints??[]].sort((e,t)=>{let n=e.capacityMeshNodeId.startsWith("assignable-via:");return n===t.capacityMeshNodeId.startsWith("assignable-via:")?0:n?-1:1})}getPreplacedAssignableViaObstacles(){return this.originalSrj.obstacles.filter((e)=>e.netIsAssignable===!0&&(e.layers?.length??0)>1)}isFixedPreplacedViaRoute(e){let t=this.getPreplacedAssignableViaObstacles();return t.length!==0&&e.vias.length!==0&&t.some((n)=>[...e.route,...e.vias].every((o)=>_S(o,n)<=0))}getMovableHighDensityRouteIndexes(e){return e.map((t,n)=>this.isFixedPreplacedViaRoute(t)?-1:n).filter((t)=>t!==-1)}getMovableHighDensityRoutes(e){return this.getMovableHighDensityRouteIndexes(e).map((t)=>e[t])}mergeMovableHighDensityRoutesBack(e,t){let n=this.getMovableHighDensityRouteIndexes(e),o=[...e];for(let r=0;r<n.length;r++)o[n[r]]=t[r];return o}getOutputSimplifiedPcbTraces(){if(!this.solved||!this.highDensityRouteSolver)throw Error("Cannot get output before solving is complete");let e=[],t=this._getOutputHdRoutes();for(let n of this.netToPointPairsSolver?.newConnections??[]){let o=n.__netConnectionName??this.originalSrj.connections.find((i)=>i.name===n.name)?.__netConnectionName,r=t.filter((i)=>i.connectionName===n.name);for(let i=0;i<r.length;i++){let s=r[i],a={type:"pcb_trace",pcb_trace_id:`${n.name}_${i}`,connection_name:o??n.__rootConnectionNames?.[0]??n.name,route:V4(s,this.srj.layerCount,{connectionPoints:n.pointsToConnect,defaultViaHoleDiameter:this.viaHoleDiameter,obstacles:this.srj.obstacles,connMap:this.connMap})};e.push(a)}}return e}getOutputSimpleRouteJson(){return{...this.originalSrj,traces:this.getOutputSimplifiedPcbTraces()}}},EIr=class extends Kr{bestRoutes;bestCost;completedPasses=0;cleanupPasses;simplifier;viaRemovalSolver;params;constructor(e){super(),this.params=e,this.bestRoutes=structuredClone([...e.config.hdRoutes]),this.bestCost=e.getCost(this.bestRoutes),this.cleanupPasses=e.effort<=1?e.viaRemovalPasses??1:Math.ceil(2*e.effort),this.MAX_ITERATIONS=1e8*Math.max(1,this.cleanupPasses),e.effort<=1?this.viaRemovalSolver=this.createViaRemovalSolver():(this.simplifier=new Ab({...e.config,enableRoutedTraceDetours:!0,hdRoutes:structuredClone(this.bestRoutes)}),this.simplifier.simplificationPipelineLoops=2,this.simplifier.MAX_SIMPLIFICATION_PIPELINE_LOOPS=2+this.cleanupPasses,this.simplifier.MAX_ITERATIONS=this.MAX_ITERATIONS)}createViaRemovalSolver(){let e=this.params.config,t=new Nsn({unsimplifiedHdRoutes:structuredClone(this.bestRoutes),otherHdRoutes:e.otherHdRoutes,obstacles:[...e.obstacles],colorMap:e.colorMap,layerCount:e.layerCount,connMap:e.connMap,outline:e.outline?[...e.outline]:void 0,geometryShortcutTraceMargin:0.1,geometryShortcutObstacleMargin:e.minTraceToPadEdgeClearance??0.15,enableGeometryShortcuts:!0,enableRoutedTraceDetours:!0,enableObstacleDetourShortcuts:e.enableCrossingViaReduction,preserveRouteEndpoints:e.preserveRouteEndpoints,terminalLayerIndicesByPcbPortId:e.terminalLayerIndicesByPcbPortId});return t.MAX_ITERATIONS=this.MAX_ITERATIONS,t}_step(){if(this.viaRemovalSolver){let r=this.viaRemovalSolver;if(r.step(),r.failed)return this.failed=!0,void(this.error=r.error);if(!r.solved)return;let i=r.getOptimizedHdRoutes();if(!i)throw Error("Via removal has no output");let s=this.params.getCost(i),a=s.vias<this.bestCost.vias&&this.params.isValid(i);return a&&(this.bestRoutes=structuredClone(i),this.bestCost=s),this.completedPasses++,a&&this.completedPasses<this.cleanupPasses?void(this.viaRemovalSolver=this.createViaRemovalSolver()):void(this.solved=!0)}let e=this.simplifier;if(!e)throw Error("Cleanup has no active simplifier");let{currentPhase:t,simplificationPipelineLoops:n}=e;if(e.step(),e.failed)return this.failed=!0,void(this.error=e.error);let o=e.simplificationPipelineLoops-2;if(this.completedPasses=o,e.currentPhase!==t||e.simplificationPipelineLoops!==n){let r=e.simplifiedHdRoutes,i=this.params.getCost(r);(i.vias<this.bestCost.vias||i.vias===this.bestCost.vias&&i.points<this.bestCost.points)&&this.params.isValid(r)&&(this.bestRoutes=structuredClone(r),this.bestCost=i)}this.solved=e.solved}getOutput(){if(!this.solved)throw Error("Cleanup is not complete");return this.bestRoutes}},_Q={traceClearance:0.1,viaClearance:0.1},r$e=(e,t)=>{let n=new Set(t.flatMap((o)=>o.__replaces_pcb_trace_id?[o.__replaces_pcb_trace_id]:[]));return[...e.filter((o)=>!n.has(o.pcb_trace_id)),...t]},gCe=({inputSrj:e,srjWithPointPairs:t,routedTraces:n,drcOptions:o,includeBoardClearance:r=!1,connectivityMaps:i})=>{let s=e.traces??[],a=OJe(t,r$e(s,n),{minTraceWidth:e.minTraceWidth,minViaDiameter:e.minViaDiameter,originalSrj:e,includeOriginalConnections:!0,connectivityMaps:i});return r&&a.push(fsn({...e,minBoardEdgeClearance:e.minBoardEdgeClearance??0})),{circuitJson:a,...Ann(a,{..._Q,holeClearance:e.minTraceToHoleEdgeClearance,...o})}},JUt=(e,t)=>{let n=e.filter((o)=>(o.rootConnectionName??o.connectionName)===t);if(n.length!==0)return n.reduce((o,r)=>o+r.route.slice(1).reduce((i,s,a)=>{let c=r.route[a];return i+Math.hypot(s.x-c.x,s.y-c.y)},0),0)},MIr=(e,t)=>{let n=new Set(e.flatMap((o)=>o.maxLengthSkew===void 0?[]:o.connectionNames));return t.flatMap((o)=>{if(!n.has(o.name))return[];let r=o.pointsToConnect[0],i=o.pointsToConnect.at(-1);if(!r||!i||r===i)throw Error(`Length matching: bus connection "${o.name}" needs at least two points`);return[{...o,pointsToConnect:[r,i]}]})},wIr=class extends Kr{constructor(e){super(),this.params=e,this.differentialPairSolver=new eln({hdRoutes:e.hdRoutes,differentialPairs:e.differentialPairs,traces:e.traces,obstacles:e.obstacles,bounds:e.bounds,layerCount:e.layerCount,minTraceToPadEdgeClearance:e.obstacleMargin}),this.MAX_ITERATIONS=this.differentialPairSolver.MAX_ITERATIONS+1e5+10}params;differentialPairSolver;busLengthMatchingSolver;outputHdRoutes;getSolverName(){return"LengthMatchingPostProcessingSolver"}_step(){if(!this.differentialPairSolver.solved)return this.differentialPairSolver.step(),void(this.differentialPairSolver.failed&&(this.failed=!0,this.error=this.differentialPairSolver.error));if(!this.busLengthMatchingSolver){let n=this.differentialPairSolver.getOutput().hdRoutes,o=(e=this.params.buses,t=n,e.flatMap((r)=>{let i=r.maxLengthSkew;if(i===void 0||r.connectionNames.length<2)return[];let s=r.connectionNames.map((c)=>{let l=JUt(t,c);if(l===void 0)throw Error(`Length matching: bus "${r.busId}" has no routed geometry for connection "${c}"`);return{connectionName:c,length:l}}),a=s.reduce((c,l)=>l.length>c.length?l:c);return s.flatMap((c)=>c.connectionName===a.connectionName?[]:[{connectionNames:[c.connectionName,a.connectionName],lengthTolerance:i}])}));return o.length===0?(this.outputHdRoutes=n,void(this.solved=!0)):void(this.busLengthMatchingSolver=new jcn({hdRoutes:n,originalConnections:MIr(this.params.buses,this.params.connections),differentialPairs:o,traces:this.params.traces,obstacles:this.params.obstacles,bounds:this.params.bounds,layerCount:this.params.layerCount,obstacleMargin:this.params.obstacleMargin}))}var e,t;if(this.busLengthMatchingSolver.step(),this.busLengthMatchingSolver.failed)return this.failed=!0,void(this.error=this.busLengthMatchingSolver.error);this.busLengthMatchingSolver.solved&&(this.outputHdRoutes=this.busLengthMatchingSolver.getOutput().matchedHdRoutes,((n,o)=>{for(let r of n){if(r.maxLengthSkew===void 0||r.connectionNames.length<2)continue;let i=r.connectionNames.map((a)=>{let c=JUt(o,a);if(c===void 0)throw Error(`Length matching: bus "${r.busId}" lost routed geometry for connection "${a}"`);return c}),s=Math.max(...i)-Math.min(...i);if(s>r.maxLengthSkew+0.000001)throw Error(`Length matching: bus "${r.busId}" routed length skew ${s.toFixed(4)}mm exceeds ${r.maxLengthSkew.toFixed(4)}mm`)}})(this.params.buses,this.outputHdRoutes),this.solved=!0)}getOutput(){if(!this.solved||!this.outputHdRoutes)throw Error("LengthMatchingPostProcessingSolver output requested before completion");return{hdRoutes:this.outputHdRoutes}}visualize(){return this.busLengthMatchingSolver?.visualize()??this.differentialPairSolver.visualize()}},Pq=0.000000001,ZUt=(e,t)=>Math.abs(e.x-t.x)<=Pq&&Math.abs(e.y-t.y)<=Pq&&e.z===t.z,BIr=(e,t)=>{if(e.length===0)return void e.push(...t.route);let n=e.at(-1);if(t.route[0]&&ZUt(n,t.route[0]))e.push(...t.route.slice(1));else{if(!t.route.at(-1)||!ZUt(n,t.route.at(-1)))throw Error(`Pipeline9 could not reconnect mutated preloaded segment "${t.connectionName}"`);e.push(...t.route.slice(0,-1).reverse())}},i$e=(e,t)=>{let n=e.preloadedRoutePositionStart??e.preloadedRouteIndex,o=t.preloadedRoutePositionStart??t.preloadedRouteIndex,r=e.preloadedRoutePositionEnd??n,i=t.preloadedRoutePositionEnd??o;return n-o||r-i||e.preloadedRouteIndex-t.preloadedRouteIndex||e.connectionName.localeCompare(t.connectionName)},TIr=(e)=>{let t=e.route.flatMap((n)=>n.route_type==="wire"||n.route_type==="through_obstacle"?[n.width]:[]);return t.length>0?Math.max(...t):void 0},Eln=({trace:e,updatedTraceRoutes:t,layerCount:n,defaultViaHoleDiameter:o,obstacles:r,connMap:i})=>{if(t.length===0)throw Error(`Pipeline9 lost every fixed route for mutated trace "${e.pcb_trace_id}"`);let s=[],a,c=0,l=0;for(let d of[...t].sort(i$e))BIr(s,d),c=Math.max(c,d.traceThickness),l=Math.max(l,d.viaDiameter),a??=d.rootConnectionName;let h={connectionName:e.connection_name,rootConnectionName:a,traceThickness:TIr(e)??c,viaDiameter:l,route:s,vias:s.slice(0,-1).flatMap((d,u)=>{let _=s[u+1];return d.z!==_.z&&Math.abs(d.x-_.x)<=Pq&&Math.abs(d.y-_.y)<=Pq?[{x:_.x,y:_.y}]:[]})};return V4(h,n,{defaultViaHoleDiameter:o,obstacles:r,connMap:i})},zXe=(e,t)=>e.filter((n)=>{if(n.isThroughObstacle===!0)return!1;let{preloadedRoutePositionStart:o,preloadedRoutePositionEnd:r}=n;if(o===void 0||r===void 0)throw Error(`Pipeline9 fixed route "${n.connectionName}" is missing route-position metadata`);let i=Math.min(o,r),s=Math.max(o,r);return i>=t.routePositionStart-Pq&&s<=t.routePositionEnd+Pq}),DIr=({trace:e,originalTraceRoutes:t,updatedTraceRoutes:n,layerCount:o,defaultViaHoleDiameter:r,obstacles:i,connMap:s})=>{if(n.length===0)throw Error(`Pipeline9 lost every fixed route for mutated trace "${e.pcb_trace_id}"`);let a=((d)=>{let u=[],_=0;for(let p=0;p<d.route.length;p++)d.route[p]?.route_type==="through_obstacle"&&(_<p&&u.push({routePositionStart:_,routePositionEnd:p-1}),_=p+1);return _<d.route.length&&u.push({routePositionStart:_,routePositionEnd:d.route.length-1}),u})(e),c=n.filter((d)=>d.isThroughObstacle!==!0);for(let d of c)if(a.filter((u)=>zXe([d],u).includes(d)).length!==1)throw Error(`Pipeline9 fixed route "${d.connectionName}" crosses an immutable through-obstacle primitive`);let l=[],h=0;for(let d of a){l.push(...e.route.slice(h,d.routePositionStart));let u=zXe(t,d),_=zXe(n,d);if(u.length>0&&_.length===0)throw Error(`Pipeline9 lost every fixed route for an ordinary section of mutated trace "${e.pcb_trace_id}"`);l.push(..._.length>0?Eln({trace:e,updatedTraceRoutes:_,layerCount:o,defaultViaHoleDiameter:r,obstacles:i,connMap:s}):e.route.slice(d.routePositionStart,d.routePositionEnd+1)),h=d.routePositionEnd+1}return l.push(...e.route.slice(h)),l},s$e=(e,t)=>{let n=new Set(t.map((o)=>o.pcb_trace_id));return e.map((o)=>{if(!n.has(o.pcb_trace_id))return n.add(o.pcb_trace_id),o;let r=`${o.pcb_trace_id}_routed`,i=r,s=2;for(;n.has(i);)i=`${r}_${s}`,s+=1;return n.add(i),{...o,pcb_trace_id:i}})},eWt=(e,t,n)=>{let o=(s)=>`${s.x}:${s.y}`,r=new Map;for(let s of t){let a=o(s.center),c=r.get(a)??[];c.push(s),r.set(a,c)}let i=new Map;for(let s of e)for(let a of s.pointsToConnect){if(!a.pcb_port_id)continue;let c=i.get(a.pcb_port_id)??new Set,l=zx(a);for(let h of l)c.add(ti(h,n));for(let h of r.get(o(a))??[])if(!(h.layers.length<=1)&&h.connectedTo.includes(a.pcb_port_id))for(let d of h.layers)c.add(ti(d,n));i.set(a.pcb_port_id,c)}return i},vbe=(e,t)=>new Map(e.flatMap((n)=>{let o=t.getNetConnectedToId(n.connectionName)??(n.rootConnectionName?t.getNetConnectedToId(n.rootConnectionName)??(t.netMap[n.rootConnectionName]?n.rootConnectionName:void 0):void 0);return o?[[n.connectionName,o]]:[]})),gO=0.000000001,a$e=0.000001,tWt=(e,t)=>Math.abs(e.x-t.x)<=a$e&&Math.abs(e.y-t.y)<=a$e&&e.z===t.z,Mln=(e)=>new Map(e.map((t,n)=>[t.pcb_trace_id,n])),nWt=(e,t)=>{let n=e[0],o=e.at(-1);if(!n||!o)throw Error("Pipeline9 cannot split an empty preloaded route");if(n.z!==o.z)throw Error("Pipeline9 cannot partially split a preloaded layer transition");return{...n,x:n.x+(o.x-n.x)*t,y:n.y+(o.y-n.y)*t}},oWt=({traces:e,fixedHdRoutes:t,sections:n})=>{let o=(({traces:r,sections:i})=>{let s=Mln(r),a=new Map;for(let c of i){let l=s.get(c.traceId);if(l===void 0)throw Error(`Pipeline9 hypergraph changed missing preloaded trace "${c.traceId}"`);let h=a.get(l)??[];h.push({start:Math.min(c.startRoutePosition,c.endRoutePosition),end:Math.max(c.startRoutePosition,c.endRoutePosition)}),a.set(l,h)}for(let c of a.values())c.sort((l,h)=>l.start-h.start||l.end-h.end);return a})({traces:e,sections:n});return t.flatMap((r)=>{let i=o.get(r.preloadedTraceIndex);if(!i?.length)return[r];let{preloadedRoutePositionStart:s,preloadedRoutePositionEnd:a}=r;if(s===void 0||a===void 0)throw Error(`Pipeline9 fixed route "${r.connectionName}" is missing route-position metadata`);if(Math.abs(a-s)<=gO)return i.some((l)=>l.start-gO<=s&&s<=l.end+gO)?[]:[r];let c=[{start:s,end:a}];for(let l of i)c=c.flatMap((h)=>{if(l.end<=h.start+gO||l.start>=h.end-gO)return[h];let d=[];return l.start>h.start+gO&&d.push({start:h.start,end:Math.min(l.start,h.end)}),l.end<h.end-gO&&d.push({start:Math.max(l.end,h.start),end:h.end}),d});return c.map((l,h)=>{let d=(l.start-s)/(a-s),u=(l.end-s)/(a-s);return{...r,connectionName:`${r.connectionName}_hypergraph_fixed_${h}`,preloadedRoutePositionStart:l.start,preloadedRoutePositionEnd:l.end,route:[nWt(r.route,d),nWt(r.route,u)],vias:[]}})})},NIr=({traces:e,sections:t,stitchedHdRoutes:n,layerCount:o})=>{let r=Mln(e);return t.map((i,s)=>{let a=r.get(i.traceId);if(a===void 0)throw Error(`Pipeline9 cannot materialize missing preloaded trace "${i.traceId}"`);let[c,l]=((p,m)=>{let A=p.connection.pointsToConnect.map((g)=>({x:g.x,y:g.y,z:ti(Ef(g),m)}));if(!A[0]||!A[1])throw Error(`Pipeline9 changed section "${p.connectionName}" is missing an endpoint`);return[A[0],A[1]]})(i,o),h=n.flatMap((p)=>{if(p.connectionName!==i.connectionName)return[];let m=(({route:A,sectionStart:g,sectionEnd:f})=>{let y=A.route[0],x=A.route.at(-1);if(!y||!x)return null;let C=y.z===g.z&&x.z===f.z,b=y.z===f.z&&x.z===g.z,I=C?Dn(y,g)+Dn(x,f):Number.POSITIVE_INFINITY,v=b?Dn(y,f)+Dn(x,g):Number.POSITIVE_INFINITY;return Number.isFinite(I)||Number.isFinite(v)?I<=v?{score:I,reverse:!1}:{score:v,reverse:!0}:null})({route:p,sectionStart:c,sectionEnd:l});return m?[{route:p,...m}]:[]});h.sort((p,m)=>p.score-m.score);let d=h[0],u=h[1];if(!d||u&&Math.abs(u.score-d.score)<=a$e)throw Error(`Pipeline9 expected one nearest stitched route for changed preloaded section "${i.connectionName}", got ${h.length}`);return{...(({route:p,reverse:m,sectionStart:A,sectionEnd:g})=>{let f=m?((y)=>{let x=[...y].reverse().map((C)=>{let{toNextSegmentType:b,...I}=C;return I});for(let C=0;C<y.length-1;C++){let b=y[C]?.toNextSegmentType;b&&(x[y.length-C-2]={...x[y.length-C-2],toNextSegmentType:b})}return x})(p.route):[...p.route];if(!f[0]||!f.at(-1))throw Error(`Pipeline9 cannot materialize empty route "${p.connectionName}"`);return tWt(f[0],A)||f.unshift(A),tWt(f.at(-1),g)||f.push(g),{...p,route:f}})({route:d.route,reverse:d.reverse,sectionStart:c,sectionEnd:l}),preloadedTraceIndex:a,preloadedRouteIndex:Number.MAX_SAFE_INTEGER-t.length+s,preloadedRoutePositionStart:i.startRoutePosition,preloadedRoutePositionEnd:i.endRoutePosition,isThroughObstacle:!1}})},qK=0.000001,wln=({hdRoute:e,start:t,end:n})=>{if(Math.abs(t.x-n.x)<=qK&&Math.abs(t.y-n.y)<=qK)return"colocated";let o=e.vias.some((i)=>Math.abs(i.x-t.x)<=qK&&Math.abs(i.y-t.y)<=qK),r=e.vias.some((i)=>Math.abs(i.x-n.x)<=qK&&Math.abs(i.y-n.y)<=qK);if(!o&&!r)throw Error(`Pipeline9 route "${e.connectionName}" changes layers from z=${t.z} to z=${n.z} without an explicit via`);if(o===r)throw Error(`Pipeline9 route "${e.connectionName}" has an ambiguous layer transition between (${t.x}, ${t.y}) and (${n.x}, ${n.y})`);return o?"start":"end"},fZe=(e)=>e.map((t)=>{let n=[];for(let o of t.route){let r=n.at(-1);if(!r||r.z===o.z||r.toNextSegmentType==="through_obstacle"){n.push(o);continue}let i=wln({hdRoute:t,start:r,end:o});i!=="colocated"?(i==="start"?n.push({x:r.x,y:r.y,z:o.z}):n.push({x:o.x,y:o.y,z:r.z}),n.push(o)):n.push(o)}return{...t,route:n}}),w$=(e)=>fZe(e).map((t)=>({...t,route:t.route.flatMap((n,o)=>{let r=t.route[o-1];return!r||r.z===n.z||r.toNextSegmentType==="through_obstacle"||r.x===n.x&&r.y===n.y?[n]:[{x:n.x,y:n.y,z:r.z},n]})})),RIr=(e)=>{let t=new Map;for(let n of e)n.regionId&&t.set(n.regionId,(t.get(n.regionId)??0)+n.route.length);return e.map((n)=>{if(!n.regionId||t.get(n.regionId)<4096)return n;let o=[],r=[];for(let[s,a]of n.route.entries()){for(;o.length>=2;){let c=o[o.length-2],l=o[o.length-1];if(c.z!==l.z||l.z!==a.z||c.toNextSegmentType||c.traceThickness!==void 0||Object.keys(l).some((m)=>m!=="x"&&m!=="y"&&m!=="z")||n.vias.some((m)=>Math.hypot(m.x-l.x,m.y-l.y)<0.000000001))break;let h=l.x-c.x,d=l.y-c.y,u=a.x-l.x,_=a.y-l.y,p=Math.hypot(a.x-c.x,a.y-c.y);if(p===0||h*u+d*_<0||Math.abs(h*_-d*u)>0.000000001*p)break;o.pop(),r.pop()}o.push(a),r.push(s)}let i=[];for(let s=0;s<o.length;s++){let a=o[s];if(o[s-1]){let c=r[s-1],l=r[s];l-c<64&&i.push(...n.route.slice(c+1,l))}i.push(a)}return{...n,route:i}})},dy=0.000000001,Bln=(e)=>({minX:e.center.x-e.width/2,maxX:e.center.x+e.width/2,minY:e.center.y-e.height/2,maxY:e.center.y+e.height/2}),rWt=(e,t)=>e.x>=t.minX-dy&&e.x<=t.maxX+dy&&e.y>=t.minY-dy&&e.y<=t.maxY+dy,iWt=(e,t,n)=>n<=dy?e:n>=0.999999999?t:{x:e.x+(t.x-e.x)*n,y:e.y+(t.y-e.y)*n,z:e.z},QIr=(e,t,n)=>{let o=t.x-e.x,r=t.y-e.y;if(Math.abs(o)<=dy&&Math.abs(r)<=dy)return rWt(e,n)&&rWt(t,n)?{start:e,end:t}:null;let i=0,s=1,a=[[-o,e.x-n.minX],[o,n.maxX-e.x],[-r,e.y-n.minY],[r,n.maxY-e.y]];for(let[c,l]of a){if(Math.abs(c)<=dy){if(l<0)return null;continue}let h=l/c;if(c<0?i=Math.max(i,h):s=Math.min(s,h),i>s+dy)return null}return{start:iWt(e,t,i),end:iWt(e,t,s)}},kIr=(e)=>{let t=e.sourceRoutes[0],n=`pipeline9_fallback:${t.connectionName}`,o=`${n}:start`,r=`${n}:end`;return[{...e.start.point,portPointId:o,nextPortPointId:r,connectionName:t.connectionName,rootConnectionName:t.rootConnectionName},{...e.end.point,portPointId:r,prevPortPointId:o,connectionName:t.connectionName,rootConnectionName:t.rootConnectionName}]},Bce=(e,t)=>Math.abs(e.x-t.x)<=dy&&Math.abs(e.y-t.y)<=dy&&e.z===t.z,LIr=(e,t)=>e.sourceRoute.preloadedTraceIndex===t.sourceRoute.preloadedTraceIndex&&Bce(e.sourceRoute.route.at(-1),t.sourceRoute.route[0]),Cle=(e,t,n=new Set)=>{let o=new Map,r=[],i=new Set(e.portPoints.map((d)=>d.z)),s=t.map((d)=>((u,_)=>{let p=Bln(_),m,A;for(let g=0;g<u.route.length-1;g++){let f=QIr(u.route[g],u.route[g+1],p);f&&(m??={segmentIndex:g,point:f.start},A={segmentIndex:g,point:f.end})}return m&&A?{sourceRoute:u,start:m,end:A}:null})(d,e)).filter((d)=>d!==null),a=s.filter((d)=>d.sourceRoute.isThroughObstacle!==!0&&(((u,_)=>_.size===0||[u.start.point,...u.sourceRoute.route.slice(u.start.segmentIndex+1,u.end.segmentIndex+1),u.end.point].some((p)=>_.has(p.z)))(d,i)||n.has(d.sourceRoute.connectionName))).sort((d,u)=>d.sourceRoute.preloadedTraceIndex-u.sourceRoute.preloadedTraceIndex||d.sourceRoute.preloadedRouteIndex-u.sourceRoute.preloadedRouteIndex),c=new Set(a.map((d)=>d.sourceRoute)),l=s.map((d)=>d.sourceRoute).filter((d)=>!c.has(d)),h=[];for(let d=0;d<a.length;d++){let u=a[d],_=a[d-1],p=h.at(-1);_&&p&&LIr(_,u)?(p.sourceRoutes.push(u.sourceRoute),p.end=u.end):h.push({sourceRoutes:[u.sourceRoute],start:u.start,end:u.end})}for(let d of h){if(Bce(d.start.point,d.end.point))continue;let u=d.sourceRoutes[0].connectionName;if(o.has(u))throw Error(`Pipeline9 regional fallback found duplicate fixed route section identity "${u}"`);o.set(u,d),r.push(kIr(d))}return{nodeWithPortPoints:{...e,portPoints:[...e.portPoints,...r.flatMap((d)=>d)],portPointsInPairs:[...e.portPointsInPairs??[],...r]},fixedRouteSectionsByConnectionName:o,fixedObstacleRoutes:l}},HIr=(e)=>{let t=[];for(let n=0;n<e.length-1;n++){let o=e[n],r=e[n+1];o.z!==r.z&&Math.abs(o.x-r.x)<=dy&&Math.abs(o.y-r.y)<=dy&&t.push({x:r.x,y:r.y})}return t},yZe=(e,t)=>Tln({section:e,replacement:t,sourceMutationMasks:new Map,replacementIsMutated:!1}).route,Tln=({section:e,replacement:t,sourceMutationMasks:n,replacementIsMutated:o})=>{let r=e.sourceRoutes[0],i=e.sourceRoutes.at(-1),s=((_,p)=>{let m=_.route,A=m[0],g=m.at(-1);if(!A||!g)throw Error(`Pipeline9 regional fallback produced an empty replacement for "${p.sourceRoutes[0].connectionName}"`);let f=Math.hypot(A.x-p.start.point.x,A.y-p.start.point.y)+Math.hypot(g.x-p.end.point.x,g.y-p.end.point.y);return Math.hypot(g.x-p.start.point.x,g.y-p.start.point.y)+Math.hypot(A.x-p.end.point.x,A.y-p.end.point.y)<f?[...m].reverse():m})(t,e),a=[],c=[],l=(_,p)=>{let m=n.get(_.connectionName);if(m&&m.length!==_.route.length-1)throw Error(`Pipeline9 fixed route mutation mask for "${_.connectionName}" has ${m.length} segments, expected ${_.route.length-1}`);return m?.[p]??!1},h=(_,p)=>{let m=a.at(-1);if(m){if(!Bce(m,_)){if(m.z!==_.z&&(Math.abs(m.x-_.x)>dy||Math.abs(m.y-_.y)>dy)){let A={..._,z:m.z};Bce(m,A)||(a.push(A),c.push(p))}Bce(a.at(-1),_)||(a.push(_),c.push(p))}}else a.push(_)};h(r.route[0],!1);for(let _=1;_<=e.start.segmentIndex;_++)h(r.route[_],l(r,_-1));h(e.start.point,l(r,e.start.segmentIndex));let d=c.length;for(let _ of s.slice(1,-1))h(_,o);h(e.end.point,o);let u=c.length>d;for(let _=e.end.segmentIndex+1;_<i.route.length;_++)h(i.route[_],l(i,_-1));if(c.length!==a.length-1)throw Error(`Pipeline9 produced an invalid mutation mask while splicing "${r.connectionName}"`);return{route:{...r,preloadedRoutePositionStart:r.preloadedRoutePositionStart,preloadedRoutePositionEnd:i.preloadedRoutePositionEnd,traceThickness:Math.max(...e.sourceRoutes.map((_)=>_.traceThickness)),viaDiameter:Math.max(...e.sourceRoutes.map((_)=>_.viaDiameter)),route:a,vias:HIr(a)},mutatedSegments:c,replacementProducedSegment:u}},Sbe=0.000001,Pbe=(e,t)=>Math.abs(e.x-t.x)<=Sbe&&Math.abs(e.y-t.y)<=Sbe&&e.z===t.z,sWt=(e,t)=>{for(let n of t)e.at(-1)&&Pbe(e.at(-1),n)||e.push(n)},Dln=(e)=>e.slice(0,-1).flatMap((t,n)=>{let o=e[n+1];return t.z!==o.z&&Math.abs(t.x-o.x)<=Sbe&&Math.abs(t.y-o.y)<=Sbe?[{x:o.x,y:o.y}]:[]}),aWt=(e)=>{let{preloadedRoutePositionStart:t,preloadedRoutePositionEnd:n}=e;if(t===void 0||n===void 0)throw Error(`Pipeline9 fixed route "${e.connectionName}" is missing route-position metadata`);return{start:Math.min(t,n),end:Math.max(t,n)}},Nln=(e,t)=>{let n=aWt(e),o=aWt(t);return e.preloadedTraceIndex-t.preloadedTraceIndex||n.start-o.start||n.end-o.end||e.preloadedRouteIndex-t.preloadedRouteIndex||e.connectionName.localeCompare(t.connectionName)},Rln=(e,t)=>{let n=e.route.at(-1),o=t.route[0];return Boolean(n&&o&&e.preloadedTraceIndex===t.preloadedTraceIndex&&Pbe(n,o))},cWt=(e,t)=>{let n=e.preloadedRoutePositionStart??e.preloadedRouteIndex;return n+((e.preloadedRoutePositionEnd??e.preloadedRouteIndex)-n)*t/(e.route.length-1)},lWt=(e,t)=>e.route[t].z!==e.route[t+1].z,FIr=({updatedFixedRoutes:e,regionalMutationMasks:t})=>{let n=[],o=(({updatedFixedRoutes:r,regionalMutationMasks:i})=>{let s=new Map;for(let h of r){if(h.route.length===0)throw Error(`Pipeline9 cannot normalize empty fixed route "${h.connectionName}"`);let d=h.route.length-1;if(s.has(h.connectionName))throw Error(`Pipeline9 cannot normalize duplicate fixed route "${h.connectionName}"`);let u=i.get(h.connectionName);if(u&&u.length!==d)throw Error(`Pipeline9 fixed route mutation mask for "${h.connectionName}" has ${u.length} segments, expected ${d}`);let _=h.isThroughObstacle!==!0&&(h.jumpers?.length??0)===0;s.set(h.connectionName,Array.from({length:d},(p,m)=>_&&(u?.[m]??!1)))}let a=[],c=()=>{for(;a[0]&&lWt(a[0].route,a[0].segmentIndex);){let h=a.shift();s.get(h.route.connectionName)[h.segmentIndex]=!1}for(;a.at(-1)&&lWt(a.at(-1).route,a.at(-1).segmentIndex);){let h=a.pop();s.get(h.route.connectionName)[h.segmentIndex]=!1}a=[]},l;for(let h of[...r].sort(Nln)){l&&!Rln(l,h)&&c();let d=s.get(h.connectionName);if(d.length!==0){for(let u=0;u<d.length;u++)d[u]?a.push({route:h,segmentIndex:u}):c();l=h}else c(),l=h}return c(),s})({updatedFixedRoutes:e,regionalMutationMasks:t});for(let r of e){let i=r.route.length-1,s=o.get(r.connectionName);if(i===0){n.push({route:r,mutated:!1});continue}let a=[];for(let c=0;c<i;c++){let l=s[c],h=a.at(-1);h?.mutated===l?h.end=c+1:a.push({start:c,end:c+1,mutated:l})}for(let[c,l]of a.entries()){let h=r.route.slice(l.start,l.end+1),d={...r,connectionName:a.length===1?r.connectionName:`${r.connectionName}_mutation_fragment_${c}`,preloadedRouteIndex:r.preloadedRouteIndex+c/(a.length+1),preloadedRoutePositionStart:cWt(r,l.start),preloadedRoutePositionEnd:cWt(r,l.end),route:h,vias:Dln(h)};n.push({route:d,mutated:l.mutated})}}return n},zIr=({updatedFixedRoutes:e,regionalMutationMasks:t})=>{let n=FIr({updatedFixedRoutes:e,regionalMutationMasks:t}),o=n.map(({route:a})=>a),r=((a)=>{let c=[],l;for(let h of[...a].sort((d,u)=>Nln(d.route,u.route))){let d=h.route;if(!h.mutated){l=void 0;continue}let u=d.route[0],_=d.route.at(-1);if(!u||!_||d.route.length<2)throw Error(`Pipeline9 cannot simplify empty fixed route "${d.connectionName}"`);let p=l?.sourceRoutes.at(-1);l&&p&&Rln(p,d)?(l.sourceRoutes.push(d),l.end={segmentIndex:d.route.length-2,point:_}):(l={sourceRoutes:[d],start:{segmentIndex:0,point:u},end:{segmentIndex:d.route.length-2,point:_}},c.push(l))}return c})(n),i=r.map((a,c)=>{let l=((h,d)=>{let u=h.sourceRoutes[0],_=h.sourceRoutes.at(-1);if(!u||!_)throw Error("Pipeline9 cannot simplify an empty mutation section");let p=[h.start.point];for(let[m,A]of h.sourceRoutes.entries()){let g=m===0,f=m===h.sourceRoutes.length-1,y=g?h.start.segmentIndex+1:0,x=f?h.end.segmentIndex+1:A.route.length;sWt(p,A.route.slice(y,x))}if(sWt(p,[h.end.point]),p.length<2)throw Error(`Pipeline9 mutation section for "${u.connectionName}" has no routable span`);return{connectionName:`pipeline9_mutated_preload_${u.preloadedTraceIndex}_${d}`,rootConnectionName:u.rootConnectionName,traceThickness:Math.max(...h.sourceRoutes.map((m)=>m.traceThickness)),viaDiameter:Math.max(...h.sourceRoutes.map((m)=>m.viaDiameter)),route:p,vias:Dln(p)}})(a,c);return{connectionName:l.connectionName,section:a,hdRoute:l}}),s=new Set(i.flatMap(({section:a})=>a.sourceRoutes.map((c)=>c.connectionName)));return{sections:i,immutableHdRoutes:o.filter((a)=>!s.has(a.connectionName)),normalizedFixedRoutes:o}},OXe=0.000000001,xw=(e,t,n,o,r)=>{let i=r.getNetConnectedToId(e.connection_name)??e.connection_name,s=[],a=(c,l,h=o,d=[],u,_,p=!1)=>{c.length<2||s.push({connectionName:`${e.connection_name}_fixed_${t}_${s.length}`,rootConnectionName:i,preloadedTraceIndex:t,preloadedRouteIndex:s.length,preloadedRoutePositionStart:u,preloadedRoutePositionEnd:_,isThroughObstacle:p,traceThickness:Math.max(OXe,l),viaDiameter:Math.max(OXe,h),route:c,vias:d})};for(let c=0;c<e.route.length;c++){let l=e.route[c];if(l.route_type==="via"){a([{x:l.x,y:l.y,z:ti(l.from_layer,n)},{x:l.x,y:l.y,z:ti(l.to_layer,n)}],OXe,l.via_diameter??o,[{x:l.x,y:l.y}],c,c);continue}if(l.route_type==="through_obstacle"){let d=ti(l.from_layer,n),u=ti(l.to_layer,n);for(let _=Math.min(d,u);_<=Math.max(d,u);_++)a([{...l.start,z:_},{...l.end,z:_}],l.width,o,[],c,c+1,!0);continue}let h=e.route[c+1];l.route_type==="wire"&&h?.route_type==="wire"&&l.layer===h.layer&&a([{x:l.x,y:l.y,z:ti(l.layer,n)},{x:h.x,y:h.y,z:ti(h.layer,n)}],Math.max(l.width,h.width),o,[],c,c+1)}return s};function VR(e,t){return{x:e.a*t.x+e.b*t.y+e.c,y:e.d*t.x+e.e*t.y+e.f}}var OIr={highResolutionCellSize:0.1,highResolutionCellThickness:8,lowResolutionCellSize:0.4,traceMargin:0.15,traceThickness:0.1,viaDiameter:0.3,viaMinDistFromBorder:0.15},VIr={...OIr},c$e=(e,t,n)=>{let[o,r]=e;if(o===r)return;let i=((s,a)=>{let c=s.portPointId??`${s.connectionName}:${s.x}:${s.y}:${s.z}`,l=a.portPointId??`${a.connectionName}:${a.x}:${a.y}:${a.z}`;return c<l?`${c}|${l}`:`${l}|${c}`})(o,r);t.has(i)||(t.add(i),n.push(e))},hWt=(e,t,n)=>{for(let o=0;o<e.length-1;o++)c$e([e[o],e[o+1]],t,n)},YIr=(e)=>{let t=[],n=new Set,o=((s)=>{let a=new Map;for(let c of s)c.portPointId&&a.set(c.portPointId,c);return a})(e);for(let s of e){if(s.prevPortPointId){let a=o.get(s.prevPortPointId);a&&a.connectionName===s.connectionName&&c$e([a,s],n,t)}if(s.nextPortPointId){let a=o.get(s.nextPortPointId);a&&a.connectionName===s.connectionName&&c$e([s,a],n,t)}}if(t.length===0)return hWt(e,n,t),t;let r=((s)=>{let a=new Set;for(let[c,l]of s)c.portPointId&&a.add(c.portPointId),l.portPointId&&a.add(l.portPointId);return a})(t),i=e.filter((s)=>!s.portPointId||!r.has(s.portPointId));return hWt(i,n,t),t};function eCe(e,t,n){return Math.max(t,Math.min(n,e))}var VXe=["left","top","right","bottom","middle"],GIr=class{f=new Float64Array(1024);seq=new Uint32Array(1024);id=new Int32Array(1024);n=0;push(e,t,n){this.ensureCapacity(this.n+1);let o=this.n++;for(this.f[o]=e,this.seq[o]=t,this.id[o]=n;o>0;){let r=o-1>>1;if(this.less(r,o))break;this.swap(o,r),o=r}}pop(){let e=this.id[0];return this.n--,this.n>0&&(this.f[0]=this.f[this.n],this.seq[0]=this.seq[this.n],this.id[0]=this.id[this.n],this.siftDown(0)),e}get size(){return this.n}clear(){this.n=0}ensureCapacity(e){if(e<=this.f.length)return;let t=this.f.length;for(;t<e;)t*=2;let n=new Float64Array(t);n.set(this.f),this.f=n;let o=new Uint32Array(t);o.set(this.seq),this.seq=o;let r=new Int32Array(t);r.set(this.id),this.id=r}siftDown(e){for(;;){let t=2*e+1,n=t+1;if(t>=this.n)return;let o=t;if(n<this.n&&!this.less(t,n)&&(o=n),this.less(e,o))return;this.swap(e,o),e=o}}less(e,t){let n=this.f[e],o=this.f[t];return n!==o?n<o:this.seq[e]<this.seq[t]}swap(e,t){let n=this.f[e];this.f[e]=this.f[t],this.f[t]=n;let o=this.seq[e];this.seq[e]=this.seq[t],this.seq[t]=o;let r=this.id[e];this.id[e]=this.id[t],this.id[t]=r}},UIr=class{z=new Int32Array(1024);cellId=new Int32Array(1024);g=new Float64Array(1024);parent=new Int32Array(1024);ripHead=new Int32Array(1024).fill(-1);ripCount=new Int32Array(1024);length=0;clear(){this.length=0}push(e,t,n,o,r,i){this.ensureCapacity(this.length+1);let s=this.length++;return this.z[s]=e,this.cellId[s]=t,this.g[s]=n,this.parent[s]=o,this.ripHead[s]=r,this.ripCount[s]=i,s}ensureCapacity(e){if(e<=this.z.length)return;let t=this.z.length;for(;t<e;)t*=2;let n=new Int32Array(t);n.set(this.z),this.z=n;let o=new Int32Array(t);o.set(this.cellId),this.cellId=o;let r=new Float64Array(t);r.set(this.g),this.g=r;let i=new Int32Array(t);i.set(this.parent),this.parent=i;let s=new Int32Array(t);s.fill(-1),s.set(this.ripHead.subarray(0,this.length)),this.ripHead=s;let a=new Int32Array(t);a.set(this.ripCount.subarray(0,this.length)),this.ripCount=a}},WIr=class{connId=new Int32Array(1024);prev=new Int32Array(1024).fill(-1);length=0;clear(){this.length=0}append(e,t){this.ensureCapacity(this.length+1);let n=this.length++;return this.connId[n]=t,this.prev[n]=e,n}contains(e,t){for(let n=e;n>=0;n=this.prev[n])if(this.connId[n]===t)return!0;return!1}collect(e,t){t.length=0;for(let n=e;n>=0;n=this.prev[n])t.push(this.connId[n])}ensureCapacity(e){if(e<=this.connId.length)return;let t=this.connId.length;for(;t<e;)t*=2;let n=new Int32Array(t);n.set(this.connId),this.connId=n;let o=new Int32Array(t);o.fill(-1),o.set(this.prev.subarray(0,this.length)),this.prev=o}};function YXe(e,t){return t??e.replace(/_mst\d+$/,"")}function GXe(e,t){let n=e.x-t.center.x,o=e.y-t.center.y,r=Math.cos(-t.rotationRadians),i=Math.sin(-t.rotationRadians);return{x:n*r-o*i,y:n*i+o*r}}function dWt(e){return{minX:-e.width/2,minY:-e.height/2,maxX:e.width/2,maxY:e.height/2}}function H4(e,t,n){return Math.max(t,Math.min(n,e))}function JK(e,t){for(let n=0;n<e.length;n++)if(e[n]===t)return;e.push(t)}function uWt(e,t){for(let n=0;n<e.length;n++)if(e[n].cellId===t.cellId)return;e.push(t)}function Qae(e,t,n,o,r,i,s){let a=e-H4(e,o,i),c=t-H4(t,r,s);return a*a+c*c<=n*n}function VO(e){let t=e.segmentEnd.x-e.segmentStart.x,n=e.segmentEnd.y-e.segmentStart.y,o=t**2+n**2;if(o===0)return(e.point.x-e.segmentStart.x)**2+(e.point.y-e.segmentStart.y)**2;let r=H4(((e.point.x-e.segmentStart.x)*t+(e.point.y-e.segmentStart.y)*n)/o,0,1),i=e.segmentStart.x+r*t,s=e.segmentStart.y+r*n;return(e.point.x-i)**2+(e.point.y-s)**2}function dce(e){let t=H4(e.point.x,e.rect.minX,e.rect.maxX),n=H4(e.point.y,e.rect.minY,e.rect.maxY),o=e.point.x-t,r=e.point.y-n;return o*o+r*r}function uce(e){return(e.second.x-e.first.x)*(e.third.y-e.first.y)-(e.second.y-e.first.y)*(e.third.x-e.first.x)}function tCe(e){return!(Math.abs(uce({first:e.segmentStart,second:e.segmentEnd,third:e.point}))>0.000000001)&&(e.point.x>=Math.min(e.segmentStart.x,e.segmentEnd.x)&&e.point.x<=Math.max(e.segmentStart.x,e.segmentEnd.x)&&e.point.y>=Math.min(e.segmentStart.y,e.segmentEnd.y)&&e.point.y<=Math.max(e.segmentStart.y,e.segmentEnd.y))}function Qln(e){let t=uce({first:e.firstStart,second:e.firstEnd,third:e.secondStart}),n=uce({first:e.firstStart,second:e.firstEnd,third:e.secondEnd}),o=uce({first:e.secondStart,second:e.secondEnd,third:e.firstStart}),r=uce({first:e.secondStart,second:e.secondEnd,third:e.firstEnd});return t*n<0&&o*r<0||(tCe({point:e.secondStart,segmentStart:e.firstStart,segmentEnd:e.firstEnd})||tCe({point:e.secondEnd,segmentStart:e.firstStart,segmentEnd:e.firstEnd})||tCe({point:e.firstStart,segmentStart:e.secondStart,segmentEnd:e.secondEnd})||tCe({point:e.firstEnd,segmentStart:e.secondStart,segmentEnd:e.secondEnd}))}function XIr(e){return Qln(e)?0:Math.min(VO({point:e.firstStart,segmentStart:e.secondStart,segmentEnd:e.secondEnd}),VO({point:e.firstEnd,segmentStart:e.secondStart,segmentEnd:e.secondEnd}),VO({point:e.secondStart,segmentStart:e.firstStart,segmentEnd:e.firstEnd}),VO({point:e.secondEnd,segmentStart:e.firstStart,segmentEnd:e.firstEnd}))}function pWt(e){if(function(n){if(dce({point:n.segmentStart,rect:n.rect})===0||dce({point:n.segmentEnd,rect:n.rect})===0)return!0;let o=[{x:n.rect.minX,y:n.rect.minY},{x:n.rect.maxX,y:n.rect.minY},{x:n.rect.maxX,y:n.rect.maxY},{x:n.rect.minX,y:n.rect.maxY}];for(let r=0;r<o.length;r++){let i=(r+1)%o.length;if(Qln({firstStart:n.segmentStart,firstEnd:n.segmentEnd,secondStart:o[r],secondEnd:o[i]}))return!0}return!1}(e))return!0;let t=e.radius**2;if(dce({point:e.segmentStart,rect:e.rect})<=t||dce({point:e.segmentEnd,rect:e.rect})<=t)return!0;return[{x:e.rect.minX,y:e.rect.minY},{x:e.rect.maxX,y:e.rect.minY},{x:e.rect.maxX,y:e.rect.maxY},{x:e.rect.minX,y:e.rect.maxY}].some((n)=>VO({point:n,segmentStart:e.segmentStart,segmentEnd:e.segmentEnd})<=t)}var jIr=class extends fa{getSolverName(){return"HighDensitySolverB01"}nodeWithPortPoints;obstacles;highResolutionCellSize;highResolutionCellThickness;lowResolutionCellSize;viaDiameter;MAX_RIPS;maxCellCount;traceThickness;traceMargin;obstacleClearanceMargin;viaMinDistFromBorder;showPenaltyMap;showUsedCellMap;effort;stepMultiplier;hyperParameters;initialPenaltyFn;boundsMinX;boundsMaxX;boundsMinY;boundsMaxY;gridToBoundsTransform;availableZ;zToLayer;layerToZ;layers;fineRows;fineCols;lowScale;bandRows;bandCols;regions;planeSize;cellCenterX;cellCenterY;cellMinX;cellMinY;cellMaxX;cellMaxY;cellWidth;cellHeight;cellRegion;cellRow;cellCol;viaAllowed;neighborOffset;neighborIds;neighborCosts;usedCellsFlat;sharedCellsFlat;portOwnerFlat;penalty2d;ripStateBuckets;visitedStamp;bestGStamp;bestGValue;visitedFlatStamp;sharedCrossRootPortFlat;stamp=0;connNameToId;connIdToName;connIdToRootNet;overlapFriendlyRootNets;usedIndicesByConn;unsolvedSegs;solvedRoutes;activeConnSeg=null;activeConnId=-1;nodePool;heap;ripChain;seqCounter=0;_viaOccs=[];_cellOccs=[];_rippedIds=[];ripCount;totalRipEvents=0;searchIterations=0;consecutiveSkips=0;penaltyCap;baseSearchBudgetIters;_moveCost=0;_moveRippedHead=-1;_moveRipCount=0;traceKeepoutRadius;viaKeepoutRadius;obstacleTraceRootIdsFlat;obstacleViaRootIdsByCell;obstacleRootNameToId;obstacleRootNames;obstacleTracePrimitives;obstacleViaPrimitives;obstacleRectPrimitives;obstacleTraceBlockedCellCount=0;obstacleViaBlockedCellCount=0;get unsolvedConnections(){return this.unsolvedSegs}get solvedConnectionsMap(){let e=new Map;for(let t=0;t<this.solvedRoutes.length;t++){let n=this.getSolvedRoutesForConn(t);n.length>0&&e.set(t,n)}return e}get activeConnection(){if(!this.activeConnSeg)return null;let e=this.activeConnSeg.startCellId,t=this.activeConnSeg.endCellId;return{connectionName:this.connIdToName[this.activeConnSeg.connId]??"",start:{cellId:e,region:VXe[this.cellRegion[e]],row:this.cellRow[e],col:this.cellCol[e],x:this.cellCenterX[e],y:this.cellCenterY[e],z:this.activeConnSeg.startZ},end:{cellId:t,region:VXe[this.cellRegion[t]],row:this.cellRow[t],col:this.cellCol[t],x:this.cellCenterX[t],y:this.cellCenterY[t],z:this.activeConnSeg.endZ}}}get openSet(){return{length:this.heap?.size??0}}get gridStats(){return{cells:this.planeSize||0,layers:this.layers||0,states:(this.planeSize||0)*(this.layers||0),ripStateBuckets:this.ripStateBuckets||0,neighborEdges:this.neighborIds?.length??0,regionCounts:this.regions?Object.fromEntries(this.regions.map((e)=>[e.name,e.rows*e.cols])):{},obstacleTraceBlockedCells:this.obstacleTraceBlockedCellCount,obstacleViaBlockedCells:this.obstacleViaBlockedCellCount,obstacleRootCount:this.obstacleRootNames?.length??0,obstacleRectCount:this.obstacleRectPrimitives?.length??0}}constructor(e){super(),this.nodeWithPortPoints=e.nodeWithPortPoints,this.obstacles=e.obstacles,this.highResolutionCellSize=e.highResolutionCellSize??0.1,this.highResolutionCellThickness=Math.max(1,Math.floor(e.highResolutionCellThickness??8)),this.lowResolutionCellSize=e.lowResolutionCellSize??0.4,this.viaDiameter=e.viaDiameter,this.maxCellCount=e.maxCellCount,this.traceThickness=e.traceThickness??0.1,this.traceMargin=e.traceMargin??0.15,this.obstacleClearanceMargin=e.obstacleClearanceMargin??0,this.viaMinDistFromBorder=e.viaMinDistFromBorder??0.15,this.showPenaltyMap=e.showPenaltyMap??!1,this.showUsedCellMap=e.showUsedCellMap??!1,this.effort=e.effort??1,this.stepMultiplier=Math.max(1,Math.floor(e.stepMultiplier??1)),this.hyperParameters={shuffleSeed:0,ripCost:8,ripTracePenalty:0.5,ripViaPenalty:0.75,viaBaseCost:0.1,greedyMultiplier:1.5,sameRootObstacleCostMultiplier:1,...e.hyperParameters},this.MAX_ITERATIONS=1e8,this.MAX_RIPS=200,this.initialPenaltyFn=e.initialPenaltyFn}getConstructorParams(){return[{nodeWithPortPoints:this.nodeWithPortPoints,obstacles:this.obstacles,highResolutionCellSize:this.highResolutionCellSize,highResolutionCellThickness:this.highResolutionCellThickness,lowResolutionCellSize:this.lowResolutionCellSize,viaDiameter:this.viaDiameter,maxCellCount:this.maxCellCount,stepMultiplier:this.stepMultiplier,traceThickness:this.traceThickness,traceMargin:this.traceMargin,obstacleClearanceMargin:this.obstacleClearanceMargin,viaMinDistFromBorder:this.viaMinDistFromBorder,showPenaltyMap:this.showPenaltyMap,showUsedCellMap:this.showUsedCellMap,effort:this.effort,hyperParameters:this.hyperParameters,initialPenaltyFn:this.initialPenaltyFn}]}_setup(){let{nodeWithPortPoints:e}=this,{width:t,height:n,center:o}=e;if(t>15||n>15)return this.error=`HighDensitySolverB01 only supports routing windows up to 15x15mm; received ${t}x${n}mm`,void(this.failed=!0);let r=this.lowResolutionCellSize/this.highResolutionCellSize,i=Math.round(r);if(!Number.isFinite(r)||r<=0||Math.abs(r-i)>0.000000001)return this.error="lowResolutionCellSize must be a positive integer multiple of highResolutionCellSize",void(this.failed=!0);this.lowScale=Math.max(1,i),this.availableZ=e.availableZ??[...new Set(e.portPoints.map((_)=>_.z))].sort((_,p)=>_-p),this.layers=this.availableZ.length,this.zToLayer=new Map,this.layerToZ=new Map;for(let _=0;_<this.availableZ.length;_++){let p=this.availableZ[_];this.zToLayer.set(p,_),this.layerToZ.set(_,p)}this.boundsMinX=o.x-t/2,this.boundsMaxX=o.x+t/2,this.boundsMinY=o.y-n/2,this.boundsMaxY=o.y+n/2,this.traceKeepoutRadius=this.traceMargin+this.traceThickness/2,this.viaKeepoutRadius=this.viaDiameter/2+this.traceKeepoutRadius,this.buildFiveRegionGrid(t,n),this.gridToBoundsTransform=this.computeGridToBoundsTransform();let s=this.layers*this.planeSize;if(this.maxCellCount!==void 0&&s>this.maxCellCount)return this.error=`Cell count ${s} exceeds maxCellCount ${this.maxCellCount}`,void(this.failed=!0);this.connNameToId=new Map,this.connIdToName=[],this.connIdToRootNet=[],this.overlapFriendlyRootNets=new Set,this.unsolvedSegs=this.buildConnectionSegs(),this.penalty2d=new Float64Array(this.planeSize);let a=t>0?1/t:0,c=n>0?1/n:0;for(let _=0;_<this.planeSize;_++){let p=0;this.initialPenaltyFn&&(p+=this.initialPenaltyFn({x:this.cellCenterX[_],y:this.cellCenterY[_],px:(this.cellCenterX[_]-this.boundsMinX)*a,py:(this.cellCenterY[_]-this.boundsMinY)*c,cellId:_,region:VXe[this.cellRegion[_]],row:this.cellRow[_],col:this.cellCol[_]})),this.penalty2d[_]=p}this.usedCellsFlat=new Int32Array(s).fill(-1),this.sharedCellsFlat=Array.from({length:s},()=>{}),this.portOwnerFlat=new Int32Array(s).fill(-1),this.sharedCrossRootPortFlat=new Uint8Array(s),this.obstacleTraceRootIdsFlat=Array.from({length:s},()=>{}),this.obstacleViaRootIdsByCell=Array.from({length:this.planeSize},()=>{}),this.obstacleRootNameToId=new Map,this.obstacleRootNames=[],this.obstacleTracePrimitives=[],this.obstacleViaPrimitives=[],this.obstacleRectPrimitives=[];let l=this.rasterizeObstacles();if(l)return this.error=l,void(this.failed=!0);this.ripStateBuckets=1;let h=s;this.visitedStamp=new Uint32Array(h),this.bestGStamp=new Uint32Array(h),this.bestGValue=new Float64Array(h),this.visitedFlatStamp=new Uint32Array(s),this.stamp=0;let d=new Map;for(let _ of this.nodeWithPortPoints.portPoints){let p=this.connNameToId.get(_.connectionName);if(p===void 0)continue;let m=this.pointToCell(_),A=m.z*this.planeSize+m.cellId,g=this.connIdToRootNet[p],f=d.get(A);f===void 0?d.set(A,g):f!==g&&(this.sharedCrossRootPortFlat[A]=1);let y=this.portOwnerFlat[A];this.portOwnerFlat[A]=y===-1||y===p?p:-2}this.solvedRoutes=[],this.usedIndicesByConn=[],this.ripCount=[],this.consecutiveSkips=0,this.penaltyCap=0.5*this.hyperParameters.ripCost,this.shuffleConnections();let u=function(_){let p=_.planeSize*_.layers,m=_.connectionCount,A=Math.sqrt(m),g=Math.max(1,_.maxIterations),f=eCe(Math.round(p*(8+1.2*A)),150000,12000000),y=eCe(Math.round(f*_.effort),150000,12000000),x=eCe(Math.round(0.2*g),150000,2000000);return{maxIterationsIters:Math.max(1,Math.min(g,Math.max(x,y))),baseSearchBudgetIters:eCe(Math.round(p*(10+0.8*A)*_.effort),50000,4000000)}}({planeSize:this.planeSize,layers:this.layers,connectionCount:this.unsolvedSegs.length,effort:this.effort,maxIterations:this.MAX_ITERATIONS});this.baseSearchBudgetIters=u.baseSearchBudgetIters,this.MAX_ITERATIONS=u.maxIterationsIters,this.activeConnSeg=null,this.activeConnId=-1,this.nodePool=new UIr,this.heap=new GIr,this.ripChain=new WIr,this.seqCounter=0}_step(){for(let e=0;e<this.stepMultiplier;e++){if(this.solved||this.failed)return;this.stepOnce()}}rasterizeObstacles(){for(let e=0;e<this.obstacles.length;e++){let t=this.obstacles[e];if(t.type==="rect"){let r=this.rasterizeRectObstacle(t,e);if(r)return r;continue}if(t.traceThickness<=0||t.viaDiameter<=0||t.route.length<2)return`Obstacle ${e} must have positive trace/via sizes and at least two route points`;let n=YXe(t.connectionName,t.rootConnectionName),o=this.internObstacleRootName(n);for(let r=1;r<t.route.length;r++){let i=t.route[r-1],s=t.route[r];if(!(Number.isFinite(i.x)&&Number.isFinite(i.y)&&Number.isFinite(i.z)&&Number.isFinite(s.x)&&Number.isFinite(s.y)&&Number.isFinite(s.z)))return`Obstacle ${e} contains non-finite route coordinates`;if(i.z===s.z){let a=this.zToLayer.get(i.z);if(a===void 0)return`Obstacle ${e} uses unavailable layer z=${i.z}`;this.rasterizeObstacleTraceSegment({segmentStart:i,segmentEnd:s,layer:a,obstacleRootId:o,obstacleTraceThickness:t.traceThickness})}else if(!t.vias.some((a)=>a.x===s.x&&a.y===s.y)){let a=this.rasterizeObstacleVia({center:s,obstacleRootId:o,obstacleViaDiameter:t.viaDiameter,zStart:i.z,zEnd:s.z,obstacleIndex:e});if(a)return a}}for(let r of t.vias){if(!Number.isFinite(r.x)||!Number.isFinite(r.y))return`Obstacle ${e} contains non-finite via coordinates`;let i=this.rasterizeObstacleVia({center:r,obstacleRootId:o,obstacleViaDiameter:t.viaDiameter,zStart:r.zStart,zEnd:r.zEnd,obstacleIndex:e});if(i)return i}}return this.obstacleTraceBlockedCellCount=this.obstacleTraceRootIdsFlat.reduce((e,t)=>e+(t?1:0),0),this.obstacleViaBlockedCellCount=this.obstacleViaRootIdsByCell.reduce((e,t)=>e+(t?1:0),0),null}rasterizeRectObstacle(e,t){if(!Number.isFinite(e.center.x)||!Number.isFinite(e.center.y)||!Number.isFinite(e.width)||!Number.isFinite(e.height)||e.width<=0||e.height<=0)return`Rect obstacle ${t} must have finite geometry and positive dimensions`;let n=[];for(let l of e.zLayers){let h=this.zToLayer.get(l);if(h===void 0)return`Rect obstacle ${t} uses unavailable layer z=${l}`;JK(n,h)}if(n.length===0)return`Rect obstacle ${t} must apply to at least one layer`;let o=this.internObstacleRootName(YXe(e.connectionName,e.rootConnectionName)),r={rootId:o,center:e.center,width:e.width,height:e.height,rotationRadians:(e.ccwRotationDegrees??0)*Math.PI/180,layers:n};this.obstacleRectPrimitives.push(r);let i=this.transformBoundsPointToGrid(e.center),s=Math.hypot(e.width/2,e.height/2),a=this.getConservativeGridRadius(s+this.traceThickness/2+this.traceMargin);this.forEachCellNearCircle(i.x,i.y,a,(l)=>{for(let h of n)this.addObstacleRootId({rootIdsByCell:this.obstacleTraceRootIdsFlat,cellIndex:h*this.planeSize+l,obstacleRootId:o})});let c=this.getConservativeGridRadius(s+this.viaDiameter/2+this.traceMargin);return this.forEachCellNearCircle(i.x,i.y,c,(l)=>{this.addObstacleRootId({rootIdsByCell:this.obstacleViaRootIdsByCell,cellIndex:l,obstacleRootId:o})}),null}internObstacleRootName(e){let t=this.obstacleRootNameToId.get(e);if(t!==void 0)return t;let n=this.obstacleRootNames.length;return this.obstacleRootNames.push(e),this.obstacleRootNameToId.set(e,n),n}rasterizeObstacleTraceSegment(e){this.obstacleTracePrimitives.push({rootId:e.obstacleRootId,layer:e.layer,segmentStart:e.segmentStart,segmentEnd:e.segmentEnd,traceRadius:e.obstacleTraceThickness/2});let t=this.transformBoundsPointToGrid(e.segmentStart),n=this.transformBoundsPointToGrid(e.segmentEnd),o=this.getConservativeGridRadius(e.obstacleTraceThickness/2+this.traceMargin),r=this.getConservativeGridRadius(e.obstacleTraceThickness/2+this.viaDiameter/2+this.traceMargin);this.forEachCellNearSegment({segmentStart:t,segmentEnd:n,radius:o},(i)=>{this.addObstacleRootId({rootIdsByCell:this.obstacleTraceRootIdsFlat,cellIndex:e.layer*this.planeSize+i,obstacleRootId:e.obstacleRootId})}),this.forEachCellNearSegment({segmentStart:t,segmentEnd:n,radius:r},(i)=>{this.addObstacleRootId({rootIdsByCell:this.obstacleViaRootIdsByCell,cellIndex:i,obstacleRootId:e.obstacleRootId})})}rasterizeObstacleVia(e){if(e.zStart===void 0!=(e.zEnd===void 0))return`Obstacle ${e.obstacleIndex} via must provide both zStart and zEnd`;let t=Array.from({length:this.layers},(i,s)=>s);if(e.zStart!==void 0&&e.zEnd!==void 0){if(!Number.isFinite(e.zStart)||!Number.isFinite(e.zEnd))return`Obstacle ${e.obstacleIndex} contains a non-finite via layer span`;let i=Math.min(e.zStart,e.zEnd),s=Math.max(e.zStart,e.zEnd);t=this.availableZ.flatMap((a,c)=>a>=i&&a<=s?[c]:[])}if(t.length===0)return null;this.obstacleViaPrimitives.push({rootId:e.obstacleRootId,center:e.center,viaRadius:e.obstacleViaDiameter/2,layers:t});let n=this.transformBoundsPointToGrid(e.center),o=this.getConservativeGridRadius(e.obstacleViaDiameter/2+this.traceThickness/2+this.traceMargin),r=this.getConservativeGridRadius(e.obstacleViaDiameter/2+this.viaDiameter/2+this.traceMargin);return this.forEachCellNearCircle(n.x,n.y,Math.max(o,r),(i)=>{let s=this.getCellRect(i);if(Qae(n.x,n.y,o,s.minX,s.minY,s.maxX,s.maxY))for(let a of t)this.addObstacleRootId({rootIdsByCell:this.obstacleTraceRootIdsFlat,cellIndex:a*this.planeSize+i,obstacleRootId:e.obstacleRootId});Qae(n.x,n.y,r,s.minX,s.minY,s.maxX,s.maxY)&&this.addObstacleRootId({rootIdsByCell:this.obstacleViaRootIdsByCell,cellIndex:i,obstacleRootId:e.obstacleRootId})}),null}forEachCellNearSegment(e,t){let n={x:(e.segmentStart.x+e.segmentEnd.x)/2,y:(e.segmentStart.y+e.segmentEnd.y)/2},o=Math.hypot(e.segmentEnd.x-e.segmentStart.x,e.segmentEnd.y-e.segmentStart.y)/2+e.radius;this.forEachCellNearCircle(n.x,n.y,o,(r)=>{pWt({segmentStart:e.segmentStart,segmentEnd:e.segmentEnd,radius:e.radius,rect:this.getCellRect(r)})&&t(r)})}getCellRect(e){return{minX:this.cellMinX[e],minY:this.cellMinY[e],maxX:this.cellMaxX[e],maxY:this.cellMaxY[e]}}transformBoundsPointToGrid(e){let t=this.gridToBoundsTransform;return{x:(e.x-t.c)/t.a,y:(e.y-t.f)/t.e}}getConservativeGridRadius(e){return e/Math.min(Math.abs(this.gridToBoundsTransform.a),Math.abs(this.gridToBoundsTransform.e))}addObstacleRootId(e){let t=e.rootIdsByCell[e.cellIndex];t||(t=[],e.rootIdsByCell[e.cellIndex]=t),JK(t,e.obstacleRootId)}isBlockedByObstacleRoots(e,t){if(!e)return!1;let n=this.connIdToRootNet[t];for(let o of e)if(this.obstacleRootNames[o]!==n)return!0;return!1}hasSameRootObstacle(e,t){if(!e)return!1;let n=this.connIdToRootNet[t];return e.some((o)=>this.obstacleRootNames[o]===n)}isLateralMoveBlockedByObstacleGeometry(e){let t=this.connIdToRootNet[e.activeConn],n=this.activeConnSeg,o=n&&e.layer===n.startZ&&e.fromCellId===n.startCellId?n.startPoint:VR(this.gridToBoundsTransform,{x:this.cellCenterX[e.fromCellId],y:this.cellCenterY[e.fromCellId]}),r=n&&e.layer===n.endZ&&e.toCellId===n.endCellId?n.endPoint:VR(this.gridToBoundsTransform,{x:this.cellCenterX[e.toCellId],y:this.cellCenterY[e.toCellId]});for(let i of this.obstacleTracePrimitives){if(i.layer!==e.layer||this.obstacleRootNames[i.rootId]===t)continue;let s=i.traceRadius+this.traceThickness/2+this.obstacleClearanceMargin;if(XIr({firstStart:o,firstEnd:r,secondStart:i.segmentStart,secondEnd:i.segmentEnd})<s*s)return!0}for(let i of this.obstacleViaPrimitives){if(!i.layers.includes(e.layer)||this.obstacleRootNames[i.rootId]===t)continue;let s=i.viaRadius+this.traceThickness/2+this.obstacleClearanceMargin;if(VO({point:i.center,segmentStart:o,segmentEnd:r})<s*s)return!0}for(let i of this.obstacleRectPrimitives)if(i.layers.includes(e.layer)&&this.obstacleRootNames[i.rootId]!==t&&pWt({segmentStart:GXe(o,i),segmentEnd:GXe(r,i),radius:this.traceThickness/2+this.obstacleClearanceMargin,rect:dWt(i)}))return!0;return!1}isViaMoveBlockedByObstacleGeometry(e){let t=this.connIdToRootNet[e.activeConn],n=VR(this.gridToBoundsTransform,{x:this.cellCenterX[e.cellId],y:this.cellCenterY[e.cellId]});for(let o of this.obstacleTracePrimitives){if(this.obstacleRootNames[o.rootId]===t)continue;let r=o.traceRadius+this.viaDiameter/2+this.obstacleClearanceMargin;if(VO({point:n,segmentStart:o.segmentStart,segmentEnd:o.segmentEnd})<r*r)return!0}for(let o of this.obstacleViaPrimitives){if(this.obstacleRootNames[o.rootId]===t)continue;let r=o.viaRadius+this.viaDiameter/2+this.obstacleClearanceMargin;if((n.x-o.center.x)**2+(n.y-o.center.y)**2<r*r)return!0}for(let o of this.obstacleRectPrimitives){if(this.obstacleRootNames[o.rootId]===t)continue;let r=GXe(n,o),i=this.viaDiameter/2+this.obstacleClearanceMargin;if(dce({point:r,rect:dWt(o)})<i*i)return!0}return!1}buildFiveRegionGrid(e,t){this.fineCols=Math.max(1,Math.ceil(e/this.highResolutionCellSize)),this.fineRows=Math.max(1,Math.ceil(t/this.highResolutionCellSize)),this.bandCols=Math.min(this.highResolutionCellThickness,Math.floor(this.fineCols/2)),this.bandRows=Math.min(this.highResolutionCellThickness,Math.floor(this.fineRows/2));let n=Math.max(0,this.fineCols-2*this.bandCols),o=Math.max(0,this.fineRows-2*this.bandRows),r=n,i=n;this.regions=[{id:0,name:"left",fineOriginRow:0,fineOriginCol:0,fineRows:this.fineRows,fineCols:this.bandCols,cellScale:1,rows:this.fineRows,cols:this.bandCols,offset:0},{id:1,name:"top",fineOriginRow:0,fineOriginCol:this.bandCols,fineRows:this.bandRows,fineCols:r,cellScale:1,rows:this.bandRows,cols:r,offset:0},{id:2,name:"right",fineOriginRow:0,fineOriginCol:this.fineCols-this.bandCols,fineRows:this.fineRows,fineCols:this.bandCols,cellScale:1,rows:this.fineRows,cols:this.bandCols,offset:0},{id:3,name:"bottom",fineOriginRow:this.fineRows-this.bandRows,fineOriginCol:this.bandCols,fineRows:this.bandRows,fineCols:i,cellScale:1,rows:this.bandRows,cols:i,offset:0},{id:4,name:"middle",fineOriginRow:this.bandRows,fineOriginCol:this.bandCols,fineRows:o,fineCols:n,cellScale:this.lowScale,rows:o>0?Math.ceil(o/this.lowScale):0,cols:n>0?Math.ceil(n/this.lowScale):0,offset:0}];let s=0;for(let x=0;x<this.regions.length;x++)this.regions[x].offset=s,s+=this.regions[x].rows*this.regions[x].cols;this.planeSize=s,this.cellCenterX=new Float64Array(this.planeSize),this.cellCenterY=new Float64Array(this.planeSize),this.cellMinX=new Float64Array(this.planeSize),this.cellMinY=new Float64Array(this.planeSize),this.cellMaxX=new Float64Array(this.planeSize),this.cellMaxY=new Float64Array(this.planeSize),this.cellWidth=new Float64Array(this.planeSize),this.cellHeight=new Float64Array(this.planeSize),this.cellRegion=new Uint8Array(this.planeSize),this.cellRow=new Int32Array(this.planeSize),this.cellCol=new Int32Array(this.planeSize),this.viaAllowed=new Uint8Array(this.planeSize);for(let x=0;x<this.regions.length;x++){let C=this.regions[x];for(let b=0;b<C.rows;b++){let I=C.fineOriginRow+b*C.cellScale,v=Math.min(C.fineOriginRow+C.fineRows,I+C.cellScale),P=this.boundsMinY+I*this.highResolutionCellSize,M=Math.min(this.boundsMaxY,this.boundsMinY+v*this.highResolutionCellSize);for(let B=0;B<C.cols;B++){let T=C.fineOriginCol+B*C.cellScale,N=Math.min(C.fineOriginCol+C.fineCols,T+C.cellScale),D=this.boundsMinX+T*this.highResolutionCellSize,L=Math.min(this.boundsMaxX,this.boundsMinX+N*this.highResolutionCellSize),H=this.cellIdFor(C.id,b,B);this.cellCenterX[H]=(D+L)/2,this.cellCenterY[H]=(P+M)/2,this.cellMinX[H]=D,this.cellMinY[H]=P,this.cellMaxX[H]=L,this.cellMaxY[H]=M,this.cellWidth[H]=L-D,this.cellHeight[H]=M-P,this.cellRegion[H]=C.id,this.cellRow[H]=b,this.cellCol[H]=B;let V=Math.min(this.cellCenterX[H]-this.boundsMinX,this.boundsMaxX-this.cellCenterX[H],this.cellCenterY[H]-this.boundsMinY,this.boundsMaxY-this.cellCenterY[H]);this.viaAllowed[H]=V>=this.viaMinDistFromBorder?1:0}}}let a=Array.from({length:this.planeSize},()=>[]),c=(x,C)=>{if(x===C||x<0||C<0)return;let b=this.cellCenterX[x]-this.cellCenterX[C],I=this.cellCenterY[x]-this.cellCenterY[C],v=Math.hypot(b,I);uWt(a[x],{cellId:C,cost:v}),uWt(a[C],{cellId:x,cost:v})};for(let x=0;x<this.regions.length;x++){let C=this.regions[x];for(let b=0;b<C.rows;b++)for(let I=0;I<C.cols;I++){let v=this.cellIdFor(C.id,b,I);b+1<C.rows&&c(v,this.cellIdFor(C.id,b+1,I)),I+1<C.cols&&c(v,this.cellIdFor(C.id,b,I+1))}}let l=this.regions[0],h=this.regions[1],d=this.regions[2],u=this.regions[3],_=this.regions[4],p=l.rows>0&&l.cols>0,m=h.rows>0&&h.cols>0,A=d.rows>0&&d.cols>0,g=u.rows>0&&u.cols>0,f=_.rows>0&&_.cols>0;if(p&&m)for(let x=0;x<this.bandRows;x++)c(this.cellIdFor(0,x,l.cols-1),this.cellIdFor(1,x,0));if(m&&A)for(let x=0;x<this.bandRows;x++)c(this.cellIdFor(1,x,h.cols-1),this.cellIdFor(2,x,0));if(p&&g)for(let x=this.fineRows-this.bandRows;x<this.fineRows;x++)c(this.cellIdFor(0,x,l.cols-1),this.cellIdFor(3,x-(this.fineRows-this.bandRows),0));if(g&&A)for(let x=this.fineRows-this.bandRows;x<this.fineRows;x++)c(this.cellIdFor(3,x-(this.fineRows-this.bandRows),u.cols-1),this.cellIdFor(2,x,0));if(p&&f)for(let x=this.bandRows;x<this.fineRows-this.bandRows;x++)c(this.cellIdFor(0,x,l.cols-1),this.cellIdFor(4,Math.floor((x-this.bandRows)/this.lowScale),0));if(A&&f)for(let x=this.bandRows;x<this.fineRows-this.bandRows;x++)c(this.cellIdFor(4,Math.floor((x-this.bandRows)/this.lowScale),_.cols-1),this.cellIdFor(2,x,0));if(m&&f)for(let x=this.bandCols;x<this.fineCols-this.bandCols;x++)c(this.cellIdFor(1,h.rows-1,x-this.bandCols),this.cellIdFor(4,0,Math.floor((x-this.bandCols)/this.lowScale)));if(g&&f)for(let x=this.bandCols;x<this.fineCols-this.bandCols;x++)c(this.cellIdFor(4,_.rows-1,Math.floor((x-this.bandCols)/this.lowScale)),this.cellIdFor(3,0,x-this.bandCols));if(!f&&!m&&!g&&p&&A)for(let x=0;x<Math.min(l.rows,d.rows);x++)c(this.cellIdFor(0,x,l.cols-1),this.cellIdFor(2,x,0));if(!f&&!p&&!A&&m&&g)for(let x=0;x<Math.min(h.cols,u.cols);x++)c(this.cellIdFor(1,h.rows-1,x),this.cellIdFor(3,0,x));let y=this.flattenNeighborLists(a);this.neighborOffset=y.offset,this.neighborIds=y.ids,this.neighborCosts=y.costs}cellIdFor(e,t,n){let o=this.regions[e];return o.offset+t*o.cols+n}stepOnce(){if(!this.activeConnSeg){if(this.unsolvedSegs.length===0)return void(this.solved=!0);let f=this.unsolvedSegs.shift();this.activeConnSeg=f,this.activeConnId=f.connId,this.nodePool.clear(),this.ripChain.clear(),this.heap.clear(),this.seqCounter=0,this.searchIterations=0,this.nextStamp();let y=this.computeH(f.startZ,f.startCellId,f.endZ,f.endCellId)*this.hyperParameters.greedyMultiplier,x=this.nodePool.push(f.startZ,f.startCellId,0,-1,-1,0),C=f.startZ*this.planeSize+f.startCellId,b=this.getSearchStateIdx(C,0);return this.bestGStamp[b]=this.stamp,this.bestGValue[b]=0,void this.heap.push(y,this.seqCounter++,x)}this.searchIterations++;let e=this.ripCount[this.activeConnId]??0,t=Math.round(this.baseSearchBudgetIters*(1+0.25*Math.min(e,10)));if(this.searchIterations>t){let f=this.penalty2d;for(let y=0;y<f.length;y++)f[y]=0.9*f[y];return this.unsolvedSegs.push(this.activeConnSeg),this.activeConnSeg=null,this.activeConnId=-1,this.heap.clear(),this.nodePool.clear(),this.consecutiveSkips++,void(this.consecutiveSkips>=Math.max(3,3*this.unsolvedSegs.length)&&(this.error=`Convergence failure: ${this.unsolvedSegs.length} connections stuck`,this.failed=!0))}if(this.heap.size===0)return this.error=`No path found for ${this.connIdToName[this.activeConnId]}`,void(this.failed=!0);let n=this.heap.pop(),o=this.nodePool.z[n],r=this.nodePool.cellId[n],i=this.nodePool.g[n],s=this.nodePool.ripHead[n],a=this.nodePool.ripCount[n],c=o*this.planeSize+r,l=this.getSearchStateIdx(c,a);if(this.visitedStamp[l]===this.stamp)return;this.visitedStamp[l]=this.stamp,this.visitedFlatStamp[c]=this.stamp;let h=this.activeConnSeg;if(o===h.endZ&&r===h.endCellId)return this.finalizeRoute(n),this.activeConnSeg=null,void(this.activeConnId=-1);let d=this.visitedStamp,u=this.stamp,_=this.activeConnId,{endZ:p,endCellId:m}=h,A=this.neighborOffset[r],g=this.neighborOffset[r+1];for(let f=A;f<g;f++){let y=this.neighborIds[f],x=o*this.planeSize+y;if(this.computeMoveCostAndRips(_,o,r,y,!1,s,a,this.neighborCosts[f]),this._moveCost<0)continue;let C=this.getSearchStateIdx(x,this._moveRipCount);if(d[C]===u)continue;let b=i+this._moveCost;if(this.bestGStamp[C]===u&&b>=this.bestGValue[C])continue;this.bestGStamp[C]=u,this.bestGValue[C]=b;let I=b+this.computeH(o,y,p,m)*this.hyperParameters.greedyMultiplier,v=this.nodePool.push(o,y,b,n,this._moveRippedHead,this._moveRipCount);this.heap.push(I,this.seqCounter++,v)}if(this.viaAllowed[r])for(let f=0;f<this.layers;f++){if(f===o)continue;let y=f*this.planeSize+r;if(this.computeMoveCostAndRips(_,f,r,r,!0,s,a,0),this._moveCost<0)continue;let x=this.getSearchStateIdx(y,this._moveRipCount);if(d[x]===u)continue;let C=i+this._moveCost;if(this.bestGStamp[x]===u&&C>=this.bestGValue[x])continue;this.bestGStamp[x]=u,this.bestGValue[x]=C;let b=C+this.computeH(f,r,p,m)*this.hyperParameters.greedyMultiplier,I=this.nodePool.push(f,r,C,n,this._moveRippedHead,this._moveRipCount);this.heap.push(b,this.seqCounter++,I)}}computeMoveCostAndRips(e,t,n,o,r,i,s,a){let c=0,l=i,h=s,d=t*this.planeSize+o,u=r?this.obstacleViaRootIdsByCell[o]:[...this.obstacleTraceRootIdsFlat[t*this.planeSize+n]??[],...this.obstacleTraceRootIdsFlat[d]??[]];if(this.isBlockedByObstacleRoots(u,e)&&(r?this.isViaMoveBlockedByObstacleGeometry({activeConn:e,cellId:o}):this.isLateralMoveBlockedByObstacleGeometry({activeConn:e,layer:t,fromCellId:n,toCellId:o})))return this._moveCost=-1,this._moveRippedHead=l,void(this._moveRipCount=h);let _=this.hasSameRootObstacle(u,e);if(r){c+=this.hyperParameters.viaBaseCost,c+=Math.min(this.penalty2d[o],this.penaltyCap);let p=this.portOwnerFlat[d],m=this.allowSharedUse(e,p),A=this.activeConnSeg,g=!!A&&t===A.endZ&&o===A.endCellId;if(p>=0&&p!==e&&!m&&!g)return this._moveCost=-1,void(this._moveRippedHead=l);this.fillViaOccupants(o,e);let f=this._viaOccs;for(let y=0;y<f.length;y++){let x=f[y];this.ripChain.contains(l,x)||(c+=this.hyperParameters.ripCost,l=this.ripChain.append(l,x),h++),c+=this.hyperParameters.ripViaPenalty}}else{c+=a,c+=Math.min(this.penalty2d[o],this.penaltyCap);let p=this.portOwnerFlat[d],m=this.allowSharedUse(e,p),A=this.activeConnSeg,g=!!A&&t===A.endZ&&o===A.endCellId;if(p>=0&&p!==e&&!m&&!g)return this._moveCost=-1,void(this._moveRippedHead=l);this.fillTraceOccupants(d,e,this._cellOccs);for(let f=0;f<this._cellOccs.length;f++){let y=this._cellOccs[f];this.ripChain.contains(l,y)||(c+=this.hyperParameters.ripCost,l=this.ripChain.append(l,y),h++),c+=this.hyperParameters.ripTracePenalty}}_&&(c*=this.hyperParameters.sameRootObstacleCostMultiplier),this._moveCost=c,this._moveRippedHead=l,this._moveRipCount=h}fillViaOccupants(e,t){let n=this._viaOccs;n.length=0;let o=this.cellCenterX[e],r=this.cellCenterY[e];this.forEachCellNearCircle(o,r,this.viaKeepoutRadius,(i)=>{if(Qae(o,r,this.viaKeepoutRadius,this.cellMinX[i],this.cellMinY[i],this.cellMaxX[i],this.cellMaxY[i]))for(let s=0;s<this.layers;s++)this.pushFlatOccupants(s*this.planeSize+i,t,n)})}fillTraceOccupants(e,t,n){n.length=0,this.pushFlatOccupants(e,t,n)}pushFlatOccupants(e,t,n){let o=this.usedCellsFlat[e];o===-1||o===t||this.allowSharedUse(t,o)||JK(n,o);let r=this.sharedCellsFlat[e];if(r)for(let i=0;i<r.length;i++){let s=r[i];s!==t&&(this.allowSharedUse(t,s)||JK(n,s))}}addSharedOccupant(e,t){if(this.usedCellsFlat[e]===t)return;let n=this.sharedCellsFlat[e];n||(n=[],this.sharedCellsFlat[e]=n),JK(n,t)}replaceOccupants(e,t){this.usedCellsFlat[e]=t,this.sharedCellsFlat[e]=void 0}removeOccupant(e,t){let n=this.sharedCellsFlat[e];if(this.usedCellsFlat[e]===t)return void(n&&n.length>0?(this.usedCellsFlat[e]=n.pop(),n.length===0&&(this.sharedCellsFlat[e]=void 0)):this.usedCellsFlat[e]=-1);if(!n)return;let o=n.indexOf(t);o!==-1&&(n.splice(o,1),n.length===0&&(this.sharedCellsFlat[e]=void 0))}allowSharedUse(e,t){if(t<0)return!1;return this.connIdToRootNet[t]===this.connIdToRootNet[e]}shouldSkipFixedPortHalo(e,t){let n=this.portOwnerFlat[e];return n!==t&&(n===-2||!(n<0)&&!this.allowSharedUse(t,n))}nextStamp(){this.stamp=this.stamp+1>>>0,this.stamp===0&&(this.visitedStamp.fill(0),this.bestGStamp.fill(0),this.visitedFlatStamp.fill(0),this.stamp=1)}getSearchStateIdx(e,t){return e}computeH(e,t,n,o){let r=Math.hypot(this.cellCenterX[t]-this.cellCenterX[o],this.cellCenterY[t]-this.cellCenterY[o]);return e===n?r:r+this.hyperParameters.viaBaseCost}internConn(e,t){let n=this.connNameToId.get(e);if(n!==void 0)return n;let o=this.connIdToName.length;return this.connIdToName.push(e),this.connIdToRootNet.push(YXe(e,t)),this.connNameToId.set(e,o),o}buildConnectionSegs(){let e=new Map;for(let o of this.nodeWithPortPoints.portPoints){let r=o.connectionName;e.has(r)||e.set(r,{points:[],rootConnectionName:o.rootConnectionName}),e.get(r).points.push(o)}let t=[],n=new Map;for(let[o,r]of e){let i=r.points,s=YIr(i);if(s.length===0)continue;let a=this.internConn(o,r.rootConnectionName);for(let[c,l]of s){let h=this.pointToCell(c),d=this.pointToCell(l),u=`${h.z}:${h.cellId}`,_=`${d.z}:${d.cellId}`,p=u<_?`${u}|${_}`:`${_}|${u}`,m=this.connIdToRootNet[a],A=`${m}|${p}`,g=n.get(A);if(g){if(this.overlapFriendlyRootNets.add(m),!g.connectionAliases.some((y)=>y.connectionName===o)){let y=g.startZ===h.z&&g.startCellId===h.cellId&&g.endZ===d.z&&g.endCellId===d.cellId,x=g.startZ===d.z&&g.startCellId===d.cellId&&g.endZ===h.z&&g.endCellId===h.cellId;if(!y&&!x)throw Error(`Connection alias ${o} does not match canonical segment ${A}`);g.connectionAliases.push({connectionName:o,rootConnectionName:m,startPoint:c,endPoint:l,reversedFromCanonical:!y&&x})}continue}let f={connId:a,startZ:h.z,startCellId:h.cellId,startPoint:c,endZ:d.z,endCellId:d.cellId,endPoint:l,connectionAliases:[{connectionName:o,rootConnectionName:m,startPoint:c,endPoint:l,reversedFromCanonical:!1}]};n.set(A,f),t.push(f)}}return t}pointToCell(e){let t=H4(Math.floor((e.x-this.boundsMinX)/this.highResolutionCellSize),0,this.fineCols-1),n=H4(Math.floor((e.y-this.boundsMinY)/this.highResolutionCellSize),0,this.fineRows-1),o=4;t<this.bandCols?o=0:t>=this.fineCols-this.bandCols?o=2:n<this.bandRows?o=1:n>=this.fineRows-this.bandRows&&(o=3);let r=this.regions[o],i=n-r.fineOriginRow,s=t-r.fineOriginCol,a=H4(Math.floor(i/r.cellScale),0,Math.max(0,r.rows-1)),c=H4(Math.floor(s/r.cellScale),0,Math.max(0,r.cols-1));return{z:this.zToLayer.get(e.z)??0,cellId:this.cellIdFor(o,a,c)}}shuffleConnections(){let e=this.unsolvedSegs,t=this.hyperParameters.shuffleSeed>>>0,n=()=>(t=Math.imul(t,1664525)+1013904223>>>0,t/4294967295);for(let o=e.length-1;o>0;o--){let r=Math.floor(n()*(o+1)),i=e[o];e[o]=e[r],e[r]=i}}finalizeRoute(e){this.consecutiveSkips=Math.max(0,this.consecutiveSkips-1);let t=[],n=e;for(;n>=0;){let l=this.nodePool.z[n],h=this.nodePool.cellId[n];t.push(l*this.planeSize+h),n=this.nodePool.parent[n]}for(t.reverse();t.length>1&&this.sharedCrossRootPortFlat[t[0]];)t.shift();for(;t.length>1&&this.sharedCrossRootPortFlat[t[t.length-1]];)t.pop();let o=this.extractViaCellIds(t),r=this.activeConnId;this.ripChain.collect(this.nodePool.ripHead[e],this._rippedIds);for(let l=0;l<this._rippedIds.length;l++)if(this.ripTrace(this._rippedIds[l]),this.failed)return;let i=[];for(let l=0;l<t.length;l++){let h=t[l],d=Math.floor(h/this.planeSize),u=h-d*this.planeSize;this.markTraceFootprint(r,d,u,i)}let s=[];for(let l=0;l<o.length;l++)this.markViaFootprint(r,o[l],i,s);for(;this.usedIndicesByConn.length<=r;)this.usedIndicesByConn.push(void 0);let a=this.usedIndicesByConn[r]??[];for(a.push(...i),this.usedIndicesByConn[r]=a;this.solvedRoutes.length<=r;)this.solvedRoutes.push(void 0);let c=this.solvedRoutes[r]??[];c.push({connId:r,states:Int32Array.from(t),viaCellIds:Int32Array.from(o),startPoint:this.activeConnSeg.startPoint,endPoint:this.activeConnSeg.endPoint,connectionAliases:this.activeConnSeg.connectionAliases}),this.solvedRoutes[r]=c;for(let l=0;l<s.length;l++)if(this.ripTrace(s[l]),this.failed)return;if(this._rippedIds.length>0||s.length>0){let l=this.penalty2d,h=this.penaltyCap;if(this.totalRipEvents>50)for(let d=0;d<l.length;d++)l[d]=0.99*l[d];else for(let d=0;d<l.length;d++)l[d]>h&&(l[d]=0.5*l[d])}}extractViaCellIds(e){let t=[];for(let n=1;n<e.length;n++){let o=e[n-1],r=e[n],i=Math.floor(o/this.planeSize),s=Math.floor(r/this.planeSize);i!==s&&t.push(r-s*this.planeSize)}return t}markTraceFootprint(e,t,n,o){let r=this.cellCenterX[n],i=this.cellCenterY[n];this.forEachCellNearCircle(r,i,this.traceKeepoutRadius,(s)=>{if(!Qae(r,i,this.traceKeepoutRadius,this.cellMinX[s],this.cellMinY[s],this.cellMaxX[s],this.cellMaxY[s]))return;let a=t*this.planeSize+s;if(s!==n&&this.shouldSkipFixedPortHalo(a,e))return;let c=this.usedCellsFlat[a],l=this.allowSharedUse(e,c);(c===-1||c===e||l)&&(c!==-1&&c!==e?this.addSharedOccupant(a,e):this.usedCellsFlat[a]=e,o.push(a))})}markViaFootprint(e,t,n,o){let r=this.cellCenterX[t],i=this.cellCenterY[t];this.forEachCellNearCircle(r,i,this.viaKeepoutRadius,(s)=>{if(Qae(r,i,this.viaKeepoutRadius,this.cellMinX[s],this.cellMinY[s],this.cellMaxX[s],this.cellMaxY[s]))for(let a=0;a<this.layers;a++){let c=a*this.planeSize+s;if(s!==t&&this.shouldSkipFixedPortHalo(c,e))continue;if(this.fillTraceOccupants(c,e,this._cellOccs),this._cellOccs.length>0){for(let h=0;h<this._cellOccs.length;h++)JK(o,this._cellOccs[h]);this.replaceOccupants(c,e),n.push(c);continue}let l=this.usedCellsFlat[c];l!==-1&&l!==e?this.addSharedOccupant(c,e):this.usedCellsFlat[c]=e,n.push(c)}})}forEachCellNearCircle(e,t,n,o){let r=H4(Math.floor((e-n-this.boundsMinX)/this.highResolutionCellSize),0,this.fineCols-1),i=H4(Math.floor((e+n-this.boundsMinX)/this.highResolutionCellSize),0,this.fineCols-1),s=H4(Math.floor((t-n-this.boundsMinY)/this.highResolutionCellSize),0,this.fineRows-1),a=H4(Math.floor((t+n-this.boundsMinY)/this.highResolutionCellSize),0,this.fineRows-1);for(let c=0;c<this.regions.length;c++){let l=this.regions[c];if(l.rows===0||l.cols===0)continue;let h=Math.max(s,l.fineOriginRow),d=Math.min(a,l.fineOriginRow+l.fineRows-1),u=Math.max(r,l.fineOriginCol),_=Math.min(i,l.fineOriginCol+l.fineCols-1);if(h>d)continue;if(u>_)continue;let p=Math.floor((h-l.fineOriginRow)/l.cellScale),m=Math.floor((d-l.fineOriginRow)/l.cellScale),A=Math.floor((u-l.fineOriginCol)/l.cellScale),g=Math.floor((_-l.fineOriginCol)/l.cellScale);for(let f=p;f<=m;f++)for(let y=A;y<=g;y++)o(this.cellIdFor(l.id,f,y))}}ripTrace(e){for(;this.ripCount.length<=e;)this.ripCount.push(0);if(this.ripCount[e]++,this.totalRipEvents++,this.totalRipEvents>=this.MAX_RIPS)return this.error=`Convergence failure: exceeded MAX_RIPS ${this.MAX_RIPS}`,void(this.failed=!0);let t=this.getSolvedRoutesForConn(e);if(t.length>0)for(let o of t){for(let r=0;r<o.states.length;r++){let i=o.states[r]%this.planeSize;this.penalty2d[i]=this.penalty2d[i]+this.hyperParameters.ripTracePenalty}for(let r=0;r<o.viaCellIds.length;r++){let i=o.viaCellIds[r];this.penalty2d[i]=this.penalty2d[i]+this.hyperParameters.ripViaPenalty}}let n=this.usedIndicesByConn[e];if(n){for(let o=0;o<n.length;o++)this.removeOccupant(n[o],e);this.usedIndicesByConn[e]=void 0}if(t.length>0){this.solvedRoutes[e]=void 0;for(let o of t){let r=o.states[0],i=o.states[o.states.length-1],s=Math.floor(r/this.planeSize),a=Math.floor(i/this.planeSize);this.unsolvedSegs.push({connId:e,startZ:s,startCellId:r-s*this.planeSize,startPoint:o.startPoint,endZ:a,endCellId:i-a*this.planeSize,endPoint:o.endPoint,connectionAliases:o.connectionAliases})}}}flattenNeighborLists(e){let t=new Int32Array(e.length+1),n=0;for(let s=0;s<e.length;s++)t[s]=n,n+=e[s].length;t[e.length]=n;let o=new Int32Array(n),r=new Float32Array(n),i=0;for(let s=0;s<e.length;s++){let a=e[s];for(let c=0;c<a.length;c++){let l=a[c];o[i]=l.cellId,r[i]=l.cost,i++}}return{offset:t,ids:o,costs:r}}visualize(){let e=["red","blue","orange","green"],t=this.gridToBoundsTransform,n=[],o=[],r=[],i=[];i.push({center:{x:this.nodeWithPortPoints.center.x,y:this.nodeWithPortPoints.center.y},width:this.nodeWithPortPoints.width,height:this.nodeWithPortPoints.height,stroke:"gray"});let s=({route:c,connectionName:l,strokeWidth:h,strokeDash:d,labelPrefix:u})=>{if(c.length<2)return;let _=0;for(let m=1;m<c.length;m+=1){let A=c[m-1];c[m].z!==A.z&&(m-_>=2&&o.push({points:c.slice(_,m).map((g)=>({x:g.x,y:g.y})),strokeColor:e[A.z]??"rgba(128,128,128,0.75)",strokeWidth:h,strokeDash:d,label:`${u} ${l} z=${A.z}`}),_=m)}if(c.length-_<2)return;let p=c[_].z;o.push({points:c.slice(_).map((m)=>({x:m.x,y:m.y})),strokeColor:e[p]??"rgba(128,128,128,0.75)",strokeWidth:h,strokeDash:d,label:`${u} ${l} z=${p}`})};for(let c of this.obstacles)if(c.type!=="rect"){s({route:c.route,connectionName:c.connectionName,strokeWidth:c.traceThickness,strokeDash:[0.12,0.08],labelPrefix:"fixed obstacle"});for(let l of c.vias)r.push({center:{x:l.x,y:l.y},radius:c.viaDiameter/2,fill:"rgba(128,0,128,0.25)",stroke:"purple",label:`fixed obstacle ${c.connectionName} via`})}else i.push({center:c.center,width:c.width,height:c.height,fill:"rgba(128,0,128,0.12)",stroke:"purple",label:`fixed obstacle ${c.connectionName}`});if(this.showPenaltyMap&&this.penalty2d){let c=0;for(let l=0;l<this.penalty2d.length;l++)this.penalty2d[l]>c&&(c=this.penalty2d[l]);if(c>0)for(let l=0;l<this.planeSize;l++){let h=this.penalty2d[l];if(h<=0)continue;let d=VR(t,{x:this.cellCenterX[l],y:this.cellCenterY[l]}),u=Math.min(0.6,h/c*0.6);i.push({center:d,width:this.cellWidth[l]*t.a,height:this.cellHeight[l]*t.e,fill:`rgba(255,165,0,${u.toFixed(3)})`})}}if(this.showUsedCellMap&&this.usedCellsFlat)for(let c=0;c<this.layers;c++){let l=c*this.planeSize;for(let h=0;h<this.planeSize;h++){if(this.usedCellsFlat[l+h]===-1)continue;let d=VR(t,{x:this.cellCenterX[h],y:this.cellCenterY[h]});i.push({center:d,width:this.cellWidth[h]*t.a,height:this.cellHeight[h]*t.e,fill:"rgba(0,0,255,0.5)"})}}for(let c of this.nodeWithPortPoints.portPoints)n.push({x:c.x,y:c.y,color:e[c.z]??"gray",label:c.connectionName});let a=this.getOutput();for(let c of a)s({route:c.route,connectionName:c.connectionName,strokeWidth:this.traceThickness,labelPrefix:"B01 route"});for(let c of a)for(let l of c.vias)r.push({center:{x:l.x,y:l.y},radius:this.viaDiameter/2,fill:"rgba(0,0,0,0.3)",stroke:"black",label:`B01 route ${c.connectionName} via`});if(this.activeConnSeg&&this.visitedFlatStamp){let c=this.stamp;for(let l=0;l<this.layers;l++){let h=l*this.planeSize;for(let d=0;d<this.planeSize;d++){if(this.visitedFlatStamp[h+d]!==c)continue;let u=VR(t,{x:this.cellCenterX[d],y:this.cellCenterY[d]});n.push({x:u.x,y:u.y,color:"rgba(0,0,255,0.2)"})}}}return{points:n,lines:o,circles:r,rects:i,coordinateSystem:"cartesian",title:`HighDensityB01 [${this.getSolvedRouteCount()} solved, ${this.unsolvedSegs?.length??0} remaining]`}}getOutput(){let e=this.gridToBoundsTransform,t=[];for(let n=0;n<this.solvedRoutes.length;n++){let o=this.getSolvedRoutesForConn(n);if(o.length!==0)for(let r of o){let i=Array.from(r.states,(a)=>{let c=Math.floor(a/this.planeSize),l=a-c*this.planeSize,h=VR(e,{x:this.cellCenterX[l],y:this.cellCenterY[l]});return{x:h.x,y:h.y,z:this.layerToZ.get(c)??c}}),s=Array.from(r.viaCellIds,(a)=>VR(e,{x:this.cellCenterX[a],y:this.cellCenterY[a]}));for(let a of r.connectionAliases){let c=(a.reversedFromCanonical?[...i].reverse():i).map((l)=>({...l}));c.length>0&&(c[0]={...a.startPoint},c.length>1&&(c[c.length-1]={...a.endPoint})),t.push({connectionName:a.connectionName,rootConnectionName:a.rootConnectionName,regionId:this.nodeWithPortPoints.capacityMeshNodeId,traceThickness:this.traceThickness,viaDiameter:this.viaDiameter,route:c,vias:s.map((l)=>({...l}))})}}}return t}getSolvedRoutesForConn(e){let t=this.solvedRoutes[e];return t?Array.isArray(t)?t:[t]:[]}getSolvedRouteCount(){let e=0;for(let t=0;t<this.solvedRoutes.length;t++)e+=this.getSolvedRoutesForConn(t).length;return e}computeGridToBoundsTransform(){let e=1/0,t=-1/0,n=1/0,o=-1/0;for(let h=0;h<this.planeSize;h++){let d=this.cellCenterX[h],u=this.cellCenterY[h];d<e&&(e=d),d>t&&(t=d),u<n&&(n=u),u>o&&(o=u)}let r=t-e,i=o-n,s=this.boundsMaxX-this.boundsMinX,a=this.boundsMaxY-this.boundsMinY,c=r>0?s/r:1,l=i>0?a/i:1;return{a:c,b:0,c:r>0?this.boundsMinX-c*e:(this.boundsMinX+this.boundsMaxX)/2-e,d:0,e:l,f:i>0?this.boundsMinY-l*n:(this.boundsMinY+this.boundsMaxY)/2-n}}},UXe=new WeakMap,Dw=(e,{layerCount:t,allowBlindAndBuriedVias:n})=>{let o=`${t}:${n===!0}`,r=UXe.get(e)?.get(o);if(r)return r;let i=[],s=[];for(let l=1;l<e.route.length;l++){let h=e.route[l-1],d=e.route[l],u=Math.hypot(d.x-h.x,d.y-h.y),_=Math.max(h.traceThickness??e.traceThickness,d.traceThickness??e.traceThickness);if(h.z!==d.z&&h.toNextSegmentType==="through_obstacle"){let g=Math.min(h.z,d.z),f=Math.max(h.z,d.z);if(u<=0.000000001){let y=e.vias.some((x)=>Math.hypot(x.x-d.x,x.y-d.y)<=0.000000001);s.push({center:{x:d.x,y:d.y},minZ:g,maxZ:f,diameter:y?e.viaDiameter:_});continue}for(let y=g;y<=f;y++)i.push({start:{...h,z:y},end:{...d,z:y},z:y,width:_});continue}let p=h.z===d.z?void 0:wln({hdRoute:e,start:h,end:d}),m=p==="start"?d.z:h.z;if(u>0.000000001&&i.push({start:h.z===m?h:{...h,z:m},end:d.z===m?d:{...d,z:m},z:m,width:_}),h.z===d.z)continue;let A=p==="start"?h:d;Nh(h.z,t),Nh(d.z,t),s.push({center:{x:A.x,y:A.y},minZ:n?Math.min(h.z,d.z):0,maxZ:n?Math.max(h.z,d.z):t-1,diameter:e.viaDiameter})}let a={wireSegments:i,viaSpans:s},c=UXe.get(e)??new Map;return c.set(o,a),UXe.set(e,c),a},kln=(e,t,n)=>{let o=e.end.x-e.start.x,r=e.end.y-e.start.y,i=Math.hypot(o,r),s={x:(e.start.x+e.end.x)/2,y:(e.start.y+e.end.y)/2};return Math.abs(o)<=0.000000001||Math.abs(r)<=0.000000001?[{center:s,width:Math.abs(o)>Math.abs(r)?i:e.width,height:Math.abs(o)>Math.abs(r)?e.width:i}]:Vcn({center:s,width:i,height:e.width,rotation:180*Math.atan2(r,o)/Math.PI},Math.max(n,Math.ceil(i/t)))},Lln=({fixedObstacleRoutes:e,layerCount:t,allowBlindAndBuriedVias:n})=>e.flatMap((o,r)=>{let i=[o.connectionName,o.rootConnectionName].filter((a)=>typeof a=="string"),s=Dw(o,{layerCount:t,allowBlindAndBuriedVias:n});return[...s.wireSegments.flatMap((a,c)=>kln(a,0.75,2).map((l,h)=>({obstacleId:`pipeline9_fixed_obstacle_${r}_wire_${c}_${h}`,type:"rect",layers:[Nh(a.z,t)],center:l.center,width:l.width,height:l.height,connectedTo:i}))),...s.viaSpans.map((a,c)=>({obstacleId:`pipeline9_fixed_obstacle_${r}_via_${c}`,type:"rect",layers:Array.from({length:a.maxZ-a.minZ+1},(l,h)=>Nh(a.minZ+h,t)),center:a.center,width:a.diameter,height:a.diameter,connectedTo:i}))]}),Hln=(e,t,n)=>{let o=[e.connectionName,e.rootConnectionName].filter((i)=>typeof i=="string"),r=[t.connectionName,t.rootConnectionName].filter((i)=>typeof i=="string");return o.some((i)=>r.some((s)=>i===s||n.areIdsConnected(i,s)))},mWt=(e,t)=>e.minX<=t.maxX&&e.maxX>=t.minX&&e.minY<=t.maxY&&e.maxY>=t.minY,Fln=({left:e,right:t,clearance:n,leftBounds:o,layerCount:r,allowBlindAndBuriedVias:i})=>{let s={layerCount:r,allowBlindAndBuriedVias:i},a=Dw(e,s),c=Dw(t,s),l=o?a.wireSegments.filter((d)=>((u,_)=>{let p={minX:Math.min(u.start.x,u.end.x)-u.width/2,maxX:Math.max(u.start.x,u.end.x)+u.width/2,minY:Math.min(u.start.y,u.end.y)-u.width/2,maxY:Math.max(u.start.y,u.end.y)+u.width/2};return mWt(p,_)})(d,o)):a.wireSegments,h=o?a.viaSpans.filter((d)=>((u,_)=>{let p={minX:u.center.x-u.diameter/2,maxX:u.center.x+u.diameter/2,minY:u.center.y-u.diameter/2,maxY:u.center.y+u.diameter/2};return mWt(p,_)})(d,o)):a.viaSpans;for(let d of l){for(let u of c.wireSegments){if(d.z!==u.z)continue;let _=d.width/2+u.width/2+n;if(WO(d.start,d.end,u.start,u.end)<_)return!0}for(let u of c.viaSpans){if(d.z<u.minZ||d.z>u.maxZ)continue;let _=d.width/2+u.diameter/2+n;if(WO(d.start,d.end,u.center,u.center)<_)return!0}}for(let d of h){for(let u of c.wireSegments){if(u.z<d.minZ||u.z>d.maxZ)continue;let _=d.diameter/2+u.width/2+n;if(WO(d.center,d.center,u.start,u.end)<_)return!0}for(let u of c.viaSpans){if(d.minZ>u.maxZ||u.minZ>d.maxZ)continue;let _=d.diameter/2+u.diameter/2+n;if(Math.hypot(d.center.x-u.center.x,d.center.y-u.center.y)<_)return!0}}return!1},KIr=({routes:e,movablePreloadedConnectionNames:t,boardObstacles:n,connMap:o,layerCount:r,viaToPadClearance:i,allowBlindAndBuriedVias:s})=>e.some((a)=>{if(!t.has(a.connectionName))return!1;return Dw(a,{layerCount:r,allowBlindAndBuriedVias:s}).viaSpans.some((c)=>n.some((l)=>{if((({obstacle:d,route:u,connMap:_})=>{if(Pw(d,u,_))return!0;if(!u.rootConnectionName)return!1;let p=_.getNetConnectedToId(u.connectionName)??_.getNetConnectedToId(u.rootConnectionName)??(_.netMap[u.rootConnectionName]?u.rootConnectionName:void 0);return!!p&&d.connectedTo.some((m)=>(_.getNetConnectedToId(m)??(_.netMap[m]?m:void 0))===p)})({obstacle:l,route:a,connMap:o}))return!1;return!!((d,u)=>(d.__zLayers??d.zLayers)||d.layers.map((p)=>ti(p,u)))(l,r).some((d)=>d>=c.minZ&&d<=c.maxZ)&&((d,u)=>{let _=-1*(u.ccwRotationDegrees??0)*Math.PI/180,p=d.x-u.center.x,m=d.y-u.center.y,A=p*Math.cos(_)-m*Math.sin(_),g=p*Math.sin(_)+m*Math.cos(_),f=Math.max(Math.abs(A)-u.width/2,0),y=Math.max(Math.abs(g)-u.height/2,0);return Math.hypot(f,y)})(c.center,l)<c.diameter/2+i}))}),zln=class extends Kr{params;highDensitySolver;forceImproveSolver;repairSolver;phase="route";constructor(e){super(),this.params=e,this.stats={preloadedViaCandidateRejectionCount:0,forceImproveCandidateRejectionCount:0,repairCandidateRejectionCount:0},this.highDensitySolver=new PV({nodePortPoints:[e.nodeWithPortPoints],colorMap:e.colorMap,connMap:e.connMap,viaDiameter:e.viaDiameter,traceWidth:e.traceWidth,obstacleMargin:e.obstacleMargin,effort:e.effort,nodePfById:e.nodePfById,obstacles:e.obstacles,layerCount:e.layerCount,useGrowShrinkHighDensityIntraNodeSolver:!0,preserveTerminalPcbPortIds:!1,growShrinkFallbackToInvalidGeometryOnFailure:!1,growShrinkSolutionValidator:e.boardObstacles&&e.movablePreloadedConnectionNames&&e.viaToPadClearance!==void 0?(t)=>this.validateCandidateRoutes(t):void 0}),this.activeSubSolver=this.highDensitySolver,this.MAX_ITERATIONS=1e8*e.effort}getSolverName(){return"Pipeline9RegionalFallbackSolver"}validateCandidateRoutes(e){let{boardObstacles:t,movablePreloadedConnectionNames:n,viaToPadClearance:o}=this.params;if(!t||!n||o===void 0)return!0;let r=KIr({routes:e,movablePreloadedConnectionNames:n,boardObstacles:t,connMap:this.params.connMap,layerCount:this.params.layerCount,allowBlindAndBuriedVias:this.params.allowBlindAndBuriedVias,viaToPadClearance:o});return r&&(this.stats.preloadedViaCandidateRejectionCount=Number(this.stats.preloadedViaCandidateRejectionCount??0)+1),!r}_step(){if(this.phase==="route"){if(this.highDensitySolver.step(),this.highDensitySolver.failed)return this.error=this.highDensitySolver.error,void(this.failed=!0);if(!this.highDensitySolver.solved)return;let e=fZe(this.highDensitySolver.routes);return this.validateCandidateRoutes(e)?(this.forceImproveSolver=new Gle({nodeWithPortPoints:[this.params.nodeWithPortPoints],hdRoutes:e,colorMap:this.params.colorMap,totalStepsPerNode:Math.max(12,Math.round(20*this.params.effort)),nodeAssignmentMargin:this.params.obstacleMargin}),this.activeSubSolver=this.forceImproveSolver,void(this.phase="improve")):(this.error="Pipeline9 regional route output failed its candidate validator",void(this.failed=!0))}if(this.phase==="improve"){if(this.forceImproveSolver.step(),this.forceImproveSolver.failed)return this.error=this.forceImproveSolver.error,void(this.failed=!0);if(!this.forceImproveSolver.solved)return;let e=this.forceImproveSolver.getOutput();return this.validateCandidateRoutes(e)?(this.repairSolver=new Ule({nodeWithPortPoints:[this.params.nodeWithPortPoints],hdRoutes:e,obstacles:this.params.obstacles,colorMap:this.params.colorMap,repairMargin:this.params.obstacleMargin,minimumTraceWidth:this.params.traceWidth,connMap:this.params.connMap}),this.activeSubSolver=this.repairSolver,void(this.phase="repair")):(this.stats.forceImproveCandidateRejectionCount=Number(this.stats.forceImproveCandidateRejectionCount??0)+1,this.error="Pipeline9 regional force-improve output failed its candidate validator",void(this.failed=!0))}if(this.phase==="repair"){if(this.repairSolver.step(),this.repairSolver.failed)return this.error=this.repairSolver.error,void(this.failed=!0);if(!this.repairSolver.solved)return;let e=this.repairSolver.getOutput();return this.validateCandidateRoutes(e)?(this.activeSubSolver=null,this.phase="done",void(this.solved=!0)):(this.stats.repairCandidateRejectionCount=Number(this.stats.repairCandidateRejectionCount??0)+1,this.error="Pipeline9 regional repair output failed its candidate validator",void(this.failed=!0))}}getOutput(){return this.repairSolver?.getOutput()??this.forceImproveSolver?.getOutput()??this.highDensitySolver.routes}visualize(){return this.repairSolver?.visualize()??this.forceImproveSolver?.visualize()??this.highDensitySolver.visualize()}},_Wt=(e,t)=>({minX:e.center.x-e.width/2-t,maxX:e.center.x+e.width/2+t,minY:e.center.y-e.height/2-t,maxY:e.center.y+e.height/2+t}),$Ir=(e,t,n,o,r)=>{let i=new Set(t.availableZ??t.portPoints.map((a)=>a.z)),s=Dw(e,r);return s.wireSegments.some((a)=>i.has(a.z)&&((c,l,h,d)=>Math.min(c.x,l.x)-h<=d.maxX&&Math.max(c.x,l.x)+h>=d.minX&&Math.min(c.y,l.y)-h<=d.maxY&&Math.max(c.y,l.y)+h>=d.minY)(a.start,a.end,a.width/2+o,n))||s.viaSpans.some((a)=>[...i].some((c)=>c>=a.minZ&&c<=a.maxZ)&&((c,l,h)=>{let d=Math.max(h.minX-c.x,0,c.x-h.maxX),u=Math.max(h.minY-c.y,0,c.y-h.maxY);return d*d+u*u<=l*l})(a.center,a.diameter/2+o,n))},Tce=(e,t)=>{let n=(o)=>({...o,rootConnectionName:t.getNetConnectedToId(o.rootConnectionName??o.connectionName)??o.rootConnectionName??o.connectionName});return{...e,portPoints:e.portPoints.map(n),portPointsInPairs:e.portPointsInPairs?.map(([o,r])=>[n(o),n(r)])}},qIr=({nodeWithPortPoints:e,connMap:t,colorMap:n,viaDiameter:o,traceWidth:r,obstacleMargin:i,effort:s,nodePfById:a,obstacles:c,boardGeometry:l,layerCount:h})=>new PV({nodePortPoints:[Tce(e,t)],colorMap:n,connMap:t,viaDiameter:o,traceWidth:r,obstacleMargin:i,effort:s,nodePfById:a,obstacles:c,layerCount:h,useGrowShrinkHighDensityIntraNodeSolver:!0,enableNegotiatedSearch:!0,gridSearchSegmentWork:500,gridSearchWorkScale:h>2?0.25:1,rejectOverlappingTerminals:h>2,boardGeometry:l,preserveTerminalPcbPortIds:!1,growShrinkFallbackToInvalidGeometryOnFailure:!1,captureSearchDebug:!1}),xZe=class extends Kr{fixedHdRoutes;connMap;colorMap;obstacles;boardGeometry;layerCount;allowBlindAndBuriedVias;viaDiameter;traceWidth;obstacleMargin;viaToPadClearance;effort;nodePfById;preserveTerminalPcbPortIds;includeBoardObstacles;enableRegionalFallback;maxB01Rips;routes=[];failedSolvers=[];unsolvedNodePortPoints;fixedRouteReplacements=new Map;removedFixedRouteConnectionNames=new Set;preloadedTraceMutationMasks=new Map;activeRegularSolver=null;activeB01Solver=null;activeFallbackSolver=null;activeFallbackFixedRouteSections=new Map;activeFallbackFixedObstacleRoutes=[];activeFallbackPromotedFixedRouteConnectionNames=new Set;activeFallbackReason=null;activeNode=null;constructor(e){super(),this.fixedHdRoutes=e.fixedHdRoutes,this.connMap=e.connMap,this.colorMap=e.colorMap??{},this.obstacles=e.obstacles,this.boardGeometry=e.boardGeometry,this.layerCount=e.layerCount,this.allowBlindAndBuriedVias=e.allowBlindAndBuriedVias??!1,this.viaDiameter=e.viaDiameter,this.traceWidth=e.traceWidth,this.obstacleMargin=e.obstacleMargin,this.viaToPadClearance=e.viaToPadClearance,this.effort=e.effort,this.nodePfById=e.nodePfById instanceof Map?new Map(e.nodePfById):new Map(Object.entries(e.nodePfById??{})),this.preserveTerminalPcbPortIds=e.preserveTerminalPcbPortIds??!1,this.includeBoardObstacles=e.includeBoardObstacles??!1,this.enableRegionalFallback=e.enableRegionalFallback??!0,this.maxB01Rips=e.maxB01Rips,this.unsolvedNodePortPoints=[...e.nodePortPoints],this.MAX_ITERATIONS=1e8*this.effort,this.stats={nodeCount:e.nodePortPoints.length,solvedNodeCount:0,fixedObstacleCount:e.fixedHdRoutes.length,fixedObstacleUses:0,boardObstacleUses:0,fallbackNodeCount:0,regularNodeCount:0,b01NodeCount:0,reroutedFixedRouteCount:0,reroutedFixedRouteSectionCount:0,promotedFallbackAttemptCount:0,promotedFixedRouteCount:0,regionalPreloadedViaCandidateRejectionCount:0,regionalForceImproveCandidateRejectionCount:0,regionalRepairCandidateRejectionCount:0}}getSolverName(){return"Pipeline9HighDensitySolver"}getUpdatedFixedHdRoutes(){return this.fixedHdRoutes.flatMap((e)=>this.removedFixedRouteConnectionNames.has(e.connectionName)?[]:[this.fixedRouteReplacements.get(e.connectionName)??e])}finishActiveNode(e){let t=this.activeNode?((n,o)=>n.map((r)=>({...r,rootConnectionName:o.portPoints.find((i)=>i.connectionName===r.connectionName)?.rootConnectionName??r.rootConnectionName})))(e,this.activeNode):e;this.routes.push(...this.preserveTerminalPcbPortIds&&this.activeNode?((n,o)=>{let r=o.portPoints.filter((i)=>i.pcb_port_id!==void 0);return n.map((i)=>{let s=i.route[0],a=i.route.at(-1),c=r.find((h)=>s!==void 0&&h.connectionName===i.connectionName&&h.x===s.x&&h.y===s.y&&h.z===s.z),l=r.find((h)=>a!==void 0&&h.connectionName===i.connectionName&&h.x===a.x&&h.y===a.y&&h.z===a.z);return{...i,startPcbPortId:c?.pcb_port_id,endPcbPortId:l?.pcb_port_id}})})(t,this.activeNode):t),this.stats.solvedNodeCount=Number(this.stats.solvedNodeCount??0)+1,this.activeB01Solver=null,this.activeRegularSolver=null,this.activeFallbackSolver=null,this.activeFallbackFixedRouteSections.clear(),this.activeFallbackFixedObstacleRoutes=[],this.activeFallbackPromotedFixedRouteConnectionNames.clear(),this.activeFallbackReason=null,this.activeNode=null}startRegularSolver(e){this.activeNode=e,this.activeRegularSolver=qIr({nodeWithPortPoints:e,colorMap:this.colorMap,connMap:this.connMap,viaDiameter:this.viaDiameter,traceWidth:this.traceWidth,obstacleMargin:this.obstacleMargin,effort:this.effort,nodePfById:this.nodePfById,obstacles:this.obstacles,boardGeometry:this.boardGeometry,layerCount:this.layerCount}),this.stats.regularNodeCount=Number(this.stats.regularNodeCount??0)+1}startRegionalFallback(e=new Set){if(!this.activeNode)throw Error("Pipeline9 cannot start a regional fallback without an active node");let t={...Tce(this.activeNode,this.connMap),availableZ:Array.from({length:this.layerCount},(s,a)=>a)},n=Cle(t,this.getUpdatedFixedHdRoutes(),e),o=new Set([...n.fixedRouteSectionsByConnectionName.values()].flatMap((s)=>s.sourceRoutes.map((a)=>a.connectionName)));for(let s of e)if(!o.has(s))throw Error(`Pipeline9 could not promote fixed route "${s}" into the active regional fallback`);let r=[...e].filter((s)=>!this.activeFallbackPromotedFixedRouteConnectionNames.has(s)).length;this.activeFallbackFixedRouteSections=n.fixedRouteSectionsByConnectionName,this.activeFallbackFixedObstacleRoutes=n.fixedObstacleRoutes,this.activeFallbackPromotedFixedRouteConnectionNames=new Set(e);let i=Lln({fixedObstacleRoutes:this.activeFallbackFixedObstacleRoutes,layerCount:this.layerCount,allowBlindAndBuriedVias:this.allowBlindAndBuriedVias});this.activeFallbackSolver=new zln({nodeWithPortPoints:n.nodeWithPortPoints,colorMap:this.colorMap,connMap:this.connMap,viaDiameter:this.viaDiameter,traceWidth:this.traceWidth,obstacleMargin:this.obstacleMargin,effort:this.effort,nodePfById:this.nodePfById,obstacles:[...this.obstacles,...i],boardObstacles:this.obstacles,movablePreloadedConnectionNames:o,viaToPadClearance:this.viaToPadClearance,layerCount:this.layerCount,allowBlindAndBuriedVias:this.allowBlindAndBuriedVias}),e.size===0?this.stats.fallbackNodeCount=Number(this.stats.fallbackNodeCount??0)+1:(this.stats.promotedFallbackAttemptCount=Number(this.stats.promotedFallbackAttemptCount??0)+1,this.stats.promotedFixedRouteCount=Number(this.stats.promotedFixedRouteCount??0)+r)}finishRegionalFallback(){if(!this.activeFallbackSolver)return;if(!this.activeNode)throw Error("Pipeline9 cannot finish a regional fallback without an active node");this.recordRegionalCandidateRejections();let e=[],t=new Map;for(let u of this.activeFallbackSolver.getOutput()){if(!this.activeFallbackFixedRouteSections.has(u.connectionName)){e.push(u);continue}let _=t.get(u.connectionName)??[];_.push(u),t.set(u.connectionName,_)}let n=[],o=[];for(let[u,_]of this.activeFallbackFixedRouteSections){let p=t.get(u)??[];if(p.length===0){o.push(_);continue}if(p.length>1)return this.error=`Pipeline9 regional fallback expected one replacement for fixed route "${u}", got ${p.length}`,void(this.failed=!0);let m=Tln({section:_,replacement:p[0],sourceMutationMasks:this.preloadedTraceMutationMasks,replacementIsMutated:!0});n.push({connectionName:u,section:_,replacement:m.route,mutatedSegments:m.mutatedSegments,replacementProducedSegment:m.replacementProducedSegment})}let r=[...e,...n.map(({replacement:u})=>u)],i=[...this.activeFallbackFixedObstacleRoutes,...o.flatMap((u)=>u.sourceRoutes)],s=_Wt(this.activeNode,this.obstacleMargin+Math.max(this.traceWidth,this.viaDiameter)/2),a=new Map;for(let u of r)for(let _ of i)Hln(u,_,this.connMap)||Fln({left:u,right:_,clearance:this.obstacleMargin,leftBounds:s,layerCount:this.layerCount,allowBlindAndBuriedVias:this.allowBlindAndBuriedVias})&&a.set(_.connectionName,_);if(a.size>0){let u=[...a.keys()],_=[...a].flatMap(([m,A])=>A.isThroughObstacle===!0?[]:[m]),p=new Set(this.activeFallbackPromotedFixedRouteConnectionNames);for(let m of _)p.add(m);if(p.size===this.activeFallbackPromotedFixedRouteConnectionNames.size){let m=[...a].flatMap(([A,g])=>g.isThroughObstacle===!0?[A]:[]);return this.error=m.length>0?`Pipeline9 regional fallback conflicts with immutable through-obstacle route(s): ${m.join(", ")}`:`Pipeline9 promoted regional fallback could not resolve immutable fixed route conflict(s): ${u.join(", ")}`,void(this.failed=!0)}return void this.startRegionalFallback(p)}let c=new Map;for(let{section:u,replacementProducedSegment:_}of n)if(_)for(let p of u.sourceRoutes){let{preloadedRoutePositionStart:m,preloadedRoutePositionEnd:A}=p;if(m===void 0!=(A===void 0))throw Error(`Pipeline9 fixed route "${p.connectionName}" has incomplete route-position metadata`);let g=Math.min(m??p.preloadedRouteIndex,A??p.preloadedRouteIndex),f=Math.max(m??p.preloadedRouteIndex,A??p.preloadedRouteIndex),y=c.get(p.preloadedTraceIndex);c.set(p.preloadedTraceIndex,{start:Math.min(y?.start??g,g),end:Math.max(y?.end??f,f)})}for(let{connectionName:u,section:_,replacement:p,mutatedSegments:m}of n){this.fixedRouteReplacements.set(u,p),this.preloadedTraceMutationMasks.set(u,m);for(let A of _.sourceRoutes.slice(1))this.removedFixedRouteConnectionNames.add(A.connectionName),this.preloadedTraceMutationMasks.delete(A.connectionName)}let l=Cle({...Tce(this.activeNode,this.connMap),portPoints:[],portPointsInPairs:[],availableZ:Array.from({length:this.layerCount},(u,_)=>_)},this.getUpdatedFixedHdRoutes()),h=new Set;for(let u of l.fixedRouteSectionsByConnectionName.values()){let _=u.sourceRoutes[0];if(!_)continue;let p=c.get(_.preloadedTraceIndex);if(p)for(let[m,A]of u.sourceRoutes.entries()){let g=A.preloadedRoutePositionStart??A.preloadedRouteIndex,f=A.preloadedRoutePositionEnd??A.preloadedRouteIndex,y={start:Math.min(g,f),end:Math.max(g,f)},x=y.start===y.end,C=p.start===p.end;if(!(x||C?y.start<=p.end&&p.start<=y.end:y.start<p.end&&p.start<y.end))continue;h.add(_.preloadedTraceIndex);let b=[...this.preloadedTraceMutationMasks.get(A.connectionName)??Array(A.route.length-1).fill(!1)];if(b.length!==A.route.length-1)throw Error(`Pipeline9 fixed route mutation mask for "${A.connectionName}" has ${b.length} segments, expected ${A.route.length-1}`);let I=m===0?u.start.segmentIndex:0,v=m===u.sourceRoutes.length-1?u.end.segmentIndex:A.route.length-2;for(let P=I;P<=v;P++)b[P]=!0;this.preloadedTraceMutationMasks.set(A.connectionName,b)}}for(let u of c.keys())if(!h.has(u))throw Error(`Pipeline9 could not capture accepted mutation provenance for trace ${u}`);let d=n.reduce((u,{section:_})=>u+_.sourceRoutes.length,0);this.stats.reroutedFixedRouteCount=Number(this.stats.reroutedFixedRouteCount??0)+d,this.stats.reroutedFixedRouteSectionCount=Number(this.stats.reroutedFixedRouteSectionCount??0)+n.length,this.finishActiveNode(e)}recordRegionalCandidateRejections(){if(!this.activeFallbackSolver)return;let e=this.activeFallbackSolver.stats;this.stats.regionalPreloadedViaCandidateRejectionCount=Number(this.stats.regionalPreloadedViaCandidateRejectionCount??0)+Number(e.preloadedViaCandidateRejectionCount??0),this.stats.regionalForceImproveCandidateRejectionCount=Number(this.stats.regionalForceImproveCandidateRejectionCount??0)+Number(e.forceImproveCandidateRejectionCount??0),this.stats.regionalRepairCandidateRejectionCount=Number(this.stats.regionalRepairCandidateRejectionCount??0)+Number(e.repairCandidateRejectionCount??0)}finishRegularSolverFailure(e){if(this.activeFallbackReason=`regular high-density routing failed: ${e}`,this.activeRegularSolver=null,!this.enableRegionalFallback)return this.error=`Pipeline9 ${this.activeFallbackReason}`,this.failed=!0,void(this.activeNode=null);this.startRegionalFallback()}_step(){this.stepNodeRouting(),this.activeSubSolver=this.activeFallbackSolver??this.activeRegularSolver??this.activeB01Solver}computeProgress(){if(this.solved)return 1;let e=Number(this.stats.nodeCount);if(e===0)return 0;let t=Math.max(0,Math.min(1,this.activeSubSolver?.progress??0));return Math.max(this.progress,(Number(this.stats.solvedNodeCount)+t)/e)}stepNodeRouting(){if(this.activeFallbackSolver){if(this.activeFallbackSolver.step(),this.activeFallbackSolver.failed)return this.recordRegionalCandidateRejections(),this.error=[`Pipeline9 primary high-density routing failed: ${this.activeFallbackReason??"unknown error"}`,`regional fallback failed: ${this.activeFallbackSolver.error??"unknown error"}`].join("; "),this.failed=!0,this.activeFallbackSolver=null,this.activeFallbackFixedRouteSections.clear(),this.activeFallbackFixedObstacleRoutes=[],this.activeFallbackPromotedFixedRouteConnectionNames.clear(),void(this.activeNode=null);if(!this.activeFallbackSolver.solved)return;return void this.finishRegionalFallback()}if(this.activeRegularSolver){if(this.activeRegularSolver.step(),this.activeRegularSolver.failed)return void this.finishRegularSolverFailure(this.activeRegularSolver.error??"unknown error");if(!this.activeRegularSolver.solved)return;return void this.finishActiveNode(this.activeRegularSolver.routes)}if(this.activeB01Solver){if(this.activeB01Solver.step(),this.activeB01Solver.failed)return this.failedSolvers.push(this.activeB01Solver),this.activeFallbackReason=`B01 failed: ${this.activeB01Solver.error??"unknown error"}`,this.activeB01Solver=null,this.enableRegionalFallback?void this.startRegionalFallback():(this.error=`Pipeline9 ${this.activeFallbackReason}`,this.failed=!0,void(this.activeNode=null));if(!this.activeB01Solver.solved)return;return void this.finishActiveNode(this.activeB01Solver.getOutput())}let e=this.unsolvedNodePortPoints.pop();if(!e)return void(this.solved=!0);let t=_Wt(e,this.obstacleMargin),n=Math.max(this.traceWidth,this.viaDiameter)/2,o=this.getUpdatedFixedHdRoutes().filter((s)=>$Ir(s,e,t,n,this)).flatMap((s)=>((a,c,l)=>{let h=new Set(c.availableZ??c.portPoints.map((p)=>p.z));if(h.size===0)throw Error(`Pipeline9 B01 node "${c.capacityMeshNodeId}" has no available layers`);let d={type:"route",connectionName:a.connectionName,rootConnectionName:a.rootConnectionName,traceThickness:a.traceThickness,viaDiameter:a.viaDiameter},u=[],_=Dw(a,l);for(let p of _.wireSegments)h.has(p.z)&&u.push({...d,traceThickness:p.width,route:[p.start,p.end],vias:[]});for(let p of _.viaSpans)[...h].some((m)=>m>=p.minZ&&m<=p.maxZ)&&u.push({...d,viaDiameter:p.diameter,route:[{...p.center,z:p.minZ},{...p.center,z:p.maxZ}],vias:[{...p.center,zStart:p.minZ,zEnd:p.maxZ}]});return u})(s,e,this));if(this.stats.fixedObstacleUses=Number(this.stats.fixedObstacleUses??0)+o.length,o.length===0)return void this.startRegularSolver(e);let r=(this.includeBoardObstacles?this.obstacles:[]).filter((s)=>((a,c)=>{let l=(a.ccwRotationDegrees??0)*Math.PI/180,h=Math.abs(Math.cos(l)),d=Math.abs(Math.sin(l)),u=a.width/2*h+a.height/2*d,_=a.width/2*d+a.height/2*h;return a.center.x-u<=c.maxX&&a.center.x+u>=c.minX&&a.center.y-_<=c.maxY&&a.center.y+_>=c.minY})(s,t)).map((s)=>(({obstacle:a,node:c,connMap:l,layerCount:h})=>{let d=new Set(c.availableZ??c.portPoints.map((p)=>p.z)),u=(a.zLayers??a.layers.map((p)=>ti(p,h))).filter((p)=>d.has(p));if(u.length===0)return;let _=a.connectedTo[0]??a.obstacleId??`pipeline9_obstacle_${a.center.x}_${a.center.y}`;return{type:"rect",connectionName:_,rootConnectionName:l.getNetConnectedToId(_)??_,center:a.center,width:a.width,height:a.height,ccwRotationDegrees:a.ccwRotationDegrees,zLayers:u}})({obstacle:s,node:e,connMap:this.connMap,layerCount:this.layerCount})).filter((s)=>s!==void 0);if(this.stats.boardObstacleUses=Number(this.stats.boardObstacleUses??0)+r.length,this.activeNode=e,e.width>15||e.height>15)return this.activeFallbackReason=`B01 node "${e.capacityMeshNodeId}" exceeds the 15x15mm routing limit (${e.width}x${e.height}mm)`,void this.startRegionalFallback();let i=Tce(e,this.connMap);this.stats.b01NodeCount=Number(this.stats.b01NodeCount??0)+1,this.activeB01Solver=new jIr({...VIr,nodeWithPortPoints:i,obstacles:[...o,...r],viaDiameter:this.viaDiameter,viaMinDistFromBorder:this.viaDiameter/2,traceThickness:this.traceWidth,traceMargin:this.obstacleMargin,obstacleClearanceMargin:0.15,effort:this.effort}),this.maxB01Rips!==void 0&&(this.activeB01Solver.MAX_RIPS=this.maxB01Rips)}visualize(){return this.activeFallbackSolver?.visualize()??this.activeRegularSolver?.visualize()??this.activeB01Solver?.visualize()??{lines:this.routes.flatMap((e)=>e.route.slice(0,-1).map((t,n)=>({points:[t,e.route[n+1]],strokeWidth:e.traceThickness,layer:`z${t.z}`,label:e.connectionName}))),points:[],rects:[],circles:[]}}},BO=(e,t)=>{let n=e({hdRoutes:t,traces:[]});return Array.isArray(n)?n:n.errorsWithCenters??n.errors},Oln=(e)=>{let t=typeof e.pcb_trace_id=="string"?e.pcb_trace_id:void 0,n=Array.isArray(e.pcb_trace_ids)?e.pcb_trace_ids.filter((s)=>typeof s=="string"):[],o=[...typeof e.pcb_via_id=="string"?[e.pcb_via_id]:[],...Array.isArray(e.pcb_via_ids)?e.pcb_via_ids:[]].filter((s)=>typeof s=="string"),r=t?`overlap_${t}_`:void 0,i=r&&typeof e.pcb_trace_error_id=="string"&&e.pcb_trace_error_id.startsWith(r)?e.pcb_trace_error_id.slice(r.length):void 0;if(n.length>0){let s=t&&!n.includes(t)?[t,...n]:[...n];return s.length<2&&i&&!o.includes(i)&&s.push(i),s}return[t,i].filter((s)=>typeof s=="string"&&!o.includes(s))},JIr=(e)=>Oln(e).filter((t,n,o)=>o.indexOf(t)===n),gWt=(e)=>e.reduce((t,n)=>{if(typeof n.actual_clearance=="number"&&typeof n.minimum_clearance=="number")return t+Math.max(0,n.minimum_clearance-n.actual_clearance);let o=(typeof n.message=="string"?n.message:"").match(/gap: (-?\d+(?:\.\d+)?)mm/);return o?t+Math.max(0,0.1-Number.parseFloat(o[1])):t+1},0),pce=(e,t)=>e.length<t.length||e.length===t.length&&gWt(e)<gWt(t)-0.000000001,ble=({routes:e,newConnections:t,syntheticConnectionNames:n})=>{let o=new Set([...t.map((s)=>s.name),...n]),r=new Map,i=new Map;for(let s=0;s<e.length;s++){let a=e[s];if(!o.has(a.connectionName))continue;let c=r.get(a.connectionName)??0;r.set(a.connectionName,c+1),i.set(`${a.connectionName}_${c}`,s)}return i},Ebe=0.01,ZIr=[0.03,0.1,0.25],AWt=(e)=>{let t=0;for(let n of e){if(typeof n.actual_clearance!="number"||!Number.isFinite(n.actual_clearance)||typeof n.minimum_clearance!="number"||!Number.isFinite(n.minimum_clearance))return;if(t+=Math.max(0,n.minimum_clearance-n.actual_clearance),!Number.isFinite(t))return}return t},WXe=({errors:e,errorsWithCenters:t,routeIndexByTraceId:n,padPositionById:o})=>{let r=[],i=0;for(let s of e){let a=s.type==="pcb_via_trace_clearance_error",c=s.type==="pcb_pad_trace_clearance_error";if(!a&&!c||typeof s.pcb_trace_id!="string"||!n.has(s.pcb_trace_id)||typeof s.actual_clearance!="number"||!Number.isFinite(s.actual_clearance)||typeof s.minimum_clearance!="number"||!Number.isFinite(s.minimum_clearance))return;let l=JIr(s);if(a&&l.length<2||l.some((_)=>!n.has(_)))return;let h=t.find((_)=>_.type===s.type&&_.pcb_trace_id===s.pcb_trace_id&&_.pcb_pad_id===s.pcb_pad_id&&_.pcb_via_id===s.pcb_via_id),d=c?typeof s.pcb_pad_id=="string"?o.get(s.pcb_pad_id):void 0:h?.center??s.center;if(!d||typeof d!="object")return;if(!(("x"in d)&&("y"in d)&&typeof d.x=="number"&&Number.isFinite(d.x)&&typeof d.y=="number"&&Number.isFinite(d.y)))return;let u={...s,pcb_trace_id:s.pcb_trace_id,actual_clearance:s.actual_clearance,minimum_clearance:s.minimum_clearance,center:{x:d.x,y:d.y}};if(a){if(typeof s.pcb_via_id!="string")return;r.push({...u,type:"pcb_via_trace_clearance_error",pcb_via_id:s.pcb_via_id,pcb_pad_id:void 0})}else{if(typeof s.pcb_pad_id!="string")return;r.push({...u,type:"pcb_pad_trace_clearance_error",pcb_pad_id:s.pcb_pad_id,pcb_via_id:void 0})}if(i+=Math.max(0,s.minimum_clearance-s.actual_clearance),!Number.isFinite(i))return}return{errors:r,deficit:i}},CZe=(e)=>((t)=>{let n=typeof t.pcb_trace_id=="string"?t.pcb_trace_id:void 0,o=Array.isArray(t.pcb_trace_ids)?t.pcb_trace_ids.filter((a)=>typeof a=="string"):[],r=[...typeof t.pcb_via_id=="string"?[t.pcb_via_id]:[],...Array.isArray(t.pcb_via_ids)?t.pcb_via_ids:[]].filter((a)=>typeof a=="string"),i=n?`overlap_${n}_`:void 0,s=i&&typeof t.pcb_trace_error_id=="string"&&t.pcb_trace_error_id.startsWith(i)?t.pcb_trace_error_id.slice(i.length):void 0;if(o.length>0){let a=n&&!o.includes(n)?[n,...o]:[...o];return a.length<2&&s&&!r.includes(s)&&a.push(s),a}return[n,s].filter((a)=>typeof a=="string"&&!r.includes(a))})(e).filter((t,n,o)=>o.indexOf(t)===n),e9r=(e,t)=>{let n=[...new Set(t.flatMap(CZe))];return e.map((o)=>{if(o.jumpers?.length||!n.some((i)=>i===o.connectionName||i.startsWith(`${o.connectionName}_`)))return o;let r=o.route.flatMap((i,s)=>{let a=o.route[s+1];if(!a||i.z!==a.z||i.toNextSegmentType||i.insideJumperPad||a.insideJumperPad||(i.traceThickness??o.traceThickness)!==(a.traceThickness??o.traceThickness))return[i];let c=Math.min(32,Math.ceil(((l,h)=>{let d=Math.max(Math.abs(l),Math.abs(h));if(d===0||d===Number.POSITIVE_INFINITY)return d;let u=l/d,_=h/d;return d*Math.sqrt(u*u+_*_)})(a.x-i.x,a.y-i.y)/0.25));return[i,...Array.from({length:Math.max(0,c-1)},(l,h)=>({x:i.x+(a.x-i.x)*(h+1)/c,y:i.y+(a.y-i.y)*(h+1)/c,z:i.z,traceThickness:i.traceThickness}))]});return r.length===o.route.length?o:{...o,route:r}})},SO=class extends Kr{params;state={phase:"initialize"};constructor(e){super(),this.params=e}_step(){let e=this.state,t=this.params;if(e.phase==="initialize"){let l=t.drcEvaluator({traces:[],routes:t.routes,hdRoutes:t.routes}),h=Array.isArray(l)?l:l.errors;if(h.length===0)return this.state={phase:"finished",output:t.routes},void(this.solved=!0);let d={...pS(t.originalSrj),traces:void 0},u=w$(t.routes),_=t.subdivideSegments?e9r(u,h):u,p=new hfr({srj:d,routes:_,bounds:d.bounds,boundaryMargin:0,boardEdgeClearance:t.originalSrj.minBoardEdgeClearance??0,lockedPointIndices:_.map((m)=>m.route.map(()=>!1)),allowViaMovement:!t.allowPartialRepair,traceClearance:(t.originalSrj.minTraceToPadEdgeClearance??_Q.traceClearance)+(t.allowPartialRepair||t.usePrecisionMargin?Ebe:0),viaClearance:(t.originalSrj.minPadEdgeToPadEdgeClearance??_Q.viaClearance)+(t.usePrecisionMargin?Ebe:0)});return this.MAX_ITERATIONS=p.MAX_ITERATIONS+4,this.activeSubSolver=p,void(this.state={phase:"relax",context:{srj:d,errors:h,originalCanonicalRoutes:u,canonicalRoutes:_},solver:p})}if(e.phase==="relax"){if(e.solver.step(),this.MAX_ITERATIONS=e.solver.MAX_ITERATIONS+4,e.solver.failed)throw Error(`Clearance relaxation failed: ${e.solver.error}`);return void(e.solver.solved&&(this.activeSubSolver=null,this.state={phase:"select",context:e.context,candidate:e.solver.getOutput()}))}if(e.phase==="finished")throw Error("Clearance projection stepped after completion");let{srj:n,errors:o,originalCanonicalRoutes:r,canonicalRoutes:i}=e.context;if(e.phase==="select"){let l=e.candidate;return t.allowPartialRepair&&(l=(({srj:h,routes:d,proposedRoutes:u})=>{if(d.length!==u.length)throw Error("Clearance projection changed the route count");if(h.allowBlindAndBuriedVias||d.some((M)=>M.jumpers?.length||M.route.some((B)=>B.toNextSegmentType||B.insideJumperPad)))return d;let{holeDiameter:_}=Pp(h),p=(M,B)=>({type:"pcb_trace",pcb_trace_id:`projection_${B}`,connection_name:M.rootConnectionName??M.connectionName,route:V4(M,h.layerCount,{defaultViaHoleDiameter:_})}),m=d.map(p),A={...h,minBoardEdgeClearance:h.minBoardEdgeClearance??0,traces:m},g=new Tw(A),f=new Set(g.canonicalize([...(h.differentialPairs??[]).flatMap((M)=>M.connectionNames),...(h.buses??[]).flatMap((M)=>M.connectionNames)])),y=[...d],x=[];for(let[M,B]of u.entries()){let T=d[M];if(B.route.length!==T.route.length)throw Error("Partial clearance projection changed routing topology");let N=[m[M].pcb_trace_id];if(!g.canonicalize(N).some((D)=>f.has(D))){y[M]={...T,route:[...B.route]};for(let D=0;D<B.route.length;D++)B.route[D].x===T.route[D].x&&B.route[D].y===T.route[D].y||x.push({routeIndex:M,pointIndex:D})}}let C=new yb(A,y.map(p),void 0,[],g),b=({routeIndex:M,pointIndex:B})=>{let T=y[M];for(let N=Math.max(1,B);N<=Math.min(B+1,T.route.length-1);N++){let D=T.route[N-1],L=T.route[N];if(D.z!==L.z)throw Error("Partial clearance projection moved a layer transition");if(C.collides({start:D,end:L,layer:Nh(D.z,h.layerCount),width:Math.max(D.traceThickness??T.traceThickness,L.traceThickness??T.traceThickness),connectionNames:[m[M].pcb_trace_id]}))return!1}return!0},I=x;for(;I.length>0;){let M=I.filter((T)=>!b(T));if(M.length===0)break;for(let{routeIndex:T,pointIndex:N}of M)y[T].route[N]=d[T].route[N];let B=new Set(M);I=I.filter((T)=>!B.has(T)),C=new yb(A,y.map(p),void 0,[],g)}let v=new Set(I);for(let M=0;M<x.length;M++){let B=x[M];if(v.has(B))continue;let T=[B];for(;M+1<x.length;){let N=x[M+1];if(v.has(N)||N.routeIndex!==B.routeIndex||N.pointIndex!==x[M].pointIndex+1)break;T.push(N),M++}for(let{routeIndex:N,pointIndex:D}of T)y[N].route[D]=u[N].route[D];for(;T.length>0;){let N=T.filter((L)=>!b(L));if(N.length===0)break;for(let{routeIndex:L,pointIndex:H}of N)y[L].route[H]=d[L].route[H];let D=new Set(N);T=T.filter((L)=>!D.has(L))}if(T.length!==0){for(let N of T)v.add(N);C=new yb(A,y.map(p),void 0,[],g)}}let P=new Set([...v].map(({routeIndex:M})=>M));return y.map((M,B)=>P.has(B)?M:d[B])})({srj:n,routes:i,proposedRoutes:l}),l=l.map((h,d)=>h===i[d]?r[d]:h)),void(this.state={phase:"physical-validation",context:e.context,candidate:l})}if(e.phase==="physical-validation"){let l=new Map(sV({srj:n,routes:i}).map((h)=>[h.key,h.severity]));return sV({srj:n,routes:e.candidate}).some(({key:h,severity:d})=>!l.has(h)||d>l.get(h)+0.00000001)||uqe({srj:n,previousRoutes:t.previousRoutes??i,routes:e.candidate}).length>0?(this.state={phase:"finished",output:t.routes},void(this.solved=!0)):void(this.state={...e,phase:"reference-validation"})}let s=t.drcEvaluator({traces:[],routes:e.candidate,hdRoutes:e.candidate}),a=Array.isArray(s)?s:s.errors,c=t.allowPartialRepair?((l,h)=>{if(h.length>=l.length)return!1;let d=(_)=>_.type==="pcb_via_trace_clearance_error"?JSON.stringify([_.type,_.pcb_trace_id,_.pcb_via_id]):_.type==="pcb_pad_trace_clearance_error"?JSON.stringify([_.type,_.pcb_trace_id,_.pcb_pad_id]):_.type==="pcb_via_clearance_error"&&Array.isArray(_.pcb_via_ids)?JSON.stringify([_.type,[..._.pcb_via_ids].sort()]):_.type==="pcb_trace_error"&&typeof _.pcb_trace_error_id=="string"&&_.pcb_trace_error_id.startsWith(`overlap_${_.pcb_trace_id}_`)?JSON.stringify([_.type,_.pcb_trace_error_id]):void 0,u=[...l];for(let _ of h){let p=d(_);if(p===void 0)return!1;let m=u.findIndex((g)=>d(g)===p);if(m<0)return!1;let A=u.splice(m,1)[0];if(_.type!=="pcb_trace_error"&&(typeof _.actual_clearance!="number"||!Number.isFinite(_.actual_clearance)||typeof A.actual_clearance!="number"||!Number.isFinite(A.actual_clearance)||_.minimum_clearance!==A.minimum_clearance||_.actual_clearance<A.actual_clearance-0.000000001))return!1}return!0})(o,a):a.length<o.length;this.state={phase:"finished",output:c?e.candidate:t.routes},this.solved=!0}getOutput(){if(!this.solved||this.state.phase!=="finished")throw Error("Clearance projection is not complete");return this.state.output}computeProgress(){switch(this.state.phase){case"initialize":return 0;case"relax":return 0.9*this.state.solver.progress;case"select":return 0.9;case"physical-validation":return 0.93;case"reference-validation":return 0.96;case"finished":return 1}}},t9r={maxRegions:4,maxCandidateAttempts:1024,maxPathSearchNodes:480000},fWt=(e,t,n)=>{if(!Number.isFinite(n)||n<=0)throw Error("Pipeline9 regional repair effort must be positive and finite");let o=Math.max(1,n);return{maxRegions:Math.ceil(24*o),maxCandidateAttempts:Math.ceil(4096*o),maxPathSearchNodes:Math.ceil(40000000*o),initialMaxRegions:Math.ceil(4*o),initialMaxCandidateAttempts:Math.ceil(1024*o),initialMaxPathSearchNodes:Math.ceil(2000000*o),regionsPerAcceptedRepair:2,candidateAttemptsPerAcceptedRepair:512,pathSearchNodesPerAcceptedRepair:2000000,maxCandidateAttemptsPerRegion:512,maxPathSearchNodesPerCall:1e6,pathGridSizeScale:2,pathHeuristicWeight:3,revisitChangedRegions:!0,regionSizes:[16,32]}},yWt=(e,t)=>({maxRegions:Math.min(e.maxRegions,(e.initialMaxRegions??e.maxRegions)+t*(e.regionsPerAcceptedRepair??0)),maxCandidateAttempts:Math.min(e.maxCandidateAttempts,(e.initialMaxCandidateAttempts??e.maxCandidateAttempts)+t*(e.candidateAttemptsPerAcceptedRepair??0)),maxPathSearchNodes:Math.min(e.maxPathSearchNodes,(e.initialMaxPathSearchNodes??e.maxPathSearchNodes)+t*(e.pathSearchNodesPerAcceptedRepair??0))}),xWt=[3,4,5,6,8],CWt=({error:e,routeIndexByTraceId:t})=>{let n=typeof e.pcb_trace_id=="string"?e.pcb_trace_id:void 0,o=[...typeof e.pcb_via_id=="string"?[e.pcb_via_id]:[],...Array.isArray(e.pcb_via_ids)?e.pcb_via_ids.filter((a)=>typeof a=="string"):[]],r=n?`overlap_${n}_`:void 0,i=r&&typeof e.pcb_trace_error_id=="string"&&e.pcb_trace_error_id.startsWith(r)?e.pcb_trace_error_id.slice(r.length):void 0,s=i!==void 0&&o.includes(i);return[n,...Array.isArray(e.pcb_trace_ids)?e.pcb_trace_ids:[],s?void 0:i].filter((a)=>typeof a=="string"&&t.has(a)).filter((a,c,l)=>l.indexOf(a)===c)},bWt=(e)=>e.filter((t)=>t.type==="pcb_via_clearance_error"||Array.isArray(t.pcb_via_ids)).length,Vln=(e,t)=>{let n=new Map;for(let o of e)n.set(o.connectionName,(n.get(o.connectionName)??0)+1);return e.map((o,r)=>{let i=n.get(o.connectionName)>1?`${o.connectionName}_regional_${r}`:o.connectionName;return i!==o.connectionName&&t.addConnections([[i,o.connectionName,o.rootConnectionName??o.connectionName]]),{...o,connectionName:i,preloadedTraceId:`pipeline9_joint_candidate_${r}`,preloadedTraceIndex:r,preloadedRouteIndex:0,isThroughObstacle:!1}})},IWt=(e,t)=>e.minX<=t.maxX&&e.maxX>=t.minX&&e.minY<=t.maxY&&e.maxY>=t.minY,Yln=(e)=>({minX:e.center.x-e.diameter/2,maxX:e.center.x+e.diameter/2,minY:e.center.y-e.diameter/2,maxY:e.center.y+e.diameter/2}),n9r=(e)=>({minX:e.center.x-e.width/2,maxX:e.center.x+e.width/2,minY:e.center.y-e.height/2,maxY:e.center.y+e.height/2}),o9r=(e,t,n)=>{let o=Dw(e,n);return o.wireSegments.some((r)=>IWt(((i)=>({minX:Math.min(i.start.x,i.end.x)-i.width/2,maxX:Math.max(i.start.x,i.end.x)+i.width/2,minY:Math.min(i.start.y,i.end.y)-i.width/2,maxY:Math.max(i.start.y,i.end.y)+i.width/2}))(r),t))||o.viaSpans.some((r)=>IWt(Yln(r),t))},r9r=({routes:e,fixedRouteCopperSpatialIndex:t,center:n,regionSize:o,srj:r,connMap:i,colorMap:s,viaDiameter:a,traceWidth:c,obstacleMargin:l,effort:h})=>{let d=Vln(e,i),u={capacityMeshNodeId:"pipeline9_joint_drc_regular_fallback",center:n,width:o,height:o,availableZ:Array.from({length:r.layerCount},(f,y)=>y),portPoints:[],portPointsInPairs:[]},_=Cle(u,d);if(_.fixedRouteSectionsByConnectionName.size===0)return;if(!((f)=>{let y=Bln(f);return f.portPoints.every((x)=>MXt({point:x,bounds:y})==="on-boundary")})(_.nodeWithPortPoints))return;let p=[..._.fixedRouteSectionsByConnectionName.values()].flatMap((f)=>f.sourceRoutes).reduce((f,y)=>{let x=Dw(y,r);return Math.max(f,y.viaDiameter/2,...x.wireSegments.map((C)=>C.width/2),...x.viaSpans.map((C)=>C.diameter/2))},Math.max(c/2,a/2)),m={minX:n.x-o/2-l-p,maxX:n.x+o/2+l+p,minY:n.y-o/2-l-p,maxY:n.y+o/2+l+p},A=t.getRoutesOverlappingBounds(m),g=Lln({fixedObstacleRoutes:A,layerCount:r.layerCount,allowBlindAndBuriedVias:r.allowBlindAndBuriedVias});return{solver:new zln({nodeWithPortPoints:_.nodeWithPortPoints,colorMap:s,connMap:i,viaDiameter:a,traceWidth:c,obstacleMargin:l,effort:h,obstacles:[...r.obstacles,...g],layerCount:r.layerCount,allowBlindAndBuriedVias:r.allowBlindAndBuriedVias}),routes:e,regionalRoutes:d,problem:_,candidateBounds:m,localFixedObstacleRoutes:A,obstacleMargin:l,connMap:i,srj:r}},i9r=({solver:e,routes:t,regionalRoutes:n,problem:o,candidateBounds:r,localFixedObstacleRoutes:i,obstacleMargin:s,connMap:a,srj:c})=>{if(!e.solved||e.failed)return;let l=e.getOutput(),h=new Map(l.map((p)=>[p.connectionName,p])),d=new Map,u=new Set;for(let[p,m]of o.fixedRouteSectionsByConnectionName){let A=h.get(p);if(!A)return;d.set(m.sourceRoutes[0].preloadedTraceIndex,yZe(m,A));for(let g of m.sourceRoutes.slice(1))u.add(g.preloadedTraceIndex)}let _=n.flatMap((p,m)=>u.has(m)?[]:[{...d.get(m)??p,connectionName:t[m].connectionName}]);return(({candidateRoutes:p,fixedObstacleRoutes:m,obstacleMargin:A,connMap:g,candidateBounds:f,srj:y})=>{for(let x of p)for(let C of m)if(!Hln(x,C,g)&&Fln({left:x,right:C,clearance:A,leftBounds:f,layerCount:y.layerCount,allowBlindAndBuriedVias:y.allowBlindAndBuriedVias}))return!0;return!1})({candidateRoutes:_,fixedObstacleRoutes:i,obstacleMargin:s,connMap:a,candidateBounds:r,srj:c})?void 0:_},s9r=class extends Kr{params;candidateSearchBudget;phase="initialize";result;currentRoutes;currentErrors=[];bestRoutes;bestErrors=[];fixedRouteCopperSpatialIndex;routeIndexByTraceId=new Map;repairableErrors=[];passIndex=0;errorIndex=0;traceIndex=0;regionIndex=0;traceIds=[];repairCenter;stopB01SearchForError=!1;acceptedOnPass=!1;attemptedCandidateCount=0;acceptedCandidateCount=0;fallbackCandidateCount=0;candidateSearchCount=0;candidateSearchBudgetExhausted=!1;safeTraceLayerRepairSkippedForBudget=!1;preloadEligibleDrcIssueCount=0;b01Candidate;regularCandidate;safeTraceLayerSolver;constructor(e){super(),this.params=e,this.currentRoutes=e.routes,this.bestRoutes=e.routes,this.candidateSearchBudget=((t)=>{if(!Number.isInteger(t)||t<0)throw Error("Pipeline9 regional repair route count must be nonnegative");let n=Math.floor(7000/Math.max(1,t));return Math.max(16,Math.min(192,n))})(e.routes.length),this.MAX_ITERATIONS=64+8*this.candidateSearchBudget}initializeRepair(){let{initialErrors:e,drcEvaluator:t,newConnections:n,syntheticConnectionNames:o}=this.params;this.currentErrors=e??BO(t,this.currentRoutes),this.MAX_ITERATIONS+=16*this.currentErrors.length,this.preloadEligibleDrcIssueCount=this.currentErrors.filter((s)=>(({error:a,preloadRepairTraceIds:c})=>!!Oln(a).some((l)=>c.has(l))||(a.__collapsed_trace_participants??[]).flatMap((l)=>new Set(l.evaluationTraceIds).size>1?[l.solverTraceId]:[]).some((l)=>c.collidingFixedTraceIds?.has(l)))({error:s,preloadRepairTraceIds:this.params.preloadRepairTraceIds})).length;let r=ble({routes:this.currentRoutes,newConnections:n,syntheticConnectionNames:o}),i=this.params.allowTracePairRepair===!0&&this.currentErrors.some((s)=>((a,c)=>!(a.type!=="pcb_trace_error"||typeof a.pcb_via_id=="string"||Array.isArray(a.pcb_via_ids)&&a.pcb_via_ids.length>0)&&CWt({error:a,routeIndexByTraceId:c}).length===2)(s,r));this.preloadEligibleDrcIssueCount!==0||i?(this.fixedRouteCopperSpatialIndex=((s,a)=>{let c=new Map,l=(h,d)=>{let u=Math.floor(d.minX/4),_=Math.floor(d.maxX/4),p=Math.floor(d.minY/4),m=Math.floor(d.maxY/4);for(let A=u;A<=_;A++)for(let g=p;g<=m;g++){let f=`${A}:${g}`,y=c.get(f)??new Set;y.add(h),c.set(f,y)}};for(let h=0;h<s.length;h++){let d=Dw(s[h],a);for(let u of d.wireSegments)for(let _ of kln(u,4,1))l(h,n9r(_));for(let u of d.viaSpans)l(h,Yln(u))}return{getRoutesOverlappingBounds:(h)=>{let d=new Set,u=Math.floor(h.minX/4),_=Math.floor(h.maxX/4),p=Math.floor(h.minY/4),m=Math.floor(h.maxY/4);for(let A=u;A<=_;A++)for(let g=p;g<=m;g++)for(let f of c.get(`${A}:${g}`)??[])d.add(f);return[...d].sort((A,g)=>A-g).map((A)=>s[A]).filter((A)=>o9r(A,h,a))}}})(this.params.fixedObstacleRoutes,this.params.srj),this.phase="begin-pass"):this.finishRepair()}beginPass(){this.candidateSearchBudgetExhausted||this.passIndex>=2?this.phase="refine":(this.acceptedOnPass=!1,this.routeIndexByTraceId=ble({routes:this.currentRoutes,newConnections:this.params.newConnections,syntheticConnectionNames:this.params.syntheticConnectionNames}),this.repairableErrors=this.currentErrors.filter((e)=>(e.type==="pcb_trace_error"||e.type==="pcb_pad_trace_clearance_error"||e.type==="pcb_via_trace_clearance_error"||e.type==="pcb_via_clearance_error")&&typeof e.pcb_trace_id=="string"),this.errorIndex=0,this.phase="begin-error")}beginError(){if(this.candidateSearchBudgetExhausted||this.errorIndex>=this.repairableErrors.length)return void(this.phase="finish-pass");let e=this.repairableErrors[this.errorIndex];this.repairCenter=((t,n)=>{let o=typeof t.pcb_pad_id=="string"?t.pcb_pad_id:typeof t.pcb_trace_error_id=="string"?t.pcb_trace_error_id.match(/(pcb_(?:smtpad|plated_hole|hole|keepout)_\d+)$/)?.[1]:void 0;if(o){let r=n.obstacles.find((i)=>i.obstacleId===o||i.connectedTo[0]===o);if(r)return r.center}return((r)=>{let i=r.center;return i&&typeof i=="object"&&"x"in i&&"y"in i&&typeof i.x=="number"&&typeof i.y=="number"?{x:i.x,y:i.y}:void 0})(t)})(e,this.params.srj),this.traceIds=CWt({error:e,routeIndexByTraceId:this.routeIndexByTraceId}).slice(0,2),this.repairCenter?(this.bestRoutes=this.currentRoutes,this.bestErrors=this.currentErrors,this.traceIndex=0,this.regionIndex=0,this.stopB01SearchForError=!1,this.phase="prepare-b01"):this.errorIndex++}startChildSolver(e){let t=Math.floor(e.MAX_ITERATIONS)+1;if(!Number.isSafeInteger(t)||t<1)throw Error("Regional B01 child has an invalid iteration limit");this.MAX_ITERATIONS+=t,this.activeSubSolver=e}prepareB01Candidate(){if(this.stopB01SearchForError||this.candidateSearchBudgetExhausted||this.traceIndex>=this.traceIds.length)return void(this.phase="prepare-regional");let e=this.routeIndexByTraceId.get(this.traceIds[this.traceIndex]);if(e===void 0)return this.traceIndex++,void(this.regionIndex=0);if(this.regionIndex>=xWt.length)return void(this.bestErrors.length===0?this.stopB01SearchForError=!0:(this.traceIndex++,this.regionIndex=0));if(this.candidateSearchCount>=this.candidateSearchBudget)return this.candidateSearchBudgetExhausted=!0,void(this.phase="prepare-regional");let t=this.repairCenter;if(!t)throw Error("Regional B01 candidate has no repair center");let n=xWt[this.regionIndex];this.regionIndex++,this.candidateSearchCount++,this.b01Candidate=(({routes:o,fixedObstacleRoutes:r,routeIndex:i,center:s,regionSize:a,srj:c,connMap:l,colorMap:h,viaDiameter:d,traceWidth:u,obstacleMargin:_,effort:p})=>{let m=Vln(o,l),A=m[i];if(!A)return;let g={capacityMeshNodeId:`pipeline9_joint_drc_${i}_${a}`,center:s,width:a,height:a,availableZ:Array.from({length:c.layerCount},(C,b)=>b),portPoints:[],portPointsInPairs:[]},f=Cle(g,[A]),y=f.fixedRouteSectionsByConnectionName.get(A.connectionName);if(!y)return;let x=m.filter((C,b)=>b!==i);return{solver:new xZe({nodePortPoints:[f.nodeWithPortPoints],fixedHdRoutes:[...x,...r].map((C)=>({...C,rootConnectionName:l.getNetConnectedToId(C.rootConnectionName??C.connectionName)??C.rootConnectionName??C.connectionName})),connMap:l,colorMap:h,obstacles:c.obstacles,layerCount:c.layerCount,allowBlindAndBuriedVias:c.allowBlindAndBuriedVias,viaDiameter:d,traceWidth:u,obstacleMargin:_,effort:p,preserveTerminalPcbPortIds:!0,includeBoardObstacles:!0,enableRegionalFallback:!1,maxB01Rips:120}),routes:o,movableRoute:A,movableSection:y,routeIndex:i}})({...this.params,routes:this.currentRoutes,routeIndex:e,center:t,regionSize:n}),this.b01Candidate&&(this.startChildSolver(this.b01Candidate.solver),this.phase="route-b01")}stepB01Candidate(){let e=this.b01Candidate;if(!e)throw Error("Regional B01 has no active candidate");e.solver.step(),(e.solver.solved||e.solver.failed)&&(this.activeSubSolver=null,this.phase="validate-b01")}validateB01Candidate(){let e=this.b01Candidate;if(!e)throw Error("Regional B01 has no completed candidate");let t=(({solver:n,routes:o,movableRoute:r,movableSection:i,routeIndex:s})=>{if(!n.solved||n.failed)return;let a=n.routes.find((c)=>c.connectionName===r.connectionName);return a?{routes:o.map((c,l)=>l===s?{...yZe(i,a),connectionName:c.connectionName}:c),usedFallback:Number(n.stats.fallbackNodeCount??0)>0}:void 0})(e);if(this.b01Candidate=void 0,t){this.attemptedCandidateCount++,t.usedFallback&&this.fallbackCandidateCount++;let n=BO(this.params.drcEvaluator,t.routes);pce(n,this.bestErrors)&&(this.bestRoutes=t.routes,this.bestErrors=n),this.bestErrors.length===0&&(this.stopB01SearchForError=!0)}this.phase="prepare-b01"}prepareRegularCandidate(){if(this.bestRoutes!==this.currentRoutes||this.candidateSearchBudgetExhausted)return void(this.phase="commit-error");if(this.candidateSearchCount>=this.candidateSearchBudget)return this.candidateSearchBudgetExhausted=!0,void(this.phase="commit-error");this.candidateSearchCount++;let e=this.repairCenter,t=this.fixedRouteCopperSpatialIndex;if(!e||!t)throw Error("Regional fallback candidate is missing its fixed context");this.regularCandidate=r9r({...this.params,routes:this.currentRoutes,fixedRouteCopperSpatialIndex:t,center:e,regionSize:3}),this.regularCandidate?(this.startChildSolver(this.regularCandidate.solver),this.phase="route-regional"):this.phase="commit-error"}stepRegularCandidate(){let e=this.regularCandidate;if(!e)throw Error("Regional fallback has no active candidate");e.solver.step(),(e.solver.solved||e.solver.failed)&&(this.activeSubSolver=null,this.phase="validate-regional")}validateRegularCandidate(){let e=this.regularCandidate;if(!e)throw Error("Regional fallback has no completed candidate");let t=i9r(e);if(this.regularCandidate=void 0,t){this.attemptedCandidateCount++,this.fallbackCandidateCount++;let n=BO(this.params.drcEvaluator,t);pce(n,this.bestErrors)&&(this.bestRoutes=t,this.bestErrors=n)}this.phase="commit-error"}commitErrorRepair(){this.bestRoutes!==this.currentRoutes&&(this.currentRoutes=this.bestRoutes,this.currentErrors=this.bestErrors,this.acceptedCandidateCount++,this.acceptedOnPass=!0),this.errorIndex++,this.phase=this.candidateSearchBudgetExhausted?"finish-pass":"begin-error"}finishPass(){this.passIndex++,this.phase=!this.acceptedOnPass||this.currentErrors.length===0||this.candidateSearchBudgetExhausted?"refine":"begin-pass"}refineAcceptedRoutes(){if(this.acceptedCandidateCount>0&&this.currentErrors.length>0){let e=LJe({...this.params.srj,traces:void 0},this.currentRoutes,this.params.effort,1,this.params.connMap);if(e!==this.currentRoutes){let t=BO(this.params.drcEvaluator,e);bWt(t)<=bWt(this.currentErrors)&&pce(t,this.currentErrors)&&(this.currentRoutes=e,this.currentErrors=t)}}this.phase="prepare-safe-layer"}prepareSafeLayerRepair(){let e=this.currentErrors.some((t)=>t.type==="pcb_trace_error"||t.type==="pcb_pad_trace_clearance_error");this.safeTraceLayerRepairSkippedForBudget=e&&this.candidateSearchBudgetExhausted,e&&!this.candidateSearchBudgetExhausted?(this.safeTraceLayerSolver=new Y7({srj:{...this.params.srj,traces:void 0},hdRoutes:this.currentRoutes,connMap:this.params.connMap,effort:this.params.effort,drcEvaluator:this.params.drcEvaluator,maxIterations:8,enableLargeBoardBroadFallback:!1,enableTargetedErrorSweep:!1,enablePostSolveClearanceRelaxation:!1,enableSafeTraceLayerMoves:!0,enableViaInPadLayerMoves:!1}),this.startChildSolver(this.safeTraceLayerSolver),this.phase="route-safe-layer"):this.finishRepair()}stepSafeLayerRepair(){let e=this.safeTraceLayerSolver;if(!e)throw Error("Regional B01 has no safe trace-layer solver");if(e.step(),e.failed)throw Error(`Pipeline9 post-regional safe trace-layer repair failed: ${e.error??"unknown error"}`);e.solved&&(this.activeSubSolver=null,this.phase="validate-safe-layer")}validateSafeLayerRepair(){let e=this.safeTraceLayerSolver;if(!e)throw Error("Regional B01 has no completed safe trace-layer solver");let t=e.getOutput(),n=BO(this.params.drcEvaluator,t);pce(n,this.currentErrors)&&(this.currentRoutes=t,this.currentErrors=n),this.safeTraceLayerSolver=void 0,this.finishRepair()}finishRepair(){this.result={routes:this.currentRoutes,attemptedCandidateCount:this.attemptedCandidateCount,acceptedCandidateCount:this.acceptedCandidateCount,fallbackCandidateCount:this.fallbackCandidateCount,candidateSearchCount:this.candidateSearchCount,candidateSearchBudget:this.candidateSearchBudget,candidateSearchBudgetExhausted:this.candidateSearchBudgetExhausted,safeTraceLayerRepairSkippedForBudget:this.safeTraceLayerRepairSkippedForBudget,remainingDrcIssueCount:this.currentErrors.length,preloadEligibleDrcIssueCount:this.preloadEligibleDrcIssueCount,preloadRepairAttempted:this.preloadEligibleDrcIssueCount>0},this.activeSubSolver=null,this.stats={...this.result,routes:void 0},this.phase="done",this.solved=!0}_step(){switch(this.phase){case"initialize":return this.initializeRepair();case"begin-pass":return this.beginPass();case"begin-error":return this.beginError();case"prepare-b01":return this.prepareB01Candidate();case"route-b01":return this.stepB01Candidate();case"validate-b01":return this.validateB01Candidate();case"prepare-regional":return this.prepareRegularCandidate();case"route-regional":return this.stepRegularCandidate();case"validate-regional":return this.validateRegularCandidate();case"commit-error":return this.commitErrorRepair();case"finish-pass":return this.finishPass();case"refine":return this.refineAcceptedRoutes();case"prepare-safe-layer":return this.prepareSafeLayerRepair();case"route-safe-layer":return this.stepSafeLayerRepair();case"validate-safe-layer":return this.validateSafeLayerRepair();case"done":throw Error("Regional B01 repair was stepped after completion")}}computeProgress(){if(this.solved)return 1;let e=this.activeSubSolver?Math.max(0,Math.min(1,this.activeSubSolver.progress)):1;return Math.max(this.progress,Math.min(1,(Math.max(0,this.candidateSearchCount-1)+e)/(this.candidateSearchBudget+1)))}getResult(){if(!this.solved||this.failed||!this.result)throw Error("Pipeline9 regional B01 repair is not complete");return this.result}},a9r=class extends Kr{params;merger;result;phase="initialize";physicalSrj;movableRoutes=[];candidateRoutes;beforeErrorCount=0;constructor(e){super(),this.params=e,this.MAX_ITERATIONS=1000004}initializeMerge(){let{srj:e,routes:t,connMap:n,drcEvaluator:o,referenceResult:r}=this.params,i=r??o({traces:[],routes:t,hdRoutes:t});this.result={routes:t,referenceResult:i,referenceValidationCount:r===void 0?1:0,accepted:!1};let s=Array.isArray(i)?i:i.errors;this.beforeErrorCount=s.length;let a=s.filter((l)=>l.type==="pcb_via_clearance_error").flatMap(CZe);if(this.movableRoutes=t.filter((l)=>a.some((h)=>h===l.connectionName||h.startsWith(`${l.connectionName}_`))),this.movableRoutes.length===0)return this.phase="done",void(this.solved=!0);this.physicalSrj={...pS(e),traces:void 0};let c=new Set(this.movableRoutes);this.merger=new jJe({inputHdRoutes:this.movableRoutes,otherHdRoutes:t.filter((l)=>!c.has(l)),netByConnectionName:vbe(t,n),obstacles:this.physicalSrj.obstacles,layerCount:this.physicalSrj.layerCount,connMap:n,colorMap:{},preserveRouteEndpoints:!0}),this.MAX_ITERATIONS=this.merger.MAX_ITERATIONS+4,this.activeSubSolver=this.merger,this.phase="merge"}stepMerge(){let e=this.merger;if(!e)throw Error("Reported via merge has no active merger");if(e.step(),e.failed)throw Error(`Reported via merge failed: ${e.error}`);if(!e.solved)return;if(e.mergedViaHdRoutes.length!==this.movableRoutes.length)throw Error("Reported via merge changed the number of route pieces");let t=new Map(this.movableRoutes.map((n,o)=>[n,e.mergedViaHdRoutes[o]]));this.candidateRoutes=this.params.routes.map((n)=>t.get(n)??n),this.activeSubSolver=null,this.phase="physical-check"}validatePhysicalProposal(){let e=this.physicalSrj,t=this.candidateRoutes;if(!e||!t)throw Error("Reported via merge has no physical proposal");let n=this.params.routes,o=new Map(sV({srj:e,routes:n}).map(({key:r,severity:i})=>[r,i]));if(!sV({srj:e,routes:t}).every(({key:r,severity:i})=>o.has(r)&&i<=o.get(r)+0.00000001)||uqe({srj:e,previousRoutes:n,routes:t}).length>0)return this.phase="done",void(this.solved=!0);this.phase="reference-check"}validateReferenceProposal(){let e=this.result,t=this.candidateRoutes;if(!e||!t)throw Error("Reported via merge has no reference proposal");let n=this.params.drcEvaluator({traces:[],routes:t,hdRoutes:t});e.referenceValidationCount++,(Array.isArray(n)?n:n.errors).length<this.beforeErrorCount&&(this.result={...e,routes:t,referenceResult:n,accepted:!0}),this.phase="done",this.solved=!0}_step(){switch(this.phase){case"initialize":return this.initializeMerge();case"merge":return this.stepMerge();case"physical-check":return this.validatePhysicalProposal();case"reference-check":return this.validateReferenceProposal();case"done":throw Error("Reported via merge was stepped after completion")}}getResult(){if(!this.solved||this.failed||!this.result)throw Error("Reported via merge is not complete");return this.result}},c9r=[10,16],vWt=class extends Kr{params;budget;state={phase:"initialize"};result;reservedChildMaximum=0;constructor(e){super(),this.params=e,this.budget=e.budget??t9r,this.result={routes:e.routes,attemptedRegionCount:0,acceptedRegionCount:0,candidateAttemptCount:0,pathSearchNodeCount:0,referenceValidationCount:0,initialDrcIssueCount:void 0,finalDrcIssueCount:void 0,publishedDrcIssueCount:void 0,repaired:!1},this.MAX_ITERATIONS=16*this.budget.maxRegions+32}updateProgress(){let e=yWt(this.budget,this.result.acceptedRegionCount),t=this.state.phase==="negotiate"?this.state.solver:void 0,n=typeof t?.stats.pathSearchCalls=="number"?t.stats.pathSearchCalls:0,o=typeof t?.stats.pathSearchNodes=="number"?t.stats.pathSearchNodes:0;this.stats={...this.result,routes:void 0,phase:this.state.phase,candidateAttemptCount:this.result.candidateAttemptCount+n,pathSearchNodeCount:this.result.pathSearchNodeCount+o,allowedRegionCount:e.maxRegions,allowedCandidateAttemptCount:e.maxCandidateAttempts,allowedPathSearchNodeCount:e.maxPathSearchNodes};let r=Math.max(this.result.attemptedRegionCount/Math.max(1,this.budget.maxRegions),this.stats.candidateAttemptCount/Math.max(1,this.budget.maxCandidateAttempts),this.stats.pathSearchNodeCount/Math.max(1,this.budget.maxPathSearchNodes));this.progress=this.solved?1:Math.max(this.progress,Math.min(0.99,r))}startChild(e){if(this.activeSubSolver)throw Error("Regional repair started a child before the previous stage completed");this.activeSubSolver=e,this.reservedChildMaximum=e.MAX_ITERATIONS,this.MAX_ITERATIONS+=this.reservedChildMaximum+1}finish(){if(this.activeSubSolver)throw Error("Regional repair finished with an active child solver");this.solved=!0,this.state={phase:"done"}}publish(e,t){this.result.routes=e.currentRoutes,this.result.publishedDrcIssueCount=e.currentErrors.length,this.result.finalDrcIssueCount=e.currentErrors.length,this.result.repaired=t,this.finish()}initialize(){let{originalSrj:e,routes:t,syntheticConnectionNames:n}=this.params;if(e.traces?.length||n.size>0)return void this.finish();let o=Math.max(e.defaultObstacleMargin??0.2,e.minTraceToPadEdgeClearance??0,e.minTraceToHoleEdgeClearance??0,e.minViaEdgeToPadEdgeClearance??0),r=Math.max(e.minTraceWidth,e.minViaDiameter??0);for(let a of t){r=Math.max(r,a.traceThickness,a.viaDiameter);for(let c of a.route)r=Math.max(r,c.traceThickness??0)}let i=Math.max(0.5,r+o),s=(this.budget.regionSizes??c9r).filter((a)=>!Number.isFinite(i)||2*i<a);s.length!==0?this.state={phase:"initial-reference",context:{boundaryMargin:i,regionSizes:s}}:this.finish()}initialReference(e){let t=this.params.drcEvaluator({traces:[],routes:this.params.routes,hdRoutes:this.params.routes});this.result.referenceValidationCount++;let n=Array.isArray(t)?t:t.errors,o={...e,currentRoutes:this.params.routes,reference:t,currentErrors:n,initialErrors:n};if(this.result.initialDrcIssueCount=n.length,this.result.finalDrcIssueCount=n.length,this.result.publishedDrcIssueCount=n.length,n.length===0)return void this.finish();let r=new SO({originalSrj:this.params.originalSrj,routes:o.currentRoutes,drcEvaluator:(i)=>(this.result.referenceValidationCount++,this.params.drcEvaluator(i))});this.state={phase:"initial-projection",context:o,solver:r},this.startChild(r)}initialProjectionReference(e){let t=this.params.drcEvaluator({traces:[],routes:e.currentRoutes,hdRoutes:e.currentRoutes});this.result.referenceValidationCount++,e.reference=t,e.currentErrors=Array.isArray(t)?t:t.errors,this.result.finalDrcIssueCount=e.currentErrors.length,e.currentErrors.length!==0?this.state={phase:"prepare-regions",context:e}:this.publish(e,!0)}prepareRegions(e){let t={...pS(this.params.originalSrj),traces:void 0},n=new Map;for(let i of this.params.originalSrj.obstacles)for(let s of[i.obstacleId,i.circuitJsonMetadata?.pcb_smtpad_id,i.circuitJsonMetadata?.pcb_plated_hole_id,i.connectedTo[0]])typeof s=="string"&&n.set(s,i.center);let o=w$(e.currentRoutes),r={...e,srj:t,obstacleCenterById:n,currentRoutes:o,attemptedRegions:[],fixedViolations:new Map(sV({srj:t,routes:o}).map(({key:i,severity:s})=>[i,s]))};this.state={phase:"select-region",context:r}}selectRegion(e){let t=yWt(this.budget,this.result.acceptedRegionCount);if(this.result.attemptedRegionCount>=t.maxRegions||this.result.candidateAttemptCount>=t.maxCandidateAttempts||this.result.pathSearchNodeCount>=t.maxPathSearchNodes)return void(this.state={phase:"publish-partial",context:e});let n=(Array.isArray(e.reference)?e.reference:e.reference.errorsWithCenters??e.reference.errors).map((d)=>{let u=`overlap_${d.pcb_trace_id}_`,_=typeof d.pcb_pad_id=="string"?d.pcb_pad_id:typeof d.pcb_trace_error_id=="string"&&d.pcb_trace_error_id.startsWith(u)?d.pcb_trace_error_id.slice(u.length):void 0;return(_?e.obstacleCenterById.get(_):void 0)??d.center??d.pcb_center}).filter((d)=>d!==null&&typeof d=="object"&&("x"in d)&&("y"in d)&&typeof d.x=="number"&&typeof d.y=="number"&&Number.isFinite(d.x)&&Number.isFinite(d.y)),o;for(let d of e.regionSizes){let u=n.filter(({x:y,y:x})=>!e.attemptedRegions.some(({bounds:C,size:b})=>d===b&&y>=C.minX&&y<=C.maxX&&x>=C.minY&&x<=C.maxY)),_=u[0];if(!_)continue;let{x:p,x:m,y:A,y:g}=_,f=d-2*e.boundaryMargin;for(let y of u.slice(1)){let x=Math.min(p,y.x),C=Math.max(m,y.x),b=Math.min(A,y.y),I=Math.max(g,y.y);C-x>=f||I-b>=f||(p=x,m=C,A=b,g=I)}o={center:{x:(p+m)/2,y:(A+g)/2},size:d};break}if(!o)return void(this.state={phase:"publish-partial",context:e});let{center:r,size:i}=o,s=rfr({srj:e.srj,routes:e.currentRoutes,bounds:{minX:r.x-i/2,maxX:r.x+i/2,minY:r.y-i/2,maxY:r.y+i/2}});if(e.attemptedRegions.push({bounds:s.mutableBounds,size:i}),this.result.attemptedRegionCount++,s.routes.length===0)return;let a=new Set(e.currentErrors.flatMap(CZe)),c=s.routes.flatMap((d,u)=>[...a].some((_)=>_===d.connectionName||_.startsWith(`${d.connectionName}_`))?[u]:[]),l=Math.min(this.budget.maxCandidateAttemptsPerRegion??(this.budget.revisitChangedRegions?Math.ceil(t.maxCandidateAttempts/2):t.maxCandidateAttempts),t.maxCandidateAttempts-this.result.candidateAttemptCount),h=new cfr({srj:s.srj,routes:s.routes,bounds:s.mutableBounds,dirtyRouteIndices:c,isLocked:(d,u)=>s.lockedPointIndices[d][u],maxPathSearchCalls:l,maxPathSearchNodes:t.maxPathSearchNodes-this.result.pathSearchNodeCount,maxPathSearchNodesPerCall:this.budget.maxPathSearchNodesPerCall,pathHeuristicWeight:this.budget.pathHeuristicWeight,pathGridSizeScale:e.currentErrors.length>10?this.budget.pathGridSizeScale:void 0,allowLayerChanges:!0,traceClearance:_Q.traceClearance,viaClearance:_Q.viaClearance,viaHoleDiameter:this.params.viaHoleDiameter});this.state={phase:"negotiate",negotiation:{context:e,allowance:t,maxPathSearchCalls:l,region:s},solver:h},this.startChild(h)}completeNegotiation(e){let t=e.solver.getOutput(),{context:n,allowance:o,maxPathSearchCalls:r}=e.negotiation,{pathSearchCalls:i,pathSearchNodes:s}=t;if(this.budget.revisitChangedRegions&&t.unresolvedSpanCount>0&&i<r&&s<o.maxPathSearchNodes-this.result.pathSearchNodeCount&&n.regionSizes.sort((a,c)=>c-a),!Number.isSafeInteger(i)||i<0||i+this.result.candidateAttemptCount>this.budget.maxCandidateAttempts||!Number.isSafeInteger(s)||s<0||s+this.result.pathSearchNodeCount>this.budget.maxPathSearchNodes)throw Error("Pipeline9 bounded regional repair exceeded its work budget");this.result.candidateAttemptCount+=i,this.result.pathSearchNodeCount+=s,this.state={phase:"splice-region",negotiation:e.negotiation,repair:t}}spliceRegion(e){let{context:t,region:n}=e.negotiation,o=(({routes:i,region:s,repairedRoutes:a})=>{if(a.length!==s.routeMappings.length||s.lockedPointIndices.length!==a.length)throw Error("repair04 merge requires exactly one replacement for every extracted fragment");let c=new Map;for(let l=0;l<a.length;l+=1){let h=s.routeMappings[l],d=a[l];if(!i[h.sourceRouteIndex])throw Error("repair04 merge source route no longer exists");if(ifr(h.originalFragment,d,s.lockedPointIndices[l],s.mutableBounds,s.contextBounds,s.srj.layerCount),rl(h.originalFragment)===rl(d))continue;let u=c.get(h.sourceRouteIndex)??[];u.push({mapping:h,repaired:d}),c.set(h.sourceRouteIndex,u)}return i.map((l,h)=>{let d=c.get(h);if(!d)return l;d.sort((A,g)=>W4e(A.mapping.start)-W4e(g.mapping.start));let u=[],_=0;for(let{mapping:A,repaired:g}of d){let f=W4e(A.start),y=W4e(A.end);if(f<_-pr||y<f||y>l.route.length-1+pr)throw Error("repair04 merge received overlapping or stale fragment provenance");if(wXt(l,f,y)!==A.sourceGeometryKey)throw Error("repair04 merge rejected stale source geometry");mWe(u,uje(l,_,f)),mWe(u,g.route),_=y}mWe(u,uje(l,_,l.route.length-1));let p=new Set(d.flatMap(({mapping:A})=>A.originalFragment.vias.map((g)=>`${g.x},${g.y}`))),m=l.vias.filter((A)=>!p.has(`${A.x},${A.y}`)).map((A)=>structuredClone(A));for(let{repaired:A}of d)for(let g of A.vias)m.some((f)=>Math.abs(f.x-g.x)<=pr&&Math.abs(f.y-g.y)<=pr)||m.push(structuredClone(g));return{...l,route:sfr(u,l,d.map(({mapping:A})=>A)),vias:m}})})({routes:t.currentRoutes,region:n,repairedRoutes:e.repair.routes});if(o.every((i,s)=>i===t.currentRoutes[s]))return void(this.state={phase:"select-region",context:t});let r=new SO({originalSrj:this.params.originalSrj,routes:o,previousRoutes:t.currentRoutes,subdivideSegments:!0,drcEvaluator:(i)=>(this.result.referenceValidationCount++,this.params.drcEvaluator(i))});this.state={phase:"candidate-projection",context:t,solver:r},this.startChild(r)}prepareViaMerge(e){if(!this.params.connMap)return void(this.state={...e,phase:"candidate-physical"});let t=new a9r({srj:e.context.srj,routes:e.candidateRoutes,connMap:this.params.connMap,drcEvaluator:this.params.drcEvaluator});this.state={...e,phase:"via-merge",solver:t},this.startChild(t)}validateCandidate(e){let{context:t,candidateRoutes:n}=e,o=sV({srj:t.srj,routes:n});!o.every(({key:r,severity:i})=>t.fixedViolations.has(r)&&i<=t.fixedViolations.get(r)+0.00000001)||uqe({srj:t.srj,previousRoutes:t.currentRoutes,routes:n}).length>0?this.state={phase:"select-region",context:t}:this.state=e.candidateReference===void 0?{phase:"candidate-reference",context:t,candidateRoutes:n,candidateFixedViolations:o}:{phase:"accept-candidate",context:t,candidateRoutes:n,candidateFixedViolations:o,candidateReference:e.candidateReference}}referenceCandidate(e){let t=this.params.drcEvaluator({traces:[],routes:e.candidateRoutes,hdRoutes:e.candidateRoutes});this.result.referenceValidationCount++,this.state={...e,phase:"accept-candidate",candidateReference:t}}acceptCandidate(e){let{context:t,candidateReference:n}=e,o=Array.isArray(n)?n:n.errors;o.length>=t.currentErrors.length?this.state={phase:"select-region",context:t}:(t.currentRoutes=e.candidateRoutes,t.currentErrors=o,t.reference=n,t.fixedViolations=new Map(e.candidateFixedViolations.map(({key:r,severity:i})=>[r,i])),this.result.acceptedRegionCount++,this.budget.revisitChangedRegions&&(t.attemptedRegions.length=0),this.result.finalDrcIssueCount=o.length,o.length!==0?this.state={phase:"select-region",context:t}:this.publish(t,!0))}publishPartial(e){(({originalSrj:t,initialErrors:n,remainingErrors:o})=>{if(o.length>=n.length)return!1;let r=new Set(t.obstacles.flatMap((s)=>{let a=s.circuitJsonMetadata;return[a?.pcb_smtpad_id,a?.pcb_plated_hole_id].filter((c)=>typeof c=="string")})),i=[...n];for(let s of o){if(typeof s.pcb_trace_id!="string")return!1;let a=`overlap_${s.pcb_trace_id}_`,c=s.type==="pcb_trace_error"&&typeof s.pcb_trace_error_id=="string"&&s.pcb_trace_error_id.startsWith(a)?s.pcb_trace_error_id.slice(a.length):void 0,l=s.type==="pcb_pad_trace_clearance_error",h=l?s.pcb_pad_id:c;if(typeof h!="string"||!r.has(h))return!1;let d=i.findIndex((_)=>_.type===s.type&&_.pcb_trace_id===s.pcb_trace_id&&(l?_.pcb_pad_id===h:_.pcb_trace_error_id===s.pcb_trace_error_id));if(d===-1)return!1;let u=i.splice(d,1)[0];if(l&&(typeof s.actual_clearance!="number"||!Number.isFinite(s.actual_clearance)||typeof u.actual_clearance!="number"||!Number.isFinite(u.actual_clearance)||typeof s.minimum_clearance!="number"||!Number.isFinite(s.minimum_clearance)||s.minimum_clearance!==u.minimum_clearance||s.actual_clearance<u.actual_clearance))return!1}return!0})({originalSrj:this.params.originalSrj,initialErrors:e.initialErrors,remainingErrors:e.currentErrors})?this.publish(e,!1):this.state={phase:"prepare-independent-projection",context:e}}prepareIndependentProjection(e){let t=new SO({originalSrj:this.params.originalSrj,routes:this.params.routes,allowPartialRepair:!0,drcEvaluator:(n)=>(this.result.referenceValidationCount++,this.params.drcEvaluator(n))});this.state={phase:"independent-projection",context:e,solver:t},this.startChild(t)}prepareIndependentSubdivision(e){let t=new SO({originalSrj:this.params.originalSrj,routes:e.independentRoutes,allowPartialRepair:!0,subdivideSegments:!0,drcEvaluator:(n)=>(this.result.referenceValidationCount++,this.params.drcEvaluator(n))});this.state={phase:"independent-subdivision",context:e.context,solver:t},this.startChild(t)}prepareIndependentCoupled(e){let t=new SO({originalSrj:this.params.originalSrj,routes:e.independentRoutes,usePrecisionMargin:!0,drcEvaluator:(n)=>(this.result.referenceValidationCount++,this.params.drcEvaluator(n))});this.state={phase:"independent-coupled",context:e.context,solver:t},this.startChild(t)}referenceIndependent(e){let t=this.params.drcEvaluator({traces:[],routes:e.independentRoutes,hdRoutes:e.independentRoutes});this.result.referenceValidationCount++;let n=Array.isArray(t)?t:t.errors;this.result.routes=e.independentRoutes,this.result.publishedDrcIssueCount=n.length,this.result.finalDrcIssueCount=n.length,this.result.repaired=n.length===0,this.finish()}completeChild(){let e=this.state;switch(e.phase){case"initial-projection":{let t=e.solver.getOutput();t!==e.context.currentRoutes?(e.context.currentRoutes=t,this.state={phase:"initial-projection-reference",context:e.context}):this.state={phase:"prepare-regions",context:e.context};break}case"negotiate":this.completeNegotiation(e);break;case"candidate-projection":{let t=new SO({originalSrj:this.params.originalSrj,routes:e.solver.getOutput(),previousRoutes:e.context.currentRoutes,usePrecisionMargin:!0,drcEvaluator:(n)=>(this.result.referenceValidationCount++,this.params.drcEvaluator(n))});this.state={phase:"candidate-margin-projection",context:e.context,solver:t},this.startChild(t);break}case"candidate-margin-projection":this.state={phase:"prepare-via-merge",context:e.context,candidateRoutes:e.solver.getOutput()};break;case"via-merge":{let t=e.solver.getResult();this.result.referenceValidationCount+=t.referenceValidationCount,this.state={phase:"candidate-physical",context:e.context,candidateRoutes:t.routes,candidateReference:t.referenceResult};break}case"independent-projection":this.state={phase:"prepare-independent-subdivision",context:e.context,independentRoutes:e.solver.getOutput()};break;case"independent-subdivision":{let t=e.solver.getOutput();t===this.params.routes?this.finish():this.state={phase:"prepare-independent-coupled",context:e.context,independentRoutes:t};break}case"independent-coupled":this.state={phase:"independent-reference",context:e.context,independentRoutes:e.solver.getOutput()};break;default:throw Error(`Regional repair child completed during phase ${e.phase}`)}}_step(){let e=this.activeSubSolver;if(e)return e.step(),e.MAX_ITERATIONS>this.reservedChildMaximum&&(this.MAX_ITERATIONS+=e.MAX_ITERATIONS-this.reservedChildMaximum,this.reservedChildMaximum=e.MAX_ITERATIONS),e.failed?(this.failed=!0,this.error=e.error):e.solved&&(this.activeSubSolver=null,this.reservedChildMaximum=0,this.completeChild()),void this.updateProgress();let t=this.state;switch(t.phase){case"initialize":this.initialize();break;case"initial-reference":this.initialReference(t.context);break;case"initial-projection-reference":this.initialProjectionReference(t.context);break;case"prepare-regions":this.prepareRegions(t.context);break;case"select-region":this.selectRegion(t.context);break;case"splice-region":this.spliceRegion(t);break;case"prepare-via-merge":this.prepareViaMerge(t);break;case"candidate-physical":this.validateCandidate(t);break;case"candidate-reference":this.referenceCandidate(t);break;case"accept-candidate":this.acceptCandidate(t);break;case"publish-partial":this.publishPartial(t.context);break;case"prepare-independent-projection":this.prepareIndependentProjection(t.context);break;case"prepare-independent-subdivision":this.prepareIndependentSubdivision(t);break;case"prepare-independent-coupled":this.prepareIndependentCoupled(t);break;case"independent-reference":this.referenceIndependent(t);break;default:throw Error(`Regional repair has no active child during phase ${t.phase}`)}this.updateProgress()}getResult(){if(!this.solved||this.failed)throw Error("Pipeline9 bounded regional repair result requested before completion");return this.result}},l9r=[0.9,0.72],h9r=Array.from({length:16},(e,t)=>t*Math.PI/8),d9r=(e)=>e.type==="pcb_pad_trace_clearance_error"||e.type==="pcb_trace_error"&&!(Array.isArray(e.pcb_trace_ids)&&e.pcb_trace_ids.length>=2),u9r=(e)=>{if(typeof e.pcb_pad_id=="string")return e.pcb_pad_id;if(typeof e.pcb_trace_error_id=="string"){let n=e.pcb_trace_error_id.match(/(pcb_(?:smtpad|plated_hole|hole|keepout)_\d+)$/)?.[1];if(n)return n}return(typeof e.message=="string"?e.message:"").match(/(?:pcb_smtpad|pcb_plated_hole|pcb_hole|pcb_keepout)\[#?([^\]"]+)\]/)?.[1]},p9r=(e,t)=>{if(!t)return;let n=t.startsWith("pcb_")?t:`pcb_${t}`;return e.obstacles.find((o)=>o.obstacleId===n||o.connectedTo[0]===n)},m9r=({srj:e,pcbPortId:t,z:n,portPositionMap:o})=>{let r=Nh(n,e.layerCount),i=o.get(t),s=e.obstacles.filter((a)=>a.layers.includes(r)&&a.connectedTo.includes(t));return i?s.reduce((a,c)=>a?Math.hypot(c.center.x-i.x,c.center.y-i.y)<Math.hypot(a.center.x-i.x,a.center.y-i.y)?c:a:c,void 0):s[0]},_9r=({terminalObstacle:e,conflictingObstacle:t,traceRadius:n})=>{let o=Math.max(0,e.width/2-n),r=Math.max(0,e.height/2-n),i=(e.ccwRotationDegrees??0)*Math.PI/180;return l9r.flatMap((s)=>h9r.map((a)=>{let c={x:Math.cos(a)*o*s,y:Math.sin(a)*r*s},l=(d=i,{x:(h=c).x*Math.cos(d)-h.y*Math.sin(d),y:h.x*Math.sin(d)+h.y*Math.cos(d)});var h,d;return{x:e.center.x+l.x,y:e.center.y+l.y}})).sort((s,a)=>Math.hypot(a.x-t.center.x,a.y-t.center.y)-Math.hypot(s.x-t.center.x,s.y-t.center.y)).slice(0,16)},g9r=({routes:e,routeIndex:t,endpointIndex:n,point:o,bounds:r,collapseAdjacent:i})=>{let s=((_)=>_.map((p)=>({...p,route:p.route.map((m)=>({...m})),vias:p.vias.map((m)=>({...m}))})))(e),a=s[t];if(!a||a.route.length<2)return;let c=n===0?0:a.route.length-1,l=n===0?1:c-1,h=a.route[c],d=a.route[l];if(!h||!d||h.z!==d.z)return;let u=a.traceThickness/2;if(!(o.x-u<r.minX||o.x+u>r.maxX||o.y-u<r.minY||o.y+u>r.maxY)){if(a.route[c]={...h,...o},i){let _=n===0?l+1:l-1,p=a.route[_],m=a.vias.some((A)=>A.x===d.x&&A.y===d.y);if(!p||p.z!==h.z||d.pcb_port_id!==void 0||m)return;a.route[l]={...d,...o}}return s}},A9r=({srj:e,originalSrj:t,routes:n,newConnections:o,syntheticConnectionNames:r,drcEvaluator:i,effort:s=1})=>{let a=n,c=BO(i,a),l=0,h=0,d=c.length<20||n.length<=120?256:Math.max(32,Math.min(256,Math.floor(16384*Math.max(1,s)/n.length))),u=((_)=>{let p=new Map;for(let m of _.connections)for(let A of m.pointsToConnect)A.pcb_port_id&&p.set(A.pcb_port_id,A);return p})(t);for(let _=0;_<2;_++){let p=!1,m=ble({routes:a,newConnections:o,syntheticConnectionNames:r});for(let A of c.filter(d9r)){if(l>=d)break;if(typeof A.pcb_trace_id!="string")continue;let g=m.get(A.pcb_trace_id),f=p9r(e,u9r(A));if(g===void 0||!f)continue;let y=a[g],x=a,C=c;e:for(let b of[0,-1]){let I=b===0?y.route[0]:y.route.at(-1);if(!I||typeof I.pcb_port_id!="string")continue;let v=m9r({srj:t,pcbPortId:I.pcb_port_id,z:I.z,portPositionMap:u});if(!v||v===f)continue;let P=Math.hypot(f.width,f.height)/2+Math.hypot(v.width,v.height)/2+0.5;if(!(Math.hypot(I.x-f.center.x,I.y-f.center.y)>P))for(let M of _9r({terminalObstacle:v,conflictingObstacle:f,traceRadius:y.traceThickness/2}))for(let B of[!1,!0]){if(l>=d)break e;let T=g9r({routes:a,routeIndex:g,endpointIndex:b,point:M,bounds:e.bounds,collapseAdjacent:B});if(!T)continue;l++;let N=BO(i,T);pce(N,C)&&(x=T,C=N)}}x!==a&&(a=x,c=C,h++,p=!0)}if(!p||c.length===0)break}return{routes:a,attemptedCandidateCount:l,acceptedCandidateCount:h,remainingErrors:c}},f9r=["pcb_trace_error_id","pcb_error_id","pcb_via_trace_clearance_error_id","pcb_pad_trace_clearance_error_id"],XXe=(e,t)=>{let n=e,o=[...t].sort(([r],[i])=>i.length-r.length);for(let[r,i]of o)n=n.replaceAll(r,i);return n},SWt=(e,t)=>{let n=String(e.type??e.error_type??"unknown");if(n==="pcb_via_clearance_error")return((r,i)=>{let s=[...typeof r.pcb_trace_id=="string"?[r.pcb_trace_id]:[],...Array.isArray(r.pcb_trace_ids)?r.pcb_trace_ids.filter((h)=>typeof h=="string"):[]].map((h)=>XXe(h,i)).filter((h,d,u)=>u.indexOf(h)===d).sort(),a=r.center&&typeof r.center=="object"?r.center:r.pcb_center&&typeof r.pcb_center=="object"?r.pcb_center:void 0,c=typeof a?.x=="number"&&typeof a.y=="number"?{x:a.x,y:a.y}:void 0,l=typeof r.pcb_via_pair_net_relation=="string"?r.pcb_via_pair_net_relation:void 0;if(s.length!==0&&c&&l)return`pcb_via_clearance_error:${JSON.stringify({traceIds:s,center:c,netRelation:l})}`})(e,t);for(let r of f9r){let i=e[r];if(typeof i=="string")return`${n}:${XXe(i,t)}`}let o=Object.fromEntries(Object.entries(e).filter(([r,i])=>(r.endsWith("_id")||r.endsWith("_ids"))&&(typeof i=="string"||Array.isArray(i))).sort(([r],[i])=>r.localeCompare(i)).map(([r,i])=>[r,typeof i=="string"?XXe(i,t):i]));return`${n}:${JSON.stringify(o)}`},ZK=({errors:e,baselineErrors:t,originalTraceIdByPreparedTraceId:n=new Map})=>{let o=new Set(t.filter((r)=>!((i)=>typeof i.pcb_trace_error_id=="string"&&i.pcb_trace_error_id.startsWith("missing_connection_"))(r)).map((r)=>SWt(r,new Map)));return o.delete(void 0),e.filter((r)=>{let i=SWt(r,n);return i===void 0||!o.has(i)})},nCe=1.5,y9r=({errorsWithCenters:e,traces:t,layerCount:n,defaultViaDiameter:o,connMap:r})=>{let i=((a)=>a.flatMap((c)=>{if(c.type!=="pcb_trace_error"||!Array.isArray(c.pcb_port_ids)||c.pcb_port_ids.length<4)return[];let l=c.center;return l&&typeof l=="object"&&"x"in l&&"y"in l&&typeof l.x=="number"&&typeof l.y=="number"?[{x:l.x,y:l.y}]:[]}))(e),s=new Set;for(let a=0;a<t.length;a++){let c=t[a],l=xw(c,a,n,o,r);i.some((h)=>l.some((d)=>{let u=d.route.map((p)=>p.x),_=d.route.map((p)=>p.y);return Math.min(...u)<=h.x+nCe&&Math.max(...u)>=h.x-nCe&&Math.min(..._)<=h.y+nCe&&Math.max(..._)>=h.y-nCe}))&&s.add(c.pcb_trace_id)}return s},x9r=({routes:e,otherHdRoutes:t,obstacles:n,colorMap:o,layerCount:r,connMap:i})=>{let s=vbe([...e,...t],i),a=new jJe({inputHdRoutes:e,otherHdRoutes:t,netByConnectionName:s,obstacles:n,colorMap:o,layerCount:r,connMap:i});if(a.solve(),a.failed)throw Error(`Pipeline9 could not merge movable preloaded vias: ${a.error??"unknown error"}`);return a.getMergedViaHdRoutes()??e},PWt=({errors:e,circuitJson:t,newTraceIds:n})=>{let o=new Map(t.flatMap((r)=>r.type==="pcb_via"&&typeof r.pcb_via_id=="string"&&typeof r.pcb_trace_id=="string"?[[r.pcb_via_id,r.pcb_trace_id]]:[]));return e.map((r)=>{let i=typeof r.pcb_trace_id=="string"?r.pcb_trace_id:void 0,s=Array.isArray(r.pcb_trace_ids)?r.pcb_trace_ids.filter((d)=>typeof d=="string"):[],a=[...typeof r.pcb_via_id=="string"?[r.pcb_via_id]:[],...Array.isArray(r.pcb_via_ids)?r.pcb_via_ids.filter((d)=>typeof d=="string"):[]].filter((d,u,_)=>_.indexOf(d)===u);if(i&&typeof r.pcb_trace_error_id=="string"){let d=`overlap_${i}_`,u=r.pcb_trace_error_id.startsWith(d)?r.pcb_trace_error_id.slice(d.length):void 0,_=u!==void 0&&(a.includes(u)||o.has(u)&&!s.includes(u)),p=s.find((m)=>m!==i&&n.has(m))??(u&&!_?u:void 0);if(!n.has(i)&&a.length===0&&p&&n.has(p)){let m=[p,i,...s].filter((A,g,f)=>f.indexOf(A)===g);return{...r,pcb_trace_id:p,pcb_trace_ids:m,pcb_trace_error_id:`overlap_${p}_${i}`}}}let c=a.flatMap((d)=>{let u=o.get(d);return u?[u]:[]}).filter((d,u,_)=>_.indexOf(d)===u),l=c.length>0?c:s.filter((d)=>d!==i),h=l.find((d)=>n.has(d));if(h&&(!i||!n.has(i))){let d=[h,...i?[i]:[],...s,...l].filter((u,_,p)=>p.indexOf(u)===_);return{...r,pcb_trace_id:h,pcb_trace_ids:d,pcb_via_id:a[0],pcb_via_ids:a}}if(a.length>0){let d=[...i?[i]:[],...s,...l].filter((u,_,p)=>p.indexOf(u)===_);return{...r,pcb_trace_ids:d,pcb_via_id:a[0],pcb_via_ids:a}}return r})},Mbe=0.000000001,EWt=(e)=>{let t=new Set,n=[];for(let o of e)for(let r of o.route){if(r.route_type!=="via")continue;let i=`${r.x},${r.y},${r.from_layer},${r.to_layer}`;t.has(i)||(t.add(i),n.push({type:"pcb_via",pcb_via_id:`via_${n.length}`,pcb_trace_id:o.pcb_trace_id}))}return n},D7=({errors:e,circuitJson:t,evaluatedTraceIds:n})=>{let o=new Map(t.flatMap((r)=>r.type==="pcb_via"&&typeof r.pcb_via_id=="string"&&typeof r.pcb_trace_id=="string"?[[r.pcb_via_id,r.pcb_trace_id]]:[]));return e.map((r)=>{let i=[...typeof r.pcb_via_id=="string"?[r.pcb_via_id]:[],...Array.isArray(r.pcb_via_ids)?r.pcb_via_ids.filter((_)=>typeof _=="string"):[]],s=typeof r.pcb_trace_id=="string"?r.pcb_trace_id:void 0,a=s?`overlap_${s}_`:void 0,c=a&&typeof r.pcb_trace_error_id=="string"&&r.pcb_trace_error_id.startsWith(a)?r.pcb_trace_error_id.slice(a.length):void 0,l=typeof r.pcb_trace_error_id=="string"?r.pcb_trace_error_id.match(/_(via_\d+)$/)?.[1]:void 0,h=i.length!==0||!l||!o.has(l)||c&&n.has(c)?void 0:l,d=[...i,...h?[h]:[]].filter((_,p,m)=>m.indexOf(_)===p),u=[...typeof r.pcb_trace_id=="string"?[r.pcb_trace_id]:[],...Array.isArray(r.pcb_trace_ids)?r.pcb_trace_ids.filter((_)=>typeof _=="string"):[],...d.flatMap((_)=>{let p=o.get(_);return p?[p]:[]})].filter((_,p,m)=>m.indexOf(_)===p);return{...r,...d.length>0?{pcb_via_id:d[0],pcb_via_ids:d}:{},...d.length>0&&u.length>0?{pcb_trace_ids:u}:{}}})},MWt=(e,t)=>Math.abs(e.x-t.x)<=Mbe&&Math.abs(e.y-t.y)<=Mbe&&e.z===t.z,C9r=({trace:e,sectionGroup:t,syntheticConnectionName:n,connMap:o})=>{let r=t.routes;if(r.length===0)throw Error(`Pipeline9 cannot exactly repair empty preloaded section for trace "${e.pcb_trace_id}"`);let i=[];for(let h of r){if(i.length===0){i.push(...h.route);continue}let d=i.at(-1);if(h.route[0]&&MWt(d,h.route[0]))i.push(...h.route.slice(1));else{if(!h.route.at(-1)||!MWt(d,h.route.at(-1)))throw Error(`Pipeline9 cannot reconnect preloaded trace "${e.pcb_trace_id}" for exact repair`);i.push(...h.route.slice(0,-1).reverse())}}let s=t.routePositionStart===0,a=t.routePositionEnd===e.route.length-1,c=s?e.connectsTo?.[0]:null,l=a?e.connectsTo?.at(-1):null;return c&&i[0]&&(i[0]={...i[0],pcb_port_id:c}),l&&i.at(-1)&&(i[i.length-1]={...i.at(-1),pcb_port_id:l}),{connectionName:n,rootConnectionName:o.getNetConnectedToId(e.connection_name)??e.connection_name,traceThickness:Math.max(...r.map((h)=>h.traceThickness)),viaDiameter:Math.max(...r.map((h)=>h.viaDiameter)),route:i,vias:i.slice(0,-1).flatMap((h,d)=>{let u=i[d+1];return h.z!==u.z&&(_=h,p=u,Math.abs(_.x-p.x)<=Mbe&&Math.abs(_.y-p.y)<=Mbe)?[{x:u.x,y:u.y}]:[];var _,p})}},b9r=({trace:e,traceIndex:t,layerCount:n,defaultViaDiameter:o,connMap:r})=>{let i=e.route.flatMap((c,l)=>c.route_type==="through_obstacle"?[l]:[]),s=new Map,a=xw(e,t,n,o,r);for(let c of a){let{preloadedRoutePositionStart:l,preloadedRoutePositionEnd:h}=c;if(l===void 0||h===void 0)throw Error(`Pipeline9 preloaded trace section is missing route positions for "${e.pcb_trace_id}"`);if(e.route[l]?.route_type==="through_obstacle")continue;let d=i.filter((_)=>_<l).length,u=s.get(d)??{routePositionStart:l,routePositionEnd:h,routes:[]};u.routePositionStart=Math.min(u.routePositionStart,l),u.routePositionEnd=Math.max(u.routePositionEnd,h),u.routes.push(c),s.set(d,u)}return[...s.values()]},wWt=(e,t)=>e.map((n)=>{let o=Array.isArray(n.pcb_trace_ids)?n.pcb_trace_ids.filter((m)=>typeof m=="string"):[],r=typeof n.pcb_trace_id=="string"?n.pcb_trace_id:void 0,i=r?`overlap_${r}_`:void 0,s=i&&typeof n.pcb_trace_error_id=="string"&&n.pcb_trace_error_id.startsWith(i)?n.pcb_trace_error_id.slice(i.length):void 0,a=[...typeof n.pcb_via_id=="string"?[n.pcb_via_id]:[],...Array.isArray(n.pcb_via_ids)?n.pcb_via_ids.filter((m)=>typeof m=="string"):[]],c=s!==void 0&&a.includes(s),l=[r,...o,c?void 0:s].filter((m)=>typeof m=="string"),h=new Map;for(let m of l){let A=t.get(m)??m,g=h.get(A)??new Set;g.add(m),h.set(A,g)}let d=[...h].flatMap(([m,A])=>A.size>1?[{solverTraceId:m,evaluationTraceIds:[...A]}]:[]),u=r?t.get(r)??r:void 0,_=o.map((m)=>t.get(m)??m),p=s?c?s:t.get(s)??s:void 0;return u!==r||_.some((m,A)=>m!==o[A])||p!==s?{...n,...r?{pcb_trace_id:u}:{},...Array.isArray(n.pcb_trace_ids)?{pcb_trace_ids:_}:{},...u&&p?{pcb_trace_error_id:`overlap_${u}_${p}`}:{},...d.length>0?{__collapsed_trace_participants:d}:{}}:n}),I9r=(e,t)=>{let n=e.hdRoute.route[0],o=e.hdRoute.route.at(-1);return{name:e.syntheticConnectionName,rootConnectionName:e.hdRoute.rootConnectionName,__netConnectionName:e.originalTrace.connection_name,nominalTraceWidth:e.hdRoute.traceThickness,pointsToConnect:[{x:n.x,y:n.y,layer:Nh(n.z,t),pointId:`${e.syntheticConnectionName}:start`},{x:o.x,y:o.y,layer:Nh(o.z,t),pointId:`${e.syntheticConnectionName}:end`}]}},v9r=({originalTrace:e,repairedSections:t})=>{let n=[],o=0;for(let r of[...t].sort((i,s)=>i.routePositionStart-s.routePositionStart)){if(r.routePositionStart<o)throw Error(`Pipeline9 found overlapping repaired sections for preloaded trace "${e.pcb_trace_id}"`);n.push(...e.route.slice(o,r.routePositionStart),...r.route),o=r.routePositionEnd+1}return n.push(...e.route.slice(o)),{...e,__replaces_pcb_trace_id:e.pcb_trace_id,route:n}},S9r=class extends Kr{params;inputNewHdRoutes;inputUpdatedPreloadedTraces;movablePreloadedSections;fixedPreloadedObstacleRoutes;syntheticConnectionNames;exactRepairSolver;exactRepairParams;clearanceProjectionSolver;drcEvaluator;cachedReferenceDrcEvaluator;clearancePrecisionDrcEvaluator;clearancePrecisionIndexedDrcEvaluator;clearanceMarginDrcEvaluator;referenceDrcValidationCount=0;referenceDrcFalseNegativeCount=0;indexedDrcEvaluationCount=0;indexedDrcCacheHitCount=0;indexedDrcEvaluationTimeMs=0;indexedDrcCandidateCache=new Map;combinedOutput;currentPipelineStepIndex=0;regionalB01Params;boundedRegionalParams;boundedRegionalRepairStartedAt;initialBoundedRegionalRepairSolver;initialBoundedRegionalRepairStartedAt;pipelineDef=[{solverName:"clearanceProjectionSolver",createSolver:()=>{if(!this.exactRepairParams)throw Error("Pipeline9 clearance projection is missing its input");return this.clearanceProjectionSolver=new SO({originalSrj:this.params.originalSrj,routes:this.exactRepairParams.hdRoutes,drcEvaluator:this.cachedReferenceDrcEvaluator}),this.clearanceProjectionSolver},onSolved:()=>{}},{solverName:"initialBoundedRegionalRepairSolver",createSolver:()=>{if(!this.exactRepairParams||!this.cachedReferenceDrcEvaluator)throw Error("Pipeline9 initial regional repair is missing its input");return this.initialBoundedRegionalRepairStartedAt=performance.now(),this.initialBoundedRegionalRepairSolver=new vWt({connMap:this.params.connMap,originalSrj:{...this.params.originalSrj,connections:[...this.params.originalSrj.connections,...this.params.newConnections]},routes:this.clearanceProjectionSolver?.getOutput()??this.exactRepairParams.hdRoutes,viaHoleDiameter:this.params.defaultViaHoleDiameter,syntheticConnectionNames:this.syntheticConnectionNames,drcEvaluator:this.cachedReferenceDrcEvaluator,budget:fWt(this.exactRepairParams.hdRoutes.length,this.stats.initialJointDrcIssueCount,this.params.effort)}),this.initialBoundedRegionalRepairSolver},onSolved:()=>this.finishInitialBoundedRegionalRepair()},{solverName:"exactRepairSolver",createSolver:()=>{if(!this.exactRepairParams)throw Error("Pipeline9 exact repair stage is missing its input");return this.exactRepairSolver=new msn({...this.exactRepairParams,hdRoutes:this.clearanceProjectionSolver?.getOutput()??this.exactRepairParams.hdRoutes}),this.exactRepairSolver},onSolved:()=>this.finishExactRepair()},{solverName:"regionalB01RepairSolver",createSolver:()=>{if(!this.regionalB01Params)throw Error("Pipeline9 regional B01 stage is missing its input");return this.regionalB01RepairSolver=new s9r(this.regionalB01Params),this.regionalB01RepairSolver},onSolved:()=>this.finishRegionalB01Repair()},{solverName:"boundedRegionalRepairSolver",createSolver:()=>{if(!this.boundedRegionalParams)throw Error("Pipeline9 bounded regional stage is missing its input");return this.boundedRegionalRepairStartedAt=performance.now(),this.boundedRegionalRepairSolver=new vWt(this.boundedRegionalParams),this.boundedRegionalRepairSolver},onSolved:()=>this.finishBoundedRegionalRepair()}];boundedRegionalRepairSolver;regionalB01RepairSolver;cacheIndexedDrcResult(e,t){if(this.indexedDrcCandidateCache.size>=64){let n=this.indexedDrcCandidateCache.keys().next().value;n!==void 0&&this.indexedDrcCandidateCache.delete(n)}this.indexedDrcCandidateCache.set(e,t)}constructor(e){super(),this.params=e,this.inputNewHdRoutes=e.newHdRoutes,this.inputUpdatedPreloadedTraces=e.updatedPreloadedTraces;let t=e.updatedPreloadedTraces.filter((ie)=>e.mutatedPreloadedTraceIds.has(ie.pcb_trace_id)),n=AZe({connections:e.newConnections,originalConnections:e.originalSrj.connections,layerCount:e.layerCount,obstacles:e.obstacles,defaultViaHoleDiameter:e.defaultViaHoleDiameter,connMap:e.connMap}),o=n(e.newHdRoutes),r=new Set(o.map((ie)=>ie.pcb_trace_id)),i=(({originalPreloadedTraces:ie,mutatedPreloadedTraces:ce,newTraces:ue})=>{let de=new Set(ue.map((Ee)=>Ee.pcb_trace_id)),me=new Map(ce.map((Ee)=>[Ee.pcb_trace_id,Ee])),ge=new Set([...ie.map((Ee)=>Ee.pcb_trace_id),...de]),xe=new Map;return{routedTraces:[...ie.filter((Ee)=>de.has(Ee.pcb_trace_id)).map((Ee)=>{let Re=me.get(Ee.pcb_trace_id)??Ee,Me=`${Ee.pcb_trace_id}_preloaded`,_e=Me,ye=2;for(;ge.has(_e);)_e=`${Me}_${ye}`,ye+=1;return ge.add(_e),xe.set(_e,Ee.pcb_trace_id),{...Re,pcb_trace_id:_e,__replaces_pcb_trace_id:Ee.pcb_trace_id}}),...ce.filter((Ee)=>!de.has(Ee.pcb_trace_id)),...ue],originalPreloadedTraceIdByPreparedTraceId:xe}})({originalPreloadedTraces:e.originalSrj.traces??[],mutatedPreloadedTraces:t,newTraces:o}),s=e.originalSrj.minTraceToPadEdgeClearance??_Q.traceClearance??0.1,a=_Q.viaClearance??0.1,c=e.originalSrj.minViaHoleEdgeToViaHoleEdgeClearance??_Q.viaClearance??0.1,l=gCe({includeBoardClearance:!0,inputSrj:e.originalSrj,srjWithPointPairs:e.srjWithPointPairs,routedTraces:[],drcOptions:{traceClearance:s,viaClearance:c}}),h=new Set((e.originalSrj.traces??[]).map((ie)=>ie.pcb_trace_id)),d=D7({errors:l.errors,circuitJson:l.circuitJson,evaluatedTraceIds:h}),u=D7({errors:l.errorsWithCenters,circuitJson:l.circuitJson,evaluatedTraceIds:h}),_=gCe({includeBoardClearance:!0,inputSrj:e.originalSrj,srjWithPointPairs:e.srjWithPointPairs,routedTraces:i.routedTraces,drcOptions:{traceClearance:s,viaClearance:c}}),p=new Set(r$e(e.originalSrj.traces??[],i.routedTraces).map((ie)=>ie.pcb_trace_id)),m=D7({errors:_.errors,circuitJson:_.circuitJson,evaluatedTraceIds:p}),A=D7({errors:_.errorsWithCenters,circuitJson:_.circuitJson,evaluatedTraceIds:p}),g={..._,errors:ZK({errors:m,baselineErrors:d,originalTraceIdByPreparedTraceId:i.originalPreloadedTraceIdByPreparedTraceId}),errorsWithCenters:ZK({errors:A,baselineErrors:u,originalTraceIdByPreparedTraceId:i.originalPreloadedTraceIdByPreparedTraceId})},f=(({errors:ie,circuitJson:ce})=>{let ue=new Map(ce.flatMap((me)=>me.type==="pcb_via"&&typeof me.pcb_via_id=="string"&&typeof me.pcb_trace_id=="string"?[[me.pcb_via_id,me.pcb_trace_id]]:[])),de=new Set;for(let me of ie){let ge=typeof me.pcb_trace_id=="string"?me.pcb_trace_id:void 0,xe=[...typeof me.pcb_via_id=="string"?[me.pcb_via_id]:[],...Array.isArray(me.pcb_via_ids)?me.pcb_via_ids.filter((Re)=>typeof Re=="string"):[]];if(typeof me.pcb_trace_id=="string"&&de.add(me.pcb_trace_id),Array.isArray(me.pcb_trace_ids))for(let Re of me.pcb_trace_ids)typeof Re=="string"&&de.add(Re);if(typeof me.pcb_via_id=="string"){let Re=ue.get(me.pcb_via_id);Re&&de.add(Re)}if(Array.isArray(me.pcb_via_ids))for(let Re of me.pcb_via_ids){if(typeof Re!="string")continue;let Me=ue.get(Re);Me&&de.add(Me)}let Ee=ge?`overlap_${ge}_`:void 0;if(Ee&&typeof me.pcb_trace_error_id=="string"&&me.pcb_trace_error_id.startsWith(Ee)){let Re=me.pcb_trace_error_id.slice(Ee.length);xe.includes(Re)||de.add(Re)}}return de})({errors:g.errors,circuitJson:g.circuitJson}),y=new Map(e.updatedPreloadedTraces.map((ie)=>[ie.pcb_trace_id,ie])),x=new Set;for(let ie of f){let ce=i.originalPreloadedTraceIdByPreparedTraceId.get(ie);ce&&y.has(ce)?x.add(ce):!r.has(ie)&&y.has(ie)&&x.add(ie)}for(let ie of y9r({errorsWithCenters:g.errorsWithCenters,traces:e.updatedPreloadedTraces,layerCount:e.layerCount,defaultViaDiameter:e.defaultViaDiameter,connMap:e.connMap}))x.add(ie);this.movablePreloadedSections=[];for(let ie of x){let ce=y.get(ie);if(!ce)throw Error(`Pipeline9 cannot find preloaded trace "${ie}" selected for exact repair`);let ue=e.updatedPreloadedTraces.findIndex((me)=>me.pcb_trace_id===ie),de=b9r({trace:ce,traceIndex:ue,layerCount:e.layerCount,defaultViaDiameter:e.defaultViaDiameter,connMap:e.connMap});for(let[me,ge]of de.entries()){let xe=`pipeline9_preloaded_drc_${this.movablePreloadedSections.length}`;this.movablePreloadedSections.push({originalTrace:ce,originalRoutePositionStart:ge.routePositionStart,originalRoutePositionEnd:ge.routePositionEnd,syntheticConnectionName:xe,evaluationTraceId:`${ce.pcb_trace_id}__pipeline9_section_${me}`,hdRoute:C9r({trace:ce,sectionGroup:ge,syntheticConnectionName:xe,connMap:e.connMap})})}}this.syntheticConnectionNames=new Set(this.movablePreloadedSections.map((ie)=>ie.syntheticConnectionName));let C=new Set(this.movablePreloadedSections.map((ie)=>ie.originalTrace.pcb_trace_id));this.fixedPreloadedObstacleRoutes=e.updatedPreloadedTraces.flatMap((ie,ce)=>{let ue=xw(ie,ce,e.layerCount,e.defaultViaDiameter,e.connMap);return C.has(ie.pcb_trace_id)?ue.filter((de)=>{let me=de.preloadedRoutePositionStart;return me!==void 0&&ie.route[me]?.route_type==="through_obstacle"}):ue});let b=new Map;for(let[ie,ce]of this.movablePreloadedSections.entries()){let ue=ce.originalTrace.pcb_trace_id,de=b.get(ue)??[];de.push(ie),b.set(ue,de)}for(let ie of(({errors:ce,circuitJson:ue,originalTraceIdByPreparedTraceId:de})=>{let me=new Map(ue.flatMap((ge)=>ge.type==="pcb_via"&&typeof ge.pcb_via_id=="string"&&typeof ge.pcb_trace_id=="string"?[[ge.pcb_via_id,ge.pcb_trace_id]]:[]));return ce.flatMap((ge)=>{if(ge.type!=="pcb_via_clearance_error"||!Array.isArray(ge.pcb_via_ids)||typeof ge.actual_clearance!="number"||ge.actual_clearance>=0)return[];let xe=ge.pcb_via_ids.flatMap((Ee)=>{if(typeof Ee!="string")return[];let Re=me.get(Ee);return Re?[de.get(Re)??Re]:[]}).filter((Ee,Re,Me)=>Me.indexOf(Ee)===Re);return xe.length>0?[xe]:[]})})({errors:g.errors,circuitJson:g.circuitJson,originalTraceIdByPreparedTraceId:i.originalPreloadedTraceIdByPreparedTraceId})){let ce=ie.flatMap((me)=>b.get(me)??[]).filter((me,ge,xe)=>xe.indexOf(me)===ge);if(ce.length===0)continue;let ue=new Set(ce),de=x9r({routes:ce.map((me)=>this.movablePreloadedSections[me].hdRoute),otherHdRoutes:[...e.newHdRoutes,...this.fixedPreloadedObstacleRoutes,...this.movablePreloadedSections.flatMap((me,ge)=>ue.has(ge)?[]:[me.hdRoute])],obstacles:e.obstacles,colorMap:e.colorMap,layerCount:e.layerCount,connMap:e.connMap});for(let me=0;me<ce.length;me++)this.movablePreloadedSections[ce[me]].hdRoute=de[me]}let I=e.newHdRoutes.length+this.movablePreloadedSections.length,v=g.errors.length>=20&&I>120?Math.min(1,120*Math.max(1,e.effort)/I):1,P=g.errors.length>=200?v**2:v,M=Math.max(g.errors.length>=200?2:8,Math.floor(32*P)),B=Math.max(g.errors.length>=200?1:4,Math.floor(12*P));if(this.stats={initialJointDrcIssueCount:g.errors.length,baselineJointDrcIssueCount:l.errors.length,initialJointDrcIssueCountByType:g.errors.reduce((ie,ce)=>{let ue=String(ce.type??ce.error_type??"unknown");return ie[ue]=(ie[ue]??0)+1,ie},{}),movablePreloadedTraceCount:C.size,movablePreloadedSectionCount:this.movablePreloadedSections.length,exactRepairConfiguredMaxIterations:M,exactRepairConfiguredViaInPadMaxIterations:M,exactRepairConfiguredBroadMaxIterations:B},g.errors.length===0)return void(this.solved=!0);let T=new Set(this.movablePreloadedSections.map((ie)=>ie.originalTrace.pcb_trace_id)),N=t.filter((ie)=>!T.has(ie.pcb_trace_id)),D=new Map(this.movablePreloadedSections.map((ie)=>[ie.syntheticConnectionName,I9r(ie,e.layerCount)])),{traces:L,...H}=e.srjWithPointPairs,V={...H,connections:[...e.srjWithPointPairs.connections,...D.values()]},O=new Dle({...V,obstacles:e.originalSrj.obstacles,minTraceWidth:e.originalSrj.minTraceWidth,minViaDiameter:e.originalSrj.minViaDiameter??e.defaultViaDiameter},{connMap:e.connMap,traceClearance:s,viaClearance:a,includeTraceViaOwnerMetadata:!0,spatialCellSize:Math.max(e.defaultViaDiameter,e.originalSrj.minTraceWidth)+Math.max(s,a)}),U=O.evaluate(e.originalSrj.traces??[]),j=EWt(e.originalSrj.traces??[]),Y={...U,errors:D7({errors:U.errors,circuitJson:j,evaluatedTraceIds:h}),errorsWithCenters:D7({errors:U.errorsWithCenters,circuitJson:j,evaluatedTraceIds:h})},X,K=(ie)=>{let ce=ie.filter((_e)=>!this.syntheticConnectionNames.has(_e.connectionName)),ue=n(ce),de=s$e(ue,e.originalSrj.traces??[]),me=new Set,ge=new Map,xe=this.movablePreloadedSections.map((_e)=>{let ye=ie.find((Le)=>Le.connectionName===_e.syntheticConnectionName);if(!ye)throw Error(`Pipeline9 joint DRC repair lost preloaded section "${_e.syntheticConnectionName}"`);let Se=_e.originalTrace.pcb_trace_id;ge.set(_e.evaluationTraceId,Se);let Ne=!me.has(Se);return me.add(Se),{..._e.originalTrace,pcb_trace_id:_e.evaluationTraceId,...Ne?{__replaces_pcb_trace_id:Se}:{__replaces_pcb_trace_id:void 0},route:V4(ye,e.layerCount,{defaultViaHoleDiameter:e.defaultViaHoleDiameter,obstacles:e.obstacles,connMap:e.connMap})}}),Ee=new Map;for(let _e=0;_e<ue.length;_e++)Ee.set(de[_e].pcb_trace_id,ue[_e].pcb_trace_id);for(let _e of this.movablePreloadedSections)Ee.set(_e.evaluationTraceId,`${_e.syntheticConnectionName}_0`);let Re=new Set(Ee.values()),Me=[...N,...xe,...de];return{evaluatedTraces:r$e(e.originalSrj.traces??[],Me),movableTraceIds:Re,originalTraceIdByEvaluationTraceId:ge,routedTraces:Me,solverTraceIdByEvaluationTraceId:Ee}},J=({errors:ie,errorsWithCenters:ce,circuitJson:ue,movableTraceIds:de,solverTraceIdByEvaluationTraceId:me})=>{let ge=ue.map((xe)=>{if(!("pcb_trace_id"in xe)||typeof xe.pcb_trace_id!="string")return xe;let Ee=me.get(xe.pcb_trace_id);return Ee?{...xe,pcb_trace_id:Ee}:xe});return{errors:PWt({errors:wWt(ie,me),circuitJson:ge,newTraceIds:de}),errorsWithCenters:PWt({errors:wWt(ce,me),circuitJson:ge,newTraceIds:de})}},ee={source:Ep(e.originalSrj===e.srjWithPointPairs?e.originalSrj:{...e.originalSrj,connections:[...e.srjWithPointPairs.connections,...e.originalSrj.connections]}),route:Ep(e.srjWithPointPairs)},se=({routes:ie,hdRoutes:ce},ue=!0)=>{let de=ie??ce;if(!de)throw Error("Pipeline9 reference DRC repair requires HD routes");let me=K(de),ge=gCe({includeBoardClearance:!0,connectivityMaps:ee,inputSrj:e.originalSrj,srjWithPointPairs:e.srjWithPointPairs,routedTraces:me.routedTraces,drcOptions:{traceClearance:s,viaClearance:c,includeTraceContinuity:ue}}),xe=new Set(me.evaluatedTraces.map((ye)=>ye.pcb_trace_id)),Ee=D7({errors:ge.errors,circuitJson:ge.circuitJson,evaluatedTraceIds:xe}),Re=D7({errors:ge.errorsWithCenters,circuitJson:ge.circuitJson,evaluatedTraceIds:xe}),Me=ZK({errors:Ee,baselineErrors:d,originalTraceIdByPreparedTraceId:me.originalTraceIdByEvaluationTraceId}),_e=ZK({errors:Re,baselineErrors:u,originalTraceIdByPreparedTraceId:me.originalTraceIdByEvaluationTraceId});return J({errors:Me,errorsWithCenters:_e,circuitJson:ge.circuitJson,movableTraceIds:me.movableTraceIds,solverTraceIdByEvaluationTraceId:me.solverTraceIdByEvaluationTraceId})},ne=({routes:ie,hdRoutes:ce})=>{let ue=ie??ce;if(!ue)throw Error("Pipeline9 cached reference DRC requires HD routes");let de=JSON.stringify(ue);if(X?.candidateKey===de)return X.result;this.referenceDrcValidationCount+=1;let me=se({traces:[],routes:ue,hdRoutes:ue});return X={candidateKey:de,result:me},me};ne.inputMode="routes-only",this.cachedReferenceDrcEvaluator=ne,this.clearancePrecisionDrcEvaluator=({routes:ie,hdRoutes:ce})=>se({traces:[],routes:ie,hdRoutes:ce},!1);let re=(ie)=>{let ce=K(ie);return OJe(e.srjWithPointPairs,ce.routedTraces,{minTraceWidth:e.originalSrj.minTraceWidth,minViaDiameter:e.originalSrj.minViaDiameter,originalSrj:e.originalSrj,includeOriginalConnections:!0,connectivityMaps:ee})},Z;this.clearanceMarginDrcEvaluator=(ie,ce,ue)=>(Z?.routes!==ue&&(Z={routes:ue,circuitJson:re(ue)}),(({circuitJson:de,originalCircuitJson:me,targets:ge})=>{let xe=new Map(de.filter((ye)=>ye.type==="pcb_trace").map((ye)=>[ye.pcb_trace_id,ye])),Ee=new Map(me.filter((ye)=>ye.type==="pcb_trace").map((ye)=>[ye.pcb_trace_id,ye])),Re=de.filter((ye)=>ye.type==="pcb_via"),Me=new Map;for(let ye of de)ye.type==="pcb_via"?Me.set(ye.pcb_via_id,ye):ye.type==="pcb_smtpad"?Me.set(ye.pcb_smtpad_id,ye):ye.type==="pcb_plated_hole"&&Me.set(ye.pcb_plated_hole_id,ye);let _e=[];for(let ye of ge){let Se=ye.type==="pcb_via_trace_clearance_error",Ne=Se?ye.pcb_via_id:ye.pcb_pad_id;if(!Se&&ye.type!=="pcb_pad_trace_clearance_error"||typeof ye.pcb_trace_id!="string"||typeof Ne!="string"||typeof ye.minimum_clearance!="number"||!Number.isFinite(ye.minimum_clearance)||ye.minimum_clearance<=0)throw Error("Pipeline9 clearance margin requires a valid target pair");let Le=Ee.get(ye.pcb_trace_id),nt=me.find((kt)=>Se?kt.type==="pcb_via"&&kt.pcb_via_id===Ne:kt.type==="pcb_smtpad"&&kt.pcb_smtpad_id===Ne||kt.type==="pcb_plated_hole"&&kt.pcb_plated_hole_id===Ne);if(!Le||!nt)throw Error(`Pipeline9 clearance margin has no original target ${Ne}/${ye.pcb_trace_id}`);let dt=xe.get(ye.pcb_trace_id),rt=Me.get(Ne);if(Se){if(nt.type!=="pcb_via"||typeof nt.pcb_trace_id!="string")throw Error("Pipeline9 clearance margin requires the original via owner");let kt=Ee.get(nt.pcb_trace_id);if(!kt)throw Error("Pipeline9 clearance margin lost the original via owner");let Lt=kt.route.filter((Fe)=>Fe.route_type==="via"),Bt=Lt.map((Fe,tt)=>({segment:Fe,index:tt})).filter(({segment:Fe})=>Fe.x===nt.x&&Fe.y===nt.y&&nt.layers.includes(Fe.from_layer)&&nt.layers.includes(Fe.to_layer)).filter(({segment:Fe},tt,Je)=>Je.findIndex(($e)=>$e.segment.from_layer===Fe.from_layer&&$e.segment.to_layer===Fe.to_layer)===tt);if(Bt.length===0)throw Error("Pipeline9 clearance margin lost the original via transition");if(Bt.length!==1)return{status:"unsupported-identity"};let xt=Bt[0].index,Yt=xe.get(nt.pcb_trace_id),ut=Yt?.route.filter((Fe)=>Fe.route_type==="via");if(!ut||ut.length!==Lt.length||ut.some((Fe,tt)=>Fe.from_layer!==Lt[tt].from_layer||Fe.to_layer!==Lt[tt].to_layer))return{status:"unsupported-identity"};let Ze=ut[xt];rt=Re.filter((Fe)=>Fe.x===Ze.x&&Fe.y===Ze.y&&Fe.layers.join()===nt.layers.join()).reduce((Fe,tt)=>!Fe||tt.outer_diameter>Fe.outer_diameter?tt:Fe,void 0)}if(!(dt&&rt&&("x"in rt)&&("y"in rt)))return{status:"unsupported-identity"};let pt={minClearance:ye.minimum_clearance+1},ct=Se?gnn([dt,rt],pt):_nn([dt,rt],pt),Ct=ye.minimum_clearance+Ebe;for(let kt of ct){let Lt=kt.actual_clearance;if(typeof Lt!="number"||!Number.isFinite(Lt))throw Error("Pipeline9 clearance margin requires a finite measurement");Lt>=Ct||_e.push({...ye,...rt.type==="pcb_via"?{pcb_via_id:rt.pcb_via_id,pcb_via_ids:[rt.pcb_via_id]}:{},actual_clearance:Lt,minimum_clearance:Ct,center:{x:rt.x,y:rt.y}})}}return{status:"measured",errors:_e}})({circuitJson:re(ie),originalCircuitJson:Z.circuitJson,targets:ce})),this.clearancePrecisionIndexedDrcEvaluator=({routes:ie,hdRoutes:ce})=>{let ue=ie??ce;if(!ue)throw Error("Pipeline9 clearance ranking requires HD routes");let de=K(ue);return O.evaluate(de.evaluatedTraces)};let te=({routes:ie,hdRoutes:ce})=>{let ue=ie??ce;if(!ue)throw Error("Pipeline9 joint DRC repair requires HD routes");let de=JSON.stringify(ue),me=this.indexedDrcCandidateCache.get(de);if(me!==void 0)return this.indexedDrcCacheHitCount+=1,me;let ge=performance.now();this.indexedDrcEvaluationCount+=1;let xe=K(ue),Ee=O.evaluate(xe.evaluatedTraces),Re=EWt(xe.evaluatedTraces),Me=new Set(xe.evaluatedTraces.map((nt)=>nt.pcb_trace_id)),_e=D7({errors:Ee.errors,circuitJson:Re,evaluatedTraceIds:Me}),ye=D7({errors:Ee.errorsWithCenters,circuitJson:Re,evaluatedTraceIds:Me}),Se=ZK({errors:_e,baselineErrors:Y.errors,originalTraceIdByPreparedTraceId:xe.originalTraceIdByEvaluationTraceId}),Ne=ZK({errors:ye,baselineErrors:Y.errorsWithCenters,originalTraceIdByPreparedTraceId:xe.originalTraceIdByEvaluationTraceId});if(Se.length===0){let nt=this.referenceDrcValidationCount,dt=ne({traces:[],routes:ue,hdRoutes:ue}),rt=Array.isArray(dt)?dt:dt.errors;return this.referenceDrcValidationCount>nt&&rt.length>0&&(this.referenceDrcFalseNegativeCount+=1),this.indexedDrcEvaluationTimeMs+=performance.now()-ge,this.cacheIndexedDrcResult(de,dt),dt}let Le=J({errors:Se,errorsWithCenters:Ne,circuitJson:Re,movableTraceIds:xe.movableTraceIds,solverTraceIdByEvaluationTraceId:xe.solverTraceIdByEvaluationTraceId});return this.indexedDrcEvaluationTimeMs+=performance.now()-ge,this.cacheIndexedDrcResult(de,Le),Le};te.inputMode="routes-only",this.drcEvaluator=te,this.exactRepairParams={srj:V,hdRoutes:[...e.newHdRoutes,...this.movablePreloadedSections.map((ie)=>ie.hdRoute)],connMap:e.connMap,effort:e.effort,viaHoleDiameter:e.defaultViaHoleDiameter,drcEvaluator:te,viaInPadDrcEvaluator:te,maxIterations:M,enableBroadFallback:!1,enableLargeBoardBroadFallback:!1,enableTargetedErrorSweep:!0,enableTraceViaOwnerTargeting:!0,enablePostSolveClearanceRelaxation:!1,enableSafeTraceLayerMoves:!0,enableViaInPadLayerMoves:e.originalSrj.allowViaInPad??!1,viaInPadMaxIterations:M,broadMaxIterations:B,broadPassMultiplier:3*P},(e.updatedPreloadedTraces.length>0||(e.originalSrj.traces?.length??0)>0)&&this.pipelineDef.splice(1,1),(e.updatedPreloadedTraces.length>0||!e.obstacles.some((ie)=>ie.isNonPlatedHole))&&(this.currentPipelineStepIndex=1),this.activeSubSolver=this.pipelineDef[this.currentPipelineStepIndex].createSolver(),this.MAX_ITERATIONS=this.activeSubSolver.MAX_ITERATIONS+1}getSolverName(){return"Pipeline9JointDrcRepairSolver"}_step(){let e=this.pipelineDef[this.currentPipelineStepIndex];if(e){if(this.activeSubSolver){let t=this.activeSubSolver;return t.step(),this.MAX_ITERATIONS=Math.max(this.MAX_ITERATIONS,this.iterations+t.MAX_ITERATIONS-t.iterations+2),void(t.failed?(this.failed=!0,this.error=t.error,this.activeSubSolver=null):t.solved&&(e.onSolved(),this.activeSubSolver=null,this.currentPipelineStepIndex++))}this.activeSubSolver=e.createSolver(),this.MAX_ITERATIONS=Math.max(this.MAX_ITERATIONS,this.iterations+this.activeSubSolver.MAX_ITERATIONS+2)}else this.solved=!0}computeProgress(){return this.solved?1:Math.max(this.progress,(this.currentPipelineStepIndex+(this.activeSubSolver?.progress??0))/this.pipelineDef.length)}getCurrentPhase(){return this.pipelineDef[this.currentPipelineStepIndex]?.solverName??"none"}finishInitialBoundedRegionalRepair(){if(!this.initialBoundedRegionalRepairSolver?.solved||this.initialBoundedRegionalRepairStartedAt===void 0||!this.cachedReferenceDrcEvaluator)throw Error("Pipeline9 initial regional repair is not complete");let e=this.initialBoundedRegionalRepairSolver.getResult();if(this.stats={...this.stats,initialBoundedRegionalRepairAccepted:!1,initialBoundedRegionalRepairAttemptedRegionCount:e.attemptedRegionCount,initialBoundedRegionalRepairAcceptedRegionCount:e.acceptedRegionCount,initialBoundedRegionalRepairCandidateAttemptCount:e.candidateAttemptCount,initialBoundedRegionalRepairPathSearchNodeCount:e.pathSearchNodeCount,initialBoundedRegionalRepairReferenceValidationCount:e.referenceValidationCount,initialBoundedRegionalRepairPublishedDrcIssueCount:e.publishedDrcIssueCount,initialBoundedRegionalRepairTimeMs:performance.now()-this.initialBoundedRegionalRepairStartedAt},e.publishedDrcIssueCount!==0)return;let t=this.cachedReferenceDrcEvaluator({traces:[],routes:e.routes,hdRoutes:e.routes});if((Array.isArray(t)?t:t.errors).length!==0)throw Error("Pipeline9 initial regional repair lost its zero-DRC validation");this.combinedOutput=e.routes,this.stats={...this.stats,finalDrcIssueCount:0,initialBoundedRegionalRepairAccepted:!0,boundedRegionalRepairMaxRegions:this.initialBoundedRegionalRepairSolver.budget.maxRegions,boundedRegionalRepairMaxCandidateAttempts:this.initialBoundedRegionalRepairSolver.budget.maxCandidateAttempts,boundedRegionalRepairMaxPathSearchNodes:this.initialBoundedRegionalRepairSolver.budget.maxPathSearchNodes,boundedRegionalRepairAttemptedRegionCount:e.attemptedRegionCount,boundedRegionalRepairAcceptedRegionCount:e.acceptedRegionCount,boundedRegionalRepairCandidateAttemptCount:e.candidateAttemptCount,boundedRegionalRepairPathSearchNodeCount:e.pathSearchNodeCount,boundedRegionalRepairReferenceValidationCount:e.referenceValidationCount,boundedRegionalRepairRepaired:e.repaired,boundedRegionalRepairPublishedDrcIssueCount:e.publishedDrcIssueCount,initialBoundedRegionalRepairAddedViaCount:Math.max(0,e.routes.reduce((n,o)=>n+o.vias.length,0)-this.inputNewHdRoutes.reduce((n,o)=>n+o.vias.length,0)),terminalEscapeCandidateCount:0,terminalEscapeAcceptedCount:0,regionalB01RepairAttempted:!1,regionalB01RepairCandidateSearchCount:0,regionalB01RepairCandidateSearchBudget:0,clearancePrecisionCandidateCount:0,clearancePrecisionCandidateValidationCount:0,clearancePrecisionReferenceValidationCount:0,clearancePrecisionRepaired:!1,referenceDrcValidationCount:this.referenceDrcValidationCount,referenceDrcFalseNegativeCount:this.referenceDrcFalseNegativeCount,indexedDrcEvaluationCount:this.indexedDrcEvaluationCount,indexedDrcCacheHitCount:this.indexedDrcCacheHitCount,indexedDrcEvaluationTimeMs:this.indexedDrcEvaluationTimeMs,indexedDrcCandidateCacheSize:this.indexedDrcCandidateCache.size,indexedDrcCandidateCacheCapacity:64},this.solved=!0}finishExactRepair(){if(!this.exactRepairSolver)throw Error("Pipeline9 post-exact repair requires the exact solver");let e=this.exactRepairSolver.getOutput(),t=this.exactRepairSolver.stats.finalDrcIssueCount,n=typeof t=="number"&&Number.isFinite(t)&&t>=0?t:void 0,o,r=0,i=0,s=0,a=!1,c=this.cachedReferenceDrcEvaluator({traces:[],routes:e,hdRoutes:e}),l=Array.isArray(c)?c:c.errors;if(o=l.length,l.length>0){let u=(({srj:_,routes:p,newConnections:m,syntheticConnectionNames:A,connMap:g,indexedDrcEvaluator:f,candidateDrcEvaluator:y,marginDrcEvaluator:x,drcEvaluator:C,initialErrors:b,initialErrorsWithCenters:I=b})=>{let v={routes:p,attemptedCandidateCount:0,candidateValidationCount:0,referenceValidationCount:0,repaired:!1};if((_.traces?.length??0)>0||A.size>0)return v;if(b.length===0)return v;let P=ble({routes:p,newConnections:m,syntheticConnectionNames:A}),M=new Map;for(let Y of _.obstacles)for(let X of[Y.obstacleId,Y.circuitJsonMetadata?.pcb_smtpad_id,Y.circuitJsonMetadata?.pcb_plated_hole_id,Y.connectedTo[0]])typeof X=="string"&&M.set(X,Y.center);let B=WXe({errors:b,errorsWithCenters:I,routeIndexByTraceId:P,padPositionById:M});if(!B)return v;let T=B,N=B.errors,D=B.errors.map((Y)=>({...Y,minimum_clearance:Y.minimum_clearance+Ebe})),L=AWt(D);if(L===void 0)return v;let H={errors:D,deficit:L},V=p,O=0,U=0,j=0;for(let Y=0;Y<8;Y++){let X=new Map;for(let ie of[...H.errors,...T.errors]){let ce=JSON.stringify([ie.type,ie.pcb_trace_id,ie.pcb_pad_id,ie.pcb_via_id]);X.set(ce,ie)}let K=[...X.values()],J;for(let ie of ZIr){let ce=ib(V);if(!rKe(_,ce,K,P,ie,g,!0,!0,!0,!1))continue;let ue=n9(ce);O++;let de=f({traces:[],routes:ue,hdRoutes:ue}),me=AWt(Array.isArray(de)?de:de.errors);me!==void 0&&(!J||me<J.deficit)&&(J={routes:ue,deficit:me})}if(!J)break;U++;let ee=y({traces:[],routes:J.routes,hdRoutes:J.routes}),se=Array.isArray(ee)?ee:ee.errors,ne=WXe({errors:se,errorsWithCenters:Array.isArray(ee)?ee:ee.errorsWithCenters??ee.errors,routeIndexByTraceId:P,padPositionById:M});if(!ne)break;let re=x(J.routes,N,p);if(re.status==="unsupported-identity")break;let Z=re.errors,te=WXe({errors:Z,errorsWithCenters:Z,routeIndexByTraceId:P,padPositionById:M});if(!te)break;if(se.length===0&&Z.length===0){j++;let ie=C({traces:[],routes:J.routes,hdRoutes:J.routes});if((Array.isArray(ie)?ie:ie.errors).length===0)return{routes:J.routes,attemptedCandidateCount:O,candidateValidationCount:U,referenceValidationCount:j,repaired:!0};break}if(ne.deficit+te.deficit>=T.deficit+H.deficit-0.000000001)break;V=J.routes,T=ne,H=te}return{routes:p,attemptedCandidateCount:O,candidateValidationCount:U,referenceValidationCount:j,repaired:!1}})({srj:this.params.srj,routes:e,newConnections:this.params.newConnections,syntheticConnectionNames:this.syntheticConnectionNames,connMap:this.params.connMap,indexedDrcEvaluator:this.clearancePrecisionIndexedDrcEvaluator,candidateDrcEvaluator:this.clearancePrecisionDrcEvaluator,marginDrcEvaluator:this.clearanceMarginDrcEvaluator,drcEvaluator:this.cachedReferenceDrcEvaluator,initialErrors:l,initialErrorsWithCenters:Array.isArray(c)?c:c.errorsWithCenters??c.errors});r=u.attemptedCandidateCount,i=u.candidateValidationCount,s=u.referenceValidationCount,a=u.repaired,u.repaired&&(e=u.routes,o=0)}if(o===0)return this.combinedOutput=e,this.stats={...this.stats,...this.exactRepairSolver.stats,postExactIndexedDrcIssueCount:n,postExactReferenceValidationAttempted:!0,postExactReferenceDrcIssueCount:0,postExactReferenceAccepted:!0,clearancePrecisionCandidateCount:r,clearancePrecisionCandidateValidationCount:i,clearancePrecisionReferenceValidationCount:s,clearancePrecisionRepaired:a,boundedRegionalRepairMaxRegions:0,boundedRegionalRepairMaxCandidateAttempts:0,boundedRegionalRepairMaxPathSearchNodes:0,boundedRegionalRepairAttemptedRegionCount:0,boundedRegionalRepairAcceptedRegionCount:0,boundedRegionalRepairCandidateAttemptCount:0,boundedRegionalRepairPathSearchNodeCount:0,boundedRegionalRepairReferenceValidationCount:0,boundedRegionalRepairRepaired:!1,boundedRegionalRepairTimeMs:0,regionalB01RepairCandidateCount:0,regionalB01RepairAcceptedCount:0,regionalB01RepairFallbackCandidateCount:0,regionalB01RepairCandidateSearchCount:0,regionalB01RepairCandidateSearchBudget:0,regionalB01RepairCandidateSearchBudgetExhausted:!1,regionalB01RepairSafeTraceLayerSkippedForBudget:!1,regionalB01RepairRemainingDrcIssueCount:0,regionalB01RepairPreloadEligibleDrcIssueCount:0,regionalB01RepairAttempted:!1,regionalB01RepairTraceIdCount:0,terminalEscapeCandidateCount:0,terminalEscapeAcceptedCount:0,referenceDrcValidationCount:this.referenceDrcValidationCount,referenceDrcFalseNegativeCount:this.referenceDrcFalseNegativeCount,indexedDrcEvaluationCount:this.indexedDrcEvaluationCount,indexedDrcCacheHitCount:this.indexedDrcCacheHitCount,indexedDrcEvaluationTimeMs:this.indexedDrcEvaluationTimeMs,indexedDrcCandidateCacheSize:this.indexedDrcCandidateCache.size,indexedDrcCandidateCacheCapacity:64},void(this.solved=!0);let h=A9r({srj:this.params.srj,originalSrj:this.params.originalSrj,routes:e,newConnections:this.params.newConnections,syntheticConnectionNames:this.syntheticConnectionNames,drcEvaluator:this.drcEvaluator,effort:this.params.effort}),d=(({routes:u,newConnections:_,syntheticConnectionNames:p,fixedPreloadedObstacleRoutes:m,updatedPreloadedTraces:A})=>{let g=new Set,f=Object.assign(new Set,{collidingFixedTraceIds:g}),y=ble({routes:u,newConnections:_,syntheticConnectionNames:p}),x=new Set;for(let[C,b]of y)p.has(u[b].connectionName)?f.add(C):x.add(C);for(let C of m){let b=A[C.preloadedTraceIndex];if(!b)throw Error(`Pipeline9 fixed preload route has invalid trace index ${C.preloadedTraceIndex}`);x.has(b.pcb_trace_id)?g.add(b.pcb_trace_id):f.add(b.pcb_trace_id)}return f})({routes:h.routes,newConnections:this.params.newConnections,syntheticConnectionNames:this.syntheticConnectionNames,fixedPreloadedObstacleRoutes:this.fixedPreloadedObstacleRoutes,updatedPreloadedTraces:this.params.updatedPreloadedTraces});this.regionalB01Params={srj:this.params.srj,routes:h.routes,fixedObstacleRoutes:this.fixedPreloadedObstacleRoutes,newConnections:this.params.newConnections,syntheticConnectionNames:this.syntheticConnectionNames,drcEvaluator:this.drcEvaluator,initialErrors:h.remainingErrors,allowTracePairRepair:!0,preloadRepairTraceIds:d,connMap:this.params.connMap,colorMap:this.params.colorMap,viaDiameter:this.params.defaultViaDiameter,traceWidth:this.params.srj.minTraceWidth,obstacleMargin:this.params.srj.defaultObstacleMargin??this.params.srj.minTraceToPadEdgeClearance??0.15,effort:this.params.effort},this.stats={...this.stats,...this.exactRepairSolver.stats,postExactIndexedDrcIssueCount:n,postExactReferenceValidationAttempted:!0,postExactReferenceDrcIssueCount:o,postExactReferenceAccepted:!1,clearancePrecisionCandidateCount:r,clearancePrecisionCandidateValidationCount:i,clearancePrecisionReferenceValidationCount:s,clearancePrecisionRepaired:a,regionalB01RepairTraceIdCount:d.size+(d.collidingFixedTraceIds?.size??0),terminalEscapeCandidateCount:h.attemptedCandidateCount,terminalEscapeAcceptedCount:h.acceptedCandidateCount}}finishRegionalB01Repair(){if(!this.regionalB01RepairSolver?.solved)throw Error("Pipeline9 regional B01 stage must solve before completion");let e=this.regionalB01RepairSolver.getResult(),t=this.cachedReferenceDrcEvaluator({traces:[],routes:e.routes,hdRoutes:e.routes}),n=fWt(e.routes.length,(Array.isArray(t)?t:t.errors).length,this.params.effort);this.boundedRegionalParams={connMap:this.params.connMap,originalSrj:{...this.params.originalSrj,connections:[...this.params.originalSrj.connections,...this.params.newConnections]},routes:e.routes,viaHoleDiameter:this.params.defaultViaHoleDiameter,syntheticConnectionNames:this.syntheticConnectionNames,drcEvaluator:this.cachedReferenceDrcEvaluator,budget:n}}finishBoundedRegionalRepair(){if(!this.boundedRegionalRepairSolver?.solved||!this.regionalB01RepairSolver?.solved||!this.boundedRegionalParams?.budget||this.boundedRegionalRepairStartedAt===void 0)throw Error("Pipeline9 bounded regional stage is missing its completed inputs");let e=this.regionalB01RepairSolver.getResult(),t=this.boundedRegionalRepairSolver.getResult(),n=this.boundedRegionalParams.budget;this.combinedOutput=t.routes,this.stats={...this.stats,boundedRegionalRepairMaxRegions:n.maxRegions,boundedRegionalRepairMaxCandidateAttempts:n.maxCandidateAttempts,boundedRegionalRepairMaxPathSearchNodes:n.maxPathSearchNodes,boundedRegionalRepairAttemptedRegionCount:t.attemptedRegionCount,boundedRegionalRepairAcceptedRegionCount:t.acceptedRegionCount,boundedRegionalRepairCandidateAttemptCount:t.candidateAttemptCount,boundedRegionalRepairPathSearchNodeCount:t.pathSearchNodeCount,boundedRegionalRepairReferenceValidationCount:t.referenceValidationCount,boundedRegionalRepairRepaired:t.repaired,boundedRegionalRepairPublishedDrcIssueCount:t.publishedDrcIssueCount,boundedRegionalRepairTimeMs:performance.now()-this.boundedRegionalRepairStartedAt,regionalB01RepairCandidateCount:e.attemptedCandidateCount,regionalB01RepairAcceptedCount:e.acceptedCandidateCount,regionalB01RepairFallbackCandidateCount:e.fallbackCandidateCount,regionalB01RepairCandidateSearchCount:e.candidateSearchCount,regionalB01RepairCandidateSearchBudget:e.candidateSearchBudget,regionalB01RepairCandidateSearchBudgetExhausted:e.candidateSearchBudgetExhausted,regionalB01RepairSafeTraceLayerSkippedForBudget:e.safeTraceLayerRepairSkippedForBudget,regionalB01RepairRemainingDrcIssueCount:e.remainingDrcIssueCount,regionalB01RepairPreloadEligibleDrcIssueCount:e.preloadEligibleDrcIssueCount,regionalB01RepairAttempted:e.preloadRepairAttempted,referenceDrcValidationCount:this.referenceDrcValidationCount,referenceDrcFalseNegativeCount:this.referenceDrcFalseNegativeCount,indexedDrcEvaluationCount:this.indexedDrcEvaluationCount,indexedDrcCacheHitCount:this.indexedDrcCacheHitCount,indexedDrcEvaluationTimeMs:this.indexedDrcEvaluationTimeMs,indexedDrcCandidateCacheSize:this.indexedDrcCandidateCache.size,indexedDrcCandidateCacheCapacity:64},this.solved=!0}getCombinedOutput(){return this.combinedOutput??this.exactRepairSolver?.getOutput()??this.inputNewHdRoutes}getOutput(){return this.getCombinedOutput().filter((e)=>!this.syntheticConnectionNames.has(e.connectionName))}getUpdatedPreloadedTraces(){let e=new Map(this.getCombinedOutput().map((o)=>[o.connectionName,o])),t=new Map;for(let o of this.movablePreloadedSections){let r=e.get(o.syntheticConnectionName);if(!r)throw Error(`Pipeline9 joint DRC repair output is missing "${o.syntheticConnectionName}"`);let i=o.originalTrace.pcb_trace_id,s=t.get(i)??[];s.push({routePositionStart:o.originalRoutePositionStart,routePositionEnd:o.originalRoutePositionEnd,route:V4(r,this.params.layerCount,{defaultViaHoleDiameter:this.params.defaultViaHoleDiameter,obstacles:this.params.obstacles,connMap:this.params.connMap})}),t.set(i,s)}let n=new Map([...t].map(([o,r])=>{let i=this.inputUpdatedPreloadedTraces.find((s)=>s.pcb_trace_id===o);if(!i)throw Error(`Pipeline9 cannot find preloaded trace "${o}" while rebuilding repaired sections`);return[o,v9r({originalTrace:i,repairedSections:r})]}));return this.inputUpdatedPreloadedTraces.map((o)=>n.get(o.pcb_trace_id)??o)}getMutatedPreloadedTraces(){let e=new Set([...this.params.mutatedPreloadedTraceIds,...this.movablePreloadedSections.map((t)=>t.originalTrace.pcb_trace_id)]);return this.getUpdatedPreloadedTraces().filter((t)=>e.has(t.pcb_trace_id))}visualize(){return this.exactRepairSolver?.visualize()??{}}},Gln=0.000001,BWt=(e,t,n)=>{let o=ti(e,n),r=ti(t,n);return Array.from({length:Math.abs(r-o)+1},(i,s)=>Math.min(o,r)+s)},TWt=(e)=>e.route_type==="wire",P9r=(e,t,n)=>e.portPoints.filter((o)=>o.availableZ.includes(n)&&!(o._preloadedTracePortAssignments??[]).some((r)=>r.z===n&&r.fixedNetId!==t.fixedNetId)).map((o)=>({portPoint:o,distance:oc(o,t.start,t.end)})).sort((o,r)=>o.distance-r.distance||o.portPoint.distToCentermostPortOnZ-r.portPoint.distToCentermostPortOnZ||o.portPoint.segmentPortPointId.localeCompare(r.portPoint.segmentPortPointId))[0]?.portPoint,E9r=(e,t,n)=>{e._preloadedFixedNetIds=[...new Set([...e._preloadedFixedNetIds??[],t.fixedNetId])].sort();let o=t.end.x-t.start.x,r=t.end.y-t.start.y,i=o*o+r*r,s=i===0?0:Math.max(0,Math.min(1,((e.x-t.start.x)*o+(e.y-t.start.y)*r)/i)),a={traceId:t.traceId,fixedNetId:t.fixedNetId,routePosition:t.routePositionStart+s*(t.routePositionEnd-t.routePositionStart),tracePoint:{x:t.start.x+s*o,y:t.start.y+s*r},z:n},c=e._preloadedTracePortAssignments??[];c.some((l)=>l.traceId===a.traceId&&l.fixedNetId===a.fixedNetId&&l.z===a.z&&Math.abs(l.routePosition-a.routePosition)<=Gln)||(e._preloadedTracePortAssignments=[...c,a].sort((l,h)=>l.traceId.localeCompare(h.traceId)||l.routePosition-h.routePosition||l.z-h.z))},M9r=class extends Kr{constructor(e,t){super(),this.sharedEdgeSegments=e,this.srj=t,this.MAX_ITERATIONS=1,this.primitives=((n)=>{let o=[],r=Ep(n);for(let i of n.traces??[]){if(!i.connection_name)throw Error(`Preloaded trace "${i.pcb_trace_id}" is missing a connection name`);let s=r.getNetConnectedToId(i.connection_name)??i.connection_name;for(let[a,c]of i.route.entries())if(c.route_type==="via")o.push({traceId:i.pcb_trace_id,fixedNetId:s,connectionName:i.connection_name,routePositionStart:a,routePositionEnd:a,zLayers:BWt(c.from_layer,c.to_layer,n.layerCount),start:c,end:c});else if(c.route_type==="through_obstacle")o.push({traceId:i.pcb_trace_id,fixedNetId:s,connectionName:i.connection_name,routePositionStart:a,routePositionEnd:a+1,zLayers:BWt(c.from_layer,c.to_layer,n.layerCount),start:c.start,end:c.end});else if(c.route_type==="jumper"){let l=ti(c.layer,n.layerCount);for(let[h,d]of[c.start,c.end].entries())o.push({traceId:i.pcb_trace_id,fixedNetId:s,connectionName:i.connection_name,routePositionStart:a+h,routePositionEnd:a+h,zLayers:[l],start:d,end:d})}for(let a=0;a<i.route.length-1;a++){let c=i.route[a],l=i.route[a+1];TWt(c)&&TWt(l)&&c.layer===l.layer&&o.push({traceId:i.pcb_trace_id,fixedNetId:s,connectionName:i.connection_name,routePositionStart:a,routePositionEnd:a+1,zLayers:[ti(c.layer,n.layerCount)],start:c,end:l})}}return o})(t)}sharedEdgeSegments;srj;primitives;getSolverName(){return"PreloadedTraceGraphSolver"}_step(){for(let n of this.primitives)for(let o of this.sharedEdgeSegments)if(!(WO(n.start,n.end,o.start,o.end)>Gln))for(let r of n.zLayers){if(!o.availableZ.includes(r))continue;let i=P9r(o,n,r);i&&E9r(i,n,r)}let e=this.sharedEdgeSegments.flatMap((n)=>n.portPoints),t=e.filter((n)=>(n._preloadedFixedNetIds?.length??0)>0);this.stats={preloadedTraceCount:this.srj.traces?.length??0,preloadedTraceShapeCount:this.primitives.length,inputBoundaryCount:this.sharedEdgeSegments.length,outputBoundaryCount:this.sharedEdgeSegments.length,inputPortCount:e.length,outputPortCount:e.length,preloadedPortCount:t.length,tracePortAssignmentCount:t.reduce((n,o)=>n+(o._preloadedTracePortAssignments?.length??0),0),topologyChanged:!1},this.solved=!0}getOutput(){if(!this.solved)throw Error("PreloadedTraceGraphSolver has not solved yet");return this.sharedEdgeSegments}},w9r=class extends C6e{_step(){if(this.error=$Ke(this.inputSrj),this.error)return void(this.failed=!0);let{traces:e,...t}=this.inputSrj,n=pS(t),o=pS(Gcn(Ucn(n)));this.error=$Ke(o),this.error?this.failed=!0:(this.outputSrj=e===void 0?o:{...o,traces:e},this.solved=!0)}};function DWt(e){return new Set((e??[]).filter((t)=>t._isComponentTopologyNode).map((t)=>t.capacityMeshNodeId))}function Uln(e,t){return e.nodeIds.some((n)=>t.has(n))}function B9r({sharedEdgeSegments:e,componentCapacityMeshNodeIds:t}){return e.filter((n)=>!Uln(n,t))}function Hu(e,t,n,o={}){return{solverName:e,solverClass:t,getConstructorParams:n,onSolved:o.onSolved}}var jle=class extends Kr{constructor(e,t={}){super(),this.srj=e,this.opts=t;let n=pS(e);this.originalSrj=n,this.opts={...t};let o=this.opts;if(this.effort=o.effort??1,this.MAX_ITERATIONS=1e8*this.effort,this.maxNodeDimension=o.maxNodeDimension??15,this.maxNodeRatio=o.maxNodeRatio??6,this.minNodeArea=o.minNodeArea??0.010000000000000002,this.visualizationTraceColorMode=o.visualizationTraceColorMode??"layer",this.setSimpleRouteJson(n),o.capacityDepth===void 0){let r=this.srj.bounds.maxX-this.srj.bounds.minX,i=this.srj.bounds.maxY-this.srj.bounds.minY,s=Math.max(r,i),a=o.targetMinCapacity??0.5;o.capacityDepth=MQ(s,a)}this.cacheProvider=o.cacheProvider===void 0?_9():o.cacheProvider===null?null:o.cacheProvider,this.startTimeOfPhase={},this.endTimeOfPhase={},this.timeSpentOnPhase={}}srj;opts;getSolverName(){return"AutoroutingPipelineSolver9_PreloadedTraceGraph"}preprocessSimpleRouteJsonSolver;escapeViaLocationSolver;netToPointPairsSolver;componentTopologyGeneratorSolver;topologyPlanningSolver;topologyMergingSolver;globalTopologyGeneratorSolver;nodeDimensionSubdivisionSolver;nodeTargetMerger;edgeSolver;colorMap;highDensityRouteSolver;highDensityForceImproveSolver;highDensityRepairSolver;highDensityStitchSolver;globalDrcForceImproveSolver;pipeline9JointDrcRepairSolver;singleLayerNodeMerger;strawSolver;deadEndSolver;traceSimplificationSolver;mutatedPreloadedTraceSimplificationSolver;lengthMatchingPostProcessingSolver;powerTraceExpansionSolver;availableSegmentPointSolver;portPointPathingSolver;multiSectionPortPointOptimizer;uniformPortDistributionSolver;traceWidthSolver;necessaryCrampedPortPointSolver;preloadedTraceGraphSolver;componentDetectionSolver;viaDiameter;viaHoleDiameter;minTraceWidth;effort;effortCleanupSolver;maxNodeDimension;maxNodeRatio;minNodeArea;visualizationTraceColorMode;startTimeOfPhase;endTimeOfPhase;timeSpentOnPhase;activeSubSolver=null;connMap;srjWithEscapeViaLocations;srjWithPointPairs;originalSrj;capacityNodes=null;capacityEdges=null;sharedEdgeSegmentsWithNecessaryCrampedPortPoints;highDensityNodePortPoints;cacheProvider=null;pipelineDef=[Hu("preprocessSimpleRouteJsonSolver",w9r,(e)=>[e.originalSrj,{traceColorMode:e.visualizationTraceColorMode}],{onSolved:(e)=>{e.setSimpleRouteJson(e.preprocessSimpleRouteJsonSolver.getOutputSimpleRouteJson())}}),Hu("componentDetectionSolver",lln,(e)=>[{inputSrj:e.srj}]),Hu("escapeViaLocationSolver",f6e,(e)=>[e.srj,{viaDiameter:e.viaDiameter,minTraceWidth:e.minTraceWidth,obstacleMargin:e.srj.defaultObstacleMargin??0.15}],{onSolved:(e)=>{e.srjWithEscapeViaLocations=e.escapeViaLocationSolver?.getOutputSimpleRouteJson()}}),Hu("netToPointPairsSolver",kq,(e)=>{let t=e.srjWithEscapeViaLocations??e.srj;return[t,e.colorMap,SQ(t)]},{onSolved:(e)=>{e.srjWithPointPairs=e.netToPointPairsSolver?.getNewSimpleRouteJson(),e.colorMap=yA(e.srjWithPointPairs,e.connMap),e.connMap=Ep(e.srjWithPointPairs)}}),Hu("topologyPlanningSolver",pln,(e)=>[{inputSrj:e.srjWithPointPairs,componentDetectionOutput:e.componentDetectionSolver.getOutput(),viaDiameter:e.viaDiameter,obstacleMargin:e.srj.defaultObstacleMargin??0.15}],{onSolved:(e)=>{e.topologyPlanningSolver.getOutput(),e.globalTopologyGeneratorSolver=e.topologyPlanningSolver.globalTopologySolver,e.componentTopologyGeneratorSolver=new mln(e.topologyPlanningSolver)}}),Hu("topologyMergingSolver",uln,(e)=>{let t=e.topologyPlanningSolver.getOutput();return[{layerCount:e.srj.layerCount,nodeGroups:[{groupId:"global",nodes:t.globalMeshNodes,isComponent:!1},...t.componentMeshNodes.map((n,o)=>({groupId:`component-${o}`,nodes:n,isComponent:!0}))]}]},{onSolved:(e)=>{e.capacityNodes=e.topologyMergingSolver.getOutput()}}),Hu("nodeDimensionSubdivisionSolver",g6e,(e)=>[e.capacityNodes,e.maxNodeDimension,e.maxNodeRatio,e.minNodeArea],{onSolved:(e)=>{e.capacityNodes=e.nodeDimensionSubdivisionSolver.outputNodes}}),Hu("edgeSolver",PQ,(e)=>[e.capacityNodes],{onSolved:(e)=>{e.capacityEdges=e.edgeSolver?.edges}}),Hu("availableSegmentPointSolver",yV,(e)=>[{nodes:e.capacityNodes,edges:e.capacityEdges||[],traceWidth:e.minTraceWidth,colorMap:e.colorMap,shouldReturnCrampedPortPoints:!0}]),Hu("necessaryCrampedPortPointSolver",Vle,(e)=>{let t=DWt(e.capacityNodes);return[{capacityMeshNodes:e.capacityNodes.filter((n)=>!t.has(n.capacityMeshNodeId)),sharedEdgeSegments:B9r({sharedEdgeSegments:e.availableSegmentPointSolver.getOutput(),componentCapacityMeshNodeIds:t}),simpleRouteJson:e.srjWithPointPairs}]},{onSolved:(e)=>{let t=DWt(e.capacityNodes);e.sharedEdgeSegmentsWithNecessaryCrampedPortPoints=function({originalSharedEdgeSegments:n,filteredSharedEdgeSegments:o,componentCapacityMeshNodeIds:r}){let i=new Map(o.map((s)=>[s.edgeId,s]));return n.map((s)=>Uln(s,r)?s:i.get(s.edgeId)??s)}({originalSharedEdgeSegments:e.availableSegmentPointSolver.getOutput(),filteredSharedEdgeSegments:e.necessaryCrampedPortPointSolver.getOutput(),componentCapacityMeshNodeIds:t})}}),Hu("preloadedTraceGraphSolver",M9r,(e)=>[e.sharedEdgeSegmentsWithNecessaryCrampedPortPoints,e.srjWithPointPairs]),Hu("portPointPathingSolver",A6e,(e)=>{let t=e.sharedEdgeSegmentsWithNecessaryCrampedPortPoints??e.necessaryCrampedPortPointSolver?.getOutput()??e.availableSegmentPointSolver.getOutput(),{graph:n,connections:o}=Yle({capacityMeshNodes:e.capacityNodes,layerCount:e.srj.layerCount,connectivityMap:e.connMap,segmentPortPoints:t.flatMap((r)=>r.portPoints),simpleRouteJsonConnections:e.srjWithPointPairs.connections});return[{graph:n,connections:o,layerCount:e.srj.layerCount,effort:Math.min(1,e.effort),preserveTerminalPcbPortIds:!0,minViaPadDiameter:e.viaDiameter,flags:{FORCE_CENTER_FIRST:!0,RIPPING_ENABLED:!0,USE_SELECTIVE_RERIP_ROUTING:!0,USE_PARTIAL_RIP_ROUTING_WITH_PRELOADED_TRACES:!0},weights:{SHUFFLE_SEED:0,MEMORY_PF_FACTOR:4,CENTER_OFFSET_DIST_PENALTY_FACTOR:0,CENTER_OFFSET_FOCUS_SHIFT:0,NODE_PF_FACTOR:0,LAYER_CHANGE_COST:0,RIPPING_PF_COST:0,NODE_PF_MAX_PENALTY:100,BASE_CANDIDATE_COST:0.6,MAX_ITERATIONS_PER_PATH:0,RANDOM_WALK_DISTANCE:0,START_RIPPING_PF_THRESHOLD:0.3,END_RIPPING_PF_THRESHOLD:1,MAX_RIPS:1000,RANDOM_RIP_FRACTION:0.3,STRAIGHT_LINE_DEVIATION_PENALTY_FACTOR:4,GREEDY_MULTIPLIER:0.7,MIN_ALLOWED_BOARD_SCORE:-1e4}}]}),Hu("uniformPortDistributionSolver",Sle,(e)=>[{nodeWithPortPoints:e.portPointPathingSolver?.getOutput().nodesWithPortPoints??[],inputNodesWithPortPoints:e.portPointPathingSolver?.getOutput().inputNodeWithPortPoints??[],minTraceWidth:e.minTraceWidth,obstacles:e.srj.obstacles,layerCount:e.srj.layerCount,useLayerAwareGeometry:e.srj.layerCount>2,preserveSolitaryPorts:Boolean(e.srj.traces?.length)}]),Hu("highDensityRouteSolver",xZe,(e)=>{let t=e.portPointPathingSolver;if(!t)throw Error("Pipeline9 invariant violated: high-density routing requires the completed port-point pathing solver");let n=t.getOutput(),o=e.uniformPortDistributionSolver?.getOutput()??[],r=n.nodesWithPortPoints,i=o.length>0?o:r;e.highDensityNodePortPoints=structuredClone(i);let s=(e.originalSrj.traces??[]).flatMap((c,l)=>xw(c,l,e.originalSrj.layerCount,e.viaDiameter,e.connMap)),a=oWt({traces:e.originalSrj.traces??[],fixedHdRoutes:s,sections:e.getChangedPreloadedTraceSections()});return[{nodePortPoints:i,boardGeometry:{bounds:e.originalSrj.bounds,outline:e.originalSrj.outline,minBoardEdgeClearance:e.originalSrj.minBoardEdgeClearance},fixedHdRoutes:a,connMap:e.connMap,colorMap:e.colorMap,obstacles:e.srj.obstacles,layerCount:e.srj.layerCount,allowBlindAndBuriedVias:e.srj.allowBlindAndBuriedVias,viaDiameter:e.viaDiameter,traceWidth:e.minTraceWidth,obstacleMargin:e.srj.defaultObstacleMargin??0.15,viaToPadClearance:e.srj.minViaEdgeToPadEdgeClearance,effort:Math.min(1,e.effort),includeBoardObstacles:!0,nodePfById:t.computeNodePfMap(),preserveTerminalPcbPortIds:!0}]}),Hu("highDensityForceImproveSolver",Gle,(e)=>[{nodeWithPortPoints:e.highDensityNodePortPoints??[],hdRoutes:RIr(fZe(e.highDensityRouteSolver.routes)),colorMap:e.colorMap,totalStepsPerNode:Math.max(12,Math.round(20*Math.min(1,e.effort))),nodeAssignmentMargin:e.srj.defaultObstacleMargin??0.2}]),Hu("highDensityRepairSolver",Ule,(e)=>[{nodeWithPortPoints:e.highDensityNodePortPoints??[],hdRoutes:e.highDensityForceImproveSolver?.getOutput()??e.highDensityRouteSolver.routes,obstacles:e.srj.obstacles,colorMap:e.colorMap,repairMargin:e.srj.defaultObstacleMargin??0.2,minimumTraceWidth:e.srj.minTraceWidth,connMap:e.connMap}]),Hu("highDensityStitchSolver",x6e,(e)=>[{connections:[...e.srjWithPointPairs.connections,...e.getChangedPreloadedTraceSections().map((t)=>t.connection)],hdRoutes:e.highDensityRepairSolver?.getOutput()??e.highDensityForceImproveSolver?.getOutput()??e.highDensityRouteSolver.routes,colorMap:e.colorMap,layerCount:e.srj.layerCount,defaultViaDiameter:e.viaDiameter,preserveTerminalPcbPortIds:!0,preferSameLayerTerminalEndpoints:!0}]),Hu("traceSimplificationSolver",Ab,(e)=>{let t=e.getPreloadedTraceUpdatesAfterHighDensity().updatedPreloadedTraces.flatMap((i,s)=>xw(i,s,e.originalSrj.layerCount,e.viaDiameter,e.connMap).map((a)=>({...a,rootConnectionName:i.connection_name}))),n=new Set(e.getChangedPreloadedTraceSections().map((i)=>i.connectionName)),o=e.highDensityStitchSolver.mergedHdRoutes.filter((i)=>!n.has(i.connectionName)),r=vbe([...o,...t],e.connMap);return[{hdRoutes:o,obstacles:e.srj.obstacles,connMap:e.connMap,colorMap:e.colorMap,outline:e.srj.outline,defaultViaDiameter:e.viaDiameter,layerCount:e.srj.layerCount,minTraceToPadEdgeClearance:e.srj.minTraceToPadEdgeClearance,minBoardEdgeClearance:e.srj.minBoardEdgeClearance,otherHdRoutes:t,netByConnectionName:r,enableCrossingViaReduction:!0,terminalLayerIndicesByPcbPortId:eWt(e.srj.connections,e.srj.obstacles,e.srj.layerCount),iterations:2}]}),Hu("mutatedPreloadedTraceSimplificationSolver",Ab,(e)=>{let t=e.getPreparedMutatedPreloadedTraceSections(),n=t.sections.map((r)=>r.hdRoute),o=[...t.immutableHdRoutes,...e.traceSimplificationSolver.simplifiedHdRoutes];return[{hdRoutes:n,obstacles:e.srj.obstacles,connMap:e.connMap,colorMap:e.colorMap,outline:e.srj.outline,defaultViaDiameter:e.viaDiameter,layerCount:e.srj.layerCount,minTraceToPadEdgeClearance:e.srj.minTraceToPadEdgeClearance,minBoardEdgeClearance:e.srj.minBoardEdgeClearance,otherHdRoutes:o,netByConnectionName:vbe([...n,...o],e.connMap),enableCrossingViaReduction:!0,preserveRouteEndpoints:!0,enableVertexShortcuts:!0,iterations:2}]}),Hu("traceWidthSolver",Lq,(e)=>[{hdRoutes:e.traceSimplificationSolver.simplifiedHdRoutes,obstacles:e.srj.obstacles,connMap:e.connMap,colorMap:e.colorMap,minTraceWidth:e.minTraceWidth,connection:e.srjWithPointPairs.connections,obstacleMargin:e.srj.minTraceToPadEdgeClearance??0.15,minTraceToHoleEdgeClearance:e.srj.minTraceToHoleEdgeClearance,layerCount:e.srj.layerCount}]),Hu("globalDrcForceImproveSolver",Y7,(e)=>[{srj:e.getSrjWithMaterializedPreloadedTraces(),hdRoutes:bln({hdRoutes:w$(e.traceWidthSolver.getHdRoutesWithWidths()),connections:e.netToPointPairsSolver?.newConnections??[]}),connMap:e.connMap,effort:Math.min(1,e.effort),maxIterations:16,enableLargeBoardBroadFallback:!1,enablePostSolveClearanceRelaxation:!1}]),Hu("pipeline9JointDrcRepairSolver",S9r,(e)=>{let t=e.getPreloadedTraceUpdatesAfterHighDensity(),n=e.getSrjWithMaterializedPreloadedTraces();return[{srj:n,srjWithPointPairs:n,originalSrj:e.originalSrj,newConnections:e.netToPointPairsSolver?.newConnections??[],newHdRoutes:e.globalDrcForceImproveSolver.getOutput(),updatedPreloadedTraces:t.updatedPreloadedTraces,mutatedPreloadedTraceIds:new Set(t.mutatedPreloadedTraces.map((o)=>o.pcb_trace_id)),connMap:e.connMap,obstacles:e.srj.obstacles,layerCount:e.srj.layerCount,defaultViaDiameter:e.viaDiameter,defaultViaHoleDiameter:e.viaHoleDiameter,effort:Math.min(1,e.effort),colorMap:e.colorMap}]}),Hu("effortCleanupSolver",EIr,(e)=>{let t=e.getUpdatedPreloadedTraces(),n={...e.originalSrj,traces:t},o=w$(e.pipeline9JointDrcRepairSolver.getOutput()),r=(i)=>s$e(o$e({connections:e.netToPointPairsSolver.newConnections,originalConnections:e.originalSrj.connections,hdRoutes:w$(i),layerCount:e.srj.layerCount,obstacles:e.srj.obstacles,defaultViaHoleDiameter:e.viaHoleDiameter,connMap:e.connMap}),e.originalSrj.traces??[]);return[{effort:e.effort,viaRemovalPasses:e.pipeline9JointDrcRepairSolver.stats.initialBoundedRegionalRepairAddedViaCount>0?2:1,config:{hdRoutes:o,preserveRouteEndpoints:!0,obstacles:e.srj.obstacles,connMap:e.connMap,colorMap:e.colorMap,outline:e.srj.outline,defaultViaDiameter:e.viaDiameter,layerCount:e.srj.layerCount,minTraceToPadEdgeClearance:e.srj.minTraceToPadEdgeClearance,minBoardEdgeClearance:e.srj.minBoardEdgeClearance,otherHdRoutes:t.flatMap((i,s)=>xw(i,s,e.srj.layerCount,e.viaDiameter,e.connMap)),enableCrossingViaReduction:!0,terminalLayerIndicesByPcbPortId:eWt(e.srj.connections,e.srj.obstacles,e.srj.layerCount)},getCost:(i)=>{let s=r(i);return{vias:s.reduce((a,c)=>a+c.route.filter((l)=>l.route_type==="via").length,0),points:s.reduce((a,c)=>a+c.route.length,0)}},isValid:(i)=>gCe({inputSrj:n,srjWithPointPairs:e.srjWithPointPairs,routedTraces:r(i),includeBoardClearance:!0,drcOptions:{traceClearance:e.originalSrj.minTraceToPadEdgeClearance??0.1,viaClearance:e.originalSrj.minViaHoleEdgeToViaHoleEdgeClearance??0.1}}).errors.length===0}]}),Hu("lengthMatchingPostProcessingSolver",wIr,(e)=>{let t=e.netToPointPairsSolver;if(!t)throw Error("Pipeline9: length-matching post-processing requires NetToPointPairsSolver output");let n=t.newConnections,o=new Map;for(let s of e.srj.differentialPairs??[])for(let a of s.connectionNames){let c=n.filter((l)=>l.name===a||l.__rootConnectionNames?.includes(a)||l.__netConnectionName===a);if(c.length!==1)throw Error(`Pipeline9: differential pair connection "${a}" must resolve to exactly one final point-pair connection, got ${c.length}`);o.set(a,c[0].name)}let r=e.effortCleanupSolver.getOutput(),i=(e.srj.differentialPairs??[]).map((s)=>{let a=s.connectionNames.map((d)=>{let u=o.get(d);if(!u)throw Error(`Pipeline9: differential pair connection "${d}" is missing from final routed output`);return u});if(a[0]===a[1])throw Error(`Pipeline9: differential pair ${s.connectionNames.join("/")} resolves both members to "${a[0]}"`);let c={connectionNames:a,lengthTolerance:s.lengthTolerance};if(s.maxUncoupledLength!==void 0&&(c.maxUncoupledLength=s.maxUncoupledLength),s.traceGap===void 0)return c;let l=a.map((d)=>{let u=r.filter((_)=>_.connectionName===d);if(u.length!==1)throw Error(`Pipeline9: differential pair connection "${d}" must resolve to exactly one final HD route, got ${u.length}`);return u[0]}),h=s.traceGap+l.reduce((d,u)=>d+u.traceThickness/2,0);return{...c,minimumCenterlineDistance:h,maximumCenterlineDistance:h}});return[{hdRoutes:r,differentialPairs:i,buses:e.srj.buses??[],connections:e.srj.connections,obstacles:e.srj.obstacles,traces:e.getUpdatedPreloadedTraces(),bounds:e.srj.bounds,layerCount:e.srj.layerCount,obstacleMargin:e.srj.minTraceToPadEdgeClearance??0.15}]}),Hu("powerTraceExpansionSolver",xln,(e)=>{let t=e.opts.powerTraceExpansion??{},n=t.onlyConnectionNames??Cln(e.originalSrj);return[Iln({originalSrj:e.originalSrj,newlyRoutedTraces:e.getNewTracesBeforePowerExpansion(),currentPreloadedTraces:e.getUpdatedPreloadedTraces(),expandedConnectionNames:n,resolveConnectedTraceAliases:!0}),{allowNewVias:!1,...t,onlyConnectionNames:n}]})];setSimpleRouteJson(e){this.srj=e;let t=Pp(this.srj);this.viaDiameter=t.padDiameter,this.viaHoleDiameter=t.holeDiameter,this.minTraceWidth=this.srj.minTraceWidth,this.connMap=Ep(this.srj),this.colorMap=yA(this.srj,this.connMap)}getConstructorParams(){return[this.srj,this.opts]}currentPipelineStepIndex=0;computeProgress(){let e=this.activeSubSolver?.progress??0;return(this.currentPipelineStepIndex+e)/this.pipelineDef.length}_step(){let e=this.pipelineDef[this.currentPipelineStepIndex];if(!e)return void(this.solved=!0);if(this.activeSubSolver)return this.activeSubSolver.step(),void(this.activeSubSolver.solved?(this.endTimeOfPhase[e.solverName]=performance.now(),this.timeSpentOnPhase[e.solverName]=this.endTimeOfPhase[e.solverName]-this.startTimeOfPhase[e.solverName],e.onSolved?.(this),this.activeSubSolver=null,this.currentPipelineStepIndex++):this.activeSubSolver.failed&&(this.error=this.activeSubSolver?.error,this.failed=!0,this.activeSubSolver=null));let t=e.getConstructorParams(this);this.activeSubSolver=new e.solverClass(...t),this.activeSubSolver instanceof Ab&&(this.activeSubSolver.MAX_SIMPLIFICATION_PIPELINE_LOOPS=Math.ceil(this.activeSubSolver.MAX_SIMPLIFICATION_PIPELINE_LOOPS*Math.min(1,this.effort))),e.solverName!=="lengthMatchingPostProcessingSolver"&&e.solverName!=="powerTraceExpansionSolver"&&e.solverName!=="effortCleanupSolver"||(this.MAX_ITERATIONS=Math.max(this.MAX_ITERATIONS,this.iterations+this.activeSubSolver.MAX_ITERATIONS+1)),this[e.solverName]=this.activeSubSolver,this.timeSpentOnPhase[e.solverName]=0,this.startTimeOfPhase[e.solverName]=performance.now()}solveUntilPhase(e){for(;this.getCurrentPhase()!==e;)this.step()}getCurrentPhase(){return this.pipelineDef[this.currentPipelineStepIndex]?.solverName??"none"}visualize(){if(!this.solved&&this.activeSubSolver)return this.visualizeStage(this.activeSubSolver);let e=this.escapeViaLocationSolver?.visualize(),t=this.netToPointPairsSolver?.visualize(),n=this.componentDetectionSolver?.visualize(),o=this.componentTopologyGeneratorSolver?.visualize(),r=this.globalTopologyGeneratorSolver?.visualize(),i=this.topologyMergingSolver?.visualize(),s=this.nodeDimensionSubdivisionSolver?.visualize(),a=this.nodeTargetMerger?.visualize(),c=this.singleLayerNodeMerger?.visualize(),l=this.strawSolver?.visualize(),h=this.edgeSolver?.visualize(),d=this.deadEndSolver?.visualize(),u=this.availableSegmentPointSolver?.visualize(),_=this.portPointPathingSolver?.visualize(),p=this.multiSectionPortPointOptimizer?.visualize(),m=this.uniformPortDistributionSolver?.visualize(),A=this.highDensityRouteSolver?.visualize(),g=this.highDensityForceImproveSolver?.visualize(),f=this.highDensityRepairSolver?.visualize(),y=this.highDensityStitchSolver?.visualize(),x=this.traceSimplificationSolver?.visualize(),C=this.mutatedPreloadedTraceSimplificationSolver?.visualize(),b=this.lengthMatchingPostProcessingSolver?.visualize(),I=this.powerTraceExpansionSolver?.visualize(),v=this.traceWidthSolver?.visualize(),P=this.necessaryCrampedPortPointSolver?.visualize(),M=(this.highDensityRouteSolver?.visualize(),this.originalSrj),B=M.outline,T=[];if(T.push({points:[{x:M.bounds?.minX??-50,y:M.bounds?.minY??-50},{x:M.bounds?.maxX??50,y:M.bounds?.minY??-50},{x:M.bounds?.maxX??50,y:M.bounds?.maxY??50},{x:M.bounds?.minX??-50,y:M.bounds?.maxY??50},{x:M.bounds?.minX??-50,y:M.bounds?.minY??-50}],strokeColor:"rgba(255,0,0,0.25)"}),B&&B.length>=2){let K=B.map((J)=>({x:J.x,y:J.y}));K.push({...K[0]}),T.push({points:K,strokeColor:"rgba(0, 136, 255, 0.95)"})}let N=Nw(M),D={points:[...M.connections.flatMap((K)=>K.pointsToConnect.map((J)=>({...J,layer:Rw(J,M.layerCount),label:`${K.name} ${J.pcb_port_id??""}`})))],rects:[...(M.obstacles??[]).filter((K)=>!K.isCopperPour).map((K)=>({...K,fill:K.layers?.includes("top")?"rgba(255,0,0,0.25)":K.layers?.includes("bottom")?"rgba(0,0,255,0.25)":"rgba(255,0,0,0.25)",layer:sS(K,M.layerCount),label:N(K)}))],lines:T},L={traceColorMode:this.visualizationTraceColorMode},H=Bw({srj:M,visualizationOptions:L}),V=sl(D,H),O=this.preprocessSimpleRouteJsonSolver?.visualize(),U=this.globalDrcForceImproveSolver?.visualize(),j=this.pipeline9JointDrcRepairSolver?.visualize(),Y=[V,O,n,o,e,t,r,i,s,a,c,l,h,d,u,P,_,p,m,A?sl(D,A):null,g,f,y,x,C,v,U,j,b,I,this.solved?sl({lines:T},Bw({srj:this.originalSrj,visualizationOptions:L}),this.visualizeFinalOutput()):null].filter(Boolean),X=sl(...Y);return this.visualizationTraceColorMode==="net"?fbe(X,this.colorMap):X}visualizeStage(e){let t=e.visualize();return this.visualizationTraceColorMode==="net"?fbe(t,this.colorMap):t}visualizeFinalOutput(){let e=this.visualizationTraceColorMode,t=this.getOutputSimpleRouteJson();return py(t,{traceColorMode:e})}preview(){if(this.highDensityRouteSolver){let e=[];for(let t=this.highDensityRouteSolver.routes.length-1;t>=0;t--){let n=this.highDensityRouteSolver.routes[t];if(e.push({points:n.route.map((o)=>({x:o.x,y:o.y})),strokeColor:this.colorMap[n.connectionName]}),e.length>200)break}return{lines:e}}return this.portPointPathingSolver?this.portPointPathingSolver.preview():this.netToPointPairsSolver?this.netToPointPairsSolver.visualize():this.escapeViaLocationSolver?this.escapeViaLocationSolver.visualize():this.componentTopologyGeneratorSolver?this.componentTopologyGeneratorSolver.visualize():this.componentDetectionSolver?this.componentDetectionSolver.visualize():this.preprocessSimpleRouteJsonSolver?this.preprocessSimpleRouteJsonSolver.visualize():{}}_getOutputHdRoutes(){if(((this.originalSrj.differentialPairs?.length??0)>0||(this.originalSrj.buses??[]).some((e)=>e.maxLengthSkew!==void 0))&&this.lengthMatchingPostProcessingSolver){let{hdRoutes:e}=this.lengthMatchingPostProcessingSolver.getOutput();return e}return(this.effortCleanupSolver?.solved?this.effortCleanupSolver.getOutput():void 0)??this.pipeline9JointDrcRepairSolver?.getOutput()??this.globalDrcForceImproveSolver?.getOutput()??this.traceWidthSolver?.getHdRoutesWithWidths()??this.traceSimplificationSolver?.simplifiedHdRoutes??this.highDensityStitchSolver.mergedHdRoutes}getOriginalFixedHdRoutes(){return(this.originalSrj.traces??[]).flatMap((e,t)=>xw(e,t,this.originalSrj.layerCount,this.viaDiameter,this.connMap))}getChangedPreloadedTraceSections(){return this.portPointPathingSolver?.getOutput().changedPreloadedTraceSections??[]}getPreloadedFixedRouteStateAfterHighDensity(){let e=this.getOriginalFixedHdRoutes(),t=this.getChangedPreloadedTraceSections(),n=oWt({traces:this.originalSrj.traces??[],fixedHdRoutes:e,sections:t}),o=t.length===0?[]:NIr({traces:this.originalSrj.traces??[],sections:t,stitchedHdRoutes:this.highDensityStitchSolver?.mergedHdRoutes??[],layerCount:this.originalSrj.layerCount}),r=new Set(t.map((s)=>s.traceId)),i=e.filter((s)=>r.has(this.originalSrj.traces?.[s.preloadedTraceIndex]?.pcb_trace_id??"")).map((s)=>s.connectionName);return{originalFixedRoutes:e,updatedFixedRoutes:[...this.highDensityRouteSolver?.getUpdatedFixedHdRoutes()??n,...o],replacedConnectionNames:new Set([...this.highDensityRouteSolver?.fixedRouteReplacements.keys()??[],...i]),mutationMasks:new Map([...this.highDensityRouteSolver?.preloadedTraceMutationMasks??[],...o.map((s)=>[s.connectionName,Array(s.route.length-1).fill(!0)])])}}getPreparedMutatedPreloadedTraceSections(){let e=this.getPreloadedFixedRouteStateAfterHighDensity();return zIr({updatedFixedRoutes:e.updatedFixedRoutes,regionalMutationMasks:e.mutationMasks})}getPreloadedTraceUpdatesAfterHighDensity(){let e=this.getPreloadedFixedRouteStateAfterHighDensity(),t=this.getPreparedMutatedPreloadedTraceSections(),n=this.mutatedPreloadedTraceSimplificationSolver?.solved===!0?(({updatedFixedRoutes:o,sections:r,simplifiedHdRoutes:i})=>{let s=new Set(r.map((h)=>h.connectionName)),a=new Map(i.map((h)=>[h.connectionName,h]));if(a.size!==r.length||i.some((h)=>!s.has(h.connectionName)))throw Error(`Pipeline9 trace simplification changed the mutation-section set (expected ${r.length}, got ${i.length})`);let c=new Map,l=new Set;for(let h of r){let d=a.get(h.connectionName);if(!d)throw Error(`Pipeline9 trace simplification lost mutation section "${h.connectionName}"`);let u=d.route[0],_=d.route.at(-1);if(!(u&&_&&Pbe(u,h.section.start.point)&&Pbe(_,h.section.end.point)))throw Error(`Pipeline9 trace simplification changed mutation-section boundary "${h.connectionName}"`);let p=yZe(h.section,d),m=h.section.sourceRoutes[0];l.add(m.connectionName);for(let A of h.section.sourceRoutes){if(c.has(A.connectionName))throw Error(`Pipeline9 attempted to simplify fixed route "${A.connectionName}" more than once`);c.set(A.connectionName,p)}}return o.flatMap((h)=>{let d=c.get(h.connectionName);return d?l.has(h.connectionName)?[d]:[]:[h]})})({updatedFixedRoutes:t.normalizedFixedRoutes,sections:t.sections,simplifiedHdRoutes:this.mutatedPreloadedTraceSimplificationSolver.simplifiedHdRoutes}):e.updatedFixedRoutes;return(({originalTraces:o,originalFixedRoutes:r,updatedFixedRoutes:i,replacedConnectionNames:s,layerCount:a,defaultViaHoleDiameter:c,obstacles:l,connMap:h})=>{let d=new Map,u=new Map;for(let p of r){let m=d.get(p.preloadedTraceIndex)??[];m.push(p),d.set(p.preloadedTraceIndex,m)}for(let p of i){let m=u.get(p.preloadedTraceIndex)??[];m.push(p),u.set(p.preloadedTraceIndex,m)}let _=[];return{updatedPreloadedTraces:o.map((p,m)=>{let A=(d.get(m)??[]).sort(i$e);if(!A.some((x)=>s.has(x.connectionName)))return p;let g=(u.get(m)??[]).sort(i$e),f=p.route.some((x)=>x.route_type==="through_obstacle"),y={...p,__replaces_pcb_trace_id:p.pcb_trace_id,route:f?DIr({trace:p,originalTraceRoutes:A,updatedTraceRoutes:g,layerCount:a,defaultViaHoleDiameter:c,obstacles:l,connMap:h}):Eln({trace:p,updatedTraceRoutes:g,layerCount:a,defaultViaHoleDiameter:c,obstacles:l,connMap:h})};return _.push(y),y}),mutatedPreloadedTraces:_}})({originalTraces:this.originalSrj.traces??[],originalFixedRoutes:e.originalFixedRoutes,updatedFixedRoutes:n,replacedConnectionNames:e.replacedConnectionNames,layerCount:this.originalSrj.layerCount,defaultViaHoleDiameter:this.viaHoleDiameter,obstacles:this.originalSrj.obstacles,connMap:this.connMap})}getSrjWithMaterializedPreloadedTraces(){return{...this.srjWithPointPairs,traces:this.getPreloadedTraceUpdatesAfterHighDensity().updatedPreloadedTraces}}getUpdatedPreloadedTraces(){return this.pipeline9JointDrcRepairSolver?.getUpdatedPreloadedTraces()??this.getPreloadedTraceUpdatesAfterHighDensity().updatedPreloadedTraces}getMutatedPreloadedTraces(){return this.pipeline9JointDrcRepairSolver?.getMutatedPreloadedTraces()??this.getPreloadedTraceUpdatesAfterHighDensity().mutatedPreloadedTraces}getNewTracesBeforePowerExpansion(){if(!this.highDensityRouteSolver)throw Error("Cannot get new traces before high-density routing");let e=o$e({connections:this.netToPointPairsSolver?.newConnections??[],originalConnections:this.originalSrj.connections,hdRoutes:w$(this._getOutputHdRoutes()),layerCount:this.srj.layerCount,obstacles:this.srj.obstacles,defaultViaHoleDiameter:this.viaHoleDiameter,connMap:this.connMap});return s$e(e,this.originalSrj.traces??[])}getPowerTraceExpansionFixedTraces(){if(!this.powerTraceExpansionSolver)throw Error("Pipeline9 invariant violated: solved pipeline is missing the unconditional power-trace expansion solver");return this.powerTraceExpansionSolver.inputSrj.fixedTraces}getOutputSimplifiedPcbTraces(){if(!this.solved)throw Error("Cannot get output before solving is complete");if(!this.powerTraceExpansionSolver)throw Error("Pipeline9 invariant violated: solved pipeline is missing the unconditional power-trace expansion solver");return[...this.getPowerTraceExpansionFixedTraces().filter((e)=>e.__replaces_pcb_trace_id!==void 0),...this.powerTraceExpansionSolver.getOutput()]}getOutputSimpleRouteJson(){if(!this.solved)throw Error("Cannot get output before solving is complete");if(!this.powerTraceExpansionSolver)throw Error("Pipeline9 invariant violated: solved pipeline is missing the unconditional power-trace expansion solver");let e=[...this.getPowerTraceExpansionFixedTraces(),...this.powerTraceExpansionSolver.getOutput()];return{...this.originalSrj,traces:e}}},T9r=String("0.0.993"),bZe=({nodeWithPortPoints:e,obstacleMargin:t,traceWidth:n,viaDiameter:o})=>{let r=Rce(e),i=t+Math.max(n,o)/2+0.000001;return{minX:e.center.x+8*(r.minX-e.center.x)-i,maxX:e.center.x+8*(r.maxX-e.center.x)+i,minY:e.center.y+8*(r.minY-e.center.y)-i,maxY:e.center.y+8*(r.maxY-e.center.y)+i}},Wln=(e,t)=>{let n=(e.ccwRotationDegrees??0)*Math.PI/180,o=Math.abs(Math.cos(n)),r=Math.abs(Math.sin(n)),i=e.width/2,s=e.height/2,a=Math.max(i,i*o+s*r),c=Math.max(s,i*r+s*o);return e.center.x-a<=t.maxX&&e.center.x+a>=t.minX&&e.center.y-c<=t.maxY&&e.center.y+c>=t.minY},X$=(e,t)=>{for(let n of[t.connectionName,t.rootConnectionName,t.portPointId,t.pcb_port_id,t.prevPortPointId,t.nextPortPointId])n!==void 0&&e.add(n)},Xln=(e,t)=>Object.fromEntries(Object.entries(e.netMap).flatMap(([n,o])=>{let r=o.filter((i)=>t.has(i));return r.length>0||t.has(n)?[[n,r]]:[]})),jln=({obstacle:e,connectedTo:t,preserveRotation:n})=>({type:"rect",layers:e.layers,...e.zLayers===void 0?{}:{zLayers:e.zLayers},...e.__zLayers===void 0?{}:{__zLayers:e.__zLayers},center:e.center,width:e.width,height:e.height,...n&&e.ccwRotationDegrees!==void 0?{ccwRotationDegrees:e.ccwRotationDegrees}:{},connectedTo:t,...e.circuitJsonMetadata===void 0?{}:{circuitJsonMetadata:e.circuitJsonMetadata}});function D9r({nodeWithPortPoints:e,connMap:t,obstacles:n,obstacleMargin:o,traceWidth:r,viaDiameter:i}){let s=bZe({nodeWithPortPoints:e,obstacleMargin:o,traceWidth:r,viaDiameter:i}),a=new Set;for(let l of e.portPoints)X$(a,l);for(let l of e.portPointsInPairs??[])X$(a,l[0]),X$(a,l[1]);let c=n.flatMap((l)=>{if(!Wln(l,s))return[];let h=(({obstacle:d,nodeWithPortPoints:u,connMap:_})=>{let p=new Set(u.portPoints.flatMap((g)=>{let f=_.getNetConnectedToId(g.rootConnectionName??g.connectionName)??g.rootConnectionName??g.connectionName;return[g.connectionName,f]})),m=new Set(d.connectedTo.filter((g)=>p.has(g))),A=new Map;for(let g of p){let f=_.getNetConnectedToId(g)??g,y=A.get(f)??[];y.push(g),A.set(f,y)}for(let g of A.values()){if([...m].some((y)=>g.some((x)=>x===y||_.areIdsConnected(x,y))))continue;let f=d.connectedTo.find((y)=>g.some((x)=>x===y||_.areIdsConnected(x,y)));f!==void 0&&m.add(f)}return[...m]})({obstacle:l,nodeWithPortPoints:e,connMap:t});for(let d of h)a.add(d);return[jln({obstacle:l,connectedTo:h,preserveRotation:!0})]});return{connectivityNetMap:Xln(t,a),obstacles:c}}var N9r=(...e)=>{let t=new Map;for(let n of e)for(let[o,r]of Object.entries(n)){let i=t.get(o)??new Set;for(let s of r)i.add(s);t.set(o,i)}return Object.fromEntries([...t].map(([n,o])=>[n,[...o]]))};function R9r({nodeWithPortPoints:e,connMap:t,colorMap:n,obstacles:o,obstacleMargin:r,traceWidth:i,viaDiameter:s}){let a=bZe({nodeWithPortPoints:e,obstacleMargin:r,traceWidth:i,viaDiameter:s}),c=((d)=>[...new Set(d.portPoints.map((u)=>u.connectionName))])(e),l=o.flatMap((d)=>{if(!Wln(d,a))return[];let u=c.filter((_)=>d.connectedTo.some((p)=>p===_||t.areIdsConnected(_,p)));return u.length===0?[]:[jln({obstacle:d,connectedTo:u,preserveRotation:!1})]}),h=new Set;for(let d of e.portPoints)X$(h,d);for(let d of e.portPointsInPairs??[])X$(h,d[0]),X$(h,d[1]);for(let d of l)for(let u of[d.circuitJsonMetadata?.pcb_smtpad_id,d.circuitJsonMetadata?.pcb_plated_hole_id,d.circuitJsonMetadata?.pcb_port_id,d.circuitJsonMetadata?.pcb_via_id,...d.connectedTo??[]])u!==void 0&&h.add(u);return{connectivityNetMap:Xln(t,h),colorMap:Object.fromEntries(Object.entries(n??{}).filter(([d])=>h.has(d))),obstacles:l}}var IZe="https://hd-cache2.tscircuit.com",NWt=310000,RWt=1835008,QWt=16777216,y0=class extends Error{constructor(e,t){super(t),this.reason=e,this.name="HdCache2RequestError"}reason},kae=(e)=>e instanceof Error?e.message:String(e),Q9r=new Set(["pcb_smtpad_id","pcb_plated_hole_id","pcb_port_id","pcb_via_id","source_component_name","source_port_name"]),k9r=(e)=>!(!e||typeof e!="object"||Array.isArray(e))&&Object.entries(e).every(([t,n])=>Q9r.has(t)&&typeof n=="string"),Lae=(e,t)=>Math.abs(e-t)<=0.000000001*Math.max(1,Math.abs(e),Math.abs(t)),kWt=0.000001,L9r=(e,t)=>{let n=t==="ordinary"?kWt:0.001,o=new Set;for(let i=0;i<e.route.length-1;i++){let s=e.route[i],a=e.route[i+1],c=s.z!==a.z;if(s.toNextSegmentType==="through_obstacle"){if(!c)return!1;continue}if(s.toNextSegmentCircuitJsonMetadata!==void 0)return!1;if(!c)continue;let l=[],h=[];for(let[d,u]of e.vias.entries())Math.hypot(u.x-s.x,u.y-s.y)<=n&&l.push(d),Math.hypot(u.x-a.x,u.y-a.y)<=n&&h.push(d);if(Math.hypot(s.x-a.x,s.y-a.y)<=kWt){if(l.length===0)return!1;for(let d of l)o.add(d)}else{if(t==="regional-fallback")return!1;if(l.length===0==(h.length===0))return!1;for(let d of[...l,...h])o.add(d)}}let r=e.route.at(-1);return r.toNextSegmentType===void 0&&r.toNextSegmentCircuitJsonMetadata===void 0&&e.vias.every((i,s)=>o.has(s))},H9r=(e,t,n)=>{if(!Array.isArray(e))return!1;let o=new Map;for(let c of t.nodeWithPortPoints.portPoints){let l=o.get(c.connectionName)??[];l.push(c),o.set(c.connectionName,l)}let r=new Set(t.nodeWithPortPoints.availableZ??t.nodeWithPortPoints.portPoints.map((c)=>c.z)),i=bZe({nodeWithPortPoints:t.nodeWithPortPoints,obstacleMargin:t.obstacleMargin,traceWidth:t.traceWidth,viaDiameter:t.viaDiameter}),s=(c,l)=>(o.get(l)??[]).some((h)=>typeof c.x=="number"&&Lae(c.x,h.x)&&typeof c.y=="number"&&Lae(c.y,h.y)&&c.z===h.z);for(let c of e){if(!c||typeof c!="object")return!1;let l=c;if(typeof l.connectionName!="string"||l.connectionName.length===0||!o.has(l.connectionName)||typeof l.traceThickness!="number"||!Number.isFinite(l.traceThickness)||l.traceThickness<=0||typeof l.viaDiameter!="number"||!Number.isFinite(l.viaDiameter)||l.viaDiameter<=0||!Lae(l.viaDiameter,t.viaDiameter)||!Array.isArray(l.route)||l.route.length<2||!Array.isArray(l.vias))return!1;for(let d of[l.rootConnectionName,l.startPcbPortId,l.endPcbPortId,l.regionId])if(d!==void 0&&typeof d!="string")return!1;for(let d of l.route){if(!d||typeof d!="object")return!1;let u=d;if(typeof u.x!="number"||!Number.isFinite(u.x)||typeof u.y!="number"||!Number.isFinite(u.y)||u.x<i.minX||u.x>i.maxX||u.y<i.minY||u.y>i.maxY||typeof u.z!="number"||!Number.isInteger(u.z)||u.z<0||u.z>=t.layerCount||n==="ordinary"&&!r.has(u.z))return!1;if(u.traceThickness!==void 0&&(typeof u.traceThickness!="number"||!Number.isFinite(u.traceThickness)||u.traceThickness<=0))return!1;if(u.pcb_port_id!==void 0&&typeof u.pcb_port_id!="string")return!1;if(u.insideJumperPad!==void 0&&typeof u.insideJumperPad!="boolean")return!1;if(u.toNextSegmentType!==void 0&&u.toNextSegmentType!=="through_obstacle")return!1;if(u.toNextSegmentCircuitJsonMetadata!==void 0&&!k9r(u.toNextSegmentCircuitJsonMetadata))return!1}let h=l.route;if(!(n!=="ordinary"||s(h[0],l.connectionName)&&s(h.at(-1),l.connectionName)))return!1;for(let d of l.vias){if(!d||typeof d!="object")return!1;let u=d;if(typeof u.x!="number"||!Number.isFinite(u.x)||typeof u.y!="number"||!Number.isFinite(u.y)||u.x<i.minX||u.x>i.maxX||u.y<i.minY||u.y>i.maxY)return!1}if(!L9r(l,n))return!1;if(l.jumpers!==void 0){if(!Array.isArray(l.jumpers))return!1;for(let d of l.jumpers){if(!d||typeof d!="object")return!1;let u=d,{start:_,end:p}=u;if(u.route_type!=="jumper"||u.footprint!=="0603"&&u.footprint!=="1206"&&u.footprint!=="1206x4_pair"||!_||typeof _.x!="number"||!Number.isFinite(_.x)||typeof _.y!="number"||!Number.isFinite(_.y)||!p||typeof p.x!="number"||!Number.isFinite(p.x)||typeof p.y!="number"||!Number.isFinite(p.y)||_.x<i.minX||_.x>i.maxX||_.y<i.minY||_.y>i.maxY||p.x<i.minX||p.x>i.maxX||p.y<i.minY||p.y>i.maxY)return!1}}}let a=e;return n==="ordinary"?((c,l)=>{let h=l.portPointsInPairs??[];if(h.length>0){for(let[u,_]of h)if(!KCe(c,u.connectionName,z4(u)).has(z4(_)))return!1;return!0}let d=new Map;for(let u of l.portPoints){let _=d.get(u.connectionName)??[];_.push(u),d.set(u.connectionName,_)}for(let[u,_]of d)for(let[p,m]of kce(_))if(!KCe(c,u,z4(p)).has(z4(m)))return!1;return!0})(a,t.nodeWithPortPoints):((c,l)=>{let h=(m,A)=>{if(m.z!==A.z)return!1;let g=m.x-A.x,f=m.y-A.y;return Math.hypot(g,f)<=0.001},d=new Map;for(let m of c){let A=m.route.some((C,b)=>{let I=m.route[b+1];return!(I===void 0||Lae(C.x,I.x)&&Lae(C.y,I.y)&&C.z===I.z)}),g=m.route[0],f=m.route.at(-1);if(!A||!g||!f)return!1;let y=l.portPoints.filter((C)=>C.connectionName===m.connectionName);if(!y.some((C)=>h(g,C))||!y.some((C)=>h(f,C)))return!1;let x=d.get(m.connectionName)??[];x.push({start:g,end:f}),d.set(m.connectionName,x)}let u=(m,A,g)=>{if(h(A,g))return!0;let f=d.get(m)??[],y=[],x=new Set;for(let[C,b]of f.entries())(h(A,b.start)||h(A,b.end))&&(y.push(C),x.add(C));for(;y.length>0;){let C=f[y.pop()];if(h(g,C.start)||h(g,C.end))return!0;for(let[b,I]of f.entries())x.has(b)||(h(C.start,I.start)||h(C.start,I.end)||h(C.end,I.start)||h(C.end,I.end))&&(x.add(b),y.push(b))}return!1},_=l.portPointsInPairs??[];if(_.length>0)return _.every(([m,A])=>u(m.connectionName,m,A));let p=new Map;for(let m of l.portPoints){let A=p.get(m.connectionName)??[];A.push(m),p.set(m.connectionName,A)}return[...p].every(([,m])=>kce(m).every(([A,g])=>u(A.connectionName,A,g)))})(a,t.nodeWithPortPoints)},F9r=class{constructor(e,t=IZe,n={}){this.autorouterVersion=e,this.serverUrl=t;let{cacheVersion:o}=n;if(o!==void 0&&o.trim().length===0)throw Error("hd-cache2 cacheVersion must not be empty");this.cacheVersion=o}autorouterVersion;serverUrl;cacheVersion;stats={batchRequestsStarted:0,batchRequestsCompleted:0,batchItemsStarted:0,batchBodyBytesStarted:0,batchMaxBodyBytes:0,batchCacheMisses:0,singleRequestsStarted:0,batchInvalidLines:0,batchUnknownRequestIds:0,batchDuplicateRequestIds:0};solveMany(e){let t=e.map((i,s)=>this.createPendingSolve(String(s),i)),n=t.filter((i)=>i.serializedItem!==null),{batches:o,singletonSolves:r}=this.prepareBatches(n);for(let i of o)this.fetchBatch(i);for(let i of r)this.launchSingleSolve(i);return t.map((i)=>i.promise)}createPendingSolve(e,t){let n,o={requestId:e,input:t,serializedItem:null,promise:new Promise((r)=>{n=r}),resolve:n,settled:!1,singleSolveStarted:!1};try{o.serializedItem=JSON.stringify({requestId:e,input:t})}catch(r){this.settleWithFallback(o,"request_serialization_error",kae(r))}return o}settle(e,t){e.settled||(e.settled=!0,e.resolve(t))}settleWithFallback(e,t,n){this.settle(e,{kind:"local-fallback",reason:t,error:n})}parseSuccessfulResponse(e,t){if(!e||typeof e!="object"||Array.isArray(e))throw new y0("invalid_response","hd-cache2 returned a non-object response");let n=e;if(n.ok!==!0)throw new y0("remote_error",typeof n.message=="string"?n.message:"hd-cache2 returned an unsuccessful response");if(n.autorouterVersion!==this.autorouterVersion)throw new y0("version_mismatch",`hd-cache2 returned autorouter version ${String(n.autorouterVersion)}, expected ${this.autorouterVersion}`);if(n.cacheVersion!==this.cacheVersion)throw new y0("cache_version_mismatch",`hd-cache2 returned cache version ${String(n.cacheVersion)}, expected ${String(this.cacheVersion)}`);if(n.source!=="cache"&&n.source!=="solver")throw new y0("invalid_response","hd-cache2 returned an invalid cache source");if(n.solutionStage!=="ordinary"&&n.solutionStage!=="regional-fallback")throw new y0("invalid_response","hd-cache2 returned an invalid solution stage");if(n.solutionStage==="regional-fallback"&&(!t.enableRegionalFallback||typeof n.ordinaryFailure!="string"||n.ordinaryFailure.length===0))throw new y0("invalid_response","hd-cache2 returned invalid regional fallback metadata");if(n.solutionStage==="ordinary"&&Object.prototype.hasOwnProperty.call(n,"ordinaryFailure"))throw new y0("invalid_response","hd-cache2 returned regional metadata on an ordinary result");if(n.solutionStage==="ordinary"&&n.status==="failed"&&t.enableRegionalFallback)throw new y0("invalid_response","hd-cache2 returned an intermediate ordinary failure");if(n.status==="solved"&&H9r(n.routes,t,n.solutionStage))return n;if(n.status==="failed"&&typeof n.error=="string"&&n.error.length>0)return n;throw new y0("invalid_response","hd-cache2 returned an invalid solve result")}parseBatchCacheMiss(e){if(e.ok!==!1||e.code!=="CACHE_MISS")return null;if(e.autorouterVersion!==this.autorouterVersion)throw new y0("version_mismatch",`hd-cache2 returned autorouter version ${String(e.autorouterVersion)}, expected ${this.autorouterVersion}`);if(e.cacheVersion!==this.cacheVersion)throw new y0("cache_version_mismatch",`hd-cache2 returned cache version ${String(e.cacheVersion)}, expected ${String(this.cacheVersion)}`);if(typeof e.message!="string")throw new y0("invalid_response","hd-cache2 returned an invalid cache miss response");return e}async fetchSingle(e){let t=new AbortController,n=!1,o=setTimeout(()=>{n=!0,t.abort(Error("hd-cache2 transport timed out after 310000ms"))},NWt);o.unref?.();try{let i={autorouterVersion:this.autorouterVersion,...this.cacheVersion===void 0?{}:{cacheVersion:this.cacheVersion},input:e.input},s;try{s=JSON.stringify(i)}catch(h){throw new y0("request_serialization_error",kae(h))}let a=await fetch((r=this.serverUrl,/\/solve\/?$/.test(r)?r.replace(/\/+$/,""):`${r.replace(/\/+$/,"")}/solve`),{method:"POST",headers:{accept:"application/json","content-type":"application/json"},body:s,signal:t.signal}),c=await a.text(),l=null;try{l=c?JSON.parse(c):null}catch{if(!a.ok)throw new y0("http_error",`hd-cache2 request failed with status ${a.status}`);throw new y0("invalid_json",`hd-cache2 returned invalid JSON with status ${a.status}`)}if(!a.ok){let h=l&&typeof l=="object"&&"message"in l&&typeof l.message=="string"?l.message:`hd-cache2 request failed with status ${a.status}`;throw new y0("http_error",h)}this.settle(e,{kind:"remote",response:this.parseSuccessfulResponse(l,e.input)})}catch(i){let s=i instanceof y0?i.reason:n?"transport_timeout":"transport_error";this.settleWithFallback(e,s,kae(i))}finally{clearTimeout(o)}var r}launchSingleSolve(e){e.singleSolveStarted||e.settled||(e.singleSolveStarted=!0,this.stats.singleRequestsStarted+=1,this.fetchSingle(e))}handleBatchResponseLine(e,t,n){if(e.trim().length===0)return;if(e.length>QWt)throw new y0("response_too_large","hd-cache2 returned an oversized batch result line");let o;try{o=JSON.parse(e)}catch{return void(this.stats.batchInvalidLines+=1)}if(!o||typeof o!="object"||Array.isArray(o))return void(this.stats.batchInvalidLines+=1);let r=o,i=r.requestId;if(typeof i!="string")return void(this.stats.batchInvalidLines+=1);let s=t.get(i);if(s)if(n.has(i))this.stats.batchDuplicateRequestIds+=1;else{n.add(i);try{if(this.parseBatchCacheMiss(r))return this.stats.batchCacheMisses+=1,void this.launchSingleSolve(s);this.settle(s,{kind:"remote",response:this.parseSuccessfulResponse(r,s.input)})}catch(a){this.stats.batchInvalidLines+=1,this.settleWithFallback(s,a instanceof y0?a.reason:"invalid_response",kae(a))}}else this.stats.batchUnknownRequestIds+=1}async readBatchResponse(e,t){if(!e.body)throw new y0("invalid_response","hd-cache2 returned an empty batch response body");let n=new Map(t.items.map((a)=>[a.requestId,a])),o=new Set,r=new TextDecoder,i=e.body.getReader(),s="";for(;o.size<t.items.length;){let{done:a,value:c}=await i.read();if(s+=r.decode(c,{stream:!a}),s.length>QWt&&!s.includes(`
`))throw new y0("response_too_large","hd-cache2 returned an oversized unterminated batch result line");let l=s.indexOf(`
`);for(;l>=0;){let h=s.slice(0,l);s=s.slice(l+1),this.handleBatchResponseLine(h,n,o),l=s.indexOf(`
`)}if(a){s.trim().length>0&&this.handleBatchResponseLine(s,n,o);break}}if(o.size!==t.items.length)for(let a of t.items)o.has(a.requestId)||this.settleWithFallback(a,"missing_response",`hd-cache2 batch ended without result ${a.requestId}`);else await i.cancel().catch(()=>{})}async fetchBatch(e){let t=new AbortController,n=!1,o=setTimeout(()=>{n=!0,t.abort(Error("hd-cache2 batch transport timed out after 310000ms"))},NWt);o.unref?.(),this.stats.batchRequestsStarted+=1,this.stats.batchItemsStarted+=e.items.length,this.stats.batchBodyBytesStarted+=e.bodyBytes,this.stats.batchMaxBodyBytes=Math.max(this.stats.batchMaxBodyBytes,e.bodyBytes);try{let r=await fetch(((i)=>{let s=i.replace(/\/+$/,"");return/\/solve-batch$/.test(s)?s:/\/solve$/.test(s)?s.replace(/\/solve$/,"/solve-batch"):`${s}/solve-batch`})(this.serverUrl),{method:"POST",headers:{accept:"application/x-ndjson","content-type":"application/json"},body:e.body,signal:t.signal});if(!r.ok){let i=await r.text().catch(()=>""),s=`hd-cache2 batch request failed with status ${r.status}`;try{let a=i?JSON.parse(i):null;a&&typeof a=="object"&&"message"in a&&typeof a.message=="string"&&(s=a.message)}catch{}throw new y0("http_error",s)}await this.readBatchResponse(r,e)}catch(r){let i=r instanceof y0?r.reason:n?"transport_timeout":"transport_error";for(let s of e.items)s.singleSolveStarted||this.settleWithFallback(s,i,kae(r))}finally{clearTimeout(o),this.stats.batchRequestsCompleted+=1}}prepareBatches(e){let t=new TextEncoder,n=this.cacheVersion===void 0?"":`,"cacheVersion":${JSON.stringify(this.cacheVersion)}`,o=`{"autorouterVersion":${JSON.stringify(this.autorouterVersion)}${n},"items":[`,r=t.encode(o+"]}").byteLength,i=[],s=[],a=[],c=r,l=()=>{a.length!==0&&(i.push({body:`${o}${a.map((h)=>h.serializedItem).join(",")}]}`,bodyBytes:c,items:a}),a=[],c=r)};for(let h of e){let d=t.encode(h.serializedItem).byteLength,u=a.length===0?0:1;r+d>RWt?(l(),s.push(h)):((a.length>=100||c+u+d>RWt)&&l(),a.push(h),c+=(a.length===1?0:1)+d)}return l(),{batches:i,singletonSolves:s}}},z9r="ordinary_then_regional_without_fixed_copper_v1",O9r=class extends xZe{autorouterVersion;hdCache2ServerUrl;hdCache2CacheVersion;requestTimeoutMs;hdCache2Client;launchedRemoteSolves=!1;waitingForRemoteNode=null;remoteRequestByNode=new Map;remoteResultByNode=new Map;logicallyTimedOutNodes=new Set;constructor({autorouterVersion:e,hdCache2ServerUrl:t,hdCache2CacheVersion:n,requestTimeoutMs:o,...r}){if(super(r),r.effort!==1)throw Error(`Pipeline9 networked high-density routing requires effort=1, received ${r.effort}`);if(this.requestTimeoutMs=o??30000,!Number.isFinite(this.requestTimeoutMs)||this.requestTimeoutMs<=0)throw Error(`Pipeline9 network request timeout must be a positive number, received ${this.requestTimeoutMs}`);this.autorouterVersion=e,this.hdCache2ServerUrl=t??IZe,this.hdCache2CacheVersion=n,this.hdCache2Client=new F9r(this.autorouterVersion,this.hdCache2ServerUrl,{cacheVersion:n}),this.pendingEffects=[],this.stats={...this.stats,remoteRequestsStarted:0,remoteRequestsCompleted:0,remoteBatchRequestsStarted:0,remoteBatchRequestsCompleted:0,remoteBatchItemsStarted:0,remoteBatchBodyBytesStarted:0,remoteBatchMaxBodyBytes:0,remoteBatchCacheMisses:0,remoteSingleRequestsStarted:0,remoteBatchInvalidLines:0,remoteBatchUnknownRequestIds:0,remoteBatchDuplicateRequestIds:0,remoteCacheHits:0,remoteSolverResults:0,remoteSolvedResults:0,remoteFailedResults:0,remoteOrdinaryResults:0,remoteRegionalFallbackResults:0,remoteRegionalFallbackResultsApplied:0,remoteRegionalFallbackResultsDeferredToLocal:0,remoteTransportFallbacks:0,remoteLogicalTimeoutFallbacks:0,remoteFallbackReasonCounts:{}}}getSolverName(){return"Pipeline9NetworkedHighDensitySolver"}async waitForAllRemoteRequests(){let e=[...this.remoteRequestByNode.values()];e.length!==0?(await Promise.all(e.map(({promise:t})=>t)),this.syncClientStats()):this.syncClientStats()}createNodeInput(e){let t=this.enableRegionalFallback?D9r({nodeWithPortPoints:e,connMap:this.connMap,obstacles:this.obstacles,obstacleMargin:this.obstacleMargin,traceWidth:this.traceWidth,viaDiameter:this.viaDiameter}):{connectivityNetMap:{},obstacles:[]},n=R9r({nodeWithPortPoints:e,connMap:this.connMap,colorMap:this.colorMap,obstacles:this.enableRegionalFallback?t.obstacles:this.obstacles,obstacleMargin:this.obstacleMargin,traceWidth:this.traceWidth,viaDiameter:this.viaDiameter});return{solvePolicy:z9r,enableRegionalFallback:this.enableRegionalFallback,nodeWithPortPoints:e,connectivityNetMap:N9r(n.connectivityNetMap,t.connectivityNetMap),colorMap:n.colorMap,viaDiameter:this.viaDiameter,traceWidth:this.traceWidth,obstacleMargin:this.obstacleMargin,effort:1,obstacles:n.obstacles,boardGeometry:this.boardGeometry,regionalObstacles:t.obstacles,layerCount:this.layerCount,nodePf:this.nodePfById.get(e.capacityMeshNodeId)??null}}syncClientStats(){let e=this.hdCache2Client.stats;this.stats.remoteBatchRequestsStarted=e.batchRequestsStarted,this.stats.remoteBatchRequestsCompleted=e.batchRequestsCompleted,this.stats.remoteBatchItemsStarted=e.batchItemsStarted,this.stats.remoteBatchBodyBytesStarted=e.batchBodyBytesStarted,this.stats.remoteBatchMaxBodyBytes=e.batchMaxBodyBytes,this.stats.remoteBatchCacheMisses=e.batchCacheMisses,this.stats.remoteSingleRequestsStarted=e.singleRequestsStarted,this.stats.remoteBatchInvalidLines=e.batchInvalidLines,this.stats.remoteBatchUnknownRequestIds=e.batchUnknownRequestIds,this.stats.remoteBatchDuplicateRequestIds=e.batchDuplicateRequestIds}recordFallbackReason(e){let t=this.stats.remoteFallbackReasonCounts;t[e]=(t[e]??0)+1}trackRemoteSolve(e,t){let n=performance.now()+this.requestTimeoutMs;this.stats.remoteRequestsStarted+=1;let o=t.then((r)=>{let i=this.logicallyTimedOutNodes.has(e);i||this.remoteResultByNode.set(e,r),r.kind==="remote"?(r.response.source==="cache"&&(this.stats.remoteCacheHits+=1),r.response.source==="solver"&&(this.stats.remoteSolverResults+=1),r.response.status==="solved"?this.stats.remoteSolvedResults+=1:this.stats.remoteFailedResults+=1):i||(this.stats.remoteTransportFallbacks+=1,this.recordFallbackReason(r.reason)),this.stats.remoteRequestsCompleted+=1,this.syncClientStats()});this.remoteRequestByNode.set(e,{promise:o,deadlineAt:n})}launchRemoteSolves(){let e=[],t=[...this.unsolvedNodePortPoints].reverse();for(let o of t)try{e.push({node:o,input:this.createNodeInput(o)})}catch(r){this.trackRemoteSolve(o,Promise.resolve({kind:"local-fallback",reason:"request_serialization_error",error:r instanceof Error?r.message:String(r)}))}let n=this.hdCache2Client.solveMany(e.map(({input:o})=>o));for(let[o,r]of n.entries())this.trackRemoteSolve(e[o].node,r);this.syncClientStats()}async waitForCurrentRemoteNode(e,t){let n=t.deadlineAt-performance.now();if(n<=0)return void this.recordLogicalTimeout(e);let o,r=await Promise.race([t.promise.then(()=>"request-settled"),new Promise((i)=>{o=setTimeout(()=>i("logical-timeout"),n)})]);o!==void 0&&clearTimeout(o),r==="logical-timeout"&&this.recordLogicalTimeout(e)}recordLogicalTimeout(e){this.logicallyTimedOutNodes.add(e),this.stats.remoteLogicalTimeoutFallbacks+=1,this.stats.remoteTransportFallbacks+=1,this.recordFallbackReason("logical_timeout")}startRegularSolver(e){let t=this.remoteResultByNode.get(e);if(!t){let n=this.remoteRequestByNode.get(e);if(n){this.waitingForRemoteNode=e;let o=this.waitForCurrentRemoteNode(e,n);o.then(()=>{this.waitingForRemoteNode===e&&(this.pendingEffects=[])});let r={name:`hd-cache2:${e.capacityMeshNodeId}`,promise:o};return void(this.pendingEffects=[r])}return void super.startRegularSolver(e)}this.applyRemoteResultToRegularNode(e,t)}applyRemoteResultToRegularNode(e,t){if(t.kind!=="local-fallback"){if(this.stats.regularNodeCount=Number(this.stats.regularNodeCount??0)+1,this.activeNode=e,t.response.solutionStage==="regional-fallback"){if(this.stats.remoteRegionalFallbackResults+=1,!this.canUseNoFixedCopperRegionalResult(e))return this.stats.remoteRegionalFallbackResultsDeferredToLocal+=1,void this.finishRegularSolverFailure(t.response.ordinaryFailure);this.stats.remoteRegionalFallbackResultsApplied+=1,this.stats.fallbackNodeCount=Number(this.stats.fallbackNodeCount??0)+1}else this.stats.remoteOrdinaryResults+=1;if(t.response.status==="failed")return this.error=t.response.error,this.failed=!0,void(this.activeNode=null);this.finishActiveNode(t.response.routes)}else super.startRegularSolver(e)}canUseNoFixedCopperRegionalResult(e){let t={...Tce(e,this.connMap),availableZ:Array.from({length:this.layerCount},(o,r)=>r)},n=Cle(t,this.getUpdatedFixedHdRoutes());return n.fixedRouteSectionsByConnectionName.size===0&&n.fixedObstacleRoutes.length===0}_step(){if(this.syncClientStats(),this.launchedRemoteSolves||(this.launchedRemoteSolves=!0,this.launchRemoteSolves()),this.waitingForRemoteNode){let e=this.waitingForRemoteNode;if(this.logicallyTimedOutNodes.has(e))return this.waitingForRemoteNode=null,this.pendingEffects=[],void super.startRegularSolver(e);let t=this.remoteResultByNode.get(e);if(!t)return;return this.waitingForRemoteNode=null,this.pendingEffects=[],void this.applyRemoteResultToRegularNode(e,t)}super._step()}},S6e=class extends jle{hdCache2ServerUrl;hdCache2CacheVersion;getSolverName(){return"AutoroutingPipelineSolver9_Networked"}constructor(e,t={}){if(super(e,t),this.effort!==1)throw Error(`AutoroutingPipelineSolver9_Networked is only available at effort=1, received ${this.effort}`);this.hdCache2ServerUrl=t.hdCache2ServerUrl??IZe,this.hdCache2CacheVersion=t.hdCache2CacheVersion,this.replaceHighDensityPipelineStep()}replaceHighDensityPipelineStep(){let e=this.pipelineDef.findIndex((o)=>o.solverName==="highDensityRouteSolver"),t=this.pipelineDef[e];if(!t)throw Error("Pipeline9 highDensityRouteSolver step is missing");let n=t.getConstructorParams;this.pipelineDef[e]={...t,solverClass:O9r,getConstructorParams:(o)=>{let[r]=n(o);return[{...r,autorouterVersion:T9r,hdCache2ServerUrl:o.hdCache2ServerUrl,hdCache2CacheVersion:o.hdCache2CacheVersion}]}}}async stepAsync(){if(this.solved||this.failed)return;this.step();let e=Wcn(this);e.length!==0&&(await Promise.race(e.map((t)=>t.promise.then(()=>t.name,()=>t.name))),this.solved||this.failed||this.step())}async solveAsync(){let e=Date.now();for(;!this.solved&&!this.failed;)await this.stepAsync();this.timeToSolve=Date.now()-e}async solveUntilPhaseAsync(e){for(;this.getCurrentPhase()!==e&&!this.solved&&!this.failed;)await this.stepAsync()}solve(){throw Error("AutoroutingPipelineSolver9_Networked requires async execution. Use solveAsync() or stepAsync().")}solveUntilPhase(e){throw Error("AutoroutingPipelineSolver9_Networked requires solveUntilPhaseAsync().")}};var ZNs=globalThis.process?.env?.FANOUT_FLOW_DEBUG==="1";var V9r=class extends fa{constructor(e){super(),this.inputProblem=e,this.simplifiedRouteByTraceId=new Map(e.simplifiedHdRoutes.map((t)=>[t.connectionName,t])),this.MAX_ITERATIONS=e.preparedInput.preparedTraces.length+1}inputProblem;simplifiedRouteByTraceId;outputTraces=[];nextTraceIndex=0;getSolverName(){return"ApplyTraceSimplificationSolver"}_step(){let e=this.inputProblem.preparedInput.preparedTraces,t=e[this.nextTraceIndex];t?(this.outputTraces.push(this.applyTrace(t)),this.nextTraceIndex++,this.progress=this.nextTraceIndex/Math.max(1,e.length)):this.finishApplication()}applyTrace(e){if(!e.mutableHdRoute)return structuredClone(e.originalTrace);let t=this.simplifiedRouteByTraceId.get(e.originalTrace.pcb_trace_id);if(!t||e.uniformTraceWidth===void 0)throw Error(`Simplification removed trace "${e.originalTrace.pcb_trace_id}"`);let n=V4(t,this.inputProblem.preparedInput.srj.layerCount,{defaultViaHoleDiameter:e.viaHoleDiameter,obstacles:this.inputProblem.preparedInput.srj.obstacles,connMap:this.inputProblem.preparedInput.connMap}),o=n.filter((i)=>i.route_type==="jumper"),r=((i,s)=>i.map((a)=>a.route_type==="wire"||a.route_type==="through_obstacle"?{...a,width:s}:a))([...structuredClone(e.leadingTerminalVias),...n.filter((i)=>i.route_type!=="jumper"),...structuredClone(e.trailingTerminalVias),...o],e.uniformTraceWidth);return((i,s)=>{let a=i.filter((c)=>c.route_type==="wire");s.startPcbPortId&&a[0]&&(a[0].start_pcb_port_id=s.startPcbPortId),s.endPcbPortId&&a.at(-1)&&(a.at(-1).end_pcb_port_id=s.endPcbPortId)})(r,t),{...structuredClone(e.originalTrace),route:r}}finishApplication(){let e=this.inputProblem.preparedInput.preparedTraces;this.stats={inputTraceCount:e.length,outputTraceCount:this.outputTraces.length,inputRoutePointCount:e.reduce((t,n)=>t+n.originalTrace.route.length,0),outputRoutePointCount:this.outputTraces.reduce((t,n)=>t+n.route.length,0)},this.progress=1,this.solved=!0}getConstructorParams(){return[this.inputProblem]}getOutput(){if(!this.solved)throw Error("Cannot get applied traces before conversion completes");return{...structuredClone(this.inputProblem.preparedInput.originalSrj),traces:structuredClone(this.outputTraces)}}},Hae=(e,t)=>{let n=e.at(-1);if(n&&(o=n,r=t,Math.abs(o.x-r.x)<=0.000000001&&Math.abs(o.y-r.y)<=0.000000001&&o.z===r.z))return t.traceThickness!==void 0&&(n.traceThickness=t.traceThickness),void(t.pcb_port_id!==void 0&&(n.pcb_port_id=t.pcb_port_id));var o,r;e.push(t)},Y9r=(e,t,n)=>{for(let o=t+1;o<e.length;o++){let r=e[o];if(r.route_type==="wire")return ti(r.layer,n);if(r.route_type==="through_obstacle")return ti(r.from_layer,n)}},G9r=({fromZ:e,toZ:t,previousZ:n,nextZ:o})=>n===e?[e,t]:n===t?[t,e]:o===t?[e,t]:o===e?[t,e]:[e,t],U9r=(e,t)=>{for(let n of e)if(n.route_type==="via"&&n.via_diameter!==void 0)return n.via_diameter;return t},LWt=(e,t)=>{let n=t==="start"?e:[...e].reverse();for(let o of n){if(o.route_type!=="wire")continue;let r=t==="start"?o.start_pcb_port_id:o.end_pcb_port_id;if(r)return r}},W9r=(e)=>({route_type:"jumper",start:{...e.start},end:{...e.end},footprint:e.footprint}),X9r=(e,t)=>{for(let n of e.route)if(n.route_type==="via"&&n.via_hole_diameter!==void 0)return n.via_hole_diameter;return t},j9r=class extends fa{preparedInput;seenTraceIds=new Set;nextTraceIndex=0;constructor(e){super();let t=structuredClone(e.inputSrj),n=pS(t),o=Ep(n);this.preparedInput={originalSrj:t,srj:n,connMap:o,colorMap:yA(n,o),immutableHdRoutes:[],mutableHdRoutes:[],netByConnectionName:new Map,options:{...e.options},preparedTraces:[]},this.MAX_ITERATIONS=(n.traces?.length??0)+1}getSolverName(){return"PrepareTraceSimplificationSolver"}_step(){let e=this.preparedInput.srj.traces??[],t=e[this.nextTraceIndex];if(!t)return this.stats={inputTraceCount:e.length,mutableTraceCount:this.preparedInput.mutableHdRoutes.length,immutableTraceCount:e.length-this.preparedInput.mutableHdRoutes.length},this.progress=1,void(this.solved=!0);this.prepareTrace(t,this.nextTraceIndex),this.nextTraceIndex++,this.progress=this.nextTraceIndex/Math.max(1,e.length)}prepareTrace(e,t){if(this.seenTraceIds.has(e.pcb_trace_id))throw Error(`Duplicate pcb_trace_id "${e.pcb_trace_id}"`);this.seenTraceIds.add(e.pcb_trace_id);let n=Pp(this.preparedInput.srj),o=((d)=>{let u=d.route.flatMap((p)=>p.route_type==="wire"||p.route_type==="through_obstacle"?[p.width]:[]),_=u[0];if(_!==void 0&&!u.some((p)=>Math.abs(p-_)>0.000000001))return _})(e),{traceToSimplify:r,leadingTerminalVias:i,trailingTerminalVias:s}=((d)=>{let u=0;for(;d.route[u]?.route_type==="via";)u++;let _=d.route.length;for(;d.route[_-1]?.route_type==="jumper";)_--;let p=_;for(;p>u&&d.route[p-1]?.route_type==="via";)p--;return{traceToSimplify:{...d,route:[...d.route.slice(u,p),...d.route.slice(_)]},leadingTerminalVias:d.route.slice(0,u),trailingTerminalVias:d.route.slice(p,_)}})(e),a=this.preparedInput.connMap.getNetConnectedToId(e.connection_name)??e.connection_name,c=o===void 0?void 0:((d,u)=>{let _=[],p=[],m=[],A=((g,f)=>{for(let y of g)if(y.route_type==="wire"||y.route_type==="through_obstacle")return y.width;return f})(d.route,u.defaultTraceThickness);for(let g=0;g<d.route.length;g++){let f=d.route[g];if(f.route_type==="jumper"){m.push(W9r(f));continue}if(f.route_type==="wire"){Hae(_,{x:f.x,y:f.y,z:ti(f.layer,u.layerCount),traceThickness:f.width,pcb_port_id:f.start_pcb_port_id??f.end_pcb_port_id});continue}let y=ti(f.from_layer,u.layerCount),x=ti(f.to_layer,u.layerCount),[C,b]=G9r({fromZ:y,toZ:x,previousZ:_.at(-1)?.z,nextZ:Y9r(d.route,g,u.layerCount)});if(f.route_type==="via"){Hae(_,{x:f.x,y:f.y,z:C,traceThickness:A}),Hae(_,{x:f.x,y:f.y,z:b,traceThickness:A}),p.push({x:f.x,y:f.y});continue}let I=C===y,v=I?f.start:f.end,P=I?f.end:f.start;Hae(_,{...v,z:C,traceThickness:f.width,toNextSegmentType:"through_obstacle",...f.circuitJsonMetadata?{toNextSegmentCircuitJsonMetadata:f.circuitJsonMetadata}:{}}),Hae(_,{...P,z:b,traceThickness:f.width})}return{connectionName:d.pcb_trace_id,rootConnectionName:u.rootConnectionName,startPcbPortId:LWt(d.route,"start"),endPcbPortId:LWt(d.route,"end"),traceThickness:A,viaDiameter:U9r(d.route,u.defaultViaDiameter),route:_,vias:p,...m.length>0?{jumpers:m}:{}}})(r,{layerCount:this.preparedInput.srj.layerCount,defaultTraceThickness:o,defaultViaDiameter:n.padDiameter,rootConnectionName:a}),l=c&&c.route.length>=2?c:void 0;if(this.preparedInput.preparedTraces.push({originalTrace:e,mutableHdRoute:l,leadingTerminalVias:i,trailingTerminalVias:s,uniformTraceWidth:o,viaHoleDiameter:X9r(e,n.holeDiameter)}),!l)return void this.preparedInput.immutableHdRoutes.push(...xw(e,t,this.preparedInput.srj.layerCount,n.padDiameter,this.preparedInput.connMap));this.preparedInput.mutableHdRoutes.push(l),this.preparedInput.netByConnectionName.set(l.connectionName,a),this.preparedInput.colorMap[l.connectionName]=this.preparedInput.colorMap[a]??this.preparedInput.colorMap[e.connection_name]??"#2563eb";let h={...e,route:[...i,...s]};this.preparedInput.immutableHdRoutes.push(...xw(h,t,this.preparedInput.srj.layerCount,n.padDiameter,this.preparedInput.connMap))}getOutput(){if(!this.solved)throw Error("Cannot get prepared traces before preparation completes");return this.preparedInput}},K9r=class extends fa{constructor(e){super(),this.inputProblem=e;let t=e.preparedInput,n=Pp(t.srj);this.traceSimplificationSolver=new Ab({hdRoutes:t.mutableHdRoutes,otherHdRoutes:t.immutableHdRoutes,obstacles:t.srj.obstacles,connMap:t.connMap,colorMap:t.colorMap,outline:t.srj.outline,defaultViaDiameter:n.padDiameter,layerCount:t.srj.layerCount,minTraceToPadEdgeClearance:t.srj.minTraceToPadEdgeClearance,minBoardEdgeClearance:t.srj.minBoardEdgeClearance,netByConnectionName:t.netByConnectionName,enableCrossingViaReduction:t.options.enableCrossingViaReduction??!0,preserveRouteEndpoints:!0,useTraceWidthAwareClearance:!0,enableVertexShortcuts:t.options.enableVertexShortcuts??!0}),this.traceSimplificationSolver.MAX_SIMPLIFICATION_PIPELINE_LOOPS=t.options.iterations??2,this.activeSubSolver=this.traceSimplificationSolver,this.MAX_ITERATIONS=this.traceSimplificationSolver.MAX_ITERATIONS+1}inputProblem;traceSimplificationSolver;getSolverName(){return"TraceSimplificationStageSolver"}_step(){if(this.traceSimplificationSolver.step(),this.progress=this.traceSimplificationSolver.progress,this.stats={...this.traceSimplificationSolver.stats},this.traceSimplificationSolver.failed)return this.error=this.traceSimplificationSolver.error??"Trace simplification failed",this.failed=!0,void(this.activeSubSolver=null);this.traceSimplificationSolver.solved&&(this.progress=1,this.solved=!0,this.activeSubSolver=null)}getConstructorParams(){return[this.inputProblem]}getOutput(){if(!this.solved)throw Error("Cannot get simplified routes before cleanup completes");return structuredClone(this.traceSimplificationSolver.simplifiedHdRoutes)}visualize(){return this.traceSimplificationSolver.visualize()}preview(){return this.traceSimplificationSolver.preview()}},$9r=class extends fa{constructor(e){super(),this.inputProblem=e;let t=e.preparedInput;this.drcEngine=new Dle(t.srj,{connMap:t.connMap,traceClearance:t.srj.minTraceToPadEdgeClearance??0.1,viaClearance:0.1}),this.MAX_ITERATIONS=3}inputProblem;drcEngine;phase="baseline";baselineErrorCounts={};outputErrorCounts={};getSolverName(){return"ValidateTraceSimplificationSolver"}_step(){return this.phase==="baseline"?(this.baselineErrorCounts=this.evaluateErrorCounts(this.inputProblem.preparedInput.originalSrj),this.phase="output",void(this.progress=0.3333333333333333)):this.phase==="output"?(this.outputErrorCounts=this.evaluateErrorCounts(this.inputProblem.outputSrj),this.phase="compare",void(this.progress=0.6666666666666666)):(this.assertNoNewDrcErrors(),this.stats={baselineErrorCounts:this.baselineErrorCounts,outputErrorCounts:this.outputErrorCounts},this.progress=1,void(this.solved=!0))}evaluateErrorCounts(e){return((t)=>{let n={};for(let o of t.errors)n[o.type]=(n[o.type]??0)+1;return n})(this.drcEngine.evaluate(e.traces??[]))}assertNoNewDrcErrors(){let e=[...new Set([...Object.keys(this.baselineErrorCounts),...Object.keys(this.outputErrorCounts)])].filter((n)=>(this.outputErrorCounts[n]??0)>(this.baselineErrorCounts[n]??0));if(e.length===0)return;let t=e.map((n)=>`${n}: ${this.baselineErrorCounts[n]??0} -> ${this.outputErrorCounts[n]??0}`).join(", ");throw Error(`Pipeline 11 simplification introduced DRC errors (${t})`)}getConstructorParams(){return[this.inputProblem]}getOutput(){if(!this.solved)throw Error("Cannot get Pipeline 11 output before DRC validation");return structuredClone(this.inputProblem.outputSrj)}},Kln=class extends mS{prepareTraceSimplificationSolver;traceSimplificationStageSolver;applyTraceSimplificationSolver;validateTraceSimplificationSolver;pipelineDef=[b0("prepareTraceSimplificationSolver",j9r,(e)=>[{inputSrj:e.inputProblem.inputSrj,options:e.inputProblem.options}]),b0("traceSimplificationStageSolver",K9r,(e)=>[{preparedInput:e.prepareTraceSimplificationSolver.getOutput()}]),b0("applyTraceSimplificationSolver",V9r,(e)=>[{preparedInput:e.prepareTraceSimplificationSolver.getOutput(),simplifiedHdRoutes:e.traceSimplificationStageSolver.getOutput()}]),b0("validateTraceSimplificationSolver",$9r,(e)=>[{preparedInput:e.prepareTraceSimplificationSolver.getOutput(),outputSrj:e.applyTraceSimplificationSolver.getOutput()}])];constructor(e,t={}){if(t.iterations!==void 0&&(!Number.isInteger(t.iterations)||t.iterations<1))throw Error("Simplification iterations must be a positive integer");super({inputSrj:e,options:{...t}}),this.MAX_ITERATIONS=1e8}getSolverName(){return"AutoroutingPipelineSolver11_Simplification"}getConstructorParams(){return[this.inputProblem.inputSrj,this.inputProblem.options]}getOutput(){if(!this.validateTraceSimplificationSolver?.solved)throw Error("Pipeline 11 simplification has not solved yet");return this.validateTraceSimplificationSolver.getOutput()}getOutputSimpleRouteJson(){return this.getOutput()}getOutputSimplifiedPcbTraces(){return structuredClone(this.getOutput().traces??[])}initialVisualize(){return py(this.inputProblem.inputSrj)}finalVisualize(){return py(this.getOutput())}};var Eq=0.000000001,jXe=(e)=>((t)=>t.route_type==="wire")(e)||((t)=>t.route_type==="via")(e)?e:((t)=>t.route_type==="through_obstacle")(e)&&Math.hypot(e.end.x-e.start.x,e.end.y-e.start.y)<=Eq?{route_type:e.route_type,x:e.start.x,y:e.start.y,from_layer:e.from_layer,to_layer:e.to_layer,width:e.width}:null,q9r=(e,t)=>e.layer??t.layer??e.to_layer??t.from_layer??e.from_layer??t.to_layer??"top",J9r=(e,t,n)=>e.width??t.width??n,e$=(e,t,n,o,r)=>({x:e.x+(t.x-e.x)*n,y:e.y+(t.y-e.y)*n,layer:o,width:r}),HWt=(e,t)=>({...e,x:Math.abs(e.x-t.minX)<0.000001?t.minX:Math.abs(e.x-t.maxX)<0.000001?t.maxX:e.x,y:Math.abs(e.y-t.minY)<0.000001?t.minY:Math.abs(e.y-t.maxY)<0.000001?t.maxY:e.y}),FWt=({x:e,y:t,layer:n})=>({x:e,y:t,layer:n}),zWt=({x:e,y:t,layer:n,width:o})=>({route_type:"wire",x:e,y:t,layer:n,width:o}),Z9r=(e,t,n)=>{let o=t.x-e.x,r=t.y-e.y,i=0,s=1,a=(c,l)=>{if(Math.abs(c)<Eq)return l>=0;let h=l/c;if(c<0){if(h>s)return!1;h>i&&(i=h)}else{if(h<i)return!1;h<s&&(s=h)}return!0};return a(-o,e.x-n.minX)&&a(o,n.maxX-e.x)&&a(-r,e.y-n.minY)&&a(r,n.maxY-e.y)?{startT:i,endT:s}:null},OWt=(e,t)=>e.x>=t.minX-0.000001&&e.x<=t.maxX+0.000001&&e.y>=t.minY-0.000001&&e.y<=t.maxY+0.000001&&(Math.abs(e.x-t.minX)<=0.000001||Math.abs(e.x-t.maxX)<=0.000001||Math.abs(e.y-t.minY)<=0.000001||Math.abs(e.y-t.maxY)<=0.000001),KXe=(e,t,n,o,r)=>{var i,s;(i=o,s=r,Math.hypot(i.x-s.x,i.y-s.y)<=Eq)||e.push({type:"pcb_trace",pcb_trace_id:`${t.pcb_trace_id}_keep_${n}`,connection_name:t.connection_name,route:[zWt(o),zWt(r)]})},VWt=({obstacleId:e,start:t,end:n,layer:o,width:r})=>{let i=n.x-t.x,s=n.y-t.y,a=Math.hypot(i,s);return a>r+Eq?null:{obstacleId:e,type:"rect",layers:[o],center:{x:(t.x+n.x)/2,y:(t.y+n.y)/2},width:a,height:r,ccwRotationDegrees:180*Math.atan2(s,i)/Math.PI,connectedTo:[]}},YWt=({connection:e,point:t,endpointIndex:n})=>({obstacleId:`${e.name}_route_endpoint_${n}`,type:"rect",layers:[t.layer],center:{x:t.x,y:t.y},width:t.width,height:t.width,connectedTo:[e.name,e.__rootConnectionNames?.[0]??e.name]}),GWt=({trace:e,ripIndex:t,start:n,end:o,region:r,allowInteriorStart:i,allowInteriorEnd:s})=>{if(!i&&!OWt(n,r)||!s&&!OWt(o,r))return null;let a=(({trace:c,ripIndex:l,start:h,end:d})=>({name:`${c.connection_name}_reroute_${c.pcb_trace_id}_${l}`,__rootConnectionNames:[c.connection_name],pointsToConnect:[FWt(h),FWt(d)]}))({trace:e,ripIndex:t,start:n,end:o});return{connection:a,endpointObstacles:[YWt({connection:a,point:n,endpointIndex:0}),YWt({connection:a,point:o,endpointIndex:1})]}},evr=(e,t,n)=>{let o=[],r=[],i=[],s=[],a=null,c=!1,l=0,h=!1;for(let d=0;d<e.route.length-1;d++){let u=jXe(e.route[d]),_=jXe(e.route[d+1]);if(!u||!_)return null;let p=q9r(u,_),m=J9r(u,_,n),A=Z9r(u,_,t),g=e$(u,_,0,p,m),f=e$(u,_,1,p,m),y=d===0;if(!A){KXe(o,e,l++,g,f);continue}if(h=!0,A.startT>Eq){let I=e$(u,_,A.startT,p,m),v=VWt({obstacleId:`${e.pcb_trace_id}_keep_${l}_bounds`,start:g,end:I,layer:p,width:m});v&&s.push(v),KXe(o,e,l++,g,I)}let x=e$(u,_,A.endT,p,m),C=HWt(e$(u,_,A.startT,p,m),t),b=HWt(e$(u,_,A.endT,p,m),t);if(a||(a=C,c=y&&A.startT<=Eq),A.endT<0.999999999){let I=GWt({trace:e,ripIndex:r.length,start:a,end:b,region:t,allowInteriorStart:c});I&&(r.push(I.connection),i.push(...I.endpointObstacles)),a=null,c=!1;let v=VWt({obstacleId:`${e.pcb_trace_id}_keep_${l}_bounds`,start:x,end:f,layer:p,width:m});v&&s.push(v),KXe(o,e,l++,x,f)}}if(a){let d=e.route.slice().reverse().map(jXe).find((u)=>Boolean(u));if(d){let u=GWt({trace:e,ripIndex:r.length,start:a,end:{x:d.x,y:d.y,layer:d.layer??d.from_layer??a.layer,width:a.width},region:t,allowInteriorStart:c,allowInteriorEnd:!0});u&&(r.push(u.connection),i.push(...u.endpointObstacles))}}return{keptTraces:o,rerouteConnections:r,rerouteEndpointObstacles:i,clippedTraceSegmentObstacles:s,hadIntersection:h}},$ln=(e,t)=>{let n=structuredClone(e),o=[],r=[],i=[],s=[];for(let c of e.traces??[]){let l=evr(c,t,e.minTraceWidth);l?l.hadIntersection?(o.push(...l.keptTraces),r.push(...l.rerouteConnections),i.push(...l.rerouteEndpointObstacles),s.push(...l.clippedTraceSegmentObstacles)):o.push(structuredClone(c)):o.push(structuredClone(c))}let a=((c,l)=>{let h={minX:c.minX,maxX:c.maxX,minY:c.minY,maxY:c.maxY};for(let d of l){let u=Pi(d);h.minX=Math.min(h.minX,u.minX),h.maxX=Math.max(h.maxX,u.maxX),h.minY=Math.min(h.minY,u.minY),h.maxY=Math.max(h.maxY,u.maxY)}return h})(t,[...i,...s]);return{...n,bounds:a,obstacles:[...n.obstacles,...i],traces:o,connections:r}},qln=(e,t)=>{let n=new Map(t.connections.map((r)=>[r.name,r.__rootConnectionNames?.[0]??r.name])),o=(t.traces??[]).map((r)=>{let i=n.get(r.connection_name);return i?{...structuredClone(r),connection_name:i}:structuredClone(r)});return{...structuredClone(e),traces:o,jumpers:t.jumpers?structuredClone(t.jumpers):structuredClone(e.jumpers)}};/*! Bundled license information:

is-buffer/index.js:
  (*!
   * Determine if an object is a Buffer
   *
   * @author   Feross Aboukhadijeh <https://feross.org>
   * @license  MIT
   *)

deep-rename-keys/index.js:
  (*!
   * deep-rename-keys <https://github.com/jonschlinkert/deep-rename-keys>
   *
   * Copyright (c) 2015 Jon Schlinkert, contributors.
   * Licensed under the MIT license.
   *)

@tscircuit/checks/dist/index.js:
  (*! Bundled license information:
  
  @tscircuit/circuit-json-pcb-style-analysis/dist/index.js:
    (*!
    * Determine if an object is a Buffer
    *
    * @author   Feross Aboukhadijeh <https://feross.org>
    * @license  MIT
    *)
  *)

@tscircuit/curvy-trace-solver/dist/index.js:
@tscircuit/find-convex-regions/dist/index.js:
  (*! Bundled license information:
  
  is-buffer/index.js:
    (*!
     * Determine if an object is a Buffer
     *
     * @author   Feross Aboukhadijeh <https://feross.org>
     * @license  MIT
     *)
  
  deep-rename-keys/index.js:
    (*!
     * deep-rename-keys <https://github.com/jonschlinkert/deep-rename-keys>
     *
     * Copyright (c) 2015 Jon Schlinkert, contributors.
     * Licensed under the MIT license.
     *)
  *)

@tscircuit/hypergraph/dist/index.js:
  (*! Bundled license information:
  
  @tscircuit/find-convex-regions/dist/index.js:
    (*! Bundled license information:
    
    is-buffer/index.js:
      (*!
       * Determine if an object is a Buffer
       *
       * @author   Feross Aboukhadijeh <https://feross.org>
       * @license  MIT
       *)
    
    deep-rename-keys/index.js:
      (*!
       * deep-rename-keys <https://github.com/jonschlinkert/deep-rename-keys>
       *
       * Copyright (c) 2015 Jon Schlinkert, contributors.
       * Licensed under the MIT license.
       *)
    *)
  *)
*/Kt();tc();var vJ=Qe(p0(),1);Kt();Kt();async function tvr(e={}){var t,n=e,o=!!globalThis.window,r=!!globalThis.WorkerGlobalScope,i=globalThis.process?.versions?.node&&globalThis.process?.type!="renderer";if(i){let{createRequire:qe}=await import("node:module");var s=qe(import.meta.url)}var a=!1;n.setup=function(){if(a)return;a=!0,n.initTBB();function qe(Xt,bn,to=(yo)=>yo){if(bn)for(let yo of bn)Xt.push_back(to(yo));return Xt}function at(Xt,bn=(to)=>to){let to=[],yo=Xt.size();for(let ci=0;ci<yo;ci++)to.push(bn(Xt.get(ci)));return to}function Tt(Xt,bn=(to)=>to){let to=[],yo=Xt.size();for(let ci=0;ci<yo;ci++){let Ws=Xt.get(ci),rs=Ws.size(),ma=[];for(let ch=0;ch<rs;ch++)ma.push(bn(Ws.get(ch)));to.push(ma)}return to}function Jt(Xt){if(Xt[0].length<3)Xt=[Xt];return qe(new n.Vector2_vec2,Xt,(bn)=>qe(new n.Vector_vec2,bn,(to)=>{if(to instanceof Array)return{x:to[0],y:to[1]};return to}))}function yn(Xt){for(let bn=0;bn<Xt.size();bn++)Xt.get(bn).delete();Xt.delete()}function Pn(Xt){if(Xt[0]instanceof Array)return{x:Xt[0][0],y:Xt[0][1]};if(typeof Xt[0]=="number")return{x:Xt[0]||0,y:Xt[1]||0};return Xt[0]}function Nn(Xt){if(Xt[0]instanceof Array)return{x:Xt[0][0],y:Xt[0][1],z:Xt[0][2]};if(typeof Xt[0]=="number")return{x:Xt[0]||0,y:Xt[1]||0,z:Xt[2]||0};return Xt[0]}function ao(Xt){return Xt=="EvenOdd"?0:Xt=="NonZero"?1:Xt=="Negative"?3:2}function wo(Xt){return Xt=="Round"?1:Xt=="Miter"?2:0}let $o=n.CrossSection;function Mr(Xt,bn="Positive"){if(Xt instanceof $o)return Xt;else{let to=Jt(Xt),yo=new $o(to,ao(bn));return yn(to),yo}}n.CrossSection.prototype.translate=function(...Xt){return this._Translate(Pn(Xt))},n.CrossSection.prototype.scale=function(Xt){if(typeof Xt=="number")return this._Scale({x:Xt,y:Xt});return this._Scale(Pn([Xt]))},n.CrossSection.prototype.mirror=function(Xt){return this._Mirror(Pn([Xt]))},n.CrossSection.prototype.warp=function(Xt){let bn=r0(function(yo){let ci=Ee(yo,"double"),Ws=Ee(yo+8,"double"),rs=[ci,Ws];Xt(rs),Me(yo,rs[0],"double"),Me(yo+8,rs[1],"double")},"vi"),to=this._Warp(bn);return $A(bn),to},n.CrossSection.prototype.decompose=function(){let Xt=this._Decompose(),bn=at(Xt);return Xt.delete(),bn},n.CrossSection.prototype.bounds=function(){let Xt=this._Bounds();return{min:["x","y"].map((bn)=>Xt.min[bn]),max:["x","y"].map((bn)=>Xt.max[bn])}},n.CrossSection.prototype.offset=function(Xt,bn="Round",to=2,yo=0){return this._Offset(Xt,wo(bn),to,yo)},n.CrossSection.prototype.simplify=function(Xt=0.000001){return this._Simplify(Xt)},n.CrossSection.prototype.extrude=function(Xt,bn=0,to=0,yo=[1,1],ci=!1){yo=Pn([yo]);let Ws=n._Extrude(this._ToPolygons(),Xt,bn,to,yo);return ci?Ws.translate([0,0,-Xt/2]):Ws},n.CrossSection.prototype.revolve=function(Xt=0,bn=360){return n._Revolve(this._ToPolygons(),Xt,bn)},n.CrossSection.prototype.add=function(Xt){return this._add(Mr(Xt))},n.CrossSection.prototype.subtract=function(Xt){return this._subtract(Mr(Xt))},n.CrossSection.prototype.intersect=function(Xt){return this._intersect(Mr(Xt))},n.CrossSection.prototype.toPolygons=function(){let Xt=this._ToPolygons(),bn=Tt(Xt,(to)=>[to.x,to.y]);return Xt.delete(),bn},n.Manifold.prototype.smoothOut=function(Xt=52.5,bn=0){return this._SmoothOut(Xt,bn)},n.Manifold.prototype.warp=function(Xt){let bn=r0(function(ci){let Ws=Ee(ci,"double"),rs=Ee(ci+8,"double"),ma=Ee(ci+16,"double"),ch=[Ws,rs,ma];Xt(ch),Me(ci,ch[0],"double"),Me(ci+8,ch[1],"double"),Me(ci+16,ch[2],"double")},"vi"),to=this._Warp(bn);$A(bn);let yo=to.status();if(yo!=="NoError")throw new n.ManifoldError(yo);return to},n.Manifold.prototype.warpBatch=function(Xt){let bn=r0(function(ci,Ws){let rs=n.HEAPF64??L;if(!rs)throw Error("WASM heap is not initialized (HEAPF64 unavailable)");let ma=new Float64Array(rs.buffer,ci,Ws*3);Xt(ma,Ws)},"vii"),to=this._WarpBatch(bn);$A(bn);let yo=to.status();if(yo!=="NoError")throw new n.ManifoldError(yo);return to},n.Manifold.prototype.calculateNormals=function(Xt=0,bn=52.5){return this._CalculateNormals(Xt,bn)},n.Manifold.prototype.smoothByNormals=function(Xt=0){return this._SmoothByNormals(Xt)},n.Manifold.prototype.setProperties=function(Xt,bn){let to=this.numProp(),yo=r0(function(Ws,rs,ma){let ch=[];for(let ml=0;ml<Xt;++ml)ch[ml]=Ee(Ws+8*ml,"double");let L_=[];for(let ml=0;ml<3;++ml)L_[ml]=Ee(rs+8*ml,"double");let H_=[];for(let ml=0;ml<to;++ml)H_[ml]=Ee(ma+8*ml,"double");bn(ch,L_,H_);for(let ml=0;ml<Xt;++ml)Me(Ws+8*ml,ch[ml],"double")},"viii"),ci=this._SetProperties(Xt,yo);return $A(yo),ci},n.Manifold.prototype.translate=function(...Xt){return this._Translate(Nn(Xt))},n.Manifold.prototype.rotate=function(Xt,bn,to){if(Array.isArray(Xt))return this._Rotate(...Xt);else return this._Rotate(Xt,bn||0,to||0)},n.Manifold.prototype.scale=function(Xt){if(typeof Xt=="number")return this._Scale({x:Xt,y:Xt,z:Xt});return this._Scale(Nn([Xt]))},n.Manifold.prototype.mirror=function(Xt){return this._Mirror(Nn([Xt]))},n.Manifold.prototype.trimByPlane=function(Xt,bn=0){return this._TrimByPlane(Nn([Xt]),bn)},n.Manifold.prototype.slice=function(Xt=0){let bn=this._Slice(Xt),to=new $o(bn,ao("Positive"));return yn(bn),to},n.Manifold.prototype.project=function(){let Xt=this._Project(),bn=new $o(Xt,ao("Positive"));return yn(Xt),bn},n.Manifold.prototype.rayCast=function(Xt,bn){let to=this._RayCast(Nn([Xt]),Nn([bn])),yo=at(to,(ci)=>({faceID:ci.faceID,distance:ci.distance,position:["x","y","z"].map((Ws)=>ci.position[Ws]),normal:["x","y","z"].map((Ws)=>ci.normal[Ws])}));return to.delete(),yo},n.Manifold.prototype.split=function(Xt){let bn=this._Split(Xt),to=at(bn);return bn.delete(),to},n.Manifold.prototype.splitByPlane=function(Xt,bn=0){let to=this._SplitByPlane(Nn([Xt]),bn),yo=at(to);return to.delete(),yo},n.Manifold.prototype.decompose=function(){let Xt=this._Decompose(),bn=at(Xt);return Xt.delete(),bn},n.Manifold.prototype.boundingBox=function(){let Xt=this._boundingBox();return{min:["x","y","z"].map((bn)=>Xt.min[bn]),max:["x","y","z"].map((bn)=>Xt.max[bn])}},n.Manifold.prototype.simplify=function(Xt=0){return this._Simplify(Xt)};class Gs{constructor({numProp:Xt=3,triVerts:bn=new Uint32Array,vertProperties:to=new Float32Array,mergeFromVert:yo,mergeToVert:ci,runIndex:Ws,runOriginalID:rs,faceID:ma,halfedgeTangent:ch,runTransform:L_,runFlags:H_,tolerance:ml=0}={}){this.numProp=Xt,this.triVerts=bn,this.vertProperties=to,this.mergeFromVert=yo,this.mergeToVert=ci,this.runIndex=Ws,this.runOriginalID=rs,this.faceID=ma,this.halfedgeTangent=ch,this.runTransform=L_,this.runFlags=H_,this.tolerance=ml}get numTri(){return this.triVerts.length/3}get numVert(){return this.vertProperties.length/this.numProp}get numRun(){return this.runOriginalID.length}merge(){let{changed:Xt,mesh:bn}=n._Merge(this);return Object.assign(this,{...bn}),Xt}verts(Xt){return this.triVerts.subarray(3*Xt,3*(Xt+1))}position(Xt){return this.vertProperties.subarray(this.numProp*Xt,this.numProp*Xt+3)}extras(Xt){return this.vertProperties.subarray(this.numProp*Xt+3,this.numProp*(Xt+1))}tangent(Xt){return this.halfedgeTangent.subarray(4*Xt,4*(Xt+1))}transform(Xt){let bn=Array(16);for(let to of[0,1,2,3])for(let yo of[0,1,2])bn[4*to+yo]=this.runTransform[12*Xt+3*to+yo];return bn[15]=1,bn}backside(Xt){return this.runFlags!=null&&Xt<this.runFlags.length&&(this.runFlags[Xt]&1)!==0}hasNormals(Xt){return this.runFlags!=null&&Xt<this.runFlags.length&&(this.runFlags[Xt]&2)!==0}}n.Mesh=Gs,n.Manifold.prototype.getMesh=function(Xt=-1){return new Gs(this._GetMeshJS(Xt))},n.ManifoldError=function(bn,...to){let yo="Unknown error";switch(bn){case"NonFiniteVertex":yo="Non-finite vertex";break;case"NotManifold":yo="Not manifold";break;case"VertexOutOfBounds":yo="Vertex index out of bounds";break;case"PropertiesWrongLength":yo="Properties have wrong length";break;case"MissingPositionProperties":yo="Less than three properties";break;case"MergeVectorsDifferentLengths":yo="Merge vectors have different lengths";break;case"MergeIndexOutOfBounds":yo="Merge index out of bounds";break;case"TransformWrongLength":yo="Transform vector has wrong length";break;case"RunIndexWrongLength":yo="Run index vector has wrong length";break;case"FaceIDWrongLength":yo="Face ID vector has wrong length";break;case"InvalidConstruction":yo="Manifold constructed with invalid parameters";break;case"ResultTooLarge":yo="Result exceeds maximum size";break;case"InvalidTangents":yo="Invalid halfedge tangents";break}let ci=Error.apply(this,[yo,...to]);ci.name=this.name="ManifoldError",this.message=ci.message,this.stack=ci.stack,this.code=bn},n.ManifoldError.prototype=Object.create(Error.prototype,{constructor:{value:n.ManifoldError,writable:!0,configurable:!0}}),n.CrossSection=function(Xt,bn="Positive"){let to=Jt(Xt),yo=new $o(to,ao(bn));return yn(to),yo},n.CrossSection.ofPolygons=function(Xt,bn="Positive"){return new n.CrossSection(Xt,bn)},n.CrossSection.square=function(...Xt){let bn=void 0;if(Xt.length==0)bn={x:1,y:1};else if(typeof Xt[0]=="number")bn={x:Xt[0],y:Xt[0]};else bn=Pn(Xt);let to=Xt[1]||!1;return n._Square(bn,to)},n.CrossSection.circle=function(Xt,bn=0){return n._Circle(Xt,bn)};function pa(Xt){return function(...bn){if(bn.length==1)bn=bn[0];let to=new n.Vector_crossSection;for(let ci of bn)to.push_back(Mr(ci));let yo=n["_crossSection"+Xt](to);return to.delete(),yo}}n.CrossSection.compose=pa("Compose"),n.CrossSection.union=pa("UnionN"),n.CrossSection.difference=pa("DifferenceN"),n.CrossSection.intersection=pa("IntersectionN");function Qs(Xt,bn){qe(Xt,bn,(to)=>{if(to instanceof Array)return{x:to[0],y:to[1]};return to})}n.CrossSection.hull=function(...Xt){if(Xt.length==1)Xt=Xt[0];let bn=new n.Vector_vec2;for(let yo of Xt)if(yo instanceof $o)n._crossSectionCollectVertices(bn,yo);else if(yo instanceof Array&&yo.length==2&&typeof yo[0]=="number")bn.push_back({x:yo[0],y:yo[1]});else if(yo.x)bn.push_back(yo);else{let Ws=yo[0].length==2&&typeof yo[0][0]=="number"||yo[0].x?[yo]:yo;for(let rs of Ws)Qs(bn,rs)}let to=n._crossSectionHullPoints(bn);return bn.delete(),to},n.CrossSection.prototype=Object.create($o.prototype),Object.defineProperty(n.CrossSection,Symbol.hasInstance,{get:()=>(Xt)=>Xt instanceof $o});let Us=n.Manifold;n.Manifold=function(Xt){let bn=new Us(Xt),to=bn.status();if(to!=="NoError")throw new n.ManifoldError(to);return bn},n.Manifold.ofMesh=function(Xt){return new n.Manifold(Xt)},n.Manifold.tetrahedron=function(){return n._Tetrahedron()},n.Manifold.cube=function(...Xt){let bn=void 0;if(Xt.length==0)bn={x:1,y:1,z:1};else if(typeof Xt[0]=="number")bn={x:Xt[0],y:Xt[0],z:Xt[0]};else bn=Nn(Xt);let to=Xt[1]||!1;return n._Cube(bn,to)},n.Manifold.cylinder=function(Xt,bn,to=-1,yo=0,ci=!1){return n._Cylinder(Xt,bn,to,yo,ci)},n.Manifold.sphere=function(Xt,bn=0){return n._Sphere(Xt,bn)},n.Manifold.smooth=function(Xt,bn=[]){let to=new n.Vector_smoothness;qe(to,bn);let yo=n._Smooth(Xt,to);return to.delete(),yo},n.Manifold.extrude=function(Xt,bn,to=0,yo=0,ci=[1,1],Ws=!1){return(Xt instanceof $o?Xt:n.CrossSection(Xt,"Positive")).extrude(bn,to,yo,ci,Ws)},n.Manifold.revolve=function(Xt,bn=0,to=360){return(Xt instanceof $o?Xt:n.CrossSection(Xt,"Positive")).revolve(bn,to)},n.Manifold.reserveIDs=function(Xt){return n._ReserveIDs(Xt)};function sc(Xt){return function(...bn){if(bn.length==1)bn=bn[0];let to=new n.Vector_manifold;for(let ci of bn)to.push_back(ci);let yo=n["_manifold"+Xt+"N"](to);return to.delete(),yo}}n.Manifold.union=sc("Union"),n.Manifold.compose=n.Manifold.union,n.Manifold.difference=sc("Difference"),n.Manifold.intersection=sc("Intersection"),n.Manifold.levelSet=function(Xt,bn,to,yo=0,ci=-1){let Ws={min:{x:bn.min[0],y:bn.min[1],z:bn.min[2]},max:{x:bn.max[0],y:bn.max[1],z:bn.max[2]}},rs=r0(function(ch){let L_=Ee(ch,"double"),H_=Ee(ch+8,"double"),ml=Ee(ch+16,"double");return Xt([L_,H_,ml])},"di"),ma=n._LevelSet(rs,Ws,to,yo,ci);return $A(rs),ma},n.ExecutionContext.prototype.fromMesh=function(Xt){return this._FromMesh(Xt)},n.ExecutionContext.prototype.smooth=function(Xt,bn=[]){let to=new n.Vector_smoothness;qe(to,bn);let yo=this._Smooth(Xt,to);return to.delete(),yo},n.ExecutionContext.prototype.levelSet=function(Xt,bn,to,yo=0,ci=-1){let Ws={min:{x:bn.min[0],y:bn.min[1],z:bn.min[2]},max:{x:bn.max[0],y:bn.max[1],z:bn.max[2]}},rs=r0(function(ch){let L_=Ee(ch,"double"),H_=Ee(ch+8,"double"),ml=Ee(ch+16,"double");return Xt([L_,H_,ml])},"di"),ma=this._LevelSet(rs,Ws,to,yo,ci);return $A(rs),ma};function cp(Xt,bn){qe(Xt,bn,(to)=>{if(to instanceof Array)return{x:to[0],y:to[1],z:to[2]};return to})}n.Manifold.hull=function(...Xt){if(Xt.length==1)Xt=Xt[0];let bn=new n.Vector_vec3;for(let yo of Xt)if(yo instanceof Us)n._manifoldCollectVertices(bn,yo);else if(yo instanceof Array&&yo.length==3&&typeof yo[0]=="number")bn.push_back({x:yo[0],y:yo[1],z:yo[2]});else if(yo.x)bn.push_back(yo);else cp(bn,yo);let to=n._manifoldHullPoints(bn);return bn.delete(),to},n.Manifold.prototype=Object.create(Us.prototype),Object.defineProperty(n.Manifold,Symbol.hasInstance,{get:()=>(Xt)=>Xt instanceof Us}),n.triangulate=function(Xt,bn=-1,to=!0){let yo=Jt(Xt),ci=at(n._Triangulate(yo,bn,to),(Ws)=>[Ws[0],Ws[1],Ws[2]]);return yn(yo),ci}};var c=[],l="./this.program",h=(qe,at)=>{throw at},d=import.meta.url,u="";function _(qe){if(n.locateFile)return n.locateFile(qe,u);return u+qe}var p,m;if(i){var A=s("node:fs");if(d.startsWith("file:"))u=s("node:path").dirname(s("node:url").fileURLToPath(d))+"/";if(m=(qe)=>{qe=C(qe)?new URL(qe):qe;var at=A.readFileSync(qe);return at},p=async(qe,at=!0)=>{qe=C(qe)?new URL(qe):qe;var Tt=A.readFileSync(qe,at?void 0:"utf8");return Tt},process.argv.length>1)l=process.argv[1].replace(/\\/g,"/");c=process.argv.slice(2),h=(qe,at)=>{throw process.exitCode=qe,at}}else if(o||r){try{u=new URL(".",d).href}catch{}{if(r)m=(qe)=>{var at=new XMLHttpRequest;return at.open("GET",qe,!1),at.responseType="arraybuffer",at.send(null),new Uint8Array(at.response)};p=async(qe)=>{if(C(qe))return new Promise((Tt,Jt)=>{var yn=new XMLHttpRequest;yn.open("GET",qe,!0),yn.responseType="arraybuffer",yn.onload=()=>{if(yn.status==200||yn.status==0&&yn.response){Tt(yn.response);return}Jt(yn.status)},yn.onerror=Jt,yn.send(null)});var at=await fetch(qe,{credentials:"same-origin"});if(at.ok)return at.arrayBuffer();throw Error(at.status+" : "+at.url)}}}var g=console.log.bind(console),f=console.error.bind(console),y,x=!1,C=(qe)=>qe.startsWith("file://"),b,I,v,P,M,B,T,N,D,L,H,V,O=!1;function U(){var qe=h1.buffer;v=new Int8Array(qe),M=new Int16Array(qe),P=new Uint8Array(qe),B=new Uint16Array(qe),T=new Int32Array(qe),N=new Uint32Array(qe),D=new Float32Array(qe),L=new Float64Array(qe),H=new BigInt64Array(qe),V=new BigUint64Array(qe)}function j(){if(n.preRun){if(typeof n.preRun=="function")n.preRun=[n.preRun];while(n.preRun.length)xe(n.preRun.shift())}ue(ge)}function Y(){O=!0,T5.J()}function X(){if(n.postRun){if(typeof n.postRun=="function")n.postRun=[n.postRun];while(n.postRun.length)me(n.postRun.shift())}ue(de)}function K(qe){n.onAbort?.(qe),qe="Aborted("+qe+")",f(qe),x=!0,qe+=". Build with -sASSERTIONS for more info.";var at=new WebAssembly.RuntimeError(qe);throw I?.(at),at}var J;function ee(){if(n.locateFile)return _("manifold.wasm");return new URL("manifold.wasm",import.meta.url).href}function se(qe){if(qe==J&&y)return new Uint8Array(y);if(m)return m(qe);throw"both async and sync fetching of the wasm failed"}async function ne(qe){if(!y)try{var at=await p(qe);return new Uint8Array(at)}catch{}return se(qe)}async function re(qe,at){try{var Tt=await ne(qe),Jt=await WebAssembly.instantiate(Tt,at);return Jt}catch(yn){f(`failed to asynchronously prepare wasm: ${yn}`),K(yn)}}async function Z(qe,at,Tt){if(!qe&&!C(at)&&!i)try{var Jt=fetch(at,{credentials:"same-origin"}),yn=await WebAssembly.instantiateStreaming(Jt,Tt);return yn}catch(Pn){f(`wasm streaming compile failed: ${Pn}`),f("falling back to ArrayBuffer instantiation")}return re(at,Tt)}function te(){var qe={a:ZP};return qe}async function ie(){function qe(Pn,Nn){return T5=Pn.exports,T5=B5(T5),Eu(T5),U(),T5}function at(Pn){return qe(Pn.instance)}var Tt=te();if(n.instantiateWasm)return new Promise((Pn,Nn)=>{n.instantiateWasm(Tt,(ao,wo)=>{Pn(qe(ao,wo))})});J??=ee();var Jt=await Z(y,J,Tt),yn=at(Jt);return yn}class ce{name="ExitStatus";constructor(qe){this.message=`Program terminated with exit(${qe})`,this.status=qe}}var ue=(qe)=>{while(qe.length>0)qe.shift()(n)},de=[],me=(qe)=>de.push(qe),ge=[],xe=(qe)=>ge.push(qe);function Ee(qe,at="i8"){if(at.endsWith("*"))at="*";switch(at){case"i1":return v[qe>>>0];case"i8":return v[qe>>>0];case"i16":return M[qe>>>1>>>0];case"i32":return T[qe>>>2>>>0];case"i64":return H[qe>>>3>>>0];case"float":return D[qe>>>2>>>0];case"double":return L[qe>>>3>>>0];case"*":return N[qe>>>2>>>0];default:K(`invalid type for getValue: ${at}`)}}var Re=!0;function Me(qe,at,Tt="i8"){if(Tt.endsWith("*"))Tt="*";switch(Tt){case"i1":v[qe>>>0]=at;break;case"i8":v[qe>>>0]=at;break;case"i16":M[qe>>>1>>>0]=at;break;case"i32":T[qe>>>2>>>0]=at;break;case"i64":H[qe>>>3>>>0]=BigInt(at);break;case"float":D[qe>>>2>>>0]=at;break;case"double":L[qe>>>3>>>0]=at;break;case"*":N[qe>>>2>>>0]=at;break;default:K(`invalid type for setValue: ${Tt}`)}}class _e{constructor(qe){this.excPtr=qe,this.ptr=qe-24}set_type(qe){N[this.ptr+4>>>2>>>0]=qe}get_type(){return N[this.ptr+4>>>2>>>0]}set_destructor(qe){N[this.ptr+8>>>2>>>0]=qe}get_destructor(){return N[this.ptr+8>>>2>>>0]}set_caught(qe){qe=qe?1:0,v[this.ptr+12>>>0]=qe}get_caught(){return v[this.ptr+12>>>0]!=0}set_rethrown(qe){qe=qe?1:0,v[this.ptr+13>>>0]=qe}get_rethrown(){return v[this.ptr+13>>>0]!=0}init(qe,at){this.set_adjusted_ptr(0),this.set_type(qe),this.set_destructor(at)}set_adjusted_ptr(qe){N[this.ptr+16>>>2>>>0]=qe}get_adjusted_ptr(){return N[this.ptr+16>>>2>>>0]}}var ye=0,Se=0;function Ne(qe,at,Tt){qe>>>=0,at>>>=0,Tt>>>=0;var Jt=new _e(qe);throw Jt.init(at,Tt),ye=qe,Se++,ye}var Le=()=>K(""),nt={},dt=(qe)=>{while(qe.length){var at=qe.pop(),Tt=qe.pop();Tt(at)}};function rt(qe){return this.fromWireType(N[qe>>>2>>>0])}var pt={},ct={},Ct={},kt=class extends Error{constructor(at){super(at);this.name="InternalError"}},Lt=(qe)=>{throw new kt(qe)},Bt=(qe,at,Tt)=>{qe.forEach((ao)=>Ct[ao]=at);function Jt(ao){var wo=Tt(ao);if(wo.length!==qe.length)Lt("Mismatched type converter count");for(var $o=0;$o<qe.length;++$o)tt(qe[$o],wo[$o])}var yn=Array(at.length),Pn=[],Nn=0;for(let[ao,wo]of at.entries())if(ct.hasOwnProperty(wo))yn[ao]=ct[wo];else{if(Pn.push(wo),!pt.hasOwnProperty(wo))pt[wo]=[];pt[wo].push(()=>{if(yn[ao]=ct[wo],++Nn,Nn===Pn.length)Jt(yn)})}if(Pn.length===0)Jt(yn)},xt=function(qe){qe>>>=0;var at=nt[qe];delete nt[qe];var{rawConstructor:Tt,rawDestructor:Jt,fields:yn}=at,Pn=yn.map((Nn)=>Nn.getterReturnType).concat(yn.map((Nn)=>Nn.setterArgumentType));Bt([qe],Pn,(Nn)=>{var ao={};for(var[wo,$o]of yn.entries()){let Mr=Nn[wo],{getter:Gs,getterContext:pa}=$o,Qs=Nn[wo+yn.length],{setter:Us,setterContext:sc}=$o;ao[$o.fieldName]={read:(cp)=>Mr.fromWireType(Gs(pa,cp)),write:(cp,Xt)=>{var bn=[];Us(sc,cp,Qs.toWireType(bn,Xt)),dt(bn)},optional:Mr.optional}}return[{name:at.name,fromWireType:(Mr)=>{var Gs={};for(var pa in ao)Gs[pa]=ao[pa].read(Mr);return Jt(Mr),Gs},toWireType:(Mr,Gs)=>{for(var pa in ao)if(!(pa in Gs)&&!ao[pa].optional)throw TypeError(`Missing field: "${pa}"`);var Qs=Tt();for(pa in ao)ao[pa].write(Qs,Gs[pa]);if(Mr!==null)Mr.push(Jt,Qs);return Qs},readValueFromPointer:rt,destructorFunction:Jt}]})},Yt=(qe)=>{qe>>>=0;var at="";while(!0){var Tt=P[qe++>>>0];if(!Tt)return at;at+=String.fromCharCode(Tt)}},ut=class extends Error{constructor(at){super(at);this.name="BindingError"}},Ze=(qe)=>{throw new ut(qe)};function Fe(qe,at,Tt={}){var Jt=at.name;if(!qe)Ze(`type "${Jt}" must have a positive integer typeid pointer`);if(ct.hasOwnProperty(qe))if(Tt.ignoreDuplicateRegistrations)return;else Ze(`Cannot register type '${Jt}' twice`);if(ct[qe]=at,delete Ct[qe],pt.hasOwnProperty(qe)){var yn=pt[qe];delete pt[qe],yn.forEach((Pn)=>Pn())}}function tt(qe,at,Tt={}){return Fe(qe,at,Tt)}var Je=(qe,at,Tt)=>{switch(at){case 1:return Tt?(Jt)=>v[Jt>>>0]:(Jt)=>P[Jt>>>0];case 2:return Tt?(Jt)=>M[Jt>>>1>>>0]:(Jt)=>B[Jt>>>1>>>0];case 4:return Tt?(Jt)=>T[Jt>>>2>>>0]:(Jt)=>N[Jt>>>2>>>0];case 8:return Tt?(Jt)=>H[Jt>>>3>>>0]:(Jt)=>V[Jt>>>3>>>0];default:throw TypeError(`invalid integer width (${at}): ${qe}`)}},$e=function(qe,at,Tt,Jt,yn){qe>>>=0,at>>>=0,Tt>>>=0,at=Yt(at);let Pn=Jt===0n,Nn=(ao)=>ao;if(Pn){let ao=Tt*8;Nn=(wo)=>BigInt.asUintN(ao,wo),yn=Nn(yn)}tt(qe,{name:at,fromWireType:Nn,toWireType:(ao,wo)=>{if(typeof wo=="number")wo=BigInt(wo);return wo},readValueFromPointer:Je(at,Tt,!Pn),destructorFunction:null})};function ft(qe,at,Tt,Jt){qe>>>=0,at>>>=0,at=Yt(at),tt(qe,{name:at,fromWireType:function(yn){return!!yn},toWireType:function(yn,Pn){return Pn?Tt:Jt},readValueFromPointer:function(yn){return this.fromWireType(P[yn>>>0])},destructorFunction:null})}var vt=(qe)=>({count:qe.count,deleteScheduled:qe.deleteScheduled,preservePointerOnDelete:qe.preservePointerOnDelete,ptr:qe.ptr,ptrType:qe.ptrType,smartPtr:qe.smartPtr,smartPtrType:qe.smartPtrType}),Ye=(qe)=>{function at(Tt){return Tt.$$.ptrType.registeredClass.name}Ze(at(qe)+" instance already deleted")},je=!1,st=(qe)=>{},St=(qe)=>{if(qe.smartPtr)qe.smartPtrType.rawDestructor(qe.smartPtr);else qe.ptrType.registeredClass.rawDestructor(qe.ptr)},Nt=(qe)=>{qe.count.value-=1;var at=qe.count.value===0;if(at)St(qe)},Ot=(qe)=>{if(!globalThis.FinalizationRegistry)return Ot=(at)=>at,qe;return je=new FinalizationRegistry((at)=>{Nt(at.$$)}),Ot=(at)=>{var Tt=at.$$,Jt=!!Tt.smartPtr;if(Jt){var yn={$$:Tt};je.register(at,yn,at)}return at},st=(at)=>je.unregister(at),Ot(qe)},Ut=[],mn=()=>{while(Ut.length){var qe=Ut.pop();qe.$$.deleteScheduled=!1,qe.delete()}},_n,En=()=>{let qe=Qn.prototype;Object.assign(qe,{isAliasOf(Tt){if(!(this instanceof Qn))return!1;if(!(Tt instanceof Qn))return!1;var Jt=this.$$.ptrType.registeredClass,yn=this.$$.ptr;Tt.$$=Tt.$$;var Pn=Tt.$$.ptrType.registeredClass,Nn=Tt.$$.ptr;while(Jt.baseClass)yn=Jt.upcast(yn),Jt=Jt.baseClass;while(Pn.baseClass)Nn=Pn.upcast(Nn),Pn=Pn.baseClass;return Jt===Pn&&yn===Nn},clone(){if(!this.$$.ptr)Ye(this);if(this.$$.preservePointerOnDelete)return this.$$.count.value+=1,this;else{var Tt=Ot(Object.create(Object.getPrototypeOf(this),{$$:{value:vt(this.$$)}}));return Tt.$$.count.value+=1,Tt.$$.deleteScheduled=!1,Tt}},delete(){if(!this.$$.ptr)Ye(this);if(this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete)Ze("Object already scheduled for deletion");if(st(this),Nt(this.$$),!this.$$.preservePointerOnDelete)this.$$.smartPtr=void 0,this.$$.ptr=void 0},isDeleted(){return!this.$$.ptr},deleteLater(){if(!this.$$.ptr)Ye(this);if(this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete)Ze("Object already scheduled for deletion");if(Ut.push(this),Ut.length===1&&_n)_n(mn);return this.$$.deleteScheduled=!0,this}});let at=Symbol.dispose;if(at)qe[at]=qe.delete};function Qn(){}var ln=(qe,at)=>Object.defineProperty(at,"name",{value:qe}),hn={},Zn=(qe,at,Tt)=>{if(qe[at].overloadTable===void 0){var Jt=qe[at];qe[at]=function(...yn){if(!qe[at].overloadTable.hasOwnProperty(yn.length))Ze(`Function '${Tt}' called with an invalid number of arguments (${yn.length}) - expects one of (${qe[at].overloadTable})!`);return qe[at].overloadTable[yn.length].apply(this,yn)},qe[at].overloadTable=[],qe[at].overloadTable[Jt.argCount]=Jt}},bo=(qe,at,Tt)=>{if(n.hasOwnProperty(qe)){if(Tt===void 0||n[qe].overloadTable!==void 0&&n[qe].overloadTable[Tt]!==void 0)Ze(`Cannot register public name '${qe}' twice`);if(Zn(n,qe,qe),n[qe].overloadTable.hasOwnProperty(Tt))Ze(`Cannot register multiple overloads of a function with the same number of arguments (${Tt})!`);n[qe].overloadTable[Tt]=at}else n[qe]=at,n[qe].argCount=Tt},ir=48,gt=57,Oe=(qe)=>{qe=qe.replace(/[^a-zA-Z0-9_]/g,"$");var at=qe.charCodeAt(0);if(at>=ir&&at<=gt)return`_${qe}`;return qe};function mt(qe,at,Tt,Jt,yn,Pn,Nn,ao){this.name=qe,this.constructor=at,this.instancePrototype=Tt,this.rawDestructor=Jt,this.baseClass=yn,this.getActualType=Pn,this.upcast=Nn,this.downcast=ao,this.pureVirtualFunctions=[]}var It=(qe,at,Tt)=>{while(at!==Tt){if(!at.upcast)Ze(`Expected null or instance of ${Tt.name}, got an instance of ${at.name}`);qe=at.upcast(qe),at=at.baseClass}return qe},bt=(qe)=>{if(qe===null)return"null";var at=typeof qe;if(at==="object"||at==="array"||at==="function")return qe.toString();else return""+qe};function cn(qe,at){if(at===null){if(this.isReference)Ze(`null is not a valid ${this.name}`);return 0}if(!at.$$)Ze(`Cannot pass "${bt(at)}" as a ${this.name}`);if(!at.$$.ptr)Ze(`Cannot pass deleted object as a pointer of type ${this.name}`);var Tt=at.$$.ptrType.registeredClass,Jt=It(at.$$.ptr,Tt,this.registeredClass);return Jt}function dn(qe,at){var Tt;if(at===null){if(this.isReference)Ze(`null is not a valid ${this.name}`);if(this.isSmartPointer){if(Tt=this.rawConstructor(),qe!==null)qe.push(this.rawDestructor,Tt);return Tt}else return 0}if(!at||!at.$$)Ze(`Cannot pass "${bt(at)}" as a ${this.name}`);if(!at.$$.ptr)Ze(`Cannot pass deleted object as a pointer of type ${this.name}`);if(!this.isConst&&at.$$.ptrType.isConst)Ze(`Cannot convert argument of type ${at.$$.smartPtrType?at.$$.smartPtrType.name:at.$$.ptrType.name} to parameter type ${this.name}`);var Jt=at.$$.ptrType.registeredClass;if(Tt=It(at.$$.ptr,Jt,this.registeredClass),this.isSmartPointer){if(at.$$.smartPtr===void 0)Ze("Passing raw pointer to smart pointer is illegal");switch(this.sharingPolicy){case 0:if(at.$$.smartPtrType===this)Tt=at.$$.smartPtr;else Ze(`Cannot convert argument of type ${at.$$.smartPtrType?at.$$.smartPtrType.name:at.$$.ptrType.name} to parameter type ${this.name}`);break;case 1:Tt=at.$$.smartPtr;break;case 2:if(at.$$.smartPtrType===this)Tt=at.$$.smartPtr;else{var yn=at.clone();if(Tt=this.rawShare(Tt,$r.toHandle(()=>yn.delete())),qe!==null)qe.push(this.rawDestructor,Tt)}break;default:Ze("Unsupported sharing policy")}}return Tt}function wn(qe,at){if(at===null){if(this.isReference)Ze(`null is not a valid ${this.name}`);return 0}if(!at.$$)Ze(`Cannot pass "${bt(at)}" as a ${this.name}`);if(!at.$$.ptr)Ze(`Cannot pass deleted object as a pointer of type ${this.name}`);if(at.$$.ptrType.isConst)Ze(`Cannot convert argument of type ${at.$$.ptrType.name} to parameter type ${this.name}`);var Tt=at.$$.ptrType.registeredClass,Jt=It(at.$$.ptr,Tt,this.registeredClass);return Jt}var eo=(qe,at,Tt)=>{if(at===Tt)return qe;if(Tt.baseClass===void 0)return null;var Jt=eo(qe,at,Tt.baseClass);if(Jt===null)return null;return Tt.downcast(Jt)},_o={},$n=(qe,at)=>{if(at===void 0)Ze("ptr should not be undefined");while(qe.baseClass)at=qe.upcast(at),qe=qe.baseClass;return at},qn=(qe,at)=>(at=$n(qe,at),_o[at]),Po=(qe,at)=>{if(!at.ptrType||!at.ptr)Lt("makeClassHandle requires ptr and ptrType");var Tt=!!at.smartPtrType,Jt=!!at.smartPtr;if(Tt!==Jt)Lt("Both smartPtrType and smartPtr must be specified");return at.count={value:1},Ot(Object.create(qe,{$$:{value:at,writable:!0}}))};function To(qe){var at=this.getPointee(qe);if(!at)return this.destructor(qe),null;var Tt=qn(this.registeredClass,at);if(Tt!==void 0)if(Tt.$$.count.value===0)return Tt.$$.ptr=at,Tt.$$.smartPtr=qe,Tt.clone();else{var Jt=Tt.clone();return this.destructor(qe),Jt}function yn(){if(this.isSmartPointer)return Po(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:at,smartPtrType:this,smartPtr:qe});else return Po(this.registeredClass.instancePrototype,{ptrType:this,ptr:qe})}var Pn=this.registeredClass.getActualType(at),Nn=hn[Pn];if(!Nn)return yn.call(this);var ao;if(this.isConst)ao=Nn.constPointerType;else ao=Nn.pointerType;var wo=eo(at,this.registeredClass,ao.registeredClass);if(wo===null)return yn.call(this);if(this.isSmartPointer)return Po(ao.registeredClass.instancePrototype,{ptrType:ao,ptr:wo,smartPtrType:this,smartPtr:qe});else return Po(ao.registeredClass.instancePrototype,{ptrType:ao,ptr:wo})}var Tn=()=>{Object.assign(lo.prototype,{getPointee(qe){if(this.rawGetPointee)qe=this.rawGetPointee(qe);return qe},destructor(qe){this.rawDestructor?.(qe)},readValueFromPointer:rt,fromWireType:To})};function lo(qe,at,Tt,Jt,yn,Pn,Nn,ao,wo,$o,Mr){if(this.name=qe,this.registeredClass=at,this.isReference=Tt,this.isConst=Jt,this.isSmartPointer=yn,this.pointeeType=Pn,this.sharingPolicy=Nn,this.rawGetPointee=ao,this.rawConstructor=wo,this.rawShare=$o,this.rawDestructor=Mr,!yn&&at.baseClass===void 0)if(Jt)this.toWireType=cn,this.destructorFunction=null;else this.toWireType=wn,this.destructorFunction=null;else this.toWireType=dn}var fo=(qe,at,Tt)=>{if(!n.hasOwnProperty(qe))Lt("Replacing nonexistent public symbol");if(n[qe].overloadTable!==void 0&&Tt!==void 0)n[qe].overloadTable[Tt]=at;else n[qe]=at,n[qe].argCount=Tt},oo=(qe)=>d1.get(qe),Ro=(qe,at,Tt=[],Jt=!1)=>{var yn=oo(at),Pn=yn(...Tt);function Nn(ao){return qe[0]=="p"?ao>>>0:ao}return Nn(Pn)},or=(qe,at,Tt=!1)=>(...Jt)=>Ro(qe,at,Jt,Tt),Er=(qe,at,Tt=!1)=>{qe=Yt(qe);function Jt(){if(qe.includes("p"))return or(qe,at,Tt);var Pn=oo(at);return Pn}var yn=Jt();if(typeof yn!="function")Ze(`unknown function pointer with signature ${qe}: ${at}`);return yn};class Xi extends Error{}var Ys=(qe)=>{var at=ap(qe),Tt=Yt(at);return Ol(at),Tt},aa=(qe,at)=>{var Tt=[],Jt={};function yn(Pn){if(Jt[Pn])return;if(ct[Pn])return;if(Ct[Pn]){Ct[Pn].forEach(yn);return}Tt.push(Pn),Jt[Pn]=!0}throw at.forEach(yn),new Xi(`${qe}: `+Tt.map(Ys).join([", "]))};function Lo(qe,at,Tt,Jt,yn,Pn,Nn,ao,wo,$o,Mr,Gs,pa){qe>>>=0,at>>>=0,Tt>>>=0,Jt>>>=0,yn>>>=0,Pn>>>=0,Nn>>>=0,ao>>>=0,wo>>>=0,$o>>>=0,Mr>>>=0,Gs>>>=0,pa>>>=0,Mr=Yt(Mr),Pn=Er(yn,Pn),ao&&=Er(Nn,ao),$o&&=Er(wo,$o),pa=Er(Gs,pa);var Qs=Oe(Mr);bo(Qs,function(){aa(`Cannot construct ${Mr} due to unbound types`,[Jt])}),Bt([qe,at,Tt],Jt?[Jt]:[],(Us)=>{Us=Us[0];var sc,cp;if(Jt)sc=Us.registeredClass,cp=sc.instancePrototype;else cp=Qn.prototype;var Xt=ln(Mr,function(...rs){if(Object.getPrototypeOf(this)!==bn)throw new ut(`Use 'new' to construct ${Mr}`);if(to.constructor_body===void 0)throw new ut(`${Mr} has no accessible constructor`);var ma=to.constructor_body[rs.length];if(ma===void 0)throw new ut(`Tried to invoke ctor of ${Mr} with invalid number of parameters (${rs.length}) - expected (${Object.keys(to.constructor_body).toString()}) parameters instead!`);return ma.apply(this,rs)}),bn=Object.create(cp,{constructor:{value:Xt}});Xt.prototype=bn;var to=new mt(Mr,Xt,bn,pa,sc,Pn,ao,$o);if(to.baseClass)to.baseClass.__derivedClasses??=[],to.baseClass.__derivedClasses.push(to);var yo=new lo(Mr,to,!0,!1,!1),ci=new lo(Mr+"*",to,!1,!1,!1),Ws=new lo(Mr+" const*",to,!1,!0,!1);return hn[qe]={pointerType:ci,constPointerType:Ws},fo(Qs,Xt),[yo,ci,Ws]})}var Gi=(qe,at)=>{var Tt=[];for(var Jt=0;Jt<qe;Jt++)Tt.push(N[at+Jt*4>>>2>>>0]);return Tt};function bi(qe){for(var at=1;at<qe.length;++at)if(qe[at]!==null&&qe[at].destructorFunction===void 0)return!0;return!1}function os(qe,at,Tt,Jt){var yn=bi(qe),Pn=qe.length-2,Nn=[],ao=["fn"];if(at)ao.push("thisWired");for(var wo=0;wo<Pn;++wo)Nn.push(`arg${wo}`),ao.push(`arg${wo}Wired`);Nn=Nn.join(","),ao=ao.join(",");var $o=`return function (${Nn}) {
`;if(yn)$o+=`var destructors = [];
`;var Mr=yn?"destructors":"null",Gs=["humanName","throwBindingError","invoker","fn","runDestructors","fromRetWire","toClassParamWire"];if(at)$o+=`var thisWired = toClassParamWire(${Mr}, this);
`;for(var wo=0;wo<Pn;++wo){var pa=`toArg${wo}Wire`;$o+=`var arg${wo}Wired = ${pa}(${Mr}, arg${wo});
`,Gs.push(pa)}if($o+=(Tt||Jt?"var rv = ":"")+`invoker(${ao});
`,yn)$o+=`runDestructors(destructors);
`;else for(var wo=at?1:2;wo<qe.length;++wo){var Qs=wo===1?"thisWired":"arg"+(wo-2)+"Wired";if(qe[wo].destructorFunction!==null)$o+=`${Qs}_dtor(${Qs});
`,Gs.push(`${Qs}_dtor`)}if(Tt)$o+=`var ret = fromRetWire(rv);
return ret;
`;return $o+=`}
`,Function(Gs,$o)}function Lc(qe,at,Tt,Jt,yn,Pn){var Nn=at.length;if(Nn<2)Ze("argTypes array size mismatch! Must at least get return value and 'this' types!");var ao=at[1]!==null&&Tt!==null,wo=bi(at),$o=!at[0].isVoid,Mr=at[0],Gs=at[1],pa=[qe,Ze,Jt,yn,dt,Mr.fromWireType.bind(Mr),Gs?.toWireType.bind(Gs)];for(var Qs=2;Qs<Nn;++Qs){var Us=at[Qs];pa.push(Us.toWireType.bind(Us))}if(!wo){for(var Qs=ao?1:2;Qs<at.length;++Qs)if(at[Qs].destructorFunction!==null)pa.push(at[Qs].destructorFunction)}var cp=os(at,ao,$o,Pn)(...pa);return ln(qe,cp)}var dl=function(qe,at,Tt,Jt,yn,Pn){qe>>>=0,Tt>>>=0,Jt>>>=0,yn>>>=0,Pn>>>=0;var Nn=Gi(at,Tt);yn=Er(Jt,yn),Bt([],[qe],(ao)=>{ao=ao[0];var wo=`constructor ${ao.name}`;if(ao.registeredClass.constructor_body===void 0)ao.registeredClass.constructor_body=[];if(ao.registeredClass.constructor_body[at-1]!==void 0)throw new ut(`Cannot register multiple constructors with identical number of parameters (${at-1}) for class '${ao.name}'! Overload resolution is currently only performed using the parameter count, not actual type info!`);return ao.registeredClass.constructor_body[at-1]=()=>{aa(`Cannot construct ${ao.name} due to unbound types`,Nn)},Bt([],Nn,($o)=>($o.splice(1,0,null),ao.registeredClass.constructor_body[at-1]=Lc(wo,$o,null,yn,Pn),[])),[]})},Ec=(qe)=>{qe=qe.trim();let at=qe.indexOf("(");if(at===-1)return qe;return qe.slice(0,at)},_d=function(qe,at,Tt,Jt,yn,Pn,Nn,ao,wo,$o){qe>>>=0,at>>>=0,Jt>>>=0,yn>>>=0,Pn>>>=0,Nn>>>=0;var Mr=Gi(Tt,Jt);at=Yt(at),at=Ec(at),Pn=Er(yn,Pn,wo),Bt([],[qe],(Gs)=>{Gs=Gs[0];var pa=`${Gs.name}.${at}`;if(at.startsWith("@@"))at=Symbol[at.substring(2)];if(ao)Gs.registeredClass.pureVirtualFunctions.push(at);function Qs(){aa(`Cannot call ${pa} due to unbound types`,Mr)}var Us=Gs.registeredClass.instancePrototype,sc=Us[at];if(sc===void 0||sc.overloadTable===void 0&&sc.className!==Gs.name&&sc.argCount===Tt-2)Qs.argCount=Tt-2,Qs.className=Gs.name,Us[at]=Qs;else Zn(Us,at,pa),Us[at].overloadTable[Tt-2]=Qs;return Bt([],Mr,(cp)=>{var Xt=Lc(pa,cp,Gs,Pn,Nn,wo);if(Us[at].overloadTable===void 0)Xt.argCount=Tt-2,Us[at]=Xt;else Us[at].overloadTable[Tt-2]=Xt;return[]}),[]})},B0=[],Jo=[0,1,,1,null,1,!0,1,!1,1];function zr(qe){if(qe>>>=0,qe>9&&--Jo[qe+1]===0)Jo[qe]=void 0,B0.push(qe)}var $r={toValue:(qe)=>{if(!qe)Ze(`Cannot use deleted val. handle = ${qe}`);return Jo[qe]},toHandle:(qe)=>{switch(qe){case void 0:return 2;case null:return 4;case!0:return 6;case!1:return 8;default:{let at=B0.pop()||Jo.length;return Jo[at]=qe,Jo[at+1]=1,at}}}},Sl={name:"emscripten::val",fromWireType:(qe)=>{var at=$r.toValue(qe);return zr(qe),at},toWireType:(qe,at)=>$r.toHandle(at),readValueFromPointer:rt,destructorFunction:null};function ul(qe){return qe>>>=0,tt(qe,Sl)}var gd=(qe,at,Tt)=>{switch(at){case 1:return Tt?function(Jt){return this.fromWireType(v[Jt>>>0])}:function(Jt){return this.fromWireType(P[Jt>>>0])};case 2:return Tt?function(Jt){return this.fromWireType(M[Jt>>>1>>>0])}:function(Jt){return this.fromWireType(B[Jt>>>1>>>0])};case 4:return Tt?function(Jt){return this.fromWireType(T[Jt>>>2>>>0])}:function(Jt){return this.fromWireType(N[Jt>>>2>>>0])};default:throw TypeError(`invalid integer width (${at}): ${qe}`)}};function i1(qe){return qe===0?"object":qe===1?"number":"string"}function Fp(qe,at,Tt,Jt,yn){qe>>>=0,at>>>=0,Tt>>>=0,at=Yt(at);let Pn=i1(yn);switch(Pn){case"object":{let $o=function(){};$o.values={},tt(qe,{name:at,constructor:$o,valueType:Pn,fromWireType:function(Mr){return this.constructor.values[Mr]},toWireType:(Mr,Gs)=>Gs.value,readValueFromPointer:gd(at,Tt,Jt),destructorFunction:null}),bo(at,$o);break}case"number":{var Nn={};tt(qe,{name:at,keysMap:Nn,valueType:Pn,fromWireType:($o)=>$o,toWireType:($o,Mr)=>Mr,readValueFromPointer:gd(at,Tt,Jt),destructorFunction:null}),bo(at,Nn),delete n[at].argCount;break}case"string":{var ao={},wo={},Nn={};tt(qe,{name:at,valuesMap:ao,reverseMap:wo,keysMap:Nn,valueType:Pn,fromWireType:function(Mr){return this.reverseMap[Mr]},toWireType:function(Mr,Gs){return this.valuesMap[Gs]},readValueFromPointer:gd(at,Tt,Jt),destructorFunction:null}),bo(at,Nn),delete n[at].argCount;break}}}var ca=(qe,at)=>{var Tt=ct[qe];if(Tt===void 0)Ze(`${at} has unknown type ${Ys(qe)}`);return Tt};function n0(qe,at,Tt){qe>>>=0,at>>>=0;var Jt=ca(qe,"enum");switch(at=Yt(at),Jt.valueType){case"object":{var yn=Jt.constructor,Pn=Object.create(Jt.constructor.prototype,{value:{value:Tt},constructor:{value:ln(`${Jt.name}_${at}`,function(){})}});yn.values[Tt]=Pn,yn[at]=Pn;break}case"number":{Jt.keysMap[at]=Tt;break}case"string":{Jt.valuesMap[at]=Tt,Jt.reverseMap[Tt]=at,Jt.keysMap[at]=at;break}}}var zp=(qe,at)=>{switch(at){case 4:return function(Tt){return this.fromWireType(D[Tt>>>2>>>0])};case 8:return function(Tt){return this.fromWireType(L[Tt>>>3>>>0])};default:throw TypeError(`invalid float width (${at}): ${qe}`)}},Yd=function(qe,at,Tt){qe>>>=0,at>>>=0,Tt>>>=0,at=Yt(at),tt(qe,{name:at,fromWireType:(Jt)=>Jt,toWireType:(Jt,yn)=>yn,readValueFromPointer:zp(at,Tt),destructorFunction:null})};function vu(qe,at,Tt,Jt,yn,Pn,Nn,ao){qe>>>=0,Tt>>>=0,Jt>>>=0,yn>>>=0,Pn>>>=0;var wo=Gi(at,Tt);qe=Yt(qe),qe=Ec(qe),yn=Er(Jt,yn,Nn),bo(qe,function(){aa(`Cannot call ${qe} due to unbound types`,wo)},at-1),Bt([],wo,($o)=>{var Mr=[$o[0],null].concat($o.slice(1));return fo(qe,Lc(qe,Mr,null,yn,Pn,Nn),at-1),[]})}var ji=function(qe,at,Tt,Jt,yn){qe>>>=0,at>>>=0,Tt>>>=0,at=Yt(at);let Pn=Jt===0,Nn=(wo)=>wo;if(Pn){var ao=32-8*Tt;Nn=(wo)=>wo<<ao>>>ao,yn=Nn(yn)}tt(qe,{name:at,fromWireType:Nn,toWireType:(wo,$o)=>$o,readValueFromPointer:Je(at,Tt,Jt!==0),destructorFunction:null})},pl=(qe,at,Tt)=>{let Jt=(yn,Pn)=>{let Nn=0;return{next(){if(Nn>=yn)return{done:!0};let ao=Nn;return Nn++,{value:Pn(ao),done:!1}},[Symbol.iterator](){return this}}};if(!qe[Symbol.iterator])qe[Symbol.iterator]=function(){let yn=this[at]();return Jt(yn,(Pn)=>this[Tt](Pn))}},Zs=function(qe,at,Tt,Jt){qe>>>=0,at>>>=0,Tt>>>=0,Jt>>>=0,Tt=Yt(Tt),Jt=Yt(Jt),Bt([],[qe,at],(yn)=>{let Pn=yn[0];return pl(Pn.registeredClass.instancePrototype,Tt,Jt),[]})};function Cc(qe,at,Tt){qe>>>=0,Tt>>>=0;var Jt=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,BigInt64Array,BigUint64Array],yn=Jt[at];function Pn(Nn){var ao=N[Nn>>>2>>>0],wo=N[Nn+4>>>2>>>0];return new yn(v.buffer,wo,ao)}Tt=Yt(Tt),tt(qe,{name:Tt,fromWireType:Pn,readValueFromPointer:Pn},{ignoreDuplicateRegistrations:!0})}var ea=Object.assign({optional:!0},Sl);function Zr(qe,at){qe>>>=0,at>>>=0,tt(qe,ea)}var Ya=(qe,at,Tt,Jt)=>{if(Tt>>>=0,!(Jt>0))return 0;var yn=Tt,Pn=Tt+Jt-1;for(var Nn=0;Nn<qe.length;++Nn){var ao=qe.codePointAt(Nn);if(ao<=127){if(Tt>=Pn)break;at[Tt++>>>0]=ao}else if(ao<=2047){if(Tt+1>=Pn)break;at[Tt++>>>0]=192|ao>>6,at[Tt++>>>0]=128|ao&63}else if(ao<=65535){if(Tt+2>=Pn)break;at[Tt++>>>0]=224|ao>>12,at[Tt++>>>0]=128|ao>>6&63,at[Tt++>>>0]=128|ao&63}else{if(Tt+3>=Pn)break;at[Tt++>>>0]=240|ao>>18,at[Tt++>>>0]=128|ao>>12&63,at[Tt++>>>0]=128|ao>>6&63,at[Tt++>>>0]=128|ao&63,Nn++}}return at[Tt>>>0]=0,Tt-yn},sh=(qe,at,Tt)=>Ya(qe,P,at,Tt),vs=(qe)=>{var at=0;for(var Tt=0;Tt<qe.length;++Tt){var Jt=qe.charCodeAt(Tt);if(Jt<=127)at++;else if(Jt<=2047)at+=2;else if(Jt>=55296&&Jt<=57343)at+=4,++Tt;else at+=3}return at},Ad=globalThis.TextDecoder&&new TextDecoder,ah=(qe,at,Tt,Jt)=>{var yn=at+Tt;if(Jt)return yn;while(qe[at]&&!(at>=yn))++at;return at},fd=(qe,at=0,Tt,Jt)=>{at>>>=0;var yn=ah(qe,at,Tt,Jt);if(yn-at>16&&qe.buffer&&Ad)return Ad.decode(qe.subarray(at,yn));var Pn="";while(at<yn){var Nn=qe[at++];if(!(Nn&128)){Pn+=String.fromCharCode(Nn);continue}var ao=qe[at++]&63;if((Nn&224)==192){Pn+=String.fromCharCode((Nn&31)<<6|ao);continue}var wo=qe[at++]&63;if((Nn&240)==224)Nn=(Nn&15)<<12|ao<<6|wo;else Nn=(Nn&7)<<18|ao<<12|wo<<6|qe[at++]&63;if(Nn<65536)Pn+=String.fromCharCode(Nn);else{var $o=Nn-65536;Pn+=String.fromCharCode(55296|$o>>10,56320|$o&1023)}}return Pn},Rg=(qe,at,Tt)=>(qe>>>=0,qe?fd(P,qe,at,Tt):"");function Su(qe,at){qe>>>=0,at>>>=0,at=Yt(at);var Tt=!0;tt(qe,{name:at,fromWireType(Jt){var yn=N[Jt>>>2>>>0],Pn=Jt+4,Nn;if(Tt)Nn=Rg(Pn,yn,!0);else{Nn="";for(var ao=0;ao<yn;++ao)Nn+=String.fromCharCode(P[Pn+ao>>>0])}return Ol(Jt),Nn},toWireType(Jt,yn){if(yn instanceof ArrayBuffer)yn=new Uint8Array(yn);var Pn,Nn=typeof yn=="string";if(!(Nn||ArrayBuffer.isView(yn)&&yn.BYTES_PER_ELEMENT==1))Ze("Cannot pass non-string to std::string");if(Tt&&Nn)Pn=vs(yn);else Pn=yn.length;var ao=m6(4+Pn+1),wo=ao+4;if(N[ao>>>2>>>0]=Pn,Nn)if(Tt)sh(yn,wo,Pn+1);else for(var $o=0;$o<Pn;++$o){var Mr=yn.charCodeAt($o);if(Mr>255)Ol(ao),Ze("String has UTF-16 code units that do not fit in 8 bits");P[wo+$o>>>0]=Mr}else P.set(yn,wo>>>0);if(Jt!==null)Jt.push(Ol,ao);return ao},readValueFromPointer:rt,destructorFunction(Jt){Ol(Jt)}})}var s1=globalThis.TextDecoder?new TextDecoder("utf-16le"):void 0,KA=(qe,at,Tt)=>{var Jt=qe>>>1,yn=ah(B,Jt,at/2,Tt);if(yn-Jt>16&&s1)return s1.decode(B.subarray(Jt>>>0,yn>>>0));var Pn="";for(var Nn=Jt;Nn<yn;++Nn){var ao=B[Nn>>>0];Pn+=String.fromCharCode(ao)}return Pn},T0=(qe,at,Tt)=>{if(Tt??=2147483647,Tt<2)return 0;Tt-=2;var Jt=at,yn=Tt<qe.length*2?Tt/2:qe.length;for(var Pn=0;Pn<yn;++Pn){var Nn=qe.charCodeAt(Pn);M[at>>>1>>>0]=Nn,at+=2}return M[at>>>1>>>0]=0,at-Jt},Q_=(qe)=>qe.length*2,Gd=(qe,at,Tt)=>{var Jt="",yn=qe>>>2;for(var Pn=0;!(Pn>=at/4);Pn++){var Nn=N[yn+Pn>>>0];if(!Nn&&!Tt)break;Jt+=String.fromCodePoint(Nn)}return Jt},Dm=(qe,at,Tt)=>{if(at>>>=0,Tt??=2147483647,Tt<4)return 0;var Jt=at,yn=Jt+Tt-4;for(var Pn=0;Pn<qe.length;++Pn){var Nn=qe.codePointAt(Pn);if(Nn>65535)Pn++;if(T[at>>>2>>>0]=Nn,at+=4,at+4>yn)break}return T[at>>>2>>>0]=0,at-Jt},Ph=(qe)=>{var at=0;for(var Tt=0;Tt<qe.length;++Tt){var Jt=qe.codePointAt(Tt);if(Jt>65535)Tt++;at+=4}return at};function Yy(qe,at,Tt){qe>>>=0,at>>>=0,Tt>>>=0,Tt=Yt(Tt);var Jt,yn,Pn;if(at===2)Jt=KA,yn=T0,Pn=Q_;else Jt=Gd,yn=Dm,Pn=Ph;tt(qe,{name:Tt,fromWireType:(Nn)=>{var ao=N[Nn>>>2>>>0],wo=Jt(Nn+4,ao*at,!0);return Ol(Nn),wo},toWireType:(Nn,ao)=>{if(typeof ao!="string")Ze(`Cannot pass non-string to C++ string type ${Tt}`);var wo=Pn(ao),$o=m6(4+wo+at);if(N[$o>>>2>>>0]=wo/at,yn(ao,$o+4,wo+at),Nn!==null)Nn.push(Ol,$o);return $o},readValueFromPointer:rt,destructorFunction(Nn){Ol(Nn)}})}function Nm(qe,at,Tt,Jt,yn,Pn){qe>>>=0,at>>>=0,Tt>>>=0,Jt>>>=0,yn>>>=0,Pn>>>=0,nt[qe]={name:Yt(at),rawConstructor:Er(Tt,Jt),rawDestructor:Er(yn,Pn),fields:[]}}function $f(qe,at,Tt,Jt,yn,Pn,Nn,ao,wo,$o){qe>>>=0,at>>>=0,Tt>>>=0,Jt>>>=0,yn>>>=0,Pn>>>=0,Nn>>>=0,ao>>>=0,wo>>>=0,$o>>>=0,nt[qe].fields.push({fieldName:Yt(at),getterReturnType:Tt,getter:Er(Jt,yn),getterContext:Pn,setterArgumentType:Nn,setter:Er(ao,wo),setterContext:$o})}var a1=function(qe,at){qe>>>=0,at>>>=0,at=Yt(at),tt(qe,{isVoid:!0,name:at,fromWireType:()=>{return},toWireType:(Tt,Jt)=>{return}})};function u6(qe,at){qe>>>=0,at>>>=0,qe=$r.toValue(qe),at=$r.toValue(at),qe.set(at)}var o0=[],p6=(qe)=>{var at=o0.length;return o0.push(qe),at},c1=(qe,at)=>{var Tt=Array(qe);for(var Jt=0;Jt<qe;++Jt)Tt[Jt]=ca(N[at+Jt*4>>>2>>>0],`parameter ${Jt}`);return Tt},yd=(qe,at,Tt)=>{var Jt=[],yn=qe(Jt,Tt);if(Jt.length)N[at>>>2>>>0]=$r.toHandle(Jt);return yn},Rs={},So=(qe)=>{var at=Rs[qe];if(at===void 0)return Yt(qe);return at},Gh=function(qe,at,Tt){at>>>=0;var Jt=8,[yn,...Pn]=c1(qe,at),Nn=yn.toWireType.bind(yn),ao=Pn.map((Qs)=>Qs.readValueFromPointer.bind(Qs));qe--;var wo={toValue:$r.toValue},$o=ao.map((Qs,Us)=>{var sc=`argFromPtr${Us}`;return wo[sc]=Qs,`${sc}(args${Us?"+"+Us*Jt:""})`}),Mr;switch(Tt){case 0:Mr="toValue(handle)";break;case 2:Mr="new (toValue(handle))";break;case 3:Mr="";break;case 1:wo.getStringOrSymbol=So,Mr="toValue(handle)[getStringOrSymbol(methodName)]";break}if(Mr+=`(${$o})`,!yn.isVoid)wo.toReturnWire=Nn,wo.emval_returnValue=yd,Mr=`return emval_returnValue(toReturnWire, destructorsRef, ${Mr})`;Mr=`return function (handle, methodName, destructorsRef, args) {
${Mr}
}`;var Gs=Function(Object.keys(wo),Mr)(...Object.values(wo)),pa=`methodCaller<(${Pn.map((Qs)=>Qs.name)}) => ${yn.name}>`;return p6(ln(pa,Gs))};function Hc(qe,at){return qe>>>=0,at>>>=0,qe=$r.toValue(qe),at=$r.toValue(at),qe==at}function ua(qe,at){return qe>>>=0,at>>>=0,qe=$r.toValue(qe),at=$r.toValue(at),$r.toHandle(qe[at])}function Qg(qe){if(qe>>>=0,qe>9)Jo[qe+1]+=1}function L3(qe,at,Tt,Jt,yn){return qe>>>=0,at>>>=0,Tt>>>=0,Jt>>>=0,yn>>>=0,o0[qe](at,Tt,Jt,yn)}function vT(qe){return qe>>>=0,$r.toHandle(So(qe))}function H3(){return $r.toHandle({})}function nH(qe){qe>>>=0;var at=$r.toValue(qe);dt(at),zr(qe)}function M5(qe,at,Tt){qe>>>=0,at>>>=0,Tt>>>=0,qe=$r.toValue(qe),at=$r.toValue(at),Tt=$r.toValue(Tt),qe[at]=Tt}var w5=()=>4294901760,xv=(qe,at)=>Math.ceil(qe/at)*at,Pu=(qe)=>{var at=h1.buffer.byteLength,Tt=(qe-at+65535)/65536|0;try{return h1.grow(Tt),U(),1}catch(Jt){}};function Mc(qe){qe>>>=0;var at=P.length,Tt=w5();if(qe>Tt)return!1;for(var Jt=1;Jt<=4;Jt*=2){var yn=at*(1+0.2/Jt);yn=Math.min(yn,qe+100663296);var Pn=Math.min(Tt,xv(Math.max(qe,yn),65536)),Nn=Pu(Pn);if(Nn)return!0}return!1}var Cv=(qe,at)=>{if(k_)for(var Tt=qe;Tt<qe+at;Tt++){var Jt=oo(Tt);if(Jt)k_.set(Jt,Tt)}},k_,l1=(qe)=>{if(!k_)k_=new WeakMap,Cv(0,d1.length);return k_.get(qe)||0},Op=[],D0=()=>{if(Op.length)return Op.pop();return d1.grow(1)},Vp=(qe,at)=>d1.set(qe,at),Yp=(qe)=>{let at=qe.length;return[at%128|128,at>>7,...qe]},bv={i:127,p:127,j:126,f:125,d:124,e:111},Rm=(qe)=>Yp(Array.from(qe,(at)=>{var Tt=bv[at];return Tt})),JP=(qe,at)=>{var Tt=Uint8Array.of(0,97,115,109,1,0,0,0,1,...Yp([1,96,...Rm(at.slice(1)),...Rm(at[0]==="v"?"":at[0])]),2,7,1,1,101,1,102,0,0,7,5,1,1,102,0,0),Jt=new WebAssembly.Module(Tt),yn=new WebAssembly.Instance(Jt,{e:{f:qe}}),Pn=yn.exports.f;return Pn},r0=(qe,at)=>{var Tt=l1(qe);if(Tt)return Tt;var Jt=D0();try{Vp(Jt,qe)}catch(Pn){if(!(Pn instanceof TypeError))throw Pn;var yn=JP(qe,at);Vp(Jt,yn)}return k_.set(qe,Jt),Jt},$A=(qe)=>{k_.delete(oo(qe)),Vp(qe,null),Op.push(qe)};En(),Tn();{if(n.noExitRuntime)Re=n.noExitRuntime;if(n.print)g=n.print;if(n.printErr)f=n.printErr;if(n.wasmBinary)y=n.wasmBinary;if(n.arguments)c=n.arguments;if(n.thisProgram)l=n.thisProgram;if(n.preInit){if(typeof n.preInit=="function")n.preInit=[n.preInit];while(n.preInit.length>0)n.preInit.shift()()}}n.addFunction=r0,n.removeFunction=$A;var ap,m6,Ol,qA,F3,h1,d1;function Eu(qe){ap=qe.K,m6=qe.M,Ol=qe.N,qA=h1=qe.I,F3=d1=qe.L}var ZP={l:Ne,C:Le,q:xt,z:$e,G:ft,j:Lo,i:dl,a:_d,E:ul,x:Fp,d:n0,y:Yd,c:vu,p:ji,m:Zs,h:Cc,n:Zr,F:Su,w:Yy,r:Nm,k:$f,H:a1,u:u6,g:Gh,b:zr,o:Hc,B:ua,t:Qg,f:L3,s:vT,A:H3,e:nH,v:M5,D:Mc};function B5(qe){qe=Object.assign({},qe);var at=(Jt)=>(yn)=>Jt(yn)>>>0,Tt=(Jt)=>()=>Jt()>>>0;return qe.K=at(qe.K),qe.M=at(qe.M),qe._emscripten_stack_alloc=at(qe._emscripten_stack_alloc),qe.emscripten_stack_get_current=Tt(qe.emscripten_stack_get_current),qe}function eE(){j();function qe(){if(n.calledRun=!0,x)return;Y(),b?.(n),n.onRuntimeInitialized?.(),X()}if(n.setStatus)n.setStatus("Running..."),setTimeout(()=>{setTimeout(()=>n.setStatus(""),1),qe()},1);else qe()}var T5=await ie();if(eE(),O)t=n;else t=new Promise((qe,at)=>{b=qe,I=at});return t}var Jln=tvr;var Zln="AGFzbQEAAAABlwRFYAF/AGACf38AYAJ/fwF/YAN/f38AYAF/AX9gBH9/f38AYAN/f38Bf2AFf39/f38AYAZ/f39/f38AYAR/f39/AX9gCH9/f39/f39/AGADf398AGAAAGABfAF8YAABf2AEf39/fABgAX8BfGACf38BfGAHf39/f39/fwBgBX9/f39/AX9gBH9/f3wBf2AEf398fwBgA398fwBgCn9/f39/f39/f38AYAV/f39/fwF8YAF8AX9gA39/fAF/YAF8AGAEf398fwF/YAR/f398AXxgA3x8fwF8YAJ8fAF8YAJ8fwF/YAJ/fgBgBX9/fHx8AGAGf398f3x/AGAGf3x8fH9/AGADf3x/AX9gA39/fAF8YAR/f3x8AGAHf39/f3x8fABgBn9/f3x8fABgBn9/fH98fABgDX9/f39/f39/f39/f38AYAV/f39+fgBgAnx/AXxgBX9/f398AGAFf39/f3wBf2AFf398fH8AYAZ/f39/fH8AYAJ/fgF/YAV/f398fwF/YAF+AX9gA39/fwF8YAd/f39/fHx/AGAHf39/fHx8fwBgDH9/f39/f39/f39/fwBgCX9/f39/f39/fwBgBn9/fH98fAF/YAd/f39/fHx8AX9gA39/fgBgAn9/AX5gAn98AX9gAn98AGAGf39/fHx8AX9gBn9/fH98fwF/YAZ/fHx8f38Bf2AFf398fHwBf2AEf398fAF/As0BIgFhAWEAFwFhAWIAAAFhAWMACgFhAWQAAwFhAWUAAAFhAWYAGAFhAWcABgFhAWgAAwFhAWkACAFhAWoAKwFhAWsAFwFhAWwAAwFhAW0ABQFhAW4AAQFhAW8AAgFhAXAABwFhAXEAAAFhAXIACAFhAXMABAFhAXQAAAFhAXUAAQFhAXYAAwFhAXcAAwFhAXgABwFhAXkAAwFhAXoALAFhAUEADgFhAUIAAgFhAUMADAFhAUQABAFhAUUAAAFhAUYAAQFhAUcABQFhAUgAAQP1B/MHAAQAAQwEBAABAgEAAgQAAwkBDQEAAgABBAQCAQ0DAgQAAQEAAQUCAAkJAQEBAgQABAABAQECAAEAAQENAQMCCQICCQAMAwEEAQQOAwABAQAMBgQAAQMBBQABAgEDAQsDBQAJBQUGAwABAgABAAMBBQEAAAACDQEAAQEDHAMBAgMQAgEBAQENCQAABBkBCAgAAgICBwcICAgIHQEBCAQEAhkIAQcIAAMBAwcBAAcFCAgICAEAAAEeHwIEBQcAAQMBBwAFAwIFBQMABAIAAwEDAQELEQAEAi0NHxgCCQEJBQUABAACAQIHBgMAAQEBAQQIAQAAAwUDAAADAgIAAwMBBAIBAAMAAQEAAgcFAwwEDQ0NAwcuBQUKCi8DBgEGAgMBMBEDAwUSEgEACgoKAQUxBQEBAQECBTIBAQADCQAAAwYGCgEBAQEKBwoSAQEEAAUFAQEFAQAzAQYDAAAHAQEDBRIDAAoHCgcKBwoHBRMBAQICBgQBCQEABQEBBgEIAgUDBgQGHjQNIA0NBQUDAwUGAggHAQcABwECAgE1AQMBBQUFBggAAQEBBwEEAQMEBQUFCAMBBQMDAgcHBwEDAQEBBQYFAQY2AQUDAwAGBQMDAQUDAwMBASECIQY3AAEDBgEBBQQRBAIVFQABAQEBBQEBFQABBwcPAQMGAyIDDgQEBAUMAQUJCRIFBwMBBggHBQQBBgEFAAEBAQEFAQMAEgcGBAMAAQAIBwEBAAEDCAEBAQEBAQIAAwEFAwMDAQEDBQUBAQECAwEBAQEBAwIXODkCBwcTBxMHChMHChMFAQEBAQEBAQEBAgkBACAFAgEBIyQDAQUBAQEGBAYAAQMBAAYMBgMEAwEEBAQDAgMCAgEABAcGBQUFBgQCBCUCBgYCAgIaAAYCBAIBAQQEAAACAAYEAAQAAAQAAQQQAQECBAsDAwsDARYDAQ4AAAQEAgUBBAQCAQQEAgUBBAQCAQQODg4OAgAEDgIJAQQEAgkBBAQCAQQABCYBAQsDAw8LCwMnAw8FBAQQEAQLCxADDAwAGxsEAgEBBAEFDwAEEAQAAwEABAAABAAABAAEAAAEKAAABAQEBAMDBQMpBAMFAwUDBAIBBAQCAQQDAQEBAwMDBAIBAQQABAEPARYqAAQCAxEBBAQCBQEEBAIBAQQEAgEEBAIBBAkCAwkGFAY6AQYGAwYBBgMGAxQGDwsGAwMGBgMDBgMGAwM7CQYDAwQDAQQEBgMDAQMABAYDAwEABAYDAQQDAQQGAwMBAAQDBAYDAwEEBgMDAQQGAwMBBDw9AwIAPgE/AgJAFBxBBgQlQgYUCR0CAkMGRBoCGhQCAAQEBAgICAcHAgQMBAUBcADvBAUHAQGAAoCABAYIAX8BQbCrBgsHGwYBSQIAAUoAlAgBSwCTCAFMAQABTQAnAU4AIgniCAEAQQEL7gSgBZ0EiQFsiQGEBokBgAaJAf8FiQH+BYkBnQSJAf0FiQHrBekFa+cFvAbmBbsGswG6BsMC1gbVBswG3QXWBc8FtweyB60HqQf8BpQH4gXDBeEFwQXgBd8F4wXABdgFswHZBcMCywOzAc4D1wW/Bd4F+AbGA7ED2wW+BbwF5QW6BeQFuAWbBZsFnweaB6ED9gaSCNoFiwiJCIgI7wbsBusG6ga9BrcGmgaHCJkGnAOYBpcGhgiWBrEDlQaFCNgHnQacA5wGhAibBp8GngaDCN0G2wbaBuYG6QGCCJsEgQicBJoE9AaACMABswG+BqoGnAOQArMBoAS/AZ8EngTkAv8HqQbDAqgGpwamBrMBpAalBpQG/ge2BqEG/QegBvwHowaPAvsHkQX6B5AF+Qf3BvgH+Qb3B8IH9gePBfUHhwT0B/UG8wfXBvIHzQfxB6IGrQXpBugG5wahA7UGrQWOAvAHrwauBu8HrQbuB8IB7QesBqsG9AHzAawFqwX0AfMB9AHzAewH6weqBakFrAWrBfQB8wHqB+kH9AHzAaoFqQWfBbUHtAfoB6sBa2znB+YHqAXlB+QH4werAWts4gfhB6cF4AffB94HqwFrbN0H3AemBdsH2gfZB6sBa2ylBaQFowWiBaEF1wfWB2ts1QfUB6cF0wfSB9EHqwFrbNAHzwfOB8wHywfKB8kHa2zIB8cHqAXGB8UHxAfDB2tswQfAB6YFvwe+B70HqwFrbKUFpAWjBaIFoQW8B6sBa2y7B7oHuQe4B7YHmQWZBZsHmQeXBZgHlweWB5cFlQefBZMHkgezB4UBfLEHhAGwB4UBfK8HhAGuB4UBfKwHhAGcBYUBfKsHhAGqB4UBfKgHhAGnB6YHfKUHpAejB4UBfKIHhAGhB4UBfKAHhAGcBYUBfJ4HhAGdB4UBfJwHhAFSsAWiBFIwkQeQB0JRlQWPB44HUjCNB4wHQlGVBYsHigdSMIkHiAdCUYcHhgeFB1IwhAeDB0JRggeBB4AHUjD/Bv4GQlH9BvsG+gbzBvIGiQW7BTBSMPEG8AZCUYcF7gbtBlJSMOUG5AZCUeIE4wbiBjDhBuAGQlHiBN8G3gZS2QbeBNgG0AbcBtMG1AbSBtEG3wTPBs4GzQYwywbKBskGMMgGxwaJBTDGBsUGxAYwwwbCBsEGMMAGvwZCMLkGuAZCMDC0BrMGQlGyBrEGsAaTBpIGQjAwkQaQBkJRhwWPBo4GMI0GjAZCUYsGigaJBjCIBocGQlGGBoUGgwZSMIIGgQYwUjD8BfsFQlHuA/oF+QVSMPgF9wVCUfYF9QX0BVIw8wXyBUJR6gPxBfAFUjDvBe4FQlHtBewF6gVC6AXSBdwF1QXUBdMFMNEF0AVpxQODAs4FzQXLBcoFUjDJBcgFQlHHBcYFxQXEBcIFxQMwuQUwtwVSMEJCogMwvQUwogMwtgWNCJAItQUwjgiRCLQFMI8IsQWzBTCyBTCMCK8FigivBQwCqgEK2d4e8weEDAEIfwJAIABFDQAgAEEIayIDIABBBGsoAgAiAUF4cSIAaiEFAkAgAUEBcQ0AIAFBAnFFDQEgAyADKAIAIgFrIgNBtKECKAIASQ0BIAAgAWohAAJAAkACQEG4oQIoAgAgA0cEQCADKAIMIQIgAUH/AU0EQCACIAMoAggiBEcNAkGkoQJBpKECKAIAQX4gAUEDdndxNgIADAULIAMoAhghBiACIANHBEAgAygCCCIBIAI2AgwgAiABNgIIDAQLIAMoAhQiAQR/IANBFGoFIAMoAhAiAUUNAyADQRBqCyEEA0AgBCEHIAEiAkEUaiEEIAIoAhQiAQ0AIAJBEGohBCACKAIQIgENAAsgB0EANgIADAMLIAUoAgQiAUEDcUEDRw0DQayhAiAANgIAIAUgAUF+cTYCBCADIABBAXI2AgQgBSAANgIADwsgBCACNgIMIAIgBDYCCAwCC0EAIQILIAZFDQACQCADKAIcIgFBAnQiBCgC1KMCIANGBEAgBEHUowJqIAI2AgAgAg0BQaihAkGooQIoAgBBfiABd3E2AgAMAgsCQCADIAYoAhBGBEAgBiACNgIQDAELIAYgAjYCFAsgAkUNAQsgAiAGNgIYIAMoAhAiAQRAIAIgATYCECABIAI2AhgLIAMoAhQiAUUNACACIAE2AhQgASACNgIYCyADIAVPDQAgBSgCBCIBQQFxRQ0AAkACQAJAAkAgAUECcUUEQEG8oQIoAgAgBUYEQEG8oQIgAzYCAEGwoQJBsKECKAIAIABqIgA2AgAgAyAAQQFyNgIEIANBuKECKAIARw0GQayhAkEANgIAQbihAkEANgIADwtBuKECKAIAIgggBUYEQEG4oQIgAzYCAEGsoQJBrKECKAIAIABqIgA2AgAgAyAAQQFyNgIEIAAgA2ogADYCAA8LIAFBeHEgAGohACAFKAIMIQIgAUH/AU0EQCAFKAIIIgQgAkYEQEGkoQJBpKECKAIAQX4gAUEDdndxNgIADAULIAQgAjYCDCACIAQ2AggMBAsgBSgCGCEGIAIgBUcEQCAFKAIIIgEgAjYCDCACIAE2AggMAwsgBSgCFCIBBH8gBUEUagUgBSgCECIBRQ0CIAVBEGoLIQQDQCAEIQcgASICQRRqIQQgAigCFCIBDQAgAkEQaiEEIAIoAhAiAQ0ACyAHQQA2AgAMAgsgBSABQX5xNgIEIAMgAEEBcjYCBCAAIANqIAA2AgAMAwtBACECCyAGRQ0AAkAgBSgCHCIBQQJ0IgQoAtSjAiAFRgRAIARB1KMCaiACNgIAIAINAUGooQJBqKECKAIAQX4gAXdxNgIADAILAkAgBSAGKAIQRgRAIAYgAjYCEAwBCyAGIAI2AhQLIAJFDQELIAIgBjYCGCAFKAIQIgEEQCACIAE2AhAgASACNgIYCyAFKAIUIgFFDQAgAiABNgIUIAEgAjYCGAsgAyAAQQFyNgIEIAAgA2ogADYCACADIAhHDQBBrKECIAA2AgAPCyAAQf8BTQRAIABB+AFxQcyhAmohAQJ/QaShAigCACIEQQEgAEEDdnQiAHFFBEBBpKECIAAgBHI2AgAgAQwBCyABKAIICyEAIAEgAzYCCCAAIAM2AgwgAyABNgIMIAMgADYCCA8LQR8hAiAAQf///wdNBEAgAEEmIABBCHZnIgFrdkEBcSABQQF0ckE+cyECCyADIAI2AhwgA0IANwIQIAJBAnRB1KMCaiEEAn8CQAJ/QaihAigCACIBQQEgAnQiB3FFBEBBqKECIAEgB3I2AgAgBCADNgIAQRghAkEIDAELIABBGSACQQF2a0EAIAJBH0cbdCECIAQoAgAhBANAIAQiASgCBEF4cSAARg0CIAJBHXYhBCACQQF0IQIgASAEQQRxaiIHKAIQIgQNAAsgByADNgIQQRghAiABIQRBCAshACADIQEgAwwBCyABKAIIIgQgAzYCDCABIAM2AghBGCEAQQghAkEACyEHIAIgA2ogBDYCACADIAE2AgwgACADaiAHNgIAQcShAkHEoQIoAgBBAWsiAEF/IAAbNgIACwsSACAAEFAiAEUEQBCuAgALIAALLwEBfwJAIAAoAggEQCAAIAAoAggiAUEBazYCCCABDQELIAAgACgCACgCEBEAAAsLVwEDfyAAKAIIIAFJBEAgAUECdBAnIQQgACgCACECAkAgACgCBCIDRQ0AIANBAnQiA0UNACAEIAIgA/wKAAALIAIEQCACECILIAAgATYCCCAAIAQ2AgALCwkAQfENEJ4FAAvCKAELfyMAQRBrIgokAAJAAkACQAJAAkACQAJAAkACQAJAIABB9AFNBEBBpKECKAIAIgRBECAAQQtqQfgDcSAAQQtJGyIGQQN2IgB2IgFBA3EEQAJAIAFBf3NBAXEgAGoiA0EDdCIBQcyhAmoiACABKALUoQIiAigCCCIFRgRAQaShAiAEQX4gA3dxNgIADAELIAUgADYCDCAAIAU2AggLIAJBCGohACACIAFBA3I2AgQgASACaiIBIAEoAgRBAXI2AgQMCwsgBkGsoQIoAgAiCE0NASABBEACQEECIAB0IgJBACACa3IgASAAdHFoIgNBA3QiAUHMoQJqIgIgASgC1KECIgAoAggiBUYEQEGkoQIgBEF+IAN3cSIENgIADAELIAUgAjYCDCACIAU2AggLIAAgBkEDcjYCBCAAIAZqIgcgASAGayIFQQFyNgIEIAAgAWogBTYCACAIBEAgCEF4cUHMoQJqIQFBuKECKAIAIQICfyAEQQEgCEEDdnQiA3FFBEBBpKECIAMgBHI2AgAgAQwBCyABKAIICyEDIAEgAjYCCCADIAI2AgwgAiABNgIMIAIgAzYCCAsgAEEIaiEAQbihAiAHNgIAQayhAiAFNgIADAsLQaihAigCACILRQ0BIAtoQQJ0KALUowIiASgCBEF4cSAGayEDIAEhAgNAAkAgASgCECIARQRAIAEoAhQiAEUNAQsgACgCBEF4cSAGayIBIAMgASADSSIBGyEDIAAgAiABGyECIAAhAQwBCwsgAigCGCEJIAIgAigCDCIARwRAIAIoAggiASAANgIMIAAgATYCCAwKCyACKAIUIgEEfyACQRRqBSACKAIQIgFFDQMgAkEQagshBQNAIAUhByABIgBBFGohBSAAKAIUIgENACAAQRBqIQUgACgCECIBDQALIAdBADYCAAwJC0F/IQYgAEG/f0sNACAAQQtqIgFBeHEhBkGooQIoAgAiB0UNAEEfIQhBACAGayEDIABB9P//B00EQCAGQSYgAUEIdmciAGt2QQFxIABBAXRrQT5qIQgLAkACQAJAIAhBAnQoAtSjAiIBRQRAQQAhAAwBC0EAIQAgBkEZIAhBAXZrQQAgCEEfRxt0IQIDQAJAIAEoAgRBeHEgBmsiBCADTw0AIAEhBSAEIgMNAEEAIQMgASEADAMLIAAgASgCFCIEIAQgASACQR12QQRxaigCECIBRhsgACAEGyEAIAJBAXQhAiABDQALCyAAIAVyRQRAQQAhBUECIAh0IgBBACAAa3IgB3EiAEUNAyAAaEECdCgC1KMCIQALIABFDQELA0AgACgCBEF4cSAGayICIANJIQEgAiADIAEbIQMgACAFIAEbIQUgACgCECIBBH8gAQUgACgCFAsiAA0ACwsgBUUNACADQayhAigCACAGa08NACAFKAIYIQggBSAFKAIMIgBHBEAgBSgCCCIBIAA2AgwgACABNgIIDAgLIAUoAhQiAQR/IAVBFGoFIAUoAhAiAUUNAyAFQRBqCyECA0AgAiEEIAEiAEEUaiECIAAoAhQiAQ0AIABBEGohAiAAKAIQIgENAAsgBEEANgIADAcLIAZBrKECKAIAIgVNBEBBuKECKAIAIQACQCAFIAZrIgFBEE8EQCAAIAZqIgIgAUEBcjYCBCAAIAVqIAE2AgAgACAGQQNyNgIEDAELIAAgBUEDcjYCBCAAIAVqIgEgASgCBEEBcjYCBEEAIQFBACECC0GsoQIgATYCAEG4oQIgAjYCACAAQQhqIQAMCQsgBkGwoQIoAgAiAkkEQEGwoQIgAiAGayIBNgIAQbyhAkG8oQIoAgAiACAGaiICNgIAIAIgAUEBcjYCBCAAIAZBA3I2AgQgAEEIaiEADAkLQQAhACAGQS9qIgMCf0H8pAIoAgAEQEGEpQIoAgAMAQtBiKUCQn83AgBBgKUCQoCggICAgAQ3AgBB/KQCIApBDGpBcHFB2KrVqgVzNgIAQZClAkEANgIAQeCkAkEANgIAQYAgCyIBaiIEQQAgAWsiB3EiASAGTQ0IQdykAigCACIFBEBB1KQCKAIAIgggAWoiCSAITSAFIAlJcg0JCwJAQeCkAi0AAEEEcUUEQAJAAkACQAJAQbyhAigCACIFBEBB5KQCIQADQCAAKAIAIgggBU0EQCAFIAggACgCBGpJDQMLIAAoAggiAA0ACwtBABCsASICQX9GDQMgASEEQYClAigCACIAQQFrIgUgAnEEQCABIAJrIAIgBWpBACAAa3FqIQQLIAQgBk0NA0HcpAIoAgAiAARAQdSkAigCACIFIARqIgcgBU0gACAHSXINBAsgBBCsASIAIAJHDQEMBQsgBCACayAHcSIEEKwBIgIgACgCACAAKAIEakYNASACIQALIABBf0YNASAGQTBqIARNBEAgACECDAQLQYSlAigCACICIAMgBGtqQQAgAmtxIgIQrAFBf0YNASACIARqIQQgACECDAMLIAJBf0cNAgtB4KQCQeCkAigCAEEEcjYCAAsgARCsASICQX9GQQAQrAEiAEF/RnIgACACTXINBSAAIAJrIgQgBkEoak0NBQtB1KQCQdSkAigCACAEaiIANgIAQdikAigCACAASQRAQdikAiAANgIACwJAQbyhAigCACIDBEBB5KQCIQADQCACIAAoAgAiASAAKAIEIgVqRg0CIAAoAggiAA0ACwwEC0G0oQIoAgAiAEEAIAAgAk0bRQRAQbShAiACNgIAC0EAIQBB6KQCIAQ2AgBB5KQCIAI2AgBBxKECQX82AgBByKECQfykAigCADYCAEHwpAJBADYCAANAIABBA3QiASABQcyhAmoiBTYC1KECIAEgBTYC2KECIABBAWoiAEEgRw0AC0GwoQIgBEEoayIAQXggAmtBB3EiAWsiBTYCAEG8oQIgASACaiIBNgIAIAEgBUEBcjYCBCAAIAJqQSg2AgRBwKECQYylAigCADYCAAwECyACIANNIAEgA0tyDQIgACgCDEEIcQ0CIAAgBCAFajYCBEG8oQIgA0F4IANrQQdxIgBqIgE2AgBBsKECQbChAigCACAEaiICIABrIgA2AgAgASAAQQFyNgIEIAIgA2pBKDYCBEHAoQJBjKUCKAIANgIADAMLQQAhAAwGC0EAIQAMBAtBtKECKAIAIAJLBEBBtKECIAI2AgALIAIgBGohBUHkpAIhAAJAA0AgBSAAKAIAIgFHBEAgACgCCCIADQEMAgsLIAAtAAxBCHFFDQMLQeSkAiEAA0ACQCAAKAIAIgEgA00EQCADIAEgACgCBGoiBUkNAQsgACgCCCEADAELC0GwoQIgBEEoayIAQXggAmtBB3EiAWsiBzYCAEG8oQIgASACaiIBNgIAIAEgB0EBcjYCBCAAIAJqQSg2AgRBwKECQYylAigCADYCACADIAVBJyAFa0EHcWpBL2siACAAIANBEGpJGyIBQRs2AgQgAUHspAIpAgA3AhAgAUHkpAIpAgA3AghB7KQCIAFBCGo2AgBB6KQCIAQ2AgBB5KQCIAI2AgBB8KQCQQA2AgAgAUEYaiEAA0AgAEEHNgIEIABBCGogAEEEaiEAIAVJDQALIAEgA0YNACABIAEoAgRBfnE2AgQgAyABIANrIgJBAXI2AgQgASACNgIAAn8gAkH/AU0EQCACQfgBcUHMoQJqIQACf0GkoQIoAgAiAUEBIAJBA3Z0IgJxRQRAQaShAiABIAJyNgIAIAAMAQsgACgCCAshASAAIAM2AgggASADNgIMQQwhAkEIDAELQR8hACACQf///wdNBEAgAkEmIAJBCHZnIgBrdkEBcSAAQQF0ckE+cyEACyADIAA2AhwgA0IANwIQIABBAnRB1KMCaiEBAkACQEGooQIoAgAiBUEBIAB0IgRxRQRAQaihAiAEIAVyNgIAIAEgAzYCAAwBCyACQRkgAEEBdmtBACAAQR9HG3QhACABKAIAIQUDQCAFIgEoAgRBeHEgAkYNAiAAQR12IQUgAEEBdCEAIAEgBUEEcWoiBCgCECIFDQALIAQgAzYCEAsgAyABNgIYQQghAiADIgEhAEEMDAELIAEoAggiACADNgIMIAEgAzYCCCADIAA2AghBACEAQRghAkEMCyADaiABNgIAIAIgA2ogADYCAAtBsKECKAIAIgAgBk0NAEGwoQIgACAGayIBNgIAQbyhAkG8oQIoAgAiACAGaiICNgIAIAIgAUEBcjYCBCAAIAZBA3I2AgQgAEEIaiEADAQLQaChAkEwNgIAQQAhAAwDCyAAIAI2AgAgACAAKAIEIARqNgIEIAJBeCACa0EHcWoiCCAGQQNyNgIEIAFBeCABa0EHcWoiBCAGIAhqIgNrIQcCQEG8oQIoAgAgBEYEQEG8oQIgAzYCAEGwoQJBsKECKAIAIAdqIgA2AgAgAyAAQQFyNgIEDAELQbihAigCACAERgRAQbihAiADNgIAQayhAkGsoQIoAgAgB2oiADYCACADIABBAXI2AgQgACADaiAANgIADAELIAQoAgQiAEEDcUEBRgRAIABBeHEhCSAEKAIMIQICQCAAQf8BTQRAIAQoAggiASACRgRAQaShAkGkoQIoAgBBfiAAQQN2d3E2AgAMAgsgASACNgIMIAIgATYCCAwBCyAEKAIYIQYCQCACIARHBEAgBCgCCCIAIAI2AgwgAiAANgIIDAELAkAgBCgCFCIABH8gBEEUagUgBCgCECIARQ0BIARBEGoLIQEDQCABIQUgACICQRRqIQEgACgCFCIADQAgAkEQaiEBIAIoAhAiAA0ACyAFQQA2AgAMAQtBACECCyAGRQ0AAkAgBCgCHCIAQQJ0IgEoAtSjAiAERgRAIAFB1KMCaiACNgIAIAINAUGooQJBqKECKAIAQX4gAHdxNgIADAILAkAgBCAGKAIQRgRAIAYgAjYCEAwBCyAGIAI2AhQLIAJFDQELIAIgBjYCGCAEKAIQIgAEQCACIAA2AhAgACACNgIYCyAEKAIUIgBFDQAgAiAANgIUIAAgAjYCGAsgByAJaiEHIAQgCWoiBCgCBCEACyAEIABBfnE2AgQgAyAHQQFyNgIEIAMgB2ogBzYCACAHQf8BTQRAIAdB+AFxQcyhAmohAAJ/QaShAigCACIBQQEgB0EDdnQiAnFFBEBBpKECIAEgAnI2AgAgAAwBCyAAKAIICyEBIAAgAzYCCCABIAM2AgwgAyAANgIMIAMgATYCCAwBC0EfIQIgB0H///8HTQRAIAdBJiAHQQh2ZyIAa3ZBAXEgAEEBdHJBPnMhAgsgAyACNgIcIANCADcCECACQQJ0QdSjAmohAAJAAkBBqKECKAIAIgFBASACdCIFcUUEQEGooQIgASAFcjYCACAAIAM2AgAMAQsgB0EZIAJBAXZrQQAgAkEfRxt0IQIgACgCACEBA0AgASIAKAIEQXhxIAdGDQIgAkEddiEBIAJBAXQhAiAAIAFBBHFqIgUoAhAiAQ0ACyAFIAM2AhALIAMgADYCGCADIAM2AgwgAyADNgIIDAELIAAoAggiASADNgIMIAAgAzYCCCADQQA2AhggAyAANgIMIAMgATYCCAsgCEEIaiEADAILAkAgCEUNAAJAIAUoAhwiAUECdCICKALUowIgBUYEQCACQdSjAmogADYCACAADQFBqKECIAdBfiABd3EiBzYCAAwCCwJAIAUgCCgCEEYEQCAIIAA2AhAMAQsgCCAANgIUCyAARQ0BCyAAIAg2AhggBSgCECIBBEAgACABNgIQIAEgADYCGAsgBSgCFCIBRQ0AIAAgATYCFCABIAA2AhgLAkAgA0EPTQRAIAUgAyAGaiIAQQNyNgIEIAAgBWoiACAAKAIEQQFyNgIEDAELIAUgBkEDcjYCBCAFIAZqIgQgA0EBcjYCBCADIARqIAM2AgAgA0H/AU0EQCADQfgBcUHMoQJqIQACf0GkoQIoAgAiAUEBIANBA3Z0IgJxRQRAQaShAiABIAJyNgIAIAAMAQsgACgCCAshASAAIAQ2AgggASAENgIMIAQgADYCDCAEIAE2AggMAQtBHyEAIANB////B00EQCADQSYgA0EIdmciAGt2QQFxIABBAXRyQT5zIQALIAQgADYCHCAEQgA3AhAgAEECdEHUowJqIQECQAJAIAdBASAAdCICcUUEQEGooQIgAiAHcjYCACABIAQ2AgAgBCABNgIYDAELIANBGSAAQQF2a0EAIABBH0cbdCEAIAEoAgAhAQNAIAEiAigCBEF4cSADRg0CIABBHXYhByAAQQF0IQAgAiAHQQRxaiIHKAIQIgENAAsgByAENgIQIAQgAjYCGAsgBCAENgIMIAQgBDYCCAwBCyACKAIIIgAgBDYCDCACIAQ2AgggBEEANgIYIAQgAjYCDCAEIAA2AggLIAVBCGohAAwBCwJAIAlFDQACQCACKAIcIgFBAnQiBSgC1KMCIAJGBEAgBUHUowJqIAA2AgAgAA0BQaihAiALQX4gAXdxNgIADAILAkAgAiAJKAIQRgRAIAkgADYCEAwBCyAJIAA2AhQLIABFDQELIAAgCTYCGCACKAIQIgEEQCAAIAE2AhAgASAANgIYCyACKAIUIgFFDQAgACABNgIUIAEgADYCGAsCQCADQQ9NBEAgAiADIAZqIgBBA3I2AgQgACACaiIAIAAoAgRBAXI2AgQMAQsgAiAGQQNyNgIEIAIgBmoiBSADQQFyNgIEIAMgBWogAzYCACAIBEAgCEF4cUHMoQJqIQBBuKECKAIAIQECf0EBIAhBA3Z0IgcgBHFFBEBBpKECIAQgB3I2AgAgAAwBCyAAKAIICyEEIAAgATYCCCAEIAE2AgwgASAANgIMIAEgBDYCCAtBuKECIAU2AgBBrKECIAM2AgALIAJBCGohAAsgCkEQaiQAIAALFgAgAEEQahAvGiAAQQhqEC8aIAAQLwsrAQJ/IAAoAgAiASgCACICBEAgASACEHsgACgCACIAKAIAIAAoAggaECILC/w9AxJ/HXwLfiMAQbACayIMJAAgDEIANwMIIAxCgICAgICAgPg/NwMAIAxCADcDECAMQgA3AxggDEIANwMoIAxCgICAgICAgPg/NwMgIAxCADcDMCAMQgA3AzggDEIANwNIIAxCgICAgICAgPg/NwNAIAxCADcDUCAMQgA3A1ggDEGYAmogAUEYaiIFIAwQygEgDCsDmAIgDCsDoAJiBEAgASgCDCELIwBBwAZrIgMkACADQgA3A/AEIANCgICAgICAgPg/NwPoBCADQgA3A/gEIANCADcDgAUgA0IANwOQBSADQoCAgICAgID4PzcDiAUgA0IANwOYBSADQgA3A6AFIANCADcDsAUgA0KAgICAgICA+D83A6gFIANCADcDuAUgA0IANwPABSADQaADaiAFIANB6ARqEMoBAkAgAysDoAMgAysDqANhBEAgDCALEDcaDAELIAwQOyEIIAsoAkQiAgRAIAggAjYCRAwBCyAFKQMAITEgBSkDCCEyIAUpAxAhMyAFKQMYITQgBSkDICE1IAUpAyghNiAFKQMwITcgBSkDOCE4IAUpA0AhOSAFKQNIITogBSkDUCE7IAMgBSkDWEL///////////8Ag0KAgICAgICA+P8AVDoA8wQgAyA7Qv///////////wCDQoCAgICAgID4/wBUOgDyBCADIDpC////////////AINCgICAgICAgPj/AFQ6APEEIAMgOUL///////////8Ag0KAgICAgICA+P8AVDoA8AQgAyA4Qv///////////wCDQoCAgICAgID4/wBUOgDvBCADIDdC////////////AINCgICAgICAgPj/AFQ6AO4EIAMgNkL///////////8Ag0KAgICAgICA+P8AVDoA7QQgAyA1Qv///////////wCDQoCAgICAgID4/wBUOgDsBCADIDRC////////////AINCgICAgICAgPj/AFQ6AOsEIAMgM0L///////////8Ag0KAgICAgICA+P8AVDoA6gQgAyAyQv///////////wCDQoCAgICAgID4/wBUOgDpBCADIDFC////////////AINCgICAgICAgPj/AFQ6AOgEAkACQCADLQDpBCADLQDoBHFFDQAgAy0A6gRBAXFFDQAgAy0A7AQgAy0A6wRxRQ0AIAMtAO0EQQFxRQ0AIAMtAO8EIAMtAO4EcUUNACADLQDwBEEBcUUNACADLQDyBCADLQDxBHFFDQAgAy0A8wRBAXENAQsgCEEBECwMAQsgCCALKALIATYCyAEgCCALRwRAIAsoAswBIQYgC0HQAWohEiMAQRBrIg0kACAIQcwBaiIKKAIIBEAgDSAKNgIEIAooAgAhAiAKIApBBGo2AgAgCigCBEEANgIIIApCADcCBCANIAIoAgQiBCACIAQbIgI2AgwgDSACNgIIIAIEQCANIAIQsAQ2AggLAkAgDSgCDCICRSAGIBJGcg0AA0AgAiAGKAIQNgIQIAJBGGogBkEYakHqAPwKAAAgAiEJAkAgCigCBCIERQRAIApBBGoiAiEHDAELIAkoAhAhDgNAIAQiAigCECAOSgRAIAIhByACKAIAIgQNAQwCCyACKAIEIgQNAAsgAkEEaiEHCyAKIAIgByAJEIIBIA0gDSgCCCICNgIMIAIEQCANIAIQsAQ2AggLAkAgBigCBCICBEADQCACIgYoAgAiAg0ADAILAAsDQCAGIAYoAggiBigCAEcNAAsLIA0oAgwiAkUNASAGIBJHDQALCyANKAIEIA0oAgwQbyANKAIIIgIEQCACKAIIIgQEQANAIAQiAigCCCIEDQALIA0gAjYCCAsgDSgCBCACEG8LCyAGIBJHBEAgCkEEaiEQA0AjAEEQayIRJABBiAEQIyITQRBqIg8gBkEQakH4APwKAAACfwJAAkAgECIHIApBBGoiBEcEQCAPKAIAIgkgBygCEEoNAQsgBygCACEOAkAgByICIAooAgBHBEACQCAORQRAA0AgAiACKAIIIgIoAgBGDQAMAgsACyAOIQkDQCAJIgIoAgQiCQ0ACwsgDygCACIJIAIoAhBIDQELIA5FBEAgESAHNgIMIAcMBAsgESACNgIMIAJBBGoMAwsDQCAEIgcoAgAiAkUNAgNAIAkgAiIEKAIQSA0BIAIoAgQiAg0ACwsgBEEEaiEHDAELA0AgBCIHKAIAIgJFDQEDQCACIgQoAhAgCU4NASACKAIEIgINAAsLIARBBGohBwsgESAENgIMIAcLIQIgCiARKAIMIAIgExCCASARQRBqJAACQCAGKAIEIgIEQANAIAIiBigCACICDQAMAgsACwNAIAYgBigCCCIGKAIARw0ACwsgBiASRw0ACwsgDUEQaiQACwJAIAhBAGogC0YNACAIKALYASICBEAgAhAiCyAIQgA3AtgBIAggCygC3AEiAjYC4AEgCCACNgLcASACRQ0AIAggAkEEdCICECciBDYC2AEgAkUNACAEIAsoAtgBIAL8CgAACyAIIAsrAzA5AzAgCCALKwM4OQM4IAggCygCQDYCQCAIQYgBaiIOIAtBiAFqEJICIAggC0Ew/AoAACAIQdgAaiIJIAtB2ABqIg8Q7QIgCEHoAGoiByALQegAahDtAiAIQfgAaiIKIAtB+ABqEO0CIAsoArwBIQIgA0IANwOABCADQgA3A4gEIANCADcDkAQgA0IANwOYBCADIAMpA4AENwOgAiADIAMpA4gENwOoAiADIAMpA5AENwOwAiADIAMpA5gENwO4AiAIQbgBaiACIANBoAJqENoEIAhBfzYCyAEgCCgCzAEiAiAIQdABaiIERwRAA0AgAisDICEVIAIrAyghFCACKwMwIRcgAisDOCEbIAIrA0AhGCACKwNIIRYgAisDUCEZIAIrA1ghGiACKwNgIR4gAisDaCEfIAIrA3AhHCACKwN4ISAgA0KAgICAgICA+D83A+AFIAMgIDkD2AUgAyAcOQPQBSADIB85A8gFIANCADcDwAUgAyAeOQO4BSADIBo5A7AFIAMgGTkDqAUgA0IANwOgBSADIBY5A5gFIAMgGDkDkAUgAyAbOQOIBSADQgA3A4AFIAMgFzkD+AQgAyAUOQPwBCADIBU5A+gEIANBoANqIgYgBSADQegEahDwASACQSBqIAZB4AD8CgAAAkAgAigCBCIGBEADQCAGIgIoAgAiBg0ADAILAAsDQCACIAIoAggiAigCAEcNAAsLIAIgBEcNAAsLIAsoAkwhAiADQgA3A5gDIANCADcDkAMgA0IANwOIAyADQgA3A4gCIANCADcDkAIgA0IANwOYAiAIQcgAaiACIANBiAJqEGcgCygCrAEhAiADQgA3A/ACIANCADcD+AIgA0IANwOAAyADIAMpA/ACNwPwASADIAMpA/gCNwP4ASADIAMpA4ADNwOAAiAIQagBaiACIANB8AFqEGcgCygCnAEhAiADQgA3A9gCIANCADcD4AIgA0IANwPoAiADIAMpA9gCNwPYASADIAMpA+ACNwPgASADIAMpA+gCNwPoASAIQZgBaiACIANB2AFqEGcgBSsDQCEeIAUrAzghFSAFKwMwIRQgBSsDKCEXIAUrAyAhGyAFKwMYIRggBSsDECEWIAUrAwghGSAFKwMAIRogAyALKAJMIgQEfCALKAJIIgIgBEEYbGohBCAFKwNYIR0gBSsDUCEhIAUrA0ghIiAIKAJIIQYDQCAGIB0gFiACKwMAIh+iIBcgAisDCCIcoqAgHiACKwMQIiCioKA5AxAgBiAhIBkgH6IgGyAcoqAgFSAgoqCgOQMIIAYgIiAaIB+iIBggHKKgIBQgIKKgoDkDACAGQRhqIQYgAkEYaiICIARHDQALIAUrAxAhFiAFKwMIIRkgBSsDACEaIAUrAzghFSAFKwMwIRQgBSsDKCEXIAUrAyAhGyAFKwMYIRggBSsDQAUgHgs5A6gFIAMgFzkDoAUgAyAWOQOYBSADIBU5A5AFIAMgGzkDiAUgAyAZOQOABSADIBQ5A/gEIAMgGDkD8AQgAyAaOQPoBCADQaADaiICIANB6ARqEJABIAgoAqgBIQYgCygCqAEhBCALKAKsASEQIANBkAFqIg0gAkHIAPwKAAAgBCAEIBBBGGxqIAYgDRC6BCAIKAKYASEGIAsoApgBIQQgCygCnAEhECADQcgAaiINIAJByAD8CgAAIAQgBCAQQRhsaiAGIA0QugQgCygCQCIEQQJKBEAgDyALQcgBaiACIA4gCygCjAEgBG4gBEEAEL4ECyAFKwMYIhsgBSsDOCIYoiAFKwMgIhYgBSsDMCIZoqEgBSsDECIcoiAFKwMAIiAgFiAFKwNAIhqiIAUrAygiHiAYoqGiIAUrAwgiHSAeIBmiIBsgGqKhoqCgIR8gCygCvAEiDgRAIAsoAmghDyALKAK4ASEQIAgoArgBIQ1BACECA0AgECAfRAAAAAAAAAAAYwR/IAIgAkEDcEEBdGtBAnQgD2ooAggFIAILQQV0aiIEKwMQIRUgBCsDACEUIAQrAwghFyANIAJBBXRqIgYgBCsDGDkDGCAGIBwgFKIgHiAXoqAgGiAVoqA5AxAgBiAdIBSiIBYgF6KgIBggFaKgOQMIIAYgICAUoiAbIBeioCAZIBWioDkDACACQQFqIgIgDkcNAAsLAkAgH0QAAAAAAAAAAGNFDQAgCRA4IAcQOCAKEDggCCgCXCICQQNuIQ8gAkEDSQ0AIAooAgAhBCAHKAIAIQcgCSgCACEKQQAhCQNAIAMgCiAJQQNsIhBBAnQiAkEIaiIGaigCACINNgLoBCADIAIgCmooAgAiETYC7AQgAyAGIAdqKAIANgLwBCADIAQgBmooAgA2AvQEIAogAkEEaiIGaigCACEOIAMgDTYC/AQgAyAONgL4BCADIAYgB2ooAgA2AoAFIAQgBmooAgAhBiADIA42AowFIAMgETYCiAUgAyAGNgKEBSADIAIgB2ooAgA2ApAFIAMgAiAEaigCADYClAUgA0ECNgLQAiADQoCAgIAQNwLIAkEAIQYDQCADQegEaiADQcgCaiAGaigCAEEEdGoiAiACKQIAQiCJNwIAIAIgAigCCCICIAJBA29BAXRrQQJqNgIIIAZBBGoiBkEMRw0ACyADQQI2AtACIANCgICAgBA3AsgCQQAhAgNAIAogA0HIAmogAmooAgAiDiAQakECdCIGaiADQegEaiAOQQR0aiIOKAIANgIAIAYgB2ogDigCCDYCACAEIAZqIA4oAgw2AgAgAkEEaiICQQxHDQALIAlBAWoiCSAPRw0ACwsgCBBYIAMgBSkDKDcDyAQgAyAFKQMgNwPABCADIAUpAxg3A7gEIAMgBSkDMDcD0AQgAyAFKQM4NwPYBCADIAUpA0A3A+AEIAMgBSkDADcDoAQgAyAFKQMINwOoBCADIAUpAxA3A7AEIAMgA0GgBGpByAD8CgAAIANB6ARqIgYhBEEAIQcjAEHgAWsiAiQAIAMrAwAhFSADKwMYIRQgAysDMCEXIAMrAwghGyADKwMgIRggAysDOCEWIAMrAxAhGSADKwMoIRogAiADKwNAOQNIIAIgGjkDQCACIBk5AzggAiAWOQMwIAIgGDkDKCACIBs5AyAgAiAXOQMYIAIgFDkDECACIBU5AwggAkHQAGogAkEIaiADEJoCRAAAAAAAAAAAIRUgAisDkAEhKSACKwN4ISMgAisDcCEiIAIrA2AhJiACKwNYIRQgAisDUCEkRAAAAAAAAPA/ISBEAAAAAAAAAAAhF0QAAAAAAAAAACEbA0AgJCAioSIYIBigIhhEAAAAAAAA8D8gFCAUoiAYIBiiIhagn6MiGKJERo0yz2uQ7T8gGL1C////////////AINCgICAgICAgPj/AFQgFCAUROadPzNPUBdAoqIgFmNxIgkbIh0gHaIiFiAUIBiiRGOprqbifdg/IAkbIhggGKIiGaFEAAAAAAAA8D8gFiAZoKMiGaIiFiAiIBaiIBQgHSAYIBigoiAZoiIZoiIcoSIloiAZIBQgFqIiJyAkIBmioSIroqEiKiApoSIUIBSgIhpEAAAAAAAA8D8gIyAWoiAmIBmioSIUIBSiIBogGqIiHqCfoyIaokRGjTLPa5DtPyAavUL///////////8Ag0KAgICAgICA+P8AVCAUIBRE5p0/M09QF0CioiAeY3EiCRsiISAhoiIeIBQgGqJEY6mupuJ92D8gCRsiGiAaoiIfoUQAAAAAAADwPyAeIB+goyIfoiIeICkgHqIgFCAhIBogGqCiIB+iIh+iIiyhIi2iIB8gFCAeoiIuICogH6KhIi+ioSIoIBYgJCAWoiAcoKIgGSAnICIgGaKgoqAiJ6EiFCAUoCIcRAAAAAAAAPA/ICYgFqIgIyAZoqAiIyAeoiAWICuiIBkgJaKgIiUgH6KhIhQgFKIgHCAcoiIZoJ+jIhaiREaNMs9rkO0/IBa9Qv///////////wCDQoCAgICAgID4/wBUIBQgFETmnT8zT1AXQKKiIBljcSIJGyIiICKiIhkgFCAWokRjqa6m4n3YPyAJGyIWIBaiIhyhRAAAAAAAAPA/IBkgHKCjIhyiIhkgJyAZoiAUICIgFiAWoKIgHKIiHKIiK6EiJqIgHCAUIBmiIjAgKCAcoqEiFKKhISQgGSAUoiAcICaioCEmICUgHqIgIyAfoqAiIyAZoiAeIC+iIB8gLaKgIiUgHKKhIRQgJSAZoiAjIByioCEjICAgHaIgFSAYoqEiJSAaoiAbIB2iIBcgGKKgIi0gIaKgIi8gIqIgICAYoiAVIB2ioCIgICGiIBcgHaIgGyAYoqEiFyAaoqEiFSAWoqEhGyAVICKiIC8gFqKgIRUgJSAhoiAtIBqioSIYICKiIBcgIaIgICAaoqAiFyAWoqEhICAYIBaiIBcgIqKgIRcgHiAqIB6iICygoiAfIC4gKSAfoqCioCEiIBkgKCAZoiAroKIgHCAwICcgHKKgoqAhKSAHQQFqIgdBDEcNAAsgAiAXIBWiIhQgGyAgoiIYoSIWIBagOQPQASACIBsgFaIiFiAXICCiIhmgIhogGqA5A8gBIAIgFCAYoCIUIBSgOQPAASACIBsgF6IiFCAVICCiIhihIhogGqA5A7ABIAIgFiAZoSIWIBagOQOoASACIBQgGKAiFCAUoDkDoAEgAkQAAAAAAADwPyAbIBuiIhQgFyAXoiIXoCIbIBugoTkD2AEgAkQAAAAAAADwPyAUIBUgFaIiFaAiFCAUoKE5A7gBIAJEAAAAAAAA8D8gFyAVoCIVIBWgoTkDmAEgAkEIaiADIAJBmAFqIg4QmgIgAiACKwPIASIZIAIrA7ABIhogAisDmAEiHiACKwMIIhUgFaIgAisDECIWIBaioCACKwMYIhwgHKKgIhQgAisDICIgICCiIAIrAygiHSAdoqAgAisDMCIhICGioCIXYyIHGyIfIBcgFCAHGyIiIAIrAzgiIyAjoiACKwNAIiYgJqKgIAIrA0giKiAqoqAiKWMiCRs5A5gBIAIgAisD0AEiJCACKwO4ASIoIAIrA6ABIicgBxsiJSAJGzkDoAEgAisDwAEhGyACKwOoASEYIAIgH5ogGSAJGyIZIB6aIBogBxsiGiAUIBcgBxsgIiApIAkbYyIKGzkDsAEgAiAamiAZIAobOQPIASACICWaICQgCRsiFCAnmiAoIAcbIhcgChs5A7gBIAIgF5ogFCAKGzkD0AEgAiACKwPYASIUIBsgGCAHGyIXIAkbOQOoASACIBiaIBsgBxsiG5ogF5ogFCAJGyIUIAobOQPYASACIBQgGyAKGzkDwAEgBCAmIB0gFiAHGyIlIAkbIiIgIyAgIBUgBxsiKyAJGyIZmSAZIBmiICIgIqKgnyIURI3ttaD3xrA+EPoBoCIXICJEAAAAAAAAAAAgFESN7bWg98awPmQbIhsgGUQAAAAAAAAAAGMiDxsiFEQAAAAAAADwPyAbIBcgDxsiFyAXoiAUIBSioJ+jIhuiIhQgFyAboiIaIBqgoiIboiAZRAAAAAAAAPA/IBQgFCAUoKKhIh6ioCIfmSAqICEgHCAHGyIsIAkbIikgKaIgHyAfoqCfIhdEje21oPfGsD4Q+gGgIhggKUQAAAAAAAAAACAXRI3ttaD3xrA+ZBsiJCAfRAAAAAAAAAAAYyIPGyIXRAAAAAAAAPA/ICQgGCAPGyIYIBiiIBcgF6Kgn6MiJKIiFyAYICSiIiQgJKAiLaIiGDkDECAEIBQgGkQAAAAAAAAAwKKiIBcgF6JEAAAAAAAA4L+gIiggKKAiKKI5AwggBCAUIBSiRAAAAAAAAOC/oCInICegIicgKKI5AwAgBCAcmiAhIAcbIiGaICyaICogCRsiKiAKGyIsIBiiIBaaIB0gBxsiFpogJZogJiAJGyIdIAobIiUgG6IgFZogICAHGyIVmiArmiAjIAkbIiAgChsiKyAeoqAiLkQAAAAAAADwPyAXIBcgF6CioSIcoqA5A3ggBCAqICEgChsiISAYoiAdIBYgChsiFiAboiAgIBUgChsiFSAeoqAiHSAcoqA5A2AgBCApIBiiIB8gHKKgOQNIIAQgFiAeoiAVIBuioSIgmSAgICCiICEgHKIgHSAYoqEiIyAjoqCfIhVEje21oPfGsD4Q+gGgIhYgI0QAAAAAAAAAACAVRI3ttaD3xrA+ZBsiHSAgRAAAAAAAAAAAYyIHGyIVRAAAAAAAAPA/IB0gFiAHGyIWIBaiIBUgFaKgn6MiHaIiFSAoIBYgHaIiFkQAAAAAAAAAwKIiKqKiOQMoIAQgKCAVIBWiRAAAAAAAAOC/oCIdIB2gIiaiOQNAIAQgLCAcoiAuIBiioSIoRAAAAAAAAPA/IBUgFSAVoKKhIh2iICUgHqIgKyAboqEiJSAVIBYgFqCiIiGioTkDiAEgBCAoICGiICUgHaKgOQOAASAEICMgHaIgICAhoqE5A3AgBCAjICGiICAgHaKgOQNoIAQgKSAcoiAfIBiioSIYIB2iICIgHqIgGSAboqEiGSAhoqE5A1ggBCAYICGiIBkgHaKgOQNQIAQgFSAUIBpEAAAAAAAAEECiIBaioqIgFyAnIC2ioiAmoqE5AzAgBCAnICaiIBUgFyAUIBpEAAAAAAAAIMCiICSiIBaioqKioDkDICAEIBUgFyAnICREAAAAAAAAEECiIBaioqKiIBsgJqKgOQMYIAQgFSAqoiAURAAAAAAAABBAoiAVIBQgFqKiIBcgGiAkoqIgJqKgoqA5AzggBEGQAWogDkHIAPwKAAAgAkHgAWokACAIIAMrA7AFIAgrAzCiIhU5AzAgCCAIEKIBRBHqLYGZl3E9oiIUIBUgFCAVZBsiFUQAAAAAAADwvyAVvUL///////////8Ag0KAgICAgICA+P8AVBsiFTkDMCAIIBUgCCsDOCIUIBQgFWMbOQM4IAgoAlxBA0kNAEEAIQ4jAEEgayIKQQI2AhwgCkKAgICAEDcCFCAFIgRBGGohBwNAIApBFGogDmooAgAhAiAKQQI2AhAgCkKAgICAEDcCCEEIQRAgAkEBRhtBACACGyEQQQAhD0EAIQkDQCAEIQICQAJAAkAgCkEIaiAPaigCACINDgICAAELIAchAgwBCyAEQTBByAAgDUECRhtqIQILIAkgAiAQaisDAEQAAAAAAAAAAGFqIQkgD0EEaiIPQQxHDQALIAlBAkYEQCAOQQRqIg5BDEcNAQsLIAlBAkYEQCAIQegBaiICIAtB6AFqELkEIAhB+AFqIAtB+AFqELgEIAhBiAJqIAtBiAJqELcEIAgoAuwBIQkgAyACNgLsBCADIAU2AugEQQAhBCMAQTBrIgckACAJBEAgBiECA0AgByAEQTBsIgYgAigCBCIFKAIAaiACKAIAENsEIAUoAgAgBmogB0Ew/AoAACAEQQFqIgQgCUcNAAsLIAdBMGokAAwBCyAIKAJcQQNJDQAgCEHoAWoiAiALQegBaiIEELkEIAJBEGogBEEQahC4BCACQSBqIARBIGoQtwQgA0EANgLwBCADQgA3AugEIANBADYC0AIgA0IANwLIAiAIIANB6ARqIANByAJqQQAQzwIgAyADKQLoBDcCwAIgAiADQcACahC2BCADKALIAiICBEAgAhAiCyADKALoBCICRQ0AIAIQIgsgA0HABmokAEGoAhAjIgJB2JMCNgIAIAJCADcCBCACQRBqIAwQowEhBCAMIAI2ApwCIAwgBDYCmAIgAUEMaiAMQZgCahBOAkAgDCgCnAIiAkUNACACIAIoAgQiBEEBazYCBCAEDQAgAiACKAIAKAIIEQAAIAIQJAsgDBA6GiABQgA3AyAgAUKAgICAgICA+D83AxggAUIANwMoIAFCADcDMCABQgA3A0AgAUKAgICAgICA+D83AzggAUIANwNIIAFCADcDUCABQgA3A2AgAUKAgICAgICA+D83A1ggAUIANwNoIAFCADcDcAsgACABKAIMNgIAIAAgASgCECIANgIEIAAEQCAAIAAoAgRBAWo2AgQLIAxBsAJqJAAL9QEBBH8jAEEQayIDJAAgACgCABogAQRAIAAoAggiAiACKAIAKAIMEQQAIQIgAUEANgIMIAFBADYCBCABIAIgAkEAR2siAjYCACABIAJBC2w2AggLAkAgACgCCCICIAIoAgAoAggRBABBA0YNACADQQhqIgIgAEEIaiIEKAIAIgUgASAFKAIAKAIAEQMAIAQgAhBOIAMoAgwiAUUNACABIAEoAgQiAkEBazYCBCACDQAgASABKAIAKAIIEQAAIAEQJAsgACgCCAJAIAAoAgwiAEUNACAAKAIEQX9HDQAgACAAKAIAKAIIEQAAIAAQJAsgA0EQaiQAC7EEAQZ/IwBBIGsiAiQAIABBADYCTCAAQoCAgICAgIB4NwMoIABCgICAgICAgHg3AyAgAEKAgICAgICAeDcDGCAAQoCAgICAgID4/wA3AxAgAEKAgICAgICA+P8ANwMIIABCgICAgICAgPj/ADcDACAAQcgAahBxIABB2ABqIgMQOCAAQegAahA4IABB+ABqEDggAxDvAiAAQQA2ApwBIABBmAFqEHEgAEEANgKsASAAQagBahBxIABBADYCvAEgAEG4AWoQkwEgAkIANwIIIAJBfzYCACACQgA3AhggAkIANwIQIAIgAkEIaiIENgIEIABBfzYCyAEgAEHMAWogACgC0AEQbyAAIAIoAgQ2AswBIAAgAigCCCIFNgLQASAAIAIoAgwiBjYC1AEgAEHQAWohAyAAQcgBaiEHAkAgBkUEQCAAIAM2AswBDAELIAUgAzYCCCACQgA3AgggAiAENgIECyACQQRqAkAgAiAHRwRAIAAoAtgBIgQEQCAEECILIAAgAigCEDYC2AEgACACKAIUNgLcASAAIAIoAhg2AuABDAELIAIoAhAiBEUNACAEECILIAJBADYCGCACQgA3AhAgAigCCBBvIAAoAugBIgMEQCADECILIABBADYC8AEgAEIANwPoASAAKAL4ASIDBEAgAxAiCyAAQQA2AoACIABCADcD+AEgACgCiAIiAwRAIAMQIgsgAEEANgKQAiAAQgA3A4gCIAAgATYCRCACQSBqJAALUgEEfyAAKAIAIQECQCAAKAIEIgNFBEAMAQsgA0ECdCIEECchAiAERQ0AIAIgASAE/AoAAAsgACABBH8gARAiIAAoAgQFIAMLNgIIIAAgAjYCAAuQAQECfyMAQRBrIgMkAEEkECMiAkIANwIMIAJBhJYCNgIAIAJCADcCBCACQgA3AhQgAkIANwIcIABCADcCCCAAIAI2AgQgACACQQxqNgIAIABCADcCECABKAIAGiAAQQhqIAFBCGoQXiADQQhqIAFBEGoQfyADIAMpAgg3AwAgAEEQaiADEOcCIANBEGokACAACzcBAn8CQCAAKAIEIgFFDQAgASABKAIEIgJBAWs2AgQgAg0AIAEgASgCACgCCBEAACABECQLIAALBgAgABAiC3IBBH8gACgCBCIDIAFBAXRLIANBEEtxAkAgASADTQ0AIAAgARAlIAEgACgCBCIEayIDQQBMDQAgACgCACAEQQJ0aiEEA0AgBCACNgIAIARBBGohBCADQQFLIANBAWshAw0ACwsgACABNgIEBEAgABAtCwtgACAAIAM2AhBBACEDIABBADYCDAJAIAEEQCABQYCAgIABTw0BIAFBBHQQIyEDCyAAIAM2AgAgACADIAJBBHRqIgI2AgggACADIAFBBHRqNgIMIAAgAjYCBCAADwsQcgALVwEDfyAAKAIIIAFJBEAgAUEYbBAnIQQgACgCACECAkAgACgCBCIDRQ0AIANBGGwiA0UNACAEIAIgA/wKAAALIAIEQCACECILIAAgATYCCCAAIAQ2AgALC6QBAwF8AX4BfyAAvSICQjSIp0H/D3EiA0GyCE0EfCADQf0HTQRAIABEAAAAAAAAAACiDwsCfCAAmSIARAAAAAAAADBDoEQAAAAAAAAww6AgAKEiAUQAAAAAAADgP2QEQCAAIAGgRAAAAAAAAPC/oAwBCyAAIAGgIgAgAUQAAAAAAADgv2VFDQAaIABEAAAAAAAA8D+gCyIAmiAAIAJCAFMbBSAACwtXAQN/IAAoAgggAUkEQCABQQxsECchBCAAKAIAIQICQCAAKAIEIgNFDQAgA0EMbCIDRQ0AIAQgAiAD/AoAAAsgAgRAIAIQIgsgACABNgIIIAAgBDYCAAsLPQECfyAAKAIEIgIgACgCCCIBRwRAIAAgASACIAFrQQ9qQXBxajYCCAsgACgCACIBBEAgACgCDBogARAiCwu7CwEJfyAAIAFByAD8CgAAIABBADYCUCAAQgA3A0gCQCABKAJMIgNFDQAgASgCSCEFIANBGGwiBBAnIQIgBEUNACACIAUgBPwKAAALIAAgAzYCUCAAIAM2AkwgACACNgJIQQAhBCMAQRBrIgIkACAAQdgAaiIDQgA3AgggA0IANwIAIAEoAlghCSABKAJcIQUgAkEANgIAQQQQIyIHQQE2AgAgAiAFNgIIIAIgBTYCBCACIAc2AgwCQCAFRQ0AIAIgBUECdCIIECciBDYCACAIRQ0AIAQgCSAI/AoAAAsgAiADRwRAIAMgBzYCDCACQQA2AgwgAyAFNgIIIAMgBTYCBCADIAQ2AgAgAkEANgIIIAJCADcCAAsgAhBJIANCADcCGCADQgA3AhAgASgCaCEJIAEoAmwhBUEAIQQgAkEANgIAQQQQIyIHQQE2AgAgAiAFNgIIIAIgBTYCBCACIAc2AgwgA0EQaiEKAkAgBUUNACACIAVBAnQiCBAnIgQ2AgAgCEUNACAEIAkgCPwKAAALIAIgCkcEQCADIAc2AhwgAkEANgIMIAMgBTYCGCADIAU2AhQgAyAENgIQIAJBADYCCCACQgA3AgALIAIQSSADQgA3AiggA0IANwIgIAEoAnghCSABKAJ8IQVBACEEIAJBADYCAEEEECMiB0EBNgIAIAIgBTYCCCACIAU2AgQgAiAHNgIMIANBIGohCgJAIAVFDQAgAiAFQQJ0IggQJyIENgIAIAhFDQAgBCAJIAj8CgAACyACIApHBEAgAyAHNgIsIAJBADYCDCADIAU2AiggAyAFNgIkIAMgBDYCICACQQA2AgggAkIANwIACyACEEkgAkEQaiQAIABBADYCkAEgAEIANwOIAQJAIAEoAowBIgNFDQAgASgCiAEhBCADQQN0IgIQJyEGIAJFDQAgBiAEIAL8CgAAC0EAIQIgAEEANgKgASAAQgA3A5gBIAAgAzYCkAEgACADNgKMASAAIAY2AogBQQAhBgJAIAEoApwBIgNFDQAgASgCmAEhBSADQRhsIgQQJyEGIARFDQAgBiAFIAT8CgAACyAAQQA2ArABIABCADcDqAEgACADNgKgASAAIAM2ApwBIAAgBjYCmAECQCABKAKsASIDRQ0AIAEoAqgBIQQgA0EYbCIGECchAiAGRQ0AIAIgBCAG/AoAAAtBACEGIABBADYCwAEgAEIANwO4ASAAIAM2ArABIAAgAzYCrAEgACACNgKoAUEAIQICQCABKAK8ASIDRQ0AIAEoArgBIQUgA0EFdCIEECchAiAERQ0AIAIgBSAE/AoAAAsgACADNgLAASAAIAM2ArwBIAAgAjYCuAEgASgCyAEhAiAAQgA3A9ABIAAgAjYCyAEgACAAQdABajYCzAEgAEHMAWogASgCzAEgAUHQAWoQgwMgAEEANgLgASAAQgA3A9gBAkAgASgC3AEiA0UNACABKALYASEEIANBBHQiAhAnIQYgAkUNACAGIAQgAvwKAAALQQAhAiAAQQA2AvABIABCADcD6AEgACADNgLgASAAIAM2AtwBIAAgBjYC2AFBACEGAkAgASgC7AEiA0UNACABKALoASEFIANBMGwiBBAnIQYgBEUNACAGIAUgBPwKAAALIABBADYCgAIgAEIANwP4ASAAIAM2AvABIAAgAzYC7AEgACAGNgLoAQJAIAEoAvwBIgNFDQAgASgC+AEhBCADQQJ0IgYQJyECIAZFDQAgAiAEIAb8CgAAC0EAIQQgAEEANgKQAiAAQgA3A4gCIAAgAzYCgAIgACADNgL8ASAAIAI2AvgBIAEoAowCIgIEQCABKAKIAiIBIAJBA3QiA2ohBSADECciBCEGA0AgBiABKAIANgIAIAYgASgCBDYCBCAGQQhqIQYgAUEIaiIBIAVHDQALCyAAIAI2ApACIAAgAjYCjAIgACAENgKIAiAAC40CAQR/IwBBEGsiAiQAIAAoAgwoAgBBAk4EQCAAKAIAIQQgACgCBCEBIAJBADYCAEEEECMiA0EBNgIAIAIgATYCCCACIAE2AgQgAiADNgIMAkAgAUUNACACIAFBAnQiARAnIgM2AgAgAUUNACADIAQgAfwKAAALIAAgAkcEQAJAIAAoAgwiAUUNACABIAEoAgAiAUEBazYCACABQQFKDQAgACgCDCIBBEAgARAiCyAAQQA2AgwgACgCACIBRQ0AIAEQIgsgACACKAIMNgIMIAJBADYCDCAAIAIoAgA2AgAgACACKAIENgIEIAAgAigCCDYCCCACQQA2AgggAkIANwIACyACEEkLIAJBEGokAAtXAQN/IAAoAgggAUkEQCABQQR0ECchBCAAKAIAIQICQCAAKAIEIgNFDQAgA0EEdCIDRQ0AIAQgAiAD/AoAAAsgAgRAIAIQIgsgACABNgIIIAAgBDYCAAsLogIBAX8gACgCiAIiAQRAIAEQIgsgAEEANgKQAiAAQgA3A4gCIAAoAvgBIgEEQCABECILIABBADYCgAIgAEIANwP4ASAAKALoASIBBEAgARAiCyAAKALYASIBBEAgARAiCyAAQQA2AuABIABCADcD2AEgAEHMAWogACgC0AEQbyAAKAK4ASIBBEAgARAiCyAAQQA2AsABIABCADcDuAEgACgCqAEiAQRAIAEQIgsgAEEANgKwASAAQgA3A6gBIAAoApgBIgEEQCABECILIABBADYCoAEgAEIANwOYASAAKAKIASIBBEAgARAiCyAAQQA2ApABIABCADcDiAEgAEH4AGoQSSAAQegAahBJIABB2ABqEEkgACgCSCIBBEAgARAiCyAAC7kCACAAQgA3A0AgAEKAgICAgICA+L9/NwM4IABCgICAgICAgPi/fzcDMCAAQoCAgICAgIB4NwMoIABCgICAgICAgHg3AyAgAEKAgICAgICAeDcDGCAAQoCAgICAgID4/wA3AxAgAEKAgICAgICA+P8ANwMIIABCgICAgICAgPj/ADcDACAAQgA3A0ggAEEANgJQIABB2ABqEKECGiAAQgA3A9ABIABBfzYCyAEgAEEANgLAASAAQgA3A7gBIABBADYCsAEgAEIANwOoASAAQQA2AqABIABCADcDmAEgAEEANgKQASAAQgA3A4gBIABBADYCkAIgAEIANwOIAiAAQQA2AoACIABCADcD+AEgAEEANgLwASAAQgA3A+gBIABBADYC4AEgAEIANwPYASAAIABB0AFqNgLMASAAC1UBAn8gAEEANgIIIABCADcCACABKAIEIgIgASgCACIDRwRAIAAgAiADayIBQQR1EI8DIAAoAgQhAiABBEAgAiADIAH8CgAACyAAIAEgAmo2AgQLIAALoAIBBX8jAEEgayIFJAACQAJAIAAoAgQiAiAAKAIIIgNJBEAgAiABKAIANgIAIAJBBGohAQwBCyACIAAoAgAiBGtBAnUiBkEBaiICQYCAgIAETw0BIAVBDGpB/////wMgAyAEayIDQQF1IgQgAiACIARJGyADQfz///8HTxsgBiAAEEoiAigCCCIDIAEoAgA2AgAgAiADQQRqNgIIIAIoAgQgACgCBCAAKAIAIgNrIgFrIQQgAQRAIAQgAyAB/AoAAAsgACgCACEDIAAgBDYCACACIAM2AgQgACACKAIIIgE2AgQgAiADNgIIIAAoAgghBCAAIAIoAgw2AgggAiADNgIAIAIgBDYCDCACEFMLIAAgATYCBCAFQSBqJAAPCxAmAAvQAQIBfAF/IwBBEGsiAiQARAAAAAAAAPh/IQECQCAAvUL///////////8Ag0L/////////9/8AVg0ARAAAAAAAAAAAIQEgAEQAAAAAAAAAAGMEQCAAmhA+miEBDAELIACZRAAAAAAAgFZAIAJBDGoQpQNEGC1EVPshCUCiRAAAAAAAgGZAoyEAAkACQAJAAkAgAigCDEEEbw4EAAECAwQLIAAQqAEhAQwDCyAAEJcBIQEMAgsgABCoAZohAQwBCyAAEJcBmiEBCyACQRBqJAAgAQspACAAIAEoAgQgAhASIgEQGzYCBCAAQZygAjYCACABQQlPBEAgARABCwujAQEBf0EkECMiAkIANwIMIAJBhJYCNgIAIAJCADcCBCACQgA3AhQgAkIANwIcIABCADcDGCAAQoCAgICAgID4PzcDECAAQgA3AwggACACNgIEIAAgAkEMajYCACAAQgA3AyAgAEIANwMwIABCgICAgICAgPg/NwMoIABCADcDOCABKAIAGiAAQQhqIAFBCGoQXiAAQRBqIAFBEGpBMPwKAAAgAAsOACAAQQhqEC8aIAAQLwsCAAtyAQF/QSQQIyICQgA3AgwgAkGElgI2AgAgAkIANwIEIAJCADcCFCACQgA3AhwgACACNgIEIAAgAkEMajYCACAAIAEoAgA2AgggACABKAIEIgI2AgwgAgRAIAIgAigCBEEBajYCBAsgAEIANwIQIAEQLxoLVwEDfyAAKAIIIAFJBEAgAUEDdBAnIQQgACgCACECAkAgACgCBCIDRQ0AIANBA3QiA0UNACAEIAIgA/wKAAALIAIEQCACECILIAAgATYCCCAAIAQ2AgALCy0BAX8gACgCACIBBEAgACABNgIEIAAoAggaIAEQIiAAQQA2AgggAEIANwIACwuLAQEDfyMAQRBrIgMkAEGoAhAjIgJBoJACNgIAIAJCADcCBCACQRBqEDshBCACIAE2AlQgAyACNgIMIAMgBDYCCCACIAIoAgRBAWo2AgQgAyADKQIINwMAIAAgAxBIGiACIAIoAgQiAEEBazYCBCAARQRAIAIgAigCACgCCBEAACACECQLIANBEGokAAs+ACADBEAgACADEKMCIAAoAgQhAyABIAJHBEADQCADIAEQPEEMaiEDIAFBDGoiASACRw0ACwsgACADNgIECwt5AQJ/IwBBEGsiAyQAQSQQIyICQgA3AgwgAkGElgI2AgAgAkIANwIEIAJCADcCFCACQgA3AhwgACACNgIEIAAgAkEMajYCACADQQRqIAEQWSAAIAMoAgQ2AgggACADKAIINgIMIABCADcCECABEC8aIANBEGokACAAC1gBAX8CQCAAKAIMIgFFDQAgASABKAIAIgFBAWs2AgAgAUEBSg0AIAAoAgwiAQRAIAEQIgsgAEEANgIMIAAoAgAiAQRAIAEQIgsgAEEANgIIIABCADcCAAsLYAAgACADNgIQQQAhAyAAQQA2AgwCQCABBEAgAUGAgICABE8NASABQQJ0ECMhAwsgACADNgIAIAAgAyACQQJ0aiICNgIIIAAgAyABQQJ0ajYCDCAAIAI2AgQgAA8LEHIAC2AAIAAgAzYCEEEAIQMgAEEANgIMAkAgAQRAIAFBgICAgAJPDQEgAUEDdBAjIQMLIAAgAzYCACAAIAMgAkEDdGoiAjYCCCAAIAMgAUEDdGo2AgwgACACNgIEIAAPCxByAAu3AgEFfyMAQSBrIgUkAAJAAkAgACgCBCICIAAoAggiA0kEQCACIAEpAwg3AwggAiABKQMANwMAIAJBEGohAQwBCyACIAAoAgAiBGtBBHUiBkEBaiICQYCAgIABTw0BIAVBDGpB/////wAgAyAEayIDQQN1IgQgAiACIARJGyADQfD///8HTxsgBiAAEDIiAigCCCIDIAEpAwg3AwggAyABKQMANwMAIAIgAigCCEEQajYCCCACKAIEIAAoAgQgACgCACIDayIBayEEIAEEQCAEIAMgAfwKAAALIAAoAgAhAyAAIAQ2AgAgAiADNgIEIAAgAigCCCIBNgIEIAIgAzYCCCAAKAIIIQQgACACKAIMNgIIIAIgAzYCACACIAQ2AgwgAhA2CyAAIAE2AgQgBUEgaiQADwsQJgALsgYCC38KfCMAQTBrIgMkACABKAIAGgJAIAErAxggASsDECINIA1EAAAAAAAA8D9hIgIbIg1EAAAAAAAAAABEAAAAAAAA8D8gAhsiDmINACABKwMoIAErAyAiDSANRAAAAAAAAAAAYSICGyINRAAAAAAAAPA/RAAAAAAAAAAAIAIbIg5iDQBEAAAAAAAAAAAhDiABKwM4IAErAzAiDSANRAAAAAAAAAAAYRshDQsgDSAOYgRAIAEoAgghAiADQQA2AgggA0IANwIAIAMgAigCACIEIAIoAgQiAiACIARrQQxtEEcgASsDOCERIAErAzAhEiABKwMoIQ0gASsDECEOIAErAyAhDyABKwMYIRAgA0EANgIUIANCADcCDCADQQxqIAMoAgQgAygCAGtBDG0QViADKAIAIgQgAygCBCIJRwRAIBAgD6IhEyAOIA2iIRQDQCADQSRqIAQQPCEFIANBGGogAygCKCICIAUoAgAiBmtBBHUiCBCSAyEHIAIgBkcEQCAHKAIAIQYgBSgCACEKQQAhAgNAIAYgCCACQX9zaiACIBMgFGQbQQR0aiILIBEgECAKIAJBBHRqIgwrAwAiFaIgDSAMKwMIIhaioKA5AwggCyASIA4gFaIgDyAWoqCgOQMAIAJBAWoiAiAIRw0ACwsgA0EMaiAHEHYgBygCACICBEAgAyACNgIcIAMoAiAaIAIQIgsgBSgCACICBEAgAyACNgIoIAMoAiwaIAIQIgsgBEEMaiIEIAlHDQALC0EYECMiAkG0mgI2AgAgAkIANwIEIAJBDGoiBCADQQxqEFsgAyACNgIoIAMgBDYCJCABQQhqIANBJGoQTgJAIAMoAigiAkUNACACIAIoAgQiBEEBazYCBCAEDQAgAiACKAIAKAIIEQAAIAIQJAsgAyADQQxqNgIYIANBGGoiAhApIAMgAzYCGCACECkgAUKAgICAgICA+D83AxAgAUIANwMgIAFCADcDGCABQoCAgICAgID4PzcDKCABQgA3AzggAUIANwMwCyAAIAEoAgg2AgAgACABKAIMIgA2AgQgAARAIAAgACgCBEEBajYCBAsgA0EwaiQAC0wBAX4gASkCACECIAFCADcCACAAKAIEIQEgACACNwIAAkAgAUUNACABIAEoAgQiAEEBazYCBCAADQAgASABKAIAKAIIEQAAIAEQJAsLjAECAn4CfyAAKAIAIAFBA3RqKAIAIAFHBEADQCAAKAIAIgQgBCABQQN0IgVqKQMAIgOnQQN0aikDACICpyEBIAJC/////w+DIANCgICAgHCDhCICIANSBEAgACgCACAFaiIEIAIgBCkDACICIAIgA1EbNwMACyABIAAoAgAgAUEDdGooAgBHDQALCyABCzMBAn9BASAAIABBAU0bIQADQAJAIAAQJyIBDQBBoKsCKAIAIgJFDQAgAhEMAAwBCwsgAQsPACAAIAAoAgAoAgQRAAALBAAgAAs9AQJ/IAAoAgQiAiAAKAIIIgFHBEAgACABIAIgAWtBA2pBfHFqNgIICyAAKAIAIgEEQCAAKAIMGiABECILC9AUAgx/BnwjAEHgAGsiCSQAAkAgACgCXEUEQCAAKALoASIBBEAgARAiCyAAQQA2AvABIABCADcD6AEgACgC+AEiAQRAIAEQIgsgAEEANgKAAiAAQgA3A/gBIAAoAogCIgEEQCABECILIABBADYCkAIgAEIANwOIAgwBCyAAQdgAahA4IABB6ABqEDggAEH4AGoQOCMAQcABayIEJAAgACgCTCEDIARBADYCtAEgBEIANwKsASAEQawBaiADECUgBCADNgKwAQJAAkACQAJAIAEEQCADRQ0CIAEtABBBAXENAgNAIAZBAWoiBkGACEYEQEEAIQYgAS0AEA0ECyAAKAJIIAJBGGxqIgUrAwAiDiAOYgR/QX8FIAQgBSkDEDcDkAEgBCAFKQMINwOIASAEIAUpAwA3A4ABIARB0ABqIgUgAEEw/AoAACAEQYABaiAFEIUCCyEFIAQoAqwBIAJBAnRqIAU2AgAgAkEBaiICIANHDQALDAELIANFDQIDQCAAKAJIIAJBGGxqIgUrAwAiDiAOYgR/QX8FIAQgBSkDEDcDSCAEIAUpAwg3A0AgBCAFKQMANwM4IARBCGoiBSAAQTD8CgAAIARBOGogBRCFAgshBSAEKAKsASACQQJ0aiAFNgIAIAJBAWoiAiADRw0ACwsgAUUNAQsgAS0AEA0BC0EAIQIgBEEANgKkASAEQgA3ApwBIARBnAFqIAMQJSAEIAM2AqABIAQoApwBIgogA0ECdGohCAJAAkAgAwRAA0AgCiACQQJ0aiACNgIAIAJBAWoiAiADRw0ACyAEIARBrAFqNgK8ASADQYEBSA0BIAMhAgNAIAJBAnQQUCIFRQRAIAJBAXYiAg0BDAMLCyAKIAggBEG8AWogAyAFIAIQugEgBRAiDAILIAQgBEGsAWo2ArwBCyAKIAggBEG8AWogA0EAQQAQugELIAAgBEGcAWogAyABEOEDAkAgAQRAIAEtABANAQsgBCgCnAEiCiECIAQoAqABIgYEQCAEKAKsASEIA0AgAiACIAZBAXYiC0ECdGoiAkEEaiAIIAIoAgBBAnRqKAIAQX9GIgUbIQIgCyAGIAtBf3NqIAUbIgYNAAsLIARBnAFqIgUgAiAKa0ECdUEAEDEgAEHIAGogBRClASAAKAKcASADRw0AIABBmAFqIAUQpQELIAQoApwBIgNFDQAgAxAiCyAEKAKsASIDBEAgAxAiCyAEQcABaiQAIAEEQCABLQAQDQELIAlBADYCWCAJQgA3AlAgCUEANgJIIAlCADcCQCAAIAlB0ABqIgIgCUFAayIDIAEQzwICQAJAIAFFBEAgACACIANBABDjAwwBCyABLQAQDQEgACAJQdAAaiAJQUBrIAEQ4wMgAS0AEA0BCyAAKAJcRQRAIAAoAugBIgEEQCABECILIABBADYC8AEgAEIANwPoASAAKAL4ASIBBEAgARAiCyAAQQA2AoACIABCADcD+AEgACgCiAIiAQRAIAEQIgsgAEEANgKQAiAAQgA3A4gCDAELIAkgCSkCUDcCCCAJIAkpAkA3AgACQCAJQRBqIAlBCGogCRDiAyICIABB6AFqRwRAIAAoAugBIgMEQCADECILIAAgAigCADYC6AEgACACKAIENgLsASAAIAIoAgg2AvABIAJBADYCCCACQgA3AgAgACgC+AEiAwRAIAMQIgsgACACKAIQNgL4ASAAIAIoAhQ2AvwBIAAgAigCGDYCgAIgAkEANgIYIAJCADcCECAAKAKIAiIDBEAgAxAiCyAAIAIoAiA2AogCIAAgAigCJDYCjAIgACACKAIoNgKQAgwBCyACKAIgIgNFDQAgAxAiCyACQQA2AiggAkIANwIgIAIoAhAiAwRAIAMQIgsgAkEANgIYIAJCADcCECACKAIAIgMEQCADECILAnwgACgC7AFFBEBEAAAAAAAA8P8hD0QAAAAAAADw/yEQRAAAAAAAAPD/IRFEAAAAAAAA8H8hEkQAAAAAAADwfyETRAAAAAAAAPB/DAELIAAoAugBIgMrA1ghDyADKwNQIRAgAysDSCERIAMrAzghEiADKwMwIRMgAysDQAshDiAAIA85AyggACAQOQMgIAAgETkDGCAAIA45AxAgACASOQMIIAAgEzkDAEEAIQJBACEGIwBBIGsiByQAAkAgACgCQCIMRQ0AIAAoAowBIQsgB0EANgIYIAdCADcCECAHQRBqIAsgDG4iBEEAEDEgACgCXCEDAkACQCABBEACQCADRQ0AIAEtABBBAXENAANAIAZBAWoiBkGACEYEQEEAIQYgAS0AEA0CCyAHKAIQIAAoAnggAkECdGooAgBBAnRqQQE2AgAgAkEBaiICIANHDQALCyABLQAQRQ0BDAILIANFDQADQCAHKAIQIAAoAnggAkECdGooAgBBAnRqQQE2AgAgAkEBaiICIANHDQALCyAHQQA2AgggB0IANwIAIAcgBEEBakEAEDEgBygCACEKAkAgBygCFCIDRQ0AIAogBygCECIIKAIAIgU2AgQgA0EBRg0AIAggA0ECdGohAyAKQQRqIQIgCEEEaiEGA0AgAiAGKAIAIAVqIgU2AgQgAkEEaiECIAZBBGoiBiADRw0ACwsgAEGIAWohCAJAIAAoAowBIgVFDQAgCCgCACEDIAVBA3QiAhAnIQ0gAkUNACANIAMgAvwKAAALIAggCiAEQQJ0aigCACAMbCIDEEQgACADNgKMASAFQRFJIAUgA0EBdE1yRQRAIAgQlAELAkACQAJAAkAgAQRAIAsgDEkNAiABLQAQQQFxDQIgDEEDdCELIAgoAgAhCkEAIQYgBygCACEIIAcoAhAhBUEAIQIDQCAGQQFqIgZBgAhGBEBBACEGIAEtABANBAsCQCAMQQBMDQAgBSACQQJ0IgNqKAIARSALRXINACAKIAMgCGooAgAgDGxBA3RqIA0gAiALbGogC/wKAAALIAJBAWoiAiAERw0ACwwBCyALIAxJDQIgDEEDdCEGIAgoAgAhC0EAIQIgBygCACEKIAcoAhAhCCAMQQBMIQUDQAJAIAUNACAIIAJBAnQiA2ooAgBFIAZFcg0AIAsgAyAKaigCACAMbEEDdGogDSACIAZsaiAG/AoAAAsgAkEBaiICIARHDQALCyABRQ0BCyABLQAQDQEgACgCXCIKRQ0BIAEtABBBAXENASAAKAJ4IQhBACECIAcoAgAhBUEAIQADQCACQQFqIgJBgAhGBEBBACECIAEtABANAwsgCCAAQQJ0aiIDIAUgAygCAEECdGooAgA2AgAgAEEBaiIAIApHDQALDAELIAAoAlwiBUUNACAAKAJ4IQJBACEAIAcoAgAhAwNAIAIgAEECdGoiASADIAEoAgBBAnRqKAIANgIAIABBAWoiACAFRw0ACwsgDQRAIA0QIgsgBygCACIARQ0AIAAQIgsgBygCECIARQ0AIAAQIgsgB0EgaiQACyAJKAJAIgAEQCAAECILIAkoAlAiAEUNACAAECILIAlB4ABqJAALVwEDfyAAKAIIIAFJBEAgAUEFdBAnIQQgACgCACECAkAgACgCBCIDRQ0AIANBBXQiA0UNACAEIAIgA/wKAAALIAIEQCACECILIAAgATYCCCAAIAQ2AgALC8gBAQR/IwBBIGsiBCQAAkAgACgCCCAAKAIAIgJrQQxtIAFJBEAgAUHWqtWqAU8NASAEQQxqIAEgACgCBCACa0EMbSAAEGEiASgCBCAAKAIEIAAoAgAiBWsiAkF0bUEMbGohAyACBEAgAyAFIAL8CgAACyAAKAIAIQIgACADNgIAIAEgAjYCBCAAIAEoAgg2AgQgASACNgIIIAAoAgghAyAAIAEoAgw2AgggASACNgIAIAEgAzYCDCABENUBCyAEQSBqJAAPCxAmAAtTAQF/IAEoAhAiAkUEQCAAQQA2AhAgAA8LIAEgAkYEQCAAIAA2AhAgASgCECIBIAAgASgCACgCDBEBACAADwsgACACIAIoAgAoAggRBAA2AhAgAAuABQIGfAN/AkAgACgCTCIIBEAgACgCSCIHIAhBGGxqIQlEAAAAAAAA8H8hAkQAAAAAAADwfyEDIAchCEQAAAAAAADwfyEBA0AgCCsDECEFIAgrAwghBiAIKwMAIQQCQCABIAFiBEAgBSECIAYhAyAEIQEMAQsgBCAEYg0AIAIgBSACIAVjGyECIAMgBiADIAZjGyEDIAEgBCABIARjGyEBCyAIQRhqIgggCUcNAAsgACACOQMQIAAgAzkDCCAAIAE5AwBEAAAAAAAA8P8hAkQAAAAAAADw/yEDRAAAAAAAAPD/IQEDQCAHKwMQIQUgBysDCCEGIAcrAwAhBAJAIAEgAWIEQCAFIQIgBiEDIAQhAQwBCyAEIARiDQAgBSACIAIgBWMbIQIgBiADIAMgBmMbIQMgBCABIAEgBGMbIQELIAdBGGoiByAJRw0ACwwBCyAAQoCAgICAgID4/wA3AxAgAEKAgICAgICA+P8ANwMIIABCgICAgICAgPj/ADcDAEQAAAAAAADw/yECRAAAAAAAAPD/IQNEAAAAAAAA8P8hAQsgACACOQMoIAAgAzkDICAAIAE5AxhBACEHAkAgACkDAEL///////////8Ag0L/////////9/8AVg0AIAApAwhC////////////AINCgICAgICAgPj/AFoNACAAKQMQQv///////////wCDQoCAgICAgID4/wBaDQAgACkDGEL///////////8Ag0KAgICAgICA+P8AVCAAKQMgQv///////////wCDQoCAgICAgID4/wBUcSAAKQMoQv///////////wCDQoCAgICAgID4/wBUcSEHCyAHRQRAIABBABAsCwuDAQECf0GgARAjIQMjAEEQayICJAAgA0IANwIEIANBgJQCNgIAIAIgASgCADYCCCACIAEoAgQiATYCDCABBEAgASABKAIEQQFqNgIECyACIAIpAgg3AwAgA0EQaiIBIAIQ/gIgAkEQaiQAIAAgAzYCBCAAIAE2AgAgACADQRRqIAEQjwELwAoCC38GfCMAQUBqIgMkACAAKAJcIQQgA0IANwM4IANCADcDMCADQgA3AyggA0IANwMAIANCADcDCCADQgA3AxAgAEGoAWogBEEDbiIGIAMQZwJAAkACQCAEQQJNBEAgBkEEdCEBDAELIAZBBHQQJyEIA0AgAkEEdCILIAAoAtgBakF/NgIMAkAgACgCWCACQQxsaiIFKAIAIglBAEgEQEQAAAAAAAAAACEMDAELIAAoAqgBIAJBGGxqIgEgACgCSCIHIAUoAgRBGGxqIgorAwAgByAJQRhsaiIJKwMAIgyhIg4gByAFKAIIQRhsaiIFKwMIIAkrAwgiDaEiD6IgCisDCCANoSINIAUrAwAgDKEiEKKhIgwgDCAMoiANIAUrAxAgCSsDECIMoSIRoiAKKwMQIAyhIgwgD6KhIg0gDaIgDCAQoiAOIBGioSIOIA6ioKAiDJ8iD6M5AxAgASAOIA+jOQMIIAEgDSAPoyINOQMAIA0gDWENACABQgA3AwggAUIANwMAIAFCgICAgICAgPg/NwMQCyAIIAtqIgEgAjYCCCABIAw5AwAgAkEBaiICIAZHDQALIAggBkEEdGohASAEQYMDSQ0AIAYhAgNAIAJBBHQQUCIFDQIgAkEBdiICDQALCyAIIAEgBkEAQQAQxQEMAQsgCCABIAYgBSACEMUBIAUQIgsgA0EANgIgIANCADcCGCAEQQNPBEAgCCAGQQR0aiEKIAghBgNAAkAgACgC2AEgBigCCCIFQQR0aiICKAIMQQBODQAgAiAFNgIMIAAoAlggBUEDbCICQQJ0aigCACIEQQBIDQAgACgCqAEgBUEYbGoiASsDECEMIAErAwghDSABKwMAIQ4gACgCSCAEQRhsaiIBKwMQIQ8gASsDCCEQIAErAwAhESADQRhqQQNBABAxIAMoAhgiASACQQJqNgIIIAEgAkEBajYCBCABIAI2AgAgAygCHCICRQ0AA0AgACgCaCADKAIYIAJBAnRqQQRrKAIAQQJ0aigCACEBIANBGGoiByACQQFrIgQQJSADIAQ2AhwgAkERSSACIARBAXRNckUEQCAHEC0LAkAgACgC2AEgAUF+QQEgAUEDb0ECRhtqIgRBA20iAUEEdGoiCSgCDEEATgRAIAMoAhwhAgwBCyADKAIcIQIgACsDOCAOIAAoAkggACgCWEF+QQEgBCABQQNsa0ECRhsiC0ECdGogBEECdGooAgBBGGxqIgcrAwAgEaGiRAAAAAAAAAAAoCANIAcrAwggEKGioCAMIAcrAxAgD6GioJlkRQ0AIAkgBTYCDCAAKAKoASABQRhsaiIBIAw5AxAgASANOQMIIAEgDjkDAAJAAkAgAgRAIAQgACgCaCADKAIYIAJBAnRqQQRrKAIAQQJ0aigCAEYNAQsCQCADKAIgIgEgAk0EQCADQRhqIAFBAXRBgAEgARsQJSADKAIYIAMoAhwiAkECdGogBDYCAAwBCyADKAIYIAJBAnRqIAQ2AgALIAMgAkEBaiIBNgIcDAELIANBGGoiByACQQFrIgEQJSADIAE2AhwgAkERSSACIAFBAXRNcg0AIAcQLSADKAIcIQELIAQgC2ohAgJAIAMoAiAiBCABTQRAIANBGGogBEEBdEGAASAEGxAlIAMoAhggAygCHCIBQQJ0aiACNgIADAELIAMoAhggAUECdGogAjYCAAsgAyABQQFqIgI2AhwLIAINAAsLIAZBEGoiBiAKRw0ACwsgABCUAiADKAIYIgAEQCAAECILIAgEQCAIECILIANBQGskAAtyAQJ/IwBBEGsiAiQAIAJBADYCCCACQgA3AgAgAiABKAIAIgMgASgCBCIBIAEgA2tBDG0QRyAAQQA2AgggAEIANwIAIAAgAigCACIAIAIoAgQiASABIABrQQxtEEcgAiACNgIMIAJBDGoQKSACQRBqJAALwQEBBH8jAEEgayIEJAACQCAAKAIIIAAoAgAiAmtBBHUgAUkEQCABQYCAgIABTw0BIARBDGogASAAKAIEIAJrQQR1IAAQMiIBKAIEIAAoAgQgACgCACIFayICayEDIAIEQCADIAUgAvwKAAALIAAoAgAhAiAAIAM2AgAgASACNgIEIAAgASgCCDYCBCABIAI2AgggACgCCCEDIAAgASgCDDYCCCABIAI2AgAgASADNgIMIAEQNgsgBEEgaiQADwsQJgALwgUDAnwBfgF/IAC9IgNCIIinQf////8HcSIEQYCAwP8DTwRAIAOnIARBgIDA/wNrckUEQEQAAAAAAAAAAEQYLURU+yEJQCADQgBZGw8LRAAAAAAAAAAAIAAgAKGjDwsCfCAEQf////4DTQRARBgtRFT7Ifk/IARBgYCA4wNJDQEaRAdcFDMmppE8IAAgACAAoiIBIAEgASABIAEgAUQJ9/0N4T0CP6JEiLIBdeDvST+gokQ7j2i1KIKkv6CiRFVEiA5Vwck/oKJEfW/rAxLW1L+gokRVVVVVVVXFP6CiIAEgASABIAFEgpIuscW4sz+iRFkBjRtsBua/oKJEyIpZnOUqAECgokRLLYocJzoDwKCiRAAAAAAAAPA/oKOioSAAoUQYLURU+yH5P6APCyADQgBTBEBEGC1EVPsh+T8gAEQAAAAAAADwP6BEAAAAAAAA4D+iIgCfIgEgASAAIAAgACAAIAAgAEQJ9/0N4T0CP6JEiLIBdeDvST+gokQ7j2i1KIKkv6CiRFVEiA5Vwck/oKJEfW/rAxLW1L+gokRVVVVVVVXFP6CiIAAgACAAIABEgpIuscW4sz+iRFkBjRtsBua/oKJEyIpZnOUqAECgokRLLYocJzoDwKCiRAAAAAAAAPA/oKOiRAdcFDMmppG8oKChIgAgAKAPC0QAAAAAAADwPyAAoUQAAAAAAADgP6IiACAAnyICvUKAgICAcIO/IgEgAaKhIAIgAaCjIAIgACAAIAAgACAAIABECff9DeE9Aj+iRIiyAXXg70k/oKJEO49otSiCpL+gokRVRIgOVcHJP6CiRH1v6wMS1tS/oKJEVVVVVVVVxT+goiAAIAAgACAARIKSLrHFuLM/okRZAY0bbAbmv6CiRMiKWZzlKgBAoKJESy2KHCc6A8CgokQAAAAAAADwP6CjoqAgAaAiACAAoAsLYwEBfyABKAIAIQIgASgCBCIBBEAgASABKAIEQQFqNgIECyAAIAI2AgAgACgCBCECIAAgATYCBAJAIAJFDQAgAiACKAIEIgBBAWs2AgQgAA0AIAIgAigCACgCCBEAACACECQLC4kCAgV/A34gACABEE8iAyAAIAIQTyICRwRAA0ACQAJ/IAAoAgAiASADQQN0aigCBEH/////B3EiBCABIAJBA3RqKAIEQf////8HcSIFTSAEIAVHIAIgA01ycUUEQCACIQEgAyECIAUhAyAEDAELIAMhASAEIQMgBQshBiAAKAIAIAFBA3RqIgcgA61CIIYiCSACrSIKhCAHKQMAIgggCCAJIAGthCIJURs3AwAgCCAJUQRAIAQgBUcNASAAKAIAIAJBA3RqIgMgBkEBaq1CIIYgCoQgAykDACIIIAggBq1CIIYgCoRRIgMbNwMAIAMgBnINAQsgACABEE8iAyAAIAIQTyICRw0BCwsLC1UBAn8gAEEANgIIIABCADcCACABKAIEIgIgASgCACIDRwRAIAAgAiADayIBQQJ1EPEBIAAoAgQhAiABBEAgAiADIAH8CgAACyAAIAEgAmo2AgQLIAALYAAgACADNgIQQQAhAyAAQQA2AgwCQCABBEAgAUHWqtWqAU8NASABQQxsECMhAwsgACADNgIAIAAgAyACQQxsaiICNgIIIAAgAyABQQxsajYCDCAAIAI2AgQgAA8LEHIAC5cDAQR/IwBBQGoiAiQAIAAgACgCACIDQQhrKAIAIgVqIQQCQCADQQRrKAIAIgMoAgQgASgCBEYEQEEAIAQgBRshAAwBCyAAIAROBEAgAkIANwIUIAJBADYCECACIAE2AgwgAiAANgIIIAIgAzYCBCACQgA3AhwgAkIANwIkIAJCADcCLCACQQA2AjwgAkKBgICAgICAgAE3AjQgAyACQQRqIAQgBEEBQQAgAygCACgCFBEIACACKAIcDQELIAJCADcCFCACQQA2AhAgAkHk5gE2AgwgAiAANgIIIAIgATYCBCACQgA3AhwgAkIANwIkIAJCADcCLCACQgA3ADMgAkEANgI8IAJBAToAOyADIAJBBGogBEEBQQAgAygCACgCGBEHAEEAIQACQAJAIAIoAigOAgABAgsgAigCGEEAIAIoAiRBAUYbQQAgAigCIEEBRhtBACACKAIsQQFGGyEADAELIAIoAhxBAUcEQCACKAIsDQEgAigCIEEBRw0BIAIoAiRBAUcNAQsgAigCFCEACyACQUBrJAAgAAu1AQIEfwJ+IAEpAwghBiABKQMAIQcgACgCPCIEKAIQIgIoAhAhAwJAIAAgBCgCCEciBUUEQCAHIAIpAwBSDQEgBiACKQMIUg0BIAIPCyAHIAMpAwBSDQAgBiADKQMIUg0AIAMPC0EgECMiACABKQMINwMIIAAgASkDADcDACAAQQA2AhwgACAENgIYIAMgADYCFCAAIAM2AhAgACACNgIUIAIgADYCECAFRQRAIAQgADYCEAsgAAtgACAAIAM2AhBBACEDIABBADYCDAJAIAEEQCABQavVqtUATw0BIAFBGGwQIyEDCyAAIAM2AgAgACADIAJBGGxqIgI2AgggACADIAFBGGxqNgIMIAAgAjYCBCAADwsQcgALVgEFfyAAKAIAIgIoAgAiAQRAIAEhAyACIQQgAigCBCIFIAFHBEADQCABIAVBCGsQLyIFRw0ACyAAKAIAIgQoAgAhAwsgAiABNgIEIAQoAggaIAMQIgsLHQEBf0EEEHQiAEGQ4gE2AgAgAEGc4gFBqwMQCwALkwEBBH8gACgCBCIDIAFBAXRLIANBEEtxAkAgASADTQ0AIAAgARAzIAEgACgCBCIDa0EYbCIEQQBMDQAgBEEYbiEEIAAoAgAgA0EYbGohAwNAIAMgAikDEDcDECADIAIpAwg3AwggAyACKQMANwMAIANBGGohAyAEQQFLIARBAWshBA0ACwsgACABNgIEBEAgABBxCwuKAwEFfyMAQSBrIgUkAAJAAkAgACgCBCICIAAoAggiA0kEQCACQQA2AgggAkIANwIAIAIgASgCADYCACACIAEoAgQ2AgQgAiABKAIINgIIIAFBADYCCCABQgA3AgAgAkEMaiEBDAELIAIgACgCACIEa0EMbSIGQQFqIgJB1qrVqgFPDQEgBUEMakHVqtWqASADIARrQQxtIgNBAXQiBCACIAIgBEkbIANBqtWq1QBPGyAGIAAQYSICKAIIIgNBADYCCCADQgA3AgAgAyABKAIANgIAIAMgASgCBDYCBCADIAEoAgg2AgggAUEANgIIIAFCADcCACACIANBDGo2AgggAigCBCAAKAIEIAAoAgAiA2siAUF0bUEMbGohBCABBEAgBCADIAH8CgAACyAAKAIAIQMgACAENgIAIAIgAzYCBCAAIAIoAggiATYCBCACIAM2AgggACgCCCEEIAAgAigCDDYCCCACIAM2AgAgAiAENgIMIAIQ1QELIAAgATYCBCAFQSBqJAAPCxAmAAvcAgEEfyMAQRBrIgMkACAAQZCcAjYCACAAEN4BIABBJGogACgCJBC9AyAAIAAoAjQiASAAKAI4IgJHBH8DQCABKAIAIgQEQCAEECILIAFBBGoiASACRw0ACyAAKAI0BSABCzYCOCAAQQA6AHwgAEEAOgAYIAAgACgCJDYCMCAAKAKAASIBBEAgACABNgKEASAAKAKIARogARAiCyAAKAJoIgEEQCAAIAE2AmwgACgCcBogARAiCyAAKAJcIgEEQCAAIAE2AmAgACgCZBogARAiCyAAKAJQIgEEQCAAIAE2AlQgACgCWBogARAiCyAAKAJAIgEEQCAAIAE2AkQgACgCSBogARAiCyAAKAI0IgEEQCAAIAE2AjggACgCPBogARAiCyADIABBJGo2AgwgAygCDCIBKAIAIgIEQCABIAIQvQMgAygCDCIBKAIAIAEoAggaECILIANBEGokACAAC40BAQF/QSQQIyICQgA3AgwgAkGElgI2AgAgAkIANwIEIAJCADcCFCACQgA3AhwgAEIANwMYIABCgICAgICAgPg/NwMQIABCADcDCCAAIAI2AgQgACACQQxqNgIAIABCADcDICAAQgA3AzAgAEKAgICAgICA+D83AyggAEIANwM4IABBCGogARBeIAEQLxoLBwAgABEOAAsYAQF/QQwQIyIAQQA2AgggAEIANwIAIAALIAAgACgCBCABEBIiACACKAIEEBUgAEEJTwRAIAAQAQsLSgECfyAAKAIEIgIgACgCCCIBRwRAA0AgACABQQhrIgE2AgggARAvGiACIAAoAggiAUcNAAsLIAAoAgAiAQRAIAAoAgwaIAEQIgsLHQAgAQRAIAAgASgCABBvIAAgASgCBBBvIAEQIgsL+wMBB38CQAJ/QQIgAUEBRg0AGiABIAEgAUEBa3FFDQAaIAEQ9gELIgMgACgCBCIBTQRAIAEgA00NASAAKAIMsyAAKgIQlY38ASECIAEgAyABQQNJIAFpQQFLcgR/IAIQ9gEFIAJBAUEgIAJBAWtna3QgAkECSRsLIgIgAiADSRsiA00NAQsgACEBAkACQCADBEAgA0GAgICABE8NASADQQJ0IgAQIyEFIAEoAgAhAiABIAU2AgAgAgRAIAEoAgQaIAIQIiABKAIAIQULIAEgAzYCBCAABEAgBUEAIAD8CwALIAEoAggiAEUNAiABQQhqIQEgACgCBCECAkAgA2kiBEEBTQRAIAIgA0EBa3EhAgwBCyACIANJDQAgAiADcCECCyAFIAJBAnRqIAE2AgAgACgCACIBRQ0CIANBAWshByAEQQFLIQgDQCABKAIEIQQCQCAIRQRAIAQgB3EhBAwBCyADIARLDQAgBCADcCEECwJAIAIgBEYEQCABIQAMAQsgBSAEQQJ0aiIGKAIARQRAIAYgADYCACABIQAgBCECDAELIAAgASgCADYCACABIAYoAgAoAgA2AgAgBigCACABNgIACyAAKAIAIgENAAsMAgsgASgCACEAIAFBADYCACAABEAgASgCBBogABAiCyABQQA2AgQMAQsQcgALCwtSAQR/IAAoAgAhAQJAIAAoAgQiA0UEQAwBCyADQRhsIgQQJyECIARFDQAgAiABIAT8CgAACyAAIAEEfyABECIgACgCBAUgAws2AgggACACNgIACx0BAX9BBBB0IgBBiO4BNgIAIABByO4BQe0CEAsAC3EBAX8gAkUEQCAAKAIEIAEoAgRGDwsgACABRgRAQQEPCwJAIAAoAgQiAi0AACIARSAAIAEoAgQiAS0AACIDR3INAANAIAEtAAEhAyACLQABIgBFDQEgAUEBaiEBIAJBAWohAiAAIANGDQALCyAAIANGCw4AIABB0ABqECdB0ABqCxsBAX8gAARAIAAoAgAiAQRAIAEQIgsgABAiCwuiAgEFfyMAQSBrIgUkAAJAAkAgACgCBCICIAAoAggiA0kEQCACIAEQPEEMaiEBDAELIAIgACgCACIEa0EMbSIGQQFqIgJB1qrVqgFPDQEgBUEMakHVqtWqASADIARrQQxtIgNBAXQiBCACIAIgBEkbIANBqtWq1QBPGyAGIAAQYSICKAIIIAEQPBogAiACKAIIQQxqNgIIIAIoAgQgACgCBCAAKAIAIgNrIgFBdG1BDGxqIQQgAQRAIAQgAyAB/AoAAAsgACgCACEDIAAgBDYCACACIAM2AgQgACACKAIIIgE2AgQgAiADNgIIIAAoAgghBCAAIAIoAgw2AgggAiADNgIAIAIgBDYCDCACENUBCyAAIAE2AgQgBUEgaiQADwsQJgALgQECAn8BfCMAQRBrIgMkAEHwngItAABBAXFFBEBBAUHYiwJBARAGIQRB8J4CQQE6AABB7J4CIAQ2AgALIANBADYCDEHsngIoAgAgASACIANBDGpBABAFIQUgAygCDCEBIAAgBfwDNgIEIABBnKACNgIAIAEEQCABEAQLIANBEGokAAuoAQEDfyMAQaACayIDJAACQAJAIAEoAgAiBCgCkAEiAkUEQCABKAIEIgEgASgCBEEBajYCBAwBCyACIAIoAgxBAWo2AgwgBCgCkAEhAiABKAIEIgEgASgCBEEBajYCBCACRQ0AIAItABBBAUcNACADQQhqEDsiAUEONgJEIAAgARCjAUEBOgCYAiABEDoaDAELIABBADoAmAIgAEEAOgAACyADQaACaiQAC5UCAQN/IAACfwJAIAEoAgQiBEUEQCABQQRqIgUhAgwBCyACKAIAIQYDQCAEIgIoAhAiBSAGSgRAIAQhBSAEKAIAIgQNAQwCC0EAIAUgBk4NAhogAigCBCIEDQALIAJBBGohBQtBiAEQIyIEIAMoAgAoAgA2AhAgBEEYakEAQfAA/AsAIARCADcDKCAEQoCAgICAgID4PzcDICAEQX82AhggBEIANwMwIARCADcDOCAEQgA3A0ggBEKAgICAgICA+D83A0AgBEIANwNQIARCADcDWCAEQgA3A2ggBEKAgICAgICA+D83A2AgBEIANwNwIARCADcDeCAEQQA7AYABIAEgAiAFIAQQggFBAQs6AAQgACAENgIAC1YBBX8gACgCACICKAIAIgEEQCABIQMgAiEEIAIoAgQiBSABRwRAA0AgASAFQRhrECgiBUcNAAsgACgCACIEKAIAIQMLIAIgATYCBCAEKAIIGiADECILC0oBA38gACgCBCICIAFHBEADQCACQQxrIgQoAgAiAwRAIAJBCGsgAzYCACACQQRrKAIAGiADECILIAQiAiABRw0ACwsgACABNgIECwwAIAEgACgCABEEAAvzAgEFfyAAKAIEIAAoAgAiAmtBAnUiAyABSQRAIwBBIGsiBSQAAkACQAJAIAEgA2siAyAAKAIIIgQgACgCBCICa0ECdU0EQCAAIAMEfyADQQJ0IgAEQCACQQAgAPwLAAsgACACagUgAgs2AgQMAQsgAiAAKAIAIgJrQQJ1IgYgA2oiAUGAgICABE8NASAFQQxqQf////8DIAQgAmsiAkEBdSIEIAEgASAESRsgAkH8////B08bIAYgABBKIgEoAgghAiADQQJ0IgMEQCACQQAgA/wLAAsgASACIANqNgIIIAEoAgQgACgCBCAAKAIAIgRrIgJrIQMgAgRAIAMgBCAC/AoAAAsgACgCACECIAAgAzYCACABIAI2AgQgACABKAIINgIEIAEgAjYCCCAAKAIIIQMgACABKAIMNgIIIAEgAjYCACABIAM2AgwgARBTCyAFQSBqJAAMAQsQJgALDwsgASADSQRAIAAgAiABQQJ0ajYCBAsLSQEBfyABKAJgIAFBADYCYEECRgRAIAEoAkQiA0EANgJgIAAgASADIAJBARDdAQ8LIAEoAkAiA0EANgJgIAAgAyABIAJBARDdAQs7AQF/IAEQowMiAhD1ASAAIAEoAgA2AgAgACABKAIEIgA2AgQgAARAIAAgACgCBEEBajYCBAsgAhD1AQtzAQR/IAAoAgQiAyABQQF0SyADQRBLcQJAIAEgA00NACAAIAEQRCABIAAoAgQiBGsiA0EATA0AIAAoAgAgBEEDdGohBANAIAQgAjkDACAEQQhqIQQgA0EBSyADQQFrIQMNAAsLIAAgATYCBARAIAAQlAELC50BAQR/IAAoAgQiAyABQQF0SyADQRBLcQJAIAEgA00NACAAKAIIIAFJBEAgARAnIQQgACgCACEDIAAoAgQiBUUgBUVyRQRAIAQgAyAF/AoAAAsgAwRAIAMQIgsgACABNgIIIAAgBDYCAAsgASAAKAIEIgRrIgNBAEwgA0VyDQAgACgCACAEaiACIAP8CwALIAAgATYCBARAIAAQhAMLC0IAIAMgATYCCCADQgA3AgAgAiADNgIAIAAoAgAoAgAiAQRAIAAgATYCAAsgACgCBCADEKcBIAAgACgCCEEBajYCCAtSAQR/IAAoAgAhAQJAIAAoAgQiA0UEQAwBCyADQQR0IgQQJyECIARFDQAgAiABIAT8CgAACyAAIAEEfyABECIgACgCBAUgAws2AgggACACNgIACxAAIAEgAiADIAAoAgARBgALEAAgASACIAMgACgCABEDAAucBAEEfyABKAJgBEAgACABIAMQfgsgAigCYARAIAAgAiADEH4LAkACQAJAAkACQAJAIAEgASgCPCIEKAIIIgZGIAIgAigCPCIFKAIIIgdGc0UEQAJAIAEoAlQtABhBA3EEQCAEKAIMIQUgBCAGNgIMIAQgBTYCCAwBCyACKAJULQAYQQNxRQ0CIAUoAgwhBCAFIAc2AgwgBSAENgIIIAUhBAsgBCAEKAIQKAIQNgIQCyABIAMQYyEDIAEoAjwiBCACKAI8IgVGBEAgBCADNgIQIAAtABlBAUcNBCABKAJAIgJFDQIDQAJAIAIoAlgtAAhFBEAgAigCPCIADQELIAIoAkAiAg0BDAQLC0EAIQMCQCAAKAIEIgJFDQADQCACKAIQBEAgAiEDDAILIAIoAgQiAg0ACwsgACADNgIEIAAgBEcEQCAAIQIDQCACKAIEIgJBACACIARHGw0ACyACRQ0ECyAAIAQoAgQ2AgQMAwsgASgCWC0ACEEBRgRAIAEoAjBBAEgNBiACIAEQmgEPCyAEKAIAIAUoAgBJDQUgAiABEJoBDAQLIABBADoAfQ8LQQAhAAsgBCAANgIECyABKAI8IgAEQCAAKAIIQQA2AjwgACgCDEEANgI8IABCADcDCAsgBCgCBCIBRQ0AIAEoAggNAAJAA0AgASgCEA0BIAEoAgQiAQ0AC0EAIQELIAQgATYCBA8LDwsgASACEJoBC4cDAQl+An8gAikDCCABKQMIIgh9IgRCP4ciBacgBEIAVWogASkDACIHIAApAwB9IgNCP4ciBqcgA0IAVWpsIgEgAikDACAHfSIHQj+HIgmnIAdCAFVqIAggACkDCH0iCEI/hyIKpyAIQgBVamwiAEYEQEEBQX8CfyAEIAWFIAV9IgRC/////w+DIgUgAyAGhSAGfSIDQv////8PgyIGfiILQiCIIAUgA0IgiCIDfnwiBUIgiCAEQiCIIgQgA358IAQgBn4gBUL/////D4N8IgRCIIh8IgUgByAJhSAJfSIDQv////8PgyIGIAggCoUgCn0iB0L/////D4MiCX4iCEIgiCAGIAdCIIgiB358IgZCIIggA0IgiCIDIAd+fCADIAl+IAZC/////w+DfCIDQiCIfCIGUQRAQQAgC0L/////D4MgBEIghoQiBCAIQv////8PgyADQiCGhCIFUQ0DGiAEIAVWDAELIAUgBlYLGyIAQQAgAGsgAUEAShsPC0EBQX8gACABSBsLC+wFAgZ/AX4jAEFAaiIDJAAgAyACOgArAkACQAJAAkACQAJAIAEoAgQgASgCACIEa0EYbSICDgICAAELIAAgBBAuGgwECyADQQA2AiQgA0IANwIcIwBBIGsiBiQAAkACQCADQRxqIgQoAgggBCgCACIFa0EDdSACSQRAIAJBgICAgAJPDQEgBkEMaiACIAQoAgQgBWtBA3UgBBBLIgIoAgQgBCgCBCAEKAIAIghrIgVrIQcgBQRAIAcgCCAF/AoAAAsgBCgCACEFIAQgBzYCACACIAU2AgQgBCACKAIINgIEIAIgBTYCCCAEKAIIIQcgBCACKAIMNgIIIAIgBTYCACACIAc2AgwgAhBuCyAGQSBqJAAMAQsQJgALIAEoAgAiAiABKAIEIgdGDQIDQCADQRRqIAIQigECQCADKAIgIgEgAygCJCIESQRAIAEgAygCFDYCACABIAMoAhg2AgQgAUEIaiEBDAELIAEgAygCHCIFa0EDdSIGQQFqIgFBgICAgAJPDQMgA0EsakH/////ASAEIAVrIgRBAnUiBSABIAEgBUkbIARB+P///wdPGyAGIANBHGoQSyEEIAMoAjQiASADKAIUNgIAIAEgAygCGDYCBCADIAFBCGo2AjQgAygCMCADKAIgIAMoAhwiBmsiAWshBSABBEAgBSAGIAH8CgAACyADIAMoAhwiBjYCMCADIAU2AhwgAygCNCEBIAMgBjYCNCADIAE2AiAgAygCJCEFIAMgAygCODYCJCADIAU2AjggBCAGNgIAIAQQbgsgAyABNgIgIAJBGGoiAiAHRw0ACwwCCyAAEOsBGgwCCxAmAAsgA0EsaiADQRxqIANBK2oQgAMgAyADKQIsIgk3AgwgA0IANwIsIAMgCTcDACAAIAMQQwJAIAMoAjAiAEUNACAAIAAoAgQiAUEBazYCBCABDQAgACAAKAIAKAIIEQAAIAAQJAsgAyADQRxqNgIsIANBLGoQZQsgA0FAayQACwsAIAAEQCAAECILCzAAIAEoAgAaIAAgASgCCDYCACAAIAEoAgwiADYCBCAABEAgACAAKAIEQQFqNgIECwtVACAAIAEoAgA2AgAgACABKAIENgIEIAFCADcCACAAIAEoAgg2AgggACABKAIMNgIMIAFCADcCCCAAIAEoAhA2AhAgACABKAIUNgIUIAFCADcCECAAC0UBAn8gACgCBCICIAAoAggiAUcEQCAAIAEgASACa0EYayICQRhwIAJrakEYazYCCAsgACgCACIBBEAgACgCDBogARAiCwuNAQECfCAAIAAQogFEEeotgZmXcT2iIgJEAAAAAAAA8L8gAkQAAAAAAADwv2QbIgJEAAAAAAAA8L8gAr1C////////////AINCgICAgICAgPj/AFQbIgI5AzAgAQRAIAAQogFEAAAAAAAAgD6iIgMgAiACIANjGyECCyAAIAIgACsDOCIDIAIgA2QbOQM4C4sDAQZ/IwBBIGsiAiQAQZiVAiIDIAMoAgAiA0EBajYCACACIAM2AgwgACADNgLIASAAKALcASEBIABB2AFqIgQgACgCXEEDbiIFEDkgACAFNgLcASABQRFJIAEgBUEBdE1yRQRAIAQQgwELIAAoAlwiAUEDbiEFIAFBA08EQCAEKAIAIQZBACEBA0AgBiABQQR0aiIEQX82AgggBCADNgIEIAQgAzYCACABQQFqIgEgBUcNAAsLIAAQ7gIhASAAQcwBaiIEIAAoAtABEG8gACAAQdABajYCzAEgAEIANwPQASACIAJBDGoiADYCFCACQRhqIAQgACACQRRqEHkgAigCGCIAQgA3AyggAEKAgICAgICA+D83AyAgACADNgIYIABCADcDMCAAQgA3AzggAEIANwNIIABCgICAgICAgPg/NwNAIABCADcDUCAAQgA3A1ggAEIANwNoIABCgICAgICAgPg/NwNgIABCADcDcCAAQgA3A3ggAEEAOgCAASAAIAE6AIEBIAJBIGokAAuLAQEBfwJAIAFFDQAgASgCBCIDBEAgAygCBEF/Rw0BCyAAKAIEIgAEQCAAIAAoAgRBAWo2AgQgACAAKAIIQQFqNgIIIAEoAgQhAwsgASAANgIEIAEgAjYCACADBEAgAxAkCyAARQ0AIAAgACgCBCIBQQFrNgIEIAENACAAIAAoAgAoAggRAAAgABAkCwvHAwIBfwx8IwBB0ABrIgIkACABKwNAIQMgASsDECEEIAErAyghBSABKwMwIQYgASsDOCEHIAIgASsDICIIIAErAwAiCaIgASsDCCIKIAErAxgiC6KhOQNIIAIgCiAGoiAHIAmioTkDQCACIAcgC6IgCCAGoqE5AzggAiAEIAuiIAUgCaKhOQMwIAIgAyAJoiAEIAaioTkDKCACIAUgBqIgAyALoqE5AyAgAiAFIAqiIAggBKKhOQMYIAIgByAEoiADIAqioTkDECACIAggA6IgByAFoqE5AwggAisDCCEEIAIrAxAhBSACKwMYIQYgAisDICEHIAIrAyghCCACKwMwIQkgAisDOCEKIAIrA0AhCyAAIAIrA0ggASsDECABKwM4IgMgASsDGCINoiABKwMgIgwgASsDMCIOoqGiIAErAwAgDCABKwNAIgyiIAMgASsDKCIDoqGiIAErAwggAyAOoiAMIA2ioaKgoCIDozkDQCAAIAsgA6M5AzggACAKIAOjOQMwIAAgCSADozkDKCAAIAggA6M5AyAgACAHIAOjOQMYIAAgBiADozkDECAAIAUgA6M5AwggACAEIAOjOQMAIAJB0ABqJAALkgMBBn8gAyEEAkAgASACRg0AIAIgBEYEQCABIQQMAQsgAiABQQRqIgRGBEAgASgCACEFIAMgAmsiAgRAIAEgBCAC/AoAAAsgASACaiIEIAU2AgAMAQsgAyACQQRqRgRAIAMgA0EEayICIAFrIgVrIQQgAigCACEGIAVFIAEgAkZyRQRAIAQgASAF/AoAAAsgASAGNgIADAELAn8gAiABIgRrIgdBAnUiBiADIAJrIghBAnUiAUcEQCAGIQIDQCACIAEiAm8iAQ0ACyAEIAJBAnRqIQUDQCAFQQRrIgUgB2ohAiAFKAIAIQkgBSEBA0AgASACIgEoAgA2AgAgAiAHaiAEIAYgAyACa0ECdSICa0ECdGogAiAGShsiAiAFRw0ACyABIAk2AgAgBCAFRw0ACyAEIAhqDAELAkAgAiAERiACIANGcg0AIAIhAQNAIAQoAgAhBSAEIAEoAgA2AgAgASAFNgIAIARBBGoiBCACRg0BIAFBBGoiASADRw0ACwsgAgshBAsgACADNgIEIAAgBDYCAAuhAgEFfyMAQSBrIgUkAAJAAkAgACgCBCICIAAoAggiA0kEQCACIAEpAwA3AwAgAkEIaiEBDAELIAIgACgCACIEa0EDdSIGQQFqIgJBgICAgAJPDQEgBUEMakH/////ASADIARrIgNBAnUiBCACIAIgBEkbIANB+P///wdPGyAGIAAQSyICKAIIIgMgASkDADcDACACIANBCGo2AgggAigCBCAAKAIEIAAoAgAiA2siAWshBCABBEAgBCADIAH8CgAACyAAKAIAIQMgACAENgIAIAIgAzYCBCAAIAIoAggiATYCBCACIAM2AgggACgCCCEEIAAgAigCDDYCCCACIAM2AgAgAiAENgIMIAIQmQELIAAgATYCBCAFQSBqJAAPCxAmAAtSAQR/IAAoAgAhAQJAIAAoAgQiA0UEQAwBCyADQQV0IgQQJyECIARFDQAgAiABIAT8CgAACyAAIAEEfyABECIgACgCBAUgAws2AgggACACNgIAC1IBBH8gACgCACEBAkAgACgCBCIDRQRADAELIANBA3QiBBAnIQIgBEUNACACIAEgBPwKAAALIAAgAQR/IAEQIiAAKAIEBSADCzYCCCAAIAI2AgALOwECfyAAKAIIIgIEQANAIAIoAgAgAhAiIgINAAsLIAAoAgAhASAAQQA2AgAgAQRAIAAoAgQaIAEQIgsLRAEBfyAAQQA2AgggAEIANwIAIAEEQCAAIAEQkAMgACgCBCECIAFBA3QiAQRAIAJBACAB/AsACyAAIAEgAmo2AgQLIAALkQYCBXwCfyMAQRBrIgYkAAJ8IAC9QiCIp0H/////B3EiB0H7w6T/A00EQEQAAAAAAADwPyAHQZ7BmvIDSQ0BGkQAAAAAAADwPyAAIACiIgFEAAAAAAAA4D+iIgKhIgNEAAAAAAAA8D8gA6EgAqEgASABIAEgAUSQFcsZoAH6PqJEd1HBFmzBVr+gokRMVVVVVVWlP6CiIAEgAaIiAiACoiABIAFE1DiIvun6qL2iRMSxtL2e7iE+oKJErVKcgE9+kr6goqCiIABEAAAAAAAAAICioKCgDAELIAAgAKEgB0GAgMD/B08NABogACAGEIoFIQcgBisDACIBIAGiIgAgAKIhAiAGKwMIIQMCQAJAAkACQCAHQQNxQQFrDgMBAgMAC0QAAAAAAADwPyAARAAAAAAAAOA/oiIEoSIFRAAAAAAAAPA/IAWhIAShIAAgACAAIABEkBXLGaAB+j6iRHdRwRZswVa/oKJETFVVVVVVpT+goiACIAKiIAAgAETUOIi+6fqovaJExLG0vZ7uIT6gokStUpyAT36SvqCioKIgASADoqGgoAwDCyABIAEgAKIiAURJVVVVVVXFP6IgACADRAAAAAAAAOA/oiABIAAgAqIgAER81c9aOtnlPaJE65wriublWr6goiAAIABEff6xV+Mdxz6iRNVhwRmgASq/oKJEpvgQERERgT+goKKhoiADoaChmgwCC0QAAAAAAADwPyAARAAAAAAAAOA/oiIEoSIFRAAAAAAAAPA/IAWhIAShIAAgACAAIABEkBXLGaAB+j6iRHdRwRZswVa/oKJETFVVVVVVpT+goiACIAKiIAAgAETUOIi+6fqovaJExLG0vZ7uIT6gokStUpyAT36SvqCioKIgASADoqGgoJoMAQsgASABIACiIgFESVVVVVVVxT+iIAAgA0QAAAAAAADgP6IgASAAIAKiIABEfNXPWjrZ5T2iROucK4rm5Vq+oKIgACAARH3+sVfjHcc+okTVYcEZoAEqv6CiRKb4EBEREYE/oKCioaIgA6GgoQsgBkEQaiQAC5oCAQV/IAACfyAAKAIEIgIgACgCCEkEQCACIAEQiwFBGGoMAQsjAEEgayIFJAAgACgCBCAAKAIAIgNrQRhtIgRBAWoiAkGr1arVAE8EQBAmAAsgBUEMakGq1arVACAAKAIIIANrQRhtIgNBAXQiBiACIAIgBkkbIANB1arVKk8bIAQgABBkIgIoAgggARCLARogAiACKAIIQRhqNgIIIAAoAgAiASAAKAIEIgMgAigCBCADIAFrQWhtQRhsaiIDEKUCIAAoAgAhASAAIAM2AgAgAiABNgIEIAAgAigCCCIDNgIEIAIgATYCCCAAKAIIIQQgACACKAIMNgIIIAIgATYCACACIAQ2AgwgAhCkAiAFQSBqJAAgAws2AgQLPQECfyAAKAIEIgIgACgCCCIBRwRAIAAgASACIAFrQQdqQXhxajYCCAsgACgCACIBBEAgACgCDBogARAiCwvoAgEGfyABKAI8IgcoAhAiAigCECEFIAAoAjwiAygCECIEKAIQIQYCQAJAIAMoAgggAEYEQCAFIAQ2AhQgBCAFNgIQIAIgBjYCECAGIAI2AhQgAyACNgIQIAMgBygCCCICNgIIIAINAQwCCyAGIAI2AhQgAiAGNgIQIAQgBTYCECAFIAQ2AhQgAyAHKAIMIgI2AgwgAkUNAQsgAiADNgI8C0EAIQUgASgCPCIEQQA2AhAgBEIANwMIIAAoAjwhAwJAIAAoAlQtABhBA3EEQCAEIAMoAhA2AhAgA0EANgIQDAELAkAgAygCBCICRQ0AA0AgAigCEARAIAIhBQwCCyACKAIEIgINAAsLIAMgBTYCBCADQQBHIQUCQCADRSADIARGcg0AIAMhAgNAIAIoAgQiAkEARyEFIAJFDQEgAiAERw0ACwsgBQRAIAMgBCgCBDYCBAsgBCADNgIECyAAQQA2AjwgAUEANgI8C0QCAX8BfCMAQRBrIgIkACACIAEgACsDkAEiAyADIABB+ABqEMICIAAgAkEAEMACIAIgAjYCDCACQQxqECkgAkEQaiQAC68DAQd8IAAgASsDECIEIAErAwAiAyADoiABKwMIIgUgBaKgIAQgBKKgnyIGo0QAAAAAAAAAACADIAajIgi9Qv///////////wCDQoCAgICAgID4/wBUIgEbIgkgAisDECIEIAIrAwAiAyADoiACKwMIIgcgB6KgIAQgBKKgnyIEo0QAAAAAAAAAACADIASjIgO9Qv///////////wCDQoCAgICAgID4/wBUIgIboiAFIAajRAAAAAAAAAAAIAEbIgUgByAEo0QAAAAAAAAAACACG6IgCEQAAAAAAAAAACABGyIGIANEAAAAAAAAAAAgAhuiRAAAAAAAAAAAoKCgIgNEAAAAAAAA4D8gA0QAAAAAAADgP2QbRFVVVVVVVeU/okRWVVVVVVXVP6AiAzkDGCAAIAQgCUQAAAAAAADgP6KiRFVVVVVVVeU/okQAAAAAAAAAAKAgA6M5AxAgACAEIAVEAAAAAAAA4D+iokRVVVVVVVXlP6JEAAAAAAAAAACgIAOjOQMIIAAgBCAGRAAAAAAAAOA/oqJEVVVVVVVV5T+iRAAAAAAAAAAAoCADozkDAAuJBQIGfw58QQECQCABIAEoAjwiBEYNACAAKAI4IgYoAjwiBSAERg0AIAIgAqIhFEE4QTwgAxshByAAKAI8IAYgAxshCSABIgAhAwNAIAUgCUYNAQJAIBQgBSsDGCIPIAArAxgiDaEiDiAOoiAFKwMgIhEgACsDICIOoSIKIAqioCIWZgRAIAUgB2ooAgAhBQwBCyAUIAQrAxgiCiANoSIMIAyiIAQrAyAiDCAOoSILIAuioCIXZgRAIAQoAjwhBAwBCyAUIAogD6EiCyALoiAMIBGhIhAgEKKgIhJmBEAgBCAFIAdqKAIAIgZGDQMgBCgCPCEEIAAhAyAFIQAgBiEFDAELQQBBAUF/IA0gD6EiEyAQoiAOIBGhIhAgC6KhIgtEAAAAAAAAAABkGyALIAuiRAAAAAAAABBAoiACIAIgEiATIBOiIBAgEKKgIgsgCyASYxuiomUbIQYgACADRwRAQQBBAUF/IA0gCqEiCyADKwMgIhAgDKEiEqIgDiAMoSIMIAMrAxgiEyAKoSIKoqEiFUQAAAAAAAAAAGQbIBUgFaJEAAAAAAAAEECiIAIgAiAKIAqiIBIgEqKgIgogCyALoiAMIAyioCIMIAogDGQboqJlGyAGakEAQQFBfyANIBOhIg0gESAQoSIRoiAPIBOhIg8gDiAQoSIOoqEiCkQAAAAAAAAAAGQbIAogCqJEAAAAAAAAEECiIAIgAiAPIA+iIBEgEaKgIg8gDSANoiAOIA6ioCINIA0gD2MboqJlG2ohBgsgBgRAIAZBAEoPCyAWIBdjBEAgBSEDIAUhACAFIAdqKAIAIQUMAQsgBCEDIAQhACAEKAI8IQQLIAEgBEYNASAEIAVHDQALCwv6FQESfyMAQdAAayIDJAAgASgCBCEGIANBADYCPCADQgA3AjQgA0E0aiAGQQNsIgwQNSADIAw2AjggACgCTCEJIANBADYCLCADQgA3AiQgA0EkaiAMECUgAyAMNgIoAkACQAJAAkAgCUH//w9MBEAgA0EANgIcIANCADcCFCADQRRqIAwQRCADIAw2AhggASgCACEJIAMoAjQhBwJAIAIoAgRFBEAgBkUNASADKAIUIQsDQCADQQI2AgwgA0KAgICAEDcCBCAFQQNsIQ0gCSAFQQxsaiEKQQAhBANAIApBBEEIQQRBCCADQQRqIARqKAIAIgJBAUYbQQAgAhsiDkHQ/gBqKAIAIgFBAUYbQQAgARtqKAIAIQEgByACIA1qIg9BDGxqIgggCiAOaigCACICNgIIIAggATYCBCAIIAI2AgAgCyAPQQN0aiACIAEgASACSCIIG6xCgICAgICAgICAf0IAIAEgAkobhCABIAIgCButQiCGhDcDACAEQQRqIgRBDEcNAAsgBUEBaiIFIAZHDQALDAELIAZFDQAgAigCACENIAMoAhQhDkEAIQIDQCADQQI2AgwgA0KAgICAEDcCBCACQQNsIQ8gDSACQQxsIgFqIQogASAJaiEQQQAhBQNAIApBBEEIQQRBCCADQQRqIAVqKAIAIghBAUYbQQAgCBsiC0HQ/gBqKAIAIgFBAUYbQQAgARtqKAIAIQEgCiALaigCACEEIAcgCCAPaiIRQQxsaiIIIAsgEGooAgA2AgggCCABNgIEIAggBDYCACAOIBFBA3RqIAQgASABIARIIggbrEKAgICAgICAgIB/QgAgASAEShuEIAEgBCAIG61CIIaENwMAIAVBBGoiBUEMRw0ACyACQQFqIgIgBkcNAAsLIAMoAiQiBCADKAIoIgJBAnRqIQYgAkUNAUEAIQEDQCAEIAFBAnRqIAE2AgAgAUEBaiIBIAJHDQALIAMgA0EUajYCBCACQYEBSA0CIAIhAQNAIAFBAnQQUCIFRQRAIAFBAXYiAQ0BDAQLCyAEIAYgA0EEaiACIAUgARDGASAFECIMAwsgA0EANgIcIANCADcCFCADQRRqIAwQNSADIAw2AhggA0EANgIMIANCADcCBCADQQRqIAlBAXRBABAxIAEoAgAhByADKAI0IQoCQCACKAIERQRAIAZFDQFBACEBA0AgA0ECNgJMIANCgICAgBA3AkQgCiABQSRsaiENIAcgAUEMbGohCEEAIQQDQCAIQQRBCEEEQQggA0HEAGogBGooAgAiBUEBRhtBACAFGyIOQdD+AGooAgAiAkEBRhtBACACG2ooAgAhAiANIAVBDGxqIgsgCCAOaigCACIFNgIIIAsgAjYCBCALIAU2AgAgAygCBCAFIAIgAiAFShtBAnRqIAlBACACIAVOG0ECdGoiAiACKAIAQQFqNgIAIARBBGoiBEEMRw0ACyABQQFqIgEgBkcNAAsMAQsgBkUNACACKAIAIQ5BACEBA0AgA0ECNgJMIANCgICAgBA3AkQgCiABQSRsaiEPIA4gAUEMbCICaiEIIAIgB2ohEEEAIQUDQCAIQQRBCEEEQQggA0HEAGogBWooAgAiC0EBRhtBACALGyINQdD+AGooAgAiAkEBRhtBACACG2ooAgAhAiAIIA1qKAIAIQQgDyALQQxsaiILIA0gEGooAgA2AgggCyACNgIEIAsgBDYCACADKAIEIAQgAiACIARKG0ECdGogCUEAIAIgBE4bQQJ0aiICIAIoAgBBAWo2AgAgBUEEaiIFQQxHDQALIAFBAWoiASAGRw0ACwsCQCADKAIIIgVFDQAgAygCBCIBKAIAIQIgAUEANgIAIAVBAUYNACABIAVBAnRqIQcgAUEEaiEEA0AgBCgCACEKIAEgAjYCBCABQQRqIQEgAiAKaiECIARBBGoiBCAHRw0ACwsgBgRAQQAhAgNAIANBAjYCTCADQoCAgIAQNwJEIAJBA2whCkEAIQQDQCADKAIEIAMoAjQgA0HEAGogBGooAgAgCmoiCEEMbGoiBSgCACIBIAUoAgQiBSABIAVIG0ECdGpBACAJIAEgBUoiCxtBAnRqIgcgBygCACIHQQFqNgIAIAMoAhQgB0EMbGoiByAINgIIIAcgAjYCBCAHIAEgBSALGzYCACAEQQRqIgRBDEcNAAsgAkEBaiICIAZHDQALIAMoAgghBQsgBQRAQQAhBANAIAMoAgQhBiADKAIkIQkgBAR/IAYgBEECdGpBBGsoAgAFQQALIgIiASAGIARBAnRqKAIAIgZIBEADQCAJIAFBAnRqIAE2AgAgAUEBaiIBIAZHDQALCyADIANBFGo2AkQgAiAGRwRAIAkgAkECdCIBaiAJIAZBAnQiB2ogA0HEAGogByABa0ECdWdBAXRBPnNBARC/BAsgAiAGSARAIAMoAhQhASADKAIkIQkDQCAJIAJBAnRqIgcgASAHKAIAQQxsaigCCDYCACACQQFqIgIgBkcNAAsLIARBAWoiBCAFRw0ACwsgAygCBCIBBEAgARAiCyADKAIUIgFFDQMgARAiDAMLIAMgA0EUajYCBAsgBCAGIANBBGogAkEAQQAQxgELIAMoAhQiAUUNACABECILQQAhBiADQQA2AhwgA0IANwIUIANBFGogDEEAEIEBIAxBAm0hCSAMQQJOBEAgCUEBdCERQQAhAgNAIAMoAjQiBCADKAIkIgggAkECdCISaigCACIFQQxsaiIHQWhBDCAFQQNvQQJGG2ohDiAGIAlqIQEgBygCBCELIAcoAgAhDSADKAIUIQoDQAJAIA0gBCAIIAFBAnRqKAIAIgdBDGwiD2oiECgCBEcNACALIBAoAgBHDQACQCAHIApqLQAADQAgDigCBCAEQWhBDCAHQQNvQQJGG2ogD2ooAgRHDQAgBSAKakEBOgAAIAMoAhQgB2pBAToAACACIAlqIgogAUYNAUEBQX8gASAKSiITGyIOIAFqIQUgASEEA0AgAygCFCEPIAMoAiQhCAJAA0AgBCAOayIEIApOIAQgCkwgExtBAUcNASAPIAggBEECdGooAgAiFGotAAANAAsDQAJAIAggBSAOayIFQQJ0aiEQIAEgBUYNACAPIBAoAgBqLQAADQELCyAQIBQ2AgAMAQsLIAggEmogCUECdGogBzYCAAwBCyABQQFqIgEgEUgNAQsLAkAgAkEBaiICIAlGIgENACANIAMoAjQgAygCJCACQQJ0aigCAEEMbGoiBCgCAEYEQCAEKAIEIAtGDQELIAIhBgsgAUUNAAsLIABB2ABqIgEQ7wIgASAMEMkBIAxBAWpBA08EQCAAKAJoIQYgACgCeCEFIAAoAlghAEEAIQQgAygCNCEHIAMoAhQhCiADKAIkIQgDQCAFIAggBEECdGoiASAJQQJ0aigCACICQQJ0IgtqAn8gCiABKAIAIgFqLQAARQRAIAAgAUECdCIMaiAHIAFBDGxqIg0oAgA2AgAgBSAMaiANKAIINgIAIAYgDGogAjYCACAAIAJBAnRqIAcgAkEMbGoiAigCADYCACACKAIIDAELIAFBAnQhDEF/IQEgACAMakF/NgIAIAUgDGpBADYCACAGIAxqQX82AgAgACACQQJ0akF/NgIAQQALNgIAIAYgC2ogATYCACAEQQFqIgQgCUcNAAsLIAMoAhQiAARAIAAQIgsgAygCJCIABEAgABAiCyADKAI0IgAEQCAAECILIANB0ABqJAALVwEDfyAAKAIIIAFJBEAgAUEwbBAnIQQgACgCACECAkAgACgCBCIDRQ0AIANBMGwiA0UNACAEIAIgA/wKAAALIAIEQCACECILIAAgATYCCCAAIAQ2AgALCy4AIAApAwggASkDCFQgACgCACgCDCgCTCIAIAEoAgAoAgwoAkwiAUkgACABRhsLsAEBDHwgASsDSCEHIAErAzAhCCABKwMAIQkgASsDGCEKIAErA1AhCyABKwM4IQwgASsDCCENIAErAyAhDiAAIAIrAwAiAyABKwMQoiACKwMIIgQgASsDKKKgIAIrAxAiBSABKwNAoqAgAisDGCIGIAErA1iioDkDECAAIAMgDaIgBCAOoqAgBSAMoqAgBiALoqA5AwggACADIAmiIAQgCqKgIAUgCKKgIAYgB6KgOQMAC1oBA3wgACsDKJkiAiAAKwMQmSIBIAEgAmMbIgIgACsDIJkiASAAKwMImSIDIAEgA2QbIgEgASACYxsiAiAAKwMYmSIBIAArAwCZIgMgASADZBsiASABIAJjGwu9BwEDfyAAIAFByAD8CgAAIABBADYCUCAAQgA3A0ggACABKAJINgJIIAAgASgCTDYCTCAAIAEoAlA2AlAgAUEANgJQIAFCADcDSCAAQQA2AmAgAEIANwNYIAAgASgCZDYCZCABQQA2AmQgACABKAJYNgJYIAAgASgCXDYCXCAAIAEoAmA2AmAgAUEANgJgIAFCADcDWCAAQQA2AnAgAEIANwNoIAAgASgCdDYCdCABQQA2AnQgACABKAJoNgJoIAAgASgCbDYCbCAAIAEoAnA2AnAgAUEANgJwIAFCADcDaCAAQQA2AoABIABCADcDeCAAIAEoAoQBNgKEASABQQA2AoQBIAAgASgCeDYCeCAAIAEoAnw2AnwgACABKAKAATYCgAEgAUEANgKAASABQgA3A3ggAEEANgKQASAAQgA3A4gBIAAgASgCiAE2AogBIAAgASgCjAE2AowBIAAgASgCkAE2ApABIAFBADYCkAEgAUIANwOIASAAQQA2AqABIABCADcDmAEgACABKAKYATYCmAEgACABKAKcATYCnAEgACABKAKgATYCoAEgAUEANgKgASABQgA3A5gBIABBADYCsAEgAEIANwOoASAAIAEoAqgBNgKoASAAIAEoAqwBNgKsASAAIAEoArABNgKwASABQQA2ArABIAFCADcDqAEgAEEANgLAASAAQgA3A7gBIAAgASgCuAE2ArgBIAAgASgCvAE2ArwBIAAgASgCwAE2AsABIAFBADYCwAEgAUIANwO4ASAAIAEoAsgBNgLIASAAIAEoAswBNgLMASAAIAEoAtABIgM2AtABIAAgASgC1AEiBDYC1AEgAEHQAWohAgJAIARFBEAgACACNgLMAQwBCyADIAI2AgggAUIANwPQASABIAFB0AFqNgLMAQsgAEEANgLgASAAQgA3A9gBIAAgASgC2AE2AtgBIAAgASgC3AE2AtwBIAAgASgC4AE2AuABIAFBADYC4AEgAUIANwPYASAAQQA2AvABIABCADcD6AEgACABKALoATYC6AEgACABKALsATYC7AEgACABKALwATYC8AEgAUEANgLwASABQgA3A+gBIABBADYCgAIgAEIANwP4ASAAIAEoAvgBNgL4ASAAIAEoAvwBNgL8ASAAIAEoAoACNgKAAiABQQA2AoACIAFCADcD+AEgAEEANgKQAiAAQgA3A4gCIAAgASgCiAI2AogCIAAgASgCjAI2AowCIAAgASgCkAI2ApACIAFBADYCkAIgAUIANwOIAiAAC44BAgJ/AXwjAEEQayICJABB6J4CLQAAQQFxRQRAQQJByIsCQQMQBiEDQeieAkEBOgAAQeSeAiADNgIACyACIAEpAgA3AwggAkEANgIEQeSeAigCAEEAQQAgAkEEaiACQQhqEAUhBCACKAIEIQEgACAE/AM2AgQgAEGcoAI2AgAgAQRAIAEQBAsgAkEQaiQAC5oBAQV/IABCADcCBCAAKAIAIQMgAEEANgIAIAAgASgCBCIEEDMgACAENgIEAkACQCABKAIEIgQEQCAAKAIAIQUgASgCACEGA0AgBSACQRhsaiIAIAMgBiACQQJ0aigCAEEYbGoiASkDEDcDECAAIAEpAwg3AwggACABKQMANwMAIAJBAWoiAiAERw0ACwwBCyADRQ0BCyADECILC4EBAQR/IABCADcCBCAAKAIAIQIgAEEANgIAIAAgASgCBCIEECUgACAENgIEAkACQCABKAIEIgQEQCAAKAIAIQAgASgCACEBA0AgACADQQJ0IgVqIAIgASAFaigCAEECdGooAgA2AgAgA0EBaiIDIARHDQALDAELIAJFDQELIAIQIgsL0gQBBH8gASAAIAFGIgM6AAwCQCADDQADQCABKAIIIgMtAAwNAQJAAkAgAygCCCICKAIAIgQgA0YEQAJAIAIoAgQiBUUNACAFLQAMDQAgA0EBOgAMIAIgACACRjoADCAFQQE6AAwMAgsCQCADKAIAIAFGBEAgAyEBDAELIAMgAygCBCIBKAIAIgA2AgQCQAJAAkAgAEUEQCABIAI2AggMAQsgACADNgIIIAMoAggiAigCACABIAI2AgggA0cNAQsgAiABNgIADAELIAIgATYCBAsgASADNgIAIAMgATYCCCABKAIIIgIoAgAhBAsgAUEBOgAMIAJBADoADCACIAQoAgQiADYCACAABEAgACACNgIICyAEIAIoAggiADYCCAJAIAAoAgAgAkYEQCAAIAQ2AgAMAQsgACAENgIECyAEIAI2AgQgAiAENgIIDwsgBEUNASAELQAMDQEgA0EBOgAMIAIgACACRjoADCAEQQE6AAwLIAIhASAAIAJHDQEMAgsLAkAgAygCACIEIAFHBEAgAyEEDAELIAMgBCgCBCIANgIAIAAEQCAAIAM2AgggAygCCCECCyAEIAI2AggCQCACKAIAIANGBEAgAiAENgIADAELIAIgBDYCBAsgBCADNgIEIAMgBDYCCCAEKAIIIQILIARBAToADCACQQA6AAwgAiACKAIEIgEoAgAiADYCBCAABEAgACACNgIICyABIAIoAggiADYCCAJAIAAoAgAgAkYEQCAAIAE2AgAMAQsgACABNgIECyABIAI2AgAgAiABNgIICwvgBQIFfAJ/IwBBEGsiBiQAAkAgAL1CIIinQf////8HcSIHQfvDpP8DTQRAIAdBgIDA8gNJDQEgACAAIAAgAKIiAKIgACAAIAAgAKKiIABEfNXPWjrZ5T2iROucK4rm5Vq+oKIgACAARH3+sVfjHcc+okTVYcEZoAEqv6CiRKb4EBEREYE/oKCiRElVVVVVVcW/oKKgIQAMAQsgB0GAgMD/B08EQCAAIAChIQAMAQsgACAGEIoFIQcgBisDACIBIAGiIgAgAKIhAiAGKwMIIQMCQAJAAkACQCAHQQNxQQFrDgMBAgMACyABIAEgAKIiAURJVVVVVVXFP6IgACADRAAAAAAAAOA/oiABIAAgAqIgAER81c9aOtnlPaJE65wriublWr6goiAAIABEff6xV+Mdxz6iRNVhwRmgASq/oKJEpvgQERERgT+goKKhoiADoaChIQAMAwtEAAAAAAAA8D8gAEQAAAAAAADgP6IiBKEiBUQAAAAAAADwPyAFoSAEoSAAIAAgACAARJAVyxmgAfo+okR3UcEWbMFWv6CiRExVVVVVVaU/oKIgAiACoiAAIABE1DiIvun6qL2iRMSxtL2e7iE+oKJErVKcgE9+kr6goqCiIAEgA6KhoKAhAAwCCyABIAEgAKIiAURJVVVVVVXFP6IgACADRAAAAAAAAOA/oiABIAAgAqIgAER81c9aOtnlPaJE65wriublWr6goiAAIABEff6xV+Mdxz6iRNVhwRmgASq/oKJEpvgQERERgT+goKKhoiADoaChmiEADAELRAAAAAAAAPA/IABEAAAAAAAA4D+iIgShIgVEAAAAAAAA8D8gBaEgBKEgACAAIAAgAESQFcsZoAH6PqJEd1HBFmzBVr+gokRMVVVVVVWlP6CiIAIgAqIgACAARNQ4iL7p+qi9okTEsbS9nu4hPqCiRK1SnIBPfpK+oKKgoiABIAOioaCgmiEACyAGQRBqJAAgAAtfACAAIAM2AhBBACEDIABBADYCDAJAIAEEQCABQYCAgCBPDQEgAUEGdBAjIQMLIAAgAzYCACAAIAMgAkEGdGoiAjYCCCAAIAMgAUEGdGo2AgwgACACNgIEIAAPCxByAAuSAgEBfyAAKAJwIgEEQCAAIAE2AnQgACgCeBogARAiCyAAKAJkIgEEQCAAIAE2AmggACgCbBogARAiCyAAKAJYIgEEQCAAIAE2AlwgACgCYBogARAiCyAAKAJMIgEEQCAAIAE2AlAgACgCVBogARAiCyAAKAJAIgEEQCAAIAE2AkQgACgCSBogARAiCyAAKAI0IgEEQCAAIAE2AjggACgCPBogARAiCyAAKAIoIgEEQCAAIAE2AiwgACgCMBogARAiCyAAKAIcIgEEQCAAIAE2AiAgACgCJBogARAiCyAAKAIQIgEEQCAAIAE2AhQgACgCGBogARAiCyAAKAIEIgEEQCAAIAE2AgggACgCDBogARAiCwsoAQF/IAAEQCAAKAIAIgEEQCAAIAE2AgQgACgCCBogARAiCyAAECILC1cCAX8BfgJAQcCcAigCACIBrSAArUIHfEL4////H4N8IgJC/////w9YBEAgAqciAD8AQRB0TQ0BIAAQHQ0BC0GgoQJBMDYCAEF/DwtBwJwCIAA2AgAgAQsJACAAvUI0iKcL0AICBX8BfCMAQSBrIgUkAAJAAkAgACgCBCICIAAoAggiA0kEQCABKwMAIQcgAiABKwMIEDT8BjcDCCACIAcQNPwGNwMAIAJBEGohAQwBCyACIAAoAgAiBGtBBHUiBkEBaiICQYCAgIABTw0BIAVBDGpB/////wAgAyAEayIDQQN1IgQgAiACIARJGyADQfD///8HTxsgBiAAEDIhAiABKwMAIQcgAigCCCIDIAErAwgQNPwGNwMIIAMgBxA0/AY3AwAgAiADQRBqNgIIIAIoAgQgACgCBCAAKAIAIgNrIgFrIQQgAQRAIAQgAyAB/AoAAAsgACgCACEDIAAgBDYCACACIAM2AgQgACACKAIIIgE2AgQgAiADNgIIIAAoAgghBCAAIAIoAgw2AgggAiADNgIAIAIgBDYCDCACEDYLIAAgATYCBCAFQSBqJAAPCxAmAAuUBgEFfyMAQRBrIggkAAJAAkACQCADDgMCAgABCyABQQxrIQICQAJAIAFBCGsoAgAiAUUNACAAKAIERQ0AIAAoAgApAwAgAigCACkDAFUNAQwDCyABRQ0CCyAIIAAoAgg2AgggCCAAKQIANwMAIAAgAi0ACDoACCAAIAIpAgA3AgAgAiAILQAIOgAIIAIgCCkDADcCAAwBCyADQYABTARAIAAiAiABIgRGDQEgAEEMaiIDIAFGDQEDQCAAIQEgAyEAAkACQAJAIAEoAhAiBkUNACABKAIERQ0AIAEoAgApAwAgACgCACIFKQMAVQ0BDAILIAZFDQEgACgCACEFCyABKAIUIQcgACABLQAIOgAIIAAgASkCADcCAAJ/IAIgASACRg0AGgNAIAFBDGshAwJAIAFBCGsoAgBFDQAgAygCACkDACAFKQMAVQ0AIAEMAgsgASADLQAIOgAIIAEgAykCADcCACADIgEgAkcNAAsgAgsiASAHOgAIIAEgBjYCBCABIAU2AgALIABBDGoiAyAERw0ACwwBCyADIANBAXYiB2shCSAAIAdBDGwiCmohBiADIAVMBEAgACAGIAIgByAEELMDIAYgASACIAkgBCAKaiIBELMDIAQgA0EMbGohAgJAIAEiAyAERwRAA0AgASACRgRAIAMgBEYNAwNAIAAgBC0ACDoACCAAIAQpAgA3AgAgAEEMaiEAIARBDGoiBCADRw0ACwwDCwJAAkACQAJAIAEoAgQiBUUNACAEKAIERQ0AIAQoAgApAwAgASgCACkDAFUNAQwCCyAFRQ0BCyAAIAEtAAg6AAggACABKQIANwIAIAFBDGohAQwBCyAAIAQtAAg6AAggACAEKQIANwIAIARBDGohBAsgAEEMaiEAIAMgBEcNAAsLIAEgAkYNAANAIAAgAS0ACDoACCAAIAEpAgA3AgAgAEEMaiEAIAFBDGoiASACRw0ACwsMAQsgACAGIAIgByAEIAUQrwEgBiABIAIgCSAEIAUQrwEgACAGIAEgAiAHIAkgBCAFELgCCyAIQRBqJAAL5wYCBX8CfiMAQRBrIgkkAAJAAkACQCADDgMCAgABCwJAIAAoAgAiAigCACIDKQMIIgsgAUEEayIBKAIAIgQoAgAiBSkDCCIMUgRAIAsgDFMNAQwDCyADKQMAIAUpAwBXDQILIAAgBDYCACABIAI2AgAMAQsgA0EATARAIAAiAyABIgZGDQEgAEEEaiIFIAFGDQEgACEBA0AgASEAIAUhAQJAAkAgACgCACIHKAIAIgIpAwgiCyAAKAIEIggoAgAiBCkDCCIMUgRAIAsgDFMNAQwCCyACKQMAIAQpAwBXDQELQQAhBSABQQA2AgAgASECA0AgAEEANgIAIAIgBzYCACAFBEAgBRAiCwJAIAAgA0YEQCADIQAMAQsCQCAAQQRrIgQoAgAiBygCACICKQMIIgsgCCgCACIFKQMIIgxSBEAgCyAMUw0BDAILIAIpAwAgBSkDAFcNAQsgACgCACEFIAAhAiAEIQAMAQsLIAAoAgAhAiAAIAg2AgAgAkUNACACECILIAFBBGoiBSAGRw0ACwwBCyAAIANBAXYiBkECdCIIaiEHIAMgBUwEQCAAIAcgAiAGIAQQtQMgByABIAIgAyAGayAEIAhqIgIQtQMgCSADNgIMIAQgA0ECdGohBQJAIAQiASACIgNHBEADQCACIAVGBEAgASADRg0DA0AgASgCACEFIAFBADYCACAAKAIAIQIgACAFNgIAIAIEQCACECILIABBBGohACABQQRqIgEgA0cNAAsMAwsCQAJAAkAgASgCACIHKAIAIgYpAwgiCyACKAIAIggoAgAiCikDCCIMUgRAIAsgDFMNAQwCCyAGKQMAIAopAwBXDQELIAJBADYCACAAKAIAIQYgACAINgIAIAYEQCAGECILIAJBBGohAgwBCyABQQA2AgAgACgCACEGIAAgBzYCACAGBEAgBhAiCyABQQRqIQELIABBBGohACABIANHDQALCyACIAVGDQADQCACKAIAIQMgAkEANgIAIAAoAgAhASAAIAM2AgAgAQRAIAEQIgsgAEEEaiEAIAJBBGoiAiAFRw0ACwsgCUEMaiAEELQDDAELIAAgByACIAYgBCAFELABIAcgASACIAMgBmsiAyAEIAUQsAEgACAHIAEgAiAGIAMgBCAFELkCCyAJQRBqJAALHQECfyAAKAIEIAAoAgAiAmtBDG0EQCAAIAIQewsLFwAgAEHomgI2AgAgAEEEaiABENEEIAALNQEBfyABIAAoAgQiAkEBdWohASAAKAIAIQAgASACQQFxBH8gASgCACAAaigCAAUgAAsRBAALSgAgACABKAIANgIAIAAgASgCBDYCBCABQgA3AwAgACABKAIINgIIIAAgASgCDDYCDCABQgA3AwggAEEQaiABQRBqQTD8CgAAIAALvAUCBX8CfCMAQSBrIgUkAAJAAkACQCACDgMCAgABCyABQRBrKwMAIAArAwhjRQ0BIAUgACkDEDcDGCAFIAApAwg3AxAgBSAAKQMANwMIIAAgAUEYayIBKAIQNgIQIAAgASkDCDcDCCAAIAEpAwA3AwAgASAFKAIYNgIQIAEgBSkDEDcDCCABIAUpAwg3AwAMAQsgAkGAAUwEQCAAIAFGDQEgAEEYaiIDIAFGDQEgACEEA0AgAyEGIAQrAyAiCiAEKwMIYwRAIAQoAighByADKwMAIQsgAyECA0ACQCACIAQiAygCEDYCECACIAMpAwg3AwggAiADKQMANwMAIAAgA0YEQCAAIQMMAQsgA0EYayEEIAMhAiAKIANBEGsrAwBjDQELCyADIAc2AhAgAyAKOQMIIAMgCzkDAAsgASAGIgRBGGoiA0cNAAsMAQsgAiACQQF2IgdrIQggACAHQRhsIglqIQYCQCACIARMBEAgACAGIAcgAxDPAyAGIAEgCCADIAlqIgEQzwMgAyACQRhsaiEEIAEhAgNAIAIgBEYEQCABIANGDQQDQCAAIAMoAhA2AhAgACADKQMINwMIIAAgAykDADcDACAAQRhqIQAgA0EYaiIDIAFHDQALDAQLAkAgAisDCCADKwMIYwRAIAAgAigCEDYCECAAIAIpAwg3AwggACACKQMANwMAIAJBGGohAgwBCyAAIAMoAhA2AhAgACADKQMINwMIIAAgAykDADcDACADQRhqIQMLIABBGGohACABIANHDQALDAELIAAgBiAHIAMgBBC1ASAGIAEgCCADIAQQtQEgACAGIAEgByAIIAMgBBDHAgwBCyACIARGDQADQCAAIAIoAhA2AhAgACACKQMINwMIIAAgAikDADcDACAAQRhqIQAgAkEYaiICIARHDQALCyAFQSBqJAALwAUCBX8BfCMAQSBrIgUkAAJAAkACQCACDgMCAgABCyABQRhrIgErAwAgACsDAGNFDQEgBSAAKQMQNwMYIAUgACkDCDcDECAFIAApAwA3AwggACABKAIQNgIQIAAgASkDCDcDCCAAIAEpAwA3AwAgASAFKAIYNgIQIAEgBSkDEDcDCCABIAUpAwg3AwAMAQsgAkGAAUwEQCAAIAFGDQEgAEEYaiIDIAFGDQEgACEEA0AgAyEGIAQrAxgiCiAEKwMAYwRAIAUgBCkDKDcDECAFIAQpAyA3AwggAyECA0ACQCACIAQiAygCEDYCECACIAMpAwg3AwggAiADKQMANwMAIAAgA0YEQCAAIQMMAQsgAyECIAogA0EYayIEKwMAYw0BCwsgAyAKOQMAIAMgBSkDCDcDCCADIAUoAhA2AhALIAEgBiIEQRhqIgNHDQALDAELIAIgAkEBdiIHayEIIAAgB0EYbCIJaiEGAkAgAiAETARAIAAgBiAHIAMQ0QMgBiABIAggAyAJaiIBENEDIAMgAkEYbGohBCABIQIDQCACIARGBEAgASADRg0EA0AgACADKAIQNgIQIAAgAykDCDcDCCAAIAMpAwA3AwAgAEEYaiEAIANBGGoiAyABRw0ACwwECwJAIAIrAwAgAysDAGMEQCAAIAIoAhA2AhAgACACKQMINwMIIAAgAikDADcDACACQRhqIQIMAQsgACADKAIQNgIQIAAgAykDCDcDCCAAIAMpAwA3AwAgA0EYaiEDCyAAQRhqIQAgASADRw0ACwwBCyAAIAYgByADIAQQtgEgBiABIAggAyAEELYBIAAgBiABIAcgCCADIAQQyAIMAQsgAiAERg0AA0AgACACKAIQNgIQIAAgAikDCDcDCCAAIAIpAwA3AwAgAEEYaiEAIAJBGGoiAiAERw0ACwsgBUEgaiQAC/gZAiR/CXwjAEGAAWsiCiQAIAVBAWohHCADQQRqIRsgAkEEaiEPIARBBGohEQJAAkACQANAIApCgoCAgDA3AnggCkKAgICAEDcCcEEDIQZBfyELQQAhCEF/IQcDQCAGIQ0gCkHwAGogCGooAgAhBgJAIAtBf0cNACAEIQkCQAJAAkAgBg4CAgABCyARIQkMAQsgBEEIQQwgBkECRhtqIQkLQX8hCyAJKAIADQAgBCELAkACQAJAIA0OAgIAAQsgESELDAELIARBCEEMIA1BAkYbaiELC0F/IAYgCygCABshCwsgBCEJAkACQAJAIAYOAgIAAQsgESEJDAELIARBCEEMIAZBAkYbaiEJC0F+IAYgB0F/RxsgByAJKAIAQQBKGyEHIAhBBGoiCEEQRw0ACwJAIAtBAE4EQCAHQQBOBEAgB0EBayAHQQNxIgxBAnMhEiAEIQYCQAJAAkAgBw4CAgABCyARIQYMAQsgBEEIQQwgB0ECRhtqIQYLQQNxIQ4gBigCACINQQJtIRQgAiEGAkACQAJAIBIOAgIAAQsgDyEGDAELIAJBDEEIIAwbaiEGCyACIQgCQAJAAkAgDg4CAgABCyAPIQgMAQsgAkEIQQwgDkECRhtqIQgLIAMhASAFIQkCQAJAAkAgBw4CAgABCyAbIQEgHCEJDAELIAVBAkEDIAdBAkYiARtqIQkgA0EIQQwgARtqIQELIAEoAgAgFEEAIBRrIAktAAAbaiELIAgoAgAhCSAGKAIAIQECfyAAKAIEIgggACgCCCIGTwRAIAAgBkEBdEGAASAGGxA1IAAoAgAiFyAAKAIEIghBDGxqDAELIAAoAgAiFyAIQQxsagsiBiABNgIAIAdBAWogBiALNgIIIAYgCTYCBCAAIAhBAWoiBjYCBCACIQgCQAJAAkAgDA4CAgABCyAPIQgMAQsgAkEIQQwgDEECRhtqIQgLQQNxIRUgDUF/TgRAIAJBCEEMIA5BAkYbaiEWIAVBAkEDIAdBAkYiARtqIRAgA0EIQQwgARtqIQ0gCCgCACELQQAhCANAIAMhASAFIQkCQAJAAkAgBw4CAgABCyAbIQEgHCEJDAELIA0hASAQIQkLIAhBACAIayAJLQAAGyETIAEoAgAgAiEBAkACQAJAIA4OAgIAAQsgDyEBDAELIBYhAQsgE2ohCSABKAIAIRMCfyAAKAIIIgEgBk0EQCAAIAFBAXRBgAEgARsQNSAAKAIAIhcgACgCBCIGQQxsagwBCyAXIAZBDGxqCyIBIBM2AgAgASAJNgIIIAEgCzYCBCAAIAZBAWoiBjYCBCAIIBRGIAhBAWohCCAJIQtFDQALCyACIQEgFQ4CBQQCCyACKAIAIQkgCkKBgICAIDcCcCACQQhBDCALQQJGG2ohEEEAIRgDQCAKQfAAaiAYaigCACIOIAtqIhJBBG8hDAJAAkAgDkECRw0AIAQhBgJAAkACQCAMDgICAAELIBEhBgwBCyAEQQhBDCAMQQJGG2ohBgsgBigCAEEATA0AIAIhBiADIQcCQAJAAkAgDA4CAgABCyAPIQYgGyEHDAELIANBCEEMIAxBAkYbIgFqIQcgASACaiEGCyAGKAIAIQggBygCACEHIAAoAgQiBiAAKAIIIgFPBEAgACABQQF0QYABIAEbEDUgACAAKAIEIgFBAWo2AgQgACgCACABQQxsaiIBIAk2AgggASAHNgIEIAEgCDYCAAwCCyAAIAZBAWo2AgQgACgCACAGQQxsaiIBIAk2AgggASAHNgIEIAEgCDYCAAwBCyACIQYCQAJAAkAgDA4CAgABCyAPIQYMAQsgAkEIQQwgDEECRhtqIQYLIAYoAgAhCQsgBUECQQMgDEECRiIBG2ohEyADQQhBDCABGyIBaiEWIAEgBGohDUEAIQYCQAJAAkACQANAIAQhBwJAAkACQCAMDgICAAELIBEhBwwBCyANIQcLAkAgBygCACAGTARAIA5BAkYNBSAEIQYgDA4CBAEDCyADIQcgBSEIAkACQAJAIAwOAgIAAQsgGyEHIBwhCAwBCyAWIQcgEyEICyAGQQAgBmsgCC0AABshCCAHKAIAIAIhBwJAAkACQCALDgICAAELIA8hBwwBCyAQIQcLIAhqIQggBygCACEVAn8gACgCBCIBIAAoAggiB08EQCAAIAdBAXRBgAEgBxsQNSAAKAIAIAAoAgQiAUEMbGoMAQsgACgCACABQQxsagsiByAVNgIAIAcgCDYCCCAHIAk2AgQgACABQQFqNgIEIAZBAWohBiAIIQkMAQsLIBEhBgwBCyANIQYLIAYoAgANAQsgAiEGAkACQAJAIAsOAgIAAQsgDyEGDAELIBAhBgsgAiEHAkACQAJAIBJBAWpBBG8iAQ4CAgABCyAPIQcMAQsgAkEIQQwgAUECRhtqIQcLIAcoAgAhCCAGKAIAIQcCfyAAKAIEIgYgACgCCCIBTwRAIAAgAUEBdEGAASABGxA1IAAgACgCBCIBQQFqNgIEIAAoAgAgAUEMbGoMAQsgACAGQQFqNgIEIAAoAgAgBkEMbGoLIgYgBzYCACAGIAg2AgggBiAJNgIECyAYQQRqIhhBCEcNAAsMBQsgAygCDCIdIAQoAgwiGUEBaiAZQX9zIAUtAAMiHhtqIQcgBS0AAEEYdCEGIAQoAgghJCAFLQABIR8gBCgCACEOIAMoAgAhICADKAIEIRIgAigCACEVIAIoAgQhEwJAIBkgBCgCBCIhIBkgIUgbIiVBAEwEQCAeQRB0IB9yISYgEiEWDAELIAYgHkEQdCAfciImQYACciIXciEYICVBAWoiJ7chLCAktyEtIA63IS5BASEaIBIhCANAIBogIWwgJ20iC0EBaiALQX9zIB8bIBJqIhYgCGsiCUEfdSIGQX9zIAYgCXNqISggGSAZIBpsICdtIglrIgZBACAGayAeGyAdaiIUIAdrIgdBH3UiBkF/cyAGIAdzaiEpIAtBACALayAfGyASaiEQIBkgCUF/c2oiBkEAIAZrIB4bIB1qIQ1EAAAAAAAA8D8gGrggLKMiKqEgLqIgKiAtoqAQNCABKAIEISL8AiIMQQBKBEAgDEEBarghLyABKAIAIQlBACELICIhBwNARAAAAAAAAPA/IAtBAWoiC7ggL6MiK6EiKiAJIBBBBXRqIiMrAxiiICsgCSANQQV0aiIGKwMYoqAhMCAqICMrAxCiICsgBisDEKKgITEgKiAjKwMIoiArIAYrAwiioCEyICogIysDAKIgKyAGKwMAoqAhKgJ/IAEoAggiBiAHTQRAIAEgBkEBdEGAASAGGxBVIAEoAgAiCSABKAIEIgdBBXRqDAELIAkgB0EFdGoLIgYgKjkDACAGIDA5AxggBiAxOQMQIAYgMjkDCCABIAdBAWoiBzYCBCALIAxHDQALCyAKIBA2AmQgCiATNgJgIAogFTYCbCAKIA02AmggCiAINgJQIAogIDYCXCAKIBQ2AlggCiAONgJMIAogKTYCSCAKICg2AkAgCiAYNgI8IAogCikCYDcDKCAKIAopAmg3AzAgCiAiNgJUIAogCikCUDcDGCAKIAopAlg3AyAgCiAMNgJEIAogCikCSDcDECAKIAopAkA3AwggCiAYNgIEIAAgASAKQShqIApBGGogCkEIaiAKQQRqELcBIAwgImpBAWshICAaICVGIBpBAWohGiANIRUgECETIBQhByAWIQggFyEYIAwhDkUNAAtBACEGCyAFLQACIQ0gAygCCCELIAIoAgwhCSACIBU2AgwgAigCCCEIIAIgCTYCCCACIAg2AgQgAiATNgIAIAMgIDYCDCADIB02AgggAyALNgIEIAMgFjYCACAEIA42AgwgBCAkNgIEIAQgByAdayIIQR91IgdBf3MgByAIc2o2AgggBCAhIBYgEmsiCEEfdSIHIAcgCHNrajYCACAFIA1BCHQgBnIgJnI2AAAMAQsLIAJBCEEMIBVBAkYbaiEBDAELIA8hAQsCQAJAAkAgBw4CAgABCyARIQQMAQsgBEEIQQwgB0ECRhtqIQQLIAQoAgAiCCAUTA0AIAEoAgAhECACQQxBCCAMG2ohDSAFQQJBAyAHQQJGIgEbaiERIANBCEEMIAEbaiEEA0AgAyEJIAUhCwJAAkACQCAHDgICAAELIBshCSAcIQsMAQsgBCEJIBEhCwsgCEEBayIBQQEgCGsgCy0AABshCyAJKAIAIAIhCAJAAkACQCASDgICAAELIA8hCAwBCyANIQgLIAtqIQkgCCgCACELAn8gACgCCCIIIAZNBEAgACAIQQF0QYABIAgbEDUgACgCACIXIAAoAgQiBkEMbGoMAQsgFyAGQQxsagsiCCALNgIAIAggEDYCCCAIIAk2AgQgACAGQQFqIgY2AgQgCSEQIAEiCCAUSg0ACwsgCkGAAWokAAu+BAEEfwJAAkACQCADDgMCAgABCyACKAIAKAIAIgIgAUEEayIBKAIAIgNBAnRqKAIAIAIgACgCACIEQQJ0aigCAE8NASAAIAM2AgAgASAENgIADwsgA0GAAUwEQCAAIAFGDQEgAEEEaiIEIAFGDQEgAigCACgCACEGIAAhAwNAIAQiByECIAYgAygCBCIIQQJ0aiIJKAIAIAYgAygCACIFQQJ0aigCAEkEQANAAkAgAiAFNgIAIAAgAyIERgRAIAAhBAwBCyAEIQIgCSgCACAGIARBBGsiAygCACIFQQJ0aigCAEkNAQsLIAQgCDYCAAsgByIDQQRqIgQgAUcNAAsMAQsgAyADQQF2IgZrIQggACAGQQJ0IglqIQcCQCADIAVMBEAgACAHIAIgBiAEENkDIAcgASACIAggBCAJaiIBENkDIAQgA0ECdGohBSACKAIAIQcgASEDA0AgAyAFRwRAIAAgAygCACICIAQoAgAiBiAHKAIAIgggAkECdGooAgAgCCAGQQJ0aigCAEkiAhs2AgAgA0EEQQAgAhtqIQMgAEEEaiEAIAEgBEEAQQQgAhtqIgRHDQEMAwsLIAEgBEYNAgNAIAAgBCgCADYCACAAQQRqIQAgBEEEaiIEIAFHDQALDAILIAAgByACIAYgBCAFELgBIAcgASACIAggBCAFELgBIAAgByABIAIgBiAIIAQgBRDLAg8LIAMgBUYNAANAIAAgAygCADYCACAAQQRqIQAgA0EEaiIDIAVHDQALCwu+BAEEfwJAAkACQCADDgMCAgABCyACKAIAKAIAIgIgAUEEayIBKAIAIgNBAnRqKAIAIAIgACgCACIEQQJ0aigCAE8NASAAIAM2AgAgASAENgIADwsgA0GAAUwEQCAAIAFGDQEgAEEEaiIEIAFGDQEgAigCACgCACEGIAAhAwNAIAQiByECIAYgAygCBCIIQQJ0aiIJKAIAIAYgAygCACIFQQJ0aigCAEkEQANAAkAgAiAFNgIAIAAgAyIERgRAIAAhBAwBCyAEIQIgCSgCACAGIARBBGsiAygCACIFQQJ0aigCAEkNAQsLIAQgCDYCAAsgByIDQQRqIgQgAUcNAAsMAQsgAyADQQF2IgZrIQggACAGQQJ0IglqIQcCQCADIAVMBEAgACAHIAIgBiAEENoDIAcgASACIAggBCAJaiIBENoDIAQgA0ECdGohBSACKAIAIQcgASEDA0AgAyAFRwRAIAAgAygCACICIAQoAgAiBiAHKAIAIgggAkECdGooAgAgCCAGQQJ0aigCAEkiAhs2AgAgA0EEQQAgAhtqIQMgAEEEaiEAIAEgBEEAQQQgAhtqIgRHDQEMAwsLIAEgBEYNAgNAIAAgBCgCADYCACAAQQRqIQAgBEEEaiIEIAFHDQALDAILIAAgByACIAYgBCAFELkBIAcgASACIAggBCAFELkBIAAgByABIAIgBiAIIAQgBRDMAg8LIAMgBUYNAANAIAAgAygCADYCACAAQQRqIQAgA0EEaiIDIAVHDQALCwu+BAEEfwJAAkACQCADDgMCAgABCyACKAIAKAIAIgIgAUEEayIBKAIAIgNBAnRqKAIAIAIgACgCACIEQQJ0aigCAE8NASAAIAM2AgAgASAENgIADwsgA0GAAUwEQCAAIAFGDQEgAEEEaiIEIAFGDQEgAigCACgCACEGIAAhAwNAIAQiByECIAYgAygCBCIIQQJ0aiIJKAIAIAYgAygCACIFQQJ0aigCAEkEQANAAkAgAiAFNgIAIAAgAyIERgRAIAAhBAwBCyAEIQIgCSgCACAGIARBBGsiAygCACIFQQJ0aigCAEkNAQsLIAQgCDYCAAsgByIDQQRqIgQgAUcNAAsMAQsgAyADQQF2IgZrIQggACAGQQJ0IglqIQcCQCADIAVMBEAgACAHIAIgBiAEENsDIAcgASACIAggBCAJaiIBENsDIAQgA0ECdGohBSACKAIAIQcgASEDA0AgAyAFRwRAIAAgAygCACICIAQoAgAiBiAHKAIAIgggAkECdGooAgAgCCAGQQJ0aigCAEkiAhs2AgAgA0EEQQAgAhtqIQMgAEEEaiEAIAEgBEEAQQQgAhtqIgRHDQEMAwsLIAEgBEYNAgNAIAAgBCgCADYCACAAQQRqIQAgBEEEaiIEIAFHDQALDAILIAAgByACIAYgBCAFELoBIAcgASACIAggBCAFELoBIAAgByABIAIgBiAIIAQgBRDNAg8LIAMgBUYNAANAIAAgAygCADYCACAAQQRqIQAgA0EEaiIDIAVHDQALCwuJAQEGfAJAIAMgAisDACIFIAErAyAgACsDICIGoaIgAisDCCIHIAErAxggACsDGCIIoaKhIgmZZARAIAUgASgCPCIAKwMgIAahoiAHIAArAxggCKGioSIEmSADZA0BIAUgASgCOCIAKwMgIAahoiAHIAArAxggCKGioSIEmSADZA0BCyAJIQQLIAQLpgICDHwDfwJAIAEoAjwiDigCOCABRw0AIAFBPGohDwNAIAEoAjgiECAORg0BIA4rAxgiAyABKwMYIgahIgcgB6IgDisDICIEIAErAyAiCKEiCSAJoqBEAAAAAAAAEECiIAArA5gBIgIgAqJjRQRAIAYgECsDGCIKoSIFIAQgECsDICIEoSILoiADIAqhIgMgCCAEoSIMoqEiDSANokQAAAAAAAAQQKIgAiACIAMgA6IgCyALoqAiAiAFIAWiIAwgDKKgIgUgAiAFZBuiomVFIAcgCiAGoaJEAAAAAAAAAACgIAQgCKEgCaKgRAAAAAAAAAAAZEVyDQILIAAgARCKBCAAIAEoAjgQvAEgDygCACIBQTxqIQ8gASABKAI8Ig4oAjhGDQALCwvuAQEGfwJAAkACQCAAKAIEIgIgACgCCCIDSQRAIAIgASgCADYCACACQQRqIQEMAQsgAiAAKAIAIgJrIgZBAnUiBUEBaiIEQYCAgIAETw0BIAZB/////wMgAyACayIDQQF1IgcgBCAEIAdJGyADQfz///8HTxsiBAR/IARBgICAgARPDQMgBEECdBAjBUEACyIHaiIDIAEoAgA2AgAgAyAFQQJ0ayEFIAYEQCAFIAIgBvwKAAALIAAgByAEQQJ0ajYCCCAAIANBBGoiATYCBCAAIAU2AgAgAkUNACACECILIAAgATYCBA8LECYACxByAAuOAgEEfwJAAkACQAJAIAMOAwICAAELAkAgAigCACICIAFBBGsiASgCACIDQQR0aiIEKAIEIgUgAiAAKAIAIgZBBHRqIgIoAgQiB0YEQCAEKAIAIAIoAgBIDQEMAwsgBSAHTg0CCyAAIAM2AgAgASAGNgIADwsgA0GAAUwEQCAAIAEgAhCqBA8LIAMgA0EBdiIHayEIIAAgB0ECdCIJaiEGIAMgBUoNASAAIAYgAiAHIAQQlQQgBiABIAIgCCAEIAlqIgEQlQQgBCABIAEgBCADQQJ0aiAAIAIQkQILDwsgACAGIAIgByAEIAUQvgEgBiABIAIgCCAEIAUQvgEgACAGIAEgAiAHIAggBCAFEOMCC10BA38jAEEQayIBJAAgAUEIaiAAQQAQKxAqIAEoAggoAlwCQCABKAIMIgBFDQAgACAAKAIEIgNBAWs2AgQgAw0AIAAgACgCACgCCBEAACAAECQLIAFBEGokAEEDbgtdAQN/IwBBEGsiASQAIAFBCGogAEEAECsQKiABKAIIKAJcAkAgASgCDCIARQ0AIAAgACgCBCIDQQFrNgIEIAMNACAAIAAoAgAoAggRAAAgABAkCyABQRBqJABBA0kLIgAgACABEE4gAEEIaiABQQhqEE4gAEEQaiABQRBqEE4gAAupAQIBfwF8QbSfAigCACIBQQBMBH8gAJkiACAAoEQYLURU+yEJQKJB6JUCKwMAo50hAEEERAAAAAAAgHZAQeCVAisDAKOdIgK9Qv///////////wCDQoCAgICAgID4/wBYBHwgAiAAIAKkIAC9Qv///////////wCDQoCAgICAgID4/wBWGwUgAAtEAAAAAAAACECg/AIiASABQQRvayIBIAFBBEwbBSABCwuOAgEEfwJAAkACQAJAIAMOAwICAAELAkAgAigCACICIAFBBGsiASgCACIDQQR0aiIEKAIEIgUgAiAAKAIAIgZBBHRqIgIoAgQiB0YEQCAEKAIAIAIoAgBIDQEMAwsgBSAHTg0CCyAAIAM2AgAgASAGNgIADwsgA0GAAUwEQCAAIAEgAhCqBA8LIAMgA0EBdiIHayEIIAAgB0ECdCIJaiEGIAMgBUoNASAAIAYgAiAHIAQQqQQgBiABIAIgCCAEIAlqIgEQqQQgBCABIAEgBCADQQJ0aiAAIAIQkQILDwsgACAGIAIgByAEIAUQwwEgBiABIAIgCCAEIAUQwwEgACAGIAEgAiAHIAggBCAFEOgCC9ECAQV/IwBBIGsiBSQAAkACQCAAKAIEIgIgACgCCCIDSQRAIAIgASkDEDcDECACIAEpAwg3AwggAiABKQMANwMAIAJBGGohAQwBCyACIAAoAgAiBGtBGG0iBkEBaiICQavVqtUATw0BIAVBDGpBqtWq1QAgAyAEa0EYbSIDQQF0IgQgAiACIARJGyADQdWq1SpPGyAGIAAQZCICKAIIIgMgASkDEDcDECADIAEpAwg3AwggAyABKQMANwMAIAIgA0EYajYCCCACKAIEIAAoAgQgACgCACIDayIBQWhtQRhsaiEEIAEEQCAEIAMgAfwKAAALIAAoAgAhAyAAIAQ2AgAgAiADNgIEIAAgAigCCCIBNgIEIAIgAzYCCCAAKAIIIQQgACACKAIMNgIIIAIgAzYCACACIAQ2AgwgAhCMAQsgACABNgIEIAVBIGokAA8LECYAC9gEAwV/AXwBfiMAQRBrIgYkAAJAAkACQCACDgMCAgABCyABQRBrIgErAwAgACsDAGRFDQEgBiAAKQMINwMIIAYgACkDADcDACAAIAEpAwg3AwggACABKQMANwMAIAEgBikDCDcDCCABIAYpAwA3AwAMAQsgAkGAAUwEQCAAIAFGDQEgAEEQaiIDIAFGDQEgACEEA0AgAyEFIAQrAxAiCiAEKwMAZARAIAQpAxghCyADIQIDQAJAIAIgBCIDKQMINwMIIAIgAykDADcDACAAIANGBEAgACEDDAELIAMhAiAKIANBEGsiBCsDAGQNAQsLIAMgCzcDCCADIAo5AwALIAEgBSIEQRBqIgNHDQALDAELIAIgAkEBdiIHayEIIAAgB0EEdCIJaiEFAkAgAiAETARAIAAgBSAHIAMQrwQgBSABIAggAyAJaiIBEK8EIAMgAkEEdGohBCABIQIDQCACIARGBEAgASADRg0EA0AgACADKQMINwMIIAAgAykDADcDACAAQRBqIQAgA0EQaiIDIAFHDQALDAQLAkAgAisDACADKwMAZARAIAAgAikDCDcDCCAAIAIpAwA3AwAgAkEQaiECDAELIAAgAykDCDcDCCAAIAMpAwA3AwAgA0EQaiEDCyAAQRBqIQAgASADRw0ACwwBCyAAIAUgByADIAQQxQEgBSABIAggAyAEEMUBIAAgBSABIAcgCCADIAQQ6wIMAQsgAiAERg0AA0AgACACKQMINwMIIAAgAikDADcDACAAQRBqIQAgAkEQaiICIARHDQALCyAGQRBqJAALvQQCBH8BfgJAAkACQCADDgMCAgABCyACKAIAKAIAIgIgAUEEayIBKAIAIgNBA3RqKQMAIAIgACgCACIEQQN0aikDAFoNASAAIAM2AgAgASAENgIADwsgA0GAAUwEQCAAIAFGDQEgAEEEaiIEIAFGDQEgAigCACgCACEGIAAhAwNAIAQiByECIAYgAygCBCIIQQN0aikDACIKIAYgAygCACIFQQN0aikDAFQEQANAAkAgAiAFNgIAIAAgAyIERgRAIAAhBAwBCyAEIQIgCiAGIARBBGsiAygCACIFQQN0aikDAFQNAQsLIAQgCDYCAAsgByIDQQRqIgQgAUcNAAsMAQsgAyADQQF2IgZrIQggACAGQQJ0IglqIQcCQCADIAVMBEAgACAHIAIgBiAEEK4EIAcgASACIAggBCAJaiIBEK4EIAQgA0ECdGohBSACKAIAIQcgASEDA0AgAyAFRwRAIAAgAygCACICIAQoAgAiBiAHKAIAIgggAkEDdGopAwAgCCAGQQN0aikDAFQiAhs2AgAgA0EEQQAgAhtqIQMgAEEEaiEAIAEgBEEAQQQgAhtqIgRHDQEMAwsLIAEgBEYNAgNAIAAgBCgCADYCACAAQQRqIQAgBEEEaiIEIAFHDQALDAILIAAgByACIAYgBCAFEMYBIAcgASACIAggBCAFEMYBIAAgByABIAIgBiAIIAQgBRDqAg8LIAMgBUYNAANAIAAgAygCADYCACAAQQRqIQAgA0EEaiIDIAVHDQALCwspAQF/IAAoAggQxQQgACgCACEBIABBADYCACABBEAgACgCBBogARAiCwuRAgECfwJAIAAoAgQiAyAAKAIIIgRPBEAgACAEQQF0QYABIAQbECUgACgCACAAKAIEIgNBAnRqIAE2AgAMAQsgACgCACADQQJ0aiABNgIACyAAIANBAWo2AgQgAEEQaiEBAkAgACgCFCIDIAAoAhgiBE8EQCABIARBAXRBgAEgBBsQJSAAKAIQIAAoAhQiA0ECdGpBfzYCAAwBCyABKAIAIANBAnRqQX82AgALIAAgA0EBajYCFCAAQSBqIQECQCAAKAIkIgMgACgCKCIETwRAIAEgBEEBdEGAASAEGxAlIAAoAiAgACgCJCIDQQJ0aiACNgIADAELIAEoAgAgA0ECdGogAjYCAAsgACADQQFqNgIkC4gBAQN/IAAoAgQhAiAAIAEQJSAAIAE2AgQgAkERSSACIAFBAXQiBE1yRQRAIAAQLQsgACgCFCECIABBEGoiAyABECUgACABNgIUIAJBEUkgAiAETXJFBEAgAxAtCyAAKAIkIQIgAEEgaiIDIAEQJSAAIAE2AiQgAkERSSACIARNckUEQCADEC0LC6wCAgR8AX8CQAJAIAErAwAiAyACKwMAIgRhBEAgASsDECIFIAErAwgiAyADIAIrAwgiBGEiBxsgAisDECIGIAQgBxtiBEAgB0UNAwwCCyABKwMYIgMgAisDGCIEYg0CIAErAygiBSABKwMgIgMgAyACKwMgIgRhIgcbIAIrAygiBiAEIAcbYgRAIAdFDQMMAgsgASsDMCIDIAIrAzAiBGINAiABKwNAIgUgASsDOCIDIAMgAisDOCIEYSIHGyACKwNAIgYgBCAHG2IEQCAHRQ0DDAILIAErA0giAyACKwNIIgRiDQIgASsDUCIDIAIrA1AiBGINAiAAIAErA1g5AwAgACACKwNYOQMIDwsMAQsgACAGOQMIIAAgBTkDAA8LIAAgBDkDCCAAIAM5AwAL2AYDBX8CfAF+IwBBIGsiBiQAAkACQAJAIAIOAwICAAELIAFBGGsiAisDACIKIAArAwAiC2NFBEAgCiALYg0CIAFBDGsoAgAgACgCDE4NAgsgBiAAKQMQNwMYIAYgACkDCDcDECAGIAApAwA3AwggACACKQMQNwMQIAAgAikDCDcDCCAAIAIpAwA3AwAgAiAGKQMYNwMQIAIgBikDEDcDCCACIAYpAwg3AwAMAQsgAkGAAUwEQCAAIAFGDQEgAEEYaiICIAFGDQEgACEEA0AgBCEDIAIhBAJAAkAgAysDGCIKIAMrAwAiC2MEQCADKAIkIQUMAQsgCiALYg0BIAMoAiQiBSADKAIMTg0BCyADKQMoIQwgAygCICEHIAQgAykDEDcDECAEIAMpAwg3AwggBCADKQMANwMAAn8gACAAIANGDQAaAkADQCAKIANBGGsiAisDACILY0UEQCAKIAtiDQIgBSADQQxrKAIATg0CCyADIAIpAxA3AxAgAyACKQMINwMIIAMgAikDADcDACACIgMgAEcNAAsgAAwBCyADCyICIAw3AxAgAiAFNgIMIAIgBzYCCCACIAo5AwALIAEgBEEYaiICRw0ACwwBCyACIAJBAXYiB2shCCAAIAdBGGwiCWohBQJAIAIgBEwEQCAAIAUgByADEOAEIAUgASAIIAMgCWoiARDgBCADIAJBGGxqIQQgASECA0AgAiAERgRAIAEgA0YNBANAIAAgAykDEDcDECAAIAMpAwg3AwggACADKQMANwMAIABBGGohACADQRhqIgMgAUcNAAsMBAsCQAJAIAIrAwAiCiADKwMAIgtjRQRAIAogC2INASACKAIMIAMoAgxODQELIAAgAikDEDcDECAAIAIpAwg3AwggACACKQMANwMAIAJBGGohAgwBCyAAIAMpAxA3AxAgACADKQMINwMIIAAgAykDADcDACADQRhqIQMLIABBGGohACABIANHDQALDAELIAAgBSAHIAMgBBDLASAFIAEgCCADIAQQywEgACAFIAEgByAIIAMgBBCCAwwBCyACIARGDQADQCAAIAIpAxA3AxAgACACKQMINwMIIAAgAikDADcDACAAQRhqIQAgAkEYaiICIARHDQALCyAGQSBqJAALVgEDfyABIABrIgJBGG0hAwJAIAJBgRhOBEAgAyECA0AgAkEYbBBQIgQNAiACQQF2IgINAAsLIAAgASADQQBBABDLAQ8LIAAgASADIAQgAhDLASAEECILOAEBfyAABEAgACgCABDNASAAKAIEEM0BIAAoAhQiAQRAIAAgATYCGCAAKAIcGiABECILIAAQIgsL8gECCHwCfyABKwMAIQYgAisDACEHIAAgASsDCCIFIAMrAwgiCCACKwMIIgkgBaEiC5kgBCsDCCIKIAihIgyZYyIOGyAJIAogDhsgCCAFoSIFmSAKIAmhIgiZYyINGyALIAwgDhsgBSAIIA0bIAUgCKGjIgVEAAAAAAAAAAAgBb1C////////////AINCgICAgICAgPj/AFQbIgWioDkDCCAAIAYgByANGyAHIAahIAWioDkDACAAIAErAxAiBiACKwMQIgcgDRsgBSAHIAahoqA5AxAgACADKwMQIgYgBCsDECIHIA0bIAUgByAGoaKgOQMYC4UEAgZ/An0gAigCACEGIAACfwJAIAEoAgQiBEUNACABKAIAAn8gBEEBayAGcSAEaSIFQQFNDQAaIAYgBCAGSw0AGiAGIARwCyIHQQJ0aigCACICRQ0AIAIoAgAiAkUNACAEQQFrIQggBUEBSyEJA0ACQCAGIAIoAgQiBUcEQAJAIAlFBEAgBSAIcSEFDAELIAQgBUsNACAFIARwIQULIAUgB0cNAwwBCyACKAIIIAZHDQBBAAwDCyACKAIAIgINAAsLQQwQIyICIAY2AgQgAkEANgIAIAIgAygCADYCCAJAQQAgBCABKAIMQQFqsyIKIAEqAhAiCyAEs5ReGw0AIAEgBCAEQQFrcUEARyAEQQNJciAEQQF0ciIDIAogC5WN/AEiByADIAdLGxBwIAEoAgQiBCAEQQFrIgNxRQRAIAMgBnEhBwwBCyAEIAZLBEAgBiEHDAELIAYgBHAhBwsCQCABKAIAIgYgB0ECdGoiBygCACIDRQRAIAIgASgCCDYCACABIAI2AgggByABQQhqNgIAIAIoAgAiA0UNASADKAIEIQUCQCAEIARBAWsiA3FFBEAgAyAFcSEFDAELIAQgBUsNACAFIARwIQULIAYgBUECdGogAjYCAAwBCyACIAMoAgA2AgAgAyACNgIACyABIAEoAgxBAWo2AgxBAQs6AAQgACACNgIAC7wGAQl/AkACQAJAIAMOAwICAAELIAIoAgAoAgAiAyABQQRrIgEoAgAiBEEDdGoiBSACKAIEKAIAIgJBAnQiBmooAgAiByAGIAMgACgCACIGQQN0aiIDaigCACIITgRAIAcgCEcNAiAFQQEgAmtBAnQiAmooAgAgAiADaigCAE4NAgsgACAENgIAIAEgBjYCAAwBCyADQYABTARAIAAgAUYNASAAQQRqIgMgAUYNAUEBIAIoAgQoAgAiBGshCCACKAIAKAIAIQYgBEECdCEHIAAhBQNAIAUhBCADIQUCQCAGIAQoAgQiDEEDdGoiCSAHaigCACIDIAYgBCgCACICQQN0aiIKIAdqKAIAIgtOBEAgAyALRw0BIAkgCEECdCILaigCACAKIAtqKAIATg0BCyAEIAI2AgQCfyAAIAAgBEYNABogCSAIQQJ0IgpqIQkCQANAIAYgBEEEayICKAIAIgtBA3RqIg0gB2ooAgAiDiADTARAIAMgDkcNAiAJKAIAIAogDWooAgBODQILIAQgCzYCACACIgQgAEcNAAsgAAwBCyAECyAMNgIACyABIAVBBGoiA0cNAAsMAQsgAyADQQF2IgdrIQggACAHQQJ0IglqIQYCQCADIAVMBEAgACAGIAIgByAEEPIEIAYgASACIAggBCAJaiIBEPIEIAQgA0ECdGohBSACKAIEIQYgAigCACECIAEhAwNAIAMgBUYEQCABIARGDQQDQCAAIAQoAgA2AgAgAEEEaiEAIARBBGoiBCABRw0ACwwECwJAAkAgAigCACIHIAMoAgAiCEEDdGoiCSAGKAIAIgxBAnQiCmooAgAiCyAKIAcgBCgCACIKQQN0aiIHaigCACINTgRAIAsgDUcNASAJQQEgDGtBAnQiDGooAgAgByAMaigCAE4NAQsgACAINgIAIANBBGohAwwBCyAAIAo2AgAgBEEEaiEECyAAQQRqIQAgASAERw0ACwwBCyAAIAYgAiAHIAQgBRDQASAGIAEgAiAIIAQgBRDQASAAIAYgASACIAcgCCAEIAUQhQMPCyADIAVGDQADQCAAIAMoAgA2AgAgAEEEaiEAIANBBGoiAyAFRw0ACwsLvAYBCX8CQAJAAkAgAw4DAgIAAQsgAigCACgCACIDIAFBBGsiASgCACIEQQN0aiIFIAIoAgQoAgAiAkECdCIGaigCACIHIAYgAyAAKAIAIgZBA3RqIgNqKAIAIghOBEAgByAIRw0CIAVBASACa0ECdCICaigCACACIANqKAIATg0CCyAAIAQ2AgAgASAGNgIADAELIANBgAFMBEAgACABRg0BIABBBGoiAyABRg0BQQEgAigCBCgCACIEayEIIAIoAgAoAgAhBiAEQQJ0IQcgACEFA0AgBSEEIAMhBQJAIAYgBCgCBCIMQQN0aiIJIAdqKAIAIgMgBiAEKAIAIgJBA3RqIgogB2ooAgAiC04EQCADIAtHDQEgCSAIQQJ0IgtqKAIAIAogC2ooAgBODQELIAQgAjYCBAJ/IAAgACAERg0AGiAJIAhBAnQiCmohCQJAA0AgBiAEQQRrIgIoAgAiC0EDdGoiDSAHaigCACIOIANMBEAgAyAORw0CIAkoAgAgCiANaigCAE4NAgsgBCALNgIAIAIiBCAARw0ACyAADAELIAQLIAw2AgALIAEgBUEEaiIDRw0ACwwBCyADIANBAXYiB2shCCAAIAdBAnQiCWohBgJAIAMgBUwEQCAAIAYgAiAHIAQQ9AQgBiABIAIgCCAEIAlqIgEQ9AQgBCADQQJ0aiEFIAIoAgQhBiACKAIAIQIgASEDA0AgAyAFRgRAIAEgBEYNBANAIAAgBCgCADYCACAAQQRqIQAgBEEEaiIEIAFHDQALDAQLAkACQCACKAIAIgcgAygCACIIQQN0aiIJIAYoAgAiDEECdCIKaigCACILIAogByAEKAIAIgpBA3RqIgdqKAIAIg1OBEAgCyANRw0BIAlBASAMa0ECdCIMaigCACAHIAxqKAIATg0BCyAAIAg2AgAgA0EEaiEDDAELIAAgCjYCACAEQQRqIQQLIABBBGohACABIARHDQALDAELIAAgBiACIAcgBCAFENEBIAYgASACIAggBCAFENEBIAAgBiABIAIgByAIIAQgBRCHAw8LIAMgBUYNAANAIAAgAygCADYCACAAQQRqIQAgA0EEaiIDIAVHDQALCwu8BgEJfwJAAkACQCADDgMCAgABCyACKAIAKAIAIgMgAUEEayIBKAIAIgRBA3RqIgUgAigCBCgCACICQQJ0IgZqKAIAIgcgBiADIAAoAgAiBkEDdGoiA2ooAgAiCE4EQCAHIAhHDQIgBUEBIAJrQQJ0IgJqKAIAIAIgA2ooAgBODQILIAAgBDYCACABIAY2AgAMAQsgA0GAAUwEQCAAIAFGDQEgAEEEaiIDIAFGDQFBASACKAIEKAIAIgRrIQggAigCACgCACEGIARBAnQhByAAIQUDQCAFIQQgAyEFAkAgBiAEKAIEIgxBA3RqIgkgB2ooAgAiAyAGIAQoAgAiAkEDdGoiCiAHaigCACILTgRAIAMgC0cNASAJIAhBAnQiC2ooAgAgCiALaigCAE4NAQsgBCACNgIEAn8gACAAIARGDQAaIAkgCEECdCIKaiEJAkADQCAGIARBBGsiAigCACILQQN0aiINIAdqKAIAIg4gA0wEQCADIA5HDQIgCSgCACAKIA1qKAIATg0CCyAEIAs2AgAgAiIEIABHDQALIAAMAQsgBAsgDDYCAAsgASAFQQRqIgNHDQALDAELIAMgA0EBdiIHayEIIAAgB0ECdCIJaiEGAkAgAyAFTARAIAAgBiACIAcgBBD2BCAGIAEgAiAIIAQgCWoiARD2BCAEIANBAnRqIQUgAigCBCEGIAIoAgAhAiABIQMDQCADIAVGBEAgASAERg0EA0AgACAEKAIANgIAIABBBGohACAEQQRqIgQgAUcNAAsMBAsCQAJAIAIoAgAiByADKAIAIghBA3RqIgkgBigCACIMQQJ0IgpqKAIAIgsgCiAHIAQoAgAiCkEDdGoiB2ooAgAiDU4EQCALIA1HDQEgCUEBIAxrQQJ0IgxqKAIAIAcgDGooAgBODQELIAAgCDYCACADQQRqIQMMAQsgACAKNgIAIARBBGohBAsgAEEEaiEAIAEgBEcNAAsMAQsgACAGIAIgByAEIAUQ0gEgBiABIAIgCCAEIAUQ0gEgACAGIAEgAiAHIAggBCAFEIkDDwsgAyAFRg0AA0AgACADKAIANgIAIABBBGohACADQQRqIgMgBUcNAAsLC7wGAQl/AkACQAJAIAMOAwICAAELIAIoAgAoAgAiAyABQQRrIgEoAgAiBEEDdGoiBSACKAIEKAIAIgJBAnQiBmooAgAiByAGIAMgACgCACIGQQN0aiIDaigCACIITgRAIAcgCEcNAiAFQQEgAmtBAnQiAmooAgAgAiADaigCAE4NAgsgACAENgIAIAEgBjYCAAwBCyADQYABTARAIAAgAUYNASAAQQRqIgMgAUYNAUEBIAIoAgQoAgAiBGshCCACKAIAKAIAIQYgBEECdCEHIAAhBQNAIAUhBCADIQUCQCAGIAQoAgQiDEEDdGoiCSAHaigCACIDIAYgBCgCACICQQN0aiIKIAdqKAIAIgtOBEAgAyALRw0BIAkgCEECdCILaigCACAKIAtqKAIATg0BCyAEIAI2AgQCfyAAIAAgBEYNABogCSAIQQJ0IgpqIQkCQANAIAYgBEEEayICKAIAIgtBA3RqIg0gB2ooAgAiDiADTARAIAMgDkcNAiAJKAIAIAogDWooAgBODQILIAQgCzYCACACIgQgAEcNAAsgAAwBCyAECyAMNgIACyABIAVBBGoiA0cNAAsMAQsgAyADQQF2IgdrIQggACAHQQJ0IglqIQYCQCADIAVMBEAgACAGIAIgByAEEPkEIAYgASACIAggBCAJaiIBEPkEIAQgA0ECdGohBSACKAIEIQYgAigCACECIAEhAwNAIAMgBUYEQCABIARGDQQDQCAAIAQoAgA2AgAgAEEEaiEAIARBBGoiBCABRw0ACwwECwJAAkAgAigCACIHIAMoAgAiCEEDdGoiCSAGKAIAIgxBAnQiCmooAgAiCyAKIAcgBCgCACIKQQN0aiIHaigCACINTgRAIAsgDUcNASAJQQEgDGtBAnQiDGooAgAgByAMaigCAE4NAQsgACAINgIAIANBBGohAwwBCyAAIAo2AgAgBEEEaiEECyAAQQRqIQAgASAERw0ACwwBCyAAIAYgAiAHIAQgBRDTASAGIAEgAiAIIAQgBRDTASAAIAYgASACIAcgCCAEIAUQiwMPCyADIAVGDQADQCAAIAMoAgA2AgAgAEEEaiEAIANBBGoiAyAFRw0ACwsL9AIBBX8gACgCBCAAKAIAIgJrQQN1IgMgAUkEQCMAQSBrIgUkAAJAAkACQCABIANrIgMgACgCCCIEIAAoAgQiAmtBA3VNBEAgACADBH8gA0EDdCIABEAgAkEAIAD8CwALIAAgAmoFIAILNgIEDAELIAIgACgCACICa0EDdSIGIANqIgFBgICAgAJPDQEgBUEMakH/////ASAEIAJrIgJBAnUiBCABIAEgBEkbIAJB+P///wdPGyAGIAAQSyIBKAIIIQIgA0EDdCIDBEAgAkEAIAP8CwALIAEgAiADajYCCCABKAIEIAAoAgQgACgCACIEayICayEDIAIEQCADIAQgAvwKAAALIAAoAgAhAiAAIAM2AgAgASACNgIEIAAgASgCCDYCBCABIAI2AgggACgCCCEDIAAgASgCDDYCCCABIAI2AgAgASADNgIMIAEQmQELIAVBIGokAAwBCxAmAAsPCyABIANJBEAgACACIAFBA3RqNgIECwtpAQR/IAAoAgQiBCAAKAIIIgFHBEADQCAAIAFBDGsiAjYCCCACKAIAIgMEfyABQQhrIAM2AgAgAUEEaygCABogAxAiIAAoAggFIAILIgEgBEcNAAsLIAAoAgAiAgRAIAAoAgwaIAIQIgsLRQECfyAAKAIEIgIgACgCCCIBRwRAIAAgASABIAJrQQxrIgJBDHAgAmtqQQxrNgIICyAAKAIAIgEEQCAAKAIMGiABECILC4sBAQN/IwBBEGsiAiQAIAJBCGoiAyABQfgQED8gAigCDCADEKoCIQMgAigCDCIEQQlPBEAgBBABCyAAQQA2AgggAEIANwIAIAAgAxB9IAIgACgCADYCBCACIAM2AgAgAkEIaiACEKQBIAIoAgwgASgCBBAUIAIoAgwiAEEJTwRAIAAQAQsgAkEQaiQAC5kBAQN8IAAgAKIiAyADIAOioiADRHzVz1o62eU9okTrnCuK5uVavqCiIAMgA0R9/rFX4x3HPqJE1WHBGaABKr+gokSm+BARERGBP6CgIQUgACADoiEEIAJFBEAgBCADIAWiRElVVVVVVcW/oKIgAKAPCyAAIAMgAUQAAAAAAADgP6IgBCAFoqGiIAGhIARESVVVVVVVxT+ioKELkgEBA3xEAAAAAAAA8D8gACAAoiICRAAAAAAAAOA/oiIDoSIERAAAAAAAAPA/IAShIAOhIAIgAiACIAJEkBXLGaAB+j6iRHdRwRZswVa/oKJETFVVVVVVpT+goiACIAKiIgMgA6IgAiACRNQ4iL7p+qi9okTEsbS9nu4hPqCiRK1SnIBPfpK+oKKgoiAAIAGioaCgC7YHAgh/Bn4jAEEwayIDJAAgACEFAkADQCACIQkCQAJAIAEgASgCECICRg0AIAEoAhQgAkYNACAFKQMIIQogASEEAkADQCAEKQMIIg0gClINASAEKAIQIgQgAUcNAAsgBCkDCCENCyAKIA1RDQAgCiANVSEHQQAhBiAKIQwgBCECA0AgBSkDACEOIAIoAhAhAgJAAkACQAJAAkADQAJAIAIgBEYNAAJAIAdBAXEEQANAIAIpAwggDFkNAiACKAIQIgIgBEcNAAwCCwALA0AgAikDCCAMVw0BIAIoAhAiAiAERw0ACwsgAiAERg0AIAIpAwAhCyACKQMIIAxSDQIgCyAOUQ0DIAIoAhQiCCkDCCAMUQRAIA4gCCkDAFMgCyAOV0YNBAsgAigCECICIARHDQELCyAHQQFxIAogDVVHBH8gAigCFCACIAUQhwEiAkUNAkEBIAZrIAYgByACQQBOc0EBcRsFIAYLDQQMBgsgDiACKAIUIggpAwAiD1MgCyAOVXENAiAOIA9XIAsgDllyRQRAQQEgBmshBgwDCyAIIAIgBRCHASIIDQELIAkhAgwFC0EBIAZrIAYgByAIQQBOc0EBcRshBiAFKQMIIQwLIAdBAXMhBwwBCwtBASECIAlBAUYNAwwBC0ECIQIgCUECRw0AQQAhAgwCCyAFKAIQIgUgAEcNAAsgA0EUaiAAELsDIANBCGogARC7A0EAIQICQCADKAIUIgQgAygCGCIBRg0AQQAhBQJAA0ACQAJAAkAgBCADQQhqELoDIgBBAWsOAgEAAgtBACECIAVBAkYNBCAAIQUgBEEQaiIEIAFHDQIMBAtBASECIAVBAUYNAyAAIQUgBEEQaiIEIAFHDQEMAgsgBEEQaiIEIAFHDQALQQAhAiAFQQFHDQELAn4gAygCFCICIAMoAhgiAEYEQEIAIQtCAAwBC0KAgICAgICAgIB/IQtC////////////ACENQv///////////wAhDEKAgICAgICAgIB/IQ8DQCACKQMIIgogCyAKIAtVGyELIAogDCAKIAxTGyEMIAIpAwAiCiAPIAogD1UbIQ8gCiANIAogDVMbIQ0gAkEQaiICIABHDQALIAsgDHxCAn8hCyANIA98QgJ/CyEKIAMgCzcDKCADIAo3AyAgA0EgaiADQQhqELoDQQFGIQILIAMoAggiAARAIAMgADYCDCADKAIQGiAAECILIAMoAhQiAEUNACADIAA2AhggAygCHBogABAiCyADQTBqJAAgAgvdAgEGfyMAQSBrIgYkAEHQABAjIgRBAEHQAPwLACAEIAAoAoQBIgEgACgCgAEiA2tBAnUiAjYCAAJAAkAgACgCiAEiBSABSwRAIAEgBDYCACABQQRqIQMMAQsgAkEBaiIBQYCAgIAETw0BIAZBDGpB/////wMgBSADayIDQQF1IgUgASABIAVJGyADQfz///8HTxsgAiAAQYABahBKIgEoAggiAiAENgIAIAEgAkEEajYCCCABKAIEIAAoAoQBIAAoAoABIgVrIgJrIQMgAgRAIAMgBSAC/AoAAAsgACgCgAEhAiAAIAM2AoABIAEgAjYCBCAAIAEoAggiAzYChAEgASACNgIIIAAoAogBIQUgACABKAIMNgKIASABIAI2AgAgASAFNgIMIAEQUwsgACADNgKEASAEQQA6AEwgBEEANgIEIARCADcDECAEQQA2AhggBkEgaiQAIAQPCxAmAAv8CgIKfwJ+AkACQAJAAkACQCAALQB8QQFHDQAgAigCWC0ACCEFAkAgASgCWC0ACEUEQCAFQQFxRQ0CIAIhBCABIQIMAQsgASEEIAVBAXENAgsgAigCYARAIAAgAiADEH4LIAIoAjQiASABQR91IgVzIAVrQQFHDQECQCAAKAIEQQJGBEAgAigCPA0BDAMLIAIoAlgoAgRFDQILAkACQAJAIAAoAghBAmsOAgABAgsgAUEBRg0BDAMLIAFBf0cNAgsgBCgCPARAIAQgAxBjGgJAIAQoAjwiACgCCCAERgRAIABBADYCCAwBCyAAQQA2AgwLIARBADYCPA8LAkAgAykDACAEKAJYKAIAIgEpAwBSDQAgAykDCCABKQMIUg0AIAEtABhBA3ENAAJAAn8CQAJAIAQoAkQiAUUNACAEKAJYIQIDQCABKAJYIAJGDQIgASkDCCIOIAEpAxhSBEAgBCkDACABKQMAUg0CIAQpAwggDlINAgsgASgCRCIBDQALC0EAIQEgBCgCQCICRQ0AIAQoAlghBQNAIAIgBSACKAJYRg0CGiACKQMIIg4gAikDGFIEQCAEKQMAIAIpAwBSDQIgBCkDCCAOUg0CCyACKAJAIgINAAsLIAELIgFFDQAgASgCPCICRQ0AIAQgAjYCPCABKAI8IQAgBCgCMEEASgRAIAAgATYCDCAAIAQ2AggPCyAAIAQ2AgwgACABNgIIDwsMAwsMAgsgASgCYARAIAAgASADEH4LIAIoAmAEQCAAIAIgAxB+CyAAKAIIIQUCQAJAAkACQAJAIAEoAlgoAgQiByACKAJYKAIEIgpGBEAgASgCNCEEIAVFBEAgASACKAI0NgI0IAIgBDYCNAwECyABIAIoAjAgBGoiBkEAIARrIAYbNgI0IAIoAjQiBCABKAIwIgZHDQEgAkEAIARrNgI0DAILIAUEQCABIAEoAjggAigCMGo2AjggAiACKAI4IAEoAjBrNgI4DAILIAEgASgCOEU2AjggAiACKAI4RTYCOAwCCyACIAQgBms2AjQLQQEhBiAFQQFLDQELIAIoAjQiBCAEQR91IgRzIARrIQggASgCNCIEIARBH3UiBHMgBGshBEEBIQsMAQsgASgCNCEEAn8gACgCDCAFRgRAIAIoAjQMAQtBACAEayEEQQAgAigCNGsLIQggBSEGCyAEQQFLIgwgASgCPCIFRXENACAIQQFLIg0gAigCPCIJRXENACAFBEAgCQRAAkAgDCANckUEQCAHIApGDQEgACgCBEEERg0BCyAAIAEgAiADEIYBDwsCQCAFIAlHBEAgASAFKAIIRw0BCyAAIAEgAiADEIYBDAULIAEgAxBjGgwFCyABIAMQYxogASACEL8DDwsgCQ0DAn4gCwRAIAIoAjgiBSAFQR91IgVzIAVrrSEOIAEoAjgiBSAFQR91IgVzIAVrrQwBCyABKAI4IQUgACgCDCAGRgRAIAI0AjghDiAFrAwBC0EAIAIoAjhrrCEOQQAgBWusCyEPIAcgCkcNAiAEQQFHIAhBAUdyDQACQAJAAkAgACgCBEECaw4DAAEFAgsgD0IAVSAOQgBVcg0CDAQLIA5CAFUiBCAHQQFHIA9CAFdyRXFBASAEIAcgD0IAVXJyG0UNAQwDCyAPQgBXIA5CAFdyDQAgACABIAIgA0EAEN0BCw8LIAAQ2wEiAUEBOgBMIAFBACAEIAQoAjBBAEoiABs2AgwgASAEQQAgABs2AgggBCABNgI8QSAQIyIAIAMpAwg3AwggACADKQMANwMAIABBADYCHCAAIAE2AhggACAANgIUIAAgADYCECABIAA2AhAPCyAAIAEgAiADQQAQ3QEPCyACIAMQYxogASACEL8DC9sCAQR/IAEgABDbASIFNgI8IAIgBTYCPAJAAkACQCABKAJYLQAIQQFGBEAgBUEBOgBMIAVBADYCBCABKAIwQQBMDQEMAgsCQCABKAJAIgcEQANAIAcoAlgtAAhFBEAgBygCPCIGDQMLIAcoAkAiBw0ACwsgBUEANgIEIAQNAgwBCyAALQAZQQFGBEACQCAGKAIEIgBFDQADQCAAKAIQBEAgACEIDAILIAAoAgQiAA0ACwsgBiAINgIEAkAgBSAGRwRAIAYhAANAIAAoAgQiAEEAIAAgBUcbDQALIABFDQELIAYgBSgCBDYCBAsgBSAGNgIECyAEIAcgBigCCEZzDQELIAUgATYCDCAFIAI2AggMAQsgBSACNgIMIAUgATYCCAtBIBAjIgAgAykDCDcDCCAAIAMpAwA3AwAgAEEANgIcIAAgBTYCGCAAIAA2AhQgACAANgIQIAUgADYCEAuAAgEFfyAAKAIcIgEEQANAIAAgASgCRDYCHCABECIgACgCHCIBDQALCyAAQUBrEEUgAEEANgJIIABCADcDQCAAIAAoAlA2AlQgACgCgAEiBCAAKAKEASIFRwRAA0AgBCgCACICKAIQIgEEQCABKAIUQQA2AhADQCABKAIQIAEQIiIBDQALIAJBADYCEAsgAigCGCIBBEAgASgCACIDBEAgASADNgIEIAEoAggaIAMQIgsgARAiCyACKAJAIgEEQCACIAE2AkQgAigCSBogARAiCyACECIgBEEEaiIEIAVHDQALCyAAQYABakEAEH0gACAAKAJcNgJgIAAgACgCaDYCbAupEAIMfwF8IwBBIGsiAiQAIABBBGoiBkEAQfwA/AsAIAJBFGogAUGHDxA/IAIoAhghBSMAQRBrIgMkAEGQnwItAABBAXFFBEBBAkGEjAJBAxAGIQRBkJ8CQQE6AABBjJ8CIAQ2AgALIAIoAhgiBEEJTwRAIAQQEwsgAyAENgIIIANBADYCBEGMnwIoAgAgBUEAIANBBGogA0EIahAFIQ4gAygCBCIEBEAgBBAECyADQRBqJAAgACAO/AI2AgAgAigCGCIDQQlPBEAgAxABCyACQQxqIgMgAUGwChA/IAJBFGogAxDXASAAQRBqEEUgACACKAIUNgIQIAAgAigCGDYCFCAAIAIoAhw2AhggAkEANgIcIAJCADcCFCACKAIQIgNBCU8EQCADEAELIAJBDGoiAyABQaUMED8gAkEUaiADEJsDIAYQRSAAIAIoAhQ2AgQgACACKAIYNgIIIAAgAigCHDYCDCACQQA2AhwgAkIANwIUIAIoAhAiA0EJTwRAIAMQAQsgAkEUaiABQaQJED8gAigCGEECEA4hAyACKAIYIgRBCU8EQCAEEAELAkAgAw0AIAJBDGoiAyABQaQJED8gAkEUaiADENcBIABBHGoQRSAAIAIoAhQ2AhwgACACKAIYNgIgIAAgAigCHDYCJCACQQA2AhwgAkIANwIUIAIoAhAiA0EJSQ0AIAMQAQsgAkEUaiABQZAJED8gAigCGEECEA4hAyACKAIYIgRBCU8EQCAEEAELAkAgAw0AIAJBDGoiAyABQZAJED8gAkEUaiADENcBIABBKGoQRSAAIAIoAhQ2AiggACACKAIYNgIsIAAgAigCHDYCMCACQQA2AhwgAkIANwIUIAIoAhAiA0EJSQ0AIAMQAQsgAkEUaiABQbUIED8gAigCGEECEA4hAyACKAIYIgRBCU8EQCAEEAELAkAgAw0AIAJBDGoiAyABQbUIED8gAkEUaiADENcBIABBNGoQRSAAIAIoAhQ2AjQgACACKAIYNgI4IAAgAigCHDYCPCACQQA2AhwgAkIANwIUIAIoAhAiA0EJSQ0AIAMQAQsgAkEUaiABQasZED8gAigCGEECEA4hAyACKAIYIgRBCU8EQCAEEAELAkAgAw0AIAJBDGoiAyABQasZED8gAkEUaiADENcBIABBQGsQRSAAIAIoAhQ2AkAgACACKAIYNgJEIAAgAigCHDYCSCACQQA2AhwgAkIANwIUIAIoAhAiA0EJSQ0AIAMQAQsgAkEUaiABQbkZED8gAigCGEECEA4hAyACKAIYIgRBCU8EQCAEEAELAkAgAw0AIAJBDGoiAyABQbkZED8gAkEUaiADENcBIABB5ABqEEUgACACKAIUNgJkIAAgAigCGDYCaCAAIAIoAhw2AmwgAkEANgIcIAJCADcCFCACKAIQIgNBCUkNACADEAELIAJBFGogAUG/CRA/IAIoAhhBAhAOIQMgAigCGCIEQQlPBEAgBBABCwJAIAMNACACQQxqIgMgAUG/CRA/IAJBFGogAxCbAyAAQfAAahBFIAAgAigCFDYCcCAAIAIoAhg2AnQgACACKAIcNgJ4IAJBADYCHCACQgA3AhQgAigCECIDQQlJDQAgAxABCyACQRRqIAFBhBAQPyACKAIYQQIQDiEDIAIoAhgiBEEJTwRAIAQQAQsCQCADDQAgAkEMaiIDIAFBhBAQPyACQRRqIAMQmwMgAEHMAGoQRSAAIAIoAhQ2AkwgACACKAIYNgJQIAAgAigCHDYCVCACQQA2AhwgAkIANwIUIAIoAhAiA0EJSQ0AIAMQAQsgAkEUaiABQZwMED8gAigCGEECEA4hAyACKAIYIgRBCU8EQCAEEAELAkAgAw0AIAJBDGoiCyABQZwMED8jAEEQayIDJAAgA0EIaiIEIAtB+BAQPyADKAIMIAQQqgIhBiADKAIMIgRBCU8EQCAEEAELIAJBADYCHCACQgA3AhQCQCACKAIYIAIoAhQiBWsiBCAGSQRAIAYgBGsiBCACKAIcIgcgAigCGCIFa00EQCACIAQEfyAEBEAgBUEAIAT8CwALIAQgBWoFIAULNgIYDAILIAUgAigCFCIJayIKIARqIghBAE4EQEEAIQVB/////wcgByAJayIHQQF0IgwgCCAIIAxJGyAHQf////8DTxsiCARAIAgQIyEFCyAFIApqIQcgBARAIAdBACAE/AsACyAKBEAgBSAJIAr8CgAACyACIAUgCGo2AhwgAiAEIAdqNgIYIAIgBTYCFCAJBEAgCRAiCwwCCxAmAAsgBCAGSwRAIAIgBSAGajYCGAsLIAMgAigCFDYCBCADIAY2AgAgA0EIaiADEN8DIAMoAgwgCygCBBAUIAMoAgwiBEEJTwRAIAQQAQsgA0EQaiQAIABB2ABqEEUgACACKAIUNgJYIAAgAigCGDYCXCAAIAIoAhw2AmAgAkEANgIcIAJCADcCFCACKAIQIgNBCUkNACADEAELIAJBFGogAUG1FhA/IAIoAhhBAhAOIQMgAigCGCIEQQlPBEAgBBABCwJAIAMNACACQRRqIAFBtRYQPyAAIAIoAhghAyMAQRBrIgAkAEGgnwItAABBAXFFBEBBAkGUjAJBAxAGIQFBoJ8CQQE6AABBnJ8CIAE2AgALIAIoAhgiAUEJTwRAIAEQEwsgACABNgIIIABBADYCBEGcnwIoAgAgA0EAIABBBGogAEEIahAFIAAoAgQiAQRAIAEQBAsgAEEQaiQAtjgCfCACKAIYIgBBCUkNACAAEAELIAJBIGokAAuUAwICfw98IwBBgAFrIgMkACABKAIAGiAAEOMBIAErAxAhBSABKwMYIQYgASsDICEHIAErAyghCCABKwMwIQkgASsDOCEKIANCgICAgICAgPg/NwNIIAMgCjkDQCADIAk5AzggA0IANwMwIAMgCDkDKCADIAc5AyAgA0IANwMYIAMgBjkDECADIAU5AwggAysDGCEIIAMrAwghCSADKwMQIQogAysDMCELIAMrAyAhDCADKwMoIQ0gAisDICEFIAIrAwAhBiACKwMQIQcgA0HQAGoiBCACKwMIIg4gAysDOCIRoiACKwMYIg8gAysDQCISoqAgAisDKCIQIAMrA0giE6KgOQMoIAQgBiARoiAHIBKioCAFIBOioDkDICAEIA4gDKIgDyANoqAgECALoqA5AxggBCAGIAyiIAcgDaKgIAUgC6KgOQMQIAQgCSAOoiAKIA+ioCAIIBCioDkDCCAEIAkgBqIgCiAHoqAgCCAFoqA5AwAgAEEQaiAEQTD8CgAAIABBCGogAUEIahBeIANBgAFqJAALRAIBfwF8IwBBEGsiAiQAIAIgASAAKwOQASIDIAMgAEH4AGoQwgIgACACQQEQwAIgAiACNgIMIAJBDGoQKSACQRBqJAALwwIBBH8gACABIAJBABD/AQRAIwBBEGsiAiQAIAMQsQEgAyAAKAKEASAAKAKAAWtBAnUQViAEBEAgBBCxASAEIAAoAoQBIAAoAoABa0ECdRBWCyAAKAKEASIGIAAoAoABIgFHBEADQCABIAdBAnRqKAIAIgUoAhAiCARAIAJBADYCDCACQgA3AgQCQAJAAkAgBEUNACAFLQBMQQFHDQAgBCEBIAggAC0AdUEBIAJBBGogACsDmAEQugINAQwCCyAAIAUQvQIgAyEBIAUoAhAgAC0AdUEAIAJBBGogACsDmAEQugJFDQELIAEgAkEEahBoCyACKAIEIgEEQCACIAE2AgggAigCDBogARAiCyAAKAKEASEGIAAoAoABIQELIAdBAWoiByAGIAFrQQJ1SQ0ACwsgAkEQaiQACyAAEN4BIAAtAH0aC/4CAQZ/IwBBIGsiAiQAQSQQIyIBQgA3AgwgAUGElgI2AgAgAUIANwIEIAFCADcCFCABQgA3AhwgAEIANwMYIABCgICAgICAgPg/NwMQIABCADcDCCAAIAE2AgQgACABQQxqNgIAIABCADcDICAAQgA3AzAgAEKAgICAgICA+D83AyggAEIANwM4IAJBADYCECACQgA3AghBGBAjIgNBtJoCNgIAIANCADcCBCMAQRBrIgEkACABIAIoAggiBTYCACABIAIoAgwiBjYCBCABIAIoAhA2AgggAkEANgIQIAJCADcCCCADQQxqIgRBADYCCCAEQgA3AgAgBCAFIAYgBiAFa0EMbRBHIAEgATYCDCABQQxqECkgAUEQaiQAIAIgAzYCGCACIAQ2AhQgAEEIaiACQRRqEE4CQCACKAIYIgBFDQAgACAAKAIEIgFBAWs2AgQgAQ0AIAAgACgCACgCCBEAACAAECQLIAIgAkEIajYCHCACQRxqECkgAkEgaiQAC64BAQN/IAACfwJAIAEoAgQiBEUEQCABQQRqIgUhAgwBCyACKAIAIQYDQCAEIgIoAhAiBSAGSgRAIAQhBSAEKAIAIgQNAQwCC0EAIAUgBk4NAhogAigCBCIEDQALIAJBBGohBQtBOBAjIQQgAygCACgCACEDIARCADcDGCAEIAM2AhAgBEIANwMgIARCADcDKCAEQgA3AzAgASACIAUgBBCCAUEBCzoABCAAIAQ2AgAL5QEBEXwgACABKwMQIgMgA6IiCSABKwMYIgQgBKIiDSABKwMAIgUgBaIiDqEiDyABKwMIIgYgBqIiCqGgIAIrAxAiC6IgAisDACIMIAUgA6IiECAEIAaiIhGhIgcgB6CiIAIrAwgiByAEIAWiIgggBiADoiISoCITIBOgoqCgOQMQIAAgCyASIAihIgggCKCiIAcgCiAPoCAJoaIgDCAFIAaiIgUgBCADoiIDoCIEIASgoqCgOQMIIAAgCyARIBCgIgQgBKCiIAwgDSAOoCAKoSAJoaIgByAFIAOhIgMgA6CioKA5AwALKAAgACgCvAFFBEBBAA8LIAAoArgBIAFBBXRqKwMYRAAAAAAAAAAAYwuDAwIFfwp8IwBBMGsiBCQAIAEoAkgiBSADQQJ0IgYgASgCWGoiB0F4QQQgAyADQQNtIghBA2xrQQJGG2ooAgBBGGxqIgMrAxAhCyADKwMAIQkgBSAHKAIAQRhsaiIFKwMQIQogBSsDACEMIAQgAysDCCAFKwMIoSIQOQMgIAQgCSAMoSIMOQMYIAQgCyAKoSINOQMoIAQgAisDCCILIA0gASgCqAEiBSAIQRhsaiIDKwMIIAUgASgCaCAGaigCAEEDbUEYbGoiASsDCKAiCiALIAMrAwAgASsDAKAiDiACKwMAIgmiRAAAAAAAAAAAoCAKIAuioCADKwMQIAErAxCgIg8gAisDECIKoqBEAAAAAAAAAABjIgEbIhGiIBAgDyAKIAEbIg+ioSISoiAJIAwgD6IgDSAOIAkgARsiDaKhIg6ioTkDECAEIAkgECANoiAMIBGioSIJoiAKIBKioTkDCCAEIAogDqIgCyAJoqE5AwAgACAEIARBGGoQnAEgBEEwaiQAC7kBAQJ/IwBBIGsiBCQAIARBEGogARCKASAEKAIQIQEgBEEIaiIFIAIQigEgBEEYaiABIAUgAyABKAIAKAIQEQUAIAQgBCkCGDcDACAAIAQQQwJAIAQoAgwiAEUNACAAIAAoAgQiAUEBazYCBCABDQAgACAAKAIAKAIIEQAAIAAQJAsCQCAEKAIUIgBFDQAgACAAKAIEIgFBAWs2AgQgAQ0AIAAgACgCACgCCBEAACAAECQLIARBIGokAAusAgICfwJ8IwBBIGsiAyQAIANBEGogARCKASADKAIQIQQjAEHgAGsiASQAIAFCADcDCCABQoCAgICAgID4PzcDACABQgA3AxAgAUIANwMYIAFCADcDKCABQoCAgICAgID4PzcDICABQgA3AzAgAUIANwM4IAFCgICAgICAgPg/NwNAIAIrAwAhBSACKwMIIQYgASACKwMQRAAAAAAAAAAAoDkDWCABIAZEAAAAAAAAAACgOQNQIAEgBUQAAAAAAAAAAKA5A0ggA0EYaiAEIAEgBCgCACgCBBEDACABQeAAaiQAIAMgAykCGDcDCCAAIANBCGoQQwJAIAMoAhQiAEUNACAAIAAoAgQiAUEBazYCBCABDQAgACAAKAIAKAIIEQAAIAAQJAsgA0EgaiQAC4sBAQN/IwBBEGsiAiQAQagCECMiAUGgkAI2AgAgAUIANwIEIAFBEGoQOyEDIAFBCzYCVCACIAE2AgwgAiADNgIIIAEgASgCBEEBajYCBCACIAIpAgg3AwAgACACEEgaIAEgASgCBCIAQQFrNgIEIABFBEAgASABKAIAKAIIEQAAIAEQJAsgAkEQaiQAC3MBAn8jAEEQayICJABBJBAjIgFCADcCDCABQYSWAjYCACABQgA3AgQgAUIANwIUIAFCADcCHCAAIAE2AgQgACABQQxqNgIAIAJBBGoQ+wIgACACKAIENgIIIAAgAigCCDYCDCAAQgA3AhAgAkEQaiQAIAALRAEBfyAAQQA2AgggAEIANwIAIAEEQCAAIAEQ8QEgACgCBCECIAFBAnQiAQRAIAJBACAB/AsACyAAIAEgAmo2AgQLIAAL1SgCFH8CfSAAKAJcBEAgAEHYAGoQOCAAQegAahA4IABB+ABqEDgjAEEwayIDJAAgACgCXCEGIAAoAkwhASADQQA6ABggA0EMaiABIANBGGoiARD5AiEEIANBADoAGCADIAYgARD5AiIKKAIAIQggBgRAIABByABqIQUDQAJAIAggAkEDdkH8////AXFqKAIAIAJ2QQFxDQAgACgCWCACQQJ0aigCACIBQX9GDQAgBCgCACABQQN2Qfz///8BcWoiBygCACILQQEgAXQiCXEEQCAAKAJIIgkgAUEYbGohAQJAIAAoAkwiByAAKAJQIgtPBEAgAyABKQMQNwMoIAMgASkDCDcDICADIAEpAwA3AxggBSALQQF0QYABIAsbEDMgACAAKAJMIgFBAWo2AkwgACgCSCABQRhsaiIBIAMpAyg3AxAgASADKQMgNwMIIAEgAykDGDcDACAKKAIAIQgMAQsgACAHQQFqNgJMIAkgB0EYbGoiByABKQMQNwMQIAcgASkDCDcDCCAHIAEpAwA3AwALIAAoAkxBAWshByAAKAJYIQsgACgCaCEJIAIhAQNAIAhBfkEBIAkgAUECdGooAgAiAUEDb0ECRhsgAWoiAUEDdkH8////AXFqIgwgDCgCAEEBIAF0cjYCACALIAFBAnQiDGogBzYCACALQXhBBCAJIAxqKAIAIgxBA29BAkYbaiAMQQJ0aiAHNgIAIAEgAkcNAAsMAQsgByAJIAtyNgIAIAAoAmghByACIQEDQCAIQX5BASAHIAFBAnRqKAIAIgFBA29BAkYbIAFqIgFBA3ZB/P///wFxaiILIAsoAgBBASABdHI2AgAgASACRw0ACwsgAkEBaiICIAZHDQALCyAIBEAgCigCCBogCBAiCyAEKAIAIgEEQCAEKAIIGiABECILIANBMGokACAAIQMjAEHQAGsiBiQAA0AgAygCXCEJIAZBADYCFCAGQgA3AgwgBkEAOgAYIAYgCSAGQRhqEPkCIQUgBkEANgI4IAZCADcCMCAGQgA3AyAgBkIANwMYIAZBgICA/AM2AihBACEBIAkEQANAAkAgBSgCACABQQN2Qfz///8BcWooAgAgAXZBAXENACADKAJYIAFBAnRqIgAoAgBBf0YNACAAQXhBBCABQQNvQQJGG2ooAgBBf0YNACAGQQA2AjQgBigCJARAIAYoAiAiAgRAA0AgAigCACACECIiAg0ACwsgBkEANgIgAkAgBigCHCIARQ0AIABBAnQiAEUNACAGKAIYQQAgAPwLAAsgBkEANgIkCyABIQADQCAFKAIAQX5BASADKAJoIABBAnRqKAIAIgBBA29BAkYbIABqIgBBA3ZB/P///wFxaiICIAIoAgBBASAAdHI2AgAgAEEDbyECAkAgAygCWCAAQQJ0aiIIKAIAQX9GDQAgCEF4QQQgAkECRhtqKAIAIgRBf0YNAAJAIAYoAiRFBEAgBigCMCICIAYoAjQiCEEDdGohCgJAIAhFDQADQCACKAIAIARGDQEgAkEIaiICIApHDQALDAILIAIgCkYNASACIAAgAigCBCICIAAgAkgbNgIEDAILIAYgADYCRCAGIAQ2AkBBACEIIAZBQGsiDCgCACECIAYCfwJAIAZBGGoiCygCBCIERQ0AIAsoAgACfyAEQQFrIAJxIARpIgdBAU0NABogAiACIARJDQAaIAIgBHALIghBAnRqKAIAIgpFDQAgCigCACIKRQ0AIARBAWshDiAHQQFLIQ0DQAJAIAIgCigCBCIHRwRAAkAgDUUEQCAHIA5xIQcMAQsgBCAHSw0AIAcgBHAhBwsgByAIRw0DDAELIAooAgggAkcNAEEADAMLIAooAgAiCg0ACwtBEBAjIgogAjYCBCAKQQA2AgAgCiAMKQIANwIIAkBBACAEIAsoAgxBAWqzIhUgCyoCECIWIASzlF4bDQAgCyAEIARBAWtxQQBHIARBA0lyIARBAXRyIgggFSAWlY38ASIEIAQgCEkbEHAgCygCBCIEIARBAWsiCHFFBEAgAiAIcSEIDAELIAIgBEkEQCACIQgMAQsgAiAEcCEICwJAIAsoAgAiDCAIQQJ0aiIIKAIAIgJFBEAgCiALKAIINgIAIAsgCjYCCCAIIAtBCGo2AgAgCigCACICRQ0BIAIoAgQhBwJAIAQgBEEBayICcUUEQCACIAdxIQcMAQsgBCAHSw0AIAcgBHAhBwsgDCAHQQJ0aiAKNgIADAELIAogAigCADYCACACIAo2AgALIAsgCygCDEEBajYCDEEBCzoATCAGIAo2AkggBi0ATA0BIAYoAkgiAiAAIAIoAgwiAiAAIAJIGzYCDAwBCwJAIAYoAjgiAiAITQRAIAZBMGogAkEBdEGAASACGxDQBCAGIAYoAjQiAkEBajYCNCAGKAIwIAJBA3RqIAStIACtQiCGhDcCACAGKAI0IQgMAQsgBiAIQQFqIgg2AjQgCiAANgIEIAogBDYCAAsgCEEhSQ0AIAYoAjAiAiAIQQN0aiEIA0AgBkHIAGogBkEYaiACIAIQiwUgAkEIaiICIAhHDQALIAZBADYCNAsgACABRw0ACyABIQIDQCADKAJYQX5BASADKAJoIAJBAnRqKAIAIgBBA29BAkYbIABqIgJBAnRqIgAoAgAhCCAGIABBeEEEIAJBA29BAkYbaigCACIENgJIAkAgCEF/RiAEQX9Gcg0AIAYoAiRFBEAgBigCMCEAAkAgBigCNCIIRQ0AIAAgCEEDdGohCANAIAAoAgAgBEYNASAAQQhqIgAgCEcNAAsgCCEACyAAKAIEIAJGDQEgBiACNgJAIAZBDGogBkFAaxA9DAELIAZBGGogBkHIAGoQogIoAgwgAkYNACAGIAI2AkAgBkEMaiAGQUBrED0LIAEgAkcNAAsLIAFBAWoiASAJRw0ACwsgBkEYahCVASAGKAIwIgAEQCAAECILIAUoAgAiAARAIAYoAggaIAAQIgsgBigCDCIAIAYoAhAiE0YiFEUEQANAIAAoAgAhByMAQSBrIgQkACADQdgAaiELIAMoAlgiAkF+QQEgB0EDb0ECRhsgB2oiCEECdCIJaigCACEKAkACQCADKAJoIgUgCWooAgAiASAHRg0AIAIgB0ECdGooAgAhDiADKAJ4IAlqKAIAIQwDQCAOIAIgAUECdCIJaigCAEYEQCADKAJIIg4gCkEYbGohAgJAIAMoAkwiCSADKAJQIgVPBEAgBCACKQMQNwMYIAQgAikDCDcDECAEIAIpAwA3AwggA0HIAGogBUEBdEGAASAFGxAzIAMgAygCTCICQQFqNgJMIAMoAkggAkEYbGoiAiAEKQMYNwMQIAIgBCkDEDcDCCACIAQpAwg3AwAMAQsgAyAJQQFqNgJMIA4gCUEYbGoiBSACKQMQNwMQIAUgAikDCDcDCCAFIAIpAwA3AwALAkAgAygCnAEiBUUNACADKAKYASINIApBGGxqIQIgAygCoAEiDiAFTQRAIAQgAikDEDcDGCAEIAIpAwg3AxAgBCACKQMANwMIIANBmAFqIA5BAXRBgAEgDhsQMyADIAMoApwBIgJBAWo2ApwBIAMoApgBIAJBGGxqIgIgBCkDGDcDECACIAQpAxA3AwggAiAEKQMINwMADAELIAMgBUEBajYCnAEgDSAFQRhsaiIFIAIpAxA3AxAgBSACKQMINwMIIAUgAikDADcDAAsgAygCWCEFIAMoAmgiDUF4QQQgAUEDb0ECRhtqIAFBAnRqKAIAIgIgDSAIQQJ0aigCACIORwRAIAIhAQNAIAVBfkEBIAFBA29BAkYbIg9BAnRqIAFBAnRqIAk2AgAgBSABIA9qQQJ0IgFqIAk2AgAgASANaigCACIBIA5HDQALCyAFIAJBAnQiDWooAgAhBSADKAJcIQEgCyAKIAwQyAEgCyAJIAwQyAEgCyAFIAMoAnggDWooAgAQyAEgAygCaCIFIAFBAmoiD0ECdGogBSANaiINKAIAIhA2AgAgBSAQQQJ0aiAPNgIAIAUgAUEBaiIPQQJ0aiACNgIAIA0gDzYCACADQdgBaiEPIAJBA20hEAJAIAMoAtwBIg1FDQAgAygC2AEiEiAQQQR0aiEFIAMoAuABIhEgDU0EQCAEIAUpAgg3AxAgBCAFKQIANwMIIA8gEUEBdEGAASARGxA5IAMgAygC3AEiBUEBajYC3AEgAygC2AEgBUEEdGoiBSAEKQMQNwIIIAUgBCkDCDcCAAwBCyADIA1BAWo2AtwBIBIgDUEEdGoiDSAFKQIINwIIIA0gBSkCADcCAAsgA0GoAWohEQJAIAMoAqwBIg1FDQAgAygCqAEiEiAQQRhsaiEFIAMoArABIhAgDU0EQCAEIAUpAxA3AxggBCAFKQMINwMQIAQgBSkDADcDCCARIBBBAXRBgAEgEBsQMyADIAMoAqwBIgVBAWo2AqwBIAMoAqgBIAVBGGxqIgUgBCkDGDcDECAFIAQpAxA3AwggBSAEKQMINwMADAELIAMgDUEBajYCrAEgEiANQRhsaiINIAUpAxA3AxAgDSAFKQMINwMIIA0gBSkDADcDAAsgDkECdCIFIAMoAlhqKAIAIQ0gCyAJIAwQyAEgCyAKIAwQyAEgCyANIAMoAnggBWooAgAQyAEgAygCaCIJIAFBBWoiDEECdGogBSAJaiIFKAIAIg02AgAgCSANQQJ0aiAMNgIAIAkgAUEEaiIMQQJ0aiAONgIAIAUgDDYCACAJIAFBA2oiBUECdGogATYCACAJIAFBAnRqIAU2AgAgDkEDbSEFAkAgAygC3AEiCUUNACADKALYASIOIAVBBHRqIQEgAygC4AEiDCAJTQRAIAQgASkCCDcDECAEIAEpAgA3AwggDyAMQQF0QYABIAwbEDkgAyADKALcASIBQQFqNgLcASADKALYASABQQR0aiIBIAQpAxA3AgggASAEKQMINwIADAELIAMgCUEBajYC3AEgDiAJQQR0aiIJIAEpAgg3AgggCSABKQIANwIACwJAIAMoAqwBIglFDQAgAygCqAEiDCAFQRhsaiEBIAMoArABIgUgCU0EQCAEIAEpAxA3AxggBCABKQMINwMQIAQgASkDADcDCCARIAVBAXRBgAEgBRsQMyADIAMoAqwBIgFBAWo2AqwBIAMoAqgBIAFBGGxqIgEgBCkDGDcDECABIAQpAxA3AwggASAEKQMINwMADAELIAMgCUEBajYCrAEgDCAJQRhsaiIJIAEpAxA3AxAgCSABKQMINwMIIAkgASkDADcDAAsgAiAHRg0CIAMoAmghAgwDCyAFQXhBBCABQQNvQQJGG2ogCWooAgAiASAHRw0ACwsgAygCSCIFIApBGGxqIQECQCADKAJMIgkgAygCUCICTwRAIAQgASkDEDcDGCAEIAEpAwg3AxAgBCABKQMANwMIIANByABqIAJBAXRBgAEgAhsQMyADIAMoAkwiAUEBajYCTCADKAJIIAFBGGxqIgEgBCkDGDcDECABIAQpAxA3AwggASAEKQMINwMADAELIAMgCUEBajYCTCAFIAlBGGxqIgIgASkDEDcDECACIAEpAwg3AwggAiABKQMANwMACwJAIAMoApwBIgJFDQAgAygCmAEiDCAKQRhsaiEBIAMoAqABIgUgAk0EQCAEIAEpAxA3AxggBCABKQMINwMQIAQgASkDADcDCCADQZgBaiAFQQF0QYABIAUbEDMgAyADKAKcASIBQQFqNgKcASADKAKYASABQRhsaiIBIAQpAxg3AxAgASAEKQMQNwMIIAEgBCkDCDcDAAwBCyADIAJBAWo2ApwBIAwgAkEYbGoiAiABKQMQNwMQIAIgASkDCDcDCCACIAEpAwA3AwALIAMoAlghBSADKAJoIQIgCCEBA0AgBUF+QQEgAiABQQJ0aigCACIBQQNvQQJGGyABaiIBQQJ0IgxqIAk2AgAgBUF4QQQgAiAMaigCACIMQQNvQQJGG2ogDEECdGogCTYCACABIAhHDQALCwJAAkAgAkF+QQEgAiAHQQJ0aigCACIIQQNvQQJGGyIJQQJ0aiAIQQJ0aigCACIBIAhGDQAgCygCACEHA0AgCiAHIAFBAnQiC2ooAgBHBEAgAkF4QQQgAUEDb0ECRhtqIAtqKAIAIgEgCEcNAQwCCwsgASAIRw0BCyADKAJIIgsgCkEYbGohAQJAIAMoAkwiAiADKAJQIgdPBEAgBCABKQMQNwMYIAQgASkDCDcDECAEIAEpAwA3AwggA0HIAGogB0EBdEGAASAHGxAzIAMgAygCTCIBQQFqNgJMIAMoAkggAUEYbGoiASAEKQMYNwMQIAEgBCkDEDcDCCABIAQpAwg3AwAMAQsgAyACQQFqNgJMIAsgAkEYbGoiByABKQMQNwMQIAcgASkDCDcDCCAHIAEpAwA3AwALAkAgAygCnAEiB0UNACADKAKYASILIApBGGxqIQEgAygCoAEiCiAHTQRAIAQgASkDEDcDGCAEIAEpAwg3AxAgBCABKQMANwMIIANBmAFqIApBAXRBgAEgChsQMyADIAMoApwBIgFBAWo2ApwBIAMoApgBIAFBGGxqIgEgBCkDGDcDECABIAQpAxA3AwggASAEKQMINwMADAELIAMgB0EBajYCnAEgCyAHQRhsaiIKIAEpAxA3AxAgCiABKQMINwMIIAogASkDADcDAAsgAygCWCEKIAMoAmghByAIIAlqIgghAQNAIApBfkEBIAcgAUECdGooAgAiAUEDb0ECRhsgAWoiAUECdCILaiACNgIAIApBeEEEIAcgC2ooAgAiC0EDb0ECRhtqIAtBAnRqIAI2AgAgASAIRw0ACwsgBEEgaiQAIABBBGoiACATRw0ACyAGKAIMIQALIAAEQCAGIAA2AhAgBigCFBogABAiCyAURQ0ACyAGQdAAaiQACwvTAwEDfyAAKAIIIAAoAgAiA2tBA3UEQCAAKAIEIgQgA2siBUEDdUUEQCABIAVqIQUgAyAERwRAA0AgAyABEF4gA0EIaiEDIAFBCGoiASAFRw0ACyAAKAIEIQQLIAQhASACIAVHBEADQCABIAUoAgA2AgAgASAFKAIEIgM2AgQgAwRAIAMgAygCBEEBajYCBAsgAUEIaiEBIAVBCGoiBSACRw0ACwsgACAEIAEgBGtqNgIEDwsgASACRwRAA0AgAyABEF4gA0EIaiEDIAFBCGoiASACRw0ACyAAKAIEIQQLIAMgBEcEQANAIAMgBEEIaxAvIgRHDQALCyAAIAM2AgQPCyAAKAIAIgQEQCAEIgMgACgCBCIFRwRAA0AgBCAFQQhrEC8iBUcNAAsgACgCACEDCyAAIAQ2AgQgACgCCBogAxAiIABBADYCCCAAQgA3AgALIABB/////wFBASAAKAIIIAAoAgBrIgNBAnUiBCAEQQFNGyADQfj///8HTxsQkAMgACgCBCEDIAEgAkcEQANAIAMgASgCADYCACADIAEoAgQiBDYCBCAEBEAgBCAEKAIEQQFqNgIECyADQQhqIQMgAUEIaiIBIAJHDQALCyAAIAM2AgQLfgECfyMAQRBrIgIkAEGoAhAjIgNBoJACNgIAIANCADcCBCADQRBqIAEQowEhASACIAM2AgggAiABNgIEIAAgAkEEahDcBAJAIAIoAggiAEUNACAAIAAoAgQiAUEBazYCBCABDQAgACAAKAIAKAIIEQAAIAAQJAsgAkEQaiQAC6sBAQF/IwBB0ABrIgMkACADQThqIAEgAhChASADQSBqIAEgAkEgahChASADQQhqIAEgAkFAaxChASAAQcgAaiABIAJB4ABqEKEBIAAgAykDSDcDECAAIAMpA0A3AwggACADKQM4NwMAIAAgAykDIDcDGCAAIAMpAyg3AyAgACADKQMwNwMoIAAgAykDCDcDMCAAIAMpAxA3AzggACADKQMYNwNAIANB0ABqJAALNAEBfyABQYCAgIAETwRAECYACyAAIAFBAnQiAhAjIgE2AgQgACABNgIAIAAgASACajYCCAs0AQF/IAFBq9Wq1QBPBEAQJgALIAAgAUEYbCICECMiATYCBCAAIAE2AgAgACABIAJqNgIICw8AIAEgACgCAGogAjkDAAsNACABIAAoAgBqKwMACwgAIAAoAgAaC7cMAQd/IwBBEGsiBCQAIAQgADYCDAJAIABB0wFNBEBB0OIBQZDkASAEQQxqEKQDKAIAIQAMAQsgAEF8TwRAEK4CAAsgBCAAIABB0gFuIgVB0gFsIgBrNgIIQZDkAUHQ5QEgBEEIahCkAyIDKAIAIABqIQAgA0GQ5AFrQQJ1IQYDQEEFIQMCQAJAA0AgAyIBQS9GDQEgACABQQJ0KALQ4gEiAm4iByACSQ0EIAFBAWohAyAAIAIgB2xHDQALIAFBL0kNAQtB0wEhAwNAIAAgA24iASADSQ0DIAAgASADbEYNASAAIANBCmoiAW4iAiABSQ0DIAAgASACbEYNASAAIANBDGoiAW4iAiABSQ0DIAAgASACbEYNASAAIANBEGoiAW4iAiABSQ0DIAAgASACbEYNASAAIANBEmoiAW4iAiABSQ0DIAAgASACbEYNASAAIANBFmoiAW4iAiABSQ0DIAAgASACbEYNASAAIANBHGoiAW4iAiABSQ0DIAAgASACbEYNASAAIANBHmoiAW4iAiABSQ0DIAAgASACbEYNASAAIANBJGoiAW4iAiABSQ0DIAAgASACbEYNASAAIANBKGoiAW4iAiABSQ0DIAAgASACbEYNASAAIANBKmoiAW4iAiABSQ0DIAAgASACbEYNASAAIANBLmoiAW4iAiABSQ0DIAAgASACbEYNASAAIANBNGoiAW4iAiABSQ0DIAAgASACbEYNASAAIANBOmoiAW4iAiABSQ0DIAAgASACbEYNASAAIANBPGoiAW4iAiABSQ0DIAAgASACbEYNASAAIANBwgBqIgFuIgIgAUkNAyAAIAEgAmxGDQEgACADQcYAaiIBbiICIAFJDQMgACABIAJsRg0BIAAgA0HIAGoiAW4iAiABSQ0DIAAgASACbEYNASAAIANBzgBqIgFuIgIgAUkNAyAAIAEgAmxGDQEgACADQdIAaiIBbiICIAFJDQMgACABIAJsRg0BIAAgA0HYAGoiAW4iAiABSQ0DIAAgASACbEYNASAAIANB4ABqIgFuIgIgAUkNAyAAIAEgAmxGDQEgACADQeQAaiIBbiICIAFJDQMgACABIAJsRg0BIAAgA0HmAGoiAW4iAiABSQ0DIAAgASACbEYNASAAIANB6gBqIgFuIgIgAUkNAyAAIAEgAmxGDQEgACADQewAaiIBbiICIAFJDQMgACABIAJsRg0BIAAgA0HwAGoiAW4iAiABSQ0DIAAgASACbEYNASAAIANB+ABqIgFuIgIgAUkNAyAAIAEgAmxGDQEgACADQf4AaiIBbiICIAFJDQMgACABIAJsRg0BIAAgA0GCAWoiAW4iAiABSQ0DIAAgASACbEYNASAAIANBiAFqIgFuIgIgAUkNAyAAIAEgAmxGDQEgACADQYoBaiIBbiICIAFJDQMgACABIAJsRg0BIAAgA0GOAWoiAW4iAiABSQ0DIAAgASACbEYNASAAIANBlAFqIgFuIgIgAUkNAyAAIAEgAmxGDQEgACADQZYBaiIBbiICIAFJDQMgACABIAJsRg0BIAAgA0GcAWoiAW4iAiABSQ0DIAAgASACbEYNASAAIANBogFqIgFuIgIgAUkNAyAAIAEgAmxGDQEgACADQaYBaiIBbiICIAFJDQMgACABIAJsRg0BIAAgA0GoAWoiAW4iAiABSQ0DIAAgASACbEYNASAAIANBrAFqIgFuIgIgAUkNAyAAIAEgAmxGDQEgACADQbIBaiIBbiICIAFJDQMgACABIAJsRg0BIAAgA0G0AWoiAW4iAiABSQ0DIAAgASACbEYNASAAIANBugFqIgFuIgIgAUkNAyAAIAEgAmxGDQEgACADQb4BaiIBbiICIAFJDQMgACABIAJsRg0BIAAgA0HAAWoiAW4iAiABSQ0DIAAgASACbEYNASAAIANBxAFqIgFuIgIgAUkNAyAAIAEgAmxGDQEgACADQcYBaiIBbiICIAFJDQMgACABIAJsRg0BIAAgA0HQAWoiAW4iAiABSQ0DIANB0gFqIQMgACABIAJsRw0ACwtBACAGQQFqIgAgAEEwRiIAGyIGQQJ0KAKQ5AEgACAFaiIFQdIBbGohAAwACwALIARBEGokACAAC7MBAQN/IwBBEGsiAyQAIAEhAgNAIAJBBE8EQCAAKAAAQZXTx94FbCIEQRh2IARzQZXTx94FbCABQZXTx94FbHMhASACQQRrIQIgAEEEaiEADAELCwJAAkACQAJAIAJBAWsOAwIBAAMLIAAtAAJBEHQgAXMhAQsgAC0AAUEIdCABcyEBCyABIAAtAABzQZXTx94FbCEBCyABQQ12IAFzQZXTx94FbCIAQQ92IABzIANBEGokAAuoAQACQCABQYAITgRAIABEAAAAAAAA4H+iIQAgAUH/D0kEQCABQf8HayEBDAILIABEAAAAAAAA4H+iIQBB/RcgASABQf0XTxtB/g9rIQEMAQsgAUGBeEoNACAARAAAAAAAAGADoiEAIAFBuHBLBEAgAUHJB2ohAQwBCyAARAAAAAAAAGADoiEAQfBoIAEgAUHwaE0bQZIPaiEBCyAAIAFB/wdqrUI0hr+iCwoAIAAgABCnA6ILQwAgACAAIAGlIAG9Qv///////////wCDQoCAgICAgID4/wBWGyABIAC9Qv///////////wCDQoCAgICAgID4/wBYGwtNAgF/AXwjAEEQayIFJAAgBSAENgIIIAUgAzYCDCAAKAIQIgBFBEAQZgALIAAgASACIAVBDGogBUEIaiAAKAIAKAIYERgAIAVBEGokAAukAgICfwV+AkAgASgCEEUNAAJAIAEpAzggASkDKFUEQCABKQMwIAEpAyBVDQELIAAgARC9AiABKAIQIgNFDQEgAyAALQB1QQAgAUFAaxD9AUUNAUL///////////8AIQdCgICAgICAgICAfyEIAkAgASgCQCICIAEoAkQiAEYEQEKAgICAgICAgIB/IQVC////////////ACEGDAELQv///////////wAhBkKAgICAgICAgIB/IQUDQCACKQMIIgQgCCAEIAhVGyEIIAQgBiAEIAZTGyEGIAIpAwAiBCAFIAQgBVUbIQUgBCAHIAQgB1MbIQcgAkEQaiICIABHDQALCyABIAg3AzggASAFNwMwIAEgBjcDKCABIAc3AyALQQEhAgsgAgvtBgIGfwR+IwBBIGsiCCQAAkAgAEUNACAAKAIQIgQgAEYNACACRQRAIAQgACgCFEYNAQsgAxC2AyABBH8gAEEUagUgACgCECIAQRBqCygCACEGIAApAwAhCiAAKQMIIQsCQAJAAkAgAygCBCIEIAMoAggiBUkEQCAEIAs3AwggBCAKNwMAIARBEGohBAwBCyAEIAMoAgAiCWtBBHUiB0EBaiIEQYCAgIABTw0BIAhBDGpB/////wAgBSAJayIFQQN1IgkgBCAEIAlJGyAFQfD///8HTxsgByADEDIiBSgCCCIEIAs3AwggBCAKNwMAIAUgBEEQajYCCCAFKAIEIAMoAgQgAygCACIJayIEayEHIAQEQCAHIAkgBPwKAAALIAMoAgAhCSADIAc2AgAgBSAJNgIEIAMgBSgCCCIENgIEIAUgCTYCCCADKAIIIQcgAyAFKAIMNgIIIAUgCTYCACAFIAc2AgwgBRA2CyADIAQ2AgQgACAGRwRAQRRBECABGyEJA0AgCiAGKQMAIg1RIAYpAwgiDCALUXFFBEACQCADKAIIIgUgBEsEQCAEIAw3AwggBCANNwMAIARBEGohBAwBCyAEIAMoAgAiBGtBBHUiB0EBaiIBQYCAgIABTw0EIAhBDGpB/////wAgBSAEayIEQQN1IgUgASABIAVJGyAEQfD///8HTxsgByADEDIhBSAIKAIUIgEgDDcDCCABIA03AwAgCCABQRBqNgIUIAgoAhAgAygCBCADKAIAIgdrIgFrIQQgAQRAIAQgByAB/AoAAAsgAygCACEBIAMgBDYCACAIIAE2AhAgAyAIKAIUIgQ2AgQgCCABNgIUIAMoAgghByADIAgoAhg2AgggCCAHNgIYIAUgATYCACAFEDYLIAMgBDYCBCAMIQsgDSEKCyAGIAlqKAIAIgYgAEcNAAsLAkAgAg0AIAQgAygCAGtBMEcNACAGKAIUIgAgBigCECIBKAIQRw0AIAApAwAiCiABKQMAIgt9QgF8QgJYBEAgACkDCCABKQMIfUIBfEIDVA0DCyAGKQMAQgF8IgwgC31CAlgEQCAGKQMIIAEpAwh9QgF8QgNUDQMLIAwgCn1CAlYNACAGKQMIIAApAwh9QgF8QgNUDQILQQEhBgwCCxAmAAtBACEGCyAIQSBqJAAgBgvDBAIEfgZ/IwBBEGsiCSQAIAEgASkDGCIDNwMIIAEgASkDECIFNwMAIAEgASgCVEEQQRQgASgCMEEAShtqKAIAIgY2AlQgBikDACEEIAYpAwghAiABIAU3AyAgASACNwMYIAEgBDcDECABAnwgAiADUgRAIAEpAxAgBX25IAIgA325owwBC0T////////v/0T////////vfyABKQMQIAVVGws5AyggASgCYARAIAAgASABEH4gASkDCCEDIAEpAxghAgsCQCACIANRBEAgASgCWC0ACA0BQQAhBkEQQRQgASgCMEEAShsiCCABKAJUaigCACIHKQMIIANSDQEgASkDACEFIAEpABAhBCAALQB0QQFxIQACQANAIABBACAHKQMAIgIgBFMgBCAFV0YbRQRAIAEgAjcDECABIAc2AlQgBy0AGEEEcQ0CQQEhBiACIQQgAyAHIAhqKAIAIgcpAwhRDQEMAgsLIAQhAiAGQQFxRQ0CCyABRP///////+//RP///////+9/IAIgBVUbOQMoDAELIAkgAjcDCCAAQUBrIAlBCGoQkgECQCAAKAJEIgggACgCQCIKa0EDdSIGQQJIDQAgCiAGQQJrQQF2IgdBA3RqIgYpAwAiAyAIQQhrIgspAwAiBFkNAANAAkAgBiEIIAsgAzcDACAHRQ0AIAYhCyAKIAdBAWtBAXYiB0EDdGoiBikDACIDIARTDQELCyAIIAQ3AwALIAAgASABQQAQgQIgACABIAFBARCAAgsgCUEQaiQAC+tJAwx/DH4IfCMAQRBrIg8kACAAIAM6ABkgACACNgIIIAAgATYCBCMAQRBrIg0kACAALQAYRQRAIA1BB2ohBwJAAkAgACgCKCIFIAAoAiQiBGtBAnUiAkEASgRAIAIhAwNAIANBAnQQUCIGDQIgA0EBdiIDDQALCyAEIAUgByACQQBBABCwAQwBCyAEIAUgByACIAYgAxCwASAGECILIABBAToAGAsgACgCKCIHIAAoAiQiCEcEQCAAQUBrIQQDQCANIAdBBGsiBygCACgCACkDCDcDCCAEIA1BCGoQkgECQCAAKAJEIgMgACgCQCIFa0EDdSICQQJIDQAgBSACQQJrQQF2IghBA3RqIgYpAwAiESADQQhrIgMpAwAiEFkNAANAAkAgBiECIAMgETcDACAIRQ0AIAIhAyAFIAhBAWtBAXYiCEEDdGoiBikDACIRIBBTDQELCyACIBA3AwALIAcgACgCJCIIRw0ACwsgAEEBOgB9IABCADcCHCAAIAg2AjAgDUEQaiQAQQEhAwJAIAFFDQAgACAPQQhqELkDRQ0AQQAhAyAALQB9QQFHDQADQCAPKQMIIRMjAEEQayIKJAACQCAAKAIwIgYgACgCKEYNACAAQUBrIQ0DQCAGKAIAIgQoAgAiASkDCCATUg0BIAAgBkEEajYCMAJAAkAgASgCGCIBQQFxRQRAQegAECMiAkEAQegA/AsAIAJBATYCMCACQTRqQQBBKfwLACACIAQoAgAiASkDADcDACABKQMIIRAgAkF/NgIwIAIgEDcDCCACIAIpAwAiEjcDICACIAQoAgAoAhQiATYCVCACIAEpAwg3AxggASkDACEQIAIgBDYCWCACIBA3AxAgAgJ8IAIpAxgiESACKQMIIhBSBEAgAikDECASfbkgESAQfbmjDAELRP///////+//RP///////+9/IAIpAxAgElUbCzkDKCAEKAIALQAYQQJxRQRAIAIhBgwCC0EAIQYMAgtBACEGQQAhAiABQQJxDQELQegAECMiAUEAQegA/AsAIAFBATYCMCABQTRqQQBBKfwLACABIAQoAgAiAikDADcDACACKQMIIRAgAUEBNgIwIAEgEDcDCCABIAEpAwAiEjcDICABIAQoAgAoAhAiAjYCVCABIAIpAwg3AxggAikDACEQIAEgBDYCWCABIBA3AxAgAQJ8IAEpAxgiESABKQMIIhBSBEAgASkDECASfbkgESAQfbmjDAELRP///////+//RP///////+9/IAEpAxAgElUbCyIcOQMoAkAgBkUEQEEAIQYMAQsCQCAGKQMYIAYpAwhRBEAgBisDKET////////v/2ENAgwBCyAQIBFRBEAgHET////////vf2ENAgwBCyAGKwMoIBxjDQELIAYhAiABIQYMAQsgASECCyACQQE6AFwgAEEcaiEEAkAgACgCHCIBRQRAIAJCADcDQCAAIAI2AhwMAQsgASACEL8CBEADQAJAIAQoAgAiAUHEAGohBCABKAJEIgVFDQAgBSACEL8CDQELCwJAIAEoAmBBAkYEQCABKAJEIgFFDQELIAIgASgCRCIENgJEIAQEQCAEIAI2AkALIAIgATYCQCABIAI2AkQLDAELIAJBADYCQCACIAAoAhwiATYCRCABIAI2AkAgACACNgIcCwJAIAIoAlgtAAhBAUYEQEEAIQUgACgCHCEBAkAgACgCCARAIAEgAkcEQCACKAI4IQQgAigCNCEFA0ACQCABKAJYIgcoAgRBAUYEQCACIAQgASgCMGoiBDYCOAwBCyAHLQAIDQAgAiAFIAEoAjBqIgU2AjQLIAEoAkQiASACRw0ACwsMAQtBACEEAkAgASACRgRAQQAhAQwBCwNAAkAgASgCWCIHKAIEQQFGBEAgBEEBaiEEDAELIAUgBy0ACEEBc2ohBQsgASgCRCIBIAJHDQALIARBAXEhASAFQQFxIQQLIAIgATYCOCACIAQ2AjQLIAIoAjghAQJ/AkACQAJAIAAoAghBAmsOAgABAgsgAigCNEEASiEEIAFBAEoMAgsgAigCNEEfdiEEIAFBH3YMAQsgAigCNEEARyEEIAFBAEcLIQECQAJAIAAoAgRBAWsOAgMAAQsgASAEckEBcyEBDAILIAFBAXMhAQwBCyACKAJYIgUoAgQhCwJAAkACQAJ/AkAgAigCQCIBBEADQCALIAEoAlgiBCgCBEYEQCAELQAIQQFHDQMLIAEoAkAiAQ0ACwsgAiACKAIwNgI0IAAoAhwiASAAKAIIRQ0BGgwDCyAAKAIIDQEgAiACKAIwNgI0IAIgASgCODYCOCABKAJECyIBIAJGDQIgAigCOCEEA0ACQCABKAJYIgUoAgQgC0YNACAFLQAIDQAgAiAERSIENgI4CyABKAJEIgEgAkcNAAsMAgsgAgJ/IAEoAjAiByABKAI0IghsQQBIBEAgCEECa0F8TQRAIAggAigCMCIEQQAgBCAHbEEAThtqDAILQQEgAigCMCAFLQAIGwwBCyAIIAIoAjAiBEEAIAQgB2xBAE4bags2AjQgAiABKAI4NgI4IAEoAkQhAQsgASACRg0AIAIoAjghBANAAkAgASgCWCIFKAIEIAtGDQAgBS0ACA0AIAIgBCABKAIwaiIENgI4CyABKAJEIgEgAkcNAAsLAn8CQAJAAkACQAJAIAAoAggiBUEBaw4DAAECAwsgAigCNCIBIAFBH3UiAXMgAWtBAUYNAgwDCyACKAI0QQFHDQIMAQsgAigCNEF/Rw0BC0EBIQQCQAJAAkACQCAAKAIEQQFrDgQAAQIDBAsgAigCOCEBAkACQAJAIAVBAmsOAgABAgsgAUEASgwGCyABQR92DAULIAFBAEcMBAsgAigCOCEBAkACQAJAIAVBAmsOAgABAgsgAUEATAwFCyABQQBODAQLIAFFDAMLIAIoAjghAQJ/AkACQAJAIAVBAmsOAgABAgsgAUEATAwCCyABQQBODAELIAFFCyACKAJYKAIEQQBHcyEECyAEDAELQQALIQELAkAgBgRAIAZBADoAXCAGIAIoAjQ2AjQgBiACKAI4NgI4IAYgAigCRCIENgJEIAQEQCAEIAY2AkALIAYgAjYCQCACIAY2AkQCQCABQQFxRQ0AIAAgAiAGIAJBARDdASACKQMYIAIpAwhRDQAgACACIAJBABCBAgsCQCAGKAJEIgRFDQADQCAEIAYQvwJFDQEgACAGIAYoAkQgBhDcASAGKAJEIgUoAkQiBARAIAQgBjYCQAsgBigCQCIBBEAgASAFNgJECyAFIAY2AkQgBSABNgJAIAYgBDYCRCAGIAU2AkAgBSgCQEUEQCAAIAU2AhwLIAQNAAsLIAYpAxggBikDCFEEQCAGIAAoAiA2AkwgACAGNgIgDAILIAAgBiAGQQAQgAIgCiAGKQMYNwMIIA0gCkEIahCSASAAKAJEIgQgACgCQCIHa0EDdSIBQQJIDQEgByABQQJrQQF2IgZBA3RqIgEpAwAiECAEQQhrIgQpAwAiEVkNAQNAAkAgASEFIAQgEDcDACAGRQ0AIAEhBCAHIAZBAWtBAXYiBkEDdGoiASkDACIQIBFTDQELCyAFIBE3AwAMAQsgAUEBcUUNACAAENsBIgZBAToATCAGQQAgAiACKAIwQQBKIgEbNgIMIAYgAkEAIAEbNgIIIAIgBjYCPEEgECMiASACKQMINwMIIAEgAikDADcDACABQQA2AhwgASAGNgIYIAEgATYCFCABIAE2AhAgBiABNgIQCwJAIAIpAxgiECACKQMIUQRAIAIgACgCIDYCTCAAIAI2AiAMAQsgCiAQNwMIIA0gCkEIahCSASAAKAJEIgIgACgCQCIFa0EDdSIBQQJIDQAgBSABQQJrQQF2IgZBA3RqIgEpAwAiECACQQhrIgQpAwAiEVkNAANAAkAgASECIAQgEDcDACAGRQ0AIAIhBCAFIAZBAWtBAXYiBkEDdGoiASkDACIQIBFTDQELCyACIBE3AwALIAAoAjAiBiAAKAIoRw0ACwsgCkEQaiQAA0AgACgCICIBBEAgACABKAJMNgIgIAAgARC4AwwBCwsgACgCYCAAKAJcRwRAQQAhCSMAQSBrIg4kAAJAIAAoAlwiBCAAKAJgIghGDQAgBCEFA0AgBSgCACICQRhqIQYDQCAGKAIAIgdBBGohBiAHKAIQIg1FDQALIAIpAwghECACIQECQCAHKAIIBEAgDSgCECEHA0AgByABIgZHBEAgASgCFCIBKQMIIBBRDQELCwNAIAIiASANRg0CIAIoAhAiAikDCCAQUQ0ACwwBCwNAIAIgASIGKAIUIgFHBEAgASkDCCAQUQ0BCwsDQCACIgEoAhAiAiAGRg0BIAIpAwggEFENAAsLAkACQCAGKQMAIhEgASkDACIQUgRAIAUgECARVSICOgAIIAUgASAGIAIbNgIEIAUgBiABIAIbIgE2AgAgASgCHEUNAQsgBUEANgIEDAELIAEgBTYCHCAJQQFqIQkLIAVBDGoiBSAIRw0ACyAJQQJIDQAgDkEMaiEFIAggBGsiAUEMbSECAkACQCABQYEMTgRAIAIhAQNAIAFBDGwQUCIGDQIgAUEBdiIBDQALCyAEIAggBSACQQBBABCvAQwBCyAEIAggBSACIAYgARCvASAGECILIABB6ABqIQogACgCXCIBIAlBDGxqIgtBDGshDQNAAkAgASIHQQxqIgEgC0YNACABIQYDQAJAAkAgBigCACICKQMAIAcoAgQpAwBZDQAgBy0ACCIFIAYtAAhGDQAgBigCBCkDACAHKAIAIgQpAwBXDQAgBCkDCCEQAkACQAJAIAVFBEACQCAEKAIUIgQpAwggEFINAANAIAQpAwAgBigCACICKQMAVQ0BIAcgBDYCACAEKAIUIgQpAwggEFENAAsgBigCACECCyACKAIQIgQpAwggEFINAiAEKQMAIAcoAgApAwBXDQEMAgsCQCAEKAIQIgUpAwggEFINACAFKQMAIAYoAgAiAikDAFUNAANAAkAgByAFIgQ2AgAgBCgCECIFKQMIIBBSDQAgBSkDACAGKAIAIgIpAwBXDQEMAgsLIAYoAgAhAgsCQCACKAIUIgIpAwggEFINAANAIAIpAwAgBygCACIEKQMAVQ0BIAYgAjYCACACKAIUIgIpAwggEFENAAsgBygCACEEC0EgECMhDCAEKAIYIQIgDCAEKQMINwMIIAwgBCkDADcDACAMQQA2AhwgDCACNgIYIAQoAhAiAiAMNgIUIAQgDDYCECAMIAQ2AhQgDCACNgIQIAYoAgAhBEEgECMhCSAEKAIYIQIgCSAEKQMINwMIIAkgBCkDADcDACAJQQA2AhwgCSACNgIYIAQoAhQiAiAJNgIQIAQgCTYCFCAJIAI2AhQgCSAENgIQIAAoAmwiAiAAKAJwIgRJBEAgAiAJNgIEIAIgDDYCACACQQhqIQIMAwsgAiAKKAIAIgJrQQN1IgVBAWoiCEGAgICAAk8NBCAOQQxqQf////8BIAQgAmsiBEECdSICIAggAiAISxsgBEH4////B08bIAUgChBLIQggDigCFCICIAk2AgQgAiAMNgIAIA4gDigCFEEIajYCFCAOKAIQIAAoAmwgACgCaCICayIFayEEIAUEQCAEIAIgBfwKAAALIAAoAmghBSAAIAQ2AmggDiAFNgIQIAAgDigCFCICNgJsIA4gBTYCFCAAKAJwIQQgACAOKAIYNgJwIA4gBDYCGCAIIAU2AgAgCBCZAQwCCwNAIAYgBCICNgIAIAIoAhAiBCkDCCAQUg0BIAQpAwAgBygCACkDAFcNAAsLQSAQIyEMIAIoAhghBCAMIAIpAwg3AwggDCACKQMANwMAIAxBADYCHCAMIAQ2AhggAigCECIEIAw2AhQgAiAMNgIQIAwgAjYCFCAMIAQ2AhAgBygCACEEQSAQIyEJIAQoAhghAiAJIAQpAwg3AwggCSAEKQMANwMAIAlBADYCHCAJIAI2AhggBCgCFCICIAk2AhAgBCAJNgIUIAkgAjYCFCAJIAQ2AhAgACgCbCICIAAoAnAiBEkEQCACIAk2AgQgAiAMNgIAIAJBCGohAgwBCyACIAooAgAiAmtBA3UiBUEBaiIIQYCAgIACTw0CIA5BDGpB/////wEgBCACayIEQQJ1IgIgCCACIAhLGyAEQfj///8HTxsgBSAKEEshCCAOKAIUIgIgCTYCBCACIAw2AgAgDiAOKAIUQQhqNgIUIA4oAhAgACgCbCAAKAJoIgJrIgVrIQQgBQRAIAQgAiAF/AoAAAsgACgCaCEFIAAgBDYCaCAOIAU2AhAgACAOKAIUIgI2AmwgDiAFNgIUIAAoAnAhBCAAIA4oAhg2AnAgDiAENgIYIAggBTYCACAIEJkBCyAAIAI2AmwLIAsgBkEMaiIGRw0BDAILCxAmAAsgASANRw0ACwsgDkEgaiQAIAAgACgCXDYCYAsgACAPKQMINwMQAkAgACAPQQhqELkDBEAgDykDCCEYQQAhAgJAIAAoAhwiB0UNACAHKAJERQ0AIAAgBzYCICAHIQEDQCABIgIgAigCQDYCSCACIAIoAkQiATYCUCACIAE2AkwgAikDECEQAkAgGCACKQMYUQ0AIBAgAikDACIRUQ0AIAIpAwgiECAYUQRAIBEhEAwBCyARIAIrAyggGCAQfbminvwGfCEQCyACIBA3AyAgAQ0ACwNAAkBBACEGIAcoAlBFDQADQCAHIgQoAlAiBQRAIAYhDSAEIAUoAlAiBzYCUAJAIAQgBUYgBSAHRnJFBEAgBCEGIAUhAQNAAkACQCABIgIpAyAgBCkDIFMEQANAIAIoAkghAiMAQSBrIgwkAAJAAn4gAikDGCIRIAIpAwgiFH25Ih0gASkDECITIAEpAwAiFn25Ih6iIAIpAxAiECACKQMAIhV9uSIfIAEpAxgiGiABKQMIIhd9uSIgoqEiHEQAAAAAAAAAAGIEQCAUIBUiEiAWfbkgIKIgHiAUIBd9uaKhIByjIhxEAAAAAAAAAABlDQEaIBAhEiARIBxEAAAAAAAA8D9mDQEaIBwgH6IgFbmg/AYhEiAcIB2iIBS5oPwGDAELIAIpAyAhEiAYCyIZIBhTIgggACkDECIbIBlTckUEQCAZIREgEiEQDAELIAIrAygiIZkiI0QAAAAAAABZQGQiBUUgASsDKCIcmSIiRAAAAAAAAFlAZEVyRQRAICIgI2MEQCAQIBVRIBEgFFFxDQJEAAAAAAAAAAAhHAJAIBIgFX25IB+iIB0gGSAUfbmioCAfIB+iIB0gHaKgoyIhRAAAAAAAAAAAYw0AICEiHEQAAAAAAADwP2RFDQBEAAAAAAAA8D8hHAsgFCAcIB2invwGfCERIBUgHCAfop78BnwhEAwCCyATIBZRBEAgEyEQIBcgGiIRUQ0CC0QAAAAAAAAAACEcAkAgEiAWfbkgHqIgICAZIBd9uaKgIB4gHqIgICAgoqCjIiFEAAAAAAAAAABjDQAgISIcRAAAAAAAAPA/ZEUNAEQAAAAAAADwPyEcCyAXIBwgIKKe/AZ8IREgFiAcIB6invwGfCEQDAELIAUEQCAQIBVRIBEgFFFxDQFEAAAAAAAAAAAhHAJAIBIgFX25IB+iIB0gGSAUfbmioCAfIB+iIB0gHaKgoyIhRAAAAAAAAAAAYw0AICEiHEQAAAAAAADwP2RFDQBEAAAAAAAA8D8hHAsgFCAcIB2invwGfCERIBUgHCAfop78BnwhEAwBCyAiRAAAAAAAAFlAZARAIBMgFlEEQCATIRAgFyAaIhFRDQILRAAAAAAAAAAAIRwCQCASIBZ9uSAeoiAgIBkgF325oqAgHiAeoiAgICCioKMiIUQAAAAAAAAAAGMNACAhIhxEAAAAAAAA8D9kRQ0ARAAAAAAAAPA/IRwLIBcgHCAgop78BnwhESAWIBwgHqKe/AZ8IRAMAQsgGCAbIAgbIRICQAJAICIgI2QEQCARIBJRIBAgFVFyDQEgEiAUUQRAIBQhESAVIRAMBAsgFSAhIBIgFH25op78BnwhEAwBCyASIBpRIBMgFlFyDQEgEiAXUQRAIBchESAWIRAMAwsgFiAcIBIgF325op78BnwhEAsgEiERDAELIBIhESATIRALAkACQAJAIAAoAlQiBSAAKAJYIghJBEAgBSABNgIUIAUgAjYCECAFIBE3AwggBSAQNwMAIAVBGGohCAwBCyAFIABB0ABqIgooAgAiBWtBGG0iC0EBaiIJQavVqtUATw0BIAxBDGpBqtWq1QAgCCAFa0EYbSIIQQF0IgUgCSAFIAlLGyAIQdWq1SpPGyALIAoQZCIKKAIIIgUgATYCFCAFIAI2AhAgBSARNwMIIAUgEDcDACAKIAVBGGo2AgggCigCBCAAKAJUIAAoAlAiBWsiC0FobUEYbGohCCALBEAgCCAFIAv8CgAACyAAKAJQIQsgACAINgJQIAogCzYCBCAAIAooAggiCDYCVCAKIAs2AgggACgCWCEFIAAgCigCDDYCWCAKIAs2AgAgCiAFNgIMIAoQjAELIAAgCDYCVCAMQSBqJAAMAQsQJgALIAIgBEcNAAsgASgCSCEFIAEoAkwiAgRAIAIgBTYCSAsgBSACNgJMIAEgBCgCSCIFNgJIIAUEQCAFIAE2AkwLIAEgBDYCTCAEIAE2AkggBCAGRwRAIAIhBQwDCyABIAc2AlAgDUUEQCAAIAE2AiAMAgsgDSABNgJQDAELIAQoAkwhBAwBCyACIQUgASEGCyAEIAVGDQIgByACIgFHDQALDAELIAQhBgsgBw0BCwsgACgCICIHDQELCyAAKAJUIAAoAlBHIQILIAIEQCMAQSBrIgckACAAKAJUIQEgACgCUCECIAdBywQ2AgggASACRwR/IAIgASAHQQhqIAEgAmtBGG1nQQF0QT5zQQEQtwMgACgCUCECIAAoAlQFIAELIAJHBEADQAJAIAIoAhQiBiACKAIQIgUoAkRGDQAgAiEBIAUoAkAgBkYNAANAAkAgAUEYaiEGIAEoAiwiBSABKAIoIgQoAkRGDQAgBiEBIAQoAkAgBUcNAQsLIAcgAikDEDcDGCAHIAIpAwg3AxAgByACKQMANwMIIAIgBikDEDcDECACIAYpAwg3AwggAiAGKQMANwMAIAYgBykDGDcDECAGIAcpAxA3AwggBiAHKQMINwMAIAIoAhQhBiACKAIQIQULIAAgBSAGIAIQ3AEgAigCECEEIAIoAhQiBSgCRCIGBEAgBiAENgJACyAEKAJAIgEEQCABIAU2AkQLIAUgBDYCRCAFIAE2AkAgBCAGNgJEIAQgBTYCQCAFKAJARQRAIAAgBTYCHAsgBCACKQMAIhA3AyAgBSAQNwMgIAAgBSACQQEQgQIgACACKAIQIAJBARCAAiACQRhqIgIgACgCVEcNAAsLIAdBIGokACAAIAAoAlA2AlQLIA8pAwghEyAAQQA2AiAgACgCHCIBBEADQCABKQMQIRACfwJAIBMgASkDGFEEQCABIBA3AyAgASgCVC0AGEEEcQRAAn8gASgCRCEGAkACQAJAAkACQCABKAJUIgQtABhBA3FFBEAgASgCQCENIAEhAgNAIAIoAkQiAkUNBiACKAJUIARHDQALIAEoAmAEQCAAIAEgAUEQahB+CyACKAJgBEAgACACIAJBEGoQfgsgAiAGRwRAIAFBEGohBQNAIAAgASAGIAUQ3AEgBigCRCIEBEAgBCABNgJACyABKAJAIgcEQCAHIAY2AkQLIAYgATYCRCAGIAc2AkAgASAENgJEIAEgBjYCQCAGKAJARQRAIAAgBjYCHAsgBCIGIAJHDQALCyABKAI8IQYgASgCWC0ACEEBRw0EIAYEQCAAIAEgAiABQRBqEIYBCyAAQRxqIQcgAigCRCIFIAIoAkAiBHJFBEAgAiAAKAIcIgZHDQQLIARFDQEgBCAFNgJEDAILIAEoAjwEQCABIAFBEGoQYxoLIAEpAxggASkDCFENBCABKAI8IgIEQAJAIAIoAgggAUYEQCACQQA2AggMAQsgAkEANgIMCyABQQA2AjwLIAEoAkQiBCABKAJAIgJyRQRAIAEgACgCHEcNBQsCQCACBEAgAiAENgJEDAELIAAgBDYCHAsgBARAIAQgAjYCQAsgARAiIAYMBQsgByAFNgIACyAFBEAgBSAENgJACyACECIgBygCACEGCyABKAJEIgQgASgCQCICckUgASAGR3FFBEACQCACBEAgAiAENgJEDAELIAcgBDYCAAsgBARAIAQgAjYCQAsgARAiCyANQcQAaiAHIA0bKAIADAILIAYEQCAAIAEgAiABQRBqEIYBCyAAQRxqIQcCQCABKAJEIgUgASgCQCIEckUEQCABIAAoAhwiBkcNAQsCQCAEBEAgBCAFNgJEDAELIAcgBTYCAAsgBQRAIAUgBDYCQAsgARAiIAcoAgAhBgsgAigCRCIEIAIoAkAiAXJFIAIgBkdxRQRAAkAgAQRAIAEgBDYCRAwBCyAHIAQ2AgALIAQEQCAEIAE2AkALIAIQIgsgDUHEAGogByANGygCACEGCyAGCwwDCyABKAI8BEAgASABQRBqEGMaCyAAIAEQ/gEgASkDGCABKQMIUg0BIAEgACgCIDYCTCAAIAE2AiAMAQsCQCAQIAEpAwAiEVENACABKQMIIhAgE1EEQCARIRAMAQsgESABKwMoIBMgEH25op78BnwhEAsgASAQNwMgCyABKAJECyIBDQALCwNAIAAoAiAiAUUNAiAAIAEoAkw2AiAgACABELgDDAALAAsgAC0AfUEBRw0CIwBBIGsiCyQAAkACQCAAKAJoIgkgACgCbCINRwRAA0ACf0EAIAkoAgAiBSgCGCIBRQ0AGgNAIAEgASgCEA0BGiABKAIEIgENAAtBAAshAkEAIQMCQCAJKAIEIgQoAhgiAUUNAANAIAEoAhAEQCABIQMMAgsgASgCBCIBDQALCyAEKAIUIQEgBSgCECEGIAUgBDYCECAEIAU2AhQgBiABNgIUIAEgBjYCEAJAAkACQCACIANGBEAgABDbASIHIAY2AhAgBiEBA0AgASAHNgIYIAEoAhAiASAGRw0ACyAHIAIoAhAiASgCGEYEQCACIAkoAgAiATYCECABIAI2AhgLIAAtABlBAUYEQAJAIAEgBygCEBDaAQRAIAIoAhAhAyACIAcoAhA2AhAgByADNgIQIAIoAhAiBiEBA0AgASACNgIYIAEoAhAiASAGRw0ACyADIQEDQCABIAc2AhggASgCECIBIANHDQALIAIhAQwBCyAHKAIQIAIiASgCEBDaAQ0AIAIoAgQhAQsgByABNgIEIAIoAhgiAUUEQEEAIQNBDBAjIgFBADYCCCABQgA3AgAgAiABNgIYIAFBBGohBkEAIQIMAwsgAUEEaiEGIAEoAgQiAyABKAIIIgJPDQIgAyAHNgIAIANBBGohAwwDCyAHIAI2AgQMAwsgA0EANgIQIAAtABlBAUYEQEEAIQYCQCACKAIEIgFFDQADQCABKAIQBEAgASEGDAILIAEoAgQiAQ0ACwsgAiAGNgIEIAIhAQNAIAEoAgQiAUEAIAEgA0cbDQALIAEEQCACIAMoAgQ2AgQLIAMgAjYCBCADKAIYRQ0DIwBBIGsiCCQAIAIoAhhFBEBBDBAjIgFBADYCCCABQgA3AgAgAiABNgIYCwJAAkAgAygCGCIHKAIAIgQgBygCBEcEQANAIAQoAgAiASACRwRAAkAgAigCGCIKKAIEIgUgCigCCCIGSQRAIAUgATYCACAFQQRqIQYMAQsgBSAKKAIAIgFrQQJ1IgVBAWoiB0GAgICABE8NBCAIQQxqQf////8DIAYgAWsiBkEBdSIBIAcgASAHSxsgBkH8////B08bIAUgChBKIQcgCCgCFCIBIAQoAgA2AgAgCCABQQRqNgIUIAgoAhAgCigCBCAKKAIAIgFrIgVrIQYgBQRAIAYgASAF/AoAAAsgCigCACEFIAogBjYCACAIIAU2AhAgCiAIKAIUIgY2AgQgCCAFNgIUIAooAgghASAKIAgoAhg2AgggCCABNgIYIAcgBTYCACAHEFMgAygCGCEHCyAKIAY2AgQLIARBBGoiBCAHKAIERw0ACyAHKAIAIQQLIAcgBDYCBCAIQSBqJAAMAQsQJgALDAMLIAMgAjYCBAwCCyADIAEoAgAiA2tBAnUiBEEBaiIFQYCAgIAETw0EIAtBDGpB/////wMgAiADayIDQQF1IgIgBSACIAVLGyADQfz///8HTxsgBCABEEohBSALKAIUIgIgBzYCACALIAJBBGo2AhQgCygCECAGKAIAIAEoAgAiAmsiBGshAyAEBEAgAyACIAT8CgAACyABKAIAIQQgASADNgIAIAsgBDYCECAGIAsoAhQiAzYCACALIAQ2AhQgASgCCCECIAEgCygCGDYCCCALIAI2AhggBSAENgIAIAUQUwsgBiADNgIACyAJQQhqIgkgDUcNAAsLIAtBIGokAAwBCxAmAAsgAC0AfSEDDAILIAAtAH1BAUYNAAsLIA9BEGokACADQQFxC44CAgJ/BX4CQCABKAJEIgRFDQAgASgCPEUNACAEKAI8RQ0AIAEpAxgiByABKQMIIghRDQAgBCkDGCIJIAQpAwgiClENACABKAJYLQAIDQAgBCgCWC0ACA0AIAIpAwgiBiAHQgJ8WSAGIAlCAnxZcUUgBiAIUyAGIApTcnENAAJAIAMEQCACIAQgBEEQahC8A0RmZmZmZmbWP2RFDQEMAgsgASkDICAEKQMgUg0BCyABQRBqIAIgBEEQahC+AkUNAAJAIAEoAjwoAgAiAyAEKAI8KAIAIgVGBEAgACABIAQgAhCGAQwBCyADIAVJBEAgASAEEJoBDAELIAQgARCaAQsgAUECNgJgIARBATYCYAsLjgICAn8FfgJAIAEoAkAiBEUNACABKAI8RQ0AIAQoAjxFDQAgASkDGCIHIAEpAwgiCFENACAEKQMYIgkgBCkDCCIKUQ0AIAEoAlgtAAgNACAEKAJYLQAIDQAgAikDCCIGIAdCAnxZIAYgCUICfFlxRSAGIAhTIAYgClNycQ0AAkAgAwRAIAIgBCAEQRBqELwDRAAAAAAAANA/ZEUNAQwCCyABKQMgIAQpAyBSDQELIAFBEGogAiAEQRBqEL4CRQ0AAkAgASgCPCgCACIDIAQoAjwoAgAiBUYEQCAAIAQgASACEIYBDAELIAMgBUkEQCABIAQQmgEMAQsgBCABEJoBCyAEQQI2AmAgAUEBNgJgCwujAQACQCAAIABBAWtxDQACQAJAAkACQAJAIABoDgcAAQIFBQMEBQtBEBB0QboVELIBQdSaAkGzBBALAAtBEBB0QeMfELIBQdSaAkGzBBALAAtBEBB0QagTELIBQdSaAkGzBBALAAtBEBB0QZ4fELIBQdSaAkGzBBALAAtBEBB0QeAVELIBQdSaAkGzBBALAAtBEBB0QYAOELIBQdSaAkGzBBALAAu3AQEGfyMAQRBrIgMkACAAQZibAjYCACAAQQhqIgQQhAIgACgCICICBEAgACACNgIkIAAoAigaIAIQIgsgAyAENgIMIAMoAgwiBCgCACICBEAgAiIBIAQiBigCBCIFRwRAA0AgBUEEayIFKAIAIQEgBUEANgIAIAEEQCABIAEoAgAoAgQRAAALIAIgBUcNAAsgAygCDCIGKAIAIQELIAQgAjYCBCAGKAIIGiABECILIANBEGokACAAC1cBA38gACgCBCICIAAoAgAiA2tBAnUEQCACIANHBEADQCACQQRrIgIoAgAhASACQQA2AgAgAQRAIAEgASgCACgCBBEAAAsgAiADRw0ACwsgACADNgIECwv6AgEBfEQAAAAAAPiPQCAAKwMQIAErAxAiAqEgASsDKCACoaNEAAAAAAAAkECiIgJEAAAAAAAAAAAgAkQAAAAAAAAAAGQbIgIgAkQAAAAAAPiPQGQb/ANBgYAEbEH/gYD4AHFBgQJsQY/gg/gAcUERbEHD4bCYBHFBBWxByaSSyQRxRAAAAAAA+I9AIAArAwggASsDCCICoSABKwMgIAKho0QAAAAAAACQQKIiAkQAAAAAAAAAACACRAAAAAAAAAAAZBsiAiACRAAAAAAA+I9AZBv8A0GBgARsQf+BgPgAcUGBAmxBj+CD+ABxQRFsQcPhsJgEcUEKbEGSyaSSeXFEAAAAAAD4j0AgACsDACABKwMAIgKhIAErAxggAqGjRAAAAAAAAJBAoiICRAAAAAAAAAAAIAJEAAAAAAAAAABkGyICIAJEAAAAAAD4j0BkG/wDQYGABGxB/4GAGHFBgQJsQY/ggxhxQRFsQcPhsBhxQRRsQaSSyaQCcXJyCz4BAn8gACgCBCICIAFHBEADQCACQQRrIgIoAgAhAyACQQA2AgAgAwRAIAMQdQsgASACRw0ACwsgACABNgIEC5wCAQV/IwBBIGsiBSQAIAAoAgQgACgCACICa0HIAG0iBEEBaiIDQeTxuBxPBEAQJgALIAVBDGpB4/G4HCAAKAIIIAJrQcgAbSICQQF0IgYgAyADIAZJGyACQfG4nA5PGyAEIAAQ3QIiAygCCCICIAEoAgA2AgAgAkEIakEAQTj8CwAgAkEANgJEIAIgAi0AQEHgAXE6AEAgAyACQcgAajYCCCAAKAIAIgEgACgCBCICIAMoAgQgAiABa0G4f21ByABsaiICENwCIAAoAgAhASAAIAI2AgAgAyABNgIEIAAgAygCCCICNgIEIAMgATYCCCAAKAIIIQQgACADKAIMNgIIIAMgATYCACADIAQ2AgwgAxDbAiAFQSBqJAAgAgvDHgEIfyMAQRBrIgokACAAIAAoAgAQgQQgAEEANgIQIABBDGoiBxCDASAAQQA2AiAgAEEcaiIIEC0gAEEANgIwIABBLGoiCRAtIABBADYCQCAAQTxqEC0gAEEANgJQIABBzABqEC0jAEEgayIMJAAgACgCCCAAKAIAIgVrQcgAbUEESQRAIAxBDGpBBCAAKAIEIAVrQcgAbSAAEN0CIQUgACgCACIGIAAoAgQiCyAFKAIEIAsgBmtBuH9tQcgAbGoiCxDcAiAAKAIAIQYgACALNgIAIAUgBjYCBCAAIAUoAgg2AgQgBSAGNgIIIAAoAgghCyAAIAUoAgw2AgggBSAGNgIAIAUgCzYCDCAFENsCCyAMQSBqJAAgB0EMEDkCfyAAKAIQIgYgACgCFCIFTwRAIAcgBUEBdEGAASAFGxA5IAAoAgwgACgCECIGQQR0agwBCyAHKAIAIAZBBHRqCyIFQQA2AgAgBUIGNwIIIAUgAjYCBCAAIAZBAWo2AhACQCAAKAIgIgUgACgCJCIGTwRAIAggBkEBdEGAASAGGxAlIAAoAhwgACgCICIFQQJ0akEANgIADAELIAgoAgAgBUECdGpBADYCAAsgACAFQQFqNgIgAkAgACgCMCIFIAAoAjQiBk8EQCAJIAZBAXRBgAEgBhsQJSAAKAIsIAAoAjAiBUECdGpBATYCAAwBCyAJKAIAIAVBAnRqQQE2AgALIAAgBUEBajYCMAJAIAAoAhAiBSAAKAIUIgZPBEAgByAGQQF0QYABIAYbEDkgACgCDCAAKAIQIgVBBHRqIgZBADYCAAwBCyAHKAIAIAVBBHRqIgZBADYCAAsgBkIJNwIIIAYgAzYCBCAAIAVBAWo2AhACQCAAKAIgIgUgACgCJCIGTwRAIAggBkEBdEGAASAGGxAlIAAoAhwgACgCICIFQQJ0akEANgIADAELIAgoAgAgBUECdGpBADYCAAsgACAFQQFqNgIgAkAgACgCMCIFIAAoAjQiBk8EQCAJIAZBAXRBgAEgBhsQJSAAKAIsIAAoAjAiBUECdGpBAjYCAAwBCyAJKAIAIAVBAnRqQQI2AgALIAAgBUEBajYCMAJAIAAoAhAiBSAAKAIUIgZPBEAgByAGQQF0QYABIAYbEDkgACgCDCAAKAIQIgVBBHRqIgZBADYCAAwBCyAHKAIAIAVBBHRqIgZBADYCAAsgBkIDNwIIIAYgATYCBCAAIAVBAWo2AhACQCAAKAIgIgUgACgCJCIGTwRAIAggBkEBdEGAASAGGxAlIAAoAhwgACgCICIFQQJ0akEANgIADAELIAgoAgAgBUECdGpBADYCAAsgACAFQQFqNgIgAkAgACgCMCIFIAAoAjQiBk8EQCAJIAZBAXRBgAEgBhsQJSAAKAIsIAAoAjAiBUECdGpBADYCAAwBCyAJKAIAIAVBAnRqQQA2AgALIAAgBUEBajYCMAJAIAAoAhAiBSAAKAIUIgZPBEAgByAGQQF0QYABIAYbEDkgACgCDCAAKAIQIgVBBHRqIgZBADYCAAwBCyAHKAIAIAVBBHRqIgZBADYCAAsgBkICNwIIIAYgAzYCBCAAIAVBAWo2AhACQCAAKAIgIgUgACgCJCIGTwRAIAggBkEBdEGAASAGGxAlIAAoAhwgACgCICIFQQJ0akEBNgIADAELIAgoAgAgBUECdGpBATYCAAsgACAFQQFqNgIgAkAgACgCMCIFIAAoAjQiBk8EQCAJIAZBAXRBgAEgBhsQJSAAKAIsIAAoAjAiBUECdGpBBDYCAAwBCyAJKAIAIAVBAnRqQQQ2AgALIAAgBUEBajYCMAJAIAAoAhAiBSAAKAIUIgZPBEAgByAGQQF0QYABIAYbEDkgACgCDCAAKAIQIgVBBHRqIgZBADYCAAwBCyAHKAIAIAVBBHRqIgZBADYCAAsgBkILNwIIIAYgBDYCBCAAIAVBAWo2AhACQCAAKAIgIgUgACgCJCIGTwRAIAggBkEBdEGAASAGGxAlIAAoAhwgACgCICIFQQJ0akEBNgIADAELIAgoAgAgBUECdGpBATYCAAsgACAFQQFqNgIgAkAgACgCMCIFIAAoAjQiBk8EQCAJIAZBAXRBgAEgBhsQJSAAKAIsIAAoAjAiBUECdGpBBTYCAAwBCyAJKAIAIAVBAnRqQQU2AgALIAAgBUEBajYCMAJAIAAoAhAiBSAAKAIUIgZPBEAgByAGQQF0QYABIAYbEDkgACgCDCAAKAIQIgVBBHRqIgZBADYCAAwBCyAHKAIAIAVBBHRqIgZBADYCAAsgBkIHNwIIIAYgATYCBCAAIAVBAWo2AhACQCAAKAIgIgUgACgCJCIGTwRAIAggBkEBdEGAASAGGxAlIAAoAhwgACgCICIFQQJ0akEBNgIADAELIAgoAgAgBUECdGpBATYCAAsgACAFQQFqNgIgAkAgACgCMCIFIAAoAjQiBk8EQCAJIAZBAXRBgAEgBhsQJSAAKAIsIAAoAjAiBUECdGpBAzYCAAwBCyAJKAIAIAVBAnRqQQM2AgALIAAgBUEBajYCMAJAIAAoAhAiBSAAKAIUIgZPBEAgByAGQQF0QYABIAYbEDkgACgCDCAAKAIQIgVBBHRqIgZBADYCAAwBCyAHKAIAIAVBBHRqIgZBADYCAAsgBkIANwIIIAYgATYCBCAAIAVBAWo2AhACQCAAKAIgIgEgACgCJCIFTwRAIAggBUEBdEGAASAFGxAlIAAoAhwgACgCICIBQQJ0akECNgIADAELIAgoAgAgAUECdGpBAjYCAAsgACABQQFqNgIgAkAgACgCMCIBIAAoAjQiBU8EQCAJIAVBAXRBgAEgBRsQJSAAKAIsIAAoAjAiAUECdGpBBzYCAAwBCyAJKAIAIAFBAnRqQQc2AgALIAAgAUEBajYCMAJAIAAoAhAiASAAKAIUIgVPBEAgByAFQQF0QYABIAUbEDkgACgCDCAAKAIQIgFBBHRqIgVBADYCAAwBCyAHKAIAIAFBBHRqIgVBADYCAAsgBUIFNwIIIAUgBDYCBCAAIAFBAWo2AhACQCAAKAIgIgEgACgCJCIFTwRAIAggBUEBdEGAASAFGxAlIAAoAhwgACgCICIBQQJ0akECNgIADAELIAgoAgAgAUECdGpBAjYCAAsgACABQQFqNgIgAkAgACgCMCIBIAAoAjQiBU8EQCAJIAVBAXRBgAEgBRsQJSAAKAIsIAAoAjAiAUECdGpBCDYCAAwBCyAJKAIAIAFBAnRqQQg2AgALIAAgAUEBajYCMAJAIAAoAhAiASAAKAIUIgVPBEAgByAFQQF0QYABIAUbEDkgACgCDCAAKAIQIgFBBHRqIgVBADYCAAwBCyAHKAIAIAFBBHRqIgVBADYCAAsgBUIKNwIIIAUgAjYCBCAAIAFBAWo2AhACQCAAKAIgIgEgACgCJCIFTwRAIAggBUEBdEGAASAFGxAlIAAoAhwgACgCICIBQQJ0akECNgIADAELIAgoAgAgAUECdGpBAjYCAAsgACABQQFqNgIgAkAgACgCMCIBIAAoAjQiBU8EQCAJIAVBAXRBgAEgBRsQJSAAKAIsIAAoAjAiAUECdGpBBjYCAAwBCyAJKAIAIAFBAnRqQQY2AgALIAAgAUEBajYCMAJAIAAoAhAiASAAKAIUIgVPBEAgByAFQQF0QYABIAUbEDkgACgCDCAAKAIQIgFBBHRqIgVBADYCAAwBCyAHKAIAIAFBBHRqIgVBADYCAAsgBUIBNwIIIAUgAjYCBCAAIAFBAWo2AhACQCAAKAIgIgIgACgCJCIBTwRAIAggAUEBdEGAASABGxAlIAAoAhwgACgCICICQQJ0akEDNgIADAELIAgoAgAgAkECdGpBAzYCAAsgACACQQFqNgIgAkAgACgCMCICIAAoAjQiAU8EQCAJIAFBAXRBgAEgARsQJSAAKAIsIAAoAjAiAkECdGpBCjYCAAwBCyAJKAIAIAJBAnRqQQo2AgALIAAgAkEBajYCMAJAIAAoAhAiAiAAKAIUIgFPBEAgByABQQF0QYABIAEbEDkgACgCDCAAKAIQIgJBBHRqIgFBADYCAAwBCyAHKAIAIAJBBHRqIgFBADYCAAsgAUIINwIIIAEgBDYCBCAAIAJBAWo2AhACQCAAKAIgIgQgACgCJCIBTwRAIAggAUEBdEGAASABGxAlIAAoAhwgACgCICIEQQJ0akEDNgIADAELIAgoAgAgBEECdGpBAzYCAAsgACAEQQFqNgIgAkAgACgCMCIEIAAoAjQiAU8EQCAJIAFBAXRBgAEgARsQJSAAKAIsIAAoAjAiBEECdGpBCzYCAAwBCyAJKAIAIARBAnRqQQs2AgALIAAgBEEBajYCMAJAIAAoAhAiBCAAKAIUIgFPBEAgByABQQF0QYABIAEbEDkgACgCDCAAKAIQIgRBBHRqIgFBADYCAAwBCyAHKAIAIARBBHRqIgFBADYCAAsgAUIENwIIIAEgAzYCBCAAIARBAWo2AhACQCAAKAIgIgEgACgCJCICTwRAIAggAkEBdEGAASACGxAlIAAoAhwgACgCICIBQQJ0akEDNgIADAELIAgoAgAgAUECdGpBAzYCAAsgACABQQFqNgIgAkAgACgCMCIBIAAoAjQiAk8EQCAJIAJBAXRBgAEgAhsQJSAAKAIsIAAoAjAiAUECdGpBCTYCAAwBCyAJKAIAIAFBAnRqQQk2AgALIAAgAUEBajYCMCAKQQA2AgwgAAJ/IAAoAgQiASAAKAIISQRAIAFBADYCACABQQhqQQBBOPwLACABQQA2AkQgASABLQBAQeABcToAQCABQcgAagwBCyAAIApBDGoQhwILIgE2AgQgCkEDNgIMIAACfyAAKAIIIAFLBEAgAUEDNgIAIAFBCGpBAEE4/AsAIAFBADYCRCABIAEtAEBB4AFxOgBAIAFByABqDAELIAAgCkEMahCHAgsiATYCBCAKQQY2AgwgAAJ/IAAoAgggAUsEQCABQQY2AgAgAUEIakEAQTj8CwAgAUEANgJEIAEgAS0AQEHgAXE6AEAgAUHIAGoMAQsgACAKQQxqEIcCCyIBNgIEIApBCTYCDCAAAn8gACgCCCABSwRAIAFBCTYCACABQQhqQQBBOPwLACABQQA2AkQgASABLQBAQeABcToAQCABQcgAagwBCyAAIApBDGoQhwILNgIEIApBEGokAAtKAQd/QQQQIyIDIAI2AgBBBBAjIgQgAjYCAEGI8AEgAUGQ6wEiAUEAIQJB1iVBASEFQcEBIAMgASACQdolaiAFQcEBaiAEEAogAAvaCAMKfwJ+An0jAEEwayIGJAAgBiAAKAIEIAAoAgBrQQR1Igk2AhwgBkJ/NwIUIAYgAjYCECAGIAE2AgwgBiABrSACrUIghoQiDTcDKEEAIQIjAEEQayIIJAACQCAAQRhqIgcoAgQiBEUNACAHKAIMRQ0AIAggBikDKCIONwMIIAhBCGpBCBD3ASEFIAcoAgACfyAFIARBAWtxIARpIgNBAU0NABogBSAEIAVLDQAaIAUgBHALIgpBAnRqKAIAIgFFDQAgASgCACIBRQ0AIARBAWshCyADQQFLIQwDQAJAIAUgASgCBCIDRwRAAkAgDEUEQCADIAtxIQMMAQsgAyAESQ0AIAMgBHAhAwsgAyAKRw0DDAELIAEpAwggDlINACABIQIMAgsgASgCACIBDQALCyAIQRBqJAACQAJAIAJFDQAgAigCECIDIAIoAhQiAUYNACAGIAFBBGsiASgCACIENgIUIAAoAgAgBEEEdGogCTYCCCACIAE2AhQgASADRw0BIwBBEGsiAyQAIAIoAgAaIANBBGogByACEMIEIAMoAgQhASADQQA2AgQgAQRAAkACQCADLQAMQQFGBEAgASgCECICRQ0BIAEgAjYCFCABKAIYGiACECIMAQsgAUUNAQsgARAiCwsgA0EQaiQADAELIAYgDUIgiTcDACAGIAY2AiRBACECIwBBEGsiCCQAIAggBikDACINNwMIIAhBCGpBCBD3ASEBIAYCfwJAIAcoAgQiBEUNACAHKAIAAn8gBEEBayABcSAEaSIFQQFNDQAaIAEgASAESQ0AGiABIARwCyICQQJ0aigCACIDRQ0AIAMoAgAiA0UNACAEQQFrIQkgBUEBSyEKA0ACQCABIAMoAgQiBUcEQAJAIApFBEAgBSAJcSEFDAELIAQgBUsNACAFIARwIQULIAIgBUcNAwwBCyADKQMIIA1SDQBBAAwDCyADKAIAIgMNAAsLQSAQIyIDIAE2AgQgA0EANgIAIAYoAiQpAwAhDSADQQA2AhggA0IANwMQIAMgDTcDCAJAQQAgBCAHKAIMQQFqsyIPIAcqAhAiECAEs5ReGw0AIAcgBCAEQQFrcUEARyAEQQNJciAEQQF0ciICIA8gEJWN/AEiBCACIARLGxBwIAcoAgQiBCAEQQFrIgJxRQRAIAEgAnEhAgwBCyABIARJBEAgASECDAELIAEgBHAhAgsCQCAHKAIAIgkgAkECdGoiAigCACIBRQRAIAMgBygCCDYCACAHIAM2AgggAiAHQQhqNgIAIAMoAgAiAUUNASABKAIEIQUCQCAEIARBAWsiAXFFBEAgASAFcSEFDAELIAQgBUsNACAFIARwIQULIAkgBUECdGogAzYCAAwBCyADIAEoAgA2AgAgASADNgIACyAHIAcoAgxBAWo2AgxBAQs6ACwgBiADNgIoIAhBEGokACAGKAIoQRBqIAZBHGoQPQsgACAGQQxqEOMEIAZBMGokAAsbACAABEAgACgCABCLAiAAKAIEEIsCIAAQIgsLmAIBBX8jAEEgayIGJAACQAJAIAAoAgQiAiAAKAIIIgNJBEAgAiABQcAA/AoAACACQUBrIQEMAQsgAiAAKAIAIgRrQQZ1IgVBAWoiAkGAgIAgTw0BIAZBDGpB////HyADIARrIgNBBXUiBCACIAIgBEkbIANBwP///wdPGyAFIAAQqQEiAigCCCIFIAFBwAD8CgAAIAIoAgQgACgCBCAAKAIAIgNrIgFrIQQgAQRAIAQgAyAB/AoAAAsgACgCACEDIAAgBDYCACACIAM2AgQgACAFQUBrIgE2AgQgAiADNgIIIAAoAgghBCAAIAIoAgw2AgggAiADNgIAIAIgBDYCDCACEKkCCyAAIAE2AgQgBkEgaiQADwsQJgALjgECAn8BfCMAQRBrIgIkAEH4ngItAABBAXFFBEBBAkHciwJBAxAGIQNB+J4CQQE6AABB9J4CIAM2AgALIAIgASkCADcDCCACQQA2AgRB9J4CKAIAQQBBACACQQRqIAJBCGoQBSEEIAIoAgQhASAAIAT8AzYCBCAAQZygAjYCACABBEAgARAECyACQRBqJAALrAICBn8BfiMAQTBrIgIkAEGoAhAjIgNBoJACNgIAIANCADcCBCADQRBqEDshBCACIAM2AiggAiAENgIkIAEoAgQiBiABKAIAIgVrIgNBGG0hB0EAIQECQCAFIAZGDQAgAxAnIQEgA0UNACABIAUgA/wKAAALIAIgBzYCICACIAE2AhwgBCACQRxqQQAQ/gMgAQRAIAEQIgsgAkEMaiACQSRqEFkgAiACKQIMIgg3AhQgAkIANwIMIAIgCDcDACAAIAIQQwJAIAIoAhAiAEUNACAAIAAoAgQiAUEBazYCBCABDQAgACAAKAIAKAIIEQAAIAAQJAsCQCACKAIoIgBFDQAgACAAKAIEIgFBAWs2AgQgAQ0AIAAgACgCACgCCBEAACAAECQLIAJBMGokAAuwAgICfwF+IwBBMGsiAiQAIAJBJGogAUEAECsQKgJAIAIoAiQiAygCRCIBBEAgACABEEYMAQtBqAIQIyIBQaCQAjYCACABQgA3AgQgAUEQaiADEDchAyACIAE2AiAgAiADNgIcIAMQjgEgAxBaIAJBDGogAkEcahBZIAIgAikCDCIENwIUIAJCADcCDCACIAQ3AwAgACACEEMCQCACKAIQIgBFDQAgACAAKAIEIgFBAWs2AgQgAQ0AIAAgACgCACgCCBEAACAAECQLIAIoAiAiAEUNACAAIAAoAgQiAUEBazYCBCABDQAgACAAKAIAKAIIEQAAIAAQJAsCQCACKAIoIgBFDQAgACAAKAIEIgFBAWs2AgQgAQ0AIAAgACgCACgCCBEAACAAECQLIAJBMGokAAtaAQN/IwBBEGsiASQAIAFBCGogAEEAECsQKiABKAIIKAJMAkAgASgCDCIARQ0AIAAgACgCBCIDQQFrNgIEIAMNACAAIAAoAgAoAggRAAAgABAkCyABQRBqJAAL6AEBBn8CQCAAIAFHBEAgBSgCACEFA0AgAiADRgRAIAAgAUYNAwNAIAQgACgCADYCACAEQQRqIQQgAEEEaiIAIAFHDQALDAMLAkACQAJAIAUgAigCACIGQQR0aiIHKAIEIgggBSAAKAIAIglBBHRqIgooAgQiC0YEQCAHKAIAIAooAgBIDQEMAgsgCCALTg0BCyAEIAY2AgAgAkEEaiECDAELIAQgCTYCACAAQQRqIQALIARBBGohBCAAIAFHDQALCyACIANGDQADQCAEIAIoAgA2AgAgBEEEaiEEIAJBBGoiAiADRw0ACwsLXQEBfwJAIAAgAUYNACAAKAIAIgIEQCACECILIABCADcCACAAIAEoAgQiAjYCCCAAIAI2AgQgAkUNACAAIAJBA3QiABAnIgI2AgAgAEUNACACIAEoAgAgAPwKAAALC+0BAQV/IwBBEGsiAiQAIAAoAkwhBCACQQA2AgggAkIANwIAIAIgBEEAEDEgACgCXCIDBEADQCAAKAJYIAFBAnRqKAIAIgVBAE4EQCACKAIAIAVBAnRqQQE2AgALIAFBAWoiASADRw0ACwsgAigCACEDIAQEQCAAKAJIIQVBACEBA0AgAyABQQJ0aigCAEUEQCAFIAFBGGxqIgBCgICAgICAgPz/ADcDECAAQoCAgICAgID8/wA3AwggAEKAgICAgICA/P8ANwMACyABQQFqIgEgBEcNAAsgAigCACEDCyADBEAgAxAiCyACQRBqJAAL4gcCDX8LfCMAQUBqIgUkACAAKAJMIQIgBUIANwM4IAVCADcDMCAFQgA3AyggBUIANwMAIAVCADcDCCAFQgA3AxAgAEGYAWogAiAFEGcgBUEcaiAAKAJMEOwBIQYgACgCTCICBEADQCAGKAIAIAFBAnRqQf////8HNgIAIAFBAWoiASACRw0ACwsgACgCXCIDBEADQEH/////ByECAkAgACgCWCAEQQJ0aigCACIHQQBIDQADQCAGKAIAIAdBAnRqIgEgBCABKAIAIgEgASACRiICGzYCACACDQEgASICIARODQALCyAEQQFqIgQgA0cNAAsLIAAoAkwiCQRAQQAhAgNARAAAAAAAAAAAIQ5EAAAAAAAAAAAhEkQAAAAAAAAAACEQIAYoAgAgAkECdGooAgAiBCEBAkAgBEH/////B0YEQCAAKAKYASACQRhsaiIBQgA3AxAgAUIANwMIIAFCADcDAAwBCwNAQX5BAUF+QQEgACgCaCABQQJ0aigCACIBQQNvQQJGGyABaiIBIAFBA20iCkEDbGtBAkYbIgcgAWoiC0EDbyEMAkAgACgCSCIDIAAoAlgiDSABQQJ0aiIIIAdBAnRqKAIAQRhsaiIHKwMAIAMgCCgCAEEYbGoiCCsDACIRoSIPIA8gD6IgBysDCCAIKwMIIhOhIg8gD6KgIAcrAxAgCCsDECIUoSIVIBWioJ8iFqMiF71C////////////AINC//////////f/AFYNACARIAMgDUF4QQQgDEECRhtqIAtBAnRqKAIAQRhsaiIDKwMAoSIRIBEgEaIgEyADKwMIoSIRIBGioCAUIAMrAxChIhMgE6KgnyIUoyIYvUL///////////8Ag0KAgICAgICA+P8AWg0AIA4CfEQAAAAAAAAAACAVIBajIBMgFKOiIA8gFqMgESAUo6IgFyAYokQAAAAAAAAAAKCgoCIORAAAAAAAAPC/ZQ0AGkQYLURU+yEJQCAORAAAAAAAAPA/Zg0AGiAOmhBdCyIPIAAoAqgBIApBGGxqIgMrAxCioCEOIBIgDyADKwMIoqAhEiAQIA8gAysDAKKgIRALIAEgBEcNAAsgACgCmAEgAkEYbGoiASAOIA4gDqIgEiASoiAQIBCioKCfIg6jRAAAAAAAAAAAIBAgDqMiEL1C////////////AINCgICAgICAgPj/AFQiBBs5AxAgASASIA6jRAAAAAAAAAAAIAQbOQMIIAEgEEQAAAAAAAAAACAEGzkDAAsgAkEBaiICIAlHDQALCyAGKAIAIgAEQCAGIAA2AgQgBigCCBogABAiCyAFQUBrJAALgAEBBH8gACgCBCIDIAFBAXRLIANBEEtxAkAgASADTQ0AIAAgARA5IAEgACgCBCIDayIEQQBMDQAgACgCACADQQR0aiEDA0AgAyACKQIINwIIIAMgAikCADcCACADQRBqIQMgBEEBSyAEQQFrIQQNAAsLIAAgATYCBARAIAAQgwELCz4AIAMEQCAAIAMQ8gEgACgCBCEDIAEgAkcEQANAIAMgARAuQRhqIQMgAUEYaiIBIAJHDQALCyAAIAM2AgQLC4gBAQl8IAErAzAhBiABKwMAIQcgASsDGCEIIAErAzghCSABKwMIIQogASsDICELIAAgAisDACIDIAErAxCiIAIrAwgiBCABKwMooqAgAisDECIFIAErA0CioDkDECAAIAMgCqIgBCALoqAgBSAJoqA5AwggACADIAeiIAQgCKKgIAUgBqKgOQMAC0oBAn8gACgCBCICIAAoAggiAUcEQANAIAAgAUEQayIBNgIIIAEQLxogAiAAKAIIIgFHDQALCyAAKAIAIgEEQCAAKAIMGiABECILCzABAn8jAEGgAmsiASQAIAFBCGoQOyICQQ42AkQgACACEO8BIAIQOhogAUGgAmokAAt3AQF/IwBBMGsiAyQAIANBGGogASACEJcCIAMgASACQRhqEJcCIABBMGogASACQTBqEJcCIAAgAykDKDcDECAAIAMpAyA3AwggACADKQMYNwMAIAAgAykDADcDGCAAIAMpAwg3AyAgACADKQMQNwMoIANBMGokAAuMAQECfyAAIAEoAgA2AgACQAJAIAEoAgQiAkUEQCAAQQA2AgQMAQsgAigCBCEBA0ACQCABQX9GBEBBACECDAELIAIgAUEBaiACKAIEIgMgASADRiIBGzYCBCABDQAgAyEBDAELCyAAIAI2AgQgAg0BC0EEEHQiAEG05gE2AgAgAEHA5gFBvQMQCwALIAALUgEBfyAAQQA2AgggAEIANwIAIAEEQCAAIAEQowIgACgCBCECIAFBDGxBDGsiASABQQxwa0EMaiIBBEAgAkEAIAH8CwALIAAgASACajYCBAsgAAs4AQF/IAAEQCAAKAIAEJ0CIAAoAgQQnQIgACgCGCIBBEAgACABNgIcIAAoAiAaIAEQIgsgABAiCwvlAgEKfyAAIQYgAigCGCEHIAIoAhAhCCACKAIIIQkgAigCACEKAkAgAQRAIABFDQEgAS0AEEEBcQ0BQQAhAgNAIAJBAWoiAkGACEYEQEEAIQIgAS0AEA0DCyAJIANBAnQiBGooAgAiAARAIAAgAEEfdSIFcyAFayELIAQgCGohDCAHIANBGGxqIQRBACEAA0AgCiAMKAIAQRhsaiAAQRhsaiIFIAQpAxA3AxAgBSAEKQMINwMIIAUgBCkDADcDACAAQQFqIgAgC0cNAAsLIANBAWoiAyAGRw0ACwwBCyAARQ0AA0AgCSADQQJ0IgFqKAIAIgAEQCAAIABBH3UiAnMgAmshBCABIAhqIQUgByADQRhsaiEBQQAhAANAIAogBSgCAEEYbGogAEEYbGoiAiABKQMQNwMQIAIgASkDCDcDCCACIAEpAwA3AwAgAEEBaiIAIARHDQALCyADQQFqIgMgBkcNAAsLC4OPAQQjfyF8AX4CfSMAQaAIayIFJAAgASgCkAEhBiAFQQA6AIQGIAVBADYCgAYgBSAGNgL8BQJAIAEoAgAiAygCRARAIAAQOyABKAIAKAJENgJEDAELIAEoAgQiBCgCRARAIAAQOyABKAIEKAJENgJEDAELIAQoAlwhCCADKAJcQQJNBEAgAiAIQQNJckUEQCAAIAQQNxoMAgsgABA7GgwBCyAIQQJNBEAgAkECRgRAIAAQOxoMAgsgACADEDcaDAELIAUgATYC9AUgBSAFQfwFajYC+AUCQAJAIAZFBEAgBUEBNgKABgwBCyAGIAYoAgxBAWo2AgwgASgCkAEhAyAFQQE2AoAGIANFDQAgAy0AEEEBRw0AIAVBiAZqEDsiA0EONgJEIAVB0ANqIANByAD8CgAAIAUgAygCSDYCmAQgBSADKAJMNgKcBCAFIAMoAlA2AqAEIANBADYCUCADQgA3A0ggBSADKAJkNgK0BCADQQA2AmQgBSADKAJYNgKoBCAFIAMoAlw2AqwEIAUgAygCYDYCsAQgA0EANgJgIANCADcDWCAFIAMoAnQ2AsQEIANBADYCdCAFIAMoAmg2ArgEIAUgAygCbDYCvAQgBSADKAJwNgLABCADQQA2AnAgA0IANwNoIAUgAygChAE2AtQEIANBADYChAEgBSADKAJ4NgLIBCAFIAMoAnw2AswEIAUgAygCgAE2AtAEIANBADYCgAEgA0IANwN4IAUgAygCiAE2AtgEIAUgAygCjAE2AtwEIAUgAygCkAE2AuAEIANBADYCkAEgA0IANwOIASAFIAMoApgBNgLoBCAFIAMoApwBNgLsBCAFIAMoAqABNgLwBCADQQA2AqABIANCADcDmAEgBSADKAKoATYC+AQgBSADKAKsATYC/AQgBSADKAKwATYCgAUgA0EANgKwASADQgA3A6gBIAUgAygCuAE2AogFIAUgAygCvAE2AowFIAUgAygCwAE2ApAFIANBADYCwAEgA0IANwO4ASAFIAMoAsgBNgKYBSAFIAMoAswBNgKcBSAFIAMoAtABIgY2AqAFIAUgAygC1AEiCDYCpAUgBUGgBWohBAJAIAhFBEAgBSAENgKcBQwBCyAGIAQ2AgggA0IANwPQASADIANB0AFqNgLMAQsgBSADKALYATYCqAUgBSADKALcATYCrAUgBSADKALgATYCsAUgA0EANgLgASADQgA3A9gBIAUgAygC6AE2ArgFIAUgAygC7AE2ArwFIAUgAygC8AE2AsAFIANBADYC8AEgA0IANwPoASAFIAMoAvgBNgLIBSAFIAMoAvwBNgLMBSAFIAMoAoACNgLQBSADQQA2AoACIANCADcD+AEgBSADKAKIAjYC2AUgBSADKAKMAjYC3AUgBSADKAKQAjYC4AUgA0EANgKQAiADQgA3A4gCIAVBAToA6AUgAxA6GiAFLQDoBUEBRw0AIAAgBUHQA2oiABA3GiAFLQDoBUEBRw0BIAAQOhoMAQsgAS0AjAFFBEAgABA7QQw2AkQMAQtBf0EBIAJBAkcbIQYgASgCICEDIAVBADYCyAMgBUIANwLAAyAFQcADaiADECUgBSADNgLEAyABKAJQIQMgBUEANgK4AyAFQgA3ArADIAVBsANqIAMQJSAFIAM2ArQDIAEoAnAhAyAFQQA2AqgDIAVCADcCoAMgBUGgA2ogAxAlIAUgAzYCpAMgASgCgAEhAyAFQQA2ApgDIAVCADcCkAMgBUGQA2ogAxAlIAUgAzYClAMgASgCICIDBEAgASgCHCIEIANBAnRqIQggBSgCwAMhAwNAIAMgBCgCACAGbDYCACADQQRqIQMgBEEEaiIEIAhHDQALCyABKAJQIgMEQCABKAJMIgQgA0ECdGohCCAFKAKwAyEDA0AgAyAEKAIAIAZsNgIAIANBBGohAyAEQQRqIgQgCEcNAAsLIAEoAnAiAwRAIAJBAkchCCABKAJsIgQgA0ECdGohCSAFKAKgAyEDA0AgAyAEKAIAIAZsIAhqNgIAIANBBGohAyAEQQRqIgQgCUcNAAsLIAEoAoABIgMEQCABKAJ8IgQgA0ECdGohCCACRSEJIAUoApADIQMDQCADIAQoAgAgBmwgCWo2AgAgA0EEaiEDIARBBGoiBCAIRw0ACwsgASgCACgCTCEJIAVBADYCiAMgBUIANwKAAyAFQYADaiAJECUgBSAJNgKEAyAFKAKgAyIDIAUoAqQDIgRBAnRqIQcgBSgCgAMhCAJAIARFDQAgAygCACEGIAhBADYCACAEQQFGDQAgBiAGQR91IgRzIARrIQYgA0EEaiEEIAghAwNAIAQoAgAhCyADIAY2AgQgBiALIAtBH3UiCnMgCmtqIQYgA0EEaiEDIARBBGoiBCAHRw0ACwsgCCAJQQJ0akEEaygCACEDIAdBBGsoAgAhBCABKAIEKAJMIQkgBUEANgL4AiAFQgA3AvACIAVB8AJqIAkQJSAFIAk2AvQCIAUoApADIgcgBSgClAMiBkECdGohCyAFKALwAiEIAkAgBkUNACAHKAIAIQogCCAEIARBH3UiDHMgDGsgAyADQR91IgRzIARraiIDNgIAIAZBAUYNACADIAogCkEfdSIEcyAEa2ohBiAHQQRqIQQgCCEDA0AgBCgCACEHIAMgBjYCBCAGIAcgB0EfdSIKcyAKa2ohBiADQQRqIQMgBEEEaiIEIAtHDQALCyAIIAlBAnRqQQRrKAIAIQMgC0EEaygCACEEIAEoAjAhCSAFQQA2AugCIAVCADcC4AIgBUHgAmogCRAlIAUgCTYC5AIgBCAEQR91IgZzIAZrIAMgA0EfdSIEcyAEa2oiICEEIAEoAjAEQCAFKALAAyIDIAUoAsQDIgRBAnRqIQcgBSgC4AIhCAJAIARFDQAgAygCACEGIAggIDYCACAEQQFGDQAgBiAGQR91IgRzIARrICBqIQYgA0EEaiEEIAghAwNAIAQoAgAhCyADIAY2AgQgBiALIAtBH3UiCnMgCmtqIQYgA0EEaiEDIARBBGoiBCAHRw0ACwsgB0EEaygCACIDIANBH3UiA3MgA2sgCCAJQQJ0akEEaygCACIDIANBH3UiA3MgA2tqIQQLIAEoAmAhCSAFQQA2AtgCIAVCADcC0AIgBUHQAmogCRAlIAUgCTYC1AIgASgCYARAIAUoArADIgMgBSgCtAMiBkECdGohByAFKALQAiEIAkAgBkUNACADKAIAIQsgCCAENgIAIAZBAUYNACAEIAsgC0EfdSIGcyAGa2ohBiADQQRqIQQgCCEDA0AgBCgCACELIAMgBjYCBCAGIAsgC0EfdSIKcyAKa2ohBiADQQRqIQMgBEEEaiIEIAdHDQALCyAHQQRrKAIAIgMgA0EfdSIDcyADayAIIAlBAnRqQQRrKAIAIgMgA0EfdSIDcyADa2ohBAsgBUGIBmoQOyELAkAgBEUEQCAAIAsQowEaDAELIAsgASgCBCIDKwMwIiYgASgCACIGKwMwIicgJiAnZBs5AzAgCyADKwM4IiYgBisDOCInICYgJ2QbOQM4IAtByABqIAQQiAUgASgCkAEhBCABKAIAIgYoAkwhAyAFIAsoAkg2ArACIAUgCygCTDYCtAIgBSAFKQKgAzcCuAIgBSAFKQKAAzcCwAIgBSAGKAJINgLIAiAFIAM2AswCIAMgBCAFQbACahCeAiABKAKQASEEIAEoAgQiBigCTCEDIAUgCygCSDYCkAIgBSALKAJMNgKUAiAFIAUpApADNwKYAiAFIAUpAvACNwKgAiAFIAYoAkg2AqgCIAUgAzYCrAIgAyAEIAVBkAJqEJ4CIAEoApABIQMgBSALKAJINgLwASAFIAsoAkw2AvQBIAUgBSkC4AI3AoACIAUgBSgCwAM2AvgBIAUgBSgCxAMiBDYC/AEgBSABKQIsNwKIAiAEIAMgBUHwAWoQngIgASgCkAEhAyAFIAsoAkg2AtABIAUgCygCTDYC1AEgBSAFKQLQAjcC4AEgBSAFKAKwAzYC2AEgBSAFKAK0AyIENgLcASAFIAEpAlw3AugBIAQgAyAFQdABahCeAiAFQdADaiIDIAVB9AVqEHggBS0A6AVBAUYEQCAAIAMQNxogBS0A6AVBAUcNASADEDoaDAELIAUgBUHIAWoiFTYCxAEgBUIANwLIASAFIAVBvAFqIhk2ArgBIAVCADcCvAEgBSAFQbABaiIXNgKsASAFQgA3ArABIAVBxAFqIAVBrAFqIgMgAUEMaiIEIAVBwANqIAVB4AJqIAEoAgBB2ABqQQFBACABKAKQARDvBCAFQbgBaiADIAFBPGoiFCAFQbADaiAFQdACaiABKAIEQdgAakEAIAEoAhAgASgCkAEQ7wQgBUHQA2oiAyAFQfQFahB4AkAgBS0A6AVBAUYEQCAAIAMQNxogBS0A6AVBAUcNASADEDoaDAELQQAhAyAFQQA2AuQCIAVB4AJqEC0gBUEANgLUAiAFQdACahAtIAVBADYCpAEgBUIANwKcASAFQQA2ApQBIAVCADcCjAEgBUHQA2ohDSABKAIAIQ4gASgCBCERIAJBAUYhFiABKAKQASEMIwBBkAFrIgkkACARKAJcIQYgDigCXCEIIAlBADYCSCAJQgA3AkAgCUFAayAGQQNuIAhBA25qQQAQMSARKAJcIQYgDigCXCEKIAkgCSgCQCIHNgIwIAkgDkHYAGoiCDYCLCAJIApBA24iDzYCNCAJIAUpAqADNwI4IA8gDCAJQSxqEOsEIBEoAlwgCSAGQQNuIhA2AiAgCSAHIA9BAnRqIgo2AhwgCSARQdgAaiISNgIYIAkgBSkCkAM3AiRBA24gDCAJQRhqEOsEIAUoAsADIRMCQAJAAkACQCAFKALEAyIGQaCNBk8EQCAMBEACQCAMLQAQDQBBACEEQQAhCANAIARBAWoiBEGACEYEQEEAIQQgDC0AEA0CCyABKAIMIAhBA3RqIhAoAgAhDyAKIBAoAgRBAnRqIhQgEyAIQQJ0aigCACIQIBBBH3UiEHMgEGsiECAUKAIAajYCACAHIA9BA21BAnRqIhQgFCgCACAQajYCACAHIA4oAmggD0ECdGooAgBBA21BAnRqIg8gDygCACAQajYCACAIQQFqIgggBkcNAAsLIAUoArQDIhBFDQMgDC0AEEEBcQ0DIAUoArADIRNBACEGQQAhCANAIAZBAWoiBkGACEYEQEEAIQYgDC0AEA0FCyABKAI8IAhBA3RqIg8oAgQhBCAHIA8oAgBBAnRqIhQgEyAIQQJ0aigCACIPIA9BH3UiD3MgD2siDyAUKAIAajYCACAKIARBA21BAnRqIhQgFCgCACAPajYCACAKIBEoAmggBEECdGooAgBBA21BAnRqIgQgBCgCACAPajYCACAIQQFqIgggEEcNAAsMAgtBACEIA0AgASgCDCAIQQN0aiIMKAIAIQQgCiAMKAIEQQJ0aiIPIBMgCEECdGooAgAiDCAMQR91IgxzIAxrIgwgDygCAGo2AgAgByAEQQNtQQJ0aiIPIA8oAgAgDGo2AgAgByAOKAJoIARBAnRqKAIAQQNtQQJ0aiIEIAQoAgAgDGo2AgAgCEEBaiIIIAZHDQALIAUoArQDIgxFDQMgBSgCsAMhD0EAIQgDQCABKAI8IAhBA3RqIgYoAgQhBCAHIAYoAgBBAnRqIhAgDyAIQQJ0aigCACIGIAZBH3UiBnMgBmsiBiAQKAIAajYCACAKIARBA21BAnRqIhAgECgCACAGajYCACAKIBEoAmggBEECdGooAgBBA21BAnRqIgQgBCgCACAGajYCACAIQQFqIgggDEcNAAsMAwsgCSAINgJsIAkgBDYCaCAJIAY2AmQgCSATNgJgIAkgEDYCXCAJIAo2AlggCSAPNgJUIAkgBzYCUAJAIAwEQCAGRQ0BIAwtABBBAXENAUEAIQRBACEIA0AgBEEBaiIEQYAIRgRAQQAhBCAMLQAQDQMLIAlB0ABqIAgQ6gQgCEEBaiIIIAZHDQALDAELIAkgCDYCjAEgCSAENgKIASAJIAY2AoQBIAkgEzYCgAEgCSAQNgJ8IAkgCjYCeCAJIA82AnQgCSAHNgJwIAZFDQBBACEIA0AgCUHwAGogCBDqBCAIQQFqIgggBkcNAAsLIAUoArADIQYgBSgCtAMhBCAJIBI2AmwgCSAUNgJoIAkgBDYCZCAJIAY2AmAgCSAPNgJcIAkgBzYCWCAJIBA2AlQgCSAKNgJQIAwEQCAERQ0BIAwtABBBAXENAUEAIQpBACEHA0AgCkEBaiIKQYAIRgRAQQAhCiAMLQAQDQMLIAlB0ABqIAcQ6QQgB0EBaiIHIARHDQALDAELIAkgEjYCjAEgCSAUNgKIASAJIAQ2AoQBIAkgBjYCgAEgCSAPNgJ8IAkgBzYCeCAJIBA2AnQgCSAKNgJwIARFDQBBACEHA0AgCUHwAGogBxDpBCAHQQFqIgcgBEcNAAsLIAxFDQELIAwtABBBAUcNACANQQA2AgggDUIANwIAIA1CADcCECANQQA2AhgMAQsgDigCXCEEIBEoAlwhBiAJQQA2AnggCUIANwJwIAlB8ABqIARBA24gBkEDbmpBAWpBABAxIAkoAnAhBAJAIAkoAkQiBkUNACAEIAkoAkAiCigCAEEASiIINgIEIAZBAUYNACAKIAZBAnRqIQYgBEEEaiEHIApBBGohCgNAIAcgCCAKKAIAQQBKaiIINgIEIAdBBGohByAKQQRqIgogBkcNAAsLIAQgCSgCdEECdGpBBGsoAgAhCiAJQfAAaiARKAJcQQNuIA4oAlxBA25qQQAQMSALKAKsASEEIAtBqAFqIgwgChAzIAsgCjYCrAEgBEERSSAEIApBAXRNckUEQCAMEHEgCygCrAEhCgtBACEHIAlBADYCWCAJQgA3AlAgCUHQAGogChAlIAkgCjYCVCAJKAJQIQQCfyAOKAKsASIIRQRAIAQhBkEADAELIAkoAkAhCiAEIQYDQCAKIAdBAnRqKAIAQQBKBEAgBiAHNgIAIAZBBGohBgsgB0EBaiIHIAhHDQALQQAiCiAEIAZGDQAaIAYgBGtBAnUhCCAMKAIAIRAgDigCqAEhEwNAIBAgCkEYbGoiByATIAQgCkECdGooAgBBGGxqIg8pAxA3AxAgByAPKQMINwMIIAcgDykDADcDACAKQQFqIgogCEcNAAsgBiEEIAgLIQogBCEIIBEoAqwBIg8EQEEAIQcgCSgCQCEQA0AgECAHQQJ0aiAOKAKsAUECdGooAgBBAEoEQCAIIAc2AgAgCEEEaiEICyAHQQFqIgcgD0cNAAsLIBEoAqgBIQ4CQCAWBEAgCUEBOgAVIAkgDjYCECAMKAIAIApBGGxqIQogBCAIRwRAIAggBGtBAnUhDCAJKAIQIQ5BACEGA0AgDiAEIAZBAnRqKAIAQRhsaiIIKwMAISYgCCsDCCEnIAogBkEYbGoiByAIKwMQmjkDECAHICeaOQMIIAcgJpo5AwAgBkEBaiIGIAxHDQALCwwBCyAEIAhGDQAgCCAGa0ECdSERIAwoAgAgCkEYbGohCkEAIQcDQCAKIAdBGGxqIgYgDiAEIAdBAnRqKAIAQRhsaiIIKQMQNwMQIAYgCCkDCDcDCCAGIAgpAwA3AwAgB0EBaiIHIBFHDQALCyAJKAJAIQQgCSgCRCEGIAlBADYCAAJAIAQgBkECdGoiCAJ/IAkoAgAhByAIIARrQQJ1IgYEQANAIAQgByAEKAIARg0CGiAEQQRqIQQgBkEBayIGDQALC0EACyIEIAggBBsiBkYNACAGQQRqIgQgCEYNAANAIAQoAgAiByAJKAIARwRAIAYgBzYCACAGQQRqIQYLIARBBGoiBCAIRw0ACwsgCUEANgIIIAlCADcCACAJIAYgCSgCQGtBAnVBAWpBABAxIAkoAgAhBAJAIAYgCSgCQCIIRg0AIAQgCCgCACIMNgIEIAhBBGoiByAGRg0AIARBBGohCgNAIAogBygCACAMaiIMNgIEIApBBGohCiAHQQRqIgcgBkcNAAsLIA0gBDYCACANIAkoAgQ2AgQgDSAJKAIINgIIIA0gCSgCcDYCECANIAkoAnQ2AhQgDSAJKAJ4NgIYIAlBADYCeCAJQgA3AnAgCSgCUCIERQ0AIAQQIiAJKAJwIgRFDQAgBBAiCyAJKAJAIgQEQCAEECILIAlBkAFqJAAgBSAFQYwBajYCgAEgBSAFQZwBajYCfCAFKAJ8IgQgDUcEQCAEKAIAIgYEQCAGECILIARBADYCCCAEQgA3AgAgBCANKAIANgIAIAQgDSgCBDYCBCAEIA0oAgg2AgggDUEANgIIIA1CADcCAAsgBSgCgAEiBCANQRBqRwRAIAQoAgAiBgRAIAYQIgsgBEEANgIIIARCADcCACAEIA0oAhA2AgAgBCANKAIUNgIEIAQgDSgCGDYCCCANQQA2AhggDUIANwIQCyANKAIQIgQEQCAEECILIA0oAgAiBARAIAQQIgsgDSAFQfQFahB4AkAgBS0A6AVBAUYEQCAAIA0QNxogBS0A6AVBAUcNASANEDoaDAELIAVBADYCxAMgBUHAA2oQLSAFQQA2ArQDIAVBsANqEC0gBUEANgKEASAFQgA3AnwCQCAFKAKgASIERQ0AIAUoApwBIQggBEECdCIGECchAyAGRQ0AIAMgCCAG/AoAAAsgBSAENgKEASAFIAQ2AoABIAUgAzYCfCABKAIAKAJcIQMgBUEANgJ0IAVCADcCbCAFQewAaiIIIANBARCBASABKAIEKAJcIQMgBUEANgJkIAVCADcCXCAFQdwAaiIJIANBARCBASAFKAKcASAFKAKgAUECdGpBBGsoAgAhAyAFQQA2AlQgBUIANwJMIAVBzABqIgQgAxA5IAUgAzYCUCAFKAKcASAFKAKgAUECdGpBBGsoAgAhAyAFQQA2AkQgBUIANwI8IAVBPGoiBiADEDkgBSADNgJAIAsgBiAIIAVB/ABqIgMgBUHEAWogBCABKAIAIAVBoANqIAVBgANqIAUoAowBQQEgASgCkAEQ7gQgCyAGIAkgAyAFQbgBaiAEIAEoAgQgBUGQA2ogBUHwAmogBSgCjAEgASgCACgCXEEDbkECdGpBACABKAKQARDuBCAFQdADaiIDIAVB9AVqEHgCQCAFLQDoBUEBRgRAIAAgAxA3GiAFLQDoBUEBRw0BIAMQOhoMAQsgBSgCyAEQzQEgBSAVNgLEASAFQgA3AsgBIAUoArwBEM0BIAUgGTYCuAEgBUIANwK8ASABKAIAKAJcQQNuIQMgASgCkAEhCiMAQSBrIggkAAJAIAVBrAFqIgQoAgAiCSAEQQRqIhVGDQAgA0ECdCEZA0AgCgRAIAotABANAgsgCSgCFCEMIAkoAhAhDSAJKAIYIAkoAhwQzAEgCSgCGCIEIAkoAhwiBkYiDkUEQCALKAJIIRFEAAAAAAAA8H8hJkQAAAAAAADw/yEnRAAAAAAAAPD/ISlEAAAAAAAA8P8hKEQAAAAAAADwfyEqRAAAAAAAAPB/ISwgBCEDA0AgESADKAIIQRhsaiIHKwMQIi0gJyAnIC1jGyEnIAcrAwgiKyApICkgK2MbISkgBysDACIuICggKCAuYxshKCAmIC0gJiAtYxshJiAqICsgKiArYxshKiAsIC4gLCAuYxshLCADQRhqIgMgBkcNAAsgCygCSEEAQQhBECApICqhIikgJyAmoSImZBsiAyAmICggLKEiJ2MbIAMgJyApZBtqIQcgBCEDA0AgAyAHIAMoAghBGGxqKwMAOQMAIANBGGoiAyAGRw0ACwsgBSgCjAEiAyAZaiAMQQJ0aigCACERIAYgBGtBGG1BAXYhByADIA1BAnRqKAIAIQ8gBCEDAkAgDg0AA0AgBC0AEEEBcUUEQCAGIQMDQCADQRhrIgYgBEYEQCAEIQMMBAsgA0EIayAGIQMtAABBAXFFDQALIAggBCkDEDcDGCAIIAQpAwg3AxAgCCAEKQMANwMIIAQgAykDEDcDECAEIAMpAwg3AwggBCADKQMANwMAIAMgCCkDGDcDECADIAgpAxA3AwggAyAIKQMINwMAIARBGGoiBCADRw0BDAILIARBGGoiBCAGRw0ACyAGIQMLIAkoAhggAxDMASADIAkoAhwQzAEgBwRAIAUoAnwiAyARQQJ0aiEEIAMgD0ECdGohDiAFKAJMIREgBSgCPCEPIAkoAhghFkEAIQYDQCAWIAZBGGxqIgMgB0EYbGooAgghECADKAIIIRMgDiAOKAIAIhRBAWo2AgAgBCAEKAIAIhJBAWo2AgAgDyAUQQR0IhhqIgNBADYCDCADIBI2AgggAyAQNgIEIAMgEzYCACARIBhqIgNBfzYCDCADIA02AgggA0KAgICAcDcCACAPIBJBBHQiEmoiA0EANgIMIAMgFDYCCCADIBM2AgQgAyAQNgIAIBEgEmoiA0F/NgIMIAMgDDYCCCADQoGAgIBwNwIAIAZBAWoiBiAHRw0ACwsCQCAJKAIEIgMEQANAIAMiCSgCACIDDQAMAgsACwNAIAkgCSgCCCIJKAIARw0ACwsgCSAVRw0ACwsgCEEgaiQAIAVB0ANqIgMgBUH0BWoQeCAFLQDoBUEBRgRAIAAgAxA3GiAFLQDoBUEBRw0BIAMQOhoMAQsgBSgCsAEQnQIgBSAXNgKsASAFQgA3ArABIAEoAgAhBgJAIAUoAnAiBEUEQEEAIQMMAQsgBSgCbCEIIAQQJyEDIARFDQAgAyAIIAT8CgAACyAFIAQ2AjQgBSAENgIwIAUgAzYCLCAGKAJcIQQgBSAFKAKMATYCJCAFIARBA242AiggBUH8AGogBUE8aiAFQcwAaiAGIAVBLGogBUGgA2ogBUGAA2ogBUEkakEBIAEoApABEO0EIAMEQCADECILIAVBADYCNCAFQgA3AiwgASgCBCEGQQAhBAJAIAUoAmAiA0UNACAFKAJcIQggAxAnIQQgA0UNACAEIAggA/wKAAALIAUgAzYCHCAFIAM2AhggBSAENgIUIAEoAgAoAlwhAyAFIAYoAlxBA242AhAgBSAFKAKMASADQQNuQQJ0ajYCDCAFQfwAaiAFQTxqIAVBzABqIAYgBUEUaiAFQZADaiAFQfACaiAFQQxqQQAgASgCkAEQ7QQgBARAIAQQIgsgBUEANgIcIAVCADcCFCAFQdADaiIDIAVB9AVqEHggBS0A6AVBAUYEQCAAIAMQNxogBS0A6AVBAUcNASADEDoaDAELIAVBADYCcCAFQewAahCEAyAFQQA2AmAgBUHcAGoQhAMgBUEANgKAASAFQfwAahAtIAVBADYCkAEgBUGMAWoQLSAFQQA2AqQDIAVBoANqEC0gBUEANgKUAyAFQZADahAtIAVBADYChAMgBUGAA2oQLSAFQQA2AvQCIAVB8AJqEC0gBSAFKQI8NwLQAyAFQZwBaiERIAVB0ANqIhQhDiAFQcwAaiEQIAEoApABIQ1BACEJQQAhDyMAQdACayIHJAACQCANBEAgDS0AEA0BCyAHQQA2AvwBIAdCADcC9AEgC0EANgLcASALQdgBaiITEIMBIA4oAgQhAyAHQQA2AuwBIAdCADcC5AEgB0HkAWogA0F/EDEgESgCBCEEIAdBADYC3AEgB0IANwLUASAHQdQBaiAEECUgByAENgLYASAHKALUASIDIARBAnRqQQRrQQA2AgAgB0IANwPIASAHQgA3A8ABIAdBgICA/AM2AtABIAdBADYCvAECQCARKAIEQQJOBEAgC0HIAGohFSAHQaABaiEZA0AgDQRAIA0tABANAwsCQCAJQQJ0IgMgESgCAGoiBCgCBCIGIAQoAgAiCEYEQCAHKALUASADakEANgIADAELIAcoAtQBIANqIAYgCGsiA0ECazYCACADQQVIDQAgCygCqAEgCUEYbGoiAysDCCInmSEoAnwgAysDECImmSIqIAMrAwAiKZkiLGRFICggKmNFckUEQEQAAAAAAAAAACEqRAAAAAAAAAAAIShEAAAAAAAA8D8MAQsgKCAsZARARAAAAAAAAPA/IShEAAAAAAAAAAAhKiAnISZEAAAAAAAAAAAMAQtEAAAAAAAA8D8hKkQAAAAAAAAAACEoICkhJkQAAAAAAAAAAAshJyAHQYQCaiIDIA4oAgAiCCAEKAIAIgRBBHRqIAggBkEEdGogBBD0AiAHICg5A6gCIAcgKJogKCAmRAAAAAAAAAAAYyIEGzkDwAIgByAqOQPIAiAHICqaICogBBs5A7ACIAcgJzkDuAIgByAnmiAnIAQbOQOgAiAHQTBqIgYgB0GgAmpBMPwKAAAgB0GQAmoiBCADIA4gFSAGEMcEIAcgAzYCnAIgB0GcAmoQKSAHQYgBaiAEIAsrAzBBABCRBCAHIAQ2AoQCIAMQKSAHKALUASAHKAK8AUECdGogBygCjAEgBygCiAFrQQR1IAcoApQBa0EDbjYCAEEAIQYjAEEQayIJJAAgBygCvAEhAyAHAn8CQCAHQcABaiIIKAIEIgpFDQAgCCgCAAJ/IApBAWsgA3EgCmkiDEEBTQ0AGiADIAMgCkkNABogAyAKcAsiBkECdGooAgAiBEUNACAEKAIAIgRFDQAgCkEBayESIAxBAUshFwNAAkAgAyAEKAIEIgxHBEACQCAXRQRAIAwgEnEhDAwBCyAKIAxLDQAgDCAKcCEMCyAGIAxHDQMMAQsgBCgCCCADRw0AQQAMAwsgBCgCACIEDQALC0HAABAjIQQgCSAINgIIIAkgBDYCBCAEIAM2AgQgBEEANgIAIAQgBygCvAE2AgggBCAHKAKIATYCECAEIAcoAowBNgIUIAQgBygCkAE2AhggB0EANgKQASAHQgA3A4gBIAQgBygCnAE2AiQgBCAHKQKUATcCHCAHKAKgASESIAdBADYCoAEgBEEoaiIEIBI2AgAgBCAHKAKkATYCBCAHQQA2AqQBIAQgBygCqAEiDDYCCCAEIAcoAqwBIhc2AgwgBCAHKgKwATgCECAXBEAgBEEIaiEXIAwoAgQhDAJAIAQoAgQiBCAEQQFrIhZxRQRAIAwgFnEhDAwBCyAEIAxLDQAgDCAEcCEMCyASIAxBAnRqIBc2AgAgB0IANwKoAQsgCUEBOgAMAkBBACAKIAgoAgxBAWqzIkggCCoCECJJIAqzlF4bDQAgCCAKIApBAWtxQQBHIApBA0lyIApBAXRyIgQgSCBJlY38ASIGIAQgBksbEHAgCCgCBCIKIApBAWsiBHFFBEAgAyAEcSEGDAELIAMgCkkEQCADIQYMAQsgAyAKcCEGCwJAIAgoAgAiEiAGQQJ0aiIGKAIAIgNFBEAgCSgCBCIEIAgoAgg2AgAgCCAENgIIIAYgCEEIajYCACAEKAIAIgNFDQEgAygCBCEMAkAgCiAKQQFrIgNxRQRAIAMgDHEhDAwBCyAKIAxLDQAgDCAKcCEMCyASIAxBAnRqIAQ2AgAMAQsgCSgCBCIEIAMoAgA2AgAgAyAENgIACyAJQQA2AgQgCCAIKAIMQQFqNgIMIAkoAgQhAyAJQQA2AgQgAwRAIAktAAxBAUYEQCADQQhqEMMECyADECILQQELOgCkAiAHIAQ2AqACIAlBEGokACAZEMcBIAcoAogBIgMEQCAHIAM2AowBIAcoApABGiADECILIAcoArwBIQkLIAcgCUEBaiIJNgK8ASAJIBEoAgRBAWtIDQALIAcoAtQBIQMLAkAgBygC2AEiBEUNACADKAIAIQkgA0EANgIAIARBAUYNACADIARBAnRqIQYgA0EEaiEIIAMhBANAIAgoAgAhCiAEIAk2AgQgBEEEaiEEIAkgCmohCSAIQQRqIgggBkcNAAsLIAtB2ABqIhkgAyAHKALYAUECdGpBBGsoAgBBA2wQyQEgBygC1AEgBygC2AFBAnRqQQRrKAIAIQMgB0IANwNwIAdCADcDeCAHQgA3A4ABIAcgBykDcDcDGCAHIAcpA3g3AyAgByAHKQOAATcDKCAHQfQBaiADIAdBGGoQZyAHKALUASAHKALYAUECdGpBBGsoAgAhAyAHQgA3A2AgB0IANwNoIAcgBykDYDcDCCAHIAcpA2g3AxAgEyADIAdBCGoQlQIgESgCBEEBRwRAA0AgDQRAIA0tABANAwsgByAPNgKgAiAHQcABaiAHQaACahCiAiEDAkAgD0ECdCIIIBEoAgBqIgYoAgQiBCAGKAIAIgZGDQAgBygC1AEgCGooAgAhCiALKAKoASAPQRhsaiIIKwMQISogCCsDCCEsIAgrAwAhLQJAAkACQAJAAkACQAJAIAQgBmtBA2sOAgABAgsgByAGNgKgAiAHIAZBAmoiAzYCqAIgByAGQQFqIgQ2AqQCIA4oAgAiCCAGQQR0aigCBCAIIANBBHRqKAIARgRAIAcgBDYCqAIgByADNgKkAgsgByAHKQLkATcCiAFBASEMIBkgB0GIAWogDiAKIAdBoAJqQQEQxgQMAgsCfCAqmSImIC2ZIidkRSAmICyZIilkRXJFBEBEAAAAAAAA8D8hJkQAAAAAAAAAACEoRAAAAAAAAAAAIScgKgwBCyAnICljBEBEAAAAAAAA8D8hJ0QAAAAAAAAAACEoRAAAAAAAAAAAISYgLAwBC0QAAAAAAAAAACEmRAAAAAAAAPA/IShEAAAAAAAAAAAhJyAtCyEpIAdBoAJqIgMgDigCACIIIAZBBHRqIAggBEEEdGogBhD0AiAHQYgBaiAHKAKgAhBgIRcgByADNgKQAiAHQZACahApIBcoAgAiCSgCCCEDIAkoAgAhBCAJKAIEIQggByAJKAIMIgw2AswCIAcgCDYCyAIgByAENgLEAiAHIAw2AsACIAcgAzYCvAIgByAINgK4AiAHIAw2ArQCIAcgAzYCsAIgByAENgKsAiAHIAM2AqgCIAcgCDYCpAIgByAENgKgAiAmmiAmIClEAAAAAAAAAABjIgkbIi8gCygCSCISIA4oAgAiFSADQQR0aigCAEEYbGoiAysDACI4oiAomiAoIAkbIjEgAysDCCI5oqAgJ5ogJyAJGyIyIAMrAxAiOqKgIkQgLyASIBUgBEEEdGooAgBBGGxqIgMrAwAiO6IgMSADKwMIIjyioCAyIAMrAxAiPaKgIjChIjMgM6IgJyA4oiAmIDmioCAoIDqioCJFICcgO6IgJiA8oqAgKCA9oqAiPqEiNCA0oqAhKyAvIBIgFSAIQQR0aigCAEEYbGoiAysDACI/oiAxIAMrAwgiQKKgIDIgAysDECJBoqAiQiAwoSI2IDaiICcgP6IgJiBAoqAgKCBBoqAiQyA+oSI3IDeioCEuIAsrAzAhKUEBIQkCQCA2IDSiIDcgM6KhIjVEAAAAAAAAAABkRQRAIDUgNaJEAAAAAAAAEECiICkgKSArIC4gKyAuZBuiomVFDQELIC8gEiAVIAxBBHRqKAIAQRhsaiIDKwMAIjWiIDEgAysDCCIxoqAgMiADKwMQIjKioCJGIDChIi8gL6IgJyA1oiAmIDGioCAoIDKioCIwID6hIicgJ6KgISYgMyAnoiA0IC+ioSIoRAAAAAAAAAAAZEUEQCAoICiiRAAAAAAAABBAoiApICkgJiArICYgK2QboqJlRQ0BC0EAIQkgRCBCoSIoIDAgQ6EiK6IgRSBDoSIzIEYgQqEiNKKhIjBEAAAAAAAAAABkRQRAIDAgMKJEAAAAAAAAEECiICkgKSA0IDSiICsgK6KgIisgKCAooiAzIDOioCIoICggK2MboqJlRQ0BCyA2ICeiIDcgL6KhIidEAAAAAAAAAABkRQRAICcgJ6JEAAAAAAAAEECiICkgKSAmIC4gJiAuZBuiomVFDQELIDsgOKEiJiAmoiA8IDmhIiYgJqKgID0gOqEiJiAmoqAgPyA1oSImICaiIEAgMaEiJiAmoqAgQSAyoSImICaioGQhCQsgByAHKQLkATcCkAIgGSAHQZACaiAOIAogB0GgAmogCUEYbGpBAhDGBCAXKAIAIgMEQCAHIAM2AowBIAcoApABGiADECILQQIhDAwBCyADKAIUIAMoAhAiCWtBBHUgAygCHCIDayIIIAhBA24iDEEDbCIVayESIApBA2whBCAHKALkASEXIA0EQAJAIAggEkYNACANLQAQQQFxDQAgBCADayEbIAkgA0EEdGohHCALKAJoIR0gCygCeCEeIAsoAlghHyAOKAIAIRZBACESQQAhCANAIBJBAWoiEkGACEYEQEEAIRIgDS0AEA0CCyAfIAQgCGpBAnQiGGogFiAcIAhBBHRqIhooAgBBBHRqKAIANgIAIBggHmogFiAaKAIAQQR0aigCDDYCACAYIB1qQX8gGyAaKAIIIhhqIAMgGEobNgIAIAhBAWoiCCAVRw0ACwsgA0UNAiANLQAQQQFxDQIgBCADayESQQAhBEEAIQgDQCAEQQFqIgRBgAhGBEBBACEEIA0tABANBAsgCSAIQQR0aiIVKAIIIhZBAE4EQCAXIBUoAgRBAnRqIBIgFmo2AgALIAhBAWoiCCADRw0ACwwBCyAIIBJHBEAgBCADayEaIAkgA0EEdGohGyALKAJoIRwgCygCeCEdIAsoAlghHiAOKAIAIRJBACEIA0AgHiAEIAhqQQJ0IhZqIBIgGyAIQQR0aiIYKAIAQQR0aigCADYCACAWIB1qIBIgGCgCAEEEdGooAgw2AgAgFiAcakF/IBogGCgCCCIWaiADIBZKGzYCACAIQQFqIgggFUcNAAsLIANFBEAgEygCACEIIAcoAvQBIQMgByAQKAIAIAZBBHRqIgQpAgg3A6gCIAcgBCkCADcDoAIMBAsgBCADayEEQQAhCANAIAkgCEEEdGoiEigCCCIVQQBOBEAgFyASKAIEQQJ0aiAEIBVqNgIACyAIQQFqIgggA0cNAAsLIBMoAgAhCCAHKAL0ASEDIAcgECgCACAGQQR0aiIEKQIINwOoAiAHIAQpAgA3A6ACIA1FDQIMAQsgEygCACEIIAcoAvQBIQMgByAQKAIAIAZBBHRqIgQpAgg3A6gCIAcgBCkCADcDoAILIAxFDQEgDS0AEEEBcQ0BIAggCkEEdGohBiADIApBGGxqIQhBACEEQQAhCQNAIARBAWoiBEGACEYEQEEAIQQgDS0AEA0DCyAIIAlBGGxqIgMgKjkDECADICw5AwggAyAtOQMAIAYgCUEEdGoiAyAHKQOoAjcCCCADIAcpA6ACNwIAIAlBAWoiCSAMRw0ACwwBCyAMRQ0AIAggCkEEdGohBCADIApBGGxqIQZBACEJA0AgBiAJQRhsaiIDICo5AxAgAyAsOQMIIAMgLTkDACAEIAlBBHRqIgMgBykDqAI3AgggAyAHKQOgAjcCACAJQQFqIgkgDEcNAAsLIA9BAWoiDyARKAIEQQFrSQ0ACwsCQAJAAkAgDQRAIA0tABANBCANLQAQDQIgDigCBCIERQ0CIAsoAmghBiAOKAIAIQogBygC5AEhA0EAIQhBACEJA0AgCEEBaiIIQYAIRgRAQQAhCCANLQAQDQQLAkAgAyAJQQJ0aigCACIMQQBIDQAgCiAJQQR0aigCCCIOQQBIDQAgBiAMQQJ0aiADIA5BAnRqKAIANgIACyAJQQFqIgkgBEcNAAsMAQsgDigCBCIERQ0CIAsoAmghBiAOKAIAIQggBygC5AEhA0EAIQkDQAJAIAMgCUECdGooAgAiCkEASA0AIAggCUEEdGooAggiDEEASA0AIAYgCkECdGogAyAMQQJ0aigCADYCAAsgCUEBaiIJIARHDQALCyANRQ0BCyANLQAQDQELIAdBzABqIAtGDQAgCygCqAEiAwRAIAMQIgsgCyAHKAL0ATYCqAEgCyAHKAL4ATYCrAEgCyAHKAL8ATYCsAEgB0EANgL8ASAHQgA3AvQBCyAHKALIASIDBEADQCADKAIAIANBCGoQwwQgAxAiIgMNAAsLIAcoAsABIQMgB0EANgLAASADBEAgBygCxAEaIAMQIgsgBygC1AEiAwRAIAMQIgsgBygC5AEiAwRAIAMQIgsgBygC9AEiA0UNACADECILIAdB0AJqJAAgBUEANgJQIBAQgwEgBUEANgJAIAVBPGoQgwEgBUEANgKgASAREC1BACEIQQAhCSMAQUBqIQMgCygCXCIHQQNuIQwCQAJAAkACQCABKAKQASIKBEAgCi0AECAHQQNJcg0CIAsoAnghDSALKAJoIQ4gCygCWCERA0AgCEEBaiIIQYAIRgRAQQAhCCAKLQAQDQQLIAMgESAJQQNsIhNBAnQiBGooAgAiDzYCBCADIAQgDmooAgA2AgwgAyAEIA1qKAIANgIQIAMgESAEQQRqIgZqKAIANgIUIAMgBiAOaigCADYCHCADIAYgDWooAgA2AiAgAyARIARBCGoiBGooAgA2AiQgAyAEIA5qKAIANgIsIAMgBCANaigCADYCMCAPQQBOBEAgA0KBgICAIDcCNEEAIQZBACEEA0AgA0E0aiAEaigCACIPIAYgA0EEaiIQIA9BBHRqKAIAIAZBBHQgEGooAgBIGyEGIARBBGoiBEEIRw0ACyADQQI2AjwgA0KAgICAEDcCNEEAIQQDQCADQQRqIANBNGogBGooAgAiECAGakEDb0EEdGoiDygCDCESIA8oAgghFSARIBAgE2pBAnQiEGogDygCADYCACAOIBBqIBU2AgAgDSAQaiASNgIAIARBBGoiBEEMRw0ACwsgCUEBaiIJIAxHDQALDAELIAdBA0kNAyALKAJ4IQggCygCaCENIAsoAlghDgNAIAMgDiAJQQNsIhBBAnQiBGooAgAiETYCBCADIAQgDWooAgA2AgwgAyAEIAhqKAIANgIQIAMgDiAEQQRqIgZqKAIANgIUIAMgBiANaigCADYCHCADIAYgCGooAgA2AiAgAyAOIARBCGoiBGooAgA2AiQgAyAEIA1qKAIANgIsIAMgBCAIaigCADYCMCARQQBOBEAgA0KBgICAIDcCNEEAIQZBACEEA0AgA0E0aiAEaigCACIRIAYgA0EEaiIPIBFBBHRqKAIAIAZBBHQgD2ooAgBIGyEGIARBBGoiBEEIRw0ACyADQQI2AjwgA0KAgICAEDcCNEEAIQQDQCADQQRqIANBNGogBGooAgAiDyAGakEDb0EEdGoiESgCDCETIBEoAgghEiAOIA8gEGpBAnQiD2ogESgCADYCACANIA9qIBI2AgAgCCAPaiATNgIAIARBBGoiBEEMRw0ACwsgCUEBaiIJIAxHDQALCyAKRQ0BCyAKLQAQDQEgCi0AECAHQQNJcg0BIAsoAlghDUEAIQhBACEJA0AgCEEBaiIIQYAIRgRAQQAhCCAKLQAQDQMLIANBAjYCDCADQoCAgIAQNwIEIAlBA2whESALKAJoIQ9BACEHA0AgDSADQQRqIAdqKAIAIBFqQQJ0IgRqKAIAIhBBAE4EQCAEIA9qIhMoAgAhBCADQQI2AjwgA0KAgICAEDcCNCAEIARBA29rIQ5BfyEEQQAhBgNAIANBNGogBmooAgAiEiAEIBAgDUF4QQQgDiASaiIEQQNvQQJGG2ogBEECdGooAgBGGyEEIAZBBGoiBkEMRw0ACyATIAQgDmo2AgAgB0EEaiIHQQxHDQELCyAJQQFqIgkgDEcNAAsMAQsgB0EDSQ0AIAsoAlghCEEAIQkDQCADQQI2AgwgA0KAgICAEDcCBCAJQQNsIQ0gCygCaCEOQQAhBwNAIAggA0EEaiAHaigCACANakECdCIEaigCACIRQQBOBEAgBCAOaiIPKAIAIQQgA0ECNgI8IANCgICAgBA3AjQgBCAEQQNvayEKQX8hBEEAIQYDQCADQTRqIAZqKAIAIhAgBCARIAhBeEEEIAogEGoiBEEDb0ECRhtqIARBAnRqKAIARhshBCAGQQRqIgZBDEcNAAsgDyAEIApqNgIAIAdBBGoiB0EMRw0BCwsgCUEBaiIJIAxHDQALCyAUIAVB9AVqEHggBS0A6AVBAUYEQCAAIBQQNxogBS0A6AVBAUcNASAUEDoaDAELIAEoAgAhByABKAIEIQkgAkEBRiEaIAEoApABIQ1BACEKIwBBwAFrIgYkACALIAcoAkAiGyAJKAJAIhwgGyAcShsiETYCQAJAIBFFDQAgCygCXCECIAZBADYCOCAGQgA3AjAgBkEwaiACEDMgBiACNgI0IAsoAtgBIQMgCygC3AEhBCAHKAJIIQggBygCTCEMIAkoAkghDiAJKAJMIQ8gCygCSCEQIAsoAkwhEyAGKAIwIRQgBiALKwMwIiY5A3ggBiALQdgAaiIVNgJwIAYgCUHYAGoiHTYCbCAGIAdB2ABqIh42AmggBiATNgJkIAYgEDYCYCAGIA82AlwgBiAONgJYIAYgDDYCVCAGIAg2AlAgBiAENgJMIAYgAzYCSCAGIAI2AkQgBiAUNgJAIAJBA24hEgJAAkAgDQRAAkAgAkEDSQ0AIA0tABBBAXENAEEAIQQDQCAKQQFqIgpBgAhGBEBBACEKIA0tABANAgsgBkFAayAEEOYEIARBAWoiBCASRw0ACwsgDS0AEEUNAQwCCyAGICY5A7gBIAYgFTYCsAEgBiAdNgKsASAGIB42AqgBIAYgEzYCpAEgBiAQNgKgASAGIA82ApwBIAYgDjYCmAEgBiAMNgKUASAGIAg2ApABIAYgBDYCjAEgBiADNgKIASAGIBQ2AoABIAYgAjYChAEgAkEDSQ0AQQAhBANAIAZBgAFqIAQQ5gQgBEEBaiIEIBJHDQALCyAGQSRqIAsoAkwiA0EBahCcAiEfIAZCADcDkAEgBkIANwOIASAGQgA3A4ABAn8gCSgCQCIERQRAIAkoAkwMAQsgCSgCjAEgBG4LIQQgBkF/NgJAIAZBgAFqIgggBCAGQUBrEOUEIAhBDHICfyAHKAJAIghFBEAgBygCTAwBCyAHKAKMASAIbgsgBkF/NgJAIAZBQGsQ5QQgC0GIAWoiDyALKAJMIBFsEEQCQCACQQNJDQAgCUHIAWohIkEAIRBBACEMA0AgDQRAIA0tABANAgsgCygCWCAQQQNsIiNBAnRqKAIAQQBOBEAgHCAbIAsoAtgBIBBBBHRqIgIoAgAiDhshEyACKAIIIQJBACEVAn9BACAaRQ0AGkEAIA5FDQAaQQAgE0EDSA0AGiAiIAIQ5AQLISQgHSAeIA4bIRkgCSAHIA4bISUgBkECNgIgIAZCgICAgBA3AhggAkEMbCEXIA5FISEDQCAGKAIwIAZBGGogFWooAgAgI2oiAkEYbGohFCACQQJ0IRZBfyEYAkACQAJAAkAgE0EATARAQX8hCCADIQIMAQsgCygCWCAWaigCACECIAZBAjYCSCAGQoCAgIAQNwJAQQAhCkF+IQgCQAJ/A0AgFEEIQRAgBkFAayAKaigCACIEQQFGG0EAIAQbaisDACImRAAAAAAAAPA/YQRAIAMhAiAZKAIgIBdqIARBAnRqKAIADAILIAQgCCAmRAAAAAAAAAAAYRshCCAKQQRqIgpBDEcNAAsgCEEASA0BIBkoAiAgF2oiCkEEQQggCEEBRhtBACAIGyIIQYzzAGooAgBBAnRqKAIAIgQgCiAIQZjzAGooAgBBAnRqKAIAIgggBCAISiIKGyEYIAggBCAKGwshCCACIANHIAhBAEhyDQEgBkGAAWoiAiACQQxyIA4bKAIAIAhBAnRqIgIoAgAiBEEATg0DIAIgDDYCAAwCCyACIAMgCEF+RhshAkF/IQgLIB8oAgAgAkEMbGoiAigCACIEIAIoAgQiCkcEQANAAkAgBCgCACAhRw0AIAQoAgQgCEcNACAEKAIIIBhHDQAgBCgCDCEEDAQLIARBEGoiBCAKRw0ACwsgBiAMNgJMIAYgGDYCSCAGIAg2AkQgBiAhNgJAIAIgBkFAaxDjBAsgCygCeCAWaiAMNgIAIAxBAWohDCARQQBMDQFBACECA0ACQCACIBNIBEAgBkIANwNQIAZCADcDSCAGQgA3A0AgBkECNgIUIAZCgICAgBA3AgwgJSgCiAEgAkEDdGohCiAZKAIgIBdqIRZBACEEA0AgBkFAa0EIQRAgBkEMaiAEaigCACIIQQFGG0EAIAgbaiAKIBYgCEECdGooAgAgE2xBA3RqKwMAOQMAIARBBGoiBEEMRw0ACyAUKwMAIAYrA0CiRAAAAAAAAAAAoCAUKwMIIAYrA0iioCAUKwMQIAYrA1CioCImmiAmIAJBA0kbICYgJBshJgJAIAsoAowBIgQgCygCkAEiCE8EQCAPIAhBAXRBgAEgCBsQRCALKAKIASALKAKMASIEQQN0aiAmOQMADAELIA8oAgAgBEEDdGogJjkDAAsMAQsCQCALKAKMASIEIAsoApABIghPBEAgDyAIQQF0QYABIAgbEEQgCygCiAEgCygCjAEiBEEDdGpCADcDAAwBCyAPKAIAIARBA3RqQgA3AwALCyALIARBAWo2AowBIAJBAWoiAiARRw0ACwwBCyALKAJ4IBZqIAQ2AgALIBVBBGoiFUEMRw0ACwsgEEEBaiIQIBJHDQALCyAGQZgBaiEEA0AgBEEMayICKAIAIgMEQCAEQQhrIAM2AgAgBEEEaygCABogAxAiCyAGQYABaiIDIAIiBEcNAAsgBiAfNgKAASADECkLIAYoAjAiAkUNACACECILIAZBwAFqJAAgBUHQA2oiAiAFQfQFahB4IAUtAOgFQQFGBEAgACACEDcaIAUtAOgFQQFHDQEgAhA6GgwBCyABKAIAIQkgASgCBCEHIAEoApABIQYjAEEgayIEJAAgCygC2AEiAiALKAJcIgNBA25BBHRqIQogBygC2AEhDCAJKALYASENQZiVAigCACEIAkACQAJAAkAgBgRAIANBA0kNAiAGLQAQQQFxDQJBACEDA0AgA0EBaiIDQYAIRgRAQQAhAyAGLQAQDQQLIAIoAgghDgJAIAIoAgBFBEAgAiANIA5BBHRqIg4pAgg3AgggAiAOKQIANwIADAELIAIgDCAOQQR0aiIOKQIAIkc3AgAgAiAOKQIINwIIIAIgR6cgCGo2AgALIAJBEGoiAiAKRw0ACwwBCyADQQNJDQIDQCACKAIIIQMCQCACKAIARQRAIAIgDSADQQR0aiIDKQIINwIIIAIgAykCADcCAAwBCyACIAwgA0EEdGoiAykCACJHNwIAIAIgAykCCDcCCCACIEenIAhqNgIACyACQRBqIgIgCkcNAAsLIAZFDQELIAYtABANAQsgCSgCzAEiAiAJQdABaiIGRwRAIAtBzAFqIQkDQCAEIAJBEGoiAzYCFCAEQRhqIAkgAyAEQRRqEHkgBCgCGEEYaiACQRhqQeoA/AoAAAJAIAIoAgQiAwRAA0AgAyICKAIAIgMNAAwCCwALA0AgAiACKAIIIgIoAgBHDQALCyACIAZHDQALCyAHKALMASICIAdB0AFqIglGDQAgC0HMAWohBgNAIAQgAigCECAIajYCDCAEIARBDGoiAzYCFCAEQRhqIgcgBiADIARBFGoiChB5IAQoAhhBGGogAkEYakHqAPwKAAAgBCACKAIQIAhqNgIMIAQgAzYCFCAHIAYgAyAKEHkgBCgCGCIDIAMtAIABIBpHOgCAAQJAIAIoAgQiAwRAA0AgAyICKAIAIgMNAAwCCwALA0AgAiACKAIIIgIoAgBHDQALCyACIAlHDQALCyAEQSBqJAAgBUHQA2oiAiAFQfQFahB4IAUtAOgFQQFGBEAgACACEDcaIAUtAOgFQQFHDQEgAhA6GgwBCyALICAQ+AIgCxCTAiALEFggCyABKAKQARBUIAsQtQQgBUHQA2oiASAFQfQFahB4IAUtAOgFQQFGBEAgACABEDcaIAUtAOgFQQFHDQEgARA6GgwBCyAFQQE6AIQGIAAgCxCjARoLIAUoAjwiAARAIAAQIgsgBSgCTCIABEAgABAiCyAFKAJcIgAEQCAAECILIAUoAmwiAARAIAAQIgsgBSgCfCIARQ0AIAAQIgsgBSgCjAEiAARAIAAQIgsgBSgCnAEiAEUNACAAECILIAUoArABEJ0CIAUoArwBEM0BIAUoAsgBEM0BCyALEDoaIAUoAtACIgAEQCAAECILIAUoAuACIgAEQCAAECILIAUoAvACIgAEQCAAECILIAUoAoADIgAEQCAAECILIAUoApADIgAEQCAAECILIAUoAqADIgAEQCAAECILIAUoArADIgAEQCAAECILIAUoAsADIgBFDQAgABAiCyAFKAL8BSEGCwJAIAZFDQAgBi0AEA0AIAUtAIQGQQFxDQAgBSgCgAYiAEEKSg0AIAYgBigCDCAAa0ELajYCDAsgBUGgCGokAAuCAQEDfyAAQgA3AgQgACgCACEDIABBADYCACAAIAEoAgQiBBBEIAAgBDYCBAJAAkAgASgCBCIEBEAgACgCACEAIAEoAgAhAQNAIAAgAkEDdGogAyABIAJBAnRqKAIAQQN0aikCADcCACACQQFqIgIgBEcNAAsMAQsgA0UNAQsgAxAiCwtmAQF/IABBADYCCCAAQgA3AgBBBBAjIgFBATYCACAAQQA2AhggAEIANwIQIAAgATYCDEEEECMiAUEBNgIAIABBADYCKCAAQgA3AiAgACABNgIcQQQQIyIBQQE2AgAgACABNgIsIAALxwEBBn8CQCAAKAIEIgJFDQAgACgCDEUNACABKAIAIQMgACgCAAJ/IAMgAkEBa3EgAmkiAUEBTQ0AGiADIAIgA0sNABogAyACcAsiBUECdGooAgAiAEUNACAAKAIAIgBFDQAgAkEBayEGIAFBAUshBwNAAkAgAyAAKAIEIgFHBEACQCAHRQRAIAEgBnEhAQwBCyABIAJJDQAgASACcCEBCyABIAVHDQMMAQsgACgCCCADRw0AIAAhBAwCCyAAKAIAIgANAAsLIAQLNAEBfyABQdaq1aoBTwRAECYACyAAIAFBDGwiAhAjIgE2AgQgACABNgIAIAAgASACajYCCAtKAQJ/IAAoAgQiAiAAKAIIIgFHBEADQCAAIAFBGGsiATYCCCABECgaIAIgACgCCCIBRw0ACwsgACgCACIBBEAgACgCDBogARAiCws8AQF/IAAgAUcEQCAAIQMDQCACIAMQiwFBGGohAiADQRhqIgMgAUcNAAsDQCAAEChBGGoiACABRw0ACwsLSgECfyAAKAIEIgIgACgCCCIBRwRAA0AgACABQUBqIgE2AgggARBBGiACIAAoAggiAUcNAAsLIAAoAgAiAQRAIAAoAgwaIAEQIgsLtwEBBX8gACgCBCICIQQgASgCBCAAKAIAIgMgAmtqIgYhBSADIARHBEAgAyECA0AgBSACELQBQUBrIQUgAkFAayICIARHDQALA0AgAxBBQUBrIgMgBEcNAAsLIAEgBjYCBCAAIAAoAgAiAjYCBCAAIAEoAgQ2AgAgASACNgIEIAAoAgQhAiAAIAEoAgg2AgQgASACNgIIIAAoAgghAiAAIAEoAgw2AgggASACNgIMIAEgASgCBDYCAAuhAgEFfyMAQSBrIgUkAAJAAkAgACgCBCICIAAoAggiA0kEQCACIAErAwA5AwAgAkEIaiEBDAELIAIgACgCACIEa0EDdSIGQQFqIgJBgICAgAJPDQEgBUEMakH/////ASADIARrIgNBAnUiBCACIAIgBEkbIANB+P///wdPGyAGIAAQSyICKAIIIgMgASsDADkDACACIANBCGo2AgggAigCBCAAKAIEIAAoAgAiA2siAWshBCABBEAgBCADIAH8CgAACyAAKAIAIQMgACAENgIAIAIgAzYCBCAAIAIoAggiATYCBCACIAM2AgggACgCCCEEIAAgAigCDDYCCCACIAM2AgAgAiAENgIMIAIQmQELIAAgATYCBCAFQSBqJAAPCxAmAAs9AQJ/IAAoAgQiAiAAKAIIIgFHBEAgACABIAIgAWtBP2pBQHFqNgIICyAAKAIAIgEEQCAAKAIMGiABECILC4gBAgJ/AXwjAEEQayICJABBmJ8CLQAAQQFxRQRAQQJBjIwCQQMQBiEDQZifAkEBOgAAQZSfAiADNgIACyABKAIEIgFBCU8EQCABEBMLIAIgATYCCCACQQA2AgRBlJ8CKAIAIABBACACQQRqIAJBCGoQBSACKAIEIgAEQCAAEAQLIAJBEGokAPwDC0kBAn8gACgCBCIFQQh1IQYgACgCACIAIAEgBUEBcQR/IAIoAgAgBmooAgAFIAYLIAJqIANBAiAFQQJxGyAEIAAoAgAoAhgRBwALmgEAIABBAToANQJAIAIgACgCBEcNACAAQQE6ADQCQCAAKAIQIgJFBEAgAEEBNgIkIAAgAzYCGCAAIAE2AhAgA0EBRw0CIAAoAjBBAUYNAQwCCyABIAJGBEAgACgCGCICQQJGBEAgACADNgIYIAMhAgsgACgCMEEBRw0CIAJBAUYNAQwCCyAAIAAoAiRBAWo2AiQLIABBAToANgsLdgEBfyAAKAIkIgNFBEAgACACNgIYIAAgATYCECAAQQE2AiQgACAAKAI4NgIUDwsCQAJAIAAoAhQgACgCOEcNACAAKAIQIAFHDQAgACgCGEECRw0BIAAgAjYCGA8LIABBAToANiAAQQI2AhggACADQQFqNgIkCwsFABAcAAt9AQN/AkACQCAAIgFBA3FFDQAgAS0AAEUEQEEADwsDQCABQQFqIgFBA3FFDQEgAS0AAA0ACwwBCwNAIAEiAkEEaiEBQYCChAggAigCACIDayADckGAgYKEeHFBgIGChHhGDQALA0AgAiIBQQFqIQIgAS0AAA0ACwsgASAAawvKAQICfwF8IwBBEGsiASQAAkAgAL1CIIinQf////8HcSICQfvDpP8DTQRAIAJBgIDA8gNJDQEgAEQAAAAAAAAAAEEAENgBIQAMAQsgAkGAgMD/B08EQCAAIAChIQAMAQsgACABEKgDIQIgASsDCCEAIAErAwAhAwJAAkACQAJAIAJBA3FBAWsOAwECAwALIAMgAEEBENgBIQAMAwsgAyAAENkBIQAMAgsgAyAAQQEQ2AGaIQAMAQsgAyAAENkBmiEACyABQRBqJAAgAAvCAQIBfAJ/IwBBEGsiAiQAAnwgAL1CIIinQf////8HcSIDQfvDpP8DTQRARAAAAAAAAPA/IANBnsGa8gNJDQEaIABEAAAAAAAAAAAQ2QEMAQsgACAAoSADQYCAwP8HTw0AGiAAIAIQqAMhAyACKwMIIQAgAisDACEBAkACQAJAAkAgA0EDcUEBaw4DAQIDAAsgASAAENkBDAMLIAEgAEEBENgBmgwCCyABIAAQ2QGaDAELIAEgAEEBENgBCyACQRBqJAALjQEAIAAgACAAIAAgACAARAn3/Q3hPQI/okSIsgF14O9JP6CiRDuPaLUogqS/oKJEVUSIDlXByT+gokR9b+sDEtbUv6CiRFVVVVVVVcU/oKIgACAAIAAgAESCki6xxbizP6JEWQGNG2wG5r+gokTIilmc5SoAQKCiREstihwnOgPAoKJEAAAAAAAA8D+gowtqAQJ/IAAgACgCRDYCSCACKAIEIgMgAigCACIERwRAIAMgBGtBBHVBAWshBEEAIQMDQCAAIAEgAiADIAQQtAIgAyEEIANBAWoiAyACKAIEIAIoAgBrQQR1SQ0ACwsgACgCUCAAQcQAahB2C+4TAwV/B3wCfiMAQSBrIgkkAAJAIAIoAgAiBSADQQR0IgdqIgYpAwAgBSAEQQR0IghqIgUpAwBRBEAgBikDCCAFKQMIUQ0BC0QAAAAAAADwPyEKAkAgACgCOCIFIAdqIgYrAwgiDSAFIAhqIgUrAwAiDqIgBSsDCCIPIAYrAwAiEKKhIgtEAAAAAAAA8D9kDQAgCyIKRAAAAAAAAPC/Y0UNAEQAAAAAAADwvyEKCwJAIAAoApgBRQRAIAArAxAhDAwBCyAAIABBiAFqIAIgAEE4aiADIAQQ+wEiDDkDECABLQAUQQFHDQAgACAMmiIMOQMQCwJAAkAgDJlEEeotgZmXcT1lBEAgAigCACADQQR0aiEGAkAgACgCSCIBIAAoAkwiAkkEQCABIAYpAwg3AwggASAGKQMANwMAIAFBEGohAgwBCyABIABBxABqIgQoAgAiAWtBBHUiA0EBaiIFQYCAgIABTw0CIAlBDGpB/////wAgAiABayICQQN1IgEgBSABIAVLGyACQfD///8HTxsgAyAEEDIiBCgCCCIBIAYpAwg3AwggASAGKQMANwMAIAQgBCgCCEEQajYCCCAEKAIEIAAoAkggACgCRCIBayIDayECIAMEQCACIAEgA/wKAAALIAAoAkQhAyAAIAI2AkQgBCADNgIEIAAgBCgCCCICNgJIIAQgAzYCCCAAKAJMIQEgACAEKAIMNgJMIAQgAzYCACAEIAE2AgwgBBA2CyAAIAI2AkgMAwsgECAOoiANIA+ioCILRCuHFtnO9++/ZEUgCiAMokQAAAAAAAAAAGNFckUEQCAAKAI4IARBBHRqIgQrAwggDKIgAigCACIFIANBBHRqIgEpAwi5oBA0/AYhEiAEKwMAIAyiIAEpAwC5oBA0/AYhESAAQcQAaiEHAkAgACgCSCIEIAAoAkwiAUkEQCAEIBI3AwggBCARNwMAIARBEGohBAwBCyAEIAcoAgAiBGtBBHUiBUEBaiIGQYCAgIABTw0CIAlBDGpB/////wAgASAEayIEQQN1IgEgBiABIAZLGyAEQfD///8HTxsgBSAHEDIiBigCCCIBIBI3AwggASARNwMAIAYgAUEQajYCCCAGKAIEIAAoAkggACgCRCIBayIFayEEIAUEQCAEIAEgBfwKAAALIAAoAkQhBSAAIAQ2AkQgBiAFNgIEIAAgBigCCCIENgJIIAYgBTYCCCAAKAJMIQEgACAGKAIMNgJMIAYgBTYCACAGIAE2AgwgBhA2IAAoAkwhASACKAIAIQULIAAgBDYCSCAFIANBBHRqIQgCQCABIARLBEAgBCAIKQMINwMIIAQgCCkDADcDACAEQRBqIQEMAQsgBCAHKAIAIgRrQQR1IgVBAWoiBkGAgICAAU8NAiAJQQxqQf////8AIAEgBGsiBEEDdSIBIAYgASAGSxsgBEHw////B08bIAUgBxAyIgYoAggiASAIKQMINwMIIAEgCCkDADcDACAGIAYoAghBEGo2AgggBigCBCAAKAJIIAAoAkQiAWsiBWshBCAFBEAgBCABIAX8CgAACyAAKAJEIQUgACAENgJEIAYgBTYCBCAAIAYoAggiATYCSCAGIAU2AgggACgCTCEEIAAgBigCDDYCTCAGIAU2AgAgBiAENgIMIAYQNgsgACABNgJIIANBBHQiBCAAKAI4aiIDKwMIIAArAxAiC6IgAigCACAEaiICKQMIuaAQNPwGIRIgCyADKwMAoiACKQMAuaAQNPwGIRECQCAAKAJMIgIgAUsEQCABIBI3AwggASARNwMAIAFBEGohAgwBCyABIAcoAgAiAWtBBHUiA0EBaiIEQYCAgIABTw0CIAlBDGpB/////wAgAiABayICQQN1IgEgBCABIARLGyACQfD///8HTxsgAyAHEDIiBCgCCCIBIBI3AwggASARNwMAIAQgAUEQajYCCCAEKAIEIAAoAkggACgCRCIBayIDayECIAMEQCACIAEgA/wKAAALIAAoAkQhAyAAIAI2AkQgBCADNgIEIAAgBCgCCCICNgJIIAQgAzYCCCAAKAJMIQEgACAEKAIMNgJMIAQgAzYCACAEIAE2AgwgBBA2CyAAIAI2AkgMAwsgACgCZCIBQQJHIAtEK4cW2c737z9kcQ0BAkACQAJAAkAgAUEBaw4DAwIAAQsgCyAAKwMYRAAAAAAAAPC/oGQNBAsgACACIAMgBBC2AgwECyAAIAIgAyAEAnwgCiALoCAKvUL///////////8Ag0KBgICAgICA+P8AVCALvUL///////////8Ag0KAgICAgICA+P8AWHFFDQAaIAu9IhFCIIinIgJBgIDA/wNrIBGnIgFyRQRAIAoQqQMMAQsgAkEedkECcSIAIAq9IhFCP4inciEEAkAgEUIgiKdB/////wdxIgMgEadyRQRAAkACQCAEQQJrDgIAAQMLRBgtRFT7IQlADAMLRBgtRFT7IQnADAILRBgtRFT7Ifk/IAqmIAEgAkH/////B3EiAXJFDQEaAkAgAUGAgMD/B0YEQCADQYCAwP8HRw0BIARBA3QrA/CZAQwDC0QYLURU+yH5PyAKpiADQYCAwP8HRyABQYCAgCBqIANPcUUNAhoCfCAABEBEAAAAAAAAAAAgA0GAgIAgaiABSQ0BGgsgCiALo5kQqQMLIQoCQAJAAkAgBEEBaw4DAAECBAsgCpoMBAtEGC1EVPshCUAgCkQHXBQzJqahvKChDAMLIApEB1wUMyamobygRBgtRFT7IQnAoAwCCyAEQQN0KwOQmgEhCgsgCgsQtQIMAwsgACACIAMgBBC3AgwCCxAmAAsjAEEgayIGJAAgACgCOCIFIARBBHRqIgQrAwggBSADQQR0IgFqIgMrAwigIAArAxAgC0QAAAAAAADwP6CjIguiIAIoAgAgAWoiASkDCLmgIQogBCsDACADKwMAoCALoiABKQMAuaAhCwJAAkACQCAAKAJIIgEgACgCTCICSQRAIAEgChA0/AY3AwggASALEDT8BjcDACABQRBqIQMMAQsgASAAQcQAaiIEKAIAIgFrQQR1IgNBAWoiBUGAgICAAU8NASAGQQxqQf////8AIAIgAWsiAkEDdSIBIAUgASAFSxsgAkHw////B08bIAMgBBAyIgUoAggiASAKEDT8BjcDCCABIAsQNPwGNwMAIAUgAUEQajYCCCAFKAIEIAAoAkggACgCRCIBayIDayECIAMEQCACIAEgA/wKAAALIAAoAkQhBCAAIAI2AkQgBSAENgIEIAAgBSgCCCIDNgJIIAUgBDYCCCAAKAJMIQEgACAFKAIMNgJMIAUgBDYCACAFIAE2AgwgBRA2CyAAIAM2AkggBkEgaiQADAELECYACwsgCUEgaiQAC5EKAwd/B3wCfiMAQSBrIggkACAAKwMQIQ4gACgCmAEEQCAARBgtRFT7IRlAIA6ZIgxEGC1EVPshCUCiIg9EGC1EVPshCUBEAAAAAAAA8D8gACsDeCINIAwgDCANZBsgDET8qfHSTWJgP6IgDUQR6i2BmZdxPWQbIAyjoRCqA6MiDCAMIA9kGyIMoyINELECOQMwIAAgDRCwAiINOQMoIA5EAAAAAAAAAABjBEAgACANmjkDKAsgACAMRBgtRFT7IRlAozkDIAsgDiAAKAI4IANBBHRqIgUrAwiiIgyaIAwgAiADRiIDGyIMIAEoAgAgAkEEdGoiCSkDCLkiEKAhDSAFKwMAIA6iIg6aIA4gAxsiDiAJKQMAuSIRoCEPIABBxABqIQkCQAJAIAAoAkgiAyAAKAJMIgVJBEAgAyANEDT8BjcDCCADIA8QNPwGNwMAIANBEGohAwwBCyADIAkoAgAiBmtBBHUiB0EBaiIDQYCAgIABTw0BIAhBDGpB/////wAgBSAGayIFQQN1IgYgAyADIAZJGyAFQfD///8HTxsgByAJEDIiBSgCCCIDIA0QNPwGNwMIIAMgDxA0/AY3AwAgBSADQRBqNgIIIAUoAgQgACgCSCAAKAJEIgZrIgNrIQcgAwRAIAcgBiAD/AoAAAsgACgCRCEGIAAgBzYCRCAFIAY2AgQgACAFKAIIIgM2AkggBSAGNgIIIAAoAkwhByAAIAUoAgw2AkwgBSAGNgIAIAUgBzYCDCAFEDYLIAAgAzYCSCAEmSAAKwMgopv8AiILQQJOBEBBASEFA0AgDiAAKwMoIg+iIAwgACsDMCISoqAiBCAQoCENIA4gEqIgDyAMoqEiDiARoCEMAkAgACgCTCIGIANLBEAgAyANEDT8BjcDCCADIAwQNPwGNwMAIANBEGohAwwBCyADIAkoAgAiB2tBBHUiCkEBaiIDQYCAgIABTw0DIA0QNCENIAhBDGpB/////wAgBiAHayIGQQN1IgcgAyADIAdJGyAGQfD///8HTxsgCiAJEDIhByAIKAIUIgMgDfwGNwMIIAMgDBA0/AY3AwAgCCADQRBqNgIUIAgoAhAgACgCSCAAKAJEIgZrIgNrIQogAwRAIAogBiAD/AoAAAsgACgCRCEGIAAgCjYCRCAIIAY2AhAgACAIKAIUIgM2AkggCCAGNgIUIAAoAkwhCiAAIAgoAhg2AkwgCCAKNgIYIAcgBjYCACAHEDYLIAAgAzYCSCAEIQwgBUEBaiIFIAtHDQALCyACQQR0IgIgACgCOGoiBSsDCCAAKwMQIgSiIAEoAgAgAmoiASkDCLmgEDT8BiETIAQgBSsDAKIgASkDALmgEDT8BiEUAkAgACgCTCICIANLBEAgAyATNwMIIAMgFDcDACADQRBqIQUMAQsgAyAJKAIAIgNrQQR1IgVBAWoiAUGAgICAAU8NASAIQQxqQf////8AIAIgA2siAkEDdSIDIAEgASADSRsgAkHw////B08bIAUgCRAyIgEoAggiAiATNwMIIAIgFDcDACABIAJBEGo2AgggASgCBCAAKAJIIAAoAkQiBWsiAmshAyACBEAgAyAFIAL8CgAACyAAKAJEIQIgACADNgJEIAEgAjYCBCAAIAEoAggiBTYCSCABIAI2AgggACgCTCEDIAAgASgCDDYCTCABIAI2AgAgASADNgIMIAEQNgsgACAFNgJIIAhBIGokAA8LECYAC/cFAgR/EXwjAEEgayIEJAAgACgCOCEFAkAgAiADRyIGRQRAIAUgAkEEdGoiBSsDACIImiEKIAUrAwgiCyEJDAELIAUgAkEEdGoiBysDCCAFIANBBHRqIgUrAwgiC6EiDCAMoiAFKwMAIgggBysDAKEiDyAPoqCfIg2ZRPyp8dJNYlA/YwRADAELIA9EAAAAAAAA8D8gDaMiD6IhCiAMIA+iIQkLIAkgACsDECIOoiIQIAogDpkiEaIgASgCACIBIAJBBHRqIgIpAwi5IhegIg2gIg8gDSAQoSIMoSETIAkgEaIgAikDALkiGKAiCSAKIA6iIhShIhEgFCAJoCIKoSIWmiEVIAsgDqIiCyABIANBBHRqIgEpAwi5oCESIAggDqIiCCABKQMAuaAhDgJAIAZFBEAgBCANOQMYIAQgCTkDECANIQggCSELIBMgECAOoCAOoSIQoiAUIBKgIBKhIhQgFaKgIhVEAAAAAAAAAABiBEAgBAJ8IAogDqEgFKIgDCASoSAQoqEgFaMiCEQAAAAAAAAAAGUEQCAEIAo5AxAgCiELIAwMAQsgCEQAAAAAAADwP2YEQCAEIBE5AxAgESELIA8MAQsgBCAIIBaiIAqgIgs5AxAgCCAToiAMoAsiCDkDGAsgBCANIA0gCKGgOQMIIAQgCSAJIAuhoDkDACAAQcQAaiIAIAQQrgEgACAEQRBqEK4BDAELIAQgDTkDGCAEIAk5AxAgEyAIIBigIA6hIgiiIAsgF6AgEqEiCyAVoqAiEEQAAAAAAAAAAGIEQAJAIAogDqEgC6IgDCASoSAIoqEgEKMiCEQAAAAAAAAAAGUEQCAEIAo5AxAMAQsgCEQAAAAAAADwP2YEQCAEIBE5AxAgDyEMDAELIAQgCCAWoiAKoDkDECAIIBOiIAygIQwLIAQgDDkDGAsgAEHEAGoiACAEQRBqEK4BIAQgDSANIAQrAxihoDkDCCAEIAkgCSAEKwMQoaA5AwAgACAEEK4BCyAEQSBqJAALqQIDAn8FfAF+IwBBIGsiBCQAIARCADcDGCAEQgA3AxACfCACIANGBEAgAkEEdCICIAEoAgBqIgEpAwAhCyAAKAI4IAJqIgIrAwAhBiAEIAEpAwi5IgcgACsDEJkiCCACKwMIoiIJoTkDGCAEIAu5IgogCCAGoiIGoTkDECAJIAegIQcgBiAKoAwBCyACQQR0IgIgASgCAGoiASkDACELIAAoAjgiBSADQQR0aiIDKwMAIQcgBCAAKwMQIgYgAysDCKIgASkDCLkiCKA5AxggBCAGIAeiIAu5IgmgOQMQIAYgAiAFaiIBKwMIoiAIoCEHIAYgASsDAKIgCaALIQYgBCAHOQMIIAQgBjkDACAAQcQAaiIAIARBEGoQrgEgACAEEK4BIARBIGokAAuxDQENfyMAQRBrIgwkAAJAIAVFDQADQAJAIAUgB0wgBCAHTHJFBEAgBEUNAyABKAIEIQgDQAJAAkAgCEUNACAAKAIERQ0AIAAoAgApAwAgASgCACkDAFcNAQwECyAIDQMLIABBDGohACAEQQFrIgQNAAsMAwsgACEIIAIhByMAQRBrIgkkAAJAIAQgBUwEQCAGIQIgASAIRwRAA0AgAiAAKAIINgIIIAIgACkCADcCACACQQxqIQIgAEEMaiIAIAFHDQALCwJAIAIgBkYNAANAIAEgB0YEQCACIAZrQQNrIgBFDQIgCCAGIAD8CgAADAILAkACQAJAAkAgASgCBCIARQ0AIAYoAgRFDQAgBigCACkDACABKAIAKQMAVQ0BDAILIABFDQELIAggAS0ACDoACCAIIAEpAgA3AgAgAUEMaiEBDAELIAggBi0ACDoACCAIIAYpAgA3AgAgBkEMaiEGCyAIQQxqIQggAiAGRw0ACwsMAQsgBiECIAEgB0cEQCABIQADQCACIAAoAgg2AgggAiAAKQIANwIAIAJBDGohAiAAQQxqIgAgB0cNAAsLIAkgAzYCDAJAIAYgAiIDRg0AA0AgCCABIgJGBEADQCAHQQxrIgcgA0EMayIDLQAIOgAIIAcgAykCADcCACADIAZHDQAMAwsACyADQQxrIQQgAkEMayEAAkACQAJAIANBCGsoAgAiBUUNACACQQhrKAIARQ0AIAAiASgCACkDACAEKAIAKQMAVw0BDAILIAAhASAFDQELIAIhASAEIgAhAwsgB0EMayIHIAAtAAg6AAggByAAKQIANwIAIAMgBkcNAAsLCyAJQRBqJAAMAgsCQCAEIAVIBEAgASAFQQJtIg9BDGxqIQsgASAAIglHBEAgASAAa0EMbSEQIAsoAgAhEiALKAIEIQoDQCAJIBBBAXYiDUEMbGohCAJ/AkACQAJAIApFDQAgCCgCBEUNACAIKAIAKQMAIBIpAwBXDQEMAgsgCg0BCyAIQQxqIQkgECANQX9zagwBCyANCyIQDQALCyAJIABrQQxtIRAMAQsgBEEBRgRAIAwgACgCCDYCCCAMIAApAgA3AwAgACABLQAIOgAIIAAgASkCADcCACABIAwtAAg6AAggASAMKQMANwIADAMLIAxBADoADyABIQsgACAEQQJtIhBBDGxqIQkgAiABa0EMbSIPBEAgCSgCACENIAkoAgQhEgNAAn8CQAJAIAsgD0EBdiIIQQxsaiIKKAIEIg5FIBJFckUEQCANKQMAIAooAgApAwBVDQEMAgsgDkUNAQsgCkEMaiELIA8gCEF/c2oMAQsgCAsiDw0ACwsgCyABa0EMbSEPCyMAQRBrIg4kAAJAIAEgCUYEQCAMIAs2AgQgDCALNgIADAELIAEgC0YEQCAMIAE2AgQgDCAJNgIADAELAkAgASAJQQxqIghGBEAgDiAJKAIINgIIIA4gCSkCADcDACALIAFrIgFBA2siCgRAIAkgCCAK/AoAAAsgASAJaiIBIA4tAAg6AAggASAOKQMANwIADAELIAsgAUEMakYEQCAOIAtBDGsiCCgCCDYCCCAOIAgpAgA3AwAgCyAIIAlrIgpBdG1BDGxqIQECQCAIIAlGDQAgCkEDayIIRQ0AIAEgCSAI/AoAAAsgCSAOLQAIOgAIIAkgDikDADcCAAwBCwJ/IwBBEGshESABIAkiCmsiE0EMbSISIAsgAWsiFEEMbSIIRwRAIBIhAQNAIAEgCCIBbyIIDQALIAogAUEMbGohDQNAIBEgDUEMayINKAIINgIIIBEgDSkCADcDACANIBNqIQggDSEBA0AgASAILQAIOgAIIAEgCCkCADcCACAIIgEgE2ogCiASIAsgAWtBDG0iCGtBDGxqIAggEkobIgggDUcNAAsgASARLQAIOgAIIAEgESkDADcCACAKIA1HDQALIAogFGoMAQsCQCABIApGIAEgC0ZyDQAgASEIA0AgESAKKAIINgIIIBEgCikCADcDACAKIAgtAAg6AAggCiAIKQIANwIAIAggES0ACDoACCAIIBEpAwA3AgAgCkEMaiIKIAFGDQEgCEEMaiIIIAtHDQALCyABCyEBCyAMIAs2AgQgDCABNgIACyAOQRBqJAAgDCgCACEBAn8gDyAQaiAEIBBrIgQgBSAPayIFakgEQCAAIAkgASADIBAgDyAGIAcQuAIgASEAIAsMAQsgASALIAIgAyAEIAUgBiAHELgCIA8hBSAQIQQgASECIAkLIQEgBQ0ACwsgDEEQaiQAC68MAgl/An4jAEEQayIQJAACQCAFRQ0AA0ACQCAFIAdMIAQgB0xyRQRAIARFDQMgASgCACIJKAIAIggpAwghEQNAAkAgESAAKAIAIgooAgAiCykDCCISUgRAIBEgElcNAQwECyALKQMAIAgpAwBVDQMLIABBBGohACAEQQFrIgQNAAsMAwsgACEHIAEhCUEAIQgjAEEQayIKJAACQAJAAkACQAJAIAQgBUwEQCAAIAFHDQEgBiEADAILIAIgCUcNAiAGIQAMAwsgBiEAIAchAQNAIAEoAgAhAyABQQA2AgAgACADNgIAIABBBGohACAIQQFqIQggAUEEaiIBIAlHDQALCyAKIAg2AgwjAEEQayIDJAACQCAAIAYiAUYNAANAIAIgCUYEQCAAIAFHBEADQCABKAIAIQQgAUEANgIAIAcoAgAhAiAHIAQ2AgAgAgRAIAIQIgsgB0EEaiEHIAFBBGoiASAARw0ACyAAIQELIAMgBzYCDCADIAE2AggMAgsCQAJAAkAgASgCACIFKAIAIgQpAwgiESAJKAIAIggoAgAiCykDCCISUgRAIBEgElMNAQwCCyAEKQMAIAspAwBXDQELIAlBADYCACAHKAIAIQQgByAINgIAIAQEQCAEECILIAlBBGohCQwBCyABQQA2AgAgBygCACEEIAcgBTYCACAEBEAgBBAiCyABQQRqIQELIAdBBGohByAAIAFHDQALCyADQRBqJAAMAgsgBiEAA0AgASgCACEEIAFBADYCACAAIAQ2AgAgAEEEaiEAIAhBAWohCCABQQRqIgEgAkcNAAsLIAogCDYCDCAKIAM2AgggCSEBIAIhBAJAIAYgACICRg0AA0AgASAHRgRAA0AgAkEEayICKAIAIQEgAkEANgIAIARBBGsiBCgCACEAIAQgATYCACAABEAgABAiCyACIAZHDQAMAwsACwJAAkACQCABQQRrIgAoAgAiCSgCACIFKQMIIhEgAkEEayIDKAIAIggoAgAiCykDCCISUgRAIBEgElMNAQwCCyAFKQMAIAspAwBXDQELIABBADYCACAEQQRrIgEoAgAhBSABIAk2AgAgACEBDAELIANBADYCACAEQQRrIgAoAgAhBSAAIAg2AgAgASEAIAMhAgsgBQRAIAUQIiAAIQELIARBBGshBCACIAZHDQALCwsgBgRAIApBDGogBhC0AwsgCkEQaiQADAILAkAgBCAFSARAIAEgBUECbSINQQJ0aiEKIAEgACIJRwRAIAEgAGtBAnUhCCAKKAIAKAIAIgwpAwghEQNAAn8CQAJAIBEgCSAIQQF2IgtBAnRqIg4oAgAoAgAiDykDCCISUgRAIBEgElcNAQwCCyAPKQMAIAwpAwBVDQELIA5BBGohCSAIIAtBf3NqDAELIAsLIggNAAsLIAkiCyAAa0ECdSEODAELIARBAUYEQCAAIAk2AgAgASAKNgIADAMLIBBBADoADiABIQkgACAEQQJtIg5BAnRqIgshCiACIAFrQQJ1IggEQCAKKAIAKAIAIgwpAwghEQNAAn8CQAJAIAkgCEEBdiIKQQJ0aiINKAIAKAIAIg8pAwgiEiARUgRAIBEgElMNAQwCCyAMKQMAIA8pAwBXDQELIA1BBGohCSAIIApBf3NqDAELIAoLIggNAAsLIAkiCiABa0ECdSENCyAFIA1rIQUgBCAOayEEAn8gCiABIAtGDQAaIAsgASAKRg0AGiALKAIAIQkgCyABKAIANgIAIAEgCTYCACALQQRqIQwgCiABQQRqIghHBEADQCAMKAIAIQkgDCAIKAIANgIAIAggCTYCACAIIAEgASAMRhshASAMQQRqIQwgCEEEaiIIIApHDQALCyABIAxHBEAgDCEIIAEhCQNAIAgoAgAhDyAIIAkoAgA2AgAgCSAPNgIAIAhBBGohCCAKIAlBBGoiCUYEQCABIQkgASAIRw0BBSAJIAEgASAIRhshAQwBCwsLIAwLIQECfyANIA5qIAQgBWpIBEAgACALIAEgAyAOIA0gBiAHELkCIAEhACAKDAELIAEgCiACIAMgBCAFIAYgBxC5AiANIQUgDiEEIAEhAiALCyEBIAUNAAsLIBBBEGokAAuHBwMFfwR+AnwjAEEgayIIJAACQCAARQ0AIAAoAhAiBSAARg0AIAJFBEAgBSAAKAIURg0BCyADELYDIAEEfyAAQRRqBSAAKAIQIgBBEGoLIAQgACkDCCIKuaIhDiAEIAApAwAiC7miIQ8oAgAhBgJAAkACQCADKAIEIgIgAygCCCIFSQRAIAIgDjkDCCACIA85AwAgAkEQaiECDAELIAIgAygCACIJa0EEdSIHQQFqIgJBgICAgAFPDQEgCEEMakH/////ACAFIAlrIgVBA3UiCSACIAIgCUkbIAVB8P///wdPGyAHIAMQMiIFKAIIIgIgDjkDCCACIA85AwAgBSACQRBqNgIIIAUoAgQgAygCBCADKAIAIglrIgJrIQcgAgRAIAcgCSAC/AoAAAsgAygCACEJIAMgBzYCACAFIAk2AgQgAyAFKAIIIgI2AgQgBSAJNgIIIAMoAgghByADIAUoAgw2AgggBSAJNgIAIAUgBzYCDCAFEDYLIAMgAjYCBCAAIAZHBEBBFEEQIAEbIQkDQCALIAYpAwAiDVEgBikDCCIMIApRcUUEQCAEIAy5oiEOIAQgDbmiIQ8CQCADKAIIIgUgAksEQCACIA45AwggAiAPOQMAIAJBEGohAgwBCyACIAMoAgAiAmtBBHUiB0EBaiIBQYCAgIABTw0EIAhBDGpB/////wAgBSACayICQQN1IgUgASABIAVJGyACQfD///8HTxsgByADEDIhBSAIKAIUIgEgDjkDCCABIA85AwAgCCABQRBqNgIUIAgoAhAgAygCBCADKAIAIgdrIgFrIQIgAQRAIAIgByAB/AoAAAsgAygCACEBIAMgAjYCACAIIAE2AhAgAyAIKAIUIgI2AgQgCCABNgIUIAMoAgghByADIAgoAhg2AgggCCAHNgIYIAUgATYCACAFEDYLIAMgAjYCBCANIQsgDCEKCyAGIAlqKAIAIgYgAEcNAAsLAkAgAiADKAIAa0EwRw0AIAYoAhQiACAGKAIQIgEoAhBHDQAgACkDACIMIAEpAwAiCn1CAXxCAlgEQCAAKQMIIAEpAwh9QgF8QgNUDQMLIAYpAwBCAXwiCyAKfUICWARAIAYpAwggASkDCH1CAXxCA1QNAwsgCyAMfUICVg0AIAYpAwggACkDCH1CAXxCA1QNAgtBASEGDAILECYAC0EAIQYLIAhBIGokACAGC5UCAQJ/AkAgASgCFA0AIAEpAzggASkDKFcNACABKQMwIAEpAyBXDQACQAJAIAEoAgQiA0UNAANAAkAgAygCGCIEBEAgACABIAQQvAINASABKAIEIQMLAkAgAygCEEUNACAAIAMQ/AEgASgCBCEDRQ0AIAEpAyAgAykDIFMNACABKQMwIAMpAzBVDQAgASkDKCADKQMoUw0AIAEpAzggAykDOFUNACABKAIQIAMoAhAQ2gENASABKAIEIQMLIAEgAygCBCIDNgIEIAMNAQwCCwsgASgCBCIERQ0AIAQoAhQiAw0BIAAgBCACELsCIAEoAgQoAhQhAwwBCyACIQMLIAEgAyABQUBrIAMoAgAoAggRAgA2AhQLC6gCAQN/AkAgAigCACIDIAIoAgRHBEADQAJAIAMgBEECdGooAgAiAygCEA0AIAMoAhgiBUUNACAAIAEgBRC8Ag0DCwJAA0AgAygCEEUEQCADKAIEIgMNAQwCCwsgASADRg0AIAMoAhwgAUYNACADIAE2AhwgAygCGCIFBEAgACABIAUQvAINBAsgACADEPwBRQ0AIAEpAyAgAykDIFMNACABKQMwIAMpAzBVDQAgASkDKCADKQMoUw0AIAEpAzggAykDOFUNACABKAIQIAMoAhAQ2gFFDQAgAyEEA0AgBCgCBCIEBEAgASAERw0BCwsgBARAIAMgASgCBDYCBAsgASADNgIEDAMLIARBAWoiBCACKAIEIAIoAgAiA2tBAnVJDQALC0EADwtBAQveEwMIfxd+BnwCQAJAIAFFDQADQCABKAIQIgNFBEAgASgCBCIBDQEMAgsLIAEtAEwNAAJAAkAgAygCECICIANGDQAgAiADKAIUIgVGDQAgAigCECAFRw0BIAUpAwAiCiACKQMAIgt9QgF8QgJYBEAgBSkDCCACKQMIfUIBfEIDVA0BCyADKQMAQgF8IgwgC31CAlgEQCADKQMIIAIpAwh9QgF8QgNUDQELIAwgCn1CAlYNASADKQMIIAUpAwh9QgF8QgJWDQELIAMoAhRBADYCEAwCCwNAIAMpAwghDCADKQMAIQogAC0AdEEBcSEIIAMhAgNAIAwhCwJAIAIiBSgCECICKQMIIgwgC30iECAQQj+HIhKFIBJ9Ig1C/////w+DIg4gCiIPIAUoAhQiBCkDACIafSIRIBFCP4ciE4UgE30iCkL/////D4MiFH4iFUIgiCAOIApCIIgiG358IhxC/////w+DIA1CIIgiHSAUfnwiHkIghiAVQv////8Pg4QgAikDACIKIA99Ig0gDUI/hyIUhSAUfSIWQv////8PgyIXIAsgBCkDCCIffSIOIA5CP4ciFYUgFX0iGEL/////D4MiGX4iIEIgiCAXIBhCIIgiGH58IhdC/////w+DIBZCIIgiFiAZfnwiGUIghiAgQv////8Pg4RSIBsgHX4gHEIgiHwgHkIgiHwgFiAYfiAXQiCIfCAZQiCIfFJyIBKnIBBCAFVqIBOnIBFCAFVqbCAUpyANQgBVaiAVpyAOQgBVamxHcg0AIA8gGlEgCyAfUXEgCiAPUiALIAxSckUgCEVyckUEQCARuSANuaIgELkgDrmioEQAAAAAAAAAAGNFDQELIAEoAhAgBUYEQCABIAQ2AhALIAQgAjYCECACIAQ2AhQgBRAiAkAgAigCECIFIAJGDQAgBSACKAIUIgRGDQAgAiEDIAUoAhAgBEcNAyAEKQMAIgogBSkDACILfUIBfEICWARAIAQpAwggBSkDCH1CAXxCA1QNAQsgAikDAEIBfCIMIAt9QgJYBEAgAikDCCAFKQMIfUIBfEIDVA0BCyAMIAp9QgJWDQMgAikDCCAEKQMIfUIBfEICVg0DCyABKAIQIgMoAhRBADYCEAwECyACIANHDQALCyAAIQgCQCABIgUoAhAiAygCFCIGIAMoAhAiAigCECIERg0AA0AgAyEAA0AgAiEBAkAgACkDCCAGKQMIIgp9uSIjIAQiAikDACABKQMAIgt9uSIhoiAAKQMAIAYpAwAiDH25IiQgAikDCCABKQMIIg99uSIloqEiIkQAAAAAAAAAAGENACAMIAt9uSImICWiIAogD325IiUgIaKhIiFEAAAAAAAAAABhDQACQCAhRAAAAAAAAAAAZARAICJEAAAAAAAAAABjDQIgISAiZkUNAQwCCyAhICJlICJEAAAAAAAAAABkcg0BCyAmICOiICSaICWioCIhRAAAAAAAAAAAYQ0AAkAgIUQAAAAAAAAAAGQEQCAiRAAAAAAAAAAAZEUgISAiY0VyDQIMAQsgIkQAAAAAAAAAAGNFICEgImRFcg0BCyAAIANHIAEgA0dxRQRAIAUgAygCFDYCEAtCACEKQgAhC0QAAAAAAAAAACEiIwBBIGsiBiQAIAAiAigCECIBKAIQIQMgBSAAKAIUIgA2AhACQCACKQMIIgwgACkDCCIPfbkiIyADKQMAIhIgASkDACINfbkiIaIgAikDACIQIAApAwAiEX25IiQgAykDCCITIAEpAwgiDn25IiWioSImRAAAAAAAAAAAYQ0AIBEiCiANfbkgJaIgISAPIgsgDn25oqEgJqMiIUQAAAAAAAAAAGUNACAMIQsgECEKICFEAAAAAAAA8D9mDQAgISAjoiAPuaD8BiELICEgJKIgEbmg/AYhCgsgACEBA0AgASkDCCABKAIUIgQpAwh8uSAEKQMAIAEpAwB9uaIgIqAhIiABKAIQIgEgAEcNAAsCQAJAAkAgIkQAAAAAAADgP6IiIZkiI0QAAAAAAAAAQGMEQCAAKAIUQQA2AhADQCAAKAIQIAAQIiIADQALIAVBADYCEAwBCyAMIA58uSAQIA19uaIgCyAOfLkgDSAKfbmiIAsgDHy5IAogEH25oqCgIiSZISICfyAKIBFRBEAgACEBIAMgCyAPUQ0BGgsgCiASUQRAIAAhASADIAsgE1ENARoLQSAQIyEBIAAoAhghBCABQQA2AhwgASAENgIYIAEgCzcDCCABIAo3AwAgASAANgIUIAEgAzYCECABCyEEIAMgATYCFCAAIAQ2AhACQAJAICJEAAAAAAAA8D9mRSAiICNkRSAhRAAAAAAAAAAAZEUgJEQAAAAAAAAAAGRGcXJFBEAgCBDbASIDIAUoAgQ2AgQgAiADNgIYIAIoAhAiBCADNgIYQSAQIyIBQQA2AhwgASADNgIYIAEgCzcDCCABIAo3AwAgASAENgIUIAEgAjYCECADIAE2AhAgAiABNgIUIAQgATYCECAILQAZQQFHDQMgACABENoBBEBBDBAjIgBBADYCCCAAQgA3AgAgAyAANgIYIAZBDGpBAUEAIAAQSiIBKAIIIgIgBTYCACABIAJBBGo2AgggASgCBCAAKAIEIAAoAgAiBGsiAmshAyACBEAgAyAEIAL8CgAACyAAKAIAIQIgACADNgIAIAEgAjYCBCAAIAEoAggiAzYCBCABIAI2AgggACgCCCEEIAAgASgCDDYCCCABIAI2AgAgASAENgIMIAEQUyAAIAM2AgQMBAsgBSgCGCIBRQRAQQAhAEEMECMiAUEANgIIIAFCADcCACAFIAE2AhggAUEEaiEEQQAhAgwCCyABQQRqIQQgASgCBCIAIAEoAggiAk8NASAAIAM2AgAgAEEEaiECDAILIAIoAhAiAARAIAAQIgsgAhAiDAILIAAgASgCACIHa0ECdSIJQQFqIgBBgICAgARPDQIgBkEMakH/////AyACIAdrIgJBAXUiByAAIAAgB0kbIAJB/P///wdPGyAJIAEQSiIAKAIIIgIgAzYCACAAIAJBBGo2AgggACgCBCAEKAIAIAEoAgAiA2siAmshByACBEAgByADIAL8CgAACyABKAIAIQMgASAHNgIAIAAgAzYCBCAEIAAoAggiAjYCACAAIAM2AgggASgCCCEHIAEgACgCDDYCCCAAIAM2AgAgACAHNgIMIAAQUwsgBCACNgIACyAGQSBqJAAMAQsQJgALIAUoAhAiA0UNAyADKAIUIgYgAygCECICKAIQIgRHDQIMAwsgASADRg0CIAIoAhAhBCABKAIUIQYgASEADAALAAsACwsPCwNAIAMoAhAgAxAiIgMNAAsgAUEANgIQC8MCARF+IAIpAwggASkDCCIEfSINIA1CP4ciDoUgDn0iBUL/////D4MiBiABKQMAIgcgACkDAH0iDyAPQj+HIhCFIBB9IghC/////w+DIgl+IgNCIIggBiAIQiCIIgh+fCIRQv////8PgyAJIAVCIIgiCX58IhJCIIYgA0L/////D4OEIAIpAwAgB30iBSAFQj+HIgaFIAZ9IgNC/////w+DIgogBCAAKQMIfSIEIARCP4ciB4UgB30iC0L/////D4MiDH4iE0IgiCAKIAtCIIgiC358IgpC/////w+DIANCIIgiAyAMfnwiDEIghiATQv////8Pg4RRIAggCX4gEUIgiHwgEkIgiHwgAyALfiAKQiCIfCAMQiCIfFFxIA6nIA1CAFVqIBCnIA9CAFVqbCAGpyAFQgBVaiAHpyAEQgBVamxGcQuJAwIEfwJ+An8gASkDICIHIAApAyAiBlIEQCAGIAdTDAELIABBEGoiBSABIAFBEGoiAxCHASICBEAgAkEfdgwBCwJAIAAoAlQiBC0AGEEEcQ0AIAApAxggASkDGFcNACABIAUgBEEQQRQgACgCMEEAShtqKAIAEIcBQQBMDAELAkAgASgCVCICLQAYQQRxDQAgASkDGCAAKQMYVw0AIAEgAyACQRBBFCABKAIwQQBKG2ooAgAQhwFBAE4MAQsgAS0AXCICIAEpAwgiBiAAKQMIUg0AGiACIAYgACgCWCgCACkDCFINABogAiAALQBcIAJHDQAaQQECfyAAKAIwQQBKBEAgBCgCFEEUagwBCyAEKAIQQRBqCygCACAAIAUQvgINABogACgCVCEDAn8gACgCMEEASgRAIAMoAhRBFGoMAQsgAygCEEEQagshACABKAJUIQMgAiAAKAIAIAECfyABKAIwQQBKBEAgAygCFEEUagwBCyADKAIQQRBqCygCABCHAUEASkYLQQFxC/QGAgt/An4gAEEAOgAYIAIhCSAAQTRqIQQgAEEkaiEKIwBBIGsiCyQAAkACQAJAIAEoAgAiBiABKAIEIgxGDQAgBiEAA0AgACgCBCAAKAIAa0EEdSADaiEDIABBDGoiACAMRw0ACyADRQ0AQX8gA0EFdCIAIANB////P0sbECMiByAAaiEBIAchAANAIABBADYCGCAAQgA3AxAgAEIANwMIIABCADcDACAAQSBqIgAgAUcNAAsgByECA0ACQCAGKAIAIgMgBigCBCIIRg0AQQAhASACQQA2AhQgAiEAQQAhBQNAAkAgAQRAIAEpAwAgAykDAFEEQCABKQMIIAMpAwhRDQILIAEgADYCEAsgACABNgIUIAAgAykDADcDACAAIAMpAwg3AwggAEEANgIYIAVBAWohBSAAIgFBIGohAAsgA0EQaiIDIAhHDQALIAEoAhQiA0UNACADIAEgASkDCCACKQMIURsgASABKQMAIAIpAwBRGyIDIAI2AhAgAiADNgIUAkAgAiADRiAFQQNIcg0AIAIpAwghDgNAIA4gAykDCCIPUQRAIAMoAhQiAyACRw0BDAILCyAOIA9TIg0hBSACIgEoAhAiCCABRwRAA0AgASEDAkAgBUEBcUUgCCIBKQMIIg4gAykDCCIPV3JFBEAgAyADKAIYQQRyNgIYQQAhBQwBCyAOIA9ZIAVyQQFxDQAgCiADIAkQvgNBASEFCyABKAIQIgggAkcNAAsLIA0gBUEBcUYNACANBEAgCiABIAkQvgMMAQsgASABKAIYQQRyNgIYCyAAIQILIAZBDGoiBiAMRw0ACwJAIAQoAgQiACAEKAIIIgFJBEAgACAHNgIAIABBBGohAwwBCyAAIAQoAgAiAmtBAnUiBkEBaiIAQYCAgIAETw0CIAtBDGpB/////wMgASACayIBQQF1IgIgACAAIAJJGyABQfz///8HTxsgBiAEEEoiACgCCCIBIAc2AgAgACABQQRqNgIIIAAoAgQgBCgCBCAEKAIAIgdrIgFrIQIgAQRAIAIgByAB/AoAAAsgBCgCACEBIAQgAjYCACAAIAE2AgQgBCAAKAIIIgM2AgQgACABNgIIIAQoAgghAiAEIAAoAgw2AgggACABNgIAIAAgAjYCDCAAEFMLIAQgAzYCBAsgC0EgaiQADAELECYACwszAQN/QQQQIyICIAE2AgBB/P0BIABBA0EAIQBB7IQCIABBrtsAakGuAiACQQBBAEEAEAALlwMCBX8CfCMAQTBrIgUkACAAQQA2AgggAEIANwIAIAUgARDHAwJAAkAgAiAFKwMAokQAAAAAAADAw2MNACACIAUrAxCiRAAAAAAAAMBDZA0AIAMgBSsDCKJEAAAAAAAAwMNjDQAgAyAFKwMYokQAAAAAAADAQ2QNACAAIAEoAgQgASgCAGtBDG0QViABKAIAIgYgASgCBCIHRwRAIAJEAAAAAAAAAABhIANEAAAAAAAAAABhciEIA0AgBUEANgIsIAVCADcCJCAIDQMgBUEkaiAGKAIEIAYoAgBrQQR1EFwgBigCACIBIAYoAgQiCUcEQANAIAMgASsDCKIQNCEKIAErAwAhCyAFIAr8BjcDCCAFIAIgC6IQNPwGNwMAIAVBJGogBRBMIAFBEGoiASAJRw0ACwsgACAFQSRqEGggBSgCJCIBBEAgBSABNgIoIAUoAiwaIAEQIgsgBkEMaiIGIAdHDQALCyAFQTBqJAAPCyAEIAQoAgBBwAByNgIAQcAAEIICAAsgBCAEKAIAQQJyNgIAQQIQggIACzUBAX8gASAAKAIEIgJBAXVqIQEgACgCACEAIAEgAkEBcQR/IAEoAgAgAGooAgAFIAALERAAC70FAQl/IwBBEGsiCSQAIAAgACgCACgCEBEEACIKIAJLBEAgCSAAKAIIIAJBAnRqKAIAIgMgAygCACgCEBEEACIFQQFqEJwCIggoAgAiBiADQSBqRwRAIAYgAygCICIGIAMoAiQiByAHIAZrQQR1EJkDCyAFBEADQCADKAIIIARBAnRqKAIAIgYgAUEAEMQCIAgoAgAgBEEBaiIEQQxsaiIHIAZBIGpHBEAgByAGKAIgIgcgBigCJCIGIAYgB2tBBHUQmQMLIAQgBUcNAAsLIAECfyABKAIEIgMgASgCCEkEQCADQQA2AgggA0IANwIAIAMgCCgCACIEIAgoAgQiBiAGIARrQQxtEEcgA0EMagwBCwJ/IwBBIGsiBiQAIAEoAgQgASgCACIEa0EMbSIFQQFqIgNB1qrVqgFJBEAgBkEMakHVqtWqASABKAIIIARrQQxtIgRBAXQiByADIAMgB0kbIARBqtWq1QBPGyAFIAEQYSIDKAIIIgRBADYCCCAEQgA3AgAgBCAIKAIAIgQgCCgCBCIFIAUgBGtBDG0QRyADIAMoAghBDGo2AgggAygCBCABKAIEIAEoAgAiB2siBEF0bUEMbGohBSAEBEAgBSAHIAT8CgAACyABKAIAIQQgASAFNgIAIAMgBDYCBCABIAMoAggiBzYCBCADIAQ2AgggASgCCCEFIAEgAygCDDYCCCADIAQ2AgAgAyAFNgIMIwBBEGsiBCQAIAMoAgQiCyADKAIIIgVHBEADQCADIAVBDGsiBTYCCCAEIAU2AgwgBEEMahApIAsgAygCCCIFRw0ACwsgBEEQaiQAIAMoAgAiBARAIAMoAgwaIAQQIgsgBkEgaiQAIAcMAQsQJgALCzYCBCAKQQFrIAJLBEAgACABIAJBAWoQxAILIAkgCDYCDCAJQQxqECkLIAlBEGokAAvlDgINfwF+IwBBgAJrIgMkAAJAAkACQAJAIAEoAgQgASgCACIEa0EGdQ4CAAECCyAAEOMBDAILIAAgBBBAGgwBCyADQcQAaiAEEE0CQCACQQJHBEAgASgCBCABKAIAIgRrQcEATwRAQQEhCQNAIANB0ABqIAQgCUEGdGoQTSADKAJQIgQoAgQgBCgCAGtBDG0hBgJAIAMoAlQiBEUNACAEIAQoAgQiB0EBazYCBCAHDQAgBCAEKAIAKAIIEQAAIAQQJAsgBSAGaiEFIAlBAWoiCSABKAIEIAEoAgAiBGtBBnVJDQALCyADQQA2AkAgA0IANwI4IANBOGogBRBWIAEoAgQgASgCACIEa0HBAE8EQEEBIQkDQCADQdAAaiAEIAlBBnRqEE0gA0E4aiEGIAMoAjwhByADKAJQIgUoAgAiBCEKIAUoAgQiBSEMIwBBIGsiDSQAAkAgBSAEa0EMbSIIQQBMDQAgBigCCCILIAYoAgQiBGtBDG0gCE4EQCAEIAdrIg5BDG0iDyAISARAAkAgDCAKIA5qIgtGBEAgBCEFDAELIAQhBQNAIAUgCxA8QQxqIQUgC0EMaiILIAxHDQALCyAGIAU2AgQgDkEATA0CIAYgByAEIAcgCEEMbGoQwQMgBiAKIA8gBxDAAwwCCyAGIAcgBCAHIAhBDGxqEMEDIAYgCiAIIAcQwAMMAQsgBCAGKAIAIgVrQQxtIAhqIgRB1qrVqgFJBEAgDUEMakHVqtWqASALIAVrQQxtIgtBAXQiDCAEIAQgDEkbIAtBqtWq1QBPGyAHIAVrQQxtIAYQYSIFKAIIIgsgCEEMbGohBANAIAsgChA8IApBDGohCkEMaiILIARHDQALIAUgBDYCCCAFKAIEGiAGKAIEIAdrIggEQCAEIAcgCPwKAAALIAUgBSgCCCAGKAIEIAdrajYCCCAGIAc2AgQgBSgCBCAHIAYoAgAiCGsiBEF0bUEMbGohByAEBEAgByAIIAT8CgAACyAGKAIAIQQgBiAHNgIAIAUgBDYCBCAGIAUoAgg2AgQgBSAENgIIIAYoAgghByAGIAUoAgw2AgggBSAENgIAIAUgBzYCDCAFENUBDAELECYACyANQSBqJAACQCADKAJUIgVFDQAgBSAFKAIEIgRBAWs2AgQgBA0AIAUgBSgCACgCCBEAACAFECQLIAlBAWoiCSABKAIEIAEoAgAiBGtBBnVJDQALCyADQQA2AjQgA0IANwIsIAMoAkQhASADQegAakEAQegA/AsAIANCADcDYCADQQI2AlwgA0IANwJUIANB7ABqQQBBMPwLACADQaABakEAQST8CwAgA0EANgLYASADQgA3A9ABIANBAToAzQEgA0EBOgDEASADQoCAgICAgICgPjcD6AEgA0KAgICAgICA0MEANwPgASADQfyaAjYCUCADQdAAaiIEIAEQmwEgBCADQThqIgUQ4QEgA0EANgL8ASADQgA3AvQBIARBA0ECIAJBAUYbQQIgA0EsaiICIANB9AFqIgEQ4gEgAyABNgIkIANBJGoQKSAEEGkaQRgQIyIBQbSaAjYCACABQgA3AgQgAUEMaiIGIAIQWyADIAE2AhggAyAGNgIUIAMgAykCFDcDCCAAIANBCGoQaiADIAI2AlAgBBApDAELIANBADYCQCADQgA3AjggA0E4aiADKAJEIgIoAgAiBSACKAIEIgIgAiAFa0EMbRBHIAEoAgQgASgCACIEa0HBAE8EQCADQaABaiEGIANB7ABqIQcgA0HoAGohCEEBIQkDQCADQSRqIAQgCUEGdGoQTSADQQA2AjQgA0IANwIsIAMoAiQhBCAIQQBB6AD8CwAgA0IANwNgIANBAjYCXCADQgA3AlQgB0EAQTD8CwAgBkEAQST8CwAgA0EANgLYASADQgA3A9ABIANBAToAzQEgA0EBOgDEASADQoCAgICAgICgPjcD6AEgA0KAgICAgICA0MEANwPgASADQfyaAjYCUCADQdAAaiIFIANBOGoiAhCbASAFIAQQ4QEgA0EANgL8ASADQgA3AvQBIAVBAUECIANBLGoiBCADQfQBaiIKEOIBIAMgCjYCTCADQcwAahApIAUQaRogAigCACIKBEAgAiAKEHsgAigCCBogAigCABAiIAJBADYCCCACQgA3AgALIAMgAygCLDYCOCADKQIwIRAgA0EANgI0IAMgEDcCPCADQgA3AiwgAyAENgJQIAUQKQJAIAMoAigiAkUNACACIAIoAgQiBUEBazYCBCAFDQAgAiACKAIAKAIIEQAAIAIQJAsgCUEBaiIJIAEoAgQgASgCACIEa0EGdUkNAAsLQRgQIyIBQbSaAjYCACABQgA3AgQgA0HQAGohBCABQQxqIgIgA0E4aiIFEFsgAyABNgIgIAMgAjYCHCADIAMpAhw3AwAgACADEGoLIAMgBTYCUCAEECkgAygCSCIARQ0AIAAgACgCBCIBQQFrNgIEIAENACAAIAAoAgAoAggRAAAgABAkCyADQYACaiQAC+EDAQV/IwBB4AFrIgQkACAEQRxqIAEQTSAEKAIcIQEgBEEUaiACEE0gBEEANgIsIARCADcCJCAEKAIUIQIgBEHIAGpBAEHoAPwLACAEQgA3A0AgBEECNgI8IARCADcCNCAEQcwAakEAQTD8CwAgBEGAAWpBAEEk/AsAIARBADYCuAEgBEIANwOwASAEQQE6AK0BIARBAToApAEgBEKAgICAgICAoD43A8gBIARCgICAgICAgNDBADcDwAEgBEH8mgI2AjAgBEEwaiIFIAEQmwEgBSACEOEBIARBADYC2AEgBEIANwLQASAFQQFBA0ECIANBAUYbIANBAkYbQQIgBEEkaiAEQdABaiIBEOIBIAQgATYC3AEgBEHcAWoQKSAFEGkaAkAgBCgCGCIBRQ0AIAEgASgCBCICQQFrNgIEIAINACABIAEoAgAoAggRAAAgARAkCwJAIAQoAiAiAUUNACABIAEoAgQiAkEBazYCBCACDQAgASABKAIAKAIIEQAAIAEQJAtBGBAjIgFBtJoCNgIAIAFCADcCBCAEQTBqIgMhBiABQQxqIgIgBEEkaiIFEFsgBCABNgIQIAQgAjYCDCAEIAQpAgw3AwAgACAEEGogBCAFNgIwIAMQKSAEQeABaiQAC+MHAgd/AXwjAEEgayIKJAACQCAERQ0AA0ACQAJAIAQgBkwgAyAGTHJFBEAgA0UNBCABKwMIIQ4DQCAOIAArAwhjDQIgAEEYaiEAIANBAWsiAw0ACwwECyADIARKDQEgACABRg0DIAUhAyAAIQcDQCADIAcpAxA3AxAgAyAHKQMINwMIIAMgBykDADcDACADQRhqIQMgB0EYaiIHIAFHDQALA0AgASACRgRAIAMgBWtBBGsiAUUNBSAAIAUgAfwKAAAMBQsCQCABKwMIIAUrAwhjBEAgACABKAIQNgIQIAAgASkDCDcDCCAAIAEpAwA3AwAgAUEYaiEBDAELIAAgBSgCEDYCECAAIAUpAwg3AwggACAFKQMANwMAIAVBGGohBQsgAEEYaiEAIAMgBUcNAAsMAwsCQCADIARIBEAgASAEQQJtIgtBGGxqIQgCQCAAIAFGBEAgACEHDAELIAEgAGtBGG0hCSAIKwMIIQ4gACEHA0AgByAHIAlBAXYiDEEYbGoiB0EYaiAOIAcrAwhjIg0bIQcgDCAJIAxBf3NqIA0bIgkNAAsLIAcgAGtBGG0hDAwBCyADQQFGBEAgCiAAKQMQNwMYIAogACkDCDcDECAKIAApAwA3AwggACABKAIQNgIQIAAgASkDCDcDCCAAIAEpAwA3AwAgASAKKAIYNgIQIAEgCikDEDcDCCABIAopAwg3AwAMBAsgACADQQJtIgxBGGxqIQcCQCABIAJGBEAgASEIDAELIAIgAWtBGG0hCSAHKwMIIQ4gASEIA0AgCCAJQQF2IgtBGGxqIg1BGGogCCANKwMIIA5jIg0bIQggCSALQX9zaiALIA0bIgkNAAsLIAggAWtBGG0hCwsgCkEIaiAHIAEgCBDQAyAKKAIIIQkCfyALIAxqIAQgC2siBCADIAxrIgNqSARAIAAgByAJIAwgCyAFIAYQxwIgCSEAIAgMAQsgCSAIIAIgAyAEIAUgBhDHAiALIQQgDCEDIAkhAiAHCyEBIAQNAQwCCwsgASACRg0AIAUhAyABIQcDQCADIAcpAxA3AxAgAyAHKQMINwMIIAMgBykDADcDACADQRhqIQMgB0EYaiIHIAJHDQALA0AgACABRwRAIAJBGGsiAiABQRhrIgcgA0EYayIIIANBEGsrAwAgAUEQaysDAGMiBBsiBigCEDYCECACIAYpAwg3AwggAiAGKQMANwMAIAcgASAEGyEBIAUgAyAIIAQbIgNHDQEMAgsLA0AgAkEYayICIANBGGsiAygCEDYCECACIAMpAwg3AwggAiADKQMANwMAIAMgBUcNAAsLIApBIGokAAvdBwIHfwF8IwBBIGsiCiQAAkAgBEUNAANAAkACQCAEIAZMIAMgBkxyRQRAIANFDQQgASsDACEOA0AgDiAAKwMAYw0CIABBGGohACADQQFrIgMNAAsMBAsgAyAESg0BIAAgAUYNAyAFIQMgACEHA0AgAyAHKQMQNwMQIAMgBykDCDcDCCADIAcpAwA3AwAgA0EYaiEDIAdBGGoiByABRw0ACwNAIAEgAkYEQCADIAVrQQRrIgFFDQUgACAFIAH8CgAADAULAkAgASsDACAFKwMAYwRAIAAgASgCEDYCECAAIAEpAwg3AwggACABKQMANwMAIAFBGGohAQwBCyAAIAUoAhA2AhAgACAFKQMINwMIIAAgBSkDADcDACAFQRhqIQULIABBGGohACADIAVHDQALDAMLAkAgAyAESARAIAEgBEECbSILQRhsaiEIAkAgACABRgRAIAAhBwwBCyABIABrQRhtIQkgCCsDACEOIAAhBwNAIAcgByAJQQF2IgxBGGxqIgdBGGogDiAHKwMAYyINGyEHIAwgCSAMQX9zaiANGyIJDQALCyAHIABrQRhtIQwMAQsgA0EBRgRAIAogACkDEDcDGCAKIAApAwg3AxAgCiAAKQMANwMIIAAgASgCEDYCECAAIAEpAwg3AwggACABKQMANwMAIAEgCigCGDYCECABIAopAxA3AwggASAKKQMINwMADAQLIAAgA0ECbSIMQRhsaiEHAkAgASACRgRAIAEhCAwBCyACIAFrQRhtIQkgBysDACEOIAEhCANAIAggCUEBdiILQRhsaiINQRhqIAggDSsDACAOYyINGyEIIAkgC0F/c2ogCyANGyIJDQALCyAIIAFrQRhtIQsLIApBCGogByABIAgQ0AMgCigCCCEJAn8gCyAMaiAEIAtrIgQgAyAMayIDakgEQCAAIAcgCSAMIAsgBSAGEMgCIAkhACAIDAELIAkgCCACIAMgBCAFIAYQyAIgCyEEIAwhAyAJIQIgBwshASAEDQEMAgsLIAEgAkYNACAFIQMgASEHA0AgAyAHKQMQNwMQIAMgBykDCDcDCCADIAcpAwA3AwAgA0EYaiEDIAdBGGoiByACRw0ACwNAIAAgAUcEQCACQRhrIgIgAUEYayIEIANBGGsiBiAGKwMAIAQrAwBjIgcbIggoAhA2AhAgAiAIKQMINwMIIAIgCCkDADcDACAEIAEgBxshASAFIAMgBiAHGyIDRw0BDAILCwNAIAJBGGsiAiADQRhrIgMoAhA2AhAgAiADKQMINwMIIAIgAykDADcDACADIAVHDQALCyAKQSBqJAALpgIBBn8jAEEQayIEJAAgACgCACIGIAAoAgQiAkEYbGohBwJAIAEEQAJAIAJBgQFPBEAgAiEDA0AgA0EYbBBQIgUNAiADQQF2IgMNAAsLIAYgByACQQBBABC2AQwCCyAGIAcgAiAFIAMQtgEgBRAiDAELAkAgAkGBAU8EQCACIQMDQCADQRhsEFAiBQ0CIANBAXYiAw0ACwsgBiAHIAJBAEEAELUBDAELIAYgByACIAUgAxC1ASAFECILIAAoAgQiA0ECTwRAIAAoAgAhAiAEIANBAXY2AgwgBCACNgIIIARBCGogAUEBcyICEMkCIAAoAgAhASAEIAAoAgQiACAAQQF2QQFqIgBrNgIEIAQgASAAQRhsajYCACAEIAIQyQILIARBEGokAAtFAQF/IAAoAgAhASAAQQA2AgAgAQRAIAEoAjAiAARAIAAQIgsgAUEANgI4IAFCADcCMCABKAIgIgAEQCAAECILIAEQIgsLkgcBCX8jAEEQayIPJAACQCAFRQ0AA0ACQAJAIAUgB0wgBCAHTHJFBEAgBEUNBCADKAIAKAIAIg0gASgCACIIQQJ0aigCACEJA0AgCSANIAAoAgAiCkECdGooAgBJDQIgAEEEaiEAIARBAWsiBA0ACwwECyAEIAVKDQEgACABRg0DIAYhBCAAIQUDQCAEIAUoAgA2AgAgBEEEaiEEIAVBBGoiBSABRw0ACyADKAIAIQUDQCABIAJGBEAgBCAGayIBRQ0FIAAgBiAB/AoAAAwFCyAAIAEoAgAiAyAGKAIAIgcgBSgCACIIIANBAnRqKAIAIAggB0ECdGooAgBJIgMbNgIAIAFBBEEAIAMbaiEBIABBBGohACAGQQBBBCADG2oiBiAERw0ACwwDCwJAIAQgBUgEQCABIAVBAm0iC0ECdGohCAJAIAAgAUYEQCAAIQkMAQsgASAAa0ECdSEKIA0gCCgCAEECdGooAgAhECAAIQkDQCAJIAkgCkEBdiIMQQJ0aiIJQQRqIBAgDSAJKAIAQQJ0aigCAEkiDhshCSAMIAogDEF/c2ogDhsiCg0ACwsgCSAAa0ECdSEMDAELIARBAUYEQCAAIAg2AgAgASAKNgIADAQLIAAgBEECbSIMQQJ0aiEJAkAgASACRgRAIAEhCAwBCyACIAFrQQJ1IQogDSAJKAIAQQJ0aigCACEQIAEhCANAIAggCkEBdiILQQJ0aiIOQQRqIAggDSAOKAIAQQJ0aigCACAQSSIOGyEIIAogC0F/c2ogCyAOGyIKDQALCyAIIAFrQQJ1IQsLIA9BCGogCSABIAgQkQEgDygCCCEKAn8gCyAMaiAFIAtrIgUgBCAMayIEakgEQCAAIAkgCiADIAwgCyAGIAcQywIgCiEAIAgMAQsgCiAIIAIgAyAEIAUgBiAHEMsCIAshBSAMIQQgCiECIAkLIQEgBQ0BDAILCyABIAJGDQAgBiEEIAEhBQNAIAQgBSgCADYCACAEQQRqIQQgBUEEaiIFIAJHDQALIAMoAgAhBQNAIAAgAUYEQANAIAJBBGsiAiAEQQRrIgQoAgA2AgAgBCAGRw0ADAMLAAsgAkEEayICIAFBBGsiBygCACIDIARBBGsiCCgCACIJIAUoAgAiCiAJQQJ0aigCACAKIANBAnRqKAIASSIDGzYCACAHIAEgAxshASAEIAggAxsiBCAGRw0ACwsgD0EQaiQAC5IHAQl/IwBBEGsiDyQAAkAgBUUNAANAAkACQCAFIAdMIAQgB0xyRQRAIARFDQQgAygCACgCACINIAEoAgAiCEECdGooAgAhCQNAIAkgDSAAKAIAIgpBAnRqKAIASQ0CIABBBGohACAEQQFrIgQNAAsMBAsgBCAFSg0BIAAgAUYNAyAGIQQgACEFA0AgBCAFKAIANgIAIARBBGohBCAFQQRqIgUgAUcNAAsgAygCACEFA0AgASACRgRAIAQgBmsiAUUNBSAAIAYgAfwKAAAMBQsgACABKAIAIgMgBigCACIHIAUoAgAiCCADQQJ0aigCACAIIAdBAnRqKAIASSIDGzYCACABQQRBACADG2ohASAAQQRqIQAgBkEAQQQgAxtqIgYgBEcNAAsMAwsCQCAEIAVIBEAgASAFQQJtIgtBAnRqIQgCQCAAIAFGBEAgACEJDAELIAEgAGtBAnUhCiANIAgoAgBBAnRqKAIAIRAgACEJA0AgCSAJIApBAXYiDEECdGoiCUEEaiAQIA0gCSgCAEECdGooAgBJIg4bIQkgDCAKIAxBf3NqIA4bIgoNAAsLIAkgAGtBAnUhDAwBCyAEQQFGBEAgACAINgIAIAEgCjYCAAwECyAAIARBAm0iDEECdGohCQJAIAEgAkYEQCABIQgMAQsgAiABa0ECdSEKIA0gCSgCAEECdGooAgAhECABIQgDQCAIIApBAXYiC0ECdGoiDkEEaiAIIA0gDigCAEECdGooAgAgEEkiDhshCCAKIAtBf3NqIAsgDhsiCg0ACwsgCCABa0ECdSELCyAPQQhqIAkgASAIEJEBIA8oAgghCgJ/IAsgDGogBSALayIFIAQgDGsiBGpIBEAgACAJIAogAyAMIAsgBiAHEMwCIAohACAIDAELIAogCCACIAMgBCAFIAYgBxDMAiALIQUgDCEEIAohAiAJCyEBIAUNAQwCCwsgASACRg0AIAYhBCABIQUDQCAEIAUoAgA2AgAgBEEEaiEEIAVBBGoiBSACRw0ACyADKAIAIQUDQCAAIAFGBEADQCACQQRrIgIgBEEEayIEKAIANgIAIAQgBkcNAAwDCwALIAJBBGsiAiABQQRrIgcoAgAiAyAEQQRrIggoAgAiCSAFKAIAIgogCUECdGooAgAgCiADQQJ0aigCAEkiAxs2AgAgByABIAMbIQEgBCAIIAMbIgQgBkcNAAsLIA9BEGokAAuSBwEJfyMAQRBrIg8kAAJAIAVFDQADQAJAAkAgBSAHTCAEIAdMckUEQCAERQ0EIAMoAgAoAgAiDSABKAIAIghBAnRqKAIAIQkDQCAJIA0gACgCACIKQQJ0aigCAEkNAiAAQQRqIQAgBEEBayIEDQALDAQLIAQgBUoNASAAIAFGDQMgBiEEIAAhBQNAIAQgBSgCADYCACAEQQRqIQQgBUEEaiIFIAFHDQALIAMoAgAhBQNAIAEgAkYEQCAEIAZrIgFFDQUgACAGIAH8CgAADAULIAAgASgCACIDIAYoAgAiByAFKAIAIgggA0ECdGooAgAgCCAHQQJ0aigCAEkiAxs2AgAgAUEEQQAgAxtqIQEgAEEEaiEAIAZBAEEEIAMbaiIGIARHDQALDAMLAkAgBCAFSARAIAEgBUECbSILQQJ0aiEIAkAgACABRgRAIAAhCQwBCyABIABrQQJ1IQogDSAIKAIAQQJ0aigCACEQIAAhCQNAIAkgCSAKQQF2IgxBAnRqIglBBGogECANIAkoAgBBAnRqKAIASSIOGyEJIAwgCiAMQX9zaiAOGyIKDQALCyAJIABrQQJ1IQwMAQsgBEEBRgRAIAAgCDYCACABIAo2AgAMBAsgACAEQQJtIgxBAnRqIQkCQCABIAJGBEAgASEIDAELIAIgAWtBAnUhCiANIAkoAgBBAnRqKAIAIRAgASEIA0AgCCAKQQF2IgtBAnRqIg5BBGogCCANIA4oAgBBAnRqKAIAIBBJIg4bIQggCiALQX9zaiALIA4bIgoNAAsLIAggAWtBAnUhCwsgD0EIaiAJIAEgCBCRASAPKAIIIQoCfyALIAxqIAUgC2siBSAEIAxrIgRqSARAIAAgCSAKIAMgDCALIAYgBxDNAiAKIQAgCAwBCyAKIAggAiADIAQgBSAGIAcQzQIgCyEFIAwhBCAKIQIgCQshASAFDQEMAgsLIAEgAkYNACAGIQQgASEFA0AgBCAFKAIANgIAIARBBGohBCAFQQRqIgUgAkcNAAsgAygCACEFA0AgACABRgRAA0AgAkEEayICIARBBGsiBCgCADYCACAEIAZHDQAMAwsACyACQQRrIgIgAUEEayIHKAIAIgMgBEEEayIIKAIAIgkgBSgCACIKIAlBAnRqKAIAIAogA0ECdGooAgBJIgMbNgIAIAcgASADGyEBIAQgCCADGyIEIAZHDQALCyAPQRBqJAALHwAgAQRAIAAgASgCABDOAiAAIAEoAgQQzgIgARAiCwu1BAEGfyMAQYABayIEJAAgACgCXCEGIARCgICAgICAgHg3A1ggBEKAgICAgICAeDcDUCAEQoCAgICAgIB4NwNIIARCgICAgICAgPj/ADcDQCAEQoCAgICAgID4/wA3AzggBEKAgICAgICA+P8ANwMwIAQgBEEwakEw/AoAACABKAIEIgUgBkEDbiIGQQF0SyAFQRBLcQJAIAUgBk8NACABIAYQnwEgBiABKAIEIgdrQTBsIgVBAEwNACAFQTBuIQUgASgCACAHQTBsaiEHA0AgByAEQTD8CgAAIAdBMGohByAFQQFLIAVBAWshBQ0ACwsgASAGNgIEBEBBACEGIAEoAgAhBQJAIAEoAgQiB0UNACAHQTBsIggQJyEGIAhFDQAgBiAFIAj8CgAACyABIAUEfyAFECIgASgCBAUgBws2AgggASAGNgIACyACKAIEIQYgAiAAKAJcQQNuIgUQJSACIAU2AgQgBkERSSAGIAVBAXRNckUEQCACEC0LIAAoAlwhBiAEIAI2AmggBCABNgJkIAQgADYCYCAGQQNuIQUCQCADBEAgBkEDSQ0BIAMtABBBAXENAUEAIQBBACECA0AgAEEBaiIAQYAIRgRAQQAhACADLQAQDQMLIARB4ABqIAIQ4AMgAkEBaiICIAVHDQALDAELIAQgAjYCeCAEIAE2AnQgBCAANgJwIAZBA0kNAEEAIQIDQCAEQfAAaiACEOADIAJBAWoiAiAFRw0ACwsgBEGAAWokAAvqGQICfx18IwBB4AJrIgYkAEQAAAAAAADwPyAEoSIPIA8gDyABKwMQIhiiIAQgGCACKwMQIhCgIAIrAxhEAAAAAAAAAACgIgmiIgiioKIgBCAPIAiiIAQgASsDKCIdIAIrAzAiEqAgAisDOEQAAAAAAAAAAKAiDaIiCKKgIguioCIOoiAEIA8gC6IgBCAEIB2iIA8gCKKgoqAiC6KgIRogDyAPIA8gASsDCCIZoiAEIBkgAisDCCIToCAJoiIIoqCiIAQgDyAIoiAEIAErAyAiHiACKwMoIhagIA2iIgiioCIKoqAiDKIgBCAPIAqiIAQgBCAeoiAPIAiioKKgIgiioCEbIA8gDyAPIAErAwAiH6IgBCAfIAIrAwAiF6AgCaIiCqKgoiAEIA8gCqIgBCABKwMYIiAgAisDICIVoCANoiIKoqAiEaKgIhSiIAQgDyARoiAEIAQgIKIgDyAKoqCioCIKoqAhHCAPIA8gDyAEIAmioKIgBCAPIAmiIAQgDaKgIhGioCIJoiAEIA8gEaIgBCAEIA8gDaKgoqAiDaKgIhFEAAAAAAAAAABiBEAgGyARoyEbIBwgEaMhHCAaIBGjIRoLIA1EAAAAAAAAAABiBEAgCyANoyELIAogDaMhCiAIIA2jIQgLIAlEAAAAAAAAAABiBEAgDiAJoyEOIBQgCaMhFCAMIAmjIQwLAkAgCiAUoSIJIAkgCaIgCCAMoSIIIAiioCALIA6hIgkgCaKgnyILoyIMvUL///////////8Ag0L/////////9/8AWARAIAYgDDkD+AEgBiAJIAujOQOIAiAGIAggC6M5A4ACDAELIAZCADcDiAIgBkIANwOAAiAGQgA3A/gBC0QAAAAAAAAAACEOIBKaIBUgFaIgFiAWoqAgEiASoqCfIhGjISQgFSARoyIVvUL///////////8Ag0KAgICAgICA+P8AVCECIAUrAxAhISAFKwMIISIgBSsDACEjIAMrAxAiCSAQIBcgF6IgEyAToqAgECAQoqCfIgijRAAAAAAAAAAAIBcgCKMiC71C////////////AINCgICAgICAgPj/AFQiBRsiECALRAAAAAAAAAAAIAUbIhIgAysDACIKokQAAAAAAAAAAKAgEyAIo0QAAAAAAAAAACAFGyITIAMrAwgiDaKgIBAgCaKgIgiioSIMIAyiIAogEiAIoqEiCyALoiANIBMgCKKhIgggCKKgoCIUIAogCqIgDSANoqAgCSAJoqBEEeotgZmXcT2iYwRAICEgGKEiCCAQIBIgIyAfoSIJokQAAAAAAAAAAKAgEyAiIBmhIgqioCAQIAiioCIIoqEiDCAMoiAJIBIgCKKhIgsgC6IgCiATIAiioSIIIAiioKAhFAtEAAAAAAAAAAAhDUQAAAAAAAAAACEJIAsgFJ8iCqMiC71C////////////AINC//////////f/AFgEQCAIIAqjIQ0gDCAKoyEOIAshCQtEAAAAAAAAAAAhCyADKwMwIgggJEQAAAAAAAAAgCACGyIUIBWaRAAAAAAAAACAIAIbIhcgAysDICIMokQAAAAAAAAAAKAgFpogEaNEAAAAAAAAAIAgAhsiFiADKwMoIhiioCAUIAiioCIRoqEiFSAVoiAMIBcgEaKhIgogCqIgGCAWIBGioSIRIBGioKAiGSAMIAyiIBggGKKgIAggCKKgRBHqLYGZl3E9omMEQCAhIB2hIgggFCAXICMgIKEiDKJEAAAAAAAAAACgIBYgIiAeoSIRoqAgFCAIoqAiCKKhIhUgFaIgDCAXIAiioSIKIAqiIBEgFiAIoqEiESARoqCgIRkLRAAAAAAAAAAAIQxEAAAAAAAAAAAhCCAGIBM5A5gBIAYgCTkDqAEgBiASOQOQASAGIA05A7ABIAYgEiANoiATIAmioTkD0AEgBiAOOQO4ASAGIBA5A6ABIAYgECAJoiASIA6ioTkDyAEgBiATIA6iIBAgDaKhOQPAASAGQdgBaiAGQZABaiICEOQDIAYgFjkDmAEgCiAZnyIKoyIJvUL///////////8Ag0L/////////9/8AWARAIBEgCqMhDCAVIAqjIQsgCSEICyAGIAg5A6gBIAYgFzkDkAEgBiAMOQOwASAGIBcgDKIgFiAIoqE5A9ABIAYgCzkDuAEgBiAUOQOgASAGIBQgCKIgFyALoqE5A8gBIAYgFiALoiAUIAyioTkDwAEgBkHwAGogAhDkAyAGKwNwIg0gBisD2AEiFaJEAAAAAAAAAACgIAYrA3giCSAGKwPgASIRoqAgBisDgAEiCyAGKwPoASIKoqAgBisDiAEiDCAGKwPwASIIoqAiDkQAAAAAAAAAAGMgEiABKwMYIAErAwChIhKiRAAAAAAAAAAAoCATIAErAyAgASsDCKEiE6KgIBAgASsDKCABKwMQoSIQoqAgFyASokQAAAAAAAAAAKAgFiAToqAgFCAQoqCgRAAAAAAAAAAAY0cEQCAOmiEOIAyaIQwgC5ohCyANmiENIAmaIQkLIAYCfCAOmUT+///////vP2QEQCAPIAiiIAQgDKKgIQggDyAKoiAEIAuioCEKIA8gFaIgBCANoqAhCyAPIBGiIAQgCaKgDAELIA8gDhBdIgiiEKgBIQ4gBisD2AEhEiAGKwPgASETIAYrA+gBIQogDiAGKwPwAaIgDCAEIAiiEKgBIgyioCAIEKgBIhCjIQggDiAKoiALIAyioCAQoyEKIA4gEqIgDSAMoqAgEKMhCyAOIBOiIAkgDKKgIBCjCyIJOQNYIAYgCDkDaCAGIAs5A1AgBiAKOQNgIAYgCyAKoiAJIAiioSIMIAygOQO4AiAGIAsgCaIgCiAIoqAiDCAMoDkDsAIgBiALIAuiIAggCKKgIAkgCaKhIAogCqKhOQOoAiAGQZABaiEBAkAgBkGoAmoiBSICKwMAIgkgBisD+AEiDKJEAAAAAAAAAACgIAIrAwgiCCAGKwOAAiIKoqAgAisDECILIAYrA4gCIg6ioCINRP7//////+8/ZgRAIAFCADcDECABQgA3AwggAUIANwMAIAFCgICAgICAgPg/NwMYDAELIA1E/v//////779jBEBEGC1EVPsh+T8QqAEhDCABRBgtRFT7Ifk/EJcBOQMYIAEgDCAIIAlEAAAAAAAAAACiIgqhIAhEAAAAAAAAAACiIhAgCqEiDiAOIA6iIAtEAAAAAAAAAACiIg4gCKEiCCAIoiAJIA6hIgkgCaKgoEQAAAAAAACwPGMiAhsiDSANIA2iIA4gEKEgCCACGyIIIAiiIAogC6EgCSACGyIJIAmioKCfIgujojkDECABIAwgCSALo6I5AwggASAMIAggC6OiOQMADAELIAEgDUQAAAAAAADwP6AiDSANoJ8iDUQAAAAAAADgP6I5AxggASAJIAqiIAwgCKKhRAAAAAAAAPA/IA2jIg2iOQMQIAEgDCALoiAJIA6ioSANojkDCCABIAggDqIgCiALoqEgDaI5AwALIAYgBisDaCIIIAErAxgiCaIgASsDACILIAYrA1AiDKKhIAErAwgiCiAGKwNYIg6ioSAGKwNgIg0gASsDECIQoqE5A0ggBiAJIA2iIAggEKKgIAsgDqKgIAwgCqKhOQNAIAYgDCAQoiAIIAqiIAkgDqKgoCALIA2ioTkDOCAGIAsgCKIgCSAMoqAgCiANoqAgECAOoqE5AzAgAysDACEIIAMrAwghCSADKwMQIQsgBisD2AEhDCAGKwPgASEKIAYrA+gBIQ4gBisD8AEhDSAGIAYpA0g3A8ACIAYgBikDQDcDuAIgBiAGKQM4NwOwAiAGIAYpAzA3A6gCIAYgCzkDoAIgBiAJOQOYAiAGIAg5A5ACIAYgDTkDqAEgBiAOmjkDoAEgBiAKmjkDmAEgBiAMmjkDkAEgBkHIAmoiAiABIAZBkAJqIgcQ5QEgBkEYaiAFIAIQ5QEgAysDICEIIAMrAyghCSADKwMwIQsgBisDcCEMIAYrA3ghCiAGKwOAASEOIAYrA4gBIQ0gBiAGKQNINwPAAiAGIAYpA0A3A7gCIAYgBikDODcDsAIgBiAGKQMwNwOoAiAGIAs5A6ACIAYgCTkDmAIgBiAIOQOQAiAGIA05A6gBIAYgDpo5A6ABIAYgCpo5A5gBIAYgDJo5A5ABIAIgASAHEOUBIAYgBSACEOUBIAYrAxghCCAGKwMAIQkgBisDICELIAYrAwghDCADKwMYIQogAysDOCEOIAAgDyAGKwMooiAEIAYrAxCioDkDMCAAIA8gC6IgBCAMoqA5AyggACAPIAiiIAQgCaKgOQMgIABCgICAgICAgPg/NwMYIAAgGjkDECAAIBs5AwggACAcOQMAIAAgDyAKoiAEIA6ioDkDOCAGQeACaiQAC/slAhN/JnwjAEHwCGsiBCQAAkAgACgCXEEDSQ0AIAAoAlwiBwR/IAAoAmghBSAAKAK4ASEIIAAoArwBIQsDQAJAAkAgC0UNACAIIA9BBXQiFGorAxhEAAAAAAAAAABjIglFIAggBSAPQQJ0aigCACIMQQV0IhBqKwMYIhdEAAAAAAAAAABjRXJFBEBBACETIAhBQEEgIA9BA3AiCUECRhtqIBRqKwMYRAAAAAAAAAAAYw0CIAhBYEHAACAJG2ogFGorAxhEAAAAAAAAAABjDQIgCEFAQSAgDEEDbyIJQQJGG2ogEGorAxhEAAAAAAAAAABjDQIgCEFgQcAAIAkbaiAQaisDGEQAAAAAAAAAAGMNAgwBCyAJIBdEAAAAAAAAAABjc0UNAEEAIRMMAQtBASETIA9BAWoiDyAHRw0BCwsgEwVBAQtFBEAgAEENECwMAQsgBEEoaiAAEDchDSAAQdgAahA4IABB6ABqEDggAEH4AGoQOCAEQRhqIAAgBCABEFciASACENUDAkAgASgCECICIAFGBH9BEAUgAkUNAUEUCyEBIAIgAigCACABaigCABEAAAsCQAJAIANFDQAgAy0AEEEBRw0AIABBDhAsDAELIAQoAhxFDQACQCANKAK8ASANKAJcRw0AIAAoAkwiD0UNACAAKAJIIRMgBCgCGCEUIARByAhqIQkgBEGwCGohCyAEQZgIaiEMA0AgFCAWQShsaiIBKwMgIR4gASsDGCEdIAErAxAhHyABKwMIIRwgBEHgCGogDSABKAIAENcDIA0oAkgiCiANKAJYIgEgBCgC6AgiEUECdCISaigCAEEYbGohDiAKIAEgBCgC5AgiCEECdCIQaigCAEEYbGohBiAKIAEgBCgC4AgiBUECdCIHaigCAEEYbGohAkQAAAAAAAAAACEoRAAAAAAAAAAAISZEAAAAAAAAAAAhKSAEKALsCCIVQQBOBEAgCiABIBVBAnRqKAIAQRhsaiIBKwMQISkgASsDACEoIAErAwghJgsgEyAWQRhsaiEKIAQgAikDEDcDkAggBCACKQMINwOICCAEIAIpAwA3A4AIIAwgBikDEDcDECAMIAYpAwg3AwggDCAGKQMANwMAIAsgDikDEDcDECALIA4pAwg3AwggCyAOKQMANwMAIAQgKTkD2AggBCAmOQPQCCAEICg5A8gIIARCgoCAgDA3AsAGIARCgICAgBA3ArgGQQAhAgJAAkADQCAcIRcCQAJAAkACQCAEQbgGaiACaigCACIBDgMDAAECCyAfIRcMAgsgHSEXDAELIB4hFwsgF0QAAAAAAADwP2IEQCACQQRqIgJBEEYNAgwBCwsgBEGACGohAgJAAkACQAJAIAEOAwMAAQILIAwhAgwCCyALIQIMAQsgCSECCyAKIAIpAxA3AxAgCiACKQMINwMIIAogAikDADcDAAwBCwJAIBVBAEgEQCAEIA0oArgBIgYgBUEFdGoiASkDGDcD0AYgBCABKQMQNwPIBiAEIAEpAwg3A8AGIAQgASkDADcDuAYgBCAGIAhBBXRqIgEpAxg3A/AGIAQgASkDEDcD6AYgBCABKQMINwPgBiAEIAEpAwA3A9gGIAQgBiARQQV0aiIBKQMYNwOQByAEIAEpAxA3A4gHIAQgASkDCDcDgAcgBCABKQMANwP4BiANKAJoIgUgEGooAgAhAiAFIAdqKAIAIQEgBCAGIAUgEmooAgBBBXRqIgUpAxg3A9AFIAQgBSkDEDcDyAUgBCAFKQMINwPABSAEIAUpAwA3A7gFIAQgBiABQQV0aiIBKQMYNwPwBSAEIAEpAxA3A+gFIAQgASkDCDcD4AUgBCABKQMANwPYBSAEIAYgAkEFdGoiASkDGDcDkAYgBCABKQMQNwOIBiAEIAEpAwg3A4AGIAQgASkDADcD+AUgBCAEKwPACCIxRFVVVVVVVdU/oiAEKwOoCCIyRFVVVVVVVdU/oiAEKwOQCCIzRFVVVVVVVdU/oqCgOQP4ByAEIAQrA7gIIjREVVVVVVVV1T+iIAQrA6AIIjVEVVVVVVVV1T+iIAQrA4gIIjZEVVVVVVVV1T+ioKA5A/AHIAQgBCsDsAgiN0RVVVVVVVXVP6IgBCsDmAgiOERVVVVVVVXVP6IgBCsDgAgiOURVVVVVVVXVP6KgoDkD6AcgBEECNgKoBSAEQoCAgIAQNwKgBUQAAAAAAAAAACEiQQAhEkQAAAAAAAAAACEjRAAAAAAAAAAAISREAAAAAAAAAAAhIANAQQRBCCAEQaAFaiASaigCACIOQQFGIhAbQQAgDhsiAkHwlAFqIBwhFwJAAkACQAJAIAJB/JQBaigCACIGDgMDAAECCyAfIRcMAgsgHSEXDAELIB4hFwsoAgAhESAcIRgCQAJAAkACQCAODgMDAAECCyAfIRgMAgsgHSEYDAELIB4hGAtEAAAAAAAA8D8gGKEhGCAEQYAIaiIBIQICQAJAAkACQCARDgMDAAECCyAMIQIMAgsgCyECDAELIAkhAgsgFyAYoyEaAkACQAJAAkAgBg4DAwABAgsgDCEBDAILIAshAQwBCyAJIQELIAQgAikDEDcDyAcgBCACKQMINwPAByAEIAIpAwA3A7gHIAQgASkDEDcD4AcgBCABKQMINwPYByAEIAEpAwA3A9AHIARBIEHAACARQQFGG0EAIBEbIgcgBEG4BmoiBWoiASkDGDcD2AIgBCABKQMQNwPQAiAEIAEpAwg3A8gCIAQgASkDADcDwAIgBEEgQcAAIAZBAUYbQQAgBhsiAiAEQbgFaiIBaiIIKQMYNwP4AiAEIAgpAxA3A/ACIAQgCCkDCDcD6AIgBCAIKQMANwPgAiAEIAEgB2oiASkDGDcD2AQgBCABKQMQNwPQBCAEIAEpAwg3A8gEIAQgASkDADcDwAQgBCACIAVqIgEpAxg3A/gEIAQgASkDEDcD8AQgBCABKQMINwPoBCAEIAEpAwA3A+AEIARBwANqIARBuAdqIARBwAJqIARBwARqIBogBEHoB2oQ0AIgBCsD+ANEAAAAAAAAAACgIScgBCsD0AMiOiAEKwPwA6AgBCsDyAMiOyAEKwPoA6AhGCAEKwPAAyI8IAQrA+ADoCEXIARBgAhqIQEgBCsD2AMhLQJAAkACQAJAIA4OAwMAAQILIAwhAQwCCyALIQEMAQsgCSEBCyAnoiEuIBggJ6IhLyAXICeiITAgASsDEEQAAAAAAADwPyAaoSIXQSBBwAAgEBtBACAOGyICIARBuAZqaiIFKwMQoiAaIARBuAVqIAJqIgIrAxCioKAgFyAFKwMYoiAaIAIrAxiioEQAAAAAAAAAAKAiKqIhISABKwMIIBcgBSsDCKIgGiACKwMIoqCgICqiISsgASsDACAXIAUrAwCiIBogAisDAKKgoCAqoiEsIDMhGiA2IRsgOSEYIBwhFwJAAkACQCAODgICAAELIDIhGiA1IRsgOCEYIB8hFwwBCyAdIB4gDkECRiIBGyEXIDEgKSABGyEaIDQgJiABGyEbIDcgKCABGyEYC0QAAAAAAADwPyAXoSIZICEgF6IgLiAZoqAiJaIgFyAaIBeiICEgGaKgoqAgGSArIBeiIC8gGaKgIhqiIBcgGyAXoiArIBmioKKgISsgGSAsIBeiIDAgGaKgIhuiIBcgGCAXoiAsIBmioKKgISwgFyAqIBeiICcgGaKgIhiiIBkgJyAXoiAtIBmioKKgIS0gFyAloiAZIC4gF6IgOiAZoqCioCElIBcgGqIgGSAvIBeiIDsgGaKgoqAhGiAXIBuiIBkgMCAXoiA8IBmioKKgIRsgGSAYoiAXIBcgKiAZoqCioCEYIBwhFwJAAkACQAJAIA4OAwMAAQILIB8hFwwCCyAdIRcMAQsgHiEXCyAXoiAlRAAAAAAAAPA/IBehIiGioCElICsgF6IgGiAhoqAhGiAsIBeiIBsgIaKgIRsgGCAXoiAtICGioCIXRAAAAAAAAAAAYgRAICUgF6MhJSAaIBejIRogGyAXoyEbCyAcIRcCQAJAAkACQCARDgMDAAECCyAfIRcMAgsgHSEXDAELIB4hFwsgHCEYAkACQAJAAkAgBg4DAwABAgsgHyEYDAILIB0hGAwBCyAeIRgLICIgFyAYoiIXoCEiICMgJSAXoqAhIyAkIBogF6KgISQgICAbIBeioCEgIBJBBGoiEkEMRw0ACwwBCyASIA0oAmgiBmooAgAhAiAGIAdqKAIAIQEgBCANKAK4ASIHIAVBBXRqIgUpAxg3A9AGIAQgBSkDEDcDyAYgBCAFKQMINwPABiAEIAUpAwA3A7gGIAQgByABQQV0aiIBKQMYNwPwBiAEIAEpAxA3A+gGIAQgASkDCDcD4AYgBCABKQMANwPYBiAEIAcgEUEFdGoiASkDGDcDkAcgBCABKQMQNwOIByAEIAEpAwg3A4AHIAQgASkDADcD+AYgBCAHIAJBBXRqIgEpAxg3A7AHIAQgASkDEDcDqAcgBCABKQMINwOgByAEIAEpAwA3A5gHIAYgEGooAgAhASAEIAcgBiAVQQJ0aigCAEEFdGoiAikDGDcD0AUgBCACKQMQNwPIBSAEIAIpAwg3A8AFIAQgAikDADcDuAUgBCAHIAhBBXRqIgIpAxg3A/AFIAQgAikDEDcD6AUgBCACKQMINwPgBSAEIAIpAwA3A9gFIAQgByABQQV0aiIBKQMYNwOQBiAEIAEpAxA3A4gGIAQgASkDCDcDgAYgBCABKQMANwP4BSAEIAcgFUEFdGoiASkDGDcDsAYgBCABKQMQNwOoBiAEIAEpAwg3A6AGIAQgASkDADcDmAYgBCApRAAAAAAAANA/oiAEKwOQCEQAAAAAAADQP6IgBCsDqAhEAAAAAAAA0D+ioCAEKwPACEQAAAAAAADQP6KgoDkDyAcgBCAmRAAAAAAAANA/oiAEKwOICEQAAAAAAADQP6IgBCsDoAhEAAAAAAAA0D+ioCAEKwO4CEQAAAAAAADQP6KgoDkDwAcgBCAoRAAAAAAAANA/oiAEKwOACEQAAAAAAADQP6IgBCsDmAhEAAAAAAAA0D+ioCAEKwOwCEQAAAAAAADQP6KgoDkDuAcgBEHoB2ogBEGACGogBEG4BmogBEG4BWogHyAdoCIYIB0gHqAiHCAEQbgHaiIBEOYDIAQgDCkDEDcD0AQgBCAMKQMINwPIBCAEIAwpAwA3A8AEIAQgCykDEDcD6AQgBCALKQMINwPgBCAEIAspAwA3A9gEIAQgCSkDEDcDgAUgBCAJKQMINwP4BCAEIAkpAwA3A/AEIAQgBCkDkAg3A5gFIAQgBCkDiAg3A5AFIAQgBCkDgAg3A4gFIAQgBCkD8AU3A9gDIAQgBCkD6AU3A9ADIAQgBCkD4AU3A8gDIAQgBCkD2AU3A8ADIAQgBCkDkAY3A/gDIAQgBCkDiAY3A/ADIAQgBCkDgAY3A+gDIAQgBCkD+AU3A+ADIAQgBCkDsAY3A5gEIAQgBCkDqAY3A5AEIAQgBCkDoAY3A4gEIAQgBCkDmAY3A4AEIAQgBCkD0AU3A7gEIAQgBCkDyAU3A7AEIAQgBCkDwAU3A6gEIAQgBCkDuAU3A6AEIAQgBCkD8AY3A9gCIAQgBCkD6AY3A9ACIAQgBCkD4AY3A8gCIAQgBCkD2AY3A8ACIAQgBCkDkAc3A/gCIAQgBCkDiAc3A/ACIAQgBCkDgAc3A+gCIAQgBCkD+AY3A+ACIAQgBCkDsAc3A5gDIAQgBCkDqAc3A5ADIAQgBCkDoAc3A4gDIAQgBCkDmAc3A4ADIAQgBCkD0AY3A7gDIAQgBCkDyAY3A7ADIAQgBCkDwAY3A6gDIAQgBCkDuAY3A6ADIARBoAVqIARBwARqIARBwANqIARBwAJqIBxEAAAAAAAA8D8gGKEiFyABEOYDIBggF6IiGEQAAAAAAAAAAKAgHEQAAAAAAADwPyAcoaIiF6AhIiAYIAQrA/gHokQAAAAAAAAAAKAgFyAEKwOwBaKgISMgGCAEKwPwB6JEAAAAAAAAAACgIBcgBCsDqAWioCEkIBggBCsD6AeiRAAAAAAAAAAAoCAXIAQrA6AFoqAhIAsgIkQAAAAAAAAAAGIEQCAjICKjISMgJCAioyEkICAgIqMhIAsgCiAjOQMQIAogJDkDCCAKICA5AwAgIL1C////////////AINC//////////f/AFYgJL1C////////////AINC//////////f/AFZyRSAjvUL///////////8Ag0L/////////9/8AWHENACAKIAQpA5AINwMQIAogBCkDiAg3AwggCiAEKQOACDcDAAsgFkEBaiIWIA9HDQALCyAAQQA2ArwBIABBuAFqEJMBAkAgDSgCvAEgDSgCXEYEQCAAEFogABBYDAELIAAQlAILIAAgAxBUIABBfzYCyAELIAQoAhgiAARAIAAQIgsgDRA6GgsgBEHwCGokAAsfACABBEAgACABKAIAENICIAAgASgCBBDSAiABECILCzoAIAEEQCAAIAEoAgAQ0wIgACABKAIEENMCIAEoAhQiAARAIAEgADYCGCABKAIcGiAAECILIAEQIgsLghMCCn8afCMAQYABayICJAAgASgCBCILBEADQAJAIAEoAgAgCGotAABBAUcNACAAKAK4ASEKIAAoArwBBEAgCiAIQQV0aisDGEQAAAAAAAAAAGMNAQtBACEDIAJBADYCeCACQgA3AnAgAkEANgJoIAJCADcCYEQAAAAAAAAAACEVIAAoAkgiBSAAKAJYIAhBAnRqIgRBeEEEIAhBA3BBAkYbaigCAEEYbGoiCSsDACAFIAQoAgBBGGwiBGoiBSsDACIfoSIOIA4gDqIgCSsDCCAFKwMIIiChIgwgDKKgIAkrAxAgBSsDECIhoSIPIA+ioJ8iE6MiDkQAAAAAAAAAACAOvUL///////////8Ag0KAgICAgICA+P8AVCIFGyEOIAwgE6NEAAAAAAAAAAAgBRshDCAPIBOjRAAAAAAAAAAAIAUbIRMgACgCmAEgBGoiBCsDECEiIAQrAwghIyAEKwMAISRBACEHIAogCEEFdGoiBCsDECIPIAQrAwAiECAQoiAEKwMIIg0gDaKgIA8gD6KgnyIPo0QAAAAAAAAAACAQIA+jIhC9Qv///////////wCDQoCAgICAgID4/wBUIgQbIhohESANIA+jRAAAAAAAAAAAIAQbIhshDyAQRAAAAAAAAAAAIAQbIhwhEEQAAAAAAAAAACEWRAAAAAAAAAAAIRcgCCEEA0BBfkEBIAAoAmggBEECdGooAgAiBEEDb0ECRhsgBGohBCAAKAK4ASEFAkAgACgCvAEEQCAFIARBBXRqKwMYRAAAAAAAAAAAYw0BCyAFIARBBXRqIgMrAwgiEiADKwMAIg0gDaIgEiASoqAgAysDECIdIB2ioJ8iHqNEAAAAAAAAAAAgDSAeoyIUvUL///////////8Ag0KAgICAgICA+P8AVCIFGyESAnxEAAAAAAAAAAAgEyAAKAJIIAAoAlhBeEEEIARBA29BAkYbaiAEQQJ0aigCAEEYbGoiAysDECAhoSINIAMrAwAgH6EiEyAToiADKwMIICChIhggGKKgIA0gDaKgnyIZo0QAAAAAAAAAACATIBmjIg29Qv///////////wCDQoCAgICAgID4/wBUIgMbIhOiIAwgGCAZo0QAAAAAAAAAACADGyIMoiAOIA1EAAAAAAAAAAAgAxsiDqJEAAAAAAAAAACgoKAiDUQAAAAAAADwP2YNABpEGC1EVPshCUAgDUQAAAAAAADwv2UNABogDRBdCyAPIBREAAAAAAAAAAAgBRsiDaIgECASoqEhGSAQIB0gHqNEAAAAAAAAAAAgBRsiEKIgESANoqEhFCARIBKiIA8gEKKhIQ8gAigCZCIGBHwgAigCYCAGQQN0akEIaysDAAUgJQugIRECQCACKAJoIgMgBk0EQCACQeAAaiADQQF0QYABIAMbEEQgAigCYCACKAJkIgZBA3RqIBE5AwAMAQsgAigCYCAGQQN0aiAROQMACyAXIBmgIRcgFiAUoCEWIBUgD6AhFSACIAZBAWo2AmQCQCAEIAhGBEACQCACKAJ0IgYgAigCeCIDTwRAIAJB8ABqIANBAXRBgAEgAxsQRCACKAJwIgcgAigCdCIGQQN0akKY2pCitb/IjMAANwMADAELIAIoAnAiByAGQQN0akKY2pCitb/IjMAANwMACyACIAZBAWoiAzYCdAwBCwJ8RAAAAAAAAAAAIBogEKIgGyASoiAcIA2iRAAAAAAAAAAAoKCgIg9EAAAAAAAA8D9mDQAaRBgtRFT7IQlAIA9EAAAAAAAA8L9lDQAaIA8QXQshEQJAIAIoAnQiBiACKAJ4IgNPBEAgAkHwAGogA0EBdEGAASADGxBEIAIoAnAiByACKAJ0IgZBA3RqIBE5AwAMAQsgAigCcCIHIAZBA3RqIBE5AwALIAIgBkEBaiIDNgJ0ICIgGyANoiAcIBKioaIgIyAcIBCiIBogDaKhoiAkIBogEqIgGyAQoqGiRAAAAAAAAAAAoKCgRAAAAAAAAAAAY0UNACAHIANBA3RqQQhrIgVEGC1EVPshGUAgBSsDAKE5AwALIBAhESASIQ8gDSEQCyABKAIAIgYgBGotAABBAUcNAAsCQCADQQFGDQAgFSAVoiAWIBaioCAXIBeioCIORAAAAAAAAAAAYQ0AIAcgA0EDdGpBCGsrAwAgAigCYCIJIAIoAmRBA3RqQQhrKwMAoyERRAAAAAAAAAAAIRAgBCAIRgRAQQAhBEQAAAAAAAAAACEMIAMEQANAIAwgByAEQQN0IgVqKwMAIBEgBSAJaisDAKKhIgxEGC1EVPshGUCgIAxEGC1EVPshGcCgIAwgDEQYLURU+yEJQGQbIAxEGC1EVPshCcBjG6AhDCAEQQFqIgQgA0cNAAsLIAwgA7ijIRALIBcgDp8iDqMhEiAWIA6jIQ0gFSAOoyEPQQAhByAIIQkDQCAIQX5BASAAKAJoIAlBAnRqKAIAIgNBA29BAkYbIANqIglHBEAgBiAJai0AAA0CCwJAIAAoArwBBEAgACgCuAEgCUEFdGorAxhEAAAAAAAAAABjDQELIAIoAmAiBSAHQQN0IgRqIgogESAKKwMAoiIUOQMAAkAgCgJ8IBQgBwR8IApBCGsrAwAFRAAAAAAAAAAACyIMoUQYLURU+yEJQGQEQCAMRBgtRFT7IQlAoAwBCyAHQQFqIgMgAigCZE8NASARIAUgA0EDdGorAwCiIg4gFKFEGC1EVPshCUBkRQ0BIA5EGC1EVPshCcCgCyIUOQMACyACKAJwIARqKwMAIAlBBXQiAyAAKAK4AWoiBCsDACEMIAQrAwghDiACIAQrAxA5A1ggAiAOOQNQIAIgDDkDSCAUoSAQoUQAAAAAAADgP6IiDhCoASEMIAIgDhCXATkDQCACIBIgDKI5AzggAiANIAyiOQMwIAIgDyAMojkDKCACQRBqIAJBKGogAkHIAGoQ5QEgAkECNgIMIAJCgICAgBA3AgQgACgCuAEgA2oiBUEIaiEEQQAhBgNAIAJBEGpBCEEQIAJBBGogBmooAgAiCkEBRhtBACAKG2orAwAhDiAFIQMCQAJAAkAgCg4CAgABCyAEIQMMAQsgBUEQQRggCkECRhtqIQMLIAMgDjkDACAGQQRqIgZBDEcNAAsgB0EBaiEHIAEoAgAhBgsgBiAJai0AAEEBRw0ACwsgAigCYCIDBEAgAxAiCyACKAJwIgNFDQAgAxAiCyAIQQFqIgggC0cNAAsLIAJBgAFqJAALHwAgAQRAIAAgASgCABDVAiAAIAEoAgQQ1QIgARAiCwuiAwEJfyAAKAK8AQRAIAAoArgBIAFBBXRqKwMYRAAAAAAAAAAAYw8LAkAgACgC2AEiBCABQQNtIglBBHRqIgIoAgAiBSAEIAAoAmgiACABQQJ0aigCACIGQQNtIgpBBHRqIgMoAgBHDQAgAigCDCIHIAMoAgxHDQAgAigCCCICIAMoAghHDQACQCAFIAQgAEF+QQEgASAJQQNsa0ECRhsgAWoiA0ECdCIJaigCAEEDbUEEdGoiASgCAEcNACAHIAEoAgxHDQAgAiABKAIIRg0BCwJAIAUgBCAAQXhBBCADQQNvQQJGG2ogCWooAgBBA21BBHRqIgEoAgBHDQAgByABKAIMRw0AIAIgASgCCEYNAQsCQCAFIAQgAEF+QQEgBiAKQQNsa0ECRhsgBmoiBkECdCIDaigCAEEDbUEEdGoiASgCAEcNACAHIAEoAgxHDQAgAiABKAIIRg0BCyAEIABBeEEEIAZBA29BAkYbaiADaigCAEEDbUEEdGoiACgCACAFRwRAQQEPC0EBIQggByAAKAIMRw0AIAIgACgCCEchCAsgCAvgBQIDfwl8IwBB0ABrIgQkACABKAJ4IAJBAnRqKAIAIQUgAEIANwMQIABCADcDCCAAQgA3AwAgBEECNgIQIARCgICAgBA3AgggASgCiAEgBSABKAJAbEEDdGogA0EDdGohBkEAIQMDQCAAQQhBECAEQQhqIANqKAIAIgVBAUYbQQAgBRtqIAYgBUEDdGorAwA5AwAgA0EEaiIDQQxHDQALIAJBA20hAgJAIAEoAtABIgNFDQAgASgC2AEgAkEEdGooAgAhAiABQdABaiIFIQEDQCABIAMgAygCECACSCIGGyEBIANBBEEAIAYbaigCACIDDQALIAEgBUYNACACIAEoAhBIDQAgAS0AgQENACMAQZABayICJAAgASsDICEHIAErAzghCCABKwNQIQkgASsDKCEKIAErA0AhCyABKwNYIQwgASsDMCENIAErA0ghDiACIAErA2A5A4gBIAIgDjkDgAEgAiANOQN4IAIgDDkDcCACIAs5A2ggAiAKOQNgIAIgCTkDWCACIAg5A1AgAiAHOQNIIAIgAkHIAGoQkAEgAisDACEIIAIrAwghCSACKwMQIQogAisDGCELIAIrAyAhDCACKwMoIQ0gAisDMCEOIAIrAzghDyAERAAAAAAAAPC/RAAAAAAAAPA/IAEtAIABGyIHIAIrA0CiOQNIIAQgByAPojkDQCAEIAcgDqI5AzggBCAHIA2iOQMwIAQgByAMojkDKCAEIAcgC6I5AyAgBCAHIAqiOQMYIAQgByAJojkDECAEIAcgCKI5AwggAkGQAWokACAEKwM4IQogBCsDCCELIAQrAyAhDCAEKwNAIQ0gBCsDECEOIAQrAyghDyAAIAArAwAiByAEKwMYoiAAKwMIIgggBCsDMKKgIAArAxAiCSAEKwNIoqA5AxAgACAHIA6iIAggD6KgIAkgDaKgOQMIIAAgByALoiAIIAyioCAJIAqioDkDAAsgBEHQAGokAAuZAQIBfgN/AkAgACgCBCAAKAIIQQFrIgQgAUIeiCABhUK5y5Pn0e2RrL9/fiICQhuIIAKFQuujxJmxt5LolH9+IgJCH4ggAoWncSIDQQN0aikDACICIAFRIAJCf1FyDQAgACgCACEFA0AgACgCBCAEIAMgBWpxIgNBA3RqKQMAIgIgAVENASACQn9SDQALCyAAKAIMIANBKGxqC+ACAQd/IwBBIGsiCCQAAkAgACgCCCICIAAoAgxHDQAgACgCBCIEIAAoAgAiA0sEQCACIARrIQYgBCAEIANrQQJ1QQFqQX5tQQJ0IgNqIQcgACACIARHBH8gBgRAIAcgBCAG/AoAAAsgACgCBAUgBAsgA2o2AgQgBiAHaiECDAELIAhBDGpBASACIANrQQF1IAIgA0YbIgMgA0ECdiAAEEoiBSgCCCECIAAoAggiBiAAKAIEIgdHBEAgAiAGIAdraiEDIAchBANAIAIgBCgCADYCACAEQQRqIQQgAkEEaiICIANHDQALIAMhAgsgACgCACEDIAAgBSgCADYCACAFIAM2AgAgACAFKAIENgIEIAUgBzYCBCAAIAI2AgggBSAGNgIIIAAoAgwhAyAAIAUoAgw2AgwgBSADNgIMIAUQUyAAKAIIIQILIAIgASgCADYCACAAIAJBBGo2AgggCEEgaiQAC44DAQV/IwBBIGsiBiQAAkACQCAAKAIEIgMgACgCCCICSQRAIAEoAgAhAiABQQA2AgAgAyACNgIAIANBBGohAQwBCyADIAAoAgAiBGtBAnUiBUEBaiIDQYCAgIAETw0BIAZBDGpB/////wMgAiAEayICQQF1IgQgAyADIARJGyACQfz///8HTxsgBSAAEEoiAygCCCECIAEoAgAhBCABQQA2AgAgAiAENgIAIAMgAkEEajYCCCADKAIEIAAoAgQgACgCACICayIBayEEIAEEQCAEIAIgAfwKAAALIAAoAgAhAiAAIAQ2AgAgAyACNgIEIAAgAygCCCIBNgIEIAMgAjYCCCAAKAIIIQQgACADKAIMNgIIIAMgAjYCACADIAQ2AgwgAygCBCIFIAMoAggiAkcEQANAIAMgAkEEayICNgIIIAIoAgAhBCACQQA2AgAgBARAIAQQdSADKAIIIQILIAIgBUcNAAsLIAMoAgAiAgRAIAMoAgwaIAIQIgsLIAAgATYCBCAGQSBqJAAPCxAmAAtlAQR/IAAoAgQiBCAAKAIIIgFHBEADQCAAIAFByABrIgI2AgggAUEEayIBKAIAIQMgAUEANgIAIAMEfyADEHUgACgCCAUgAgsiASAERw0ACwsgACgCACICBEAgACgCDBogAhAiCwtvAQJ/IAAgAUcEQCAAIQMDQCACIANBwQD8CgAAIAMoAkQhBCADQQA2AkQgAiAENgJEIAJByABqIQIgA0HIAGoiAyABRw0ACwNAIAAoAkQhAiAAQQA2AkQgAgRAIAIQdQsgAEHIAGoiACABRw0ACwsLYgAgACADNgIQQQAhAyAAQQA2AgwCQCABBEAgAUHk8bgcTw0BIAFByABsECMhAwsgACADNgIAIAAgAyACQcgAbGoiAjYCCCAAIAMgAUHIAGxqNgIMIAAgAjYCBCAADwsQcgALGwAgAARAIAAoAgAQ3gIgACgCBBDeAiAAECILCxsAIAAEQCAAKAIAEN8CIAAoAgQQ3wIgABAiCwvWEAIbfAx/IwBB8BZrIh4kACAeIAE2AmwgAEE8aiEkIAEoAhAiHyAAQUBrIiFHBEAgJCAfEIsEIAEgITYCEAsCQCABKAI8Ih8rAxgiECABKwMYIgOhIgQgBKIgHysDICIRIAErAyAiBqEiBSAFoqAiCkQAAAAAAAAQQKIgACsDmAEiCCAIomMEQCABQoCAgICAgIB4NwMIIAEgJCAeQewAahCGBDYCEAwBCwJAAkAgAyABKAI4IiIrAxgiCaEiCyARICIrAyAiB6EiDKIgECAJoSIPIAYgB6EiDqKhIg1EAAAAAAAAAABkRQRAIA0gDaJEAAAAAAAAEECiIAggCKAiDSANIA8gD6IgDCAMoqAiDCALIAuiIA4gDqKgIgsgCyAMYxuiomVFDQELICIrAyggASsDKKJEAAAAAAAAAACgICIrAzAgASsDMKKgRAAAAAAAAPC/oCAIoSELIAUgCSADoSIFoiAEIAcgBqEiBKKhIgwgDKJEAAAAAAAAEECiIAggCCAKIAUgBaIgBCAEoqAiBCAEIApjG6KiZQ0BRAAAAAAAABBAIAkgEKEiBCAEoiAHIBGhIgUgBaKgIgqjIRggBSAKnyIFoyEZIAQgBaMhGiAIIAYgESAHoEQAAAAAAADgP6IiFSAFRAAAAAAAAOA/oiIHoCIEIBUgB6EiBSAEIAVkIgAbIgogBiAKZBugIQ0gCCADIBAgCaBEAAAAAAAA4D+iIhYgB6AiCSAWIAehIgcgByAJYyIhGyIKIAMgCmQboCESIAUgBCAAGyIEIAYgBCAGYxsgCKEhEyAHIAkgIRsiBiADIAMgBmQbIAihIRQgAigCACEAIB8oAgAhJSAiKAIAISYgAigCBCIfQQhNBEAgH0UNAiAAIB9BGGxqISEgCJohBiABKAIAISAgAigCECEjA0ACQCAAKwMAIgMgFGZFDQAgACsDCCIJIBNmRSADIBJlRXIgCSANZUVyDQAgIyAAKAIQQQJ0aigCACICKAI8KAI4IAJHDQAgAigCACIfICBGIB8gJkZyIB8gJUZyDQAgHiABKQMwNwMgIB4gASkDKDcDGCABIAIgHkEYaiAIELsBIQMgHiAiKQMwNwMQIB4gIikDKDcDCCAGIBogAisDICIJIBGhoiAZIAIrAxgiByAQoaKhIgQgASACIB5BCGogCBC7ASIFIAMgAyAFZBsiAyADIARkGyIDZARAIAYgGCAHIBahIgMgA6IgCSAVoSIDIAOioKKhIQMLIAMgC2RFDQAgAyELCyAAQRhqIgAgIUcNAAsMAgtBACEhA0AgHkHwBmogIWoiIEKAgICAgICAeDcDGCAgQoCAgICAgIB4NwMQICBCgICAgICAgPj/ADcDCCAgQoCAgICAgID4/wA3AwAgIUEgaiIhQYAQRw0AC0EAISEgHkHwAmpBAEGABPwLACAImiEXIAEoAgAhJyACKAIQIShEAAAAAAAA8H8hBEQAAAAAAADw/yEKRAAAAAAAAPD/IQxEAAAAAAAA8H8hBQNAIB9BCE0EQCAfBEAgACAfQRhsaiEgA0ACQCAAKwMAIgMgFGZFDQAgACsDCCIGIBNmRSADIBJlRXIgBiANZUVyDQAgKCAAKAIQQQJ0aigCACICKAI8KAI4IAJHDQAgAigCACIfICdGIB8gJkZyIB8gJUZyDQAgHiABKQMwNwNAIB4gASkDKDcDOCABIAIgHkE4aiAIELsBIQMgHiAiKQMwNwMwIB4gIikDKDcDKCAXIBogAisDICIGIBGhoiAZIAIrAxgiCSAQoaKhIgcgASACIB5BKGogCBC7ASIEIAMgAyAEZBsiAyADIAdkGyIDZARAIBcgGCAJIBahIgMgA6IgBiAVoSIDIAOioKKhIQMLIAMgC2RFDQAgAyELCyAAQRhqIgAgIEcNAAsLICFBAEwNAyAeQfAGaiAhQQFrIiFBBXRqIgArAxghBSAAKwMQIQQgACsDCCEMIAArAwAhCiAeQfACaiAhQQN0aiIAKAIEIR8gACgCACEAIB5B8ABqICFBAnRqKAIAISMMAQUgACAfQQF2IgJBGGxqIiArAwghAyAgKwMAIg4hDyAMIQYgDiEJIAUhByAjQQFxBEAgCiEPIAQhCSADIQcgAyEGCwJAIA4gFGZFIAMgE2ZFciAOIBJlRSADIA1lRXJyDQAgKCAgKAIQQQJ0aigCACIgKAI8KAI4ICBHDQAgICgCACIpICdGICYgKUZyICUgKUZyDQAgHiABKQMwNwNgIB4gASkDKDcDWCABICAgHkHYAGogCBC7ASEDIB4gIikDMDcDUCAeICIpAyg3A0ggFyAaICArAyAiDiARoaIgGSAgKwMYIhsgEKGioSIcIAEgICAeQcgAaiAIELsBIh0gAyADIB1kGyIDIAMgHGQbIgNkBEAgFyAYIBsgFqEiAyADoiAOIBWhIgMgA6KgoqEhAwsgAyALZEUNACADIQsLAkACQCAKIBJlRSAMIA1lRXIgCSAUZkUgByATZkVyckUEQCAPIBJlRSAGIA1lRXIgBCAUZkUgBSATZkVycg0BIB5B8AZqICFBBXRqIiAgBTkDGCAgIAQ5AxAgICAGOQMIICAgDzkDACAeQfACaiAhQQN0aiIgIB8gAkEBaiIfazYCBCAeQfAAaiAhQQJ0aiAjQQFqNgIAICAgACAfQRhsajYCACAhQQFqISEMAQsgHyACQQFqIgJrIR8gACACQRhsaiEAIA8hCiAGIQwMAQsgAiEfIAkhBCAHIQULICNBAWohIwwBCwALAAsgAUKAgICAgICA+D83AwgMAQsgASALOQMIIAEgJCAeQewAahCGBDYCEAsgHkHwFmokAAtKAQd/QQQQIyIDIAI2AgBBBBAjIgQgAjYCAEGA8AEgAUGQ6wEiAUEAIQJBsyVBASEFQb8BIAMgASACQbclaiAFQb8BaiAEEAogAAtKAQd/QQQQIyIDIAI2AgBBBBAjIgQgAjYCAEH47wEgAUG86gEiAUEAIQJBkCVBASEFQb0BIAMgASACQZQlaiAFQb0BaiAEEAogAAujAwEIfyMAQRBrIggkAAJAIAVFDQADQAJAIAUgB0wgBCAHTHJFBEAgBEUNAyADKAIAIgogASgCACILQQR0aiIMKAIEIQkDQAJAIAogACgCACINQQR0aiIOKAIEIg8gCUYEQCAMKAIAIA4oAgBODQEMBAsgCSAPSA0DCyAAQQRqIQAgBEEBayIEDQALDAMLIAAgASACIAMgBCAFIAYQpwQMAgsCQCAEIAVIBEAgACABIAEgBUECbSIJQQJ0aiIMIAMQpgQiDSAAa0ECdSELDAELIARBAUYEQCAAIAs2AgAgASANNgIADAMLIAggCjYCCCAIIAMoAgQ2AgwgCEEAOgAAIAEgACAEQQJtIgtBAnRqIg0gAiABa0ECdSAIQQhqEKUEIgwgAWtBAnUhCQsgCCANIAEgDBCkBCAIKAIAIQoCfyAJIAtqIAQgC2siBCAFIAlrIgVqSARAIAAgDSAKIAMgCyAJIAYgBxDjAiAKIQAgDAwBCyAKIAwgAiADIAQgBSAGIAcQ4wIgCSEFIAshBCAKIQIgDQshASAFDQALCyAIQRBqJAALXwEBfyMAQRBrIgIkACACQQhqIAFBABArECogACACKAIIQTD8CgAAAkAgAigCDCIARQ0AIAAgACgCBCIBQQFrNgIEIAENACAAIAAoAgAoAggRAAAgABAkCyACQRBqJAALoAIBBX8jAEEgayIFJAACQAJAIAAoAgQiAiAAKAIIIgNJBEAgAiABKgIAOAIAIAJBBGohAQwBCyACIAAoAgAiBGtBAnUiBkEBaiICQYCAgIAETw0BIAVBDGpB/////wMgAyAEayIDQQF1IgQgAiACIARJGyADQfz///8HTxsgBiAAEEoiAigCCCIDIAEqAgA4AgAgAiADQQRqNgIIIAIoAgQgACgCBCAAKAIAIgNrIgFrIQQgAQRAIAQgAyAB/AoAAAsgACgCACEDIAAgBDYCACACIAM2AgQgACACKAIIIgE2AgQgAiADNgIIIAAoAgghBCAAIAIoAgw2AgggAiADNgIAIAIgBDYCDCACEFMLIAAgATYCBCAFQSBqJAAPCxAmAAtFAQF/IwBBEGsiAiQAIAIgASgCADYCCCACIAEoAgQ2AgwgAUIANwIAIAIgAikCCDcDACAAIAIQSBogARAvGiACQRBqJAALSAECfyAAEKMDIgMQ9QEgACgCACECIAAgASgCADYCACABIAI2AgAgACgCBCECIAAgASgCBDYCBCABIAI2AgQgAxD1ASABEC8aC6MDAQh/IwBBEGsiCCQAAkAgBUUNAANAAkAgBSAHTCAEIAdMckUEQCAERQ0DIAMoAgAiCiABKAIAIgtBBHRqIgwoAgQhCQNAAkAgCiAAKAIAIg1BBHRqIg4oAgQiDyAJRgRAIAwoAgAgDigCAE4NAQwECyAJIA9IDQMLIABBBGohACAEQQFrIgQNAAsMAwsgACABIAIgAyAEIAUgBhCnBAwCCwJAIAQgBUgEQCAAIAEgASAFQQJtIglBAnRqIgwgAxCmBCINIABrQQJ1IQsMAQsgBEEBRgRAIAAgCzYCACABIA02AgAMAwsgCCAKNgIIIAggAygCBDYCDCAIQQA6AAAgASAAIARBAm0iC0ECdGoiDSACIAFrQQJ1IAhBCGoQpQQiDCABa0ECdSEJCyAIIA0gASAMEKQEIAgoAgAhCgJ/IAkgC2ogBCALayIEIAUgCWsiBWpIBEAgACANIAogAyALIAkgBiAHEOgCIAohACAMDAELIAogDCACIAMgBCAFIAYgBxDoAiAJIQUgCyEEIAohAiANCyEBIAUNAAsLIAhBEGokAAvmBAEIfwJAAkACQCAEKAIAKAIAIgYgASgCACIEQQxsaiIIKAIAIgUgBiAAKAIAIgdBDGxqIgkoAgAiCkgNACAFIApGBEAgCCgCBCAJKAIESA0BCyAFIAYgAigCACIHQQxsaiIJKAIAIgpMBEAgBSAKRw0CIAkoAgQgCCgCBE4NAgsgASAHNgIAIAIgBDYCACAGIAEoAgAiB0EMbGoiBSgCACIIIAYgACgCACIJQQxsaiIKKAIAIgtOBEAgCCALRw0DIAUoAgQgCigCBE4NAwsgACAHNgIAIAEgCTYCACACKAIAIQQMAgsCQAJAIAUgBiACKAIAIgpBDGxqIgsoAgAiDEwEQCAFIAxHDQEgCygCBCAIKAIETg0BCyAAIAo2AgAMAQsgACAENgIAIAEgBzYCACAGIAIoAgAiBEEMbGoiBSgCACIIIAkoAgAiCk4EQCAIIApHDQMgBSgCBCAJKAIETg0DCyABIAQ2AgALIAIgBzYCACAHIQQMAQsgByEECwJAIAYgAygCACIHQQxsaiIFKAIAIgggBiAEQQxsaiIJKAIAIgpOBEAgCCAKRw0BIAUoAgQgCSgCBE4NAQsgAiAHNgIAIAMgBDYCACAGIAIoAgAiA0EMbGoiBCgCACIHIAYgASgCACIFQQxsaiIIKAIAIglOBEAgByAJRw0BIAQoAgQgCCgCBE4NAQsgASADNgIAIAIgBTYCACAGIAEoAgAiAkEMbGoiAygCACIEIAYgACgCACIHQQxsaiIGKAIAIgVOBEAgBCAFRw0BIAMoAgQgBigCBE4NAQsgACACNgIAIAEgBzYCAAsLlAcCCH8BfiMAQRBrIg8kAAJAIAVFDQADQAJAAkAgBSAHTCAEIAdMckUEQCAERQ0EIAMoAgAoAgAiDSABKAIAIghBA3RqKQMAIRADQCAQIA0gACgCACIJQQN0aikDAFQNAiAAQQRqIQAgBEEBayIEDQALDAQLIAQgBUoNASAAIAFGDQMgBiEEIAAhBQNAIAQgBSgCADYCACAEQQRqIQQgBUEEaiIFIAFHDQALIAMoAgAhBQNAIAEgAkYEQCAEIAZrIgFFDQUgACAGIAH8CgAADAULIAAgASgCACIDIAYoAgAiByAFKAIAIgggA0EDdGopAwAgCCAHQQN0aikDAFQiAxs2AgAgAUEEQQAgAxtqIQEgAEEEaiEAIAZBAEEEIAMbaiIGIARHDQALDAMLAkAgBCAFSARAIAEgBUECbSILQQJ0aiEIAkAgACABRgRAIAAhCQwBCyABIABrQQJ1IQogDSAIKAIAQQN0aikDACEQIAAhCQNAIAkgCSAKQQF2IgxBAnRqIglBBGogECANIAkoAgBBA3RqKQMAVCIOGyEJIAwgCiAMQX9zaiAOGyIKDQALCyAJIABrQQJ1IQwMAQsgBEEBRgRAIAAgCDYCACABIAk2AgAMBAsgACAEQQJtIgxBAnRqIQkCQCABIAJGBEAgASEIDAELIAIgAWtBAnUhCiANIAkoAgBBA3RqKQMAIRAgASEIA0AgCCAKQQF2IgtBAnRqIg5BBGogCCANIA4oAgBBA3RqKQMAIBBUIg4bIQggCiALQX9zaiALIA4bIgoNAAsLIAggAWtBAnUhCwsgD0EIaiAJIAEgCBCRASAPKAIIIQoCfyALIAxqIAUgC2siBSAEIAxrIgRqSARAIAAgCSAKIAMgDCALIAYgBxDqAiAKIQAgCAwBCyAKIAggAiADIAQgBSAGIAcQ6gIgCyEFIAwhBCAKIQIgCQshASAFDQEMAgsLIAEgAkYNACAGIQQgASEFA0AgBCAFKAIANgIAIARBBGohBCAFQQRqIgUgAkcNAAsgAygCACEFA0AgACABRgRAA0AgAkEEayICIARBBGsiBCgCADYCACAEIAZHDQAMAwsACyACQQRrIgIgAUEEayIHKAIAIgMgBEEEayIIKAIAIgkgBSgCACIKIAlBA3RqKQMAIAogA0EDdGopAwBUIgMbNgIAIAcgASADGyEBIAQgCCADGyIEIAZHDQALCyAPQRBqJAAL3QoCDH8BfCMAQRBrIgokAAJAIARFDQADQAJAAkAgBCAGTCADIAZMckUEQCADRQ0EIAErAwAhEwNAIBMgACsDAGQNAiAAQRBqIQAgA0EBayIDDQALDAQLIAMgBEoNASAAIAFGDQMgBSEHIAAhCANAIAcgCCkDCDcDCCAHIAgpAwA3AwAgB0EQaiEHIAhBEGoiCCABRw0ACwNAIAEgAkYEQCAHIAVrIgFFDQUgACAFIAH8CgAADAULAkAgASsDACAFKwMAZARAIAAgASkDCDcDCCAAIAEpAwA3AwAgAUEQaiEBDAELIAAgBSkDCDcDCCAAIAUpAwA3AwAgBUEQaiEFCyAAQRBqIQAgBSAHRw0ACwwDCwJAIAMgBEgEQCABIARBAm0iDUEEdGohCwJAIAAgAUYEQCAAIQkMAQsgASAAa0EEdSEHIAsrAwAhEyAAIQkDQCAJIAkgB0EBdiIMQQR0aiIJQRBqIBMgCSsDAGQiCBshCSAMIAcgDEF/c2ogCBsiBw0ACwsgCSAAa0EEdSEODAELIANBAUYEQCAKIAApAwg3AwggCiAAKQMANwMAIAAgASkDCDcDCCAAIAEpAwA3AwAgASAKKQMINwMIIAEgCikDADcDAAwECyAAIANBAm0iDkEEdGohCQJAIAEgAkYEQCABIQsMAQsgAiABa0EEdSEHIAkrAwAhEyABIQsDQCALIAdBAXYiDEEEdGoiCEEQaiALIAgrAwAgE2QiCBshCyAHIAxBf3NqIAwgCBsiBw0ACwsgCyABa0EEdSENCyAEIA1rIQQgAyAOayEDIAshBwJAIAEgCUYNACAJIQcgASALRg0AIAEgB0EQaiIIRgRAIAogBykDCDcDCCAKIAcpAwA3AwAgCyABayIBBEAgByAIIAH8CgAACyABIAlqIgcgCikDCDcDCCAHIAopAwA3AwAMAQsgCyABQRBqRgRAIAogC0EQayIIKQMINwMIIAogCCkDADcDACALIAggCWsiAWshByABRSAIIAlGckUEQCAHIAkgAfwKAAALIAkgCikDCDcDCCAJIAopAwA3AwAMAQsgASEIIAEgCWsiEEEEdSIPIQwCQCALIAFrIhJBBHUiESAPRgRAA0AgCiAHKQMINwMIIAogBykDADcDACAHIAgpAwg3AwggByAIKQMANwMAIAggCikDCDcDCCAIIAopAwA3AwAgB0EQaiIHIAFGDQIgCEEQaiIIIAtHDQAMAgsACwNAIAwgESIMbyIRDQALIAkgDEEEdGohDANAIAogDEEQayIMKQMINwMIIAogDCkDADcDACAMIBBqIQggDCEHA0AgByIBIAgiBykDCDcDCCABIAcpAwA3AwAgByAQaiAJIA8gCyAHa0EEdSIBa0EEdGogASAPShsiCCAMRw0ACyAHIAopAwg3AwggByAKKQMANwMAIAkgDEcNAAsgCSASaiEHDAELIAEhBwsCfyANIA5qIAMgBGpIBEAgACAJIAcgDiANIAUgBhDrAiAHIQAgCwwBCyAHIAsgAiADIAQgBSAGEOsCIA0hBCAOIQMgByECIAkLIQEgBA0BDAILCyABIAJGDQAgBSEHIAEhCANAIAcgCCkDCDcDCCAHIAgpAwA3AwAgB0EQaiEHIAhBEGoiCCACRw0ACwNAIAAgAUcEQCACQRBrIgIgAUEQayIJIAdBEGsiBiAGKwMAIAkrAwBkIgQbIgMpAwg3AwggAiADKQMANwMAIAkgASAEGyEBIAUgByAGIAQbIgdHDQEMAgsLA0AgAkEQayICIAdBEGsiBykDCDcDCCACIAcpAwA3AwAgBSAHRw0ACwsgCkEQaiQAC3MBBH8gACgCBCICIAFBAXRLIAJBEEtxAkAgASACTQ0AIAAgARBEIAEgACgCBCIDayICQQBMDQAgACgCACADQQN0aiEDA0AgA0J/NwMAIANBCGohAyACQQFLIAJBAWshAg0ACwsgACABNgIEBEAgABCUAQsLmgEBAX8gACABRwRAAkAgACgCDCICRQ0AIAIgAigCACICQQFrNgIAIAJBAUoNACAAKAIMIgIEQCACECILIABBADYCDCAAKAIAIgIEQCACECILIABBADYCCCAAQgA3AgALIAEoAgwiAiACKAIAQQFqNgIAIAAgASgCDDYCDCAAIAEoAgA2AgAgACABKAIENgIEIAAgASgCCDYCCAsLcgEDfyAAKALUAUUEQEEADwsgACgCzAEiASAAQdABaiICRgRAQQEPCwNAIAEtAIEBIgNBAUYEQAJAIAEoAgQiAARAA0AgACIBKAIAIgANAAwCCwALA0AgASABKAIIIgEoAgBHDQALCyABIAJHDQELCyADCykAIABBADYCBCAAEC0gAEEANgIUIABBEGoQLSAAQQA2AiQgAEEgahAtC8UCAQN/IAAoAgggACgCACIEa0EMbSADTwRAIAAoAgQiBSAEayIGQQxtIANJBEAgASAGaiEDIAQgBUcEQCAGBEAgBCABIAb8CgAACyAAKAIEIQULIAUhASACIANHBEADQCABIAMoAgg2AgggASADKQIANwIAIAFBDGohASADQQxqIgMgAkcNAAsLIAAgBSABIAVrajYCBA8LIAIgAWsiA0UgASACRnJFBEAgBCABIAP8CgAACyAAIAMgBGo2AgQPCyAAEEUgA0HWqtWqAUkEQCAAQdWq1aoBIAAoAgggACgCAGtBDG0iBUEBdCIEIAMgAyAESRsgBUGq1arVAE8bEKMCIAAoAgQhAyABIAJHBEADQCADIAEoAgg2AgggAyABKQIANwIAIANBDGohAyABQQxqIgEgAkcNAAsLIAAgAzYCBA8LECYAC9gCAQN/IAAoAgggACgCACIEa0EYbSADTwRAIAAoAgQiBSAEayIGQRhtIANJBEAgASAGaiEDIAQgBUcEQCAGBEAgBCABIAb8CgAACyAAKAIEIQULIAUhASACIANHBEADQCABIAMpAxA3AxAgASADKQMINwMIIAEgAykDADcDACABQRhqIQEgA0EYaiIDIAJHDQALCyAAIAUgASAFa2o2AgQPCyACIAFrIgNFIAEgAkZyRQRAIAQgASAD/AoAAAsgACADIARqNgIEDwsgABBFIANBq9Wq1QBJBEAgAEGq1arVACAAKAIIIAAoAgBrQRhtIgVBAXQiBCADIAMgBEkbIAVB1arVKk8bEPIBIAAoAgQhAyABIAJHBEADQCADIAEpAxA3AxAgAyABKQMINwMIIAMgASkDADcDACADQRhqIQMgAUEYaiIBIAJHDQALCyAAIAM2AgQPCxAmAAsfACABBEAgACABKAIAEPICIAAgASgCBBDyAiABECILC2EBAn8CQCABKAIEIgNFBEAgASECA0AgAiACKAIIIgIoAgBHDQALDAELA0AgAyICKAIAIgMNAAsLIAEgACgCAEYEQCAAIAI2AgALIAAgACgCCEEBazYCCCAAKAIEIAEQxAQL1AMBCn8jAEEgayIEJAAgBEIANwIYIAQgBEEYaiIKNgIUIAEgAkcEQCABIQUDQCAEIAUoAgA2AgggBCAFIAFrQQR1NgIMQRgQIyIIIAQoAggiDTYCECAIIAQoAgw2AhQCQCAEQRRqIgsoAgQiCUUEQCALQQRqIgYhBwwBCwNAIAkiBigCECANSgRAIAYhByAGKAIAIgkNAQwCCyAGKAIEIgkNAAsgBkEEaiEHCyALIAYgByAIEIIBIAVBEGoiBSACRw0ACwsgAEEANgIIIABCADcCAEEAIQUDQAJAIAUgDEYEQCAEKAIcRQ0BIAQoAhQoAhQhDCAEQQA2AhAgBEIANwIIIAAgBEEIahBoIAQoAggiAgRAIAQgAjYCDCAEKAIQGiACECILIAwhBQsgACgCBCAEIAMgBWo2AghBDGsgBEEIahA9AkACQCAEKAIYIgZFDQAgASAFQQR0aigCBCEHIAohAgNAIAIiBSAGIgkgBigCECAHSCIIGyECIAZBBEEAIAgbaigCACIGDQALIAIgCkYNACAHIAUgCSAIGygCEE4NAQsgCiECCyACKAIUIQUgBEEUaiACEPMCIAIQIgwBCwsgBEEUaiAEKAIYEPICIARBIGokAAvpBQEJfyMAQTBrIgMgATYCJCADQX5BASABQQNvQQJGGyABaiIENgIoIANBfkEBIARBA29BAkYbIARqIgk2AiwgAyAAKAJoIgUgAUECdGooAgAiATYCGCADIAFBfkEBIAFBA29BAkYbaiICNgIcIANBfkEBIAJBA29BAkYbIAJqIgc2AiACQCAFIARBAnRqKAIAIghBf0YNACAAKAJYIgYgCUECdCIBaigCACAGIAdBAnRqKAIARw0AIAEgBWooAgAhAQJAIAcgCEYEQCABIAJGBEAgA0ECNgIUIANCgICAgBA3AgwgACgCSCEKQQAhAQNAIAogBiADQSRqQQRBCCADQQxqIAFqKAIAIgRBAUYbQQAgBBtqKAIAQQJ0aigCAEEYbGoiBEKAgICAgICA/P8ANwMQIARCgICAgICAgPz/ADcDCCAEQoCAgICAgID8/wA3AwAgAUEEaiIBQQxHDQALDAILIAAoAkggBiAEQQJ0aigCAEEYbGoiAUKAgICAgICA/P8ANwMQIAFCgICAgICAgPz/ADcDCCABQoCAgICAgID8/wA3AwAMAQsgASACRw0AIAAoAkggBiACQQJ0aigCAEEYbGoiAUKAgICAgICA/P8ANwMQIAFCgICAgICAgPz/ADcDCCABQoCAgICAgID8/wA3AwALIAUgCEECdGogBSAHQQJ0aigCACIBNgIAIAUgAUECdGogCDYCACAFIAUgCUECdGooAgAiAUECdGogBSACQQJ0aigCACICNgIAIAUgAkECdGogATYCACADQQI2AhQgA0KAgICAEDcCDCAAKAJ4IQBBACEBA0AgBkEEQQggA0EMaiABaigCACICQQFGG0EAIAIbIgQgA0EkamooAgBBAnQiAmpBfzYCACACIAVqQX82AgAgACACakF/NgIAIAYgA0EYaiAEaigCAEECdCICakF/NgIAIAIgBWpBfzYCACAAIAJqQX82AgAgAUEEaiIBQQxHDQALCws6ACAAKAJcBEAgAEHYAGoQOCAAQegAahA4IABB+ABqEDggABDtASAAQQAQzwQgAEEAEM4EIAAQlAILC/8PAhh/GHwjAEEgayIKJAACQCAAKAJoIgsgAUECdCIGaigCACIMQQBIDQAgACsDMCEnIAogATYCFCAKQX5BASABIAFBA20iByIXQQNsa0ECRhsgAWoiDzYCGCAKQX5BASAPQQNvQQJGGyAPaiINNgIcIAogDDYCCCAKQX5BASAMIAxBA24iASIYQQNsa0ECRhsgDGoiCTYCDCAKQX5BASAJQQNvQQJGGyAJaiIQNgIQIAsgCUECdGooAgAiCSAMRiAAKAJIIg4gACgCWCIRIA9BAnRqKAIAIhJBGGxqIgUrAwAiKyAOIAYgEWooAgAiGUEYbGoiBisDACIxoSIdIB2iIAUrAwgiLCAGKwMIIjKhIh0gHaKgIAUrAxAiLSAGKwMQIjOhIh0gHaKgICcgAyADRAAAAAAAAAAAYxsiLiAuoiAnICeiIAQgEkobY3JFBEAgACgCqAEiGiABIgRBGGxqIRMgACgC2AEiFSAHQQR0aiEUIBUgBEEEdGoiASgCACEGIAEoAgghBCABKAIMIQggDiARIBBBAnRqKAIAQRhsaiIBKwMAISMgASsDCCEoIAErAxAhKSAJIQEDQCAOIBFBeEEEQX5BASABQQNvQQJGGyABaiIBIAFBA20iB0EDbGtBAkYbaiABQQJ0IhtqKAIAQRhsaiEBIBUgB0EEdGoiFigCACEFIBogB0EYbGoiBysDCCIemSEDAnwgBysDECIfmSIdIAcrAwAiIpkiKmRFIAMgHWNFckUEQEQAAAAAAAAAACEgRAAAAAAAAAAAISEgHyEdRAAAAAAAAPA/DAELIAMgKmQEQEQAAAAAAADwPyEhRAAAAAAAAAAAISAgHiEdRAAAAAAAAAAADAELRAAAAAAAAPA/ISBEAAAAAAAAAAAhISAiIR1EAAAAAAAAAAALIQMgASsDECEqIAErAwghLyABKwMAITAgA5ogAyAdRAAAAAAAAAAAYyIHGyEdICCaICAgBxshJCAhmiAhIAcbISUCQCAFIAZHIhwgCCAWKAIMIgdHciAEIBYoAggiAUdyRQRAIAYhBSAEIQEgCCEHDAELQQAhCCAFIBQoAgBHDQMgByAUKAIMRw0DIAEgFCgCCEcNAwJAIBwgASAER3INACAiIBMrAwCiRAAAAAAAAAAAoCAeIBMrAwiioCAfIBMrAxCioEQAAAAAAADgv2MNACAGIQUgBCEBDAELIC0gIKIgLCADoiArICGioKAgKSAgoiAoIAOiICMgIaKgoCIioSIeIDMgJaIgMSAdoiAyICSioKAgKSAloiAjIB2iICggJKKgoCImoSIfoiAzICCiIDIgA6IgMSAhoqCgICKhIiIgLSAloiArIB2iICwgJKKgoCAmoSImoqEiNCA0okQAAAAAAAAQQKIgLiAuIB4gHqIgJiAmoqAiHiAiICKiIB8gH6KgIh8gHiAfZBuiomVFDQMLAkAgLSAgoiAsIAOiICsgIaKgoCAqICCiIC8gA6IgMCAhoqCgIiKhIh4gKSAloiAjIB2iICggJKKgoCAqICWiIDAgHaIgLyAkoqCgIiahIh+iICkgIKIgKCADoiAjICGioKAgIqEiAyAtICWiICsgHaIgLCAkoqCgICahIh2ioSIjRAAAAAAAAAAAZA0AICMgI6JEAAAAAAAAEECiICcgJyAeIB6iIB0gHaKgIh0gAyADoiAfIB+ioCIDIAMgHWMboqJlDQBBACEIDAMLIAchCCABIQQgBSEGICohKSAvISggMCEjIAsgG2ooAgAiASAMRw0ACwsgECALIA9BAnRqKAIAIgVHBH8gAigCBCEBA0BBfkEBIAVBA29BAkYbIAVqIQQCQCACKAIIIgUgAU0EQCACIAVBAXRBgAEgBRsQJSACKAIAIAIoAgQiAUECdGogBDYCACAAKAJoIQsMAQsgAigCACABQQJ0aiAENgIACyACIAFBAWoiATYCBCALIARBAnRqKAIAIgUgEEcNAAsgACgCSAUgDgsgGUEYbGoiAUKAgICAgICA/P8ANwMQIAFCgICAgICAgPz/ADcDCCABQoCAgICAgID8/wA3AwAgACAKQQhqEMsEIAkgDUcEQCAJIQQDQEF+QQEgBEEDb0ECRhsgBGohBQJAIAAoAkBFDQACQAJAIAAoAtgBIgYgBUEDbUEEdGoiBCgCACIHIAYgF0EEdGoiCCgCAEcNACAEKAIMIAgoAgxHDQAgDyEBIAQoAgggCCgCCEYNAQsgByAGIBhBBHRqIgYoAgBHDQEgBCgCDCAGKAIMRw0BIAwhASAEKAIIIAYoAghHDQELIAAoAngiBCAFQQJ0aiAEIAFBAnRqKAIANgIACyAFQQNvIQEgBUECdCIGIAAoAmhqKAIAIQQCQCACKAIEIghFDQAgACgCWCIHQXhBBCABQQJGG2ogBmooAgAhCyACKAIAIQ5BACEBA0AgB0F4QQQgDiABQQJ0aigCACIGQQNvQQJGG2ogBkECdGooAgAgC0YEQCAAIAYgBRDMBCACIAFBABAxIAQhCQwCCyABQQFqIgEgCEcNAAsLIAQgDUcNAAsgCSANRwRAIAAoAmghBCAAKAJYIQIgCSEBA0AgAkF+QQEgAUEDb0ECRhsiBUECdGogAUECdGogEjYCACACIAEgBWpBAnQiAWogEjYCACABIARqKAIAIgEgDUcNAAsLIAkhDQsgACAKQRRqEMsEIAAgDRD1AkEBIQgLIApBIGokACAIC6QFARF/IAAoAlwEQCAAQdgAahA4IABB6ABqEDggAEH4AGoQOCAAEO0BIAAgARDPBCMAQSBrIgIkACACQQA2AhggAkIANwIQIAAoAlwhCSACQQA2AgggAkIANwIAIAJBChAlAkADQEEAIQUgCQRAA0ACQCAAKAJoIg8gBUECdCIEaigCACIDQQBIDQAgACgCWCAEaigCACABSA0AIAVBfkEBIANBA3BBAkYbIANqIghHBEAgACgC2AEiCiAFQQNtQQR0aiIEKAIAIhAgCiAIQQNtQQR0aiIGKAIAIgdHIAQoAgwiESAGKAIMIgNHciAEKAIIIhIgBigCCCIER3IhBgNAIAchCyAEIQwgAyENIAYhDiAKQX5BASAPIAhBAnRqKAIAIgNBA29BAkYbIANqIghBA21BBHRqIgQoAgwhAwJAIAQoAgAiByAQRyADIBFHckUgEiAEKAIIIgRGcSAHIAtHIAMgDUdyRSAEIAxGcXJFBEBBASEGIA5BAXENBAwBCyALIQcgDCEEIA0hAwsgBSAIRw0ACwsgAigCFCIDIAIoAhgiBE8EQCACQRBqIARBAXRBgAEgBBsQJSACIAIoAhQiA0EBajYCFCACKAIQIANBAnRqIAU2AgAMAQsgAiADQQFqNgIUIAIoAhAgA0ECdGogBTYCAAsgBUEBaiIFIAlHDQALCyACKAIUIgQEQCACKAIQIgMgBEECdGohB0EAIQQDQCAAIAMoAgAgAkQAAAAAAADwv0EAEPcCIQYgAkEAQQAQMSAEIAZqIQQgA0EEaiIDIAdHDQALIAJBADYCFCACQRBqEC0gBA0BDAILCyACQRBqEC0LIAIoAgAiAwRAIAMQIgsgAigCECIDBEAgAxAiCyACQSBqJAAgACABEM4EIAAQlAILC4cDAQR/IwBBEGsiBSQAIABBADYCCCAAQgA3AgACQCABRQ0AIAAgARDJBCAAKAIEIgRBH3EhAyAAKAIAIARBA3ZB/P///wFxaiEEAkAgAi0AAEEBRgRAIAUgAzYCDCAFIAQ2AgggASECIAUoAgghAyAFKAIMIgQEQCADIAMoAgBBfyAEdEF/QSAgBGsiAiABIAIgASACSRsiAmt2cXI2AgAgA0EEaiEDIAEgAmshAgsCQCACQQV2IgRFDQAgBEECdCIGRQ0AIANB/wEgBvwLAAsgAkEfcSICBEAgAyAEQQJ0aiIDIAMoAgBBf0EgIAJrdnI2AgALDAELIAUgAzYCDCAFIAQ2AgggBUEIaiABEMgECyAAIAAoAgQgAWoiAjYCBCACQR9xIgFFDQBBICABayEDIAAoAgAgAkEDdkH8////AXFqIQIDQCACIAIoAgBBfiABd3E2AgBBACABQQFqIAFBH0YiBBshASACQQRBACAEG2ohAiADQQFrIgMNAAsLIAVBEGokACAAC9Y9Ayh/GHwBfiMAQZABayIGJAACQAJAIAEoAgQgASgCACIFa0EDdSIDQQJPBEAgBkEYaiEcA0ACQCACRQ0AIAItABBBAUcNACAAEJkCDAQLIAZCADcCOCAGQQA2AkAgBkE4aiADIANB6AdrIgVBACADIAVPGyIQaxCfAQJAIBAiAyABKAIEIAEoAgAiBWtBA3VPBEAgBigCPCEJDAELA0AgBkHIAGogBSADQQN0aigCABDdBAJ/IAYoAjwiBSAGKAJAIgdPBEAgBkE4aiAHQQF0QYABIAcbEJ8BIAYoAjggBigCPCIFQTBsagwBCyAGKAI4IAVBMGxqCyAGQcgAakEw/AoAACAGIAVBAWoiCTYCPCADQQFqIgMgASgCBCABKAIAIgVrQQN1SQ0ACwtBACERIAZBADYCNCAGQgA3AiwCQCAJRQRAIAZBADYCKCAGQgA3AiAMAQsCQANAAkAgBigCLCIJIAYoAjAiCkcEfwNAIAkoAgAhAwJ/IAkoAgQiBQRAIAMgBUECdGohBQJAA0AgBigCOCIHIBFBMGxqIAcgAygCAEEwbGoQ1AQNASADQQRqIgMgBUcNAAsgBSEDCyAJKAIEIQUgCSgCAAwBC0EAIQUgAwsgBUECdGogA0cEQCAJQRBqIgkgCkcNAQsLIAYoAjAFIAoLIAlGBEBBACEJIAZBADYCKCAGQgA3AiAgBiARNgIUIAZBIGpBARDxASAGKAIkIQMgHCAGQRRqIgVHBEADQCADIAUoAgA2AgAgA0EEaiEDIAVBBGoiBSAcRw0ACwsgBiADNgIkIAYoAiQiBSAGKAIgIgNrIQcCQCADIAVGDQAgBxAnIQkgB0UNACAJIAMgB/wKAAALIAdBAnUhDAJAIAYoAjAiByAGKAI0IgVJBEAgByAMNgIIIAcgDDYCBCAHIAk2AgAgB0EQaiEFDAELIAcgBigCLCIDa0EEdSIHQQFqIgpBgICAgAFPDQQgBkH8AGpB/////wAgBSADayIFQQN1IgMgCiADIApLGyAFQfD///8HTxsgByAGQSxqEDIhCCAGKAKEASIDIAw2AgggAyAMNgIEIAMgCTYCACAGIANBEGo2AoQBIAYoAjAiBSESIAgoAgQgBigCLCIDIAVraiIKIQkgAyASRwRAIAMhBQNAQQAhDSAJQQA2AgggCUIANwIAAkAgBSgCBCIORQ0AIAUoAgAhByAOQQJ0IgwQJyENIAxFDQAgDSAHIAz8CgAACyAJIA42AgggCSAONgIEIAkgDTYCACAJQRBqIQkgBUEQaiIFIBJHDQALA0AgAygCACIFBEAgBRAiCyADQQA2AgggA0IANwIAIANBEGoiAyASRw0ACwsgCCAKNgIEIAYgBigCLCIDNgIwIAYgCCgCBDYCLCAIIAM2AgQgBigCMCEDIAYgCCgCCDYCMCAIIAM2AgggBigCNCEDIAYgCCgCDDYCNCAIIAM2AgwgCCAIKAIENgIAIAYoAjAhBSAIKAIEIgwgCCgCCCIJRwRAA0AgCCAJQRBrIgc2AgggByIDKAIAIgoEQCAKECIgCCgCCCEDCyAHQQA2AgAgCUEMa0IANwIAIAMiCSAMRw0ACwsgCCgCACIDBEAgCCgCDBogAxAiCyAGKAIgIQMLIAYgBTYCMCADRQ0BIAYgAzYCJCAGKAIoGiADECIMAQsgCSgCBCIFIAkoAggiA08EQCAJIANBAXRBgAEgAxsQJSAJIAkoAgQiA0EBajYCBCAJKAIAIANBAnRqIBE2AgAMAQsgCSAFQQFqNgIEIAkoAgAgBUECdGogETYCAAsgEUEBaiIRIAYoAjxJDQALIAYoAjAhHSAGKAIsIQkgBkEANgIoIAZCADcCICAJIB1GDQEDQAJAIAkoAgQiBUEBRgRAIAZBIGogASgCACAQQQN0aiAJKAIAKAIAQQN0ahD/AgwBCyAGQQA2AhwgBkIANwIUIAUEQCAJKAIAIgMgBUECdGohBQNAIAZBFGogASgCACAQQQN0aiADKAIAQQN0ahD/AiADQQRqIgMgBUcNAAsLIAZBDGohHkEAIQNBACEXQQAhGCMAQbAHayIEJAAgBEEANgL8BCAEQQA2AvgEIARBADYC9AQgBEEANgLwBCAEQgA3AugEIARBADYC5AQgBEIANwLcBCAEQQA2AtgEIARCADcC0AQgBEEANgLMBCAEQgA3AsQEAkACQAJ/IAYoAhQiBSAGKAIYIg5GBEBEAAAAAAAA8L8hL0QAAAAAAADw/yEwRAAAAAAAAPB/ITFEAAAAAAAA8H8hMkQAAAAAAADwfyEzRAAAAAAAAPD/ITREAAAAAAAA8P8hNUQAAAAAAADwvyE2QQAMAQtEAAAAAAAA8H8hM0QAAAAAAADw/yE1RAAAAAAAAPC/ITZEAAAAAAAA8L8hL0QAAAAAAADw/yE0RAAAAAAAAPD/ITBEAAAAAAAA8H8hMkQAAAAAAADwfyExA0AgBSgCACgCDCIHKAJEDQIgBxCiASE/IARBqAJqIgwgBSgCACIHKAIMIAdBGGoQ2wQgBCsDqAIhNyAEKwPAAiE4IAQrA7ACITkgBCsDyAIhOiAEKwO4AiEtIAQrA9ACISsgBSgCACIKKAIMIgcrAzghQiAHKwMwIS4gDCAKEN0EIAQrA6gCIUAgBCsDsAIhQSAEKwO4AiE7IAQrA8ACITwgBCsDyAIhPSAEKwPQAiE+IARB6ARqIARB/ARqED0gBCADQQF0NgKoAiAEQdwEaiAMED0gBEHQBGogBEH4BGoQPSAEQcQEaiAEQfQEahA9IAQgBCgC/AQgBSgCACgCDCISKAJMajYC/AQgBCAEKAL4BCASKAJcIgxBA25qNgL4BCA2ICuZIiwgLZkiKyArICxjGyItIDqZIiwgOZkiKyArICxjGyIrICsgLWMbIi0gOJkiLCA3mSIrICsgLGMbIisgKyAtYxsiK0QR6i2BmZdxPaIiLCAuICsgP6MiK0QAAAAAAADwPyArRAAAAAAAAPA/ZBuiIisgKyAsYxsiK0QAAAAAAADwvyArvUL///////////8Ag0KAgICAgICA+P8AVBsiK2MhCiAXIBIoAkAiDUohByArIDYgChshNiBCIC8gLyBCYxshLyA+IDUgNSA+YxshNSA9IDQgNCA9YxshNCA8IDAgMCA8YxshMCAzIDsgMyA7YxshMyAyIEEgMiBBYxshMiAxIEAgMSBAYxshMSAXIA0gBxshFyAMQQF2IANqIQMgBCANBH8gEigCjAEgDW4FQQELIAQoAvQEajYC9AQgBUEIaiIFIA5HDQALIANBAXQLIQcgBEGoAmoQOyILIC85AzggCyA2OQMwIAsgNTkDKCALIDQ5AyAgCyAwOQMYIAsgMzkDECALIDI5AwggCyAxOQMAIAsoAkwhBSALQcgAaiIZIAQoAvwEIgMQMyALIAM2AkwgBUERSSAFIANBAXRNckUEQCAZEHELIAsoApwBIQUgC0GYAWoiGiAEKAL8BCIDEDMgCyADNgKcASAFQRFJIAUgA0EBdE1yRQRAIBoQcQsgC0HYAGogBxDJASALKAKsASEFIAtBqAFqIhsgBCgC+AQiAxAzIAsgAzYCrAEgBUERSSAFIANBAXRNckUEQCAbEHELIARCADcDoAIgBEIANwOYAiAEQgA3A5ACIARCADcDiAIgBEIANwMIIARCADcDECAEQgA3AxggBEIANwMgIAtBuAFqIAcgBEEIahDaBCALKALcASEFIAtB2AFqIh8gBCgC+AQiAxA5IAsgAzYC3AEgBUERSSAFIANBAXRNckUEQCAfEIMBCyAXQQBKBEAgCyAXNgJAIAtBiAFqIAQoAvQEIBdsRAAAAAAAAAAAEIABC0GYlQIoAgAhICAGKAIUIgMgBigCGCIIRwRAIAggA2tBA3UhKCALQYgBaiEhIARBiAVqISkgBEGwAWohKiAEQdwFaiEiIARBLGohIwNAIAQoAtwEIQUgBigCFCAYQQN0aiIVKAIAIg8oAgwiFigCvAEiAwRAIANBBXQiAwRAIAsoArgBIAUgGEECdGooAgBBBXRqIBYoArgBIAP8CgAACyAVKAIAIg8oAgwhFiAEKALcBCEFCyAYQQJ0IhQgBCgCxARqISQgFigCQCETIBYoAlwiCARAICQoAgAhJSAFIBRqIhEoAgAhEiAEKALoBCAUaigCACENIAsoAnghDiALKAJoIQwgFigCaCEKIAsoAlghByAWKAJYIQNBACEFA0AgByARKAIAIAVqQQJ0IiZqIAMgBUECdCInaigCACANajYCACAMICZqIAogJ2ooAgAgEmo2AgAgDiAmaiATBH8gFigCeCAnaigCACAlagUgJQs2AgAgBUEBaiIFIAhHDQALIBYoAkAhEwsCQCATRSATQQBMcg0AIBMgFigCjAFqQQFrIQ4gISgCACEMIBYoAogBIQpBACEIA0AgDiAIayINIA0gE3AiB0cEQCAKIAhBA3QiA2oiBSANIAdrQQN0aiEHIAwgJCgCACAXbEEDdGogA2ohAwNAIAMgBSsDADkDACADIBdBA3RqIQMgBSATQQN0aiIFIAdHDQALCyAIQQFqIgggE0cNAAsgE0ECTA0AIARCgICAgICAgPg/NwMoIARCADcDQCAEQgA3AzggBEIANwMwIARCgICAgICAgPg/NwNIIARCADcDYCAEQgA3A1ggBEIANwNQIARCgICAgICAgPg/NwNoIARCADcDgAEgBEIANwN4IARCADcDcCAEQdgFaiIDIA9BGGogBEEoaiIFEMoBIBUoAgAhDyAEKwPYBSAEKwPgBWENACAPKwMYITcgDysDMCE4IA8rA0ghOSAPKwMgITogDysDOCEuIA8rA1AhLSAPKwMoISwgDysDQCErIAQgDysDWDkDmAYgBCArOQOQBiAEICw5A4gGIAQgLTkDgAYgBCAuOQP4BSAEIDo5A/AFIAQgOTkD6AUgBCA4OQPgBSAEIDc5A9gFIAUgAxCQASAVKAIAKAIMIgNB2ABqIANByAFqIAUgISAWKAKMASATbiAXIAQoAsQEIBRqKAIAEL4EIBUoAgAhDwsgBEKAgICAgICA+D83AyggBEIANwNAIARCADcDOCAEQgA3AzAgBEKAgICAgICA+D83A0ggBEIANwNgIARCADcDWCAEQgA3A1AgBEKAgICAgICA+D83A2ggBEIANwOAASAEQgA3A3ggBEIANwNwIARB2AVqIA9BGGogBEEoahDKASAVKAIAIQgCQCAEKwPYBSAEKwPgBWEEQCAIKAIMIgUoAkwiAwRAIANBGGwiAwRAIBkoAgAgBCgC6AQgFGooAgBBGGxqIAUoAkggA/wKAAALIBUoAgAiCCgCDCEFCyAFKAKcASIDBEAgA0EYbCIDBEAgGigCACAEKALoBCAUaigCAEEYbGogBSgCmAEgA/wKAAALIBUoAgAiCCgCDCEFCyAFKAKsASIDRQ0BIANBGGwiAwRAIBsoAgAgBCgC0AQgFGooAgBBGGxqIAUoAqgBIAP8CgAACyAVKAIAIQgMAQsgCCsDcCEuIAgrA2ghLSAIKwNgISwgCCgCDCgCSCEFIAgrAxghQCAIKwMwIUEgCCsDSCE7IAgrAyAhPCAIKwM4IT0gCCsDUCE+IAgrAyghPyAIKwNAITcgBCAIKwNYIis5A2ggBCA3OQNgIAQgPzkDWCAEID45A1AgBCA9OQNIIAQgPDkDQCAEIDs5AzggBCBBOQMwIAQgQDkDKCAEQagGaiIDIARBKGoQkAEgFSgCACgCDCINKAKYASEMICMgA0HIAPwKAAAgDSgCqAEhCiAiIANByAD8CgAAIAQoAugEIQ4CQCANKAJMIgNFBEAgDiAUaigCACEPDAELIAUgA0EYbGohByAZKAIAIA4gFGooAgAiD0EYbGohAwNAIAMgLiA/IAUrAwAiOKIgNyAFKwMIIjmioCArIAUrAxAiOqKgoDkDECADIC0gPCA4oiA9IDmioCA+IDqioKA5AwggAyAsIEAgOKIgQSA5oqAgOyA6oqCgOQMAIANBGGohAyAFQRhqIgUgB0cNAAsLIAQgDDYCqAEgKiAjQcgA/AoAACAEQQE6APgBIARBqAFqIA0oApwBIBooAgAgD0EYbGoQ2QQgBCAKNgKABSApICJByAD8CgAAIARBAToA0AUgBEGABWogFSgCACgCDCgCrAEgGygCACAEKALQBCAUaigCAEEYbGoQ2QQgFSgCACIIKwMwIj4gCCsDUCI/oiAIKwM4IjcgCCsDSCI4oqEgCCsDKCItoiAIKwMYIiwgNyAIKwNYIjmiIAgrA0AiOiA/oqGiIAgrAyAiKyA6IDiiID4gOaKhoqCgIS4gCCgCDCINKAK8ASIKBEAgDSgCuAEhByALKAK4ASAEKALcBCAUaigCAEEFdGohA0EAIQUDQCAHIC5EAAAAAAAAAABjBH8gDSgCaCAFIAVBA3BBAXRrQQJ0aigCCAUgBQtBBXRqIg4rAxAhOyAOKwMAITwgDisDCCE9IAMgBUEFdGoiDCAOKwMYOQMYIAwgLSA8oiA6ID2ioCA5IDuioDkDECAMICsgPKIgNyA9oqAgPyA7oqA5AwggDCAsIDyiID4gPaKgIDggO6KgOQMAIAVBAWoiBSAKRw0ACwsgLkQAAAAAAAAAAGNFDQAgDSgCXCIFQQNuIAVBA0kNACAEKALQBCAUaigCACITaiEKIAsoAnghESALKAJoIRIgCygCWCENA0AgBCANIBNBA2wiDkECaiIFQQJ0IgdqIgMoAgA2AoAHIAQgA0F4QQQgBUEDb0ECRhtqKAIANgKEByAEIAcgEmooAgA2AogHIAQgByARaigCADYCjAcgBCANIA5BAWoiB0ECdCIMaiIDKAIAIgU2ApAHIAQgA0F4QQQgB0EDb0ECRhtqKAIANgKUByAEIAwgEmooAgA2ApgHIAQgDCARaigCADYCnAcgDSAOQQJ0IgdqKAIAIQMgBCAFNgKkByAEIAM2AqAHIAQgByASaigCADYCqAcgBCAHIBFqKAIANgKsByAEQQI2AvwGIARCgICAgBA3AvQGQQAhAwNAIARBgAdqIARB9AZqIANqKAIAQQR0aiIFIAUpAgBCIIk3AgAgBSAFKAIIIgUgBUEDb0EBdGtBAmo2AgggA0EEaiIDQQxHDQALIARBAjYC/AYgBEKAgICAEDcC9AZBACEFA0AgDSAEQfQGaiAFaigCACIDIA5qQQJ0IgdqIARBgAdqIANBBHRqIgMoAgA2AgAgByASaiADKAIINgIAIAcgEWogAygCDDYCACAFQQRqIgVBDEcNAAsgE0EBaiITIApHDQALCyAIKAIMIgUoAtwBIgMEQCAYICBsIQwgBSgC2AEiBSADQQR0aiEKIB8oAgAgBCgC0AQgFGooAgBBBHRqIQMDQCAFKAIAIQcgBCAFKAIMNgIwIAQgBSkCBDcDKCADIAcgDGo2AgAgAyAEKQMoNwIEIAMgBCgCMDYCDCADQRBqIQMgBUEQaiIFIApHDQALCyAYQQFqIhggKEcNAAsgBigCGCEIIAYoAhQhAwsgAyAIRwRAIAtBzAFqIRJBACEPA0AgAyAPQQN0aiIRKAIAKAIMIgcoAswBIgUgB0HQAWoiDUcEQCAPICBsIQ4DQCAFLwGAASEMIAUrA3ghLyAFKwNwITAgBSsDaCExIAUrA2AhMiAFKwNYITMgBSsDUCE0IAUrA0ghNSAFKwNAITYgBSsDOCEuIAUrAzAhLSAFKwMoISwgBSsDICErIAUpAxghQyARKAIAIQMgBEKAgICAgICA+D83AyggBEIANwNAIARCADcDOCAEQgA3AzAgBEKAgICAgICA+D83A0ggBEIANwNgIARCADcDWCAEQgA3A1AgBEKAgICAgICA+D83A2ggBEIANwOAASAEQgA3A3ggBEIANwNwIARBqAFqIgogA0EYaiAEQShqIgcQygEgBCsDqAEgBCsDsAFiBEAgESgCACEDIARCgICAgICAgPg/NwOgASAEIC85A5gBIAQgMDkDkAEgBCAxOQOIASAEQgA3A4ABIAQgMjkDeCAEIDM5A3AgBCA0OQNoIARCADcDYCAEIDU5A1ggBCA2OQNQIAQgLjkDSCAEQgA3A0AgBCAtOQM4IAQgLDkDMCAEICs5AyggCiADQRhqIAcQ8AEgBCsD+AEhMCAEKwPwASExIAQrA+gBITIgBCsD4AEhMyAEKwPYASE0IAQrA9ABITUgBCsDyAEhNiAEKwPAASEuIAQrA7gBIS0gBCsDsAEhLCAEKwOAAiEvIAQrA6gBISsLIAQgBSgCECAOajYCgAUgBCAEQYAFaiIDNgKoASAEQShqIBIgAyAEQagBahB5IAQoAigiAyAMOwGAASADIC85A3ggAyAwOQNwIAMgMTkDaCADIDI5A2AgAyAzOQNYIAMgNDkDUCADIDU5A0ggAyA2OQNAIAMgLjkDOCADIC05AzAgAyAsOQMoIAMgKzkDICADIEM3AxgCQCAFKAIEIgMEQANAIAMiBSgCACIDDQAMAgsACwNAIAUgBSgCCCIFKAIARw0ACwsgBSANRw0ACyAGKAIYIQggBigCFCEDCyAPQQFqIg8gCCADa0EDdUkNAAsLIAsQ9gIgC0EAEFQgCxC1BCAeIAsQ7wEgCxA6GgwBCyAEQagCahA7IgMgBSgCACgCDCgCRDYCRCAeIAMQ7wEgAxA6GgsgBCgCxAQiAwRAIAQgAzYCyAQgBCgCzAQaIAMQIgsgBCgC0AQiAwRAIAQgAzYC1AQgBCgC2AQaIAMQIgsgBCgC3AQiAwRAIAQgAzYC4AQgBCgC5AQaIAMQIgsgBCgC6AQiAwRAIAQgAzYC7AQgBCgC8AQaIAMQIgsgBEGwB2okAAJAIAYoAiQiAyAGKAIoIgVJBEAgAyAGKAIMNgIAIAMgBigCEDYCBCAGIANBCGo2AiQMAQsgAyAGKAIgIgNrQQN1IgdBAWoiCkGAgICAAk8NByAGQfwAakH/////ASAFIANrIgVBAnUiAyAKIAMgCksbIAVB+P///wdPGyAHIAZBIGoQSyEKIAYoAoQBIgMgBigCDDYCACADIAYoAhA2AgQgBiADQQhqNgKEASAGQgA3AgwgBigCgAEgBigCJCAGKAIgIgNrIgdrIQUgBwRAIAUgAyAH/AoAAAsgBiAGKAIgIgc2AoABIAYgBTYCICAGKAKEASEFIAYgBzYChAEgBiAFNgIkIAYoAighAyAGIAYoAogBNgIoIAYgAzYCiAEgCiAHNgIAIAoQbiAGIAU2AiQgBigCECIFRQ0AIAUgBSgCBCIDQQFrNgIEIAMNACAFIAUoAgAoAggRAAAgBRAkCyACBEAgAiAJKAIEQQFrIgMgAigCBGo2AgQgAiACKAIMIANBC2xqNgIMCyAGIAZBFGo2AnwgBkH8AGoQZQsgHSAJQRBqIglHDQALDAELECYACyABKAIAIBBBA3RqIgMgASgCBCIFRwRAAkAgAyAFIANraiIJIAEoAgQiCkYEQCADIQUMAQsgAyEFA0AgBSAJEE4gBUEIaiEFIAlBCGoiCSAKRw0ACyABKAIEIQoLIAogAyAFIANraiIDRwRAA0AgAyAKQQhrEC8iCkcNAAsLIAEgAzYCBAsgBkEUakEAIAZBIGogAhDYBAJAIAEoAgQiAyABKAIIIgVJBEAgAyAGKAIUNgIAIAMgBigCGDYCBCABIANBCGo2AgQMAQsgAyABKAIAIgNrQQN1IgdBAWoiEEGAgICAAk8NAyAGQfwAakH/////ASAFIANrIgVBAnUiAyAQIAMgEEsbIAVB+P///wdPGyAHIAEQSyEQIAYoAoQBIgMgBigCFDYCACADIAYoAhg2AgQgBiADQQhqNgKEASAGQgA3AhQgBigCgAEgASgCBCABKAIAIgNrIgdrIQUgBwRAIAUgAyAH/AoAAAsgASgCACEHIAEgBTYCACAGIAc2AoABIAEgBigChAEiBTYCBCAGIAc2AoQBIAEoAgghAyABIAYoAogBNgIIIAYgAzYCiAEgECAHNgIAIBAQbiAGKAIYIQcgASAFNgIEIAdFDQAgByAHKAIEIgNBAWs2AgQgAw0AIAcgBygCACgCCBEAACAHECQLIAEoAgAiECgCACEFIBAgASgCBCIHQQhrIgMoAgA2AgAgAyAFNgIAIBAoAgQhBSAQIAdBBGsiAygCADYCBCADIAU2AgAgBiAGQSBqNgJ8IAZB/ABqEGUgBiAGQSxqNgJ8IAYoAnwiBSgCACIJBEAgBSgCBCIDIAlHBEADQCADQRBrIgcoAgAiEARAIBAQIgsgB0EANgIAIANBDGtCADcCACAHIgMgCUcNAAsLIAUgCTYCBCAGKAJ8IgUoAgAgBSgCCBoQIgsgBigCOCIDBEAgAxAiCyABKAIEIAEoAgAiBWtBA3UiA0EBSw0ACwsgACAFKAIANgIAIAAgBSgCBCIANgIEIABFDQEgACAAKAIEQQFqNgIEDAELECYACyAGQZABaiQAC9gBAQR/QaABECMiAkGAlAI2AgAgAkIANwIEIAJBEGoiAUIANwIEIAFBmJICNgIAQagCECMiA0GgkAI2AgAgA0IANwIEIANBEGoQOyEEIAFCADcDICABQoCAgICAgID4PzcDGCABIAM2AhAgASAENgIMIAFCADcDKCABQgA3AzAgAUIANwNAIAFCgICAgICAgPg/NwM4IAFCADcDSCABQgA3A1AgAUKAgICAgICA+D83A1ggAUHgAGpBAEEw/AsAIAAgAjYCBCAAIAE2AgAgACACQRRqIAEQjwELyQEBAX8gACgCfCIBBEAgARAiCyAAQQA2AoQBIABCADcCfCAAKAJsIgEEQCABECILIABBADYCdCAAQgA3AmwgACgCXCIBBEAgARAiCyAAQQA2AmQgAEIANwJcIAAoAkwiAQRAIAEQIgsgAEEANgJUIABCADcCTCAAKAI8IgEEQCABECILIAAoAiwiAQRAIAEQIgsgAEEANgI0IABCADcCLCAAKAIcIgEEQCABECILIABBADYCJCAAQgA3AhwgACgCDCIABEAgABAiCwufAQECfyMAQbADayIFJAACQCAEBEAgBC0AEEEBRgRAIAAQmQIMAgsgBUGYAWoiBiAFQQRqIAEgAiADIAQQjgMiASADEJ8CIAAgBhDvASAGEDoaIAEQ/AIgBCAEKAIEQQFqNgIEDAELIAVBmAFqIgQgBUEEaiABIAIgA0EAEI4DIgEgAxCfAiAAIAQQ7wEgBBA6GiABEPwCCyAFQbADaiQAC6UBAQF/IABCADcCBCAAQZiSAjYCACAAIAEoAgA2AgwgACABKAIEIgI2AhAgAgRAIAIgAigCBEEBajYCBAsgAEIANwMgIABCgICAgICAgPg/NwMYIABCADcDKCAAQgA3AzAgAEIANwNAIABCgICAgICAgPg/NwM4IABCADcDSCAAQgA3A1AgAEKAgICAgICA+D83A1ggAEHgAGpBAEEw/AsAIAEQLxoL4gIBBX8jAEEgayIFJAACQAJAIAAoAgQiAiAAKAIIIgNJBEAgAiABKAIANgIAIAIgASgCBCIBNgIEIAEEQCABIAEoAgRBAWo2AgQLIAJBCGohAQwBCyACIAAoAgAiBGtBA3UiBkEBaiICQYCAgIACTw0BIAVBDGpB/////wEgAyAEayIDQQJ1IgQgAiACIARJGyADQfj///8HTxsgBiAAEEsiAigCCCIDIAEoAgA2AgAgAyABKAIEIgE2AgQgAiABBH8gASABKAIEQQFqNgIEIAIoAggFIAMLQQhqNgIIIAIoAgQgACgCBCAAKAIAIgNrIgFrIQQgAQRAIAQgAyAB/AoAAAsgACgCACEDIAAgBDYCACACIAM2AgQgACACKAIIIgE2AgQgAiADNgIIIAAoAgghBCAAIAIoAgw2AgggAiADNgIAIAIgBDYCDCACEG4LIAAgATYCBCAFQSBqJAAPCxAmAAubAgEEf0GYARAjIgRBsJMCNgIAIARCADcCBCACLAAAIQUjAEEQayIDJAAgBEEQaiICQgA3AgQgAkG0kgI2AgAgA0EANgIIIANCADcCACADIAEoAgAiBiABKAIEIgEgASAGa0EDdRCBAyACQQxqIAMQ0wQgAyADNgIMIANBDGoQZSACQgA3AyggAkKAgICAgICA+D83AyAgAiAFOgAcIAJCADcDMCACQgA3AzggAkIANwNIIAJCgICAgICAgPg/NwNAIAJCADcDUCACQgA3A1ggAkIANwNoIAJCgICAgICAgPg/NwNgIAJCADcDcCACQgA3A3ggAkIANwOAASADQRBqJAAgACAENgIEIAAgAjYCACAAIARBFGogAhCPAQtkAQF/IAMEQCAAIAMQkAMgACgCBCEDIAEgAkcEQANAIAMgASgCADYCACADIAEoAgQiBDYCBCAEBEAgBCAEKAIEQQFqNgIECyADQQhqIQMgAUEIaiIBIAJHDQALCyAAIAM2AgQLC6kNAgx/AnwjAEEgayIJJAACQCAERQ0AA0ACQAJAIAQgBkwgAyAGTHJFBEAgA0UNBCABKwMAIRMDQCATIAArAwAiFGMNAiATIBRhBEAgASgCDCAAKAIMSA0DCyAAQRhqIQAgA0EBayIDDQALDAQLIAMgBEoNASAAIAFGDQMgBSEHIAAhCANAIAcgCCkDEDcDECAHIAgpAwg3AwggByAIKQMANwMAIAdBGGohByAIQRhqIgggAUcNAAsDQCABIAJGBEAgByAFayIBRQ0FIAAgBSAB/AoAAAwFCwJAAkAgASsDACITIAUrAwAiFGNFBEAgEyAUYg0BIAEoAgwgBSgCDE4NAQsgACABKQMQNwMQIAAgASkDCDcDCCAAIAEpAwA3AwAgAUEYaiEBDAELIAAgBSkDEDcDECAAIAUpAwg3AwggACAFKQMANwMAIAVBGGohBQsgAEEYaiEAIAUgB0cNAAsMAwsCQCADIARIBEAgBEECbSIOQRhsIQwCQCAAIAFGBEAgACEKDAELIAEgAGtBGG0hByABIAxqIggoAgwhDSAIKwMAIRMgACEKA0ACfwJAIBMgCiAHQQF2IghBGGxqIgsrAwAiFGMNACATIBRhBEAgDSALKAIMSA0BCyALQRhqIQogByAIQX9zagwBCyAICyIHDQALCyAKIABrQRhtIQ8MAQsgA0EBRgRAIAkgACkDEDcDGCAJIAApAwg3AxAgCSAAKQMANwMIIAAgASkDEDcDECAAIAEpAwg3AwggACABKQMANwMAIAEgCSkDGDcDECABIAkpAxA3AwggASAJKQMINwMADAQLIAAgA0ECbSIPQRhsaiEKAkAgASACRgRAQQAhDAwBCyACIAFrQRhtIQcgCigCDCELIAorAwAhE0EAIQwDQAJ/AkAgASAHQQF2IghBGGwgDGoiDWoiDisDACIUIBNjRQRAIBMgFGINASAOKAIMIAtODQELIA1BGGohDCAHIAhBf3NqDAELIAgLIgcNAAsLIAxBGG4hDgsgBCAOayEEIAMgD2shAyABIAxqIg0hBwJAIAEgCkYNACAKIQcgDEUNACABIAdBGGoiCEYEQCAJIAcpAxA3AxggCSAHKQMINwMQIAkgBykDADcDCCAMBEAgByAIIAz8CgAACyAKIAxqIgcgCSkDGDcDECAHIAkpAxA3AwggByAJKQMINwMADAELIAxBGEYEQCAJIA1BGGsiASkDEDcDGCAJIAEpAwg3AxAgCSABKQMANwMIIA0gASAKayIIQWhtQRhsaiEHIAhFIAEgCkZyRQRAIAcgCiAI/AoAAAsgCiAJKQMYNwMQIAogCSkDEDcDCCAKIAkpAwg3AwAMAQsgASEIIAEgCmsiEUEYbSIQIQsCQCAMQRhtIhIgEEYEQANAIAkgBykDEDcDGCAJIAcpAwg3AxAgCSAHKQMANwMIIAcgCCkDEDcDECAHIAgpAwg3AwggByAIKQMANwMAIAggCSkDGDcDECAIIAkpAxA3AwggCCAJKQMINwMAIAdBGGoiByABRg0CIAhBGGoiCCANRw0ADAILAAsDQCALIBIiC28iEg0ACyAKIAtBGGxqIQsDQCAJIAtBGGsiCykDEDcDGCAJIAspAwg3AxAgCSALKQMANwMIIAsgEWohCCALIQEDQCABIAgpAxA3AxAgASAIKQMINwMIIAEgCCkDADcDACAIIgEgEWogCiAQIA0gAWtBGG0iB2tBGGxqIAcgEEobIgggC0cNAAsgASAJKQMYNwMQIAEgCSkDEDcDCCABIAkpAwg3AwAgCiALRw0ACyAKIAxqIQcMAQsgASEHCwJ/IA4gD2ogAyAEakgEQCAAIAogByAPIA4gBSAGEIIDIAchACANDAELIAcgDSACIAMgBCAFIAYQggMgDiEEIA8hAyAHIQIgCgshASAEDQEMAgsLIAEgAkYNACAFIQcgASEIA0AgByAIKQMQNwMQIAcgCCkDCDcDCCAHIAgpAwA3AwAgB0EYaiEHIAhBGGoiCCACRw0ACwNAIAAgASIDRgRAA0AgAkEYayICIAdBGGsiBykDEDcDECACIAcpAwg3AwggAiAHKQMANwMAIAUgB0cNAAwDCwALAn8gB0EYayIEKwMAIhMgA0EYayIIKwMAIhRjBEAgCAwBCyATIBRhBEAgCCAHQQxrKAIAIANBDGsoAgBIDQEaCyAEIgghByADCyEBIAJBGGsiAiAIKQMQNwMQIAIgCCkDCDcDCCACIAgpAwA3AwAgBSAHRw0ACwsgCUEgaiQAC/YEAQl/IwBBEGsiCiQAIAEgAkcEQCAAQQRqIQYDQCMAQRBrIggkACAKAn8gCEEIaiEEIAFBEGohCwJAAkACQCAAQQRqIgUgBkcEQCALKAIAIgkgBigCECIDTg0BCyAGKAIAIQcCQCAGIgMgACgCAEcEQAJAIAdFBEADQCADIAMoAggiAygCAEYNAAwCCwALIAchBANAIAQiAygCBCIEDQALCyALKAIAIgkgAygCEEwNAQsgB0UEQCAIIAY2AgwgBgwFCyAIIAM2AgwgA0EEagwECyAFKAIAIgNFDQEgBSEEA0AgAyIFKAIQIgcgCUoEQCADIgQoAgAiAw0BDAQLIAcgCU4NAyAFQQRqIQQgBSgCBCIDDQALDAILIAMgCUgEQAJAIAYoAgQiB0UEQCAGIQMDQCADIAMoAggiAygCAEcNAAsMAQsgByEEA0AgBCIDKAIAIgQNAAsLAkAgAyAFRwRAIAkgAygCEE4NAQsgB0UEQCAIIAY2AgwgBkEEagwFCyAIIAM2AgwgAwwECyAFKAIAIgNFDQEgBSEEA0AgAyIFKAIQIgcgCUoEQCADIgQoAgAiA0UNBAwBCyAHIAlODQMgBUEEaiEEIAUoAgQiAw0ACwwCCyAIIAY2AgwgBCAGNgIAIAQMAgsgBSEECyAIIAU2AgwgBAsiAygCACIEBH9BAAVBiAEQIyIEQRBqIAtB+AD8CgAAIAAgCCgCDCADIAQQggFBAQs6AAwgCiAENgIIIAhBEGokAAJAIAEoAgQiAwRAA0AgAyIBKAIAIgMNAAwCCwALA0AgASABKAIIIgEoAgBHDQALCyABIAJHDQALCyAKQRBqJAALTQEDfyAAKAIAIQICQCAAKAIEIgFFBEAMAQsgARAnIQMgAUUNACADIAIgAfwKAAALIAAgAgR/IAIQIiAAKAIEBSABCzYCCCAAIAM2AgALsgkBDn8jAEEQayIRJAACQCAFRQ0AA0ACQAJAIAUgB0wgBCAHTHJFBEAgBEUNBCADKAIAKAIAIg0gASgCACILQQN0aiIIQQEgAygCBCgCACIJa0ECdCIOaiEKIAggCUECdCIPaigCACEIA0AgCCANIAAoAgAiCUEDdGoiDCAPaigCACIQSA0CIAggEEYEQCAKKAIAIAwgDmooAgBIDQMLIABBBGohACAEQQFrIgQNAAsMBAsgBCAFSg0BIAAgAUYNAyAGIQQgACEIA0AgBCAIKAIANgIAIARBBGohBCAIQQRqIgggAUcNAAsgAygCBCEFIAMoAgAhAwNAIAEgAkYEQCAEIAZrIgFFDQUgACAGIAH8CgAADAULAkACQCADKAIAIgcgASgCACIIQQN0aiILIAUoAgAiCUECdCIKaigCACIMIAogByAGKAIAIgpBA3RqIgdqKAIAIg1OBEAgDCANRw0BIAtBASAJa0ECdCIJaigCACAHIAlqKAIATg0BCyAAIAg2AgAgAUEEaiEBDAELIAAgCjYCACAGQQRqIQYLIABBBGohACAEIAZHDQALDAMLAkAgBCAFSARAIAEgBUECbSIKQQJ0aiELAkAgACABRgRAIAAhCQwBCyANIAsoAgBBA3RqIgggDmohEiAIIA9qKAIAIRAgASAAa0ECdSEIIAAhCQNAAn8CQCAQIA0gCSAIQQF2IgxBAnRqIhMoAgBBA3RqIhQgD2ooAgAiFUgNACAQIBVGBEAgEigCACAOIBRqKAIASA0BCyATQQRqIQkgCCAMQX9zagwBCyAMCyIIDQALCyAJIABrQQJ1IQwMAQsgBEEBRgRAIAAgCzYCACABIAk2AgAMBAsgACAEQQJtIgxBAnRqIQkCQCABIAJGBEAgASELDAELIA0gCSgCAEEDdGoiCCAOaiESIAggD2ooAgAhECACIAFrQQJ1IQggASELA0ACfwJAIBAgDSALIAhBAXYiCkECdGoiEygCAEEDdGoiFCAPaigCACIVTARAIBAgFUcNASAOIBRqKAIAIBIoAgBODQELIBNBBGohCyAIIApBf3NqDAELIAoLIggNAAsLIAsgAWtBAnUhCgsgEUEIaiAJIAEgCxCRASARKAIIIQgCfyAKIAxqIAUgCmsiBSAEIAxrIgRqSARAIAAgCSAIIAMgDCAKIAYgBxCFAyAIIQAgCwwBCyAIIAsgAiADIAQgBSAGIAcQhQMgCiEFIAwhBCAIIQIgCQshASAFDQEMAgsLIAEgAkYNACAGIQQgASEIA0AgBCAIKAIANgIAIARBBGohBCAIQQRqIgggAkcNAAsgAygCBCELIAMoAgAhCQNAIAAgASIDRgRAA0AgAkEEayICIARBBGsiBCgCADYCACAEIAZHDQAMAwsACwJAIAkoAgAiCiAEQQRrIgcoAgAiCEEDdGoiDCALKAIAIg1BAnQiAWooAgAiDiABIAogA0EEayIBKAIAIgVBA3RqIgpqKAIAIg9IDQAgDiAPRgRAIAxBASANa0ECdCINaigCACAKIA1qKAIASA0BCyAIIQUgAyEBIAchBAsgAkEEayICIAU2AgAgBCAGRw0ACwsgEUEQaiQAC5YHAgl8DH8jAEFAaiIPQRBqQQBBMPwLACAPQQI2AgwgD0KAgICAEDcCBCACQRhsIgIgASgCACIOKAKYAWorAwAhCiAOKAJIIAJqIhQrAwAhBiABKAIEIhEoApgBIRUgESgCSCEWQQAhAUEAIQIDQAJ/IAogFSAEIA9BBGogAmooAgBBBHRqIhAoAgRBGGwiDmorAwCaZCAOIBZqIg4rAwAiCCAGYyAGIAhhGyAKIBUgECgCCEEYbCITaisDAJpkIBMgFmoiEysDACIJIAZjIAYgCWEbayIZRQRARAAAAAAAAPh/IQVEAAAAAAAA+H8hB0EADAELIBAoAgAhGCAOKwMQIQcgDisDCCEFAkAgBiAIoSILIAYgCaEiDCALmSAMmWMiDhsgCSAIoaMiCL1C////////////AINC//////////f/AFYNACATKwMIIgkgBaEiC71C////////////AINCgICAgICAgPj/AFoNACATKwMQIgwgB6EiDb1C////////////AINCgICAgICAgPj/AFoNACAHIAwgDhsgCCANoqAhByAFIAkgDhsgCCALoqAhBQsgGUEAIBEoAqgBIg4gGEEDbUEYbGorAwggDiARKAJoIBhBAnRqKAIAQQNtQRhsaisDCKBEAAAAAAAAAABkIAUgFCsDCCIIYyAFIAhhGxsLIQ4CQCAFvUL///////////8Ag0L/////////9/8AVg0AIA5BACAOayAQLQAMGyASaiESIAFBAUoEQEECIQEMAQsgAUUgDkUgF3NFckUEQEEBIQEMAQsgD0EQaiABQRhsaiIQIAc5AxAgECAHOQMIIBAgBTkDACABQQFqIQEgDkEARyEXCyACQQRqIgJBDEcNAAsCfyASRQRARAAAAAAAAPh/IQVBAAwBCyASQQAgESgCqAEgA0EYbGorAxBEAAAAAAAAAABkIA8rAyAiBSAPKwM4IgYgFCsDCCIHIA8rAxAiCKEiCZkgByAPKwMoIgehIgqZYyIBGyAGIAWhIgYgCSAKIAEbIAcgCKGjIgeioCAFIAa9Qv///////////wCDQoCAgICAgID4/wBUGyAFIA8rAzAgDysDGKG9Qv///////////wCDQoCAgICAgID4/wBUGyAFIAe9Qv///////////wCDQoCAgICAgID4/wBUGyIFIBQrAxAiBmMgBSAGYRsbCyEBIAAgBTkDCCAAIAE2AgALsgkBDn8jAEEQayIRJAACQCAFRQ0AA0ACQAJAIAUgB0wgBCAHTHJFBEAgBEUNBCADKAIAKAIAIg0gASgCACILQQN0aiIIQQEgAygCBCgCACIJa0ECdCIOaiEKIAggCUECdCIPaigCACEIA0AgCCANIAAoAgAiCUEDdGoiDCAPaigCACIQSA0CIAggEEYEQCAKKAIAIAwgDmooAgBIDQMLIABBBGohACAEQQFrIgQNAAsMBAsgBCAFSg0BIAAgAUYNAyAGIQQgACEIA0AgBCAIKAIANgIAIARBBGohBCAIQQRqIgggAUcNAAsgAygCBCEFIAMoAgAhAwNAIAEgAkYEQCAEIAZrIgFFDQUgACAGIAH8CgAADAULAkACQCADKAIAIgcgASgCACIIQQN0aiILIAUoAgAiCUECdCIKaigCACIMIAogByAGKAIAIgpBA3RqIgdqKAIAIg1OBEAgDCANRw0BIAtBASAJa0ECdCIJaigCACAHIAlqKAIATg0BCyAAIAg2AgAgAUEEaiEBDAELIAAgCjYCACAGQQRqIQYLIABBBGohACAEIAZHDQALDAMLAkAgBCAFSARAIAEgBUECbSIKQQJ0aiELAkAgACABRgRAIAAhCQwBCyANIAsoAgBBA3RqIgggDmohEiAIIA9qKAIAIRAgASAAa0ECdSEIIAAhCQNAAn8CQCAQIA0gCSAIQQF2IgxBAnRqIhMoAgBBA3RqIhQgD2ooAgAiFUgNACAQIBVGBEAgEigCACAOIBRqKAIASA0BCyATQQRqIQkgCCAMQX9zagwBCyAMCyIIDQALCyAJIABrQQJ1IQwMAQsgBEEBRgRAIAAgCzYCACABIAk2AgAMBAsgACAEQQJtIgxBAnRqIQkCQCABIAJGBEAgASELDAELIA0gCSgCAEEDdGoiCCAOaiESIAggD2ooAgAhECACIAFrQQJ1IQggASELA0ACfwJAIBAgDSALIAhBAXYiCkECdGoiEygCAEEDdGoiFCAPaigCACIVTARAIBAgFUcNASAOIBRqKAIAIBIoAgBODQELIBNBBGohCyAIIApBf3NqDAELIAoLIggNAAsLIAsgAWtBAnUhCgsgEUEIaiAJIAEgCxCRASARKAIIIQgCfyAKIAxqIAUgCmsiBSAEIAxrIgRqSARAIAAgCSAIIAMgDCAKIAYgBxCHAyAIIQAgCwwBCyAIIAsgAiADIAQgBSAGIAcQhwMgCiEFIAwhBCAIIQIgCQshASAFDQEMAgsLIAEgAkYNACAGIQQgASEIA0AgBCAIKAIANgIAIARBBGohBCAIQQRqIgggAkcNAAsgAygCBCELIAMoAgAhCQNAIAAgASIDRgRAA0AgAkEEayICIARBBGsiBCgCADYCACAEIAZHDQAMAwsACwJAIAkoAgAiCiAEQQRrIgcoAgAiCEEDdGoiDCALKAIAIg1BAnQiAWooAgAiDiABIAogA0EEayIBKAIAIgVBA3RqIgpqKAIAIg9IDQAgDiAPRgRAIAxBASANa0ECdCINaigCACAKIA1qKAIASA0BCyAIIQUgAyEBIAchBAsgAkEEayICIAU2AgAgBCAGRw0ACwsgEUEQaiQAC5QHAgl8DH8jAEFAaiIPQRBqQQBBMPwLACAPQQI2AgwgD0KAgICAEDcCBCACQRhsIgIgASgCACIOKAKYAWorAwAhCiAOKAJIIAJqIhQrAwAhBiABKAIEIhEoApgBIRUgESgCSCEWQQAhAUEAIQIDQAJ/IBUgBCAPQQRqIAJqKAIAQQR0aiIQKAIEQRhsIg5qKwMAIApjIA4gFmoiDisDACIIIAZjIAYgCGEbIBUgECgCCEEYbCITaisDACAKYyATIBZqIhMrAwAiCSAGYyAGIAlhG2siGUUEQEQAAAAAAAD4fyEFRAAAAAAAAPh/IQdBAAwBCyAQKAIAIRggDisDECEHIA4rAwghBQJAIAYgCKEiCyAGIAmhIgwgC5kgDJljIg4bIAkgCKGjIgi9Qv///////////wCDQv/////////3/wBWDQAgEysDCCIJIAWhIgu9Qv///////////wCDQoCAgICAgID4/wBaDQAgEysDECIMIAehIg29Qv///////////wCDQoCAgICAgID4/wBaDQAgByAMIA4bIAggDaKgIQcgBSAJIA4bIAggC6KgIQULIBlBACARKAKoASIOIBhBA21BGGxqKwMIIA4gESgCaCAYQQJ0aigCAEEDbUEYbGorAwigRAAAAAAAAAAAYyAFIBQrAwgiCGMgBSAIYRsbCyEOAkAgBb1C////////////AINC//////////f/AFYNACAOQQAgDmsgEC0ADBsgEmohEiABQQFKBEBBAiEBDAELIAFFIA5FIBdzRXJFBEBBASEBDAELIA9BEGogAUEYbGoiECAHOQMQIBAgBzkDCCAQIAU5AwAgAUEBaiEBIA5BAEchFwsgAkEEaiICQQxHDQALAn8gEkUEQEQAAAAAAAD4fyEFQQAMAQsgEkEAIBEoAqgBIANBGGxqKwMQRAAAAAAAAAAAYyAPKwMgIgUgDysDOCIGIBQrAwgiByAPKwMQIgihIgmZIAcgDysDKCIHoSIKmWMiARsgBiAFoSIGIAkgCiABGyAHIAihoyIHoqAgBSAGvUL///////////8Ag0KAgICAgICA+P8AVBsgBSAPKwMwIA8rAxihvUL///////////8Ag0KAgICAgICA+P8AVBsgBSAHvUL///////////8Ag0KAgICAgICA+P8AVBsiBSAUKwMQIgZjIAUgBmEbGwshASAAIAU5AwggACABNgIAC7IJAQ5/IwBBEGsiESQAAkAgBUUNAANAAkACQCAFIAdMIAQgB0xyRQRAIARFDQQgAygCACgCACINIAEoAgAiC0EDdGoiCEEBIAMoAgQoAgAiCWtBAnQiDmohCiAIIAlBAnQiD2ooAgAhCANAIAggDSAAKAIAIglBA3RqIgwgD2ooAgAiEEgNAiAIIBBGBEAgCigCACAMIA5qKAIASA0DCyAAQQRqIQAgBEEBayIEDQALDAQLIAQgBUoNASAAIAFGDQMgBiEEIAAhCANAIAQgCCgCADYCACAEQQRqIQQgCEEEaiIIIAFHDQALIAMoAgQhBSADKAIAIQMDQCABIAJGBEAgBCAGayIBRQ0FIAAgBiAB/AoAAAwFCwJAAkAgAygCACIHIAEoAgAiCEEDdGoiCyAFKAIAIglBAnQiCmooAgAiDCAKIAcgBigCACIKQQN0aiIHaigCACINTgRAIAwgDUcNASALQQEgCWtBAnQiCWooAgAgByAJaigCAE4NAQsgACAINgIAIAFBBGohAQwBCyAAIAo2AgAgBkEEaiEGCyAAQQRqIQAgBCAGRw0ACwwDCwJAIAQgBUgEQCABIAVBAm0iCkECdGohCwJAIAAgAUYEQCAAIQkMAQsgDSALKAIAQQN0aiIIIA5qIRIgCCAPaigCACEQIAEgAGtBAnUhCCAAIQkDQAJ/AkAgECANIAkgCEEBdiIMQQJ0aiITKAIAQQN0aiIUIA9qKAIAIhVIDQAgECAVRgRAIBIoAgAgDiAUaigCAEgNAQsgE0EEaiEJIAggDEF/c2oMAQsgDAsiCA0ACwsgCSAAa0ECdSEMDAELIARBAUYEQCAAIAs2AgAgASAJNgIADAQLIAAgBEECbSIMQQJ0aiEJAkAgASACRgRAIAEhCwwBCyANIAkoAgBBA3RqIgggDmohEiAIIA9qKAIAIRAgAiABa0ECdSEIIAEhCwNAAn8CQCAQIA0gCyAIQQF2IgpBAnRqIhMoAgBBA3RqIhQgD2ooAgAiFUwEQCAQIBVHDQEgDiAUaigCACASKAIATg0BCyATQQRqIQsgCCAKQX9zagwBCyAKCyIIDQALCyALIAFrQQJ1IQoLIBFBCGogCSABIAsQkQEgESgCCCEIAn8gCiAMaiAFIAprIgUgBCAMayIEakgEQCAAIAkgCCADIAwgCiAGIAcQiQMgCCEAIAsMAQsgCCALIAIgAyAEIAUgBiAHEIkDIAohBSAMIQQgCCECIAkLIQEgBQ0BDAILCyABIAJGDQAgBiEEIAEhCANAIAQgCCgCADYCACAEQQRqIQQgCEEEaiIIIAJHDQALIAMoAgQhCyADKAIAIQkDQCAAIAEiA0YEQANAIAJBBGsiAiAEQQRrIgQoAgA2AgAgBCAGRw0ADAMLAAsCQCAJKAIAIgogBEEEayIHKAIAIghBA3RqIgwgCygCACINQQJ0IgFqKAIAIg4gASAKIANBBGsiASgCACIFQQN0aiIKaigCACIPSA0AIA4gD0YEQCAMQQEgDWtBAnQiDWooAgAgCiANaigCAEgNAQsgCCEFIAMhASAHIQQLIAJBBGsiAiAFNgIAIAQgBkcNAAsLIBFBEGokAAuVBwIJfAx/IwBBQGoiD0EQakEAQTD8CwAgD0ECNgIMIA9CgICAgBA3AgQgAkEYbCICIAEoAgAiDigCSGoiFCsDACEIIA4oApgBIAJqKwMAmiELIAEoAgQiEigCmAEhFSASKAJIIRZBACEBQQAhAgNAAn8gFSAEIA9BBGogAmooAgBBBHRqIhEoAghBGGwiDmorAwAgC2QgCCAOIBZqIg4rAwAiBmMgBiAIYRsgFSARKAIEQRhsIhBqKwMAIAtkIAggECAWaiIQKwMAIgljIAggCWEbayIZRQRARAAAAAAAAPh/IQVEAAAAAAAA+H8hB0EADAELIBEoAgAhGCAQKwMQIQcgECsDCCEFAkAgCCAJoSIKIAggBqEiDCAKmSAMmWMiEBsgBiAJoaMiBr1C////////////AINC//////////f/AFYNACAOKwMIIgkgBaEiCr1C////////////AINCgICAgICAgPj/AFoNACAOKwMQIgwgB6EiDb1C////////////AINCgICAgICAgPj/AFoNACAHIAwgEBsgBiANoqAhByAFIAkgEBsgBiAKoqAhBQsgGUEAIBIoAqgBIg4gGEEDbUEYbGorAwggDiASKAJoIBhBAnRqKAIAQQNtQRhsaisDCKBEAAAAAAAAAABkIBQrAwgiBiAFYyAFIAZhGxsLIQ4CQCAFvUL///////////8Ag0L/////////9/8AVg0AQQAgDmsgDiARLQAMGyATaiETIAFBAUoEQEECIQEMAQsgAUUgDkUgF3NFckUEQEEBIQEMAQsgD0EQaiABQRhsaiIRIAc5AxAgESAHOQMIIBEgBTkDACABQQFqIQEgDkEARyEXCyACQQRqIgJBDEcNAAsCfyATRQRARAAAAAAAAPh/IQVBAAwBCyATQQAgEigCqAEgA0EYbGorAxBEAAAAAAAAAABkIBQrAxAiCCAPKwMgIgUgDysDOCIHIBQrAwgiBiAPKwMQIgmhIguZIAYgDysDKCIGoSIKmWMiARsgByAFoSIHIAsgCiABGyAGIAmhoyIGoqAgBSAHvUL///////////8Ag0KAgICAgICA+P8AVBsgBSAPKwMwIA8rAxihvUL///////////8Ag0KAgICAgICA+P8AVBsgBSAGvUL///////////8Ag0KAgICAgICA+P8AVBsiBWMgBSAIYRsbCyEBIAAgBTkDCCAAIAE2AgALsgkBDn8jAEEQayIRJAACQCAFRQ0AA0ACQAJAIAUgB0wgBCAHTHJFBEAgBEUNBCADKAIAKAIAIg0gASgCACILQQN0aiIIQQEgAygCBCgCACIJa0ECdCIOaiEKIAggCUECdCIPaigCACEIA0AgCCANIAAoAgAiCUEDdGoiDCAPaigCACIQSA0CIAggEEYEQCAKKAIAIAwgDmooAgBIDQMLIABBBGohACAEQQFrIgQNAAsMBAsgBCAFSg0BIAAgAUYNAyAGIQQgACEIA0AgBCAIKAIANgIAIARBBGohBCAIQQRqIgggAUcNAAsgAygCBCEFIAMoAgAhAwNAIAEgAkYEQCAEIAZrIgFFDQUgACAGIAH8CgAADAULAkACQCADKAIAIgcgASgCACIIQQN0aiILIAUoAgAiCUECdCIKaigCACIMIAogByAGKAIAIgpBA3RqIgdqKAIAIg1OBEAgDCANRw0BIAtBASAJa0ECdCIJaigCACAHIAlqKAIATg0BCyAAIAg2AgAgAUEEaiEBDAELIAAgCjYCACAGQQRqIQYLIABBBGohACAEIAZHDQALDAMLAkAgBCAFSARAIAEgBUECbSIKQQJ0aiELAkAgACABRgRAIAAhCQwBCyANIAsoAgBBA3RqIgggDmohEiAIIA9qKAIAIRAgASAAa0ECdSEIIAAhCQNAAn8CQCAQIA0gCSAIQQF2IgxBAnRqIhMoAgBBA3RqIhQgD2ooAgAiFUgNACAQIBVGBEAgEigCACAOIBRqKAIASA0BCyATQQRqIQkgCCAMQX9zagwBCyAMCyIIDQALCyAJIABrQQJ1IQwMAQsgBEEBRgRAIAAgCzYCACABIAk2AgAMBAsgACAEQQJtIgxBAnRqIQkCQCABIAJGBEAgASELDAELIA0gCSgCAEEDdGoiCCAOaiESIAggD2ooAgAhECACIAFrQQJ1IQggASELA0ACfwJAIBAgDSALIAhBAXYiCkECdGoiEygCAEEDdGoiFCAPaigCACIVTARAIBAgFUcNASAOIBRqKAIAIBIoAgBODQELIBNBBGohCyAIIApBf3NqDAELIAoLIggNAAsLIAsgAWtBAnUhCgsgEUEIaiAJIAEgCxCRASARKAIIIQgCfyAKIAxqIAUgCmsiBSAEIAxrIgRqSARAIAAgCSAIIAMgDCAKIAYgBxCLAyAIIQAgCwwBCyAIIAsgAiADIAQgBSAGIAcQiwMgCiEFIAwhBCAIIQIgCQshASAFDQEMAgsLIAEgAkYNACAGIQQgASEIA0AgBCAIKAIANgIAIARBBGohBCAIQQRqIgggAkcNAAsgAygCBCELIAMoAgAhCQNAIAAgASIDRgRAA0AgAkEEayICIARBBGsiBCgCADYCACAEIAZHDQAMAwsACwJAIAkoAgAiCiAEQQRrIgcoAgAiCEEDdGoiDCALKAIAIg1BAnQiAWooAgAiDiABIAogA0EEayIBKAIAIgVBA3RqIgpqKAIAIg9IDQAgDiAPRgRAIAxBASANa0ECdCINaigCACAKIA1qKAIASA0BCyAIIQUgAyEBIAchBAsgAkEEayICIAU2AgAgBCAGRw0ACwsgEUEQaiQAC5QHAgl8DH8jAEFAaiIPQRBqQQBBMPwLACAPQQI2AgwgD0KAgICAEDcCBCACQRhsIgIgASgCACIOKAKYAWorAwAhCyAOKAJIIAJqIhQrAwAhCCABKAIEIhIoApgBIRUgEigCSCEWQQAhAUEAIQIDQAJ/IAsgFSAEIA9BBGogAmooAgBBBHRqIhEoAghBGGwiDmorAwBjIAggDiAWaiIOKwMAIgZjIAYgCGEbIAsgFSARKAIEQRhsIhBqKwMAYyAIIBAgFmoiECsDACIJYyAIIAlhG2siGUUEQEQAAAAAAAD4fyEFRAAAAAAAAPh/IQdBAAwBCyARKAIAIRggECsDECEHIBArAwghBQJAIAggCaEiCiAIIAahIgwgCpkgDJljIhAbIAYgCaGjIga9Qv///////////wCDQv/////////3/wBWDQAgDisDCCIJIAWhIgq9Qv///////////wCDQoCAgICAgID4/wBaDQAgDisDECIMIAehIg29Qv///////////wCDQoCAgICAgID4/wBaDQAgByAMIBAbIAYgDaKgIQcgBSAJIBAbIAYgCqKgIQULIBlBACASKAKoASIOIBhBA21BGGxqKwMIIA4gEigCaCAYQQJ0aigCAEEDbUEYbGorAwigRAAAAAAAAAAAZCAUKwMIIgYgBWMgBSAGYRsbCyEOAkAgBb1C////////////AINC//////////f/AFYNAEEAIA5rIA4gES0ADBsgE2ohEyABQQFKBEBBAiEBDAELIAFFIA5FIBdzRXJFBEBBASEBDAELIA9BEGogAUEYbGoiESAHOQMQIBEgBzkDCCARIAU5AwAgAUEBaiEBIA5BAEchFwsgAkEEaiICQQxHDQALAn8gE0UEQEQAAAAAAAD4fyEFQQAMAQsgE0EAIBIoAqgBIANBGGxqKwMQRAAAAAAAAAAAZCAUKwMQIgggDysDICIFIA8rAzgiByAUKwMIIgYgDysDECIJoSILmSAGIA8rAygiBqEiCpljIgEbIAcgBaEiByALIAogARsgBiAJoaMiBqKgIAUgB71C////////////AINCgICAgICAgPj/AFQbIAUgDysDMCAPKwMYob1C////////////AINCgICAgICAgPj/AFQbIAUgBr1C////////////AINCgICAgICAgPj/AFQbIgVjIAUgCGEbGwshASAAIAU5AwggACABNgIAC/wHAw9/A3wDfiMAQdABayIEJAAgBEGgAWpBAEEw/AsAIARB8ABqQQBBMPwLACABKAIAIhAoAlggAkECdGoiBUF4QQQgAkEDb0ECRhtqKAIAIQ8gBSgCACEMIAEoAgQhBSAEQQI2AhAgBEKAgICAEDcCCCAFKAJYIg0gA0EDbCIOQQJ0aiERIAUoAmghEgNAQQEhCQJAIA0gBEEIaiAGaigCACIKIA5qIgtBAnQiB2ooAgAiBSARQQRBCCAKQQFGG0EAIAobQYzpAGooAgBBAnRqKAIAIghIBEAgBSEHIAghBQwBCyAHIBJqKAIAIQtBACEJIAghBwsgBEFAayAKQQR0aiIIIAk6AAwgCCAFNgIIIAggBzYCBCAIIAs2AgAgBkEEaiIGQQxHDQALIAQgDzYCOCAEIAw2AjQgAUEIaiENQQAhBkEAIQdBACEIQQAhCQNAIARBCGogDSAEQTRqIAhqKAIAIgsgAyAEQUBrEIoDAkAgBCsDECITvUL///////////8Ag0L/////////9/8AVg0AIAQoAggiCkEAIAprIAsgDEYbIAlqIQkgBkEBSgRAQQIhBgwBCyAGRSAHIApFc0EBcUVyRQRAQQEhBgwBCyAGQRhsIg4gBEGgAWpqIgUgECgCSCALQRhsaiIHKQMQIhc3AxAgBSAHKQMIIhY3AwggBSAHKQMAIhg3AwAgBSAWNwMQIAUgFzcDCCAEQfAAaiAOaiIFIBY3AxAgBSAYNwMAIAUgEzkDCCAGQQFqIQYgCkEARyEHCyAIQQRqIghBCEcNAAsgBEECNgI8IARCgICAgBA3AjQgAUEQaiEIQQAhBQNAIARBCGogCCACIAwgDyAEQUBrIARBNGogBWooAgBBBHRqIgEoAgAgASgCBCABKAIIEPcEAkAgBCsDECITvUL///////////8Ag0L/////////9/8AVg0AQQAgBCgCCCIDayADIAEtAAwbIAlqIQkgBkEBSgRAQQIhBgwBCyAGRSAHIANFc0EBcUVyRQRAQQEhBgwBCyAGQRhsIgcgBEGgAWpqIgEgEzkDACABIAQrAyAiFDkDCCABIAQrAxgiFTkDECAEQfAAaiAHaiIBIBU5AxAgASAUOQMIIAEgEzkDACABIAQrAyg5AwggBkEBaiEGIANBAEchBwsgBUEEaiIFQQxHDQALAnwgCUUEQEQAAAAAAAD4fyEURAAAAAAAAPh/IRVEAAAAAAAA+H8MAQsgBEEIaiAEQaABaiAEQbgBaiAEQfAAaiAEQYgBahDOASAEKwMQIRUgBCsDGCEUIAQrAwgLIRMgACAVOQMYIAAgFDkDECAAIBM5AwggACAJNgIAIARB0AFqJAALgVYCEX8CfiMAQbABayIFJAAgACAENgKQASAAQQE6AIwBIABBADYChAEgAEIANwJ8IABBADYCdCAAQgA3AmwgAEEANgJkIABCADcCXCAAQQA2AlQgAEIANwJMIABBADYCRCAAQgA3AjwgAEEANgI0IABCADcCLCAAQQA2AiQgAEIANwIcIABBADYCFCAAQgA3AgwgACACNgIEIAAgATYCACAAIANFOgAIIABB/ABqIRUgAEHsAGohEwJAAkACQCABKAJcQQNJDQAgAigCXEEDSQ0AIAEgAhDUBA0BCyATIAEoAkxBABAxIBUgAigCTEEAEDEMAQsgACgCkAEiBwRAIActABANAQsgAEEMaiEGAkACQAJAAkACQAJAAkACQAJAIAAtAAhBAUYEQCAFIAI2AowBIAUgATYCiAEgBSACNgKEASAFIAE2AoABIAUgAjYCfCAFIAE2AnggBUEANgJwIAVCADcCaCAFQQA2AmAgBUIANwJYIAVBADYCUCAFQgA3AkggBSAFQfgAajYCRCABKAJcIQggBSABNgKoAQJAIAIoAowCIgNFDQAgAigC6AEhBCACKALsASEJIAIoAogCIQogBSADNgKgASAFIAo2ApwBIAUgCTYCmAEgBSAENgKUASAFIAVBxABqNgKkASAFIAVBqAFqNgKQASAHBEAgCEUNASAHLQAQQQFxDQFBACEDQQAhBANAIANBAWoiA0GACEYEQEEAIQMgBy0AEA0DCyAFQZABaiAEEIUFIARBAWoiBCAIRw0ACwwBCyAFIAM2AiAgBSAKNgIcIAUgCTYCGCAFIAQ2AhQgBSAFQcQAajYCJCAFIAVBqAFqNgIQIAhFDQBBACEEA0AgBUEQaiAEEIUFIARBAWoiBCAIRw0ACwsCQCAHRQ0AIActABBBAUcNACAFQQA2AjggBUIANwIwIAVBADYCKCAFQgA3AiAgBUEANgIYIAVCADcCEAwJC0EAIQNBACEEAkAgBSgCTCIHRQ0AIAUoAkghCSAHQQN0IggQJyEEIAhFDQAgBCAJIAj8CgAACyAFIAc2AhggBSAHNgIUIAUgBDYCEAJAIAUoAlwiBEUNACAFKAJYIQkgBEECdCIIECchAyAIRQ0AIAMgCSAI/AoAAAsgBSAENgIoIAUgBDYCJCAFIAM2AiBBACEEQQAhAwJAIAUoAmwiCEUNACAFKAJoIQogCEEYbCIJECchAyAJRQ0AIAMgCiAJ/AoAAAsgBUEgaiEKIAUgCDYCOCAFIAg2AjQgBSADNgIwIAVBADYCmAEgBUIANwKQASAFQZABaiAHECUgBSAHNgKUASAFQTBqIQsgBSgCkAEhCCAHRQ0BA0AgCCAEQQJ0aiAENgIAIARBAWoiBCAHRw0ACyAFKAKUASEDIAVBADYCQCAIIANBAnRqIQcgBSAFQUBrNgKsASAFIAVBEGo2AqgBIANBgQFIDQYgAyEEA0AgBEECdBBQIglFBEAgBEEBdiIEDQEMCAsLIAggByAFQagBaiADIAkgBBDTASAJECIMBwsgBSACNgKMASAFIAE2AogBIAUgAjYChAEgBSABNgKAASAFIAI2AnwgBSABNgJ4IAVBADYCcCAFQgA3AmggBUEANgJgIAVCADcCWCAFQQA2AlAgBUIANwJIIAUgBUH4AGo2AkQgASgCXCEIIAUgATYCqAECQCACKAKMAiIDRQ0AIAIoAugBIQQgAigC7AEhCSACKAKIAiEKIAUgAzYCoAEgBSAKNgKcASAFIAk2ApgBIAUgBDYClAEgBSAFQcQAajYCpAEgBSAFQagBajYCkAEgBwRAIAhFDQEgBy0AEEEBcQ0BQQAhA0EAIQQDQCADQQFqIgNBgAhGBEBBACEDIActABANAwsgBUGQAWogBBCEBSAEQQFqIgQgCEcNAAsMAQsgBSADNgIgIAUgCjYCHCAFIAk2AhggBSAENgIUIAUgBUHEAGo2AiQgBSAFQagBajYCECAIRQ0AQQAhBANAIAVBEGogBBCEBSAEQQFqIgQgCEcNAAsLAkAgB0UNACAHLQAQQQFHDQAgBUEANgI4IAVCADcCMCAFQQA2AiggBUIANwIgIAVBADYCGCAFQgA3AhAMBQtBACEDQQAhBAJAIAUoAkwiB0UNACAFKAJIIQkgB0EDdCIIECchBCAIRQ0AIAQgCSAI/AoAAAsgBSAHNgIYIAUgBzYCFCAFIAQ2AhACQCAFKAJcIgRFDQAgBSgCWCEJIARBAnQiCBAnIQMgCEUNACADIAkgCPwKAAALIAUgBDYCKCAFIAQ2AiQgBSADNgIgQQAhBEEAIQMCQCAFKAJsIghFDQAgBSgCaCEKIAhBGGwiCRAnIQMgCUUNACADIAogCfwKAAALIAVBIGohCiAFIAg2AjggBSAINgI0IAUgAzYCMCAFQQA2ApgBIAVCADcCkAEgBUGQAWogBxAlIAUgBzYClAEgBUEwaiELIAUoApABIQggB0UNAQNAIAggBEECdGogBDYCACAEQQFqIgQgB0cNAAsgBSgClAEhAyAFQQA2AkAgCCADQQJ0aiEHIAUgBUFAazYCrAEgBSAFQRBqNgKoASADQYEBSA0CIAMhBANAIARBAnQQUCIJRQRAIARBAXYiBA0BDAQLCyAIIAcgBUGoAWogAyAJIAQQ0gEgCRAiDAMLQQAhAyAFQQA2AkAgBSAFQUBrNgKsASAFIAVBEGo2AqgBIAghBwwEC0EAIQMgBUEANgJAIAUgBUFAazYCrAEgBSAFQRBqNgKoASAIIQcLIAggByAFQagBaiADQQBBABDSAQsgBUEQaiAFQZABaiIDEKACIAogAxCmASALIAMQpQEgBSgCkAEiA0UNACADECILIAUoAmgiAwRAIAMQIgsgBUEANgJwIAVCADcCaCAFKAJYIgMEQCADECILIAVBADYCYCAFQgA3AlggBSgCSCIDRQ0DIAMQIgwDCyAIIAcgBUGoAWogA0EAQQAQ0wELIAVBEGogBUGQAWoiAxCgAiAKIAMQpgEgCyADEKUBIAUoApABIgNFDQAgAxAiCyAFKAJoIgMEQCADECILIAVBADYCcCAFQgA3AmggBSgCWCIDBEAgAxAiCyAFQQA2AmAgBUIANwJYIAUoAkgiA0UNACADECILAkAgBiAFQRBqRwRAIAYoAgAiAwRAIAMQIgsgACAFKAIQNgIMIAAgBSgCFDYCECAAIAUoAhg2AhQgBUEANgIYIAVCADcCECAAKAIcIgMEQCADECILIAAgBSgCIDYCHCAAIAUoAiQ2AiAgACAFKAIoNgIkIAVBADYCKCAFQgA3AiAgACgCLCIDBEAgAxAiCyAAIAUoAjA2AiwgACAFKAI0NgIwIAAgBSgCODYCNAwBCyAFKAIwIgNFDQAgAxAiCyAFQQA2AjggBUIANwIwIAUoAiAiAwRAIAMQIgsgBUEANgIoIAVCADcCICAFKAIQIgMEQCADECILIAAoApABIgcEQCAHLQAQDQELIABBPGohBgJAAkACQAJAAkACQAJAAkACQCAALQAIQQFGBEAgBSACNgKMASAFIAE2AogBIAUgATYChAEgBSACNgKAASAFIAE2AnwgBSACNgJ4IAVBADYCcCAFQgA3AmggBUEANgJgIAVCADcCWCAFQQA2AlAgBUIANwJIIAUgBUH4AGo2AkQgAigCXCEIIAUgAjYCqAECQCABKAKMAiIDRQ0AIAEoAugBIQQgASgC7AEhCSABKAKIAiEKIAUgAzYCoAEgBSAKNgKcASAFIAk2ApgBIAUgBDYClAEgBSAFQcQAajYCpAEgBSAFQagBajYCkAEgBwRAIAhFDQEgBy0AEEEBcQ0BQQAhA0EAIQQDQCADQQFqIgNBgAhGBEBBACEDIActABANAwsgBUGQAWogBBCDBSAEQQFqIgQgCEcNAAsMAQsgBSADNgIgIAUgCjYCHCAFIAk2AhggBSAENgIUIAUgBUHEAGo2AiQgBSAFQagBajYCECAIRQ0AQQAhBANAIAVBEGogBBCDBSAEQQFqIgQgCEcNAAsLAkAgB0UNACAHLQAQQQFHDQAgBUEANgI4IAVCADcCMCAFQQA2AiggBUIANwIgIAVBADYCGCAFQgA3AhAMCQtBACEDQQAhBAJAIAUoAkwiB0UNACAFKAJIIQkgB0EDdCIIECchBCAIRQ0AIAQgCSAI/AoAAAsgBSAHNgIYIAUgBzYCFCAFIAQ2AhACQCAFKAJcIgRFDQAgBSgCWCEJIARBAnQiCBAnIQMgCEUNACADIAkgCPwKAAALIAUgBDYCKCAFIAQ2AiQgBSADNgIgQQAhBEEAIQMCQCAFKAJsIghFDQAgBSgCaCEKIAhBGGwiCRAnIQMgCUUNACADIAogCfwKAAALIAVBIGohCiAFIAg2AjggBSAINgI0IAUgAzYCMCAFQQA2ApgBIAVCADcCkAEgBUGQAWogBxAlIAUgBzYClAEgBUEwaiELIAUoApABIQggB0UNAQNAIAggBEECdGogBDYCACAEQQFqIgQgB0cNAAsgBSgClAEhAyAFQQE2AkAgCCADQQJ0aiEHIAUgBUFAazYCrAEgBSAFQRBqNgKoASADQYEBSA0GIAMhBANAIARBAnQQUCIJRQRAIARBAXYiBA0BDAgLCyAIIAcgBUGoAWogAyAJIAQQ0QEgCRAiDAcLIAUgAjYCjAEgBSABNgKIASAFIAE2AoQBIAUgAjYCgAEgBSABNgJ8IAUgAjYCeCAFQQA2AnAgBUIANwJoIAVBADYCYCAFQgA3AlggBUEANgJQIAVCADcCSCAFIAVB+ABqNgJEIAIoAlwhCCAFIAI2AqgBAkAgASgCjAIiA0UNACABKALoASEEIAEoAuwBIQkgASgCiAIhCiAFIAM2AqABIAUgCjYCnAEgBSAJNgKYASAFIAQ2ApQBIAUgBUHEAGo2AqQBIAUgBUGoAWo2ApABIAcEQCAIRQ0BIActABBBAXENAUEAIQNBACEEA0AgA0EBaiIDQYAIRgRAQQAhAyAHLQAQDQMLIAVBkAFqIAQQggUgBEEBaiIEIAhHDQALDAELIAUgAzYCICAFIAo2AhwgBSAJNgIYIAUgBDYCFCAFIAVBxABqNgIkIAUgBUGoAWo2AhAgCEUNAEEAIQQDQCAFQRBqIAQQggUgBEEBaiIEIAhHDQALCwJAIAdFDQAgBy0AEEEBRw0AIAVBADYCOCAFQgA3AjAgBUEANgIoIAVCADcCICAFQQA2AhggBUIANwIQDAULQQAhA0EAIQQCQCAFKAJMIgdFDQAgBSgCSCEJIAdBA3QiCBAnIQQgCEUNACAEIAkgCPwKAAALIAUgBzYCGCAFIAc2AhQgBSAENgIQAkAgBSgCXCIERQ0AIAUoAlghCSAEQQJ0IggQJyEDIAhFDQAgAyAJIAj8CgAACyAFIAQ2AiggBSAENgIkIAUgAzYCIEEAIQRBACEDAkAgBSgCbCIIRQ0AIAUoAmghCiAIQRhsIgkQJyEDIAlFDQAgAyAKIAn8CgAACyAFQSBqIQogBSAINgI4IAUgCDYCNCAFIAM2AjAgBUEANgKYASAFQgA3ApABIAVBkAFqIAcQJSAFIAc2ApQBIAVBMGohCyAFKAKQASEIIAdFDQEDQCAIIARBAnRqIAQ2AgAgBEEBaiIEIAdHDQALIAUoApQBIQMgBUEBNgJAIAggA0ECdGohByAFIAVBQGs2AqwBIAUgBUEQajYCqAEgA0GBAUgNAiADIQQDQCAEQQJ0EFAiCUUEQCAEQQF2IgQNAQwECwsgCCAHIAVBqAFqIAMgCSAEENABIAkQIgwDCyAFQQE2AkAgBSAFQUBrNgKsASAFIAVBEGo2AqgBQQAhAyAIIQcMBAsgBUEBNgJAIAUgBUFAazYCrAEgBSAFQRBqNgKoAUEAIQMgCCEHCyAIIAcgBUGoAWogA0EAQQAQ0AELIAVBEGogBUGQAWoiAxCgAiAKIAMQpgEgCyADEKUBIAUoApABIgNFDQAgAxAiCyAFKAJoIgMEQCADECILIAVBADYCcCAFQgA3AmggBSgCWCIDBEAgAxAiCyAFQQA2AmAgBUIANwJYIAUoAkgiA0UNAyADECIMAwsgCCAHIAVBqAFqIANBAEEAENEBCyAFQRBqIAVBkAFqIgMQoAIgCiADEKYBIAsgAxClASAFKAKQASIDRQ0AIAMQIgsgBSgCaCIDBEAgAxAiCyAFQQA2AnAgBUIANwJoIAUoAlgiAwRAIAMQIgsgBUEANgJgIAVCADcCWCAFKAJIIgNFDQAgAxAiCwJAIAYgBUEQakcEQCAGKAIAIgMEQCADECILIAAgBSgCEDYCPCAAIAUoAhQ2AkAgACAFKAIYNgJEIAVBADYCGCAFQgA3AhAgACgCTCIDBEAgAxAiCyAAIAUoAiA2AkwgACAFKAIkNgJQIAAgBSgCKDYCVCAFQQA2AiggBUIANwIgIAAoAlwiAwRAIAMQIgsgACAFKAIwNgJcIAAgBSgCNDYCYCAAIAUoAjg2AmQMAQsgBSgCMCIDRQ0AIAMQIgsgBUEANgI4IAVCADcCMCAFKAIgIgMEQCADECILIAVBADYCKCAFQgA3AiAgBSgCECIDBEAgAxAiCwJAIAAoAiBBAE4EQCAAKAJQQQBODQELIABBADoAjAEMAQsgACgCkAEiCgRAIAotABANAQsgBSAAKAIMNgIIIAUgACgCEDYCDCAFQcQAaiELIAAtAAghA0EAIQkjAEGQAWsiBiQAIAUoAgwhByAFKAIIIQgCQAJAAkACQCADBEAgBkHMAGogASgCTCIDEJYBIQwgAwRAIAOtIRcDQCAMKAIAIBanQQN0aiAWNwMAIBZCAXwiFiAXUg0ACwsgASgCXCEOAkACQAJAIAoEQCAKLQAQIA5Fcg0CIAggB0EDdGohEgNAIA1BAWoiDUGACEYEQEEAIQ0gCi0AEA0ECwJAIAEoAlggCUECdGoiAygCACIPIANBeEEEIAlBA3BBAkYbaigCACIQTg0AIAghAyAHIgQEQANAIAMgBEEBdiIRQQN0aiIUQQhqIAMgFCgCACAJSCIUGyEDIAQgEUF/c2ogESAUGyIEDQALCyADIBJHBEAgAygCACAJRg0BCyAMIA8gEBBfCyAJQQFqIgkgDkcNAAsMAQsgDkUNAiAIIAdBA3RqIREDQAJAIAEoAlggCUECdGoiAygCACISIANBeEEEIAlBA3BBAkYbaigCACIPTg0AIAghAyAHIgQEQANAIAMgBEEBdiINQQN0aiIQQQhqIAMgECgCACAJSCIQGyEDIAQgDUF/c2ogDSAQGyIEDQALCyADIBFHBEAgAygCACAJRg0BCyAMIBIgDxBfCyAJQQFqIgkgDkcNAAsLIApFDQELIAotABBBAUcNACALQQA2AgggC0IANwIADAQLIAZCADcDQCAGQgA3AzggBkGAgID8AzYCSCABKAJMBEBBACEDA0AgBiAMIAMQTzYCYCAGQfgAaiAGQThqIAZB4ABqIgQgBBDPASADQQFqIgMgASgCTEkNAAsLAkAgCkUNACAKLQAQRQ0AIAtBADYCCCALQgA3AgAMAwsgBkEANgIwIAZCADcCKCAGQShqIAYoAkQQJSAGKAJAIgRFDQEgBigCLCEDA0AgBCgCCCEHAkAgBigCMCIIIANNBEAgBkEoaiAIQQF0QYABIAgbECUgBigCKCAGKAIsIgNBAnRqIAc2AgAMAQsgBigCKCADQQJ0aiAHNgIACyAGIANBAWoiAzYCLCAEKAIAIgQNAAsMAQsgBkHMAGogASgCTCIDEJYBIQwgAwRAIAOtIRcDQCAMKAIAIBanQQN0aiAWNwMAIBZCAXwiFiAXUg0ACwsgASgCXCEOAkACQAJAAkAgCgRAIAotABAgDkVyDQIgCCAHQQN0aiESA0AgDUEBaiINQYAIRgRAQQAhDSAKLQAQDQQLAkAgASgCWCAJQQJ0aiIDKAIAIg8gA0F4QQQgCUEDcEECRhtqKAIAIhBODQAgCCEDIAciBARAA0AgAyAEQQF2IhFBA3RqIhRBCGogAyAUKAIAIAlIIhQbIQMgBCARQX9zaiARIBQbIgQNAAsLIAMgEkcEQCADKAIAIAlGDQELIAwgDyAQEF8LIAlBAWoiCSAORw0ACwwBCyAORQ0CIAggB0EDdGohEQNAAkAgASgCWCAJQQJ0aiIDKAIAIhIgA0F4QQQgCUEDcEECRhtqKAIAIg9ODQAgCCEDIAciBARAA0AgAyAEQQF2Ig1BA3RqIhBBCGogAyAQKAIAIAlIIhAbIQMgBCANQX9zaiANIBAbIgQNAAsLIAMgEUcEQCADKAIAIAlGDQELIAwgEiAPEF8LIAlBAWoiCSAORw0ACwsgCkUNAQsgCi0AEEEBRw0AIAtBADYCCCALQgA3AgAMAQsgBkIANwNAIAZCADcDOCAGQYCAgPwDNgJIIAEoAkwEQEEAIQMDQCAGIAwgAxBPNgJgIAZB+ABqIAZBOGogBkHgAGoiBCAEEM8BIANBAWoiAyABKAJMSQ0ACwsCQAJAIApFDQAgCi0AEEUNACALQQA2AgggC0IANwIADAELIAZBADYCMCAGQgA3AiggBkEoaiAGKAJEECUgBigCQCIEBEAgBigCLCEDA0AgBCgCCCEHAkAgBigCMCIIIANNBEAgBkEoaiAIQQF0QYABIAgbECUgBigCKCAGKAIsIgNBAnRqIAc2AgAMAQsgBigCKCADQQJ0aiAHNgIACyAGIANBAWoiAzYCLCAEKAIAIgQNAAsLIAEoAkwhAyAGQQA2AiAgBkIANwIYIAZBGGoiBCADQQAQMSAGIAE2AhAgBiACNgIUIAYgBDYCDCAGIAZBKGoiAzYCCCAGIAZBEGo2AgQgBiAGQQRqNgIAIAYoAiwhByAGIAE2AlggBiADNgJcAkAgAigCjAIiA0UNACACKALoASEEIAIoAuwBIQggAigCiAIhCSAGIAM2AnAgBiAJNgJsIAYgCDYCaCAGIAQ2AmQgBiAGNgJ0IAYgBkHYAGo2AmAgCgRAIAdFDQEgCi0AEEEBcQ0BQQAhBEEAIQMDQCAEQQFqIgRBgAhGBEBBACEEIAotABANAwsgBkHgAGogAxCABSADQQFqIgMgB0cNAAsMAQsgBiADNgKIASAGIAk2AoQBIAYgCDYCgAEgBiAENgJ8IAYgBjYCjAEgBiAGQdgAajYCeCAHRQ0AQQAhAwNAIAZB+ABqIAMQgAUgA0EBaiIDIAdHDQALCwJAAkACQAJAAkAgCgRAIAotABANBCAKLQAQDQIgBigCHCIHRQ0CQQAhBEEAIQMDQCAEQQFqIgRBgAhGBEBBACEEIAotABANBAsgAyAMIAMQTyIIRwRAIAYoAhgiCSADQQJ0aiAJIAhBAnRqKAIANgIACyADQQFqIgMgB0cNAAsMAQsgBigCHCIERQ0CQQAhAwNAIAMgDCADEE8iB0cEQCAGKAIYIgggA0ECdGogCCAHQQJ0aigCADYCAAsgA0EBaiIDIARHDQALCyAKRQ0BCyAKLQAQDQELIAsgBigCGDYCACALIAYoAhw2AgQgCyAGKAIgNgIIDAELIAtBADYCCCALQgA3AgAgBigCGCIDRQ0AIAMQIgsgBigCKCIDRQ0AIAMQIgsgBkE4ahCVAQsgDCgCACIDRQ0DIAwgAzYCBCAMKAIIGiADECIMAwsgASgCTCEDIAZBADYCICAGQgA3AhggBkEYaiIEIANBABAxIAYgATYCECAGIAI2AhQgBiAENgIMIAYgBkEoaiIDNgIIIAYgBkEQajYCBCAGIAZBBGo2AgAgBigCLCEHIAYgATYCWCAGIAM2AlwCQCACKAKMAiIDRQ0AIAIoAugBIQQgAigC7AEhCCACKAKIAiEJIAYgAzYCcCAGIAk2AmwgBiAINgJoIAYgBDYCZCAGIAY2AnQgBiAGQdgAajYCYCAKBEAgB0UNASAKLQAQQQFxDQFBACEEQQAhAwNAIARBAWoiBEGACEYEQEEAIQQgCi0AEA0DCyAGQeAAaiADEP8EIANBAWoiAyAHRw0ACwwBCyAGIAM2AogBIAYgCTYChAEgBiAINgKAASAGIAQ2AnwgBiAGNgKMASAGIAZB2ABqNgJ4IAdFDQBBACEDA0AgBkH4AGogAxD/BCADQQFqIgMgB0cNAAsLAkACQAJAAkACQCAKBEAgCi0AEA0EIAotABANAiAGKAIcIgdFDQJBACEEQQAhAwNAIARBAWoiBEGACEYEQEEAIQQgCi0AEA0ECyADIAwgAxBPIghHBEAgBigCGCIJIANBAnRqIAkgCEECdGooAgA2AgALIANBAWoiAyAHRw0ACwwBCyAGKAIcIgRFDQJBACEDA0AgAyAMIAMQTyIHRwRAIAYoAhgiCCADQQJ0aiAIIAdBAnRqKAIANgIACyADQQFqIgMgBEcNAAsLIApFDQELIAotABANAQsgCyAGKAIYNgIAIAsgBigCHDYCBCALIAYoAiA2AggMAQsgC0EANgIIIAtCADcCACAGKAIYIgNFDQAgAxAiCyAGKAIoIgNFDQAgAxAiCyAGQThqEJUBCyAMKAIAIgNFDQAgDCADNgIEIAwoAggaIAMQIgsgBkGQAWokACATIAsQgQUgBSgCRCIDBEAgAxAiCyAAKAKQASIKBEAgCi0AEA0BCyAFIAAoAjw2AgAgBSAAKAJANgIEIAVBxABqIQsgASEIIAIhByAALQAIIQFBACEJQQAhDUIAIRYjAEGQAWsiBiQAIAUoAgQhAyAFKAIAIQQCQAJAAkACQCABBEAgBkHMAGogBygCTCIBEJYBIQwgAQRAIAGtIRcDQCAMKAIAIBanQQN0aiAWNwMAIBZCAXwiFiAXUg0ACwsgBygCXCEOAkACQAJAIAoEQCAKLQAQIA5Fcg0CIAQgA0EDdGohEQNAIA1BAWoiDUGACEYEQEEAIQ0gCi0AEA0ECwJAIAcoAlggCUECdGoiASgCACISIAFBeEEEIAlBA3BBAkYbaigCACIPTg0AIAQhASADIgIEQANAIAEgAkEBdiITQQN0aiIQQQhqIAEgECgCBCAJSCIQGyEBIAIgE0F/c2ogEyAQGyICDQALCyABIBFHBEAgASgCBCAJRg0BCyAMIBIgDxBfCyAJQQFqIgkgDkcNAAsMAQsgDkUNAiAEIANBA3RqIRMDQAJAIAcoAlggCUECdGoiASgCACIRIAFBeEEEIAlBA3BBAkYbaigCACISTg0AIAQhASADIgIEQANAIAEgAkEBdiINQQN0aiIPQQhqIAEgDygCBCAJSCIPGyEBIAIgDUF/c2ogDSAPGyICDQALCyABIBNHBEAgASgCBCAJRg0BCyAMIBEgEhBfCyAJQQFqIgkgDkcNAAsLIApFDQELIAotABBBAUcNACALQQA2AgggC0IANwIADAQLIAZCADcDQCAGQgA3AzggBkGAgID8AzYCSCAHKAJMBEBBACEBA0AgBiAMIAEQTzYCYCAGQfgAaiAGQThqIAZB4ABqIgIgAhDPASABQQFqIgEgBygCTEkNAAsLAkAgCkUNACAKLQAQRQ0AIAtBADYCCCALQgA3AgAMAwsgBkEANgIwIAZCADcCKCAGQShqIAYoAkQQJSAGKAJAIgJFDQEgBigCLCEBA0AgAigCCCEDAkAgBigCMCIEIAFNBEAgBkEoaiAEQQF0QYABIAQbECUgBigCKCAGKAIsIgFBAnRqIAM2AgAMAQsgBigCKCABQQJ0aiADNgIACyAGIAFBAWoiATYCLCACKAIAIgINAAsMAQsgBkHMAGogBygCTCIBEJYBIQwgAQRAIAGtIRcDQCAMKAIAIBanQQN0aiAWNwMAIBZCAXwiFiAXUg0ACwsgBygCXCEOAkACQAJAAkAgCgRAIAotABAgDkVyDQIgBCADQQN0aiERA0AgDUEBaiINQYAIRgRAQQAhDSAKLQAQDQQLAkAgBygCWCAJQQJ0aiIBKAIAIhIgAUF4QQQgCUEDcEECRhtqKAIAIg9ODQAgBCEBIAMiAgRAA0AgASACQQF2IhNBA3RqIhBBCGogASAQKAIEIAlIIhAbIQEgAiATQX9zaiATIBAbIgINAAsLIAEgEUcEQCABKAIEIAlGDQELIAwgEiAPEF8LIAlBAWoiCSAORw0ACwwBCyAORQ0CIAQgA0EDdGohEwNAAkAgBygCWCAJQQJ0aiIBKAIAIhEgAUF4QQQgCUEDcEECRhtqKAIAIhJODQAgBCEBIAMiAgRAA0AgASACQQF2Ig1BA3RqIg9BCGogASAPKAIEIAlIIg8bIQEgAiANQX9zaiANIA8bIgINAAsLIAEgE0cEQCABKAIEIAlGDQELIAwgESASEF8LIAlBAWoiCSAORw0ACwsgCkUNAQsgCi0AEEEBRw0AIAtBADYCCCALQgA3AgAMAQsgBkIANwNAIAZCADcDOCAGQYCAgPwDNgJIIAcoAkwEQEEAIQEDQCAGIAwgARBPNgJgIAZB+ABqIAZBOGogBkHgAGoiAiACEM8BIAFBAWoiASAHKAJMSQ0ACwsCQAJAIApFDQAgCi0AEEUNACALQQA2AgggC0IANwIADAELIAZBADYCMCAGQgA3AiggBkEoaiAGKAJEECUgBigCQCICBEAgBigCLCEBA0AgAigCCCEDAkAgBigCMCIEIAFNBEAgBkEoaiAEQQF0QYABIAQbECUgBigCKCAGKAIsIgFBAnRqIAM2AgAMAQsgBigCKCABQQJ0aiADNgIACyAGIAFBAWoiATYCLCACKAIAIgINAAsLIAcoAkwhASAGQQA2AiAgBkIANwIYIAZBGGoiAiABQQAQMSAGIAc2AhAgBiAINgIUIAYgAjYCDCAGIAZBKGoiATYCCCAGIAZBEGo2AgQgBiAGQQRqNgIAIAYoAiwhAyAGIAc2AlggBiABNgJcAkAgCCgCjAIiAUUNACAIKALoASECIAgoAuwBIQQgCCgCiAIhByAGIAE2AnAgBiAHNgJsIAYgBDYCaCAGIAI2AmQgBiAGNgJ0IAYgBkHYAGo2AmAgCgRAIANFDQEgCi0AEEEBcQ0BQQAhAkEAIQEDQCACQQFqIgJBgAhGBEBBACECIAotABANAwsgBkHgAGogARD+BCABQQFqIgEgA0cNAAsMAQsgBiABNgKIASAGIAc2AoQBIAYgBDYCgAEgBiACNgJ8IAYgBjYCjAEgBiAGQdgAajYCeCADRQ0AQQAhAQNAIAZB+ABqIAEQ/gQgAUEBaiIBIANHDQALCwJAAkACQAJAAkAgCgRAIAotABANBCAKLQAQDQIgBigCHCIDRQ0CQQAhAkEAIQEDQCACQQFqIgJBgAhGBEBBACECIAotABANBAsgASAMIAEQTyIERwRAIAYoAhgiByABQQJ0aiAHIARBAnRqKAIANgIACyABQQFqIgEgA0cNAAsMAQsgBigCHCICRQ0CQQAhAQNAIAEgDCABEE8iA0cEQCAGKAIYIgQgAUECdGogBCADQQJ0aigCADYCAAsgAUEBaiIBIAJHDQALCyAKRQ0BCyAKLQAQDQELIAsgBigCGDYCACALIAYoAhw2AgQgCyAGKAIgNgIIDAELIAtBADYCCCALQgA3AgAgBigCGCIBRQ0AIAEQIgsgBigCKCIBRQ0AIAEQIgsgBkE4ahCVAQsgDCgCACIBRQ0DIAwgATYCBCAMKAIIGiABECIMAwsgBygCTCEBIAZBADYCICAGQgA3AhggBkEYaiICIAFBABAxIAYgBzYCECAGIAg2AhQgBiACNgIMIAYgBkEoaiIBNgIIIAYgBkEQajYCBCAGIAZBBGo2AgAgBigCLCEDIAYgBzYCWCAGIAE2AlwCQCAIKAKMAiIBRQ0AIAgoAugBIQIgCCgC7AEhBCAIKAKIAiEHIAYgATYCcCAGIAc2AmwgBiAENgJoIAYgAjYCZCAGIAY2AnQgBiAGQdgAajYCYCAKBEAgA0UNASAKLQAQQQFxDQFBACECQQAhAQNAIAJBAWoiAkGACEYEQEEAIQIgCi0AEA0DCyAGQeAAaiABEP0EIAFBAWoiASADRw0ACwwBCyAGIAE2AogBIAYgBzYChAEgBiAENgKAASAGIAI2AnwgBiAGNgKMASAGIAZB2ABqNgJ4IANFDQBBACEBA0AgBkH4AGogARD9BCABQQFqIgEgA0cNAAsLAkACQAJAAkACQCAKBEAgCi0AEA0EIAotABANAiAGKAIcIgNFDQJBACECQQAhAQNAIAJBAWoiAkGACEYEQEEAIQIgCi0AEA0ECyABIAwgARBPIgRHBEAgBigCGCIHIAFBAnRqIAcgBEECdGooAgA2AgALIAFBAWoiASADRw0ACwwBCyAGKAIcIgJFDQJBACEBA0AgASAMIAEQTyIDRwRAIAYoAhgiBCABQQJ0aiAEIANBAnRqKAIANgIACyABQQFqIgEgAkcNAAsLIApFDQELIAotABANAQsgCyAGKAIYNgIAIAsgBigCHDYCBCALIAYoAiA2AggMAQsgC0EANgIIIAtCADcCACAGKAIYIgFFDQAgARAiCyAGKAIoIgFFDQAgARAiCyAGQThqEJUBCyAMKAIAIgFFDQAgDCABNgIEIAwoAggaIAEQIgsgBkGQAWokACAVIAsQgQUgBSgCRCIBRQ0AIAEQIgsgBUGwAWokACAACzQBAX8gAUGAgICAAU8EQBAmAAsgACABQQR0IgIQIyIBNgIEIAAgATYCACAAIAEgAmo2AggLNAEBfyABQYCAgIACTwRAECYACyAAIAFBA3QiAhAjIgE2AgQgACABNgIAIAAgASACajYCCAtIAQF/IABBADYCCCAAQgA3AgAgAQRAIAAgARDyASAAKAIEIgIgAUEYbGohAQNAIAIQ6wFBGGoiAiABRw0ACyAAIAE2AgQLIAALRAEBfyAAQQA2AgggAEIANwIAIAEEQCAAIAEQjwMgACgCBCECIAFBBHQiAQRAIAJBACAB/AsACyAAIAEgAmo2AgQLIAAL5SEDFH8BfAx9IwBBgAFrIgQkACAAQgA3A0AgAEKAgICAgICA+L9/NwM4IABCgICAgICAgPi/fzcDMCAAQoCAgICAgIB4NwMoIABCgICAgICAgHg3AyAgAEKAgICAgICAeDcDGCAAQoCAgICAgID4/wA3AxAgAEKAgICAgICA+P8ANwMIIABCgICAgICAgPj/ADcDACAAQgA3A0ggAEEANgJQIABB2ABqEKECGiAAQgA3A9ABIABBfzYCyAEgAEEANgLAASAAQgA3A7gBIABBADYCsAEgAEIANwOoASAAQQA2AqABIABCADcDmAEgAEEANgKQASAAQgA3A4gBIABBADYCkAIgAEIANwOIAiAAQQA2AoACIABCADcD+AEgAEEANgLwASAAQgA3A+gBIABBADYC4AEgAEIANwPYASAAIABB0AFqNgLMAQJAAkAgAkUNACACLQAQQQFHDQAgAEEOECwMAQsgASgCFCABKAIQa0ECdSIRQQNuIg8gASgCCCIHIAEoAgQiBWtBAnUgASgCACIDbiINckUEQCAAQQAQLAwBCyARQQtLIA1BBE9xRQRAIABBAhAsDAELIANBAk0EQCAAQQUQLAwBCyABKAIgIgwgASgCHCIKayABKAIsIAEoAihrRwRAIABBBhAsDAELAkAgASgCTCIDIAEoAlAiBkYEQCABKAJEIQggASgCQCEJDAELIAEoAkQiCCABKAJAIglrQQJ2QQxsIAYgA2tBAnVGDQAgAEEIECwMAQsCQCAIIAlGDQAgASgCNCILIAEoAjgiDkYNACAOIAtrQQJ1IgsgCCAJa0ECdSIIQQFqRiAIIAtGcg0AIABBCRAsDAELIAEoAmQiCCABKAJoIglGIAkgCGtBAnUgD0ZyRQRAIABBChAsDAELAkAgBSAHRg0AA0AgBSgCAEH/////B3FBgICA/AdJBEAgByAFQQRqIgVHDQEMAgsLIABBARAsDAELAkAgAyAGRg0AA0AgAygCAEH/////B3FBgICA/AdJBEAgBiADQQRqIgNHDQEMAgsLIABBCxAsDAELAkAgASgCcCIFIAEoAnQiA0YNAANAIAUoAgBB/////wdxQYCAgPwHSQRAIAMgBUEEaiIFRw0BDAILCyAAQQsQLAwBC0EAIQUgBEEANgJ8IARCADcCdAJAAkAgCiAMRg0AIARB9ABqIA0QfSAEKAJ0IgYgBCgCeCIHRwRAIAYhAwNAIAMgBTYCACAFQQFqIQUgA0EEaiIDIAdHDQALCyABKAIgIgcgASgCHCIDRg0AIAcgA2tBAnUhByABKAIoIQhBACEFA0ACQCANIAMgBUECdCIJaigCACIMSwRAIAggCWooAgAiCSANSQ0BCyAAQQcQLAwDCyAGIAxBAnRqIAk2AgAgBUEBaiIFIAdHDQALCyAAIAEoAgAiB0EDayIKNgJAIABBiAFqIgMoAgQhBiADIAEoAgggASgCBGtBAnUgB24gCmwiBxBEIAMgBzYCBCAGQRFJIAYgB0EBdE1yRQRAIAMQlAELIAAgASoCfLs5AzggAEHIAGogASgCCCABKAIEa0ECdSABKAIAbhCIBSABKAIIIAEoAgQiCWtBAnUiAyABKAIAIgZuIQwgAyAGTwRAIAAoAogBIQsgACgCSCEOQQAhAwNAIARCgICAgBA3AmQgDiADQRhsaiEQIARBAjYCbCAJIAMgBmxBAnRqIQdBACEFA0AgEEEIQRAgBEHkAGogBWooAgAiCEEBRhtBACAIG2ogByAIQQJ0aioCALs5AwAgBUEEaiIFQQxHDQALIAoEQCAHQQxqIQcgCyADIApsQQN0aiEIQQAhBQNAIAggBUEDdGogByAFQQJ0aioCALs5AwAgBUEBaiIFIApHDQALCyADQQFqIgMgDEkNAAsLIABBuAFqIgMoAgQhBiADIAEoAnQgASgCcGtBAnVBAnYiBxBVIAMgBzYCBCAGQRFJIAYgB0EBdE1yRQRAIAMQkwELIAAoArwBIgwEQCAAKAK4ASELIAEoAnAhDkEAIQgDQCAEQoKAgIAwNwJsIARCgICAgBA3AmQgDiAIQQR0aiEQIAsgCEEFdGoiBkEIaiEHQQAhBQNAIBAgBEHkAGogBWooAgAiCUECdGoqAgC7IRcgBiEDAkACQAJAIAkOAgIAAQsgByEDDAELIAZBEEEYIAlBAkYbaiEDCyADIBc5AwAgBUEEaiIFQRBHDQALIAhBAWoiCCAMRw0ACwsgBEEANgJsIARCADcCZCAEQeQAaiIDKAIEIQYgAyABKAIUIAEoAhBrQQJ1QQNuIgcQOSADIAc2AgQgBkERSSAGIAdBAXRNckUEQCADEIMBCyABQUBrIQsgBEHYAGogAUE0ahBgIQcgASgCFCABKAIQa0ECdSEDAkAgBygCACIGIAcoAgQiBUYEQCAEIAM2AjwgBEEANgI4IARBOGohBiAEQUBrIQgCQCAHKAIIIAcoAgAiCWtBAnVBAk8EQCAHKAIEIgMgCWsiDEECdUECSQRAIAYgDGohBSADIAlHBEAgDARAIAkgBiAM/AoAAAsgBygCBCEDCyADIQYgBSAIRwRAA0AgBiAFKAIANgIAIAZBBGohBiAFQQRqIgUgCEcNAAsLIAcgAyAGIANrajYCBAwCCyAIIAZrIgNFIAYgCEZyRQRAIAkgBiAD/AoAAAsgByADIAlqNgIEDAELIAcQRSAHQf////8DQQIgBygCCCAHKAIAayIDQQF1IgUgBUECTRsgA0H8////B08bEPEBIAcoAgQhBSAGIAhHBEADQCAFIAYoAgA2AgAgBUEEaiEFIAZBBGoiBiAIRw0ACwsgByAFNgIECwwBCyAFIAZrIgYgASgCRCABKAJAa0YEQCAEIAM2AjggByAEQThqED0MAQsgBkEERw0AIAQgAzYCOCAHIARBOGoQPQsgBEEBIAEoAkQgASgCQGtBAnUiAyADQQFNGxDBBDYCVAJAIARByABqIAsQYCIMKAIAIgUgDCgCBEYEQCAMIARB1ABqED0gDCgCACIFIAwoAgRGDQELIABBzAFqIRBBACEDA0AgBCAEKAJUIANqNgIcIAUgA0ECdCIGakEAIQhBACEJIAEoAlwgASgCWCILayADSwRAIAMgC2otAAAiCUEBcSEIIAlBAnFBAXYhCQsoAgAhCyAHKAIAIg4gBmooAgBBA24iBSAOIANBAWoiBkECdGoiEygCAEEDbkkEQCAEKAJkIRQgASgCZCIVIAEoAmhGIRYDQCAEKAIcIRIgFCAFQQR0aiIOIAs2AgQgDiASNgIAIBYEf0F/BSAVIAVBAnRqKAIACyESIA4gBTYCDCAOIBI2AgggBUEBaiIFIBMoAgBBA25JDQALCyAKQQJLIAlxIQUCQCABKAJMIgkgASgCUEYEQCAEIARBHGoiAzYCKCAEQThqIBAgAyAEQShqEHkgBCgCOCIDQgA3AyggA0KAgICAgICA+D83AyAgAyALNgIYIANCADcDMCADQgA3AzggA0IANwNIIANCgICAgICAgPg/NwNAIANCADcDUCADQgA3A1ggA0IANwNoIANCgICAgICAgPg/NwNgIANCADcDcCADQgA3A3ggA0EAOgCAASADIAU6AIEBDAELIAkgA0EwbGoiAyoCACEYIAMqAgQhGSADKgIIIRogAyoCDCEbIAMqAhAhHCADKgIUIR0gAyoCGCEeIAMqAhwhHyADKgIgISAgAyoCJCEhIAMqAighIiADKgIsISMgBCAEQRxqIgM2AiggBEE4aiAQIAMgBEEoahB5IAQoAjgiAyAFOgCBASADIAg6AIABIAMgI7s5A3ggAyAiuzkDcCADICG7OQNoIAMgILs5A2AgAyAfuzkDWCADIB67OQNQIAMgHbs5A0ggAyAcuzkDQCADIBu7OQM4IAMgGrs5AzAgAyAZuzkDKCADIBi7OQMgIAMgCzYCGAsgBiIDIAwoAgQgDCgCACIFa0ECdUkNAAsLQQAhCSAEQQA2AkAgBEIANwI4IARBOGogDxA1IARBADYCMCAEQgA3AigCQCAKRQ0AIAQoAnQgBCgCeEYNACAEQShqIA8QNUEBIQkLIABB2AFqIQYgBCgCaARAIAYgDxA5CwJAAkACQCARQQNPBEBBACEIA0AgBEEANgIkIARCADcCHCAEQQA2AhggBEIANwIQIARBAjYCDCAEQoCAgIAQNwIEIAEoAhAgCEEMbGohCyAEKAJ0Ig4gBCgCeEYhEUEAIQMDQCALIARBBGogA2ooAgAiCkECdGooAgAiBSANTw0DQQRBCCAKQQFGG0EAIAobIgogBEEcamogBTYCACAEQRBqIApqIBEEfyAFBSAOIAVBAnRqKAIACzYCACADQQRqIgNBDEcNAAsCQCAEKAIQIgMgBCgCFCIFRg0AIAUgBCgCGCIKRiADIApGcg0AIARBOGohAyAJBH8gAyAEQRxqEI0FIARBKGoFIAMLIARBEGoQjQUgBCgCaEUNACAEKAJkIAhBBHRqIQUjAEEQayIDJAACQCAGKAIEIgogBigCCCILTwRAIAMgBSkCCDcDCCADIAUpAgA3AwAgBiALQQF0QYABIAsbEDkgBiAGKAIEIgVBAWo2AgQgBigCACAFQQR0aiIFIAMpAwg3AgggBSADKQMANwIADAELIAYgCkEBajYCBCAGKAIAIApBBHRqIgogBSkCCDcCCCAKIAUpAgA3AgALIANBEGokAAsgCEEBaiIIIA9HDQALCyAAIARBOGogBEEoahCeAQJ/QQEgACgCXCIFRQ0AGkEAIAVBA3ANABogACgCaCEJIAAoAlghAUEAIQgDQAJAIAEgCEECdCIDaiIGQX5BASAIQQNvQQJGGyINQQJ0aigCACIKIAYoAgAiD3EgAyAJaigCACIDcUF/RwRAQQAhBiABIAggDWoiDUECdCILaigCAEF/RiADQX9Gcg0BIAFBeEEEIA1BA29BAkYbaiALaigCAEF/RiAKIA9Gcg0BIAkgA0ECdCINaigCACAIRw0BIA8gASANaiINQXhBBCADQQNvQQJGG2ooAgBHDQEgCiANKAIARw0BC0EBIQYgCEEBaiIIIAVHDQELCyAGC0UEQCAAQQIQLAwDCwJAAkAgAgRAIAItABBBAUcNASAAQQ4QLAwFCyAAEFggAEEBEI0BIAAQ7QEgABC9BCAAEFogABD2AiAAEJMCIABBABBUDAELIAIgAigCDEEBajYCDCAAEFggAEEBEI0BIAAQ7QEgAi0AEA0CIAIgAigCDEEBajYCDCAAEL0EIAItABBBAUYEQCAAQQ4QLAwECyACIAIoAgxBAWo2AgwgABBaIAItABBBAUYEQCAAQQ4QLAwECyACIAIoAgxBAWo2AgwgABD2AiACLQAQQQFGBEAgAEEOECwMBAsgAiACKAIMQQFqNgIMIAAQkwIgAi0AEEEBRgRAIABBDhAsDAQLIAIgAigCDEEBajYCDCAAIAIQVCACLQAQQQFGBEAgAEEOECwMBAsgAiACKAIMQQFqNgIMCyAAEIMERQRAIABBARAsDAMLIABBfzYCyAEMAgsgAEEDECwMAQsgAEEOECwLIAQoAigiAQRAIAEQIgsgBCgCOCIBBEAgARAiCyAMKAIAIgEEQCAMIAE2AgQgDCgCCBogARAiCyAHKAIAIgEEQCAHIAE2AgQgBygCCBogARAiCyAEKAJkIgFFDQAgARAiCyAEKAJ0IgFFDQAgBCABNgJ4IAQoAnwaIAEQIgsgBEGAAWokACAACzMBAn9BDBAjIgFBADYCCCABQgA3AgAgASAAKAIAIgIgACgCBCIAIAAgAmtBGG0QlgIgAQszAQF/IAFBgICAIE8EQBAmAAsgACABQQZ0IgIQIyIBNgIEIAAgATYCACAAIAEgAmo2AggLYAAgACADNgIQQQAhAyAAQQA2AgwCQCABBEAgAUGAgIDAAE8NASABQQV0ECMhAwsgACADNgIAIAAgAyACQQV0aiICNgIIIAAgAyABQQV0ajYCDCAAIAI2AgQgAA8LEHIAC90CAQV/IwBBIGsiBSQAAkACQCAAKAIEIgIgACgCCCIDSQRAIAIgASkDGDcDGCACIAEpAxA3AxAgAiABKQMINwMIIAIgASkDADcDACACQSBqIQEMAQsgAiAAKAIAIgRrQQV1IgZBAWoiAkGAgIDAAE8NASAFQQxqQf///z8gAyAEayIDQQR1IgQgAiACIARJGyADQeD///8HTxsgBiAAEJYDIgIoAggiAyABKQMYNwMYIAMgASkDEDcDECADIAEpAwg3AwggAyABKQMANwMAIAIgA0EgajYCCCACKAIEIAAoAgQgACgCACIDayIBayEEIAEEQCAEIAMgAfwKAAALIAAoAgAhAyAAIAQ2AgAgAiADNgIEIAAgAigCCCIBNgIEIAIgAzYCCCAAKAIIIQQgACACKAIMNgIIIAIgAzYCACACIAQ2AgwgAhCaBQsgACABNgIEIAVBIGokAA8LECYAC1YBBX8gACgCACICKAIAIgEEQCABIQMgAiEEIAIoAgQiBSABRwRAA0AgASAFQUBqEEEiBUcNAAsgACgCACIEKAIAIQMLIAIgATYCBCAEKAIIGiADECILC4sCAQJ/AkAgACgCCCAAKAIAIgRrQQR1IANPBEAgAyAAKAIEIgMgBGsiBUEEdUsEQCADIARHBEAgBQRAIAQgASAF/AoAAAsgACgCBCEDCyACIAEgBWoiAWsiBEUgASACRnJFBEAgAyABIAT8CgAACyAAIAMgBGo2AgQPCyACIAFrIgNFIAEgAkZyRQRAIAQgASAD/AoAAAsMAQsgABBFIANBgICAgAFJBEAgAEH/////ACAAKAIIIAAoAgBrIgRBA3UiBSADIAMgBUkbIARB8P///wdPGxCPAyAAKAIEIQMgAiABayIERSABIAJGckUEQCADIAEgBPwKAAALDAELECYACyAAIAMgBGo2AgQLogIBBX8jAEEgayIFJAACQAJAIAAoAgQiAiAAKAIIIgNJBEAgAiABQcAA/AoAACACQUBrIQEMAQsgAiAAKAIAIgRrQQZ1IgZBAWoiAkGAgIAgTw0BIAVBDGpB////HyADIARrIgNBBXUiBCACIAIgBEkbIANBwP///wdPGyAGIAAQqQEiAigCCCIDIAFBwAD8CgAAIAIgA0FAazYCCCACKAIEIAAoAgQgACgCACIDayIBayEEIAEEQCAEIAMgAfwKAAALIAAoAgAhAyAAIAQ2AgAgAiADNgIEIAAgAigCCCIBNgIEIAIgAzYCCCAAKAIIIQQgACACKAIMNgIIIAIgAzYCACACIAQ2AgwgAhCpAgsgACABNgIEIAVBIGokAA8LECYAC4sBAQN/IwBBEGsiAiQAIAJBCGoiAyABQfgQED8gAigCDCADEKoCIQMgAigCDCIEQQlPBEAgBBABCyAAQQA2AgggAEIANwIAIAAgAxB9IAIgACgCADYCBCACIAM2AgAgAkEIaiACEI0CIAIoAgwgASgCBBAUIAIoAgwiAEEJTwRAIAAQAQsgAkEQaiQAC1sBA38jAEEgayIDJAAgASAAKAIEIgVBAXVqIQEgACgCACEAIANBCGoiBCABIAIgBUEBcQR/IAEoAgAgAGooAgAFIAALEQMAQRgQIyAEEC4gBBAoGiADQSBqJAALMwEDf0EEECMiAiABNgIAQZjxASAAQQNBACEAQdSGAiAAQbncAGpBsgIgAkEAQQBBABAAC0sBAn8gACgCBCIGQQh1IQcgACgCACIAIAEgAiAGQQFxBH8gAygCACAHaigCAAUgBwsgA2ogBEECIAZBAnEbIAUgACgCACgCFBEIAAtRAQF/AkAgAUUNACABQdjoARBiIgFFDQAgASgCCCAAKAIIQX9zcQ0AIAAoAgwoAgQgASgCDCgCBEcNACAAKAIQKAIEIAEoAhAoAgRGIQILIAILewEDfyAAKAIEIgRBAXEhBgJ/IAEtADdBAUYEQCAEQQh1IgUgBkUNARogAigCACAFaigCAAwBCyAEQQh1IAZFDQAaIAEgACgCACgCBDYCOEEAIQJBAAshBSAAKAIAIgAgASACIAVqIANBAiAEQQJxGyAAKAIAKAIcEQUACwsAIAEgAiAAEQEACw0AIAAoAgQgASgCBEYLQAECfyMAQRBrIgIkACMAQRBrIgEkACABIAA2AgwgAUEMakEEEPcBIAFBEGokACACQRBqJABBH3FBAnRB0JwCagtoAQN/IwBBEGsiAyQAIANBADoADiABIABrQQJ1IQEgAigCACEEA0AgAQRAIAEgAUEBdiICQX9zaiACIAAgAkECdGoiAigCACAESSIFGyEBIAJBBGogACAFGyEADAELCyADQRBqJAAgAAvsBAMEfwV+AXwgAkEANgIAAkAgAb1C////////////AINCgICAgICAgPj/AFYgAUQAAAAAAAAAAGFyRQRAIAC9IglCNIinQf8PcSIDQf8PRw0BCyAAIAGiIgAgAKMPCwJAIABEAAAAAAAAAABhDQAgAb0iCkI0iKdB/w9xIQQCfiADRQRAQQAhAyAJQgyGIgdCAFkEQANAIANBAWshAyAHQgGGIgdCAFkNAAsLIAlBASADa62GDAELIAlC/////////weDQoCAgICAgIAIhAshBwJ+IARFBEBBACEEIApCDIYiCEIAWQRAA0AgBEEBayEEIAhCAYYiCEIAWQ0ACwsgCkEBIARrrYYMAQsgCkL/////////B4NCgICAgICAgAiECyEIAn4CQAJAIAMgBE4EQCADIARKBEADQCAHIAh9IgsgByALQgBZIgYbQgGGIQcgBSAGckEBdCEFIANBAWsiAyAESg0ACyAEIQMLIAUgByAIfSIIQgBZIgZyIQUgCCAHIAYbIgdQBEBBRCEDQgAhBwwDCyAHQv////////8HVg0BA0AgA0EBayEDIAciCEIBhiEHIAhCgICAgICAgARUDQALDAELIANBAWogBEcNAwsgA0EATA0AIAdCgICAgICAgAh9IAOtQjSGhAwBCyAHQQEgA2utiAsgAZkhAL8hAQJAAkAgAyAERg0AIANBAWogBEcNASABIAGgIgwgAGQNACAFQQFxRSAAIAxicg0BCyAFQQFqIQUgASAAoSEBCyACQQAgBUH/////B3EiAmsgAiAJIAqFQgBTGzYCACABmiABIAlCAFMbIQALIAALGwAgAEIBhkKAgICAgICAEHxCgYCAgICAgBBUCxUBAX8jAEEQayIBIAA5AwggASsDCAvaFgMSfwR8AX4jAEEwayIJJAACQAJAAkAgAL0iGEIgiKciA0H/////B3EiBkH61L2ABE0EQCADQf//P3FB+8MkRg0BIAZB/LKLgARNBEAgGEIAWQRAIAEgAEQAAEBU+yH5v6AiAEQxY2IaYbTQvaAiFDkDACABIAAgFKFEMWNiGmG00L2gOQMIQQEhAwwFCyABIABEAABAVPsh+T+gIgBEMWNiGmG00D2gIhQ5AwAgASAAIBShRDFjYhphtNA9oDkDCEF/IQMMBAsgGEIAWQRAIAEgAEQAAEBU+yEJwKAiAEQxY2IaYbTgvaAiFDkDACABIAAgFKFEMWNiGmG04L2gOQMIQQIhAwwECyABIABEAABAVPshCUCgIgBEMWNiGmG04D2gIhQ5AwAgASAAIBShRDFjYhphtOA9oDkDCEF+IQMMAwsgBkG7jPGABE0EQCAGQbz714AETQRAIAZB/LLLgARGDQIgGEIAWQRAIAEgAEQAADB/fNkSwKAiAETKlJOnkQ7pvaAiFDkDACABIAAgFKFEypSTp5EO6b2gOQMIQQMhAwwFCyABIABEAAAwf3zZEkCgIgBEypSTp5EO6T2gIhQ5AwAgASAAIBShRMqUk6eRDuk9oDkDCEF9IQMMBAsgBkH7w+SABEYNASAYQgBZBEAgASAARAAAQFT7IRnAoCIARDFjYhphtPC9oCIUOQMAIAEgACAUoUQxY2IaYbTwvaA5AwhBBCEDDAQLIAEgAEQAAEBU+yEZQKAiAEQxY2IaYbTwPaAiFDkDACABIAAgFKFEMWNiGmG08D2gOQMIQXwhAwwDCyAGQfrD5IkESw0BCyAARIPIyW0wX+Q/okQAAAAAAAA4Q6BEAAAAAAAAOMOgIhX8AiEDAkAgACAVRAAAQFT7Ifm/oqAiFCAVRDFjYhphtNA9oiIWoSIXRBgtRFT7Iem/YwRAIANBAWshAyAVRAAAAAAAAPC/oCIVRDFjYhphtNA9oiEWIAAgFUQAAEBU+yH5v6KgIRQMAQsgF0QYLURU+yHpP2RFDQAgA0EBaiEDIBVEAAAAAAAA8D+gIhVEMWNiGmG00D2iIRYgACAVRAAAQFT7Ifm/oqAhFAsgASAUIBahIgA5AwACQCAGQRR2IgIgAL1CNIinQf8PcWtBEUgNACABIBQgFUQAAGAaYbTQPaIiAKEiFyAVRHNwAy6KGaM7oiAUIBehIAChoSIWoSIAOQMAIAIgAL1CNIinQf8PcWtBMkgEQCAXIRQMAQsgASAXIBVEAAAALooZozuiIgChIhQgFUTBSSAlmoN7OaIgFyAUoSAAoaEiFqEiADkDAAsgASAUIAChIBahOQMIDAELIAZBgIDA/wdPBEAgASAAIAChIgA5AwAgASAAOQMIQQAhAwwBCyAJQRBqIgNBCHIhBCAYQv////////8Hg0KAgICAgICAsMEAhL8hAEEBIQIDQCADIAD8ArciFDkDACAAIBShRAAAAAAAAHBBoiEAIAJBACECIAQhAw0ACyAJIAA5AyBBAiEDA0AgAyICQQFrIQMgCUEQaiINIAJBA3RqKwMARAAAAAAAAAAAYQ0AC0EAIQQjAEGwBGsiBSQAIAZBFHZBlghrIgNBA2tBGG0iCEEAIAhBAEobIgdBaGwgA2ohC0G0mgEoAgAiCCACQQFqIg5BAWsiCmpBAE4EQCAIIA5qIQMgByAKayECA0AgBUHAAmogBEEDdGogAkEASAR8RAAAAAAAAAAABSACQQJ0KALAmgG3CzkDACACQQFqIQIgBEEBaiIEIANHDQALCyALQRhrIQZBACEDIAhBACAIQQBKGyEEIA5BAEwhDANAAkAgDARARAAAAAAAAAAAIQAMAQsgAyAKaiEPQQAhAkQAAAAAAAAAACEAA0AgDSACQQN0aisDACAFQcACaiAPIAJrQQN0aisDAKIgAKAhACACQQFqIgIgDkcNAAsLIAUgA0EDdGogADkDACADIARGIANBAWohA0UNAAtBLyALayEQQTAgC2shDyAHQQJ0QcCaAWohESAIIQMCQANAIAUgA0EDdGorAwAhAEEAIQIgAyEEIANBAEoEQANAIAVB4ANqIAJBAnRqIABEAAAAAAAAcD6i/AK3IhREAAAAAAAAcMGiIACg/AI2AgAgBSAEQQN0akEIaysDACAUoCEAIARBAWshBCACQQFqIgIgA0cNAAsLIAAgBhD4ASIAIABEAAAAAAAAwD+inEQAAAAAAAAgwKKgIgAgAPwCIgy3oSEAAkACQAJAAn8gBkEATCISRQRAIANBAnQgBWoiAiACKALcAyICIAIgD3UiAiAPdGsiBDYC3AMgAiAMaiEMIAQgEHUMAQsgBg0BIANBAnQgBWooAtwDQRd1CyIKQQBMDQIMAQtBAiEKIABEAAAAAAAA4D9mDQBBACEKDAELQQAhAkEAIQdBASEEIANBAEoEQANAIAVB4ANqIAJBAnRqIhMoAgAhBAJ/AkAgEyAHBH9B////BwUgBEUNAUGAgIAICyAEazYCAEEBIQdBAAwBC0EAIQdBAQshBCACQQFqIgIgA0cNAAsLAkAgEg0AQf///wMhAgJAAkAgBkEBaw4CAQACC0H///8BIQILIANBAnQgBWoiByAHKALcAyACcTYC3AMLIAxBAWohDCAKQQJHDQBEAAAAAAAA8D8gAKEhAEECIQogBA0AIABEAAAAAAAA8D8gBhD4AaEhAAsgAEQAAAAAAAAAAGEEQEEAIQQgAyECAkAgAyAITA0AA0AgBUHgA2ogAkEBayICQQJ0aigCACAEciEEIAIgCEoNAAsgBEUNAANAIAZBGGshBiAFQeADaiADQQFrIgNBAnRqKAIARQ0ACwwDC0EBIQIDQCACIgRBAWohAiAFQeADaiAIIARrQQJ0aigCAEUNAAsgAyAEaiEEA0AgBUHAAmogAyAOaiIHQQN0aiARIANBAWoiA0ECdGooAgC3OQMAQQAhAkQAAAAAAAAAACEAIA5BAEoEQANAIA0gAkEDdGorAwAgBUHAAmogByACa0EDdGorAwCiIACgIQAgAkEBaiICIA5HDQALCyAFIANBA3RqIAA5AwAgAyAESA0ACyAEIQMMAQsLAkAgAEEYIAtrEPgBIgBEAAAAAAAAcEFmBEAgBUHgA2ogA0ECdGogAEQAAAAAAABwPqL8AiICt0QAAAAAAABwwaIgAKD8AjYCACADQQFqIQMgCyEGDAELIAD8AiECCyAFQeADaiADQQJ0aiACNgIAC0QAAAAAAADwPyAGEPgBIQAgA0EATgRAIAMhAgNAIAUgAiIEQQN0aiAAIAVB4ANqIAJBAnRqKAIAt6I5AwAgAkEBayECIABEAAAAAAAAcD6iIQAgBA0ACyADIQcDQAJAIAggAyAHayIEIAQgCEobIgZBAEgEQEQAAAAAAAAAACEADAELIAUgB0EDdGohC0EAIQJEAAAAAAAAAAAhAANAIAJBA3QiDSsDkLABIAsgDWorAwCiIACgIQAgAiAGRyACQQFqIQINAAsLIAVBoAFqIARBA3RqIAA5AwAgB0EASiAHQQFrIQcNAAsLRAAAAAAAAAAAIQAgA0EATgRAIAMhAgNAIAIiBEEBayECIAAgBUGgAWogBEEDdGorAwCgIQAgBA0ACwsgCSAAmiAAIAobOQMAIAUrA6ABIAChIQBBASECIANBAEoEQANAIAAgBUGgAWogAkEDdGorAwCgIQAgAiADRyACQQFqIQINAAsLIAkgAJogACAKGzkDCCAFQbAEaiQAIAxBB3EhAyAJKwMAIQAgGEIAUwRAIAEgAJo5AwAgASAJKwMImjkDCEEAIANrIQMMAQsgASAAOQMAIAEgCSsDCDkDCAsgCUEwaiQAIAML9AMDA3wCfwF+IAC9IgZCIIinQf////8HcSIEQYCAwKAETwRAIABEGC1EVPsh+T8gAKYgAL1C////////////AINCgICAgICAgPj/AFYbDwsCQAJ/IARB///v/gNNBEBBfyAEQYCAgPIDTw0BGgwCCyAAmSEAIARB///L/wNNBEAgBEH//5f/A00EQCAAIACgRAAAAAAAAPC/oCAARAAAAAAAAABAoKMhAEEADAILIABEAAAAAAAA8L+gIABEAAAAAAAA8D+goyEAQQEMAQsgBEH//42ABE0EQCAARAAAAAAAAPi/oCAARAAAAAAAAPg/okQAAAAAAADwP6CjIQBBAgwBC0QAAAAAAADwvyAAoyEAQQMLIAAgAKIiAiACoiIBIAEgASABIAFEL2xqLES0or+iRJr93lIt3q2/oKJEbZp0r/Kws7+gokRxFiP+xnG8v6CiRMTrmJmZmcm/oKIhAyACIAEgASABIAEgAUQR2iLjOq2QP6JE6w12JEt7qT+gokRRPdCgZg2xP6CiRG4gTMXNRbc/oKJE/4MAkiRJwj+gokQNVVVVVVXVP6CiIQEgBEH//+/+A00EQCAAIAAgAyABoKKhDwtBA3QiBCsDsJkBIAAgAyABoKIgBCsD0JkBoSAAoaEiAJogACAGQgBTGyEACyAAC64CAwF8AX4BfyAAvSICQiCIp0H/////B3EiA0GAgMD/A08EQCACpyADQYCAwP8Da3JFBEBEAAAAAAAAAABEGC1EVPshCUAgAkIAWRsPC0QAAAAAAAAAACAAIAChow8LAnwgA0H////+A00EQEQYLURU+yH5PyADQYGAgOMDSQ0BGkQHXBQzJqaRPCAAIAAgAKIQsgKioSAAoUQYLURU+yH5P6APCyACQgBTBEBEGC1EVPsh+T8gAEQAAAAAAADwP6BEAAAAAAAA4D+iIgCfIgEgASAAELICokQHXBQzJqaRvKCgoSIAIACgDwtEAAAAAAAA8D8gAKFEAAAAAAAA4D+iIgCfIgEgABCyAqIgACABvUKAgICAcIO/IgAgAKKhIAEgAKCjoCAAoCIAIACgCwvJAgEFfyACIAIoAgAQeyADIAMoAgAQeyAAQQIgAUEAEP8BBEAjAEEQayIEJAAgAhCxASACIAAoAoQBIAAoAoABa0ECdRBWIAMEQCADELEBIAMgACgChAEgACgCgAFrQQJ1EFYLIAAoAoQBIgcgACgCgAEiAUcEQANAIAEgBUECdGooAgAiBigCECIIBEAgBEEANgIMIARCADcCBAJAAkACQCADRQ0AIAYtAExBAUcNACADIQEgCCAALQB1QQEgBEEEahD9AQ0BDAILIAAgBhC9AiACIQEgBigCECAALQB1QQAgBEEEahD9AUUNAQsgASAEQQRqEGgLIAQoAgQiAQRAIAQgATYCCCAEKAIMGiABECILIAAoAoQBIQcgACgCgAEhAQsgBUEBaiIFIAcgAWtBAnVJDQALCyAEQRBqJAALIAAQ3gEgAC0AfRoLpwIBA38gAEECIAFBARD/AQRAIAMgAygCABB7IAIgAigCACgCDBEAACMAQRBrIgEkACACIAIoAgAoAgwRAAAgAxCxASAALQB8QQFGBEAgAyAAKAKEASAAKAKAAWtBAnUQVgsgACgCgAEiBCAAKAKEAUcEQANAAkAgBCAFQQJ0aigCACIERQ0AIAQoAhAiBkUNACAELQBMQQFGBEAgAUEANgIMIAFCADcCBCAGIAAtAHVBASABQQRqIgQQ/QEEQCADIAQQaAsgASgCBCIERQ0BIAEgBDYCCCABKAIMGiAEECIMAQsgACAEEPwBRQ0AIAAgBCACELsCCyAFQQFqIgUgACgChAEgACgCgAEiBGtBAnVJDQALCyABQRBqJAALIAAQ3gEgAC0AfRoLeQIDfAR+IAIpAwghBiABKQMIIQcCfCACKQMAIgggASkDACIJUQRARAAAAAAAAAAAIAYgB1ENARoLRAAAAAAAAPA/IAggCX25IgMgA6IgBiAHfbkiBSAFoqCfoyIEIAOaoiEDIAQgBaILIQQgACADOQMIIAAgBDkDAAuACAMIfwF8Bn4jAEEQayIGJAAgAEEANgIIIABCADcCACAAIAEoAgAiAyABKAIEIgEgASADa0EMbRBHIABBADYCHCAAIAI2AhggAEEAOgAUIABBADoAECAAQQA6AAwCQCAAKAIAIgIgACgCBCIHRwR/A0ACQAJAAkAgAigCACIBIAIoAgQiBEYNAANAIAEiA0EQaiIBIARGDQEgAykDACADKQMQUg0AIAMpAwggAykDGFINAAsMAQsgASIDIARHDQAgBiAENgIIIAYgBDYCBAwBCyAEIANBIGoiAUcEQCADQRBqIQUDQAJAIAMpAwAgASkDAFEEQCADKQMIIAUpAxhRDQELIAMgASkDCDcDGCADIAEpAwA3AxAgA0EQaiEDCyABIQUgAUEQaiIBIARHDQALCyAGIAQ2AgggBiADQRBqNgIECyAGKAIEIgMgAigCBCIBRwRAIAEgAyABIANraiIFayIERSABIAVGckUEQCADIAUgBPwKAAALIAIgAyAEaiIBNgIECwJAIAEgAigCACIFa0ERSQ0AIAUpAwAhDANAIAFBEGsiAykDACAMUg0BIAFBCGspAwAgBSkDCFINASACIAM2AgQgAyIBIAVrQRBLDQALCyACQQxqIgIgB0cNAAsgACgCHAVBAAtFBEBBACEFIAAtABBBAUYEQCAAQQA6ABALIAAoAgQiAiAAKAIAIgRHBEBC////////////ACEOQoCAgICAgICAgH8hDQNARP///////+9/IQsgBCAFQQxsIglqIgEoAgAiAyABKAIEIgpHBEACQANAAkAgAykDCCIMIA1TDQAgDCANUQRAIAMpAwAgDlkNAQsgC0T////////vf2EEQCAAKAIAIgQgCWoiASgCBCIHIAEoAgAiAWsiCEEhSQ0DAkAgB0EQayICIAcgCEEQcSIHGyIIIAFGBEBEAAAAAAAAAAAhCwwBCyACKQMAIQxEAAAAAAAAAAAhCwNAIAEpAwgiDyABKQMYfLkgASkDACIQIAEpAxAiEX25oiAPIAIpAwh8uSAMIBB9uaIgC6CgIQsgAUEQaiECIBEhDCABQSBqIgEgCEcNAAsLIAcEfCABKQMIIAIpAwh8uSACKQMAIAEpAwB9uaIgC6AFIAsLRAAAAAAAAOA/oiILRAAAAAAAAAAAYQ0DIAYgC0QAAAAAAAAAAGM6AAMLIABBAToAECAAIAU2AgwgAykDCCENIAMpAwAhDgsgA0EQaiIDIApHDQALIAAoAgAhBAsgACgCBCECCyAFQQFqIgUgAiAEa0EMbUkNAAsLIAAgAC0AECAGLQADcToAFAwBCyAALQAQQQFGBEAgAEEAOgAQCyAAQQA6ABQLIAZBEGokAAvMAgEGfyMAQSBrIgckACADIABrQRhtIQUCQCACQQJIDQAgAkECa0EBdiIJIAVIDQAgACAFQQF0IgVBAXIiBkEYbGohBCACIAVBAmoiBUoEQCAEQRhqIgggBCAEIAggASgCABECACIIGyEEIAUgBiAIGyEGCyAEIAMgASgCABECAA0AIAcgAykDEDcDGCAHIAMpAwg3AxAgByADKQMANwMIA0ACQCADIAQiBSkDEDcDECADIAQpAwg3AwggAyAEKQMANwMAIAYgCUoNACAAIAZBAXQiA0EBciIGQRhsaiEEIAIgA0ECaiIDSgRAIARBGGoiCCAEIAQgCCABKAIAEQIAIggbIQQgAyAGIAgbIQYLIAUhAyAEIAdBCGogASgCABECAEUNAQsLIAUgBykDGDcDECAFIAcpAxA3AwggBSAHKQMINwMACyAHQSBqJAALwRIBBn8jAEEgayIDJABBASEHAkACQAJAAkACQAJAIAEgAGtBGG0OBgUFAAECAwQLIAFBGGsiASAAIAIoAgARAgBFDQQgAyAAKQMQNwMYIAMgACkDCDcDECADIAApAwA3AwggACABKQMQNwMQIAAgASkDCDcDCCAAIAEpAwA3AwAgASADKQMYNwMQIAEgAykDEDcDCCABIAMpAwg3AwAMBAsgAEEYaiIEIAAgAigCABECACABQRhrIgEgBCACKAIAEQIAIQVFBEAgBUUNBCADIAQpAxA3AxggAyAEKQMINwMQIAMgBCkDADcDCCAEIAEpAxA3AxAgBCABKQMINwMIIAQgASkDADcDACABIAMpAxg3AxAgASADKQMQNwMIIAEgAykDCDcDACAEIAAgAigCABECAEUNBCADIAApAxA3AxggAyAAKQMINwMQIAMgACkDADcDCCAAIAQpAxA3AxAgACAEKQMINwMIIAAgBCkDADcDACAEIAMpAxg3AxAgBCADKQMQNwMIIAQgAykDCDcDAAwECyAFBEAgAyAAKQMQNwMYIAMgACkDCDcDECADIAApAwA3AwggACABKQMQNwMQIAAgASkDCDcDCCAAIAEpAwA3AwAgASADKQMYNwMQIAEgAykDEDcDCCABIAMpAwg3AwAMBAsgAyAAKQMQNwMYIAMgACkDCDcDECADIAApAwA3AwggACAEKQMQNwMQIAAgBCkDCDcDCCAAIAQpAwA3AwAgBCADKQMYNwMQIAQgAykDEDcDCCAEIAMpAwg3AwAgASAEIAIoAgARAgBFDQMgAyAEKQMQNwMYIAMgBCkDCDcDECADIAQpAwA3AwggBCABKQMQNwMQIAQgASkDCDcDCCAEIAEpAwA3AwAgASADKQMYNwMQIAEgAykDEDcDCCABIAMpAwg3AwAMAwsgAUEYayEFIABBGGoiASAAIAIoAgARAgAhCCAAQTBqIgQgASACKAIAEQIAIQYCQCAIRQRAIAZFDQEgAyABKQMQNwMYIAMgASkDCDcDECADIAEpAwA3AwggASAEKQMQNwMQIAEgBCkDCDcDCCABIAQpAwA3AwAgBCADKQMYNwMQIAQgAykDEDcDCCAEIAMpAwg3AwAgASAAIAIoAgARAgBFDQEgAyAAKQMQNwMYIAMgACkDCDcDECADIAApAwA3AwggACABKQMQNwMQIAAgASkDCDcDCCAAIAEpAwA3AwAgASADKQMYNwMQIAEgAykDEDcDCCABIAMpAwg3AwAMAQsgBgRAIAMgACkDEDcDGCADIAApAwg3AxAgAyAAKQMANwMIIAAgBCkDEDcDECAAIAQpAwg3AwggACAEKQMANwMAIAQgAykDGDcDECAEIAMpAxA3AwggBCADKQMINwMADAELIAMgACkDEDcDGCADIAApAwg3AxAgAyAAKQMANwMIIAAgASkDEDcDECAAIAEpAwg3AwggACABKQMANwMAIAEgAykDGDcDECABIAMpAxA3AwggASADKQMINwMAIAQgASACKAIAEQIARQ0AIAMgASkDEDcDGCADIAEpAwg3AxAgAyABKQMANwMIIAEgBCkDEDcDECABIAQpAwg3AwggASAEKQMANwMAIAQgAykDGDcDECAEIAMpAxA3AwggBCADKQMINwMACyAFIAQgAigCABECAEUNAiADIAQpAxA3AxggAyAEKQMINwMQIAMgBCkDADcDCCAEIAUpAxA3AxAgBCAFKQMINwMIIAQgBSkDADcDACAFIAMpAxg3AxAgBSADKQMQNwMIIAUgAykDCDcDACAEIAEgAigCABECAEUNAiADIAEpAxA3AxggAyABKQMINwMQIAMgASkDADcDCCABIAQpAxA3AxAgASAEKQMINwMIIAEgBCkDADcDACAEIAMpAxg3AxAgBCADKQMQNwMIIAQgAykDCDcDACABIAAgAigCABECAEUNAiADIAApAxA3AxggAyAAKQMINwMQIAMgACkDADcDCCAAIAEpAxA3AxAgACABKQMINwMIIAAgASkDADcDACABIAMpAxg3AxAgASADKQMQNwMIIAEgAykDCDcDAAwCCyAAIABBGGogAEEwaiAAQcgAaiABQRhrIAIQsgMMAQsgAEEYaiIFIAAgAigCABECACEIIABBMGoiBCAFIAIoAgARAgAhBgJAIAhFBEAgBkUNASADIAUpAxA3AxggAyAFKQMINwMQIAMgBSkDADcDCCAFIAQpAxA3AxAgBSAEKQMINwMIIAUgBCkDADcDACAEIAMpAxg3AxAgBCADKQMQNwMIIAQgAykDCDcDACAFIAAgAigCABECAEUNASADIAApAxA3AxggAyAAKQMINwMQIAMgACkDADcDCCAAIAUpAxA3AxAgACAFKQMINwMIIAAgBSkDADcDACAFIAMpAxg3AxAgBSADKQMQNwMIIAUgAykDCDcDAAwBCyAGBEAgAyAAKQMQNwMYIAMgACkDCDcDECADIAApAwA3AwggACAEKQMQNwMQIAAgBCkDCDcDCCAAIAQpAwA3AwAgBCADKQMYNwMQIAQgAykDEDcDCCAEIAMpAwg3AwAMAQsgAyAAKQMQNwMYIAMgACkDCDcDECADIAApAwA3AwggACAFKQMQNwMQIAAgBSkDCDcDCCAAIAUpAwA3AwAgBSADKQMYNwMQIAUgAykDEDcDCCAFIAMpAwg3AwAgBCAFIAIoAgARAgBFDQAgAyAFKQMQNwMYIAMgBSkDCDcDECADIAUpAwA3AwggBSAEKQMQNwMQIAUgBCkDCDcDCCAFIAQpAwA3AwAgBCADKQMYNwMQIAQgAykDEDcDCCAEIAMpAwg3AwALIABByABqIgUgAUYNAEEAIQgDQAJAIAUgBCACKAIAEQIARQ0AIAMgBSkDEDcDGCADIAUpAwg3AxAgAyAFKQMANwMIIAUhBgNAAkAgBiAEIgcpAxA3AxAgBiAEKQMINwMIIAYgBCkDADcDACAAIARGBEAgACEHDAELIANBCGogByIGQRhrIgQgAigCABECAA0BCwsgByADKQMYNwMQIAcgAykDEDcDCCAHIAMpAwg3AwAgCEEBaiIIQQhHDQAgBUEYaiABRiEHDAILIAUiBEEYaiIHIQUgASAHRw0AC0EBIQcLIANBIGokACAHC1oBAn8jAEEQayICJAAgASAAKAIEIgNBAXVqIQEgACgCACEAIAIgASADQQFxBH8gASgCACAAaigCAAUgAAsRAQAgAhCYBSACIAI2AgwgAkEMahApIAJBEGokAAuMCgEDfyMAQSBrIgYkACABIAAgBSgCABECACEIIAIgASAFKAIAEQIAIQcCQCAIRQRAIAdFDQEgBiABKQMQNwMYIAYgASkDCDcDECAGIAEpAwA3AwggASACKQMQNwMQIAEgAikDCDcDCCABIAIpAwA3AwAgAiAGKQMYNwMQIAIgBikDEDcDCCACIAYpAwg3AwAgASAAIAUoAgARAgBFDQEgBiAAKQMQNwMYIAYgACkDCDcDECAGIAApAwA3AwggACABKQMQNwMQIAAgASkDCDcDCCAAIAEpAwA3AwAgASAGKQMYNwMQIAEgBikDEDcDCCABIAYpAwg3AwAMAQsgBwRAIAYgACkDEDcDGCAGIAApAwg3AxAgBiAAKQMANwMIIAAgAikDEDcDECAAIAIpAwg3AwggACACKQMANwMAIAIgBikDGDcDECACIAYpAxA3AwggAiAGKQMINwMADAELIAYgACkDEDcDGCAGIAApAwg3AxAgBiAAKQMANwMIIAAgASkDEDcDECAAIAEpAwg3AwggACABKQMANwMAIAEgBikDGDcDECABIAYpAxA3AwggASAGKQMINwMAIAIgASAFKAIAEQIARQ0AIAYgASkDEDcDGCAGIAEpAwg3AxAgBiABKQMANwMIIAEgAikDEDcDECABIAIpAwg3AwggASACKQMANwMAIAIgBikDGDcDECACIAYpAxA3AwggAiAGKQMINwMACwJAIAMgAiAFKAIAEQIARQ0AIAYgAikDEDcDGCAGIAIpAwg3AxAgBiACKQMANwMIIAIgAykDEDcDECACIAMpAwg3AwggAiADKQMANwMAIAMgBikDGDcDECADIAYpAxA3AwggAyAGKQMINwMAIAIgASAFKAIAEQIARQ0AIAYgASkDEDcDGCAGIAEpAwg3AxAgBiABKQMANwMIIAEgAikDEDcDECABIAIpAwg3AwggASACKQMANwMAIAIgBikDGDcDECACIAYpAxA3AwggAiAGKQMINwMAIAEgACAFKAIAEQIARQ0AIAYgACkDEDcDGCAGIAApAwg3AxAgBiAAKQMANwMIIAAgASkDEDcDECAAIAEpAwg3AwggACABKQMANwMAIAEgBikDGDcDECABIAYpAxA3AwggASAGKQMINwMACwJAIAQgAyAFKAIAEQIARQ0AIAYgAykDEDcDGCAGIAMpAwg3AxAgBiADKQMANwMIIAMgBCkDEDcDECADIAQpAwg3AwggAyAEKQMANwMAIAQgBikDGDcDECAEIAYpAxA3AwggBCAGKQMINwMAIAMgAiAFKAIAEQIARQ0AIAYgAikDEDcDGCAGIAIpAwg3AxAgBiACKQMANwMIIAIgAykDEDcDECACIAMpAwg3AwggAiADKQMANwMAIAMgBikDGDcDECADIAYpAxA3AwggAyAGKQMINwMAIAIgASAFKAIAEQIARQ0AIAYgASkDEDcDGCAGIAEpAwg3AxAgBiABKQMANwMIIAEgAikDEDcDECABIAIpAwg3AwggASACKQMANwMAIAIgBikDGDcDECACIAYpAxA3AwggAiAGKQMINwMAIAEgACAFKAIAEQIARQ0AIAYgACkDEDcDGCAGIAApAwg3AxAgBiAAKQMANwMIIAAgASkDEDcDECAAIAEpAwg3AwggACABKQMANwMAIAEgBikDGDcDECABIAYpAxA3AwggASAGKQMINwMACyAGQSBqJAALqAYBA38CQAJAAkACQAJAIAMOAwMAAQILIAQgACgCCDYCCCAEIAApAgA3AgAPCyABQQxrIQICQAJAIAFBCGsoAgAiAUUNACAAKAIERQ0AIAAoAgApAwAgAigCACkDAFUNAQwECyABRQ0DCyAEIAIoAgg2AgggBCACKQIANwIAIAQgACkCADcCDCAEIAAoAgg2AhQPCyADQQhMBEAgBCEDAkAgACABRg0AIAQgACgCCDYCCCAEIAApAgA3AgAgAEEMaiIGIAFGDQADQCAEQQxqIQUCQAJAAkACQCAAKAIQIgJFDQAgBCgCBEUNACAEKAIAKQMAIAYoAgApAwBVDQEMAgsgAkUNAQsgBSAEKAIINgIIIAUgBCkCADcCAAJ/IAMgAyAERg0AGgJAA0AgBEEMayECAkACQCAAKAIQIgdFDQAgBEEIaygCAEUNACACKAIAKQMAIAYoAgApAwBVDQEMAwsgB0UNAgsgBCACLQAIOgAIIAQgAikCADcCACACIgQgA0cNAAsgAwwBCyAECyIAIAYtAAg6AAggACAGKQIANwIADAELIAUgBigCCDYCCCAFIAYpAgA3AgALIAUhBCAGIgBBDGoiBiABRw0ACwsPCyAAIAAgA0EBdiIHQQxsIgZqIgUgAiAHIAQgBxCvASAFIAEgAiADIAdrIgIgBCAGaiACEK8BAkAgBSIDIABHBEADQCABIAVGBEAgACADRg0DA0AgBCAAKAIINgIIIAQgACkCADcCACAEQQxqIQQgAEEMaiIAIANHDQALDAMLAkACQAJAAkAgBSgCBCICRQ0AIAAoAgRFDQAgACgCACkDACAFKAIAKQMAVQ0BDAILIAJFDQELIAQgBSgCCDYCCCAEIAUpAgA3AgAgBUEMaiEFDAELIAQgACgCCDYCCCAEIAApAgA3AgAgAEEMaiEACyAEQQxqIQQgACADRw0ACwsgASAFRg0AA0AgBCAFKAIINgIIIAQgBSkCADcCACAEQQxqIQQgBUEMaiIFIAFHDQALCwsPCyAEIAAoAgg2AgggBCAAKQIANwIAIAQgAikCADcCDCAEIAIoAgg2AhQLQgEDfyAAKAIAIgIEQANAIAEoAgAhAyABQQA2AgAgAUEEaiEBIAMEQCADECIgACgCACECCyAEQQFqIgQgAkkNAAsLC80GAgR/An4CQAJAAkACQAJAIAMOAwMAAQILIAAoAgAhASAAQQA2AgAgBCABNgIADwsCQCAAKAIAIgIoAgAiAykDCCIJIAFBBGsiASgCACIFKAIAIgYpAwgiClIEQCAJIApTDQEMBAsgAykDACAGKQMAVw0DCyABQQA2AgAgBCAFNgIAIAAoAgAhASAAQQA2AgAgBCABNgIEDwsgA0EITARAIAQhAgJAIAAgAUYNACAAKAIAIQMgAEEANgIAIAQgAzYCACAAQQRqIgUgAUYNAANAIAQiAEEEaiEEAkACQAJAIAAoAgAiAygCACIGKQMIIgkgBSgCACIHKAIAIggpAwgiClIEQCAJIApTDQEMAgsgBikDACAIKQMAVw0BCyAAIAM2AgQgAEEANgIAAn8gAiAAIAJGDQAaAkADQAJAIABBBGsiAygCACIHKAIAIgYpAwgiCSAFKAIAKAIAIggpAwgiClIEQCAJIApTDQEMAwsgBikDACAIKQMAVw0CCyADQQA2AgAgACgCACEGIAAgBzYCACAGBEAgBhAiCyADIgAgAkcNAAsgAgwBCyAACyEAIAUoAgAhBiAFQQA2AgAgACgCACEDIAAgBjYCACADRQ0BIAMQIgwBCyAFQQA2AgAgBCAHNgIACyAFQQRqIgUgAUcNAAsLDwsgACAAIANBAXYiBkECdCIHaiIFIAIgBiAEIAYQsAEgBSABIAIgAyAGayICIAQgB2ogAhCwAQJAIAUiAiAARwRAA0AgASAFRgRAIAAgAkYNAwNAIAAoAgAhASAAQQA2AgAgBCABNgIAIARBBGohBCAAQQRqIgAgAkcNAAsMAwsCQAJAAkAgACgCACIDKAIAIgYpAwgiCSAFKAIAIgcoAgAiCCkDCCIKUgRAIAkgClMNAQwCCyAGKQMAIAgpAwBXDQELIAVBADYCACAEIAc2AgAgBUEEaiEFDAELIABBADYCACAEIAM2AgAgAEEEaiEACyAEQQRqIQQgACACRw0ACwsgASAFRg0AA0AgBSgCACEAIAVBADYCACAEIAA2AgAgBEEEaiEEIAVBBGoiBSABRw0ACwsLDwsgAEEANgIAIAQgAjYCACABKAIAIQAgAUEANgIAIAQgADYCBAseAQJ/IAAoAgQgACgCACICa0EEdQRAIAAgAjYCBAsLjzMBCn8jAEEgayIFJAADQCABQcgAayEKIAFBMGshDCABQRhrIQkCQANAAkACQAJAAkACQCABIABrIghBGG0iBg4GBgYAAQIDBAsgAUEYayIBIAAgAigCABECAEUNBSAFIAApAxA3AxggBSAAKQMINwMQIAUgACkDADcDCCAAIAEpAxA3AxAgACABKQMINwMIIAAgASkDADcDACABIAUpAxg3AxAgASAFKQMQNwMIIAEgBSkDCDcDAAwFCyAAQRhqIgMgACACKAIAEQIAIAFBGGsiASADIAIoAgARAgAhBEUEQCAERQ0FIAUgAykDEDcDGCAFIAMpAwg3AxAgBSADKQMANwMIIAMgASkDEDcDECADIAEpAwg3AwggAyABKQMANwMAIAEgBSkDGDcDECABIAUpAxA3AwggASAFKQMINwMAIAMgACACKAIAEQIARQ0FIAUgACkDEDcDGCAFIAApAwg3AxAgBSAAKQMANwMIIAAgAykDEDcDECAAIAMpAwg3AwggACADKQMANwMAIAMgBSkDGDcDECADIAUpAxA3AwggAyAFKQMINwMADAULIAQEQCAFIAApAxA3AxggBSAAKQMINwMQIAUgACkDADcDCCAAIAEpAxA3AxAgACABKQMINwMIIAAgASkDADcDACABIAUpAxg3AxAgASAFKQMQNwMIIAEgBSkDCDcDAAwFCyAFIAApAxA3AxggBSAAKQMINwMQIAUgACkDADcDCCAAIAMpAxA3AxAgACADKQMINwMIIAAgAykDADcDACADIAUpAxg3AxAgAyAFKQMQNwMIIAMgBSkDCDcDACABIAMgAigCABECAEUNBCAFIAMpAxA3AxggBSADKQMINwMQIAUgAykDADcDCCADIAEpAxA3AxAgAyABKQMINwMIIAMgASkDADcDACABIAUpAxg3AxAgASAFKQMQNwMIIAEgBSkDCDcDAAwECyABQRhrIQQgAEEYaiIBIAAgAigCABECACEIIABBMGoiAyABIAIoAgARAgAhBgJAIAhFBEAgBkUNASAFIAEpAxA3AxggBSABKQMINwMQIAUgASkDADcDCCABIAMpAxA3AxAgASADKQMINwMIIAEgAykDADcDACADIAUpAxg3AxAgAyAFKQMQNwMIIAMgBSkDCDcDACABIAAgAigCABECAEUNASAFIAApAxA3AxggBSAAKQMINwMQIAUgACkDADcDCCAAIAEpAxA3AxAgACABKQMINwMIIAAgASkDADcDACABIAUpAxg3AxAgASAFKQMQNwMIIAEgBSkDCDcDAAwBCyAGBEAgBSAAKQMQNwMYIAUgACkDCDcDECAFIAApAwA3AwggACADKQMQNwMQIAAgAykDCDcDCCAAIAMpAwA3AwAgAyAFKQMYNwMQIAMgBSkDEDcDCCADIAUpAwg3AwAMAQsgBSAAKQMQNwMYIAUgACkDCDcDECAFIAApAwA3AwggACABKQMQNwMQIAAgASkDCDcDCCAAIAEpAwA3AwAgASAFKQMYNwMQIAEgBSkDEDcDCCABIAUpAwg3AwAgAyABIAIoAgARAgBFDQAgBSABKQMQNwMYIAUgASkDCDcDECAFIAEpAwA3AwggASADKQMQNwMQIAEgAykDCDcDCCABIAMpAwA3AwAgAyAFKQMYNwMQIAMgBSkDEDcDCCADIAUpAwg3AwALIAQgAyACKAIAEQIARQ0DIAUgAykDEDcDGCAFIAMpAwg3AxAgBSADKQMANwMIIAMgBCkDEDcDECADIAQpAwg3AwggAyAEKQMANwMAIAQgBSkDGDcDECAEIAUpAxA3AwggBCAFKQMINwMAIAMgASACKAIAEQIARQ0DIAUgASkDEDcDGCAFIAEpAwg3AxAgBSABKQMANwMIIAEgAykDEDcDECABIAMpAwg3AwggASADKQMANwMAIAMgBSkDGDcDECADIAUpAxA3AwggAyAFKQMINwMAIAEgACACKAIAEQIARQ0DIAUgACkDEDcDGCAFIAApAwg3AxAgBSAAKQMANwMIIAAgASkDEDcDECAAIAEpAwg3AwggACABKQMANwMAIAEgBSkDGDcDECABIAUpAxA3AwggASAFKQMINwMADAMLIAAgAEEYaiAAQTBqIABByABqIAFBGGsgAhCyAwwCCyAIQb8ETARAIARBAXEEQCACIQYjAEEgayIHJAACQCAAIgIgASIIRg0AIAEgAEEYaiIBRg0AA0AgASIDIAAgBigCABECAARAIAcgASkDEDcDGCAHIAEpAwg3AxAgByABKQMANwMIIAEhBANAAkAgBCAAIgEpAxA3AxAgBCAAKQMINwMIIAQgACkDADcDACAAIAJGBEAgAiEBDAELIAEhBCAHQQhqIAFBGGsiACAGKAIAEQIADQELCyABIAcpAxg3AxAgASAHKQMQNwMIIAEgBykDCDcDAAsgAyIAQRhqIgEgCEcNAAsLIAdBIGokAAwDCyACIQMjAEEgayIIJAACQCABIgYgAEYNACAAQRhqIgEgBkYNAANAIAEiAiAAIAMoAgARAgAEQCAIIAEpAxA3AxggCCABKQMINwMQIAggASkDADcDCANAIAEiBCAAIgEpAxA3AxAgBCAAKQMINwMIIAQgACkDADcDACAIQQhqIABBGGsiACADKAIAEQIADQALIAEgCCkDGDcDECABIAgpAxA3AwggASAIKQMINwMACyACIgBBGGoiASAGRw0ACwsgCEEgaiQADAILIANFBEAgACABRg0CIwBBIGsiCSQAIAEgACIERwRAIAEgAGsiBkEYbSEIIAZBGU4EQCAIQQJrQQF2IQADQCAEIAIgCCAEIAAiA0EYbGoQrwMgAEEBayEAIAMNAAsLIAEiACAARwRAA0AgACAEIAIoAgARAgAEQCAJIAApAxA3AxggCSAAKQMINwMQIAkgACkDADcDCCAAIAQpAxA3AxAgACAEKQMINwMIIAAgBCkDADcDACAEIAkpAxg3AxAgBCAJKQMQNwMIIAQgCSkDCDcDACAEIAIgCCAEEK8DCyAAQRhqIgAgAUcNAAsLIAZBGU4EQCAGQRhuIQMDQCAJIAQpAxA3AxggCSAEKQMINwMQIAkgBCkDADcDCCADIgZBAmtBAXYhCkEAIQggBCEAA0AgCEEBdCIMQQFyIQcgACAIQRhsaiIIQRhqIQMgBiAMQQJqIgxMBH8gBwUgCEEwaiIIIAMgAyAIIAIoAgARAgAiCBshAyAMIAcgCBsLIQggACADKQMQNwMQIAAgAykDCDcDCCAAIAMpAwA3AwAgAyEAIAggCkwNAAsCQCABQRhrIgEgAEYEQCAAIAkpAxg3AxAgACAJKQMQNwMIIAAgCSkDCDcDAAwBCyADIAEpAxA3AxAgAyABKQMINwMIIAMgASkDADcDACABIAkpAwg3AwAgASAJKQMQNwMIIAEgCSkDGDcDECMAQSBrIgckAAJAIANBGGoiACAEa0EYbSIDQQJIDQAgBCADQQJrQQF2IgpBGGxqIgggAEEYayIDIAIoAgARAgBFDQAgByADKQMQNwMYIAcgAykDCDcDECAHIAMpAwA3AwgDQAJAIAMgCCIAKQMQNwMQIAMgACkDCDcDCCADIAApAwA3AwAgCkUNACAAIQMgBCAKQQFrQQF2IgpBGGxqIgggB0EIaiACKAIAEQIADQELCyAAIAcpAxg3AxAgACAHKQMQNwMIIAAgBykDCDcDAAsgB0EgaiQACyAGQQFrIQMgBkECSg0ACwsLIAlBIGokAAwCCyAAIAZBAXZBGGxqIQYgAigCACEHAkAgCEGBGE8EQCAGIAAgBxECACEHIAkgBiACKAIAEQIAIQgCQCAHRQRAIAhFDQEgBSAGKQMQNwMYIAUgBikDCDcDECAFIAYpAwA3AwggBiAJKQMQNwMQIAYgCSkDCDcDCCAGIAkpAwA3AwAgCSAFKQMYNwMQIAkgBSkDEDcDCCAJIAUpAwg3AwAgBiAAIAIoAgARAgBFDQEgBSAAKQMQNwMYIAUgACkDCDcDECAFIAApAwA3AwggACAGKQMQNwMQIAAgBikDCDcDCCAAIAYpAwA3AwAgBiAFKQMYNwMQIAYgBSkDEDcDCCAGIAUpAwg3AwAMAQsgCARAIAUgACkDEDcDGCAFIAApAwg3AxAgBSAAKQMANwMIIAAgCSkDEDcDECAAIAkpAwg3AwggACAJKQMANwMAIAkgBSkDGDcDECAJIAUpAxA3AwggCSAFKQMINwMADAELIAUgACkDEDcDGCAFIAApAwg3AxAgBSAAKQMANwMIIAAgBikDEDcDECAAIAYpAwg3AwggACAGKQMANwMAIAYgBSkDGDcDECAGIAUpAxA3AwggBiAFKQMINwMAIAkgBiACKAIAEQIARQ0AIAUgBikDEDcDGCAFIAYpAwg3AxAgBSAGKQMANwMIIAYgCSkDEDcDECAGIAkpAwg3AwggBiAJKQMANwMAIAkgBSkDGDcDECAJIAUpAxA3AwggCSAFKQMINwMACyAGQRhrIgggAEEYaiIHIAIoAgARAgAhDSAMIAggAigCABECACELAkAgDUUEQCALRQ0BIAUgCCkDEDcDGCAFIAgpAwg3AxAgBSAIKQMANwMIIAggDCkDEDcDECAIIAwpAwg3AwggCCAMKQMANwMAIAwgBSkDGDcDECAMIAUpAxA3AwggDCAFKQMINwMAIAggByACKAIAEQIARQ0BIAUgBykDEDcDGCAFIAcpAwg3AxAgBSAHKQMANwMIIAcgCCkDEDcDECAHIAgpAwg3AwggByAIKQMANwMAIAggBSkDGDcDECAIIAUpAxA3AwggCCAFKQMINwMADAELIAsEQCAFIAcpAxA3AxggBSAHKQMINwMQIAUgBykDADcDCCAHIAwpAxA3AxAgByAMKQMINwMIIAcgDCkDADcDACAMIAUpAxg3AxAgDCAFKQMQNwMIIAwgBSkDCDcDAAwBCyAFIAcpAxA3AxggBSAHKQMINwMQIAUgBykDADcDCCAHIAgpAxA3AxAgByAIKQMINwMIIAcgCCkDADcDACAIIAUpAxg3AxAgCCAFKQMQNwMIIAggBSkDCDcDACAMIAggAigCABECAEUNACAFIAgpAxA3AxggBSAIKQMINwMQIAUgCCkDADcDCCAIIAwpAxA3AxAgCCAMKQMINwMIIAggDCkDADcDACAMIAUpAxg3AxAgDCAFKQMQNwMIIAwgBSkDCDcDAAsgBkEYaiIHIABBMGoiCyACKAIAEQIAIQ4gCiAHIAIoAgARAgAhDQJAIA5FBEAgDUUNASAFIAcpAxA3AxggBSAHKQMINwMQIAUgBykDADcDCCAHIAopAxA3AxAgByAKKQMINwMIIAcgCikDADcDACAKIAUpAxg3AxAgCiAFKQMQNwMIIAogBSkDCDcDACAHIAsgAigCABECAEUNASAFIAspAxA3AxggBSALKQMINwMQIAUgCykDADcDCCALIAcpAxA3AxAgCyAHKQMINwMIIAsgBykDADcDACAHIAUpAxg3AxAgByAFKQMQNwMIIAcgBSkDCDcDAAwBCyANBEAgBSALKQMQNwMYIAUgCykDCDcDECAFIAspAwA3AwggCyAKKQMQNwMQIAsgCikDCDcDCCALIAopAwA3AwAgCiAFKQMYNwMQIAogBSkDEDcDCCAKIAUpAwg3AwAMAQsgBSALKQMQNwMYIAUgCykDCDcDECAFIAspAwA3AwggCyAHKQMQNwMQIAsgBykDCDcDCCALIAcpAwA3AwAgByAFKQMYNwMQIAcgBSkDEDcDCCAHIAUpAwg3AwAgCiAHIAIoAgARAgBFDQAgBSAHKQMQNwMYIAUgBykDCDcDECAFIAcpAwA3AwggByAKKQMQNwMQIAcgCikDCDcDCCAHIAopAwA3AwAgCiAFKQMYNwMQIAogBSkDEDcDCCAKIAUpAwg3AwALIAYgCCACKAIAEQIAIQ0gByAGIAIoAgARAgAhCwJAIA1FBEAgC0UNASAFIAYpAxA3AxggBSAGKQMINwMQIAUgBikDADcDCCAGIAcpAxA3AxAgBiAHKQMINwMIIAYgBykDADcDACAHIAUpAxg3AxAgByAFKQMQNwMIIAcgBSkDCDcDACAGIAggAigCABECAEUNASAFIAgpAxA3AxggBSAIKQMINwMQIAUgCCkDADcDCCAIIAYpAxA3AxAgCCAGKQMINwMIIAggBikDADcDACAGIAUpAxg3AxAgBiAFKQMQNwMIIAYgBSkDCDcDAAwBCyALBEAgBSAIKQMQNwMYIAUgCCkDCDcDECAFIAgpAwA3AwggCCAHKQMQNwMQIAggBykDCDcDCCAIIAcpAwA3AwAgByAFKQMYNwMQIAcgBSkDEDcDCCAHIAUpAwg3AwAMAQsgBSAIKQMQNwMYIAUgCCkDCDcDECAFIAgpAwA3AwggCCAGKQMQNwMQIAggBikDCDcDCCAIIAYpAwA3AwAgBiAFKQMYNwMQIAYgBSkDEDcDCCAGIAUpAwg3AwAgByAGIAIoAgARAgBFDQAgBSAGKQMQNwMYIAUgBikDCDcDECAFIAYpAwA3AwggBiAHKQMQNwMQIAYgBykDCDcDCCAGIAcpAwA3AwAgByAFKQMYNwMQIAcgBSkDEDcDCCAHIAUpAwg3AwALIAUgACkDEDcDGCAFIAApAwg3AxAgBSAAKQMANwMIIAAgBikDEDcDECAAIAYpAwg3AwggACAGKQMANwMAIAYgBSkDGDcDECAGIAUpAxA3AwggBiAFKQMINwMADAELIAAgBiAHEQIAIAkgACACKAIAEQIAIQhFBEAgCEUNASAFIAApAxA3AxggBSAAKQMINwMQIAUgACkDADcDCCAAIAkpAxA3AxAgACAJKQMINwMIIAAgCSkDADcDACAJIAUpAxg3AxAgCSAFKQMQNwMIIAkgBSkDCDcDACAAIAYgAigCABECAEUNASAFIAYpAxA3AxggBSAGKQMINwMQIAUgBikDADcDCCAGIAApAxA3AxAgBiAAKQMINwMIIAYgACkDADcDACAAIAUpAxg3AxAgACAFKQMQNwMIIAAgBSkDCDcDAAwBCyAIBEAgBSAGKQMQNwMYIAUgBikDCDcDECAFIAYpAwA3AwggBiAJKQMQNwMQIAYgCSkDCDcDCCAGIAkpAwA3AwAgCSAFKQMYNwMQIAkgBSkDEDcDCCAJIAUpAwg3AwAMAQsgBSAGKQMQNwMYIAUgBikDCDcDECAFIAYpAwA3AwggBiAAKQMQNwMQIAYgACkDCDcDCCAGIAApAwA3AwAgACAFKQMYNwMQIAAgBSkDEDcDCCAAIAUpAwg3AwAgCSAAIAIoAgARAgBFDQAgBSAAKQMQNwMYIAUgACkDCDcDECAFIAApAwA3AwggACAJKQMQNwMQIAAgCSkDCDcDCCAAIAkpAwA3AwAgCSAFKQMYNwMQIAkgBSkDEDcDCCAJIAUpAwg3AwALIANBAWshAwJAIARBAXEiCw0AIABBGGsgACACKAIAEQIADQBBACEEIwBBMGsiByQAIAcgACkDEDcDECAHIAApAwg3AwggByAAKQMANwMAAkAgByABIghBGGsgAigCABECAARAIAAhBgNAIAcgBkEYaiIGIAIoAgARAgBFDQALDAELIAAhBgNAIAZBGGoiBiAITw0BIAcgBiACKAIAEQIARQ0ACwsgBiAISQRAA0AgByAIQRhrIgggAigCABECAA0ACwsgBiAISQRAA0AgByAGKQMQNwMoIAcgBikDCDcDICAHIAYpAwA3AxggBiAIKQMQNwMQIAYgCCkDCDcDCCAGIAgpAwA3AwAgCCAHKQMoNwMQIAggBykDIDcDCCAIIAcpAxg3AwADQCAHIAZBGGoiBiACKAIAEQIARQ0ACwNAIAcgCEEYayIIIAIoAgARAgANAAsgBiAISQ0ACwsgBkEYayIIIABHBEAgACAIKQMQNwMQIAAgCCkDCDcDCCAAIAgpAwA3AwALIAggBykDEDcDECAIIAcpAwg3AwggCCAHKQMANwMAIAdBMGokACAGIQAMAQsLIAEhByMAQTBrIgkkACAJIAApAxA3AxAgCSAAKQMINwMIIAkgACkDADcDACAAIQYDQCAGIghBGGoiBiAJIAIoAgARAgANAAsCQCAAIAhGBEADQCAGIAdPDQIgB0EYayIHIAkgAigCABECAEUNAAwCCwALA0AgB0EYayIHIAkgAigCABECAEUNAAsLIAYgB08iCkUEQANAIAkgBikDEDcDKCAJIAYpAwg3AyAgCSAGKQMANwMYIAYgBykDEDcDECAGIAcpAwg3AwggBiAHKQMANwMAIAcgCSkDKDcDECAHIAkpAyA3AwggByAJKQMYNwMAA0AgBiIIQRhqIgYgCSACKAIAEQIADQALA0AgB0EYayIHIAkgAigCABECAEUNAAsgBiAHSQ0ACwsgACAIRwRAIAAgCCkDEDcDECAAIAgpAwg3AwggACAIKQMANwMACyAIIAkpAxA3AxAgCCAJKQMINwMIIAggCSkDADcDACAFIAo6AAwgBSAINgIIIAlBMGokACAFKAIIIQgCQCAFLQAMQQFHDQAgACAIIAIQsAMhByAIQRhqIgYgASACELADBEAgCCEBIAdFDQMMAgsgB0UNACAGIQAMAgsgACAIIAIgAyALELcDIAhBGGohAEEAIQQMAQsLIAVBIGokAAubFgIOfwZ+IwBBMGsiBiQAIAZCADcDECAGQgA3AwggASgCMCEDIAEoAlQiAikDCCEQAkAgASgCWC0ACCIOQQFGBEAgA0EASgRAA0AgAiIDKAIQIgIpAwggEFINAyADLQAYQQZxRQ0ADAMLAAsDQCACIgMoAhQiAikDCCAQUg0CIAMtABhBBnFFDQALDAELIANBAEoEQANAIAIiAygCECICKQMIIBBRDQAMAgsACwNAIAIiAygCFCICKQMIIBBRDQALCyADKAIYQR10QR91IANxIQkgASkDICEQAn4CQCABKQMQIhIgASkDAFEEQCABIQIDQCACKAJEIgJBAEchAyACRQ0CIAIoAlQgCUcNAAsMAQsgECASIBAgElUbIRUgECASIBAgElMiAxsMAQsgECEVIBALIRICQAJAIAEoAjxFDQAgBiABKQMINwMgIAYgEDcDGCABIAZBGGoQYyIHKAIYLQBMDQACQCAAKAJgIgIgACgCZCIFSQRAIAJBAToACCACQQA2AgQgAiAHNgIAIAJBDGohBQwBCyACIABB3ABqIgQoAgAiCmtBDG0iDEEBaiICQdaq1aoBTw0CIAZBGGpB1arVqgEgBSAKa0EMbSIFQQF0IgogAiACIApJGyAFQarVqtUATxsgDCAEEGEiAigCCCIFQQE6AAggBUEANgIEIAUgBzYCACACIAVBDGo2AgggAigCBCAAKAJgIAAoAlwiB2siBUF0bUEMbGohBCAFBEAgBCAHIAX8CgAACyAAKAJcIQcgACAENgJcIAIgBzYCBCAAIAIoAggiBTYCYCACIAc2AgggACgCZCEEIAAgAigCDDYCZCACIAc2AgAgAiAENgIMIAIQ1gELIAAgBTYCYAsgAUEQaiEHIABB3ABqIQogAUFAayEMIAFBxABqIQ0DQAJAAkACQCANIAwgAxsoAgAiAkUNAANAIAkgAigCVEYEQAJAIAEoAjxFDQAgAigCYARAIAAgAiACQRBqEH4gASgCPEUNAQsgCSABKAJURwRAA0AgASAHEGMaIAAgARD+ASABKAJUIAlHDQALCyADBEAgACABIAIgBxCGAQwBCyAAIAIgASAHEIYBCwJAIAIoAkQiAyACKAJAIgVyRQRAIAIgACgCHCIHRw0BCwJAIAUEQCAFIAM2AkQMAQsgACADNgIcCyADBEAgAyAFNgJACyACECIgACgCHCEHCyABKAJEIgIgASgCQCIDckUgASAHR3ENAwJAIAMEQCADIAI2AkQMAQsgACACNgIcCyACBEAgAiADNgJACyABECIMAwsCfwJAAkACQAJAIAkgASgCVCIERw0AIAQtABhBA3ENACACKQMgIRQMAQsgAikDICEUAkAgAwRAIBQgFVcNAQwHCyASIBRVDQYLIBQgBykDAFINACACKQMYIhEgAikDCFENACACQSBqIQUgBiAEQRBBFCABKAIwQQBKG2ooAgAiBCkDCDcDECAGIAQpAwA3AwggAigCWCIELQAIIQgCQCADBEACQCAIQQFxRQ0AIAQoAgQgASgCWCgCBEYNACACKAI8DQAgAikDECEQAkAgBikDECITIBFRDQAgECACKQMAIhFRDQAgAikDCCIQIBNRBEAgESEQDAELIBEgAisDKCATIBB9uaKe/AZ8IRALIBAgBikDCFUNCAwCCyACKQMQIRACQCAGKQMQIhMgEVENACAQIAIpAwAiEVENACACKQMIIhAgE1EEQCARIRAMAQsgESACKwMoIBMgEH25op78BnwhEAsgECAGKQMIUw0BDAcLAkACQCAIQQFxRQ0AIAQoAgQgASgCWCgCBEYNACACKAI8DQAgAikDECEQAkAgBikDECITIBFRDQAgECACKQMAIhFRDQAgAikDCCIQIBNRBEAgESEQDAELIBEgAisDKCATIBB9uaKe/AZ8IRALIBAgBikDCFkNAQwICyACKQMQIRACQCAGKQMQIhMgEVENACAQIAIpAwAiEVENACACKQMIIhAgE1EEQCARIRAMAQsgESACKwMoIBMgEH25op78BnwhEAsgECAGKQMIVw0HCyAGIAEpAwg3AxAgBiAUNwMIDAMLIAYgASkDCDcDECAGIBQ3AwgMAQsgBiABKQMINwMQIAYgFDcDCCACQSBqIQUgA0UNAQsgACABIAIgBkEIahDcASACKAJEIgQEQCAEIAE2AkALIAwoAgAiCARAIAggAjYCRAsgAiABNgJEIAIgCDYCQCABIAQ2AkQgASACNgJAIAIoAkBFBEAgACACNgIcCyAAIAIgBkEIakEAEIECIA0MAQsgACACIAEgBkEIahDcASABKAJEIgQEQCAEIAI2AkALIAIoAkAiCARAIAggATYCRAsgASACNgJEIAEgCDYCQCACIAQ2AkQgAiABNgJAIAEoAkBFBEAgACABNgIcCyAAIAIgBkEIakEAEIACIAwLIAEgBSkDADcDICgCACECAkAgASgCPCIERQ0AIAQoAhAhBSAEKAIIIAFHBEAgBSgCECEFCyAFKAIYLQBMDQACQCAAKAJgIgQgACgCZCIISQRAIARBAToACCAEQQA2AgQgBCAFNgIAIARBDGohBQwBCyAEIAooAgAiC2tBDG0iD0EBaiIEQdaq1aoBTw0HIAZBGGpB1arVqgEgCCALa0EMbSIIQQF0IgsgBCAEIAtJGyAIQarVqtUATxsgDyAKEGEhCCAGKAIgIgRBAToACCAEQQA2AgQgBCAFNgIAIAYgBEEMajYCICAGKAIcIAAoAmAgACgCXCIEayIFQXRtQQxsaiELIAUEQCALIAQgBfwKAAALIAAoAlwhBCAAIAs2AlwgBiAENgIcIAAgBigCICIFNgJgIAYgBDYCICAAKAJkIQsgACAGKAIkNgJkIAYgCzYCJCAIIAQ2AgAgCBDWAQsgACAFNgJgCyACDQALCyABKAJUIQICQCAORQ0AIAItABhBA3FFDQAgASgCPARAIAEgBxBjGgJAIAEoAjwiAigCCCABRgRAIAJBADYCCAwBCyACQQA2AgwLIAFBADYCPAsgASgCRCICIAEoAkAiA3JFBEAgASAAKAIcRw0CCwJAIAMEQCADIAI2AkQMAQsgACACNgIcCyACBEAgAiADNgJACyABECIMAQsgASgCPCEDIAJBEEEUIAEoAjBBAEobaigCACkDCCABKQMYUQRAIAMEQCABIAcQYxoLIAAgARD+ASABKQMgIRIgASICKQMQIhAgAikDAFEEQANAIAIoAkQiAkEARyEDIAJFDQQgAigCVCAJRw0ADAQLAAsgEiAQIBAgElMbIRUgEiAQIBAgElUiAxshEgwDCwJAIANFDQAgASAHEGMiBSgCGC0ATA0AAkAgACgCYCICIAAoAmQiA0kEQCACQQE6AAggAkEANgIEIAIgBTYCACACQQxqIQMMAQsgAiAKKAIAIgdrQQxtIglBAWoiAkHWqtWqAU8NBSAGQRhqQdWq1aoBIAMgB2tBDG0iA0EBdCIHIAIgAiAHSRsgA0Gq1arVAE8bIAkgChBhIgIoAggiA0EBOgAIIANBADYCBCADIAU2AgAgAiADQQxqNgIIIAIoAgQgACgCYCAAKAJcIgVrIgNBdG1BDGxqIQcgAwRAIAcgBSAD/AoAAAsgACgCXCEFIAAgBzYCXCACIAU2AgQgACACKAIIIgM2AmAgAiAFNgIIIAAoAmQhByAAIAIoAgw2AmQgAiAFNgIAIAIgBzYCDCACENYBCyAAIAM2AmALIAAgARD+AQsgBkEwaiQADwsgEiEVDAALAAsQJgALzQUCDH8DfiAAKAJAIgUgACgCRCIJRwRAIAEgBSkDACIQNwMAAkAgCSAFa0EDdSILQQJIDQAgC0ECa0EBdiEKIAUhAwNAIARBAXQiCEEBciEGIAMgBEEDdGoiB0EIaiECIAMCfiALIAhBAmoiBEwEQCAGIQQgAikDAAwBCyAEIAYgAikDACIOIAdBEGoiBykDACIPUyIGGyEEIAcgAiAGGyECIA4gDyAOIA9VGws3AwAgAiEDIAQgCkwNAAsgCUEIayIDIAJGBEAgAiAQNwMADAELIAIgAykDADcDACADIBA3AwAgAiAFa0EIakEDdSIDQQJIDQAgBSADQQJrQQF2IgRBA3RqIgMpAwAiDiACKQMAIg9ZDQADQAJAIAMhBiACIA43AwAgBEUNACADIQIgBSAEQQFrQQF2IgRBA3RqIgMpAwAiDiAPUw0BCwsgBiAPNwMACwJAIAUgCUEIayICRg0AIAkhBgNAIAYhByACIQYgASkDACIQIAUpAwBSDQECQCACIAVrQQN1IgxBAkgNACAMQQJrQQF2IQ1BACEEIAUhAwNAIARBAXQiC0EBciEIIAMgBEEDdGoiCkEIaiECIAMCfiAMIAtBAmoiBEwEQCAIIQQgAikDAAwBCyAEIAggAikDACIOIApBEGoiCikDACIPUyIIGyEEIAogAiAIGyECIA4gDyAOIA9VGws3AwAgAiEDIAQgDUwNAAsgB0EQayIDIAJGBEAgAiAQNwMADAELIAIgAykDADcDACADIBA3AwAgAiAFa0EIakEDdSIDQQJIDQAgBSADQQJrQQF2IgRBA3RqIgMpAwAiDiACKQMAIg9ZDQADQAJAIAMhByACIA43AwAgBEUNACADIQIgBSAEQQFrQQF2IgRBA3RqIgMpAwAiDiAPUw0BCwsgByAPNwMACyAFIAZBCGsiAkcNAAsLIAAgAjYCRAsgBSAJRwuuBAILfwZ+QQIhCgJAIAEoAgQiAyABKAIAIgdrQSFJDQACQCAHIgQgA0YNACAAKQMIIQ8DQCAEKQMIIA9SDQEgBEEQaiIEIANHDQALCyADIARGDQAgBCkDCCIRIAApAwgiD1MhCCADIQkgDyEOIAQhAgNAIAJBEGohAiAAKQMAIQ0gCEEBcSEMAkACQAJAAkADQAJAAkAgAiADRwRAIAIhBgwBCyAEIAdGDQEgByEGIAIgBCIDRg0BCwJAIAxFBEAgBiICIANGDQEDQCACKQMIIA5XDQIgAkEQaiICIANHDQALDAELAkAgBiICIANGDQADQCACKQMIIA5ZDQEgAkEQaiICIANHDQALCwsgAiADRg0BIAkgAiACIAdGGyIGQRBrIQsgAikDACEQIAIpAwggDlINAkEAIQogDSAQUQ0HIAZBCGspAwAgDlEEQCANIAspAwBTIA0gEFlGDQgLIAJBEGoiAiAERw0BCwtBAUECIAhBAXEgDyARVUcEfyAJIAkgAiACIAdGGyACIAlGIgEbQRBrIAcgAiABGyAAEIcBIgBFDQJBASAFayAFIAggAEEATnNBAXEbBSAFCxshCgwFCyANIBBTIAspAwAiEiANVXENAiANIBBXIA0gEldyRQRAQQEgBWshBQwDCyALIAIgABCHASIGDQELQQAPC0EBIAVrIAUgCCAGQQBOc0EBcRshBSABKAIEIQkgACkDCCEOCyAIQQFzIQgMAAsACyAKC7UFAgd/An4jAEEgayIHJAAgAEEANgIIIABCADcCAAJAIAEiAiACKAIQIgNGDQAgAikDACEJA0ACQCADKQMAIgogCVEEQCAJIAIoAhQpAwBRDQELIAIpAwgiCSADKQMIUg0CIAkgAigCFCkDCFINAgsgCiEJIAMiAigCECIDIAFHDQALCyAHQQxqQQFBACAAEDIiBCgCCCIDIAIpAwg3AwggAyACKQMANwMAIAQgBCgCCEEQajYCCCAEKAIEIAAoAgQgACgCACIDayIFayEGIAUEQCAGIAMgBfwKAAALIAAoAgAhBSAAIAY2AgAgBCAFNgIEIAAgBCgCCCIINgIEIAQgBTYCCCAAKAIIIQMgACAEKAIMNgIIIAQgBTYCACAEIAM2AgwgBBA2IAAgCDYCBAJAIAEgAigCECIGRwRAA0ACQCAGIgMpAwAiCiADKAIQIgYpAwBRBEAgCiACKQMAUQ0BCyADKQMIIgogBikDCFEEQCAKIAIpAwhRDQELAkAgACgCCCIGIAhLBEAgCCADKQMINwMIIAggAykDADcDACAIQRBqIQgMAQsgCCAAKAIAIgJrQQR1IgVBAWoiBEGAgICAAU8NBCAHQQxqQf////8AIAYgAmsiBkEDdSICIAQgAiAESxsgBkHw////B08bIAUgABAyIQQgBygCFCICIAMpAwg3AwggAiADKQMANwMAIAcgBygCFEEQajYCFCAHKAIQIAAoAgQgACgCACICayIFayEGIAUEQCAGIAIgBfwKAAALIAAoAgAhBSAAIAY2AgAgByAFNgIQIAAgBygCFCIINgIEIAcgBTYCFCAAKAIIIQIgACAHKAIYNgIIIAcgAjYCGCAEIAU2AgAgBBA2CyAAIAg2AgQgAygCECEGIAMhAgsgASAGRw0ACwsgB0EgaiQADwsQJgALcAIEfgN8IAIpAwghBCABKQMIIQMCfCACKQMAIgYgASkDACIFUQRARAAAAAAAAAAAIAMgBFENARoLIAApAwAgBX25IAQgA325IgeiIAYgBX25IgggACkDCCADfbmioSIJIAmiIAggCKIgByAHoqCjCws+AQJ/IAAoAgQiAiABRwRAA0AgAkEEayICKAIAIQMgAkEANgIAIAMEQCADECILIAEgAkcNAAsLIAAgATYCBAuhAwEEfyMAQSBrIgYkAAJAIAEoAhgiA0EIcUUEQCABIANBCHI2AhhBDBAjIgNBADoACCADIAI2AgQgAyABNgIAAkAgACgCBCIBIAAoAggiAkkEQCABIAM2AgAgAUEEaiEDDAELIAEgACgCACIEa0ECdSIFQQFqIgFBgICAgARPDQIgBkEMakH/////AyACIARrIgJBAXUiBCABIAEgBEkbIAJB/P///wdPGyAFIAAQSiIBKAIIIgIgAzYCACABIAJBBGo2AgggASgCBCAAKAIEIAAoAgAiBGsiAmshAyACBEAgAyAEIAL8CgAACyAAKAIAIQIgACADNgIAIAEgAjYCBCAAIAEoAggiAzYCBCABIAI2AgggACgCCCEEIAAgASgCDDYCCCABIAI2AgAgASAENgIMIAEoAgQiBSABKAIIIgJHBEADQCABIAJBBGsiAjYCCCACKAIAIQQgAkEANgIAIAQEQCAEECIgASgCCCECCyACIAVHDQALCyABKAIAIgIEQCABKAIMGiACECILCyAAIAM2AgQLIAZBIGokAA8LECYAC3gBAn8gACgCPCICIAEoAjwiA0YEQCACIAIpAwhCIIk3AwgPCwJAIAJFDQAgAigCCCAARgRAIAIgATYCCAwBCyACIAE2AgwLAkAgA0UNACADKAIIIAFGBEAgAyAANgIIDAELIAMgADYCDAsgACADNgI8IAEgAjYCPAtqAQJ/IwBBEGsiBCQAIAIEQCADIAJBDGxqIQIDQCAEIAA2AgwgBCABEDwhBSADEEUgAyAFKAIANgIAIAMgBCgCBDYCBCADIAQoAgg2AgggAUEMaiEBIANBDGoiAyACRw0ACwsgBEEQaiQAC/wBAQR/IwBBEGsiByQAIAAoAgQiBiEEIAIgASAGIANraiIFSwRAIAUhAwNAIARBADYCCCAEQgA3AgAgBCADKAIANgIAIAQgAygCBDYCBCAEIAMoAgg2AgggA0EANgIIIANCADcCACAEQQxqIQQgA0EMaiIDIAJJDQALCyAAIAQ2AgQgBiEAIAEiAyAFIgZHBEADQCAAIgFBDGsiABBFIAAgBUEMayICKAIANgIAIAFBCGsgBUEIaygCADYCACABQQRrIAVBBGsiASgCADYCACABQQA2AgAgAkIANwIAIAIiBSADRw0ACwsgByAANgIMIAcgBjYCCCAHQRBqJAAL9QMBBn8jAEGQAWsiBCQAAkAgAkECSA0AIAJBAmtBAXYiCSADIABrIgZBBHVIDQAgACAGQQN1IgZBAWoiB0EEdGohBSACIAZBAmoiBkoEQCABKAIAIQggBCAFKQMINwN4IAQgBSkDADcDcCAEIAUpAxA3A2AgBCAFKQMYNwNoIAYgByAEQfAAaiAEQeAAaiAIEQIAIgYbIQcgBUEQaiAFIAYbIQULIAEoAgAhBiAEIAUpAwg3A1ggBCAFKQMANwNQIAQgAykDADcDQCAEIAMpAwg3A0ggBEHQAGogBEFAayAGEQIADQAgBCADKQMINwOIASAEIAMpAwA3A4ABA0ACQCADIAUiBikDCDcDCCADIAUpAwA3AwAgByAJSg0AIAAgB0EBdCIDQQFyIgdBBHRqIQUgAiADQQJqIgNKBEAgASgCACEIIAQgBSkDCDcDOCAEIAUpAwA3AzAgBCAFKQMQNwMgIAQgBSkDGDcDKCADIAcgBEEwaiAEQSBqIAgRAgAiAxshByAFQRBqIAUgAxshBQsgASgCACEIIAQgBSkDCDcDGCAEIAUpAwA3AxAgBCAEKQOAATcDACAEIAQpA4gBNwMIIAYhAyAEQRBqIAQgCBECAEUNAQsLIAYgBCkDiAE3AwggBiAEKQOAATcDAAsgBEGQAWokAAv8FQEHfyMAQeAEayIDJABBASEGAkACQAJAAkACQAJAIAEgAGtBBHUOBgUFAAECAwQLIAIoAgAhAiADIAFBEGsiASkDCDcD2AEgAyABKQMANwPQASADIAApAwA3A8ABIAMgACkDCDcDyAEgA0HQAWogA0HAAWogAhECAEUNBCADIAApAwg3A9gEIAMgACkDADcD0AQgACABKQMINwMIIAAgASkDADcDACABIAMpA9gENwMIIAEgAykD0AQ3AwAMBAsgAigCACEEIAMgACkDGDcD2AIgAyAAKQMQNwPQAiADIAApAwA3A8ACIAMgACkDCDcDyAIgA0HQAmogA0HAAmogBBECACACKAIAIQQgAyABQRBrIgEpAwg3A7gCIAMgASkDADcDsAIgAyAAKQMQNwOgAiADIAApAxg3A6gCIANBsAJqIANBoAJqIAQRAgAhBEUEQCAERQ0EIAMgACkDGDcD2AQgAyAAKQMQNwPQBCAAIAEpAwg3AxggACABKQMANwMQIAEgAykD2AQ3AwggASADKQPQBDcDACACKAIAIQEgAyAAKQMYNwOYAiADIAApAxA3A5ACIAMgACkDADcDgAIgAyAAKQMINwOIAiADQZACaiADQYACaiABEQIARQ0EIAMgACkDCDcD2AQgAyAAKQMANwPQBCAAIAApAxg3AwggACAAKQMQNwMAIAAgAykD2AQ3AxggACADKQPQBDcDEAwECyAEBEAgAyAAKQMINwPYBCADIAApAwA3A9AEIAAgASkDCDcDCCAAIAEpAwA3AwAgASADKQPYBDcDCCABIAMpA9AENwMADAQLIAMgACkDCDcD2AQgAyAAKQMANwPQBCAAIAApAxg3AwggACAAKQMQNwMAIAAgAykD2AQ3AxggACADKQPQBDcDECACKAIAIQIgAyABKQMINwP4ASADIAEpAwA3A/ABIAMgACkDEDcD4AEgAyAAKQMYNwPoASADQfABaiADQeABaiACEQIARQ0DIAMgACkDGDcD2AQgAyAAKQMQNwPQBCAAIAEpAwg3AxggACABKQMANwMQIAEgAykD2AQ3AwggASADKQPQBDcDAAwDCyACKAIAIQQgAyAAKQMYNwO4BCADIAApAxA3A7AEIAMgACkDADcDoAQgAyAAKQMINwOoBCADQbAEaiADQaAEaiAEEQIAIQUgAigCACEEIAMgACkDKDcDmAQgAyAAKQMgNwOQBCADIAApAxA3A4AEIAMgACkDGDcDiAQgAUEQayEBIANBkARqIANBgARqIAQRAgAhBAJAIAVFBEAgBEUNASADIAApAxg3A9gEIAMgACkDEDcD0AQgACAAKQMoNwMYIAAgACkDIDcDECAAIAMpA9gENwMoIAAgAykD0AQ3AyAgAigCACEEIAMgACkDGDcD+AMgAyAAKQMQNwPwAyADIAApAwA3A+ADIAMgACkDCDcD6AMgA0HwA2ogA0HgA2ogBBECAEUNASADIAApAwg3A9gEIAMgACkDADcD0AQgACAAKQMYNwMIIAAgACkDEDcDACAAIAMpA9gENwMYIAAgAykD0AQ3AxAMAQsgBARAIAMgACkDCDcD2AQgAyAAKQMANwPQBCAAIAApAyg3AwggACAAKQMgNwMAIAAgAykD2AQ3AyggACADKQPQBDcDIAwBCyADIAApAwg3A9gEIAMgACkDADcD0AQgACAAKQMYNwMIIAAgACkDEDcDACAAIAMpA9gENwMYIAAgAykD0AQ3AxAgAigCACEEIAMgACkDKDcD2AMgAyAAKQMgNwPQAyADIAApAxA3A8ADIAMgACkDGDcDyAMgA0HQA2ogA0HAA2ogBBECAEUNACADIAApAxg3A9gEIAMgACkDEDcD0AQgACAAKQMoNwMYIAAgACkDIDcDECAAIAMpA9gENwMoIAAgAykD0AQ3AyALIAIoAgAhBCADIAEpAwg3A7gDIAMgASkDADcDsAMgAyAAKQMgNwOgAyADIAApAyg3A6gDIANBsANqIANBoANqIAQRAgBFDQIgAyAAKQMoNwPYBCADIAApAyA3A9AEIAAgASkDCDcDKCAAIAEpAwA3AyAgASADKQPYBDcDCCABIAMpA9AENwMAIAIoAgAhASADIAApAyg3A5gDIAMgACkDIDcDkAMgAyAAKQMQNwOAAyADIAApAxg3A4gDIANBkANqIANBgANqIAERAgBFDQIgAyAAKQMYNwPYBCADIAApAxA3A9AEIAAgACkDKDcDGCAAIAApAyA3AxAgACADKQPYBDcDKCAAIAMpA9AENwMgIAIoAgAhASADIAApAxg3A/gCIAMgACkDEDcD8AIgAyAAKQMANwPgAiADIAApAwg3A+gCIANB8AJqIANB4AJqIAERAgBFDQIgAyAAKQMINwPYBCADIAApAwA3A9AEIAAgACkDGDcDCCAAIAApAxA3AwAgACADKQPYBDcDGCAAIAMpA9AENwMQDAILIAAgAEEQaiAAQSBqIABBMGogAUEQayACEMQDDAELIAIoAgAhBCADIAApAxg3A7gBIAMgACkDEDcDsAEgAyAAKQMANwOgASADIAApAwg3A6gBIANBsAFqIANBoAFqIAQRAgAhByACKAIAIQUgAyAAKQMoNwOYASADIAApAyA3A5ABIAMgACkDEDcDgAEgAyAAKQMYNwOIASAAQSBqIQQgA0GQAWogA0GAAWogBRECACEFAkAgB0UEQCAFRQ0BIAMgACkDGDcD2AQgAyAAKQMQNwPQBCAAIAQpAwg3AxggACAEKQMANwMQIAQgAykD2AQ3AwggBCADKQPQBDcDACACKAIAIQUgAyAAKQMYNwN4IAMgACkDEDcDcCADIAApAwA3A2AgAyAAKQMINwNoIANB8ABqIANB4ABqIAURAgBFDQEgAyAAKQMINwPYBCADIAApAwA3A9AEIAAgACkDGDcDCCAAIAApAxA3AwAgACADKQPYBDcDGCAAIAMpA9AENwMQDAELIAUEQCADIAApAwg3A9gEIAMgACkDADcD0AQgACAEKQMINwMIIAAgBCkDADcDACAEIAMpA9gENwMIIAQgAykD0AQ3AwAMAQsgAyAAKQMINwPYBCADIAApAwA3A9AEIAAgACkDGDcDCCAAIAApAxA3AwAgACADKQPYBDcDGCAAIAMpA9AENwMQIAIoAgAhBSADIAQpAwg3A1ggAyAEKQMANwNQIAMgACkDEDcDQCADIAApAxg3A0ggA0HQAGogA0FAayAFEQIARQ0AIAMgACkDGDcD2AQgAyAAKQMQNwPQBCAAIAQpAwg3AxggACAEKQMANwMQIAQgAykD2AQ3AwggBCADKQPQBDcDAAsgAEEwaiIFIAFGDQADQCACKAIAIQYgAyAFKQMINwM4IAMgBSkDADcDMCADIAQpAwA3AyAgAyAEKQMINwMoAkAgA0EwaiADQSBqIAYRAgBFDQAgAyAFKQMINwPIBCADIAUpAwA3A8AEIAUhBwNAAkAgByAEIgYpAwg3AwggByAEKQMANwMAIAAgBEYEQCAAIQYMAQsgAigCACEJIAMgAykDyAQ3AxggAyADKQPABDcDECADIAZBEGsiBCkDADcDACADIAQpAwg3AwggBiEHIANBEGogAyAJEQIADQELCyAGIAMpA8gENwMIIAYgAykDwAQ3AwAgCEEBaiIIQQhHDQAgBUEQaiABRiEGDAILIAUiBEEQaiIGIQUgASAGRw0AC0EBIQYLIANB4ARqJAAgBgumDAEDfyMAQfACayIGJAAgBSgCACEHIAYgASkDCDcD2AIgBiABKQMANwPQAiAGIAApAwA3A8ACIAYgACkDCDcDyAIgBkHQAmogBkHAAmogBxECACEIIAUoAgAhByAGIAIpAwg3A7gCIAYgAikDADcDsAIgBiABKQMANwOgAiAGIAEpAwg3A6gCIAZBsAJqIAZBoAJqIAcRAgAhBwJAIAhFBEAgB0UNASAGIAEpAwg3A+gCIAYgASkDADcD4AIgASACKQMINwMIIAEgAikDADcDACACIAYpA+gCNwMIIAIgBikD4AI3AwAgBSgCACEHIAYgASkDCDcDmAIgBiABKQMANwOQAiAGIAApAwA3A4ACIAYgACkDCDcDiAIgBkGQAmogBkGAAmogBxECAEUNASAGIAApAwg3A+gCIAYgACkDADcD4AIgACABKQMINwMIIAAgASkDADcDACABIAYpA+gCNwMIIAEgBikD4AI3AwAMAQsgBwRAIAYgACkDCDcD6AIgBiAAKQMANwPgAiAAIAIpAwg3AwggACACKQMANwMAIAIgBikD6AI3AwggAiAGKQPgAjcDAAwBCyAGIAApAwg3A+gCIAYgACkDADcD4AIgACABKQMINwMIIAAgASkDADcDACABIAYpA+gCNwMIIAEgBikD4AI3AwAgBSgCACEHIAYgAikDCDcD+AEgBiACKQMANwPwASAGIAEpAwA3A+ABIAYgASkDCDcD6AEgBkHwAWogBkHgAWogBxECAEUNACAGIAEpAwg3A+gCIAYgASkDADcD4AIgASACKQMINwMIIAEgAikDADcDACACIAYpA+gCNwMIIAIgBikD4AI3AwALIAUoAgAhByAGIAMpAwg3A9gBIAYgAykDADcD0AEgBiACKQMANwPAASAGIAIpAwg3A8gBAkAgBkHQAWogBkHAAWogBxECAEUNACAGIAIpAwg3A+gCIAYgAikDADcD4AIgAiADKQMINwMIIAIgAykDADcDACADIAYpA+gCNwMIIAMgBikD4AI3AwAgBSgCACEHIAYgAikDCDcDuAEgBiACKQMANwOwASAGIAEpAwA3A6ABIAYgASkDCDcDqAEgBkGwAWogBkGgAWogBxECAEUNACAGIAEpAwg3A+gCIAYgASkDADcD4AIgASACKQMINwMIIAEgAikDADcDACACIAYpA+gCNwMIIAIgBikD4AI3AwAgBSgCACEHIAYgASkDCDcDmAEgBiABKQMANwOQASAGIAApAwA3A4ABIAYgACkDCDcDiAEgBkGQAWogBkGAAWogBxECAEUNACAGIAApAwg3A+gCIAYgACkDADcD4AIgACABKQMINwMIIAAgASkDADcDACABIAYpA+gCNwMIIAEgBikD4AI3AwALIAUoAgAhByAGIAQpAwg3A3ggBiAEKQMANwNwIAYgAykDADcDYCAGIAMpAwg3A2gCQCAGQfAAaiAGQeAAaiAHEQIARQ0AIAYgAykDCDcD6AIgBiADKQMANwPgAiADIAQpAwg3AwggAyAEKQMANwMAIAQgBikD6AI3AwggBCAGKQPgAjcDACAFKAIAIQQgBiADKQMINwNYIAYgAykDADcDUCAGIAIpAwA3A0AgBiACKQMINwNIIAZB0ABqIAZBQGsgBBECAEUNACAGIAIpAwg3A+gCIAYgAikDADcD4AIgAiADKQMINwMIIAIgAykDADcDACADIAYpA+gCNwMIIAMgBikD4AI3AwAgBSgCACEDIAYgAikDCDcDOCAGIAIpAwA3AzAgBiABKQMANwMgIAYgASkDCDcDKCAGQTBqIAZBIGogAxECAEUNACAGIAEpAwg3A+gCIAYgASkDADcD4AIgASACKQMINwMIIAEgAikDADcDACACIAYpA+gCNwMIIAIgBikD4AI3AwAgBSgCACECIAYgASkDCDcDGCAGIAEpAwA3AxAgBiAAKQMANwMAIAYgACkDCDcDCCAGQRBqIAYgAhECAEUNACAGIAApAwg3A+gCIAYgACkDADcD4AIgACABKQMINwMIIAAgASkDADcDACABIAYpA+gCNwMIIAEgBikD4AI3AwALIAZB8AJqJAALCAAgABBpECILhAMCBX8BfCMAQUBqIgIkACAAQQA2AgggAEIANwIAIAJBCGogARBNIAJBADYCPCACQgA3AjQgAkE0aiACKAIIIgEoAgAiAyABKAIEIgEgASADa0EMbRBHAkAgAigCDCIBRQ0AIAEgASgCBCIDQQFrNgIEIAMNACABIAEoAgAoAggRAAAgARAkCyAAIAIoAjggAigCNGtBDG0QViACKAI0IgMgAigCOCIFRwRAA0AgAkEoaiADEDwhBCACQQA2AiQgAkIANwIcIAJBHGogAigCLCAEKAIAa0EEdRBcIAQoAgAiASACKAIsIgZHBEADQCABKwMAIQcgAiABKwMIOQMQIAIgBzkDCCACQRxqIAJBCGoQTCABQRBqIgEgBkcNAAsLIAAgAkEcahB2IAIoAhwiAQRAIAIgATYCICACKAIkGiABECILIAQoAgAiAQRAIAIgATYCLCACKAIwGiABECILIANBDGoiAyAFRw0ACwsgAiACQTRqNgIIIAJBCGoQKSACQUBrJAAL5QECBXwDf0T////////vfyEFRP///////+//IQYCQCABKAIAIgcgASgCBCIIRgRARP///////+//IQNE////////738hBAwBC0T////////vfyEERP///////+//IQMDQCAHKAIAIgEgBygCBCIJRwRAA0AgASsDCCICIAMgAiADZBshAyACIAQgAiAEYxshBCABKwMAIgIgBiACIAZkGyEGIAIgBSACIAVjGyEFIAFBEGoiASAJRw0ACwsgB0EMaiIHIAhHDQALCyAAIAM5AxggACAGOQMQIAAgBDkDCCAAIAU5AwAL1QECB3wDfwJAIAEoAgQiCSABKAIAIgprIgtBEUkNACAAKwMIIQcgACsDACEIA0AgCiALaiIAQRBrKwMAIABBIGsrAwAiAqEiAyAHIABBGGsrAwAiBKEiBaIgAEEIaysDACAEoSIEIAggAqEiAqKhIgZEAAAAAAAAAABkBEAgAiACoiAFIAWioCIFIAMgA6IgBCAEoqAiAyADIAVjG0QAAAAAAAAAAKKZIAYgBqJEAAAAAAAAEECiZkUNAgsgASAJQRBrIgk2AgQgCSAKayILQRBLDQALCwuRPwIKfwJ+IwBB0AhrIgUkAANAIAFBMGshCiABQSBrIQsgAUEQayEJAkADQAJAAkACQAJAAkAgASAAa0EEdSIIDgYGBgABAgMECyABQRBrIgEpAwghDyACKAIAIQIgBSABKQMAIhA3A7AFIAUgDzcDuAggBSAQNwOwCCAFIA83A7gFIAUgACkDADcDoAUgBSAAKQMINwOoBSAFQbAFaiAFQaAFaiACEQIARQ0FIAUgACkDCDcDyAggBSAAKQMANwPACCAAIAEpAwg3AwggACABKQMANwMAIAEgBSkDyAg3AwggASAFKQPACDcDAAwFCyACKAIAIQMgBSAAKQMYNwO4BiAFIAApAxA3A7AGIAUgACkDADcDoAYgBSAAKQMINwOoBiAFQbAGaiAFQaAGaiADEQIAIAIoAgAhAyAFIAFBEGsiASkDCDcDmAYgBSABKQMANwOQBiAFIAApAxA3A4AGIAUgACkDGDcDiAYgBUGQBmogBUGABmogAxECACEDRQRAIANFDQUgBSAAKQMYNwPICCAFIAApAxA3A8AIIAAgASkDCDcDGCAAIAEpAwA3AxAgASAFKQPICDcDCCABIAUpA8AINwMAIAIoAgAhASAFIAApAxg3A/gFIAUgACkDEDcD8AUgBSAAKQMANwPgBSAFIAApAwg3A+gFIAVB8AVqIAVB4AVqIAERAgBFDQUgBSAAKQMINwPICCAFIAApAwA3A8AIIAAgACkDGDcDCCAAIAApAxA3AwAgACAFKQPICDcDGCAAIAUpA8AINwMQDAULIAMEQCAFIAApAwg3A8gIIAUgACkDADcDwAggACABKQMINwMIIAAgASkDADcDACABIAUpA8gINwMIIAEgBSkDwAg3AwAMBQsgBSAAKQMINwPICCAFIAApAwA3A8AIIAAgACkDGDcDCCAAIAApAxA3AwAgACAFKQPICDcDGCAAIAUpA8AINwMQIAIoAgAhAiAFIAEpAwg3A9gFIAUgASkDADcD0AUgBSAAKQMQNwPABSAFIAApAxg3A8gFIAVB0AVqIAVBwAVqIAIRAgBFDQQgBSAAKQMYNwPICCAFIAApAxA3A8AIIAAgASkDCDcDGCAAIAEpAwA3AxAgASAFKQPICDcDCCABIAUpA8AINwMADAQLIAIoAgAhAyAFIAApAxg3A5gIIAUgACkDEDcDkAggBSAAKQMANwOACCAFIAApAwg3A4gIIAVBkAhqIAVBgAhqIAMRAgAhBCACKAIAIQMgBSAAKQMoNwP4ByAFIAApAyA3A/AHIAUgACkDEDcD4AcgBSAAKQMYNwPoByABQRBrIQEgBUHwB2ogBUHgB2ogAxECACEDAkAgBEUEQCADRQ0BIAUgACkDGDcDyAggBSAAKQMQNwPACCAAIAApAyg3AxggACAAKQMgNwMQIAAgBSkDyAg3AyggACAFKQPACDcDICACKAIAIQMgBSAAKQMYNwPYByAFIAApAxA3A9AHIAUgACkDADcDwAcgBSAAKQMINwPIByAFQdAHaiAFQcAHaiADEQIARQ0BIAUgACkDCDcDyAggBSAAKQMANwPACCAAIAApAxg3AwggACAAKQMQNwMAIAAgBSkDyAg3AxggACAFKQPACDcDEAwBCyADBEAgBSAAKQMINwPICCAFIAApAwA3A8AIIAAgACkDKDcDCCAAIAApAyA3AwAgACAFKQPICDcDKCAAIAUpA8AINwMgDAELIAUgACkDCDcDyAggBSAAKQMANwPACCAAIAApAxg3AwggACAAKQMQNwMAIAAgBSkDyAg3AxggACAFKQPACDcDECACKAIAIQMgBSAAKQMoNwO4ByAFIAApAyA3A7AHIAUgACkDEDcDoAcgBSAAKQMYNwOoByAFQbAHaiAFQaAHaiADEQIARQ0AIAUgACkDGDcDyAggBSAAKQMQNwPACCAAIAApAyg3AxggACAAKQMgNwMQIAAgBSkDyAg3AyggACAFKQPACDcDIAsgAigCACEDIAUgASkDCDcDmAcgBSABKQMANwOQByAFIAApAyA3A4AHIAUgACkDKDcDiAcgBUGQB2ogBUGAB2ogAxECAEUNAyAFIAApAyg3A8gIIAUgACkDIDcDwAggACABKQMINwMoIAAgASkDADcDICABIAUpA8gINwMIIAEgBSkDwAg3AwAgAigCACEBIAUgACkDKDcD+AYgBSAAKQMgNwPwBiAFIAApAxA3A+AGIAUgACkDGDcD6AYgBUHwBmogBUHgBmogARECAEUNAyAFIAApAxg3A8gIIAUgACkDEDcDwAggACAAKQMoNwMYIAAgACkDIDcDECAAIAUpA8gINwMoIAAgBSkDwAg3AyAgAigCACEBIAUgACkDGDcD2AYgBSAAKQMQNwPQBiAFIAApAwA3A8AGIAUgACkDCDcDyAYgBUHQBmogBUHABmogARECAEUNAyAFIAApAwg3A8gIIAUgACkDADcDwAggACAAKQMYNwMIIAAgACkDEDcDACAAIAUpA8gINwMYIAAgBSkDwAg3AxAMAwsgACAAQRBqIABBIGogAEEwaiABQRBrIAIQxAMMAgsgCEEXTARAIARBAXEEQCACIQYjAEHQAGsiByQAAkAgACICIAEiCEYNACAAQRBqIgEgCEYNAANAIAYoAgAhBCAHIAEiAykDCDcDOCAHIAEpAwA3AzAgByAAKQMANwMgIAcgACkDCDcDKCAHQTBqIAdBIGogBBECAARAIAcgASkDCDcDSCAHIAEpAwA3A0AgASEEA0ACQCAEIAAiASkDCDcDCCAEIAApAwA3AwAgACACRgRAIAIhAQwBCyAGKAIAIQkgByAHKQNINwMYIAcgBykDQDcDECAHIAFBEGsiACkDADcDACAHIAApAwg3AwggASEEIAdBEGogByAJEQIADQELCyABIAcpA0g3AwggASAHKQNANwMACyADIgBBEGoiASAIRw0ACwsgB0HQAGokAAwDCyACIQMjAEHQAGsiCCQAAkAgASIEIABGDQAgASAAQRBqIgFGDQADQCADKAIAIQYgCCABIgIpAwg3AzggCCABKQMANwMwIAggACkDADcDICAIIAApAwg3AyggCEEwaiAIQSBqIAYRAgAEQCAIIAEpAwg3A0ggCCABKQMANwNAA0AgASIGIAAiASkDCDcDCCAGIAApAwA3AwAgAygCACEGIAggCCkDSDcDGCAIIAgpA0A3AxAgCCAAQRBrIgApAwg3AwggCCAAKQMANwMAIAhBEGogCCAGEQIADQALIAEgCCkDSDcDCCABIAgpA0A3AwALIAIiAEEQaiIBIARHDQALCyAIQdAAaiQADAILIANFBEAgACABRg0CIwBBMGsiCSQAIAEgACIDRwRAIAEgAGtBBHUiBkECTgRAIAZBAmtBAXYhAANAIAMgAiAGIAMgACIEQQR0ahDCAyAAQQFrIQAgBA0ACwsgASIAIABHBEADQCACKAIAIQQgCSAAKQMINwMYIAkgACkDADcDECAJIAMpAwA3AwAgCSADKQMINwMIIAlBEGogCSAEEQIABEAgCSAAKQMINwMoIAkgACkDADcDICAAIAMpAwg3AwggACADKQMANwMAIAMgCSkDKDcDCCADIAkpAyA3AwAgAyACIAYgAxDCAwsgAEEQaiIAIAFHDQALCyAGQQJOBEADQCAJIAMpAwg3AyggCSADKQMANwMgIAMhAEEAIQgjAEEwayIKJAAgBkECa0ECbSELA0AgCEEBdCIMQQFyIQcgACAIQQR0aiIIQRBqIQQCQCAGIAxBAmoiDEwEQCAHIQgMAQsgAigCACENIAQpAwghDyAKIAQpAwAiEDcDECAKIA83AyggCiAQNwMgIAogDzcDGCAKIAhBIGoiDikDADcDACAKIAgpAyg3AwggDCAHIApBEGogCiANEQIAIgcbIQggDiAEIAcbIQQLIAAgBCkDCDcDCCAAIAQpAwA3AwAgBCEAIAggC0wNAAsgCkEwaiQAAkAgAUEQayIBIABGBEAgACAJKQMoNwMIIAAgCSkDIDcDAAwBCyAAIAEpAwg3AwggACABKQMANwMAIAEgCSkDIDcDACABIAkpAyg3AwgjAEHQAGsiByQAAkAgAEEQaiIAIANrQQR1IgRBAkgNACACKAIAIQsgByADIARBAmtBAXYiCkEEdGoiCCkDCDcDOCAHIAgpAwA3AzAgByAAQRBrIgQpAwA3AyAgByAEKQMINwMoIAdBMGogB0EgaiALEQIARQ0AIAcgBCkDCDcDSCAHIAQpAwA3A0ADQAJAIAQgCCIAKQMINwMIIAQgACkDADcDACAKRQ0AIAIoAgAhCyAHIAMgCkEBa0EBdiIKQQR0aiIIKQMINwMYIAcgCCkDADcDECAHIAcpA0A3AwAgByAHKQNINwMIIAAhBCAHQRBqIAcgCxECAA0BCwsgACAHKQNINwMIIAAgBykDQDcDAAsgB0HQAGokAAsgBkECSiAGQQFrIQYNAAsLCyAJQTBqJAAMAgsgACAIQQN0QXBxaiEGIAIoAgAhBwJAIAhBgQFPBEAgBSAGKQMINwOYBCAFIAYpAwA3A5AEIAUgACkDADcDgAQgBSAAKQMINwOIBCAFQZAEaiAFQYAEaiAHEQIAIQcgAigCACEIIAUgCSkDCDcD+AMgBSAJKQMANwPwAyAFIAYpAwA3A+ADIAUgBikDCDcD6AMgBUHwA2ogBUHgA2ogCBECACEIAkAgB0UEQCAIRQ0BIAUgBikDCDcDyAggBSAGKQMANwPACCAGIAkpAwg3AwggBiAJKQMANwMAIAkgBSkDyAg3AwggCSAFKQPACDcDACACKAIAIQggBSAGKQMINwPYAyAFIAYpAwA3A9ADIAUgACkDADcDwAMgBSAAKQMINwPIAyAFQdADaiAFQcADaiAIEQIARQ0BIAUgACkDCDcDyAggBSAAKQMANwPACCAAIAYpAwg3AwggACAGKQMANwMAIAYgBSkDyAg3AwggBiAFKQPACDcDAAwBCyAIBEAgBSAAKQMINwPICCAFIAApAwA3A8AIIAAgCSkDCDcDCCAAIAkpAwA3AwAgCSAFKQPICDcDCCAJIAUpA8AINwMADAELIAUgACkDCDcDyAggBSAAKQMANwPACCAAIAYpAwg3AwggACAGKQMANwMAIAYgBSkDyAg3AwggBiAFKQPACDcDACACKAIAIQggBSAJKQMINwO4AyAFIAkpAwA3A7ADIAUgBikDADcDoAMgBSAGKQMINwOoAyAFQbADaiAFQaADaiAIEQIARQ0AIAUgBikDCDcDyAggBSAGKQMANwPACCAGIAkpAwg3AwggBiAJKQMANwMAIAkgBSkDyAg3AwggCSAFKQPACDcDAAsgAigCACEHIAUgBkEQayIIKQMINwOYAyAFIAgpAwA3A5ADIAUgACkDEDcDgAMgBSAAKQMYNwOIAyAFQZADaiAFQYADaiAHEQIAIQwgAigCACEHIAUgCykDCDcD+AIgBSALKQMANwPwAiAFIAgpAwA3A+ACIAUgCCkDCDcD6AIgBUHwAmogBUHgAmogBxECACEHAkAgDEUEQCAHRQ0BIAUgCCkDCDcDyAggBSAIKQMANwPACCAIIAspAwg3AwggCCALKQMANwMAIAsgBSkDyAg3AwggCyAFKQPACDcDACACKAIAIQcgBSAIKQMINwPYAiAFIAgpAwA3A9ACIAUgACkDEDcDwAIgBSAAKQMYNwPIAiAFQdACaiAFQcACaiAHEQIARQ0BIAUgACkDGDcDyAggBSAAKQMQNwPACCAAIAgpAwg3AxggACAIKQMANwMQIAggBSkDyAg3AwggCCAFKQPACDcDAAwBCyAHBEAgBSAAKQMYNwPICCAFIAApAxA3A8AIIAAgCykDCDcDGCAAIAspAwA3AxAgCyAFKQPICDcDCCALIAUpA8AINwMADAELIAUgACkDGDcDyAggBSAAKQMQNwPACCAAIAgpAwg3AxggACAIKQMANwMQIAggBSkDyAg3AwggCCAFKQPACDcDACACKAIAIQcgBSALKQMINwO4AiAFIAspAwA3A7ACIAUgCCkDADcDoAIgBSAIKQMINwOoAiAFQbACaiAFQaACaiAHEQIARQ0AIAUgCCkDCDcDyAggBSAIKQMANwPACCAIIAspAwg3AwggCCALKQMANwMAIAsgBSkDyAg3AwggCyAFKQPACDcDAAsgAigCACEHIAUgBikDGDcDmAIgBSAGKQMQNwOQAiAFIAApAyA3A4ACIAUgACkDKDcDiAIgBUGQAmogBUGAAmogBxECACEMIAIoAgAhByAFIAopAwg3A/gBIAUgCikDADcD8AEgBSAGKQMQNwPgASAFIAYpAxg3A+gBIAVB8AFqIAVB4AFqIAcRAgAhBwJAIAxFBEAgB0UNASAFIAYpAxg3A8gIIAUgBikDEDcDwAggBiAKKQMINwMYIAYgCikDADcDECAKIAUpA8gINwMIIAogBSkDwAg3AwAgAigCACEHIAUgBikDGDcD2AEgBSAGKQMQNwPQASAFIAApAyA3A8ABIAUgACkDKDcDyAEgBUHQAWogBUHAAWogBxECAEUNASAFIAApAyg3A8gIIAUgACkDIDcDwAggACAGKQMYNwMoIAAgBikDEDcDICAGIAUpA8gINwMYIAYgBSkDwAg3AxAMAQsgBwRAIAUgACkDKDcDyAggBSAAKQMgNwPACCAAIAopAwg3AyggACAKKQMANwMgIAogBSkDyAg3AwggCiAFKQPACDcDAAwBCyAFIAApAyg3A8gIIAUgACkDIDcDwAggACAGKQMYNwMoIAAgBikDEDcDICAGIAUpA8gINwMYIAYgBSkDwAg3AxAgAigCACEHIAUgCikDCDcDuAEgBSAKKQMANwOwASAFIAYpAxA3A6ABIAUgBikDGDcDqAEgBUGwAWogBUGgAWogBxECAEUNACAFIAYpAxg3A8gIIAUgBikDEDcDwAggBiAKKQMINwMYIAYgCikDADcDECAKIAUpA8gINwMIIAogBSkDwAg3AwALIAIoAgAhByAFIAYpAwg3A5gBIAUgBikDADcDkAEgBSAIKQMANwOAASAFIAgpAwg3A4gBIAVBkAFqIAVBgAFqIAcRAgAhDCACKAIAIQcgBSAGKQMYNwN4IAUgBikDEDcDcCAFIAYpAwA3A2AgBSAGKQMINwNoIAVB8ABqIAVB4ABqIAcRAgAhBwJAIAxFBEAgB0UNASAFIAYpAwg3A8gIIAUgBikDADcDwAggBiAGKQMYNwMIIAYgBikDEDcDACAGIAUpA8gINwMYIAYgBSkDwAg3AxAgAigCACEHIAUgBikDCDcDWCAFIAYpAwA3A1AgBSAIKQMANwNAIAUgCCkDCDcDSCAFQdAAaiAFQUBrIAcRAgBFDQEgBSAIKQMINwPICCAFIAgpAwA3A8AIIAggBikDCDcDCCAIIAYpAwA3AwAgBiAFKQPICDcDCCAGIAUpA8AINwMADAELIAcEQCAFIAgpAwg3A8gIIAUgCCkDADcDwAggCCAGKQMYNwMIIAggBikDEDcDACAGIAUpA8gINwMYIAYgBSkDwAg3AxAMAQsgBSAIKQMINwPICCAFIAgpAwA3A8AIIAggBikDCDcDCCAIIAYpAwA3AwAgBiAFKQPICDcDCCAGIAUpA8AINwMAIAIoAgAhCCAFIAYpAxg3AzggBSAGKQMQNwMwIAUgBikDADcDICAFIAYpAwg3AyggBUEwaiAFQSBqIAgRAgBFDQAgBSAGKQMINwPICCAFIAYpAwA3A8AIIAYgBikDGDcDCCAGIAYpAxA3AwAgBiAFKQPICDcDGCAGIAUpA8AINwMQCyAFIAApAwg3A8gIIAUgACkDADcDwAggACAGKQMINwMIIAAgBikDADcDACAGIAUpA8gINwMIIAYgBSkDwAg3AwAMAQsgBSAAKQMINwOYBSAFIAApAwA3A5AFIAUgBikDADcDgAUgBSAGKQMINwOIBSAFQZAFaiAFQYAFaiAHEQIAIAIoAgAhCCAFIAkpAwg3A/gEIAUgCSkDADcD8AQgBSAAKQMANwPgBCAFIAApAwg3A+gEIAVB8ARqIAVB4ARqIAgRAgAhCEUEQCAIRQ0BIAUgACkDCDcDyAggBSAAKQMANwPACCAAIAkpAwg3AwggACAJKQMANwMAIAkgBSkDyAg3AwggCSAFKQPACDcDACACKAIAIQggBSAAKQMINwPYBCAFIAApAwA3A9AEIAUgBikDADcDwAQgBSAGKQMINwPIBCAFQdAEaiAFQcAEaiAIEQIARQ0BIAUgBikDCDcDyAggBSAGKQMANwPACCAGIAApAwg3AwggBiAAKQMANwMAIAAgBSkDyAg3AwggACAFKQPACDcDAAwBCyAIBEAgBSAGKQMINwPICCAFIAYpAwA3A8AIIAYgCSkDCDcDCCAGIAkpAwA3AwAgCSAFKQPICDcDCCAJIAUpA8AINwMADAELIAUgBikDCDcDyAggBSAGKQMANwPACCAGIAApAwg3AwggBiAAKQMANwMAIAAgBSkDyAg3AwggACAFKQPACDcDACACKAIAIQYgBSAJKQMINwO4BCAFIAkpAwA3A7AEIAUgACkDADcDoAQgBSAAKQMINwOoBCAFQbAEaiAFQaAEaiAGEQIARQ0AIAUgACkDCDcDyAggBSAAKQMANwPACCAAIAkpAwg3AwggACAJKQMANwMAIAkgBSkDyAg3AwggCSAFKQPACDcDAAsgA0EBayEDAkAgBEEBcSIMDQAgAEEQayIGKQMIIQ8gAigCACEIIAUgBikDACIQNwMQIAUgDzcDqAggBSAQNwOgCCAFIA83AxggBSAAKQMANwMAIAUgACkDCDcDCCAFQRBqIAUgCBECAA0AQQAhBCMAQeABayIHJAAgByAAKQMINwPIASAHIAApAwA3A8ABIAIoAgAhBiAHIAApAwA3A7ABIAcgACkDCDcDuAEgByABIghBEGsiDCkDCDcDqAEgByAMKQMANwOgAQJAIAdBsAFqIAdBoAFqIAYRAgAEQCAAIQYDQCACKAIAIQwgByAHKQPIATcDeCAHIAcpA8ABNwNwIAcgBikDEDcDYCAHIAYpAxg3A2ggBkEQaiEGIAdB8ABqIAdB4ABqIAwRAgBFDQALDAELIAAhBgNAIAZBEGoiBiAITw0BIAIoAgAhDCAHIAcpA8gBNwOYASAHIAcpA8ABNwOQASAHIAYpAwA3A4ABIAcgBikDCDcDiAEgB0GQAWogB0GAAWogDBECAEUNAAsLIAYgCEkEQANAIAIoAgAhDCAHIAcpA8gBNwNYIAcgBykDwAE3A1AgByAIQRBrIggpAwA3A0AgByAIKQMINwNIIAdB0ABqIAdBQGsgDBECAA0ACwsgBiAISQRAA0AgByAGKQMINwPYASAHIAYpAwA3A9ABIAYgCCkDCDcDCCAGIAgpAwA3AwAgCCAHKQPYATcDCCAIIAcpA9ABNwMAA0AgAigCACEMIAcgBykDyAE3AzggByAHKQPAATcDMCAHIAYpAxA3AyAgByAGKQMYNwMoIAZBEGohBiAHQTBqIAdBIGogDBECAEUNAAsDQCACKAIAIQwgByAHKQPIATcDGCAHIAcpA8ABNwMQIAcgCEEQayIIKQMANwMAIAcgCCkDCDcDCCAHQRBqIAcgDBECAA0ACyAGIAhJDQALCyAGQRBrIgggAEcEQCAAIAgpAwg3AwggACAIKQMANwMACyAIIAcpA8gBNwMIIAggBykDwAE3AwAgB0HgAWokACAGIQAMAQsLIAEhByMAQcABayIJJAAgCSAAKQMINwOoASAJIAApAwA3A6ABIAAhBgNAIAIoAgAhCiAJIAYiCCkDGDcDmAEgCSAGKQMQNwOQASAJIAkpA6ABNwOAASAJIAkpA6gBNwOIASAGQRBqIQYgCUGQAWogCUGAAWogChECAA0ACwJAIAAgCEYEQANAIAYgB08NAiACKAIAIQogCSAHQRBrIgcpAwg3A1ggCSAHKQMANwNQIAkgCSkDoAE3A0AgCSAJKQOoATcDSCAJQdAAaiAJQUBrIAoRAgBFDQAMAgsACwNAIAIoAgAhCiAJIAdBEGsiBykDCDcDeCAJIAcpAwA3A3AgCSAJKQOgATcDYCAJIAkpA6gBNwNoIAlB8ABqIAlB4ABqIAoRAgBFDQALCyAGIAdPIgpFBEADQCAJIAYpAwg3A7gBIAkgBikDADcDsAEgBiAHKQMINwMIIAYgBykDADcDACAHIAkpA7gBNwMIIAcgCSkDsAE3AwADQCACKAIAIQsgCSAGIggpAxg3AzggCSAGKQMQNwMwIAkgCSkDoAE3AyAgCSAJKQOoATcDKCAGQRBqIQYgCUEwaiAJQSBqIAsRAgANAAsDQCACKAIAIQsgCSAHQRBrIgcpAwg3AxggCSAHKQMANwMQIAkgCSkDoAE3AwAgCSAJKQOoATcDCCAJQRBqIAkgCxECAEUNAAsgBiAHSQ0ACwsgACAIRwRAIAAgCCkDCDcDCCAAIAgpAwA3AwALIAggCSkDqAE3AwggCCAJKQOgATcDACAFQcAIaiIGIAo6AAQgBiAINgIAIAlBwAFqJAAgBSgCwAghCAJAIAUtAMQIQQFHDQAgACAIIAIQwwMhByAIQRBqIgYgASACEMMDBEAgCCEBIAdFDQMMAgsgB0UNACAGIQAMAgsgACAIIAIgAyAMEMkDIAhBEGohAEEAIQQMAQsLIAVB0AhqJAALiQQCBX8BfCMAQTBrIgIkAAJAIAEoAgQiAyABKAIAIgRrQQR1IgVBAk0EQCAAQQA2AgggAEIANwIADAELIAJBtAQ2AgggAyAERwRAIAQgAyACQQhqIAVnQQF0QT5zQQEQyQMgASgCACEEIAEoAgQhAwtBACEFIAJBADYCLCACQgA3AiQgAyAERwRAA0AgBCACQSRqIgYQyAMgBiAEEEwgBEEQaiIEIANHDQALIAEoAgAhBCABKAIEIQMLIAJBADYCICACQgA3AhggAyAERgR/QQAFA0AgA0EQayIDIAJBGGoiBBDIAyAEIAMQTCADIAEoAgBHDQALIAIoAhghBSACKAIcCyEBIAIgAigCKEEQayIDNgIoIAIgAUEQayIBNgIcIABBADYCCCAAQgA3AgAgACABIAVrQQR1IAMgAigCJGtBBHVqEFwgAigCJCIDIAIoAigiAUcEQANAIAMrAwAhByACIAMrAwg5AxAgAiAHOQMIIAAgAkEIahBMIANBEGoiAyABRw0ACwsgAigCGCIDIAIoAhwiAUcEQANAIAMrAwAhByACIAMrAwg5AxAgAiAHOQMIIAAgAkEIahBMIANBEGoiAyABRw0ACyACKAIYIQMLIAMEQCACIAM2AhwgAigCIBogAxAiCyACKAIkIgBFDQAgAiAANgIoIAIoAiwaIAAQIgsgAkEwaiQAC+wBAQV/IwBBIGsiASQAIAFBCGogABBNIAFBADYCHCABQgA3AhQgAUEUaiABKAIIIgAoAgAiAiAAKAIEIgAgACACa0EMbRBHAkAgASgCDCIARQ0AIAAgACgCBCICQQFrNgIEIAINACAAIAAoAgAoAggRAAAgABAkCyABKAIUIgAgASgCGCIERwRAA0AgAUEIaiAAEDwhAiABKAIMIAIoAgAiAmtBBHUhBSACBEAgASACNgIMIAEoAhAaIAIQIgsgAyAFaiEDIABBDGoiACAERw0ACwsgASABQRRqNgIIIAFBCGoQKSABQSBqJAAgAwtdAQN/AkAgACAAKAIAKAIQEQQAIgNFDQADQCAAKAIIIAJBAnRqKAIAIgQgARDMAyABIARBIGoQdiACIANBAWtPDQEgAkEBaiICIAAgACgCACgCEBEEACIDSQ0ACwsLuAIBBH8gAEECQQJBARD/AQRAIAEgASgCACgCDBEAACABIAArA5gBOQMYIAIgAigCABB7IwBBEGsiBCQAIAEgASgCACgCDBEAACACELEBIAAtAHxBAUYEQCACIAAoAoQBIAAoAoABa0ECdRBWCyAAKAKAASIDIAAoAoQBRwRAA0ACQCADIAVBAnRqKAIAIgNFDQAgAygCECIGRQ0AIAMtAExBAUYEQCAEQQA2AgwgBEIANwIEIAYgAC0AdUEBIARBBGoiAyAAKwOYARC6AgRAIAIgAxBoCyAEKAIEIgNFDQEgBCADNgIIIAQoAgwaIAMQIgwBCyAAIAMQ/AFFDQAgACADIAEQuwILIAVBAWoiBSAAKAKEASAAKAKAASIDa0ECdUkNAAsLIARBEGokAAsgABDeASAALQB9GgtlAQR/IwBBEGsiASQAIAFBCGogABBNIAEoAggiACgCACECIAAoAgQCQCABKAIMIgBFDQAgACAAKAIEIgRBAWs2AgQgBA0AIAAgACgCACgCCBEAACAAECQLIAFBEGokACACa0EMbQuQBgEDfwJAAkACQAJAAkAgAg4DBAIAAQsgAUEYayECIAFBEGsrAwAgACsDCGMEQCADIAIpAxA3AxAgAyACKQMINwMIIAMgAikDADcDACADIAApAxA3AyggAyAAKQMINwMgIAMgACkDADcDGA8LIAMgACkDEDcDECADIAApAwg3AwggAyAAKQMANwMAIAMgAikDEDcDKCADIAIpAwg3AyAgAyACKQMANwMYDwsgAkEITARAIAAgAUYNAyADIAApAxA3AxAgAyAAKQMINwMIIAMgACkDADcDACAAQRhqIgQgAUYNAyADIQIDQCAEIQUgAkEYaiEGAkAgACsDICACKwMIYwRAIAYgAikDEDcDECAGIAIpAwg3AwggBiACKQMANwMAAn8gAyACIANGDQAaA0AgAiAAKwMgIAJBEGsrAwBjRQ0BGiACIAJBGGsiBCgCEDYCECACIAQpAwg3AwggAiAEKQMANwMAIAQiAiADRw0ACyADCyIEIAUoAhA2AhAgBCAFKQMINwMIIAQgBSkDADcDAAwBCyAGIAUpAxA3AxAgBiAFKQMINwMIIAYgBSkDADcDAAsgBiECIAUiAEEYaiIEIAFHDQALDAMLIAAgACACQQF2IgVBGGwiBmoiBCAFIAMgBRC1ASAEIAEgAiAFayICIAMgBmogAhC1ASAEIQIDQCABIAJGBEAgACAERg0EA0AgAyAAKQMQNwMQIAMgACkDCDcDCCADIAApAwA3AwAgA0EYaiEDIABBGGoiACAERw0ACwwECwJAIAIrAwggACsDCGMEQCADIAIpAxA3AxAgAyACKQMINwMIIAMgAikDADcDACACQRhqIQIMAQsgAyAAKQMQNwMQIAMgACkDCDcDCCADIAApAwA3AwAgAEEYaiEACyADQRhqIQMgACAERw0ACwwBCyADIAApAxA3AxAgAyAAKQMINwMIIAMgACkDADcDAAwBCyABIAJGDQADQCADIAIpAxA3AxAgAyACKQMINwMIIAMgAikDADcDACADQRhqIQMgAkEYaiICIAFHDQALCwudBQEIfyMAQSBrIgUkACADIQQCQCABIAJGDQAgAiAERgRAIAEhBAwBCyACIAFBGGoiBEYEQCAFIAEpAxA3AxggBSABKQMINwMQIAUgASkDADcDCCADIAJrIgJBBGsiBwRAIAEgBCAH/AoAAAsgASACaiIEIAUoAhg2AhAgBCAFKQMQNwMIIAQgBSkDCDcDAAwBCyADIAJBGGpGBEAgBSADQRhrIgIpAxA3AxggBSACKQMINwMQIAUgAikDADcDCCADIAIgAWsiB0FobUEYbGohBAJAIAEgAkYNACAHQQRrIgJFDQAgBCABIAL8CgAACyABIAUoAhg2AhAgASAFKQMQNwMIIAEgBSkDCDcDAAwBCwJ/IwBBIGshBiACIAEiBGsiCUEYbSIHIAMgAmsiC0EYbSIBRwRAIAchAgNAIAIgASICbyIBDQALIAQgAkEYbGohAgNAIAYgAkEYayICKQMQNwMYIAYgAikDCDcDECAGIAIpAwA3AwggAiAJaiEIIAIhAQNAIAEiCiAIIgEoAhA2AhAgCiABKQMINwMIIAogASkDADcDACABIAlqIAQgByADIAFrQRhtIghrQRhsaiAHIAhIGyIIIAJHDQALIAEgBigCGDYCECABIAYpAxA3AwggASAGKQMINwMAIAIgBEcNAAsgBCALagwBCwJAIAIgBEYgAiADRnINACACIQEDQCAGIAQpAxA3AxggBiAEKQMINwMQIAYgBCkDADcDCCAEIAEoAhA2AhAgBCABKQMINwMIIAQgASkDADcDACABIAYoAhg2AhAgASAGKQMQNwMIIAEgBikDCDcDACAEQRhqIgQgAkYNASABQRhqIgEgA0cNAAsLIAILIQQLIAAgAzYCBCAAIAQ2AgAgBUEgaiQAC4IGAQN/AkACQAJAAkACQCACDgMEAgABCyABQRhrIgErAwAgACsDAGMEQCADIAEpAxA3AxAgAyABKQMINwMIIAMgASkDADcDACADIAApAxA3AyggAyAAKQMINwMgIAMgACkDADcDGA8LIAMgACkDEDcDECADIAApAwg3AwggAyAAKQMANwMAIAMgASkDEDcDKCADIAEpAwg3AyAgAyABKQMANwMYDwsgAkEITARAIAAgAUYNAyADIAApAxA3AxAgAyAAKQMINwMIIAMgACkDADcDACAAQRhqIgQgAUYNAyADIQADQCAAQRhqIQUCQCAEKwMAIAArAwBjBEAgBSAAKQMQNwMQIAUgACkDCDcDCCAFIAApAwA3AwACfyADIAAgA0YNABoDQCAAIAQrAwAgAEEYayICKwMAY0UNARogACACKAIQNgIQIAAgAikDCDcDCCAAIAIpAwA3AwAgAiIAIANHDQALIAMLIgIgBCgCEDYCECACIAQpAwg3AwggAiAEKQMANwMADAELIAUgBCkDEDcDECAFIAQpAwg3AwggBSAEKQMANwMACyAFIQAgBEEYaiIEIAFHDQALDAMLIAAgACACQQF2IgRBGGwiBmoiBSAEIAMgBBC2ASAFIAEgAiAEayICIAMgBmogAhC2ASAFIQIDQCABIAJGBEAgACAFRg0EA0AgAyAAKQMQNwMQIAMgACkDCDcDCCADIAApAwA3AwAgA0EYaiEDIABBGGoiACAFRw0ACwwECwJAIAIrAwAgACsDAGMEQCADIAIpAxA3AxAgAyACKQMINwMIIAMgAikDADcDACACQRhqIQIMAQsgAyAAKQMQNwMQIAMgACkDCDcDCCADIAApAwA3AwAgAEEYaiEACyADQRhqIQMgACAFRw0ACwwBCyADIAApAxA3AxAgAyAAKQMINwMIIAMgACkDADcDAAwBCyABIAJGDQADQCADIAIpAxA3AxAgAyACKQMINwMIIAMgAikDADcDACADQRhqIQMgAkEYaiICIAFHDQALCwuLCwEQfyMAQSBrIgckACAHQQA2AhggB0IANwIQIAdBEGogASgCJBAlIAEoAgwhDyABKAIIIQogASgCBCELIAEoAgAhBgJAAkACQCACKAIMQQBOBEBBASERDAELQQEhESALQQRBCCAGQQFGG0EAIAYbQZSVAWooAgBHDQELIAohDCAGIQoMAQtBASESIAQgBC0AA0EBczoAAyAEIAQtAAJBAXM6AAIgBCAELQABQQFzOgABIAQgBC0AAEEBczoAAEEAIREgCyEMIAYhCwsgAUEEaiETIAdCgoCAgDA3AgggB0KAgICAEDcCACACQQRqIRADQCAKIQYCQAJAAkACQCAHIAhqKAIAIg0OAwMAAQILIAshBgwCCyAMIQYMAQsgDyEGCyACIQkCQAJAAkAgBg4CAgABCyAQIQkMAQsgAkEIQQwgBkECRhtqIQkLIAkoAgBBAE4EQCAKIQYCQAJAAkACQCANDgMDAAECCyALIQYMAgsgDCEGDAELIA8hBgsgAiEJAkACQAJAIAYOAgIAAQsgECEJDAELIAJBCEEMIAZBAkYbaiEJCyAJKAIAIQkCQCAHKAIUIgYgBygCGCINTwRAIAdBEGogDUEBdEGAASANGxAlIAcoAhAgBygCFCIGQQJ0aiAJNgIADAELIAcoAhAgBkECdGogCTYCAAsgByAGQQFqNgIUCyAIQQRqIghBEEcNAAsgB0KCgICAMDcCCCAHQoCAgIAQNwIAIARBAWohCyADQQRqIQ8gAUEUaiEQIAFBEGohDANAIAwhCCABIQYCQAJAAkAgByAUaigCACIODgICAAELIBAhCCATIQYMAQsgAUEIQQwgDkECRhsiAmohBiACIAxqIQgLIAMhCQJAAkACQCAGKAIAIgIOAgIAAQsgDyEJDAELIANBCEEMIAJBAkYbaiEJCyABIQYCQAJAAkAgDg4CAgABCyATIQYMAQsgAUEIQQwgDkECRhtqIQYLIAgoAgAhCCAEIQoCQAJAAkAgBigCACICDgICAAELIAshCgwBCyAEQQJBAyACQQJGG2ohCgsgCEECTgRAIAFBCEEMIA5BAkYbaiENQQAhAiAJKAIAQQAgCEECayIVIAotAAAbaiEGIAcoAhQhCANAIAIhCQJAIAcoAhgiAiAITQRAIAdBEGogAkEBdEGAASACGxAlIAcoAhAgBygCFCIIQQJ0aiAGNgIADAELIAcoAhAgCEECdGogBjYCAAsgByAIQQFqIgg2AhQgASECAkACQAJAIA4OAgIAAQsgEyECDAELIA0hAgsgBCEKAkACQAJAIAIoAgAiAg4CAgABCyALIQoMAQsgBEECQQMgAkECRhtqIQoLQQFBfyAKLQAAGyAGaiEGIAlBAWohAiAJIBVHDQALCyAUQQRqIhRBEEcNAAsgBygCFCECIAdBEGoiAyABKAIkIggQJSAHIAg2AhQgAkERSSACIAhBAXRNckUEQCADEC0gBygCFCEICyACIAhHBEAgBygCECIDIAhBAnRqIQQgAyACQQJ0aiEIA0AgCCAFNgIAIAVBAWohBSAIQQRqIgggBEcNAAsLIAEoAjQhAyAAQQA2AgggAEIANwIAIAAgAxA1IAAgAzYCBCADBEAgACgCACEEIAEoAjAhBSAHKAIQIQZBACEAA0AgB0ECNgIIIAdCgICAgBA3AgAgBCAAQQxsIgFqIQogASAFaiELQQAhCANAQQghCSAGIAtBBEEIIAcgCGooAgAiAUEBRhtBACABG2ooAgBBAnRqKAIAIQwgEiECAkACQAJAIAEOAgEAAgsgESECC0EEQQAgAhshCQsgCSAKaiAMNgIAIAhBBGoiCEEMRw0ACyAAQQFqIgAgA0cNAAsLIAcoAhAiAARAIAAQIgsgB0EgaiQAC4ACAQV/IAEoAgghBiABKAIAIQUCQCACQQBMBEAgACgCBCEDDAELIAAoAgQhAwNAAn8gACgCCCIEIANNBEAgACAEQQF0QYABIAQbEDUgACgCACAAKAIEIgNBDGxqDAELIAAoAgAgA0EMbGoLIgQgBTYCACAEIAY2AgggBCAHQQNqIgU2AgQgACADQQFqIgM2AgQgB0EBaiIHIAJHDQALCyABKAIEIQICfyAAKAIIIgEgA00EQCAAIAFBAXRBgAEgARsQNSAAKAIAIAAoAgQiA0EMbGoMAQsgACgCACADQQxsagsiASAFNgIAIAEgBjYCCCABIAI2AgQgACADQQFqNgIEC1cBA38gACgCCCABSQRAIAFBKGwQJyEEIAAoAgAhAgJAIAAoAgQiA0UNACADQShsIgNFDQAgBCACIAP8CgAACyACBEAgAhAiCyAAIAE2AgggACAENgIACwuGigEEH38MfAF+An0jAEGACGsiBCQAIAFB2ABqIgUQOCABQegAahA4IAFB+ABqEDggASgCXCEGIARBADYCgAUgBEIANwL4BCAEQfgEaiIHIAYQNSAEIAY2AvwEIAQgBTYC9AYgBCAHNgLwBkEAIQUgBgRAIAQoAvAGKAIAIQkgBCgC9AYoAgAhCwNAIAkgBUEMbGoiCEF/IAUgCyAFQQJ0aiIKKAIAIgcgCkF4QQQgBUEDb0ECRhtqKAIAIgpOGzYCCCAIIAcgCiAHIApKIgwbNgIEIAggCiAHIAwbNgIAIAVBAWoiBSAGRw0ACwsgBCgC+AQiCCAEKAL8BCIGQQxsaiEKIAghBQJAAkAgBkUNAANAIAUoAghBAEgNASAFQQxqIgUgCkcNAAsgCiEGDAELAkAgBSAKRg0AIAVBDGoiByAKRg0AIAUhBgNAIAUoAhRBAE4EQCAGIAcoAgg2AgggBiAHKQIANwIAIAZBDGohBgsgByIFQQxqIgcgCkcNAAsgBCgC+AQhCAwBCyAFIQYLIAQgBCgC+AY2ArADIAQgBCkC8AY3A6gDIARB+ARqIAYgCGtBDG0gBEGoA2oQ9AMgASgCTCEfIAEoAlwhGyAEKAL8BCEUQQAhBSAEQQA2AvAEIARCADcC6AQgBEHoBGogFEEBdCIGECUgBCAGNgLsBCAUBEAgASgCaCEHIAQoAugEIQYgBCgC+AQhCgNAIAYgCiAFQQxsaigCCEECdCIIaiAFNgIAIAYgByAIaigCAEECdGogBTYCACAFQQFqIgUgFEcNAAsLQQAhBSAEQQA2AuAEIARCADcC2AQgBEHYBGogG0EDbiIcEDkgBCAcNgLcBCAbQQNPBEADQCAEQfAGaiABIAUQ1wMgBCgC2AQgBUEEdGoiBiAEKQL4BjcCCCAGIAQpAvAGNwIAIAVBAWoiBSAcRw0ACwsgBEEANgLQBCAEQgA3AsgEIARByARqIgYgFBAlIAQgFDYCzAQgBCAEQfgEajYCpAQgBCAGNgKgBCAEQagEaiACEFchCCAEIAE2AsAEIAQgBCkDoAQ3A4gFIARBkAVqIQYCQAJAAkACQAJAIAQoArgEIgJFBEAgBEEANgKgBSAEIAQoAsAEIgc2AqgFIAQgBCkDiAUiLzcDsAUgBEG4BWohDgwBCwJAIAIgCEYEQCAEIAY2AqAFIAIgBiACKAIAKAIMEQEAIAQoAqAFIQUMAQsgBCACIAIoAgAoAggRBAAiBTYCoAULIAQgBCgCwAQiBzYCqAUgBCAEKQOIBSIvNwOwBSAEQbgFaiEOIAUNAQsgBCAHNgLQBSAEQQA2AsgFIAQgLzcD2AUgBEHgBWohAgwBCwJAIAUgBkYEQCAEIA42AsgFIAUgDiAFKAIAKAIMEQEAIAQoAsgFIQUMAQsgBCAFIAUoAgAoAggRBAAiBTYCyAULIAQgBCgCqAU2AtAFIAQgBCkDsAU3A9gFIARB4AVqIQIgBQ0BCyAEQQA2AvAFDAELIAUgDkYEQCAEIAI2AvAFIAUgAiAFKAIAKAIMEQEADAELIAQgBSAFKAIAKAIIEQQANgLwBQsgBCAEKALQBTYC+AUCQAJAAkAgFARAQQAhBQNAIAQoAtwFKAIAIAVBDGxqIgooAgQhDCAKKAIAIQ1BACEJIAQoAvgFIgcgCigCCCILEOYBRQRAIAcoAkgiCSANQRhsaiIKKwMQIAkgDEEYbGoiCSsDEKEhKiAKKwMIIAkrAwihISsgCisDACAJKwMAoSEsAnwgBygCvAFFBEBEAAAAAAAAAAAhI0QAAAAAAAAAACEkRAAAAAAAAAAAISVEAAAAAAAAAAAhJkQAAAAAAAAAACEnRAAAAAAAAAAAIShEAAAAAAAAAAAhKUQAAAAAAAAAAAwBCyAHKAK4ASIJIAtBBXRqIgorAxghIyAKKwMQISQgCisDCCElIAorAwAhJiAJIAcoAmggC0ECdGooAgBBBXRqIgcrAxghJyAHKwMQISggBysDCCEpIAcrAwALIS0gBCAqOQOQBiAEICs5A4gGIAQgLDkDgAYgBCAjOQOwBiAEICQ5A6gGIAQgJTkDoAYgBCAmOQOYBiAEICc5A9AGIAQgKDkDyAYgBCApOQPABiAEIC05A7gGIAQoAvAFIgdFDQMgByAEQYAGaiAEQZgGaiAEQbgGaiAHKAIAKAIYEQkAIQkLIAQoAtgFKAIAIAVBAnRqIAk2AgAgBUEBaiIFIBRHDQALCyAEIAQpA9gFNwPwBgJAIAQoAvAFIgVFBEAgBEEANgKIByAEIAQoAvgFNgKQBwwBCyAEQfgGaiEHAkAgAiAFRgRAIAQgBzYCiAcgBSAHIAUoAgAoAgwRAQAgBCgCiAchBQwBCyAEQQA2AvAFIAQgBTYCiAcLIAQgBCgC+AU2ApAHIAUgBSAHRgR/QRAFIAVFDQFBFAsgBSgCAGooAgARAAALAkAgAiAEKALwBSIFRgR/QRAFIAVFDQFBFAshAiAFIAUoAgAgAmooAgARAAALAkAgDiAEKALIBSICRgR/QRAFIAJFDQFBFAshBSACIAIoAgAgBWooAgARAAALAkAgBiAEKAKgBSICRgR/QRAFIAJFDQFBFAshBiACIAIoAgAgBmooAgARAAALAkAgCCAEKAK4BCICRgR/QRAFIAJFDQFBFAshBiACIAIoAgAgBmooAgARAAALIAMEQEEAIQsgBEEANgL4BiAEQgA3AvAGIARB8AZqIBQQJSAEIBQ2AvQGIBQEQANAIAtBAnQiAyAEKALwBmogBCgCyAQgA2ooAgA2AgAgASAEKAL4BCALQQxsaigCCCICEOYBRQRAIAQoAvAGIANqKAIAIQogAiEFQQAhCUEAIQhBACEGA0ACQCAEKALIBCAEKALoBCAFQQJ0aigCAEECdGooAgAhByABQX5BASAFQQNvQQJGGyAFaiIFEOYBBEBBACEGQQEhCQwBCyAGIAcgBiAHShshBiAHIAlqIQkgCEEEaiIIQQxHDQELC0EAIQgCf0EAIAZFDQAaQQAgBrhEmpmZmZmZyT+iRAAAAAAAAPA/oPwCIAZBAXQgCWtqIgVBAEwNABogBSAGIAprbCAGbQshDCABKAJoIAJBAnRqKAIAIQVBACEJQQAhBgNAAkAgBCgCyAQgBCgC6AQgBUECdGooAgBBAnRqKAIAIQdBACECIAFBfkEBIAVBA29BAkYbIAVqIgUQ5gEEQEEAIQZBASEIDAELIAYgByAGIAdKGyEGIAcgCGohCCAJQQRqIglBDEcNAQsLAkAgBkUNACAGuESamZmZmZnJP6JEAAAAAAAA8D+g/AIgBkEBdCAIa2oiBUEATA0AIAUgBiAKa2wgBm0hAgsgBCgC8AYgA2oiAyADKAIAIAwgAiACIAxIG2o2AgALIAtBAWoiCyAURw0ACwsgBCgCyAQiAgRAIAIQIgsgBCAEKALwBjYCyAQgBCAEKQL0BjcCzAQLIARBADYCmAQgBEIANwKQBCAEQZAEaiAUECUgBCAUNgKUBCAEKALIBCIDIAQoAswEIgZBAnRqIQogBCgCkAQhAgJAIAZFDQAgAygCACACIB82AgAgBkEBRg0AIB9qIQUgA0EEaiEHIAIhBgNAIAcoAgAgBiAFNgIEIAZBBGohBiAFaiEFIAdBBGoiByAKRw0ACwsgCkEEaygCACEDIAIgFEECdGpBBGsoAgAhAiAAQQA2AgggAEIANwIAIAAgAiADaiIgENQDIAAgIDYCBEEAIQYjAEFAaiICJAAgASgCXCIDQQNuIQcgA0EDTwRAA0AgAkECNgI8IAJCgICAgBA3AjQgBkEDbCEKQQAhBQNAIAJBKGogASACQTRqIAVqKAIAIApqIggQ1gMgAigCLCIJQQBOBEAgAkIANwMgIAJCADcDGCACQgA3AxAgAkIANwMIIAJBIGohAwJAAkACQAJAIAkOAwMAAQILIAJBGGohAwwCCyACQRBqIQMMAQsgAkEIaiEDCyADQoCAgICAgID4PzcDACACKAIoIQkgAisDICEjIAIrAxghJCACKwMQISUgACgCACABKAJYIAhBAnRqKAIAQShsaiIDIAIrAwg5AyAgAyAlOQMYIAMgJDkDECADICM5AwggAyAJNgIACyAFQQRqIgVBDEcNAAsgBkEBaiIGIAdHDQALCyACQUBrJAAgFARAQQAhDANAIAxBAnQiAiAEKAKQBGooAgAhAyAEKALIBCACaigCACEKIARB8AZqIAEgBCgC+AQgDEEMbGooAggQ1gMgBCgC8AYiCEEASCAKQQBMckUEQEQAAAAAAADwPyAKQQFqt6MhJCAAKAIAIANBKGxqIQkgBEGIBWogBEG4BmogBCgC+AYiC0ECRhshAkEAIQcgBCgC9AYhDQNAIARCADcD2AUgBEIANwOwBSAEQgA3A4gFIARCADcDuAYgJCAHIgNBAWoiB7iiISMgBEHYBWoiBSEGAkACQAJAIAsOAgIAAQsgBEGwBWohBgwBCyACIQYLIAYgIzkDAEQAAAAAAADwPyAjoSEjAkACQAJAAkAgDQ4DAwABAgsgBEGwBWohBQwCCyAEQYgFaiEFDAELIARBuAZqIQULIAUgIzkDACAJIANBKGxqIgMgBCsD2AU5AwggAyAEKwOwBTkDECADIAQrA4gFOQMYIAQrA7gGISMgAyAINgIAIAMgIzkDICAHIApHDQALCyAMQQFqIgwgFEcNAAsLAkACQAJAIBtBAk0EQCAcQQZ0IR0MAQsgG0GAgIDgAE8NAiAcQQZ0Ih0QIyEVIB0EQCAVQQAgHfwLAAsgFSAdaiEaIARB6AVqISEgBEGgB2ohFiAEQZAHaiESA0AgBCgC2AQgHkEEdGoiBSgCDCECIAUoAgghAyAFKAIEIQYgBSgCACEKIARBADYC8AcgBEEANgLsByAEQQA2AugHIARBADYC5AcgBEKCgICAMDcC+AYgBEKAgICAEDcC8AYgBCgC6AQiCSAKQQJ0aiEMIAkgBkECdGohDSAEKALIBCEIQQAhBQNAIAohBwJAAkACQAJAIARB8AZqIAVqKAIAIgsOAwMAAQILIAYhBwwCCyADIQcMAQsgAiEHCyAHQQBOBEACfwJAAkACQCALDgIAAQILIAggDCgCAEECdGohByAEQfAHagwCCyAIIA0oAgBBAnRqIQcgBEHsB2oMAQsgCCAJIAMgAiALQQJGIgsbQQJ0aigCAEECdGohByAEQegHaiAEQeQHaiALGwsgBygCAEEBajYCAAsgBUEEaiIFQRBHDQALAkAgBCgC8AciB0UEQCAEQfAGakEAQcAA/AsADAELIAQoAuQHIQ8gBCgC6AchDSAEKALsByEKIAQgBzYC0AcgBCAKNgL8ByAEIA02AvgHIAQgDzYC9AcCfwJAIA9FBEACfyAKIA1OBEBBASETIA0hBUECDAELIAQgDTYC/AcgBCAKNgL4B0ECIRMgCiEFIA0hCkEBCyECQQMhFyAHIApOBEBBACEQIAIhGCAHIQlBACEDIAUMAwsgBCAKNgLQByAEIAc2AvwHIAUgB0oNAUEAIRAgAiEYIAohCSATIQNBACETIAchCiAFDAILIARBAzYC4AUgBEKBgICAIDcC2AVBACELIAchCCAKIQxBACEJA0AgByEGAkACQAJAAkAgBEHYBWogCWooAgAiA0EBakEEbw4DAwABAgsgCiEGDAILIA0hBgwBCyAPIQYLIAchAgJAAkACQAJAIAMOAwMAAQILIAohAgwCCyANIQIMAQsgDyECCwJAIAIgCE4EQCAHIQICQAJAAkACQCADDgMDAAECCyAKIQIMAgsgDSECDAELIA8hAgsgAiAIRyAGIAxOcg0BCyAGIQwgByEIAn8CQAJAIAMiCw4CAwABCyAKDAELIA0gDyADQQJGGwshCAsgCUEEaiIJQQxHDQALIARCgoCAgDA3AuAFIARCgICAgBA3AtgFQQAhCEEBIRNBAiEYQQMhF0EAIQUDQCAEQdgFaiAFaigCACIGIAtqQQRvIgIhAwJAAkACQAJAAkAgBg4DBAECAAsgAiEXDAILIAIhEwwBCyACIRgLIAghAwsgByEIAkACQAJAAkAgAg4DAwABAgsgCiEIDAILIA0hCAwBCyAPIQgLIARB0AdqIQkCQAJAAkACQCAGDgMDAAECCyAEQfwHaiEJDAILIARB+AdqIQkMAQsgBEH0B2ohCQsgCSAINgIAIAMhCCAFQQRqIgVBEEcNAAsgBCgC9AchECAEKALQByEJIAQoAvwHIQogBCgC+AcMAQsgBCAFNgL8ByAEIAc2AvgHQQAhGEEAIRAgCiEJIBMhAyACIRMgBSEKIAcLIRECQAJAQdSfAigCACIIRQ0AQdyfAigCAEUNACAJIBBzIBFzIApzIQYCQCAIaUEBSyILRQRAIAhBAWsgBnEhAgwBCyAGIgIgCEkNACACIAhwIQILQdCfAigCACACQQJ0aigCACIFRQ0AIAUoAgAiBUUNACAIQQFrIQwDQAJAAkAgBiAFKAIEIgdHBEACQCALRQRAIAcgDHEhBwwBCyAHIAhJDQAgByAIcCEHCyACIAdGDQEMBAsgBSgCCCAJRw0AIAUoAgwgCkcNACAFKAIQIBFHDQAgBSgCFCAQRg0BCyAFKAIAIgUNAQwCCwsgBCAFKAIYIgIpAhg3A4gHIAQgAikCEDcDgAcgBCACKQIINwP4BiAEIAIpAgA3A/AGQQAhBiAEQQA2ApgHIARCADcDkAdBACEJAkAgAigCJCIFRQ0AIAIoAiAhCiAFQQV0IgcQJyEJIAdFDQAgCSAKIAf8CgAACyAEQQA2AqgHIARCADcDoAcgBCAFNgKYByAEIAU2ApQHIAQgCTYCkAcCQCACKAI0IgVFDQAgAigCMCEHIAVBDGwiAhAnIQYgAkUNACAGIAcgAvwKAAALIAQgBTYCqAcgBCAFNgKkByAEIAY2AqAHDAELIARBADYCqAcgBEIANwOgByAEQfAGakEAQSz8CwAgBCARNgKIByAEIAo2AoQHIAQgCTYCgAcgBCAQNgKMByASQYABEFUgBCgCkAciCCAEKAKUByIGQQV0aiICQgA3AwggAkKAgICAgICA+D83AwAgAkIANwMQIAJCADcDGCAEIAZBAWoiAjYClAcgBCgCmAchBQJAIBBBAEoEQCAEAn8gAiAFTwRAIBIgBUEBdEGAASAFGxBVIAQoApAHIgggBCgClAciBkEFdGoiAkIANwMQIAJCgICAgICAgPg/NwMIIAJCADcDACACQgA3AxggBCgCmAchBSAGQQFqDAELIAggAkEFdGoiAkIANwMQIAJCgICAgICAgPg/NwMIIAJCADcDACACQgA3AxggBkECagsiBzYClAcCQCAFIAdNBEAgEiAFQQF0QYABIAUbEFUgBCgCkAciCCAEKAKUByIHQQV0aiICQgA3AwggAkIANwMAIAJCADcDGCACQoCAgICAgID4PzcDECAEKAKYByEFDAELIAggB0EFdGoiAkIANwMIIAJCADcDACACQgA3AxggAkKAgICAgICA+D83AxALIAQgB0EBaiICNgKUBwJ/IAIgBU8EQCASIAVBAXRBgAEgBRsQVSAEKAKUByICQQFqIQYgBCgCkAciCCACQQV0agwBCyAHQQJqIQYgCCACQQV0agsiAkIANwMQIAJCADcDCCACQgA3AwAgAkKAgICAgICA+D83AxggBCAGNgKUByAEQoKAgIAwNwLgBSAEQoCAgIAQNwLYBUEAIQ9BACENQQAhBUEAIQ4DQAJAAkAgBEHYBWogDmooAgAiGUEATA0AQQQhByAJIQsCQAJAAkAgGUEBayIMDgICAAELIAUhByAKIQsMAQsgESAQIAxBAkYiAhshCyANIA8gAhshBwsgByALakEBayECAkACQCAMDgIDAQALIAIhDwwBCyACIQ0LIAUhAgsgESAQIBlBAkYbIQxBASEHIAggGUEBakEDcUEFdGoiBSsDGCElIAUrAxAhJiAFKwMIIScgBSsDACEoA0AgCSEFAkACQAJAIBkOAgIAAQsgCiEFDAELIAwhBQsgBSAHTARAIAIhBSAOQQRqIg5BEEcNAiAEIA82ApQFIAQgDTYCkAUgBCACNgKMBSAEQQQ2AogFIAQgEEEBazYCxAYgBCARQQFrNgLABiAEQoCAgIAQNwKwBSAEQoKAgIAwNwK4BSAEQYGChAg2ApgGIARCgICAgBA3A6gBIARCgoCAgDA3A7ABIAQgCkEBazYCvAYgBCAJQQFrNgK4BiAEIAQpApAFNwOgASAEIAQpAogFNwOYASAEIAQpAsAGNwOQASAEIAQpArgGNwOIASAEQYGChAg2AoQBIBYgEiAEQagBaiAEQZgBaiAEQYgBaiAEQYQBahC3AQwEBSAIIBlBBXRqIQUgCSELAkACQAJAIBkOAgIAAQsgCiELDAELIAwhCwsgJSAHuCALt6MiI6JEAAAAAAAA8D8gI6EiJCAFKwMYoqAhKSAmICOiICQgBSsDEKKgISogJyAjoiAFKwMIICSioCErICggI6IgBSsDACAkoqAhIwJ/IAQoApgHIgUgBk0EQCASIAVBAXRBgAEgBRsQVSAEKAKQByIIIAQoApQHIgZBBXRqDAELIAggBkEFdGoLIgUgIzkDACAFICk5AxggBSAqOQMQIAUgKzkDCCAEIAZBAWoiBjYClAcgB0EBaiEHDAELAAsACwALIAQCfyACIAVPBEAgEiAFQQF0QYABIAUbEFUgBCgCkAciCCAEKAKUByIGQQV0aiICQgA3AxAgAkKAgICAgICA+D83AwggAkIANwMAIAJCADcDGCAEKAKYByEFIAZBAWoMAQsgCCACQQV0aiICQgA3AxAgAkKAgICAgICA+D83AwggAkIANwMAIAJCADcDGCAGQQJqCyIHNgKUBwJ/IAUgB00EQCASIAVBAXRBgAEgBRsQVSAEKAKQByIIIAQoApQHIgdBBXRqDAELIAggB0EFdGoLIgJCADcDCCACQgA3AwAgAkIANwMYIAJCgICAgICAgPg/NwMQIAQgB0EBaiIGNgKUByAEQQI2AuAFIARCgICAgBA3AtgFQQAhDgJAAkADQCARIBAgBEHYBWogDmooAgAiAkECRhshDEEBIQcgCCACQQFqQQNvQQV0aiIFKwMYISUgBSsDECEmIAUrAwghJyAFKwMAISgDQCAJIQUCQAJAAkAgAg4CAgABCyAKIQUMAQsgDCEFCwJAIAUgB0wEQCAOQQRqIg5BDEcNAyAKQQFHDQUgCUEBRw0EIAQoAqQHIgIgBCgCqAciBkkNASAWIAZBAXRBgAEgBhsQNSAEIAQoAqQHIgJBAWo2AqQHIAQoAqAHIAJBDGxqIgJBAjYCCCACQoCAgIAQNwIADAYLIAggAkEFdGohBSAJIQsCQAJAAkAgAg4CAgABCyAKIQsMAQsgDCELCyAlIAe4IAu3oyIjokQAAAAAAADwPyAjoSIkIAUrAxiioCEpICYgI6IgJCAFKwMQoqAhKiAnICOiIAUrAwggJKKgISsgKCAjoiAFKwMAICSioCEjAn8gBCgCmAciBSAGTQRAIBIgBUEBdEGAASAFGxBVIAQoApAHIgggBCgClAciBkEFdGoMAQsgCCAGQQV0agsiBSAjOQMAIAUgKTkDGCAFICo5AxAgBSArOQMIIAQgBkEBaiIGNgKUByAHQQFqIQcMAQsLCyAEIAJBAWo2AqQHIAQoAqAHIAJBDGxqIgJBAjYCCCACQoCAgIAQNwIADAILIARBAjYCuAUgBEKAgICAEDcCsAUgBEKAgICAEDcDuAEgBEECNgLAASAWIARBuAFqIAlBAWsQ0wMMAQsgCiAJQQJqIgtqIiJBAWshDSAKIApsIgK4IBEgEWwiBSAJIAlsaiIHuCAJt0TNO39mnqD2v6IgEbeioGQEQCAJQQFqIQICfyAEKAKkByIGIAQoAqgHIgVPBEAgFiAFQQF0QYABIAUbEDUgBCgCoAcgBCgCpAciBkEMbGoMAQsgBCgCoAcgBkEMbGoLIgUgAjYCACAFIAs2AgggBUEBNgIEIAQgCzYCtAUgBCACNgKwBSAEIA02ApAFIARBAzYClAUgBCAJQQNqNgKMBSAEIAlBAms2AsQGIARBfzYCiAUgBCARQQFrNgLABiAEIAZBAWo2AqQHIARCAjcCuAUgBCAKQQJrNgK8BiAEQQA2ArgGIARBgYKECDYCmAYgBEICNwPwASAEIAQpArAFNwPoASAEIAQpApAFNwPgASAEIAQpAogFNwPYASAEIAQpAsAGNwPQASAEIAQpArgGNwPIASAEQYGChAg2AsQBIBYgEiAEQegBaiAEQdgBaiAEQcgBaiAEQcQBahC3AQwBCyAJQQJrIhkgByACa7cgCUEBdLejEDT8AiICIAIgGUobIgxBAmohDyAFIAwgDGxrt58QNCIjRAAAAAAAAPA/ICNEAAAAAAAA8D9kG/wCIgVBAk4EQCAIIA9BBXRqIgIrAxghJSACKwMQISYgAisDCCEnIAIrAwAhKCAFuCEpQQEhAiAGIQcDQCAlIAK4ICmjIiOiRAAAAAAAAPA/ICOhIiQgCCsDWKKgISogJiAjoiAkIAgrA1CioCErICcgI6IgCCsDSCAkoqAhLCAoICOiIAgrA0AgJKKgISMCfyAEKAKYByIOIAdNBEAgEiAOQQF0QYABIA4bEFUgBCgCkAciCCAEKAKUByIHQQV0agwBCyAIIAdBBXRqCyIOICM5AwAgDiAqOQMYIA4gKzkDECAOICw5AwggBCAHQQFqIgc2ApQHIAJBAWoiAiAFRw0ACwsgDEEDaiEOIAlBAWohAgJ/IAQoAqQHIgggBCgCqAciB08EQCAWIAdBAXRBgAEgBxsQNSAEKAKgByAEKAKkByIIQQxsagwBCyAEKAKgByAIQQxsagsiByACNgIAIAcgCzYCCCAHQQE2AgQgBCALNgK0BSAEIAI2ArAFIAQgDzYCvAUgBEECNgK4BSAEIAlBA2o2AowFIAQgDjYClAUgBCAGNgKQBSAEIApBAms2ArwGIARBADYCuAYgBCAIQQFqNgKkByAEIBkgDGs2AsQGIARBgYKECDYC2AMgBEF/NgKIBSAEIAVBAWsiCzYCwAYgBCAEKQKwBTcDmAMgBCAEKQK4BTcDoAMgBCAEKQKIBTcDiAMgBCAEKQKQBTcDkAMgBCAEKQK4BjcD+AIgBCAEKQLABjcDgAMgBEGBgoQINgL0AiAWIBIgBEGYA2ogBEGIA2ogBEH4AmogBEH0AmoQtwEgEUEBRgRAIAQgDzYCnAYgBEEANgKYBiAEQQI2AqAGIARBAjYCgAIgBCAEKQKYBjcD+AEgFiAEQfgBaiAMQQFrENMDDAELIAxBAUYEQAJ/IAQoAqQHIgcgBCgCqAciAk8EQCAWIAJBAXRBgAEgAhsQNSAEKAKgByAEKAKkByIHQQxsagwBCyAEKAKgByAHQQxsagsiAiAGNgIAIAIgDTYCCCACQQI2AgQgBCANNgKcBiAEICI2AoQGIARBfzYCgAYgBEF/NgKIBiAEIAVBAmsiAjYC5AYgBCAGNgKYBiAEIAIgBmo2AowGIARBADYC4AYgBCAHQQFqNgKkByAEQoCAgIAwNwKgBiAEIBFBAms2AtwGIARBADYC2AYgBEGBggQ2AMgDIARCgICAgDA3A7ACIAQgBCkCmAY3A6gCIAQgBCkCgAY3A5gCIAQgBCkCiAY3A6ACIAQgBCkC4AY3A5ACIAQgBCkC2AY3A4gCIARBgYIENgKEAiAWIBIgBEGoAmogBEGYAmogBEGIAmogBEGEAmoQtwEMAQsgBkEBayEHAn8gBCgCpAciAiAEKAKoByIITwRAIBYgCEEBdEGAASAIGxA1IAQoAqAHIAQoAqQHIgJBDGxqDAELIAQoAqAHIAJBDGxqCyIIIAc2AgAgCEKAgICAMDcCBCAEQQM2ApwGIAQgBzYCmAYgBEECNgKkBiAEIA82AqAGIAQgDTYCjAYgBCAFIAZqQQJrNgKIBiAEIBFBAms2AuQGIAQgCzYC4AYgBCACQQFqNgKkByAEQv/////PADcCgAYgBCAMQQJrNgLcBiAEQQA2AtgGIARBgYKACDYAyAMgBEL/////zwA3A9ACIAQgBCkCmAY3A+ACIAQgBCkCoAY3A+gCIAQgBCkCiAY3A9gCIAQgBCkC4AY3A8gCIAQgBCkC2AY3A8ACIARBgYKACDYCvAIgFiASIARB4AJqIARB0AJqIARBwAJqIARBvAJqELcBC0HAABAjIgYgBCkDiAc3AhggBiAEKQOABzcCECAGIAQpA/gGNwIIIAYgBCkD8AY3AgBBACEHQQAhCAJAIAQoApQHIgJFDQAgBCgCkAchCyACQQV0IgUQJyEIIAVFDQAgCCALIAX8CgAACyAGIAI2AiggBiACNgIkIAYgCDYCIAJAIAQoAqQHIgJFDQAgBCgCoAchCCACQQxsIgUQJyEHIAVFDQAgByAIIAX8CgAACyAGIAI2AjggBiACNgI0IAYgBzYCMCAEQQA2ArgDIAQgBjYC6AUgBCAJNgLYBSAEIBA2AuQFIAQgETYC4AUgBCAKNgLcBSAJIBBzIBFzIApzIQICQAJAQdSfAigCACIIRQ0AAkAgCGlBAUsiC0UEQCAIQQFrIAJxIQwMAQsgAiIMIAhJDQAgAiAIcCEMC0HQnwIoAgAgDEECdGooAgAiBUUNACAFKAIAIgVFDQAgCEEBayENA0ACQCACIAUoAgQiB0cEQAJAIAtFBEAgByANcSEHDAELIAcgCEkNACAHIAhwIQcLIAcgDEYNAQwDCyAFKAIIIAlHDQAgBSgCDCAKRw0AIAUoAhAgEUcNACAFKAIUIBBGDQMLIAUoAgAiBQ0ACwtBHBAjIgsgEDYCFCALIBE2AhAgCyAKNgIMIAsgCTYCCCALIAI2AgQgC0EANgIAIARBADYC6AUgCyAGNgIYAkBBACAIQdyfAigCAEEBarMiMEHgnwIqAgAiMSAIs5ReGw0AQQIhCQJAIAggCEEBa3FBAEcgCEEDSXIgCEEBdHIiBiAwIDGVjfwBIgUgBSAGSRsiBkEBRg0AIAYgBkEBa3FFBEAgBiEJDAELIAYQ9gEhCUHUnwIoAgAhCAsCQAJAIAggCU8EQCAIIAlNDQJB3J8CKAIAs0HgnwIqAgCVjfwBIQYgCSAIQQNJIAhpQQFLcgR/IAYQ9gEFIAZBAUEgIAZBAWtna3QgBkECSRsLIgYgBiAJSRsiCSAITw0CIAlFDQELIAlBgICAgARPDQggCUECdCIGECMhDkHQnwIoAgAhBUHQnwIgDjYCACAFBEBB1J8CKAIAGiAFECJB0J8CKAIAIQ4LQdSfAiAJNgIAIAYEQCAOQQAgBvwLAAtB2J8CKAIAIgZFDQEgBigCBCEIAkAgCWlBAUsiDEUEQCAIIAlBAWtxIQgMAQsgCCAJSQ0AIAggCXAhCAsgDiAIQQJ0akHYnwI2AgAgBigCACIHRQ0BIAlBAWshDQNAIAcoAgQhBQJAIAxFBEAgBSANcSEFDAELIAUgCUkNACAFIAlwIQULAkAgBSAIRgRAIAchBgwBCyAOIAVBAnRqIgooAgBFBEAgCiAGNgIAIAchBiAFIQgMAQsgBiAHKAIANgIAIAcgCigCACgCADYCACAKKAIAIAc2AgALIAYoAgAiBw0ACwwBC0HQnwIoAgAhBkHQnwJBADYCACAGBEBB1J8CKAIAGiAGECILQdSfAkEANgIAC0HUnwIoAgAiCCAIQQFrIgZxRQRAIAIgBnEhDAwBCyACIAhJBEAgAiEMDAELIAIgCHAhDAsCQEHQnwIoAgAiBiAMQQJ0aiIFKAIAIgJFBEAgC0HYnwIoAgAiAjYCAEHYnwIgCzYCACAFQdifAjYCACACRQ0BIAIoAgQhBQJAIAggCEEBayICcUUEQCACIAVxIQUMAQsgBSAISQ0AIAUgCHAhBQsgBiAFQQJ0aiALNgIADAELIAsgAigCADYCACACIAs2AgALQdyfAkHcnwIoAgBBAWo2AgALICEQygIgBEG4A2oQygILIAQgFzYC/AYgBCAYNgL4BiAEIBM2AvQGIAQgAzYC8AYLIBUgHkEGdGoiAiAEKQOIBzcCGCACIAQpA4AHNwIQIAIgBCkD+AY3AgggAiAEKQPwBjcCACACKAIgIgMEQCADECILIAIgBCgCkAc2AiAgAiAEKAKUBzYCJCACIAQoApgHNgIoQQAhByAEQQA2ApgHIARCADcDkAcgAigCMCIDBEAgAxAiIAQoApAHIQcLIAIgBCgCoAc2AjAgAiAEKAKkBzYCNCACIAQoAqgHNgI4IARBADYCqAcgBEIANwOgByAHBEAgBxAiCyAeQQFqIh4gHEcNAAsLIARBADYCwAYgBEIANwK4BiAEQbgGaiAcECUgBCAcNgK8BiAVIB1qIQICQCAbQQNJIgMNACAVKAI0IQUgBCgCuAYiB0EANgIAIBtBBkkNACAVQUBrIQYgFSEIA0AgCCgCdCEKIAcgBTYCBCAHQQRqIQcgBSAKaiEFIAYiCEFAayIGIAJHDQALCyAEQQA2AqAGIARCADcCmAYgBEGYBmogHBAlIAQgHDYCnAYCQCADDQAgFSgCHCEDIBUoAhghBiAVKAIUIQUgFSgCECEKIBUoAiQgBCgCmAYiByAAKAIEIgk2AgAgG0EGSQ0AIAlqIAUgCmogBmogA2prIQYgFUFAayEIIBUhBQNAIAUoAlwhAyAFKAJYIQogBSgCVCEJIAUoAlAhCyAFKAJkIAcgBjYCBCAGaiADIAogCSALampqayEGIAdBBGohByAIIgVBQGsiCCACRw0ACwsgGkEMaygCACECIAQoArgGIAQoArwGQQJ0akEEaygCACEDIARBADYCiAYgBEIANwKABiAEQYAGaiACIANqIgIQNSAEIAI2AoQGIBpBHGsoAgAhAiAEKAKYBiAEKAKcBkECdGpBBGsoAgAhBiAaQSRrKAIAIQUgGkEoaygCACEHIBpBLGsoAgAhCiAaQTBrKAIAIQggBEHoA2oiA0EAQSj8CwAgBEHYAGoiCSADQSj8CgAAIAAoAgQiAyACIAZqIAUgByAIIApqamprIgJBAXRLIANBEEtxAkAgAiADTQ0AIAAgAhDUAyACIAAoAgQiA2tBKGwiBkEATA0AIAZBKG4hBiAAKAIAIANBKGxqIQUDQCAFIAlBKPwKAAAgBUEoaiEFIAZBAUsgBkEBayEGDQALCyAAIAI2AgQEQEEAIQIgACgCACEDAkAgACgCBCIGRQ0AIAZBKGwiBRAnIQIgBUUNACACIAMgBfwKAAALIAAgAwR/IAMQIiAAKAIEBSAGCzYCCCAAIAI2AgALIARBADYC4AYgBEIANwLYBiAEQdgGaiAEKAKEBiICEDkgBCACNgLcBiAEQQA2AuADIARCADcC2AMgBEHYA2ogBCgChAYiAhAzIAQgAjYC3AMgG0EDTwRAQQAhCwNAAkAgC0EEdCIXIAQoAtgEaiICKAIAIgNBAEgNACACKAIMIQogAigCCCEIIAIoAgQhBkEAIQIgBEEANgL8ByAEQQA2AvgHIARBADYC9AcgBEEANgLwByAEQQA6AOMHIARBADoA4gcgBEEAOgDhByAEQQA6AO8GIARCgoCAgDA3AvgGIARCgICAgBA3AvAGIAEoAlgiDyADQQJ0IgVqIg5BeEEEIANBA3BBAkYbaiERIA8gBkECdCIHaiISQXhBBCAGQQNvQQJGG2ohFiAEKALoBCIYIAVqIRkgByAYaiEdIAQoApAEIRNBACEMQQAhBUEAIRBBACENA0AgAyEHAkACQAJAAkAgBEHwBmogBWooAgAiCQ4DAwABAgsgBiEHDAILIAghBwwBCyAKIQcLAkAgB0EASARAIARB/AdqIQcCQAJAAkACQCAJDgMDAAECCyAEQfgHaiEHDAILIARB9AdqIQcMAQsgBEHwB2ohBwsgB0F/NgIADAELAn8CQAJAAkAgCQ4CAAECCyAEIA4oAgAiBzYC/AcgByARKAIASCEHIBMgGSgCAEECdGooAgAhDSAEQeMHagwCCyAEIBIoAgAiBzYC+AcgByAWKAIASCEHIBMgHSgCAEECdGooAgAhECAEQeIHagwBCyAEQfQHaiAEQfAHaiAJQQJGIgkbIA8gCCAKIAkbIgdBAnQiHmoiISgCACIiNgIAIAwgEyAYIB5qKAIAQQJ0aigCACIeIAkbIQwgHiACIAkbIQIgIiAhQXhBBCAHQQNvQQJGG2ooAgBIIQcgBEHhB2ogBEHvBmogCRsLIAc6AAALIAVBBGoiBUEQRw0ACyAEIAQoAvwHNgKwBSAEIAQoAvgHNgK0BSAEIAQoAvQHNgK4BSAEIAQoAvAHNgK8BSAEIBA2AowFIAQgDTYCiAUgBCAMNgKUBSAEIAI2ApAFIAQtAOMHIQIgBC0A4gchAyAELQDhByEGIAQgBC0A7wY6AO8HIAQgBjoA7gcgBCADOgDtByAEIAI6AOwHIAtBAnQiDSAEKAKYBmooAgAhAiAEIAQpArAFNwNIIAQgBCkCuAU3A1AgBCAEKQKIBTcDOCAEIAQpApAFNwNAIAQgBCgA7Ac2AjQgBEHYBWogFSALQQZ0aiIMIARByABqIARBOGogBEE0aiACENIDIAQoAtwFIgIEfyACQQxsIgIEQCAEKAKABiAEKAK4BiANaigCAEEMbGogBCgC2AUgAvwKAAALIAQoAtwFBUEACyEFIAQoArgGIA1qKAIAIQYgBCgC2AYhAiAEIAEoAtgBIBdqIgMpAgg3A/gGIAQgAykCADcD8AYgBUEASgRAIAIgBkEEdGohBwNAIAcgBCkD+AY3AgggByAEKQPwBjcCACAHQRBqIQcgBUEBSyAFQQFrIQUNAAsgBCgC3AUhBSAEKAK4BiANaigCACEGCyAEKALYAyEDIAQgASgCqAEgC0EYbGoiAikDEDcDgAcgBCACKQMINwP4BiAEIAIpAwA3A/AGIAUEQCADIAZBGGxqIQcDQCAHIAQpA4AHNwMQIAcgBCkD+AY3AwggByAEKQPwBjcDACAHQRhqIQcgBUEBSyAFQQFrIQUNAAsLIAwoAgwhCSAMKAIIIQggDCgCBCECIAwoAgAhAwJAAkAgCkEATg0AIAJBBEEIIANBAUYbQQAgAxtBlJUBaigCAEYNACACIQogAyECDAELIAghCiADIQgLQQAhBSAEQQA2AugHIARBADYC5AcgBEEANgLcByAEQQA2AugGIARCgoCAgDA3AvgGIARCgICAgBA3AvAGA0AgCCEHAkACQAJAAkAgBEHwBmogBWooAgAiAw4DAwABAgsgAiEHDAILIAohBwwBCyAJIQcLIARB6AdqIQYCQAJAAkACQCAHDgMDAAECCyAEQeQHaiEGDAILIARB3AdqIQYMAQsgBEHoBmohBgsgBiADNgIAIAVBBGoiBUEQRw0ACyAMKAIcIAwoAhggDCgCFCAMKAIQampqQQV0IgIgDCgCJEEFdCIDRwRAIAMgDCgCICIGaiEDIAQoAugGIQogBCgC3AchDCAEKALkByETIAQoAugHIQ8gAiAGaiEHIAAoAgAgBCgCmAYgDWooAgBBKGxqIQUDQCAHKwMYISMgBysDECEkIAcrAwghJSAEIAcrAwA5A/AGIAQgJTkDyAMgBCAkOQO4AyAEICM5A9AHIARB8AZqIgYhCQJAAkACQAJAIA8OAwMAAQILIARByANqIQkMAgsgBEG4A2ohCQwBCyAEQdAHaiEJCwJAAkACQAJAIBMOAwMAAQILIARByANqIQYMAgsgBEG4A2ohBgwBCyAEQdAHaiEGCyAEQfAGaiIIIQICQAJAAkACQCAMDgMDAAECCyAEQcgDaiECDAILIARBuANqIQIMAQsgBEHQB2ohAgsCQAJAAkACQCAKDgMDAAECCyAEQcgDaiEIDAILIARBuANqIQgMAQsgBEHQB2ohCAsgCSsDACEjIAYrAwAhJCACKwMAISUgBSAIKwMAOQMgIAUgJTkDGCAFICQ5AxAgBSAjOQMIIAUgCzYCACAFQShqIQUgB0EgaiIHIANHDQALCyAEKALYBSICRQ0AIAIQIgsgC0EBaiILIBxHDQALCyAEQYAFaiABRwRAIAEoAtgBIgIEQCACECILIAEgBCgC2AY2AtgBIAEgBCgC3AY2AtwBIAEgBCgC4AY2AuABIARBADYC4AYgBEIANwLYBgsgBEGwAmogAUcEQCABKAKoASICBEAgAhAiCyABIAQoAtgDNgKoASABIAQoAtwDNgKsASABIAQoAuADNgKwASAEQQA2AuADIARCADcC2AMLIAAoAgQhAiAEQQA2ApAFIARCADcCiAUgBEGIBWogAhAzIAQgAjYCjAUgACgCBCIMBEAgASgCSCENIAEoAlghEyAEQbgHaiEPIARBoAdqIRggBEGIB2ohCCAAKAIAIRcgBCgCiAUhCSAEKALYBCEOQQAhEANAIBcgEEEobGoiBisDGCEjIAYrAxAhJCAGKwMIISUgDiAGKAIAQQR0aiIFKAIIIQIgBSgCBCEDIAUoAgAhBwJAIAUoAgwiCkEASARAQQAhBSAEQfAGakEAQcgA/AsAIARBAjYC4AUgBEKAgICAEDcC2AUDQCAHIQYCQAJAAkACQCAEQdgFaiAFaigCACILDgMDAAECCyADIQYMAgsgAiEGDAELIAohBgsgBEHwBmpBGEEwIAtBAUYbQQAgCxtqIgsgDSATIAZBAnRqKAIAQRhsaiIGKQMQNwMQIAsgBikDCDcDCCALIAYpAwA3AwAgBUEEaiIFQQxHDQALIAQrA6AHISYgBCsD8AYhJyAEKwOIByEoIAQrA6gHISkgBCsD+AYhKiAEKwOQByErIAkgEEEYbGoiAiAlIAQrA4AHoiAkIAQrA5gHoqAgIyAEKwOwB6KgOQMQIAIgJSAqoiAkICuioCAjICmioDkDCCACICUgJ6IgJCAooqAgIyAmoqA5AwAMAQsgBisDICEmQQAhBiAEQfAGakEAQeAA/AsAIARCgoCAgDA3AuAFIARCgICAgBA3AtgFIAEoAlgiCyAHQQJ0aiERIAsgA0ECdGohEiABKAJIIQMDQAJ/AkACQAJAIARB2AVqIAZqKAIAIgUOAgABAgsgBEHwBmohByADIBEoAgBBGGxqDAILIAghByADIBIoAgBBGGxqDAELIBggDyAFQQJGIgUbIQcgAyALIAIgCiAFG0ECdGooAgBBGGxqCyEFIAcgBSkDEDcDECAHIAUpAwg3AwggByAFKQMANwMAIAZBBGoiBkEQRw0ACyAEKwO4ByEnIAQrA6AHISggBCsD8AYhKSAEKwOIByEqIAQrA8AHISsgBCsDqAchLCAEKwP4BiEtIAQrA5AHIS4gCSAQQRhsaiICICUgBCsDgAeiICQgBCsDmAeioCAjIAQrA7AHoqAgJiAEKwPIB6KgOQMQIAIgJSAtoiAkIC6ioCAjICyioCAmICuioDkDCCACICUgKaIgJCAqoqAgIyAooqAgJiAnoqA5AwALIBBBAWoiECAMRw0ACwsCQCABQcAEayAERg0AIAEoAkgiAgRAIAIQIgsgAUIANwJIIAEgBCgCjAUiAjYCUCABIAI2AkwgAkUNACABIAJBGGwiAhAnIgM2AkggAkUNACADIAQoAogFIAL8CgAACyABKAJAIgJBAEwNAyABKAJMIQMgASgCjAEhBiAEQQA2AtADIARCADcCyAMgBEHIA2ogAyAfayIMIAYgAm4iBiAgIB9ramogAmwiAhBEIAQgAjYCzAMgAUGIAWohCwJAIAEoAowBIgJFDQAgAkEDdCICRQ0AIAQoAsgDIAsoAgAgAvwKAAALIAMgH0cEQCAAKAIAIB9BKGxqIQkgBCgC2AQhDSABKAJAIgBBAEwhE0EAIRcDQCATRQRAIAkgF0EobGoiAisDICEmIAIrAxghIyACKwMQISQgAisDCCElIA0gAigCACIDQQR0aiICKAIIIQ8gASgCeCADQQxsaiEYIAQoAsgDIAYgF2ogAGxBA3RqIQogCygCACEOQQAhAyACKAIMIhBBAE4hESACKAIAQQJ0IRIgAigCBEECdCEWA0ACQCARRQRAIARCADcDgAcgBEIANwP4BiAEQgA3A/AGIARBAjYC4AUgBEKAgICAEDcC2AUgDiADQQN0IgdqIQhBACEFA0AgBEHwBmpBCEEQIARB2AVqIAVqKAIAIgJBAUYbQQAgAhtqIAggGCACQQJ0aigCACAAbEEDdGorAwA5AwAgBUEEaiIFQQxHDQALIAcgCmogJSAEKwPwBqJEAAAAAAAAAACgICQgBCsD+AaioCAjIAQrA4AHoqA5AwAMAQsgBEIANwPYBSAEQgA3A7AFIARCADcDuAMgBEIANwPQByAEQoKAgIAwNwL4BiAEQoCAgIAQNwLwBiABKAJ4IgggEmohGSADQQN0Ih0gCygCAGohAiAIIBZqIR5BACEFA0ACfwJAAkACQCAEQfAGaiAFaigCACIHDgIAAQILIAIgGSgCACAAbEEDdGohByAEQdgFagwCCyACIB4oAgAgAGxBA3RqIQcgBEGwBWoMAQsgAiAIIA8gECAHQQJGIiAbQQJ0aigCACAAbEEDdGohByAEQbgDaiAEQdAHaiAgGwsgBysDADkDACAFQQRqIgVBEEcNAAsgCiAdaiAlIAQrA9gFokQAAAAAAAAAAKAgJCAEKwOwBaKgICMgBCsDuAOioCAmIAQrA9AHoqA5AwALIANBAWoiAyAARw0ACwsgF0EBaiIXIAxHDQALCyAGIB9rIQggFARAIAggDGohByABKAJoIQogASgCeCEJIAEoAkAhAkEAIQ4gBCgC+AQhDSAEKAKQBCETIAQoAsgEIQ8DQCAPIA5BAnQiAGooAgAiA0EASgRAIAcgACATaigCAGohGEQAAAAAAADwPyADQQFqt6MhIyALKAIAIgAgCSAKIA0gDkEMbGooAghBAnRqKAIAIgZBAnRqIgVBeEEEIAZBA29BAkYbaigCACACbEEDdGohFyAAIAUoAgAgAmxBA3RqIRBBACEFIAQoAsgDIREDQCAFQQFqIQAgAkEASgRARAAAAAAAAPA/ICMgALiiIiShISUgESAFIBhqIAJsQQN0aiESQQAhBQNAIBIgBUEDdCIGaiAlIAYgEGorAwCiICQgBiAXaisDAKKgOQMAIAVBAWoiBSACRw0ACwsgACIFIANHDQALCyAOQQFqIg4gFEcNAAsLIARBADYCwAMgBEIANwK4AyAEQbgDaiAEKAKEBiIAEDUgBCAANgK8AyAbQQNPBEBBACEXA0ACQCAEKALYBCAXQQR0aiICKAIAIgBBAEgNACACKAIMIQMgAigCCCEHIAIoAgQhAkEAIQUgBEEANgLQByAEQQA2AvwHIARBADYC+AcgBEEANgL0ByAEQQA2AvAHIARBADYC7AcgBEEANgLoByAEQQA2AuQHIARBAToA6AYgBEEBOgDjByAEQQE6AOIHIARBAToA4QcgBEKCgICAMDcC+AYgBEKAgICAEDcC8AYgBCgC6AQiEyAAQQJ0IgZqIRggASgCeCIJIAZqIQ4gEyACQQJ0IgZqIRAgBiAJaiEUIAEoAmghESABKAJYIRIgBCgCkAQhDQNAIAAhBgJAAkACQAJAIARB8AZqIAVqKAIAIgoOAwMAAQILIAIhBgwCCyAHIQYMAQsgAyEGCwJAIAZBAEgEQCAEQdAHaiEGAkACQAJAAkAgCg4DAwABAgsgBEH8B2ohBgwCCyAEQfgHaiEGDAELIARB9AdqIQYLIAZBfzYCAAwBCwJAAkACQAJAIAoOAgABAgsgBCAOKAIANgLQByAEIA0gGCgCAEECdGooAgA2AvAHIAAhBgwCCyAEIBQoAgA2AvwHIAQgDSAQKAIAQQJ0aigCADYC7AcgAiEGDAELIARB+AdqIARB9AdqIApBAkYiDxsgCSAHIAMgDxsiBkECdCIWaigCADYCACAEQegHaiAEQeQHaiAPGyANIBMgFmooAgBBAnRqKAIANgIACyASIAZBAnRqIg8oAgAgD0F4QQQgBkEDb0ECRhtqKAIASA0AIAAhBgJAAkACQAJAIAoOAwMAAQILIAIhBgwCCyAHIQYMAQsgAyEGCwJAIAkgESAGQQJ0Ig9qKAIAIhZBAnQiG2ooAgAgCUF4QQQgBkEDb0ECRhtqIA9qKAIARgRAIAlBeEEEIBZBA29BAkYbaiAbaigCACAAIQYCQAJAAkACQCAKDgMDAAECCyACIQYMAgsgByEGDAELIAMhBgsgCSAGQQJ0aigCAEYNAQsgBEHwB2ohBgJAAkACQAJAIAoOAwMAAQILIARB7AdqIQYMAgsgBEHoB2ohBgwBCyAEQeQHaiEGCyAGIAYoAgAgDGo2AgAMAQsgBEHoBmohBgJAAkACQAJAIAoOAwMAAQILIARB4wdqIQYMAgsgBEHiB2ohBgwBCyAEQeEHaiEGCyAGQQA6AAALIAVBBGoiBUEQRw0ACyAEIAQoAtAHNgLYBSAEIAQoAvwHNgLcBSAEIAQoAvgHNgLgBSAEIAQoAvQHNgLkBSAEIAQoAuwHIAhqNgK0BSAEIAQoAvAHIAhqNgKwBSAEIAQoAuQHIAhqNgK8BSAEIAQoAugHIAhqNgK4BSAEIAQtAOEHOgDfByAEIAQtAOIHOgDeByAEIAQtAOMHOgDdByAEIAQtAOgGOgDcByAXQQJ0IgAgBCgCmAZqKAIAIQIgBCAEKQK4BTcDGCAEIAQpArAFNwMQIAQgBCkC4AU3AyggBCAEKQLYBTcDICAEIAQoANwHNgIMIARB8AZqIBUgF0EGdGogBEEgaiAEQRBqIARBDGogAiAIahDSAwJAIAQoAvQGIgJFDQAgAkEMbCICRQ0AIAQoArgDIAQoArgGIABqKAIAQQxsaiAEKALwBiAC/AoAAAsgBCgC8AYiAEUNACAAECILIBdBAWoiFyAcRw0ACwsgCyAEQcgDahCSAiABIARBuANqIARBgAZqEJ4BIAQoArgDIgAEQCAAECILIAQoAsgDIgBFDQQgABAiDAQLEHIACxAmAAsQZgALIARBADYC+AYgBEIANwLwBiABIARBgAZqIARB8AZqEJ4BIAQoAvAGIgBFDQAgABAiCyAEKAKIBSIABEAgABAiCyAEKALYAyIABEAgABAiCyAEKALYBiIABEAgABAiCyAEKAKABiIABEAgABAiCyAEKAKYBiIABEAgABAiCyAEKAK4BiIABEAgABAiCyAVBEAgFSAaRwRAA0AgGkEQayIAKAIAIgEEQCABECILIABBADYCACAaQQxrQgA3AgAgGkEgaygCACIABEAgABAiCyAVIBpBQGoiGkcNAAsLIBUQIgsgBCgCkAQiAARAIAAQIgsgBCgCyAQiAARAIAAQIgsgBCgC2AQiAARAIAAQIgsgBCgC6AQiAARAIAAQIgsgBCgC+AQiAARAIAAQIgsgBEGACGokAAvHAQECfyACIAJBA20iAkEDbGsiAyABIAIQ2AMiBEYEQCAAQX82AgggAEJ/NwIADwsgBEEASARAIAAgAzYCBCAAIAI2AgAgAEEEQQggA0EBRhtBACADG0GUlQFqKAIANgIIDwsgACABKAJoIAJBDGxqIARBAnRqKAIAQQNtIgEgAiABIAJIIgEbNgIAIABBBEEIIARBAUYbQQAgBBtBlJUBaigCACICIANHQQJBAyACIANGGyABGyIBNgIEIAAgAUEBakEDcTYCCAufAwEGfyMAQSBrIgMkACADQX82AhwgA0F/NgIYIANBfzYCFCADQX82AhAgA0ECNgIMIANCgICAgBA3AgQgAkEDbCEGA0AgA0EEaiAFaigCACIHIAZqIQggA0EcaiEEAkACQAJAAkAgBw4DAwABAgsgA0EYaiEEDAILIANBFGohBAwBCyADQRBqIQQLIAQgCDYCACAFQQRqIgVBDEcNAAsCQCAAAn8gASACENgDIgRBAEgEQCADKAIUIQUgAygCGCECIAMoAhwhBCADKAIQDAELIAIgASgCaCACQQxsaiAEQQJ0aigCACIFQQNtIgZKBEAgAEJ/NwIIIABCfzcCAAwCCyADQRxqIQECQAJAAkACQCAEDgMDAAECCyADQRhqIQEMAgsgA0EUaiEBDAELIANBEGohAQtBfkEBQX5BASAFIAZBA2xrQQJGGyAFaiIEQQNvQQJGGyAEaiECQX5BAUF+QQEgASgCACIBQQNvQQJGGyABaiIFQQNvQQJGGyAFags2AgwgACAFNgIIIAAgAjYCBCAAIAQ2AgALIANBIGokAAtmAQR/IwBBEGsiAiQAIAJBAjYCDCACQoCAgIAQNwIEIAFBA2whBEF/IQEDQEF+IAJBBGogA2ooAgAiBSABQX9HGyABIAAgBCAFahDmARshASADQQRqIgNBDEcNAAsgAkEQaiQAIAELxQQBBH8CQAJAAkACQCADDgMDAgABCyACKAIAKAIAIgIgAUEEayIBKAIAIgNBAnRqKAIAIAIgACgCACIFQQJ0aigCAEkEQCAEIAM2AgAgBCAAKAIANgIEDwsgBCAFNgIAIAQgASgCADYCBA8LIANBCEwEQCAAIAFGDQIgBCAAKAIANgIAIABBBGoiBSABRg0CIAIoAgAoAgAhBiAEIQADQCAAQQRqIQICQCAGIAUoAgAiA0ECdGooAgAgBiAAKAIAIgdBAnRqKAIASQRAIAAgBzYCBAJ/IAQgACAERg0AGgNAIAAgBiAFKAIAQQJ0aigCACAGIABBBGsiAygCACIHQQJ0aigCAE8NARogACAHNgIAIAMiACAERw0ACyAECyAFKAIANgIADAELIAIgAzYCAAsgAiEAIAVBBGoiBSABRw0ACwwCCyAAIAAgA0EBdiIGQQJ0IgdqIgUgAiAGIAQgBhC4ASAFIAEgAiADIAZrIgMgBCAHaiADELgBIAIoAgAhBiAFIQMCQANAIAEgA0YNASAEIAMoAgAiAiAAKAIAIgcgBigCACIIIAJBAnRqKAIAIAggB0ECdGooAgBJIgIbNgIAIANBBEEAIAIbaiEDIARBBGohBCAAQQBBBCACG2oiACAFRw0ACyABIANGDQIDQCAEIAMoAgA2AgAgBEEEaiEEIANBBGoiAyABRw0ACwwCCyAAIAVGDQEDQCAEIAAoAgA2AgAgBEEEaiEEIABBBGoiACAFRw0ACwwBCyAEIAAoAgA2AgALC8UEAQR/AkACQAJAAkAgAw4DAwIAAQsgAigCACgCACICIAFBBGsiASgCACIDQQJ0aigCACACIAAoAgAiBUECdGooAgBJBEAgBCADNgIAIAQgACgCADYCBA8LIAQgBTYCACAEIAEoAgA2AgQPCyADQQhMBEAgACABRg0CIAQgACgCADYCACAAQQRqIgUgAUYNAiACKAIAKAIAIQYgBCEAA0AgAEEEaiECAkAgBiAFKAIAIgNBAnRqKAIAIAYgACgCACIHQQJ0aigCAEkEQCAAIAc2AgQCfyAEIAAgBEYNABoDQCAAIAYgBSgCAEECdGooAgAgBiAAQQRrIgMoAgAiB0ECdGooAgBPDQEaIAAgBzYCACADIgAgBEcNAAsgBAsgBSgCADYCAAwBCyACIAM2AgALIAIhACAFQQRqIgUgAUcNAAsMAgsgACAAIANBAXYiBkECdCIHaiIFIAIgBiAEIAYQuQEgBSABIAIgAyAGayIDIAQgB2ogAxC5ASACKAIAIQYgBSEDAkADQCABIANGDQEgBCADKAIAIgIgACgCACIHIAYoAgAiCCACQQJ0aigCACAIIAdBAnRqKAIASSICGzYCACADQQRBACACG2ohAyAEQQRqIQQgAEEAQQQgAhtqIgAgBUcNAAsgASADRg0CA0AgBCADKAIANgIAIARBBGohBCADQQRqIgMgAUcNAAsMAgsgACAFRg0BA0AgBCAAKAIANgIAIARBBGohBCAAQQRqIgAgBUcNAAsMAQsgBCAAKAIANgIACwvFBAEEfwJAAkACQAJAIAMOAwMCAAELIAIoAgAoAgAiAiABQQRrIgEoAgAiA0ECdGooAgAgAiAAKAIAIgVBAnRqKAIASQRAIAQgAzYCACAEIAAoAgA2AgQPCyAEIAU2AgAgBCABKAIANgIEDwsgA0EITARAIAAgAUYNAiAEIAAoAgA2AgAgAEEEaiIFIAFGDQIgAigCACgCACEGIAQhAANAIABBBGohAgJAIAYgBSgCACIDQQJ0aigCACAGIAAoAgAiB0ECdGooAgBJBEAgACAHNgIEAn8gBCAAIARGDQAaA0AgACAGIAUoAgBBAnRqKAIAIAYgAEEEayIDKAIAIgdBAnRqKAIATw0BGiAAIAc2AgAgAyIAIARHDQALIAQLIAUoAgA2AgAMAQsgAiADNgIACyACIQAgBUEEaiIFIAFHDQALDAILIAAgACADQQF2IgZBAnQiB2oiBSACIAYgBCAGELoBIAUgASACIAMgBmsiAyAEIAdqIAMQugEgAigCACEGIAUhAwJAA0AgASADRg0BIAQgAygCACICIAAoAgAiByAGKAIAIgggAkECdGooAgAgCCAHQQJ0aigCAEkiAhs2AgAgA0EEQQAgAhtqIQMgBEEEaiEEIABBAEEEIAIbaiIAIAVHDQALIAEgA0YNAgNAIAQgAygCADYCACAEQQRqIQQgA0EEaiIDIAFHDQALDAILIAAgBUYNAQNAIAQgACgCADYCACAEQQRqIQQgAEEEaiIAIAVHDQALDAELIAQgACgCADYCAAsLnQIBDX8gACgCGCABQQJ0aigCACMAQRBrIgVBAjYCDCAFQoCAgIAQNwIEIAFBA2whB0EDbCEIQQAhAQNAIAVBBGogAWooAgAiBCAIaiIJQQJ0IgIgACgCDCIDKAIgaigCACEKIAAoAiAgAygCECACaigCACILQQNtIgxBAnRqKAIAIQ0gBCAHaiIOQQJ0IgQgACgCACIGKAIAaiADKAIAIAJqKAIANgIAIAYoAhAgBGogCyANIAxrQQNsajYCACAGKAIgIARqIAo2AgAgACgCFARAIAAoAgQgDkEFdGoiAiAAKAIQIAlBBXRqIgMpAxg3AxggAiADKQMQNwMQIAIgAykDCDcDCCACIAMpAwA3AwALIAFBBGoiAUEMRw0ACwu+AgELfyMAQdAAayIDJAAgAyACKAIAIgU2AgAgAyACKAIEIgY2AgQgAyACKAIIIgc2AgggAyACKAIMIgg2AgwgAyACKAIQIgk2AhAgAyACKAIUIgo2AhQgAyACKAIYIgs2AhggAyACKAIcIgw2AhwgAyACKAIgIg02AiAgAyACKAIkIgI2AiQCQCABBEAgAEUNASABLQAQQQFxDQFBACECA0AgAkEBaiICQYAIRgRAQQAhAiABLQAQDQMLIAMgBBDcAyAEQQFqIgQgAEcNAAsMAQsgAyACNgJMIAMgDTYCSCADIAw2AkQgAyALNgJAIAMgCjYCPCADIAk2AjggAyAINgI0IAMgBzYCMCADIAY2AiwgAyAFNgIoIABFDQADQCADQShqIAQQ3AMgBEEBaiIEIABHDQALCyADQdAAaiQAC4MBAQN/IABCADcCBCAAKAIAIQMgAEEANgIAIAAgASgCBCIEEJ8BIAAgBDYCBAJAAkAgASgCBCIEBEAgACgCACEAIAEoAgAhAQNAIAAgAkEwbGogAyABIAJBAnRqKAIAQTBsakEw/AoAACACQQFqIgIgBEcNAAsMAQsgA0UNAQsgAxAiCwuOAQICfwF8IwBBEGsiAiQAQYCfAi0AAEEBcUUEQEECQeyLAkEDEAYhA0GAnwJBAToAAEH8ngIgAzYCAAsgAiABKQIANwMIIAJBADYCBEH8ngIoAgBBAEEAIAJBBGogAkEIahAFIQQgAigCBCEBIAAgBPwDNgIEIABBnKACNgIAIAEEQCABEAQLIAJBEGokAAvSAwIHfwx8IwBB4ABrIgIkAAJ/AkAgAUEMbCIDIAAoAgAiBSgCaGooAgBBAEgNACACQoCAgIAQNwJIIAJBAjYCUCAFKAJYIANqIQcgACgCBCgCACABQTBsaiIDKwMoIQwgAysDICENIAMrAxghDiADKwMQIQ8gAysDCCEQIAMrAwAhESAFKAJIIQgDQCAIIAcgAkHIAGogBGooAgBBAnRqKAIAQRhsaiIGKwMAIQkgBisDCCEKIAMgBisDECILIAwgCyAMZBsiDDkDKCADIAogDSAKIA1kGyINOQMgIAMgCSAOIAkgDmQbIg45AxggAyAPIAsgCyAPZBsiDzkDECADIBAgCiAKIBBkGyIQOQMIIAMgESAJIAkgEWQbIhE5AwAgEiALoCESIBMgCqAhEyAUIAmgIRQgBEEEaiIEQQxHDQALIAIgEkQAAAAAAAAIQKM5A1ggAiATRAAAAAAAAAhAozkDUCACIBREAAAAAAAACECjIgk5A0ggCSAJYg0AIAIgAikDWDcDQCACIAIpA1A3AzggAiACKQNINwMwIAIgBUEw/AoAACACQTBqIAIQhQIMAQtBfwshAyAAKAIIKAIAIAFBAnRqIAM2AgAgAkHgAGokAAvyAgEIfyMAQRBrIgUkACAFQQA2AgggBUIANwIAIAUgAhAlIAUgAjYCBCAFKAIAIQIgACgCTCIHBEAgASgCACEBA0AgAiABIARBAnRqKAIAQQJ0aiAENgIAIARBAWoiBCAHRw0ACwsgACgCXCEBIAAoAkAhBwJAIAMEQCABRQ0BIAMtABBBAXENASAAKAJ4IQggACgCWCEGQQAhAEEAIQQDQCAAQQFqIgBBgAhGBEBBACEAIAMtABANAwsCQCAGIARBAnQiCWoiCigCACILQQBIDQAgCiACIAtBAnRqKAIAIgo2AgAgBw0AIAggCWogCjYCAAsgBEEBaiIEIAFHDQALDAELIAFFDQAgACgCeCEDIAAoAlghAEEAIQQDQAJAIAAgBEECdCIIaiIGKAIAIglBAEgNACAGIAIgCUECdGooAgAiBjYCACAHDQAgAyAIaiAGNgIACyAEQQFqIgQgAUcNAAsLIAIEQCACECILIAVBEGokAAu7CAINfwJ+IwBBMGsiBiQAIABBADYCKCAAQgA3AiAgAEEANgIYIABCADcCECAAQQA2AgggAEIANwIAIAEoAgQiBARAIAAgBEEBdEEBayIEEJ8BIAAgBDYCBCAAQRBqIARBfxAxIAEoAgQhBCAGQn83AwggBkJ/NwIoIABBIGogBEEBayAGQQhqELwEIAAoAiQhDiAGIAAoAhA2AhAgBiAAKAIUNgIUIAAoAiAhBCAGIA42AhwgBiAENgIYIAYgAigCADYCICAGIAIoAgQ2AiRBACEEIwBBIGsiByQAIAYpAhAhECAGKQIYIREgByAGKQIgNwIYIAcgETcCECAHIBA3AgggDgRAA0BBfyEFIAcoAhwhCAJ/QX8gBEF/SA0AGkF/IARBAWoiCSAITg0AGiAEIAlzZ0EgciAHKAIYIgIgBEECdGooAgAiAyACIAlBAnRqKAIAIgJGDQAaIAIgA3NnCyEJAkAgBEEATCAEIAhKcg0AIAcoAhgiAiAEQQJ0aigCACIFIAIgBEEBayIDQQJ0aigCACICRgRAIAMgBHNnQSByIQUMAQsgAiAFc2chBQsgBygCGCEKAn9BfyAEIAUgCUggBSAJSmsiC2siAkEASCACIAhOcg0AGiACIARzZ0EgaiAKIARBAnRqKAIAIgMgCiACQQJ0aigCACICRg0AGiACIANzZwshDCAKIARBAnRqIQ1BgAEhBQNAAn9BfyAFIgIgC2wgBGoiA0EASCADIAhOcg0AGiADIARzZ0EgaiANKAIAIgUgCiADQQJ0aigCACIDRg0AGiADIAVzZwsgAkECdCEFIAxKDQALIAJBAXYhBUEAIQMDQAJ/QX8gAyAFaiIPIAtsIARqIgJBAEggAiAITnINABogAiAEc2dBIGogDSgCACIJIAogAkECdGooAgAiAkYNABogAiAJc2cLIQIgDyADIAIgDEobIQMgBUEBdiIFDQALIAQgAyALbCAEaiIDIAMgBEobIQIgBygCGCELAn9BfyAEIAMgAyAESBsiCEEASCAHKAIcIg0gCExyDQAaIAIgCHNnQSBqIAsgAkECdGooAgAiBSALIAhBAnRqKAIAIgNGDQAaIAMgBXNnCyEPIAggAmshDCALIAJBAnRqIQkgAiEDA0AgCCAMQQFqQQF1IgwgA2oiCkoEQCAKIAMCf0F/IApBAEggCiANTnINABogAiAKc2dBIGogCSgCACIFIAsgCkECdGooAgAiA0YNABogAyAFc2cLIA9KGyEDCyAMQQFKDQALIAcoAhAgBEEDdGoiBSADQQF0IAIgA0dyIgk2AgAgBSADQQFqIgJBAXQgAiAIR3IiBTYCBCAHKAIIIgMgCUECdGogBEEBdEEBciICNgIAIAMgBUECdGogAjYCACAEQQFqIgQgDkcNAAsLIAdBIGokACAAIAEQtgQLIAZBMGokACAAC5QJAQp/IwBBIGsiCCQAIAAoAlwhBSAIQQA2AhQgCEIANwIMIAhBDGogBUEDbiIEECUgCCAENgIQIAgoAgwiByAEQQJ0aiEJAkACQCAFQQJLBEADQCAHIAZBAnRqIAY2AgAgBkEBaiIGIARHDQALIAggAjYCHCAFQYMDSQ0BIAQhBgNAIAZBAnQQUCIFRQRAIAZBAXYiBg0BDAMLCyAHIAkgCEEcaiAEIAUgBhC5ASAFECIMAgsgCCACNgIcCyAHIAkgCEEcaiAEQQBBABC5AQsgCCgCDCIJIQYgCCgCECIFBEAgAigCACEHA0AgBiAGIAVBAXYiBEECdGoiBkEEaiAHIAYoAgBBAnRqKAIAQX9GIgobIQYgBCAFIARBf3NqIAobIgUNAAsLIAhBDGoiByAGIAlrQQJ1QQAQMSACIAcQpgEgASAHEN4DQQAhASMAQZABayIEJAAgBygCBCEJIAAoAlwiBkEDbiIFIAAoAtwBRgRAQQAhBiAAQdgBaiICQgA3AgQgAigCACEFIAJBADYCACACIAcoAgQiChA5IAIgCjYCBAJAAkAgBygCBCIKBEAgAigCACECIAcoAgAhCwNAIAIgBkEEdGoiDCAFIAsgBkECdGooAgBBBHRqIg0pAgg3AgggDCANKQIANwIAIAZBAWoiBiAKRw0ACwwBCyAFRQ0BCyAFECILIAAoAlwiBkEDbiEFCyAFIAAoAqwBRgRAIABBqAFqIAcQpQEgACgCXCIGQQNuIQULIAQgACgCZDYCbCAAQQA2AmQgACgCWCECIAQgBjYCZCAEIAI2AmAgBCAAKAJgNgJoIABBADYCYCAAQgA3A1ggBCAAKAJ0NgJ8IABBADYCdCAEIAAoAmg2AnAgBCAAKAJsNgJ0IAQgACgCcDYCeCAAQQA2AnAgAEIANwNoIAQgACgChAE2AowBIABBADYChAEgBCAAKAJ4NgKAASAEIAAoAnw2AoQBIAQgACgCgAE2AogBIABBADYCgAEgAEIANwN4IARBMGoiCkEAQTD8CwAgAEHYAGoiCyAKEKECIgIQ/QMgAkEgahBJIAJBEGoQSSACEEkgACgCvAEhDCAAQgA3ArwBIAAoArgBIQYgAEEANgK4ASAEQQA2AjggBEIANwIwIAogBRAlIAQgBTYCNCAJBEAgBygCACECIAQoAjAhBQNAIAUgAiABQQJ0aigCAEECdGogATYCACABQQFqIgEgCUcNAAsLIABBuAFqIQUgCyAJQQNsIgEQyQEgACgCvAEhAgJAIAxFBEAgAiEBDAELIAUgARBVIAAgATYCvAEgAkERSSACIAlBBmxNcg0AIAUQkwEgACgCvAEhAQsgBCALNgIIIAUoAgAhACAEIAw2AhwgBCAGNgIYIAQgATYCECAEIAA2AgwgBCAEQeAAajYCFCAEIAcpAgA3AiAgBCAEKQIwNwIoIAkgAyAEQQhqEN0DIAQoAjAiAARAIAAQIgsgBgRAIAYQIgsgBEGAAWoQSSAEQfAAahBJIARB4ABqEEkgBEGQAWokACAIKAIMIgAEQCAAECILIAhBIGokAAuxBQINfAV/IwBBoAFrIg8kACAPIAErAwAiAiABKwMgIgOgIAErA0AiBKAiCTkDmAEgDyAEIAKhIAOhIgo5A5ABIA8gAiADoSAEoSILOQOAASAPIAMgAqEgBKEiDDkDiAEgASsDOCECIAErAyghAyABKwMQIQQgASsDMCEFIAErAxghBiABKwMIIQcgD0KAgICAgICA+D83A3ggD0KAgICAgICA+D83A1AgD0KAgICAgICA+D83AyggD0KAgICAgICA+D83AwAgDyAHIAahIgg5A3AgDyAFIAShIg05A2ggDyADIAKhIg45A2AgDyAIOQNYIA8gAyACoCICOQNIIA8gBSAEoCIDOQNAIA8gDTkDOCAPIAI5AzAgDyAHIAagIgI5AyAgDyAOOQMYIA8gAzkDECAPIAI5AwggD0GAAWoiEkEIaiETQQEhEQNAIBMgEkEQQRggEUECRhtqIBFBAUYbKwMAIQIgEiEBAkACQAJAIBAOAgIAAQsgEyEBDAELIBJBEEEYIBBBAkYbaiEBCyARIBAgAiABKwMAZBshECARQQFqIhFBBEcNAAsgDyAQQQV0aiIBKwMAIQYgASsDCCEHIAErAxAhCCAAIAlEAAAAAAAA8D+gIgJEAAAAAAAAAAAgAkQAAAAAAAAAAGQbnyICIAIgAqIgC0QAAAAAAADwP6AiAkQAAAAAAAAAACACRAAAAAAAAAAAZBufIgMgA6IgDEQAAAAAAADwP6AiAkQAAAAAAAAAACACRAAAAAAAAAAAZBufIgQgBKKgIApEAAAAAAAA8D+gIgJEAAAAAAAAAAAgAkQAAAAAAAAAAGQbnyIFIAWioKCfIgKjIAErAximOQMYIAAgBSACoyAIpjkDECAAIAQgAqMgB6Y5AwggACADIAKjIAamOQMAIA9BoAFqJAALTQEHf0EEECMiAyACNgIAQQQQIyIEIAI2AgBBwPABIAFBACEBQYDwASICIAFB1idqQQEhBUHPASADIAIgAUHaJ2ogBUHPAWogBBAKIAAL5QcCA38HfCMAQbACayIHJAAgByABKQMQNwMQIAcgASkDCDcDCCAHIAEpAwA3AwAgByABKQMYNwMYIAcgASkDIDcDICAHIAEpAyg3AyggByACKQMYNwPIASAHIAIpAxA3A8ABIAcgAikDCDcDuAEgByACKQMANwOwASAHIAIpAyA3A9ABIAcgAikDKDcD2AEgByACKQMwNwPgASAHIAIpAzg3A+gBIAcgAykDGDcDiAEgByADKQMQNwOAASAHIAMpAwg3A3ggByADKQMANwNwIAcgAykDIDcDkAEgByADKQMoNwOYASAHIAMpAzA3A6ABIAcgAykDODcDqAEgB0HwAWogByAHQbABaiIIIAdB8ABqIgkgBCAGENACIAcgASkDQDcDUCAHIAEpAzg3A0ggByABKQMwNwNAIAcgASkDSDcDWCAHIAEpA1A3A2AgByABKQNYNwNoIAcgAikDWDcDiAEgByACKQNQNwOAASAHIAIpA0g3A3ggByACKQNANwNwIAcgAikDYDcDkAEgByACKQNoNwOYASAHIAIpA3A3A6ABIAcgAikDeDcDqAEgByADKQNYNwMYIAcgAykDUDcDECAHIAMpA0g3AwggByADKQNANwMAIAcgAykDYDcDICAHIAMpA2g3AyggByADKQNwNwMwIAcgAykDeDcDOCAIIAdBQGsgCSAHRAAAAAAAAPA/IAShIAYQ0AJEAAAAAAAA8D8gBaEiBCAEIAQgBysDgAIiDKIgBSAMIAcrA6ACoCAHKwOoAkQAAAAAAAAAAKAiDKIiDaKgoiAFIAQgDaIgBSAHKwPAASIOIAcrA+ABoCAHKwPoAUQAAAAAAAAAAKAiDaIiC6KgIgqioKIgBSAEIAqiIAUgBSAOoiAEIAuioKKgoqAhDiAEIAQgBCAHKwP4ASILoiAFIAsgBysDmAKgIAyiIguioKIgBSAEIAuiIAUgBysDuAEiCyAHKwPYAaAgDaIiCqKgIg+ioKIgBSAEIA+iIAUgBSALoiAEIAqioKKgoqAhCyAEIAQgBCAHKwPwASIKoiAFIAogBysDkAKgIAyiIgqioKIgBSAEIAqiIAUgBysDsAEiCiAHKwPQAaAgDaIiD6KgIhCioKIgBSAEIBCiIAUgBSAKoiAEIA+ioKKgoqAhCiAAIAQgBCAEIAcrA4gCoiAFIAyioKIgBSAEIAyiIAUgDaKgIgyioKIgBSAEIAyiIAUgBCANoiAFIAcrA8gBoqCioKKgIgREAAAAAAAAAABiBHwgCyAEoyELIAogBKMhCiAOIASjBSAOCzkDECAAIAs5AwggACAKOQMAIAdBsAJqJAALgAsCCH8IfCMAQfAAayIEJAACQAJAAkAgACgCBCIDKAIEIgJFDQAgACgCACEFIANBBGoiBiEDA0AgAyACIAIoAhAgAUgiBxshAyACQQRBACAHG2ooAgAiAg0ACyADIAZGDQAgASADKAIQTg0BCyAAKAIIKAIAIAAoAgwoAgAgAUECdGooAgBqQQE6AAAMAQsCQAJAIAMoAhgiBiADKAIUIgFrQQV1QQFrDgICAAELIAEoAiAhBiAAKAIIKAIAIgIgASgCACIAakEBOgAAIAIgBmpBAToAACAEIAUoArgBIgIgAEEFdGoiASsDACACIAZBBXQiCGoiAisDAKEiCiAKIAqiIAErAwggAisDCKEiCiAKoqAgASsDECACKwMQoSIMIAyioJ8iC6MiDTkDWCAEIAogC6MiDjkDYCAEIAwgC6MiCzkDaCAFKAJIIgcgBSgCWCAAQQJ0aiIJKAIAQRhsaiICKwMAIQogAisDCCEMIAcgCUF4QQQgAEEDb0ECRhtqKAIAQRhsaiIHKwMAIQ8gBysDCCEQIAQgBysDECACKwMQIhGhOQMwIAQgECAMoTkDKCAEIA8gCqE5AyAgBEE4aiICIARB2ABqIARBIGoiBxCcASABIAQpA1A3AxggASAEKQNINwMQIAEgBCkDQDcDCCABIAQpAzg3AwAgBCALmjkDMCAEIA6aOQMoIAQgDZo5AyAgBSgCSCAFKAJYQXhBBCAGQQNvQQJGG2ogBkECdGooAgBBGGxqIgErAwAhCyABKwMIIQ0gBCABKwMQIBGhOQMYIAQgDSAMoTkDECAEIAsgCqE5AwggAiAHIARBCGoQnAEgBSgCuAEgCGoiASAEKQNQNwMYIAEgBCkDSDcDECABIAQpA0A3AwggASAEKQM4NwMAIAMoAhQiAysDGCADKwMooEQAAAAAAADgP6IhCiAFKAJoIQcgACECA0ACQCAGQX5BASAHIAJBAnRqKAIAIgFBA29BAkYbIAFqIgJGBEAgAysDOCADKwMIoEQAAAAAAADgP6IhCgwBCyAAIAJGDQAgBSgCuAEhASAFKAK8AQRAIAEgAkEFdGorAxhEAAAAAAAAAABjDQELRAAAAAAAAAAAIQsgASACQQV0aiIBKwMQIQwgASsDCCENIAErAwAhDiABIApEAAAAAAAAAABiBHwgASsDGAUgCws5AxggASAKIAyiOQMQIAEgCiANojkDCCABIAogDqI5AwALIAAgAkcNAAsMAQsgASAGRgR8RAAAAAAAAPh/BSABIQIDQCALRAAAAAAAAPA/RAAAAAAAAAAAIAIrAwgiDEQAAAAAAAAAAGIboEQAAAAAAADwP0QAAAAAAAAAACACKwMYIg1EAAAAAAAAAABiG6AhCyAKIAygIA2gIQogAkEgaiICIAZHDQALIAogC6MLIQwgBSgCvAEhByAFKAJoIQYgACgCECEAIAEoAgAiASECA0BBfkEBIAYgAkECdGooAgAiAkEDb0ECRhsgAmohAgJAIAcEQCAFKAK4ASACQQV0aisDGEQAAAAAAAAAAGMNAQsCfAJAAkAgACgCACIIIAJBA21qLQAAQQFGBEAgBSgCuAEhAwwBCyAFKAK4ASEDIAggBiACQQJ0aigCAEEDbWotAABBAUcNAQsgAyACQQV0aiIDKwMQIQ0gAysDCCEOIAMrAwAhD0QAAAAAAAAAACELRAAAAAAAAAAADAELRAAAAAAAAAAAIQsgAyACQQV0aiIDKwMQIQ0gAysDCCEOIAMrAwAhDyAMRAAAAAAAAAAAYgRAIAMrAxghCwsgDAshCiADIAs5AxggAyANIAqiOQMQIAMgDiAKojkDCCADIA8gCqI5AwALIAEgAkcNAAsLIARB8ABqJAALpgEBA38gAAJ/AkAgASgCBCIERQRAIAFBBGoiBSECDAELIAIoAgAhBgNAIAQiAigCECIEIAZKBEAgAiEFIAIoAgAiBA0BDAILIAQgBk4EQCACIQRBAAwDCyACKAIEIgQNAAsgAkEEaiEFC0EgECMhBCADKAIAKAIAIQMgBEEANgIcIARCADcCFCAEIAM2AhAgASACIAUgBBCCAUEBCzoABCAAIAQ2AgALyxkDE38CfAF+IwBBwAFrIgMkACAAQQA2ArwBIAAoAlwhCiAAQbgBaiIPEJMBIANBADYCkAEgA0IANwKIASADQYgBaiAKEFUgAyAKNgKMASADQQA2AoABIANCADcCeCADQfgAaiAKQQAQgQEgA0HoAGogABDwAyMAQSBrIgUkACAAKAJcIQYgA0HYAGoiBEEANgIIIARCADcCACAEIAZBA24iEUEAEIEBIAZBA08EQCAEKAIAIQkgACgCaCESIAAoAtgBIQsDQCAFQX82AhwgBUJ/NwIUIAVBAjYCECAFQoCAgIAQNwIIIBIgB0EMbGohEyALIAdBBHRqIgwoAgAhFEEAIQhBACEGA0ACQCALIBMgBUEIaiAGaigCACINQQJ0aigCAEEDbSIVQQR0aiIQKAIAIBRHDQAgECgCDCAMKAIMRw0AIBAoAgggDCgCCEcNACAFQRRqQQRBCCANQQFGG0EAIA0baiAVNgIAIAhBAWohCAsgBkEEaiIGQQxHDQALIAhBAUoEQCAHIAlqQQE6AAAgBUECNgIQIAVCgICAgBA3AghBACEGA0AgBUEUakEEQQggBUEIaiAGaigCACIIQQFGG0EAIAgbaigCACIIQQBOBEAgCCAJakEBOgAACyAGQQRqIgZBDEcNAAsLIAdBAWoiByARRw0ACwsgBUEgaiQAQQAhBiMAQTBrIgUkACAAKAJMIQcgA0HIAGoiCUEANgIIIAlCADcCACAJIAdBfxAxIAAoAkwhByAFQQA2AhggBUIANwIQIAVCfzcDACAFQn83AwggBUJ/NwMgIAVCfzcDKCAFQRBqIAcgBRCVAiAAKAJcIgdBA08EQANAIAQoAgAgBmotAABBAUYEQCAFQQI2AiggBUKAgICAEDcCICAGQQxsIQxBACELA0ACQAJAIAUoAhAgACgCWCAMaiAFQSBqIAtqKAIAQQJ0aigCACINQQR0aiIHKAIAIAAoAtgBIAZBBHRqIggoAgBHDQAgBygCDCAIKAIMRw0AIAcoAgggCCgCCEYNAQsgByAIKQIINwIIIAcgCCkCADcCACAJKAIAIA1BAnRqIgdBfiAGIAcoAgBBf0cbNgIACyALQQRqIgtBDEcNAAsgACgCXCEHCyAGQQFqIgYgB0EDbkkNAAsLIAUoAhAiBARAIAQQIgsgBUEwaiQAAkAgACgCnAEiBEUNACAAKAKYASEFIARBGGwiBBAnIQ4gBEUNACAOIAUgBPwKAAALIAAoAkwiBwRAIAAoAqgBIQggAygCSCEJQQAhBANAIAkgBEECdGooAgAiBkEATgRAIA4gBEEYbGoiBSAIIAZBGGxqIgYpAxA3AxAgBSAGKQMINwMIIAUgBikDADcDAAsgBEEBaiIEIAdHDQALCwJAAkAgAgRAIAItABAEQCAAQQ4QLAwDCyACIAIoAgxBAWo2AgwgCkUNASACLQAQQQFxDQFBACEFIAMoAogBIQdBACEEA0AgBUEBaiIFQYAIRgRAQQAhBSACLQAQDQMLAkAgACAEENYCBEAgA0IANwOoASADQgA3A6ABIANCADcDmAEgA0KAgICAgICA+L9/NwOwAQwBCyADQZgBaiAAIA4gACgCWCAEQQJ0aigCAEEYbGogBBDnAQsgByAEQQV0aiIGIAMpA7ABNwMYIAYgAykDqAE3AxAgBiADKQOgATcDCCAGIAMpA5gBNwMAIARBAWoiBCAKRw0ACwwBCyAKRQ0AQQAhBCADKAKIASEGA0ACQCAAIAQQ1gIEQCADQgA3A6gBIANCADcDoAEgA0IANwOYASADQoCAgICAgID4v383A7ABDAELIANBmAFqIAAgDiAAKAJYIARBAnRqKAIAQRhsaiAEEOcBCyAGIARBBXRqIgUgAykDsAE3AxggBSADKQOoATcDECAFIAMpA6ABNwMIIAUgAykDmAE3AwAgBEEBaiIEIApHDQALCyAPIANBiAFqRwRAIA8oAgAiBARAIAQQIgsgACADKAKIATYCuAEgACADKAKMATYCvAEgACADKAKQATYCwAEgA0EANgKQASADQgA3AogBCyACBEAgAi0AEEEBRgRAIABBDhAsDAILIAIgAigCDEEBajYCDAsgACgCXCIEQQNPBEBBACEFA0AgAygCWCAFai0AAEEBRgRAIANBAjYCECADQoCAgIAQNwIIIAVBA2whB0EAIQQDQAJAAkAgACgCaCADQQhqIARqKAIAIAdqIghBAnRqKAIAQQNtIgYgAygCWGotAABBAUcNACAAKALYASIJIAVBBHRqIgooAgAgCSAGQQR0aiIGKAIARw0AIAooAgwgBigCDEcNACAKKAIIIAYoAghGDQELIANCADcDoAEgAyAINgKYASABIANBmAFqEEwLIARBBGoiBEEMRw0ACyAAKAJcIQQLIAVBAWoiBSAEQQNuSQ0ACwsgAgRAIAItABAEQCAAQQ4QLAwCCyACIAIoAgxBAWo2AgwLIANCADcCQCADIANBQGsiCjYCPAJAAkAgASgCACIHIAEoAgQiD0cEQANAAkAgBysDCCIWRAAAAAAAAPA/Zg0AIAcoAgQhDCADIAcoAgAiCCAIQQJ0IgEgACgCaGooAgAiDSAAKAJYIAFqIgEoAgAiECABQXhBBCAIQQNvQQJGG2ooAgAiEUgiEhsiCTYCMCAKIQECQAJAIAMoAkAiBUUNAANAIAEiBCAFIgYgBSgCECAJSCILGyEBIAVBBEEAIAsbaigCACIFDQALIAEgCkYNACAJIAQgBiALGygCEE4NAQsgAyADQTBqIgE2AgggA0GYAWoiBSADQTxqIgYgASADQQhqIgkQ5AEgAygCmAEiBEKAgICAgICA+D83AzAgBCANNgIoIAQgFjkDICAEIAw2AhwgBCAINgIYIBINASADIAE2AgggBSAGIAEgCRDkASADKAKYASEEIAMgATYCCCAFIAYgASAJEOQBIAMoApgBIQEgAyAEKQMgNwOgASADIAQpAxg3A5gBIAQgASkDMDcDICAEIAEpAyg3AxggASADKQOgATcDMCABIAMpA5gBNwMoDAELAn8gECARSARAIAMgA0EwaiIBNgIIIANBmAFqIANBPGogASADQQhqEOQBIAMoApgBQRhqDAELIAMgA0EwaiIBNgIIIANBmAFqIANBPGogASADQQhqEOQBIAMoApgBQShqCyIBIAErAwgiFyAWIBYgF2QbOQMICyAPIAdBEGoiB0cNAAwCCwALIANCADcCNCADIANBNGo2AjAMAQsgAygCPCEEIAMgA0E0ajYCMCADQgA3AjQgBCAKRg0AA0AgAyAEKQMwNwOwASADIAQpAyg3A6gBIAMgBCkDIDcDoAEgAyAEKQMYIhg3A5gBIAMgACgCWCAYp0ECdGooAgA2AiwgAyADQSxqIgE2ArwBIANBCGoiBSADQTBqIgYgASADQbwBaiIHEOgDIAMoAghBFGogA0GYAWoQlwMgAyAAKAJYIAMoAqgBQQJ0aigCADYCLCADIAE2ArwBIAUgBiABIAcQ6AMgAygCCCADIAMpA7ABNwMQIAMgAykDqAE3AwggAyADKQOgATcDICADIAMpA5gBNwMYQRRqIAUQlwMCQCAEKAIEIgEEQANAIAEiBCgCACIBDQAMAgsACwNAIAQgBCgCCCIEKAIARw0ACwsgBCAKRw0ACwsCQAJAIAIEQCACLQAQBEAgAEEOECwMAwsgAiACKAIMQQFqNgIMIAAoAkwhBSADIAA2AgggAyADQdgAajYCGCADIANB6ABqNgIUIAMgA0H4AGo2AhAgAyADQTBqNgIMAkAgBUUNACACLQAQQQFxDQBBACEBQQAhBANAIAFBAWoiAUGACEYEQEEAIQEgAi0AEA0CCyADQQhqIAQQ5wMgBEEBaiIEIAVHDQALCyACLQAQQQFHDQEgAEEOECwMAgsgACgCTCEBIAMgADYCmAEgAyADQdgAajYCqAEgAyADQegAajYCpAEgAyADQfgAajYCoAEgAyADQTBqNgKcASABBEBBACEEA0AgA0GYAWogBBDnAyAEQQFqIgQgAUcNAAsLIAAQ6wMgACADQfgAahDUAgwBCyACIAIoAgxBAWo2AgwgABDrAyACLQAQQQFGBEAgAEEOECwMAQsgAiACKAIMQQFqNgIMIAAgA0H4AGoQ1AIgAi0AEEEBRgRAIABBDhAsDAELIAIgAigCDEEBajYCDAsgA0EwaiADKAI0ENMCIANBPGogAygCQBDSAgsgDgRAIA4QIgsgAygCSCIABEAgABAiCyADKAJYIgAEQCAAECILIAMoAmgiAARAIAAQIgsgAygCeCIABEAgABAiCyADKAKIASIABEAgABAiCyADQcABaiQAC94CAgJ/BnwjAEEgayIDJAAgA0EIaiABKAIIIgQgAigCACICIAEoAgQQ1wIgACADKwMYIgYgAysDCCIFIAWiIAMrAxAiCCAIoqAgBiAGoqCfIgajRAAAAAAAAAAAIAUgBqMiCr1C////////////AINCgICAgICAgPj/AFQiARsgBCgCqAEgAkEDbUEYbGoiAisDECIFIAIrAwAiByAHoiACKwMIIgkgCaKgIAUgBaKgnyIFo0QAAAAAAAAAACAHIAWjIge9Qv///////////wCDQoCAgICAgID4/wBUIgIboiAIIAajRAAAAAAAAAAAIAEbIAkgBaNEAAAAAAAAAAAgAhuiIApEAAAAAAAAAAAgARsgB0QAAAAAAAAAACACG6JEAAAAAAAAAACgoKBEHqfoSC7/7z9kOgAAIAAgAykDCDcDCCAAIAMpAxA3AxAgACADKQMYNwMYIANBIGokAAvNBAIJfwZ8IAAoArwBIgcEQCAAKAJIIQUgACgCWCEIIAAoAmghCSAAKAK4ASEGQQAhAANAAkAgCCAAQQJ0IgFqIgIoAgAiBCACQXhBBCAAQQNwQQJGG2ooAgAiA04NACAGIABBBXRqIgIrAxgiCkQAAAAAAAAAAGEgBiABIAlqKAIAQQV0aiIBKwMYIgtEAAAAAAAAAABhckUNACAFIANBGGxqIgMrAxAgBSAEQRhsaiIEKwMQoSEMIAMrAwggBCsDCKEhDSADKwMAIAQrAwChIQ4gCkQAAAAAAAAAAGIiAyALRAAAAAAAAAAAYnJFBEAgAkKAgICAgICA+D83AxggAiAMRAAAAAAAAAhAozkDECACIA1EAAAAAAAACECjOQMIIAIgDkQAAAAAAAAIQKM5AwAgAUKAgICAgICA+D83AxggASAMRAAAAAAAAAjAozkDECABIA1EAAAAAAAACMCjOQMIIAEgDkQAAAAAAAAIwKM5AwAMAQsgA0UEQCABKwMAIQogASsDCCELIAErAxAhDyACQoCAgICAgID4PzcDGCACIAwgD6BEAAAAAAAA4D+iOQMQIAIgDSALoEQAAAAAAADgP6I5AwggAiAOIAqgRAAAAAAAAOA/ojkDAAwBCyACKwMAIQogAisDCCELIAIrAxAhDyABQoCAgICAgID4PzcDGCABIA8gDKFEAAAAAAAA4D+iOQMQIAEgCyANoUQAAAAAAADgP6I5AwggASAKIA6hRAAAAAAAAOA/ojkDAAsgAEEBaiIAIAdHDQALCwtNAQd/QQQQIyIDIAI2AgBBBBAjIgQgAjYCAEGw8AEgAUEAIQFBgPABIgIgAUH0JmpBASEFQcUBIAMgAiABQfgmaiAFQcUBaiAEEAogAAugAQEDfyAAAn8CQCABKAIEIgRFBEAgAUEEaiIFIQIMAQsgAigCACEGA0AgBCICKAIQIgQgBkoEQCACIQUgAigCACIEDQEMAgsgBCAGTgRAIAIhBEEADAMLIAIoAgQiBA0ACyACQQRqIQULQeAAECMiBCADKAIAKAIANgIQIARBGGpBAEHIAPwLACABIAIgBSAEEIIBQQELOgAEIAAgBDYCAAvUAQIEfAJ/IAEoAgQiBygCWEF4QQQgAigCACICIAJBA20iCEEDbGtBAkYbaiACQQJ0aigCACECIAAgCDYCACAHKAJIIAJBGGxqIgIrAwAgASgCCCIBKwMAoSIDIAMgA6IgAisDCCABKwMIoSIDIAOioCACKwMQIAErAxChIgQgBKKgnyIFoyIGvUL///////////8Ag0L/////////9/8AWARAIAAgBjkDCCAAIAQgBaM5AxggACADIAWjOQMQDwsgAEIANwMYIABCADcDECAAQgA3AwgLpgUCB38JfCMAQeAAayIDJAAgAyACNgJMIAEoAgQhBwJAAkAgASgCACIGKAIEIgRFDQAgBkEEaiIIIQUDQCAFIAQgBCgCECACSCIJGyEFIARBBEEAIAkbaigCACIEDQALIAUgCEYNACACIAUoAhBODQELIAMgA0HMAGoiBTYCWCADIAdBzAFqIAUgA0HYAGoiBhB5IAMoAgAhBCMAQaACayICJAAgAiAEKQNINwNwIAIgBCkDQDcDaCACIAQpAzg3A2AgAiAEKQNQNwN4IAIgBCkDWDcDgAEgAiAEKQNgNwOIASACIAQpAyA3A0ggAiAEKQMoNwNQIAIgBCkDMDcDWCACQZABaiACQcgAahCQASACIAIrA9ABOQOYAiACIAIrA7gBOQOQAiACIAIrA6ABOQOIAiACIAIrA8gBOQOAAiACIAIrA7ABOQP4ASACIAIrA5gBOQPwASACIAIrA8ABOQPoASACIAIrA6gBOQPgASACIAIrA5ABOQPYASACIAJB2AFqEJABIAIrAwAhCyACKwMIIQwgAisDECENIAIrAxghDiACKwMgIQ8gAisDKCEQIAIrAzAhESACKwM4IRIgA0QAAAAAAADwv0QAAAAAAADwPyAELQCAARsiCiACKwNAojkDQCADIAogEqI5AzggAyAKIBGiOQMwIAMgCiAQojkDKCADIAogD6I5AyAgAyAKIA6iOQMYIAMgCiANojkDECADIAogDKI5AwggAyAKIAuiOQMAIAJBoAJqJAAgASgCACECIAMgBTYCVCAGIAIgBSADQdQAahDtAyADKAJYQRhqIANByAD8CgAAIAEoAgAhBgsgAyADQcwAaiIBNgJYIAMgBiABIANB2ABqEO0DIAAgAygCAEEYakHIAPwKAAAgA0HgAGokAAuzAQEGfyMAQRBrIgIkACABKAJMIQMgAEEANgIIIABCADcCACAAIAMQJSAAIAM2AgQgASgCTCEDIAJBADYCCCACQgA3AgAgAiADQQAQgQEgASgCXCIDBEADQCABKAJYIARBAnRqKAIAIgUgAigCAGoiBi0AACAGQQE6AABBAUcEQCAAKAIAIAVBAnRqIAQ2AgALIARBAWoiBCADRw0ACwsgAigCACIABEAgABAiCyACQRBqJAALkwQCBn8CfSACKAIAIQYgAAJ/AkAgASgCBCIERQ0AIAEoAgACfyAEQQFrIAZxIARpIgVBAU0NABogBiAEIAZLDQAaIAYgBHALIgdBAnRqKAIAIgJFDQAgAigCACICRQ0AIARBAWshCCAFQQFLIQkDQAJAIAYgAigCBCIFRwRAAkAgCUUEQCAFIAhxIQUMAQsgBCAFSw0AIAUgBHAhBQsgBSAHRw0DDAELIAIoAgggBkcNAEEADAMLIAIoAgAiAg0ACwtBEBAjIgIgBjYCBCACQQA2AgAgAygCACgCACEDIAJBADYCDCACIAM2AggCQEEAIAQgASgCDEEBarMiCiABKgIQIgsgBLOUXhsNACABIAQgBEEBa3FBAEcgBEEDSXIgBEEBdHIiAyAKIAuVjfwBIgcgAyAHSxsQcCABKAIEIgQgBEEBayIDcUUEQCADIAZxIQcMAQsgBCAGSwRAIAYhBwwBCyAGIARwIQcLAkAgASgCACIGIAdBAnRqIgcoAgAiA0UEQCACIAEoAgg2AgAgASACNgIIIAcgAUEIajYCACACKAIAIgNFDQEgAygCBCEFAkAgBCAEQQFrIgNxRQRAIAMgBXEhBQwBCyAEIAVLDQAgBSAEcCEFCyAGIAVBAnRqIAI2AgAMAQsgAiADKAIANgIAIAMgAjYCAAsgASABKAIMQQFqNgIMQQELOgAEIAAgAjYCAAuCAQECfwJAIAEoAgAiA0EASA0AIAIgA0ECdGooAgAiAyACIAEoAgRBAnRqKAIAIgRGDQAgBCACIAEoAghBAnRqKAIAIgFGIAEgA0ZyDQAgACgCCCICIAIoAgAiAkEBajYCACAAKAIAIAJBDGxqIgAgATYCCCAAIAQ2AgQgACADNgIACwtTACAAIAEoAgBBAEpBAkEAIAEoAgRBAEobckEEQQAgASgCCEEAShtyQQhBACABKAIMQQBKG3JBDGwiAUHgiAFqIAIQ8gMgACABQaCKAWogAhDyAwvUAQEEfyAAKAIEIgMgAUEBdEsgA0EQS3ECQCABIANNDQAgACABEDUgASAAKAIEIgNrQQxsIgRBAEwNACAEQQxuIQQgACgCACADQQxsaiEDA0AgAyACKAIINgIIIAMgAikCADcCACADQQxqIQMgBEEBSyAEQQFrIQQNAAsLIAAgATYCBARAQQAhASAAKAIAIQICQCAAKAIEIgNFDQAgA0EMbCIEECchASAERQ0AIAEgAiAE/AoAAAsgACACBH8gAhAiIAAoAgQFIAMLNgIIIAAgATYCAAsLqwkDGH8DfgF8IwBBwAFrIgIkACAAKAIUIAFBA3RqKQMAIhpCf1IEQCAaQgGIIhsgACgCMCIErYgiHCAAKAIsIgmtiKdBfyAAKAIodEF/c3EiEUEBaiEDIAAoAhwgAUEobGohBiARIQEgHKdBfyAJdEF/c3EiDCELIBunQX8gBHRBf3NxIg0hEkEBIRMgGqdBAXEiFgRAIA1BAWohEiAMQQFqIQtBACETIAMhAQsgBisDACEdIAYoAgwhDiACQX42ArwBIAJBAUF/IB1EAAAAAAAAAABkGyIFNgK0ASACIAVBACAFayAOQX9GGzYCsAEgAiADNgKsASACQfgAaiAAQRBqIhQgDUEBdK0gGkIBg4QgDK0gBEEBaiIErYaEIAOtIAQgCWqthoQQ2AJBKPwKAAAgAkEBQX8gBisDAEQAAAAAAAAAAGQbIgNBACADayAGKAIQQX9GGzYCuAEgAkECNgJ0IAJCgICAgBA3AmwgAUEBayEOIAtBAWshCSAGQQxqIQ8gAkGUAWohFyACQcwAaiEVA0AgAiASNgKkASACIBM2AqABIAshAyAOIgQhBQJAAkACQEEEQQggAkHsAGogEGooAgAiB0EBRhtBACAHGyIKQcCIAWooAgAiCA4CAgABCyACIAk2AqgBIAEhBCAJIgMhBQwBCyACQaQBaiACQaABaiAIQQJGGyIDIAMoAgBBAWsiBTYCACALIQMgASEECwJAIAVBAEgEQCACQoCAgICAgID8/wA3A0AgAkJ/NwNgIAJCfzcDWCACQn83A1AgAkJ/NwNIDAELIAJBQGsgFCACNAKgASACNAKkAUIBhoQgA6wgACgCMEEBaiIDrYaEIASsIAMgACgCLGqthoQQ2AJBKPwKAAALIAJBAUF/IAYrAwBEAAAAAAAAAABkGyIDQQAgA2sgDyAIQQJ0IgNqKAIQIgRBf0YbIgU2ArwBIAIgBigCDDYCICACIA8gB0ECdCIHaigCBDYCJCACIBUgCkHMiAFqKAIAIghBAnQiCmoiGEEQaigCADYCKCACIAMgFWooAgQiGTYCLCAHIBdqIgcoAgAhAyACIAQ2AjQgAiADNgIwIAJB+ABqIAJBQGtBKPwKAAAgACACQbABaiACQSBqEPMDIAIgDDYCqAEgAiARNgKsASACIA02AqQBIAIgFjYCoAEgAkGsAWohAwJAAkACQAJAIAgOAwMAAQILIAJBqAFqIQMMAgsgAkGkAWohAwwBCyACQaABaiEDCyADIAMoAgBBAWo2AgAgAkFAayAUIAI0AqABIAI0AqQBQgGGhCACNAKoASAAKAIwQQFqIgOthoQgAjQCrAEgAyAAKAIsaq2GhBDYAiIDQSj8CgAAIAIgBTYCuAEgAkEBQX8gBisDAEQAAAAAAAAAAGQbIgVBACAFayAKIA9qKAIEIgVBf0YbIgg2ArwBIAYoAgwhCiACIAQ2AgQgAiAKNgIAIAIgBygCADYCCCAYKAIQIQQgAiAFNgIUIAIgGTYCECACIAQ2AgwgAkH4AGogA0Eo/AoAACAAIAJBsAFqIAIQ8wMgAiAINgK4ASAQQQRqIhBBDEcNAAsLIAJBwAFqJAALsgwDFXwPfwJ+IwBBMGsiGCQAAkACQCAAKAIUIAFBA3RqKQMAIiZCf1ENACAAKAIcIAFBKGxqIh4oAghBAE4NACAAKwNYRAAAAAAAAAAARAAAAAAAAOC/ICanQQFxIiAbIg0gJkIBiCImp0F/IAAoAnQiAXRBf3NxIiG4oCAAKwOIAaKgIRQgACsDUCAAKwOAASANICYgAa2IIianQX8gACgCcCIBdEF/c3EiIrigoqAhFSAAKwNIIAArA3ggDSAmIAGtiKdBfyAAKAJsdEF/c3EiI7igoqAhDSAeQQxqISQgAEEwaiElA0AgHUEEdEHghgFqIgEoAgggIWohGSABKAIEICJqIRsgASgCACAjaiEcIAEoAgwgIGoiGkECRgRAIBlBAWohGSAbQQFqIRsgHEEBaiEcQQAhGgsCQCAAKAIUIBqsIBmsQgGGhCAbrCAAKAJ0QQFqIgGthoQgHKwgASAAKAJwaq2GhCInQh6IICeFQrnLk+fR7ZGsv39+IiZCG4ggJoVC66PEmbG3kuiUf34iJkIfiCAmhacgACgCGEEBa3EiAUEDdGopAwAiJkJ/USAmICdRcg0AA0AgACgCFCAAKAIYQQFrIAAoAhAgAWpxIgFBA3RqKQMAIiYgJ1ENASAmQn9SDQALCyAAKAIcIAFBKGxqIhcrAwAiC71C////////////AINCgICAgICAgPj/AFoEQCAAKAIoIBogGUEBdEECaq0gG0EBaq0gACgCdEEBaiIBrYaEIBxBAWqtIAEgACgCcGqthoSnckEDdGorAwAhCwsgHisDAEQAAAAAAAAAAGQgC0QAAAAAAAAAAGRHBEAgFygCCCIfQQBIBEAgACgCCCIBIAEoAgAiH0EBajYCACAAKwOIASEMIAArA1ghBCAAKwOAASEFIAArA1AhCSAAKwN4IQMgACsDSCECIB4rAwAhCiAAKwOQASEOIAArA5gBIQ8gGCAlEFchASAVIQcgFCEIAnwgDSAKRAAAAAAAAAAAYQ0AGiAERAAAAAAAAAAARAAAAAAAAOC/IBpBAUYbIgYgGbegIAyioCEIIAkgBiAbt6AgBaKgIQcgAiAGIBy3oCADoqAiBiALRAAAAAAAAAAAYQ0AGkQAAAAAAADwPyERRAAAAAAAAPA/IRIgDyAPoCANIgkgBqEiAiACoiAVIgMgB6EiAiACoqAgFCICIAihIgUgBaKgn6MiBUQAAAAAAADwP2MEQANAIBggCiAKIAuho0TNzMzMzMzsP6JEmpmZmZmZqT+gIgxEAAAAAAAA4D8gEiARo0QAAAAAAADgv6AiBCAEmiAMRAAAAAAAAOA/YxuhIAxEAAAAAAAA4L+gmSAEYxsiECAIoiACRAAAAAAAAPA/IBChIhOioCIWOQMoIBggByAQoiADIBOioCIPOQMgIBggBiAQoiAJIBOioCIMOQMYIBgoAhAiF0UNByAKIBcgGEEYaiAXKAIAKAIYEREAIA6hIgQgCkQAAAAAAAAAAGQgBEQAAAAAAAAAAGRzIhcbIQogBCALIBcbIQsgCSAMIBcbIQkgDCAGIBcbIQYgAyAPIBcbIQMgDyAHIBcbIQcgAiAWIBcbIQIgFiAIIBcbIQggEkQAAAAAAADgP6IhEiARIBAgEyAXG6IiESAFZA0ACwsgCCAKIAogC6GjIgWiIAJEAAAAAAAA8D8gBaEiAqKgIQggByAFoiADIAKioCEHIAYgBaIgCSACoqALIQYCQCABIBgoAhAiF0YEf0EQBSAXRQ0BQRQLIRkgFyAXKAIAIBlqKAIAEQAACyAAKwN4IQUgACgCYCEXIAArA0ghBCAAKwOAASEJIAAoAmQhASAAKwNQIQ4gACgCACAfQRhsaiIaIAArA1giAiAIIAIgCGQbIgMgAiAAKwOIASAAKAJot0QAAAAAAADwv6CioCICIAIgA2QbOQMQIBogDiAHIAcgDmMbIgMgDiAJIAG3RAAAAAAAAPC/oKKgIgIgAiADZBs5AwggGiAEIAYgBCAGZBsiAyAEIAUgF7dEAAAAAAAA8L+goqAiAiACIANkGzkDAAsgJCAdQQJ0aiAfNgIACyAdQQFqIh1BB0cNAAsLIBhBMGokAA8LEGYAC5ERAxR/FXwCfiMAQeAAayIFJAACQCAAKAIYIAAoAiQoAgBBAXRJDQAgAUIBiCIrp0F/IAAoAnQiAnRBf3NxIgogACgCaEoNACArIAKtiCIrp0F/IAAoAnAiA3RBf3NxIgsgACgCZEoNACArIAOtiKdBfyAAKAJsdEF/c3EiDCAAKAJgSg0AIAGnQQFxIQ0gBUJ/NwNAIAVCfzcDOCAFQn83AzAgBUJ/NwMoIAUgACgCKCISIApBAXRBAmqtIAFCAYOEIAtBAWqtIAJBAWoiAq0iK4aEIAxBAWqtIAIgA2qtIiyGhKdBA3RqKwMAIho5AyAgGplEAAAAAAAACECiIRggBUEsaiEJQX8hBkEAIQIDQCACQQR0QeCGAWoiCCgCCCAKaiEDIAgoAgQgC2ohBCAIKAIAIAxqIQcgCCgCDCANaiIUQQJGBEAgBEEBaiEEIAdBAWohB0EAIRQgA0EBaiEDCyACQQdqIhVBBHRB4IYBaiIIKAIIIApqIQ8gCCgCBCALaiEQIAgoAgAgDGohESASIANBAXRBAmqtIBStIAdBAWqtICyGhCAEQQFqrSArhoSEp0EDdGorAwAhFyAIKAIMIA1qIgNBAkYEQCAPQQFqIQ8gEEEBaiEQIBFBAWohEUEAIQMLIBIgD0EBdEECaq0gA60gEUEBaq0gLIaEIBBBAWqtICuGhISnQQN0aisDACEWAkAgGkQAAAAAAAAAAGQiAyAXRAAAAAAAAAAAZEcEQCAJIAJBAnRqQX42AgAgAiAGIBeZIhsgGGQgGyAZmWRxIgQbIQYgFyAZIAQbIRkgDiAWRAAAAAAAAAAAZCADc2ohDkEBIRMMAQsgAyAWRAAAAAAAAAAAZEYNACAVIAYgFpkiFyAYZCAXIBmZZHEiAxshBiAWIBkgAxshGQsgAkEBaiICQQdHDQALAkACQCAOQQRIIAZBAE5xRQRAIAlBfzYCGCAJQn83AhAgCUJ/NwIIIAlCfzcCAAwBCyAGQQR0QeCGAWoiAigCCCAKaiEDIAIoAgQgC2ohBCACKAIAIAxqIQdEAAAAAAAA4L8hFkQAAAAAAAAAAEQAAAAAAADgvyANGyIXIAq4oCAAKwOIASIkoiEgIAArA1ghGCAXIAu4oCAAKwOAASIhoiEiIAArA1AhHCAXIAy4oCAAKwN4IiWiIRsgACsDSCEXAkAgAigCDCANaiICQQJGBEAgA0EBaiEDIARBAWohBCAHQQFqIQcMAQtEAAAAAAAAAABEAAAAAAAA4L8gAkEBRhshFgsgACsDkAEhKSAAKwOYASEjIAVBCGogAEEwahBXIQYgHCAioCIiIR0gGCAgoCIgIR4CQAJ8IBcgG6AiGyAaRAAAAAAAAAAAYQ0AGiAYICQgFiADt6CioCEeIBwgISAWIAS3oKKgIR0gFyAlIBYgB7egoqAiHyAZRAAAAAAAAAAAYQ0AGgJAICMgI6AgICAeoSIWIBaiIBsgH6EiFiAWoiAiIB2hIhYgFqKgoJ+jIipEAAAAAAAA8D9jRQRAICAhFiAiIRcgGyEYDAELRAAAAAAAAPA/ISNEAAAAAAAA8D8hJCAbIRggIiEXICAhFgNAIAUgGiAaIBmho0TNzMzMzMzsP6JEmpmZmZmZqT+gIhxEAAAAAAAA4D8gJCAjo0QAAAAAAADgv6AiISAhmiAcRAAAAAAAAOA/YxuhIBxEAAAAAAAA4L+gmSAhYxsiHCAeoiAWRAAAAAAAAPA/IByhIiGioCIlOQNYIAUgHSAcoiAXICGioCImOQNQIAUgHyAcoiAYICGioCInOQNIIAYoAhAiAkUNAyAaIAIgBUHIAGogAigCACgCGBERACApoSIoIBpEAAAAAAAAAABkIChEAAAAAAAAAABkcyICGyEaICggGSACGyEZIBggJyACGyEYICcgHyACGyEfIBcgJiACGyEXICYgHSACGyEdIBYgJSACGyEWICUgHiACGyEeICREAAAAAAAA4D+iISQgIyAcICEgAhuiIiMgKmQNAAsLIB4gGiAaIBmhoyIZoiAWRAAAAAAAAPA/IBmhIhaioCEeIB0gGaIgFyAWoqAhHSAfIBmiIBggFqKgCyEfAkAgBiAGKAIQIgJGBH9BEAUgAkUNAUEUCyEDIAIgAigCACADaigCABEAAAsgHyAboZkgACsDeEQAAAAAAADQP6JjRQ0BIB0gIqGZIAArA4ABRAAAAAAAANA/omNFDQEgHiAgoZkgACsDiAFEAAAAAAAA0D+iY0UNASAAKAIIIgIgAigCACIDQQFqNgIAIAArA3ghGyAAKAJgIQQgACsDSCEWIAArA4ABISIgACgCZCEHIAArA1AhFyAAKAIAIANBGGxqIgIgACsDWCIYIB4gGCAeZBsiICAYIAArA4gBIAAoAmi3RAAAAAAAAPC/oKKgIhggGCAgZBs5AxAgAiAXIB0gFyAdZBsiGCAXICIgB7dEAAAAAAAA8L+goqAiFyAXIBhkGzkDCCACIBYgHyAWIB9kGyIXIBYgGyAEt0QAAAAAAADwv6CioCIWIBYgF2QbOQMAIAUgAzYCKEEAIQIDQCAJIAJBAnRqIgQgAyAEKAIAIgQgBEF+Rhs2AgAgAkEBaiICQQdHDQALDAILEGYACyATRQ0BCyAAKAIYIgIgACgCJCgCAEEBdEkNACABQh6IIAGFQrnLk+fR7ZGsv39+IitCG4ggK4VC66PEmbG3kuiUf34iK0IfiCArhacgAkEBa3EhAgNAIAAoAhQgAkEDdGoiAyABIAMpAwAiKyArQn9RIgMbNwMAIAMEQCAAKAIkIgMgAygCAEEBajYCACAAKAIcIAJBKGxqIAVBIGpBKPwKAAAMAgsgASArUQ0BIAAoAhgiA0EBayAAKAIQIAJqcSECIAAoAiQoAgBBAXQgA00NAAsLIAVB4ABqJAAL4gEBA38CQCABRQRAIABBADYCCCAAQgA3AgAgAEEAEOwCIABBADYCGCAAQQA2AhAMAQsgAEEANgIIIABCADcCACAAQQFBICABQQFrZ2siAXQiAxDsAiAAQQA2AhggAEEANgIQQSggAXQiAhAnIQEgACADNgIYIAAgATYCECACQQBMDQAgAkEobiECA0AgAUJ/NwMIIAFCgICAgICAgPz/ADcDACABQn83AxAgAUJ/NwMYIAFCfzcDICABQShqIQEgAkEBSyACQQFrIQINAAsLIABCgICAgBA3AiAgACADNgIUIAAL5AMDB3wJfwJ+IwBBMGsiDCQAIAAoAmghDSAAKAJsIQ4gACgCZCEJIAAoAlwhCiAAKAJYIQsgACgCYCEPIAArAyAhAyAAKwNQIQQgACsDSCEFIAArA0AhBiAAKwM4IQIgACsDMCEHIAArAyghCCAMIABBCGoQVyEQAkAgCyABQgGIIhIgDq2IIhMgDa2Ip0F/IAl0QX9zcUEBayIJayILIAogE6dBfyANdEF/c3FBAWsiDWsiCiAKIAtKGyIKIA8gEqdBfyAOdEF/c3FBAWsiDmsiCyAKIAtIGyABpyIKQQFxIgtrIg8gCSANIAkgDUgbIhEgDiAOIBFKGyIRIA8gEUgbIg9BAEgEfEQAAAAAAAAAAAUgDCACRAAAAAAAAAAARAAAAAAAAOC/IAsbIgIgDregIASioDkDKCAMIAcgBSACIA23oKKgOQMgIAwgCCAGIAIgCbegoqA5AxggECgCECIJRQ0BIAkgDEEYaiAJKAIAKAIYEREAIAOhIgJEAAAAAAAAAAAgAiACRAAAAAAAAAAAZBsgDxsLIQIgACgCACgCACAKQQN0aiACOQMAAkAgECAQKAIQIgBGBH9BEAUgAEUNAUEUCyEQIAAgACgCACAQaigCABEAAAsgDEEwaiQADwsQZgALTQEHf0EEECMiAyACNgIAQQQQIyIEIAI2AgBBqPABIAFBACEBQfDvASICIAFB1iZqQQEhBUHDASADIAIgAUHaJmogBUHDAWogBBAKIAALzycDGH8Ffgd8IwBBsAhrIgckAAJAAkAgBkUNACAGLQAQQQFHDQAgAEEOECwMAQsgAisDACElIAIrAxghJiACKwMQIScgAisDKCEkIAIrAwghKCACKwMgISkgB0IANwLABCAHQQA2AsgEIAdBwARqIgIgKSAooSIpIAOjRAAAAAAAAPA/oPwCIhBBAmoiCKxBICAkICehIiQgA6NEAAAAAAAA8D+g/AIiEUECaiIJZ2tBACARQQNqQQJPGyITQQFqIgutIiGGIAmsQgGGhCAmICWhIiogA6NEAAAAAAAA8D+g/AIiEkECaiIJrCALQSAgCGdrQQAgEEEDakECTxsiFGqtIiKGhCIjQgGEIiCnIgsQRCAHIAs2AsQEIAcgAjYC0AMgB0HYA2ogARBXIQwgByATNgK8BCAHIBQ2ArgEIAdBICAJZ2tBACASQQNqQQJPGyIVNgK0BCAHIBE2ArAEIAcgEDYCrAQgByASNgKoBCAHICQgEUEBa7ejIgM5A6AEIAcgKSAQQQFrt6MiJjkDmAQgByAqIBJBAWu3oyIkOQOQBCAHICc5A4gEIAcgKDkDgAQgByAlOQP4AyAHIAQ5A/ADIAcgBygC0AM2AtAEIAdB2ARqIQggB0HwA2ohCQJAIAcoAugDIgJFBEAgB0EANgLoBAwBCyACIAxGBEAgByAINgLoBCACIAggAigCACgCDBEBAAwBCyAHIAIgAigCACgCCBEEADYC6AQLIAdB8ARqIg8gCUHQAPwKAAACQCAGBEAgBi0AEA0BQQAhAkEAIQkDQCACQQFqIgJBgAhGBEBBACECIAYtABANAwsgB0HQBGogHxD5AyAfQgF8IR8gCUEBaiIJIAtHDQALDAELIAcgBygC0AQ2AvAFIAdB+AVqIQkCQCAHKALoBCICRQRAIAdBADYCiAYMAQsgAiAIRgRAIAcgCTYCiAYgAiAJIAIoAgAoAgwRAQAMAQsgByACIAIoAgAoAggRBAA2AogGCyAHQZAGaiINIA9B0AD8CgAAQQAhAgNAIAdB8AVqIB8Q+QMgH0IBfCEfIAJBAWoiAiALRw0ACyAHIAcoAvAFNgKQBwJAIAcoAogGIgJFBEAgB0EANgKoByAHQbAHaiANQdAA/AoAAAwBCyAHQZgHaiELAkAgAiAJRgRAIAcgCzYCqAcgAiALIAIoAgAoAgwRAQAgBygCqAchAgwBCyAHQQA2AogGIAcgAjYCqAcLIAdBsAdqIA1B0AD8CgAAIAIgAiALRgR/QRAFIAJFDQFBFAsgAigCAGooAgARAAALIAkgBygCiAYiAkYEf0EQBSACRQ0BQRQLIQkgAiACKAIAIAlqKAIAEQAACwJAIAggBygC6AQiAkYEf0EQBSACRQ0BQRQLIQggAiACKAIAIAhqKAIAEQAACwJAIAwgBygC6AMiAkYEf0EQBSACRQ0BQRQLIQggAiACKAIAIAhqKAIAEQAACwJAIAYEQCAGLQAQQQFGBEAgAEEOECwMAgsgBiAGKAIMQQFqNgIMCyAHQagDakL/////D0IBICC6IimfRAAAAAAAACRAovwHIh9C/////w8gIEIBhiAjQv////8HVhsiICAfICBUGyIfIB9CAVgbIh8gH0L/////D1obpyIZEPgDIQggACgCTCECIABByABqIg8gCCgCBCIJQQdsIgsQMyAAIAs2AkwgAkERSSACIAlBDmxNckUEQCAPEHELRAAAAAAAAPB/IAUgBUQAAAAAAAAAAGUbIQUgEUEBdK0gEK0gIYaEIBKtICKGhEL+////D4MhICAIQSBqIRYgB0HYB2ohFyAHQcAHaiEMIAdBuAZqIQ0gB0GgBmohCSAHQZgFaiEYIAdBgAVqIQsgB0GgAWohGyAHQYgBaiEcIAdBwAJqIR0gB0GoAmohHgNAIAdBADYCoAMgB0IANwKYAyAHQZgDakEBQQAQMSAHIAAoAkg2AvgBIAcgACgCTDYC/AEgByAHKQKYAzcDgAIgByAIKAIkNgKIAiAHIAgoAgA2AowCIAcgCCgCBDYCkAIgByAIKAIQNgKUAiAHIAgoAhQ2ApgCIAcgFjYCnAIgByAHKQLABDcDoAIgHiABEFchCiAHIAU5A5ADIAcgBDkDiAMgByADOQOAAyAHICY5A/gCIAcgJDkD8AIgByATNgLsAiAHIBQ2AugCIAcgFTYC5AIgByARNgLgAiAHIBA2AtwCIAcgEjYC2AIgByAnOQPQAiAHICg5A8gCIAcgJTkDwAIgByAHKQP4ATcD0AQgByAHKAKAAjYC2AQgByAHKAKEAjYC3AQgByAHKAKIAjYC4AQgByAHKAKMAjYC5AQgByAHKAKQAjYC6AQgByAHKAKUAjYC7AQgByAHKAKYAjYC8AQgByAHKAKcAjYC9AQgByAHKAKgAjYC+AQgByAHKAKkAjYC/AQCQCAHKAK4AiICRQRAIAdBADYCkAUMAQsgAiAKRgRAIAcgCzYCkAUgAiALIAIoAgAoAgwRAQAMAQsgByACIAIoAgAoAggRBAA2ApAFCyAYIB1B2AD8CgAAAkAgBgRAIAYtABANAUEAIQJCACEfA0AgAkEBaiICQYAIRgRAQQAhAiAGLQAQDQMLIAdB0ARqIB8Q9wMgHyAgUiAfQgF8IR8NAAsMAQsgByAHKALQBDYC8AUgByAHKQLUBDcC9AUgByAHKQLcBDcC/AUgByAHKQLkBDcChAYgByAHKQLsBDcCjAYgByAHKQL0BDcClAYgByAHKAL8BDYCnAYCQCAHKAKQBSICRQRAIAdBADYCsAYMAQsgAiALRgRAIAcgCTYCsAYgAiAJIAIoAgAoAgwRAQAMAQsgByACIAIoAgAoAggRBAA2ArAGCyANIBhB2AD8CgAAQgAhHwNAIAdB8AVqIB8Q9wMgHyAgUiAfQgF8IR8NAAsgByAHKALwBTYCkAcgByAHKQL0BTcClAcgByAHKQL8BTcCnAcgByAHKQKEBjcCpAcgByAHKQKMBjcCrAcgByAHKQKUBjcCtAcgByAHKAKcBjYCvAcgCQJ/IAcoArAGIgJFBEAgB0EANgLQByAXIA1B2AD8CgAAQQAMAQsCQCACIAlGBEAgByAMNgLQByACIAwgAigCACgCDBEBACAHKALQByECDAELIAcgAiACKAIAKAIIEQQAIgI2AtAHCyAXIA1B2AD8CgAAAkAgAiACIAxGBH9BEAUgAkUNAUEUCyACKAIAaigCABEAAAsgBygCsAYLIgJGBH9BEAUgAkUNAUEUCyEOIAIgAigCACAOaigCABEAAAsCQCALIAcoApAFIgJGBH9BEAUgAkUNAUEUCyEOIAIgAigCACAOaigCABEAAAsCQCAKIAcoArgCIgJGBH9BEAUgAkUNAUEUCyEKIAIgAigCACAKaigCABEAAAsCfwJAIAgoAgQiCiAIKAIgQQF0SQRAIAYEQCAGLQAQQQFGDQILIAggB0GQB2ogGUEBdCApIA8oAgAgBygCmAMoAgBBGGxqIgJBGGsrAwAgJaEgJKP8AqwgIoYgAkEQaysDACAooSAmo/wCrCAhhoQgAkEIaysDACAnoSADo/wCrEIBhoRCAYS6oyIqIBm4ovwDICpEAAAAAABAj0BkGyIZEPgDIgoQkgIgCCgCECICBEAgAhAiCyAIQQA2AhAgCCAHKAKkByICNgIYIAggAjYCFAJAIAJFDQAgCCACQShsIgIQJyIONgIQIAJFDQAgDiAHKAKgByAC/AoAAAsgCCAHKAKwBzYCICAIIAcoArQHNgIkIAcoAqAHIgIEQCACECILIAdBADYCqAcgB0IANwKgByAKKAIAIgIEQCACECILIAgoAgQhAiAHQQA2ApgHIAdCADcCkAcgB0GQB2oiCiACQQdsIgIQMyAHIAI2ApQHAkAgCiAPRwRAIA8oAgAiCgRAIAoQIiAHKAKUByECCyAHKAKQByEKIAAgAjYCTCAAIAo2AkggACAHKAKYBzYCUAwBCyAHKAKQByICRQ0AIAIQIgtBAAwCCyAGBEAgBi0AEEEBRg0BIAYgBigCDEEBajYCDAsgByAAKAJINgJYIAcgACgCTDYCXCAHIAcpApgDNwNgIAcgCCgCJDYCaCAHIAgoAgA2AmwgByAKNgJwIAcgCCgCEDYCdCAHIAgoAhQ2AnggByAWNgJ8IAcgBykCwAQ3A4ABIBwgARBXIRogByAFOQPwASAHIAQ5A+gBIAcgAzkD4AEgByAmOQPYASAHICQ5A9ABIAcgEzYCzAEgByAUNgLIASAHIBU2AsQBIAcgETYCwAEgByAQNgK8ASAHIBI2ArgBIAcgJzkDsAEgByAoOQOoASAHICU5A6ABIAcgBykDWDcD0AQgByAHKAJgNgLYBCAHIAcoAmQ2AtwEIAcgBygCaDYC4AQgByAHKAJsNgLkBCAHIAcoAnA2AugEIAcgBygCdDYC7AQgByAHKAJ4NgLwBCAHIAcoAnw2AvQEIAcgBygCgAE2AvgEIAcgBygChAE2AvwEAkAgBygCmAEiAkUEQCAHQQA2ApAFDAELIAIgGkYEQCAHIAs2ApAFIAIgCyACKAIAKAIMEQEADAELIAcgAiACKAIAKAIIEQQANgKQBQsgGCAbQdgA/AoAAAJAIAYEQCAKRQ0BQQAhDkEAIQIgBi0AEEEBcQ0BA0AgDkEBaiIOQYAIRgRAQQAhDiAGLQAQDQMLIAdB0ARqIAIQ9gMgAkEBaiICIApHDQALDAELIAcgBygC0AQ2AvAFIAcgBykC1AQ3AvQFIAcgBykC3AQ3AvwFIAcgBykC5AQ3AoQGIAcgBykC7AQ3AowGIAcgBykC9AQ3ApQGIAcgBygC/AQ2ApwGAkAgBygCkAUiAkUEQCAHQQA2ArAGDAELIAIgC0YEQCAHIAk2ArAGIAIgCSACKAIAKAIMEQEADAELIAcgAiACKAIAKAIIEQQANgKwBgsgDSAYQdgA/AoAAEEAIQIgCgRAA0AgB0HwBWogAhD2AyACQQFqIgIgCkcNAAsLIAcgBygC8AU2ApAHIAcgBykC9AU3ApQHIAcgBykC/AU3ApwHIAcgBykChAY3AqQHIAcgBykCjAY3AqwHIAcgBykClAY3ArQHIAcgBygCnAY2ArwHIAkCfyAHKAKwBiICRQRAIAdBADYC0AcgFyANQdgA/AoAAEEADAELAkAgAiAJRgRAIAcgDDYC0AcgAiAMIAIoAgAoAgwRAQAgBygC0AchAgwBCyAHIAIgAigCACgCCBEEACICNgLQBwsgFyANQdgA/AoAAAJAIAIgAiAMRgR/QRAFIAJFDQFBFAsgAigCAGooAgARAAALIAcoArAGCyICRgR/QRAFIAJFDQFBFAshCiACIAIoAgAgCmooAgARAAALAkAgCyAHKAKQBSICRgR/QRAFIAJFDQFBFAshCiACIAIoAgAgCmooAgARAAALAkAgGiAHKAKYASICRgR/QRAFIAJFDQFBFAshCiACIAIoAgAgCmooAgARAAALIAYEQCAGLQAQQQFGDQEgBiAGKAIMQQFqNgIMCyAHKAKYAygCACECIAdCADcDQCAHQgA3A0ggB0IANwNQIAdCADcDGCAHQgA3AyAgB0IANwMoIA8gAiAHQRhqEGdBBQwBCyAAQQ4QLEEBCyECIAcoApgDIgoEQCAKECILIAJFDQALAkAgAkEFRw0AIAgoAiAhAUEAIQkgB0EANgLYBCAHQgA3AtAEIAdB0ARqIAFBDGwiARA1IAcgATYC1AQgB0EANgKgAyAHQgA3ApgDIAdBmANqQQFBABAxIAgoAiQhAiAIKAIAIQsgCCgCBCEBIAgoAhAhECAIKAIUIREgBygC0AQhEiAHKALUBCEMIAcoApgDIQ0gBygCnAMhDyAHIBM2AqAGIAcgFDYCnAYgByAVNgKYBiAHIBY2ApQGIAcgETYCkAYgByAQNgKMBiAHIAE2AogGIAcgCzYChAYgByACNgKABiAHIA82AvwFIAcgDTYC+AUgByAMNgL0BSAHIBI2AvAFAkACQAJAIAYEQAJAIAFFDQAgBi0AEEEBcQ0AQQAhAgNAIAlBAWoiCUGACEYEQEEAIQkgBi0AEA0CCyAHQfAFaiACEPUDIAJBAWoiAiABRw0ACwsgBi0AEEEBRw0BIABBDhAsDAMLIAcgEzYCwAcgByAUNgK8ByAHIBU2ArgHIAcgFjYCtAcgByARNgKwByAHIBA2AqwHIAcgATYCqAcgByALNgKkByAHIAI2AqAHIAcgDzYCnAcgByANNgKYByAHIAw2ApQHIAcgEjYCkAcgAUUNAUEAIQIDQCAHQZAHaiACEPUDIAJBAWoiAiABRw0ACwwBCyAGIAYoAgxBAWo2AgwLIAcoApgDKAIAIQEgB0IANwI0IAdBADYCPCAHQgA3AwggB0EANgIQIAdB0ARqIgIgASAHQQhqEPQDIAdBADYCmAcgB0IANwKQByAAIAIgB0GQB2oQngEgBygCkAciAQRAIAEQIgsgABDtASAAEJMCIAAQjgEgABBYIABBABCNASAAIAYQVCAGRQRAIAAQWgwBCyAGLQAQQQFGBEAgAEEOECwMAQsgABBaIAYtABBBAUYEQCAAQQ4QLAwBCyAGIAYoAgxBAWo2AgwLIAcoApgDIgAEQCAAECILIAcoAtAEIgBFDQAgABAiCyAIKAIQIgAEQCAAECILIAhBADYCGCAIQgA3AhAgCCgCACIARQ0AIAAQIgsgBygCwAQiAEUNACAAECILIAdBsAhqJAALLAECfyAAKAIAIgEoAgAiAgRAIAEgAhCGAiAAKAIAIgAoAgAgACgCCBoQIgsLvwMBAX8gACABRwRAAkAgACgCDCICRQ0AIAIgAigCACICQQFrNgIAIAJBAUoNACAAKAIMIgIEQCACECILIABBADYCDCAAKAIAIgIEQCACECILIABBADYCCCAAQgA3AgALIAAgASgCDDYCDCABQQA2AgwgACABKAIANgIAIAAgASgCBDYCBCAAIAEoAgg2AgggAUEANgIIIAFCADcCAAJAIAAoAhwiAkUNACACIAIoAgAiAkEBazYCACACQQFKDQAgACgCHCICBEAgAhAiCyAAQQA2AhwgACgCECICBEAgAhAiCyAAQQA2AhggAEIANwIQCyAAIAEoAhw2AhwgAUEANgIcIAAgASgCEDYCECAAIAEoAhQ2AhQgACABKAIYNgIYIAFBADYCGCABQgA3AhACQCAAKAIsIgJFDQAgAiACKAIAIgJBAWs2AgAgAkEBSg0AIAAoAiwiAgRAIAIQIgsgAEEANgIsIAAoAiAiAgRAIAIQIgsgAEEANgIoIABCADcCIAsgACABKAIsNgIsIAFBADYCLCAAIAEoAiA2AiAgACABKAIkNgIkIAAgASgCKDYCKCABQQA2AiggAUIANwIgCwujTgIefxB8IwBBgANrIgokAAJAIAEoAgQiBUUNAAJAIAJFDQAgAi0AEEEBRw0AIABBDhAsDAELIAEoAgAhASAKIAU2AkwgCiABNgJIIApB0ABqIgNCADcCLCADQQA2AiQgA0IANwIcIAMgCigCSDYCLCADIAooAkw2AjAgA0IANwJEIANCADcCPCADQgA3AjRBBBAjIgFBATYCACADQQA2AogBIANCADcCgAEgA0EANgJ4IANCADcCcCADQQA2AmggA0IANwJgIANBADYCWCADQgA3AlAgAyABNgJMIANBADYC9AEgA0IANwLsASADQQA2AuQBIANCADcC3AEgA0EANgLUASADQgA3AswBIANBADYCxAEgA0IANwK8ASADQgA3A6gBIANCADcDsAEgA0H8AWpBAEEw/AsAIApBADYCQCAKQgA3AjhBACEFIwBBkAFrIgYkAAJAIAMoAjBFBEBBBBAjIgFBATYCACAKIAE2AgwgBkEANgKEASAKQQA2AgggCkIANwIAIAZBADYCgAEgBkIANwJ4IApBADYCGCAKQgA3AhAMAQsgBkEANgKMASAGQgA3AoQBIAZCADcCfCADKAIwIhRBAk8EQEEBIQEgAygCLCIJKwMQIiMhJiAJKwMAIiQhJSAJKwMIIichIQNAAkAgJCAJIAFBGGxqIg8rAwAiImMEQCABIQggIiEkDAELICIgJWNFDQAgASEFICIhJQsCQCAnIA8rAwgiImMEQCABIQQgIiEnDAELICEgImRFDQAgASELICIhIQsCQCAmIA8rAxAiImMEQCABIQwgIiEmDAELICIgI2NFDQAgASEHICIhIwsgAUEBaiIBIBRHDQALIAYgCzYChAEgBiAFNgJ8IAYgBzYCjAEgBiAENgKAASAGIAw2AogBCyAGIAg2AnggAyAGKQKIATcCoAEgAyAGKQKAATcCmAEgAyAGKQJ4NwKQASADQZABaiEBIAMoAiwhBQNAIAUgASANQQJ0IgRqKAIAQRhsaiAEQXhxaisDAJkiISAoICEgKGQbISggDUEBaiINQQZHDQALQQAhDSADQQA6ABggAyAoOQMQIAMgKERIr7ya8td6PqIiITkDACADICEgIaI5AwgjAEEQayIPJAAgA0EANgLQASADQcwBaiIcEC0gA0EANgLgASADQdwBaiIXEC0gA0EANgLwASADQewBaiIUEJQBQQAhBEEAIQFBACELQQAhDCMAQSBrIgckAAJAIAMoAjAiBUEETQRAAkACQAJAAkAgBQ4FAgEBAQABCyADKAIsIQQMAgsgBUEYbCIBECchBCABRQ0AIAQgAygCLCAB/AoAAAsgAygCHCIBBEAgARAiCyADQRxqIQsgAyAFNgIkIAMgBTYCICADIAQ2AhwDQCADKAIcIAVBGGxqIgRBGGshAQJAIAMoAiQiCCAFTQRAIAcgASkDEDcDGCAHIAEpAwg3AxAgByABKQMANwMIIAsgCEEBdEGAASAIGxAzIAMgAygCICIBQQFqNgIgIAMoAhwgAUEYbGoiASAHKQMYNwMQIAEgBykDEDcDCCABIAcpAwg3AwAMAQsgAyAFQQFqNgIgIAQgASkDEDcDECAEIAEpAwg3AwggBCABKQMANwMACyADKAIgIgVBBEkNAAsgAyAFNgIwIAMgAygCHCIENgIsCyADQTRqRAAAAAAAAAAAIAQrAwAiIiAEKwMIIiYgBCsDOCIhoSIjIAQrAyggBCsDQCIkoSIloiAEKwMQIicgJKEiJCAEKwMgICGhIiiioSIhICIgBCsDMCIioSIpICiiICMgBCsDGCAioSIjoqEiIiAioiAhICGiICQgI6IgKSAloqEiISAhoqCgnyIjoyIkoqEgJiAhICOjIiGioSAnICIgI6MiIqKhIAQrA1ggIqIgBCsDUCAhoiAEKwNIICSiRAAAAAAAAAAAoKCgoEQAAAAAAAAAAGYiASABRUECQQMQiAIMAQsgA0GQAWohCSADKAIsIQggAysDCCIiISEDQCABIgRBAWohASAEQQRNBEAgCCAJIARBAnRqKAIAIhFBGGxqIgQrAxAhIyAEKwMIISYgBCsDACEkIAEhBANAICQgCCAJIARBAnRqKAIAIhVBGGxqIg4rAwChIiUgJaIgJiAOKwMIoSIlICWioCAjIA4rAxChIiUgJaKgIiUgISAhICVjIg4bISEgFSALIA4bIQsgESAMIA4bIQwgBEEBaiIEQQZHDQALCyABQQZHDQALICEgImEEQCADQTRqQQBBAUECQQMQiAIMAQtEAAAAAAAA8D8gCCALQRhsaiIBKwMAIisgCCAMQRhsaiIEKwMAIiOhIiYgJqIgASsDCCItIAQrAwgiJKEiJSAloqAgASsDECIuIAQrAxAiJ6EiKCAooqCjIS9BACEEQX8hCSAiISEDQCAIIARBGGxqIgErAwAgI6EiKSApoiABKwMIICShIiwgLKKgIAErAxAgJ6EiKiAqoqAgLyAmICmiRAAAAAAAAAAAoCAlICyioCAoICqioCIpICmioqEiKSAhICEgKWMiARshISAEIAkgARshCSAEQQFqIgQgBUcNAAsgISAiYQRAQQAhAQNAIAEiBUEBaiEBIAUgDEYgBSALRnINAAsgBSEBA0AgAUEBaiIBIAxGIAEgC0ZyDQALIANBNGogDCALIAUgARCIAgwBC0QAAAAAAAAAACAjICQgCCAJQRhsaiIBKwMIIiKhIiogLiABKwMQIimhIi6iIC0gIqEiLSAnICmhIi+ioSIhICMgASsDACIsoSIwIC2iICsgLKEiKyAqoqEiKiAqoiAhICGiICsgL6IgMCAuoqEiISAhoqCgnyIroyItoqEgJCAhICujIi6ioSAnICogK6MiKqKhIStBACEBIAMrAwAiLyEhQQAhBANAICsgLSAIIARBGGxqIg4rAwCiRAAAAAAAAAAAoCAuIA4rAwiioCAqIA4rAxCioKCZIjAgISAhIDBjIg4bISEgBCABIA4bIQEgBEEBaiIEIAVHDQALICEgL2EEQCADQQE6ABggBUEYbCIBECchBCABBEAgBCAIIAH8CgAACyAmICIgJKEiIqIgJSAsICOhIiOioSIhICEgIaIgJSApICehIiSiICggIqKhIiEgIaIgKCAjoiAmICSioSIiICKioKCfIiOjISYgAygCHCIBBEAgARAiIAMoAiwhCAsgAyAFNgIkIAMgBTYCICADIAQ2AhwgCCsDACEkIAgrAwghJSAIKwMQIScgA0EcaiAFQQF0EDMgAygCHCIIIAMoAiAiAUEYbGoiBCAmICegOQMQIAQgIiAjoyAloDkDCCAEICEgI6MgJKA5AwAgAyABQQFqIgQ2AjAgAyAINgIsIAMgBDYCIAsgA0E0aiALIAwgKyAtIAggAUEYbGoiBCsDAKJEAAAAAAAAAACgIC4gBCsDCKKgICogBCsDEKKgoEQAAAAAAAAAAGYiBBsgDCALIAQbIAkgARCIAiADKAI0IgQgAygCOCIRRwRAIAMoAiwhASADKAJgIQsgAygCQCEIA0AgBCABIAggBCgCACIJQQR0aigCBEEYbGoiDCsDACIkIAEgCCALIAsgCUECdGooAgAiDkECdGooAgBBBHRqKAIEQRhsaiIJKwMAIiGhIiIgASAIIA5BBHRqKAIEQRhsaiIOKwMIIAkrAwgiI6EiJqIgDCsDCCIlICOhIiMgDisDACAhoSInoqEiISAhICGiICMgDisDECAJKwMQIiGhIiiiIAwrAxAiKSAhoSIhICaioSIjICOiICEgJ6IgIiAooqEiIiAioqCgnyImoyIhOQMYIAQgIiAmoyIiOQMQIAQgIyAmoyIjOQMIIAQgISAhoiAjICOiICIgIqKgoDkDKCAERAAAAAAAAAAAICQgI6KhICUgIqKhICkgIaKhOQMgIARByABqIgQgEUcNAAsLQQAhAQNAAkAgAygCNCIEIAMoAjgiCEYNAANAIAMgBCABEP8DDQEgBEHIAGoiBCAIRw0ACwsgAUEBaiIBIAVHDQALCyAHQSBqJAAgA0EANgKcAiADKAKQAiADKAKMAiIHa0ECdSIFQQNPBEADQCAHKAIAECIgAyADKAKMAkEEaiIHNgKMAiADKAKQAiAHa0ECdSIFQQJLDQALC0GABCEHAkACQAJAIAVBAWsOAgEAAgtBgAghBwsgAyAHNgKYAgsgA0GIAmohCyADQTRqIQRBACEHA0ACQCAEKAIAIAdByABsaiIBKAJEIgVFDQAgBSgCBEUNACAPIAc2AgQgCyAPQQRqEIAEIAEgAS0AQEECcjoAQAsgB0EBaiIHQQRHDQALIAMoApwCIgEEQCADQfwBaiEdIANBvAFqIRggA0GsAWohHiADQaACaiEfA0AgAygCjAIgAygCmAIiBUEIdkH8//8HcWooAgAgBUH/B3FBAnRqKAIAIQcgAyABQQFrNgKcAiADIAVBAWo2ApgCIAsoAhBBgBBPBEAgCygCBCgCABAiIAsgCygCBEEEajYCBCALIAsoAhBBgAhrNgIQCyADKAI0IAdByABsaiIIIAgtAEBB/QFxOgBAIBZBAWoiAUEAIAFBf0cbIRYCQCAIKAJERQ0AIAgoAgBBf0YNACAIKAI4IRUgA0EANgLgASADKAIsIQwgFxAtIANBADYC8AEgFBCUASADQQA2AtABIBwQLSAVQRhsAkAgAygC8AEiASADKAL0ASIFTwRAIBQgBUEBdEGAASAFGxBEIAMgAygC8AEiAUEBajYC8AEMAQsgAyABQQFqNgLwAQsgAygC7AEgAUEDdGogB61CgICAgHCENwIAIAxqIQwDQAJAIAMoAvABIgEEQCADKALsASABQQN0aiIFQQRrKAIAIQkgBUEIaygCACEHIBQgAUEBayIFEEQgAyAFNgLwASABQRFJIAEgBUEBdE1yRQRAIBQQlAELIBYgBCgCACAHQcgAbGoiASgCPEYEQCABLQBAIgVBAXENAwwCCyABIBY2AjwgAS0AQCEFIAErAyAgASsDCCAMKwMAokQAAAAAAAAAAKAgASsDECAMKwMIoqAgASsDGCAMKwMQoqCgRAAAAAAAAAAAZEUNASABIAVB4gFxQQFyOgBAAkAgAygC0AEiBSADKALUASIOTwRAIBwgDkEBdEGAASAOGxAlIAMgAygC0AEiBUEBajYC0AEMAQsgAyAFQQFqNgLQAQsgAygCzAEgBUECdGogBzYCACAPIAEoAgAiATYCBCAPIAMoAmAiBSABQQJ0aigCACIBNgIIIA8gBSABQQJ0aigCADYCDEEAIQcDQAJAIAMoAkAgD0EEaiAHaigCACIBQQR0aigCCCIFIAlGDQAgAygCUCAFQQJ0aigCACEFIAMoAvABIg4gAygC9AEiEU8EQCAUIBFBAXRBgAEgERsQRCADIAMoAvABIg5BAWo2AvABIAMoAuwBIA5BA3RqIAWtIAGtQiCGhDcCAAwBCyADIA5BAWo2AvABIAMoAuwBIA5BA3RqIAWtIAGtQiCGhDcCAAsgB0EEaiIHQQxHDQALDAILIAMoAuABIQ4Cf0EBIBcoAgQiEUECSQ0AGiADKAJAIQcgFygCACEJQQAhAUEBIQUDQCAHIAkgAUECdGooAgBBBHRqKAIEIRIgBSEBAkADQCAHIAcgCSABQQJ0aiIQKAIAIhNBBHRqKAIIQQR0aigCBCASRg0BIAFBAWoiASARRw0AC0EADAILIAkgBUECdGoiASgCACESIAEgEzYCACAQIBI2AgAgBSIBQQFqIgUgEUcNAAtBAQtFBEAgAyADKAKoAUEBajYCqAEgCEHEAGoiDCgCACIIKAIEIgkEQCAIKAIAIQ5BACEBQQAhBwNAAkBBASEFAkAgFSAOIAdBAnRqIhEoAgAiEkcEQCABIgVBAUYNAQsgBSEBIAdBAWoiByAJSQ0CIAFBAUcNByAIIAlBAWtBABAxIAwoAgAiCCgCBCEJDAELIBFBBGsgEjYCAEECIQEgB0EBaiIHIAgoAgQiCUkNAQsLIAkNBAsgCCgCCEGBAU8EQCAMQQA2AgAgCBB1DAQLIB8gDBDaAgwDC0EAIQkgA0EANgKwASAeEC0gA0EANgLAASAYEC0gHSADKAL8ARCGAiAOQQF0IREgAygC0AEiAQRAIAMoAswBIgUgAUECdGohEwNAIA8gAygCNCAFKAIAIhJByABsaiIZKAIAIgE2AgQgDyADKAJgIgcgAUECdGooAgAiATYCCCAPIAcgAUECdGooAgA2AgxBACEHA0ACQCAZLQBAQQJ2QQdxIAd2QQFxDQAgD0EEaiAHQQJ0aigCACEBIAkgEUkEQAJAIAMoAsABIgggAygCxAEiEE8EQCAYIBBBAXRBgAEgEBsQJSADIAMoAsABIghBAWo2AsABDAELIAMgCEEBajYCwAELIAMoArwBIAhBAnRqIAE2AgAgCUEBaiEJDAELIAQoAgwgAUEEdGpBfzYCCAJAIAQoAlAiCCAEKAJUIhBPBEAgBEHMAGogEEEBdEGAASAQGxAlIAQgBCgCUCIIQQFqNgJQDAELIAQgCEEBajYCUAsgBCgCTCAIQQJ0aiABNgIACyAHQQFqIgdBA0cNAAsgBCgCACASQcgAbGoiB0F/NgIAAkAgBCgCQCIBIAQoAkQiCE8EQCAEQTxqIAhBAXRBgAEgCBsQJSAEIAQoAkAiAUEBajYCQAwBCyAEIAFBAWo2AkALIAQoAjwgAUECdGogEjYCACAHKAJEIQEgB0EANgJEIA8gATYCAAJAIAFFDQAgHSAPENoCIA8oAgAhASAPQQA2AgAgAUUNACABEHULIAVBBGoiBSATRw0ACwsgCSARSQRAIBEgCWshEkEAIQcDQAJAIAQoAlAiAQRAIAQoAkwgAUECdGpBBGsoAgAhBSAEQcwAaiIJIAFBAWsiCBAlIAQgCDYCUCABQRFJIAEgCEEBdE1yDQEgCRAtDAELIARBDGohBQJ/IAQoAhAiASAEKAIUIghPBEAgBSAIQQF0QYABIAgbEDkgBCgCDCAEKAIQIgFBBHRqDAELIAUoAgAgAUEEdGoLIgVCADcCCCAFQgA3AgAgBCABQQFqNgIQIARBHGohBQJAIAQoAiAiASAEKAIkIghPBEAgBSAIQQF0QYABIAgbECUgBCgCHCAEKAIgIgFBAnRqQQA2AgAMAQsgBSgCACABQQJ0akEANgIACyAEIAFBAWo2AiAgBEEsaiEFAkAgBCgCMCIBIAQoAjQiCE8EQCAFIAhBAXRBgAEgCBsQJSAEKAIsIAQoAjAiAUECdGpBADYCAAwBCyAFKAIAIAFBAnRqQQA2AgALIAQgAUEBajYCMCAEKAIQQQFrIQULAkAgAygCwAEiCSADKALEASIBTwRAIBggAUEBdEGAASABGxAlIAMgAygCwAEiCUEBajYCwAEMAQsgAyAJQQFqNgLAAQsgAygCvAEgCUECdGogBTYCACAHQQFqIgcgEkcNAAsLIA4EQCADKAJAIQlBACEHA0AgCSADKALcASAHQQJ0aigCACIIQQR0aiIBKAIEIRkgCSABKAIIQQR0aigCBCESAkAgBCgCQCIBBEAgBCgCACAEKAI8IAFBAnRqQQRrKAIAIgVByABsakIANwMwIARBPGoiECABQQFrIgkQJSAEIAk2AkAgAUERSSABIAlBAXRNcg0BIBAQLQwBCyAEAn8gBCgCBCIBIAQoAghJBEAgAUF/NgIAIAFBCGpBAEE4/AsAIAFBADYCRCABIAEtAEBB4AFxOgBAIAFByABqDAELIwBBIGsiCSQAIAQoAgQgBCgCACIFa0HIAG0iEEEBaiIBQeTxuBxPBEAQJgALIAlBDGpB4/G4HCAEKAIIIAVrQcgAbSIFQQF0IhMgASABIBNJGyAFQfG4nA5PGyAQIAQQ3QIiASgCCCIFQX82AgAgBUEIakEAQTj8CwAgBUEANgJEIAUgBS0AQEHgAXE6AEAgASAFQcgAajYCCCAEKAIAIgUgBCgCBCIQIAEoAgQgECAFa0G4f21ByABsaiIQENwCIAQoAgAhBSAEIBA2AgAgASAFNgIEIAQgASgCCCIQNgIEIAEgBTYCCCAEKAIIIRMgBCABKAIMNgIIIAEgBTYCACABIBM2AgwgARDbAiAJQSBqJAAgEAsiATYCBCABIAQoAgBrQcgAbUEBayEFCwJAIAMoArABIgkgAygCtAEiAU8EQCAeIAFBAXRBgAEgARsQJSADIAMoArABIglBAWo2ArABDAELIAMgCUEBajYCsAELIAMoAqwBIAlBAnRqIAU2AgAgAygCvAEiECAHQQN0aiITKAIAIQEgAygCYCIJIAhBAnQiGmogEygCBCITNgIAIAkgE0ECdCIbaiABNgIAIAkgAUECdCIgaiAINgIAIBsgAygCUCIJaiAFNgIAIAkgIGogBTYCACAJIBpqIAU2AgAgAygCQCIJIAFBBHRqIhogEjYCBCAJIBNBBHRqIhMgFTYCBCADKAIsIhsgEkEYbGoiASsDCCEmIBsgGUEYbGoiEisDCCEkIAErAxAhJSASKwMAIScgASsDACEoIBIrAxAhKSAMKwMIISEgDCsDACEiIAwrAxAhIyADKAI0IAVByABsaiIBIAg2AgAgASAoICKhIiggJCAhoSIkoiAmICGhIiwgJyAioSInoqEiJiAmICaiICwgKSAjoSImoiAlICOhIikgJKKhIiUgJaIgKSAnoiAoICaioSIkICSioKCfIiejIiY5AxggASAkICejIiQ5AxAgASAlICejIiU5AwggASAmICaiICUgJaIgJCAkoqCgOQMoIAFEAAAAAAAAAAAgIiAloqEgISAkoqEgIyAmoqE5AyAgGiAQIAdBAXQgESAHG0ECdGpBBGsoAgA2AgggEyAQIAdBAWoiB0EBdCARcEECdGooAgA2AgggByAORw0ACwsgAygC/AEiASADKAKAAiIIRwRAA0ACQAJ/IAEoAgAiBygCBCIMBEAgBygCACIFIAxBAnRqIQwDQAJAIAUoAgAgFUYNAEEAIQcgDkUNAANAIAMgAygCNCADKAKsASAHQQJ0aigCAEHIAGxqIAUoAgAQ/wMNASAHQQFqIgcgDkkNAAsLIAVBBGoiBSAMRw0ACyABKAIAIgcoAgRBB3RBgAFqDAELQYABCyAHKAIISQRAIAFBADYCACAHEHUMAQsgHyABENoCCyABQQRqIgEgCEcNAAsLIAMoArABIgFFDQIgAygCrAEiByABQQJ0aiEFA0ACQCAEKAIAIAcoAgAiCEHIAGxqIgEoAkRFDQAgAS0AQEECcQ0AIA8gCDYCBCALIA9BBGoQgAQgASABLQBAQQJyOgBACyAFIAdBBGoiB0cNAAsMAgsgASAFQf4BcToAQAJAIAMoAuABIgUgAygC5AEiAU8EQCAXIAFBAXRBgAEgARsQJSADIAMoAuABIgVBAWo2AuABDAELIAMgBUEBajYC4AELIAMoAtwBIAVBAnRqIAk2AgAgAygCNCADKAJQIAlBAnRqKAIAQcgAbGoiASABLQBAQQRBCEEQIAMoAmAgASgCACIBQQJ0aigCACAJRhsgASAJRhtyOgBADAALAAsgAygCnAIiAQ0ACwsgA0GgAmogAygCoAIQhgIgD0EQaiQAIAMtABhBAUYEQCADKAIcIgEgAygCIEEYbGpBGGsiBSABKQMQNwMQIAUgASkDCDcDCCAFIAEpAwA3AwALIAMoAkQhASAGQQA2AoABIAZCADcCeEEEECMiBUEBNgIAIAYgBTYChAEgBkH4AGogARA5IAYgATYCfCADKAJEIQEgBkEANgJwIAZCADcCaCAGQegAaiABECUgBiABNgJsIAMoAkQhASAGQQA2AmAgBkIANwJYIAZB2ABqIAFBABAxIAMoAkQhASAGQQA2AlAgBkIANwJIIAZByABqIAEQJSAGIAE2AkwgAygCNCEBIAMoAjghBSAGQQA2AkAgBkIANwI4IAZBOGogBSABa0HIAG0iARAlIAYgATYCPCAGQQA2AjQgAygCRCIHBEADQAJAIA1BBHQiBCADKAJAaigCCEEASA0AIAMoAjQgDUECdCIFIAMoAlBqKAIAIgFByABsaigCAEF/Rg0AIAYoAlggAUECdGoiASABKAIAIgFBAWo2AgAgAUEASg0AIAYgBigCNCIBQQNqNgI0IAYoAkggBWogATYCACABQQR0IgggBigCeGoiCyADKAJAIARqIgQpAgg3AgggCyAEKQIANwIAIAYoAmggAUECdGogAygCUCAFaigCADYCACADKAJgIAVqKAIAIgtBAnQiBSAGKAJIaiABQQFqIgQ2AgAgBEEEdCIMIAYoAnhqIgkgAygCQCALQQR0aiILKQIINwIIIAkgCykCADcCACAGKAJoIARBAnRqIAMoAlAgBWooAgA2AgAgAygCYCAFaigCACIFQQJ0IgQgBigCSGogAUECaiIBNgIAIAFBBHQiCyAGKAJ4aiIJIAMoAkAgBUEEdGoiBSkCCDcCCCAJIAUpAgA3AgAgBigCaCABQQJ0aiADKAJQIARqKAIANgIAIAYoAngiASAIaiIFIAEgC2oiBCgCBDYCACABIAxqIgEgBSgCBDYCACAEIAEoAgQ2AgALIA1BAWoiDSAHRw0ACyAGKAI0IQ0LIAZCADcDKCAGQgA3AyAgBkIANwMAIAZCADcDCCAGQfgAaiANIAYQlQIgBkHoAGogDUEAEDEgBigCfCIBBEAgBigCeCINIAFBBHRqIQEgBigCSCEFA0AgDSAFIA0oAghBAnRqKAIANgIIIA1BEGoiDSABRw0ACwsgBigCXCEBIAZB2ABqIgUgAygCMEEBaiIEECUgBiAENgJcIAFBEUkgASAEQQF0TXJFBEAgBRAtIAYoAlwhBAsCQCAEQQBMDQAgBEECdCIBRQ0AIAYoAlhBACAB/AsACyAGKAJ8IgFBA24hBSABQQNPBEBBACENA0AgBigCWCANQTBsIgEgBigCeGooAgBBAnRqIgQgBCgCAEEBajYCACAGKAJYIAYoAnggAWooAhBBAnRqIgQgBCgCAEEBajYCACAGKAJYIAYoAnggAWooAiBBAnRqIgEgASgCAEEBajYCACANQQFqIg0gBUcNAAsgBigCXCEECyAGKAJYIg0gBEECdGohAQJAIARFDQAgDSgCACANQQA2AgAgBEEBRg0AQQBKIQQgDUEEaiELA0AgCygCACEFIA0gBDYCBCANQQRqIQ0gBCAFQQBKaiEEIAtBBGoiCyABRw0ACwsgAUEEaygCACEEQQAhDSAGQQA2AhggBkIANwIQIAZBEGogBBAzIAYgBDYCFCADKAIwIgcEQCAGKAIQIQggBigCWCELA0AgCyANQQJ0aiIBKAIEIAEoAgAiAUoEQCAIIAFBGGxqIgEgAygCLCANQRhsaiIFKQMQNwMQIAEgBSkDCDcDCCABIAUpAwA3AwALIA1BAWoiDSAHRw0ACwsgBigCeCEFIAYoAnwiBwRAIAUgB0EEdGohCyAGKAJYIQggBSEBA0AgASAIIAEoAgBBAnRqKAIANgIAIAEgCCABKAIEQQJ0aigCADYCBCABQRBqIgEgC0cNAAsLIAogBigChAE2AgwgBkEANgKEASAKIAc2AgQgCiAFNgIAIAogBigCgAE2AgggBkEANgKAASAGQgA3AnggBigCECEBIAogBDYCFCAKIAE2AhAgCiAGKAIYNgIYIAYoAjgiAQRAIAEQIgsgBigCSCIBBEAgARAiCyAGKAJYIgEEQCABECILIAYoAmgiAQRAIAEQIgsLIAZB+ABqEEkgBkGQAWokACAKIABByABqNgI0IAogCkE4ajYCMCAKKAIwIgEoAgAiBQRAIAUQIgsgAUIANwIAIAEgCigCADYCACABIAooAgQ2AgQgASAKKAIINgIIIApBADYCCCAKQgA3AgAgCigCNCIBIApBEGpHBEAgASgCACIFBEAgBRAiCyABQQA2AgggAUIANwIAIAEgCigCEDYCACABIAooAhQ2AgQgASAKKAIYNgIIIApBADYCGCAKQgA3AhALIAooAhAiAQRAIAEQIgsgCkEANgIYIApCADcCECAKEEkgCiAKKQI4NwIwIApBADYCCCAKQgA3AgBBBBAjIgFBATYCACAKQQA2AhggCkIANwIQIAogATYCDEEEECMiAUEBNgIAIApBADYCKCAKQgA3AiAgCiABNgIcQQQQIyIBQQE2AgAgCiABNgIsIAoQ7wIgCiAKKAI0EMkBIAooAjQiBwRAIAooAiAhCCAKKAIQIQsgCigCACEMIAooAjAhBkEAIQEDQCAMIAFBAnQiBWogBiABQQR0aiIEKAIANgIAIAUgC2ogBCgCCDYCACAFIAhqIAQoAgw2AgAgAUEBaiIBIAdHDQALCyAAQdgAaiAKEP0DIApBIGoQSSAKQRBqEEkgChBJAkACQCACBEAgAi0AEEEBRgRAIABBDhAsDAMLIAAQWCAAQQAQjQEgABCOASAAIAIQVCACLQAQQQFHDQEgAEEOECwMAgsgABBYIABBABCNASAAEI4BIABBABBUCyAAEFoLIAooAjgiAARAIAAQIgsjAEEQayIAJAAgACADQaACajYCBCAAQQRqEPwDIANBiAJqIgJBADYCFCACKAIIIgUgAigCBCIBa0ECdSIEQQNPBEADQCABKAIAECIgAiACKAIEQQRqIgE2AgQgAigCCCIFIAFrQQJ1IgRBAksNAAsLQYAEIQcCQAJAAkAgBEEBaw4CAQACC0GACCEHCyACIAc2AhALIAEgBUcEQANAIAEoAgAQIiABQQRqIgEgBUcNAAsLIAIQUyAAIANB/AFqNgIIIABBCGoQ/AMgAygC7AEiAQRAIAEQIgsgA0EANgL0ASADQgA3AuwBIAMoAtwBIgEEQCABECILIANBADYC5AEgA0IANwLcASADKALMASIBBEAgARAiCyADQQA2AtQBIANCADcCzAEgAygCvAEiAQRAIAEQIgsgA0EANgLEASADQgA3ArwBIAMoAqwBIgEEQCABECILIANBADYCtAEgA0IANwKsASADKAKAASIBBEAgARAiCyADQQA2AogBIANCADcDgAEgAygCcCIBBEAgARAiCyADQQA2AnggA0IANwNwIAMoAmAiAQRAIAEQIgsgA0EANgJoIANCADcDYCADKAJQIgEEQCABECILIANBADYCWCADQgA3A1AgA0FAaxBJIAAgA0E0ajYCDCAAKAIMIgEoAgAiAgRAIAEgAhCBBCAAKAIMIgEoAgAgASgCCBoQIgsgAygCHCIBBEAgARAiCyAAQRBqJAALIApBgANqJAALwAMCB38BfAJAIAErAyAgASsDCCAAKAIsIAJBGGxqIgQrAwCiRAAAAAAAAAAAoCABKwMQIAQrAwiioCABKwMYIAQrAxCioKAiCkQAAAAAAAAAAGRFDQAgCiAKoiAAKwMIIAErAyiiZEUNAAJAIAEoAkQiAw0AIwBBEGsiBSQAAkAgAEGgAmoiBygCBCIAIAcoAgBGBEBBEBAjIgZBADYCCCAGQgA3AgAMAQsgAEEEayIEKAIAIQYgBEEANgIAIAAiAyAARwRAA0AgACgCACEJIABBADYCACAEKAIAIQggBCAJNgIAIAgEQCAIEHULIARBBGohBCAAQQRqIgAgA0cNAAsgAyEACyAFIAQ2AgwgBSAANgIIIAcgBSgCDBCGAgsgBUEQaiQAIAYiA0EANgIEIAMQLSABKAJEIQAgASADNgJEIABFDQAgABB1IAEoAkQhAwsCQCADKAIEIgAgAygCCCIETwRAIAMgBEEBdEGAASAEGxAlIAMgAygCBCIAQQFqNgIEDAELIAMgAEEBajYCBAsgAygCACAAQQJ0aiACNgIAQQEhAyAKIAErAzBkRQ0AIAEgAjYCOCABIAo5AzALIAMLkQwBCn8gACgCFCIHIAAoAhBqIgIgACgCCCIEIAAoAgQiA2tBCHRBAWtBACADIARHG0YEQCMAQSBrIgkkAAJAIAAoAhAiAkGACE8EQCAAIAJBgAhrNgIQIAkgACgCBCICKAIANgIMIAAgAkEEajYCBCAAIAlBDGoQ2QIMAQsCQCAAKAIIIgMgACgCBGsiBCAAKAIMIgIgACgCACIFayIGSQRAIAIgA0YNASAJQYAgECM2AgwgACAJQQxqENkCDAILIAlBDGpBASAGQQF1IAIgBUYbIARBAnUgABBKIQIgCUGAIBAjNgIIIwBBIGsiCCQAAkAgAigCCCIDIAIoAgxHDQAgAigCBCIEIAIoAgAiBUsEQCADIARrIQYgBCAEIAVrQQJ1QQFqQX5tQQJ0IgdqIQUgAiADIARHBH8gBgRAIAUgBCAG/AoAAAsgAigCBAUgBAsgB2o2AgQgBSAGaiEDDAELIAhBDGpBASADIAVrQQF1IAMgBUYbIgMgA0ECdiACKAIQEEoiBygCCCEDIAIoAggiCiACKAIEIgRHBEAgAyAKIARraiEGIAQhBQNAIAMgBSgCADYCACAFQQRqIQUgA0EEaiIDIAZHDQALIAYhAwsgAigCACEFIAIgBygCADYCACAHIAU2AgAgAiAHKAIENgIEIAcgBDYCBCACIAM2AgggByAKNgIIIAIoAgwhAyACIAcoAgw2AgwgByADNgIMIAcQUyACKAIIIQMLIAMgCSgCCDYCACACIANBBGo2AgggCEEgaiQAIAAoAggiByAAKAIEIgNHBEADQCAHQQRrIQcjAEEgayIKJAACQCACKAIEIgQgAigCAEcEQCAEIQMMAQsgAigCCCIFIAIoAgwiA0kEQCAFIAMgBWtBAnVBAWpBAm1BAnQiCGogBSAEayIGayEDIAIgBCAFRwR/IAYEQCADIAQgBvwKAAALIAIoAggFIAULIAhqNgIIDAELIApBDGpBASADIARrQQF1IAMgBEYbIgMgA0EDakECdiACKAIQEEoiCCgCCCEEIAIoAggiCyACKAIEIgVHBEAgBCALIAVraiEGIAUhAwNAIAQgAygCADYCACADQQRqIQMgBEEEaiIEIAZHDQALIAYhBAsgAigCACEDIAIgCCgCADYCACAIIAM2AgAgAiAIKAIENgIEIAggBTYCBCACIAQ2AgggCCALNgIIIAIoAgwhAyACIAgoAgw2AgwgCCADNgIMIAgQUyACKAIEIQMLIANBBGsiAyAHKAIANgIAIAIgAzYCBCAKQSBqJAAgByAAKAIEIgNHDQALIAAoAgghBwsgACgCACEEIAAgAigCADYCACACIAQ2AgAgACACKAIENgIEIAIgAzYCBCAAIAIoAgg2AgggAiAHNgIIIAAoAgwhAyAAIAIoAgw2AgwgAiADNgIMIAIQUwwBCyAJQYAgECM2AgwgCUEMaiEKIwBBIGsiByQAAkAgACgCBCIDIAAoAgBHBEAgAyECDAELIAAoAggiBCAAKAIMIgJJBEAgBCACIARrQQJ1QQFqQQJtQQJ0IgZqIAQgA2siBWshAiAAIAMgBEcEfyAFBEAgAiADIAX8CgAACyAAKAIIBSAECyAGajYCCAwBCyAHQQxqQQEgAiADa0EBdSACIANGGyICIAJBA2pBAnYgABBKIgYoAgghAyAAKAIIIgggACgCBCIERwRAIAMgCCAEa2ohBSAEIQIDQCADIAIoAgA2AgAgAkEEaiECIANBBGoiAyAFRw0ACyAFIQMLIAAoAgAhAiAAIAYoAgA2AgAgBiACNgIAIAAgBigCBDYCBCAGIAQ2AgQgACADNgIIIAYgCDYCCCAAKAIMIQIgACAGKAIMNgIMIAYgAjYCDCAGEFMgACgCBCECCyACQQRrIgIgCigCADYCACAAIAI2AgQgB0EgaiQAIAkgACgCBCICKAIANgIMIAAgAkEEajYCBCAAIAoQ2QILIAlBIGokACAAKAIEIQMgACgCFCIHIAAoAhBqIQILIAMgAkEIdkH8//8HcWooAgAgAkH/B3FBAnRqIAEoAgA2AgAgACAHQQFqNgIUC0QBA38gACgCBCICIAFHBEADQCACQQRrIgMoAgAhBCADQQA2AgAgBARAIAQQdQsgASACQcgAayICRw0ACwsgACABNgIEC/MaAhV8CX8jAEGgAWsiHiQAIB5B2ABqQQBByAD8CwAgHkEQakEAQcgA/AsAIB5BAjYCDCAeQoCAgIAQNwIEIAAoAgQiGigCWCABQQxsaiEbIAAoAgAiACgCWCACQQxsaiEcIBooAkghHSAAKAJIIR8DQCAeQQRqIBlqKAIAIgJBGGwiGiAeQdgAaiIAaiIBIB8gHCACQQJ0IiBqKAIAQRhsaiICKQMQNwMQIAEgAikDCDcDCCABIAIpAwA3AwAgGiAeQRBqIgFqIgIgHSAbICBqKAIAQRhsaiIaKQMINwMIIAIgGikDEDcDECACIBopAwA3AwAgGUEEaiIZQQxHDQALQQAhGUEAIRojAEHAAWsiAiQAIAArAwAhBSAAKwMYIQYgACsDCCEIIAArAyAhBCACIAArAygiCiAAKwMQIguhOQOIASACIAQgCKE5A4ABIAIgBiAFoTkDeCAAKwMwIQcgACsDOCEJIAIgCyAAKwNAIguhOQO4ASACIAggCaE5A7ABIAIgBSAHoTkDqAEgAiALIAqhOQOgASACIAkgBKE5A5gBIAIgByAGoTkDkAEgASsDACEFIAErAxghBiABKwMIIQggASsDICEEIAIgASsDKCIKIAErAxAiC6E5A0AgAiAEIAihOQM4IAIgBiAFoTkDMCABKwMwIQcgASsDOCEJIAIgCyABKwNAIguhOQNwIAIgCCAJoTkDaCACIAUgB6E5A2AgAiALIAqhOQNYIAIgCSAEoTkDUCACIAcgBqE5A0hE////////738hBgJAA0AgACAZQRhsIhtqIR8gACAZQQFrQQIgGRtBGGxqISAgAkH4AGogG2ohIUEAIRsDQCACQgA3AyggAkIANwMgIAJCADcDGCACQgA3AxAgAkIANwMIIAJCADcDACABIBtBGGwiHWoiHCsDACAfKwMAIhChIgQgAkEwaiAdaiIdKwMAIgWiRAAAAAAAAAAAoCAcKwMIIB8rAwgiEaEiByAdKwMIIgiioCAcKwMQIB8rAxAiEqEiCyAdKwMQIgyioCEPIAQgISsDACIJokQAAAAAAAAAAKAgByAhKwMIIgqioCALICErAxAiC6KgIQ1EAAAAAAAAAAAhBCAJIAmiIAogCqKgIAsgC6KgIgcgBSAFoiAIIAiioCAMIAyioCIOoiAJIAWiRAAAAAAAAAAAoCAKIAiioCALIAyioCIMIAyioSIFRAAAAAAAAAAAYgRARAAAAAAAAAAAIA0gDqIgDyAMoqEgBaMiBUQAAAAAAADwPyAFRAAAAAAAAPA/YxsgBUQAAAAAAAAAAGMbIQQLAkAgDkQAAAAAAAAAAGIEQEQAAAAAAAAAACEIIAwgBKIgD6EgDqMiBUQAAAAAAAAAAGMEQEQAAAAAAAAAACEEIAdEAAAAAAAAAABhDQJEAAAAAAAAAAAgDSAHoyIFRAAAAAAAAPA/IAVEAAAAAAAA8D9jGyAFRAAAAAAAAAAAYxshBAwCCyAFIghEAAAAAAAA8D9kRQ0BRAAAAAAAAAAAIQREAAAAAAAA8D8hCCAHRAAAAAAAAAAAYQ0BRAAAAAAAAAAAIA0gDKAgB6MiBUQAAAAAAADwPyAFRAAAAAAAAPA/YxsgBUQAAAAAAAAAAGMbIQQMAQtEAAAAAAAAAAAhCEQAAAAAAAAAACEEIAdEAAAAAAAAAABhDQBEAAAAAAAAAAAgDSAHoyIFRAAAAAAAAPA/IAVEAAAAAAAA8D9jGyAFRAAAAAAAAAAAYxshBAsgAiASIAsgBKKgOQMoIAIgESAKIASioDkDICACIBAgCSAEoqA5AxggHCsDACEFIB0rAwAhBCAcKwMIIQcgHSsDCCEJIAIgCCAdKwMQoiAcKwMQoDkDECACIAcgCCAJoqA5AwggAiAFIAggBKKgOQMAAkAgAisDACIKIAIrAxgiCKEiBCAEoiACKwMIIgsgAisDICINoSIHIAeioCACKwMQIgwgAisDKCIOoSIJIAmioCIFIAZlRQRAIAYhBQwBCyAEICArAwAgCKGiRAAAAAAAAAAAoCAHICArAwggDaGioCAJICArAxAgDqGioCIIRAAAAAAAAAAAZSAEIAEgG0EBa0ECIBsbQRhsaiIcKwMAIAqhokQAAAAAAAAAAKAgByAcKwMIIAuhoqAgCSAcKwMQIAyhoqAiBkQAAAAAAAAAAGZxDQMCQCAIRAAAAAAAAAAAZQRARAAAAAAAAAAAIQgMAQsgBkQAAAAAAAAAAGRFDQBEAAAAAAAAAAAhBgsgBSAIoSAGoEQAAAAAAAAAAGQgGnIhGiAFIQYLIBtBAWoiG0EDRw0ACyAFIQYgGUEBaiIZQQNHDQALAkAgAisDmAEiCyACKwN4Ig2iIAIrA4ABIgwgAisDkAEiDqKhIgYgBqIgDCACKwOgASIPoiACKwOIASIQIAuioSIIIAiiIBAgDqIgDyANoqEiBCAEoqCgIhFEFlbnnq8D0jxkRQ0AIAErAxAhCSABKwMAIRUgASsDCCEWIAErAyghByABKwMYIRcgASsDICEYIAIgCCAAKwMAIhIgASsDMKGiRAAAAAAAAAAAoCAEIAArAwgiEyABKwM4oaKgIAYgACsDECIUIAErA0ChoqAiCjkDKCACIAggEiAXoaJEAAAAAAAAAACgIAQgEyAYoaKgIAYgFCAHoaKgIgc5AyAgAiAIIBIgFaGiRAAAAAAAAAAAoCAEIBMgFqGioCAGIBQgCaGioCIJOQMYAn8CQCAKRAAAAAAAAAAAZEUgCUQAAAAAAAAAAGRFIAdEAAAAAAAAAABkRXJyRQRAIAogCSAHIAcgCWQiGRtjDQEgGUUMAgsgCkQAAAAAAAAAAGNFIAlEAAAAAAAAAABjRSAHRAAAAAAAAAAAY0Vycg0CIAogCSAHIAcgCWMiGRtkDQAgGUUMAQtBAgshGUEBIRogECAEoiAMIAaioSABIBlBGGxqIhsrAwAiByASoaJEAAAAAAAAAACgIA0gBqIgECAIoqEgGysDCCIJIBOhoqAgDCAIoiANIASioSAbKwMQIgogFKGioEQAAAAAAAAAAGRFDQAgDyAEoiALIAaioSAHIAArAxihokQAAAAAAAAAAKAgDiAGoiAPIAiioSAJIAArAyChoqAgCyAIoiAOIASioSAKIAArAyihoqBEAAAAAAAAAABkRQ0AIAogACsDQKEgCCACKwOwASILoiAEIAIrA6gBIg2ioaIgByAAKwMwoSAEIAIrA7gBIgyiIAYgC6KhokQAAAAAAAAAAKAgCSAAKwM4oSAGIA2iIAggDKKhoqCgRAAAAAAAAAAAZEUNACAKIAYgAkEYakEIQRAgGUEBRhtBACAZG2orAwAiBaIgEaOgIAqhIgYgBqIgByAIIAWiIBGjoCAHoSIGIAaiIAkgBCAFoiARo6AgCaEiBSAFoqCgIQUMAQsCQCACKwNQIgsgAisDMCINoiACKwM4IgwgAisDSCIOoqEiBiAGoiAMIAIrA1giD6IgAisDQCIQIAuioSIIIAiiIBAgDqIgDyANoqEiBCAEoqCgIhFEFlbnnq8D0jxkRQ0AIAArAxAhCSAAKwMAIRUgACsDCCEWIAArAyghByAAKwMYIRcgACsDICEYIAIgCCABKwMAIhIgACsDMKGiRAAAAAAAAAAAoCAEIAErAwgiEyAAKwM4oaKgIAYgASsDECIUIAArA0ChoqAiCjkDKCACIAggEiAXoaJEAAAAAAAAAACgIAQgEyAYoaKgIAYgFCAHoaKgIgc5AyAgAiAIIBIgFaGiRAAAAAAAAAAAoCAEIBMgFqGioCAGIBQgCaGioCIJOQMYAn8CQCAKRAAAAAAAAAAAZEUgCUQAAAAAAAAAAGRFIAdEAAAAAAAAAABkRXJyRQRAIAogCSAHIAcgCWQiGRtjDQEgGUUMAgsgCkQAAAAAAAAAAGNFIAlEAAAAAAAAAABjRSAHRAAAAAAAAAAAY0Vycg0CIAogCSAHIAcgCWMiGRtkDQAgGUUMAQtBAgshGUEBIRogECAEoiAMIAaioSAAIBlBGGxqIgArAwAiByASoaJEAAAAAAAAAACgIA0gBqIgECAIoqEgACsDCCIJIBOhoqAgDCAIoiANIASioSAAKwMQIgogFKGioEQAAAAAAAAAAGRFDQAgDyAEoiALIAaioSAHIAErAxihokQAAAAAAAAAAKAgDiAGoiAPIAiioSAJIAErAyChoqAgCyAIoiAOIASioSAKIAErAyihoqBEAAAAAAAAAABkRQ0AIAogASsDQKEgCCACKwNoIguiIAQgAisDYCINoqGiIAcgASsDMKEgBCACKwNwIgyiIAYgC6KhokQAAAAAAAAAAKAgCSABKwM4oSAGIA2iIAggDKKhoqCgRAAAAAAAAAAAZEUNACAKIAogBiACQRhqQQhBECAZQQFGG0EAIBkbaisDACIFoiARo6ChIgYgBqIgByAHIAggBaIgEaOgoSIGIAaiIAkgCSAEIAWiIBGjoKEiBSAFoqCgIQUMAQsgBUQAAAAAAAAAACAaQQFxGyEFCyACQcABaiQAIAMgBSADKwMAIgYgBSAGYxs5AwAgHkGgAWokAAuQAQECf0EBIQEgACgCTCICBEAgACgCSCIAIAJBGGxqIQIDQCABIAApAwBC////////////AINCgICAgICAgPj/AFQgACkDCEL///////////8Ag0KAgICAgICA+P8AVHEgACkDEEL///////////8Ag0KAgICAgICA+P8AVHFxIQEgAEEYaiIAIAJHDQALCyABC7ICAgt8Bn8gACgCXCIOQQNPBHwgDkEDbiESIAAoAkghDyAAKAJYIQ5BACEAIAFBAUchAQNAIA8gDiAAQQxsaiINKAIEQRhsaiIQKwMAIA8gDSgCAEEYbGoiESsDACIHoSIEIA8gDSgCCEEYbGoiDSsDCCARKwMIIgihIgqiIBArAwggCKEiCyANKwMAIAehIgKioSEGIBArAxAgESsDECIJoSIMIAKiIAQgDSsDECAJoSICoqEhBCALIAKiIAwgCqKhIQIgBSABBHwgCSAGoiAIIASiIAcgAqJEAAAAAAAAAACgoKBEAAAAAAAAGECjBSAGIAaiIAIgAqIgBCAEoqCgn0QAAAAAAADgP6ILIgIgAyADIAKgIgOhoKAhBSAAQQFqIgAgEkcNAAsgBSADoAUgAwsL1QICCX8GfEEBIQECQCAAKAJMIAAoAlwiA0EBdmsgA0EDbmpBfnFBAkcNACADBEAgACgCSCEEIAAoAmghBiAAKAKoASEFIAAoAlghB0EAIQADQAJAIAcgAEECdCICaiIBKAIAIgggAUF4QQQgAEEDb0ECRhtqKAIAIglODQAgBSAAQQNuQRhsaiIBKwMQIQogBSACIAZqKAIAQQNtQRhsaiICKwMQIQsgASsDACIMIAIrAwAiDWIgASsDCCIOIAIrAwgiD2JyRSAKIAthcQ0AIA4gC6IgCiAPoqEgBCAJQRhsaiIBKwMAIAQgCEEYbGoiAisDAKGiRAAAAAAAAAAAoCAKIA2iIAwgC6KhIAErAwggAisDCKGioCAMIA+iIA4gDaKhIAErAxAgAisDEKGioEQAAAAAAAAAAGRFDQMLQQEhASAAQQFqIgAgA0cNAAsLIAEPC0EAC6oBAgN/AXxBFBAjIgIgASgCACIBNgIQAkAgACgCBCIDRQRAIABBBGoiASEEDAELIAErAwghBQNAIAMiASgCECsDCCAFZARAIAEhBCABKAIAIgMNAQwCCyABKAIEIgMNAAsgAUEEaiEECyACIAE2AgggAkIANwIAIAQgAjYCACAAKAIAKAIAIgEEQCAAIAE2AgALIAAoAgQgAhCnASAAIAAoAghBAWo2AgggAgvhAQEFfyMAQTBrIgQkACAEQQA2AiwgBEIANwIkIAEoAgAiBSABKAIEIgdHBEADQCAEQQA2AiAgBEIANwIYIAUoAgAiASAFKAIEIghHBEADQCAEIAEpAwg3AwggBCABKQMANwMAIAQgBjYCECAGQQFqIQYgBEEYaiAEEMQBIAFBEGoiASAIRw0ACwsgBEEkaiAEQRhqEI4FIAQoAhgiAQRAIAQgATYCHCAEKAIgGiABECILIAVBDGoiBSAHRw0ACwsgACAEQSRqIgAgAiADEIgEIAQgADYCACAEECkgBEEwaiQAC6kDAQV/IwBBMGsiBCQAIAQgASACIAMQkQQjAEEQayIFJAAgAEEANgIIIABCADcCACAEKAIEIAQoAgBrQQR1IAQoAgxrQQNuIQEjAEEgayIHJAACQAJAIAAoAgggACgCACIDa0EMbSABSQRAIAFB1qrVqgFPDQEgB0EMaiABIAAoAgQgA2tBDG0gABBhIgEoAgQgACgCBCAAKAIAIghrIgNBdG1BDGxqIQYgAwRAIAYgCCAD/AoAAAsgACgCACEDIAAgBjYCACABIAM2AgQgACABKAIINgIEIAEgAzYCCCAAKAIIIQYgACABKAIMNgIIIAEgAzYCACABIAY2AgwgARDWAQsgB0EgaiQADAELECYACyAEKAIMIgMgBCgCBCAEKAIAIgFrQQR1SQRAA0AgBSABIANBBHRqIgEoAgA2AgQgBSABKAIQNgIIIAUgASgCIDYCDCAAIAVBBGoQnQUgA0EDaiIDIAQoAgQgBCgCACIBa0EEdUkNAAsLIAVBEGokACAEQRhqEMcBIAQoAgAiAARAIAQgADYCBCAEKAIIGiAAECILIARBMGokAAtFAQF/IAAoAgwEQCAAKAIIEMUEIABBADYCCAJAIAAoAgQiAUUNACABQQJ0IgFFDQAgACgCAEEAIAH8CwALIABBADYCDAsLxAECAn8CfCABKAI4IgIgASgCPCIDNgI8IAMgAjYCOCACIAMrAyAgAisDIKEiBCADKwMYIAIrAxihIgUgBaIgBCAEoqCfIgSjRAAAAAAAAAAAIAUgBKMiBL1C////////////AINCgICAgICAgPj/AFQiAxs5AzAgAiAERAAAAAAAAAAAIAMbOQMoAkAgASgCOCgCACICIAEoAgAiA0YNACADIAEoAjwoAgAiAUYgASACRnINACAAQcgAaiACIAMgARCOBAsLZQECfwJAIAEoAgQiA0UEQCABIQIDQCACIAIoAggiAigCAEcNAAsMAQsDQCADIgIoAgAiAw0ACwsgASAAKAIARgRAIAAgAjYCAAsgACAAKAIIQQFrNgIIIAAoAgQgARDEBCABECILWgEDfyAAKAIIIAFJBEAgAUEYbBAnIQQgACgCACECAkAgACgCBCIDRQ0AIANBGGxBBGsiA0UNACAEIAIgA/wKAAALIAIEQCACECILIAAgATYCCCAAIAQ2AgALC74BAQR/IAAQiQQgASgCACEDIAFBADYCACAAKAIAIQIgACADNgIAIAIEQCAAKAIEGiACECILIAAgASgCBDYCBCABQQA2AgQgACABKAIMIgI2AgwgACABKgIQOAIQIAAgASgCCCIDNgIIIAIEQCAAQQhqIQQgAygCBCECAkAgACgCBCIDIANBAWsiBXFFBEAgAiAFcSECDAELIAIgA0kNACACIANwIQILIAAoAgAgAkECdGogBDYCACABQgA3AggLCx0AIAAgASACEIoCIAAgAiADEIoCIAAgAyABEIoCCyoAIAAgACgCDCABQQNsahBcIABBGGogACgCJCABarMgACoCKJWN/AEQcAv+AQEFfyABKAIAIgMgASgCBCIFRwRAA0AgAygCBCADKAIAa0EYbSACaiECIANBDGoiAyAFRw0ACwsgACAAKAIEIAAoAgBrQQR1IAJqEFwgAEEYaiAAKAIkIAJqsyAAKgIolY38ARBwIAEoAgAiBCABKAIEIgZHBEADQCAEKAIEIgEgBCgCACICRwRAIAEgAmtBGG0hAUEAIQMDQCAAIAIgA0EBaiIFQQAgASAFSxtBGGxqKAIQIAIgA0EYbGooAhAQigIgBCgCBCAEKAIAIgJrQRhtIgEgBSIDSw0ACwsgBEEMaiIEIAZHDQALCyAAIAAoAgQgACgCAGtBBHU2AgwLmTYEEn8OfAJ+An0jAEGQAmsiBCQAIABCADcDCCAAQgA3AwAgAEIANwMYIABCgICAgICAgPi/fzcDECAAQgA3AyAgAEGAgID8AzYCKCAAQRhqIRIgASgCACEIAkACQCADRQRAIAEoAgQhCgwBCwJAIAEoAgQiCiAIRwRAIAghCQNAIAkoAgQiAyAJKAIAIgZrQRhtIQcgAyAGRwRAIAYrAwAgA0EYaysDAKEiGyAbIBuiIAYrAwggA0EQaysDAKEiHCAcoqCfIhajIRkgHCAWoyEYQQAhBQNAIBshFiAcIRcgByAFQQFqIgNLBEAgBiADQRhsaiIMKwMIIAYgBUEYbGoiBSsDCKEhFyAMKwMAIAUrAwChIRYLIBkgF6IgGCAWoqEiGkQAAAAAAAAAAGUNBSACIBqZZARAIBkgFqJEAAAAAAAAAACgIBggF6KgRAAAAAAAAAAAYw0GCyAXIBYgFqIgFyAXoqCfIhejIRggFiAXoyEZIAMiBSAHRw0ACwsgCUEMaiIJIApHDQALQQAhAwNAIAMgCCgCBCAIKAIAa0EYbWpBAmshAyAIQQxqIgggCkcNAAsMAQtBACEDCyAEQgA3AxAgBEIANwMIIARCADcDICAEQoCAgICAgID4v383AxggBEIANwMoIARBgICA/AM2AjAgBEEIaiIFIAEQkAQgBSADEI8EIAEoAgAiCCABKAIEIgxHBEADQCAIKAIEIAgoAgBrQRhtQQFrIgNBAk8EQEEAIQVBASEGQQEhBwNAIARBCGogCCgCACIBIAVBGGxqKAIQIAEgBiADQQFrIgsgB0EBcSIJG0EYbGooAhAgASADQRhsaigCEBCOBCAHQQFzIQcgBiAFIAkbIgVBAWoiBiADIAsgCRsiA0kNAAsLIAhBDGoiCCAMRw0ACwsgABBFIAAgBCgCCDYCACAAIAQoAgw2AgQgACAEKAIQNgIIIARBADYCECAEQgA3AwggACAEKAIcNgIUIAAgBCkCFDcCDCASIARBIGoiARCNBCABEMcBIAQoAggiAUUNASAEIAE2AgwgBCgCEBogARAiDAELIARCADcDGEEAIQkgBEEANgIQIARCADcDCCAEQgA3AjwgBEIANwMgIARCADcDKCAEQgA3AzAgBEIANwNIIARCADcDUCAEQgA3A1ggBEKAgICAgICA+L9/NwNgIARCADcDaCAEQgA3A3AgBEGAgID8AzYCeCAEQoCAgICAgID4/wA3A4ABIARCgICAgICAgPj/ADcDiAEgBEKAgICAgICAeDcDkAEgBEKAgICAgICAeDcDmAEgBCACOQOgASAEIARBGGoiDTYCFCAEIARBPGoiDDYCOCAEIARByABqIg82AkRBACEFIAggCkcEQCAIIQMDQCADKAIEIAMoAgBrQRhtIAVqIQUgA0EMaiIDIApHDQALCwJAAkAgBSAKIAhrQQxtQQF0aiIDBEAgA0GAgIAgTw0BIAQgBEEIajYCuAEgBCADQQZ0IgUQIyIDNgIIIAQgAzYCDCAEQgA3ArABIARCADcCqAEgBCADIAVqNgIQIARBqAFqEKkCIAEoAgQhCiABKAIAIQggBCgCCCEJCyAEQQA2AvwBIARCADcC9AEgCCAKRwRAA0AgCCgCACIFKAIQIQMgBCAPNgK4ASAEQgA3A7ABIAQgAzYCqAEgBCAFKQMINwPIASAEIAUpAwA3A8ABIARCADcD2AEgBEIANwPQASAEIAk2AuQBIAQgCTYC4AEgBEEIaiAEQagBahCMAiAEIAQoAgwiDkFAaiILNgKEAiAOQSBrIhArAwAhAiAEIAQrA4ABIhcgDkEoayIRKwMAIhYgFiAXZBs5A4ABIAQgAiAEKwOYASIXIAIgF2QbOQOYASAEIBYgBCsDkAEiFyAWIBdkGzkDkAEgBCAEKwOIASIWIAIgAiAWZBs5A4gBIARB9AFqIARBhAJqEL0BIAshByAFQRhqIgYgCCgCBEcEQANAIAUrAxghAiAEIAQrA4gBIhcgBSsDICIWIBYgF2QbOQOIASAEIAQrA4ABIhcgAiACIBdkGzkDgAEgBCACIAQrA5ABIhcgAiAXZBs5A5ABIAQgFiAEKwOYASICIAIgFmMbOQOYASAFKAIoIQMgBCAPNgK4ASAEQgA3A7ABIAQgAzYCqAEgBCAGIgUpAwg3A8gBIAQgBSkDADcDwAEgBEIANwPYASAEQgA3A9ABIAQgCTYC5AEgBCAJNgLgASAEQQhqIARBqAFqEIwCIAciAyAEKAIMIgZBQGoiBzYCPCAGQQhrIAM2AgAgAyAGQSBrKwMAIAMrAyChIgIgBkEoaysDACADKwMYoSIWIBaiIAIgAqKgnyICo0QAAAAAAAAAACAWIAKjIgK9Qv///////////wCDQoCAgICAgID4/wBUIgYbOQMwIAMgAkQAAAAAAAAAACAGGzkDKCAFQRhqIgYgCCgCBEcNAAsLIAcgCzYCPCAOQQhrIAc2AgAgByAQKwMAIAcrAyChIgIgESsDACAHKwMYoSIWIBaiIAIgAqKgnyICo0QAAAAAAAAAACAWIAKjIgK9Qv///////////wCDQoCAgICAgID4/wBUIgMbOQMwIAcgAkQAAAAAAAAAACADGzkDKCAIQQxqIgggCkcNAAsLIARB0ABqIQ4gBCsDoAFEAAAAAAAAAABjBEAgBCAEKwOYAZkiAiAEKwOIAZkiFiACIBZkGyICIAQrA5ABmSIWIAQrA4ABmSIXIBYgF2QbIhYgAiAWZBtEEeotgZmXcT2iOQOgAQsgDiABEJAEIA4gBCgC+AEiCyAEKAL0ASIIa0EBdSAEKAIMIAQoAghrQQZ1ahCPBCAEKAIIIgMgBCgCDEcEQANAIARBCGogAxC8ASADQUBrIgMgBCgCDEcNAAsLIARBLGohECAIIAtGDQEgBEEgaiERIAghAQNAIAEoAgAiCSsDICEeIAkrAxghH0QAAAAAAAAAACEXRAAAAAAAAPD/IRtEAAAAAAAA8H8hGSAEKwOgASEgRAAAAAAAAPB/IRhEAAAAAAAA8P8hHEQAAAAAAADw/yECRAAAAAAAAAAAIRogCSIHIQMCQANAAkACQAJAIAMgAygCPCIGKAI4IgVHBEAgBSgCPCIGKAI4IAVHDQIgBiAFKAI4IgpGDQUgGiAFKwMYIhYgH6EgBisDICAeoaIgBSsDICIdIB6hIAYrAxggH6GioSIaIBcgFyAaoCIXoaCgIRogHSACIAIgHWMbIQIgFiAcIBYgHGQbIRwgGSAdIBkgHWMbIRkgGCAWIBYgGGQbIRggFiAbZEUEQCAFIQcgBSEDDAQLIAUiAyEHIAogCigCPCAgQQEQnQFFDQEMAwsgBiADKAI4IgpGDQQgGiADKwMYIhYgH6EgBisDICAeoaIgAysDICIdIB6hIAYrAxggH6GioSIaIBcgFyAaoCIXoaCgIRogHSACIAIgHWMbIQIgFiAcIBYgHGQbIRwgGSAdIBkgHWMbIRkgGCAWIBYgGGQbIRggFiAbZEUNAiAHIQUgCiAKKAI8ICBBARCdAQ0CCyADIQkgFiEbCyAFIQcLIAcgAygCPCIDRw0ACyAEIAk2AqgBIAcgBCgCDEYNACAXIBqgIhYgICACIBmhIhcgHCAYoSIaIBcgGmQboiIXmmNFIBu9Qv///////////wCDQv/////////3/wBWckUEQEEUECMiByAJNgIQIA0iAyEGAkAgBCgCGCIFRQ0AIAkrAxghFgNAIAUiAygCECsDGCAWYwRAIAMhBiADKAIAIgUNAQwCCyADKAIEIgUNAAsgA0EEaiEGCyAHIAM2AgggB0IANwIAIAYgBzYCACAEKAIUKAIAIgMEQCAEIAM2AhQLIAQoAhggBxCnASAEIAQoAhxBAWo2AhwgDCIGIQMCQCAEKAI8IgVFDQADQCAJIAUiAygCECIFSQRAIAMhBiADKAIAIgUNAQwCCyAFIAlPDQMgAygCBCIFDQALIANBBGohBgtBOBAjIgUgAjkDMCAFIBw5AyggBSAZOQMgIAUgGDkDGCAFIAk2AhAgBSADNgIIIAVCADcDACAGIAU2AgAgBCgCOCgCACIDBEAgBCADNgI4CyAEKAI8IAUQpwEgBCAEKAJAQQFqNgJADAELIBAgBEGoAWoiAxC9ASAWIBdkRQ0AIBEgAxC9AQsgAUEEaiIBIAtHDQALDAELECYACyAIBEAgBCgC/AEaIAgQIgsgDSAEKAIUIghHBEADQCAEIAgoAhAiCjYCqAEgDCIGIQMCQAJAIAQoAjwiBUUNAANAIAUiAygCECIBIApLBEAgAyEGIAMoAgAiBQ0BDAILIAEgCk8NAiADKAIEIgUNAAsgA0EEaiEGC0E4ECMiBUKAgICAgICAeDcDMCAFQoCAgICAgIB4NwMoIAVCgICAgICAgPj/ADcDICAFQoCAgICAgID4/wA3AxggBSAKNgIQIAUgAzYCCCAFQgA3AwAgBiAFNgIAIAQoAjgoAgAiAQRAIAQgATYCOAsgBCgCPCAFEKcBIAQgBCgCQEEBajYCQAsCQAJAIAQoAiAiCyAEKAIkIhFHBEAgCisDICIXIAUrAzAgBCsDoAEiAqFmIhRBf3MgFyAFKwMgIAKgZXEhFSAXIAKhIRwgFyACoCEZIAshASAEKAIMIhMhCQNAIAEoAgAiByEFA0ACQAJAAkAgBSAFKAI8IgYoAjgiA0cEQCADIAMoAjwiBigCOEcEQCADIQcgBSEDDAMLIAMhByAGIAMoAjhHDQEMAwsgBiAFIgMoAjhGDQILAkAgAiADKwMgIhsgF6GZZgRARAAAAAAAAPh/RAAAAAAAAPh/IAMrAxggBisDICAZZRsgFBshFgwBC0QAAAAAAAD4fyEWIBsgHGNFDQAgGSAGKwMgIhhjBEAgAysDGCIWIBcgG6EgBisDGCAWoaIgGCAboaOgIRYMAQsgFSAYIBxjcg0AIAYrAxghFgsgFr1C////////////AINC//////////f/AFYNACAKIAMgAkEBEJ0BRQ0AAkAgCSATRg0AIAkrAxggFqEiGCAJKAI8IgUrAyAgF6EiGqIgCSsDICIdIBehIh4gBSsDGCAWoSIWoqEiH0QAAAAAAAAAAGQEQCAfIB+iRAAAAAAAABBAoiACIAIgFiAWoiAaIBqioCIWIBggGKIgHiAeoqAiGCAWIBhkG6KiZUUNAQsgGyAdZARAIAMgCSACQQAQnQENAQwCCyAJIAMgAkEAEJ0BDQELIAMhCQsgByADKAI8IgVHDQELCyABQQRqIgEgEUcNAAsgCSATRw0BCyAQIARBqAFqEL0BDAELAn8gCisDGCIWIAkrAxhkBEAgCSgCPAwBCyAJIAkoAjwiASsDGCAWYw0AGiAJIAErAyAgF6EgFyAJKwMgoWQNABogAQsiASsDICIbIBehmSACZUUEQCAWIAKhIR0gF0QAAAAAAADwP0QAAAAAAADwvyAXIBtjGyIboiACoSEgA0AgCygCACIGIQUDQAJAAkACQCAFIAUoAjwiBygCOCIDRwRAIAMgAygCPCIHKAI4RwRAIAMhBiAFIQMMAwsgAyEGIAcgAygCOCIFRw0BDAMLIAcgBSIDKAI4IgVGDQILIAMrAxgiHCAdZEUNACAbIAMrAyAiGqIiISAgZEUNACAbRAAAAAAAAAAARAAAAAAAAPA/RAAAAAAAAPC/IBwgFqEiGSABKwMgIiIgF6EiGKIgGiAXoSIaIAErAxgiIyAWoSIeoqEiH0QAAAAAAAAAAGQbIB8gH6JEAAAAAAAAEECiIAIgAiAeIB6iIBggGKKgIhggGSAZoiAaIBqioCIZIBggGWQboqJlG6IiGUQAAAAAAAAAAGRFBEAgISAbICKiY0UgHCAjY0UgGUQAAAAAAAAAAGJycg0BCyADIAkgAkEBEJ0BRQ0AIAEgAyAFIAUoAjwgAkEBEJ0BGyEBCyAGIAMoAjwiBUcNAQsLIAtBBGoiCyARRw0ACwsgBEEIaiIFIAoQjAIgBCgCDCEGIAUgARCMAiAEKAIMIQMgCigCPCAGQUBqIgk2AjggASgCOCADQUBqIgc2AjwgCiABNgI8IAEgCjYCOCAKIAErAyAgCisDIKEiAiABKwMYIAorAxihIhYgFqIgAiACoqCfIgKjRAAAAAAAAAAAIBYgAqMiAr1C////////////AINCgICAgICAgPj/AFQiCxs5AzAgCiACRAAAAAAAAAAAIAsbOQMoIANBBGsgCTYCACAGQQhrIAc2AgAgA0EQayAGQSBrKwMAIANBIGsrAwChIgIgBkEoaysDACADQShrKwMAoSIWIBaiIAIgAqKgnyICo0QAAAAAAAAAACAWIAKjIgK9Qv///////////wCDQoCAgICAgID4/wBUIgYbOQMAIANBGGsgAkQAAAAAAAAAACAGGzkDACAFIAoQvAEgBSAJELwBIAUgARC8ASAFIAcQvAELAkAgCCgCBCIDBEADQCADIggoAgAiAw0ADAILAAsDQCAIIAgoAggiCCgCAEcNAAsLIAggDUcNAAsLIAQoAiwiASAEKAIwIgtHBEAgBEHEAGohDQNAIAEoAgAhCSAEQQA2AowCIARCADcChAIgBEEANgL8ASAEQgA3AvQBIAkiBiEFA0ACQAJAAkAgBSAFKAI8IgcoAjgiA0cEQCADIAMoAjwiBigCOEcEQCADIQYMAgsgBiADKAI4Rg0DIAQoAogCIAQoAoQCa0ECdSEFIAQgAzYC7AECQCAEKAL4ASIGIAQoAvwBIgdPBEAgBCADKQMgNwOwASAEIAMpAxg3A6gBIARB9AFqIAdBAXRBgAEgBxsQjAQgBCAEKAL4ASIGQQFqNgL4ASAEKQOoASEkIAQpA7ABISUgBCgC9AEgBkEYbGoiBiAFNgIQIAYgJTcDCCAGICQ3AwAMAQsgBCAGQQFqNgL4ASADKQMYISQgBCgC9AEgBkEYbGoiBiADKQMgNwMIIAYgJDcDACAGIAU2AhALIARBhAJqIARB7AFqEL0BIAMhBgwCCyAHIAUoAjhGDQIgBCgCiAIgBCgChAJrQQJ1IQMgBCAFNgLsAQJAIAQoAvgBIgcgBCgC/AEiCE8EQCAEIAUpAyA3A7ABIAQgBSkDGDcDqAEgBEH0AWogCEEBdEGAASAIGxCMBCAEIAQoAvgBIgdBAWo2AvgBIAQpA6gBISQgBCkDsAEhJSAEKAL0ASAHQRhsaiIHIAM2AhAgByAlNwMIIAcgJDcDAAwBCyAEIAdBAWo2AvgBIAUpAxghJCAEKAL0ASAHQRhsaiIHIAUpAyA3AwggByAkNwMAIAcgAzYCEAsgBEGEAmogBEHsAWoQvQELIAUhAwsgBiADKAI8IgVHDQELCyAEIAQpAvQBNwLsASMAQRBrIgMkACAEKALwASIFQQlPBEAgBCgC7AEhBiADIAU2AgwgAyAGNgIIIANBCGpBARDJAgsgA0EQaiQAIAQgBCgC9AEiCDYCqAEgBCAEKQL4ATcCrAEgBCAEKAKEAiIHNgK4ASAEIAQoAogCIgM2ArwBIAQgBCgCjAI2AsABAkAgAyAHRg0AIAQoAkgQiwIgBCAPNgJEIARCADcDSEF+IQYgCSEDA0ACfwJAIAMgAygCPCIMKAI4IgVHBEAgBSAFKAI8IgMoAjhHBEAgBSEJIAwMAwsgBSEJIAMgBSgCOEcNAQwECyADIQUgDCADKAI4Rg0DCyAGQQFqIQYgBEEIaiAFIARBqAFqEOACIAUoAjwLIgMgCUcNAAsgAyAEKAIMRiAGQQBMcg0AA0AgDyAEKAJEIgVHBEAgBSgCECEDIA0gBRCLBAsgBEEIaiIFIAMQigQgBSADKAI4IARBqAFqIgkQ4AIgBSADKAI8IAkQ4AIgBkEBSiADKAI8IQMgBkEBayEGDQALCyAHBEAgBxAiCyAIBEAgCBAiCyABQQRqIgEgC0cNAAsLIARBqAFqIA4QPCILIAQoAmQ2AhQgCyAEKQJcNwIMIwBBEGsiDSQAIAtBGGoiAUIANwIIIAFCADcCACABIARB6ABqIg8iAyoCEDgCECABIAMoAgQQcCADKAIIIgYEQANAQQAhBSMAQRBrIgokACAKIAZBCGoiCSkDACIkNwMIIApBCGpBCBD3ASEDIA0CfwJAIAEoAgQiB0UNACABKAIAAn8gB0EBayADcSAHaSIMQQFNDQAaIAMgAyAHSQ0AGiADIAdwCyIFQQJ0aigCACIIRQ0AIAgoAgAiCEUNACAHQQFrIQ4gDEEBSyEQA0ACQCADIAgoAgQiDEcEQAJAIBBFBEAgDCAOcSEMDAELIAcgDEsNACAMIAdwIQwLIAUgDEcNAwwBCyAIKQMIICRSDQBBAAwDCyAIKAIAIggNAAsLQSAQIyIIIAM2AgQgCEEANgIAIAggCSkDADcDCCAIQRBqIAlBCGoQYBoCQEEAIAcgASgCDEEBarMiJiABKgIQIicgB7OUXhsNACABIAcgB0EBa3FBAEcgB0EDSXIgB0EBdHIiBSAmICeVjfwBIgkgBSAJSxsQcCABKAIEIgcgB0EBayIFcUUEQCADIAVxIQUMAQsgAyAHSQRAIAMhBQwBCyADIAdwIQULAkAgASgCACIJIAVBAnRqIgUoAgAiA0UEQCAIIAEoAgg2AgAgASAINgIIIAUgAUEIajYCACAIKAIAIgNFDQEgAygCBCEMAkAgByAHQQFrIgNxRQRAIAMgDHEhDAwBCyAHIAxLDQAgDCAHcCEMCyAJIAxBAnRqIAg2AgAMAQsgCCADKAIANgIAIAMgCDYCAAsgASABKAIMQQFqNgIMQQELOgAMIA0gCDYCCCAKQRBqJAAgBigCACIGDQALCyANQRBqJAAgABBFIAAgCygCADYCACAAIAsoAgQ2AgQgACALKAIINgIIIAtBADYCCCALQgA3AwAgACALKAIUNgIUIAAgCykCDDcCDCASIAEQjQQgARDHASALKAIAIgEEQCALIAE2AgQgCygCCBogARAiCyAEKwOgASECIA8QxwEgBCgCUCIBBEAgBCABNgJUIAQoAlgaIAEQIgsgBCgCSBCLAiAEKAI8EN8CIAQoAiwiAQRAIAQgATYCMCAEKAI0GiABECILIAQoAiAiAQRAIAQgATYCJCAEKAIoGiABECILIAQoAhgQ3gIgBCgCCCIBRQ0AIAQgATYCDCAEKAIQGiABECILIAAgAjkDECASEIkEIBJBABBwIARBkAJqJAALiwEBA38jAEEQayICJABBqAIQIyIBQaCQAjYCACABQgA3AgQgAUEQahA7IQMgAUEONgJUIAIgATYCDCACIAM2AgggASABKAIEQQFqNgIEIAIgAikCCDcDACAAIAIQSBogASABKAIEIgBBAWs2AgQgAEUEQCABIAEoAgAoAggRAAAgARAkCyACQRBqJAALwgEBA38jAEEgayIEJAACQCAAKAIIIAAoAgAiAmtBGG0gAUkEQCABQavVqtUATw0BIARBDGogASAAKAIEIAJrQRhtIAAQZCEBIAAoAgAiAiAAKAIEIgMgASgCBCADIAJrQWhtQRhsaiIDEKUCIAAoAgAhAiAAIAM2AgAgASACNgIEIAAgASgCCDYCBCABIAI2AgggACgCCCEDIAAgASgCDDYCCCABIAI2AgAgASADNgIMIAEQpAILIARBIGokAA8LECYAC4whAxJ/FXwBfiMAQZADayIFJAACQAJAAkAgBEUNACAELQAQQQFHDQBBqAIQIyIBQaCQAjYCACABQgA3AgQgAUEQahA7IQIgAUEONgJUIAUgATYCjAEgBSACNgKIASABIAEoAgRBAWo2AgQgBSAFKQKIATcDKCAAIAVBKGoQSBogASABKAIEIgBBAWs2AgQgAA0BIAEgASgCACgCCBEAACABECQMAQsgARCFBCEHAn8gAhCFBCILIAdFckUEQCABIQZBAQwBCyACIQYgASECIAchCSALCyEMIAYoAlxBAk0EQEGoAhAjIgFBoJACNgIAIAFCADcCBCABQRBqIAIQNyECIAUgATYChAEgBSACNgKAASABIAEoAgRBAWo2AgQgBSAFKQKAATcDACAAIAUQSBogASABKAIEIgBBAWs2AgQgAA0BIAEgASgCACgCCBEAACABECQMAQsgAigCXCEIQagCECMiD0GgkAI2AgAgD0IANwIEIA9BEGohAQJAIAhBAk0EQCABIAYQNyEBIAUgDzYCfCAFIAE2AnggDyAPKAIEQQFqNgIEIAUgBSkCeDcDCCAAIAVBCGoQSBoMAQsgASACEDchASAFIA82AlwgBSABNgJYIA8gDygCBEEBajYCBCAFIAUpAlg3AyAgBUHgAGogBUEgahBIIRMgBUEANgJUIAVCADcCTCAFQcwAaiIBIAIoAlxBA25B5wdqQegHbkEBahCTBCABAn8gASgCBCIIIAEoAghJBEAgCCATEC5BGGoMAQsjAEEgayINJAAgASgCBCABKAIAIgprQRhtIg5BAWoiCEGr1arVAE8EQBAmAAsgDUEMakGq1arVACABKAIIIAprQRhtIgpBAXQiECAIIAggEEkbIApB1arVKk8bIA4gARBkIggoAgggExAuGiAIIAgoAghBGGo2AgggASgCACIKIAEoAgQiDiAIKAIEIA4gCmtBaG1BGGxqIg4QpQIgASgCACEKIAEgDjYCACAIIAo2AgQgASAIKAIIIg42AgQgCCAKNgIIIAEoAgghECABIAgoAgw2AgggCCAKNgIAIAggEDYCDCAIEKQCIA1BIGokACAOCzYCBAJAAkACQCAMIAkgA0EBc3EiAXFBAUYEQCAGKAJIIQggBigCTCEKIAVBADYCgAMgBUIANwL4AiAKIAIoAkxsIQYjAEEgayIJJAACQAJAIAVB+AJqIgEoAgggASgCACIHa0EYbSAGSQRAIAZBq9Wq1QBPDQEgCUEMaiAGIAEoAgQgB2tBGG0gARBkIgYoAgQgASgCBCABKAIAIgxrIgdBaG1BGGxqIQsgBwRAIAsgDCAH/AoAAAsgASgCACEHIAEgCzYCACAGIAc2AgQgASAGKAIINgIEIAYgBzYCCCABKAIIIQsgASAGKAIMNgIIIAYgBzYCACAGIAs2AgwgBhCMAQsgCUEgaiQADAELECYACyACKAJMIgFFDQEgAigCSCIJIAFBGGxqIQ0gCCAKQRhsIgtqIQ4DQAJAIApFDQAgCSsDECEZIAkrAwghGiAJKwMAIRsgCCEHAkAgBSgCgAMiBiAFKAL8AiIBayALSARAIAEgBSgC+AIiB2tBGG0iDCAKaiICQavVqtUASQ0BDAoLA0AgBysDACEXIAcrAwghGCABIBkgBysDEKA5AxAgASAaIBigOQMIIAEgGyAXoDkDACABQRhqIQEgB0EYaiIHIA5HDQALIAUgATYC/AIMAQsgBUGIAWpBqtWq1QAgBiAHa0EYbSIGQQF0IgcgAiACIAdJGyAGQdWq1SpPGyAMIAVB+AJqEGQhDCAFKAKQASIHIAtqIQIgCCEGA0AgBisDACEXIAYrAwghGCAHIBkgBisDEKA5AxAgByAaIBigOQMIIAcgGyAXoDkDACAGQRhqIQYgB0EYaiIHIAJHDQALIAUgAjYCkAEgBSgC/AIgAWsiBgRAIAIgASAG/AoAAAsgBSgC/AIhAiAFIAE2AvwCIAUgBSgCkAEgAiABa2o2ApABIAUoAowBIAEgBSgC+AIiBmsiAUFobUEYbGohAiABBEAgAiAGIAH8CgAACyAFIAUoAvgCIgE2AowBIAUgAjYC+AIgBSkCkAEhLCAFIAE2ApABIAUoAoADIQIgBSAsNwL8AiAFIAI2ApQBIAwgATYCACAMEIwBCyAJQRhqIgkgDUcNAAsMAQsgDCABQQFzcUEBRgRAIAIoAlwiAUEDbiEOIAFBA0kNAiAGKAJIIgggBigCTCIQQRhsIhFqIRRBACEKA0ACQCAERQ0AIAQtABBBAUcNACAAEJIEDAULIAVBQGtB6AcgDiAKayIBIAFB6AdPGyIVEJEDIQxBACELA0AgBUEANgKAAyAFQgA3AvgCIAVBAjYC9AIgBUKAgICAEDcC7AIgCiALakEMbCEWQQAhCQNAAkAgEEUNACACKAJIIAIoAlggFmogBUHsAmogCWooAgBBAnRqKAIAQRhsaiIBKwMQIRkgASsDCCEaIAErAwAhGyAIIQcgBSgCgAMiDSAFKAL8AiIBayARTgRAA0AgBysDACEXIAcrAwghGCABIBkgBysDEKA5AxAgASAaIBigOQMIIAEgGyAXoDkDACABQRhqIQEgB0EYaiIHIBRHDQALIAUgATYC/AIMAQsgASAFKAL4AiIHa0EYbSISIBBqIgZBq9Wq1QBPDQogBUGIAWpBqtWq1QAgDSAHa0EYbSIHQQF0Ig0gBiAGIA1JGyAHQdWq1SpPGyASIAVB+AJqEGQhEiAFKAKQASIHIBFqIQ0gCCEGA0AgBisDACEXIAYrAwghGCAHIBkgBisDEKA5AxAgByAaIBigOQMIIAcgGyAXoDkDACAGQRhqIQYgB0EYaiIHIA1HDQALIAUgDTYCkAEgBSgC/AIgAWsiBgRAIA0gASAG/AoAAAsgBSgC/AIhBiAFIAE2AvwCIAUgBSgCkAEgBiABa2o2ApABIAUoAowBIAEgBSgC+AIiB2siAUFobUEYbGohBiABBEAgBiAHIAH8CgAACyAFIAUoAvgCIgE2AowBIAUgBjYC+AIgBSkCkAEhLCAFIAE2ApABIAUoAoADIQYgBSAsNwL8AiAFIAY2ApQBIBIgATYCACASEIwBCyAJQQRqIglBDEcNAAsgBUGIAWoiASAFQfgCahCOAiAMKAIAIAtBGGxqIAEQwQEaIAEQKBogBSgC+AIiAQRAIAUgATYC/AIgBSgCgAMaIAEQIgsgC0EBaiILIBVHDQALIAVBiAFqIgEgDEEAEIgBIAEgBBArGiAFQcwAaiABEJgBIAEQKBogBSAMNgKIASABEHogCkHoB2oiCiAOSQ0ACwwCCyAHIAtyDQEgBigCXCEBIAIoAlwhByAFQQA2AkggBUIANwJAIAVBQGtByAEgB0EDbiIMIAxByAFPGxCTBCABQQNuIQ0CQCAHQQNPBEAgAUEDSSEOQQAhBwNAIAQEQCAELQAQDQMLIAIoAqgBIAdBGGxqIgErAxAhKSABKwMIISogASsDACErIAIoAkgiASACKAJYIAdBDGxqIggoAgBBGGxqIgkrAxAhGSAJKwMIIRogCSsDACEbIAEgCCgCCEEYbGoiCSsDECEXIAkrAwghGCAJKwMAIR8gASAIKAIEQRhsaiIBKwMQISAgASsDCCEhIAErAwAhIkEAIQEgBUE0aiANEJEDIQsgDkUEQANAAkAgKyABQRhsIhAgBigCqAFqIggrAwCiIhxEAAAAAAAAAACgICogCCsDCKIiHaAgKSAIKwMQoiIeoEQAAAAAAADwv6CZRBHqLYGZl3E9Y0QAAAAAAAAAACAcoSAdoSAeoUQAAAAAAADwv6CZRBHqLYGZl3E9Y3INACAGKAJIIgggBigCWCABQQxsaiIJKAIAQRhsaiIKKwMAIRwgCisDCCEdIAorAxAhHiAIIAkoAgRBGGxqIgorAwAhIyAKKwMIISQgCisDECElIAggCSgCCEEYbGoiCCsDACEmIAgrAwghJyAFIBcgCCsDECIooDkD2AIgBSAYICegOQPQAiAFIB8gJqA5A8gCIAUgFyAloDkDwAIgBSAYICSgOQO4AiAFIB8gI6A5A7ACIAUgFyAeoDkDqAIgBSAYIB2gOQOgAiAFIB8gHKA5A5gCIAUgICAooDkDkAIgBSAhICegOQOIAiAFICIgJqA5A4ACIAUgICAloDkD+AEgBSAhICSgOQPwASAFICIgI6A5A+gBIAUgICAeoDkD4AEgBSAhIB2gOQPYASAFICIgHKA5A9ABIAUgGSAooDkDyAEgBSAaICegOQPAASAFIBsgJqA5A7gBIAUgGSAloDkDsAEgBSAaICSgOQOoASAFIBsgI6A5A6ABIAUgGSAeoDkDmAEgBSAaIB2gOQOQASAFIBsgHKA5A4gBIAVBCTYC6AIgBSAFQYgBajYC5AIgBSAFKQLkAjcDGCAFQewCaiIIQQA2AgggCEIANwIAIAUoAhwiCQRAIAUoAhgiCiAJQRhsaiERIAggCRDyASAIKAIEIQkDQCAJIAopAxA3AxAgCSAKKQMINwMIIAkgCikDADcDACAJQRhqIQkgCkEYaiIKIBFHDQALIAggCTYCBAsgBUH4AmoiCSAIEI4CIAsoAgAgEGogCRDBARogCRAoGiAIKAIAIghFDQAgBSAINgLwAiAFKAL0AhogCBAiCyABQQFqIgEgDUcNAAsLIAVBADYCgAMgBUIANwL4AgJAIAsoAgAiASAFKAI4IghGDQADQCABEMABRQRAIAVB+AJqIAEQmAELIAFBGGoiASAIRw0ACyAFKAL4AiAFKAL8AkYNACAFQYgBaiIBIAVB+AJqQQAQiAEgASAEECsaIAVBQGsgARCYASABECgaCyAFKAJEIAUoAkBrQRhtQcgBTwRAIAVBiAFqIgEgBUFAa0EAEIgBIAEgBBArGiAFKAJAIgggBSgCRCIBRwRAA0AgCCABQRhrECgiAUcNAAsLIAUgCDYCRCAFQUBrIAVBiAFqIgEQmAEgARAoGgsgBSAFQfgCajYCiAEgBUGIAWoiARB6IAUgCzYCiAEgARB6IAdBAWoiByAMRw0ACwsgBSgCQCAFKAJERwRAIAVBiAFqIgEgBUFAa0EAEIgBIAEgBBArGiAFQcwAaiABEJgBIAEQKBoLIAUgBUFAazYCiAEgBUGIAWoQegwCCyAAEJIEIAUgBUFAazYCiAEgBUGIAWoQegwCCyAFQYgBaiIBIAVB+AJqEI4CIAVBzABqIAEQmAEgARAoGiAFKAL4AiIBRQ0AIAUgATYC/AIgBSgCgAMaIAEQIgsCQCAERQ0AIAQtABBBAUcNAEGoAhAjIgFBoJACNgIAIAFCADcCBCABQRBqEDshAiABQQ42AlQgBSABNgKMASAFIAI2AogBIAEgASgCBEEBajYCBCAFIAUpAogBNwMQIAAgBUEQahBIGiABIAEoAgQiAEEBazYCBCAADQEgASABKAIAKAIIEQAAIAEQJAwBCyAFQYgBaiIBIAVBzABqIAMQiAEgASAEECsaIAAgARCPAiABECgaCyAFIAVBzABqNgKIASAFQYgBahB6IBMQKBoLIA8gDygCBCIAQQFrNgIEIAANACAPIA8oAgAoAggRAAAgDxAkCyAFQZADaiQADwsQJgAL8QEBBH8CQAJAAkACQAJAIAMOAwMAAQILIAQgACgCADYCAA8LAkAgAigCACICIAFBBGsiASgCACIDQQR0aiIFKAIEIgYgAiAAKAIAIgdBBHRqIgIoAgQiCEYEQCAFKAIAIAIoAgBIDQEMBAsgBiAITg0DCyAEIAM2AgAgBCAAKAIANgIEDwsgA0EITARAIAAgASAEIAIQqAQPCyAAIAAgA0EBdiIFQQJ0IgdqIgYgAiAFIAQgBRC+ASAGIAEgAiADIAVrIgMgBCAHaiADEL4BIAAgBiAGIAEgBCACEJECCw8LIAQgBzYCACAEIAEoAgA2AgQL8Q8DBH8KfAJ+IwBBkAJrIgQkACACKwMQIQkgAisDACEIIAIrAwghCiAEQoCAgICAgICAwAA3A9gBIARCgICAgICAgIDAADcD0AEgBEKAgICAgICAgMAANwPIASAEQoCAgICAgICAwAA3A1AgBEKAgICAgICAgMAANwNYIARCgICAgICAgIDAADcDYCAEQeABaiICIARB0ABqQQEQkQUgBEKAgICAgICA+D83A7ABIARCADcDuAEgBEIANwPAASAEQoCAgICAgID4PzcDOCAEQgA3A0AgBEIANwNIIARB+AFqIgUgAiAEQThqEOkBIAIQKBogBCABKwMYIgsgASsDACIMoSINIA2iIAErAyAiDSABKwMIIg+hIg4gDqKgIAErAygiDiABKwMQIhChIhEgEaKgn0QAAAAAAADgP6IgCyAMoEQAAAAAAADgP6IgAyAIIAggCKIgCiAKoqAgCSAJoqCfIgyjIguioSIIIAiiIA0gD6BEAAAAAAAA4D+iIAMgCiAMoyIIoqEiCiAKoqAgDiAQoEQAAAAAAADgP6IgAyAJIAyjIgmioSIKIAqioJ+gIgo5A5ABIAQgCjkDiAEgBCAKOQOAASAEIAo5AyAgBCAKOQMoIAQgCjkDMCAEQZgBaiIBIAUgBEEgahCcBCAEIAM5A2ggBEIANwNwIARCADcDeCAEIAM5AwggBEIANwMQIARCADcDGCACIAEgBEEIahDpASAFIAIQwQEhBSACECgaIAEQKBogACAFRAAAAAAAAAAAAnxEAAAAAAAA+H8gCb1C////////////AINCgICAgICAgPj/AFogCZlEAAAAAAAA8D9kcg0AGkS17z+35KtxwCAJRAAAAAAAAPA/YQ0AGkS17z+35KtxQCAJRAAAAAAAAPC/YQ0AGkQYLURU+yH5PyAJEF2hRAAAAAAAgGbAogtEGC1EVPshCUCjAnwgCCIDIAugIAsgC2EgAyADYXFFDQAaIAO9IhJCIIinIQACQAJAIAu9IhNCIIinIgJBgIDA/wNrIBOnIgZyRQRAIABB/////wdxIgBBgIDAoARPDQICfyAAQf//7/4DTQRAQX8gAEGAgIDyA08NARoMAwsgA5khAyAAQf//y/8DTQRAIABB//+X/wNNBEAgAyADoEQAAAAAAADwv6AgA0QAAAAAAAAAQKCjIQNBAAwCCyADRAAAAAAAAPC/oCADRAAAAAAAAPA/oKMhA0EBDAELIABB//+NgARNBEAgA0QAAAAAAAD4v6AgA0QAAAAAAAD4P6JEAAAAAAAA8D+goyEDQQIMAQtEAAAAAAAA8L8gA6MhA0EDCyADIAMgAyADoiILIAuiIgggCCAIIAggCEQvbGosRLSiv6JEmv3eUi3erb+gokRtmnSv8rCzv6CiRHEWI/7Gcby/oKJExOuYmZmZyb+goiIJIAsgCCAIIAggCCAIRBHaIuM6rZA/okTrDXYkS3upP6CiRFE90KBmDbE/oKJEbiBMxc1Ftz+gokT/gwCSJEnCP6CiRA1VVVVVVdU/oKIiCKCioSAAQf//7/4DTQ0DGkEDdCIAQbCAAWorAwAgAyAJIAigoiAAQdCAAWorAwChIAOhoSIDmiADIBJCAFMbDAMLIAJBHnZBAnEiByAAQR92ciEBIABB/////wdxIgAgEqdyRQRAAkACQCABQQJrDgIAAQMLRBgtRFT7IQlADAQLRBgtRFT7IQnADAMLIAJB/////wdxIgIgBnJFDQECQCACQYCAwP8HRgRAIABBgIDA/wdHDQEgAUEDdEGYhgFqKwMADAQLIABBgIDA/wdHIAJBgICAIGogAE9xRQ0CAnwgBwRARAAAAAAAAAAAIABBgICAIGogAkkNARoLAnwCQCADIAujmSIDvSISQiCIp0H/////B3EiAEGAgMCgBE8EQCADIANiDQFEGC1EVPsh+T8gA6YMAgsCfyAAQf//7/4DTQRAQX8gAEGAgIDyA08NARoMAgsgA5khAyAAQf//y/8DTQRAIABB//+X/wNNBEAgAyADoEQAAAAAAADwv6AgA0QAAAAAAAAAQKCjIQNBAAwCCyADRAAAAAAAAPC/oCADRAAAAAAAAPA/oKMhA0EBDAELIABB//+NgARNBEAgA0QAAAAAAAD4v6AgA0QAAAAAAAD4P6JEAAAAAAAA8D+goyEDQQIMAQtEAAAAAAAA8L8gA6MhA0EDCyADIAMgAyADoiILIAuiIgggCCAIIAggCEQvbGosRLSiv6JEmv3eUi3erb+gokRtmnSv8rCzv6CiRHEWI/7Gcby/oKJExOuYmZmZyb+goiIJIAsgCCAIIAggCCAIRBHaIuM6rZA/okTrDXYkS3upP6CiRFE90KBmDbE/oKJEbiBMxc1Ftz+gokT/gwCSJEnCP6CiRA1VVVVVVdU/oKIiCKCioSAAQf//7/4DTQ0BGkEDdCIAQbCAAWorAwAgAyAJIAigoiAAQdCAAWorAwChIAOhoSIDmiADIBJCAFMbIQMLIAMLCyEDAkACQAJAIAFBAWsOAwABAgQLIAOaDAULRBgtRFT7IQlAIANEB1wUMyamobygoQwECyADRAdcFDMmpqG8oEQYLURU+yEJwKAMAwsgAUEDdEG4hgFqKwMAIQMLIAMMAQtEGC1EVPsh+T8gA6YLRAAAAAAAgGZAokQYLURU+yEJQKMQmwQgBRAoGiAEQZACaiQAC6UBAQZ/IwBBEGsiByQAQaABECMiA0GAlAI2AgAgA0IANwIEIANBEGohBSMAQRBrIgIkACACIAEoAgAiBjYCCCAGBEBBEBAjIgQgBjYCDCAEQeyXAjYCACAEQgA3AgQLIAIgBDYCDCABQQA2AgAgAiACKQIINwMAIAUgAhD+AiACQRBqJAAgACADNgIEIAAgBTYCACAAIANBFGogBRCPASAHQRBqJAAL0gQBAn8jAEGQBGsiAyQAIANBhARqIAFBABArECogA0H8A2ogAkEAECsQKiADQcgAaiIBIANB6AJqIAMoAoQEIAMoAvwDQQFBABCOAyICQQIQnwIgA0GYAhAjIAEQowE2AiAgA0HgAmogA0EgahCXBCADKAIgIQEgA0EANgIgIAEEQCABEDoQIgsgA0HIAGoiARA6GiABIAJBARCfAiADQZgCECMgARCjATYCICADQUBrIANBIGoQlwQgAygCICEBIANBADYCICABBEAgARA6ECILIANByABqEDoaIAMgAygC4AI2AjggAyADKALkAiIBNgI8IAEEQCABIAEoAgRBAWo2AgQLIAMgAykCODcDECADQcgAaiADQRBqEEMgAyADKAJANgIYIAMgAygCRCIBNgIcIAEEQCABIAEoAgRBAWo2AgQLIAMgAykCGDcDCCADQSBqIgEgA0EIahBDIAAgA0HIAGoiBBCLARogAEEYaiABEIsBGiABECgaIAQQKBoCQCADKAJEIgBFDQAgACAAKAIEIgFBAWs2AgQgAQ0AIAAgACgCACgCCBEAACAAECQLAkAgAygC5AIiAEUNACAAIAAoAgQiAUEBazYCBCABDQAgACAAKAIAKAIIEQAAIAAQJAsgAhD8AgJAIAMoAoAEIgBFDQAgACAAKAIEIgFBAWs2AgQgAQ0AIAAgACgCACgCCBEAACAAECQLAkAgAygCiAQiAEUNACAAIAAoAgQiAUEBazYCBCABDQAgACAAKAIAKAIIEQAAIAAQJAsgA0GQBGokAAtKAQd/QQQQIyIDIAI2AgBBBBAjIgQgAjYCAEHw7wEgAUGQ6wEiAUEAIQJB7SRBASEFQbsBIAMgASACQfEkaiAFQbsBaiAEEAogAAviAwICfwV8IwBBgAFrIgMkACADQfgAaiABQQAQKxAqAkAgAygCeCgCRCIEBEAgACAEEEYMAQsgAisDACIHIAeiIAIrAwgiBiAGoqAgAisDECIFIAWioCIIRAAAAAAAAAAAYQRAIAAQ6wEaDAELIANCADcDcCADQgA3A2ggA0IANwNgIANEAAAAAAAA8D8gBSAInyIIoyIFIAWiIgkgCaChOQNYIANEAAAAAAAAAAAgBSAGIAijIgaiIgkgCaChIgk5A1AgA0QAAAAAAAAAACAHIAijIgcgBaIiBSAFoKEiBTkDSCADIAk5A0AgA0QAAAAAAADwPyAGIAaiIgggCKChOQM4IANEAAAAAAAAAAAgByAGoiIGIAagoSIGOQMwIAMgBTkDKCADIAY5AyAgA0QAAAAAAADwPyAHIAeiIgUgBaChOQMYIANBCGogARCKASADQRBqIAMoAggiASADQRhqIAEoAgAoAgQRAwAgAyADKQIQNwMAIAAgAxBDIAMoAgwiAEUNACAAIAAoAgQiAUEBazYCBCABDQAgACAAKAIAKAIIEQAAIAAQJAsCQCADKAJ8IgBFDQAgACAAKAIEIgFBAWs2AgQgAQ0AIAAgACgCACgCCBEAACAAECQLIANBgAFqJAALlQUCA38DfCMAQSBrIgUkACAFQRBqIAEQigEgBSgCECEGIwBB0ANrIgEkACACRAAAAAAAgFZAoCIIED4hCSACED4hCiACED4hAiAIED4hCCABQgA3A5ADIAFCgICAgICAgPg/NwOIAyABQgA3A5gDIAFCADcDoAMgASAIOQPIAyABIAKaOQPAAyABQgA3A7gDIAEgCjkDsAMgASAJOQOoAyADRAAAAAAAgFZAoCICED4hCCADED4hCSADED4hAyABIAIQPjkDgAMgAUIANwP4AiABIAM5A/ACIAFCADcD6AIgAUKAgICAgICA+D83A+ACIAFCADcD2AIgASAJmjkD0AIgAUIANwPIAiABIAg5A8ACIAREAAAAAACAVkCgIgIQPiEDIAQQPiEIIAQQPiEEIAIQPiECIAFCADcDoAIgASACOQOYAiABIASaOQOQAiABQgA3A4gCIAEgCDkDgAIgASADOQP4ASABQgA3A6gCIAFCADcDsAIgAUKAgICAgICA+D83A7gCIAFBCGoiByABQfgBaiABQcACahCaAiABQdAAaiAHIAFBiANqEJoCIAFCADcD8AEgAUIANwPoASABQgA3A+ABIAEgASkDUDcDmAEgASABKQNYNwOgASABIAEpA2A3A6gBIAEgASkDaDcDsAEgASABKQNwNwO4ASABIAEpA3g3A8ABIAEgASkDgAE3A8gBIAEgASkDiAE3A9ABIAEgASkDkAE3A9gBIAVBGGogBiABQZgBaiAGKAIAKAIEEQMAIAFB0ANqJAAgBSAFKQIYNwMIIAAgBUEIahBDAkAgBSgCFCIARQ0AIAAgACgCBCIBQQFrNgIEIAENACAAIAAoAgAoAggRAAAgABAkCyAFQSBqJAALpwICCH8BfCMAQSBrIgQkACAEQRBqIAEQigEgBEEYaiAEKAIQIQcjAEHwAGsiAyQAIANBEGpBAEHgAPwLACADQQI2AgwgA0KAgICAEDcCBCADQShqIQkDQCACQQhBECADQQRqIAVqKAIAIgZBAUYbQQAgBhsiCmorAwAhCyADQRBqIQECQAJAAkAgBg4CAgABCyAJIQEMAQsgA0EQakEwQcgAIAZBAkYbaiEBCyABIApqIAs5AwAgBUEEaiIFQQxHDQALIAcgA0EQaiAHKAIAKAIEEQMAIANB8ABqJAAgBCAEKQIYNwMIIAAgBEEIahBDAkAgBCgCFCIARQ0AIAAgACgCBCIBQQFrNgIEIAENACAAIAAoAgAoAggRAAAgABAkCyAEQSBqJAALGAEBf0EQECMiAEIANwMIIABCADcDACAAC3UBA38jAEEQayIBJAAgAUEIaiAAQQAQKxAqAn8gASgCCCIAKAJAIgJFBEAgACgCTAwBCyAAKAKMASACbgsCQCABKAIMIgBFDQAgACAAKAIEIgNBAWs2AgQgAw0AIAAgACgCACgCCBEAACAAECQLIAFBEGokAAtaAQN/IwBBEGsiASQAIAFBCGogAEEAECsQKiABKAIIKAJAAkAgASgCDCIARQ0AIAAgACgCBCIDQQFrNgIEIAMNACAAIAAoAgAoAggRAAAgABAkCyABQRBqJAALXQEDfyMAQRBrIgEkACABQQhqIABBABArECogASgCCCgCXAJAIAEoAgwiAEUNACAAIAAoAgQiA0EBazYCBCADDQAgACAAKAIAKAIIEQAAIAAQJAsgAUEQaiQAQQF2C7YCAQZ/IwBBMGsiBCQAIAQgAkEDbDYCHCABQTRqIARBHGoiAhA9IAQgAygCADYCHCABQUBrIAIQPSAEIAMtAGggAy0AaUEBdHI6AC8gAUHYAGogBEEvahCrBCAALQAARQRAIARCgoCAgDA3AiQgBEKAgICAEDcCHCADQSBqIQggA0EIaiEAIAFBzABqIQkDQCAEQRxqIAVqKAIAIQYgBEKAgICAEDcCECAEQQI2AhggAEEwQcgAIAZBAkYbaiEBQQAhAwNAIARBEGogA2ooAgAhByAAIQICQAJAAkAgBg4CAgABCyAIIQIMAQsgASECCyAEIAJBCEEQIAdBAUYbQQAgBxtqKwMAtjgCDCAJIARBDGoQ5QIgA0EEaiIDQQxHDQALIAVBBGoiBUEQRw0ACwsgBEEwaiQAC8I/AQN/IwBBEGsiASQAQfDvAUHaH0HoJEECQeokQQMQESABQQ9qQcAIQQAQmQRBkghBCBCZBBpB8O8BEBBB+O8BQYwfQYslQQRBjSVBBRARIAFBDmpB4R9BABDiAkHfH0EEEOICQd0fQQgQ4gIaQfjvARAQQYDwAUGZH0GuJUEGQbAlQQcQESABQQ1qQcAIQQAQ4QJBkghBCBDhAkGACEEQEOECGkGA8AEQEEGI8AFB9R5B0SVBCEHTJUEJEBEgAUEMakHACEEAEIkCQZIIQQgQiQJBgAhBEBCJAkHCCEEYEIkCGkGI8AEQEEGQ8AFBowpBBEEBQQAQF0GQ8AFBjg5BABADQZDwAUGlCEEBEANBkPABQYcXQQIQA0GQ8AFBkw1BAxADQZDwAUGiEUEEEANBkPABQcMMQQUQA0GQ8AFB/wtBBhADQZDwAUGlDUEHEANBkPABQbgRQQgQA0GQ8AFBjhFBCRADQZDwAUHNEUEKEANBkPABQbQPQQsQA0GQ8AFBqxVBDBADQZDwAUGNC0ENEANBkPABQaIXQQ4QA0GY8AFB8RRBBEEBQQAQF0GY8AFB+BdBABADQZjwAUGWD0EBEANBmPABQYcTQQIQA0GY8AFBkBNBAxADQaDwAUG/FEEEQQFBABAXQaDwAUG4FEEAEANBoPABQfEWQQEQA0Gg8AFBow5BAhADQaDwAUGyEEEDEANBqPABQYUKQdEmQQpB0yZBCxARIAFBC2pB6Q9BABD6A0G+CEEQEPoDGkGo8AEQEEGw8AFBlAhB7yZBDEHxJkENEBEgAUEKakHpD0EAEOwDQb4IQRgQ7AMaQbDwARAQQbjwAUHFC0GVJ0EOQZcnQQ8QEUEEECMiAEEANgIAQQQQIyICQQA2AgBBuPABQf4VQeDqAUGaJ0HHASAAQeDqAUGeJ0HIASACEApBBBAjIgBBCDYCAEEEECMiAkEINgIAQbjwAUHFC0GQ6wFBoydByQEgAEGQ6wFBpydBygEgAhAKQbjwARAQQcDwAUHdCUG/J0EQQcEnQREQEUEEECMiAEEANgIAQQQQIyICQQA2AgBBwPABQbkZQfjqAUHEJ0HLASAAQfjqAUHIJ0HMASACEApBBBAjIgBBCDYCAEEEECMiAkEINgIAQcDwAUGsFkGQ6wFBzSdBzQEgAEGQ6wFB0SdBzgEgAhAKIAFBCGpBqw9BEBDlA0HKEEEoEOUDGkHA8AEQEEHI8AFB0PABQeDwAUEAQbwoQRJBvyhBAEG/KEEAQcQIQcEoQRMQCUHI8AFBAUHw8AFBxChBFEEVEAhBCBAjIgBBADYCBCAAQRY2AgBByPABQbgQQQJB9PABQccoQRcgAEEAQQBBABAAQQgQIyIAQQA2AgQgAEEYNgIAQcjwAUGYF0ECQfzwAUHLKEEZIABBAEEAQQAQAEEIECMiAEEANgIEIABBGjYCAEHI8AFBtQtBAkGE8QFBzyhBGyAAQQBBAEEAEABBBBAjIgBBHDYCAEHI8AFB/RFBA0GM8QFB+yhB0QEgAEEAQQBBABAAQQQQIyIAQR02AgBByPABQeIQQQRBsPEBQbwpQdIBIABBAEEAQQAQAEEEECMiAEEeNgIAQcjwAUHwCUEHQdDxAUHCKUHTASAAQQBBAEEAEABB5J0CLQAARQRAQeSdAkEBOgAAQezxAUHA8AEQDQtB6PIBQfDyAUGA8wFBAEHILkHUAUG/KEEAQb8oQQBB1glByy5B1QEQCUHo8gFBAUGQ8wFBzi5B1gFB1wEQCEEEECMiAEHYATYCAEHo8gFB0RBBA0GU8wFB0S5BuwIgAEEAQQBBABAAQQQQIyIAQdkBNgIAQejyAUH3EkEEQaDzAUHWLkG8AiAAQQBBAEEAEABBBBAjIgBB2gE2AgBB6PIBQfkSQQJBsPMBQdwuQb0CIABBAEEAQQAQAEEEECMiAEHbATYCAEHo8gFB7AlBA0HA8wFB4C5BvgIgAEEAQQBBABAAQQQQIyIAQdwBNgIAQejyAUHoCUEEQdDzAUHlLkG/AiAAQQBBAEEAEABB6PIBQcDwAUH5EkHsCRAMQfCdAi0AAEUEQEHwnQJBAToAAEHg8wFB+O8BEA0LQcz0AUHU9AFB5PQBQQBBrDNB3QFBvyhBAEG/KEEAQYUfQa8zQd4BEAlBzPQBQQFB9PQBQbIzQd8BQeABEAhBBBAjIgBB4QE2AgBBzPQBQdEQQQNB+PQBQbUzQcACIABBAEEAQQAQAEEEECMiAEHiATYCAEHM9AFB9xJBBEGQ9QFBujNBwQIgAEEAQQBBABAAQQQQIyIAQeMBNgIAQcz0AUH5EkECQaD1AUHAM0HCAiAAQQBBAEEAEABBBBAjIgBB5AE2AgBBzPQBQewJQQNBsPUBQcQzQcMCIABBAEEAQQAQAEEEECMiAEHlATYCAEHM9AFB6AlBBEHA9QFByTNBxAIgAEEAQQBBABAAQcz0AUH47wFB+RJB7AkQDEH8nQItAABFBEBB/J0CQQE6AABB0PUBQYDwARANC0G89gFBxPYBQdT2AUEAQZA4QeYBQb8oQQBBvyhBAEGSH0GTOEHnARAJQbz2AUEBQeT2AUGWOEHoAUHpARAIQQQQIyIAQeoBNgIAQbz2AUHREEEDQej2AUGZOEHFAiAAQQBBAEEAEABBBBAjIgBB6wE2AgBBvPYBQfcSQQRBgPcBQZ44QcYCIABBAEEAQQAQAEEEECMiAEHsATYCAEG89gFB+RJBAkGQ9wFBpDhBxwIgAEEAQQBBABAAQQQQIyIAQe0BNgIAQbz2AUHsCUEDQaD3AUGoOEHIAiAAQQBBAEEAEABBBBAjIgBB7gE2AgBBvPYBQegJQQRBsPcBQa04QckCIABBAEEAQQAQAEG89gFBgPABQfkSQewJEAxBiJ4CLQAARQRAQYieAkEBOgAAQcD3AUHw7wEQDQtBrPgBQbT4AUHE+AFBAEH0PEHvAUG/KEEAQb8oQQBBxh9B9zxB8AEQCUGs+AFBAUHU+AFB+jxB8QFB8gEQCEEEECMiAEHzATYCAEGs+AFB0RBBA0HY+AFB/TxBygIgAEEAQQBBABAAQQQQIyIAQfQBNgIAQaz4AUH3EkEEQfD4AUGCPUHLAiAAQQBBAEEAEABBBBAjIgBB9QE2AgBBrPgBQfkSQQJBgPkBQYg9QcwCIABBAEEAQQAQAEEEECMiAEH2ATYCAEGs+AFB7AlBA0GQ+QFBjD1BzQIgAEEAQQBBABAAQQQQIyIAQfcBNgIAQaz4AUHoCUEEQaD5AUGRPUHOAiAAQQBBAEEAEABBrPgBQfDvAUH5EkHsCRAMQZSeAi0AAEUEQEGUngJBAToAAEGw+QFBrPgBEA0LQZz6AUGk+gFBtPoBQQBB68MAQfgBQb8oQQBBvyhBAEHSH0HuwwBB+QEQCUGc+gFBAUHE+gFB8cMAQfoBQfsBEAhBBBAjIgBB/AE2AgBBnPoBQdEQQQNByPoBQfTDAEHPAiAAQQBBAEEAEABBBBAjIgBB/QE2AgBBnPoBQfcSQQRB4PoBQfnDAEHQAiAAQQBBAEEAEABBBBAjIgBB/gE2AgBBnPoBQfkSQQJB8PoBQf/DAEHRAiAAQQBBAEEAEABBBBAjIgBB/wE2AgBBnPoBQewJQQNBgPsBQYPEAEHSAiAAQQBBAEEAEABBBBAjIgBBgAI2AgBBnPoBQegJQQRBkPsBQYjEAEHTAiAAQQBBAEEAEABBnPoBQaz4AUH5EkHsCRAMQaCeAi0AAEUEQEGgngJBAToAAEGg+wFBkOsBEA0LQYz8AUGU/AFBpPwBQQBBi8cAQYECQb8oQQBBvyhBAEH6HkGOxwBBggIQCUGM/AFBAUG0/AFBkccAQYMCQYQCEAhBBBAjIgBBhQI2AgBBjPwBQdEQQQNBuPwBQZTHAEHUAiAAQQBBAEEAEABBBBAjIgBBhgI2AgBBjPwBQfcSQQRB0PwBQZnHAEHVAiAAQQBBAEEAEABBBBAjIgBBhwI2AgBBjPwBQfkSQQJB4PwBQZ/HAEHWAiAAQQBBAEEAEABBBBAjIgBBiAI2AgBBjPwBQewJQQNB8PwBQaPHAEHXAiAAQQBBAEEAEABBBBAjIgBBiQI2AgBBjPwBQegJQQRBgP0BQajHAEHYAiAAQQBBAEEAEABBjPwBQZDrAUH5EkHsCRAMQayeAi0AAEUEQEGsngJBAToAAEGQ/QFB/P0BEA0LQYT+AUGM/gFBnP4BQQBBu8wAQYoCQb8oQQBBvyhBAEHID0G+zABBiwIQCUGE/gFBAUGs/gFBwcwAQYwCQY0CEAhBBBAjIgBBjgI2AgBBhP4BQdEQQQNBsP4BQcTMAEHZAiAAQQBBAEEAEABBBBAjIgBBjwI2AgBBhP4BQfcSQQRBwP4BQcnMAEHaAiAAQQBBAEEAEABBBBAjIgBBkAI2AgBBhP4BQfkSQQJB0P4BQc/MAEHbAiAAQQBBAEEAEABBBBAjIgBBkQI2AgBBhP4BQewJQQNB4P4BQdPMAEHcAiAAQQBBAEEAEABBBBAjIgBBkgI2AgBBhP4BQegJQQRB8P4BQdjMAEHdAiAAQQBBAEEAEABBhP4BQfz9AUH5EkHsCRAMQbieAi0AAEUEQEG4ngJBAToAAEGA/wFBmPEBEA0LQez/AUH0/wFBhIACQQBBn9EAQZMCQb8oQQBBvyhBAEH3FkGi0QBBlAIQCUHs/wFBAUGUgAJBpdEAQZUCQZYCEAhBBBAjIgBBlwI2AgBB7P8BQdEQQQNBmIACQajRAEHeAiAAQQBBAEEAEABBBBAjIgBBmAI2AgBB7P8BQfcSQQRBsIACQa3RAEHfAiAAQQBBAEEAEABBBBAjIgBBmQI2AgBB7P8BQfkSQQJBwIACQbPRAEHgAiAAQQBBAEEAEABBBBAjIgBBmgI2AgBB7P8BQewJQQNB0IACQbfRAEHhAiAAQQBBAEEAEABBBBAjIgBBmwI2AgBB7P8BQegJQQRB4IACQbzRAEHiAiAAQQBBAEEAEABB7P8BQZjxAUH5EkHsCRAMQcSeAi0AAEUEQEHEngJBAToAAEHwgAJBuPABEA0LQcDxAUHcgQJB7IECQQBB5dUAQZwCQb8oQQBBvyhBAEG+C0Ho1QBBnQIQCUHA8QFBAUH8gQJB69UAQZ4CQZ8CEAhBBBAjIgBBoAI2AgBBwPEBQdEQQQNBgIICQe7VAEHjAiAAQQBBAEEAEABBBBAjIgBBoQI2AgBBwPEBQfcSQQRBkIICQfPVAEHkAiAAQQBBAEEAEABBBBAjIgBBogI2AgBBwPEBQfkSQQJBoIICQfnVAEHlAiAAQQBBAEEAEABBBBAjIgBBowI2AgBBwPEBQewJQQNBsIICQf3VAEHmAiAAQQBBAEEAEABBBBAjIgBBpAI2AgBBwPEBQegJQQRBwIICQYLWAEHnAiAAQQBBAEEAEABBwPEBQbjwAUH5EkHsCRAMQdCeAi0AAEUEQEHQngJBAToAAEHQggJBiPABEA0LQbyDAkHEgwJB1IMCQQBBydoAQaUCQb8oQQBBvyhBAEHuHkHM2gBBpgIQCUG8gwJBAUHkgwJBz9oAQacCQagCEAhBBBAjIgBBqQI2AgBBvIMCQdEQQQNB6IMCQdLaAEHoAiAAQQBBAEEAEABBBBAjIgBBqgI2AgBBvIMCQfcSQQRBgIQCQdfaAEHpAiAAQQBBAEEAEABBBBAjIgBBqwI2AgBBvIMCQfkSQQJBkIQCQd3aAEHqAiAAQQBBAEEAEABBBBAjIgBBrAI2AgBBvIMCQewJQQNBoIQCQeHaAEHrAiAAQQBBAEEAEABBBBAjIgBBrQI2AgBBvIMCQegJQQRBsIQCQebaAEHsAiAAQQBBAEEAEABBvIMCQYjwAUH5EkHsCRAMQfz9AUHAhAJB0IQCQQBBo9sAQR9BvyhBAEG/KEEAQdwPQabbAEEgEAlB/P0BQQNB4IQCQanbAEEhQSIQCEHzF0EjEMECQZMKQSQQwQJB+glBJRDBAkEEECMiAEEmNgIAQfz9AUHBDkEDQfiEAkGz2wBBrwIgAEEAQQBBABAAQQQQIyIAQSc2AgBB/P0BQfoPQQNBhIUCQbjbAEGwAiAAQQBBAEEAEABBCBAjIgBBADYCBCAAQSg2AgBB/P0BQeATQQNBkIUCQb3bAEEpIABBAEEAQQAQAEEIECMiAEEANgIEIABBKjYCAEH8/QFBmRNBA0GchQJBwtsAQSsgAEEAQQBBABAAQQgQIyIAQQA2AgQgAEEsNgIAQfz9AUGdFUEDQZCFAkG92wBBKSAAQQBBAEEAEABBCBAjIgBBADYCBCAAQS02AgBB/P0BQfgNQQNBkIUCQb3bAEEpIABBAEEAQQAQAEEIECMiAEEANgIEIABBLjYCAEH8/QFB6xNBAkGohQJBx9sAQS8gAEEAQQBBABAAQQgQIyIAQQA2AgQgAEEwNgIAQfz9AUGCCEECQbCFAkHL2wBBMSAAQQBBAEEAEABBCBAjIgBBADYCBCAAQTI2AgBB/P0BQYAYQQJBuIUCQc/bAEEzIABBAEEAQQAQAEEIECMiAEEANgIEIABBNDYCAEH8/QFBnAlBAkHAhQJB09sAQTUgAEEAQQBBABAAQQgQIyIAQQA2AgQgAEE2NgIAQfz9AUHZDUECQcCFAkHT2wBBNSAAQQBBAEEAEABBCBAjIgBBADYCBCAAQTc2AgBB/P0BQbsNQQJByIUCQdfbAEE4IABBAEEAQQAQAEEIECMiAEEANgIEIABBOTYCAEH8/QFBighBA0GchQJBwtsAQSsgAEEAQQBBABAAQQQQIyIAQTo2AgBB/P0BQeQJQQZB0IUCQdvbAEGxAiAAQQBBAEEAEABBCBAjIgBBADYCBCAAQTs2AgBB/P0BQdALQQJB6IUCQePbAEE8IABBAEEAQQAQAEEIECMiAEEANgIEIABBPTYCAEH8/QFBlhBBAkHwhQJB59sAQT4gAEEAQQBBABAAQbcUQQNB+IUCQevbAEE/QcAAQQBBABACQY4VQQNBhIYCQfDbAEHBAEHCAEEAQQAQAkH2E0ECQZCGAkH12wBBwwBBxABBAEEAEAJBzhhBAkGQhgJB9dsAQcMAQcUAQQBBABACQfIYQQJBkIYCQfXbAEHDAEHGAEEAQQAQAkGcGEECQZCGAkH12wBBwwBBxwBBAEEAEAJB3QxBA0GYhgJB+dsAQcgAQckAQQBBABACQbkKQQJBpIYCQf7bAEHKAEHLAEEAQQAQAkGY8QFBrIYCQbyGAkEAQa/cAEHMAEG/KEEAQb8oQQBBihdBstwAQc0AEAlBmPEBQQJBzIYCQbXcAEHOAEHPABAIQfQXQdAAEJ0DQZQKQdEAEJ0DQfsJQdIAEJ0DQQQQIyIAQdMANgIAQZjxAUHPCUEDQeCGAkG+3ABBswIgAEEAQQBBABAAQQQQIyIAQdQANgIAQZjxAUHPFEEEQfCGAkHD3ABBtAIgAEEAQQBBABAAQQgQIyIAQQA2AgQgAEHVADYCAEGY8QFB3RRBBEGAhwJBydwAQdYAIABBAEEAQQAQAEEIECMiAEEANgIEIABB1wA2AgBBmPEBQe0PQQNBkIcCQc/cAEHYACAAQQBBAEEAEABBCBAjIgBBADYCBCAAQdkANgIAQZjxAUGYFkEDQZCHAkHP3ABB2AAgAEEAQQBBABAAQQgQIyIAQQA2AgQgAEHaADYCAEGY8QFB5BZBA0GchwJB1NwAQdsAIABBAEEAQQAQAEEIECMiAEEANgIEIABB3AA2AgBBmPEBQYoKQQJBqIcCQdncAEHdACAAQQBBAEEAEABBCBAjIgBBADYCBCAAQd4ANgIAQZjxAUGWEEECQbCHAkHd3ABB3wAgAEEAQQBBABAAQQQQIyIAQeAANgIAQZjxAUGRGEEDQbiHAkHh3ABBtQIgAEEAQQBBABAAQQgQIyIAQQA2AgQgAEHhADYCAEGY8QFByBRBA0HEhwJB5twAQeIAIABBAEEAQQAQAEEIECMiAEEANgIEIABB4wA2AgBBmPEBQf8QQQNB0IcCQevcAEHkACAAQQBBAEEAEABBCBAjIgBBADYCBCAAQeUANgIAQZjxAUHMFkEDQdCHAkHr3ABB5AAgAEEAQQBBABAAQQgQIyIAQQA2AgQgAEHmADYCAEGY8QFB3AtBA0HEhwJB5twAQeIAIABBAEEAQQAQAEEIECMiAEEANgIEIABB5wA2AgBBmPEBQeEIQQRB4IcCQfDcAEHoACAAQQBBAEEAEABBwQ5B6QAQrgVBhxJB6gAQrgVBBBAjIgBB6wA2AgBBmPEBQbQMQQRBgIgCQfvcAEG3AiAAQQBBAEEAEABBBBAjIgBB7AA2AgBBmPEBQfoPQQNBkIgCQYHdAEG4AiAAQQBBAEEAEABBCBAjIgBBADYCBCAAQe0ANgIAQZjxAUHgE0EDQZyIAkGG3QBB7gAgAEEAQQBBABAAQQgQIyIAQQA2AgQgAEHvADYCAEGY8QFBoBNBBUGwiAJBi90AQfAAIABBAEEAQQAQAEEIECMiAEEANgIEIABB8QA2AgBBmPEBQZ0VQQNBnIgCQYbdAEHuACAAQQBBAEEAEABBCBAjIgBBADYCBCAAQfIANgIAQZjxAUH4DUEDQZyIAkGG3QBB7gAgAEEAQQBBABAAQQgQIyIAQQA2AgQgAEHzADYCAEGY8QFB6xNBAkHEiAJBkt0AQfQAIABBAEEAQQAQAEEIECMiAEEANgIEIABB9QA2AgBBmPEBQYIIQQJBzIgCQZbdAEH2ACAAQQBBAEEAEABBBBAjIgBB9wA2AgBBmPEBQaMKQQJB1IgCQdndAEG5AiAAQQBBAEEAEABBCBAjIgBBADYCBCAAQfgANgIAQZjxAUHVCEEDQeSIAkHd3QBB+QAgAEEAQQBBABAAQQgQIyIAQQA2AgQgAEH6ADYCAEGY8QFBnAlBAkHwiAJB4t0AQfsAIABBAEEAQQAQAEEIECMiAEEANgIEIABB/AA2AgBBmPEBQYcWQQJB8IgCQeLdAEH7ACAAQQBBAEEAEABBCBAjIgBBADYCBCAAQf0ANgIAQZjxAUHbEEECQfCIAkHi3QBB+wAgAEEAQQBBABAAQQgQIyIAQQA2AgQgAEH+ADYCAEGY8QFBhw9BAkHwiAJB4t0AQfsAIABBAEEAQQAQAEEIECMiAEEANgIEIABB/wA2AgBBmPEBQYQJQQJB8IgCQeLdAEH7ACAAQQBBAEEAEABBCBAjIgBBADYCBCAAQYABNgIAQZjxAUGYCEECQfiIAkHm3QBBgQEgAEEAQQBBABAAQQgQIyIAQQA2AgQgAEGCATYCAEGY8QFBtRZBAkGAiQJB6t0AQYMBIABBAEEAQQAQAEEIECMiAEEANgIEIABBhAE2AgBBmPEBQb8WQQNB0IcCQevcAEHkACAAQQBBAEEAEABBCBAjIgBBADYCBCAAQYUBNgIAQZjxAUGKCEEDQdCHAkHr3ABB5AAgAEEAQQBBABAAQQgQIyIAQQA2AgQgAEGGATYCAEGY8QFBqgpBAkGIiQJB7t0AQYcBIABBAEEAQQAQAEEIECMiAEEANgIEIABBiAE2AgBBmPEBQeoUQQJBgIkCQerdAEGDASAAQQBBAEEAEABBCBAjIgBBADYCBCAAQYkBNgIAQZjxAUGFGEECQYCJAkHq3QBBgwEgAEEAQQBBABAAQQgQIyIAQQA2AgQgAEGKATYCAEGY8QFBjw9BBEGQiQJB8t0AQYsBIABBAEEAQQAQAEEEECMiAEGMATYCAEGY8QFB7AhBBEGgiQJB+N0AQboCIABBAEEAQQAQAEEIECMiAEEANgIEIABBjQE2AgBBmPEBQZwUQQRBsIkCQf7dAEGOASAAQQBBAEEAEABBCBAjIgBBADYCBCAAQY8BNgIAQZjxAUHtC0EEQcCJAkGE3gBBkAEgAEEAQQBBABAAQQgQIyIAQQA2AgQgAEGRATYCAEGY8QFBoBlBAkGIiQJB7t0AQYcBIABBAEEAQQAQAEEIECMiAEEANgIEIABBkgE2AgBBmPEBQb8QQQJBsIcCQd3cAEHfACAAQQBBAEEAEABB6xZBA0HQiQJBit4AQZMBQZQBQQBBABACQakOQQZB4IkCQY/eAEGVAUGWAUEAQQAQAkGvFEEDQfiJAkGX3gBBlwFBmAFBAEEAEAJBng9BAUGEigJBnN4AQZkBQZoBQQBBABACQeIQQQNBiIoCQZ/eAEGbAUGcAUEAQQAQAkGPFkEGQaCKAkGk3gBBnQFBngFBAEEAEAJB0xNBBEHAigJBrN4AQZ8BQaABQQBBABACQf4SQQRB0IoCQbLeAEGhAUGiAUEAQQAQAkHwCUEGQeCKAkG43gBBowFBpAFBAEEAEAJBpBVBAkH4igJBwN4AQaUBQaYBQQBBABACQcMNQQJBgIsCQcTeAEGnAUGoAUEAQQAQAkGLFEECQYiLAkHI3gBBqQFBqgFBAEEAEAJB4hhBAkGIiwJByN4AQakBQaoBQQBBABACQYsZQQJBiIsCQcjeAEGpAUGrAUEAQQAQAkG3GEECQYiLAkHI3gBBqQFBrAFBAEEAEAJB+gxBA0GQiwJBzN4AQa0BQa4BQQBBABACQdEKQQJBnIsCQdHeAEGvAUGwAUEAQQAQAkH6FEECQaSLAkHV3gBBsQFBsgFBAEEAEAJB3xFBAkGkiwJB1d4AQbEBQbMBQQBBABACQeUKQQJBrIsCQdneAEG0AUG1AUEAQQAQAkH5CkECQbSLAkHd3gBBtgFBtwFBAEEAEAJBnQtBAUG8iwJB4d4AQbgBQbkBQQBBABACQcAZQQFBvIsCQeHeAEG4AUG6AUEAQQAQAiABQRBqJAALVAEBfyMAQRBrIgIkACAAIAFHBEAgACgCABogASgCABogAEEIaiABQQhqEF4gAkEIaiABQRBqEH8gAiACKQIINwMAIABBEGogAhDnAgsgAkEQaiQAC6cDAQZ/IAEgAkYEQCAAIAM2AgQgACADNgIADwsgAiADRgRAIAAgAjYCBCAAIAE2AgAPCwJAIAIgAUEEaiIFRgRAIAEoAgAhBCADIAJrIgIEQCABIAUgAvwKAAALIAEgAmoiAiAENgIADAELIAMgAkEEakYEQCADIANBBGsiBSABayIEayECIAUoAgAhBiAERSABIAVGckUEQCACIAEgBPwKAAALIAEgBjYCAAwBCwJ/IAIgASIEayIHQQJ1IgYgAyACayIIQQJ1IgFHBEAgBiECA0AgAiABIgJvIgENAAsgBCACQQJ0aiEBA0AgAUEEayIBIAdqIQIgASgCACEJIAEhBQNAIAUgAigCADYCACACIgUgB2ogBCAGIAMgAmtBAnUiAmtBAnRqIAIgBkobIgIgAUcNAAsgBSAJNgIAIAEgBEcNAAsgBCAIagwBCwJAIAIgBEYgAiADRnINACACIQEDQCAEKAIAIQUgBCABKAIANgIAIAEgBTYCACAEQQRqIgQgAkYNASABQQRqIgEgA0cNAAsLIAILIQILIAAgAzYCBCAAIAI2AgALgAEBBX8gAgRAIAMoAgAiBCABKAIAQQR0aiIFKAIEIQEDQAJ/AkACQCABIAQgACACQQF2IgNBAnRqIgYoAgBBBHRqIgcoAgQiCEYEQCAHKAIAIAUoAgBODQEMAgsgASAISg0BCyADDAELIAZBBGohACACIANBf3NqCyICDQALCyAAC40BAQV/IAAgAUcEQCABIABrQQJ1IQEgAygCACIEIAIoAgBBBHRqIgUoAgQhAgNAAn8CQAJAIAQgACABQQF2IgNBAnRqIgYoAgBBBHRqIgcoAgQiCCACRgRAIAUoAgAgBygCAEgNAQwCCyACIAhODQELIAMMAQsgBkEEaiEAIAEgA0F/c2oLIgENAAsLIAAL6gMBCH8jAEEQayIIJAACQCAEIAVMBEAgBiEFIAAgAUcEQCAAIQQDQCAFIAQoAgA2AgAgBUEEaiEFIARBBGoiBCABRw0ACwsCQCAFIAZGDQAgAygCACEDA0AgASACRgRAIAUgBmsiAUUNAiAAIAYgAfwKAAAMAgsCQAJAAkAgAyABKAIAIgRBBHRqIgkoAgQiCiADIAYoAgAiC0EEdGoiBygCBCIMRgRAIAkoAgAgBygCAEgNAQwCCyAKIAxODQELIAAgBDYCACABQQRqIQEMAQsgACALNgIAIAZBBGohBgsgAEEEaiEAIAUgBkcNAAsLDAELIAYhBSABIAJHBEAgASEEA0AgBSAEKAIANgIAIAVBBGohBSAEQQRqIgQgAkcNAAsLIAggAzYCDCAAIQQCQCAFIAZGDQAgCCgCDCELA0AgBCABIgBGBEADQCACQQRrIgIgBUEEayIFKAIANgIAIAUgBkcNAAwDCwALAkACQCALKAIAIgcgBUEEayIJKAIAIgpBBHRqIgwoAgQiDSAHIABBBGsiASgCACIDQQR0aiIHKAIEIg5GBEAgDCgCACAHKAIATg0BDAILIA0gDkgNAQsgCiEDIAAhASAJIQULIAJBBGsiAiADNgIAIAUgBkcNAAsLCyAIQRBqJAALnQIBCH8CQCAAIAFGDQAgAiAAKAIANgIAIABBBGoiBCABRg0AIAMoAgAhBSACIQADQCAAQQRqIQsCQAJAAkAgBSAEKAIAIgNBBHRqIgYoAgQiByAFIAAoAgAiCEEEdGoiCSgCBCIKRgRAIAYoAgAgCSgCAEgNAQwCCyAHIApODQELIAAgCDYCBAJ/IAIgACACRg0AGgNAAkACQCAFIAQoAgBBBHRqIgYoAgQiByAFIABBBGsiAygCACIIQQR0aiIJKAIEIgpGBEAgBigCACAJKAIATg0BDAILIAcgCkgNAQsgAAwCCyAAIAg2AgAgAyIAIAJHDQALIAILIAQoAgA2AgAMAQsgCyADNgIACyALIQAgBEEEaiIEIAFHDQALCwvxAQEEfwJAAkACQAJAAkAgAw4DAwABAgsgBCAAKAIANgIADwsCQCACKAIAIgIgAUEEayIBKAIAIgNBBHRqIgUoAgQiBiACIAAoAgAiB0EEdGoiAigCBCIIRgRAIAUoAgAgAigCAEgNAQwECyAGIAhODQMLIAQgAzYCACAEIAAoAgA2AgQPCyADQQhMBEAgACABIAQgAhCoBA8LIAAgACADQQF2IgVBAnQiB2oiBiACIAUgBCAFEMMBIAYgASACIAMgBWsiAyAEIAdqIAMQwwEgACAGIAYgASAEIAIQkQILDwsgBCAHNgIAIAQgASgCADYCBAv2AQEJfwJAIAAgAUYNACAAQQRqIgMgAUYNACACKAIAIQQgACEFA0AgBSECIAMhBQJAAkAgBCACKAIEIgpBBHRqIgYoAgQiAyAEIAIoAgAiB0EEdGoiCCgCBCIJRgRAIAYoAgAgCCgCAEgNAQwCCyADIAlODQELIAIgBzYCBAJ/IAAgACACRg0AGgNAAkACQCAGKAIEIgcgBCACQQRrIgMoAgAiCEEEdGoiCSgCBCILRgRAIAYoAgAgCSgCAE4NAQwCCyAHIAtIDQELIAIMAgsgAiAINgIAIAMiAiAARw0ACyAACyAKNgIACyAFQQRqIgMgAUcNAAsLC8QBAQV/AkACQCAAKAIEIgIgACgCCCIDSQRAIAIgAS0AADoAACACQQFqIQEMAQsgAiAAKAIAIgJrIgVBAWoiBEEASA0BIAVB/////wcgAyACayIDQQF0IgYgBCAEIAZJGyADQf////8DTxsiAwR/IAMQIwVBAAsiBGoiBiABLQAAOgAAIAUEQCAEIAIgBfwKAAALIAAgAyAEajYCCCAAIAZBAWoiATYCBCAAIAQ2AgAgAkUNACACECILIAAgATYCBA8LECYAC9wIAQp/QQEhCwJAAkACQAJAAkACQAJAIAEgAGtBAnUOBgUFAAECAwQLIAIoAgAoAgAiAiABQQRrIgEoAgAiA0EMbGoiBCgCACIIIAIgACgCACIFQQxsaiICKAIAIgZOBEAgBiAIRw0FIAQoAgQgAigCBE4NBQsgACADNgIAIAEgBTYCAAwFCyABQQRrIQECQCACKAIAKAIAIgIgACgCBCIGQQxsaiIEKAIAIgMgAiAAKAIAIghBDGxqIgUoAgAiB0gNACADIAdGBEAgBCgCBCAFKAIESA0BCyADIAIgASgCACIIQQxsaiIFKAIAIgdMBEAgAyAHRw0FIAUoAgQgBCgCBE4NBQsgACAINgIEIAEgBjYCACACIAAoAgQiAUEMbGoiAygCACIEIAIgACgCACIIQQxsaiICKAIAIgVOBEAgBCAFRw0FIAMoAgQgAigCBE4NBQsgACAINgIEIAAgATYCAAwFCwJAIAMgAiABKAIAIgdBDGxqIgooAgAiCUwEQCADIAlHDQEgCigCBCAEKAIETg0BCyAAIAc2AgAgASAINgIADAULIAAgCDYCBCAAIAY2AgAgAiABKAIAIgNBDGxqIgIoAgAiBCAFKAIAIgZOBEAgBCAGRw0EIAIoAgQgBSgCBE4NBAsgACADNgIEIAEgCDYCAAwECyAAIABBBGogAEEIaiABQQRrIAIQ6QIMAwsgACAAQQRqIABBCGogAEEMaiABQQRrIAIQrQQMAgsgAEEIaiEDAkACQCACKAIAKAIAIgggACgCBCIKQQxsaiIGKAIAIgIgCCAAKAIAIgVBDGxqIgQoAgAiB0gNACACIAdGBEAgBigCBCAEKAIESA0BCyACIAggAygCACIJQQxsaiIHKAIAIgxMBEAgAiAMRw0CIAcoAgQgBigCBE4NAgsgACAKNgIIIAAgCTYCBCAHKAIAIgIgBCgCACIGTgRAIAIgBkcNAiAHKAIEIAQoAgRODQILIAAgBTYCBCAAIAk2AgAMAQsCQCACIAggAygCACIJQQxsaiIHKAIAIgxMBEAgAiAMRw0BIAcoAgQgBigCBE4NAQsgACAFNgIIIAAgCTYCAAwBCyAAIAU2AgQgACAKNgIAIAcoAgAiAiAEKAIAIgZOBEAgAiAGRw0BIAcoAgQgBCgCBE4NAQsgACAFNgIIIAAgCTYCBAsgAEEMaiICIAFGDQBBACEGA0ACQCAIIAIoAgAiB0EMbGoiBSgCACIEIAggAygCACILQQxsaiIKKAIAIglOBEAgBCAJRw0BIAUoAgQgCigCBE4NAQsgAiALNgIAAkADQCAFKAIAIgsgCCADQQRrIgQoAgAiCkEMbGoiCSgCACIMTgRAIAsgDEcNAiAFKAIEIAkoAgRODQILIAMgCjYCACAEIgMgAEcNAAsgACEDCyADIAc2AgAgBkEBaiIGQQhHDQAgAkEEaiABRg8LIAIiA0EEaiICIAFHDQALQQEhCwsgCw8LQQEL1AIBBn8gACABIAIgAyAFEOkCAkAgBSgCACgCACIFIAQoAgAiBkEMbGoiBygCACIIIAUgAygCACIJQQxsaiIKKAIAIgtOBEAgCCALRw0BIAcoAgQgCigCBE4NAQsgAyAGNgIAIAQgCTYCACAFIAMoAgAiBEEMbGoiBigCACIHIAUgAigCACIIQQxsaiIJKAIAIgpOBEAgByAKRw0BIAYoAgQgCSgCBE4NAQsgAiAENgIAIAMgCDYCACAFIAIoAgAiA0EMbGoiBCgCACIGIAUgASgCACIHQQxsaiIIKAIAIglOBEAgBiAJRw0BIAQoAgQgCCgCBE4NAQsgASADNgIAIAIgBzYCACAFIAEoAgAiAkEMbGoiAygCACIEIAUgACgCACIGQQxsaiIFKAIAIgdOBEAgBCAHRw0BIAMoAgQgBSgCBE4NAQsgACACNgIAIAEgBjYCAAsLxQQBBH8CQAJAAkACQCADDgMDAgABCyACKAIAKAIAIgIgAUEEayIBKAIAIgNBA3RqKQMAIAIgACgCACIFQQN0aikDAFQEQCAEIAM2AgAgBCAAKAIANgIEDwsgBCAFNgIAIAQgASgCADYCBA8LIANBCEwEQCAAIAFGDQIgBCAAKAIANgIAIABBBGoiBSABRg0CIAIoAgAoAgAhBiAEIQADQCAAQQRqIQICQCAGIAUoAgAiA0EDdGopAwAgBiAAKAIAIgdBA3RqKQMAVARAIAAgBzYCBAJ/IAQgACAERg0AGgNAIAAgBiAFKAIAQQN0aikDACAGIABBBGsiAygCACIHQQN0aikDAFoNARogACAHNgIAIAMiACAERw0ACyAECyAFKAIANgIADAELIAIgAzYCAAsgAiEAIAVBBGoiBSABRw0ACwwCCyAAIAAgA0EBdiIGQQJ0IgdqIgUgAiAGIAQgBhDGASAFIAEgAiADIAZrIgMgBCAHaiADEMYBIAIoAgAhBiAFIQMCQANAIAEgA0YNASAEIAMoAgAiAiAAKAIAIgcgBigCACIIIAJBA3RqKQMAIAggB0EDdGopAwBUIgIbNgIAIANBBEEAIAIbaiEDIARBBGohBCAAQQBBBCACG2oiACAFRw0ACyABIANGDQIDQCAEIAMoAgA2AgAgBEEEaiEEIANBBGoiAyABRw0ACwwCCyAAIAVGDQEDQCAEIAAoAgA2AgAgBEEEaiEEIABBBGoiACAFRw0ACwwBCyAEIAAoAgA2AgALC+QEAQN/AkACQAJAAkACQCACDgMEAgABCyABQRBrIgErAwAgACsDAGQEQCADIAEpAwg3AwggAyABKQMANwMAIAMgACkDCDcDGCADIAApAwA3AxAPCyADIAApAwg3AwggAyAAKQMANwMAIAMgASkDCDcDGCADIAEpAwA3AxAPCyACQQhMBEAgACABRg0DIAMgACkDCDcDCCADIAApAwA3AwAgAEEQaiIEIAFGDQMgAyEFA0AgBSICQRBqIgUhAAJAIAQrAwAgAisDAGRFDQAgBSACKQMINwMIIAUgAikDADcDACADIQAgAiADRg0AA0AgBCsDACACQRBrIgArAwBkRQRAIAIhAAwCCyACIAApAwg3AwggAiAAKQMANwMAIAAiAiADRw0ACyADIQALIAAgBCkDCDcDCCAAIAQpAwA3AwAgBEEQaiIEIAFHDQALDAMLIAAgACACQQF2IgRBBHQiBmoiBSAEIAMgBBDFASAFIAEgAiAEayICIAMgBmogAhDFASAFIQIDQCABIAJGBEAgACAFRg0EA0AgAyAAKQMINwMIIAMgACkDADcDACADQRBqIQMgAEEQaiIAIAVHDQALDAQLAkAgAisDACAAKwMAZARAIAMgAikDCDcDCCADIAIpAwA3AwAgAkEQaiECDAELIAMgACkDCDcDCCADIAApAwA3AwAgAEEQaiEACyADQRBqIQMgACAFRw0ACwwBCyADIAApAwg3AwggAyAAKQMANwMADAELIAEgAkYNAANAIAMgAikDCDcDCCADIAIpAwA3AwAgA0EQaiEDIAJBEGoiAiABRw0ACwsLbAEBfyAAKAIIIgFFBEBBAA8LAkAgACABKAIAIgBGBEAgAUEANgIAA0AgASgCBCIARQ0CA0AgACIBKAIAIgANAAsMAAsACyABQQA2AgQgAEUNAANAIAAiASgCACIADQAgASgCBCIADQALCyABC6ICAQV/IwBBIGsiBSQAAkACQCAAKAIEIgIgACgCCCIDSQRAIAIgASkCADcCACACQQhqIQEMAQsgAiAAKAIAIgRrQQN1IgZBAWoiAkGAgICAAk8NASAFQQxqQf////8BIAMgBGsiA0ECdSIEIAIgAiAESRsgA0H4////B08bIAYgABBLIgIoAgggASkCADcCACACIAIoAghBCGo2AgggAigCBCAAKAIEIAAoAgAiA2siAWshBCABBEAgBCADIAH8CgAACyAAKAIAIQMgACAENgIAIAIgAzYCBCAAIAIoAggiATYCBCACIAM2AgggACgCCCEEIAAgAigCDDYCCCACIAM2AgAgAiAENgIMIAIQmQELIAAgATYCBCAFQSBqJAAPCxAmAAtTAQF/IABBADYCCCAAQgA3AgAgAQRAIAAgARDxASAAKAIEIgMgAUECdGohASACKAIAIQIDQCADIAI2AgAgA0EEaiIDIAFHDQALIAAgATYCBAsgAAtkAQR/IAAoAgQiAkUEQA8LIAEoAgAhAyAAQQRqIgQhAQNAIAEgAiACKAIQIANIIgUbIQEgAkEEQQAgBRtqKAIAIgINAAsCQCABIARGDQAgAyABKAIQSA0AIAAgARDzAiABECILC6sCAQZ/IwBBMGsiBCQAIAQgAkEDbKw3AxggAUE4aiAEQRhqIgIQkgEgBCADKAIANgIYIAFBxABqIAIQPSAEIAMtAGggAy0AaUEBdHI6AC8gAUHcAGogBEEvahCrBCAALQAARQRAIARCgoCAgDA3AiAgBEKAgICAEDcCGCADQSBqIQggA0EIaiEAIAFB0ABqIQkDQCAEQRhqIAVqKAIAIQYgBEKAgICAEDcCDCAEQQI2AhQgAEEwQcgAIAZBAkYbaiEBQQAhAwNAIARBDGogA2ooAgAhByAAIQICQAJAAkAgBg4CAgABCyAIIQIMAQsgASECCyAJIAJBCEEQIAdBAUYbQQAgBxtqEKgCIANBBGoiA0EMRw0ACyAFQQRqIgVBEEcNAAsLIARBMGokAAuPCAILfwJ+IwBB4ABrIgEkACAAKALUAUEBdCECIAFBGGoiA0EANgIIIANCADcCACADQQFBICACQQFrZ2t0QQAgAhsiAhDsAiADQQA2AhggA0IANwIQIANBEGogAkEAEDEgA0EBNgIkIANBADYCICADIQQgASAAKALMASIDNgIMIAAoAtABIQYgAEEANgLQASABIAY2AhAgACgC1AEhAiAAQQA2AtQBIAEgAjYCFCAAIABB0AFqNgLMASABQRBqIQcCQCACRQRAQZiVAkGYlQIoAgAgAmo2AgAgASAHNgIMDAELIAYgBzYCCEGYlQJBmJUCKAIAIgYgAmo2AgAgAyAHRg0AIABBzAFqIQkgBEEgaiELA0AgASAEKAIkNgJAIAEgBCgCADYCRCABIAQoAgQ2AkggASAEKAIQNgJMIAQoAhQhAiABIAs2AlQgASACNgJQIAM0AhAhDSABIAY2AlwgAUHcAGohCgJAIAFBQGsiAigCCCIFIAIoAhQoAgBBAXRJDQAgDUIeiCANhUK5y5Pn0e2RrL9/fiIMQhuIIAyFQuujxJmxt5LolH9+IgxCH4ggDIWnIAVBAWtxIQUDQCACKAIEIAVBA3RqIgggDSAIKQMAIgwgDEJ/USIIGzcDACAIBEAgAigCFCIIIAgoAgBBAWo2AgAgAigCDCAFQQJ0aiAKKAIANgIADAILIAwgDVENASACKAIIIghBAWsgAigCACAFanEhBSACKAIUKAIAQQF0IAhNDQALCyABIAY2AgggASABQQhqIgU2AlwgAiAJIAUgChB5IAEoAkBBGGogA0EYakHqAPwKAAACQCADKAIEIgIEQANAIAIiAygCACICDQAMAgsACwNAIAMgAygCCCIDKAIARw0ACwsgBkEBaiEGIAMgB0cNAAsLIAAoAtgBIQMgACgCXCEAIAQoAiQhAiAEKAIAIQcgBCgCBCEGIAQoAhAhBSAEKAIUIQkgASAEQSBqNgJUIAEgCTYCUCABIAU2AkwgASAGNgJIIAEgBzYCRCABIAI2AkAgAEEDTwRAIAMgAEEDbkEEdGohBwNAAkAgAzQCACINIAFBQGsiACgCBCAAKAIIQQFrIgYgDUIeiCANhUK5y5Pn0e2RrL9/fiIMQhuIIAyFQuujxJmxt5LolH9+IgxCH4ggDIWncSICQQN0aikDACIMUSAMQn9Rcg0AIAAoAgAhBQNAIAAoAgQgBiACIAVqcSICQQN0aikDACIMIA1RDQEgDEJ/Ug0ACwsgAyAAKAIMIAJBAnRqKAIANgIAIANBEGoiAyAHRw0ACwsgAUEMaiABKAIQEG8gBCgCECIABEAgABAiCyAEQQA2AhggBEIANwIQIAQoAgAiAARAIAAQIgsgAUHgAGokAAv9BAMHfwZ8A34jAEHQAGsiAiQAIAEoAgQiAwRAIAEoAgAiASADQTBsaiEFIAAoAgAhAwNAIAMgAUEw/AoAACADQeAAaiEDIAFBMGoiASAFRw0ACwsgACgCJCEBIAJBADYCCCACQgA3AgAgAiABQQAQMSAAKQIAIQ8gACkCECEQIAAoAiAhASACKQIAIREgAiAAKAIkIgM2AkwgAiABNgJIIAIgEDcCQCACIBE3AjggAiAPNwIwIAJBMGohAEEAIQEgA0EBakEAIAMbIgcEQANAIwBBMGsiAyQAIAFBAXQhBgNAAkAgACgCCCAAKAIQIAZBAnRqKAIAIgZBAWtBAm0iBUECdGoiBCAEKAIAIgRBAWo2AgAgBEUNACAAKAIAIgQgACgCGCAFQQN0aiIIKAIAQTBsaiEFIAQgCCgCBEEwbGoiBCsDACEJIAUrAwAhCiAEKwMIIQsgBSsDCCEMIAMgBSsDECINIAQrAxAiDiANIA5jGzkDECADIAwgCyALIAxkGzkDCCADIAogCSAJIApkGzkDACAEKwMYIQkgBSsDGCEKIAQrAyAhCyAFKwMgIQwgAyAEKwMoIg0gBSsDKCIOIA0gDmQbOQMoIAMgCyAMIAsgDGQbOQMgIAMgCSAKIAkgCmQbOQMYIAAoAgAgBkEwbGogA0Ew/AoAACAGQQFHDQELCyADQTBqJAAgAUEBaiIBIAdHDQALCyACIAAoAgA2AhAgAiAAKAIENgIUIAIgACgCCDYCGCACIAAoAgw2AhwgAiAAKAIQNgIgIAIgACgCFDYCJCACIAAoAhg2AiggAiAAKAIcNgIsIAIoAgAiAARAIAAQIgsgAkHQAGokAAuBAQEBfwJAIAAgAUYNACAAKAIAIgIEQCACECILIABCADcCACAAIAEoAgQiAjYCCCAAIAI2AgQgAkUNACAAIAJBA3QiAhAnIgA2AgAgASgCACIBIAJqIQIDQCAAIAEoAgA2AgAgACABKAIENgIEIABBCGohACABQQhqIgEgAkcNAAsLC10BAX8CQCAAIAFGDQAgACgCACICBEAgAhAiCyAAQgA3AgAgACABKAIEIgI2AgggACACNgIEIAJFDQAgACACQQJ0IgAQJyICNgIAIABFDQAgAiABKAIAIAD8CgAACwtdAQF/AkAgACABRg0AIAAoAgAiAgRAIAIQIgsgAEIANwIAIAAgASgCBCICNgIIIAAgAjYCBCACRQ0AIAAgAkEwbCIAECciAjYCACAARQ0AIAIgASgCACAA/AoAAAsL/gEBDXwgACABRwRAIAMrA0AhCCADKwM4IQkgAysDMCEKIAMrAyghCyADKwMgIQwgAysDGCENIAMrAxAhDiADKwMIIQ8gAysDACEQA0AgAkQAAAAAAAAAACAOIAArAwAiBKIgCyAAKwMIIgWioCAIIAArAxAiBqKgIgcgByAHoiAQIASiIA0gBaKgIAogBqKgIgcgB6IgDyAEoiAMIAWioCAJIAaioCIEIASioKCfIgWjIAcgBaMiBiAGYiIDGzkDECACRAAAAAAAAAAAIAQgBaMgAxs5AwggAkQAAAAAAAAAACAGIAMbOQMAIAJBGGohAiAAQRhqIgAgAUcNAAsLC9MBAgJ8AX8jAEEQayIEJAAgBCAAKQNINwIIIAEoAhAiAQRAIAEgBEEIaiABKAIAKAIYEQEAIAAQWAJAIAAQgwRFBEAgAEEBECwMAQsgACAAEKIBRBHqLYGZl3E9oiICRAAAAAAAAPC/IAJEAAAAAAAA8L9kGyICRAAAAAAAAPC/IAK9Qv///////////wCDQoCAgICAgID4/wBUGyICOQMwIAAgAiAAKwM4IgMgAiADZBs5AzggAEEAEFQgABBaIABBfzYCyAELIARBEGokAA8LEGYAC+wBAgR/AX4gACgCBCIDIAFBAXRLIANBEEtxAkAgASADTQ0AIAAgARDQBCABIAAoAgQiA2siBEEATA0AIAIpAgAhByAAKAIAIANBA3RqIQIDQCACIAc3AgAgAkEIaiECIARBAUsgBEEBayEEDQALCyAAIAE2AgQEQEEAIQQgACgCACECIAAoAgQiBQRAIAIgBUEDdCIBaiEDIAEQJyIEIQYgAiEBA0AgBiABKAIANgIAIAYgASgCBDYCBCAGQQhqIQYgAUEIaiIBIANHDQALCyAAIAIEfyACECIgACgCBAUgBQs2AgggACAENgIACwuSBgIPfwJ+IwBBQGoiAiQAAkAgACgCQCIFRQ0AIABB2ABqEDggAEHoAGoQOCAAQfgAahA4IAAoAlwhASACQQA2AiggAkIANwIgIAJCfzcDCCACQn83AzAgAkEgaiABIAJBCGoQvAQgACgCXCIKBEAgACgCiAEhBCAAKAJ4IQYgACgC2AEhByAAKAJoIQsgAigCICEMA0ACQCALIANBAnQiCGooAgAiAUEASA0AIAcgA0EDbkEEdGooAgAgByABQQNuIglBBHRqKAIARw0AIAQgBkF4QQQgASAJQQNsa0ECRhtqIAFBAnRqKAIAIgkgBWxBA3RqIQ0gBCAGIAhqKAIAIgggBWxBA3RqIQ5BACEBA0AgDiABQQN0Ig9qKwMAIA0gD2orAwBiDQEgAUEBaiIBIAVHDQALIAwgA0EDdGoiASAJNgIEIAEgCDYCAAsgA0EBaiIDIApHDQALCyACQQA2AhwgAkIANwIUIAJBMGoCfyAAKAJAIgFFBEAgACgCTAwBCyAAKAKMASABbgsiBRCWASEDIAUEQCAFrSERA0AgAygCACAQp0EDdGogEDcDACAQQgF8IhAgEVINAAsLIAIoAiQiBARAIAIoAiAiASAEQQN0aiEEA0ACQCABKAIAIgZBf0YNACABKAIEIgdBf0YNACADIAYgBxBfCyABQQhqIgEgBEcNAAsLIAMgAkEUahCMBSEEIAMoAgAiAQRAIAMgATYCBCADKAIIGiABECILIAJBMGogBBDsASIEKAIAIQMgBQRAQQAhASACKAIUIQYDQCADIAYgAUECdGooAgBBAnRqIAE2AgAgAUEBaiIBIAVHDQALCwJAAkAgACgCXCIFBEAgACgCeCEAQQAhASACKAIUIQYDQCAAIAFBAnRqIgcgAyAGIAcoAgBBAnRqKAIAQQJ0aigCADYCACABQQFqIgEgBUcNAAsMAQsgA0UNAQsgBCADNgIEIAQoAggaIAMQIgsgAigCFCIABEAgAiAANgIYIAIoAhwaIAAQIgsgAigCICIARQ0AIAAQIgsgAkFAayQAC9gEAgZ/A3wjAEHQAGsiByQAAkAgASgCBCIIIAFBCGoiCkYNAANAIAgtAIEBRQRAAkAgCCgCBCIJBEADQCAJIggoAgAiCQ0ADAILAAsDQCAIIAgoAggiCCgCAEcNAAsLIAggCkcNAQwCCwsgB0EANgJIIAdCADcCQCAHQUBrIARBABCBASAAKAIEBEBBACEEA0ACQCABIARBA24Q5ARFDQAgACgCICAEQQJ0aigCACIIQQBIDQAgBygCQCAIaiIJLQAADQAgCUEBOgAAIAdCADcDOCAHQgA3AzAgB0IANwMoIAdBAjYCJCAHQoCAgIAQNwIcIAYgCGogBWxBA3QiCiADKAIAaiELQQAhCANAIAdBKGoiDEEIQRAgB0EcaiAIaigCACIJQQFGG0EAIAkbaiALIAlBA3RqKwMAOQMAIAhBBGoiCEEMRw0ACyAHIAIgDBCXAiAHIAcrAxAiDSAHKwMAIg4gDqIgBysDCCIPIA+ioCANIA2ioJ8iDaNEAAAAAAAAAAAgDiANoyIOvUL///////////8Ag0KAgICAgICA+P8AVCIIGzkDOCAHIA8gDaNEAAAAAAAAAAAgCBs5AzAgByAORAAAAAAAAAAAIAgbOQMoIAdBAjYCJCAHQoCAgIAQNwIcIAMoAgAgCmohCkEAIQgDQCAKIAdBHGogCGooAgAiCUEDdGogB0EoakEIQRAgCUEBRhtBACAJG2orAwA5AwAgCEEEaiIIQQxHDQALCyAEQQFqIgQgACgCBEkNAAsLIAcoAkAiAEUNACAAECILIAdB0ABqJAALlScBEH8CQANAIAFBBGshDiABQQxrIREgAUEIayESA0ACQAJAAkACQAJAAkACQCABIAAiCGtBAnUiBQ4GCQkAAQQCAwsgAigCACgCACIAIAFBBGsiASgCACICQQxsaiIDKAIAIgQgACAIKAIAIgVBDGxqIgAoAgAiBk4EQCAEIAZHDQkgAygCBCAAKAIETg0JCyAIIAI2AgAgASAFNgIADwsgAUEEayEAAkAgAigCACgCACIBIAgoAgQiBkEMbGoiAygCACICIAEgCCgCACIEQQxsaiIFKAIAIgdIDQAgAiAHRgRAIAMoAgQgBSgCBEgNAQsgAiABIAAoAgAiBEEMbGoiBSgCACIHTARAIAIgB0cNCSAFKAIEIAMoAgRODQkLIAggBDYCBCAAIAY2AgAgASAIKAIEIgBBDGxqIgIoAgAiAyABIAgoAgAiBEEMbGoiASgCACIFTgRAIAMgBUcNCSACKAIEIAEoAgRODQkLIAggBDYCBCAIIAA2AgAPCwJAIAIgASAAKAIAIgdBDGxqIgooAgAiC0wEQCACIAtHDQEgCigCBCADKAIETg0BCyAIIAc2AgAgACAENgIADwsgCCAENgIEIAggBjYCACABIAAoAgAiAkEMbGoiASgCACIDIAUoAgAiBk4EQCADIAZHDQggASgCBCAFKAIETg0ICyAIIAI2AgQgACAENgIADwsgCCAIQQRqIAhBCGogCEEMaiABQQRrIAIQrQQPCyAFQRdKDQEgBEEBcUUNAiABIAhGDQUgCEEEaiIFIAFGDQUgAigCACgCACEEIAghAgNAIAIhACAFIQICQCAEIAAoAgQiB0EMbGoiBigCACIDIAQgACgCACIFQQxsaiIKKAIAIgtOBEAgAyALRw0BIAYoAgQgCigCBE4NAQsgACAFNgIEAn8gCCAAIAhGDQAaAkADQCAGKAIAIgUgBCAAQQRrIgMoAgAiCkEMbGoiCygCACIOTgRAIAUgDkcNAiAGKAIEIAsoAgRODQILIAAgCjYCACADIgAgCEcNAAsgCAwBCyAACyAHNgIACyACQQRqIgUgAUcNAAsMBQsgCCAIQQRqIAhBCGogAUEEayACEOkCDAQLIANFBEAgASAIRg0EIAIoAgAhDCAFQQJrQQF2IgohAANAAkAgCiAAIgNIDQAgCCAAQQJ0aiEEIAggAEEBdCIGQQFyIgBBAnRqIQsgDCgCACEHAkACQCAGQQJqIgYgBU4NACAHIAsoAgBBDGxqIg4oAgAiCSAHIAsoAgRBDGxqIg0oAgAiD04EQCAJIA9HDQEgDigCBCANKAIETg0BCyALQQRqIQsMAQsgACEGCyAHIAsoAgAiAEEMbGoiCSgCACINIAcgBCgCACIPQQxsaiIOKAIAIhFIDQAgDSARRgRAIAkoAgQgDigCBEgNAQsgBCAANgIAAkACQCAGIApKDQADQCAIIAZBAXQiBkEBciIEQQJ0aiEAAkACQCAGQQJqIgYgBU4NACAHIAAoAgBBDGxqIgkoAgAiDSAHIAAoAgRBDGxqIhEoAgAiEk4EQCANIBJHDQEgCSgCBCARKAIETg0BCyAAQQRqIQAMAQsgBCEGCyAHIAAoAgAiBEEMbGoiCSgCACINIA4oAgAiEUgNASANIBFGBEAgCSgCBCAOKAIESA0CCyALIAQ2AgAgACELIAYgCkwNAAsMAQsgCyEACyAAIA82AgALIANBAWshACADDQALA0AgBSIEQQJrQQF2IQwgAigCACELIAgoAgAhDkEAIQAgCCEFA0AgAEEBdCIHQQFyIQMgBSIGIABBAnRqIgBBBGohBQJ/AkAgB0ECaiIHIARODQAgCygCACIJIAAoAgRBDGxqIg0oAgAiDyAJIABBCGoiCigCAEEMbGoiCSgCACIATgRAIAAgD0cNASADIA0oAgQgCSgCBE4NAhoLIAohBSAHDAELIAMLIQAgBiAFKAIANgIAIAAgDEwNAAsCQCABQQRrIgEgBUYEQCAFIA42AgAMAQsgBSABKAIANgIAIAEgDjYCACAFIAhrQQRqQQJ1IgBBAkgNACALKAIAIgcgCCAAQQJrQQF2IgBBAnRqIgYoAgAiCkEMbGoiCygCACIOIAcgBSgCACIMQQxsaiIDKAIAIglOBEAgCSAORw0BIAsoAgQgAygCBE4NAQsgBSAKNgIAAkACQCAARQ0AA0AgByAIIABBAWtBAXYiAEECdGoiBSgCACIKQQxsaiILKAIAIg4gAygCACIJTgRAIAkgDkcNAiALKAIEIAMoAgRODQILIAYgCjYCACAFIQYgAA0ACwwBCyAGIQULIAUgDDYCAAsgBEEBayEFIARBAkoNAAsMBAsgCCAFQQF0QXxxaiEKIAIoAgAoAgAhBwJAAkACQAJAIAVBgQFPBEACQAJAIAcgCigCACILQQxsaiIFKAIAIgAgByAIKAIAIgxBDGxqIgYoAgAiCUgNACAAIAlGBEAgBSgCBCAGKAIESA0BCyAAIAcgDigCACIGQQxsaiIMKAIAIglMBEAgACAJRw0CIAwoAgQgBSgCBE4NAgsgCiAGNgIAIA4gCzYCACAHIAooAgAiAEEMbGoiBSgCACIGIAcgCCgCACILQQxsaiIMKAIAIglOBEAgBiAJRw0CIAUoAgQgDCgCBE4NAgsgCCAANgIAIAogCzYCAAwBCwJAAkAgACAHIA4oAgAiCUEMbGoiDSgCACIPTARAIAAgD0cNASANKAIEIAUoAgRODQELIAggCTYCAAwBCyAIIAs2AgAgCiAMNgIAIAcgDigCACIAQQxsaiIFKAIAIgsgBigCACIJTgRAIAkgC0cNAiAFKAIEIAYoAgRODQILIAogADYCAAsgDiAMNgIACwJAAkAgByAKQQRrIgsoAgAiDEEMbGoiBSgCACIAIAcgCCgCBCIJQQxsaiIGKAIAIg1IDQAgACANRgRAIAUoAgQgBigCBEgNAQsgACAHIBIoAgAiBkEMbGoiCSgCACINTARAIAAgDUcNAiAJKAIEIAUoAgRODQILIAsgBjYCACASIAw2AgAgByALKAIAIgBBDGxqIgUoAgAiBiAHIAgoAgQiDEEMbGoiCSgCACINTgRAIAYgDUcNAiAFKAIEIAkoAgRODQILIAggADYCBCALIAw2AgAMAQsCQAJAIAAgByASKAIAIg1BDGxqIg8oAgAiEEwEQCAAIBBHDQEgDygCBCAFKAIETg0BCyAIIA02AgQMAQsgCCAMNgIEIAsgCTYCACAHIBIoAgAiAEEMbGoiBSgCACIMIAYoAgAiDU4EQCAMIA1HDQIgBSgCBCAGKAIETg0CCyALIAA2AgALIBIgCTYCAAsCQAJAIAcgCigCBCIMQQxsaiIFKAIAIgAgByAIKAIIIglBDGxqIgYoAgAiDUgNACAAIA1GBEAgBSgCBCAGKAIESA0BCyAAIAcgESgCACIGQQxsaiIJKAIAIg1MBEAgACANRw0CIAkoAgQgBSgCBE4NAgsgCiAGNgIEIBEgDDYCACAHIAooAgQiAEEMbGoiBSgCACIGIAcgCCgCCCIMQQxsaiIJKAIAIg1OBEAgBiANRw0CIAUoAgQgCSgCBE4NAgsgCCAANgIIIAogDDYCBAwBCwJAAkAgACAHIBEoAgAiDUEMbGoiDygCACIQTARAIAAgEEcNASAPKAIEIAUoAgRODQELIAggDTYCCAwBCyAIIAw2AgggCiAJNgIEIAcgESgCACIAQQxsaiIFKAIAIgwgBigCACINTgRAIAwgDUcNAiAFKAIEIAYoAgRODQILIAogADYCBAsgESAJNgIACwJAIAcgCigCACIAQQxsaiINKAIAIgwgByALKAIAIgVBDGxqIgkoAgAiBkgNACAGIAxGBEAgDSgCBCAJKAIESA0BCyAMIAcgCigCBCIGQQxsaiIPKAIAIhBMBEAgDCAQRw0EIA8oAgQgDSgCBE4NBAsgCiAANgIEIAogBjYCACAPKAIAIgAgCSgCACIMTgRAIAAgDEcNAyAPKAIEIAkoAgRODQMLIAsgBjYCACAKIAU2AgAMBAsCQCAMIAcgCigCBCIGQQxsaiIPKAIAIhBMBEAgDCAQRw0BIA8oAgQgDSgCBE4NAQsgCyAGNgIAIAogBTYCBAwDCyALIAA2AgAgCiAFNgIAIA8oAgAiACAJKAIAIgtOBEAgACALRw0EIA8oAgQgCSgCBE4NBAsgCiAFNgIEIAogBjYCACAGIQUMAwsCQCAHIAgoAgAiC0EMbGoiBSgCACIAIAcgCigCACIMQQxsaiIGKAIAIglIDQAgACAJRgRAIAUoAgQgBigCBEgNAQsgACAHIA4oAgAiBkEMbGoiDCgCACIJTARAIAAgCUcNBSAMKAIEIAUoAgRODQULIAggBjYCACAOIAs2AgAgByAIKAIAIgBBDGxqIgUoAgAiBiAHIAooAgAiC0EMbGoiDCgCACIJTgRAIAYgCUcNBSAFKAIEIAwoAgRODQULIAogADYCACAIIAs2AgAMBAsCQAJAIAAgByAOKAIAIglBDGxqIg0oAgAiD0wEQCAAIA9HDQEgDSgCBCAFKAIETg0BCyAKIAk2AgAMAQsgCiALNgIAIAggDDYCACAHIA4oAgAiAEEMbGoiBSgCACIKIAYoAgAiC04EQCAKIAtHDQUgBSgCBCAGKAIETg0FCyAIIAA2AgALIA4gDDYCAAwDCyAGIQUMAQsgACEFCyAIKAIAIQAgCCAFNgIAIAogADYCAAsgA0EBayEDIAgoAgAhEwJAAkACQCAEQQFxIhQNACAHIAhBBGsoAgBBDGxqIgAoAgAiBSAHIBNBDGxqIgkoAgAiCkgNACAFIApGBEAgACgCBCAJKAIESA0BCyAHIA4oAgAiDUEMbGoiACgCACILIApMBEAgCiALRw0CIAkoAgQgACgCBE4NAgsgCEEEaiIGIQAgCiAHIAgoAgQiBUEMbGooAgAiDEgNAgNAAkAgCiAMRw0AIAkoAgQgByAFQQxsaigCBE4NACAGIQAMBAsgBigCBCEFIAZBBGoiACEGIAogByAFQQxsaigCACIMTg0ACwwCCyACKAIAKAIAIgkgE0EMbGoiDygCACEAIAghCgNAIAoiBUEEaiEKIAkgBSgCBCINQQxsaiIGKAIAIgcgAEgNACAAIAdGBEAgBigCBCAPKAIESA0BCwsCQCAFIAhHBEAgCSAOIgcoAgAiC0EMbGooAgAiBiAASA0BA0AgACAGRgRAIAkgC0EMbGooAgQgDygCBEgNAwsgCSAHQQRrIgcoAgAiC0EMbGooAgAiBiAATg0ACwwBCyAKIAEiB08NACAJIA4iBygCACILQQxsaigCACIGIABIDQADQAJAIAAgBkYEQCAHIApNDQMgCSALQQxsaigCBCAPKAIETg0BDAMLIAcgCk0NAgsgCSAHQQRrIgcoAgAiC0EMbGooAgAiBiAATg0ACwsgByAKSwRAIAcoAgAhACAKIQYgByEMA0AgBiAANgIAIAwgDTYCACAPKAIAIRADQCAGIgVBBGohBiAJIAUoAgQiDUEMbGoiACgCACILIBBIDQAgCyAQRgRAIAAoAgQgDygCBEgNAQsLAkAgCSAMQQRrIgwoAgAiAEEMbGooAgAiCyAQSA0AA0AgCyAQRgRAIAkgAEEMbGooAgQgDygCBEgNAgsgCSAMQQRrIgwoAgAiAEEMbGooAgAiCyAQTg0ACwsgBiAMSQ0ACwsgBSAIRwRAIAggBSgCADYCAAsgBSATNgIAIAcgCk0EQCAIIAUgAhCsBCEGIAVBBGoiACABIAIQrAQEQCAFIQEgCCEAIAZFDQYMBwsgBg0ECyAIIAUgAiADIBQQvwQgBUEEaiEAQQAhBAwDCyAIQQRqIgAgAU8NAANAIAogByAAKAIAQQxsaiIEKAIAIgVIDQEgBSAKRgRAIAkoAgQgBCgCBEgNAgsgAEEEaiIAIAFJDQALCwJAIAEiBiAATQ0AIAYhBQNAIAVBBGshBiAKIAtOBEAgCiALRw0CIAkoAgQgByANQQxsaigCBE4NAgsgByAFQQhrKAIAIg1BDGxqKAIAIQsgBiEFDAALAAsgACAGSQRAIAYoAgAhDSAAKAIAIQwDQCAAIA02AgAgBiAMNgIAIAAoAgQhDCAAQQRqIgUhAAJAIAkoAgAiBCAHIAxBDGxqKAIAIgtIDQADQAJAIAQgC0cNACAJKAIEIAcgDEEMbGooAgRODQAgBSEADAILIAUoAgQhDCAFQQRqIgAhBSAEIAcgDEEMbGooAgAiC04NAAsLA0AgBCAHIAZBBGsiBigCACINQQxsaiIFKAIAIgpIDQAgBCAKRgRAIAkoAgQgBSgCBEgNAQsLIAAgBkkNAAsLIABBBGsiBCAIRwRAIAggBCgCADYCAAsgBCATNgIAQQAhBAwBCwsLIAEgCEYNACAIQQRqIgUgAUYNACACKAIAKAIAIQIDQCAIIQAgBSEIAkAgAiAAKAIEIgRBDGxqIgMoAgAiBSACIAAoAgAiBkEMbGoiBygCACIKTgRAIAUgCkcNASADKAIEIAcoAgRODQELIAghBQNAIAUgBjYCACADKAIAIgcgAiAAIgVBBGsiACgCACIGQQxsaiIKKAIAIgtIDQAgByALRgRAIAMoAgQgCigCBEgNAQsLIAUgBDYCAAsgCEEEaiIFIAFHDQALCwvUCAIFfwJ8IwBB8AFrIgMkACAAQgA3A0AgAEKAgICAgICA+L9/NwM4IABCgICAgICAgPi/fzcDMCAAQoCAgICAgIB4NwMoIABCgICAgICAgHg3AyAgAEKAgICAgICAeDcDGCAAQoCAgICAgID4/wA3AxAgAEKAgICAgICA+P8ANwMIIABCgICAgICAgPj/ADcDACAAQgA3A0ggAEEANgJQIABB2ABqEKECGiAAQgA3A9ABIABBfzYCyAEgAEEANgLAASAAQgA3A7gBIABBADYCsAEgAEIANwOoASAAQQA2AqABIABCADcDmAEgAEEANgKQASAAQgA3A4gBIABBADYCkAIgAEIANwOIAiAAQQA2AoACIABCADcD+AEgAEEANgLwASAAQgA3A+gBIABBADYC4AEgAEIANwPYASAAIABB0AFqNgLMASADQQA2AuwBIANCADcC5AEgA0EANgLgASADQgA3AtgBAkACQAJAAkAgAQ4DAAECAwsgA0EYaiIBQYD5AEHgAPwKAAAgA0HkAWogASADQfgAakEEEPECIAFB4PkAQTD8CgAAIANB2AFqIAEgA0HIAGpBBBDwAgwCCyADQRhqIgFBkPoAQcAB/AoAACADQeQBaiABIANB2AFqIgVBCBDxAiABQdD7AEGQAfwKAAAgBSABIANBqAFqQQwQ8AIMAQsgA0EYaiIBQeD8AEGQAfwKAAAgA0HkAWogASADQagBakEGEPECIAFB8P0AQeAA/AoAACADQdgBaiABIANB+ABqQQgQ8AILIAMoAugBIgYgAygC5AEiBWsiAUEYbSEHAkAgBSAGRiIGDQAgARAnIQQgAUUNACAEIAUgAfwKAAALIAAoAkgiBQRAIAUQIgsgACAHNgJQIAAgBzYCTCAAIAQ2AkggBkUEQCABIARqIQEDQCADIAQrAwA5AxggAyAEKwMIOQMgIAQrAxAhCCADQoCAgICAgID4PzcDMCADIAg5AyggAyACIANBGGoQoQEgBCADKQMQNwMQIAQgAykDCDcDCCAEIAMpAwA3AwAgBEEYaiIEIAFHDQALCyADQQA2AhggAyADKALcASIFIAMoAtgBIgJrIgFBDG0iBDYCICADIAQ2AhxBACEEAkAgAiAFRg0AIAMgARAnIgQ2AhggAUUNACAEIAIgAfwKAAALIANBADYCCCADQgA3AgAgACADQRhqIAMQngEgBARAIAQQIgsgABCOASAAEFggACAAEKIBRBHqLYGZl3E9oiIIRAAAAAAAAPC/IAhEAAAAAAAA8L9kGyIIRAAAAAAAAPC/IAi9Qv///////////wCDQoCAgICAgID4/wBUGyIIOQMwIAAgCCAAKwM4IgkgCCAJZBs5AzggAEEAEFQgABBaIAMoAtgBIgEEQCADIAE2AtwBIAMoAuABGiABECILIAMoAuQBIgEEQCADIAE2AugBIAMoAuwBGiABECILIANB8AFqJAAgAAsZAQF/QZiVAiIBIAAgASgCACIAajYCACAAC+gCAQd/IAIoAgQhBQJAIAEoAgQiBGkiCEEBTQRAIARBAWsgBXEhBQwBCyAEIAVLDQAgBSAEcCEFCyABKAIAIgkgBUECdGoiBigCACEDA0AgAyIHKAIAIgMgAkcNAAsCQCABQQhqIAdHBEAgBygCBCEDAkAgCEEBTQRAIAMgBEEBa3EhAwwBCyADIARJDQAgAyAEcCEDCyADIAVGDQELIAIoAgAiAwRAIAMoAgQhAwJAIAhBAU0EQCADIARBAWtxIQMMAQsgAyAESQ0AIAMgBHAhAwsgAyAFRg0BCyAGQQA2AgALIAcCf0EAIAIoAgAiBkUNABogBigCBCEDAkAgCEEBTQRAIAMgBEEBa3EhAwwBCyADIARJDQAgAyAEcCEDCyAGIAMgBUYNABogCSADQQJ0aiAHNgIAIAIoAgALNgIAIAJBADYCACABIAEoAgxBAWs2AgwgAEEBOgAIIAAgATYCBCAAIAI2AgALJwEBfyAAQSBqEMcBIAAoAggiAQRAIAAgATYCDCAAKAIQGiABECILC+4JAQZ/An8CQCABIgMoAgAiBARAIAMoAgQiAkUNAQNAIAIiAygCACICDQALCyADKAIEIgQNACADKAIIIQVBACEEQQEMAQsgBCADKAIIIgU2AghBAAshBgJAIAUoAgAiAiADRgRAIAUgBDYCACAAIANGBEBBACECIAQhAAwCCyAFKAIEIQIMAQsgBSAENgIECyADLQAMIQcgASADRwRAIAMgASgCCCIFNgIIAkAgBSgCACABRgRAIAUgAzYCAAwBCyAFIAM2AgQLIAMgASgCACIFNgIAIAUgAzYCCCADIAEoAgQiBTYCBCAFBEAgBSADNgIICyADIAEtAAw6AAwgAyAAIAAgAUYbIQALAkACQCAARSAHQQFxRXJFBEAgBgRAA0AgAi0ADCEEAkAgAigCCCIBKAIAIgMgAkcEQCAEQQFxRQRAIAJBAToADCABQQA6AAwgASABKAIEIgMoAgAiBDYCBCAEBEAgBCABNgIICyADIAEoAggiBDYCCAJAIAQoAgAgAUYEQCAEIAM2AgAMAQsgBCADNgIECyADIAE2AgAgASADNgIIIAIgACAAIAIoAgAiAUYbIQAgASgCBCECCwJAAkACQAJAIAIoAgAiAwRAIAMtAAxBAUcNAQsgAigCBCIBBEAgAS0ADEEBRw0CCyACQQA6AAwgACACKAIIIgJHBEAgAi0ADA0GCyACQQE6AAwPCyACKAIEIgFFDQELIAEtAAxBAUYNACACIQMMAQsgA0EBOgAMIAJBADoADCACIAMoAgQiADYCACAABEAgACACNgIICyADIAIoAggiADYCCAJAIAAoAgAgAkYEQCAAIAM2AgAMAQsgACADNgIECyADIAI2AgQgAiADNgIIIAIhAQsgAyADKAIIIgAtAAw6AAwgAEEBOgAMIAFBAToADCAAIAAoAgQiASgCACICNgIEIAIEQCACIAA2AggLIAEgACgCCCICNgIIAkAgAigCACAARgRAIAIgATYCAAwBCyACIAE2AgQLIAEgADYCACAAIAE2AggPCyAEQQFxRQRAIAJBAToADCABQQA6AAwgASADKAIEIgQ2AgAgBARAIAQgATYCCAsgAyABKAIIIgQ2AggCQCAEKAIAIAFGBEAgBCADNgIADAELIAQgAzYCBAsgAyABNgIEIAEgAzYCCCACIAAgACACKAIEIgFGGyEAIAEoAgAhAgsgAigCACIBBEAgAS0ADEEBRw0FCwJAIAIoAgQiAwRAIAMtAAxBAUcNAQsgAkEAOgAMIAIoAggiAi0ADEEBRiAAIAJHcQ0BIAJBAToADA8LIAEEQCABLQAMQQFHDQUgAigCBCEDCyADQQE6AAwgAkEAOgAMIAIgAygCACIANgIEIAAEQCAAIAI2AggLIAMgAigCCCIANgIIAkAgACgCACACRgRAIAAgAzYCAAwBCyAAIAM2AgQLIAMgAjYCACACIAM2AgggAiEBDAULIAIoAggiAUEEQQAgAiABKAIARhtqKAIAIQIMAAsACyAEQQE6AAwLDwsgAiEDCyADIAMoAggiAC0ADDoADCAAQQE6AAwgAUEBOgAMIAAgACgCACIBKAIEIgI2AgAgAgRAIAIgADYCCAsgASAAKAIIIgI2AggCQCACKAIAIABGBEAgAiABNgIADAELIAIgATYCBAsgASAANgIEIAAgATYCCAs0AQJ/IAAEQANAIAAoAgAgACgCECIBBEAgACABNgIUIAAoAhgaIAEQIgsgABAiIgANAAsLC+cDAQ1/IwBB4ABrIgdBGGpBAEHIAPwLACADQQNsIQwgACgCECENIAAoAiAhDiAAKAIAIQ8gAigCACEQQQAhAgNAIAIhCiAHQQI2AhQgB0KAgICAEDcCDCAEIAlBDGxqIQtBACEDA0AgC0EEQQhBBEEIIAdBDGogA2ooAgAiBkEBRhtBACAGGyIGQfD4AGooAgAiCEEBRhtBACAIG2ooAgAhESAGIAtqKAIAIQggB0EYaiACIgZBDGxqIgIgBiAMaiISNgIIIAIgETYCBCACIAg2AgAgDyASQQJ0IgJqIBAgCEEEdGoiCCgCADYCACACIA5qIAgoAgw2AgAgAiANakF/NgIAIAZBAWohAiADQQRqIgNBDEcNAAsgCUEBaiIJIAVHDQALIAZBAE4EQCAKQQJqIgJBACACQQBKGyECIAAoAhAhCkEAIQMDQCAHQRhqIAMiAEEMbGoiAygCCCEEIAMoAgQhCSADKAIAIQVBACEDAkACQANAAkAgCSAHQRhqIANBDGxqIgYoAgBGBEAgBigCBCAFRg0BCyACIANGIANBAWohA0UNAQwCCwsgBigCCCIDQQBIDQAgCiAEQQJ0aiADNgIADAELIAEoAgAgBUECdGogBDYCAAsgAEEBaiEDIAAgAkcNAAsLC7YCAgZ/CXwjAEEgayIFJAAgAEEANgIIIABCADcCACABKAIAIgYgASgCBCIHRwRAIAQrAyghDiAEKwMgIQ8gBCsDGCEQIAQrAxAhESAEKwMIIRIgBCsDACETA0AgBUEANgIQIAVCADcCCCAAIAVBCGoQaCAFKAIIIgEEQCAFIAE2AgwgBSgCEBogARAiCyAGKAIAIgQgBigCBCIIRwRAA0AgACgCBCADKAIAIAIoAgAgBCgCACIKQQR0aigCAEEYbGoiASsDECELIAErAwAhDCABKwMIIQ0gBSAKNgIYIAUgDCASoiANIBCioCALIA6ioDkDECAFIAwgE6IgDSARoqAgCyAPoqA5AwhBDGsgBUEIahDEASAEQQRqIgQgCEcNAAsLIAZBDGoiBiAHRw0ACwsgBUEgaiQAC5YBAQJ/IAAoAgAhAiAAKAIEIgAEQCACIAIoAgBBfyAAdEF/QSAgAGsiACABIAAgACABSxsiAGt2cUF/c3E2AgAgAkEEaiECIAEgAGshAQsCQCABQQV2IgBFDQAgAEECdCIDRQ0AIAJBACAD/AsACyABQR9xIgEEQCACIABBAnRqIgAgACgCAEF/QSAgAWt2QX9zcTYCAAsLPQEBfyABQQBIBEAQJgALIAFBAWtBBXZBAWpBACABGyIBQQJ0ECMhAiAAIAE2AgggAEEANgIEIAAgAjYCAAvBCAIKfwZ8IAAoAgAiBigCWCIBIAAoAgQiAigCCEECdGooAgAhAyABIAIoAgBBAnRqIAEgACgCCCIEKAIIQQJ0aigCACIFNgIAIAFBeEEEIAIoAggiB0EDb0ECRhtqIAdBAnRqIAU2AgAgASAEKAIAQQJ0aiADNgIAIAFBeEEEIAQoAggiBUEDb0ECRhtqIAVBAnRqIAM2AgAgBigCaCIBIAIoAgAiA0ECdGogASAEKAIIQQJ0aigCACIFNgIAIAEgBUECdGogAzYCACABIAQoAgAiA0ECdGogASACKAIIQQJ0aigCACIFNgIAIAEgBUECdGogAzYCACABIAIoAggiA0ECdGogBCgCCCIFNgIAIAEgBUECdGogAzYCACAGKAKoASIDIAIoAgBBA20iBUEYbGoiASADIAQoAgBBA20iBEEYbGoiAikDEDcDECABIAIpAwg3AwggASACKQMANwMAIAAoAgwoAgAiASAFQQR0aiICIAEgBEEEdGoiASkCCDcCCCACIAEpAgA3AgAgACgCBCEDIAAoAgghBCAGKAKMASIBBEAgACgCECICKwMIIQsgAisDGCENIAIrAwAhDCACKwMQIRAgAisDKCEOIAIrAyAhDyAGKAJ4IgIgAygCBEECdGogAiAEKAIAQQJ0aigCADYCACACIAMoAgBBAnRqIAIgBCgCCEECdGooAgA2AgAgAiADKAIIQQJ0aiACIAQoAghBAnRqKAIANgIAIAEgBigCQCIFbiEIIAVBAEoEQCAGQYgBaiEJRAAAAAAAAPA/IA8gDKEiDyAPoiAOIAuhIg4gDqKgnyAQIAyhIgwgDKIgDSALoSILIAuioJ+jIgtEAAAAAAAA8D8gC0QAAAAAAADwP2MbIgtEAAAAAAAAAAAgC0QAAAAAAAAAAGQbIgyhIQ0gBigCiAEhA0EAIQcgAiAEKAIEQQJ0aigCACAFbEEDdCEKIAIgBCgCAEECdGooAgAgBWxBA3QhBANAIAwgB0EDdCICIAMgBGpqKwMAoiANIAMgCmogAmorAwCioCELAkAgBigCkAEiAiABTQRAIAkgAkEBdEGAASACGxBEIAYoAogBIgMgBigCjAEiAUEDdGogCzkDAAwBCyADIAFBA3RqIAs5AwALIAYgAUEBaiIBNgKMASAHQQFqIgcgBUcNAAsgACgCBCEDIAAoAgghBCAGKAJ4IQILIAIgBCgCAEECdGogCDYCACACIAMoAghBAnRqIAg2AgALIAYoAlgiAkF4QQQgBCgCBCIBQQNvQQJGG2ogAUECdGooAgAhBSADKAIEIQcgBigCaCEIIAQoAgAhAQJAA0AgCCABQQJ0aigCACIBIAdGDQEgAkF4QQRBfkEBIAFBA29BAkYbIAFqIgFBA29BAkYbaiABQQJ0aigCACAFRw0ACyAGIAMoAgggARDMBCAGIAAoAgQoAggQ9QILC8kBAQd/IAAoAmgiBCABKAIEQQJ0aigCACIDQX9HBEAgBCADQQJ0aiAEIAEoAghBAnRqKAIAIgI2AgAgBCACQQJ0aiADNgIAIwBBEGsiA0ECNgIMIANCgICAgBA3AgQgACgCWCEFIAAoAnghBkEAIQADQCAGIAFBBEEIIANBBGogAGooAgAiAkEBRhtBACACG2ooAgBBAnQiAmoiBygCACEIIAIgBWpBfzYCACACIARqQX82AgAgByAINgIAIABBBGoiAEEMRw0ACwsLtAUBC38jAEEgayIFJAAgAEHIAGohBiAAKAJIIgggACgCWCABQQJ0aigCAEEYbGohAwJAIAAoAkwiByAAKAJQIgRPBEAgBSADKQMQNwMYIAUgAykDCDcDECAFIAMpAwA3AwggBiAEQQF0QYABIAQbEDMgACAAKAJMIgNBAWo2AkwgACgCSCADQRhsaiIDIAUpAxg3AxAgAyAFKQMQNwMIIAMgBSkDCDcDAAwBCyAAIAdBAWo2AkwgCCAHQRhsaiIEIAMpAxA3AxAgBCADKQMINwMIIAQgAykDADcDAAsgACgCSCIJIAAoAlhBeEEEIAFBA29BAkYbaiABQQJ0aigCAEEYbGohAwJAIAAoAkwiCCAAKAJQIgRPBEAgBSADKQMQNwMYIAUgAykDCDcDECAFIAMpAwA3AwggBiAEQQF0QYABIAQbEDMgACAAKAJMIgNBAWo2AkwgACgCSCADQRhsaiIDIAUpAxg3AxAgAyAFKQMQNwMIIAMgBSkDCDcDAAwBCyAAIAhBAWo2AkwgCSAIQRhsaiIGIAMpAxA3AxAgBiADKQMINwMIIAYgAykDADcDAAsgACgCaCIEIAFBAnRqIgsoAgAiBiAEIAJBAnRqIgwoAgAiCUcEQCAAKAJYIQogBiEDA0AgCkF+QQEgA0EDb0ECRhsiDUECdGogA0ECdGogBzYCACAKIAMgDWpBAnQiA2ogBzYCACADIARqKAIAIgMgCUcNAAsLIAEgAkcEQCAAKAJYIQcgAiEDA0AgB0F+QQEgA0EDb0ECRhsiCkECdGogA0ECdGogCDYCACAHIAMgCmpBAnQiA2ogCDYCACADIARqKAIAIgMgAUcNAAsLIAsgCTYCACAEIAlBAnRqIAE2AgAgDCAGNgIAIAQgBkECdGogAjYCACAAIAIQ9QIgBUEgaiQAC6UTAgt/DXwjAEHgAWsiBiQAAkAgAUEASA0AIAFBAnQiByAAKAJoaigCACIKQQBIDQAgByADKAIAIgdqKAIAIgkgAigCAEYEQCAHIApBAnRqKAIAIAlGDQELIAYgATYCeCAGQX5BASABIAFBA24iCUEDbGtBAkYbIAFqIgc2AnwgBkF+QQEgB0EDcEECRhsgB2o2AoABIAYgCjYCbCAGQX5BASAKIApBA24iC0EDbGtBAkYbIApqIgc2AnAgBkF+QQEgB0EDb0ECRhsgB2oiDzYCdCAAKAKoASIMIAlBGGxqIgcrAwgiFZkhFAJ8IAcrAxAiEZkiEiAHKwMAIhaZIhNkRSASIBRkRXJFBEBEAAAAAAAAAAAhEkQAAAAAAAAAACETRAAAAAAAAPA/DAELIBMgFGMEQEQAAAAAAADwPyETRAAAAAAAAAAAIRIgFSERRAAAAAAAAAAADAELRAAAAAAAAPA/IRJEAAAAAAAAAAAhEyAWIRFEAAAAAAAAAAALIRQgBkEgakEAQcAA/AsAIAZBAjYCuAEgBkKAgICAEDcCsAEgFJogFCARRAAAAAAAAAAAYyIHGyERIBKaIBIgBxshFSATmiATIAcbIRYgACgCSCEJIAAoAlghDUEAIQcDQCAGQSBqIAZBsAFqIAdqKAIAIghBBHRqIg4gEyAJIA0gBkH4AGpBBEEIIAhBAUYbQQAgCBtqKAIAQQJ0aigCAEEYbGoiCCsDACIZoiAUIAgrAwgiGKKgIBIgCCsDECIXoqA5AwggDiARIBmiIBUgGKKgIBYgF6KgOQMAIAdBBGoiB0EMRw0ACyAAKwM4IRkgBisDMCIcIAYrAyAiFqEiESAGKwNIIhQgBisDKCISoSIToiAGKwM4IhogEqEiFSAGKwNAIhggFqEiF6KhIhtEAAAAAAAAAABkBEAgGyAbokQAAAAAAAAQQKIgGSAZIBcgF6IgEyAToqAiEyARIBGiIBUgFaKgIhcgEyAXZBuiomVFDQELIAYgFTkDuAEgBiAROQOwASAGIBIgFKE5A9gBIAYgFiAYoTkD0AEgBiAUIBqhOQPIASAGIBggHKE5A8ABIAZBAjYCFCAGQoCAgIAQNwIMQQAhBwNAIAZBkAFqIAZBDGogB2ooAgAiCEEDdGogBkGwAWogCEEEdGoiCCsDACIRIBGiIAgrAwgiESARoqA5AwAgB0EEaiIHQQxHDQALIAYrA5ABIhEgBisDmAFkRQ0AIBEgBisDoAFkRQ0AIABB2AFqIQ4gDCALQRhsaiIHKwMIIhWZIRQCfCAHKwMQIhGZIhIgBysDACIWmSITZEUgEiAUZEVyRQRARAAAAAAAAAAAIRJEAAAAAAAAAAAhE0QAAAAAAADwPwwBCyATIBRjBEBEAAAAAAAA8D8hE0QAAAAAAAAAACESIBUhEUQAAAAAAAAAAAwBC0QAAAAAAADwPyESRAAAAAAAAAAAIRMgFiERRAAAAAAAAAAACyEUIAZBAjYCuAEgBkKAgICAEDcCsAEgFJogFCARRAAAAAAAAAAAYyIHGyEVIBKaIBIgBxshFiATmiATIAcbIRhBACEHA0AgBkEgaiIMIAZBsAFqIAdqKAIAIghBBHRqIgsgEyAJIA0gBkH4AGoiEEEEQQggCEEBRhtBACAIG2ooAgBBAnRqKAIAQRhsaiIIKwMAIhGiIBQgCCsDCCIXoqAgEiAIKwMQIhuioDkDCCALIBUgEaIgFiAXoqAgGCAboqA5AwAgB0EEaiIHQQxHDQALIAYgEyAJIA0gD0ECdGooAgBBGGxqIgcrAwAiE6IgFCAHKwMIIhSioCASIAcrAxAiEqKgIhE5A1ggBiAVIBOiIBYgFKKgIBggEqKgIhU5A1AgBiAONgIYIAYgADYCDCAGKwM4IRYgBisDMCEUIAYrAyghEiAGKwMgIRMgBiAMNgIcIAYgBkHsAGo2AhQgBiAQNgIQAkAgESAWoSIYIBMgFKEiF6IgFSAUoSIbIBIgFqEiHKKhIhpEAAAAAAAAAABkBEAgGiAaokQAAAAAAAAQQKIgGSAZIBsgG6IgGCAYoqAiGiAXIBeiIBwgHKKgIh0gGiAdZBuiomVFDQELIAYgHDkDuAEgBiAXOQOwASAGIBYgEaE5A9gBIAYgFCAVoTkD0AEgBiARIBKhOQPIASAGIBUgE6E5A8ABIAZBAjYCjAEgBkKAgICAEDcChAFBACEHA0AgBkGQAWogBkGEAWogB2ooAgAiCUEDdGogBkGwAWogCUEEdGoiCSsDACIRIBGiIAkrAwgiESARoqA5AwAgB0EEaiIHQQxHDQALIAYrA5ABIhEgBisDmAFkRQ0BIBEgBisDoAFkRQ0BIAZBDGoQygQgAigCACEHIAYrA1AgBisDQKEiESARoiAGKwNYIAYrA0ihIhEgEaKgIAArAzgiESARomMEQCACIAdBAWo2AgAgACAGKAKAASAFRAAAAAAAAPC/QQAQ9wIaIAVBAEEAEDEMAgsgAygCACIAIAFBAnRqIAc2AgAgACAKQQJ0aiAHNgIAIAYgBikCbEIgiTcCsAEgBiAGKQJ4QiCJNwK4ASAEKAIEIQdBACEAA0AgBkGwAWogAGooAgAhAQJAIAQoAggiAiAHTQRAIAQgAkEBdEGAASACGxAlIAQoAgAgBCgCBCIHQQJ0aiABNgIADAELIAQoAgAgB0ECdGogATYCAAsgBCAHQQFqIgc2AgQgAEEEaiIAQRBHDQALDAELIBUgE6EiFSAGKwNIIhwgEqEiF6IgESASoSIRIAYrA0AiHSAToSISoqEiE0QAAAAAAAAAAGRFDQAgEyATokQAAAAAAAAQQKIgGSAZIBIgEqIgFyAXoqAiEiAVIBWiIBEgEaKgIhEgESASYxuiomUNACAYIB0gFKEiEaIgGyAcIBahIhWioSIWRAAAAAAAAAAAZEUNACAWIBaiRAAAAAAAABBAoiAZIBkgGiARIBGiIBUgFaKgIhEgESAaYxuiomUNACAGQQxqEMoEIAMoAgAiAyABQQJ0aiACKAIAIgE2AgAgAyAKQQJ0aiABNgIAIAYgACgCaCIAIAYoAmxBAnRqKAIANgKwASAGIAAgBigCfEECdGooAgA2ArQBIAQoAgQhB0EAIQADQCAGQbABaiAAaigCACEBAkAgBCgCCCICIAdNBEAgBCACQQF0QYABIAIbECUgBCgCACAEKAIEIgdBAnRqIAE2AgAMAQsgBCgCACAHQQJ0aiABNgIACyAEIAdBAWoiBzYCBCAAQQRqIgBBCEcNAAsLIAZB4AFqJAAL4RACC38MfCMAQYACayICJAAgAkEANgJIIAJCADcCQCAAKAJcIQogAkEANgI4IAJCADcCMCACQTBqQQoQJSACQQA2AiggAkIANwIgIAAoAlwhAyACQQA2AhggAkIANwIQIAJBEGogA0F/EDEgAkEANgIMAkAgCkUNAANAAkAgBkECdCIFIAAoAmhqKAIAIgNBAEgNACACIAY2ApgBIAJBfkEBIAYgBkEDbSIEQQNsa0ECRhsgBmoiBzYCnAEgAkF+QQEgB0EDb0ECRhsgB2oiCTYCoAEgAiADNgKMASACQX5BASADIANBA24iC0EDbGtBAkYbIANqIgM2ApABIAJBfkEBIANBA29BAkYbIANqIgM2ApQBAkAgBSAAKAJYIgVqKAIAIAFODQAgBSAHQQJ0aigCACABTg0AIAUgCUECdGooAgAgAU4NACAFIANBAnRqKAIAIAFIDQELIAAoAqgBIgkgBEEYbGoiAysDCCIRmSEQAnwgAysDECINmSIPIAMrAwAiEpkiDmRFIA8gEGRFckUEQEQAAAAAAAAAACEPRAAAAAAAAAAAIQ5EAAAAAAAA8D8MAQsgDiAQYwRARAAAAAAAAPA/IQ5EAAAAAAAAAAAhDyARIQ1EAAAAAAAAAAAMAQtEAAAAAAAA8D8hD0QAAAAAAAAAACEOIBIhDUQAAAAAAAAAAAshEEEAIQMgAkHQAGpBAEEw/AsAIAJBAjYC2AEgAkKAgICAEDcC0AEgEJogECANRAAAAAAAAAAAYyIHGyENIA+aIA8gBxshESAOmiAOIAcbIRIgACgCSCEHA0AgAkHQAGogAkHQAWogA2ooAgAiBEEEdGoiDCAOIAcgBSACQZgBakEEQQggBEEBRhtBACAEG2ooAgBBAnRqKAIAQRhsaiIEKwMAIhWiIBAgBCsDCCIUoqAgDyAEKwMQIhOioDkDCCAMIA0gFaIgESAUoqAgEiAToqA5AwAgA0EEaiIDQQxHDQALIAArAzghFSACKwNgIhcgAisDUCISoSINIAIrA3giECACKwNYIg+hIg6iIAIrA2giGCAPoSIRIAIrA3AiFCASoSIToqEiFkQAAAAAAAAAAGQEQCAWIBaiRAAAAAAAABBAoiAVIBUgEyAToiAOIA6ioCIOIA0gDaIgESARoqAiEyAOIBNkG6KiZUUNAQsgAiAROQPYASACIA05A9ABIAIgDyAQoTkD+AEgAiASIBShOQPwASACIBAgGKE5A+gBIAIgFCAXoTkD4AEgAkECNgKsASACQoCAgIAQNwKkAUEAIQMDQCACQbABaiACQaQBaiADaigCACIEQQN0aiACQdABaiAEQQR0aiIEKwMAIg0gDaIgBCsDCCINIA2ioDkDACADQQRqIgNBDEcNAAsgAisDsAEiDSACKwO4AWRFDQAgDSACKwPAAWRFDQAgCSALQRhsaiIDKwMIIhGZIRACfCADKwMQIg2ZIg8gAysDACISmSIOZEUgDyAQZEVyRQRARAAAAAAAAAAAIQ9EAAAAAAAAAAAhDkQAAAAAAADwPwwBCyAOIBBjBEBEAAAAAAAA8D8hDkQAAAAAAAAAACEPIBEhDUQAAAAAAAAAAAwBC0QAAAAAAADwPyEPRAAAAAAAAAAAIQ4gEiENRAAAAAAAAAAACyEQIAJBAjYC2AEgAkKAgICAEDcC0AEgEJogECANRAAAAAAAAAAAYyIDGyENIA+aIA8gAxshESAOmiAOIAMbIRJBACEDA0AgAkHQAGogAkHQAWogA2ooAgAiBEEEdGoiCSAOIAcgBSACQYwBakEEQQggBEEBRhtBACAEG2ooAgBBAnRqKAIAQRhsaiIEKwMAIhSiIBAgBCsDCCIToqAgDyAEKwMQIhaioDkDCCAJIA0gFKIgESAToqAgEiAWoqA5AwAgA0EEaiIDQQxHDQALAkAgAisDYCIXIAIrA1AiEqEiDSACKwN4IhAgAisDWCIPoSIOoiACKwNoIhggD6EiESACKwNwIhQgEqEiE6KhIhZEAAAAAAAAAABkBEAgFiAWokQAAAAAAAAQQKIgFSAVIBMgE6IgDiAOoqAiDiANIA2iIBEgEaKgIhUgDiAVZBuiomVFDQELIAIgETkD2AEgAiANOQPQASACIA8gEKE5A/gBIAIgEiAUoTkD8AEgAiAQIBihOQPoASACIBQgF6E5A+ABIAJBAjYCrAEgAkKAgICAEDcCpAFBACEDA0AgAkGwAWogAkGkAWogA2ooAgAiBUEDdGogAkHQAWogBUEEdGoiBSsDACINIA2iIAUrAwgiDSANoqA5AwAgA0EEaiIDQQxHDQALIAIrA7ABIg0gAisDuAFkRQ0BIA0gAisDwAFkRQ0BCyACKAJEIgMgAigCSCIFTwRAIAJBQGsgBUEBdEGAASAFGxAlIAIgAigCRCIDQQFqNgJEIAIoAkAiCCADQQJ0aiAGNgIADAELIAIgA0EBajYCRCAIIANBAnRqIAY2AgALIAZBAWoiBiAKRw0ACyACKAJEIgFFDQAgCCABQQJ0aiEGA0AgCCgCACEBIAIgAigCDEEBajYCDCAAIAEgAkEMaiACQRBqIAJBIGogAkEwahDNBANAIAIoAiQiAQRAIAIoAiAgAUECdGpBBGsoAgAhBSACQSBqIgQgAUEBayIDECUgAiADNgIkIAFBEUkgASADQQF0TXJFBEAgBBAtCyAAIAUgAkEMaiACQRBqIAJBIGogAkEwahDNBAwBCwsgCEEEaiIIIAZHDQALCyACQQA2AkQgAkFAaxAtIAIoAhAiAARAIAAQIgsgAigCICIABEAgABAiCyACKAIwIgAEQCAAECILIAIoAkAiAARAIAAQIgsgAkGAAmokAAvRAwIJfwN8IwBBIGsiAiQAIAJBADYCGCACQgA3AhAgACgCXCEIIAJBADYCCCACQgA3AgAgAkEKECUCQCAIRQ0AIABBOEEwIAEbaisDACIMIAyiIQ0DQAJAIANBAnQiBCAAKAJoaigCAEEASA0AIAAoAlggBGoiBUF4QQQgA0EDb0ECRhtqKAIAIQQgASAESiIJIAEgBSgCACIHSnENACAAKAJIIgogBEEYbGoiBSsDACAKIAdBGGxqIgcrAwChIgsgC6IgBSsDCCAHKwMIoSILIAuioCAFKwMQIAcrAxChIgsgC6KgIA0gACsDMCILIAuiIAkbY0UNACACKAIUIgQgAigCGCIFTwRAIAJBEGogBUEBdEGAASAFGxAlIAIgAigCFCIEQQFqNgIUIAIoAhAiBiAEQQJ0aiADNgIADAELIAIgBEEBajYCFCAGIARBAnRqIAM2AgALIANBAWoiAyAIRw0ACyACKAIUIgNFDQAgBiADQQJ0aiEDA0AgACAGKAIAIAIgDCABEPcCGiACQQBBABAxIAZBBGoiBiADRw0ACwsgAkEANgIUIAJBEGoQLSACKAIAIgAEQCAAECILIAIoAhAiAARAIAAQIgsgAkEgaiQAC3wBBX8gACgCCCABSQRAIAFBA3QQJyEFIAAoAgAhAyAAKAIEIgIEQCADIAJBA3RqIQYgBSECIAMhBANAIAIgBCgCADYCACACIAQoAgQ2AgQgAkEIaiECIARBCGoiBCAGRw0ACwsgAwRAIAMQIgsgACABNgIIIAAgBTYCAAsLgAEBA38gARCvAiICQff///8HSQRAAkACQCACQQtPBEAgAkEHciIEQQFqECMhAyAAIARB/////wdrNgIIIAAgAzYCACAAIAI2AgQMAQsgACACOgALIAAhAyACRQ0BCyACRQ0AIAMgASAC/AoAAAsgAiADakEAOgAADwtBwBIQngUAC8oDAQh/IwBBIGsiBiQAAkAgASgCBCICIAEoAgBHBEADQCACQQRrKAIAIQQgAkEIayICKAIAIQUgAkIANwIAIAEgAhAvNgIEIAUgBSgCACgCCBEEAEEDRwRAIAAoAgAhAiAEBEAgBCAEKAIEQQFqNgIECwJAIAIoAgQiAyACKAIIIghJBEAgAyAENgIEIAMgBTYCACADQQhqIQMMAQsgAyACKAIAIgdrQQN1IglBAWoiA0GAgICAAk8NBCAGQQxqQf////8BIAggB2siCEECdSIHIAMgAyAHSRsgCEH4////B08bIAkgAhBLIQggBigCFCIDIAQ2AgQgAyAFNgIAIAYgA0EIajYCFCAGKAIQIAIoAgQgAigCACIHayIFayEDIAUEQCADIAcgBfwKAAALIAIoAgAhBSACIAM2AgAgBiAFNgIQIAIgBigCFCIDNgIEIAYgBTYCFCACKAIIIQcgAiAGKAIYNgIIIAYgBzYCGCAIIAU2AgAgCBBuCyACIAM2AgQLAkAgBEUNACAEIAQoAgQiAkEBazYCBCACDQAgBCAEKAIAKAIIEQAAIAQQJAsgASgCBCICIAEoAgBHDQALCyAGQSBqJAAPCxAmAAudAQEEfyMAQRBrIgQkAEEYECMiAkEANgIUIAJCADcCDCACQaiUAjYCACACQgA3AgQgAkEMaiIDIAEoAgAiBSABKAIEIgEgASAFa0EDdRCBAyAAIAI2AgQgACADNgIAQSQQIyIBQdCUAjYCACABQgA3AgQgAUEMaiECIwBBEGsiAyQAIANBEGokACAAIAE2AgwgACACNgIIIARBEGokAAtcAQF/AkAgACsDACABKwMYZUUNACAAKwMIIAErAyBlRQ0AIAArAxAgASsDKGVFDQAgACsDGCABKwMAZkUNACAAKwMgIAErAwhmRQ0AIAArAyggASsDEGYhAgsgAgtWAQV/IAAoAgAiAigCACIBBEAgASEDIAIhBCACKAIEIgUgAUcEQANAIAEgBUEQaxAvIgVHDQALIAAoAgAiBCgCACEDCyACIAE2AgQgBCgCCBogAxAiCwvpAQEEfyMAQRBrIgMkAAJAIAJBAkgNACAAIAJBAmtBAXYiBEEEdGoiBSABQRBrIgIQoAFFDQAgAyACKAIANgIAIAMgAUEMayIGKAIANgIEIAJBADYCACAGQQA2AgAgAyABQQhrKQMANwMIA0ACQCACIAUiARBOIAIgASkDCDcDCCAERQ0AIAEhAiAAIARBAWtBAXYiBEEEdGoiBSADEKABDQELCyABIAMQTiABIAMpAwg3AwggAygCBCIARQ0AIAAgACgCBCIBQQFrNgIEIAENACAAIAAoAgAoAggRAAAgABAkCyADQRBqJAALyQIBCH8jAEEQayIEJAACQCABIABrQQR1IgdBAkgNACAEIAAoAgA2AgAgBCAAKAIENgIEIABCADcCACAEIAApAwg3AwggB0ECa0EBdiEJIAAhBQNAIANBAXQiBkEBciEIIAUgA0EEdGoiA0EQaiECIAcgBkECaiIGTAR/IAgFIANBIGoiAyACIAIgAxCgASIDGyECIAYgCCADGwshAyAFIAIQTiAFIAIpAwg3AwggAiEFIAMgCUwNAAsCQCABQRBrIgUgAkYEQCACIAQQTiACIAQpAwg3AwgMAQsgAiAFEE4gAiABQQhrIgEpAwA3AwggBSAEEE4gASAEKQMINwMAIAAgAkEQaiIBIAEgAGtBBHUQ1gQLIAQoAgQiAEUNACAAIAAoAgQiAUEBazYCBCABDQAgACAAKAIAKAIIEQAAIAAQJAsgBEEQaiQAC/IUAgl/AX4jAEFAaiIFJAACQAJAAkACQAJAIAIoAgQgAigCACIGa0EDdSIEDgMAAQIDCyAAEPsCDAMLIAAgBigCADYCACAAIAYoAgQiADYCBCAARQ0CIAAgACgCBEEBajYCBAwCCyAFQShqIAYoAgAQKiAFKAIoIQQgBUEcaiACKAIAKAIIECogACAEIAUoAhwgASADEP0CAkAgBSgCICIBRQ0AIAEgASgCBCIAQQFrNgIEIAANACABIAEoAgAoAggRAAAgARAkCyAFKAIsIgFFDQEgASABKAIEIgBBAWs2AgQgAA0BIAEgASgCACgCCBEAACABECQMAQsgBUEANgIkIAVCADcCHCMAQSBrIgwkAAJAAkAgBUEcaiIKKAIIIAooAgAiBmtBBHUgBEkEQCAEQYCAgIABTw0BIAxBDGogBCAKKAIEIAZrQQR1IAoQMiIJKAIEIAooAgQgCigCACIEayIIayEGIAgEQCAGIAQgCPwKAAALIAooAgAhCCAKIAY2AgAgCSAINgIEIAogCSgCCDYCBCAJIAg2AgggCigCCCEEIAogCSgCDDYCCCAJIAg2AgAgCSAENgIMIAkQmAILIAxBIGokAAwBCxAmAAsgBUEANgIoIAIoAgQiCyACKAIAIgRHBEADQCAEIAdBA3RqIQkjAEEgayIMJAACQAJAAkAgBUEcaiIKKAIEIgQgCigCCCIGSQRAIAQgCSgCADYCACAEIAkoAgQ2AgQgCUIANwIAIAQgBTUCKDcDCCAEQRBqIQYMAQsgBCAKKAIAIgRrQQR1IgdBAWoiCEGAgICAAU8NASAMQQxqQf////8AIAYgBGsiBkEDdSIEIAggBCAISxsgBkHw////B08bIAcgChAyIggoAggiBCAJKAIANgIAIAQgCSgCBDYCBCAJQgA3AgAgBCAFNQIoNwMIIAggBEEQajYCCCAIKAIEIAooAgQgCigCACIEayIHayEGIAcEQCAGIAQgB/wKAAALIAooAgAhByAKIAY2AgAgCCAHNgIEIAogCCgCCCIGNgIEIAggBzYCCCAKKAIIIQQgCiAIKAIMNgIIIAggBzYCACAIIAQ2AgwgCBCYAgsgCiAGNgIEIAxBIGokAAwBCxAmAAsgBSAFKAIoQQFqIgc2AiggByACKAIEIgsgAigCACIEa0EDdUkNAAsLIAQgC0cEQANAIAQgC0EIaxAvIgtHDQALCyACIAQ2AgQgBSgCICAFKAIcIgprIgRBBHUiCUECTgRAIAlBAmtBAXYiDCEEA0ACQCAMIAQiBkkNACAKIARBBHRqIQcgCiAEQQF0IgJBAXIiC0EEdGohBCAJIAJBAmoiCEoEQCAEQRBqIgIgBCAEIAIQoAEiAhshBCAIIAsgAhshCwsgBCAHEKABDQAgBSAHKAIANgIoIAUgBygCBDYCLCAHQgA3AwAgBSAHKQMINwMwA0ACQCAHIAQiAhBOIAcgBCkDCDcDCCALIAxKDQAgCiALQQF0IgdBAXIiC0EEdGohBCAJIAdBAmoiCEoEQCAEQRBqIgcgBCAEIAcQoAEiBxshBCAIIAsgBxshCwsgAiEHIAQgBUEoahCgAUUNAQsLIAIgBUEoahBOIAIgBSkDMDcDCCAFKAIsIgRFDQAgBCAEKAIEIgJBAWs2AgQgAg0AIAQgBCgCACgCCBEAACAEECQLIAZBAWshBCAGQQBKDQALIAUoAiAgBSgCHCIKayEECyAFQQA2AhggBUIANwIQAkAgBEERTwRAIAmtIQ0DQAJAIANFDQAgAy0AEEEBRw0AIAAQmQIMAwtBACECAkADQCAFKAIgIgYgBSgCHCIEa0EQTQ0BIAQgBhDXBCAFKAIgIgZBDGsiBCgCACEJIARBADYCACAGQRBrIgQoAgAhByAEQQA2AgAgBSAEEC8iBDYCICAFKAIcIAQQ1wQgBSgCICIGQQxrIgQoAgAhDCAEQQA2AgAgBkEQayIEKAIAIQYgBEEANgIAIAUgBBAvNgIgIAVBKGogBxAqIAUoAighBCAFIAYQKiAFQQhqIAQgBSgCACABIAMQ/QICQCAFKAIEIgZFDQAgBiAGKAIEIgRBAWs2AgQgBA0AIAYgBigCACgCCBEAACAGECQLAkAgBSgCLCIGRQ0AIAYgBigCBCIEQQFrNgIEIAQNACAGIAYoAgAoAggRAAAgBhAkCwJAAkAgBSgCFCIHIAUoAhgiBkkEQCAHIAUoAgg2AgAgBSgCDCEEIAcgDTcDCCAHIAQ2AgQgBSAHQRBqNgIUDAELIAcgBSgCECIEa0EEdSIHQQFqIghBgICAgAFPDQEgBUEoakH/////ACAGIARrIgZBA3UiBCAIIAQgCEsbIAZB8P///wdPGyAHIAVBEGoQMiEIIAUoAjAiBCAFKAIINgIAIAQgBSgCDDYCBCAFQgA3AgggBCANNwMIIAUgBEEQajYCMCAFKAIsIAUoAhQgBSgCECIEayIHayEGIAcEQCAGIAQgB/wKAAALIAUgBSgCECIHNgIsIAUgBjYCECAFKAIwIQYgBSAHNgIwIAUgBjYCFCAFKAIYIQQgBSAFKAI0NgIYIAUgBDYCNCAIIAc2AgAgCBCYAiAFIAY2AhQgBSgCDCIGRQ0AIAYgBigCBCIEQQFrNgIEIAQNACAGIAYoAgAoAggRAAAgBhAkCwJAIAxFDQAgDCAMKAIEIgRBAWs2AgQgBA0AIAwgDCgCACgCCBEAACAMECQLAkAgCUUNACAJIAkoAgQiBEEBazYCBCAEDQAgCSAJKAIAKAIIEQAAIAkQJAsgDUIBfCENIAJBAWoiAkEERw0BDAILCxAmAAsgBSgCECIEIAUoAhQiC0cEQANAIwBBIGsiDCQAAkACQAJAIAVBHGoiCSgCBCICIAkoAggiBkkEQCACIAQoAgA2AgAgAiAEKAIENgIEIARCADcDACACIAQpAwg3AwggAkEQaiEGDAELIAIgCSgCACICa0EEdSIHQQFqIghBgICAgAFPDQEgDEEMakH/////ACAGIAJrIgZBA3UiAiAIIAIgCEsbIAZB8P///wdPGyAHIAkQMiIIKAIIIgIgBCgCADYCACACIAQoAgQ2AgQgBEIANwMAIAIgBCkDCDcDCCAIIAJBEGo2AgggCCgCBCAJKAIEIAkoAgAiAmsiB2shBiAHBEAgBiACIAf8CgAACyAJKAIAIQcgCSAGNgIAIAggBzYCBCAJIAgoAggiBjYCBCAIIAc2AgggCSgCCCECIAkgCCgCDDYCCCAIIAc2AgAgCCACNgIMIAgQmAILIAkgBjYCBCAMQSBqJAAMAQsQJgALIAUoAhwiBiAFKAIgIgIgAiAGa0EEdRDWBCAEQRBqIgQgC0cNAAsgBSgCFCELIAUoAhAhBAsgBCALRwRAA0AgBCALQRBrEC8iC0cNAAsLIAUgBDYCFCAFKAIgIAUoAhwiCmtBEEsNAAsLIAAgCigCADYCACAAIAooAgQiADYCBCAARQ0AIAAgACgCBEEBajYCBAsgBSAFQRBqNgIoIAVBKGoiABDVBCAFIAVBHGo2AiggABDVBAsgBUFAayQAC4wCAgF/DXwgAQRAIAAoAgAiAyABQRhsaiEBIAArA0ghCCAAKwNAIQkgACsDOCEKIAArAzAhCyAAKwMoIQwgACsDICENIAArAxghDiAAKwMQIQ8gACsDCCEQA0AgAkQAAAAAAAAAACAOIAMrAwAiBKIgCyADKwMIIgWioCAIIAMrAxAiBqKgIgcgByAHoiAQIASiIA0gBaKgIAogBqKgIgcgB6IgDyAEoiAMIAWioCAJIAaioCIEIASioKCfIgWjIAcgBaMiBiAGYiIAGzkDECACRAAAAAAAAAAAIAQgBaMgABs5AwggAkQAAAAAAAAAACAGIAAbOQMAIAJBGGohAiADQRhqIgMgAUcNAAsLC5QBAQR/IAAoAgQiAyABQQF0SyADQRBLcQJAIAEgA00NACAAIAEQVSABIAAoAgQiA2siBEEATA0AIAAoAgAgA0EFdGohAwNAIAMgAikDGDcDGCADIAIpAxA3AxAgAyACKQMINwMIIAMgAikDADcDACADQSBqIQMgBEEBSyAEQQFrIQQNAAsLIAAgATYCBARAIAAQkwELC5ECAgJ/BnwjAEHQAGsiAyQAIAMgASsDADkDGCADIAErAwg5AyAgASsDECEFIANCgICAgICAgPg/NwMwIAMgBTkDKCADQThqIAIgA0EYaiIEEKEBIAMgASsDGDkDGCADIAErAyA5AyAgASsDKCEFIANCgICAgICAgPg/NwMwIAMgBTkDKCADIAIgBBChASADKwM4IQUgAysDACEGIAMrA0AhByADKwMIIQggACADKwMQIgkgAysDSCIKIAkgCmQiARs5AyggACAIIAcgByAIYyICGzkDICAAIAYgBSAFIAZjIgQbOQMYIAAgCiAJIAEbOQMQIAAgByAIIAIbOQMIIAAgBSAGIAQbOQMAIANB0ABqJAALdAECfyMAQRBrIgIkAEGgARAjIgNBgJQCNgIAIANCADcCBCACIAEoAgA2AgggAiABKAIENgIMIAFCADcCACACIAIpAgg3AwAgA0EQaiIBIAIQ/gIgACADNgIEIAAgATYCACAAIANBFGogARCPASACQRBqJAAL9AQCDn8GfCMAQYABayICJAAgASgCDCEDIAJCADcDICACQoCAgICAgID4PzcDGCACQgA3AyggAkIANwMwIAJCADcDQCACQoCAgICAgID4PzcDOCACQgA3A0ggAkIANwNQIAJCADcDYCACQoCAgICAgID4PzcDWCACQgA3A2ggAkIANwNwIAIgAUEYaiIHIAJBGGoQygECQCACKwMAIAIrAwhhBEAgACADQTD8CgAADAELIAIgASkDcDcDKCACIAEpA2g3AyAgAiABKQNgNwMYIAIgASkDcDcDECACIAEpA2g3AwggAiABKQNgNwMAIAFByABqIQggAUEwaiEJIANBGGohCgNAIAhBCEEQIAVBAUYbQQAgBRsiBGohCyAEIAdqIQwgBCAJaiENIAIgBGoiDisDACERIAJBGGogBGoiDysDACESQQAhAQNAIBECfwJAAkACQCABDgIAAQILIAwrAwAgAysDAKIhEEEAIQYgBwwCCyANKwMAIAMrAwiiIRBBCCEGIAkMAQsgCysDACADKwMQoiEQQRAhBiAICyAEaisDACAGIApqKwMAoiITIBAgECATYxugIREgEiATIBAgECATZBugIRIgAUEBaiIBQQNHDQALIA8gEjkDACAOIBE5AwAgBUEBaiIFQQNHDQALIAIrAwAhECACKwMYIREgAisDCCESIAIrAyAhEyAAIAIrAxAiFCACKwMoIhUgFCAVZCIBGzkDKCAAIBIgEyASIBNkIgMbOQMgIAAgECARIBAgEWQiBBs5AxggACAVIBQgARs5AxAgACATIBIgAxs5AwggACARIBAgBBs5AwALIAJBgAFqJAAL/AMCBX8MfCMAQfABayIDJAAgASsDGCEIIAErAyAhCSABKwMoIQogASsDMCELIAErAzghDCABKwNAIQ0gASsDSCEOIAErA1AhDyABKwNYIRAgASsDYCERIAErA2ghEiABKwNwIRMgA0KAgICAgICA+D83A3ggAyATOQNwIAMgEjkDaCADIBE5A2AgA0IANwNYIAMgEDkDUCADIA85A0ggAyAOOQNAIANCADcDOCADIA05AzAgAyAMOQMoIAMgCzkDICADQgA3AxggAyAKOQMQIAMgCTkDCCADIAg5AwAgA0GAAWoiBCACIAMQ8AEjAEHwAGsiAiQAQaABECMiBUGAlAI2AgAgBUIANwIEIAIgASgCDDYCaCACIAEoAhAiATYCbCABBEAgASABKAIEQQFqNgIECyADQeQBaiEGIAIgAikCaDcDYCACIARB4AD8CgAAIAVBEGoiAUIANwIEIAFBmJICNgIAIAEgAkHgAGoiBygCADYCDCABIAcoAgQiBDYCECAEBEAgBCAEKAIEQQFqNgIECyABQRhqIAJB4AD8CgAAIAFCADcDiAEgAUIANwOAASABQgA3A3ggBxAvGiAGIAU2AgQgBiABNgIAIAYgBUEUaiABEI8BIAJB8ABqJAAgACADKALkATYCACAAIAMoAugBNgIEIANB8AFqJAAL2QIBBH8jAEEwayIEJAAgBCADOgAbIARBADYCFCAEQgA3AgwgBEEEaiABQQRqEJsCIQMgBEEcakEBQQAgBEEMahBLIgEoAggiBSADKAIANgIAIAUgAygCBDYCBCADQgA3AgAgASAFQQhqNgIIIAEoAgQgBCgCECAEKAIMIgdrIgVrIQYgBQRAIAYgByAF/AoAAAsgBCgCDCEFIAQgBjYCDCABIAU2AgQgBCABKAIIIgY2AhAgASAFNgIIIAQoAhQhByAEIAEoAgw2AhQgASAFNgIAIAEgBzYCDCABEG4gAygCBCEBIAQgBjYCEAJAIAFFDQAgASABKAIEIgNBAWs2AgQgAw0AIAEgASgCACgCCBEAACABECQLIARBDGoiASACEP8CIARBHGoiAiABIARBG2oQgAMgACAEKAIcNgIAIAAgBCgCIDYCBCAEIAE2AhwgAhBlIARBMGokAAvgBgIDfwJ8AkACQAJAAkACQCACDgMEAgABCwJAIAFBGGsiAisDACIHIAArAwAiCGNFBEAgByAIYg0BIAFBDGsoAgAgACgCDE4NAQsgAyACKQMQNwMQIAMgAikDCDcDCCADIAIpAwA3AwAgAyAAKQMANwMYIAMgACkDCDcDICADIAApAxA3AygPCyADIAApAxA3AxAgAyAAKQMINwMIIAMgACkDADcDACADIAIpAwA3AxggAyACKQMINwMgIAMgAikDEDcDKA8LIAJBCEoNASAAIAFGDQIgAyAAKQMQNwMQIAMgACkDCDcDCCADIAApAwA3AwAgAEEYaiICIAFGDQIgAyEFA0AgACEGIAIhACAFIgJBGGohBQJ/IAYrAxgiByACKwMAIghjRQRAIAUiBCAHIAhiDQEaIAQgBigCJCACKAIMTg0BGgsgBSACKQMQNwMQIAUgAikDCDcDCCAFIAIpAwA3AwAgAyACIANGDQAaAkADQCAAKwMAIgcgAkEYayIEKwMAIghjRQRAIAcgCGINAiAGKAIkIAJBDGsoAgBODQILIAIgBCkDEDcDECACIAQpAwg3AwggAiAEKQMANwMAIAQiAiADRw0ACyADDAELIAILIgQgACkDEDcDECAEIAApAwg3AwggBCAAKQMANwMAIABBGGoiAiABRw0ACwwCCyADIAApAxA3AxAgAyAAKQMINwMIIAMgACkDADcDAAwBCyAAIAAgAkEBdiIFQRhsIgZqIgQgBSADIAUQywEgBCABIAIgBWsiAiADIAZqIAIQywEgBCECA0AgASACRgRAIAAgBEYNAgNAIAMgACkDEDcDECADIAApAwg3AwggAyAAKQMANwMAIANBGGohAyAAQRhqIgAgBEcNAAsMAgsCQAJAIAIrAwAiByAAKwMAIghjRQRAIAcgCGINASACKAIMIAAoAgxODQELIAMgAikDEDcDECADIAIpAwg3AwggAyACKQMANwMAIAJBGGohAgwBCyADIAApAxA3AxAgAyAAKQMINwMIIAMgACkDADcDACAAQRhqIQALIANBGGohAyAAIARHDQALIAEgAkYNAANAIAMgAikDEDcDECADIAIpAwg3AwggAyACKQMANwMAIANBGGohAyACQRhqIgIgAUcNAAsLC4sBAQV/IwBBEGsiA0KAgICAEDcCBCADQQI2AgwgACgCACgCACABQQxsaiEEIAAoAgQgAUECdGoiBSgCACEBIAAoAgwhBkEAIQADQCAFIAEgBiAEIANBBGogAGooAgBBAnRqKAIAQQJ0aigCACICIAJBH3UiAnMgAmtqIgE2AgAgAEEEaiIAQQxHDQALCwIAC7cCAQV/IwBBIGsiBSQAAkACQCAAKAIEIgIgACgCCCIDSQRAIAIgASkCCDcCCCACIAEpAgA3AgAgAkEQaiEBDAELIAIgACgCACIEa0EEdSIGQQFqIgJBgICAgAFPDQEgBUEMakH/////ACADIARrIgNBA3UiBCACIAIgBEkbIANB8P///wdPGyAGIAAQMiICKAIIIgMgASkCCDcCCCADIAEpAgA3AgAgAiACKAIIQRBqNgIIIAIoAgQgACgCBCAAKAIAIgNrIgFrIQQgAQRAIAQgAyAB/AoAAAsgACgCACEDIAAgBDYCACACIAM2AgQgACACKAIIIgE2AgQgAiADNgIIIAAoAgghBCAAIAIoAgw2AgggAiADNgIAIAIgBDYCDCACEDYLIAAgATYCBCAFQSBqJAAPCxAmAAt4AQN/AkAgACgCCCICRQRAQQAhAgwBCyAAKAIQIAFBBHRqKAIAIQEgAEEIaiIDIQADQCAAIAIgAigCECABSCIEGyEAIAJBBEEAIAQbaigCACICDQALQQAhAiAAIANGDQAgASAAKAIQSA0AIAAtAIEBIQILIAJBAXELkwMBBX8gACgCBCAAKAIAIgNrQQJ1IgQgAUkEQCMAQSBrIgYkAAJAAkACQCABIARrIgQgACgCCCIFIAAoAgQiA2tBAnVNBEAgACAEBH8gAyAEQQJ0aiEAIAIoAgAhAQNAIAMgATYCACADQQRqIgMgAEcNAAsgAAUgAws2AgQMAQsgAyAAKAIAIgNrQQJ1IgcgBGoiAUGAgICABE8NASAGQQxqQf////8DIAUgA2siA0EBdSIFIAEgASAFSRsgA0H8////B08bIAcgABBKIgEoAggiAyAEQQJ0aiEEIAIoAgAhAgNAIAMgAjYCACADQQRqIgMgBEcNAAsgASAENgIIIAEoAgQgACgCBCAAKAIAIgRrIgJrIQMgAgRAIAMgBCAC/AoAAAsgACgCACECIAAgAzYCACABIAI2AgQgACABKAIINgIEIAEgAjYCCCAAKAIIIQMgACABKAIMNgIIIAEgAjYCACABIAM2AgwgARBTCyAGQSBqJAAMAQsQJgALDwsgASAESQRAIAAgAyABQQJ0ajYCBAsL2wwCCn8OfCMAQfAAayIDJAAgACgCMCgCACABQQNsIgpBAnRqKAIAQQBOBEAgAEEsQSggACgCCCABQQR0aiIBKAIAIgIbaigCACABKAIIIQEgA0EoakEAQcgA/AsAIANBAjYCCCADQoCAgIAQNwIAKAIAIAFBDGxqIQUgAEEYQRAgAhtqKAIAIQZBACEBA0AgA0EoakEYQTAgASADaigCACICQQFGG0EAIAIbaiIEIAYgBSACQQJ0aigCAEEYbGoiAikDADcDACAEIAIpAwg3AwggBCACKQMQNwMQIAFBBGoiAUEMRw0ACyADQQI2AiQgA0KAgICAEDcCHEEAIQEDQCAAKAIgIAAoAjAoAgAgA0EcaiABaigCACAKaiILQQJ0aigCAEEYbGohBSAAKwM4IQ0jAEGQAWsiAiQAIANBKGoiBCsDICESIAQrAxghDiAEKwMoIRYgBCsDECEUIAQrA0AhDyAEKwMAIRcgBCsDMCEQIAIgBCsDCCIYIAQrAzgiE6EiDDkDaCACIBcgEKEiETkDYCACIBQgD6EiFTkDcCACIA8gFqEiDzkDWCACIBAgDqEiEDkDSCACIBMgEqEiEzkDUCACIBYgFKEiFjkDiAEgAiAOIBehIg45A3ggAiASIBihIhI5A4ABIAIgESARoiAMIAyioCAVIBWioCIUOQM4IAIgDiAOoiASIBKioCAWIBaioCISOQNAIAIgECAQoiATIBOioCAPIA+ioCIOOQMwIAJCADcDKCACQgA3AyAgAkIANwMYIAJBAjYCFCACQoCAgIAQNwIMIBAgDKIgEyARoqEiFiAWoiATIBWiIA8gDKKhIhMgE6IgDyARoiAQIBWioSIQIBCioKAhFyAOIBRkRSAOIBJkRXIhBiANIA2iIQwgBSsDECERIAUrAwghFSAFKwMAIQ9BACEFAkACQANAIA8gBEEYQTAgAkEMaiAFaigCACIIQQFGG0EAIAgbaiIHKwMAoSINIA2iIBUgBysDCKEiDSANoqAgESAHKwMQoSINIA2ioCAMY0UEQCAFQQRqIgVBDEcNAQwCCwsgAkEYakEIQRAgCEEBRhtBACAIG2pCgICAgICAgPg/NwMAIAMgAikDKDcDECADIAIpAyA3AwggAyACKQMYNwMADAELIAxBCEEQIAYgEiAUY3EiCBtBACAGGyIJIAJBMGpqKwMAIg1kBEAgA0IANwMIIANCgICAgICAgPg/NwMAIANCADcDEAwBCyAMIA2iIBdjBEAgAkECNgIUIAJCgICAgBA3AgxBACEFA0BEAAAAAAAAAAAhDSAVIARBGEEwQQRBCCACQQxqIAVqKAIAIgZBAUYiCBtBACAGG0GM8wBqKAIAIgdBAUYbQQAgBxtqIgcrAwihIg4gAkHIAGpBGEEwIAgbQQAgBhtqIgkrAwAiFKIgDyAHKwMAoSIXIAkrAwgiGKKhIhIgEqIgGCARIAcrAxChIhiiIA4gCSsDECIZoqEiDiAOoiAXIBmiIBggFKKhIhQgFKKgoCAMQQhBECAIG0EAIAYbIgYgAkEwamorAwCiY0UEQCAWIBKiIBMgDqJEAAAAAAAAAACgIBAgFKKgoCENCyACQRhqIAZqIA05AwAgBUEEaiIFQQxHDQALIAIgAisDGCIMIAwgAisDICIRoCACKwMoIhWgIgyjIg85AxggAiARIAyjIhE5AyAgAiAVIAyjIgw5AyggAyAMOQMQIAMgETkDCCADIA85AwAMAQsgBEEYQTBBBEEIIAgbQQAgBhtBjPMAaigCACIFQQFGIgcbQQAgBRtqIgQrAxAhDCAEKwMAIRAgBCsDCCETIAkgAkEYaiIEakIANwMAQQhBECAHG0EAIAUbIARqRAAAAAAAAPA/IA8gEKEgAkHIAGpBGEEwIAgbQQAgBhtqIgYrAwCiRAAAAAAAAAAAoCAVIBOhIAYrAwiioCARIAyhIAYrAxCioCANoyIMoTkDACAEQQhBEEEEQQggBxtBACAFG0GM8wBqKAIAIgRBAUYbQQAgBBtqIAw5AwAgAyACKQMoNwMQIAMgAikDIDcDCCADIAIpAxg3AwALIAJBkAFqJAAgACgCACALQRhsaiICIAMpAxA3AxAgAiADKQMINwMIIAIgAykDADcDACABQQRqIgFBDEcNAAsLIANB8ABqJAAL3AMBD38CQCAAKAIYIAFqLQAARQ0AIAFBAnQiBiAAKAIgIgMoAgBqIgIoAgAiBCACQXhBBCABIAFBA20iCkEDbGtBAkYbaigCACIFTg0AIAAoAiQgBEECdGooAgAiAkUNACACIAJBH3UiB3MgB2shDCAALQA8QQFzIQcgBiADKAIgIghqKAIAIQ0gACgCLCIJIAQgBSACQQBIIgIbQQJ0aigCACEBIAkgBSAEIAIbQQJ0aigCACEEIAggAygCECAGaigCACICQQJ0aigCACEIIAAoAjQiAyAKQQJ0aigCAEECdCEGIAMgAkEDbSIJQQJ0aigCAEECdCEOA0AgACgCECAGaiICIAIoAgAiA0EBajYCACAAKAIQIA5qIgIgAigCACIFQQFqNgIAIAAoAgAiDyADQQR0IhBqIgIgDTYCDCACIAU2AgggAiABNgIEIAIgBDYCACAPIAVBBHQiBWoiAiAINgIMIAIgAzYCCCACIAQ2AgQgAiABNgIAIAAoAggiAyAQaiICQX82AgwgAiAKNgIIIAJBfzYCBCACIAc2AgAgAyAFaiICQX82AgwgAiAJNgIIIAJBfzYCBCACIAc2AgAgAUEBaiEBIARBAWohBCALQQFqIgsgDEcNAAsLC8cCAQV/IwBBIGsiBiQAAkACQCAAKAIEIgIgACgCCCIDSQRAIAIgASkDEDcDECACIAEpAwg3AwggAiABKQMANwMAIAJBGGohAQwBCyACIAAoAgAiBGtBGG0iBUEBaiICQavVqtUATw0BIAZBDGpBqtWq1QAgAyAEa0EYbSIDQQF0IgQgAiACIARJGyADQdWq1SpPGyAFIAAQZCICKAIIIgMgASkDEDcDECADIAEpAwg3AwggAyABKQMANwMAIAIoAgQgACgCBCAAKAIAIgRrIgFBaG1BGGxqIQUgAQRAIAUgBCAB/AoAAAsgACgCACEEIAAgBTYCACACIAQ2AgQgACADQRhqIgE2AgQgAiAENgIIIAAoAgghAyAAIAIoAgw2AgggAiAENgIAIAIgAzYCDCACEIwBCyAAIAE2AgQgBkEgaiQADwsQJgALkwEBA38gACgCGCgCACABQQN0aiICKAIEIQMgACgCCCACKAIAQQJ0aiICIAAoAhAgAUECdGooAgAiASABQR91IgFzIAFrIgEgAigCAGo2AgAgACgCACICIANBA21BAnRqIgQgBCgCACABajYCACACIAAoAhwoAhAgA0ECdGooAgBBA21BAnRqIgAgACgCACABajYCAAuTAQEDfyAAKAIYKAIAIAFBA3RqIgIoAgAhAyAAKAIIIAIoAgRBAnRqIgIgACgCECABQQJ0aigCACIBIAFBH3UiAXMgAWsiASACKAIAajYCACAAKAIAIgIgA0EDbUECdGoiBCAEKAIAIAFqNgIAIAIgACgCHCgCECADQQJ0aigCAEEDbUECdGoiACAAKAIAIAFqNgIAC6gBAQN/IwBBIGsiAyQAAkAgAQRAIAEtABAgAEVyDQEDQCAFQQFqIgVBgAhGBEBBACEFIAEtABANAwsgAiAEEOEEIARBAWoiBCAARw0ACwwBCyADIAIoAgA2AgwgAyACKAIENgIQIAMgAigCCDYCFCADIAIoAgw2AhggAyACKAIQNgIcIABFDQADQCADQQxqIAQQ4QQgBEEBaiIEIABHDQALCyADQSBqJAAL7gECBX8BfgJAAkAgACgCBCICRQRAIABBBGoiBCEDDAELIAEoAgQhBSABKAIAIQYDQAJAAkAgAiIDKAIQIgQgBkwEQCAEIAZIDQIgBSACKAIUIgJODQELIAMhBCADKAIAIgINAgwDCyACIAVIDQAgAyECDAMLIAMoAgQiAg0ACyADQQRqIQQLQSQQIyECIAEpAgAhByACQQA2AiAgAkIANwIYIAIgBzcCECACIAM2AgggAkIANwIAIAQgAjYCACAAKAIAKAIAIgEEQCAAIAE2AgALIAAoAgQgAhCnASAAIAAoAghBAWo2AggLIAJBGGoL1wMBCX8jAEGAAWsiCiQAIAMoAlwhCyABKAIAIQwgASgCBCEBIAIoAgAhDSACKAIEIQIgACgCACEOIAAoAgQhACAEKAIAIQ8gBCgCBCEEIAUoAgAhECAFKAIEIQUgBigCACERIAYoAgQhBiAHKAIAIRIgBygCBCEHIAogCDoAPCAKIAc2AjggCiASNgI0IAogBjYCMCAKIBE2AiwgCiAFNgIoIAogEDYCJCAKIANB2ABqIgM2AiAgCiAENgIcIAogDzYCGCAKIAA2AhQgCiAONgIQIAogAjYCDCAKIA02AgggCiABNgIEIAogDDYCAAJAIAkEQCALRQ0BIAktABBBAXENAUEAIQFBACEDA0AgAUEBaiIBQYAIRgRAQQAhASAJLQAQDQMLIAogAxDnBCADQQFqIgMgC0cNAAsMAQsgCiAIOgB8IAogBzYCeCAKIBI2AnQgCiAGNgJwIAogETYCbCAKIAU2AmggCiAQNgJkIAogAzYCYCAKIAQ2AlwgCiAPNgJYIAogADYCVCAKIA42AlAgCiACNgJMIAogDTYCSCAKIAE2AkQgCiAMNgJAIAtFDQBBACEDA0AgCkFAayADEOcEIANBAWoiAyALRw0ACwsgCkGAAWokAAuYCwIRfwZ8IwBBQGoiDSQAAkAgBCgCACIQIARBBGoiGkYNACAKQQFzIRUDQCALBEAgCy0AEA0CCyAQKAIQIQRBACEMIA1BADYCJCANQgA3AhxBACEKAkACQAJAIBAoAhgiDiAQKAIUIg9HBEAgDiAPayIOQRhtQavVqtUATw0BIA0gDhAjIgo2AiAgDSAKNgIcIA0gCiAOaiIMNgIkIA4EQCAKIA8gDvwKAAALIA0gDDYCIAsgCiAMEMwBIARBAnQiCiAGKAJoaigCACERIAIoAgAgBGpBADoAACARIAIoAgBqQQA6AAAgBigCSCIMIAYoAlggCmoiCkF4QQQgBCAEQQNtIhZBA2xrQQJGG2ooAgAiE0EYbGoiBCsDECAMIAooAgAiDkEYbGoiCisDEKEhHSAEKwMIIAorAwihIR4gBCsDACAKKwMAoSEfIAAoAkghDCANKAIcIgQgDSgCICIPRw0BDAILECYACwNAIAQgHyAMIAQoAghBGGxqIgorAwCiRAAAAAAAAAAAoCAeIAorAwiioCAdIAorAxCioDkDACAEQRhqIgQgD0cNAAsLIAwgCCgCACIPIA5BAnQiDmooAgAiBEEYbGoiCisDECEgIAorAwAhISAKKwMIISJBACEKIA0gBygCACISIA5qKAIAIg5BAEo6ABAgDUH/////BzYCDCANIAQ2AgggDSAfICGiRAAAAAAAAAAAoCAeICKioCAdICCioDkDACAOBEAgDiAOQR91IgxzIAxrIQwDQCANQRxqIA0Q6AQgDSAEQQFqIgQ2AgggCkEBaiIKIAxHDQALIAgoAgAhDyAHKAIAIRIgACgCSCEMCyAMIA8gE0ECdCIOaigCACIEQRhsaiIKKwMQISAgCisDACEhIAorAwghIiANIA4gEmooAgAiCkEfdjoAECANQf////8HNgIMIA0gBDYCCCANIB8gIaJEAAAAAAAAAACgIB4gIqKgIB0gIKKgOQMAIAoEQCAKIApBH3UiDHMgDGshDEEAIQoDQCANQRxqIA0Q6AQgDSAEQQFqIgQ2AgggCkEBaiIKIAxHDQALCyANKAIgIgogDSgCHCIOa0EYbUEBdiEPIAkgFkECdGooAgAhEiAJIBFBA20iG0ECdGooAgAhESAOIgQhDAJAIAQgCkYNAANAIAQtABBBAXFFBEAgCiEMA0AgDEEYayIKIARGBEAgBCEMDAQLIAxBCGsgCiEMLQAAQQFxRQ0ACyANIAQpAxA3AzggDSAEKQMINwMwIA0gBCkDADcDKCAEIAopAxA3AxAgBCAKKQMINwMIIAQgCikDADcDACAKIA0pAzg3AxAgCiANKQMwNwMIIAogDSkDKDcDACAEQRhqIgQgCkcNAQwCCyAEQRhqIgQgCkcNAAsgCiEMCyAOIAwQzAEgDCANKAIgEMwBIA0oAhwhBAJAAkAgDwRAIAMoAgAiCiARQQJ0aiEOIAogEkECdGohESAFKAIAIRIgASgCACETQQAhCgNAIAQgCkEYbGoiDCAPQRhsaigCCCEXIAwoAgghGCARIBEoAgAiGUEBajYCACAOIA4oAgAiFEEBajYCACATIBlBBHQiHGoiDEEANgIMIAwgFDYCCCAMIBc2AgQgDCAYNgIAIBIgHGoiDEF/NgIMIAwgFjYCCCAMQX82AgQgDCAVNgIAIBMgFEEEdCIUaiIMQQA2AgwgDCAZNgIIIAwgGDYCBCAMIBc2AgAgEiAUaiIMQX82AgwgDCAbNgIIIAxBfzYCBCAMIBU2AgAgCkEBaiIKIA9HDQALDAELIARFDQELIA0gBDYCICANKAIkGiAEECILAkAgECgCBCIEBEADQCAEIhAoAgAiBA0ADAILAAsDQCAQIBAoAggiECgCAEcNAAsLIBAgGkcNAAsLIA1BQGskAAv1CAETfyMAQYABayIKJAACQAJAIAgEQCAILQAQDQELIAIoAgRFDQAgAEEEaiEWIAZBAnQhFyAGQQFzQQJ0IRgDQCAIBEAgCC0AEA0CCyAKQZCRAjYCICAKQdiRAjYCCCAKIApBIGo2AjAgCiAKQQhqNgIYIBNBAnQiCSADKAIAaigCACEUIAQoAgAgCWooAgAhGSAFKAIQIAIoAgAgE0EDdGoiCSAYaigCACIPQQJ0aigCACELIAogCSAXaigCACIRNgJoIAogC0EDbSINNgJkAn8gBgRAIBEhEiAPQQNtDAELIAogDTYCaCAKIBE2AmQgD0EDbSESIBELIQwgCiASNgJgIAogDDYCXCAUQR92IQ4CQAJAIBYiECILKAIAIglFDQADQCAJIgsoAhAiECAPSgRAIAkhECAJKAIAIgkNAQwCCyAPIBBMBEAMAwsgCygCBCIJDQALIAtBBGohEAtBIBAjIglBADYCHCAJQgA3AhQgCSAPNgIQIAkgCzYCCCAJQgA3AgAgECAJNgIAIAAoAgAoAgAiCwRAIAAgCzYCAAsgACgCBCAJEKcBIAAgACgCCEEBajYCCAsgCiAPNgI8IAogCUEUajYCQCAKIA46ADggCiABIApB5ABqEOwENgJMIAogDSARczYCSCAKIAYgDkY6AEQgCiABIApB3ABqEOwENgJYIAogDCASczYCVCAKIAYgDkc6AFAgFCAUQR91IglzIAlrIRogByATaiESQQAhEQNAIAogCkE4aiARaiIJKAIEIhs2AmwgCigCMCILRQ0DIAsgCkHsAGogCygCACgCGBEBAAJAIBRFDQAgCS0AACEPIAkoAggiCygCBCEJQQAhEANAAkAgECAZaiEMAkAgCygCCCIOIAlLBEAgCSAPOgAQIAkgEjYCDCAJIAw2AgggCUIANwMAIAlBGGohCQwBCyAJIAsoAgAiDWtBGG0iFUEBaiIJQavVqtUATw0BIApB7ABqQarVqtUAIA4gDWtBGG0iDkEBdCINIAkgCSANSRsgDkHVqtUqTxsgFSALEGQhDiAKKAJ0IgkgDzoAECAJIBI2AgwgCSAMNgIIIAlCADcDACAKKAJwIAsoAgQgCygCACIVayIMQWhtQRhsaiENIAwEQCANIBUgDPwKAAALIAsoAgAhDCALIA02AgAgCiAMNgJwIAsgCUEYaiIJNgIEIAogDDYCdCALKAIIIQ0gCyAKKAJ4NgIIIAogDTYCeCAOIAw2AgAgDhCMAQsgCyAJNgIEIBBBAWoiECAaRw0BDAILCxAmAAsgCiAbNgJsIAooAhgiCUUNAyAJIApB7ABqIAkoAgAoAhgRAQAgEUEMaiIRQSRHDQALAkAgCigCGCILIApBCGpGBH9BEAUgC0UNAUEUCyEJIAsgCygCACAJaigCABEAAAsCQCAKKAIwIgsgCkEgakYEf0EQBSALRQ0BQRQLIQkgCyALKAIAIAlqKAIAEQAACyATQQFqIhMgAigCBEkNAAsLIApBgAFqJAAPCxBmAAvjCQMFfwN8AX4jAEFAaiICJABBASEFAkACQAJAAkACQAJAIAEgAGtBBnUOBgUFAAECAwQLIAFBOGsrAwAgACsDCGNFDQQgAiAAQcAA/AoAACAAIAFBQGoiAEHAAPwKAAAgACACQcAA/AoAAAwECyABQUBqIQMgAEFAayEEIAFBOGsiASsDACEIIAArA0giByAAKwMIY0UEQCAHIAhkRQ0EIAIgBEHAAPwKAAAgBCADQcAA/AoAACADIAJBwAD8CgAAIAArA0ggACsDCGNFDQQgAiAAQcAA/AoAACAAIARBwAD8CgAAIAQgAkHAAPwKAAAMBAsgByAIZARAIAIgAEHAAPwKAAAgACADQcAA/AoAACADIAJBwAD8CgAADAQLIAIgAEHAAPwKAAAgACAEQcAA/AoAACAEIAJBwAD8CgAAIAErAwAgACsDSGNFDQMgAiAEQcAA/AoAACAEIANBwAD8CgAAIAMgAkHAAPwKAAAMAwsgAEGAAWohAyAAQUBrIQQgACsDiAEhCQJAIAArA0giCCAAKwMIIgdjRQRAIAggCWRFDQEgAiAEQcAA/AoAACAEIANBwAD8CgAAIAMgAkHAAPwKAAAgACsDSCAHY0UNASACIABBwAD8CgAAIAAgBEHAAPwKAAAgBCACQcAA/AoAAAwBCyAIIAlkBEAgAiAAQcAA/AoAACAAIANBwAD8CgAAIAMgAkHAAPwKAAAMAQsgAiAAQcAA/AoAACAAIARBwAD8CgAAIAQgAkHAAPwKAAAgCSAAKwNIY0UNACACIARBwAD8CgAAIAQgA0HAAPwKAAAgAyACQcAA/AoAAAsgAUE4aysDACAAKwOIAWNFDQIgAiADQcAA/AoAACADIAFBQGoiAUHAAPwKAAAgASACQcAA/AoAACAAKwOIASAAKwNIY0UNAiACIARBwAD8CgAAIAQgA0HAAPwKAAAgAyACQcAA/AoAACAAKwNIIAArAwhjRQ0CIAIgAEHAAPwKAAAgACAEQcAA/AoAACAEIAJBwAD8CgAADAILIAAgAEFAayAAQYABaiAAQcABaiABQUBqEPEEDAELIABBQGshAyAAQYABaiEEIAArA4gBIQkCQCAAKwNIIgggACsDCCIHY0UEQCAIIAlkRQ0BIAIgA0HAAPwKAAAgAyAEQcAA/AoAACAEIAJBwAD8CgAAIAArA0ggB2NFDQEgAiAAQcAA/AoAACAAIANBwAD8CgAAIAMgAkHAAPwKAAAMAQsgCCAJZARAIAIgAEHAAPwKAAAgACAEQcAA/AoAACAEIAJBwAD8CgAADAELIAIgAEHAAPwKAAAgACADQcAA/AoAACADIAJBwAD8CgAAIAkgACsDSGNFDQAgAiADQcAA/AoAACADIARBwAD8CgAAIAQgAkHAAPwKAAALIABBwAFqIgMgAUYNAANAAkAgAysDCCIHIAQrAwhjRQ0AIAMpAwAhCiACIANBEGpBMPwKAAAgAyEFA0ACQCAFIAQiBUHAAPwKAAAgACAERgRAIAAhBQwBCyAFQUBqIQQgByAFQThrKwMAYw0BCwsgBSAHOQMIIAUgCjcDACAFQRBqIAJBMPwKAAAgBkEBaiIGQQhHDQAgA0FAayABRiEFDAILIAMiBEFAayIFIQMgASAFRw0AC0EBIQULIAJBQGskACAFC8wEAgF/AnwjAEFAaiEFIAIrAwghBgJAIAErAwgiByAAKwMIY0UEQCAGIAdjRQ0BIAUgAUHAAPwKAAAgASACQcAA/AoAACACIAVBwAD8CgAAIAErAwggACsDCGNFDQEgBSAAQcAA/AoAACAAIAFBwAD8CgAAIAEgBUHAAPwKAAAMAQsgBiAHYwRAIAUgAEHAAPwKAAAgACACQcAA/AoAACACIAVBwAD8CgAADAELIAUgAEHAAPwKAAAgACABQcAA/AoAACABIAVBwAD8CgAAIAIrAwggASsDCGNFDQAgBSABQcAA/AoAACABIAJBwAD8CgAAIAIgBUHAAPwKAAALAkAgAysDCCACKwMIY0UNACAFIAJBwAD8CgAAIAIgA0HAAPwKAAAgAyAFQcAA/AoAACACKwMIIAErAwhjRQ0AIAUgAUHAAPwKAAAgASACQcAA/AoAACACIAVBwAD8CgAAIAErAwggACsDCGNFDQAgBSAAQcAA/AoAACAAIAFBwAD8CgAAIAEgBUHAAPwKAAALAkAgBCsDCCADKwMIY0UNACAFIANBwAD8CgAAIAMgBEHAAPwKAAAgBCAFQcAA/AoAACADKwMIIAIrAwhjRQ0AIAUgAkHAAPwKAAAgAiADQcAA/AoAACADIAVBwAD8CgAAIAIrAwggASsDCGNFDQAgBSABQcAA/AoAACABIAJBwAD8CgAAIAIgBUHAAPwKAAAgASsDCCAAKwMIY0UNACAFIABBwAD8CgAAIAAgAUHAAPwKAAAgASAFQcAA/AoAAAsLwwYBCX8CQAJAAkACQAJAIAMOAwQCAAELAkAgAigCACgCACIDIAFBBGsiASgCACIGQQN0aiIHIAIoAgQoAgAiAkECdCIFaigCACILIAUgAyAAKAIAIgVBA3RqIgNqKAIAIglOBEAgCSALRw0BIAdBASACa0ECdCICaigCACACIANqKAIATg0BCyAEIAY2AgAgBCAAKAIANgIEDwsgBCAFNgIAIAQgASgCADYCBA8LIANBCEoNASAAIAFGDQIgBCAAKAIANgIAIABBBGoiBiABRg0CQQEgAigCBCgCACIAayELIAIoAgAoAgAhByAAQQJ0IQUgBCEAA0AgAEEEaiECAkACfwJAAkAgByAGKAIAIgNBA3RqIgkgBWooAgAiCCAHIAAoAgAiCkEDdGoiDCAFaigCACINTgRAIAggDUcNASAJIAtBAnQiCGooAgAgCCAMaigCAE4NAQsgACAKNgIEIAQgACAERg0CGgNAIAcgBigCAEEDdGoiCSAFaigCACIIIAcgAEEEayIDKAIAIgpBA3RqIgwgBWooAgAiDU4EQCAIIA1HDQMgCSALQQJ0IghqKAIAIAggDGooAgBODQMLIAAgCjYCACADIgAgBEcNAAsgBAwCCyACIAM2AgAMAgsgAAsgBigCADYCAAsgAiEAIAZBBGoiBiABRw0ACwwCCyAEIAAoAgA2AgAMAQsgACAAIANBAXYiB0ECdCIFaiIGIAIgByAEIAcQ0AEgBiABIAIgAyAHayIDIAQgBWogAxDQASACKAIEIQcgAigCACECIAYhAwNAIAEgA0YEQCAAIAZGDQIDQCAEIAAoAgA2AgAgBEEEaiEEIABBBGoiACAGRw0ACwwCCwJAAkAgAigCACIFIAMoAgAiC0EDdGoiCSAHKAIAIghBAnQiCmooAgAiDCAKIAUgACgCACIKQQN0aiIFaigCACINTgRAIAwgDUcNASAJQQEgCGtBAnQiCGooAgAgBSAIaigCAE4NAQsgBCALNgIAIANBBGohAwwBCyAEIAo2AgAgAEEEaiEACyAEQQRqIQQgACAGRw0ACyABIANGDQADQCAEIAMoAgA2AgAgBEEEaiEEIANBBGoiAyABRw0ACwsLpwsDD38DfAN+IwBB0AFrIgUkAAJAIAAoAgQgAkEwbGoiBysDACABKwMYZUUNACAHKwMIIAErAyBlRQ0AIAcrAxAgASsDKGVFDQAgBysDGCABKwMAZkUNACAHKwMgIAErAwhmRQ0AIAcrAyggASsDEGZFDQACQCACQQFxDQAgACgCFCgCACEKIAVBoAFqQQBBMPwLACAFQfAAakEAQTD8CwAgCigCACIRKAJYIANBAnRqIgBBeEEEIANBA29BAkYbaigCACEQIAAoAgAhDCAKKAIEIQAgBUECNgIQIAVCgICAgBA3AgggACgCWCINIAJBAXUiDiACaiIPQQJ0aiESIAAoAmghEwNAQQEhAAJAIA0gBUEIaiAIaigCACIJIA9qIgtBAnQiB2ooAgAiBiASQQRBCCAJQQFGG0EAIAkbQYzpAGooAgBBAnRqKAIAIgFIBEAgBiEHIAEhBgwBCyAHIBNqKAIAIQtBACEAIAEhBwsgBUFAayAJQQR0aiIBIAA6AAwgASAGNgIIIAEgBzYCBCABIAs2AgAgCEEEaiIIQQxHDQALIAUgEDYCOCAFIAw2AjQgCkEIaiENQQAhCEEAIQdBACEBQQAhAANAIAVBCGogDSAFQTRqIAFqKAIAIgsgDiAFQUBrEIYDAkAgBSsDECIUvUL///////////8Ag0L/////////9/8AVg0AQQAgBSgCCCIJayAJIAsgDEYbIABqIQAgCEEBSgRAQQIhCAwBCyAIRSAHIAlFc0EBcUVyRQRAQQEhCAwBCyAIQRhsIg8gBUGgAWpqIgYgESgCSCALQRhsaiIHKQMQIhg3AxAgBiAHKQMIIhc3AwggBiAHKQMAIhk3AwAgBiAXNwMQIAYgGDcDCCAFQfAAaiAPaiIGIBc3AxAgBiAZNwMAIAYgFDkDCCAIQQFqIQggCUEARyEHCyABQQRqIgFBCEcNAAsgBUECNgI8IAVCgICAgBA3AjQgCkEQaiEJQQAhBgNAIAVBCGogCSAFQUBrIAVBNGogBmooAgBBBHRqIgEoAgAgASgCBCABKAIIIAMgDCAQEPcEAkAgBSsDECIUvUL///////////8Ag0L/////////9/8AVg0AQQAgBSgCCCIKayAKIAEtAAwbIABqIQAgCEEBSgRAQQIhCAwBCyAIRSAHIApFc0EBcUVyRQRAQQEhCAwBCyAIQRhsIgcgBUGgAWpqIgEgFDkDACABIAUrAyAiFTkDCCABIAUrAxgiFjkDECAFQfAAaiAHaiIHIBY5AxAgByAVOQMIIAcgFDkDACABIAUrAyg5AwggByAVOQMIIAhBAWohCCAKQQBHIQcLIAZBBGoiBkEMRw0ACwJ8IABFBEBEAAAAAAAA+H8hFUQAAAAAAAD4fyEWRAAAAAAAAPh/DAELIAVBCGogBUGgAWogBUG4AWogBUHwAGogBUGIAWoQzgEgBSsDECEWIAUrAxghFSAFKwMICyIUvUL///////////8Ag0L/////////9/8AVg0AAkAgBCgCBCIBIAQoAggiBk8EQCAEIAZBAXRBgAEgBhsQRCAEIAQoAgQiAUEBajYCBAwBCyAEIAFBAWo2AgQLIAQoAgAgAUEDdGogDq0gA61CIIaENwIAIARBEGohAwJAIAQoAhQiASAEKAIYIgZPBEAgAyAGQQF0QYABIAYbECUgBCgCECAEKAIUIgFBAnRqIAA2AgAMAQsgAygCACABQQJ0aiAANgIACyAEIAFBAWo2AhQgBEEgaiEAAn8gBCgCJCIIIAQoAigiAU8EQCAAIAFBAXRBgAEgARsQMyAEKAIgIAQoAiQiCEEYbGoMAQsgACgCACAIQRhsagsiASAUOQMAIAQgCEEBajYCJCABIBY5AxAgASAVOQMICyACQYGAgIB4cUEBRiEGCyAFQdABaiQAIAYLwwYBCX8CQAJAAkACQAJAIAMOAwQCAAELAkAgAigCACgCACIDIAFBBGsiASgCACIGQQN0aiIHIAIoAgQoAgAiAkECdCIFaigCACILIAUgAyAAKAIAIgVBA3RqIgNqKAIAIglOBEAgCSALRw0BIAdBASACa0ECdCICaigCACACIANqKAIATg0BCyAEIAY2AgAgBCAAKAIANgIEDwsgBCAFNgIAIAQgASgCADYCBA8LIANBCEoNASAAIAFGDQIgBCAAKAIANgIAIABBBGoiBiABRg0CQQEgAigCBCgCACIAayELIAIoAgAoAgAhByAAQQJ0IQUgBCEAA0AgAEEEaiECAkACfwJAAkAgByAGKAIAIgNBA3RqIgkgBWooAgAiCCAHIAAoAgAiCkEDdGoiDCAFaigCACINTgRAIAggDUcNASAJIAtBAnQiCGooAgAgCCAMaigCAE4NAQsgACAKNgIEIAQgACAERg0CGgNAIAcgBigCAEEDdGoiCSAFaigCACIIIAcgAEEEayIDKAIAIgpBA3RqIgwgBWooAgAiDU4EQCAIIA1HDQMgCSALQQJ0IghqKAIAIAggDGooAgBODQMLIAAgCjYCACADIgAgBEcNAAsgBAwCCyACIAM2AgAMAgsgAAsgBigCADYCAAsgAiEAIAZBBGoiBiABRw0ACwwCCyAEIAAoAgA2AgAMAQsgACAAIANBAXYiB0ECdCIFaiIGIAIgByAEIAcQ0QEgBiABIAIgAyAHayIDIAQgBWogAxDRASACKAIEIQcgAigCACECIAYhAwNAIAEgA0YEQCAAIAZGDQIDQCAEIAAoAgA2AgAgBEEEaiEEIABBBGoiACAGRw0ACwwCCwJAAkAgAigCACIFIAMoAgAiC0EDdGoiCSAHKAIAIghBAnQiCmooAgAiDCAKIAUgACgCACIKQQN0aiIFaigCACINTgRAIAwgDUcNASAJQQEgCGtBAnQiCGooAgAgBSAIaigCAE4NAQsgBCALNgIAIANBBGohAwwBCyAEIAo2AgAgAEEEaiEACyAEQQRqIQQgACAGRw0ACyABIANGDQADQCAEIAMoAgA2AgAgBEEEaiEEIANBBGoiAyABRw0ACwsLpwsDD38DfAN+IwBB0AFrIgUkAAJAIAAoAgQgAkEwbGoiBysDACABKwMYZUUNACAHKwMIIAErAyBlRQ0AIAcrAxAgASsDKGVFDQAgBysDGCABKwMAZkUNACAHKwMgIAErAwhmRQ0AIAcrAyggASsDEGZFDQACQCACQQFxDQAgACgCFCgCACEKIAVBoAFqQQBBMPwLACAFQfAAakEAQTD8CwAgCigCACIRKAJYIANBAnRqIgBBeEEEIANBA29BAkYbaigCACEQIAAoAgAhDCAKKAIEIQAgBUECNgIQIAVCgICAgBA3AgggACgCWCINIAJBAXUiDiACaiIPQQJ0aiESIAAoAmghEwNAQQEhAAJAIA0gBUEIaiAIaigCACIJIA9qIgtBAnQiB2ooAgAiBiASQQRBCCAJQQFGG0EAIAkbQYzpAGooAgBBAnRqKAIAIgFIBEAgBiEHIAEhBgwBCyAHIBNqKAIAIQtBACEAIAEhBwsgBUFAayAJQQR0aiIBIAA6AAwgASAGNgIIIAEgBzYCBCABIAs2AgAgCEEEaiIIQQxHDQALIAUgEDYCOCAFIAw2AjQgCkEIaiENQQAhCEEAIQdBACEBQQAhAANAIAVBCGogDSAFQTRqIAFqKAIAIgsgDiAFQUBrEIgDAkAgBSsDECIUvUL///////////8Ag0L/////////9/8AVg0AQQAgBSgCCCIJayAJIAsgDEYbIABqIQAgCEEBSgRAQQIhCAwBCyAIRSAHIAlFc0EBcUVyRQRAQQEhCAwBCyAIQRhsIg8gBUGgAWpqIgYgESgCSCALQRhsaiIHKQMQIhg3AxAgBiAHKQMIIhc3AwggBiAHKQMAIhk3AwAgBiAXNwMQIAYgGDcDCCAFQfAAaiAPaiIGIBc3AxAgBiAZNwMAIAYgFDkDCCAIQQFqIQggCUEARyEHCyABQQRqIgFBCEcNAAsgBUECNgI8IAVCgICAgBA3AjQgCkEQaiEJQQAhBgNAIAVBCGogCSAFQUBrIAVBNGogBmooAgBBBHRqIgEoAgAgASgCBCABKAIIIAMgDCAQEPoEAkAgBSsDECIUvUL///////////8Ag0L/////////9/8AVg0AQQAgBSgCCCIKayAKIAEtAAwbIABqIQAgCEEBSgRAQQIhCAwBCyAIRSAHIApFc0EBcUVyRQRAQQEhCAwBCyAIQRhsIgcgBUGgAWpqIgEgFDkDACABIAUrAyAiFTkDCCABIAUrAxgiFjkDECAFQfAAaiAHaiIHIBY5AxAgByAVOQMIIAcgFDkDACABIAUrAyg5AwggByAVOQMIIAhBAWohCCAKQQBHIQcLIAZBBGoiBkEMRw0ACwJ8IABFBEBEAAAAAAAA+H8hFUQAAAAAAAD4fyEWRAAAAAAAAPh/DAELIAVBCGogBUGgAWogBUG4AWogBUHwAGogBUGIAWoQzgEgBSsDECEWIAUrAxghFSAFKwMICyIUvUL///////////8Ag0L/////////9/8AVg0AAkAgBCgCBCIBIAQoAggiBk8EQCAEIAZBAXRBgAEgBhsQRCAEIAQoAgQiAUEBajYCBAwBCyAEIAFBAWo2AgQLIAQoAgAgAUEDdGogDq0gA61CIIaENwIAIARBEGohAwJAIAQoAhQiASAEKAIYIgZPBEAgAyAGQQF0QYABIAYbECUgBCgCECAEKAIUIgFBAnRqIAA2AgAMAQsgAygCACABQQJ0aiAANgIACyAEIAFBAWo2AhQgBEEgaiEAAn8gBCgCJCIIIAQoAigiAU8EQCAAIAFBAXRBgAEgARsQMyAEKAIgIAQoAiQiCEEYbGoMAQsgACgCACAIQRhsagsiASAUOQMAIAQgCEEBajYCJCABIBY5AxAgASAVOQMICyACQYGAgIB4cUEBRiEGCyAFQdABaiQAIAYLwwYBCX8CQAJAAkACQAJAIAMOAwQCAAELAkAgAigCACgCACIDIAFBBGsiASgCACIGQQN0aiIHIAIoAgQoAgAiAkECdCIFaigCACILIAUgAyAAKAIAIgVBA3RqIgNqKAIAIglOBEAgCSALRw0BIAdBASACa0ECdCICaigCACACIANqKAIATg0BCyAEIAY2AgAgBCAAKAIANgIEDwsgBCAFNgIAIAQgASgCADYCBA8LIANBCEoNASAAIAFGDQIgBCAAKAIANgIAIABBBGoiBiABRg0CQQEgAigCBCgCACIAayELIAIoAgAoAgAhByAAQQJ0IQUgBCEAA0AgAEEEaiECAkACfwJAAkAgByAGKAIAIgNBA3RqIgkgBWooAgAiCCAHIAAoAgAiCkEDdGoiDCAFaigCACINTgRAIAggDUcNASAJIAtBAnQiCGooAgAgCCAMaigCAE4NAQsgACAKNgIEIAQgACAERg0CGgNAIAcgBigCAEEDdGoiCSAFaigCACIIIAcgAEEEayIDKAIAIgpBA3RqIgwgBWooAgAiDU4EQCAIIA1HDQMgCSALQQJ0IghqKAIAIAggDGooAgBODQMLIAAgCjYCACADIgAgBEcNAAsgBAwCCyACIAM2AgAMAgsgAAsgBigCADYCAAsgAiEAIAZBBGoiBiABRw0ACwwCCyAEIAAoAgA2AgAMAQsgACAAIANBAXYiB0ECdCIFaiIGIAIgByAEIAcQ0gEgBiABIAIgAyAHayIDIAQgBWogAxDSASACKAIEIQcgAigCACECIAYhAwNAIAEgA0YEQCAAIAZGDQIDQCAEIAAoAgA2AgAgBEEEaiEEIABBBGoiACAGRw0ACwwCCwJAAkAgAigCACIFIAMoAgAiC0EDdGoiCSAHKAIAIghBAnQiCmooAgAiDCAKIAUgACgCACIKQQN0aiIFaigCACINTgRAIAwgDUcNASAJQQEgCGtBAnQiCGooAgAgBSAIaigCAE4NAQsgBCALNgIAIANBBGohAwwBCyAEIAo2AgAgAEEEaiEACyAEQQRqIQQgACAGRw0ACyABIANGDQADQCAEIAMoAgA2AgAgBEEEaiEEIANBBGoiAyABRw0ACwsL6gwDDHwRfwF+IwBBkAFrIhQkACAUQeAAakEAQTD8CwAgFEEwakEAQTD8CwAgFCAENgIsIBQgAzYCKCAUQoCAgIAQNwIAIAEoAgQiGigCSCIfIAdBGGwiFWoiICsDACILIB8gBkEYbCIXaiIhKwMAIgyhIQ4gBUEDbSEiIBooApgBIiMgFWorAwAhDyAXICNqKwMAIRAgASgCACIbKAKYASEcIBsoAkghHUEAIQFBACEXA0ACfyAPIBwgFEEoaiAUIBdqKAIAIh5BAnRqKAIAQRhsIhVqKwMAmiIJZCAVIB1qIhgrAwAiCCALYyAIIAthGyAJIBBjIAggDGMgCCAMYRtrIiRFBEBEAAAAAAAA+H8hCUQAAAAAAAD4fyEKQQAMAQsgISsDECEKICErAwghCQJAIAggDKEiDSAIIAuhIgggDZkgCJljIhUbIA6jIgi9Qv///////////wCDQv/////////3/wBWDQAgICsDCCINIAmhIhG9Qv///////////wCDQoCAgICAgID4/wBaDQAgICsDECISIAqhIhO9Qv///////////wCDQoCAgICAgID4/wBaDQAgCiASIBUbIAggE6KgIQogCSANIBUbIAggEaKgIQkLICRBACAaKAKoASIVICJBGGxqKwMIIBUgGigCaCAFQQJ0aigCAEEDbUEYbGorAwigRAAAAAAAAAAAZCAYKwMIIgggCWMgCCAJYRsbCyEVAkAgCb1C////////////AINC//////////f/AFYNACAVQQAgFWsgHhsgGWohGSABQQFKBEBBAiEBDAELIAFFIBVFIBZzRXJFBEBBASEBDAELIAFBGGwiHiAUQeAAamoiFiAYKQMAIiU3AwAgFiAYKQMQNwMQIBYgGCkDCDcDCCAUQTBqIB5qIhYgCTkDCCAWIAo5AxAgFiAlNwMAIAFBAWohASAVQQBHIRYLIBdBBGoiF0EIRw0ACyAUIAc2AiQgFCAGNgIgIBRCgICAgBA3AgAgHSAEQRhsIhVqIgQrAwAiCyAdIANBGGwiA2oiBisDACIMoSEOIAJBA20hByAVIBxqKwMAmiEPIAMgHGorAwCaIRBBACEXA0ACfyAjIBRBIGogFCAXaigCACIYQQJ0aigCAEEYbCIDaisDACIJIBBkIAwgAyAfaiIDKwMAIghjIAggDGEbIAkgD2QgCCALZCAIIAthG2siHEUEQEQAAAAAAAD4fyEJRAAAAAAAAPh/IQpBAAwBCyAGKwMQIQogBisDCCEJAkAgCCAMoSINIAggC6EiCCANmSAImWMiFRsgDqMiCL1C////////////AINC//////////f/AFYNACAEKwMIIg0gCaEiEb1C////////////AINCgICAgICAgPj/AFoNACAEKwMQIhIgCqEiE71C////////////AINCgICAgICAgPj/AFoNACAKIBIgFRsgCCAToqAhCiAJIA0gFRsgCCARoqAhCQsgHEEAIBsoAqgBIhUgB0EYbGorAwggFSAbKAJoIAJBAnRqKAIAQQNtQRhsaisDCKBEAAAAAAAAAABkIAkgAysDCCIIYyAIIAlhGxsLIRUCQCAJvUL///////////8Ag0L/////////9/8AVg0AIBVBACAVayAYGyAZaiEZIAFBAUoEQEECIQEMAQsgAUUgFUUgFnNFckUEQEEBIQEMAQsgAUEYbCIYIBRBMGpqIhYgAykDACIlNwMAIBYgAykDEDcDECAWIAMpAwg3AwggFEHgAGogGGoiAyAJOQMIIAMgCjkDECADICU3AwAgAUEBaiEBIBVBAEchFgsgF0EEaiIXQQhHDQALAn8gGUUEQEQAAAAAAAD4fyEIRAAAAAAAAPh/IQtEAAAAAAAA+H8hCkQAAAAAAAD4fyEJQQAMAQsgFCAUQeAAaiAUQfgAaiAUQTBqIBRByABqEM4BIBQrAwghCyAUKwMAIQggGUEAIBsoAqgBIgEgB0EYbGorAxAgASAbKAJoIAJBAnRqKAIAQQNtQRhsaisDEKCaIBooAqgBIgEgIkEYbGorAxAgASAaKAJoIAVBAnRqKAIAQQNtQRhsaisDEKBjIBQrAxAiCiAUKwMYIgljIAkgCmEbGwshASAAIAk5AyAgACAKOQMYIAAgCzkDECAAIAg5AwggACABNgIAIBRBkAFqJAAL8QMBA38jAEEgayIGJAACQCAAKAIEIAJBMGxqIgcrAwAgASsDGGVFDQAgBysDCCABKwMgZUUNACAHKwMQIAErAyhlRQ0AIAcrAxggASsDAGZFDQAgBysDICABKwMIZkUNACAHKwMoIAErAxBmRQ0AAkAgAkEBcQ0AIAYgACgCFCgCACADIAJBAXUiABCNAyAGKQMIQv///////////wCDQv/////////3/wBWDQACQCAEKAIEIgEgBCgCCCIFTwRAIAQgBUEBdEGAASAFGxBEIAQgBCgCBCIBQQFqNgIEDAELIAQgAUEBajYCBAsgBCgCACABQQN0aiADrSAArUIghoQ3AgAgBEEQaiEBIAYoAgAhAwJAIAQoAhQiACAEKAIYIgVPBEAgASAFQQF0QYABIAUbECUgBCgCECAEKAIUIgBBAnRqIAM2AgAMAQsgASgCACAAQQJ0aiADNgIACyAEIABBAWo2AhQgBEEgaiEAAn8gBCgCJCIFIAQoAigiAU8EQCAAIAFBAXRBgAEgARsQMyAEKAIgIAQoAiQiBUEYbGoMAQsgACgCACAFQRhsagshACAEIAVBAWo2AiQgACAGKQMYNwMQIAAgBikDEDcDCCAAIAYpAwg3AwALIAJBgYCAgHhxQQFGIQULIAZBIGokACAFC8MGAQl/AkACQAJAAkACQCADDgMEAgABCwJAIAIoAgAoAgAiAyABQQRrIgEoAgAiBkEDdGoiByACKAIEKAIAIgJBAnQiBWooAgAiCyAFIAMgACgCACIFQQN0aiIDaigCACIJTgRAIAkgC0cNASAHQQEgAmtBAnQiAmooAgAgAiADaigCAE4NAQsgBCAGNgIAIAQgACgCADYCBA8LIAQgBTYCACAEIAEoAgA2AgQPCyADQQhKDQEgACABRg0CIAQgACgCADYCACAAQQRqIgYgAUYNAkEBIAIoAgQoAgAiAGshCyACKAIAKAIAIQcgAEECdCEFIAQhAANAIABBBGohAgJAAn8CQAJAIAcgBigCACIDQQN0aiIJIAVqKAIAIgggByAAKAIAIgpBA3RqIgwgBWooAgAiDU4EQCAIIA1HDQEgCSALQQJ0IghqKAIAIAggDGooAgBODQELIAAgCjYCBCAEIAAgBEYNAhoDQCAHIAYoAgBBA3RqIgkgBWooAgAiCCAHIABBBGsiAygCACIKQQN0aiIMIAVqKAIAIg1OBEAgCCANRw0DIAkgC0ECdCIIaigCACAIIAxqKAIATg0DCyAAIAo2AgAgAyIAIARHDQALIAQMAgsgAiADNgIADAILIAALIAYoAgA2AgALIAIhACAGQQRqIgYgAUcNAAsMAgsgBCAAKAIANgIADAELIAAgACADQQF2IgdBAnQiBWoiBiACIAcgBCAHENMBIAYgASACIAMgB2siAyAEIAVqIAMQ0wEgAigCBCEHIAIoAgAhAiAGIQMDQCABIANGBEAgACAGRg0CA0AgBCAAKAIANgIAIARBBGohBCAAQQRqIgAgBkcNAAsMAgsCQAJAIAIoAgAiBSADKAIAIgtBA3RqIgkgBygCACIIQQJ0IgpqKAIAIgwgCiAFIAAoAgAiCkEDdGoiBWooAgAiDU4EQCAMIA1HDQEgCUEBIAhrQQJ0IghqKAIAIAUgCGooAgBODQELIAQgCzYCACADQQRqIQMMAQsgBCAKNgIAIABBBGohAAsgBEEEaiEEIAAgBkcNAAsgASADRg0AA0AgBCADKAIANgIAIARBBGohBCADQQRqIgMgAUcNAAsLC+YMAwx8EX8BfiMAQZABayIUJAAgFEHgAGpBAEEw/AsAIBRBMGpBAEEw/AsAIBQgBDYCLCAUIAM2AiggFEKAgICAEDcCACABKAIEIhooAkgiHyAHQRhsIhVqIiArAwAiCyAfIAZBGGwiF2oiISsDACIMoSEOIAVBA20hIiAaKAKYASIjIBVqKwMAIQ8gFyAjaisDACEQIAEoAgAiGygCmAEhHCAbKAJIIR1BACEBQQAhFwNAAn8gHCAUQShqIBQgF2ooAgAiHkECdGooAgBBGGwiFWorAwAiCSAPYyAVIB1qIhgrAwAiCCALYyAIIAthGyAJIBBjIAggDGMgCCAMYRtrIiRFBEBEAAAAAAAA+H8hCUQAAAAAAAD4fyEKQQAMAQsgISsDECEKICErAwghCQJAIAggDKEiDSAIIAuhIgggDZkgCJljIhUbIA6jIgi9Qv///////////wCDQv/////////3/wBWDQAgICsDCCINIAmhIhG9Qv///////////wCDQoCAgICAgID4/wBaDQAgICsDECISIAqhIhO9Qv///////////wCDQoCAgICAgID4/wBaDQAgCiASIBUbIAggE6KgIQogCSANIBUbIAggEaKgIQkLICRBACAaKAKoASIVICJBGGxqKwMIIBUgGigCaCAFQQJ0aigCAEEDbUEYbGorAwigRAAAAAAAAAAAZCAYKwMIIgggCWMgCCAJYRsbCyEVAkAgCb1C////////////AINC//////////f/AFYNACAVQQAgFWsgHhsgGWohGSABQQFKBEBBAiEBDAELIAFFIBVFIBZzRXJFBEBBASEBDAELIAFBGGwiHiAUQeAAamoiFiAYKQMAIiU3AwAgFiAYKQMQNwMQIBYgGCkDCDcDCCAUQTBqIB5qIhYgCTkDCCAWIAo5AxAgFiAlNwMAIAFBAWohASAVQQBHIRYLIBdBBGoiF0EIRw0ACyAUIAc2AiQgFCAGNgIgIBRCgICAgBA3AgAgHSAEQRhsIhVqIgQrAwAiCyAdIANBGGwiA2oiBisDACIMoSEOIAJBA20hByAVIBxqKwMAIQ8gAyAcaisDACEQQQAhFwNAAn8gECAjIBRBIGogFCAXaigCACIYQQJ0aigCAEEYbCIDaisDACIJYyAMIAMgH2oiAysDACIIYyAIIAxhGyAJIA9kIAggC2QgCCALYRtrIhxFBEBEAAAAAAAA+H8hCUQAAAAAAAD4fyEKQQAMAQsgBisDECEKIAYrAwghCQJAIAggDKEiDSAIIAuhIgggDZkgCJljIhUbIA6jIgi9Qv///////////wCDQv/////////3/wBWDQAgBCsDCCINIAmhIhG9Qv///////////wCDQoCAgICAgID4/wBaDQAgBCsDECISIAqhIhO9Qv///////////wCDQoCAgICAgID4/wBaDQAgCiASIBUbIAggE6KgIQogCSANIBUbIAggEaKgIQkLIBxBACAbKAKoASIVIAdBGGxqKwMIIBUgGygCaCACQQJ0aigCAEEDbUEYbGorAwigRAAAAAAAAAAAYyAJIAMrAwgiCGMgCCAJYRsbCyEVAkAgCb1C////////////AINC//////////f/AFYNACAVQQAgFWsgGBsgGWohGSABQQFKBEBBAiEBDAELIAFFIBVFIBZzRXJFBEBBASEBDAELIAFBGGwiGCAUQTBqaiIWIAMpAwAiJTcDACAWIAMpAxA3AxAgFiADKQMINwMIIBRB4ABqIBhqIgMgCTkDCCADIAo5AxAgAyAlNwMAIAFBAWohASAVQQBHIRYLIBdBBGoiF0EIRw0ACwJ/IBlFBEBEAAAAAAAA+H8hCEQAAAAAAAD4fyELRAAAAAAAAPh/IQpEAAAAAAAA+H8hCUEADAELIBQgFEHgAGogFEH4AGogFEEwaiAUQcgAahDOASAUKwMIIQsgFCsDACEIIBlBACAbKAKoASIBIAdBGGxqKwMQIAEgGygCaCACQQJ0aigCAEEDbUEYbGorAxCgIBooAqgBIgEgIkEYbGorAxAgASAaKAJoIAVBAnRqKAIAQQNtQRhsaisDEKBjIBQrAxAiCiAUKwMYIgljIAkgCmEbGwshASAAIAk5AyAgACAKOQMYIAAgCzkDECAAIAg5AwggACABNgIAIBRBkAFqJAALoAsDD38DfAN+IwBB0AFrIgUkAAJAIAAoAgQgAkEwbGoiCCsDACABKwMYZUUNACAIKwMIIAErAyBlRQ0AIAgrAxAgASsDKGVFDQAgCCsDGCABKwMAZkUNACAIKwMgIAErAwhmRQ0AIAgrAyggASsDEGZFDQACQCACQQFxDQAgACgCFCgCACEKIAVBoAFqQQBBMPwLACAFQfAAakEAQTD8CwAgCigCACIRKAJYIANBAnRqIgBBeEEEIANBA29BAkYbaigCACEQIAAoAgAhDCAKKAIEIQAgBUECNgIQIAVCgICAgBA3AgggACgCWCINIAJBAXUiDiACaiIPQQJ0aiESIAAoAmghEwNAQQEhAAJAIA0gBUEIaiAHaigCACIJIA9qIgtBAnQiCGooAgAiBiASQQRBCCAJQQFGG0EAIAkbQYzpAGooAgBBAnRqKAIAIgFIBEAgBiEIIAEhBgwBCyAIIBNqKAIAIQtBACEAIAEhCAsgBUFAayAJQQR0aiIBIAA6AAwgASAGNgIIIAEgCDYCBCABIAs2AgAgB0EEaiIHQQxHDQALIAUgEDYCOCAFIAw2AjQgCkEIaiENQQAhB0EAIQhBACEBQQAhAANAIAVBCGogDSAFQTRqIAFqKAIAIgsgDiAFQUBrEIwDAkAgBSsDECIUvUL///////////8Ag0L/////////9/8AVg0AIAUoAggiCUEAIAlrIAsgDEYbIABqIQAgB0EBSgRAQQIhBwwBCyAHRSAIIAlFc0EBcUVyRQRAQQEhBwwBCyAHQRhsIg8gBUGgAWpqIgYgESgCSCALQRhsaiIIKQMQIhg3AxAgBiAIKQMIIhc3AwggBiAIKQMAIhk3AwAgBiAXNwMQIAYgGDcDCCAFQfAAaiAPaiIGIBc3AxAgBiAZNwMAIAYgFDkDCCAHQQFqIQcgCUEARyEICyABQQRqIgFBCEcNAAsgBUECNgI8IAVCgICAgBA3AjQgCkEQaiEJQQAhBgNAIAVBCGogCSADIAwgECAFQUBrIAVBNGogBmooAgBBBHRqIgEoAgAgASgCBCABKAIIEPoEAkAgBSsDECIUvUL///////////8Ag0L/////////9/8AVg0AQQAgBSgCCCIKayAKIAEtAAwbIABqIQAgB0EBSgRAQQIhBwwBCyAHRSAIIApFc0EBcUVyRQRAQQEhBwwBCyAHQRhsIgggBUGgAWpqIgEgFDkDACABIAUrAyAiFTkDCCABIAUrAxgiFjkDECAFQfAAaiAIaiIBIBY5AxAgASAVOQMIIAEgFDkDACABIAUrAyg5AwggB0EBaiEHIApBAEchCAsgBkEEaiIGQQxHDQALAnwgAEUEQEQAAAAAAAD4fyEVRAAAAAAAAPh/IRZEAAAAAAAA+H8MAQsgBUEIaiAFQaABaiAFQbgBaiAFQfAAaiAFQYgBahDOASAFKwMQIRYgBSsDGCEVIAUrAwgLIhS9Qv///////////wCDQv/////////3/wBWDQACQCAEKAIEIgEgBCgCCCIGTwRAIAQgBkEBdEGAASAGGxBEIAQgBCgCBCIBQQFqNgIEDAELIAQgAUEBajYCBAsgBCgCACABQQN0aiADrSAOrUIghoQ3AgAgBEEQaiEDAkAgBCgCFCIBIAQoAhgiBk8EQCADIAZBAXRBgAEgBhsQJSAEKAIQIAQoAhQiAUECdGogADYCAAwBCyADKAIAIAFBAnRqIAA2AgALIAQgAUEBajYCFCAEQSBqIQACfyAEKAIkIgcgBCgCKCIBTwRAIAAgAUEBdEGAASABGxAzIAQoAiAgBCgCJCIHQRhsagwBCyAAKAIAIAdBGGxqCyIBIBQ5AwAgBCAHQQFqNgIkIAEgFjkDECABIBU5AwgLIAJBgYCAgHhxQQFGIQYLIAVB0AFqJAAgBgv4HgMOfwJ8AX4jAEHwAGsiCCQAA0AgAUE4ayEOIAFBuAFrIQ8gAUHAAWshDCABQfgAayEQIAFBgAFrIQ0gAUFAaiEKA0AgA0EBcSERAkADQAJAAkACQAJAAkACQCABIAAiBGtBBnUiBg4GBwcAAQIEAwsgAUE4aysDACAEKwMIY0UNBiAIQTBqIgIgBEHAAPwKAAAgBCABQUBqIgBBwAD8CgAAIAAgAkHAAPwKAAAMBgsgAUFAaiECIARBQGshACABQThrIgErAwAhEiAEKwNIIhMgBCsDCGNFBEAgEiATY0UNBiAIQTBqIgEgAEHAAPwKAAAgACACQcAA/AoAACACIAFBwAD8CgAAIAQrA0ggBCsDCGNFDQYgASAEQcAA/AoAACAEIABBwAD8CgAAIAAgAUHAAPwKAAAMBgsgEiATYwRAIAhBMGoiACAEQcAA/AoAACAEIAJBwAD8CgAAIAIgAEHAAPwKAAAMBgsgCEEwaiIDIARBwAD8CgAAIAQgAEHAAPwKAAAgACADQcAA/AoAACABKwMAIAQrA0hjRQ0FIAMgAEHAAPwKAAAgACACQcAA/AoAACACIANBwAD8CgAADAULIARBgAFqIQIgBEFAayEAIAQrA4gBIRICQCAEKwNIIhMgBCsDCGNFBEAgEiATY0UNASAIQTBqIgMgAEHAAPwKAAAgACACQcAA/AoAACACIANBwAD8CgAAIAQrA0ggBCsDCGNFDQEgAyAEQcAA/AoAACAEIABBwAD8CgAAIAAgA0HAAPwKAAAMAQsgEiATYwRAIAhBMGoiAyAEQcAA/AoAACAEIAJBwAD8CgAAIAIgA0HAAPwKAAAMAQsgCEEwaiIDIARBwAD8CgAAIAQgAEHAAPwKAAAgACADQcAA/AoAACASIAQrA0hjRQ0AIAMgAEHAAPwKAAAgACACQcAA/AoAACACIANBwAD8CgAACyABQThrKwMAIAQrA4gBY0UNBCAIQTBqIgMgAkHAAPwKAAAgAiABQUBqIgFBwAD8CgAAIAEgA0HAAPwKAAAgBCsDiAEgBCsDSGNFDQQgAyAAQcAA/AoAACAAIAJBwAD8CgAAIAIgA0HAAPwKAAAgBCsDSCAEKwMIY0UNBCADIARBwAD8CgAAIAQgAEHAAPwKAAAgACADQcAA/AoAAAwECyAGQRdMBEAgASAERiAEQUBrIgAgAUZyIQIgA0EBcQRAIAINBSAEIQUDQCAAIAUrA0giEiAFKwMIYwRAIAApAwAhFCAIQTBqIAVB0ABqQTD8CgAAIAAhBgNAAkAgBiAFIgBBwAD8CgAAIAAgBEYEQCAEIQAMAQsgAEFAaiEFIAAhBiASIABBOGsrAwBjDQELCyAAIBI5AwggACAUNwMAIABBEGogCEEwakEw/AoAAAsiBUFAayIAIAFHDQALDAULIAINBANAIAAgBCsDSCISIAQrAwhjBEAgACkDACEUIAhBMGogBEHQAGpBMPwKAAADQCAAIAQiAEHAAPwKAAAgAEFAaiEEIBIgAEE4aysDAGMNAAsgACASOQMIIAAgFDcDACAAQRBqIAhBMGpBMPwKAAALIgRBQGsiACABRw0ACwwECyACDQEgASAERg0DIAZBAmtBAXYiCSEAA0ACQCAJIAAiAkgNACAEIABBBnRqIQcgBCAAQQF0IgVBAXIiA0EGdGohAAJAAkAgBUECaiIFIAZODQAgACsDCCAAKwNIY0UNACAAQUBrIQAMAQsgAyEFCyAHKwMIIhIgACsDCGQNACAHKQMAIRQgCEEwaiAHQRBqQTD8CgAAA0ACQCAHIAAiB0HAAPwKAAAgBSAJSg0AIAQgBUEBdCIFQQFyIgNBBnRqIQACQAJAIAVBAmoiBSAGTg0AIAArAwggACsDSGNFDQAgAEFAayEADAELIAMhBQsgACsDCCASY0UNAQsLIAcgEjkDCCAHIBQ3AwAgB0EQaiAIQTBqQTD8CgAACyACQQFrIQAgAg0ACwNAIAhBMGogBEHAAPwKAAAgBiIDQQJrQQF2IQpBACEAIAQhBQNAIABBAXQiBkEBciECIAUiByAAQQZ0aiIJQUBrIQUCfyACIAMgBkECaiIGTA0AGiACIAkrA0ggCSsDiAFjRQ0AGiAJQYABaiEFIAYLIQAgByAFQcAA/AoAACAAIApMDQALAkAgAUFAaiIBIAVGBEAgBSAIQTBqQcAA/AoAAAwBCyAFIAFBwAD8CgAAIAEgCEEwakHAAPwKAAAgBSAEa0FAa0EGdSIAQQJIDQAgBSsDCCISIAQgAEECa0EBdiIAQQZ0aiIHKwMIZEUNACAFKQMAIRQgCCAFQRBqQTD8CgAAA0ACQCAFIAciAkHAAPwKAAAgAEUNACAHIQUgBCAAQQFrQQF2IgBBBnRqIgcrAwggEmMNAQsLIAIgEjkDCCACIBQ3AwAgAkEQaiAIQTD8CgAACyADQQFrIQYgA0ECSg0ACwwDCyAEIARBQGsgBEGAAWogBEHAAWogAUFAahDxBAwCCyAEIAZBBXRBQHFqIQAgDisDACESAkAgBkGBAU8EQAJAIAArAwgiEyAEKwMIY0UEQCASIBNjRQ0BIAhBMGoiBSAAQcAA/AoAACAAIApBwAD8CgAAIAogBUHAAPwKAAAgACsDCCAEKwMIY0UNASAFIARBwAD8CgAAIAQgAEHAAPwKAAAgACAFQcAA/AoAAAwBCyASIBNjBEAgCEEwaiIFIARBwAD8CgAAIAQgCkHAAPwKAAAgCiAFQcAA/AoAAAwBCyAIQTBqIgUgBEHAAPwKAAAgBCAAQcAA/AoAACAAIAVBwAD8CgAAIA4rAwAgACsDCGNFDQAgBSAAQcAA/AoAACAAIApBwAD8CgAAIAogBUHAAPwKAAALIABBQGohBSAEQUBrIQcgECsDACESAkAgAEE4ayIJKwMAIhMgBCsDSGNFBEAgEiATY0UNASAIQTBqIgYgBUHAAPwKAAAgBSANQcAA/AoAACANIAZBwAD8CgAAIAkrAwAgBCsDSGNFDQEgBiAHQcAA/AoAACAHIAVBwAD8CgAAIAUgBkHAAPwKAAAMAQsgEiATYwRAIAhBMGoiBiAHQcAA/AoAACAHIA1BwAD8CgAAIA0gBkHAAPwKAAAMAQsgCEEwaiIGIAdBwAD8CgAAIAcgBUHAAPwKAAAgBSAGQcAA/AoAACAQKwMAIAkrAwBjRQ0AIAYgBUHAAPwKAAAgBSANQcAA/AoAACANIAZBwAD8CgAACyAAQUBrIQcgBEGAAWohBiAPKwMAIRICQCAAKwNIIhMgBCsDiAFjRQRAIBIgE2NFDQEgCEEwaiILIAdBwAD8CgAAIAcgDEHAAPwKAAAgDCALQcAA/AoAACAAKwNIIAQrA4gBY0UNASALIAZBwAD8CgAAIAYgB0HAAPwKAAAgByALQcAA/AoAAAwBCyASIBNjBEAgCEEwaiILIAZBwAD8CgAAIAYgDEHAAPwKAAAgDCALQcAA/AoAAAwBCyAIQTBqIgsgBkHAAPwKAAAgBiAHQcAA/AoAACAHIAtBwAD8CgAAIA8rAwAgACsDSGNFDQAgCyAHQcAA/AoAACAHIAxBwAD8CgAAIAwgC0HAAPwKAAALIAArA0ghEgJAIAArAwgiEyAJKwMAY0UEQCASIBNjRQ0BIAhBMGoiBiAAQcAA/AoAACAAIAdBwAD8CgAAIAcgBkHAAPwKAAAgACsDCCAJKwMAY0UNASAGIAVBwAD8CgAAIAUgAEHAAPwKAAAgACAGQcAA/AoAAAwBCyASIBNjBEAgCEEwaiIGIAVBwAD8CgAAIAUgB0HAAPwKAAAgByAGQcAA/AoAAAwBCyAIQTBqIgYgBUHAAPwKAAAgBSAAQcAA/AoAACAAIAZBwAD8CgAAIAArA0ggACsDCGNFDQAgBiAAQcAA/AoAACAAIAdBwAD8CgAAIAcgBkHAAPwKAAALIAhBMGoiBSAEQcAA/AoAACAEIABBwAD8CgAAIAAgBUHAAPwKAAAMAQsgBCsDCCITIAArAwhjRQRAIBIgE2NFDQEgCEEwaiIFIARBwAD8CgAAIAQgCkHAAPwKAAAgCiAFQcAA/AoAACAEKwMIIAArAwhjRQ0BIAUgAEHAAPwKAAAgACAEQcAA/AoAACAEIAVBwAD8CgAADAELIBIgE2MEQCAIQTBqIgUgAEHAAPwKAAAgACAKQcAA/AoAACAKIAVBwAD8CgAADAELIAhBMGoiBSAAQcAA/AoAACAAIARBwAD8CgAAIAQgBUHAAPwKAAAgDisDACAEKwMIY0UNACAFIARBwAD8CgAAIAQgCkHAAPwKAAAgCiAFQcAA/AoAAAsgAkEBayECAkAgEQRAIAQrAwghEgwBCyAEKwMIIhIgBEE4aysDAGQNACAEKQMAIRQgCCAEQRBqQTD8CgAAIAQiACEFAkAgDisDACASZARAA0AgACIDQUBrIQAgEiADKwNIY0UNAAwCCwALA0AgBUFAayIAIAFPDQEgBSsDSCETIAAhBSASIBNjRQ0ACwsgASIFIABLBEADQCAFQThrIQMgBUFAaiEFIBIgAysDAGMNAAsLIAAgBUkEQANAIAhBMGoiAyAAQcAA/AoAACAAIAVBwAD8CgAAIAUgA0HAAPwKAAADQCAAIgNBQGshACASIAMrA0hjRQ0ACwNAIAUiA0FAaiEFIBIgA0E4aysDAGMNAAsgACAFSQ0ACwsgAEFAaiIDIARHBEAgBCADQcAA/AoAAAsgAyAUNwMAIABBOGsgEjkDACAAQTBrIAhBMPwKAABBACEDDAMLIAQpAwAhFCAIIARBEGpBMPwKAAAgBCEHA0AgByIAQUBrIQcgACsDSCASYw0ACyABIgUhBgJAIAAgBEYEQANAIAUgB00EQCAFIQYMAwsgBUE4ayAFQUBqIgYhBSsDACASY0UNAAwCCwALA0AgBiIAQUBqIQYgAEE4aysDACASY0UNAAsLIAciACAGIgVJBEADQCAIQTBqIgkgAEHAAPwKAAAgACAFQcAA/AoAACAFIAlBwAD8CgAAA0AgACIJQUBrIQAgCSsDSCASYw0ACwNAIAUiCUFAaiEFIAlBOGsrAwAgEmNFDQALIAAgBUkNAAsLIABBQGoiBSAERwRAIAQgBUHAAPwKAAALIAUgFDcDACAAQThrIBI5AwAgAEEwayAIQTD8CgAAIAYgB00EQCAEIAUQ8AQhByAAIAEQ8AQEQCAFIQEgBCEAIAdFDQUMAwsgBw0BCwsgBCAFIAIgERD8BEEAIQMMAQsLCyAIQfAAaiQAC5AIAhZ/AnwjAEHAAmsiAiQAIAAoAgAiBCgCACgCSCABQQJ0IhUgBCgCBCgCAGooAgBBGGxqIgErAwghGCABKwMAIRkgACgCBCEWIAAoAgwhFyAAKAIUKAIAIQhBASEAQX8hCQNAIBcgAEEBa0ECbUEDdGoiACgCBCEFQQAhBgJ/QQAgGSAWIAAoAgAiCkEwbGoiACsDGGVFDQAaQQAgGSAAKwMAZkUNABpBACAYIAArAyBlRQ0AGkEAIBggACsDCGZFDQAaAkAgCkEBcQ0AIAgoAgQoAgAgFWooAgAhCyAIKAIAIg4oAgQhACACQQI2AogCIAJCgICAgBA3AoACIAAoAlgiDyAKQQF1IhAgCmoiEUECdGohEiAAKAJoIRNBACEBA0BBASEMAkAgDyACQYACaiABaigCACIHIBFqIg1BAnQiBGooAgAiACASQQRBCCAHQQFGG0EAIAcbQYzpAGooAgBBAnRqKAIAIgNIBEAgACEEIAMhAAwBCyAEIBNqKAIAIQ1BACEMIAMhBAsgAkGQAmoiFCAHQQR0aiIDIAw6AAwgAyAANgIIIAMgBDYCBCADIA02AgAgAUEEaiIBQQxHDQALIAJBgAJqIA4gCyAQIBQQiAMgAikDiAJC////////////AINC//////////f/AFYNACAIKAIIKAIAIAtBAnRqIgAgACgCACACKAKAAms2AgALIApBgYCAgHhxQQFGCyEHAkAgGSAWIAVBMGxqIgArAxhlRQ0AIBkgACsDAGZFDQAgGCAAKwMgZUUNACAYIAArAwhmRQ0AAkAgBUEBcQ0AIAgoAgQoAgAgFWooAgAhCyAIKAIAIg4oAgQhACACQQI2AogCIAJCgICAgBA3AoACIAAoAlgiDyAFQQF1IhAgBWoiEUECdGohEiAAKAJoIRNBACEBA0BBASEMAkAgDyACQYACaiABaigCACIGIBFqIg1BAnQiBGooAgAiACASQQRBCCAGQQFGG0EAIAYbQYzpAGooAgBBAnRqKAIAIgNIBEAgACEEIAMhAAwBCyAEIBNqKAIAIQ1BACEMIAMhBAsgAkGQAmoiFCAGQQR0aiIDIAw6AAwgAyAANgIIIAMgBDYCBCADIA02AgAgAUEEaiIBQQxHDQALIAJBgAJqIA4gCyAQIBQQiAMgAikDiAJC////////////AINC//////////f/AFYNACAIKAIIKAIAIAtBAnRqIgAgACgCACACKAKAAms2AgALIAVBgYCAgHhxQQFGIQYLAkAgBiAHckUEQCAJQQBIDQEgAiAJQQJ0aigCACEAIAlBAWshCQwCCyAKIAUgBxshACAHRSAGRXINASACIAlBAWoiCUECdGogBTYCAAwBCwsgAkHAAmokAAuQCAIWfwJ8IwBBwAJrIgIkACAAKAIAIgQoAgAoAkggAUECdCIVIAQoAgQoAgBqKAIAQRhsaiIBKwMIIRggASsDACEZIAAoAgQhFiAAKAIMIRcgACgCFCgCACEIQQEhAEF/IQkDQCAXIABBAWtBAm1BA3RqIgAoAgQhBUEAIQYCf0EAIBkgFiAAKAIAIgpBMGxqIgArAxhlRQ0AGkEAIBkgACsDAGZFDQAaQQAgGCAAKwMgZUUNABpBACAYIAArAwhmRQ0AGgJAIApBAXENACAIKAIEKAIAIBVqKAIAIQsgCCgCACIOKAIEIQAgAkECNgKIAiACQoCAgIAQNwKAAiAAKAJYIg8gCkEBdSIQIApqIhFBAnRqIRIgACgCaCETQQAhAQNAQQEhDAJAIA8gAkGAAmogAWooAgAiByARaiINQQJ0IgRqKAIAIgAgEkEEQQggB0EBRhtBACAHG0GM6QBqKAIAQQJ0aigCACIDSARAIAAhBCADIQAMAQsgBCATaigCACENQQAhDCADIQQLIAJBkAJqIhQgB0EEdGoiAyAMOgAMIAMgADYCCCADIAQ2AgQgAyANNgIAIAFBBGoiAUEMRw0ACyACQYACaiAOIAsgECAUEIYDIAIpA4gCQv///////////wCDQv/////////3/wBWDQAgCCgCCCgCACALQQJ0aiIAIAAoAgAgAigCgAJrNgIACyAKQYGAgIB4cUEBRgshBwJAIBkgFiAFQTBsaiIAKwMYZUUNACAZIAArAwBmRQ0AIBggACsDIGVFDQAgGCAAKwMIZkUNAAJAIAVBAXENACAIKAIEKAIAIBVqKAIAIQsgCCgCACIOKAIEIQAgAkECNgKIAiACQoCAgIAQNwKAAiAAKAJYIg8gBUEBdSIQIAVqIhFBAnRqIRIgACgCaCETQQAhAQNAQQEhDAJAIA8gAkGAAmogAWooAgAiBiARaiINQQJ0IgRqKAIAIgAgEkEEQQggBkEBRhtBACAGG0GM6QBqKAIAQQJ0aigCACIDSARAIAAhBCADIQAMAQsgBCATaigCACENQQAhDCADIQQLIAJBkAJqIhQgBkEEdGoiAyAMOgAMIAMgADYCCCADIAQ2AgQgAyANNgIAIAFBBGoiAUEMRw0ACyACQYACaiAOIAsgECAUEIYDIAIpA4gCQv///////////wCDQv/////////3/wBWDQAgCCgCCCgCACALQQJ0aiIAIAAoAgAgAigCgAJrNgIACyAFQYGAgIB4cUEBRiEGCwJAIAYgB3JFBEAgCUEASA0BIAIgCUECdGooAgAhACAJQQFrIQkMAgsgCiAFIAcbIQAgB0UgBkVyDQEgAiAJQQFqIglBAnRqIAU2AgAMAQsLIAJBwAJqJAALkAgCFn8CfCMAQcACayICJAAgACgCACIEKAIAKAJIIAFBAnQiFSAEKAIEKAIAaigCAEEYbGoiASsDCCEYIAErAwAhGSAAKAIEIRYgACgCDCEXIAAoAhQoAgAhCEEBIQBBfyEJA0AgFyAAQQFrQQJtQQN0aiIAKAIEIQVBACEGAn9BACAZIBYgACgCACIKQTBsaiIAKwMYZUUNABpBACAZIAArAwBmRQ0AGkEAIBggACsDIGVFDQAaQQAgGCAAKwMIZkUNABoCQCAKQQFxDQAgCCgCBCgCACAVaigCACELIAgoAgAiDigCBCEAIAJBAjYCiAIgAkKAgICAEDcCgAIgACgCWCIPIApBAXUiECAKaiIRQQJ0aiESIAAoAmghE0EAIQEDQEEBIQwCQCAPIAJBgAJqIAFqKAIAIgcgEWoiDUECdCIEaigCACIAIBJBBEEIIAdBAUYbQQAgBxtBjOkAaigCAEECdGooAgAiA0gEQCAAIQQgAyEADAELIAQgE2ooAgAhDUEAIQwgAyEECyACQZACaiIUIAdBBHRqIgMgDDoADCADIAA2AgggAyAENgIEIAMgDTYCACABQQRqIgFBDEcNAAsgAkGAAmogDiALIBAgFBCMAyACKQOIAkL///////////8Ag0L/////////9/8AVg0AIAgoAggoAgAgC0ECdGoiACAAKAIAIAIoAoACajYCAAsgCkGBgICAeHFBAUYLIQcCQCAZIBYgBUEwbGoiACsDGGVFDQAgGSAAKwMAZkUNACAYIAArAyBlRQ0AIBggACsDCGZFDQACQCAFQQFxDQAgCCgCBCgCACAVaigCACELIAgoAgAiDigCBCEAIAJBAjYCiAIgAkKAgICAEDcCgAIgACgCWCIPIAVBAXUiECAFaiIRQQJ0aiESIAAoAmghE0EAIQEDQEEBIQwCQCAPIAJBgAJqIAFqKAIAIgYgEWoiDUECdCIEaigCACIAIBJBBEEIIAZBAUYbQQAgBhtBjOkAaigCAEECdGooAgAiA0gEQCAAIQQgAyEADAELIAQgE2ooAgAhDUEAIQwgAyEECyACQZACaiIUIAZBBHRqIgMgDDoADCADIAA2AgggAyAENgIEIAMgDTYCACABQQRqIgFBDEcNAAsgAkGAAmogDiALIBAgFBCMAyACKQOIAkL///////////8Ag0L/////////9/8AVg0AIAgoAggoAgAgC0ECdGoiACAAKAIAIAIoAoACajYCAAsgBUGBgICAeHFBAUYhBgsCQCAGIAdyRQRAIAlBAEgNASACIAlBAnRqKAIAIQAgCUEBayEJDAILIAogBSAHGyEAIAdFIAZFcg0BIAIgCUEBaiIJQQJ0aiAFNgIADAELCyACQcACaiQAC5AIAhZ/AnwjAEHAAmsiAiQAIAAoAgAiBCgCACgCSCABQQJ0IhUgBCgCBCgCAGooAgBBGGxqIgErAwghGCABKwMAIRkgACgCBCEWIAAoAgwhFyAAKAIUKAIAIQhBASEAQX8hCQNAIBcgAEEBa0ECbUEDdGoiACgCBCEFQQAhBgJ/QQAgGSAWIAAoAgAiCkEwbGoiACsDGGVFDQAaQQAgGSAAKwMAZkUNABpBACAYIAArAyBlRQ0AGkEAIBggACsDCGZFDQAaAkAgCkEBcQ0AIAgoAgQoAgAgFWooAgAhCyAIKAIAIg4oAgQhACACQQI2AogCIAJCgICAgBA3AoACIAAoAlgiDyAKQQF1IhAgCmoiEUECdGohEiAAKAJoIRNBACEBA0BBASEMAkAgDyACQYACaiABaigCACIHIBFqIg1BAnQiBGooAgAiACASQQRBCCAHQQFGG0EAIAcbQYzpAGooAgBBAnRqKAIAIgNIBEAgACEEIAMhAAwBCyAEIBNqKAIAIQ1BACEMIAMhBAsgAkGQAmoiFCAHQQR0aiIDIAw6AAwgAyAANgIIIAMgBDYCBCADIA02AgAgAUEEaiIBQQxHDQALIAJBgAJqIA4gCyAQIBQQigMgAikDiAJC////////////AINC//////////f/AFYNACAIKAIIKAIAIAtBAnRqIgAgACgCACACKAKAAmo2AgALIApBgYCAgHhxQQFGCyEHAkAgGSAWIAVBMGxqIgArAxhlRQ0AIBkgACsDAGZFDQAgGCAAKwMgZUUNACAYIAArAwhmRQ0AAkAgBUEBcQ0AIAgoAgQoAgAgFWooAgAhCyAIKAIAIg4oAgQhACACQQI2AogCIAJCgICAgBA3AoACIAAoAlgiDyAFQQF1IhAgBWoiEUECdGohEiAAKAJoIRNBACEBA0BBASEMAkAgDyACQYACaiABaigCACIGIBFqIg1BAnQiBGooAgAiACASQQRBCCAGQQFGG0EAIAYbQYzpAGooAgBBAnRqKAIAIgNIBEAgACEEIAMhAAwBCyAEIBNqKAIAIQ1BACEMIAMhBAsgAkGQAmoiFCAGQQR0aiIDIAw6AAwgAyAANgIIIAMgBDYCBCADIA02AgAgAUEEaiIBQQxHDQALIAJBgAJqIA4gCyAQIBQQigMgAikDiAJC////////////AINC//////////f/AFYNACAIKAIIKAIAIAtBAnRqIgAgACgCACACKAKAAmo2AgALIAVBgYCAgHhxQQFGIQYLAkAgBiAHckUEQCAJQQBIDQEgAiAJQQJ0aigCACEAIAlBAWshCQwCCyAKIAUgBxshACAHRSAGRXINASACIAlBAWoiCUECdGogBTYCAAwBCwsgAkHAAmokAAtUAQF/IAAgAUcEQCAAKAIAIgIEQCACECILIABBADYCCCAAQgA3AgAgACABKAIANgIAIAAgASgCBDYCBCAAIAEoAgg2AgggAUEANgIIIAFCADcCAAsL8wMCB38JfCMAQcADayICJAACQCAAKAIAKAIAIgQoAlggAUECdGoiAygCACIGIANBeEEEIAFBA29BAkYbaigCACIDTg0AIAQoAkgiBSAGQRhsaiIEKwMAIgkgBSADQRhsaiIDKwMAIgogCSAKYyIGGyIMRAAAAAAAAPB/YQ0AIAMrAxAiCyAEKwMQIg0gCyANZCIFGyEOIAMrAwgiDyAEKwMIIhAgDyAQZCIEGyERIAogCSAGGyEJIA0gCyAFGyEKIBAgDyAEGyELIAAoAhRBBGohB0EBIQNBfyEEA0AgACgCDCADQQFrQQJtQQN0aiIDKAIEIQYgAygCACEDIAIgDjkDuAEgAiAROQOwASACIAk5A6gBIAIgCjkDoAEgAiALOQOYASACIAw5A5ABIAJBMGoiBSACQZABakEw/AoAACAAIAUgAyABIAcQ8wQhBSACIA45A4gBIAIgETkDgAEgAiAJOQN4IAIgCjkDcCACIAs5A2ggAiAMOQNgIAIgAkHgAGpBMPwKAAAgBSAAIAIgBiABIAcQ8wQiCHJFBEAgBEEASA0CIAJBwAFqIARBAnRqKAIAIQMgBEEBayEEDAELIAMgBiAFGyEDIAVFIAhFcg0AIAJBwAFqIARBAWoiBEECdGogBjYCAAwACwALIAJBwANqJAAL8wMCB38JfCMAQcADayICJAACQCAAKAIAKAIAIgQoAlggAUECdGoiAygCACIGIANBeEEEIAFBA29BAkYbaigCACIDTg0AIAQoAkgiBSAGQRhsaiIEKwMAIgkgBSADQRhsaiIDKwMAIgogCSAKYyIGGyIMRAAAAAAAAPB/YQ0AIAMrAxAiCyAEKwMQIg0gCyANZCIFGyEOIAMrAwgiDyAEKwMIIhAgDyAQZCIEGyERIAogCSAGGyEJIA0gCyAFGyEKIBAgDyAEGyELIAAoAhRBBGohB0EBIQNBfyEEA0AgACgCDCADQQFrQQJtQQN0aiIDKAIEIQYgAygCACEDIAIgDjkDuAEgAiAROQOwASACIAk5A6gBIAIgCjkDoAEgAiALOQOYASACIAw5A5ABIAJBMGoiBSACQZABakEw/AoAACAAIAUgAyABIAcQ9QQhBSACIA45A4gBIAIgETkDgAEgAiAJOQN4IAIgCjkDcCACIAs5A2ggAiAMOQNgIAIgAkHgAGpBMPwKAAAgBSAAIAIgBiABIAcQ9QQiCHJFBEAgBEEASA0CIAJBwAFqIARBAnRqKAIAIQMgBEEBayEEDAELIAMgBiAFGyEDIAVFIAhFcg0AIAJBwAFqIARBAWoiBEECdGogBjYCAAwACwALIAJBwANqJAAL8wMCB38JfCMAQcADayICJAACQCAAKAIAKAIAIgQoAlggAUECdGoiAygCACIGIANBeEEEIAFBA29BAkYbaigCACIDTg0AIAQoAkgiBSAGQRhsaiIEKwMAIgkgBSADQRhsaiIDKwMAIgogCSAKYyIGGyIMRAAAAAAAAPB/YQ0AIAMrAxAiCyAEKwMQIg0gCyANZCIFGyEOIAMrAwgiDyAEKwMIIhAgDyAQZCIEGyERIAogCSAGGyEJIA0gCyAFGyEKIBAgDyAEGyELIAAoAhRBBGohB0EBIQNBfyEEA0AgACgCDCADQQFrQQJtQQN0aiIDKAIEIQYgAygCACEDIAIgDjkDuAEgAiAROQOwASACIAk5A6gBIAIgCjkDoAEgAiALOQOYASACIAw5A5ABIAJBMGoiBSACQZABakEw/AoAACAAIAUgAyABIAcQ+AQhBSACIA45A4gBIAIgETkDgAEgAiAJOQN4IAIgCjkDcCACIAs5A2ggAiAMOQNgIAIgAkHgAGpBMPwKAAAgBSAAIAIgBiABIAcQ+AQiCHJFBEAgBEEASA0CIAJBwAFqIARBAnRqKAIAIQMgBEEBayEEDAELIAMgBiAFGyEDIAVFIAhFcg0AIAJBwAFqIARBAWoiBEECdGogBjYCAAwACwALIAJBwANqJAAL8wMCB38JfCMAQcADayICJAACQCAAKAIAKAIAIgQoAlggAUECdGoiAygCACIGIANBeEEEIAFBA29BAkYbaigCACIDTg0AIAQoAkgiBSAGQRhsaiIEKwMAIgkgBSADQRhsaiIDKwMAIgogCSAKYyIGGyIMRAAAAAAAAPB/YQ0AIAMrAxAiCyAEKwMQIg0gCyANZCIFGyEOIAMrAwgiDyAEKwMIIhAgDyAQZCIEGyERIAogCSAGGyEJIA0gCyAFGyEKIBAgDyAEGyELIAAoAhRBBGohB0EBIQNBfyEEA0AgACgCDCADQQFrQQJtQQN0aiIDKAIEIQYgAygCACEDIAIgDjkDuAEgAiAROQOwASACIAk5A6gBIAIgCjkDoAEgAiALOQOYASACIAw5A5ABIAJBMGoiBSACQZABakEw/AoAACAAIAUgAyABIAcQ+wQhBSACIA45A4gBIAIgETkDgAEgAiAJOQN4IAIgCjkDcCACIAs5A2ggAiAMOQNgIAIgAkHgAGpBMPwKAAAgBSAAIAIgBiABIAcQ+wQiCHJFBEAgBEEASA0CIAJBwAFqIARBAnRqKAIAIQMgBEEBayEEDAELIAMgBiAFGyEDIAVFIAhFcg0AIAJBwAFqIARBAWoiBEECdGogBjYCAAwACwALIAJBwANqJAALWgEDfyAAQQA2AgggAEIANwIAIAEoAgQiAiABKAIAIgFHBEAgACACIAFrIgJBGG0Q8gEgACgCBCEDIAJBBGsiBARAIAMgASAE/AoAAAsgACACIANqNgIECyAACwoAIAAoAgRBAWsLLgEBfyAAKAIEIQIgACABEDMgACABNgIEIAJBEUkgAiABQQF0TXJFBEAgABBxCwsKACAAQRBqEDoaC8gIAwR8A38BfiMAQRBrIggkAAJAAkACQCAAvSIJQiCIpyIGQf////8HcSIHQfrUvYAETQRAIAZB//8/cUH7wyRGDQEgB0H8souABE0EQCAJQgBZBEAgASAARAAAQFT7Ifm/oCIARDFjYhphtNC9oCICOQMAIAEgACACoUQxY2IaYbTQvaA5AwhBASEGDAULIAEgAEQAAEBU+yH5P6AiAEQxY2IaYbTQPaAiAjkDACABIAAgAqFEMWNiGmG00D2gOQMIQX8hBgwECyAJQgBZBEAgASAARAAAQFT7IQnAoCIARDFjYhphtOC9oCICOQMAIAEgACACoUQxY2IaYbTgvaA5AwhBAiEGDAQLIAEgAEQAAEBU+yEJQKAiAEQxY2IaYbTgPaAiAjkDACABIAAgAqFEMWNiGmG04D2gOQMIQX4hBgwDCyAHQbuM8YAETQRAIAdBvPvXgARNBEAgB0H8ssuABEYNAiAJQgBZBEAgASAARAAAMH982RLAoCIARMqUk6eRDum9oCICOQMAIAEgACACoUTKlJOnkQ7pvaA5AwhBAyEGDAULIAEgAEQAADB/fNkSQKAiAETKlJOnkQ7pPaAiAjkDACABIAAgAqFEypSTp5EO6T2gOQMIQX0hBgwECyAHQfvD5IAERg0BIAlCAFkEQCABIABEAABAVPshGcCgIgBEMWNiGmG08L2gIgI5AwAgASAAIAKhRDFjYhphtPC9oDkDCEEEIQYMBAsgASAARAAAQFT7IRlAoCIARDFjYhphtPA9oCICOQMAIAEgACACoUQxY2IaYbTwPaA5AwhBfCEGDAMLIAdB+sPkiQRLDQELIABEg8jJbTBf5D+iRAAAAAAAADhDoEQAAAAAAAA4w6AiA/wCIQYCQCAAIANEAABAVPsh+b+ioCICIANEMWNiGmG00D2iIgShIgVEGC1EVPsh6b9jBEAgBkEBayEGIANEAAAAAAAA8L+gIgNEMWNiGmG00D2iIQQgACADRAAAQFT7Ifm/oqAhAgwBCyAFRBgtRFT7Iek/ZEUNACAGQQFqIQYgA0QAAAAAAADwP6AiA0QxY2IaYbTQPaIhBCAAIANEAABAVPsh+b+ioCECCyABIAIgBKEiADkDACAHQRR2IgcgAL1CNIinQf8PcWtBEU4EQAJAIAcgAiADRAAAYBphtNA9oiIAoSIFIANEc3ADLooZozuiIAIgBaEgAKGhIgShIgC9QjSIp0H/D3FrQTJIBEAgBSECDAELIAUgA0QAAAAuihmjO6IiAKEiAiADRMFJICWag3s5oiAFIAKhIAChoSIEoSEACyABIAA5AwALIAEgAiAAoSAEoTkDCAwBCyAHQYCAwP8HTwRAIAEgACAAoSIAOQMAIAEgADkDCEEAIQYMAQsgAEQYLURU+yH5PyAIQQxqEKUDIQAgAUIANwMIIAEgADkDACAIKAIMIQYLIAhBEGokACAGC48EAgZ/An0gAigCACEGIAACfwJAIAEoAgQiBEUNACABKAIAAn8gBEEBayAGcSAEaSIFQQFNDQAaIAYgBCAGSw0AGiAGIARwCyIHQQJ0aigCACICRQ0AIAIoAgAiAkUNACAEQQFrIQggBUEBSyEJA0ACQCAGIAIoAgQiBUcEQAJAIAlFBEAgBSAIcSEFDAELIAQgBUsNACAFIARwIQULIAUgB0cNAwwBCyACKAIIIAZHDQBBAAwDCyACKAIAIgINAAsLQRAQIyICIAY2AgQgAkEANgIAIAIgAygCADYCCCACIAMoAgQ2AgwCQEEAIAQgASgCDEEBarMiCiABKgIQIgsgBLOUXhsNACABIAQgBEEBa3FBAEcgBEEDSXIgBEEBdHIiAyAKIAuVjfwBIgcgAyAHSxsQcCABKAIEIgQgBEEBayIDcUUEQCADIAZxIQcMAQsgBCAGSwRAIAYhBwwBCyAGIARwIQcLAkAgASgCACIGIAdBAnRqIgcoAgAiA0UEQCACIAEoAgg2AgAgASACNgIIIAcgAUEIajYCACACKAIAIgNFDQEgAygCBCEFAkAgBCAEQQFrIgNxRQRAIAMgBXEhBQwBCyAEIAVLDQAgBSAEcCEFCyAGIAVBAnRqIAI2AgAMAQsgAiADKAIANgIAIAMgAjYCAAsgASABKAIMQQFqNgIMQQELOgAEIAAgAjYCAAuRAgEFfyMAQTBrIgIkACABIAAoAgQgACgCAGtBA3UQfSACQgA3AxggAkIANwMQIAJBgICA/AM2AiAgACgCBCAAKAIARgR/QQAFA0AgAiAAIAUQTyIDNgIMAkAgACgCACADQQN0aigCBEH/////B3FFBEAgAigCHCAEaiEDIARBAWohBAwBCyACQRBqIgYgAkEMahCiAiIDRQRAIAIgAigCHCAEaiIDNgIIIAIgAigCDDYCBCACQShqIAYgAkEEaiIGIAYQiwUMAQsgAygCDCEDCyABKAIAIAVBAnRqIAM2AgAgBUEBaiIFIAAoAgQgACgCAGtBA3VJDQALIAIoAhwgBGoLIAJBEGoQlQEgAkEwaiQAC6UBAQN/IwBBEGsiAiQAAkAgACgCBCIDIAAoAggiBE8EQCACIAEoAgg2AgggAiABKQIANwMAIAAgBEEBdEGAASAEGxA1IAAgACgCBCIBQQFqNgIEIAAoAgAgAUEMbGoiACACKAIINgIIIAAgAikDADcCAAwBCyAAIANBAWo2AgQgACgCACADQQxsaiIAIAEoAgg2AgggACABKQIANwIACyACQRBqJAALpAIBBX8jAEEgayIFJAACQAJAIAAoAgQiAiAAKAIIIgNJBEAgAiABEIYFQQxqIQEMAQsgAiAAKAIAIgRrQQxtIgZBAWoiAkHWqtWqAU8NASAFQQxqQdWq1aoBIAMgBGtBDG0iA0EBdCIEIAIgAiAESRsgA0Gq1arVAE8bIAYgABBhIgIoAgggARCGBRogAiACKAIIQQxqNgIIIAIoAgQgACgCBCAAKAIAIgNrIgFBdG1BDGxqIQQgAQRAIAQgAyAB/AoAAAsgACgCACEDIAAgBDYCACACIAM2AgQgACACKAIIIgE2AgQgAiADNgIIIAAoAgghBCAAIAIoAgw2AgggAiADNgIAIAIgBDYCDCACENUBCyAAIAE2AgQgBUEgaiQADwsQJgAL1hACF38LfCMAQdAAayIGJAACQAJAIAJEAAAAAAAAAABlRQRAIAEoAgQgASgCAEcNAQsgABDqAQwBCyAFRAAAAAAAAAAAIAUrAwAiHSAdRAAAAAAAAAAAYxsiJDkDACAFRAAAAAAAAAAAIAUrAwgiHSAdRAAAAAAAAAAAYxsiJTkDCEGoAhAjIghBoJACNgIAIAhCADcCBCAIQRBqEDshECAGQQA2AkggBkIANwJAIAZBADYCPCAGQgA3AjQgCEHYAGohDSABKAIAIgogASgCBCIRRwRAA0AgCigCACEFIAooAgQhDCAGQQA2AjAgBkIANwIoIAwgBWsgBSAMRwRAA0AgBSsDCCEdIAUrAwAhHgJ/IAgoAlwiCSAIKAJgIgtPBEAgDSALQQF0QYABIAsbEDMgCCgCWCAIKAJcIglBGGxqDAELIA0oAgAgCUEYbGoLIgsgHjkDACALQgA3AxAgCyAdOQMIIAggCUEBajYCXCAGIAUpAwg3AxggBiAFKQMANwMQIAYgBzYCICAHQQFqIQcgBkEoaiAGQRBqEMQBIAVBEGoiBSAMRw0ACwsgBkE0aiAGQShqEI4FIAYoAigiBQRAIAYgBTYCLCAGKAIwGiAFECILQQR1IA5qIQ4gCkEMaiIKIBFHDQALCyAkRAAAAAAAAAAAYSAlRAAAAAAAAAAAYXEhEyADQQFqIREgA0EATgRAIBG3ISZBASELA0AgBCALuCAmoyIdoiIeRAAAAAAAgFZAoCIfED4hISAeED4hIiAeED4hHiAfED4hHyABKAIAIgogASgCBCIZRwRAICFEAAAAAAAAAACiRAAAAAAAAPA/IB2hIiAgJSAdoqAiIyAioqAhJyAgICQgHaKgIiAgIaIgIkQAAAAAAAAAAKKgISEgIyAfoiAeRAAAAAAAAAAAoqEhIiAfRAAAAAAAAAAAoiAgIB6ioSEeIAIgHaIhHSALIA5sIRYgCyARRiATcSEaQQAhFEEAIRUDQEEAIQcgCigCBCIDIAooAgAiCUcEQCAUIBZqIRcgFSAWaiIbQQFrIRwgAyAJa0EEdSEHQQAhBQNAIAUgG2ohDyAcIAUgByAFG2ohEgJAIBoEQCAPIA5rIQkgBigCRCIDIAYoAkgiB08EQCAGQUBrIAdBAXRBgAEgBxsQNSAGIAYoAkQiA0EBajYCRCAGKAJAIANBDGxqIgcgFzYCAAwCCyAGIANBAWo2AkQgBigCQCADQQxsaiIHIBc2AgAMAQsgJyAJIAVBBHRqIgMrAwAiH6IgIiADKwMIIiCioCEjICEgH6IgHiAgoqAhHwJ/IAgoAlwiAyAIKAJgIgdPBEAgDSAHQQF0QYABIAcbEDMgCCgCWCAIKAJcIgNBGGxqDAELIA0oAgAgA0EYbGoLIgcgHzkDACAHIB05AxAgByAjOQMIIAggA0EBajYCXCAPIA5rIQkCQCAGKAJEIgwgBigCSCIDTwRAIAZBQGsgA0EBdEGAASADGxA1IAYoAkAiByAGKAJEIgxBDGxqIgMgCTYCCCADIBI2AgQgAyAPNgIAIAYoAkghAwwBCyAGKAJAIgcgDEEMbGoiGCAJNgIIIBggEjYCBCAYIA82AgALIAYgDEEBaiIPNgJEAn8gAyAPTQRAIAZBQGsgA0EBdEGAASADGxA1IAYgBigCRCIDQQFqNgJEIAYoAkAgA0EMbGoMAQsgBiAMQQJqNgJEIAcgD0EMbGoLIgcgEjYCAAsgByAJNgIIIAcgEiAOazYCBCAFQQFqIgUgCigCBCAKKAIAIglrQQR1IgdJDQALCyAHIBVqIRUgFEEBaiEUIApBDGoiCiAZRw0ACwsgCyARRiALQQFqIQtFDQALCwJAIBNFDQAgASgCBCIJIAEoAgAiA0YNACAIKAJcIQVBACEHA0ACQCAIKAJgIgogBU0EQCANIApBAXRBgAEgChsQMyAIKAJYIAgoAlwiBUEYbGoiA0IANwMIIANCADcDACADIAI5AxAgASgCACEDIAEoAgQhCQwBCyANKAIAIAVBGGxqIgpCADcDCCAKQgA3AwAgCiACOQMQCyAIIAVBAWoiBTYCXCAHQQFqIgcgCSADa0EMbUkNAAsLIAZBKGogBkE0akQAAAAAAADwv0EBEIgEIAYoAigiBSAGKAIsIgpHBEAgDiARbCEDIAYoAkQhBwNAIAUoAgQhCSAFKAIIIQ0gBSgCACEOAn8gBigCSCIBIAdNBEAgBkFAayABQQF0QYABIAEbEDUgBigCQCIMIAYoAkQiB0EMbGoMAQsgBigCQCIMIAdBDGxqCyIBIA42AgAgASAJNgIIIAEgDTYCBCAGIAdBAWoiATYCRAJAIBMEQCABIQcMAQsgBSgCCCADaiENIAUoAgQgA2ohDiAFKAIAIANqIQsCfyAGKAJIIgkgAU0EQCAGQUBrIAlBAXRBgAEgCRsQNSAGIAYoAkQiAUEBaiIHNgJEIAYoAkAgAUEMbGoMAQsgBiAHQQJqIgc2AkQgDCABQQxsagsiASALNgIAIAEgDTYCCCABIA42AgQLIAVBDGoiBSAKRw0ACwsgBkEANgIYIAZCADcCECAQIAZBQGsgBkEQahCeASAGKAIQIgEEQCABECILIBAQjgEgEBBYIBBBABCNASAQQQAQVCAQEFogBiAINgIMIAYgEDYCCCAIIAgoAgRBAWo2AgQgBiAGKQIINwMAIAAgBhBIGiAGKAIoIgAEQCAGIAA2AiwgBigCMBogABAiCyAGIAZBNGo2AhAgBkEQahApIAYoAkAiAARAIAAQIgsgCCAIKAIEIgBBAWs2AgQgAA0AIAggCCgCACgCCBEAACAIECQLIAZB0ABqJAAL9gUCBH8DfCMAQYACayIGJAACQAJAIAJEAAAAAAAAAABjIAFEAAAAAAAAAABlcg0AIAJEAAAAAAAAAABhBEAgA0QAAAAAAAAAAGUNASAGQeQBaiIHIAEgA0QAAAAAAAAAACAEQQEQkAUgBkIANwOwASAGQgA3A7gBIAZCgICAgICAgPg/NwPAASAGQgA3AyAgBkIANwMoIAZCgICAgICAgPg/NwMwIAZBzAFqIgQgByAGQSBqEJoEIAcgBBDBARogBBAoGiAFRQRAIAZCADcDmAEgBkIANwOgASAGQgA3AwggBkIANwMQIAYgAUQAAAAAAADgP6IiATkDqAEgBiABOQMYIAQgByAGQQhqEOkBIAcgBBDBARogBBAoGgsgACAGQeQBaiIAEI8CIAAQKBoMAgsgBEECTARAIAIgAxD6ARDCASEECyAGQYwBaiAEEJIDIQcgBEEASgRARAAAAAAAgHZAIAS3oyELA0AgCyAIuKIiCkQAAAAAAIBWQKAQPiEMIAoQPiEKIAcoAgAgCEEEdGoiCSACIAqiOQMIIAkgAiAMojkDACAIQQFqIgggBEcNAAsLIAZBzAFqIAcQPCEEIAZBADYC7AEgBkIANwLkASAGQeQBaiIIIAQgBEEMakEBEEcgBiADIAKjRAAAAAAAAPA/IANEAAAAAAAAAABmGyICOQOAASAGIAI5A3ggBiACOQNQIAYgAjkDWCAAIAggAUEARAAAAAAAAAAAIAZB0ABqEI8FIAYgCDYC/AEgBkH8AWoQKSAEKAIAIggEQCAEIAg2AgQgBCgCCBogCBAiCyAFBEAgBkIANwNgIAZCADcDaCAGQgA3AzggBkIANwNAIAYgAUQAAAAAAADgv6IiATkDcCAGIAE5A0ggBkHMAWoiBCAAIAZBOGoQ6QEgBkHkAWoiBSAEEI8CIAAgBRDBARogBRAoGiAEECgaCyAHKAIAIgBFDQEgByAANgIEIAcoAggaIAAQIgwBCyAAEOoBCyAGQYACaiQAC/QCAgF/A3wjAEHQAWsiAyQAAkACQAJAIAErAwAiBEQAAAAAAAAAAGMNACABKwMIIgVEAAAAAAAAAABjDQAgASsDECIGRAAAAAAAAAAAYw0AIAQgBKIgBSAFoqAgBiAGoqBEAAAAAAAAAABiDQELIAAQ6gEMAQsgA0IANwN4IANCADcDgAEgA0IANwOIASADQgA3A5gBIANCADcDoAEgA0IANwOoASADIAY5A7ABIAMgBkQAAAAAAADgv6JEAAAAAAAAAAAgAhs5A8gBIAMgBTkDkAEgAyAFRAAAAAAAAOC/okQAAAAAAAAAACACGzkDwAEgAyAEOQNwIAMgBEQAAAAAAADgv6JEAAAAAAAAAAAgAhs5A7gBQagCECMiAUGgkAI2AgAgAUIANwIEIANBCGoiAiADQfAAakHgAPwKAAAgAUEQakEBIAIQwAQhAiADIAE2AmwgAyACNgJoIAMgAykCaDcDACAAIAMQSBoLIANB0AFqJAAL0QEBAn8jAEHAAWsiAiQAQagCECMiA0GgkAI2AgAgA0IANwIEIAEoAgAhASACQgA3A2ggAkKAgICAgICA+D83A2AgAkIANwNwIAJCADcDeCACQgA3A4gBIAJCgICAgICAgPg/NwOAASACQgA3A5ABIAJCADcDmAEgAkIANwOoASACQoCAgICAgID4PzcDoAEgAkIANwOwASACQgA3A7gBIAIgAkHgAGpB4AD8CgAAIANBEGogASACEMAEIQEgACADNgIEIAAgATYCACACQcABaiQAC7IHAQl/IwBBkAFrIgUkAAJAAkAgA0UNACADLQAQQQFHDQBBqAIQIyIBQaCQAjYCACABQgA3AgQgAUEQahA7IQIgACABNgIEIAAgAjYCACACQQ4QLAwBCyAFIAEoAgA2AhAgBUEUaiABQQRqEGAaIAVBIGogAUEQahBgGiAFQSxqIAFBHGoQYBogBUE4aiABQShqEGAaIAVBxABqIAFBNGoQYBogBUHQAGogAUFAaxBgGiAFQdwAaiABQcwAahBgGiAFQegAaiIEQQA2AgggBEIANwIAIAEoAlwiBiABKAJYIghHBEAgBiAIayIGQQBIBEAQJgALIAQgBhAjIgc2AgQgBCAHNgIAIAQgBiAHajYCCCAEKAIEIQcgBgRAIAcgCCAG/AoAAAsgBCAGIAdqNgIECyAFQfQAaiABQeQAahBgIQQgBUGAAWogAUHwAGoQYBogBSABKgJ8OAKMASAEIAEoAhQgASgCEGtBAnVBA24QfSAEKAIAIgQgBSgCeCIGRwRAA0AgBCAJNgIAIAlBAWohCSAEQQRqIgQgBkcNAAsLQagCECMiBkGgkAI2AgAgBkIANwIEIAZBEGogBUEQaiADEJMDIQggACAGNgIEIAAgCDYCAAJAIAYoAlQNAEEAIQcjAEFAaiIAJAAgAEIANwMgIABCADcDGCAAQYCAgPwDNgIoIAgoAlxBA08EQANAIAgoAtgBIAdBBHRqKAIIIABBAjYCFCAAQoCAgIAQNwIMIAdBA2whCUEDbCEKQQAhBANAIAAgAEEMaiAEaigCACILIApqNgIIIAAgAEEIaiIMNgI0IABBOGogAEEYaiAMIABBNGoQ8QMgACgCOCAJIAtqNgIMIARBBGoiBEEMRw0ACyAHQQFqIgcgCCgCXEEDbkkNAAsLIAVBBGoiByACEDwiAigCACIEIAIoAgQiAkcEQANAIAAgBCgCADYCNCAAIABBNGoiCTYCOCAAQQxqIABBGGogCSAAQThqEPEDIAQgACgCDCgCDDYCACAEQRBqIgQgAkcNAAsLIABBGGoQlQEgAEFAayQAIAggByADEOkDIAUoAgQiAARAIAUgADYCCCAFKAIMGiAAECILIAYoAmwiAkEDbiEAIAJBA0kNACAGKALoASECQQAhBCABKAJoIAEoAmQiAWtBAnUgAEchAwNAIAIgBEEEdGoiBiADBH9BfwUgASAGKAIIQQJ0aigCAAs2AgggBEEBaiIEIABHDQALCyAFQRBqEKoBCyAFQZABaiQAC9ELAgZ/AXwjAEEgayIDJAAgABAaNgIEIABBnKACNgIAIwBBEGsiBCQAIAAoAgRBhw8QEiEGIwBBEGsiAiQAQeCeAi0AAEEBcUUEQEECQcCLAkEDEAYhBUHgngJBAToAAEHcngIgBTYCAAsgAiABKAIANgIIIAJBADYCBEHcngIoAgBBAEEAIAJBBGogAkEIahAFIQggAigCBCEFIAQgCPwDNgIMIARBnKACNgIIIAUEQCAFEAQLIAJBEGokACAGIAQoAgwQFSAEKAIMIgJBCU8EQCACEAELIAZBCU8EQCAGEAELIARBEGokACABKAIUIQIgAyABKAIQIgQ2AgwgAyACIARrQQJ1NgIIIANBEGogA0EIahCkASADQRhqIgIgAygCFEHeFhB3IABBsAogAhBtIAMoAhwiAkEJTwRAIAIQAQsgAygCFCICQQlPBEAgAhABCyABKAIIIQIgAyABKAIEIgQ2AgwgAyACIARrQQJ1NgIIIANBEGogA0EIahCNAiADQRhqIgIgAygCFEHeFhB3IABBpQwgAhBtIAMoAhwiAkEJTwRAIAIQAQsgAygCFCICQQlPBEAgAhABCyABKAIgIQIgAyABKAIcIgQ2AgwgAyACIARrQQJ1NgIIIANBEGogA0EIahCkASADQRhqIgIgAygCFEHeFhB3IABBpAkgAhBtIAMoAhwiAkEJTwRAIAIQAQsgAygCFCICQQlPBEAgAhABCyABKAIsIQIgAyABKAIoIgQ2AgwgAyACIARrQQJ1NgIIIANBEGogA0EIahCkASADQRhqIgIgAygCFEHeFhB3IABBkAkgAhBtIAMoAhwiAkEJTwRAIAIQAQsgAygCFCICQQlPBEAgAhABCyABKAI4IQIgAyABKAI0IgQ2AgwgAyACIARrQQJ1NgIIIANBEGogA0EIahCkASADQRhqIgIgAygCFEHeFhB3IABBtQggAhBtIAMoAhwiAkEJTwRAIAIQAQsgAygCFCICQQlPBEAgAhABCyABKAJEIQIgAyABKAJAIgQ2AgwgAyACIARrQQJ1NgIIIANBEGogA0EIahCkASADQRhqIgIgAygCFEHeFhB3IABBqxkgAhBtIAMoAhwiAkEJTwRAIAIQAQsgAygCFCICQQlPBEAgAhABCyABKAJoIQIgAyABKAJkIgQ2AgwgAyACIARrQQJ1NgIIIANBEGogA0EIahCkASADQRhqIgIgAygCFEHeFhB3IABBuRkgAhBtIAMoAhwiAkEJTwRAIAIQAQsgAygCFCICQQlPBEAgAhABCyABKAJ0IQIgAyABKAJwIgQ2AgwgAyACIARrQQJ1NgIIIANBEGogA0EIahCNAiADQRhqIgIgAygCFEHeFhB3IABBvwkgAhBtIAMoAhwiAkEJTwRAIAIQAQsgAygCFCICQQlPBEAgAhABCyABKAJQIQIgAyABKAJMIgQ2AgwgAyACIARrQQJ1NgIIIANBEGogA0EIahCNAiADQRhqIgIgAygCFEHeFhB3IABBhBAgAhBtIAMoAhwiAkEJTwRAIAIQAQsgAygCFCICQQlPBEAgAhABCyABKAJcIQIgAyABKAJYIgQ2AgwgAyACIARrNgIIIANBEGogA0EIahDfAyADQRhqIgIgAygCFEHeFhB3IABBnAwgAhBtIAMoAhwiAkEJTwRAIAIQAQsgAygCFCICQQlPBEAgAhABCyMAQRBrIgIkACAAKAIEQbUWEBIhBCMAQRBrIgAkAEGInwItAABBAXFFBEBBAkH8iwJBAxAGIQVBiJ8CQQE6AABBhJ8CIAU2AgALIAAgASoCfDgCCCAAQQA2AgRBhJ8CKAIAQQBBACAAQQRqIABBCGoQBSEIIAAoAgQhASACIAj8AzYCDCACQZygAjYCCCABBEAgARAECyAAQRBqJAAgBCACKAIMEBUgAigCDCIAQQlPBEAgABABCyAEQQlPBEAgBBABCyACQRBqJAAgA0EgaiQACwwAIAEgACgCBBEAAAuMAgIDfwF8IwBBEGsiAiQAIAJBCGoiAyABQfgQED8gAigCDCADEKoCIQMgAigCDCIEQQlPBEAgBBABCyAAQQA2AgggAEIANwIAIAAgAxDUASACIAAoAgA2AgQgAiADNgIAIwBBEGsiACQAQbCfAi0AAEEBcUUEQEECQaSMAkEDEAYhA0GwnwJBAToAAEGsnwIgAzYCAAsgACACKQIANwMIIABBADYCBEGsnwIoAgBBAEEAIABBBGogAEEIahAFIQUgACgCBCEDIAIgBfwDNgIMIAJBnKACNgIIIAMEQCADEAQLIABBEGokACACKAIMIAEoAgQQFCACKAIMIgBBCU8EQCAAEAELIAJBEGokAAs0AQJ/IwBBIGsiAyQAIANBCGoiBCABIAIgACgCABEDAEEYECMgBBAuIAQQKBogA0EgaiQACzIBAn9BDBAjIgFBADYCCCABQgA3AgAgASAAKAIAIgIgACgCBCIAIAAgAmtBDG0QRyABCzABAX8jAEFAaiIDJAAgAyABIAIgACgCABEDAEHAABAjIAMQQCADEEEaIANBQGskAAs9AQJ/IAAoAgQiAiAAKAIIIgFHBEAgACABIAIgAWtBH2pBYHFqNgIICyAAKAIAIgEEQCAAKAIMGiABECILCwsAIAAgAUEAEMUCCzgBAX8jAEEQayIDJAAgACgCACEAIAMgAikDCDcDCCADIAIpAwA3AwAgASADIAARAQAgA0EQaiQAC8ECAQV/IwBBIGsiBSQAAkACQCAAKAIEIgIgACgCCCIDSQRAIAIgASgCCDYCCCACIAEpAgA3AgAgAkEMaiEBDAELIAIgACgCACIEa0EMbSIGQQFqIgJB1qrVqgFPDQEgBUEMakHVqtWqASADIARrQQxtIgNBAXQiBCACIAIgBEkbIANBqtWq1QBPGyAGIAAQYSICKAIIIgMgASgCCDYCCCADIAEpAgA3AgAgAiACKAIIQQxqNgIIIAIoAgQgACgCBCAAKAIAIgNrIgFBdG1BDGxqIQQgAQRAIAQgAyAB/AoAAAsgACgCACEDIAAgBDYCACACIAM2AgQgACACKAIIIgE2AgQgAiADNgIIIAAoAgghBCAAIAIoAgw2AgggAiADNgIAIAIgBDYCDCACENYBCyAAIAE2AgQgBUEgaiQADwsQJgALaQEDf0EIEHQiA0H47gE2AgAgABCvAiICQQ1qECMiAUEANgIIIAEgAjYCBCABIAI2AgAgAUEMaiEBIAJBAWoiAgRAIAEgACAC/AoAAAsgAyABNgIEIANBqO8BNgIAIANBtO8BQe4CEAsAC1kBAX8jAEEgayIDJAAgACgCACEAIAMgAjYCBCADQZygAjYCACADQQhqIgIgASADIAARAwBBGBAjIAIQLiACECgaIAMoAgQiAEEJTwRAIAAQAQsgA0EgaiQAC/EDAEHk6QFBkxcQIUH06QFBkRBBAUEAECBBgOoBQbwOQQFBgH9B/wAQD0GY6gFBtQ5BAUGAf0H/ABAPQYzqAUGzDkEBQQBB/wEQD0Gk6gFB/ghBAkGAgH5B//8BEA9BsOoBQfUIQQJBAEH//wMQD0G86gFBuwlBBEGAgICAeEH/////BxAPQcjqAUGyCUEEQQBBfxAPQdTqAUGuEkEEQYCAgIB4Qf////8HEA9B4OoBQaUSQQRBAEF/EA9B7OoBQZsSQQhCgICAgICAgICAf0L///////////8AEBlB+OoBQZISQQhCAEJ/EBlBhOsBQZ0KQQQQGEGQ6wFBlhVBCBAYQdyIAkHNEhAfQYwgQQRBsxIQFkHUIEECQdkSEBZBoCFBBEHoEhAWQaDxARAeQewhQQBBnx0QB0GUIkEAQeQdEAdB9IsCQQFBvR0QB0G8IkECQewZEAdB5CJBA0GLGhAHQYwjQQRBsxoQB0HQiwJBBUHQGhAHQbQjQQRBiR4QB0HcI0EFQaceEAdBlCJBAEG2GxAHQfSLAkEBQZUbEAdBvCJBAkH4GxAHQeQiQQNB1hsQB0GMI0EEQf4cEAdB0IsCQQVB3BwQB0GEJEEIQbscEAdBrCRBCUGZHBAHQeSLAkEGQfYaEAdBrIwCQQdBzh4QBwsjACAAKAIAIAFBBHRqIgAgAikDCDcDCCAAIAIpAwA3AwBBAQtJACAAAn8gASgCBCABKAIAIgFrQQR1IAJLBEAgACABIAJBBHRqIgEpAwg3AwggACABKQMANwMAQQEMAQsgAEEAOgAAQQALOgAQCxAAIAAoAgQgACgCAGtBBHULngMBBX8CQCAAKAIEIAAoAgAiA2tBBHUiBCABSQRAIwBBIGsiBiQAAkACQCABIARrIgQgACgCCCIFIAAoAgQiA2tBBHVNBEAgACAEBH8gAyAEQQR0aiEAA0AgAyACKQMINwMIIAMgAikDADcDACADQRBqIgMgAEcNAAsgAAUgAws2AgQMAQsgAyAAKAIAIgNrQQR1IgcgBGoiAUGAgICAAU8NASAGQQxqQf////8AIAUgA2siA0EDdSIFIAEgASAFSRsgA0Hw////B08bIAcgABAyIgEoAggiAyAEQQR0aiEEA0AgAyACKQMINwMIIAMgAikDADcDACADQRBqIgMgBEcNAAsgASAENgIIIAEoAgQgACgCBCAAKAIAIgRrIgJrIQMgAgRAIAMgBCAC/AoAAAsgACgCACECIAAgAzYCACABIAI2AgQgACABKAIINgIEIAEgAjYCCCAAKAIIIQMgACABKAIMNgIIIAEgAjYCACABIAM2AgwgARA2CyAGQSBqJAAMAgsQJgALIAEgBEkEQCAAIAMgAUEEdGo2AgQLCwsIACAAIAEQTAsQACAAKAIEIAAoAgBrQRhtCxAAIAAoAgQgACgCAGtBDG0LEAAgACgCBCAAKAIAa0EGdQsoACABIAAoAgBqIgAgAikDEDcDECAAIAIpAwg3AwggACACKQMANwMACzQBAX8gACgCACECQRgQIyIAIAEgAmoiASkDEDcDECAAIAEpAwg3AwggACABKQMANwMAIAALDwAgASAAKAIAaiACNgIACw0AIAEgACgCAGooAgALLwECfyMAQSBrIgIkACACQQhqIgMgASAAEQEAQRgQIyADEC4gAxAoGiACQSBqJAALMwEDf0EEECMiAiABNgIAQZjxASAAQQNBACEAQfCHAiAAQfbcAGpBtgIgAkEAQQBBABAACwwAIAAQsAUaIAAQIgs3AQJ/IABB+O4BNgIAIAAoAgQiAkEEayIBIAEoAgBBAWsiATYCACABQQBIBEAgAkEMaxAiCyAAC8EEAQN/AkAgACABKAIIIAQQcwRAIAIgASgCBEcNASABKAIcQQFGDQEgASADNgIcDwsCQCAAIAEoAgAgBBBzBEACQCABKAIQIAJHBEAgAiABKAIURw0BCyADQQFHDQMgAUEBNgIgDwsgASADNgIgIAEoAixBBEYNASAAQRBqIgUgACgCDEEDdGohB0EAIQMDQAJAAkAgAQJ/AkAgBSAHTw0AIAFBADsBNCAFIAEgAiACQQEgBBCeAyABLQA2DQAgAS0ANUEBRw0DIAEtADRBAUYEQCABKAIYQQFGDQNBASEDQQEhBiAALQAIQQJxRQ0DDAQLQQEhAyAALQAIQQFxDQNBAwwBC0EDQQQgAxsLNgIsIAYNBQwECyABQQM2AiwMBAsgBUEIaiEFDAALAAsgACgCDCEFIABBEGoiBiABIAIgAyAEEKsCIAVBAkkNASAGIAVBA3RqIQYgAEEYaiEFAkAgACgCCCIAQQJxRQRAIAEoAiRBAUcNAQsDQCABLQA2DQMgBSABIAIgAyAEEKsCIAVBCGoiBSAGSQ0ACwwCCyAAQQFxRQRAA0AgAS0ANg0DIAEoAiRBAUYNAyAFIAEgAiADIAQQqwIgBUEIaiIFIAZJDQAMAwsACwNAIAEtADYNAiABKAIkQQFGBEAgASgCGEEBRg0DCyAFIAEgAiADIAQQqwIgBUEIaiIFIAZJDQALDAELIAEgAjYCFCABIAEoAihBAWo2AiggASgCJEEBRw0AIAEoAhhBAkcNACABQQE6ADYLC8sEAQV/IwBBQGoiBSQAAkACQAJAIAEoAgRB7ukBRgRAIAJBADYCAAwBCwJAIAAgASAALQAIQRhxBH9BAQUgAUUNASABQcTnARBiIgZFDQEgBi0ACEEYcUEARwsQcyEDCyADBEBBASEEIAIoAgAiAEUNAyACIAAoAgA2AgAMAwsgAUH05wEQYiIDRQ0CQQAhASACKAIAIgYEQCACIAYoAgAiATYCAAsgAygCCCIHIAAoAggiBkF/c3FBB3EgB0F/cyAGcUHgAHFyDQIgACgCDCIHKAIEIgQgAygCDCIAKAIERw0BC0EBIQQMAQsgBEHs6QFGBEAgAEGk6AEQYkUhBAwBC0EAIQQgB0H05wEQYiIDBEAgBkEBcUUNAQJ/IAMhAUEAIQICQANAQQAgAEUNAhogAEH05wEQYiIARQ0BIAAoAgggASgCCCIEQX9zcQ0BQQEgASgCDCIDKAIEIAAoAgwiACgCBEYNAhogBEEBcUUNASADQfTnARBiIgENAAsgA0HY6AEQYiIBRQ0AIAEgABCfAyECCyACCyEEDAELIAdB2OgBEGIiAwRAIAZBAXFFDQEgAyAAEJ8DIQQMAQsgB0GU5wEQYiIDRQ0AIABBlOcBEGIiAEUNACAFQQhqQQBBOPwLACAFIAFBAEc6ADsgBUF/NgIQIAUgAzYCDCAFIAA2AgQgBUEBNgI0IAAgBUEEaiABQQEgACgCACgCHBEFACAFKAIcIgBBAUYEQCACIAUoAhRBACABGzYCAAsgAEEBRiEECyAFQUBrJAAgBAtyAQJ/IAAoAgQgASgCCCgCBEYEQCABIAIgAxCtAg8LIAAoAgwhBCAAQRBqIgUgASACIAMQoAMCQCAEQQJJDQAgBSAEQQN0aiEEIABBGGohAANAIAAgASACIAMQoAMgAS0ANg0BIABBCGoiACAESQ0ACwsLNQAgACgCBCABKAIIKAIERgRAIAEgAiADEK0CDwsgACgCCCIAIAEgAiADIAAoAgAoAhwRBQALHAAgACgCBCABKAIIKAIERgRAIAEgAiADEK0CCwvEAQECfyMAQdAAayIDJAACQAJ/QQEgACgCBCABKAIERg0AGkEAIAFBlOcBEGIiAUUNABogAigCACIERQ0BIANBGGpBAEE4/AsAIANBAToASyADQX82AiAgAyAANgIcIAMgATYCFCADQQE2AkQgASADQRRqIARBASABKAIAKAIcEQUAIAMoAiwiAEEBRgRAIAIgAygCJDYCAAsgAEEBRgsgA0HQAGokAA8LIANByBk2AgggA0HnAzYCBCADQccONgIAEK4CAAsFAEHkDQsrAQF/IwBBQGoiAiQAIAIgASAAEQEAQcAAECMgAhBAIAIQQRogAkFAayQACwUAQZsQCy0BAX8jAEFAaiIDJAAgAyABIAIgABEWAEHAABAjIAMQQCADEEEaIANBQGskAAsEAEEAC0gBAX8jAEHQAGsiAyQAIAMgASkDADcDACADIAEpAwg3AwggA0EQaiIBIAMgAiAAEQMAQcAAECMgARBAIAEQQRogA0HQAGokAAsEAEEAC1UBAn8jAEFAaiICJAAgASAAKAIEIgNBAXVqIQEgACgCACEAIAIgASADQQFxBH8gASgCACAAaigCAAUgAAsRAQBBwAAQIyACEEAgAhBBGiACQUBrJAALdQECfyMAQSBrIgIkACABIAAoAgQiA0EBdWohASAAKAIAIQAgAiABIANBAXEEfyABKAIAIABqKAIABSAACxEBAEEgECMiACACKQMYNwMYIAAgAikDEDcDECAAIAIpAwg3AwggACACKQMANwMAIAJBIGokACAAC7oBAQN/IwBBEGsiAyQAIAAoAgAhAiADIAEgACgCBCIAQQF1aiIBIABBAXEEfyABKAIAIAJqKAIABSACCxEBAEEMECMiAEEANgIIIABCADcCACADKAIEIgIhBCACIAMoAgAiAWtBBnUiAgRAIAAgAhCVAyAAKAIEIQIgASAERwRAA0AgAiABEEBBQGshAiABQUBrIgEgBEcNAAsLIAAgAjYCBAsgAyADNgIMIANBDGoQmAMgA0EQaiQAIAALVwECfyMAQUBqIgMkACABIAAoAgQiBEEBdWohASAAKAIAIQAgAyABIAIgBEEBcQR/IAEoAgAgAGooAgAFIAALEQsAQcAAECMgAxBAIAMQQRogA0FAayQACwsAIAAQaRogABAiC3MBAn8jAEHQAGsiAyQAIAEgACgCBCIEQQF1aiEBIAAoAgAhACAEQQFxBEAgASgCACAAaigCACEACyADIAIpAwg3AwggAyACKQMANwMAIANBEGoiAiABIAMgABEDAEHAABAjIAIQQCACEEEaIANB0ABqJAALJAECfiAAKQMAIAEpAwBTIAApAwgiAiABKQMIIgNVIAIgA1EbCwYAQYCcAgsUACAAQQRqQQAgASgCBEGhmAFGGwtPAQJ/AkAgASgCBCICBEAgASgCACIBIAJBBHRqIQMDQCAAKAIEKAIQIgJFDQIgAiABIAIoAgAoAhgRAQAgAUEQaiIBIANHDQALCw8LEGYACxUAIAFByJsCNgIAIAEgACgCBDYCBAsdAQF/QQgQIyIBQcibAjYCACABIAAoAgQ2AgQgAQsQACAAKAIMIAAoAghrQQJ1CwoAIABBCGoQhAILZwEDfyAAKAIEIgMgACgCCCIBRwRAA0AgACABQQRrIgE2AgggASgCACECIAFBADYCACACBEAgAiACKAIAKAIEEQAAIAAoAgghAQsgASADRw0ACwsgACgCACIBBEAgACgCDBogARAiCwviBAMGfwF8AX4jAEEgayIGJAACf0EwECMhAyMAQSBrIgIkACADQQA2AiggA0IANwMgIANBADYCECADQgA3AwggAyAANgIEIANBmJsCNgIAAkACQCAARQRAIANCgICAgICAgPg/NwMYIAJBADYCDCACQgA3AgREAAAAAAAA8D8hCAwBCyADIAArAxgiCDkDGCACQQA2AgwgAkIANwIEIAhEAAAAAAAAAABhDQELIAJBBGogASgCBCABKAIAa0EEdRBcIAEoAgAiBCABKAIEIgFHBEADQCAEKQMAIQkgAiAIIAQpAwi5ojkDGCACIAggCbmiOQMQIAJBBGogAkEQahBMIARBEGoiBCABRw0ACwsgA0EgahBFIAMgAigCBDYCICADIAIoAgg2AiQgAyACKAIMNgIoIAJBIGokACADDAELQQIQggIACyEDAkACQCAAKAIMIgEgACgCECICSQRAIAEgAzYCACABQQRqIQMMAQsgASAAQQhqIgQoAgAiBWtBAnUiB0EBaiIBQYCAgIAETw0BIAZBDGpB/////wMgAiAFayICQQF1IgUgASABIAVJGyACQfz///8HTxsgByAEEEoiASgCCCICIAM2AgAgASACQQRqNgIIIAEoAgQgACgCDCAAKAIIIgJrIgNrIQQgAwRAIAQgAiAD/AoAAAsgACgCCCECIAAgBDYCCCABIAI2AgQgACABKAIIIgM2AgwgASACNgIIIAAoAhAhBCAAIAEoAgw2AhAgASACNgIAIAEgBDYCDCABEMwFCyAAIAM2AgwgA0EEaygCACAGQSBqJAAPCxAmAAsJACAAEIMCECILcQEDfyMAQeAAayIDJAAgA0EANgIUIANCADcCDCADQQxqIgQgASgCACIFIAEoAgQiASABIAVrQQxtEEcgA0EYaiIBIAQgAiAAEQMAQcAAECMgARC0ASABEEEaIAMgBDYCXCADQdwAahApIANB4ABqJAALFQAgACgCBCAAQQRqIAAsAA9BAEgbCycAIABB6JoCNgIAIAAsAA9BAEgEQCAAKAIMGiAAKAIEECILIAAQIgslACAAQeiaAjYCACAALAAPQQBIBEAgACgCDBogACgCBBAiCyAACyUBAX8jAEEQayIBJAAgASAAQQxqNgIMIAFBDGoQKSABQRBqJAALDwAgAEG0mgI2AgAgABAiCw0AIABBtJoCNgIAIAALDQAgAARAIAAQQRAiCwuvAQICfwR8IwBBMGsiAiQAIAJBCGogARBNIAJBEGogAigCCBDHAwJAIAIoAgwiAUUNACABIAEoAgQiA0EBazYCBCADDQAgASABKAIAKAIIEQAAIAEQJAsgAisDECEEIAIrAyAhBSAAIAIrAxgiBiACKwMoIgcgBiAHZCIBGzkDGCAAIAUgBCAEIAVjIgMbOQMQIAAgByAGIAEbOQMIIAAgBCAFIAMbOQMAIAJBMGokAAteAQR/IwBBEGsiASQAIAFBCGogABBNIAEoAggiACgCBCAAKAIAAkAgASgCDCIARQ0AIAAgACgCBCIEQQFrNgIEIAQNACAAIAAoAgAoAggRAAAgABAkCyABQRBqJABGC7oCAgJ8Bn8jAEEQayIEJAAgBEEIaiAAEE0gBCgCCCIAKAIAIgUgACgCBCIIRwRAA0BEAAAAAAAAAAAhASACIAUoAgQiBiAFKAIAIgBrIgdBIU8EfAJAIAZBEGsiAyAGIAdBEHEiBhsiByAARgRADAELIAMrAwAhAgNAIAEgAysDCCAAKwMIIgGgIAIgACsDACICoaKgIAEgACsDGKAgAiAAKwMQIgKhoqAhASAAQRBqIQMgAEEgaiIAIAdHDQALCyAGBHwgASADKwMIIAArAwigIAMrAwAgACsDAKGioAUgAQtEAAAAAAAA4D+iBSABC6AhAiAFQQxqIgUgCEcNAAsLAkAgBCgCDCIARQ0AIAAgACgCBCIDQQFrNgIEIAMNACAAIAAoAgAoAggRAAAgABAkCyAEQRBqJAAgAgujAQEDfyMAQTBrIgIkACACQQxqIgMgARDKAyACQQA2AiAgAkIANwIYIAJBGGoiASADIAFBARBHQRgQIyIDQbSaAjYCACADQgA3AgQgA0EMaiIEIAEQWyACIAM2AiggAiAENgIkIAIgAikCJDcDACAAIAIQaiACIAE2AiwgAkEsahApIAIoAgwiAARAIAIgADYCECACKAIUGiAAECILIAJBMGokAAveBQIJfwF8IwBB0ABrIgYkACAGIAEQQBogBkEANgJIIAZCADcCQCAGQUBrIgFBARCVAyABKAIEIQMgASAGIgJHBEADQCADIAIQQBogA0FAayEDIAJBQGsiAiABRw0ACwsgASADNgIEIwBBkAFrIgIkACABKAIAIgMgASgCBCIHRwRAA0AgAkHQAGoiBCADEEAaIAQQywMgBWohBSAEEEEaIANBQGsiAyAHRw0ACwsgAkEANgJMIAJCADcCRCACQcQAaiAFEFwgASgCACIFIAEoAgQiB0cEQANAIAJB0ABqIgMgBRBAGiACQRhqIAMQTSACQQA2AkAgAkIANwI4IAJBOGogAigCGCIDKAIAIgQgAygCBCIDIAMgBGtBDG0QRwJAIAIoAhwiA0UNACADIAMoAgQiBEEBazYCBCAEDQAgAyADKAIAKAIIEQAAIAMQJAsgAigCOCIEIAIoAjwiCEcEQANAIAJBLGogBBA8IgkoAgAiAyACKAIwIgpHBEADQCADKwMAIQsgAiADKwMIOQMgIAIgCzkDGCACQcQAaiACQRhqEEwgA0EQaiIDIApHDQALIAkoAgAhAwsgAwRAIAIgAzYCMCACKAI0GiADECILIARBDGoiBCAIRw0ACwsgAiACQThqNgIYIAJBGGoQKSACQdAAahBBGiAFQUBrIgUgB0cNAAsLIAJBGGoiAyACQcQAahDKAyACQQA2AlggAkIANwJQIAJB0ABqIgUgAyACQSRqQQEQR0EYECMiA0G0mgI2AgAgA0IANwIEIANBDGoiBCAFEFsgAiADNgIUIAIgBDYCECACIAIpAhA3AwggACACQQhqEGogAiAFNgI4IAJBOGoQKSACKAIYIgAEQCACIAA2AhwgAigCIBogABAiCyACKAJEIgAEQCACIAA2AkggAigCTBogABAiCyACQZABaiQAIAYgATYCTCAGQcwAahCYAyAGEEEaIAZB0ABqJAALJAECfCAAKwMIIAErAwhjIAArAwAiAiABKwMAIgNjIAIgA2EbCwYAQfz9AQvZGgIRfwd8IwBBkAJrIgQkACAEQQA2AlggBEIANwNQIARCADcCPCAEQgA3AjQgBEKAgICAgICA+D83A0ggBEGYmwI2AjAgBEEYaiABEE0gBCgCGCEBIARBADYCLCAEQgA3AiQgBEE4ahCEAiAEQfgAakEAQegA/AsAIARCADcDcCAEQQI2AmwgBEIANwJkIARB/ABqQQBBMPwLACAEQbABakEAQST8CwAgBEEANgLoASAEQgA3A+ABIARBAToA3QEgBEEBOgDUASAEQoCAgICAgICgPjcD+AEgBEKAgICAgICA0MEANwPwASAEQfyaAjYCYCAEQeAAaiIGIAEQmwEgBiAEQSRqIgUQ4QEgBEEANgKIAiAEQgA3AoACIAYgBEEwaiAEQYACaiIBEM0DIAQgATYCjAIgBEGMAmoQKSAGEGkaIAQgBTYCYCAGECkCQCAEKAIcIgVFDQAgBSAFKAIEIgFBAWs2AgQgAQ0AIAUgBSgCACgCCBEAACAFECQLIARBADYCiAIgBEIANwKAAiAEQTBqIARBgAJqEMwDIARBADYCLCAEQgA3AiQgBCgCgAIiByAEKAKEAiIJRwRAA0AgBEHgAGogBxA8IQxEAAAAAAAAAAAhFCAEKAJkIgogDCgCACIDayIBQSFPBEACQCAKQRBrIgUgCiABQRBxIggbIgYgA0YEQEQAAAAAAAAAACEWIAMhAQwBCyAFKwMAIRhEAAAAAAAAAAAhFiADIQEDQCAWIAUrAwggASsDCCIWoCAYIAErAwAiFKGioCAWIAErAxigIBQgASsDECIYoaKgIRYgAUEQaiEFIAFBIGoiASAGRw0ACwsgCAR8IBYgBSsDCCABKwMIoCAFKwMAIAErAwChoqAFIBYLRAAAAAAAAOA/opkhFAtEAAAAAAAA8H8hGkQAAAAAAADw/yEYRAAAAAAAAPD/IRZEAAAAAAAA8P8hGUQAAAAAAADwfyEVIAogAyIBRwRAA0AgASsDCCIXIBggFyAYZBshGCABKwMAIhYgGSAWIBlkGyEZIBogFyAXIBpkGyEaIBUgFiAVIBZjGyEVIAFBEGoiASAKRw0ACyAYIBqhIRYgGSAVoSEYCyACIBYgGCAWIBhkG6IgFGMEQCAEQSRqIAwQdiAMKAIAIQMLIAMEQCAEIAM2AmQgBCgCaBogAxAiCyAHQQxqIgcgCUcNAAsgBCgCKCAEKAIka0EMbSEDCyAEQQA2AiAgBEIANwIYIARBGGogAxBWIAQoAiQiASAEKAIoIhNHBEADQCAEQeAAaiELIwBBMGsiDSQAAkAgASgCBCABKAIAayIGQQR1Ig9BA00EQCALIAEQPBoMAQsjAEEQayIJJAAgDUEQaiIKQQA2AgggCkIANwIAAkAgD0UNACAKIA8QyQQgCigCACEFIAkgCigCBCIDQR9xNgIMIAkgBSADQQN2Qfz///8BcWo2AgggCUEIaiAPEMgEIAogCigCBCAPaiIDNgIEIANBH3EiBUUNAEEgIAVrIQggCigCACADQQN2Qfz///8BcWohBwNAIAcgBygCAEF+IAV3cTYCAEEAIAVBAWogBUEfRiIDGyEFIAdBBEEAIAMbaiEHIAhBAWsiCA0ACwsgCUEQaiQAIA1BBGogDxCWASESAnwgASgCACIHKwMYIAcgD0EBayIMQQR0aiIFKwMIIhahIRUgEigCACIQIAcrAxAgBSsDACIUoSIXRAAAAAAAAAAAYSAVRAAAAAAAAAAAYXEEfEQAAAAAAAAAAAUgFSAHKwMAIBShoiAXIAcrAwggFqGioSIUIBSiIBcgF6IgFSAVoqCjCzkDACAGIAdqIgNBGGsrAwAgBysDCCIWoSEVRAAAAAAAAAAAIANBIGsrAwAgBysDACIUoSIXRAAAAAAAAAAAYSAVRAAAAAAAAAAAYXENABogFSAFKwMAIBShoiAXIAUrAwggFqGioSIUIBSiIBcgF6IgFSAVoqCjCyEUIBAgDEEDdGogFDkDACAMQQJPBEAgASgCACEHQQEhAwNAIAcgA0EBaiIFQQR0aiIGKwMIIAcgA0EEdGoiCEEIaysDACIWoSEVIBAgA0EDdGoCfCAGKwMAIAhBEGsrAwAiFKEiF0QAAAAAAAAAAGEEQEQAAAAAAAAAACAVRAAAAAAAAAAAYQ0BGgsgFSAIKwMAIBShoiAXIAgrAwggFqGioSIUIBSiIBcgF6IgFSAVoqCjCzkDACAFIgMgDEcNAAsLIAIgAqIhFyABKAIAIREgCigCACEOQQAhBQNAAkACQAJAIBAgBUEDdGorAwAiGCAXZEUEQCAFIQMMAQsgCigCACEGIAUhAwNAQQAhBwJAIAwgA0EBaiIDTwRAIAYgA0EDdkH8////AXFqKAIAIAN2QQFxDQIMAQsDQCAHIgNBAWohByAGIANBA3ZB/P///wFxaigCACADdkEBcQ0ACwsgAyAFRg0CIBAgA0EDdGorAwAiGCAXZA0ACwtBACEHAkAgA0EBayAMIAMbIgZFDQADQCAOIAZBA3ZB/P///wFxaigCACAGdkEBcUUEQCAGIQcMAgsgBkEBayIGDQALCyAMIQYgDiAHQQN2Qfz///8BcWooAgAgB3ZBAXEEQANAIAYiB0EBayEGIA4gB0EDdkH8////AXFqKAIAIAd2QQFxDQALCyADIQUDQAJAIAwgBUEBaiIFSQRAQQAhBgNAIAYiBUEBaiEGIA4gBUEDdkH8////AXFqKAIAIAV2QQFxDQALDAELIA4gBUEDdkH8////AXFqKAIAIAV2QQFxDQELCyAFIAdGDQACQCAYIBAgBSIGQQN0aisDAGQEQANAIAwgBkEBaiIGSQRAQQAhCANAIAgiBkEBaiEIIA4gBkEDdkH8////AXFqKAIAIAZ2QQFxDQALIAMhCSAFIQMgBiEFIAchCAwDCyAOIAZBA3ZB/P///wFxaigCACAGdkEBcQ0ACyADIQkgBSEDIAYhBSAHIQgMAQtBACEIAkAgB0EBayAMIAcbIgZFDQADQCAOIAZBA3ZB/P///wFxaigCACAGdkEBcUUEQCAGIQgMAgsgBkEBayIGDQALCyAMIQYgDiAIQQN2Qfz///8BcWooAgAgCHZBAXEEQANAIAYiCEEBayEGIA4gCEEDdkH8////AXFqKAIAIAh2QQFxDQALCyAHIQkLIA4gA0EDdkH8////AXFqIgYgBigCAEEBIAN0cjYCACAKKAIAIQYgBSEDA0AgDCADQQFqIgNJBEBBACEHA0AgByIDQQFqIQcgBiADQQN2Qfz///8BcWooAgAgA3ZBAXENAAsMAwsgBiADQQN2Qfz///8BcWooAgAgA3ZBAXENAAsMAQtBACEDIAtBADYCCCALQgA3AgAgCyAPEFwCQANAIAooAgAgA0EDdkH8////AXFqKAIAIAN2QQFxRQRAIAEoAgAgA0EEdGohCQJAIAsoAgQiBSALKAIIIgZJBEAgBSAJKQMINwMIIAUgCSkDADcDACAFQRBqIQcMAQsgBSALKAIAIgVrQQR1IgdBAWoiCEGAgICAAU8NAyANQRxqQf////8AIAYgBWsiBkEDdSIFIAggBSAISxsgBkHw////B08bIAcgCxAyIQggDSgCJCIFIAkpAwg3AwggBSAJKQMANwMAIA0gDSgCJEEQajYCJCANKAIgIAsoAgQgCygCACIFayIHayEGIAcEQCAGIAUgB/wKAAALIAsoAgAhCSALIAY2AgAgDSAJNgIgIAsgDSgCJCIHNgIEIA0gCTYCJCALKAIIIQUgCyANKAIoNgIIIA0gBTYCKCAIIAk2AgAgCBA2CyALIAc2AgQLIANBAWoiAyAPRw0ACyASKAIAIgMEQCASIAM2AgQgEigCCBogAxAiCyAKKAIAIgNFDQMgCigCCBogAxAiDAMLECYACyARIANBBHRqIgYrAwggESAJQQR0aiIDKwMIIhahIRkgECAFQQN0aiAGKwMAIAMrAwAiFKEiFUQAAAAAAAAAAGEgGUQAAAAAAAAAAGFxBHxEAAAAAAAAAAAFIBkgESAFQQR0aiIDKwMAIBShoiAVIAMrAwggFqGioSIUIBSiIBUgFaIgGSAZoqCjCzkDACARIAVBBHRqIgYrAwggESAIQQR0aiIDKwMIIhahIRkgECAJQQN0aiAGKwMAIAMrAwAiFKEiFUQAAAAAAAAAAGEgGUQAAAAAAAAAAGFxBHxEAAAAAAAAAAAFIBkgESAJQQR0aiIDKwMAIBShoiAVIAMrAwggFqGioSIUIBSiIBUgFaIgGSAZoqCjCzkDAAwACwALIA1BMGokACAEQRhqIAsQaCAEKAJgIgMEQCAEIAM2AmQgBCgCaBogAxAiCyABQQxqIgEgE0cNAAsLQRgQIyIFQbSaAjYCACAFQgA3AgQgBUEMaiIDIARBGGoiARBbIAQgBTYCFCAEIAM2AhAgBCAEKQIQNwMIIAAgBEEIahBqIAQgATYCYCAEQeAAaiIAECkgBCAEQSRqNgJgIAAQKSAEIARBgAJqNgJgIAAQKSAEQTBqEIMCGiAEQZACaiQAC7wBAgR8AX8jAEEwayIHJAACQCACKwMAIgQgBKIgAisDCCIDIAOioCIFRAAAAAAAAAAAYQRAIAAQ4wEMAQsgB0IANwMgIAdCADcDKCAHRAAAAAAAAPA/IAMgBZ8iBaMiAyADoiIGIAagoTkDGCAHRAAAAAAAAAAAIAQgBaMiBCADoiIDIAOgoSIDOQMQIAcgAzkDCCAHRAAAAAAAAPA/IAQgBKIiBCAEoKE5AwAgACABIAcQ4AELIAdBMGokAAtXAgF/AnwjAEEwayIDJAAgAisDCCEEIAIrAwAhBSADQgA3AwggAyAFOQMAIANCADcDECADQgA3AyAgAyAEOQMYIANCADcDKCAAIAEgAxDgASADQTBqJAALYAIBfwF8IwBBMGsiAyQAIAIQPiEEIAJEAAAAAACAVkCgED4hAiADQgA3AyAgAyACOQMYIAMgBJo5AxAgAyAEOQMIIAMgAjkDACADQgA3AyggACABIAMQ4AEgA0EwaiQAC2cCAX8CfCMAQTBrIgMkACACKwMAIQQgAisDCCEFIANCADcDCCADQoCAgICAgID4PzcDACADQgA3AxAgAyAFOQMoIAMgBDkDICADQoCAgICAgID4PzcDGCAAIAEgAxDgASADQTBqJAALhwgBBX8jAEGQAmsiAiQAAkACQCABEM4DQQFNBEAgAkHYAGoiAyABEEAaIABBwAAQIyIBNgIAIAAgAUFAayIENgIIIAEgAxBAGiAAIAQ2AgQgAxBBGgwBCyACQQA2AlAgAkIANwNIIAJCADcCNCACQgA3AiwgAkKAgICAgICA+D83A0AgAkGYmwI2AiggAkEgaiABEE0gAigCICEDIAJBADYCHCACQgA3AhQgAkEwahCEAiACQfAAakEAQegA/AsAIAJCADcDaCACQQI2AmQgAkIANwJcIAJB9ABqQQBBMPwLACACQagBakEAQST8CwAgAkEANgLgASACQgA3A9gBIAJBAToA1QEgAkEBOgDMASACQoCAgICAgICgPjcD8AEgAkKAgICAgICA0MEANwPoASACQfyaAjYCWCACQdgAaiIBIAMQmwEgASACQRRqIgMQ4QEgAkEANgKEAiACQgA3AvwBIAEgAkEoaiACQfwBaiIEEM0DIAIgBDYC+AEgAkH4AWoQKSABEGkaIAIgAzYCWCABECkCQCACKAIkIgFFDQAgASABKAIEIgNBAWs2AgQgAw0AIAEgASgCACgCCBEAACABECQLIAJBADYCHCACQgA3AhQgAkEoaiACQRRqQQAQxAIgAEEANgIIIABCADcCACACKAIYIAIoAhRrQQxtIQEjAEEgayIDJAACQAJAIAAoAgggACgCACIEa0EGdSABSQRAIAFBgICAIE8NASAAIANBDGogASAAKAIEIARrQQZ1IAAQqQEiARCnAiABEKYCCyADQSBqJAAMAQsQJgALIAIoAhgiAyACKAIURwRAA0BBGBAjIgFBtJoCNgIAIAFCADcCBCABQQxqIgQgA0EMayIDEFsgAiABNgIQIAIgBDYCDCACIAIpAgw3AwAgAkHYAGoiBCACEGoCQCAAKAIEIgEgACgCCCIFSQRAIAEgBBC0ARogAUFAayEBDAELIAEgACgCACIEa0EGdSIGQQFqIgFBgICAIE8NBCACQfwBakH///8fIAUgBGsiBEEFdSIFIAEgASAFSRsgBEHA////B08bIAYgABCpASEEIAIoAoQCIAJB2ABqELQBGiACIAIoAoQCQUBrNgKEAiAAIAQQpwIgACgCBCEBIAQQpgILIAAgATYCBCACQdgAahBBGiADIAIoAhRHDQALCyACIAJBFGo2AlgjAEEQayIFJAAgAigCWCIBKAIAIgAEQCAAIQMgASEEIAEoAgQiBiAARwRAA0AgBSAGQQxrIgY2AgwgBUEMahApIAAgBkcNAAsgAigCWCIEKAIAIQMLIAEgADYCBCAEKAIIGiADECILIAVBEGokACACQShqEIMCGgsgAkGQAmokAA8LECYAC9oCAgV/A3wjAEFAaiIDJAACQCABRAAAAAAAAAAAZQRAIAAQ4wEMAQsgAkECTARAIAEQwgEhAgsgA0EwaiACEJIDIQUgAkEASgRARAAAAAAAgHZAIAK3oyEJA0AgCSAEuKIiCEQAAAAAAIBWQKAQPiEKIAgQPiEIIAUoAgAgBEEEdGoiBiABIAiiOQMIIAYgASAKojkDACAEQQFqIgQgAkcNAAsLIANBEGogBRA8IQIgA0EANgIkIANCADcCHCADQRxqIgYgAiACQQxqQQEQR0EYECMiBEG0mgI2AgAgBEIANwIEIARBDGoiByAGEFsgAyAENgIsIAMgBzYCKCADIAMpAig3AwggACADQQhqEGogAyAGNgI8IANBPGoQKSACKAIAIgAEQCACIAA2AgQgAigCCBogABAiCyAFKAIAIgBFDQAgBSAANgIEIAUoAggaIAAQIgsgA0FAayQAC5MDAgN/BHwjAEFAaiIDJAACQAJAAkAgASsDACIGRAAAAAAAAAAAYw0AIAErAwgiB0QAAAAAAAAAAGMNACAGIAaiIAcgB6KgRAAAAAAAAAAAYg0BCyAAEOMBDAELIANBwAAQIyIBNgIwIAMgAUFAayIENgI4IAMgBDYCNCACBEAgB0QAAAAAAADgP6IiCJohByAGRAAAAAAAAOA/oiIJmiEGCyABIAc5AzggASAJOQMwIAEgBzkDKCABIAY5AyAgASAIOQMYIAEgBjkDECABIAg5AwggASAJOQMAIANBEGogA0EwahA8IQEgA0EANgIkIANCADcCHCADQRxqIgQgASABQQxqQQEQR0EYECMiAkG0mgI2AgAgAkIANwIEIAJBDGoiBSAEEFsgAyACNgIsIAMgBTYCKCADIAMpAig3AwggACADQQhqEGogAyAENgI8IANBPGoQKSABKAIAIgAEQCABIAA2AgQgASgCCBogABAiCyADKAIwIgBFDQAgAyAANgI0IAMoAjgaIAAQIgsgA0FAayQACzUBAX8gASAAKAIEIgJBAXVqIQEgACgCACEAIAEgAkEBcQR/IAEoAgAgAGooAgAFIAALEQAAC0YBAn9BCBAjIQFBIBAjIgBCADcCDCAAQfiUAjYCACAAQgA3AgQgAEIANwIUIABBADYCHCABIAA2AgQgASAAQQxqNgIAIAELSwEBf0HYnwIoAgAiAARAA0AgACgCACAAQRhqEMoCIAAQIiIADQALC0HQnwIoAgAhAEHQnwJBADYCACAABEBB1J8CKAIAGiAAECILCw0AIAAEQCAAEC8QIgsLBgBBpJoCCwYAQcjwAQsUACAAQQRqQQAgASgCBEH+kwFGGwueCgIGfwt8IwBB0ABrIgQkACAAKAIYIQggACgCBCgCACIFIAEoAgAiAUEFdGpCgICAgICAgPg/NwMYAkAgAi0AACADLQAARg0AIAAoAggiBygCAEF/RgRAIAcgATYCAAwBCyAHKAIEQX9GBEAgByABNgIEDAELIAdBfjYCAAsgAysDCCIMIQoCQCAMRAAAAAAAAAAAYg0AIAMrAxAiCkQAAAAAAAAAAGINACADKwMYIQoLIAJBCGohByACKwMIIQsCQAJAIApEAAAAAAAAAABhDQAgCyEKAkAgC0QAAAAAAAAAAGINACACKwMQIgpEAAAAAAAAAABiDQAgAisDGCEKCyAKRAAAAAAAAAAAYQ0ARAAAAAAAAPA/IQsMAQsCQCALRAAAAAAAAAAAYg0AIAIrAxAiC0QAAAAAAAAAAGINACACKwMYIQsLAkAgC0QAAAAAAAAAAGIEQCAAKAIMIgUgBykDEDcDECAFIAcpAwg3AwggBSAHKQMANwMAIAAoAgQoAgAhBQwBCwJAIAxEAAAAAAAAAABiDQAgAysDECIMRAAAAAAAAAAAYg0AIAMrAxghDAsgACgCECIGKAIAIQkgDEQAAAAAAAAAAGIEQCAJQQBODQEgBiABNgIADAELIAlBAE4NACAGQX42AgALIAAoAgwiBisDACEKIAYrAwghDCAGKwMQIQ0gBSABQQV0aiIGIAAoAhQrAwAiCzkDGCAGIA05AxAgBiAMOQMIIAYgCjkDAAsgCCABENYCBEAgACgCDCIGKwMAIQogBisDCCEMIAYrAxAhDSAFIAFBBXRqIgYgACgCHCsDACILOQMYIAYgDTkDECAGIAw5AwggBiAKOQMACwJAIAtEAAAAAAAAAABjDQAgBSABQQV0aiEFIAMrAxgiCyADKwMIIgogCqIgAysDECIMIAyioCALIAuioJ8iDqNEAAAAAAAAAAAgCiAOoyIQvUL///////////8Ag0KAgICAgICA+P8AVCIDGyACKwMYIg0gAisDCCIRIBGiIAIrAxAiEiASoqAgDSANoqCfIg+jRAAAAAAAAAAAIBEgD6MiE71C////////////AINCgICAgICAgPj/AFQiAhuiIAwgDqNEAAAAAAAAAAAgAxsgEiAPo0QAAAAAAAAAACACG6IgEEQAAAAAAAAAACADGyATRAAAAAAAAAAAIAIbokQAAAAAAAAAAKCgoEQep+hILv/vP2QEQCAEQTBqIAggByABEOcBIAUgBCkDSDcDGCAFIAQpA0A3AxAgBSAEKQM4NwMIIAUgBCkDMDcDAAwBCyAAKAIgKAIAIAFqQQE6AAAgACgCCEF+NgIAIAgoAkgiAiAIKAJYIAFBAnRqIgNBeEEEIAFBA29BAkYbaigCAEEYbGoiACsDECEOIAArAwAhDyACIAMoAgBBGGxqIgErAxAhECABKwMAIRMgBCAAKwMIIAErAwihIhQ5AyAgBCAPIBOhIg85AxggBCAOIBChIg45AyggBCAMIBGiIAogEqKhIhBEAAAAAAAA8L9EAAAAAAAA8D8gCyASoiAMIA2ioSIMIA+iRAAAAAAAAAAAoCAKIA2iIAsgEaKhIgogFKKgIBAgDqKgRAAAAAAAAAAAYxsiC6I5AxAgBCAKIAuiOQMIIAQgDCALojkDACAEQTBqIAQgBEEYahCcASAFIAQpA0g3AxggBSAEKQNANwMQIAUgBCkDODcDCCAFIAQpAzA3AwALIARB0ABqJAALMwAgAUHsmQI2AgAgASAAKQIENwIEIAEgACkCDDcCDCABIAApAhQ3AhQgASAAKQIcNwIcCzsBAX9BJBAjIgFB7JkCNgIAIAEgACkCBDcCBCABIAApAgw3AgwgASAAKQIUNwIUIAEgACkCHDcCHCABCwYAQdyZAgsUACAAQQRqQQAgASgCBEG6kQFGGwsVACABQaSZAjYCACABIAApAgQ3AgQLHQEBf0EMECMiAUGkmQI2AgAgASAAKQIENwIEIAELBgBBlJkCCxQAIABBBGpBACABKAIEQZqPAUYbC6EFAgp8A38jAEEgayIBJAACfEQAAAAAAAAAACAAKAIEIhAoAqgBIg4gAigCAEEYbGoiDysDACAOIAMoAgBBGGxqIg4rAwCiRAAAAAAAAAAAoCAPKwMIIA4rAwiioCAPKwMQIA4rAxCioCIERAAAAAAAAPA/Zg0AGkS17z+35KuBQCAERAAAAAAAAPC/ZQ0AGiAEEF1EAAAAAACAZkCiCyEEIAAoAggrAwAgBEQYLURU+yEJQKNjBEAgACgCDCABQgA3AxggAUIANwMQIAFCADcDCCABQQhqEMQBIAAoAhAgECgC2AEgAygCAEEEdGoQPQsgACgCFCABIAAoAgwiDigCBCAOKAIAa0EYbUEBazYCCCABQQhqED0CQCADKwMIIgS9Qv///////////wCDQv/////////3/wBYBEAgAysDECIIIAIrAxgiCaIgAysDGCIKIAIrAxAiC6KhIgUgBCALoiAIIAIrAwgiDKKhIgYgBqIgBSAFoiAKIAyiIAQgCaKhIgUgBaKgoJ8iDaMiB0QAAAAAAAAAACAHvUL///////////8Ag0KAgICAgICA+P8AVCICGyEHIAUgDaNEAAAAAAAAAAAgAhshBSAGIA2jRAAAAAAAAAAAIAIbIQYCfEQAAAAAAAAAACAJIAqiIAggC6IgBCAMokQAAAAAAAAAAKCgoCIERAAAAAAAAPA/Zg0AGkQYLURU+yEJQCAERAAAAAAAAPC/ZQ0AGiAEEF0LIQQgACgCDCgCBCIAQQhrIgIgBiAEoiACKwMAoDkDACAAQRBrIgIgBSAEoiACKwMAoDkDACAAQRhrIgAgByAEoiAAKwMAoDkDAAwBCyADIAIpAxg3AxggAyACKQMQNwMQIAMgAikDCDcDCAsgAUEgaiQACykAIAFB3JgCNgIAIAEgACkCBDcCBCABIAApAgw3AgwgASAAKAIUNgIUCzEBAX9BGBAjIgFB3JgCNgIAIAEgACkCBDcCBCABIAApAgw3AgwgASAAKAIUNgIUIAELBgBBzJgCCxQAIABBBGpBACABKAIEQZ+NAUYbCxUAIAFBlJgCNgIAIAEgACkCBDcCBAsdAQF/QQwQIyIBQZSYAjYCACABIAApAgQ3AgQgAQsVAQF/QcAAECMiAEEAQcAA/AsAIAALZAEBf0EwECMiAEKAgICAgICAeDcDKCAAQoCAgICAgIB4NwMgIABCgICAgICAgHg3AxggAEKAgICAgICA+P8ANwMQIABCgICAgICAgPj/ADcDCCAAQoCAgICAgID4/wA3AwAgAAtGAQF/QSAQIyIAQoCAgICAgIB4NwMYIABCgICAgICAgHg3AxAgAEKAgICAgICA+P8ANwMIIABCgICAgICAgPj/ADcDACAACyYBAX9BIBAjIgBCADcDGCAAQgA3AxAgAEIANwMIIABCADcDACAACxEAIABBACABKAIEQeCFAUYbCxIAIAAoAgwiAARAIAAQOhAiCwsGAEHclwILHwEBf0EYECMiAEIANwMQIABCADcDCCAAQgA3AwAgAAsUACAAQQhqQQAgASgCBEHJhAFGGwumAgELfCACKwMQIgggASsDECIEIAErAwAiBSAFoiABKwMIIgYgBqKgIAQgBKKgnyIHoyIEIAggBKIgAisDCCIMIAYgB6MiBqIgAisDACIJIAUgB6MiBaJEAAAAAAAAAACgoKAiB6KhIgggAysDECIKIAQgBSADKwMAIguiRAAAAAAAAAAAoCAGIAMrAwgiDaKgIAQgCqKgIgSioSIKoSIOIA6iIAkgBSAHoqEiCSALIAUgBKKhIgWhIgsgC6IgDCAGIAeioSIHIA0gBiAEoqEiBKEiBiAGoqCgnyAIIAiiIAkgCaIgByAHoqCgnyAKIAqiIAUgBaIgBCAEoqCgn6BEAAAAAAAA4D+ioEQAAAAAAAAIQKIgACsDCEQAAAAAAAAQQKKjn/wCCxUAIAFBrJcCNgIAIAEgACkDCDcDCAsdAQF/QRAQIyIBQayXAjYCACABIAApAwg3AwggAQsGAEGclwILFAAgAEEIakEAIAEoAgRBqYMBRhsLLQEBfCABKwMAIgQgBKIgASsDCCIEIASioCABKwMQIgQgBKKgnyAAKwMIo/wCCxUAIAFB7JYCNgIAIAEgACkDCDcDCAsdAQF/QRAQIyIBQeyWAjYCACABIAApAwg3AwggAQsGAEHclgILFAAgAEEEakEAIAEoAgRBlYIBRhsLFQAgAUGslgI2AgAgASAAKAIENgIECx0BAX9BCBAjIgFBrJYCNgIAIAEgACgCBDYCBCABCw8AIABBhJYCNgIAIAAQIgsNACAAQYSWAjYCACAAC7MJAwx/BnwBfiMAQTBrIggkACAIQRhqIgMgACABQQIQ6AECQCADEMABRQ0AIAhBEGogAEEAECsQKiAIKAIQIQkgCEEIaiABQQAQKxAqIAgoAgghCkEAIQAjAEFAaiIEJAAgBEEANgIwIARCADcCKCAEQQA2AiAgBEIANwIYIAogBEEoaiAEQRhqQQAQzwIgBCgCKCEBIAQoAiwiAwRAIAEgA0EwbGohDSABIQADQCAAIAIgACsDKKAiECAAKwMQIAKhIhEgECARZCIOGzkDKCAAIAIgACsDIKAiEiAAKwMIIAKhIhMgEiATZCIFGzkDICAAIAIgACsDGKAiFCAAKwMAIAKhIg8gDyAUYyIDGzkDGCAAIBEgECAOGzkDECAAIBMgEiAFGzkDCCAAIA8gFCADGzkDACAAQTBqIgAgDUcNAAsgBCgCLCEACyAEQoCAgICAgID4/wA3AxAgBCAKNgIMIAQgCTYCCCAEIAA2AjwgBCABNgI4IwBBIGsiByQAIAkoAowCIgMEQCAJKQLoASEVIAkoAogCIQEgByAEQQhqNgIcIAcgAzYCGCAHIAE2AhQgByAVNwIMIAcgBEE4ajYCCEEAIQEjAEEgayIGJAAgBiAHKAIINgIIIAYgBygCDDYCDCAGIAcoAhA2AhAgBiAHKAIUNgIUIAYgBygCGDYCGCAGIAcoAhw2AhwgAARAA0AjAEGAAmsiCiQAAkAgBigCCCgCACABQTBsaiIDKwMAIhBEAAAAAAAA8H9hDQAgAysDKCERIAMrAyAhEiADKwMYIRMgAysDECEUIAMrAwghDyAGKAIcQQhqIQ5BASEFQX8hCwNAIAYoAhQgBUEBa0ECbUEDdGoiAygCBCEMQQAhDQJ/AkAgBigCDCIFIAMoAgAiCUEwbGoiAysDACATZUUNACADKwMIIBJlRQ0AIAMrAxAgEWVFDQAgAysDGCAQZkUNACADKwMgIA9mRQ0AIAMrAyggFGZFDQAgCUEBcUUEQCAGKAIcIAEgCUEBdSAOEIIEIAYoAgwhBQsgCUGBgICAeHFBAUYMAQtBAAshAwJAIAUgDEEwbGoiBSsDACATZUUNACAFKwMIIBJlRQ0AIAUrAxAgEWVFDQAgBSsDGCAQZkUNACAFKwMgIA9mRQ0AIAUrAyggFGZFDQAgDEEBcUUEQCAGKAIcIAEgDEEBdSAOEIIECyAMQYGAgIB4cUEBRiENCyADIA1yRQRAIAtBAEgNAiAKIAtBAnRqKAIAIQUgC0EBayELDAELIAkgDCADGyEFIANFIA1Fcg0AIAogC0EBaiILQQJ0aiAMNgIADAALAAsgCkGAAmokACABQQFqIgEgAEcNAAsLIAZBIGokAAsgB0EgaiQAIAQrAxAhDyAEKAIYIgAEQCAAECILIAQoAigiAARAIAAQIgsgBEFAayQAIAIgAqIiAiAPIAIgD2MbnyEPAkAgCCgCDCIBRQ0AIAEgASgCBCIAQQFrNgIEIAANACABIAEoAgAoAggRAAAgARAkCyAIKAIUIgFFDQAgASABKAIEIgBBAWs2AgQgAA0AIAEgASgCACgCCBEAACABECQLIAhBGGoQKBogCEEwaiQAIA8L/wICAn8BfiMAQUBqIgIkACACQTRqIAFBEGoQfyACQSxqIAEgAigCNBArECoCQCACKAIsKAJEIgEEQCAAIAEQRgwBC0GoAhAjIgFBoJACNgIAIAFCADcCBCABQRBqEDshAyACIAE2AiggAiADNgIkIAIgAigCLCkCSDcCHCADIAJBHGogAigCNBD+AyACQQxqIAJBJGoQWSACIAIpAgwiBDcCFCACQgA3AgwgAiAENwMAIAAgAhBDAkAgAigCECIARQ0AIAAgACgCBCIBQQFrNgIEIAENACAAIAAoAgAoAggRAAAgABAkCyACKAIoIgBFDQAgACAAKAIEIgFBAWs2AgQgAQ0AIAAgACgCACgCCBEAACAAECQLAkAgAigCMCIARQ0AIAAgACgCBCIBQQFrNgIEIAENACAAIAAoAgAoAggRAAAgABAkCwJAIAIoAjgiAEUNACAAIAAoAgQiAUEBazYCBCABDQAgACAAKAIAKAIIEQAAIAAQJAsgAkFAayQAC/YFAQ9/IwBBEGsiBiQAIAZBCGogAUEAECsQKiAGKAIIIQMjAEGwAWsiASQAIAMoAlwhAiABQQA2AqgBIAFCADcCoAEgAUGgAWogAkEBdiICEDkgASACNgKkASADKAJcIgsEQCADKAJ4IQwgAygCWCENIAMoAqgBIQcgAygCaCEIIAEoAqABIQ5BACECA0ACQCAHIAggCCACQQJ0IglqKAIAIgpBAnRqKAIAQQNtQRhsaisDEEQAAAAAAAAAAGZFDQAgByAKQQNtQRhsaisDEEQAAAAAAAAAAGNFDQAgCSANaiIFQXhBBCACQQNvQQJGG2ooAgAhDyAFKAIAIRAgDiAEQQR0aiIFIAkgDGooAgA2AgwgBSAKNgIIIAUgDzYCBCAFIBA2AgAgBEEBaiEECyACQQFqIgIgC0cNAAsLIAFCADcDmAEgAUIANwOQASABQgA3AzAgAUIANwM4IAFBoAFqIAQgAUEwahCVAiABQfgAaiICIAEoAqABIgQgBCABKAKkAUEEdGpBABD0AiABQgA3A0ggAUKAgICAgICA+D83A0AgAUIANwNQIAFCADcDYCABQoCAgICAgID4PzcDWCABQgA3A2ggASABKQKgATcCcCABIAFBQGtBMPwKAAAgAUGEAWogAiABQfAAaiIEIANByABqIAEQxwQgASACNgJwIAQQKSAAQQA2AgggAEIANwIAIAEoAoQBIgMgASgCiAEiBEcEQANAIAFBADYCgAEgAUIANwJ4IAMoAgAiAiADKAIEIgVHBEADQCABQfgAaiACEEwgAkEYaiICIAVHDQALCyAAIAFB+ABqEHYgASgCeCICBEAgASACNgJ8IAEoAoABGiACECILIANBDGoiAyAERw0ACwsgASABQYQBajYCeCABQfgAahApIAEoAqABIgAEQCAAECILIAFBsAFqJAACQCAGKAIMIgBFDQAgACAAKAIEIgFBAWs2AgQgAQ0AIAAgACgCACgCCBEAACAAECQLIAZBEGokAAuODgMPfwl8An4jAEEQayILJAAgC0EIaiABQQAQKxAqIAsoAgghBiMAQcACayIBJAAgASAGKQMINwM4IAEgBikDADcDMCABIAYpAyA3AxAgASAGKQMYNwMIIAFBADYCKCABQgA3AiAgAUEgakGAARCfASABIAEoAiQiA0EBajYCJCABKQMwIRsgASkDOCEcIAEoAiAgA0EwbGoiAyACOQMQIAMgHDcDCCADIBs3AwAgAyABKQMQNwMgIAMgASkDCDcDGCADIAI5AyggAUIANwMQIAFCADcDCCABQYCAgPwDNgIYAkACQCAGKAKMAkUNACABKAIkIg9FDQAgASgCICEQIAYoAogCIREgBigC6AEhDgNAAkAgECAKQTBsaiIDKwMAIhVEAAAAAAAA8H9hDQAgAysDKCEWIAMrAyAhFyADKwMYIRggAysDECEZIAMrAwghGkF/IQRBASEDA0AgESADQQFrQQJtQQN0aiIDKAIEIQhBACEFAn9BACAOIAMoAgAiB0EwbGoiAysDACAYZUUNABpBACADKwMIIBdlRQ0AGkEAIAMrAxAgFmVFDQAaQQAgAysDGCAVZkUNABpBACADKwMgIBpmRQ0AGkEAIAMrAyggGWZFDQAaAkAgB0EBcQ0AIAEgB0EBdSIDNgK8AiABQQI2ArgCIAFCgICAgBA3ArACIAYoAlggA0EMbGohCSAGKAJIIQxEAAAAAAAA8P8hEkQAAAAAAADwfyETQQAhAwNAIAwgCSABQbACaiINIANqKAIAQQJ0aigCAEEYbGorAxAiFCASIBIgFGMbIRIgFCATIBMgFGQbIRMgA0EEaiIDQQxHDQALIAIgE2ZFIAIgEmNFcg0AIA0gAUEIaiABQbwCaiIDIAMQzwELIAdBgYCAgHhxQQFGCyEJAkAgDiAIQTBsaiIDKwMAIBhlRQ0AIAMrAwggF2VFDQAgAysDECAWZUUNACADKwMYIBVmRQ0AIAMrAyAgGmZFDQAgAysDKCAZZkUNAAJAIAhBAXENACABIAhBAXUiAzYCvAIgAUECNgK4AiABQoCAgIAQNwKwAiAGKAJYIANBDGxqIQUgBigCSCEMRAAAAAAAAPD/IRJEAAAAAAAA8H8hE0EAIQMDQCAMIAUgAUGwAmoiDSADaigCAEECdGooAgBBGGxqKwMQIhQgEiASIBRjGyESIBQgEyATIBRkGyETIANBBGoiA0EMRw0ACyACIBNmRSACIBJjRXINACANIAFBCGogAUG8AmoiAyADEM8BCyAIQYGAgIB4cUEBRiEFCyAFIAlyRQRAIARBAEgNAiABQTBqIARBAnRqKAIAIQMgBEEBayEEDAELIAcgCCAJGyEDIAlFIAVFcg0AIAFBMGogBEEBaiIEQQJ0aiAINgIADAALAAsgCkEBaiIKIA9HDQALIAEoAhQgAEEANgIIIABCADcCAEUNAQNAIAEoAhAoAgghCEEAIQMgAUEANgK4AiABQgA3ArACIAFBAjYCOCABQoCAgIAQNwIwIAYoAlggCEEMbGohBSAGKAJIIQcCQANAIAIgByAFIAFBMGogA2ooAgAiBEECdGooAgBBGGxqKwMQYwRAIAcgBUEEQQggBEEBRhtBACAEG0Hw+ABqKAIAIgRBAnRqKAIAQRhsaisDECACZQ0CCyADQQRqIgNBDEcNAAtBACEECyABIAg2ArwCA0AgAUEIaiIDIQcgAyABQbwCahCiAiEFIwBBEGsiAyQAIAUoAgAaIANBBGogByAFEMIEIAMoAgQhBSADQQA2AgQgBQRAIAUQIgsgA0EQaiQAIAIgBigCSCIHIAYoAlgiCkF4QQQgASgCvAJBA2wiCSAEaiIDQQNvIgVBAkYbaiADQQJ0aigCAEEYbGorAxBmBEBBBEEIIARBAUYbQQAgBBtB8PgAaigCACAJaiIDQQNvIQULIAcgCiADQQJ0IglqIgRBeEEEIAVBAkYbaigCAEEYbGoiAysDACETIAcgBCgCAEEYbGoiBCsDACEUIAEgAysDCCACIAQrAxAiEqEgAysDECASoaMiEqIgBCsDCEQAAAAAAADwPyASoSIVoqA5AzggASATIBKiIBQgFaKgOQMwIAFBsAJqIgUgAUEwahBMIAEgBigCaCAJaigCACIEQQNtIgM2ArwCQQRBCCAEIANBA2xrIgRBAUYbQQAgBBtB8PgAaigCACEEIAMgCEcNAAsgACAFEHYgASgCsAIiAwRAIAEgAzYCtAIgASgCuAIaIAMQIgsgASgCFA0ACwwBCyAAQQA2AgggAEIANwIACyABQQhqEJUBIAEoAiAiAARAIAAQIgsgAUHAAmokAAJAIAsoAgwiAEUNACAAIAAoAgQiAUEBazYCBCABDQAgACAAKAIAKAIIEQAAIAAQJAsgC0EQaiQAC5UCAQF/IwBBIGsiAyQAIANBGGogAUEQahB/IANBEGogASADKAIYECsQKgJAIAMoAhAoAkQiAQRAIAAgARBGDAELIANBCGogAiADKAIYECsQKgJAIAMoAggiASgCRCICBEAgACACEEYMAQsgACADKAIQIAFBASADKAIYEJQECyADKAIMIgBFDQAgACAAKAIEIgFBAWs2AgQgAQ0AIAAgACgCACgCCBEAACAAECQLAkAgAygCFCIARQ0AIAAgACgCBCIBQQFrNgIEIAENACAAIAAoAgAoAggRAAAgABAkCwJAIAMoAhwiAEUNACAAIAAoAgQiAUEBazYCBCABDQAgACAAKAIAKAIIEQAAIAAQJAsgA0EgaiQAC5UCAQF/IwBBIGsiAyQAIANBGGogAUEQahB/IANBEGogASADKAIYECsQKgJAIAMoAhAoAkQiAQRAIAAgARBGDAELIANBCGogAiADKAIYECsQKgJAIAMoAggiASgCRCICBEAgACACEEYMAQsgACADKAIQIAFBACADKAIYEJQECyADKAIMIgBFDQAgACAAKAIEIgFBAWs2AgQgAQ0AIAAgACgCACgCCBEAACAAECQLAkAgAygCFCIARQ0AIAAgACgCBCIBQQFrNgIEIAENACAAIAAoAgAoAggRAAAgABAkCwJAIAMoAhwiAEUNACAAIAAoAgQiAUEBazYCBCABDQAgACAAKAIAKAIIEQAAIAAQJAsgA0EgaiQAC3EBA38jAEGQAWsiBCQAIARByABqIgUgARDkAiAEQRhqIgYgBUEw/AoAACAEIAIpAxA3AxAgBCACKQMINwMIIAQgAikDADcDACAEQfgAaiICIAYgBCADEJYEIAAgASACQQIQ6AEgAhAoGiAEQZABaiQAC8oDAgN/AX4jAEHQAGsiAyQAIANBxABqIAFBEGoQfyADQTxqIAEgAygCRBArECoCQCADKAI8IgQoAkQiAQRAIAAgARBGDAELQagCECMiAUGgkAI2AgAgAUIANwIEIAFBEGogBBA3IQQgAyABNgI4IAMgBDYCNAJAIAEoAswBRQ0AIAMgApk5AyAgA0GslwI2AhggAyADQRhqIgU2AiggBCAFQQEgAygCRBDRAiAFIAMoAigiAUYEf0EQBSABRQ0BQRQLIQQgASABKAIAIARqKAIAEQAACyADQQhqIANBNGoQWSADIAMpAggiBjcCECADQgA3AgggAyAGNwMAIAAgAxBDAkAgAygCDCIARQ0AIAAgACgCBCIBQQFrNgIEIAENACAAIAAoAgAoAggRAAAgABAkCyADKAI4IgBFDQAgACAAKAIEIgFBAWs2AgQgAQ0AIAAgACgCACgCCBEAACAAECQLAkAgAygCQCIARQ0AIAAgACgCBCIBQQFrNgIEIAENACAAIAAoAgAoAggRAAAgABAkCwJAIAMoAkgiAEUNACAAIAAoAgQiAUEBazYCBCABDQAgACAAKAIAKAIIEQAAIAAQJAsgA0HQAGokAAvCAwIEfwF+IwBB0ABrIgMkAEEQIQUgA0HEAGogAUEQahB/IANBPGogASADKAJEECsQKgJAIAMoAjwiBCgCRCIBBEAgACABEEYMAQtBqAIQIyIBQaCQAjYCACABQgA3AgQgAUEQaiAEEDchBCADIAE2AjggAyAENgI0IAMgApk5AyAgA0HslgI2AhggAyADQRhqIgY2AiggBCAGQQAgAygCRBDRAgJAIAYgAygCKCIBRwRAQRQhBSABRQ0BCyABIAEoAgAgBWooAgARAAALIANBCGogA0E0ahBZIAMgAykCCCIHNwIQIANCADcCCCADIAc3AwAgACADEEMCQCADKAIMIgBFDQAgACAAKAIEIgFBAWs2AgQgAQ0AIAAgACgCACgCCBEAACAAECQLIAMoAjgiAEUNACAAIAAoAgQiAUEBazYCBCABDQAgACAAKAIAKAIIEQAAIAAQJAsCQCADKAJAIgBFDQAgACAAKAIEIgFBAWs2AgQgAQ0AIAAgACgCACgCCBEAACAAECQLAkAgAygCSCIARQ0AIAAgACgCBCIBQQFrNgIEIAENACAAIAAoAgAoAggRAAAgABAkCyADQdAAaiQAC8cDAgJ/AX4jAEHQAGsiAyQAIANBxABqIAFBEGoQfyADQTxqIAEgAygCRBArECoCQCADKAI8IgQoAkQiAQRAIAAgARBGDAELQagCECMiAUGgkAI2AgAgAUIANwIEIAFBEGogBBA3IQQgAyABNgI4IAMgBDYCNAJAIAJBAkgNACADIAI2AhwgA0GslgI2AhggAyADQRhqIgI2AiggBCACQQAgAygCRBDRAiACIAMoAigiAUYEf0EQBSABRQ0BQRQLIQIgASABKAIAIAJqKAIAEQAACyADQQhqIANBNGoQWSADIAMpAggiBTcCECADQgA3AgggAyAFNwMAIAAgAxBDAkAgAygCDCIARQ0AIAAgACgCBCIBQQFrNgIEIAENACAAIAAoAgAoAggRAAAgABAkCyADKAI4IgBFDQAgACAAKAIEIgFBAWs2AgQgAQ0AIAAgACgCACgCCBEAACAAECQLAkAgAygCQCIARQ0AIAAgACgCBCIBQQFrNgIEIAENACAAIAAoAgAoAggRAAAgABAkCwJAIAMoAkgiAEUNACAAIAAoAgQiAUEBazYCBCABDQAgACAAKAIAKAIIEQAAIAAQJAsgA0HQAGokAAudBQMIfwF8AX4jAEFAaiIEJAAgBEE0aiABQQAQKxAqAkAgBCgCNCIGKAJEIgUEQCAAIAUQRgwBC0GoAhAjIgVBoJACNgIAIAVCADcCBCAFQRBqIAYQNyEGIAQgBTYCMCAEIAY2AiwCQCABEMABDQAjAEEQayIBJAAgBEEgaiIFQQA2AgggBUIANwIAIAYoAlwEQEQtQxzr4jYaPyACIAJELUMc6+I2Gj9jG0QYLURU+yEJQKJEAAAAAACAZkCjIQwDQAJAIAdBAnQiCCAGKAJYaiIJKAIAIAlBeEEEIAdBA29BAkYbaigCAE4NACAGKAKoASIKIAdBA25BGGxqIgkrAwAgCiAGKAJoIAhqKAIAIgtBA25BGGxqIggrAwCiRAAAAAAAAAAAoCAJKwMIIAgrAwiioCAJKwMQIAgrAxCioCICRAAAAAAAAPA/Zg0AIAJEAAAAAAAA8L9lBHxEGC1EVPshCUAFIAIQXQsgDGRFDQAgASADOQMIIAEgBzYCACAFIAEQTCABIAM5AwggASALNgIAIAUgARBMCyAHQQFqIgcgBigCXEkNAAsLIAFBEGokACAGIAVBABDpAyAEKAIgIgFFDQAgBCABNgIkIAQoAigaIAEQIgsgBEEQaiAEQSxqEFkgBCAEKQIQIg03AhggBEIANwIQIAQgDTcDCCAAIARBCGoQQwJAIAQoAhQiAEUNACAAIAAoAgQiAUEBazYCBCABDQAgACAAKAIAKAIIEQAAIAAQJAsgBCgCMCIARQ0AIAAgACgCBCIBQQFrNgIEIAENACAAIAAoAgAoAggRAAAgABAkCwJAIAQoAjgiAEUNACAAIAAoAgQiAUEBazYCBCABDQAgACAAKAIAKAIIEQAAIAAQJAsgBEFAayQAC7AWAwx/C3wBfiMAQTBrIgckACAHQSRqIAFBABArECoCQCAHKAIkIgYoAkQiCQRAIAAgCRBGDAELQagCECMiCUGgkAI2AgAgCUIANwIEIAlBEGogBhA3IQYgByAJNgIgIAcgBjYCHCABEMABRQRAAkAgAiEJIwBBkAJrIgMkACAGQQA2ArwBIAYoAkwhAiAGKAJcIQEgBkG4AWoiDBCTASADQQA2AkAgA0IANwI4IANBOGogARBVIAMgATYCPCADQQA2AjAgA0IANwIoIANBKGogAUEAEIEBIANCgICAgICAgPi/fzcDICADQoCAgICAgICEQDcDGCADQQhqIAYQ8AMCQCACBEAgAygCCCIKIAJBAnRqIQ0DQCAKKAIAIQIgA0J/NwLIASADQX82AsQBIAMgBjYCmAEgAyAJNgKUASADQaSZAjYCkAEgA0IANwO4ASADQgA3A7ABIANCADcDqAEgAyADQZABaiIBNgKgAUEkECMiBSAGNgIYIAVB7JkCNgIAIAUgA0EoajYCICAFIANBIGo2AhwgBSADQRhqNgIUIAUgA0HEAWo2AhAgBSADQagBajYCDCAFIANByAFqNgIIIAUgA0E4ajYCBCADIAI2AtABIANB8AFqIAEgA0HQAWoQ6gMgAiEBA0AgA0F+QQEgBigCaCABQQJ0aigCACIEQQNvQQJGGyAEaiIENgJ4IAMoAqABIghFDQMgA0HQAWoiCyAIIANB+ABqIg4gCCgCACgCGBEDACADIAE2AnggBSAOIANB8AFqIAsgBSgCACgCGBEFACADIAMpA9ABNwPwASADIAMpA9gBNwP4ASADIAMpA+ABNwOAAiADIAMpA+gBNwOIAiAEIgEgAkcNAAsgBSAFKAIAKAIUEQAAAkAgAygCoAEiASADQZABakYEf0EQBSABRQ0BQRQLIQQgASABKAIAIARqKAIAEQAACwJAAkAgAygCxAEiAUF/Rg0AAkAgAysDqAEiD0QAAAAAAAAAAGINACADKwOwASIPRAAAAAAAAAAAYg0AIAMrA7gBIQ8LIA9EAAAAAAAAAABhBEAgAyAGKAKYASAGKAJYIAJBAnRqKAIAQRhsaiIBKQMQNwPgASADIAEpAwg3A9gBIAMgASkDADcD0AEgAygCOCEFIAIhAQNAIAVBfkEBIAYoAmggAUECdGooAgAiAUEDb0ECRhsgAWoiAUEFdGoiBCsDGEQAAAAAAADwv2IEQCADQfABaiAGIANB0AFqIAEQ5wEgBCADKQOIAjcDGCAEIAMpA4ACNwMQIAQgAykD+AE3AwggBCADKQPwATcDAAsgASACRw0ACwwCCyABQQBIDQAgA0HQAWogBkF+QQEgBigCaCABQQJ0aigCACICQQNvQQJGGyACaiAJENcCA0ACQCADKAI4IAFBBXRqIgIrAxhEAAAAAAAACMBiDQAgAisDECEQIAIrAwghESACKwMAIhMhDwJAIBNEAAAAAAAAAABiDQAgESIPRAAAAAAAAAAAYg0AIBAhDwsgAysDuAEgECAPRAAAAAAAAAAAYSIEGyIPIAMrA6gBIBMgBBsiECAQoiADKwOwASARIAQbIhEgEaKgIA8gD6KgnyIUo0QAAAAAAAAAACAQIBSjIhe9Qv///////////wCDQoCAgICAgID4/wBUIgQbIAMrA+ABIhMgAysD0AEiEiASoiADKwPYASIVIBWioCATIBOioJ8iFqNEAAAAAAAAAAAgEiAWoyIYvUL///////////8Ag0KAgICAgICA+P8AVCIFG6IgESAUo0QAAAAAAAAAACAEGyAVIBajRAAAAAAAAAAAIAUboiAXRAAAAAAAAAAAIAQbIBhEAAAAAAAAAAAgBRuiRAAAAAAAAAAAoKCgRB6n6Egu/+8/ZARAIANB8AFqIAYgA0HQAWogARDnASACIAMpA4gCNwMYIAIgAykDgAI3AxAgAiADKQP4ATcDCCACIAMpA/ABNwMADAELIAYoAkgiBSAGKAJYIAFBAnRqIghBeEEEIAFBA29BAkYbaigCAEEYbGoiBCsDECEUIAQrAwAhFiAFIAgoAgBBGGxqIgUrAxAhFyAFKwMAIRggAyAEKwMIIAUrAwihIhk5A4ABIAMgFiAYoSIWOQN4IAMgFCAXoSIUOQOIASADIBEgEqIgECAVoqEiF0QAAAAAAADwv0QAAAAAAADwPyAPIBWiIBEgE6KhIhEgFqJEAAAAAAAAAACgIBAgE6IgDyASoqEiECAZoqAgFyAUoqBEAAAAAAAAAABjGyIPojkDcCADIBAgD6I5A2ggAyARIA+iOQNgIANB8AFqIANB4ABqIANB+ABqEJwBIAIgAykDiAI3AxggAiADKQOAAjcDECACIAMpA/gBNwMIIAIgAykD8AE3AwALIANB8AFqIAYgASAJENcCAkAgAysD8AEiD0QAAAAAAAAAAGINACADKwP4ASIPRAAAAAAAAAAAYg0AIAMrA4ACIQ8LIA9EAAAAAAAAAABiBEAgAyADKQOAAjcD4AEgAyADKQP4ATcD2AEgAyADKQPwATcD0AELIAYoAmhBfEEIIAFBA28baiABQQJ0aigCACIBIAMoAsQBRw0ACwsgAygCyAEiAUEASA0AIAMoAswBIgJBAEgNACAGKAJIIgQgBigCWCILIAFBAnRqIghBeEEEIAFBA3BBAkYbaigCAEEYbGoiBSsDECERIAUrAwAhECAEIAgoAgBBGGxqIggrAxAhEyAIKwMAIRIgAyAFKwMIIAgrAwihIg85A9gBIAMgECASoSIQOQPQASADIBEgE6EiETkD4AEgBCALIAJBAnRqIghBeEEEIAJBA3BBAkYbaigCAEEYbGoiBSsDECEVIAUrAwAhEiAEIAgoAgBBGGxqIgQrAxAhFCAEKwMAIRYgAyAFKwMIIAQrAwihIhM5A4ABIAMgEiAWoSISOQN4IAMgFSAUoSIVOQOIASADIBAgECAQoiAPIA+ioCARIBGioJ8iEKMgEiASIBKiIBMgE6KgIBUgFaKgnyISo6EiFDkDYCADIA8gEKMgEyASo6EiDzkDaCADIBEgEKMgFSASo6EiEDkDcCADQfABaiIFIANB4ABqIANB0AFqEJwBIAMoAjgiCCABQQV0aiIEIAMpA4gCNwMYIAQgAykDgAI3AxAgBCADKQP4ATcDCCAEIAMpA/ABNwMAIAMgEJo5A1ggAyAPmjkDUCADIBSaOQNIIAUgA0HIAGogA0H4AGoQnAEgCCACQQV0aiIEIAMpA4gCNwMYIAQgAykDgAI3AxAgBCADKQP4ATcDCCAEIAMpA/ABNwMAIAEgAygCKCIBakEBOgAAIAEgAmpBAToAAAsgCkEEaiIKIA1HDQALCyAMIANBOGpHBEAgDCgCACIBBEAgARAiCyAGIAMoAjg2ArgBIAYgAygCPDYCvAEgBiADKAJANgLAASADQQA2AkAgA0IANwI4CyAGIANBKGoQ1AIgAygCCCIBBEAgARAiCyADKAIoIgEEQCABECILIAMoAjgiAQRAIAEQIgsgA0GQAmokAAwBCxBmAAsLIAdBDGogB0EcahBZIAcgBykCDCIaNwIUIAdCADcCDCAHIBo3AwAgACAHEEMCQCAHKAIQIgBFDQAgACAAKAIEIgFBAWs2AgQgAQ0AIAAgACgCACgCCBEAACAAECQLIAcoAiAiAEUNACAAIAAoAgQiAUEBazYCBCABDQAgACAAKAIAKAIIEQAAIAAQJAsCQCAHKAIoIgBFDQAgACAAKAIEIgFBAWs2AgQgAQ0AIAAgACgCACgCCBEAACAAECQLIAdBMGokAAvBGwMXfwR8AX4jAEEwayIKJAAgCkEkaiABQQAQKxAqAkAgCigCJCIBKAJEIgUEQCAAIAUQRgwBC0GoAhAjIhNBoJACNgIAIBNCADcCBCATQRBqIAEQNyEIIAogEzYCICAKIAg2AhxBACEFIwBBoAJrIgQkAAJAIAJBAEgNACAIKAJcQQNJDQAgBEQtQxzr4jYaPyADIANELUMc6+I2Gj9jGzkD8AEgCEHYAGoQOCAIQegAahA4IAhB+ABqEDggCCgCQCEOIAgoAkwhASAEQQA2AugBIARCADcC4AEgBEHgAWogAUEAEDEgCCgCXARAA0ACQCAFQQJ0IgEgCCgCWGoiCSgCACAJQXhBBCAFQQNvQQJGGyIGaigCAE4NAAJ8RAAAAAAAAAAAIAgoAqgBIgcgBUEDbkEYbGoiCSsDACAHIAgoAmggAWooAgBBA21BGGxqIgcrAwCiRAAAAAAAAAAAoCAJKwMIIAcrAwiioCAJKwMQIAcrAxCioCIDRAAAAAAAAPA/Zg0AGkS17z+35KuBQCADRAAAAAAAAPC/ZQ0AGiADEF1EAAAAAACAZkCiCyEDIAQrA/ABIANEGC1EVPshCUCjY0UNACAEKALgASIJIAgoAlggAWoiASgCAEECdGoiByAHKAIAQQFqNgIAIAkgASAGaigCAEECdGoiASABKAIAQQFqNgIACyAFQQFqIgUgCCgCXEkNAAsLIA4gAkEDaiIBIAEgDkgbIQ8CfyAIKAJAIgFFBEAgCCgCTAwBCyAIKAKMASABbgshAUEAIQUgBEEANgLYASAEQgA3AtABIARB0AFqIAEgD2xEAAAAAAAAAAAQgAEgCCgCiAEhASAIIAQoAtABNgKIASAEIAE2AtABIAgoAowBIQEgCCAEKALUATYCjAEgBCABNgLUASAIKAKQASEBIAggBCgC2AE2ApABIAQgATYC2AEgCCAPNgJAIAgoAlwhASAEQQA2AsgBIARCADcCwAEgBEHAAWogARAlIAQgATYCxAEgBEG0AWoCfwJAAkAgCCgCXCIVRQRAIARCADcCuAEgBCAEQbgBajYCtAEMAQsgCEGIAWohECAIKAJ4IQEgBCgCwAEhCQNAIAkgBUECdCIHaiABIAdqIgcoAgA2AgAgB0F/NgIAIAVBAWoiBSAVRw0ACyAEQgA3ArgBIAQgBEG4AWo2ArQBIAQgCDYCsAEgBCAEQbQBajYCrAEgFUEASg0BC0EADAELIA5BA3QhEkEAIQkDQAJAIAlBAnQiASAIKAJ4aigCAEEATg0AIAQoAuABIAgoAlggAWooAgAiAUECdGooAgBBAUwEQCAIKAKYASABQRhsaiIBKwMQIRwgASsDCCEeIAErAwAhGwJAIAJFBEAgHiEDIBwhHQwBCyAEQeAAaiAEQawBaiAIKALYASAJQQNuQQR0aigCABDvAyAbIAQrA3CiIB4gBCsDiAGioCAcIAQrA6ABoqAhHSAbIAQrA2iiIB4gBCsDgAGioCAcIAQrA5gBoqAhAyAbIAQrA2CiIB4gBCsDeKKgIBwgBCsDkAGioCEbCyAEIB05A4gCIAQgAzkDgAIgBCAbOQP4AUF/IQYgCSEBA0BBfkEBIAgoAmggAUECdGooAgAiAUEDb0ECRhsgAWoiAUECdCIFIAgoAnhqIAQoAsABIAVqKAIAIgc2AgAgBiAHRwRAIBAoAgAhBQJAIA5FBEAgByAPbCEGDAELIAcgD2whBiASBEAgBSAGQQN0aiAEKALQASAHIA5sQQN0aiAS/AoAAAsgECgCACEFCyAEQQI2AmggBEKAgICAEDcCYCAFIAZBA3RqIAJBA3RqIQtBACEFA0AgCyAEQeAAaiAFaigCACIGQQN0aiAEQfgBakEIQRAgBkEBRhtBACAGG2orAwA5AwAgBUEEaiIFQQxHDQALIAchBgsgASAJRw0ACwwBCyAEIAgoAkggAUEYbGoiASkDEDcDWCAEIAEpAwg3A1AgBCABKQMANwNIIARBADYCRCAEQgA3AjwgBEEANgI4IARCADcCMCAEQQA2AiwgBEIANwIkIAlBA24hBSAJIQEDQAJ8RAAAAAAAAAAAIAgoAqgBIgZBfkEBIAgoAmggAUECdGooAgAiB0EDb0ECRhsgB2oiC0EDbSIMQRhsaiIHKwMAIAYgBUEYbGoiBisDAKJEAAAAAAAAAACgIAcrAwggBisDCKKgIAcrAxAgBisDEKKgIgNEAAAAAAAA8D9mDQAaRLXvP7fkq4FAIANEAAAAAAAA8L9lDQAaIAMQXUQAAAAAAIBmQKILIQMgASALIAQrA/ABIANEGC1EVPshCUCjYyIHGyEBIAdFBEAgBSAMIAcbIQUgASAJRw0BCwsgBCAINgIMIARBlJgCNgIIIAQgBEEIaiIFNgIYIAQgBEHIAGo2AhBBGBAjIgYgCDYCBCAGQdyYAjYCACAGIARBPGo2AhQgBiAEQSRqNgIQIAYgBEEwajYCDCAGIARB8AFqNgIIIAQgATYC+AEgBEHgAGogBSAEQfgBahDuAyABIQUCQAJAA0AgBEF+QQEgCCgCaCAFQQJ0aigCACIHQQNvQQJGGyAHaiIHNgKcAiAEKAIYIgtFDQEgBEH4AWoiDCALIARBnAJqIhEgCygCACgCGBEDACAEIAU2ApwCIAYgESAEQeAAaiAMIAYoAgAoAhgRBQAgBCAEKQP4ATcDYCAEIAQpA4ACNwNoIAQgBCkDiAI3A3AgBCAEKQOQAjcDeCAHIgUgAUcNAAsgBiAGKAIAKAIUEQAAAkAgBCgCGCIFIARBCGpGBH9BEAUgBUUNAUEUCyEHIAUgBSgCACAHaigCABEAAAtBACEFIAQoAjQiCyAEKAIwIg1GDQEDQCANIAVBGGwiBmoiBysDECEcIAcrAwghHiAHKwMAIRsCQCACRQRAIB4hAyAcIR0MAQsgBEHgAGogBEGsAWogBCgCJCAFQQJ0aigCABDvAyAbIAQrA3CiIB4gBCsDiAGioCAcIAQrA6ABoqAhHSAbIAQrA2iiIB4gBCsDgAGioCAcIAQrA5gBoqAhAyAbIAQrA2CiIB4gBCsDeKKgIBwgBCsDkAGioCEbIAQoAjQhCyAEKAIwIQ0LIAYgDWoiByAdIBsgG6IgAyADoqAgHSAdoqCfIh2jRAAAAAAAAAAAIBsgHaMiHL1C////////////AINCgICAgICAgPj/AFQiBhs5AxAgByADIB2jRAAAAAAAAAAAIAYbOQMIIAcgHEQAAAAAAAAAACAGGzkDACAFQQFqIgUgCyANa0EYbUkNAAsMAQsQZgALQQAhC0F/IREgBCgCPCEUQX8hDEEAIRYgASEXA0AgBCgC0AFBfkEBIAgoAmggF0ECdGooAgAiBUEDb0ECRhsgBWoiF0ECdCIaIAQoAsABaigCACIHIA5sQQN0aiEFAkACQCAUIBZBAnQiGGooAgAiGUUgCyAZRnJFBEAgByARRw0BAn8gCCgCQCIHRQRAIAgoAowBIQYgCCgCTAwBCyAIKAKMASIGIAduCyEMIBAgBiAPakQAAAAAAAAAABCAAQJAIA5FBEAgDCAPbCEGDAELIAwgD2whBiASRQ0AIBAoAgAgBkEDdGogBSAS/AoAAAsgBEKAgICAEDcCYCAEQQI2AmggECgCACAGQQN0aiACQQN0aiEGIAQoAjAiDSAEKAI8IhQgGGooAgBBGGxqIQtBACEFA0AgBiAEQeAAaiAFaigCACIHQQN0aiALQQhBECAHQQFGG0EAIAcbaisDADkDACAFQQRqIgVBDEcNAAsgGSELDAILIAcgEUYNAQsgByAPbCEMIBAoAgAhBiAOBEAgEgRAIAYgDEEDdGogBSAS/AoAAAsgBCgCMCENIAQoAjwhFCAQKAIAIQYLIARCgICAgBA3AmAgBiAMQQN0aiACQQN0aiEMIARBAjYCaCANIBQgGGooAgBBGGxqIRFBACEFA0AgDCAEQeAAaiAFaigCACIGQQN0aiARQQhBECAGQQFGG0EAIAYbaisDADkDACAFQQRqIgVBDEcNAAsgByERIAchDAsgCCgCeCAaaiAMNgIAIBZBAWohFiABIBdHDQALIAQoAiQiAQRAIAQgATYCKCAEKAIsGiABECIgBCgCMCENCyANBEAgBCANNgI0IAQoAjgaIA0QIgsgBCgCPCIBRQ0AIAQgATYCQCAEKAJEGiABECILIAlBAWoiCSAVRw0ACyAEKAK4AQsQ1QIgBCgCwAEiAQRAIAEQIgsgBCgC0AEiAQRAIAEQIgsgBCgC4AEiAUUNACABECILIARBoAJqJAACQCACDQAgEygC3AEiASATQeABaiIFRg0AA0AgAUEBOgCBAQJAIAEoAgQiAgRAA0AgAiIBKAIAIgINAAwCCwALA0AgASABKAIIIgEoAgBHDQALCyABIAVHDQALCyAKQQxqIApBHGoQWSAKIAopAgwiHzcCFCAKQgA3AgwgCiAfNwMAIAAgChBDAkAgCigCECIARQ0AIAAgACgCBCIBQQFrNgIEIAENACAAIAAoAgAoAggRAAAgABAkCyAKKAIgIgBFDQAgACAAKAIEIgFBAWs2AgQgAQ0AIAAgACgCACgCCBEAACAAECQLAkAgCigCKCIARQ0AIAAgACgCBCIBQQFrNgIEIAENACAAIAAoAgAoAggRAAAgABAkCyAKQTBqJAALhBIDE38IfAF+IwBBMGsiCiQAIApBJGogAUEAECsQKgJAIAooAiQiASgCRCIEBEAgACAEEEYMAQtBqAIQIyIEQaCQAjYCACAEQgA3AgQgBEEQaiABEDchASAKIAQ2AiAgCiABNgIcIwBB0AFrIgQkAAJAIAIgA3FBAEgNACABKAJcQQNJDQAgASgCTCEFIARBADYCPCAEQgA3AjQgBEE0aiAFRAAAAAAAAAAAEIABIAEoAkwhBSAEQQA2AiwgBEIANwIkIARBJGogBUQYLURU+yEZQBCAASABKAJMIQUgBEEANgIcIARCADcCFCAEQRRqIAVEAAAAAAAAAAAQgAEgASgCTCEFIARBADYCDCAEQgA3AgQgBEEEaiAFRAAAAAAAAAAAEIABIAEoAlwiBUEDbiEPIAVBA08EQCABKAKoASEHIAEoAkghDCAEKAIEIRAgBCgCFCERIAQoAiQhEiAEKAI0IQ4DQEEAIQUgBEGAAWpBAEHIAPwLACAEQgA3A3ggBEIANwNwIARCADcDaCAEQQI2AlggBEKAgICAEDcCUCAJQQNsIRMgByAJQRhsaiEIA0AgBEHoAGpBCEEQIARB0ABqIAVqKAIAIgZBAUYbQQAgBhtqIAwgBiATaiILQQJ0IhQgASgCWGoiDUF4QQQgC0EDb0ECRhtqKAIAIhVBGGxqIgsrAwAgDCANKAIAIhZBGGxqIg0rAwChIhggGKIgCysDCCANKwMIoSIaIBqioCALKwMQIA0rAxChIhkgGaKgnyIXOQMAIARBgAFqIAZBGGxqIgYgGSAXoyIZOQMQIAYgGiAXoyIaOQMIIAYgGCAXoyIYOQMAIA4gFkEDdCILaiINIBdEAAAAAAAA0D+iAnxEAAAAAAAA+H8gGSAHIAEoAmggFGooAgBBA21BGGxqIgYrAwgiFyAIKwMAIhmiIAgrAwgiGyAGKwMAIh2ioaIgGCAbIAYrAxAiGKIgCCsDECIbIBeioaJEAAAAAAAAAACgIBogGyAdoiAYIBmioaKgoCIXmUQAAAAAAADwP2QgF71C////////////AINCgICAgICAgPj/AFpyDQAaRBgtRFT7Ifk/IBdEAAAAAAAA8D9hDQAaRBgtRFT7Ifm/IBdEAAAAAAAA8L9hDQAaRBgtRFT7Ifk/IBcQXaELoiIXIA0rAwCgOQMAIA4gFUEDdGoiBiAXIAYrAwCgOQMAIAsgEGoiBiAGKwMARAAAAAAAAPA/oDkDACAFQQRqIgVBDEcNAAsgBCAEKwOwASAEKwOAASIXokQAAAAAAAAAAKAgBCsDuAEgBCsDiAEiGKKgIAQrA8ABIAQrA5ABIhqioJoQXSIcOQNQIAQgFyAEKwOYASIZokQAAAAAAAAAAKAgGCAEKwOgASIboqAgGiAEKwOoASIdoqCaEF0iHjkDWCAERBgtRFT7IQlAIByhIB6hOQNgIAQrA2ggBCsDcCAEQQI2AkwgBEKAgICAEDcCRKIgFyAboiAYIBmioSIcIByiIBggHaIgGiAboqEiGCAYoiAaIBmiIBcgHaKhIhcgF6KgoJ+iRAAAAAAAABhAoyEXIAlBDGwhBkEAIQUDQCASIAEoAlggBmogBEHEAGogBWooAgAiCEECdGooAgBBA3QiC2oiDSANKwMAIARB0ABqQQhBECAIQQFGG0EAIAgbaisDAKE5AwAgCyARaiIIIBcgCCsDAKA5AwAgBUEEaiIFQQxHDQALIAlBAWoiCSAPRw0ACwsgASgCTCIHBEBBACEFIAQoAiQhCCAEKAI0IQYgBCgCFCEMIAQoAgQhDgNAIAYgBUEDdCIJaiILIAsrAwAgCSAOaisDACAJIAxqKwMARAAAAAAAABhAoqMiF6I5AwAgCCAJaiIJIBcgCSsDAKI5AwAgBUEBaiIFIAdHDQALCyABKAJAIgUgAiADIAIgA0obQQFqIg5KIQsgAUGIAWohCQJAIAEoAowBIghFBEBBACEGDAELIAkoAgAhDSAIQQN0IgwQJyEGIAxFDQAgBiANIAz8CgAACyAFBEAgCCAFbiEHCyAEQQA2AogBIARCADcCgAEgBEGAAWoiDCAHIAUgDiALGyIIbEQAAAAAAAAAABCAAQJAIAkgDEcEQCAJKAIAIgcEQCAHECILIAEgBCgCgAE2AogBIAEgBCgChAE2AowBIAEgBCgCiAE2ApABDAELIAQoAoABIgdFDQAgBxAiCyABIAg2AkACfyAIRQRAIAEoAkwMAQsgASgCjAEgCG4LIQcgBEEANgKIASAEQgA3AoABIARBgAFqIAdBABCBASABKAJcIgdBA24hDyAHQQNPBEAgBUEDdCELQQAhDANAIARBAjYCcCAEQoCAgIAQNwJoIAxBA2whEEEAIQ4DQCAEQegAaiAOaigCACAQakECdCIHIAEoAlhqKAIAIQ0gASgCeCAHaigCACIHIAQoAoABaiIRLQAAIRIgEUEBOgAAAkAgEkEBRg0AIAtFIAVBAExyRQRAIAkoAgAgByAIbEEDdGogBiAFIAdsQQN0aiAL/AoAAAsgAkEATgRAIAkoAgAgByAIbEEDdGogAkEDdGogBCgCJCANQQN0aisDADkDAAsgA0EASA0AIAkoAgAgByAIbEEDdGogA0EDdGogBCgCNCANQQN0aisDADkDAAsgDkEEaiIOQQxHDQALIAxBAWoiDCAPRw0ACwsgBCgCgAEiAQRAIAEQIgsgBgRAIAYQIgsgBCgCBCIBBEAgARAiCyAEKAIUIgEEQCABECILIAQoAiQiAQRAIAEQIgsgBCgCNCIBRQ0AIAEQIgsgBEHQAWokACAKQQxqIApBHGoQWSAKIAopAgwiHzcCFCAKQgA3AgwgCiAfNwMAIAAgChBDAkAgCigCECIARQ0AIAAgACgCBCIBQQFrNgIEIAENACAAIAAoAgAoAggRAAAgABAkCyAKKAIgIgBFDQAgACAAKAIEIgFBAWs2AgQgAQ0AIAAgACgCACgCCBEAACAAECQLAkAgCigCKCIARQ0AIAAgACgCBCIBQQFrNgIEIAENACAAIAAoAgAoAggRAAAgABAkCyAKQTBqJAALBwAgABDBBAtbAQN/IwBBEGsiASQAIAFBCGogAEEAECsQKiABKAIIKALIAQJAIAEoAgwiAEUNACAAIAAoAgQiA0EBazYCBCADDQAgACAAKAIAKAIIEQAAIAAQJAsgAUEQaiQAC14CAn8BfCMAQRBrIgEkACABQQhqIABBABArECogASgCCEEAEIQEAkAgASgCDCIARQ0AIAAgACgCBCICQQFrNgIEIAINACAAIAAoAgAoAggRAAAgABAkCyABQRBqJAALXgICfwF8IwBBEGsiASQAIAFBCGogAEEAECsQKiABKAIIQQEQhAQCQCABKAIMIgBFDQAgACAAKAIEIgJBAWs2AgQgAg0AIAAgACgCACgCCBEAACAAECQLIAFBEGokAAsZACAAEJACIAAQoARrIAAQvwFqQX5tQQFqC54CAgJ/AXwjAEEgayIDJAAgA0EYaiABQQAQKxAqAkAgAygCGCIEKAJEIgEEQCAAIAEQRgwBC0GoAhAjIgFBoJACNgIAIAFCADcCBCABQRBqIAQQNyEEIAErA0giBSACIAJEAAAAAAAAAABhGyICIAVkBEAgASACOQNIIAQQWgsgBEEAEPgCIARBABBUIAEgBTkDSCADIAE2AhQgAyAENgIQIAEgASgCBEEBajYCBCADIAMpAhA3AwggACADQQhqEEgaIAEgASgCBCIAQQFrNgIEIAANACABIAEoAgAoAggRAAAgARAkCwJAIAMoAhwiAEUNACAAIAAoAgQiAUEBazYCBCABDQAgACAAKAIAKAIIEQAAIAAQJAsgA0EgaiQAC50CAgJ/AXwjAEEgayIDJAAgA0EYaiABQQAQKxAqAkAgAygCGCIEKAJEIgEEQCAAIAEQRgwBC0GoAhAjIgFBoJACNgIAIAFCADcCBCABQRBqIAQQNyEEAkAgASsDSCACYwRAIAEgAjkDSCAEEFogBEEAEPgCIARBABBUDAELIAEgAiABKwNAIgUgAiAFZBs5A0gLIAMgATYCFCADIAQ2AhAgASABKAIEQQFqNgIEIAMgAykCEDcDCCAAIANBCGoQSBogASABKAIEIgBBAWs2AgQgAA0AIAEgASgCACgCCBEAACABECQLAkAgAygCHCIARQ0AIAAgACgCBCIBQQFrNgIEIAENACAAIAAoAgAoAggRAAAgABAkCyADQSBqJAALXAICfwF8IwBBEGsiASQAIAFBCGogAEEAECsQKiABKAIIKwM4AkAgASgCDCIARQ0AIAAgACgCBCICQQFrNgIEIAINACAAIAAoAgAoAggRAAAgABAkCyABQRBqJAALVwEBfyMAQRBrIgMkACAAIAEQLhogAyACKAIANgIIIAMgAigCBCIBNgIMIAEEQCABIAEoAgRBAWo2AgQLIAMgAykCCDcDACAAQRBqIAMQ5wIgA0EQaiQACwIACzMBAX9B4JUCQoCAgICAgICSwAA3AwBBtJ8CQQA2AgAgAEHolQJqQoCAgICAgID4PzcDAAsZACAAQQJMQQAgABtFBEBBtJ8CIAA2AgALCxsAIABEAAAAAAAAAABlRQRAQeiVAiAAOQMACwsbACAARAAAAAAAAAAAZUUEQEHglQIgADkDAAsLBgBB1JUCCxQAIABBBGpBACABKAIEQdr/AEYbC6EDAQh/IwBBIGsiBiQAIAEoAgAiBCABKAIEQRhsaiEBIAZBCGogACgCBBBXIgchACMAQSBrIggkACAIQQhqIAAQVyIJIQAjAEEwayIFJAAgBUEYaiECIAUgABBXIQMCQAJAIAEgBCIARwRAA0AgAygCECIERQ0CIAQgACAEKAIAKAIYEQEAIABBGGoiACABRw0ACwsgAygCECIARQRAIAJBADYCEAwCCyAAIANGBEAgAiACNgIQIAAgAiAAKAIAKAIMEQEADAILIAIgADYCECADQQA2AhAMAQsQZgALAkAgAiAFKAIoIgBGBH9BEAUgAEUNAUEUCyEBIAAgACgCACABaigCABEAAAsCQCADIAMoAhAiAEYEf0EQBSAARQ0BQRQLIQEgACAAKAIAIAFqKAIAEQAACyAFQTBqJAACQCAJIAkoAhAiAEYEf0EQBSAARQ0BQRQLIQEgACAAKAIAIAFqKAIAEQAACyAIQSBqJAACQCAHKAIQIgAgB0YEf0EQBSAARQ0BQRQLIQEgACAAKAIAIAFqKAIAEQAACyAGQSBqJAALFQAgAUGklQI2AgAgASAAKAIENgIECx0BAX9BCBAjIgFBpJUCNgIAIAEgACgCBDYCBCABC/AaAxx/CHwDfiMAQaABayIEJAAgBEEYaiEGIwBBEGsiFCQAIBRBCGogAUEAECsQKiAUKAIIIQgCQCAUKAIMIgFFDQAgASABKAIEIgNBAWs2AgQgAw0AIAEgASgCACgCCBEAACABECQLQQBBfyAIEO4CGyEXIwBBoAJrIgIkAAJ/IAgoAkAiEkUEQCAIKAJMDAELIAgoAowBIBJuCyEOIAgoAsgBIQogCCgCXCEJIAZBCGoiC0EAQfgA/AsAIAYgEkEDaqw3AwAgBiAIKwM4OQOAASAGQRRqIAlBA24iEEEDbCIVENQBIAZB9ABqIAgoArwBIgdBAnQQ1AEgB0EASgRAIAYoAnQhDyAIKAK4ASERA0AgESAFQQV0IgNqIgErAwAhHiABKwMIIR8gASsDECEgIAMgD2oiAyABKwMYOQMYIAMgIDkDECADIB85AwggAyAeOQMAIAVBAWoiBSAHRw0ACwsgBkHoAGogEBDUASACQZQCaiAQEOwBIg8oAgAiBSAPKAIEIgdHBEBBACEDIAUhAQNAIAEgAzYCACADQQFqIQMgAUEEaiIBIAdHDQALCyAIKALYASERIApBAEgEQCACIAgoAtwBNgKQAiACIBE2AowCIAJBjAJqIQwCQAJAIAcgBWtBAnUiA0GBAU4EQCADIQEDQCABQQJ0EFAiEw0CIAFBAXYiAQ0ACwsgBSAHIAwgA0EAQQAQwwEMAQsgBSAHIAwgAyATIAEQwwEgExAiCwsgAiAKQQBOIhM6AIsCIAIgAkGAAmoiBzYC/AEgAkIANwKAAiACQfwBaiAIKALMASAIQdABahCDAyAJQQNPBEBBfyEBA0AgESAPKAIAIA1BAnRqKAIAIgpBBHRqIgMoAgwhDCADKAIIIQUgAiADKAIAIgk2AgAgBigCaCANQQN0aiAMIAUgBUEASBusNwMAIAJBAjYCkAEgAkKAgICAEDcCiAEgBigCFCANQRhsaiEFIAgoAlggCkEMbGohCkEAIQMDQCAFIAJBiAFqIANqKAIAIgxBA3RqIAogDEECdGo0AgA3AwAgA0EEaiIDQQxHDQALIAEgCUcEQCACQoCAgICAgID4PzcDkAEgAkF/NgKIASACQgA3A6gBIAJCADcDoAEgAkIANwOYASACQoCAgICAgID4PzcDsAEgAkIANwPIASACQgA3A8ABIAJCADcDuAEgAkKAgICAgICA+D83A9ABIAJBADsB8AEgAkIANwPoASACQgA3A+ABIAJCADcD2AEgByEBAkAgAigCgAIiBUUNAANAIAEiAyAFIgogBSgCECAJSCIMGyEBIAVBBEEAIAwbaigCACIFDQALIAEgB0YNACAJIAMgCiAMGygCEEgNACACQYgBaiABQRhqQeoA/AoAAAsgAkGLAmogBiANIAJBiAFqELQEIAJB/AFqIAIQswQgAigCACEBCyANQQFqIg0gEEcNAAsLIAcgAigC/AEiA0cEQANAIAJBiwJqIAYgECADQRhqELQEAkAgAygCBCIBBEADQCABIgMoAgAiAQ0ADAILAAsDQCADIAMoAggiAygCAEcNAAsLIAMgB0cNAAsLIAIgFa03A4gBIAZBOGogAkGIAWoQkgECQCASRQRAIAsgDkEDbBDUASAOQQBMDQEgCygCACEHIAgoAkghCkEAIQMDQCAKIANBGGwiBWoiASsDACEeIAErAwghHyAFIAdqIgUgASsDEDkDECAFIB85AwggBSAeOQMAIANBAWoiAyAORw0ACwwBCyAIKAJMIQEgAkF/NgKIASACQfwAaiABIAJBiAFqELIEIQ0gAkHwAGogCCgCTBCcAiEQIA4gBigCAGwhASMAQSBrIgUkAAJAAkAgCygCCCALKAIAIgNrQQN1IAFJBEAgAUGAgICAAk8NASAFQQxqIAEgCygCBCADa0EDdSALEEsiASgCBCALKAIEIAsoAgAiCmsiA2shByADBEAgByAKIAP8CgAACyALKAIAIQMgCyAHNgIAIAEgAzYCBCALIAEoAgg2AgQgASADNgIIIAsoAgghByALIAEoAgw2AgggASADNgIAIAEgBzYCDCABEJkBCyAFQSBqJAAMAQsQJgALIAYoAkgiASAGKAJEIgVHBEAgF0EASCATciETIAZBLGohFSAGQSBqIRggBigCOCEDQQAhCgNAIAMgCiIHQQFqIgpBA3QiGWopAwBCA4AgAyAHQQN0aikDAEIDgCImQv////8Pg1YEQCAHQeAAbCEaICanIQUDQCACQQI2AmwgAkKAgICAEDcCZCAFQRhsIRtBACEOA0AgCCgCeCAPKAIAIAVBAnRqKAIAQQxsaiACQeQAaiAOaigCACIDQQJ0aigCACEBAkAgECgCACAGKAIUIBtqIANBA3RqIgkoAgAiEUEMbGoiDCgCACIDIAwoAgQiFkcEQANAIAEgAygCAEYEQCAJIAM0AgQ3AwAMAwsgA0EIaiIDIBZHDQALCyAJIAYoAgwgBigCCGtBA3WtIAYpAwCAIibEIic3AwAgAiAmpyIWNgKMASACIAE2AogBIAwgAkGIAWoQsQQgAkECNgKQASACQoCAgIAQNwKIAUEAIQMDQCALIAgoAkggEUEYbGpBCEEQIAJBiAFqIANqKAIAIglBAUYbQQAgCRtqEKgCIANBBGoiA0EMRw0ACyASQQBKBEBBACEDIAEgEmxBA3QhAQNAIAsgCCgCiAEgAWogA0EDdGoQqAIgA0EBaiIDIBJHDQALCyATRQRAIAJCADcDWCACQgA3A1AgAkIANwNIIAYoAgAhAyAGKAIIIQEgBigCDCEJIAJBAjYCkAEgAkKAgICAEDcCiAEgF0EDdCIMIAEgCSABa0EDdSADa0EDdCIcampBGGohHUEAIQMDQCACQcgAakEIQRAgAkGIAWogA2ooAgAiCUEBRhtBACAJG2ogHSAJQQN0aisDADkDACADQQRqIgNBDEcNAAsCfCAGKAJcIAdqLQAAQQJxBEAgAisDWCEfIAIrA1AhICACKwNIDAELIAYoAlAgGmoiASsDACEeIAErAxghHyABKwMwISAgASsDCCEhIAErAyAhIiABKwM4ISMgASsDECEkIAErAyghJSACIAErA0A5A8gBIAIgJTkDwAEgAiAkOQO4ASACICM5A7ABIAIgIjkDqAEgAiAhOQOgASACICA5A5gBIAIgHzkDkAEgAiAeOQOIASACIAJBiAFqEJABRAAAAAAAAPC/RAAAAAAAAPA/IAYoAlwgB2otAABBAXEbIh4gAisDEKIgAisDSCIhoiAeIAIrAyiiIAIrA1AiIqKgIB4gAisDQKIgAisDWCIjoqAhHyACKwMIIB6iICGiIB4gAisDIKIgIqKgIB4gAisDOKIgI6KgISAgBigCCCEBIAIrAwAgHqIgIaIgHiACKwMYoiAioqAgHiACKwMwoiAjoqALIR4gAiAfIB4gHqIgICAgoqAgHyAfoqCfIh+jRAAAAAAAAAAAIB4gH6MiHr1C////////////AINCgICAgICAgPj/AFQiAxs5A1ggAiAgIB+jRAAAAAAAAAAAIAMbOQNQIAIgHkQAAAAAAAAAACADGzkDSCACQQI2ApABIAJCgICAgBA3AogBIAEgHGogDGpBGGohCUEAIQMDQCAJIAJBiAFqIANqKAIAIgFBA3RqIAJByABqQQhBECABQQFGG0EAIAEbaisDADkDACADQQRqIgNBDEcNAAsLIBFBAnQiASANKAIAaiIDKAIAQX9GBEAgAyAWNgIADAELIAIgJzcDiAEgGCACQYgBaiIDEJIBIAIgDSgCACABajQCADcDiAEgFSADEJIBCyAOQQRqIg5BDEcNAAsgBUEBaiIFrSAGKAI4IgMgGWopAwBCA4BUDQALIAYoAkQhBSAGKAJIIQELIAogASAFa0ECdUkNAAsLIAIgEDYCiAEgAkGIAWoQKSANKAIAIgFFDQAgDSABNgIEIA0oAggaIAEQIgsgAkH8AWogAigCgAIQbyAPKAIAIgEEQCAPIAE2AgQgDygCCBogARAiCyACQaACaiQAIBRBEGokACAEKAIkIAQoAiBrQQN1rSImIAQpAxgiJ4AhKCAmICdaBEBCACEmA0AgBCAEKAIgIAQoAhggJqdsQQN0aiIBKwMAOQMAIAQgASsDCDkDCCAEIAErAxA5AxAgACAEEMQBICggJkIBfCImVg0ACwsgBCgCjAEiAARAIAQgADYCkAEgBCgClAEaIAAQIgsgBCgCgAEiAARAIAQgADYChAEgBCgCiAEaIAAQIgsgBCgCdCIABEAgBCAANgJ4IAQoAnwaIAAQIgsgBCgCaCIABEAgBCAANgJsIAQoAnAaIAAQIgsgBCgCXCIABEAgBCAANgJgIAQoAmQaIAAQIgsgBCgCUCIABEAgBCAANgJUIAQoAlgaIAAQIgsgBCgCRCIABEAgBCAANgJIIAQoAkwaIAAQIgsgBCgCOCIABEAgBCAANgI8IAQoAkAaIAAQIgsgBCgCLCIABEAgBCAANgIwIAQoAjQaIAAQIgsgBCgCICIABEAgBCAANgIkIAQoAigaIAAQIgsgBEGgAWokAAuUDwINfwx8IwBBMGsiByQAIAcgAikDEDcDKCAHIAIpAwg3AyAgByACKQMANwMYIAcgAykDADcDACAHIAMpAwg3AwggByADKQMQNwMQIwBBQGoiAiQAIAJBOGogAUEAECsQKiACIAcpAxg3AyAgAiAHKQMgNwMoIAIgBykDKDcDMCACIAcpAwA3AwggAiAHKQMINwMQIAIgBykDEDcDGCACKAI4IQggAkEgaiEGIwBBwAZrIgEkAAJAIAgoAlxBAk0EQCAAQQA2AgggAEIANwIADAELIAYrAwAhEiACKwMIIRUgBisDCCETIAIrAxAhFiABIAIrAxgiFCAGKwMQIhehIhE5A9gDIAEgFiAToSIYOQPQAyABIBUgEqEiGTkDyAMgGSAZoiAYIBiioCARIBGioEQAAAAAAAAAAGEEQCAAQQA2AgggAEIANwIADAELIAFBsAFqEDshAyABQgA3A6gBIAFCADcDoAEgAUIANwOYASABQgA3AzggAUIANwNAIAFCADcDSCADQcgAakECIAFBOGoQZyADKAJIIgUgBikDEDcDECAFIAYpAwg3AwggBSAGKQMANwMAIAMoAkgiBSACKQMQNwMgIAUgAikDGDcDKCAFIAIpAwg3AxggAUIANwOAASABQgA3A5ABIAFCADcDiAEgAUIANwMoIAFCADcDMCABIAEpA4ABNwMgIANBmAFqQQIgAUEgahBnIAMoApgBQQBBMPwLACADQdgAaiIFQQNBfxAxIAVBEGpBA0F/EDEgBUEgakEDQX8QMSADKAJYIgVBADYCACADKAJoIgRBATYCACADKAJ4IglBADYCACAFQQE2AgQgBEEANgIEIAlBADYCBCAFQX82AgggBEF/NgIIIAlBADYCCCABQgA3A3ggAUIANwNwIAFCADcDaCABQgA3AwggAUIANwMQIAFCADcDGCADQagBakEBIAFBCGoQZyADKAKoASIFQgA3AxAgBUIANwMIIAVCADcDACABIAg2AmQgASADNgJgIAEgCDYCXCABIAM2AlggASAINgJUIAEgAzYCUCAAQQA2AgggAEIANwIAAkAgCCgCjAJFDQAgEiAVIBIgFWMiBRsiGiAVIBIgBRsiEiASIBpkIgUbIhVEAAAAAAAA8H9hDQAgFCAXIBQgF2QiBBsiGyAXIBQgBBsiFCAUIBtjIgQbIRcgFiATIBMgFmMiCRsiHCATIBYgCRsiEyATIBxjIgkbIRYgEiAaIAUbIRIgFCAbIAQbIRQgEyAcIAkbIRMgCCgCiAIhECAIKALoASEMQQhBECAYmSIYIBGZIhFkG0EAIBggGZkiGWNFIBEgGWNFchsiBSABQagGamohDSAFIAZqIQ4gAUHIA2ogBWohD0EBIQRBfyEGA0AgECAEQQFrQQJtQQN0aiIEKAIEIQVBACEKAn9BACAMIAQoAgAiCUEwbGoiBCsDACASZUUNABpBACAEKwMIIBZlRQ0AGkEAIAQrAxAgF2VFDQAaQQAgBCsDGCAVZkUNABpBACAEKwMgIBNmRQ0AGkEAIAQrAyggFGZFDQAaAkAgCUEBcQ0AIAFBoAZqIAFB0ABqQQAgCUEBdSIEEI0DIAEoAqAGRQ0AIAEpA6gGQv///////////wCDQv/////////3/wBWDQAgDSsDACAOKwMAoSAPKwMAoyIRRAAAAAAAAAAAZkUgEUQAAAAAAADwP2VFcg0AIAEgETkD6AUgASAErDcD4AUgASABKQO4BjcDgAYgASABKQOwBjcD+AUgASABKQOoBjcD8AUgASAIKAKoASAEQRhsaiIEKQMINwOQBiABIAQpAxA3A5gGIAEgBCkDADcDiAYgACABQeAFahCaAwsgCUGBgICAeHFBAUYLIQsCQCAMIAVBMGxqIgQrAwAgEmVFDQAgBCsDCCAWZUUNACAEKwMQIBdlRQ0AIAQrAxggFWZFDQAgBCsDICATZkUNACAEKwMoIBRmRQ0AAkAgBUEBcQ0AIAFBoAZqIAFB0ABqQQAgBUEBdSIEEI0DIAEoAqAGRQ0AIAEpA6gGQv///////////wCDQv/////////3/wBWDQAgDSsDACAOKwMAoSAPKwMAoyIRRAAAAAAAAAAAZkUgEUQAAAAAAADwP2VFcg0AIAEgETkD6AUgASAErDcD4AUgASABKQO4BjcDgAYgASABKQOwBjcD+AUgASABKQOoBjcD8AUgASAIKAKoASAEQRhsaiIEKQMINwOQBiABIAQpAxA3A5gGIAEgBCkDADcDiAYgACABQeAFahCaAwsgBUGBgICAeHFBAUYhCgsCQCAKIAtyRQRAIAZBAEgNASABQeADaiAGQQJ0aigCACEEIAZBAWshBgwCCyAJIAUgCxshBCALRSAKRXINASABQeADaiAGQQFqIgZBAnRqIAU2AgAMAQsLIAAoAgAiCCAAKAIEIgBGDQAgCCAAIAAgCGtBBnVnQQF0QT5zQQEQ/AQLIAMQOhoLIAFBwAZqJAACQCACKAI8IgBFDQAgACAAKAIEIgFBAWs2AgQgAQ0AIAAgACgCACgCCBEAACAAECQLIAJBQGskACAHQTBqJAALsQMBBH8jAEGAAWsiBCQAIAQgAikDADcDCCAEIAIpAwg3AxAgBCACKQMQNwMYIARB0ABqIQYjAEGwAWsiAiQAIAJBqAFqIAFBABArECoCQCACKAKoASgCRCIFBEAgAkGQAWoiASAFEEYgBiABEC4aIAZBGGogARAuGiABECgaDAELIAEQwAEEQCACQZABaiIBEOsBGiACQfgAaiIFEOsBGiAGIAEQiwEaIAZBGGogBRCLARogBRAoGiABECgaDAELIAJByABqIgUgARDkAiACQRhqIgcgBUEw/AoAACACIAQpAxg3AxAgAiAEKQMQNwMIIAIgBCkDCDcDACACQZABaiIFIAcgAiADEJYEIAYgASAFEJgEIAUQKBoLAkAgAigCrAEiAUUNACABIAEoAgQiBUEBazYCBCAFDQAgASABKAIAKAIIEQAAIAEQJAsgAkGwAWokACAEQSBqIAYQLiIBQRhqIARB6ABqIgYQLhogAEEANgIIIABCADcCACAAIAEgAUEwaiICQQIQlgIDQCACQRhrECgiAiABRw0ACyAGECgaIARB0ABqECgaIARBgAFqJAALDwAgAEH4lAI2AgAgABAiCw0AIABB+JQCNgIAIAALKAEBfyAAKAIAIgAoAggiAUUEQEQAAAAAAADwPw8LIAAoAgy3IAG3owsXACAAKAIAIgAEfyAALQAQBUEAC0EBcQsMACAAKAIAQQE6ABALdgECfyMAQeAAayIDJAAgA0EwaiIEIAEgAhCYBCADIAQQLiIBQRhqIANByABqIgQQLhogAEEANgIIIABCADcCACAAIAEgAUEwaiICQQIQlgIDQCACQRhrECgiAiABRw0ACyAEECgaIANBMGoQKBogA0HgAGokAAu1AQEDfyAAIwBBEGsiACQAIAAgAUEQahB/IABBCGogASAAKAIAECsQKiAAKAIIKAJEAkAgACgCDCIBRQ0AIAEgASgCBCICQQFrNgIEIAINACABIAEoAgAoAggRAAAgARAkCwJAIAAoAgQiAUUNACABIAEoAgQiAkEBazYCBCACDQAgASABKAIAKAIIEQAAIAEQJAsgAEEQaiQAIgBBDksEf0GWDgUgAEECdEHcjwJqKAIACxDRBAsPACAAQdCUAjYCACAAECILDQAgAEHQlAI2AgAgAAslAQF/IwBBEGsiASQAIAEgAEEMajYCDCABQQxqEGUgAUEQaiQACw8AIABBqJQCNgIAIAAQIgsNACAAQaiUAjYCACAACyoBAX8jAEEQayIBJAAgAEEcahAvGiAAKAIYIgAEQCAAECQLIAFBEGokAAsPACAAQYCUAjYCACAAECILDQAgAEGAlAI2AgAgAAsPACAAQdiTAjYCACAAECILDQAgAEHYkwI2AgAgAAuwAgEFfyMAQRBrIgEkACAAQRBqIgNBDGoCQCADKAIQIgBFDQAgACgCBA0AIAMoAgwhACADKAIUGiABQQA2AgggAUIANwIAIAEgATYCDCABQQxqIAAQ0gQgASgCBCICIAEoAgBHBEADQCACQQRrKAIAIQAgAkEIayIEKAIAIQIgBEIANwIAIAEgBBAvNgIEAkAgAEUNAAJAIAAoAgQNACACKAIQIgRFDQAgBCgCBA0AIAIoAhQaIAFBDGogAigCDBDSBAsgACAAKAIEIgJBAWs2AgQgAg0AIAAgACgCACgCCBEAACAAECQLIAEoAgQiAiABKAIARw0ACwsgASABNgIMIAFBDGoQZQsgA0GAAWoQLxogA0EUahAvGhAvGiADKAIIIgAEQCAAECQLIAFBEGokAAsPACAAQbCTAjYCACAAECILDQAgAEGwkwI2AgAgAAv0AgEHfyMAQdAAayIHJAAgB0EANgJIIAIEQCAHIAI2AjwgB0GMjwI2AjggByAHQThqNgJICyAHQQhqIgsgA0Ew/AoAACMAQeAAayIDJAAgASgCACICQgA3AgAgAkIFNwIIQagCECMiAkGgkAI2AgAgAkIANwIEQRAhCSACQRBqEDshCiADQcgAaiAHQThqIgwQVyEIIAEoAgAhASADQRBqIg0gC0Ew/AoAACAKIAggDSAEIAUgBiABEPsDAkAgCCgCECIBIAhHBEBBFCEJIAFFDQELIAEgASgCACAJaigCABEAAAsgAyACNgJEIAMgCjYCQCACIAIoAgRBAWo2AgQgAyADKQJANwMIIAAgA0EIahDmAiACIAIoAgQiAEEBazYCBCAARQRAIAIgAigCACgCCBEAACACECQLIANB4ABqJAACQCAMIAcoAkgiAEYEf0EQBSAARQ0BQRQLIQEgACAAKAIAIAFqKAIAEQAACyAHQdAAaiQAC1YBAn8jAEEQayICJAAjAEEQayIBJAAgASAAQRBqIgBBhAFqNgIIIAFBCGoQZSABIABB+ABqNgIMIAFBDGoQZSAAQfAAahAvGiABQRBqJAAgAkEQaiQACw8AIABBiJMCNgIAIAAQIgsNACAAQYiTAjYCACAACwQAQQELkgIBBH8jAEEQayIBJABBASEDAkAgACgCgAENAEEAIQMgAUEANgIMIAFCADcCBCABIAA2AgAgAUEEaiABED0gASgCBCICIAEoAggiAEcEQANAIABBBGsiACgCACEEIAEgADYCCAJAIAQoAoABBEAgA0EBaiEDDAELIAQoAhQaIAQoAgwiAigCACIAIAIoAgQiAkcEQANAAkAgACgCACIEIAQoAgAoAggRBABBA0YEQCADQQFqIQMMAQsgASAAKAIANgIAIAFBBGogARA9CyAAQQhqIgAgAkcNAAsLIAEoAgghACABKAIEIQILIAAgAkcNAAsLIAJFDQAgASACNgIIIAEoAgwaIAIQIgsgAUEQaiQAIAMLJQEBf0EDIQEgAC0AHCIAQQJNBH8gAEECdEGM+ABqKAIABSABCwvFIgMVfwF+DHwjAEGgAmsiBCQAIAEoAhQaAkACQAJAIAEoAoABIgUEQCAAIAU2AgAgACABKAKEASIANgIEIAAEQCAAIAAoAgRBAWo2AgQLDAELIARBADYC+AEgBEIANwLwASAEQQA6AOABIARBADYCgAIgBEEANgLoASAEIARBjAJqIAFBBGoQmwIiBygCADYCgAEgBCAHKAIEIgU2AoQBIAUEQCAFIAUoAgRBAWo2AgQLQaABECMiBUGIkwI2AgAgBUIANwIEIAQoAoQBIQMgBC0A4AEhBiABLQAcIQ0gBEEANgKEASAEKAKAASEIIARBADYCgAEgBUEQaiIKQgA3AxAgBUKAgICAgICA+D83AxggBSANOgARIAUgBjoAECAFQgA3AyggBUIANwMwIAVCADcDQCAFQoCAgICAgID4PzcDOCAFQgA3A0ggBUIANwNQIAVCADcDYCAFQoCAgICAgID4PzcDWCAFQgA3A2ggBUIANwNwIAVCADcDeCAFIAM2AoQBIAUgCDYCgAECQCADRQRAIAVCADcDmAEgBUIANwOQASAFQgA3A4gBDAELIAMgAygCBEEBajYCBCAFQgA3A5gBIAVCADcDkAEgBUIANwOIASADIAMoAgQiBkEBazYCBCAGRQRAIAMgAygCACgCCBEAACADECQLCwJAIAQoAvQBIgMgBCgC+AEiBkkEQCADIAU2AgQgAyAKNgIAIANBCGohAwwBCyADIAQoAvABIg1rQQN1IghBAWoiA0GAgICAAk8NAiAEQf////8BIAYgDWsiBkECdSINIAMgAyANSRsgBkH4////B08bIAggBEHwAWoQSyIGKAIIIgMgBTYCBCADIAo2AgAgBiADQQhqNgIIIAYoAgQgBCgC9AEgBCgC8AEiCmsiBWshAyAFBEAgAyAKIAX8CgAACyAEKALwASEFIAQgAzYC8AEgBiAFNgIEIAQgBigCCCIDNgL0ASAGIAU2AgggBCgC+AEhCiAEIAYoAgw2AvgBIAYgBTYCACAGIAo2AgwgBhBuCyAEIAM2AvQBAkAgBCgChAEiBUUNACAFIAUoAgQiA0EBazYCBCADDQAgBSAFKAIAKAIIEQAAIAUQJAsCQCAHKAIEIgVFDQAgBSAFKAIEIgNBAWs2AgQgAw0AIAUgBSgCACgCCBEAACAFECQLAkAgBCgC9AEiAyAEKALwAUcEQCABQYABaiEUIARBCGohDyAEQYgBaiENIARBlAJqIRUDQAJAIAJFDQAgAi0AEEEBRw0AIAQQmQIgBCgC8AEiByAEKAL0ASICRwRAA0AgBygCACgCcCIFKAKAAUUEQCAFQYABaiAEEF4LIAdBCGoiByACRw0ACwsgFCAEEF4gACABKAKAATYCACAAIAEoAoQBIgA2AgQgAARAIAAgACgCBEEBajYCBAsgBCgCBCIARQ0DIAAgACgCBCIBQQFrNgIEIAENAyAAIAAoAgAoAggRAAAgABAkDAMLIANBCGsoAgAhBSADQQRrKAIAIgoEQCAKIAooAgRBAWo2AgQLIAUoAnAiAygCDCEGIAMoAhQaIAUoAnAhAwJAIAUtAABBAUYEQAJAIAMoAoABDQACQAJAAkACQCADLQAcDgMAAgEDCyAEQYABaiAFQfgAaiACEPoCIAQgBCkCgAE3AgAgBEIANwKAASAGIAQgDxDuASAEEC8aIAQoAoQBIgNFDQIgAyADKAIEIgdBAWs2AgQgBw0CIAMgAygCACgCCBEAACADECQMAgsgBEGAAWpBAiAFQfgAaiACENgEIAQgBCkCgAE3AgAgBEIANwKAASAGIAQgDxDuASAEEC8aIAQoAoQBIgNFDQEgAyADKAIEIgdBAWs2AgQgBw0BIAMgAygCACgCCBEAACADECQMAQsgBSgCeCAFKAJ8RgRAIARBgAFqEPsCIAQpAoABIRggBEIANwKAASAEIBg3AgAgBiAEIA8Q7gEgBBAvGiAEKAKEASIDRQ0BIAMgAygCBCIHQQFrNgIEIAcNASADIAMoAgAoAggRAAAgAxAkDAELIAQgBUH4AGogAhD6AgJAIAUoAoQBIAUoAogBRgRAIAQgBSgCeCIDKAIANgKAASAEIAMoAgQiAzYChAEgAwRAIAMgAygCBEEBajYCBAsgBiAEQYABaiIDIA0Q7gEgAxAvGgwBCyAEQYABaiAFQYQBaiACEPoCIARB6AFqIAQoAgAQKiAEKALoASEDIARB4AFqIAQoAoABECogBEGAAmogAyAEKALgAUEBIAIQ/QIgBCAEKQKAAjcCjAIgBEIANwKAAiAGIARBjAJqIgMgFRDuASADEC8aAkAgBCgChAIiA0UNACADIAMoAgQiB0EBazYCBCAHDQAgAyADKAIAKAIIEQAAIAMQJAsCQCAEKALkASIDRQ0AIAMgAygCBCIHQQFrNgIEIAcNACADIAMoAgAoAggRAAAgAxAkCwJAIAQoAuwBIgNFDQAgAyADKAIEIgdBAWs2AgQgBw0AIAMgAygCACgCCBEAACADECQLIAQoAoQBIgNFDQAgAyADKAIEIgdBAWs2AgQgBw0AIAMgAygCACgCCBEAACADECQLIAQoAgQiA0UNACADIAMoAgQiB0EBazYCBCAHDQAgAyADKAIAKAIIEQAAIAMQJAsgBEGAAWogBigCACgCACIDIAUoAnBBIGogAygCACgCBBEDACAEIAQoAoABNgIAIAQgBCgChAEiAzYCBCADBEAgAyADKAIEQQFqNgIECyAFKAJwQYABaiAEEE4CQCAEKAIEIgNFDQAgAyADKAIEIgZBAWs2AgQgBg0AIAMgAygCACgCCBEAACADECQLIAQoAoQBIgNFDQAgAyADKAIEIgZBAWs2AgQgBg0AIAMgAygCACgCCBEAACADECQLAkAgBSgCaCIGRQ0AIARBgAFqIAUoAnAoAoABIAVBCGoQ3gQgBCgChAEiBQRAIAUgBSgCBEEBajYCBAsgBCgCgAEhBwJAIAYoAgQiAyAGKAIIIghJBEAgAyAFNgIEIAMgBzYCACADQQhqIQMMAQsgAyAGKAIAIgxrQQN1IglBAWoiA0GAgICAAk8NCSAEQf////8BIAggDGsiCEECdSIMIAMgAyAMSRsgCEH4////B08bIAkgBhBLIQggBCgCCCIDIAU2AgQgAyAHNgIAIAQgA0EIajYCCCAEKAIEIAYoAgQgBigCACIHayIDayEMIAMEQCAMIAcgA/wKAAALIAYoAgAhByAGIAw2AgAgBCAHNgIEIAYgBCgCCCIDNgIEIAQgBzYCCCAGKAIIIQwgBiAEKAIMNgIIIAQgDDYCDCAIIAc2AgAgCBBuCyAGIAM2AgQgBUUNACAFIAUoAgQiA0EBazYCBCADDQAgBSAFKAIAKAIIEQAAIAUQJAsgBCAEKAL0AUEIaxAvNgL0AQwBCyADLQAcIQwCfwJAIAUoAmhFDQACQAJAIAwgBS0AAUcNACAFKAJ0IgcEQCAHKAIEQQFKDQELIAMoAhAiA0UNACADKAIERQ0BCyAGKAIEIAYoAgBrQQhHDQELIAQgBCgC9AFBCGsQLzYC9AEgBSgCcCIDKwMgIRkgAysDKCEaIAMrAzAhGyADKwM4IRwgAysDQCEdIAMrA0ghHiADKwNQIR8gAysDWCEgIAMrA2AhISADKwNoISIgAysDcCEjIAMrA3ghJCAEQoCAgICAgID4PzcDeCAEICQ5A3AgBCAjOQNoIAQgIjkDYCAEQgA3A1ggBCAhOQNQIAQgIDkDSCAEIB85A0AgBEIANwM4IAQgHjkDMCAEIB05AyggBCAcOQMgIARCADcDGCAEIBs5AxAgBCAaOQMIIAQgGTkDACAEQYABaiAFQQhqIAQQ8AEgBSgCaCERIAUoAmwMAQsgBUEBOgAAIARCgICAgICAgPg/NwOAASANQgA3AxAgDUIANwMIIA1CADcDACAEQoCAgICAgID4PzcDoAEgBEIANwO4ASAEQgA3A7ABIARCADcDqAEgBEKAgICAgICA+D83A8ABIARCADcD2AEgBEIANwPQASAEQgA3A8gBIAVB+ABqIREgBUGEAWoLIRIgBigCACIDIAYoAgRGDQBBACEHIAxBAUYhEwNAIAQgBEGAAWpB4AD8CgAAIARBACAMIBMgB0EAR3EiBRs6AIsCIAQgEiARIAUbIgU2AugBIARBACASIAcbQQAgExs2AuABAkAgAyAHQQN0aiIDKAIAIgggCCgCACgCCBEEAEEDRgRAIARBgAJqIAMoAgAiAyAEIAMoAgAoAgQRAwAgBCgChAIiAwRAIAMgAygCBEEBajYCBAsgBCgCgAIhCQJAIAUoAgQiCCAFKAIIIgtJBEAgCCADNgIEIAggCTYCACAIQQhqIQMMAQsgCCAFKAIAIg5rQQN1IhBBAWoiCEGAgICAAk8NCiAEQYwCakH/////ASALIA5rIgtBAnUiDiAIIAggDkkbIAtB+P///wdPGyAQIAUQSyELIAQoApQCIgggAzYCBCAIIAk2AgAgBCAIQQhqNgKUAiAEKAKQAiAFKAIEIAUoAgAiCGsiA2shCSADBEAgCSAIIAP8CgAACyAFKAIAIQggBSAJNgIAIAQgCDYCkAIgBSAEKAKUAiIDNgIEIAQgCDYClAIgBSgCCCEJIAUgBCgCmAI2AgggBCAJNgKYAiALIAg2AgAgCxBuCyAFIAM2AgQgBCgChAIiBUUNASAFIAUoAgQiA0EBazYCBCADDQEgBSAFKAIAKAIIEQAAIAUQJAwBCyAEQQA6AP8BIAQgAygCADYCgAIgBCADKAIEIgU2AoQCIAUEQCAFIAUoAgRBAWo2AgQLQaABECMiCEGIkwI2AgAgCEIANwIEIwBB4ABrIgkkACAELQD/ASELIAQtAIsCIQ4gCSAEQeAA/AoAACAEKALoASEQIAQoAuABIRYgBCgChAIhAyAEQQA2AoQCIAQoAoACIRcgBEEANgKAAiAIQRBqIgUgDjoAASAFIAs6AAAgBUEIaiAJQeAA/AoAACAFIAM2AnQgBSAXNgJwIAUgFjYCbCAFIBA2AmgCQCADRQRAIAVCADcDiAEgBUIANwOAASAFQgA3A3gMAQsgAyADKAIEQQFqNgIEIAVCADcDiAEgBUIANwOAASAFQgA3A3ggAyADKAIEIgtBAWs2AgQgCw0AIAMgAygCACgCCBEAACADECQLIAlB4ABqJAACQCAEKAL0ASIDIAQoAvgBIglJBEAgAyAINgIEIAMgBTYCACADQQhqIQMMAQsgAyAEKALwASILa0EDdSIOQQFqIgNBgICAgAJPDQggBEGMAmpB/////wEgCSALayIJQQJ1IgsgAyADIAtJGyAJQfj///8HTxsgDiAEQfABahBLIQkgBCgClAIiAyAINgIEIAMgBTYCACAEIANBCGo2ApQCIAQoApACIAQoAvQBIAQoAvABIghrIgVrIQMgBQRAIAMgCCAF/AoAAAsgBCAEKALwASIFNgKQAiAEIAM2AvABIAQoApQCIQMgBCAFNgKUAiAEIAM2AvQBIAQoAvgBIQggBCAEKAKYAjYC+AEgBCAINgKYAiAJIAU2AgAgCRBuCyAEIAM2AvQBIAQoAoQCIgVFDQAgBSAFKAIEIgNBAWs2AgQgAw0AIAUgBSgCACgCCBEAACAFECQLIAdBAWoiByAGKAIEIAYoAgAiA2tBA3VJDQALCwJAIApFDQAgCiAKKAIEIgVBAWs2AgQgBQ0AIAogCigCACgCCBEAACAKECQLIAQoAvQBIgMgBCgC8AFHDQALCyAAIAEoAoABNgIAIAAgASgChAEiADYCBCAARQ0AIAAgACgCBEEBajYCBAsgBCAEQfABajYCACAEEGULIARBoAJqJAAPCxAmAAsQJgALwwQCBH8MfCMAQfABayIDJABBmAEQIyIGQbCTAjYCACAGQgA3AgQjAEEQayIFJAAgBkEQaiIEQgA3AgQgBEG0kgI2AgAgBUEANgIIIAVCADcCACAEQQxqIAUQ0wQgBSAFNgIMIAVBDGoQZSAEQgA3AyggBEKAgICAgICA+D83AyAgBEIANwMwIARCADcDOCAEQgA3A0ggBEKAgICAgICA+D83A0AgBEIANwNQIARCADcDWCAEQgA3A2ggBEKAgICAgICA+D83A2AgBEIANwNwIARCADcDeCAEQgA3A4ABIAVBEGokACADQegBaiIFIAY2AgQgBSAENgIAIAUgBkEUaiAEEI8BIAMoAugBQQxqIgQgAUEMaiIFRwRAIAQgBRBeIARBCGogBUEIahBeCyABKwMgIQcgASsDKCEIIAErAzAhCSABKwM4IQogASsDQCELIAErA0ghDCABKwNQIQ0gASsDWCEOIAErA2AhDyABKwNoIRAgASsDcCERIAErA3ghEiADQoCAgICAgID4PzcDgAEgAyASOQN4IAMgETkDcCADIBA5A2ggA0IANwNgIAMgDzkDWCADIA45A1AgAyANOQNIIANCADcDQCADIAw5AzggAyALOQMwIAMgCjkDKCADQgA3AyAgAyAJOQMYIAMgCDkDECADIAc5AwggA0GIAWoiBCACIANBCGoQ8AEgAygC6AEiAkEgaiAEQeAA/AoAACACIAEtABw6ABwgACACNgIAIAAgAygC7AE2AgQgA0HwAWokAAtnAQJ/IwBBgAFrIgQkACAEIAIQ3wEjAEEQayICJAAgASgCACIFQgA3AgAgBUIONwIIIAJBCGogBCADIAEoAgAQkwUgAiACKQIINwMAIAAgAhDmAiACQRBqJAAgBBCqASAEQYABaiQAC44BAQJ/IwBBgAFrIgQkACAEIAIQ3wEjAEEQayICJAAgASgCACIDQgA3AgAgA0IHNwIIIAEoAgAhA0GoAhAjIgFBoJACNgIAIAFCADcCBCABQRBqIAQgAxCTAyEDIAIgATYCDCACIAM2AgggAiACKQIINwMAIAAgAhDmAiACQRBqJAAgBBCqASAEQYABaiQAC9oCAQd/IwBB0ABrIgYkACAGQQA2AkggAQRAIAYgATYCPCAGQYyPAjYCOCAGIAZBOGo2AkgLIAZBCGoiByACQTD8CgAAIwBB4ABrIgIkAEGoAhAjIgFBoJACNgIAIAFCADcCBEEQIQkgAUEQahA7IQogAkHIAGogBkE4aiILEFchCCACQRBqIgwgB0Ew/AoAACAKIAggDCADIAQgBUEAEPsDAkAgCCAIKAIQIgdHBEBBFCEJIAdFDQELIAcgBygCACAJaigCABEAAAsgAiABNgJEIAIgCjYCQCABIAEoAgRBAWo2AgQgAiACKQJANwMIIAAgAkEIahBIGiABIAEoAgQiAEEBazYCBCAARQRAIAEgASgCACgCCBEAACABECQLIAJB4ABqJAACQCALIAYoAkgiAEYEf0EQBSAARQ0BQRQLIQEgACAAKAIAIAFqKAIAEQAACyAGQdAAaiQACwQAQQML4AEBAn8jAEEQayICJABBoAEQIyIEQYCUAjYCACAEQgA3AgQgBEEQaiIDQgA3AyAgA0KAgICAgICA+D83AxggA0IANwIMIANCADcCBCADQgA3AyggA0IANwMwIANCADcDQCADQoCAgICAgID4PzcDOCADQgA3A0ggA0IANwNQIANCgICAgICAgPg/NwNYIANBmJICNgIAIANB4ABqQQBBMPwLACADQQxqIAFBDGoQXiADQRhqIAFBGGpB4AD8CgAAIAAgBDYCBCAAIAM2AgAgACAEQRRqIAMQjwEgAkEQaiQAC48HAg9/A34jAEEgayIGJAAgBkEANgIYIAMEQCAGIAM2AgwgBkG0jgI2AgggBiAGQQhqNgIYCyAGQQhqIQsjAEHwAGsiAyQAIANBIGogAUEAECsQKgJAIAMoAiAiBygCRCIEBEAgACAEEEYMAQtBqAIQIyIEQaCQAjYCACAEQgA3AgQgBEEQaiAHEDchByADIAQ2AhwgAyAHNgIYIARBmAFqIQcgARCfBCEOAkAgBCgCnAEiBUUNACAHKAIAIQkgBUEDdCIFECchCCAFRQ0AIAggCSAF/AoAAAsCQCACRQRAIARBADYCnAEgBxCUAQwBCyABEJ4EIQUgA0EANgJYIANCADcCUCADQdAAaiACIAVsRAAAAAAAAAAAEIABIAcoAgAiBQRAIAUQIgsgBCADKAJQNgKYASAEIAMoAlQ2ApwBIAQgAygCWDYCoAEgARC/ASIPRQ0AIAJBA3QhDCACQQBMIRBBACEBA0AgA0ECNgJMIANCgICAgBA3AkQgAUEDbCERQQAhBQNAIANBxABqIAVqKAIAIBFqQQJ0IgogBCgCiAFqKAIAIQkCQCALKAIQIg1FBEAgECAMRXINASAHKAIAIAIgCWxBA3RqQQAgDPwLAAwBCyAEKAKYASESIAMgBCgCWCAEKAJoIApqKAIAQRhsaiIKKQMQIhM3AzggAyAKKQMIIhQ3AzAgAyAKKQMAIhU3AyggAyAVNwNQIAMgFDcDWCADIBM3A2AgAyASIAIgCWxBA3RqNgJsIAMgCCAJIA5sQQN0ajYCaCANIANB7ABqIANB0ABqIANB6ABqIA0oAgAoAhgRBQALIAVBBGoiBUEMRw0ACyABQQFqIgEgD0cNAAsLIAQgAjYCUCADQdAAaiADQRhqEFkgAyADKQJQIhM3AhAgA0IANwJQIAMgEzcDCCAAIANBCGoQQwJAIAMoAlQiAEUNACAAIAAoAgQiAUEBazYCBCABDQAgACAAKAIAKAIIEQAAIAAQJAsgCARAIAgQIgsgAygCHCIARQ0AIAAgACgCBCIBQQFrNgIEIAENACAAIAAoAgAoAggRAAAgABAkCwJAIAMoAiQiAEUNACAAIAAoAgQiAUEBazYCBCABDQAgACAAKAIAKAIIEQAAIAAQJAsgA0HwAGokAAJAIAsgBigCGCIARgR/QRAFIABFDQFBFAshASAAIAAoAgAgAWooAgARAAALIAZBIGokAAvHAwIDfwF+IwBBIGsiAyQAIAMgAjYCHCADQeyNAjYCACADIAM2AhAgAyADQRxqNgIEIwBB0ABrIgIkACACQcQAaiABQQAQKxAqAkAgAigCRCIEKAJEIgEEQCAAIAEQRgwBC0GoAhAjIgFBoJACNgIAIAFCADcCBEEQIQUgAUEQaiAEEDchBCACIAE2AkAgAiAENgI8IAQgAkEgaiADEFciBBC7BAJAIAQgBCgCECIBRwRAQRQhBSABRQ0BCyABIAEoAgAgBWooAgARAAALIAJBEGogAkE8ahBZIAIgAikCECIGNwIYIAJCADcCECACIAY3AwggACACQQhqEEMCQCACKAIUIgBFDQAgACAAKAIEIgFBAWs2AgQgAQ0AIAAgACgCACgCCBEAACAAECQLIAIoAkAiAEUNACAAIAAoAgQiAUEBazYCBCABDQAgACAAKAIAKAIIEQAAIAAQJAsCQCACKAJIIgBFDQAgACAAKAIEIgFBAWs2AgQgAQ0AIAAgACgCACgCCBEAACAAECQLIAJB0ABqJAACQCADIAMoAhAiAEYEf0EQBSAARQ0BQRQLIQEgACAAKAIAIAFqKAIAEQAACyADQSBqJAAL4QIBAn8jAEEgayIEJAAgBCADOgAeAkAgA0H9AXEgAigCACIFIAUoAgAoAggRBABBA0ZyRQRAIAIoAgAhBSACKAIEIgIEQCACIAIoAgRBAWo2AgQLIAAgBSAEIAFBBGoQmwIiACADEN8EAkAgACgCBCIARQ0AIAAgACgCBCIBQQFrNgIEIAENACAAIAAoAgAoAggRAAAgABAkCyACRQ0BIAIgAigCBCIAQQFrNgIEIAANASACIAIoAgAoAggRAAAgAhAkDAELIAQgAUEEahCbAiIBIAIoAgA2AgggASACKAIEIgI2AgwgAgRAIAIgAigCBEEBajYCBAsgBEEANgIYIARCADcCECAEQRBqIAEgAUEQaiICQQIQgQMDQCACQQhrEC8iAiABRw0ACyAEIARBEGoiASAEQR5qEIADIAAgBCgCADYCACAAIAQoAgQ2AgQgBCABNgIAIAQQZQsgBEEgaiQAC60EAgZ/AX4jAEEgayIDJAAgA0EANgIYIAIEQCADIAI2AgwgA0GUjQI2AgggAyADQQhqNgIYCyADQQhqIQcjAEHQAGsiAiQAIAJBxABqIAFBABArECoCQCACKAJEIgQoAkQiAQRAIAAgARBGDAELQagCECMiAUGgkAI2AgAgAUIANwIEQRAhCCABQRBqIAQQNyEEIAIgATYCQCACIAQ2AjwgAkEgaiAHEFchBiMAQSBrIgEkACABIAY2AgwgAUGklQI2AgggASABQQhqIgU2AhggBCAFELsEAkAgBSABKAIYIgRGBH9BEAUgBEUNAUEUCyEFIAQgBCgCACAFaigCABEAAAsgAUEgaiQAAkAgBiAGKAIQIgFHBEBBFCEIIAFFDQELIAEgASgCACAIaigCABEAAAsgAkEQaiACQTxqEFkgAiACKQIQIgk3AhggAkIANwIQIAIgCTcDCCAAIAJBCGoQQwJAIAIoAhQiAEUNACAAIAAoAgQiAUEBazYCBCABDQAgACAAKAIAKAIIEQAAIAAQJAsgAigCQCIARQ0AIAAgACgCBCIBQQFrNgIEIAENACAAIAAoAgAoAggRAAAgABAkCwJAIAIoAkgiAEUNACAAIAAoAgQiAUEBazYCBCABDQAgACAAKAIAKAIIEQAAIAAQJAsgAkHQAGokAAJAIAcgAygCGCIARgR/QRAFIABFDQFBFAshASAAIAAoAgAgAWooAgARAAALIANBIGokAAsGAEGIkgILFAAgAEEEakEAIAEoAgRB5PAARhsLCwAgAUHYkQI2AgALEQBBCBAjIgBB2JECNgIAIAALBgBByJECCxQAIABBBGpBACABKAIEQfvrAEYbCwsAIAFBkJECNgIACxEAQQgQIyIAQZCRAjYCACAAC5sDAgl/AXwjAEGQAWsiAyQAIANBhAFqIAIQlgUgA0EgakEAQeAA/AsAIANCgoCAgDA3AhggA0KAgICAEDcCECADQThqIQggAygChAEhCQNAIANBEGogBmooAgAhBCADQoCAgIAQNwIEIAkgBEEFdGohCiADQQI2AgwgA0EgakEwQcgAIARBAkYbaiELQQAhAgNAIAogA0EEaiACaigCACIHQQN0aisDACEMIANBIGohBQJAAkACQCAEDgICAAELIAghBQwBCyALIQULIAVBCEEQIAdBAUYbQQAgBxtqIAw5AwAgAkEEaiICQQxHDQALIAZBBGoiBkEQRw0ACyMAQSBrIgIkACACQRBqIAEQigEgAkEYaiACKAIQIgEgA0EgaiABKAIAKAIEEQMAIAIgAikCGDcDCCAAIAJBCGoQQwJAIAIoAhQiAEUNACAAIAAoAgQiAUEBazYCBCABDQAgACAAKAIAKAIIEQAAIAAQJAsgAkEgaiQAIAMoAoQBIgAEQCADIAA2AogBIAMoAowBGiAAECILIANBkAFqJAALCwAgACABQQIQiAELCwAgACABQQEQiAELCwAgACABQQAQiAELDQAgACABIAJBAhDoAQsNACAAIAEgAkEBEOgBCw0AIAAgASACQQAQ6AELBgBBgJECCxQAIABBBGpBACABKAIEQefoAEYbC/0BAQN/IwBBgAFrIgMkACADIAEQ3wEjAEEgayIBJABBJBAjIgJCADcCDCACQYSWAjYCACACQgA3AgQgAkIANwIUIAJCADcCHCAAIAI2AgQgACACQQxqNgIAQagCECMiAkGgkAI2AgAgAkIANwIEIAJBEGogA0EAEJMDIQQgASACNgIQIAEgBDYCDCABQRRqIAFBDGoQ3AQgACABKAIUNgIIIAAgASgCGDYCDCABQgA3AhQCQCABKAIQIgJFDQAgAiACKAIEIgRBAWs2AgQgBA0AIAIgAigCACgCCBEAACACECQLIABCADcCECABQSBqJAAgAxCqASADQYABaiQACxUAIAFByJACNgIAIAEgACgCBDYCBAsdAQF/QQgQIyIBQciQAjYCACABIAAoAgQ2AgQgAQsPACAAQaCQAjYCACAAECILDQAgAEGgkAI2AgAgAAvwEAITfwJ+IwBB0AFrIgMkACADQcgBaiICIAFBABArECoCQCADKALIASgCRCIEBEAgA0GwAWoiASAEEEYgAEEANgIIIABCADcCACAAIAEgAkEBEJYCIAEQKBoMAQsgA0GkAWogARCQAiICEJYBIQ0gAgRAIAKtIRYDQCANKAIAIBWnQQN0aiAVNwMAIBVCAXwiFSAWUg0ACwsgAygCyAEiBCgCXARAQQAhAgNAIAQoAlggAkECdGoiBSgCACIGIAVBeEEEIAJBA29BAkYbaigCACIFSARAIA0gBiAFEF8gAygCyAEhBAsgAkEBaiICIAQoAlxJDQALCyADQQA2AqABIANCADcCmAECQCANIANBmAFqEIwFIhNBAUYEQCAAQQEQkQMoAgAgARCjBAwBCwJAIAMoApwBIgQgAygCmAEiAkYNACAEIAJrIgQQJyEOIARFDQAgDiACIAT8CgAACyABEJACIQ8gAEEANgIIIABCADcCACATQQBKBEADQEGoAhAjIghBoJACNgIAIAhCADcCBCAIQRBqEDshBiAIIAMoAsgBIgIrAzA5A0AgCCACKwM4OQNIQQAhAiADQQA2ApABIANCADcCiAEgA0GIAWogDxAlIAMgDzYCjAEgAygCiAEiBSEEIA8EQANAIBAgDiACQQJ0aigCAEYEQCAEIAI2AgAgBEEEaiEECyACQQFqIgIgD0cNAAsLIANCADcDgAEgA0IANwN4IANCADcDcCADQgA3AyggA0IANwMwIANCADcDOCAIQdgAaiAEIAVrQQJ1IgQgA0EoahBnIANCADcDaCADQgA3A2AgA0IANwNYIANCADcDECADQgA3AxggA0IANwMgIAhBqAFqIAQgA0EQahBnQQAhAiADQYgBaiAEQQAQMSADKAKMASIEBEAgCCgCWCEKIAMoAsgBIgsoAkghDCADKAKIASEFA0AgCiACQRhsaiIHIAwgBSACQQJ0aigCAEEYbGoiCSkDEDcDECAHIAkpAwg3AwggByAJKQMANwMAIAJBAWoiAiAERw0ACyAIKAKoASEKIAsoApgBIQtBACECA0AgCiACQRhsaiIHIAsgBSACQQJ0aigCAEEYbGoiCSkDEDcDECAHIAkpAwg3AwggByAJKQMANwMAIAJBAWoiAiAERw0ACwtBACECIANBADYCUCADQgA3AkggA0HIAGogARC/ARAlIAMoAsgBIQcgARC/AQRAA0AgECAOIAcoAlggAkEMbGooAgBBAnRqKAIARgRAAkAgAygCTCIEIAMoAlAiBU8EQCADQcgAaiAFQQF0QYABIAUbECUgAygCSCADKAJMIgRBAnRqIAI2AgAMAQsgAygCSCAEQQJ0aiACNgIACyADIARBAWo2AkwLIAEQvwEgAkEBaiICSw0ACwsgAygCTARAIAMoAsgBIQcjAEFAaiIFJAAgBigC3AEhAiAGQdgBaiIEIAMoAkwiCRA5IAYgCTYC3AEgAkERSSACIAlBAXQiCk1yRQRAIAQQgwELIAMoAkwiCwRAIAQoAgAhBCAHKALYASEMIAMoAkghEUEAIQIDQCAEIAJBBHRqIhIgDCARIAJBAnRqKAIAQQR0aiIUKQIINwIIIBIgFCkCADcCACACQQFqIgIgC0cNAAsLIAcoAswBIgIgB0HQAWoiC0cEQCAGQcwBaiEMA0AgBSACQRBqIgQ2AjwgBUEoaiAMIAQgBUE8ahB5IAUoAihBGGogAkEYakHqAPwKAAACQCACKAIEIgQEQANAIAQiAigCACIEDQAMAgsACwNAIAIgAigCCCICKAIARw0ACwsgAiALRw0ACwsgBygCQCICBEAgBiACNgJAIAZBiAFqIAdBiAFqEJICCwJAIAcoAqwBIAcoAlxBA25HDQAgBigCrAEhAiAGQagBaiIEIAkQMyAGIAk2AqwBIAJBEUkgAiAKTXJFBEAgBBBxCyADKAJMIgtFDQAgBCgCACEMIAcoAqgBIREgAygCSCESQQAhAgNAIAwgAkEYbGoiBCARIBIgAkECdGooAgBBGGxqIgopAxA3AxAgBCAKKQMINwMIIAQgCikDADcDACACQQFqIgIgC0cNAAsLIAcoAlwhBEEAIQIgBUEANgIwIAVCADcCKCAFQShqIARBA24iBBAlIAUgBDYCLCAJBEAgAygCSCEEIAUoAighCgNAIAogBCACQQJ0aigCAEECdGogAjYCACACQQFqIgIgCUcNAAsLIAZB2ABqIgogCUEDbCICEMkBAkAgBygCvAFFDQAgBigCvAEhBCAGQbgBaiILIAIQVSAGIAI2ArwBIARBEUkgBCAJQQZsTXINACALEJMBCyAFIAo2AgAgBSAGKAK4ATYCBCAGKAK8ASECIAUgB0HYAGo2AgwgBSACNgIIIAUgBykDuAE3AhAgBSADKQJINwIYIAUgBSkCKDcCICAJQQAgBRDdAyAFKAIoIgIEQCACECILIAVBQGskACAGIANBiAFqIAMoAsgBKAJMQQAQ4QMgBhBYIAZBABBUIAMgCDYCRCADIAY2AkAgCCAIKAIEQQFqNgIEIAMgAykCQDcDCCAAIANBsAFqIANBCGoQSCICEJgBIAIQKBoLIAMoAkgiAgRAIAIQIgsgAygCiAEiAgRAIAIQIgsgCCAIKAIEIgJBAWs2AgQgAkUEQCAIIAgoAgAoAggRAAAgCBAkCyAQQQFqIhAgE0cNAAsLIA5FDQAgDhAiCyADKAKYASIABEAgAyAANgKcASADKAKgARogABAiCyANKAIAIgBFDQAgDSAANgIEIA0oAggaIAAQIgsCQCADKALMASIARQ0AIAAgACgCBCIBQQFrNgIEIAENACAAIAAoAgAoAggRAAAgABAkCyADQdABaiQAC8cQAhR/BnwjAEHgAGsiBCQAIARBADYCXCAEQgA3AlQCQAJAIAEoAgAiBiABKAIEIgpHBEADQCAGKAIEIgEgBigCACIHa0EEdSEIQQAhBQJAAkAgASAHRg0AA0AgByAFQQR0aisDAEQAAAAAAAAAAGNFDQEgBUEBaiIFIAhHDQALDAELIAUgCEYNACAEQQA2AkggBEIANwJAIARB1ABqIARBQGsQaCAEKAJAIgEEQCAEIAE2AkQgBCgCSBogARAiCyAFIQEDQCAGKAIAIg0gAUEEdCIHaiIIKwMAIhhEAAAAAAAAAABmBEAgBCgCWEEMayAIEEwgBigCACINIAdqKwMAIhggGSAYIBlkGyEZCyAYRAAAAAAAAAAAYyANIAFBAWoiAUEAIAEgBigCBCANa0EEdUcbIgFBBHRqIggrAwAiG0QAAAAAAAAAAGNHBEAgByANaisDCCEdIAgrAwghHCAEKAJYIARCADcDQCAEIBwgGyAdIByhoiAYIBuho6E5A0hBDGsgBEFAaxBMCyABIAVHDQALCyAGQQxqIgYgCkcNAAsgBCgCVCAEKAJYRw0BCyAAEOoBDAELRAAAAAAAgHZAIAMgA0QAAAAAAIB2QGQbIRogAkEDTgR8IAK4BSAaIBkQwgG3okQAAAAAAIB2QKMLIQNBqAIQIyIJQaCQAjYCACAJQgA3AgQgCUEQahA7IQwgBEEANgJIIARCADcCQCAEQQA2AjwgBEIANwI0IARBADYCMCAEQgA3AiggBCgCVCILIAQoAlgiFUcEQCAJQdgAaiEWIBogA/wCIhK3oyEZQQAgEiAaRAAAAAAAgHZAYmoiD2shFwNAQQAhBkEAIQIgCygCACIBIQUgCygCBCIKIAFHBEADQCAGIAUrAwBEAAAAAAAAAABkIghqIQYgAiAIRWohAiAFQRBqIgUgCkcNAAsgBiAPbCACaiEIQQAhAgNAIAkoAlwhDiAaRAAAAAAAgHZAYSITRQRAIAQgDjYCGCAEQTRqIARBGGoQPSALKAIAIQELIAEgAkEEdGoiBSsDCCEbIAUrAwAhGEEAIQUgAiIGRQRAIAsoAgQgAWtBBHUhBiAIIQULIA9BAEoEQCAFIA5qQX8gFyABIAZBBHRqQRBrKwMAIhxEAAAAAAAAAABhIg0baiEQQQAhAQNAAkACQEEAIAEgGEQAAAAAAAAAAGQbDQAgGCAZIAG4oiIDRAAAAAAAgFZAoBA+oiEdIBggAxA+oiEDAkAgCSgCXCIFIAkoAmAiBk8EQCAWIAZBAXRBgAEgBhsQMyAJIAkoAlwiBUEBajYCXAwBCyAJIAVBAWo2AlwLIAkoAlggBUEYbGoiBSAdOQMAIAUgGzkDECAFIAM5AwggEw0AIAFFDQELIAEgEiABG0EBayERIBhEAAAAAAAAAABkBEAgDiARaiEHIAEgDmohCkEAIBEgDRsgEGohBQJAIAQoAkQiBiAEKAJIIhRPBEAgBEFAayAUQQF0QYABIBQbEDUgBCAEKAJEIgZBAWo2AkQMAQsgBCAGQQFqNgJECyAEKAJAIAZBDGxqIgYgCjYCACAGIAU2AgggBiAHNgIECyAcRAAAAAAAAAAAZEUNACAQIBFqIQogAUEAIBhEAAAAAAAAAABiGyAOaiEGAkAgBCgCRCIFIAQoAkgiB08EQCAEQUBrIAdBAXRBgAEgBxsQNSAEIAQoAkQiBUEBajYCRAwBCyAEIAVBAWo2AkQLIAQoAkAgBUEMbGoiBSAKNgIAIAUgBjYCCCAFIAEgEGo2AgQLIAFBAWoiASAPRw0ACwsgE0UEQCAEIAkoAlxBAWs2AhggBEEoaiAEQRhqED0LIAJBAWoiAiALKAIEIAsoAgAiAWtBBHVJDQALCyALQQxqIgsgFUcNAAsLAkAgGkQAAAAAAIB2QGENACAEQRhqIARB1ABqIAkrA0BBARCHBCAEKAIYIgEgBCgCHCICRwRAIAQoAkQhBQNAIAQoAjQiCCABKAIIQQJ0aigCACEKIAggASgCBEECdGooAgAhBiAIIAEoAgBBAnRqKAIAIQgCfyAEKAJIIgcgBU0EQCAEQUBrIAdBAXRBgAEgBxsQNSAEKAJAIAQoAkQiBUEMbGoMAQsgBCgCQCAFQQxsagsiByAINgIAIAcgCjYCCCAHIAY2AgQgBCAFQQFqIgU2AkQgAUEMaiIBIAJHDQALIAQoAhwhAiAEKAIYIQELIAEgAkcEQCAEKAJEIQUDQCAEKAIoIgggASgCAEECdGooAgAhCiAIIAEoAgRBAnRqKAIAIQYgCCABKAIIQQJ0aigCACEIAn8gBCgCSCIHIAVNBEAgBEFAayAHQQF0QYABIAcbEDUgBCgCQCAEKAJEIgVBDGxqDAELIAQoAkAgBUEMbGoLIgcgCDYCACAHIAo2AgggByAGNgIEIAQgBUEBaiIFNgJEIAFBDGoiASACRw0ACyAEKAIYIQELIAFFDQAgBCABNgIcIAQoAiAaIAEQIgsgBEEANgIgIARCADcCGCAMIARBQGsgBEEYahCeASAEKAIYIgEEQCABECILIAwQjgEgDBBYIAxBABCNASAMQQAQVCAMEFogBCAJNgIUIAQgDDYCECAJIAkoAgRBAWo2AgQgBCAEKQIQNwMIIAAgBEEIahBIGiAEKAIoIgAEQCAEIAA2AiwgBCgCMBogABAiCyAEKAI0IgAEQCAEIAA2AjggBCgCPBogABAiCyAEKAJAIgAEQCAAECILIAkgCSgCBCIAQQFrNgIEIAANACAJIAkoAgAoAggRAAAgCRAkCyAEIARB1ABqNgJAIARBQGsQKSAEQeAAaiQAC5sHAg1/AX4jAEEgayIIJAAgCEEUaiABEMYDIAgoAhQiASAIKAIYIg1HBEADQCAIQQhqIAEQPCEKIAAoAgQhBCAKKAIAIgMhByAIKAIMIQIjAEEgayILJAACQCACIANrQQR1IglBAEwNACAAKAIIIgUgACgCBCIDa0EEdSAJTgRAIAMgBGsiDEEEdSIOIAlIBEAgAiAHIAxqIgVrIgZFIAIgBUZyRQRAIAMgBSAG/AoAAAsgACADIAZqIgU2AgQgDkEATA0CIAQgCUEEdCIGaiEJIAMgBSICIAZrIgZLBEADQCACIAYpAwg3AwggAiAGKQMANwMAIAJBEGohAiAGQRBqIgYgA0kNAAsLIAAgAjYCBAJAIAUgCUYNACAFIAlrIgJFDQAgBSACayAEIAL8CgAACyAEIAxqIQMgBCECA0AgBykDACEPIAIgBykDCDcDCCACIA83AwAgB0EQaiEHIAJBEGoiAiADRw0ACwwCCyAEIAlBBHQiBmohBSADIgIgBmsiBiACSQRAA0AgAiAGKQMINwMIIAIgBikDADcDACACQRBqIQIgBkEQaiIGIANJDQALCyAAIAI2AgQCQCADIAVGDQAgAyAFayICRQ0AIAMgAmsgBCAC/AoAAAsgBCAJQQR0aiEDIAQhAgNAIAcpAwAhDyACIAcpAwg3AwggAiAPNwMAIAdBEGohByACQRBqIgIgA0cNAAsMAQsgAyAAKAIAIgJrQQR1IAlqIgNBgICAgAFJBEAgC0EMakH/////ACAFIAJrIgVBA3UiBiADIAMgBkkbIAVB8P///wdPGyAEIAJrQQR1IAAQMiIDKAIIIgIgCUEEdGohBQNAIAIgBykDCDcDCCACIAcpAwA3AwAgB0EQaiEHIAJBEGoiAiAFRw0ACyADIAU2AgggAygCBBogACgCBCAEayICBEAgBSAEIAL8CgAACyADIAMoAgggACgCBCAEa2o2AgggACAENgIEIAMoAgQgBCAAKAIAIgVrIgJrIQQgAgRAIAQgBSAC/AoAAAsgACgCACECIAAgBDYCACADIAI2AgQgACADKAIINgIEIAMgAjYCCCAAKAIIIQQgACADKAIMNgIIIAMgAjYCACADIAQ2AgwgAxA2DAELECYACyALQSBqJAAgCigCACICBEAgCCACNgIMIAgoAhAaIAIQIgsgAUEMaiIBIA1HDQALCyAIIAhBFGo2AgggCEEIahApIAhBIGokAAvMBAICfwN8IwBB0ABrIgMkAAJAIAFEAAAAAAAAAABlBEAgABDqAQwBCyACQQBKBH8gAkEDakECdgUgARDCAUEEbQshAiADQQI2AkAgA0HEAGogA0FAaxCSBSADIAI2AhwgA0HIkAI2AhggAyADQRhqIgI2AiggA0EwaiADKAJEIAJBABDVAyADKAIwIgIEQCACECILIANBADYCOCADQgA3AjACQCADKAIoIgIgA0EYakYEf0EQBSACRQ0BQRQLIQQgAiACKAIAIARqKAIAEQAACyADKAJEIgIoAkwiBAR/IAIoAkgiAiAEQRhsaiEEA0BEAAAAAAAA8D8gAisDAKFEGC1EVPsh+T+iEJcBIQVEAAAAAAAA8D8gAisDCKFEGC1EVPsh+T+iEJcBIQcgAiABRAAAAAAAAPA/IAIrAxChRBgtRFT7Ifk/ohCXASIGIAUgBaIgByAHoqAgBiAGoqCfIgajojkDECACIAEgByAGo6I5AwggAiABIAUgBqOiIgU5AwAgBSAFYgRAIAJCADcDECACQgA3AwggAkIANwMACyACQRhqIgIgBEcNAAsgAygCRAUgAgsQjgEgAygCRBBYIAMoAkRBABCNASADKAJEQQAQVCADKAJEEFogAyADKAJENgIQIAMgAygCSCICNgIUIAIEQCACIAIoAgRBAWo2AgQLIAMgAykCEDcDCCAAIANBCGoQSBogAygCSCIARQ0AIAAgACgCBCICQQFrNgIEIAINACAAIAAoAgAoAggRAAAgABAkCyADQdAAaiQAC8NFAxR/A34HfCAF/AIhBkQAAAAAAAAAACEFIwBBMGsiEiQAAkBBAyADIANBA08bIgNBAUYEQEECIQdEGC1EVPshCUAgBkECTAR/IAIQwgEFIAYLt6MQlwEgEkEcaiABEE1EAAAAAAAA8L+gIAKZmqIhBSASKAIcIQEMAQsgEkEcaiABEE0gEigCHCEBAkACQCADQQJrDgIAAQILQQMhBwwBC0EBIQcLIBJBJGohEyMAQcABayIQJAAgEEEANgK4AQJAAkAgAkQAAAAAAAAAAGEEQCATQQA2AgggE0IANwIAIBMgASgCACIDIAEoAgQiASABIANrQQxtEEcMAQsgEEEANgIYIBBBIGpBAEHcAPwLACAQQQA2ArABIBBBADsBmAEgECAEOQOIASAQQgE3AnwgECAFIwBBEGsiBiQARAAAAAAAACRAEK0BIQMCfAJARAAAAAAAACBAEK0BIgpB/w9xIgxBvghrIg1B/35LIANB/w9rQYJwT3ENAEQAAAAAAABQQEKAgICAgICAkMAAEKYDDQEaRAAAAAAAAFlAQoCAgICAgICSwAAQpgMNARogDUH/fk0EQEQAAAAAAAAiQCAMQb0HTQ0CGiAKQf8PTQRARAAAAAAAAABwEPkBDAMLRAAAAAAAAAAQEPkBDAILIAMNAAsCfCAGQcjBASsDAEQAAAAAAAAIQKJBgN0BKwMAoEHo3AErAwAiBEQAAAAAAAD0P6JEAAAAAAAA8L+gIgUgBEQAAAAAAAAAAKIiHaAiBEHAwQErAwBEAAAAAAAACECiQfjcASsDAKAiHiAEIB6gIh6hoKAgHSAEQdDBASsDACIdoiIfIAUgHaIiHaCioCAFIB2iIgUgHiAeIAWgIgWhoKAgBCAEIB+iIh6iIB4gHiAEQYDCASsDAKJB+MEBKwMAoKIgBEHwwQErAwCiQejBASsDAKCgoiAEQeDBASsDAKJB2MEBKwMAoKCioCIEIAUgBSAEoCIFoaA5AwggBb1CgICAQIO/Ih5EAAAAAAAAIECiIQQgHkQAAAAAAAAAAKIgBisDCCAFIB6hoEQAAAAAAAAgQKKgAkAgBBCtAUH/D3EiA0QAAAAAAACQPBCtASIKa0QAAAAAAACAQBCtASAKa0kNACAERAAAAAAAAPA/oCADIApJDQEaRAAAAAAAAJBAEK0BIANLQQAhAw0AIAS9QgBTBEBEAAAAAAAAABAQ+QEMAgtEAAAAAAAAAHAQ+QEMAQsgBEHQsAErAwCiQdiwASsDACIFoCIeIAWhIgVB6LABKwMAoiAFQeCwASsDAKIgBKCgoCIEIASiIgUgBaIgBEGIsQErAwCiQYCxASsDAKCiIAUgBEH4sAErAwCiQfCwASsDAKCiIB69IhunQQR0QfAPcSIKKwPAsQEgBKCgoCEEIAopA8ixASAbQi2GfCEaIANFBEACfCAbQoCAgIAIg1AEQCAaQoCAgICAgICIP32/IgUgBKIgBaBEAAAAAAAAAH+iDAELIBpCgICAgICAgPA/fCIavyIFIASiIh0gBaAiBJlEAAAAAAAA8D9jBHxEAAAAAAAAEAAQpwNEAAAAAAAAEACiIR4jAEEQayAeOQMIIBpCgICAgICAgICAf4O/IAREAAAAAAAA8L9EAAAAAAAA8D8gBEQAAAAAAAAAAGMbIh6gIh8gHSAFIAShoCAEIB4gH6GgoKAgHqEiBCAERAAAAAAAAAAAYRsFIAQLRAAAAAAAABAAogsMAQsgGr8iBSAEoiAFoAsLIR8gBkEQaiQAIB+iOQOQASAQQQxqIgogASAfIB8gEEG4AWoQwgIgEEEYaiEMIwBBIGsiCSQAAkAgCigCBCAKKAIARwRAAkAgDCgCXCIBIAwoAmAiBkkEQCABIAogBxCuAyABQSBqIQcMAQsgASAMQdgAaiIDKAIAIg1rQQV1Ig5BAWoiAUGAgIDAAE8NBCAJQQxqQf///z8gBiANayIGQQR1Ig0gASABIA1JGyAGQeD///8HTxsgDiADEJYDIgEoAgggCiAHEK4DIAEgASgCCEEgajYCCCADKAIAIgchDSADKAIEIgYhDiABKAIEIAcgBmtqIgshBiMAQRBrIggkACANIA5HBEADQCAGQQA2AgggBkIANwIAIAYgBygCADYCACAGIAcoAgQ2AgQgBiAHKAIINgIIIAdBADYCCCAHQgA3AgAgBiAHKAIcNgIcIAYgBykCFDcCFCAGIAcpAgw3AgwgBkEgaiEGIAdBIGoiByAORw0ACwNAIAggDTYCDCAIQQxqECkgDUEgaiINIA5HDQALCyAIQRBqJAAgASALNgIEIAMgAygCACIGNgIEIAMgASgCBDYCACABIAY2AgQgAygCBCEGIAMgASgCCDYCBCABIAY2AgggAygCCCEGIAMgASgCDDYCCCABIAY2AgwgASABKAIENgIAIAwoAlwhByMAQRBrIgMkACABKAIEIg0gASgCCCIGRwRAA0AgASAGQSBrIgY2AgggAyAGNgIMIANBDGoQKSANIAEoAggiBkcNAAsLIANBEGokACABKAIAIgMEQCABKAIMGiADECILCyAMIAc2AlwLIAlBIGokAAwACyAQIAo2ArwBIBBBvAFqECkCQCAQKAK4AQRAIBNBADYCCCATQgA3AgAMAQsgEEEANgIUIBBCADcCDCAQQQxqIhYgECgCDBB7IBBBGGoiB0EANgJUIAcgFjYCUCACIB+iIQJBACEBIwBBoAFrIgwkACAHQQA2AgACQCAHKAJcIgMgBygCWCIKRg0AIAcoAlADQCAKKAIEIAooAgBrQQxtIAooAhxBAUZ0IAFqIQEgCkEgaiIKIANHDQALIAEQVgJAIAKZRAAAAAAAAOA/YwRAQQAhASAHKAJYIgogBygCXCIDRwRAA0AgCigCBCAKKAIAa0EMbSABaiEBIApBIGoiCiADRw0ACwsgBygCUCABEFYgBygCWCIBIAcoAlwiA0YNAQNAIAEoAgAiCiABKAIEIgZHBEAgBygCUCENA0AgDSAKEHYgCkEMaiIKIAZHDQALCyABQSBqIgEgA0cNAAsMAQtEAAAAAAAAAEAhHSAHKwNwIgREAAAAAAAA8D9lRQRARAAAAAAAAABAIAQgBKKjIR0LIAcgAjkDCCAHIB05AxggBygCWCIKIAcoAlxGDQADQCMAQTBrIg4kACAHAnwgCigCHCIDRQRAIAcrAwghAiAKLQAQRQRAIAcgApkiAjkDCAsgApogAiAKLQAUGwwBCyAHKwMImQsiAjkDECAKKAIYIQEgByADNgJoIAcgATYCZCACmSEdAkAgAUECRwRAIAooAhxBBEcNAQsgB0QYLURU+yEZQCAdRBgtRFT7IQlAoiIFRBgtRFT7IQlARAAAAAAAAPA/IAcrA3giBCAdIAQgHWMbIB1E/Knx0k1iYD+iIAREEeotgZmXcT1kGyAdo6EQqgOjIgQgBCAFZBsiBKMiBRCxAjkDMCAHIAUQsAIiBTkDKCACRAAAAAAAAAAAYwRAIAcgBZo5AygLIAcgBEQYLURU+yEZQKM5AyALIAooAgAiDSAKKAIERwRAIAdBOGohFyAHQYgBaiEYIAdBxABqIRUDQCANKAIAIQEgDSgCBCEDIAcgBygCRDYCSAJAAkACQAJAIAMgAWtBBHVBAWsOAgABAgsCQCAHKAKYAQRAIAcgGCANIBdBAEEAEPsBIgI5AxAgCi0AFEEBRgRAIAcgApoiAjkDEAsgApkhHQwBCyAHKwMQIQILIAJEAAAAAAAA8D9jDQIgDSgCACEJAkAgCigCGEECRgRAIA5BEGohASAHKwMgIgIgAqBEGC1EVPshCUCim/wDQQAgAkQAAAAAAAAAAGQbIQsjAEEgayIDJAACQAJAIB1EAAAAAAAAAABlBEAgAUEANgIIIAFCADcCAAwBCyABQQA2AgggAUIANwIAIAtBAk0EQCAdIB2gRAAAAAAAAOA/op9EGC1EVPshCUCi/AMhCwsgASALEFwgHSAJKQMAuaAhAiABKAIIIQggASgCBCEGIAkpAwi5IQREGC1EVPshGUAgC7ijIh4QsQIhBSAeELACIR4CQCAGIAhJBEAgBiAE/AY3AwggBiACEDT8BjcDACAGQRBqIQYMAQsgBiABKAIAIhFrQQR1Ig9BAWoiBkGAgICAAU8NDyADQQxqQf////8AIAggEWsiCEEDdSIRIAYgBiARSRsgCEHw////B08bIA8gARAyIggoAggiBiAE/AY3AwggBiACEDT8BjcDACAIIAZBEGo2AgggCCgCBCABKAIEIAEoAgAiEWsiBmshDyAGBEAgDyARIAb8CgAACyABKAIAIREgASAPNgIAIAggETYCBCABIAgoAggiBjYCBCAIIBE2AgggASgCCCEPIAEgCCgCDDYCCCAIIBE2AgAgCCAPNgIMIAgQNgsgASAGNgIEIAtBAkkNACAemiEiQQEhESAeIQIgBSEEA0AgHSACoiAJKQMIuaAhICAdIASiIAkpAwC5oCEhAkAgASgCCCIIIAZLBEAgBiAgEDT8BjcDCCAGICEQNPwGNwMAIAZBEGohBgwBCyAGIAEoAgAiD2tBBHUiFEEBaiIGQYCAgIABTw0QICAQNCEgIANBDGpB/////wAgCCAPayIIQQN1Ig8gBiAGIA9JGyAIQfD///8HTxsgFCABEDIhDyADKAIUIgYgIPwGNwMIIAYgIRA0/AY3AwAgAyAGQRBqNgIUIAMoAhAgASgCBCABKAIAIghrIgZrIRQgBgRAIBQgCCAG/AoAAAsgASgCACEIIAEgFDYCACADIAg2AhAgASADKAIUIgY2AgQgAyAINgIUIAEoAgghFCABIAMoAhg2AgggAyAUNgIYIA8gCDYCACAPEDYLIAEgBjYCBCAeIASiIAQgBaIgAiAioqAhBCACIAWioCECIBFBAWoiESALRw0ACwsgA0EgaiQADAALIBUQRSAHIA4oAhA2AkQgByAOKAIUNgJIIAcgDigCGDYCTAwBCyAJKQMAIRsgDiAJKQMIIhwgHZv8AqwiGnw3AyggDiAaIBt8NwMgIA4gHCAafTcDGCAOIBsgGn03AxAjAEEgayIIJAAgDkEEaiIBQQA2AgggAUIANwIAIAFBBBBcAkACQCABKAIEIgMgASgCCCIGSQRAIA4pAxAhGiADIA4pAxg3AwggAyAaNwMAIANBEGohAwwBCyADIAEoAgAiCWtBBHUiC0EBaiIDQYCAgIABTw0NIAhBDGpB/////wAgBiAJayIGQQN1IgkgAyADIAlJGyAGQfD///8HTxsgCyABEDIhBiAOKQMQIRogBigCCCIDIA4pAxg3AwggAyAaNwMAIAYgA0EQajYCCCAGKAIEIAEoAgQgASgCACIJayIDayELIAMEQCALIAkgA/wKAAALIAEoAgAhCSABIAs2AgAgBiAJNgIEIAEgBigCCCIDNgIEIAYgCTYCCCABKAIIIQsgASAGKAIMNgIIIAYgCTYCACAGIAs2AgwgBhA2IAEoAgghBgsgASADNgIEAkAgAyAGSQRAIA4pAyAhGiADIA4pAxg3AwggAyAaNwMAIANBEGohAwwBCyADIAEoAgAiCWtBBHUiC0EBaiIDQYCAgIABTw0NIAhBDGpB/////wAgBiAJayIGQQN1IgkgAyADIAlJGyAGQfD///8HTxsgCyABEDIhBiAOKQMgIRogBigCCCIDIA4pAxg3AwggAyAaNwMAIAYgA0EQajYCCCAGKAIEIAEoAgQgASgCACIJayIDayELIAMEQCALIAkgA/wKAAALIAEoAgAhCSABIAs2AgAgBiAJNgIEIAEgBigCCCIDNgIEIAYgCTYCCCABKAIIIQsgASAGKAIMNgIIIAYgCTYCACAGIAs2AgwgBhA2IAEoAgghBgsgASADNgIEAkAgAyAGSQRAIA4pAyAhGiADIA4pAyg3AwggAyAaNwMAIANBEGohAwwBCyADIAEoAgAiCWtBBHUiC0EBaiIDQYCAgIABTw0NIAhBDGpB/////wAgBiAJayIGQQN1IgkgAyADIAlJGyAGQfD///8HTxsgCyABEDIhBiAOKQMgIRogBigCCCIDIA4pAyg3AwggAyAaNwMAIAYgA0EQajYCCCAGKAIEIAEoAgQgASgCACIJayIDayELIAMEQCALIAkgA/wKAAALIAEoAgAhCSABIAs2AgAgBiAJNgIEIAEgBigCCCIDNgIEIAYgCTYCCCABKAIIIQsgASAGKAIMNgIIIAYgCTYCACAGIAs2AgwgBhA2IAEoAgghBgsgASADNgIEAkAgAyAGSQRAIA4pAxAhGiADIA4pAyg3AwggAyAaNwMAIANBEGohCQwBCyADIAEoAgAiCWtBBHUiC0EBaiIDQYCAgIABTw0NIAhBDGpB/////wAgBiAJayIGQQN1IgkgAyADIAlJGyAGQfD///8HTxsgCyABEDIhAyAOKQMQIRogAygCCCIGIA4pAyg3AwggBiAaNwMAIAMgBkEQajYCCCADKAIEIAEoAgQgASgCACILayIGayEJIAYEQCAJIAsgBvwKAAALIAEoAgAhBiABIAk2AgAgAyAGNgIEIAEgAygCCCIJNgIEIAMgBjYCCCABKAIIIQsgASADKAIMNgIIIAMgBjYCACADIAs2AgwgAxA2CyABIAk2AgQgCEEgaiQADAALIBUQRSAHIA4oAgQ2AkQgByAOKAIINgJIIAcgDigCDDYCTAsgBygCUCAVEHYMAgsgCigCHEEBRw0AIAdBBEEDIAooAhhBAkYbNgJoCyMAQTBrIgEkACAHIAcoAjg2AjwgB0E4aiIIIA0oAgQgDSgCAGtBBHUQXAJAIA0oAgQiCSANKAIAIgZHBEAgBygCPCEDIAlBEGsiCyAGRwRAA0AgAUEIaiAGIAZBEGoiBhCtAwJAIAcoAkAiCSADSwRAIAMgASkDEDcDCCADIAEpAwg3AwAgA0EQaiEDDAELIAMgCCgCACIRa0EEdSIPQQFqIgNBgICAgAFPDQ0gAUEcakH/////ACAJIBFrIglBA3UiESADIAMgEUkbIAlB8P///wdPGyAPIAgQMiERIAEoAiQiAyABKQMQNwMIIAMgASkDCDcDACABIAEoAiRBEGo2AiQgASgCICAHKAI8IAcoAjgiCWsiA2shDyADBEAgDyAJIAP8CgAACyAHKAI4IQkgByAPNgI4IAEgCTYCICAHIAEoAiQiAzYCPCABIAk2AiQgBygCQCEPIAcgASgCKDYCQCABIA82AiggESAJNgIAIBEQNgsgByADNgI8IAYgC0cNAAsgDSgCACEGCyABQQhqIAsgBhCtAwJAIAcoAkAiBiADSwRAIAMgASkDEDcDCCADIAEpAwg3AwAgA0EQaiEGDAELIAMgCCgCACIJa0EEdSILQQFqIgNBgICAgAFPDQsgAUEcakH/////ACAGIAlrIgZBA3UiCSADIAMgCUkbIAZB8P///wdPGyALIAgQMiIDKAIIIgYgASkDEDcDCCAGIAEpAwg3AwAgAyADKAIIQRBqNgIIIAMoAgQgBygCPCAHKAI4IghrIgZrIQkgBgRAIAkgCCAG/AoAAAsgBygCOCEIIAcgCTYCOCADIAg2AgQgByADKAIIIgY2AjwgAyAINgIIIAcoAkAhCSAHIAMoAgw2AkAgAyAINgIAIAMgCTYCDCADEDYLIAcgBjYCPAsgAUEwaiQADAALAkACQAJAIAcoAmgOAgABAgsgByAKIA0QswIMAgsjAEEwayIIJAAgByAKIA0QswICQCAIQQxqIA0QPCIJKAIAIgEgCSgCBCIDRg0AIAEgA0EQayIDTw0AA0AgCCABKQMINwMgIAggASkDADcDGCABIAMpAwg3AwggASADKQMANwMAIAMgCCkDIDcDCCADIAgpAxg3AwAgAUEQaiIBIANBEGsiA0kNAAsLAkAgBygCOCIBIAcoAjwiBkYNACABIAZBEGsiA08NAANAIAggASkDCDcDICAIIAEpAwA3AxggASADKQMINwMIIAEgAykDADcDACADIAgpAyA3AwggAyAIKQMYNwMAIAFBEGoiASADQRBrIgNJDQALIAcoAjwhBiAHKAI4IQELIAdBOGohEQJAAkAgBygCQCILIAZLBEAgBiABKQMINwMIIAYgASkDADcDACAGQRBqIQYMAQsgBiABa0EEdSIGQQFqIgNBgICAgAFPDQsgCEEYakH/////ACALIAFrIgtBA3UiDyADIAMgD0kbIAtB8P///wdPGyAGIBEQMiIDKAIIIgYgASkDCDcDCCAGIAEpAwA3AwAgAyADKAIIQRBqNgIIIAMoAgQgBygCPCAHKAI4IgtrIgFrIQYgAQRAIAYgCyAB/AoAAAsgBygCOCEBIAcgBjYCOCADIAE2AgQgByADKAIIIgY2AjwgAyABNgIIIAcoAkAhCyAHIAMoAgw2AkAgAyABNgIAIAMgCzYCDCADEDYLIAcgBjYCPCAGIAcoAjgiA0EQaiIPayELIAMhASAGIA9HBEAgCwRAIAEgDyAL/AoAAAsgESgCACEBCyAHIAMgC2oiAzYCPCABIANHBEADQCABIAErAwCaOQMAIAEgASsDCJo5AwggAUEQaiIBIANHDQALCyAHIAogCRCzAiAJKAIAIgEEQCAJIAE2AgQgCSgCCBogARAiCyAIQTBqJAAMAAsMAQsjAEEgayIJJAAgB0GIAWohCwJAIAcoApgBRQRAIAcrAxAhAgwBCyAHIAsgDSAHQThqQQBBABD7ASICOQMQCwJAAkAgAplEEeotgZmXcT1lBEAgDSgCACEDAkAgBygCSCIBIAcoAkwiBkkEQCABIAMpAwg3AwggASADKQMANwMAIAFBEGohAwwBCyABIAdBxABqIggoAgAiEWtBBHUiD0EBaiIBQYCAgIABTw0MIAlBDGpB/////wAgBiARayIGQQN1IhEgASABIBFJGyAGQfD///8HTxsgDyAIEDIiASgCCCIGIAMpAwg3AwggBiADKQMANwMAIAEgASgCCEEQajYCCCABKAIEIAcoAkggBygCRCIGayIDayEIIAMEQCAIIAYgA/wKAAALIAcoAkQhBiAHIAg2AkQgASAGNgIEIAcgASgCCCIDNgJIIAEgBjYCCCAHKAJMIQggByABKAIMNgJMIAEgBjYCACABIAg2AgwgARA2CyAHIAM2AkgMAQsCQAJAAkAgBygCaEECaw4DAAIBAgsgByANQQBBABC3AgwCCyAHIA1BAEEARBgtRFT7IQlAELUCDAELIAcgDUEAQQAQtgILQQEhASANKAIEIA0oAgBrQQR1IhFBAWsiA0EBSwRAQQAhBgNAIAcgCiANIAEgBhC0AiABIgZBAWoiASADRw0ACwsgBygCOCEIIAMEQCADIQEDQCAIIAFBAWsiBkEEdGoiDysDACECIAggAUEEdGoiASAPKwMImjkDCCABIAKaOQMAIAYiAQ0ACwsgCCAIIANBBHRqIgEpAwg3AwggCCABKQMANwMAAkAgBygCmAFFBEAgBysDECECDAELIAcgCyANIAdBOGogAyADEPsBIgI5AxALAkAgAplEEeotgZmXcT1lBEAgDSgCACADQQR0aiEGAkAgBygCSCIBIAcoAkwiCEkEQCABIAYpAwg3AwggASAGKQMANwMAIAFBEGohBgwBCyABIAdBxABqIgsoAgAiD2tBBHUiFEEBaiIBQYCAgIABTw0MIAlBDGpB/////wAgCCAPayIIQQN1Ig8gASABIA9JGyAIQfD///8HTxsgFCALEDIiASgCCCIIIAYpAwg3AwggCCAGKQMANwMAIAEgASgCCEEQajYCCCABKAIEIAcoAkggBygCRCIIayIGayELIAYEQCALIAggBvwKAAALIAcoAkQhCCAHIAs2AkQgASAINgIEIAcgASgCCCIGNgJIIAEgCDYCCCAHKAJMIQsgByABKAIMNgJMIAEgCDYCACABIAs2AgwgARA2CyAHIAY2AkgMAQsCQAJAAkAgBygCaEECaw4DAAIBAgsgByANIAMgAxC3AgwCCyAHIA0gAyADRBgtRFT7IQlAELUCDAELIAcgDSADIAMQtgILIBFBAmsiAQRAA0AgByAKIA0gASADELQCIAEiA0EBayIBDQALCyAHKAJQIAdBxABqEHYgCUEgaiQADAALCyANQQxqIg0gCigCBEcNAAsLIA5BMGokACAHKAIABEAgBygCUCIBIAEoAgAQewsgCkEgaiIKIAcoAlxHDQALCyAHKAJQIgEoAgQgASgCAEYNAAJ/QQAgBygCWCIKIAcoAlwiA0YNABoCQANAIAooAhxFDQEgCkEgaiIKIANHDQALQQAMAQsgCi0AFAshAyAMQQA7ARggDEIANwMQIAxBAjYCDCAMQgA3AgQgDEEcakEAQTD8CwAgDEHQAGpBAEEk/AsAIAxBADYCiAEgDEIANwOAASAMQYACOwF8IAxBADYCeCAMQaicAjYCACAMIActAIABOgB0IAwgA0EBcSIDIActAIEBRzoAdSAMIAFBABDAAgJAIAcoAlQiAQRAIAMEQCAMQQA2ApgBIAxCADcCkAEgDEEDIAEgDEGQAWoiARCsAwwCCyAMQQA2ApgBIAxCADcCkAEgDEECIAEgDEGQAWoiARCsAwwBCyAHKAJQIQEgAwRAIAxBADYCmAEgDEIANwKQASAMQQMgASAMQZABaiIBEKsDDAELIAxBADYCmAEgDEIANwKQASAMQQIgASAMQZABaiIBEKsDCyAMIAE2ApwBIAxBnAFqECkgDBBpGgsgDEGgAWokAEQAAAAAAADwPyAfoyECIwBBIGsiASQAIBNBADYCCCATQgA3AgAgEyAQKAIQIBAoAgxrQQxtEFYCQAJAIBAoAgwiByAQKAIQIgZHBEAgAkQAAAAAAAAAAGEiAyADciEKA0AgAUEANgIMIAFCADcCBCAKDQIgAUEEaiAHKAIEIAcoAgBrQQR1EFwgBygCACIDIAcoAgQiDEcEQANAIAMpAwAhGiABIAIgAykDCLmiOQMYIAEgAiAauaI5AxAgAUEEaiABQRBqEEwgA0EQaiIDIAxHDQALCyATIAFBBGoQaCABKAIEIgMEQCABIAM2AgggASgCDBogAxAiCyAHQQxqIgcgBkcNAAsLIAFBIGokAAwBCyAQIBAoArgBQQJyNgK4AUECEIICAAsgECAWNgK8ASAQQbwBahApCyMAQRBrIgwkACMAQRBrIgMkACAQQRhqIgoiASgCWCIGIAEoAlwiB0cEQANAIAMgB0EgayIHNgIMIANBDGoQKSAGIAdHDQALCyABIAY2AlwgASABKAI4NgI8IANBEGokAAJAIAooApgBIgEgCkGIAWpGBH9BEAUgAUUNAUEUCyEDIAEgASgCACADaigCABEAAAsgDCAKQdgAajYCDCMAQRBrIg4kACAMKAIMIgMoAgAiAQRAIAEiByADIgYoAgQiDUcEQANAIA4gDUEgayINNgIMIA5BDGoQKSABIA1HDQALIAwoAgwiBigCACEHCyADIAE2AgQgBigCCBogBxAiCyAOQRBqJAAgCigCRCIBBEAgCiABNgJIIAooAkwaIAEQIgsgCigCOCIBBEAgCiABNgI8IAooAkAaIAEQIgsgDEEQaiQACyAQQcABaiQAAkAgEigCICIBRQ0AIAEgASgCBCIDQQFrNgIEIAMNACABIAEoAgAoAggRAAAgARAkC0EYECMiAUG0mgI2AgAgAUIANwIEIAFBDGoiAyASQSRqIgYQWyASIAE2AhggEiADNgIUIBIgEikCFDcDCCAAIBJBCGoQaiASIAY2AhwgEkEcahApIBJBMGokAA8LECYACzwBAX8jAEEgayIBJAAgAUEANgIQIAFBFGogAUEQahCSBSABIAEpAhQ3AwggACABQQhqEEgaIAFBIGokAAsGAEHEjwILFAAgAEEEakEAIAEoAgRBueYARhsLrgcCCH8BfCMAQSBrIgUkACAFQQA2AhggAgRAIAUgAjYCDCAFQbyMAjYCCCAFIAVBCGo2AhgLIwBBIGsiBiQAIAYgBUEIaiIKNgIMIAZByJsCNgIIIAYgBkEIaiIJNgIYIwBB8AFrIgIkACACQQA2AjwgAkIANwI0IAJBQGsgARBNIAJBADYCMCACQgA3AiggAkEoaiACKAJAIgEoAgAiAyABKAIEIgEgASADa0EMbRBHAkAgAigCRCIBRQ0AIAEgASgCBCIDQQFrNgIEIAMNACABIAEoAgAoAggRAAAgARAkCyACKAIoIgEgAigCLCIERwRAA0AgASgCACIDIAEoAgQiB0cEQANAIAMrAwAhCyACIAMrAwg5A0ggAiALOQNAIAJBNGogAkFAaxBMIANBEGoiAyAHRw0ACwsgAUEMaiIBIARHDQALCyACIAIoAjQiATYCICACIAIoAjggAWtBBHU2AiQCQCAJKAIQIgEEQCABIAJBIGogASgCACgCGBEBACACKAIoIgQgAigCLCIHRwRAIAIoAjQhAQNAIAQoAgAiAyAEKAIEIghHBEADQCABKwMAIQsgAyABKwMIOQMIIAMgCzkDACABQRBqIQEgA0EQaiIDIAhHDQALCyAEQQxqIgQgB0cNAAsLIAJBADYCFCACQgA3AgwgAkHYAGpBAEHoAPwLACACQgA3A1AgAkECNgJMIAJCADcCRCACQdwAakEAQTD8CwAgAkGQAWpBAEEk/AsAIAJBADYCyAEgAkIANwPAASACQQE6AL0BIAJBAToAtAEgAkKAgICAgICAoD43A9gBIAJCgICAgICAgNDBADcD0AEgAkH8mgI2AkAgAkFAayIBIAJBKGoiBxCbASACQQA2AugBIAJCADcC4AEgAUECQQIgAkEMaiIEIAJB4AFqIgMQ4gEgAiADNgLsASACQewBahApIAEQaRpBGBAjIgNBtJoCNgIAIANCADcCBCADQQxqIgggBBBbIAIgAzYCHCACIAg2AhggAiACKQIYNwMAIAAgAhBqIAIgBDYCQCABECkgAiAHNgJAIAEQKSACKAI0IgAEQCACIAA2AjggAigCPBogABAiCyACQfABaiQADAELEGYACwJAIAkgBigCGCIARgR/QRAFIABFDQFBFAshASAAIAAoAgAgAWooAgARAAALIAZBIGokAAJAIAogBSgCGCIARgR/QRAFIABFDQFBFAshASAAIAAoAgAgAWooAgARAAALIAVBIGokAAsMACABIAAoAgQREAALFQAgAUGMjwI2AgAgASAAKAIENgIECx0BAX9BCBAjIgFBjI8CNgIAIAEgACgCBDYCBCABCwYAQeyOAgsUACAAQQRqQQAgASgCBEGL5QBGGwtRAQF/IwBBIGsiBCQAIAMoAgAhAyABKAIAIAAoAgQhACAEIAIpAxA3AxggBCACKQMINwMQIAQgAikDADcDCCAEQQhqIAMgABEDACAEQSBqJAALFQAgAUG0jgI2AgAgASAAKAIENgIECx0BAX9BCBAjIgFBtI4CNgIAIAEgACgCBDYCBCABCwYAQaSOAgsUACAAQQRqQQAgASgCBEHj4wBGGwuCAgEGfyMAQRBrIgIkACABKAIAIQcgASgCBCEEQQAhASACQQA2AgwgAkIANwIEIAJBBGogBEEDbBDUASACKAIEIQUgBARAA0AgBSABQRhsIgZqIgMgBiAHaiIGKwMAOQMAIAMgBisDCDkDCCADIAYrAxA5AxAgAUEBaiIBIARHDQALCyAFIAQgACgCBCgCABEBACACKAIEIQACQAJAIAQEQEEAIQEDQCAHIAFBGGwiA2oiBSAAIANqIgMrAwA5AwAgBSADKwMIOQMIIAUgAysDEDkDECABQQFqIgEgBEcNAAsMAQsgAEUNAQsgAiAANgIIIAIoAgwaIAAQIgsgAkEQaiQACxUAIAFB7I0CNgIAIAEgACgCBDYCBAsdAQF/QQgQIyIBQeyNAjYCACABIAAoAgQ2AgQgAQsGAEHMjQILFAAgAEEEakEAIAEoAgRB8+EARhsLFQAgAUGUjQI2AgAgASAAKAIENgIECx0BAX9BCBAjIgFBlI0CNgIAIAEgACgCBDYCBCABCwYAQfSMAgsUACAAQQRqQQAgASgCBEHQ4ABGGwsVACABQbyMAjYCACABIAAoAgQ2AgQLHQEBf0EIECMiAUG8jAI2AgAgASAAKAIENgIEIAEL2gEBAX8jAEFAaiIEJAAgACgCACEAIAQgAikDEDcDKCAEIAIpAwg3AyAgBCACKQMANwMYIAQgAykDADcDACAEIAMpAwg3AwggBCADKQMQNwMQIARBNGogASAEQRhqIAQgABEFAEEMECMiAEEANgIIIABCADcCACAEKAI4IgEgBCgCNCICRwRAIAAgASACayIBQQZ1EJUDIAAoAgQhAyABBEAgAyACIAH8CgAACyAAIAEgA2o2AgQLIAQoAjQiAQRAIAQgATYCOCAEKAI8GiABECILIARBQGskACAAC3kBBX8jAEEQayICJAAgAkEEaiIFIAEgACgCABEBACACKAIIIAIsAA8iASABQQBIIgYbIgBBBGoQJyIDIAA2AgAgAigCBCEEIAAEQCADQQRqIAQgBSAGGyAA/AoAAAsgAUEASARAIAIoAgwaIAQQIgsgAkEQaiQAIAML6wEBBn8jAEHgAGsiAyQAIANB1ABqIAIQlgUgA0EgakEAQTD8CwAgA0ECNgIcIANCgICAgBA3AhQgAygCVCEFA0AgA0EUaiAEaigCACECIANCgICAgBA3AgwgBSACQRhsaiEGIANBIGpBEEEgIAJBAUYbQQAgAhtqIQdBACECA0AgB0EIQQAgA0EMaiACaigCACIIG2ogBiAIQQN0aisDADkDACACQQRqIgJBCEcNAAsgBEEEaiIEQQxHDQALIAAgASADQSBqEOABIAMoAlQiAARAIAMgADYCWCADKAJcGiAAECILIANB4ABqJAALNgECfyMAQSBrIgQkACAEQQhqIgUgASACIAMgACgCABEFAEEYECMgBRAuIAUQKBogBEEgaiQACyoBAX8jAEEQayIDJAAgA0EIaiABIAIgACgCABEDACADKAIMIANBEGokAAthAQF/IwBBMGsiBCQAIAAoAgAhACAEIAIpAxA3AxggBCACKQMINwMQIAQgAikDADcDCCAEQSBqIgIgASAEQQhqIAMgABEPACACEJQDIAQgAjYCLCAEQSxqEHogBEEwaiQACzUBAX8jAEEQayIDJAAgAyABIAIgACgCABEDACADEJQDIAMgAzYCDCADQQxqEHogA0EQaiQACzYBAX8jAEFAaiIGJAAgBiABIAIgAyAEIAUgACgCABEqAEHAABAjIAYQQCAGEEEaIAZBQGskAAsLACAAIAFBAhDFAgtfAQF/IwBB0ABrIgMkACAAKAIAIQAgAyACNgIMIANBnKACNgIIIANBEGoiAiABIANBCGogABEDAEHAABAjIAIQQCACEEEaIAMoAgwiAEEJTwRAIAAQAQsgA0HQAGokAAuBAgICfwF8IwBB4ABrIgMkACADQQhqIgQgASACIAAoAgARAwAgA0EwaiAEQSj8CgAAQQIhACADLQBQQQFGBEAjAEEQayIAJABB2J4CLQAAQQFxRQRAQQJBmIQCQQMQBiEBQdieAkEBOgAAQdSeAiABNgIAC0EgECMiASADKQNINwMYIAEgAykDQDcDECABIAMpAzg3AwggASADKQMwNwMAIAAgATYCCCAAQQA2AgRB1J4CKAIAQQBBACAAQQRqIABBCGoQBSEFIAAoAgQhASADIAX8AzYCXCADQZygAjYCWCABBEAgARAECyAAQRBqJAAgAygCXCEACyADQeAAaiQAIAALTAEBfyMAQSBrIgMkACAAKAIAIQAgAyACKQMYNwMYIAMgAikDEDcDECADIAIpAwg3AwggAyACKQMANwMAIAEgAyAAEQEAIANBIGokAAv8AQMBfwF+AXwjAEFAaiIDJAAgA0EIaiABIAIgACgCABEDACADIAMpAxgiBDcDMCADIAMpAxA3AyggAyADKQMINwMgQQIhACAEp0EBcQRAIwBBEGsiACQAQcyeAi0AAEEBcUUEQEECQaiCAkEDEAYhAUHMngJBAToAAEHIngIgATYCAAtBEBAjIgEgAykDKDcDCCABIAMpAyA3AwAgACABNgIIIABBADYCBEHIngIoAgBBAEEAIABBBGogAEEIahAFIQUgACgCBCEBIAMgBfwDNgI8IANBnKACNgI4IAEEQCABEAQLIABBEGokACADKAI8IQALIANBQGskACAACwsAIAAgAUEBEMUCC90BAgJ/AXwjAEEwayIDJAAgA0EMaiIEIAEgAiAAKAIAEQMAQQIhAAJAIAMtACRBAUcNACMAQRBrIgAkAEHAngItAABBAXFFBEBBAkHIgAJBAxAGIQFBwJ4CQQE6AABBvJ4CIAE2AgALIABBGBAjIAQQLjYCCCAAQQA2AgRBvJ4CKAIAQQBBACAAQQRqIABBCGoQBSEFIAAoAgQhASADIAX8AzYCLCADQZygAjYCKCABBEAgARAECyAAQRBqJAAgAygCLCEAIAMtACRBAUcNACAEECgaCyADQTBqJAAgAAsyAQF/IwBBIGsiAyQAIAAoAgAhACABIANBCGogAhAuIgEgABEBACABECgaIANBIGokAAvbAQIBfwF8IwBB0ABrIgMkACADIAEgAiAAKAIAEQMAQQIhAAJAIAMtAEBBAUcNACMAQRBrIgAkAEG0ngItAABBAXFFBEBBAkHY/gFBAxAGIQFBtJ4CQQE6AABBsJ4CIAE2AgALIABBwAAQIyADEEA2AgggAEEANgIEQbCeAigCAEEAQQAgAEEEaiAAQQhqEAUhBCAAKAIEIQEgAyAE/AM2AkwgA0GcoAI2AkggAQRAIAEQBAsgAEEQaiQAIAMoAkwhACADLQBAQQFHDQAgAxBBGgsgA0HQAGokACAACy8BAX8jAEFAaiIDJAAgACgCACEAIAEgAyACEEAiASAAEQEAIAEQQRogA0FAayQACzABAX8jAEEQayIEJAAgACgCACEAIAQgAzkDCCABIAIgBEEIaiAAEQYAIARBEGokAAvdAQMBfwF+AXwjAEEwayIDJAAgA0EIaiABIAIgACgCABEDACADIAMpAxAiBDcDICADIAMpAwg3AxhBAiEAIASnQQFxBEAjAEEQayIAJABBqJ4CLQAAQQFxRQRAQQJB6PwBQQMQBiEBQaieAkEBOgAAQaSeAiABNgIACyAAIAMrAxg5AwggAEEANgIEQaSeAigCAEEAQQAgAEEEaiAAQQhqEAUhBSAAKAIEIQEgAyAF/AM2AiwgA0GcoAI2AiggAQRAIAEQBAsgAEEQaiQAIAMoAiwhAAsgA0EwaiQAIAALMAEBfyMAQRBrIgQkACAAKAIAIQAgBCADOQMIIAEgAiAEQQhqIAARAwAgBEEQaiQACy4BAX8jAEEQayIDJAAgACgCACEAIAMgAjkDCCABIANBCGogABEBACADQRBqJAAL8wECAn8BfCMAQSBrIgMkACADQQhqIgQgASACIAAoAgARAwBBAiEAAkAgAy0AFEEBRw0AIwBBEGsiACQAQZyeAi0AAEEBcUUEQEECQfj6AUEDEAYhAUGcngJBAToAAEGYngIgATYCAAsgAEEMECMgBBA8NgIIIABBADYCBEGYngIoAgBBAEEAIABBBGogAEEIahAFIQUgACgCBCEBIAMgBfwDNgIcIANBnKACNgIYIAEEQCABEAQLIABBEGokACADKAIcIQAgAy0AFEEBRw0AIAMoAggiAUUNACADIAE2AgwgAygCEBogARAiCyADQSBqJAAgAAsNACAAIAEgAkECEMYCC0gBAX8jAEEQayIDJAAgACgCACEAIAEgA0EEaiACEDwiASAAEQEAIAEoAgAiAARAIAEgADYCBCABKAIIGiAAECILIANBEGokAAv8AQMBfwF+AXwjAEFAaiIDJAAgA0EIaiABIAIgACgCABEDACADIAMpAxgiBDcDMCADIAMpAxA3AyggAyADKQMINwMgQQIhACAEp0EBcQRAIwBBEGsiACQAQZCeAi0AAEEBcUUEQEECQYj5AUEDEAYhAUGQngJBAToAAEGMngIgATYCAAtBEBAjIgEgAykDKDcDCCABIAMpAyA3AwAgACABNgIIIABBADYCBEGMngIoAgBBAEEAIABBBGogAEEIahAFIQUgACgCBCEBIAMgBfwDNgI8IANBnKACNgI4IAEEQCABEAQLIABBEGokACADKAI8IQALIANBQGskACAAC5ICAwF/AX4BfCMAQdAAayIDJAAgA0EIaiABIAIgACgCABEDACADIAMpAyAiBDcDQCADIAMpAxg3AzggAyADKQMQNwMwIAMgAykDCDcDKEECIQAgBKdBAXEEQCMAQRBrIgAkAEGEngItAABBAXFFBEBBAkGY9wFBAxAGIQFBhJ4CQQE6AABBgJ4CIAE2AgALQRgQIyIBIAMpAzg3AxAgASADKQMwNwMIIAEgAykDKDcDACAAIAE2AgggAEEANgIEQYCeAigCAEEAQQAgAEEEaiAAQQhqEAUhBSAAKAIEIQEgAyAF/AM2AkwgA0GcoAI2AkggAQRAIAEQBAsgAEEQaiQAIAMoAkwhAAsgA0HQAGokACAACw0AIAAgASACQQEQxgILRQEBfyMAQSBrIgMkACAAKAIAIQAgAyACKQMQNwMYIAMgAikDCDcDECADIAIpAwA3AwggASADQQhqIAARAQAgA0EgaiQAC/ABAgF/AXwjAEEwayIDJAAgA0EIaiABIAIgACgCABEDACADIAMpAhA3AyAgAyADKQIINwMYQQIhACADLQAkQQFGBEAjAEEQayIAJABB+J0CLQAAQQFxRQRAQQJBqPUBQQMQBiEBQfidAkEBOgAAQfSdAiABNgIAC0EMECMiASADKAIgNgIIIAEgAykCGDcCACAAIAE2AgggAEEANgIEQfSdAigCAEEAQQAgAEEEaiAAQQhqEAUhBCAAKAIEIQEgAyAE/AM2AiwgA0GcoAI2AiggAQRAIAEQBAsgAEEQaiQAIAMoAiwhAAsgA0EwaiQAIAALOAEBfyMAQRBrIgMkACAAKAIAIQAgAyACKAIINgIIIAMgAikCADcDACABIAMgABEBACADQRBqJAAL7QECAn8BfCMAQaABayIDJAAgA0EIaiIEIAEgAiAAKAIAEQMAIANB0ABqIgEgBEHIAPwKAABBAiEAIAMtAJABQQFGBEAjAEEQayIAJABB7J0CLQAAQQFxRQRAQQJBuPMBQQMQBiECQeydAkEBOgAAQeidAiACNgIAC0HAABAjIgIgAUHAAPwKAAAgACACNgIIIABBADYCBEHonQIoAgBBAEEAIABBBGogAEEIahAFIQUgACgCBCEBIAMgBfwDNgKcASADQZygAjYCmAEgAQRAIAEQBAsgAEEQaiQAIAMoApwBIQALIANBoAFqJAAgAAsNACAAIAEgAkEAEMYCCy8BAX8jAEFAaiIDJAAgACgCACEAIAMgAkHAAPwKAAAgASADIAARAQAgA0FAayQAC1EBAn8jAEHQAGsiByQAIAAoAgAhACAHQQhqIgggA0Ew/AoAACAHQThqIgMgASACIAggBCAFIAYgABEoAEEYECMgAxAuIAMQKBogB0HQAGokAAtbAQF/IwBBIGsiBCQAIAAoAgAhACAEIAI2AgQgBEGcoAI2AgAgBEEIaiICIAEgBCADIAARBQBBGBAjIAIQLiACECgaIAQoAgQiAEEJTwRAIAAQAQsgBEEgaiQACzcAIAAoAgAgAUEFdGoiACACKQMYNwMYIAAgAikDEDcDECAAIAIpAwg3AwggACACKQMANwMAQQELmgYCB38BfCMAQdABayIDJABBJBAjIgRCADcCDCAEQYSWAjYCACAEQgA3AgQgBEIANwIUIARCADcCHCAAQgA3AxggAEKAgICAgICA+D83AxAgAEIANwMIIAAgBDYCBCAAIARBDGo2AgAgAEIANwMgIABCADcDMCAAQoCAgICAgID4PzcDKCAAQgA3AzggA0EANgIcIANCADcCFCADQRRqIAEoAgQgASgCAGtBDG0QViABKAIAIgcgASgCBCIIRwRAA0AgA0EgaiAHEDwiCSEBIwBBEGsiBCQAIANBwAFqIgVBADYCCCAFQgA3AgAgBSABKAIEIAEoAgBrQQR1EFwgASgCACIGIAEoAgQiAUcEQANAIAYrAwAhCiAEIAYrAwg5AwggBCAKOQMAIAUgBBBMIAZBEGoiBiABRw0ACwsgBEEQaiQAIANBFGogBRBoIAMoAsABIgEEQCADIAE2AsQBIAMoAsgBGiABECILIAkoAgAiAQRAIAMgATYCJCADKAIoGiABECILIAdBDGoiByAIRw0ACwsgA0EANgIQIANCADcCCCADQThqQQBB6AD8CwAgA0IANwMwIANBAjYCLCADQgA3AiQgA0E8akEAQTD8CwAgA0HwAGpBAEEk/AsAIANBADYCqAEgA0IANwOgASADQQE6AJ0BIANBAToAlAEgA0KAgICAgICAoD43A7gBIANCgICAgICAgNDBADcDsAEgA0H8mgI2AiAgA0EgaiIBIANBFGoQmwEgA0EANgLIASADQgA3AsABIAFBAkEDIAIgAkEDTxsiAkEAIAJBAWtBA0kbIANBCGoiBCADQcABaiICEOIBIAMgAjYCzAEgA0HMAWoQKSABEGkaQRgQIyICQbSaAjYCACACQgA3AgQgAkEMaiIFIAQQWyADIAI2AiQgAyAFNgIgIABBCGogARBOAkAgAygCJCIARQ0AIAAgACgCBCIBQQFrNgIEIAENACAAIAAoAgAoAggRAAAgABAkCyADIANBCGo2AsABIANBwAFqECkgAyADQRRqNgIgIANBIGoQKSADQdABaiQAC10AIAACfyABKAIEIAEoAgAiAWtBBXUgAksEQCAAIAEgAkEFdGoiASkDGDcDGCAAIAEpAxA3AxAgACABKQMINwMIIAAgASkDADcDAEEBDAELIABBADoAAEEACzoAIAsQACAAKAIEIAAoAgBrQQV1C8cDAQV/AkAgACgCBCAAKAIAIgNrQQV1IgQgAUkEQCMAQSBrIgYkAAJAAkAgASAEayIEIAAoAggiBSAAKAIEIgNrQQV1TQRAIAAgBAR/IAMgBEEFdGohAANAIAMgAikDGDcDGCADIAIpAxA3AxAgAyACKQMINwMIIAMgAikDADcDACADQSBqIgMgAEcNAAsgAAUgAws2AgQMAQsgAyAAKAIAIgNrQQV1IgcgBGoiAUGAgIDAAE8NASAGQQxqQf///z8gBSADayIDQQR1IgUgASABIAVJGyADQeD///8HTxsgByAAEJYDIgEoAggiAyAEQQV0aiEEA0AgAyACKQMYNwMYIAMgAikDEDcDECADIAIpAwg3AwggAyACKQMANwMAIANBIGoiAyAERw0ACyABIAQ2AgggASgCBCAAKAIEIAAoAgAiBGsiAmshAyACBEAgAyAEIAL8CgAACyAAKAIAIQIgACADNgIAIAEgAjYCBCAAIAEoAgg2AgQgASACNgIIIAAoAgghAyAAIAEoAgw2AgggASACNgIAIAEgAzYCDCABEJoFCyAGQSBqJAAMAgsQJgALIAEgBEkEQCAAIAMgAUEFdGo2AgQLCwsJACAAIAEQlwMLBgBBvIMCCwYAQcDxAQsUACAAKAIAIAFBGGxqIAIQowRBAQs6ACAAAn8gASgCBCABKAIAIgFrQRhtIAJLBEAgACABIAJBGGxqEC4aQQEMAQsgAEEAOgAAQQALOgAYC5wDAQV/AkAgACgCBCIDIAAoAgAiBWtBGG0iBCABSQRAIwBBIGsiBSQAAkACQCABIARrIgQgACgCCCIGIAAoAgQiA2tBGG1NBEAgACAEBH8gAyAEQRhsaiEAA0AgAyACEC5BGGoiAyAARw0ACyAABSADCzYCBAwBCyADIAAoAgAiA2tBGG0iByAEaiIBQavVqtUATw0BIAVBDGpBqtWq1QAgBiADa0EYbSIDQQF0IgYgASABIAZJGyADQdWq1SpPGyAHIAAQZCIBKAIIIgMgBEEYbGohBANAIAMgAhAuQRhqIgMgBEcNAAsgASAENgIIIAAoAgAiAiAAKAIEIgMgASgCBCADIAJrQWhtQRhsaiIDEKUCIAAoAgAhAiAAIAM2AgAgASACNgIEIAAgASgCCDYCBCABIAI2AgggACgCCCEDIAAgASgCDDYCCCABIAI2AgAgASADNgIMIAEQpAILIAVBIGokAAwCCxAmAAsgASAESQRAIAMgBSABQRhsaiIBRwRAA0AgASADQRhrECgiA0cNAAsLIAAgATYCBAsLCwkAIAAgARCYAQtRAQF/IwBBgAFrIgMkACADIAEQ3wEjAEEQayIBJAAgAUEIaiADIAJBABCTBSABIAEpAgg3AwAgACABEEgaIAFBEGokACADEKoBIANBgAFqJAALKwEBfyMAQRBrIgEkACAABEAgASAANgIMIAFBDGoQeiAAECILIAFBEGokAAsGAEHs/wELPwAgAiAAKAIAIAFBBnRqIgBHBEAgACgCABogAigCABogAEEIaiACQQhqEF4gAEEQaiACQRBqQTD8CgAAC0EBCzoAIAACfyABKAIEIAEoAgAiAWtBBnUgAksEQCAAIAEgAkEGdGoQQBpBAQwBCyAAQQA6AABBAAs6AEALtwIBBX8CQCAAKAIEIgMgACgCACIFa0EGdSIEIAFJBEAjAEEgayIFJAACQAJAIAEgBGsiASAAKAIIIgYgACgCBCIDa0EGdU0EQCAAIAEEfyADIAFBBnRqIQADQCADIAIQQEFAayIDIABHDQALIAAFIAMLNgIEDAELIAMgACgCACIEa0EGdSIHIAFqIgNBgICAIE8NASAFQQxqQf///x8gBiAEayIEQQV1IgYgAyADIAZJGyAEQcD///8HTxsgByAAEKkBIgQoAggiAyABQQZ0aiEBA0AgAyACEEBBQGsiAyABRw0ACyAEIAE2AgggACAEEKcCIAQQpgILIAVBIGokAAwCCxAmAAsgASAESQRAIAMgBSABQQZ0aiIBRwRAA0AgASADQUBqEEEiA0cNAAsLIAAgATYCBAsLC78BAQV/AkAjAEEgayIFJAACQAJAIAAoAgQiAiAAKAIIIgNJBEAgAiABELQBQUBrIQEMAQsgAiAAKAIAIgRrQQZ1IgZBAWoiAkGAgIAgTw0BIAVBDGpB////HyADIARrIgNBBXUiBCACIAIgBEkbIANBwP///wdPGyAGIAAQqQEiAigCCCABELQBGiACIAIoAghBQGs2AgggACACEKcCIAAoAgQhASACEKYCCyAAIAE2AgQgBUEgaiQADAELECYACwssAQF/IwBBEGsiASQAIAAEQCABIAA2AgwgAUEMahCYAyAAECILIAFBEGokAAsGAEGE/gELFwAgACgCACABQQN0aiACKwMAOQMAQQELPQAgAAJ/IAEoAgQgASgCACIBa0EDdSACSwRAIAAgASACQQN0aisDADkDAEEBDAELIABBADoAAEEACzoACAvtGgQVfwZ8A30CfiMAQZABayINJAAgABAaNgIEIABBnKACNgIAIA1BEGoiCCABEN8BIwBBkARrIgIkACACQgA3AogCIAIgAkGIAmoiCjYChAIgAkH4AWogCCgCCCAIKAIEa0ECdSAIKAIAbhDsASIQKAIAIgYgECgCBCIFRwRAIAYhBANAIAQgAzYCACADQQFqIQMgBEEEaiIEIAVHDQALCyAIKAIgIgMgCCgCHCIERwRAIAMgBGtBAnUhBSAIKAIoIQdBACEDA0AgBiAEIANBAnQiCWooAgBBAnRqIAcgCWooAgA2AgAgA0EBaiIDIAVHDQALCyAIKAIUIAgoAhBrQQJ1IgZBA24hDiAIKAIIIAgoAgRrQQJ1IhEgCCgCACISbiETIAZBA08EQEEAIQQDQCACQQI2ApgCIAJCgICAgBA3ApACIARBDGwhFEEAIQMDQCAIKAIQIBRqIgYgAkGQAmogA2ooAgBBAnQiBWooAgAhByACIBAoAgAiCSAGIAVBiJUBaigCAEECdGooAgBBAnRqKAIANgK4ASACIAkgB0ECdGooAgA2ArwBIAJBhAJqIg8iBkEEaiEHAkACQCAGKAIEIgVFDQAgAigCvAEhCyACKAK4ASEJIAchBgNAAkAgCSAFKAIQIgxKBEAgBUEEaiEFDAELIAkgDEgEQCAFIQYMAQsgBiAFIAUoAhQgC0giDBshBiAFQQRBACAMG2ohBQsgBSgCACIFDQALIAYgB0YNACAJIAYoAhAiBUgNACAFIAlIDQEgCyAGKAIUTg0BCyAHIQYLAkAgBiAKRgRAIAIgAikCuAFCIIk3ArgBIwBBEGsiCSQAQRgQIyILIAIpArgBNwIQAkAgDygCBCIFRQRAIA9BBGoiBiEHDAELIAsoAhQhFSALKAIQIQwDQAJAIAUiBigCECIFIAxMBEAgBSAMSA0BIBUgBigCFE4NAQsgBiIHKAIAIgUNAQwCCyAGKAIEIgUNAAsgBkEEaiEHCyAJIAY2AgwgDyAJKAIMIAcgCxCCASAJQRBqJAAMAQsgAkGEAmogBhDzAiAGECILIANBBGoiA0EMRw0ACyAEQQFqIgQgDkcNAAsLAkAgAigCjAIiBkUNAEEAIQUgAkEANgLwASACQgA3AugBIAJB6AFqIAYQJSACIAY2AuwBIAogAigChAIiA0cEQCACKALoASEHA0AgByAFQQJ0aiADKAIQNgIAAkAgAygCBCIEBEADQCAEIgMoAgAiBA0ADAILAAsDQCADIAMoAggiAygCAEcNAAsLIAVBAWohBSADIApHDQALCyAIKAIIIgUgCCgCBCIDayEEQQAhDwJAIAMgBUYNACAEECchDyAERQ0AIA8gAyAE/AoAAAsgAkKAgICAgICAeDcD4AEgAkKAgICAgICAeDcD2AEgAkKAgICAgICAeDcD0AEgAkKAgICAgICA+P8ANwPIASACQoCAgICAgID4/wA3A8ABIAJCgICAgICAgPj/ADcDuAEgAkECNgKYAiACQoCAgIAQNwKQAiAIKAIAIgdBAWshCyACQdABaiEMQQAhBQNARAAAAAAAAPB/IRdEAAAAAAAA8P8hGSALIAQgAkGQAmogBWooAgAiCUECdCIDa0ECdWoiCiAKIAdwIg5HBEAgAyAPaiIDIAogDmtBAnRqIQoDQCADKgIAuyIYIBkgGCAZZBshGSAYIBcgFyAYZBshFyADIAdBAnRqIgMgCkcNAAsLQQhBECAJQQFGG0EAIAkbIgMgAkG4AWpqIBc5AwAgAyAMaiAZOQMAIAVBBGoiBUEMRw0ACyAIKgJ8IR0gAisDuAEhFyACKwPQASEZIAIrA8ABIRggAisD2AEhGiACKwPIASEbIAIrA+ABQQAhBCACQQA2ArABIAJCADcCqAEgAkGoAWogBhCfASACIAY2AqwBIAJBADYCoAEgAkIANwKYASACQZgBaiAGECUgAiAGNgKcAZkiHCAbmSIbIBsgHGMbIhsgGpkiGiAYmSIYIBggGmMbIhggGCAbYxsiGCAZmSIZIBeZIhcgFyAZYxsiFyAXIBhjG0QAAAAAAACAPqIiFyAduyIZIBcgGWQbRAAAAAAAAOA/oiEXA0AgCCgCBCAIKAIAIARBAnQiByACKALoAWooAgBsQQJ0aiIFKgIEIR4gBSoCCCEfIAIoAqgBIARBMGxqIgMgFyAFKgIAIh27IhmgOQMYIAMgGSAXoTkDACADIBcgH7siGKA5AyggAyAXIB67IhqgOQMgIAMgGCAXoTkDECADIBogF6E5AwggAiAYOQOgAiACIBo5A5gCIAIgGTkDkAIgHSAdXAR/QX8FIAIgAikDoAI3A0AgAiACKQOYAjcDOCACIAIpA5ACNwMwIAIgAkG4AWpBMPwKAAAgAkEwaiACEIUCCyEDIAIoApgBIAdqIAM2AgAgBEEBaiIEIAZHDQALQQAhAyACQQA2ApABIAJCADcCiAEgAkGIAWogBhAlIAIgBjYCjAEgAigCiAEhBANAIAQgA0ECdGogAzYCACADQQFqIgMgBkcNAAsgBCAGQQJ0aiEFIAIgAkGYAWo2ApACAkACQCAGQYEBTgRAIAYhAwNAIANBAnQQUCIHDQIgA0EBdiIDDQALCyAEIAUgAkGQAmogBkEAQQAQuAEMAQsgBCAFIAJBkAJqIAYgByADELgBIAcQIgsgAkGYAWogAkGIAWoiAxCmASACQagBaiADEN4DIAJB6AFqIAMQpgEgAiACKQKoATcCkAIgAiACKQKYATcCTCACQdgAaiACQZACaiACQcwAaiIDEOIDIQUgAyATEJYBIQcgESASSSISRQRAIBOtISEDQCAHKAIAICCnQQN0aiAgNwMAICBCAXwiICAhUg0ACwsCQCAFKAIkRQ0AIAIoAqwBIhRFDQAgAigCqAEhFSAFKAIgIRYgBSgCACERQQAhAwNAAkAgFSADQTBsaiIEKwMAIhdEAAAAAAAA8H9hDQAgBCsDKCEZIAQrAyAhGCAEKwMYIRogBCsDECEbIAQrAwghHEF/IQlBASEEA0AgFiAEQQFrQQJtQQN0aiIEKAIEIQpBACEMAn9BACARIAQoAgAiC0EwbGoiBCsDACAaZUUNABpBACAEKwMIIBhlRQ0AGkEAIAQrAxAgGWVFDQAaQQAgBCsDGCAXZkUNABpBACAEKwMgIBxmRQ0AGkEAIAQrAyggG2ZFDQAaAkAgC0EBcQ0AIAtBAXUiBCADRg0AIAcgAigC6AEiDiADQQJ0aigCACAOIARBAnRqKAIAEF8LIAtBgYCAgHhxQQFGCyEOAkAgESAKQTBsaiIEKwMAIBplRQ0AIAQrAwggGGVFDQAgBCsDECAZZUUNACAEKwMYIBdmRQ0AIAQrAyAgHGZFDQAgBCsDKCAbZkUNAAJAIApBAXENACAKQQF1IgQgA0YNACAHIAIoAugBIgwgA0ECdGooAgAgDCAEQQJ0aigCABBfCyAKQYGAgIB4cUEBRiEMCyAMIA5yRQRAIAlBAEgNAiACQZACaiAJQQJ0aigCACEEIAlBAWshCQwBCyALIAogDhshBCAORSAMRXINACACQZACaiAJQQFqIglBAnRqIAo2AgAMAAsACyADQQFqIgMgFEcNAAsLIAgoAhwiBCAIKAIgRwRAQQAhAwNAIAcgBCADQQJ0IglqKAIAIAgoAiggCWooAgAQXyADQQFqIgMgCCgCICAIKAIcIgRrQQJ1SQ0ACwsgCCAENgIgIAggCCgCKDYCLCASRQRAIAhBHGohBCAIQShqIQlBACEDA0AgAyAHIAMQTyIKRwRAIAIgAzYCkAIgBCACQZACaiILED0gAiAKNgKQAiAJIAsQPQsgA0EBaiIDIBNJDQALCyAHKAIAIgMEQCAHIAM2AgQgBygCCBogAxAiCyAFKAIgIgMEQCADECILIAVBADYCKCAFQgA3AiAgBSgCECIDBEAgAxAiCyAFQQA2AhggBUIANwIQIAUoAgAiAwRAIAMQIgsgAigCiAEiAwRAIAMQIgsgAigCmAEiAwRAIAMQIgsgAigCqAEiAwRAIAMQIgsgDwRAIA8QIgsgAigC6AEiA0UNACADECILIBAoAgAiAwRAIBAgAzYCBCAQKAIIGiADECILIAJBhAJqIAIoAogCEM4CIAJBkARqJAAgDSAGQQBHOgAPIwBBEGsiAyQAIAAoAgRB6xcQEiEEIwBBEGsiBiQAQaifAi0AAEEBcUUEQEECQZyMAkEDEAYhBUGonwJBAToAAEGknwIgBTYCAAsgBiANLQAPNgIIIAZBADYCBEGknwIoAgBBAEEAIAZBBGogBkEIahAFIRcgBigCBCEFIAMgF/wDNgIMIANBnKACNgIIIAUEQCAFEAQLIAZBEGokACAEIAMoAgwQFSADKAIMIgZBCU8EQCAGEAELIARBCU8EQCAEEAELIANBEGokAAJAIA0tAA9BAUYEQCANQQRqIAgQlAUMAQsgDSABKAIEIgE2AgggDUGcoAI2AgQgAUEJSQ0AIAEQEwsgAEH4ESANQQRqEG0gDSgCCCIAQQlPBEAgABABCyANQRBqEKoBIA1BkAFqJAALEAAgACgCBCAAKAIAa0EDdQuVAwIFfwF8AkAgACgCBCAAKAIAIgNrQQN1IgQgAUkEQCMAQSBrIgYkAAJAAkAgASAEayIEIAAoAggiBSAAKAIEIgNrQQN1TQRAIAAgBAR/IAMgBEEDdGohACACKwMAIQgDQCADIAg5AwAgA0EIaiIDIABHDQALIAAFIAMLNgIEDAELIAMgACgCACIDa0EDdSIHIARqIgFBgICAgAJPDQEgBkEMakH/////ASAFIANrIgNBAnUiBSABIAEgBUkbIANB+P///wdPGyAHIAAQSyIBKAIIIgMgBEEDdGohBCACKwMAIQgDQCADIAg5AwAgA0EIaiIDIARHDQALIAEgBDYCCCABKAIEIAAoAgQgACgCACIEayICayEDIAIEQCADIAQgAvwKAAALIAAoAgAhAiAAIAM2AgAgASACNgIEIAAgASgCCDYCBCABIAI2AgggACgCCCEDIAAgASgCDDYCCCABIAI2AgAgASADNgIMIAEQmQELIAZBIGokAAwCCxAmAAsgASAESQRAIAAgAyABQQN0ajYCBAsLCwkAIAAgARCoAgsGAEGM/AELMgAgAiAAKAIAIAFBDGxqIgBHBEAgACACKAIAIgAgAigCBCIBIAEgAGtBBHUQmQMLQQELOgAgAAJ/IAEoAgQgASgCACIBa0EMbSACSwRAIAAgASACQQxsahA8GkEBDAELIABBADoAAEEACzoADAuHAwEFfwJAIAAoAgQgACgCACIDa0EMbSIEIAFJBEAjAEEgayIGJAACQAJAIAEgBGsiBCAAKAIIIgUgACgCBCIDa0EMbU0EQCAAIAQEfyADIARBDGxqIQADQCADIAIQPEEMaiIDIABHDQALIAAFIAMLNgIEDAELIAMgACgCACIDa0EMbSIHIARqIgFB1qrVqgFPDQEgBkEMakHVqtWqASAFIANrQQxtIgNBAXQiBSABIAEgBUkbIANBqtWq1QBPGyAHIAAQYSIBKAIIIgMgBEEMbGohBANAIAMgAhA8QQxqIgMgBEcNAAsgASAENgIIIAEoAgQgACgCBCAAKAIAIgRrIgJBdG1BDGxqIQMgAgRAIAMgBCAC/AoAAAsgACgCACECIAAgAzYCACABIAI2AgQgACABKAIINgIEIAEgAjYCCCAAKAIIIQMgACABKAIMNgIIIAEgAjYCACABIAM2AgwgARDVAQsgBkEgaiQADAILECYACyABIARJBEAgACADIAFBDGxqEHsLCwsIACAAIAEQaAsrAQF/IwBBEGsiASQAIAAEQCABIAA2AgwgAUEMahApIAAQIgsgAUEQaiQACwYAQZz6AQu2GAMafwZ8CH0jAEGAAWsiBCQAIwBBEGsiFCQAIBRBCGogAUEAECsQKiAUKAIIIQcCQCAUKAIMIgFFDQAgASABKAIEIgVBAWs2AgQgBQ0AIAEgASgCACgCCBEAACABECQLIAJBAEgEf0EAIAIgBxDuAhsFIAILIRZBACECIwBBoAJrIgMkAAJ/IAcoAkAiEUUEQCAHKAJMDAELIAcoAowBIBFuCyEOIAcoAsgBIQkgBygCXCELIARBBGoiCkEAQfgA/AsAIAQgEUEDajYCACAEIAcrAzi2OAJ8IAQgBxCiAUQAAAAAAACAPqK2IiMgBCoCfCIkICMgJF4bOAJ8IARBEGogC0EDbiINQQNsIhUQfSAEQfAAaiAHKAK8ASIGQQJ0EH0gBkEASgRAIAQoAnAhDyAHKAK4ASEQA0AgECACQQV0aiIBKwMAIR0gASsDCCEeIAErAxAhHyAPIAJBBHRqIgUgASsDGLY4AgwgBSAftjgCCCAFIB62OAIEIAUgHbY4AgAgAkEBaiICIAZHDQALCyAEQeQAaiANEH0gA0GUAmogDRDsASIPKAIAIgUgDygCBCIGRwRAQQAhAiAFIQEDQCABIAI2AgAgAkEBaiECIAFBBGoiASAGRw0ACwsgBygC2AEhECAJQQBIBEAgAyAHKALcATYCkAIgAyAQNgKMAiADQYwCaiEIAkACQCAGIAVrQQJ1IgJBgQFOBEAgAiEBA0AgAUECdBBQIhINAiABQQF2IgENAAsLIAUgBiAIIAJBAEEAEL4BDAELIAUgBiAIIAIgEiABEL4BIBIQIgsLIAMgCUEATiISOgCLAiADIANBgAJqIgY2AvwBIANCADcCgAIgA0H8AWogBygCzAEgB0HQAWoQgwMgC0EDTwRAQX8hAQNAIBAgDEECdCIJIA8oAgBqKAIAIgtBBHRqIgIoAgwhCCACKAIIIQUgAyACKAIANgIAIAQoAmQgCWogCCAFIAVBAEgbNgIAIANBAjYCkAEgA0KAgICAEDcCiAEgBCgCECAMQQxsaiEFIAcoAlggC0EMbGohCUEAIQIDQCAFIANBiAFqIAJqKAIAQQJ0IgtqIAkgC2ooAgA2AgAgAkEEaiICQQxHDQALIAEgAygCACILRwRAIANCgICAgICAgPg/NwOQASADQX82AogBIANCADcDqAEgA0IANwOgASADQgA3A5gBIANCgICAgICAgPg/NwOwASADQgA3A8gBIANCADcDwAEgA0IANwO4ASADQoCAgICAgID4PzcD0AEgA0EAOwHwASADQgA3A+gBIANCADcD4AEgA0IANwPYASAGIQECQCADKAKAAiIFRQ0AA0AgASICIAUiCSAFKAIQIAtIIggbIQEgBUEEQQAgCBtqKAIAIgUNAAsgASAGRg0AIAsgAiAJIAgbKAIQSA0AIANBiAFqIAFBGGpB6gD8CgAACyADQYsCaiAEIAwgA0GIAWoQoQQgA0H8AWogAxCzBCADKAIAIQELIAxBAWoiDCANRw0ACwsgBiADKAL8ASICRwRAA0AgA0GLAmogBCANIAJBGGoQoQQCQCACKAIEIgEEQANAIAEiAigCACIBDQAMAgsACwNAIAIgAigCCCICKAIARw0ACwsgAiAGRw0ACwsgAyAVNgKIASAEQTRqIANBiAFqED0CQCARRQRAIAogDkEDbBB9IA5BAEwNASAKKAIAIQYgBygCSCEJQQAhAgNAIAkgAkEYbGoiASsDACEdIAErAwghHiAGIAJBDGxqIgUgASsDELY4AgggBSAetjgCBCAFIB22OAIAIAJBAWoiAiAORw0ACwwBCyAHKAJMIQEgA0F/NgKIASADQfwAaiABIANBiAFqELIEIQ0gA0HwAGogBygCTBCcAiELIAQoAgAgDmwhASMAQSBrIgUkAAJAAkAgCigCCCAKKAIAIgJrQQJ1IAFJBEAgAUGAgICABE8NASAFQQxqIAEgCigCBCACa0ECdSAKEEoiASgCBCAKKAIEIAooAgAiCWsiAmshBiACBEAgBiAJIAL8CgAACyAKKAIAIQIgCiAGNgIAIAEgAjYCBCAKIAEoAgg2AgQgASACNgIIIAooAgghBiAKIAEoAgw2AgggASACNgIAIAEgBjYCDCABEFMLIAVBIGokAAwBCxAmAAsgBCgCRCIBIAQoAkAiBUcEQCAWQQBIIBJyIRIgBEEoaiEVIARBHGohFyAEKAI0IQJBACEJA0AgAiAJIgZBAnRqKAIAQQNuIg4gAiAGQQFqIglBAnQiGGooAgBBA25JBEAgBkEwbCEZA0AgA0ECNgJsIANCgICAgBA3AmQgDkEMbCEaQQAhBQNAIANB5ABqIAVqKAIAQQJ0IgIgBygCeCAPKAIAIA5BAnRqKAIAQQxsamooAgAhAQJAIAsoAgAgBCgCECAaaiACaiIMKAIAIhBBDGxqIggoAgAiAiAIKAIEIhNHBEADQCABIAIoAgBGBEAgDCACKAIENgIADAMLIAJBCGoiAiATRw0ACwsgDCAEKAIIIAQoAgRrQQJ1IAQoAgBuIgw2AgAgAyAMNgKMASADIAE2AogBIAggA0GIAWoQsQQgA0ECNgKQASADQoCAgIAQNwKIAUEAIQIgEEEYbCEIA0AgAyAHKAJIIAhqQQhBECADQYgBaiACaigCACITQQFGG0EAIBMbaisDALY4AgAgCiADEOUCIAJBBGoiAkEMRw0ACyARQQBKBEBBACECIAEgEWxBA3QhAQNAIAMgBygCiAEgAWogAkEDdGorAwC2OAKIASAKIANBiAFqEOUCIAJBAWoiAiARRw0ACwsgEkUEQCADQgA3A1ggA0IANwNQIANCADcDSCAEKAIAIQIgBCgCBCEBIAQoAgghCCADQoCAgIAQNwKIASADQQI2ApABIBZBAnQiEyABIAggAWtBAnUgAmtBAnQiG2pqQQxqIRxBACECA0AgA0HIAGpBCEEQIANBiAFqIAJqKAIAIghBAUYbQQAgCBtqIBwgCEECdGoqAgC7OQMAIAJBBGoiAkEMRw0ACwJ8IAQoAlggBmotAABBAnEEQCADKwNYIR4gAysDUCEfIAMrA0gMAQsgBCgCTCAZaiIBKgIAISMgASoCDCEkIAEqAhghJSABKgIEISYgASoCECEnIAEqAhwhKCABKgIIISkgASoCFCEqIAMgASoCILs5A8gBIAMgKrs5A8ABIAMgKbs5A7gBIAMgKLs5A7ABIAMgJ7s5A6gBIAMgJrs5A6ABIAMgJbs5A5gBIAMgJLs5A5ABIAMgI7s5A4gBIAMgA0GIAWoQkAFEAAAAAAAA8L9EAAAAAAAA8D8gBCgCWCAGai0AAEEBcRsiHSADKwMQoiADKwNIIiCiIB0gAysDKKIgAysDUCIhoqAgHSADKwNAoiADKwNYIiKioCEeIAMrAwggHaIgIKIgHSADKwMgoiAhoqAgHSADKwM4oiAioqAhHyAEKAIEIQEgAysDACAdoiAgoiAdIAMrAxiiICGioCAdIAMrAzCiICKioAshHSADIB4gHSAdoiAfIB+ioCAeIB6ioJ8iHqNEAAAAAAAAAAAgHSAeoyIdvUL///////////8Ag0KAgICAgICA+P8AVCICGzkDWCADIB8gHqNEAAAAAAAAAAAgAhs5A1AgAyAdRAAAAAAAAAAAIAIbOQNIIANCgICAgBA3AogBIANBAjYCkAEgASAbaiATakEMaiEIQQAhAgNAIAggA0GIAWogAmooAgAiAUECdGogA0HIAGpBCEEQIAFBAUYbQQAgARtqKwMAtjgCACACQQRqIgJBDEcNAAsLIBBBAnQiASANKAIAaiICKAIAQX9GBEAgAiAMNgIADAELIAMgDDYCiAEgFyADQYgBaiICED0gAyANKAIAIAFqKAIANgKIASAVIAIQPQsgBUEEaiIFQQxHDQALIA5BAWoiDiAEKAI0IgIgGGooAgBBA25JDQALIAQoAkAhBSAEKAJEIQELIAkgASAFa0ECdUkNAAsLIAMgCzYCiAEgA0GIAWoQKSANKAIAIgFFDQAgDSABNgIEIA0oAggaIAEQIgsgA0H8AWogAygCgAIQbyAPKAIAIgEEQCAPIAE2AgQgDygCCBogARAiCyADQaACaiQAIBRBEGokACAAIAQQlAUgBBCqASAEQYABaiQACwYAQaz4AQstACAAKAIAIAFBGGxqIgAgAikDEDcDECAAIAIpAwg3AwggACACKQMANwMAQQELUwAgAAJ/IAEoAgQgASgCACIBa0EYbSACSwRAIAAgASACQRhsaiIBKQMQNwMQIAAgASkDCDcDCCAAIAEpAwA3AwBBAQwBCyAAQQA6AABBAAs6ABgLuwMBBX8CQCAAKAIEIAAoAgAiA2tBGG0iBCABSQRAIwBBIGsiBiQAAkACQCABIARrIgQgACgCCCIFIAAoAgQiA2tBGG1NBEAgACAEBH8gAyAEQRhsaiEAA0AgAyACKQMQNwMQIAMgAikDCDcDCCADIAIpAwA3AwAgA0EYaiIDIABHDQALIAAFIAMLNgIEDAELIAMgACgCACIDa0EYbSIHIARqIgFBq9Wq1QBPDQEgBkEMakGq1arVACAFIANrQRhtIgNBAXQiBSABIAEgBUkbIANB1arVKk8bIAcgABBkIgEoAggiAyAEQRhsaiEEA0AgAyACKQMQNwMQIAMgAikDCDcDCCADIAIpAwA3AwAgA0EYaiIDIARHDQALIAEgBDYCCCABKAIEIAAoAgQgACgCACIEayICQWhtQRhsaiEDIAIEQCADIAQgAvwKAAALIAAoAgAhAiAAIAM2AgAgASACNgIEIAAgASgCCDYCBCABIAI2AgggACgCCCEDIAAgASgCDDYCCCABIAI2AgAgASADNgIMIAEQjAELIAZBIGokAAwCCxAmAAsgASAESQRAIAAgAyABQRhsajYCBAsLCwkAIAAgARDEAQsGAEG89gELIwAgACgCACABQQxsaiIAIAIoAgg2AgggACACKQIANwIAQQELSQAgAAJ/IAEoAgQgASgCACIBa0EMbSACSwRAIAAgASACQQxsaiIBKAIINgIIIAAgASkCADcCAEEBDAELIABBADoAAEEACzoADAuoAwEFfwJAIAAoAgQgACgCACIDa0EMbSIEIAFJBEAjAEEgayIGJAACQAJAIAEgBGsiBCAAKAIIIgUgACgCBCIDa0EMbU0EQCAAIAQEfyADIARBDGxqIQADQCADIAIoAgg2AgggAyACKQIANwIAIANBDGoiAyAARw0ACyAABSADCzYCBAwBCyADIAAoAgAiA2tBDG0iByAEaiIBQdaq1aoBTw0BIAZBDGpB1arVqgEgBSADa0EMbSIDQQF0IgUgASABIAVJGyADQarVqtUATxsgByAAEGEiASgCCCIDIARBDGxqIQQDQCADIAIoAgg2AgggAyACKQIANwIAIANBDGoiAyAERw0ACyABIAQ2AgggASgCBCAAKAIEIAAoAgAiBGsiAkF0bUEMbGohAyACBEAgAyAEIAL8CgAACyAAKAIAIQIgACADNgIAIAEgAjYCBCAAIAEoAgg2AgQgASACNgIIIAAoAgghAyAAIAEoAgw2AgggASACNgIAIAEgAzYCDCABENYBCyAGQSBqJAAMAgsQJgALIAEgBEkEQCAAIAMgAUEMbGo2AgQLCwsJACAAIAEQnQULBgBBzPQBCxgAIAAoAgAgAUEGdGogAkHAAPwKAABBAQs+ACAAAn8gASgCBCABKAIAIgFrQQZ1IAJLBEAgACABIAJBBnRqQcAA/AoAAEEBDAELIABBADoAAEEACzoAQAuMAwEFfwJAIAAoAgQgACgCACIDa0EGdSIEIAFJBEAjAEEgayIGJAACQAJAIAEgBGsiBCAAKAIIIgUgACgCBCIDa0EGdU0EQCAAIAQEfyADIARBBnRqIQADQCADIAJBwAD8CgAAIANBQGsiAyAARw0ACyAABSADCzYCBAwBCyADIAAoAgAiA2tBBnUiByAEaiIBQYCAgCBPDQEgBkEMakH///8fIAUgA2siA0EFdSIFIAEgASAFSRsgA0HA////B08bIAcgABCpASIBKAIIIgMgBEEGdGohBANAIAMgAkHAAPwKAAAgA0FAayIDIARHDQALIAEgBDYCCCABKAIEIAAoAgQgACgCACIEayICayEDIAIEQCADIAQgAvwKAAALIAAoAgAhAiAAIAM2AgAgASACNgIEIAAgASgCCDYCBCABIAI2AgggACgCCCEDIAAgASgCDDYCCCABIAI2AgAgASADNgIMIAEQqQILIAZBIGokAAwCCxAmAAsgASAESQRAIAAgAyABQQZ0ajYCBAsLCwkAIAAgARCaAwsGAEHo8gELDwAgASAAKAIAaiACNwMACw0AIAEgACgCAGopAwALHgAgASAAKAIAaiIAIAIpAwg3AwggACACKQMANwMACyoBAX8gACgCACECQRAQIyIAIAEgAmoiASkDCDcDCCAAIAEpAwA3AwAgAAsHACAAEQwACwkAIAEgABEZAAsJACABIAARAAALCQAgASAAERsACwkAIAEgABEEAAtNAQF/IwBBEGsiAiQAIAIgATYCBCACQZygAjYCACACQQhqIAIgABEBACACKAIMIAJBADYCDCACKAIEIgFBCU8EQCABEAELIAJBEGokAAtIAQJ/IwBB0ABrIgYkACAGQQhqIgcgAkEw/AoAACAGQThqIgIgASAHIAMgBCAFIAARKQBBGBAjIAIQLiACECgaIAZB0ABqJAALMwECfyMAQSBrIgQkACAEQQhqIgUgASACIAMgABEPAEEYECMgBRAuIAUQKBogBEEgaiQAC5QBAQJ/IwBBEGsiBCQAIARBBGogASACIAMgABEVAEEMECMiAEEANgIIIABCADcCACAEKAIIIgEgBCgCBCIDRwRAIAAgASADayIBQQxtEKMCIAAoAgQhBSABBEAgBSADIAH8CgAACyAAIAEgBWo2AgQLIAQoAgQiAQRAIAQgATYCCCAEKAIMGiABECILIARBEGokACAAC04BAX8jAEEwayIGJAAgBiAFKQMANwMIIAYgBSkDCDcDECAGQRhqIgUgASACIAMgBCAGQQhqIAARIwBBGBAjIAUQLiAFECgaIAZBMGokAAtSAQF/IwBBIGsiAyQAIAMgATYCBCADQZygAjYCACADQQhqIgEgAyACIAARAwBBGBAjIAEQLiABECgaIAMoAgQiAUEJTwRAIAEQAQsgA0EgaiQACy0BAn8jAEEgayIBJAAgAUEIaiICIAARAABBGBAjIAIQLiACECgaIAFBIGokAAsxAQJ/IwBBIGsiAyQAIANBCGoiBCABIAIgABEWAEEYECMgBBAuIAQQKBogA0EgaiQACzcBAn8jAEEgayIGJAAgBkEIaiIHIAEgAiADIAQgBSAAESQAQRgQIyAHEC4gBxAoGiAGQSBqJAALTwEBfyMAQTBrIgMkACADIAEpAwA3AwAgAyABKQMINwMIIAMgASkDEDcDECADQRhqIgEgAyACIAARAwBBGBAjIAEQLiABECgaIANBMGokAAtdAQN/IwBBIGsiBCQAIAEgACgCBCIGQQF1aiEBIAAoAgAhACAEQQhqIgUgASACIAMgBkEBcQR/IAEoAgAgAGooAgAFIAALEQ8AQRgQIyAFEC4gBRAoGiAEQSBqJAALXQEDfyMAQSBrIgQkACABIAAoAgQiBkEBdWohASAAKAIAIQAgBEEIaiIFIAEgAiADIAZBAXEEfyABKAIAIABqKAIABSAACxEFAEEYECMgBRAuIAUQKBogBEEgaiQACzkBAX8gASAAKAIEIgRBAXVqIQEgACgCACEAIAEgAiADIARBAXEEfyABKAIAIABqKAIABSAACxEmAAtXAQJ/IwBBMGsiAiQAIAEgACgCBCIDQQF1aiEBIAAoAgAhACACIAEgA0EBcQR/IAEoAgAgAGooAgAFIAALEQEAQTAQIyIAIAJBMPwKAAAgAkEwaiQAIAALWgECfyMAQRBrIgIkACABIAAoAgQiA0EBdWohASAAKAIAIQAgAiABIANBAXEEfyABKAIAIABqKAIABSAACxEBACACEJQDIAIgAjYCDCACQQxqEHogAkEQaiQAC18BA38jAEEgayIFJAAgASAAKAIEIgdBAXVqIQEgACgCACEAIAVBCGoiBiABIAIgAyAEIAdBAXEEfyABKAIAIABqKAIABSAACxEiAEEYECMgBhAuIAYQKBogBUEgaiQAC3oBAn8jAEEwayIDJAAgASAAKAIEIgRBAXVqIQEgACgCACEAIARBAXEEQCABKAIAIABqKAIAIQALIAMgAikDEDcDECADIAIpAwg3AwggAyACKQMANwMAIANBGGoiAiABIAMgABEDAEEYECMgAhAuIAIQKBogA0EwaiQAC10BA38jAEEgayIEJAAgASAAKAIEIgZBAXVqIQEgACgCACEAIARBCGoiBSABIAIgAyAGQQFxBH8gASgCACAAaigCAAUgAAsRJwBBGBAjIAUQLiAFECgaIARBIGokAAtbAQN/IwBBIGsiAyQAIAEgACgCBCIFQQF1aiEBIAAoAgAhACADQQhqIgQgASACIAVBAXEEfyABKAIAIABqKAIABSAACxELAEEYECMgBBAuIAQQKBogA0EgaiQAC1kBA38jAEEgayICJAAgASAAKAIEIgRBAXVqIQEgACgCACEAIAJBCGoiAyABIARBAXEEfyABKAIAIABqKAIABSAACxEBAEEYECMgAxAuIAMQKBogAkEgaiQAC1wBAn8jAEEQayIDJAAgASAAKAIEIgRBAXVqIQEgACgCACEAIAMgASACIARBAXEEfyABKAIAIABqKAIABSAACxELACADEJgFIAMgAzYCDCADQQxqECkgA0EQaiQAC3wBAn8jAEEwayIEJAAgASAAKAIEIgVBAXVqIQEgACgCACEAIAVBAXEEQCABKAIAIABqKAIAIQALIAQgAikDEDcDECAEIAIpAwg3AwggBCACKQMANwMAIARBGGoiAiABIAQgAyAAEQ8AQRgQIyACEC4gAhAoGiAEQTBqJAALUQEBfyMAQSBrIgIkACACIAE2AgQgAkGcoAI2AgAgAkEIaiIBIAIgABEBAEEYECMgARCLASABECgaIAIoAgQiAUEJTwRAIAEQAQsgAkEgaiQACw0AIAAEQCAAECgQIgsLBwAgACgCBAsGAEGY8QELBQBB6hALGwAgACABKAIIIAUQcwRAIAEgAiADIAQQrAILCzgAIAAgASgCCCAFEHMEQCABIAIgAyAEEKwCDwsgACgCCCIAIAEgAiADIAQgBSAAKAIAKAIUEQgAC5ICAQZ/IAAgASgCCCAFEHMEQCABIAIgAyAEEKwCDwsgAS0ANSAAKAIMIQYgAUEAOgA1IAEtADQgAUEAOgA0IABBEGoiCSABIAIgAyAEIAUQngMgAS0ANCIKciEIIAEtADUiC3IhBwJAIAZBAkkNACAJIAZBA3RqIQkgAEEYaiEGA0AgAS0ANg0BAkAgCkEBcQRAIAEoAhhBAUYNAyAALQAIQQJxDQEMAwsgC0EBcUUNACAALQAIQQFxRQ0CCyABQQA7ATQgBiABIAIgAyAEIAUQngMgAS0ANSILIAdyQQFxIQcgAS0ANCIKIAhyQQFxIQggBkEIaiIGIAlJDQALCyABIAdBAXE6ADUgASAIQQFxOgA0C6QBAAJAIAAgASgCCCAEEHMEQCACIAEoAgRHDQEgASgCHEEBRg0BIAEgAzYCHA8LIAAgASgCACAEEHNFDQACQCABKAIQIAJHBEAgAiABKAIURw0BCyADQQFHDQEgAUEBNgIgDwsgASACNgIUIAEgAzYCICABIAEoAihBAWo2AigCQCABKAIkQQFHDQAgASgCGEECRw0AIAFBAToANgsgAUEENgIsCwuIAgACQCAAIAEoAgggBBBzBEAgAiABKAIERw0BIAEoAhxBAUYNASABIAM2AhwPCyAAIAEoAgAgBBBzBEACQCABKAIQIAJHBEAgAiABKAIURw0BCyADQQFHDQIgAUEBNgIgDwsgASADNgIgAkAgASgCLEEERg0AIAFBADsBNCAAKAIIIgAgASACIAJBASAEIAAoAgAoAhQRCAAgAS0ANUEBRgRAIAFBAzYCLCABLQA0RQ0BDAMLIAFBBDYCLAsgASACNgIUIAEgASgCKEEBajYCKCABKAIkQQFHDQEgASgCGEECRw0BIAFBAToANg8LIAAoAggiACABIAIgAyAEIAAoAgAoAhgRBwALC1YBA38jAEHQAGsiAiQAIAJBEGoiAyACQQRqIAEQPCIBIAARAQBBwAAQIyADEEAgAxBBGiABKAIAIgAEQCABIAA2AgQgASgCCBogABAiCyACQdAAaiQAC6gEAQV/IAAoAgQiAhCvAkEBaiIBECciAAR/An8gAUGABE8EQCABBEAgACACIAH8CgAACyAADAELIAAgAWohAwJAIAAgAnNBA3FFBEACQCAAQQNxRQRAIAAhAQwBCyABRQRAIAAhAQwBCyAAIQEDQCABIAItAAA6AAAgAkEBaiECIAFBAWoiAUEDcUUNASABIANJDQALCyADQXxxIQQCQCADQcAASQ0AIAEgBEFAaiIFSw0AA0AgASACKAIANgIAIAEgAigCBDYCBCABIAIoAgg2AgggASACKAIMNgIMIAEgAigCEDYCECABIAIoAhQ2AhQgASACKAIYNgIYIAEgAigCHDYCHCABIAIoAiA2AiAgASACKAIkNgIkIAEgAigCKDYCKCABIAIoAiw2AiwgASACKAIwNgIwIAEgAigCNDYCNCABIAIoAjg2AjggASACKAI8NgI8IAJBQGshAiABQUBrIgEgBU0NAAsLIAEgBE8NAQNAIAEgAigCADYCACACQQRqIQIgAUEEaiIBIARJDQALDAELIANBBEkEQCAAIQEMAQsgAUEESQRAIAAhAQwBCyADQQRrIQUgACEBA0AgASACLQAAOgAAIAEgAi0AAToAASABIAItAAI6AAIgASACLQADOgADIAJBBGohAiABQQRqIgEgBU0NAAsLIAEgA0kEQANAIAEgAi0AADoAACACQQFqIQIgAUEBaiIBIANHDQALCyAACwVBAAsLtgEAQdSdAkEBNgIAQdidAkEANgIAEKAFQdidAkHQnQIoAgA2AgBB0J0CQdSdAjYCAEHgnQJBADYCAEHcnQJB7wI2AgAQogRB4J0CQdCdAigCADYCAEHQnQJB3J0CNgIAQdifAkIANwIAQdCfAkIANwIAQeCfAkGAgID8AzYCAEH8oAJBhKACNgIAQdSgAkGAgAQ2AgBB0KACQbCrBjYCAEG0oAJBKjYCAEHYoAJBvJwCKAIANgIACwuzkAKqAQBBgAgL9XB6AGlzRW1wdHkAX1NpbXBsaWZ5AGJveABfYm91bmRpbmdCb3gATm9uRmluaXRlVmVydGV4AHJ1bkluZGV4AG1heAB3AEV4ZWN1dGlvbkNvbnRleHQAd2l0aENvbnRleHQAX1Ntb290aE91dABfUmF5Q2FzdAB1bnNpZ25lZCBzaG9ydABudW1Qcm9wVmVydABtZXJnZVRvVmVydABudW1WZXJ0AG1lcmdlRnJvbVZlcnQAdW5zaWduZWQgaW50AGhhbGZlZGdlVGFuZ2VudABfU3BsaXQAVmVjdG9yX3JheUhpdABfT2Zmc2V0AGdldABfTGV2ZWxTZXQAX2ludGVyc2VjdAByZWN0AF9Qcm9qZWN0AF9zdWJ0cmFjdABmbG9hdABzdGF0dXMAZ2VudXMAdHJpVmVydHMAX2Nyb3NzU2VjdGlvbkh1bGxQb2ludHMAX21hbmlmb2xkSHVsbFBvaW50cwBzZXRDaXJjdWxhclNlZ21lbnRzAGdldENpcmN1bGFyU2VnbWVudHMASW52YWxpZFRhbmdlbnRzAHJlc2V0VG9DaXJjdWxhckRlZmF1bHRzAHByb2dyZXNzAFZlY3Rvcl9zbW9vdGhuZXNzAF9Ub1BvbHlnb25zAF9TbW9vdGhCeU5vcm1hbHMAX0NhbGN1bGF0ZU5vcm1hbHMATWVyZ2VWZWN0b3JzRGlmZmVyZW50TGVuZ3RocwBydW5GbGFncwB2ZXJ0UHJvcGVydGllcwBfU2V0UHJvcGVydGllcwBNaXNzaW5nUG9zaXRpb25Qcm9wZXJ0aWVzAF9jcm9zc1NlY3Rpb25Db2xsZWN0VmVydGljZXMAX21hbmlmb2xkQ29sbGVjdFZlcnRpY2VzAFZlcnRleE91dE9mQm91bmRzAE1lcmdlSW5kZXhPdXRPZkJvdW5kcwBfQm91bmRzAF9SZXNlcnZlSURzACVzOiVkOiAlcwBudW1Db250b3VyAGJhZF93ZWFrX3B0cgB2ZWN0b3IAX01pcnJvcgBVbmtub3duIGVycm9yAE5vRXJyb3IAVW5rbm93bkVycm9yAE1pdGVyAF9DeWxpbmRlcgB1bnNpZ25lZCBjaGFyAF9XYXJwAC9lbXNkay9lbXNjcmlwdGVuL3N5c3RlbS9saWIvbGliY3h4YWJpL3NyYy9wcml2YXRlX3R5cGVpbmZvLmNwcABudW1Qcm9wAG1pbkdhcABOb25aZXJvAF9UZXRyYWhlZHJvbgBwb3NpdGlvbgBJbnZhbGlkQ29uc3RydWN0aW9uAFZlY3Rvcl9jcm9zc1NlY3Rpb24AQ3Jvc3NTZWN0aW9uAG1pbgBtaW5rb3dza2lTdW0AdHJhbnNmb3JtAHJ1blRyYW5zZm9ybQBib29sAGh1bGwAc3RkOjpiYWRfZnVuY3Rpb25fY2FsbABCZXZlbABjYW5jZWwAYXNPcmlnaW5hbABub3JtYWwAcHVzaF9iYWNrAG51bVRyaQBfU21vb3RoAGJhZF9hcnJheV9uZXdfbGVuZ3RoAHJlZmluZVRvTGVuZ3RoAFJ1bkluZGV4V3JvbmdMZW5ndGgAUHJvcGVydGllc1dyb25nTGVuZ3RoAFRyYW5zZm9ybVdyb25nTGVuZ3RoAEZhY2VJRFdyb25nTGVuZ3RoAHNldE1pbkNpcmN1bGFyRWRnZUxlbmd0aABtZXNoAF9Gcm9tTWVzaABfV2FycEJhdGNoAHVuc2lnbmVkIGxvbmcgbG9uZwB1bnNpZ25lZCBsb25nAHN0ZDo6d3N0cmluZwBiYXNpY19zdHJpbmcAc3RkOjpzdHJpbmcAc3RkOjp1MTZzdHJpbmcAc3RkOjp1MzJzdHJpbmcAcmVzaXplAF9SZXZvbHZlAFBvc2l0aXZlAE5lZ2F0aXZlAHJvdGF0ZQBfUm90YXRlAFRoZXJlIG11c3QgYmUgMiB2YWx1ZXMgZm9yIGVhY2ggY29vcmRpbmF0ZQBfVHJpYW5ndWxhdGUAX1RyYW5zbGF0ZQBfRGVjb21wb3NlAF9jcm9zc1NlY3Rpb25Db21wb3NlAF9tYW5pZm9sZENvbXBvc2UAY2FsY3VsYXRlQ3VydmF0dXJlAF9TcGhlcmUAX1NxdWFyZQBqb2ludHlwZQByZWZpbmUAX1NwbGl0QnlQbGFuZQBfVHJpbUJ5UGxhbmUAdm9sdW1lAGZpbGxydWxlAHNldE1pbkNpcmN1bGFyQW5nbGUAX0NpcmNsZQBkb3VibGUAX1NjYWxlAF9NZXJnZQBSZXN1bHRUb29MYXJnZQBQcmVjaXNpb24gZXhjZWVkcyB0aGUgcGVybWl0dGVkIHJhbmdlAFZhbHVlcyBleGNlZWQgcGVybWl0dGVkIHJhbmdlAGhhbGZlZGdlAG51bUVkZ2UAX0V4dHJ1ZGUAbWlua293c2tpRGlmZmVyZW5jZQBkaXN0YW5jZQB0b2xlcmFuY2UAc2V0VG9sZXJhbmNlAHJlZmluZVRvVG9sZXJhbmNlAHNsaWNlAF9TbGljZQBfQ3ViZQBSb3VuZABWZWN0b3JfbWFuaWZvbGQATm90TWFuaWZvbGQAdm9pZABjYW5jZWxsZWQAQ2FuY2VsbGVkAHJlY3Vyc2l2ZV9tdXRleCBjb25zdHJ1Y3RvciBmYWlsZWQAcmVjdXJzaXZlX211dGV4IGxvY2sgZmFpbGVkAGNoYW5nZWQAX2FkZABFdmVuT2RkAGFyZWEAc3VyZmFjZUFyZWEAX0dldE1lc2hKUwBfY3Jvc3NTZWN0aW9uSW50ZXJzZWN0aW9uTgBfbWFuaWZvbGRJbnRlcnNlY3Rpb25OAF9jcm9zc1NlY3Rpb25Vbmlvbk4AX21hbmlmb2xkVW5pb25OAF9jcm9zc1NlY3Rpb25EaWZmZXJlbmNlTgBfbWFuaWZvbGREaWZmZXJlbmNlTgBvcmlnaW5hbElEAHJ1bk9yaWdpbmFsSUQAZmFjZUlEAGluaXRUQkIAY2F0Y2hpbmcgYSBjbGFzcyB3aXRob3V0IGFuIG9iamVjdD8AZW1zY3JpcHRlbjo6bWVtb3J5X3ZpZXc8c2hvcnQ+AGVtc2NyaXB0ZW46Om1lbW9yeV92aWV3PHVuc2lnbmVkIHNob3J0PgBlbXNjcmlwdGVuOjptZW1vcnlfdmlldzxpbnQ+AGVtc2NyaXB0ZW46Om1lbW9yeV92aWV3PHVuc2lnbmVkIGludD4AZW1zY3JpcHRlbjo6bWVtb3J5X3ZpZXc8ZmxvYXQ+AGVtc2NyaXB0ZW46Om1lbW9yeV92aWV3PHVpbnQ4X3Q+AGVtc2NyaXB0ZW46Om1lbW9yeV92aWV3PGludDhfdD4AZW1zY3JpcHRlbjo6bWVtb3J5X3ZpZXc8dWludDE2X3Q+AGVtc2NyaXB0ZW46Om1lbW9yeV92aWV3PGludDE2X3Q+AGVtc2NyaXB0ZW46Om1lbW9yeV92aWV3PHVpbnQ2NF90PgBlbXNjcmlwdGVuOjptZW1vcnlfdmlldzxpbnQ2NF90PgBlbXNjcmlwdGVuOjptZW1vcnlfdmlldzx1aW50MzJfdD4AZW1zY3JpcHRlbjo6bWVtb3J5X3ZpZXc8aW50MzJfdD4AZW1zY3JpcHRlbjo6bWVtb3J5X3ZpZXc8Y2hhcj4AZW1zY3JpcHRlbjo6bWVtb3J5X3ZpZXc8dW5zaWduZWQgY2hhcj4AZW1zY3JpcHRlbjo6bWVtb3J5X3ZpZXc8c2lnbmVkIGNoYXI+AGVtc2NyaXB0ZW46Om1lbW9yeV92aWV3PGxvbmc+AGVtc2NyaXB0ZW46Om1lbW9yeV92aWV3PHVuc2lnbmVkIGxvbmc+AGVtc2NyaXB0ZW46Om1lbW9yeV92aWV3PGRvdWJsZT4AVmVjdG9yX3ZlYzQAVmVjdG9yX2Y2NABWZWN0b3JfaXZlYzMAVmVjdG9yX3ZlYzMAVGhlcmUgaXMgYW4gdW5kZWZpbmVkIGVycm9yIGluIENsaXBwZXIyAFZlY3Rvcl92ZWMyAFZlY3RvcjJfdmVjMgAxADAASW52YWxpZCBzY2FsZSAoZWl0aGVyIDAgb3IgdG9vIGxhcmdlKQAAAAAMdgAAFBAAAE5TdDNfXzIxMmJhc2ljX3N0cmluZ0l3TlNfMTFjaGFyX3RyYWl0c0l3RUVOU185YWxsb2NhdG9ySXdFRUVFAAAMdgAAXBAAAE5TdDNfXzIxMmJhc2ljX3N0cmluZ0lEc05TXzExY2hhcl90cmFpdHNJRHNFRU5TXzlhbGxvY2F0b3JJRHNFRUVFAAAADHYAAKgQAABOU3QzX18yMTJiYXNpY19zdHJpbmdJRGlOU18xMWNoYXJfdHJhaXRzSURpRUVOU185YWxsb2NhdG9ySURpRUVFRQAAAAx2AAD0EAAATjEwZW1zY3JpcHRlbjExbWVtb3J5X3ZpZXdJY0VFAAAMdgAAHBEAAE4xMGVtc2NyaXB0ZW4xMW1lbW9yeV92aWV3SWFFRQAADHYAAEQRAABOMTBlbXNjcmlwdGVuMTFtZW1vcnlfdmlld0lzRUUAAAx2AABsEQAATjEwZW1zY3JpcHRlbjExbWVtb3J5X3ZpZXdJdEVFAAAMdgAAlBEAAE4xMGVtc2NyaXB0ZW4xMW1lbW9yeV92aWV3SWlFRQAADHYAALwRAABOMTBlbXNjcmlwdGVuMTFtZW1vcnlfdmlld0lsRUUAAAx2AADkEQAATjEwZW1zY3JpcHRlbjExbWVtb3J5X3ZpZXdJbUVFAAAMdgAADBIAAE4xMGVtc2NyaXB0ZW4xMW1lbW9yeV92aWV3SXhFRQAADHYAADQSAABOMTBlbXNjcmlwdGVuMTFtZW1vcnlfdmlld0l5RUUATjZsaW5hbGczdmVjSWRMaTJFRUUAcAB2cABkcHAAdnBwZABONmxpbmFsZzN2ZWNJaUxpM0VFRQBwAHZwAGlwcAB2cHBpAE42bGluYWxnM3ZlY0lkTGkzRUVFAHAAdnAAZHBwAHZwcGQATjZsaW5hbGczdmVjSWRMaTRFRUUAcAB2cABkcHAAdnBwZABOOG1hbmlmb2xkOE1hbmlmb2xkNUVycm9yRQBOOG1hbmlmb2xkMTJDcm9zc1NlY3Rpb244RmlsbFJ1bGVFAE44bWFuaWZvbGQxMkNyb3NzU2VjdGlvbjhKb2luVHlwZUUATjhtYW5pZm9sZDRSZWN0RQBwAHZwAHBwcAB2cHBwAE44bWFuaWZvbGQzQm94RQBwAHZwAHBwcAB2cHBwAE44bWFuaWZvbGQxMFNtb290aG5lc3NFAHAAdnAAaXBwAHZwcGkAZHBwAHZwcGQATjhtYW5pZm9sZDZSYXlIaXRFAHAAdnAAanBwAHZwcGoAZHBwAHZwcGQAcHBwAHZwcHAATjhtYW5pZm9sZDE2RXhlY3V0aW9uQ29udGV4dEUAUE44bWFuaWZvbGQxNkV4ZWN1dGlvbkNvbnRleHRFAFBLTjhtYW5pZm9sZDE2RXhlY3V0aW9uQ29udGV4dEUAcHAAdgB2cABwcAB2cHAAaXBwAGRwcABOOG1hbmlmb2xkOE1hbmlmb2xkRQBOMTBlbXNjcmlwdGVuM3ZhbEUAcHBwcABOU3QzX18yNnZlY3RvcklOOG1hbmlmb2xkMTBTbW9vdGhuZXNzRU5TXzlhbGxvY2F0b3JJUzJfRUVFRQBwcHBwcABwcHBpcGRkZABOU3QzX18yOG9wdGlvbmFsSU44bWFuaWZvbGQ2UmF5SGl0RUVFAE5TdDNfXzIyN19fb3B0aW9uYWxfbW92ZV9hc3NpZ25fYmFzZUlOOG1hbmlmb2xkNlJheUhpdEVMYjFFRUUATlN0M19fMjI3X19vcHRpb25hbF9jb3B5X2Fzc2lnbl9iYXNlSU44bWFuaWZvbGQ2UmF5SGl0RUxiMUVFRQBOU3QzX18yMjBfX29wdGlvbmFsX21vdmVfYmFzZUlOOG1hbmlmb2xkNlJheUhpdEVMYjFFRUUATlN0M19fMjIwX19vcHRpb25hbF9jb3B5X2Jhc2VJTjhtYW5pZm9sZDZSYXlIaXRFTGIxRUVFAE5TdDNfXzIyM19fb3B0aW9uYWxfc3RvcmFnZV9iYXNlSU44bWFuaWZvbGQ2UmF5SGl0RUxiMEVFRQBOU3QzX18yMjRfX29wdGlvbmFsX2Rlc3RydWN0X2Jhc2VJTjhtYW5pZm9sZDZSYXlIaXRFTGIxRUVFAE5TdDNfXzIxOF9fc2ZpbmFlX2N0b3JfYmFzZUlMYjFFTGIxRUVFAE5TdDNfXzIyMF9fc2ZpbmFlX2Fzc2lnbl9iYXNlSUxiMUVMYjFFRUUATlN0M19fMjZ2ZWN0b3JJTjhtYW5pZm9sZDZSYXlIaXRFTlNfOWFsbG9jYXRvcklTMl9FRUVFAFBOU3QzX18yNnZlY3RvcklOOG1hbmlmb2xkNlJheUhpdEVOU185YWxsb2NhdG9ySVMyX0VFRUUAUEtOU3QzX18yNnZlY3RvcklOOG1hbmlmb2xkNlJheUhpdEVOU185YWxsb2NhdG9ySVMyX0VFRUUAcHAAdnAAcHAAdnBwcAB2cHBpcABpcHAAcHBwaQBpcHBpcABOU3QzX18yOG9wdGlvbmFsSU42bGluYWxnM3ZlY0lpTGkzRUVFRUUATlN0M19fMjI3X19vcHRpb25hbF9tb3ZlX2Fzc2lnbl9iYXNlSU42bGluYWxnM3ZlY0lpTGkzRUVFTGIxRUVFAE5TdDNfXzIyN19fb3B0aW9uYWxfY29weV9hc3NpZ25fYmFzZUlONmxpbmFsZzN2ZWNJaUxpM0VFRUxiMUVFRQBOU3QzX18yMjBfX29wdGlvbmFsX21vdmVfYmFzZUlONmxpbmFsZzN2ZWNJaUxpM0VFRUxiMUVFRQBOU3QzX18yMjBfX29wdGlvbmFsX2NvcHlfYmFzZUlONmxpbmFsZzN2ZWNJaUxpM0VFRUxiMUVFRQBOU3QzX18yMjNfX29wdGlvbmFsX3N0b3JhZ2VfYmFzZUlONmxpbmFsZzN2ZWNJaUxpM0VFRUxiMEVFRQBOU3QzX18yMjRfX29wdGlvbmFsX2Rlc3RydWN0X2Jhc2VJTjZsaW5hbGczdmVjSWlMaTNFRUVMYjFFRUUATlN0M19fMjZ2ZWN0b3JJTjZsaW5hbGczdmVjSWlMaTNFRUVOU185YWxsb2NhdG9ySVMzX0VFRUUAUE5TdDNfXzI2dmVjdG9ySU42bGluYWxnM3ZlY0lpTGkzRUVFTlNfOWFsbG9jYXRvcklTM19FRUVFAFBLTlN0M19fMjZ2ZWN0b3JJTjZsaW5hbGczdmVjSWlMaTNFRUVOU185YWxsb2NhdG9ySVMzX0VFRUUAcHAAdnAAcHAAdnBwcAB2cHBpcABpcHAAcHBwaQBpcHBpcABOU3QzX18yOG9wdGlvbmFsSU42bGluYWxnM3ZlY0lkTGkzRUVFRUUATlN0M19fMjI3X19vcHRpb25hbF9tb3ZlX2Fzc2lnbl9iYXNlSU42bGluYWxnM3ZlY0lkTGkzRUVFTGIxRUVFAE5TdDNfXzIyN19fb3B0aW9uYWxfY29weV9hc3NpZ25fYmFzZUlONmxpbmFsZzN2ZWNJZExpM0VFRUxiMUVFRQBOU3QzX18yMjBfX29wdGlvbmFsX21vdmVfYmFzZUlONmxpbmFsZzN2ZWNJZExpM0VFRUxiMUVFRQBOU3QzX18yMjBfX29wdGlvbmFsX2NvcHlfYmFzZUlONmxpbmFsZzN2ZWNJZExpM0VFRUxiMUVFRQBOU3QzX18yMjNfX29wdGlvbmFsX3N0b3JhZ2VfYmFzZUlONmxpbmFsZzN2ZWNJZExpM0VFRUxiMEVFRQBOU3QzX18yMjRfX29wdGlvbmFsX2Rlc3RydWN0X2Jhc2VJTjZsaW5hbGczdmVjSWRMaTNFRUVMYjFFRUUATlN0M19fMjZ2ZWN0b3JJTjZsaW5hbGczdmVjSWRMaTNFRUVOU185YWxsb2NhdG9ySVMzX0VFRUUAUE5TdDNfXzI2dmVjdG9ySU42bGluYWxnM3ZlY0lkTGkzRUVFTlNfOWFsbG9jYXRvcklTM19FRUVFAFBLTlN0M19fMjZ2ZWN0b3JJTjZsaW5hbGczdmVjSWRMaTNFRUVOU185YWxsb2NhdG9ySVMzX0VFRUUAcHAAdnAAcHAAdnBwcAB2cHBpcABpcHAAcHBwaQBpcHBpcABOU3QzX18yOG9wdGlvbmFsSU42bGluYWxnM3ZlY0lkTGkyRUVFRUUATlN0M19fMjI3X19vcHRpb25hbF9tb3ZlX2Fzc2lnbl9iYXNlSU42bGluYWxnM3ZlY0lkTGkyRUVFTGIxRUVFAE5TdDNfXzIyN19fb3B0aW9uYWxfY29weV9hc3NpZ25fYmFzZUlONmxpbmFsZzN2ZWNJZExpMkVFRUxiMUVFRQBOU3QzX18yMjBfX29wdGlvbmFsX21vdmVfYmFzZUlONmxpbmFsZzN2ZWNJZExpMkVFRUxiMUVFRQBOU3QzX18yMjBfX29wdGlvbmFsX2NvcHlfYmFzZUlONmxpbmFsZzN2ZWNJZExpMkVFRUxiMUVFRQBOU3QzX18yMjNfX29wdGlvbmFsX3N0b3JhZ2VfYmFzZUlONmxpbmFsZzN2ZWNJZExpMkVFRUxiMEVFRQBOU3QzX18yMjRfX29wdGlvbmFsX2Rlc3RydWN0X2Jhc2VJTjZsaW5hbGczdmVjSWRMaTJFRUVMYjFFRUUATlN0M19fMjZ2ZWN0b3JJTjZsaW5hbGczdmVjSWRMaTJFRUVOU185YWxsb2NhdG9ySVMzX0VFRUUAUE5TdDNfXzI2dmVjdG9ySU42bGluYWxnM3ZlY0lkTGkyRUVFTlNfOWFsbG9jYXRvcklTM19FRUVFAFBLTlN0M19fMjZ2ZWN0b3JJTjZsaW5hbGczdmVjSWRMaTJFRUVOU185YWxsb2NhdG9ySVMzX0VFRUUAcHAAdnAAcHAAdnBwcAB2cHBpcABpcHAAcHBwaQBpcHBpcABOU3QzX18yOG9wdGlvbmFsSU5TXzZ2ZWN0b3JJTjZsaW5hbGczdmVjSWRMaTJFRUVOU185YWxsb2NhdG9ySVM0X0VFRUVFRQBOU3QzX18yMjdfX29wdGlvbmFsX21vdmVfYXNzaWduX2Jhc2VJTlNfNnZlY3RvcklONmxpbmFsZzN2ZWNJZExpMkVFRU5TXzlhbGxvY2F0b3JJUzRfRUVFRUxiMEVFRQBOU3QzX18yMjdfX29wdGlvbmFsX2NvcHlfYXNzaWduX2Jhc2VJTlNfNnZlY3RvcklONmxpbmFsZzN2ZWNJZExpMkVFRU5TXzlhbGxvY2F0b3JJUzRfRUVFRUxiMEVFRQBOU3QzX18yMjBfX29wdGlvbmFsX21vdmVfYmFzZUlOU182dmVjdG9ySU42bGluYWxnM3ZlY0lkTGkyRUVFTlNfOWFsbG9jYXRvcklTNF9FRUVFTGIwRUVFAE5TdDNfXzIyMF9fb3B0aW9uYWxfY29weV9iYXNlSU5TXzZ2ZWN0b3JJTjZsaW5hbGczdmVjSWRMaTJFRUVOU185YWxsb2NhdG9ySVM0X0VFRUVMYjBFRUUATlN0M19fMjIzX19vcHRpb25hbF9zdG9yYWdlX2Jhc2VJTlNfNnZlY3RvcklONmxpbmFsZzN2ZWNJZExpMkVFRU5TXzlhbGxvY2F0b3JJUzRfRUVFRUxiMEVFRQBOU3QzX18yMjRfX29wdGlvbmFsX2Rlc3RydWN0X2Jhc2VJTlNfNnZlY3RvcklONmxpbmFsZzN2ZWNJZExpMkVFRU5TXzlhbGxvY2F0b3JJUzRfRUVFRUxiMEVFRQBOU3QzX18yNnZlY3RvcklOUzBfSU42bGluYWxnM3ZlY0lkTGkyRUVFTlNfOWFsbG9jYXRvcklTM19FRUVFTlM0X0lTNl9FRUVFAFBOU3QzX18yNnZlY3RvcklOUzBfSU42bGluYWxnM3ZlY0lkTGkyRUVFTlNfOWFsbG9jYXRvcklTM19FRUVFTlM0X0lTNl9FRUVFAFBLTlN0M19fMjZ2ZWN0b3JJTlMwX0lONmxpbmFsZzN2ZWNJZExpMkVFRU5TXzlhbGxvY2F0b3JJUzNfRUVFRU5TNF9JUzZfRUVFRQBwcAB2cABwcAB2cHBwAHZwcGlwAGlwcABwcHBpAGlwcGlwAE5TdDNfXzI4b3B0aW9uYWxJZEVFAE5TdDNfXzIyN19fb3B0aW9uYWxfbW92ZV9hc3NpZ25fYmFzZUlkTGIxRUVFAE5TdDNfXzIyN19fb3B0aW9uYWxfY29weV9hc3NpZ25fYmFzZUlkTGIxRUVFAE5TdDNfXzIyMF9fb3B0aW9uYWxfbW92ZV9iYXNlSWRMYjFFRUUATlN0M19fMjIwX19vcHRpb25hbF9jb3B5X2Jhc2VJZExiMUVFRQBOU3QzX18yMjNfX29wdGlvbmFsX3N0b3JhZ2VfYmFzZUlkTGIwRUVFAE5TdDNfXzIyNF9fb3B0aW9uYWxfZGVzdHJ1Y3RfYmFzZUlkTGIxRUVFAE5TdDNfXzI2dmVjdG9ySWROU185YWxsb2NhdG9ySWRFRUVFAFBOU3QzX18yNnZlY3RvcklkTlNfOWFsbG9jYXRvcklkRUVFRQBQS05TdDNfXzI2dmVjdG9ySWROU185YWxsb2NhdG9ySWRFRUVFAHBwAHZwAHBwAHZwcGQAdnBwaWQAaXBwAHBwcGkAaXBwaWQATlN0M19fMjhvcHRpb25hbElOOG1hbmlmb2xkMTJDcm9zc1NlY3Rpb25FRUUATlN0M19fMjI3X19vcHRpb25hbF9tb3ZlX2Fzc2lnbl9iYXNlSU44bWFuaWZvbGQxMkNyb3NzU2VjdGlvbkVMYjBFRUUATlN0M19fMjI3X19vcHRpb25hbF9jb3B5X2Fzc2lnbl9iYXNlSU44bWFuaWZvbGQxMkNyb3NzU2VjdGlvbkVMYjBFRUUATlN0M19fMjIwX19vcHRpb25hbF9tb3ZlX2Jhc2VJTjhtYW5pZm9sZDEyQ3Jvc3NTZWN0aW9uRUxiMEVFRQBOU3QzX18yMjBfX29wdGlvbmFsX2NvcHlfYmFzZUlOOG1hbmlmb2xkMTJDcm9zc1NlY3Rpb25FTGIwRUVFAE5TdDNfXzIyM19fb3B0aW9uYWxfc3RvcmFnZV9iYXNlSU44bWFuaWZvbGQxMkNyb3NzU2VjdGlvbkVMYjBFRUUATlN0M19fMjI0X19vcHRpb25hbF9kZXN0cnVjdF9iYXNlSU44bWFuaWZvbGQxMkNyb3NzU2VjdGlvbkVMYjBFRUUATjhtYW5pZm9sZDEyQ3Jvc3NTZWN0aW9uRQBOU3QzX18yNnZlY3RvcklOOG1hbmlmb2xkMTJDcm9zc1NlY3Rpb25FTlNfOWFsbG9jYXRvcklTMl9FRUVFAFBOU3QzX18yNnZlY3RvcklOOG1hbmlmb2xkMTJDcm9zc1NlY3Rpb25FTlNfOWFsbG9jYXRvcklTMl9FRUVFAFBLTlN0M19fMjZ2ZWN0b3JJTjhtYW5pZm9sZDEyQ3Jvc3NTZWN0aW9uRU5TXzlhbGxvY2F0b3JJUzJfRUVFRQBwcAB2cABwcAB2cHBwAHZwcGlwAGlwcABwcHBpAGlwcGlwAE5TdDNfXzI4b3B0aW9uYWxJTjhtYW5pZm9sZDhNYW5pZm9sZEVFRQBOU3QzX18yMjdfX29wdGlvbmFsX21vdmVfYXNzaWduX2Jhc2VJTjhtYW5pZm9sZDhNYW5pZm9sZEVMYjBFRUUATlN0M19fMjI3X19vcHRpb25hbF9jb3B5X2Fzc2lnbl9iYXNlSU44bWFuaWZvbGQ4TWFuaWZvbGRFTGIwRUVFAE5TdDNfXzIyMF9fb3B0aW9uYWxfbW92ZV9iYXNlSU44bWFuaWZvbGQ4TWFuaWZvbGRFTGIwRUVFAE5TdDNfXzIyMF9fb3B0aW9uYWxfY29weV9iYXNlSU44bWFuaWZvbGQ4TWFuaWZvbGRFTGIwRUVFAE5TdDNfXzIyM19fb3B0aW9uYWxfc3RvcmFnZV9iYXNlSU44bWFuaWZvbGQ4TWFuaWZvbGRFTGIwRUVFAE5TdDNfXzIyNF9fb3B0aW9uYWxfZGVzdHJ1Y3RfYmFzZUlOOG1hbmlmb2xkOE1hbmlmb2xkRUxiMEVFRQBOU3QzX18yNnZlY3RvcklOOG1hbmlmb2xkOE1hbmlmb2xkRU5TXzlhbGxvY2F0b3JJUzJfRUVFRQBQTlN0M19fMjZ2ZWN0b3JJTjhtYW5pZm9sZDhNYW5pZm9sZEVOU185YWxsb2NhdG9ySVMyX0VFRUUAUEtOU3QzX18yNnZlY3RvcklOOG1hbmlmb2xkOE1hbmlmb2xkRU5TXzlhbGxvY2F0b3JJUzJfRUVFRQBwcAB2cABwcAB2cHBwAHZwcGlwAGlwcABwcHBpAGlwcGlwAE5TdDNfXzI4b3B0aW9uYWxJTjhtYW5pZm9sZDEwU21vb3RobmVzc0VFRQBOU3QzX18yMjdfX29wdGlvbmFsX21vdmVfYXNzaWduX2Jhc2VJTjhtYW5pZm9sZDEwU21vb3RobmVzc0VMYjFFRUUATlN0M19fMjI3X19vcHRpb25hbF9jb3B5X2Fzc2lnbl9iYXNlSU44bWFuaWZvbGQxMFNtb290aG5lc3NFTGIxRUVFAE5TdDNfXzIyMF9fb3B0aW9uYWxfbW92ZV9iYXNlSU44bWFuaWZvbGQxMFNtb290aG5lc3NFTGIxRUVFAE5TdDNfXzIyMF9fb3B0aW9uYWxfY29weV9iYXNlSU44bWFuaWZvbGQxMFNtb290aG5lc3NFTGIxRUVFAE5TdDNfXzIyM19fb3B0aW9uYWxfc3RvcmFnZV9iYXNlSU44bWFuaWZvbGQxMFNtb290aG5lc3NFTGIwRUVFAE5TdDNfXzIyNF9fb3B0aW9uYWxfZGVzdHJ1Y3RfYmFzZUlOOG1hbmlmb2xkMTBTbW9vdGhuZXNzRUxiMUVFRQBQTlN0M19fMjZ2ZWN0b3JJTjhtYW5pZm9sZDEwU21vb3RobmVzc0VOU185YWxsb2NhdG9ySVMyX0VFRUUAUEtOU3QzX18yNnZlY3RvcklOOG1hbmlmb2xkMTBTbW9vdGhuZXNzRU5TXzlhbGxvY2F0b3JJUzJfRUVFRQBwcAB2cABwcAB2cHBwAHZwcGlwAGlwcABwcHBpAGlwcGlwAE5TdDNfXzI4b3B0aW9uYWxJTjZsaW5hbGczdmVjSWRMaTRFRUVFRQBOU3QzX18yMjdfX29wdGlvbmFsX21vdmVfYXNzaWduX2Jhc2VJTjZsaW5hbGczdmVjSWRMaTRFRUVMYjFFRUUATlN0M19fMjI3X19vcHRpb25hbF9jb3B5X2Fzc2lnbl9iYXNlSU42bGluYWxnM3ZlY0lkTGk0RUVFTGIxRUVFAE5TdDNfXzIyMF9fb3B0aW9uYWxfbW92ZV9iYXNlSU42bGluYWxnM3ZlY0lkTGk0RUVFTGIxRUVFAE5TdDNfXzIyMF9fb3B0aW9uYWxfY29weV9iYXNlSU42bGluYWxnM3ZlY0lkTGk0RUVFTGIxRUVFAE5TdDNfXzIyM19fb3B0aW9uYWxfc3RvcmFnZV9iYXNlSU42bGluYWxnM3ZlY0lkTGk0RUVFTGIwRUVFAE5TdDNfXzIyNF9fb3B0aW9uYWxfZGVzdHJ1Y3RfYmFzZUlONmxpbmFsZzN2ZWNJZExpNEVFRUxiMUVFRQBOU3QzX18yNnZlY3RvcklONmxpbmFsZzN2ZWNJZExpNEVFRU5TXzlhbGxvY2F0b3JJUzNfRUVFRQBQTlN0M19fMjZ2ZWN0b3JJTjZsaW5hbGczdmVjSWRMaTRFRUVOU185YWxsb2NhdG9ySVMzX0VFRUUAUEtOU3QzX18yNnZlY3RvcklONmxpbmFsZzN2ZWNJZExpNEVFRU5TXzlhbGxvY2F0b3JJUzNfRUVFRQBwcAB2cABwcAB2cHBwAHZwcGlwAGlwcABwcHBpAGlwcGlwAFBOOG1hbmlmb2xkMTJDcm9zc1NlY3Rpb25FAFBLTjhtYW5pZm9sZDEyQ3Jvc3NTZWN0aW9uRQBwcAB2cABwcHBpAHBwcHAAcHBwaQBwcHBwAHBwcHAAcHBwZABwcHAAaXBwAGRwcABpcHAAcHBwAHBwcGRpZGQAcHBwAHBwcABwcHBpAHBwZGkAcHBwAHZwcHAAcHBwAFBOOG1hbmlmb2xkOE1hbmlmb2xkRQBQS044bWFuaWZvbGQ4TWFuaWZvbGRFAHBwAHZwAHBwcABwcHBwAHBwcHAAcHBwcGQAcHBwcGQAcHBwcABwcHBkAHBwcABwcHAAcHBwaQBwcHBpAHBwcGQAcHBwZGQAcHBwaQBwcHBpaQBwcHBwAHBwcHAAcHBwZGRkAHBwcABpcHAATlN0M19fMjEyYmFzaWNfc3RyaW5nSWNOU18xMWNoYXJfdHJhaXRzSWNFRU5TXzlhbGxvY2F0b3JJY0VFRUUAcHBwAHBwcHAAaXBwAHBwcABkcHAAaXBwAGRwcHBkAHBwcHBwAHBwcGlpAHBwcGlkAHBwcGkAcHBkZGRpaQBwcGRpAHBwAHBwcHAAcHBwZGlkcABwcHBkaQBwcHBpZABwcGlwZGRkAHBwcABpcGkAcHBwAHZwcHAAcHBwAHZwZAB2cGkAaXBkAHZwAE4xMGVtc2NyaXB0ZW4xMW1lbW9yeV92aWV3SWpFRQBOMTBlbXNjcmlwdGVuMTFtZW1vcnlfdmlld0lmRUUATjEwZW1zY3JpcHRlbjExbWVtb3J5X3ZpZXdJaEVFAE4xMGVtc2NyaXB0ZW4xMW1lbW9yeV92aWV3SWRFRQBOU3QzX18yMTBfX2Z1bmN0aW9uNl9fZnVuY0lQRnZSTjZsaW5hbGczdmVjSWRMaTJFRUVFUzZfRUUATlN0M19fMjEwX19mdW5jdGlvbjZfX2Jhc2VJRnZSTjZsaW5hbGczdmVjSWRMaTJFRUVFRUUAUEZ2Uk42bGluYWxnM3ZlY0lkTGkyRUVFRQBGdlJONmxpbmFsZzN2ZWNJZExpMkVFRUUATlN0M19fMjEwX19mdW5jdGlvbjZfX2Z1bmNJUEZ2Uk42bGluYWxnM3ZlY0lkTGkzRUVFRVM2X0VFAE5TdDNfXzIxMF9fZnVuY3Rpb242X19iYXNlSUZ2Uk42bGluYWxnM3ZlY0lkTGkzRUVFRUVFAFBGdlJONmxpbmFsZzN2ZWNJZExpM0VFRUUARnZSTjZsaW5hbGczdmVjSWRMaTNFRUVFAE5TdDNfXzIxMF9fZnVuY3Rpb242X19mdW5jSVpONm1hbl9qczlXYXJwQmF0Y2hFUk44bWFuaWZvbGQ4TWFuaWZvbGRFbUUzJF8wRnZOUzNfN1ZlY1ZpZXdJTjZsaW5hbGczdmVjSWRMaTNFRUVFRUVFRQBOU3QzX18yMTBfX2Z1bmN0aW9uNl9fYmFzZUlGdk44bWFuaWZvbGQ3VmVjVmlld0lONmxpbmFsZzN2ZWNJZExpM0VFRUVFRUVFAFpONm1hbl9qczlXYXJwQmF0Y2hFUk44bWFuaWZvbGQ4TWFuaWZvbGRFbUUzJF8wAE5TdDNfXzIxMF9fZnVuY3Rpb242X19mdW5jSVBGdlBkTjZsaW5hbGczdmVjSWRMaTNFRUVQS2RFUzhfRUUATlN0M19fMjEwX19mdW5jdGlvbjZfX2Jhc2VJRnZQZE42bGluYWxnM3ZlY0lkTGkzRUVFUEtkRUVFAFBGdlBkTjZsaW5hbGczdmVjSWRMaTNFRUVQS2RFAEZ2UGRONmxpbmFsZzN2ZWNJZExpM0VFRVBLZEUATlN0M19fMjEwX19mdW5jdGlvbjZfX2Z1bmNJUEZkUktONmxpbmFsZzN2ZWNJZExpM0VFRUVGZFM0X0VFRQBOU3QzX18yMTBfX2Z1bmN0aW9uNl9fYmFzZUlGZE42bGluYWxnM3ZlY0lkTGkzRUVFRUVFAFBGZFJLTjZsaW5hbGczdmVjSWRMaTNFRUVFAEZkUktONmxpbmFsZzN2ZWNJZExpM0VFRUUATlN0M19fMjIwX19zaGFyZWRfcHRyX2VtcGxhY2VJTjhtYW5pZm9sZDhNYW5pZm9sZDRJbXBsRU5TXzlhbGxvY2F0b3JJUzNfRUVFRQAATlN0M19fMjEwX19mdW5jdGlvbjZfX2Z1bmNJWk44bWFuaWZvbGQ4TWFuaWZvbGQ2U3BoZXJlRWRpRTMkXzBGaU42bGluYWxnM3ZlY0lkTGkzRUVFTlM2X0lkTGk0RUVFUzhfRUVFAE5TdDNfXzIxMF9fZnVuY3Rpb242X19iYXNlSUZpTjZsaW5hbGczdmVjSWRMaTNFRUVOUzNfSWRMaTRFRUVTNV9FRUUAWk44bWFuaWZvbGQ4TWFuaWZvbGQ2U3BoZXJlRWRpRTMkXzAAAAEAAAACAAAAAAAAAE5TdDNfXzIxMF9fZnVuY3Rpb242X19mdW5jSVpOMTJfR0xPQkFMX19OXzExNUFkZE5ld0VkZ2VWZXJ0c0VSTlNfM21hcElpTlNfNnZlY3RvcklOUzJfN0VkZ2VQb3NFTlNfOWFsbG9jYXRvcklTNV9FRUVFTlNfNGxlc3NJaUVFTlM2X0lOU180cGFpcklLaVM4X0VFRUVFRVJOUzNfSU5TQl9JaWlFRVM4X05TOV9JU0hfRUVOUzZfSU5TQl9JS1NIX1M4X0VFRUVFRVJLTjhtYW5pZm9sZDNWZWNJTlNfNWFycmF5SWlMbTJFRUVMYjBFRUVSS05TUF9JaUxiMEVFRVNYX1JLTlNPXzlIYWxmZWRnZXNFYm1QTlNPXzE2RXhlY3V0aW9uQ29udGV4dDRJbXBsRUUzJF8wRnZtRUVFAE5TdDNfXzIxMF9fZnVuY3Rpb242X19iYXNlSUZ2bUVFRQBaTjEyX0dMT0JBTF9fTl8xMTVBZGROZXdFZGdlVmVydHNFUk5TdDNfXzIzbWFwSWlOUzBfNnZlY3RvcklOU183RWRnZVBvc0VOUzBfOWFsbG9jYXRvcklTM19FRUVFTlMwXzRsZXNzSWlFRU5TNF9JTlMwXzRwYWlySUtpUzZfRUVFRUVFUk5TMV9JTlM5X0lpaUVFUzZfTlM3X0lTRl9FRU5TNF9JTlM5X0lLU0ZfUzZfRUVFRUVFUktOOG1hbmlmb2xkM1ZlY0lOUzBfNWFycmF5SWlMbTJFRUVMYjBFRUVSS05TTl9JaUxiMEVFRVNWX1JLTlNNXzlIYWxmZWRnZXNFYm1QTlNNXzE2RXhlY3V0aW9uQ29udGV4dDRJbXBsRUUzJF8wAE5TdDNfXzIxMF9fZnVuY3Rpb242X19mdW5jSVpOMTJfR0xPQkFMX19OXzExNUFkZE5ld0VkZ2VWZXJ0c0VSTlNfM21hcElpTlNfNnZlY3RvcklOUzJfN0VkZ2VQb3NFTlNfOWFsbG9jYXRvcklTNV9FRUVFTlNfNGxlc3NJaUVFTlM2X0lOU180cGFpcklLaVM4X0VFRUVFRVJOUzNfSU5TQl9JaWlFRVM4X05TOV9JU0hfRUVOUzZfSU5TQl9JS1NIX1M4X0VFRUVFRVJLTjhtYW5pZm9sZDNWZWNJTlNfNWFycmF5SWlMbTJFRUVMYjBFRUVSS05TUF9JaUxiMEVFRVNYX1JLTlNPXzlIYWxmZWRnZXNFYm1QTlNPXzE2RXhlY3V0aW9uQ29udGV4dDRJbXBsRUUzJF8xRnZtRUVFAFpOMTJfR0xPQkFMX19OXzExNUFkZE5ld0VkZ2VWZXJ0c0VSTlN0M19fMjNtYXBJaU5TMF82dmVjdG9ySU5TXzdFZGdlUG9zRU5TMF85YWxsb2NhdG9ySVMzX0VFRUVOUzBfNGxlc3NJaUVFTlM0X0lOUzBfNHBhaXJJS2lTNl9FRUVFRUVSTlMxX0lOUzlfSWlpRUVTNl9OUzdfSVNGX0VFTlM0X0lOUzlfSUtTRl9TNl9FRUVFRUVSS044bWFuaWZvbGQzVmVjSU5TMF81YXJyYXlJaUxtMkVFRUxiMEVFRVJLTlNOX0lpTGIwRUVFU1ZfUktOU01fOUhhbGZlZGdlc0VibVBOU01fMTZFeGVjdXRpb25Db250ZXh0NEltcGxFRTMkXzEAAQAAAAIAAAAAAAAAAgAAAAAAAAABAAAAAE44bWFuaWZvbGQ3Q3NnTm9kZUUATlN0M19fMjIzZW5hYmxlX3NoYXJlZF9mcm9tX3RoaXNJTjhtYW5pZm9sZDdDc2dOb2RlRUVFAE44bWFuaWZvbGQxMUNzZ0xlYWZOb2RlRQBOOG1hbmlmb2xkOUNzZ09wTm9kZUUATlN0M19fMjIwX19zaGFyZWRfcHRyX2VtcGxhY2VJTjhtYW5pZm9sZDEzQ3NnU3RhY2tGcmFtZUVOU185YWxsb2NhdG9ySVMyX0VFRUUATlN0M19fMjIwX19zaGFyZWRfcHRyX2VtcGxhY2VJTjhtYW5pZm9sZDlDc2dPcE5vZGVFTlNfOWFsbG9jYXRvcklTMl9FRUVFAE5TdDNfXzIyMF9fc2hhcmVkX3B0cl9lbXBsYWNlSUtOOG1hbmlmb2xkOE1hbmlmb2xkNEltcGxFTlNfOWFsbG9jYXRvcklTM19FRUVFAE5TdDNfXzIyMF9fc2hhcmVkX3B0cl9lbXBsYWNlSU44bWFuaWZvbGQxMUNzZ0xlYWZOb2RlRU5TXzlhbGxvY2F0b3JJUzJfRUVFRQBOU3QzX18yMjBfX3NoYXJlZF9wdHJfZW1wbGFjZUlOU182dmVjdG9ySU5TXzEwc2hhcmVkX3B0cklOOG1hbmlmb2xkN0NzZ05vZGVFRUVOU185YWxsb2NhdG9ySVM1X0VFRUVOUzZfSVM4X0VFRUUATlN0M19fMjIwX19zaGFyZWRfcHRyX2VtcGxhY2VJTlNfMTVyZWN1cnNpdmVfbXV0ZXhFTlNfOWFsbG9jYXRvcklTMV9FRUVFAAAAAAAAAAACAAAAAQAAAE5TdDNfXzIyMF9fc2hhcmVkX3B0cl9lbXBsYWNlSU44bWFuaWZvbGQxNkV4ZWN1dGlvbkNvbnRleHQ0SW1wbEVOU185YWxsb2NhdG9ySVMzX0VFRUUAAAABAAAAAgBBhvkAC4cB8L8AAAAAAADwvwAAAAAAAPA/AAAAAAAA8L8AAAAAAADwPwAAAAAAAPC/AAAAAAAA8D8AAAAAAADwvwAAAAAAAPC/AAAAAAAA8D8AAAAAAADwPwAAAAAAAPA/AgAAAAAAAAABAAAAAAAAAAMAAAABAAAAAgAAAAMAAAAAAAAAAwAAAAIAAAABAEG++gALAvA/AEHO+gALAvA/AEHm+gALEvA/AAAAAAAA8D8AAAAAAADwPwBBjvsACwLwPwBBnvsACxLwPwAAAAAAAPA/AAAAAAAA8D8AQb77AAufAfA/AAAAAAAA8D8AAAAAAADwPwEAAAAAAAAABAAAAAIAAAAEAAAAAAAAAAEAAAADAAAAAAAAAAMAAAABAAAABQAAAAMAAAACAAAAAAAAAAMAAAAHAAAAAgAAAAUAAAAEAAAABgAAAAUAAAABAAAABAAAAAYAAAAEAAAAAgAAAAcAAAAGAAAAAgAAAAcAAAADAAAABQAAAAcAAAAFAAAABgBB5vwACwLwPwBB/vwACwLwvwBBnv0ACwLwPwBBtv0ACwLwvwBB1v0ACwLwPwBB7v0AC8oI8L8AAAAAAgAAAAQAAAABAAAABQAAAAMAAAACAAAAAQAAAAQAAAADAAAABQAAAAAAAAABAAAAAwAAAAQAAAAAAAAABQAAAAIAAAADAAAAAAAAAAQAAAACAAAABQAAAAEAAAABAAAAAgAAAAAAAABOU3QzX18yMTBfX2Z1bmN0aW9uNl9fZnVuY0laTjhtYW5pZm9sZDhNYW5pZm9sZDRJbXBsNFdhcnBFTlNfOGZ1bmN0aW9uSUZ2Uk42bGluYWxnM3ZlY0lkTGkzRUVFRUVFRTMkXzBGdk5TMl83VmVjVmlld0lTOF9FRUVFRQBaTjhtYW5pZm9sZDhNYW5pZm9sZDRJbXBsNFdhcnBFTlN0M19fMjhmdW5jdGlvbklGdlJONmxpbmFsZzN2ZWNJZExpM0VFRUVFRUUzJF8wAAAAAAAAAE+7YQVnrN0/GC1EVPsh6T+b9oHSC3PvPxgtRFT7Ifk/4mUvIn8rejwHXBQzJqaBPL3L8HqIB3A8B1wUMyamkTxOU3QzX18yMjBfX3NoYXJlZF9wdHJfZW1wbGFjZUlOU181bXV0ZXhFTlNfOWFsbG9jYXRvcklTMV9FRUVFAE5TdDNfXzIxMF9fZnVuY3Rpb242X19mdW5jSVpOSzhtYW5pZm9sZDhNYW5pZm9sZDZSZWZpbmVFaUUzJF8wRmlONmxpbmFsZzN2ZWNJZExpM0VFRU5TNl9JZExpNEVFRVM4X0VFRQBaTks4bWFuaWZvbGQ4TWFuaWZvbGQ2UmVmaW5lRWlFMyRfMABOU3QzX18yMTBfX2Z1bmN0aW9uNl9fZnVuY0laTks4bWFuaWZvbGQ4TWFuaWZvbGQxNFJlZmluZVRvTGVuZ3RoRWRFMyRfMEZpTjZsaW5hbGczdmVjSWRMaTNFRUVOUzZfSWRMaTRFRUVTOF9FRUUAWk5LOG1hbmlmb2xkOE1hbmlmb2xkMTRSZWZpbmVUb0xlbmd0aEVkRTMkXzAATlN0M19fMjEwX19mdW5jdGlvbjZfX2Z1bmNJWk5LOG1hbmlmb2xkOE1hbmlmb2xkMTdSZWZpbmVUb1RvbGVyYW5jZUVkRTMkXzBGaU42bGluYWxnM3ZlY0lkTGkzRUVFTlM2X0lkTGk0RUVFUzhfRUVFAFpOSzhtYW5pZm9sZDhNYW5pZm9sZDE3UmVmaW5lVG9Ub2xlcmFuY2VFZEUzJF8wAE5TdDNfXzIyMF9fc2hhcmVkX3B0cl9wb2ludGVySVBOOG1hbmlmb2xkOE1hbmlmb2xkNEltcGxFTlNfMTRkZWZhdWx0X2RlbGV0ZUlTM19FRU5TXzlhbGxvY2F0b3JJUzNfRUVFRQBOU3QzX18yMTRkZWZhdWx0X2RlbGV0ZUlOOG1hbmlmb2xkOE1hbmlmb2xkNEltcGxFRUUAAAAAABgtRFT7Iek/GC1EVPsh6b/SITN/fNkCQNIhM3982QLAAEHHhgELEYAYLURU+yEJQBgtRFT7IQnAAEHshgELBQEAAAABAEGEhwELAQEAQZiHAQslAQAAAAAAAAD/////AAAAAAAAAAABAAAAAAAAAP////8AAAAAAQBByIcBCxz/////AQAAAP///////////////wEAAAD/////AEH0hwELBP////8AQYiIAQtJ/////wAAAAAAAAAA//////////8BAAAA/////wAAAAD/////AQAAAP//////////AAAAAAEAAAACAAAAAAAAAAEAAAABAAAAAgBB4IgBC7AR////////////////AAAAAAMAAAAEAAAAAAAAAAEAAAAFAAAAAQAAAAUAAAADAAAAAQAAAAQAAAACAAAAAQAAAAAAAAADAAAAAgAAAAUAAAAAAAAABQAAAAMAAAACAAAAAgAAAAMAAAAFAAAAAAAAAAUAAAACAAAAAwAAAAAAAAABAAAAAgAAAAQAAAABAAAAAwAAAAUAAAABAAAABQAAAAEAAAAAAAAABAAAAAMAAAAAAAAA////////////////////////////////////////////////////////////////AwAAAAQAAAABAAAA////////////////AwAAAAIAAAABAAAAAAAAAAQAAAACAAAA////////////////////////////////AgAAAAQAAAAAAAAAAQAAAAIAAAADAAAA////////////////AQAAAAQAAAADAAAA////////////////////////////////////////////////TlN0M19fMjEwX19mdW5jdGlvbjZfX2Z1bmNJWk44bWFuaWZvbGQ4TWFuaWZvbGQ0SW1wbDEwU2V0Tm9ybWFsc0VpZEUzJF8wRlpOUzRfMTBTZXROb3JtYWxzRWlkRThGYWNlRWRnZWlFRUUATlN0M19fMjEwX19mdW5jdGlvbjZfX2Jhc2VJRlpOOG1hbmlmb2xkOE1hbmlmb2xkNEltcGwxMFNldE5vcm1hbHNFaWRFOEZhY2VFZGdlaUVFRQBaTjhtYW5pZm9sZDhNYW5pZm9sZDRJbXBsMTBTZXROb3JtYWxzRWlkRTMkXzAATlN0M19fMjEwX19mdW5jdGlvbjZfX2Z1bmNJWk44bWFuaWZvbGQ4TWFuaWZvbGQ0SW1wbDEwU2V0Tm9ybWFsc0VpZEUzJF8xRnZpUktaTlM0XzEwU2V0Tm9ybWFsc0VpZEU4RmFjZUVkZ2VSUzZfRUVFAE5TdDNfXzIxMF9fZnVuY3Rpb242X19iYXNlSUZ2aVJLWk44bWFuaWZvbGQ4TWFuaWZvbGQ0SW1wbDEwU2V0Tm9ybWFsc0VpZEU4RmFjZUVkZ2VSUzVfRUVFAFpOOG1hbmlmb2xkOE1hbmlmb2xkNEltcGwxMFNldE5vcm1hbHNFaWRFMyRfMQBOU3QzX18yMTBfX2Z1bmN0aW9uNl9fZnVuY0laWk44bWFuaWZvbGQ4TWFuaWZvbGQ0SW1wbDE0Q3JlYXRlVGFuZ2VudHNFaUVOSzMkXzBjbEVpRVVsaUVfRlpaTlM0XzE0Q3JlYXRlVGFuZ2VudHNFaUVOS1M1X2NsRWlFMTBGbGF0Tm9ybWFsaUVFRQBOU3QzX18yMTBfX2Z1bmN0aW9uNl9fYmFzZUlGWlpOOG1hbmlmb2xkOE1hbmlmb2xkNEltcGwxNENyZWF0ZVRhbmdlbnRzRWlFTkszJF8wY2xFaUUxMEZsYXROb3JtYWxpRUVFAFpaTjhtYW5pZm9sZDhNYW5pZm9sZDRJbXBsMTRDcmVhdGVUYW5nZW50c0VpRU5LMyRfMGNsRWlFVWxpRV8ATlN0M19fMjEwX19mdW5jdGlvbjZfX2Z1bmNJWlpOOG1hbmlmb2xkOE1hbmlmb2xkNEltcGwxNENyZWF0ZVRhbmdlbnRzRWlFTkszJF8wY2xFaUVVbGlSS1paTlM0XzE0Q3JlYXRlVGFuZ2VudHNFaUVOS1M1X2NsRWlFMTBGbGF0Tm9ybWFsUzhfRV9GdmlTOF9SUzZfRUVFAE5TdDNfXzIxMF9fZnVuY3Rpb242X19iYXNlSUZ2aVJLWlpOOG1hbmlmb2xkOE1hbmlmb2xkNEltcGwxNENyZWF0ZVRhbmdlbnRzRWlFTkszJF8wY2xFaUUxMEZsYXROb3JtYWxSUzZfRUVFAFpaTjhtYW5pZm9sZDhNYW5pZm9sZDRJbXBsMTRDcmVhdGVUYW5nZW50c0VpRU5LMyRfMGNsRWlFVWxpUktaWk5TMV8xNENyZWF0ZVRhbmdlbnRzRWlFTktTMl9jbEVpRTEwRmxhdE5vcm1hbFM1X0VfAAEAAAACAAAAAAAAAAIAAAAAAAAAAQAAAAEAAAACAAAAAAAAAAEAAAACAAAAAAAAAE5TdDNfXzIyMF9fc2hhcmVkX3B0cl9lbXBsYWNlSUtOOG1hbmlmb2xkOFBhdGhJbXBsRU5TXzlhbGxvY2F0b3JJUzJfRUVFRQBOMTFDbGlwcGVyMkxpYjE3Q2xpcHBlcjJFeGNlcHRpb25FAE4xMUNsaXBwZXIyTGliOENsaXBwZXJERQBOMTFDbGlwcGVyMkxpYjlQb2x5UGF0aERFAE4xMUNsaXBwZXIyTGliOFBvbHlQYXRoRQBOU3QzX18yMTBfX2Z1bmN0aW9uNl9fZnVuY0laTks4bWFuaWZvbGQxMkNyb3NzU2VjdGlvbjRXYXJwRU5TXzhmdW5jdGlvbklGdlJONmxpbmFsZzN2ZWNJZExpMkVFRUVFRUUzJF8wRnZOUzJfN1ZlY1ZpZXdJUzdfRUVFRUUATlN0M19fMjEwX19mdW5jdGlvbjZfX2Jhc2VJRnZOOG1hbmlmb2xkN1ZlY1ZpZXdJTjZsaW5hbGczdmVjSWRMaTJFRUVFRUVFRQBaTks4bWFuaWZvbGQxMkNyb3NzU2VjdGlvbjRXYXJwRU5TdDNfXzI4ZnVuY3Rpb25JRnZSTjZsaW5hbGczdmVjSWRMaTJFRUVFRUVFMyRfMABOMTFDbGlwcGVyMkxpYjExQ2xpcHBlckJhc2VFAE4xMUNsaXBwZXIyTGliOUNsaXBwZXI2NEUAAAAAAAAAAE+7YQVnrN0/GC1EVPsh6T+b9oHSC3PvPxgtRFT7Ifk/4mUvIn8rejwHXBQzJqaBPL3L8HqIB3A8B1wUMyamkTwYLURU+yHpPxgtRFT7Iem/0iEzf3zZAkDSITN/fNkCwABBn5oBC+gVgBgtRFT7IQlAGC1EVPshCcADAAAABAAAAAQAAAAGAAAAg/miAERObgD8KRUA0VcnAN009QBi28AAPJmVAEGQQwBjUf4Au96rALdhxQA6biQA0k1CAEkG4AAJ6i4AHJLRAOsd/gApsRwA6D6nAPU1ggBEuy4AnOmEALQmcABBfl8A1pE5AFODOQCc9DkAi1+EACj5vQD4HzsA3v+XAA+YBQARL+8AClqLAG0fbQDPfjYACcsnAEZPtwCeZj8ALepfALondQDl68cAPXvxAPc5BwCSUooA+2vqAB+xXwAIXY0AMANWAHv8RgDwq2sAILzPADb0mgDjqR0AXmGRAAgb5gCFmWUAoBRfAI1AaACA2P8AJ3NNAAYGMQDKVhUAyahzAHviYABrjMAAGcRHAM1nwwAJ6NwAWYMqAIt2xACmHJYARK/dABlX0QClPgUABQf/ADN+PwDCMugAmE/eALt9MgAmPcMAHmvvAJ/4XgA1HzoAf/LKAPGHHQB8kCEAaiR8ANVu+gAwLXcAFTtDALUUxgDDGZ0ArcTCACxNQQAMAF0Ahn1GAONxLQCbxpoAM2IAALTSfAC0p5cAN1XVANc+9gCjEBgATXb8AGSdKgBw16sAY3z4AHqwVwAXFecAwElWADvW2QCnhDgAJCPLANaKdwBaVCMAAB+5APEKGwAZzt8AnzH/AGYeagCZV2EArPtHAH5/2AAiZbcAMuiJAOa/YADvxM0AbDYJAF0/1AAW3tcAWDveAN6bkgDSIigAKIboAOJYTQDGyjIACOMWAOB9ywAXwFAA8x2nABjgWwAuEzQAgxJiAINIAQD1jlsArbB/AB7p8gBISkMAEGfTAKrd2ACuX0IAamHOAAoopADTmbQABqbyAFx3fwCjwoMAYTyIAIpzeACvjFoAb9e9AC2mYwD0v8sAjYHvACbBZwBVykUAytk2ACio0gDCYY0AEsl3AAQmFAASRpsAxFnEAMjFRABNspEAABfzANRDrQApSeUA/dUQAAC+/AAelMwAcM7uABM+9QDs8YAAs+fDAMf4KACTBZQAwXE+AC4JswALRfMAiBKcAKsgewAutZ8AR5LCAHsyLwAMVW0AcqeQAGvnHwAxy5YAeRZKAEF54gD034kA6JSXAOLmhACZMZcAiO1rAF9fNgC7/Q4ASJq0AGekbABxckIAjV0yAJ8VuAC85QkAjTElAPd0OQAwBRwADQwBAEsIaAAs7lgAR6qQAHTnAgC91iQA932mAG5IcgCfFu8AjpSmALSR9gDRU1EAzwryACCYMwD1S34AsmNoAN0+XwBAXQMAhYl/AFVSKQA3ZMAAbdgQADJIMgBbTHUATnHUAEVUbgALCcEAKvVpABRm1QAnB50AXQRQALQ72wDqdsUAh/kXAElrfQAdJ7oAlmkpAMbMrACtFFQAkOJqAIjZiQAsclAABKS+AHcHlADzMHAAAPwnAOpxqABmwkkAZOA9AJfdgwCjP5cAQ5T9AA2GjAAxQd4AkjmdAN1wjAAXt+cACN87ABU3KwBcgKAAWoCTABARkgAP6NgAbICvANv/SwA4kA8AWRh2AGKlFQBhy7sAx4m5ABBAvQDS8gQASXUnAOu29gDbIrsAChSqAIkmLwBkg3YACTszAA6UGgBROqoAHaPCAK/trgBcJhIAbcJNAC16nADAVpcAAz+DAAnw9gArQIwAbTGZADm0BwAMIBUA2MNbAPWSxADGrUsATsqlAKc3zQDmqTYAq5KUAN1CaAAZY94AdozvAGiLUgD82zcArqGrAN8VMQAArqEADPvaAGRNZgDtBbcAKWUwAFdWvwBH/zoAavm5AHW+8wAok98Aq4AwAGaM9gAEyxUA+iIGANnkHQA9s6QAVxuPADbNCQBOQukAE76kADMjtQDwqhoAT2WoANLBpQALPw8AW3jNACP5dgB7iwQAiRdyAMamUwBvbuIA7+sAAJtKWADE2rcAqma6AHbPzwDRAh0AsfEtAIyZwQDDrXcAhkjaAPddoADGgPQArPAvAN3smgA/XLwA0N5tAJDHHwAq27YAoyU6AACvmgCtU5MAtlcEACkttABLgH4A2genAHaqDgB7WaEAFhIqANy3LQD65f0Aidv+AIm+/QDkdmwABqn8AD6AcACFbhUA/Yf/ACg+BwBhZzMAKhiGAE296gCz568Aj21uAJVnOQAxv1sAhNdIADDfFgDHLUMAJWE1AMlwzgAwy7gAv2z9AKQAogAFbOQAWt2gACFvRwBiEtIAuVyEAHBhSQBrVuAAmVIBAFBVNwAe1bcAM/HEABNuXwBdMOQAhS6pAB2ywwChMjYACLekAOqx1AAW9yEAj2nkACf/dwAMA4AAjUAtAE/NoAAgpZkAs6LTAC9dCgC0+UIAEdrLAH2+0ACb28EAqxe9AMqigQAIalwALlUXACcAVQB/FPAA4QeGABQLZACWQY0Ah77eANr9KgBrJbYAe4k0AAXz/gC5v54AaGpPAEoqqABPxFoALfi8ANdamAD0x5UADU2NACA6pgCkV18AFD+xAIA4lQDMIAEAcd2GAMnetgC/YPUATWURAAEHawCMsKwAssDQAFFVSAAe+w4AlXLDAKMGOwDAQDUABtx7AOBFzABOKfoA1srIAOjzQQB8ZN4Am2TYANm+MQCkl8MAd1jUAGnjxQDw2hMAujo8AEYYRgBVdV8A0r31AG6SxgCsLl0ADkTtABw+QgBhxIcAKf3pAOfW8wAifMoAb5E1AAjgxQD/140AbmriALD9xgCTCMEAfF10AGutsgDNbp0APnJ7AMYRagD3z6kAKXPfALXJugC3AFEA4rINAHS6JADlfWAAdNiKAA0VLACBGAwAfmaUAAEpFgCfenYA/f2+AFZF7wDZfjYA7NkTAIu6uQDEl/wAMagnAPFuwwCUxTYA2KhWALSotQDPzA4AEoktAG9XNAAsVokAmc7jANYguQBrXqoAPiqcABFfzAD9C0oA4fT7AI47bQDihiwA6dSEAPy0qQDv7tEALjXJAC85YQA4IUQAG9nIAIH8CgD7SmoALxzYAFO0hABOmYwAVCLMACpV3ADAxtYACxmWABpwuABplWQAJlpgAD9S7gB/EQ8A9LURAPzL9QA0vC0ANLzuAOhdzADdXmAAZ46bAJIz7wDJF7gAYVibAOFXvABRg8YA2D4QAN1xSAAtHN0ArxihACEsRgBZ89cA2XqYAJ5UwABPhvoAVgb8AOV5rgCJIjYAOK0iAGeT3ABV6KoAgiY4AMrnmwBRDaQAmTOxAKnXDgBpBUgAZbLwAH+IpwCITJcA+dE2ACGSswB7gkoAmM8hAECf3ADcR1UA4XQ6AGfrQgD+nd8AXtRfAHtnpAC6rHoAVfaiACuIIwBBulUAWW4IACEqhgA5R4MAiePmAOWe1ABJ+0AA/1bpABwPygDFWYoAlPorANPBxQAPxc8A21quAEfFhgCFQ2IAIYY7ACx5lAAQYYcAKkx7AIAsGgBDvxIAiCaQAHg8iQCoxOQA5dt7AMQ6wgAm9OoA92eKAA2SvwBloysAPZOxAL18CwCkUdwAJ91jAGnh3QCalBkAqCmVAGjOKAAJ7bQARJ8gAE6YygBwgmMAfnwjAA+5MgCn9Y4AFFbnACHxCAC1nSoAb35NAKUZUQC1+asAgt/WAJbdYQAWNgIAxDqfAIOioQBy7W0AOY16AIK4qQBrMlwARidbAAA07QDSAHcA/PRVAAFZTQDgcYAAQZOwAQutAUD7Ifk/AAAAAC1EdD4AAACAmEb4PAAAAGBRzHg7AAAAgIMb8DkAAABAICV6OAAAAIAiguM2AAAAAB3zaTX+gitlRxVnQAAAAAAAADhDAAD6/kIudr86O568mvcMvb39/////98/PFRVVVVVxT+RKxfPVVWlPxfQpGcREYE/AAAAAAAAyELvOfr+Qi7mPyTEgv+9v84/tfQM1whrrD/MUEbSq7KDP4Q6Tpvg11U/AEHOsQELwhDwP26/iBpPO5s8NTP7qT327z9d3NicE2BxvGGAdz6a7O8/0WaHEHpekLyFf27oFePvPxP2ZzVS0ow8dIUV07DZ7z/6jvkjgM6LvN723Slr0O8/YcjmYU73YDzIm3UYRcfvP5nTM1vko5A8g/PGyj6+7z9te4NdppqXPA+J+WxYte8//O/9khq1jjz3R3IrkqzvP9GcL3A9vj48otHTMuyj7z8LbpCJNANqvBvT/q9mm+8/Dr0vKlJWlbxRWxLQAZPvP1XqTozvgFC8zDFswL2K7z8W9NW5I8mRvOAtqa6agu8/r1Vc6ePTgDxRjqXImHrvP0iTpeoVG4C8e1F9PLhy7z89Mt5V8B+PvOqNjDj5au8/v1MTP4yJizx1y2/rW2PvPybrEXac2Za81FwEhOBb7z9gLzo+9+yaPKq5aDGHVO8/nTiGy4Lnj7wd2fwiUE3vP43DpkRBb4o81oxiiDtG7z99BOSwBXqAPJbcfZFJP+8/lKio4/2Oljw4YnVuejjvP31IdPIYXoc8P6ayT84x7z/y5x+YK0eAPN184mVFK+8/XghxP3u4lryBY/Xh3yTvPzGrCW3h94I84d4f9Z0e7z/6v28amyE9vJDZ2tB/GO8/tAoMcoI3izwLA+SmhRLvP4/LzomSFG48Vi8+qa8M7z+2q7BNdU2DPBW3MQr+Bu8/THSs4gFChjwx2Ez8cAHvP0r401053Y88/xZksgj87j8EW447gKOGvPGfkl/F9u4/aFBLzO1KkrzLqTo3p/HuP44tURv4B5m8ZtgFba7s7j/SNpQ+6NFxvPef5TTb5+4/FRvOsxkZmbzlqBPDLePuP21MKqdIn4U8IjQSTKbe7j+KaSh6YBKTvByArARF2u4/W4kXSI+nWLwqLvchCtbuPxuaSWebLHy8l6hQ2fXR7j8RrMJg7WNDPC2JYWAIzu4/72QGOwlmljxXAB3tQcruP3kDodrhzG480DzBtaLG7j8wEg8/jv+TPN7T1/Aqw+4/sK96u86QdjwnKjbV2r/uP3fgVOu9HZM8Dd39mbK87j+Oo3EANJSPvKcsnXayue4/SaOT3Mzeh7xCZs+i2rbuP184D73G3ni8gk+dViu07j/2XHvsRhKGvA+SXcqkse4/jtf9GAU1kzzaJ7U2R6/uPwWbii+3mHs8/ceX1BKt7j8JVBzi4WOQPClUSN0Hq+4/6sYZUIXHNDy3RlmKJqnuPzXAZCvmMpQ8SCGtFW+n7j+fdplhSuSMvAncdrnhpe4/qE3vO8UzjLyFVTqwfqTuP67pK4l4U4S8IMPMNEaj7j9YWFZ43c6TvCUiVYI4ou4/ZBl+gKoQVzxzqUzUVaHuPygiXr/vs5O8zTt/Zp6g7j+CuTSHrRJqvL/aC3USoO4/7qltuO9nY7wvGmU8sp/uP1GI4FQ93IC8hJRR+X2f7j/PPlp+ZB94vHRf7Oh1n+4/sH2LwEruhrx0gaVImp/uP4rmVR4yGYa8yWdCVuuf7j/T1Aley5yQPD9d3k9poO4/HaVNudwye7yHAetzFKHuP2vAZ1T97JQ8MsEwAe2h7j9VbNar4etlPGJOzzbzou4/Qs+zL8WhiLwSGj5UJ6TuPzQ3O/G2aZO8E85MmYml7j8e/xk6hF6AvK3HI0Yap+4/bldy2FDUlLztkkSb2ajuPwCKDltnrZA8mWaK2ceq7j+06vDBL7eNPNugKkLlrO4//+fFnGC2ZbyMRLUWMq/uP0Rf81mD9ns8NncVma6x7j+DPR6nHwmTvMb/kQtbtO4/KR5si7ipXbzlxc2wN7fuP1m5kHz5I2y8D1LIy0S67j+q+fQiQ0OSvFBO3p+Cve4/S45m12zKhby6B8pw8cDuPyfOkSv8r3E8kPCjgpHE7j+7cwrhNdJtPCMj4xljyO4/YyJiIgTFh7xl5V17ZszuP9Ux4uOGHIs8My1K7JvQ7j8Vu7zT0buRvF0lPrID1e4/0jHunDHMkDxYszATntnuP7Nac26EaYQ8v/15VWve7j+0nY6Xzd+CvHrz079r4+4/hzPLkncajDyt01qZn+juP/rZ0UqPe5C8ZraNKQfu7j+6rtxW2cNVvPsVT7ii8+4/QPamPQ6kkLw6WeWNcvnuPzSTrTj01mi8R1778nb/7j81ilhr4u6RvEoGoTCwBe8/zd1fCtf/dDzSwUuQHgzvP6yYkvr7vZG8CR7XW8IS7z+zDK8wrm5zPJxShd2bGe8/lP2fXDLjjjx60P9fqyDvP6xZCdGP4IQ8S9FXLvEn7z9nGk44r81jPLXnBpRtL+8/aBmSbCxrZzxpkO/cIDfvP9K1zIMYioC8+sNdVQs/7z9v+v8/Xa2PvHyJB0otR+8/Sal1OK4NkLzyiQ0Ih0/vP6cHPaaFo3Q8h6T73BhY7z8PIkAgnpGCvJiDyRbjYO8/rJLB1VBajjyFMtsD5mnvP0trAaxZOoQ8YLQB8yFz7z8fPrQHIdWCvF+bezOXfO8/yQ1HO7kqibwpofUURobvP9OIOmAEtnQ89j+L5y6Q7z9xcp1R7MWDPINMx/tRmu8/8JHTjxL3j7zakKSir6TvP310I+KYro288WeOLUiv7z8IIKpBvMOOPCdaYe4buu8/Muupw5QrhDyXums3K8XvP+6F0TGpZIo8QEVuW3bQ7z/t4zvkujeOvBS+nK392+8/nc2RTTuJdzzYkJ6BwefvP4nMYEHBBVM88XGPK8Lz7z8AOPr+Qi7mPzBnx5NX8y49AAAAAAAA4L9gVVVVVVXlvwYAAAAAAOA/TlVZmZmZ6T96pClVVVXlv+lFSJtbSfK/wz8miysA8D8AAAAAAKD2PwBBmcIBCxfIufKCLNa/gFY3KCS0+jwAAAAAAID2PwBBucIBCxcIWL+90dW/IPfg2AilHL0AAAAAAGD2PwBB2cIBCxdYRRd3dtW/bVC21aRiI70AAAAAAED2PwBB+cIBCxf4LYetGtW/1WewnuSE5rwAAAAAACD2PwBBmcMBCxd4d5VfvtS/4D4pk2kbBL0AAAAAAAD2PwBBucMBCxdgHMKLYdS/zIRMSC/YEz0AAAAAAOD1PwBB2cMBCxeohoYwBNS/OguC7fNC3DwAAAAAAMD1PwBB+cMBCxdIaVVMptO/YJRRhsaxID0AAAAAAKD1PwBBmcQBCxeAmJrdR9O/koDF1E1ZJT0AAAAAAID1PwBBucQBCxcg4bri6NK/2Cu3mR57Jj0AAAAAAGD1PwBB2cQBCxeI3hNaidK/P7DPthTKFT0AAAAAAGD1PwBB+cQBCxeI3hNaidK/P7DPthTKFT0AAAAAAED1PwBBmcUBCxd4z/tBKdK/dtpTKCRaFr0AAAAAACD1PwBBucUBCxeYacGYyNG/BFTnaLyvH70AAAAAAAD1PwBB2cUBCxeoq6tcZ9G/8KiCM8YfHz0AAAAAAOD0PwBB+cUBCxdIrvmLBdG/ZloF/cSoJr0AAAAAAMD0PwBBmcYBCxeQc+Iko9C/DgP0fu5rDL0AAAAAAKD0PwBBucYBCxfQtJQlQNC/fy30nrg28LwAAAAAAKD0PwBB2cYBCxfQtJQlQNC/fy30nrg28LwAAAAAAID0PwBB+cYBCxdAXm0Yuc+/hzyZqypXDT0AAAAAAGD0PwBBmccBCxdg3Mut8M6/JK+GnLcmKz0AAAAAAED0PwBBuccBCxfwKm4HJ86/EP8/VE8vF70AAAAAACD0PwBB2ccBCxfAT2shXM2/G2jKu5G6IT0AAAAAAAD0PwBB+ccBCxegmsf3j8y/NISfaE95Jz0AAAAAAAD0PwBBmcgBCxegmsf3j8y/NISfaE95Jz0AAAAAAODzPwBBucgBCxeQLXSGwsu/j7eLMbBOGT0AAAAAAMDzPwBB2cgBCxfAgE7J88q/ZpDNP2NOujwAAAAAAKDzPwBB+cgBCxew4h+8I8q/6sFG3GSMJb0AAAAAAKDzPwBBmckBCxew4h+8I8q/6sFG3GSMJb0AAAAAAIDzPwBBuckBCxdQ9JxaUsm/49TBBNnRKr0AAAAAAGDzPwBB2ckBCxfQIGWgf8i/Cfrbf7+9Kz0AAAAAAEDzPwBB+ckBCxfgEAKJq8e/WEpTcpDbKz0AAAAAAEDzPwBBmcoBCxfgEAKJq8e/WEpTcpDbKz0AAAAAACDzPwBBucoBCxfQGecP1sa/ZuKyo2rkEL0AAAAAAADzPwBB2coBCxeQp3Aw/8W/OVAQn0OeHr0AAAAAAADzPwBB+coBCxeQp3Aw/8W/OVAQn0OeHr0AAAAAAODyPwBBmcsBCxewoePlJsW/j1sHkIveIL0AAAAAAMDyPwBBucsBCxeAy2wrTcS/PHg1YcEMFz0AAAAAAMDyPwBB2csBCxeAy2wrTcS/PHg1YcEMFz0AAAAAAKDyPwBB+csBCxeQHiD8ccO/OlQnTYZ48TwAAAAAAIDyPwBBmcwBCxfwH/hSlcK/CMRxFzCNJL0AAAAAAGDyPwBBucwBCxdgL9Uqt8G/lqMRGKSALr0AAAAAAGDyPwBB2cwBCxdgL9Uqt8G/lqMRGKSALr0AAAAAAEDyPwBB+cwBCxeQ0Hx+18C/9FvoiJZpCj0AAAAAAEDyPwBBmc0BCxeQ0Hx+18C/9FvoiJZpCj0AAAAAACDyPwBBuc0BCxfg2zGR7L+/8jOjXFR1Jb0AAAAAAADyPwBB2s0BCxYrbgcnvr88APAqLDQqPQAAAAAAAPI/AEH6zQELFituBye+vzwA8CosNCo9AAAAAADg8T8AQZnOAQsXwFuPVF68vwa+X1hXDB29AAAAAADA8T8AQbnOAQsX4Eo6bZK6v8iqW+g1OSU9AAAAAADA8T8AQdnOAQsX4Eo6bZK6v8iqW+g1OSU9AAAAAACg8T8AQfnOAQsXoDHWRcO4v2hWL00pfBM9AAAAAACg8T8AQZnPAQsXoDHWRcO4v2hWL00pfBM9AAAAAACA8T8AQbnPAQsXYOWK0vC2v9pzM8k3lya9AAAAAABg8T8AQdnPAQsXIAY/Bxu1v1dexmFbAh89AAAAAABg8T8AQfnPAQsXIAY/Bxu1v1dexmFbAh89AAAAAABA8T8AQZnQAQsX4BuW10Gzv98T+czaXiw9AAAAAABA8T8AQbnQAQsX4BuW10Gzv98T+czaXiw9AAAAAAAg8T8AQdnQAQsXgKPuNmWxvwmjj3ZefBQ9AAAAAAAA8T8AQfnQAQsXgBHAMAqvv5GONoOeWS09AAAAAAAA8T8AQZnRAQsXgBHAMAqvv5GONoOeWS09AAAAAADg8D8AQbnRAQsXgBlx3UKrv0xw1uV6ghw9AAAAAADg8D8AQdnRAQsXgBlx3UKrv0xw1uV6ghw9AAAAAADA8D8AQfnRAQsXwDL2WHSnv+6h8jRG/Cy9AAAAAADA8D8AQZnSAQsXwDL2WHSnv+6h8jRG/Cy9AAAAAACg8D8AQbnSAQsXwP65h56jv6r+JvW3AvU8AAAAAACg8D8AQdnSAQsXwP65h56jv6r+JvW3AvU8AAAAAACA8D8AQfrSAQsWeA6bgp+/5Al+fCaAKb0AAAAAAIDwPwBBmtMBCxZ4DpuCn7/kCX58JoApvQAAAAAAYPA/AEG50wELF4DVBxu5l785pvqTVI0ovQAAAAAAQPA/AEHa0wELFvywqMCPv5ym0/Z8Ht+8AAAAAABA8D8AQfrTAQsW/LCowI+/nKbT9nwe37wAAAAAACDwPwBBmtQBCxYQayrgf7/kQNoNP+IZvQAAAAAAIPA/AEG61AELFhBrKuB/v+RA2g0/4hm9AAAAAAAA8D8AQe7UAQsC8D8AQY3VAQsDwO8/AEGa1QELFol1FRCAP+grnZlrxxC9AAAAAACA7z8AQbnVAQsXgJNYViCQP9L34gZb3CO9AAAAAABA7z8AQdrVAQsWySglSZg/NAxaMrqgKr0AAAAAAADvPwBB+dUBCxdA54ldQaA/U9fxXMARAT0AAAAAAMDuPwBBmtYBCxYu1K5mpD8o/b11cxYsvQAAAAAAgO4/AEG51gELF8CfFKqUqD99JlrQlXkZvQAAAAAAQO4/AEHZ1gELF8DdzXPLrD8HKNhH8mgavQAAAAAAIO4/AEH51gELF8AGwDHqrj97O8lPPhEOvQAAAAAA4O0/AEGZ1wELF2BG0TuXsT+bng1WXTIlvQAAAAAAoO0/AEG51wELF+DRp/W9sz/XTtulXsgsPQAAAAAAYO0/AEHZ1wELF6CXTVrptT8eHV08BmksvQAAAAAAQO0/AEH51wELF8DqCtMAtz8y7Z2pjR7sPAAAAAAAAO0/AEGZ2AELF0BZXV4zuT/aR706XBEjPQAAAAAAwOw/AEG52AELF2Ctjchquz/laPcrgJATvQAAAAAAoOw/AEHZ2AELF0C8AViIvD/TrFrG0UYmPQAAAAAAYOw/AEH52AELFyAKgznHvj/gReavaMAtvQAAAAAAQOw/AEGZ2QELF+DbOZHovz/9CqFP1jQlvQAAAAAAAOw/AEG52QELF+Ango4XwT/yBy3OeO8hPQAAAAAA4Os/AEHZ2QELF/AjfiuqwT80mThEjqcsPQAAAAAAoOs/AEH52QELF4CGDGHRwj+htIHLbJ0DPQAAAAAAgOs/AEGZ2gELF5AVsPxlwz+JcksjqC/GPAAAAAAAQOs/AEG52gELF7Azgz2RxD94tv1UeYMlPQAAAAAAIOs/AEHZ2gELF7Ch5OUnxT/HfWnl6DMmPQAAAAAA4Oo/AEH52gELFxCMvk5Xxj94Ljwsi88ZPQAAAAAAwOo/AEGZ2wELF3B1ixLwxj/hIZzljRElvQAAAAAAoOo/AEG52wELF1BEhY2Jxz8FQ5FwEGYcvQAAAAAAYOo/AEHa2wELFjnrr77IP9Es6apUPQe9AAAAAABA6j8AQfrbAQsW99xaWsk/b/+gWCjyBz0AAAAAAADqPwBBmdwBCxfgijztk8o/aSFWUENyKL0AAAAAAODpPwBBudwBCxfQW1fYMcs/quGsTo01DL0AAAAAAMDpPwBB2dwBCxfgOziH0Ms/thJUWcRLLb0AAAAAAKDpPwBB+dwBCxcQ8Mb7b8w/0iuWxXLs8bwAAAAAAGDpPwBBmd0BCxeQ1LA9sc0/NbAV9yr/Kr0AAAAAAEDpPwBBud0BCxcQ5/8OU84/MPRBYCcSwjwAAAAAACDpPwBB2t0BCxbd5K31zj8RjrtlFSHKvAAAAAAAAOk/AEH53QELF7CzbByZzz8w3wzK7MsbPQAAAAAAwOg/AEGZ3gELF1hNYDhx0D+RTu0W25z4PAAAAAAAoOg/AEG53gELF2BhZy3E0D/p6jwWixgnPQAAAAAAgOg/AEHZ3gELF+gngo4X0T8c8KVjDiEsvQAAAAAAYOg/AEH53gELF/isy1xr0T+BFqX3zZorPQAAAAAAQOg/AEGZ3wELF2haY5m/0T+3vUdR7aYsPQAAAAAAIOg/AEG53wELF7gObUUU0j/quka63ocKPQAAAAAA4Oc/AEHZ3wELF5DcfPC+0j/0BFBK+pwqPQAAAAAAwOc/AEH53wELF2DT4fEU0z+4PCHTeuIovQAAAAAAoOc/AEGZ4AELFxC+dmdr0z/Id/GwzW4RPQAAAAAAgOc/AEG54AELFzAzd1LC0z9cvQa2VDsYPQAAAAAAYOc/AEHZ4AELF+jVI7QZ1D+d4JDsNuQIPQAAAAAAQOc/AEH54AELF8hxwo1x1D911mcJzicvvQAAAAAAIOc/AEGZ4QELFzAXnuDJ1D+k2AobiSAuvQAAAAAAAOc/AEG54QELF6A4B64i1T9Zx2SBcL4uPQAAAAAA4OY/AEHZ4QELF9DIU/d71T/vQF3u7a0fPQAAAAAAwOY/AEH54QELSmBZ373V1T/cZaQIKgsKvQAAAAAccQAAqwEAAE4CAABPAgAANHYAAChxAAAUdwAATlN0M19fMjE3YmFkX2Z1bmN0aW9uX2NhbGxFAEHU4gELlA0CAAAAAwAAAAUAAAAHAAAACwAAAA0AAAARAAAAEwAAABcAAAAdAAAAHwAAACUAAAApAAAAKwAAAC8AAAA1AAAAOwAAAD0AAABDAAAARwAAAEkAAABPAAAAUwAAAFkAAABhAAAAZQAAAGcAAABrAAAAbQAAAHEAAAB/AAAAgwAAAIkAAACLAAAAlQAAAJcAAACdAAAAowAAAKcAAACtAAAAswAAALUAAAC/AAAAwQAAAMUAAADHAAAA0wAAAAEAAAALAAAADQAAABEAAAATAAAAFwAAAB0AAAAfAAAAJQAAACkAAAArAAAALwAAADUAAAA7AAAAPQAAAEMAAABHAAAASQAAAE8AAABTAAAAWQAAAGEAAABlAAAAZwAAAGsAAABtAAAAcQAAAHkAAAB/AAAAgwAAAIkAAACLAAAAjwAAAJUAAACXAAAAnQAAAKMAAACnAAAAqQAAAK0AAACzAAAAtQAAALsAAAC/AAAAwQAAAMUAAADHAAAA0QAAAAx2AADYcgAATlN0M19fMjE0X19zaGFyZWRfY291bnRFAAAAAJB2AAAMcwAAAAAAAAEAAADQcgAAAAAAAE5TdDNfXzIxOV9fc2hhcmVkX3dlYWtfY291bnRFAAAAAAAAAEBzAAC9AQAAUAIAAFECAAA0dgAATHMAABR3AABOU3QzX18yMTJiYWRfd2Vha19wdHJFAAA0dgAAcHMAANR3AABOMTBfX2N4eGFiaXYxMTZfX3NoaW1fdHlwZV9pbmZvRQAAAAA0dgAAoHMAAGRzAABOMTBfX2N4eGFiaXYxMTdfX2NsYXNzX3R5cGVfaW5mb0UAAAA0dgAA0HMAAGRzAABOMTBfX2N4eGFiaXYxMTdfX3BiYXNlX3R5cGVfaW5mb0UAAAA0dgAAAHQAAMRzAABOMTBfX2N4eGFiaXYxMTlfX3BvaW50ZXJfdHlwZV9pbmZvRQA0dgAAMHQAAGRzAABOMTBfX2N4eGFiaXYxMjBfX2Z1bmN0aW9uX3R5cGVfaW5mb0UAAAAANHYAAGR0AADEcwAATjEwX19jeHhhYml2MTI5X19wb2ludGVyX3RvX21lbWJlcl90eXBlX2luZm9FAAAAAAAAALB0AABSAgAAUwIAAFQCAABVAgAAVgIAADR2AAC8dAAAZHMAAE4xMF9fY3h4YWJpdjEyM19fZnVuZGFtZW50YWxfdHlwZV9pbmZvRQCcdAAA7HQAAHYARG4AAAAAnHQAAPx0AABiAAAAnHQAAAh1AABjAAAAnHQAABR1AABoAAAAnHQAACB1AABhAAAAnHQAACx1AABzAAAAnHQAADh1AAB0AAAAnHQAAER1AABpAAAAnHQAAFB1AABqAAAAnHQAAFx1AABsAAAAnHQAAGh1AABtAAAAnHQAAHR1AAB4AAAAnHQAAIB1AAB5AAAAnHQAAIx1AABmAAAAnHQAAJh1AABkAAAAAAAAACR0AABSAgAAVwIAAFQCAABVAgAAWAIAAAAAAADUdQAAUgIAAFkCAABUAgAAVQIAAFoCAAA0dgAA4HUAAGRzAABOMTBfX2N4eGFiaXYxMTZfX2VudW1fdHlwZV9pbmZvRQAAAAAAAAAAlHMAAFICAABbAgAAVAIAAFUCAABcAgAAXQIAAF4CAABfAgAAAAAAAFR2AABSAgAAYAIAAFQCAABVAgAAXAIAAGECAABiAgAAYwIAADR2AABgdgAAlHMAAE4xMF9fY3h4YWJpdjEyMF9fc2lfY2xhc3NfdHlwZV9pbmZvRQAAAAAAAAAAsHYAAFICAABkAgAAVAIAAFUCAABcAgAAZQIAAGYCAABnAgAANHYAALx2AACUcwAATjEwX19jeHhhYml2MTIxX192bWlfY2xhc3NfdHlwZV9pbmZvRQAAAAAAAAD0cwAAUgIAAGgCAABUAgAAVQIAAGkCAAAAAAAASHcAAG0BAABqAgAAawIAAAx2AAAcdwAAU3Q5ZXhjZXB0aW9uAAAAADR2AAA4dwAAFHcAAFN0OWJhZF9hbGxvYwAAAAA0dgAAVHcAACx3AABTdDIwYmFkX2FycmF5X25ld19sZW5ndGgAAAAAAAAAAIR3AABuAQAAbAIAAG0CAAA0dgAAkHcAABR3AABTdDExbG9naWNfZXJyb3IAAAAAALR3AABuAQAAbgIAAG0CAAA0dgAAwHcAAIR3AABTdDEybGVuZ3RoX2Vycm9yAAAAAAx2AADcdwAAU3Q5dHlwZV9pbmZvAEHw7wELtgEMdgAAUxIAAAx2AAB2EgAADHYAAJkSAAAMdgAAvBIAAMB1AADfEgAAwHUAAPoSAADAdQAAHRMAAAx2AABAEwAADHYAAF8TAAAMdgAAfRMAAAx2AACsEwAADHYAAN8TAADsdgAA/RMAAAAAAABIeAAA7HYAABwUAAABAAAASHgAAFB4AADkdAAAUHgAAPR0AABgeAAAkHUAAGB4AACYeAAASHgAAKB4AAAMdgAAUxQAAAx2AABoFABBsPEBCxaYeAAASHgAAKB4AADAeAAADHYAAIAUAEHQ8QELsgOYeAAASHgAAGB1AAAweAAAkHUAAJB1AACQdQAAkHYAAMsUAAAAAAAAAwAAABR5AAAAAAAAWHkAAAAAAABgeQAAAAAAADR2AADxFAAAIHkAADR2AAAvFQAALHkAADR2AABtFQAAOHkAADR2AACkFQAARHkAADR2AADbFQAAUHkAAAx2AAAVFgAADHYAAFAWAAAMdgAAdxYAAAx2AACgFgAA7HYAANcWAAAAAAAAaHkAAOx2AAAPFwAAAQAAAGh5AABweQAA5HQAAGh5AABAeAAA5HQAAGh5AABIdQAAQHgAAEh1AABoeQAAoHgAAEB4AADseAAAaHkAAEh1AAAAAAAA9HQAAGh5AABIdQAAQHgAAJB2AABrFwAAAAAAAAMAAAAIegAAAAAAAFh5AAAAAAAAYHkAAAAAAAA0dgAAkxcAABR6AAA0dgAA0xcAACB6AAA0dgAAExgAACx6AAA0dgAATBgAADh6AAA0dgAAhRgAAER6AAAMdgAAwRgAAAx2AAD+GAAA7HYAADcZAAAAAAAATHoAAOx2AABxGQAAAQAAAEx6AABUegAA5HQAAEx6AAD4dwBBkPUBC+IB5HQAAEx6AABIdQAA+HcAAEh1AABMegAAoHgAAPh3AADgeQAATHoAAEh1AAAAAAAA9HQAAEx6AABIdQAA+HcAAJB2AADPGQAAAAAAAAMAAAD4egAAAAAAAFh5AAAAAAAAYHkAAAAAAAA0dgAA9xkAAAR7AAA0dgAANxoAABB7AAA0dgAAdxoAABx7AAA0dgAAsBoAACh7AAA0dgAA6RoAADR7AAAMdgAAJRsAAAx2AABiGwAA7HYAAJsbAAAAAAAAPHsAAOx2AADVGwAAAQAAADx7AABEewAA5HQAADx7AAAAeABBgPcBC+IB5HQAADx7AABIdQAAAHgAAEh1AAA8ewAAoHgAAAB4AADQegAAPHsAAEh1AAAAAAAA9HQAADx7AABIdQAAAHgAAJB2AAAzHAAAAAAAAAMAAADoewAAAAAAAFh5AAAAAAAAYHkAAAAAAAA0dgAAWxwAAPR7AAA0dgAAmxwAAAB8AAA0dgAA2xwAAAx8AAA0dgAAFB0AABh8AAA0dgAATR0AACR8AAAMdgAAiR0AAAx2AADGHQAA7HYAAP8dAAAAAAAALHwAAOx2AAA5HgAAAQAAACx8AAA0fAAA5HQAACx8AADwdwBB8PgBC+IB5HQAACx8AABIdQAA8HcAAEh1AAAsfAAAoHgAAPB3AADAewAALHwAAEh1AAAAAAAA9HQAACx8AABIdQAA8HcAAJB2AACXHgAAAAAAAAMAAADYfAAAAAAAAFh5AAAAAAAAYHkAAAAAAAA0dgAA3x4AAOR8AAA0dgAAPx8AAPB8AAA0dgAAnx8AAPx8AAA0dgAA+B8AAAh9AAA0dgAAUSAAABR9AAAMdgAArSAAAAx2AAAKIQAA7HYAAFQhAAAAAAAAHH0AAOx2AACfIQAAAQAAABx9AAAkfQAA5HQAABx9AAAsfABB4PoBC+IB5HQAABx9AABIdQAALHwAAEh1AAAcfQAAoHgAACx8AACwfAAAHH0AAEh1AAAAAAAA9HQAABx9AABIdQAALHwAAJB2AAAOIgAAAAAAAAMAAADIfQAAAAAAAFh5AAAAAAAAYHkAAAAAAAA0dgAAIyIAANR9AAA0dgAAUCIAAOB9AAA0dgAAfSIAAOx9AAA0dgAAoyIAAPh9AAA0dgAAySIAAAR+AAAMdgAA8iIAAAx2AAAcIwAA7HYAAEAjAAAAAAAADH4AAOx2AABlIwAAAQAAAAx+AAAUfgAA5HQAAAx+AACQdQBB0PwBC9ID5HQAAAx+AABIdQAAkHUAAEh1AAAMfgAAoHgAAJB1AACgfQAADH4AAEh1AAAAAAAA9HQAAAx+AABIdQAAkHUAAJB2AACuIwAAAAAAAAMAAAC4fgAAAAAAAFh5AAAAAAAAYHkAAAAAAAA0dgAA2yMAAMR+AAA0dgAAICQAANB+AAA0dgAAZSQAANx+AAA0dgAAoyQAAOh+AAA0dgAA4SQAAPR+AAAMdgAAIiUAAAx2AABkJQAADHYAAH4lAADsdgAAvCUAAAAAAAAEfwAA7HYAAPslAAABAAAABH8AAAx/AADkdAAABH8AAPx+AAAAAAAA5HQAAAR/AABIdQAA/H4AAEh1AAAEfwAAoHgAAPx+AACQfgAABH8AAEh1AAAAAAAA9HQAAAR/AABIdQAA/H4AAJB2AABeJgAAAAAAAAMAAACofwAAAAAAAFh5AAAAAAAAYHkAAAAAAAA0dgAAhiYAALR/AAA0dgAAxiYAAMB/AAA0dgAABicAAMx/AAA0dgAAPycAANh/AAA0dgAAeCcAAOR/AAAMdgAAtCcAAAx2AADxJwAA7HYAACooAAAAAAAA7H8AAOx2AABkKAAAAQAAAOx/AAD0fwAA5HQAAOx/AACYeABBsIACC8ID5HQAAOx/AABIdQAAmHgAAEh1AADsfwAAoHgAAJh4AACAfwAA7H8AAEh1AAAAAAAA9HQAAOx/AABIdQAAmHgAAJB2AADCKAAAAAAAAAMAAACYgAAAAAAAAFh5AAAAAAAAYHkAAAAAAAA0dgAA7SgAAKSAAAA0dgAAMCkAALCAAAA0dgAAcykAALyAAAA0dgAArykAAMiAAAA0dgAA6ykAANSAAAAMdgAAKioAAOx2AABqKgAAAAAAAMB4AADsdgAApyoAAAEAAADAeAAA3IAAAOR0AADAeAAAOHgAAAAAAADkdAAAwHgAAEh1AAA4eAAASHUAAMB4AACgeAAAOHgAAHCAAADAeAAASHUAAAAAAAD0dAAAwHgAAEh1AAA4eAAAkHYAAAgrAAAAAAAAAwAAAHiBAAAAAAAAWHkAAAAAAABgeQAAAAAAADR2AAAwKwAAhIEAADR2AABwKwAAkIEAADR2AACwKwAAnIEAADR2AADpKwAAqIEAADR2AAAiLAAAtIEAAAx2AABeLAAADHYAAJssAADsdgAA1CwAAAAAAAC8gQAA7HYAAA4tAAABAAAAvIEAAMSBAADkdAAAvIEAAAh4AEGAhAILpgTkdAAAvIEAAEh1AAAIeAAASHUAALyBAACgeAAACHgAAFCBAAC8gQAASHUAAAAAAAD0dAAAvIEAAEh1AAAIeAAA7HYAAGwtAAAAAAAA/H4AAOx2AACHLQAAAQAAAPx+AAD8fgAAHH0AADx1AAD8fgAA/H4AAPx+AAD8fgAA/H4AAGB1AAD8fgAA/H4AAKB4AAD8fgAAUIIAAPB3AAD8fgAAUIIAAJB1AAAEfwAAUIIAAPR0AABQggAAkHUAAFCCAABgdQAAUIIAACh4AABQggAA/H4AAPx+AACQdQAAPHUAAJB1AACQdQAAHH0AAFCCAAD8fgAAUIIAAPx+AADwdwAA9HQAAPx+AACQdQAAPHUAAPx+AAAEfwAA5HQAACx8AAD8fgAA/H4AACx8AADsdgAAAi4AAAAAAACYeAAA7HYAABguAAABAAAAmHgAAJh4AACgeAAAmHgAAJh4AACYeAAA7H8AAJh4AACYeAAAAAAAAOx/AACYeAAAAHgAAJB1AACYeAAAPIMAAAB4AACQdQAAmHgAADyDAACYeAAAHH0AADyDAACQdQAAHH0AADyDAACYeAAAPIMAAKB4AACYeAAAPHUAAJh4AAA8gwAAPHUAAJh4AAA8gwAAkHUAAAAAAACYeAAAPIMAAJB1AACQdQAAmHgAAJh4AABgdQAAAAAAAJh4AACYeAAAPHUAAGB1AACYeAAAmHgAAKB4AACYeAAAPIMAAAB4AEGwiAIL4gGYeAAAPIMAAJB1AACQdQAAkHUAAOx/AAA8gwAA9HQAADyDAABchAAAmHgAAAx2AACaLgAAmHgAADyDAABIeAAAYHUAADyDAAAweAAAPIMAAJB1AAA8gwAAPHUAADyDAACQdQAAPIMAAJh4AACQdQAAaHkAAJh4AAAAeAAAAHgAAJh4AAA8gwAAPHUAADx1AACYeAAAPIMAADx1AACQdQAAmHgAAAB4AAD0dAAAAAAAAJh4AACQdQAAkHUAAJB1AAA8dQAA9HQAAJh4AACQdQAAPHUAAJh4AACYeAAAoHgAAMB4AEGgigILFph4AAAcfQAAkHUAADx1AACQdQAA8HcAQcCKAguaC0x6AAAcfQAAkHUAAPR0AACYeAAAHH0AADx1AACQdQAAmHgAAGB1AAAweAAAkHUAAJB1AACQdQAAoHgAAKB4AABIdQAASHUAAJh4AADsfwAA5HQAADx7AACYeAAAmHgAADx7AADkdAAAkHUAAOR0AAA8dQAAPHUAAJB1AADkdAAAoHgAAEh1AACgeAAA0IUAAAx2AABkLwAAoHgAAKB4AADkhQAADHYAAIMvAACgeAAA9IUAAAx2AACiLwAAoHgAAIR1AAA8dQAAoHgAAGB1AACgeAAAhHUAAKB4AACgeAAA9HQAAKB4AAAshgAADHYAAMEvAAAAAAAAYIYAAHABAABxAQAAcgEAAHMBAAB0AQAAdQEAAHYBAAB3AQAAeAEAADR2AADgLwAAbIYAAAx2AAAaMAAA7HYAAFAwAAAAAAAAhIYAAKR1AABqMAAAAAAAALiGAAB5AQAAegEAAHsBAAB8AQAAfQEAAH4BAAB/AQAAgAEAAIEBAAA0dgAAgzAAAMSGAAAMdgAAvTAAAOx2AADzMAAAAAAAANyGAACkdQAADTEAAAAAAAAQhwAAggEAAIMBAACEAQAAhQEAAIYBAACHAQAAiAEAAIkBAACKAQAANHYAACYxAAAchwAADHYAAJkxAAAMdgAA4zEAAAAAAABYhwAAiwEAAIwBAACNAQAAjgEAAI8BAACQAQAAkQEAAJIBAACTAQAANHYAABMyAABkhwAADHYAAFEyAADsdgAAizIAAAAAAAB8hwAApHUAAKkyAAAAAAAAsIcAAJQBAACVAQAAlgEAAJcBAACYAQAAmQEAAJoBAACbAQAAnAEAADR2AADGMgAAvIcAAAx2AAAEMwAA7HYAADkzAAAAAAAA1IcAAKR1AABUMwAADgcAACUEAACHCwAAkwYAAKIIAABDBgAA/wUAAKUGAAC4CAAAjggAAM0IAAC0BwAAqwoAAI0FAACiCwAAAAAAADSIAACdAQAAngEAAJ8BAACgAQAAoQEAADR2AABuMwAA9HIAAAAAAABsiAAAogEAAKMBAACkAQAApQEAAKYBAACnAQAAqAEAAKkBAACqAQAANHYAALwzAAB4iAAADHYAACM0AAAMdgAAZzQAAAAAAAC0iAAArAEAAK0BAACuAQAArwEAALABAACxAQAAsgEAALMBAAC0AQAANHYAAJg0AADAiAAADHYAANk1AAAMdgAA+zUAAAAAAAD8iAAArAEAALUBAAC2AQAAtwEAALgBAAC5AQAAugEAALsBAAC8AQAANHYAACM3AADAiAAADHYAAGQ4AAAAAAAAaIkAAL4BAAC/AQAAwAEAAMEBAADCAQAAAAAAAHSJAADDAQAAxAEAAMUBAADGAQAAxwEAAJB2AAClOQAAAAAAAAEAAABgiQAAAgQAAAx2AAC5OQAANHYAAPA5AABIiQAANHYAAAk6AABIiQAAAAAAAJyJAADIAQAAyQEAAMoBAACgAQAAywEAADR2AAAfOgAA9HIAAAAAAADEiQAAzAEAAM0BAADOAQAAoAEAAM8BAAA0dgAAbToAAPRyAAAAAAAA7IkAANABAADRAQAA0gEAAKABAADTAQAANHYAALY6AAD0cgAAAAAAABSKAADUAQAA1QEAANYBAACgAQAA1wEAADR2AAAEOwAA9HIAAAAAAAA8igAA2AEAANkBAADaAQAAoAEAANsBAAA0dgAAUDsAAPRyAAAAAAAAZIoAANwBAADdAQAA3gEAAKABAADfAQAANHYAAMA7AAD0cgAAAAAAAIyKAADgAQAA4QEAAOIBAACgAQAA4wEAADR2AAAYPAAA9HIAAAEAAAAAAAAAyIoAAIIBAADkAQAA5QEAAOYBAADnAQAA6AEAAOkBAADqAQAA6wEAADR2AABcPwAAHIcAAAx2AADaPwBB5pUCCw8kQAAAAAAAAPA/AAABAAEAQYCWAgvDBhiLAADsAQAA7QEAAO4BAACgAQAA7wEAADR2AABwQAAA9HIAAAAAAABQiwAAogEAAPABAADxAQAA8gEAAPMBAAD0AQAA9QEAAPYBAAD3AQAANHYAAK5AAAB4iAAADHYAABVBAAAAAAAAkIsAAKIBAAD4AQAA+QEAAPoBAAD7AQAA/AEAAP0BAAD+AQAA/wEAADR2AAA5QQAAeIgAAAx2AACpQQAAAAAAANCLAACiAQAAAAIAAAECAAACAgAAAwIAAAQCAAAFAgAABgIAAAcCAAA0dgAA1kEAAHiIAAAMdgAASUIAAAAAAAAAjAAACAIAAAkCAAAKAgAACwIAAAwCAAA0dgAAeUIAAPRyAAAAAAAAOIwAAA0CAAAOAgAADwIAABACAAARAgAAEgIAABMCAAAUAgAAFQIAADR2AADgRQAARIwAAAx2AABMRgAADHYAAJ9GAAAAAAAAgIwAABYCAAAXAgAAGAIAABkCAAAaAgAAGwIAABwCAAAdAgAAHgIAADR2AADNRgAAjIwAAAx2AABARwAADHYAAJpHAAAAAAAAyIwAAB8CAAAgAgAAIQIAACICAAAjAgAAJAIAACUCAAAmAgAAJwIAADR2AADIRwAA1IwAAAx2AABVSAAADHYAALpIAAAAAAAAEI0AACgCAAApAgAAKgIAACsCAAAsAgAALQIAAC4CAAAvAgAAMAIAADR2AAD4SAAAHI0AAAx2AACSSQAADHYAAP5JAAAAAAAASI0AADUCAAA2AgAANwIAAKABAAA4AgAANHYAAKBKAAD0cgAANHYAAOlKAAAUdwAAAAAAAFSNAAAzAgAAOQIAADoCAAAAAAAAhI0AADsCAAA8AgAANHYAAAxLAAAYjgAAAAAAAKyNAAA9AgAAPgIAAD8CAABAAgAAQQIAADR2AAAlSwAAuI0AAAx2AAA/SwAAAAAAAOyNAABCAgAAQwIAAEQCAABFAgAARgIAAEcCAABIAgAASQIAAEoCAAA0dgAAWEsAAPiNAAAMdgAA10sAAAx2AAAhTAAAAAAAABiOAAA7AgAATAIAAAx2AAByTAAAAAAAADCOAAA7AgAATQIAADR2AACPTAAAGI4AAAAgAACwlQEAQdCcAgt+oJIAALiSAADQkgAA6JIAAACTAAAYkwAAMJMAAEiTAABgkwAAeJMAAJCTAACokwAAwJMAANiTAADwkwAACJQAACCUAAA4lAAAUJQAAGiUAACAlAAAmJQAALCUAADIlAAA4JQAAPiUAAAQlQAAKJUAAECVAABYlQAAcJUAAIiV";var P6e=null,vZe=null,ehn=null;var nvr=()=>{let e=globalThis.atob(Zln),t=new Uint8Array(e.length);for(let n=0;n<e.length;n++)t[n]=e.charCodeAt(n);return t},ovr=async()=>{let e=Boolean(globalThis.process?.versions?.node&&globalThis.process?.type!=="renderer"),t=ehn?{locateFile:()=>ehn}:e?void 0:{locateFile:()=>"manifold.wasm",wasmBinary:nvr()},n=await Jln(t);return n.setup(),n},thn=async()=>{if(P6e)return P6e;return vZe??=ovr().then((e)=>(P6e=e,e)).catch((e)=>{throw vZe=null,e}),vZe},SZe=()=>P6e;tc();Ko();var fm=1e6,qle=(e)=>{let t=0;for(let n=0;n<e.length;n++){let o=e[n],r=e[(n+1)%e.length];t+=o.x*r.y-r.x*o.y}return t/2},rvr=(e)=>{let t=0,n={minX:Number.POSITIVE_INFINITY,minY:Number.POSITIVE_INFINITY,maxX:Number.NEGATIVE_INFINITY,maxY:Number.NEGATIVE_INFINITY};for(let o of e){t+=o.length;for(let[r,i]of o)n.minX=Math.min(n.minX,r),n.minY=Math.min(n.minY,i),n.maxX=Math.max(n.maxX,r),n.maxY=Math.max(n.maxY,i)}return{polygonCount:e.length,pointCount:t,bbox:t>0?n:null,scale:fm}},ivr=(e,t)=>{if(!Number.isFinite(e.x)||!Number.isFinite(e.y))throw Error(`${t} received non-finite point (${e.x}, ${e.y})`)},nhn=(e,t)=>e.x===t.x&&e.y===t.y,QV=(e,t="normalizeRing")=>{let n=[];for(let r of e){ivr(r,t);let i={x:Math.round(r.x*fm)/fm,y:Math.round(r.y*fm)/fm},s=n[n.length-1];if(!s||!nhn(s,i))n.push(i)}if(n.length>1&&nhn(n[0],n[n.length-1]))n.pop();if(new Set(n.map((r)=>`${r.x},${r.y}`)).size<3||Math.abs(qle(n))<0.000000000000000001)return[];return n},Jle=(e,t="toScaledManifoldPolygons")=>{let n=[];for(let o of e){let r=QV(o,t);if(r.length<3)continue;let i=qle(r)<0?[...r].reverse():r;n.push(i.map((s)=>[Math.round(s.x*fm),Math.round(s.y*fm)]))}return n},shn=(e)=>e.map((t)=>QV(t.map(([n,o])=>({x:n/fm,y:o/fm})),"fromScaledManifoldPolygons")).filter((t)=>t.length>=3),ohn=(e,t)=>{let n=qle(e);return t==="positive"&&n<0||t==="negative"&&n>0?[...e].reverse():e},rhn=(e)=>e.map((t)=>({x:t.x,y:t.y})),svr=(e)=>{let t=[];for(let n of e){if(n.outerRing.length<3)continue;let o=ohn(n.outerRing,"negative"),r=n.innerRings.filter((i)=>i.length>=3).map((i)=>ohn(i,"positive"));t.push({outer_ring:{vertices:rhn(o)},inner_rings:r.map((i)=>({vertices:rhn(i)}))})}return t},ahn=async()=>{await thn()},avr=()=>Boolean(SZe()),BQ=()=>{let e=SZe();if(!e)throw Error("Manifold geometry has not been initialized. Call initializeManifoldGeometry() before solving copper pours.");return e.CrossSection},Fw=(e,t,n)=>{try{return n()}catch(o){let r=rvr(t),i=o instanceof Error?o.message:String(o);throw Error(`${e} failed: ${i}; details=${JSON.stringify(r)}`)}},cvr=0.00000001,MZe=()=>BQ().square([0,0]),lvr=(e,t="Positive")=>{let n=Jle([e],"crossSectionFromPolygon"),o=BQ();if(n.length===0)return MZe();return Fw("crossSectionFromPolygon",n,()=>o.ofPolygons(n,t))},RV=(e,t="Positive")=>{let n=Jle(e,"crossSectionFromPolygons"),o=BQ();if(n.length===0)return MZe();return Fw("crossSectionFromPolygons",n,()=>o.ofPolygons(n,t))},wZe=(e)=>{let t=e.filter((o)=>!o.isEmpty()),n=BQ();if(t.length===0)return MZe();return Fw("composeCrossSections",[],()=>n.compose(t))},Kle=(e,t,n="Miter")=>{let o=Jle([e],"offsetPolygon");if(o.length===0||t<=0)return o.length===0?[]:[QV(e)];let r=t*fm,i=BQ(),s=Fw("offsetPolygon.input",o,()=>i.ofPolygons(o,"Positive")),a=Fw("offsetPolygon.offset",o,()=>s.offset(r,n,2,32));return shn(a.toPolygons())},hvr=(e,t,n="Miter")=>{if(e.isEmpty()||t<=0)return e;let o=t*fm,r=e.toPolygons();return Fw("offsetCrossSection",r,()=>e.offset(o,n,2,32))},chn=(e,t)=>{let n=wZe(t);if(e.isEmpty()||n.isEmpty())return e;return Fw("subtractCrossSectionBlockers",[...e.toPolygons(),...n.toPolygons()],()=>e.subtract(n))},dvr=(e,t)=>{let n=lvr(e),o=RV(t);if(n.isEmpty()||o.isEmpty())return n;let r=[...Jle([e],"subtractBlockersFromPour.pour"),...Jle(t,"subtractBlockersFromPour.blockers")];return Fw("subtractBlockersFromPour",r,()=>n.subtract(o))},uvr=(e,t=cvr)=>{if(e.isEmpty())return e;let n=t*fm*fm,o=e.decompose().filter((r)=>Math.abs(r.area())>=n);return wZe(o)},lhn=(e)=>{let t=[];for(let n of e.decompose()){let o=shn(n.toPolygons());if(o.length===0)continue;let r=o.reduce((s,a)=>Math.abs(qle(a))>Math.abs(qle(s))?a:s),i=o.filter((s)=>s!==r);t.push({outerRing:r,innerRings:i})}return t};function pvr(e){let{start:t,end:n,start_width:o,end_width:r}=e,i=n.x-t.x,s=n.y-t.y,a=Math.hypot(i,s);if(a===0||o<=0||r<=0)return[];let c=Math.abs(r-o),l=e.width_interpolation_mode==="linear"?1:Math.max(1,Math.ceil(Math.sqrt(c/0.008))),h=[],d=[];for(let u=0;u<=l;u++){let _=u/l,p=o<=r?_:1-_,m=e.width_interpolation_mode==="quadratic"?Math.min(o,r)+c*p*p:o+(r-o)*_,A=t.x+i*_,g=t.y+s*_;h.push({x:A-s/a*m/2,y:g+i/a*m/2}),d.push({x:A+s/a*m/2,y:g-i/a*m/2})}return[...d,...h.reverse()]}var $le=(e,t,n=32)=>{let o=[];for(let r=0;r<n;r++){let i=r/n*2*Math.PI;o.push({x:e.x+t*Math.cos(i),y:e.y+t*Math.sin(i)})}return o},hhn=(e,t,n,o=0,r=32)=>{if(t<=0||n<=0)return[];let i=t/2,s=n/2,a=o*Math.PI/180,c=Math.cos(a),l=Math.sin(a),h=[];for(let d=0;d<r;d++){let u=d/r*2*Math.PI,_=i*Math.cos(u),p=s*Math.sin(u);h.push({x:e.x+_*c-p*l,y:e.y+_*l+p*c})}return h},PZe=(e,t,n,o)=>[{x:e,y:t},{x:n,y:t},{x:n,y:o},{x:e,y:o}],dhn=(e,t,n,o)=>{let r=t/2,i=n/2,s=o*Math.PI/180,a=Math.cos(s),c=Math.sin(s);return[{x:-r,y:-i},{x:r,y:-i},{x:r,y:i},{x:-r,y:i}].map((l)=>({x:e.x+l.x*a-l.y*c,y:e.y+l.x*c+l.y*a}))},EZe=(e,t,n)=>{let o=Math.hypot(e.x-t.x,e.y-t.y);if(o===0)return[];let r=(e.x+t.x)/2,i=(e.y+t.y)/2,s=Math.atan2(t.y-e.y,t.x-e.x),a=Math.cos(s),c=Math.sin(s),l=o/2,h=n/2;return[{x:-l,y:-h},{x:l,y:-h},{x:l,y:h},{x:-l,y:h}].map((d)=>({x:r+d.x*a-d.y*c,y:i+d.x*c+d.y*a}))},uhn=(e,t,n,o,r=0,i=32)=>{if(o<=0)return[];let s=n>=t,a=Math.max(t,n)-2*o,c=Math.max(0,a/2),h=(s?Math.PI/2:0)+r*Math.PI/180,d=Math.cos(h),u=Math.sin(h),_={x:e.x-c*d,y:e.y-c*u},p={x:e.x+c*d,y:e.y+c*u};if(c===0)return $le(e,o,i);let m=[],A=Math.max(4,Math.floor(i/2));for(let g=0;g<=A;g++){let f=h-Math.PI/2+g/A*Math.PI;m.push({x:p.x+o*Math.cos(f),y:p.y+o*Math.sin(f)})}for(let g=0;g<=A;g++){let f=h+Math.PI/2+g/A*Math.PI;m.push({x:_.x+o*Math.cos(f),y:_.y+o*Math.sin(f)})}return m},mvr=(e)=>{if(e.shape==="rect")return{x:(e.bounds.minX+e.bounds.maxX)/2,y:(e.bounds.minY+e.bounds.maxY)/2};if(e.shape==="polygon"){let t=e.points.reduce((n,o)=>({minX:Math.min(n.minX,o.x),minY:Math.min(n.minY,o.y),maxX:Math.max(n.maxX,o.x),maxY:Math.max(n.maxY,o.y)}),{minX:Number.POSITIVE_INFINITY,minY:Number.POSITIVE_INFINITY,maxX:Number.NEGATIVE_INFINITY,maxY:Number.NEGATIVE_INFINITY});return{x:(t.minX+t.maxX)/2,y:(t.minY+t.maxY)/2}}return{x:e.x,y:e.y}},_vr=(e)=>{if(e.shape==="rotated_rect"||e.shape==="pill"||e.shape==="oval")return e.ccwRotation;return 0},ihn=(e,t)=>{if(e.shape==="circle")return[$le({x:e.x,y:e.y},e.radius+t)];if(e.shape==="pill")return[uhn({x:e.x,y:e.y},e.width+t*2,e.height+t*2,e.radius+t,e.ccwRotation)];if(e.shape==="oval"){let n=hhn({x:e.x,y:e.y},e.width,e.height,e.ccwRotation);return t>0?Kle(n,t,"Round"):[n]}if(e.shape==="rect")return[PZe(e.bounds.minX-t,e.bounds.minY-t,e.bounds.maxX+t,e.bounds.maxY+t)];if(e.shape==="polygon"){let n=QV(e.points,"generateThermalReliefClearances.polygonPad");return t>0?Kle(n,t,"Round"):[n]}return[dhn({x:e.x,y:e.y},e.width+t*2,e.height+t*2,e.ccwRotation)]},gvr=(e)=>e.shape==="circle"||e.shape==="oval"||e.shape==="pill"||e.shape==="polygon"||e.shape==="rect"||e.shape==="rotated_rect",Avr=(e,t,n,o=4)=>{if(!gvr(e)||t<=0)return[];if(typeof n!=="number"||!Number.isFinite(n)||n<=0)throw Error("thermal_relief_spoke_width must be greater than 0");if(!Number.isInteger(o)||o<1)throw Error("thermal_relief_spoke_count must be a positive integer");let r=ihn(e,0),i=ihn(e,t),s=mvr(e),a=Math.max(...i.flatMap((_)=>_).map((_)=>Math.hypot(_.x-s.x,_.y-s.y)))+n,c=_vr(e)*Math.PI/180,l=[];for(let _=0;_<o;_++){let p=c+_/o*Math.PI*2;l.push(EZe(s,{x:s.x+Math.cos(p)*a,y:s.y+Math.sin(p)*a},n))}let h=RV(i),d=RV([...r,...l]),u=chn(h,[d]);return lhn(u).map(({outerRing:_})=>_)},fvr=(e)=>e.shape==="rect",yvr=(e)=>e.shape==="rotated_rect",xvr=(e)=>e.shape==="trace",Cvr=(e)=>e.shape==="circle",bvr=(e)=>e.shape==="pill",Ivr=(e)=>e.shape==="oval",vvr=(e)=>e.shape==="polygon",phn=(e,t,n,o)=>{let r=[],{padMargin:i,traceMargin:s,board_edge_margin:a,cutoutMargin:c,use_thermal_reliefs:l,thermal_relief_spoke_width:h,thermal_relief_spoke_count:d}=n;if(o&&o.length>0&&a&&a>0){let _=QV(o,"processObstacles.boardOutline");for(let p=0;p<_.length;p++){let m=_[p===0?_.length-1:p-1],A=_[p],g=_[(p+1)%_.length];if(!m||!A||!g)continue;let f={x:A.x-m.x,y:A.y-m.y},y={x:g.x-A.x,y:g.y-A.y},x=f.x*y.y-f.y*y.x;if(r.push($le(A,a)),x<0)r.push(PZe(A.x-a,A.y-a,A.x+a,A.y+a))}for(let p=0;p<_.length;p++){let m=_[p],A=_[(p+1)%_.length];if(!m||!A)continue;let g=EZe(m,A,a*2);if(g.length>0)r.push(g)}}let u=r.length;for(let _ of e){if(_.connectivityKey===t){if((_.isPlatedHole||_.isSmtPad)&&l)r.push(...Avr(_,i,h,d));continue}let m=_.connectivityKey.startsWith("hole:")||_.connectivityKey.startsWith("cutout:"),A=_.connectivityKey.startsWith("keepout:"),g=(f)=>A?0:m?c??0:f;if(Cvr(_)){let f=g(i);r.push($le({x:_.x,y:_.y},_.radius+f));continue}if(bvr(_)){let f=g(i);r.push(uhn({x:_.x,y:_.y},_.width+f*2,_.height+f*2,_.radius+f,_.ccwRotation));continue}if(Ivr(_)){let f=g(i),y=hhn({x:_.x,y:_.y},_.width,_.height,_.ccwRotation);r.push(...f>0?Kle(y,f,"Round"):[y]);continue}if(fvr(_)){let f=g(i),{bounds:y}=_;r.push(PZe(y.minX-f,y.minY-f,y.maxX+f,y.maxY+f));continue}if(yvr(_)){let f=g(i);r.push(dhn({x:_.x,y:_.y},_.width+f*2,_.height+f*2,_.ccwRotation));continue}if(vvr(_)){let f=g(i),y=new Set,x=_.points.filter((b)=>{let I=`${b.x},${b.y}`;if(y.has(I))return!1;return y.add(I),!0});if(x.length<3)continue;let C=QV(x,"processObstacles.polygonPad");if(C.length<3)continue;if(f<=0){r.push(C);continue}r.push(...Kle(C,f));continue}if(_.shape==="tapered_trace"){let f=pvr(_);if(f.length>=3)r.push(...s>0?Kle(f,s):[f]);continue}if(xvr(_)){for(let f of _.segments)r.push($le(f,_.width/2+s));for(let f=0;f<_.segments.length-1;f++){let y=_.segments[f],x=_.segments[f+1];if(!y||!x)continue;let C=EZe(y,x,_.width+s*2);if(C.length>0)r.push(C)}}}return{polygonsToSubtract:r,obstaclePolygons:r.slice(u)}},mhn=(e,t,n)=>{let o=(e+t)*Math.SQRT1_2/fm,r=(t-e)*Math.SQRT1_2/fm;return`${Math.floor(o/n)},${Math.floor(r/n)}`},Svr=(e,t,n)=>{let o=new Map;for(let i of e.toPolygons()){let[s,a]=i[0],c=mhn(s,a,t),l=o.get(c)??[];l.push(i),o.set(c,l)}let r=[];for(let i of o.values()){let s=BQ().ofPolygons(i,"Positive"),a=s.decompose();try{for(let c of a){if(c.area()<n**2*fm**2)continue;let l=c.offset(-n/2*fm,"Round");try{if(!l.isEmpty())r.push(...c.toPolygons())}finally{l.delete()}}}finally{for(let c of a)c.delete();s.delete()}}return r.length>0?BQ().ofPolygons(r,"Positive"):BQ().square([0,0])},Pvr=({solidPour:e,hatchPitch:t=1,hatchWidth:n=0.25,padsForLayer:o,connectivityKey:r,obstaclePolygons:i,higherPriorityPourBlockers:s})=>{if(!Number.isFinite(t)||t<=0)throw Error("crosshatchPitch must be a finite positive distance in mm");if(!Number.isFinite(n)||n<=0||n>=t)throw Error("crosshatchWidth must be positive and less than crosshatchPitch");let a=(t-n)/2;if(e.isEmpty())return e;let c=e.toPolygons();return Fw("applyCrosshatch",c,()=>{let l=e.offset(-n*fm),{polygonsToSubtract:h}=phn(o.filter((A)=>A.connectivityKey===r),void 0,{padMargin:n,traceMargin:n}),d=RV(h),u=RV(i),_=wZe([u,...s]),p=_.offset(n*fm,"Round"),m=d.add(p);u.delete(),_.delete(),p.delete(),d.delete();try{if(l.isEmpty())return e;let A=1/0,g=-1/0,f=1/0,y=-1/0;for(let L of l.toPolygons())for(let[H,V]of L){let O=(H+V)*Math.SQRT1_2/fm,U=(V-H)*Math.SQRT1_2/fm;A=Math.min(A,O),g=Math.max(g,O),f=Math.min(f,U),y=Math.max(y,U)}let x=Math.floor(A/t),C=Math.floor(g/t),b=Math.floor(f/t),I=Math.floor(y/t);if(![x,C,b,I].every(Number.isSafeInteger)||(C-x+1)*(I-b+1)>1e6)throw Error("Crosshatch exceeds 1,000,000 candidate cells; increase crosshatchPitch or reduce the pour area");let v=[];for(let L=x;L<=C;L++)for(let H=b;H<=I;H++){let V=(L+0.5)*t,O=(H+0.5)*t;v.push({key:`${L},${H}`,ring:[[V-a,O-a],[V+a,O-a],[V+a,O+a],[V-a,O+a]].map(([U,j])=>({x:(U-j)*Math.SQRT1_2,y:(U+j)*Math.SQRT1_2}))})}let P=RV(v.map(({ring:L})=>L)),M=P.intersect(m);P.delete();let B=new Set;for(let L of M.toPolygons()){let[H,V]=L[0];B.add(mhn(H,V,t))}M.delete();let T=RV(v.filter(({key:L})=>!B.has(L)).map(({ring:L})=>L)),N=T.intersect(l);T.delete();let D=Svr(N,t,n);N.delete();try{return e.subtract(D)}finally{D.delete()}}finally{l.delete(),m.delete()}})},Evr=(e)=>{let t=e.board_edge_margin??0;if(e.outline&&e.outline.length>0)return QV(e.outline,"getBoardPolygon.outline");let{bounds:n}=e,o={minX:n.minX+t,minY:n.minY+t,maxX:n.maxX-t,maxY:n.maxY-t};if(o.minX>=o.maxX||o.minY>=o.maxY)return[];return[{x:o.minX,y:o.minY},{x:o.maxX,y:o.minY},{x:o.maxX,y:o.maxY},{x:o.minX,y:o.maxY}]},w6e=class extends XC{constructor(e){super(e);this.input=e}input;pipelineDef=[];getSolverName(){return"CopperPourPipelineSolver"}getOutput(){if(!avr())throw Error("Manifold geometry has not been initialized. Call initializeManifoldGeometry() before solving copper pours.");let e=this.input.regionsForPour.map(()=>[]),t=[];for(let n=this.input.regionsForPour.length-1;n>=0;n--){let o=this.input.regionsForPour[n],r=Evr(o),i=this.input.pads.filter((p)=>p.layer===o.layer),{polygonsToSubtract:s,obstaclePolygons:a}=phn(i,o.connectivityKey,{padMargin:o.padMargin,traceMargin:o.traceMargin,board_edge_margin:o.board_edge_margin,cutoutMargin:o.cutout_margin,use_thermal_reliefs:o.use_thermal_reliefs,thermal_relief_spoke_width:o.thermal_relief_spoke_width,thermal_relief_spoke_count:o.thermal_relief_spoke_count},o.boardEdgeOutline??o.outline),c=o.pourMargin??Math.max(o.padMargin,o.traceMargin),l=t.filter((p)=>p.layer===o.layer&&p.connectivityKey!==o.connectivityKey).map((p)=>hvr(p.section,Math.max(c,p.pourMargin))),h=dvr(r,s),d=uvr(chn(h,l)),u=o.crosshatch?Pvr({solidPour:d,hatchPitch:o.crosshatchPitch,hatchWidth:o.crosshatchWidth,padsForLayer:i,connectivityKey:o.connectivityKey,obstaclePolygons:a,higherPriorityPourBlockers:l}):d,_=lhn(u);e[n]=svr(_),t.push({layer:o.layer,connectivityKey:o.connectivityKey,pourMargin:c,section:d})}return{brep_shapes:e.flat(),brep_shapes_by_region:e}}},Mvr=(e)=>{let t=e.subcircuit_connectivity_map_key;return typeof t==="string"&&t.length>0?t:void 0},M6e=(e)=>{let t=e.subcircuit_id;return typeof t==="string"&&t.length>0?t:void 0},E6e=(e,t)=>e?`subcircuit:${e}:connectivity:${t}`:t,wvr=(e,t)=>{if(!t)return;let n={};for(let i of e){if(i.type!=="source_group")continue;let s=i.source_group_id,a=M6e(i);if(typeof s==="string"&&a)n[s]=a}let o=new Set([t]),r=!0;while(r){r=!1;for(let i of e){if(i.type!=="source_group")continue;let s=M6e(i);if(!s||o.has(s))continue;let{parent_subcircuit_id:a,parent_source_group_id:c}=i,l=typeof c==="string"?n[c]:void 0;if(typeof a==="string"&&o.has(a)||l&&o.has(l))o.add(s),r=!0}}return o},Bvr=(e,t,n)=>{let o=wvr(e,n),r={},i={},s={},a=new Set;for(let h of e){let d=tz(h),u=Mvr(h),_=M6e(h);if(d)i[d]=_;if(o&&(!_||!o.has(_)))continue;if(d&&u){let p=E6e(_,u);r[d]=p,a.add(u),s[p]??=[],s[p].push(d)}}let c={};for(let[h,d]of Object.entries(t.netMap)){let u=new Set(d.map((p)=>r[p]).filter((p)=>Boolean(p))),_=Array.from(u).sort()[0];if(_)c[h]=_}let l={};for(let[h,d]of Object.entries(s)){let u=new Set;for(let p of d){let m=t.getNetConnectedToId(p),A=m?c[m]:void 0;u.add(A??h)}if(u.size>1)throw Error(`subcircuit_connectivity_map_key "${h}" maps to multiple global connectivity keys: ${Array.from(u).join(", ")}`);let _=u.values().next().value;if(_)l[h]=_}return{knownSubcircuitConnectivityKeys:new Set([...Object.keys(s),...a]),descendantSubcircuitIds:o,getScopedSubcircuitConnectivityKey:E6e,getElementSubcircuitId:M6e,resolveSubcircuitConnectivityKey(h,d){let u=Object.keys(s).filter((p)=>p===E6e(d,h));if(d&&u.length===0&&o)u.push(...Object.keys(s).filter((p)=>p.endsWith(`:connectivity:${h}`)));if(!d)u.push(...Object.keys(s).filter((p)=>p.endsWith(`:connectivity:${h}`)));let _=Array.from(new Set(u));if(_.length===0){if(d&&o)throw Error(`No subcircuit_connectivity_map_key "${h}" found in subcircuit "${d}" or its child subcircuits.`);return E6e(d,h)}if(_.length>1)throw Error(`subcircuit_connectivity_map_key "${h}" exists in multiple subcircuits. Pass subcircuit_id to disambiguate.`);return l[_[0]]??_[0]},getSubcircuitConnectivityKeyForId(h){if(o){let _=i[h];if(!_||!o.has(_))return}let d=r[h],u=t.getNetConnectedToId(h);if(!u)return d?l[d]??d:void 0;return c[u]??(d?l[d]:void 0)??d}}},Tvr=(e,t,n)=>{if(t.subcircuit_connectivity_map_key)return n.resolveSubcircuitConnectivityKey(t.subcircuit_connectivity_map_key,t.subcircuit_id);if(t.source_net_id){let o=e.find((r)=>r.type==="source_net"&&r.source_net_id===t.source_net_id);if(!o)throw Error(`No source_net found with id "${t.source_net_id}"`);if(!o.subcircuit_connectivity_map_key)throw Error(`source_net "${t.source_net_id}" has no subcircuit_connectivity_map_key`);return n.resolveSubcircuitConnectivityKey(o.subcircuit_connectivity_map_key,o.subcircuit_id??t.subcircuit_id)}if(t.source_net_name){let o=e.find((r)=>r.type==="source_net"&&r.name===t.source_net_name&&(!t.subcircuit_id||Boolean(n.descendantSubcircuitIds?.has(r.subcircuit_id??""))));if(!o)throw Error(`No source_net found with name "${t.source_net_name}"`);if(!o.subcircuit_connectivity_map_key)throw Error(`source_net "${t.source_net_name}" has no subcircuit_connectivity_map_key`);return n.resolveSubcircuitConnectivityKey(o.subcircuit_connectivity_map_key,o.subcircuit_id??t.subcircuit_id)}if(t.pour_connectivity_key){if(!n.knownSubcircuitConnectivityKeys.has(t.pour_connectivity_key))throw Error("pour_connectivity_key must be a subcircuit_connectivity_map_key. Use subcircuit_connectivity_map_key, source_net_id, or source_net_name instead of a generated connectivity-map id.");return n.resolveSubcircuitConnectivityKey(t.pour_connectivity_key,t.subcircuit_id)}throw Error("Copper pour requires source_net_id, source_net_name, or subcircuit_connectivity_map_key")},BZe=(e,t)=>{if(Array.isArray(t)){if(t.length===0)return{pads:[],regionsForPour:[]};let m=t[0].subcircuit_id;if(t.some((f)=>f.subcircuit_id!==m))throw Error("All copper pours in one input problem must use the same subcircuit_id");let A=t.map((f)=>BZe(e,f)),g=new Map;for(let f of A)for(let y of f.pads)g.set(`${y.layer}:${y.padId}`,y);return{pads:[...g.values()],regionsForPour:A.flatMap((f)=>f.regionsForPour)}}let n=t,o=e.find((m)=>m.type==="pcb_board");if(!o)throw Error("No pcb_board found in circuit json");let r=oa(e),i=Bvr(e,r,n.subcircuit_id),s=Tvr(e,n,i),{getSubcircuitConnectivityKeyForId:a}=i,c=[];for(let m of e)if(m.type==="pcb_smtpad"){let A=m;if(A.layer!==n.layer)continue;let g;if(g=a(A.pcb_smtpad_id),!g)g=`unconnected:${A.pcb_smtpad_id}`;if(A.shape==="rect")c.push({shape:"rect",padId:A.pcb_smtpad_id,layer:A.layer,connectivityKey:g,isSmtPad:!0,bounds:{minX:A.x-A.width/2,minY:A.y-A.height/2,maxX:A.x+A.width/2,maxY:A.y+A.height/2}});else if(A.shape==="rotated_rect")c.push({shape:"rotated_rect",padId:A.pcb_smtpad_id,layer:A.layer,connectivityKey:g,isSmtPad:!0,x:A.x,y:A.y,width:A.width,height:A.height,ccwRotation:A.ccw_rotation});else if(A.shape==="circle")c.push({shape:"circle",padId:A.pcb_smtpad_id,layer:A.layer,connectivityKey:g,isSmtPad:!0,x:A.x,y:A.y,radius:A.radius});else if(A.shape==="pill"||A.shape==="rotated_pill")c.push({shape:"pill",padId:A.pcb_smtpad_id,layer:A.layer,connectivityKey:g,isSmtPad:!0,x:A.x,y:A.y,width:A.width,height:A.height,radius:A.radius,ccwRotation:A.shape==="rotated_pill"?A.ccw_rotation:0});else if(A.shape==="polygon")c.push({shape:"polygon",padId:A.pcb_smtpad_id,layer:A.layer,connectivityKey:g,isSmtPad:!0,points:A.points})}else if(m.type==="pcb_plated_hole"){let A=m;if(!A.layers.includes(n.layer))continue;let g=a(A.pcb_plated_hole_id);if(!g)g=`unconnected-plated-hole:${A.pcb_plated_hole_id}`;if(A.shape==="hole_with_polygon_pad"){let f=(A.ccw_rotation??0)*Math.PI/180,y=Math.cos(f),x=Math.sin(f);c.push({shape:"polygon",padId:A.pcb_plated_hole_id,layer:n.layer,connectivityKey:g,isPlatedHole:!0,points:A.pad_outline.map((C)=>({x:A.x+C.x*y-C.y*x,y:A.y+C.x*x+C.y*y}))})}else if(A.shape==="circle")c.push({shape:"circle",padId:A.pcb_plated_hole_id,layer:n.layer,connectivityKey:g,isPlatedHole:!0,x:A.x,y:A.y,radius:A.outer_diameter/2});else if(A.shape==="pill")c.push({shape:"pill",padId:A.pcb_plated_hole_id,layer:n.layer,connectivityKey:g,isPlatedHole:!0,x:A.x,y:A.y,width:A.outer_width,height:A.outer_height,radius:Math.min(A.outer_width,A.outer_height)/2,ccwRotation:A.ccw_rotation});else if(A.shape==="oval")c.push({shape:"oval",padId:A.pcb_plated_hole_id,layer:n.layer,connectivityKey:g,isPlatedHole:!0,x:A.x,y:A.y,width:A.outer_width,height:A.outer_height,ccwRotation:A.ccw_rotation});else if(A.shape==="circular_hole_with_rect_pad"||A.shape==="pill_hole_with_rect_pad"||A.shape==="rotated_pill_hole_with_rect_pad"){let{rect_pad_width:f,rect_pad_height:y}=A;if(typeof f!=="number"||typeof y!=="number")continue;let x=A.shape==="pill_hole_with_rect_pad"?0:A.rect_ccw_rotation??0;if(x===0)c.push({shape:"rect",padId:A.pcb_plated_hole_id,layer:n.layer,connectivityKey:g,isPlatedHole:!0,bounds:{minX:A.x-f/2,minY:A.y-y/2,maxX:A.x+f/2,maxY:A.y+y/2}});else c.push({shape:"rotated_rect",padId:A.pcb_plated_hole_id,layer:n.layer,connectivityKey:g,isPlatedHole:!0,x:A.x,y:A.y,width:f,height:y,ccwRotation:x})}}else if(m.type==="pcb_hole"){let A=m;if(A.hole_shape==="rect"){c.push({shape:"rect",padId:A.pcb_hole_id,layer:n.layer,connectivityKey:`hole:${A.pcb_hole_id}`,bounds:{minX:A.x-A.hole_width/2,minY:A.y-A.hole_height/2,maxX:A.x+A.hole_width/2,maxY:A.y+A.hole_height/2}});continue}if(A.hole_shape==="pill"||A.hole_shape==="rotated_pill"){let g=0;if(A.hole_shape==="rotated_pill")g=A.ccw_rotation;c.push({shape:"pill",padId:A.pcb_hole_id,layer:n.layer,connectivityKey:`hole:${A.pcb_hole_id}`,x:A.x,y:A.y,width:A.hole_width,height:A.hole_height,radius:Math.min(A.hole_width,A.hole_height)/2,ccwRotation:g});continue}if(A.hole_shape==="oval"){c.push({shape:"oval",padId:A.pcb_hole_id,layer:n.layer,connectivityKey:`hole:${A.pcb_hole_id}`,x:A.x,y:A.y,width:A.hole_width,height:A.hole_height,ccwRotation:0});continue}if(A.hole_shape!=="circle")continue;c.push({shape:"circle",padId:A.pcb_hole_id,layer:n.layer,connectivityKey:`hole:${A.pcb_hole_id}`,x:A.x,y:A.y,radius:A.hole_diameter/2})}else if(m.type==="pcb_cutout"){let A=m;if(A.shape==="rect")c.push({shape:"rect",padId:A.pcb_cutout_id,layer:n.layer,connectivityKey:`cutout:${A.pcb_cutout_id}`,bounds:{minX:A.center.x-A.width/2,minY:A.center.y-A.height/2,maxX:A.center.x+A.width/2,maxY:A.center.y+A.height/2}});else if(A.shape==="circle")c.push({shape:"circle",padId:A.pcb_cutout_id,layer:n.layer,connectivityKey:`cutout:${A.pcb_cutout_id}`,x:A.center.x,y:A.center.y,radius:A.radius});else if(A.shape==="polygon")c.push({shape:"polygon",padId:A.pcb_cutout_id,layer:n.layer,connectivityKey:`cutout:${A.pcb_cutout_id}`,points:A.points})}else if(m.type==="pcb_keepout"){let A=m;if(!A.layers.includes(n.layer))continue;if(A.shape==="rect")c.push({shape:"rect",padId:A.pcb_keepout_id,layer:n.layer,connectivityKey:`keepout:${A.pcb_keepout_id}`,bounds:{minX:A.center.x-A.width/2,minY:A.center.y-A.height/2,maxX:A.center.x+A.width/2,maxY:A.center.y+A.height/2}});else if(A.shape==="circle")c.push({shape:"circle",padId:A.pcb_keepout_id,layer:n.layer,connectivityKey:`keepout:${A.pcb_keepout_id}`,x:A.center.x,y:A.center.y,radius:A.radius})}else if(m.type==="pcb_via"){let A=m;if(!A.layers.includes(n.layer))continue;let g=a(A.pcb_via_id)??`unconnected-via:${A.pcb_via_id}`;c.push({shape:"circle",padId:A.pcb_via_id,layer:n.layer,connectivityKey:g,x:A.x,y:A.y,radius:A.outer_diameter/2})}else if(m.type==="pcb_trace"){let A=m,g=a(A.pcb_trace_id);if(!g)continue;let f=[],y=null,x=()=>{if(f.length>1)c.push({shape:"trace",padId:`${A.pcb_trace_id}-${c.length}`,layer:n.layer,connectivityKey:g,segments:f,width:y});f=[],y=null};for(let[C,b]of A.route.entries()){let I=A.route[C+1];if(b.route_type==="wire"&&b.layer===n.layer&&b.width_interpolation_mode&&b.start_width!==void 0&&b.end_width!==void 0&&I){let P=I.route_type==="through_pad"?I.start:I;if((I.route_type==="via"?I.from_layer:I.route_type==="through_pad"?I.start_layer:I.layer)===b.layer&&Math.hypot(P.x-b.x,P.y-b.y)>0){f.push({x:b.x,y:b.y}),x(),c.push({shape:"tapered_trace",padId:`${A.pcb_trace_id}-${c.length}`,layer:n.layer,connectivityKey:g,start:{x:b.x,y:b.y},end:{x:P.x,y:P.y},start_width:b.start_width,end_width:b.end_width,width_interpolation_mode:b.width_interpolation_mode});continue}}if(b.route_type==="wire"&&b.layer===n.layer){let P={x:b.x,y:b.y};if(y===null)y=b.width;else if(b.width!==y)f.push(P),x(),y=b.width;f.push(P)}else x()}x()}let{width:l,height:h,center:d}=o,u=n.outline??o.outline,_;if(u&&u.length>0){let m=u.map((g)=>g.x),A=u.map((g)=>g.y);_={minX:Math.min(...m),minY:Math.min(...A),maxX:Math.max(...m),maxY:Math.max(...A)}}else _={minX:d.x-l/2,minY:d.y-h/2,maxX:d.x+l/2,maxY:d.y+h/2};let p=[{shape:"rect",layer:n.layer,bounds:_,boardEdgeOutline:n.board_edge_outline,outline:u,connectivityKey:s,crosshatch:n.crosshatch,crosshatchPitch:n.crosshatchPitch,crosshatchWidth:n.crosshatchWidth,padMargin:n.pad_margin,traceMargin:n.trace_margin,pourMargin:n.pour_margin??Math.max(n.pad_margin,n.trace_margin),board_edge_margin:n.board_edge_margin??0,cutout_margin:n.cutout_margin,use_thermal_reliefs:n.use_thermal_reliefs,thermal_relief_spoke_width:n.thermal_relief_spoke_width,thermal_relief_spoke_count:n.thermal_relief_spoke_count}];return{pads:c,regionsForPour:p}};Y0();Y0();Y0();var Ahn=["x_pos","x_neg","y_pos","y_neg","z_pos","z_neg"],Dvr=(e)=>typeof e==="string"&&Ahn.includes(e),Nvr=(e,t="face")=>{if(!Dvr(e))throw Error(`${t} must be one of ${Ahn.join(", ")}, got ${JSON.stringify(e)}. The named directions (front/back/left/right/top/bottom) were retired: faces are named for the axis their outward normal points along, so the old \`top\` (+Z) is \`z_pos\` and the old \`front\` (+Y) is \`y_pos\`.`);return e},zw=(e)=>e.slice(0,1),Gq=(e)=>e.endsWith("_pos")?1:-1,fhn=(e)=>{let t=zw(e);if(t==="x")return["y","z"];if(t==="y")return["x","z"];return["x","y"]},Cb=(e)=>zw(e)==="z",yhn=(e)=>e==="x"?0:e==="y"?1:2,T6e=(e,t)=>[e.width,e.height,e.depth][yhn(t)],Rvr=(e,t,n,o)=>{let r=n*Math.PI/180,i=Math.abs(Math.cos(r)),s=Math.abs(Math.sin(r));return o==="x"?e*i+t*s:e*s+t*i},Qvr=({body:e,face:t})=>{if(!e)return;if(Cb(t))return e.aboveBoardHeight??e.size?.z;let n=zw(t)==="y"?"y":"x",o=e.footprint&&(n==="y"?e.footprint.height:e.footprint.width);if(!e.size)return o;let r=Rvr(e.size.x,e.size.y,e.rotation??0,n);return o===void 0?r:Math.max(r,o)},kvr=(e)=>e?.aboveBoardHeight,Lvr=(e)=>({type:"cuboid",size:e}),Hvr=(e,t)=>({type:"cylinder",radius:e,height:t,resolution:32}),TZe=(e,t)=>({type:"translate",vector:e,shape:t}),Fvr={x:[Math.PI/2,0,Math.PI/2],y:[Math.PI/2,0,0]},zvr=(e,t)=>{let n=zw(e);if(n==="z")return t;return{type:"rotate",angles:Fvr[n],shape:t}},xhn=({width:e,height:t,cutDepth:n})=>Lvr([e,t,n]),DZe=({diameter:e,cutDepth:t})=>Hvr(e/2,t),Ovr=({width:e,height:t,cutDepth:n})=>{if(Math.abs(e-t)<Number.EPSILON)return DZe({diameter:e,cutDepth:n});let o=e>t,r=Math.min(e,t)/2,i=Math.abs(e-t),s=xhn({width:o?i:e,height:o?t:i,cutDepth:n}),a=DZe({diameter:r*2,cutDepth:n}),c=(l)=>o?[l,0,0]:[0,l,0];return{type:"union",shapes:[s,TZe(c(-i/2),a),TZe(c(i/2),a)]}},Vvr=({placement:e,faceThickness:t,booleanTolerance:n})=>{let{aperture:o,face:r,center:i,width:s,height:a,inwardProjection:c}=e,h=(e.incidenceDegrees??0)*Math.PI/180,d=Math.abs(Math.cos(h)),u=Math.abs(Math.tan(h)),_=(t+n*2)/d+s*u+c,p;switch(o.shape){case"rect":p=xhn({width:s,height:a,cutDepth:_});break;case"circle":p=DZe({diameter:s,cutDepth:_});break;case"pill":p=Ovr({width:s,height:a,cutDepth:_});break}let m=e.rotation===0?p:{type:"rotate",angles:[0,0,e.rotation*Math.PI/180],shape:p},A=zw(r),g=Gq(r),f=[i.x,i.y,i.z];if(A==="z")f[yhn(A)]-=g*c/2;else{let C=A==="x"?g:0,b=A==="y"?g:0,I=Math.cos(h),v=Math.sin(h),P=C*I-b*v,M=C*v+b*I;f[0]-=P*c/2,f[1]-=M*c/2}let y=zvr(r,m),x=e.incidenceDegrees===void 0||e.incidenceDegrees===0?y:{type:"rotate",angles:[0,0,e.incidenceDegrees*Math.PI/180],shape:y};return{aperture:o,width:s,height:a,cutDepth:_,jscadPlan:TZe(f,x)}},QZe=(e)=>{let t=e.margin??0;if(e.shape==="circle"){let n=2*(e.radius+t);return{width:n,height:n}}return{width:e.width+t*2,height:e.height+t*2}},Chn=(e)=>{let t=kvr(e.componentBody);if(t!==void 0)return t/2;return QZe(e).height/2},Vq=(e,t)=>{if(!Number.isFinite(e))throw Error(`${t} must be finite, but is ${e}`)},gS=(e,t)=>{if(Vq(e,t),e<=0)throw Error(`${t} must be greater than 0, but is ${Yc(e)}`)},Yq=(e,t)=>{if(Vq(e,t),e<0)throw Error(`${t} must not be negative, but is ${Yc(e)}`)},Yvr=(e,t)=>{let n=`apertures[${t}]`;if(Nvr(e.face,`${n}.face`),Vq(e.center.x,`${n}.center.x`),Vq(e.center.y,`${n}.center.y`),Yq(e.margin??0,`${n}.margin`),e.shape==="circle")gS(e.radius,`${n}.radius`);else gS(e.width,`${n}.width`),gS(e.height,`${n}.height`);if(e.depth!==void 0)Yq(e.depth,`${n}.depth`);if(e.widthDimensionOffset!==void 0)Vq(e.widthDimensionOffset,`${n}.widthDimensionOffset`);if(e.heightDimensionOffset!==void 0)Vq(e.heightDimensionOffset,`${n}.heightDimensionOffset`)},bhn=({floorThickness:e,standoffHeight:t,boardThickness:n})=>{let o=e,r=o+t;return{floorTopZ:o,boardBottomZ:r,boardTopZ:r+n}},Gvr=({seamOffsetFromTop:e,totalHeight:t,...n})=>({...bhn(n),seamZ:t-e,totalHeight:t}),B6e=["y_pos","x_pos","y_neg","x_neg"],NZe=5,RZe=(e,t)=>T6e(t,fhn(e)[0]),Uvr=(e)=>{let t=new Map,o=-B6e.reduce((r,i)=>r+RZe(i,e),NZe*(B6e.length-1))/2;for(let r of B6e){let i=RZe(r,e);t.set(r,o+i/2),o+=i+NZe}return t},_hn=(e,t)=>{let n=e.get(t);if(n===void 0)throw Error(`Missing ${t} wall panel`);return n},Wvr=({graphics:e,placement:t,panelCenterX:n,planViewY:o,isProcessed:r})=>{let{aperture:i,width:s,height:a}=t,c=t.face==="y_pos"||t.face==="y_neg"?t.center.x:t.center.y,l=t.face==="y_pos"||t.face==="x_neg"?-1:1,h=Cb(t.face)?{x:t.center.x,y:o+t.center.y}:{x:n+l*c,y:t.center.z},d=r?"rgba(239, 68, 68, 0.4)":"rgba(148, 163, 184, 0.12)",u=r?"#dc2626":"#94a3b8",p=`${Cb(t.face)?`${t.face} `:""}${i.shape} ${s.toFixed(1)}×${a.toFixed(1)}`;if(i.shape==="rect"){e.rects?.push({center:h,width:s,height:a,fill:d,stroke:u,label:p});return}if(i.shape==="circle"){e.circles?.push({center:h,radius:s/2,fill:d,stroke:u,label:p});return}let m=s>=a,A=Math.min(s,a)/2,g=Math.abs(s-a);e.rects?.push({center:h,width:m?g:s,height:m?a:g,fill:d,stroke:u,label:p}),e.circles?.push({center:{x:h.x+(m?-g/2:0),y:h.y+(m?0:-g/2)},radius:A,fill:d,stroke:u},{center:{x:h.x+(m?g/2:0),y:h.y+(m?0:g/2)},radius:A,fill:d,stroke:u})},ehe=({title:e,resolved:t,processedApertureCount:n=0})=>{let{board:o,dimensions:r}=t,i={title:e,coordinateSystem:"cartesian",rects:[],circles:[],lines:[],points:[],texts:[]},s=Uvr(r),a=-r.height/2-NZe;for(let c of B6e){let l=_hn(s,c);i.rects?.push({center:{x:l,y:r.depth/2},width:RZe(c,r),height:r.depth,fill:"rgba(59, 130, 246, 0.08)",stroke:"#2563eb",label:c}),i.texts?.push({x:l,y:r.depth+1.5,text:c,anchorSide:"bottom_center",color:"#1e3a8a",fontSize:1.5})}for(let[c,l]of t.apertures.entries())Wvr({graphics:i,placement:l,panelCenterX:Cb(l.face)?0:_hn(s,l.face),planViewY:a,isProcessed:c<n});return i.rects?.push({center:{x:0,y:a},width:r.width,height:r.height,fill:"rgba(59, 130, 246, 0.05)",stroke:"#1d4ed8",label:"enclosure top view"},{center:{x:0,y:a},width:o.width,height:o.height,fill:"rgba(34, 197, 94, 0.18)",stroke:"#15803d",label:"board"}),i},Xvr=class extends co{constructor(e){super();this.params=e}params;enclosurePlans;_step(){let e=this.params.apertureCutouts.map((r)=>r.jscadPlan),t=(r)=>e.length===0?r:{type:"subtract",shapes:[r,...e]},n=t(this.params.shellPlans.basePlan),o=t(this.params.shellPlans.lidPlan);this.enclosurePlans={parts:[{id:"base",jscadPlan:n},{id:"lid",jscadPlan:o}],assembledPlan:{type:"union",shapes:[n,o]}},this.solved=!0}getOutput(){if(!this.enclosurePlans)throw Error("Enclosure plan has not been composed");return this.enclosurePlans}getConstructorParams(){return[this.params]}visualize(){return ehe({title:"Composed enclosure",resolved:this.params.resolved,processedApertureCount:this.params.apertureCutouts.length})}},jvr=(e,t)=>{if(e==="z_pos")return t.lidThickness;if(e==="z_neg")return t.floorThickness;return t.wallThickness},Kvr=class extends co{constructor(e){super();this.params=e,this.MAX_ITERATIONS=e.resolved.apertures.length+1}params;apertureCutouts=[];_step(){let e=this.params.resolved.apertures,t=e[this.apertureCutouts.length];if(!t){this.solved=!0;return}if(this.apertureCutouts.push(Vvr({placement:t,faceThickness:jvr(t.face,this.params.resolved.dimensions),booleanTolerance:this.params.resolved.rules.booleanTolerance})),this.apertureCutouts.length===e.length)this.solved=!0}computeProgress(){let e=this.params.resolved.apertures.length;if(e===0)return this.solved?1:0;return this.apertureCutouts.length/e}getOutput(){return this.apertureCutouts}getConstructorParams(){return[this.params]}visualize(){return ehe({title:`Aperture cutouts (${this.apertureCutouts.length}/${this.params.resolved.apertures.length})`,resolved:this.params.resolved,processedApertureCount:this.apertureCutouts.length})}},$vr=class extends co{constructor(e){super();this.params=e}params;shellPlans;_step(){let{dimensions:e,rules:t,frame:n}=this.params.resolved,{width:o,height:r,wallThickness:i,floorThickness:s,lidThickness:a,lidLipDepth:c}=e,l=o-2*i,h=r-2*i,d=n.seamZ,u=d-s+t.booleanTolerance*2,_={type:"subtract",shapes:[{type:"translate",vector:[0,0,d/2],shape:{type:"cuboid",size:[o,r,d]}},{type:"translate",vector:[0,0,s+u/2],shape:{type:"cuboid",size:[l,h,u]}}]},p={type:"translate",vector:[0,0,n.seamZ+a/2],shape:{type:"cuboid",size:[o,r,a]}},m=c,A=p;if(m>0){let g=l-t.slidingFitClearance,f=h-t.slidingFitClearance,y=Math.min(i*t.lipWallThicknessRatio,t.lipWallThicknessMax),x=g-2*y,C=f-2*y,b={type:"subtract",shapes:[{type:"translate",vector:[0,0,n.seamZ-m/2],shape:{type:"cuboid",size:[g,f,m]}},{type:"translate",vector:[0,0,n.seamZ-m/2],shape:{type:"cuboid",size:[x,C,m+t.booleanTolerance*2]}}]};A={type:"union",shapes:[p,b]}}this.shellPlans={basePlan:_,lidPlan:A},this.solved=!0}getOutput(){if(!this.shellPlans)throw Error("Enclosure shell has not been created");return this.shellPlans}getConstructorParams(){return[this.params]}visualize(){return ehe({title:"Base and lid blanks",resolved:this.params.resolved})}},qvr=({axis:e,offset:t,extent:n,dimensions:o,face:r,prefix:i})=>{let s=T6e(o,e)/2,a=n/2,c=t-a,l=t+a,h=`the opening spans ${Yc(c)} to ${Yc(l)} but the enclosure only spans ${Yc(-s)} to ${Yc(s)}`;if(Math.abs(t)-a>s)throw Error(`${i} misses the ${r} face along ${e.toUpperCase()}: ${h}`);if(a-Math.abs(t)>s)throw Error(`${i} engulfs the ${r} face along ${e.toUpperCase()}: ${h}`)},Jvr=({centerZ:e,extent:t,dimensions:n,prefix:o})=>{let r=e-t/2;if(r<n.floorThickness)throw Error(`${o} intersects the enclosure floor: its lowest edge is at ${Yc(r)} but the floor top is at ${Yc(n.floorThickness)}. Raise heightDimensionOffset, or reduce the opening height.`);if(r>n.depth)throw Error(`${o} sits entirely above the enclosure: its lowest edge is at ${Yc(r)} but the enclosure is only ${Yc(n.depth)} tall`)},Zvr=({face:e,center:t,width:n,height:o,dimensions:r,prefix:i})=>{let s=fhn(e),a=[n,o];s.forEach((c,l)=>{let h=a[l];if(c==="z"){Jvr({centerZ:t.z,extent:h,dimensions:r,prefix:i});return}qvr({axis:c,offset:c==="x"?t.x:t.y,extent:h,dimensions:r,face:e,prefix:i})})},e8r={wallThickness:2,boardClearance:1,lidThickness:2,standoffHeight:4,topHeadroom:6,lidLipDepth:4,booleanTolerance:0.5,slidingFitClearance:0.3,lipWallThicknessRatio:0.7,lipWallThicknessMax:1.5},t8r=({face:e,boardSide:t="top",componentBody:n,frame:o})=>{let r=Qvr({body:n,face:e});if(r===void 0)return;if(!Cb(e))return r;let i=t==="bottom"?o.boardBottomZ:o.boardTopZ,s=e==="z_pos"?o.seamZ:o.floorTopZ;return Math.max(0,Math.abs(s-i))},n8r=({face:e,depth:t=0,dimensions:n,rules:o})=>{if(Cb(e)){if(e==="z_neg")return t;return Math.max(t,n.lidLipDepth)}let r=Math.min(n.wallThickness*o.lipWallThicknessRatio,o.lipWallThicknessMax),i=o.slidingFitClearance/2+r+o.booleanTolerance;return Math.max(t,i)},o8r=["x_pos","x_neg","y_pos","y_neg"],r8r=({face:e,origin:t,apertureAxisDirection:n,dimensions:o})=>{if(Cb(e)||!n)return e;let r=Math.hypot(n.x,n.y);if(!Number.isFinite(r)||r===0)return e;let i={x:n.x/r,y:n.y/r},s=o8r.flatMap((a)=>{let c=zw(a),l=Gq(a);if(i[c]*l<=0)return[];let u=(l*(T6e(o,c)/2-o.wallThickness)-t[c])/i[c];return Number.isFinite(u)&&u>=0?[{face:a,distance:u}]:[]});if(s.length===0)return e;return s.sort((a,c)=>{let l=a.distance-c.distance;if(Math.abs(l)>0.000000001)return l;if(a.face===e)return-1;if(c.face===e)return 1;return 0}),s[0].face},i8r=({face:e,apertureAxisDirection:t})=>{if(Cb(e)||!t)return 0;let n=zw(e),o=Gq(e),r={x:n==="x"?o:0,y:n==="y"?o:0},i=Math.hypot(t.x,t.y);if(!Number.isFinite(i)||i===0)throw Error(`apertureAxisDirection must have a finite, non-zero XY projection for side face ${e}`);let s={x:t.x/i,y:t.y/i},a=r.x*s.y-r.y*s.x,c=r.x*s.x+r.y*s.y;return Math.atan2(a,c)*180/Math.PI},s8r=({face:e,incidenceDegrees:t,distanceToWall:n})=>{if(Cb(e))return 0;let o=n*Math.tan(t*Math.PI/180),r=zw(e),i=Gq(e),s=r==="x"?i:-i;return o*s},Ihn=({boardSide:e,heightDatum:t,heightDimensionOffset:n,boardTopZ:o,boardBottomZ:r})=>{let i=t+n;return e==="bottom"?r-i:o+i},a8r=({face:e,boardCenter:t,centerZ:n,widthDimensionOffset:o,heightDimensionOffset:r,rotation:i,incidenceDegrees:s=0,dimensions:a,frame:c})=>{let l=zw(e);if(l==="z"){let u=i*Math.PI/180,_=Math.cos(u),p=Math.sin(u);return{x:t.x+o*_-r*p,y:t.y+o*p+r*_,z:e==="z_pos"?c.seamZ+a.lidThickness/2:a.floorThickness/2}}let h=Gq(e)*(T6e(a,l)/2-a.wallThickness/2),d=s8r({face:e,incidenceDegrees:s,distanceToWall:(h-t[l==="x"?"x":"y"])*Gq(e)});return l==="x"?{x:h,y:t.y+o+d,z:n}:{x:t.x+o+d,y:h,z:n}},c8r=({apertures:e,floorThickness:t,standoffHeight:n,boardThickness:o,lidThickness:r,lidLipDepth:i})=>{let{boardTopZ:s,boardBottomZ:a}=bhn({floorThickness:t,standoffHeight:n,boardThickness:o}),c=0;for(let l of e){if(Cb(l.face))continue;let d=Ihn({boardSide:l.boardSide??"top",heightDatum:Chn(l),heightDimensionOffset:l.heightDimensionOffset??0,boardTopZ:s,boardBottomZ:a})+QZe(l).height/2+i;c=Math.max(c,d+r)}return c},ghn=["width","height","depth"],l8r=({board:e,wallThickness:t,boardClearance:n,floorThickness:o,standoffHeight:r,topHeadroom:i,lidThickness:s})=>{let a=t+n,c=(l)=>`to fit the ${Yc(l)} board inside ${Yc(t)} walls with ${Yc(n)} clearance on each side`;return{width:{value:e.width+2*a,because:c(e.width)},height:{value:e.height+2*a,because:c(e.height)},depth:{value:o+r+e.thickness+i+s,because:`to stack ${Yc(o)} floor + ${Yc(r)} standoffs + ${Yc(e.thickness)} board + ${Yc(i)} headroom + ${Yc(s)} lid`}}},h8r=({input:e,rules:t})=>{gS(e.board.width,"board.width"),gS(e.board.height,"board.height"),gS(e.board.thickness,"board.thickness");let n=e.wallThickness??t.wallThickness,o=e.floorThickness??n,r=e.lidThickness??t.lidThickness,i=e.boardClearance??t.boardClearance,s=e.standoffHeight??t.standoffHeight,a=e.topHeadroom??t.topHeadroom,c=e.lidLipDepth??t.lidLipDepth;gS(n,"wallThickness"),gS(o,"floorThickness"),gS(r,"lidThickness"),Yq(i,"boardClearance"),Yq(s,"standoffHeight"),Yq(a,"topHeadroom"),Yq(c,"lidLipDepth");let l=l8r({board:e.board,wallThickness:n,boardClearance:i,floorThickness:o,standoffHeight:s,topHeadroom:a,lidThickness:r}),h=e.topHeadroom===void 0?Math.max(l.depth.value,c8r({apertures:e.apertures??[],floorThickness:o,standoffHeight:s,boardThickness:e.board.thickness,lidThickness:r,lidLipDepth:c})):l.depth.value,d={width:e.width??l.width.value,height:e.height??l.height.value,depth:e.depth??h,wallThickness:n,floorThickness:o,lidThickness:r,boardClearance:i,standoffHeight:s,topHeadroom:a,lidLipDepth:c};for(let u of ghn)gS(d[u],u);for(let u of ghn){let{value:_,because:p}=l[u];if(d[u]<_)throw Error(`${u} must be at least ${Yc(_)} ${p}, but is ${Yc(d[u])}`)}return d},d8r=({board:e,dimensions:t})=>Gvr({floorThickness:t.floorThickness,standoffHeight:t.standoffHeight,boardThickness:e.thickness,seamOffsetFromTop:t.lidThickness,totalHeight:t.depth}),u8r=(e)=>{let t={...e8r,...e.fdmRules},n=e.apertures??[];for(let[s,a]of n.entries())Yvr(a,s);let o=h8r({input:e,rules:t}),r=d8r({board:e.board,dimensions:o});o.lidLipDepth=Math.min(o.lidLipDepth,Math.max(0,r.seamZ-o.floorThickness));let i=n.map((s,a)=>{let c=r8r({face:s.face,origin:s.center,apertureAxisDirection:s.apertureAxisDirection,dimensions:o}),l=`apertures[${a}]`,{width:h,height:d}=QZe(s),u=i8r({face:c,apertureAxisDirection:s.apertureAxisDirection}),_=s.widthDimensionOffset??0,p=s.heightDimensionOffset??0,m=Cb(c)?s.rotation??0:0,A=a8r({face:c,boardCenter:s.center,widthDimensionOffset:_,heightDimensionOffset:p,rotation:m,incidenceDegrees:u,centerZ:Ihn({boardSide:s.boardSide??"top",heightDatum:Chn(s),heightDimensionOffset:p,boardTopZ:r.boardTopZ,boardBottomZ:r.boardBottomZ}),dimensions:o,frame:r}),g=Cb(c)?h:h/Math.abs(Math.cos(u*Math.PI/180));Zvr({face:c,center:A,width:g,height:d,dimensions:o,prefix:l});let f=s.depth??t8r({face:c,boardSide:s.boardSide,componentBody:s.componentBody,frame:r})??0;return{aperture:s,face:c,center:A,width:h,height:d,rotation:m,incidenceDegrees:u,inwardProjection:n8r({face:c,depth:f,dimensions:o,rules:t})}});return{construction:"fdm_box",board:e.board,apertures:i,dimensions:o,rules:t,frame:r}},p8r=class extends co{constructor(e){super();this.input=e}input;resolved;_step(){this.resolved=u8r(this.input),this.solved=!0}getOutput(){if(!this.resolved)throw Error("FDM enclosure problem is not resolved");return this.resolved}getConstructorParams(){return[this.input]}visualize(){if(!this.resolved)return super.visualize();return ehe({title:"Resolved FDM enclosure problem",resolved:this.resolved})}},Zle=(e,t)=>{if(!e)throw Error(`${t} has not completed`);return e},D6e=class extends XC{resolveFdmEnclosureProblemSolver;createFdmEnclosureShellSolver;createFdmApertureCutoutsSolver;composeFdmEnclosureSolver;getResolvedProblem(){return Zle(this.resolveFdmEnclosureProblemSolver,"resolveFdmEnclosureProblemSolver").getOutput()}pipelineDef=[xi("resolveFdmEnclosureProblemSolver",p8r,(e)=>[e.inputProblem]),xi("createFdmEnclosureShellSolver",$vr,(e)=>[{resolved:e.getResolvedProblem()}]),xi("createFdmApertureCutoutsSolver",Kvr,(e)=>[{resolved:e.getResolvedProblem()}]),xi("composeFdmEnclosureSolver",Xvr,(e)=>[{resolved:e.getResolvedProblem(),shellPlans:Zle(e.createFdmEnclosureShellSolver,"createFdmEnclosureShellSolver").getOutput(),apertureCutouts:Zle(e.createFdmApertureCutoutsSolver,"createFdmApertureCutoutsSolver").getOutput()}])];getConstructorParams(){return[this.inputProblem]}getOutput(){if(!this.solved)throw Error("FDM enclosure solver has not completed");let e=this.getResolvedProblem(),t=Zle(this.composeFdmEnclosureSolver,"composeFdmEnclosureSolver").getOutput();return{dimensions:e.dimensions,frame:e.frame,parts:t.parts,apertures:Zle(this.createFdmApertureCutoutsSolver,"createFdmApertureCutoutsSolver").getOutput(),jscadPlan:t.assembledPlan}}initialVisualize(){return null}finalVisualize(){let e=this.getResolvedProblem();return ehe({title:"Final FDM enclosure",resolved:e,processedApertureCount:e.apertures.length})}};var Wk=Qe(wt(),1);Ko();var n3=Qe(wt(),1);tc();var Xk=Qe(wt(),1);fp();Ko();var TQ=(e,t,n={x:0,y:0})=>{let o=Math.cos(t),r=Math.sin(t),i=e.x-n.x,s=e.y-n.y;return{x:n.x+i*o-s*r,y:n.y+i*r+s*o}},N6e=(e)=>{e.pads=e.pads.map((t)=>{let n=TQ(t.offset,e.ccwRotationOffset*Math.PI/180),o=(e.ccwRotationOffset%360+360)%360;return{...t,size:o===90||o===270?{x:t.size.y,y:t.size.x}:t.size,absoluteCenter:{x:e.center.x+n.x,y:e.center.y+n.y}}})};function m8r({components:e,packOrderStrategy:t,packFirst:n=[]}){let o=new Map;return n.forEach((r,i)=>{o.set(r,i)}),[...e].sort((r,i)=>{let s=o.get(r.componentId),a=o.get(i.componentId);if(s!==void 0&&a!==void 0)return s-a;if(s!==void 0)return-1;if(a!==void 0)return 1;if(t==="largest_to_smallest")return i.pads.length-r.pads.length;return r.pads.length-i.pads.length})}var _8r=(e)=>{let t=Math.min(...e.map((i)=>i.minX)),n=Math.min(...e.map((i)=>i.minY)),o=Math.max(...e.map((i)=>i.maxX)),r=Math.max(...e.map((i)=>i.maxY));return{minX:t,minY:n,maxX:o,maxY:r}};function LZe(e){let{bounds:t,center:n,width:o,height:r,angleRad:i}=e,s=e.translate?.x??0,a=e.translate?.y??0,c=o/2,l=r/2,h=[{x:n.x-c,y:n.y-l},{x:n.x+c,y:n.y-l},{x:n.x+c,y:n.y+l},{x:n.x-c,y:n.y+l}];for(let d of h){let u=TQ(d,i),_=u.x+s,p=u.y+a;t.minX=Math.min(t.minX,_),t.maxX=Math.max(t.maxX,_),t.minY=Math.min(t.minY,p),t.maxY=Math.max(t.maxY,p)}}var kV=(e,t=0)=>{let n={minX:1/0,maxX:-1/0,minY:1/0,maxY:-1/0},o=e.ccwRotationOffset*Math.PI/180;for(let r of e.pads){let i=TQ(r.offset,o),s=e.center.x+i.x,a=e.center.y+i.y,c=r.size.x/2,l=r.size.y/2;n.minX=Math.min(n.minX,s-c),n.maxX=Math.max(n.maxX,s+c),n.minY=Math.min(n.minY,a-l),n.maxY=Math.max(n.maxY,a+l)}if(e.courtyard)LZe({bounds:n,center:e.courtyard.offsetFromCenter,width:e.courtyard.width,height:e.courtyard.height,angleRad:o,translate:e.center});return{minX:n.minX-t,maxX:n.maxX+t,minY:n.minY-t,maxY:n.maxY+t}},vhn=(e,t,n)=>(t.x-e.x)*(n.y-e.y)-(t.y-e.y)*(n.x-e.x);function Shn(e,t=0.0000000001){if(e.length<=1)return e;let n=[],o=e[0][0],r=e[0][1];for(let i=1;i<e.length;i++){let s=e[i],[a,c]=s,l=0.000000001;if(!(Math.abs(r.x-a.x)<0.000000001&&Math.abs(r.y-a.y)<0.000000001)){n.push([o,r]),o=a,r=c;continue}let d=vhn(o,r,c),u=Math.hypot(r.x-o.x,r.y-o.y),_=Math.hypot(c.x-r.x,c.y-r.y),p=Math.max(t,t*u*_);if(Math.abs(d)<p)r=c;else n.push([o,r]),o=a,r=c}if(e.length>2){let i=n[0],s=[o,r];if(i&&n.length>0)if(Math.abs(r.x-i[0].x)<0.000000001&&Math.abs(r.y-i[0].y)<0.000000001){let l=vhn(o,r,i[1]),h=Math.hypot(r.x-o.x,r.y-o.y),d=Math.hypot(i[1].x-r.x,i[1].y-r.y),u=Math.max(t,t*h*d);if(Math.abs(l)<u)n[0]=[o,i[1]];else n.push(s)}else n.push(s);else n.push(s)}else n.push([o,r]);return n}function g8r(e){let t=0;for(let n=0;n<e.length;n++){let o=(n+1)%e.length,r=e[n],i=e[o];t+=r.x*i.y,t-=i.x*r.y}return t/2}function A8r(e){let t=[],n=e.first;if(!n)return t;do{let o=n.shape,r=o.start??o.ps;t.push({x:r.x,y:r.y}),n=n.next}while(n!==e.first);return t}function f8r(e){let t=[],n=[],o=Array.from(e.faces);for(let r of o){let i=A8r(r);if(i.length<3)continue;let s=g8r(i);if(s>0)t.push(i);else if(s<0)n.push(i)}return{obstacleFreeLoops:t,obstacleContainingLoops:n}}function Phn(e){let t=[];for(let n=0;n<e.length;n++){let o=e[n],r=e[(n+1)%e.length];t.push([o,r])}return t}function y8r(e){let t=f8r(e);return{obstacleFreeLoops:t.obstacleFreeLoops.map(Phn),obstacleContainingLoops:t.obstacleContainingLoops.map(Phn)}}var x8r=(e)=>{let{component:t,courtyard:n,minGap:o}=e,r=n.width/2+o,i=n.height/2+o,a=[{x:n.offsetFromCenter.x-r,y:n.offsetFromCenter.y-i},{x:n.offsetFromCenter.x+r,y:n.offsetFromCenter.y-i},{x:n.offsetFromCenter.x+r,y:n.offsetFromCenter.y+i},{x:n.offsetFromCenter.x-r,y:n.offsetFromCenter.y+i}].map((_)=>{let p=TQ(_,t.ccwRotationOffset*Math.PI/180);return{x:p.x+t.center.x,y:p.y+t.center.y}}),c=a.map(({x:_,y:p})=>[_,p]),l=new He.Polygon(c),h=a.map((_)=>_.x),d=a.map((_)=>_.y),u={minX:Math.min(...h),minY:Math.min(...d),maxX:Math.max(...h),maxY:Math.max(...d)};return{poly:l,bbox:u}},C8r=(e,t)=>e.pads.map((n)=>{let o=n.size.x/2+t,r=n.size.y/2+t,s=[{x:n.offset.x-o,y:n.offset.y-r},{x:n.offset.x+o,y:n.offset.y-r},{x:n.offset.x+o,y:n.offset.y+r},{x:n.offset.x-o,y:n.offset.y+r}].map((u)=>{let _=TQ(u,e.ccwRotationOffset*Math.PI/180);return{x:_.x+e.center.x,y:_.y+e.center.y}}),a=s.map(({x:u,y:_})=>[u,_]),c=new He.Polygon(a),l=s.map((u)=>u.x),h=s.map((u)=>u.y),d={minX:Math.min(...l),minY:Math.min(...h),maxX:Math.max(...l),maxY:Math.max(...h)};return{poly:c,bbox:d}}),b8r=(e,t)=>e.map((n)=>{let o=n.width/2+t,r=n.height/2+t,i=n.absoluteCenter.x,s=n.absoluteCenter.y,a=[{x:i-o,y:s-r},{x:i+o,y:s-r},{x:i+o,y:s+r},{x:i-o,y:s+r}],c=a.map(({x:_,y:p})=>[_,p]),l=new He.Polygon(c),h=a.map((_)=>_.x),d=a.map((_)=>_.y),u={minX:Math.min(...h),minY:Math.min(...d),maxX:Math.max(...h),maxY:Math.max(...d)};return{poly:l,bbox:u}}),I8r=(e,t={})=>{let{minGap:n=0,obstacles:o=[]}=t;if(e.length===0&&o.length===0)return[];let r=e.map((A)=>kV(A,n)),i=o.map((A)=>({minX:A.absoluteCenter.x-A.width/2-n,minY:A.absoluteCenter.y-A.height/2-n,maxX:A.absoluteCenter.x+A.width/2+n,maxY:A.absoluteCenter.y+A.height/2+n})),s=_8r([...r,...i]),a=[];for(let A of e)if(A.courtyard)a.push(x8r({component:A,courtyard:A.courtyard,minGap:n}));else{let g=C8r(A,n);a.push(...g)}let c=b8r(o,n);if(a.push(...c),a.length===0)return[];let h=v8r(a).map((A)=>A.poly),d=new He.Polygon(new He.Box(s.minX,s.minY,s.maxX,s.maxY)),u=d.clone();for(let A of h)try{d=He.BooleanOperations.subtract(d,A)}catch{}let _=null;try{_=He.BooleanOperations.subtract(u,d)}catch{try{if(h.length>0){let A=h[0];for(let g=1;g<h.length;g++)try{A=He.BooleanOperations.unify(A,h[g])}catch{}_=A}}catch{_=null}}if(!_)return[];let p=y8r(_);return[...p.obstacleFreeLoops.map((A)=>Shn(A)),...p.obstacleContainingLoops.map((A)=>Shn(A))].filter((A)=>A.length>=3)};function v8r(e){let t=(i)=>Math.max(0,i.maxX-i.minX)*Math.max(0,i.maxY-i.minY),n=(i,s,a=0.000000001)=>i.minX-a<=s.minX&&i.minY-a<=s.minY&&i.maxX+a>=s.maxX&&i.maxY+a>=s.maxY,o=[...e].sort((i,s)=>t(s.bbox)-t(i.bbox)),r=[];for(let i of o){let s=i.bbox.maxX-i.bbox.minX,a=i.bbox.maxY-i.bbox.minY;if(!(s>0.000000000001&&a>0.000000000001))continue;let c=!1;for(let l of r)if(n(l.bbox,i.bbox)){c=!0;break}if(!c)r.push(i)}return r}var Thn=(e)=>{if(typeof e==="number")return Math.round(e*100)/100;if(typeof e==="object")return Object.fromEntries(Object.entries(e).map(([t,n])=>[t,Thn(n)]));return e},Dhn=class{MAX_ITERATIONS=1e5;solved=!1;failed=!1;iterations=0;progress=0;error=null;activeSubSolver;failedSubSolvers;timeToSolve;stats={};_setupDone=!1;getSolverName(){return this.constructor.name}setup(){if(this._setupDone)return;this._setup(),this._setupDone=!0}step(){if(!this._setupDone)this.setup();if(this.solved)return;if(this.failed)return;this.iterations++;try{this._step()}catch(e){throw this.error=`${this.getSolverName()} error: ${e}`,console.error(this.error),this.failed=!0,e}if(!this.solved&&this.iterations>this.MAX_ITERATIONS)this.tryFinalAcceptance();if(!this.solved&&this.iterations>this.MAX_ITERATIONS)this.error=`${this.getSolverName()} ran out of iterations`,console.error(this.error),this.failed=!0;if("computeProgress"in this)this.progress=this.computeProgress()}_setup(){}_step(){}getConstructorParams(){throw Error("getConstructorParams not implemented")}solve(){let e=Date.now();while(!this.solved&&!this.failed)this.step();let t=Date.now();this.timeToSolve=t-e}visualize(){return{lines:[],points:[],rects:[],circles:[]}}tryFinalAcceptance(){}getOutput(){return null}preview(){return{lines:[],points:[],rects:[],circles:[]}}noisySolve(){let e=Date.now();while(!this.solved&&!this.failed)this.step(),console.log(JSON.stringify(Thn(this.visualize())));let t=Date.now();this.timeToSolve=t-e}},HZe=class extends Dhn{offsetPadPoints;targetPointMap;currentPosition;constraintFn;epsilon;useSquaredDistance;optimalPosition;initialPosition;getSolverName(){return"MultiOffsetIrlsSolver"}constructor(e){super();this.offsetPadPoints=[...e.offsetPadPoints],this.targetPointMap=new Map(e.targetPointMap),this.initialPosition={...e.initialPosition},this.currentPosition={...e.initialPosition},this.constraintFn=e.constraintFn,this.epsilon=e.epsilon??0.000001,this.useSquaredDistance=e.useSquaredDistance??!1,this.MAX_ITERATIONS=e.maxIterations??100}getConstructorParams(){return{offsetPadPoints:this.offsetPadPoints.map((e)=>({...e})),targetPointMap:new Map(this.targetPointMap),initialPosition:this.initialPosition,constraintFn:this.constraintFn,epsilon:this.epsilon,useSquaredDistance:this.useSquaredDistance,maxIterations:this.MAX_ITERATIONS}}_setup(){if(this.currentPosition={...this.initialPosition},this.optimalPosition=void 0,!Array.from(this.targetPointMap.values()).some((t)=>t.length>0)||this.offsetPadPoints.length===0)this.optimalPosition={...this.currentPosition},this.solved=!0}_step(){if(this.offsetPadPoints.length===0)return;let{x:e,y:t}=this.currentPosition,n=0,o=0,r=0;for(let h of this.offsetPadPoints){let d=this.targetPointMap.get(h.id)||[];if(d.length===0)continue;let u=e+h.offsetX,_=t+h.offsetY;for(let p of d){let m=u-p.x,A=_-p.y,g=Math.sqrt(m*m+A*A),f;if(this.useSquaredDistance)f=1;else f=g<this.epsilon?1e6:1/g;let y={x:p.x-h.offsetX,y:p.y-h.offsetY};n+=f*y.x,o+=f*y.y,r+=f}}let i={x:r>0?n/r:e,y:r>0?o/r:t},s=this.constraintFn?this.constraintFn(i):i,a=s.x-e,c=s.y-t;if(Math.sqrt(a*a+c*c)<this.epsilon){this.optimalPosition={...s},this.solved=!0;return}this.currentPosition=s}getBestPosition(){return this.optimalPosition||this.currentPosition}getOffsetPadPositions(){let e=this.getBestPosition(),t=new Map;for(let n of this.offsetPadPoints)t.set(n.id,{x:e.x+n.offsetX,y:e.y+n.offsetY});return t}getOffsetPadPosition(e){return this.getOffsetPadPositions().get(e)}getTotalDistance(e){let t=e||this.getBestPosition(),n=0;for(let o of this.offsetPadPoints){let r={x:t.x+o.offsetX,y:t.y+o.offsetY},i=this.targetPointMap.get(o.id)||[];for(let s of i){let a=r.x-s.x,c=r.y-s.y;if(this.useSquaredDistance)n+=a*a+c*c;else n+=Math.sqrt(a*a+c*c)}}return n}getDistanceForPad(e,t){let n=t||this.getBestPosition(),o=this.offsetPadPoints.find((s)=>s.id===e);if(!o)return 0;let r={x:n.x+o.offsetX,y:n.y+o.offsetY};return(this.targetPointMap.get(e)||[]).reduce((s,a)=>{let c=r.x-a.x,l=r.y-a.y;if(this.useSquaredDistance)return s+(c*c+l*l);else return s+Math.sqrt(c*c+l*l)},0)}computeProgress(){if(this.offsetPadPoints.length===0)return 1;let e=this.getTotalDistance(this.initialPosition),t=this.getTotalDistance();if(e===0)return 1;let n=Math.max(0,e-t);return Math.min(1,n/e)}visualize(){let e={lines:[],points:[],rects:[],circles:[]},t=["#4CAF50","#2196F3","#FF9800","#9C27B0","#F44336","#607D8B"],n=this.getBestPosition();for(let o=0;o<this.offsetPadPoints.length;o++){let r=this.offsetPadPoints[o];if(!r)continue;let i=t[o%t.length],s=this.targetPointMap.get(r.id)||[],a={x:n.x+r.offsetX,y:n.y+r.offsetY};for(let c of s)e.points.push({...c,color:i});for(let c of s)e.lines.push({points:[a,c],strokeColor:i});e.points.push({x:a.x,y:a.y,color:i})}if(e.points.push({...this.currentPosition,color:"#f44336"}),this.optimalPosition)e.points.push({...this.optimalPosition,color:"rgba(76, 175, 80, 0.3)"});return e}getOutput(){return this.optimalPosition??this.currentPosition}},S8r=class extends Dhn{offsetPadPoints;targetPointMap;constraintFn;currentPosition;optimalPosition;initialPosition;phase1Epsilon;phase2Epsilon;maxIterations;getSolverName(){return"TwoPhaseIrlsSolver"}phase1Solver;phase2Solver;currentPhase=1;phase1Position;closestTargetPadId;closestTargetPoint;constructor(e){super();this.offsetPadPoints=[...e.offsetPadPoints],this.targetPointMap=new Map(e.targetPointMap),this.initialPosition={...e.initialPosition},this.currentPosition={...e.initialPosition},this.constraintFn=e.constraintFn,this.phase1Epsilon=e.phase1Epsilon??e.epsilon??0.000001,this.phase2Epsilon=e.phase2Epsilon??e.epsilon??0.000001,this.maxIterations=e.maxIterations??100}getConstructorParams(){return{offsetPadPoints:this.offsetPadPoints.map((e)=>({...e})),targetPointMap:new Map(this.targetPointMap),initialPosition:this.initialPosition,constraintFn:this.constraintFn,phase1Epsilon:this.phase1Epsilon,phase2Epsilon:this.phase2Epsilon,maxIterations:this.maxIterations}}_setup(){if(this.currentPosition={...this.initialPosition},this.optimalPosition=void 0,this.currentPhase=1,this.phase1Position=void 0,this.closestTargetPadId=void 0,this.closestTargetPoint=void 0,!Array.from(this.targetPointMap.values()).some((t)=>t.length>0)||this.offsetPadPoints.length===0){this.optimalPosition={...this.currentPosition},this.solved=!0;return}this.phase1Solver=new HZe({offsetPadPoints:this.offsetPadPoints,targetPointMap:this.targetPointMap,initialPosition:this.initialPosition,constraintFn:this.constraintFn,epsilon:this.phase1Epsilon,maxIterations:this.maxIterations,useSquaredDistance:!0}),this.phase1Solver.setup()}_step(){if(this.currentPhase===1)this.stepPhase1();else this.stepPhase2()}stepPhase1(){if(!this.phase1Solver)return;if(this.phase1Solver.step(),this.currentPosition=this.phase1Solver.getBestPosition(),this.phase1Solver.solved)this.phase1Position=this.phase1Solver.getBestPosition(),this.setupPhase2();else if(this.phase1Solver.failed)this.failed=!0,this.error=`Phase 1 failed: ${this.phase1Solver.error}`}setupPhase2(){if(!this.phase1Position)return;let e=1/0,t,n;for(let r of this.offsetPadPoints){let i=this.targetPointMap.get(r.id)||[];if(i.length===0)continue;let s=this.phase1Position.x+r.offsetX,a=this.phase1Position.y+r.offsetY;for(let c of i){let l=s-c.x,h=a-c.y,d=Math.sqrt(l*l+h*h);if(d<e)e=d,t=r.id,n=c}}if(this.closestTargetPadId=t,this.closestTargetPoint=n,!t||!n){this.optimalPosition=this.phase1Position,this.solved=!0;return}let o=new Map;o.set(t,[n]),this.phase2Solver=new HZe({offsetPadPoints:this.offsetPadPoints,targetPointMap:o,initialPosition:this.phase1Position,constraintFn:this.constraintFn,epsilon:this.phase2Epsilon,maxIterations:this.maxIterations,useSquaredDistance:!1}),this.phase2Solver.setup(),this.currentPhase=2}stepPhase2(){if(!this.phase2Solver)return;if(this.phase2Solver.step(),this.currentPosition=this.phase2Solver.getBestPosition(),this.phase2Solver.solved)this.optimalPosition=this.phase2Solver.getBestPosition(),this.solved=!0;else if(this.phase2Solver.failed)this.failed=!0,this.error=`Phase 2 failed: ${this.phase2Solver.error}`}getBestPosition(){return this.optimalPosition||this.currentPosition}getOffsetPadPositions(){let e=this.getBestPosition(),t=new Map;for(let n of this.offsetPadPoints)t.set(n.id,{x:e.x+n.offsetX,y:e.y+n.offsetY});return t}getTotalDistance(e){let t=e||this.getBestPosition(),n=0;for(let o of this.offsetPadPoints){let r={x:t.x+o.offsetX,y:t.y+o.offsetY},i=this.targetPointMap.get(o.id)||[];for(let s of i){let a=r.x-s.x,c=r.y-s.y;n+=a*a+c*c}}return n}visualize(){let e={lines:[],points:[],rects:[],circles:[]};if(e.points.push({...this.currentPosition,color:this.currentPhase===1?"#FF6B6B":"#4ECDC4",label:`Phase ${this.currentPhase}`}),this.phase1Position&&this.currentPhase===2)e.points.push({...this.phase1Position,color:"rgba(255, 107, 107, 0.5)",label:"Phase 1 result"});if(this.closestTargetPoint&&this.closestTargetPadId){e.points.push({...this.closestTargetPoint,color:"#FFA500",label:`Closest target (${this.closestTargetPadId})`});let n=this.offsetPadPoints.find((o)=>o.id===this.closestTargetPadId);if(n){let o=this.getBestPosition(),r={x:o.x+n.offsetX,y:o.y+n.offsetY};e.lines.push({points:[r,this.closestTargetPoint],strokeColor:"#FFA500"})}}let t=this.currentPhase===1?this.phase1Solver:this.phase2Solver;if(t){let n=t.visualize(),o=this.currentPhase===1?"rgba(255, 107, 107, 0.7)":"rgba(76, 205, 196, 0.7)";if(n.lines){let r=n.lines.map((i)=>({...i,strokeColor:o}));e.lines.push(...r)}if(n.points)e.points.push(...n.points);if(n.rects)e.rects.push(...n.rects);if(n.circles)e.circles.push(...n.circles)}if(this.optimalPosition)e.points.push({...this.optimalPosition,color:"rgba(76, 175, 80, 0.8)",label:"Final optimal position"});return e}getOutput(){return this.optimalPosition??this.currentPosition}};function P8r(e){let t=new Map,n=new Set;for(let{padIds:o,ignoreWeakConnections:r}of e)for(let i of o){let s=t.get(i);if(!s)s=new Set,t.set(i,s);for(let a of o)s.add(a);if(r===!0)n.add(i)}return{explicitlyConnectedPadIdsByPadId:t,padIdsRejectingWeakConnections:n}}var Ehn=new WeakMap;function E8r(e){let t=Ehn.get(e);if(t)return t;let n=P8r(e);return Ehn.set(e,n),n}function R6e(e,t,n){if(!n?.length)return!0;let o=E8r(n);if(o.explicitlyConnectedPadIdsByPadId.get(e)?.has(t))return!0;return!(o.padIdsRejectingWeakConnections.has(e)||o.padIdsRejectingWeakConnections.has(t))}var M8r=(e)=>{let t={};for(let n=0;n<e.length;n++)t[e[n]]=`hsl(${n*300/e.length}, 100%, 50%)`;return t},FZe=(e,t=1)=>`hsl(${e.split("").reduce((o,r)=>o*31+r.charCodeAt(0),0)%360}, 100%, 50%, ${t})`;function Mhn(e,t){let[n,o]=e,r=o.x-n.x,i=o.y-n.y,s=Math.hypot(r,i);if(s===0)return{x:0,y:1};let a=r/s,c=i/s,l={x:-c,y:a},h={x:c,y:-a},d=[];if(t.length>0){d.push(t[0][0]);for(let m of t)d.push(m[1])}let u=(()=>{let m=0;for(let A=0;A<d.length;A++){let g=d[A],f=d[(A+1)%d.length];m+=g.x*f.y-f.x*g.y}return m/2})(),_=u>0?h:l;if(u<0)return{x:-_.x,y:-_.y};return _}var w8r=class extends co{ccwFullOutline;origin;globalBounds;largestRect=null;mode;getSolverName(){return"LargestRectOutsideOutlineFromPointSolver"}constructor(e){super();this.ccwFullOutline=e.ccwFullOutline,this.origin=e.origin,this.globalBounds=e.globalBounds,this.mode=e.mode??"outside"}getConstructorParams(){return{ccwFullOutline:this.ccwFullOutline,origin:this.origin,globalBounds:this.globalBounds,mode:this.mode}}_setup(){}_step(){this.largestRect=this.computeLargestRect(),this.solved=!0}computeLargestRect(){let e=this.makeEdges(this.ccwFullOutline),t={x:this.globalBounds.minX,y:this.globalBounds.minY,w:this.globalBounds.maxX-this.globalBounds.minX,h:this.globalBounds.maxY-this.globalBounds.minY};return this.largestRectContainingPointRegion(e,this.origin,t,this.mode)}almostEqual(e,t,n=0.000000001){return Math.abs(e-t)<=n}makeEdges(e){let t=[];for(let n=0;n<e.length;n++){let o=e[n],r=e[(n+1)%e.length];if(!o||!r)continue;if(this.almostEqual(o.x,r.x)&&this.almostEqual(o.y,r.y))continue;t.push([o,r])}return t}isVertical(e){return this.almostEqual(e[0].x,e[1].x)}isHorizontal(e){return this.almostEqual(e[0].y,e[1].y)}scanlineIntervalsAtY(e,t){let n=[];for(let r of e){if(!this.isVertical(r))continue;let i=r[0].y,s=r[1].y,a=r[0].x,c=Math.min(i,s),l=Math.max(i,s);if(c<=t&&t<l)n.push(a)}n.sort((r,i)=>r-i);let o=[];for(let r=0;r+1<n.length;r+=2){let i=n[r],s=n[r+1];if(i!==void 0&&s!==void 0)o.push([i,s])}return o}clipIntervals(e,t,n){let o=[];for(let[r,i]of e){let s=Math.max(t,r),a=Math.min(n,i);if(a>s)o.push([s,a])}return o}regionIntervalsAtY(e,t,n,o,r){let i=this.clipIntervals(this.scanlineIntervalsAtY(e,t),n,o);if(r==="inside")return i;let s=[],a=n;for(let[c,l]of i){if(c>a)s.push([a,c]);a=Math.max(a,l)}if(a<o)s.push([a,o]);return s}largestRectContainingPointRegion(e,t,n,o){let r=n.x,i=n.x+n.w,s=n.y,a=n.y+n.h,l=this.regionIntervalsAtY(e,t.y,r,i,o).find(([x,C])=>x-0.000000001<=t.x&&t.x<=C+0.000000001);if(!l)return null;let[h,d]=l,u=new Set([h,d]);for(let x of e){if(!this.isVertical(x))continue;let C=x[0].x;if(h<C&&C<d)u.add(C)}let _=Array.from(u).sort((x,C)=>x-C),p=_.length-1;if(p<=0)return null;let m=Array(p).fill(-1/0),A=Array(p).fill(1/0);for(let x=0;x<p;x++){let C=_[x],b=_[x+1];if(C===void 0||b===void 0)continue;let I=0.5*(C+b);if(u.has(I))I+=0.000001;let v=a,P=s;for(let M of e){if(!this.isHorizontal(M))continue;let B=M[0].y,T=Math.min(M[0].x,M[1].x),N=Math.max(M[0].x,M[1].x);if(T-0.000000001<=I&&I<=N+0.000000001){if(B>t.y)v=Math.min(v,B);if(B<t.y)P=Math.max(P,B)}}if(!(P<v))m[x]=-1/0,A[x]=1/0;else m[x]=v,A[x]=P}let g=-1;for(let x=0;x<p;x++){let C=_[x],b=_[x+1];if(C===void 0||b===void 0)continue;if(C-0.000000001<=t.x&&t.x<=b+0.000000001){g=x;break}}if(g===-1)return null;let f=null,y=-1;for(let x=0;x<=g;x++){let C=1/0,b=-1/0;for(let I=x;I<p;I++){let v=m[I],P=A[I];if(v===void 0||P===void 0)continue;if(C=Math.min(C,v),b=Math.max(b,P),I<g)continue;let M=Math.max(0,C-b);if(M<=0)continue;let B=_[x],T=_[I+1];if(B===void 0||T===void 0)continue;let N=T-B,D=N*M;if(D>y)y=D,f={x:B,y:b,w:N,h:M}}}return f}getLargestRect(){if(!this.solved)this.solve();return this.largestRect}getLargestRectBounds(){if(!this.solved)this.solve();if(!this.largestRect)return{minX:0,minY:0,maxX:0,maxY:0};return{minX:this.largestRect.x,minY:this.largestRect.y,maxX:this.largestRect.x+this.largestRect.w,maxY:this.largestRect.y+this.largestRect.h}}visualize(){let e={lines:[],points:[],rects:[],circles:[]};for(let t=0;t<this.ccwFullOutline.length;t++){let n=this.ccwFullOutline[t],o=this.ccwFullOutline[(t+1)%this.ccwFullOutline.length];if(n&&o)e.lines.push({points:[n,o],strokeColor:"rgba(0,0,0,0.5)"})}if(e.lines.push({points:[...this.ccwFullOutline,this.ccwFullOutline[0]],strokeColor:"rgba(200, 200, 200, 0.5)",strokeDash:[10,5]}),e.circles.push({center:this.origin,radius:0.05,fill:"#f44336",label:"Origin"}),this.largestRect)e.rects.push({center:{x:this.largestRect.x+this.largestRect.w/2,y:this.largestRect.y+this.largestRect.h/2},width:this.largestRect.w,height:this.largestRect.h,fill:"rgba(0, 255, 0, 0.3)",stroke:"#4CAF50",label:`Largest Rectangle (Area: ${(this.largestRect.w*this.largestRect.h).toFixed(3)})`});return e}getOutput(){return this.largestRect??null}},B8r=(e,{rotationDegrees:t=0})=>{let n={minX:1/0,maxX:-1/0,minY:1/0,maxY:-1/0},o=t*Math.PI/180;for(let r of e.pads)LZe({bounds:n,center:r.offset,width:r.size.x,height:r.size.y,angleRad:o});if(e.courtyard)LZe({bounds:n,center:e.courtyard.offsetFromCenter,width:e.courtyard.width,height:e.courtyard.height,angleRad:o});return n},T8r=(e,t)=>{let[n,o]=e,r={x:o.x-n.x,y:o.y-n.y},i=D8r(r);return[{x:n.x-i.x*t,y:n.y-i.y*t},{x:o.x+i.x*t,y:o.y+i.y*t}]};function D8r(e){let t=Math.hypot(e.x,e.y);return{x:e.x/t,y:e.y/t}}function Uq(e,t){if(t.length<3)return!1;let n=!1,o=t.length,r=[...t];if(r[0].x!==r[o-1].x||r[0].y!==r[o-1].y)r.push({...r[0]});for(let i=0,s=r.length-1;i<r.length;s=i++){let a=r[i].x,c=r[i].y,l=r[s].x,h=r[s].y;if(c>e.y!==h>e.y&&e.x<(l-a)*(e.y-c)/(h-c)+a)n=!n}return n}var N8r=class extends co{outlineSegment;viableOutlineSegment=null;ccwFullOutline;componentRotationDegrees;packStrategy;minGap;obstacles;packedComponents;componentToPack;viableBounds;globalBounds;boundaryOutline;weightedConnections;networkTargetPointMappingsCache;optimalPosition;irlsSolver;twoPhaseIrlsSolver;getSolverName(){return"OutlineSegmentCandidatePointSolver"}largestRectBounds;largestRectMidPoint;largestRectOrigin;constructor(e){super();this.outlineSegment=e.outlineSegment,this.ccwFullOutline=e.ccwFullOutline,this.componentRotationDegrees=e.componentRotationDegrees,this.packStrategy=e.packStrategy,this.minGap=e.minGap,this.packedComponents=e.packedComponents,this.componentToPack=e.componentToPack,this.obstacles=e.obstacles??[],this.globalBounds=e.globalBounds,this.boundaryOutline=e.boundaryOutline,this.weightedConnections=e.weightedConnections,this.networkTargetPointMappingsCache=e.networkTargetPointMappingsCache}getConstructorParams(){return{outlineSegment:this.outlineSegment,ccwFullOutline:this.ccwFullOutline,componentRotationDegrees:this.componentRotationDegrees,packStrategy:this.packStrategy,minGap:this.minGap,packedComponents:this.packedComponents,componentToPack:this.componentToPack,obstacles:this.obstacles,globalBounds:this.globalBounds,boundaryOutline:this.boundaryOutline,weightedConnections:this.weightedConnections,networkTargetPointMappingsCache:this.networkTargetPointMappingsCache}}_getOutlineBoundsWithMargin(e={}){let t=1/0,n=1/0,o=-1/0,r=-1/0;for(let[s,a]of this.ccwFullOutline)t=Math.min(t,s.x,a.x),n=Math.min(n,s.y,a.y),o=Math.max(o,s.x,a.x),r=Math.max(r,s.y,a.y);let i=e.margin??0;return{minX:t-i,minY:n-i,maxX:o+i,maxY:r+i}}_setup(){let[e,t]=this.outlineSegment,n=(T)=>{let N=this.projectPointOntoSegment(T,this.viableOutlineSegment);return this.adjustPositionForOutlineCollision(N)},o=Mhn(this.outlineSegment,this.ccwFullOutline),r=B8r(this.componentToPack,{rotationDegrees:this.componentRotationDegrees}),i=this._getOutlineBoundsWithMargin({margin:Math.max(r.maxX-r.minX,r.maxY-r.minY)*2+this.minGap*2});this.largestRectMidPoint={x:(e.x+t.x)/2,y:(e.y+t.y)/2},this.largestRectOrigin={x:this.largestRectMidPoint.x+o.x*0.0001,y:this.largestRectMidPoint.y+o.y*0.0001};let s=this.ccwFullOutline.flatMap(([T])=>T),a=0;for(let T=0;T<s.length;T++){let N=s[T],D=s[(T+1)%s.length];a+=N.x*D.y-D.x*N.y}a/=2;let l=a<0?"inside":"outside",h={ccwFullOutline:s,globalBounds:i,origin:this.largestRectOrigin,mode:l},d=new w8r(h);d.solve();let u=d.getLargestRectBounds();this.largestRectBounds=u;let _={x:Math.abs(Math.sign(this.outlineSegment[1].x-this.outlineSegment[0].x)),y:Math.abs(Math.sign(this.outlineSegment[1].y-this.outlineSegment[0].y))},p={minX:u.minX-r.minX*_.x,minY:u.minY-r.minY*_.y,maxX:u.maxX-r.maxX*_.x,maxY:u.maxY-r.maxY*_.y};if(this.boundaryOutline&&this.boundaryOutline.length>=3){let T=1/0,N=1/0,D=-1/0,L=-1/0;for(let H of this.boundaryOutline)T=Math.min(T,H.x),N=Math.min(N,H.y),D=Math.max(D,H.x),L=Math.max(L,H.y);p={minX:Math.max(p.minX,T-r.minX),minY:Math.max(p.minY,N-r.minY),maxX:Math.min(p.maxX,D-r.maxX),maxY:Math.min(p.maxY,L-r.maxY)}}this.viableBounds=p;let m=p.maxX-p.minX,A=p.maxY-p.minY,g=r.maxX-r.minX,f=r.maxY-r.minY;if(m<g||A<f){this.failed=!0,this.error="There is nowhere for the component to fit along this outline section";return}let y=Math.hypot(t.x-e.x,t.y-e.y),x=T8r(this.outlineSegment,y),[C,b]=x;this.viableOutlineSegment=[{x:Dh(C.x,p.minX,p.maxX),y:Dh(C.y,p.minY,p.maxY)},{x:Dh(b.x,p.minX,p.maxX),y:Dh(b.y,p.minY,p.maxY)}];let[I,v]=this.viableOutlineSegment,P=this.adjustPositionForOutlineCollision({x:(I.x+v.x)/2,y:(I.y+v.y)/2}),{offsetPadPoints:M,targetPointMap:B}=this.getNetworkTargetPointMappings();if(this.packStrategy==="minimum_closest_sum_squared_distance")this.twoPhaseIrlsSolver=new S8r({offsetPadPoints:M,targetPointMap:B,initialPosition:P,constraintFn:n,epsilon:0.000001,maxIterations:50});else this.irlsSolver=new HZe({offsetPadPoints:M,targetPointMap:B,initialPosition:P,constraintFn:n,epsilon:0.000001,maxIterations:50,useSquaredDistance:this.packStrategy==="minimum_sum_squared_distance_to_network"})}_step(){let e=this.irlsSolver||this.twoPhaseIrlsSolver;if(!e){this.solved=!0;return}if(e.step(),e.solved){let t=e.getBestPosition();this.optimalPosition=t,this.solved=!0}else if(e.failed)this.failed=!0,this.error=e.error}getNetworkTargetPointMappings(){let e=this.networkTargetPointMappingsCache?.get(this.componentRotationDegrees);if(e)return e;let t=this.getRotatedComponentPads(),n=t.map((i)=>({id:i.padId,offsetX:i.offset.x,offsetY:i.offset.y})),o=new Map;for(let i of t){let s=[];for(let a of this.packedComponents)for(let c of a.pads)if(c.networkId===i.networkId){if(!R6e(i.padId,c.padId,this.weightedConnections))continue;s.push({...c.absoluteCenter,networkId:c.networkId})}o.set(i.padId,s)}let r={offsetPadPoints:n,targetPointMap:o};return this.networkTargetPointMappingsCache?.set(this.componentRotationDegrees,r),r}projectPointOntoSegment(e,t){let[n,o]=t,r=o.x-n.x,i=o.y-n.y,s=e.x-n.x,a=e.y-n.y,c=r*r+i*i;if(c===0)return{x:n.x,y:n.y};let l=Math.max(0,Math.min(1,(s*r+a*i)/c));return{x:n.x+l*r,y:n.y+l*i}}getRotatedComponentPads(){let e=this.componentRotationDegrees*Math.PI/180;return this.componentToPack.pads.map((t)=>({...t,size:(this.componentRotationDegrees+90)%180===0?{x:t.size.y,y:t.size.x}:t.size,offset:TQ(t.offset,e)}))}createTemporaryPackedComponent(e){let t=this.componentRotationDegrees*Math.PI/180,n=(this.componentRotationDegrees+90)%180===0;return{componentId:this.componentToPack.componentId,center:e,ccwRotationOffset:this.componentRotationDegrees,pads:this.componentToPack.pads.map((o)=>{let r=TQ(o.offset,t);return{...o,size:{x:n?o.size.y:o.size.x,y:n?o.size.x:o.size.y},absoluteCenter:{x:e.x+r.x,y:e.y+r.y}}}),courtyard:this.componentToPack.courtyard}}adjustPositionForOutlineCollision(e){let t=this.createTemporaryPackedComponent(e),n=kV(t,0),o=Mhn(this.outlineSegment,this.ccwFullOutline),r=Math.abs(o.x)>Math.abs(o.y),i=!r,s=e;if(r){let a=o.x>0,c=!a;if(a)s={x:n.maxX,y:e.y};else if(c)s={x:n.minX,y:e.y}}else if(i){let a=o.y>0,c=!a;if(a)s={x:e.x,y:n.maxY};else if(c)s={x:e.x,y:n.minY}}if(this.boundaryOutline&&this.boundaryOutline.length>=3){let a=this.createTemporaryPackedComponent(s),c=kV(a,0),l=a.pads.every((d)=>Uq(d.absoluteCenter,this.boundaryOutline)),h=[{x:c.minX,y:c.minY},{x:c.minX,y:c.maxY},{x:c.maxX,y:c.minY},{x:c.maxX,y:c.maxY}].every((d)=>Uq(d,this.boundaryOutline));if(!l||!h){if(this.viableBounds)s={x:Dh(s.x,this.viableBounds.minX,this.viableBounds.maxX),y:Dh(s.y,this.viableBounds.minY,this.viableBounds.maxY)}}}return s}visualize(){let e={lines:[],points:[],rects:[],circles:[]};if(this.obstacles&&this.obstacles.length>0)for(let s of this.obstacles)e.rects.push({center:s.absoluteCenter,width:s.width,height:s.height,fill:"rgba(0,0,0,0.1)",stroke:"#555",label:s.obstacleId});if(this.globalBounds)e.lines.push({points:[{x:this.globalBounds.minX,y:this.globalBounds.minY},{x:this.globalBounds.minX,y:this.globalBounds.maxY},{x:this.globalBounds.maxX,y:this.globalBounds.maxY},{x:this.globalBounds.maxX,y:this.globalBounds.minY},{x:this.globalBounds.minX,y:this.globalBounds.minY}],strokeColor:"rgba(255,0,255,0.5)",strokeDash:"2 2"});if(this.boundaryOutline&&this.boundaryOutline.length){let s=[...this.boundaryOutline];if(s.length>0&&(s[0].x!==s[s.length-1].x||s[0].y!==s[s.length-1].y))s.push({...s[0]});e.lines.push({points:s,strokeColor:"rgba(0, 0, 255, 0.5)",strokeDash:"4 2"})}if(this.viableBounds)e.rects.push({center:{x:(this.viableBounds.minX+this.viableBounds.maxX)/2,y:(this.viableBounds.minY+this.viableBounds.maxY)/2},width:this.viableBounds.maxX-this.viableBounds.minX,height:this.viableBounds.maxY-this.viableBounds.minY,fill:"rgba(0,255,0,0.1)",label:"Viable Bounds"});if(this.largestRectBounds)e.rects.push({center:{x:(this.largestRectBounds.minX+this.largestRectBounds.maxX)/2,y:(this.largestRectBounds.minY+this.largestRectBounds.maxY)/2},width:this.largestRectBounds.maxX-this.largestRectBounds.minX,height:this.largestRectBounds.maxY-this.largestRectBounds.minY,fill:"rgba(255,0,255,0.4)"});if(this.largestRectMidPoint)e.points.push({...this.largestRectMidPoint,label:"Largest Rect Mid Point",color:"rgba(128,0,255,1)"});if(this.largestRectOrigin)e.points.push({...this.largestRectOrigin,label:"Largest Rect Origin",color:"rgba(255,0,128,1)"});if(this.viableOutlineSegment){let[s,a]=this.viableOutlineSegment;e.lines.push({points:[s,a],strokeColor:"#2196F3"})}let[t,n]=this.outlineSegment;e.lines.push({points:[t,n],strokeColor:"rgba(255,0,0,1)",strokeDash:"3 3"});for(let[s,a]of this.ccwFullOutline)e.lines.push({points:[s,a],strokeColor:"rgba(0,0,0,0.5)",strokeDash:"4 4"});for(let s of this.packedComponents)for(let a of s.pads)e.rects.push({center:a.absoluteCenter,width:a.size.x,height:a.size.y,fill:FZe(a.networkId,0.5),stroke:"#333",label:`${a.padId} (${a.networkId})`});let o=this.optimalPosition??this.irlsSolver?.currentPosition??this.twoPhaseIrlsSolver?.currentPosition??{x:0,y:0},r=this.getRotatedComponentPads();for(let s of r){let a={x:o.x+s.offset.x,y:o.y+s.offset.y};e.rects.push({center:a,width:s.size.x,height:s.size.y,fill:this.failed?"rgba(255,0,0,0.5)":FZe(s.networkId,0.5),label:`${s.padId} (${s.networkId})`});for(let c of this.packedComponents)for(let l of c.pads)if(l.networkId===s.networkId){let h=R6e(s.padId,l.padId,this.weightedConnections);e.lines.push({points:[a,l.absoluteCenter],strokeColor:s.networkId==="VCC"?"#FF6B6B":"#4ECDC4",strokeDash:h?void 0:"4 2",label:`${s.networkId} ${h?"strong":"weak"}`})}}let i=this.irlsSolver||this.twoPhaseIrlsSolver;if(i){let s=i.currentPosition;e.points.push({...s,color:"#f44336"});let a=i.visualize();if(a.lines)e.lines.push(...a.lines);if(a.circles)e.circles.push(...a.circles);if(a.rects)e.rects.push(...a.rects);if(a.points)e.points.push(...a.points)}if(this.optimalPosition)e.points.push({...this.optimalPosition,color:"rgba(76, 175, 80, 0.3)"});return e}getOutput(){return this.optimalPosition??null}},zZe=(e)=>{let t=[],n=[];if(e.boundaryOutline&&e.boundaryOutline.length){let i=[...e.boundaryOutline];if(i.length>0&&(i[0].x!==i[i.length-1].x||i[0].y!==i[i.length-1].y))i.push({...i[0]});n.push({points:i,strokeColor:"rgba(0, 0, 255, 0.5)",strokeDash:"4 2"})}let o=Array.from(new Set(e.components.flatMap((i)=>i.pads.map((s)=>s.networkId)))),r=M8r(o);if(e.obstacles&&e.obstacles.length>0)for(let i of e.obstacles)t.push({center:{x:i.absoluteCenter.x,y:i.absoluteCenter.y},width:i.width,height:i.height,fill:"rgba(0,0,0,0.1)",stroke:"#555",label:i.obstacleId});for(let i of e.components){let s=kV(i),a=s.maxX-s.minX,c=s.maxY-s.minY,l=Boolean(i.isStatic),h="rgba(33, 150, 243, 0.25)",d="rgba(33, 150, 243, 0.6)",u={center:{x:i.center.x,y:i.center.y},width:a,height:c,fill:l?"rgba(33, 150, 243, 0.25)":"rgba(0,0,0,0.25)",stroke:l?"rgba(33, 150, 243, 0.6)":void 0,label:[i.componentId,`ccwRotationOffset: ${i.ccwRotationOffset.toFixed(1)}°`].join(`
`)};t.push(u);for(let _ of i.pads){let{absoluteCenter:p,size:m,padId:A,networkId:g}=_,f={center:{x:p.x,y:p.y},width:m.x,height:m.y,label:`${A} ${g}`,fill:"rgba(255,0,0,0.8)"};t.push(f)}}for(let i of o){let s=e.components.flatMap((a)=>a.pads.filter((c)=>c.networkId===i));for(let a=0;a<s.length;a++)for(let c=a+1;c<s.length;c++){let l=s[a],h=s[c],d=R6e(l.padId,h.padId,e.weightedConnections);n.push({points:[l.absoluteCenter,h.absoluteCenter],strokeColor:r[i],strokeDash:d?void 0:"4 2"})}}return{coordinateSystem:"cartesian",rects:t,lines:n}};function the(e){if(e.courtyard){let t=e.courtyard,n=e.ccwRotationOffset*Math.PI/180,o=TQ(t.offsetFromCenter,n),r=(e.ccwRotationOffset%360+360)%360,i=r===90||r===270,{width:s,height:a}=t;if(i)s=t.height,a=t.width;return[{center:{x:e.center.x+o.x,y:e.center.y+o.y},width:s,height:a}]}return e.pads.map((t)=>({center:{x:t.absoluteCenter.x,y:t.absoluteCenter.y},width:t.size.x,height:t.size.y}))}function R8r({component:e,packedComponents:t,minGap:n}){let o=t.flatMap((i)=>the(i)),r=the(e);for(let i of r)for(let s of o){let{distance:a}=GM(i,s);if(a+0.000001<n)return{hasOverlap:!0,gapDistance:a}}return{hasOverlap:!1}}var whn=class extends co{componentToPack;packedComponents;packPlacementStrategy;minGap;obstacles;boundaryOutline;weightedConnections;getSolverName(){return"SingleComponentPackSolver"}currentPhase="outline";outlines=[];queuedOutlineSegments=[];currentSegmentIndex=0;currentRotationIndex=0;activeSubSolver=null;candidateResults=[];rejectedCandidates=[];bestCandidate;outputPackedComponent;bounds;networkTargetPointMappingsCache=new Map;constructor(e){super();this.componentToPack=e.componentToPack,this.packedComponents=e.packedComponents,this.packPlacementStrategy=e.packPlacementStrategy,this.minGap=e.minGap??0,this.obstacles=e.obstacles??[],this.bounds=e.bounds,this.boundaryOutline=e.boundaryOutline,this.weightedConnections=e.weightedConnections}_setup(){super._setup(),this.currentPhase="outline",this.outlines=[],this.queuedOutlineSegments=[],this.candidateResults=[],this.activeSubSolver=void 0,this.currentSegmentIndex=0,this.currentRotationIndex=0,this.networkTargetPointMappingsCache.clear()}_step(){if(this.solved||this.failed)return;switch(this.currentPhase){case"outline":this.executeOutlinePhase();break;case"segment_candidate":this.executeSegmentCandidatePhase();break;case"evaluate":this.executeEvaluatePhase();break}}executeOutlinePhase(){if(this.packedComponents.length===0){let n=this.componentToPack.availableRotationDegrees??[0,90,180,270],o={x:0,y:0},r=n[0]??0,i=this.createPackedComponent(o,r),s=the(i);if(!(this.obstacles??[]).some((c)=>{let l={center:{x:c.absoluteCenter.x,y:c.absoluteCenter.y},width:c.width,height:c.height};return s.some((h)=>{let{distance:d}=GM(h,l);return d+0.000001<this.minGap})})){this.outputPackedComponent=i,this.solved=!0;return}}this.outlines=I8r(this.packedComponents,{minGap:this.minGap,obstacles:this.obstacles});let e=this.componentToPack.availableRotationDegrees??[0,90,180,270];for(let n=0;n<this.outlines.length;n++){let o=this.outlines[n];for(let r=0;r<o.length;r++){let i=o[r];this.queuedOutlineSegments.push({segment:i,availableRotations:[...e],segmentIndex:n*1000+r,ccwFullOutline:o})}}if(this.boundaryOutline&&this.boundaryOutline.length>=3){let n=[];for(let r=0;r<this.boundaryOutline.length;r++){let i=this.boundaryOutline[r],s=this.boundaryOutline[(r+1)%this.boundaryOutline.length];n.push([i,s])}let o=this.outlines.length;for(let r=0;r<n.length;r++){let i=n[r];this.queuedOutlineSegments.push({segment:i,availableRotations:[...e],segmentIndex:o*1000+r,ccwFullOutline:n})}}let t=this.outlines.length+1;for(let n of this.obstacles){let o=n.width/2+this.minGap,r=n.height/2+this.minGap,i=n.absoluteCenter.x,s=n.absoluteCenter.y,a=[{x:i-o,y:s-r},{x:i+o,y:s-r},{x:i+o,y:s+r},{x:i-o,y:s+r}],c=[[a[0],a[1]],[a[1],a[2]],[a[2],a[3]],[a[3],a[0]]];for(let l=0;l<c.length;l++){let h=c[l];this.queuedOutlineSegments.push({segment:h,availableRotations:[...e],segmentIndex:t*1000+l,ccwFullOutline:c})}t++}this.currentPhase="segment_candidate",this.currentSegmentIndex=0,this.currentRotationIndex=0}executeSegmentCandidatePhase(){if(this.activeSubSolver?.solved||this.activeSubSolver?.failed){let e=this.queuedOutlineSegments[this.currentSegmentIndex],t=e.availableRotations[this.currentRotationIndex],n=1/0,o;if(this.activeSubSolver.solved&&this.activeSubSolver.optimalPosition){o=this.activeSubSolver.optimalPosition;let r=this.createPackedComponent(o,t),{hasOverlap:i,gapDistance:s}=R8r({component:r,packedComponents:this.packedComponents,minGap:this.minGap}),a=1/0,c=the(r),l=(this.obstacles??[]).some((u)=>{let _={center:{x:u.absoluteCenter.x,y:u.absoluteCenter.y},width:u.width,height:u.height};return c.some((p)=>{let{distance:m}=GM(p,_);return a=Math.min(a,m),m+0.000001<this.minGap})}),h=!1;if(this.bounds){let u=kV(r,0);h=u.minX<this.bounds.minX||u.maxX>this.bounds.maxX||u.minY<this.bounds.minY||u.maxY>this.bounds.maxY}let d=!1;if(this.boundaryOutline&&this.boundaryOutline.length>=3){let u=kV(r,0),_=r.pads.every((m)=>Uq(m.absoluteCenter,this.boundaryOutline)),p=[{x:u.minX,y:u.minY},{x:u.minX,y:u.maxY},{x:u.maxX,y:u.minY},{x:u.maxX,y:u.maxY}].every((m)=>Uq(m,this.boundaryOutline));d=!_||!p}if(n=this.calculateDistance(o,t),i)this.rejectedCandidates.push({segment:e.segment,rotation:t,optimalPosition:o,distance:n,segmentIndex:e.segmentIndex,rotationIndex:this.currentRotationIndex,gapDistance:s});else if(l)this.rejectedCandidates.push({segment:e.segment,rotation:t,optimalPosition:o,distance:n,segmentIndex:e.segmentIndex,rotationIndex:this.currentRotationIndex,gapDistance:a});else if(h)this.rejectedCandidates.push({segment:e.segment,rotation:t,optimalPosition:o,distance:n,segmentIndex:e.segmentIndex,rotationIndex:this.currentRotationIndex,gapDistance:-1});else if(d)this.rejectedCandidates.push({segment:e.segment,rotation:t,optimalPosition:o,distance:n,segmentIndex:e.segmentIndex,rotationIndex:this.currentRotationIndex,gapDistance:-1});else this.candidateResults.push({segment:e.segment,rotation:t,optimalPosition:o,distance:n,segmentIndex:e.segmentIndex,rotationIndex:this.currentRotationIndex})}this.currentRotationIndex++,this.activeSubSolver=void 0}while(!this.activeSubSolver){if(this.currentSegmentIndex>=this.queuedOutlineSegments.length){this.currentPhase="evaluate";return}let e=this.queuedOutlineSegments[this.currentSegmentIndex];if(this.currentRotationIndex>=e.availableRotations.length){this.currentSegmentIndex++,this.currentRotationIndex=0;continue}let t=e.availableRotations[this.currentRotationIndex];this.activeSubSolver=new N8r({outlineSegment:e.segment,ccwFullOutline:e.ccwFullOutline,componentRotationDegrees:t,packStrategy:this.packPlacementStrategy,minGap:this.minGap,packedComponents:this.packedComponents,componentToPack:this.componentToPack,obstacles:this.obstacles,globalBounds:this.bounds,boundaryOutline:this.boundaryOutline,weightedConnections:this.weightedConnections,networkTargetPointMappingsCache:this.networkTargetPointMappingsCache}),this.activeSubSolver.setup();break}this.activeSubSolver.step()}executeEvaluatePhase(){if(this.candidateResults.length===0){this.failed=!0,this.error="No valid candidates found";return}if(this.candidateResults.sort((e,t)=>e.distance-t.distance),this.bestCandidate=this.candidateResults[0],this.bestCandidate.optimalPosition)this.outputPackedComponent=this.createPackedComponent(this.bestCandidate.optimalPosition,this.bestCandidate.rotation);this.solved=!0}calculateDistance(e,t){let n=this.createPackedComponent(e,t),o=0,r=this.packPlacementStrategy==="minimum_sum_squared_distance_to_network"||this.packPlacementStrategy==="minimum_closest_sum_squared_distance";for(let i of n.pads){let s=1/0;for(let a of this.packedComponents)for(let c of a.pads)if(c.networkId===i.networkId){if(!R6e(i.padId,c.padId,this.weightedConnections))continue;let l=i.absoluteCenter.x-c.absoluteCenter.x,h=i.absoluteCenter.y-c.absoluteCenter.y,d=Math.sqrt(l*l+h*h);s=Math.min(s,d)}if(s<1/0)o+=r?s*s:s}return o}createPackedComponent(e,t){let n={...this.componentToPack,center:e,ccwRotationOffset:t,pads:this.componentToPack.pads.map((o)=>({...o,absoluteCenter:{x:0,y:0}}))};return N6e(n),n}visualize(){if(this.activeSubSolver)return this.activeSubSolver.visualize();let e=zZe({components:this.packedComponents,minGap:this.minGap,packOrderStrategy:"largest_to_smallest",packPlacementStrategy:this.packPlacementStrategy});if(e.points??=[],e.lines??=[],e.rects??=[],e.texts??=[],e.circles??=[],this.obstacles&&this.obstacles.length>0)for(let t of this.obstacles)e.rects.push({center:t.absoluteCenter,width:t.width,height:t.height,fill:"rgba(0,0,0,0.1)",stroke:"#555",label:t.obstacleId});if(this.bounds)e.lines.push({points:[{x:this.bounds.minX,y:this.bounds.minY},{x:this.bounds.minX,y:this.bounds.maxY},{x:this.bounds.maxX,y:this.bounds.maxY},{x:this.bounds.maxX,y:this.bounds.minY},{x:this.bounds.minX,y:this.bounds.minY}],strokeColor:"rgba(0,0,0,0.5)",strokeDash:"2 2"});if(this.boundaryOutline&&this.boundaryOutline.length){let t=[...this.boundaryOutline];if(t.length>0&&(t[0].x!==t[t.length-1].x||t[0].y!==t[t.length-1].y))t.push({...t[0]});e.lines.push({points:t,strokeColor:"rgba(0, 0, 255, 0.5)",strokeDash:"4 2"})}switch(this.currentPhase){case"outline":this.visualizeOutlinePhase(e);break;case"segment_candidate":this.visualizeSegmentCandidatePhase(e);break;case"evaluate":this.visualizeEvaluatePhase(e);break}return e}visualizeOutlinePhase(e){for(let t of this.outlines)for(let n of t){let[o,r]=n;e.lines.push({points:[o,r],strokeColor:"#ff4444"})}for(let t=0;t<this.outlines.length;t++){let n=this.outlines[t];for(let o=0;o<n.length;o++){let[r,i]=n[o];e.points.push({x:r.x,y:r.y,label:`outlines [${t}] [${o}]`,color:"#ff4444"})}}}visualizeSegmentCandidatePhase(e){if(this.visualizeOutlinePhase(e),this.activeSubSolver){let t=this.activeSubSolver.visualize();if(t.lines)e.lines.push(...t.lines);if(t.points)e.points.push(...t.points);if(t.rects)e.rects.push(...t.rects);if(t.circles)e.circles.push(...t.circles??[])}else for(let t=0;t<this.candidateResults.length;t++){let n=this.candidateResults[t];if(n.optimalPosition){let o=this.createPackedComponent(n.optimalPosition,n.rotation);for(let r of o.pads)e.rects.push({center:r.absoluteCenter,width:r.size.x,height:r.size.y,fill:"rgba(255,165,0,0.3)",stroke:"rgba(255,165,0,0.8)",strokeWidth:1});e.points.push({x:n.optimalPosition.x,y:n.optimalPosition.y,label:`c${t}, d=${n.distance.toFixed(3)}`,color:"rgba(255,165,0,0.8)"})}}}visualizeEvaluatePhase(e){this.visualizeOutlinePhase(e);for(let t=0;t<this.candidateResults.length;t++){let n=this.candidateResults[t];if(!n.optimalPosition)continue;let o=t,r=o===0;e.points.push({x:n.optimalPosition.x,y:n.optimalPosition.y,label:`step=${o}, d=${n.distance.toFixed(3)}`,color:r?"rgba(0,255,0,0.8)":"rgba(255,165,0,0.6)"})}for(let t=0;t<this.rejectedCandidates.length;t++){let n=this.rejectedCandidates[t];if(!n.optimalPosition)continue;e.points.push({x:n.optimalPosition.x,y:n.optimalPosition.y,label:`rejected, d=${n.distance.toFixed(3)}
gap_distance=${n.gapDistance}`,color:"rgba(255,0,0,0.8)"})}if(this.outputPackedComponent)for(let t of this.outputPackedComponent.pads)e.rects.push({center:t.absoluteCenter,width:t.size.x,height:t.size.y,fill:"rgba(0,255,0,0.7)"})}getResult(){return this.outputPackedComponent}getOutput(){return this.getResult()}getConstructorParams(){return{componentToPack:this.componentToPack,packedComponents:this.packedComponents,packPlacementStrategy:this.packPlacementStrategy,minGap:this.minGap,obstacles:this.obstacles,bounds:this.bounds,boundaryOutline:this.boundaryOutline,weightedConnections:this.weightedConnections}}};function Q8r(e){if(e.length<3){let i=e.reduce((a,c)=>a+c.x,0),s=e.reduce((a,c)=>a+c.y,0);return{x:i/e.length,y:s/e.length}}let t=0,n=0,o=0;for(let i=0;i<e.length;i++){let s=e[i],a=e[(i+1)%e.length],c=s.x*a.y-a.x*s.y;t+=c,n+=(s.x+a.x)*c,o+=(s.y+a.y)*c}if(t*=0.5,Math.abs(t)<0.0000000001){let i=e.reduce((a,c)=>a+c.x,0),s=e.reduce((a,c)=>a+c.y,0);return{x:i/e.length,y:s/e.length}}return n/=6*t,o/=6*t,{x:n,y:o}}var Ow=class extends co{packInput;getSolverName(){return"PackSolver2"}unpackedComponentQueue=[];packedComponents=[];componentToPack;constructor(e){super();this.MAX_ITERATIONS=300000,this.packInput=e}getConstructorParams(){return this.packInput}_setup(){let{components:e,packOrderStrategy:t,packFirst:n=[]}=this.packInput,o=e.filter((s)=>{if(s.pads.length===0)return!1;return s.pads.every((a)=>Number.isFinite(a.size.x)&&Number.isFinite(a.size.y)&&a.size.x>0&&a.size.y>0)}),r=o.filter((s)=>s.isStatic),i=o.filter((s)=>!s.isStatic);this.packedComponents=r.map((s)=>{let a={...s,center:s.center??{x:0,y:0},ccwRotationOffset:s.ccwRotationOffset??s.availableRotationDegrees?.[0]??0,pads:s.pads.map((c)=>({...c,absoluteCenter:c.absoluteCenter??{x:0,y:0}}))};return N6e(a),a}),this.unpackedComponentQueue=m8r({components:i,packOrderStrategy:t,packFirst:n})}packFirstComponent(){let e=this.unpackedComponentQueue.shift(),t={x:0,y:0};if(this.packInput.boundaryOutline&&this.packInput.boundaryOutline.length>=3)t=Q8r(this.packInput.boundaryOutline);let n={...e,center:t,ccwRotationOffset:e.ccwRotationOffset??e.availableRotationDegrees?.[0]??0,pads:e.pads.map((l)=>({...l,absoluteCenter:{x:0,y:0}}))};N6e(n);let o=this.packInput.obstacles??[],r=the(n),i=o.some((l)=>{let h={center:{x:l.absoluteCenter.x,y:l.absoluteCenter.y},width:l.width,height:l.height};return r.some((d)=>{let{distance:u}=GM(d,h);return u+0.000001<this.packInput.minGap})}),s=!1;if(this.packInput.boundaryOutline&&this.packInput.boundaryOutline.length>=3){let l=kV(n,0),h=n.pads.every((u)=>Uq(u.absoluteCenter,this.packInput.boundaryOutline)),d=[{x:l.minX,y:l.minY},{x:l.minX,y:l.maxY},{x:l.maxX,y:l.minY},{x:l.maxX,y:l.maxY}].every((u)=>Uq(u,this.packInput.boundaryOutline));s=!h||!d}if(!i&&!s){this.packedComponents.push(n);return}let a=new whn({packedComponents:[],componentToPack:e,packPlacementStrategy:this.packInput.packPlacementStrategy,minGap:this.packInput.minGap,obstacles:o,bounds:this.packInput.bounds,boundaryOutline:this.packInput.boundaryOutline,weightedConnections:this.packInput.weightedConnections});a.solve();let c=a.getResult();if(c)this.packedComponents.push(c);else this.packedComponents.push(n)}_step(){if(this.solved||this.failed)return;if(this.packedComponents.length===0){if(this.unpackedComponentQueue.length===0){this.solved=!0;return}this.packFirstComponent();return}if(!this.activeSubSolver){if(this.unpackedComponentQueue.length===0){this.solved=!0;return}if(this.componentToPack=this.unpackedComponentQueue.shift(),!this.componentToPack){this.solved=!0;return}this.activeSubSolver=new whn({packedComponents:this.packedComponents,componentToPack:this.componentToPack,packPlacementStrategy:this.packInput.packPlacementStrategy,minGap:this.packInput.minGap,obstacles:this.packInput.obstacles??[],bounds:this.packInput.bounds,boundaryOutline:this.packInput.boundaryOutline,weightedConnections:this.packInput.weightedConnections}),this.activeSubSolver.setup()}if(this.activeSubSolver.step(),this.activeSubSolver.failed){this.failed=!0;return}if(this.activeSubSolver.solved){let e=this.activeSubSolver.getResult();if(e)this.packedComponents.push(e);else{let t={...this.componentToPack,center:{x:0,y:0},ccwRotationOffset:this.componentToPack?.ccwRotationOffset??this.componentToPack?.availableRotationDegrees?.[0]??0,pads:this.componentToPack.pads.map((n)=>({...n,absoluteCenter:{x:0,y:0}}))};N6e(t),this.packedComponents.push(t)}this.componentToPack=void 0,this.activeSubSolver=void 0}}visualize(){if(this.activeSubSolver)return this.activeSubSolver.visualize();let e={coordinateSystem:"cartesian",title:"Pack Solver 2",points:[],lines:[],rects:[],circles:[],texts:[],arrows:[]};if(this.packInput.obstacles&&this.packInput.obstacles.length>0)for(let o of this.packInput.obstacles)e.rects.push({center:o.absoluteCenter,width:o.width,height:o.height,fill:"rgba(0,0,0,0.1)",stroke:"#555",label:o.obstacleId});if(this.packInput.bounds)e.lines.push({points:[{x:this.packInput.bounds.minX,y:this.packInput.bounds.minY},{x:this.packInput.bounds.minX,y:this.packInput.bounds.maxY},{x:this.packInput.bounds.maxX,y:this.packInput.bounds.maxY},{x:this.packInput.bounds.maxX,y:this.packInput.bounds.minY},{x:this.packInput.bounds.minX,y:this.packInput.bounds.minY}],strokeColor:"rgba(0,0,0,0.5)",strokeDash:"2 2"});if(this.packInput.boundaryOutline&&this.packInput.boundaryOutline.length){let o=[...this.packInput.boundaryOutline];if(o.length>0&&(o[0].x!==o[o.length-1].x||o[0].y!==o[o.length-1].y))o.push({...o[0]});e.lines.push({points:o,strokeColor:"rgba(0, 0, 255, 0.5)",strokeDash:"4 2"})}if(this.packedComponents.length===0)for(let o of this.unpackedComponentQueue)for(let r of o.pads)e.rects.push({center:{x:0,y:0},width:r.size.x,height:r.size.y,fill:"rgba(0,0,0,0.1)"});let t=this.packedComponents.flatMap((o)=>o.pads),n=new Map;for(let o of t)if(o.networkId)n.set(o.networkId,[...n.get(o.networkId)||[],o]);for(let o of t)e.rects.push({center:o.absoluteCenter,width:o.size.x,height:o.size.y,fill:"rgba(255,0,0,0.5)"});for(let[o,r]of n.entries())for(let i=0;i<r.length;i++)for(let s=i+1;s<r.length;s++){let a=r[i],c=r[s];e.lines.push({points:[a.absoluteCenter,c.absoluteCenter],strokeColor:FZe(o,0.5)})}return e}getOutput(){return{packedComponents:this.packedComponents,unpackedComponents:this.unpackedComponentQueue}}},Nhn=(e)=>{let t=new Ow(e);return t.solve(),{...e,components:t.packedComponents}},k8r=(e)=>{if(!e||e.length===0)return{minX:0,maxX:0,minY:0,maxY:0};let t=1/0,n=1/0,o=-1/0,r=-1/0;for(let i of e)t=Math.min(t,i.x),o=Math.max(o,i.x),n=Math.min(n,i.y),r=Math.max(r,i.y);return{minX:t,maxX:o,minY:n,maxY:r}},kZe=(e)=>{let{width:t,height:n,ccwRotationDegrees:o}=e,r=o*Math.PI/180,i=(c)=>{let l=Math.abs(c);if(l<0.000000000001)return 0;if(Math.abs(l-1)<0.000000000001)return 1;return l},s=i(Math.cos(r)),a=i(Math.sin(r));return{width:t*s+n*a,height:t*a+n*s}},Rhn=(e,t,n)=>{let o=[],r=({padId:i,pcbPortId:s,sx:a,sy:c,x:l,y:h})=>o.push({padId:i,networkId:n(s),size:{x:a,y:c},absoluteCenter:{x:l,y:h},pcbPortId:s});for(let i of t.pcb_via.list({pcb_component_id:e.pcb_component_id}))r({padId:i.pcb_via_id,pcbPortId:i.pcb_port_id,sx:i.outer_diameter??i.hole_diameter??0,sy:i.outer_diameter??i.hole_diameter??0,x:i.x,y:i.y});for(let i of t.pcb_plated_hole.list({pcb_component_id:e.pcb_component_id}))switch(i.shape){case"circle":{r({padId:i.pcb_plated_hole_id,pcbPortId:i.pcb_port_id,sx:i.outer_diameter??i.hole_diameter??0,sy:i.outer_diameter??i.hole_diameter??0,x:i.x,y:i.y});break}case"oval":case"pill":{let s=kZe({width:i.outer_width,height:i.outer_height,ccwRotationDegrees:i.ccw_rotation});r({padId:i.pcb_plated_hole_id,pcbPortId:i.pcb_port_id,sx:s.width,sy:s.height,x:i.x,y:i.y});break}case"circular_hole_with_rect_pad":{r({padId:i.pcb_plated_hole_id,pcbPortId:i.pcb_port_id,sx:i.rect_pad_width,sy:i.rect_pad_height,x:i.x,y:i.y});break}case"pill_hole_with_rect_pad":{r({padId:i.pcb_plated_hole_id,pcbPortId:i.pcb_port_id,sx:i.rect_pad_width,sy:i.rect_pad_height,x:i.x,y:i.y});break}case"rotated_pill_hole_with_rect_pad":{let s=kZe({width:i.rect_pad_width,height:i.rect_pad_height,ccwRotationDegrees:i.rect_ccw_rotation});r({padId:i.pcb_plated_hole_id,pcbPortId:i.pcb_port_id,sx:s.width,sy:s.height,x:i.x,y:i.y});break}default:{console.warn(`Unsupported plated hole shape ${i.shape}`);break}}for(let i of t.pcb_smtpad.list({pcb_component_id:e.pcb_component_id}))switch(i.shape){case"rect":{r({padId:i.pcb_smtpad_id,pcbPortId:i.pcb_port_id,sx:i.width??0,sy:i.height??0,x:i.x,y:i.y});break}case"pill":{r({padId:i.pcb_smtpad_id,pcbPortId:i.pcb_port_id,sx:i.width,sy:i.height,x:i.x,y:i.y});break}case"rotated_rect":case"rotated_pill":{let s=kZe({width:i.width,height:i.height,ccwRotationDegrees:i.ccw_rotation});r({padId:i.pcb_smtpad_id,pcbPortId:i.pcb_port_id,sx:s.width,sy:s.height,x:i.x,y:i.y});break}case"circle":{r({padId:i.pcb_smtpad_id,pcbPortId:i.pcb_port_id,sx:i.radius*2,sy:i.radius*2,x:i.x,y:i.y});break}case"polygon":{if(i.points&&i.points.length>0){let{minX:s,maxX:a,minY:c,maxY:l}=k8r(i.points),h=a-s,d=l-c,u=(s+a)/2,_=(c+l)/2;r({padId:i.pcb_smtpad_id,pcbPortId:i.pcb_port_id,sx:h,sy:d,x:u,y:_})}else console.warn(`Polygon pad ${i.pcb_smtpad_id} has no points`);break}}return o},L8r=(e,t)=>{let n=new Set,o=(i)=>{if(!i)return;if(i.nodeType==="component"){let s=i.otherChildElements?.[0]?.pcb_component_id;if(s)n.add(s)}for(let s of i.childNodes??[])o(s)};o(t);let r=[];for(let i of e.pcb_plated_hole.list({})){if(!("pcb_component_id"in i)||!i.pcb_component_id){r.push(i);continue}if(!n.has(i.pcb_component_id))r.push(i)}for(let i of e.pcb_hole.list({}))r.push(i);return r},H8r=(e,t,n)=>{let o=n*Math.PI/180,r=Math.abs(Math.cos(o)),i=Math.abs(Math.sin(o));return{width:e*r+t*i,height:e*i+t*r}},F8r=(e)=>{if(e.type==="pcb_plated_hole"&&e.shape==="circular_hole_with_rect_pad"){let{rect_pad_height:t,rect_pad_width:n,x:o,y:r}=e;return{obstacleId:e.pcb_plated_hole_id,absoluteCenter:{x:o,y:r},width:n,height:t}}if(e.type==="pcb_plated_hole"&&e.shape==="rotated_pill_hole_with_rect_pad"){let{rect_pad_height:t,rect_pad_width:n,rect_ccw_rotation:o,x:r,y:i}=e,s=H8r(n,t,o);return{obstacleId:e.pcb_plated_hole_id,absoluteCenter:{x:r,y:i},width:s.width,height:s.height}}if(e.type==="pcb_hole"){let{x:t,y:n,pcb_hole_id:o}=e,r="hole_diameter"in e?e.hole_diameter:e.hole_width,i="hole_diameter"in e?e.hole_diameter:e.hole_height;return{obstacleId:o,absoluteCenter:{x:t,y:n},width:r,height:i}}return},Qhn=(e)=>{let{db:t,pcbComponentIds:n,componentCenter:o}=e;if(Array.from(new Set(n)).length!==1)return;let i=new Set(n),s=1/0,a=1/0,c=-1/0,l=-1/0,h=!1;for(let _ of t.pcb_courtyard_rect.list()){if(!i.has(_.pcb_component_id))continue;s=Math.min(s,_.center.x-_.width/2),c=Math.max(c,_.center.x+_.width/2),a=Math.min(a,_.center.y-_.height/2),l=Math.max(l,_.center.y+_.height/2),h=!0}for(let _ of t.pcb_courtyard_polygon.list()){if(!i.has(_.pcb_component_id))continue;for(let p of _.points)s=Math.min(s,p.x),c=Math.max(c,p.x),a=Math.min(a,p.y),l=Math.max(l,p.y);h=!0}for(let _ of t.pcb_courtyard_outline.list()){if(!i.has(_.pcb_component_id))continue;for(let p of _.outline)s=Math.min(s,p.x),c=Math.max(c,p.x),a=Math.min(a,p.y),l=Math.max(l,p.y);h=!0}for(let _ of t.pcb_courtyard_circle.list()){if(!i.has(_.pcb_component_id))continue;s=Math.min(s,_.center.x-_.radius),c=Math.max(c,_.center.x+_.radius),a=Math.min(a,_.center.y-_.radius),l=Math.max(l,_.center.y+_.radius),h=!0}if(!h)return;let d=(s+c)/2,u=(a+l)/2;return{offsetFromCenter:{x:d-o.x,y:u-o.y},width:c-s,height:l-a}},Bhn=(e,t,n,o,r,i=new Map,s={},a=!1)=>{let c=e.flatMap((A)=>{let g=Rhn(A,n,o),f=s[A.pcb_component_id];if(!f)return g;return g.map((y)=>({...y,size:{x:y.size.x+f.left+f.right,y:y.size.y+f.top+f.bottom},absoluteCenter:{x:y.absoluteCenter.x+(f.right-f.left)/2,y:y.absoluteCenter.y+(f.top-f.bottom)/2}}))}),l=1/0,h=1/0,d=-1/0,u=-1/0;for(let A of c)l=Math.min(l,A.absoluteCenter.x-A.size.x/2),d=Math.max(d,A.absoluteCenter.x+A.size.x/2),h=Math.min(h,A.absoluteCenter.y-A.size.y/2),u=Math.max(u,A.absoluteCenter.y+A.size.y/2);let _={x:(l+d)/2,y:(h+u)/2},p=c.map((A)=>({padId:A.padId,networkId:A.networkId,type:"rect",size:A.size,absoluteCenter:A.absoluteCenter,offset:{x:A.absoluteCenter.x-_.x,y:A.absoluteCenter.y-_.y}}));for(let A of c){if(!A.pcbPortId)continue;let g=n.pcb_port.get(A.pcbPortId)?.source_port_id;if(!g)continue;let f=i.get(g)??[];f.push(A.padId),i.set(g,f)}if(r){let A={padId:`${t}-inner`,networkId:`${t}-inner`,type:"rect",size:{x:d-l,y:u-h},absoluteCenter:_,offset:{x:0,y:0}};p.push(A)}let m=Qhn({db:n,pcbComponentIds:e.map((A)=>A.pcb_component_id),componentCenter:_});return{componentId:t,isStatic:a,center:_,ccwRotationOffset:0,pads:p,courtyard:m}},khn=(e,t)=>{if(e.nodeType==="component"){let n=e.otherChildElements[0]?.pcb_component_id;return n?[t.pcb_component.get(n)]:[]}return e.childNodes.flatMap((n)=>khn(n,t))},Lhn=(e,t={})=>{let n={components:[],minGap:0,packOrderStrategy:"largest_to_smallest",packPlacementStrategy:"shortest_connection_along_outline",obstacles:t.obstacles??[]},o=CM(e,{source_group_id:t.source_group_id}),r=As(e),i=0,s=new Map,a=L8r(r,o),c=e.find((f)=>f.type==="pcb_board");if(c?.outline)n.boundaryOutline=c.outline;let l=(f)=>{if(f){let y=r.pcb_port.get(f);if(y){let x=r.source_port.get(y.source_port_id);if(x?.subcircuit_connectivity_map_key)return x.subcircuit_connectivity_map_key}}return`unnamed${i++}`},h=o.childNodes??[],d=(f)=>{let y=[];if(f.nodeType==="component"){let x=f.otherChildElements.find((C)=>C.type==="pcb_component");if(x&&x.position_mode==="relative_to_group_anchor")y.push(x)}for(let x of f.childNodes??[])y.push(...d(x));return y},u=new Set(t.staticPcbComponentIds??[]),_=new Set;for(let f of h)if(f.nodeType==="component"){let y=f.otherChildElements.find((C)=>C.type==="pcb_component");if(!y)continue;if(y.position_mode==="relative_to_group_anchor"&&!u.has(y.pcb_component_id))continue;let x=t.shouldAddInnerObstacles??!1;if(y.obstructs_within_bounds===!0)x=!0;else if(y.obstructs_within_bounds===!1)x=!1;n.components.push(Bhn([y],y.pcb_component_id,r,l,x,s,t.chipMarginsMap,u.has(y.pcb_component_id)))}else if(f.nodeType==="group"){let y=khn(f,r);if(!y.length)continue;for(let C of y)_.add(C.pcb_component_id);let x=f.sourceGroup?.source_group_id??f.sourceGroup?.name??`group_${n.components.length}`;n.components.push(Bhn(y,x,r,l,void 0,s,t.chipMarginsMap,u.has(x)))}let p=h.flatMap((f)=>d(f));for(let f of p){if(u.has(f.pcb_component_id))continue;if(_.has(f.pcb_component_id))continue;let y=Qhn({db:r,pcbComponentIds:[f.pcb_component_id],componentCenter:f.center});if(y){n.obstacles.push({obstacleId:f.pcb_component_id,absoluteCenter:{x:f.center.x+y.offsetFromCenter.x,y:f.center.y+y.offsetFromCenter.y},width:y.width,height:y.height});continue}let x=Rhn(f,r,l);if(x.length===0)continue;let C=1/0,b=1/0,I=-1/0,v=-1/0;for(let T of x)C=Math.min(C,T.absoluteCenter.x-T.size.x/2),I=Math.max(I,T.absoluteCenter.x+T.size.x/2),b=Math.min(b,T.absoluteCenter.y-T.size.y/2),v=Math.max(v,T.absoluteCenter.y+T.size.y/2);let P={x:(C+I)/2,y:(b+v)/2},M=I-C,B=v-b;n.obstacles.push({obstacleId:f.pcb_component_id,absoluteCenter:P,width:M,height:B})}for(let f of a){let y=F8r(f);if(y)n.obstacles.push(y)}let m=[],A=new Set,g=typeof r.source_trace.list==="function"?r.source_trace.list():e.filter((f)=>f.type==="source_trace");for(let f of g){let y=f.connected_source_port_ids||[],x=f.connected_source_net_ids||[];if(!(y.length===2&&x.length===0))continue;let[b,I]=y,v=b?s.get(b)??[]:[],P=I?s.get(I)??[]:[];for(let M of v)for(let B of P){let T=[M,B].sort().join("--");if(A.has(T))continue;m.push({padIds:[M,B],weight:1,ignoreWeakConnections:!0}),A.add(T)}}if(m.length>0)n.weightedConnections=m;return n},Hhn=(e)=>{let t=e.components.map((n)=>({...n.isStatic?{...n,pads:n.pads.map((o)=>({...o}))}:{componentId:n.componentId,availableRotationDegrees:n.availableRotationDegrees,pads:n.pads.map(({absoluteCenter:o,...r})=>r),courtyard:n.courtyard}}));return{...e,components:t}};var X6e=Qe(wt(),1);var CA=class{MAX_ITERATIONS=200000;solved=!1;failed=!1;iterations=0;progress=0;error=null;activeSubSolver;failedSubSolvers;timeToSolve;stats={};step(){if(this.solved)return;if(this.failed)return;this.iterations++;try{this._step()}catch(e){throw this.error=`${this.constructor.name} error: ${e}`,this.failed=!0,e}if(!this.solved&&this.iterations>this.MAX_ITERATIONS)this.tryFinalAcceptance();if(!this.solved&&this.iterations>this.MAX_ITERATIONS)this.error=`${this.constructor.name} ran out of iterations`,this.failed=!0;if("computeProgress"in this)this.progress=this.computeProgress()}_step(){}getConstructorParams(){throw Error("getConstructorParams not implemented")}solve(){let e=Date.now();while(!this.solved&&!this.failed)this.step();let t=Date.now();this.timeToSolve=t-e}visualize(){return{lines:[],points:[],rects:[],circles:[]}}tryFinalAcceptance(){}preview(){return{lines:[],points:[],rects:[],circles:[]}}};function OZe(e,t){let n=t*Math.PI/180,o=Math.cos(n),r=Math.sin(n);return{x:e.x*o-e.y*r,y:e.x*r+e.y*o}}function z8r(e,t,n){let o=(n%360+360)%360;if(Math.round((o+90)%180)===0)return{width:t,height:e};return{width:e,height:t}}function O8r(e,t){let n=Math.min(e,t);return Math.min(0.35,Math.max(0.08,n*0.22))}function V8r(e,t=!1){let n=e.charAt(0).toUpperCase();if(t){if(n==="C")return"rgba(30, 64, 175, 0.35)";if(n==="R")return"rgba(5, 150, 105, 0.35)";if(n==="L")return"rgba(126, 34, 206, 0.35)";if(n==="U")return"rgba(180, 83, 9, 0.35)"}if(n==="C")return"rgba(59, 130, 246, 0.18)";if(n==="R")return"rgba(16, 185, 129, 0.18)";if(n==="L")return"rgba(168, 85, 247, 0.18)";if(n==="U")return"rgba(245, 158, 11, 0.18)";return"rgba(59, 130, 246, 0.12)"}function X0(e,t){let n={points:[],rects:[],lines:[],circles:[],texts:[]},o={};for(let a of Object.keys(e.netConnMap)){let[c,l]=a.split("-");o[c]=l}for(let[a,c]of Object.entries(e.chipMap)){let l=c.pins.map((g)=>e.chipPinMap[g]),h=t.chipPlacements[a];if(!h)continue;let d,u;if(c.size&&Number.isFinite(c.size.x)&&Number.isFinite(c.size.y))d=c.size.x,u=c.size.y;else{let g=l.map((I)=>I.offset.x),f=l.map((I)=>I.offset.y),y=g.length?Math.min(...g):-5,x=g.length?Math.max(...g):5,C=f.length?Math.min(...f):-5,b=f.length?Math.max(...f):5;d=Math.max(10,x-y+6),u=Math.max(10,b-C+6)}let{x:_,y:p}=h,m=z8r(d,u,h.ccwRotationDegrees),A=c.fixedPosition?`${a} [fixed]`:a;n.rects.push({center:{x:_,y:p},width:m.width,height:m.height,label:A,fill:V8r(a,Boolean(c.fixedPosition)),stroke:"none"}),n.texts.push({x:_,y:p,text:A,fontSize:O8r(m.width,m.height)});for(let g of l){let f=OZe(g.offset,h.ccwRotationDegrees),y=h.x+f.x,x=h.y+f.y,C=o[g.pinId],b=C?`${g.pinId} (${C})`:g.pinId;n.points.push({x:y,y:x,label:b})}}let r={};for(let[a,c]of Object.entries(o)){if(!r[c])r[c]=[];r[c].push(a)}for(let[,a]of Object.entries(r)){let c=a.map((l)=>{let h=e.chipPinMap[l];if(h){for(let[d,u]of Object.entries(e.chipMap))if(u.pins.includes(l)){let _=t.chipPlacements[d];if(_){let p=OZe(h.offset,_.ccwRotationDegrees);return{x:_.x+p.x,y:_.y+p.y}}}return h.offset}return null}).filter(Boolean);for(let l=0;l<c.length;l++)for(let h=l+1;h<c.length;h++)n.lines.push({points:[c[l],c[h]],strokeColor:"rgba(0,0,0,0.1)"})}let i=(a)=>{let c=e.chipPinMap[a];if(c){for(let[l,h]of Object.entries(e.chipMap))if(h.pins.includes(a)){let d=t.chipPlacements[l];if(d){let u=OZe(c.offset,d.ccwRotationDegrees);return{x:d.x+u.x,y:d.y+u.y}}}return c.offset}return null},s=new Set;for(let[a,c]of Object.entries(e.pinStrongConnMap)){if(!c)continue;let[l,h]=a.split("-"),d=l<h?`${l}-${h}`:`${h}-${l}`;if(s.has(d))continue;s.add(d);let u=i(l),_=i(h);if(!u||!_)continue;n.lines.push({points:[u,_]})}return n}var Y8r=(e)=>JSON.stringify(e),VZe=new Map;function Vw(e){let t=Y8r(e);if(VZe.has(t))return structuredClone(VZe.get(t));let n=Object.entries(e.chipMap).map(([s,a])=>{let l=a.pins.map((d)=>e.chipPinMap[d]).map((d)=>{let u=d.pinId;for(let[_,p]of Object.entries(e.pinStrongConnMap))if(p&&_.includes(d.pinId)){let[m,A]=_.split("-");if(m===d.pinId||A===d.pinId){u=[m,A].sort().join("_");break}}return{padId:d.pinId,networkId:u,type:"rect",offset:d.offset,size:{x:0.001,y:0.001}}});l.push({padId:`${s}-body`,networkId:s,type:"rect",offset:{x:0,y:0},size:{x:a.size.x,y:a.size.y}});let h=a.availableRotations?.[0]??0;return{componentId:s,pads:l,availableRotationDegrees:a.availableRotations??[0,90,180,270],...a.fixedPosition&&{isStatic:!0,center:a.fixedPosition,ccwRotationOffset:h}}}),o=Nhn({components:n,minGap:0.4,packOrderStrategy:"largest_to_smallest",packPlacementStrategy:"shortest_connection_along_outline"}),r={};for(let s of o.components)r[s.componentId]={x:s.center.x,y:s.center.y,ccwRotationDegrees:s.ccwRotationOffset};let i={chipPlacements:r,groupPlacements:{}};return VZe.set(t,i),structuredClone(i)}var HV=(e)=>{let t=new Map;for(let n of Object.values(e.chipMap))for(let o of n.pins)t.set(o,n);return t},Kq=(e)=>{let t={},n=Object.keys(e.chipPinMap);for(let o=0;o<n.length;o++)for(let r=o+1;r<n.length;r++){let i=n[o],s=n[r];if(e.pinStrongConnMap[`${i}-${s}`]||e.pinStrongConnMap[`${s}-${i}`])t[i]??=[],t[s]??=[],t[i].push(e.chipPinMap[s]),t[s].push(e.chipPinMap[i])}return t},G8r=class extends CA{inputProblem;partitions=[];decouplingCapGroups;crystalCircuitGroups;constructor({inputProblem:e,decouplingCapGroups:t,crystalCircuitGroups:n}){super();this.inputProblem=e,this.decouplingCapGroups=t,this.crystalCircuitGroups=n}_step(){this.partitions=this.createPartitions(this.inputProblem),this.solved=!0}createPartitions(e){let t=Object.keys(e.chipMap),n=new Set,o=[];for(let u of this.crystalCircuitGroups??[]){let _=[u.crystalChipId,...u.loadCaps.map((p)=>p.chipId),...u.seriesResistors.map((p)=>p.chipId)].filter((p)=>e.chipMap[p]);if(_.length<3)continue;o.push({chipIds:_,group:u});for(let p of _)n.add(p)}let r=new Set,i=[],s=Kq(e);if(this.decouplingCapGroups&&this.decouplingCapGroups.length>0)for(let u of this.decouplingCapGroups){let _=[];for(let p of u.decouplingCapChipIds)if(e.chipMap[p]&&!n.has(p))_.push(p);if(_.length===1){let p=e.chipMap[_[0]],m=e.chipMap[u.mainChipId];if(!m||m.pins.length<=2||[...p.pins,...m.pins].some((A)=>s[A]?.length))continue}if(_.length>=1){i.push(_);for(let p of _)r.add(p)}}let a=t.filter((u)=>!r.has(u)&&!n.has(u)),c=new Map,l=HV(e);for(let u of a)c.set(u,new Set);for(let[u,_]of Object.entries(e.pinStrongConnMap)){if(!_)continue;let[p,m]=u.split("-"),A=l.get(p)?.chipId,g=l.get(m)?.chipId;if(A&&g&&A!==g&&!r.has(A)&&!r.has(g)&&!n.has(A)&&!n.has(g))c.get(A).add(g),c.get(g).add(A)}let h=new Set,d=[];for(let u of a)if(!h.has(u)){let _=this.dfs(u,c,h);if(_.length>0)d.push(_)}return[...o.map(({chipIds:u,group:_})=>this.createInputProblemFromPartition(u,e,{partitionType:"crystal_circuit",crystalCircuitGroup:_})),...i.map((u)=>{let _=this.decouplingCapGroups?.find((p)=>p.decouplingCapChipIds.some((m)=>u.includes(m)));return this.createInputProblemFromPartition(u,e,{partitionType:"decoupling_caps",decouplingMainChipId:_?.mainChipId,decouplingMainChipSide:_?.mainChipSide})}),...d.map((u)=>this.createInputProblemFromPartition(u,e))]}dfs(e,t,n){let o=[],r=[e];while(r.length>0){let i=r.pop();if(n.has(i))continue;n.add(i),o.push(i);let s=t.get(i)||new Set;for(let a of s)if(!n.has(a))r.push(a)}return o}createInputProblemFromPartition(e,t,n){let o=e,r=new Set;for(let d of o){let u=t.chipMap[d];for(let _ of u.pins)r.add(_)}let i={},s={},a={},c={},l={};for(let d of o)i[d]=t.chipMap[d];for(let d of r)if(t.chipPinMap[d])s[d]=t.chipPinMap[d];for(let[d,u]of Object.entries(t.pinStrongConnMap)){let[_,p]=d.split("-");if(r.has(_)&&r.has(p))c[d]=u}let h=new Set;for(let[d,u]of Object.entries(t.netConnMap)){if(!u)continue;let[_,p]=d.split("-");if(r.has(_))h.add(p),l[d]=u}for(let d of h)if(t.netMap[d])a[d]=t.netMap[d];return{...t,chipMap:i,chipPinMap:s,netMap:a,pinStrongConnMap:c,netConnMap:l,isPartition:!0,partitionType:n?.partitionType,decouplingMainChipId:n?.decouplingMainChipId,decouplingMainChipSide:n?.decouplingMainChipSide,crystalCircuitGroup:n?.crystalCircuitGroup}}visualize(){if(this.partitions.length===0){let n=Vw(this.inputProblem);return X0(this.inputProblem,n)}let e=this.partitions.map((n)=>{let o=Vw(n);return X0(n,o)}),t=this.partitions.map((n,o)=>`partition${o}`);return hR(e,{titles:t})}},U8r=(e,t=1)=>{let n=0;for(let o=0;o<e.length;o++){let r=e.charCodeAt(o);n=(n<<5)-n+r,n=n&n}return`hsl(${Math.abs(n)%360}, 70%, 50%, ${t})`},gdn=(e)=>(Math.round(e/90)*90%360+360)%360,us=(e,t)=>{switch(gdn(t)){case 90:return{x:-e.y,y:e.x};case 180:return{x:-e.x,y:-e.y};case 270:return{x:e.y,y:-e.x};default:return{x:e.x,y:e.y}}},Ou=(e,t)=>{let n=gdn(t);if(n===90||n===270)return{x:e.y,y:e.x};return{x:e.x,y:e.y}},Adn=({inputProblem:e,netIds:t})=>{let n=t.filter((i)=>e.netMap[i]?.isPositiveVoltageSource);if(n.length===1)return n[0];let o=t.filter((i)=>e.netMap[i]?.isGround),r=t.filter((i)=>{let s=e.netMap[i];if(!s)return!1;return!s.isGround});if(o.length!==1||r.length!==1)return null;return r[0]},W8r=2,X8r=(e,t)=>e[0]===t[0]&&e[1]===t[1],j8r=({groundedCapacitorsWithoutPowerMetadata:e})=>{let t=[];for(let n of e){let o=t.find((r)=>X8r(r.netPair,n.netPair));if(o){o.capacitorChipIds.push(n.capacitorChipId);continue}t.push({capacitorChipIds:[n.capacitorChipId],netPair:n.netPair})}return t.filter((n)=>n.capacitorChipIds.length>=W8r)},K8r=class extends CA{inputProblem;queuedChips;outputDecouplingCapGroups=[];groundedCapacitorsWithoutPowerMetadata=[];groupsByMainChipId=new Map;constructor(e){super();this.inputProblem=e,this.queuedChips=Object.values(e.chipMap)}isTwoPinRestrictedRotation(e){if(e.pins.length!==2)return!1;if(!e.availableRotations)return!1;let t=new Set([0,180]);return e.availableRotations.length>0&&(e.availableRotations.length===1||e.availableRotations.every((n)=>t.has(n)))}pinsOnOppositeYSidesAfterRotation(e){if(e.pins.length!==2)return!1;let[t,n]=e.pins,o=this.inputProblem.chipPinMap[t],r=this.inputProblem.chipPinMap[n];if(!o||!r)return!1;let i=e.availableRotations?.[0]??0,s=us(o.offset,i),a=us(r.offset,i),c=Math.abs(s.y-a.y);return c>0&&c>=Math.abs(s.x-a.x)}getStronglyConnectedNeighborChips(e){let t=new Set;for(let[n,o]of Object.entries(this.inputProblem.pinStrongConnMap)){if(!o)continue;let[r,i]=n.split("-");if(r===e){let s=i.split(".")[0];t.add(s)}else if(i===e){let s=r.split(".")[0];t.add(s)}}return t}findMainChipIdForCap(e,t){return this.findStronglyConnectedMainChipId(e)??this.findRailSharingMainChipId(e,t)??this.findUniqueMainChipSharingNetPair(t)}findUniqueMainChipSharingNetPair(e){let t=Object.values(this.inputProblem.chipMap).filter((n)=>!n.isCapacitor&&e.every((o)=>n.pins.some((r)=>this.getNetIdsForPin(r).has(o))));return t.length===1?t[0].chipId:null}findStronglyConnectedMainChipId(e){let t=new Map;for(let r of e.pins){let i=this.getStronglyConnectedNeighborChips(r);for(let s of i){if(s===e.chipId)continue;let a=t.get(s)||0;t.set(s,a+1)}}let n=null,o=0;for(let[r,i]of t){if(i<o)continue;if(n!==null&&i===o&&r>n)continue;n=r,o=i}return n}findRailSharingMainChipId(e,t){for(let n of Object.values(this.inputProblem.chipMap)){if(n.chipId===e.chipId)continue;if(!n.isCapacitor)continue;let o=this.getNormalizedNetPair(n);if(!o||o[0]!==t[0]||o[1]!==t[1])continue;let r=this.findStronglyConnectedMainChipId(n);if(r)return r}return null}getNetIdsForPin(e){let t=new Set;for(let[n,o]of Object.entries(this.inputProblem.netConnMap)){if(!o)continue;let[r,i]=n.split("-");if(r===e)t.add(i)}return t}getNormalizedNetPair(e){if(e.pins.length!==2)return null;let t=new Set;for(let r of e.pins){let i=this.getNetIdsForPin(r);for(let s of i)t.add(s)}if(t.size!==2)return null;let[n,o]=Array.from(t).sort();return[n,o]}addToGroup(e,t,n){let[o,r]=t,i=`${e}__${o}__${r}`,s=this.groupsByMainChipId.get(i);if(!s)s={decouplingCapGroupId:`decap_group_${e}__${o}__${r}`,mainChipId:e,mainChipSide:this.getMainChipSide(e,t),netPair:[o,r],decouplingCapChipIds:[]},this.groupsByMainChipId.set(i,s),this.outputDecouplingCapGroups.push(s);if(!s.decouplingCapChipIds.includes(n))s.decouplingCapChipIds.push(n)}getMainChipSide(e,t){let n=this.inputProblem.chipMap[e];if(!n)return null;let o=Adn({inputProblem:this.inputProblem,netIds:t});if(!o)return null;let r=new Map;for(let a of n.pins){let c=this.inputProblem.chipPinMap[a];if(!c)continue;if(!this.getNetIdsForPin(a).has(o))continue;r.set(c.side,(r.get(c.side)??0)+1)}let i=null,s=0;for(let[a,c]of r){if(c<=s)continue;i=a,s=c}return i}lastChip=null;addGroundedCapacitorGroupsWithoutPowerMetadata(){let e=j8r({groundedCapacitorsWithoutPowerMetadata:this.groundedCapacitorsWithoutPowerMetadata});for(let t of e){let n=this.findUniqueMainChipSharingNetPair(t.netPair);if(!n)continue;for(let o of t.capacitorChipIds)this.addToGroup(n,t.netPair,o)}}_step(){let e=this.queuedChips.shift();if(this.lastChip=e??null,!e){this.addGroundedCapacitorGroupsWithoutPowerMetadata(),this.solved=!0;return}if(!e.isCapacitor)return;if(!(this.isTwoPinRestrictedRotation(e)&&this.pinsOnOppositeYSidesAfterRotation(e)))return;let n=this.getNormalizedNetPair(e);if(!n)return;let[o,r]=n,i=this.inputProblem.netMap[o],s=this.inputProblem.netMap[r];if(!(i?.isGround&&s?.isPositiveVoltageSource||s?.isGround&&i?.isPositiveVoltageSource)){if(n.filter((h)=>this.inputProblem.netMap[h]?.isGround).length===1)this.groundedCapacitorsWithoutPowerMetadata.push({capacitorChipId:e.chipId,netPair:n});return}let c=this.findMainChipIdForCap(e,n);if(!c)return;this.addToGroup(c,n,e.chipId)}visualize(){let e=Vw(this.inputProblem),t=X0(this.inputProblem,e),n=new Map;for(let o of this.outputDecouplingCapGroups){n.set(o.mainChipId,o);for(let r of o.decouplingCapChipIds)n.set(r,o)}for(let o of t.rects||[])if(o.label!==this.lastChip?.chipId)o.fill="rgba(0,0,0,0.5)";for(let o of t.rects||[]){let r=o.label,i=n.get(r);if(!i)continue;o.label=`${o.label}
${i.decouplingCapGroupId}`,o.fill=U8r(i.decouplingCapGroupId,0.8)}return t}getConstructorParams(){return[this.inputProblem]}computeProgress(){let e=Object.keys(this.inputProblem.chipMap).length||1,t=e-this.queuedChips.length;return Math.min(1,Math.max(0,t/e))}},$8r=class extends CA{inputProblem;queuedCrystals;outputCrystalCircuitGroups=[];constructor(e){super();this.inputProblem=e,this.queuedCrystals=Object.values(e.chipMap).filter((t)=>t.isCrystal)}getNetIdsForPin(e){let t=new Set;for(let n of Object.keys(this.inputProblem.netMap))if(this.inputProblem.netConnMap[`${e}-${n}`])t.add(n);return t}pinsAreConnected(e,t){if(this.inputProblem.pinStrongConnMap[`${e}-${t}`]||this.inputProblem.pinStrongConnMap[`${t}-${e}`])return!0;let n=this.getNetIdsForPin(e);return Array.from(this.getNetIdsForPin(t)).some((o)=>n.has(o))}getGroundNetId(e){for(let t of this.getNetIdsForPin(e))if(this.inputProblem.netMap[t]?.isGround)return t;return null}findLoadCapsForCrystalPin(e){let t=[];for(let n of Object.values(this.inputProblem.chipMap)){if(!n.isCapacitor||n.pins.length!==2)continue;for(let o of n.pins){if(!this.pinsAreConnected(e,o))continue;let r=n.pins.find((s)=>s!==o);if(!r)continue;let i=this.getGroundNetId(r);if(!i)continue;t.push({chipId:n.chipId,signalPinId:o,groundPinId:r,groundNetId:i})}}return t}findSeriesResistors(e,t){let n=[];for(let o of Object.values(this.inputProblem.chipMap)){if(!o.isResistor||o.pins.length!==2||t.has(o.chipId))continue;let r=e.flatMap((a)=>o.pins.filter((c)=>this.pinsAreConnected(a,c)).map((c)=>({crystalPinId:a,connectedPinId:c})));if(r.length!==1)continue;let i=r[0],s=o.pins.find((a)=>a!==i.connectedPinId);if(!s||this.getGroundNetId(s))continue;n.push({chipId:o.chipId,crystalPinId:i.crystalPinId,connectedPinId:i.connectedPinId})}return n}identifyCrystal(e){let t=e.pins.filter((c)=>!this.getGroundNetId(c));if(t.length!==2)return null;let[n,o]=t,r=this.findLoadCapsForCrystalPin(n),i=this.findLoadCapsForCrystalPin(o);if(r.length!==1||i.length!==1)return null;if(r[0].chipId===i[0].chipId)return null;if(r[0].groundNetId!==i[0].groundNetId)return null;let s=[{chipId:r[0].chipId,signalPinId:r[0].signalPinId,groundPinId:r[0].groundPinId},{chipId:i[0].chipId,signalPinId:i[0].signalPinId,groundPinId:i[0].groundPinId}],a=new Set(s.map((c)=>c.chipId));return{crystalCircuitGroupId:`crystal_circuit_${e.chipId}`,crystalChipId:e.chipId,activeCrystalPinIds:[n,o],loadCaps:s,groundNetId:r[0].groundNetId,seriesResistors:this.findSeriesResistors([n,o],a)}}_step(){let e=this.queuedCrystals.shift();if(!e){this.solved=!0;return}let t=this.identifyCrystal(e);if(t)this.outputCrystalCircuitGroups.push(t)}visualize(){return X0(this.inputProblem,Vw(this.inputProblem))}getConstructorParams(){return[this.inputProblem]}computeProgress(){let e=Object.values(this.inputProblem.chipMap).filter((t)=>t.isCrystal).length;if(e===0)return 1;return(e-this.queuedCrystals.length)/e}},q8r=({firstChipId:e,secondChipId:t},n)=>{let o=n.chipMap[e],r=n.chipMap[t];if(o?.isCapacitor&&r?.isCapacitor)return n.decouplingCapsGap??n.chipGap;return n.partitionGap},J8r=class extends CA{inputProblem;inputLayout;outputLayout=null;constructor(e){super();this.inputProblem=e.inputProblem,this.inputLayout=e.inputLayout}_step(){this.outputLayout=this.createAlignedLayout()??this.inputLayout,this.solved=!0}isPowerGroundNet(e){let t=this.inputProblem.netMap[e];return t?.isPositiveVoltageSource===!0||t?.isGround===!0}getPinNetIds(e){let t=[];for(let[n,o]of Object.entries(this.inputProblem.netConnMap)){if(!o)continue;if(!n.startsWith(`${e}-`))continue;t.push(n.slice(e.length+1))}return t}pinHasStrongConnection(e){for(let[t,n]of Object.entries(this.inputProblem.pinStrongConnMap)){if(!n)continue;if(t.startsWith(`${e}-`)||t.endsWith(`-${e}`))return!0}return!1}getAlignmentGroupId(e){if(e.fixedPosition||e.pins.length!==2)return null;let t=new Set,n=0;for(let o of e.pins){let r=this.getPinNetIds(o);if(r.length===0){if(this.pinHasStrongConnection(o))return null;continue}let i=!1;for(let s of r)if(this.isPowerGroundNet(s))i=!0;else t.add(s);if(i)n++}if(n===0)return null;if(t.size===0)return"power-ground";if(t.size===1)return`signal:${[...t][0]}`;return null}getAlignmentGroups(){let e=Object.keys(this.inputProblem.chipMap);if(e.length<2)return null;let t=new Map;for(let n of e){let o=this.inputProblem.chipMap[n];if(!o)continue;if(!this.inputLayout.chipPlacements[n])continue;let r=this.getAlignmentGroupId(o);if(!r)continue;let i=t.get(r)??[];i.push(n),t.set(r,i)}return[...t.values()].filter((n)=>n.length>1).map((n)=>({chipIds:n}))}alignGroup(e,t){if(t.length<2)return;let n=0,o=t.reduce((s,a)=>s+this.inputLayout.chipPlacements[a].y,0)/t.length,r=t.reduce((s,a)=>s+this.inputLayout.chipPlacements[a].x,0)/t.length;for(let[s,a]of t.entries()){let c=t[s-1];if(c)n+=q8r({firstChipId:c,secondChipId:a},this.inputProblem);let l=this.inputProblem.chipMap[a],h=this.inputLayout.chipPlacements[a],d=h.ccwRotationDegrees===90||h.ccwRotationDegrees===270,u=l.size.x;if(d)u=l.size.y;let _=n+u/2;e[a]={x:_,y:o,ccwRotationDegrees:h.ccwRotationDegrees},n+=u}let i=n;for(let s of t)e[s].x+=r-i/2}hasChipOverlap(e){let t=Object.keys(this.inputProblem.chipMap);for(let n=0;n<t.length;n++){let o=t[n],r=this.inputProblem.chipMap[o],i=e[o];if(!i)continue;let s=i.ccwRotationDegrees===90||i.ccwRotationDegrees===270,a=r.size.x,c=r.size.y;if(s)a=r.size.y,c=r.size.x;for(let l=n+1;l<t.length;l++){let h=t[l],d=this.inputProblem.chipMap[h],u=e[h];if(!u)continue;let _=u.ccwRotationDegrees===90||u.ccwRotationDegrees===270,p=d.size.x,m=d.size.y;if(_)p=d.size.y,m=d.size.x;let A=Math.abs(i.x-u.x)<(a+p)/2,g=Math.abs(i.y-u.y)<(c+m)/2;if(A&&g)return!0}}return!1}createAlignedLayout(){let e=this.getAlignmentGroups();if(!e)return null;let t={...this.inputLayout.chipPlacements};for(let n of e)this.alignGroup(t,n.chipIds);if(this.hasChipOverlap(t))return null;return{chipPlacements:t,groupPlacements:{...this.inputLayout.groupPlacements}}}visualize(){return X0(this.inputProblem,this.outputLayout??this.inputLayout)}getConstructorParams(){return[{inputProblem:this.inputProblem,inputLayout:this.inputLayout}]}},Yw=({placement:e,size:t,margin:n=0})=>{let o=Ou(t,e.ccwRotationDegrees);return td({center:e,width:o.x+n*2,height:o.y+n*2})},fdn=({inputProblem:e,chipIdA:t,placementA:n,chipIdB:o,placementB:r})=>{let i=Yw({placement:n,size:e.chipMap[t].size,margin:e.chipGap}),s=Yw({placement:r,size:e.chipMap[o].size});return qOe(i,s)>0},Z8r=0.2,e7r=({looseTestPointChipIds:e},t)=>{let n=e.reduce((s,a)=>s+t.chipPlacements[a].y,0)/e.length,o=[...e].sort((s,a)=>t.chipPlacements[s].x-t.chipPlacements[a].x),r={},i;for(let s of o){let a={...t.chipPlacements[s],y:n};if(i){let c=r[i],l=Ou(t.inputProblem.chipMap[i].size,c.ccwRotationDegrees),h=Ou(t.inputProblem.chipMap[s].size,a.ccwRotationDegrees),d=c.x+l.x/2+t.inputProblem.chipGap+h.x/2;if(a.x<d)a.x=d}r[s]=a,i=s}return r},t7r=({looseTestPointChipIds:e,testPointRow:t},n)=>{let o=new Set(e);return e.some((r)=>Object.entries(n.chipPlacements).some(([i,s])=>!o.has(i)&&fdn({inputProblem:n.inputProblem,chipIdA:r,placementA:t[r],chipIdB:i,placementB:s})))},n7r=({looseTestPointChipIds:e,testPointRow:t},n)=>{let o=Math.max(n.inputProblem.chipGap,Z8r),r=0;while(!0){let i=[0];if(r>0)i.length=0,i.push(-r*o,r*o);for(let s of i){let a=structuredClone(t);for(let c of e)a[c].y+=s;if(!t7r({looseTestPointChipIds:e,testPointRow:a},n))return a}r++}},o7r=({anchoredTestPointChipIds:e},t)=>{let n=Object.values(t.inputProblem.chipMap).filter((i)=>i.isTestPoint&&!i.fixedPosition&&i.pins.length===1&&t.chipPlacements[i.chipId]&&!e.has(i.chipId)).map((i)=>i.chipId);if(n.length<2)return;let o=e7r({looseTestPointChipIds:n},t),r=n7r({looseTestPointChipIds:n,testPointRow:o},t);for(let[i,s]of Object.entries(r))t.chipPlacements[i]=s},r7r=1.5,ydn=0.2,Fhn=0.000001,i7r=2,s7r=0.5,a7r={"x-":{x:-1,y:0},"x+":{x:1,y:0},"y-":{x:0,y:-1},"y+":{x:0,y:1}},W6e={"x-":{normalAxis:"x",tangentAxis:"y",direction:-1},"x+":{normalAxis:"x",tangentAxis:"y",direction:1},"y-":{normalAxis:"y",tangentAxis:"x",direction:-1},"y+":{normalAxis:"y",tangentAxis:"x",direction:1}},c7r={"x-":"x+","x+":"x-","y-":"y+","y+":"y-"},l7r=(e)=>{if(Math.abs(e.x)>Math.abs(e.y)){if(e.x<0)return"x-";return"x+"}if(e.y<0)return"y-";return"y+"},KZe=(e,t)=>l7r(us(a7r[e],t)),F6e=({anchorChipId:e,anchorPinId:t,side:n},o)=>{let r=o.inputLayout.chipPlacements[e],i=o.inputProblem.chipPinMap[t],s=us(i.offset,r.ccwRotationDegrees),a=W6e[n].tangentAxis;return r[a]+s[a]},h7r=({group:e},t)=>{if(e.members.length<2)return[e];let n=t.inputProblem.chipMap[e.anchorChipId],o=t.inputLayout.chipPlacements[e.anchorChipId],r=n.pins.filter((h)=>{let d=t.inputProblem.chipPinMap[h];return d&&KZe(d.side,o.ccwRotationDegrees)===e.side}).map((h)=>F6e({anchorChipId:e.anchorChipId,anchorPinId:h,side:e.side},t)).sort((h,d)=>h-d),i=r.slice(1).map((h,d)=>h-r[d]).filter((h)=>h>Fhn);if(i.length===0)return[e];let s=Math.min(...i)*r7r,a=[],c=[],l;for(let h of e.members){let d=F6e({anchorChipId:h.anchorChipId,anchorPinId:h.anchorPinId,side:h.side},t);if(l!==void 0&&d-l>s+Fhn)a.push({...e,members:c}),c=[];c.push(h),l=d}if(c.length>0)a.push({...e,members:c});return a},d7r=(e)=>{let t=HV(e.inputProblem),n=Kq(e.inputProblem),o=[];for(let r of Object.values(e.inputProblem.chipMap)){if(!r.isTestPoint||r.fixedPosition||r.pins.length!==1)continue;let i=r.pins[0],s=n[i]?.[0];if(!s)continue;let a=s.pinId,c=t.get(a)?.chipId;if(!c||c===r.chipId)continue;if(e.inputProblem.chipMap[c]?.isTestPoint)continue;let l=e.inputLayout.chipPlacements[c];if(!l)continue;let h=KZe(s.side,l.ccwRotationDegrees),d=o.find((u)=>u.anchorChipId===c&&u.side===h);if(!d)d={anchorChipId:c,side:h,members:[]},o.push(d);d.members.push({testPointChipId:r.chipId,testPointPinId:i,anchorChipId:c,anchorPinId:a,side:h})}for(let r of o)r.members.sort((i,s)=>F6e({anchorChipId:i.anchorChipId,anchorPinId:i.anchorPinId,side:i.side},e)-F6e({anchorChipId:s.anchorChipId,anchorPinId:s.anchorPinId,side:s.side},e));return o.flatMap((r)=>h7r({group:r},e))},u7r=({member:e},t)=>{let n=t.inputProblem.chipMap[e.testPointChipId],o=t.inputProblem.chipPinMap[e.testPointPinId],r=n.availableRotations??[0,90,180,270],i=c7r[e.side];return r.find((s)=>KZe(o.side,s)===i)??r[0]},p7r=({group:e},t)=>{let{inputProblem:n,chipPlacements:o}=t,r=o[e.anchorChipId],i=n.chipMap[e.anchorChipId],s=Yw({placement:r,size:i.size}),{normalAxis:a,tangentAxis:c,direction:l}=W6e[e.side],h=e.members.map((u)=>{let _=n.chipPinMap[u.anchorPinId],p=us(_.offset,r.ccwRotationDegrees),m={x:r.x+p.x,y:r.y+p.y},A=u7r({member:u},t),g=Ou(n.chipMap[u.testPointChipId].size,A);return{member:u,anchorPinPosition:m,ccwRotationDegrees:A,size:g}}).sort((u,_)=>u.anchorPinPosition[c]-_.anchorPinPosition[c]),d=-1/0;for(let u of h){let _=u.size[c],p=u.anchorPinPosition[c],m=Math.max(p,d+n.chipGap+_/2);d=m+_/2;let A=u.anchorPinPosition[a],g=s.minX;if(a==="y")g=s.minY;if(a==="x"&&l>0)g=s.maxX;if(a==="y"&&l>0)g=s.maxY;let f=Math.min(g,A);if(l>0)f=Math.max(g,A);let y=f+l*(n.chipGap+u.size[a]/2),x=y,C=m;if(a==="y")x=m,C=y;o[u.member.testPointChipId]={x,y:C,ccwRotationDegrees:u.ccwRotationDegrees}}},xdn=({group:e},t)=>{let n=new Set(e.members.map((o)=>o.testPointChipId));return e.members.some((o)=>{let r=t.chipPlacements[o.testPointChipId];return Object.entries(t.chipPlacements).some(([i,s])=>i!==e.anchorChipId&&!n.has(i)&&fdn({inputProblem:t.inputProblem,chipIdA:o.testPointChipId,placementA:r,chipIdB:i,placementB:s}))})},m7r=({group:e},t)=>{let{normalAxis:n,direction:o}=W6e[e.side],r=Math.max(t.inputProblem.chipGap,ydn);while(xdn({group:e},t))for(let i of e.members)t.chipPlacements[i.testPointChipId][n]+=o*r},zhn=({inputProblem:e,pinId:t,placement:n})=>{let o=e.chipPinMap[t],r=us(o.offset,n.ccwRotationDegrees);return{x:n.x+r.x,y:n.y+r.y}},Cdn=({group:e},t)=>{let n=new Set(e.members.map((r)=>r.testPointChipId)),o=0;for(let r of e.members){let i=zhn({inputProblem:t.inputProblem,pinId:r.testPointPinId,placement:t.chipPlacements[r.testPointChipId]}),s=zhn({inputProblem:t.inputProblem,pinId:r.anchorPinId,placement:t.chipPlacements[r.anchorChipId]});for(let[a,c]of Object.entries(t.chipPlacements)){if(a===r.anchorChipId||n.has(a))continue;let l=Yw({placement:c,size:t.inputProblem.chipMap[a].size});if(ese(i,s,l))o++}}return o},_7r=({group:e,tangentAxis:t,searchStep:n},o)=>{let r=new Set(e.members.map((c)=>c.testPointChipId)),i=e.members.reduce((c,l)=>c+o.chipPlacements[l.testPointChipId][t],0)/e.members.length,s=Math.max(...e.members.map((c)=>{let l=o.chipPlacements[c.testPointChipId];return Ou(o.inputProblem.chipMap[c.testPointChipId].size,l.ccwRotationDegrees)[t]})),a=Object.entries(o.chipPlacements).reduce((c,[l,h])=>{if(r.has(l))return c;let d=Ou(o.inputProblem.chipMap[l].size,h.ccwRotationDegrees)[t];return Math.max(c,Math.abs(h[t]-i)+d+s)},0)+o.inputProblem.partitionGap;return Math.ceil(a/n)+i7r},g7r=({group:e},t)=>{let{tangentAxis:n}=W6e[e.side],o=new Map(e.members.map((c)=>[c.testPointChipId,{...t.chipPlacements[c.testPointChipId]}])),r=Math.max(t.inputProblem.partitionGap*s7r,t.inputProblem.chipGap,ydn),i=_7r({group:e,tangentAxis:n,searchStep:r},t),s=0,a=Number.POSITIVE_INFINITY;for(let c=0;c<=i;c++){let l=[0];if(c>0)l.length=0,l.push(-c*r,c*r);for(let h of l){for(let u of e.members){let _=o.get(u.testPointChipId);t.chipPlacements[u.testPointChipId]={..._,[n]:_[n]+h}}if(xdn({group:e},t))continue;let d=Cdn({group:e},t);if(d<a)a=d,s=h;if(d===0)break}if(a===0)break}for(let c of e.members){let l=o.get(c.testPointChipId);t.chipPlacements[c.testPointChipId]={...l,[n]:l[n]+s}}},A7r=class extends CA{inputProblem;inputLayout;outputLayout=null;testPointSideGroups=[];connectionBodyCrossingCount=0;constructor(e){super();this.inputProblem=e.inputProblem,this.inputLayout=e.inputLayout}_step(){let e=structuredClone(this.inputLayout.chipPlacements),t={inputProblem:this.inputProblem,chipPlacements:e};this.testPointSideGroups=d7r({inputProblem:this.inputProblem,inputLayout:this.inputLayout});for(let o of this.testPointSideGroups)p7r({group:o},t);for(let o of this.testPointSideGroups)m7r({group:o},t),g7r({group:o},t);this.connectionBodyCrossingCount=this.testPointSideGroups.reduce((o,r)=>o+Cdn({group:r},t),0);let n=new Set(this.testPointSideGroups.flatMap((o)=>o.members.map((r)=>r.testPointChipId)));o7r({anchoredTestPointChipIds:n},t),this.outputLayout={chipPlacements:e,groupPlacements:{...this.inputLayout.groupPlacements}},this.solved=!0}visualize(){return X0(this.inputProblem,this.outputLayout??this.inputLayout)}};function f7r(e){let{inputProblem:t,pinIdToStronglyConnectedPins:n}=e,o=new Map,r=new Set,i=!1,s=new Map;for(let[a,c]of Object.entries(t.pinStrongConnMap)){if(!c)continue;i=!0;let l=a.split("-");if(l.length===2&&l[0]&&l[1]){let h=t.chipPinMap[l[0]],d=t.chipPinMap[l[1]];if(h&&d){let u=l[0].split(".")[0],_=l[1].split(".")[0];if(u&&_&&u!==_){let p=`${u}-${_}`,m=`${_}-${u}`;if(!s.has(p))s.set(p,new Set);if(!s.has(m))s.set(m,new Set);s.get(p).add(h.side),s.get(m).add(d.side)}}}}if(i)for(let[a,c]of Object.entries(t.netConnMap)){if(!c)continue;let[l,h]=a.split("-");if(l&&h)r.add(l)}else for(let[a,c]of Object.entries(t.netConnMap)){if(!c)continue;let[l,h]=a.split("-");if(l&&h){if(!t.chipPinMap[l])continue;let u=l.split(".")[0],_=!0;for(let[p,m]of s.entries()){let[A,g]=p.split("-");if(A===u)for(let[f,y]of Object.entries(t.netConnMap)){if(!y)continue;let[x,C]=f.split("-");if(C===h&&x&&x!==l){let b=t.chipPinMap[x];if(!b)continue;if(x.split(".")[0]===g){if(!m.has(b.side)){_=!1;break}}}}}if(_)o.set(l,h);else{let p=`${l}_opposite-strong-side-disconnected`;o.set(l,p),r.add(l)}}}for(let[a,c]of Object.entries(t.pinStrongConnMap)){if(!c)continue;let l=a.split("-");if(l.length===2&&l[0]&&l[1]){let h=o.get(l[0])||o.get(l[1]);if(h)o.set(l[0],h),o.set(l[1],h);else o.set(l[0],a),o.set(l[1],a)}}return{pinToNetworkMap:o,filteredPins:r}}var y7r=(e)=>{let t=e.flatMap((a)=>[a.offset.x-a.size.x/2,a.offset.x+a.size.x/2]),n=e.flatMap((a)=>[a.offset.y-a.size.y/2,a.offset.y+a.size.y/2]),o=t.length?Math.min(...t):0,r=t.length?Math.max(...t):0,i=n.length?Math.min(...n):0,s=n.length?Math.max(...n):0;return{minX:o,maxX:r,minY:i,maxY:s}},z6e=0.2,ohe=0.000001,YZe=2,Xq=(e,t)=>{let n=us(e.offset,t.ccwRotationDegrees);return{x:t.x+n.x,y:t.y+n.y}},x7r=(e,t)=>{for(let[n,o]of Object.entries(e.netMap)){if(!o.isGround)continue;if(e.netConnMap[`${t}-${n}`])return!0}return!1},C7r=({chip:e,inputProblem:t,placement:n})=>{let[o,r]=e.pins,i=o&&t.chipPinMap[o],s=r&&t.chipPinMap[r];if(!i||!s)return!1;let a=us(i.offset,n.ccwRotationDegrees),c=us(s.offset,n.ccwRotationDegrees);return Math.abs(a.y-c.y)>Math.abs(a.x-c.x)},b7r=({chipId:e,chipPlacements:t,ignoredChipIds:n,inputProblem:o,minimumGap:r})=>{let i=o.chipMap[e],s=t[e];if(!i||!s)return!1;let a=Ou(i.size,s.ccwRotationDegrees),c=td({center:s,width:a.x,height:a.y});for(let[l,h]of Object.entries(t)){if(n.has(l))continue;let d=o.chipMap[l];if(!d)continue;let u=Ou(d.size,h.ccwRotationDegrees),_=td({center:h,width:u.x,height:u.y});if(aR(c,_)<r-ohe)return!1}return!0},LV=({chipIds:e,clearanceGroupChipIds:t,dx:n,dy:o,chipPlacements:r,inputProblem:i,minimumOutsideGap:s})=>{let a=e.map((h)=>r[h]).filter((h)=>Boolean(h));if(a.length!==e.length)return!1;for(let h of a)h.x+=n,h.y+=o;let c=new Set(t??e);if(e.every((h)=>b7r({chipId:h,chipPlacements:r,ignoredChipIds:c,inputProblem:i,minimumGap:s??i.chipGap})))return!0;for(let h of a)h.x-=n,h.y-=o;return!1},bdn=({inputProblem:e,connectedPinsByPinId:t,chipPlacements:n,rigidChipGroups:o=[]})=>{let r=HV(e),i=Object.keys(e.chipMap).length;for(let s of Object.values(e.chipMap)){if(s.pins.length<=YZe)continue;for(let a of s.pins)for(let c of t[a]??[]){let l=r.get(c.pinId);if(!l)continue;if(l.fixedPosition)continue;if(l.pins.length!==YZe)continue;let h=e.chipPinMap[a],d=n[s.chipId],u=n[l.chipId];if(!h||!d||!u)continue;let _=Xq(h,d),p=Xq(c,u),m=Math.abs(_.x-p.x)<=ohe,A=Math.abs(_.y-p.y)<=ohe,g=C7r({chip:l,inputProblem:e,placement:u}),f=o.find((I)=>I.includes(l.chipId)),y=f??[l.chipId];if(m&&g){if(f)continue;LV({chipIds:[l.chipId],dx:-z6e,dy:0,chipPlacements:n,inputProblem:e});continue}let x=i===YZe&&g&&(l.isCapacitor||l.isResistor),C=l.pins.find((I)=>I!==c.pinId),b=C&&x7r(e,C);if(A&&(x||b))LV({chipIds:y,dx:0,dy:-z6e,chipPlacements:n,inputProblem:e})}}},I7r=({groundedLoadPairs:e,inputProblem:t,chipPlacements:n})=>{for(let o of e){if(!o.mainPinId)continue;if(!o.upperChip.isResistor)continue;let r=t.chipPinMap[o.upperInnerPinId],i=t.chipPinMap[o.lowerInnerPinId],s=n[o.upperChip.chipId],a=n[o.lowerChip.chipId];if(!r||!i||!s||!a)continue;let c=Xq(r,s),l=Xq(i,a);if(Math.abs(c.x-l.x)>ohe)continue;LV({chipIds:[o.upperChip.chipId],dx:-z6e,dy:0,chipPlacements:n,inputProblem:t})}},v7r=({railLoadPairs:e,inputProblem:t,chipPlacements:n})=>{for(let o of e){let r=t.chipPinMap[o.mainPinId],i=t.chipPinMap[o.resistorMainPinId],s=n[o.mainChipId],a=n[o.resistor.chipId];if(!r||!i||!s||!a)continue;let c=Xq(r,s),l=Xq(i,a);if(Math.abs(c.y-l.y)>ohe)continue;LV({chipIds:[o.railComponent.chipId,o.resistor.chipId],dx:0,dy:z6e,chipPlacements:n,inputProblem:t})}},Ohn=0.1,$Ze=class extends CA{partitionInputProblem;layout=null;pinIdToStronglyConnectedPins;constructor(e){super();this.partitionInputProblem=e.partitionInputProblem,this.pinIdToStronglyConnectedPins=e.pinIdToStronglyConnectedPins}_step(){if(!this.activeSubSolver){let e=f7r({inputProblem:this.partitionInputProblem,pinIdToStronglyConnectedPins:this.pinIdToStronglyConnectedPins}).pinToNetworkMap,t=this.createPackInput(e);this.activeSubSolver=new Ow(t),this.activeSubSolver.MAX_ITERATIONS=this.MAX_ITERATIONS}if(this.activeSubSolver.step(),this.activeSubSolver.failed){this.failed=!0,this.error=`PackSolver2 failed: ${this.activeSubSolver.error}`;return}if(this.activeSubSolver.solved)this.layout=this.createLayoutFromPackingResult(this.activeSubSolver.packedComponents),this.solved=!0,this.activeSubSolver=null}createPackInput(e){let t=Object.entries(this.partitionInputProblem.chipMap).map(([o,r])=>{let i=[];for(let l of r.pins){let h=this.partitionInputProblem.chipPinMap[l];if(!h)continue;let d=e.get(l)||`${l}_isolated`;i.push({padId:l,networkId:d,type:"rect",offset:{x:h.offset.x,y:h.offset.y},size:{x:Ohn,y:Ohn}})}let s=y7r(i),a={x:s.maxX-s.minX,y:s.maxY-s.minY};i.push({padId:`${o}_body`,networkId:`${o}_body_disconnected`,type:"rect",offset:{x:0,y:0},size:{x:Math.max(a.x,r.size.x),y:Math.max(a.y,r.size.y)}});let c=r.availableRotations?.[0]??0;return{componentId:o,pads:i,availableRotationDegrees:r.availableRotations??[0,90,180,270],...r.fixedPosition&&{isStatic:!0,center:r.fixedPosition,ccwRotationOffset:c}}}),n=this.partitionInputProblem.chipGap;if(this.partitionInputProblem.partitionType==="decoupling_caps")n=this.partitionInputProblem.decouplingCapsGap??n;return{components:t,minGap:n,packOrderStrategy:"largest_to_smallest",packPlacementStrategy:"minimum_closest_sum_squared_distance"}}createLayoutFromPackingResult(e){let t={};for(let n of e){let o=n.componentId;t[o]={x:n.center.x,y:n.center.y,ccwRotationDegrees:n.ccwRotationDegrees??n.ccwRotationOffset??0}}return bdn({inputProblem:this.partitionInputProblem,connectedPinsByPinId:this.pinIdToStronglyConnectedPins,chipPlacements:t}),{chipPlacements:t,groupPlacements:{}}}visualize(){if(this.activeSubSolver&&!this.solved)return this.activeSubSolver.visualize();if(!this.layout){let e=Vw(this.partitionInputProblem);return X0(this.partitionInputProblem,e)}return X0(this.partitionInputProblem,this.layout)}getConstructorParams(){return[this.partitionInputProblem]}},S7r=2,P7r=4,E7r=3,Vhn=2,M7r=(e)=>{let t={};for(let[n,o]of Object.entries(e.chipMap))for(let r of o.pins)t[r]=n;return t},w7r=(e)=>{let t=[],n=new Set;for(let[o,r]of Object.entries(e.pinStrongConnMap)){if(!r)continue;let[i,s]=o.split("-"),a=`${i}|${s}`;if(s<i)a=`${s}|${i}`;if(n.has(a))continue;n.add(a),t.push([i,s])}return t},Yhn=(e,t)=>{for(let[n,o]of Object.entries(e.netConnMap)){if(!o)continue;if(!n.startsWith(`${t}-`))continue;return n.slice(t.length+1)}return null},Ghn=(e,t)=>{let n=us(e,t);if(Math.abs(n.x)>=Math.abs(n.y)){if(n.x>=0)return"x+";return"x-"}if(n.y>=0)return"y+";return"y-"},B7r=(e,t)=>{if(t==="x-"||t==="x+")return e.y;return e.x},Idn=(e)=>{let t=M7r(e),n=w7r(e),o=new Set(n.flat()),r=new Map;for(let[h,d]of n){let u=t[h],_=t[d];if(!u||!_||u===_)continue;if(!r.has(u))r.set(u,[]);if(!r.has(_))r.set(_,[]);r.get(u).push({selfPin:h,otherPin:d,otherChip:_}),r.get(_).push({selfPin:d,otherPin:h,otherChip:u})}let i=[];for(let h of r.values()){let d=new Map;for(let u of h){let _=d.get(u.selfPin)??[];_.push(u),d.set(u.selfPin,_)}for(let[u,_]of d){if(_.length<Vhn)continue;let p=[u,..._.map((A)=>A.otherPin)],m=new Map;for(let A of p){let g=t[A],f=e.chipMap[g];if(!g||f?.fixedPosition||f?.pins.length!==2)continue;let y=f.pins.find((C)=>C!==A);if(!y||o.has(y))continue;let x=Yhn(e,y);if(!x)continue;m.set(x,[...m.get(x)??[],g])}for(let A of m.values()){if(A.length<Vhn)continue;let g=p.filter((b)=>!A.includes(t[b]));if(g.length!==1)continue;let f=g[0],y=t[f];if(!y)continue;let x=e.chipMap[y],C=e.chipPinMap[f];if(!x||!C)continue;i.push({mainChipId:y,side:Ghn(C.offset,x.availableRotations?.[0]??0),passiveChipIds:A,mainChipPinIds:A.map(()=>f)})}}}let s=new Set(i.flatMap((h)=>h.passiveChipIds)),a=[];for(let[h,d]of Object.entries(e.chipMap)){if(s.has(h))continue;if(d.pins.length!==S7r)continue;let u=r.get(h)??[];if(u.length!==1)continue;let{selfPin:_,otherPin:p,otherChip:m}=u[0],A=e.chipMap[m];if(!A||A.pins.length<P7r)continue;let g=d.pins.find((b)=>b!==_);if(!g)continue;let f=Yhn(e,g);if(!f)continue;let y=A.availableRotations?.[0]??0,x=us(e.chipPinMap[p].offset,y),C=Ghn(e.chipPinMap[p].offset,y);a.push({passiveChipId:h,mainChipId:m,mainChipPinId:p,side:C,sharedNetId:f,edgeCoord:B7r(x,C)})}let c=new Map;for(let h of a){let d=`${h.mainChipId}|${h.side}|${h.sharedNetId}`,u=c.get(d)??[];u.push(h),c.set(d,u)}let l=[...i];for(let h of c.values()){if(h.length<E7r)continue;h.sort((d,u)=>d.edgeCoord-u.edgeCoord),l.push({mainChipId:h[0].mainChipId,side:h[0].side,passiveChipIds:h.map((d)=>d.passiveChipId),mainChipPinIds:h.map((d)=>d.mainChipPinId)})}return l},Wq=0.000001,T7r=16,D7r={"x-":{x:-1,y:0},"x+":{x:1,y:0},"y-":{x:0,y:-1},"y+":{x:0,y:1}},Uhn=(e,t,n)=>{if(n==="x")return Math.max(0,e.minX-t.maxX,t.minX-e.maxX);return Math.max(0,e.minY-t.maxY,t.minY-e.maxY)},N7r=class extends CA{partitionInputProblem;layout=null;pinIdToStronglyConnectedPins;packingSolver=null;constructor(e){super();this.partitionInputProblem=e.partitionInputProblem,this.pinIdToStronglyConnectedPins=e.pinIdToStronglyConnectedPins}_step(){if(!this.packingSolver)this.packingSolver=new $Ze({partitionInputProblem:this.partitionInputProblem,pinIdToStronglyConnectedPins:this.pinIdToStronglyConnectedPins}),this.activeSubSolver=this.packingSolver;if(this.packingSolver.step(),this.packingSolver.failed){this.failed=!0,this.error=this.packingSolver.error;return}if(this.packingSolver.solved&&this.packingSolver.layout)this.layout=this.alignPassiveGroups(this.packingSolver.layout),this.activeSubSolver=null,this.solved=!0}alignPassiveGroups(e){let t={};for(let[o,r]of Object.entries(e.chipPlacements))t[o]={...r};let n=Idn(this.partitionInputProblem);for(let o of n)this.reflowPassiveGroup(t,o);return bdn({inputProblem:this.partitionInputProblem,connectedPinsByPinId:this.pinIdToStronglyConnectedPins,chipPlacements:t,rigidChipGroups:n.map((o)=>o.passiveChipIds)}),{chipPlacements:t,groupPlacements:e.groupPlacements}}reflowPassiveGroup(e,t){let n=this.partitionInputProblem,o=n.chipGap,r=e[t.mainChipId];if(!r)return;let i=D7r[t.side],s=i.x!==0,a=this.boxFor(t.mainChipId,r),c=b4(a),l=t.mainChipPinIds.map((y)=>{let x=us(n.chipPinMap[y].offset,r.ccwRotationDegrees);return{x:r.x+x.x,y:r.y+x.y}}),h=c;if(l.length>0){let y=l.reduce((C,b)=>C+b.x,0),x=l.reduce((C,b)=>C+b.y,0);h={x:y/l.length,y:x/l.length}}let d=t.passiveChipIds.map((y)=>Ou(n.chipMap[y].size,e[y].ccwRotationDegrees)),u=[],_=0;for(let y=0;y<d.length;y++)u[y]=_+d[y].x/2,_+=d[y].x+o;let p=Math.max(0,_-o);for(let y=0;y<u.length;y++)u[y]-=p/2;let m=Math.max(...d.map((y)=>y.y)),A=new Set(t.passiveChipIds),g=[];if(s){let y=(a.maxX-a.minX)/2+o+p/2,x=c.x+i.x*y,C=h.y;if(l.length>0)C=Math.min(...l.map((b)=>b.y));g.push({x,y:C-m/2}),g.push({x,y:h.y})}else{let y=(a.maxY-a.minY)/2+o+m/2;g.push({x:h.x,y:c.y+i.y*y})}let f=a.maxX-a.minX+p;for(let y of g){let x=0;for(let C=0;C<T7r;C++){let b={};for(let P=0;P<t.passiveChipIds.length;P++){let M=t.passiveChipIds[P];b[M]={x:y.x+x+u[P],y:y.y,ccwRotationDegrees:e[M].ccwRotationDegrees}}let I=this.clearanceAdjustment(b,e,A,o);if(I===0){for(let P of t.passiveChipIds)e[P]=b[P];return}if(I===null)break;let v=x+I;if(Math.abs(v)>f)break;x=v}}}clearanceAdjustment(e,t,n,o){let r=0,i=0;for(let[s,a]of Object.entries(e)){let c=this.boxFor(s,a);for(let[l,h]of Object.entries(t)){if(n.has(l))continue;let d=this.boxFor(l,h);if(aR(c,d)>=o-Wq)continue;let u=Uhn(c,d,"y"),_=Uhn(c,d,"x"),m=Math.sqrt(Math.max(0,o*o-u*u))-_;if(m<=Wq)continue;if(b4(c).x>=b4(d).x)r=Math.max(r,m);else i=Math.max(i,m)}}if(r>Wq&&i>Wq)return null;if(r>Wq)return r;if(i>Wq)return-i;return 0}boxFor(e,t){let n=this.partitionInputProblem.chipMap[e],o=Ou(n.size,t.ccwRotationDegrees),r=[{x:t.x-o.x/2,y:t.y-o.y/2},{x:t.x+o.x/2,y:t.y+o.y/2}];for(let i of n.pins){let s=this.partitionInputProblem.chipPinMap[i];if(!s)continue;let a=us(s.offset,t.ccwRotationDegrees);r.push({x:t.x+a.x,y:t.y+a.y})}return Ms(r)}visualize(){if(this.activeSubSolver&&!this.solved)return this.activeSubSolver.visualize();if(!this.layout){let e=Vw(this.partitionInputProblem);return X0(this.partitionInputProblem,e)}return X0(this.partitionInputProblem,this.layout)}getConstructorParams(){return[this.partitionInputProblem]}},vdn=(e,t)=>{if(e.pins.length!==2)return null;let[n,o]=e.pins.map((a)=>t.chipPinMap[a]);if(!n||!o)return null;let r=e.availableRotations?.[0]??0,i=us(n.offset,r),s=us(o.offset,r);if(Math.abs(i.y-s.y)>=Math.abs(i.x-s.x))return"y";return"x"},R7r=(e)=>{if(e.partitionType!=="decoupling_caps")return!1;let t=Object.values(e.chipMap);if(t.length<2)return!1;let n=null;for(let o of t){if(o.fixedPosition)return!1;let r=vdn(o,e);if(!r)return!1;if(n&&n!==r)return!1;n=r}return n!==null},Q7r=class extends CA{partitionInputProblem;layout=null;constructor(e){super();this.partitionInputProblem=e.partitionInputProblem}getRotation(e){return e.availableRotations?.[0]??0}isOnRailNet(e){let t=this.partitionInputProblem,n=Adn({inputProblem:t,netIds:Object.keys(t.netMap)});if(!n)return!1;return t.netConnMap[`${e}-${n}`]===!0}getRailOffset(e,t){let n=e.pins.find((r)=>this.isOnRailNet(r));if(!n)return 0;let o=this.partitionInputProblem.chipPinMap[n];if(!o)return 0;return-us(o.offset,this.getRotation(e))[t]}_step(){let e=this.partitionInputProblem,t=Object.values(e.chipMap),n=vdn(t[0],e),o="y";if(n==="y")o="x";let r=e.decouplingCapsGap??e.chipGap,i=t.map((u)=>Ou(u.size,this.getRotation(u))[o]),s=i.reduce((u,_)=>u+_,0)+r*(t.length-1),a={},c=-s/2,l=1,h=e.decouplingMainChipSide;if(o==="x"&&h==="x-"||o==="y"&&h==="y-")c=s/2,l=-1;t.forEach((u,_)=>{let p=i[_],m={x:0,y:0,ccwRotationDegrees:this.getRotation(u)};m[o]=c+l*p/2,m[n]=this.getRailOffset(u,n),a[u.chipId]=m,c+=l*(p+r)}),this.layout={chipPlacements:a,groupPlacements:{}},this.solved=!0}visualize(){return X0(this.partitionInputProblem,this.layout??{chipPlacements:{},groupPlacements:{}})}getConstructorParams(){return[{partitionInputProblem:this.partitionInputProblem}]}},jq=(e)=>{if(e.availableRotations?.length)return e.availableRotations;return[0]},k7r=(e,t,n)=>{let o=jq(e)[0],r=-1/0;for(let i of jq(e)){let s=n.chipPinMap[t[0]],a=n.chipPinMap[t[1]];if(!s||!a)continue;let c=us(s.offset,i),l=us(a.offset,i),h=Math.abs(c.x-l.x)-Math.abs(c.y-l.y);if(h>r)r=h,o=i}return o},L7r=(e,t,n,o)=>{let r=jq(e)[0],i=-1/0;for(let s of jq(e)){let a=o.chipPinMap[t],c=o.chipPinMap[n];if(!a||!c)continue;let l=us(a.offset,s),h=us(c.offset,s),d=l.y-h.y-Math.abs(l.x-h.x);if(d>i)i=d,r=s}return r},H7r=(e,t,n)=>{let o=e.pins.find((s)=>s!==t),r=jq(e)[0],i=-1/0;for(let s of jq(e)){let a=n.chipPinMap[t],c=o&&n.chipPinMap[o];if(!a||!c)continue;let l=us(a.offset,s),h=us(c.offset,s),d=h.y-l.y-Math.abs(h.x-l.x);if(d>i)i=d,r=s}return r},F7r=(e)=>{if(e.partitionType!=="crystal_circuit"||!e.crystalCircuitGroup)return!1;return Object.values(e.chipMap).every((t)=>t.fixedPosition===void 0)},z7r=class extends CA{partitionInputProblem;layout=null;constructor(e){super();this.partitionInputProblem=e.partitionInputProblem}_step(){let e=this.partitionInputProblem,t=e.crystalCircuitGroup,n=e.chipMap[t.crystalChipId],o=k7r(n,t.activeCrystalPinIds,e),r=Ou(n.size,o),i=e.chipGap,s={[n.chipId]:{x:0,y:0,ccwRotationDegrees:o}},a=new Map;for(let u of t.activeCrystalPinIds){let _=e.chipPinMap[u];a.set(u,us(_.offset,o))}let c=a.get(t.activeCrystalPinIds[0]),l=a.get(t.activeCrystalPinIds[1]),h;if(Math.abs(c.x-l.x)>=Math.abs(c.y-l.y))h="x";else h="y";let d=t.loadCaps.map((u,_)=>{let p=e.chipMap[u.chipId],m=L7r(p,u.signalPinId,u.groundPinId,e),A=Ou(p.size,m),g=us(e.chipPinMap[u.signalPinId].offset,m),f=us(e.chipPinMap[u.groundPinId].offset,m),y=t.activeCrystalPinIds[_],x=a.get(y),C=-r.y/2-i-A.y/2;return{chip:p,rotation:m,size:A,signalOffset:g,groundOffset:f,crystalPinOffset:x,highestGroundY:C+f.y}});if(h==="x"){let u=Math.min(...d.map((y)=>y.highestGroundY));for(let y of d)s[y.chip.chipId]={x:y.crystalPinOffset.x-y.signalOffset.x,y:u-y.groundOffset.y,ccwRotationDegrees:y.rotation};let[_,p]=[...d].sort((y,x)=>s[y.chip.chipId].x-s[x.chip.chipId].x),m=s[_.chip.chipId],A=s[p.chip.chipId],g=A.x-p.size.x/2-(m.x+_.size.x/2),f=Math.max(0,(i*2-g)/2);m.x-=f,A.x+=f}else d.forEach((u,_)=>{let p;if(_===0)p=-1;else p=1;s[u.chip.chipId]={x:p*(r.x/2+i+u.size.x/2),y:u.crystalPinOffset.y-u.signalOffset.y,ccwRotationDegrees:u.rotation}});for(let u of t.seriesResistors){let _=e.chipMap[u.chipId],p=H7r(_,u.connectedPinId,e),m=Ou(_.size,p),A=us(e.chipPinMap[u.connectedPinId].offset,p),g=a.get(u.crystalPinId);s[_.chipId]={x:g.x-A.x,y:r.y/2+i+m.y/2,ccwRotationDegrees:p}}this.layout={chipPlacements:s,groupPlacements:{}},this.solved=!0}visualize(){return X0(this.partitionInputProblem,this.layout??{chipPlacements:{},groupPlacements:{}})}getConstructorParams(){return[{partitionInputProblem:this.partitionInputProblem}]}},rhe=2,O7r=(e)=>{let t=new Map;for(let r of Object.values(e.chipMap))for(let i of r.pins)t.set(i,r.chipId);let n=Kq(e),o=new Map;for(let[r,i]of Object.entries(n)){let s=t.get(r);if(!s)continue;for(let a of i){let c=t.get(a.pinId);if(!c||c===s)continue;let l=o.get(s)??[];l.push({selfPinId:r,otherPinId:a.pinId,otherChipId:c}),o.set(s,l)}}return o},V7r=({inputProblem:e,connectionsByChip:t,mainChipId:n,startChipId:o,endChipId:r})=>{if(o===r)return null;let i=(c)=>{let l=e.chipMap[c];return c!==n&&l?.pins.length===rhe&&!l.fixedPosition};if(!i(o)||!i(r))return null;let s=[[o]],a=new Set([o]);while(s.length>0){let c=s.shift(),l=c[c.length-1];if(l===r)return c;for(let h of t.get(l)??[]){let d=h.otherChipId;if(!i(d)||a.has(d))continue;a.add(d),s.push([...c,d])}}return null},Y7r=({inputProblem:e,connectionsByChip:t,mainChipId:n,mainPinIds:o,pathChipIds:r})=>{let i=[];for(let s=0;s<r.length;s++){let a=r[s],c=e.chipMap[a],l=t.get(a)??[];if(!c||l.length!==rhe||new Set(l.map((p)=>p.selfPinId)).size!==rhe)return null;let h=s===0?n:r[s-1],d=s===r.length-1?n:r[s+1],u=l.find((p)=>p.otherChipId===h),_=l.find((p)=>p.otherChipId===d);if(!u||!_||u.selfPinId===_.selfPinId)return null;if(s===0&&u.otherPinId!==o[0])return null;if(s===r.length-1&&_.otherPinId!==o[1])return null;i.push({chipId:a,nearPinId:u.selfPinId,farPinId:_.selfPinId})}return i},Sdn=(e)=>{let t=O7r(e),n=[],o=new Set;for(let r of Object.values(e.chipMap)){if(r.pins.length<=rhe)continue;let i=t.get(r.chipId)??[];for(let s=0;s<i.length;s++){let a=i[s],c=e.chipPinMap[a.selfPinId];if(!c)continue;for(let l=s+1;l<i.length;l++){let h=i[l],d=e.chipPinMap[h.selfPinId];if(!d||c.side!==d.side||a.selfPinId===h.selfPinId)continue;let u=V7r({inputProblem:e,connectionsByChip:t,mainChipId:r.chipId,startChipId:a.otherChipId,endChipId:h.otherChipId});if(!u||u.length<rhe||u.length%2!==0||u.some((f)=>o.has(f)))continue;let _=[a.selfPinId,h.selfPinId],p=Y7r({inputProblem:e,connectionsByChip:t,mainChipId:r.chipId,mainPinIds:_,pathChipIds:u});if(!p)continue;let m=p.length/2,A=p.slice(0,m),g=p.slice(m).reverse().map((f)=>({chipId:f.chipId,nearPinId:f.farPinId,farPinId:f.nearPinId}));n.push({mainChipId:r.chipId,mainPinIds:_,branches:[A,g]});for(let f of u)o.add(f)}}}return n},G7r=[0,90,180,270],Whn=0.000001,DQ=(e,t)=>e.x*t.x+e.y*t.y,U7r=({outwardCoordinate:e,tangentCoordinate:t,axes:n})=>({x:n.outward.x*e+n.tangent.x*t,y:n.outward.y*e+n.tangent.y*t}),W7r=({pinOffset:e})=>{if(Math.abs(e.x)>=Math.abs(e.y))return{outward:m7(e.x>=0?"right":"left"),tangent:m7("up")};return{outward:m7(e.y>=0?"up":"down"),tangent:m7("right")}},Xhn=({size:e,axis:t})=>(Math.abs(t.x)*e.x+Math.abs(t.y)*e.y)/2,X7r=({chip:e,nearPinId:t,farPinId:n,inputProblem:o,outward:r,originalRotation:i})=>{let s=o.chipPinMap[t],a=o.chipPinMap[n];if(!s||!a)return i;let c=e.availableRotations??G7r,l=c[0]??0,h=Number.NEGATIVE_INFINITY;for(let d of c){let u=us(s.offset,d),_=us(a.offset,d),p=DQ({x:_.x-u.x,y:_.y-u.y},r);if(p>h||p===h&&d===i)h=p,l=d}return l},k6e=({chip:e,placement:t})=>{let n=Ou(e.size,t.ccwRotationDegrees);return td({center:t,width:n.x,height:n.y})},jhn=({branch:e,mainPinId:t,mainChip:n,mainPlacement:o,inputProblem:r,axes:i,originalPlacements:s,extraGap:a})=>{let c=r.chipPinMap[t];if(!c)return null;let l=Ou(n.size,o.ccwRotationDegrees),h=us(c.offset,o.ccwRotationDegrees),d={x:o.x+h.x,y:o.y+h.y},u=DQ(o,i.outward)+Xhn({size:l,axis:i.outward});u=Math.max(u,DQ(d,i.outward));let _=DQ(d,i.tangent),p={},m=u;for(let A of e){let g=r.chipMap[A.chipId],f=s[A.chipId],y=r.chipPinMap[A.nearPinId],x=r.chipPinMap[A.farPinId];if(!g||!f||!y||!x)return null;let C=X7r({chip:g,nearPinId:A.nearPinId,farPinId:A.farPinId,inputProblem:r,outward:i.outward,originalRotation:f.ccwRotationDegrees}),b=Ou(g.size,C),I=Xhn({size:b,axis:i.outward}),v=us(y.offset,C),P=us(x.offset,C),M=u+r.chipGap+a+I,B=_-DQ(v,i.tangent),T=U7r({outwardCoordinate:M,tangentCoordinate:B,axes:i});p[g.chipId]={...T,ccwRotationDegrees:C},u=M+I,_=B+DQ(P,i.tangent),m=M+DQ(P,i.outward)}return{placements:p,terminalOutwardCoordinate:m}},Khn=({branchLayout:e,shift:t,tangent:n})=>{for(let o of Object.values(e.placements))o.x+=n.x*t,o.y+=n.y*t},$hn=({branchLayout:e,inputProblem:t,tangent:n})=>{let o=Ms(Object.entries(e.placements).flatMap(([r,i])=>{let s=k6e({chip:t.chipMap[r],placement:i});return[{x:s.minX,y:s.minY},{x:s.maxX,y:s.maxY}]}));if(!o)return{min:0,max:0};if(Math.abs(n.x)>=Math.abs(n.y))return{min:o.minX,max:o.maxX};return{min:o.minY,max:o.maxY}},j7r=({candidatePlacements:e,originalPlacements:t,inputProblem:n})=>{let o=new Set(Object.keys(e)),r=Object.entries(e);for(let i=0;i<r.length;i++){let[s,a]=r[i],c=n.chipMap[s];if(!c)return!1;let l=k6e({chip:c,placement:a});for(let h=i+1;h<r.length;h++){let[d,u]=r[h],_=n.chipMap[d];if(!_||aR(l,k6e({chip:_,placement:u}))<n.chipGap-Whn)return!1}for(let[h,d]of Object.entries(t)){if(o.has(h))continue;let u=n.chipMap[h];if(!u||aR(l,k6e({chip:u,placement:d}))<n.chipGap-Whn)return!1}}return!0},K7r=({group:e,chipPlacements:t,inputProblem:n})=>{let o=n.chipMap[e.mainChipId],r=t[e.mainChipId],i=n.chipPinMap[e.mainPinIds[0]];if(!o||!r||!i)return null;let s=us(i.offset,r.ccwRotationDegrees),a=W7r({pinOffset:s}),c=e.branches.map((m,A)=>({branch:m,mainPinId:e.mainPinIds[A]})).sort((m,A)=>{let g=(f)=>{let y=n.chipPinMap[f],x=us(y.offset,r.ccwRotationDegrees);return DQ({x:r.x+x.x,y:r.y+x.y},a.tangent)};return g(m.mainPinId)-g(A.mainPinId)}),l=c.map(({branch:m,mainPinId:A})=>jhn({branch:m,mainPinId:A,mainChip:o,mainPlacement:r,inputProblem:n,axes:a,originalPlacements:t,extraGap:0}));if(l.some((m)=>!m))return null;let h=Math.max(...l.map((m)=>m.terminalOutwardCoordinate));if(l=c.map(({branch:m,mainPinId:A},g)=>{let f=l[g],y=(h-f.terminalOutwardCoordinate)/m.length;return jhn({branch:m,mainPinId:A,mainChip:o,mainPlacement:r,inputProblem:n,axes:a,originalPlacements:t,extraGap:y})}),l.some((m)=>!m))return null;let d=$hn({branchLayout:l[0],inputProblem:n,tangent:a.tangent}),u=$hn({branchLayout:l[1],inputProblem:n,tangent:a.tangent}),_=Math.max(0,d.max+n.chipGap-u.min);Khn({branchLayout:l[0],shift:-_/2,tangent:a.tangent}),Khn({branchLayout:l[1],shift:_/2,tangent:a.tangent});let p=Object.assign({},l[0].placements,l[1].placements);if(!j7r({candidatePlacements:p,originalPlacements:t,inputProblem:n}))return null;return p},$7r=(e)=>Sdn(e).length>0,q7r=class extends CA{partitionInputProblem;layout=null;pinIdToStronglyConnectedPins;packingSolver=null;constructor(e){super();this.partitionInputProblem=e.partitionInputProblem,this.pinIdToStronglyConnectedPins=e.pinIdToStronglyConnectedPins}_step(){if(!this.packingSolver)this.packingSolver=new $Ze({partitionInputProblem:this.partitionInputProblem,pinIdToStronglyConnectedPins:this.pinIdToStronglyConnectedPins}),this.activeSubSolver=this.packingSolver;if(this.packingSolver.step(),this.packingSolver.failed){this.failed=!0,this.error=this.packingSolver.error;return}if(this.packingSolver.solved&&this.packingSolver.layout)this.layout=this.refinePackedLayout(this.packingSolver.layout),this.activeSubSolver=null,this.solved=!0}refinePackedLayout(e){let t={};for(let[n,o]of Object.entries(e.chipPlacements))t[n]={...o};for(let n of Sdn(this.partitionInputProblem)){let o=K7r({group:n,chipPlacements:t,inputProblem:this.partitionInputProblem});if(o)Object.assign(t,o)}return{chipPlacements:t,groupPlacements:e.groupPlacements}}visualize(){if(this.activeSubSolver&&!this.solved)return this.activeSubSolver.visualize();if(!this.layout){let e=Vw(this.partitionInputProblem);return X0(this.partitionInputProblem,e)}return X0(this.partitionInputProblem,this.layout)}getConstructorParams(){return[this.partitionInputProblem]}};function nhe(e,t,n,o){return{solverName:e,solverClass:t,appliesTo:n,getConstructorParams:o}}var J7r=[nhe("crystalCircuitLayoutSolver",z7r,F7r,(e)=>[{partitionInputProblem:e.partitions[e.currentPartitionIndex]}]),nhe("decouplingCapRowSolver",Q7r,R7r,(e)=>[{partitionInputProblem:e.partitions[e.currentPartitionIndex]}]),nhe("parallelAlignedPassiveSolver",N7r,(e)=>Idn(e).length>0,(e)=>[{partitionInputProblem:e.partitions[e.currentPartitionIndex],pinIdToStronglyConnectedPins:e.pinIdToStronglyConnectedPins}]),nhe("parallelSeriesBranchSolver",q7r,$7r,(e)=>[{partitionInputProblem:e.partitions[e.currentPartitionIndex],pinIdToStronglyConnectedPins:e.pinIdToStronglyConnectedPins}]),nhe("singleInnerPartitionPackingSolver",$Ze,()=>!0,(e)=>[{partitionInputProblem:e.partitions[e.currentPartitionIndex],pinIdToStronglyConnectedPins:e.pinIdToStronglyConnectedPins}])],Z7r=class extends CA{partitions;packedPartitions=[];completedSolvers=[];activeSolver=null;currentPartitionIndex=0;pinIdToStronglyConnectedPins;constructor(e){super();this.partitions=e.partitions,this.pinIdToStronglyConnectedPins=e.pinIdToStronglyConnectedPins}_step(){if(this.currentPartitionIndex>=this.partitions.length){this.solved=!0;return}if(!this.activeSolver){let e=this.partitions[this.currentPartitionIndex],t=J7r.find((o)=>o.appliesTo(e)),n=t.getConstructorParams(this);this.activeSolver=new t.solverClass(...n),this.activeSubSolver=this.activeSolver}if(this.activeSolver.step(),this.activeSolver.failed){this.failed=!0,this.error=`Partition ${this.currentPartitionIndex} failed: ${this.activeSolver.error}`;return}if(this.activeSolver.solved){if(this.completedSolvers.push(this.activeSolver),this.activeSolver.layout)this.packedPartitions.push({inputProblem:this.partitions[this.currentPartitionIndex],layout:this.activeSolver.layout});else{this.failed=!0,this.error=`Partition ${this.currentPartitionIndex} completed but has no layout`;return}this.activeSolver=null,this.activeSubSolver=null,this.currentPartitionIndex++}}visualize(){if(this.activeSolver)return this.activeSolver.visualize();if(this.completedSolvers.length===0){let n=this.partitions.map((r)=>{let i=Vw(r);return X0(r,i)}),o=this.partitions.map((r,i)=>`partition${i}`);return hR(n,{titles:o})}let e=this.completedSolvers.map((n)=>n.visualize()),t=this.completedSolvers.map((n,o)=>`packed_partition_${o}`);return hR(e,{titles:t})}getConstructorParams(){return[this.partitions]}};var GZe=0.000001,qhn=2,Jhn=["x+","y+","x-","y-"],L6e=(e,t)=>e===t?0:e<t?-1:1,Zhn=(e,t)=>{let n=(Math.round(t/90)%4+4)%4,o=Jhn.indexOf(e);return Jhn[(o+n)%4]},O6e=(e,t,n)=>{let o=e.chipPinMap[t],r=us(o.offset,n.ccwRotationDegrees);return{x:n.x+r.x,y:n.y+r.y}},eSr=(e,t)=>e.distanceSquared-t.distanceSquared||Math.abs(e.yDelta)-Math.abs(t.yDelta)||L6e(e.anchorChipId,t.anchorChipId)||L6e(e.anchorPinId,t.anchorPinId)||L6e(e.resistorPinId,t.resistorPinId),tSr=(e,t,n,o)=>{let r=o[t],i=o[e.anchorChipId];if(!r||!i)return!0;let s=O6e(n,e.resistorPinId,r),a=O6e(n,e.anchorPinId,i);return Object.entries(o).some(([c,l])=>{if(c===t||c===e.anchorChipId)return!1;let h=n.chipMap[c];if(!h)return!1;let d=Ou(h.size,l.ccwRotationDegrees);return ese(s,a,td({center:l,width:d.x,height:d.y}))})},nSr=({inputProblem:e,chipPlacements:t,pinToNetworkMap:n})=>{let o=HV(e),r=new Map;for(let[s,a]of n){let c=r.get(a)??[];c.push(s),r.set(a,c)}let i=Object.values(e.chipMap).filter((s)=>s.isResistor&&!s.fixedPosition&&s.pins.length===qhn).sort((s,a)=>L6e(s.chipId,a.chipId));for(let s of i){let a=t[s.chipId];if(!a)continue;let c=[];for(let d of s.pins){let u=e.chipPinMap[d],_=n.get(d);if(!u||!_)continue;let p=Zhn(u.side,a.ccwRotationDegrees);if(p!=="x-"&&p!=="x+")continue;let m=p==="x+"?1:-1,A=O6e(e,d,a);for(let g of r.get(_)??[]){let f=o.get(g);if(!f||f.chipId===s.chipId||f.pins.length!==qhn)continue;let y=e.chipPinMap[g],x=t[f.chipId];if(!y||!x)continue;let C=Zhn(y.side,x.ccwRotationDegrees);if(p==="x-"&&C!=="x+"||p==="x+"&&C!=="x-")continue;let b=O6e(e,g,x),I=b.x-A.x,v=b.y-A.y,P=I*m;if(P<=GZe||Math.abs(v)<=GZe||Math.abs(v)>P+GZe)continue;c.push({anchorChipId:f.chipId,anchorPinId:g,resistorPinId:d,yDelta:v,distanceSquared:I*I+v*v})}}c.sort(eSr);let l=c[0];if(!l)continue;let h=a.y;if(!LV({chipIds:[s.chipId],dx:0,dy:l.yDelta,chipPlacements:t,inputProblem:e}))continue;if(tSr(l,s.chipId,e,t))a.y=h}},oSr=class extends CA{packedPartitions;inputProblem;finalLayout=null;packSolver2=null;pinToNetworkMap=null;constructor(e){super();this.packedPartitions=e.packedPartitions,this.inputProblem=e.inputProblem}partitionHasFixedChip(e){let t=this.packedPartitions[e];if(!t)return!1;return Object.values(t.inputProblem.chipMap).some((n)=>n.fixedPosition!==void 0)}_step(){try{if(this.packedPartitions.length===0){this.finalLayout={chipPlacements:{},groupPlacements:{}},this.solved=!0;return}if(this.packedPartitions.length===1){this.finalLayout=this.packedPartitions[0].layout,this.solved=!0;return}let e=this.organizePackedPartitions();if(!this.packSolver2){let t=this.createPackInput(e);this.packSolver2=new Ow(t),this.activeSubSolver=this.packSolver2}if(this.packSolver2.step(),this.packSolver2.failed){this.failed=!0,this.error=`PackSolver2 failed: ${this.packSolver2.error}`;return}if(this.packSolver2.solved){let t=this.applyPackingResult(this.packSolver2.packedComponents,e);this.finalLayout=t,this.solved=!0,this.activeSubSolver=null}}catch(e){this.failed=!0,this.error=`Failed to pack partitions: ${e}`}}buildConnectivityMap(){let e=new Map;for(let t of this.packedPartitions){for(let[n,o]of Object.entries(t.inputProblem.netConnMap)){if(!o)continue;let[r,i]=n.split("-");if(r&&i)e.set(r,i)}for(let[n,o]of Object.entries(t.inputProblem.pinStrongConnMap)){if(!o)continue;let r=n.split("-");if(r.length===2&&r[0]&&r[1]){let i=e.get(r[0])||e.get(r[1]);if(i)e.set(r[0],i),e.set(r[1],i);else e.set(r[0],n),e.set(r[1],n)}}}return e}getConnectivityMap(){return this.pinToNetworkMap??=this.buildConnectivityMap(),this.pinToNetworkMap}organizePackedPartitions(){let e=[];for(let t=0;t<this.packedPartitions.length;t++){let n=this.packedPartitions[t],o=Object.keys(n.layout.chipPlacements);if(o.length>0){let r=1/0,i=-1/0,s=1/0,a=-1/0;for(let c of o){let l=n.layout.chipPlacements[c],h=n.inputProblem.chipMap[c],d=h.size.x,u=h.size.y;if(l.ccwRotationDegrees===90||l.ccwRotationDegrees===270)[d,u]=[u,d];let _=l.x-d/2,p=l.x+d/2,m=l.y-u/2,A=l.y+u/2;r=Math.min(r,_),i=Math.max(i,p),s=Math.min(s,m),a=Math.max(a,A)}e.push({partitionIndex:t,chipIds:o,bounds:{minX:r,maxX:i,minY:s,maxY:a}})}}return e}createPackInput(e){let t=this.getConnectivityMap();return{components:e.map((o)=>{let r=this.packedPartitions[o.partitionIndex],i=this.partitionHasFixedChip(o.partitionIndex),s=o.bounds.maxX-o.bounds.minX,a=o.bounds.maxY-o.bounds.minY,c=(o.bounds.minX+o.bounds.maxX)/2,l=(o.bounds.minY+o.bounds.maxY)/2,h=[{padId:`partition_${o.partitionIndex}_body`,networkId:`partition_${o.partitionIndex}_disconnected`,type:"rect",offset:{x:0,y:0},size:{x:Math.max(s,0.1),y:Math.max(a,0.1)}}],d=new Set;for(let u of o.chipIds){let _=r.layout.chipPlacements[u],p=r.inputProblem.chipMap[u];for(let m of p.pins){let A=r.inputProblem.chipPinMap[m];if(!A)continue;let g={x:A.offset.x,y:A.offset.y},f=_.ccwRotationDegrees??0;if(f===90)g={x:-A.offset.y,y:A.offset.x};else if(f===180)g={x:-A.offset.x,y:-A.offset.y};else if(f===270)g={x:A.offset.y,y:-A.offset.x};let y=_.x+g.x,x=_.y+g.y,C=t.get(m)??`${m}_disconnected`;if(!d.has(C))d.add(C),h.push({padId:`${o.partitionIndex}_pin_${m}`,networkId:C,type:"rect",offset:{x:y-c,y:x-l},size:{x:0.01,y:0.01}})}}return{componentId:`partition_${o.partitionIndex}`,pads:h,availableRotationDegrees:[0],...i&&{isStatic:!0,center:{x:c,y:l},ccwRotationOffset:0}}}),minGap:this.inputProblem.partitionGap,packOrderStrategy:"largest_to_smallest",packPlacementStrategy:"minimum_sum_squared_distance_to_network"}}applyPackingResult(e,t){let n={};for(let r of e){let i=parseInt(r.componentId.replace("partition_","")),s=t.find((c)=>c.partitionIndex===i),a=this.packedPartitions[i];if(s&&a){let c=(s.bounds.minX+s.bounds.maxX)/2,l=(s.bounds.minY+s.bounds.maxY)/2,h=r.center.x,d=r.center.y,u=h-c,_=d-l;for(let p of s.chipIds){let m=a.layout.chipPlacements[p];n[p]={x:m.x+u,y:m.y+_,ccwRotationDegrees:m.ccwRotationDegrees}}}}let o={chipPlacements:n,groupPlacements:{}};return nSr({inputProblem:this.inputProblem,chipPlacements:o.chipPlacements,pinToNetworkMap:this.getConnectivityMap()}),o}getCombinedPackedPartitionsProblem(){let e={chipMap:{},chipPinMap:{},pinStrongConnMap:{},netMap:{},netConnMap:{},chipGap:this.inputProblem.chipGap,partitionGap:this.inputProblem.partitionGap};for(let t of this.packedPartitions)Object.assign(e.chipMap,t.inputProblem.chipMap),Object.assign(e.chipPinMap,t.inputProblem.chipPinMap),Object.assign(e.pinStrongConnMap,t.inputProblem.pinStrongConnMap),Object.assign(e.netMap,t.inputProblem.netMap),Object.assign(e.netConnMap,t.inputProblem.netConnMap);return e}getCombinedPackedPartitionsLayout(){let e={};for(let t of this.packedPartitions)Object.assign(e,t.layout.chipPlacements);return{chipPlacements:e,groupPlacements:{}}}visualize(){if(this.packSolver2&&!this.solved)return this.packSolver2.visualize();if(!this.finalLayout){if(this.packedPartitions.length===0)return super.visualize();return X0(this.getCombinedPackedPartitionsProblem(),this.getCombinedPackedPartitionsLayout())}return X0(this.getCombinedPackedPartitionsProblem(),this.finalLayout)}getConstructorParams(){return{packedPartitions:this.packedPartitions,inputProblem:this.inputProblem}}},rSr=0.2,edn=(e,t)=>t.y+us(e.offset,t.ccwRotationDegrees).y,j6e=({upperPin:e,upperPlacement:t,lowerPin:n,lowerPlacement:o})=>edn(e,t)-edn(n,o)-rSr,tdn=({chipId:e,side:t},n)=>n.chipMap[e]?.pins.filter((r)=>!t||n.chipPinMap[r]?.side===t).map((r)=>n.chipPinMap[r]).find((r)=>r&&Object.values(n.netMap).some((i)=>i.isPositiveVoltageSource&&n.netConnMap[`${r.pinId}-${i.netId}`])),jZe=(e,{inputProblem:t,layout:n})=>{let o=n.chipPlacements[e],r=t.chipMap[e];if(!o||!r)return null;let i=Ou(r.size,o.ccwRotationDegrees);return td({center:o,width:i.x,height:i.y})},ndn=(e,t)=>{let n=e.flatMap((o)=>{let r=jZe(o,t);if(!r)return[];return[{x:r.minX,y:r.minY},{x:r.maxX,y:r.maxY}]});return Ms(n)},iSr=({mainPartition:e,mainChipId:t,side:n},o)=>{let r=new Set(o.chipMap[t]?.pins.filter((s)=>o.chipPinMap[s]?.side===n)),i=HV(e.inputProblem);for(let[s,a]of Object.entries(o.pinStrongConnMap)){if(!a)continue;let[c,l]=s.split("-"),h=r.has(c)?l:r.has(l)?c:null;if(!h)continue;let d=i.get(h);if(d?.chipId===t)continue;if(d)return d.chipId}return null},sSr=({partitionA:e,partitionB:t},n)=>{let o=new Set(Object.keys(e.inputProblem.chipPinMap)),r=new Set(Object.keys(t.inputProblem.chipPinMap));return Object.entries(n.pinStrongConnMap).some(([i,s])=>{if(!s)return!1;let[a,c]=i.split("-");return o.has(a)&&r.has(c)||o.has(c)&&r.has(a)})},aSr=(e,t)=>{let n=new Set(e);return e.some((o)=>{let r=jZe(o,t);return Object.keys(t.layout.chipPlacements).some((i)=>{if(!r||n.has(i))return!1;let s=jZe(i,t);return s?yp(r,s):!1})})},cSr=({side:e,chipGap:t,mainBounds:n,rowBounds:o,neighbor:r})=>{let i=b4(o),s={x:r.x-i.x,y:r.y-i.y};if(e==="x+")s.x=n.maxX+t-o.minX;if(e==="x-")s.x=n.minX-t-o.maxX;if(e==="y+")s.y=n.maxY+t-o.minY;if(e==="y-")s.y=n.minY-t-o.maxY;return s},lSr=({layout:e,decouplingPartition:t},{inputProblem:n,packedPartitions:o})=>{let r=t.inputProblem,{decouplingMainChipId:i,decouplingMainChipSide:s}=r;if(r.partitionType!=="decoupling_caps"||!i||!s)return;let a=o.find((f)=>f!==t&&f.inputProblem.chipMap[i]);if(!a||sSr({partitionA:t,partitionB:a},n))return;let c=iSr({mainPartition:a,mainChipId:i,side:s},n),l=e.chipPlacements[i];if(c)l=e.chipPlacements[c];let h=Object.keys(r.chipMap),d={inputProblem:n,layout:e},u=ndn(Object.keys(a.inputProblem.chipMap),d),_=ndn(h,d);if(!l||!u||!_)return;if(!c){let f=h[0],y=tdn({chipId:i,side:s},n),x=f&&tdn({chipId:f},n),C=f&&e.chipPlacements[f];if(!y||!x||!C)return;l={...l,y:l.y+j6e({upperPin:y,upperPlacement:l,lowerPin:x,lowerPlacement:{...C,y:l.y}})}}let p=n.chipGap;if(!c)p=n.partitionGap;let m=cSr({side:s,chipGap:p,mainBounds:u,rowBounds:_,neighbor:l}),A=X6e.translate(m.x,m.y),g=new Map;for(let f of h){let y=e.chipPlacements[f];if(!y)continue;g.set(f,y),e.chipPlacements[f]={...y,...X6e.applyToPoint(A,y)}}if(aSr(h,d))for(let[f,y]of g)e.chipPlacements[f]=y},hSr=class extends CA{constructor(e){super();this.options=e}options;outputLayout=null;_step(){this.outputLayout=structuredClone(this.options.inputLayout);for(let e of this.options.packedPartitions)lSr({layout:this.outputLayout,decouplingPartition:e},this.options);this.solved=!0}visualize(){return X0(this.options.inputProblem,this.outputLayout??this.options.inputLayout)}getConstructorParams(){return[this.options]}},dSr=[0,90,180,270],odn=0,Q6e=0.5,rdn=({chip:e,upperPinId:t,lowerPinId:n,inputProblem:o})=>{let r=o.chipPinMap[t],i=o.chipPinMap[n];if(!r||!i)return odn;let s=e.availableRotations??dSr,a=odn,c=Number.NEGATIVE_INFINITY;for(let l of s){let h=us(r.offset,l),d=us(i.offset,l),u=h.y-d.y;if(u<=c)continue;c=u,a=l}return a},uSr=({railLoadPairs:e,inputProblem:t,inputLayout:n})=>{let o=structuredClone(n),{chipPlacements:r}=o,i=new Map;for(let s of e){let a=i.get(s.mainChipId)??[];a.push(s),i.set(s.mainChipId,a)}for(let s of i.values()){let a;for(let c of s){let l=r[c.railComponent.chipId],h=r[c.resistor.chipId],d=r[c.mainChipId],u=t.chipPinMap[c.mainPinId];if(!l||!h)continue;if(!d||!u)continue;let _=rdn({chip:c.railComponent,upperPinId:c.railPinId,lowerPinId:c.railComponentResistorPinId,inputProblem:t}),p=rdn({chip:c.resistor,upperPinId:c.resistorRailComponentPinId,lowerPinId:c.resistorMainPinId,inputProblem:t}),m=Ou(c.railComponent.size,_),A=Ou(c.resistor.size,p),g=m.y*Q6e+t.chipGap+A.y*Q6e,f=us(u.offset,d.ccwRotationDegrees),y=t.chipPinMap[c.resistorMainPinId];if(!y)continue;let x=us(y.offset,p),C=(l.x+h.x)*Q6e,b=d.y+f.y-x.y,I=b+g;r[c.railComponent.chipId]={x:C,y:I,ccwRotationDegrees:_},r[c.resistor.chipId]={x:C,y:b,ccwRotationDegrees:p};let v=Math.max(m.x,A.x)*Q6e,P=C-v,M=C+v;if(a!==void 0){let B=a+t.partitionGap-P;C+=B,r[c.railComponent.chipId].x=C,r[c.resistor.chipId].x=C,a=M+B;continue}a=M}}return v7r({railLoadPairs:e,inputProblem:t,chipPlacements:r}),o},idn=2,sdn=({connectedPinsByPinId:e,pinId:t})=>(e[t]??[]).map((n)=>n.pinId),pSr=({inputProblem:e,pinId:t})=>{for(let[n,o]of Object.entries(e.netMap)){if(!o.isPositiveVoltageSource)continue;if(e.netConnMap[`${t}-${n}`])return!0}return!1},mSr=(e,t)=>{let{inputProblem:n,pinOwnerMap:o,connectedPinsByPinId:r}=t;for(let i of e.pins){let s=sdn({connectedPinsByPinId:r,pinId:i}).find((u)=>{let _=o.get(u);if(!_)return!1;return _.pins.length>idn&&!_.isCrystal});if(!s)continue;let a=o.get(s);if(!a)continue;let c=e.pins.find((u)=>u!==i);if(!c)continue;let l=sdn({connectedPinsByPinId:r,pinId:c}).find((u)=>{let _=o.get(u);if(!_)return!1;if(_.pins.length!==idn)return!1;return!_.isResistor&&!_.isCapacitor&&!_.fixedPosition});if(!l)continue;let h=o.get(l);if(!h)continue;let d=h.pins.find((u)=>u!==l&&pSr({inputProblem:n,pinId:u}));if(!d)continue;return{railComponent:h,resistor:e,railPinId:d,railComponentResistorPinId:l,resistorRailComponentPinId:c,resistorMainPinId:i,mainChipId:a.chipId,mainPinId:s}}return null},_Sr=(e)=>{let t={inputProblem:e,pinOwnerMap:HV(e),connectedPinsByPinId:Kq(e)},n=[];for(let o of Object.values(e.chipMap)){if(!o.isResistor||o.fixedPosition)continue;let r=mSr(o,t);if(r)n.push(r)}return n},gSr=class extends CA{constructor(e){super();this.params=e}params;outputLayout=null;_step(){let e=_Sr(this.params.inputProblem);this.outputLayout=uSr({railLoadPairs:e,inputProblem:this.params.inputProblem,inputLayout:this.params.inputLayout}),this.solved=!0}visualize(){let e=this.params.inputLayout;if(this.outputLayout)e=this.outputLayout;return X0(this.params.inputProblem,e)}getConstructorParams(){return[this.params]}},NQ=2,H6e=({connectedPinsByPinId:e,pinId:t})=>(e[t]??[]).map((n)=>n.pinId),K6e=({inputProblem:e,pinId:t})=>{let n=[];for(let o of Object.keys(e.netMap))if(e.netConnMap[`${t}-${o}`])n.push(o);return n},Pdn=({inputProblem:e,netId:t})=>{let n=[];for(let o of Object.keys(e.chipPinMap))if(e.netConnMap[`${o}-${t}`])n.push(o);return n},qZe=({lowerChip:e,lowerInnerPinId:t,inputProblem:n})=>{for(let o of e.pins){if(o===t)continue;let r=K6e({inputProblem:n,pinId:o}).find((i)=>n.netMap[i]?.isGround===!0);if(r)return{groundPinId:o,groundNetId:r}}return null},ASr=({inputProblem:e,pinId:t})=>K6e({inputProblem:e,pinId:t}).some((n)=>e.netMap[n]?.isPositiveVoltageSource===!0),Edn=({upperInnerPinId:e},t)=>{let{inputProblem:n,pinOwnerMap:o,connectedPinsByPinId:r,pairedChipIds:i}=t;for(let s of H6e({connectedPinsByPinId:r,pinId:e})){let a=o.get(s);if(!a)continue;if(a.pins.length!==NQ)continue;if(a.fixedPosition)continue;if(i.has(a.chipId))continue;let c=qZe({lowerChip:a,lowerInnerPinId:s,inputProblem:n});if(!c)continue;return{lowerChip:a,lowerInnerPinId:s,...c}}return null},fSr=(e,t)=>{let{inputProblem:n,pinOwnerMap:o,connectedPinsByPinId:r,pairedChipIds:i}=t;for(let s of e.pins){let a=H6e({connectedPinsByPinId:r,pinId:s}).find((_)=>{let p=o.get(_);if(!p)return!1;return p.pins.length>NQ&&!p.isCrystal});if(!a)continue;let c=o.get(a);if(!c)continue;let l=e.pins.find((_)=>_!==s);if(!l)continue;let h=H6e({connectedPinsByPinId:r,pinId:l}).map((_)=>o.get(_)).find((_)=>{if(!_)return!1;if(_.pins.length!==NQ)return!1;if(_.chipId===e.chipId)return!1;if(_.fixedPosition)return!1;return!i.has(_.chipId)});if(!h)continue;let d=h.pins.find((_)=>H6e({connectedPinsByPinId:r,pinId:_}).some((p)=>o.get(p)?.chipId===e.chipId));if(!d)continue;let u=qZe({lowerChip:h,lowerInnerPinId:d,inputProblem:n});if(!u)continue;return{upperChip:e,lowerChip:h,mainChipId:c.chipId,mainPinId:a,upperOuterPinId:s,upperInnerPinId:l,lowerInnerPinId:d,...u}}return null},ySr=(e,t)=>{let{inputProblem:n,pinOwnerMap:o,pairedChipIds:r}=t,i=e.pins.find((_)=>ASr({inputProblem:n,pinId:_}));if(!i)return null;let s=e.pins.find((_)=>_!==i);if(!s)return null;let a=Edn({upperInnerPinId:s},t);if(a)return{upperChip:e,upperOuterPinId:i,upperInnerPinId:s,...a};let c=K6e({inputProblem:n,pinId:s}).find((_)=>{let p=n.netMap[_];return!p?.isGround&&!p?.isPositiveVoltageSource});if(!c)return null;let l=Pdn({inputProblem:n,netId:c});if(l.length!==NQ)return null;let h=l.find((_)=>_!==s);if(!h)return null;let d=o.get(h);if(!d)return null;if(d.pins.length!==NQ)return null;if(d.fixedPosition)return null;if(r.has(d.chipId))return null;let u=qZe({lowerChip:d,lowerInnerPinId:h,inputProblem:n});if(!u)return null;return{upperChip:e,lowerChip:d,upperOuterPinId:i,upperInnerPinId:s,lowerInnerPinId:h,...u}},xSr=(e,t)=>{let{inputProblem:n}=t;for(let o of e.pins){if(!K6e({inputProblem:n,pinId:o}).some((a)=>{let c=n.netMap[a];if(c?.isGround||c?.isPositiveVoltageSource)return!1;return Pdn({inputProblem:n,netId:a}).length===1}))continue;let i=e.pins.find((a)=>a!==o);if(!i)continue;let s=Edn({upperInnerPinId:i},t);if(!s)continue;return{upperChip:e,upperOuterPinId:o,upperInnerPinId:i,...s,isStandaloneSignalChain:!0}}return null},CSr=(e)=>{let t=HV(e),n=[],o=new Set,r=Kq(e),i={inputProblem:e,pinOwnerMap:t,connectedPinsByPinId:r,pairedChipIds:o};for(let s of Object.values(e.chipMap)){if(s.pins.length!==NQ)continue;if(s.isCrystal)continue;if(s.fixedPosition)continue;if(o.has(s.chipId))continue;let a=fSr(s,i);if(!a)continue;n.push(a),o.add(a.upperChip.chipId),o.add(a.lowerChip.chipId)}for(let s of Object.values(e.chipMap)){if(s.pins.length!==NQ)continue;if(s.isCrystal)continue;if(s.fixedPosition)continue;if(o.has(s.chipId))continue;let a=xSr(s,i);if(!a)continue;n.push(a),o.add(a.upperChip.chipId),o.add(a.lowerChip.chipId)}for(let s of Object.values(e.chipMap)){if(s.pins.length!==NQ)continue;if(s.isCrystal)continue;if(s.fixedPosition)continue;if(o.has(s.chipId))continue;let a=ySr(s,i);if(!a)continue;n.push(a),o.add(a.upperChip.chipId),o.add(a.lowerChip.chipId)}return n},bSr=[0,90,180,270],adn=0,UZe=0.5,cdn=({chip:e,upperPinId:t,lowerPinId:n,inputProblem:o})=>{let r=o.chipPinMap[t],i=o.chipPinMap[n];if(!r||!i)return adn;let s=bSr;if(e.availableRotations)s=e.availableRotations;let a=adn,c=Number.NEGATIVE_INFINITY;for(let l of s){let h=us(r.offset,l),d=us(i.offset,l),u=h.y-d.y;if(u<=c)continue;c=u,a=l}return a},WZe=({chip:e,placement:t})=>{let n=Ou(e.size,t.ccwRotationDegrees);return td({center:t,width:n.x,height:n.y})},ISr=({groundedLoadPair:e,chipPlacements:t,inputProblem:n})=>{let o=t[e.upperChip.chipId],r=t[e.lowerChip.chipId];if(!o||!r)return;let i=WZe({chip:e.upperChip,placement:o}),s=WZe({chip:e.lowerChip,placement:r}),a=Ms([{x:i.minX,y:i.minY},{x:i.maxX,y:i.maxY},{x:s.minX,y:s.minY},{x:s.maxX,y:s.maxY}]);if(!a)return;let c=0;for(let[l,h]of Object.entries(t)){if(l===e.upperChip.chipId)continue;if(l===e.lowerChip.chipId)continue;let d=n.chipMap[l];if(!d)continue;let u=WZe({chip:d,placement:h});if(a.maxX+n.chipGap<=u.minX||a.minX-n.chipGap>=u.maxX)continue;if(u.maxY<=a.maxY)continue;let p=a.maxY+n.chipGap-u.minY;c=Math.max(c,p)}o.y-=c,r.y-=c},vSr=({groundedLoadPair:e,chipPlacements:t,inputProblem:n})=>{let o=t[e.upperChip.chipId],r=t[e.lowerChip.chipId];if(!o||!r)return;let i=cdn({chip:e.upperChip,upperPinId:e.upperOuterPinId,lowerPinId:e.upperInnerPinId,inputProblem:n}),s=cdn({chip:e.lowerChip,upperPinId:e.lowerInnerPinId,lowerPinId:e.groundPinId,inputProblem:n}),a=Ou(e.upperChip.size,i),c=Ou(e.lowerChip.size,s),l=a.y*UZe+n.chipGap+c.y*UZe,h=n.chipPinMap[e.upperInnerPinId],d=n.chipPinMap[e.lowerInnerPinId];if(!h||!d)return;let u=us(h.offset,i),_=us(d.offset,s),p=Ms([o,r]);if(!p)return;let m=b4(p),A={x:m.x-u.x,y:m.y+l*UZe,ccwRotationDegrees:i},g=e.mainPinId;if(g){let f=e.mainChipId;if(!f)return;let y=t[f];if(!y)return;let x=n.chipPinMap[e.upperOuterPinId],C=n.chipPinMap[g];if(!x||!C)return;let b=us(x.offset,o.ccwRotationDegrees),I=us(x.offset,i);A.x=o.x+b.x-I.x,A.y=o.y+b.y-I.y,A.y+=j6e({upperPin:C,upperPlacement:y,lowerPin:x,lowerPlacement:A})}t[e.upperChip.chipId]=A,t[e.lowerChip.chipId]={x:A.x+u.x-_.x,y:A.y-l,ccwRotationDegrees:s},ISr({groundedLoadPair:e,chipPlacements:t,inputProblem:n})},Mdn=2,RQ=(e,t)=>{let{chipPlacements:n}=t,o=n[e.upperChip.chipId],r=n[e.lowerChip.chipId],i=Yw({placement:o,size:e.upperChip.size}),s=Yw({placement:r,size:e.lowerChip.size});return{minX:Math.min(i.minX,s.minX),maxX:Math.max(i.maxX,s.maxX),minY:Math.min(i.minY,s.minY),maxY:Math.max(i.maxY,s.maxY)}},ldn=(e,t)=>{let{chipPlacements:n,inputProblem:o}=t,r=n[e.lowerChip.chipId],i=o.chipPinMap[e.groundPinId],s=us(i.offset,r.ccwRotationDegrees);return r.y+s.y},V6e=({groundedLoadPair:e,dx:t,dy:n},o)=>{let{chipPlacements:r}=o;for(let i of[e.upperChip.chipId,e.lowerChip.chipId]){let s=r[i];s.x+=t,s.y+=n}},Y6e=(e,t)=>RQ(e,t).minX,hdn=(e,t)=>{let n=e.map((o)=>RQ(o,t));return{minX:Math.min(...n.map((o)=>o.minX)),maxX:Math.max(...n.map((o)=>o.maxX)),minY:Math.min(...n.map((o)=>o.minY)),maxY:Math.max(...n.map((o)=>o.maxY))}},wdn=(e,t,n)=>e.maxY+n<=t.minY||t.maxY+n<=e.minY,SSr=(e,t,n)=>{let{inputProblem:o}=n,r=RQ(e,n),i=RQ(t,n),s=r.maxX+o.chipGap<=i.minX||i.maxX+o.chipGap<=r.minX,a=wdn(r,i,o.chipGap);return!s&&!a},PSr=(e,t)=>{let n=new Set(e),o=[];while(n.size>0){let r=n.values().next().value;if(!r)break;n.delete(r);let i=[r];for(let s=0;s<i.length;s++){let a=i[s];for(let c of[...n]){if(!SSr(a,c,t))continue;n.delete(c),i.push(c)}}if(i.length>=Mdn)o.push(i)}return o},ESr=(e,t)=>{let{inputProblem:n}=t,o=[...e].sort((a,c)=>Y6e(a,t)-Y6e(c,t)),r=o.map((a)=>ldn(a,t)),i=Math.min(...r);for(let a of o){let c=ldn(a,t);V6e({groundedLoadPair:a,dx:0,dy:i-c},t)}let s;for(let a of o){let c=RQ(a,t);if(s===void 0){s=c.maxX;continue}let l=s+n.partitionGap-c.minX;V6e({groundedLoadPair:a,dx:l,dy:0},t),s=c.maxX+l}},MSr=(e,t)=>{let{inputProblem:n}=t,o=[...e].sort((c,l)=>Y6e(c,t)-Y6e(l,t)),r=hdn(o,t),i=[];for(let c of o){let l=RQ(c,t),h=l.minX;for(let d of i){let u=RQ(d,t);if(wdn(u,l,n.chipGap))continue;h=Math.max(h,u.maxX+n.chipGap)}V6e({groundedLoadPair:c,dx:h-l.minX,dy:0},t),i.push(c)}let s=hdn(o,t),a=(r.minX+r.maxX-s.minX-s.maxX)/2;for(let c of o)V6e({groundedLoadPair:c,dx:a,dy:0},t)},wSr=({groundedLoadPairs:e,chipPlacements:t,inputProblem:n})=>{let o={chipPlacements:t,inputProblem:n},r=new Map;for(let s of e){if(!t[s.upperChip.chipId])continue;if(!t[s.lowerChip.chipId])continue;if(!n.chipPinMap[s.groundPinId])continue;let a=r.get(s.groundNetId)??new Map,c=a.get(s.mainChipId)??[];c.push(s),a.set(s.mainChipId,c),r.set(s.groundNetId,a)}for(let s of r.values())for(let a of s.values()){if(a.length<Mdn)continue;if(a[0].mainChipId===void 0){ESr(a,o);continue}for(let l of PSr(a,o))MSr(l,o)}let i=DSr({groundedLoadPairs:e,chipPlacements:t,inputProblem:n});I7r({groundedLoadPairs:e.filter((s)=>!i.has(s)),chipPlacements:t,inputProblem:n})},BSr={"x-":{x:-1,y:0},"x+":{x:1,y:0},"y-":{x:0,y:-1},"y+":{x:0,y:1}},TSr=2,DSr=({inputProblem:e,chipPlacements:t,groundedLoadPairs:n})=>{let o=new Set,r=new Set(n);for(let i of r){if(!i.mainChipId||!i.mainPinId)continue;let s=e.chipPinMap[i.mainPinId],a=n.filter((u)=>u.mainChipId===i.mainChipId&&u.mainPinId&&e.chipPinMap[u.mainPinId].side===s.side);if(a.length<TSr)continue;let c=t[i.mainChipId],l=us(BSr[s.side],c.ccwRotationDegrees);if(l.x===0)continue;a.sort((u,_)=>{let p=us(e.chipPinMap[u.mainPinId].offset,c.ccwRotationDegrees),m=us(e.chipPinMap[_.mainPinId].offset,c.ccwRotationDegrees);return p.y-m.y});let h=Yw({placement:c,size:e.chipMap[i.mainChipId].size}),d;for(let u of a){r.delete(u);let _=e.chipPinMap[u.mainPinId],p=[u.upperChip.chipId,u.lowerChip.chipId],m=a.filter((b)=>b===u||r.has(b)).flatMap((b)=>[b.upperChip.chipId,b.lowerChip.chipId]),A=t[u.upperChip.chipId],g=j6e({upperPin:_,upperPlacement:c,lowerPin:e.chipPinMap[u.upperOuterPinId],lowerPlacement:A}),{minX:f,maxX:y}=RQ(u,{chipPlacements:t,inputProblem:e}),x=Math.max(0,h.maxX+e.chipGap-f);if(l.x<0)x=Math.min(0,h.minX-e.chipGap-y);if(d!==void 0)if(l.x<0)x=Math.min(x,d-e.chipGap-y);else x=Math.max(x,d+e.chipGap-f);let C=[x];for(let[b,I]of Object.entries(t)){if(m.includes(b))continue;let v=Yw({placement:I,size:e.chipMap[b].size}),P=v.maxX+e.chipGap-f;if(l.x<0)P=v.minX-e.chipGap-y;if(P*l.x<x*l.x)continue;C.push(P)}C.sort((b,I)=>Math.abs(b)-Math.abs(I));for(let b of C)if(LV({chipIds:p,clearanceGroupChipIds:m,dx:b,dy:g,chipPlacements:t,inputProblem:e})){if(o.add(u),d=y+b,l.x<0)d=f+b;break}}}return o},NSr=class extends CA{constructor(e){super();this.params=e}params;outputLayout=null;groundedLoadPairs=[];_step(){let e={};for(let[t,n]of Object.entries(this.params.inputLayout.chipPlacements))e[t]={...n};this.groundedLoadPairs=CSr(this.params.inputProblem);for(let t of this.groundedLoadPairs)vSr({groundedLoadPair:t,chipPlacements:e,inputProblem:this.params.inputProblem});wSr({groundedLoadPairs:this.groundedLoadPairs,chipPlacements:e,inputProblem:this.params.inputProblem}),this.outputLayout={chipPlacements:e,groupPlacements:{...this.params.inputLayout.groupPlacements}},this.solved=!0}visualize(){let e=this.params.inputLayout;if(this.outputLayout)e=this.outputLayout;return X0(this.params.inputProblem,e)}getConstructorParams(){return[this.params]}},RSr=(e)=>{let t=Object.values(e.inputProblem.chipMap);return t.length>1&&t.every((n)=>n.pins.length===2&&!n.isCapacitor&&!n.fixedPosition)},QSr=({groundedLoadPairs:e,packedPartitions:t})=>{let o=t.filter(RSr).map((i)=>({chipIds:Object.keys(i.inputProblem.chipMap)})),r=new Set(o.flatMap((i)=>i.chipIds));for(let i of e){if(i.mainChipId)continue;if(i.isStandaloneSignalChain)continue;let s=[i.upperChip.chipId,i.lowerChip.chipId];if(s.some((a)=>r.has(a)))continue;o.push({chipIds:s});for(let a of s)r.add(a)}return o},G6e=({chipId:e},t)=>{let n=t.inputProblem.chipMap[e],o=t.layout.chipPlacements[e];if(!n||!o)return null;let r=Ou(n.size,o.ccwRotationDegrees);return td({center:o,width:r.x,height:r.y})},XZe=({chipIds:e},t)=>Ms(e.flatMap((n)=>{let o=G6e({chipId:n},t);if(!o)return[];return[{x:o.minX,y:o.minY},{x:o.maxX,y:o.maxY}]})),ddn=({chipIds:e,railNetIds:t},n)=>{let o=null;for(let r of e){let i=n.inputProblem.chipMap[r];if(!i)continue;let s=n.layout.chipPlacements[i.chipId];if(!s)continue;for(let a of i.pins){if(![...t].some((u)=>n.inputProblem.netConnMap[`${a}-${u}`]))continue;let l=n.inputProblem.chipPinMap[a];if(!l)continue;let h=us(l.offset,s.ccwRotationDegrees),d=s.y+h.y;if(o===null||d>o.y)o={chipId:i.chipId,y:d}}}return o},udn=({chipIds:e},{inputProblem:t})=>{let n=new Set;for(let o of e){let r=t.chipMap[o];if(!r)continue;for(let i of r.pins)for(let[s,a]of Object.entries(t.netMap)){if(!a.isGround&&!a.isPositiveVoltageSource)continue;if(t.netConnMap[`${i}-${s}`])n.add(s)}}return n},kSr=(e,t)=>e.size>=2&&e.size===t.size&&[...e].every((n)=>t.has(n)),LSr=({chipIds:e,offset:t},{layout:n})=>{let o=new Map;for(let r of e){let i=n.chipPlacements[r];if(!i)continue;o.set(r,i),n.chipPlacements[r]={...i,x:i.x+t.x,y:i.y+t.y}}return o},HSr=({movedChipIds:e},t)=>{let n=new Set(e);return e.some((o)=>{let r=G6e({chipId:o},t);if(!r)return!1;return Object.keys(t.layout.chipPlacements).some((i)=>{if(n.has(i))return!1;let s=G6e({chipId:i},t);if(!s)return!1;return yp(r,s)})})},FSr=(e)=>{let{groundedLoadPairs:t,inputProblem:n,packedPartitions:o}=e,r=structuredClone(e.inputLayout),i={inputProblem:n,layout:r},s=o.filter((l)=>l.inputProblem.partitionType==="decoupling_caps"),a=QSr({groundedLoadPairs:t,packedPartitions:o}),c=new Set;for(let l of s){let h=udn({chipIds:Object.keys(l.inputProblem.chipMap)},i),d=Object.keys(l.inputProblem.chipMap),u=XZe({chipIds:d},i);if(!u)continue;let _=ddn({chipIds:d,railNetIds:h},i);if(!_)continue;let p=u.maxX;for(let m of a){if(c.has(m))continue;let A=udn({chipIds:m.chipIds},i);if(!kSr(h,A))continue;let g=m.chipIds;if(!XZe({chipIds:g},i))continue;let y=ddn({chipIds:g,railNetIds:A},i);if(!y)continue;let x=G6e({chipId:y.chipId},i);if(!x)continue;let C=LSr({chipIds:g,offset:{x:p+n.partitionGap-x.minX,y:_.y-y.y}},i);if(HSr({movedChipIds:g},i)){for(let[I,v]of C)r.chipPlacements[I]=v;continue}let b=XZe({chipIds:g},i);if(b)p=b.maxX;c.add(m)}}return r},zSr=class extends CA{constructor(e){super();this.options=e}options;outputLayout=null;_step(){this.outputLayout=FSr(this.options),this.solved=!0}visualize(){return X0(this.options.inputProblem,this.outputLayout??this.options.inputLayout)}getConstructorParams(){return[this.options]}},Bdn=(e,t)=>Object.keys(t.netMap).filter((n)=>t.netConnMap[`${e}-${n}`]),Tdn=(e,t)=>new Set(e.pins.flatMap((n)=>Bdn(n,t))),pdn=({chipId:e,railNetId:t},n)=>{let o=n.chipMap[e]?.pins.find((r)=>Bdn(r,n).includes(t));if(!o)return null;return n.chipPinMap[o]??null},U6e=(e,{inputProblem:t,layout:n})=>{let o=t.chipMap[e],r=n.chipPlacements[e];if(!o||!r)return null;return Yw({placement:r,size:o.size})},mdn=(e,t)=>e.reduce((n,o)=>n+t.chipPlacements[o].x,0)/e.length,OSr=({groundNetId:e,railNetId:t},{inputProblem:n,layout:o})=>Object.values(n.chipMap).filter((r)=>{if(!r.isCapacitor||r.fixedPosition||r.pins.length!==2)return!1;if(!o.chipPlacements[r.chipId])return!1;let i=Tdn(r,n);return i.size===2&&i.has(e)&&i.has(t)}).map((r)=>r.chipId),VSr=(e,t)=>{let{inputProblem:n,layout:o}=t;if(e.fixedPosition||e.pins.length!==3)return null;let r=o.chipPlacements[e.chipId];if(!r)return null;let i=[...Tdn(e,n)],s=i.filter((d)=>n.netMap[d]?.isGround),a=i.filter((d)=>n.netMap[d]?.isPositiveVoltageSource);if(s.length!==1||a.length!==2)return null;let c=a.map((d)=>({railNetId:d,capacitorChipIds:OSr({groundNetId:s[0],railNetId:d},t)}));if(c.some((d)=>d.capacitorChipIds.length===0))return null;let l=c.find((d)=>mdn(d.capacitorChipIds,o)<r.x),h=c.find((d)=>mdn(d.capacitorChipIds,o)>r.x);if(!l||!h)return null;return l.capacitorChipIds.sort((d,u)=>o.chipPlacements[d].x-o.chipPlacements[u].x),h.capacitorChipIds.sort((d,u)=>o.chipPlacements[d].x-o.chipPlacements[u].x),{regulatorChipId:e.chipId,left:l,right:h}},_dn=({group:e,regulatorChipId:t,startX:n,xDirection:o},r)=>{let{inputProblem:i,layout:s}=r,a=s.chipPlacements[t],c=pdn({chipId:t,railNetId:e.railNetId},i);if(!a||!c)return!1;let l=[...e.capacitorChipIds];if(o<0)l.reverse();let h=i.decouplingCapsGap??i.chipGap,d=n;for(let u of l){let _=s.chipPlacements[u],p=U6e(u,r),m=pdn({chipId:u,railNetId:e.railNetId},i);if(!_||!p||!m)return!1;let A=p.maxX-p.minX;s.chipPlacements[u]={..._,x:d+o*A/2,y:_.y+j6e({upperPin:c,upperPlacement:a,lowerPin:m,lowerPlacement:_})},d+=o*(A+h)}return!0},YSr=(e,t)=>{let n=U6e(e.regulatorChipId,t);if(!n)return!1;if(!_dn({group:e.left,regulatorChipId:e.regulatorChipId,startX:n.minX-t.inputProblem.chipGap,xDirection:-1},t))return!1;return _dn({group:e.right,regulatorChipId:e.regulatorChipId,startX:n.maxX+t.inputProblem.chipGap,xDirection:1},t)},GSr=(e,t)=>{let{inputProblem:n,layout:o}=t,r=new Set(e),i=e.map((u)=>U6e(u,t)),s=Math.min(...i.map((u)=>u.minX)),a=Math.min(...i.map((u)=>u.minY)),c=Math.max(...i.map((u)=>u.maxX)),l=Math.max(...i.map((u)=>u.maxY)),h=(s+c)/2,d=0;for(let u of Object.keys(o.chipPlacements)){if(r.has(u))continue;let _=U6e(u,t);if(!_||(_.minX+_.maxX)/2<=h)continue;if(Math.max(_.minY-l,a-_.maxY,0)>=n.partitionGap)continue;d=Math.min(d,_.minX-n.partitionGap-c)}return d},USr=(e,t)=>{let n=structuredClone(t),o={inputProblem:e,layout:n},r=Object.values(e.chipMap).map((c)=>VSr(c,o)).find((c)=>c!==null);if(!r)return n;let i=[...r.left.capacitorChipIds,r.regulatorChipId,...r.right.capacitorChipIds];if(!YSr(r,o))return t;let a=GSr(i,o);if(!LV({chipIds:i,clearanceGroupChipIds:i,dx:a,dy:0,chipPlacements:n.chipPlacements,inputProblem:e,minimumOutsideGap:e.partitionGap}))return t;return n},WSr=class extends CA{constructor(e){super();this.params=e}params;outputLayout=null;_step(){this.outputLayout=USr(this.params.inputProblem,this.params.inputLayout),this.solved=!0}visualize(){let e=this.params.inputLayout;if(this.outputLayout)e=this.outputLayout;return X0(this.params.inputProblem,e)}getConstructorParams(){return[this.params]}};function bb(e,t,n,o={}){return{solverName:e,solverClass:t,getConstructorParams:n,onSolved:o.onSolved}}var $6e=class extends CA{getSolverName(){return"LayoutPipelineSolver"}identifyCrystalCircuitsSolver;identifyDecouplingCapsSolver;chipPartitionsSolver;packInnerPartitionsSolver;partitionPackingSolver;groundedLoadPairSolver;alignPowerGroundRowsSolver;alignTestPointsSolver;placeNetOnlyDecouplingRowsSolver;placeRailConnectedLoadsSolver;alignChipConnectedRailLoadsSolver;alignRegulatorCapacitorRowSolver;startTimeOfPhase;endTimeOfPhase;timeSpentOnPhase;firstIterationOfPhase;pinIdToStronglyConnectedPins;inputProblem;chipPartitions;packedPartitions;pipelineDef=[bb("identifyCrystalCircuitsSolver",$8r,()=>[this.inputProblem]),bb("identifyDecouplingCapsSolver",K8r,()=>[this.inputProblem],{onSolved:(e)=>{}}),bb("chipPartitionsSolver",G8r,()=>[{inputProblem:this.inputProblem,decouplingCapGroups:this.identifyDecouplingCapsSolver?.outputDecouplingCapGroups,crystalCircuitGroups:this.identifyCrystalCircuitsSolver?.outputCrystalCircuitGroups}],{onSolved:(e)=>{this.chipPartitions=this.chipPartitionsSolver.partitions}}),bb("packInnerPartitionsSolver",Z7r,()=>[{partitions:this.chipPartitions,pinIdToStronglyConnectedPins:this.pinIdToStronglyConnectedPins}],{onSolved:(e)=>{this.packedPartitions=this.packInnerPartitionsSolver.packedPartitions}}),bb("partitionPackingSolver",oSr,()=>[{packedPartitions:this.packedPartitions||[],inputProblem:this.inputProblem}],{onSolved:(e)=>{}}),bb("alignPowerGroundRowsSolver",J8r,()=>[{inputProblem:this.inputProblem,inputLayout:this.partitionPackingSolver.finalLayout}]),bb("placeNetOnlyDecouplingRowsSolver",hSr,()=>[{inputProblem:this.inputProblem,packedPartitions:this.packedPartitions,inputLayout:this.alignPowerGroundRowsSolver.outputLayout}]),bb("groundedLoadPairSolver",NSr,()=>[{inputProblem:this.inputProblem,inputLayout:this.placeNetOnlyDecouplingRowsSolver.outputLayout}]),bb("placeRailConnectedLoadsSolver",zSr,()=>[{inputProblem:this.inputProblem,groundedLoadPairs:this.groundedLoadPairSolver.groundedLoadPairs,packedPartitions:this.packedPartitions,inputLayout:this.groundedLoadPairSolver.outputLayout}]),bb("alignChipConnectedRailLoadsSolver",gSr,()=>[{inputProblem:this.inputProblem,inputLayout:this.placeRailConnectedLoadsSolver.outputLayout}]),bb("alignRegulatorCapacitorRowSolver",WSr,()=>[{inputProblem:this.inputProblem,inputLayout:this.alignChipConnectedRailLoadsSolver.outputLayout??this.placeRailConnectedLoadsSolver.outputLayout}]),bb("alignTestPointsSolver",A7r,()=>[{inputProblem:this.inputProblem,inputLayout:this.alignRegulatorCapacitorRowSolver.outputLayout??this.alignChipConnectedRailLoadsSolver.outputLayout??this.placeRailConnectedLoadsSolver.outputLayout??this.groundedLoadPairSolver.outputLayout??this.placeNetOnlyDecouplingRowsSolver.outputLayout??this.alignPowerGroundRowsSolver.outputLayout??this.partitionPackingSolver.finalLayout}])];constructor(e){super();this.inputProblem=e,this.MAX_ITERATIONS=1e6,this.startTimeOfPhase={},this.endTimeOfPhase={},this.timeSpentOnPhase={},this.firstIterationOfPhase={},this.pinIdToStronglyConnectedPins=Kq(e)}currentPipelineStepIndex=0;_step(){let e=this.pipelineDef[this.currentPipelineStepIndex];if(!e){this.solved=!0;return}if(this.activeSubSolver){if(this.activeSubSolver.step(),this.activeSubSolver.solved)this.endTimeOfPhase[e.solverName]=performance.now(),this.timeSpentOnPhase[e.solverName]=this.endTimeOfPhase[e.solverName]-this.startTimeOfPhase[e.solverName],e.onSolved?.(this),this.activeSubSolver=null,this.currentPipelineStepIndex++;else if(this.activeSubSolver.failed)this.error=this.activeSubSolver?.error,this.failed=!0,this.activeSubSolver=null;return}let t=e.getConstructorParams(this);this.activeSubSolver=new e.solverClass(...t),this[e.solverName]=this.activeSubSolver,this.timeSpentOnPhase[e.solverName]=0,this.startTimeOfPhase[e.solverName]=performance.now(),this.firstIterationOfPhase[e.solverName]=this.iterations}solveUntilPhase(e){while(this.getCurrentPhase()!==e)this.step()}getCurrentPhase(){return this.pipelineDef[this.currentPipelineStepIndex]?.solverName??"none"}visualize(){if(!this.solved&&this.activeSubSolver)return this.activeSubSolver.visualize();if(this.solved&&this.alignTestPointsSolver?.solved)return this.alignTestPointsSolver.visualize();if(this.solved&&this.placeNetOnlyDecouplingRowsSolver?.solved)return this.placeNetOnlyDecouplingRowsSolver.visualize();if(this.solved&&this.alignPowerGroundRowsSolver?.solved)return this.alignPowerGroundRowsSolver.visualize();if(this.solved&&this.groundedLoadPairSolver?.solved)return this.groundedLoadPairSolver.visualize();if(this.solved&&this.partitionPackingSolver?.solved)return this.partitionPackingSolver.visualize();let e=this.identifyCrystalCircuitsSolver?.visualize(),t=this.identifyDecouplingCapsSolver?.visualize(),n=this.chipPartitionsSolver?.visualize(),o=this.packInnerPartitionsSolver?.visualize(),r=this.partitionPackingSolver?.visualize(),i=this.groundedLoadPairSolver?.visualize(),s=this.alignPowerGroundRowsSolver?.visualize(),a=this.alignTestPointsSolver?.visualize(),c=this.placeNetOnlyDecouplingRowsSolver?.visualize(),l=Vw(this.inputProblem),d=[X0(this.inputProblem,l),e,t,n,o,r,i,s,c,a].filter(Boolean).map((u,_)=>{for(let p of u.rects??[])p.step=_;for(let p of u.points??[])p.step=_;for(let p of u.circles??[])p.step=_;for(let p of u.texts??[])p.step=_;for(let p of u.lines??[])p.step=_;return u});if(d.length===1)return d[0];return{points:d.flatMap((u)=>u.points||[]),rects:d.flatMap((u)=>u.rects||[]),lines:d.flatMap((u)=>u.lines||[]),circles:d.flatMap((u)=>u.circles||[]),texts:d.flatMap((u)=>u.texts||[])}}preview(){if(this.activeSubSolver)return this.activeSubSolver.preview();if(this.alignTestPointsSolver?.solved)return this.alignTestPointsSolver.visualize();if(this.placeNetOnlyDecouplingRowsSolver?.solved)return this.placeNetOnlyDecouplingRowsSolver.visualize();if(this.alignPowerGroundRowsSolver?.solved)return this.alignPowerGroundRowsSolver.visualize();if(this.partitionPackingSolver?.solved)return this.partitionPackingSolver.visualize();if(this.packInnerPartitionsSolver?.solved)return this.packInnerPartitionsSolver.visualize();if(this.chipPartitionsSolver?.solved)return this.chipPartitionsSolver.visualize();if(this.identifyDecouplingCapsSolver?.solved)return this.identifyDecouplingCapsSolver.visualize();if(this.identifyCrystalCircuitsSolver?.solved)return this.identifyCrystalCircuitsSolver.visualize();return super.preview()}checkForOverlaps(e){let t=[],n=Object.keys(e.chipPlacements);for(let o=0;o<n.length;o++)for(let r=o+1;r<n.length;r++){let i=n[o],s=n[r],a=e.chipPlacements[i],c=e.chipPlacements[s],l=this.inputProblem.chipMap[i],h=this.inputProblem.chipMap[s];if(!l||!h)continue;let d=this.getRotatedBounds(a,l.size),u=this.getRotatedBounds(c,h.size),_=this.calculateOverlapArea(d,u);if(_>0)t.push({chip1:i,chip2:s,overlapArea:_})}return t}getRotatedBounds(e,t){let n=t.x/2,o=t.y/2,r=e.ccwRotationDegrees*Math.PI/180,i=Math.abs(Math.cos(r)),s=Math.abs(Math.sin(r)),a=n*i+o*s,c=n*s+o*i;return{minX:e.x-a,maxX:e.x+a,minY:e.y-c,maxY:e.y+c}}calculateOverlapArea(e,t){if(e.maxX<=t.minX||e.minX>=t.maxX||e.maxY<=t.minY||e.minY>=t.maxY)return 0;let n=Math.min(e.maxX,t.maxX)-Math.max(e.minX,t.minX),o=Math.min(e.maxY,t.maxY)-Math.max(e.minY,t.minY);return n*o}getOutputLayout(){if(!this.solved)throw Error("Pipeline not solved yet. Call solve() or step() until solved.");let e;if(this.alignTestPointsSolver?.solved&&this.alignTestPointsSolver.outputLayout)e=this.alignTestPointsSolver.outputLayout;else if(this.placeNetOnlyDecouplingRowsSolver?.solved&&this.placeNetOnlyDecouplingRowsSolver.outputLayout)e=this.placeNetOnlyDecouplingRowsSolver.outputLayout;else if(this.alignPowerGroundRowsSolver?.solved&&this.alignPowerGroundRowsSolver.outputLayout)e=this.alignPowerGroundRowsSolver.outputLayout;else if(this.partitionPackingSolver?.solved&&this.partitionPackingSolver.finalLayout)e=this.partitionPackingSolver.finalLayout;else throw Error("No layout available. Pipeline may have failed or not progressed far enough.");let t=this.checkForOverlaps(e);if(t.length>0){let n=t.map((o)=>`${o.chip1} overlaps ${o.chip2} (area: ${o.overlapArea.toFixed(4)})`).join(", ");console.warn(`Warning: ${t.length} chip overlaps detected in final layout: ${n}`)}return e}};Ko();Ko();Ko();Ko();Ko();tc();var rsi=Qe(wt(),1);fp();var I7n=Qe(wt(),1);Ko();Ko();var Ndn={flexGrow:0,flexShrink:1,flexBasis:0,alignSelf:"auto",width:void 0,height:void 0},Rdn=class{id;metadata;size={width:0,height:0};position={x:0,y:0};style;constructor(e={}){this.style={...Ndn,...e},this.id=e.id,this.metadata=e.metadata}},XSr=class extends Rdn{build(){}},Ddn=class e extends Rdn{children=[];direction="row";columnGap=0;rowGap=0;justifyContent="flex-start";alignItems="stretch";constructor(t,n,o={}){super({});this.size.width=t,this.size.height=n,this.id=o.id,Object.assign(this,o)}addChild(t,n){if(t instanceof e){let r=t;if(n)r.style={...Ndn,...n};return this.children.push(r),r}let o=new XSr(t);return this.children.push(o),o}build(){let t=this.direction.startsWith("row"),n=t?"width":"height",o=t?"height":"width",r=t?this.columnGap:this.rowGap,i=t?this.rowGap:this.columnGap,s=r*Math.max(0,this.children.length-1),a=this.size[n],c=this.size[o],l=0,h=0,d=0;for(let C of this.children)l+=C.style.flexBasis,h+=C.style.flexGrow,d+=C.style.flexShrink;let u=a-l-s;for(let C of this.children){let b=C.style.flexBasis;if(u>0&&h>0)b+=u*C.style.flexGrow/h;else if(u<0&&d>0){if(b+=u*C.style.flexShrink/d,b<0)b=0}C.size[n]=b;let I=C.style.alignSelf!=="auto"?C.style.alignSelf:this.alignItems,v=t?C.style.height:C.style.width;if(v!==void 0)C.size[o]=v;else if(I==="stretch")C.size[o]=c}let _=this.children.reduce((C,b)=>C+b.size[n],0)+s,p=a-_,m=0,A=r,g=this.children.length;switch(this.justifyContent){case"flex-start":break;case"flex-end":m=p;break;case"center":m=p/2;break;case"space-between":A=g>1?r+p/(g-1):0;break;case"space-around":A=r+p/g,m=A/2;break;case"space-evenly":A=r+p/(g+1),m=A;break}let f=this.direction.endsWith("reverse")?[...this.children].reverse():this.children,y=m;for(let C of f){if(t)C.position.x=this.direction==="row"?y:a-y-C.size.width,C.position.y=x(C,o,c,this.alignItems);else C.position.y=this.direction==="column"?y:a-y-C.size.height,C.position.x=x(C,o,c,this.alignItems);y+=C.size[n]+A}for(let C of this.children)if(C instanceof e)C.build();function x(C,b,I,v){switch(C.style.alignSelf!=="auto"?C.style.alignSelf:v){case"flex-start":return 0;case"flex-end":return I-C.size[b];case"center":return(I-C.size[b])/2;case"stretch":default:return 0}}}},q6e=class extends Ddn{constructor(e,t,n={}){super(e,t,n)}getLayout(){this.build();let e={};return this._collectLayout(this,e),e}_collectLayout(e,t,n={counter:0}){for(let o of e.children){let r=o.id??`_$$${n.counter++}`;if(t[r]={position:o.position,size:o.size},o instanceof Ddn)this._collectLayout(o,t,n)}}};Kt();Ko();Kt();var Qdn=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20].map((e)=>`hsl(${e*360/21}deg, 100%, 50%)`),jSr=(e)=>{let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n);return t},Fdn=(e)=>Qdn[Math.abs(jSr(e))%Qdn.length],KSr=(e)=>{let t=(p)=>!p?void 0:typeof p==="string"?p:p.join(" "),n=["display:grid","background-color:gray"],{gridTemplateRows:o,gridTemplateColumns:r,gap:i,justifyItems:s,alignItems:a,containerWidth:c,containerHeight:l}=e.opts,h=t(o);if(h)n.push(`grid-template-rows:${h}`);let d=t(r);if(d)n.push(`grid-template-columns:${d}`);if(i!==void 0)if(typeof i==="number")n.push(`gap:${i}px`);else{let[p,m]=i;n.push(`row-gap:${p}px`,`column-gap:${m}px`)}if(s)n.push(`justify-items:${s}`);if(a)n.push(`align-items:${a}`);if(c!=null)n.push(`width:${c}px`);if(l!=null)n.push(`height:${l}px`);let u=n.join(";"),_=e.opts.children.map((p)=>{let m=["display:flex",`background-color:${Fdn(p.key)}`];if(p.area)m.push(`grid-area:${p.area}`);else{if(typeof p.row==="string"&&p.row.includes("/"))m.push(`grid-row:${p.row}`);else{let y=p.rowStart??p.row,{rowEnd:x,rowSpan:C}=p;if(y!==void 0||x!==void 0)if(y!==void 0&&x!==void 0)m.push(`grid-row:${y} / ${x}`);else if(y!==void 0)C!==void 0?m.push(`grid-row:${y} / span ${C}`):m.push(`grid-row-start:${y}`);else m.push(`grid-row-end:${x}`);else if(C!==void 0)m.push(`grid-row:auto / span ${C}`)}if(typeof p.column==="string"&&p.column.includes("/"))m.push(`grid-column:${p.column}`);else{let y=p.columnStart??p.column,{columnEnd:x,columnSpan:C}=p;if(y!==void 0||x!==void 0)if(y!==void 0&&x!==void 0)m.push(`grid-column:${y} / ${x}`);else if(y!==void 0)C!==void 0?m.push(`grid-column:${y} / span ${C}`):m.push(`grid-column-start:${y}`);else m.push(`grid-column-end:${x}`);else if(C!==void 0)m.push(`grid-column:auto / span ${C}`)}}let A=m.join(";"),g=["font-size: 7px"];if(p.contentWidth!==void 0){let y=typeof p.contentWidth==="string"?p.contentWidth:`${p.contentWidth}px`;g.push(`width:${y}`)}else g.push(`width:${p.key.length*5}px`);if(p.contentHeight!==void 0){let y=typeof p.contentHeight==="string"?p.contentHeight:`${p.contentHeight}px`;g.push(`height:${y}`)}let f=g.join(";");return`  <div id="${p.key}" style="${A}"><div style="${f}">${p.key}</div></div>`});return`<div style="${u}">
${_.join(`
`)}
</div>`},$Sr=(e)=>{let t=e.layout(),n={title:"CssGrid",coordinateSystem:"screen",lines:[],circles:[],points:[],rects:[],texts:[]},{cells:o}=t;for(let r of o){let{x:i,y:s,width:a,height:c,key:l}=r;n.rects.push({center:{x:i+a/2,y:s+c/2},width:a,height:c,fill:Fdn(l),label:l})}return n};function J6e(e){return e.replace(/repeat\((\d+),\s*([^)]+)\)/g,(t,n,o)=>Array(Number(n)).fill(o.trim()).join(" "))}function Z6e(e){return e.trim().split(/\s+/).filter(Boolean)}function kdn(e){if(!e)return 0;return Z6e(J6e(e)).length}function Ldn(e,t){if(e==="auto")return{fr:1};if(e.endsWith("%")){let o=parseFloat(e);return t!=null?t*o/100:0}if(e.endsWith("px"))return parseFloat(e);if(e.endsWith("em"))return parseFloat(e)*16;if(e.endsWith("fr"))return{fr:parseFloat(e)};let n=parseFloat(e);if(!Number.isNaN(n))return n;return 0}function Hdn(e,t){return e>0?e:t+2+e}var qSr=(e)=>{let t=e.opts,n=t.children,o,r;if("gridTemplate"in t&&typeof t.gridTemplate==="string"){let[b,I]=t.gridTemplate.split("/");o=b?.trim(),r=I?.trim()}else o=typeof t.gridTemplateRows==="string"?t.gridTemplateRows:void 0,r=typeof t.gridTemplateColumns==="string"?t.gridTemplateColumns:void 0;let i=kdn(r),s=kdn(o);function a(b,I,v,P){if(!b)return 0;let M=J6e(b),B=Z6e(M),T=B.length,N=0,D=!1;for(let H=0;H<B.length;H++){let V=B[H];if(V.endsWith("px"))N+=parseFloat(V);else if(V.endsWith("em"))N+=parseFloat(V)*16;else if(V.endsWith("fr")||V==="auto"){D=!0;let O=0;for(let U of I){let j=v?U.columnStart||U.column:U.rowStart||U.row,Y=v?U.columnSpan||1:U.rowSpan||1,X=v?U.contentWidth:U.contentHeight,K=(typeof j==="number"?j:parseInt(j||"1"))-1,J=typeof Y==="number"?Y:parseInt(Y.toString());if(K<=H&&H<K+J){if(X){let ee=typeof X==="string"&&X.endsWith("px")?parseFloat(X):typeof X==="number"?X:0;O=Math.max(O,ee/J)}}}N+=O}}let L=P*(T-1);return N+L}function c(b,I,v,P=!0,M=1){if(!b)return[];if(I==null){let Y=J6e(b),X=Z6e(Y),K=X.length,J=(ne)=>{if(ne===void 0)return 0;if(typeof ne==="number")return ne;if(ne.endsWith("px"))return parseFloat(ne);return parseFloat(ne)},ee=Array(K).fill(0),se=0;for(let ne of n){let re=P?typeof ne.columnSpan==="number"?ne.columnSpan:ne.columnSpan?parseInt(ne.columnSpan.toString()):1:typeof ne.rowSpan==="number"?ne.rowSpan:ne.rowSpan?parseInt(ne.rowSpan.toString()):1,Z=P?ne.contentWidth:ne.contentHeight,te=J(Z)/re,ie;if(P){if(ne.columnStart!==void 0||ne.column!==void 0)ie=parseInt(ne.columnStart??ne.column)-1}else if(ne.rowStart!==void 0||ne.row!==void 0)ie=parseInt(ne.rowStart??ne.row)-1;if(ie===void 0||Number.isNaN(ie)){if(P)ie=se%K;else ie=Math.floor(se/M);se+=re}for(let ce=0;ce<re&&ie+ce<K;ce++)ee[ie+ce]=Math.max(ee[ie+ce],te)}return X.forEach((ne,re)=>{let Z=Ldn(ne,void 0);if(typeof Z==="number")ee[re]=Z}),ee}let B=J6e(b),T=Z6e(B),N=T.length,D=I;if(D==null)D=a(b,n,P,v);let L=D-v*(N-1),H=0,V=0,O=[],U=[];T.forEach((Y,X)=>{let K=Ldn(Y,L);if(typeof K==="number")U.push(K),H+=K;else if(K&&typeof K==="object"&&"fr"in K)U.push(K),V+=K.fr,O.push({idx:X,fr:K.fr});else U.push(0),H+=0});let j=Math.max(L-H,0);return U.map((Y)=>typeof Y==="number"?Y:V>0?j/V*Y.fr:0)}let l=typeof t.gap==="number"?t.gap:Array.isArray(t.gap)?t.gap[0]:0,h=typeof t.gap==="number"?t.gap:Array.isArray(t.gap)?t.gap[1]:0,d=c(o,t.containerHeight,l,!1,i||1),u=c(r,t.containerWidth,h,!0,s||1),_=d.length,p=u.length;if(p===0&&n.length>0)p=1;let m=[],A=0;for(let b of n){let I=b.rowStart!==void 0?b.rowStart:b.row,v=b.columnStart!==void 0?b.columnStart:b.column,P=b.rowSpan!==void 0?typeof b.rowSpan==="string"?parseInt(b.rowSpan):b.rowSpan:1,M=b.columnSpan!==void 0?typeof b.columnSpan==="string"?parseInt(b.columnSpan):b.columnSpan:1;if(b.rowEnd!==void 0){let N=typeof b.rowEnd==="string"?parseInt(b.rowEnd):b.rowEnd;if(I!==void 0)P=N-(typeof I==="string"?parseInt(I):I);else I=N-P}if(b.columnEnd!==void 0){let N=typeof b.columnEnd==="string"?parseInt(b.columnEnd):b.columnEnd;if(v!==void 0)M=N-(typeof v==="string"?parseInt(v):v);else v=N-M}if(typeof I==="string")I=parseInt(I);if(typeof v==="string")v=parseInt(v);if(typeof I==="number"&&I<0)I=Hdn(I,_);if(typeof v==="number"&&v<0)v=Hdn(v,p);if(I===void 0&&v!==void 0)I=1;else if(v===void 0&&I!==void 0)v=1;else if(I===void 0&&v===void 0){let N=A;I=Math.floor(N/p)+1,v=N%p+1}let B=I-1,T=v-1;P=Math.max(1,P),M=Math.max(1,M),m.push({key:b.key,row:B,column:T,rowSpan:P,columnSpan:M,x:0,y:0,width:0,height:0}),A+=M}let g=d.length,f=u.length;for(let b of m){if(b.row+b.rowSpan>g)g=b.row+b.rowSpan;if(b.column+b.columnSpan>f)f=b.column+b.columnSpan}if(d.length===0&&g>0&&t.containerHeight){let b=g,v=(t.containerHeight-l*(b-1))/b;for(let P=0;P<b;P++)d.push(v)}else while(d.length<g)d.push(0);if(u.length===0&&f>0&&t.containerWidth){let b=f,v=(t.containerWidth-h*(b-1))/b;for(let P=0;P<b;P++)u.push(v)}else if(u.length===0&&n.length>0&&t.containerWidth)u.push(t.containerWidth);else while(u.length<f)u.push(0);let y=(b,I,v)=>{let P=0;for(let M=0;M<b;M++)P+=I[M]||0,P+=v;return P},x=(b,I,v,P)=>{let M=0;for(let B=b;B<b+I;B++)if(M+=v[B]||0,B>b)M+=P;return M},C={};for(let b of m){let I=n.find((U)=>U.key===b.key),v=y(b.column,u,h),P=y(b.row,d,l),M=x(b.column,b.columnSpan,u,h),B=x(b.row,b.rowSpan,d,l),T=(U)=>{if(U===void 0)return 0;if(typeof U==="string"){if(U.endsWith("px"))return parseFloat(U);if(U.endsWith("%"))return 0;return parseFloat(U)}return U},N=T(I?.contentWidth),D=T(I?.contentHeight),L=M,H=B,V=v,O=P;if(N>0)switch(L=N,t.justifyItems||"stretch"){case"start":V=v;break;case"end":V=v+M-L;break;case"center":V=v+(M-L)/2;break;case"stretch":L=M,V=v;break}if(D>0)switch(H=D,t.alignItems||"stretch"){case"start":O=P;break;case"end":O=P+B-H;break;case"center":O=P+(B-H)/2;break;case"stretch":H=B,O=P;break}b.x=V,b.y=O,b.width=L,b.height=H,C[b.key]={x:V,y:O,width:L,height:H}}return{cells:m,rowSizes:d,columnSizes:u,rowGap:l,columnGap:h,itemCoordinates:C}},zdn=class{opts;constructor(e){this.opts=e}layout(){return qSr(this)}convertToHtml(){return KSr(this)}visualize(){return $Sr(this)}};Kt();var E7n=Qe(p0(),1);Ko();Ko();var Sy=Qe(wt(),1);Kt();Kt();Ko();Ko();Ko();var{defineProperty:JSr,getOwnPropertySymbols:Odn}=Object,ZSr=Object.prototype.hasOwnProperty,ePr=Object.prototype.propertyIsEnumerable,Vdn=(e,t,n)=>(t in e)?JSr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ydn=(e,t)=>{for(var n in t||(t={}))if(ZSr.call(t,n))Vdn(e,n,t[n]);if(Odn){for(var n of Odn(t))if(ePr.call(t,n))Vdn(e,n,t[n])}return e},tPr=(e)=>{switch(e){case"left":return{x:-1,y:0};case"right":return{x:1,y:0};case"top":return{x:0,y:1};case"bottom":return{x:0,y:-1}}},nPr=(e)=>{var t,n;let o=As(e),r=o.schematic_component.list(),i=o.schematic_net_label.list(),s=o.schematic_port.list(),a={};for(let c of r){let l=o.source_component.get(c.source_component_id);a[c.schematic_component_id]=l==null?void 0:l.name}for(let c of i){let l=o.source_net.get(c.source_net_id);if(!(l==null?void 0:l.name))continue;let h=0;while(Object.values(a).includes(`NL_${l.name}${h}`))h++;a[c.schematic_net_label_id]=`NL_${l.name}${h}`}for(let c of s){let l=o.source_port.get(c.source_port_id);if(!l)continue;let h=o.source_component.get(l.source_component_id);if(!(h==null?void 0:h.name))continue;let d=`${h.name}_${(n=(t=l==null?void 0:l.name)!=null?t:l==null?void 0:l.pin_number)!=null?n:""}`;a[c.schematic_port_id]=d}return a},oPr=(e)=>{var t;let n=As(e),o=new Set(n.schematic_net_label.list().map((i)=>{var s,a,c,l;return`${(a=(s=i.anchor_position)==null?void 0:s.x)!=null?a:i.center.x},${(l=(c=i.anchor_position)==null?void 0:c.y)!=null?l:i.center.y}`})),r=[];for(let i of n.schematic_port.list()){let s=`${i.center.x},${i.center.y}`;if(o.has(s))continue;let a=n.source_port.get(i.source_port_id);if(!a)continue;let c=n.source_net.getWhere({subcircuit_connectivity_map_key:a.subcircuit_connectivity_map_key});if(!c)continue;let l=n.source_trace.list().find((_)=>{var p;return(p=_.connected_source_port_ids)==null?void 0:p.includes(i.source_port_id)}),h=n.schematic_trace.getWhere({source_trace_id:l==null?void 0:l.source_trace_id}),u={type:"schematic_net_label",schematic_net_label_id:`netlabel_for_${i.schematic_port_id}`,schematic_port_id:i.schematic_port_id,text:c.name,source_net_id:c.source_net_id,source_trace_id:l==null?void 0:l.source_trace_id,schematic_trace_id:h==null?void 0:h.schematic_trace_id,anchor_position:Ydn({},i.center),center:Ydn({},i.center),anchor_side:ibt((t=i.facing_direction)!=null?t:"right")};r.push(u)}return r},Gdn=(e,t={})=>{let n={boxes:[],pins:[]},o=As(e),r=o.schematic_component.list(),i=o.schematic_net_label.list();if(t.inferNetLabels)i=i.concat(oPr(e));let s=t.useReadableIds?nPr(e):{},a=(l)=>{if(!t.useReadableIds)return l;if(s[l])return s[l];return l},c=0;for(let l of r){let h={boxId:a(l.schematic_component_id),kind:"floating",center:l.center};n.boxes.push(h);let d={pinId:`${a(l.schematic_component_id)}_center`,color:"component_center",networkId:`center_${l.schematic_component_id}`,offset:{x:0,y:0},boxId:a(l.schematic_component_id)};n.pins.push(d);let u=o.schematic_port.list({schematic_component_id:l.schematic_component_id});for(let _ of u){let p=o.source_port.get(_.source_port_id),m=p==null?void 0:p.subcircuit_connectivity_map_key,A="normal";if(m){let f=o.source_net.getWhere({subcircuit_connectivity_map_key:p==null?void 0:p.subcircuit_connectivity_map_key});if(f&&(f.is_power||f.name.startsWith("V")))A="vcc";if(f&&(f.is_ground||f.name.startsWith("GND")))A="gnd"}else m=`disconnected-${c++}`,A="not_connected";let g={pinId:a(_.schematic_port_id),color:A,networkId:m,offset:{x:_.center.x-h.center.x,y:_.center.y-h.center.y},boxId:a(l.schematic_component_id)};n.pins.push(g)}}for(let l of i){let h=o.source_net.get(l.source_net_id),d=h==null?void 0:h.subcircuit_connectivity_map_key,u="normal";if(d){if(h&&(h.is_power||h.name.startsWith("V")))u="vcc";if(h&&(h.is_ground||h.name.startsWith("GND")))u="gnd"}else d=`disconnected-${c++}`,u="not_connected";let _=tPr(l.anchor_side),p={x:l.anchor_position.x-_.x*l.text.length*0.18*0.5,y:l.anchor_position.y-_.y*0.18},m={x:0,y:0};if(l.anchor_position)m={x:l.anchor_position.x-p.x,y:l.anchor_position.y-p.y};let A={boxId:a(l.schematic_net_label_id),kind:"fixed",center:p,boxAttributes:{is_net_label:!0,source_net_id:l.source_net_id,source_trace_id:l.source_trace_id}};n.boxes.push(A);let g={pinId:`${a(l.schematic_net_label_id)}_pin`,boxId:a(l.schematic_net_label_id),networkId:d,color:u,offset:m};n.pins.push(g),n.pins.push({pinId:`${a(l.schematic_net_label_id)}_center`,boxId:a(l.schematic_net_label_id),networkId:`${a(l.schematic_net_label_id)}_center`,color:"netlabel_center",offset:{x:0,y:0}})}return n};var Zdn=Qe(p0(),1),rPr=(e)=>{if(!e)return{x:0,y:0};if("x"in e&&"y"in e)return e;if("center"in e)return e.center;return{x:(e.minX+e.maxX)/2,y:(e.minY+e.maxY)/2}},oIe=(e,t)=>{let n=e.boxes.find((l)=>l.boxId===t),o=e.pins.filter((l)=>l.boxId===t);if(!n)throw Error(`Box "${t}" not found`);let r=n.center??{x:0,y:0},i=1/0,s=1/0,a=-1/0,c=-1/0;for(let l of o)i=Math.min(i,l.offset.x+r.x),s=Math.min(s,l.offset.y+r.y),a=Math.max(a,l.offset.x+r.x),c=Math.max(c,l.offset.y+r.y);return{minX:i,minY:s,maxX:a,maxY:c}},$q=(e,t,n)=>`hsl(${e*360/t}, 100%, 50%, ${n??1})`;var iPr=(e)=>{let t=new Set;for(let n of e.pins)t.add(n.networkId);return Array.from(t)},Udn={not_connected:"rgba(0, 0, 0, 0.2)",normal:"blue",vcc:"orange",gnd:"purple",component_center:"gray"},sPr=["red","green","blue","yellow","purple","orange","brown","gray","black","white"];function aPr(e){let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n);return t}var qdn=(e)=>{if(e.startsWith("rgb")||e.startsWith("hsl")||e.startsWith("#")||sPr.includes(e))return e;if(e in Udn)return Udn[e];return $q(aPr(e)%50,50)},kQ=(e,t)=>{let n={points:[],lines:[],rects:[],circles:[],texts:[],coordinateSystem:"cartesian",title:"BPC Graph Graphics"},o=new Map,r=new Map;for(let a of e.boxes){let c=oIe(e,a.boxId),l=rPr(c);n.rects.push({label:a.boxId,center:l,width:c.maxX-c.minX+0.1,height:c.maxY-c.minY+0.1,fill:"rgba(0, 0, 0, 0.2)"});let h=e.pins.filter((u)=>u.boxId===a.boxId),d=a.center??{x:0,y:0};for(let u of h){let _={x:u.offset.x+d.x,y:u.offset.y+d.y},p=`${_.x.toFixed(6)},${_.y.toFixed(6)}`;if(!r.has(p))r.set(p,[]);r.get(p).push({box:a,pin:u}),o.set(`${a.boxId}.${u.pinId}`,_)}}for(let[a,c]of r){let l=a.split(",").map(Number),h=l[0],d=l[1];for(let u=0;u<c.length;u++){let _=c[u],{box:p,pin:m}=_,A={x:h,y:d};if(c.length>1){let g=p.center??{x:0,y:0},f=g.x-h,y=g.y-d,x=Math.sqrt(f*f+y*y),C=0,b=0;if(x>0)C=f/x,b=y/x;else{let I=u*2*Math.PI/c.length;C=Math.cos(I),b=Math.sin(I)}A={x:h+0.01*C,y:d+0.01*b}}o.set(`${p.boxId}.${m.pinId}`,A),n.points.push({...A,label:[m.pinId,m.color,m.networkId].join(`
`),color:qdn(m.color)})}}let i=iPr(e);for(let a=0;a<i.length;a++){let c=i[a],l=$q(a,i.length,0.5),d=e.pins.filter((u)=>u.networkId===c).map((u)=>({pin:u,position:o.get(`${u.boxId}.${u.pinId}`)}));for(let u=0;u<d.length;u++){let{position:_}=d[u];for(let p=u+1;p<d.length;p++){let{position:m}=d[p];n.lines.push({points:[_,m],strokeColor:t?.grayNetworks?"rgba(0, 0, 0, 0.05)":l})}}}let s=X1(n);if(t?.title)n.title=t.title,n.texts.push({text:t.title,x:s.minX,y:s.maxY,fontSize:(s.maxY-s.minY)*0.05,anchorSide:"bottom_left"});if(t?.caption)n.texts.push({text:t.caption,x:s.minX,y:s.minY,fontSize:(s.maxY-s.minY)*0.05,anchorSide:"top_left"});return n},eIe=(e,t,n)=>{let o=e.pins.find((s)=>s.pinId===n&&s.boxId===t);if(!o)throw Error(`Pin "${n}" not found`);let r=e.boxes.find((s)=>s.boxId===o.boxId);if(!r)throw Error(`Box "${o.boxId}" not found`);let i=r.center??{x:0,y:0};return{x:o.offset.x+i.x,y:o.offset.y+i.y}},cPr=(e,t,n)=>{let o=typeof n==="string"?e.pins.find((_)=>_.pinId===n&&_.boxId===t):n;if(!o)throw Error(`Pin not found "${n}"`);if(!(typeof t==="string"?e.boxes.find((_)=>_.boxId===t):t))throw Error(`Box not found for pin "${n}" (looked for "${o.boxId}")`);let i=oIe(e,o.boxId),s=eIe(e,o.boxId,o.pinId),a=i.maxX-i.minX,c=i.maxY-i.minY;if(a===0&&c===0)if(Math.abs(o.offset.x)>Math.abs(o.offset.y))return o.offset.x>0?"x+":"x-";else return o.offset.y>0?"y+":"y-";if(a===0){if(Math.abs(s.y-i.minY)<0.0001)return"y-";if(Math.abs(s.y-i.maxY)<0.0001)return"y+"}if(c===0){if(Math.abs(s.x-i.minX)<0.0001)return"x-";if(Math.abs(s.x-i.maxX)<0.0001)return"x+"}let l=Math.abs(s.x-i.minX)<0.0001,h=Math.abs(s.x-i.maxX)<0.0001,d=Math.abs(s.y-i.minY)<0.0001,u=Math.abs(s.y-i.maxY)<0.0001;if((l||h)&&(d||u))return o.offset.x>0?"x+":"x-";if(l)return"x-";if(h)return"x+";if(d)return"y-";if(u)return"y+";throw Error(`Pin "${o.pinId}" not on the edge of the box "${o.boxId}" so we couldn't determine the direction`)},qq=(e,t,n)=>{try{return cPr(e,t,n)}catch(o){return null}};var lPr=(e)=>{let t=new Map,n=[];e.nodes.forEach((i,s)=>{t.set(i.id,s),n.push(i.id)});let o=e.nodes.length,r=Array.from({length:o},()=>Array.from({length:o},()=>0));for(let[i,s]of e.undirectedEdges){let a=t.get(i),c=t.get(s);if(a!==void 0&&c!==void 0&&a!==c)r[a][c]=1,r[c][a]=1}for(let i=0;i<o;++i)r[i][i]=1;return{matrix:r,mapping:t,indexMapping:n}};var tIe=(e)=>{let t=[],n=[],o=new Map;for(let i of e.boxes){if(i.kind==="fixed")o.set(i.boxId,i.center);else o.set(i.boxId,i.center);t.push({id:i.boxId,boxId:i.boxId,color:"box",x:i.center?.x,y:i.center?.y})}let r={};for(let i of e.pins){let s=`${i.boxId}-${i.pinId}`,a=o.get(i.boxId);t.push({id:s,boxId:i.boxId,pinId:i.pinId,color:i.color,x:a?a.x+i.offset.x:void 0,y:a?a.y+i.offset.y:void 0}),r[i.networkId]??=[],r[i.networkId].push(s)}for(let i of Object.values(r))for(let s=0;s<i.length;s++)for(let a=s+1;a<i.length;a++)n.push([i[s],i[a]]);for(let i of e.boxes)for(let s of e.pins)if(s.boxId===i.boxId)n.push([i.boxId,`${i.boxId}-${s.pinId}`]);return{nodes:t,undirectedEdges:n}},hPr=(e,t,n={})=>{let o=e.length;if(e.some((a)=>a.length!==o))throw Error("adjMatrix must be square");let r=(n.nodeInitialColors??Array.from({length:o},()=>"_")).slice(),i=(a)=>{let c={};for(let l of a)c[l]=(c[l]??0)+1;return c},s=[];s.push(i(r));for(let a=0;a<t;a++){let c=Array(o);for(let l=0;l<o;l++){let h=[];for(let d=0;d<o;d++)if(e[l][d])h.push(r[d]);h.sort(),c[l]=`${r[l]}|${h.join(",")}`}r=c,s.push(i(r))}return s},dPr=(e,t)=>{let n=0,o=Math.min(e.length,t.length);for(let r=0;r<o;r++){let i=e[r],s=t[r],a=new Set([...Object.keys(i),...Object.keys(s)]),c=0,l=0;for(let h of a){let d=i[h]??0,u=s[h]??0;c+=Math.min(d,u),l+=Math.max(d,u)}n+=l===0?0:c/l}return n};var uPr=dPr,nIe=2,rIe=(e,t=nIe)=>{let n=tIe(e),{matrix:o,indexMapping:r}=lPr(n);return hPr(o,t,{nodeInitialColors:r.map((i)=>n.nodes.find((s)=>s.id===i)?.color??"_")})},ZZe=(e,t,{wlDegrees:n=nIe}={})=>{let o=rIe(e,n),r=rIe(t,n);return(nIe+1-uPr(o,r))/(nIe+1)},pPr=(e)=>{let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n);return Math.abs(t)},JZe=(e,t={})=>{let n={points:[],lines:[],rects:[],circles:[],texts:[],coordinateSystem:"cartesian",title:"Flat-BPC Graphics"},o=new Map;for(let i of e.nodes){if(i.x===void 0||i.y===void 0)continue;let s={x:i.x,y:i.y};o.set(i.id,s),n.points.push({...s,color:qdn(i.color),label:i.id})}for(let[i,s]of e.undirectedEdges){let a=o.get(i),c=o.get(s);if(a&&c)n.lines.push({points:[a,c],strokeColor:"rgba(0,0,0,0.3)"})}let r=X1(n);if(t.title)n.texts.push({text:t.title,x:r.minX,y:r.maxY,fontSize:(r.maxY-r.minY)*0.05,anchorSide:"bottom_left"});if(t.caption)n.texts.push({text:t.caption,x:r.minX,y:r.minY,fontSize:(r.maxY-r.minY)*0.05,anchorSide:"top_left"});return n};var mPr=(e)=>{let t=new Map;for(let r of e.pins){let i=e.boxes.find((a)=>a.boxId===r.boxId);if(!i||!i.center)throw Error(`Expected fixed graph – box "${r.boxId}" missing or has no center`);let s={x:i.center.x+r.offset.x,y:i.center.y+r.offset.y};if(!t.has(r.networkId))t.set(r.networkId,[]);t.get(r.networkId).push(s)}let n=new Map,o=0;for(let[r,i]of t){if(i.length===0){n.set(r,0);continue}let s=i.reduce((c,l)=>({x:c.x+l.x,y:c.y+l.y}),{x:0,y:0});s.x/=i.length,s.y/=i.length;let a=i.reduce((c,l)=>{let h=l.x-s.x,d=l.y-s.y;return c+Math.sqrt(h*h+d*d)},0);n.set(r,a),o+=a}return{totalNetworkLength:o,networkLengths:n}},_Pr=(e,t)=>{let n=e.pins.filter((r)=>r.networkId===t),o=[];for(let r of n){let i=Math.atan2(r.offset.y,r.offset.x);o.push(i)}return o},Wdn=(e)=>{let t=new Map,n=Array.from(new Set(e.pins.map((o)=>o.networkId)));for(let o of n){let r=_Pr(e,o);t.set(o,r)}return t},gPr=(e,t)=>{let n=2*Math.PI,o=(e%n+n)%n,r=(t%n+n)%n,i=Math.abs(o-r);return Math.min(i,n-i)},APr=(e,t)=>{if(e.length===0&&t.length===0)return 0;if(e.length===0||t.length===0)return Math.PI;let n=(o,r)=>{let i=0;for(let s of o){let a=1/0;for(let c of r){let l=gPr(s,c);if(l<a)a=l}i+=a}return i/o.length};return(n(e,t)+n(t,e))/2},fPr=(e,t)=>{let n=new Map,o=Array.from(e.entries()),r=Array.from(t.entries()),i=o.length,s=r.length,a=Array.from({length:i},()=>Array(s).fill(0));for(let u=0;u<i;u++){let[,_]=o[u];for(let p=0;p<s;p++){let[,m]=r[p];a[u][p]=APr(_,m)}}let c=new Set(Array.from({length:i},(u,_)=>_)),l=new Set(Array.from({length:s},(u,_)=>_)),h=0;while(c.size&&l.size){let u=-1,_=-1,p=1/0;for(let g of c)for(let f of l){let y=a[g][f];if(y<p)p=y,u=g,_=f}let[m]=o[u],[A]=r[_];n.set(m,A),h+=p,c.delete(u),l.delete(_)}let d=Math.PI;return h+=(c.size+l.size)*d,{networkMapping:n,distance:h}},Xdn=(e)=>{let t=Math.min(...e.map((i)=>i.offset.x)),n=Math.max(...e.map((i)=>i.offset.x)),o=Math.min(...e.map((i)=>i.offset.y)),r=Math.max(...e.map((i)=>i.offset.y));return{minX:t,maxX:n,minY:o,maxY:r}},yPr=(e,t)=>{let n=(c)=>{switch(c.side){case"x+":return c.cwDistanceFromCorner;case"y-":return 1+c.cwDistanceFromCorner;case"x-":return 2+c.cwDistanceFromCorner;case"y+":return 3+c.cwDistanceFromCorner}},o=n(e)%4,r=n(t)%4,i=(r-o+4)%4,s=(o-r+4)%4,a=Math.min(i,s);return{cwDistance:i,ccwDistance:s,minDistance:a}},Gw=0.000001,jdn=(e,t)=>{let{minX:n,minY:o,maxX:r,maxY:i}=e,s=(l,h)=>Math.abs(l-h)<Gw,a,c;if(s(t.x,r)&&t.y>=o-Gw&&t.y<=i+Gw)a="x+",c=(i-t.y)/(i-o);else if(s(t.y,i)&&t.x<=r+Gw&&t.x>=n-Gw)a="y+",c=(t.x-n)/(r-n);else if(s(t.x,n)&&t.y<=i+Gw&&t.y>=o-Gw)a="x-",c=(t.y-o)/(i-o);else if(s(t.y,o)&&t.x>=n-Gw&&t.x<=r+Gw)a="y-",c=(r-t.x)/(r-n);else return null;return c=Math.min(1,Math.max(0,c)),{side:a,cwDistanceFromCorner:c}},xPr=(e,t)=>{let n=[],o=new Set,r=new Set,i=new Set,s=new Set,a=Xdn(e),c=Xdn(t);for(let l of e){let h=t.filter((p)=>p.color===l.color).filter((p)=>!s.has(p.pinId));if(h.length===0){o.add(l.pinId);continue}let d=jdn(a,l.offset);if(d===null){o.add(l.pinId);continue}let u=1/0,_=h[0];for(let p of h){let m=jdn(c,p.offset);if(m===null)continue;let{minDistance:A}=yPr(d,m);if(A<u)u=A,_=p}n.push([l,_]),i.add(l.pinId),s.add(_.pinId)}for(let l of t){if(s.has(l.pinId))continue;r.add(l.pinId)}return{matchedPins:n,unmatchedPin1Ids:o,unmatchedPin2Ids:r}},CPr=class{constructor(e,t){this.floatingGraph=e,this.fixedGraph=t,this.wipGraph={pins:[],boxes:[]},this.fixedToFloatingNetworkMap=this.computeFixedToFloatingNetworkMap(),this.floatingToFixedNetworkMap=new Map(Array.from(this.fixedToFloatingNetworkMap.entries()).map(([n,o])=>[o,n]))}floatingGraph;fixedGraph;wipGraph;iterations=0;solved=!1;acceptedFloatingBoxIds=new Set;rejectedFloatingBoxIds=new Set;acceptedFixedBoxIds=new Set;assignment=new Map;lastAcceptedEvaluation=null;fixedToFloatingNetworkMap;floatingToFixedNetworkMap;lastComputedEvaluations=[];computeFixedToFloatingNetworkMap(){let e=Wdn(this.floatingGraph),t=Wdn(this.fixedGraph),{networkMapping:n}=fPr(t,e);return n}getNextFloatingBoxId(){let e=this.floatingGraph.boxes.map((o)=>o.boxId).filter((o)=>!this.acceptedFloatingBoxIds.has(o)&&!this.rejectedFloatingBoxIds.has(o));if(!e.length)throw Error("No remaining floating box ids");let t=e[0],n=0;for(let o of e){let r=this.floatingGraph.pins.filter((i)=>i.boxId===o);if(r.length>n)t=o,n=r.length}return t}getRemainingFloatingBoxIds(){return this.floatingGraph.boxes.map((e)=>e.boxId).filter((e)=>!this.acceptedFloatingBoxIds.has(e)&&!this.rejectedFloatingBoxIds.has(e))}getPartialFloatingGraph(e){let t={pins:[],boxes:[]};for(let n of this.floatingGraph.boxes)if(this.acceptedFloatingBoxIds.has(n.boxId)||n.boxId===e)t.boxes.push(n),t.pins.push(...this.floatingGraph.pins.filter((o)=>o.boxId===n.boxId));return t}evaluateFloatingBoxAssignment(e){let t=this.getPartialFloatingGraph(e),n=ZZe(t,this.wipGraph),o=null,r=null,i={floatingBoxId:e,originalWipGraph:this.wipGraph,partialFloatingGraph:t,currentWlDist:n,networkLengths:new Map,wlDistances:new Map,wlVecs:new Map,wipGraphsWithAddedFixedBoxId:new Map},s=n,a=n,c=1/0,l=rIe(t);for(let h of this.fixedGraph.boxes.map((d)=>d.boxId)){if(this.acceptedFixedBoxIds.has(h))continue;let d=this.getWipGraphWithAddedFixedBoxIdForFloatingAssignment(h,e),u=ZZe(t,d),_=rIe(d),{totalNetworkLength:p}=mPr(d);i.wipGraphsWithAddedFixedBoxId.set(h,d),i.wlVecs.set(h,_),i.wlDistances.set(h,u),i.networkLengths.set(h,p);let m=u+p/100;if(m<s)s=m,a=u,c=p,r=d,o=h}return{bestFixedBoxId:o,bestNewWipGraph:r,bestDist:s,bestWlDist:a,bestTotalNetworkLength:c,lastDistanceEvaluation:i,nextFloatingBoxId:e,partialFloatingGraph:t,floatingBoxWlVec:l}}getPinAssignment(){let e={},t={};for(let[n,o]of this.assignment)e[n]={},t[o]=n;for(let n of this.wipGraph.pins){let o=n.boxId,r=t[o],{_floatingPinId:i,_fixedPinId:s}=n;e[r][i]=s}return e}step(){if(this.solved)return;if(this.iterations>1000)throw Error("Too many iterations");if(this.iterations++,this.iterations===1){let o=this.getNextFloatingBoxId(),r=this.evaluateFloatingBoxAssignment(o);this.lastComputedEvaluations=[r],this.acceptEvaluationResult(r);return}let e=this.getRemainingFloatingBoxIds();if(e.length===0){this.solved=!0;return}let t=1/0,n=null;this.lastComputedEvaluations=[];for(let o of e){let r=this.evaluateFloatingBoxAssignment(o);if(this.lastComputedEvaluations.push(r),r.bestDist<t)t=r.bestDist,n=r}if(n)this.acceptEvaluationResult(n)}acceptEvaluationResult(e){let{bestFixedBoxId:t,bestNewWipGraph:n,nextFloatingBoxId:o}=e;if(t===null){this.rejectedFloatingBoxIds.add(o);return}this.acceptedFloatingBoxIds.add(o),this.assignment.set(o,t),this.acceptedFixedBoxIds.add(t),this.wipGraph=n,this.lastAcceptedEvaluation=e.lastDistanceEvaluation}getWipGraphWithAddedFixedBoxIdForFloatingAssignment(e,t){let n=structuredClone(this.wipGraph),o=this.fixedGraph.boxes.find((a)=>a.boxId===e);n.boxes.push(o);let r=this.floatingGraph.pins.filter((a)=>a.boxId===t),i=this.fixedGraph.pins.filter((a)=>a.boxId===e),{matchedPins:s}=xPr(r,i);return n.pins.push(...s.map((a)=>{let[c,l]=a;return{...l,networkId:this.floatingToFixedNetworkMap.get(c.networkId),_floatingPinId:c.pinId,_fixedPinId:l.pinId}})),n}visualize(){let e=kQ(this.floatingGraph,{title:"Floating"}),t=kQ(this.wipGraph,{title:"WIP"}),n=kQ(this.fixedGraph,{title:"Fixed"}),o=kQ(this.getPartialFloatingGraph(),{title:"Partial Floating"}),r=new Map,i=new Map;for(let[m,A]of this.assignment){let g=$q(pPr(m)*47%100,100,0.5);r.set(m,g),i.set(A,m)}function s(m,A,g){let f=r.get(A);m.fill=f,m.label=`${A}→${g}`}for(let m of e.rects??[]){let A=m.label;if(!A)continue;let g=this.assignment.get(A);if(g)s(m,A,g)}for(let m of o.rects??[]){let A=m.label;if(!A)continue;let g=this.assignment.get(A);if(g)s(m,A,g)}let a=[t,n];for(let m of a)for(let A of m.rects??[]){let g=A.label;if(!g)continue;let f=i.get(g);if(f)s(A,f,g)}let c=tIe(this.floatingGraph),l=tIe(this.wipGraph),h=tIe(this.fixedGraph),d=JZe(c,{title:"Floating Flat"}),u=JZe(l,{title:"WIP Flat"}),_=JZe(h,{title:"Fixed Flat"});return hR([dse([e,d,o]),dse([t,u]),dse([n,_])])}},Jdn=(e,t)=>{let n=new CPr(e,t);while(!n.solved&&n.iterations<1000)n.step();let o={};for(let[s,a]of n.assignment.entries())o[s]=a;let r={};for(let[s,a]of n.floatingToFixedNetworkMap.entries())r[s]=a;let i=n.getPinAssignment();return{floatingToFixedBoxAssignment:o,floatingToFixedNetworkAssignment:r,floatingToFixedPinAssignment:i}};var Kdn=(e,{renetworkedNetworkIdMap:t}={})=>{if(t??={},e.length===1)return e[0];let n={boxes:[],pins:[]},o=new Map,r=new Map,i=Object.entries(e.flatMap((a)=>Array.from(new Set(a.boxes.map((c)=>c.boxId)))).reduce((a,c)=>(a[c]=(a[c]||0)+1,a),{})).filter(([a,c])=>c===e.length).map(([a])=>a);if(i.length>1)throw Error(`Expected at most one shared box across all partitions, the following box ids are shared across all graphs: ${i.join(", ")}`);let s=i[0];for(let a of e){let c=a.boxes.find((l)=>l.boxId===s)?.center;for(let l of a.boxes){if(o.has(l.boxId))continue;let h=structuredClone(l);if(h.center&&c)h.center={x:h.center.x-c.x,y:h.center.y-c.y};o.set(l.boxId,h)}for(let l of a.pins)if(!r.has(`${l.boxId}-${l.pinId}`))r.set(`${l.boxId}-${l.pinId}`,structuredClone(l))}return n.boxes=Array.from(o.values()),n.pins=Array.from(r.values()),n};var eet=({graph:e,axis:t,centerBoxId:n})=>{let o=structuredClone(e),r=o.boxes.find((a)=>a.boxId===n);if(!r||!r.center)throw Error(`Center box "${n}" not found or has no center`);let{x:i,y:s}=r.center;for(let a of o.boxes){if(!a.center)continue;if(t==="x")a.center.x=2*i-a.center.x;else a.center.y=2*s-a.center.y}for(let a of o.pins)if(t==="x")a.offset.x=-a.offset.x;else a.offset.y=-a.offset.y;return o},bPr=(e)=>{let t=null,n=-1/0;for(let i of e.boxes){let s=e.pins.filter((a)=>a.boxId===i.boxId).filter((a)=>["x-","x+"].includes(qq(e,i,a)??"none"));if(s.length>n&&s.length>1)t=i,n=s.length}if(!t)return{g:e,reflected:!1,centerBoxId:null};let o=e.pins.filter((i)=>i.boxId===t.boxId).map((i)=>qq(e,t,i)),r={"x+":0,"x-":0,"y+":0,"y-":0};for(let i of o){if(!i)continue;r[i]++}if(r["x+"]>=r["x-"])return{g:e,reflected:!1,centerBoxId:t.boxId};return{g:eet({graph:e,axis:"x",centerBoxId:t.boxId}),reflected:!0,centerBoxId:t.boxId}},QQ=Zdn.default("schematic-partition-processor"),IPr=class{constructor(e,t={}){this.initialGraph=e,this.lastGraph=e,this.singletonKeys=t.singletonKeys??[],this.centerPinColors=t.centerPinColors??[];let n=this.initializeWipPartitions();this.wipPartitions=n.wipPartitions,this.splitBoxIds=n.splitBoxIds,this.addedPins=n.addedPins,this.exploredPins=new Set,this.unexploredPins=this.wipPartitions.flatMap((i)=>i.pins.map((s)=>({...s,partitionId:i.partitionId}))),this.boxSingletonKeys=this.initializeBoxSingletonKeys(),this.pinConnectionCount=(()=>{let i={};for(let s of this.initialGraph.pins)i[`${s.boxId}:${s.pinId}`]=this.getNeighbors(s).length;return i})();let o={};for(let i of this.initialGraph.pins)o[i.networkId]=(o[i.networkId]??0)+1;this.networkSize=o;let r={};for(let i of this.initialGraph.pins)r[`${i.boxId}:${i.pinId}`]=o[i.networkId];this.pinNetworkSize=r}initialGraph;lastGraph;lastExploredPin;solved=!1;iteration=0;wipPartitions;unexploredPins=[];boxSingletonKeys;exploredPins;addedPins;allAcceptedPins=new Set;pinConnectionCount;networkSize;pinNetworkSize;splitBoxIds;acceptedBoxPartitionMap=new Map;singletonKeys;centerPinColors;initializeBoxSingletonKeys(){let e={};for(let t of this.initialGraph.boxes){let n=this.initialGraph.pins.filter((i)=>i.boxId===t.boxId),o=n.length,r=n.map((i)=>`${i.color}/${o}`).filter((i)=>this.singletonKeys.includes(i));e[t.boxId]=new Set(r)}return e}initializeWipPartitions(){let e=[],t=new Set,n=new Set,o=0;for(let r of this.initialGraph.boxes){let i=this.initialGraph.pins.filter((a)=>a.boxId===r.boxId).filter((a)=>qq(this.initialGraph,r,a)).filter((a)=>!this.centerPinColors.includes(a.color));if(i.length<4)continue;let s=new Set(i.map((a)=>qq(this.initialGraph,r,a)));if(s.size>1)n.add(r.boxId);for(let a of s){let c={partitionId:`partition${o++}`,filledSingletonSlots:new Set,pins:[]};for(let l of i)if(qq(this.initialGraph,r,l)===a)c.pins.push({boxId:r.boxId,pinId:l.pinId}),t.add(`${r.boxId}:${l.pinId}`);e.push(c)}}if(e.length===0)e.push(this.createWipPartitionFromEntireGraph()),this.solved=!0;return QQ(`splitBoxIds = ${Array.from(n).join(", ")}`),QQ(`wipPartitions = ${e.map((r)=>r.partitionId).join(", ")}`),{wipPartitions:e,splitBoxIds:n,addedPins:t}}createWipPartitionFromEntireGraph(){return{partitionId:"entire-graph",filledSingletonSlots:new Set,pins:this.initialGraph.pins.map((e)=>({boxId:e.boxId,pinId:e.pinId}))}}step(){if(this.solved)return;if(this.iteration++,QQ(`
── Iteration ${this.iteration} ──  unexplored=${this.unexploredPins.length}  explored=${this.exploredPins.size}`),this.unexploredPins.sort((l,h)=>{let d=`${l.boxId}:${l.pinId}`,u=`${h.boxId}:${h.pinId}`,_=this.pinNetworkSize[d]-this.pinNetworkSize[u];if(_!==0)return _;return this.pinConnectionCount[d]-this.pinConnectionCount[u]}),this.unexploredPins.length===0){this.solved=!0;return}let e=this.unexploredPins.shift(),t=`${e.boxId}:${e.pinId}`;QQ(`Exploring pin ${e.boxId}:${e.pinId} for partition "${e.partitionId}"`),this.lastExploredPin={...e,partitionId:e.partitionId};let n=`${e.partitionId}[${t}]`,o=this.initialGraph.pins.find((l)=>l.boxId===e.boxId&&l.pinId===e.pinId);if(!o)return;if(this.exploredPins.has(n))return;let r=this.wipPartitions.find((l)=>l.partitionId===e.partitionId);if(!r)return;let i=this.acceptedBoxPartitionMap.get(e.boxId);if(i&&i!==e.partitionId&&!this.splitBoxIds.has(e.boxId)){QQ(`  ↳ rejected (box ${e.boxId} for partition ${e.partitionId} already in partition ${this.acceptedBoxPartitionMap.get(e.boxId)})`),this.exploredPins.add(n);return}let s=this.boxSingletonKeys[e.boxId];if(Array.from(s).some((l)=>r.filledSingletonSlots.has(l))){QQ(`  ↳ rejected (singleton already in partition "${e.partitionId}")`),this.exploredPins.add(n);return}for(let l of s)r.filledSingletonSlots.add(l);if(r.pins.push({boxId:e.boxId,pinId:e.pinId}),this.allAcceptedPins.add(t),this.addedPins.add(t),!this.splitBoxIds.has(e.boxId))this.acceptedBoxPartitionMap.set(e.boxId,e.partitionId);this.exploredPins.add(n),QQ(`  ↳ accepted → pins in partition now = ${r.pins.length}`);let c=this.getNeighbors(o);for(let l of c){let h=`${l.boxId}:${l.pinId}`;if(this.addedPins.has(h))continue;if(this.centerPinColors.includes(l.color))continue;if(this.exploredPins.has(`${e.partitionId}[${h}]`))continue;this.unexploredPins.push({boxId:l.boxId,pinId:l.pinId,partitionId:e.partitionId})}if(this.unexploredPins.length===0)this.solved=!0;if(this.solved)QQ(`Solver finished in ${this.iteration} iterations, partitions=${this.getPartitions().length}`)}getNeighbors(e){let t=[];for(let n of this.initialGraph.pins){if(n.networkId!==e.networkId)continue;if(e.boxId===n.boxId&&n.pinId===e.pinId)continue;t.push(n)}for(let n of this.initialGraph.pins){if(n.boxId!==e.boxId)continue;t.push(n)}return t}solve(){while(!this.solved&&this.iteration<1000)this.step()}getPartitions(){if(!this.solved)throw Error("Graph not solved");let e=[];for(let t of this.wipPartitions){if(t.pins.length===0)continue;let n=new Set(t.pins.map((r)=>r.boxId)),o=this.initialGraph.boxes.filter((r)=>n.has(r.boxId));e.push({boxes:o,pins:this.initialGraph.pins.filter((r)=>t.pins.some((i)=>i.pinId===r.pinId&&i.boxId===r.boxId)||this.centerPinColors.includes(r.color)&&n.has(r.boxId))})}return e}getGraphicsForLastGraph(){let e=kQ(this.lastGraph,{title:`Iteration ${this.iteration}`}),t=this.wipPartitions.length,n=0.4;if(this.wipPartitions.forEach((r,i)=>{if(r.pins.length===0)return;let s=$q(i,t,0.25);for(let{boxId:a,pinId:c}of r.pins){let{x:l,y:h}=eIe(this.lastGraph,a,c);e.rects.push({center:{x:l,y:h},width:0.4,height:0.4,fill:s})}}),this.lastExploredPin){let{boxId:r,pinId:i,color:s}=this.lastExploredPin,a=eIe(this.lastGraph,r,i),c=0.25;e.rects.push({center:{x:a.x,y:a.y},width:0.25,height:0.25,fill:this.lastExploredPin.partitionId?$q(this.wipPartitions.findIndex((l)=>l.partitionId===this.lastExploredPin.partitionId),this.wipPartitions.length,1):"black"}),e.texts.push({x:a.x,y:a.y,text:`${r}:${i}-${Array.from(this.boxSingletonKeys[r]??[]).join(",")}`,fontSize:0.1})}let o=0.4;for(let r of this.unexploredPins){let{boxId:i,pinId:s,partitionId:a}=r,c=this.wipPartitions.findIndex((_)=>_.partitionId===a);if(c===-1)continue;let l=$q(c,this.wipPartitions.length,1),{x:h,y:d}=eIe(this.lastGraph,i,s),u=1+0.1*c;e.rects.push({center:{x:h,y:d},width:o*u,height:o*u,fill:"none",stroke:l})}return e}},vPr=(e,t,n={})=>{n.similarityMethod??="wl-distance";let o=ZZe,r=Object.fromEntries(Object.entries(t).map(([s,a])=>[s,o(e,a)])),i=Object.entries(r).reduce((s,[a,c])=>c<s[1]?[a,c]:s);return{graphName:i[0],graph:t[i[0]],distance:i[1],corpusScores:r}},SPr=(e)=>{if(e.x>0)return"x+";if(e.x<0)return"x-";if(e.y>0)return"y+";if(e.y<0)return"y-";return null},PPr=(e)=>{switch(e){case"x+":return{x:1,y:0};case"x-":return{x:-1,y:0};case"y+":return{x:0,y:1};case"y-":return{x:0,y:-1}}},$dn=(e,t)=>{let n=e.boxes.find((a)=>a.boxId===t);if(!n)throw Error(`Box ${t} not found`);let r=e.pins.filter((a)=>a.boxId===t).map((a)=>qq(e,n,a)),i={"x-":0,"x+":0,"y-":0,"y+":0};for(let a of r){if(!a)continue;i[a]++}let s=Math.max(...Object.values(i));for(let a of Object.keys(i))if(i[a]===s)return a;return null},EPr=(e,t,{floatingToFixedBoxAssignment:n,floatingBoxIdsWithMutablePinOffsets:o})=>{for(let r of e.boxes){let i=n[r.boxId];if(!i)continue;if(!r.center)continue;if(o?.has(r.boxId))continue;let s=oIe(t,i),a=oIe(e,r.boxId),c=$dn(t,i),l=$dn(e,r.boxId);if(c===null||l===null)continue;if(c!==l)continue;let h=PPr(c),d=s.maxX-s.minX,u=a.maxX-a.minX,_=s.maxY-s.minY,p=a.maxY-a.minY,m=u-d,A=p-_;if(m<0.001&&A<0.001)continue;for(let g of e.boxes){if(g.boxId===r.boxId)continue;if(!g.center)continue;let f={x:g.center.x-r.center.x,y:g.center.y-r.center.y};if(SPr({x:f.x*Math.abs(h.x),y:f.y*Math.abs(h.y)})===c)g.center.x+=h.x*m,g.center.y+=h.y*A}}},MPr=(e,t,n={})=>{let{floatingBoxIdsWithMutablePinOffsets:o=new Set}=n,{floatingToFixedBoxAssignment:r,floatingToFixedPinAssignment:i}=Jdn(e,t),s=structuredClone(e);for(let a of s.pins){if(!o.has(a.boxId))continue;if(i[a.boxId]?.[a.pinId]){let c=i[a.boxId]?.[a.pinId],l=r[a.boxId],h=t.pins.find((d)=>d.boxId===l&&d.pinId===c);if(h)a.offset=h.offset}}for(let a of s.boxes)if(r[a.boxId]){let c=r[a.boxId],l=t.boxes.find((h)=>h.boxId===c);if(l)a.center=l.center,a.kind="fixed"}if(n.pushBoxesAsBoxesChangeSize)EPr(s,t,{floatingToFixedBoxAssignment:r,floatingBoxIdsWithMutablePinOffsets:o});return s},wPr=(e)=>{let{floatingGraph:t,fixedCorpusMatch:n,fixedAccessoryCorpusMatch:o}=e,{floatingToFixedBoxAssignment:r,floatingToFixedPinAssignment:i,floatingToFixedNetworkAssignment:s}=Jdn(t,n);console.log("[netAdaptAccessoryGraph] START",{floatingBoxes:t.boxes.length,fixedBoxes:n.boxes.length,accessoryBoxes:o.boxes.length});let a={};for(let[u,_]of Object.entries(s))a[_]=u;console.log("[netAdaptAccessoryGraph] assignments",{box:r,net:s});let c=[],l=[],h=new Set(Object.values(r)),d={};for(let[u,_]of Object.entries(r))d[_]=u;for(let u of o.boxes){let _=h.has(u.boxId),p=_?d[u.boxId]??u.boxId:u.boxId;if(!u.center){console.log("[netAdaptAccessoryGraph] SKIP box without center",u.boxId);continue}console.log(`[netAdaptAccessoryGraph] ADD accessory box ${u.boxId} (${_?"matched":"unmatched"}) as ${p}`);let m=o.pins.filter((A)=>A.boxId===u.boxId).map((A)=>({...A,boxId:p,networkId:a[A.networkId]??A.networkId}));c.push({...u,kind:"fixed",center:u.center,boxId:p}),l.push(...m)}return console.log("[netAdaptAccessoryGraph] FINISH",{addedBoxes:c.length,addedPins:l.length}),{boxes:c,pins:l}},BPr=(e,{corpus:t,singletonKeys:n,centerPinColors:o,floatingBoxIdsWithMutablePinOffsets:r,accessoryCorpus:i})=>{let s=new IPr(e,{singletonKeys:n,centerPinColors:o});while(!s.solved&&s.iteration<1000)s.step();let l=s.getPartitions().map(bPr).map((m)=>{let{graph:A,distance:g,graphName:f}=vPr(m.g,t),y=i?.[f],x=MPr(structuredClone(m.g),A,{floatingBoxIdsWithMutablePinOffsets:r,pushBoxesAsBoxesChangeSize:!0}),C;if(y)C=wPr({floatingGraph:structuredClone(m.g),fixedCorpusMatch:A,fixedAccessoryCorpusMatch:y});return{adaptedBpcGraph:x,adaptedAccessoryGraph:C,reflected:m.reflected,centerBoxId:m.centerBoxId,distance:g}}),h=l.map(({adaptedBpcGraph:m,reflected:A,centerBoxId:g})=>{if(!A)return m;return eet({graph:m,axis:"x",centerBoxId:g})}),d;if(i)d=l.filter((m)=>m.adaptedAccessoryGraph!==void 0&&m.centerBoxId!==null).map(({adaptedAccessoryGraph:m,reflected:A,centerBoxId:g})=>{if(!A)return m;return eet({graph:m,axis:"x",centerBoxId:g})});let u=Kdn(h),_;if(i)_=Kdn(d);let p=l.reduce((m,A)=>m+(A.distance||0),0);return{fixedGraph:u,accessoryFixedGraph:_,distance:p}},eun=(e,{corpus:t,singletonKeys:n,centerPinColors:o,floatingBoxIdsWithMutablePinOffsets:r})=>{let i=[],s=null;for(let a of e){let{fixedGraph:c,accessoryFixedGraph:l,distance:h}=BPr(a.floatingGraph,{corpus:t,singletonKeys:n,centerPinColors:o,floatingBoxIdsWithMutablePinOffsets:r});if(i.push({variantName:a.variantName,distance:h}),!s||h<s.distance)s={variantName:a.variantName,fixedGraph:c,accessoryFixedGraph:l,distance:h}}return{fixedGraph:s.fixedGraph,accessoryFixedGraph:s.accessoryFixedGraph,selectedVariantName:s.variantName,variantResults:i}};Ko();Ko();var B7n=Qe(p0(),1);var T7n=Qe(p0(),1);m0();Ko();Ko();var L7n=Qe(p0(),1),F7n=Qe(p0(),1);kre();var QZ=Qe(wt(),1),z7n=Qe(p0(),1);var O7n=Qe(p0(),1);var G7n=Qe(p0(),1),U7n=Qe(rn(),1);tc();var $7n=Qe(p0(),1);var Mp=0.000000000000001,TPr=class{map;rev;constructor(){this.map=new Map([["0",0]]),this.rev=["0"]}getOrCreate(e){let t=String(e),n=t.toUpperCase();if(this.map.has(n))return this.map.get(n);let o=this.rev.length;return this.map.set(n,o),this.rev.push(t),o}get(e){return this.map.get(String(e).toUpperCase())}count(){return this.rev.length}matrixIndexOfNode(e){if(e===0)return-1;return e-1}};function H2(e){if(e==null)return NaN;let t=String(e).trim();if(t==="")return NaN;if(/^[+-]?\d*\.?\d+(?:[eE][+-]?\d+)?$/.test(t))return parseFloat(t);let n={t:1000000000000,g:1e9,meg:1e6,k:1000,m:0.001,u:0.000001,n:0.000000001,p:0.000000000001,f:0.000000000000001},o=t.match(/^([+-]?\d*\.?\d+(?:[eE][+-]?\d+)?)([a-zA-Z]+)$/);if(!o)return parseFloat(t);let[,r,i]=o;if(r==null)return parseFloat(t);let s=parseFloat(r),a=(i??"").toLowerCase();if(a=a.replace(/(ohm|v|a|s|h|f)$/g,""),a==="meg")return s*n.meg;if(a.length===1&&a in n)return s*n[a];return s}function DPr(e){let o=e.trim().replace(/^pulse\s*\(/i,"(").replace(/^\(/,"").replace(/\)$/,"").trim().split(/[\s,]+/).filter((i)=>i.length);if(o.length<7)throw Error("PULSE(...) requires 7 or 8 args");let r=o.map((i)=>H2(i));if(r.some((i)=>Number.isNaN(i)))throw Error("Invalid PULSE() numeric value");return{v1:r[0],v2:r[1],td:r[2],tr:r[3],tf:r[4],ton:r[5],period:r[6],ncycles:o[7]!=null?r[7]:1/0}}function NPr(e){let o=e.trim().replace(/^pwl\s*\(/i,"(").replace(/^\(/,"").replace(/\)$/,"").trim().split(/[\s,]+/).filter((i)=>i.length);if(o.length===0||o.length%2!==0)throw Error("PWL(...) requires an even number of time/value pairs");let r=[];for(let i=0;i<o.length;i+=2){let s=H2(o[i]),a=H2(o[i+1]);if(Number.isNaN(s)||Number.isNaN(a))throw Error("Invalid PWL() numeric value");r.push({t:s,v:a})}return r}function RPr(e,t){if(t<e.td)return e.v1;let n=t-e.td,o=Math.floor(n/e.period);if(o>=e.ncycles)return e.v1;let r=n-o*e.period;if(r<e.tr){let i=r/Math.max(e.tr,Mp);return e.v1+(e.v2-e.v1)*i}if(r<e.tr+e.ton)return e.v2;if(r<e.tr+e.ton+e.tf){let i=(r-(e.tr+e.ton))/Math.max(e.tf,Mp);return e.v2+(e.v1-e.v2)*i}return e.v1}function QPr(e,t){if(e.length===0)return 0;if(t<=e[0].t)return e[0].v;for(let n=1;n<e.length;n++){let o=e[n-1],r=e[n];if(t<=r.t){let i=Math.max(r.t-o.t,Mp),s=(t-o.t)/i;return o.v+(r.v-o.v)*s}}return e[e.length-1].v}function kPr(e){let t=/"[^"]*"|\w+\s*\([^)]*\)|\([^()]*\)|\S+/g,n=[],o;while((o=t.exec(e))!==null)n.push(o[0]);return n}function Nl(e,t,n){let o=e[t];if(o==null)throw Error(n);return o}function LPr(e){let t=new Map,n=new Map,o={nodes:new TPr,R:[],C:[],L:[],V:[],S:[],D:[],analyses:{ac:null,tran:null},probes:{tran:[]},skipped:[],models:{vswitch:t,diode:n}},r=e.split(/\r?\n/),i=!1;for(let a of r){let c=a.trim();if(!c)continue;if(/^\*/.test(c))continue;if(/^\s*\.end\b/i.test(c))break;c=c.replace(/\/\/.*$/,""),c=c.replace(/;.*$/,"");let l=kPr(c);if(l.length===0)continue;let h=l[0];if(h.length===0)continue;if(!i&&!/^[rclvgsmiqd]\w*$/i.test(h)&&!/^\./.test(h)){i=!0;continue}if(/^\./.test(h)){let _=h.toLowerCase();if(_===".ac"){let p=Nl(l,1,".ac missing mode").toLowerCase();if(p!=="dec"&&p!=="lin")throw Error(".ac supports 'dec' or 'lin'");let m=parseInt(Nl(l,2,".ac missing point count"),10),A=H2(Nl(l,3,".ac missing start frequency")),g=H2(Nl(l,4,".ac missing stop frequency"));o.analyses.ac={mode:p,N:m,f1:A,f2:g}}else if(_===".tran"){let p=H2(Nl(l,1,".tran missing timestep")),m=H2(Nl(l,2,".tran missing stop time"));o.analyses.tran={dt:p,tstop:m}}else if(_===".print")if(Nl(l,1,".print missing analysis type").toLowerCase()==="tran"){let m=l.slice(2);for(let A of m){let g=A.match(/^v\(([^)]+)\)$/i);if(g&&g[1]){let f=g[1];if(!o.probes.tran.some((y)=>y.toUpperCase()===f.toUpperCase()))o.probes.tran.push(f)}}}else o.skipped.push(c);else if(_===".model"){let p=Nl(l,1,".model missing name"),A=Nl(l,2,".model missing type"),g="";if(A.includes("(")){let y=A.indexOf("(");g=A.slice(y+1),A=A.slice(0,y)}if(!g)g=l.slice(3).join(" ").replace(/^\(/,"").replace(/\)$/,"");else{let y=l.slice(3).join(" ").replace(/\)$/,"");g=`${g} ${y}`.trim()}g=g.replace(/^\(/,"").replace(/\)$/,"").trim();let f=A.toLowerCase();if(f==="vswitch"||f==="sw"){let y={name:p,Ron:1,Roff:1000000000000,Von:0,Voff:0},x,C;if(g.length>0){let b=g.split(/[\s,]+/).filter(Boolean);for(let I of b){let[v,P]=I.split("=");if(!v||P==null)continue;let M=v.toLowerCase(),B=H2(P);if(Number.isNaN(B))continue;if(M==="ron")y.Ron=B;else if(M==="roff")y.Roff=B;else if(M==="von")y.Von=B;else if(M==="voff")y.Voff=B;else if(M==="vt")x=B;else if(M==="vh")C=B}}if(x!==void 0){let b=C??0;y.Von=x+b/2,y.Voff=x-b/2}t.set(p.toLowerCase(),y)}else if(f==="d"){let y={name:p,Is:0.00000000000001,N:1};if(g.length>0){let x=g.split(/[\s,]+/).filter(Boolean);for(let C of x){let[b,I]=C.split("=");if(!b||I==null)continue;let v=b.toLowerCase(),P=H2(I);if(Number.isNaN(P))continue;if(v==="is")y.Is=P;else if(v==="n")y.N=P}}n.set(p.toLowerCase(),y)}else o.skipped.push(c)}else o.skipped.push(c);continue}let d=h.charAt(0).toLowerCase(),u=h;try{if(d==="r"){let _=o.nodes.getOrCreate(Nl(l,1,"Resistor missing node")),p=o.nodes.getOrCreate(Nl(l,2,"Resistor missing node")),m=H2(Nl(l,3,"Resistor missing value"));o.R.push({name:u,n1:_,n2:p,R:m})}else if(d==="c"){let _=o.nodes.getOrCreate(Nl(l,1,"Capacitor missing node")),p=o.nodes.getOrCreate(Nl(l,2,"Capacitor missing node")),m=H2(Nl(l,3,"Capacitor missing value"));o.C.push({name:u,n1:_,n2:p,C:m,vPrev:0})}else if(d==="l"){let _=o.nodes.getOrCreate(Nl(l,1,"Inductor missing node")),p=o.nodes.getOrCreate(Nl(l,2,"Inductor missing node")),m=H2(Nl(l,3,"Inductor missing value"));o.L.push({name:u,n1:_,n2:p,L:m,iPrev:0})}else if(d==="v"){let _=o.nodes.getOrCreate(Nl(l,1,"Voltage source missing node")),p=o.nodes.getOrCreate(Nl(l,2,"Voltage source missing node")),m={dc:0,acMag:0,acPhaseDeg:0,waveform:null,index:-1},A=3;if(A<l.length&&!/^[a-zA-Z]/.test(l[A]))m.dc=H2(l[A]),A++;while(A<l.length){let g=l[A].toLowerCase();if(g==="dc"){let f=Nl(l,A+1,"DC value missing");m.dc=H2(f),A+=2}else if(g==="ac"){let f=Nl(l,A+1,"AC magnitude missing");m.acMag=H2(f);let y=l[A+2];if(y!=null&&/^[+-]?\d/.test(y))m.acPhaseDeg=H2(y),A+=3;else A+=2}else if(g.startsWith("pulse")){let f=g.includes("(")?g:Nl(l,A+1,"PULSE() missing arguments");if(!f||!/\(.*\)/.test(f))throw Error("Malformed PULSE() specification");let y=DPr(f);m.waveform=(x)=>RPr(y,x),A+=g.includes("(")?1:2}else if(g.startsWith("pwl")){let f=g.includes("(")?g:Nl(l,A+1,"PWL() missing arguments");if(!f||!/\(.*\)/.test(f))throw Error("Malformed PWL() specification");let y=NPr(f);m.waveform=(x)=>QPr(y,x),A+=g.includes("(")?1:2}else if(/^\(.*\)$/.test(g))A++;else A++}o.V.push({name:u,n1:_,n2:p,dc:m.dc,acMag:m.acMag,acPhaseDeg:m.acPhaseDeg,waveform:m.waveform,index:m.index??-1})}else if(d==="s"){let _=o.nodes.getOrCreate(Nl(l,1,"Switch missing node")),p=o.nodes.getOrCreate(Nl(l,2,"Switch missing node")),m=o.nodes.getOrCreate(Nl(l,3,"Switch missing control node")),A=o.nodes.getOrCreate(Nl(l,4,"Switch missing control node")),g=Nl(l,5,"Switch missing model");o.S.push({name:u,n1:_,n2:p,ncPos:m,ncNeg:A,modelName:g.toLowerCase(),model:null,isOn:!1})}else if(d==="d")if(l.length===4){let _=o.nodes.getOrCreate(Nl(l,1,"Diode missing node")),p=o.nodes.getOrCreate(Nl(l,2,"Diode missing node")),m=Nl(l,3,"Diode missing model");o.D.push({name:u,nPlus:_,nMinus:p,modelName:m.toLowerCase(),model:null,vdPrev:0})}else o.skipped.push(c);else o.skipped.push(c)}catch(_){if(_ instanceof Error)throw Error(`Parse error on line: "${c}"
${_.message}`);throw _}}let s=o.nodes.count()-1;for(let a=0;a<o.V.length;a++){let c=o.V[a];if(!c)continue;c.index=s+a}for(let a of o.S){let c=t.get(a.modelName);if(!c)throw Error(`Unknown .model ${a.modelName} referenced by switch ${a.name}`);a.model=c,a.isOn=!1}for(let a of o.D){let c=n.get(a.modelName);if(!c)throw Error(`Unknown .model ${a.modelName} referenced by diode ${a.name}`);a.model=c}return o}var Rl=class e{re;im;constructor(t=0,n=0){this.re=t,this.im=n}static from(t,n=0){return new e(t,n)}static fromPolar(t,n=0){let o=n*Math.PI/180;return new e(t*Math.cos(o),t*Math.sin(o))}clone(){return new e(this.re,this.im)}add(t){return new e(this.re+t.re,this.im+t.im)}sub(t){return new e(this.re-t.re,this.im-t.im)}mul(t){return new e(this.re*t.re-this.im*t.im,this.re*t.im+this.im*t.re)}div(t){let n=t.re*t.re+t.im*t.im;if(n<Mp)throw Error("Complex divide by ~0");return new e((this.re*t.re+this.im*t.im)/n,(this.im*t.re-this.re*t.im)/n)}inv(){let t=this.re*this.re+this.im*this.im;if(t<Mp)throw Error("Complex invert by ~0");return new e(this.re/t,-this.im/t)}abs(){return Math.hypot(this.re,this.im)}phaseDeg(){return Math.atan2(this.im,this.re)*180/Math.PI}};function HPr(e,t){let n=e.length;for(let r=0;r<n;r++){let i=e[r],s=t[r];if(!i||!s)throw Error("Matrix dimensions mismatch");let a=i.map((c)=>c.clone());a.push(s.clone()),e[r]=a}for(let r=0;r<n;r++){let i=r,s=e[r];if(!s)throw Error("Matrix row missing");let a=s[r]?.abs()??0;for(let h=r+1;h<n;h++){let d=e[h];if(!d)throw Error("Matrix row missing");let u=d[r]?.abs()??0;if(u>a)a=u,i=h}if(a<Mp)throw Error("Singular matrix (complex)");if(i!==r){let h=e[r];e[r]=e[i],e[i]=h}let c=e[r];if(!c)throw Error("Pivot row missing");let l=c[r];if(!l)throw Error("Zero pivot encountered");for(let h=r+1;h<n;h++){let d=e[h];if(!d)throw Error("Matrix row missing");let u=d[r];if(!u)continue;let _=u.div(l);if(_.abs()<Mp)continue;for(let p=r;p<=n;p++){let m=d[p],A=c[p];if(!m||!A)continue;d[p]=m.sub(_.mul(A))}}}let o=Array(n);for(let r=n-1;r>=0;r--){let i=e[r];if(!i)throw Error("Matrix row missing");let s=i[n];if(!s)throw Error("Augmented column missing");for(let c=r+1;c<n;c++){let l=i[c],h=o[c];if(!l||!h)continue;s=s.sub(l.mul(h))}let a=i[r];if(!a)throw Error("Zero pivot on back-substitution");o[r]=s.div(a)}return o}function FPr(e,t,n){if(e<=0||t<=0)throw Error(".ac frequencies must be > 0");if(t<e)[e,t]=[t,e];let o=Math.log10(t/e),r=Math.max(1,Math.ceil(o*n)),i=[];for(let a=0;a<=r;a++)i.push(e*Math.pow(10,a/n));let s=i[i.length-1];if(s==null||s<t*(1-Mp))i.push(t);return i}function tet(e,t,n,o,r){let i=t.matrixIndexOfNode(n),s=t.matrixIndexOfNode(o);if(i>=0){let a=e[i];if(!a)throw Error("Matrix row missing while stamping");a[i]=a[i]?.add(r)??r}if(s>=0){let a=e[s];if(!a)throw Error("Matrix row missing while stamping");a[s]=a[s]?.add(r)??r}if(i>=0&&s>=0){let a=e[i],c=e[s];if(!a||!c)throw Error("Matrix row missing while stamping");a[s]=a[s]?.sub(r)??Rl.from(0,0).sub(r),c[i]=c[i]?.sub(r)??Rl.from(0,0).sub(r)}}function zPr(e,t,n,o,r){let i=n.matrixIndexOfNode(o.n1),s=n.matrixIndexOfNode(o.n2),a=o.index,c=Rl.from(1,0),l=Rl.from(-1,0);if(i>=0){let d=e[i];if(!d)throw Error("Matrix row missing while stamping voltage source");d[a]=d[a]?.add(c)??c}if(s>=0){let d=e[s];if(!d)throw Error("Matrix row missing while stamping voltage source");d[a]=d[a]?.sub(c)??l}let h=e[a];if(!h)throw Error("Branch row missing while stamping voltage source");if(i>=0)h[i]=h[i]?.add(c)??c;if(s>=0)h[s]=h[s]?.sub(c)??l;t[a]=(t[a]??Rl.from(0,0)).add(r)}function OPr(e){let{mode:t,N:n,f1:o,f2:r}=e;if(t==="dec")return FPr(o,r,n);let i=[],s=Math.max(2,n),a=(r-o)/(s-1);for(let c=0;c<s;c++)i.push(o+c*a);return i}function VPr(e,t,n){let o=Array.from({length:n},()=>Array.from({length:n},()=>Rl.from(0,0))),r=Array.from({length:n},()=>Rl.from(0,0)),i=2*Math.PI;for(let s of e.R){if(s.R<=0)throw Error(`R ${s.name} must be > 0`);let a=Rl.from(1/s.R,0);tet(o,e.nodes,s.n1,s.n2,a)}for(let s of e.C){let a=Rl.from(0,i*t*s.C);tet(o,e.nodes,s.n1,s.n2,a)}for(let s of e.L){let a=Rl.from(0,i*t*s.L),c=a.abs()<Mp?Rl.from(0,0):Rl.from(1,0).div(a);tet(o,e.nodes,s.n1,s.n2,c)}for(let s of e.V){let a=Rl.fromPolar(s.acMag||0,s.acPhaseDeg||0);zPr(o,r,e.nodes,s,a)}return{A:o,b:r}}function YPr(e){if(!e.analyses.ac)return null;let{mode:t,N:n,f1:o,f2:r}=e.analyses.ac,i=e.nodes.count()-1,s=e.V.length,a=i+s,c=OPr({mode:t,N:n,f1:o,f2:r}),l={};e.nodes.rev.forEach((u,_)=>{if(_!==0)l[u]=[]});let h={},d=2*Math.PI;for(let u of c){let{A:_,b:p}=VPr(e,u,a),m=HPr(_,p);for(let A=1;A<e.nodes.count();A++){let g=A-1,f=e.nodes.rev[A];if(!f)continue;let y=l[f];if(!y)continue;y.push(m[g]??Rl.from(0,0))}for(let A of e.R){let g=A.n1===0?Rl.from(0,0):m[A.n1-1]??Rl.from(0,0),f=A.n2===0?Rl.from(0,0):m[A.n2-1]??Rl.from(0,0),x=Rl.from(1/A.R,0).mul(g.sub(f));(h[A.name]||=[]).push(x)}for(let A of e.C){let g=A.n1===0?Rl.from(0,0):m[A.n1-1]??Rl.from(0,0),f=A.n2===0?Rl.from(0,0):m[A.n2-1]??Rl.from(0,0),x=Rl.from(0,d*u*A.C).mul(g.sub(f));(h[A.name]||=[]).push(x)}for(let A of e.L){let g=A.n1===0?Rl.from(0,0):m[A.n1-1]??Rl.from(0,0),f=A.n2===0?Rl.from(0,0):m[A.n2-1]??Rl.from(0,0),y=Rl.from(0,d*u*A.L),C=(y.abs()<Mp?Rl.from(0,0):Rl.from(1,0).div(y)).mul(g.sub(f));(h[A.name]||=[]).push(C)}for(let A of e.V){let g=m[A.index]??Rl.from(0,0);(h[A.name]||=[]).push(g)}}return{freqs:c,nodeVoltages:l,elementCurrents:h}}var tun=0.02585;function GPr(e,t){let n=e.length;for(let r=0;r<n;r++){let i=e[r],s=t[r];if(!i||s==null)throw Error("Matrix dimensions mismatch");let a=i.slice();a.push(s),e[r]=a}for(let r=0;r<n;r++){let i=r,s=e[r];if(!s)throw Error("Matrix row missing");let a=Math.abs(s[r]??0);for(let h=r+1;h<n;h++){let d=e[h];if(!d)throw Error("Matrix row missing");let u=Math.abs(d[r]??0);if(u>a)a=u,i=h}if(a<Mp)throw Error("Singular matrix (real)");if(i!==r){let h=e[r];e[r]=e[i],e[i]=h}let c=e[r];if(!c)throw Error("Pivot row missing");let l=c[r];if(l==null)throw Error("Zero pivot encountered");for(let h=r+1;h<n;h++){let d=e[h];if(!d)throw Error("Matrix row missing");let u=d[r];if(u==null)continue;let _=u/l;if(Math.abs(_)<Mp)continue;for(let p=r;p<=n;p++){let m=d[p],A=c[p];if(m==null||A==null)continue;d[p]=m-_*A}}}let o=Array(n).fill(0);for(let r=n-1;r>=0;r--){let i=e[r];if(!i)throw Error("Matrix row missing");let s=i[n];if(s==null)throw Error("Augmented column missing");for(let c=r+1;c<n;c++){let l=i[c],h=o[c];if(l==null||h==null)continue;s-=l*h}let a=i[r];if(a==null)throw Error("Zero pivot on back-substitution");o[r]=s/a}return o}function ihe(e,t,n,o,r){let i=t.matrixIndexOfNode(n),s=t.matrixIndexOfNode(o);if(i>=0){let a=e[i];if(!a)throw Error("Matrix row missing while stamping");a[i]=(a[i]??0)+r}if(s>=0){let a=e[s];if(!a)throw Error("Matrix row missing while stamping");a[s]=(a[s]??0)+r}if(i>=0&&s>=0){let a=e[i],c=e[s];if(!a||!c)throw Error("Matrix row missing while stamping");a[s]=(a[s]??0)-r,c[i]=(c[i]??0)-r}}function net(e,t,n,o,r){let i=t.matrixIndexOfNode(n),s=t.matrixIndexOfNode(o);if(i>=0)e[i]=(e[i]??0)-r;if(s>=0)e[s]=(e[s]??0)+r}function UPr(e,t,n,o,r){let i=n.matrixIndexOfNode(o.n1),s=n.matrixIndexOfNode(o.n2),a=o.index;if(i>=0){let l=e[i];if(!l)throw Error("Matrix row missing while stamping voltage source");l[a]=(l[a]??0)+1}if(s>=0){let l=e[s];if(!l)throw Error("Matrix row missing while stamping voltage source");l[a]=(l[a]??0)-1}let c=e[a];if(!c)throw Error("Branch row missing while stamping voltage source");if(i>=0)c[i]=(c[i]??0)+1;if(s>=0)c[s]=(c[s]??0)-1;t[a]=(t[a]??0)+r}function WPr(e,t){let n=e>Mp?e:Math.max(t/1000,Mp),o=Math.max(1,Math.ceil(t/Math.max(n,Mp)));return{dt:o>0?t/o:t,steps:o}}function XPr(e,t,n,o,r,i,s){for(let a of n.R){let c=1/a.R;ihe(e,n.nodes,a.n1,a.n2,c)}for(let a of n.C){let c=a.C/Math.max(r,Mp);ihe(e,n.nodes,a.n1,a.n2,c);let l=-c*a.vPrev;net(t,n.nodes,a.n1,a.n2,l)}for(let a of n.L){let c=Math.max(r,Mp)/a.L;ihe(e,n.nodes,a.n1,a.n2,c),net(t,n.nodes,a.n1,a.n2,a.iPrev)}for(let a of n.S){let c=a.model;if(!c)continue;let l=a.isOn?c.Ron:c.Roff,d=1/Math.max(Math.abs(l),Mp);ihe(e,n.nodes,a.n1,a.n2,d)}for(let a of n.V){let c=a.waveform?a.waveform(o):a.dc||0;UPr(e,t,n.nodes,a,c)}for(let a of n.D){let c=a.model;if(!c)continue;let{nPlus:l,nMinus:h}=a,d=n.nodes.matrixIndexOfNode(l),u=n.nodes.matrixIndexOfNode(h),_=l===0?0:i[d]??0,p=h===0?0:i[u]??0,m=_-p,A=s===0?a.vdPrev:m,g=c.N*tun,f=A;if(A>0.8)f=0.8;if(A<-1)f=-1;let y=Math.exp(f/g),x=c.Is*(y-1),C=Math.max(c.Is/g*y,0.000000000001),b=x-C*f;ihe(e,n.nodes,l,h,C),net(t,n.nodes,l,h,b)}}function jPr(e,t){let n=!1;for(let o of e.S){let r=o.model;if(!r)continue;let i=o.ncPos===0?0:t[o.ncPos-1]??0,s=o.ncNeg===0?0:t[o.ncNeg-1]??0,a=i-s,c=o.isOn;if(o.isOn){if(a<r.Voff)c=!1}else if(a>r.Von)c=!0;if(c!==o.isOn)o.isOn=c,n=!0}return n}function KPr(e){if(!e.analyses.tran)return null;let{dt:t,tstop:n}=e.analyses.tran,{dt:o,steps:r}=WPr(t,n),i=e.nodes.count()-1,s=e.V.length,a=i+s,c=[],l={};e.nodes.rev.forEach((u,_)=>{if(_!==0)l[u]=[]});let h={},d=0;for(let u=0;u<=r;u++,d=u*o){c.push(d);let _=Array(a).fill(0);for(let p=0;p<20;p++){let m=Array.from({length:a},()=>Array(a).fill(0)),A=Array(a).fill(0);if(XPr(m,A,e,d,o,_,p),_=GPr(m,A),!jPr(e,_))break;if(p===19)break}for(let p=1;p<e.nodes.count();p++){let m=p-1,A=e.nodes.rev[p];if(!A)continue;let g=l[A];if(!g)continue;g.push(_[m]??0)}for(let p of e.R){let m=p.n1===0?0:_[p.n1-1]??0,A=p.n2===0?0:_[p.n2-1]??0,g=(m-A)/p.R;(h[p.name]||=[]).push(g)}for(let p of e.C){let m=p.n1===0?0:_[p.n1-1]??0,A=p.n2===0?0:_[p.n2-1]??0,g=p.C*(m-A-p.vPrev)/Math.max(o,Mp);(h[p.name]||=[]).push(g)}for(let p of e.L){let m=p.n1===0?0:_[p.n1-1]??0,A=p.n2===0?0:_[p.n2-1]??0,f=Math.max(o,Mp)/p.L*(m-A)+p.iPrev;(h[p.name]||=[]).push(f)}for(let p of e.V){let m=_[p.index]??0;(h[p.name]||=[]).push(m)}for(let p of e.S){let m=p.model;if(!m)continue;let A=p.n1===0?0:_[p.n1-1]??0,g=p.n2===0?0:_[p.n2-1]??0,f=p.isOn?m.Ron:m.Roff,y=Math.max(Math.abs(f),Mp),x=(A-g)/y;(h[p.name]||=[]).push(x)}for(let p of e.D){if(!p.model)continue;let{nPlus:m,nMinus:A,model:g}=p,f=m===0?0:_[m-1]??0,y=A===0?0:_[A-1]??0,x=f-y,C=g.N*tun,b=Math.exp(x/C),I=g.Is*(b-1);(h[p.name]||=[]).push(I)}for(let p of e.C){let m=p.n1===0?0:_[p.n1-1]??0,A=p.n2===0?0:_[p.n2-1]??0;p.vPrev=m-A}for(let p of e.L){let m=p.n1===0?0:_[p.n1-1]??0,A=p.n2===0?0:_[p.n2-1]??0,g=Math.max(o,Mp)/p.L;p.iPrev=g*(m-A)+p.iPrev}for(let p of e.D){let m=p.nPlus===0?0:_[p.nPlus-1]??0,A=p.nMinus===0?0:_[p.nMinus-1]??0;p.vdPrev=m-A}}if(e.probes.tran.length>0){let u={},_=e.probes.tran.map((p)=>p.toUpperCase());for(let p in l)if(_.includes(p.toUpperCase()))u[p]=l[p];return{times:c,nodeVoltages:u,elementCurrents:h}}return{times:c,nodeVoltages:l,elementCurrents:h}}function nun(e){let t=LPr(e),n=YPr(t),o=KPr(t);return{circuit:t,ac:n,tran:o}}function oun(e,t,n){if(!e||!t.analyses.tran)return[];let{dt:o,tstop:r}=t.analyses.tran,{times:i,nodeVoltages:s}=e,a=[];for(let c in s){let l=s[c];a.push({type:"simulation_transient_voltage_graph",simulation_transient_voltage_graph_id:`stvg_${n}_${c}`,simulation_experiment_id:n,timestamps_ms:i.map((h)=>h*1000),voltage_levels:l,time_per_step:o*1000,start_time_ms:0,end_time_ms:r*1000,name:`${c}`})}return a}function qPr(e){let t=new Map,n=0;function o(r){for(let[,s]of t)if(s.has(r))return s;let i=new Set;return t.set(`connectivity_net${n++}`,i),i}for(let r of e){let i=null;for(let s of r){if(!i)i=o(s);else if(!i.has(s)){let a=o(s);if(a!==i){for(let c of a)i.add(c);t.delete(Array.from(t.entries()).find(([,c])=>c===a)[0])}}i.add(s)}}return Object.fromEntries(Array.from(t.entries()).map(([r,i])=>[r,Array.from(i)]))}var JPr=class{netMap;idToNetMap;constructor(e){this.netMap=e,this.idToNetMap={};for(let[t,n]of Object.entries(e))for(let o of n)this.idToNetMap[o]=t}addConnections(e){for(let t of e){let n=new Set;for(let r of t){let i=this.idToNetMap[r];if(i)n.add(i)}let o;if(n.size===0)o=`connectivity_net${Object.keys(this.netMap).length}`,this.netMap[o]=[];else if(n.size===1)o=n.values().next().value??`connectivity_net${Object.keys(this.netMap).length}`;else{o=n.values().next().value??`connectivity_net${Object.keys(this.netMap).length}`;for(let r of n)if(r!==o){this.netMap[o].push(...this.netMap[r]),this.netMap[r]=this.netMap[o];for(let i of this.netMap[o])this.idToNetMap[i]=o}}for(let r of t){if(!this.netMap[o].includes(r))this.netMap[o].push(r);this.idToNetMap[r]=o}}}getIdsConnectedToNet(e){return this.netMap[e]||[]}getNetConnectedToId(e){return this.idToNetMap[e]}areIdsConnected(e,t){if(e===t)return!0;let n=this.getNetConnectedToId(e);if(!n)return!1;let o=this.getNetConnectedToId(t);if(!o)return!1;return n===o||o===e||o===e}areAllIdsConnected(e){let t=this.getNetConnectedToId(e[0]);for(let n of e){let o=this.getNetConnectedToId(n);if(o===void 0)return!1;if(o!==t)return!1}return!0}},run=(e)=>{let t=[];for(let o of e)if(o.type==="source_trace")t.push([...o.connected_source_port_ids??[],...o.connected_source_net_ids??[]]);else if(o.type==="source_component"){if(o.internally_connected_source_port_ids)for(let r of o.internally_connected_source_port_ids)t.push(r)}let n=qPr(t);return new JPr(n)};Ko();var ret=class{sourceSpan;leadingTrivia=[];trailingComment;constructor(e={}){this.sourceSpan=e.sourceSpan,this.trailingComment=e.trailingComment}getString(e){return this.toSource(e)}},iun="__default__",Uw=class e extends ret{originalSource;constructor(t={}){super(t);this.originalSource=t.originalSource}static classes={};static register(t){if(!t.spiceTokenKeys||t.spiceTokenKeys.length===0)throw Error("Class must declare static spiceTokenKeys");for(let n of t.spiceTokenKeys)e.classes[n.toLowerCase()]=t}static parseSpiceTokens(t){let n=t.tokens.find((i)=>i.type!=="whitespace"),o=n===void 0?"blank":n.type==="directive"?`.${n.value}`:n.type==="comment"?"comment":n.type==="identifier"?n.raw[0]?.toUpperCase()??iun:n.type,r=e.classes[o.toLowerCase()]??(n?.type==="identifier"?e.classes.__unknown_element__:void 0)??e.classes[iun];if(r===void 0)throw Error(`No SPICE card class registered for "${o}"`);return r.fromSpiceTokens(t)}},Uc=class extends Uw{cardKind="directive"},Ww=class extends Uc{},hun=class extends ret{};function ahe(e,t){let n=e?.dialect??"generic";if(n!=="pspice")throw Error(`PSpice-only construct ${t} cannot be serialized to target dialect "${n}". Serialize with { dialect: "pspice" } or translate/remove the construct before exporting.`)}function ZPr(e){let t=[],n=[],o,r,i=(a)=>{t.push({tokens:[],originalSource:"",range:{start:a.range.end,end:a.range.end},leadingNewlineRaw:a.raw})},s=()=>{if(n.length===0)return;let a={start:n[0].range.start,end:n.at(-1).range.end};t.push({tokens:n,originalSource:n.map((c)=>c.raw).join(""),range:a,leadingNewlineRaw:r}),n=[],o=void 0,r=void 0};for(let a of e){if(a.type==="newline"){if(o!==void 0){let c=o;s(),i(c),o=a;continue}if(n.length===0)i(a);else o=a;continue}if(o!==void 0){if(a.type==="continuation")n.push(o,a),o=void 0;else{let c=o.raw;s(),r=c,o=void 0,n.push(a)}continue}if(a.type==="continuation"){n.push(a);continue}n.push(a)}return s(),t}function iet(e){return e.filter((t)=>t.type!=="whitespace"&&t.type!=="newline"&&t.type!=="continuation")}function dun(e){if(e===void 0)return;if("value"in e&&typeof e.value==="string")return e.value;return e.raw}function eEr(e){let t=[];for(let n=0;n<e.length;n+=1){let o=e[n];if(o===void 0)continue;let r=oet(o);if(r===".control"){let i=[],s,a=o.originalSource;for(n+=1;n<e.length;n+=1){let c=e[n];if(c===void 0)continue;if(a=`${a}${c.leadingNewlineRaw??`
`}${c.originalSource}`,oet(c)===".endc"){s=c;break}i.push(c)}t.push({...o,childCards:i,endCard:s,originalSource:a});continue}if(r===".subckt"){let i=[],s,a=o.originalSource;for(n+=1;n<e.length;n+=1){let c=e[n];if(c===void 0)continue;if(a=`${a}${c.leadingNewlineRaw??`
`}${c.originalSource}`,oet(c)===".ends"){s=c;break}i.push(c)}t.push({...o,childCards:i,endCard:s,originalSource:a});continue}t.push(o)}return t}function oet(e){let[t]=iet(e.tokens);if(t===void 0)return;if(t.type==="directive")return`.${t.value}`;return dun(t)}function LQ(e){return dun(e)}function sun(e){return e.type==="punctuation"&&(e.value==="("||e.value===")"||e.value===",")}var Ha=class e{constructor(t){this.card=t,this.tokens=iet(t.tokens),this.originalSource=t.originalSource}card;tokens;originalSource;static from(t){return new e(t)}head(){return LQ(this.tokens[0])??""}headRaw(){return this.tokens[0]?.raw??""}headDesignator(){return this.tokens[0]?.raw[0]?.toUpperCase()??""}arg(t){return LQ(this.tokens[t+1])}args(){return this.tokens.slice(1).map((t)=>LQ(t)??t.raw)}argsAfter(t){return this.args().slice(t)}argsUntilLast(){return this.args().slice(0,-1)}lastArg(){return this.args().at(-1)}keywordIndex(t){return this.findKeyword(t)?.argIndex??-1}argAfterKeyword(t){let n=this.findKeyword(t);return n===void 0?void 0:LQ(this.tokens[n.tokenIndex+n.tokenCount])}hasKeyword(t){return this.findKeyword(t)!==void 0}sweepArg(t,n){let o=this.arg(t)?.toLowerCase();return o==="oct"||o==="lin"||o==="dec"?o:n}paramsAfter(t){return this.readParamsFrom(1+t)}paramAfter(t,n){let o=n.toLowerCase();return this.paramsAfter(t).find(([r])=>r.toLowerCase()===o)?.[1]}paramsAfterExcept(t,n){let o=new Set(n.map((r)=>r.toLowerCase()));return this.paramsAfter(t).filter(([r])=>!o.has(r.toLowerCase()))}paramsAfterKeyword(t){let n=this.findKeyword(t);if(n===void 0)return;return this.readParamsFrom(n.tokenIndex+n.tokenCount)}argsBeforeKeyword(t,n=0){let r=this.findKeyword(t,n)?.tokenIndex??this.tokens.length;return this.tokens.slice(1+n,r).map((i)=>LQ(i)??i.raw)}restJoined(t){return this.argsAfter(t).join(" ")}findKeyword(t,n=0){let o=t.endsWith(":"),r=o?t.slice(0,-1):t;for(let i=1+n;i<this.tokens.length;i+=1){let s=this.tokens[i],a=LQ(s);if(a===void 0)continue;if(a.toLowerCase()!==r.toLowerCase())continue;if(o){let c=this.tokens[i+1];if(c?.type!=="punctuation"||c.value!==":")continue;return{argIndex:i-1,tokenIndex:i,tokenCount:2}}return{argIndex:i-1,tokenIndex:i,tokenCount:1}}return}readParamsFrom(t){let n=[],o=t;while(o<this.tokens.length){let r=this.tokens[o];if(r===void 0)break;if(sun(r)){o+=1;continue}let i=this.tokens[o+1],s=this.tokens[o+2];if(i?.type==="operator"&&i.value==="="&&s!==void 0&&!sun(s)){let a=LQ(r),c=LQ(s);if(a!==void 0&&c!==void 0)n.push([a,c]);o+=3;continue}o+=1}return n}},aun=class e{name;constructor(t){this.name=t}static ground(){return new e("0")}getString(){return this.name}},uun=class{raw;constructor(e){this.raw=e}getString(){return this.raw}},iIe=class{raw;constructor(e){this.raw=String(e)}getString(){return this.raw}};function pun(e){return e instanceof aun?e:new aun(e)}function au(e){if(e instanceof iIe)return e;if(e instanceof uun)return new iIe(e.getString());return new iIe(e)}function tEr(e){if(typeof e==="object"&&!(e instanceof iIe)&&!(e instanceof uun))return{magnitude:e.magnitude===void 0?void 0:au(e.magnitude),phase:e.phase===void 0?void 0:au(e.phase)};return{magnitude:au(e)}}var che=class e{values;constructor(t=[]){if(t instanceof e)this.values=t.entries();else if(Array.isArray(t))this.values=t.map(([n,o])=>[n,au(o)]);else this.values=Object.entries(t).map(([n,o])=>[n,au(o)])}get(t){return this.values.find(([n])=>n.toLowerCase()===t.toLowerCase())?.[1]}set(t,n){let o=this.values.findIndex(([i])=>i.toLowerCase()===t.toLowerCase()),r=[t,au(n)];if(o===-1)this.values.push(r);else this.values[o]=r}delete(t){let n=this.values.findIndex(([o])=>o.toLowerCase()===t.toLowerCase());if(n===-1)return!1;return this.values.splice(n,1),!0}entries(){return this.values.map(([t,n])=>[t,n])}getString(t){return this.values.map(([n,o])=>`${n}=${o.getString()}`).join(" ")}get isEmpty(){return this.values.length===0}};var set=class e extends Ww{static spiceTokenKeys=[".ac"];type="ac";command=".ac";sweep;points;start;stop;constructor(t){super(t);this.sweep=t.sweep,this.points=t.points,this.start=au(t.start),this.stop=au(t.stop)}static fromSpiceTokens(t){let n=Ha.from(t);return new e({sweep:n.sweepArg(0,"dec"),points:Number(n.arg(1)??0),start:n.arg(2)??"",stop:n.arg(3)??"",originalSource:n.originalSource})}getChildren(){return[]}toSource(t){if(t?.format!=="pretty"&&this.originalSource!==void 0)return this.originalSource;return`${this.command} ${this.sweep} ${this.points} ${this.start.getString()} ${this.stop.getString()}`}};Ww.register(set);var nEr=class e extends Uc{static spiceTokenKeys=[".control"];type="control";command=".control";lines;constructor(t){super(t);this.lines=t.lines}static fromSpiceTokens(t){let n=Ha.from(t);return new e({lines:t.childCards?.map((o)=>o.originalSource)??[],originalSource:n.originalSource})}getChildren(){return[]}toSource(t){if(t?.format!=="pretty"&&this.originalSource!==void 0)return this.originalSource;return[this.command,...this.lines,".endc"].join(`
`)}};Uc.register(nEr);var aet=class e extends Ww{static spiceTokenKeys=[".dc"];type="dc";command=".dc";sweeps;constructor(t){super(t);let n="sweeps"in t?t.sweeps:[t];this.sweeps=n.map((o)=>({source:o.source,start:au(o.start),stop:au(o.stop),step:au(o.step)}))}static fromSpiceTokens(t){let n=Ha.from(t);return new e({source:n.arg(0)??"",start:n.arg(1)??"",stop:n.arg(2)??"",step:n.arg(3)??"",originalSource:n.originalSource})}getChildren(){return[]}toSource(t){if(t?.format!=="pretty"&&this.originalSource!==void 0)return this.originalSource;return[this.command,...this.sweeps.flatMap((n)=>[n.source,n.start.getString(),n.stop.getString(),n.step.getString()])].join(" ")}};Ww.register(aet);var she=class e extends Uc{static spiceTokenKeys=[".end"];type="end";command=".end";static fromSpiceTokens(t){return new e({originalSource:Ha.from(t).originalSource})}getChildren(){return[]}toSource(t){if(t?.format!=="pretty"&&this.originalSource!==void 0)return this.originalSource;return this.command}};Uc.register(she);var oEr=class e extends Uc{static spiceTokenKeys=[".include"];type="include";command=".include";path;constructor(t,n={}){super(n);this.path=typeof t==="string"?t:t.path}static fromSpiceTokens(t){let n=Ha.from(t);return new e(n.restJoined(0),{originalSource:n.originalSource})}getChildren(){return[]}toSource(t){if(t?.format!=="pretty"&&this.originalSource!==void 0)return this.originalSource;return`${this.command} ${this.path}`}};Uc.register(oEr);var rEr=class e extends Uc{static spiceTokenKeys=[".lib"];type="lib";command=".lib";path;section;constructor(t={}){super(t);this.path=t.path,this.section=t.section}static fromSpiceTokens(t){let n=Ha.from(t);return new e({path:n.arg(0),section:n.arg(1),originalSource:n.originalSource})}getChildren(){return[]}toSource(t){if(t?.format!=="pretty"&&this.originalSource!==void 0)return this.originalSource;return[this.command,this.path,this.section].filter(Boolean).join(" ")}};Uc.register(rEr);var iEr=class e extends Uc{static spiceTokenKeys=[".measure"];type="measure";command=".measure";analysis;name;expression;constructor(t){super(t);this.analysis=t.analysis,this.name=t.name,this.expression=t.expression}static fromSpiceTokens(t){let n=Ha.from(t);return new e({analysis:n.arg(0),name:n.arg(1)??"",expression:n.restJoined(2),originalSource:n.originalSource})}getChildren(){return[]}toSource(t){if(t?.format!=="pretty"&&this.originalSource!==void 0)return this.originalSource;return[this.command,this.analysis,this.name,this.expression].filter(Boolean).join(" ")}};Uc.register(iEr);var mun=class e extends Uc{static spiceTokenKeys=[".model"];type="model";command=".model";name;modelType;params;constructor(t){super(t);this.name=t.name,this.modelType=t.type,this.params=new che(t.params)}static fromSpiceTokens(t){let n=Ha.from(t);return new e({name:n.arg(0)??"",type:n.arg(1)??"",params:n.paramsAfter(2),originalSource:n.originalSource})}getChildren(){return[]}toSource(t){if(t?.format!=="pretty"&&this.originalSource!==void 0)return this.originalSource;let n=this.params.getString(t);return[this.command,this.name,this.modelType,n&&`(${n})`].filter(Boolean).join(" ")}};Uc.register(mun);var cet=class e extends Ww{static spiceTokenKeys=[".op"];type="op";command=".op";static fromSpiceTokens(t){return new e({originalSource:Ha.from(t).originalSource})}getChildren(){return[]}toSource(t){if(t?.format!=="pretty"&&this.originalSource!==void 0)return this.originalSource;return this.command}};Ww.register(cet);var het=class e extends Uc{static spiceTokenKeys=[".options"];type="options";command=".options";values;constructor(t,n={}){super(n);this.values=new che(t)}static fromSpiceTokens(t){let n=Ha.from(t);return new e(n.paramsAfter(0),{originalSource:n.originalSource})}getChildren(){return[]}toSource(t){if(t?.format!=="pretty"&&this.originalSource!==void 0)return this.originalSource;return`${this.command} ${this.values.getString(t)}`.trimEnd()}};Uc.register(het);var sEr=class e extends Uc{static spiceTokenKeys=[".param"];type="param";command=".param";values;constructor(t,n={}){super(n);this.values=new che(t)}static fromSpiceTokens(t){let n=Ha.from(t);return new e(n.paramsAfter(0),{originalSource:n.originalSource})}getChildren(){return[]}toSource(t){if(t?.format!=="pretty"&&this.originalSource!==void 0)return this.originalSource;return`${this.command} ${this.values.getString(t)}`.trimEnd()}};Uc.register(sEr);function aEr(e){let t=e.trim().replace(/^\.print\s+/i,""),[n,...o]=t.split(/\s+/),r=o.join(" ");return{analysis:n,expressions:r.length===0?[]:r.split(",").map((i)=>i.trim())}}var det=class e extends Uc{static spiceTokenKeys=[".print"];type="print";command=".print";analysis;expressions;constructor(t={}){super(t);this.analysis=t.analysis,this.expressions=t.expressions??[]}static fromSpiceTokens(t){let n=Ha.from(t);return new e({...aEr(n.originalSource),originalSource:n.originalSource})}getChildren(){return[]}toSource(t){if(t?.format!=="pretty"&&this.originalSource!==void 0)return this.originalSource;return[this.command,this.analysis,this.expressions.length>0?this.expressions.join(", "):void 0].filter(Boolean).join(" ")}};Uc.register(det);var cEr=class e extends Uc{static spiceTokenKeys=[".probe"];type="probe";command=".probe";expressions;constructor(t=[],n={}){super(n);this.expressions=t}static fromSpiceTokens(t){let n=Ha.from(t);return new e(n.args(),{originalSource:n.originalSource})}getChildren(){return[]}toSource(t){if(t?.format!=="pretty"&&this.originalSource!==void 0)return this.originalSource;return[this.command,...this.expressions].join(" ")}};Uc.register(cEr);var lEr=class e extends Uc{static spiceTokenKeys=[".text"];type="pspice_text";command=".TEXT";args;constructor(t,n={}){super(n);this.args=t}static fromSpiceTokens(t){let n=Ha.from(t);return new e(n.args(),{originalSource:n.originalSource})}getChildren(){return[]}toSource(t){if(ahe(t,".TEXT"),t?.format!=="pretty"&&this.originalSource!==void 0)return this.originalSource;return[this.command,...this.args].join(" ")}};Uc.register(lEr);var hEr=class e extends Uc{static spiceTokenKeys=[".vector"];type="pspice_vector";command=".VECTOR";args;constructor(t,n={}){super(n);this.args=t}static fromSpiceTokens(t){let n=Ha.from(t);return new e(n.args(),{originalSource:n.originalSource})}getChildren(){return[]}toSource(t){if(ahe(t,".VECTOR"),t?.format!=="pretty"&&this.originalSource!==void 0)return this.originalSource;return[this.command,...this.args].join(" ")}};Uc.register(hEr);var dEr=class e extends Uc{static spiceTokenKeys=[".watch"];type="pspice_watch";command=".WATCH";args;constructor(t,n={}){super(n);this.args=t}static fromSpiceTokens(t){let n=Ha.from(t);return new e(n.args(),{originalSource:n.originalSource})}getChildren(){return[]}toSource(t){if(ahe(t,".WATCH"),t?.format!=="pretty"&&this.originalSource!==void 0)return this.originalSource;return[this.command,...this.args].join(" ")}};Uc.register(dEr);var uet=class e extends Uc{static spiceTokenKeys=[".save"];type="save";command=".save";expressions;constructor(t,n={}){super(n);this.expressions=t}static fromSpiceTokens(t){let n=Ha.from(t);return new e(n.args(),{originalSource:n.originalSource})}getChildren(){return[]}toSource(t){if(t?.format!=="pretty"&&this.originalSource!==void 0)return this.originalSource;return[this.command,...this.expressions].join(" ")}};Uc.register(uet);var _un=class e extends Uc{static spiceTokenKeys=[".subckt"];type="subckt";command=".subckt";name;pins;params;cards;endsName;constructor(t){super(t);this.name=t.name,this.pins=(t.pins??[]).map(pun),this.params=new che(t.params),this.cards=t.cards??[],this.endsName=t.endsName}static fromSpiceTokens(t){let n=Ha.from(t),o=t.endCard===void 0?void 0:Ha.from(t.endCard);return new e({name:n.arg(0)??"",pins:n.argsBeforeKeyword("params:",1),params:n.paramsAfterKeyword("params:"),cards:t.childCards?.map((r)=>Uw.parseSpiceTokens(r)),endsName:o?.arg(0),originalSource:n.originalSource})}add(t){this.cards.push(t)}getChildren(){return this.cards}toSource(t){if(t?.format!=="pretty"&&this.originalSource!==void 0)return this.originalSource;let n=this.params.getString(t);return[[this.command,this.name,...this.pins.map((o)=>o.getString()),n?"params:":void 0,n||void 0].filter((o)=>o!==void 0).join(" "),...this.cards.map((o)=>o.toSource(t)),[".ends",this.endsName??this.name].join(" ")].join(`
`)}};Uc.register(_un);var uEr=class e extends Uc{static spiceTokenKeys=[".temp"];type="temp";command=".temp";values;constructor(t,n={}){super(n);this.values=t.map(au)}static fromSpiceTokens(t){let n=Ha.from(t);return new e(n.args(),{originalSource:n.originalSource})}getChildren(){return[]}toSource(t){if(t?.format!=="pretty"&&this.originalSource!==void 0)return this.originalSource;return[this.command,...this.values.map((n)=>n.getString())].join(" ")}};Uc.register(uEr);var pet=class e extends Ww{static spiceTokenKeys=[".tran"];type="tran";command=".tran";step;stop;start;maxStep;uic;pspiceOp;constructor(t){super(t);this.step=t.step===void 0?void 0:au(t.step),this.stop=au(t.stop),this.start=t.start===void 0?void 0:au(t.start),this.maxStep=t.maxStep===void 0?void 0:au(t.maxStep),this.uic=t.uic,this.pspiceOp=t.pspiceOp??!1}static fromSpiceTokens(t){let n=Ha.from(t);return new e({step:n.arg(0),stop:n.arg(1)??"",start:n.arg(2),maxStep:n.arg(3),uic:n.hasKeyword("uic"),pspiceOp:n.originalSource.trimStart().toLowerCase().startsWith(".tran/op"),originalSource:n.originalSource})}getChildren(){return[]}toSource(t){if(this.pspiceOp)ahe(t,".TRAN/OP");if(t?.format!=="pretty"&&this.originalSource!==void 0)return this.originalSource;return[this.command,this.step?.getString(),this.stop.getString(),this.start?.getString(),this.maxStep?.getString(),this.uic?"UIC":void 0].filter(Boolean).join(" ")}};Ww.register(pet);var pEr=class e extends Uc{static spiceTokenKeys=["__default__"];type="unknown_dot_command";command;args;constructor(t){super(t);this.command=t.command,this.args=t.args}static fromSpiceTokens(t){let n=Ha.from(t);return new e({command:n.headRaw(),args:n.args(),originalSource:n.originalSource})}getChildren(){return[]}toSource(t){if(t?.format!=="pretty"&&this.originalSource!==void 0)return this.originalSource;return[this.command,...this.args].join(" ")}};Uc.register(pEr);var rd=class extends Uw{cardKind="element";name;nodes;params;constructor(e){super(e);this.name=e.name,this.nodes=(e.nodes??[]).map(pun),this.params=new che(e.params)}renameNode(e,t){for(let n of this.nodes)if(n.name===e)n.name=t}getChildren(){return[]}formatParts(e,t){if(t?.format!=="pretty"&&this.originalSource!==void 0)return this.originalSource;let n=this.params.getString(t);return[...e,n||void 0].filter((o)=>o!==void 0&&o.length>0).join(" ")}},mEr=class e extends rd{static spiceTokenKeys=["Q"];type="bjt";model;constructor(t){super({...t,nodes:t.nodes.filter((n)=>n!==void 0)});this.model=t.model}static fromSpiceTokens(t){let n=Ha.from(t),o=n.args().length>4,r=o?[n.arg(0)??"",n.arg(1)??"",n.arg(2)??"",n.arg(3)??""]:[n.arg(0)??"",n.arg(1)??"",n.arg(2)??""],i=o?4:3;return new e({name:n.head(),nodes:r,model:n.arg(i)??"",params:n.paramsAfter(i+1),originalSource:n.originalSource})}toSource(t){return this.formatParts([this.name,...this.nodes.map((n)=>n.getString()),this.model],t)}};rd.register(mEr);var _Er=class e extends rd{static spiceTokenKeys=["C"];type="capacitor";capacitance;initialCondition;constructor(t){super(t);this.capacitance=au(t.capacitance),this.initialCondition=t.ic===void 0?void 0:au(t.ic)}static fromSpiceTokens(t){let n=Ha.from(t);return new e({name:n.head(),nodes:[n.arg(0)??"",n.arg(1)??""],capacitance:n.arg(2)??"",ic:n.paramAfter(3,"ic"),params:n.paramsAfterExcept(3,["ic"]),originalSource:n.originalSource})}toSource(t){return this.formatParts([this.name,...this.nodes.map((n)=>n.getString()),this.capacitance.getString(),this.initialCondition===void 0?void 0:`IC=${this.initialCondition.getString()}`],t)}};rd.register(_Er);var gEr=class e extends rd{static spiceTokenKeys=["F"];type="cccs";source;gain;constructor(t){super({...t,nodes:t.output});this.source=t.source,this.gain=au(t.gain)}static fromSpiceTokens(t){let n=Ha.from(t);return new e({name:n.head(),output:[n.arg(0)??"",n.arg(1)??""],source:n.arg(2)??"",gain:n.arg(3)??"",originalSource:n.originalSource})}toSource(t){return this.formatParts([this.name,...this.nodes.map((n)=>n.getString()),this.source,this.gain.getString()],t)}};rd.register(gEr);var AEr=class e extends rd{static spiceTokenKeys=["H"];type="ccvs";source;transresistance;constructor(t){super({...t,nodes:t.output});this.source=t.source,this.transresistance=au(t.transresistance)}static fromSpiceTokens(t){let n=Ha.from(t);return new e({name:n.head(),output:[n.arg(0)??"",n.arg(1)??""],source:n.arg(2)??"",transresistance:n.arg(3)??"",originalSource:n.originalSource})}toSource(t){return this.formatParts([this.name,...this.nodes.map((n)=>n.getString()),this.source,this.transresistance.getString()],t)}};rd.register(AEr);function gun(e){let t={},n=e.argAfterKeyword("dc"),o=e.keywordIndex("ac");if(n!==void 0)t.dc=n;else if(o===-1)t.dc=e.arg(2);if(o!==-1)t.ac={magnitude:e.arg(o+1),phase:e.arg(o+2)};return t}var sIe=class extends rd{dc;ac;transient;constructor(e){super(e);this.dc=e.dc===void 0?void 0:au(e.dc),this.ac=e.ac===void 0?void 0:tEr(e.ac),this.transient=e.transient}getChildren(){return this.transient===void 0?[]:[this.transient]}sourceParts(){let e=[this.name,...this.nodes.map((t)=>t.getString())];if(this.dc!==void 0)e.push("DC",this.dc.getString());if(this.ac!==void 0){if(e.push("AC"),this.ac.magnitude!==void 0)e.push(this.ac.magnitude.getString());if(this.ac.phase!==void 0)e.push(this.ac.phase.getString())}if(this.transient!==void 0)e.push(this.transient.toSource());return e}},fEr=class e extends sIe{static spiceTokenKeys=["I"];type="current_source";static fromSpiceTokens(t){let n=Ha.from(t),o=gun(n);return new e({name:n.head(),nodes:[n.arg(0)??"",n.arg(1)??""],dc:o.dc,ac:o.ac,originalSource:n.originalSource})}toSource(t){return this.formatParts(this.sourceParts(),t)}};sIe.register(fEr);var yEr=class e extends rd{static spiceTokenKeys=["D"];type="diode";model;constructor(t){super(t);this.model=t.model}static fromSpiceTokens(t){let n=Ha.from(t);return new e({name:n.head(),nodes:[n.arg(0)??"",n.arg(1)??""],model:n.arg(2)??"",params:n.paramsAfter(3),originalSource:n.originalSource})}toSource(t){return this.formatParts([this.name,...this.nodes.map((n)=>n.getString()),this.model],t)}};rd.register(yEr);var xEr=class e extends rd{static spiceTokenKeys=["L"];type="inductor";inductance;initialCondition;constructor(t){super(t);this.inductance=au(t.inductance),this.initialCondition=t.ic===void 0?void 0:au(t.ic)}static fromSpiceTokens(t){let n=Ha.from(t);return new e({name:n.head(),nodes:[n.arg(0)??"",n.arg(1)??""],inductance:n.arg(2)??"",ic:n.paramAfter(3,"ic"),params:n.paramsAfterExcept(3,["ic"]),originalSource:n.originalSource})}toSource(t){return this.formatParts([this.name,...this.nodes.map((n)=>n.getString()),this.inductance.getString(),this.initialCondition===void 0?void 0:`IC=${this.initialCondition.getString()}`],t)}};rd.register(xEr);var CEr=class e extends rd{static spiceTokenKeys=["M"];type="mosfet";model;constructor(t){super(t);this.model=t.model}static fromSpiceTokens(t){let n=Ha.from(t);return new e({name:n.head(),nodes:[n.arg(0)??"",n.arg(1)??"",n.arg(2)??"",n.arg(3)??""],model:n.arg(4)??"",params:n.paramsAfter(5),originalSource:n.originalSource})}toSource(t){return this.formatParts([this.name,...this.nodes.map((n)=>n.getString()),this.model],t)}};rd.register(CEr);var bEr=new Set(["VALUE","TABLE","LAPLACE","FREQ","CHEBYSHEV"]);function Aun(e){return e!==void 0&&bEr.has(e.toUpperCase())}function fun(e,t,n){let o=e?.dialect??"generic";if(o==="pspice"||o==="ngspice"&&(t==="VALUE"||t==="TABLE"))return;ahe(e,n)}var IEr=class e extends rd{type="pspice_abm_voltage_source";form;args;constructor(t){super({...t,nodes:t.output});this.form=t.form,this.args=t.args}static fromTokenCard(t){return new e({name:t.head(),output:[t.arg(0)??"",t.arg(1)??""],form:t.arg(2)?.toUpperCase(),args:t.argsAfter(3),originalSource:t.originalSource})}toSource(t){return fun(t,this.form,`${this.form} behavioral voltage source`),this.formatParts([this.name,...this.nodes.map((n)=>n.getString()),this.form,...this.args],t)}},vEr=class e extends rd{type="pspice_abm_current_source";form;args;constructor(t){super({...t,nodes:t.output});this.form=t.form,this.args=t.args}static fromTokenCard(t){return new e({name:t.head(),output:[t.arg(0)??"",t.arg(1)??""],form:t.arg(2)?.toUpperCase(),args:t.argsAfter(3),originalSource:t.originalSource})}toSource(t){return fun(t,this.form,`${this.form} behavioral current source`),this.formatParts([this.name,...this.nodes.map((n)=>n.getString()),this.form,...this.args],t)}};function SEr(e){return IEr.fromTokenCard(Ha.from(e))}function PEr(e){return vEr.fromTokenCard(Ha.from(e))}var EEr=class e extends rd{static spiceTokenKeys=["R"];type="resistor";resistance;constructor(t){super({...t,nodes:t.nodes.filter((n)=>n!==void 0)});this.resistance=au(t.resistance)}static fromSpiceTokens(t){let n=Ha.from(t);return new e({name:n.head(),nodes:[n.arg(0)??"",n.arg(1)??""],resistance:n.arg(2)??"",params:n.paramsAfter(3),originalSource:n.originalSource})}toSource(t){return this.formatParts([this.name,...this.nodes.map((n)=>n.getString()),this.resistance.getString()],t)}};rd.register(EEr);var MEr=class e extends rd{static spiceTokenKeys=["X"];type="subckt_instance";subckt;constructor(t){super(t);this.subckt=t.subckt}static fromSpiceTokens(t){let n=Ha.from(t);return new e({name:n.head(),nodes:n.argsUntilLast(),subckt:n.lastArg()??"",originalSource:n.originalSource})}toSource(t){return this.formatParts([this.name,...this.nodes.map((n)=>n.getString()),this.subckt],t)}};rd.register(MEr);var wEr=class e extends rd{static spiceTokenKeys=["__unknown_element__"];type="unknown_element";designator;tokens;constructor(t){super(t);this.designator=t.designator,this.tokens=t.tokens}static fromSpiceTokens(t){let n=Ha.from(t),o=n.head();return new e({name:o,designator:n.headDesignator(),tokens:n.args(),originalSource:n.originalSource})}toSource(t){return this.formatParts([this.name,...this.tokens],t)}};rd.register(wEr);var BEr=class e extends rd{static spiceTokenKeys=["G"];type="vccs";transconductance;constructor(t){super({...t,nodes:[...t.output,...t.control]});this.transconductance=au(t.transconductance)}static fromSpiceTokens(t){let n=Ha.from(t);if(Aun(n.arg(2)))return PEr(t);return new e({name:n.head(),output:[n.arg(0)??"",n.arg(1)??""],control:[n.arg(2)??"",n.arg(3)??""],transconductance:n.arg(4)??"",originalSource:n.originalSource})}toSource(t){return this.formatParts([this.name,...this.nodes.map((n)=>n.getString()),this.transconductance.getString()],t)}};rd.register(BEr);var TEr=class e extends rd{static spiceTokenKeys=["E"];type="vcvs";gain;constructor(t){super({...t,nodes:[...t.output,...t.control]});this.gain=au(t.gain)}static fromSpiceTokens(t){let n=Ha.from(t);if(Aun(n.arg(2)))return SEr(t);return new e({name:n.head(),output:[n.arg(0)??"",n.arg(1)??""],control:[n.arg(2)??"",n.arg(3)??""],gain:n.arg(4)??"",originalSource:n.originalSource})}toSource(t){return this.formatParts([this.name,...this.nodes.map((n)=>n.getString()),this.gain.getString()],t)}};rd.register(TEr);var DEr=class e extends sIe{static spiceTokenKeys=["V"];type="voltage_source";static fromSpiceTokens(t){let n=Ha.from(t),o=gun(n);return new e({name:n.head(),nodes:[n.arg(0)??"",n.arg(1)??""],dc:o.dc,ac:o.ac,originalSource:n.originalSource})}toSource(t){return this.formatParts(this.sourceParts(),t)}};sIe.register(DEr);var NEr=class extends ret{type="netlist";title;cards;end;dialect;trailingNewline;lineEnding;constructor(e={}){super();this.title=e.title,this.cards=e.cards??[],this.end=e.end instanceof she?e.end:e.end===!1?void 0:new she,this.dialect=e.dialect??"generic",this.trailingNewline=e.trailingNewline??!0,this.lineEnding=e.lineEnding??`
`}get elements(){return this.cards.filter((e)=>e.cardKind==="element")}get directives(){return this.cards.filter((e)=>e.cardKind==="directive")}get subckts(){return this.cards.filter((e)=>e instanceof _un)}get models(){return this.cards.filter((e)=>e instanceof mun)}get analyses(){return this.cards.filter((e)=>e instanceof Ww)}add(e){this.cards.push(e)}addAll(e){this.cards.push(...e)}findElement(e){return this.elements.find((t)=>t.name.toLowerCase()===e.toLowerCase())}findModel(e){return this.models.find((t)=>t.name.toLowerCase()===e.toLowerCase())}findSubckt(e){return this.subckts.find((t)=>t.name.toLowerCase()===e.toLowerCase())}renameNode(e,t){for(let n of this.elements)n.renameNode(e,t);for(let n of this.subckts)for(let o of n.cards)if(o instanceof rd)o.renameNode(e,t)}getChildren(){return[...this.cards,...this.end===void 0?[]:[this.end]]}getString(e={}){return this.toSource(e)}toSource(e={}){let t=e.end??"auto",o=[this.title,...this.cards.map((r)=>r.toSource(e)),t==="never"?void 0:t==="always"?(this.end??new she).toSource(e):this.end?.toSource(e)].filter((r)=>r!==void 0).join(this.lineEnding);return this.trailingNewline?`${o}${this.lineEnding}`:o}},REr=class e extends hun{static spiceTokenKeys=["blank"];type="blank";cardKind="blank";originalSource;constructor(t={}){super();this.originalSource=t.originalSource}static fromSpiceTokens(t){return new e({originalSource:Ha.from(t).originalSource})}getChildren(){return[]}toSource(){return this.originalSource??""}};Uw.register(REr);var QEr=class e extends hun{static spiceTokenKeys=["comment"];type="comment";cardKind="comment";text;marker;originalSource;constructor(t,n={}){super();this.text=t,this.marker=n.marker??"*",this.originalSource=n.originalSource}static fromSpiceTokens(t){let n=Ha.from(t),[o]=n.tokens;if(o?.type==="comment")return new e(o.value,{marker:o.marker,originalSource:n.originalSource});return new e(n.originalSource,{originalSource:n.originalSource})}getChildren(){return[]}toSource(t){if(t?.format!=="pretty"&&this.originalSource!==void 0)return this.originalSource;return`${this.marker} ${this.text}`.trimEnd()}};Uw.register(QEr);var kEr=class e extends Uw{static spiceTokenKeys=["raw","error","number","operator","punctuation"];type="raw_card";cardKind="raw";source;constructor(t){super({originalSource:t});this.source=t}static fromSpiceTokens(t){return new e(Ha.from(t).originalSource)}getChildren(){return[]}toSource(){return this.source}};Uw.register(kEr);var LEr=/^[+-]?(?:(?:\d+(?:\.\d*)?)|(?:\.\d+))(?:[eE][+-]?\d+)?([a-zA-Z]+)?$/,cun=new Set(["=","+","-","*","/","^"]),lun=new Set(["(",")",",",":"]),HEr={f:0.000000000000001,p:0.000000000001,n:0.000000001,u:0.000001,m:0.001,k:1000,meg:1e6,g:1e9,t:1000000000000};function FEr(e,t={}){let n=t.preserveWhitespace??!1,o=t.preserveComments??!0,r=t.normalizeNumbers??!0,i=[],s=[],a=0,c=1,l=1,h=!0,d=()=>({offset:a,line:c,column:l}),u=(x)=>({start:x,end:d()}),_=(x)=>{for(let C=0;C<x.length;C+=1){let b=x[C];if(a+=1,b===`
`)c+=1,l=1,h=!0;else l+=1}},p=(x)=>{if(x.type==="whitespace"&&!n)return;if(x.type==="comment"&&!o)return;i.push(x)},m=(x)=>x!==void 0&&x>="0"&&x<="9",A=(x)=>{let C=e[x],b=e[x+1];if(m(C))return!0;if(C==="."&&m(b))return!0;if((C==="+"||C==="-")&&!g())return!1;if((C==="+"||C==="-")&&m(b))return!0;return(C==="+"||C==="-")&&b==="."&&m(e[x+2])},g=()=>{let x=i.at(-1);return x===void 0||x.type==="whitespace"||x.type==="newline"||x.type==="continuation"||x.type==="operator"||x.type==="punctuation"},f=()=>{let x="";if(e[a]==="+"||e[a]==="-")x+=e[a],_(e[a]);while(m(e[a]))x+=e[a],_(e[a]);if(e[a]==="."){x+=e[a],_(e[a]);while(m(e[a]))x+=e[a],_(e[a])}if(e[a]==="e"||e[a]==="E"){if(x+=e[a],_(e[a]),e[a]==="+"||e[a]==="-")x+=e[a],_(e[a]);while(m(e[a]))x+=e[a],_(e[a])}while(e[a]!==void 0&&e[a]>="a"&&e[a]<="z"||e[a]!==void 0&&e[a]>="A"&&e[a]<="Z")x+=e[a],_(e[a]);return x},y=(x,C)=>{let b=x.match(LEr);if(!b)return!1;let I=b[1],v=I?.toLowerCase(),P=I===void 0?x:x.slice(0,-I.length),M=Number(P),B=r&&!Number.isNaN(M)?M*(v===void 0?1:HEr[v]??1):null;return p({type:"number",raw:x,value:B,unitSuffix:I,range:C}),!0};while(a<e.length){let x=d(),C=e[a],b=e[a+1];if(C==="\r"||C===`
`){let P=C==="\r"&&b===`
`?`\r
`:C;_(P),p({type:"newline",raw:P,range:u(x)});continue}if(C===" "||C==="\t"){let P="";while(e[a]===" "||e[a]==="\t")P+=e[a],_(e[a]);p({type:"whitespace",raw:P,range:u(x)});continue}if(h&&C==="+"){_(C),h=!1,p({type:"continuation",raw:C,range:u(x)});continue}if(h&&C==="*"||C===";"||C==="$"){let P=C,M="";while(a<e.length&&e[a]!==`
`&&e[a]!=="\r")M+=e[a],_(e[a]);h=!1,p({type:"comment",marker:P,raw:M,value:M.slice(1).trimStart(),range:u(x)});continue}if(C==="#"){let P="";while(a<e.length&&e[a]!==`
`&&e[a]!=="\r")P+=e[a],_(e[a]);let M=u(x),B={message:"Unsupported preprocessor-style line",raw:P,range:M};s.push(B),h=!1,p({type:"error",raw:P,message:B.message,range:M});continue}if(C==='"'||C==="'"){let P=C,M="",B="";_(C),M+=C;while(a<e.length&&e[a]!==P){if(e[a]===`
`||e[a]==="\r")break;B+=e[a],M+=e[a],_(e[a])}if(e[a]===P)M+=P,_(P),p({type:"string",quote:P,raw:M,value:B,range:u(x)});else{let T=u(x),N={message:"Unterminated string",raw:M,range:T};s.push(N),p({type:"error",raw:M,message:N.message,range:T})}h=!1;continue}if(A(a)){let P=f();if(h=!1,y(P,u(x)))continue}if(cun.has(C)){_(C),h=!1,p({type:"operator",raw:C,value:C,range:u(x)});continue}if(lun.has(C)){_(C),h=!1,p({type:"punctuation",raw:C,value:C,range:u(x)});continue}let I="";while(a<e.length&&![" ","\t","\r",`
`,'"',"'",";","$"].includes(e[a])&&!cun.has(e[a])&&!lun.has(e[a]))I+=e[a],_(e[a]);if(I.length===0){_(C);let P=u(x),M={message:`Unexpected character "${C}"`,raw:C,range:P};s.push(M),p({type:"error",raw:C,message:M.message,range:P});continue}h=!1;let v=u(x);if(I.startsWith(".")){p({type:"directive",raw:I,value:I.slice(1).toLowerCase(),range:v});continue}if(y(I,v))continue;p({type:"identifier",raw:I,value:I,range:v})}return{tokens:i,errors:s,source:{text:e,lineCount:c}}}function yun(e,t={}){let n=YEr(e),o=OEr(e),r=o[0],i=r!==void 0&&VEr(r)?r.originalSource:void 0,s=i===void 0?o:o.slice(1),a=zEr(s,t),c=a.findIndex((h)=>h instanceof she),l=c===-1?void 0:a.splice(c,1)[0];return new NEr({title:i,cards:a,end:l??!1,dialect:t.dialect,trailingNewline:n.trailingNewline,lineEnding:n.lineEnding})}function zEr(e,t){return e.map((n)=>Uw.parseSpiceTokens(n))}function OEr(e){let t=FEr(e,{preserveWhitespace:!0,preserveComments:!0,normalizeNumbers:!0});return eEr(ZPr(t.tokens))}function VEr(e){let t=iet(e.tokens),[n]=t;if(n===void 0)return!1;if(n.type==="directive"||n.type==="comment")return!1;if(n.type!=="identifier")return!1;if(t.length===1)return!0;return Uw.classes[n.raw[0]?.toLowerCase()??""]===void 0}function YEr(e){let t=e.includes(`\r
`)?`\r
`:e.includes("\r")?"\r":`
`;return{trailingNewline:t===`\r
`?e.endsWith(`\r
`):e.endsWith(t),lineEnding:t}}var GEr=(e)=>{let t=[];if(t.push(e.title),e.models.size>0)t.push(...Array.from(e.models.values()));for(let n of e.components)t.push(n.toSpiceString());if(e.optionStatements.length>0)t.push(...e.optionStatements);if(e.metadataComments.length>0)t.push(...e.metadataComments);for(let n of e.subcircuits)t.push(n.toSpiceString());if(e.printStatements.length>0)t.push(...e.printStatements);if(e.saveStatements.length>0)t.push(...e.saveStatements);if(e.controls.length>0)t.push(".control"),t.push(...e.controls),t.push(".endc");if(e.analysisCommand){let n=e.analysisCommand.trim().toLowerCase().split(/\s+/)[0];if(!t.some((r)=>r.trim().toLowerCase().split(/\s+/)[0]===n))t.push(e.analysisCommand)}return t.push(".END"),t.join(`
`)},UEr=class{title;components;nodes;controls;subcircuits;models;optionStatements;metadataComments;analysisCommand;printStatements;saveStatements;constructor(e="Circuit Netlist"){this.title=e,this.components=[],this.nodes=new Set,this.controls=[],this.subcircuits=[],this.models=new Map,this.optionStatements=[],this.metadataComments=[],this.analysisCommand=null,this.printStatements=[],this.saveStatements=[]}addComponent(e){this.components.push(e);for(let t of e.nodes)this.nodes.add(t)}addSubcircuit(e){if(this.subcircuits.find((t)=>t.name===e.name))return;this.subcircuits.push(e)}get tranCommand(){return this.analysisCommand?.trim().toLowerCase().startsWith(".tran")?this.analysisCommand:null}set tranCommand(e){this.analysisCommand=e}toSpiceString(){return GEr(this)}},_y=class{name;command;nodes;constructor(e,t,n){this.name=e,this.command=t,this.nodes=n}toSpiceString(){return this.command.toSpiceString()}},WEr=class{commandName="bjt";props;constructor(e){this.props=e}toSpiceString(){let{name:e,collector:t,base:n,emitter:o,substrate:r,model:i,area:s}=this.props,a=`Q${e} ${t} ${n} ${o}`;if(r)a+=` ${r}`;if(a+=` ${i}`,s)a+=` ${s}`;return a}},XEr=class{commandName="capacitor";props;constructor(e){this.props=e}toSpiceString(){let{name:e,positiveNode:t,negativeNode:n,modelName:o,value:r,initialCondition:i}=this.props,s=`C${e} ${t} ${n}`;if(o)s+=` ${o}`;if(s+=` ${r}`,i)s+=` IC=${i}`;return s}},xun=class{commandName="current_source";props;constructor(e){this.props=e}toSpiceString(){let{name:e,positiveNode:t,negativeNode:n,value:o,acMagnitude:r,acPhase:i}=this.props,s=`I${e} ${t} ${n}`;if(o)s+=` ${o}`;if(r){if(s+=` AC ${r}`,i)s+=` ${i}`}return s}},jEr=class{commandName="diode";props;constructor(e){this.props=e}toSpiceString(){let{name:e,positiveNode:t,negativeNode:n,model:o,area:r}=this.props,i=`D${e} ${t} ${n} ${o}`;if(r)i+=` ${r}`;return i}},KEr=class{commandName="inductor";props;constructor(e){this.props=e}toSpiceString(){let{name:e,positiveNode:t,negativeNode:n,model:o,value:r,initialCondition:i}=this.props,s=`L${e} ${t} ${n}`;if(o)s+=` ${o}`;if(s+=` ${r}`,i)s+=` IC=${i}`;return s}};var $Er=class{commandName="mosfet";props;constructor(e){this.props=e}toSpiceString(){let{name:e,drain:t,gate:n,source:o,substrate:r,model:i,length:s,width:a,drainArea:c,sourceArea:l,drainPerimeter:h,sourcePerimeter:d,drainResistance:u,sourceResistance:_}=this.props,p=`M${e} ${t} ${n} ${o} ${r} ${i}`;return Object.entries({L:s,W:a,AD:c,AS:l,PD:h,PS:d,NRD:u,NRS:_}).forEach(([A,g])=>{if(g)p+=` ${A}=${g}`}),p}},qEr=class{commandName="resistor";props;constructor(e){this.props=e}toSpiceString(){let{name:e,positiveNode:t,negativeNode:n,model:o,value:r}=this.props,i=`R${e} ${t} ${n}`;if(o)i+=` ${o}`;return i+=` ${r}`,i}},Cun=class{commandName="subcircuit_call";props;constructor(e){this.props=e}toSpiceString(){let{name:e,nodes:t,subcircuitName:n}=this.props;return`X${e} ${t.join(" ")} ${n}`}};var JEr=class{commandName="voltage_controlled_switch";props;constructor(e){this.props=e}toSpiceString(){let{name:e,positiveNode:t,negativeNode:n,positiveControl:o,negativeControl:r,model:i}=this.props;return`S${e} ${t} ${n} ${o} ${r} ${i}`}},cIe=class{commandName="voltage_source";props;constructor(e){this.props=e}toSpiceString(){let{name:e,positiveNode:t,negativeNode:n,value:o,acMagnitude:r,acPhase:i}=this.props,s=`V${e} ${t} ${n}`;if(o)s+=` ${o}`;if(r){if(s+=` AC ${r}`,i)s+=` ${i}`}return s}};function ZEr(e){if(e>=1e6)return`${e/1e6}MEG`;if(e>=1000)return`${e/1000}K`;return e.toString()}function eMr(e){if(e>=0.001)return`${e*1000}M`;if(e>=0.000001)return`${e*1e6}U`;if(e>=0.000000001)return`${e*1e9}N`;if(e>=0.000000000001)return`${e*1000000000000}P`;return e.toString()}function tMr(e){if(e>=1)return e.toString();if(e>=0.001)return`${e*1000}m`;if(e>=0.000001)return`${e*1e6}u`;if(e>=0.000000001)return`${e*1e9}n`;if(e>=0.000000000001)return`${e*1000000000000}p`;return e.toString()}function bun(e,t){if(!e)return t;let n=e.replace(/[^A-Za-z0-9_]/g,"_");if(!n)return t;if(/^[0-9]/.test(n))return`${t}_${n}`;return n}function nMr(e){if(!e)return"DC 0";let i=e.starts_closed??!1,s=e.closes_at??0,{opens_at:a,switching_frequency:c}=e,[l,h]=i?[5,0]:[0,5];if(c&&c>0){let d=1/c,u=a&&a>s?Math.min(a-s,d):0,_=u>0?u:Math.max(d/2,0.000000001);return`PULSE(${Ql(l)} ${Ql(h)} ${Ql(s)} 1n 1n ${Ql(_)} ${Ql(d)})`}if(a!==void 0&&a>s){let d=Math.max(a-s,0.000000001),u=s+d*2;return`PULSE(${Ql(l)} ${Ql(h)} ${Ql(s)} 1n 1n ${Ql(d)} ${Ql(u)})`}if(s>0){let d=s*2,u=Math.max(d/2,0.000000001);return`PULSE(${Ql(l)} ${Ql(h)} ${Ql(s)} 1n 1n ${Ql(u)} ${Ql(d)})`}return`DC ${i?5:0}`}function Ql(e){if(!Number.isFinite(e))return`${e}`;if(e===0)return"0";let t=Math.abs(e);if(t>=1000||t<=0.001)return Number(e.toExponential(6)).toString();return Number(e.toPrecision(6)).toString()}function Jq(e){if(!Number.isFinite(e))return`${e}`;if(e===0)return"0";let t=[["T",1000000000000],["G",1e9],["MEG",1e6],["k",1000],["m",0.001],["u",0.000001],["n",0.000000001],["p",0.000000000001]];for(let[n,o]of t){let r=e/o;if(Math.abs(r)>=0.999999&&Math.abs(r)<999.999999){let i=Number(r.toPrecision(6));if(Math.abs(i*o-e)<=Math.abs(e)*0.000000001)return`${i}${n}`}}return Ql(e)}var oMr=0.000000000001,rMr=({component:e,nodes:t})=>{if("resistance"in e&&"name"in e){let n=e.resistance,o=new qEr({name:e.name,positiveNode:t[0]||"0",negativeNode:t[1]||"0",value:ZEr(n===0?oMr:n)});return new _y(e.name,o,t)}return null},iMr=({netlist:e,component:t,nodes:n,simulationSwitchMap:o})=>{let r=bun(t.name??t.source_component_id,"SW"),i=n[0]||"0",s=n[1]||"0",a=`NCTRL_${r}`,c=`SW_${r}`,l=o.get(t.source_component_id),h=nMr(l),d=new JEr({name:r,positiveNode:i,negativeNode:s,positiveControl:a,negativeControl:"0",model:c});if(!e.models.has(c))e.models.set(c,`.MODEL ${c} SW(Ron=0.1 Roff=1e9 Vt=2.5 Vh=0.1)`);let u=`CTRL_${r}`,_=new cIe({name:u,positiveNode:a,negativeNode:"0",value:h}),p=new _y(u,_,[a,"0"]);return e.addComponent(p),new _y(r,d,[i,s,a,"0"])},sMr=({component:e,nodes:t})=>{if("capacitance"in e&&"name"in e){let n=new XEr({name:e.name,positiveNode:t[0]||"0",negativeNode:t[1]||"0",value:eMr(e.capacitance)});return new _y(e.name,n,t)}return null},aMr=(e,t)=>{let n=e.find((r)=>r.name?.toLowerCase()==="anode"||r.port_hints?.includes("anode")),o=e.find((r)=>r.name?.toLowerCase()==="cathode"||r.port_hints?.includes("cathode"));return{positiveNode:t.get(n?.source_port_id??"")||"0",negativeNode:t.get(o?.source_port_id??"")||"0"}},Iun=({netlist:e,component:t,componentPorts:n,nodeMap:o,modelName:r,modelDefinition:i})=>{if("name"in t){let{positiveNode:s,negativeNode:a}=aMr(n,o),c=new jEr({name:t.name,positiveNode:s,negativeNode:a,model:r});return e.models.set(r,i),new _y(t.name,c,[s,a])}return null},cMr=({netlist:e,component:t,componentPorts:n,nodeMap:o})=>Iun({netlist:e,component:t,componentPorts:n,nodeMap:o,modelName:"D",modelDefinition:".MODEL D D"}),lMr=({netlist:e,component:t,componentPorts:n,nodeMap:o})=>Iun({netlist:e,component:t,componentPorts:n,nodeMap:o,modelName:"LED",modelDefinition:".MODEL LED D(IS=1e-20 N=2 RS=10 CJO=2p EG=2.1 BV=5 IBV=10u)"}),hMr=({component:e,nodes:t})=>{if("inductance"in e&&"name"in e){let n=new KEr({name:e.name,positiveNode:t[0]||"0",negativeNode:t[1]||"0",value:tMr(e.inductance)});return new _y(e.name,n,t)}return null},dMr=({netlist:e,component:t,componentPorts:n,nodeMap:o})=>{if("name"in t){let r=n.find((A)=>A.name?.toLowerCase()==="drain"||A.port_hints?.includes("drain")),i=n.find((A)=>A.name?.toLowerCase()==="gate"||A.port_hints?.includes("gate")),s=n.find((A)=>A.name?.toLowerCase()==="source"||A.port_hints?.includes("source")),a=o.get(r?.source_port_id??"")||"0",c=o.get(i?.source_port_id??"")||"0",l=o.get(s?.source_port_id??"")||"0",h=l,d=t.channel_type??"n",u=t.mosfet_mode??"enhancement",_=`${d.toUpperCase()}MOS`,p=`${_}_${u.toUpperCase()}`;if(!e.models.has(p))if(u==="enhancement"){let A=d==="p"?-1:1;e.models.set(p,`.MODEL ${p} ${_} (VTO=${A} KP=0.1)`)}else e.models.set(p,`.MODEL ${p} ${_} (KP=0.1)`);let m=new $Er({name:t.name,drain:a,gate:c,source:l,substrate:h,model:p});return new _y(t.name,m,[a,c,l])}return null},uMr=({netlist:e,component:t,componentPorts:n,nodeMap:o})=>{if("name"in t){let r=n.find((_)=>_.name?.toLowerCase()==="collector"||_.port_hints?.includes("collector")),i=n.find((_)=>_.name?.toLowerCase()==="base"||_.port_hints?.includes("base")),s=n.find((_)=>_.name?.toLowerCase()==="emitter"||_.port_hints?.includes("emitter"));if(!r||!i||!s)throw Error(`Transistor ${t.name} is missing required ports (collector, base, emitter)`);let a=o.get(r.source_port_id)||"0",c=o.get(i.source_port_id)||"0",l=o.get(s.source_port_id)||"0",h=t.transistor_type??"npn",d=h.toUpperCase();if(!e.models.has(d))e.models.set(d,`.MODEL ${d} ${h.toUpperCase()}`);let u=new WEr({name:t.name,collector:a,base:c,emitter:l,model:d});return new _y(t.name,u,[a,c,l])}return null},pMr=({netlist:e,simulationVoltageSources:t,nodeMap:n})=>{for(let o of t){if(o.type!=="simulation_voltage_source")continue;if(o.is_dc_source===!1){let r=o.terminal1_source_port_id??o.terminal1_source_net_id,i=o.terminal2_source_port_id??o.terminal2_source_net_id;if(r&&i){let s=n.get(r)||"0",a=n.get(i)||"0",c="";if(o.wave_shape==="sinewave"){let h=o.voltage??(o.peak_to_peak_voltage??0)/2,d=o.frequency??0,u=0,_=0,p=o.phase??0;if(d>0)c=`SIN(0 ${h} ${d} 0 0 ${p})`;else c=`DC ${o.voltage??0}`}else if(o.wave_shape==="square"){let h=o.voltage??o.peak_to_peak_voltage??0,d=o.frequency??0,u=d===0?1/0:1/d,_=o.period===void 0?u:o.period/1000,p=o.duty_cycle??0.5,m=_*p,A=o.pulse_delay!==void 0?o.pulse_delay/1000:0,g=o.rise_time!==void 0?Jq(o.rise_time/1000):"1n",f=o.fall_time!==void 0?Jq(o.fall_time/1000):"1n",y=o.pulse_width===void 0?Jq(m):Jq(o.pulse_width/1000),x=Jq(_);c=`PULSE(0 ${h} ${Jq(A)} ${g} ${f} ${y} ${x})`}else if(o.voltage!==void 0)c=`DC ${o.voltage}`;if(c||o.ac_magnitude!==void 0){let l=new cIe({name:o.simulation_voltage_source_id,positiveNode:s,negativeNode:a,value:c,acMagnitude:o.ac_magnitude===void 0?void 0:Ql(o.ac_magnitude),acPhase:o.ac_phase===void 0?void 0:Ql(o.ac_phase)}),h=new _y(o.simulation_voltage_source_id,l,[s,a]);e.addComponent(h)}}}else{let r="terminal1_source_port_id"in o&&typeof o.terminal1_source_port_id==="string"?o.terminal1_source_port_id:void 0,i="terminal2_source_port_id"in o&&typeof o.terminal2_source_port_id==="string"?o.terminal2_source_port_id:void 0,s=o.positive_source_port_id??o.positive_source_net_id??r,a=o.negative_source_port_id??o.negative_source_net_id??i;if(s&&a){let c=n.get(s)||"0",l=n.get(a)||"0",h=new cIe({name:o.simulation_voltage_source_id,positiveNode:c,negativeNode:l,value:`DC ${o.voltage}`,acMagnitude:o.ac_magnitude===void 0?void 0:Ql(o.ac_magnitude),acPhase:o.ac_phase===void 0?void 0:Ql(o.ac_phase)}),d=new _y(o.simulation_voltage_source_id,h,[c,l]);e.addComponent(d)}}}},mMr=({netlist:e,simulationCurrentSources:t,nodeMap:n})=>{for(let o of t){if(o.type!=="simulation_current_source")continue;if(o.is_dc_source===!1){let r=o.terminal1_source_port_id??o.terminal1_source_net_id,i=o.terminal2_source_port_id??o.terminal2_source_net_id;if(r&&i){let s=n.get(r)||"0",a=n.get(i)||"0",c="";if(o.wave_shape==="sinewave"){let h=(o.peak_to_peak_current??0)/2,d=o.frequency??0,u=0,_=0,p=o.phase??0;if(d>0)c=`SIN(0 ${h} ${d} 0 0 ${p})`;else c=`DC ${h}`}else if(o.wave_shape==="square"){let h=o.peak_to_peak_current??0,d=o.frequency??0,u=d===0?1/0:1/d,_=o.duty_cycle??0.5,p=u*_,m=0,A="1n",g="1n";c=`PULSE(0 ${h} 0 1n 1n ${p} ${u})`}if(c||o.ac_magnitude!==void 0){let l=new xun({name:o.simulation_current_source_id,positiveNode:s,negativeNode:a,value:c,acMagnitude:o.ac_magnitude===void 0?void 0:Ql(o.ac_magnitude),acPhase:o.ac_phase===void 0?void 0:Ql(o.ac_phase)}),h=new _y(o.simulation_current_source_id,l,[s,a]);e.addComponent(h)}}}else{let r="terminal1_source_port_id"in o&&typeof o.terminal1_source_port_id==="string"?o.terminal1_source_port_id:void 0,i="terminal2_source_port_id"in o&&typeof o.terminal2_source_port_id==="string"?o.terminal2_source_port_id:void 0,s=o.positive_source_port_id??o.positive_source_net_id??r,a=o.negative_source_port_id??o.negative_source_net_id??i;if(s&&a){let c=n.get(s)||"0",l=n.get(a)||"0",h=new xun({name:o.simulation_current_source_id,positiveNode:c,negativeNode:l,value:`DC ${o.current}`,acMagnitude:o.ac_magnitude===void 0?void 0:Ql(o.ac_magnitude),acPhase:o.ac_phase===void 0?void 0:Ql(o.ac_phase)}),d=new _y(o.simulation_current_source_id,h,[c,l]);e.addComponent(d)}}}},_Mr=["method","reltol","abstol","vntol"],gMr=(e,t)=>e.find((o)=>o.connected_source_net_ids.includes(t))?.connected_source_port_ids[0],aIe=({sourcePortId:e,sourceNetId:t,sourceTraces:n,nodeMap:o})=>{if(e)return o.get(e);if(!t)return;let r=gMr(n,t);if(!r)return;return o.get(r)},AMr=(e)=>bun(`sense_${e.simulation_current_probe_id}`,"sense_current_probe"),fMr=(e)=>{switch(e){case"spice_transient_analysis":return"TRAN";case"spice_dc_operating_point":return"OP";case"spice_dc_sweep":return"DC";case"spice_ac_analysis":return"AC"}},yMr=(e)=>{switch(e){case"linear":return"lin";case"decade":return"dec";case"octave":return"oct"}},xMr=(e)=>{if(e.experiment_type==="spice_transient_analysis"){let{time_per_step:c,end_time_ms:l,start_time_ms:h}=e;if(c===void 0||l===void 0)return null;let d=(h??0)/1000;return new pet({step:Ql(c/1000),stop:Ql(l/1000),...d>0?{start:Ql(d)}:{},uic:!0})}if(e.experiment_type==="spice_dc_operating_point")return new cet;if(e.experiment_type==="spice_dc_sweep"){let{dc_sweep_voltage_source_id:c,dc_sweep_current_source_id:l,dc_sweep_start:h,dc_sweep_stop:d,dc_sweep_step:u}=e;if(h===void 0||d===void 0||u===void 0)return null;let _;if(c!==void 0)_=`V${c}`;else if(l!==void 0)_=`I${l}`;else return null;return new aet({source:_,start:Ql(h),stop:Ql(d),step:Ql(u)})}let{ac_sweep_type:t,ac_samples_per_interval:n,ac_sample_count:o,ac_start_frequency_hz:r,ac_stop_frequency_hz:i}=e;if(t===void 0||r===void 0||i===void 0)return null;let s=t==="linear"?o:n;if(s===void 0)return null;let a=yMr(t);return new set({sweep:a,points:s,start:Ql(r),stop:Ql(i)})},CMr=({netlist:e,simulationExperiment:t,simulationVoltageProbes:n,simulationCurrentProbes:o,sourceTraces:r,nodeMap:i})=>{let s=fMr(t.experiment_type),a=new Set,c=t.spice_options;if(c){let l={};for(let h of _Mr){let d=c[h];if(d!==void 0)l[h]=d}if(Object.keys(l).length>0)e.optionStatements.push(new het(l).getString())}if(n.length>0){let l=[];for(let h of n){let d=aIe({sourcePortId:h.signal_input_source_port_id,sourceNetId:h.signal_input_source_net_id,sourceTraces:r,nodeMap:i});if(!d)continue;if(h.reference_input_source_port_id||h.reference_input_source_net_id){let _=aIe({sourcePortId:h.reference_input_source_port_id,sourceNetId:h.reference_input_source_net_id,sourceTraces:r,nodeMap:i});if(_&&_!=="0"){let p=`V(${d},${_})`;a.add(p),l.push({simulation_voltage_probe_id:h.simulation_voltage_probe_id,name:h.name,spice_vector:p,source_node_name:d,reference_node_name:_})}else if(d!=="0"){let p=`V(${d})`;a.add(p),l.push({simulation_voltage_probe_id:h.simulation_voltage_probe_id,name:h.name,spice_vector:p,source_node_name:d,reference_node_name:_})}}else if(d!=="0"){let _=`V(${d})`;a.add(_),l.push({simulation_voltage_probe_id:h.simulation_voltage_probe_id,name:h.name,spice_vector:_,source_node_name:d})}}if(l.length>0)for(let h of l)e.metadataComments.push(`* tscircuit_probe ${JSON.stringify(h)}`)}if(o.length>0){let l=new Set,h=[];for(let d of o){let u=aIe({sourcePortId:d.positive_source_port_id,sourceNetId:d.positive_source_net_id,sourceTraces:r,nodeMap:i}),_=aIe({sourcePortId:d.negative_source_port_id,sourceNetId:d.negative_source_net_id,sourceTraces:r,nodeMap:i});if(!u||!_)continue;let p=AMr(d),m=p,A=2;while(l.has(m))m=`${p}_${A++}`;l.add(m);let g=`V${m}`,f=`I(${g})`,y=new cIe({name:m,positiveNode:u,negativeNode:_,value:"DC 0"});e.addComponent(new _y(m,y,[u,_])),a.add(f),h.push({simulation_current_probe_id:d.simulation_current_probe_id,name:d.name,spice_vector:f,sense_voltage_source_name:g,positive_node_name:u,negative_node_name:_})}if(h.length>0)for(let d of h)e.metadataComments.push(`* tscircuit_current_probe ${JSON.stringify(d)}`)}if(a.size>0){let l=[...a].join(" "),h=new det({analysis:s,expressions:[l]});h.command=".PRINT",e.printStatements.push(h.getString());let d=new uet([l]);d.command=".SAVE",e.saveStatements.push(d.getString())}e.analysisCommand=xMr(t)?.getString()??null},lhe="GENERIC_OPAMP",bMr=`
.SUBCKT ${lhe} non_inverting_input inverting_input positive_supply negative_supply output
* Generic Op-Amp Model
E1 internal_output 0 non_inverting_input inverting_input 100k
Rin non_inverting_input inverting_input 10Meg
Rout internal_output output 75
D1 output positive_supply opamp_diode
D2 negative_supply output opamp_diode
.model opamp_diode D
.ENDS ${lhe}
`.trim(),IMr=(e,t,n)=>{if(t.length===0)return;if(!e.models.has(lhe))e.models.set(lhe,bMr);for(let o of t){if(o.type!=="simulation_op_amp")continue;let r=n.get(o.non_inverting_input_source_port_id)??"0",i=n.get(o.inverting_input_source_port_id)??"0",s=n.get(o.output_source_port_id)??"0",a=n.get(o.positive_supply_source_port_id)??"0",c=n.get(o.negative_supply_source_port_id)??"0",l=[r,i,a,c,s],h=new Cun({name:o.simulation_op_amp_id,nodes:l,subcircuitName:lhe}),d=new _y(o.simulation_op_amp_id,h,l);e.addComponent(d)}};function vMr(e){let t=[];for(let s of e.split(/\r?\n/)){let a=s.trim();if(/^\+/.test(a)&&t.length>0){t[t.length-1]+=` ${a.slice(1).trim()}`;continue}t.push(a)}let n=t.find((s)=>/^\.subckt\s+/i.test(s));if(!n)return null;let o=n.split(/\s+/),r=o[1],i=o.slice(2);if(!r||i.length===0)return null;return{modelName:r,pinNames:i}}function SMr(e,t,n){if(t.length===0)return;for(let o of t){let r=vMr(o.subcircuit_source);if(!r)continue;let{modelName:i,pinNames:s}=r;if(!e.models.has(i))e.models.set(i,o.subcircuit_source);let a=s.map((l)=>{let h=o.spice_pin_to_source_port_map[l];return n.get(h)??"0"}),c=new Cun({name:o.simulation_spice_subcircuit_id,nodes:a,subcircuitName:i});e.addComponent(new _y(o.simulation_spice_subcircuit_id,c,a))}}function vun(e){let t=new UEr("* Circuit JSON to SPICE Netlist"),n=Ho(e).source_component.list(),o=Ho(e).source_port.list(),r=Ho(e).source_trace.list(),i=e.filter((C)=>C.type==="simulation_voltage_probe"),s=e.filter((C)=>C.type==="simulation_current_probe"),a=e.filter((C)=>C.type==="simulation_switch").map((C)=>C),c=e.filter((C)=>C.type==="simulation_op_amp"),l=e.filter((C)=>C.type==="simulation_spice_subcircuit"),h=new Map;for(let C of a)if(C.source_component_id)h.set(C.source_component_id,C);let d=run(e),u=new Map,_=new Map,p=1,m=new Set;if(i.length>0){for(let C of i)if(C.name)m.add(C.name)}let A=[...m].map((C)=>/^N(\d+)$/i.exec(C)).filter((C)=>C!==null).map((C)=>parseInt(C[1],10));if(A.length>0)p=Math.max(...A)+1;let g=new Set,f=new Set(Ho(e).source_net.list().filter((C)=>C.name?.toLowerCase().includes("gnd")).map((C)=>C.source_net_id));if(f.size>0){for(let C of Ho(e).source_trace.list())if(C.connected_source_port_ids.length>0){if(C.connected_source_net_ids.some((I)=>f.has(I))){let I=C.connected_source_port_ids[0],v=d.getNetConnectedToId(I);if(v)g.add(v)}}}let y=o.filter((C)=>C.name?.toLowerCase()==="gnd");for(let C of y){let b=d.getNetConnectedToId(C.source_port_id);if(b)g.add(b)}for(let C of Ho(e).simulation_voltage_source.list()){let b=C.negative_source_port_id??C.terminal2_source_port_id;if(b){let I=d.getNetConnectedToId(b);if(I)g.add(I)}}for(let C of g)_.set(C,"0");if(i.length>0)for(let C of i){if(!C.name)continue;if(C.reference_input_source_port_id||C.reference_input_source_net_id)continue;let b,{signal_input_source_port_id:I,signal_input_source_net_id:v}=C;if(I)b=d.getNetConnectedToId(I);else if(v){let P=r.find((M)=>M.connected_source_net_ids.includes(v));if(P&&P.connected_source_port_ids.length>0){let M=P.connected_source_port_ids[0];b=d.getNetConnectedToId(M)}}if(b){if(!_.has(b))_.set(b,C.name)}else if(I&&C.name)u.set(I,C.name)}for(let C of o){let b=C.source_port_id,I=d.getNetConnectedToId(b);if(I){if(!_.has(I))_.set(I,`N${p++}`);u.set(b,_.get(I))}}for(let C of r){let b=C.connected_source_port_ids.map((I)=>u.get(I)).find((I)=>I!==void 0);if(!b)continue;for(let I of C.connected_source_net_ids)u.set(I,b)}for(let C of o){let b=C.source_port_id;if(!u.has(b))u.set(b,`N${p++}`)}for(let C of n){if(C.type!=="source_component")continue;let b=Ho(e).source_port.list({source_component_id:C.source_component_id}).sort((v,P)=>(v.pin_number??0)-(P.pin_number??0)),I=b.map((v)=>u.get(v.source_port_id)||"0");if("ftype"in C){let v=null;switch(C.ftype){case"simple_resistor":{v=rMr({component:C,nodes:I});break}case"simple_switch":{v=iMr({netlist:t,component:C,nodes:I,simulationSwitchMap:h});break}case"simple_capacitor":{v=sMr({component:C,nodes:I});break}case"simple_diode":{v=cMr({netlist:t,component:C,componentPorts:b,nodeMap:u});break}case"simple_led":{v=lMr({netlist:t,component:C,componentPorts:b,nodeMap:u});break}case"simple_inductor":{v=hMr({component:C,nodes:I});break}case"simple_mosfet":{v=dMr({netlist:t,component:C,componentPorts:b,nodeMap:u});break}case"simple_transistor":{v=uMr({netlist:t,component:C,componentPorts:b,nodeMap:u});break}}if(v)t.addComponent(v)}}pMr({netlist:t,simulationVoltageSources:Ho(e).simulation_voltage_source.list(),nodeMap:u}),mMr({netlist:t,simulationCurrentSources:Ho(e).simulation_current_source.list(),nodeMap:u}),IMr(t,c,u),SMr(t,l,u);let x=e.find((C)=>C.type==="simulation_experiment");if(x)CMr({netlist:t,simulationExperiment:x,simulationVoltageProbes:i,simulationCurrentProbes:s,sourceTraces:r,nodeMap:u});return t}tc();var QY=Qe(wt(),1);tc();var Y7e=Qe(wt(),1);Y0();m0();var jk=Qe(wt(),1);m0();Y0();m0();Kt();Ko();var tit=Qe(p0(),1),fSn=Qe(rn(),1),nit=Qe(wt(),1);tc();Ko();Kt();Kt();Kt();fp();fp();Kt();var kZ=Qe(wt(),1);Kt();Y0();Y0();Y0();m0();Kt();var sit=Qe(wt(),1),TSn=Qe(wt(),1);var ait=Qe(wt(),1);Kt();function hhe(e,t){t=met(t||{R:255,G:255,B:255}),e=met(e);let n=e;if(e.A!==void 0)n={R:t.R+(e.R-t.R)*e.A,G:t.G+(e.G-t.G)*e.A,B:t.B+(e.B-t.B)*e.A};return EMr(PMr(n))}function PMr(e){let t=e.R/255,n=e.G/255,o=e.B/255;if(t>0.04045)t=Math.pow((t+0.055)/1.055,2.4);else t=t/12.92;if(n>0.04045)n=Math.pow((n+0.055)/1.055,2.4);else n=n/12.92;if(o>0.04045)o=Math.pow((o+0.055)/1.055,2.4);else o=o/12.92;t*=100,n*=100,o*=100;let r=t*0.4124+n*0.3576+o*0.1805,i=t*0.2126+n*0.7152+o*0.0722,s=t*0.0193+n*0.1192+o*0.9505;return{X:r,Y:i,Z:s}}function EMr(e){let r=e.Y/100,i=e.Z/108.883,s=e.X/95.047;if(s>0.008856)s=Math.pow(s,0.3333333333333333);else s=7.787*s+0.13793103448275862;if(r>0.008856)r=Math.pow(r,0.3333333333333333);else r=7.787*r+0.13793103448275862;if(i>0.008856)i=Math.pow(i,0.3333333333333333);else i=7.787*i+0.13793103448275862;let a=116*r-16,c=500*(s-r),l=200*(r-i);return{L:a,a:c,b:l}}function met(e){let t,n,o,r;if("R"in e)t=e.R,n=e.G,o=e.B,r=e.A;else t=e.r,n=e.g,o=e.b,r=e.a;let i={R:t,G:n,B:o};if(r!==void 0)i.A=r;return i}function lIe(e,t,n){if("R"in e||"r"in e)e=hhe(e,n);if("R"in t||"r"in t)t=hhe(t,n);let o=e.L,r=e.a,i=e.b,s=t.L,a=t.a,c=t.b,l=1,h=1,d=1,u=Math.sqrt(Math.pow(r,2)+Math.pow(i,2)),_=Math.sqrt(Math.pow(a,2)+Math.pow(c,2)),p=(u+_)/2,m=0.5*(1-Math.sqrt(Math.pow(p,7)/(Math.pow(p,7)+Math.pow(25,7)))),A=(1+m)*r,g=(1+m)*a,f=Math.sqrt(Math.pow(A,2)+Math.pow(i,2)),y=Math.sqrt(Math.pow(g,2)+Math.pow(c,2)),x=Sun(i,A),C=Sun(c,g),b=s-o,I=y-f,v=wMr(u,_,x,C),P=2*Math.sqrt(f*y)*Math.sin(Zq(v)/2),M=(o+s)/2,B=(f+y)/2,T=BMr(u,_,x,C),N=1-0.17*Math.cos(Zq(T-30))+0.24*Math.cos(Zq(2*T))+0.32*Math.cos(Zq(3*T+6))-0.2*Math.cos(Zq(4*T-63)),D=30*Math.exp(-Math.pow((T-275)/25,2)),L=Math.sqrt(Math.pow(B,7)/(Math.pow(B,7)+Math.pow(25,7))),H=1+0.015*Math.pow(M-50,2)/Math.sqrt(20+Math.pow(M-50,2)),V=1+0.045*B,O=1+0.015*B*N,U=-2*L*Math.sin(Zq(2*D));return Math.sqrt(Math.pow(b/(H*l),2)+Math.pow(I/(V*h),2)+Math.pow(P/(O*d),2)+U*(I/(V*h))*(P/(O*d)))}function MMr(e){return e*(180/Math.PI)}function Zq(e){return e*(Math.PI/180)}function Sun(e,t){if(e===0&&t===0)return 0;else{let n=MMr(Math.atan2(e,t));if(n>=0)return n;else return n+360}}function wMr(e,t,n,o){if(e*t===0)return 0;else if(Math.abs(o-n)<=180)return o-n;else if(o-n>180)return o-n-360;else if(o-n<-180)return o-n+360;else throw Error()}function BMr(e,t,n,o){if(e*t===0)return n+o;else if(Math.abs(n-o)<=180)return(n+o)/2;else if(Math.abs(n-o)>180&&n+o<360)return(n+o+360)/2;else if(Math.abs(n-o)>180&&n+o>=360)return(n+o-360)/2;else throw Error()}function _et(e){return hhe(e)}var DMr=2.3,Pun={R:255,G:0,B:255},Xw=({color1:e,color2:t})=>e.R===t.R&&e.G===t.G&&e.B===t.B,hIe=(e)=>{try{let t=iwt(e);if(t.depth!==8)return null;let{channels:n,data:o}=t,r=new Uint8Array(t.width*t.height*4);if(n===4)r.set(o);else if(n===3)for(let i=0,s=0;i<o.length;i+=3,s+=4)r[s]=o[i],r[s+1]=o[i+1],r[s+2]=o[i+2],r[s+3]=255;else return null;return{width:t.width,height:t.height,data:r,getPixel:(i,s)=>{let a=(s*t.width+i)*4;return{R:r[a],G:r[a+1],B:r[a+2]}}}}catch{return null}},dIe=async(e)=>{if(e instanceof Uint8Array)return e;return new Uint8Array(e)},NMr=(e,t)=>{if(e.byteLength!==t.byteLength)return!1;for(let n=0;n<e.byteLength;n+=1)if(e[n]!==t[n])return!1;return!0},RMr=(e)=>{if(!e)return Pun;let t=/^#?([0-9a-fA-F]{6})$/.exec(e.trim());if(!t)return Pun;let n=t[1];return{R:Number.parseInt(n.slice(0,2),16),G:Number.parseInt(n.slice(2,4),16),B:Number.parseInt(n.slice(4,6),16)}},QMr=(e)=>{let t=e*6.2,n=e*0.695,o=null,r=null,i=null,s=null;return(a)=>{if(Xw(a))return!0;let c=null,l=null;if(o&&Xw({color1:a.color1,color2:o}))c=i;else if(r&&Xw({color1:a.color1,color2:r}))c=s;if(o&&Xw({color1:a.color2,color2:o}))l=i;else if(r&&Xw({color1:a.color2,color2:r}))l=s;if(!c)c=_et(a.color1),o=a.color1,i=c;if(!l)l=_et(a.color2),r=a.color2,s=l;let h=Math.sqrt((c.L-l.L)*(c.L-l.L)+(c.a-l.a)*(c.a-l.a)+(c.b-l.b)*(c.b-l.b));if(h>=t)return!1;if(h<=n)return!0;return lIe(c,l)<e}},kMr=class{_baseComparator;_img1;_img2;_brightnessTolerance;constructor(e,t,n,{antialiasingTolerance:o=0}){this._baseComparator=e,this._img1=t,this._img2=n,this._brightnessTolerance=o}compare(e){return this._baseComparator(e)||this._checkIsAntialiased(e)}_checkIsAntialiased(e){return this._isAntialiased(this._img2,e.x,e.y,e,this._img1)||this._isAntialiased(this._img1,e.x,e.y,e,this._img2)}_isAntialiased(e,t,n,o,r){let i=e.getPixel(t,n),s=Math.max(t-1,0),a=Math.max(n-1,0),c=Math.min(t+1,o.width-1),l=Math.min(n+1,o.height-1),h=!r,d=h?this._brightnessTolerance:0,u=0,_=0,p=0,m=0,A=0,g=0,f=0,y=0,x=0;for(let C=a;C<=l;C+=1)for(let b=s;b<=c;b+=1){if(b===t&&C===n)continue;let I=this._brightnessDelta(e.getPixel(b,C),i);if(Math.abs(I)<=d)u+=1;else if(I>d)_+=1;else p+=1;if(u>2)return!1;if(h)continue;if(I<m)m=I,g=b,f=C;if(I>A)A=I,y=b,x=C}if(h)return!0;if(p===0||_===0)return!1;return!this._isAntialiased(e,g,f,o)&&!this._isAntialiased(r,g,f,o)||!this._isAntialiased(e,y,x,o)&&!this._isAntialiased(r,y,x,o)}_brightnessDelta(e,t){return e.R*0.29889531+e.G*0.58662247+e.B*0.11448223-(t.R*0.29889531+t.G*0.58662247+t.B*0.11448223)}},LMr=class{pixelRatio;caretTopLeft=null;caretBottomRight=null;_baseComparator;_state="init";constructor(e,t){this.pixelRatio=t?Math.floor(t):1,this._baseComparator=e}compare(e){return this._baseComparator(e)||this._checkIsCaret(e)}_checkIsCaret(e){if(this._state==="caretDetected")return this.caretTopLeft!==null&&this.caretBottomRight!==null&&e.x>=this.caretTopLeft.x&&e.x<=this.caretBottomRight.x&&e.y>=this.caretTopLeft.y&&e.y<=this.caretBottomRight.y;if(this.caretTopLeft&&this.caretBottomRight&&e.x>=this.caretTopLeft.x&&e.x<=this.caretBottomRight.x&&e.y>=this.caretTopLeft.y&&e.y<=this.caretBottomRight.y)return!0;let t=this._getLastCaretPoint(e);if(!this._looksLikeCaret({x:e.x,y:e.y},t))return!1;return this.caretTopLeft={x:e.x,y:e.y},this.caretBottomRight=t,this._state="caretDetected",!0}_getLastCaretPoint(e){let t={x:e.x,y:e.y};while(!0){let n=this._getNextCaretPoint({x:e.x,y:e.y},t);if(this._isPointOutsideImages(n,e)||this._areColorsSame(n,e))return t;t=n}}_isPointOutsideImages(e,t){return e.x>=t.minWidth||e.y>=t.minHeight}_areColorsSame(e,t){let n=t.img1.getPixel(e.x,e.y),o=t.img2.getPixel(e.x,e.y);return Xw({color1:n,color2:o})}_getNextCaretPoint(e,t){let n=t.x+1;return n<e.x+this.pixelRatio?{x:n,y:t.y}:{x:e.x,y:t.y+1}}_looksLikeCaret(e,t){return this._caretHeight(e,t)>1&&this._caretWidth(e,t)===this.pixelRatio}_caretHeight(e,t){return t.y-e.y+1}_caretWidth(e,t){return t.x-e.x+1}},Eun=(e={})=>{if(e.strict&&e.tolerance!==void 0)throw TypeError('Unable to use "strict" and "tolerance" options together');if(e.percentThreshold!==void 0&&(!Number.isFinite(e.percentThreshold)||e.percentThreshold<0))throw TypeError('Expected "percentThreshold" to be a non-negative number');return{strict:Boolean(e.strict),tolerance:e.tolerance??DMr,ignoreCaret:e.ignoreCaret??!0,ignoreAntialiasing:e.ignoreAntialiasing??!0,antialiasingTolerance:e.antialiasingTolerance??0,pixelRatio:e.pixelRatio}},Mun=(e,t,n)=>{let o=n.strict?(r)=>Xw(r):QMr(n.tolerance);if(n.ignoreAntialiasing){let r=new kMr(o,e,t,n);o=(i)=>r.compare(i)}if(n.ignoreCaret){let r=new LMr(o,n.pixelRatio);o=(i)=>r.compare(i)}return o},HMr=async(e,t,n)=>{let o=hIe(e),r=hIe(t);if(!o||!r)return{equal:NMr(e,t)};let i=Mun(o,r,n),s=Math.max(o.width,r.width),a=Math.max(o.height,r.height),c=Math.min(o.width,r.width),l=Math.min(o.height,r.height),h=s*a,d=0;for(let u=0;u<a;u+=1)for(let _=0;_<s;_+=1){if(_>=c||u>=l){d+=1;continue}let p=o.getPixel(_,u),m=r.getPixel(_,u);if(!(Xw({color1:p,color2:m})||i({color1:p,color2:m,img1:o,img2:r,x:_,y:u,width:s,height:a,minWidth:c,minHeight:l})))d+=1}return{equal:d===0,differentPixels:d,totalPixels:h}},FMr=async(e,t,n={})=>{let o=Eun(n),r=await dIe(e),i=await dIe(t);return HMr(r,i,o)},zMr=async({reference:e,current:t,highlightColor:n,...o})=>{let r=Eun(o),i=await dIe(e),s=await dIe(t),a=hIe(i),c=hIe(s);if(!(a&&c))return s;let l=Mun(a,c,r),h=Math.max(a.width,c.width),d=Math.max(a.height,c.height),u=Math.min(a.width,c.width),_=Math.min(a.height,c.height),p=RMr(n),m=new Uint8Array(h*d*4);for(let g=0;g<d;g+=1)for(let f=0;f<h;f+=1){let y=(g*h+f)*4;if(f>=u||g>=_){m[y]=p.R,m[y+1]=p.G,m[y+2]=p.B,m[y+3]=255;continue}let x=a.getPixel(f,g),C=c.getPixel(f,g);if(Xw({color1:x,color2:C})||l({color1:x,color2:C,img1:a,img2:c,x:f,y:g,width:h,height:d,minWidth:u,minHeight:_}))m[y]=x.R,m[y+1]=x.G,m[y+2]=x.B,m[y+3]=255;else m[y]=p.R,m[y+1]=p.G,m[y+2]=p.B,m[y+3]=255}return xVe({width:h,height:d,data:m,channels:4,depth:8})},TVs=Object.assign(FMr,{createDiff:zMr});fp();var wun=Qe(wt(),1);function dhe(e,t){let n=new NK(e),o=n.getTotalLength(),r=Math.max(2,Math.ceil(o*t)),i=[];for(let s=1;s<=r;s++){let a=s/r*o,c=n.getPointAtLength(a);i.push({x:c.x,y:c.y})}return i}function OMr(e,t=10){let n=new NK(e);n.toAbsolute();let o=n.segments,r=[],i=[],s=0,a=0,c=0,l=0;for(let h of o)switch(h[0]){case"M":{if(i.length>0)r.push(i);s=h[1],a=h[2],c=s,l=a,i=[{x:s,y:a}];break}case"L":{s=h[1],a=h[2],i.push({x:s,y:a});break}case"H":{s=h[1],i.push({x:s,y:a});break}case"V":{a=h[1],i.push({x:s,y:a});break}case"Z":{if(s!==c||a!==l)i.push({x:c,y:l});s=c,a=l;break}case"C":{let u=h[5],_=h[6],p=`M ${s} ${a} C ${h[1]} ${h[2]} ${h[3]} ${h[4]} ${u} ${_}`,m=dhe(p,t);i.push(...m),s=u,a=_;break}case"S":{let u=h[3],_=h[4],p=`M ${s} ${a} S ${h[1]} ${h[2]} ${u} ${_}`,m=dhe(p,t);i.push(...m),s=u,a=_;break}case"Q":{let u=h[3],_=h[4],p=`M ${s} ${a} Q ${h[1]} ${h[2]} ${u} ${_}`,m=dhe(p,t);i.push(...m),s=u,a=_;break}case"T":{let u=h[1],_=h[2],p=`M ${s} ${a} T ${u} ${_}`,m=dhe(p,t);i.push(...m),s=u,a=_;break}case"A":{let u=h[6],_=h[7],p=`M ${s} ${a} A ${h[1]} ${h[2]} ${h[3]} ${h[4]} ${h[5]} ${u} ${_}`,m=dhe(p,t);i.push(...m),s=u,a=_;break}}if(i.length>0)r.push(i);return r.map((h)=>{let d=[];for(let u of h)if(d.length===0||Math.abs(d[d.length-1].x-u.x)>0.000000001||Math.abs(d[d.length-1].y-u.y)>0.000000001)d.push(u);return d})}var g9="image/svg+xml",get="image/png";async function uIe(e){if(e.startsWith("data:"))return VMr(e);let t;try{t=await fetch(e)}catch(r){throw Error(`Failed to fetch image "${e}". Pass a data URL or a fetchable URL.`,{cause:r})}if(!t.ok)throw Error(`Failed to fetch image "${e}": ${t.status} ${t.statusText}`);let n=t.headers.get("content-type")?.split(";")[0],o=n&&n!=="application/octet-stream"?n:YMr(e);return{mimetype:o,text:o===g9?await t.text():"",dataUrl:e,projectRelativePath:e}}function Bun({svg:e,width:t,height:n,transform:o}){let r=Aet({svg:e,width:t,height:n,transform:o}).map(GMr).filter((s)=>s.length>=3).map((s)=>({vertices:s,polygon:Tun(s),samplePoint:WMr(s)})).map((s)=>({...s,area:s.polygon.area()})).filter((s)=>s.area>0.000000001),i=r.filter((s)=>r.filter((c)=>c!==s&&c.area>s.area&&c.polygon.contains(jm(s.samplePoint.x,s.samplePoint.y))).length%2===0);return i.map((s)=>{let a=r.filter((c)=>c!==s&&c.area<s.area&&s.polygon.contains(jm(c.samplePoint.x,c.samplePoint.y))&&!i.some((l)=>l!==s&&l.area<s.area&&l.area>c.area&&l.polygon.contains(jm(c.samplePoint.x,c.samplePoint.y)))).map((c)=>({vertices:UMr(c.vertices)}));return{outer_ring:{vertices:fet(s.vertices)},inner_rings:a}})}function Aet({svg:e,width:t,height:n,transform:o}){let r=XMr(e),i=t/r.width,s=n/r.height;return jMr(e).flatMap((a)=>OMr(a,0.03).map((c)=>c.map((l)=>wun.applyToPoint(o,{x:(l.x-r.x-r.width/2)*i,y:-(l.y-r.y-r.height/2)*s})).filter((l,h,d)=>h===0||Math.abs(l.x-d[h-1].x)>0.000001||Math.abs(l.y-d[h-1].y)>0.000001)))}function fet(e){return Dun(e)>0?[...e].reverse():e}function VMr(e){let t=e.indexOf(",");if(!e.startsWith("data:")||t===-1)throw Error("Invalid data URL for image source");let n=e.slice(5,t),o=e.slice(t+1),r=n.split(";")[0]||g9,i=n.includes(";base64")?new TextDecoder().decode(Uint8Array.from(atob(o),(s)=>s.charCodeAt(0))):decodeURIComponent(o);return{mimetype:r,text:i,dataUrl:e,projectRelativePath:"inline"}}function YMr(e){let t=e.toLowerCase();if(t.endsWith(".svg"))return g9;if(t.endsWith(".png"))return get;return"application/octet-stream"}function GMr(e){if(e.length<2)return e;let t=e[0],n=e[e.length-1];if(Math.abs(t.x-n.x)<0.000001&&Math.abs(t.y-n.y)<0.000001)return e.slice(0,-1);return e}function UMr(e){return Dun(e)<0?[...e].reverse():e}function WMr(e){let t=0,n=0;for(let o of e)t+=o.x,n+=o.y;return{x:t/e.length,y:n/e.length}}function Tun(e){let t=new tl;return t.addFace(e.map((n)=>jm(n.x,n.y))),t}function Dun(e){return[...Tun(e).faces][0].signedArea()}function XMr(e){let n=e.match(/\bviewBox\s*=\s*["']([^"']+)["']/i)?.[1]?.trim().split(/[\s,]+/).map(Number);if(n?.length===4&&n.every(Number.isFinite))return{x:n[0],y:n[1],width:n[2],height:n[3]};return{x:0,y:0,width:1,height:1}}function jMr(e){let t=[],n=/<path\b[^>]*>/gi;for(let o of e.match(n)??[]){let r=o.match(/\bd\s*=\s*(["'])(.*?)\1/i);if(r?.[2])t.push(r[2])}return t}var HSn=Qe(wt(),1);Kt();Kt();var hit=Qe(wt(),1);Ie();Ie();var Nun={in:25.4,inch:25.4,mil:0.0254,mm:1,m:1000,cm:10,ft:304.8,feet:304.8},FVs=new Intl.NumberFormat("en-US",{useGrouping:!1,notation:"standard",maximumFractionDigits:12}),Run=(e)=>{let t=typeof e==="number"?"mm":e.replace(/^[^a-zA-Z]+/g,"").toLowerCase();if(!t)t="mm";let n=typeof e==="number"?e:Number.parseFloat(e.split(t)[0]);if(t in Nun)return n*Nun[t];throw Error(`Unsupported unit: ${t}`)};Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();function a0n(e){if(!/^nema(?:8|17|23)(?:_|$)/i.test(e))return e;return e.replace(/(^|_)jst([0-9]+)_(ph|sh)(?=_|$)/gi,"$1jst$3$2").replace(/(^|_)jst[_-](ph|sh)[_-]([0-9]+)(?=_|$)/gi,"$1jst$2$3").replace(/(^|_)none(?=_|$)/gi,"$1nowires").replace(/(^|_)stubs(?=_|$)/gi,"$1wirestubs")}function ym(e){let t=[],n=0,o=0;for(let r=0;r<e.length;r++){let i=e[r];if(i==="(")n++;if(i===")")n--;if(n<0||n>1)throw Error("Invalid feature parentheses");if(i==="_"&&n===0)t.push(e.slice(o,r)),o=r+1}if(n!==0)throw Error("Unclosed feature parentheses");if(t.push(e.slice(o)),t.some((r)=>!r))throw Error("Model strings cannot contain empty tokens");return t}var Qun=(e)=>{let t=e.match(/^([a-zA-Z]+)([\(\d\.\+\-].*)?$/);if(!t?.[1])return;return{fn:t[1].toLowerCase(),value:t[2]}},Met=(e)=>{let t=a0n(e.trim());if(!t)throw Error("Model string cannot be empty");let n=ym(t),o=n[0],r=Qun(o),i={},s=r?.fn??o.toLowerCase();if(i[s]=!0,i.fn=s,r?.value){let a=Number.parseFloat(r.value);if(Number.isFinite(a))i.num_pins=a}for(let a of n.slice(1)){if(!a)throw Error("Model strings cannot contain empty tokens");let c=Qun(a);if(!c)throw Error(`Invalid model string token "${a}"`);i[c.fn]=c.value??!0}return i.string=t,i};function cu(e){return e}var KMr=class{models=new Map;register(e){if(typeof e.name!=="string"||!/^[a-z]+$/.test(e.name))throw Error("Model names must contain only lowercase letters");if(this.models.has(e.name))throw Error(`Modelprinter function "${e.name}" is already registered`);if(e.normalizeString!==void 0&&typeof e.normalizeString!=="function")throw Error("Model string normalizer must be a function");this.models.set(e.name,{name:e.name,schema:e.schema,parse:e.parse,normalizeString:e.normalizeString})}getModelNames(){return[...this.models.keys()]}normalize(e){let t=this.models.get(e.fn);if(!t?.normalizeString)return e;let n=t.normalizeString(e.string);if(typeof n!=="string")throw Error(`Normalizer for "${t.name}" must return a string`);if(n===e.string)return e;let o=Met(n);if(o.fn!==t.name)throw Error(`Normalizer for "${t.name}" must preserve the model name`);return o}parse(e){let t=this.models.get(e.fn);if(!t)throw Error(`Unsupported modelprinter function "${e.fn}"`);let n=t.parse(e);if(n===null||typeof n!=="object"||Array.isArray(n)||n.fn!==t.name)throw Error(`Parser for "${t.name}" must return a model with fn "${t.name}"`);return n}},Qh=un([Ae(),k()]).transform((e,t)=>{try{let n=Run(e);if(!Number.isFinite(n))throw Error("Length is not finite");return n}catch{return t.addIssue({code:"custom",message:`Invalid model length: ${String(e)}`}),$ge}}),Cs=Qh.refine((e)=>e>0,"Length must be greater than zero"),gy=Qh.refine((e)=>e>=0,"Length cannot be negative"),A9=un([Ae(),k().regex(/^(?:\d+(?:\.\d+)?|\.\d+)(?:mm|cm|m|in|inch)?$/i).transform((e)=>e.toLowerCase())]).pipe(Qh).refine((e)=>e>0,"Length must be positive"),wet={M3:{diameter:3,threadPitch:0.5,headAcrossFlats:5.5,headHeight:2,underHeadRadius:0.1,headChamferAngle:30,tipChamferAngle:45,threadFlankAngle:60,tipChamfer:0.25,threadRootDiameter:2.3865653389860224,threadPitchDiameter:2.6752404735808355,headCornerDiameter:6.3508529610858835,headChamferDiameter:5.5},M4:{diameter:4,threadPitch:0.7,headAcrossFlats:7,headHeight:2.8,underHeadRadius:0.2,headChamferAngle:30,tipChamferAngle:45,threadFlankAngle:60,tipChamfer:0.35,threadRootDiameter:3.141191474580432,threadPitchDiameter:3.5453366630131695,headCornerDiameter:8.082903768654761,headChamferDiameter:7},M5:{diameter:5,threadPitch:0.8,headAcrossFlats:8,headHeight:3.5,underHeadRadius:0.2,headChamferAngle:30,tipChamferAngle:45,threadFlankAngle:60,tipChamfer:0.4,threadRootDiameter:4.018504542377636,threadPitchDiameter:4.480384757729337,headCornerDiameter:9.237604307034013,headChamferDiameter:8},M6:{diameter:6,threadPitch:1,headAcrossFlats:10,headHeight:4,underHeadRadius:0.25,headChamferAngle:30,tipChamferAngle:45,threadFlankAngle:60,tipChamfer:0.5,threadRootDiameter:4.773130677972045,threadPitchDiameter:5.350480947161671,headCornerDiameter:11.547005383792516,headChamferDiameter:10}},$Mr=Pt(["M3","M4","M5","M6"]),qMr=Pt(["iso4017","iso4017:2014"]).default("iso4017").transform(()=>"iso4017:2014"),c0n={standard:qMr,metricSize:$Mr,length:A9,thread:he("full").default("full"),drive:he("hex").default("hex"),threadHand:Pt(["right","left"]).default("right"),threadClass:he("6g").default("6g"),threadGender:he("male").default("male"),showThreads:Be().default(!0),diameter:A9.optional(),threadPitch:A9.optional(),headAcrossFlats:A9.optional(),headHeight:A9.optional(),underHeadRadius:A9.optional(),headChamferAngle:Ae().finite().positive().optional(),tipChamferAngle:Ae().finite().positive().optional(),threadFlankAngle:Ae().finite().positive().optional(),tipChamfer:A9.optional(),threadRootDiameter:A9.optional(),threadPitchDiameter:A9.optional(),headCornerDiameter:A9.optional(),headChamferDiameter:A9.optional()},l0n=(e,t)=>{let n=wet[e.metricSize];for(let o of Object.keys(n))if(e[o]!==void 0&&Math.abs(e[o]-n[o])>0.000000001)t.addIssue({code:"custom",path:[o],message:`Dimension ${o} contradicts ${e.standard} ${e.metricSize}`});if(e.length<=n.underHeadRadius+n.tipChamfer)t.addIssue({code:"custom",path:["length"],message:"Length must separate the under-head fillet and fixed tip chamfer"})},h0n=we(c0n).strict().superRefine(l0n).transform((e)=>({...e,...wet[e.metricSize]})),_Ie=we({fn:he("hexbolt"),...c0n}).strict().superRefine(l0n).transform((e)=>({...e,...wet[e.metricSize]})),JMr={m:"metricSize",metricsize:"metricSize",l:"length",length:"length",standard:"standard",thread:"thread",drive:"drive",threadhand:"threadHand",threadclass:"threadClass",threadgender:"threadGender",diameter:"diameter",threadpitch:"threadPitch",headacrossflats:"headAcrossFlats",headheight:"headHeight",underheadradius:"underHeadRadius",headchamferangle:"headChamferAngle",tipchamferangle:"tipChamferAngle",threadflankangle:"threadFlankAngle",tipchamfer:"tipChamfer",threadrootdiameter:"threadRootDiameter",threadpitchdiameter:"threadPitchDiameter",headcornerdiameter:"headCornerDiameter",headchamferdiameter:"headChamferDiameter",d:"diameter",headh:"headHeight",af:"headAcrossFlats"},ZMr=new Set(["standard","thread","drive","threadHand","threadClass","threadGender"]),ewr=(e)=>{if(e.fn!=="hexbolt")throw Error(`Expected hexbolt params, got "${e.fn}"`);let[t,...n]=ym(e.string);if(t?.toLowerCase()!=="hexbolt")throw Error("The hexbolt function does not accept an inline value");let o={};for(let r of n){let i=r.match(/^([a-z]+)(.*)$/i),s=i?.[1]?.toLowerCase(),a=i?.[2],c,l;if(s==="threads"||s==="nothreads"){if(a!=="")throw Error(`Token "${s}" does not accept a value`);c="showThreads",l=s==="threads"}else{if(c=s?JMr[s]??"":"",!c||!a)throw Error(`Unknown or missing hexbolt token "${r}"`);if(ZMr.has(c)){let h=a.match(/^\(([^()]+)\)$/)?.[1];if(!h)throw Error(`Token "${s}" requires a parenthesized selector`);l=h.toLowerCase()}else if(c==="metricSize"){let h=s==="m"?a:a.match(/^\((m\d+)\)$/i)?.[1]?.slice(1);if(!h||!/^\d+$/.test(h))throw Error("Invalid metric size");l=`M${h}`}else{if(!/^(?:\d+(?:\.\d+)?|\.\d+)(?:mm|cm|m|in|inch)?$/i.test(a))throw Error(`Invalid dimension token "${r}"`);l=["headChamferAngle","tipChamferAngle","threadFlankAngle"].includes(c)?Number(a):a}}if(c in o)throw Error(`Property "${c}" is set more than once`);o[c]=l}return _Ie.parse({fn:"hexbolt",...o})},d0n=cu({name:"hexbolt",schema:_Ie,parse:ewr});function twr(e){e.register(d0n)}var u0n=un([Ae(),k().regex(/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:mm|cm|m|in|inch|mil|ft|feet)?$/i,"Length must be a complete number with an optional supported unit").transform((e)=>e.toLowerCase())]),Vu=u0n.pipe(Qh).refine((e)=>e>0,"Length must be greater than zero"),f9=u0n.pipe(Qh).refine((e)=>e>=0,"Length cannot be negative"),p0n=Ae().finite().gt(0).lt(90);function FV(e,t){if(!/^\d+$/.test(e))throw Error(`${t} requires a unitless integer`);return Number(e)}function gIe(e,t){if(!/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:deg)?$/i.test(e))throw Error(`${t} requires a numeric angle in degrees`);return Number(e.replace(/deg$/i,""))}function nJ(e){let t=e.match(/^([a-z]+)(.*)$/i);if(!t)throw Error(`Invalid gear token "${e}"`);return[t[1].toLowerCase(),t[2]]}var m0n={toothCount:Ae().int().min(6).max(512).default(24),module:Vu.default(1),faceWidth:Vu.default(5),pressureAngle:p0n.default(20),backlash:f9.default(0),clearance:f9.default(0.25),boreDiameter:f9.default(0),hubDiameter:f9.default(0),hubLength:f9.default(0),phase:Ae().finite().default(0),segmentsPerTooth:Ae().int().min(4).max(64).default(12)};function _0n(e){let t=e.module*e.toothCount;return{pitchDiameter:t,baseDiameter:t*Math.cos(e.pressureAngle*Math.PI/180),outsideDiameter:t+2*e.module,rootDiameter:t-2*(e.module+e.clearance),circularPitch:Math.PI*e.module,toothThickness:Math.PI*e.module/2-e.backlash}}var pIe=(e)=>Math.tan(e)-e;function g0n(e,t){let n=(c,l)=>t.addIssue({code:"custom",message:c,path:l?[l]:[]}),o=_0n(e);if(Object.values(o).some((c)=>!Number.isFinite(c))||!Number.isFinite(e.faceWidth+e.hubLength)){n("Derived gear dimensions must be finite");return}if(o.rootDiameter<=0){n("Dedendum must leave a positive root diameter","clearance");return}if(e.boreDiameter>=o.rootDiameter)n("Bore diameter must be smaller than the root diameter","boreDiameter");if(e.hubDiameter===0!==(e.hubLength===0))n("Hub diameter and length must both be zero or both be positive");if(e.hubDiameter>0){if(e.hubDiameter>=o.rootDiameter)n("Hub diameter must be smaller than the root diameter","hubDiameter");if(e.boreDiameter>=e.hubDiameter)n("Hub diameter must exceed the bore diameter","hubDiameter")}let r=e.pressureAngle*Math.PI/180,i=o.toothThickness/o.pitchDiameter,s=i+pIe(r)-pIe(Math.acos(o.baseDiameter/o.outsideDiameter));if(!Number.isFinite(s)||s<=0)n("Tooth tip must have positive angular thickness","backlash");let a=i+pIe(r)-pIe(Math.acos(o.baseDiameter/Math.max(o.rootDiameter,o.baseDiameter)));if(!Number.isFinite(a)||a>=Math.PI/e.toothCount)n("Adjacent teeth must leave a positive root gap","pressureAngle")}var _he=we(m0n).strict().superRefine(g0n),AIe=we({fn:he("spurgear"),...m0n}).strict().superRefine(g0n),Bet=(e={})=>_0n(_he.parse(e)),A0n={..._he.innerType().shape,helixAngle:Ae().finite().min(0).lt(90).default(20),handedness:Pt(["right","left"]).default("right"),segmentsPerTurn:Ae().int().min(12).max(128).default(32)};function f0n(e){let{helixAngle:t,handedness:n,segmentsPerTurn:o,...r}=e,i=Bet(r),s=t*Math.PI/180;return{...i,normalModule:e.module*Math.cos(s),normalPressureAngle:Math.atan(Math.tan(e.pressureAngle*Math.PI/180)*Math.cos(s))*180/Math.PI,normalPitch:i.circularPitch*Math.cos(s),twistAngle:t===0?0:(n==="right"?1:-1)*(2*e.faceWidth/i.pitchDiameter*Math.tan(s)*180)/Math.PI}}function y0n(e,t){let{fn:n,helixAngle:o,handedness:r,segmentsPerTurn:i,...s}=e,a=_he.safeParse(s);if(!a.success){for(let c of a.error.issues)t.addIssue(c);return}if(Object.values(f0n({...a.data,helixAngle:o,handedness:r,segmentsPerTurn:i})).some((c)=>!Number.isFinite(c)))t.addIssue({code:"custom",message:"Derived helical gear dimensions must be finite"})}var Tet=we(A0n).strict().superRefine(y0n),fIe=we({fn:he("helicalgear"),...A0n}).strict().superRefine(y0n),x0n=(e={})=>f0n(Tet.parse(e)),kun={m:"module",module:"module",w:"faceWidth",width:"faceWidth",facewidth:"faceWidth",bore:"boreDiameter",borediameter:"boreDiameter",backlash:"backlash",clearance:"clearance",hubdiameter:"hubDiameter",hublength:"hubLength"};function nwr(e){let t=e.string.split("_"),n=t[0]?.match(/^helicalgear(\d+)?$/i);if(!n||e.fn!=="helicalgear")throw Error("Expected helicalgear with an optional inline tooth count");let o={fn:"helicalgear"};if(n[1])o.toothCount=FV(n[1],"toothCount");for(let r of t.slice(1)){let[i,s]=nJ(r),a,c;if(i in kun)a=kun[i],c=s;else if(i==="teeth"||i==="segments"||i==="turnsegments")a=i==="teeth"?"toothCount":i==="segments"?"segmentsPerTooth":"segmentsPerTurn",c=FV(s,a);else if(i==="pa"||i==="pressureangle"||i==="phase"||i==="ha"||i==="helixangle")a=i==="phase"?"phase":i==="ha"||i==="helixangle"?"helixAngle":"pressureAngle",c=gIe(s,a);else if(i==="right"||i==="left"){if(s)throw Error(`Helical flag "${i}" does not accept a value`);a="handedness",c=i}else throw Error(`Unknown helical gear token "${r}"`);if(a in o)throw Error(`Helical gear property "${a}" is set more than once`);o[a]=c}return fIe.parse(o)}var C0n=cu({name:"helicalgear",schema:fIe,parse:nwr});function owr(e){e.register(C0n)}function oJ(e){let t=/^jst-(ph|sh)-([1-9][0-9]*)$/.exec(e);if(!t)return;let n=Number(t[2]),o=t[1]==="ph";return{standard:o?"jst_ph":"jst_sh",pinCount:n,maxPinCount:o?16:15,pitch:o?2:1,bodyWidth:o?(n-1)*2+3.9:n+3,bodyHeight:o?4.5:2.9,matingDepth:o?6:4.25}}var rwr=k().refine((e)=>{let t=oJ(e);return t!==void 0&&t.pinCount>=2&&t.pinCount<=t.maxPinCount},"Expected jst-ph-N (2–16 pins) or jst-sh-N (2–15 pins)"),Vx={M2:{diameter:2,threadPitch:0.4,headDiameter:3.8,headHeight:2,socketWidth:1.5,socketDepth:1},"M2.5":{diameter:2.5,threadPitch:0.45,headDiameter:4.5,headHeight:2.5,socketWidth:2,socketDepth:1.1},M3:{diameter:3,threadPitch:0.5,headDiameter:5.5,headHeight:3,socketWidth:2.5,socketDepth:1.3},M4:{diameter:4,threadPitch:0.7,headDiameter:7,headHeight:4,socketWidth:3,socketDepth:2},M5:{diameter:5,threadPitch:0.8,headDiameter:8.5,headHeight:5,socketWidth:4,socketDepth:2.5},M6:{diameter:6,threadPitch:1,headDiameter:10,headHeight:6,socketWidth:5,socketDepth:3},M8:{diameter:8,threadPitch:1.25,headDiameter:13,headHeight:8,socketWidth:6,socketDepth:4},M10:{diameter:10,threadPitch:1.5,headDiameter:16,headHeight:10,socketWidth:8,socketDepth:5},M12:{diameter:12,threadPitch:1.75,headDiameter:18,headHeight:12,socketWidth:10,socketDepth:6}},ghe=Pt(["M2","M2.5","M3","M4","M5","M6","M8","M10","M12"]),b0n={metricSize:ghe,length:Cs,showThreads:Be().default(!0)},I0n=we(b0n).strict(),yIe=we({fn:he("hexsocketbolt"),...b0n}).strict(),iwr=un([he(8),he(17),he(23)]),swr={8:{backFaceScrewSize:"M2",backFaceHoleDepth:2,bodyWidth:20.3,bodyLength:33,mountingHoleSpacing:16,mountingHoleDiameter:2,mountingHoleDepth:2,mountingHoleThrough:!1,pilotDiameter:15,pilotLength:1.5,shaftDiameter:4,shaftLength:15,shaftShape:"round",shaftFlatDepth:0.5,shaftFlatLength:10,shaftFlatAngle:0,frontCapLength:3.5,rearCapLength:3.5,faceCornerChamfer:0.5,bodyCornerChamfer:3},17:{backFaceScrewSize:"M3",backFaceHoleDepth:4.5,bodyWidth:42.3,bodyLength:38,mountingHoleSpacing:31,mountingHoleDiameter:3,mountingHoleDepth:4.5,mountingHoleThrough:!1,pilotDiameter:22,pilotLength:2,shaftDiameter:5,shaftLength:24,shaftShape:"d",shaftFlatDepth:0.5,shaftFlatLength:15,shaftFlatAngle:0,frontCapLength:5,rearCapLength:5,faceCornerChamfer:3,bodyCornerChamfer:6},23:{backFaceScrewSize:"M4",backFaceHoleDepth:4.5,bodyWidth:56.4,bodyLength:51,mountingHoleSpacing:47.14,mountingHoleDiameter:5,mountingHoleDepth:5,mountingHoleThrough:!0,pilotDiameter:38.1,pilotLength:1.6,shaftDiameter:6.35,shaftLength:20.6,shaftShape:"d",shaftFlatDepth:0.5,shaftFlatLength:15,shaftFlatAngle:0,frontCapLength:5,rearCapLength:5,faceCornerChamfer:2,bodyCornerChamfer:15}},v0n={nemaSize:iwr,backFace:Pt(["plain","holes","screws"]).optional(),backFaceHoleSpacing:Cs.optional(),backFaceHoleDiameter:Cs.optional(),backFaceHoleDepth:Cs.optional(),backFaceScrewSize:ghe.optional(),wireConnection:un([Pt(["none","stubs"]),rwr]).optional(),wireSideAngle:Ae().finite().optional(),wireLength:Cs.optional(),wireDiameter:Cs.optional(),wireCount:Ae().int().min(2).max(8).optional(),bodyWidth:Cs.optional(),bodyLength:Cs.optional(),mountingHoleSpacing:Cs.optional(),mountingHoleDiameter:Cs.optional(),mountingHoleDepth:Cs.optional(),mountingHoleThrough:Be().optional(),pilotDiameter:Cs.optional(),pilotLength:Cs.optional(),shaftLength:Cs.optional(),shaftDiameter:Cs.optional(),shaftShape:Pt(["round","d"]).optional(),shaftFlatDepth:gy.optional(),shaftFlatLength:gy.optional(),shaftFlatAngle:Ae().finite().optional(),frontCapLength:Cs.optional(),rearCapLength:Cs.optional(),faceCornerChamfer:gy.optional(),bodyCornerChamfer:gy.optional()},S0n=(e)=>{let t=swr[e.nemaSize],n=e.backFaceScrewSize??t.backFaceScrewSize,o=Vx[n];return{nemaSize:e.nemaSize,wireConnection:e.wireConnection??"stubs",wireSideAngle:((e.wireSideAngle??0)%360+360)%360,wireLength:e.wireLength??6,wireDiameter:e.wireDiameter??1.2,wireCount:e.wireCount??4,backFace:e.backFace??"screws",backFaceHoleSpacing:e.backFaceHoleSpacing??e.mountingHoleSpacing??t.mountingHoleSpacing,backFaceHoleDiameter:e.backFaceHoleDiameter??o.diameter,backFaceHoleDepth:e.backFaceHoleDepth??t.backFaceHoleDepth,backFaceScrewSize:n,bodyWidth:e.bodyWidth??t.bodyWidth,bodyLength:e.bodyLength??t.bodyLength,mountingHoleSpacing:e.mountingHoleSpacing??t.mountingHoleSpacing,mountingHoleDiameter:e.mountingHoleDiameter??t.mountingHoleDiameter,mountingHoleDepth:e.mountingHoleDepth??t.mountingHoleDepth,mountingHoleThrough:e.mountingHoleThrough??t.mountingHoleThrough,pilotDiameter:e.pilotDiameter??t.pilotDiameter,pilotLength:e.pilotLength??t.pilotLength,shaftDiameter:e.shaftDiameter??t.shaftDiameter,shaftLength:e.shaftLength??t.shaftLength,shaftShape:e.shaftShape??t.shaftShape,shaftFlatDepth:e.shaftFlatDepth??t.shaftFlatDepth,shaftFlatLength:e.shaftFlatLength??t.shaftFlatLength,shaftFlatAngle:e.shaftFlatAngle??t.shaftFlatAngle,frontCapLength:e.frontCapLength??t.frontCapLength,rearCapLength:e.rearCapLength??t.rearCapLength,faceCornerChamfer:e.faceCornerChamfer??t.faceCornerChamfer,bodyCornerChamfer:e.bodyCornerChamfer??t.bodyCornerChamfer}},P0n=(e,t)=>{let n=(i)=>t.addIssue({code:"custom",message:i});if(e.backFace!=="plain"){let i=Vx[e.backFaceScrewSize],s=(e.backFace==="screws"?Math.max(e.backFaceHoleDiameter,i.headDiameter):e.backFaceHoleDiameter)/2;if(e.backFaceHoleSpacing<=2*s)n("Rear holes and screw heads must not overlap each other");if(e.backFaceHoleSpacing+2*s>=e.bodyWidth||e.bodyWidth-e.faceCornerChamfer-e.backFaceHoleSpacing<=s*Math.SQRT2)n("Rear holes and screw heads must fit entirely inside the rear face");if(e.backFaceHoleDepth>=e.rearCapLength)n("Rear hole depth must be less than the rear cap length");if(e.backFace==="screws"&&e.backFaceHoleDiameter<i.diameter)n("Rear holes must accommodate the screw diameter")}if(e.wireConnection==="stubs"){if(e.wireDiameter*e.wireCount*1.5>e.bodyWidth-2*e.faceCornerChamfer)n("Wire bundle must fit on the cap side");if(e.wireDiameter>=e.rearCapLength)n("Wire diameter must fit within the rear cap")}let o=oJ(e.wireConnection);if(o&&e.bodyWidth-2*e.faceCornerChamfer<o.bodyWidth)n("JST header must fit on the motor side");let r=e.mountingHoleDiameter/2;if(e.frontCapLength+e.rearCapLength>=e.bodyLength)n("End caps must leave a positive body length");if(e.faceCornerChamfer>=e.bodyWidth/2||e.bodyCornerChamfer>=e.bodyWidth/2)n("Chamfer must be smaller than half the body width");if(e.mountingHoleSpacing+2*r>=e.bodyWidth||e.bodyWidth-e.faceCornerChamfer-e.mountingHoleSpacing<=r*Math.SQRT2)n("Mounting holes must fit entirely inside the front face");if(e.pilotDiameter>=e.bodyWidth||e.pilotDiameter<=e.shaftDiameter)n("Pilot diameter must exceed the shaft diameter and fit inside the face");if(e.mountingHoleSpacing/Math.SQRT2<=e.pilotDiameter/2+r)n("Mounting holes must clear the pilot");if(!e.mountingHoleThrough&&e.mountingHoleDepth>=e.frontCapLength)n("Blind mounting hole depth must be less than the front cap length");if(e.mountingHoleThrough&&e.bodyWidth-e.bodyCornerChamfer-e.mountingHoleSpacing>=-r*Math.SQRT2)n("Body must clear through front mounting holes");if(e.shaftLength<=e.pilotLength)n("Shaft tip must extend beyond the pilot");if(e.shaftShape==="d"&&(e.shaftFlatDepth<=0||e.shaftFlatDepth>=e.shaftDiameter/2||e.shaftFlatLength<=0||e.shaftFlatLength>e.shaftLength-e.pilotLength))n("D flat must have positive depth less than the shaft radius and fit above the pilot")},xIe=we(v0n).strict().transform(S0n).superRefine(P0n),CIe=we({fn:he("nema"),...v0n}).strict().transform(({fn:e,...t})=>({fn:e,...S0n(t)})).superRefine(P0n),Lun={wirelength:"wireLength",wirediameter:"wireDiameter",l:"bodyLength",length:"bodyLength",bodylength:"bodyLength",bodywidth:"bodyWidth",backholespacing:"backFaceHoleSpacing",backholediameter:"backFaceHoleDiameter",backholedepth:"backFaceHoleDepth",shaftlength:"shaftLength",shaftdiameter:"shaftDiameter",flatdepth:"shaftFlatDepth",flatlength:"shaftFlatLength",holespacing:"mountingHoleSpacing",holediameter:"mountingHoleDiameter",holedepth:"mountingHoleDepth",pilotdiameter:"pilotDiameter",pilotlength:"pilotLength",frontcap:"frontCapLength",rearcap:"rearCapLength",facechamfer:"faceCornerChamfer",bodychamfer:"bodyCornerChamfer"};function awr(e){let t=a0n(e.string).split("_"),n=t[0]?.match(/^nema(8|17|23)$/i);if(!n)throw Error("Expected nema8, nema17 or nema23");let o={fn:"nema",nemaSize:Number(n[1])};for(let r of t.slice(1)){let i=r.match(/^([a-z]+)(.*)$/i);if(!i)throw Error(`Invalid NEMA token "${r}"`);let s=i[1].toLowerCase(),a=i[2],c,l;if(s in Lun)c=Lun[s],l=a;else if(["backfaceholes","backfacescrews","plainbackface"].includes(s)){if(a)throw Error(`NEMA flag "${s}" does not accept a value`);c="backFace",l=s==="backfaceholes"?"holes":s==="backfacescrews"?"screws":"plain"}else if(["wirestubs","nowires","jstph","jstsh"].includes(s)){let h=s==="jstph"||s==="jstsh";if(h&&!/^[1-9][0-9]*$/.test(a)||!h&&a)throw Error(`Invalid wire connection token "${r}"`);c="wireConnection",l=h?`jst-${s.slice(3)}-${a}`:s==="nowires"?"none":"stubs"}else if(s==="wirecount"){if(c="wireCount",!/^\d+$/.test(a))throw Error("wirecount requires an integer");l=Number(a)}else if(s==="backscrewm")c="backFaceScrewSize",l=`M${a}`;else if(s==="flatangle"||s==="wireangle"){if(c=s==="flatangle"?"shaftFlatAngle":"wireSideAngle",!/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:deg)?$/i.test(a))throw Error(`${s} requires a numeric angle in degrees`);l=Number(a.replace(/deg$/i,""))}else if(["round","dshaft","throughholes","blindholes"].includes(s)){if(a)throw Error(`NEMA flag "${s}" does not accept a value`);c=s==="round"||s==="dshaft"?"shaftShape":"mountingHoleThrough",l=s==="round"?"round":s==="dshaft"?"d":s==="throughholes"}else throw Error(`Unknown NEMA motor token "${r}"`);if(c in o)throw Error(`NEMA property "${c}" is set more than once`);o[c]=l}return CIe.parse(o)}var E0n=cu({name:"nema",schema:CIe,parse:awr});function cwr(e){e.register(E0n)}var Hun={panel:Pt(["base","left","right"]),u:Qh,v:Qh},Eet=ss("shape",[we({...Hun,shape:he("round"),diameter:Cs}).strict(),we({...Hun,shape:he("slot"),length:Cs,width:Cs,axis:Pt(["u","v"]).default("v")}).strict()]),M0n={profile:Pt(["plate","angle","channel"]).default("plate"),width:Cs,baseLength:Cs,flangeHeight:Cs.default(12),thickness:Cs.default(1),insideBendRadius:Cs.default(1),holes:it(Eet).max(100).default([])},w0n=we(M0n).strict(),bIe=we({fn:he("sheetmetal"),...M0n}).strict();function lwr(e,t){let n=e.match(/^(hole|slot)[1-9]\d*\(([^()]+)\)$/);if(!n)throw Error(`Invalid sheet metal feature "${e}"`);let o=n[1],r={};for(let m of n[2].split("_")){let A=m.match(/^(leftofcenter|rightofcenter|abovecenter|belowcenter|r|d|l|w)([0-9.].*)$/),g=A?.[1]??m;if(g in r)throw Error(`Duplicate ${g} in ${e}`);r[g]=A?.[2]??""}let i=new Set(["bottomface","angledface","leftface","rightface","leftofcenter","rightofcenter","abovecenter","belowcenter",...o==="hole"?["r","d"]:["l","w","horizontal","vertical"]]);for(let m of Object.keys(r))if(!i.has(m))throw Error(`Unknown ${m} in ${e}`);let s=["bottomface","angledface","leftface","rightface"].filter((m)=>(m in r));if(s.length!==1)throw Error(`Specify exactly one face in ${e}`);let a=s[0];if(a==="angledface"&&t!=="angle"||["leftface","rightface"].includes(a)&&t!=="channel")throw Error(`No ${a} on ${t}`);for(let[m,A]of[["leftofcenter","rightofcenter"],["abovecenter","belowcenter"],["horizontal","vertical"],["r","d"]])if(m in r&&A in r)throw Error(`Conflicting ${m} and ${A} in ${e}`);let c=(m)=>(m in r)?Cs.parse(r[m]):0,l=c("rightofcenter")-c("leftofcenter"),h=c("abovecenter")-c("belowcenter"),d=a==="bottomface"?"base":a==="leftface"?"left":"right",u={panel:d,u:d==="base"?l:h,v:d==="base"?h:l*(d==="left"?-1:1)};if(o==="hole"){if(!("r"in r)&&!("d"in r))throw Error(`Hole requires r or d in ${e}`);return Eet.parse({...u,shape:"round",diameter:"r"in r?2*c("r"):c("d")})}if(!("l"in r)||!("w"in r))throw Error(`Slot requires l and w in ${e}`);let _=c("l"),p=c("w");if(_<p)throw Error("Slot length must be at least its width");return Eet.parse({...u,shape:"slot",length:_,width:p,axis:d==="base"===!("vertical"in r)?"u":"v"})}var hwr={w:"width",l:"baseLength",h:"flangeHeight",t:"thickness",r:"insideBendRadius"};function dwr(e){let t={},n=ym(e.string);if(n[0]!=="sheetmetal")throw Error("Expected sheetmetal");let o=[],r=new Set;for(let s of n.slice(1)){if(/^(hole|slot)[1-9]\d*\(/.test(s)){let c=s.slice(0,s.indexOf("("));if(r.has(c))throw Error(`Duplicate feature "${c}"`);r.add(c),o.push(s);continue}if(["plate","angle","channel"].includes(s)){if(t.profile)throw Error("Duplicate sheet metal profile");t.profile=s;continue}let a=hwr[s[0]];if(!a||s.length<2)throw Error(`Unknown sheet metal token "${s}"`);if(a in t)throw Error(`Duplicate sheet metal property "${a}"`);t[a]=s.slice(1)}let i=bIe.parse({fn:"sheetmetal",...t});return i.holes=o.map((s)=>lwr(s,i.profile)),i}var B0n=cu({name:"sheetmetal",schema:bIe,parse:dwr});function uwr(e){e.register(B0n)}var pwr=Pt(["sitsFlat","sitsFlatBelowBoard","foldedToFaceAboveBoard","foldedToFaceBelowBoard","foldedToRightAngleAboveBoard","foldedToRightAngleBelowBoard"]),yet=Ae().finite().positive(),mwr=k().refine((e)=>{let t=e.split(":");if(t.length!==2)return!1;let n=Number(t[0]),o=Number(t[1]);return Number.isFinite(n)&&Number.isFinite(o)&&n>0&&o>0},'Aspect ratio must look like "16:9"').transform((e)=>e),Fun=un([yet,mwr,kC([yet,yet])]),zun=we({x:Qh.optional(),y:Qh.optional(),z:Qh.optional()}).strict(),xet=un([Ae().finite(),k().min(1)]),Oun=kC([xet,xet,xet]),_wr=["sitsFlat","sitsFlatBelowBoard","foldedToFaceAboveBoard","foldedToFaceBelowBoard","foldsAboveBoard","foldsBelowBoard","foldedToRightAngleAboveBoard","foldedToRightAngleBelowBoard"],T0n={width:Cs.optional(),height:Cs.optional(),diagonal:Cs.optional(),aspectRatio:Fun.optional(),ratio:Fun.optional(),defaultDiagonal:Cs.optional(),orientation:pwr.optional(),sitsFlat:Be().optional(),sitsFlatBelowBoard:Be().optional(),foldedToFaceAboveBoard:Be().optional(),foldedToFaceBelowBoard:Be().optional(),foldsAboveBoard:Be().optional(),foldsBelowBoard:Be().optional(),foldedToRightAngleAboveBoard:Be().optional(),foldedToRightAngleBelowBoard:Be().optional(),screenThickness:Cs.optional(),bezelInset:gy.optional(),bezelDepth:Cs.optional(),activeAreaWidth:Cs.optional(),activeAreaHeight:Cs.optional(),screenColor:k().min(1).optional(),bezelColor:k().min(1).optional(),showScreen:Be().optional(),flexCableLength:Cs.optional(),flexCableWidth:Cs.optional(),flexCableThickness:Cs.optional(),flexCableColor:k().min(1).optional(),pinCount:Ae().int().positive().optional(),pitch:Cs.optional(),padWidth:Cs.optional(),padLength:gy.optional(),tailLength:Cs.optional(),taperLength:Cs.optional(),conductorCount:Ae().int().positive().optional(),conductorPitch:Cs.optional(),conductorWidth:Cs.optional(),conductorThickness:Cs.optional(),conductorColor:k().min(1).optional(),cableEdgeMargin:gy.optional(),exposedContactLength:gy.optional(),showConductors:Be().optional(),showFlexCable:Be().optional(),showStiffeners:Be().optional(),stiffenerLength:gy.optional(),stiffenerThickness:Cs.optional(),stiffenerColor:k().min(1).optional(),bendRadius:Cs.optional(),bendSegments:Ae().int().min(2).optional(),rightAngleVerticalLead:gy.optional(),distanceAboveBoard:gy.optional(),distanceBelowBoard:gy.optional(),foldDistanceFromConnector:gy.optional(),foldOutset:Cs.optional(),foldSegments:Ae().int().min(4).optional(),screenGap:gy.optional(),boardTopZ:Qh.optional(),boardThickness:Cs.optional(),boardClearance:gy.optional(),cableStartX:Qh.optional(),cableStartY:Qh.optional(),cableStartZ:Qh.optional(),cableLateralOffset:Qh.optional(),screenOffset:zun.optional(),screenRotation:Oun.optional(),rotation:Oun.optional(),offset:zun.optional()},D0n=(e,t)=>{let n=_wr.filter((o)=>e[o]===!0);if(n.length>1)t(n[1])},N0n=(e,t)=>{if(e.flexCableLength===void 0)return;if(e.tailLength!==void 0&&e.tailLength>=e.flexCableLength)t.addIssue({code:"custom",message:"tailLength must be shorter than flexCableLength",path:["tailLength"]});if((e.tailLength??0)+(e.taperLength??0)>e.flexCableLength)t.addIssue({code:"custom",message:"tailLength and taperLength must fit within flexCableLength",path:["taperLength"]})},ZVs=we(T0n).strict().superRefine((e,t)=>{N0n(e,t),D0n(e,(n)=>{t.addIssue({code:"custom",message:"Only one FlexScreen orientation shortcut can be true",path:[n]})})}),IIe=we({fn:he("flexscreen"),...T0n}).strict().superRefine((e,t)=>{N0n(e,t),D0n(e,(n)=>{t.addIssue({code:"custom",message:"Only one FlexScreen orientation shortcut can be true",path:[n]})})}),gwr={sitsflat:"sitsFlat",sitsflatbelow:"sitsFlatBelowBoard",sitsflatbelowboard:"sitsFlatBelowBoard",foldsabove:"foldedToFaceAboveBoard",foldsaboveboard:"foldedToFaceAboveBoard",foldedtofaceaboveboard:"foldedToFaceAboveBoard",foldsbelow:"foldedToFaceBelowBoard",foldsbelowboard:"foldedToFaceBelowBoard",foldedtofacebelowboard:"foldedToFaceBelowBoard",rightangleabove:"foldedToRightAngleAboveBoard",rightangleaboveboard:"foldedToRightAngleAboveBoard",foldedtorightangleaboveboard:"foldedToRightAngleAboveBoard",rightanglebelow:"foldedToRightAngleBelowBoard",rightanglebelowboard:"foldedToRightAngleBelowBoard",foldedtorightanglebelowboard:"foldedToRightAngleBelowBoard"},Awr={width:["width","w"],height:["height","h"],diagonal:["diagonal","diag","d"],defaultDiagonal:["defaultdiagonal","defaultdiag"],screenThickness:["screenthickness"],bezelInset:["bezelinset"],bezelDepth:["bezeldepth"],activeAreaWidth:["activeareawidth","activew"],activeAreaHeight:["activeareaheight","activeh"],flexCableLength:["flexcablelength","flexlength","flex"],flexCableWidth:["flexcablewidth","flexwidth"],flexCableThickness:["flexcablethickness","flexthickness"],pitch:["pitch","p"],padWidth:["padwidth","pw"],padLength:["padlength","pl"],tailLength:["taillength","tail"],taperLength:["taperlength","taper"],conductorPitch:["conductorpitch"],conductorWidth:["conductorwidth"],conductorThickness:["conductorthickness"],cableEdgeMargin:["cableedgemargin","edgemargin"],exposedContactLength:["exposedcontactlength","contactlength"],stiffenerLength:["stiffenerlength"],stiffenerThickness:["stiffenerthickness"],bendRadius:["bendradius"],rightAngleVerticalLead:["rightangleverticallead","verticallead"],distanceAboveBoard:["distanceaboveboard","distanceabove"],distanceBelowBoard:["distancebelowboard","distancebelow"],foldDistanceFromConnector:["folddistancefromconnector","folddistance","foldstart"],foldOutset:["foldoutset","outset"],screenGap:["screengap"],boardTopZ:["boardtopz"],boardThickness:["boardthickness"],boardClearance:["boardclearance"],cableStartX:["cablestartx"],cableStartY:["cablestarty"],cableStartZ:["cablestartz"],cableLateralOffset:["cablelateraloffset","lateraloffset"]},fwr=Object.fromEntries(Object.entries(Awr).flatMap(([e,t])=>t.map((n)=>[n,e]))),ywr={num_pins:"pinCount",pincount:"pinCount",conductorcount:"conductorCount",conductors:"conductorCount",bendsegments:"bendSegments",foldsegments:"foldSegments"},Vun={showscreen:["showScreen",!0],hidescreen:["showScreen",!1],showflex:["showFlexCable",!0],hideflex:["showFlexCable",!1],showconductors:["showConductors",!0],hideconductors:["showConductors",!1],showstiffeners:["showStiffeners",!0],hidestiffeners:["showStiffeners",!1]},xwr={screencolor:"screenColor",bezelcolor:"bezelColor",flexcolor:"flexCableColor",conductorcolor:"conductorColor",stiffenercolor:"stiffenerColor"},Cwr=(e)=>{let t=String(e).toLowerCase().replace("x",":");if(t.includes(":")){let[o,r,i]=t.split(":"),s=Number(o),a=Number(r);if(i!==void 0||!Number.isFinite(s)||!Number.isFinite(a)||s<=0||a<=0)throw Error(`Invalid FlexScreen aspect ratio "${String(e)}"`);return`${s}:${a}`}let n=Number(t);if(!Number.isFinite(n)||n<=0)throw Error(`Invalid FlexScreen aspect ratio "${String(e)}"`);return n},bwr=(e,t)=>{if(typeof e!=="string"||!/^\(.+\)$/.test(e))throw Error(`FlexScreen token "${t}" requires a value in (...)`);return e.slice(1,-1)},Yun=(e,t)=>{if(e!==!0)throw Error(`FlexScreen token "${t}" does not accept a value`)},Iwr=(e)=>{if(e.fn!=="flexscreen")throw Error(`Expected FlexScreen params, got "${e.fn}"`);let t={},n,o;for(let[r,i]of Object.entries(e)){if(r==="fn"||r==="string"||r==="flexscreen")continue;let s=gwr[r];if(s){if(Yun(i,r),n&&n!==s)throw Error("A FlexScreen model string can only set one orientation");n=s,t.orientation=s;continue}if(r in Vun){Yun(i,r);let[h,d]=Vun[r];t[h]=d;continue}let a=xwr[r];if(a){t[a]=bwr(i,r);continue}if(r==="ratio"){t.aspectRatio=Cwr(i);continue}let c=fwr[r];if(c){t[c]=i;continue}if(r==="distance"){o=i;continue}let l=ywr[r];if(l){let h=Number(i);if(!Number.isInteger(h)||h<1)throw Error(`Invalid positive integer in FlexScreen token "${r}${String(i)}"`);t[l]=h;continue}throw Error(`Unknown FlexScreen model token "${r}${String(i)}"`)}if(o!==void 0)if(n==="foldedToFaceAboveBoard")t.distanceAboveBoard=o;else if(n==="foldedToFaceBelowBoard")t.distanceBelowBoard=o;else throw Error('The "distance" token requires foldsabove or foldsbelow; use distanceabove or distancebelow for an explicit side');return IIe.parse({fn:"flexscreen",...t})},R0n=cu({name:"flexscreen",schema:IIe,parse:Iwr});function vwr(e){e.register(R0n)}var Swr=(e)=>{if(e.fn!=="hexsocketbolt")throw Error(`Expected hexsocketbolt params, got "${e.fn}"`);let t=e.string.split("_");if(t[0]?.toLowerCase()!=="hexsocketbolt")throw Error("The hexsocketbolt function does not accept an inline value");let n=new Set;for(let r of t.slice(1)){let i=r.match(/^[a-z]+/i)?.[0]?.toLowerCase();if(i&&n.has(i))throw Error(`Duplicate bolt token "${i}"`);if(i)n.add(i)}let o={};for(let[r,i]of Object.entries(e)){if(["fn","string","hexsocketbolt"].includes(r))continue;let s,a=i;if(r==="m")s="metricSize",a=`M${String(i)}`;else if(r==="l"||r==="length")s="length";else if(r==="threads"||r==="nothreads"){if(i!==!0)throw Error(`Bolt token "${r}" does not accept a value`);s="showThreads",a=r==="threads"}else throw Error(`Unknown hex socket bolt model token "${r}${String(i)}"`);if(s in o)throw Error(`Bolt property "${s}" is set more than once`);o[s]=a}return yIe.parse({fn:"hexsocketbolt",...o})},Q0n=cu({name:"hexsocketbolt",schema:yIe,parse:Swr});function Pwr(e){e.register(Q0n)}var Gun={m:"module",module:"module",w:"faceWidth",width:"faceWidth",facewidth:"faceWidth",bore:"boreDiameter",borediameter:"boreDiameter",backlash:"backlash",clearance:"clearance",hubdiameter:"hubDiameter",hublength:"hubLength"};function Ewr(e){let t=e.string.split("_"),n=t[0]?.match(/^spurgear(\d+)?$/i);if(!n||e.fn!=="spurgear")throw Error("Expected spurgear with an optional inline tooth count");let o={fn:"spurgear"};if(n[1])o.toothCount=FV(n[1],"toothCount");for(let r of t.slice(1)){let[i,s]=nJ(r),a,c;if(i in Gun)a=Gun[i],c=s;else if(i==="teeth"||i==="segments")a=i==="teeth"?"toothCount":"segmentsPerTooth",c=FV(s,a);else if(i==="pa"||i==="pressureangle"||i==="phase")a=i==="phase"?"phase":"pressureAngle",c=gIe(s,a);else throw Error(`Unknown spur gear token "${r}"`);if(a in o)throw Error(`Spur gear property "${a}" is set more than once`);o[a]=c}return AIe.parse(o)}var k0n=cu({name:"spurgear",schema:AIe,parse:Ewr});function Mwr(e){e.register(k0n)}var L0n={module:Vu.default(1),pitchDiameter:Vu.default(10),length:Vu.default(20),starts:Ae().int().min(1).max(8).default(1),pressureAngle:p0n.default(20),backlash:f9.default(0),clearance:f9.default(0.25),boreDiameter:f9.default(0),handedness:Pt(["right","left"]).default("right"),phase:Ae().finite().default(0),radialSegments:Ae().int().min(24).max(256).refine((e)=>e%4===0,"Radial segments must be divisible by four").default(96),segmentsPerTurn:Ae().int().min(12).max(128).default(32)};function H0n(e){let t=Math.PI*e.module,n=e.starts*t;return{pitchDiameter:e.pitchDiameter,outsideDiameter:e.pitchDiameter+2*e.module,rootDiameter:e.pitchDiameter-2*(e.module+e.clearance),axialPitch:t,lead:n,leadAngle:Math.atan(n/(Math.PI*e.pitchDiameter))*180/Math.PI,toothThickness:t/2-e.backlash}}function F0n(e,t){let n=(a,c)=>t.addIssue({code:"custom",message:a,path:c?[c]:[]}),o=H0n(e);if(Object.values(o).some((a)=>!Number.isFinite(a))){n("Derived worm dimensions must be finite");return}if(o.rootDiameter<=0){n("Dedendum must leave a positive root diameter","pitchDiameter");return}if(e.boreDiameter>=o.rootDiameter)n("Bore diameter must be smaller than the root diameter","boreDiameter");let r=Math.tan(e.pressureAngle*Math.PI/180),i=o.toothThickness-2*e.module*r,s=o.toothThickness+2*(e.module+e.clearance)*r;if(!Number.isFinite(i)||i<=0)n("Axial tooth tip must have positive thickness","backlash");if(!Number.isFinite(s)||s>=o.axialPitch)n("Adjacent threads must leave a positive root gap","pressureAngle")}var Det=we(L0n).strict().superRefine(F0n),vIe=we({fn:he("wormgear"),...L0n}).strict().superRefine(F0n),z0n=(e={})=>H0n(Det.parse(e)),Uun={m:"module",module:"module",d:"pitchDiameter",pitchdiameter:"pitchDiameter",l:"length",length:"length",bore:"boreDiameter",borediameter:"boreDiameter",backlash:"backlash",clearance:"clearance"};function wwr(e){let t=e.string.split("_");if(t[0]?.toLowerCase()!=="wormgear"||e.fn!=="wormgear")throw Error("The wormgear function does not accept an inline value");let n={fn:"wormgear"};for(let o of t.slice(1)){let[r,i]=nJ(o),s,a;if(r in Uun)s=Uun[r],a=i;else if(["starts","segments","turnsegments"].includes(r))s=r==="starts"?"starts":r==="segments"?"radialSegments":"segmentsPerTurn",a=FV(i,s);else if(r==="pa"||r==="pressureangle"||r==="phase")s=r==="phase"?"phase":"pressureAngle",a=gIe(i,s);else if(r==="right"||r==="left"){if(i)throw Error(`Worm flag "${r}" does not accept a value`);s="handedness",a=r}else throw Error(`Unknown worm gear token "${o}"`);if(s in n)throw Error(`Worm gear property "${s}" is set more than once`);n[s]=a}return vIe.parse(n)}var O0n=cu({name:"wormgear",schema:vIe,parse:wwr});function Bwr(e){e.register(O0n)}var V0n={"608":{innerDiameter:8,outerDiameter:22,width:7},"625":{innerDiameter:5,outerDiameter:16,width:5},"624":{innerDiameter:4,outerDiameter:13,width:5},"6000":{innerDiameter:10,outerDiameter:26,width:8},"6001":{innerDiameter:12,outerDiameter:28,width:8},"6002":{innerDiameter:15,outerDiameter:32,width:9}},Twr={innerDiameter:8,outerDiameter:22,width:7},Dwr=Pt(["608","625","624","6000","6001","6002"]),Cet=un([Ae(),k().regex(/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:mm|cm|m|in|inch|mil|ft|feet)?$/i).transform((e)=>e.toLowerCase())]).pipe(Qh).refine((e)=>e>0,"Length must be positive"),Y0n={innerDiameter:Cet.optional(),outerDiameter:Cet.optional(),width:Cet.optional(),code:Dwr.optional(),bothSidesOpen:Be().optional(),bothSidesShielded:Be().optional(),bothSidesSealed:Be().optional(),topSideOpen:Be().optional(),topSideShielded:Be().optional(),topSideSealed:Be().optional(),bottomSideOpen:Be().optional(),bottomSideShielded:Be().optional(),bottomSideSealed:Be().optional()};function G0n(e,t){let n=e.code===void 0?Twr:V0n[e.code],o=["Open","Shielded","Sealed"],r=o.filter((l)=>e[`bothSides${l}`]===!0);if(r.length>1)t.addIssue({code:"custom",message:"Both-side flags conflict"});let i=(l)=>{let h=o.filter((u)=>e[`${l}Side${u}`]===!0),d=o.some((u)=>e[`${l}Side${u}`]!==void 0);if(h.length>1||d&&h.length===0)t.addIssue({code:"custom",message:`${l} face must select exactly one flag`});return h[0]??r[0]??"Open"},s=i("top"),a=i("bottom"),c={innerDiameter:e.innerDiameter??n.innerDiameter,outerDiameter:e.outerDiameter??n.outerDiameter,width:e.width??n.width,topSideOpen:s==="Open",topSideShielded:s==="Shielded",topSideSealed:s==="Sealed",bottomSideOpen:a==="Open",bottomSideShielded:a==="Shielded",bottomSideSealed:a==="Sealed"};if(e.code!==void 0){for(let l of["innerDiameter","outerDiameter","width"])if(Math.abs(c[l]-n[l])>0.000000001)t.addIssue({code:"custom",path:[l],message:`Dimension conflicts with bearing designation ${e.code}`})}if(c.innerDiameter>=c.outerDiameter)t.addIssue({code:"custom",path:["innerDiameter"],message:"Inner diameter must be smaller than outer diameter"});return c}var Nwr=we(Y0n).strict().transform(G0n),SIe=we({fn:he("ballbearing"),...Y0n}).strict().transform((e,t)=>({fn:e.fn,...G0n(e,t)}));function U0n(e={}){let t=Nwr.parse(e),n=t.innerDiameter/2,o=t.outerDiameter/2,r=(n+o)/2,i=8,s=Math.min((o-n)*0.28,t.width*0.3,r*Math.sin(Math.PI/8)*0.85),a=r-0.9*s,c=r+0.9*s,l=1.03*s;return{...t,boreRadius:n,outerRadius:o,pitchRadius:r,ballCount:8,ballRadius:s,innerRaceOuterRadius:a,outerRaceInnerRadius:c,grooveRadius:l,grooveHalfWidth:s*Math.sqrt(0.2508999999999999),rimChamfer:Math.min(t.width*0.035,(a-n)*0.1,(o-c)*0.1),closureThickness:t.width*0.1,cageInnerRadius:r-0.16*s,cageOuterRadius:r+0.16*s,cageSeparatorHalfAngle:Math.PI/8-Math.asin(1.1*s/r),midZ:t.width/2}}var Wun={id:"innerDiameter",innerdiameter:"innerDiameter",od:"outerDiameter",outerdiameter:"outerDiameter",w:"width",width:"width"},Xun={open:"bothSidesOpen",bothsidesopen:"bothSidesOpen",shielded:"bothSidesShielded",bothsidesshielded:"bothSidesShielded",sealed:"bothSidesSealed",bothsidessealed:"bothSidesSealed",topsideopen:"topSideOpen",topsideshielded:"topSideShielded",topsidesealed:"topSideSealed",bottomsideopen:"bottomSideOpen",bottomsideshielded:"bottomSideShielded",bottomsidesealed:"bottomSideSealed"},Rwr=["","z","zz","2z","rs","2rs"];function W0n(e){let t=ym(e.string),n=t[0]?.toLowerCase()??"";if(e.fn!=="ballbearing")throw Error("Expected ballbearing");let o={fn:"ballbearing"},r="";if(n!=="ballbearing"){let s=n.slice(11),a=Object.keys(V0n).sort((c,l)=>l.length-c.length).find((c)=>s.startsWith(c)&&Rwr.some((l)=>s===c+l));if(!n.startsWith("ballbearing")||!a)throw Error(`Unsupported ballbearing designation "${n}"`);o.code=a,r=s.slice(a.length)}let i=new Set;for(let s of t.slice(1)){let a=s.toLowerCase();if(Object.hasOwn(Xun,a)){let u=Xun[a],_=u.startsWith("both")?"both":u.startsWith("top")?"top":"bottom";if(i.has(_))throw Error(`ballbearing ${_} face flags are repeated or conflict`);i.add(_),o[u]=!0;continue}let c=s.match(/^([a-z]+)(.*)$/i);if(!c)throw Error(`Invalid ballbearing token "${s}"`);let l=c[1].toLowerCase(),h=c[2],d;if(Object.hasOwn(Wun,l))d=Wun[l];else if(l==="code"){if(d="code",!/^\d+$/.test(h))throw Error("Bearing code must be a complete numeric designation")}else throw Error(`Unknown ballbearing token "${s}"`);if(Object.hasOwn(o,d))throw Error(`ballbearing property "${d}" is set more than once`);o[d]=h}if(!i.has("both")){let s=r==="zz"||r==="2z"?"Shielded":r==="2rs"?"Sealed":"Open";if(o[`bothSides${s}`]=!0,!i.has("bottom")&&(r==="z"||r==="rs"))o[r==="z"?"bottomSideShielded":"bottomSideSealed"]=!0}return SIe.parse(o)}function bet(e){let t=String(e);if(!t.includes("e"))return t;let[n,o]=t.split("e"),[r,i=""]=n.split("."),s=r+i,a=r.length+Number(o);if(a<=0)return`0.${"0".repeat(-a)}${s}`;if(a>=s.length)return s+"0".repeat(a-s.length);return`${s.slice(0,a)}.${s.slice(a)}`}function Qwr(e){let t=W0n(Met(e)),n=t.topSideOpen?"open":t.topSideShielded?"shielded":"sealed",o=t.bottomSideOpen?"open":t.bottomSideShielded?"shielded":"sealed",r=n===o?`bothsides${n}`:`topside${n}_bottomside${o}`;return`ballbearing_id${bet(t.innerDiameter)}mm_od${bet(t.outerDiameter)}mm_w${bet(t.width)}mm_${r}`}var X0n=cu({name:"ballbearing",schema:SIe,parse:W0n,normalizeString:Qwr});function kwr(e){e.register(X0n)}var Net={M3:{diameter:3,threadPitch:0.5,headDiameter:5.7,headHeight:1.65,crownFlatDiameter:2.6,crownRadius:3.5,socketWidth:2,socketDepth:1.04,underHeadRadius:0.3,referenceThreadLength:18},M4:{diameter:4,threadPitch:0.7,headDiameter:7.6,headHeight:2.2,crownFlatDiameter:3.8,crownRadius:4.4,socketWidth:2.5,socketDepth:1.3,underHeadRadius:0.4,referenceThreadLength:20},M5:{diameter:5,threadPitch:0.8,headDiameter:9.5,headHeight:2.75,crownFlatDiameter:5,crownRadius:5.5,socketWidth:3,socketDepth:1.56,underHeadRadius:0.45,referenceThreadLength:22},M6:{diameter:6,threadPitch:1,headDiameter:10.5,headHeight:3.3,crownFlatDiameter:6,crownRadius:5.9,socketWidth:4,socketDepth:2.08,underHeadRadius:0.5,referenceThreadLength:24}},jun=un([Ae(),k().regex(/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:mm|cm|m|in|inch|mil|ft|feet)?$/i).transform((e)=>e.toLowerCase())]).pipe(Qh).refine((e)=>e>0,"Length must be positive"),Lwr=Pt(["M3","M4","M5","M6"]),j0n={standard:Pt(["iso7380-1","iso7380-1:2022"]).default("iso7380-1").transform(()=>"iso7380-1:2022"),metricSize:Lwr,length:jun,drive:he("hexsocket").default("hexsocket"),thread:he("full").default("full"),threadPitch:jun.optional(),threadHand:he("right").default("right"),threadClass:he("6g").default("6g"),showThreads:Be().default(!0)};function K0n(e,t){let n=Net[e.metricSize];if(e.threadPitch!==void 0&&Math.abs(e.threadPitch-n.threadPitch)>0.000000001)t.addIssue({code:"custom",path:["threadPitch"],message:"ISO 7380-1 requires the tabulated coarse pitch"});if(e.length>n.referenceThreadLength)t.addIssue({code:"custom",path:["length"],message:"This family supports only lengths at or below the reference full-thread length"});if(e.length<2*n.threadPitch)t.addIssue({code:"custom",path:["length"],message:"Length must allow the fixed thread runout and tip chamfer"})}function $0n(e){return{...e,threadPitch:Net[e.metricSize].threadPitch}}var Ret=we(j0n).strict().superRefine(K0n).transform($0n),PIe=we({fn:he("buttonscrew"),...j0n}).strict().superRefine(K0n).transform($0n);function q0n(e){let t=Ret.parse(e),n=Net[t.metricSize],o=n.crownFlatDiameter/2-n.headDiameter/2,r=n.headHeight,i=Math.hypot(o,r),s=Math.sqrt(n.crownRadius**2-i**2/4);return{...n,length:t.length,overallLength:t.length+n.headHeight,crownArcCenterR:(n.headDiameter+n.crownFlatDiameter)/4-s*r/i,crownArcCenterZ:r/2+s*o/i,threadMinorDiameter:n.diameter-5*Math.sqrt(3)/8*n.threadPitch,threadPitchDiameter:n.diameter-3*Math.sqrt(3)/8*n.threadPitch,threadRunoutLength:n.threadPitch,tipChamfer:n.threadPitch/2,bearingZ:0,tipZ:-t.length,topZ:n.headHeight}}function Hwr(e){let t=ym(e.string);if(e.fn!=="buttonscrew"||t[0]?.toLowerCase()!=="buttonscrew")throw Error("Expected buttonscrew without an inline argument");let n={fn:"buttonscrew"},o={l:"length",length:"length",threadpitch:"threadPitch"},r={standard:"standard",drive:"drive",thread:"thread",threadhand:"threadHand",threadclass:"threadClass"};for(let i of t.slice(1)){let s=i.match(/^([a-z]+)(.*)$/i);if(!s)throw Error(`Invalid button screw token "${i}"`);let a=s[1].toLowerCase(),c=s[2],l,h=c;if(a==="m")l="metricSize",h=`M${c}`;else if(a in o)l=o[a];else if(a in r){if(l=r[a],!/^\([^()]+\)$/.test(c))throw Error(`Expected a parenthesized ${a}`);h=c.slice(1,-1).toLowerCase()}else if(a==="threads"||a==="nothreads"){if(c)throw Error("Thread visibility flags cannot have a value");l="showThreads",h=a==="threads"}else throw Error(`Unknown button screw token "${i}"`);if(l in n)throw Error(`Duplicate button screw property "${l}"`);n[l]=h}return PIe.parse(n)}var J0n=cu({name:"buttonscrew",schema:PIe,parse:Hwr});function Fwr(e){e.register(J0n)}var eJ=un([Ae(),k().regex(/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:mm|cm|m|in|inch|mil|ft|feet)?$/i,"Expected a complete numeric length with an optional unit")]).pipe(Cs),Z0n={panelHoleDiameter:eJ,innerDiameter:eJ,outerDiameter:eJ,height:eJ,grooveWidth:eJ,grooveDepth:eJ,shape:he("symmetricring").default("symmetricring")};function epn(e,t){if(e.innerDiameter>=e.panelHoleDiameter||e.panelHoleDiameter>=e.outerDiameter)t.addIssue({code:"custom",path:["panelHoleDiameter"],message:"Diameters must satisfy ID < panel hole < OD"});if(e.grooveWidth>=e.height)t.addIssue({code:"custom",path:["grooveWidth"],message:"Groove width must leave two positive-thickness flanges"});let n=e.outerDiameter-2*e.grooveDepth,o=0.000000001*e.outerDiameter;if(!Number.isFinite(n)||Math.abs(n-e.panelHoleDiameter)>o)t.addIssue({code:"custom",path:["grooveDepth"],message:"Panel hole must equal OD minus twice the radial groove depth"});if((n-e.innerDiameter)/2<=0||(e.height-e.grooveWidth)/2<=0)t.addIssue({code:"custom",message:"Derived root wall and flange thicknesses must be positive"})}var Qet=we(Z0n).strict().superRefine(epn),EIe=we({fn:he("cablegrommet"),...Z0n}).strict().superRefine(epn);function tpn(e){let t=Qet.parse(e),n=t.outerDiameter-2*t.grooveDepth;return{grooveRootDiameter:n,flangeThickness:(t.height-t.grooveWidth)/2,minimumWallThickness:(n-t.innerDiameter)/2,grooveStartZ:-t.grooveWidth/2,grooveEndZ:t.grooveWidth/2}}var Kun={panelhole:"panelHoleDiameter",panelholediameter:"panelHoleDiameter",id:"innerDiameter",innerdiameter:"innerDiameter",od:"outerDiameter",outerdiameter:"outerDiameter",h:"height",height:"height",groovew:"grooveWidth",groovewidth:"grooveWidth",grooved:"grooveDepth",groovedepth:"grooveDepth"};function zwr(e){let t=ym(e.string);if(e.fn!=="cablegrommet"||!/^cablegrommet$/i.test(t[0]))throw Error("Expected cablegrommet without an inline value");let n={fn:"cablegrommet"};for(let o of t.slice(1)){let r=o.match(/^([a-z]+)(.*)$/i),i=r?.[1]?.toLowerCase(),s=r?.[2];if(!i||!s)throw Error(`Invalid grommet token "${o}"`);let a,c=s;if(i in Kun)a=Kun[i];else if(i==="shape"){a="shape";let l=s.match(/^\(([a-z]+)\)$/i);if(!l)throw Error("Grommet shape requires parentheses");c=l[1].toLowerCase()}else throw Error(`Unknown grommet token "${o}"`);if(a in n)throw Error(`Grommet property "${a}" is set more than once`);n[a]=c}return EIe.parse(n)}var npn=cu({name:"cablegrommet",schema:EIe,parse:zwr});function Owr(e){e.register(npn)}var opn=un([Ae().finite(),k().regex(/^[+]?(?:\d+(?:\.\d*)?|\.\d+)(?:mm|cm|m|in|inch|mil|ft|feet)?$/i,"Expected a complete length with a supported unit").transform((e)=>e.toLowerCase())]).pipe(Qh),HQ=opn.refine((e)=>e>0,"Length must be positive"),Vwr=opn.refine((e)=>e>=0,"Length cannot be negative"),rpn={boreDiameter:HQ,outerDiameter:HQ,width:HQ,screwZ:HQ.optional(),splitWidth:HQ,clampX:HQ.optional(),clearanceHoleDiameter:HQ.optional(),mount:he("singleclamp").default("singleclamp"),metricSize:ghe,threadPitch:HQ.optional(),threadHand:Pt(["right","left"]).default("right"),threadClass:he("6H").default("6H"),chamfer:Vwr.default(0)};function ket(e){let t=Vx[e.metricSize].diameter,n=e.threadPitch??Vx[e.metricSize].threadPitch;return{...e,threadPitch:n,screwZ:e.screwZ??e.width/2,clampX:e.clampX??(e.outerDiameter+e.boreDiameter)/4,clearanceHoleDiameter:e.clearanceHoleDiameter??t+0.5}}function ipn(e,t){let n=ket(e),o=(c)=>t.addIssue({code:"custom",message:c}),r=Vx[n.metricSize].diameter;if(!Number.isFinite(n.outerDiameter**2))o("Derived dimensions must be finite");let i=(n.outerDiameter-n.boreDiameter)/2;if(i<=0)o("Outer diameter must exceed the bore diameter");if(n.threadPitch>=r)o("Thread pitch must be smaller than its nominal diameter");if(n.splitWidth>=n.boreDiameter)o("Split width must be smaller than the shaft bore");if(n.clearanceHoleDiameter<=r)o("Clearance hole diameter must exceed the thread diameter");let s=n.clearanceHoleDiameter/2;if(n.clampX-s<=n.boreDiameter/2||n.clampX+s>=n.outerDiameter/2)o("Clamp hole must fit within the radial wall without intersecting the shaft bore");if(n.screwZ-s<=n.chamfer||n.screwZ+s>=n.width-n.chamfer)o("Clamp hole must clear both end faces and chamfers");if(n.chamfer>=i/2||n.chamfer>=n.width/2)o("Chamfer must leave material between the bore and exterior");let a=n.outerDiameter/2;if(n.clampX+s<a&&n.splitWidth/2>=Math.sqrt(a**2-(n.clampX+s)**2))o("Split must leave material around both sides of the clamping bore")}var Let=we(rpn).strict().superRefine(ipn).transform(ket),MIe=we({fn:he("clampingshaftcollar"),...rpn}).strict().superRefine(ipn).transform((e)=>({fn:e.fn,...ket(e)}));function spn(e){let t=Let.parse(e),n=Vx[t.metricSize].diameter,o=t.outerDiameter/2,r=Math.sqrt(o**2-(t.clampX-t.clearanceHoleDiameter/2)**2),i=Math.sqrt(o**2-(t.clampX-n/2)**2);return{threadDiameter:n,split:{xMin:0,xMax:o,yMin:-t.splitWidth/2,yMax:t.splitWidth/2,zMin:0,zMax:t.width},clearanceHole:{start:[t.clampX,-r,t.screwZ],direction:[0,1,0],diameter:t.clearanceHoleDiameter,depth:r-t.splitWidth/2},threadedHole:{start:[t.clampX,t.splitWidth/2,t.screwZ],direction:[0,1,0],diameter:n,depth:i-t.splitWidth/2,threadPitch:t.threadPitch,threadHand:t.threadHand,threadGender:"female",threadClass:t.threadClass}}}var Ywr={bore:"boreDiameter",od:"outerDiameter",mount:"mount",m:"metricSize",threadpitch:"threadPitch",threadhand:"threadHand",threadclass:"threadClass",chamfer:"chamfer",w:"width",width:"width",screwz:"screwZ",split:"splitWidth",clampx:"clampX",clearance:"clearanceHoleDiameter"};function Gwr(e){let t=ym(e.string);if(e.fn!=="clampingshaftcollar"||t[0]?.toLowerCase()!=="clampingshaftcollar")throw Error("Expected an unadorned clampingshaftcollar function");let n={};for(let o of t.slice(1)){let r=o.match(/^([a-z]+)(.*)$/i),i=r?.[1]?.toLowerCase()??"",s=Ywr[i];if(!s)throw Error(`Unknown clampingshaftcollar token "${o}"`);if(s in n)throw Error(`Duplicate clampingshaftcollar property "${s}"`);let a=r[2];if(!a)throw Error(`Token "${i}" requires a value`);if(["mount","threadHand","threadClass"].includes(s)){let c=a.match(/^\(([^()]+)\)$/);if(!c)throw Error(`Token "${i}" requires one parenthesized argument`);n[s]=s==="threadClass"?c[1].toUpperCase():c[1].toLowerCase()}else if(s==="metricSize"){if(!/^\d+(?:\.\d+)?$/.test(a))throw Error("m requires a unitless metric designation");n[s]=`M${a}`}else n[s]=a}return MIe.parse({fn:"clampingshaftcollar",...n})}var apn=cu({name:"clampingshaftcollar",schema:MIe,parse:Gwr});function Uwr(e){e.register(apn)}var Iet=un([Ae(),k().regex(/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:mm|cm|m|in|inch|mil|ft|feet)?$/i).transform((e)=>e.toLowerCase())]).pipe(Qh).refine((e)=>e>0,"Length must be positive"),$un=Ae().int().min(1).max(Number.MAX_SAFE_INTEGER),cpn={spec:he("custom").default("custom"),outerDiameter:Iet,wireDiameter:Iet,freeLength:Iet,totalTurns:$un.min(3),activeTurns:$un.optional(),ends:he("closedground").default("closedground"),hand:Pt(["right","left"]).default("right"),state:he("free").default("free")};function lpn(e,t){if(e.outerDiameter<=2*e.wireDiameter)t.addIssue({code:"custom",path:["outerDiameter"],message:"Outer diameter must exceed twice the wire diameter to leave a positive bore"});if(e.activeTurns!==void 0&&e.activeTurns!==e.totalTurns-2)t.addIssue({code:"custom",path:["activeTurns"],message:"Closed-ground ends require totalTurns = activeTurns + 2"});let n=e.totalTurns*e.wireDiameter;if(!Number.isFinite(n)||e.freeLength<=n)t.addIssue({code:"custom",path:["freeLength"],message:"Free length must exceed the finite solid height totalTurns * wireDiameter"})}function hpn(e){return{...e,activeTurns:e.activeTurns??e.totalTurns-2}}var wIe=we(cpn).strict().superRefine(lpn).transform(hpn),BIe=we({fn:he("compressionspring"),...cpn}).strict().superRefine(lpn).transform(hpn);function dpn(e){let t=wIe.parse(e);return{outerDiameter:t.outerDiameter,wireDiameter:t.wireDiameter,insideDiameter:t.outerDiameter-2*t.wireDiameter,meanDiameter:t.outerDiameter-t.wireDiameter,freeLength:t.freeLength,totalTurns:t.totalTurns,activeTurns:t.activeTurns,endTurns:1,endPitch:t.wireDiameter,activePitch:(t.freeLength-2*t.wireDiameter)/t.activeTurns,solidHeight:t.totalTurns*t.wireDiameter,availableTravel:t.freeLength-t.totalTurns*t.wireDiameter,lowerBearingZ:0,upperBearingZ:t.freeLength}}function upn(e,t){let n=wIe.parse(e);if(!Number.isFinite(t)||t<0||t>n.totalTurns)throw Error("Turn coordinate must be finite and within [0,totalTurns]");let o=(n.outerDiameter-n.wireDiameter)/2,r=(n.freeLength-2*n.wireDiameter)/n.activeTurns,i=(n.hand==="right"?1:-1)*2*Math.PI*(t%1),s=t<=1?n.wireDiameter*t:t>=n.totalTurns-1?n.freeLength-n.wireDiameter*(n.totalTurns-t):n.wireDiameter+r*(t-1);return{x:o*Math.cos(i),y:o*Math.sin(i),z:s}}function Wwr(e){let t=ym(e.string);if(e.fn!=="compressionspring"||t[0]?.toLowerCase()!=="compressionspring")throw Error("Expected compressionspring without an inline argument");let n={fn:"compressionspring"},o={od:"outerDiameter",wire:"wireDiameter",l:"freeLength",length:"freeLength",freelength:"freeLength"},r={spec:"spec",ends:"ends",hand:"hand",state:"state"};for(let i of t.slice(1)){let s=i.match(/^([a-z]+)(.*)$/i);if(!s)throw Error(`Invalid compression spring token "${i}"`);let a=s[1].toLowerCase(),c=s[2],l,h=c;if(a in o)l=o[a];else if(a==="turns"||a==="active"){if(l=a==="turns"?"totalTurns":"activeTurns",!/^\d+$/.test(c))throw Error(`${a} requires a unitless integer`);h=Number(c)}else if(a in r){if(l=r[a],!/^\([^()]+\)$/.test(c))throw Error(`Expected a parenthesized ${a}`);h=c.slice(1,-1).toLowerCase()}else throw Error(`Unknown compression spring token "${i}"`);if(l in n)throw Error(`Duplicate compression spring property "${l}"`);n[l]=h}return BIe.parse(n)}var ppn=cu({name:"compressionspring",schema:BIe,parse:Wwr});function Xwr(e){e.register(ppn)}var uhe=un([Ae(),k().regex(/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:mm|cm|m|in|inch|mil|ft|feet)?$/i).transform((e)=>e.toLowerCase())]).pipe(Qh).refine((e)=>e>0),mpn={innerDiameter:uhe,outerDiameter:uhe,flangeDiameter:uhe,length:uhe,flangeThickness:uhe,style:he("plainclosed").default("plainclosed")};function _pn(e,t){if(e.outerDiameter<=e.innerDiameter)t.addIssue({code:"custom",path:["outerDiameter"],message:"Sleeve outside diameter must exceed the bore diameter"});if(e.flangeDiameter<=e.outerDiameter)t.addIssue({code:"custom",path:["flangeDiameter"],message:"Flange diameter must exceed the sleeve outside diameter"});if(e.flangeThickness>=e.length)t.addIssue({code:"custom",path:["flangeThickness"],message:"Flange thickness must leave a positive projecting sleeve length"})}var Het=we(mpn).strict().superRefine(_pn),TIe=we({fn:he("flangedbushing"),...mpn}).strict().superRefine(_pn);function gpn(e){let t=Het.parse(e);return{innerDiameter:t.innerDiameter,outerDiameter:t.outerDiameter,flangeDiameter:t.flangeDiameter,length:t.length,flangeThickness:t.flangeThickness,sleeveLength:t.length-t.flangeThickness,wallThickness:(t.outerDiameter-t.innerDiameter)/2,flangeProjection:(t.flangeDiameter-t.outerDiameter)/2,shoulderZ:t.flangeThickness}}var qun={id:"innerDiameter",innerdiameter:"innerDiameter",od:"outerDiameter",outerdiameter:"outerDiameter",flangeod:"flangeDiameter",flangediameter:"flangeDiameter",l:"length",length:"length",flangethickness:"flangeThickness"};function jwr(e){let t=ym(e.string);if(e.fn!=="flangedbushing"||t[0]?.toLowerCase()!=="flangedbushing")throw Error("Expected flangedbushing without an inline value");let n={fn:"flangedbushing"};for(let o of t.slice(1)){let r=o.match(/^([a-z]+)(.*)$/i);if(!r)throw Error(`Invalid flanged bushing token "${o}"`);let i=r[1].toLowerCase(),s=r[2],a,c;if(Object.hasOwn(qun,i))a=qun[i],c=s;else if(i==="style"){a="style";let l=s.match(/^\(([a-z]+)\)$/i);if(!l)throw Error("Style requires a parenthesized value");c=l[1].toLowerCase()}else throw Error(`Unknown flanged bushing token "${o}"`);if(Object.hasOwn(n,a))throw Error(`Flanged bushing property "${a}" is set more than once`);n[a]=c}return TIe.parse(n)}var Apn=cu({name:"flangedbushing",schema:TIe,parse:jwr});function Kwr(e){e.register(Apn)}var Ib=un([Ae(),k().regex(/^(?:\d+(?:\.\d+)?|\.\d+)(?:mm|cm|m|in|inch)?$/i).transform((e)=>e.toLowerCase())]).pipe(Qh).refine((e)=>e>0,"Length must be positive"),Fet={M3:{diameter:3,threadPitch:0.5,headDiameter:6.72,headHeight:1.86,socketAcrossFlats:2,socketDepth:1.1,underHeadRadius:0.1,maximumThreadLength:18,headAngle:90,tipChamferAngle:45,threadFlankAngle:60,tipChamfer:0.25,threadRootDiameter:2.3865653389860224,threadPitchDiameter:2.6752404735808355},M4:{diameter:4,threadPitch:0.7,headDiameter:8.96,headHeight:2.48,socketAcrossFlats:2.5,socketDepth:1.5,underHeadRadius:0.2,maximumThreadLength:20,headAngle:90,tipChamferAngle:45,threadFlankAngle:60,tipChamfer:0.35,threadRootDiameter:3.141191474580432,threadPitchDiameter:3.5453366630131695},M5:{diameter:5,threadPitch:0.8,headDiameter:11.2,headHeight:3.1,socketAcrossFlats:3,socketDepth:1.9,underHeadRadius:0.2,maximumThreadLength:22,headAngle:90,tipChamferAngle:45,threadFlankAngle:60,tipChamfer:0.4,threadRootDiameter:4.018504542377636,threadPitchDiameter:4.480384757729337},M6:{diameter:6,threadPitch:1,headDiameter:13.44,headHeight:3.72,socketAcrossFlats:4,socketDepth:2.2,underHeadRadius:0.25,maximumThreadLength:24,headAngle:90,tipChamferAngle:45,threadFlankAngle:60,tipChamfer:0.5,threadRootDiameter:4.773130677972045,threadPitchDiameter:5.350480947161671}},$wr=Pt(["M3","M4","M5","M6"]),qwr=Pt(["iso10642","iso10642:2019"]).default("iso10642").transform(()=>"iso10642:2019"),fpn={standard:qwr,metricSize:$wr,length:Ib,thread:he("full").default("full"),drive:he("hexsocket").default("hexsocket"),threadHand:Pt(["right","left"]).default("right"),threadClass:he("6g").default("6g"),threadGender:he("male").default("male"),showThreads:Be().default(!0),diameter:Ib.optional(),threadPitch:Ib.optional(),headDiameter:Ib.optional(),headHeight:Ib.optional(),socketAcrossFlats:Ib.optional(),socketDepth:Ib.optional(),underHeadRadius:Ib.optional(),maximumThreadLength:Ib.optional(),headAngle:Ae().finite().positive().optional(),tipChamferAngle:Ae().finite().positive().optional(),threadFlankAngle:Ae().finite().positive().optional(),tipChamfer:Ib.optional(),threadRootDiameter:Ib.optional(),threadPitchDiameter:Ib.optional()},ypn=(e,t)=>{let n=Fet[e.metricSize];for(let o of Object.keys(n))if(e[o]!==void 0&&Math.abs(e[o]-n[o])>0.000000001)t.addIssue({code:"custom",path:[o],message:`Dimension ${o} contradicts ${e.standard} ${e.metricSize}`});if(e.length<=n.tipChamfer)t.addIssue({code:"custom",path:["length"],message:"Length must exceed the fixed tip chamfer"});if(e.length<=n.headHeight+n.underHeadRadius+n.tipChamfer)t.addIssue({code:"custom",path:["length"],message:"Overall length must leave a shank beyond the countersunk head, under-head fillet and tip chamfer"});if(e.length-n.headHeight>n.maximumThreadLength+0.000000001)t.addIssue({code:"custom",path:["length"],message:"This contract supports full-thread screws only; length exceeds the pinned thread-length range"})},xpn=we(fpn).strict().superRefine(ypn).transform((e)=>({...e,...Fet[e.metricSize]})),DIe=we({fn:he("flatheadscrew"),...fpn}).strict().superRefine(ypn).transform((e)=>({...e,...Fet[e.metricSize]})),Jwr={m:"metricSize",metricsize:"metricSize",l:"length",length:"length",standard:"standard",thread:"thread",drive:"drive",threadhand:"threadHand",threadclass:"threadClass",threadgender:"threadGender",diameter:"diameter",threadpitch:"threadPitch",headdiameter:"headDiameter",headheight:"headHeight",socketacrossflats:"socketAcrossFlats",socketdepth:"socketDepth",underheadradius:"underHeadRadius",maximumthreadlength:"maximumThreadLength",headangle:"headAngle",tipchamferangle:"tipChamferAngle",threadflankangle:"threadFlankAngle",tipchamfer:"tipChamfer",threadrootdiameter:"threadRootDiameter",threadpitchdiameter:"threadPitchDiameter",d:"diameter",headh:"headHeight",headd:"headDiameter",socketaf:"socketAcrossFlats",socketh:"socketDepth"},Zwr=new Set(["standard","thread","drive","threadHand","threadClass","threadGender"]),eBr=(e)=>{if(e.fn!=="flatheadscrew")throw Error(`Expected flatheadscrew params, got "${e.fn}"`);let[t,...n]=ym(e.string);if(t?.toLowerCase()!=="flatheadscrew")throw Error("The flatheadscrew function does not accept an inline value");let o={};for(let r of n){let i=r.match(/^([a-z]+)(.*)$/i),s=i?.[1]?.toLowerCase(),a=i?.[2],c,l;if(s==="threads"||s==="nothreads"){if(a!=="")throw Error(`Token "${s}" does not accept a value`);c="showThreads",l=s==="threads"}else{if(c=s?Jwr[s]??"":"",!c||!a)throw Error(`Unknown or missing flatheadscrew token "${r}"`);if(Zwr.has(c)){let h=a.match(/^\(([^()]+)\)$/)?.[1];if(!h)throw Error(`Token "${s}" requires a parenthesized selector`);l=h.toLowerCase()}else if(c==="metricSize"){let h=s==="m"?a:a.match(/^\((m\d+)\)$/i)?.[1]?.slice(1);if(!h||!/^\d+$/.test(h))throw Error("Invalid metric size");l=`M${h}`}else{if(!/^(?:\d+(?:\.\d+)?|\.\d+)(?:mm|cm|m|in|inch)?$/i.test(a))throw Error(`Invalid dimension token "${r}"`);l=["headAngle","tipChamferAngle","threadFlankAngle"].includes(c)?Number(a):a}}if(c in o)throw Error(`Property "${c}" is set more than once`);o[c]=l}return DIe.parse({fn:"flatheadscrew",...o})},Cpn=cu({name:"flatheadscrew",schema:DIe,parse:eBr});function tBr(e){e.register(Cpn)}var zet={M5:{diameter:5,threadPitch:0.8,acrossFlats:8,height:4.7,mouthDiameter:5.75},M6:{diameter:6,threadPitch:1,acrossFlats:10,height:5.2,mouthDiameter:6.75},M8:{diameter:8,threadPitch:1.25,acrossFlats:13,height:6.8,mouthDiameter:8.75},M10:{diameter:10,threadPitch:1.5,acrossFlats:16,height:8.4,mouthDiameter:10.8},M12:{diameter:12,threadPitch:1.75,acrossFlats:18,height:10.8,mouthDiameter:12.96}},nBr=Pt(["M5","M6","M8","M10","M12"]),oBr=un([Ae(),k().regex(/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:mm|cm|m|in|inch|mil|ft|feet)?$/i).transform((e)=>e.toLowerCase())]).pipe(Qh).refine((e)=>e>0,"Length must be positive"),bpn={standard:Pt(["iso4032","iso4032:2023"]).default("iso4032").transform(()=>"iso4032:2023"),metricSize:nBr,threadPitch:oBr.optional(),threadHand:he("right").default("right"),threadClass:he("6H").default("6H"),showThreads:Be().default(!0)};function Ipn(e,t){if(e.threadPitch!==void 0&&Math.abs(e.threadPitch-zet[e.metricSize].threadPitch)>0.000000001)t.addIssue({code:"custom",path:["threadPitch"],message:"ISO 4032 requires the tabulated coarse pitch"})}function vpn(e){return{...e,threadPitch:zet[e.metricSize].threadPitch}}var Oet=we(bpn).strict().superRefine(Ipn).transform(vpn),NIe=we({fn:he("hexnut"),...bpn}).strict().superRefine(Ipn).transform(vpn);function Spn(e){let t=Oet.parse(e),n=zet[t.metricSize],o=2*n.acrossFlats/Math.sqrt(3),r=n.diameter-5*Math.sqrt(3)/8*n.threadPitch;return{...n,acrossCorners:o,boreMinorDiameter:r,faceDiameter:n.acrossFlats,outerChamferAngle:30,outerChamferDepth:(o-n.acrossFlats)/2/Math.sqrt(3),boreChamferAngle:90,boreChamferDepth:(n.mouthDiameter-r)/2,bearingZ:0,topZ:n.height,threadDepth:n.height}}function rBr(e){let t=ym(e.string);if(e.fn!=="hexnut"||t[0]?.toLowerCase()!=="hexnut")throw Error("Expected hexnut without an inline argument");let n={fn:"hexnut"},o={standard:"standard",threadhand:"threadHand",threadclass:"threadClass"};for(let r of t.slice(1)){let i=r.match(/^([a-z]+)(.*)$/i);if(!i)throw Error(`Invalid hex nut token "${r}"`);let s=i[1].toLowerCase(),a=i[2],c,l=a;if(s==="m")c="metricSize",l=`M${a}`;else if(s==="threadpitch")c="threadPitch";else if(s in o){if(c=o[s],!/^\([^()]+\)$/.test(a))throw Error(`Expected a parenthesized ${s}`);if(l=a.slice(1,-1).toLowerCase(),c==="threadClass"&&l==="6h")l="6H"}else if(s==="threads"||s==="nothreads"){if(a)throw Error("Thread visibility flags cannot have a value");c="showThreads",l=s==="threads"}else throw Error(`Unknown hex nut token "${r}"`);if(c in n)throw Error(`Duplicate hex nut property "${c}"`);n[c]=l}return NIe.parse(n)}var Ppn=cu({name:"hexnut",schema:NIe,parse:rBr});function iBr(e){e.register(Ppn)}var Epn=un([Ae(),k().regex(/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:mm|cm|m|in|inch|mil|ft|feet)?$/i).transform((e)=>e.toLowerCase())]).pipe(Qh),mIe=Epn.refine((e)=>e>0,"Length must be positive"),vet=Epn.refine((e)=>e>=0,"Length cannot be negative"),Mpn={outerDiameter:mIe.default(6),innerDiameter:mIe.default(4),startLength:vet.default(38),endLength:vet.default(112),bendRadius:mIe.default(60),bendAngle:Ae().finite().min(0).max(180).default(90),ribPitch:mIe.default(2.25),ribDepth:vet.default(0.25)};function wpn(e,t){if(e.outerDiameter-2*e.ribDepth<=e.innerDiameter)t.addIssue({code:"custom",path:["ribDepth"],message:"Rib roots must leave a positive wall outside the bore"});if(e.bendAngle>0&&e.bendRadius<=e.outerDiameter/2)t.addIssue({code:"custom",path:["bendRadius"],message:"Bend radius must exceed half the outside diameter"});let n=e.startLength+e.bendRadius*(e.bendAngle*Math.PI/180)+e.endLength;if(!Number.isFinite(n)||n<=0)t.addIssue({code:"custom",message:"Centerline length must be finite and positive"})}var RIe=we(Mpn).strict().superRefine(wpn),QIe=we({fn:he("hollowpositioningarmtube"),...Mpn}).strict().superRefine(wpn);function Vet(e){let t=RIe.parse(e),n=t.bendRadius*(t.bendAngle*Math.PI/180),o=t.outerDiameter-2*t.ribDepth;return{bendLength:n,totalLength:t.startLength+n+t.endLength,rootDiameter:o,minimumWallThickness:(o-t.innerDiameter)/2}}function Bpn(e,t){let n=RIe.parse(e),{bendLength:o,totalLength:r}=Vet(n);if(!Number.isFinite(t)||t<0||t>r)throw Error("Centerline distance must be within [0,totalLength]");let s=Math.min(o,Math.max(0,t-n.startLength))/n.bendRadius,a=Math.sin(s),c=Math.cos(s),l=Math.max(0,t-n.startLength-o),h=[n.bendRadius*(1-c)+l*a,0,Math.min(t,n.startLength)+n.bendRadius*a+l*c],d=[a,0,c],u=[c,0,-a];return{position:h,tangent:d,normal:u}}var Jun={od:"outerDiameter",id:"innerDiameter",start:"startLength",end:"endLength",radius:"bendRadius",pitch:"ribPitch",depth:"ribDepth"};function sBr(e){let t=ym(e.string);if(e.fn!=="hollowpositioningarmtube"||!/^hollowpositioningarmtube$/i.test(t[0]))throw Error("Expected hollowpositioningarmtube without an inline value");let n={fn:"hollowpositioningarmtube"};for(let o of t.slice(1)){let r=o.match(/^([a-z]+)(.*)$/i),i=r?.[1]?.toLowerCase(),s=r?.[2];if(!i||!s)throw Error(`Invalid hollowpositioningarmtube token "${o}"`);let a,c=s;if(i in Jun)a=Jun[i];else if(i==="angle"){if(a="bendAngle",!/^[+]?(?:\d+(?:\.\d*)?|\.\d+)$/.test(s))throw Error("Hollow positioning arm tube angle requires a unitless degree value");c=Number(s)}else throw Error(`Unknown hollowpositioningarmtube token "${o}"`);if(a in n)throw Error(`Duplicate hollowpositioningarmtube property "${a}"`);n[a]=c}return QIe.parse(n)}var Tpn=cu({name:"hollowpositioningarmtube",schema:QIe,parse:sBr});function aBr(e){e.register(Tpn)}var c_=un([Ae(),k().regex(/^(?:\d+(?:\.\d+)?|\.\d+)(?:mm|cm|m|in|inch)?$/i).transform((e)=>e.toLowerCase())]).pipe(Qh).refine((e)=>e>0,"Length must be positive"),Yet={M3:{diameter:3,threadPitch:0.5,headDiameter:5.6,headHeight:2.4,crownRadius:5,underHeadRadius:0.1,recessNumber:1,recessReferenceDiameter:3,recessPenetration:1.4,maximumThreadLength:25,tipChamferAngle:45,threadFlankAngle:60,tipChamfer:0.25,threadRootDiameter:2.3865653389860224,threadPitchDiameter:2.6752404735808355,recessB:0.97,recessE:0.435,recessG:1.27,recessF:0.535,recessRadius:0.5,recessT1:0.34,recessAlpha:138,recessBeta:7,recessOuterWingAngle:26.5,recessInnerWingAngle:28,recessReferencePlaneHeight:2.169696007084728},M4:{diameter:4,threadPitch:0.7,headDiameter:8,headHeight:3.1,crownRadius:6.5,underHeadRadius:0.2,recessNumber:2,recessReferenceDiameter:4.4,recessPenetration:1.9,maximumThreadLength:38,tipChamferAngle:45,threadFlankAngle:60,tipChamfer:0.35,threadRootDiameter:3.141191474580432,threadPitchDiameter:3.5453366630131695,recessB:1.47,recessE:0.815,recessG:2.29,recessF:0.7,recessRadius:0.6,recessT1:0.61,recessAlpha:140,recessBeta:5.75,recessOuterWingAngle:26.5,recessInnerWingAngle:28,recessReferencePlaneHeight:2.7163714733492106},M5:{diameter:5,threadPitch:0.8,headDiameter:9.5,headHeight:3.7,crownRadius:8,underHeadRadius:0.2,recessNumber:2,recessReferenceDiameter:4.9,recessPenetration:2.4,maximumThreadLength:38,tipChamferAngle:45,threadFlankAngle:60,tipChamfer:0.4,threadRootDiameter:4.018504542377636,threadPitchDiameter:4.480384757729337,recessB:1.47,recessE:0.815,recessG:2.29,recessF:0.7,recessRadius:0.6,recessT1:0.61,recessAlpha:140,recessBeta:5.75,recessOuterWingAngle:26.5,recessInnerWingAngle:28,recessReferencePlaneHeight:3.315608971054121},M6:{diameter:6,threadPitch:1,headDiameter:12,headHeight:4.6,crownRadius:10,underHeadRadius:0.25,recessNumber:3,recessReferenceDiameter:6.9,recessPenetration:3.1,maximumThreadLength:38,tipChamferAngle:45,threadFlankAngle:60,tipChamfer:0.5,threadRootDiameter:4.773130677972045,threadPitchDiameter:5.350480947161671,recessB:2.41,recessE:2.005,recessG:3.81,recessF:0.825,recessRadius:0.8,recessT1:1.01,recessAlpha:146,recessBeta:5.75,recessOuterWingAngle:26.5,recessInnerWingAngle:28,recessReferencePlaneHeight:3.986026848459362}},cBr=Pt(["M3","M4","M5","M6"]),lBr=Pt(["iso7045","iso7045:2011"]).default("iso7045").transform(()=>"iso7045:2011"),Dpn={standard:lBr,metricSize:cBr,length:c_,thread:he("full").default("full"),drive:he("phillips").default("phillips"),threadHand:Pt(["right","left"]).default("right"),threadClass:he("6g").default("6g"),threadGender:he("male").default("male"),showThreads:Be().default(!0),recessStandard:he("iso4757:1983").default("iso4757:1983"),recessType:he("H").default("H"),diameter:c_.optional(),threadPitch:c_.optional(),headDiameter:c_.optional(),headHeight:c_.optional(),crownRadius:c_.optional(),underHeadRadius:c_.optional(),recessNumber:Ae().finite().positive().optional(),recessReferenceDiameter:c_.optional(),recessPenetration:c_.optional(),maximumThreadLength:c_.optional(),tipChamferAngle:Ae().finite().positive().optional(),threadFlankAngle:Ae().finite().positive().optional(),tipChamfer:c_.optional(),threadRootDiameter:c_.optional(),threadPitchDiameter:c_.optional(),recessB:c_.optional(),recessE:c_.optional(),recessG:c_.optional(),recessF:c_.optional(),recessRadius:c_.optional(),recessT1:c_.optional(),recessAlpha:Ae().finite().positive().optional(),recessBeta:Ae().finite().positive().optional(),recessOuterWingAngle:Ae().finite().positive().optional(),recessInnerWingAngle:Ae().finite().positive().optional(),recessReferencePlaneHeight:c_.optional()},Npn=(e,t)=>{let n=Yet[e.metricSize];for(let o of Object.keys(n))if(e[o]!==void 0&&Math.abs(e[o]-n[o])>0.000000001)t.addIssue({code:"custom",path:[o],message:`Dimension ${o} contradicts ${e.standard} ${e.metricSize}`});if(e.length<=n.underHeadRadius+n.tipChamfer)t.addIssue({code:"custom",path:["length"],message:"Length must separate the under-head fillet and fixed tip chamfer"});if(e.length>n.maximumThreadLength+0.000000001)t.addIssue({code:"custom",path:["length"],message:"This contract supports full-thread screws only; length exceeds the pinned thread-length range"})},Rpn=we(Dpn).strict().superRefine(Npn).transform((e)=>({...e,...Yet[e.metricSize]})),kIe=we({fn:he("panscrew"),...Dpn}).strict().superRefine(Npn).transform((e)=>({...e,...Yet[e.metricSize]})),hBr={m:"metricSize",metricsize:"metricSize",l:"length",length:"length",standard:"standard",thread:"thread",drive:"drive",threadhand:"threadHand",threadclass:"threadClass",threadgender:"threadGender",diameter:"diameter",threadpitch:"threadPitch",headdiameter:"headDiameter",headheight:"headHeight",crownradius:"crownRadius",underheadradius:"underHeadRadius",recessnumber:"recessNumber",recessreferencediameter:"recessReferenceDiameter",recesspenetration:"recessPenetration",maximumthreadlength:"maximumThreadLength",tipchamferangle:"tipChamferAngle",threadflankangle:"threadFlankAngle",tipchamfer:"tipChamfer",threadrootdiameter:"threadRootDiameter",threadpitchdiameter:"threadPitchDiameter",recessb:"recessB",recesse:"recessE",recessg:"recessG",recessf:"recessF",recessradius:"recessRadius",recesst1:"recessT1",recessalpha:"recessAlpha",recessbeta:"recessBeta",recessouterwingangle:"recessOuterWingAngle",recessinnerwingangle:"recessInnerWingAngle",recessreferenceplaneheight:"recessReferencePlaneHeight",d:"diameter",headh:"headHeight",headd:"headDiameter"},dBr=new Set(["standard","thread","drive","threadHand","threadClass","threadGender"]),uBr=(e)=>{if(e.fn!=="panscrew")throw Error(`Expected panscrew params, got "${e.fn}"`);let[t,...n]=ym(e.string);if(t?.toLowerCase()!=="panscrew")throw Error("The panscrew function does not accept an inline value");let o={};for(let r of n){let i=r.match(/^(recesst1)(.*)$/i)??r.match(/^([a-z]+)(.*)$/i),s=i?.[1]?.toLowerCase(),a=i?.[2],c,l;if(s==="threads"||s==="nothreads"){if(a!=="")throw Error(`Token "${s}" does not accept a value`);c="showThreads",l=s==="threads"}else{if(c=s?hBr[s]??"":"",!c||!a)throw Error(`Unknown or missing panscrew token "${r}"`);if(dBr.has(c)){let h=a.match(/^\(([^()]+)\)$/)?.[1];if(!h)throw Error(`Token "${s}" requires a parenthesized selector`);l=h.toLowerCase()}else if(c==="metricSize"){let h=s==="m"?a:a.match(/^\((m\d+)\)$/i)?.[1]?.slice(1);if(!h||!/^\d+$/.test(h))throw Error("Invalid metric size");l=`M${h}`}else{if(!/^(?:\d+(?:\.\d+)?|\.\d+)(?:mm|cm|m|in|inch)?$/i.test(a))throw Error(`Invalid dimension token "${r}"`);l=["recessNumber","tipChamferAngle","threadFlankAngle","recessAlpha","recessBeta","recessOuterWingAngle","recessInnerWingAngle"].includes(c)?Number(a):a}}if(c in o)throw Error(`Property "${c}" is set more than once`);o[c]=l}return kIe.parse({fn:"panscrew",...o})},Qpn=cu({name:"panscrew",schema:kIe,parse:uBr});function pBr(e){e.register(Qpn)}var kpn=un([Ae(),k().regex(/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:mm|cm|m|in|inch|mil|ft|feet)?$/i).transform((e)=>e.toLowerCase())]).pipe(Qh),Pet=kpn.refine((e)=>e>0),Lpn={innerDiameter:Pet,outerDiameter:Pet,length:Pet,style:he("plainclosed").default("plainclosed"),edgeChamfer:kpn.refine((e)=>e>=0).default(0)};function Hpn(e,t){if(e.outerDiameter<=e.innerDiameter)t.addIssue({code:"custom",path:["outerDiameter"],message:"Outside diameter must exceed the bore diameter"});else if(e.edgeChamfer>=(e.outerDiameter-e.innerDiameter)/4)t.addIssue({code:"custom",path:["edgeChamfer"],message:"Inner and outer rim chamfers must leave an annular end face"});if(e.edgeChamfer>=e.length/2)t.addIssue({code:"custom",path:["edgeChamfer"],message:"The two end chamfers must leave positive straight bore length"})}var Get=we(Lpn).strict().superRefine(Hpn),LIe=we({fn:he("plainbushing"),...Lpn}).strict().superRefine(Hpn);function Fpn(e){let t=Get.parse(e);return{innerDiameter:t.innerDiameter,outerDiameter:t.outerDiameter,length:t.length,wallThickness:(t.outerDiameter-t.innerDiameter)/2,endInnerDiameter:t.innerDiameter+2*t.edgeChamfer,endOuterDiameter:t.outerDiameter-2*t.edgeChamfer,straightLength:t.length-2*t.edgeChamfer}}var Zun={id:"innerDiameter",innerdiameter:"innerDiameter",od:"outerDiameter",outerdiameter:"outerDiameter",l:"length",length:"length",edgechamfer:"edgeChamfer"};function mBr(e){let t=ym(e.string);if(e.fn!=="plainbushing"||t[0]?.toLowerCase()!=="plainbushing")throw Error("Expected plainbushing without an inline value");let n={fn:"plainbushing"};for(let o of t.slice(1)){let r=o.match(/^([a-z]+)(.*)$/i);if(!r)throw Error(`Invalid plain bushing token "${o}"`);let i=r[1].toLowerCase(),s=r[2],a,c;if(Object.hasOwn(Zun,i))a=Zun[i],c=s;else if(i==="style"){a="style";let l=s.match(/^\(([a-z]+)\)$/i);if(!l)throw Error("Style requires a parenthesized value");c=l[1].toLowerCase()}else throw Error(`Unknown plain bushing token "${o}"`);if(Object.hasOwn(n,a))throw Error(`Plain bushing property "${a}" is set more than once`);n[a]=c}return LIe.parse(n)}var zpn=cu({name:"plainbushing",schema:LIe,parse:mBr});function _Br(e){e.register(zpn)}var Opn=un([Ae().finite(),k().regex(/^[+]?(?:\d+(?:\.\d*)?|\.\d+)(?:mm|cm|m|in|inch|mil|ft|feet)?$/i,"Expected a complete length with a supported unit").transform((e)=>e.toLowerCase())]).pipe(Qh),tJ=Opn.refine((e)=>e>0,"Length must be positive"),gBr=Opn.refine((e)=>e>=0,"Length cannot be negative"),Vpn={boreDiameter:tJ,outerDiameter:tJ,boreBDiameter:tJ.optional(),length:tJ,screwCount:he(4).default(4),screwEndOffset:tJ.optional(),screwAngle:Ae().finite().default(0),mount:he("setscrew").default("setscrew"),metricSize:ghe,threadPitch:tJ.optional(),threadHand:Pt(["right","left"]).default("right"),threadClass:he("6H").default("6H"),chamfer:gBr.default(0)};function Uet(e){let t=e.threadPitch??Vx[e.metricSize].threadPitch;return{...e,threadPitch:t,boreBDiameter:e.boreBDiameter??e.boreDiameter,screwEndOffset:e.screwEndOffset??e.length/4,screwAngle:(e.screwAngle%360+360)%360}}function Ypn(e,t){let n=Uet(e),o=(a)=>t.addIssue({code:"custom",message:a}),r=Vx[n.metricSize].diameter;if(!Number.isFinite(n.outerDiameter**2))o("Derived dimensions must be finite");if((n.outerDiameter-n.boreDiameter)/2<=0)o("Outer diameter must exceed the bore diameter");if(n.threadPitch>=r)o("Thread pitch must be smaller than its nominal diameter");let s=(n.outerDiameter-Math.max(n.boreDiameter,n.boreBDiameter))/2;if(s<=0)o("Both bores must be smaller than the outer diameter");if(Math.SQRT2*r>=Math.min(n.boreDiameter,n.boreBDiameter))o("Both bores must separate the perpendicular screw holes with material");if(n.chamfer>=s/2||n.chamfer>=n.length/2)o("Chamfer must leave material between the bore and exterior");if(n.screwEndOffset-r/2<=n.chamfer)o("Screw holes must clear the end chamfers");if(n.length-2*n.screwEndOffset<=r)o("Each end must have a separate, nonintersecting screw-hole plane")}var Wet=we(Vpn).strict().superRefine(Ypn).transform(Uet),HIe=we({fn:he("rigidcoupler"),...Vpn}).strict().superRefine(Ypn).transform((e)=>({fn:e.fn,...Uet(e)}));function Gpn(e){let t=Wet.parse(e),n=Vx[t.metricSize].diameter,o=t.outerDiameter/2,r=[{bore:t.boreDiameter,z:t.screwEndOffset,angle:t.screwAngle},{bore:t.boreDiameter,z:t.screwEndOffset,angle:t.screwAngle+90},{bore:t.boreBDiameter,z:t.length-t.screwEndOffset,angle:t.screwAngle},{bore:t.boreBDiameter,z:t.length-t.screwEndOffset,angle:t.screwAngle+90}].map((i)=>{let s=i.angle*Math.PI/180;return{start:[o*Math.cos(s),o*Math.sin(s),i.z],direction:[-Math.cos(s),-Math.sin(s),0],diameter:n,depth:o-Math.sqrt((i.bore/2)**2-(n/2)**2),threadPitch:t.threadPitch,threadHand:t.threadHand,threadGender:"female",threadClass:t.threadClass}});return{threadDiameter:n,boreADepth:t.length/2,boreBDepth:t.length/2,screwHoles:r}}var ABr={bore:"boreDiameter",od:"outerDiameter",mount:"mount",m:"metricSize",threadpitch:"threadPitch",threadhand:"threadHand",threadclass:"threadClass",chamfer:"chamfer",boreb:"boreBDiameter",l:"length",length:"length",screwcount:"screwCount",screwendoffset:"screwEndOffset",screwangle:"screwAngle"};function fBr(e){let t=ym(e.string);if(e.fn!=="rigidcoupler"||t[0]?.toLowerCase()!=="rigidcoupler")throw Error("Expected an unadorned rigidcoupler function");let n={};for(let o of t.slice(1)){let r=o.match(/^([a-z]+)(.*)$/i),i=r?.[1]?.toLowerCase()??"",s=ABr[i];if(!s)throw Error(`Unknown rigidcoupler token "${o}"`);if(s in n)throw Error(`Duplicate rigidcoupler property "${s}"`);let a=r[2];if(!a)throw Error(`Token "${i}" requires a value`);if(["mount","threadHand","threadClass"].includes(s)){let c=a.match(/^\(([^()]+)\)$/);if(!c)throw Error(`Token "${i}" requires one parenthesized argument`);n[s]=s==="threadClass"?c[1].toUpperCase():c[1].toLowerCase()}else if(s==="metricSize"){if(!/^\d+(?:\.\d+)?$/.test(a))throw Error("m requires a unitless metric designation");n[s]=`M${a}`}else if(s==="screwCount"){if(!/^\d+$/.test(a))throw Error("screwcount requires a unitless integer");n[s]=Number(a)}else if(s==="screwAngle"){if(!/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:deg)?$/i.test(a))throw Error("screwangle requires an angle in degrees");n[s]=Number(a.replace(/deg$/i,""))}else n[s]=a}return HIe.parse({fn:"rigidcoupler",...n})}var Upn=cu({name:"rigidcoupler",schema:HIe,parse:fBr});function yBr(e){e.register(Upn)}var Wpn=un([Ae().finite(),k().regex(/^[+]?(?:\d+(?:\.\d*)?|\.\d+)(?:mm|cm|m|in|inch|mil|ft|feet)?$/i,"Expected a complete length with a supported unit").transform((e)=>e.toLowerCase())]).pipe(Qh),phe=Wpn.refine((e)=>e>0,"Length must be positive"),xBr=Wpn.refine((e)=>e>=0,"Length cannot be negative"),Xpn={boreDiameter:phe,outerDiameter:phe,width:phe,screwZ:phe.optional(),screwAngle:Ae().finite().default(0),mount:he("setscrew").default("setscrew"),metricSize:ghe,threadPitch:phe.optional(),threadHand:Pt(["right","left"]).default("right"),threadClass:he("6H").default("6H"),chamfer:xBr.default(0)};function Xet(e){let t=e.threadPitch??Vx[e.metricSize].threadPitch;return{...e,threadPitch:t,screwZ:e.screwZ??e.width/2,screwAngle:(e.screwAngle%360+360)%360}}function jpn(e,t){let n=Xet(e),o=(s)=>t.addIssue({code:"custom",message:s}),r=Vx[n.metricSize].diameter;if(!Number.isFinite(n.outerDiameter**2))o("Derived dimensions must be finite");let i=(n.outerDiameter-n.boreDiameter)/2;if(i<=0)o("Outer diameter must exceed the bore diameter");if(n.threadPitch>=r)o("Thread pitch must be smaller than its nominal diameter");if(r>=n.boreDiameter)o("Thread diameter must be smaller than the shaft bore");if(n.chamfer>=i/2||n.chamfer>=n.width/2)o("Chamfer must leave material between the bore and exterior");if(n.screwZ-r/2<=n.chamfer||n.screwZ+r/2>=n.width-n.chamfer)o("Screw hole must clear both end faces and chamfers")}var jet=we(Xpn).strict().superRefine(jpn).transform(Xet),FIe=we({fn:he("shaftcollar"),...Xpn}).strict().superRefine(jpn).transform((e)=>({fn:e.fn,...Xet(e)}));function Kpn(e){let t=jet.parse(e),n=Vx[t.metricSize].diameter,o=t.outerDiameter/2,r=t.screwAngle*Math.PI/180;return{threadDiameter:n,wallThickness:(t.outerDiameter-t.boreDiameter)/2,screwHole:{start:[o*Math.cos(r),o*Math.sin(r),t.screwZ],direction:[-Math.cos(r),-Math.sin(r),0],diameter:n,depth:o-Math.sqrt((t.boreDiameter/2)**2-(n/2)**2),threadPitch:t.threadPitch,threadHand:t.threadHand,threadGender:"female",threadClass:t.threadClass}}}var CBr={bore:"boreDiameter",od:"outerDiameter",mount:"mount",m:"metricSize",threadpitch:"threadPitch",threadhand:"threadHand",threadclass:"threadClass",chamfer:"chamfer",w:"width",width:"width",screwz:"screwZ",screwangle:"screwAngle"};function bBr(e){let t=ym(e.string);if(e.fn!=="shaftcollar"||t[0]?.toLowerCase()!=="shaftcollar")throw Error("Expected an unadorned shaftcollar function");let n={};for(let o of t.slice(1)){let r=o.match(/^([a-z]+)(.*)$/i),i=r?.[1]?.toLowerCase()??"",s=CBr[i];if(!s)throw Error(`Unknown shaftcollar token "${o}"`);if(s in n)throw Error(`Duplicate shaftcollar property "${s}"`);let a=r[2];if(!a)throw Error(`Token "${i}" requires a value`);if(["mount","threadHand","threadClass"].includes(s)){let c=a.match(/^\(([^()]+)\)$/);if(!c)throw Error(`Token "${i}" requires one parenthesized argument`);n[s]=s==="threadClass"?c[1].toUpperCase():c[1].toLowerCase()}else if(s==="metricSize"){if(!/^\d+(?:\.\d+)?$/.test(a))throw Error("m requires a unitless metric designation");n[s]=`M${a}`}else if(s==="screwAngle"){if(!/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:deg)?$/i.test(a))throw Error("screwangle requires an angle in degrees");n[s]=Number(a.replace(/deg$/i,""))}else n[s]=a}return FIe.parse({fn:"shaftcollar",...n})}var $pn=cu({name:"shaftcollar",schema:FIe,parse:bBr});function IBr(e){e.register($pn)}var qpn=un([Ae(),k().regex(/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:mm|cm|m|in|inch|mil|ft|feet)?$/i).transform((e)=>e.toLowerCase())]).pipe(Qh),e0n=qpn.refine((e)=>e>0),vBr=qpn.refine((e)=>e>=0),SBr={M2:0.4,"M2.5":0.45,M3:0.5,M4:0.7,M5:0.8,M6:1,M8:1.25,M10:1.5,M12:1.75,M16:2,M20:2.5},PBr=Pt(["M2","M2.5","M3","M4","M5","M6","M8","M10","M12","M16","M20"]),Jpn={spec:he("custom").default("custom"),metricSize:PBr,length:e0n,thread:he("full").default("full"),ends:he("flat").default("flat"),chamfer:vBr.default(0),threadPitch:e0n.optional(),threadHand:Pt(["right","left"]).default("right")};function Ket(e){return{...e,threadPitch:e.threadPitch??SBr[e.metricSize]}}function Zpn(e,t){let n=Number(e.metricSize.slice(1)),o=Ket(e).threadPitch;if(n-1.226869*o<=0)t.addIssue({code:"custom",path:["threadPitch"],message:"Thread pitch must leave a positive external-thread root diameter"});if(e.chamfer>=Math.min(n/2,e.length/2))t.addIssue({code:"custom",path:["chamfer"],message:"Chamfer must leave flat end faces and separate end chamfers"})}var $et=we(Jpn).strict().superRefine(Zpn).transform(Ket),zIe=we({fn:he("threadedrod"),...Jpn}).strict().superRefine(Zpn).transform((e)=>({fn:e.fn,...Ket(e)}));function emn(e){let t=$et.parse(e),n=Number(t.metricSize.slice(1));return{diameter:n,length:t.length,threadPitch:t.threadPitch,pitchDiameter:n-0.649519*t.threadPitch,minorDiameter:n-1.226869*t.threadPitch,endDiameter:n-2*t.chamfer}}var t0n={l:"length",length:"length",chamfer:"chamfer",threadpitch:"threadPitch"},n0n={spec:"spec",thread:"thread",ends:"ends",threadhand:"threadHand"};function EBr(e){let t=ym(e.string);if(e.fn!=="threadedrod"||t[0]?.toLowerCase()!=="threadedrod")throw Error("Expected threadedrod without an inline value");let n={fn:"threadedrod"};for(let o of t.slice(1)){let r=o.match(/^([a-z]+)(.*)$/i);if(!r)throw Error(`Invalid threaded rod token "${o}"`);let i=r[1].toLowerCase(),s=r[2],a,c;if(i==="m"){if(a="metricSize",!/^\d+(?:\.\d+)?$/.test(s))throw Error("Metric size must be a unitless diameter");c=`M${s}`}else if(Object.hasOwn(t0n,i))a=t0n[i],c=s;else if(Object.hasOwn(n0n,i)){a=n0n[i];let l=s.match(/^\(([a-z]+)\)$/i);if(!l)throw Error(`Token "${i}" requires a parenthesized value`);c=l[1].toLowerCase()}else throw Error(`Unknown threaded rod token "${o}"`);if(Object.hasOwn(n,a))throw Error(`Threaded rod property "${a}" is set more than once`);n[a]=c}return zIe.parse(n)}var tmn=cu({name:"threadedrod",schema:zIe,parse:EBr});function MBr(e){e.register(tmn)}var wBr=un([Ae(),k().regex(/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:mm|cm|m|in|inch|mil|ft|feet)?$/i).transform((e)=>e.toLowerCase())]).pipe(Qh),mhe=wBr.refine((e)=>e>0,"Length must be positive"),nmn={outerDiameter:mhe.default(8),wireDiameter:mhe.default(0.8),turns:Ae().finite().min(1).max(128).default(3.25),pitch:mhe.optional(),startLegLength:mhe.default(10),endLegLength:mhe.default(14),leftHand:Be().default(!1)};function omn(e){return{...e,pitch:e.pitch??e.wireDiameter*1.25}}function rmn(e,t){if(e.outerDiameter<3*e.wireDiameter)t.addIssue({code:"custom",path:["outerDiameter"],message:"Outer diameter must be at least three wire diameters"});let n=e.pitch??e.wireDiameter*1.25;if(n<1.1*e.wireDiameter)t.addIssue({code:"custom",path:["pitch"],message:"Open coils require pitch at least 1.1 times wire diameter"});if(!Number.isFinite(Math.hypot(Math.PI*(e.outerDiameter-e.wireDiameter),n)*e.turns+e.startLegLength+e.endLegLength))t.addIssue({code:"custom",message:"Spring dimensions must remain finite"})}var OIe=we(nmn).strict().superRefine(rmn).transform(omn),VIe=we({fn:he("torsionspring"),...nmn}).strict().superRefine(rmn).transform((e)=>({...omn(e),fn:e.fn}));function qet(e){let t=OIe.parse(e),n=(t.outerDiameter-t.wireDiameter)/2,o=Math.hypot(2*Math.PI*n,t.pitch),r=o*t.turns;return{meanRadius:n,insideDiameter:t.outerDiameter-2*t.wireDiameter,axialAdvance:t.pitch*t.turns,lengthPerTurn:o,coilLength:r,centerlineLength:t.startLegLength+r+t.endLegLength,endPhaseDegrees:(t.leftHand?-1:1)*360*(t.turns%1),pitch:t.pitch}}function YIe(e,t){let n=OIe.parse(e),o=qet(n);if(!Number.isFinite(t)||t<0||t>o.centerlineLength)throw Error("Distance must be within the wire centerline");let r=Math.max(0,Math.min(o.coilLength,t-n.startLegLength)),i=r/o.lengthPerTurn,s=n.leftHand?-1:1,a=s*2*Math.PI*(i%1),c=Math.cos(a),l=Math.sin(a),h=[-s*2*Math.PI*o.meanRadius*l/o.lengthPerTurn,s*2*Math.PI*o.meanRadius*c/o.lengthPerTurn,n.pitch/o.lengthPerTurn],d=[c,l,0],u=[-h[2]*l,h[2]*c,h[0]*l-h[1]*c],_=t-n.startLegLength-r;return{position:[o.meanRadius*c+_*h[0],o.meanRadius*l+_*h[1],i*n.pitch+_*h[2]],tangent:h,normal:d,binormal:u}}var o0n={od:"outerDiameter",wire:"wireDiameter",pitch:"pitch",start:"startLegLength",end:"endLegLength"};function BBr(e){let t=ym(e.string);if(e.fn!=="torsionspring"||t[0]?.toLowerCase()!=="torsionspring")throw Error("Expected torsionspring without an inline value");let n={fn:"torsionspring"};for(let o of t.slice(1)){let r=o.toLowerCase();if(r==="left"||r==="right"){if("leftHand"in n)throw Error("Duplicate or conflicting spring handedness");n.leftHand=r==="left";continue}let i=o.match(/^([a-z]+)(.*)$/i),s=i?.[1]?.toLowerCase(),a=i?.[2];if(!s||!a)throw Error(`Invalid torsion spring token "${o}"`);let c,l=a;if(s in o0n)c=o0n[s];else if(s==="turns"){if(c="turns",!/^[+]?(?:\d+(?:\.\d*)?|\.\d+)$/.test(a))throw Error("Turns requires a unitless number");l=Number(a)}else throw Error(`Unknown torsion spring token "${o}"`);if(c in n)throw Error(`Duplicate torsion spring property "${c}"`);n[c]=l}return VIe.parse(n)}var imn=cu({name:"torsionspring",schema:VIe,parse:BBr});function TBr(e){e.register(imn)}var smn={width:Vu.default(20),height:Vu.default(20),length:Vu.default(100),profile:he("fourtsolid").default("fourtsolid"),slotWidth:Vu.default(6),pocketWidth:Vu.default(10),pocketDepth:Vu.default(2),lipThickness:Vu.default(2),boreDiameter:f9.default(0),cornerRadius:f9.default(0)};function amn(e,t){let n=(i,s)=>t.addIssue({code:"custom",message:i,path:[s]}),o=Math.min(e.width,e.height)/2,r=e.lipThickness+e.pocketDepth;if(!Number.isFinite(r)){n("Total groove depth must be finite","pocketDepth");return}if(e.pocketWidth<=e.slotWidth)n("A T pocket must be wider than its slot opening","pocketWidth");if(e.cornerRadius>=o)n("Corner radius must be smaller than half the section","cornerRadius");if(e.pocketWidth/2+e.cornerRadius>=o)n("Grooves must leave material before the rounded corners","pocketWidth");if(r+e.pocketWidth/2>=o)n("Adjacent perpendicular T pockets must remain separate","pocketDepth");if(e.boreDiameter/2+r>=o)n("The axial bore must remain separate from every T pocket","boreDiameter")}var cmn=we(smn).strict().superRefine(amn),GIe=we({fn:he("tslotextrusion"),...smn}).strict().superRefine(amn);var r0n={w:"width",width:"width",h:"height",height:"height",l:"length",length:"length",slot:"slotWidth",slotwidth:"slotWidth",pocket:"pocketWidth",pocketwidth:"pocketWidth",pocketd:"pocketDepth",pocketdepth:"pocketDepth",lip:"lipThickness",lipthickness:"lipThickness",bore:"boreDiameter",borediameter:"boreDiameter",corner:"cornerRadius",cornerradius:"cornerRadius"};function DBr(e){let t=ym(e.string);if(e.fn!=="tslotextrusion"||t[0]?.toLowerCase()!==e.fn)throw Error("Expected tslotextrusion without an inline value");let n={fn:"tslotextrusion"};for(let o of t.slice(1)){let[r,i]=nJ(o),s,a=i;if(r in r0n)s=r0n[r];else if(r==="profile"){s="profile";let c=i.match(/^\(([a-z]+)\)$/i);if(!c)throw Error("Profile requires one parenthesized identity");a=c[1].toLowerCase()}else throw Error(`Unknown T-slot extrusion token "${o}"`);if(s in n)throw Error(`T-slot extrusion property "${s}" is repeated`);n[s]=a}return GIe.parse(n)}var lmn=cu({name:"tslotextrusion",schema:GIe,parse:DBr});function NBr(e){e.register(lmn)}var hmn={width:Vu.default(40),height:Vu.default(40),thickness:Vu.default(4),shape:he("righttriangle").default("righttriangle"),slotCount:he(2).default(2),slot:kC([Vu,Vu]).default([5,12]),centers:kC([Vu,Vu]).default([12,28]),edgeMargin:Vu.default(1)};function dmn(e,t){let n=(A,g)=>t.addIssue({code:"custom",message:A,path:[g]}),[o,r]=e.slot;if(r<o){n("Slot length must be at least its width","slot");return}let i=o/2,s=(r-o)/2,a=e.edgeMargin+i,[c,l]=e.centers;if(!Number.isFinite(a)){n("Derived slot centers must be finite","edgeMargin");return}if(c<=r/2||l<=r/2)n("Slots must leave material at the right-angle corner","centers");let h=Math.min(e.width,e.height)/Math.max(e.width,e.height),d=i/Math.min(e.width,e.height)*Math.hypot(1,h),u=c/e.width+a/e.height+s/e.width+d,_=a/e.width+l/e.height+s/e.height+d;if(!Number.isFinite(u)||!Number.isFinite(_)||u>=1||_>=1)n("Both complete slots must remain inside the triangular plate","centers");let p=Math.max(c-s-a,a-c-s,0),m=Math.max(l-s-a,a-l-s,0);if(Math.hypot(p,m)<=o)n("The two slots must retain a positive separating ligament","centers")}var Jet=we(hmn).strict().superRefine(dmn),UIe=we({fn:he("tslotgusset"),...hmn}).strict().superRefine(dmn);function umn(e={}){let t=Jet.parse(e),[n,o]=t.slot,r=t.edgeMargin+n/2;return[{center:{x:t.centers[0],y:r,z:0},orientation:0,width:n,length:o,depth:t.thickness,direction:{x:0,y:0,z:1}},{center:{x:r,y:t.centers[1],z:0},orientation:90,width:n,length:o,depth:t.thickness,direction:{x:0,y:0,z:1}}]}var i0n={w:"width",width:"width",h:"height",height:"height",t:"thickness",thickness:"thickness",edgemargin:"edgeMargin"};function RBr(e){let t=ym(e.string);if(e.fn!=="tslotgusset"||t[0]?.toLowerCase()!==e.fn)throw Error("Expected tslotgusset without an inline value");let n={fn:"tslotgusset"};for(let o of t.slice(1)){let[r,i]=nJ(o),s,a=i;if(r in i0n)s=i0n[r];else if(r==="slots"||r==="slotcount")s="slotCount",a=FV(i,"slotCount");else if(r==="shape"){s="shape";let c=i.match(/^\(([a-z]+)\)$/i);if(!c)throw Error("Shape requires one parenthesized identity");a=c[1].toLowerCase()}else if(r==="slot"||r==="centers"){s=r;let c=i.match(/^\(([^(),]+),([^(),]+)\)$/);if(!c)throw Error(`${r} requires two parenthesized lengths`);a=[c[1].trim(),c[2].trim()]}else throw Error(`Unknown T-slot gusset token "${o}"`);if(s in n)throw Error(`T-slot gusset property "${s}" is repeated`);n[s]=a}return UIe.parse(n)}var pmn=cu({name:"tslotgusset",schema:UIe,parse:RBr});function QBr(e){e.register(pmn)}var mmn={width:Vu.default(20),legLength:Vu.default(40),thickness:Vu.default(4),angle:he(90).default(90),holeCount:he(2).default(2),holeDiameter:Vu.default(5),holeOffset:Vu.default(20),bendRadius:f9.default(0)};function _mn(e,t){let n=(r,i)=>t.addIssue({code:"custom",message:r,path:[i]});if(!Number.isFinite(e.bendRadius+e.thickness)){n("Outside bend radius must be finite","bendRadius");return}if(e.thickness>=e.legLength)n("Thickness must be smaller than the leg length","thickness");if(e.bendRadius>=e.legLength)n("Bend radius must leave a straight portion of each leg","bendRadius");let o=e.holeDiameter/2;if(e.holeDiameter>=e.width)n("Holes must leave material at both width edges","holeDiameter");if(e.holeOffset-o<=e.bendRadius)n("Holes must lie wholly beyond the bend tangent","holeOffset");if(e.holeOffset+o>=e.legLength)n("Holes must leave material at the free leg ends","holeOffset")}var gmn=we(mmn).strict().superRefine(_mn),WIe=we({fn:he("tslotinsidecorner"),...mmn}).strict().superRefine(_mn);var s0n={w:"width",width:"width",leg:"legLength",leglength:"legLength",t:"thickness",thickness:"thickness",hole:"holeDiameter",holediameter:"holeDiameter",offset:"holeOffset",holeoffset:"holeOffset",bendr:"bendRadius",bendradius:"bendRadius"};function kBr(e){let t=ym(e.string);if(e.fn!=="tslotinsidecorner"||t[0]?.toLowerCase()!==e.fn)throw Error("Expected tslotinsidecorner without an inline value");let n={fn:"tslotinsidecorner"};for(let o of t.slice(1)){let[r,i]=nJ(o),s,a=i;if(r in s0n)s=s0n[r];else if(r==="holes"||r==="holecount")s="holeCount",a=FV(i,"holeCount");else if(r==="angle")s="angle",a=gIe(i,"angle");else throw Error(`Unknown T-slot inside corner token "${o}"`);if(s in n)throw Error(`T-slot inside corner property "${s}" is repeated`);n[s]=a}return WIe.parse(n)}var Amn=cu({name:"tslotinsidecorner",schema:WIe,parse:kBr});function LBr(e){e.register(Amn)}function XIe(e){let t=xIe.parse(e),n=t.wireSideAngle*Math.PI/180,o=Math.cos(n),r=Math.sin(n),i=Math.min(t.bodyWidth/2/Math.max(Math.abs(o),Math.abs(r)),(t.bodyWidth-t.faceCornerChamfer)/(Math.abs(o)+Math.abs(r))),s=t.shaftFlatAngle*Math.PI/180;return{frontface:{position:{x:0,y:0,z:0},direction:{x:0,y:0,z:1}},backface:{position:{x:0,y:0,z:-t.bodyLength},direction:{x:0,y:0,z:-1}},shafttip:{position:{x:0,y:0,z:t.shaftLength},direction:{x:0,y:0,z:1}},wireside:{position:{x:i*o,y:i*r,z:-t.bodyLength+t.rearCapLength/2},direction:{x:o,y:r,z:0}},shaftflat:t.shaftShape==="d"?{position:{x:(t.shaftDiameter/2-t.shaftFlatDepth)*Math.cos(s),y:(t.shaftDiameter/2-t.shaftFlatDepth)*Math.sin(s),z:t.shaftLength-t.shaftFlatLength/2},direction:{x:Math.cos(s),y:Math.sin(s),z:0}}:void 0}}var yYs=un([d0n.schema,E0n.schema,B0n.schema,R0n.schema,Q0n.schema,C0n.schema,k0n.schema,O0n.schema,X0n.schema,J0n.schema,npn.schema,apn.schema,ppn.schema,Apn.schema,Cpn.schema,Ppn.schema,Tpn.schema,Qpn.schema,zpn.schema,Upn.schema,$pn.schema,tmn.schema,imn.schema,lmn.schema,pmn.schema,Amn.schema]);function HBr(e){twr(e),owr(e),cwr(e),uwr(e),vwr(e),Pwr(e),Mwr(e),Bwr(e),kwr(e),Fwr(e),Owr(e),Uwr(e),Xwr(e),Kwr(e),tBr(e),iBr(e),aBr(e),pBr(e),_Br(e),yBr(e),IBr(e),MBr(e),TBr(e),NBr(e),QBr(e),LBr(e)}var jIe=new KMr;HBr(jIe);var FBr=(e)=>jIe.parse(e),fmn=(e)=>{let t=jIe.normalize(Met(e));return{params:()=>t,json:()=>FBr(t)}},ymn=(e)=>fmn(e).json(),zBr={string:fmn,getModelNames:()=>jIe.getModelNames()},rJ=zBr;var Cm=Qe(M7(),1);var USn=Qe(rn(),1);var WSn=Qe(rn(),1),Wx=Qe(M7(),1);Y0();Y0();Y0();m0();m0();var OBr=class extends co{constructor(e){super();this.params=e;let{cellContents:t}=e;for(let n=0;n<t.length;n++)for(let o=n+1;o<t.length;o++)this._allPairs.push([n,o])}params;midlines=[];_pairIdx=0;_allPairs=[];_step(){let{cellContents:e,containerWidth:t,containerHeight:n}=this.params;if(this._pairIdx>=this._allPairs.length){this.solved=!0;return}let[o,r]=this._allPairs[this._pairIdx],i=e[o],s=e[r],a=i.x+i.width,c=s.x+s.width,l=i.y+i.height,h=s.y+s.height;if(a<s.x||c<i.x){let d=a<s.x?(a+s.x)/2:(c+i.x)/2;this.midlines.push({id:`midline-${this.midlines.length}`,start:{x:d,y:0},end:{x:d,y:n},cellIds:[i.cellId,s.cellId],type:"vertical"})}if(l<s.y||h<i.y){let d=l<s.y?(l+s.y)/2:(h+i.y)/2;this.midlines.push({id:`midline-${this.midlines.length}`,start:{x:0,y:d},end:{x:t,y:d},cellIds:[i.cellId,s.cellId],type:"horizontal"})}if(this._pairIdx++,this._pairIdx>=this._allPairs.length)this.solved=!0}getOutput(){return this.midlines}getConstructorParams(){return[this.params]}visualize(){let{cellContents:e}=this.params,t=this._allPairs[this._pairIdx],n=t?new Set([e[t[0]]?.cellId,e[t[1]]?.cellId]):new Set;return{rects:e.map((o)=>({center:{x:o.x+o.width/2,y:o.y+o.height/2},width:o.width,height:o.height,fill:n.has(o.cellId)?"rgba(255, 80, 80, 0.45)":"rgba(255, 165, 0, 0.3)",stroke:n.has(o.cellId)?"#ff2020":"#c87000",label:o.cellId})),lines:this.midlines.map((o)=>({points:[o.start,o.end],strokeColor:"#888888",strokeDash:[4,4],label:o.id}))}}},VBr=(e,t)=>{let n=e.start.x,o=e.start.y,r=e.end.x,i=e.end.y,s=t.start.x,a=t.start.y,c=t.end.x,l=t.end.y,h=(n-r)*(a-l)-(o-i)*(s-c);if(Math.abs(h)<0.0001)return null;let d=((n-s)*(a-l)-(o-a)*(s-c))/h,u=-((n-r)*(o-a)-(o-i)*(n-s))/h;if(d>=0&&d<=1&&u>=0&&u<=1)return{x:n+d*(r-n),y:o+d*(i-o)};return null},YBr=class extends co{constructor(e){super();this.params=e}params;intersections=[];_outerIdx=0;_step(){let{midlines:e}=this.params;if(e.length<=1){this.solved=!0;return}if(this._outerIdx>=e.length-1){this.solved=!0;return}let t=e[this._outerIdx];for(let n of e.slice(this._outerIdx+1)){let o=VBr(t,n);if(o)this.intersections.push({point:o,midlineIds:[t.id,n.id]})}if(this._outerIdx++,this._outerIdx>=e.length-1)this.solved=!0}getOutput(){return this.intersections}getConstructorParams(){return[this.params]}visualize(){let{midlines:e}=this.params,t=e[this._outerIdx];return{lines:e.map((n)=>({points:[n.start,n.end],strokeColor:n===t?"#2196f3":"#cccccc",strokeWidth:n===t?2.5:1,strokeDash:n===t?void 0:[4,4]})),points:this.intersections.map((n)=>({x:n.point.x,y:n.point.y,color:"#e63946",label:`(${n.point.x.toFixed(1)}, ${n.point.y.toFixed(1)})`}))}}},GBr=(e)=>{let t=[];for(let n=0;n+1<e.length;n++){let o=e[n],r=e[n+1];if(o!==void 0&&r!==void 0)t.push([o,r])}return t},UBr=(e,t)=>{let n=Math.max(t.x,Math.min(e.x,t.x+t.width)),o=Math.max(t.y,Math.min(e.y,t.y+t.height)),r=e.x-n,i=e.y-o;return Math.sqrt(r*r+i*i)},WBr=(e,t,n)=>{let r=1/0;for(let i=0;i<=10;i++){let s=i/10,a={x:e.x+s*(t.x-e.x),y:e.y+s*(t.y-e.y)};r=Math.min(r,UBr(a,n))}return r},XBr=(e,t,n)=>Math.min(...n.map((o)=>WBr(e,t,o))),jBr=class extends co{constructor(e){super();this.params=e}params;allSegments=[];_midlineIdx=0;_segmentId=0;_step(){let{midlines:e,intersections:t,cellContents:n}=this.params;if(this._midlineIdx>=e.length){this.solved=!0;return}let o=e[this._midlineIdx],r=t.filter((i)=>i.midlineIds.includes(o.id)).map((i)=>i.point).sort((i,s)=>o.type==="vertical"?i.y-s.y:i.x-s.x);for(let[i,s]of GBr([o.start,...r,o.end]))this.allSegments.push({id:`segment-${this._segmentId++}`,start:i,end:s,fromCellIds:o.cellIds,distanceToAnyCell:XBr(i,s,n)});if(this._midlineIdx++,this._midlineIdx>=e.length)this.solved=!0}getOutput(){return this.allSegments}getConstructorParams(){return[this.params]}visualize(){let{cellContents:e,midlines:t}=this.params,n=t[this._midlineIdx],o=Math.max(...this.allSegments.map((r)=>r.distanceToAnyCell??0),1);return{rects:e.map((r)=>({center:{x:r.x+r.width/2,y:r.y+r.height/2},width:r.width,height:r.height,fill:"rgba(255, 165, 0, 0.2)",stroke:"#c87000"})),lines:[...this.allSegments.map((r)=>{let i=(r.distanceToAnyCell??0)/o,s=Math.round(255*(1-i)),a=Math.round(200*i);return{points:[r.start,r.end],strokeColor:`rgb(${s}, ${a}, 80)`,strokeWidth:1.5}}),...n?[{points:[n.start,n.end],strokeColor:"#2196f3",strokeWidth:2,strokeDash:[8,4]}]:[]]}}},xmn=(e)=>{let t=[];for(let n=0;n+1<e.length;n++){let o=e[n],r=e[n+1];if(o!==void 0&&r!==void 0)t.push([o,r])}return t},KBr=(e,t,n,o)=>{let{x:r,y:i}=e,{x:s,y:a}=t,{x:c,y:l}=n,{x:h,y:d}=o,u=(r-s)*(l-d)-(i-a)*(c-h);if(Math.abs(u)<0.0001)return!1;let _=((r-c)*(l-d)-(i-l)*(c-h))/u,p=-((r-s)*(i-l)-(i-a)*(r-c))/u;return _>=0&&_<=1&&p>=0&&p<=1},$Br=(e,t,n)=>{let{x:o,y:r,width:i,height:s}=n,a=e.x>=o&&e.x<=o+i&&e.y>=r&&e.y<=r+s,c=t.x>=o&&t.x<=o+i&&t.y>=r&&t.y<=r+s;if(a||c)return!0;let l=[{start:{x:o,y:r},end:{x:o+i,y:r}},{start:{x:o+i,y:r},end:{x:o+i,y:r+s}},{start:{x:o+i,y:r+s},end:{x:o,y:r+s}},{start:{x:o,y:r+s},end:{x:o,y:r}}];for(let h of l)if(KBr(e,t,h.start,h.end))return!0;return!1},qBr=(e,t)=>e.x<t.x+t.width&&e.x+e.width>t.x&&e.y<t.y+t.height&&e.y+e.height>t.y,Cmn=["rgba(100, 149, 237, 0.25)","rgba(144, 238, 144, 0.25)","rgba(255, 182, 193, 0.25)","rgba(221, 160, 221, 0.25)","rgba(255, 218, 185, 0.25)","rgba(175, 238, 238, 0.25)"],JBr=class extends co{constructor(e){super();this.params=e;let t=2;this.MAX_ITERATIONS=Math.max(this.MAX_ITERATIONS,e.allSegments.length+t)}params;validSegments=[];cellContainingRects=[];gridRects=[];_phase=0;_segIdx=0;_acceptedSegs=[];_rejectedSegs=[];_step(){let{allSegments:e,cellContents:t,containerWidth:n,containerHeight:o}=this.params;if(this._phase===0){if(this._segIdx>=e.length){this._phase=1;return}let d=e[this._segIdx];if(!t.some((_)=>$Br(d.start,d.end,_)))this._acceptedSegs.push(d);else this._rejectedSegs.push(d);this._segIdx++;return}let r=new Set([0,n]),i=new Set([0,o]);this._acceptedSegs.forEach((d)=>{if(Math.abs(d.start.x-d.end.x)<0.001)r.add(d.start.x);else i.add(d.start.y)});let s=Array.from(r).sort((d,u)=>d-u),a=Array.from(i).sort((d,u)=>d-u),c=[];t.forEach((d)=>{let u=s.filter((A)=>A<=d.x).pop()??s[0],_=s.find((A)=>A>=d.x+d.width)??s[s.length-1],p=a.filter((A)=>A<=d.y).pop()??a[0],m=a.find((A)=>A>=d.y+d.height)??a[a.length-1];c.push({cellId:`contain-${d.cellId}`,x:u,y:p,width:Math.max(0,_-u),height:Math.max(0,m-p)})});let l=[],h=0;for(let[d,u]of xmn(s)){if(u-d<=0)continue;for(let[_,p]of xmn(a)){if(p-_<=0)continue;let m={cellId:`gridRect-${h++}`,x:d,y:_,width:u-d,height:p-_};if(t.some((A)=>qBr(m,A)))continue;l.push(m)}}c.forEach((d)=>{let u=`${d.x},${d.y},${d.width},${d.height}`;if(!l.some((_)=>`${_.x},${_.y},${_.width},${_.height}`===u))l.push(d)}),this.validSegments=this._acceptedSegs,this.cellContainingRects=c,this.gridRects=l,this.solved=!0}getOutput(){return{validSegments:this.validSegments,cellContainingRects:this.cellContainingRects,gridRects:this.gridRects}}getConstructorParams(){return[this.params]}visualize(){let{cellContents:e,allSegments:t}=this.params,n=t[this._segIdx];return{rects:[...this.gridRects.map((o,r)=>({center:{x:o.x+o.width/2,y:o.y+o.height/2},width:o.width,height:o.height,fill:Cmn[r%Cmn.length],stroke:"#999999"})),...e.map((o)=>({center:{x:o.x+o.width/2,y:o.y+o.height/2},width:o.width,height:o.height,fill:"rgba(255, 165, 0, 0.4)",stroke:"#c87000",label:o.cellId}))],lines:[...this._rejectedSegs.map((o)=>({points:[o.start,o.end],strokeColor:"rgba(220, 50, 50, 0.35)",strokeDash:[3,3],strokeWidth:1})),...this._acceptedSegs.map((o)=>({points:[o.start,o.end],strokeColor:"#2196f3",strokeWidth:1.5})),...n&&this._phase===0?[{points:[n.start,n.end],strokeColor:"#ff9800",strokeWidth:3}]:[],...this.validSegments.map((o)=>({points:[o.start,o.end],strokeColor:"#2196f3",strokeWidth:2}))]}}},Ay=0.001,ZBr=(e,t,n=Ay)=>Math.abs(e.x-t.x)<n&&Math.abs(e.y-t.y)<n,eTr=(e,t)=>{let n=Math.max(e.x-(t.x+t.width),t.x-(e.x+e.width),0),o=Math.max(e.y-(t.y+t.height),t.y-(e.y+e.height),0);return n+o},tTr=(e,t,n=0.5)=>{let o=(Math.abs(e.x+e.width-t.x)<n||Math.abs(t.x+t.width-e.x)<n)&&!(e.y+e.height<=t.y||t.y+t.height<=e.y),r=(Math.abs(e.y+e.height-t.y)<n||Math.abs(t.y+t.height-e.y)<n)&&!(e.x+e.width<=t.x||t.x+t.width<=e.x);return o||r},bmn=["rgba(100, 149, 237, 0.35)","rgba(144, 238, 144, 0.35)","rgba(255, 182, 193, 0.35)","rgba(221, 160, 221, 0.35)","rgba(255, 218, 185, 0.35)","rgba(175, 238, 238, 0.35)","rgba(250, 200, 100, 0.35)","rgba(180, 220, 180, 0.35)"],Imn=["#6495ed","#3cb371","#ff69b4","#9370db","#ffa07a","#20b2aa","#daa520","#5f9e5f"],nTr=class extends co{constructor(e){super();this.params=e}params;mergedRectGroups=[];groupedRects=[];_phase=0;_workRects=[];_unmergedQueue=[];_step(){let{validSegments:e,gridRects:t,cellContainingRects:n,cellContents:o}=this.params;if(this._phase===0){this._workRects=t.map((s)=>{let a=1/0,{x:c,y:l,width:h,height:d}=s;return e.forEach((u)=>{let _=Math.min(u.start.x,u.end.x),p=Math.max(u.start.x,u.end.x),m=Math.min(u.start.y,u.end.y),A=Math.max(u.start.y,u.end.y),g=Math.abs(u.start.y-u.end.y)<Ay,f=Math.abs(u.start.x-u.end.x)<Ay,y=!1;if(g){if((Math.abs(m-l)<Ay||Math.abs(m-(l+d))<Ay)&&_<c+h-Ay&&p>c+Ay&&Math.max(_,c)+Ay<Math.min(p,c+h))y=!0}else if(f){if((Math.abs(_-c)<Ay||Math.abs(_-(c+h))<Ay)&&m<l+d-Ay&&A>l+Ay&&Math.max(m,l)+Ay<Math.min(A,l+d))y=!0}if(y&&u.distanceToAnyCell!==void 0)a=Math.min(a,u.distanceToAnyCell)}),{...s,merged:!1,groupId:null,minBoundingSegmentDistance:a}}),n.forEach((s,a)=>{let c=this._workRects.find((l)=>ZBr({x:l.x,y:l.y},{x:s.x,y:s.y})&&Math.abs(l.width-s.width)<Ay&&Math.abs(l.height-s.height)<Ay);if(c)c.merged=!0,c.groupId=a}),this._unmergedQueue=this._workRects.filter((s)=>!s.merged).sort((s,a)=>s.minBoundingSegmentDistance-a.minBoundingSegmentDistance),this._updateOutput(),this._phase=1;return}if(this._unmergedQueue.length===0){this._finalize(),this.solved=!0;return}let r=!1,i=[];for(let s of this._unmergedQueue){if(s.merged)continue;if(r){i.push(s);continue}let a=this._workRects.filter((c)=>c.merged&&tTr(s,c));if(a.length>0){if(s.merged=!0,a.length===1)s.groupId=a[0].groupId;else{let c=null,l=1/0;for(let h of a){if(h.groupId===null)continue;let d=o[h.groupId];if(!d)continue;let u=eTr(s,d);if(u<l||u===l&&(c===null||h.groupId!==null&&h.groupId<c))l=u,c=h.groupId}s.groupId=c}r=!0}else i.push(s)}if(this._unmergedQueue=i.sort((s,a)=>s.minBoundingSegmentDistance-a.minBoundingSegmentDistance),!r)this._finalize(),this.solved=!0;this._updateOutput()}_updateOutput(){this.groupedRects=this._workRects.filter((e)=>e.groupId!==null)}_finalize(){let{cellContainingRects:e,cellContents:t}=this.params;this.mergedRectGroups=[],e.forEach((n,o)=>{let r=this._workRects.filter((s)=>s.merged&&s.groupId===o).map(({merged:s,groupId:a,minBoundingSegmentDistance:c,...l})=>l),i=t[o];if(!i)return;this.mergedRectGroups.push([n,i,...r.filter((s)=>s.cellId!==n.cellId)])})}getOutput(){return{mergedRectGroups:this.mergedRectGroups,groupedRects:this.groupedRects}}getConstructorParams(){return[this.params]}visualize(){let{cellContents:e}=this.params;return{rects:[...this.groupedRects.map((t)=>({center:{x:t.x+t.width/2,y:t.y+t.height/2},width:t.width,height:t.height,fill:bmn[t.groupId%bmn.length],stroke:Imn[t.groupId%Imn.length]})),...this._workRects.filter((t)=>!t.merged).map((t)=>({center:{x:t.x+t.width/2,y:t.y+t.height/2},width:t.width,height:t.height,fill:"rgba(200, 200, 200, 0.2)",stroke:"#aaaaaa",strokeDash:[3,3]})),...e.map((t)=>({center:{x:t.x+t.width/2,y:t.y+t.height/2},width:t.width,height:t.height,fill:"rgba(255, 165, 0, 0.5)",stroke:"#c87000",label:t.cellId}))]}}},oTr=0.001,vmn=(e,t)=>{let n=parseFloat(e.x.toFixed(4)),o=parseFloat(e.y.toFixed(4)),r=parseFloat(t.x.toFixed(4)),i=parseFloat(t.y.toFixed(4));if(n<r||n===r&&o<i)return`${n},${o}_${r},${i}`;return`${r},${i}_${n},${o}`},Smn=["rgba(100, 149, 237, 0.25)","rgba(144, 238, 144, 0.25)","rgba(255, 182, 193, 0.25)","rgba(221, 160, 221, 0.25)","rgba(255, 218, 185, 0.25)","rgba(175, 238, 238, 0.25)","rgba(250, 200, 100, 0.25)","rgba(180, 220, 180, 0.25)"],rTr=class extends co{constructor(e){super();this.params=e}params;outlineLines=[];_outerIdx=0;_segMap=new Map;_step(){let{groupedRects:e}=this.params,t=oTr;if(this._outerIdx>=e.length){this._rebuildLines(),this.solved=!0;return}let n=e[this._outerIdx];for(let o of e.slice(this._outerIdx+1)){if(n.groupId===o.groupId)continue;let r=n.x+n.width,i=o.x+o.width;if(Math.abs(r-o.x)<t||Math.abs(i-n.x)<t){let c=Math.abs(r-o.x)<t?r:i,l=Math.max(n.y,o.y),h=Math.min(n.y+n.height,o.y+o.height);if(h-l>t){let d={x:c,y:l},u={x:c,y:h};this._segMap.set(vmn(d,u),{start:d,end:u})}}let s=n.y+n.height,a=o.y+o.height;if(Math.abs(s-o.y)<t||Math.abs(a-n.y)<t){let c=Math.abs(s-o.y)<t?s:a,l=Math.max(n.x,o.x),h=Math.min(n.x+n.width,o.x+o.width);if(h-l>t){let d={x:l,y:c},u={x:h,y:c};this._segMap.set(vmn(d,u),{start:d,end:u})}}}if(this._outerIdx++,this._rebuildLines(),this._outerIdx>=e.length)this.solved=!0}_rebuildLines(){let e=0;this.outlineLines=[],this._segMap.forEach(({start:t,end:n})=>{this.outlineLines.push({id:`outline-${e++}`,start:t,end:n})})}getOutput(){return this.outlineLines}getConstructorParams(){return[this.params]}visualize(){let{groupedRects:e}=this.params,t=e[this._outerIdx];return{rects:e.map((n)=>({center:{x:n.x+n.width/2,y:n.y+n.height/2},width:n.width,height:n.height,fill:n===t?"rgba(255, 152, 0, 0.45)":Smn[n.groupId%Smn.length],stroke:n===t?"#ff6600":"#cccccc"})),lines:this.outlineLines.map((n)=>({points:[n.start,n.end],strokeColor:"#000000",strokeWidth:3}))}}},cr=0.001,FQ=(e,t,n=cr)=>Math.abs(e.x-t.x)<n&&Math.abs(e.y-t.y)<n,Sb=(e)=>`${e.x.toFixed(4)},${e.y.toFixed(4)}`,KIe=(e,t)=>{let n=Sb(e),o=Sb(t);return n<o?`${n}_${o}`:`${o}_${n}`},fhe=(e)=>FQ(e.start,e.end),iTr=(e)=>Math.abs(e.start.x-e.end.x)<cr||Math.abs(e.start.y-e.end.y)<cr,vb=(e,t,n,o)=>Math.min(t,o)-Math.max(e,n)>cr,iJ=(e)=>e.reduce((t,n)=>t+Math.abs(n.start.x-n.end.x)+Math.abs(n.start.y-n.end.y),0),wp=(e,t)=>{if(Math.abs(e.start.x-e.end.x)<cr)return Math.abs(t.x-e.start.x)<cr&&t.y>=Math.min(e.start.y,e.end.y)-cr&&t.y<=Math.max(e.start.y,e.end.y)+cr;if(Math.abs(e.start.y-e.end.y)<cr)return Math.abs(t.y-e.start.y)<cr&&t.x>=Math.min(e.start.x,e.end.x)-cr&&t.x<=Math.max(e.start.x,e.end.x)+cr;return!1},e9e=(e,t,n)=>t==="start"?{start:n,end:e.end}:{start:e.start,end:n},Pmn=(e)=>({x:(e.minX+e.maxX)/2,y:(e.minY+e.maxY)/2}),Emn=(e,t,n)=>e>Math.min(t,n)+cr&&e<Math.max(t,n)-cr,kmn=(e)=>{let t=new Map;for(let n of e)t.set(Sb(n.start),(t.get(Sb(n.start))??0)+1),t.set(Sb(n.end),(t.get(Sb(n.end))??0)+1);return t},sTr=(e,t)=>t.some((n)=>{let o=(Math.abs(e.x-n.minX)<cr||Math.abs(e.x-n.maxX)<cr)&&e.y>=n.minY-cr&&e.y<=n.maxY+cr,r=(Math.abs(e.y-n.minY)<cr||Math.abs(e.y-n.maxY)<cr)&&e.x>=n.minX-cr&&e.x<=n.maxX+cr;return o||r}),aTr=(e,t)=>{let n=e.start.x,o=e.start.y,r=e.end.x,i=e.end.y;if(Math.abs(n-r)<cr){let s=Math.min(o,i),a=Math.max(o,i);return n>t.minX+cr&&n<t.maxX-cr&&a>t.minY-cr&&s<t.maxY+cr}if(Math.abs(o-i)<cr){let s=Math.min(n,r),a=Math.max(n,r);return o>t.minY+cr&&o<t.maxY-cr&&a>t.minX+cr&&s<t.maxX-cr}return!0},cTr=(e,t)=>{let n=e.start.x,o=e.start.y,r=e.end.x,i=e.end.y;if(Math.abs(n-r)<cr){let s=Math.min(o,i),a=Math.max(o,i);return(Math.abs(n-t.minX)<cr||Math.abs(n-t.maxX)<cr)&&vb(s,a,t.minY,t.maxY)}if(Math.abs(o-i)<cr){let s=Math.min(n,r),a=Math.max(n,r);return(Math.abs(o-t.minY)<cr||Math.abs(o-t.maxY)<cr)&&vb(s,a,t.minX,t.maxX)}return!1},Ihe=(e,t)=>e.length>0&&e.every((n)=>!fhe(n)&&iTr(n)&&!t.some((o)=>aTr(n,o)||cTr(n,o))),lTr=(e,t)=>{if(Math.abs(e.start.x-e.end.x)<cr){let n=e.start.x,o=Math.min(e.start.y,e.end.y),r=Math.max(e.start.y,e.end.y);return t.some((i)=>i.maxX<=n+cr&&vb(o,r,i.minY,i.maxY)&&t.some((s)=>s.minX>=n-cr&&vb(o,r,s.minY,s.maxY)&&vb(i.minY,i.maxY,s.minY,s.maxY)))}if(Math.abs(e.start.y-e.end.y)<cr){let n=e.start.y,o=Math.min(e.start.x,e.end.x),r=Math.max(e.start.x,e.end.x);return t.some((i)=>i.maxY<=n+cr&&vb(o,r,i.minX,i.maxX)&&t.some((s)=>s.minY>=n-cr&&vb(o,r,s.minX,s.maxX)&&vb(i.minX,i.maxX,s.minX,s.maxX)))}return!1},hTr=(e,t,n)=>{let o=Pmn(t),r=Pmn(n);if(Math.abs(e.start.x-e.end.x)<cr){let i=e.start.x,s=Math.min(e.start.y,e.end.y),a=Math.max(e.start.y,e.end.y);return Emn(i,o.x,r.x)&&vb(s,a,t.minY,t.maxY)&&vb(s,a,n.minY,n.maxY)}if(Math.abs(e.start.y-e.end.y)<cr){let i=e.start.y,s=Math.min(e.start.x,e.end.x),a=Math.max(e.start.x,e.end.x);return Emn(i,o.y,r.y)&&vb(s,a,t.minX,t.maxX)&&vb(s,a,n.minX,n.maxX)}return!1},dTr=(e,t)=>{let n=new Set;for(let o=0;o<t.length;o++){let r=t[o];if(!r)continue;for(let i=o+1;i<t.length;i++){let s=t[i];if(!s)continue;if(e.some((a)=>hTr(a,r,s)))n.add(`${o}:${i}`)}}return n},uTr=(e,t,n)=>{let o=dTr(e,t);return[...n].every((r)=>o.has(r))},cJ=(e)=>{let t=new Map,n=e.map((s)=>[s.start,s.end]),o=(s,a)=>{let c=Sb(s),l=Sb(a);if(!t.has(c))t.set(c,new Set);if(!t.has(l))t.set(l,new Set);t.get(c)?.add(l),t.get(l)?.add(c)};for(let s=0;s<e.length;s++){let a=e[s];if(!a||fhe(a))continue;for(let c=s+1;c<e.length;c++){let l=e[c];if(!l||fhe(l))continue;let h=Math.abs(a.start.x-a.end.x)<cr,d=Math.abs(a.start.y-a.end.y)<cr,u=Math.abs(l.start.x-l.end.x)<cr,_=Math.abs(l.start.y-l.end.y)<cr;if(h&&_){let p={x:a.start.x,y:l.start.y};if(wp(a,p)&&wp(l,p))n[s]?.push(p),n[c]?.push(p)}if(d&&u){let p={x:l.start.x,y:a.start.y};if(wp(a,p)&&wp(l,p))n[s]?.push(p),n[c]?.push(p)}}}for(let s=0;s<e.length;s++){let a=e[s];if(!a||fhe(a))continue;let c=[...new Map(n[s]?.map((l)=>[Sb(l),l]))].map(([,l])=>l).sort((l,h)=>Math.abs(a.start.x-a.end.x)<cr?l.y-h.y:l.x-h.x);for(let l=0;l+1<c.length;l++){let h=c[l],d=c[l+1];if(h&&d&&!FQ(h,d))o(h,d)}}let r=0,i=new Set;for(let s of t.keys()){if(i.has(s))continue;r++;let a=[s];i.add(s);while(a.length>0){let c=a.pop();if(!c)continue;for(let l of t.get(c)??[]){if(i.has(l))continue;i.add(l),a.push(l)}}}return r},pTr=(e,t,n)=>{let o=e,r=!0;while(r){r=!1;let i=kmn(o);for(let s=0;s<o.length;s++){let a=o[s];if(!a)continue;for(let c of["start","end"]){let l=a[c];if(i.get(Sb(l))!==1)continue;let h=[],d=Math.abs(a.start.x-a.end.x)<cr,u=Math.abs(a.start.y-a.end.y)<cr;for(let p=0;p<o.length;p++){if(s===p)continue;let m=o[p];if(!m)continue;if(d&&Math.abs(m.start.y-m.end.y)<cr){let A={x:a.start.x,y:m.start.y};if(wp(m,A))h.push(A)}if(u&&Math.abs(m.start.x-m.end.x)<cr){let A={x:m.start.x,y:a.start.y};if(wp(m,A))h.push(A)}}let _=h.filter((p)=>!FQ(p,l)).map((p)=>({point:p,line:e9e(a,c,p)})).filter(({line:p})=>iJ([p])>iJ([a])+cr).filter(({line:p})=>!n?.preserveOriginalSpan||wp(p,l)).filter(({line:p})=>Ihe([p],t)).sort((p,m)=>iJ([p.line])-iJ([m.line])||JSON.stringify(p.point).localeCompare(JSON.stringify(m.point))).at(0);if(!_)continue;o=o.map((p,m)=>m===s?_.line:p),r=!0;break}if(r)break}}return o},mTr=(e,t)=>{let n=[],o=Math.abs(e.start.x-e.end.x)<cr,r=Math.abs(e.start.y-e.end.y)<cr;for(let i of t){if(i===e)continue;let s=Math.abs(i.start.x-i.end.x)<cr,a=Math.abs(i.start.y-i.end.y)<cr;if(o&&a){let c={x:e.start.x,y:i.start.y};if(wp(e,c)&&wp(i,c))n.push(c)}if(r&&s){let c={x:i.start.x,y:e.start.y};if(wp(e,c)&&wp(i,c))n.push(c)}}return n},_Tr=(e,t,n)=>{let o=e,r=!0;while(r){r=!1;let i=kmn(o),s=cJ(o);for(let a=0;a<o.length;a++){let c=o[a];if(!c)continue;let l=mTr(c,o).filter((h)=>!FQ(h,c.start)&&!FQ(h,c.end));if(l.length===0)continue;for(let h of["start","end"]){let d=c[h];if(i.get(Sb(d))!==1)continue;if(sTr(d,t))continue;let u=l.map((A)=>({point:A,distance:Math.abs(A.x-d.x)+Math.abs(A.y-d.y)})).sort((A,g)=>A.distance-g.distance).at(0);if(!u)continue;let _={start:d,end:u.point};if(lTr(_,t))continue;let p=e9e(c,h,u.point);if(!Ihe([p],t))continue;let m=o.map((A,g)=>g===a?p:A);if(cJ(m)>s)continue;if(n&&!uTr(m,t,n))continue;o=m,r=!0;break}if(r)break}}return o},gTr=(e)=>{let{start:t,end:n}=e;if(t.y===n.y&&t.x>n.x)[t,n]=[{x:n.x,y:t.y},{x:t.x,y:n.y}];else if(t.x===n.x&&t.y>n.y)[t,n]=[{x:t.x,y:n.y},{x:n.x,y:t.y}];return{start:t,end:n}},ett=(e)=>{if(!e||e.length===0)return[];let t=e.map(gTr),n=[],o=[];for(let a of t)if(a.start.y===a.end.y)n.push(a);else if(a.start.x===a.end.x)o.push(a);let r=[],i=new Map;for(let a of n){let c=i.get(a.start.y)??[];c.push(a),i.set(a.start.y,c)}for(let[,a]of i){a.sort((l,h)=>l.start.x-h.start.x);let c;for(let l of a){if(!c){c={...l};continue}if(l.start.x<=c.end.x)c.end.x=Math.max(c.end.x,l.end.x);else r.push(c),c={...l}}if(c)r.push(c)}let s=new Map;for(let a of o){let c=s.get(a.start.x)??[];c.push(a),s.set(a.start.x,c)}for(let[,a]of s){a.sort((l,h)=>l.start.y-h.start.y);let c;for(let l of a){if(!c){c={...l};continue}if(l.start.y<=c.end.y)c.end.y=Math.max(c.end.y,l.end.y);else r.push(c),c={...l}}if(c)r.push(c)}return r},Ahe=(e)=>{let t=[];for(let n=0;n+1<e.length;n++){let o=e[n],r=e[n+1];if(!o||!r||FQ(o,r))continue;t.push({start:o,end:r})}return t},ATr=(e,t)=>{let n=Ahe(e),o=e.at(0),r=e.at(-1);if(!o||!r||n.length<2)return n;let i=[];if(Math.abs(o.x-r.x)<cr||Math.abs(o.y-r.y)<cr)i.push([{start:o,end:r}]);else i.push(Ahe([o,{x:o.x,y:r.y},r]),Ahe([o,{x:r.x,y:o.y},r]));let s=[...new Set(e.map((l)=>l.x))],a=[...new Set(e.map((l)=>l.y))];for(let l of s){if(Math.abs(l-o.x)<cr||Math.abs(l-r.x)<cr)continue;i.push(Ahe([o,{x:l,y:o.y},{x:l,y:r.y},r]))}for(let l of a){if(Math.abs(l-o.y)<cr||Math.abs(l-r.y)<cr)continue;i.push(Ahe([o,{x:o.x,y:l},{x:r.x,y:l},r]))}return i.filter((l)=>l.length<n.length).filter((l)=>Ihe(l,t)).sort((l,h)=>l.length-h.length||iJ(l)-iJ(h)||JSON.stringify(l).localeCompare(JSON.stringify(h))).at(0)??n},fTr=(e,t)=>{let n=new Map,o=new Map,r=(a)=>{let c=Sb(a);if(n.set(c,a),!o.has(c))o.set(c,new Set);return c};for(let a of e){if(fhe(a))continue;let c=r(a.start),l=r(a.end);o.get(c)?.add(l),o.get(l)?.add(c)}let i=new Set,s=[];for(let[a,c]of o){if(c.size===2)continue;for(let l of c){let h=KIe(n.get(a),n.get(l));if(i.has(h))continue;let d=[n.get(a)],u=a,_=l;while(!0){i.add(KIe(n.get(u),n.get(_))),d.push(n.get(_));let p=o.get(_);if(!p||p.size!==2)break;let m=[...p].find((g)=>g!==u);if(!m)break;let A=KIe(n.get(_),n.get(m));if(i.has(A))break;u=_,_=m}s.push(...ATr(d,t))}}for(let[a,c]of o)for(let l of c){let h=KIe(n.get(a),n.get(l));if(i.has(h))continue;i.add(h),s.push({start:n.get(a),end:n.get(l)})}return s},yTr=(e,t)=>{let n=e,o=!0;while(o){o=!1;let r=cJ(n),i=ett(n).length;for(let s=0;s<n.length;s++){let a=n[s];if(!a)continue;let c=Math.abs(a.start.x-a.end.x)<cr,l=Math.abs(a.start.y-a.end.y)<cr;if(!c&&!l)continue;for(let h=0;h<n.length;h++){if(s===h)continue;let d=n[h];if(!d)continue;let u=Math.abs(d.start.x-d.end.x)<cr,_=Math.abs(d.start.y-d.end.y)<cr;if(c!==u||l!==_)continue;if(c&&Math.abs(a.start.x-d.start.x)<cr||l&&Math.abs(a.start.y-d.start.y)<cr)continue;if(!n.some((f,y)=>{if(y===s||y===h)return!1;if(c&&Math.abs(f.start.y-f.end.y)<cr)return wp(f,{x:a.start.x,y:f.start.y})&&wp(a,{x:a.start.x,y:f.start.y})&&wp(f,{x:d.start.x,y:f.start.y})&&wp(d,{x:d.start.x,y:f.start.y});if(l&&Math.abs(f.start.x-f.end.x)<cr)return wp(f,{x:f.start.x,y:a.start.y})&&wp(a,{x:f.start.x,y:a.start.y})&&wp(f,{x:f.start.x,y:d.start.y})&&wp(d,{x:f.start.x,y:d.start.y});return!1}))continue;let m;if(c)m={start:{x:d.start.x,y:a.start.y},end:{x:d.start.x,y:a.end.y}};else m={start:{x:a.start.x,y:d.start.y},end:{x:a.end.x,y:d.start.y}};if(!Ihe([m],t))continue;let A=n.map((f,y)=>{if(y===s)return m;return f});if(cJ(A)>r)continue;let g=ett(A);if(g.length>=i)continue;n=g,o=!0;break}if(o)break}}return n},xTr=(e,t)=>{let n=e,o=!0;while(o){o=!1;let r=cJ(n);for(let i=0;i<n.length;i++){let s=n[i];if(!s)continue;let a=Math.abs(s.start.y-s.end.y)<cr,c=Math.abs(s.start.x-s.end.x)<cr;if(!a&&!c)continue;for(let l=0;l<n.length;l++){if(i===l)continue;let h=n[l];if(!h)continue;let d=Math.abs(h.start.y-h.end.y)<cr,u=Math.abs(h.start.x-h.end.x)<cr;if(a!==d)continue;if(c!==u)continue;let _=[s.start,s.end],p;if(a)p=_.map((f)=>({x:f.x,y:h.start.y}));else p=_.map((f)=>({x:h.start.x,y:f.y}));if(!p.every((f)=>wp(h,f)))continue;let m=new Map,A=!0;for(let f=0;f<_.length;f++){let y=_[f],x=p[f];if(!y||!x){A=!1;break}let C=n.findIndex((M,B)=>{if(B===i||B===l)return!1;let T=Math.abs(M.start.y-M.end.y)<cr,N=Math.abs(M.start.x-M.end.x)<cr;return(a&&N||c&&T)&&wp(M,y)});if(C===-1)continue;let b=n[C];if(!b){A=!1;break}let I=FQ(b.start,y),v=FQ(b.end,y);if(!I&&!v&&wp(b,x))continue;if(!I&&!v){A=!1;break}let P;if(I)P=e9e(b,"start",x);else P=e9e(b,"end",x);if(!Ihe([P],t)){A=!1;break}m.set(C,P)}if(!A)continue;let g=n.map((f,y)=>m.get(y)??f).filter((f,y)=>y!==i);if(cJ(g)>r)continue;n=g,o=!0;break}if(o)break}}return n},Lmn=((e)=>(e[e.MergeAlignedSegments=0]="MergeAlignedSegments",e[e.SimplifyChains=1]="SimplifyChains",e[e.ConnectDanglingEndpoints=2]="ConnectDanglingEndpoints",e[e.AlignParallelLinesAcrossConnectors=3]="AlignParallelLinesAcrossConnectors",e[e.RemoveRedundantParallelBridges=4]="RemoveRedundantParallelBridges",e[e.TrimDanglingOverhangs=5]="TrimDanglingOverhangs",e))(Lmn||{}),CTr=class extends co{constructor(e){super();this.params=e;let t=e.offsetX??0,n=e.offsetY??0;this._inputRects=e.cellContents.map((o)=>({minX:o.x+t,minY:o.y+n,maxX:o.x+o.width+t,maxY:o.y+o.height+n}))}params;mergedOriginalLines=[];reducedLines=[];_stage=0;_currentLines=[];_inputRects;_step(){let{outlineLines:e}=this.params,t=this.params.offsetX??0,n=this.params.offsetY??0,o=this._inputRects;switch(this._stage){case 0:{let i=ett(e.map((s)=>({start:{x:s.start.x+t,y:s.start.y+n},end:{x:s.end.x+t,y:s.end.y+n}})));this._currentLines=i,this.mergedOriginalLines=i.map((s)=>({start:{x:s.start.x,y:s.start.y},end:{x:s.end.x,y:s.end.y}}));break}case 1:this._currentLines=fTr(this._currentLines,o);break;case 2:this._currentLines=pTr(this._currentLines,o);break;case 3:this._currentLines=yTr(this._currentLines,o);break;case 4:this._currentLines=xTr(this._currentLines,o);break;case 5:this._currentLines=_Tr(this._currentLines,o),this.reducedLines=this._currentLines.map((i)=>({start:{x:i.start.x-t,y:i.start.y-n},end:{x:i.end.x-t,y:i.end.y-n}})),this.mergedOriginalLines=this.mergedOriginalLines.map((i)=>({start:{x:i.start.x-t,y:i.start.y-n},end:{x:i.end.x-t,y:i.end.y-n}})),this.solved=!0;break}let r=this.getNextStage(this._stage);if(r)this._stage=r}getNextStage(e){let t=Object.values(Lmn);return t[t.indexOf(e)+1]}getOutput(){return this.reducedLines}getConstructorParams(){return[this.params]}visualize(){let{cellContents:e,outlineLines:t}=this.params;return{rects:e.map((n)=>({center:{x:n.x+n.width/2,y:n.y+n.height/2},width:n.width,height:n.height,fill:"rgba(255, 165, 0, 0.2)",stroke:"#c87000"})),lines:[...t.map((n)=>({points:[n.start,n.end],strokeColor:"rgba(180, 180, 180, 0.4)",strokeWidth:1,strokeDash:[4,4]})),...this._currentLines.map((n)=>({points:[n.start,n.end],strokeColor:"#0055cc",strokeWidth:2}))]}}},Ei=0.001,Hmn=(e,t,n=Ei)=>Math.abs(e.x-t.x)<n&&Math.abs(e.y-t.y)<n,Zet=(e)=>`${e.x.toFixed(4)},${e.y.toFixed(4)}`,ZIe=(e)=>Hmn(e.start,e.end),bTr=(e)=>Math.abs(e.start.x-e.end.x)<Ei||Math.abs(e.start.y-e.end.y)<Ei,sJ=(e,t,n,o)=>Math.min(t,o)-Math.max(e,n)>Ei,t9e=(e)=>e.reduce((t,n)=>t+Math.abs(n.start.x-n.end.x)+Math.abs(n.start.y-n.end.y),0),$Ie=(e,t)=>{if(Math.abs(e.start.x-e.end.x)<Ei)return Math.abs(t.x-e.start.x)<Ei&&t.y>=Math.min(e.start.y,e.end.y)-Ei&&t.y<=Math.max(e.start.y,e.end.y)+Ei;if(Math.abs(e.start.y-e.end.y)<Ei)return Math.abs(t.y-e.start.y)<Ei&&t.x>=Math.min(e.start.x,e.end.x)-Ei&&t.x<=Math.max(e.start.x,e.end.x)+Ei;return!1},xhe=(e)=>({x:(e.minX+e.maxX)/2,y:(e.minY+e.maxY)/2}),Mmn=(e,t,n)=>e>Math.min(t,n)+Ei&&e<Math.max(t,n)-Ei,ITr=(e,t)=>{let n=e.start.x,o=e.start.y,r=e.end.x,i=e.end.y;if(Math.abs(n-r)<Ei){let s=Math.min(o,i),a=Math.max(o,i);return n>t.minX+Ei&&n<t.maxX-Ei&&a>t.minY-Ei&&s<t.maxY+Ei}if(Math.abs(o-i)<Ei){let s=Math.min(n,r),a=Math.max(n,r);return o>t.minY+Ei&&o<t.maxY-Ei&&a>t.minX+Ei&&s<t.maxX-Ei}return!0},vTr=(e,t)=>{let n=e.start.x,o=e.start.y,r=e.end.x,i=e.end.y;if(Math.abs(n-r)<Ei){let s=Math.min(o,i),a=Math.max(o,i);return(Math.abs(n-t.minX)<Ei||Math.abs(n-t.maxX)<Ei)&&sJ(s,a,t.minY,t.maxY)}if(Math.abs(o-i)<Ei){let s=Math.min(n,r),a=Math.max(n,r);return(Math.abs(o-t.minY)<Ei||Math.abs(o-t.maxY)<Ei)&&sJ(s,a,t.minX,t.maxX)}return!1},ttt=(e,t)=>e.length>0&&e.every((n)=>!ZIe(n)&&bTr(n)&&!t.some((o)=>ITr(n,o)||vTr(n,o))),Fmn=(e,t,n)=>{let o=xhe(t),r=xhe(n);if(Math.abs(e.start.x-e.end.x)<Ei){let i=e.start.x,s=Math.min(e.start.y,e.end.y),a=Math.max(e.start.y,e.end.y);return Mmn(i,o.x,r.x)&&sJ(s,a,t.minY,t.maxY)&&sJ(s,a,n.minY,n.maxY)}if(Math.abs(e.start.y-e.end.y)<Ei){let i=e.start.y,s=Math.min(e.start.x,e.end.x),a=Math.max(e.start.x,e.end.x);return Mmn(i,o.y,r.y)&&sJ(s,a,t.minX,t.maxX)&&sJ(s,a,n.minX,n.maxX)}return!1},i9e=(e,t)=>{let n=new Set;for(let o=0;o<t.length;o++){let r=t[o];if(!r)continue;for(let i=o+1;i<t.length;i++){let s=t[i];if(!s)continue;if(e.some((a)=>Fmn(a,r,s)))n.add(`${o}:${i}`)}}return n},STr=(e,t,n)=>{let o=i9e(e,t);return[...n].every((r)=>o.has(r))},zmn=(e,t)=>{let n=new Set,o=new Set;for(let r of t)n.add(r.minX),n.add(r.maxX),n.add(xhe(r).x),o.add(r.minY),o.add(r.maxY),o.add(xhe(r).y);for(let r of e)n.add(r.start.x),n.add(r.end.x),o.add(r.start.y),o.add(r.end.y);return{xs:[...n].sort((r,i)=>r-i),ys:[...o].sort((r,i)=>r-i)}},PTr=(e,t,n,o)=>e.some((r)=>{if(Math.abs(r.start.x-r.end.x)>=Ei)return!1;if(Math.abs(r.start.x-t)>=Ei)return!1;let i=Math.min(r.start.y,r.end.y),s=Math.max(r.start.y,r.end.y);return n>=i-Ei&&o<=s+Ei}),ETr=(e,t,n,o)=>e.some((r)=>{if(Math.abs(r.start.y-r.end.y)>=Ei)return!1;if(Math.abs(r.start.y-t)>=Ei)return!1;let i=Math.min(r.start.x,r.end.x),s=Math.max(r.start.x,r.end.x);return n>=i-Ei&&o<=s+Ei}),MTr=(e,t)=>{let{xs:n,ys:o}=zmn(e,t),r=n.length-1,i=o.length-1,s=new Map,a=(l,h)=>`${l}:${h}`,c=0;for(let l=0;l<r;l++)for(let h=0;h<i;h++){let d=a(l,h);if(s.has(d))continue;let u=[{x:l,y:h}];s.set(d,c);while(u.length>0){let _=u.pop();if(!_)continue;let p=[{x:_.x-1,y:_.y},{x:_.x+1,y:_.y},{x:_.x,y:_.y-1},{x:_.x,y:_.y+1}];for(let m of p){if(m.x<0||m.x>=r||m.y<0||m.y>=i)continue;let A=a(m.x,m.y);if(s.has(A))continue;let g=!1;if(m.x!==_.x){let f=n[Math.max(m.x,_.x)],y=o[_.y],x=o[_.y+1];if(f===void 0||y===void 0||x===void 0)continue;g=PTr(e,f,y,x)}else{let f=o[Math.max(m.y,_.y)],y=n[_.x],x=n[_.x+1];if(f===void 0||y===void 0||x===void 0)continue;g=ETr(e,f,y,x)}if(g)continue;s.set(A,c),u.push(m)}}c++}return t.map((l)=>{let h=xhe(l),d=n.findIndex((_,p)=>p+1<n.length&&h.x>=_-Ei&&h.x<=(n[p+1]??_)+Ei),u=o.findIndex((_,p)=>p+1<o.length&&h.y>=_-Ei&&h.y<=(o[p+1]??_)+Ei);return s.get(a(d,u))??-1})},n9e=(e,t)=>{let n=MTr(e,t),o=0;for(let r=0;r<n.length;r++)for(let i=r+1;i<n.length;i++)if(n[r]===n[i])o++;return o},wmn=(e)=>{let t=new Map,n=e.map((s)=>[s.start,s.end]),o=(s,a)=>{let c=Zet(s),l=Zet(a);if(!t.has(c))t.set(c,new Set);if(!t.has(l))t.set(l,new Set);t.get(c)?.add(l),t.get(l)?.add(c)};for(let s=0;s<e.length;s++){let a=e[s];if(!a||ZIe(a))continue;for(let c=s+1;c<e.length;c++){let l=e[c];if(!l||ZIe(l))continue;let h=Math.abs(a.start.x-a.end.x)<Ei,d=Math.abs(a.start.y-a.end.y)<Ei,u=Math.abs(l.start.x-l.end.x)<Ei,_=Math.abs(l.start.y-l.end.y)<Ei;if(h&&_){let p={x:a.start.x,y:l.start.y};if($Ie(a,p)&&$Ie(l,p))n[s]?.push(p),n[c]?.push(p)}if(d&&u){let p={x:l.start.x,y:a.start.y};if($Ie(a,p)&&$Ie(l,p))n[s]?.push(p),n[c]?.push(p)}}}for(let s=0;s<e.length;s++){let a=e[s];if(!a||ZIe(a))continue;let c=[...new Map(n[s]?.map((l)=>[Zet(l),l]))].map(([,l])=>l).sort((l,h)=>Math.abs(a.start.x-a.end.x)<Ei?l.y-h.y:l.x-h.x);for(let l=0;l+1<c.length;l++){let h=c[l],d=c[l+1];if(h&&d&&!Hmn(h,d))o(h,d)}}let r=0,i=new Set;for(let s of t.keys()){if(i.has(s))continue;r++;let a=[s];i.add(s);while(a.length>0){let c=a.pop();if(!c)continue;for(let l of t.get(c)??[]){if(i.has(l))continue;i.add(l),a.push(l)}}}return r},wTr=(e)=>{let{start:t,end:n}=e;if(t.y===n.y&&t.x>n.x)[t,n]=[{x:n.x,y:t.y},{x:t.x,y:n.y}];else if(t.x===n.x&&t.y>n.y)[t,n]=[{x:t.x,y:n.y},{x:n.x,y:t.y}];return{start:t,end:n}},rtt=(e)=>{if(!e||e.length===0)return[];let t=e.map(wTr),n=[],o=[];for(let a of t)if(a.start.y===a.end.y)n.push(a);else if(a.start.x===a.end.x)o.push(a);let r=[],i=new Map;for(let a of n){let c=i.get(a.start.y)??[];c.push(a),i.set(a.start.y,c)}for(let[,a]of i){a.sort((l,h)=>l.start.x-h.start.x);let c;for(let l of a){if(!c){c={...l};continue}if(l.start.x<=c.end.x+Ei)c.end.x=Math.max(c.end.x,l.end.x);else r.push(c),c={...l}}if(c)r.push(c)}let s=new Map;for(let a of o){let c=s.get(a.start.x)??[];c.push(a),s.set(a.start.x,c)}for(let[,a]of s){a.sort((l,h)=>l.start.y-h.start.y);let c;for(let l of a){if(!c){c={...l};continue}if(l.start.y<=c.end.y+Ei)c.end.y=Math.max(c.end.y,l.end.y);else r.push(c),c={...l}}if(c)r.push(c)}return r},BTr=(e,t,n,o)=>{let r=e;while(!0){let i=i9e(r,n),s=[...o].find((u)=>!i.has(u));if(!s)break;let[a,c]=s.split(":"),l=n[Number(a)],h=n[Number(c)];if(!l||!h)break;let d=t.filter((u)=>Fmn(u,l,h)).sort((u,_)=>t9e([u])-t9e([_])||JSON.stringify(u).localeCompare(JSON.stringify(_))).at(0);if(!d)break;r=rtt([...r,d])}return r},TTr=(e,t,n)=>{let o=e;while(!0){let r=n9e(o,n);if(r===0)break;let{xs:i,ys:s}=zmn(o,n),a=[];for(let l=0;l<o.length;l++){let h=o[l];if(!h)continue;if(Math.abs(h.start.y-h.end.y)<Ei){let d=Math.min(h.start.x,h.end.x),u=Math.max(h.start.x,h.end.x);for(let _ of i){if(_>=d-Ei&&_<=u+Ei)continue;let p={start:{x:Math.min(_,d),y:h.start.y},end:{x:Math.max(_,u),y:h.start.y}};if(!ttt([p],n))continue;a.push(o.map((m,A)=>{if(A===l)return p;return m}))}}if(Math.abs(h.start.x-h.end.x)<Ei){let d=Math.min(h.start.y,h.end.y),u=Math.max(h.start.y,h.end.y);for(let _ of s){if(_>=d-Ei&&_<=u+Ei)continue;let p={start:{x:h.start.x,y:Math.min(_,d)},end:{x:h.start.x,y:Math.max(_,u)}};if(!ttt([p],n))continue;a.push(o.map((m,A)=>{if(A===l)return p;return m}))}}}for(let l of t)a.push([...o,l]);let c=a.map((l)=>({lines:rtt(l),shared:n9e(l,n)})).filter((l)=>l.shared<r).sort((l,h)=>l.shared-h.shared||l.lines.length-h.lines.length||t9e(l.lines)-t9e(h.lines)).at(0);if(!c)break;o=c.lines}return o},DTr=(e,t)=>{let n=e,o=!0;while(o){o=!1;let r=i9e(n,t),i=n9e(n,t),s=wmn(n);for(let a=0;a<n.length;a++){let c=n.filter((l,h)=>h!==a);if(!ttt(c,t))continue;if(!STr(c,t,r))continue;if(n9e(c,t)>i)continue;if(wmn(c)>s)continue;n=c,o=!0;break}}return n},Omn=((e)=>(e[e.RestoreMissingSeparators=0]="RestoreMissingSeparators",e[e.FixSharedCellRegions=1]="FixSharedCellRegions",e[e.RemoveRedundantSeparators=2]="RemoveRedundantSeparators",e))(Omn||{}),NTr=class extends co{constructor(e){super();this.params=e,this._inputRects=e.cellContents.map((t)=>({minX:t.x,minY:t.y,maxX:t.x+t.width,maxY:t.y+t.height})),this._currentLines=e.reducedLines}params;repairedLines=[];_stage=0;_currentLines=[];_inputRects;_step(){let e=rtt(this.params.originalLines),t=this._inputRects;switch(this._stage){case 0:{let o=i9e(e,t);this._currentLines=BTr(this._currentLines,e,t,o);break}case 1:this._currentLines=TTr(this._currentLines,e,t);break;case 2:this._currentLines=DTr(this._currentLines,t),this.repairedLines=this._currentLines,this.solved=!0;break}let n=this.getNextStage(this._stage);if(n)this._stage=n}getNextStage(e){let t=Object.values(Omn);return t[t.indexOf(e)+1]}getOutput(){return this.repairedLines}getConstructorParams(){return[this.params]}visualize(){let{cellContents:e,reducedLines:t}=this.params;return{rects:e.map((n)=>({center:{x:n.x+n.width/2,y:n.y+n.height/2},width:n.width,height:n.height,fill:"rgba(255, 165, 0, 0.2)",stroke:"#c87000"})),lines:[...t.map((n)=>({points:[n.start,n.end],strokeColor:"rgba(180, 180, 180, 0.4)",strokeWidth:1,strokeDash:[4,4]})),...this._currentLines.map((n)=>({points:[n.start,n.end],strokeColor:"#cc5500",strokeWidth:2}))]}}},vo=0.001,zV=(e,t,n=vo)=>Math.abs(e.x-t.x)<n&&Math.abs(e.y-t.y)<n,jw=(e)=>`${e.x.toFixed(4)},${e.y.toFixed(4)}`,yhe=(e)=>zV(e.start,e.end),RTr=(e)=>Math.abs(e.start.x-e.end.x)<vo||Math.abs(e.start.y-e.end.y)<vo,aJ=(e,t,n,o)=>Math.min(t,o)-Math.max(e,n)>vo,qIe=(e)=>e.reduce((t,n)=>t+Math.abs(n.start.x-n.end.x)+Math.abs(n.start.y-n.end.y),0),Dd=(e,t)=>{if(Math.abs(e.start.x-e.end.x)<vo)return Math.abs(t.x-e.start.x)<vo&&t.y>=Math.min(e.start.y,e.end.y)-vo&&t.y<=Math.max(e.start.y,e.end.y)+vo;if(Math.abs(e.start.y-e.end.y)<vo)return Math.abs(t.y-e.start.y)<vo&&t.x>=Math.min(e.start.x,e.end.x)-vo&&t.x<=Math.max(e.start.x,e.end.x)+vo;return!1},o9e=(e,t,n)=>t==="start"?{start:n,end:e.end}:{start:e.start,end:n},r9e=(e,t)=>t==="start"?e.end:e.start,Che=(e)=>({x:(e.minX+e.maxX)/2,y:(e.minY+e.maxY)/2}),Bmn=(e,t,n)=>e>Math.min(t,n)+vo&&e<Math.max(t,n)-vo,Vmn=(e)=>{let t=new Map;for(let n of e)t.set(jw(n.start),(t.get(jw(n.start))??0)+1),t.set(jw(n.end),(t.get(jw(n.end))??0)+1);return t},QTr=(e,t)=>t.some((n)=>{let o=(Math.abs(e.x-n.minX)<vo||Math.abs(e.x-n.maxX)<vo)&&e.y>=n.minY-vo&&e.y<=n.maxY+vo,r=(Math.abs(e.y-n.minY)<vo||Math.abs(e.y-n.maxY)<vo)&&e.x>=n.minX-vo&&e.x<=n.maxX+vo;return o||r}),ntt=(e,t)=>{if(Math.abs(e.start.x-e.end.x)>=vo)return;if(Math.abs(e.start.y-t)<vo)return"start";if(Math.abs(e.end.y-t)<vo)return"end";return},Tmn=(e,t)=>{if(Math.abs(e.start.y-e.end.y)>=vo)return;if(Math.abs(e.start.x-t)<vo)return"start";if(Math.abs(e.end.x-t)<vo)return"end";return},kTr=(e,t)=>{let n=e.start.x,o=e.start.y,r=e.end.x,i=e.end.y;if(Math.abs(n-r)<vo){let s=Math.min(o,i),a=Math.max(o,i);return n>t.minX+vo&&n<t.maxX-vo&&a>t.minY-vo&&s<t.maxY+vo}if(Math.abs(o-i)<vo){let s=Math.min(n,r),a=Math.max(n,r);return o>t.minY+vo&&o<t.maxY-vo&&a>t.minX+vo&&s<t.maxX-vo}return!0},LTr=(e,t)=>{let n=e.start.x,o=e.start.y,r=e.end.x,i=e.end.y;if(Math.abs(n-r)<vo){let s=Math.min(o,i),a=Math.max(o,i);return(Math.abs(n-t.minX)<vo||Math.abs(n-t.maxX)<vo)&&aJ(s,a,t.minY,t.maxY)}if(Math.abs(o-i)<vo){let s=Math.min(n,r),a=Math.max(n,r);return(Math.abs(o-t.minY)<vo||Math.abs(o-t.maxY)<vo)&&aJ(s,a,t.minX,t.maxX)}return!1},Yx=(e,t)=>e.length>0&&e.every((n)=>!yhe(n)&&RTr(n)&&!t.some((o)=>kTr(n,o)||LTr(n,o))),HTr=(e,t,n)=>{let o=Che(t),r=Che(n);if(Math.abs(e.start.x-e.end.x)<vo){let i=e.start.x,s=Math.min(e.start.y,e.end.y),a=Math.max(e.start.y,e.end.y);return Bmn(i,o.x,r.x)&&aJ(s,a,t.minY,t.maxY)&&aJ(s,a,n.minY,n.maxY)}if(Math.abs(e.start.y-e.end.y)<vo){let i=e.start.y,s=Math.min(e.start.x,e.end.x),a=Math.max(e.start.x,e.end.x);return Bmn(i,o.y,r.y)&&aJ(s,a,t.minX,t.maxX)&&aJ(s,a,n.minX,n.maxX)}return!1},Kw=(e,t)=>{let n=new Set;for(let o=0;o<t.length;o++){let r=t[o];if(!r)continue;for(let i=o+1;i<t.length;i++){let s=t[i];if(!s)continue;if(e.some((a)=>HTr(a,r,s)))n.add(`${o}:${i}`)}}return n},vhe=(e,t,n)=>{let o=Kw(e,t);return[...n].every((r)=>o.has(r))},FTr=(e,t)=>{let n=new Set,o=new Set;for(let r of t)n.add(r.minX),n.add(r.maxX),n.add(Che(r).x),o.add(r.minY),o.add(r.maxY),o.add(Che(r).y);for(let r of e)n.add(r.start.x),n.add(r.end.x),o.add(r.start.y),o.add(r.end.y);return{xs:[...n].sort((r,i)=>r-i),ys:[...o].sort((r,i)=>r-i)}},zTr=(e,t,n,o)=>e.some((r)=>{if(Math.abs(r.start.x-r.end.x)>=vo)return!1;if(Math.abs(r.start.x-t)>=vo)return!1;let i=Math.min(r.start.y,r.end.y),s=Math.max(r.start.y,r.end.y);return n>=i-vo&&o<=s+vo}),OTr=(e,t,n,o)=>e.some((r)=>{if(Math.abs(r.start.y-r.end.y)>=vo)return!1;if(Math.abs(r.start.y-t)>=vo)return!1;let i=Math.min(r.start.x,r.end.x),s=Math.max(r.start.x,r.end.x);return n>=i-vo&&o<=s+vo}),VTr=(e,t)=>{let{xs:n,ys:o}=FTr(e,t),r=n.length-1,i=o.length-1,s=new Map,a=(l,h)=>`${l}:${h}`,c=0;for(let l=0;l<r;l++)for(let h=0;h<i;h++){let d=a(l,h);if(s.has(d))continue;let u=[{x:l,y:h}];s.set(d,c);while(u.length>0){let _=u.pop();if(!_)continue;let p=[{x:_.x-1,y:_.y},{x:_.x+1,y:_.y},{x:_.x,y:_.y-1},{x:_.x,y:_.y+1}];for(let m of p){if(m.x<0||m.x>=r||m.y<0||m.y>=i)continue;let A=a(m.x,m.y);if(s.has(A))continue;let g=!1;if(m.x!==_.x){let f=n[Math.max(m.x,_.x)],y=o[_.y],x=o[_.y+1];if(f===void 0||y===void 0||x===void 0)continue;g=zTr(e,f,y,x)}else{let f=o[Math.max(m.y,_.y)],y=n[_.x],x=n[_.x+1];if(f===void 0||y===void 0||x===void 0)continue;g=OTr(e,f,y,x)}if(g)continue;s.set(A,c),u.push(m)}}c++}return t.map((l)=>{let h=Che(l),d=n.findIndex((_,p)=>p+1<n.length&&h.x>=_-vo&&h.x<=(n[p+1]??_)+vo),u=o.findIndex((_,p)=>p+1<o.length&&h.y>=_-vo&&h.y<=(o[p+1]??_)+vo);return s.get(a(d,u))??-1})},AS=(e,t)=>{let n=VTr(e,t),o=0;for(let r=0;r<n.length;r++)for(let i=r+1;i<n.length;i++)if(n[r]===n[i])o++;return o},y9=(e)=>{let t=new Map,n=e.map((s)=>[s.start,s.end]),o=(s,a)=>{let c=jw(s),l=jw(a);if(!t.has(c))t.set(c,new Set);if(!t.has(l))t.set(l,new Set);t.get(c)?.add(l),t.get(l)?.add(c)};for(let s=0;s<e.length;s++){let a=e[s];if(!a||yhe(a))continue;for(let c=s+1;c<e.length;c++){let l=e[c];if(!l||yhe(l))continue;let h=Math.abs(a.start.x-a.end.x)<vo,d=Math.abs(a.start.y-a.end.y)<vo,u=Math.abs(l.start.x-l.end.x)<vo,_=Math.abs(l.start.y-l.end.y)<vo;if(h&&_){let p={x:a.start.x,y:l.start.y};if(Dd(a,p)&&Dd(l,p))n[s]?.push(p),n[c]?.push(p)}if(d&&u){let p={x:l.start.x,y:a.start.y};if(Dd(a,p)&&Dd(l,p))n[s]?.push(p),n[c]?.push(p)}}}for(let s=0;s<e.length;s++){let a=e[s];if(!a||yhe(a))continue;let c=[...new Map(n[s]?.map((l)=>[jw(l),l]))].map(([,l])=>l).sort((l,h)=>Math.abs(a.start.x-a.end.x)<vo?l.y-h.y:l.x-h.x);for(let l=0;l+1<c.length;l++){let h=c[l],d=c[l+1];if(h&&d&&!zV(h,d))o(h,d)}}let r=0,i=new Set;for(let s of t.keys()){if(i.has(s))continue;r++;let a=[s];i.add(s);while(a.length>0){let c=a.pop();if(!c)continue;for(let l of t.get(c)??[]){if(i.has(l))continue;i.add(l),a.push(l)}}}return r},ott=(e,t,n)=>{let o=e,r=!0;while(r){r=!1;let i=Vmn(o);for(let s=0;s<o.length;s++){let a=o[s];if(!a)continue;for(let c of["start","end"]){let l=a[c];if(i.get(jw(l))!==1)continue;let h=[],d=Math.abs(a.start.x-a.end.x)<vo,u=Math.abs(a.start.y-a.end.y)<vo;for(let p=0;p<o.length;p++){if(s===p)continue;let m=o[p];if(!m)continue;if(d&&Math.abs(m.start.y-m.end.y)<vo){let A={x:a.start.x,y:m.start.y};if(Dd(m,A))h.push(A)}if(u&&Math.abs(m.start.x-m.end.x)<vo){let A={x:m.start.x,y:a.start.y};if(Dd(m,A))h.push(A)}}let _=h.filter((p)=>!zV(p,l)).map((p)=>({point:p,line:o9e(a,c,p)})).filter(({line:p})=>qIe([p])>qIe([a])+vo).filter(({line:p})=>!n?.preserveOriginalSpan||Dd(p,l)).filter(({line:p})=>Yx([p],t)).sort((p,m)=>qIe([p.line])-qIe([m.line])||JSON.stringify(p.point).localeCompare(JSON.stringify(m.point))).at(0);if(!_)continue;o=o.map((p,m)=>m===s?_.line:p),r=!0;break}if(r)break}}return o},YTr=(e,t)=>{let n=[],o=Math.abs(e.start.x-e.end.x)<vo,r=Math.abs(e.start.y-e.end.y)<vo;for(let i of t){if(i===e)continue;let s=Math.abs(i.start.x-i.end.x)<vo,a=Math.abs(i.start.y-i.end.y)<vo;if(o&&a){let c={x:e.start.x,y:i.start.y};if(Dd(e,c)&&Dd(i,c))n.push(c)}if(r&&s){let c={x:i.start.x,y:e.start.y};if(Dd(e,c)&&Dd(i,c))n.push(c)}}return n},Dmn=(e,t,n)=>{let o=e,r=!0;while(r){r=!1;let i=Vmn(o),s=y9(o);for(let a=0;a<o.length;a++){let c=o[a];if(!c)continue;let l=YTr(c,o).filter((h)=>!zV(h,c.start)&&!zV(h,c.end));if(l.length===0)continue;for(let h of["start","end"]){let d=c[h];if(i.get(jw(d))!==1)continue;if(QTr(d,t))continue;let u=l.map((m)=>({point:m,distance:Math.abs(m.x-d.x)+Math.abs(m.y-d.y)})).sort((m,A)=>m.distance-A.distance).at(0);if(!u)continue;let _=o9e(c,h,u.point);if(!Yx([_],t))continue;let p=o.map((m,A)=>A===a?_:m);if(y9(p)>s)continue;if(n&&!vhe(p,t,n))continue;o=p,r=!0;break}if(r)break}}return o},GTr=(e)=>{let{start:t,end:n}=e;if(t.y===n.y&&t.x>n.x)[t,n]=[{x:n.x,y:t.y},{x:t.x,y:n.y}];else if(t.x===n.x&&t.y>n.y)[t,n]=[{x:t.x,y:n.y},{x:n.x,y:t.y}];return{start:t,end:n}},bhe=(e)=>{if(!e||e.length===0)return[];let t=e.map(GTr),n=[],o=[];for(let a of t)if(a.start.y===a.end.y)n.push(a);else if(a.start.x===a.end.x)o.push(a);let r=[],i=new Map;for(let a of n){let c=i.get(a.start.y)??[];c.push(a),i.set(a.start.y,c)}for(let[,a]of i){a.sort((l,h)=>l.start.x-h.start.x);let c;for(let l of a){if(!c){c={...l};continue}if(l.start.x<=c.end.x)c.end.x=Math.max(c.end.x,l.end.x);else r.push(c),c={...l}}if(c)r.push(c)}let s=new Map;for(let a of o){let c=s.get(a.start.x)??[];c.push(a),s.set(a.start.x,c)}for(let[,a]of s){a.sort((l,h)=>l.start.y-h.start.y);let c;for(let l of a){if(!c){c={...l};continue}if(l.start.y<=c.end.y)c.end.y=Math.max(c.end.y,l.end.y);else r.push(c),c={...l}}if(c)r.push(c)}return r},UTr=(e,t)=>{let n=e,o=!0,r=(i)=>{let s=Kw(n,t),a=Kw(i,t);return[...s].every((c)=>a.has(c))};while(o){o=!1;let i=AS(n,t);for(let a=0;a<n.length;a++){let c=n[a];if(!c||Math.abs(c.start.y-c.end.y)>=vo)continue;let l=c.start.y;for(let h=0;h<n.length;h++){if(h===a)continue;let d=n[h];if(!d)continue;let u=ntt(d,l);if(!u)continue;if(!Dd(c,{x:d.start.x,y:l}))continue;for(let _=h+1;_<n.length;_++){if(_===a)continue;let p=n[_];if(!p)continue;let m=ntt(p,l);if(!m)continue;if(!Dd(c,{x:p.start.x,y:l}))continue;let A=r9e(d,u),g=r9e(p,m);if((A.y-l)*(g.y-l)>=-vo)continue;let f=(d.start.x+p.start.x)/2,y={start:{x:f,y:Math.min(A.y,g.y)},end:{x:f,y:Math.max(A.y,g.y)}};if(!Yx([y],t))continue;let x=n.filter((C,b)=>b!==h&&b!==_).concat(y);if(!Yx(x,t))continue;if(!r(x))continue;if(AS(x,t)>i)continue;n=bhe(x),o=!0;break}if(o)break}if(o)break}if(o)continue;let s=y9(n);for(let a=0;a<n.length;a++){let c=n[a];if(!c||Math.abs(c.start.x-c.end.x)>=vo)continue;for(let l=a+1;l<n.length;l++){let h=n[l];if(!h||Math.abs(h.start.x-h.end.x)>=vo)continue;if(Math.abs(c.start.x-h.start.x)<vo)continue;let d=Math.max(Math.min(c.start.y,c.end.y),Math.min(h.start.y,h.end.y)),u=Math.min(Math.max(c.start.y,c.end.y),Math.max(h.start.y,h.end.y));if(u-d<-vo)continue;if(!n.some((g,f)=>{if(f===a||f===l)return!1;if(Math.abs(g.start.y-g.end.y)>=vo)return!1;let y=g.start.y;if(y<d-vo||y>u+vo)return!1;return Dd(g,{x:c.start.x,y})&&Dd(g,{x:h.start.x,y})}))continue;let p=Math.min(c.start.y,c.end.y,h.start.y,h.end.y),m=Math.max(c.start.y,c.end.y,h.start.y,h.end.y),A=[c.start.x,h.start.x].map((g)=>({start:{x:g,y:p},end:{x:g,y:m}})).filter((g)=>Yx([g],t));for(let g of A){let f=n.filter((y,x)=>x!==a&&x!==l).concat(g);if(!Yx(f,t))continue;if(!r(f))continue;if(y9(f)>s)continue;if(AS(f,t)>i)continue;for(let y=0;y<f.length;){let x=f[y];if(!x||Math.abs(x.start.y-x.end.y)>=vo||x.start.y<d-vo||x.start.y>u+vo||!Dd(x,{x:c.start.x,y:x.start.y})||!Dd(x,{x:h.start.x,y:x.start.y})){y++;continue}let C=f.filter((b,I)=>I!==y);if(Yx(C,t)&&r(C)&&y9(C)<=s&&AS(C,t)<=i){f=C;continue}y++}n=bhe(f),o=!0;break}if(o)break}if(o)break}}return n},Nmn=(e,t)=>{let n=e,o=!0;while(o){o=!1;let r=AS(n,t),i=Kw(n,t);for(let s=0;s<n.length;s++){let a=n[s];if(!a||Math.abs(a.start.x-a.end.x)>=vo)continue;let c=a.start.x;for(let l=0;l<n.length;l++){if(l===s)continue;let h=n[l];if(!h)continue;if(!Tmn(h,c))continue;if(!Dd(a,{x:c,y:h.start.y}))continue;for(let d=l+1;d<n.length;d++){if(d===s)continue;let u=n[d];if(!u)continue;if(!Dd(u,{x:c,y:u.start.y}))continue;if(!Dd(a,{x:c,y:u.start.y}))continue;if(Math.abs(h.start.y-u.start.y)<vo)continue;for(let[_,p]of[[h,u],[u,h]]){let m=ntt(a,_.start.y);if(!m)continue;let A=Tmn(_,c);if(!A)continue;let g=r9e(_,A),f=Math.min(p.start.x,p.end.x),y=Math.max(p.start.x,p.end.x);if(g.x<c-vo&&y<=c+vo)continue;if(g.x>c+vo&&f>=c-vo)continue;let x=r9e(a,m);for(let C of[_.start.y,p.start.y]){let b={start:{x:Math.min(g.x,f),y:C},end:{x:Math.max(g.x,y),y:C}};if(!Yx([b],t))continue;let I={start:x,end:{x:c,y:C}};if(yhe(I))continue;if(!Yx([I],t))continue;let v=n.filter((P,M)=>M!==l&&M!==d&&M!==s).concat(b,I);if(v=ott(v,t,{preserveOriginalSpan:!0}),!Yx(v,t))continue;if(!vhe(v,t,i))continue;if(AS(v,t)>r)continue;n=bhe(v),o=!0;break}if(o)break}if(o)break}if(o)break}if(o)break}}return n},Rmn=(e)=>Math.abs(e.start.y-e.end.y)<vo,Qmn=(e)=>Math.abs(e.start.x-e.end.x)<vo,Ymn=(e,t)=>{let n=Kw(e,t),o=AS(e,t),r=y9(e);for(let i=0;i<e.length;i++){let s=e[i];if(!s||!Rmn(s))continue;for(let a=i+1;a<e.length;a++){let c=e[a];if(!c||!Rmn(c))continue;let l=Math.min(s.start.y,c.start.y),h=Math.max(s.start.y,c.start.y);if(h-l<vo)continue;let d=Math.min(s.start.x,s.end.x),u=Math.max(s.start.x,s.end.x),_=Math.min(c.start.x,c.end.x),p=Math.max(c.start.x,c.end.x),m=Math.max(d,_),A=Math.min(u,p);if(A<m-vo)continue;if(!e.some((I)=>{if(!Qmn(I))return!1;if(A-m<vo){let P=Math.min(I.start.y,I.end.y),M=Math.max(I.start.y,I.end.y);if(P>=l-vo||M<=h+vo)return!1}let v=I.start.x;return v>=m-vo&&v<=A+vo&&Dd(I,{x:v,y:l})&&Dd(I,{x:v,y:h})}))continue;let f=Math.min(d,_),y=Math.max(u,p),x=new Set([l,h]);for(let I of t){if(I.maxX<=f+vo||I.minX>=y-vo)continue;if(I.minY>l&&I.minY<h)x.add(I.minY);if(I.maxY>l&&I.maxY<h)x.add(I.maxY)}let C=[...x].sort((I,v)=>I-v),b=[];if(A-m<vo)b.push(l,h);else for(let I=1;I<C.length;I++){let v=C[I-1],P=C[I];if(v===void 0||P===void 0)continue;b.push((v+P)/2)}for(let I of b){let v={start:{x:f,y:I},end:{x:y,y:I}};if(!Yx([v],t))continue;let P=[];for(let M=0;M<e.length;M++){if(M===i||M===a)continue;let B=e[M];if(!B)continue;if(!Qmn(B)||B.start.x<f||B.start.x>y){P.push(B);continue}let T=B.start.x;if(!(Dd(B,{x:T,y:l})||Dd(B,{x:T,y:h}))){P.push(B);continue}let D=B.start.y>=l&&B.start.y<=h,L=B.end.y>=l&&B.end.y<=h;if(D&&L)continue;if(D)P.push({start:{x:T,y:I},end:B.end});else if(L)P.push({start:B.start,end:{x:T,y:I}});else P.push(B)}if(P.push(v),!Yx(P,t))continue;if(!vhe(P,t,n))continue;if(AS(P,t)>o)continue;if(y9(P)>r)continue;return Ymn(bhe(P),t)}}}return e},WTr=(e,t)=>{let n=e,o=!0;while(o){o=!1;let r=y9(n),i=Kw(n,t);for(let s=0;s<n.length;s++){let a=n[s];if(!a)continue;let c=Math.abs(a.start.y-a.end.y)<vo,l=Math.abs(a.start.x-a.end.x)<vo;if(!c&&!l)continue;for(let h=0;h<n.length;h++){if(s===h)continue;let d=n[h];if(!d)continue;let u=Math.abs(d.start.y-d.end.y)<vo,_=Math.abs(d.start.x-d.end.x)<vo;if(c!==u)continue;if(l!==_)continue;let p=[a.start,a.end],m;if(c)m=p.map((y)=>({x:y.x,y:d.start.y}));else m=p.map((y)=>({x:d.start.x,y:y.y}));if(!m.every((y)=>Dd(d,y)))continue;let A=new Map,g=!0;for(let y=0;y<p.length;y++){let x=p[y],C=m[y];if(!x||!C){g=!1;break}let b=n.findIndex((B,T)=>{if(T===s||T===h)return!1;let N=Math.abs(B.start.y-B.end.y)<vo,D=Math.abs(B.start.x-B.end.x)<vo;return(c&&D||l&&N)&&Dd(B,x)});if(b===-1)continue;let I=n[b];if(!I){g=!1;break}let v=zV(I.start,x),P=zV(I.end,x);if(!v&&!P&&Dd(I,C))continue;if(!v&&!P){g=!1;break}let M;if(v)M=o9e(I,"start",C);else M=o9e(I,"end",C);if(!Yx([M],t)){g=!1;break}A.set(b,M)}if(!g)continue;let f=n.map((y,x)=>A.get(x)??y).filter((y,x)=>x!==s);if(y9(f)>r)continue;if(!vhe(f,t,i))continue;n=f,o=!0;break}if(o)break}}return n},XTr=(e,t)=>{let n=e,o=!0;while(o){o=!1;let r=Kw(n,t),i=AS(n,t),s=y9(n);for(let a=0;a<n.length;a++){let c=n.filter((l,h)=>h!==a);if(!Yx(c,t))continue;if(!vhe(c,t,r))continue;if(AS(c,t)>i)continue;if(y9(c)>s)continue;n=c,o=!0;break}}return n},Gmn=((e)=>(e[e.ConnectDanglingEndpoints=0]="ConnectDanglingEndpoints",e[e.CollapseVerticalDoglegs=1]="CollapseVerticalDoglegs",e[e.CollapseHorizontalSteps=2]="CollapseHorizontalSteps",e[e.RemoveRedundantParallelBridges=3]="RemoveRedundantParallelBridges",e[e.ReconnectDanglingEndpoints=4]="ReconnectDanglingEndpoints",e[e.TrimDanglingOverhangs=5]="TrimDanglingOverhangs",e[e.RemoveRedundantSeparators=6]="RemoveRedundantSeparators",e[e.MergeAlignedSegments=7]="MergeAlignedSegments",e))(Gmn||{}),jTr=class extends co{constructor(e){super();this.params=e,this._inputRects=e.cellContents.map((t)=>({minX:t.x,minY:t.y,maxX:t.x+t.width,maxY:t.y+t.height})),this._currentLines=e.repairedLines}params;refinedLines=[];_stage=0;_currentLines=[];_inputRects;_step(){let e=this._inputRects;switch(this._stage){case 0:this._currentLines=ott(this._currentLines,e,{preserveOriginalSpan:!0});break;case 1:this._currentLines=UTr(this._currentLines,e);break;case 2:this._currentLines=Nmn(this._currentLines,e);break;case 3:this._currentLines=WTr(this._currentLines,e);break;case 4:this._currentLines=ott(this._currentLines,e,{preserveOriginalSpan:!0});break;case 5:this._currentLines=Dmn(this._currentLines,e,Kw(this._currentLines,e));break;case 6:this._currentLines=XTr(this._currentLines,e);break;case 7:this._currentLines=bhe(this._currentLines),this._currentLines=Nmn(this._currentLines,e),this._currentLines=Ymn(this._currentLines,e),this._currentLines=Dmn(this._currentLines,e,Kw(this._currentLines,e)),this.refinedLines=this._currentLines,this.solved=!0;break}let t=this.getNextStage(this._stage);if(t)this._stage=t}getNextStage(e){let t=Object.values(Gmn);return t[t.indexOf(e)+1]}getOutput(){return this.refinedLines}getConstructorParams(){return[this.params]}visualize(){let{cellContents:e,repairedLines:t}=this.params;return{rects:e.map((n)=>({center:{x:n.x+n.width/2,y:n.y+n.height/2},width:n.width,height:n.height,fill:"rgba(255, 165, 0, 0.2)",stroke:"#c87000"})),lines:[...t.map((n)=>({points:[n.start,n.end],strokeColor:"rgba(180, 180, 180, 0.4)",strokeWidth:1,strokeDash:[4,4]})),...this._currentLines.map((n)=>({points:[n.start,n.end],strokeColor:"#000000",strokeWidth:3}))]}}},KTr=class extends XC{computeMidlinesSolver;computeIntersectionsSolver;computeSegmentsSolver;buildGridSolver;mergeGridSolver;buildOutlineSolver;reduceBoundaryLinesSolver;repairBoundaryLinesSolver;refineBoundaryLinesSolver;pipelineDef=[xi("computeMidlinesSolver",OBr,(e)=>[{cellContents:e.inputProblem.cellContents,containerWidth:e.inputProblem.containerWidth,containerHeight:e.inputProblem.containerHeight}]),xi("computeIntersectionsSolver",YBr,(e)=>[{midlines:e.getSolver("computeMidlinesSolver").midlines}]),xi("computeSegmentsSolver",jBr,(e)=>[{midlines:e.getSolver("computeMidlinesSolver").midlines,intersections:e.getSolver("computeIntersectionsSolver").intersections,cellContents:e.inputProblem.cellContents}]),xi("buildGridSolver",JBr,(e)=>[{allSegments:e.getSolver("computeSegmentsSolver").allSegments,cellContents:e.inputProblem.cellContents,containerWidth:e.inputProblem.containerWidth,containerHeight:e.inputProblem.containerHeight}]),xi("mergeGridSolver",nTr,(e)=>[{validSegments:e.getSolver("buildGridSolver").validSegments,gridRects:e.getSolver("buildGridSolver").gridRects,cellContainingRects:e.getSolver("buildGridSolver").cellContainingRects,cellContents:e.inputProblem.cellContents}]),xi("buildOutlineSolver",rTr,(e)=>[{groupedRects:e.getSolver("mergeGridSolver").groupedRects}]),xi("reduceBoundaryLinesSolver",CTr,(e)=>[{outlineLines:e.getSolver("buildOutlineSolver").outlineLines,cellContents:e.inputProblem.cellContents,offsetX:e.inputProblem.offsetX,offsetY:e.inputProblem.offsetY}]),xi("repairBoundaryLinesSolver",NTr,(e)=>[{reducedLines:e.getSolver("reduceBoundaryLinesSolver").reducedLines,originalLines:e.getSolver("reduceBoundaryLinesSolver").mergedOriginalLines,cellContents:e.inputProblem.cellContents}]),xi("refineBoundaryLinesSolver",jTr,(e)=>[{repairedLines:e.getSolver("repairBoundaryLinesSolver").repairedLines,cellContents:e.inputProblem.cellContents}])];finalVisualize(){let e=this.getSolver("refineBoundaryLinesSolver"),t=this.getSolver("buildOutlineSolver"),n=e?.refinedLines??t?.outlineLines;if(!n)return null;return{rects:this.inputProblem.cellContents.map((o)=>({center:{x:o.x+o.width/2,y:o.y+o.height/2},width:o.width,height:o.height,fill:"rgba(255, 165, 0, 0.3)",stroke:"#c87000",label:o.cellId})),lines:n.map((o)=>({points:[o.start,o.end],strokeColor:"#000000",strokeWidth:3}))}}initialVisualize(){return{rects:this.inputProblem.cellContents.map((e)=>({center:{x:e.x+e.width/2,y:e.y+e.height/2},width:e.width,height:e.height,fill:"rgba(255, 165, 0, 0.3)",stroke:"#c87000",label:e.cellId}))}}getConstructorParams(){return[this.inputProblem]}getOutput(){return{midlines:this.getSolver("computeMidlinesSolver")?.midlines??[],allSegments:this.getSolver("computeSegmentsSolver")?.allSegments??[],validSegments:this.getSolver("buildGridSolver")?.validSegments??[],mergedRectGroups:this.getSolver("mergeGridSolver")?.mergedRectGroups??[],cellRects:this.inputProblem.cellContents,gridRects:this.getSolver("buildGridSolver")?.gridRects??[],outlineLines:this.getSolver("refineBoundaryLinesSolver")?.refinedLines??this.getSolver("buildOutlineSolver")?.outlineLines??[]}}},$Tr=(e,t,n)=>({...e,start:{x:e.start.x+t,y:e.start.y+n},end:{x:e.end.x+t,y:e.end.y+n}}),s9e=(e)=>{let t=1/0,n=1/0,o=-1/0,r=-1/0;for(let i of e)t=Math.min(t,i.minX),n=Math.min(n,i.minY),o=Math.max(o,i.maxX),r=Math.max(r,i.maxY);return{minX:t,minY:n,maxX:o,maxY:r}},qTr=(e)=>{let{start:t,end:n}=e;if(t.y===n.y&&t.x>n.x)[t,n]=[{x:n.x,y:t.y},{x:t.x,y:n.y}];else if(t.x===n.x&&t.y>n.y)[t,n]=[{x:t.x,y:n.y},{x:n.x,y:t.y}];return{...e,start:t,end:n}},JTr=(e)=>{if(!e||e.length===0)return[];let t=e.map(qTr),n=[],o=[];for(let a of t)if(a.start.y===a.end.y)n.push(a);else if(a.start.x===a.end.x)o.push(a);let r=[],i=new Map;for(let a of n){let c=i.get(a.start.y)??[];c.push(a),i.set(a.start.y,c)}for(let[,a]of i){a.sort((l,h)=>l.start.x-h.start.x);let c;for(let l of a){if(!c){c={...l};continue}if(l.start.x<=c.end.x)c.end.x=Math.max(c.end.x,l.end.x);else r.push(c),c={...l}}if(c)r.push(c)}let s=new Map;for(let a of o){let c=s.get(a.start.x)??[];c.push(a),s.set(a.start.x,c)}for(let[,a]of s){a.sort((l,h)=>l.start.y-h.start.y);let c;for(let l of a){if(!c){c={...l};continue}if(l.start.y<=c.end.y)c.end.y=Math.max(c.end.y,l.end.y);else r.push(c),c={...l}}if(c)r.push(c)}return r};var JIe=(e,t)=>e.x!==t.x?e.x-t.x:e.y-t.y,ZTr=(e,t,n)=>{let o=e.map((_,p)=>({..._,cellId:`cell-${p}`})),r=s9e(o.map((_)=>({minX:_.x,minY:_.y,maxX:_.x+_.width,maxY:_.y+_.height}))),{minX:i,minY:s}=r;t??=r.maxX-r.minX,n??=r.maxY-r.minY;let a=o.map((_)=>({..._,x:_.x-i,y:_.y-s})),c=new KTr({cellContents:a,containerWidth:t,containerHeight:n,offsetX:i,offsetY:s});c.solve();let l=c.getOutput(),h=(_)=>$Tr(_,i,s),d=l.outlineLines.map(h);return JTr(d).map((_)=>({start:JIe(_.start,_.end)<0?_.start:_.end,end:JIe(_.start,_.end)<0?_.end:_.start})).sort((_,p)=>JIe(_.start,p.start)||JIe(_.end,p.end))};function eDr(e,t){if(!Number.isFinite(t)||t<0)throw Error("cellMargin must be finite and nonnegative");if(t===0||e.length<2)return e;let n=e.map((i)=>({...i,minX:i.minX-t,maxX:i.maxX+t,minY:i.minY-t,maxY:i.maxY+t})),o=[n[0]],r=n.slice(1);while(r.length>0){let i=r.findIndex((s)=>o.some((a)=>a.minX<=s.maxX&&a.maxX>=s.minX&&a.minY<=s.maxY&&a.maxY>=s.minY));if(i<0)return n;o.push(...r.splice(i,1))}return e}var Umn=(e,t={})=>ZTr(eDr(e,t.cellMargin??0).map((n)=>({x:n.minX,y:n.minY,width:n.maxX-n.minX,height:n.maxY-n.minY})));Kt();Ko();var pit=Qe(wt(),1),W7e=Qe(wt(),1);var fue=Qe(wt(),1),ZSn=Qe(rn(),1);var She=Qe(WGe(),1),a9e=Qe(rn(),1),zQ=(e)=>{if(Array.isArray(e)&&e.length===1)return e[0];return e};function Wmn(e,t={}){let n=(r,i,s,a,c)=>{let l=(h)=>{if(h==null||typeof h==="boolean")return[];if(Array.isArray(h))return h.flatMap(l);if(!a9e.default.isValidElement(h))throw Error("Expected JSCAD elements, not text or arbitrary objects");let d=n(h.type,h.props,[],a,c);return Array.isArray(d)?d.flat(1/0):d==null?[]:[d]};if(r===a9e.default.Fragment)return l(i.children);if(typeof r==="function")return l(r(i));switch(r){case"cube":return e.primitives.cube({size:i.size});case"sphere":return e.primitives.sphere({radius:i.radius,segments:i.segments});case"cuboid":return e.primitives.cuboid({size:i.size});case"roundedCuboid":return e.primitives.roundedCuboid({size:i.size,roundRadius:i.roundRadius});case"geodesicSphere":return e.primitives.geodesicSphere({radius:i.radius,frequency:i.frequency});case"ellipsoid":return e.primitives.ellipsoid({radius:i.radius});case"cylinder":return e.primitives.cylinder({radius:i.radius,height:i.height});case"roundedCylinder":return e.primitives.roundedCylinder({radius:i.radius,height:i.height,roundRadius:i.roundRadius});case"cylinderElliptic":return e.primitives.cylinderElliptic({radius:i.radius,height:i.height,startRadius:i.startRadius,endRadius:i.endRadius,startAngle:i.startAngle,endAngle:i.endAngle});case"torus":return e.primitives.torus({innerRadius:i.innerRadius,outerRadius:i.outerRadius,innerSegments:i.innerSegments,outerSegments:i.outerSegments,innerRotation:i.innerRotation,outerRotation:i.outerRotation,startAngle:i.startAngle});case"jscadPolygon":return e.primitives.polygon({points:i.points});case"extrudeLinear":{let{children:h,...d}=i,u=l(h);return e.extrusions.extrudeLinear({height:d.height},zQ(u))}case"extrudeRotate":{let{children:h,...d}=i,u=l(h);return e.extrusions.extrudeRotate({angle:d.angle},zQ(u))}case"extrudeRectangular":{let{children:h,...d}=i,u=l(h);return e.extrusions.extrudeRectangular({size:d.size,height:d.height},zQ(u))}case"extrudeHelical":{let{children:h,...d}=i,u=l(h);return e.extrusions.extrudeHelical({height:d.height,angle:d.angle,startAngle:d.startAngle||0,pitch:d.pitch||0,endOffset:d.endOffset||0,segmetsPerRotation:d.segmetsPerRotation||32},zQ(u))}case"extrudeFromSlices":{let{baseSlice:h,...d}=i;return e.extrusions.extrudeFromSlices(d,h)}case"project":{let{children:h,...d}=i,u=l(h);return e.extrusions.project({axis:d.axis,origin:d.origin},zQ(u))}case"colorize":{let{children:h,...d}=i,u=l(h),_=d.color;return zQ(u.map((m)=>e.colors.colorize(_,m)))}case"custom":{let{geometry:h}=i;return h}case"union":{let h=l(i.children);if(h.length===0)return[];if(h.length===1)return h[0];return e.booleans.union(...h)}case"subtract":{let h=a9e.default.Children.toArray(i.children);if(h.length<2)throw Error("Subtract must have at least one base component and one component to subtract.");let d=l(h[0]);if(d.length!==1)throw Error("Subtract requires exactly one solid base");let u=h.slice(1).flatMap(l);return u.length?e.booleans.subtract(d[0],...u):d[0]}case"translate":{let{args:h,children:d}=i,u=l(d);return zQ(u.map((_)=>e.transforms.translate(h,_)))}case"rotate":{let{children:h,...d}=i,u=l(h);return zQ(u.map((_)=>e.transforms.rotate(d.angles,_)))}case"hull":case"hullChain":{let h=l(i.children);if(!h.length)return[];if(h.length===1)return h[0];return e.hulls[r](...h)}case"rectangle":{let{size:h,name:d,reference:u}=i;if(u&&!d?.trim())throw Error("Reference rectangles require a nonblank name");if(u&&!t.preserveReferences)return[];let _=e.primitives.rectangle({size:h});return t.preserveReferences&&(d!==void 0||u!==void 0)?{..._,...d!==void 0?{name:d}:{},...u!==void 0?{reference:u}:{}}:_}case"circle":{let{radius:h}=i;return e.primitives.circle({radius:h})}default:throw Error(`Unknown element type: ${r}`)}};return{now:Date.now,supportsMutation:!0,supportsPersistence:!1,supportsHydration:!1,currentUpdatePriority:She.DefaultEventPriority,createInstance:n,createTextInstance(){throw Error("Text elements are not supported in JSCAD")},appendInitialChild(r,i){return r},appendChild(r,i){return r},removeChild(r,i){return r},appendChildToContainer(r,i){r.push(i)},removeChildFromContainer(r,i){let s=r.indexOf(i);if(s!==-1)r.splice(s,1)},prepareUpdate(){return!0},commitUpdate(r,i,s,a,c){let l=n(s,c,r,{},null);for(let h in r)delete r[h];Object.assign(r,l)},finalizeInitialChildren(){return!1},prepareForCommit(){return null},resetAfterCommit(){},getPublicInstance(r){return r},getRootHostContext(r){return e},getChildHostContext(r,i,s){return r},shouldSetTextContent(){return!1},clearContainer(){},scheduleTimeout:setTimeout,cancelTimeout:clearTimeout,noTimeout:-1,isPrimaryRenderer:!0,getCurrentEventPriority:()=>99,getInstanceFromNode:()=>null,beforeActiveInstanceBlur:()=>{},afterActiveInstanceBlur:()=>{},prepareScopeUpdate:()=>{},getInstanceFromScope:()=>null,detachDeletedInstance:()=>{},resolveUpdatePriority:()=>She.DiscreteEventPriority,setCurrentUpdatePriority:(r)=>{},getCurrentUpdatePriority:()=>She.DefaultEventPriority,maySuspendCommit(){return!1}}}var IDr=Qe(so(),1),A_n=Qe(p_n(),1),f_n=Qe(so(),1),x_n=Qe(so(),1),d9e=Qe(so(),1),u9e=Qe(so(),1),b_n=Qe(so(),1),I_n=Qe(so(),1),MDr=Qe(so(),1),v_n=Qe(so(),1),p9e=Qe(so(),1),P_n=Qe(so(),1),E_n=Qe(so(),1),M_n=Qe(so(),1),w_n=Qe(so(),1),B_n=Qe(so(),1),T_n=Qe(so(),1),D_n=Qe(so(),1),N_n=Qe(so(),1),R_n=Qe(so(),1),Q_n=Qe(so(),1),qDr=Qe(so(),1),JDr=Qe(so(),1),ZDr=Qe(so(),1),k_n=Qe(so(),1),L_n=Qe(so(),1),H_n=Qe(so(),1),F_n=Qe(so(),1),z_n=Qe(so(),1),hNr=Qe(so(),1),O_n=Qe(so(),1),V_n=Qe(rn(),1),m9e=Qe(g_n(),1);function y_n({color:e,children:t}){if(!Array.isArray(e))e=A_n.default(e).rgb().array().map((n)=>n/255);return f_n.jsx("colorize",{color:e,children:t})}var utt=(e)=>{if(!e)return null;if(Array.isArray(e))return e;return[e.x,e.y,e.z]};function C_n({offset:e,center:t,x:n,y:o,z:r,children:i}){let s=utt(e),a=utt(t),c=[s?.[0]||a?.[0]||n||0,s?.[1]||a?.[1]||o||0,s?.[2]||a?.[2]||r||0];return x_n.jsx("translate",{args:c,children:i})}function pg(e){let t=(n)=>{let{color:o,...r}=n;if(!o)return d9e.jsx(e,{...r});return d9e.jsx(y_n,{color:o,children:d9e.jsx(e,{...r})})};return t.displayName=`WithColor(${e.displayName||e.name||"Component"})`,t}function mg(e){let t=(n)=>{let{center:o,offset:r,...i}=n;if(!o&&!r)return u9e.jsx(e,{...i});return u9e.jsx(C_n,{offset:o||r,children:u9e.jsx(e,{...i})})};return t.displayName=`WithOffset(${e.displayName||e.name||"Component"})`,t}var vDr=({size:e})=>b_n.jsx("cube",{size:e}),SDr=mg(pg(vDr)),PDr=({size:e})=>I_n.jsx("cuboid",{size:e}),EDr=mg(pg(PDr));var Bhe=(e)=>{if(typeof e==="string"){let t=e.replace(/[^\d.-]/g,""),n=parseFloat(t);if(!isNaN(n)){if(e.toLowerCase().includes("deg"))return n*Math.PI/180;return n}throw Error(`Invalid rotation value: ${e}`)}return e},ptt=(e)=>{if(typeof e==="string"||typeof e==="number")return[0,0,Bhe(e)];else if(Array.isArray(e))return e.map(Bhe);else if(e&&typeof e==="object")return[Bhe(e.x),Bhe(e.y),Bhe(e.z)];return[0,0,0]},wDr=({rotation:e,angles:t,children:n})=>{let o=e?ptt(e):ptt(t);return v_n.jsx("rotate",{angles:o,children:n})},S_n=mg(pg(wDr));function BDr(e){let t=(n)=>{let{rotation:o,...r}=n;if(!o)return p9e.jsx(e,{...r});return p9e.jsx(S_n,{rotation:o,children:p9e.jsx(e,{...r})})};return t.displayName=`WithRotation(${e.displayName||e.name||"Component"})`,t}var TDr=({radius:e,height:t})=>P_n.jsx("cylinder",{radius:e,height:t}),DDr=pg(mg(BDr(TDr))),NDr=({height:e,startRadius:t,endRadius:n,segments:o=32,startAngle:r=0,endAngle:i=Math.PI*2})=>E_n.jsx("cylinderElliptic",{height:e,startRadius:t,endRadius:n,segments:o,startAngle:r,endAngle:i}),RDr=mg(pg(NDr)),QDr=({radius:e})=>M_n.jsx("ellipsoid",{radius:e}),kDr=mg(pg(QDr)),LDr=({height:e,angle:t,startAngle:n,pitch:o,endOffset:r,segmetsPerRotation:i,children:s})=>w_n.jsx("extrudeHelical",{height:e,angle:t,startAngle:n,pitch:o,endOffset:r,segmetsPerRotation:i,children:s}),HDr=mg(pg(LDr)),FDr=({height:e,twistAngle:t,twistSteps:n,children:o})=>B_n.jsx("extrudeLinear",{height:e,twistAngle:t,twistSteps:n,children:o}),zDr=mg(pg(FDr)),ODr=({size:e,height:t,children:n})=>T_n.jsx("extrudeRectangular",{size:e,height:t,children:n}),VDr=mg(pg(ODr)),YDr=({angle:e,startAngle:t,segments:n,children:o})=>D_n.jsx("extrudeRotate",{angle:e,startAngle:t,segments:n,children:o}),GDr=mg(pg(YDr)),UDr=({radius:e,frequency:t})=>N_n.jsx("geodesicSphere",{radius:e,frequency:t}),WDr=mg(pg(UDr)),XDr=({children:e})=>R_n.jsx("hull",{children:e}),jDr=mg(pg(XDr)),KDr=({children:e})=>Q_n.jsx("hullChain",{children:e}),$Dr=mg(pg(KDr));var eNr=({size:e,roundRadius:t})=>k_n.jsx("roundedCuboid",{size:e,roundRadius:t}),tNr=mg(pg(eNr)),nNr=({radius:e,height:t,roundRadius:n})=>L_n.jsx("roundedCylinder",{radius:e,height:t,roundRadius:n}),oNr=mg(pg(nNr)),rNr=({radius:e,segments:t})=>H_n.jsx("sphere",{radius:e,segments:t||32}),iNr=pg(mg(rNr)),sNr=({children:e})=>{if(!Array.isArray(e)||e.length<2)throw Error("Subtract must have at least two children");return F_n.jsx("subtract",{children:e})},aNr=mg(pg(sNr)),cNr=({innerRadius:e,outerRadius:t,innerSegments:n=32,outerSegments:o=32,innerRotation:r=0,outerRotation:i=1,startAngle:s=0})=>z_n.jsx("torus",{innerRadius:e,outerRadius:t,innerSegments:n,outerSegments:o,innerRotation:r,outerRotation:i,startAngle:s}),lNr=mg(pg(cNr));var dNr=({numberOfSlices:e,capStart:t,capEnd:n,close:o,repair:r,baseSlice:i,callback:s})=>O_n.jsx("extrudeFromSlices",{numberOfSlices:e,capStart:t,capEnd:n,close:o,repair:r,baseSlice:i,callback:s}),uNr=mg(pg(dNr)),Y_n={...m9e.jscadPlanner,primitives:{...m9e.jscadPlanner.primitives,rectangle:({size:[e,t]})=>{if(![e,t].every((n)=>Number.isFinite(n)&&n>0))throw Error("Rectangles require two positive finite dimensions");return m9e.jscadPlanner.primitives.polygon({points:[[-e/2,-t/2],[e/2,-t/2],[e/2,t/2],[-e/2,t/2]]})}}},pNr=Wmn(Y_n,{preserveReferences:!0});function mtt(e){if(typeof e==="function"||typeof e==="symbol"||typeof e==="bigint"||typeof e==="number"&&!Number.isFinite(e))throw Error("JSCAD plans must contain finite, JSON-serializable values");if(Array.isArray(e))e.forEach(mtt);else if(e&&typeof e==="object")Object.values(e).forEach(mtt)}function _tt(e){let t=pNr.createInstance(V_n.Fragment,{children:e},[],Y_n,null),n=(Array.isArray(t)?t.flat(1/0):[t]).filter(Boolean);if(!n.length)throw Error("Cannot compile an empty JSCAD plan");let o=n.length===1?n[0]:{type:"union",shapes:n};function r(i){if(!i||typeof i.type!=="string")throw Error("Expected a JSCAD operation; raw Custom geometry is not supported by the plan compiler");if("shape"in i)r(i.shape);if("shapes"in i)i.shapes.forEach(r)}return r(o),mtt(o),o}var mit=Qe(OUe(),1);Ie();Ie();Ie();Ie();var _it=Qe(M7(),1);var Cy=Qe(M7(),1);var rY=Qe(M7(),1),C9=Qe(M7(),1),sPn=Qe(rn(),1),a0i=Qe(rn(),1),hJs=Qe(rn(),1);var LY=Qe(so(),1);var cPn=Qe(so(),1),c0i=Qe(so(),1);var lPn=Qe(so(),1);var hPn=Qe(so(),1);var dPn=Qe(so(),1),l0i=Qe(rn(),1);var _Nr=Object.defineProperty,dJ=((e)=>KW)(function(e){return KW.apply(this,arguments)}),gNr=(e,t)=>{for(var n in t)_Nr(e,n,{get:t[n],enumerable:!0})},Uxn={};gNr(Uxn,{Ammeter:()=>Rhi,AnalogAcSweepSimulation:()=>Lui,AnalogAnalysisSimulation:()=>HZ,AnalogDcOperatingPointSimulation:()=>Qui,AnalogDcSweepSimulation:()=>kui,AnalogSimulation:()=>Nui,AnalogSweepParameter:()=>Yui,AnalogTransientSimulation:()=>Rui,Antenna:()=>Chi,AssemblyCable:()=>iPn,AssemblyDevice:()=>FSn,AssemblyMotor:()=>YSn,AssemblyPart:()=>jSn,AssemblyPrintedPart:()=>ePn,AssemblyReferenceSurface:()=>KSn,AssemblyScreen:()=>GSn,AssemblySubassembly:()=>dit,AutoroutingPhase:()=>Ghi,Battery:()=>hui,Board:()=>P9,Breakout:()=>lit,BreakoutPoint:()=>kY,Bus:()=>ssi,CadAssembly:()=>WQr,CadModel:()=>KQr,Capacitor:()=>S4n,Chip:()=>Eue,Connector:()=>B4n,Constraint:()=>khi,CopperPour:()=>Jdi,CopperText:()=>b5n,CourtyardCircle:()=>I5n,CourtyardOutline:()=>S5n,CourtyardRect:()=>E5n,Crystal:()=>Aui,CurrentSource:()=>BSn,Cutout:()=>wve,DifferentialPair:()=>usi,Diode:()=>D4n,DrcCheck:()=>Yhi,EnclosureCutoutAperture:()=>Fat,EnclosureFdmBox:()=>qSn,FabricationNoteDimension:()=>Uhi,FabricationNotePath:()=>w5n,FabricationNoteRect:()=>B5n,FabricationNoteText:()=>D5n,Fanout:()=>lit,FanoutPoint:()=>kY,Fiducial:()=>Fdi,Footprint:()=>s7e,Fuse:()=>Ihi,Group:()=>tP,Hole:()=>IJ,Inductor:()=>lSn,Interconnect:()=>Shi,Jumper:()=>vhi,Keepout:()=>i8e,Led:()=>hSn,Mosfet:()=>dSn,MountedBoard:()=>uhi,Net:()=>dB,NetLabel:()=>Lai,NormalComponent:()=>bl,OpAmp:()=>fui,Panel:()=>Ahi,PcbBend:()=>Zui,PcbNoteDimension:()=>Whi,PcbNoteLine:()=>R5n,PcbNotePath:()=>k5n,PcbNoteRect:()=>H5n,PcbNoteText:()=>z5n,PcbReturnCurrentExcitation:()=>Wui,PcbReturnCurrentSimulation:()=>Gui,PcbSoldermaskOpening:()=>O5n,PcbStiffener:()=>e0i,PcbTrace:()=>Mit,PcbVia:()=>V5n,PinHeader:()=>dui,Pinout:()=>bhi,PlatedHole:()=>Zw,Port:()=>Lh,Potentiometer:()=>_ui,PowerSource:()=>Ehi,PrimitiveComponent:()=>nr,PushButton:()=>uSn,Renderable:()=>e5n,Resistor:()=>pSn,Resonator:()=>pui,SchematicArc:()=>U5n,SchematicBox:()=>P7n,SchematicCell:()=>Dui,SchematicCircle:()=>W5n,SchematicGraphic:()=>wui,SchematicLine:()=>fot,SchematicPath:()=>j5n,SchematicRect:()=>$5n,SchematicRow:()=>Tui,SchematicSection:()=>vui,SchematicSheet:()=>Mui,SchematicSymbol:()=>Iui,SchematicTable:()=>Bui,SchematicText:()=>J5n,SilkscreenCircle:()=>Z5n,SilkscreenGraphic:()=>Hdi,SilkscreenLine:()=>e4n,SilkscreenPath:()=>n4n,SilkscreenRect:()=>r4n,SilkscreenText:()=>wit,SmtPad:()=>eB,SolderJumper:()=>Phi,SolderPaste:()=>i4n,SpiceModel:()=>Jui,Subcircuit:()=>SSn,Subpanel:()=>MSn,Switch:()=>mSn,Symbol:()=>Bit,TestPoint:()=>yui,Trace:()=>d_,TraceHint:()=>v7n,Transistor:()=>_Sn,Via:()=>m5n,VoltageProbe:()=>qui,VoltageSource:()=>wSn});var ANr=(e,t)=>{switch(t){case"i2c_sda":e.supports_i2c_sda=!0;return;case"i2c_scl":e.supports_i2c_scl=!0;return;case"spi_cs":e.supports_spi_cs=!0;return;case"spi_sck":e.supports_spi_sck=!0;return;case"spi_mosi":e.supports_spi_mosi=!0;return;case"spi_miso":e.supports_spi_miso=!0;return;case"uart_tx":e.supports_uart_tx=!0;return;case"uart_rx":e.supports_uart_rx=!0;return;default:throw Error(`Unhandled pin capability: ${t}`)}},fNr=(e,t)=>{switch(t){case"i2c_sda":e.is_configured_for_i2c_sda=!0;return;case"i2c_scl":e.is_configured_for_i2c_scl=!0;return;case"spi_cs":e.is_configured_for_spi_cs=!0;return;case"spi_sck":e.is_configured_for_spi_sck=!0;return;case"spi_mosi":e.is_configured_for_spi_mosi=!0;return;case"spi_miso":e.is_configured_for_spi_miso=!0;return;case"uart_tx":e.is_configured_for_uart_tx=!0;return;case"uart_rx":e.is_configured_for_uart_rx=!0;return;default:throw Error(`Unhandled configured pin capability: ${t}`)}},Wxn=(e,t)=>{if(t.isInput!==void 0)e.is_input=t.isInput;if(t.isOutput!==void 0)e.is_output=t.isOutput;if(t.isBidirectional!==void 0)e.is_bidirectional=t.isBidirectional;if(t.isPassive!==void 0)e.is_passive=t.isPassive;if(t.canUseTriState!==void 0)e.can_use_tri_state=t.canUseTriState;if(t.isUsingTriState!==void 0)e.is_using_tri_state=t.isUsingTriState;if(t.canUseOpenCollector!==void 0)e.can_use_open_collector=t.canUseOpenCollector;if(t.isUsingOpenCollector!==void 0)e.is_using_open_collector=t.isUsingOpenCollector;if(t.canUseOpenEmitter!==void 0)e.can_use_open_emitter=t.canUseOpenEmitter;if(t.isUsingOpenEmitter!==void 0)e.is_using_open_emitter=t.isUsingOpenEmitter;if(t.isGpio!==void 0)e.is_gpio=t.isGpio;if(t.highlightColor!==void 0)e.highlight_color=t.highlightColor;for(let o of t.capabilities??[])ANr(e,o);let n=new Set([...t.activeCapabilities??[],...t.activeCapability?[t.activeCapability]:[]]);for(let o of n)fNr(e,o);if(t.mustBeConnected!==void 0)e.must_be_connected=t.mustBeConnected;if(t.providesPower!==void 0)e.provides_power=t.providesPower;if(t.requiresPower!==void 0)e.requires_power=t.requiresPower;if(t.providesGround!==void 0)e.provides_ground=t.providesGround;if(t.requiresGround!==void 0)e.requires_ground=t.requiresGround;if(t.providesVoltage!==void 0)e.provides_voltage=Xl.parse(t.providesVoltage);if(t.requiresVoltage!==void 0)e.requires_voltage=Xl.parse(t.requiresVoltage);if(t.doNotConnect!==void 0)e.do_not_connect=t.doNotConnect;if(t.includeInBoardPinout!==void 0)e.include_in_board_pinout=t.includeInBoardPinout;if(t.canUseInternalPullup!==void 0)e.can_use_internal_pullup=t.canUseInternalPullup;if(t.isUsingInternalPullup!==void 0)e.is_using_internal_pullup=t.isUsingInternalPullup;if(t.needsExternalPullup!==void 0)e.needs_external_pullup=t.needsExternalPullup;if(t.canUseInternalPulldown!==void 0)e.can_use_internal_pulldown=t.canUseInternalPulldown;if(t.isUsingInternalPulldown!==void 0)e.is_using_internal_pulldown=t.isUsingInternalPulldown;if(t.needsExternalPulldown!==void 0)e.needs_external_pulldown=t.needsExternalPulldown;if(t.canUseOpenDrain!==void 0)e.can_use_open_drain=t.canUseOpenDrain;if(t.isUsingOpenDrain!==void 0)e.is_using_open_drain=t.isUsingOpenDrain;if(t.canUsePushPull!==void 0)e.can_use_push_pull=t.canUsePushPull;if(t.isUsingPushPull!==void 0)e.is_using_push_pull=t.isUsingPushPull;if(t.shouldHaveDecouplingCapacitor!==void 0)e.should_have_decoupling_capacitor=t.shouldHaveDecouplingCapacitor;if(t.recommendedDecouplingCapacitorCapacitance!==void 0)e.recommended_decoupling_capacitor_capacitance=t.recommendedDecouplingCapacitorCapacitance},yNr=(e,t)=>{let n=[];for(let o of Object.keys(e)){if(o==="highlightColor"||o==="includeInBoardPinout")continue;let r={};if(Wxn(r,{[o]:e[o]}),o==="capabilities"){for(let i of Object.keys(t))if(i.startsWith("supports_"))Object.assign(r,{[i]:r[i]??!1})}for(let i of Object.keys(r)){let s=r[i],a=i.startsWith("is_configured_for_")?i.replace("is_configured_for_","supports_"):i.startsWith("is_using_")?i.replace("is_using_","can_use_"):void 0;if(a){if(s===!0&&t[a]===!1)n.push(`${o}: ${JSON.stringify(e[o])}, fetched ${a}: false`);continue}let c=t[i],l=typeof c==="number"&&typeof s==="number"?Math.abs(c-s)<=Number.EPSILON*8*Math.max(1,Math.abs(c),Math.abs(s)):c===s;if(c!==void 0&&s!==void 0&&!l)n.push(`${o}: ${JSON.stringify(e[o])}, fetched ${i}: ${JSON.stringify(c)}`)}}return n},Xxn=(e,t)=>{if(new Set(t.map((a)=>a.source_component_id)).size>1)return{};let n=e.props.pinNumber,o=n===void 0?[]:t.filter((a)=>a.pin_number===n),r=e.getNameAndAliases(),i=o.length>0?o:t.filter((a)=>[a.name,...a.port_hints??[]].some((c)=>r.includes(c)));if(i.length!==1)return{};let s=hX.parse(i[0]);for(let a of Object.keys(s))if(s[a]===void 0)delete s[a];return s},$ve=(e)=>{let t=Xxn(e,e.getParentNormalComponent()?._importedSourcePorts??[]);for(let n of e._getMatchingPinAttributes()){for(let o of Object.keys(t))if(n.capabilities!==void 0&&o.startsWith("supports_")||(n.activeCapability!==void 0||n.activeCapabilities!==void 0)&&o.startsWith("is_configured_for_"))delete t[o];Wxn(t,n)}return t},xNr=(e)=>{let t=e._fetchedInternallyConnectedPinNames??e._importedInternallyConnectedPinNames??[],n=e._getAllPortsFromChildren(),o=(s)=>{let a=String(s),c=n.find((h)=>h.physicalPinName===a||h.props.pinNumber!==void 0&&(String(h.props.pinNumber)===a||`pin${h.props.pinNumber}`===a));if(c)return c;let l=n.filter((h)=>{let d=h.getNameAndAliases();return d.includes(a)||a.startsWith("pin")&&d.includes(a.slice(3))});return l.length===1?l[0]:void 0},r=e._parsedProps.internallyConnectedPins,i=(r??[]).map((s)=>s.map(o).filter((a)=>a!==void 0));return t.flatMap((s)=>{let a=s.map(o);if(a.some((_)=>!_))return[];let c=[...new Set(a)];if(c.length<2)return[];let l=new Set([c[0]]),h=!0;while(h){h=!1;for(let _ of i){if(!_.some((p)=>l.has(p)))continue;for(let p of _)if(!l.has(p))l.add(p),h=!0}}if(c.every((_)=>l.has(_)))return[];let d=c.map((_)=>{let p=_.getNameAndAliases();return p.find((m)=>!/^(?:pin)?\d+$/.test(m))??p[0]??"unnamed pin"});return[{message:`The datasheet reports pins ${d.length===2?d.join(" and "):`${d.slice(0,-1).join(", ")} and ${d.at(-1)}`} are internally connected, but ${r===void 0?`the internallyConnectedPins prop isn't set on ${e.getDisplayName()}`:`internallyConnectedPins on ${e.getDisplayName()} does not declare that connection`}.`,sourcePortIds:c.flatMap((_)=>_.source_port_id?[_.source_port_id]:[])}]})},G_n=new WeakMap,Jnt=async(e,t)=>{let{supplierPartNumber:n,manufacturerPartNumber:o,platformFetch:r}=t,i={supplierPartNumber:n,manufacturerPartNumber:o,platformFetch:r};try{return{circuitJson:await e(t)}}catch(s){if(!t.includeDatasheetInformation&&!(s instanceof F1&&s.issues.some((u)=>u.code==="unrecognized_keys"&&u.keys.includes("includeDatasheetInformation"))))throw s;let a={...t,includeDatasheetInformation:!1},c,l=!1;try{l=!t.includeDatasheetInformation,c=await e(l?i:a)}catch{if(l)throw s;c=await e(i),l=!0}if(!c?.length)throw s;let h=c.flatMap((u)=>u.type==="source_component"&&u.manufacturer_part_number?[u.manufacturer_part_number]:[]);if(o&&h.some((u)=>u.trim().toLowerCase()!==o.trim().toLowerCase()))throw s;let d=l?"the parts engine only accepted a request without the datasheet option":s instanceof Error?s.message:String(s);return{circuitJson:c,datasheetFailureReason:d}}},jxn=async(e,t)=>{let{circuitJson:n}=await Jnt(e,{...t,includeDatasheetInformation:!1});return n},git=async({fetchPartCircuitJson:e,supplierPartNumber:t,manufacturerPartNumber:n},o)=>{let r=o.config.componentName==="Chip"||o.config.componentName==="OpAmp"||o.config.componentName==="PushButton",i={supplierPartNumber:t,manufacturerPartNumber:n,platformFetch:o.root?.platform?.platformFetch,includeDatasheetInformation:r},s,a=o.root;if(o.config.componentName==="Chip"&&a){let h=G_n.get(a);if(!h)h=new WeakMap,G_n.set(a,h);let d=h.get(e);if(!d)d=new Map,h.set(e,d);let u=`datasheet_part:${JSON.stringify([t,n])}`;s=d.get(u)??Jnt(e,i),d.set(u,s)}else s=Jnt(e,i);let{circuitJson:c,datasheetFailureReason:l}=await s;if(r&&l!==void 0){let h=`Datasheet information for ${o.getDisplayName()} could not be fetched: ${l}. Pin attributes may not be populated.`;if(o.source_component_id&&o.root)o.root.db.source_property_ignored_warning.insert({source_component_id:o.source_component_id,property_name:"pinAttributes",message:h,error_type:"source_property_ignored_warning"});else console.warn(h)}return c},Kxn=(e)=>{let t=e.filter((o)=>o.type==="source_port"),n=e.filter((o)=>o.type==="source_component").filter((o)=>o.internally_connected_source_port_ids!==void 0);if(!n.length)return;return n.flatMap((o)=>(o.internally_connected_source_port_ids??[]).flatMap((r)=>{let i=r.map((s)=>t.find((a)=>a.source_port_id===s&&a.source_component_id===o.source_component_id));if(i.some((s)=>!s))return[];return[i.map((s)=>s.pin_number!==void 0?`pin${s.pin_number}`:s.name)]}))},CNr=(e)=>{if(!["Chip","PushButton","OpAmp"].includes(e.config.componentName))return;if(e._hasStartedPinAttributesFetch)return;if(e.getInheritedProperty("partsEngineDisabled"))return;if(e.getInheritedProperty("bomDisabled"))return;if(e._importedInternallyConnectedPinNames!==void 0)return;if(e._importedSourcePorts.some((s)=>Object.values(hX.parse(s)).some((a)=>a!==void 0)))return;let t=e.getInheritedProperty("partsEngine");if(!t?.fetchPartCircuitJson)return;let n=e.resolveFootprint(),o=e._parsedProps.supplierPartNumbers;if($M.shape.supplierPartNumbers.unwrap().keySchema.options.some((s)=>typeof e.root?.platform?.footprintLibraryMap?.[s]!=="function"&&o?.[s]?.some((a)=>n===`${s}:${a}`)))return;let r=Object.values(o??{}).flat()[0],i=ii(e._parsedProps);if(!r&&!i)return;e._hasStartedPinAttributesFetch=!0,e._queueAsyncEffect("fetch-datasheet-validation-metadata",async()=>{try{let s=await git({fetchPartCircuitJson:t.fetchPartCircuitJson,supplierPartNumber:r,manufacturerPartNumber:i},e);e._fetchedSourcePortsForPinAttributes=s?.filter((a)=>a.type==="source_port")??[],e._fetchedInternallyConnectedPinNames=Kxn(s??[]),e._markDirty("SourceDesignRuleChecks")}catch{}})},U_n=(e)=>{if(!["Chip","PushButton","OpAmp"].includes(e.config.componentName))return;let t=e.config.componentName==="Chip";if(!e.source_component_id)return;let{db:n}=e.root,o=n.source_component_pins_underspecified_warning.getWhere({source_component_id:e.source_component_id}),r=e.root?.platform?.drcChecksDisabled??e.getInheritedProperty("drcChecksDisabled"),i=e.root?.platform?.pinSpecificationDrcChecksDisabled??e.getInheritedProperty("pinSpecificationDrcChecksDisabled"),s=r||i;if(!s)CNr(e);let a=s?[]:e.selectAll("port").flatMap((g)=>{if(!g.source_port_id)return[];let f=n.source_port.get(g.source_port_id);return f?.source_component_id===e.source_component_id?[f]:[]}),c=s?null:n.source_component.get(e.source_component_id),l=c?[c,...a]:[],h=[];if(!s&&t)for(let g of e.selectAll("port")){let f=a.find((b)=>b.source_port_id===g.source_port_id);if(!f)continue;let y={};for(let b of g.getNameAndAliases())Object.assign(y,e._parsedProps.pinAttributes?.[b]);let x=Xxn(g,e._fetchedSourcePortsForPinAttributes.length?e._fetchedSourcePortsForPinAttributes:e._importedSourcePorts),C=yNr(y,x);if(C.length)h.push({pinName:f.name||"unnamed pin",reasons:C,sourcePort:f})}for(let[g,f]of[[n.source_no_power_pin_defined_warning,xBt],[n.source_no_ground_pin_defined_warning,CBt]]){let y=g.getWhere({source_component_id:e.source_component_id}),x=y?.type==="source_no_power_pin_defined_warning"?y.source_no_power_pin_defined_warning_id:y?.source_no_ground_pin_defined_warning_id,[C]=s||!t||h.length?[]:f(l);if(C)if(x)g.update(x,{message:C.message,source_port_ids:C.source_port_ids,subcircuit_id:C.subcircuit_id});else n.insertAll([C]);else if(x)g.delete(x)}let[d]=s||!t?[]:fBt(l),u=s?[]:xNr(e);if(!h.length&&!d&&!u.length){if(o)n.source_component_pins_underspecified_warning.delete(o.source_component_pins_underspecified_warning_id);return}let _=h.slice(0,3).map(({pinName:g,reasons:f})=>`${g} (${f.join("; ")})`).join(", "),p=h.length>3?`, and ${h.length-3} more`:"",m=h.length?`Chip ${e.name||"unnamed chip"} has pinAttributes that conflict with fetched pin metadata on ${h.length} pin${h.length===1?"":"s"}: ${_}${p}. Check the chip configuration against the part datasheet.`:d?.message,A={source_component_id:e.source_component_id,source_port_ids:[...new Set([...h.length?h.map(({sourcePort:g})=>g.source_port_id):d?.source_port_ids??[],...u.flatMap((g)=>g.sourcePortIds)])],subcircuit_id:e.getSubcircuit().subcircuit_id??void 0,warning_type:"source_component_pins_underspecified_warning",message:[m,...u.map((g)=>g.message)].filter(Boolean).join(" ")};if(o)n.source_component_pins_underspecified_warning.update(o.source_component_pins_underspecified_warning_id,A);else n.source_component_pins_underspecified_warning.insert(A)},bNr=/^(?:pin)?(\d+)$/,nB=(e)=>{let t=e.match(bNr);if(!t)return null;return Number.parseInt(t[1],10)},lde=(e)=>/^[A-Z]+[1-9]\d*$/.test(e);function Ait(e){let t=new Set(Object.keys(e).flatMap((i)=>{let s=nB(i);return s===null?[]:[s]})),n=Object.keys(e).filter(lde).sort((i,s)=>{let[,a,c]=i.match(/^([A-Z]+)(\d+)$/),[,l,h]=s.match(/^([A-Z]+)(\d+)$/);return a.length-l.length||(a<l?-1:a>l?1:0)||Number(c)-Number(h)}),o=[],r=1;for(let i of n){while(t.has(r))r++;o.push({physicalPinName:i,pinNumber:r++})}return Object.entries(e).map(([i,s])=>{let a=nB(i),c=a??o.find((l)=>l.physicalPinName===i)?.pinNumber;if(c===void 0)throw Error(`Invalid pinLabels key "${i}". Expected a numeric pin (e.g. pin1) or physical ball name (e.g. A1).`);return{pinNumber:c,physicalPinName:a===null?i:void 0,labels:typeof s==="string"?[s]:[...s]}})}function $he(e){if(!Object.keys(e).some(lde))return Object.fromEntries(Object.entries(e).map(([t,n])=>[t,typeof n==="string"?n:[...n]]));return Object.fromEntries(Ait(e).map(({pinNumber:t,physicalPinName:n,labels:o})=>[`pin${t}`,n?[...o,n]:o]))}var Znt=({layer:e,pcbCcwRotationDegrees:t,modelCcwRotationOffsetDegrees:n})=>{let o=e==="bottom";return{x:n.x,y:n.y+(o?180:0),z:nu(o?n.z-t:t+n.z)}},INr={invalid_bend_geometry:"Invalid bend geometry",unsupported_bend_geometry:"Unsupported bend geometry",nonparallel_bends:"Bends must be parallel with the same moving direction",overlapping_bend_zones:"Overlapping PCB bend zones or incompatible moving regions are not supported",invalid_finite_bend_region:"The bend does not define a valid finite moving region",incomplete_bend_cross_section:"The bend cross-section does not cover the board",rigid_bend_zone_intersection:"CAD mount intersects PCB bend zone"};function $xn(e,t){let n=INr[e.code];if(!e.bendId)return n;let o=t.find((r)=>r.pcb_bend_id===e.bendId);return`${n} ${o?.name??"unnamed bend"}`}var HS=class extends Error{constructor(e){super(e.message);this.issue=e,this.name="PcbFoldError"}issue};function vNr(e){try{return{ok:!0,value:e()}}catch(t){if(!(t instanceof HS))throw t;return{ok:!1,issue:t.issue}}}var kh=0.0000001,eot=(e,t)=>Math.hypot(e.x-t.x,e.y-t.y)<kh;function TS(e,t,n=!0){let o=!1;for(let r=0;r<t.length;r++){let i=t[r],s=t[(r+1)%t.length],a=(e.x-i.x)*(s.y-i.y)-(e.y-i.y)*(s.x-i.x);if(Math.abs(a)<kh*Math.max(1,Math.hypot(s.x-i.x,s.y-i.y))&&e.x>=Math.min(i.x,s.x)-kh&&e.x<=Math.max(i.x,s.x)+kh&&e.y>=Math.min(i.y,s.y)-kh&&e.y<=Math.max(i.y,s.y)+kh)return n;if(i.y>e.y!==s.y>e.y&&e.x<i.x+(s.x-i.x)*(e.y-i.y)/(s.y-i.y))o=!o}return o}function W_n(e,t,n,o){let r=[];for(let i=0;i<e.length;i++){let s=e[i],a=e[(i+1)%e.length],c=s.x*t+s.y*n-o,l=a.x*t+a.y*n-o;if(Math.abs(c)<kh&&Math.abs(l)<kh)continue;if(c>kh&&l>kh||c<-kh&&l<-kh)continue;if(Math.abs(c-l)<kh)continue;let h=Math.max(0,Math.min(1,c/(c-l))),d={x:s.x+(a.x-s.x)*h,y:s.y+(a.y-s.y)*h};if(r.some((u)=>eot(u.point,d)))continue;r.push(h>1-kh?{point:a,edge:(i+1)%e.length,fraction:0}:{point:d,edge:i,fraction:h})}return r.sort((i,s)=>-n*i.point.x+t*i.point.y-(-n*s.point.x+t*s.point.y))}function X_n(e,t,n,o,r){let i=[];for(let d=0;d<e.length;d++){i.push(e[d]);for(let u of[t,n].filter((_)=>_.edge===d).sort((_,p)=>_.fraction-p.fraction))if(u.fraction>kh)i.push(u.point)}let s=i.findIndex((d)=>eot(d,t.point)),a=i.findIndex((d)=>eot(d,n.point));if(s<0||a<0)throw Error("Cannot resolve PCB bend boundary crossings");let c=(d,u)=>{let _=[i[d]];while(d!==u)d=(d+1)%i.length,_.push(i[d]);return _},l=e.reduce((d,u,_)=>{let p=e[(_+1)%e.length];return d+u.x*p.y-p.x*u.y},0);return Math.sign(l)*((n.point.y-t.point.y)*o-(n.point.x-t.point.x)*r)>0?c(s,a):c(a,s)}function SNr({bendId:e,outline:t,nx:n,ny:o,center:r,proximal:i,axisMin:s,axisMax:a}){let c=W_n(t,n,o,r).filter(({point:m})=>{let A=-o*m.x+n*m.y;return A>=s-kh&&A<=a+kh});if(c.length!==2)throw new HS({code:"invalid_finite_bend_region",message:"A finite PCB bend must cut one board cross-section from boundary to boundary",bendId:e});let[l,h]=c,d={x:(l.point.x+h.point.x)/2,y:(l.point.y+h.point.y)/2};if(!TS(d,t,!1))throw new HS({code:"invalid_finite_bend_region",message:"A finite PCB bend must pass through the board interior",bendId:e});let u=X_n(t,l,h,n,o),_=-o*d.x+n*d.y,p=W_n(t,n,o,i);for(let m=0;m+1<p.length;m++){let A=p[m],g=p[m+1],f=-o*A.point.x+n*A.point.y,y=-o*g.point.x+n*g.point.y;if(_<=f+kh||_>=y-kh)continue;let x={x:(A.point.x+g.point.x)/2,y:(A.point.y+g.point.y)/2};if(!TS(x,t,!1))continue;let C=X_n(t,A,g,n,o);if(C.some((b)=>b.x*n+b.y*o<i-kh)||u.some((b)=>!TS(b,C))||C.some((b)=>b.x*n+b.y*o>=r-kh&&!TS(b,u)))break;return C}throw new HS({code:"invalid_finite_bend_region",message:"The finite PCB bend zone must remain in one connected board cross-section",bendId:e})}function PNr(e,t){if(e.some((o)=>TS(o,t))||t.some((o)=>TS(o,e)))return!0;let n=(o,r,i)=>(r.x-o.x)*(i.y-o.y)-(r.y-o.y)*(i.x-o.x);for(let o=0;o<e.length;o++)for(let r=0;r<t.length;r++){let i=e[o],s=e[(o+1)%e.length],a=t[r],c=t[(r+1)%t.length];if(n(i,s,a)*n(i,s,c)<-kh&&n(a,c,i)*n(a,c,s)<-kh)return!0}return!1}function j_n(e,t){if(t.some((n)=>!TS(n,e)))return!1;for(let n=0;n<t.length;n++){let o=t[n],r=t[(n+1)%t.length],i=r.x-o.x,s=r.y-o.y,a=i*i+s*s;if(a<kh*kh)continue;let c=[0,1];for(let l=0;l<e.length;l++){let h=e[l],d=e[(l+1)%e.length],u=d.x-h.x,_=d.y-h.y,p=i*_-s*u,m=h.x-o.x,A=h.y-o.y;if(Math.abs(p)<kh){if(Math.abs(m*s-A*i)>kh)continue;for(let g of[h,d]){let f=((g.x-o.x)*i+(g.y-o.y)*s)/a;if(f>0&&f<1)c.push(f)}}else{let g=(m*_-A*u)/p,f=(m*s-A*i)/p;if(g>0&&g<1&&f>=-kh&&f<=1+kh)c.push(g)}}c.sort((l,h)=>l-h);for(let l=1;l<c.length;l++){let h=(c[l-1]+c[l])/2;if(!TS({x:o.x+h*i,y:o.y+h*s},e))return!1}}return!0}var oB=0.0000001;function ENr(e){let t=[...e].sort((a,c)=>a.start-c.start||a.nx-c.nx||a.ny-c.ny||a.id.localeCompare(c.id)),n=new Map,o=(a)=>{throw new HS({code:"overlapping_bend_zones",message:"Overlapping PCB bend zones or incompatible moving regions are not supported",bendId:a.id})};for(let a=0;a<t.length;a++)for(let c=a+1;c<t.length;c++){let l=t[a],h=t[c];if(l.movingOutline&&h.movingOutline){if(!PNr(l.movingOutline,h.movingOutline))continue;let d=j_n(l.movingOutline,h.movingOutline),u=j_n(h.movingOutline,l.movingOutline);if(d===u)o(h);let _=d?l:h,p=d?h:l;if(p.movingOutline.some((m)=>m.x*_.nx+m.y*_.ny<_.end-oB))o(p);n.set(p,[...n.get(p)??[],_])}else{if(Math.abs(l.nx-h.nx)>oB||Math.abs(l.ny-h.ny)>oB)throw new HS({code:"nonparallel_bends",message:"Nonparallel PCB bends or bends with opposite moving directions require a board outline to resolve their moving regions"});if(h.start<l.end-oB)o(h);n.set(h,[...n.get(h)??[],l])}}let r=[],i=new Set,s=(a)=>{if(i.has(a))return;for(let c of n.get(a)??[])s(c);i.add(a),r.push(a)};for(let a of t)s(a);return r}function MNr(e,t,{outline:n}={}){if(!Number.isFinite(t)||t<0)throw Error("Board thickness must be finite and nonnegative");if(n&&(n.length<3||n.some((c)=>!Number.isFinite(c.x)||!Number.isFinite(c.y))))throw Error("A finite board outline with at least three points is required");let o=e.map((c)=>{let{start:l,end:h,bend_angle:d,bend_radius:u}=c;if([l?.x,l?.y,h?.x,h?.y,d,u].some((b)=>!Number.isFinite(b))||u<=t/2||!["left","right"].includes(c.bend_side))throw new HS({code:"invalid_bend_geometry",message:`Invalid PCB bend ${c.pcb_bend_id}: finite geometry and radius greater than half the board thickness are required`,bendId:c.pcb_bend_id});let p=Math.hypot(h.x-l.x,h.y-l.y);if(p<oB||Math.abs(d)>180)throw new HS({code:"unsupported_bend_geometry",message:`Unsupported PCB bend ${c.pcb_bend_id}: distinct endpoints and angles within ±180 degrees are required`,bendId:c.pcb_bend_id});let m=c.bend_side==="right"?1:-1,A=m*(h.y-l.y)/p,g=-m*(h.x-l.x)/p,f=d*Math.PI/180,y=u*Math.abs(f),x=l.x*A+l.y*g,C={id:c.pcb_bend_id,nx:A,ny:g,start:x-y/2,end:x+y/2,angle:f,radius:u,axisMin:Math.min(-g*l.x+A*l.y,-g*h.x+A*h.y),axisMax:Math.max(-g*l.x+A*l.y,-g*h.x+A*h.y)};if(n&&Math.abs(f)>oB)C.movingOutline=SNr({bendId:c.pcb_bend_id,outline:n,nx:A,ny:g,center:x,proximal:C.start,axisMin:C.axisMin,axisMax:C.axisMax});return C}).filter((c)=>Math.abs(c.angle)>oB),r=ENr(o),i=[...r].reverse(),s=({p:c,anchor:l,direction:h})=>{let d={...c};for(let u of i){if(u.movingOutline&&!TS(l,u.movingOutline))continue;let _=u.end-u.start,p=l.x*u.nx+l.y*u.ny-u.start,m=Math.max(0,Math.min(_,p)),A=u.angle*m/_,g=Math.cos(A),f=Math.sin(A),y=d.x*u.nx+d.y*u.ny-(h?0:u.start),x=d.x-(y+(h?0:u.start))*u.nx,C=d.y-(y+(h?0:u.start))*u.ny,b=Math.sign(u.angle)*u.radius,I=h?0:b*f-m*g,v=h?0:b*(1-g)-m*f,P=y*g-d.z*f+I;d={x:x+(P+(h?0:u.start))*u.nx,y:C+(P+(h?0:u.start))*u.ny,z:y*f+d.z*g+v}}return d},a=({p:c,anchor:l,direction:h})=>{let d=h?{x:0,y:0,z:0}:s({p:{x:0,y:0,z:0},anchor:l,direction:!1}),u={x:c.x-d.x,y:c.y-d.y,z:c.z-d.z},_=[{x:1,y:0,z:0},{x:0,y:1,z:0},{x:0,y:0,z:1}].map((m)=>s({p:m,anchor:l,direction:!0})),p=(m)=>m.x*u.x+m.y*u.y+m.z*u.z;return{x:p(_[0]),y:p(_[1]),z:p(_[2])}};return{bends:r,inversePoint:(c,l)=>a({p:c,anchor:l,direction:!1}),inverseDirection:(c,l)=>a({p:c,anchor:l,direction:!0}),point:(c,l=c)=>s({p:c,anchor:l,direction:!1}),direction:(c,l)=>s({p:c,anchor:l,direction:!0}),assertRigid(c,l){for(let h of o){let d=h.end-h.start,u=c.map((_)=>h.movingOutline&&!TS(_,h.movingOutline)?0:Math.max(0,Math.min(d,_.x*h.nx+_.y*h.ny-h.start)));if(Math.max(...u)>oB&&Math.min(...u)<d-oB)throw new HS({code:"rigid_bend_zone_intersection",message:`${l} intersects PCB bend zone ${h.id}`,bendId:h.id})}}}}function wNr(e,t,n={}){return vNr(()=>MNr(e,t,n))}var BNr=[{x:1,y:0,z:0},{x:0,y:1,z:0},{x:0,y:0,z:1}];function TNr(e,t){let[n,o,r]=[t.x,t.y,t.z].map((a)=>a*Math.PI/180),i={x:Math.cos(r)*e.x-Math.sin(r)*e.y,y:Math.sin(r)*e.x+Math.cos(r)*e.y,z:e.z},s={x:Math.cos(o)*i.x+Math.sin(o)*i.z,y:i.y,z:-Math.sin(o)*i.x+Math.cos(o)*i.z};return{x:s.x,y:Math.cos(n)*s.y-Math.sin(n)*s.z,z:Math.sin(n)*s.y+Math.cos(n)*s.z}}function DNr([e,t,n]){let o=Math.asin(Math.max(-1,Math.min(1,n.x))),r=Math.abs(n.x)<0.999999999999;return{x:(r?Math.atan2(-n.y,n.z):Math.atan2(t.z,t.y))*180/Math.PI,y:o*180/Math.PI,z:(r?Math.atan2(-t.x,e.x):0)*180/Math.PI}}function NNr({cadComponentPlacement:e,foldPcbs:t},n){if(e.is_on_folded_board===!0===t)return e;let{fold:o,boardCenter:r,flatMount:i}=n,s={x:i.x-r.x,y:i.y-r.y,z:0};o.assertRigid([s],"CAD mount");let a={x:e.position.x-r.x,y:e.position.y-r.y,z:e.position.z},c=t?o.direction:o.inverseDirection,l=t?o.point(a,s):o.inversePoint(a,s),h=e.rotation??n.defaultRotation??{x:0,y:0,z:0},d=BNr.map((u)=>c(TNr(u,h),s));return{...e,position:{x:l.x+r.x,y:l.y+r.y,z:l.z},rotation:DNr(d),is_on_folded_board:t}}function RNr(e){let t=e._getBoard();if(!t?.pcbFold||!t.pcb_board_id||!e.pcb_component_id)return;let{db:n}=e.root,o=n.pcb_board.get(t.pcb_board_id),r=n.pcb_component.get(e.pcb_component_id);return{fold:t.pcbFold,boardCenter:o.center,flatMount:r.center}}function tot(e,t){let n=RNr(e);if(!n)return t;try{return NNr({cadComponentPlacement:t,foldPcbs:!0},n)}catch(o){if(!(o instanceof HS))throw o;let{db:r}=e.root,i=r.pcb_component.get(e.pcb_component_id),s=r.source_component.get(i.source_component_id)?.name??"unnamed component";return r.pcb_placement_error.insert({error_type:"pcb_placement_error",message:`Unable to fold CAD for PCB component ${s}; CAD remains flat: ${$xn(o.issue,r.pcb_bend.list())}`,subcircuit_id:e.getSubcircuit()?.subcircuit_id??void 0}),t}}var K_n=class{input;constructor({input:e}){this.input=e}solveAndMapToTraces(){let e=[];for(let t of this.input.connections){if(t.pointsToConnect.length!==2)continue;let[n,o]=t.pointsToConnect,r={type:"pcb_trace",pcb_trace_id:"",connection_name:t.name,route:[{route_type:"wire",x:n.x,y:n.y,layer:"top",width:0.1},{route_type:"wire",x:o.x,y:o.y,layer:"top",width:0.1}]};e.push(r)}return e}},QNr=(e)=>{let t=Math.min(...e.map((i)=>i.center.x)),n=Math.max(...e.map((i)=>i.center.x)),o=Math.min(...e.map((i)=>i.center.y)),r=Math.max(...e.map((i)=>i.center.y));return{minX:t,maxX:n,minY:o,maxY:r}},kNr=["top","bottom","inner1","inner2"],Eve=(e,t,n)=>{let o=[];if(n.length===0){let c=e[0].layers;for(let l of c)o.push(...Eve(e.slice(1),t,[l]));return o}if(e.length===0)return[];let r=e[0],i=r.via||r.optional_via,s=n[n.length-1];if(e.length===1){let c=r;if(c.layers&&i)return c.layers.map((l)=>({layer_path:[...n,l]}));if(c.layers?.includes(s))return[{layer_path:[...n,s]}];return[]}if(!i){if(r.layers){if(!r.layers.includes(s))return[]}return Eve(e.slice(1),t,n.concat([s]))}let a=(r.optional_via?t:t.filter((c)=>c!==s)).filter((c)=>!r.layers||r.layers?.includes(c));for(let c of a)o.push(...Eve(e.slice(1),t,n.concat(c)));return o},LNr=(e,t={})=>Eve(e,t.layerSelectionPreference??kNr,[]);function $_n(e){let t={x:e.to.x-e.from.x,y:e.to.y-e.from.y},n=Math.abs(t.x),o=Math.abs(t.y);if(n>o)return t.x>0?"right":"left";return t.y>0?"down":"up"}var lk=(e)=>{if(e.route_type==="through_pad")return e.start;return{x:e.x,y:e.y}},Jxn=(e)=>{if(e.route_type==="through_pad")return[e.start,e.end];return[{x:e.x,y:e.y}]},qve=(e,t="constant")=>{let n=e.slice().reverse().map((o)=>{if(o.route_type==="wire"){let{start_width:r,end_width:i,width_interpolation_mode:s,...a}=o;return a}if(o.route_type!=="through_pad")return{...o};return{...o,start:o.end,end:o.start,start_layer:o.end_layer,end_layer:o.start_layer}});if(t==="constant"){for(let o=0;o<n.length-1;o++){let r=n[o],i=n[o+1];if(r?.route_type!=="wire"||i?.route_type!=="wire"||r.layer!==i.layer)continue;let s=e[e.length-o-2];if(s?.route_type==="wire")r.width=s.width}for(let o=0;o<n.length;o++){let r=n[o];if(r?.route_type!=="wire")continue;let i=n[o+1];if(i?.route_type==="wire"&&i.layer===r.layer)continue;let s=e.length-o-1;while(s<e.length-1){let c=e[s],l=e[s+1];if(c?.route_type!=="wire"||l?.route_type!=="wire"||c.layer!==l.layer)break;s++}let a=e[s];if(a?.route_type==="wire")r.width=a.width}}for(let o=0;o<e.length-1;o++){let r=e[o],i=e[o+1];if(r.route_type!=="wire"||!r.width_interpolation_mode)continue;if(i.route_type!=="wire"||i.layer!==r.layer)continue;let s=n[e.length-o-2];if(s.route_type!=="wire")continue;Object.assign(s,{width:r.end_width,start_width:r.end_width,end_width:r.start_width,width_interpolation_mode:r.width_interpolation_mode})}return n};function uJ(e,t){let n=lk(e),o=lk(t);return Math.hypot(n.x-o.x,n.y-o.y)}var HNr=(e)=>{if(e.length===1)return e[0];if(e.some((c)=>c.length===0))throw Error("Cannot merge routes with zero length");let t=[],n=e[0][0],o=e[0][e[0].length-1],r=e[1][0],i=e[1][e[1].length-1],s=Math.min(uJ(n,r),uJ(n,i)),a=Math.min(uJ(o,r),uJ(o,i));if(s<a)t.push(...qve(e[0]));else t.push(...e[0]);for(let c=1;c<e.length;c++){let l=t[t.length-1],h=e[c],d=h[0],u=h[h.length-1],_=uJ(l,d),p=uJ(l,u);if(_<p)t.push(...h);else t.push(...qve(h))}for(let c=1;c<t.length-1;c++){let l=t[c-1],h=t[c];if(l.route_type!=="wire")continue;if(h.route_type!=="wire")continue;if(l.layer!==h.layer)t.splice(c,0,{x:l.x,y:l.y,from_layer:l.layer,to_layer:h.layer,route_type:"via"})}return t};function not(e,t){if(e.length<2||!e.some((o)=>o.physicalPinName))return;let n=e.map((o)=>`${o.getParentNormalComponent()?.name??"unnamed component"}.${o.physicalPinName??o.name}`);throw Error(`Ambiguous port "${t}"; use a physical ball name: ${n.join(", ")}.`)}var q_n=new WeakMap,FNr=(e)=>{let t=q_n.get(e);if(!t)t="partial"in e?e.partial({name:!0}):e,q_n.set(e,t);return t},J_n=new WeakMap,zNr=(e,t)=>{let n=J_n.get(e);if(!n){n=new Map;for(let o of e)for(let r of o.getNameAndAliases().join(" ").split(/\s+/)){let i=`net.${r}`;if(!n.has(i))n.set(i,o)}J_n.set(e,n)}return n.get(t)??null},_9e=Zxn.default("tscircuit:renderable"),tY=["ReactSubtreesRender","RenderIsolatedSubcircuits","InflateSubcircuitCircuitJson","SourceNameDuplicateComponentRemoval","PcbFootprintStringRender","FetchPartFootprint","ResolveFootprintPinLabels","InitializePortsFromChildren","CreateNetsFromProps","AssignFallbackProps","CreateTracesFromProps","CreateTracesFromNetLabels","CreateTraceHintsFromProps","CreateAutoplacedBreakoutPoints","SourceGroupRender","AssignNameToUnnamedComponents","SourceRender","CheckRefDesConvention","SourceComponentPropertyValidation","SourceParentAttachment","PortMatching","OptimizeSelectorCache","SourceTraceRender","SourceAddConnectivityMapKey","SourceDesignRuleChecks","SimulationRender","SchematicComponentRender","SchematicPortRender","SymbolContainerRender","SchematicPrimitiveRender","SchematicSymbolResize","SchematicComponentSizeCalculation","SchematicLayout","SchematicSectionRender","SchematicTraceRender","SchematicSheetRender","SchematicReplaceNetLabelsWithSymbols","SchematicLabelNetsWithConflictingNames","PanelBoardLayout","ValidatePcbCoordinates","PcbComponentRender","PcbPrimitiveRender","PcbFootprintLayout","PcbPortRender","PcbPortAttachment","PcbComponentSizeCalculation","PcbComponentAnchorAlignment","PcbCalcPlacementResolution","PcbLayout","PcbBoardAutoSize","PanelLayout","PcbFlexRender","PcbAutoplaceBreakoutPoints","PcbTraceHintRender","PcbManualTraceRender","PcbPlacementDesignRuleChecks","PcbTraceRender","PcbRouteNetIslands","PcbTraceTeardropRender","PcbCopperPourRender","PcbViaStitchRender","PcbCopperPourCleanup","PcbSimulationRender","PcbDesignRuleChecks","SilkscreenOverlapAdjustment","CadModelRender","PartsEngineRender","MissingManufacturerPartNumberWarning","ComponentAvailabilityWarning","PartOrientationAnalysis","SupplierFootprintMismatchWarning","SimulationSpiceEngineRender"],Z_n=new Map(tY.map((e,t)=>[e,t])),ONr={InflateSubcircuitCircuitJson:["RenderIsolatedSubcircuits"],ResolveFootprintPinLabels:["PcbFootprintStringRender","FetchPartFootprint"],SchematicComponentRender:["PcbFootprintStringRender","FetchPartFootprint"],SchematicPortRender:["PcbFootprintStringRender","FetchPartFootprint"],SymbolContainerRender:["PcbFootprintStringRender","FetchPartFootprint"],SchematicPrimitiveRender:["PcbFootprintStringRender","FetchPartFootprint"],SchematicSymbolResize:["PcbFootprintStringRender","FetchPartFootprint"],SchematicComponentSizeCalculation:["PcbFootprintStringRender","FetchPartFootprint"],SchematicLayout:["PcbFootprintStringRender","FetchPartFootprint"],SchematicSectionRender:["PcbFootprintStringRender","FetchPartFootprint"],SchematicTraceRender:["PcbFootprintStringRender","FetchPartFootprint"],SchematicSheetRender:["PcbFootprintStringRender","FetchPartFootprint"],SchematicReplaceNetLabelsWithSymbols:["PcbFootprintStringRender","FetchPartFootprint"],SchematicLabelNetsWithConflictingNames:["RenderIsolatedSubcircuits","PcbFootprintStringRender","FetchPartFootprint","SchematicTraceRender"],PcbFootprintLayout:["PcbFootprintStringRender","FetchPartFootprint"],PcbComponentSizeCalculation:["PcbFootprintStringRender","FetchPartFootprint"],PcbLayout:["PcbFootprintStringRender","FetchPartFootprint"],PcbBoardAutoSize:["PcbFootprintStringRender","FetchPartFootprint"],PcbTraceHintRender:["PcbFootprintStringRender","FetchPartFootprint"],PcbManualTraceRender:["PcbFootprintStringRender","FetchPartFootprint"],PcbTraceTeardropRender:["PcbTraceRender","PcbRouteNetIslands"],PcbCopperPourRender:["PcbFootprintStringRender","FetchPartFootprint","PcbPlacementDesignRuleChecks","PcbTraceRender","PcbRouteNetIslands","PcbTraceTeardropRender"],PcbViaStitchRender:["PcbFootprintStringRender","FetchPartFootprint","PcbPlacementDesignRuleChecks","PcbTraceRender","PcbRouteNetIslands","PcbCopperPourRender"],PcbPlacementDesignRuleChecks:["PcbFootprintStringRender","FetchPartFootprint"],PcbCopperPourCleanup:["PcbFootprintStringRender","FetchPartFootprint","PcbPlacementDesignRuleChecks","PcbTraceRender","PcbRouteNetIslands","PcbCopperPourRender","PcbViaStitchRender"],PcbTraceRender:["PcbFootprintStringRender","FetchPartFootprint"],PcbRouteNetIslands:["PcbFootprintStringRender","FetchPartFootprint","PcbPlacementDesignRuleChecks"],PcbDesignRuleChecks:["PcbFootprintStringRender","FetchPartFootprint","PcbPlacementDesignRuleChecks","PcbTraceRender","PcbCopperPourRender","PcbViaStitchRender","PcbCopperPourCleanup"],PcbSimulationRender:["PcbFootprintStringRender","FetchPartFootprint","PcbPlacementDesignRuleChecks","PcbTraceRender","PcbRouteNetIslands","PcbCopperPourRender","PcbViaStitchRender","PcbCopperPourCleanup"],SilkscreenOverlapAdjustment:["PcbFootprintStringRender","FetchPartFootprint"],CadModelRender:["PcbFootprintStringRender","FetchPartFootprint"],PartsEngineRender:["PcbFootprintStringRender","FetchPartFootprint"],MissingManufacturerPartNumberWarning:["PcbFootprintStringRender","FetchPartFootprint","PartsEngineRender"],ComponentAvailabilityWarning:["PcbFootprintStringRender","FetchPartFootprint","PartsEngineRender"],PartOrientationAnalysis:["PcbFootprintStringRender","FetchPartFootprint","PartsEngineRender"],SupplierFootprintMismatchWarning:["PcbFootprintStringRender","FetchPartFootprint","PartsEngineRender"],SourceAddConnectivityMapKey:["PcbFootprintStringRender","FetchPartFootprint"],PcbComponentAnchorAlignment:["PcbFootprintStringRender","FetchPartFootprint"],PcbCalcPlacementResolution:["PcbFootprintStringRender","FetchPartFootprint"],ValidatePcbCoordinates:["PcbFootprintStringRender","FetchPartFootprint"],SourceTraceRender:["PcbFootprintStringRender","FetchPartFootprint"],SourceDesignRuleChecks:["PcbFootprintStringRender","FetchPartFootprint"]},VNr=0,YNr=0,e5n=class e{_phaseStatesByName;_phaseStatesByIndex;get renderPhaseStates(){return this._phaseStatesByName??=Object.fromEntries(tY.map((t,n)=>[t,this._phaseStatesByIndex[n]]))}set renderPhaseStates(t){this._phaseStatesByName=t}shouldBeRemoved=!1;children;isPcbPrimitive=!1;isSchematicPrimitive=!1;_renderId;_currentRenderPhase=null;_pcbTraceRenderWaitingForPlacementChecks=!1;_asyncEffects=[];parent=null;constructor(t){this._renderId=`${VNr++}`,this.children=[],this._phaseStatesByIndex=Array.from({length:tY.length},()=>({initialized:!1,dirty:!1}))}_markDirty(t){let n=Z_n.get(t);for(let o=n;o<tY.length;o++){let r=this._phaseStatesByName?.[tY[o]]??this._phaseStatesByIndex[o];r.dirty=!0}if(this.parent?._markDirty)this.parent._markDirty(t)}_queueAsyncEffect(t,n){let o=`${this._renderId}:${YNr++}`,r={asyncEffectId:o,promise:n(),phase:this._currentRenderPhase,effectName:t,complete:!1};this._asyncEffects.push(r);let i=this._getRootCircuit();if(i)i.emit("asyncEffect:start",{asyncEffectId:o,effectName:t,componentDisplayName:this.getString(),phase:r.phase});r.promise.then(()=>{r.complete=!0;let s=this._getRootCircuit();if(s)s.emit("asyncEffect:end",{asyncEffectId:o,effectName:t,componentDisplayName:this.getString(),phase:r.phase})}).catch((s)=>{console.error(`Async effect error in ${r.phase} "${t}":
${s.stack}`),r.complete=!0;let a=this._getRootCircuit();if(a)a.emit("asyncEffect:end",{asyncEffectId:o,effectName:t,componentDisplayName:this.getString(),phase:r.phase,error:s.toString()})})}_emitRenderLifecycleEvent(t,n){let o=this._getRootCircuit();if(o?._hasRenderLifecycleListeners===!1&&!_9e.enabled)return;let r=`renderable:renderLifecycle:${t}:${n}`,i=o&&(!o.hasEventListener||o.hasEventListener(r)||o.hasEventListener("renderable:renderLifecycle:anyEvent"));if(!_9e.enabled&&!i)return;let s=this.getString();if(_9e.enabled)_9e(`${t}:${n} ${s}`);if(!i)return;let a={renderId:this._renderId,componentDisplayName:s,type:r};o.emit(r,a),o.emit("renderable:renderLifecycle:anyEvent",{...a,type:r})}getString(){return this.constructor.name}_hasIncompleteAsyncEffects(){if(this._asyncEffects.some((t)=>!t.complete))return!0;return this.children.some((t)=>typeof t._hasIncompleteAsyncEffects==="function"?t._hasIncompleteAsyncEffects():!1)}_hasIncompleteAsyncEffectsInSubtreeForPhase(t){for(let n of this._asyncEffects)if(!n.complete&&n.phase===t)return!0;for(let n of this.children)if(n._hasIncompleteAsyncEffectsInSubtreeForPhase(t))return!0;return!1}_hasIncompleteAsyncEffectsForPhase(t){let n=this._getRootCircuit();if(n?._hasIncompleteAsyncEffectsForPhase)return n._hasIncompleteAsyncEffectsForPhase(t);return this._hasIncompleteAsyncEffectsInSubtreeForPhase(t)}getCurrentRenderPhase(){return this._currentRenderPhase}getRenderGraph(){return{id:this._renderId,currentPhase:this._currentRenderPhase,renderPhaseStates:this.renderPhaseStates,shouldBeRemoved:this.shouldBeRemoved,children:this.children.map((t)=>t.getRenderGraph())}}getTopLevelRenderable(){let t=this;while(t.parent&&t.parent instanceof e)t=t.parent;return t}runRenderCycle(){for(let t of tY)this.runRenderPhaseForChildren(t),this.runRenderPhase(t)}runRenderPhase(t){this._currentRenderPhase=t;let n=Z_n.get(t),o=this._phaseStatesByName?.[t]??this._phaseStatesByIndex[n],{initialized:r,dirty:i}=o;if(!r&&this.shouldBeRemoved)return;if(this.shouldBeRemoved&&r){this._emitRenderLifecycleEvent(t,"start"),this?.[`remove${t}`]?.(),o.initialized=!1,o.dirty=!1,this._emitRenderLifecycleEvent(t,"end");return}let s=n-1;if(this._asyncEffects.length>0&&s>=0){let c=tY[s];if(this._asyncEffects.some((h)=>h.phase===c&&!h.complete))return}let a=ONr[t]||[];if(a.length>0){for(let c of a)if(this._hasIncompleteAsyncEffectsForPhase(c))return}if(this._emitRenderLifecycleEvent(t,"start"),r){if(i)this?.[`update${t}`]?.(),o.dirty=!1;this._emitRenderLifecycleEvent(t,"end");return}o.dirty=!1,this?.[`doInitial${t}`]?.(),o.initialized=!0,this._emitRenderLifecycleEvent(t,"end")}runRenderPhaseForChildren(t){for(let n of this.children){if(t==="RenderIsolatedSubcircuits"&&"_isIsolatedSubcircuit"in this&&this._isIsolatedSubcircuit&&"doInitialRenderIsolatedSubcircuits"in this)continue;n.runRenderPhaseForChildren(t),n.runRenderPhase(t)}}_getRootCircuit(){if("root"in this)return this.root??null;return null}renderError(t){if(typeof t==="string")throw Error(t);throw Error(JSON.stringify(t,null,2))}},t5n=class extends Error{constructor(e,t,n){let o,r=Object.keys(n).filter((c)=>c!=="_errors"),i=[],s=t.pinLabels;if(s)for(let[c,l]of Object.entries(s)){let h=Array.isArray(l)?l:[l];for(let d of h)if(typeof d==="string"&&(d.startsWith(" ")||d.endsWith(" ")))i.push(`pinLabels.${c} ("${d}" has leading or trailing spaces)`)}let a=r.map((c)=>{if(c==="pinLabels"&&i.length>0)return i.join(", ");if(n[c]._errors[0])return`${c} (${n[c]._errors[0]})`;return`${c} (${JSON.stringify(n[c])})`}).join(", ");if("name"in t)o=`Invalid props for ${e} "${t.name}": ${a}`;else if("footprint"in t&&typeof t.footprint==="string")o=`Invalid props for ${e} (unnamed ${t.footprint} component): ${a}`;else o=`Invalid props for ${e} (unnamed): ${a}`;super(o);this.componentName=e,this.originalProps=t,this.formattedError=n}componentName;originalProps;formattedError},n5n={mm:1};function GNr(e,t){let{knownVariables:n,units:o}=t,r={...n5n,...o??{}},i=o5n(r5n(e)),s=i5n(i,r);return UNr(s,n)}function oot(e){let t=o5n(r5n(e));return i5n(t,n5n).filter((o)=>o.type==="identifier").map((o)=>o.value)}function o5n(e){let t={minx:"minX",maxx:"maxX",miny:"minY",maxy:"maxY"};return e.replace(/\.(minx|maxx|miny|maxy)\b/gi,(n,o)=>`.${t[String(o).toLowerCase()]??n.slice(1)}`)}function r5n(e){let t=e.trim();if(!t.toLowerCase().startsWith("calc"))return t;let n=t.match(/^calc\s*\((.*)\)$/is);if(!n)throw Error(`Invalid calc() expression: "${e}"`);return n[1].trim()}function i5n(e,t){let n=[],o=0,r=(a)=>a>="0"&&a<="9",i=(a)=>a>="A"&&a<="Z"||a>="a"&&a<="z"||a==="_",s=(a)=>i(a)||r(a)||a===".";while(o<e.length){let a=e[o];if(a===" "||a==="\t"||a===`
`||a==="\r"){o++;continue}if(r(a)||a==="."&&o+1<e.length&&r(e[o+1])){let c=o;o++;while(o<e.length){let u=e[o];if(r(u)||u===".")o++;else break}let l=e.slice(c,o),h=Number(l);if(Number.isNaN(h))throw Error(`Invalid number: "${l}"`);let d=o;while(o<e.length&&/[A-Za-z]/.test(e[o]))o++;if(o>d){let u=e.slice(d,o),_=t[u];if(_==null)throw Error(`Unknown unit: "${u}"`);h*=_}n.push({type:"number",value:h});continue}if(i(a)){let c=o;o++;while(o<e.length&&s(e[o]))o++;let l=e.slice(c,o);n.push({type:"identifier",value:l});continue}if(a==="("||a===")"){n.push({type:"paren",value:a}),o++;continue}if(a==="+"||a==="-"||a==="*"||a==="/"){n.push({type:"operator",value:a}),o++;continue}throw Error(`Unexpected character "${a}" in expression "${e}"`)}return n}function UNr(e,t){let n=0,o=()=>e[n],r=()=>e[n++],i=()=>{let h=o();if(!h)throw Error("Unexpected end of expression");if(h.type==="number")return r(),h.value;if(h.type==="identifier"){r();let d=t[h.value];if(d==null)throw Error(`Unknown variable: "${h.value}"`);return d}if(h.type==="paren"&&h.value==="("){r();let d=c(),u=o();if(!u||u.type!=="paren"||u.value!==")")throw Error('Expected ")"');return r(),d}throw Error(`Unexpected token "${h.value}"`)},s=()=>{let h=o();if(h&&h.type==="operator"&&(h.value==="+"||h.value==="-")){r();let d=s();return h.value==="+"?d:-d}return i()},a=()=>{let h=s();while(!0){let d=o();if(!d||d.type!=="operator")break;if(d.value!=="*"&&d.value!=="/")break;r();let u=s();if(d.value==="*")h*=u;else h/=u}return h},c=()=>{let h=a();while(!0){let d=o();if(!d||d.type!=="operator")break;if(d.value!=="+"&&d.value!=="-")break;r();let u=a();if(d.value==="+")h+=u;else h-=u}return h},l=c();if(n<e.length){let h=e.slice(n).map((d)=>("value"in d)?d.value:"?").join(" ");throw Error(`Unexpected tokens at end of expression: ${h}`)}return l}function s5n(e){let{vars:t,componentName:n,position:o,size:r}=e;t[`${n}.x`]=o.x,t[`${n}.y`]=o.y,t[`${n}.width`]=r.width,t[`${n}.height`]=r.height,t[`${n}.minX`]=o.x-r.width/2,t[`${n}.maxX`]=o.x+r.width/2,t[`${n}.minY`]=o.y-r.height/2,t[`${n}.maxY`]=o.y+r.height/2}function WNr(e){let t={};for(let n of e.source_component.list()){if(!n.name)continue;let o=e.pcb_component.getWhere({source_component_id:n.source_component_id});if(!o)continue;s5n({vars:t,componentName:n.name,position:{x:o.center.x,y:o.center.y},size:{width:o.width??0,height:o.height??0}})}return t}var XNr={from_left:{x:-1,y:0,z:0},from_right:{x:1,y:0,z:0},from_top:{x:0,y:1,z:0},from_bottom:{x:0,y:-1,z:0},from_above:{x:0,y:0,z:1},from_below:{x:0,y:0,z:-1}},hde=(e)=>{let{componentLayer:t,originalLayer:n}=e;return t==="bottom"!==(n==="bottom")},rot=(e)=>{let{insertionDirection:t,rotationDegrees:n=0,isFlipped:o=!1}=e;if(!t)return;let r=iAe[t],i=XNr[r],s=nP.compose(nP.rotate(nu(n)*Math.PI/180),o?nP.flipY():nP.identity()),a=nP.applyToPoint(s,i);return{x:a.x,y:a.y,z:o?-i.z:i.z}},jNr=(e)=>{let t=rot(e);if(!t)return;if(t.z!==0)return t.z>0?"from_above":"from_below";if(Math.abs(t.x)>=Math.abs(t.y))return t.x>=0?"from_right":"from_left";return t.y>=0?"from_top":"from_bottom"};function KNr(e){if(!e)return;let t={},n={};if(e.silkscreenFontSize!==void 0)n.fontSize=e.silkscreenFontSize;if(e.silkscreenTextVisibility!==void 0)n.visibility=e.silkscreenTextVisibility;if(Object.keys(n).length>0)t["& silkscreentext"]=n;if(Object.keys(t).length===0)return;return t}function $Nr({parentResolvedPcbSx:e,pcbStyle:t,ownPcbSx:n}){let o=KNr(t),r={},i=new Set;if(e)for(let s of Object.keys(e))i.add(s);if(o)for(let s of Object.keys(o))i.add(s);if(n)for(let s of Object.keys(n))i.add(s);for(let s of i)r[s]={...e?.[s],...o?.[s],...n?.[s]};return r}function fit(e,t){let n=["right","up","left","down"],o=n.indexOf(e);if(o===-1)return e;let r=Math.round(t/90),i=(o+r)%4;return n[i<0?i+4:i]}function yit(e,t){if(!e)return e;let n=e,o=n.match(/_(right|left|up|down)$/);if(o)n=n.replace(o[0],`_${fit(o[1],t)}`);let r=n.match(/_(horz|vert)$/);if(r&&xit(t))n=n.replace(r[0],r[1]==="horz"?"_vert":"_horz");return n}function xit(e){let t=(Math.round(e)%360+360)%360;return t===90||t===270}function iot(e,t){if(!xit(t))return e;return{width:e.height,height:e.width}}function gtt(e,t){let n=t.match(/^#(\w+)/);if(n)return e.props.id===n[1];let o=t.match(/^\.(\w+)/);if(o)return e.isMatchingNameOrAlias(o[1]);let[r,...i]=t.split(/(?=[#.[])/);if(r==="pin")r="port";if(r&&r!=="*"&&e.lowercaseComponentName!==r.toLowerCase())return!1;return i.every((s)=>{if(s.startsWith("#"))return e.props.id===s.slice(1);if(s.startsWith("."))return e.isMatchingNameOrAlias(s.slice(1));let a=s.match(/\[(\w+)=['"]?(.+?)['"]?\]/);if(!a)return!0;let[,c,l]=a;return e.props[c].toString()===l})}var yZ={isTag:(e)=>!0,getParent:(e)=>e.parent,getChildren:(e)=>e.children,getName:(e)=>e.lowercaseComponentName,getAttributeValue:(e,t)=>{if(t==="class"&&"getNameAndAliases"in e)return e.getNameAndAliases().join(" ");if(t==="name"&&e._parsedProps?.name)return e._parsedProps.name;if(e._parsedProps&&t in e._parsedProps){let r=e._parsedProps[t];return typeof r==="string"?r:r!==null&&r!==void 0?String(r):null}let n=Object.keys(e._parsedProps??{}).find((r)=>r.toLowerCase()===t);if(n){let r=e._parsedProps[n];return typeof r==="string"?r:r!==null&&r!==void 0?String(r):null}if(t in e){let r=e[t];return typeof r==="string"?r:r!==null&&r!==void 0?String(r):null}let o=e._attributeLowerToCamelNameMap;if(o){let r=o[t];if(r&&r in e){let i=e[r];return typeof i==="string"?i:i!==null&&i!==void 0?String(i):null}}return null},hasAttrib:(e,t)=>{if(t==="class")return!!e._parsedProps?.name;if(e._parsedProps&&t in e._parsedProps)return!0;if(Object.keys(e._parsedProps??{}).some((o)=>o.toLowerCase()===t))return!0;if(t in e)return!0;let n=e._attributeLowerToCamelNameMap;if(n){let o=n[t];if(o&&o in e)return!0}return!1},getSiblings:(e)=>{if(!e.parent)return[];return e.parent.children},prevElementSibling:(e)=>{if(!e.parent)return null;let t=e.parent.children,n=t.indexOf(e);return n>0?t[n-1]:null},getText:()=>"",removeSubsets:(e)=>e.filter((t,n)=>!e.some((o,r)=>n!==r&&o!==t&&o.getDescendants().includes(t))),existsOne:(e,t)=>t.some(e),findAll:(e,t)=>{let n=[],o=(r)=>{if(e(r))n.push(r);for(let i of r.children)o(i)};for(let r of t)o(r);return n},findOne:(e,t)=>{for(let n of t){if(e(n))return n;let o=n.children;if(o.length>0){let r=yZ.findOne(e,o);if(r)return r}}return null},equals:(e,t)=>e._renderId===t._renderId,isHovered:(e)=>!1,isVisited:(e)=>!1,isActive:(e)=>!1},qNr={...yZ,getChildren:(e)=>e.children.filter((t)=>!t.isSubcircuit)},egn={...yZ,getChildren:(e)=>e.children.filter((t)=>t.isSubcircuit)},JNr=(e,t)=>{let n=e.split("net.")[1]?.split(/[ >]/)[0]??e;return`Net names cannot contain "+" or "-" (component "${t?.componentName??"Unknown component"}" received "${n}" via "${e}"). Try using underscores instead, e.g. VCC_P`},Jve=(e,t)=>{if(/net\.[^\s>]*\./.test(e))throw Error('Net names cannot contain a period, try using "sel.net..." to autocomplete with conventional net names, e.g. V3_3');if(/net\.[^\s>]*[+-]/.test(e))throw Error(JNr(e,t));if(/net\.[0-9]/.test(e)){let n=e.match(/net\.([^ >]+)/),o=n?n[1]:"";throw Error(`Net name "${o}" cannot start with a number, try using a prefix like "VBUS1"`)}return e.replace(/ pin(?=[\d.])/g," port").replace(/ subcircuit\./g," group[isSubcircuit=true]").replace(/([^ ])\>([^ ])/g,"$1 > $2").replace(/(^|[ >])(?!pin\.)(?!port\.)(?!net\.)([A-Z][A-Za-z0-9_-]*)\.([A-Za-z0-9_-]+)/g,(n,o,r,i)=>{let s=/^\d+$/.test(i)?`pin${i}`:i;return`${o}.${r} > .${s}`}).trim()},Att={adapter:qNr,cacheResults:!0},ZNr={componentName:"",zodProps:we({}).passthrough()},nr=class extends e5n{parent=null;_childrenVersion=0;children;childrenPendingRemoval;get config(){return ZNr}props;_parsedProps;get componentName(){return this.config.componentName}getInheritedProperty(e){let t=this;while(t){if(t._parsedProps&&e in t._parsedProps)return t._parsedProps[e];t=t.parent}if(this.root?.platform&&e in this.root.platform)return this.root.platform[e];return}getInheritedMergedProperty(e){let t=this.parent?.getInheritedMergedProperty?.(e),n=this._parsedProps?.[e];return{...t,...n}}getResolvedPcbSx(){return $Nr({parentResolvedPcbSx:this.parent?.getResolvedPcbSx?.(),pcbStyle:this._parsedProps?.pcbStyle,ownPcbSx:this._parsedProps?.pcbSx})}getSchematicSectionName(){return this._parsedProps?.schSectionName??null}get lowercaseComponentName(){return this.componentName.toLowerCase()}externallyAddedAliases;get isSubcircuit(){return Boolean(this.props.subcircuit)||this.lowercaseComponentName==="group"&&this?.parent?.isRootCircuit}get isGroup(){return this.lowercaseComponentName==="group"}get isRoutingDirective(){return!1}get name(){return this._parsedProps.name??this.fallbackUnassignedName}isPrimitiveContainer=!1;canHaveTextChildren=!1;source_group_id=null;source_component_id=null;schematic_component_id=null;schematic_sheet_id=null;pcb_component_id=null;cad_component_id=null;_reportedInvalidPcbCalcWarnings=new Set;_reportInvalidComponentPropertyError(e,t){if(!this.root||this._reportedInvalidPcbCalcWarnings.has(e))return;this.root.db.source_invalid_component_property_error.insert({source_component_id:this.source_component_id||"",property_name:e,message:t,error_type:"source_invalid_component_property_error"}),this._reportedInvalidPcbCalcWarnings.add(e)}fallbackUnassignedName;constructor(e){super(e);this.children=[],this.childrenPendingRemoval=[],this.props=e??{},this.externallyAddedAliases=[];let n=FNr(this.config.zodProps).safeParse(e??{});if(n.success)this._parsedProps=n.data;else throw new t5n(this.lowercaseComponentName,this.props,n.error.format())}setProps(e){let t=this.config.zodProps.parse({...this.props,...e}),n=this.props;this.props=t,this._parsedProps=this.config.zodProps.parse(e),this.onPropsChange({oldProps:n,newProps:t,changedProps:Object.keys(e)}),this.parent?.onChildChanged?.(this)}_getPcbRotationBeforeLayout(){let{pcbRotation:e}=this.props;if(typeof e==="string")return parseFloat(e);return e??null}getResolvedPcbPositionProp(){return{pcbX:this._resolvePcbCoordinate(this._parsedProps.pcbX,"pcbX"),pcbY:this._resolvePcbCoordinate(this._parsedProps.pcbY,"pcbY")}}doInitialValidatePcbCoordinates(){if(this.root?.pcbDisabled)return;let e=this.props,{pcbX:t,pcbY:n}=e;this._validatePcbCoordinateReferences({rawValue:t,axis:"pcbX",propertyName:"pcbX"}),this._validatePcbCoordinateReferences({rawValue:n,axis:"pcbY",propertyName:"pcbY"})}_validatePcbCoordinateReferences(e){let{rawValue:t,axis:n,propertyName:o=n}=e;if(typeof t!=="string")return;let i=this._isNormalComponent!==!0&&!this._isInsideFootprint(),s=[];try{s=oot(t)}catch{this._reportInvalidComponentPropertyError(o,`Invalid ${o} value for ${this.componentName}: Invalid calc() expression. expression="${t}"`);return}if(s.some((c)=>!c.startsWith("board."))&&!i)this._reportInvalidComponentPropertyError(o,`Invalid ${o} value for ${this.componentName}: component-relative calc references are not supported for footprint elements (${this.componentName}); ${o} will be ignored. expression="${t}"`)}_resolvePcbCoordinate(e,t,n={}){if(e==null)return 0;let o=n.propertyName??t;if(typeof e==="number"){if(Number.isFinite(e))return e;return 0}if(typeof e!=="string")throw Error(`Invalid ${t} value for ${this.componentName}: ${String(e)}`);let r=n.allowBoardVariables??this._shouldAllowBoardVariablesByDefault(),i=this._isNormalComponent===!0,s=n.allowComponentVariables??(!i&&!this._isInsideFootprint()),a=e.includes("board."),c={};if(r){let l=this._getBoard(),h=l?._getBoardCalcVariables()??{};if(a&&!l)return this._reportInvalidComponentPropertyError(o,`Invalid ${o} value for ${this.componentName}: no board found for board.* variables. expression="${e}"`),0;if(a&&l&&Object.keys(h).length===0)return this._reportInvalidComponentPropertyError(o,`Invalid ${o} value for ${this.componentName}: Cannot do calculations based on board size when the board is auto-sized. expression="${e}"`),0;Object.assign(c,h)}if(s){let l=this.root?.db;if(l)Object.assign(c,WNr(l));Object.assign(c,n.componentVariables??{})}try{if(oot(e).some((d)=>!d.startsWith("board."))&&!s){if(this._isInsideFootprint()&&this.root&&!this._reportedInvalidPcbCalcWarnings.has(t))this.root.db.source_invalid_component_property_error.insert({source_component_id:this.source_component_id||"",property_name:t,message:`component-relative calc references are not supported for footprint elements (${this.componentName}); ${t} will be ignored. expression="${e}"`,error_type:"source_invalid_component_property_error"}),this._reportedInvalidPcbCalcWarnings.add(t);return 0}return GNr(e,{knownVariables:c})}catch(l){let h=l instanceof Error?l.message:String(l);return this._reportInvalidComponentPropertyError(o,`Invalid ${o} value for ${this.componentName}: ${h}. expression="${e}"`),0}}_shouldAllowBoardVariablesByDefault(){if(this._isNormalComponent===!0)return!0;return!this._isInsideFootprint()&&!this._isInsideNonBoardSubcircuit()}_isInsideFootprint(){let e=this.parent;while(e){if(e.componentName==="Footprint")return!0;e=e.parent}return!1}_isInsideNonBoardSubcircuit(){let e=this.parent;while(e){let t=e.componentName;if(t==="Board"||t==="MountedBoard")return!1;if(e.isSubcircuit)return!0;e=e.parent}return!1}_hasUserDefinedPcbPosition(){let e=this._parsedProps;return e.pcbX!==void 0||e.pcbY!==void 0||e.pcbLeftEdgeX!==void 0||e.pcbRightEdgeX!==void 0||e.pcbTopEdgeY!==void 0||e.pcbBottomEdgeY!==void 0}resolvePcbCoordinate(e){let{rawValue:t,axis:n,allowBoardVariables:o,allowComponentVariables:r,componentVariables:i,propertyName:s}=e;return this._resolvePcbCoordinate(t,n,{allowBoardVariables:o,allowComponentVariables:r,componentVariables:i,propertyName:s})}computePcbPropsTransform(){let e=this._getPcbRotationBeforeLayout()??0,{pcbX:t,pcbY:n}=this.getResolvedPcbPositionProp();return xh.compose(xh.translate(t,n),xh.rotate(e*Math.PI/180))}_computePcbGlobalTransformBeforeLayout(){let e=this.getSubcircuit()._getPcbManualPlacementForComponent(this);if(e&&this.props.pcbX===void 0&&this.props.pcbY===void 0){let t=this._getPcbRotationBeforeLayout()??0;return xh.compose(this.parent?._computePcbGlobalTransformBeforeLayout()??xh.identity(),xh.compose(xh.translate(e.x,e.y),xh.rotate(t*Math.PI/180)))}if(this.isPcbPrimitive){let{isFlipped:t}=this._getPcbPrimitiveFlippedHelpers();if(t)return xh.compose(this.parent?._computePcbGlobalTransformBeforeLayout()??xh.identity(),xh.flipY(),this.computePcbPropsTransform())}return xh.compose(this.parent?._computePcbGlobalTransformBeforeLayout()??xh.identity(),this.computePcbPropsTransform())}_getEnclosingFootprint(){let e=this.parent;while(e){if(e.componentName==="Footprint")return e;e=e.parent}return null}getPrimitiveContainer(){if(this.isPrimitiveContainer)return this;return this.parent?.getPrimitiveContainer?.()??null}_getIsSmt(){let e=this.getPrimitiveContainer();return e&&e!==this?e._getIsSmt():!0}_getSymbolAncestor(){let e=this.getPrimitiveContainer();if(e?.componentName==="Symbol")return e;return null}getParentNormalComponent(){let e=this.parent;while(e){if(e.isPrimitiveContainer&&e.doInitialPcbComponentRender)return e;e=e.parent}return null}getCollapsedSchematicBoxAncestor(){let e=this.parent;while(e){if(e.componentName==="Group"&&e._parsedProps?.showAsSchematicBox)return e;e=e.parent}return null}_resolveText(){let e=this._parsedProps.text;if(!e)return"";if(!e.includes("{NAME}")&&!e.includes("{REF}")&&!e.includes("{REFERENCE}"))return e;let n=this.getParentNormalComponent()?.name;if(!n)return e;return e.replace(/\{NAME\}/g,n).replace(/\{REF\}/g,n).replace(/\{REFERENCE\}/g,n)}emitSolderMaskMarginWarning(e,t){if(e&&t!==void 0){let n=this.getParentNormalComponent();if(n?.source_component_id)this.root.db.source_property_ignored_warning.insert({source_component_id:n.source_component_id,property_name:"solderMaskMargin",message:"solderMaskMargin is set but coveredWithSolderMask is true. When a component is fully covered with solder mask, a margin doesn't apply.",error_type:"source_property_ignored_warning"})}}_getPcbCircuitJsonBounds(){return{center:{x:0,y:0},bounds:{left:0,top:0,right:0,bottom:0},width:0,height:0}}_getPcbLocalBoundsBeforeLayout(){let{width:e,height:t}=this.getPcbSize();return{left:-e/2,right:e/2,top:t/2,bottom:-t/2}}_getPcbBoundsBeforeLayout(){let e=this._getGlobalPcbPositionBeforeLayout(),{width:t,height:n}=this.getPcbSize();return{left:e.x-t/2,right:e.x+t/2,top:e.y+n/2,bottom:e.y-n/2}}_getPcbComponentLayer(){return this._parsedProps.layer}_getPcbPrimitiveFlippedHelpers(){let e=this.getPrimitiveContainer(),t=this.componentName==="Footprint"?this:this._getEnclosingFootprint(),n=e?._getPcbComponentLayer(),o=!e?!1:hde({componentLayer:n,originalLayer:t?._parsedProps.originalLayer});return{isFlipped:o,maybeFlipLayer:(i)=>{if(o)return i==="top"?"bottom":"top";return i}}}_setPositionFromLayout(e){throw Error(`_setPositionFromLayout not implemented for ${this.componentName}`)}computeSchematicPropsTransform(){let{_parsedProps:e}=this;return xh.compose(xh.translate(e.schX??0,e.schY??0))}computeSchematicGlobalTransform(){let e=this._getSchematicGlobalManualPlacementTransform(this);if(e)return e;return xh.compose(this.parent?.computeSchematicGlobalTransform?.()??xh.identity(),this.computeSchematicPropsTransform())}_getSchematicSymbolName(){let{_parsedProps:e}=this,t=this.config.schematicSymbolName,n={horizontal:0,pos_left:0,neg_right:0,pos_right:180,neg_left:180,pos_top:270,neg_bottom:90,vertical:270,pos_bottom:90,neg_top:90},o=e.schOrientation!==void 0?n[e.schOrientation]:e.schRotation;if(o===void 0)o=0;if(o=o%360,o<0)o+=360;if(e.schRotation!==void 0&&o%90!==0)throw Error(`Schematic rotation ${e.schRotation} is not supported for ${this.componentName}`);if(/_(horz|vert|up|down|left|right)$/.test(t)&&t in Es){let d=yit(t,o);if(d&&d in Es)return d;return t}let i=`${t}_horz`,s=`${t}_vert`,a=`${t}_up`,c=`${t}_down`,l=`${t}_left`,h=`${t}_right`;if(h in Es&&o===0)return h;if(a in Es&&o===90)return a;if(l in Es&&o===180)return l;if(c in Es&&o===270)return c;if(i in Es){if(o===0)return i;if(o===180)return i}if(s in Es){if(o===90)return s;if(o===270)return s}if(t in Es)return t;return}_getSchematicSymbolNameOrThrow(){let e=this._getSchematicSymbolName();if(!e)throw Error(`No schematic symbol found (given: "${this.config.schematicSymbolName}")`);return e}getSchematicSymbol(){let e=this._getSchematicSymbolName();if(!e)return null;return Es[e]??null}_getPcbManualPlacementForComponent(e){if(!this.isSubcircuit)return null;let t=this.props.manualEdits;if(!t)return null;let n=t?.pcb_placements;if(!n)return null;for(let o of n)if(gtt(e,o.selector)||e.props.name===o.selector)return xh.applyToPoint(this._computePcbGlobalTransformBeforeLayout(),o.center);return null}_getSchematicManualPlacementForComponent(e){if(!this.isSubcircuit)return null;let t=this.props.manualEdits;if(!t)return null;let n=t.schematic_placements;if(!n)return null;for(let o of n)if(gtt(e,o.selector)||e.props.name===o.selector)return xh.applyToPoint(this.computeSchematicGlobalTransform(),o.center);return null}_getSchematicGlobalManualPlacementTransform(e){let t=this.getSubcircuit()?._parsedProps.manualEdits;if(!t)return null;for(let n of t.schematic_placements??[])if(gtt(e,n.selector)||e.props.name===n.selector){if(n.relative_to==="group_center")return xh.compose(this.parent?._computePcbGlobalTransformBeforeLayout()??xh.identity(),xh.translate(n.center.x,n.center.y))}return null}_getGlobalPcbPositionBeforeLayout(){return xh.applyToPoint(this._computePcbGlobalTransformBeforeLayout(),{x:0,y:0})}_getGlobalSchematicPositionBeforeLayout(){return xh.applyToPoint(this.computeSchematicGlobalTransform(),{x:0,y:0})}_getBoard(){let e=this;while(e){let t=e,n=t.componentName;if(n==="Board"||n==="MountedBoard")return t;e=e.parent??null}return this.root?._getBoard()}get root(){return this.parent?.root??null}onAddToParent(e){this.parent=e}onPropsChange(e){}onChildChanged(e){this.parent?.onChildChanged?.(e)}add(e){let t=e.__text;if(typeof t==="string"){if(this.canHaveTextChildren||t.trim()==="")return;let n=this._parsedProps?.name,o=n?`<${this.componentName} name="${n}">`:`<${this.componentName}>`,i=/^NaN/.test(t.trim())?` This looks like a numeric expression that evaluated to NaN (e.g. \`\${value}${t.trim().replace(/^NaN/,"")}\` where \`value\` is NaN) — check the computation that produces this value.`:"";throw Error(`Invalid JSX Element: ${o} received stray text "${t}" as a child, but it cannot hold text children. Remove the text or wrap it in an appropriate component.${i}`)}if(Object.keys(e).length===0)return;if(e.lowercaseComponentName==="panel")throw Error("<panel> must be a root-level element");if(!e.onAddToParent)throw Error(`Invalid JSX Element: Expected a React component but received "${JSON.stringify(e)}"`);e.onAddToParent(this),e.parent=this,this.children.push(e),this._childrenVersion++,this._clearSelectorCachesUpTree()}addAll(e){for(let t of e)this.add(t)}remove(e){this.children=this.children.filter((t)=>t!==e),this._childrenVersion++,this.childrenPendingRemoval.push(e),e.shouldBeRemoved=!0,this._clearSelectorCachesUpTree()}_clearSelectorCachesUpTree(){let e=this;while(e)e._cachedSelectAllQueries?.clear(),e._cachedSelectOneQueries?.clear(),e=e.parent}getSubcircuitSelector(){let e=this.name,t=e?`${this.lowercaseComponentName}.${e}`:this.lowercaseComponentName;if(!this.parent)return t;if(this.parent.isSubcircuit)return t;return`${this.parent.getSubcircuitSelector()} > ${t}`}getFullPathSelector(){let e=this.name,t=e?`${this.lowercaseComponentName}.${e}`:this.lowercaseComponentName,n=this.parent?.getFullPathSelector?.();if(!n)return t;return`${n} > ${t}`}getNameAndAliases(){return[this.name,...this._parsedProps.portHints??[]].filter(Boolean)}isMatchingNameOrAlias(e){return this.getNameAndAliases().includes(e)}isMatchingAnyOf(e){return this.getNameAndAliases().some((t)=>e.map((n)=>n.toString()).includes(t))}getPcbSize(){throw Error(`getPcbSize not implemented for ${this.componentName}`)}doesSelectorMatch(e){let t=[this.componentName,this.lowercaseComponentName],n=[this.name].filter(Boolean),o=e.trim().split(/\> /)[0],r=o[0];if(o.length>1)return!1;if(e==="*")return!0;if(e[0]==="#"&&e.slice(1)===this.props.id)return!0;if(e[0]==="."&&n.includes(e.slice(1)))return!0;if(/^[a-zA-Z0-9_]/.test(r)&&t.includes(r))return!0;return!1}getSubcircuit(){if(this.isSubcircuit)return this;let e=this.parent?.getSubcircuit?.();if(!e)throw Error("Component is not inside an opaque group (no board?)");return e}getGroup(){if(this.isGroup)return this;return this.parent?.getGroup?.()??null}_resolveSchematicSheetId(){let e=this._parsedProps?.schSheetName??this.props.schSheetName;if(e){let t=this.root?.db.schematic_sheet.list().find((n)=>n.name===e);if(t)return t.schematic_sheet_id}if(this.schematic_sheet_id)return this.schematic_sheet_id;return this.parent?._resolveSchematicSheetId?.()}doInitialAssignNameToUnnamedComponents(){if(!this._parsedProps.name)this.fallbackUnassignedName=this.getSubcircuit().getNextAvailableName(this)}doInitialOptimizeSelectorCache(){if(!this.isSubcircuit)return;let e=this.selectAll("port"),t=(n)=>/^[A-Za-z_][A-Za-z0-9_-]*$/.test(n);for(let n of e){let r=(n.getParentNormalComponent?.()??n.parent)?.getNameAndAliases(),i=n.getNameAndAliases();if(!r)continue;for(let s of r)for(let a of i){let c=[`.${s} > .${a}`,`.${s} .${a}`];if(t(s)&&t(a))c.push(`${s}.${a}`);for(let l of c){let h=this._cachedSelectAllQueries.get(l);if(h)h.push(n);else this._cachedSelectAllQueries.set(l,[n])}}}for(let[n,o]of this._cachedSelectAllQueries.entries())if(o.length===1)this._cachedSelectOneQueries.set(n,o[0])}updateOptimizeSelectorCache(){this._cachedSelectAllQueries.clear(),this._cachedSelectOneQueries.clear(),this.doInitialOptimizeSelectorCache()}_cachedSelectAllQueries=new Map;selectAll(e){if(this._cachedSelectAllQueries.has(e))return this._cachedSelectAllQueries.get(e);let t=Jve(e,this),n=oO(t,this,Att);if(n.length>0)return this._cachedSelectAllQueries.set(e,n),n;let[o,...r]=t.split(" "),i=SK(o,this,{adapter:egn});if(!i)return this._cachedSelectAllQueries.set(e,n),n;let s=i.selectAll(r.join(" "));return this._cachedSelectAllQueries.set(e,s),s}_cachedSelectOneQueries=new Map;selectOne(e,t){if(/^net\.[A-Za-z_][A-Za-z0-9_]*$/.test(e)){if(t?.port||t?.type&&t.type!=="net")return null;return zNr(this.selectAll("net"),e)}if(this._cachedSelectOneQueries.has(e))return this._cachedSelectOneQueries.get(e);let n=Jve(e,this);if(t?.port)t.type="port";let o=null;if(t?.type){let c=oO(n,this,Att).filter((l)=>l.lowercaseComponentName===t.type);if(t.type==="port")not(c,e);o=c[0]??null}if(!t?.type)o??=SK(n,this,Att);if(o){if(!t?.type&&o.componentName==="Port")not(this.selectAll(e).filter((a)=>a.componentName==="Port"),e);return this._cachedSelectOneQueries.set(e,o),o}let[r,...i]=n.split(" "),s=SK(r,this,{adapter:egn});if(!s)return null;return o=s.selectOne(i.join(" "),t),this._cachedSelectOneQueries.set(e,o),o}getAvailablePcbLayers(){if(this.isPcbPrimitive){let{maybeFlipLayer:e}=this._getPcbPrimitiveFlippedHelpers();if("layer"in this._parsedProps||this.componentName==="SmtPad")return[e(this._parsedProps.layer??"top")];if("layers"in this._parsedProps)return this._parsedProps.layers;if(this.componentName==="PlatedHole")return[...this.root?._getBoard()?.allLayers??["top","bottom"]];return[]}return[]}getDescendants(){let e=[];for(let t of this.children)e.push(t),e.push(...t.getDescendants());return e}getSelectableDescendants(){let e=[];for(let t of this.children)if(t.isSubcircuit)e.push(t);else e.push(t),e.push(...t.getSelectableDescendants());return e}_getPrimaryPinCount(){return 0}_getSchematicBoxDimensions(){return null}_getSchematicBoxComponentDimensions(){if(this.getSchematicSymbol())return null;if(!this.config.shouldRenderAsSchematicBox)return null;let{_parsedProps:e}=this;return{schWidth:e.schWidth,schHeight:e.schHeight}}renderError(e){if(typeof e==="string")return super.renderError(e);switch(e.type){case"pcb_placement_error":this.root?.db.pcb_placement_error.insert(e);break;case"pcb_via_clearance_error":this.root?.db.pcb_via_clearance_error.insert(e);break;case"pcb_trace_error":this.root?.db.pcb_trace_error.insert(e);break;case"pcb_manual_edit_conflict_warning":this.root?.db.pcb_manual_edit_conflict_warning.insert(e);break;default:this.root?.db.pcb_placement_error.insert(e)}}getString(){let{lowercaseComponentName:e,_parsedProps:t,parent:n}=this;if(t?.pinNumber!==void 0&&n?.props?.name&&t?.name)return`<${e}#${this._renderId}(pin:${t.pinNumber} .${n?.props.name}>.${t.name}) />`;if(n?.props?.name&&t?.name)return`<${e}#${this._renderId}(.${n?.props.name}>.${t?.name}) />`;if(t?.from&&t?.to)return`<${e}#${this._renderId}(from:${t.from} to:${t?.to}) />`;if(t?.name)return`<${e}#${this._renderId} name=".${t?.name}" />`;if(t?.portHints)return`<${e}#${this._renderId}(${t.portHints.map((o)=>`.${o}`).join(", ")}) />`;return`<${e}#${this._renderId} />`}getDisplayName(){if(this.name)return`${this.lowercaseComponentName} "${this.name}"`;return`${this.lowercaseComponentName} (unnamed)`}get[Symbol.toStringTag](){return this.getString()}[Symbol.for("nodejs.util.inspect.custom")](){return this.getString()}};function a5n(e){let t=[];for(let n=0;n<e.length-1;n++)t.push([e[n],e[n+1]]);return t}var xue=/(?:^|_)(?:GND|AGND|DGND|PGND|VSS)/i,Cit=/(?:^|_)(?:V(?!SS)|\d+(?:[_.]\d+)?V)/i,dB=class extends nr{source_net_id;subcircuit_connectivity_map_key=null;get config(){return{componentName:"Net",zodProps:XTt}}getPortSelector(){return`net.${this.props.name}`}doInitialCreateTracesFromProps(){let{connectsTo:e}=this._parsedProps;if(!e)return;if(typeof e==="string")e=[e];for(let t of e)this.add(new d_({from:t,to:this.getPortSelector()}))}doInitialSourceRender(){let{db:e}=this.root,{_parsedProps:t}=this,n=t.isGroundNet??xue.test(t.name),o=t.isPowerNet??Cit.test(t.name),r=e.source_net.insert({name:t.name,member_source_group_ids:[],is_ground:n,is_power:o,trace_width:t.nominalTraceWidth,is_positive_voltage_source:o});this.source_net_id=r.source_net_id}doInitialSourceParentAttachment(){let e=this.getSubcircuit();if(!e)return;let{db:t}=this.root;t.source_net.update(this.source_net_id,{subcircuit_id:e.subcircuit_id})}getAllConnectedPorts(){let e=this.getSubcircuit().selectAll("port"),t=[];for(let n of e){let o=n._getDirectlyConnectedTraces();for(let r of o)if(r._isExplicitlyConnectedToNet(this)){t.push(n);break}}return t}_getAllDirectlyConnectedTraces(){let e=this.getSubcircuit().selectAll("trace"),t=[];for(let n of e)if(n._isExplicitlyConnectedToNet(this))t.push(n);return t}doInitialPcbRouteNetIslands(){if(this.root?.pcbDisabled)return;let e=this.getSubcircuit();if(this.root?.pcbRoutingDisabled||e.getInheritedProperty("routingDisabled"))return;if(e._isInflatedFromCircuitJson)return;if(e._getAutorouterConfig().groupMode!=="sequential-trace")return;let{db:t}=this.root,{_parsedProps:n}=this,o=this._getAllDirectlyConnectedTraces().filter((s)=>(s._portsRoutedOnPcb?.length??0)>0),r=[];for(let s of o){let a=s._portsRoutedOnPcb,c=r.find((l)=>a.some((h)=>l.ports.includes(h)));if(!c){r.push({ports:[...a],traces:[s]});continue}c.traces.push(s),c.ports.push(...a)}if(r.length===0)return;let i=a5n(r);for(let[s,a]of i){let c=s.ports.map((g)=>g._getGlobalPcbPositionBeforeLayout()),l=a.ports.map((g)=>g._getGlobalPcbPositionBeforeLayout()),h=1/0,d=[-1,-1];for(let g=0;g<c.length;g++){let f=c[g];for(let y=0;y<l.length;y++){let x=l[y],C=Math.sqrt((f.x-x.x)**2+(f.y-x.y)**2);if(C<h)h=C,d=[g,y]}}let u=s.ports[d[0]],_=a.ports[d[1]],p=t.toArray().filter((g)=>g.type==="pcb_smtpad"||g.type==="pcb_trace"||g.type==="pcb_plated_hole"||g.type==="pcb_hole"||g.type==="source_port"||g.type==="pcb_port"),{solution:m}=$Rt(p.concat([{type:"source_trace",source_trace_id:"__net_trace_tmp",connected_source_port_ids:[u.source_port_id,_.source_port_id]}])),A=m[0];if(!A){this.renderError({pcb_trace_error_id:"",pcb_trace_id:"__net_trace_tmp",pcb_component_ids:[u.pcb_component_id,_.pcb_component_id].filter(Boolean),pcb_port_ids:[u.pcb_port_id,_.pcb_port_id].filter(Boolean),type:"pcb_trace_error",error_type:"pcb_trace_error",message:`Failed to route net islands for "${this.getString()}"`,source_trace_id:"__net_trace_tmp"});return}t.pcb_trace.insert(A)}}renderError(e){if(typeof e==="string")return super.renderError(e);this.root?.db.pcb_trace_error.insert(e)}},Cue=(e,t)=>{for(let n of t)if(typeof n==="string"&&n.startsWith("net.")){if(/net\.[^\s>]*\./.test(n))throw Error('Net names cannot contain a period, try using "sel.net..." to autocomplete with conventional net names, e.g. V3_3');if(/net\.[^\s>]*[+-]/.test(n)){let r=n.split("net.")[1],i=`Net names cannot contain "+" or "-" (component "${e.componentName}" received "${r}" via "${n}"). Try using underscores instead, e.g. VCC_P`;throw Error(i)}if(/net\.[0-9]/.test(n)){let r=n.split("net.")[1];throw Error(`Net name "${r}" cannot start with a number, try using a prefix like "VBUS1"`)}let o=e.getSubcircuit();if(!o.selectOne(n)){let r=new dB({name:n.split("net.")[1]});o.add(r)}}},eRr=(e,t)=>{let n="_getGlobalPcbPositionBeforeLayout"in e?e._getGlobalPcbPositionBeforeLayout():e,o="_getGlobalPcbPositionBeforeLayout"in t?t._getGlobalPcbPositionBeforeLayout():t;return Math.sqrt((n.x-o.x)**2+(n.y-o.y)**2)};function tgn(e,t){if(t.length===0)throw Error("No candidates given to getClosest method");let n=t[0],o=1/0;for(let r of t){let i=eRr(e,r);if(i<o)n=r,o=i}return n}var tRr=(e)=>{if(e.outline&&e.outline.length>0)return new tl(e.outline.map((t)=>jm(t.x,t.y)));return new tl(new rA(e.center.x-e.width/2,e.center.y-e.height/2,e.center.x+e.width/2,e.center.y+e.height/2).toPoints())},nRr=({mergedRoute:e,db:t,pcbBoardId:n})=>{let o=t.pcb_board.get(n);if(!o)return!1;let r=tRr(o);return!e.flatMap(Jxn).every((i)=>r.contains(jm(i.x,i.y)))},WS=({fromLayer:e,toLayer:t,layerCount:n})=>{if(e===t)return[e];let o=["top"];for(let s=1;s<=n-2;s++)o.push(`inner${s}`);o.push("bottom");let r=o.indexOf(e),i=o.indexOf(t);if(r===-1||i===-1)return[e,t];return r<=i?o.slice(r,i+1):o.slice(i,r+1).reverse()},HY=(e)=>{if(e<=1)return["top"];return WS({fromLayer:"top",toLayer:"bottom",layerCount:e})},c5n=({fromLayer:e,toLayer:t,layerCount:n,allowBlindAndBuriedVias:o=!1,physicalLayers:r})=>{let i=HY(n);if(!o)return i;if(r?.length){let s=new Set(r),a=i.filter((d)=>s.has(d)),c=i.indexOf(a[0]),l=i.indexOf(a[a.length-1]),h=i.slice(c,l+1);if(s.has(e)&&s.has(t)&&s.size===h.length&&h.every((d)=>s.has(d)))return h}return WS({fromLayer:e,toLayer:t,layerCount:n})},bit=(e)=>{let t=HY(e);if(t.length<=1)return t;return[t[0],t[t.length-1],...t.slice(1,-1)]};function oRr(e,t={}){let{center:n,radius:o}=e,{rectHeight:r=0.1}=t,i=[],s=Math.ceil(o*2/r);for(let a=0;a<s;a++){let c=n.y-o+(a+0.5)*r,l=c-n.y,h=Math.sqrt(o*o-l*l);if(h>0)i.push({center:{x:n.x,y:c},width:h*2,height:r})}return i}function sot(e,t={}){if(e.length<3)return[];let{rectHeight:n=0.1}=t,o=[],r=e.map((a)=>a.y),i=Math.min(...r),s=Math.max(...r);for(let a=i;a<s;a+=n){let c=a+n/2,l=[];for(let h=0;h<e.length;h++){let d=e[h],u=e[(h+1)%e.length];if(d.y<=c&&u.y>c||u.y<=c&&d.y>c){let _=(c-d.y)*(u.x-d.x)/(u.y-d.y)+d.x;l.push(_)}}l.sort((h,d)=>h-d);for(let h=0;h<l.length;h+=2)if(h+1<l.length){let d=l[h],_=l[h+1]-d;if(_>0.000001)o.push({center:{x:d+_/2,y:c},width:_,height:n})}}return o}var rRr=0.001,iRr=(e)=>{let t=(c,l)=>Math.abs(c-l)<=rRr,n=e.filter((c,l)=>l===0||!t(c.x,e[l-1].x)||!t(c.y,e[l-1].y));if(n.length>1&&t(n[0].x,n.at(-1).x)&&t(n[0].y,n.at(-1).y))n.pop();if(n.length<4)return null;let o=Math.min(...n.map((c)=>c.x)),r=Math.max(...n.map((c)=>c.x)),i=Math.min(...n.map((c)=>c.y)),s=Math.max(...n.map((c)=>c.y)),a=[{x:o,y:i},{x:o,y:s},{x:r,y:i},{x:r,y:s}];if(!n.every((c)=>t(c.x,o)||t(c.x,r)||t(c.y,i)||t(c.y,s))||!a.every((c)=>n.some((l)=>t(l.x,c.x)&&t(l.y,c.y))))return null;return{center:{x:(o+r)/2,y:(i+s)/2},width:r-o,height:s-i}},sRr=12,aRr=0.99,cRr=0.001,lRr=(e)=>{let{outline:t,stroke_width:n}=e,o=t[0],r=t.at(-1);if(!o||!r)return null;if(o.x!==r.x||o.y!==r.y)return null;let i=t.slice(0,-1);if(i.length<sRr)return null;let s=Math.min(...i.map(({x:y})=>y)),a=Math.max(...i.map(({x:y})=>y)),c=Math.min(...i.map(({y})=>y)),l=Math.max(...i.map(({y})=>y)),h=a-s,d=l-c,u=Math.max(h,d);if(!Number.isFinite(u)||u<=0||Math.min(h,d)/u<aRr)return null;let _={x:(s+a)/2,y:(c+l)/2},p=i.map(({x:y,y:x})=>Math.hypot(y-_.x,x-_.y));if(Math.max(...p)-Math.min(...p)>u*cRr)return null;let m=i.map(({x:y,y:x})=>Math.atan2(x-_.y,y-_.x)),A=m.map((y,x)=>{let C=m[(x+1)%m.length];return Math.atan2(Math.sin(C-y),Math.cos(C-y))}),g=Math.sign(A[0]);if(g===0||A.some((y)=>Math.sign(y)!==g||Math.abs(y)>4*Math.PI/i.length))return null;let f=u+n;return{center:_,width:f,height:f}},hRr=(e,t)=>{let{outline:n,stroke_width:o}=e;if(!Number.isFinite(o)||o<=0)return[];let r=lRr(e);if(r)return[{obstacleId:e.pcb_keepout_id,componentId:t,type:"rect",layers:e.layers,...r,connectedTo:[]}];let i=[];for(let c=0;c<n.length-1;c++){let l=n[c],h=n[c+1],d=h.x-l.x,u=h.y-l.y,_=Math.hypot(d,u);if(!Number.isFinite(_)||_===0)continue;i.push({obstacleId:`${e.pcb_keepout_id}_segment_${c}`,componentId:t,type:"rect",layers:e.layers,center:{x:(l.x+h.x)/2,y:(l.y+h.y)/2},width:_,height:o,ccwRotationDegrees:Math.atan2(u,d)*180/Math.PI,connectedTo:[]})}let a=n.length>1&&n[0].x===n.at(-1)?.x&&n[0].y===n.at(-1)?.y?n.slice(0,-1):n;for(let[c,l]of a.entries())i.push({obstacleId:`${e.pcb_keepout_id}_join_${c}`,componentId:t,type:"rect",layers:e.layers,center:l,width:o,height:o,connectedTo:[]});return i},ngn=(e,t)=>Math.abs(e-t)<0.0001,dRr=(e,t,{viaDiameter:n=0.5}={})=>{let o=[];for(let r=0;r<e.length-1;r++){let[i,s]=[e[r],e[r+1]],a=r-1>=0?e[r-1]:null,c=ngn(i.y,s.y),l=ngn(i.x,s.x);if(!c&&!l)throw Error(`getObstaclesFromTrace currently only supports horizontal and vertical traces (not diagonals) Conflicting trace: ${t}, start: (${i.x}, ${i.y}), end: (${s.x}, ${s.y})`);let h={type:"rect",layers:[i.layer],center:{x:(i.x+s.x)/2,y:(i.y+s.y)/2},width:c?Math.abs(i.x-s.x):0.1,height:l?Math.abs(i.y-s.y):0.1,connectedTo:[t]};if(o.push(h),a&&a.layer===i.layer&&i.layer!==s.layer){let d={type:"rect",layers:[i.layer,s.layer],center:{x:i.x,y:i.y},connectedTo:[t],width:n,height:n};o.push(d)}}return o},uRr=0.01,ftt=(e)=>{let t=(e.rotation%360+360)%360,n=[0,90,180,270];for(let o of n){if(Math.min(Math.abs(t-o),360-Math.abs(t-o))>uRr)continue;let i=o===90||o===270;return{center:e.center,width:i?e.height:e.width,height:i?e.width:e.height}}return null},l5n=(e,t)=>{let n=e.find((d)=>d.type==="pcb_board"),o=HY(n?.num_layers??4),r=new Map(e.flatMap((d)=>d.type==="pcb_component"?[[d.pcb_component_id,d]]:[])),i=new Map(e.flatMap((d)=>d.type==="pcb_port"?[[d.pcb_port_id,d]]:[])),s=new Map(e.flatMap((d)=>d.type==="source_component"?[[d.source_component_id,d]]:[])),a=new Map(e.flatMap((d)=>d.type==="source_port"?[[d.source_port_id,d]]:[])),c=({pcbComponentId:d,pcbPortId:u})=>{let _=u?i.get(u):void 0,p=_?a.get(_.source_port_id):void 0,m=(d?r.get(d)?.source_component_id:void 0)??p?.source_component_id,A=m?s.get(m):void 0;return{...A?.name?{source_component_name:A.name}:{},...p?.name?{source_port_name:p.name}:{}}},l=(d)=>t?d.concat(d.map((u)=>t?.getNetConnectedToId(u)).filter(Boolean)):d,h=[];for(let d of e){let u=d.pcb_component_id??void 0;if(d.type==="pcb_smtpad"){let _={pcb_smtpad_id:d.pcb_smtpad_id,pcb_port_id:d.pcb_port_id,...c({pcbComponentId:u,pcbPortId:d.pcb_port_id})};if(d.shape==="circle")h.push({circuitJsonMetadata:_,componentId:u,type:"rect",shape:"circle",layers:[d.layer],center:{x:d.x,y:d.y},width:d.radius*2,height:d.radius*2,connectedTo:l([d.pcb_smtpad_id])});else if(d.shape==="rect")h.push({circuitJsonMetadata:_,componentId:u,type:"rect",layers:[d.layer],center:{x:d.x,y:d.y},width:d.width,height:d.height,connectedTo:l([d.pcb_smtpad_id])});else if(d.shape==="rotated_rect"){let p={center:{x:d.x,y:d.y},width:d.width,height:d.height,rotation:d.ccw_rotation},m=ftt(p),A=m??p;h.push({circuitJsonMetadata:_,componentId:u,type:"rect",layers:[d.layer],center:A.center,width:A.width,height:A.height,ccwRotationDegrees:m?void 0:d.ccw_rotation,connectedTo:l([d.pcb_smtpad_id])})}else if(d.shape==="pill"||d.shape==="rotated_pill")h.push({circuitJsonMetadata:_,componentId:u,type:"rect",layers:[d.layer],center:{x:d.x,y:d.y},width:d.width,height:d.height,...d.shape==="rotated_pill"?{ccwRotationDegrees:d.ccw_rotation}:{},connectedTo:l([d.pcb_smtpad_id])});else if(d.shape==="polygon"){let p=iRr(d.points);if(p){h.push({circuitJsonMetadata:_,componentId:u,type:"rect",layers:[d.layer],...p,connectedTo:l([d.pcb_smtpad_id])});continue}let m=sot(d.points,{rectHeight:0.1});for(let A of m)h.push({circuitJsonMetadata:_,componentId:u,type:"rect",layers:[d.layer],center:A.center,width:A.width,height:A.height,connectedTo:l([d.pcb_smtpad_id])})}}else if(d.type==="pcb_keepout"){if(d.warning_only||d.allow_traces)continue;if(d.shape==="circle")h.push({componentId:u,type:"rect",layers:d.layers,center:{x:d.center.x,y:d.center.y},width:d.radius*2,height:d.radius*2,connectedTo:[]});else if(d.shape==="rect")h.push({componentId:u,type:"rect",layers:d.layers,center:{x:d.center.x,y:d.center.y},width:d.width,height:d.height,connectedTo:[]});else if(d.shape==="outline")h.push(...hRr(d,u))}else if(d.type==="pcb_cutout"){if(d.shape==="rect")h.push({componentId:u,type:"rect",layers:o,center:{x:d.center.x,y:d.center.y},width:d.width,height:d.height,ccwRotationDegrees:d.rotation,connectedTo:[]});else if(d.shape==="circle"){let _=oRr({center:d.center,radius:d.radius},{rectHeight:0.6});for(let p of _)h.push({componentId:u,type:"rect",layers:o,center:p.center,width:p.width,height:p.height,connectedTo:[]})}else if(d.shape==="polygon"){let _=sot(d.points,{rectHeight:0.6});for(let p of _)h.push({componentId:u,type:"rect",layers:o,center:p.center,width:p.width,height:p.height,connectedTo:[]})}}else if(d.type==="pcb_hole"){if(d.hole_shape==="oval")h.push({componentId:u,obstacleId:d.pcb_hole_id,isNonPlatedHole:!0,type:"rect",layers:o,center:{x:d.x,y:d.y},width:d.hole_width,height:d.hole_height,connectedTo:[]});else if(d.hole_shape==="pill"||d.hole_shape==="rotated_pill")h.push({componentId:u,obstacleId:d.pcb_hole_id,isNonPlatedHole:!0,type:"rect",layers:o,center:{x:d.x,y:d.y},width:d.hole_width,height:d.hole_height,...d.hole_shape==="rotated_pill"?{ccwRotationDegrees:d.ccw_rotation}:{},connectedTo:[]});else if(d.hole_shape==="rect")h.push({componentId:u,obstacleId:d.pcb_hole_id,isNonPlatedHole:!0,type:"rect",layers:o,center:{x:d.x,y:d.y},width:d.hole_width,height:d.hole_height,connectedTo:[]});else if(d.hole_shape==="square")h.push({componentId:u,obstacleId:d.pcb_hole_id,isNonPlatedHole:!0,type:"rect",layers:o,center:{x:d.x,y:d.y},width:d.hole_diameter,height:d.hole_diameter,connectedTo:[]});else if(d.hole_shape==="round"||d.hole_shape==="circle")h.push({componentId:u,obstacleId:d.pcb_hole_id,isNonPlatedHole:!0,type:"rect",shape:"circle",layers:o,center:{x:d.x,y:d.y},width:d.hole_diameter,height:d.hole_diameter,connectedTo:[]})}else if(d.type==="pcb_plated_hole"){let _={pcb_plated_hole_id:d.pcb_plated_hole_id,pcb_port_id:d.pcb_port_id,...c({pcbComponentId:u,pcbPortId:d.pcb_port_id})};if(d.shape==="circle")h.push({circuitJsonMetadata:_,componentId:u,type:"oval",layers:o,center:{x:d.x,y:d.y},width:d.outer_diameter,height:d.outer_diameter,connectedTo:l([d.pcb_plated_hole_id])});else if(d.shape==="circular_hole_with_rect_pad"||d.shape==="pill_hole_with_rect_pad"||d.shape==="rotated_pill_hole_with_rect_pad"){let p=d.shape==="pill_hole_with_rect_pad"?0:d.rect_ccw_rotation??0,m={center:{x:d.x,y:d.y},width:d.rect_pad_width,height:d.rect_pad_height,rotation:p},A=ftt(m),g=A??m;h.push({circuitJsonMetadata:_,componentId:u,type:"rect",layers:o,center:g.center,width:g.width,height:g.height,ccwRotationDegrees:A?void 0:m.rotation,connectedTo:l([d.pcb_plated_hole_id])})}else if(d.shape==="oval"){let p={center:{x:d.x,y:d.y},width:d.outer_width,height:d.outer_height,rotation:d.ccw_rotation??0},m=ftt(p),A=m??p;h.push({circuitJsonMetadata:_,componentId:u,type:"oval",layers:o,center:A.center,width:A.width,height:A.height,ccwRotationDegrees:m?void 0:p.rotation,connectedTo:l([d.pcb_plated_hole_id])})}else if(d.shape==="pill")h.push({circuitJsonMetadata:_,componentId:u,type:"rect",layers:o,center:{x:d.x,y:d.y},width:d.outer_width,height:d.outer_height,ccwRotationDegrees:d.ccw_rotation,connectedTo:l([d.pcb_plated_hole_id])});else if(d.shape==="hole_with_polygon_pad"){if("pad_outline"in d&&d.pad_outline&&d.pad_outline.length>0){let p=d.pad_outline.map((b)=>d.x+b.x),m=d.pad_outline.map((b)=>d.y+b.y),A=Math.min(...p),g=Math.max(...p),f=Math.min(...m),y=Math.max(...m),x=(A+g)/2,C=(f+y)/2;h.push({circuitJsonMetadata:_,componentId:u,type:"rect",layers:o,center:{x,y:C},width:g-A,height:y-f,connectedTo:l([d.pcb_plated_hole_id])})}}}else if(d.type==="pcb_trace"){let _=dRr(d.route.flatMap((p)=>{if(p.route_type==="through_pad")return[{x:p.start.x,y:p.start.y,layer:p.start_layer},{x:p.end.x,y:p.end.y,layer:p.end_layer}];return[{x:p.x,y:p.y,layer:p.route_type==="wire"?p.layer:p.from_layer}]}),d.source_trace_id??d.pcb_trace_id);h.push(..._.map((p)=>({...p,componentId:u})))}else if(d.type==="pcb_via"){let _=Boolean(d.net_is_assignable??d.netIsAssignable);h.push({circuitJsonMetadata:{pcb_via_id:d.pcb_via_id,...c({pcbComponentId:u})},componentId:u,type:"rect",shape:"circle",layers:d.layers,center:{x:d.x,y:d.y},connectedTo:l([d.pcb_via_id]),width:d.outer_diameter,height:d.outer_diameter,netIsAssignable:_||void 0})}}return h},rB=({text:e,font_size:t=0.18})=>{let n=t/0.18,o=0.12*n,r=0.12*n;return e.length*o+r},FS=({anchor_position:e,anchor_side:t,text:n,font_size:o=0.18})=>{let r=rB({text:n,font_size:o}),i=o,s={...e};switch(t){case"right":s.x-=r/2;break;case"left":s.x+=r/2;break;case"top":s.y-=i/2;break;case"bottom":s.y+=i/2;break}return s},pRr=(e,t)=>{let n=0;n+=e.length??0,n+=t.filter((o)=>o.is_crossing).length;for(let o=1;o<t.length;o++){let r=t[o-1],i=t[o],s=Math.abs(r.from.x-r.to.x)<0.01,a=Math.abs(i.from.x-i.to.x)<0.01;if(s!==a)n++}return n},jJ=(e)=>({up:"bottom",down:"top",left:"right",right:"left"})[e]??null,aot=({firstEdge:e,firstEdgePort:t,firstDominantDirection:n,lastEdge:o,lastEdgePort:r,lastDominantDirection:i})=>{if(e&&t)return aot({lastEdge:{from:e.to,to:e.from},lastEdgePort:t,lastDominantDirection:n}).reverse().map((a)=>({from:a.to,to:a.from}));let s=[];if(o&&r){let a={x:o.to.x,y:o.to.y};if(i==="left"||i==="right")a.x=r.position.x,s.push({from:o.to,to:{...a}}),s.push({from:a,to:{...r.position}});else a.y=r.position.y,s.push({from:o.to,to:{...a}}),s.push({from:a,to:{...r.position}})}return s=s.filter((a)=>Tl(a.from,a.to)>0.01),s};function mRr(e){try{return[e(),null]}catch(t){return[null,t]}}var _Rr=VQt.version??"unknown",qhe=class extends Error{constructor(e){super(`${e} (capacity-autorouter@${_Rr})`);this.name="AutorouterError"}},vY=class extends Error{constructor(e){super(e.message);this.errorData=e,this.name="TraceConnectionError"}errorData},gRr=0.2,ARr=0.3,ogn=(e,t)=>{if(e===void 0)return t;if(typeof e==="number")return e;let n=parseFloat(e);return Number.isFinite(n)?n:t},gB=(e)=>({holeDiameter:ogn(e?.viaHoleDiameter,gRr),padDiameter:ogn(e?.viaPadDiameter,ARr)}),fRr=(e,t)=>{let n=gB(t);return{holeDiameter:e.holeDiameter??n.holeDiameter,padDiameter:e.padDiameter??n.padDiameter}},Iit=(e)=>{if(e===void 0)return{};return{tented_on_top:e==="top_tented"||e==="top_and_bottom_tented",tented_on_bottom:e==="bottom_tented"||e==="top_and_bottom_tented"}};function h5n(e,t){let n=t.x-e.x,o=t.y-e.y;if(Math.abs(n)>Math.abs(o))return n>=0?"right":"left";return o>=0?"up":"down"}var yRr=new Proxy({},{get:(e,t)=>t}),XS=yRr,iB="rgba(132, 0, 0)",Z8e=0.12,Zve=(e)=>{if(e.length<=1)return!0;let t=e.map((i)=>{let s=i._getPcbCircuitJsonBounds();return{left:s.bounds.left,right:s.bounds.right,top:s.bounds.top,bottom:s.bounds.bottom}}),n=Array(t.length).fill(!1).map(()=>Array(t.length).fill(!1));for(let i=0;i<t.length;i++)for(let s=i+1;s<t.length;s++){let a=t[i],c=t[s];n[i][s]=n[s][i]=!(a.right<c.left||a.left>c.right||a.bottom>c.top||a.top<c.bottom)}let o=new Set,r=(i)=>{o.add(i);for(let s=0;s<t.length;s++)if(n[i][s]&&!o.has(s))r(s)};return r(0),o.size===t.length},cot=(e)=>{if(e.length===0)throw Error("Cannot get center of empty PCB primitives array");let t=e.map((r)=>r._getPcbCircuitJsonBounds().center).filter(Boolean),n=t.reduce((r,i)=>r+i.x,0),o=t.reduce((r,i)=>r+i.y,0);return{x:n/t.length,y:o/t.length}},xRr=(e)=>{if(!e)return[];return typeof e==="string"?[e]:[...e]};function CRr(e){if(!e.isGroupPort())return;let t=e._parsedProps.connectsTo;if(!t)return;let n=e.parent;if(!n)return;let o=n._parsedProps?.connections;if(Object.keys(o??{}).some((c)=>e.isMatchingAnyOf([c])))return;let i=n.name,s=e.name;if(!i||!s)return;let a=`.${i} > .${s}`;for(let c of xRr(t)){if(n.children.some((h)=>{if(!(h instanceof d_))return!1;let d=h._parsedProps;if(!("from"in d)||!("to"in d))return!1;return d.from===a&&d.to===c||d.from===c&&d.to===a}))continue;n.add(new d_({from:a,to:c}))}}function bRr(e){let t=$ve(e);if(t.requires_ground===!0||t.provides_ground===!0)return!0;for(let n of e.getNameAndAliases())if(xue.test(n))return!0;return!1}function IRr(e){return e._parsedProps.isGroundNet??xue.test(e._parsedProps.name)}function vRr(e){let t=new Set([e,...e._getPortsInternallyConnectedToThisPort()]),n=new Set([...t].flatMap((o)=>o._getDirectlyConnectedTraces()));for(let o of n){let r=o._findConnectedPorts().ports??[],i=new Set(r.flatMap((s)=>[s,...s._getPortsInternallyConnectedToThisPort()]));for(let s of i){if(t.has(s))continue;if(bRr(s))return!0}for(let s of o._findConnectedNets().nets)if(s&&IRr(s))return!0}return!1}function SRr(e){if(e.getParentNormalComponent()?.config.componentName!=="Chip")return!1;let t=$ve(e);if(t.should_have_decoupling_capacitor!==void 0)return t.should_have_decoupling_capacitor;if(t.requires_power!==void 0)return t.requires_power;if(t.provides_power===!0)return!1;let n=e.getNameAndAliases();if(t.requires_ground===!0||t.provides_ground===!0||n.some((o)=>xue.test(o)))return!1;for(let o of n){if(o===e.physicalPinName)continue;if(Cit.test(o))return!0}return!1}function PRr(e){let t=new Set([e,...e._getPortsInternallyConnectedToThisPort()]),n=new Set([...t].flatMap((o)=>o._getDirectlyConnectedTraces()));for(let o of n){let r=o._findConnectedPorts().ports??[],i=new Set(r.flatMap((s)=>[s,...s._getPortsInternallyConnectedToThisPort()]));for(let s of i){if(t.has(s))continue;if(SRr(s))return!0}}return!1}function ytt(e){if(e.root?.pcbDisabled)return!1;if(e.pcb_port_id)return!0;let{db:t}=e.root,n=e.matchedComponents.filter((c)=>c.isPcbPrimitive),o=n.length===1?n[0]._getPcbCircuitJsonBounds().center:n.length>1&&Zve(n)?cot(n):null;if(o){let c=t.pcb_port.insert({pcb_component_id:void 0,layers:e.getAvailablePcbLayers(),subcircuit_id:e.getSubcircuit()?.subcircuit_id??void 0,pcb_group_id:e.getGroup()?.pcb_group_id??void 0,...o,source_port_id:e.source_port_id,is_board_pinout:e.parent?.componentName==="Board"});return e.pcb_port_id=c.pcb_port_id,!0}let r=e._getConnectedPortsFromConnectsTo()[0];if(!r?.pcb_port_id)return!1;let i=t.pcb_port.get(r.pcb_port_id);if(!i)return!1;let s=e.getSubcircuit(),a=t.pcb_port.insert({pcb_component_id:void 0,layers:r.getAvailablePcbLayers(),subcircuit_id:s?.subcircuit_id??void 0,pcb_group_id:e.getGroup()?.pcb_group_id??void 0,x:i.x,y:i.y,source_port_id:e.source_port_id,is_board_pinout:!1});return e.pcb_port_id=a.pcb_port_id,!0}var rgn=(e,t)=>e.localeCompare(t,void 0,{numeric:!0,sensitivity:"base"}),d5n=(e,t)=>{let n=t.source_component_id?e.source_component.get(t.source_component_id):void 0,o=!n?e.source_group.list().find((r)=>r.subcircuit_id===t.subcircuit_id):void 0;return n?.name??o?.name},u5n=(e,t)=>{let n=e.source_port.get(t);if(!n?.name)return;let o=d5n(e,n);if(!o)return;return`${o}_${n.name}`},vit=(e,t)=>{let n=t.map((i)=>e.source_port.get(i)).filter((i)=>Boolean(i));if(n.length===0)return;let o=new Map;for(let i of e.source_port.list()){if(!i.source_component_id)continue;o.set(i.source_component_id,(o.get(i.source_component_id)??0)+1)}let r=n.map((i)=>{let s=d5n(e,i);if(!s||!i.name)return null;return{sourcePort:i,ownerName:s,label:`${s}_${i.name}`,ownerPinCount:i.source_component_id?o.get(i.source_component_id)??0:0}}).filter((i)=>Boolean(i));return r.sort((i,s)=>{let a=s.ownerPinCount-i.ownerPinCount;if(a!==0)return a;let c=rgn(i.ownerName,s.ownerName);if(c!==0)return c;let l=i.sourcePort.pin_number??Number.POSITIVE_INFINITY,h=s.sourcePort.pin_number??Number.POSITIVE_INFINITY,d=l-h;if(d!==0)return d;return rgn(i.sourcePort.name,s.sourcePort.name)}),r[0]?.label},ERr=0.12,Lh=class extends nr{source_port_id=null;pcb_port_id=null;schematic_port_id=null;schematic_stem_line_id=null;shouldCreateSourcePort;schematicSymbolPortDef=null;matchedComponents;_isPrimaryPort=!0;_primaryPinNumber=null;facingDirection=null;originDescription=null;get config(){return{componentName:"Port",zodProps:vNt}}constructor(e,t={}){if(!e.name&&e.pinNumber!==void 0)e.name=`pin${e.pinNumber}`;if(!e.name)throw Error("Port must have a name or a pinNumber");super(e);if(t.originDescription)this.originDescription=t.originDescription;this.shouldCreateSourcePort=t.shouldCreateSourcePort??!0,this.matchedComponents=[]}isGroupPort(){return this.parent?.isGroup===!0}isComponentPort(){return!this.isGroupPort()}_getConnectedPortsFromConnectsTo(){let{_parsedProps:e}=this,t=e.connectsTo;if(!t)return[];let n=[],o=Array.isArray(t)?t:[t];for(let r of o){let i=this.getSubcircuit().selectOne(r,{type:"port"});if(i)n.push(i)}return n}_isBoardPinoutFromAttributes(){let e=this.parent;if(e?._parsedProps?.pinAttributes){let t=e._parsedProps.pinAttributes;for(let n of this.getNameAndAliases())if(t[n]?.includeInBoardPinout)return!0}}_getGlobalPcbPositionBeforeLayout(){if(this.pcb_port_id){let n=this.root?.db.pcb_port.get(this.pcb_port_id);if(n?.pcb_component_id)return{x:n.x,y:n.y}}let e=this.matchedComponents.find((n)=>n.isPcbPrimitive),t=this.parent;if(t&&!t.props.footprint)throw Error(`${t.componentName} "${t.props.name}" does not have a footprint. Add a footprint prop, e.g. <${t.componentName.toLowerCase()} footprint="..." />`);if(!e)throw Error(`Port ${this} has no matching PCB primitives. This often means the footprint's pads lack matching port hints.`);return e?._getGlobalPcbPositionBeforeLayout()??{x:0,y:0}}_getPcbCircuitJsonBounds(){if(!this.pcb_port_id)return super._getPcbCircuitJsonBounds();let{db:e}=this.root,t=e.pcb_port.get(this.pcb_port_id);return{center:{x:t.x,y:t.y},bounds:{left:0,top:0,right:0,bottom:0},width:0,height:0}}_getGlobalPcbPositionAfterLayout(){return this._getPcbCircuitJsonBounds().center}_getPortsInternallyConnectedToThisPort(){let e=this.parent;if(!e||!e._getInternallyConnectedPins)return[];let t=e._getInternallyConnectedPins(),n=new Set([this]),o=!0;while(o){o=!1;for(let r of t){if(!r.some((i)=>n.has(i)))continue;for(let i of r)if(!n.has(i))n.add(i),o=!0}}return n.size>1?[...n]:[]}_hasSchematicPort(){let e=this.getParentNormalComponent();if(e?._parsedProps?.noSchematicRepresentation===!0)return!1;let{schX:t,schY:n}=this._parsedProps;if(t!==void 0&&n!==void 0)return!0;if(e?.getSchematicSymbol()){if(this.schematicSymbolPortDef)return!0;if(this._getPortsInternallyConnectedToThisPort().some((s)=>s.schematicSymbolPortDef))return!0;return!1}let r=e?._getSchematicBoxDimensions();if(r&&this._parsedProps.pinNumber!==void 0){if(r.getPortPositionByPinNumber(this._parsedProps.pinNumber))return!0}return!1}_getGlobalSchematicPositionBeforeLayout(){let{schX:e,schY:t}=this._parsedProps;if(e!==void 0&&t!==void 0){if(this._getSymbolAncestor())return v9.applyToPoint(this.computeSchematicGlobalTransform(),{x:0,y:0});return{x:e,y:t}}let n=this.getParentNormalComponent(),o=n?.getSchematicSymbol();if(o){let i=this.schematicSymbolPortDef;if(!i){if(i=this._getPortsInternallyConnectedToThisPort().find((a)=>a.schematicSymbolPortDef)?.schematicSymbolPortDef??null,!i)throw Error(`Couldn't find schematicSymbolPortDef for port ${this.getString()}, searched internally connected ports and none had a schematicSymbolPortDef. Why are we trying to get the schematic position of this port?`)}let s=v9.compose(n.computeSchematicGlobalTransform(),v9.translate(-o.center.x,-o.center.y));return v9.applyToPoint(s,i)}let r=n?._getSchematicBoxDimensions();if(r&&this._parsedProps.pinNumber!==void 0){let i=r.getPortPositionByPinNumber(this._parsedProps.pinNumber);if(!i)throw Error(`Couldn't find position for schematic_port for port ${this.getString()} inside of the schematic box`);return v9.applyToPoint(n.computeSchematicGlobalTransform(),i)}throw Error(`Couldn't find position for schematic_port for port ${this.getString()}`)}_getGlobalSchematicPositionAfterLayout(){let{db:e}=this.root;if(!this.schematic_port_id)throw Error(`Can't get schematic port position after layout for "${this.getString()}", no schematic_port_id`);let t=e.schematic_port.get(this.schematic_port_id);if(!t)throw Error(`Schematic port not found when trying to get post-layout position: ${this.schematic_port_id}`);return t.center}registerMatch(e){this.matchedComponents.push(e)}physicalPinName;getNameAndAliases(){let{_parsedProps:e}=this;return Array.from(new Set([...this.physicalPinName?[this.physicalPinName]:[],...e.name?[e.name]:[],...e.aliases??[],...typeof e.pinNumber==="number"?[`pin${e.pinNumber}`,e.pinNumber.toString()]:[],...this.externallyAddedAliases??[]]))}_getMatchingPinAttributes(){let t=(this.getParentNormalComponent()??this.parent)?._parsedProps,n=t?.pinAttributes,o=t?.noConnect,r=[];for(let i of this.getNameAndAliases()){if(n){let s=n[i];if(s)r.push(s)}if(o?.includes(i))r.push({doNotConnect:!0})}if(r.length===0)return[];return r}_shouldIncludeInBoardPinout(){return this._getMatchingPinAttributes().some((e)=>e.includeInBoardPinout===!0)}isMatchingPort(e){return this.isMatchingAnyOf(e.getNameAndAliases())}getPortSelector(){return`.${(this.getParentNormalComponent()??this.parent)?.props.name} > port.${this.props.name}`}getAvailablePcbLayers(){let{layer:e,layers:t}=this._parsedProps;if(t)return t;if(e)return[e];if(this.pcb_port_id){let n=this.root?.db.pcb_port.get(this.pcb_port_id);if(n?.pcb_component_id)return n.layers}return Array.from(new Set(this.matchedComponents.flatMap((n)=>n.getAvailablePcbLayers())))}_getDirectlyConnectedTraces(){let e=this.getSubcircuit().selectAll("trace"),t=[];for(let n of e){if(n._couldNotFindPort)continue;try{if(n._isExplicitlyConnectedToPort(this))t.push(n)}catch(o){if(o instanceof vY)continue;throw o}}return t}isConnectedToPower(){return PRr(this)}isConnectedToGround(){return vRr(this)}doInitialCreateTracesFromProps(){CRr(this)}doInitialSourceRender(){if(!this.shouldCreateSourcePort)return;let{db:e}=this.root,{_parsedProps:t}=this,n=this.getNameAndAliases(),o=this.getParentNormalComponent(),i=(this.parent?.source_component_id?this.parent:o)?.source_component_id??null,s=$ve(this),a=e.source_port.insert({name:this.physicalPinName??t.name,pin_number:this.physicalPinName?void 0:t.pinNumber,port_hints:n,source_component_id:i,subcircuit_id:this.getSubcircuit()?.subcircuit_id,...s});this.source_port_id=a.source_port_id}updateSourceRender(){if(!this.source_port_id||!this.shouldCreateSourcePort)return;this.root.db.source_port.update(this.source_port_id,$ve(this))}doInitialSourceParentAttachment(){if(!this.shouldCreateSourcePort)return;let{db:e}=this.root,t=this.getParentNormalComponent(),n=this.parent?.source_component_id?this.parent:t;if(this.isGroupPort()){e.source_port.update(this.source_port_id,{source_component_id:null,subcircuit_id:this.getSubcircuit()?.subcircuit_id});return}if(!n?.source_component_id)throw Error(`${this.getString()} has no parent source component (parent: ${this.parent?.getString()})`);e.source_port.update(this.source_port_id,{source_component_id:n.source_component_id,subcircuit_id:this.getSubcircuit()?.subcircuit_id}),this.source_component_id=n.source_component_id}doInitialPcbPortRender(){if(this.root?.pcbDisabled)return;if(this.getPrimitiveContainer()?.isSchematicPrimitive)return;let{db:e}=this.root,{matchedComponents:t}=this;if(this.isGroupPort()){ytt(this);return}let n=this.getParentNormalComponent(),o=this.parent?.pcb_component_id?this.parent:n;if(!o?.pcb_component_id)throw Error(`${this.getString()} has no parent pcb component, cannot render pcb_port (parent: ${this.parent?.getString()}, parentNormalComponent: ${n?.getString()})`);let r=t.filter((s)=>s.isPcbPrimitive);if(r.length===0)return;let i=null;if(r.length===1)i=r[0]._getPcbCircuitJsonBounds().center;if(r.length>1){if(!Zve(r)){let s=this.props.name,a=this.getParentNormalComponent()?.props.name??"unknown",c=this.getNameAndAliases().filter((h)=>h!==s),l=c.length>0?` (consider using alternate aliases: ${c.join(", ")})`:"";e.source_ambiguous_port_reference.insert({error_type:"source_ambiguous_port_reference",message:`${a}.${s} is ambiguous: ${a}.${s} references multiple non-overlapping pads: ${r.map((h)=>h.getString()).join(", ")}${l}`,source_port_id:this.source_port_id??void 0,source_component_id:this.getParentNormalComponent()?.source_component_id??void 0});return}i=cot(r)}if(i){let s=this.getSubcircuit(),a=this._shouldIncludeInBoardPinout(),c=e.pcb_port.insert({pcb_component_id:o.pcb_component_id,layers:this.getAvailablePcbLayers(),subcircuit_id:s?.subcircuit_id??void 0,pcb_group_id:this.getGroup()?.pcb_group_id??void 0,...a?{is_board_pinout:!0}:{},...i,source_port_id:this.source_port_id,is_board_pinout:this._isBoardPinoutFromAttributes()});this.pcb_port_id=c.pcb_port_id}else{let s=r[0];throw Error(`${s.getString()} does not have a center or _getGlobalPcbPositionBeforeLayout method (needed for pcb_port placement)`)}}updatePcbPortRender(){if(this.root?.pcbDisabled)return;if(this.getPrimitiveContainer()?.isSchematicPrimitive)return;let{db:e}=this.root;if(this.pcb_port_id)return;if(this.isGroupPort()){ytt(this);return}let t=this.matchedComponents.filter((c)=>c.isPcbPrimitive);if(t.length===0)return;let n=null;if(t.length===1)n=t[0]._getPcbCircuitJsonBounds().center;if(t.length>1)try{if(Zve(t))n=cot(t)}catch{}if(!n)return;let o=this.getParentNormalComponent(),r=this.parent?.pcb_component_id?this.parent:o,i=this.getSubcircuit(),s=this._shouldIncludeInBoardPinout(),a=e.pcb_port.insert({pcb_component_id:r?.pcb_component_id,layers:this.getAvailablePcbLayers(),subcircuit_id:i?.subcircuit_id??void 0,pcb_group_id:this.getGroup()?.pcb_group_id??void 0,...s?{is_board_pinout:!0}:{},...n,source_port_id:this.source_port_id,is_board_pinout:this._isBoardPinoutFromAttributes()});this.pcb_port_id=a.pcb_port_id}doInitialPcbPortAttachment(){if(!this.pcb_port_id&&this.source_port_id){let e=this.root?.db.pcb_port.list({source_port_id:this.source_port_id}).find((t)=>Boolean(t.pcb_component_id));if(e){this.pcb_port_id=e.pcb_port_id;return}}if(!this.isGroupPort()||this.pcb_port_id)return;ytt(this)}_getBestDisplayPinLabel(){let{db:e}=this.root,t=e.source_port.get(this.source_port_id),n=[];for(let i of t?.port_hints??[]){if(i.match(/^(pin)?\d+$/))continue;if(i.match(/^(left|right)/)&&!t?.name.match(/^(left|right)/))continue;n.push(i)}if(this.getParentNormalComponent()?.props?.showPinAliases&&n.length>0)return n.join("/");else if(n.length>0)return n[0];return}doInitialSchematicPortRender(){if(this.root?.schematicDisabled)return;let e=this.getCollapsedSchematicBoxAncestor();if(e&&this.parent!==e)return;let{db:t}=this.root,{_parsedProps:n}=this,{schX:o,schY:r}=n,i=o!==void 0&&r!==void 0?this.getParentNormalComponent():this.getPrimitiveContainer();if(!i)return;if(!this._hasSchematicPort())return;let s=i._getGlobalSchematicPositionBeforeLayout(),a=this._getGlobalSchematicPositionBeforeLayout(),c=null,l=i._getSchematicBoxDimensions();if(l&&n.pinNumber!==void 0)c=l.getPortPositionByPinNumber(n.pinNumber);if(this.getSubcircuit().props._schDebugObjectsEnabled)t.schematic_debug_object.insert({shape:"rect",center:a,size:{width:0.1,height:0.1},label:"obstacle"});let h=o!==void 0&&r!==void 0&&!!this._getSymbolAncestor();if(h&&n.direction)this.facingDirection=n.direction;else if(!c?.side)this.facingDirection=h5n(s,a);else this.facingDirection={left:"left",right:"right",top:"up",bottom:"down"}[c.side];let d=this._getBestDisplayPinLabel(),u=this.getParentNormalComponent(),_=n.direction==="up"?"top":n.direction==="down"?"bottom":n.direction,m=(h&&n.direction?_:void 0)??c?.side??_,A=n.schPinLabelFontSize==="sm"?ERr:n.schPinLabelFontSize==="default"?void 0:n.schPinLabelFontSize,g={type:"schematic_port",schematic_component_id:u?.schematic_component_id,center:a,source_port_id:this.source_port_id,facing_direction:this.facingDirection,distance_from_component_edge:n.schStemLength??0.4,side_of_component:m,pin_number:n.pinNumber,true_ccw_index:c?.trueIndex,display_pin_label:d,display_pin_label_font_size:A,is_connected:!1,schematic_sheet_id:this._resolveSchematicSheetId()};for(let y of this._getMatchingPinAttributes()){if(y.requiresPower)g.has_input_arrow=!0;if(y.providesPower)g.has_output_arrow=!0}let f=t.schematic_port.insert(g);if(this.schematic_port_id=f.schematic_port_id,n.schStemLength!==void 0&&n.schStemLength!==0){let{schStemLength:y,direction:x}=n,{x:C,y:b}=a;if(x==="right")C-=y;else if(x==="left")C+=y;else if(x==="up")b-=y;else if(x==="down")b+=y;let I=t.schematic_line.insert({schematic_component_id:u?.schematic_component_id,x1:a.x,y1:a.y,x2:C,y2:b,stroke_width:0.02,color:iB,is_dashed:!1,schematic_sheet_id:this._resolveSchematicSheetId()});this.schematic_stem_line_id=I.schematic_line_id}}doInitialSchematicSymbolResize(){if(this.root?.schematicDisabled)return;if(!this.schematic_port_id)return;let t=this._getSymbolAncestor()?.getUserCoordinateToResizedSymbolTransform();if(!t)return;let{db:n}=this.root,o=n.schematic_port.get(this.schematic_port_id);if(o){let r=v9.applyToPoint(t,o.center),i=Math.atan2(t.b,t.a)*180/Math.PI;if(o.facing_direction&&i!==0)this.facingDirection=fit(o.facing_direction,i),n.schematic_port.update(this.schematic_port_id,{facing_direction:this.facingDirection,side_of_component:this.facingDirection==="up"?"top":this.facingDirection==="down"?"bottom":this.facingDirection});if(n.schematic_port.update(this.schematic_port_id,{center:r}),this.schematic_stem_line_id){let s=n.schematic_line.get(this.schematic_stem_line_id);if(s){let a=v9.applyToPoint(t,{x:s.x1,y:s.y1}),c=v9.applyToPoint(t,{x:s.x2,y:s.y2});n.schematic_line.update(this.schematic_stem_line_id,{x1:a.x,y1:a.y,x2:c.x,y2:c.y});let l=Math.sqrt((a.x-c.x)**2+(a.y-c.y)**2);n.schematic_port.update(this.schematic_port_id,{distance_from_component_edge:l})}}}}_getSubcircuitConnectivityKey(){return this.root?.db.source_port.get(this.source_port_id)?.subcircuit_connectivity_map_key}_setPositionFromLayout(e){let{db:t}=this.root;if(!this.pcb_port_id)return;t.pcb_port.update(this.pcb_port_id,{x:e.x,y:e.y})}_hasMatchedPcbPrimitive(){let e=this.pcb_port_id?this.root?.db.pcb_port.get(this.pcb_port_id):null;return Boolean(e?.pcb_component_id)||this.matchedComponents.some((t)=>t.isPcbPrimitive)}_getNetLabelText(){if(!this.root||!this.source_port_id)return;return u5n(this.root.db,this.source_port_id)}};function e8e(e){try{return e._getPcbBoundsBeforeLayout()}catch{return null}}function p5n(e,t){let n=e8e(e),o=e8e(t);if(!n||!o)return!1;return!(n.right<o.left||n.left>o.right||n.bottom>o.top||n.top<o.bottom)}function MRr(e,t){let n=e8e(e),o=e8e(t);if(!n||!o)return!1;return n.left>=o.left&&n.right<=o.right&&n.bottom>=o.bottom&&n.top<=o.top}function wRr(e){let t=[],n=new Set;for(let o of e){if(n.has(o))continue;let r=[],i=[o];n.add(o);while(i.length>0){let s=i.pop();r.push(s);for(let a of e){if(n.has(a))continue;if(!p5n(s,a))continue;n.add(a),i.push(a)}}t.push(r)}return t}var m5n=class extends nr{pcb_via_id=null;matchedPort=null;isPcbPrimitive=!0;source_manually_placed_via_id=null;source_trace_id=null;subcircuit_connectivity_map_key=null;constructor(e){super(e);let t=this._getLayers();this._parsedProps.layers=t,this.initPorts()}get config(){return{componentName:"Via",zodProps:g5e}}getAvailablePcbLayers(){return this._getLayers()}_getResolvedViaDiameters(e){return fRr({holeDiameter:this._parsedProps.holeDiameter,padDiameter:this._parsedProps.outerDiameter},e)}getPcbSize(){let e=this.getInheritedMergedProperty("pcbStyle"),{padDiameter:t}=this._getResolvedViaDiameters(e);return{width:t,height:t}}_getPcbCircuitJsonBounds(){let{db:e}=this.root,t=e.pcb_via.get(this.pcb_via_id),n=this.getPcbSize();return{center:{x:t.x,y:t.y},bounds:{left:t.x-n.width/2,top:t.y-n.height/2,right:t.x+n.width/2,bottom:t.y+n.height/2},width:n.width,height:n.height}}_setPositionFromLayout(e){let{db:t}=this.root;t.pcb_via.update(this.pcb_via_id,{x:e.x,y:e.y})}_getLayers(){let{fromLayer:e="top",toLayer:t="bottom"}=this._parsedProps,n=this.parent?this.getSubcircuit()._getSubcircuitLayerCount():2;return WS({fromLayer:e,toLayer:t,layerCount:n})}initPorts(){let e=this._parsedProps.layers;for(let t of e){let n=new Lh({name:t,layer:t});n.registerMatch(this),this.add(n)}}_getConnectedNetOrTrace(){let e=this._parsedProps.connectsTo;if(!e)return this._getPortFromContainingPad()?._getDirectlyConnectedTraces()[0]??null;let t=this.getSubcircuit(),n=Array.isArray(e)?e:[e];for(let o of n)if(o.startsWith("net.")){let r=t.selectOne(o,{type:"net"});if(r)return r}return null}doInitialCreateNetsFromProps(){let e=this._parsedProps.connectsTo;if(!e)return;Cue(this,Array.isArray(e)?e:[e])}_getPortFromContainingPad(){if(this.parent?.componentName!=="Footprint")return null;let e=new Set(this.parent.children.filter((t)=>t.componentName==="SmtPad").filter((t)=>MRr(this,t)).map((t)=>t.matchedPort).filter((t)=>t!==null));return e.size===1?[...e][0]:null}doInitialPcbComponentRender(){if(this.root?.pcbDisabled)return;let{db:e}=this.root,t=this.getInheritedMergedProperty("pcbStyle"),{padDiameter:n}=this._getResolvedViaDiameters(t),o=this._getGlobalPcbPositionBeforeLayout(),r=this.getSubcircuit(),i=e.pcb_component.insert({center:o,width:n,height:n,layer:this._parsedProps.fromLayer??"top",rotation:0,source_component_id:this.source_component_id,subcircuit_id:r?.subcircuit_id??void 0,obstructs_within_bounds:!0});this.pcb_component_id=i.pcb_component_id}doInitialSourceRender(){let{db:e}=this.root,t=this.getGroup(),n=this.getSubcircuit(),o=e.source_manually_placed_via.insert({source_group_id:t?.source_group_id,subcircuit_id:n?.subcircuit_id??void 0});this.source_manually_placed_via_id=o.source_manually_placed_via_id,this.source_component_id=o.source_manually_placed_via_id}doInitialSourceTraceRender(){let e=this._parsedProps.connectsTo;if(!e)return;let{db:t}=this.root,n=this.getSubcircuit(),o=Array.isArray(e)?e:[e],r=[],i=[];for(let s of o){if(s.startsWith("net.")){let c=n.selectOne(s,{type:"net"});if(!c?.source_net_id){this.renderError(`Could not find net for via selector "${s}"`);return}i.push(c);continue}let a=n.selectOne(s,{type:"port"})??this.getParentNormalComponent()?.children.find((c)=>c instanceof Lh&&c.isMatchingAnyOf([s]))??null;if(!a?.source_port_id){this.renderError(`Could not find port for via selector "${s}"`);return}r.push(a)}if(r.length>0){let s=t.source_trace.insert({connected_source_port_ids:r.map((a)=>a.source_port_id),connected_source_net_ids:i.map((a)=>a.source_net_id),subcircuit_id:n.subcircuit_id??void 0,display_name:this._parsedProps.name?`${this._parsedProps.name} connectivity`:"Manually placed via connectivity"});this.source_trace_id=s.source_trace_id}t.source_manually_placed_via.update(this.source_manually_placed_via_id,{source_net_id:i[0]?.source_net_id,source_trace_id:this.source_trace_id??void 0})}doInitialPcbPortAttachment(){if(this.root?.pcbDisabled)return;this.root.db.pcb_via.update(this.pcb_via_id,{pcb_port_ids:this.children.flatMap((e)=>e instanceof Lh&&e.pcb_port_id?[e.pcb_port_id]:[])})}doInitialPcbPrimitiveRender(){if(this.root?.pcbDisabled)return;let{db:e}=this.root,t=this.getInheritedMergedProperty("pcbStyle"),{holeDiameter:n,padDiameter:o}=this._getResolvedViaDiameters(t),r=this._getGlobalPcbPositionBeforeLayout(),i=this.getSubcircuit(),s=this._getConnectedNetOrTrace(),{isFlipped:a}=this._getPcbPrimitiveFlippedHelpers(),c=Iit(this._parsedProps.tented),l=this.source_trace_id??(s instanceof dB?void 0:s?.source_trace_id),h=!l&&s instanceof dB?s.source_net_id:void 0,d=e.pcb_via.insert({x:r.x,y:r.y,hole_diameter:n,outer_diameter:o,layers:this._getLayers(),from_layer:this._parsedProps.fromLayer||"bottom",to_layer:this._parsedProps.toLayer||"top",subcircuit_id:i?.subcircuit_id??void 0,subcircuit_connectivity_map_key:this.subcircuit_connectivity_map_key??void 0,pcb_group_id:this.getGroup()?.pcb_group_id??void 0,net_is_assignable:this._parsedProps.netIsAssignable??void 0,tented_on_top:a?c.tented_on_bottom:c.tented_on_top,tented_on_bottom:a?c.tented_on_top:c.tented_on_bottom,...l?{source_trace_id:l}:{},...h?{source_net_id:h}:{}});this.pcb_via_id=d.pcb_via_id}};function BRr(e){if(e.root?.schematicDisabled)return;let{db:t}=e.root,{_parsedProps:n,parent:o}=e;if(!o)throw Error("Trace has no parent");let{allPortsFound:r,portsWithSelectors:i}=e._findConnectedPorts();if(!r)return;let s=i.map(({port:x})=>({port:x,position:x._getGlobalSchematicPositionAfterLayout(),schematic_port_id:x.schematic_port_id,facingDirection:x.facingDirection}));if(s.length<2)throw Error("Expected at least two ports in portsWithPosition.");let a,c,l=s[0].position,h=s[0].port;if("path"in e.props){if(e.props.path.length!==2)throw Error("Invalid 'path': Must contain exactly two elements.");[a,c]=e.props.path}else{if(!(("from"in e.props)&&("to"in e.props)))throw Error("Missing 'from' or 'to' properties in props.");a=e.props.from,c=e.props.to}if(!h.source_port_id)throw Error(`Missing source_port_id for the 'from' port (${a}).`);let d=s[1].position,u=s[1].port;if(!u.source_port_id)throw Error(`Missing source_port_id for the 'to' port (${c}).`);let _=t.schematic_net_label.list().find((x)=>x.source_net_id===h.source_port_id),p=t.schematic_net_label.list().find((x)=>x.source_net_id===u.source_port_id),[m,A]=i.map(({port:x})=>x),f=m.parent?.config.shouldRenderAsSchematicBox?`${m?.parent?.props.name}_${m?.props.name}`:`${A?.parent?.props.name}_${A?.props.name}`,y=e._getSchematicNetLabelText()??f;if(_&&_.text!==y)_.text=`${y} / ${_.text}`;if(p&&p?.text!==y)p.text=`${y} / ${p.text}`;if(!p){let x=jJ(u.facingDirection)??"bottom";t.schematic_net_label.insert({text:y,source_net_id:u.source_port_id,anchor_position:d,center:FS({anchor_position:d,anchor_side:x,text:y}),anchor_side:x,schematic_sheet_id:e._resolveSchematicSheetId()})}if(!_){let x=jJ(h.facingDirection)??"bottom";t.schematic_net_label.insert({text:y,source_net_id:h.source_port_id,anchor_position:l,center:FS({anchor_position:l,anchor_side:x,text:y}),anchor_side:x,schematic_sheet_id:e._resolveSchematicSheetId()})}}function TRr(e){let{_parsedProps:t,parent:n}=e;if(!n)throw Error("Trace has no parent");let o=e.getTracePortPathSelectors(),r=(s)=>{if(s.lastIndexOf(".")>s.lastIndexOf(" "))return null;let c=e.getSubcircuit().selectOne(s);if(!c&&!/[.#\[]/.test(s))c=e.getSubcircuit().selectOne(`.${s}`);if(!c)return null;let l=c.children.filter((h)=>h.componentName==="Port");return l.length===1?l[0]:null},i=o.map((s)=>({selector:s,port:e.getSubcircuit().selectOne(s,{type:"port"})??r(s)}));for(let{selector:s,port:a}of i)if(!a){let c,l,h=s.lastIndexOf(".");if(h!==-1&&h>s.lastIndexOf(" "))c=s.slice(0,h),l=s.slice(h+1);else{let C=s.match(/^(.*[ >])?([^ >]+)$/);c=C?.[1]?.trim()??"",l=C?.[2]??s}let d=c?e.getSubcircuit().selectOne(c):null;if(!d&&c&&!/[.#\[]/.test(c))d=e.getSubcircuit().selectOne(`.${c}`);if(!d){let C=c?`Could not find port for selector "${s}". Component "${c}" not found`:`Could not find port for selector "${s}"`,b=e.getSubcircuit(),I=b.getGroup();throw new vY({error_type:"source_trace_not_connected_error",message:C,subcircuit_id:b.subcircuit_id??void 0,source_group_id:I?.source_group_id??void 0,source_trace_id:e.source_trace_id??void 0,selectors_not_found:[s]})}let u=d.children.filter((C)=>C.componentName==="Port"),_=l.includes(".")?l.split(".").pop()??"":l,p=u.flatMap((C)=>C.getNameAndAliases()),m=p.some((C)=>!/^(pin\d+|\d+)$/.test(C)),A=Array.from(new Set(p)).join(", "),g;if(u.length===0)g="It has no ports";else if(!m)g=`It has ${u.length} pins and no pinLabels (consider adding pinLabels)`;else g=`It has [${A}]`;let f=`Could not find port for selector "${s}". Component "${d.props.name??c}" found, but does not have pin "${_}". ${g}`,y=e.getSubcircuit(),x=y.getGroup();throw new vY({error_type:"source_trace_not_connected_error",message:f,subcircuit_id:y.subcircuit_id??void 0,source_group_id:x?.source_group_id??void 0,source_trace_id:e.source_trace_id??void 0,selectors_not_found:[s]})}if(i.some((s)=>!s.port))return{allPortsFound:!1};return{allPortsFound:!0,portsWithSelectors:i,ports:i.map(({port:s})=>s)}}function t8e(e){let t=e.flatMap(Jxn),n=e.filter(({route_type:o})=>o==="via").length*1.6;for(let o=1;o<t.length;o++){let r=t[o-1],i=t[o];n+=Math.hypot(i.x-r.x,i.y-r.y)}return n}var _5n=({trace:e,pcbTrace:t,ports:n,pathIndex:o})=>{let{db:r}=e.root,i=r.pcb_via.list({pcb_trace_id:t.pcb_trace_id}),s=r.source_trace.get(e.source_trace_id)?.display_name,a="unnamed trace";if(s&&e._parsedProps.name)a=`${e.getDisplayName()}, ${s}`;else if(s)a=s;else if(e._parsedProps.name)a=e.getDisplayName();let c="pcbPath";if(o!==void 0)c=`pcbPaths[${o}]`;let l,h=0;for(let d of t.route){if(d.route_type==="wire"){l=d.layer;continue}if(d.route_type!=="via")continue;h+=1;let u=i[h-1];if(l&&!u.layers.includes(l)){let _=Number(d.x.toFixed(4)),p=Number(d.y.toFixed(4));r.pcb_trace_error.insert({error_type:"pcb_trace_error",source_trace_id:e.source_trace_id,message:`Invalid ${c} (${a}): via ${h} (${d.from_layer} → ${d.to_layer}) at board (${_}, ${p}) mm does not reach incoming ${l} copper.`,center:{x:d.x,y:d.y},pcb_trace_id:t.pcb_trace_id,pcb_component_ids:[],pcb_port_ids:n.map((m)=>m.pcb_port_id).filter(Boolean),subcircuit_id:t.subcircuit_id,is_fatal:!1})}l=d.to_layer}};function ign(e){let{lineStart:t,lineEnd:n,rectCenter:o,rectWidth:r,rectHeight:i}=e,s=o.x-r/2,a=o.x+r/2,c=o.y+i/2,l=o.y-i/2,h=n.x-t.x,d=n.y-t.y,u=[];if(h!==0){let _=(s-t.x)/h;if(_>=0&&_<=1){let p=t.y+_*d;if(p>=l&&p<=c)u.push({x:s,y:p,t:_})}}if(h!==0){let _=(a-t.x)/h;if(_>=0&&_<=1){let p=t.y+_*d;if(p>=l&&p<=c)u.push({x:a,y:p,t:_})}}if(d!==0){let _=(l-t.y)/d;if(_>=0&&_<=1){let p=t.x+_*h;if(p>=s&&p<=a)u.push({x:p,y:l,t:_})}}if(d!==0){let _=(c-t.y)/d;if(_>=0&&_<=1){let p=t.x+_*h;if(p>=s&&p<=a)u.push({x:p,y:c,t:_})}}if(u.length===0)return null;return u.sort((_,p)=>_.t-p.t),{x:u[0].x,y:u[0].y}}function sgn(e){let{lineStart:t,lineEnd:n,circleCenter:o,circleRadius:r}=e,i=t.x-o.x,s=t.y-o.y,a=n.x-o.x,c=n.y-o.y,l=a-i,h=c-s,d=l*l+h*h,u=2*(i*l+s*h),_=i*i+s*s-r*r,p=u*u-4*d*_;if(p<0)return null;let m=Math.sqrt(p),A=(-u-m)/(2*d),g=(-u+m)/(2*d),f=null;if(A>=0&&A<=1)f=A;else if(g>=0&&g<=1)f=g;if(f===null)return null;return{x:t.x+f*l,y:t.y+f*h}}function agn(e){let{traceStart:t,traceEnd:n,traceWidth:o,port:r}=e,i=r.matchedComponents.find((u)=>u.isPcbPrimitive);if(!i)return n;let s=i._getPcbCircuitJsonBounds(),{width:a,height:c,center:l}=s,h=Math.min(a,c);if(o<=h/2)return n;let d=null;if(i.componentName==="SmtPad"){let u=i,_=u._parsedProps.shape;if(_==="circle"){let p=u._parsedProps.radius;d=sgn({lineStart:t,lineEnd:n,circleCenter:l,circleRadius:p})}else if(_==="rect"||_==="rotated_rect"||_==="pill"||_==="polygon")d=ign({lineStart:t,lineEnd:n,rectCenter:l,rectWidth:a,rectHeight:c})}else if(i.componentName==="PlatedHole"){let u=i;if(u._parsedProps.shape==="circle"){let p=u._parsedProps.outerDiameter;d=sgn({lineStart:t,lineEnd:n,circleCenter:l,circleRadius:p/2})}else d=ign({lineStart:t,lineEnd:n,rectCenter:l,rectWidth:a,rectHeight:c})}return d??n}function cgn(e){let n=(e._parsedProps?.portHints??[]).filter(Boolean);if(n.length>0)return`<${e.lowercaseComponentName}(${n.map((o)=>`.${o}`).join(", ")}) />`;return`<${e.lowercaseComponentName} />`}function n8e(e,t){let n=t.matchedComponents.filter((a)=>a.isPcbPrimitive),o=t.getParentNormalComponent()?.props.name??t.parent?.props.name??"unknown",r=t.getParentNormalComponent(),i=e.trim().split(/\s+|>/).filter(Boolean).at(-1)?.replace(/^port\./,"").replace(/^\./,"");if(i&&!/^(pin)?\d+$/.test(i)){let a=(r?.children??[]).filter((c)=>c.componentName==="Port"&&c.isMatchingAnyOf([i]));if(a.length>1){if(!(r?._getInternallyConnectedPins?.()??[]).some((h)=>a.every((d)=>h.includes(d)))){let h=Array.from(new Set(a.flatMap((_)=>_.getNameAndAliases().filter((p)=>/^pin\d+$/.test(p)).map((p)=>`${o}.${p}`)))),d=h.length>0?` Use a raw pin selector like ${h.map((_)=>`"${_}"`).join(" or ")}.`:"",u=a.flatMap((_)=>_.matchedComponents.filter((p)=>p.isPcbPrimitive));return`Trace selector "${e}" resolved to "${o}.${t.props.name}", but alias "${i}" matches multiple PCB pads: ${u.map((_)=>cgn(_)).join(", ")}.${d}`}}}if(t.pcb_port_id)return null;let s=Array.from(new Set(t.getNameAndAliases().filter((a)=>/^pin\d+$/.test(a)).map((a)=>`${o}.${a}`)));if(n.length>1&&!Zve(n)){let a=s.length>0?` Use a raw pin selector like ${s.map((c)=>`"${c}"`).join(" or ")}.`:"";return`Trace selector "${e}" resolved to "${o}.${t.props.name}", but that target maps to multiple non-overlapping PCB pads: ${n.map((c)=>cgn(c)).join(", ")}.${a}`}return null}var Pb={min_trace_width:0.1,min_via_hole_edge_to_via_hole_edge_clearance:0.1,min_plated_hole_drill_edge_to_drill_edge_clearance:0.15,min_trace_to_hole_edge_clearance:0.2,min_trace_to_pad_edge_clearance:0.1,min_pad_edge_to_pad_edge_clearance:0.1,min_board_edge_clearance:0.2,min_via_hole_diameter:0.2,min_via_pad_diameter:0.3},DRr=({trace:e,path:t,anchorPort:n,width:o})=>{let{db:r}=e.root,i=e.getSubcircuit(),s=i._isInflatedFromCircuitJson?e._computePcbGlobalTransformBeforeLayout():n._computePcbGlobalTransformBeforeLayout?.()??e7e.identity(),a=n.getAvailablePcbLayers()[0]??"top",c=[];for(let[l,h]of t.entries()){if(typeof h==="string"){let u=i.selectOne(h,{type:"port"});if(!u){r.pcb_trace_error.insert({error_type:"pcb_trace_error",source_trace_id:e.source_trace_id,message:`Could not resolve pcbPaths selector "${h}" for ${e}`,pcb_trace_id:e.pcb_trace_id,pcb_component_ids:[],pcb_port_ids:[]});return}let _=n8e(h,u);if(_){r.pcb_trace_error.insert({error_type:"pcb_trace_error",source_trace_id:e.source_trace_id,message:_,pcb_trace_id:e.pcb_trace_id,pcb_component_ids:[],pcb_port_ids:[]});return}if(l===0)a=u.getAvailablePcbLayers()[0]??a;let p=u._getGlobalPcbPositionAfterLayout();c.push({route_type:"wire",x:p.x,y:p.y,width:o,layer:a,...l===0?{start_pcb_port_id:u.pcb_port_id}:{},...l===t.length-1?{end_pcb_port_id:u.pcb_port_id}:{}});continue}let d=e7e.applyToPoint(s,{x:h.x,y:h.y});if(h.via){let u=h.fromLayer??a,_=h.toLayer??a;c.push({route_type:"via",x:d.x,y:d.y,from_layer:u,to_layer:_}),a=_}else c.push({route_type:"wire",x:d.x,y:d.y,width:o,layer:a})}return c},g5n=({trace:e,pcbTrace:t,path:n,ports:o,pathIndex:r})=>{if(e._getBoard()?.getInheritedProperty("allowBlindAndBuriedVias"))return;let{db:s}=e.root,a=s.source_trace.get(e.source_trace_id)?.display_name,c=[e._parsedProps.name?e.getDisplayName():void 0,a].filter(Boolean).join(", ")||"unnamed trace",l=r===void 0?"pcbPath":`pcbPaths[${r}]`,h=[];for(let[A,g]of n.entries())if(typeof g!=="string"&&g.via)h.push(A);let d=s.pcb_via.list({pcb_trace_id:t.pcb_trace_id}),u=[],_=new Set,p;for(let[A,g]of d.entries()){let f=g.layers.includes("top"),y=g.layers.includes("bottom");if(f&&y)continue;let x=f||y?"blind":"buried";_.add(x);let C=h[A],b=`${l}[${C}]`,I=Number(g.x.toFixed(4)),v=Number(g.y.toFixed(4));p??=g,u.push(`${b}: ${x} via (fromLayer: "${g.from_layer}", toLayer: "${g.to_layer}") spanning [${g.layers.join(", ")}] at board (${I}, ${v}) mm`)}if(!p)return;let m=[..._].sort().join(" and ");s.pcb_trace_error.insert({error_type:"pcb_trace_error",source_trace_id:e.source_trace_id,pcb_trace_id:t.pcb_trace_id,pcb_component_ids:[],pcb_port_ids:o.map((A)=>A.pcb_port_id).filter(Boolean),subcircuit_id:t.subcircuit_id,center:{x:p.x,y:p.y},is_fatal:!1,message:`${m} vias aren't allowed by allowBlindAndBuriedVias settings in ${l} (${c}): ${u.length} disallowed via${u.length===1?"":"s"}. Use top-to-bottom through vias (fromLayer: "top", toLayer: "bottom", or the reverse) and adjust the adjoining wire layers to match, or set allowBlindAndBuriedVias={true} on <board> if fabrication supports blind/buried vias. Saved copper has been preserved. Affected indices (zero-based): ${u.join("; ")}.`})},NRr=({trace:e,paths:t,ports:n,portsWithSelectors:o,width:r})=>{let{db:i}=e.root,{pcbPathRelativeTo:s}=e._parsedProps,a=e.getSubcircuit(),c=s?o.find(({selector:_})=>_===s)?.port:void 0;if(!c&&s)c=a.selectOne(s,{type:"port"});if(c??=n[0],!c){i.source_trace_not_connected_error.insert({error_type:"source_trace_not_connected_error",source_trace_id:e.source_trace_id??void 0,subcircuit_id:a.subcircuit_id??void 0,message:"pcbPaths requires a connected port or pcbPathRelativeTo port"});return}let l=e.getInheritedMergedProperty("pcbStyle"),{holeDiameter:h,padDiameter:d}=gB(l),u=e.subcircuit_connectivity_map_key??i.source_trace.get(e.source_trace_id)?.subcircuit_connectivity_map_key;for(let[_,p]of t.entries()){let m=DRr({trace:e,path:p,anchorPort:c,width:r});if(!m||m.length<2)continue;let A=i.pcb_trace.insert({route:m,is_antenna_trace:e.isAntennaTrace,source_trace_id:e.source_trace_id,subcircuit_id:a.subcircuit_id??void 0,pcb_group_id:e.getGroup()?.pcb_group_id??void 0,trace_length:t8e(m)});e.pcb_trace_id??=A.pcb_trace_id;for(let g of m){if(g.route_type!=="via")continue;let{from_layer:f,to_layer:y}=g;i.pcb_via.insert({pcb_trace_id:A.pcb_trace_id,x:g.x,y:g.y,hole_diameter:h,outer_diameter:d,layers:WS({fromLayer:f,toLayer:y,layerCount:a._getSubcircuitLayerCount()}),from_layer:f,to_layer:y,subcircuit_id:a.subcircuit_id??void 0,pcb_group_id:e.getGroup()?.pcb_group_id??void 0,subcircuit_connectivity_map_key:u})}_5n({trace:e,pcbTrace:A,ports:n,pathIndex:_}),e._insertErrorIfTraceIsOutsideBoard(m,n),g5n({trace:e,pcbTrace:A,path:p,ports:n,pathIndex:_})}e._portsRoutedOnPcb=n},RRr=(e,t)=>{if(t.route_type!=="via")return;return e?.find((n)=>Math.abs(n.x-t.x)<0.0001&&Math.abs(n.y-t.y)<0.0001&&(!n.from_layer||n.from_layer===t.from_layer)&&(!n.to_layer||n.to_layer===t.to_layer))},QRr=(e)=>{let t=e;return{holeDiameter:t.hole_diameter??t.via_hole_diameter,outerDiameter:t.outer_diameter??t.via_diameter}};function kRr(e){if(e.root?.pcbDisabled)return;let{db:t}=e.root,{_parsedProps:n}=e,o=e.getSubcircuit(),r=n.pcbPath!==void 0,i=n.pcbPaths!==void 0,s=Boolean(n.pcbStraightLine),a=e._inflatedPcbTraces??[];if(!r&&!i&&!s&&a.length===0)return;let c,l,h;try{let N=e._findConnectedPorts();c=N.allPortsFound,l=N.ports??[],h=N.portsWithSelectors??[]}catch(N){if(N instanceof vY){t.source_trace_not_connected_error.insert({...N.errorData,error_type:"source_trace_not_connected_error"}),e._couldNotFindPort=!0;return}throw N}if(!c)return;let d=h.map(({selector:N,port:D})=>n8e(N,D)).find(Boolean);if(d){t.pcb_trace_error.insert({error_type:"pcb_trace_error",source_trace_id:e.source_trace_id,message:d,pcb_trace_id:e.pcb_trace_id,pcb_component_ids:[],pcb_port_ids:l.map((N)=>N.pcb_port_id).filter(Boolean)});return}let u=[];for(let N of l)if(!N._hasMatchedPcbPrimitive())u.push(N);if(u.length>0){t.pcb_trace_error.insert({error_type:"pcb_trace_error",source_trace_id:e.source_trace_id,message:`Some ports did not have a matching PCB primitive (e.g. a pad or plated hole), this can happen if a footprint is missing. As a result, ${e} wasn't routed. Missing ports: ${u.map((N)=>N.getString()).join(", ")}`,pcb_trace_id:e.pcb_trace_id,pcb_component_ids:[],pcb_port_ids:u.map((N)=>N.pcb_port_id).filter(Boolean)});return}let _=e._getExplicitTraceThickness()??e.getSubcircuit()._parsedProps.minTraceWidth??Pb.min_trace_width;if(a.length>0){let{isFlipped:N,maybeFlipLayer:D}=e._getPcbPrimitiveFlippedHelpers(),L=e._computePcbGlobalTransformBeforeLayout(),H=[],V=e.subcircuit_connectivity_map_key??t.source_trace.get(e.source_trace_id)?.subcircuit_connectivity_map_key;for(let O of a){let U=O.route.map((J)=>{if(J.route_type==="wire"){let{x:ee,y:se,...ne}=J,re=ak.applyToPoint(L,{x:ee,y:se});return{...ne,...re,layer:D(J.layer)}}if(J.route_type==="via"){let{x:ee,y:se,...ne}=J,re=ak.applyToPoint(L,{x:ee,y:se});return{...ne,...re,from_layer:D(J.from_layer),to_layer:D(J.to_layer),tented_on_top:N?J.tented_on_bottom:J.tented_on_top,tented_on_bottom:N?J.tented_on_top:J.tented_on_bottom}}return{...J,start:ak.applyToPoint(L,J.start),end:ak.applyToPoint(L,J.end),start_layer:D(J.start_layer),end_layer:D(J.end_layer)}}),j=t.pcb_trace.insert({...O,route:U,source_trace_id:e.source_trace_id,subcircuit_id:o?.subcircuit_id??void 0,pcb_group_id:e.getGroup()?.pcb_group_id??void 0}),Y=e.getInheritedMergedProperty("pcbStyle"),{holeDiameter:X,padDiameter:K}=gB(Y);for(let J=0;J<U.length;J++){let ee=U[J];if(ee.route_type==="via"){let se=O.route[J],ne=RRr(e._inflatedPcbVias,se),re=ne?vN.parse(ne):void 0,Z=QRr(ee),te=D(re?.from_layer??ee.from_layer),ie=D(re?.to_layer??ee.to_layer),ce=(re?.layers??WS({fromLayer:ee.from_layer,toLayer:ee.to_layer,layerCount:o._getSubcircuitLayerCount()})).map((ue)=>D(ue));t.pcb_via.insert({pcb_trace_id:j.pcb_trace_id,x:ee.x,y:ee.y,hole_diameter:re?.hole_diameter??Z.holeDiameter??X,outer_diameter:re?.outer_diameter??Z.outerDiameter??K,layers:ce,from_layer:te,to_layer:ie,subcircuit_id:o?.subcircuit_id??void 0,pcb_group_id:e.getGroup()?.pcb_group_id??void 0,subcircuit_connectivity_map_key:re?.subcircuit_connectivity_map_key??V,net_is_assignable:re?.net_is_assignable,net_assigned:re?.net_assigned,tented_on_top:(N?re?.tented_on_bottom:re?.tented_on_top)??ee.tented_on_top,tented_on_bottom:(N?re?.tented_on_top:re?.tented_on_bottom)??ee.tented_on_bottom})}}if(!e.pcb_trace_id)e.pcb_trace_id=j.pcb_trace_id;H.push(j.route)}for(let O of H)e._insertErrorIfTraceIsOutsideBoard(O,l);e._portsRoutedOnPcb=l;return}if(n.pcbPaths){NRr({trace:e,paths:n.pcbPaths,ports:l,portsWithSelectors:h,width:_});return}if(s&&!r){if(!l||l.length<2){e.renderError("pcbStraightLine requires exactly two connected ports");return}let[N,D]=l,L=N.getAvailablePcbLayers(),H=D.getAvailablePcbLayers(),O=L.find((se)=>H.includes(se))??L[0]??H[0]??"top",U=N._getGlobalPcbPositionAfterLayout(),j=D._getGlobalPcbPositionAfterLayout(),Y=agn({traceStart:j,traceEnd:U,traceWidth:_,port:N}),X=agn({traceStart:U,traceEnd:j,traceWidth:_,port:D}),K=[{route_type:"wire",x:Y.x,y:Y.y,width:_,layer:O,start_pcb_port_id:N.pcb_port_id},{route_type:"wire",x:X.x,y:X.y,width:_,layer:O,end_pcb_port_id:D.pcb_port_id}],J=t8e(K),ee=t.pcb_trace.insert({route:K,source_trace_id:e.source_trace_id,subcircuit_id:o?.subcircuit_id??void 0,pcb_group_id:e.getGroup()?.pcb_group_id??void 0,trace_length:J});e._portsRoutedOnPcb=l,e.pcb_trace_id=ee.pcb_trace_id,e._insertErrorIfTraceIsOutsideBoard(K,l);return}if(!n.pcbPath)return;let p;if(n.pcbPathRelativeTo){if(p=h.find((N)=>N.selector===n.pcbPathRelativeTo)?.port,!p)p=e.getSubcircuit().selectOne(n.pcbPathRelativeTo)}if(!p)p=l[0];if(!p){t.source_trace_not_connected_error.insert({error_type:"source_trace_not_connected_error",source_trace_id:e.source_trace_id??void 0,subcircuit_id:o.subcircuit_id??void 0,message:"pcbPath requires a connected port or pcbPathRelativeTo port"});return}let m=l.find((N)=>N!==p)??l[1],g=p.getAvailablePcbLayers()[0]||"top",f=p._getGlobalPcbPositionAfterLayout(),y=m?._getGlobalPcbPositionAfterLayout(),x=[];x.push({route_type:"wire",x:f.x,y:f.y,width:_,layer:g,start_pcb_port_id:p.pcb_port_id});let C=o._isInflatedFromCircuitJson?e._computePcbGlobalTransformBeforeLayout():p?._computePcbGlobalTransformBeforeLayout?.()||ak.identity(),b=n.pcbPath;for(let N of b){let D,L=!1,H=typeof N!=="string"&&N.via,V,O;if(typeof N==="string"){let j=e.getSubcircuit().selectOne(N,{type:"port"});if(!j){t.pcb_trace_error.insert({error_type:"pcb_trace_error",source_trace_id:e.source_trace_id,message:`Could not resolve pcbPath selector "${N}" for ${e}`,pcb_trace_id:e.pcb_trace_id,pcb_component_ids:[],pcb_port_ids:[]});continue}let Y=n8e(N,j);if(Y){t.pcb_trace_error.insert({error_type:"pcb_trace_error",source_trace_id:e.source_trace_id,message:Y,pcb_trace_id:e.pcb_trace_id,pcb_component_ids:[],pcb_port_ids:[]});return}let X=j._getGlobalPcbPositionAfterLayout();D={x:X.x,y:X.y},L=!0}else if(D={x:N.x,y:N.y},L=!1,N.via)V=N.fromLayer??g,O=N.toLayer;let U=L?D:ak.applyToPoint(C,D);if(H)x.push({route_type:"via",x:U.x,y:U.y,from_layer:V??g,to_layer:O??g}),g=O??g;else x.push({route_type:"wire",x:U.x,y:U.y,width:_,layer:g})}if(m&&y)x.push({route_type:"wire",x:y.x,y:y.y,width:_,layer:g,end_pcb_port_id:m.pcb_port_id});let I=t8e(x),v=t.pcb_trace.insert({route:x,is_antenna_trace:e.isAntennaTrace,source_trace_id:e.source_trace_id,subcircuit_id:o?.subcircuit_id??void 0,pcb_group_id:e.getGroup()?.pcb_group_id??void 0,trace_length:I}),P=e.subcircuit_connectivity_map_key??t.source_trace.get(e.source_trace_id)?.subcircuit_connectivity_map_key,M=e.getInheritedMergedProperty("pcbStyle"),{holeDiameter:B,padDiameter:T}=gB(M);for(let N of x)if(N.route_type==="via"){let{from_layer:D,to_layer:L}=N;t.pcb_via.insert({pcb_trace_id:v.pcb_trace_id,x:N.x,y:N.y,hole_diameter:B,outer_diameter:T,layers:WS({fromLayer:D,toLayer:L,layerCount:o._getSubcircuitLayerCount()}),from_layer:D,to_layer:L,subcircuit_id:o?.subcircuit_id??void 0,pcb_group_id:e.getGroup()?.pcb_group_id??void 0,subcircuit_connectivity_map_key:P})}g5n({trace:e,pcbTrace:v,path:n.pcbPath,ports:l}),e._portsRoutedOnPcb=l,e.pcb_trace_id=v.pcb_trace_id,_5n({trace:e,pcbTrace:v,ports:l}),e._insertErrorIfTraceIsOutsideBoard(x,l)}function LRr(e,t){let n=[],o=(r)=>{let i=0;for(let s of t)if(s.layer===r.layer&&Math.hypot(s.x-r.x,s.y-r.y)<0.000001)i=Math.max(i,s.diameter);return i};for(let r=0;r<e.length;r++){let i=e[r],s=e[r+1];if(i.route_type!=="wire"||s?.route_type!=="wire"||i.layer!==s.layer||i.width_interpolation_mode){n.push(i);continue}let a=Math.hypot(s.x-i.x,s.y-i.y),c=o(i),l=o(s),h=(p)=>{let m=p*0.8,A=Math.min(p*1.5,a*0.45);return m>i.width&&A>p/2?{width:m,length:A}:void 0},d=h(c),u=h(l);if(!d&&!u){n.push(i);continue}let _=(p)=>({route_type:"wire",x:i.x+(s.x-i.x)*p/a,y:i.y+(s.y-i.y)*p/a,width:i.width,layer:i.layer});if(d)n.push({...i,width:d.width,start_width:d.width,end_width:i.width,width_interpolation_mode:"quadratic"}),n.push(_(d.length));else n.push(i);if(u)n.push({..._(a-u.length),start_width:i.width,end_width:u.width,width_interpolation_mode:"quadratic"})}return n}function A5n(e){return e.map((t,n)=>{if(t.route_type!=="wire"||!t.width_interpolation_mode)return{...t};let o=e[n+1];if(o?.route_type!=="wire"||o.layer!==t.layer||o.x===t.x&&o.y===t.y)throw Error("Width interpolation requires a distinct next wire point on the same layer");return{...t,start_width:t.width,end_width:o.width}})}function Tde(e,t,n){let o,r;for(let i=t-1;i>=0;i--){let s=e[i];if(s.route_type==="wire"){o=s.width;break}}for(let i=t+1;i<e.length;i++){let s=e[i];if(s.route_type==="wire"){r=s.width;break}}return{fromWidth:o??r??n,toWidth:r??o??n}}var lgn=new WeakMap;function hgn(e){let{is_inside_copper_pour:t,copper_pour_id:n,...o}=e;return JSON.stringify(o)}function HRr(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;return e.every((n,o)=>hgn(n)===hgn(t[o]))}function FRr(e){let t=lgn.get(e);if(t)return t;let n=new Map;return lgn.set(e,n),n}function lot({pcbTrace:e,pcbTraceTeardropRenderState:t}){if(HRr(e.route,t.generatedRoute))return!1;return t.originalRoute=e.route,t.generatedRoute=e.route,!0}function zRr({route:e,contacts:t}){return e.flatMap((n,o)=>{if(n.route_type!=="via"||!t.some((l)=>Math.hypot(l.x-n.x,l.y-n.y)<0.000001))return[n];let{fromWidth:r,toWidth:i}=Tde(e,o,0);if(!r||!i)return[n];let s=e[o-1],a=e[o+1],c=[];if(!(s?.route_type==="wire"&&s.x===n.x&&s.y===n.y&&s.layer===n.from_layer))c.push({route_type:"wire",x:n.x,y:n.y,width:r,layer:n.from_layer});if(c.push(n),!(a?.route_type==="wire"&&a.x===n.x&&a.y===n.y&&a.layer===n.to_layer))c.push({route_type:"wire",x:n.x,y:n.y,width:i,layer:n.to_layer});return c})}function ORr({root:e,pcbTraceId:t,pcbTraceTeardropRenderStateByPcbTraceId:n}){let o=n.get(t);if(!o)return;let r=e.db.pcb_trace.get(t);if(!r){n.delete(t);return}lot({pcbTrace:r,pcbTraceTeardropRenderState:o});let i=[...o.contactsBySourceTraceId.values()].flat(),s=zRr({route:o.originalRoute,contacts:i}),a=LRr(s,i);if(e.db.pcb_trace.update(t,{route:a}),i.length===0){n.delete(t);return}o.generatedRoute=a}function VRr({root:e,sourceTraceId:t,contactsByPcbTraceId:n}){let o=FRr(e),r=new Set;for(let[i,s]of o){let a=e.db.pcb_trace.get(i);if(!a){o.delete(i);continue}if(lot({pcbTrace:a,pcbTraceTeardropRenderState:s}))r.add(i);if(s.contactsBySourceTraceId.delete(t))r.add(i)}for(let[i,s]of n){let a=e.db.pcb_trace.get(i);if(!a||s.length===0)continue;let c=o.get(i);if(!c)c={originalRoute:a.route,generatedRoute:a.route,contactsBySourceTraceId:new Map},o.set(i,c);else lot({pcbTrace:a,pcbTraceTeardropRenderState:c});c.contactsBySourceTraceId.set(t,s),r.add(i)}for(let i of r)ORr({root:e,pcbTraceId:i,pcbTraceTeardropRenderStateByPcbTraceId:o})}function YRr(e){if(e.shape==="polygon")return 0;if(e.shape==="circle")return e.radius*2;return Math.min(e.width,e.height)}function GRr({root:e,sourceTraceId:t}){let o=e.db.source_trace.get(t)?.subcircuit_connectivity_map_key;if(!o)return e.db.pcb_trace.list({source_trace_id:t});return e.db.pcb_trace.list().filter((r)=>{if(r.source_trace_id===t)return!0;if(!r.source_trace_id)return!1;return e.db.source_trace.get(r.source_trace_id)?.subcircuit_connectivity_map_key===o})}function URr({root:e,pcbTrace:t,enabledPorts:n,padContacts:o,enableUnmatchedVias:r}){let i=[...o];for(let s of e.db.pcb_via.list({pcb_trace_id:t.pcb_trace_id})){let a=n.find(({port:c})=>{let l=c._getGlobalPcbPositionAfterLayout();return Math.hypot(l.x-s.x,l.y-s.y)<0.000001});if(!(a?a.enabled:r))continue;for(let c of s.layers)i.push({x:s.x,y:s.y,layer:c,diameter:s.outer_diameter})}return i}function WRr({selector:e,selectors:t,props:n}){if(e===t[0])return n.pcbTeardropStart??n.pcbTeardrops??!1;if(e===t.at(-1))return n.pcbTeardropEnd??n.pcbTeardrops??!1;return n.pcbTeardrops??!1}function XRr({root:e,enabledPorts:t}){let n=[];for(let{port:o,enabled:r}of t){if(!r||!o.pcb_port_id)continue;for(let i of e.db.pcb_smtpad.list({pcb_port_id:o.pcb_port_id})){if(i.shape==="polygon")continue;n.push({x:i.x,y:i.y,layer:i.layer,diameter:YRr(i)})}for(let i of e.db.pcb_plated_hole.list({pcb_port_id:o.pcb_port_id})){if(i.shape!=="circle")continue;for(let s of i.layers)n.push({x:i.x,y:i.y,layer:s,diameter:i.outer_diameter})}}return n}function dgn(e){if(!e.root||e.root.pcbDisabled||!e.source_trace_id)return;let{root:t,source_trace_id:n,_parsedProps:o}=e,r=new Map,s=Boolean(o.pcbTeardrops||o.pcbTeardropStart||o.pcbTeardropEnd)?e._findConnectedPorts():void 0;if(s?.allPortsFound){let a=e._getTracePortOrNetSelectorListFromProps(),c=s.portsWithSelectors.map(({port:h,selector:d})=>({port:h,enabled:WRr({selector:d,selectors:a,props:o})})),l=XRr({root:t,enabledPorts:c});for(let h of GRr({root:t,sourceTraceId:n}))r.set(h.pcb_trace_id,URr({root:t,pcbTrace:h,enabledPorts:c,padContacts:l,enableUnmatchedVias:o.pcbTeardrops??!1}))}VRr({root:t,sourceTraceId:n,contactsByPcbTraceId:r})}var hot=(e)=>e.map((t)=>{let{circuitJsonMetadata:n,...o}=t;if(o.route_type!=="via")return o;let{layers:r,...i}=o;return i}),dot=({component:e,subcircuit:t})=>{e._pcbTraceRenderWaitingForPlacementChecks=!1;let n=e,o=0,r=null,i=!1;while(n){if("_pcbPlacementDrcErrorCount"in n){if("_pcbPlacementDrcChecksPending"in n&&n._pcbPlacementDrcChecksPending===!0){i=!0;break}if(typeof n._pcbPlacementDrcErrorCount==="number"){o=n._pcbPlacementDrcErrorCount;break}if("_pcbPlacementDrcCheckError"in n&&typeof n._pcbPlacementDrcCheckError==="string"){r=n._pcbPlacementDrcCheckError;break}}n=n.parent}if(i)return e._pcbTraceRenderWaitingForPlacementChecks=!0,!0;if(o===0&&!r)return!1;let{db:s}=e.root,a=`pcb_autorouting_skipped_placement_errors_${t.subcircuit_id}`;if(!s.pcb_autorouting_error.list().some((l)=>l.pcb_error_id===a))s.pcb_autorouting_error.insert({pcb_error_id:a,error_type:"pcb_autorouting_error",subcircuit_id:t.subcircuit_id??void 0,message:r?`Autorouting was skipped because PCB placement checks could not be completed: ${r}`:`Autorouting was skipped because ${o} PCB placement error${o===1?" was":"s were"} found. Fix the placement errors or set placementDrcChecksDisabled to true to route anyway.`});return!0},jRr=0.000001,KRr=(e)=>{let t=0;for(let n=0;n<e.length;n++){let o=e[n];for(let r=n+1;r<e.length;r++){let i=e[r];t=Math.max(t,Math.hypot(i.x-o.x,i.y-o.y))}}return t},$Rr=(e,t)=>{let n=Number.POSITIVE_INFINITY;for(let o of e)for(let r of t)n=Math.min(n,Math.hypot(r.x-o.x,r.y-o.y));return n},qRr=({component:e,subcircuit:t})=>{let{db:n}=e.root,o=n.source_trace.list().filter((a)=>a.subcircuit_id===t.subcircuit_id),r=new fx({});r.addConnections(o.map((a)=>[a.source_trace_id,...a.connected_source_port_ids,...a.connected_source_net_ids]));let i=new Map;for(let a of n.pcb_port.list()){if(typeof a.source_port_id!=="string"||typeof a.x!=="number"||typeof a.y!=="number")continue;i.set(a.source_port_id,{pcb_port_id:a.pcb_port_id,source_port_id:a.source_port_id,x:a.x,y:a.y})}let s=[];for(let a of o){if(typeof a.max_length!=="number")continue;let c=a.connected_source_port_ids.map((h)=>i.get(h)).filter((h)=>Boolean(h)),l;if(c.length>=2)l=KRr(c);else{if(c.length!==1||a.connected_source_net_ids.length===0)continue;let h=r.getNetConnectedToId(a.source_trace_id);if(!h)continue;let u=r.getIdsConnectedToNet(h).filter((p)=>!a.connected_source_port_ids.includes(p)&&i.has(p)).map((p)=>i.get(p)).filter((p)=>Boolean(p));if(u.length===0)continue;if(n.toArray().some((p)=>(p.type==="source_pcb_ground_plane"||p.type==="pcb_ground_plane"||p.type==="pcb_copper_pour")&&typeof p.source_net_id==="string"&&r.areIdsConnected(a.source_trace_id,p.source_net_id)))continue;l=$Rr(c,u)}if(l<=a.max_length+jRr)continue;s.push({sourceTraceId:a.source_trace_id,traceDisplayName:a.display_name,straightLineDistance:l,maximumTraceLength:a.max_length})}return s},uot=({component:e,subcircuit:t})=>{let n=qRr({component:e,subcircuit:t});if(n.length===0)return!1;let{db:o}=e.root,r=`pcb_autorouting_skipped_trace_length_violations_${t.subcircuit_id}`;if(!o.pcb_autorouting_error.list().some((s)=>s.pcb_error_id===r)){let s=n[0],a=s.traceDisplayName??s.sourceTraceId,c=n.length-1,l=c>0?` (${c} additional violation${c===1?"":"s"})`:"";o.pcb_autorouting_error.insert({pcb_error_id:r,error_type:"pcb_autorouting_error",subcircuit_id:t.subcircuit_id??void 0,message:`Autorouting was skipped because the ${s.maximumTraceLength}mm maximum length for ${a} cannot be satisfied: its endpoints are ${s.straightLineDistance.toFixed(2)}mm apart${l}.`})}return!0},g9e=(e)=>({...e._getGlobalPcbPositionAfterLayout(),layers:e.getAvailablePcbLayers()}),JRr=!1,ugn=(e,t)=>{let n=lk(e);return Math.hypot(n.x-t.x,n.y-t.y)},ZRr=(e,t)=>{if(e.length<2)return e;let n=e[0],o=e[e.length-1];return ugn(o,t)<ugn(n,t)?qve(e):e};function eQr(e){if(e.root?.pcbDisabled)return;let{db:t}=e.root,{_parsedProps:n,parent:o}=e,r=e.getSubcircuit(),i=e._getBoard(),s=i?.pcb_board_id?t.pcb_board.get(i.pcb_board_id):void 0;if(!o)throw Error("Trace has no parent");if(e.root?.pcbRoutingDisabled||r.getInheritedProperty("routingDisabled"))return;if(r._isInflatedFromCircuitJson)return;let a=r._parsedProps.pcbRouteCache?.pcbTraces;if(a){if(r._isLegacyAutorouterDisabled())return;let U=t.pcb_trace.insert({route:a.flatMap((j)=>j.route),source_trace_id:e.source_trace_id,subcircuit_id:r?.subcircuit_id??void 0,pcb_group_id:e.getGroup()?.pcb_group_id??void 0});e.pcb_trace_id=U.pcb_trace_id;return}if(n.pcbPath&&n.pcbPath.length>0)return;if(n.pcbPaths!==void 0)return;if(n.pcbStraightLine)return;if(!r._shouldUseTraceByTraceRouting())return;let c,l,h;try{let U=e._findConnectedPorts();c=U.allPortsFound,l=U.ports??[],h=U.portsWithSelectors??[]}catch(U){if(U instanceof vY){t.source_trace_not_connected_error.insert({...U.errorData,error_type:"source_trace_not_connected_error"}),e._couldNotFindPort=!0;return}throw U}let d=[];if(!c)return;let u=h.map(({selector:U,port:j})=>n8e(U,j)).find(Boolean);if(u){t.pcb_trace_error.insert({error_type:"pcb_trace_error",source_trace_id:e.source_trace_id,message:u,pcb_trace_id:e.pcb_trace_id,pcb_component_ids:[],pcb_port_ids:l.map((U)=>U.pcb_port_id).filter(Boolean)});return}let _=[];for(let U of l)if(!U._hasMatchedPcbPrimitive())_.push(U);if(_.length>0){t.pcb_trace_error.insert({error_type:"pcb_trace_error",source_trace_id:e.source_trace_id,message:`Some ports did not have a matching PCB primitive (e.g. a pad or plated hole), this can happen if a footprint is missing. As a result, ${e} wasn't routed. Missing ports: ${_.map((U)=>U.getString()).join(", ")}`,pcb_trace_id:e.pcb_trace_id,pcb_component_ids:[],pcb_port_ids:_.map((U)=>U.pcb_port_id).filter(Boolean)});return}let p=dot({component:e,subcircuit:r}),m=uot({component:e,subcircuit:r});if(p||m)return;let A=e._findConnectedNets().netsWithSelectors;if(l.length===0&&A.length===2){let[U,j]=A.map(({net:ee})=>ee),Y=U.getAllConnectedPorts(),X=j.getAllConnectedPorts();if(Y.length===0||X.length===0){console.log("Nothing to connect this net to, one of the nets is empty. TODO should emit a warning!");return}let K=[Y[0],X[0]],J=1/0;for(let ee of Y){let se=tgn(ee,X),ne=ee._getGlobalPcbPositionBeforeLayout(),re=se._getGlobalPcbPositionBeforeLayout(),Z=Math.sqrt((ne.x-re.x)**2+(ne.y-re.y)**2);if(Z<J)J=Z,K=[ee,se]}l.push(...K)}else if(l.length===1&&A.length===1){let U=l[0],Y=A[0].net.getAllConnectedPorts().filter((K)=>K!==U);if(Y.length===0){console.log("Nothing to connect this port to, the net is empty. TODO should emit a warning!");return}let X=tgn(U,Y);d.push(X),l.push(X)}else if(l.length>1&&A.length>=1){e.renderError("Trace has more than one port and one or more nets, we don't currently support this type of complex trace routing");return}let g=l.flatMap((U)=>U.matchedComponents.filter((j)=>j.componentName==="TraceHint")),f=(e._parsedProps.pcbRouteHints??[]).concat(g.flatMap((U)=>U.getPcbRouteHints()));if(l.length>2){e.renderError(`Trace has more than two ports (${l.map((U)=>U.getString()).join(", ")}), routing between more than two ports for a single trace is not implemented`);return}if(e.getSubcircuit().selectAll("trace").filter((U)=>U.renderPhaseStates.PcbTraceRender.initialized).some((U)=>U._portsRoutedOnPcb.length===l.length&&U._portsRoutedOnPcb.every((j)=>l.includes(j))))return;let C=[];if(f.length===0)C=[g9e(l[0]),g9e(l[1])];else C=[g9e(l[0]),...f,g9e(l[1])];let b=LNr(C,{layerSelectionPreference:bit(r._getSubcircuitLayerCount())});if(JRr&&b.length===0){e.renderError(`Could not find a common layer (using hints) for trace ${e.getString()}`);return}let I=oa(e.root.db.toArray()),[v,P]=mRr(()=>l5n(e.root.db.toArray()));if(P){e.renderError({type:"pcb_trace_error",error_type:"pcb_trace_error",pcb_trace_error_id:e.pcb_trace_id,message:`Error getting obstacles for autorouting: ${P.message}`,source_trace_id:e.source_trace_id,center:{x:0,y:0},pcb_port_ids:l.map((U)=>U.pcb_port_id),pcb_trace_id:e.pcb_trace_id,pcb_component_ids:[]});return}for(let U of v)if(U.connectedTo.length>0){let Y=I.getNetConnectedToId(U.connectedTo[0]);if(Y)U.connectedTo.push(Y)}let M=[];if(b.length===0)M=C;else{let U=b[0].layer_path;M=C.map((j,Y)=>{if(j.via)return{...j,via_to_layer:U[Y]};return{...j,layers:[U[Y]]}})}M[0].pcb_port_id=l[0].pcb_port_id,M[M.length-1].pcb_port_id=l[1].pcb_port_id;let B=[];for(let[U,j]of a5n(M)){let Y="via_to_layer"in U?U.via_to_layer:null,X=2,K="layers"in U&&U.layers.length===1?U.layers[0]:Y??"top",J="layers"in j&&j.layers.length===1?j.layers[0]:Y??"top",ee="pcb_port_id"in U?U.pcb_port_id:null,se="pcb_port_id"in j?j.pcb_port_id:null,ne=e._getExplicitTraceThickness()??e.getSubcircuit()._parsedProps.minTraceWidth??Pb.min_trace_width,re=new F5e({OBSTACLE_MARGIN:ne*2,isRemovePathLoopsEnabled:!0,optimizeWithGoalBoxes:Boolean(ee&&se),connMap:I,input:{obstacles:v,minTraceWidth:ne,connections:[{name:e.source_trace_id,pointsToConnect:[{...U,layer:K,pcb_port_id:ee},{...j,layer:J,pcb_port_id:se}]}],layerCount:e.getSubcircuit()._getSubcircuitLayerCount(),bounds:{minX:Math.min(U.x,j.x)-2,maxX:Math.max(U.x,j.x)+2,minY:Math.min(U.y,j.y)-2,maxY:Math.max(U.y,j.y)+2}}}),Z=null;try{Z=re.solveAndMapToTraces()}catch(ce){e.renderError({type:"pcb_trace_error",pcb_trace_error_id:e.source_trace_id,error_type:"pcb_trace_error",message:`error solving route: ${ce.message}`,source_trace_id:e.pcb_trace_id,center:{x:(U.x+j.x)/2,y:(U.y+j.y)/2},pcb_port_ids:l.map((ue)=>ue.pcb_port_id),pcb_trace_id:e.pcb_trace_id,pcb_component_ids:l.map((ue)=>ue.pcb_component_id)})}if(!Z)return;if(Z.length===0){e.renderError({type:"pcb_trace_error",error_type:"pcb_trace_error",pcb_trace_error_id:e.pcb_trace_id,message:`Could not find a route for ${e}`,source_trace_id:e.source_trace_id,center:{x:(U.x+j.x)/2,y:(U.y+j.y)/2},pcb_port_ids:l.map((ce)=>ce.pcb_port_id),pcb_trace_id:e.pcb_trace_id,pcb_component_ids:l.map((ce)=>ce.pcb_component_id)});return}let[te]=Z;if(te.route=ZRr(te.route,U),Y)te.route=te.route.map((ce)=>{if(ce.route_type==="wire"&&!ce.layer)ce.layer=Y;return ce});if(ee&&te.route[0].route_type==="wire")te.route[0].start_pcb_port_id=ee;let ie=te.route[te.route.length-1];if(se&&ie.route_type==="wire")ie.end_pcb_port_id=se;B.push(te.route)}let T=HNr(B),N=t8e(T),D=e.getInheritedMergedProperty("pcbStyle"),{holeDiameter:L,padDiameter:H}=gB(D),V=t.pcb_trace.insert({route:hot(T),source_trace_id:e.source_trace_id,subcircuit_id:e.getSubcircuit()?.subcircuit_id,trace_length:N}),O=e.subcircuit_connectivity_map_key??t.source_trace.get(e.source_trace_id)?.subcircuit_connectivity_map_key;e._portsRoutedOnPcb=l,e.pcb_trace_id=V.pcb_trace_id;for(let U of T)if(U.route_type==="via"){let j=U,{from_layer:Y,to_layer:X}=U;t.pcb_via.insert({pcb_trace_id:V.pcb_trace_id,x:U.x,y:U.y,hole_diameter:L,outer_diameter:H,layers:c5n({fromLayer:Y,toLayer:X,layerCount:r._getSubcircuitLayerCount(),allowBlindAndBuriedVias:s?.allow_blind_and_buried_vias??!1,physicalLayers:j.layers}),from_layer:Y,to_layer:X,subcircuit_id:r?.subcircuit_id??void 0,pcb_group_id:e.getGroup()?.pcb_group_id??void 0,subcircuit_connectivity_map_key:O})}e._insertErrorIfTraceIsOutsideBoard(T,l)}var o8e=(e)=>{switch(e){case"up":return"y+";case"down":return"y-";case"left":return"x-";case"right":return"x+";default:}},Sit=({db:e,source_trace_id:t,schematic_sheet_id:n,sameNetOnly:o,differentNetOnly:r})=>{if(!o&&!r)r=!0;let i=e.source_trace.get(t),s=[];for(let a of e.schematic_trace.list()){if(a.source_trace_id===t)continue;if(n!==void 0&&a.schematic_sheet_id!==n)continue;let l=e.source_trace.get(a.source_trace_id)?.subcircuit_connectivity_map_key===i.subcircuit_connectivity_map_key;if(r&&l)continue;if(o&&!l)continue;s.push(a)}return s},tQr=({edges:e,otherEdges:t})=>{let n=[...e];for(let o=0;o<n.length;o++){if(o>2000)throw Error("Over 2000 iterations spent inside createSchematicTraceCrossingSegments, you have triggered an infinite loop, please report this!");let r=n[o],i=Math.abs(r.from.x-r.to.x)<0.01?"vertical":r.from.y===r.to.y?"horizontal":"not-orthogonal";if(i==="not-orthogonal")continue;let s=[];for(let m of t){let A=m.from.x===m.to.x?"vertical":m.from.y===m.to.y?"horizontal":"not-orthogonal";if(A==="not-orthogonal")continue;if(i===A)continue;if(iR([r.from,r.to],[m.from,m.to],{lineThickness:0.01})){let f=i==="vertical"?r.from.x:m.from.x,y=i==="vertical"?m.from.y:r.from.y,x={x:f,y};s.push({otherEdge:m,crossingPoint:x,distanceFromEdgeFrom:Tl(r.from,x)})}}if(s.length===0)continue;let a=s[0];for(let m of s)if(m.distanceFromEdgeFrom<a.distanceFromEdgeFrom)a=m;let c=a.crossingPoint,l=0.075;if(c.x===r.from.x&&c.y===r.from.y)continue;let h=qj(r.from,c),d={x:c.x-h.x*l/2,y:c.y-h.y*l/2},u={x:c.x+h.x*l/2,y:c.y+h.y*l/2},_=Tl(u,r.to)<l,p=[{from:r.from,to:d},{from:d,to:u,is_crossing:!0},{from:u,to:r.to}];if(n.splice(o,1,...p),o+=p.length-2,_)o++}return n},pot=0.001,pJ=(e,t)=>{let n=Math.min(t.from.x,t.to.x),o=Math.max(t.from.x,t.to.x),r=Math.min(t.from.y,t.to.y),i=Math.max(t.from.y,t.to.y);return e.x>=n&&e.x<=o&&e.y>=r&&e.y<=i},pgn=(e)=>{let t=Math.abs(e.from.x-e.to.x)<pot,n=Math.abs(e.from.y-e.to.y)<pot;if(t)return"vertical";if(n)return"horizontal";return"diagonal"},nQr=(e,t)=>{let n=pgn(e),o=pgn(t);if(n===o)return null;if(n==="vertical"&&o==="horizontal"||n==="horizontal"&&o==="vertical"){let d=n==="vertical"?e:t,u=n==="horizontal"?e:t,_=d.from.x,p=u.from.y,m={x:_,y:p};return pJ(m,e)&&pJ(m,t)?m:null}if(n==="vertical"||o==="vertical"){let d=n==="vertical"?e:t,u=n==="vertical"?t:e,_=d.from.x,p=(u.to.y-u.from.y)/(u.to.x-u.from.x),m=u.from.y-p*u.from.x,A=p*_+m,g={x:_,y:A};return pJ(g,e)&&pJ(g,t)?g:null}let r=(e.to.y-e.from.y)/(e.to.x-e.from.x),i=e.from.y-r*e.from.x,s=(t.to.y-t.from.y)/(t.to.x-t.from.x),a=t.from.y-s*t.from.x;if(Math.abs(r-s)<pot)return null;let c=(a-i)/(r-s),l=r*c+i,h={x:c,y:l};return pJ(h,e)&&pJ(h,t)?h:null},mgn=({edges:e,db:t,source_trace_id:n,schematic_sheet_id:o})=>{let r=Sit({db:t,source_trace_id:n,schematic_sheet_id:o,sameNetOnly:!0}).flatMap((s)=>s.edges),i=new Map;for(let s of e)for(let a of r){let c=nQr(s,a);if(c){let l=`${c.x.toFixed(6)},${c.y.toFixed(6)}`;if(!i.has(l))i.set(l,c)}}return Array.from(i.values())};function _gn(e){let t=e%360;return t<0?t+360:t}function oQr(e,t,n,o){if(o==="counterclockwise"){if(n>=t)return e>=t&&e<=n;return e>=t||e<=n}if(n<=t)return e<=t&&e>=n;return e<=t||e>=n}function rQr(e){let{center:t,radius:n,start_angle_degrees:o,end_angle_degrees:r}=e,i=e.direction??"counterclockwise";if(!t||typeof t.x!=="number"||typeof t.y!=="number"||typeof n!=="number"||typeof o!=="number"||typeof r!=="number")return null;let s=_gn(o),a=_gn(r),c=new Set([s,a]),l=[0,90,180,270];for(let p of l)if(oQr(p,s,a,i))c.add(p);let h=1/0,d=1/0,u=-1/0,_=-1/0;for(let p of c){let m=p*Math.PI/180,A=t.x+n*Math.cos(m),g=t.y+n*Math.sin(m);h=Math.min(h,A),u=Math.max(u,A),d=Math.min(d,g),_=Math.max(_,g)}if(!Number.isFinite(h)||!Number.isFinite(d))return null;return{minX:h,maxX:u,minY:d,maxY:_}}function bue(e){let t=1/0,n=1/0,o=-1/0,r=-1/0;for(let i of e){let s,a,c,l;if(i.type==="schematic_component")s=i.center?.x,a=i.center?.y,c=i.size?.width,l=i.size?.height;else if(i.type==="schematic_box")s=i.x,a=i.y,c=i.width,l=i.height;else if(i.type==="schematic_port")s=i.center?.x,a=i.center?.y,c=0.2,l=0.2;else if(i.type==="schematic_text")s=i.position?.x,a=i.position?.y,c=(i.text?.length??0)*0.1,l=0.2;else if(i.type==="schematic_line"){let h=i.x1??0,d=i.y1??0,u=i.x2??0,_=i.y2??0;s=(h+u)/2,a=(d+_)/2,c=Math.abs(u-h),l=Math.abs(_-d)}else if(i.type==="schematic_rect"){if(s=i.center?.x,a=i.center?.y,c=i.width,l=i.height,i.rotation&&s!==void 0&&a!==void 0&&c!==void 0&&l!==void 0){let h=Lk.compose(Lk.translate(s,a),Lk.rotateDEG(i.rotation));for(let d of[-c/2,c/2])for(let u of[-l/2,l/2]){let _=Lk.applyToPoint(h,{x:d,y:u});t=Math.min(t,_.x),o=Math.max(o,_.x),n=Math.min(n,_.y),r=Math.max(r,_.y)}continue}}else if(i.type==="schematic_circle"){s=i.center?.x,a=i.center?.y;let h=i.radius;if(typeof h==="number")c=h*2,l=h*2}else if(i.type==="schematic_arc"){let h=rQr(i);if(h)t=Math.min(t,h.minX),o=Math.max(o,h.maxX),n=Math.min(n,h.minY),r=Math.max(r,h.maxY);continue}else if(i.type==="schematic_path"){let h=i.points;if(Array.isArray(h)){for(let d of h)if(typeof d.x==="number"&&typeof d.y==="number")t=Math.min(t,d.x),o=Math.max(o,d.x),n=Math.min(n,d.y),r=Math.max(r,d.y)}continue}if(typeof s==="number"&&typeof a==="number"&&typeof c==="number"&&typeof l==="number")t=Math.min(t,s-c/2),o=Math.max(o,s+c/2),n=Math.min(n,a-l/2),r=Math.max(r,a+l/2)}return{minX:t,maxX:o,minY:n,maxY:r}}function iQr(e,t={}){let{minX:n,maxX:o,minY:r,maxY:i}=e,s=t.padding??1;if(!isFinite(n)||!isFinite(o)||!isFinite(r)||!isFinite(i))return[];let a=n-s,c=o+s,l=i+s,h=r-s,d=0.01;return[{type:"rect",layers:["top"],center:{x:(a+c)/2,y:l},width:c-a,height:d,connectedTo:[]},{type:"rect",layers:["top"],center:{x:(a+c)/2,y:h},width:c-a,height:d,connectedTo:[]},{type:"rect",layers:["top"],center:{x:a,y:(l+h)/2},width:d,height:l-h,connectedTo:[]},{type:"rect",layers:["top"],center:{x:c,y:(l+h)/2},width:d,height:l-h,connectedTo:[]}]}var sQr=(e)=>{let t=e.root.db,n=e._findConnectedPorts().ports??[],o=new Set(n.map((s)=>s.schematic_port_id)),r=[];for(let s of t.toArray()){if(s.type==="schematic_component"){let a=Boolean(s.symbol_name),c=s.size.width>s.size.height?"horz":"vert";r.push({type:"rect",layers:["top"],center:s.center,width:s.size.width+(a&&c==="horz"?-0.5:0),height:s.size.height+(a&&c==="vert"?-0.5:0),connectedTo:[]})}if(s.type==="schematic_port"){if(o.has(s.schematic_port_id))continue;let a=s.facing_direction?m7(s.facing_direction):{x:0,y:0};r.push({type:"rect",layers:["top"],center:{x:s.center.x-a.x*0.1,y:s.center.y-a.y*0.1},width:0.1+Math.abs(a.x)*0.3,height:0.1+Math.abs(a.y)*0.3,connectedTo:[]})}if(s.type==="schematic_text")r.push({type:"rect",layers:["top"],center:s.position,width:(s.text?.length??0)*0.1,height:0.2,connectedTo:[]});if(s.type==="schematic_box")r.push({type:"rect",layers:["top"],center:{x:s.x,y:s.y},width:s.width,height:s.height,connectedTo:[]})}let i=bue(t.toArray());return r.push(...iQr(i,{padding:1})),r},aQr=({edges:e,db:t,source_trace_id:n,schematic_sheet_id:o})=>{let r=Sit({db:t,source_trace_id:n,schematic_sheet_id:o,differentNetOnly:!0}).flatMap((s)=>s.edges),i=(s)=>{let{from:a,to:c}=s;return a.x===c.x?"vertical":"horizontal"};for(let s of e){let a=i(s),c=()=>r.find((h)=>i(h)===a&&iR([s.from,s.to],[h.from,h.to],{lineThickness:0.05})),l=c();while(l){if(a==="horizontal")s.from.y+=0.1,s.to.y+=0.1;else s.from.x+=0.1,s.to.x+=0.1;l=c()}}},cQr=(e)=>{if(e.root?._featureMspSchematicTraceRouting)return;if(e._couldNotFindPort)return;if(e.root?.schematicDisabled)return;if(e.getCollapsedSchematicBoxAncestor())return;let{db:t}=e.root,{_parsedProps:n,parent:o}=e,r=e._getSchematicNetLabelText(),i=e._resolveSchematicSheetId();if(!o)throw Error("Trace has no parent");let s,a;try{let O=e._findConnectedPorts();s=O.allPortsFound,a=O.portsWithSelectors??[]}catch(O){if(O instanceof vY){t.source_trace_not_connected_error.insert({...O.errorData,error_type:"source_trace_not_connected_error"});return}throw O}let{netsWithSelectors:c}=e._findConnectedNets();if(!s)return;let l=(O)=>{if(i&&O.source_port_id){let U=t.schematic_port.getWhere({source_port_id:O.source_port_id,schematic_sheet_id:i});if(U)return U}if(O.schematic_port_id)return t.schematic_port.get(O.schematic_port_id)??null;if(!i&&O.source_port_id){let U=t.schematic_port.list({source_port_id:O.source_port_id}).filter((j)=>!j.schematic_sheet_id);if(U.length===1)return U[0]}return null},h=a.flatMap(({port:O})=>{let U=l(O);if(!U)return[];return[{port:O,position:U.center,schematic_port_id:U.schematic_port_id,facingDirection:U.facing_direction??null}]}),d=h.map(({schematic_port_id:O})=>O).sort(),u=h.some(({port:O,schematic_port_id:U})=>O.schematic_port_id!==U),_=d.join(","),p=e.root?._getBoard();if(p?._connectedSchematicPortPairs){if(p._connectedSchematicPortPairs.has(_))return}let m={name:e.source_trace_id,pointsToConnect:[]},A=sQr(e);if(h.length===1&&c.length===1){let O=c[0].net,{port:U,position:j}=h[0],Y=e.getSubcircuit().selectAll("netlabel").find((J)=>{let ee=J._parsedProps.connection??J._parsedProps.connectsTo;if(!ee)return!1;if(Array.isArray(ee))return ee.some((ne)=>e.getSubcircuit().selectOne(ne,{port:!0})===U);return e.getSubcircuit().selectOne(ee,{port:!0})===U});if(!Y){let J=t.schematic_net_label.getWhere({source_trace_id:e.source_trace_id});if(J)Y=J}if(Y){let J="_getGlobalSchematicPositionBeforeLayout"in Y?Y._getGlobalSchematicPositionBeforeLayout():Y.anchor_position,ee=[];if(j.x===J.x||j.y===J.y)ee.push({from:j,to:J});else ee.push({from:j,to:{x:J.x,y:j.y}}),ee.push({from:{x:J.x,y:j.y},to:J});let se=mgn({edges:ee,db:t,source_trace_id:e.source_trace_id,schematic_sheet_id:i}),ne=t.schematic_trace.insert({source_trace_id:e.source_trace_id,edges:ee,junctions:se,subcircuit_connectivity_map_key:e.subcircuit_connectivity_map_key??void 0,schematic_sheet_id:i});e.schematic_trace_id=ne.schematic_trace_id;return}if(r){let J=jJ(U.facingDirection)??"bottom";t.schematic_net_label.insert({text:r,source_net_id:O.source_net_id,anchor_position:j,center:FS({anchor_position:j,anchor_side:J,text:r}),anchor_side:J,schematic_sheet_id:e._resolveSchematicSheetId()});return}let X=jJ(U.facingDirection)??"bottom",K=t.schematic_net_label.insert({text:O._parsedProps.name,source_net_id:O.source_net_id,anchor_position:j,center:FS({anchor_position:j,anchor_side:X,text:O._parsedProps.name}),anchor_side:X,schematic_sheet_id:e._resolveSchematicSheetId()});return}if(r&&!u){if("from"in e.props&&"to"in e.props||"path"in e.props){e._doInitialSchematicTraceRenderWithDisplayLabel();return}}if(h.length<2)return;let y=(()=>{let O=[];for(let j=0;j<h.length-1;j++){let Y=h[j],X=h[j+1],K=oz({x:Y.position.x,y:Y.position.y,facingDirection:o8e(Y.facingDirection)},{x:X.position.x,y:X.position.y,facingDirection:o8e(X.facingDirection)});for(let J=0;J<K.length-1;J++)O.push({from:K[J],to:K[J+1]})}let U=(j,Y)=>{let X=Y.width/2,K=Y.height/2,J=Y.center.x-X,ee=Y.center.x+X,se=Y.center.y-K,ne=Y.center.y+K,re=(te)=>te.x>=J&&te.x<=ee&&te.y>=se&&te.y<=ne;if(re(j.from)||re(j.to))return!0;return[[{x:J,y:se},{x:ee,y:se}],[{x:ee,y:se},{x:ee,y:ne}],[{x:ee,y:ne},{x:J,y:ne}],[{x:J,y:ne},{x:J,y:se}]].some((te)=>iR([j.from,j.to],te,{lineThickness:0}))};for(let j of O)for(let Y of A)if(U(j,Y))return null;return O})();if(y&&y.length===0)y=null;m.pointsToConnect=h.map(({position:O})=>({...O,layer:"top"}));let x=QNr(A),C=2,b={minTraceWidth:0.1,obstacles:A,connections:[m],bounds:{minX:x.minX-C,maxX:x.maxX+C,minY:x.minY-C,maxY:x.maxY+C},layerCount:1},I=F5e,v=!1;if(e.getSubcircuit().props._schDirectLineRoutingEnabled)I=K_n,v=!0;if(!y){let U=new I({input:b,MAX_ITERATIONS:100,OBSTACLE_MARGIN:0.1,isRemovePathLoopsEnabled:!0,isShortenPathWithShortcutsEnabled:!0,marginsWithCosts:[{margin:1,enterCost:0,travelCostFactor:1},{margin:0.3,enterCost:0,travelCostFactor:1},{margin:0.2,enterCost:0,travelCostFactor:2},{margin:0.1,enterCost:0,travelCostFactor:3}]}).solveAndMapToTraces();if(U.length===0){if(!u&&(e._isSymbolToChipConnection()||e._isSymbolToSymbolConnection()||e._isChipToChipConnection())){e._doInitialSchematicTraceRenderWithDisplayLabel();return}U=new K_n({input:b}).solveAndMapToTraces(),v=!0}let[{route:j}]=U;y=[];let Y=j.filter((X)=>X.route_type==="wire"||X.route_type==="via");for(let X=0;X<Y.length-1;X++)y.push({from:Y[X],to:Y[X+1]})}let P=e.source_trace_id,M=[];if(!v){aQr({edges:y,db:t,source_trace_id:P,schematic_sheet_id:i});let O=Sit({db:t,source_trace_id:P,schematic_sheet_id:i,differentNetOnly:!0}).flatMap((U)=>U.edges);y=tQr({edges:y,otherEdges:O}),M=mgn({edges:y,db:t,source_trace_id:e.source_trace_id,schematic_sheet_id:i})}if(!y||y.length===0)return;let B=y[y.length-1],T=h[h.length-1],N=$_n(B);y.push(...aot({lastEdge:B,lastEdgePort:T,lastDominantDirection:N}));let D=y[0],L=h[0],H=$_n(D);if(y.unshift(...aot({firstEdge:D,firstEdgePort:L,firstDominantDirection:H})),!e.source_trace_id)throw Error("Missing source_trace_id for schematic trace insertion.");if(!u&&e.getSubcircuit()._parsedProps.schTraceAutoLabelEnabled&&pRr(M,y)>=5&&(e._isSymbolToChipConnection()||e._isSymbolToSymbolConnection()||e._isChipToChipConnection())){e._doInitialSchematicTraceRenderWithDisplayLabel();return}let V=t.schematic_trace.insert({source_trace_id:e.source_trace_id,edges:y,junctions:M,subcircuit_connectivity_map_key:e.subcircuit_connectivity_map_key??void 0,schematic_sheet_id:i});e.schematic_trace_id=V.schematic_trace_id;for(let{schematic_port_id:O}of h)t.schematic_port.update(O,{is_connected:!0});if(p?._connectedSchematicPortPairs)p._connectedSchematicPortPairs.add(_)},lQr=(e,{db:t})=>{let n=e.map((o)=>{let r=t.source_port.get(o.source_port_id);if(!r?.source_component_id)return null;let i=t.source_component.get(r.source_component_id);if(i?.ftype==="simple_capacitor")return i.max_decoupling_trace_length;return null}).filter((o)=>typeof o==="number");if(n.length===0)return;return Math.min(...n)};function hQr({ports:e,nets:t}){if(e.length>=2)return`${e[0]?.selector} to ${e[1]?.selector}`;if(e.length===1&&t.length===1)return`${e[0]?.selector} to net.${t[0]._parsedProps.name}`;return}function dQr(e){let t=new Set;for(let{port:n}of e){if(!(n.parent instanceof m5n))continue;let o=n.parent._getConnectedNetOrTrace();if(o instanceof dB)t.add(o)}return[...t]}var d_=class extends nr{source_trace_id=null;pcb_trace_id=null;isAntennaTrace=!1;schematic_trace_id=null;_inflatedPcbTraces;_inflatedPcbVias;_portsRoutedOnPcb;subcircuit_connectivity_map_key=null;_exposesSubcircuitConnection=!1;_traceConnectionHash=null;_couldNotFindPort;constructor(e){super(e);this._portsRoutedOnPcb=[]}_getExplicitTraceThickness(){return this._parsedProps.thickness??this._parsedProps.width}_getSchematicNetLabelText(){return this._parsedProps.schDisplayLabel??this._parsedProps.displayName??this._parsedProps.name}get config(){return{zodProps:tDt,componentName:"Trace"}}_getTracePortOrNetSelectorListFromProps(){if("from"in this.props&&"to"in this.props)return[typeof this.props.from==="string"?this.props.from:this.props.from.getPortSelector(),typeof this.props.to==="string"?this.props.to:this.props.to.getPortSelector()];if("path"in this.props)return this.props.path.map((e)=>typeof e==="string"?e:e.getPortSelector());return[]}getTracePortPathSelectors(){return this._getTracePortOrNetSelectorListFromProps().filter((e)=>!e.includes("net."))}getTracePathNetSelectors(){return this._getTracePortOrNetSelectorListFromProps().filter((e)=>e.includes("net."))}_findConnectedPorts(){return TRr(this)}_resolveNet(e){let t=this.getSubcircuit().selectOne(e,{type:"net"});if(t)return t;let n=e.match(/^net\.(.+)$/),o=n?n[1]:null;if(!o)return null;let r=this.root?._getBoard();if(!r)return this.renderError(`Could not find a <board> ancestor for ${this}, so net "${e}" cannot be resolved`),null;return r.getDescendants().find((s)=>s.componentName==="Net"&&s._parsedProps.name===o)||null}_findConnectedNets(){let e=this.getTracePathNetSelectors().map((n)=>({selector:n,net:this._resolveNet(n)})),t=e.filter((n)=>!n.net);if(t.length>0)this.renderError(`Could not find net for selector "${t[0].selector}" inside ${this}`);return{netsWithSelectors:e,nets:e.map((n)=>n.net)}}_getAllTracesConnectedToSameNet(){let e=this.getSubcircuit().selectAll("trace"),t=this._findConnectedNets().nets,n=this._findConnectedPorts().ports??[];return e.filter((o)=>{if(o===this)return!1;let r=o._findConnectedNets().nets,i=o._findConnectedPorts().ports??[];return r.some((s)=>t.includes(s))||i.some((s)=>n.includes(s))})}_isExplicitlyConnectedToPort(e){let{allPortsFound:t,portsWithSelectors:n}=this._findConnectedPorts();if(!t)return!1;return n.map((r)=>r.port).includes(e)}_isExplicitlyConnectedToNet(e){return this._findConnectedNets().nets.includes(e)}doInitialCreateNetsFromProps(){Cue(this,this.getTracePathNetSelectors())}_computeTraceConnectionHash(){let{allPortsFound:e,ports:t}=this._findConnectedPorts();if(!e||!t)return null;return[...t].sort((r,i)=>(r.pcb_port_id||"").localeCompare(i.pcb_port_id||"")).map((r)=>r.pcb_port_id).join(",")}doInitialSourceTraceRender(){let{db:e}=this.root,{_parsedProps:t,parent:n}=this;if(!n){this.renderError("Trace has no parent");return}let o,r;try{let h=this._findConnectedPorts();o=h.allPortsFound,r=h.portsWithSelectors??[]}catch(h){if(h instanceof vY){e.source_trace_not_connected_error.insert({...h.errorData,error_type:"source_trace_not_connected_error"}),this._couldNotFindPort=!0;return}throw h}if(!o)return;this._traceConnectionHash=this._computeTraceConnectionHash();let s=e.source_trace.list().find((h)=>h.subcircuit_connectivity_map_key===this.subcircuit_connectivity_map_key&&[...h.connected_source_port_ids].sort().join(",")===this._traceConnectionHash);if(s){this.source_trace_id=s.source_trace_id;return}let a=this._findConnectedNets().nets;for(let h of dQr(r))if(!a.includes(h))a.push(h);let c=hQr({ports:r,nets:a}),l=e.source_trace.insert({connected_source_port_ids:r.map((h)=>h.port.source_port_id),connected_source_net_ids:a.map((h)=>h.source_net_id),subcircuit_id:this.getSubcircuit()?.subcircuit_id,name:t.name,max_length:t.maxLength??lQr(r.map((h)=>h.port),{db:e}),max_via_count:t.maxViaCount,display_name:t.displayName??c,min_trace_thickness:this._getExplicitTraceThickness()});if(this.source_trace_id=l.source_trace_id,!t.name&&a.length===0)e.source_unnamed_trace_warning.insert({message:`${this.getString()} is missing a name. Add a name prop to make the trace easier to identify.`,source_trace_id:l.source_trace_id,subcircuit_id:this.getSubcircuit()?.subcircuit_id??void 0,warning_type:"source_unnamed_trace_warning"})}_insertErrorIfTraceIsOutsideBoard(e,t){let{db:n}=this.root,o=this._getBoard();if(!o)return;let r=o.pcb_board_id;if(!r)return;if(nRr({mergedRoute:e,db:n,pcbBoardId:r}))n.pcb_trace_error.insert({error_type:"pcb_trace_error",source_trace_id:this.source_trace_id,message:`Trace ${this.getString()} routed outside the board boundaries.`,pcb_trace_id:this.pcb_trace_id,pcb_component_ids:[],pcb_port_ids:t.map((s)=>s.pcb_port_id)})}doInitialPcbManualTraceRender(){kRr(this)}doInitialPcbTraceTeardropRender(){dgn(this)}updatePcbTraceTeardropRender(){dgn(this)}doInitialPcbTraceRender(){eQr(this)}_doInitialSchematicTraceRenderWithDisplayLabel(){BRr(this)}_isSymbolToChipConnection(){let{allPortsFound:e,ports:t}=this._findConnectedPorts();if(!e||t.length!==2)return!1;let[n,o]=t;if(!n?.parent||!o?.parent)return!1;let r=n.parent.config.shouldRenderAsSchematicBox,i=o.parent.config.shouldRenderAsSchematicBox;return r&&!i||!r&&i}_isSymbolToSymbolConnection(){let{allPortsFound:e,ports:t}=this._findConnectedPorts();if(!e||t.length!==2)return!1;let[n,o]=t;if(!n?.parent||!o?.parent)return!1;let r=!n.parent.config.shouldRenderAsSchematicBox,i=!o.parent.config.shouldRenderAsSchematicBox;return r&&i}_isChipToChipConnection(){let{allPortsFound:e,ports:t}=this._findConnectedPorts();if(!e||t.length!==2)return!1;let[n,o]=t;if(!n?.parent||!o?.parent)return!1;let r=n.parent.config.shouldRenderAsSchematicBox,i=o.parent.config.shouldRenderAsSchematicBox;return r&&i}doInitialSchematicTraceRender(){cQr(this)}},r8e={},y5n=(e)=>{let t=Object.fromEntries(Object.entries(e).map(([n,o])=>[n.toLowerCase(),o]));Object.assign(r8e,e),Object.assign(r8e,t)},uQr=class extends nr{constructor(e,t){super(e);let n=(o,r)=>{if(typeof o==="number")return o;if(typeof o==="string")try{return this._resolvePcbCoordinate(o,r,{allowBoardVariables:!1})}catch(i){return 0}return 0};this._parsedProps={...e,error:t,type:e.type||"unknown",component_name:e.name,error_type:"source_failed_to_create_component_error",message:t instanceof Error?t.message:String(t),pcbX:n(e.pcbX,"pcbX"),pcbY:n(e.pcbY,"pcbY"),schX:e.schX,schY:e.schY}}formatErrorDetails(){let e=this._parsedProps.selector??this._parsedProps.selectors??this._parsedProps.in??this._parsedProps.within,t=e===void 0?void 0:typeof e==="string"?e:this.safeStringify(e),n=this.safeStringify(this._parsedProps);return{selectorText:t,propsText:n}}safeStringify(e){let t=new WeakSet,n=JSON.stringify(e,(o,r)=>{if(typeof r==="bigint")return r.toString();if(typeof r==="function")return`[Function ${r.name||"anonymous"}]`;if(typeof r==="symbol")return r.toString();if(typeof r==="object"&&r!==null){if(t.has(r))return"[Circular]";t.add(r)}return r},2);if(!n)return"undefined";if(n.length>2000)return`${n.slice(0,2000)}…`;return n}get config(){return{componentName:"ErrorPlaceholder",zodProps:we({}).passthrough()}}doInitialSourceRender(){if(this.root?.db){let e=this._getGlobalPcbPositionBeforeLayout(),t=this._getGlobalSchematicPositionBeforeLayout(),{selectorText:n,propsText:o}=this.formatErrorDetails(),r=[n?`Within selector: ${n}`:null,`Props: ${o}`].filter(Boolean).join(" "),i=`Could not create ${this._parsedProps.componentType??"component"}${this._parsedProps.name?` "${this._parsedProps.name}"`:""}. ${this._parsedProps.error?.formattedError?._errors?.join("; ")||this._parsedProps.message}`;this.root.db.source_failed_to_create_component_error.insert({component_name:this._parsedProps.component_name,error_type:"source_failed_to_create_component_error",message:`${i}${r?` Details: ${r}`:""}`,pcb_center:e,schematic_center:t})}}};function pQr(e,t){return new uQr(e,t)}function mQr(e,t){let n=e;return n.__tsci={...t},e}var _Qr={supportsMutation:!0,createInstance(e,t){let n=r8e[e];if(!n){if(Object.keys(r8e).length===0)throw Error("No components registered in catalogue, did you forget to import lib/register-catalogue in your test file?");throw Error(`Unsupported component type "${e}". No element with this name is registered in the @tscircuit/core catalogue. Check for typos or see https://docs.tscircuit.com/category/built-in-elements for a list of valid components. To add your own component, see docs/CREATING_NEW_COMPONENTS.md`)}try{return mQr(new n(t),{})}catch(o){return pQr({...t,componentType:e},o)}},createTextInstance(e){return{__text:e}},appendInitialChild(e,t){e.add(t)},appendChild(e,t){e.add(t)},appendChildToContainer(e,t){e.add(t)},finalizeInitialChildren(){return!1},prepareUpdate(){return null},shouldSetTextContent(){return!1},getRootHostContext(){return{}},getChildHostContext(){return{}},prepareForCommit(){return null},resetAfterCommit(){},commitMount(){},commitUpdate(){},removeChild(){},clearContainer(){},supportsPersistence:!1,getPublicInstance(e){return e},preparePortalMount(e){throw Error("Function not implemented.")},scheduleTimeout(e,t){throw Error("Function not implemented.")},cancelTimeout(e){throw Error("Function not implemented.")},noTimeout:void 0,isPrimaryRenderer:!1,getInstanceFromNode(e){throw Error("Function not implemented.")},beforeActiveInstanceBlur(){throw Error("Function not implemented.")},afterActiveInstanceBlur(){throw Error("Function not implemented.")},prepareScopeUpdate:(e,t)=>{throw Error("Function not implemented.")},getInstanceFromScope:(e)=>{throw Error("Function not implemented.")},detachDeletedInstance:(e)=>{throw Error("Function not implemented.")},getCurrentEventPriority:()=>Mve.DefaultEventPriority,getCurrentUpdatePriority:()=>Mve.DefaultEventPriority,resolveUpdatePriority:()=>Mve.DefaultEventPriority,setCurrentUpdatePriority:()=>{},maySuspendCommit:()=>!1,supportsHydration:!1},A9e=f5n.default(_Qr),Iue=(e)=>{let t={children:[],props:{name:"$root"},add(i){i.parent=this,this.children.push(i)},computePcbGlobalTransform(){return x5n.identity()}},n=[],o=A9e.createContainer(t,0,null,!1,null,"tsci",(i)=>{console.log("Error in createContainer"),console.error(i),n.push(i)},null);if(A9e.updateContainerSync(e,o,null,()=>{}),A9e.flushSyncWork(),n.length>0)throw n[0];let r=A9e.getPublicRootInstance(o);if(r)return r;return t.children[0]};function gQr(e){if(!e)return{validPinLabels:e,invalidPinLabelsMessages:[]};let t={},n=[];for(let[o,r]of Object.entries(e)){let i=Array.isArray(r)?r.slice():[r],s=[];for(let a of i)if(AQr(o,a))s.push(a);else{let c=C5n(a),l=c?` Try using "${c}" instead.`:"";n.push(`Invalid pin label: ${o} = '${a}' - excluding from component. Pin labels can only contain letters, numbers and underscores.${l}`)}if(s.length>0)t[o]=Array.isArray(r)?s:s[0]}return{validPinLabels:Object.keys(t).length>0?t:void 0,invalidPinLabelsMessages:n}}function AQr(e,t){return/^[A-Za-z0-9_]+$/.test(t)}function C5n(e){let t=e.match(/^\+?(\d+)\.(\d+)V(_\d+)?$/i);if(t)return`V${t[1]}_${t[2]}${t[3]??""}`;let n=e.match(/^\+?(\d+)V(\d+)(_\d+)?$/i);if(n)return`V${n[1]}_${n[2]}${n[3]??""}`;let o=e.match(/^\+?(\d+)V(_\d+)?$/i);if(o)return`V${o[1]}${o[2]??""}`;return}var ggn=(e)=>{let t=C5n(e),n=t?` Try using "${t}" instead.`:"";return`No pin labels provided and pin number or label is not a number: "${e}".${n}`},cY=(e,t)=>{if(typeof e==="number")return e;let n=nB(e);if(n!==null)return n;if(e.startsWith("pin"))throw Error(`Invalid pinLabels key "${e}". Expected "pin\${number}" (e.g. pin1, pin2).`);if(!t)throw Error(ggn(e));let o=Ait(t),r=o.find((s)=>s.physicalPinName===e);if(r)return r.pinNumber;let i=o.filter((s)=>s.labels.includes(e));if(i.length>1&&i.some((s)=>s.physicalPinName))throw Error(`Ambiguous pin label "${e}"; use a physical ball name: ${i.map((s)=>s.physicalPinName??`pin${s.pinNumber}`).join(", ")}.`);if(i.length>0)return i[0].pinNumber;throw Error(ggn(e))},Pit=(e,t)=>{if(!e)return;let n={},o={};for(let[r,i]of Object.entries(e)){let s=cY(r,t);o[s]={...o[s],...i}}for(let[r,i]of Object.entries(o)){let s=`pin${r}`;n[s]={bottom_margin:i.bottomMargin,left_margin:i.leftMargin,right_margin:i.rightMargin,top_margin:i.topMargin}}return n},Eit=(e)=>{if(!e)return;if("leftSide"in e||"rightSide"in e||"topSide"in e||"bottomSide"in e)return{left_side:e.leftSide,right_side:e.rightSide,top_side:e.topSide,bottom_side:e.bottomSide};if("leftPinCount"in e||"rightPinCount"in e||"topPinCount"in e||"bottomPinCount"in e)return{left_size:e.leftPinCount,right_size:e.rightPinCount,top_size:e.topPinCount,bottom_size:e.bottomPinCount};if("leftSize"in e||"rightSize"in e||"topSize"in e||"bottomSize"in e)return{left_size:e.leftSize,right_size:e.rightSize,top_size:e.topSize,bottom_size:e.bottomSize};return};function vue(e){return e.replace(/\\n/g,`
`)}var b5n=class extends nr{isPcbPrimitive=!0;pcb_copper_text_id=null;get config(){return{componentName:"CopperText",zodProps:gNt}}doInitialPcbPrimitiveRender(){if(this.root?.pcbDisabled)return;let{db:e}=this.root,{_parsedProps:t}=this,n=this.getPrimitiveContainer(),o=this._getGlobalPcbPositionBeforeLayout(),r=this.getSubcircuit(),i=e.pcb_copper_text.insert({anchor_alignment:t.anchorAlignment,anchor_position:{x:o.x,y:o.y},font:"tscircuit2024",font_size:t.fontSize,layer:t.layer??"top",text:vue(t.text),ccw_rotation:t.pcbRotation,is_mirrored:t.mirrored,is_knockout:t.knockout,pcb_component_id:n.pcb_component_id,subcircuit_id:r?.subcircuit_id??void 0,pcb_group_id:this.getGroup()?.pcb_group_id??void 0});this.pcb_copper_text_id=i.pcb_copper_text_id}getPcbSize(){let{_parsedProps:e}=this,t=e.fontSize??1,o=(e.text??"").length*t,r=t;return{width:o*t,height:r*t}}_moveCircuitJsonElements({deltaX:e,deltaY:t}){if(this.root?.pcbDisabled)return;let{db:n}=this.root;if(!this.pcb_copper_text_id)return;let o=n.pcb_copper_text.get(this.pcb_copper_text_id);if(o)n.pcb_copper_text.update(this.pcb_copper_text_id,{anchor_position:{x:o.anchor_position.x+e,y:o.anchor_position.y+t}})}},I5n=class extends nr{pcb_courtyard_circle_id=null;isPcbPrimitive=!0;get config(){return{componentName:"CourtyardCircle",zodProps:WDt}}doInitialPcbPrimitiveRender(){if(this.root?.pcbDisabled)return;let{db:e}=this.root,{_parsedProps:t}=this,n=this._getGlobalPcbPositionBeforeLayout(),{maybeFlipLayer:o}=this._getPcbPrimitiveFlippedHelpers(),r=o(t.layer??"top");if(r!=="top"&&r!=="bottom")throw Error(`Invalid layer "${r}" for CourtyardCircle. Must be "top" or "bottom".`);let i=this.getSubcircuit(),s=this.parent?.pcb_component_id??this.getPrimitiveContainer()?.pcb_component_id,a=e.pcb_courtyard_circle.insert({pcb_component_id:s,layer:r,center:{x:n.x,y:n.y},radius:t.radius,subcircuit_id:i?.subcircuit_id??void 0,pcb_group_id:this.getGroup()?.pcb_group_id??void 0});this.pcb_courtyard_circle_id=a.pcb_courtyard_circle_id}getPcbSize(){let{_parsedProps:e}=this,t=e.radius*2;return{width:t,height:t}}_moveCircuitJsonElements({deltaX:e,deltaY:t}){if(this.root?.pcbDisabled)return;let{db:n}=this.root;if(!this.pcb_courtyard_circle_id)return;let o=n.pcb_courtyard_circle.get(this.pcb_courtyard_circle_id);if(o)n.pcb_courtyard_circle.update(this.pcb_courtyard_circle_id,{center:{x:o.center.x+e,y:o.center.y+t}})}},S5n=class extends nr{pcb_courtyard_outline_id=null;isPcbPrimitive=!0;get config(){return{componentName:"CourtyardOutline",zodProps:UDt}}doInitialPcbPrimitiveRender(){if(this.root?.pcbDisabled)return;let{db:e}=this.root,{_parsedProps:t}=this,{maybeFlipLayer:n}=this._getPcbPrimitiveFlippedHelpers(),o=n(t.layer??"top");if(o!=="top"&&o!=="bottom")throw Error(`Invalid layer "${o}" for CourtyardOutline. Must be "top" or "bottom".`);let r=this._computePcbGlobalTransformBeforeLayout(),i=this.getSubcircuit(),s=this.parent?.pcb_component_id??this.getPrimitiveContainer()?.pcb_component_id,a=e.pcb_courtyard_outline.insert({pcb_component_id:s,layer:o,outline:t.outline.map((c)=>{let l=v5n.applyToPoint(r,{x:c.x,y:c.y});return{x:l.x,y:l.y}}),subcircuit_id:i?.subcircuit_id??void 0,pcb_group_id:this.getGroup()?.pcb_group_id??void 0});this.pcb_courtyard_outline_id=a.pcb_courtyard_outline_id}_setPositionFromLayout(e){let{db:t}=this.root,n=t.pcb_courtyard_outline.get(this.pcb_courtyard_outline_id);if(!n)return;let o=0,r=0;for(let c of n.outline)o+=c.x,r+=c.y;o/=n.outline.length,r/=n.outline.length;let i=e.x-o,s=e.y-r,a=n.outline.map((c)=>({x:c.x+i,y:c.y+s}));t.pcb_courtyard_outline.update(this.pcb_courtyard_outline_id,{outline:a})}_moveCircuitJsonElements({deltaX:e,deltaY:t}){if(this.root?.pcbDisabled)return;let{db:n}=this.root;if(!this.pcb_courtyard_outline_id)return;let o=n.pcb_courtyard_outline.get(this.pcb_courtyard_outline_id);if(o)n.pcb_courtyard_outline.update(this.pcb_courtyard_outline_id,{outline:o.outline.map((r)=>({x:r.x+e,y:r.y+t}))})}getPcbSize(){let{_parsedProps:e}=this;if(!e.outline||e.outline.length===0)return{width:0,height:0};let t=Ms(e.outline);if(!t)return{width:0,height:0};return{width:t.maxX-t.minX,height:t.maxY-t.minY}}},E5n=class extends nr{pcb_courtyard_rect_id=null;isPcbPrimitive=!0;get config(){return{componentName:"CourtyardRect",zodProps:GDt}}doInitialPcbPrimitiveRender(){if(this.root?.pcbDisabled)return;let{db:e}=this.root,{_parsedProps:t}=this,n=this._getGlobalPcbPositionBeforeLayout(),{maybeFlipLayer:o,isFlipped:r}=this._getPcbPrimitiveFlippedHelpers(),i=o(t.layer??"top");if(i!=="top"&&i!=="bottom")throw Error(`Invalid layer "${i}" for CourtyardRect. Must be "top" or "bottom".`);let s=this.getSubcircuit(),a=this.parent?.pcb_component_id??this.getPrimitiveContainer()?.pcb_component_id,h=(P5n.decomposeTSR(this._computePcbGlobalTransformBeforeLayout()).rotation.angle*180/Math.PI%360+360)%360;if(r)h=(180-h+360)%360;let d=e.pcb_courtyard_rect.insert({pcb_component_id:a,layer:i,center:{x:n.x,y:n.y},width:t.width,height:t.height,ccw_rotation:h||void 0,subcircuit_id:s?.subcircuit_id??void 0,pcb_group_id:this.getGroup()?.pcb_group_id??void 0});this.pcb_courtyard_rect_id=d.pcb_courtyard_rect_id}getPcbSize(){let{_parsedProps:e}=this;return{width:e.width,height:e.height}}_moveCircuitJsonElements({deltaX:e,deltaY:t}){if(this.root?.pcbDisabled)return;let{db:n}=this.root;if(!this.pcb_courtyard_rect_id)return;let o=n.pcb_courtyard_rect.get(this.pcb_courtyard_rect_id);if(o)n.pcb_courtyard_rect.update(this.pcb_courtyard_rect_id,{center:{x:o.center.x+e,y:o.center.y+t}})}};function Jhe({width:e,height:t,ccwRotationDegrees:n}){let o=n*Math.PI/180,r=Math.cos(o),i=Math.sin(o),s=e/2,a=t/2,c=Math.abs(s*r)+Math.abs(a*i),l=Math.abs(s*i)+Math.abs(a*r);return{width:c*2,height:l*2,xExtent:c,yExtent:l}}var wve=class extends nr{pcb_cutout_id=null;isPcbPrimitive=!0;get config(){return{componentName:"Cutout",zodProps:KTt}}doInitialPcbPrimitiveRender(){if(this.root?.pcbDisabled)return;let{db:e}=this.root,{_parsedProps:t}=this,n=this.getSubcircuit(),o=this.getGroup()?.pcb_group_id??void 0,r=this._getGlobalPcbPositionBeforeLayout(),i=this.getPrimitiveContainer(),s=this.parent?.pcb_component_id??i?.pcb_component_id??void 0,a=void 0;if(t.shape==="rect"){let c=this._computePcbGlobalTransformBeforeLayout(),l=c.a*c.d-c.b*c.c<0,{rotation:h}=t7e.decomposeTSR(c,!1,l),d={shape:"rect",center:r,width:t.width,height:t.height,rotation:h.angle*180/Math.PI,subcircuit_id:n?.subcircuit_id??void 0,pcb_group_id:o,pcb_component_id:s};a=e.pcb_cutout.insert(d)}else if(t.shape==="circle"){let c={shape:"circle",center:r,radius:t.radius,subcircuit_id:n?.subcircuit_id??void 0,pcb_group_id:o,pcb_component_id:s};a=e.pcb_cutout.insert(c)}else if(t.shape==="polygon"){let c=this._computePcbGlobalTransformBeforeLayout(),h={shape:"polygon",points:t.points.map((d)=>t7e.applyToPoint(c,d)),subcircuit_id:n?.subcircuit_id??void 0,pcb_group_id:o,pcb_component_id:s};a=e.pcb_cutout.insert(h)}if(a)this.pcb_cutout_id=a.pcb_cutout_id}getPcbSize(){let{_parsedProps:e}=this;if(e.shape==="rect")return{width:e.width,height:e.height};if(e.shape==="circle")return{width:e.radius*2,height:e.radius*2};if(e.shape==="polygon"){if(e.points.length===0)return{width:0,height:0};let t=1/0,n=-1/0,o=1/0,r=-1/0;for(let i of e.points)t=Math.min(t,i.x),n=Math.max(n,i.x),o=Math.min(o,i.y),r=Math.max(r,i.y);return{width:n-t,height:r-o}}return{width:0,height:0}}_getPcbCircuitJsonBounds(){if(!this.pcb_cutout_id)return super._getPcbCircuitJsonBounds();let{db:e}=this.root,t=e.pcb_cutout.get(this.pcb_cutout_id);if(!t)return super._getPcbCircuitJsonBounds();if(t.shape==="rect"){let{width:n,height:o,xExtent:r,yExtent:i}=Jhe({width:t.width,height:t.height,ccwRotationDegrees:t.rotation??0});return{center:t.center,bounds:{left:t.center.x-r,top:t.center.y+i,right:t.center.x+r,bottom:t.center.y-i},width:n,height:o}}else if(t.shape==="circle")return{center:t.center,bounds:{left:t.center.x-t.radius,top:t.center.y+t.radius,right:t.center.x+t.radius,bottom:t.center.y-t.radius},width:t.radius*2,height:t.radius*2};else if(t.shape==="polygon"){if(t.points.length===0)return super._getPcbCircuitJsonBounds();let n=1/0,o=-1/0,r=1/0,i=-1/0;for(let s of t.points)n=Math.min(n,s.x),o=Math.max(o,s.x),r=Math.min(r,s.y),i=Math.max(i,s.y);return{center:{x:(n+o)/2,y:(r+i)/2},bounds:{left:n,top:i,right:o,bottom:r},width:o-n,height:i-r}}return super._getPcbCircuitJsonBounds()}_setPositionFromLayout(e){if(!this.pcb_cutout_id)return;let{db:t}=this.root,n=t.pcb_cutout.get(this.pcb_cutout_id);if(!n)return;if(n.shape==="rect"||n.shape==="circle")t.pcb_cutout.update(this.pcb_cutout_id,{...n,center:e});else if(n.shape==="polygon"){let o=this._getPcbCircuitJsonBounds().center,r=e.x-o.x,i=e.y-o.y,s=n.points.map((a)=>({x:a.x+r,y:a.y+i}));t.pcb_cutout.update(this.pcb_cutout_id,{...n,points:s})}}_moveCircuitJsonElements({deltaX:e,deltaY:t}){if(!this.pcb_cutout_id)return;let{db:n}=this.root,o=n.pcb_cutout.get(this.pcb_cutout_id);if(!o)return;if(o.shape==="rect"||o.shape==="circle")n.pcb_cutout.update(this.pcb_cutout_id,{center:{x:o.center.x+e,y:o.center.y+t}});else if(o.shape==="polygon")n.pcb_cutout.update(this.pcb_cutout_id,{points:o.points.map((r)=>({x:r.x+e,y:r.y+t}))})}},w5n=class extends nr{fabrication_note_path_id=null;isPcbPrimitive=!0;get config(){return{componentName:"FabricationNotePath",zodProps:FDt}}doInitialPcbPrimitiveRender(){if(this.root?.pcbDisabled)return;let{db:e}=this.root,t=this.getSubcircuit(),{_parsedProps:n}=this,{maybeFlipLayer:o}=this._getPcbPrimitiveFlippedHelpers(),r=o(n.layer??"top");if(r!=="top"&&r!=="bottom")throw Error(`Invalid layer "${r}" for FabricationNotePath. Must be "top" or "bottom".`);let i=this._computePcbGlobalTransformBeforeLayout(),s=this.parent?.pcb_component_id??this.getPrimitiveContainer()?.pcb_component_id,a=e.pcb_fabrication_note_path.insert({pcb_component_id:s,layer:r,color:n.color,is_filled:n.isFilled,has_stroke:n.hasStroke,route:n.route.map((c)=>{let l=M5n.applyToPoint(i,{x:c.x,y:c.y});return{...c,x:l.x,y:l.y}}),stroke_width:n.strokeWidth??0.1,subcircuit_id:t?.subcircuit_id??void 0});this.fabrication_note_path_id=a.pcb_fabrication_note_path_id}getPcbSize(){let{_parsedProps:e}=this;if(e.route.length===0)return{width:0,height:0};let t=e.route.map((a)=>typeof a.x==="string"?parseFloat(a.x):a.x),n=e.route.map((a)=>typeof a.y==="string"?parseFloat(a.y):a.y),o=Math.min(...t),r=Math.max(...t),i=Math.min(...n),s=Math.max(...n);return{width:r-o,height:s-i}}_moveCircuitJsonElements({deltaX:e,deltaY:t}){if(this.root?.pcbDisabled)return;let{db:n}=this.root;if(!this.fabrication_note_path_id)return;let o=n.pcb_fabrication_note_path.get(this.fabrication_note_path_id);if(o)n.pcb_fabrication_note_path.update(this.fabrication_note_path_id,{route:o.route.map((r)=>({...r,x:r.x+e,y:r.y+t}))})}},B5n=class extends nr{fabrication_note_rect_id=null;isPcbPrimitive=!0;get config(){return{componentName:"FabricationNoteRect",zodProps:HDt}}doInitialPcbPrimitiveRender(){if(this.root?.pcbDisabled)return;let{db:e}=this.root,{_parsedProps:t}=this,n=this._getGlobalPcbPositionBeforeLayout(),{maybeFlipLayer:o}=this._getPcbPrimitiveFlippedHelpers(),r=o(t.layer??"top");if(r!=="top"&&r!=="bottom")throw Error(`Invalid layer "${r}" for FabricationNoteRect. Must be "top" or "bottom".`);let i=this.parent?.pcb_component_id??this.getPrimitiveContainer()?.pcb_component_id,s=this.getSubcircuit(),a=t.hasStroke??(t.strokeWidth!==void 0&&t.strokeWidth!==null),c=e.pcb_fabrication_note_rect.insert({pcb_component_id:i,layer:r,color:t.color,center:{x:n.x,y:n.y},width:t.width,height:t.height,stroke_width:t.strokeWidth??1,is_filled:t.isFilled??!1,has_stroke:a,is_stroke_dashed:t.isStrokeDashed??!1,subcircuit_id:s?.subcircuit_id??void 0,pcb_group_id:this.getGroup()?.pcb_group_id??void 0,corner_radius:t.cornerRadius??void 0});this.fabrication_note_rect_id=c.pcb_fabrication_note_rect_id}getPcbSize(){let{_parsedProps:e}=this;return{width:e.width,height:e.height}}_moveCircuitJsonElements({deltaX:e,deltaY:t}){if(this.root?.pcbDisabled)return;let{db:n}=this.root;if(!this.fabrication_note_rect_id)return;let o=n.pcb_fabrication_note_rect.get(this.fabrication_note_rect_id);if(o)n.pcb_fabrication_note_rect.update(this.fabrication_note_rect_id,{center:{x:o.center.x+e,y:o.center.y+t}})}};function fQr(e){let t=e.indexOf("[");if(t===-1)return{tag:e};let n=e.slice(0,t),r=e.slice(t+1,e.lastIndexOf("]")).match(/^(\w+)(\^=|\$=|=)['"]?(.*?)['"]?$/);if(!r)return{tag:n};return{tag:n,attrName:r[1],attrOp:r[2],attrValue:r[3]}}function Agn(e,t){if(e.lowercaseComponentName!==t.tag)return!1;if(!t.attrName)return!0;let n=e.props?.[t.attrName];if(n===void 0)return!1;let o=String(n);switch(t.attrOp){case"^=":return o.startsWith(t.attrValue);case"$=":return o.endsWith(t.attrValue);case"=":return o===t.attrValue;default:return!1}}function yQr(e,t){if(!Agn(e,t[t.length-1]))return!1;let n=t.length-2,o=e.parent;while(n>=0&&o){if(Agn(o,t[n]))n--;o=o.parent}return n<0}function bJ({propertyName:e,resolvedPcbSx:t,pathFromAmpersand:n,component:o}){if(!t)return;let r,i=0;for(let[s,a]of Object.entries(t)){if(!a||!(e in a))continue;let c=s.startsWith("& ")?s.slice(2):s;if(c===n){if(1>i)i=1,r=a[e];continue}if(!o)continue;let l=c.split(/\s+/).map(fQr);if(l.length<2)continue;if(yQr(o,l)){let h=l.length;if(h>i)i=h,r=a[e]}}return r}var D5n=class extends nr{pcb_fabrication_note_text_id=null;isPcbPrimitive=!0;get config(){return{componentName:"FabricationNoteText",zodProps:LDt}}doInitialPcbPrimitiveRender(){if(this.root?.pcbDisabled)return;let{db:e}=this.root,{_parsedProps:t}=this,n=this._getGlobalPcbPositionBeforeLayout(),i=(T5n.decomposeTSR(this._computePcbGlobalTransformBeforeLayout()).rotation.angle*180/Math.PI%360+360)%360,s=this.getPrimitiveContainer(),a=this.getSubcircuit(),{maybeFlipLayer:c}=this._getPcbPrimitiveFlippedHelpers(),l=c(t.layer??"top");if(l!=="top"&&l!=="bottom")throw Error(`Invalid layer "${l}" for FabricationNoteText. Must be "top" or "bottom".`);if(bJ({propertyName:"visibility",resolvedPcbSx:this.getResolvedPcbSx(),pathFromAmpersand:"fabricationnotetext",component:this})==="hidden")return;let d=e.pcb_fabrication_note_text.insert({anchor_alignment:t.anchorAlignment,anchor_position:{x:n.x,y:n.y},font:t.font??"tscircuit2024",font_size:t.fontSize??1,layer:l,color:t.color,ccw_rotation:i,text:vue(t.text??""),pcb_component_id:s.pcb_component_id,subcircuit_id:a?.subcircuit_id??void 0,pcb_group_id:this.getGroup()?.pcb_group_id??void 0});this.pcb_fabrication_note_text_id=d.pcb_fabrication_note_text_id}getPcbSize(){let{_parsedProps:e}=this,t=typeof e.fontSize==="string"?parseFloat(e.fontSize):e.fontSize??1,n=t*0.6;return{width:(e.text??"").length*n,height:t}}_moveCircuitJsonElements({deltaX:e,deltaY:t}){if(this.root?.pcbDisabled)return;let{db:n}=this.root;if(this.pcb_fabrication_note_text_id){let o=n.pcb_fabrication_note_text.get(this.pcb_fabrication_note_text_id);if(o)n.pcb_fabrication_note_text.update(this.pcb_fabrication_note_text_id,{anchor_position:{x:o.anchor_position.x+e,y:o.anchor_position.y+t}})}}},IJ=class extends nr{pcb_hole_id=null;isPcbPrimitive=!0;get config(){return{componentName:"Hole",zodProps:ZTt}}getPcbSize(){let{_parsedProps:e}=this,t=e.shape==="pill",n=e.shape==="oval",o=e.shape==="rect";if(t||n)return{width:e.width,height:e.height};else if(o)return{width:e.width,height:e.height};else return{width:e.diameter,height:e.diameter}}doInitialPcbPrimitiveRender(){if(this.root?.pcbDisabled)return;let{db:e}=this.root,{_parsedProps:t}=this,n=this.getSubcircuit(),o=this._getGlobalPcbPositionBeforeLayout(),r=t.solderMaskMargin,i=t.coveredWithSolderMask??!1,s=this.parent?.pcb_component_id??this.getPrimitiveContainer()?.pcb_component_id;if(this.emitSolderMaskMarginWarning(i,r),t.shape==="pill")if(t.pcbRotation&&t.pcbRotation!==0){let a=e.pcb_hole.insert({pcb_component_id:s,type:"pcb_hole",hole_shape:"rotated_pill",hole_width:t.width,hole_height:t.height,x:o.x,y:o.y,ccw_rotation:t.pcbRotation,soldermask_margin:r,is_covered_with_solder_mask:i,subcircuit_id:n?.subcircuit_id??void 0,pcb_group_id:n?.getGroup()?.pcb_group_id??void 0});this.pcb_hole_id=a.pcb_hole_id}else{let a=e.pcb_hole.insert({pcb_component_id:s,type:"pcb_hole",hole_shape:"pill",hole_width:t.width,hole_height:t.height,x:o.x,y:o.y,soldermask_margin:r,is_covered_with_solder_mask:i,subcircuit_id:n?.subcircuit_id??void 0,pcb_group_id:n?.getGroup()?.pcb_group_id??void 0});this.pcb_hole_id=a.pcb_hole_id}else if(t.shape==="oval"){let a=e.pcb_hole.insert({pcb_component_id:s,type:"pcb_hole",hole_shape:"oval",hole_width:t.width,hole_height:t.height,x:o.x,y:o.y,soldermask_margin:r,is_covered_with_solder_mask:i,subcircuit_id:n?.subcircuit_id??void 0,pcb_group_id:n?.getGroup()?.pcb_group_id??void 0});this.pcb_hole_id=a.pcb_hole_id}else if(t.shape==="rect"){let a=e.pcb_hole.insert({pcb_component_id:s,type:"pcb_hole",hole_shape:"rect",hole_width:t.width,hole_height:t.height,x:o.x,y:o.y,soldermask_margin:r,is_covered_with_solder_mask:i,subcircuit_id:n?.subcircuit_id??void 0,pcb_group_id:n?.getGroup()?.pcb_group_id??void 0});this.pcb_hole_id=a.pcb_hole_id}else{let a=e.pcb_hole.insert({pcb_component_id:s,type:"pcb_hole",hole_shape:"circle",hole_diameter:t.diameter,x:o.x,y:o.y,soldermask_margin:r,is_covered_with_solder_mask:i,subcircuit_id:n?.subcircuit_id??void 0,pcb_group_id:n?.getGroup()?.pcb_group_id??void 0});this.pcb_hole_id=a.pcb_hole_id}}_getPcbCircuitJsonBounds(){let{db:e}=this.root,t=e.pcb_hole.get(this.pcb_hole_id),n=this.getPcbSize();return{center:{x:t.x,y:t.y},bounds:{left:t.x-n.width/2,top:t.y-n.height/2,right:t.x+n.width/2,bottom:t.y+n.height/2},width:n.width,height:n.height}}_setPositionFromLayout(e){let{db:t}=this.root;t.pcb_hole.update(this.pcb_hole_id,{x:e.x,y:e.y})}_moveCircuitJsonElements({deltaX:e,deltaY:t}){if(this.root?.pcbDisabled)return;let{db:n}=this.root;if(!this.pcb_hole_id)return;let o=n.pcb_hole.get(this.pcb_hole_id);if(o)n.pcb_hole.update(this.pcb_hole_id,{x:o.x+e,y:o.y+t})}},i8e=class extends nr{pcb_keepout_id=null;isPcbPrimitive=!0;get config(){return{componentName:"Keepout",zodProps:YDt}}getExcludedPcbComponentIds(){let e=this._parsedProps.excludeRefs?.flatMap((t)=>this.getSubcircuit().selectAll(t).map((n)=>n.pcb_component_id).filter((n)=>n!==null))??[];return Array.from(new Set(e))}doInitialPcbPrimitiveRender(){if(this.root?.pcbDisabled)return;let e=this.getSubcircuit(),{db:t}=this.root,{_parsedProps:n}=this,o=this.getPrimitiveContainer()?.pcb_component_id??void 0,r=o?{pcb_component_id:o}:{},i=this.getGroup()?.pcb_group_id??void 0,s=this._getGlobalPcbPositionBeforeLayout(),a=N5n.decomposeTSR(this._computePcbGlobalTransformBeforeLayout()),c=Math.abs(a.rotation.angle*(180/Math.PI)-90)%180<0.01,l=n.layers;if(!l&&n.layer)l=[n.layer];if(!l)l=["top"];let h=this.getExcludedPcbComponentIds(),d=h.length>0?{excluded_pcb_component_ids:h}:{},u=null;if(n.shape==="circle")u=t.pcb_keepout.insert({layers:l,shape:"circle",...r,...d,...n.allowTraces!==void 0?{allow_traces:n.allowTraces}:{},...n.allowPlacements!==void 0?{allow_placements:n.allowPlacements}:{},...n.warningOnly!==void 0?{warning_only:n.warningOnly}:{},radius:n.radius,center:{x:s.x,y:s.y},subcircuit_id:e?.subcircuit_id??void 0,pcb_group_id:i});else if(n.shape==="rect")u=t.pcb_keepout.insert({layers:l,shape:"rect",...r,...d,...n.allowTraces!==void 0?{allow_traces:n.allowTraces}:{},...n.allowPlacements!==void 0?{allow_placements:n.allowPlacements}:{},...n.warningOnly!==void 0?{warning_only:n.warningOnly}:{},...c?{width:n.height,height:n.width}:{width:n.width,height:n.height},center:{x:s.x,y:s.y},subcircuit_id:e?.subcircuit_id??void 0,pcb_group_id:i});if(u)this.pcb_keepout_id=u.pcb_keepout_id}getPcbSize(){let{_parsedProps:e}=this;if(e.shape==="circle")return{width:e.radius*2,height:e.radius*2};if(e.shape==="rect")return{width:e.width,height:e.height};return{width:0,height:0}}};var R5n=class extends nr{pcb_note_line_id=null;isPcbPrimitive=!0;get config(){return{componentName:"PcbNoteLine",zodProps:MNt}}doInitialPcbPrimitiveRender(){if(this.root?.pcbDisabled)return;let{db:e}=this.root,{_parsedProps:t}=this,n=this.getSubcircuit(),o=this.getGroup(),r=this._computePcbGlobalTransformBeforeLayout(),i=mot.applyToPoint(r,{x:t.x1,y:t.y1}),s=mot.applyToPoint(r,{x:t.x2,y:t.y2}),a=this.parent?.pcb_component_id??this.getPrimitiveContainer()?.pcb_component_id??void 0,c=e.pcb_note_line.insert({pcb_component_id:a,subcircuit_id:n?.subcircuit_id??void 0,pcb_group_id:o?.pcb_group_id??void 0,x1:i.x,y1:i.y,x2:s.x,y2:s.y,layer:t.layer==="bottom"?"bottom":"top",stroke_width:t.strokeWidth??0.1,color:t.color,is_dashed:t.isDashed});this.pcb_note_line_id=c.pcb_note_line_id}getPcbSize(){let{_parsedProps:e}=this;return{width:Math.abs(e.x2-e.x1),height:Math.abs(e.y2-e.y1)}}_moveCircuitJsonElements({deltaX:e,deltaY:t}){if(this.root?.pcbDisabled)return;let{db:n}=this.root;if(!this.pcb_note_line_id)return;let o=n.pcb_note_line.get(this.pcb_note_line_id);if(o)n.pcb_note_line.update(this.pcb_note_line_id,{x1:o.x1+e,y1:o.y1+t,x2:o.x2+e,y2:o.y2+t})}},k5n=class extends nr{pcb_note_path_id=null;isPcbPrimitive=!0;get config(){return{componentName:"PcbNotePath",zodProps:ENt}}doInitialPcbPrimitiveRender(){if(this.root?.pcbDisabled)return;let{db:e}=this.root,{_parsedProps:t}=this,n=this._computePcbGlobalTransformBeforeLayout(),o=this.getSubcircuit(),r=this.getGroup(),i=this.parent?.pcb_component_id??this.getPrimitiveContainer()?.pcb_component_id??void 0,s=t.route.map((c)=>{let{x:l,y:h,...d}=c,u=typeof l==="string"?parseFloat(l):l,_=typeof h==="string"?parseFloat(h):h,p=Q5n.applyToPoint(n,{x:u,y:_});return{...d,x:p.x,y:p.y}}),a=e.pcb_note_path.insert({pcb_component_id:i,subcircuit_id:o?.subcircuit_id??void 0,pcb_group_id:r?.pcb_group_id??void 0,route:s,layer:t.layer==="bottom"?"bottom":"top",stroke_width:t.strokeWidth??0.1,color:t.color});this.pcb_note_path_id=a.pcb_note_path_id}getPcbSize(){let{_parsedProps:e}=this;if(e.route.length===0)return{width:0,height:0};let t=e.route.map((a)=>typeof a.x==="string"?parseFloat(a.x):a.x),n=e.route.map((a)=>typeof a.y==="string"?parseFloat(a.y):a.y),o=Math.min(...t),r=Math.max(...t),i=Math.min(...n),s=Math.max(...n);return{width:r-o,height:s-i}}_moveCircuitJsonElements({deltaX:e,deltaY:t}){if(this.root?.pcbDisabled)return;let{db:n}=this.root;if(!this.pcb_note_path_id)return;let o=n.pcb_note_path.get(this.pcb_note_path_id);if(o)n.pcb_note_path.update(this.pcb_note_path_id,{route:o.route.map((r)=>({...r,x:r.x+e,y:r.y+t}))})}},H5n=class extends nr{pcb_note_rect_id=null;isPcbPrimitive=!0;get config(){return{componentName:"PcbNoteRect",zodProps:PNt}}doInitialPcbPrimitiveRender(){if(this.root?.pcbDisabled)return;let{db:e}=this.root,{_parsedProps:t}=this,n=this._computePcbGlobalTransformBeforeLayout(),o=L5n.applyToPoint(n,{x:0,y:0}),r=this.getSubcircuit(),i=this.getGroup(),s=this.parent?.pcb_component_id??this.getPrimitiveContainer()?.pcb_component_id??void 0,a=e.pcb_note_rect.insert({pcb_component_id:s,subcircuit_id:r?.subcircuit_id??void 0,pcb_group_id:i?.pcb_group_id??void 0,center:o,width:t.width,height:t.height,layer:t.layer==="bottom"?"bottom":"top",stroke_width:t.strokeWidth??0.1,is_filled:t.isFilled??!1,has_stroke:t.hasStroke??!0,is_stroke_dashed:t.isStrokeDashed??!1,color:t.color,corner_radius:t.cornerRadius??void 0});this.pcb_note_rect_id=a.pcb_note_rect_id}getPcbSize(){let{_parsedProps:e}=this,t=typeof e.width==="string"?parseFloat(e.width):e.width,n=typeof e.height==="string"?parseFloat(e.height):e.height;return{width:t,height:n}}_moveCircuitJsonElements({deltaX:e,deltaY:t}){if(this.root?.pcbDisabled)return;let{db:n}=this.root;if(!this.pcb_note_rect_id)return;let o=n.pcb_note_rect.get(this.pcb_note_rect_id);if(o)n.pcb_note_rect.update(this.pcb_note_rect_id,{center:{x:o.center.x+e,y:o.center.y+t}})}},z5n=class extends nr{pcb_note_text_id=null;isPcbPrimitive=!0;get config(){return{componentName:"PcbNoteText",zodProps:SNt}}doInitialPcbPrimitiveRender(){if(this.root?.pcbDisabled)return;let{db:e}=this.root,{_parsedProps:t}=this,n=this._computePcbGlobalTransformBeforeLayout(),o=F5n.applyToPoint(n,{x:0,y:0}),r=this.getSubcircuit(),i=this.getGroup(),s=this.parent?.pcb_component_id??this.getPrimitiveContainer()?.pcb_component_id??void 0,a=e.pcb_note_text.insert({pcb_component_id:s,subcircuit_id:r?.subcircuit_id??void 0,pcb_group_id:i?.pcb_group_id??void 0,font:t.font??"tscircuit2024",font_size:t.fontSize??1,text:vue(t.text),anchor_position:o,anchor_alignment:t.anchorAlignment??"center",layer:t.layer==="bottom"?"bottom":"top",color:t.color});this.pcb_note_text_id=a.pcb_note_text_id}getPcbSize(){let{_parsedProps:e}=this,t=typeof e.fontSize==="string"?parseFloat(e.fontSize):e.fontSize??1,n=t*0.6;return{width:e.text.length*n,height:t}}_moveCircuitJsonElements({deltaX:e,deltaY:t}){if(this.root?.pcbDisabled)return;let{db:n}=this.root;if(!this.pcb_note_text_id)return;let o=n.pcb_note_text.get(this.pcb_note_text_id);if(o)n.pcb_note_text.update(this.pcb_note_text_id,{anchor_position:{x:o.anchor_position.x+e,y:o.anchor_position.y+t}})}},O5n=class extends nr{pcb_soldermask_opening_id=null;isPcbPrimitive=!0;get config(){return{componentName:"PcbSoldermaskOpening",zodProps:ETt}}_getPcbLocalBoundsBeforeLayout(){let e=this._parsedProps;if(e.shape==="polygon"){let o=Ms(e.points);return{left:o.minX,right:o.maxX,top:o.maxY,bottom:o.minY}}let t=e.shape==="circle"?e.radius*2:e.width,n=e.shape==="circle"?e.radius*2:e.height;return{left:-t/2,right:t/2,top:n/2,bottom:-n/2}}getPcbSize(){let e=this._getPcbLocalBoundsBeforeLayout();return{width:e.right-e.left,height:e.top-e.bottom}}doInitialPcbPrimitiveRender(){if(this.root?.pcbDisabled)return;let{db:e}=this.root,t=this._parsedProps,n=this._computePcbGlobalTransformBeforeLayout(),{maybeFlipLayer:o,isFlipped:r}=this._getPcbPrimitiveFlippedHelpers(),i=this.getPrimitiveContainer(),s={layer:o(t.layer),pcb_component_id:this.parent?.pcb_component_id??i?.pcb_component_id??void 0,pcb_group_id:this.getGroup()?.pcb_group_id??void 0,subcircuit_id:this.getSubcircuit().subcircuit_id??void 0},a=Dde.applyToPoint(n,{x:0,y:0}),c=Dde.decomposeTSR(n,!1,r).rotation.angle*180/Math.PI,l=t.shape==="polygon"?{shape:"polygon",points:t.points.map((h)=>Dde.applyToPoint(n,h))}:t.shape==="circle"?{shape:"circle",...a,radius:t.radius}:{...Math.abs(c)<0.00000001?{shape:"rect"}:{shape:"rotated_rect",ccw_rotation:c},...a,width:t.width,height:t.height};this.pcb_soldermask_opening_id=e.pcb_soldermask_opening.insert({...s,...l}).pcb_soldermask_opening_id}_moveCircuitJsonElements({deltaX:e,deltaY:t}){if(!this.pcb_soldermask_opening_id)return;let{db:n}=this.root,o=n.pcb_soldermask_opening.get(this.pcb_soldermask_opening_id);n.pcb_soldermask_opening.update(this.pcb_soldermask_opening_id,o.shape==="polygon"?{points:o.points.map((r)=>({x:r.x+e,y:r.y+t}))}:{x:o.x+e,y:o.y+t})}doRemovePcbPrimitiveRender(){if(!this.pcb_soldermask_opening_id)return;this.root.db.pcb_soldermask_opening.delete(this.pcb_soldermask_opening_id),this.pcb_soldermask_opening_id=null}},xQr=we({route:it(aAe),source_trace_id:k().optional()}),Mit=class extends nr{pcb_trace_id=null;_materializedRouteViaIndices=new Set;isAntennaTrace=!1;isPcbPrimitive=!0;get config(){return{componentName:"PcbTrace",zodProps:xQr}}doInitialPcbPrimitiveRender(){if(this.root?.pcbDisabled)return;let{db:e}=this.root,{_parsedProps:t}=this,n=this.getPrimitiveContainer(),o=this.getSubcircuit(),{isFlipped:r,maybeFlipLayer:i}=this._getPcbPrimitiveFlippedHelpers(),s=this._computePcbGlobalTransformBeforeLayout(),a=t.route.map((d)=>{if(d.route_type==="wire"){let{x:u,y:_,...p}=d,m=Zhe.applyToPoint(s,{x:u,y:_});return{...p,...m,layer:i(d.layer)}}if(d.route_type==="via"){let{x:u,y:_,...p}=d,m=Zhe.applyToPoint(s,{x:u,y:_});return{...p,...m,from_layer:i(d.from_layer),to_layer:i(d.to_layer),tented_on_top:r?d.tented_on_bottom:d.tented_on_top,tented_on_bottom:r?d.tented_on_top:d.tented_on_bottom}}return{...d,start:Zhe.applyToPoint(s,d.start),end:Zhe.applyToPoint(s,d.end),start_layer:i(d.start_layer),end_layer:i(d.end_layer)}}),c=e.pcb_trace.insert({pcb_component_id:n.pcb_component_id,source_trace_id:t.source_trace_id,route:a,is_antenna_trace:this.isAntennaTrace,subcircuit_id:o?.subcircuit_id??void 0,pcb_group_id:this.getGroup()?.pcb_group_id??void 0});this.pcb_trace_id=c.pcb_trace_id;let{holeDiameter:l,padDiameter:h}=gB(this.getInheritedMergedProperty("pcbStyle"));for(let[d,u]of a.entries()){if(u.route_type!=="via")continue;if(this._materializedRouteViaIndices.has(d))continue;e.pcb_via.insert({pcb_trace_id:c.pcb_trace_id,x:u.x,y:u.y,hole_diameter:u.hole_diameter??l,outer_diameter:u.outer_diameter??h,layers:WS({fromLayer:u.from_layer,toLayer:u.to_layer,layerCount:o._getSubcircuitLayerCount()}),from_layer:u.from_layer,to_layer:u.to_layer,tented_on_top:u.tented_on_top,tented_on_bottom:u.tented_on_bottom,subcircuit_id:c.subcircuit_id,pcb_group_id:c.pcb_group_id})}}getPcbSize(){let e=this._getPcbLocalBoundsBeforeLayout();return{width:e.right-e.left,height:e.top-e.bottom}}_getPcbLocalBoundsBeforeLayout(){let{_parsedProps:e}=this;if(!e.route||e.route.length===0)return{left:0,right:0,top:0,bottom:0};let t=1/0,n=-1/0,o=1/0,r=-1/0;for(let i of e.route){if(i.route_type==="through_pad")t=Math.min(t,i.start.x,i.end.x),n=Math.max(n,i.start.x,i.end.x),o=Math.min(o,i.start.y,i.end.y),r=Math.max(r,i.start.y,i.end.y);else t=Math.min(t,i.x),n=Math.max(n,i.x),o=Math.min(o,i.y),r=Math.max(r,i.y);if(i.route_type==="wire")t=Math.min(t,i.x-i.width/2),n=Math.max(n,i.x+i.width/2),o=Math.min(o,i.y-i.width/2),r=Math.max(r,i.y+i.width/2);else if(i.route_type==="through_pad")t=Math.min(t,i.start.x-i.width/2,i.end.x-i.width/2),n=Math.max(n,i.start.x+i.width/2,i.end.x+i.width/2),o=Math.min(o,i.start.y-i.width/2,i.end.y-i.width/2),r=Math.max(r,i.start.y+i.width/2,i.end.y+i.width/2)}if(t===1/0||n===-1/0||o===1/0||r===-1/0)return{left:0,right:0,top:0,bottom:0};return{left:t,right:n,top:r,bottom:o}}},CQr=g5e.extend({layers:it(Bo).optional(),isTented:Be().optional(),tentedOnTop:Be().optional(),tentedOnBottom:Be().optional()}).partial({fromLayer:!0,toLayer:!0}),V5n=class extends nr{pcb_via_id=null;_importedPcbTraceId;isPcbPrimitive=!0;get config(){return{componentName:"PcbVia",zodProps:CQr}}_getLayers(){let{layers:e,fromLayer:t="top",toLayer:n="bottom"}=this._parsedProps;if(e&&e.length>0)return e;let o=this.parent?this.getSubcircuit()._getSubcircuitLayerCount():2;return WS({fromLayer:t,toLayer:n,layerCount:o})}getAvailablePcbLayers(){return this._getLayers()}getPcbSize(){let e=this._parsedProps.outerDiameter??0.6;return{width:e,height:e}}_getPcbCircuitJsonBounds(){let{db:e}=this.root,t=e.pcb_via.get(this.pcb_via_id),n=this.getPcbSize();return{center:{x:t.x,y:t.y},bounds:{left:t.x-n.width/2,top:t.y-n.height/2,right:t.x+n.width/2,bottom:t.y+n.height/2},width:n.width,height:n.height}}_setPositionFromLayout(e){let{db:t}=this.root;t.pcb_via.update(this.pcb_via_id,{x:e.x,y:e.y})}doInitialPcbPrimitiveRender(){if(this.root?.pcbDisabled)return;let{db:e}=this.root,{holeDiameter:t,outerDiameter:n,netIsAssignable:o,tented:r,isTented:i,tentedOnTop:s,tentedOnBottom:a}=this._parsedProps,c=Iit(r),l=s??c.tented_on_top??i,h=a??c.tented_on_bottom??i,d=this.getSubcircuit(),u=this._getGlobalPcbPositionBeforeLayout(),{isFlipped:_,maybeFlipLayer:p}=this._getPcbPrimitiveFlippedHelpers(),m=this._getLayers().map((y)=>p(y)),A=this._parsedProps.fromLayer?p(this._parsedProps.fromLayer):m[0],g=this._parsedProps.toLayer?p(this._parsedProps.toLayer):m[m.length-1]??A,f=e.pcb_via.insert({x:u.x,y:u.y,...t!==void 0?{hole_diameter:t}:{},...n!==void 0?{outer_diameter:n}:{},layers:m,from_layer:A,to_layer:g,pcb_trace_id:this._importedPcbTraceId,subcircuit_id:d?.subcircuit_id??void 0,pcb_group_id:this.getGroup()?.pcb_group_id??void 0,net_is_assignable:o,tented_on_top:_?h:l,tented_on_bottom:_?l:h});this.pcb_via_id=f.pcb_via_id}},bQr=(e)=>{for(let t of e){let n=t.toString();if(!/^(pin)?\d+$/.test(n))continue;return Number.parseInt(n.replace(/^pin/,""))}return null};function G5n(e,t,n){let o=bQr(n),r=e.filter((h)=>h.isMatchingAnyOf(n));if(r.length===0)return null;let i=r.filter((h)=>h.physicalPinName&&n.includes(h.physicalPinName));if(i.length===1)return i[0];let s=o===null?r:r.filter((h)=>h._parsedProps.pinNumber===o||h._primaryPinNumber===o),a=s.length>0?s:r;not(a,n.join(", "));let c=a.find((h)=>h.matchedComponents.some((d)=>d.isPcbPrimitive&&p5n(d,t)));if(c)return c;return a.find((h)=>!h.matchedComponents.some((d)=>d.isPcbPrimitive))??a[0]}var Zw=class extends nr{pcb_plated_hole_id=null;matchedPort=null;isPcbPrimitive=!0;get config(){return{componentName:"PlatedHole",zodProps:FTt}}getAvailablePcbLayers(){return[...this.root?._getBoard()?.allLayers??["top","bottom"]]}getPcbSize(){let{_parsedProps:e}=this;if(e.shape==="circle")return{width:e.outerDiameter,height:e.outerDiameter};if(e.shape==="oval"||e.shape==="pill")return{width:e.outerWidth,height:e.outerHeight};if(e.shape==="circular_hole_with_rect_pad")return{width:e.rectPadWidth,height:e.rectPadHeight};if(e.shape==="pill_hole_with_rect_pad")return{width:e.rectPadWidth,height:e.rectPadHeight};if(e.shape==="hole_with_polygon_pad"){if(!e.padOutline||e.padOutline.length===0)throw Error("padOutline is required for hole_with_polygon_pad shape");let t=e.padOutline.map((a)=>{if(typeof a.x==="number")return a.x;return parseFloat(String(a.x))}),n=e.padOutline.map((a)=>{if(typeof a.y==="number")return a.y;return parseFloat(String(a.y))}),o=Math.min(...t),r=Math.max(...t),i=Math.min(...n),s=Math.max(...n);return{width:r-o,height:s-i}}throw Error(`getPcbSize for shape "${e.shape}" not implemented for ${this.componentName}`)}_getPcbCircuitJsonBounds(){let{db:e}=this.root,t=e.pcb_plated_hole.get(this.pcb_plated_hole_id),n=this.getPcbSize();return{center:{x:t.x,y:t.y},bounds:{left:t.x-n.width/2,top:t.y+n.height/2,right:t.x+n.width/2,bottom:t.y-n.height/2},width:n.width,height:n.height}}_setPositionFromLayout(e){let{db:t}=this.root;t.pcb_plated_hole.update(this.pcb_plated_hole_id,{x:e.x,y:e.y}),this.matchedPort?._setPositionFromLayout(e)}doInitialPortMatching(){let e=this.getPrimitiveContainer()?.selectAll("port");if(!this._parsedProps.portHints)return;let t=G5n(e,this,this._parsedProps.portHints);if(!t)return;this.matchedPort=t,t.registerMatch(this)}doInitialPcbPrimitiveRender(){if(this.root?.pcbDisabled)return;let{db:e}=this.root,{_parsedProps:t}=this,n=this._getGlobalPcbPositionBeforeLayout(),o=this.parent?.pcb_component_id??this.getPrimitiveContainer()?.pcb_component_id,r=this.getSubcircuit(),i=this._getIsSmt(),s=this.getAvailablePcbLayers(),a=t.solderMaskMargin,c=t.coveredWithSolderMask??!1;this.emitSolderMaskMarginWarning(c,a);let u=(Y5n.decomposeTSR(this._computePcbGlobalTransformBeforeLayout()).rotation.angle*180/Math.PI%360+360)%360;if(t.shape==="circle"){let _=e.pcb_plated_hole.insert({pcb_component_id:o,pcb_port_id:this.matchedPort?.pcb_port_id,outer_diameter:t.outerDiameter,hole_diameter:t.holeDiameter,shape:"circle",port_hints:this.getNameAndAliases(),x:n.x,y:n.y,layers:s,soldermask_margin:a,is_covered_with_solder_mask:c,subcircuit_id:r?.subcircuit_id??void 0,pcb_group_id:this.getGroup()?.pcb_group_id??void 0});if(this.pcb_plated_hole_id=_.pcb_plated_hole_id,i&&!r._isInflatedFromCircuitJson)e.pcb_solder_paste.insert({layer:"top",shape:"circle",radius:t.outerDiameter/2,x:n.x,y:n.y,subcircuit_id:r?.subcircuit_id??void 0,pcb_group_id:this.getGroup()?.pcb_group_id??void 0}),e.pcb_solder_paste.insert({layer:"bottom",shape:"circle",radius:t.outerDiameter/2,x:n.x,y:n.y,subcircuit_id:r?.subcircuit_id??void 0,pcb_group_id:this.getGroup()?.pcb_group_id??void 0})}else if(t.shape==="pill"&&t.rectPad){let _=e.pcb_plated_hole.insert({pcb_component_id:o,pcb_port_id:this.matchedPort?.pcb_port_id,outer_width:t.outerWidth,outer_height:t.outerHeight,hole_width:t.holeWidth,hole_height:t.holeHeight,shape:"rotated_pill_hole_with_rect_pad",type:"pcb_plated_hole",port_hints:this.getNameAndAliases(),x:n.x,y:n.y,layers:s,soldermask_margin:a,is_covered_with_solder_mask:c,subcircuit_id:r?.subcircuit_id??void 0,pcb_group_id:this.getGroup()?.pcb_group_id??void 0,hole_shape:"rotated_pill",pad_shape:"rect",hole_ccw_rotation:u,rect_ccw_rotation:u,rect_pad_width:t.outerWidth,rect_pad_height:t.outerHeight,hole_offset_x:t.holeOffsetX,hole_offset_y:t.holeOffsetY});this.pcb_plated_hole_id=_.pcb_plated_hole_id}else if(t.shape==="pill"||t.shape==="oval"){let _=e.pcb_plated_hole.insert({pcb_component_id:o,pcb_port_id:this.matchedPort?.pcb_port_id,outer_width:t.outerWidth,outer_height:t.outerHeight,hole_width:t.holeWidth,hole_height:t.holeHeight,shape:t.shape,port_hints:this.getNameAndAliases(),x:n.x,y:n.y,layers:s,soldermask_margin:a,is_covered_with_solder_mask:c,subcircuit_id:r?.subcircuit_id??void 0,pcb_group_id:this.getGroup()?.pcb_group_id??void 0,ccw_rotation:u});if(this.pcb_plated_hole_id=_.pcb_plated_hole_id,t.shape==="pill"&&i)e.pcb_solder_paste.insert({layer:"top",shape:"rotated_pill",radius:Math.min(t.outerWidth,t.outerHeight)/2,ccw_rotation:u,width:t.outerWidth,height:t.outerHeight,x:n.x,y:n.y,subcircuit_id:r?.subcircuit_id??void 0,pcb_group_id:this.getGroup()?.pcb_group_id??void 0}),e.pcb_solder_paste.insert({layer:"bottom",shape:"rotated_pill",radius:Math.min(t.outerWidth,t.outerHeight)/2,ccw_rotation:u,width:t.outerWidth,height:t.outerHeight,x:n.x,y:n.y,subcircuit_id:r?.subcircuit_id??void 0,pcb_group_id:this.getGroup()?.pcb_group_id??void 0});else if(t.shape==="oval"&&i)e.pcb_solder_paste.insert({layer:"top",shape:"oval",width:t.outerWidth,height:t.outerHeight,x:n.x,y:n.y,subcircuit_id:r?.subcircuit_id??void 0,pcb_group_id:this.getGroup()?.pcb_group_id??void 0}),e.pcb_solder_paste.insert({layer:"bottom",shape:"oval",width:t.outerWidth,height:t.outerHeight,x:n.x,y:n.y,subcircuit_id:r?.subcircuit_id??void 0,pcb_group_id:this.getGroup()?.pcb_group_id??void 0})}else if(t.shape==="circular_hole_with_rect_pad"){let _=e.pcb_plated_hole.insert({pcb_component_id:o,pcb_port_id:this.matchedPort?.pcb_port_id,hole_diameter:t.holeDiameter,rect_pad_width:t.rectPadWidth,rect_pad_height:t.rectPadHeight,shape:"circular_hole_with_rect_pad",port_hints:this.getNameAndAliases(),x:n.x,y:n.y,layers:s,soldermask_margin:a,is_covered_with_solder_mask:c,subcircuit_id:r?.subcircuit_id??void 0,pcb_group_id:this.getGroup()?.pcb_group_id??void 0,hole_offset_x:t.holeOffsetX,hole_offset_y:t.holeOffsetY,rect_border_radius:t.rectBorderRadius??0,rect_ccw_rotation:u});this.pcb_plated_hole_id=_.pcb_plated_hole_id}else if(t.shape==="pill_hole_with_rect_pad")if(u!==0){let _=e.pcb_plated_hole.insert({pcb_component_id:o,pcb_port_id:this.matchedPort?.pcb_port_id,hole_width:t.holeWidth,hole_height:t.holeHeight,rect_pad_width:t.rectPadWidth,rect_pad_height:t.rectPadHeight,hole_offset_x:t.holeOffsetX,hole_offset_y:t.holeOffsetY,shape:"rotated_pill_hole_with_rect_pad",type:"pcb_plated_hole",hole_shape:"rotated_pill",pad_shape:"rect",hole_ccw_rotation:u,rect_ccw_rotation:u,rect_border_radius:t.rectBorderRadius,port_hints:this.getNameAndAliases(),x:n.x,y:n.y,layers:s,soldermask_margin:a,is_covered_with_solder_mask:c,subcircuit_id:r?.subcircuit_id??void 0,pcb_group_id:this.getGroup()?.pcb_group_id??void 0});this.pcb_plated_hole_id=_.pcb_plated_hole_id}else{let _=e.pcb_plated_hole.insert({pcb_component_id:o,pcb_port_id:this.matchedPort?.pcb_port_id,hole_width:t.holeWidth,hole_height:t.holeHeight,rect_pad_width:t.rectPadWidth,rect_pad_height:t.rectPadHeight,hole_offset_x:t.holeOffsetX,hole_offset_y:t.holeOffsetY,shape:"pill_hole_with_rect_pad",rect_border_radius:t.rectBorderRadius,port_hints:this.getNameAndAliases(),x:n.x,y:n.y,layers:s,soldermask_margin:a,is_covered_with_solder_mask:c,subcircuit_id:r?.subcircuit_id??void 0,pcb_group_id:this.getGroup()?.pcb_group_id??void 0});this.pcb_plated_hole_id=_.pcb_plated_hole_id}else if(t.shape==="hole_with_polygon_pad"){let _=(t.padOutline||[]).map((g)=>{let f=g.x;if(typeof f!=="number")f=parseFloat(String(f));let y=g.y;if(typeof y!=="number")y=parseFloat(String(y));return{x:f,y}}),p=t.holeOffsetX;if(typeof p!=="number")p=parseFloat(String(p||0));let m=t.holeOffsetY;if(typeof m!=="number")m=parseFloat(String(m||0));let A=e.pcb_plated_hole.insert({pcb_component_id:o,pcb_port_id:this.matchedPort?.pcb_port_id,shape:"hole_with_polygon_pad",hole_shape:t.holeShape||"circle",hole_diameter:t.holeDiameter,hole_width:t.holeWidth,hole_height:t.holeHeight,pad_outline:_,hole_offset_x:p,hole_offset_y:m,port_hints:this.getNameAndAliases(),x:n.x,y:n.y,layers:s,soldermask_margin:a,is_covered_with_solder_mask:c,subcircuit_id:r?.subcircuit_id??void 0,pcb_group_id:this.getGroup()?.pcb_group_id??void 0});this.pcb_plated_hole_id=A.pcb_plated_hole_id}}doInitialPcbPortAttachment(){if(this.root?.pcbDisabled)return;let{db:e}=this.root;e.pcb_plated_hole.update(this.pcb_plated_hole_id,{pcb_port_id:this.matchedPort?.pcb_port_id})}_moveCircuitJsonElements({deltaX:e,deltaY:t}){if(this.root?.pcbDisabled)return;let{db:n}=this.root;if(!this.pcb_plated_hole_id)return;let o=n.pcb_plated_hole.get(this.pcb_plated_hole_id);if(o){let r={x:o.x+e,y:o.y+t};this._setPositionFromLayout(r)}}},U5n=class extends nr{isSchematicPrimitive=!0;get config(){return{componentName:"SchematicArc",zodProps:nNt}}schematic_arc_id;doInitialSchematicPrimitiveRender(){if(this.root?.schematicDisabled)return;if(this.getCollapsedSchematicBoxAncestor())return;let{db:e}=this.root,{_parsedProps:t}=this,n=this._getGlobalSchematicPositionBeforeLayout(),o=this.getPrimitiveContainer()?.parent?.schematic_component_id,r=this._getSymbolAncestor()?.schematic_symbol_id,i=e.schematic_arc.insert({schematic_component_id:o,schematic_symbol_id:r,center:{x:t.center.x+n.x,y:t.center.y+n.y},radius:t.radius,start_angle_degrees:t.startAngleDegrees,end_angle_degrees:t.endAngleDegrees,direction:t.direction,stroke_width:t.strokeWidth??Z8e,color:t.color??iB,is_dashed:t.isDashed,subcircuit_id:this.getSubcircuit().subcircuit_id??void 0,schematic_sheet_id:this._resolveSchematicSheetId()});this.schematic_arc_id=i.schematic_arc_id}doInitialSchematicSymbolResize(){if(this.root?.schematicDisabled)return;if(!this.schematic_arc_id)return;let t=this._getSymbolAncestor()?.getUserCoordinateToResizedSymbolTransform();if(!t)return;let{db:n}=this.root,o=n.schematic_arc.get(this.schematic_arc_id);if(!o)return;let r=_ot.applyToPoint(t,o.center),i=_ot.applyToPoint(t,{x:o.center.x+o.radius,y:o.center.y}),s=Math.hypot(i.x-r.x,i.y-r.y),a=Math.atan2(t.b,t.a)*180/Math.PI;n.schematic_arc.update(this.schematic_arc_id,{center:{x:r.x,y:r.y},radius:s,start_angle_degrees:o.start_angle_degrees+a,end_angle_degrees:o.end_angle_degrees+a})}},W5n=class extends nr{isSchematicPrimitive=!0;get config(){return{componentName:"SchematicCircle",zodProps:iNt}}schematic_circle_id;doInitialSchematicPrimitiveRender(){if(this.root?.schematicDisabled)return;if(this.getCollapsedSchematicBoxAncestor())return;let{db:e}=this.root,{_parsedProps:t}=this,n=this._getGlobalSchematicPositionBeforeLayout(),o=this.getPrimitiveContainer()?.parent?.schematic_component_id,r=this._getSymbolAncestor()?.schematic_symbol_id,i=e.schematic_circle.insert({schematic_component_id:o,schematic_symbol_id:r,center:{x:t.center.x+n.x,y:t.center.y+n.y},radius:t.radius,stroke_width:t.strokeWidth??Z8e,color:t.color??iB,is_filled:t.isFilled,fill_color:t.fillColor,is_dashed:t.isDashed,subcircuit_id:this.getSubcircuit().subcircuit_id??void 0,schematic_sheet_id:this._resolveSchematicSheetId()});this.schematic_circle_id=i.schematic_circle_id}doInitialSchematicSymbolResize(){if(this.root?.schematicDisabled)return;if(!this.schematic_circle_id)return;let t=this._getSymbolAncestor()?.getUserCoordinateToResizedSymbolTransform();if(!t)return;let{db:n}=this.root,o=n.schematic_circle.get(this.schematic_circle_id);if(!o)return;let r=got.applyToPoint(t,o.center),i=got.applyToPoint(t,{x:o.center.x+o.radius,y:o.center.y}),s=Math.hypot(i.x-r.x,i.y-r.y);n.schematic_circle.update(this.schematic_circle_id,{center:{x:r.x,y:r.y},radius:s})}},fot=class extends nr{isSchematicPrimitive=!0;get config(){return{componentName:"SchematicLine",zodProps:aNt}}schematic_line_id;doInitialSchematicPrimitiveRender(){if(this.root?.schematicDisabled)return;if(this.getCollapsedSchematicBoxAncestor())return;let{db:e}=this.root,{_parsedProps:t}=this,n=this._getGlobalSchematicPositionBeforeLayout(),o=this.getPrimitiveContainer()?.parent?.schematic_component_id,r=this._getSymbolAncestor()?.schematic_symbol_id,i=e.schematic_line.insert({schematic_component_id:o,schematic_symbol_id:r,x1:t.x1+n.x,y1:t.y1+n.y,x2:t.x2+n.x,y2:t.y2+n.y,stroke_width:t.strokeWidth??Z8e,color:t.color??iB,is_dashed:t.isDashed||t.dashLength!==void 0||t.dashGap!==void 0,dash_length:t.dashLength,dash_gap:t.dashGap,subcircuit_id:this.getSubcircuit().subcircuit_id??void 0,schematic_sheet_id:this._resolveSchematicSheetId()});this.schematic_line_id=i.schematic_line_id}doInitialSchematicSymbolResize(){if(this.root?.schematicDisabled)return;if(!this.schematic_line_id)return;let t=this._getSymbolAncestor()?.getUserCoordinateToResizedSymbolTransform();if(!t)return;let{db:n}=this.root,o=n.schematic_line.get(this.schematic_line_id);if(!o)return;let r=Aot.applyToPoint(t,{x:o.x1,y:o.y1}),i=Aot.applyToPoint(t,{x:o.x2,y:o.y2});n.schematic_line.update(this.schematic_line_id,{x1:r.x,y1:r.y,x2:i.x,y2:i.y})}};function The(e,t){let n=new NK(e),o=n.getTotalLength(),r=Math.max(2,Math.ceil(o*t)),i=[];for(let s=1;s<=r;s++){let a=s/r*o,c=n.getPointAtLength(a);i.push({x:c.x,y:c.y})}return i}function IQr(e,t=10){let n=new NK(e);n.toAbsolute();let o=n.segments,r=[],i=[],s=0,a=0,c=0,l=0;for(let h of o)switch(h[0]){case"M":{if(i.length>0)r.push(i);s=h[1],a=h[2],c=s,l=a,i=[{x:s,y:a}];break}case"L":{s=h[1],a=h[2],i.push({x:s,y:a});break}case"H":{s=h[1],i.push({x:s,y:a});break}case"V":{a=h[1],i.push({x:s,y:a});break}case"Z":{if(s!==c||a!==l)i.push({x:c,y:l});s=c,a=l;break}case"C":{let u=h[5],_=h[6],p=`M ${s} ${a} C ${h[1]} ${h[2]} ${h[3]} ${h[4]} ${u} ${_}`,m=The(p,t);i.push(...m),s=u,a=_;break}case"S":{let u=h[3],_=h[4],p=`M ${s} ${a} S ${h[1]} ${h[2]} ${u} ${_}`,m=The(p,t);i.push(...m),s=u,a=_;break}case"Q":{let u=h[3],_=h[4],p=`M ${s} ${a} Q ${h[1]} ${h[2]} ${u} ${_}`,m=The(p,t);i.push(...m),s=u,a=_;break}case"T":{let u=h[1],_=h[2],p=`M ${s} ${a} T ${u} ${_}`,m=The(p,t);i.push(...m),s=u,a=_;break}case"A":{let u=h[6],_=h[7],p=`M ${s} ${a} A ${h[1]} ${h[2]} ${h[3]} ${h[4]} ${h[5]} ${u} ${_}`,m=The(p,t);i.push(...m),s=u,a=_;break}}if(i.length>0)r.push(i);return r.map((h)=>{let d=[];for(let u of h)if(d.length===0||Math.abs(d[d.length-1].x-u.x)>0.000000001||Math.abs(d[d.length-1].y-u.y)>0.000000001)d.push(u);return d})}var j5n=class extends nr{isSchematicPrimitive=!0;schematic_path_ids=[];get config(){return{componentName:"SchematicPath",zodProps:lNt}}doInitialSchematicPrimitiveRender(){if(this.root?.schematicDisabled)return;if(this.getCollapsedSchematicBoxAncestor())return;let{db:e}=this.root,{_parsedProps:t}=this,n=this._getGlobalSchematicPositionBeforeLayout(),o=this.getPrimitiveContainer()?.parent?.schematic_component_id,r=this._getSymbolAncestor()?.schematic_symbol_id,i=this.getSubcircuit().subcircuit_id??void 0;if(this.schematic_path_ids=[],t.svgPath){let s=IQr(t.svgPath);for(let a of s){let c=e.schematic_path.insert({schematic_component_id:o,schematic_symbol_id:r,points:a.map((l)=>({x:l.x+n.x,y:l.y+n.y})),is_filled:t.isFilled,is_dashed:t.dashLength!==void 0||t.dashGap!==void 0,fill_color:t.fillColor,stroke_color:t.strokeColor,stroke_width:t.strokeWidth,dash_length:t.dashLength,dash_gap:t.dashGap,subcircuit_id:i,schematic_sheet_id:this._resolveSchematicSheetId()});this.schematic_path_ids.push(c.schematic_path_id)}}else if(t.points&&t.points.length>0){let s=e.schematic_path.insert({schematic_component_id:o,schematic_symbol_id:r,points:t.points.map((a)=>({x:a.x+n.x,y:a.y+n.y})),is_filled:t.isFilled,is_dashed:t.dashLength!==void 0||t.dashGap!==void 0,fill_color:t.fillColor,stroke_color:t.strokeColor,stroke_width:t.strokeWidth,dash_length:t.dashLength,dash_gap:t.dashGap,subcircuit_id:i,schematic_sheet_id:this._resolveSchematicSheetId()});this.schematic_path_ids.push(s.schematic_path_id)}}doInitialSchematicSymbolResize(){if(this.root?.schematicDisabled)return;if(this.schematic_path_ids.length===0)return;let t=this._getSymbolAncestor()?.getUserCoordinateToResizedSymbolTransform();if(!t)return;let{db:n}=this.root;for(let o of this.schematic_path_ids){let r=n.schematic_path.get(o);if(!r)continue;let i=r.points.map((s)=>{let a=X5n.applyToPoint(t,s);return{x:a.x,y:a.y}});n.schematic_path.update(o,{points:i})}}},$5n=class extends nr{isSchematicPrimitive=!0;get config(){return{componentName:"SchematicRect",zodProps:sNt}}schematic_rect_id;doInitialSchematicPrimitiveRender(){if(this.root?.schematicDisabled)return;if(this.getCollapsedSchematicBoxAncestor())return;let{db:e}=this.root,{_parsedProps:t}=this,n=this._getGlobalSchematicPositionBeforeLayout(),o=this.getPrimitiveContainer()?.parent?.schematic_component_id,r=this._getSymbolAncestor()?.schematic_symbol_id,i=e.schematic_rect.insert({schematic_symbol_id:r,center:{x:n.x,y:n.y},width:t.width,height:t.height,stroke_width:t.strokeWidth??Z8e,color:t.color??iB,is_filled:t.isFilled,schematic_component_id:o,is_dashed:t.isDashed,rotation:t.rotation??0,subcircuit_id:this.getSubcircuit().subcircuit_id??void 0,schematic_sheet_id:this._resolveSchematicSheetId()});this.schematic_rect_id=i.schematic_rect_id}doInitialSchematicSymbolResize(){if(this.root?.schematicDisabled)return;if(!this.schematic_rect_id)return;let t=this._getSymbolAncestor()?.getUserCoordinateToResizedSymbolTransform();if(!t)return;let{db:n}=this.root,o=n.schematic_rect.get(this.schematic_rect_id);if(!o)return;let r=Math.hypot(t.a,t.b),i=Math.hypot(t.c,t.d),s=Math.atan2(t.b,t.a)*180/Math.PI;n.schematic_rect.update(this.schematic_rect_id,{center:K5n.applyToPoint(t,o.center),width:o.width*r,height:o.height*i,rotation:(o.rotation??0)+s})}},J5n=class extends nr{isSchematicPrimitive=!0;schematic_text_id;get config(){return{componentName:"SchematicText",zodProps:cNt}}doInitialSchematicPrimitiveRender(){if(this.root?.schematicDisabled)return;if(this.getCollapsedSchematicBoxAncestor())return;let{db:e}=this.root,{_parsedProps:t}=this,n=this._getGlobalSchematicPositionBeforeLayout(),o=this._getSymbolAncestor()?.schematic_symbol_id,r=this.getParentNormalComponent()?.schematic_component_id??void 0,i=this._resolveText(),s=e.schematic_text.insert({schematic_symbol_id:o,schematic_component_id:r,anchor:t.anchor??"center",text:vue(i),font_size:t.fontSize,color:t.color||"#000000",position:{x:n.x,y:n.y},rotation:t.schRotation??0,schematic_sheet_id:this._resolveSchematicSheetId()});this.schematic_text_id=s.schematic_text_id}doInitialSchematicSymbolResize(){if(this.root?.schematicDisabled)return;if(!this.schematic_text_id)return;let t=this._getSymbolAncestor()?.getUserCoordinateToResizedSymbolTransform();if(!t)return;let{db:n}=this.root,o=n.schematic_text.get(this.schematic_text_id);if(!o)return;let r=q5n.applyToPoint(t,o.position);n.schematic_text.update(this.schematic_text_id,{position:{x:r.x,y:r.y},rotation:(o.rotation??0)+Math.atan2(t.b,t.a)*180/Math.PI})}},Z5n=class extends nr{pcb_silkscreen_circle_id=null;isPcbPrimitive=!0;get config(){return{componentName:"SilkscreenCircle",zodProps:CNt}}doInitialPcbPrimitiveRender(){if(this.root?.pcbDisabled)return;let{db:e}=this.root,{_parsedProps:t}=this,n=this._getGlobalPcbPositionBeforeLayout(),{maybeFlipLayer:o}=this._getPcbPrimitiveFlippedHelpers(),r=o(t.layer??"top");if(r!=="top"&&r!=="bottom")throw Error(`Invalid layer "${r}" for SilkscreenCircle. Must be "top" or "bottom".`);let i=this.getSubcircuit(),s=this.parent?.pcb_component_id??this.getPrimitiveContainer()?.pcb_component_id,a=e.pcb_silkscreen_circle.insert({pcb_component_id:s,layer:r,center:{x:n.x,y:n.y},radius:t.radius,subcircuit_id:i?.subcircuit_id??void 0,pcb_group_id:this.getGroup()?.pcb_group_id??void 0,stroke_width:t.strokeWidth??0.1});this.pcb_silkscreen_circle_id=a.pcb_silkscreen_circle_id}getPcbSize(){let{_parsedProps:e}=this,t=e.radius*2;return{width:t,height:t}}_moveCircuitJsonElements({deltaX:e,deltaY:t}){if(this.root?.pcbDisabled)return;let{db:n}=this.root;if(!this.pcb_silkscreen_circle_id)return;let o=n.pcb_silkscreen_circle.get(this.pcb_silkscreen_circle_id);if(o)n.pcb_silkscreen_circle.update(this.pcb_silkscreen_circle_id,{center:{x:o.center.x+e,y:o.center.y+t}})}},e4n=class extends nr{pcb_silkscreen_line_id=null;isPcbPrimitive=!0;get config(){return{componentName:"SilkscreenLine",zodProps:yNt}}doInitialPcbPrimitiveRender(){if(this.root?.pcbDisabled)return;let{db:e}=this.root,{_parsedProps:t}=this,{maybeFlipLayer:n}=this._getPcbPrimitiveFlippedHelpers(),o=n(t.layer??"top");if(o!=="top"&&o!=="bottom")throw Error(`Invalid layer "${o}" for SilkscreenLine. Must be "top" or "bottom".`);let r=this.getSubcircuit(),i=this._computePcbGlobalTransformBeforeLayout(),s=yot.applyToPoint(i,{x:t.x1,y:t.y1}),a=yot.applyToPoint(i,{x:t.x2,y:t.y2}),c=this.parent?.pcb_component_id??this.getPrimitiveContainer()?.pcb_component_id,l=e.pcb_silkscreen_line.insert({pcb_component_id:c,layer:o,x1:s.x,y1:s.y,x2:a.x,y2:a.y,stroke_width:t.strokeWidth??0.1,subcircuit_id:r?.subcircuit_id??void 0,pcb_group_id:r?.getGroup()?.pcb_group_id??void 0});this.pcb_silkscreen_line_id=l.pcb_silkscreen_line_id}getPcbSize(){let{_parsedProps:e}=this,t=Math.abs(e.x2-e.x1),n=Math.abs(e.y2-e.y1);return{width:t,height:n}}_moveCircuitJsonElements({deltaX:e,deltaY:t}){if(this.root?.pcbDisabled)return;let{db:n}=this.root;if(!this.pcb_silkscreen_line_id)return;let o=n.pcb_silkscreen_line.get(this.pcb_silkscreen_line_id);if(o)n.pcb_silkscreen_line.update(this.pcb_silkscreen_line_id,{x1:o.x1+e,y1:o.y1+t,x2:o.x2+e,y2:o.y2+t})}},n4n=class extends nr{pcb_silkscreen_path_id=null;isPcbPrimitive=!0;get config(){return{componentName:"SilkscreenPath",zodProps:fNt}}doInitialPcbPrimitiveRender(){if(this.root?.pcbDisabled)return;let{db:e}=this.root,{_parsedProps:t}=this,{maybeFlipLayer:n}=this._getPcbPrimitiveFlippedHelpers(),o=n(t.layer??"top");if(o!=="top"&&o!=="bottom")throw Error(`Invalid layer "${o}" for SilkscreenPath. Must be "top" or "bottom".`);let r=this._computePcbGlobalTransformBeforeLayout(),i=this.getSubcircuit(),s=this.parent?.pcb_component_id??this.getPrimitiveContainer()?.pcb_component_id,a=e.pcb_silkscreen_path.insert({pcb_component_id:s,layer:o,route:t.route.map((c)=>{let l=t4n.applyToPoint(r,{x:c.x,y:c.y});return{...c,x:l.x,y:l.y}}),stroke_width:t.strokeWidth??0.1,subcircuit_id:i?.subcircuit_id??void 0,pcb_group_id:this.getGroup()?.pcb_group_id??void 0});this.pcb_silkscreen_path_id=a.pcb_silkscreen_path_id}_setPositionFromLayout(e){let{db:t}=this.root,{_parsedProps:n}=this,o=t.pcb_silkscreen_path.get(this.pcb_silkscreen_path_id);if(!o)return;let r=0,i=0;for(let l of o.route)r+=l.x,i+=l.y;r/=o.route.length,i/=o.route.length;let s=e.x-r,a=e.y-i,c=o.route.map((l)=>({...l,x:l.x+s,y:l.y+a}));t.pcb_silkscreen_path.update(this.pcb_silkscreen_path_id,{route:c})}_moveCircuitJsonElements({deltaX:e,deltaY:t}){if(this.root?.pcbDisabled)return;let{db:n}=this.root;if(!this.pcb_silkscreen_path_id)return;let o=n.pcb_silkscreen_path.get(this.pcb_silkscreen_path_id);if(o)n.pcb_silkscreen_path.update(this.pcb_silkscreen_path_id,{route:o.route.map((r)=>({...r,x:r.x+e,y:r.y+t}))})}getPcbSize(){let{_parsedProps:e}=this;if(!e.route||e.route.length===0)return{width:0,height:0};let t=1/0,n=-1/0,o=1/0,r=-1/0;for(let i of e.route)t=Math.min(t,i.x),n=Math.max(n,i.x),o=Math.min(o,i.y),r=Math.max(r,i.y);return{width:n-t,height:r-o}}},r4n=class extends nr{pcb_silkscreen_rect_id=null;isPcbPrimitive=!0;get config(){return{componentName:"SilkscreenRect",zodProps:xNt}}_isRotated90Degrees(){let e=this._computePcbGlobalTransformBeforeLayout(),o=(o4n.decomposeTSR(e).rotation.angle*180/Math.PI%360+360)%360,r=0.01;return Math.abs(o-90)<0.01||Math.abs(o-270)<0.01}doInitialPcbPrimitiveRender(){if(this.root?.pcbDisabled)return;let{db:e}=this.root,{_parsedProps:t}=this,{maybeFlipLayer:n}=this._getPcbPrimitiveFlippedHelpers(),o=n(t.layer??"top");if(o!=="top"&&o!=="bottom")throw Error(`Invalid layer "${o}" for SilkscreenRect. Must be "top" or "bottom".`);let r=this.getSubcircuit(),i=this._getGlobalPcbPositionBeforeLayout(),s=this._isRotated90Degrees(),a=s?t.height:t.width,c=s?t.width:t.height,l=this.parent?.pcb_component_id??this.getPrimitiveContainer()?.pcb_component_id,h=e.pcb_silkscreen_rect.insert({pcb_component_id:l,layer:o,center:{x:i.x,y:i.y},width:a,height:c,subcircuit_id:r?.subcircuit_id??void 0,pcb_group_id:this?.getGroup()?.pcb_group_id??void 0,stroke_width:t.strokeWidth??0.1,is_filled:t.filled??!1,corner_radius:t.cornerRadius??void 0});this.pcb_silkscreen_rect_id=h.pcb_silkscreen_rect_id}getPcbSize(){let{_parsedProps:e}=this;if(this._isRotated90Degrees())return{width:e.height,height:e.width};return{width:e.width,height:e.height}}_moveCircuitJsonElements({deltaX:e,deltaY:t}){if(this.root?.pcbDisabled)return;let{db:n}=this.root;if(!this.pcb_silkscreen_rect_id)return;let o=n.pcb_silkscreen_rect.get(this.pcb_silkscreen_rect_id);if(o)n.pcb_silkscreen_rect.update(this.pcb_silkscreen_rect_id,{center:{x:o.center.x+e,y:o.center.y+t}})}},wit=class extends nr{pcb_silkscreen_text_ids=[];isPcbPrimitive=!0;_footprinterFontSize;get config(){return{componentName:"SilkscreenText",zodProps:ANt}}doInitialPcbPrimitiveRender(){if(this.root?.pcbDisabled)return;let{db:e}=this.root,{_parsedProps:t}=this,n=this.getPrimitiveContainer(),{maybeFlipLayer:o,isFlipped:r}=this._getPcbPrimitiveFlippedHelpers(),i=this.getSubcircuit(),s=0;if(t.pcbRotation!==void 0&&t.pcbRotation!==0)s=t.pcbRotation;else{let x=this._computePcbGlobalTransformBeforeLayout();s=R9.decomposeTSR(x).rotation.angle*180/Math.PI}if(r)s=(s+180)%360;let a=new Set(t.layers);if(t.layer)a.add(t.layer);let c=a.size>0?Array.from(a):["top"],l=bJ({propertyName:"fontSize",resolvedPcbSx:this.getResolvedPcbSx(),pathFromAmpersand:"silkscreentext",component:this}),h=bJ({propertyName:"pcbX",resolvedPcbSx:this.getResolvedPcbSx(),pathFromAmpersand:"silkscreentext",component:this}),d=bJ({propertyName:"pcbY",resolvedPcbSx:this.getResolvedPcbSx(),pathFromAmpersand:"silkscreentext",component:this});if(bJ({propertyName:"visibility",resolvedPcbSx:this.getResolvedPcbSx(),pathFromAmpersand:"silkscreentext",component:this})==="hidden")return;let _=t.fontSize??l??this.getInheritedProperty("pcbStyle")?.silkscreenFontSize??this._footprinterFontSize??1,m=(h!==void 0||d!==void 0)&&this._footprinterFontSize!==void 0?R9.applyToPoint(R9.compose(this.parent?._computePcbGlobalTransformBeforeLayout()??R9.identity(),r?R9.flipY():R9.identity()),{x:this.resolvePcbCoordinate({rawValue:h??t.pcbX??0,axis:"pcbX"}),y:this.resolvePcbCoordinate({rawValue:d??t.pcbY??0,axis:"pcbY"})}):this._getGlobalPcbPositionBeforeLayout(),A=t.knockoutPadding??0,f=t.knockoutPadding!==void 0||t.knockoutPaddingLeft!==void 0||t.knockoutPaddingRight!==void 0||t.knockoutPaddingTop!==void 0||t.knockoutPaddingBottom!==void 0?{left:t.knockoutPaddingLeft??A,right:t.knockoutPaddingRight??A,top:t.knockoutPaddingTop??A,bottom:t.knockoutPaddingBottom??A}:void 0,y=this._resolveText();for(let x of c){let C=e.pcb_silkscreen_text.insert({anchor_alignment:t.anchorAlignment,anchor_position:{x:m.x,y:m.y},font:t.font??"tscircuit2024",font_size:_,layer:o(x),text:vue(y),ccw_rotation:s,pcb_component_id:n.pcb_component_id,subcircuit_id:i?.subcircuit_id??void 0,pcb_group_id:this.getGroup()?.pcb_group_id??void 0,is_knockout:t.isKnockout,knockout_padding:f});this.pcb_silkscreen_text_ids.push(C.pcb_silkscreen_text_id)}}getPcbSize(){let{_parsedProps:e}=this,t=bJ({propertyName:"fontSize",resolvedPcbSx:this.getResolvedPcbSx(),pathFromAmpersand:"silkscreentext",component:this}),n=e.fontSize??t??this.getInheritedProperty("pcbStyle")?.silkscreenFontSize??this._footprinterFontSize??1,r=this._resolveText().length*n,i=n;return{width:r*n,height:i*n}}_moveCircuitJsonElements({deltaX:e,deltaY:t}){if(this.root?.pcbDisabled)return;let{db:n}=this.root;for(let o of this.pcb_silkscreen_text_ids){let r=n.pcb_silkscreen_text.get(o);if(r)n.pcb_silkscreen_text.update(o,{anchor_position:{x:r.anchor_position.x+e,y:r.anchor_position.y+t}})}}},f9e=(e)=>{let t=new He.Polygon(e.map(({x:n,y:o})=>new He.Point(n,o)));if(t.orientation()===He.ORIENTATION.CW)t.reverse();return t};function vQr({points:e,solderPasteMargin:t}){if(t===0)return[{points:e}];let n=f9e(e),o=n;if(t===void 0){let r=Ms(e),i=(r.minX+r.maxX)/2,s=(r.minY+r.maxY)/2,a=AB.compose(AB.translate(i,s),AB.scale(0.7),AB.translate(-i,-s));o=He.BooleanOperations.intersect(n,f9e(e.map((c)=>AB.applyToPoint(a,c))))}else{let r=n.vertices,i=r.map((a,c)=>new He.Segment(a,r[(c+1)%r.length])).filter((a)=>!a.isZeroLength()),s=i.map((a)=>a.translate(a.tangentInStart().rotate90CW().multiply(t)));for(let[a,c]of i.entries()){let l=s[a],h=f9e([c.start,c.end,l.end,l.start]);o=t>0?He.BooleanOperations.unify(o,h):He.BooleanOperations.subtract(o,h);let d=(a+1)%i.length,u=i[d],_=s[d],p=c.tangentInStart().cross(u.tangentInStart());if(He.Utils.EQ_0(p)||p*t<0)continue;let[m]=new He.Line(l.start,l.end).intersect(new He.Line(_.start,_.end)),A=f9e([c.end,l.end,m,_.start]);o=t>0?He.BooleanOperations.unify(o,A):He.BooleanOperations.subtract(o,A)}}return o.splitToIslands().map((r)=>{let i=[...r.faces].sort((c,l)=>l.area()-c.area()),[s,...a]=i;return{points:s.vertices.map(({x:c,y:l})=>({x:c,y:l})),...a.length?{holes:a.map((c)=>c.vertices.map(({x:l,y:h})=>({x:l,y:h})))}:{}}})}var eB=class extends nr{pcb_smtpad_id=null;matchedPort=null;_inflatedPcbSolderPaste;isPcbPrimitive=!0;get config(){return{componentName:"SmtPad",zodProps:qTt}}getPcbSize(){let{_parsedProps:e}=this;if(e.shape==="circle")return{width:e.radius*2,height:e.radius*2};if(e.shape==="rect")return{width:e.width,height:e.height};if(e.shape==="rotated_rect"){let{width:t,height:n}=Jhe({width:e.width,height:e.height,ccwRotationDegrees:e.ccwRotation??0});return{width:t,height:n}}if(e.shape==="polygon"){let t=e.points,n=t.map((c)=>c.x),o=t.map((c)=>c.y),r=Math.min(...n),i=Math.max(...n),s=Math.min(...o),a=Math.max(...o);return{width:i-r,height:a-s}}if(e.shape==="pill")return{width:e.width,height:e.height};if(e.shape==="rotated_pill"){let{width:t,height:n}=Jhe({width:e.width,height:e.height,ccwRotationDegrees:e.ccwRotation});return{width:t,height:n}}throw Error(`getPcbSize for shape "${e.shape}" not implemented for ${this.componentName}`)}_getPcbBoundsBeforeLayout(){let{_parsedProps:e}=this;if(e.shape!=="polygon")return super._getPcbBoundsBeforeLayout();let t=this._computePcbGlobalTransformBeforeLayout(),n=e.points.map((r)=>lY.applyToPoint(t,r)),o=Ms(n);return{left:o.minX,right:o.maxX,top:o.maxY,bottom:o.minY}}doInitialPortMatching(){let e=this.getPrimitiveContainer()?.selectAll("port");if(!this.props.portHints)return;let t=G5n(e,this,this.props.portHints);if(!t)return;this.matchedPort=t,t.registerMatch(this)}doInitialPcbPrimitiveRender(){if(this.root?.pcbDisabled)return;let{db:e}=this.root,{_parsedProps:t}=this,n=t.coveredWithSolderMask??!1,o=!t.noSolderPaste&&!n&&this._getIsSmt(),{solderMaskMargin:r,solderPasteMargin:i}=t,s=(M,B=2)=>i!==void 0?Math.max(M+B*i,0):M*0.7;this.emitSolderMaskMarginWarning(n,r);let a=this.getSubcircuit(),c=this._getGlobalPcbPositionBeforeLayout(),l=this._computePcbGlobalTransformBeforeLayout(),u=(lY.decomposeTSR(this._computePcbGlobalTransformBeforeLayout()).rotation.angle*180/Math.PI%360+360)%360,_=0.01,p=Math.abs(u)<_||Math.abs(u-180)<_||Math.abs(u-360)<_,m=Math.abs(u-90)<_||Math.abs(u-270)<_,A=Math.abs(u-360)<_?0:u,g=A,{maybeFlipLayer:f,isFlipped:y}=this._getPcbPrimitiveFlippedHelpers(),x=this.getPrimitiveContainer(),C=x?.props?.layer!==void 0?x?._parsedProps.layer:void 0,b=(M)=>C??f(M);if(y)A=(360-A+360)%360;let I=t.portHints?.map((M)=>M.toString())??[],v=null,P=this.parent?.pcb_component_id??this.getPrimitiveContainer()?.pcb_component_id;if(t.shape==="circle"){v=e.pcb_smtpad.insert({pcb_component_id:P,pcb_port_id:this.matchedPort?.pcb_port_id,layer:b(t.layer??"top"),shape:"circle",radius:t.radius,port_hints:I,is_covered_with_solder_mask:n,soldermask_margin:r,x:c.x,y:c.y,subcircuit_id:a?.subcircuit_id??void 0});let M=s(v.radius,1);if(o&&M>0)e.pcb_solder_paste.insert({layer:v.layer,shape:"circle",radius:M,x:v.x,y:v.y,pcb_component_id:v.pcb_component_id,pcb_smtpad_id:v.pcb_smtpad_id,subcircuit_id:a?.subcircuit_id??void 0,pcb_group_id:this.getGroup()?.pcb_group_id??void 0})}else if(t.shape==="rect"){if(!p&&!m)v=e.pcb_smtpad.insert({pcb_component_id:P,pcb_port_id:this.matchedPort?.pcb_port_id,layer:b(t.layer??"top"),shape:"rotated_rect",width:t.width,height:t.height,corner_radius:t.cornerRadius??void 0,x:c.x,y:c.y,ccw_rotation:A,port_hints:I,is_covered_with_solder_mask:n,soldermask_margin:r,subcircuit_id:a?.subcircuit_id??void 0,pcb_group_id:this.getGroup()?.pcb_group_id??void 0});else v=e.pcb_smtpad.insert({pcb_component_id:P,pcb_port_id:this.matchedPort?.pcb_port_id,layer:b(t.layer??"top"),shape:"rect",width:m?t.height:t.width,height:m?t.width:t.height,corner_radius:t.cornerRadius??void 0,port_hints:I,is_covered_with_solder_mask:n,soldermask_margin:r,x:c.x,y:c.y,subcircuit_id:a?.subcircuit_id??void 0,pcb_group_id:this.getGroup()?.pcb_group_id??void 0});let B=s(v.width),T=s(v.height);if(o&&B>0&&T>0){if(v.shape==="rect")e.pcb_solder_paste.insert({layer:b(t.layer??"top"),shape:"rect",width:B,height:T,x:v.x,y:v.y,pcb_component_id:v.pcb_component_id,pcb_smtpad_id:v.pcb_smtpad_id,subcircuit_id:a?.subcircuit_id??void 0,pcb_group_id:this.getGroup()?.pcb_group_id??void 0});else if(v.shape==="rotated_rect")e.pcb_solder_paste.insert({layer:b(t.layer??"top"),shape:"rotated_rect",width:B,height:T,x:v.x,y:v.y,ccw_rotation:v.ccw_rotation,pcb_component_id:v.pcb_component_id,pcb_smtpad_id:v.pcb_smtpad_id,subcircuit_id:a?.subcircuit_id??void 0,pcb_group_id:this.getGroup()?.pcb_group_id??void 0})}}else if(t.shape==="rotated_rect"){let M=t.ccwRotation??0,B=(g+M+360)%360,T=y?(360-B+360)%360:B;v=e.pcb_smtpad.insert({pcb_component_id:P,pcb_port_id:this.matchedPort?.pcb_port_id,layer:b(t.layer??"top"),shape:"rotated_rect",width:t.width,height:t.height,corner_radius:t.cornerRadius??void 0,x:c.x,y:c.y,ccw_rotation:T,port_hints:I,is_covered_with_solder_mask:n,soldermask_margin:r,subcircuit_id:a?.subcircuit_id??void 0,pcb_group_id:this.getGroup()?.pcb_group_id??void 0});let N=s(v.width),D=s(v.height);if(o&&N>0&&D>0)e.pcb_solder_paste.insert({layer:b(t.layer??"top"),shape:"rotated_rect",width:N,height:D,x:c.x,y:c.y,ccw_rotation:T,pcb_component_id:P,pcb_smtpad_id:v.pcb_smtpad_id,subcircuit_id:a?.subcircuit_id??void 0,pcb_group_id:this.getGroup()?.pcb_group_id??void 0})}else if(t.shape==="polygon"){let M=t.points.map(({x:T,y:N})=>({x:Ke.parse(T),y:Ke.parse(N)})),B=M.map((T)=>lY.applyToPoint(l,T));if(v=e.pcb_smtpad.insert({pcb_component_id:P,pcb_port_id:this.matchedPort?.pcb_port_id,layer:b(t.layer??"top"),shape:"polygon",points:B,port_hints:I,is_covered_with_solder_mask:n,soldermask_margin:r,subcircuit_id:a?.subcircuit_id??void 0,pcb_group_id:this.getGroup()?.pcb_group_id??void 0}),o){let T=this._inflatedPcbSolderPaste??vQr({points:M,solderPasteMargin:i});for(let N of T)e.pcb_solder_paste.insert({shape:"polygon",layer:v.layer,points:N.points.map((D)=>lY.applyToPoint(l,D)),holes:N.holes?.map((D)=>D.map((L)=>lY.applyToPoint(l,L))),pcb_component_id:P??void 0,pcb_smtpad_id:v.pcb_smtpad_id,subcircuit_id:a?.subcircuit_id??void 0,pcb_group_id:this.getGroup()?.pcb_group_id??void 0})}}else if(t.shape==="rotated_pill"){let M=(g+t.ccwRotation+360)%360,B=y?(360-M+360)%360:M;v=e.pcb_smtpad.insert({pcb_component_id:P,pcb_port_id:this.matchedPort?.pcb_port_id,layer:b(t.layer??"top"),shape:"rotated_pill",x:c.x,y:c.y,radius:t.radius,height:t.height,width:t.width,ccw_rotation:B,port_hints:I,is_covered_with_solder_mask:n,soldermask_margin:r,subcircuit_id:a?.subcircuit_id??void 0,pcb_group_id:this.getGroup()?.pcb_group_id??void 0})}else if(t.shape==="pill")if(A!==0)v=e.pcb_smtpad.insert({pcb_component_id:P,pcb_port_id:this.matchedPort?.pcb_port_id,layer:b(t.layer??"top"),shape:"rotated_pill",x:c.x,y:c.y,radius:t.radius,height:t.height,width:t.width,ccw_rotation:A,port_hints:I,is_covered_with_solder_mask:n,soldermask_margin:r,subcircuit_id:a?.subcircuit_id??void 0,pcb_group_id:this.getGroup()?.pcb_group_id??void 0});else v=e.pcb_smtpad.insert({pcb_component_id:P,pcb_port_id:this.matchedPort?.pcb_port_id,layer:b(t.layer??"top"),shape:"pill",x:c.x,y:c.y,radius:t.radius,height:t.height,width:t.width,port_hints:I,is_covered_with_solder_mask:n,soldermask_margin:r,subcircuit_id:a?.subcircuit_id??void 0,pcb_group_id:this.getGroup()?.pcb_group_id??void 0});if(o&&(v?.shape==="pill"||v?.shape==="rotated_pill")){let M=s(v.width),B=s(v.height);if(M>0&&B>0){let T={x:v.x,y:v.y,width:M,height:B,radius:s(v.radius,1),layer:v.layer,pcb_component_id:v.pcb_component_id,pcb_smtpad_id:v.pcb_smtpad_id,subcircuit_id:v.subcircuit_id,pcb_group_id:v.pcb_group_id};if(v.shape==="rotated_pill")e.pcb_solder_paste.insert({...T,shape:"rotated_pill",ccw_rotation:v.ccw_rotation});else e.pcb_solder_paste.insert({...T,shape:"pill"})}}if(v)this.pcb_smtpad_id=v.pcb_smtpad_id}doInitialPcbPortAttachment(){if(this.root?.pcbDisabled)return;let{db:e}=this.root;e.pcb_smtpad.update(this.pcb_smtpad_id,{pcb_port_id:this.matchedPort?.pcb_port_id})}getAvailablePcbLayers(){let{maybeFlipLayer:e}=this._getPcbPrimitiveFlippedHelpers(),t=this.getPrimitiveContainer();return[(t?.props?.layer!==void 0?t?._parsedProps.layer:void 0)??e(this._parsedProps.layer??"top")]}_getPcbCircuitJsonBounds(){let{db:e}=this.root,t=e.pcb_smtpad.get(this.pcb_smtpad_id);if(t.shape==="rect")return{center:{x:t.x,y:t.y},bounds:{left:t.x-t.width/2,top:t.y+t.height/2,right:t.x+t.width/2,bottom:t.y-t.height/2},width:t.width,height:t.height};if(t.shape==="rotated_rect"){let{width:n,height:o,xExtent:r,yExtent:i}=Jhe({width:t.width,height:t.height,ccwRotationDegrees:t.ccw_rotation});return{center:{x:t.x,y:t.y},bounds:{left:t.x-r,right:t.x+r,top:t.y-i,bottom:t.y+i},width:n,height:o}}if(t.shape==="circle")return{center:{x:t.x,y:t.y},bounds:{left:t.x-t.radius,top:t.y-t.radius,right:t.x+t.radius,bottom:t.y+t.radius},width:t.radius*2,height:t.radius*2};if(t.shape==="polygon"){let n=t.points,o=n.map((l)=>l.x),r=n.map((l)=>l.y),i=Math.min(...o),s=Math.max(...o),a=Math.min(...r),c=Math.max(...r);return{center:{x:(i+s)/2,y:(a+c)/2},bounds:{left:i,top:c,right:s,bottom:a},width:s-i,height:c-a}}if(t.shape==="pill"){let n=t.width/2,o=t.height/2;return{center:{x:t.x,y:t.y},bounds:{left:t.x-n,top:t.y-o,right:t.x+n,bottom:t.y+o},width:t.width,height:t.height}}if(t.shape==="rotated_pill"){let{width:n,height:o,xExtent:r,yExtent:i}=Jhe({width:t.width,height:t.height,ccwRotationDegrees:t.ccw_rotation});return{center:{x:t.x,y:t.y},bounds:{left:t.x-r,right:t.x+r,top:t.y-i,bottom:t.y+i},width:n,height:o}}throw Error(`circuitJson bounds calculation not implemented for shape "${t.shape}"`)}_setPositionFromLayout(e){let{db:t}=this.root;t.pcb_smtpad.update(this.pcb_smtpad_id,{x:e.x,y:e.y});let n=t.pcb_solder_paste.list().find((o)=>o.pcb_smtpad_id===this.pcb_smtpad_id);if(n)t.pcb_solder_paste.update(n.pcb_solder_paste_id,{x:e.x,y:e.y});this.matchedPort?._setPositionFromLayout(e)}_moveCircuitJsonElements({deltaX:e,deltaY:t}){if(this.root?.pcbDisabled)return;let{db:n}=this.root;if(!this.pcb_smtpad_id)return;let o=n.pcb_smtpad.get(this.pcb_smtpad_id);if(o.shape==="rect"||o.shape==="circle"||o.shape==="rotated_rect"||o.shape==="pill"||o.shape==="rotated_pill")this._setPositionFromLayout({x:o.x+e,y:o.y+t});else if(o.shape==="polygon"){n.pcb_smtpad.update(this.pcb_smtpad_id,{points:o.points.map((i)=>({x:i.x+e,y:i.y+t}))});for(let i of n.pcb_solder_paste.list()){if(i.pcb_smtpad_id!==this.pcb_smtpad_id||i.shape!=="polygon")continue;n.pcb_solder_paste.update(i.pcb_solder_paste_id,{points:i.points.map(({x:s,y:a})=>({x:s+e,y:a+t})),holes:i.holes?.map((s)=>s.map(({x:a,y:c})=>({x:a+e,y:c+t})))})}let r={x:this._getPcbCircuitJsonBounds().center.x+e/2,y:this._getPcbCircuitJsonBounds().center.y+t/2};this.matchedPort?._setPositionFromLayout(r)}}},SQr=(e)=>e.type==="pcb_solder_paste"&&!e.pcb_smtpad_id&&(e.shape==="circle"||e.shape==="rect"||e.shape==="rotated_rect"),i4n=class e extends nr{pcb_solder_paste_id=null;isPcbPrimitive=!0;circuitJsonRotation=0;static fromCircuitJson(t){let n={pcbX:t.x,pcbY:t.y,layer:t.layer},o;if(t.shape==="circle")o={...n,shape:"circle",radius:t.radius};else o={...n,shape:"rect",width:t.width,height:t.height};let r=new e(o);if(t.shape==="rotated_rect")r.circuitJsonRotation=t.ccw_rotation;return r}_getPcbRotationBeforeLayout(){return this.circuitJsonRotation}get config(){return{componentName:"SolderPaste",zodProps:JTt}}getPcbSize(){let t=this._parsedProps;if(t.shape==="circle")return{width:t.radius*2,height:t.radius*2};return{width:t.width,height:t.height}}doInitialPcbPrimitiveRender(){if(this.root?.pcbDisabled)return;let{db:t}=this.root,n=this._parsedProps,o=n.layer??"top";if(o!=="top"&&o!=="bottom")throw Error(`Invalid layer "${o}" for SolderPaste. Must be "top" or "bottom".`);let r=this._computePcbGlobalTransformBeforeLayout(),{maybeFlipLayer:i,isFlipped:s}=this._getPcbPrimitiveFlippedHelpers(),a=n7e.applyToPoint(r,{x:0,y:0}),c=n7e.decomposeTSR(r,!1,s).rotation.angle*180/Math.PI,l={...a,layer:i(o),pcb_component_id:this.parent?.pcb_component_id??this.getPrimitiveContainer()?.pcb_component_id??void 0,pcb_group_id:this.getGroup()?.pcb_group_id??void 0,subcircuit_id:this.getSubcircuit().subcircuit_id??void 0},h;if(n.shape==="circle")h=t.pcb_solder_paste.insert({...l,shape:"circle",radius:n.radius});else if(Math.abs(c)<0.00000001)h=t.pcb_solder_paste.insert({...l,shape:"rect",width:n.width,height:n.height});else h=t.pcb_solder_paste.insert({...l,shape:"rotated_rect",ccw_rotation:c,width:n.width,height:n.height});this.pcb_solder_paste_id=h.pcb_solder_paste_id}_moveCircuitJsonElements({deltaX:t,deltaY:n}){if(!this.pcb_solder_paste_id)return;let{db:o}=this.root,r=o.pcb_solder_paste.get(this.pcb_solder_paste_id);o.pcb_solder_paste.update(this.pcb_solder_paste_id,{x:r.x+t,y:r.y+n})}removePcbPrimitiveRender(){if(!this.pcb_solder_paste_id)return;this.root.db.pcb_solder_paste.delete(this.pcb_solder_paste_id),this.pcb_solder_paste_id=null}},Bit=class extends nr{isPrimitiveContainer=!0;schematic_symbol_id;userCoordinateToResizedSymbolTransformMat;schematicSymbolBoundsInSymbolLocalCoordinateSpace;get config(){return{componentName:"Symbol",zodProps:lDt}}hasExplicitSize(){let{_parsedProps:e}=this;return e.width!==void 0||e.height!==void 0}doInitialSymbolContainerRender(){if(this.root?.schematicDisabled)return;let{db:e}=this.root,{_parsedProps:t}=this,o=this.getParentNormalComponent()?._parsedProps?.kicadSymbolMetadata,r=e.schematic_symbol.insert({name:t.name,metadata:o?{kicad_symbol:o}:void 0});this.schematic_symbol_id=r.schematic_symbol_id}getSchematicSymbolBounds(){if(this.schematicSymbolBoundsInSymbolLocalCoordinateSpace)return this.schematicSymbolBoundsInSymbolLocalCoordinateSpace;return this._computeSchematicSymbolBounds(),this.schematicSymbolBoundsInSymbolLocalCoordinateSpace??null}getUserCoordinateToResizedSymbolTransform(){if(this.userCoordinateToResizedSymbolTransformMat)return this.userCoordinateToResizedSymbolTransformMat;this._computeUserCoordinateToResizedSymbolTransform();let e=this.getParentNormalComponent(),t=e?._parsedProps.schRotation??0;if(e&&t!==0){let n=e._getGlobalSchematicPositionBeforeLayout();this.userCoordinateToResizedSymbolTransformMat=qx.compose(qx.translate(n.x,n.y),qx.rotateDEG(t),qx.translate(-n.x,-n.y),this.userCoordinateToResizedSymbolTransformMat??qx.identity())}return this.userCoordinateToResizedSymbolTransformMat??null}_computeSchematicSymbolBounds(){if(this.root?.schematicDisabled)return;let{db:e}=this.root,{viewbox:t}=this._parsedProps;if(t){let r=this._getGlobalSchematicPositionBeforeLayout();this.schematicSymbolBoundsInSymbolLocalCoordinateSpace={minX:r.x+t.minX,maxX:r.x+t.maxX,minY:r.y+t.minY,maxY:r.y+t.maxY};return}let n=[];for(let r of this.children){if(r.componentName==="Port"){let i=r.schematic_port_id;if(i){let s=e.schematic_port.get(i);if(s)n.push(s)}continue}if(!r.isSchematicPrimitive)continue;if(r.componentName==="SchematicLine"){let i=e.schematic_line.get(r.schematic_line_id);if(i)n.push(i)}else if(r.componentName==="SchematicRect"){let i=e.schematic_rect.get(r.schematic_rect_id);if(i)n.push(i)}else if(r.componentName==="SchematicCircle"){let i=e.schematic_circle.get(r.schematic_circle_id);if(i)n.push(i)}else if(r.componentName==="SchematicArc"){let i=e.schematic_arc.get(r.schematic_arc_id);if(i)n.push(i)}else if(r.componentName==="SchematicText"){let i=e.schematic_text.get(r.schematic_text_id);if(i)n.push(i)}else if(r.componentName==="SchematicPath"){let i=r.schematic_path_ids;if(i)for(let s of i){let a=e.schematic_path.get(s);if(a)n.push(a)}}}if(n.length===0)return;let o=bue(n);this.schematicSymbolBoundsInSymbolLocalCoordinateSpace=o}_computeUserCoordinateToResizedSymbolTransform(){if(!this.hasExplicitSize())return;let e=this.getSchematicSymbolBounds();if(!e)return;let{_parsedProps:t}=this,{width:n,height:o}=t;if(n===void 0&&o===void 0)return;let r=e.maxX-e.minX,i=e.maxY-e.minY;if(r===0&&i===0)return;let s=(e.minX+e.maxX)/2,a=(e.minY+e.maxY)/2,c=n!==void 0&&r>0?n/r:1,l=o!==void 0&&i>0?o/i:1;if(t.fit==="contain"){let d=[];if(n!==void 0&&r>0)d.push(n/r);if(o!==void 0&&i>0)d.push(o/i);let u=d.length?Math.min(...d):1;c=u,l=u}let h=this._getGlobalSchematicPositionBeforeLayout();this.userCoordinateToResizedSymbolTransformMat=qx.compose(qx.translate(h.x,h.y),qx.scale(c,l),qx.translate(-s,-a))}},PQr=({elm:e,pinLabels:t,layer:n,readableRotation:o,anchorAlignment:r})=>{let i=e.text.replace(/[{}]/g,"").toLowerCase(),s=i;if(Array.isArray(t)){let c=parseInt(i.replace(/[^\d]/g,""),10)-1;s=String(t[c]??i)}else if(typeof t==="object")s=String(t[i]??i);let a=new wit({anchorAlignment:r||"center",text:s??i,layer:n||"top",pcbX:isNaN(e.anchor_position.x)?0:e.anchor_position.x,pcbY:e.anchor_position.y,pcbRotation:o??0});return a._footprinterFontSize=e.font_size+0.2,a},EQr=(e,t)=>{let n=parseInt(e||"0",10),o;if(t!==void 0&&t!==null)o=t-n;else o=n;return(o%360+360)%360},mJ=(e)=>e??void 0,MQr=(e)=>{for(let t of e??[]){if(/^\d+$/.test(t))return Number(t);let n=/^pin(\d+)$/i.exec(t);if(n)return Number(n[1])}},wQr=(e)=>{switch(e){case"left":case"right":return e;case"top":return"up";case"bottom":return"down"}return null},BQr=["schematic_line","schematic_rect","schematic_circle","schematic_arc","schematic_path"],TQr=(e)=>BQr.includes(e.type),fgn=(e)=>{if(!("schematic_symbol_id"in e))return;if(typeof e.schematic_symbol_id==="string")return e.schematic_symbol_id;return},sB=({sourcePortOwner:e,componentName:t,componentRotation:n,footprinterString:o,pinLabels:r,pcbPinLabels:i,preserveSolderPaste:s=!1},a)=>{let c=a.filter((f)=>f.type==="source_port");if(e){let f=Kxn(a);if(f!==void 0)e._importedInternallyConnectedPinNames=f}if(e&&c.length>0){e._importedSourcePorts=c;for(let f of e._getAllPortsFromChildren())f._markDirty("SourceRender")}let l=[],h=new Map,d=new Map,u=new Map,_=new Map,p=new Map,m=new Map;for(let f of a){if(f.type==="pcb_component"&&typeof f.source_component_id==="string")u.set(f.pcb_component_id,f.source_component_id);if(f.type==="source_port"){if(_.set(f.source_port_id,f),typeof f.pin_number==="number"&&typeof f.source_component_id==="string"){let y=p.get(f.source_component_id);if(!y)y=new Map,p.set(f.source_component_id,y);y.set(f.pin_number,f)}}}let A=(f,y)=>{let x=MQr(f);if(typeof y!=="string")return f;let C=u.get(y);if(typeof x!=="number"||!C)return f;let b=p.get(C)?.get(x);if(!b)return f;let I=Array.from(new Set([...f??[],...b.port_hints??[],b.name].filter((v)=>typeof v==="string"&&v.length>0)));if(I.length>0)return I;return f};for(let f of a){if(f.type!=="schematic_symbol")continue;let y=new Bit({name:f.name});h.set(f.schematic_symbol_id,y),l.push(y)}for(let f of a){if(!TQr(f))continue;let y=fgn(f),x=f.stroke_width;if(!y||typeof x!=="number"||!Number.isFinite(x)||m.has(y))continue;m.set(y,x)}for(let f of a){if(f.type!=="schematic_component")continue;d.set(f.schematic_component_id,f)}let g=(f,y)=>{let x=fgn(f);if(x===void 0&&"schematic_component_id"in f&&typeof f.schematic_component_id==="string")x=d.get(f.schematic_component_id)?.schematic_symbol_id;if(typeof x==="string"){let C=h.get(x);if(C){C.add(y);return}}l.push(y)};for(let f of a){let y;if("port_hints"in f){if(y=f.port_hints,"pcb_component_id"in f)y=A(f.port_hints,f.pcb_component_id)}let x;if(s&&f.type==="pcb_smtpad"&&!a.some((C)=>C.type==="pcb_solder_paste"&&C.pcb_smtpad_id===f.pcb_smtpad_id)){if(f.shape==="circle")x=-f.radius;else if(f.shape!=="polygon")x=-Math.min(f.width,f.height)/2}if(SQr(f))l.push(i4n.fromCircuitJson(f));else if(f.type==="pcb_soldermask_opening"){let C;if(f.shape==="polygon")C={shape:"polygon",layer:f.layer,points:f.points};else if(f.shape==="circle")C={shape:"circle",layer:f.layer,pcbX:f.x,pcbY:f.y,radius:f.radius};else{let b=0;if(f.shape==="rotated_rect")b=f.ccw_rotation;C={shape:"rect",layer:f.layer,pcbX:f.x,pcbY:f.y,width:f.width,height:f.height,pcbRotation:b}}l.push(new O5n(C))}else if(f.type==="pcb_smtpad"&&f.shape==="rect")l.push(new eB({pcbX:f.x,pcbY:f.y,layer:f.layer,shape:"rect",height:f.height,width:f.width,portHints:y,rectBorderRadius:f.rect_border_radius,solderPasteMargin:x}));else if(f.type==="pcb_smtpad"&&f.shape==="circle")l.push(new eB({pcbX:f.x,pcbY:f.y,layer:f.layer,shape:"circle",radius:f.radius,portHints:y,solderPasteMargin:x}));else if(f.type==="pcb_smtpad"&&f.shape==="pill")l.push(new eB({shape:"pill",height:f.height,width:f.width,radius:f.radius,portHints:y,pcbX:f.x,pcbY:f.y,layer:f.layer,solderPasteMargin:x}));else if(f.type==="pcb_smtpad"&&f.shape==="rotated_pill")l.push(new eB({shape:"rotated_pill",height:f.height,width:f.width,radius:f.radius,portHints:y,pcbX:f.x,pcbY:f.y,layer:f.layer,ccwRotation:f.ccw_rotation,solderPasteMargin:x}));else if(f.type==="pcb_smtpad"&&f.shape==="rotated_rect")l.push(new eB({pcbX:f.x,pcbY:f.y,layer:f.layer,shape:"rotated_rect",height:f.height,width:f.width,ccwRotation:f.ccw_rotation,cornerRadius:f.corner_radius,portHints:y,solderPasteMargin:x}));else if(f.type==="pcb_smtpad"&&f.shape==="polygon"){let C=new eB({shape:"polygon",points:f.points,portHints:y,layer:f.layer,coveredWithSolderMask:f.is_covered_with_solder_mask,solderMaskMargin:f.soldermask_margin}),b=a.filter((I)=>I.type==="pcb_solder_paste"&&I.shape==="polygon"&&I.pcb_smtpad_id===f.pcb_smtpad_id);if(s||b.length>0)C._inflatedPcbSolderPaste=b;l.push(C)}else if(f.type==="pcb_silkscreen_path")l.push(new n4n({layer:f.layer,route:f.route,strokeWidth:f.stroke_width}));else if(f.type==="pcb_copper_text")l.push(new b5n({text:f.text,pcbX:f.anchor_position.x,pcbY:f.anchor_position.y,pcbRotation:f.ccw_rotation,anchorAlignment:f.anchor_alignment,fontSize:f.font_size,layer:f.layer,mirrored:f.is_mirrored,knockout:f.is_knockout}));else if(f.type==="pcb_plated_hole"){if(f.shape==="circle")l.push(new Zw({pcbX:f.x,pcbY:f.y,shape:"circle",holeDiameter:f.hole_diameter,outerDiameter:f.outer_diameter,portHints:y}));else if(f.shape==="circular_hole_with_rect_pad")l.push(new Zw({pcbX:f.x,pcbY:f.y,shape:"circular_hole_with_rect_pad",holeDiameter:f.hole_diameter,rectPadHeight:f.rect_pad_height,rectPadWidth:f.rect_pad_width,portHints:y,rectBorderRadius:f.rect_border_radius,holeOffsetX:f.hole_offset_x,holeOffsetY:f.hole_offset_y}));else if(f.shape==="pill"||f.shape==="oval")l.push(new Zw({pcbX:f.x,pcbY:f.y,shape:f.shape,holeWidth:f.hole_width,holeHeight:f.hole_height,outerWidth:f.outer_width,outerHeight:f.outer_height,portHints:y}));else if(f.shape==="pill_hole_with_rect_pad")l.push(new Zw({pcbX:f.x,pcbY:f.y,shape:"pill_hole_with_rect_pad",holeShape:"pill",padShape:"rect",holeWidth:f.hole_width,holeHeight:f.hole_height,rectPadWidth:f.rect_pad_width,rectPadHeight:f.rect_pad_height,rectBorderRadius:f.rect_border_radius,portHints:y,holeOffsetX:f.hole_offset_x,holeOffsetY:f.hole_offset_y}));else if(f.shape==="rotated_pill_hole_with_rect_pad")l.push(new Zw({pcbX:f.x,pcbY:f.y,shape:"pill_hole_with_rect_pad",holeShape:"pill",padShape:"rect",holeWidth:f.hole_width,holeHeight:f.hole_height,rectPadWidth:f.rect_pad_width,rectPadHeight:f.rect_pad_height,rectBorderRadius:f.rect_border_radius,portHints:y,holeOffsetX:f.hole_offset_x,holeOffsetY:f.hole_offset_y,pcbRotation:f.hole_ccw_rotation}));else if(f.shape==="hole_with_polygon_pad")l.push(new Zw({pcbX:f.x,pcbY:f.y,shape:"hole_with_polygon_pad",holeShape:f.hole_shape||"circle",holeDiameter:f.hole_diameter,holeWidth:f.hole_width,holeHeight:f.hole_height,padOutline:f.pad_outline||[],holeOffsetX:f.hole_offset_x,holeOffsetY:f.hole_offset_y,portHints:y}))}else if(f.type==="pcb_keepout"&&f.shape==="circle")l.push(new i8e({warningOnly:f.warning_only,allowTraces:f.allow_traces,allowPlacements:f.allow_placements,layers:f.layers.map((C)=>Bo.parse(C)),pcbX:f.center.x,pcbY:f.center.y,shape:"circle",radius:f.radius}));else if(f.type==="pcb_keepout"&&f.shape==="rect")l.push(new i8e({warningOnly:f.warning_only,allowTraces:f.allow_traces,allowPlacements:f.allow_placements,layers:f.layers.map((C)=>Bo.parse(C)),pcbX:f.center.x,pcbY:f.center.y,shape:"rect",width:f.width,height:f.height}));else if(f.type==="pcb_hole"&&f.hole_shape==="circle")l.push(new IJ({pcbX:f.x,pcbY:f.y,diameter:f.hole_diameter}));else if(f.type==="pcb_hole"&&f.hole_shape==="rect")l.push(new IJ({pcbX:f.x,pcbY:f.y,shape:"rect",width:f.hole_width,height:f.hole_height}));else if(f.type==="pcb_hole"&&f.hole_shape==="pill")l.push(new IJ({pcbX:f.x,pcbY:f.y,shape:"pill",width:f.hole_width,height:f.hole_height}));else if(f.type==="pcb_hole"&&f.hole_shape==="oval")l.push(new IJ({pcbX:f.x,pcbY:f.y,shape:"oval",width:f.hole_width,height:f.hole_height}));else if(f.type==="pcb_hole"&&f.hole_shape==="rotated_pill")l.push(new IJ({pcbX:f.x,pcbY:f.y,shape:"pill",width:f.hole_width,height:f.hole_height,pcbRotation:f.ccw_rotation}));else if(f.type==="pcb_cutout"){if(f.shape==="rect")l.push(new wve({pcbX:f.center.x,pcbY:f.center.y,shape:"rect",width:f.width,height:f.height}));else if(f.shape==="circle")l.push(new wve({pcbX:f.center.x,pcbY:f.center.y,shape:"circle",radius:f.radius}));else if(f.shape==="polygon")l.push(new wve({shape:"polygon",points:f.points}))}else if(f.type==="pcb_silkscreen_text"){let C=EQr(n,f.ccw_rotation);if((o?.includes("pinrow")||o?.includes("headermodule"))&&f.text.includes("PIN"))l.push(PQr({elm:f,pinLabels:i??r??{},layer:f.layer,readableRotation:C,anchorAlignment:f.anchor_alignment}));else{let b=t||f.text;if(o?.includes("silkscreenlabel(")&&f.text!=="{REF}"&&f.text!=="{NAME}"&&f.text!=="{REFERENCE}")b=f.text;let I=f.anchor_position.x;if(Number.isNaN(I))I=0;let v=new wit({anchorAlignment:f.anchor_alignment||"center",text:b,pcbX:I,pcbY:f.anchor_position.y,pcbRotation:C??0});v._footprinterFontSize=f.font_size+0.2,l.push(v)}}else if(f.type==="pcb_trace"){let C=new Mit({route:f.route});for(let[b,I]of f.route.entries()){if(I.route_type!=="via")continue;if(a.some((v)=>v.type==="pcb_via"&&v.x===I.x&&v.y===I.y&&v.layers.includes(I.from_layer)&&v.layers.includes(I.to_layer)))C._materializedRouteViaIndices.add(b)}l.push(C)}else if(f.type==="pcb_via"){let C=vN.parse(f),b=f.layers??[],I=new V5n({pcbX:f.x,pcbY:f.y,holeDiameter:f.hole_diameter,outerDiameter:f.outer_diameter,fromLayer:f.from_layer??b[0],toLayer:f.to_layer??b[b.length-1],layers:b,netIsAssignable:f.net_is_assignable,tentedOnTop:C.tented_on_top,tentedOnBottom:C.tented_on_bottom});I._importedPcbTraceId=f.pcb_trace_id,l.push(I)}else if(f.type==="pcb_silkscreen_rect")l.push(new r4n({pcbX:f.center.x,pcbY:f.center.y,width:f.width,height:f.height,layer:f.layer,strokeWidth:f.stroke_width,filled:f.is_filled,cornerRadius:f.corner_radius}));else if(f.type==="pcb_silkscreen_circle")l.push(new Z5n({pcbX:f.center.x,pcbY:f.center.y,radius:f.radius,layer:f.layer,strokeWidth:f.stroke_width}));else if(f.type==="pcb_silkscreen_line")l.push(new e4n({x1:f.x1,y1:f.y1,x2:f.x2,y2:f.y2,layer:f.layer,strokeWidth:f.stroke_width}));else if(f.type==="pcb_fabrication_note_text")l.push(new D5n({pcbX:f.anchor_position.x,pcbY:f.anchor_position.y,text:f.text,fontSize:f.font_size,anchorAlignment:f.anchor_alignment,color:f.color,font:f.font,layer:f.layer,pcbRotation:f.ccw_rotation}));else if(f.type==="pcb_fabrication_note_path")l.push(new w5n({route:f.route,strokeWidth:f.stroke_width,color:f.color,isFilled:f.is_filled,hasStroke:f.has_stroke,layer:f.layer}));else if(f.type==="pcb_fabrication_note_rect")l.push(new B5n({pcbX:f.center.x,pcbY:f.center.y,width:f.width,height:f.height,strokeWidth:f.stroke_width,isFilled:f.is_filled,color:f.color,layer:f.layer,cornerRadius:f.corner_radius,hasStroke:f.has_stroke,isStrokeDashed:f.is_stroke_dashed}));else if(f.type==="pcb_note_text")l.push(new z5n({pcbX:f.anchor_position.x,pcbY:f.anchor_position.y,text:f.text??"",fontSize:f.font_size,anchorAlignment:f.anchor_alignment,color:f.color,font:f.font}));else if(f.type==="pcb_note_rect")l.push(new H5n({pcbX:f.center.x,pcbY:f.center.y,width:f.width,height:f.height,strokeWidth:f.stroke_width,isFilled:f.is_filled,color:f.color,cornerRadius:f.corner_radius,hasStroke:f.has_stroke,isStrokeDashed:f.is_stroke_dashed}));else if(f.type==="pcb_note_path")l.push(new k5n({route:f.route,strokeWidth:f.stroke_width,color:f.color}));else if(f.type==="pcb_note_line")l.push(new R5n({x1:f.x1,y1:f.y1,x2:f.x2,y2:f.y2,strokeWidth:f.stroke_width,color:f.color,isDashed:f.is_dashed}));else if(f.type==="pcb_courtyard_rect")l.push(new E5n({pcbX:f.center.x,pcbY:f.center.y,width:f.width,height:f.height,pcbRotation:f.ccw_rotation,layer:f.layer}));else if(f.type==="pcb_courtyard_circle")l.push(new I5n({pcbX:f.center.x,pcbY:f.center.y,radius:f.radius,layer:f.layer}));else if(f.type==="pcb_courtyard_outline")l.push(new S5n({outline:f.outline,layer:f.layer}));else if(f.type==="schematic_line")g(f,new fot({x1:f.x1,y1:f.y1,x2:f.x2,y2:f.y2,strokeWidth:mJ(f.stroke_width),color:f.color,isDashed:f.is_dashed}));else if(f.type==="schematic_rect")g(f,new $5n({schX:f.center.x,schY:f.center.y,width:f.width,height:f.height,rotation:f.rotation,strokeWidth:mJ(f.stroke_width),color:f.color,isFilled:f.is_filled,fillColor:f.fill_color,isDashed:f.is_dashed}));else if(f.type==="schematic_circle")g(f,new W5n({center:f.center,radius:f.radius,strokeWidth:mJ(f.stroke_width),color:f.color,isFilled:f.is_filled,fillColor:f.fill_color,isDashed:f.is_dashed}));else if(f.type==="schematic_arc")g(f,new U5n({center:f.center,radius:f.radius,startAngleDegrees:f.start_angle_degrees,endAngleDegrees:f.end_angle_degrees,direction:f.direction,strokeWidth:mJ(f.stroke_width),color:f.color,isDashed:f.is_dashed}));else if(f.type==="schematic_text")g(f,new J5n({schX:f.position.x,schY:f.position.y,text:f.text,fontSize:f.font_size,anchor:f.anchor,color:f.color,schRotation:f.rotation}));else if(f.type==="schematic_path")g(f,new j5n({points:f.points,strokeWidth:mJ(f.stroke_width),strokeColor:f.stroke_color,dashLength:f.dash_length,dashGap:f.dash_gap,isFilled:f.is_filled,fillColor:f.fill_color}));else if(f.type==="schematic_port"){let C=f.schematic_component_id;if(typeof C!=="string")continue;let b=d.get(C),I=b?.schematic_symbol_id,v;if(typeof I==="string")v=h.get(I);if(v&&b?.is_box_with_pins===!0&&f.center&&f.side_of_component){let P=f.distance_from_component_edge,M=wQr(f.side_of_component);if(!M)continue;let B=m7(M),T=-1;if(f.facing_direction===M)T=1;let N={x:f.center.x+B.x*P*T,y:f.center.y+B.y*P*T},D=_.get(f.source_port_id),L=Array.from(new Set([f.display_pin_label,D?.name,...D?.port_hints??[]].filter((U)=>typeof U==="string"&&U.length>0))),H=f.schematic_port_id;if(f.pin_number)H=`pin${f.pin_number}`;let V=L[0]??f.source_port_id??H;v.add(new Lh({pinNumber:f.pin_number,name:V,aliases:L,schX:f.center.x,schY:f.center.y,direction:M}));let O;if(typeof I==="string")O=mJ(m.get(I));v.add(new fot({x1:f.center.x,y1:f.center.y,x2:N.x,y2:N.y,strokeWidth:O,isDashed:!1}))}}}return l};var DQr=["Silkscreen","PcbNote","Courtyard","FabricationNote"];function o7e(e){let t=1/0,n=1/0,o=-1/0,r=-1/0,i=!1;for(let c of e)if(c.isPcbPrimitive&&!DQr.some((l)=>c.componentName.startsWith(l))){let l=c._getPcbLocalBoundsBeforeLayout(),d=[{x:l.left,y:l.bottom},{x:l.right,y:l.bottom},{x:l.right,y:l.top},{x:l.left,y:l.top}].map((p)=>s4n.applyToPoint(c._computePcbGlobalTransformBeforeLayout(),p)),u=d.map((p)=>p.x),_=d.map((p)=>p.y);t=Math.min(t,...u),n=Math.min(n,..._),o=Math.max(o,...u),r=Math.max(r,..._),i=!0}else if(c.children.length>0){let l=o7e(c.children);if(l.width>0||l.height>0)t=Math.min(t,l.minX),n=Math.min(n,l.minY),o=Math.max(o,l.maxX),r=Math.max(r,l.maxY),i=!0}if(!i)return{minX:0,minY:0,maxX:0,maxY:0,width:0,height:0};let s=o-t,a=r-n;if(s<0)s=0;if(a<0)a=0;return{minX:t,minY:n,maxX:o,maxY:r,width:s,height:a}}var r7e=(e)=>{let t=e.find((n)=>/^(pin)?\d+$/.test(n));if(!t)return null;return Number.parseInt(t.replace(/^pin/,""))};function xot(e,t){let n=r7e(e);if(!n)return null;let r=[...e.filter((i)=>i.toString()!==n.toString()&&i!==`pin${n}`&&i.trim()!==""),...t?.additionalAliases?.[`pin${n}`]??[]];return new Lh({pinNumber:n,aliases:r})}function hk(e){if(!e)return[];if(Array.isArray(e))return e;return e.pins??[]}var a4n=(e)=>{for(let t of["leftSide","rightSide","topSide","bottomSide"])if(t in e&&typeof e[t]==="number")throw Error(`A number was specified for "${t}", you probably meant to use "size" not "side"`);return"leftSide"in e||"rightSide"in e||"topSide"in e||"bottomSide"in e},Bve=(e)=>{if(!e||!a4n(e))return[];return[...hk(e.leftSide),...hk(e.rightSide),...hk(e.topSide),...hk(e.bottomSide)]},NQr=(e)=>{if(a4n(e))return{leftSize:hk(e.leftSide).length,rightSize:hk(e.rightSide).length,topSize:hk(e.topSide).length,bottomSize:hk(e.bottomSide).length};let{leftSize:t=0,rightSize:n=0,topSize:o=0,bottomSize:r=0}=e;return{leftSize:t,rightSize:n,topSize:o,bottomSize:r}},y9e=0.4,c4n=0.1,ygn=0.1,RQr=(e)=>typeof e==="string"?e:e?.[0]??"",QQr=(e)=>Array.from(RQr(e)).length*c4n;function l4n(e){let t=e;return t.leftSide!==void 0||t.rightSide!==void 0||t.topSide!==void 0||t.bottomSide!==void 0}var Tit=(e)=>{let t=e.portDistanceFromEdge??0.4,n=e.schPortArrangement?NQr(e.schPortArrangement):null,o={left:0,right:0,top:0,bottom:0},r=e.pinCount??null;if(r===null)if(n)r=n.leftSize+n.rightSize+n.topSize;else throw Error("Could not determine pin count for the schematic box");if(r&&!n){let p=Math.floor(r/2);n={leftSize:r-p,rightSize:p,topSize:0,bottomSize:0}}if(!n)n={leftSize:0,rightSize:0,topSize:0,bottomSize:0};let i=({side:p,sideIndex:m,truePinIndex:A})=>{if(!e.schPortArrangement)return A+1;if(!l4n(e.schPortArrangement))return A+1;let g={left:"top-to-bottom",bottom:"left-to-right",right:"bottom-to-top",top:"right-to-left"}[p],f=e.schPortArrangement?.[`${p}Side`]?.direction??g,y=e.schPortArrangement?.[`${p}Side`]?.pins,x=m;if(f!==g)x=y.length-m-1;return cY(y[x],e.pinLabels)},s=[],a=0,c=0;for(let p=0;p<n.leftSize;p++){let m=i({side:"left",sideIndex:p,truePinIndex:c}),A=e.numericSchPinStyle?.[`pin${m}`]??e.numericSchPinStyle?.[m];if(A?.topMargin)a+=A.topMargin;if(s.push({trueIndex:m-1,pinNumber:m,side:"left",distanceFromOrthogonalEdge:a}),A?.bottomMargin)a+=A.bottomMargin;if(p!==n.leftSize-1)a+=e.schPinSpacing;else o.left=a;c++}a=0;for(let p=0;p<n.bottomSize;p++){let m=i({side:"bottom",sideIndex:p,truePinIndex:c}),A=e.numericSchPinStyle?.[`pin${m}`]??e.numericSchPinStyle?.[m];if(A?.leftMargin)a+=A.leftMargin;if(s.push({trueIndex:m-1,pinNumber:m,side:"bottom",distanceFromOrthogonalEdge:a}),A?.rightMargin)a+=A.rightMargin;if(p!==n.bottomSize-1)a+=e.schPinSpacing;else o.bottom=a;c++}a=0;for(let p=0;p<n.rightSize;p++){let m=i({side:"right",sideIndex:p,truePinIndex:c}),A=e.numericSchPinStyle?.[`pin${m}`]??e.numericSchPinStyle?.[m];if(A?.bottomMargin)a+=A.bottomMargin;if(s.push({trueIndex:m-1,pinNumber:m,side:"right",distanceFromOrthogonalEdge:a}),A?.topMargin)a+=A.topMargin;if(p!==n.rightSize-1)a+=e.schPinSpacing;else o.right=a;c++}a=0;for(let p=0;p<n.topSize;p++){let m=i({side:"top",sideIndex:p,truePinIndex:c}),A=e.numericSchPinStyle?.[`pin${m}`]??e.numericSchPinStyle?.[m];if(A?.rightMargin)a+=A.rightMargin;if(s.push({trueIndex:m-1,pinNumber:m,side:"top",distanceFromOrthogonalEdge:a}),A?.leftMargin)a+=A.leftMargin;if(p!==n.topSize-1)a+=e.schPinSpacing;else o.top=a;c++}let l=e.schWidth;if(l===void 0){if(l=Math.max(o.top+y9e,o.bottom+y9e),e.pinLabels){if(s.filter((y)=>y.side==="left"||y.side==="right").some((y)=>e.pinLabels?.[`pin${y.pinNumber}`]||e.pinLabels?.[y.pinNumber]))l=Math.max(l,0.5)}let p=e.pinLabels?Math.max(...Object.values(e.pinLabels).map((g)=>g.length*c4n)):0,m=p>0?1.1:0;l=Math.max(l,p+m);let A={left:0,right:0};for(let g of s){if(g.side!=="left"&&g.side!=="right")continue;let f=e.pinLabels?.[`pin${g.pinNumber}`]??e.pinLabels?.[g.pinNumber];A[g.side]=Math.max(A[g.side],QQr(f))}l=Math.max(l,A.left+A.right+2*ygn)}let h=e.schHeight;if(!h)h=Math.max(o.left+y9e,o.right+y9e);if(e.pinLabels){let m=ygn,A=0.075,g=(B)=>{let T=e.pinLabels[`pin${B}`]??e.pinLabels[`${B}`];return T?T.length*0.13:0},f=s.filter((B)=>B.side==="left").map((B)=>({y:o.left/2-B.distanceFromOrthogonalEdge,len:g(B.pinNumber)})).filter((B)=>B.len>0),y=s.filter((B)=>B.side==="right").map((B)=>({y:-o.right/2+B.distanceFromOrthogonalEdge,len:g(B.pinNumber)})).filter((B)=>B.len>0),x=s.filter((B)=>B.side==="top").map((B)=>({x:o.top/2-B.distanceFromOrthogonalEdge,len:g(B.pinNumber)})).filter((B)=>B.len>0),C=s.filter((B)=>B.side==="bottom").map((B)=>({x:-o.bottom/2+B.distanceFromOrthogonalEdge,len:g(B.pinNumber)})).filter((B)=>B.len>0),b=(B,T)=>Math.min(B.maxX,T.maxX)>Math.max(B.minX,T.minX)&&Math.min(B.maxY,T.maxY)>Math.max(B.minY,T.minY),I=(B,T)=>({minX:-T/2+m,maxX:-T/2+m+B.len,minY:B.y-0.075,maxY:B.y+0.075}),v=(B,T)=>({minX:T/2-m-B.len,maxX:T/2-m,minY:B.y-0.075,maxY:B.y+0.075}),P=(B,T)=>({minX:B.x-0.075,maxX:B.x+0.075,minY:T/2-m-B.len,maxY:T/2-m}),M=(B,T)=>({minX:B.x-0.075,maxX:B.x+0.075,minY:-T/2+m,maxY:-T/2+m+B.len});if(!e.schHeight){let B=!1;for(let T of x)for(let N of C)if(b(P(T,h),M(N,h)))B=!0,h=Math.max(h,T.len+N.len+2*m);if(B){for(let T of x){let N=P(T,h);for(let D of f){let L=I(D,l);if(b(N,L))h=Math.max(h,2*(L.maxY+m+T.len))}for(let D of y){let L=v(D,l);if(b(N,L))h=Math.max(h,2*(L.maxY+m+T.len))}}for(let T of C){let N=M(T,h);for(let D of f){let L=I(D,l);if(b(N,L))h=Math.max(h,2*(m+T.len-L.minY))}for(let D of y){let L=v(D,l);if(b(N,L))h=Math.max(h,2*(m+T.len-L.minY))}}}}}let d={left:{x:-l/2-t,y:o.left/2},bottom:{x:-o.bottom/2,y:-h/2-t},right:{x:l/2+t,y:-o.right/2},top:{x:o.top/2,y:h/2+t}},u={left:{x:0,y:-1},right:{x:0,y:1},top:{x:-1,y:0},bottom:{x:1,y:0}},_=s.map((p)=>{let{distanceFromOrthogonalEdge:m,side:A}=p,g=d[A],f=u[A];return{x:g.x+m*f.x,y:g.y+m*f.y,...p}});return{getPortPositionByPinNumber(p){let m=_.find((A)=>A.pinNumber.toString()===p.toString());if(!m)return null;return m},getSize(){return{width:l,height:h}},getSizeIncludingPins(){return{width:l+(n.leftSize||n.rightSize?0.4:0),height:h+(n.topSize||n.bottomSize?0.4:0)}},pinCount:r}},Nde=(e,t)=>{if(!e)return;let n={};for(let[o,r]of Object.entries(e)){let i=cY(o,t),s=r.marginLeft??r.leftMargin,a=r.marginRight??r.rightMargin,c=r.marginTop??r.topMargin,l=r.marginBottom??r.bottomMargin,d={...n[`pin${i}`]??{}};if(s!==void 0)d.leftMargin=Ke.parse(s);if(a!==void 0)d.rightMargin=Ke.parse(a);if(c!==void 0)d.topMargin=Ke.parse(c);if(l!==void 0)d.bottomMargin=Ke.parse(l);n[`pin${i}`]=d}return n},kQr=(e)=>e==="schematic_symbol"||e==="schematic_component"||e==="schematic_line"||e==="schematic_rect"||e==="schematic_circle"||e==="schematic_arc"||e==="schematic_text"||e==="schematic_path",Cot=(e)=>Array.isArray(e)&&e.length>0&&e.some((t)=>kQr(t.type)),bot=(e)=>typeof e?.x==="number"&&Number.isFinite(e.x)&&typeof e.y==="number"&&Number.isFinite(e.y),xtt=(e,t)=>({x:e.x-t.x,y:e.y-t.y}),LQr=(e)=>e.type==="schematic_component"||e.type==="schematic_port"||e.type==="schematic_line"||e.type==="schematic_rect"||e.type==="schematic_circle"||e.type==="schematic_arc"||e.type==="schematic_text"||e.type==="schematic_path",HQr=(e)=>{let t=e.find((r)=>r.type==="schematic_component"&&bot(r.center));if(t)return t.center;let n=e.filter(LQr);if(n.length===0)return null;let o=bue(n);if(!Number.isFinite(o.minX)||!Number.isFinite(o.maxX)||!Number.isFinite(o.minY)||!Number.isFinite(o.maxY))return null;return{x:(o.minX+o.maxX)/2,y:(o.minY+o.maxY)/2}},FQr=(e,t)=>{switch(e.type){case"schematic_component":case"schematic_port":case"schematic_rect":case"schematic_circle":case"schematic_arc":return bot(e.center)?{...e,center:xtt(e.center,t)}:e;case"schematic_line":return{...e,x1:e.x1-t.x,y1:e.y1-t.y,x2:e.x2-t.x,y2:e.y2-t.y};case"schematic_text":return bot(e.position)?{...e,position:xtt(e.position,t)}:e;case"schematic_path":return{...e,points:e.points.map((n)=>xtt(n,t))};default:return e}},zQr=(e)=>{let t=HQr(e);if(!t)return[...e];if(t.x===0&&t.y===0)return[...e];return e.map((n)=>FQr(n,t))},xgn=(e)=>e.type==="schematic_line"||e.type==="schematic_rect"||e.type==="schematic_circle"||e.type==="schematic_arc"||e.type==="schematic_text"||e.type==="schematic_path",Cgn=(e,t)=>{if(!(t in e))return;let n=e[t];return typeof n==="string"?n:void 0},OQr=(e)=>{let t=e.filter((u)=>u.type==="schematic_symbol"),n=e.filter((u)=>u.type==="schematic_component"),o=n.find((u)=>typeof u.schematic_symbol_id==="string")?.schematic_symbol_id??t[0]?.schematic_symbol_id,r=(o?n.find((u)=>u.schematic_symbol_id===o):void 0)??n[0],i=r?.schematic_component_id,s=typeof r?.source_component_id==="string"?r.source_component_id:void 0,a=(o?t.find((u)=>u.schematic_symbol_id===o):void 0)??t[0],c=new Set,l=new Set,h=[],d=(u)=>{if(!u||l.has(u))return;l.add(u),h.push(u)};d(a),d(r);for(let u of e){if(u.type!=="schematic_port")continue;if(!i||u.schematic_component_id!==i)continue;if(d(u),typeof u.source_port_id==="string")c.add(u.source_port_id)}for(let u of e){if(!xgn(u))continue;let _=Cgn(u,"schematic_symbol_id"),p=Cgn(u,"schematic_component_id");if(o&&_===o||i&&p===i||!o&&!i)d(u)}for(let u of e){if(u.type!=="source_port")continue;if(c.has(u.source_port_id)||s&&u.source_component_id===s)d(u)}if(h.length>0)return h;return e.filter((u)=>u.type==="schematic_symbol"||u.type==="schematic_component"||u.type==="schematic_port"||xgn(u))},Sue=(e,t)=>{let n=t.split("."),o=e;for(let r of n.reverse()){if(!o||o.name!==r)return!1;o=o.parent}return!0},i7e=(e)=>{let t=e._parsedProps.cadModel,o=[...e.componentName==="AssemblyPrintedPart"?e.printedPartPlan?.referencePlanes??(t&&typeof t==="object"&&"jscad"in t?h4n.resolveReferencePlanes(t.jscad).referencePlanes:[]):[],...e.children.filter((i)=>i.componentName==="AssemblyReferenceSurface").map((i)=>i.referenceFrame)],r=new Set;for(let i of o){if(r.has(i.name))throw Error(`Part "${e.name}" has duplicate reference surface "${i.name}"`);r.add(i.name)}return o},vot=(e)=>{let t=e.parent;while(t){if(t.componentName==="AssemblyDevice")return t;t=t.parent}return e.root.firstChild},FY=(e)=>{let t=vot(e);return[t,...t.getDescendants()].filter((n)=>vot(n)===t)},Ctt=(e)=>e.componentName==="AssemblyMotor"||e.componentName==="AssemblyPart"||e.componentName==="AssemblyPrintedPart",Dit=(e)=>e.componentName==="AssemblyPrintedPart",dde=(e)=>e.componentName==="AssemblyMotor",nk=()=>[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],d4n=(e)=>{let t=e[10]<0,n=t?-1:1;return{position:{x:e[12],y:e[13],z:e[14]},pcbRotation:Math.atan2(n*e[1],n*e[0])*180/Math.PI,layer:t?"bottom":"top"}},btt=({origin:e,normal:t,xAxis:n})=>{let o=Tp.vec3.cross([0,0,0],t,n);return Tp.mat4.targetTo(nk(),e,Tp.vec3.subtract([0,0,0],e,t),o)},u4n=(e,t)=>{if(!dde(e)){let n=i7e(e).find((o)=>o.name===t);if(!n)throw Error(`Part "${e.name}" has no reference face "${t}"`);return n}if(t!=="backface"&&t!=="frontface")throw Error(`Motor "${e.name}" has no mounting face "${t}"; use frontface or backface`);return{name:t,origin:[0,0,t==="backface"?-e.motorModel.bodyLength:0],normal:[0,0,t==="backface"?-1:1],xAxis:[1,0,0]}},bgn=(e,t,n)=>{let o=t.lastIndexOf("."),r=t.slice(0,o),i=t.slice(o+1);if(o<1||!i)throw Error(`"${e.name}" mountedTo must name a part and face, e.g. "SPACER.board"`);let s=n.filter((c)=>Sue(c,r));if(s.length!==1)throw Error(`"${e.name}" mountedTo "${t}" matched ${s.length} assembly parts; expected exactly one in the assembly device`);let a=s[0];return{part:a,face:u4n(a,i)}},VQr=(e,t)=>{let n=nk();if(Dit(e))return n;if(!dde(e)){if(!t)throw Error(`Part "${e.name}" has no inherited placement`);if(Tp.mat4.translate(n,n,[t.position.x,t.position.y,t.position.z]),Tp.mat4.rotateZ(n,n,t.pcbRotation*Math.PI/180),t.layer==="bottom")Tp.mat4.rotateY(n,n,Math.PI);return n}switch(e._parsedProps.shaftFacingDirection){case"x+":return Tp.mat4.rotateY(n,n,Math.PI/2);case"x-":return Tp.mat4.rotateY(n,n,-Math.PI/2);case"y+":return Tp.mat4.rotateX(n,n,-Math.PI/2);case"y-":return Tp.mat4.rotateX(n,n,Math.PI/2);case"z-":return Tp.mat4.rotateY(n,n,Math.PI);default:return n}},SY=(e)=>{let t=FY(e),n=t.filter(Ctt),o=new Map,r=new Map,i=new Map,s,a=(h,d=[])=>{if(d.includes(h))throw Error(`Assembly mounting cycle: ${[...d,h].map((A)=>A.name).join(" -> ")}`);let u=o.get(h);if(u)return u;let _,p=h,m=h.componentName==="AssemblyPart"?Pue(h):void 0;if(m&&Ctt(m))_=[...a(m,[...d,h])],p=r.get(m);else{let A=h.componentName==="AssemblyPart"?Nit(h,[],(g)=>{let f=a(g,[...d,h]);return p=r.get(g),d4n(f)}):void 0;_=VQr(h,A)}if((dde(h)||Dit(h))&&h._parsedProps.mountedTo){let{part:A,face:g}=bgn(h,h._parsedProps.mountedTo,n),f=a(A,[...d,h]),y=u4n(h,h._parsedProps.mountFace),x=btt(g);Tp.mat4.translate(x,x,[0,0,h._parsedProps.mountGap??0]),Tp.mat4.rotateX(x,x,Math.PI);let C=Tp.mat4.invert(nk(),btt(y));_=Tp.mat4.multiply(nk(),f,Tp.mat4.multiply(nk(),x,C)),p=r.get(A)}return r.set(h,p),o.set(h,_),_};for(let h of n)a(h);let c=new Set(n.filter((h)=>dde(h)&&h._parsedProps.mountedTo).map((h)=>r.get(h))),l=new Set;for(let h of t.filter((d)=>d.componentName==="Board")){if(!h._parsedProps.mountedTo)continue;let{part:d,face:u}=bgn(h,h._parsedProps.mountedTo,n),_=r.get(d);if(l.has(_))throw Error(`Assembly "${_.name}" has multiple mounted boards; only one board may determine its placement`);if(l.add(_),dde(_)&&!["z+","z-"].includes(_._parsedProps.shaftFacingDirection??"z+"))throw Error(`Board "${h.name}" cannot mount to motor "${_.name}" facing ${_._parsedProps.shaftFacingDirection}: rotated PCB boards are not yet supported`);let p=h.root.db.pcb_board.get(h.pcb_board_id);if(!p)throw Error(`Mounted board "${h.name}" has no PCB geometry`);let m=Tp.mat4.multiply(nk(),o.get(d),btt(u));if(Math.abs(Math.abs(m[10])-1)>0.000001)throw Error(`Board "${h.name}" cannot mount to a tilted reference face; its PCB plane must remain parallel to XY`);if(c.has(_)){if(h._parsedProps.mountRotation||h._parsedProps.mountRotationAnchor)throw Error(`Board "${h.name}" mountRotation and mountRotationAnchor are not supported in a face-mounted motor assembly; set the target reference face's in-plane X direction instead`);let C=m[10]<0?"top_layer_toward_mount_face":"bottom_layer_toward_mount_face";if(h._parsedProps.mountOrientation&&h._parsedProps.mountOrientation!==C)throw Error(`Board "${h.name}" mountOrientation conflicts with its resolved mounting face`)}let A=h._computePcbGlobalTransformBeforeLayout(),g=Math.atan2(A.b,A.a)-Math.atan2(m[1],m[0]),f=Tp.mat4.fromZRotation(nk(),g),y=Tp.vec3.transformMat4([0,0,0],[m[12],m[13],m[14]],f),x=m[10]>0?1:-1;f[12]=p.center.x-y[0],f[13]=p.center.y-y[1],f[14]=-x*(p.thickness/2+(h._parsedProps.mountGap??0))-y[2],i.set(_,g);for(let[C,b]of o)if(r.get(C)===_)o.set(C,Tp.mat4.multiply(nk(),f,b));if(e===h||Ctt(e)&&r.get(e)===_)s=p.subcircuit_id}return{transforms:o,roots:r,yawByRoot:i,subcircuitId:s,motorMountRoots:c}},YQr=(e)=>{if(!FY(e).some((c)=>c.componentName==="AssemblyPrintedPart"))return;let{transforms:n,roots:o,yawByRoot:r,subcircuitId:i}=SY(e);if(![...o].some(([c,l])=>Dit(c)&&l===e))return;let s=n.get(e),a=e._parsedProps.shaftFacingDirection==="z-";return{position:{x:s[12],y:s[13],z:s[14]},pcbRotation:(r.get(e)??0)*180/Math.PI,layer:a?"bottom":"top",subcircuit_id:i}},GQr=(e)=>{let t=e._parsedProps.mountedTo;if(!t)return!1;let n=t.slice(0,t.lastIndexOf("."));return FY(e).some((o)=>(o.componentName==="AssemblyPrintedPart"||o.componentName==="AssemblyPart")&&Sue(o,n))},UQr=(e,t)=>{let n=e.componentName==="AssemblyScreen"?"assembly.screen":"assembly.subassembly",o=e.root?.firstChild;if(!o)throw Error(`Could not resolve ${n} "${e.name}" because the circuit has no root component`);let r=o,i=e.parent;while(i){if(i.componentName==="AssemblyDevice"){r=i;break}i=i.parent}let s=oO(Jve(t,e),r,{adapter:yZ});if(s.length!==1)throw Error(`${n} "${e.name}" connectsTo selector "${t}" matched ${s.length} components; expected exactly one`);let a=s[0];if(!a.pcb_component_id&&a.componentName!=="AssemblyScreen"&&a.componentName!=="AssemblyPart"&&a.componentName!=="AssemblySubassembly")throw Error(`${n} "${e.name}" connectsTo selector "${t}" matched ${a.getString()}, but it has no PCB component`);return a},Sot=(e)=>e.componentName==="AssemblyPart"||e.componentName==="AssemblyPrintedPart"||e.componentName==="AssemblyScreen"||e.componentName==="AssemblySubassembly",Pue=(e)=>{let t=e.parent;while(t){if(Sot(t))return t;if(t.componentName==="AssemblyDevice"||t.pcb_component_id)return;t=t.parent}return},xZ=(e,t=[])=>{if(t.includes(e))throw Error(`Assembly attachment cycle: ${[...t,e].map((n)=>n.name).join(" -> ")}`);if(e.componentName==="AssemblyPrintedPart"||e.componentName==="AssemblyPart"){let n=e,{transforms:o,subcircuitId:r}=SY(n),i=o.get(n);if(n.componentName==="AssemblyPart")return{...d4n(i),worldTransform:Math.abs(Math.abs(i[10])-1)>0.000001?i:void 0,subcircuit_id:r};return{worldTransform:i,position:{x:i[12],y:i[13],z:i[14]},pcbRotation:0,layer:"top",subcircuit_id:r}}return Nit(e,t)},Nit=(e,t=[],n)=>{if(t.includes(e))throw Error(`Assembly attachment cycle: ${[...t,e].map((y)=>y.name).join(" -> ")}`);let o=[...t,e],r=e.componentName==="AssemblyScreen"?UQr(e,e._parsedProps.connectsTo):Pue(e);if(!r)return{position:{x:0,y:0,z:0},pcbRotation:0,layer:"top"};if(n&&(r.componentName==="AssemblyPart"||r.componentName==="AssemblyPrintedPart"))return n(r);if(n&&Sot(r))return Nit(r,o,n);if(Sot(r))return xZ(r,o);let i=e.root.db,s=i.pcb_component.get(r.pcb_component_id);if(!s)throw Error(`Assembly target "${r.name}" has no PCB component`);let a=r._getBoard();if(!a)throw Error(`Assembly target "${r.name}" is not on a board`);let l=(a.pcb_board_id?i.pcb_board.get(a.pcb_board_id):null)?.thickness??a.boardThickness,h=s.layer==="bottom"?"bottom":"top",d=h==="bottom",u=s.rotation??0,_=r instanceof bl?r._getPcbComponentInsertionAxisDirection(h,u):void 0,p=_?Math.hypot(_.x,_.y):0,m=s.cable_insertion_center??s.center,A={x:m.x-s.center.x,y:m.y-s.center.y},g=Math.hypot(A.x,A.y),f=nu(_&&p>0.000000001?Math.atan2(-_.x,_.y)*180/Math.PI:g>0.000000001?Math.atan2(-A.x,A.y)*180/Math.PI:u);return{position:{...m,z:d?-l/2:l/2},pcbRotation:f,layer:h,subcircuit_id:s.subcircuit_id}},WQr=class extends nr{isPrimitiveContainer=!0;doInitialAssignNameToUnnamedComponents(){if(Pue(this))return;super.doInitialAssignNameToUnnamedComponents()}get config(){return{componentName:"CadAssembly",zodProps:jDt}}},XQr=(e,t)=>{let n=e.replace(/\/+$/,""),o=t.replace(/^\/+/,"");return`${n}/${o}`},Rit=(e,t)=>{if(!t)return e;if(!e.startsWith("/"))return e;try{let n=new URL(t);if(n.pathname!=="/"&&e.startsWith(n.pathname))return new URL(e,n.origin).toString();return XQr(t,e)}catch(n){return e}},Qit=(e)=>{if(!e)return null;let t=e.match(/#ext=(\w+)$/);if(t)return t[1].toLowerCase();let o=e.split("?")[0].split("#")[0],r=o.split("/").pop()??o;if(!r.includes("."))return null;return r.split(".").pop()?.toLowerCase()??null},Pot=(e)=>{let t=e.replace(/#ext=\w+$/,"");switch(Qit(e)){case"obj":return{objUrl:t};case"gltf":return{gltfUrl:t};case"glb":return{glbUrl:t};case"step":case"stp":return{stepUrl:t};case"wrl":case"vrml":return{wrlUrl:t};default:return{stlUrl:t}}},m4n=(e)=>{let t=Math.asin(Math.max(-1,Math.min(1,-e[2])));return(Math.abs(Math.cos(t))>0.00000001?[Math.atan2(e[6],e[10]),t,Math.atan2(e[1],e[0])]:[0,t,Math.atan2(-e[4],e[5])]).map((o)=>o===0?0:o)},fB=(e,t,n)=>{let o=M4.parse(typeof t==="string"?{}:t),r=n.layer==="bottom",i=q1.parse(o.positionOffset??{x:0,y:0,z:0}),s=Hb.compose(Hb.translate(n.position.x,n.position.y),Hb.rotate(n.pcbRotation*Math.PI/180),r?Hb.flipY():Hb.identity()),a=Hb.applyToPoint(s,i),c=o.pcbRotationOffset??o.rotationOffset??0,l=typeof c==="number"?{x:0,y:0,z:c}:{x:ei.parse(c.x),y:ei.parse(c.y),z:ei.parse(c.z)},h=(m)=>Rit(m,e.root?.platform?.projectBaseUrl),d,u;if(n.worldTransform){let m=YJ.vec3.transformMat4([0,0,0],[i.x,i.y,i.z+(o.zOffsetFromSurface??0)],n.worldTransform);d={x:m[0],y:m[1],z:m[2]};let A=[...n.worldTransform];YJ.mat4.rotateZ(A,A,l.z*Math.PI/180),YJ.mat4.rotateY(A,A,l.y*Math.PI/180),YJ.mat4.rotateX(A,A,l.x*Math.PI/180);let g=m4n(A).map((f)=>f*180/Math.PI);u={x:g[0],y:g[1],z:nu(g[2])}}let _=typeof t==="string"?{footprinter_string:t}:{model_stl_url:"stlUrl"in t?h(t.stlUrl):void 0,model_obj_url:"objUrl"in t?h(t.objUrl):void 0,model_mtl_url:"mtlUrl"in t&&t.mtlUrl?h(t.mtlUrl):void 0,model_gltf_url:"gltfUrl"in t?h(t.gltfUrl):void 0,model_glb_url:"glbUrl"in t?h(t.glbUrl):void 0,model_step_url:t.stepUrl?h(t.stepUrl):void 0,model_wrl_url:"wrlUrl"in t?h(t.wrlUrl):void 0,model_jscad:"jscad"in t?t.jscad:void 0};return e.root.db.cad_component.insert({..._,position:d??{...a,z:n.position.z+(r?-1:1)*(i.z+(o.zOffsetFromSurface??0))},rotation:u??{x:l.x,y:(r?180:0)+l.y,z:nu((r?-1:1)*(n.pcbRotation+l.z))},layer:n.layer,source_component_id:e.source_component_id,color:e.componentName==="AssemblyPrintedPart"?e._parsedProps.color:void 0,subcircuit_id:n.subcircuit_id,model_origin_position:o.modelOriginPosition??{x:0,y:0,z:0},model_unit_to_mm_scale_factor:o.modelUnitToMmScale??1,model_object_fit:"contain_within_bounds",model_board_normal_direction:o.modelBoardNormalDirection,size:o.size,anchor_alignment:"center",show_as_translucent_model:o.showAsTranslucentModel??!1}).cad_component_id},jQr=(e)=>{let t=Pue(e);if(!t)return!1;if(e.root?.pcbDisabled||!t.source_component_id)return!0;let n=xZ(t),o=typeof e._parsedProps==="string"?{modelUrl:e._parsedProps}:e._parsedProps;if(!o)return!0;let{pcbX:r,pcbY:i}=e.getResolvedPcbPositionProp(),a={...M4.parse({...o,positionOffset:o.positionOffset??q1.parse({x:r,y:i,z:o.pcbZ??0})}),...Pot(o.modelUrl)};return e.cad_component_id=fB(t,a,n),!0},Itt=un([Ae(),k()]),Ign=we({x:Itt,y:Itt,z:Itt}),KQr=class extends nr{doInitialAssignNameToUnnamedComponents(){if(Pue(this))return;super.doInitialAssignNameToUnnamedComponents()}get config(){return{componentName:"CadModel",zodProps:$Dt}}doInitialCadModelRender(){if(jQr(this))return;let e=this._findParentWithPcbComponent();if(!e)return;if(!e.pcb_component_id)return;let{db:t}=this.root,{boardThickness:n=0}=e._getBoard()??{},o=e._getPcbCircuitJsonBounds(),r=t.pcb_component.get(e.pcb_component_id),i=this._parsedProps;if(!i||typeof i.modelUrl!=="string"&&typeof i.stepUrl!=="string")return;let s=e._computePcbGlobalTransformBeforeLayout(),c=p4n.decomposeTSR(s).rotation.angle*180/Math.PI,l=i.pcbRotationOffset??i.rotationOffset,h=Ign.parse({x:0,y:0,z:0});if(typeof l==="number")h.z=Number(l);else if(typeof l==="object"){let C=Ign.parse(l);h.x=Number(C.x),h.y=Number(C.y),h.z=Number(C.z)}let{pcbX:d,pcbY:u}=this.getResolvedPcbPositionProp(),_=q1.parse({x:d,y:u,z:i.pcbZ??0,...typeof i.positionOffset==="object"?i.positionOffset:{}}),p=i.zOffsetFromSurface!==void 0?Ke.parse(i.zOffsetFromSurface):0,m=e.props.layer==="bottom"?"bottom":"top",A=i.modelUrl?Qit(i.modelUrl):void 0,g=i.modelUrl?.replace(/#ext=\w+$/,""),f={};if(A==="stl")f.model_stl_url=this._addCachebustToModelUrl(g);else if(A==="obj")f.model_obj_url=this._addCachebustToModelUrl(g);else if(A==="gltf")f.model_gltf_url=this._addCachebustToModelUrl(g);else if(A==="glb")f.model_glb_url=this._addCachebustToModelUrl(g);else if(A==="step"||A==="stp")f.model_step_url=this._addCachebustToModelUrl(g);else if(A==="wrl"||A==="vrml")f.model_wrl_url=this._addCachebustToModelUrl(g);else f.model_stl_url=this._addCachebustToModelUrl(g);if(i.stepUrl){let C=this._addCachebustToModelUrl(i.stepUrl);if(C)f.model_step_url=C}let y={position:{x:o.center.x+Number(_.x),y:o.center.y+Number(_.y),z:(m==="bottom"?-n/2:n/2)+(m==="bottom"?-p:p)+Number(_.z)},rotation:Znt({layer:m,pcbCcwRotationDegrees:c,modelCcwRotationOffsetDegrees:{x:Number(h.x),y:Number(h.y),z:Number(h.z)}})};y=tot(e,y);let x=t.cad_component.insert({...y,pcb_component_id:e.pcb_component_id,model_board_normal_direction:i.modelBoardNormalDirection,model_origin_alignment:"center_of_component_on_board_surface",anchor_alignment:"center_of_component_on_board_surface",model_origin_position:i.modelOriginPosition,size:i.size?q1.parse(i.size):void 0,source_component_id:e.source_component_id,model_unit_to_mm_scale_factor:typeof i.modelUnitToMmScale==="number"?i.modelUnitToMmScale:void 0,show_as_translucent_model:i.showAsTranslucentModel??e._parsedProps.showAsTranslucentModel,...f});this.cad_component_id=x.cad_component_id}_findParentWithPcbComponent(){let e=this.parent;while(e&&!e.pcb_component_id)e=e.parent;return e}_addCachebustToModelUrl(e){if(!e)return e;let t=this.root?.platform?.projectBaseUrl,n=Rit(e,t);if(!n.includes("modelcdn.tscircuit.com"))return n;let o=this.root?.getClientOrigin()??"";return`${n}${n.includes("?")?"&":"?"}cachebust_origin=${encodeURIComponent(o)}`}},$Qr=_4n.default("tscircuit:core:footprint"),s7e=class extends nr{get config(){return{componentName:"Footprint",zodProps:cDt}}doInitialPcbFootprintLayout(){if(this.root?.pcbDisabled)return;let e=this.children.filter((d)=>d.componentName==="Constraint");if(e.length===0)return;let{isFlipped:t}=this._getPcbPrimitiveFlippedHelpers(),n=(d)=>{if(t){if("left"in d&&"right"in d)return{...d,left:d.right,right:d.left}}return d},o=e.flatMap((d)=>d._getAllReferencedComponents().componentsWithSelectors).map(({component:d,selector:u,componentSelector:_,edge:p})=>({component:d,selector:u,componentSelector:_,edge:p,bounds:d._getPcbCircuitJsonBounds()}));if(o.some((d)=>d.edge))throw Error("edge constraints not implemented yet for footprint layout, contributions welcome!");function r(d){return o.find(({selector:u})=>u===d)}let i=new uae,s={};function a(d){if(!(d in s))s[d]=new wR(d),i.addEditVariable(s[d],fh.weak);return s[d]}for(let{selector:d,bounds:u}of o){let _=a(`${d}_x`),p=a(`${d}_y`);i.suggestValue(_,u.center.x),i.suggestValue(p,u.center.y)}for(let d of e){let u=d._parsedProps;if("xDist"in u){let{xDist:_,left:p,right:m,edgeToEdge:A,centerToCenter:g}=n(u),f=a(`${p}_x`),y=a(`${m}_x`),x=r(p)?.bounds,C=r(m)?.bounds;if(g){let b=new od(y,[-1,f]);i.addConstraint(new mA(b,Ip.Eq,u.xDist,fh.required))}else if(A){let b=new od(y,-C.width/2,[-1,f],-x.width/2);i.addConstraint(new mA(b,Ip.Eq,u.xDist,fh.required))}}else if("yDist"in u){let{yDist:_,top:p,bottom:m,edgeToEdge:A,centerToCenter:g}=u,f=a(`${p}_y`),y=a(`${m}_y`),x=r(p)?.bounds,C=r(m)?.bounds;if(g){let b=new od(f,[-1,y]);i.addConstraint(new mA(b,Ip.Eq,u.yDist,fh.required))}else if(A){let b=new od(f,x.height/2,[-1,y],-C.height/2);i.addConstraint(new mA(b,Ip.Eq,u.yDist,fh.required))}}else if("sameY"in u){let{for:_}=u;if(_.length<2)continue;let p=_.map((A)=>a(`${A}_y`)),m=new od(...p.slice(1));i.addConstraint(new mA(m,Ip.Eq,p[0],fh.required))}else if("sameX"in u){let{for:_}=u;if(_.length<2)continue;let p=_.map((A)=>a(`${A}_x`)),m=new od(...p.slice(1));i.addConstraint(new mA(m,Ip.Eq,p[0],fh.required))}}if(i.updateVariables(),$Qr.enabled)console.log("Solution to layout constraints:"),console.table(Object.entries(s).map(([d,u])=>({var:d,val:u.value()})));let c={left:1/0,right:-1/0,top:-1/0,bottom:1/0};for(let{selector:d,bounds:{width:u,height:_}}of o){let p=a(`${d}_x`),m=a(`${d}_y`),A=p.value()-u/2,g=p.value()+u/2,f=m.value()+_/2,y=m.value()-_/2;c.left=Math.min(c.left,A),c.right=Math.max(c.right,g),c.top=Math.max(c.top,f),c.bottom=Math.min(c.bottom,y)}let l={x:-(c.right+c.left)/2,y:-(c.top+c.bottom)/2},h=this.getPrimitiveContainer()._getGlobalPcbPositionBeforeLayout();l.x+=h.x,l.y+=h.y;for(let{component:d,selector:u}of o){let _=a(`${u}_x`),p=a(`${u}_y`);d._setPositionFromLayout({x:_.value()+l.x,y:p.value()+l.y})}}},qQr=(e)=>{let{db:t}=e.root;if(e.pcb_component_id){let n=t.pcb_component.get(e.pcb_component_id);if(!n)return null;return{width:n.width,height:n.height}}if(e.pcb_group_id){let n=t.pcb_group.get(e.pcb_group_id);if(!n)return null;if(n.outline&&n.outline.length>0){let o=Ms(n.outline);if(!o)return null;return{width:o.maxX-o.minX,height:o.maxY-o.minY}}return{width:n.width??0,height:n.height??0}}return null},JQr=(e,t)=>{let{db:n}=e.root,o=n.toArray();if(e.pcb_component_id){OAe(o,e.pcb_component_id,t);return}if(e.source_group_id){VAe(o,e.source_group_id,t);return}throw Error(`Cannot reposition component ${e.getString()}: no pcb_component_id or source_group_id`)},ZQr="MARKED INTERNALLY CONNECTED",ekr=0.12,tkr=0.05,vgn=0.12,nkr=(e)=>{let{db:t}=e.root,n={pcb_component_id:e.pcb_component_id};return t.pcb_fabrication_note_text.list(n).length>0||t.pcb_fabrication_note_path.list(n).length>0||t.pcb_fabrication_note_rect.list(n).length>0||t.pcb_fabrication_note_dimension.list(n).length>0},okr=(e)=>{let t={from:e[0],to:e[1],length:-1/0};for(let s=1;s<e.length;s++){let a=e[s-1],c=e[s],l=Math.hypot(c.x-a.x,c.y-a.y);if(l>t.length)t={from:a,to:c,length:l}}let n=t.to.x-t.from.x,o=t.to.y-t.from.y,r=Math.max(t.length,Number.EPSILON),i=Math.atan2(o,n)*180/Math.PI;if(i>90)i-=180;if(i<-90)i+=180;return{anchorPosition:{x:(t.from.x+t.to.x)/2-o/r*vgn,y:(t.from.y+t.to.y)/2+n/r*vgn},ccwRotation:(i%360+360)%360}},rkr=(e)=>{let t=e.root;if(!t||t.pcbDisabled||!e.pcb_component_id)return;if(e.componentName==="SolderJumper")return;if(e._getPrimaryPinCount()>=6)return;if(nkr(e))return;let{db:n}=t,o=n.pcb_component.get(e.pcb_component_id);if(!o)return;let r=o.layer;if(r!=="top"&&r!=="bottom")return;let i=e.getSubcircuit()?.subcircuit_id??void 0,s=e.getGroup()?.pcb_group_id??void 0;for(let a of e._getInternallyConnectedPins()){let c=a.flatMap((u)=>{if(!u?.pcb_port_id)return[];let _=n.pcb_port.get(u.pcb_port_id);return _?[{x:_.x,y:_.y}]:[]}),l=c.filter((u,_)=>c.findIndex((p)=>p.x===u.x&&p.y===u.y)===_);if(l.length<2)continue;let{anchorPosition:h,ccwRotation:d}=okr(l);n.pcb_fabrication_note_path.insert({pcb_component_id:e.pcb_component_id,subcircuit_id:i,layer:r,route:l,stroke_width:tkr}),n.pcb_fabrication_note_text.insert({pcb_component_id:e.pcb_component_id,pcb_group_id:s,subcircuit_id:i,font:"tscircuit2024",font_size:ekr,text:ZQr,ccw_rotation:d,layer:r,anchor_position:h,anchor_alignment:"center"})}},ikr={simple_ammeter:["A"],simple_battery:["B","BT"],simple_capacitor:["C"],simple_chip:["U","IC"],simple_connector:["J","P","CONN"],simple_crystal:["Y","X"],simple_current_source:["I","IS"],simple_diode:["D"],simple_fuse:["F"],simple_inductor:["L","FB"],simple_interconnect:["ICN"],simple_led:["D","LED"],simple_mosfet:["Q"],simple_op_amp:["U","IC"],simple_pin_header:["J","P","JP"],simple_pinout:["J","P"],simple_potentiometer:["RV","RP"],simple_power_source:["B","BT","V","VS"],simple_push_button:["SW","S"],simple_resistor:["R"],simple_resonator:["Y","X"],simple_switch:["SW","S"],simple_test_point:["TP"],simple_transistor:["Q"],simple_voltage_probe:["VP"],simple_voltage_source:["V","VS"]},g4n=(e)=>{if(!e)return;return ikr[e]},skr=(e)=>e.match(/^[A-Za-z]+/)?.[0]?.toUpperCase(),akr=[{prefix:"J",recommendation:"a <connector /> or <jumper />"},{prefix:"Q",recommendation:"a <transistor />"},{prefix:"C",recommendation:"a <capacitor />"},{prefix:"R",recommendation:"a <resistor />"},{prefix:"L",recommendation:"an <inductor />"},{prefix:"Y",recommendation:"a <crystal />"},{prefix:"X",recommendation:"a <crystal />"},{prefix:"F",recommendation:"a <fuse />"},{prefix:"S",recommendation:"a <switch /> or <pushbutton />"},{prefix:"TP",recommendation:"a <testpoint />"}],ckr=(e)=>{let{db:t}=e.root;if(!e.source_component_id)return;let n=t.source_component.get(e.source_component_id);if(!n?.name||!n.ftype)return;let o=skr(n.name),r=e.componentName==="Chip"&&n.ftype==="simple_chip"&&o!==void 0?akr.find(({prefix:c})=>o.startsWith(c)):void 0,i=e.getRefDesPrefixes()??(r?g4n("simple_chip"):void 0);if(!i||i.length===0)return;if(o&&i.some((c)=>o===c||o.startsWith(c)))return;let s=i.length===1?i[0]:`one of ${i.join(", ")}`,a=r?`The "${r.prefix}" prefix is being used with a <chip />, try using it with ${r.recommendation}`:`Component ${n.name} has ftype="${n.ftype}" but reference designator should start with ${s}`;t.insert({type:"source_refdes_convention_warning",warning_type:"source_refdes_convention_warning",message:a,source_component_id:n.source_component_id,refdes:n.name,source_component_ftype:n.ftype,expected_prefixes:i,actual_prefix:o,subcircuit_id:n.subcircuit_id})},Sgn=new WeakMap,lkr=(e)=>{let t=Sgn.get(e);if(t)return t;let n=new Map;return Sgn.set(e,n),n},hkr=new Set(["a","anode","pos","positive","+"]),dkr=new Set(["c","k","cathode","neg","negative","-"]),A4n=(e)=>e.toLowerCase().replace(/[^a-z0-9+-]/g,""),f4n=(e,t)=>{let n=e.filter((o)=>o.type==="source_port"&&(!t||o.source_component_id===t));return n.find((o)=>o.pin_number===1)??n.find((o)=>[o.name,...o.port_hints??[]].map(A4n).includes("pin1"))??null},y4n=(e)=>{if(!e)return null;let t=[e.name,...e.port_hints??[]].map(A4n),n=t.some((r)=>hkr.has(r)),o=t.some((r)=>dkr.has(r));if(n===o)return null;return n?"anode":"cathode"},ukr=(e)=>{if(!e)return[];let t=[];for(let n of Object.keys(e)){let o=e[n]?.[0];if(o)t.push({supplierName:n,supplierPartNumber:o})}return t},pkr=(e)=>{if(typeof e!=="string")return null;let t=e.match(/(?:^|_)pin1location\((leftside|rightside|topside|bottomside),(left|right|top|bottom)\)(?:_|$)/i);if(!t)return null;let n=aX.safeParse(`${t[1].toLowerCase()}_${t[2].toLowerCase()}`);return n.success?n.data:null},mkr=({component:e,pcbComponent:t,pcbElements:n})=>{let o=-t.rotation*Math.PI/180,r=Math.cos(o),i=Math.sin(o),s=hde({componentLayer:t.layer,originalLayer:e._getFootprintOriginalLayer()}),a=(c)=>{let l=c.x-t.center.x,h=c.y-t.center.y,d=s?-h:h;return{x:l*r-d*i,y:l*i+d*r}};return n.map((c)=>{let l=structuredClone(c);if(typeof l.x==="number"&&typeof l.y==="number"){let h=a(l);l.x=h.x,l.y=h.y}if(l.points)l.points=l.points.map(a);return l})},_kr=({supplierName:e,supplierPartNumber:t})=>`part-orientation-analysis:v4:${e}:${t}`,gkr=async({cacheKey:e,component:t})=>{let n=await t.root?.platform?.localCacheEngine?.getItem(e);if(!n)return{cacheHit:!1};try{let o=JSON.parse(n),r=aX.safeParse(o.pin1_location),i=o.pin1_location===null?null:r.success?r.data:void 0,s=o.pin1_polarity===null||o.pin1_polarity==="anode"||o.pin1_polarity==="cathode"?o.pin1_polarity:void 0;if(i===void 0||s===void 0)return{cacheHit:!1};return{cacheHit:!0,analysis:{pin1Location:i,pin1Polarity:s}}}catch{return{cacheHit:!1}}},Akr=async({component:e,partsEngine:t,supplierPartCandidate:n})=>{let o=_kr(n),r=await gkr({cacheKey:o,component:e});if(r.cacheHit)return r.analysis;let i=lkr(t),s=i.get(o);if(s)return s;let a=(async()=>{let c=await Promise.resolve(jxn(t.fetchPartCircuitJson,{supplierPartNumber:n.supplierPartNumber,platformFetch:e.root?.platform?.platformFetch}));if(!c?.length)return{pin1Location:null,pin1Polarity:null};let l=ZRe(c),h=y4n(f4n(c));try{await e.root?.platform?.localCacheEngine?.setItem(o,JSON.stringify({pin1_location:l,pin1_polarity:h}))}catch{}return{pin1Location:l,pin1Polarity:h}})().finally(()=>{i.delete(o)});return i.set(o,a),a},fkr=(e)=>{if(!e.root)return;if(e.root.platform?.enablePartOrientationAnalysis===!1)return;if(e.root.pcbDisabled||e.props.doNotPlace)return;if(!e.pcb_component_id)return;let{db:t}=e.root,n=t.pcb_component.get(e.pcb_component_id);if(!n)return;let o=[...t.pcb_smtpad.list({pcb_component_id:e.pcb_component_id}),...t.pcb_plated_hole.list({pcb_component_id:e.pcb_component_id})];if(o.length===0)return;let r=pkr(e.resolveFootprint())??ZRe(mkr({component:e,pcbComponent:n,pcbElements:o}));if(r)t.pcb_component.update(e.pcb_component_id,{pin1_location:r});if(e.getInheritedProperty("bomDisabled"))return;if(e.getInheritedProperty("partsEngineDisabled"))return;let i=e.getInheritedProperty("partsEngine");if(!i?.fetchPartCircuitJson)return;let s=t.source_component.get(e.source_component_id),c=s?.ftype==="simple_diode"||s?.ftype==="simple_led"?f4n(t.source_port.list(),e.source_component_id??void 0):null,l=y4n(c),h=ukr(s?.supplier_part_numbers);if(h.length===0)return;if(e._hasStartedPartOrientationAnalysis)return;e._hasStartedPartOrientationAnalysis=!0,e._queueAsyncEffect("analyze-part-orientation",async()=>{let d={};for(let u of h)try{let{pin1Location:_,pin1Polarity:p}=await Akr({component:e,partsEngine:i,supplierPartCandidate:u});if(_)d[u.supplierName]=_;if(l&&p&&l!==p){let m=mM.parse({type:"source_component_misconfigured_error",error_type:"source_component_misconfigured_error",message:`${e.getString()} maps pin 1 to the ${l}, but supplier part ${u.supplierName}:${u.supplierPartNumber} maps pin 1 to the ${p}. Update pinLabels or use a supplier part with matching diode polarity.`,source_component_ids:[e.source_component_id],source_port_ids:c?.source_port_id?[c.source_port_id]:void 0});e.root.db.source_component_misconfigured_error.insert(m)}}catch{}e._asyncSupplierPin1LocationMap=d,e._markDirty("PartOrientationAnalysis")})},ykr=(e)=>{let t=e._asyncSupplierPin1LocationMap;if(!t||!e.pcb_component_id)return;let{db:n}=e.root,o=n.pcb_component.get(e.pcb_component_id);if(!o||Object.keys(t).length===0)return;n.pcb_component.update(e.pcb_component_id,{supplier_pin1_location_map:{...o.supplier_pin1_location_map,...t}})};function xkr(e){if(e.root?.pcbDisabled)return;if(!e.pcb_component_id)return;let{pcbX:t,pcbY:n}=e._parsedProps,o=e.props?.pcbPositionAnchor;if(!o)return;if(t===void 0&&n===void 0)return;let r=o7e(e.children);if(r.width===0||r.height===0)return;let s={...{x:(r.minX+r.maxX)/2,y:(r.minY+r.maxY)/2}},a=null;if(new Set(["center","top_left","top_center","top_right","center_left","center_right","bottom_left","bottom_center","bottom_right"]).has(o)){let h={left:r.minX,right:r.maxX,top:r.minY,bottom:r.maxY};switch(o){case"center":a=s;break;case"top_left":a={x:h.left,y:h.top};break;case"top_center":a={x:s.x,y:h.top};break;case"top_right":a={x:h.right,y:h.top};break;case"center_left":a={x:h.left,y:s.y};break;case"center_right":a={x:h.right,y:s.y};break;case"bottom_left":a={x:h.left,y:h.bottom};break;case"bottom_center":a={x:s.x,y:h.bottom};break;case"bottom_right":a={x:h.right,y:h.bottom};break}}else try{let h=e.portMap[o];if(h)a=h._getGlobalPcbPositionBeforeLayout()}catch{}if(!a)return;let l={...s};if(t!==void 0)l.x+=t-a.x;if(n!==void 0)l.y+=n-a.y;if(Math.abs(l.x-s.x)>0.000001||Math.abs(l.y-s.y)>0.000001)e._repositionOnPcb(l)}var x4n=(e)=>{let t=e.find((r)=>r.type==="cad_component");if(!t)return;let n={stlUrl:t.model_stl_url,objUrl:t.model_obj_url,gltfUrl:t.model_gltf_url,glbUrl:t.model_glb_url,stepUrl:t.model_step_url,wrlUrl:t.model_wrl_url,modelOriginPosition:t.model_origin_position??void 0,modelUnitToMmScale:t.model_unit_to_mm_scale_factor,modelBoardNormalDirection:t.model_board_normal_direction,size:t.size??void 0,rotationOffset:t.rotation??void 0,positionOffset:t.position??void 0,showAsTranslucentModel:t.show_as_translucent_model};if(!n.stlUrl&&!n.objUrl&&!n.gltfUrl&&!n.glbUrl&&!n.stepUrl&&!n.wrlUrl&&!t.model_jscad)return;if(t.model_jscad&&typeof t.model_jscad==="object")n.jscad=t.model_jscad;let o=Uz.safeParse(n);return o.success?o.data:void 0},Ckr=C4n.default("tscircuit:core:resolveStaticFileImport");async function b4n(e,t){if(!e)return e;let n=e.startsWith("./")?e.slice(1):e,o=t?.resolveProjectStaticFileImportUrl;if(o&&(e.startsWith("/")||e.startsWith("./")))try{let r=await o(n);if(r)return r}catch(r){Ckr("failed to resolve static file via platform resolver",r)}return Rit(n,t?.projectBaseUrl)}var xk=(e)=>e.startsWith("blob:"),Ck=(e)=>e.startsWith("http://")||e.startsWith("https://"),ude=(e)=>e.startsWith("/")||e.startsWith("./"),DJ=(e)=>{if(Ck(e)||xk(e))return null;let t=e.indexOf(":");if(t<=0)return null;let n=e.slice(0,t),o=e.slice(t+1);if(!n||!o)return null;return{footprintLib:n,footprintName:o}},bkr=$M.shape.supplierPartNumbers.unwrap().keySchema.options,Ikr=(e)=>e.componentName==="Symbol"||e.isSchematicPrimitive,vkr=(e,t,n)=>{if(e.getInheritedProperty("partsEngineDisabled"))return;let o=e.props.supplierPartNumbers,r=bkr.find((c)=>c===t);if(!r)return;if(!o?.[r]?.includes(n))return;let a=e.getInheritedProperty("partsEngine")?.fetchPartCircuitJson;if(!a)return;return async(c)=>({footprintCircuitJson:await git({fetchPartCircuitJson:a,supplierPartNumber:c,manufacturerPartNumber:ii(e.props)},e)??[]})},Skr=async(e,t,n)=>{if(!e)throw Error(`No footprint resolver is configured for library "${t}".`);return e(n)};function Pkr(e,t){let n=e.resolveFootprint();if(!n)return;let{pcbRotation:o,pcbPinLabels:r}=e.props,i=e._resolvePinLabels(),s=Qit(String(n)),a=s?e.root?.platform?.footprintFileParserMap?.[s]:null;if(typeof n==="string"&&(Ck(n)||xk(n)||ude(n))&&a){if(e._hasStartedFootprintUrlLoad)return;e._hasStartedFootprintUrlLoad=!0,t("load-footprint-from-platform-file-parser",async()=>{let c=Ck(n)||xk(n)?n:await b4n(n,e.root?.platform);try{let l=await a.loadFromUrl(c),h=sB({sourcePortOwner:e,componentName:e.name,componentRotation:o,footprinterString:c,pinLabels:i,pcbPinLabels:r},l.footprintCircuitJson);e.addAll(h);for(let d of e.children)if(d.componentName==="Port")d._markDirty("PcbPortRender");e._markDirty("ResolveFootprintPinLabels"),e._markDirty("InitializePortsFromChildren")}catch(l){let h=e.root?.db;if(h&&e.source_component_id&&e.pcb_component_id){let d=e.getSubcircuit(),u=`${e.getString()} failed to load footprint "${c}": `+(l instanceof Error?l.message:String(l)),_=dX.parse({type:"external_footprint_load_error",message:u,pcb_component_id:e.pcb_component_id,source_component_id:e.source_component_id,subcircuit_id:d.subcircuit_id??void 0,pcb_group_id:e.getGroup()?.pcb_group_id??void 0,footprinter_string:c});h.external_footprint_load_error.insert(_)}throw l}});return}if(typeof n==="string"&&Ck(n)){if(e._hasStartedFootprintUrlLoad)return;e._hasStartedFootprintUrlLoad=!0;let c=n;t("load-footprint-url",async()=>{try{let l=await fetch(c);if(!l.ok)throw Error(`Failed to fetch footprint: ${l.status}`);let h=await l.json(),d=sB({sourcePortOwner:e,componentName:e.name,componentRotation:o,footprinterString:c,pinLabels:i,pcbPinLabels:r},h);e.addAll(d),e._markDirty("ResolveFootprintPinLabels"),e._markDirty("InitializePortsFromChildren")}catch(l){let h=e.root?.db;if(h&&e.source_component_id&&e.pcb_component_id){let d=e.getSubcircuit(),u=`${e.getString()} failed to load external footprint "${c}": `+(l instanceof Error?l.message:String(l)),_=dX.parse({type:"external_footprint_load_error",message:u,pcb_component_id:e.pcb_component_id,source_component_id:e.source_component_id,subcircuit_id:d.subcircuit_id??void 0,pcb_group_id:e.getGroup()?.pcb_group_id??void 0,footprinter_string:c});h.external_footprint_load_error.insert(_)}throw l}});return}if(typeof n==="string"&&xk(n))return;if(typeof n==="string"){let c=DJ(n);if(!c)return;if(e._hasStartedFootprintUrlLoad)return;e._hasStartedFootprintUrlLoad=!0;let h=e.root?.platform?.footprintLibraryMap?.[c.footprintLib],d=typeof h==="function"?h:void 0,u=vkr(e,c.footprintLib,c.footprintName),_=d??u;t("load-lib-footprint",async()=>{try{let p=await Skr(_,c.footprintLib,c.footprintName),m=null;if(Array.isArray(p))m=p;else if(Array.isArray(p.footprintCircuitJson))m=p.footprintCircuitJson;if(!m||m.length===0)throw Error(`Footprint resolver returned no circuit elements for "${n}".`);let A=sB({sourcePortOwner:e,componentName:e.name,componentRotation:o,footprinterString:n,pinLabels:i,pcbPinLabels:r},m),g=new s7e({src:n}),f=[];for(let y of A)if(Ikr(y))f.push(y);else g.add(y);e.add(g),e.addAll(f),e._asyncFootprintCadModel=!Array.isArray(p)&&p.cadModel||x4n(m);for(let y of e.children)if(y.componentName==="Port")y._markDirty?.("PcbPortRender");e._markDirty("ResolveFootprintPinLabels"),e._markDirty("InitializePortsFromChildren")}catch(p){let m=e.root?.db;if(m&&e.source_component_id&&e.pcb_component_id){let A=e.getSubcircuit(),g=`${e.getString()} failed to load external footprint "${n}": `+(p instanceof Error?p.message:String(p)),f=dX.parse({type:"external_footprint_load_error",message:g,pcb_component_id:e.pcb_component_id,source_component_id:e.source_component_id,subcircuit_id:A.subcircuit_id??void 0,pcb_group_id:e.getGroup()?.pcb_group_id??void 0,footprinter_string:n});m.external_footprint_load_error.insert(f)}throw p}});return}if(!Eot.isValidElement(n)&&n.componentName==="Footprint")e.add(n);if(Array.isArray(n)&&!Eot.isValidElement(n)&&n.length>0){try{let c=sB({sourcePortOwner:e,componentName:e.name,componentRotation:o,footprinterString:"",pinLabels:i,pcbPinLabels:r},n);e.addAll(c)}catch(c){let l=e.root?.db;if(l&&e.source_component_id&&e.pcb_component_id){let h=e.getSubcircuit(),d=`${e.getString()} failed to load json footprint: `+(c instanceof Error?c.message:String(c)),u=dAe.parse({type:"circuit_json_footprint_load_error",message:d,pcb_component_id:e.pcb_component_id,source_component_id:e.source_component_id,subcircuit_id:h.subcircuit_id??void 0,pcb_group_id:e.getGroup()?.pcb_group_id??void 0});l.circuit_json_footprint_load_error.insert(u)}throw c}return}}function Ekr(e){let t=e._impliedFootprintPinLabels??{},n={},o=e.getPortsFromFootprint({allowImplicitPinNumbers:!e._parsedProps.pinLabels});for(let i of o){let s=i._parsedProps.pinNumber;if(s===void 0)continue;let a=new Set([`pin${s}`,`${s}`]),c=i.getNameAndAliases().filter((l)=>!a.has(l));if(c.length>0)n[`pin${s}`]=c}let r={...n};for(let[i,s]of Object.entries(t))r[i]=Array.isArray(s)?s:[s];if(e._impliedFootprintPinLabels=r,Object.keys(e._impliedFootprintPinLabels).length===0)return;for(let i of e.children){if(i.componentName!=="Port")continue;let s=i,a=s._parsedProps.pinNumber;if(a===void 0)continue;let c=`pin${a}`,l=e._impliedFootprintPinLabels[c];if(!l)continue;let h=Array.isArray(l)?l:[l],d=s.getNameAndAliases();for(let u of h)if(!d.includes(u))s.externallyAddedAliases.push(u)}}function Mkr(e){if(e.root?.schematicDisabled)return;if(e.getCollapsedSchematicBoxAncestor())return;if(e._parsedProps?.noSchematicRepresentation===!0)return;let{db:t}=e.root;if(e._invalidPinLabelMessages?.length&&e.root?.db)for(let a of e._invalidPinLabelMessages){let c="pinLabels",l=a.match(/^Invalid pin label:\s*([^=]+)=\s*'([^']+)'/);if(l)c=`pinLabels['${l[2]}']`;e.root.db.source_property_ignored_warning.insert({source_component_id:e.source_component_id,property_name:c,message:a,error_type:"source_property_ignored_warning"})}if(e._parsedProps.schPinSpacing!==void 0&&e.root?.db)e.root.db.source_property_ignored_warning.insert({source_component_id:e.source_component_id,property_name:"schPinSpacing",error_type:"source_property_ignored_warning",message:"schPinSpacing is deprecated and will be ignored. Pin spacing is always 0.2."});let{schematicSymbolName:n}=e.config,{_parsedProps:o}=e,r=e.children.some((a)=>a.componentName==="Symbol");if(o.symbol&&I4n.isValidElement(o.symbol)||r)e._doInitialSchematicComponentRenderWithReactSymbol(o.symbol);else if(n)e._doInitialSchematicComponentRenderWithSymbol();else{let a=e._getSchematicBoxDimensions();if(a)e._doInitialSchematicComponentRenderWithSchematicBoxDimensions(a)}let i=e.getSubcircuit()?._getSchematicManualPlacementForComponent(e);if(e.schematic_component_id&&(e.props.schX!==void 0||e.props.schY!==void 0)&&!!i){if(!e.schematic_component_id)return;let a=oAe.parse({type:"schematic_manual_edit_conflict_warning",schematic_manual_edit_conflict_warning_id:`schematic_manual_edit_conflict_${e.source_component_id}`,message:`${e.getString()} has both manual placement and prop coordinates. schX and schY will be used. Remove schX/schY or clear the manual placement.`,schematic_component_id:e.schematic_component_id,source_component_id:e.source_component_id,subcircuit_id:e.getSubcircuit()?.subcircuit_id});t.schematic_manual_edit_conflict_warning.insert(a)}let s=e._parsedProps?.schSheetName??e.props.schSheetName;if(s&&e.source_component_id&&!e._resolveSchematicSheetId())t.source_property_ignored_warning.insert({source_component_id:e.source_component_id,property_name:"schSheetName",error_type:"source_property_ignored_warning",subcircuit_id:e.getSubcircuit()?.subcircuit_id??void 0,message:`${e.getString()} references schSheetName "${s}", which does not match any schematic sheet and will be ignored.`})}function wkr(e){let t=e.font_size,n=e.text.length*t*0.6,o=t,r=e.anchor_alignment||"center",i=e.anchor_position.x,s=e.anchor_position.y;switch(r){case"top_left":i=e.anchor_position.x+n/2,s=e.anchor_position.y+o/2;break;case"top_center":i=e.anchor_position.x,s=e.anchor_position.y+o/2;break;case"top_right":i=e.anchor_position.x-n/2,s=e.anchor_position.y+o/2;break;case"center_left":i=e.anchor_position.x+n/2,s=e.anchor_position.y;break;case"center":i=e.anchor_position.x,s=e.anchor_position.y;break;case"center_right":i=e.anchor_position.x-n/2,s=e.anchor_position.y;break;case"bottom_left":i=e.anchor_position.x+n/2,s=e.anchor_position.y-o/2;break;case"bottom_center":i=e.anchor_position.x,s=e.anchor_position.y-o/2;break;case"bottom_right":i=e.anchor_position.x-n/2,s=e.anchor_position.y-o/2;break;default:i=e.anchor_position.x,s=e.anchor_position.y;break}return{x:i-n/2,y:s-o/2,width:n,height:o}}function Bkr(e){if(!e._adjustSilkscreenTextAutomatically)return;if(e.root?.pcbDisabled||!e.pcb_component_id)return;let{db:t}=e.root,o=e._getPcbCircuitJsonBounds().center,r=t.pcb_silkscreen_text.list({pcb_component_id:e.pcb_component_id}).filter((c)=>c.text===e.name);if(r.length===0)return;let a=e.getSubcircuit().selectAll("[_isNormalComponent=true]").filter((c)=>c!==e&&c.pcb_component_id).map((c)=>{let l=c._getPcbCircuitJsonBounds(),h={center:l.center,width:l.width,height:l.height};return sR(h)});for(let c of r){let l=c.anchor_position,h=wkr(c),d={center:{x:h.x+h.width/2,y:h.y+h.height/2},width:h.width,height:h.height},u=sR(d);if(!a.some((y)=>yp(u,y)))continue;let p=2*o.x-l.x,m=2*o.y-l.y,A={center:{x:p,y:m},width:h.width,height:h.height},g=sR(A);if(!a.some((y)=>yp(g,y)))t.pcb_silkscreen_text.update(c.pcb_silkscreen_text_id,{anchor_position:{x:p,y:m}})}}var Tkr=(e)=>{if(e.root?.platform?.drcChecksDisabled??e.getInheritedProperty("drcChecksDisabled"))return;let{db:n}=e.root;if(!e.source_component_id)return;let o=e.selectAll("port"),r=n.source_trace.list(),i=new Set;for(let a of r)for(let c of a.connected_source_port_ids)i.add(c);let s=e._getInternallyConnectedPins();for(let a of s)if(a.some((c)=>c.source_port_id&&i.has(c.source_port_id))){for(let c of a)if(c.source_port_id)i.add(c.source_port_id)}for(let a of o){if(!a.source_port_id)continue;if(!Dkr(e,a))continue;if(n.source_port.get(a.source_port_id)?.do_not_connect)continue;if(i.has(a.source_port_id))continue;n.source_pin_missing_trace_warning.insert({message:`Port ${a.getNameAndAliases()[0]} on ${e.props.name} is missing a trace`,source_component_id:e.source_component_id,source_port_id:a.source_port_id,subcircuit_id:e.getSubcircuit().subcircuit_id??void 0,warning_type:"source_pin_missing_trace_warning"})}},Dkr=(e,t)=>{if(e.config.componentName==="Interconnect")return!1;if(e.config.componentName==="Chip"){let n=e.props.pinAttributes;if(!n)return!1;for(let o of t.getNameAndAliases()){let r=n[o];if(r?.requiresPower||r?.requiresGround||r?.requiresVoltage!==void 0)return!0}return!1}return!0},Nkr=(e)=>{let t=e.root?.platform?.drcChecksDisabled??e.getInheritedProperty("drcChecksDisabled"),{db:n}=e.root;if(!e.source_component_id)return;let o=n.source_component.get(e.source_component_id);if(!o)return;let r=n.source_missing_manufacturer_part_number_warning.getWhere({source_component_id:e.source_component_id}),i=Object.values(o.supplier_part_numbers??{}).some((a)=>a?.some((c)=>c.trim()));if(t||e.props.doNotPlace||o.ftype==="simple_resistor"||o.ftype==="simple_capacitor"||o.ftype==="simple_inductor"||o.manufacturer_part_number?.trim()||i){if(r)n.source_missing_manufacturer_part_number_warning.delete(r.source_missing_manufacturer_part_number_warning_id);return}if(r)return;let s=o.ftype==="simple_connector"?o.standard:void 0;n.source_missing_manufacturer_part_number_warning.insert({source_component_id:e.source_component_id,subcircuit_id:e.getSubcircuit()?.subcircuit_id??void 0,standard:s,warning_type:"source_missing_manufacturer_part_number_warning",message:`${e.getString()} is missing a manufacturer part number and could not be resolved to a supplier part. Specify mpn, manufacturerPartNumber, or mfn, provide supplierPartNumbers, or configure a parts engine to select a part. If this part will not be assembled, mark it doNotPlace.`})},Pgn=new WeakMap,Rkr=async(e,t)=>{let n=new AbortController,o,r=new Promise((i)=>{o=setTimeout(()=>{n.abort(),i(!1)},1e4)});try{let i=Promise.resolve().then(()=>e.fetchPartAvailability({...t,signal:n.signal})).then((s)=>s===void 0?void 0:s.stock!==null&&s.stock>0).catch(()=>!1);return await Promise.race([i,r])}finally{clearTimeout(o)}},Qkr=(e,{partsEngine:t,...n})=>{let o=Pgn.get(e);if(!o)o=new WeakMap,Pgn.set(e,o);let r=o.get(t);if(!r)r=new Map,o.set(t,r);let i=`${n.supplierName}:${n.supplierPartNumber}`,s=r.get(i);if(s)return s;let a=Rkr(t,{...n,platformFetch:e.platform?.platformFetch}).finally(()=>{r.delete(i)});return r.set(i,a),a},vtt=new WeakMap,kkr=$M.shape.supplierPartNumbers.unwrap().keySchema.options;function Egn(e,{refresh:t=!1}={}){let{root:n,source_component_id:o}=e;if(!n||!o)return;let{db:r}=n,i=e.getInheritedProperty("partsEngine"),s=e.props.supplierPartNumbers??{},a=kkr.map((u)=>({supplierName:u,partNumbers:[...new Set((s[u]??[]).map((_)=>_.trim()).filter(Boolean))]})).filter((u)=>u.partNumbers.length>0),c=n.platform?.checkAvailability===!0&&!!i?.fetchPartAvailability&&!e.props.doNotPlace&&!e.getInheritedProperty("bomDisabled")&&!e.getInheritedProperty("partsEngineDisabled")&&!(n.platform?.drcChecksDisabled??e.getInheritedProperty("drcChecksDisabled"))&&a.length>0,l=c?JSON.stringify(a):"disabled",h=vtt.get(e);if(!t&&h?.key===l&&h.partsEngine===i)return;let d={key:l,partsEngine:i};vtt.set(e,d);for(let u of r.source_component_availability_warning.list({source_component_id:o}))r.source_component_availability_warning.delete(u.source_component_availability_warning_id);if(!c||!i)return;e._queueAsyncEffect("check-component-availability",async()=>{let u=await Promise.all(a.map(async({supplierName:_,partNumbers:p})=>({supplierName:_,partNumbers:p,availability:await Promise.all(p.map((m)=>Qkr(n,{partsEngine:i,supplierName:_,supplierPartNumber:m})))})));if(vtt.get(e)!==d||n.platform?.checkAvailability!==!0||e.shouldBeRemoved)return;for(let{supplierName:_,partNumbers:p,availability:m}of u){if(m.some((g)=>g===!0))continue;let A=p.filter((g,f)=>m[f]!==void 0);if(!A.length)continue;r.source_component_availability_warning.insert(pre.parse({type:"source_component_availability_warning",source_component_id:o,subcircuit_id:e.getSubcircuit()?.subcircuit_id??void 0,supplier_name:_,supplier_part_numbers:A,message:`${e.name||"Unnamed component"} may not have availability from ${_} (${A.join(", ")}).`}))}})}var Lkr=0.8,Hkr=$M.shape.supplierPartNumbers.unwrap().keySchema.options,Fkr=(e)=>Number.isFinite(e.minX)&&Number.isFinite(e.minY)&&Number.isFinite(e.maxX)&&Number.isFinite(e.maxY)&&e.maxX>e.minX&&e.maxY>e.minY,Mgn=(e,t=0)=>{let n={minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};for(let o of e){if(o.type!=="pcb_smtpad"&&o.type!=="pcb_plated_hole")continue;let r=o.type==="pcb_smtpad"?zX(o):kN(o,t),i=Qre(r,{x:0,y:0},-t).box;n.minX=Math.min(n.minX,i.xmin),n.minY=Math.min(n.minY,i.ymin),n.maxX=Math.max(n.maxX,i.xmax),n.maxY=Math.max(n.maxY,i.ymax)}if(!Fkr(n))return null;return n},wgn=(e)=>({width:e.maxX-e.minX,height:e.maxY-e.minY}),Bgn=(e,t,n)=>{let o=wgn(e),r=wgn(t),i=n?.rotateB?r.height:r.width,s=n?.rotateB?r.width:r.height,a=Math.min(o.width,i),c=Math.min(o.height,s),l=a*c,h=o.width*o.height+i*s-l;if(h<=0)return 0;return l/h},zkr=(e,t)=>Math.max(Bgn(e,t),Bgn(e,t,{rotateB:!0})),Okr=(e)=>{if(!e)return[];let t=[];for(let n of Hkr){let o=e[n];if(!Array.isArray(o))continue;for(let r of o){if(!r)continue;t.push({supplierName:n,supplierPartNumber:r})}}return t};function Vkr(e){if(e.root?.pcbDisabled)return;if(e.props.doNotPlace)return;if(e.props.footprint===void 0)return;if(e.getInheritedProperty("bomDisabled"))return;if(e.getInheritedProperty("partsEngineDisabled"))return;let t=e.getInheritedProperty("partsEngine");if(!t?.fetchPartCircuitJson)return;let{db:n}=e.root,o=n.source_component.get(e.source_component_id);if(!o?.supplier_part_numbers)return;if(!e.pcb_component_id)return;if(e._hasStartedSupplierFootprintMismatchWarningCheck)return;let r=Okr(o.supplier_part_numbers);if(r.length===0)return;let i=[...n.pcb_smtpad.list({pcb_component_id:e.pcb_component_id}),...n.pcb_plated_hole.list({pcb_component_id:e.pcb_component_id})],s=n.pcb_component.get(e.pcb_component_id),a=Mgn(i,s.rotation);if(!a)return;e._hasStartedSupplierFootprintMismatchWarningCheck=!0,e._queueAsyncEffect("check-supplier-footprint-mismatch",async()=>{let{db:c}=e.root,l=t.fetchPartCircuitJson;for(let h of r){let{supplierName:d,supplierPartNumber:u}=h;try{let _=await Promise.resolve(jxn(l,{supplierPartNumber:u}))??null;if(!_?.length)continue;let p=Mgn(_);if(!p)continue;let m=zkr(a,p);if(m>=Lkr)return;let A=typeof e.props.footprint==="string"?`"${e.props.footprint}"`:"the provided footprint",g=Number(m.toFixed(4)),f=pAe.parse({type:"supplier_footprint_mismatch_warning",message:`${e.getString()} footprint ${A} does not match supplier footprint ${d}:${u} (copper IoU ${g}).`,source_component_id:e.source_component_id,pcb_component_id:e.pcb_component_id,pcb_group_id:e.getGroup()?.pcb_group_id??void 0,subcircuit_id:e.getSubcircuit()?.subcircuit_id??void 0,supplier_name:d,supplier_part_number:u,footprint_copper_intersection_over_union:g});c.supplier_footprint_mismatch_warning.insert(f);return}catch(_){let p=_ instanceof Error?_.message:String(_),m=IN.parse({type:"source_part_not_found_warning",message:`Failed to fetch supplier footprint for ${e.getString()} (${d}:${u}): ${p}`,source_component_id:e.source_component_id??void 0,subcircuit_id:e.getSubcircuit()?.subcircuit_id??void 0,supplier_name:d,supplier_part_number:u});c.source_part_not_found_warning.insert(m);return}}})}var Tgn=(e,t)=>{let n=e._parsedProps.pinNumber,o=t._parsedProps.pinNumber;if(n!==void 0&&o!==void 0&&n!==o)return!1;return e.isMatchingAnyOf(t.getNameAndAliases())},Ykr=(e,t)=>{let n=e.toSorted(),o=t.toSorted();return n.length===o.length&&n.every((r,i)=>r===o[i])},Gkr=(e)=>e.getNameAndAliases().find((t)=>/^pin\d+$/.test(t))??null,Ukr=(e,t)=>{if(!e._isPrimaryPort&&e.props.name)return e.props.name;if(e.props.name&&(t.get(e.props.name)??0)<=1)return e.props.name;let n=Gkr(e);if(n)return n;return e.props.name??null};function v4n(e,t){let n=new Map;for(let o of e)for(let r of new Set(o.getNameAndAliases())){if(/^(pin)?\d+$/.test(r))continue;if(!o._isPrimaryPort&&r===o.props.name)continue;if(!n.has(r))n.set(r,[]);n.get(r).push(o)}for(let o of n.values()){let r=Array.from(new Set(o));if(r.length<2)continue;let i=new Map;for(let c of r){if(!c.props.name)continue;i.set(c.props.name,(i.get(c.props.name)??0)+1)}let s=r.map((c)=>Ukr(c,i)).filter((c)=>Boolean(c)),a=Array.from(new Set(s));if(a.length<2)continue;if(t.some((c)=>Ykr(c,a)))continue;t.push(a)}}function Stt(e,t){let n=1,o=new Map;for(let i of e){let s=i.hints.filter((u)=>u&&u.trim()!=="");if(s.length===0)continue;let a=s,c=a.map((u)=>t?.implicitPinNumberByHint?.get(u)).find((u)=>u!==void 0&&a.includes(t?.getPhysicalPinName?.(u)??""));if(c!==void 0)a=[...a.filter((u)=>!/^(?:pin)?\d+$/.test(u)),`pin${c}`];if(!a.some((u)=>u.startsWith("pin")||/^(?:pin)?\d+$/.test(u))){let u=a.map((_)=>t?.implicitPinNumberByHint?.get(_)).find((_)=>_!==void 0);if(u!==void 0)a=[...a,`pin${u}`];else if(t?.allowImplicitPinNumbers===!1)continue;else a=[...a,`pin${n}`]}n++;let h=xot(a,t);if(!h)continue;h.originDescription=i.originDescription;let d=h._parsedProps.pinNumber;if(d===void 0)continue;if(h.physicalPinName=t?.getPhysicalPinName?.(d),!o.has(d))o.set(d,[]);o.get(d).push({port:h,component:i.component})}let r=[];for(let[i,s]of o){let a=(u,_)=>{let p=_.getNameAndAliases().filter((m)=>!u.getNameAndAliases().includes(m));u.externallyAddedAliases.push(...p)},c=s[0].port,l=s.filter((u)=>Boolean(u.component));if(l.length!==s.length){for(let u of s.slice(1))a(c,u.port);r.push(c);continue}let h=wRr(l.map((u)=>u.component));if(h.length<=1){for(let u of s.slice(1))a(c,u.port);r.push(c);continue}let d=[c.props.name];for(let[u,_]of h.entries()){let p=l.filter((A)=>_.includes(A.component));if(u===0){for(let A of p.slice(1))a(c,A.port);r.push(c);continue}let m=new Lh({name:`pin${i}_internal_${u}`,aliases:c.getNameAndAliases()});m._isPrimaryPort=!1,m._primaryPinNumber=i,m.originDescription=`implicitInternalPhysicalPort:pin${i}:${u}`;for(let A of p)a(m,A.port);d.push(m.props.name),r.push(m)}t?.inferredInternallyConnectedPinNames?.push(d)}if(t?.inferredInternallyConnectedPinNames&&t.inferSharedAliases!==!1)v4n(r,t.inferredInternallyConnectedPinNames);return r}var Wkr=qxn.default("tscircuit:core"),Xkr=we({x:ei,y:ei,z:ei}),bl=class extends nr{schematicBoxDimensions=null;reactSubtrees=[];_impliedFootprint;_resolvedPcbCalcOffsetX;_resolvedPcbCalcOffsetY;isPrimitiveContainer=!0;_isNormalComponent=!0;_getIsSmt(){if(this._parsedProps.isSmt!==void 0)return this._parsedProps.isSmt;return this.selectAll("smtpad").some((e)=>e.getPrimitiveContainer()===this)}_attributeLowerToCamelNameMap={_isnormalcomponent:"_isNormalComponent"};_asyncSupplierPartNumbers;_asyncFootprintCadModel;_importedSourcePorts=[];_importedInternallyConnectedPinNames;_fetchedSourcePortsForPinAttributes=[];_fetchedInternallyConnectedPinNames;_hasStartedPinAttributesFetch=!1;_isCadModelChild;_inferredInternallyConnectedPinNames=[];pcb_missing_footprint_error_id;_hasStartedFootprintUrlLoad=!1;_hasStartedPartOrientationAnalysis=!1;_asyncSupplierPin1LocationMap;_hasStartedSupplierFootprintMismatchWarningCheck=!1;_hasInflatedCircuitJsonSymbol=!1;_invalidFootprintPropMessages=[];_invalidPinLabelMessages=[];_impliedFootprintPinLabels;_adjustSilkscreenTextAutomatically=!1;get defaultInternallyConnectedPinNames(){return[]}get internallyConnectedPinNames(){return[...this._parsedProps.internallyConnectedPins??this._importedInternallyConnectedPinNames??this.defaultInternallyConnectedPinNames,...this._inferredInternallyConnectedPinNames].map((t)=>t.map((n)=>typeof n==="number"?`pin${n}`:n))}constructor(e){let t={...e},n=[];if(t.pinLabels&&!Array.isArray(t.pinLabels)){let{validPinLabels:o,invalidPinLabelsMessages:r}=gQr(t.pinLabels);t.pinLabels=o,n=r}super(t);if(t.pinLabels&&!Array.isArray(t.pinLabels)){let o=Object.keys(t.pinLabels).find((r)=>nB(r)===null&&!lde(r));if(o)throw new t5n(this.lowercaseComponentName,this.props,{_errors:[],pinLabels:{_errors:[`Invalid pinLabels key "${o}". Expected "pin\${number}" (e.g. pin1, pin2) or a physical ball name (e.g. A1).`]}})}this._invalidPinLabelMessages=n,this._addChildrenFromStringFootprint(),this._addChildrenFromCircuitJsonSymbol(),this.initPorts()}doInitialSourceNameDuplicateComponentRemoval(){if(!this.name)return;let e=this.root;if((this.getSubcircuit().getNormalComponentNameMap?.()?.get(this.props.name)??[]).filter((r)=>r!==this&&r.renderPhaseStates.SourceNameDuplicateComponentRemoval.initialized).length>0){let r=this._getGlobalPcbPositionBeforeLayout(),i=this._getGlobalSchematicPositionBeforeLayout();e.db.source_failed_to_create_component_error.insert({component_name:this.name,error_type:"source_failed_to_create_component_error",message:`Cannot create component "${this.name}": A component with the same name already exists`,pcb_center:r,schematic_center:i}),this.shouldBeRemoved=!0;let s=[...this.children];for(let a of s)this.remove(a)}}initPorts(e={}){if(Eb.isValidElement(this.props.symbol)&&!this.children.some((p)=>p.componentName==="Symbol"))return;this._inferredInternallyConnectedPinNames=[];let{config:n}=this,o=[],r=this._resolvePinLabels(),i=this._parsedProps.pinLabels,s=i&&Array.isArray(i)?Object.fromEntries(i.map((p,m)=>[`pin${m+1}`,p])):i?$he(i):void 0,a=this._getAllPortsFromChildren(),c=a.some((p)=>p._getSymbolAncestor()!==null),l=(p)=>a.some((m)=>m._parsedProps.pinNumber===p)||o.some((m)=>m._parsedProps.pinNumber===p),h=this._getSchematicPortArrangement();if(h&&!r){for(let A in h){let g=h[A].pins;if(Array.isArray(g))for(let f of g){let y=cY(f,r);if(l(y))continue;o.push(new Lh({pinNumber:y,aliases:e.additionalAliases?.[`pin${y}`]??[]},{originDescription:`schPortArrangement:${A}`}))}}let p=["left","right","top","bottom"],m=1;for(let A of p){let g=h[`${A}Size`];for(let f=0;f<g;f++){let y=m++;if(l(y))continue;o.push(new Lh({pinNumber:y,aliases:e.additionalAliases?.[`pin${y}`]??[]},{originDescription:`schPortArrangement:${A}`}))}}}if(r)for(let[p,m]of Object.entries(r)){let A=nB(p);if(A===null)throw Error(`Invalid pinLabels key "${p}". Expected "pin\${number}" (e.g. pin1, pin2) or a physical ball name (e.g. A1).`);let g=a.find((v)=>v._parsedProps.pinNumber===A)??o.find((v)=>v._parsedProps.pinNumber===A),f=Array.isArray(m)?m:[m],x=s?.[p]!==void 0,C=this._getPhysicalPinName(A),b=C??(x?f[0]:`pin${A}`),I=C?f:x?f.slice(1):f;if(!g)g=new Lh({pinNumber:A,name:b,aliases:[...x?[]:e.additionalAliases?.[`pin${A}`]??[],...I,...x?e.additionalAliases?.[`pin${A}`]??[]:[]]},{originDescription:`pinLabels:pin${A}`}),o.push(g);else g.externallyAddedAliases.push(b,...I);g.physicalPinName=C}if(n.schematicSymbolName&&!e.ignoreSymbolPorts){let p=Es[this._getSchematicSymbolNameOrThrow()];if(!p)return;let m=p.ports.some((f)=>f.labels.some((y)=>!/^(?:pin)?\d+$/.test(y)));if(m&&r){for(let f=1;f<=(e.pinCount??0);f++)if(!l(f))o.push(new Lh({pinNumber:f}))}let A=[...this._getAllPortsFromChildren(),...o],g=new Map;for(let f of p.ports){let y=f.labels.filter((C)=>!/^(?:pin)?\d+$/.test(C)),x=A.filter((C)=>C.getNameAndAliases().some((b)=>y.includes(b)));if(x.length===1)g.set(f,x[0])}for(let f of p.ports){let y=r7e(f.labels);if(!y)continue;let x=A.filter((b)=>![...g.values()].includes(b)),C=g.get(f)??x.find((b)=>b._parsedProps.pinNumber===Number(y))??(m&&p.ports.length-g.size===1&&x.length===1?x[0]:void 0);if(C)g.set(f,C),C.schematicSymbolPortDef=f;else{if(c)continue;let b=xot(f.labels.concat(e.additionalAliases?.[`pin${y}`]??[]));if(b)b.originDescription=`schematicSymbol:labels[0]:${f.labels[0]}`,b.schematicSymbolPortDef=f,o.push(b)}}this.addAll(o)}let d=Eb.isValidElement(this.props.symbol),u=Cot(this.props.symbol);if(!d&&!u){let p=this.getPortsFromFootprint({...e,allowImplicitPinNumbers:!s,collectInferredInternallyConnectedPins:!0}),m=this._getAllPortsFromChildren();for(let A of p){if(!A._isPrimaryPort){o.push(A);continue}let g=m.find((f)=>Tgn(f,A))??o.find((f)=>Tgn(f,A));if(g){let f=A.getNameAndAliases().filter((y)=>!g.getNameAndAliases().includes(y));g.externallyAddedAliases.push(...f)}else if(!h)o.push(A)}}let _=e.pinCount??this._getPrimaryPinCount()??0;for(let p=1;p<=_;p++){if(l(p))continue;if(!h&&s&&!Array.isArray(i)&&!s[`pin${p}`])continue;if(!h){o.push(new Lh({pinNumber:p,aliases:e.additionalAliases?.[`pin${p}`]??[]}));continue}let m=Bve(h).map((A)=>cY(A,r));if(["leftSize","rightSize","topSize","bottomSize","leftPinCount","rightPinCount","topPinCount","bottomPinCount"].some((A)=>(A in h)))m=Array.from({length:this._getPrimaryPinCount()},(A,g)=>g+1);if(!m.includes(p))continue;o.push(new Lh({pinNumber:p,aliases:e.additionalAliases?.[`pin${p}`]??[]},{originDescription:`notOtherwiseAddedButDeducedFromPinCount:${p}`}))}if(v4n(Array.from(new Set([...this._getAllPortsFromChildren(),...o].filter((p)=>!p.physicalPinName))),this._inferredInternallyConnectedPinNames),o.length>0)this.addAll(o)}_resolvePinLabels(){let e=this._parsedProps.pinLabels,t=e&&Array.isArray(e)?Object.fromEntries(e.map((o,r)=>[`pin${r+1}`,o])):e?$he(e):void 0,n={...this._impliedFootprintPinLabels??{},...t??{}};if(Object.keys(n).length===0)return;return n}_resolvedPackagePins;_getPhysicalPinName(e){let t=this._parsedProps?.pinLabels??this.props.pinLabels;if(!t||Array.isArray(t))return;return this._resolvedPackagePins??=Ait(t),this._resolvedPackagePins.find((n)=>n.pinNumber===e)?.physicalPinName}_getImpliedFootprintString(){return null}resolveFootprint(){return this._parsedProps.footprint??this.props.footprint??this._getImpliedFootprintString?.()}_addChildrenFromStringFootprint(){let{pcbRotation:e,pcbPinLabels:t}=this.props,n=this._resolvePinLabels(),o=this.resolveFootprint();if(!o)return;if(typeof o==="string"){if(Ck(o))return;if(xk(o))return;if(ude(o))return;if(DJ(o))return;let r;try{r=Kl.string(o).soup()}catch(s){this._queueInvalidFootprintPropMessage(o,s);return}let i=sB({sourcePortOwner:this,componentName:this.name??this.componentName,componentRotation:e,footprinterString:o,pinLabels:n,pcbPinLabels:t},r);this.addAll(i)}}_addChildrenFromCircuitJsonSymbol(){if(this._hasInflatedCircuitJsonSymbol)return;let e=this._parsedProps.symbol;if(!Cot(e))return;if(this.children.some((i)=>i.componentName==="Symbol")){this._hasInflatedCircuitJsonSymbol=!0;return}let t=OQr(e);if(t.length===0)return;let n=zQr(t),o=sB({sourcePortOwner:this,componentName:this.name??this.componentName,componentRotation:String(this.props.schRotation??0)},n);if(o.length===0)return;if(this._hasInflatedCircuitJsonSymbol=!0,!o.some((i)=>i.componentName==="Symbol")){let i=new Bit({name:this.name??this.componentName});i.addAll(o),this.add(i);return}this.addAll(o)}get portMap(){return new Proxy({},{get:(e,t)=>{let n=this.children.find((r)=>r.componentName==="Symbol"),o=[...this.children,...n?.children??[]].find((r)=>r.componentName==="Port"&&r.isMatchingNameOrAlias(t));if(!o)throw Error(`There was an issue finding the port "${t.toString()}" inside of a ${this.componentName} component with name: "${this.props.name}". This is a bug in @tscircuit/core`);return o}})}getInstanceForReactElement(e){for(let t of this.reactSubtrees)if(t.element===e)return t.component;return null}doInitialSourceRender(){let e=this.config.sourceFtype;if(!e)return;let{db:t}=this.root,{_parsedProps:n}=this,o=t.source_component.insert({ftype:e,name:this.name,manufacturer_part_number:ii(n),supplier_part_numbers:n.supplierPartNumbers,display_name:n.displayName});this.source_component_id=o.source_component_id}getRefDesPrefixes(){return g4n(this.config.sourceFtype)}doInitialCheckRefDesConvention(){ckr(this)}doInitialSourceParentAttachment(){let{db:e}=this.root,t=this._getInternallyConnectedPins().map((n)=>n.map((o)=>o.source_port_id).filter((o)=>o!==null)).filter((n)=>n.length>=2);if(this.source_component_id&&t.length>0)e.source_component.update(this.source_component_id,{internally_connected_source_port_ids:t});for(let n of t)e.source_component_internal_connection.insert({source_component_id:this.source_component_id,subcircuit_id:this.getSubcircuit()?.subcircuit_id,source_port_ids:n})}updateSourceParentAttachment(){let{db:e}=this.root;for(let t of e.source_component_internal_connection.list({source_component_id:this.source_component_id}))e.source_component_internal_connection.delete(t.source_component_internal_connection_id);this.doInitialSourceParentAttachment()}doInitialSchematicComponentRender(){Mkr(this)}_getSchematicSymbolDisplayValue(){return}_getInternallyConnectedPins(){if(this.internallyConnectedPinNames.length===0)return[];let e=[];for(let t of this.internallyConnectedPinNames){let n=[];for(let o of t){let r=this.portMap[o]??this.portMap[`pin${o}`];if(r)n.push(r)}e.push(n)}return e}_doInitialSchematicComponentRenderWithSymbol(){if(this.root?.schematicDisabled)return;let{db:e}=this.root,{_parsedProps:t}=this,n=this._getSchematicSymbolNameOrThrow(),o=Es[n],r=this._getGlobalSchematicPositionBeforeLayout();if(o){let i=e.schematic_component.insert({center:r,size:{...o.size},source_component_id:this.source_component_id,is_box_with_pins:!0,symbol_name:n,schematic_sheet_id:this._resolveSchematicSheetId(),symbol_display_value:this._getSchematicSymbolDisplayValue()});this.schematic_component_id=i.schematic_component_id}}_doInitialSchematicComponentRenderWithReactSymbol(e){if(this.root?.schematicDisabled)return;let{db:t}=this.root,n=this._getGlobalSchematicPositionBeforeLayout(),o=t.schematic_component.insert({center:n,size:{width:0,height:0},source_component_id:this.source_component_id,symbol_display_value:this._getSchematicSymbolDisplayValue(),is_box_with_pins:!1,schematic_sheet_id:this._resolveSchematicSheetId()});this.schematic_component_id=o.schematic_component_id}_doInitialSchematicComponentRenderWithSchematicBoxDimensions(e){if(this.root?.schematicDisabled)return;let{db:t}=this.root,{_parsedProps:n}=this;this.schematicBoxDimensions=e;let o={};if(Array.isArray(n.pinLabels))n.pinLabels.forEach((_,p)=>{o[String(p+1)]=_});else for(let[_,p]of Object.entries(n.pinLabels??{}))o[_]=Array.isArray(p)?p[0]:p;let r=this._getGlobalSchematicPositionBeforeLayout(),i=this._getSchematicPortArrangement(),s=t.schematic_component.insert({center:r,rotation:n.schRotation??0,size:e.getSize(),port_arrangement:Eit(i),pin_spacing:0.2,pin_styles:Pit(n.schPinStyle,n.pinLabels),port_labels:o,source_component_id:this.source_component_id,schematic_sheet_id:this._resolveSchematicSheetId()}),a=i?.topSide!==void 0,c=a||i?.bottomSide!==void 0,l=e?.getSize().width,h=e?.getSize().height,d=t.schematic_text.insert({text:ii(n)??"",schematic_component_id:s.schematic_component_id,anchor:"left",rotation:0,position:{x:a?r.x+(l??0)/2+0.1:r.x-(l??0)/2,y:c?r.y+(h??0)/2+0.35:r.y-(h??0)/2-0.13},color:"#006464",font_size:0.18,schematic_sheet_id:this._resolveSchematicSheetId()}),u=t.schematic_text.insert({text:n.displayName??n.name??"",schematic_component_id:s.schematic_component_id,anchor:"left",rotation:0,position:{x:a?r.x+(l??0)/2+0.1:r.x-(l??0)/2,y:c?r.y+(h??0)/2+0.55:r.y+(h??0)/2+0.13},color:"#006464",font_size:0.18,schematic_sheet_id:this._resolveSchematicSheetId()});this.schematic_component_id=s.schematic_component_id}doInitialPcbComponentRender(){if(this.root?.pcbDisabled)return;let{db:e}=this.root,{_parsedProps:t}=this,n=this.getSubcircuit(),o=this._getPcbComponentLayer();if(o!=="top"&&o!=="bottom"){let l=uX.parse({type:"pcb_component_invalid_layer_error",message:`Component cannot be placed on layer '${o}'. Components can only be placed on 'top' or 'bottom' layers.`,source_component_id:this.source_component_id,layer:o,subcircuit_id:n.subcircuit_id??void 0});e.pcb_component_invalid_layer_error.insert(l)}let r=this.getGlobalTransformRotation(),i=e.pcb_component.insert({center:this._getGlobalPcbPositionBeforeLayout(),width:0,height:0,layer:o==="top"||o==="bottom"?o:"top",rotation:nu(r),insertion_direction:this._getPcbComponentInsertionDirection(o,r),source_component_id:this.source_component_id,subcircuit_id:n.subcircuit_id??void 0,do_not_place:t.doNotPlace??!1,obstructs_within_bounds:t.obstructsWithinBounds??!0,is_allowed_to_be_off_board:t.allowOffBoard??!1,metadata:t.kicadFootprintMetadata?{kicad_footprint:t.kicadFootprintMetadata}:void 0}),s=this.resolveFootprint(),a=this.children.some((l)=>l.componentName==="Footprint");if(!s&&!a&&!this.isGroup){let l=e.pcb_missing_footprint_error.insert({message:`No footprint specified for component: ${this.getString()}`,source_component_id:`${this.source_component_id}`,error_type:"pcb_missing_footprint_error"});this.pcb_missing_footprint_error_id=l.pcb_missing_footprint_error_id}this.pcb_component_id=i.pcb_component_id;let c=this.getSubcircuit()._getPcbManualPlacementForComponent(this);if((this.props.pcbX!==void 0||this.props.pcbY!==void 0)&&!!c){let l=uAe.parse({type:"pcb_manual_edit_conflict_warning",pcb_manual_edit_conflict_warning_id:`pcb_manual_edit_conflict_${this.source_component_id}`,message:`${this.getString()} has both manual placement and prop coordinates. pcbX and pcbY will be used. Remove pcbX/pcbY or clear the manual placement.`,pcb_component_id:this.pcb_component_id,source_component_id:this.source_component_id,subcircuit_id:n.subcircuit_id??void 0});e.pcb_manual_edit_conflict_warning.insert(l)}}doInitialPcbComponentSizeCalculation(){if(this.root?.pcbDisabled)return;if(!this.pcb_component_id)return;let{db:e}=this.root;rkr(this);let t=o7e(this.children);if(t.width===0||t.height===0)return;let n={x:(t.minX+t.maxX)/2,y:(t.minY+t.maxY)/2};e.pcb_component.update(this.pcb_component_id,{center:n,width:t.width,height:t.height})}updatePcbComponentSizeCalculation(){this.doInitialPcbComponentSizeCalculation()}doInitialSchematicComponentSizeCalculation(){if(this.root?.schematicDisabled)return;if(!this.schematic_component_id)return;let{db:e}=this.root;if(!e.schematic_component.get(this.schematic_component_id))return;let n=[],o=(l)=>{for(let h of l){if(h.isSchematicPrimitive&&h.componentName==="SchematicLine"){let d=e.schematic_line.get(h.schematic_line_id);if(d)n.push(d)}if(h.isSchematicPrimitive&&h.componentName==="SchematicRect"){let d=e.schematic_rect.get(h.schematic_rect_id);if(d)n.push(d)}if(h.isSchematicPrimitive&&h.componentName==="SchematicCircle"){let d=e.schematic_circle.get(h.schematic_circle_id);if(d)n.push(d)}if(h.isSchematicPrimitive&&h.componentName==="SchematicArc"){let d=e.schematic_arc.get(h.schematic_arc_id);if(d)n.push(d)}if(h.isSchematicPrimitive&&h.componentName==="SchematicPath"){let d=h.schematic_path_ids;if(d)for(let u of d){let _=e.schematic_path.get(u);if(_)n.push(_)}}if(h.children&&h.children.length>0)o(h.children)}};if(o(this.children),n.length===0)return;let r=bue(n),i=Math.abs(r.maxX-r.minX),s=Math.abs(r.maxY-r.minY);if(i===0&&s===0)return;let a=(r.minX+r.maxX)/2,c=(r.minY+r.maxY)/2;e.schematic_component.update(this.schematic_component_id,{center:{x:a,y:c},size:{width:i,height:s}})}updateSchematicComponentSizeCalculation(){this.doInitialSchematicComponentSizeCalculation()}doInitialPcbComponentAnchorAlignment(){xkr(this)}updatePcbComponentAnchorAlignment(){this.doInitialPcbComponentAnchorAlignment()}doInitialResolveFootprintPinLabels(){Ekr(this)}updateResolveFootprintPinLabels(){this.doInitialResolveFootprintPinLabels()}_renderReactSubtree(e){let t=Iue(e);return{element:e,component:t}}doInitialInitializePortsFromChildren(){this.initPorts()}updateInitializePortsFromChildren(){this.initPorts()}getGlobalTransformRotation(){let e=this._computePcbGlobalTransformBeforeLayout();return Iot.decomposeTSR(e).rotation.angle*180/Math.PI}_footprintChildCache;_getFootprintMetadataForPcbComponent(){if(!this._footprintChildCache||this._footprintChildCache.children!==this.children||this._footprintChildCache.childrenVersion!==this._childrenVersion||this._footprintChildCache.childCount!==this.children.length)this._footprintChildCache={children:this.children,childrenVersion:this._childrenVersion,childCount:this.children.length,footprintChild:this.children.find((n)=>n.componentName==="Footprint")};let{footprintChild:e}=this._footprintChildCache;if(e)return{insertionDirection:e._parsedProps.insertionDirection,cutoutApertureDirection:e._parsedProps.cutoutApertureDirection,originalLayer:e._parsedProps.originalLayer};let t=this.resolveFootprint();if(Eb.isValidElement(t)){let n=t.props;return{insertionDirection:n.insertionDirection,cutoutApertureDirection:n.cutoutApertureDirection,originalLayer:n.originalLayer}}if(t?.componentName==="Footprint")return{insertionDirection:t._parsedProps?.insertionDirection??t.props?.insertionDirection,cutoutApertureDirection:t._parsedProps?.cutoutApertureDirection??t.props?.cutoutApertureDirection,originalLayer:t._parsedProps?.originalLayer??t.props?.originalLayer};if(typeof t==="string"&&/^(pinrow|headermodule|smdpinheader)(?=\d|_|$)/.test(t)){if(!Kl.string(t).params().rightangle)return{insertionDirection:"from_above"}}return}_getPcbComponentLayer(){return this._parsedProps.layer??(this._getFootprintOriginalLayer()==="bottom"?"bottom":"top")}_getFootprintOriginalLayer(){return this._getFootprintMetadataForPcbComponent()?.originalLayer}_getPcbComponentInsertionDirection(e,t=this.getGlobalTransformRotation()){let n=this._getFootprintMetadataForPcbComponent();if(!n?.insertionDirection)return;return jNr({insertionDirection:n.insertionDirection,rotationDegrees:t,isFlipped:hde({componentLayer:e,originalLayer:n.originalLayer})})}_getPcbComponentInsertionAxisDirection(e,t=this.getGlobalTransformRotation()){let n=this._getFootprintMetadataForPcbComponent();if(!n?.insertionDirection)return;return rot({insertionDirection:n.insertionDirection,rotationDegrees:t,isFlipped:hde({componentLayer:e,originalLayer:n.originalLayer})})}_getEnclosureApertureAxisDirection(e,t=this.getGlobalTransformRotation()){let n=this._getFootprintMetadataForPcbComponent(),o=n?.cutoutApertureDirection??n?.insertionDirection;if(!o)return;return rot({insertionDirection:o,rotationDegrees:t,isFlipped:hde({componentLayer:e,originalLayer:n?.originalLayer})})}doInitialReactSubtreesRender(){let e=this.props.footprint;if(Eb.isValidElement(e)){if(!this.children.some((i)=>i.componentName==="Footprint"))this.add(e)}let t=this.props.symbol;if(Eb.isValidElement(t)){if(!this.children.some((i)=>i.componentName==="Symbol"))this.add(t)}let n=this.props.cadModel;if(Eb.isValidElement(n)){this._isCadModelChild=!0;let r=this.children.some((s)=>s.componentName==="CadAssembly"),i=this.children.some((s)=>s.componentName==="CadModel");if(!r&&!i)this.add(n)}let o=this.props.spiceModel;if(Eb.isValidElement(o)){if(!this.children.some((i)=>i.componentName==="SpiceModel"))this.add(o)}}doInitialPcbFootprintStringRender(){Pkr(this,(e,t)=>this._queueAsyncEffect(e,t))}_getAllPortsFromChildren(){let e=[],t=(n)=>{if(n.componentName==="Port")e.push(n);for(let o of n.children)t(o)};for(let n of this.children)t(n);return e}_hasExistingPortExactly(e){return this._getAllPortsFromChildren().some((n)=>{let o=e.getNameAndAliases(),r=n.getNameAndAliases();return o.length===r.length&&o.every((i)=>r.includes(i))})}_hasMatchingPort(e){let t=this._getAllPortsFromChildren(),n=e._parsedProps.pinNumber;if(n===void 0)return!1;return t.some((o)=>o._parsedProps.pinNumber===n)}add(e){let t;if(Eb.isValidElement(e)){let n=this._renderReactSubtree(e);this.reactSubtrees.push(n),t=n.component}else t=e;if(t.componentName==="Port"){if(this._hasExistingPortExactly(t))return;if(this._hasMatchingPort(t)){Wkr(`Skipping port ${t} because a matching port already exists`);return}}super.add(t)}getPortsFromFootprint(e){let t=void 0;if(e?.collectInferredInternallyConnectedPins)t=this._inferredInternallyConnectedPinNames;let n=this._parsedProps?.pinLabels??this.props.pinLabels,o=n&&!Array.isArray(n)&&Object.keys(n).some(lde),r=new Map,i=new Set,s=this._parsedProps?.pinLabels??this.props.pinLabels,a=s&&!Array.isArray(s)?$he(s):s;if(a){let h=Array.isArray(a)?a.map((d,u)=>[`pin${u+1}`,d]):Object.entries(a);for(let[d,u]of h){let _=nB(d);if(_===null)continue;let p=Array.isArray(u)?u:[u];for(let m of p)if(typeof m==="string"&&m.length>0){let A=r.get(m);if(o&&A!==void 0&&A!==_)i.add(m);r.set(m,_)}}}for(let h of i)r.delete(h);let c={...e,inferSharedAliases:!o,getPhysicalPinName:(h)=>this._getPhysicalPinName(h),inferredInternallyConnectedPinNames:t,implicitPinNumberByHint:r},{footprint:l}=this.props;if(typeof l==="string"&&DJ(l)&&this.children.some((h)=>h.componentName==="Footprint"))l=this.children.find((h)=>h.componentName==="Footprint");else if(!l||Eb.isValidElement(l))l=this.children.find((h)=>h.componentName==="Footprint");if(typeof l==="string"){if(Ck(l))return[];if(xk(l))return[];if(ude(l))return[];if(DJ(l))return[];let h;try{h=Kl.string(l).soup()}catch(d){return this._queueInvalidFootprintPropMessage(l,d),[]}return Stt(h.flatMap((d)=>("port_hints"in d)&&d.port_hints?[{hints:d.port_hints,originDescription:`footprint:string:${l}:port_hints[0]:${d.port_hints[0]}`}]:[]),c)}if(!Eb.isValidElement(l)&&l&&l.componentName==="Footprint")return Stt(l.children.flatMap((d)=>d.props.portHints?[{hints:d.props.portHints,originDescription:`footprint:${l}`,component:d}]:[]),c);if(!l)return Stt(this.children.filter((h)=>h.props.portHints&&h.isPcbPrimitive).map((h)=>({hints:h.props.portHints,originDescription:"direct PCB primitive",component:h})),{...c,allowImplicitPinNumbers:!1});return[]}_queueInvalidFootprintPropMessage(e,t){let n=t instanceof Error?t.message:String(t),o=e.includes("/")&&!e.includes(":"),i=/^c\d+$/i.test(e)?`C${e.replace(/^c/i,"")}`:null,s=o?` If this is a KiCad footprint, use "kicad:${e}".`:i?` If this is a JLCPCB part number, use "jlcpcb:${i}".`:"",a=`Invalid footprint prop on ${this.getDisplayName()}: "${e}".${s} Parser details: ${n}`;if(!this._invalidFootprintPropMessages.includes(a))this._invalidFootprintPropMessages.push(a)}_insertInvalidFootprintPropErrors(){for(let e of this._invalidFootprintPropMessages)this.root.db.source_invalid_component_property_error.insert({source_component_id:this.source_component_id||"",property_name:"footprint",message:e,error_type:"source_invalid_component_property_error"});this._invalidFootprintPropMessages=[]}getPortsFromSchematicSymbol(){if(this.root?.schematicDisabled)return[];let{config:e}=this;if(!e.schematicSymbolName)return[];let t=Es[e.schematicSymbolName];if(!t)return[];let n=[];for(let o of t.ports){let r=xot(o.labels);if(r)r.schematicSymbolPortDef=o,n.push(r)}return n}doInitialCreateNetsFromProps(){this._createNetsFromProps(this._getNetsFromConnectionsProp())}_getNetsFromConnectionsProp(){let{_parsedProps:e}=this,t=[];if(e.connections)for(let[n,o]of Object.entries(e.connections)){let r=Array.isArray(o)?o:[o];for(let i of r)t.push(String(i))}return t}_createNetsFromProps(e){Cue(this,e)}_getPcbCircuitJsonBounds(){let{db:e}=this.root;if(!this.pcb_component_id)return super._getPcbCircuitJsonBounds();let t=e.pcb_component.get(this.pcb_component_id);return{center:{x:t.center.x,y:t.center.y},bounds:{left:t.center.x-t.width/2,top:t.center.y-t.height/2,right:t.center.x+t.width/2,bottom:t.center.y+t.height/2},width:t.width,height:t.height}}_getPinCountFromSchematicPortArrangement(){let e=this._getSchematicPortArrangement();if(!e)return 0;if(!l4n(e))return(e.leftSize??e.leftPinCount??0)+(e.rightSize??e.rightPinCount??0)+(e.topSize??e.topPinCount??0)+(e.bottomSize??e.bottomPinCount??0);let n=Bve(e),o=0;for(let r of n){if(typeof r==="number"){o=Math.max(o,r);continue}let i=nB(r);if(i!==null){o=Math.max(o,i);continue}let s=this._parsedProps.pinLabels;if(s)o=Math.max(o,cY(r,s))}return Math.max(o,n.length)}_getPrimaryPinCount(){if(this._getSchematicPortArrangement())return this._getPinCountFromSchematicPortArrangement();let t=this.getPortsFromFootprint();if(t.length>0)return t.filter((o)=>o._isPrimaryPort).length;let{pinLabels:n}=this._parsedProps;if(n){if(Array.isArray(n))return n.length;let o=Object.keys(n).map((r)=>nB(r)).filter((r)=>r!==null&&!Number.isNaN(r));if(o.length>0)return Math.max(...o);return Object.keys(n).length}return 0}_getSchematicPortArrangement(){return this._parsedProps.schPinArrangement??this._parsedProps.schPortArrangement}_getPinLabelsFromPorts(){let e=this.selectAll("port"),t={};for(let n of e){let o=n.props.pinNumber;if(o!==void 0){let r=n._getBestDisplayPinLabel();if(r)t[`pin${o}`]=r}}return t}_getImplicitSparseSchematicPortArrangement(e){let t=Array.from(new Set(this._getAllPortsFromChildren().filter((i)=>i._isPrimaryPort).map((i)=>i._parsedProps.pinNumber).filter((i)=>i!==void 0))).sort((i,s)=>i-s);if(t.length!==e)return;if(!t.some((i,s)=>i!==s+1))return;let o=Math.floor(e/2),r=e-o;return{leftSide:{pins:t.slice(0,r)},rightSide:{pins:t.slice(r)}}}_getSchematicBoxDimensions(){if(this.schematicBoxDimensions)return this.schematicBoxDimensions;return this._computeSchematicBoxDimensions()}_computeSchematicBoxDimensions(){if(this.getSchematicSymbol())return null;if(!this.config.shouldRenderAsSchematicBox&&!this._parsedProps?.showAsSchematicBox)return null;let{_parsedProps:e}=this,t=this._getPrimaryPinCount(),n=0.2,o=this._getPinLabelsFromPorts(),r=Array.isArray(e.pinLabels)?Object.fromEntries(e.pinLabels.map((a,c)=>[`pin${c+1}`,a])):e.pinLabels?$he(e.pinLabels):void 0,i={...o,...r},s=this._getSchematicPortArrangement()??this._getImplicitSparseSchematicPortArrangement(t);if(e.pinLabels&&!Array.isArray(e.pinLabels)&&Object.keys(e.pinLabels).some(lde)&&s)for(let a of Bve(s))cY(a,e.pinLabels);return Tit({schWidth:e.schWidth,schHeight:e.schHeight,schPinSpacing:n,numericSchPinStyle:Nde(e.schPinStyle,!Array.isArray(e.pinLabels)?e.pinLabels??i:i),pinCount:t,schPortArrangement:s,pinLabels:i})}getFootprinterString(){let e=this.resolveFootprint();if(typeof e==="string")return e;return null}doInitialCadModelRender(){if(this._isCadModelChild)return;if(this.props.doNotPlace)return;let{db:e}=this.root,{boardThickness:t=0}=this._getBoard()??{},n=this._parsedProps.cadModel,o=n===void 0?this._asyncFootprintCadModel:n,r=this.getFootprinterString()??void 0,i=!1;if(r)i=!DJ(r)&&!Ck(r)&&!xk(r)&&!ude(r);if(!this.pcb_component_id)return;if(o===null)return;let s=this._getPcbCircuitJsonBounds();if(typeof o==="string")throw Error("String cadModel not yet implemented");let a=o?.pcbRotationOffset??o?.rotationOffset,c=Xkr.parse({x:0,y:0,z:typeof a==="number"?a:0,...typeof a==="object"?a:{}}),l=px.parse({x:0,y:0,z:0,...typeof o?.positionOffset==="object"?o.positionOffset:{}}),h=o&&typeof o==="object"&&"zOffsetFromSurface"in o?o.zOffsetFromSurface!==void 0?Ke.parse(o.zOffsetFromSurface):0:0,d=this.props.layer==="bottom"?"bottom":"top",u=e.pcb_component.get(this.pcb_component_id),_=this._computePcbGlobalTransformBeforeLayout(),m=Iot.decomposeTSR(_).rotation.angle*180/Math.PI,A=u?.position_mode==="packed"?u.rotation??m:m,g=d==="bottom";if(!o&&!i){let C={position:{x:s.center.x,y:s.center.y,z:d==="bottom"?-t/2:t/2},rotation:Znt({layer:d,pcbCcwRotationDegrees:A,modelCcwRotationOffsetDegrees:{x:0,y:0,z:0}})};C=tot(this,C);let b=e.cad_component.insert({...C,pcb_component_id:this.pcb_component_id,source_component_id:this.source_component_id,model_origin_alignment:"center_of_component_on_board_surface",anchor_alignment:"center_of_component_on_board_surface",show_as_bounding_box:!0,show_as_translucent_model:this._parsedProps.showAsTranslucentModel});this.cad_component_id=b.cad_component_id;return}let f;if(!o&&i)f=r;let y={position:{x:s.center.x+l.x,y:s.center.y+l.y,z:(d==="bottom"?-t/2:t/2)+(d==="bottom"?-h:h)+l.z},rotation:Znt({layer:d,pcbCcwRotationDegrees:A,modelCcwRotationOffsetDegrees:c})};y=tot(this,y);let x=e.cad_component.insert({...y,pcb_component_id:this.pcb_component_id,source_component_id:this.source_component_id,model_stl_url:"stlUrl"in(o??{})?this._addCachebustToModelUrl(o.stlUrl):void 0,model_obj_url:"objUrl"in(o??{})?this._addCachebustToModelUrl(o.objUrl):void 0,model_mtl_url:"mtlUrl"in(o??{})?this._addCachebustToModelUrl(o.mtlUrl):void 0,model_gltf_url:"gltfUrl"in(o??{})?this._addCachebustToModelUrl(o.gltfUrl):void 0,model_glb_url:"glbUrl"in(o??{})?this._addCachebustToModelUrl(o.glbUrl):void 0,model_step_url:"stepUrl"in(o??{})?this._addCachebustToModelUrl(o.stepUrl):void 0,model_wrl_url:"wrlUrl"in(o??{})?this._addCachebustToModelUrl(o.wrlUrl):void 0,model_jscad:"jscad"in(o??{})?o.jscad:void 0,model_unit_to_mm_scale_factor:typeof o?.modelUnitToMmScale==="number"?o.modelUnitToMmScale:void 0,model_board_normal_direction:o?.modelBoardNormalDirection,model_origin_alignment:"center_of_component_on_board_surface",anchor_alignment:"center_of_component_on_board_surface",model_origin_position:o?.modelOriginPosition,...o?.size?{size:o.size}:{},footprinter_string:f,show_as_translucent_model:this._parsedProps.showAsTranslucentModel});this.cad_component_id=x.cad_component_id}_addCachebustToModelUrl(e){if(!e||!e.includes("modelcdn.tscircuit.com"))return e;let t=this.root?.getClientOrigin()??"";return`${e}${e.includes("?")?"&":"?"}cachebust_origin=${encodeURIComponent(t)}`}_getPartsEngineCacheKey(e,t){return JSON.stringify({ftype:e.ftype,name:e.name,manufacturer_part_number:e.manufacturer_part_number,standard:e.standard,pin_count:e.pin_count,footprinterString:t})}async _getSupplierPartNumbers(e,t,n){if(this.props.doNotPlace)return{};let o=this.root?.platform?.localCacheEngine,r=this._getPartsEngineCacheKey(t,n);if(o){let a=await o.getItem(r);if(a)try{return JSON.parse(a)}catch{}}let i=await Promise.resolve(e.findPart({sourceComponent:t,footprinterString:n}));if(typeof i==="string"){if(i.includes("<!DOCTYPE")||i.includes("<html"))throw Error(`Failed to fetch supplier part numbers: Received HTML response instead of JSON. Response starts with: ${i.substring(0,100)}`);if(i==="Not found")throw Error(`Part not found for ${this.getString()}${n?` with footprint "${n}"`:""}`);throw Error(`Invalid supplier part numbers format: Expected object but got string: "${i}"`)}if(!i||Array.isArray(i)||typeof i!=="object"){let a=i===null?"null":Array.isArray(i)?"array":typeof i;throw Error(`Invalid supplier part numbers format: Expected object but got ${a}`)}let s=i;if(o)try{await o.setItem(r,JSON.stringify(s))}catch{}return s}doInitialPartsEngineRender(){if(this.props.doNotPlace)return;if(this.getInheritedProperty("bomDisabled"))return;if(this.getInheritedProperty("partsEngineDisabled"))return;let e=this.getInheritedProperty("partsEngine");if(!e)return;let{db:t}=this.root,n=t.source_component.get(this.source_component_id);if(!n)return;if(n.supplier_part_numbers)return;let o=this.props.footprint??this._getImpliedFootprintString(),r=typeof o==="string"?o:void 0,i=this._getSupplierPartNumbers(e,n,r);if(!(i instanceof Promise)){t.source_component.update(this.source_component_id,{supplier_part_numbers:i});return}this._queueAsyncEffect("get-supplier-part-numbers",async()=>{await i.then((s)=>{this._asyncSupplierPartNumbers=s,this._markDirty("PartsEngineRender")}).catch((s)=>{this._asyncSupplierPartNumbers={};let a=IN.parse({type:"source_part_not_found_warning",message:`Failed to fetch supplier part numbers for ${this.getString()}: ${s.message}`,source_component_id:this.source_component_id??void 0,subcircuit_id:this.getSubcircuit()?.subcircuit_id??void 0,manufacturer_part_number:n.manufacturer_part_number??void 0,part_name:n.name??void 0});t.source_part_not_found_warning.insert(a),this._markDirty("PartsEngineRender")})})}updatePartsEngineRender(){if(this.props.doNotPlace)return;if(this.getInheritedProperty("bomDisabled"))return;if(this.getInheritedProperty("partsEngineDisabled"))return;let{db:e}=this.root,t=e.source_component.get(this.source_component_id);if(!t)return;if(t.supplier_part_numbers)return;if(this._asyncSupplierPartNumbers){e.source_component.update(this.source_component_id,{supplier_part_numbers:this._asyncSupplierPartNumbers});return}}doInitialMissingManufacturerPartNumberWarning(){Nkr(this)}updateMissingManufacturerPartNumberWarning(){this.doInitialMissingManufacturerPartNumberWarning()}doInitialComponentAvailabilityWarning(){Egn(this)}updateComponentAvailabilityWarning(){Egn(this,{refresh:!0})}doInitialPartOrientationAnalysis(){fkr(this)}updatePartOrientationAnalysis(){ykr(this)}doInitialSupplierFootprintMismatchWarning(){Vkr(this)}updateSupplierFootprintMismatchWarning(){this.doInitialSupplierFootprintMismatchWarning()}doInitialAssignFallbackProps(){let{_parsedProps:e}=this;if(e.connections&&!this.name)this.fallbackUnassignedName=this.getSubcircuit().getNextAvailableName(this)}doInitialCreateTracesFromProps(){this._createTracesFromConnectionsProp()}_createTracesFromConnectionsProp(){let{_parsedProps:e}=this;if(e.connections)for(let[t,n]of Object.entries(e.connections)){let o=Array.isArray(n)?n:[n];for(let r of o)this.add(new d_({from:`.${this.name} > .${t}`,to:String(r)}))}}doInitialSourceDesignRuleChecks(){Tkr(this),U_n(this)}updateSourceDesignRuleChecks(){U_n(this)}doInitialSourceComponentPropertyValidation(){this._insertInvalidFootprintPropErrors()}doInitialValidatePcbCoordinates(){if(super.doInitialValidatePcbCoordinates(),this.root?.pcbDisabled)return;let e=this._parsedProps,t=this.props,n=typeof t.pcbLeftEdgeX==="string"?t.pcbLeftEdgeX:e.pcbLeftEdgeX??t.pcbLeftEdgeX,o=typeof t.pcbRightEdgeX==="string"?t.pcbRightEdgeX:e.pcbRightEdgeX??t.pcbRightEdgeX,r=typeof t.pcbTopEdgeY==="string"?t.pcbTopEdgeY:e.pcbTopEdgeY??t.pcbTopEdgeY,i=typeof t.pcbBottomEdgeY==="string"?t.pcbBottomEdgeY:e.pcbBottomEdgeY??t.pcbBottomEdgeY;if(!(e.pcbX!==void 0||e.pcbY!==void 0||n!==void 0||o!==void 0||r!==void 0||i!==void 0))return;if(n!==void 0)this._validatePcbCoordinateReferences({rawValue:n,axis:"pcbX",propertyName:"pcbLeftEdgeX"});if(o!==void 0)this._validatePcbCoordinateReferences({rawValue:o,axis:"pcbX",propertyName:"pcbRightEdgeX"});if(r!==void 0)this._validatePcbCoordinateReferences({rawValue:r,axis:"pcbY",propertyName:"pcbTopEdgeY"});if(i!==void 0)this._validatePcbCoordinateReferences({rawValue:i,axis:"pcbY",propertyName:"pcbBottomEdgeY"})}doInitialPcbLayout(){if(this.root?.pcbDisabled)return;if(!this.pcb_component_id)return;let{db:e}=this.root,t=this._parsedProps,n=this.props,o=t.pcbLeftEdgeX??n.pcbLeftEdgeX,r=t.pcbRightEdgeX??n.pcbRightEdgeX,i=t.pcbTopEdgeY??n.pcbTopEdgeY,s=t.pcbBottomEdgeY??n.pcbBottomEdgeY;if(!(t.pcbX!==void 0||t.pcbY!==void 0||o!==void 0||r!==void 0||i!==void 0||s!==void 0))return;if(o!==void 0&&r!==void 0)throw Error(`${this.componentName} cannot set both pcbLeftEdgeX and pcbRightEdgeX`);if(i!==void 0&&s!==void 0)throw Error(`${this.componentName} cannot set both pcbTopEdgeY and pcbBottomEdgeY`);let c=e.pcb_component.get(this.pcb_component_id),l=c?.width??0,h=c?.height??0,u=this.getGroup()?.pcb_group_id??void 0,_=u?void 0:this._getBoard()?.pcb_board_id??void 0,p=this._resolvedPcbCalcOffsetX??(t.pcbX!==void 0?this._resolvePcbCoordinate(t.pcbX,"pcbX"):o!==void 0?this._resolvePcbCoordinate(o,"pcbX",{propertyName:"pcbLeftEdgeX"})+l/2:r!==void 0?this._resolvePcbCoordinate(r,"pcbX",{propertyName:"pcbRightEdgeX"})-l/2:void 0),m=this._resolvedPcbCalcOffsetY??(t.pcbY!==void 0?this._resolvePcbCoordinate(t.pcbY,"pcbY"):i!==void 0?this._resolvePcbCoordinate(i,"pcbY",{propertyName:"pcbTopEdgeY"})-h/2:s!==void 0?this._resolvePcbCoordinate(s,"pcbY",{propertyName:"pcbBottomEdgeY"})+h/2:void 0);e.pcb_component.update(this.pcb_component_id,{position_mode:"relative_to_group_anchor",positioned_relative_to_pcb_group_id:u,positioned_relative_to_pcb_board_id:_,display_offset_x:p,display_offset_y:m})}_getMinimumFlexContainerSize(){return qQr(this)}_repositionOnPcb(e){return JQr(this,e)}doInitialSilkscreenOverlapAdjustment(){return Bkr(this)}isRelativelyPositioned(){let e=this.props;return this._parsedProps.pcbX!==void 0||this._parsedProps.pcbY!==void 0||this._parsedProps.pcbLeftEdgeX!==void 0||this._parsedProps.pcbRightEdgeX!==void 0||this._parsedProps.pcbTopEdgeY!==void 0||this._parsedProps.pcbBottomEdgeY!==void 0||e.pcbLeftEdgeX!==void 0||e.pcbRightEdgeX!==void 0||e.pcbTopEdgeY!==void 0||e.pcbBottomEdgeY!==void 0}},kit=(e,t)=>{let n=e.source_group.list(),o=[],r=(i)=>{let s=n.filter((a)=>a.parent_subcircuit_id===i);for(let a of s)if(a.subcircuit_id)o.push(a.subcircuit_id),r(a.subcircuit_id)};return r(t),o},jkr=({boardAnchorPosition:e,boardAnchorAlignment:t,width:n,height:o})=>{let{x:r,y:i}=e,s=r,a=i;switch(t){case"top_left":s=r+n/2,a=i-o/2;break;case"top_right":s=r-n/2,a=i-o/2;break;case"bottom_left":s=r+n/2,a=i+o/2;break;case"bottom_right":s=r-n/2,a=i+o/2;break;case"top":s=r,a=i-o/2;break;case"bottom":s=r,a=i+o/2;break;case"left":s=r+n/2,a=i;break;case"right":s=r-n/2,a=i;break;case"center":default:break}return{x:s,y:a}};function Kkr(e,t){let{subcircuit:n}=t;if(n.lowercaseComponentName==="board"||n.lowercaseComponentName==="mountedboard")return;if(n.parent?.lowercaseComponentName==="board")return;let o={name:"inflated_board"};if(e.width)o.width=e.width;if(e.height)o.height=e.height;if(e.center)o.pcbX=e.center.x,o.pcbY=e.center.y;if(e.outline)o.outline=e.outline;if(e.thickness)o.thickness=e.thickness;if(e.material)o.material=e.material;if(e.is_via_in_pad_allowed!==void 0)o.isViaInPadAllowed=e.is_via_in_pad_allowed;if(e.allow_blind_and_buried_vias!==void 0)o.allowBlindAndBuriedVias=e.allow_blind_and_buried_vias;let r=new P9(o);return r.pcb_board_id=e.pcb_board_id,n.add(r),r}var Ptt=new WeakMap,Dgn=(e)=>{let t=[e.name,...e.port_hints??[]].map((r)=>r.toLowerCase().replace(/[^a-z0-9+-]/g,"")),n=t.some((r)=>["a","anode","pos","positive","+"].includes(r)),o=t.some((r)=>["k","cathode","neg","negative","-"].includes(r));if(n===o)return null;return n?"positive":"negative"},$kr=(e)=>{let t=e.root;if(!t)return;let{db:n}=t;for(let A of Ptt.get(e)??[])n.pcb_fabrication_note_path.delete(A.pcb_fabrication_note_path_id);if(Ptt.delete(e),t.pcbDisabled||!e.props.polarized||!e.pcb_component_id)return;let o=n.pcb_component.get(e.pcb_component_id);if(!o||o.layer!=="top"&&o.layer!=="bottom")return;let r=n.source_port.list({source_component_id:e.source_component_id}),i=r.filter((A)=>Dgn(A)==="positive"),s=r.filter((A)=>Dgn(A)==="negative");if(i.length!==1||s.length!==1)return;let a=n.pcb_port.getWhere({source_port_id:i[0].source_port_id}),c=n.pcb_port.getWhere({source_port_id:s[0].source_port_id});if(!a||!c)return;let l=Math.hypot(c.x-a.x,c.y-a.y);if(l<0.000001)return;let h=Hk.compose(Hk.translate((a.x+c.x)/2,(a.y+c.y)/2),Hk.rotate(Math.atan2(c.y-a.y,c.x-a.x))),d=(A,g)=>Hk.applyToPoint(h,{x:A,y:g}),u=l/4,_=Math.min(l*0.12,0.3),p=[[d(-u-_,0),d(-u+_,0)],[d(-u,-_),d(-u,_)],[d(u-_,0),d(u+_,0)]],m=[];Ptt.set(e,m);for(let A of p)m.push(n.pcb_fabrication_note_path.insert({pcb_component_id:o.pcb_component_id,subcircuit_id:e.getSubcircuit()?.subcircuit_id??void 0,layer:o.layer,route:A,stroke_width:Math.min(0.08,_*0.4)}))},qkr=1;function Jkr(e){let t=[];for(let n of e.children)if(n instanceof Lh)t.push(n);return t}function Zkr(e){let t=Jkr(e);if(t.length!==2)return;let n=t[0].isConnectedToPower(),o=t[0].isConnectedToGround(),r=t[1].isConnectedToPower(),i=t[1].isConnectedToGround();return n&&!o&&i&&!r||r&&!i&&o&&!n?qkr:void 0}var eLr=new Set(["01005","0201","0402","0603","0805","1206","1210","2010","2512"]),S4n=class extends bl{_adjustSilkscreenTextAutomatically=!0;get config(){let e=this.props.symbolName??"capacitor",t=this.props.schSize==="sm"||this.props.schSize==="xs"?this.props.schSize:void 0,n=t&&e==="capacitor"?`capacitor_${t}`:void 0,o=n&&`${n}_right`in Es?n:e;return{componentName:"Capacitor",schematicSymbolName:this.props.polarized?"capacitor_polarized":o,zodProps:UTt,sourceFtype:XS.simple_capacitor}}initPorts(){if(typeof this.props.footprint==="string")super.initPorts({additionalAliases:{pin1:["anode","pos"],pin2:["cathode","neg"]}});else super.initPorts()}_getSchematicSymbolDisplayValue(){let e=this.props.capacitance,t;if(this._parsedProps.capacitance!==void 0&&!isNaN(this._parsedProps.capacitance))t=typeof e==="string"?e:`${qh(this._parsedProps.capacitance)}F`;else t=`${qh(this._parsedProps.capacitance)}F`;if(this._parsedProps.schShowRatings&&this._parsedProps.maxVoltageRating)return`${t}/${qh(this._parsedProps.maxVoltageRating)}V`;return t}getFootprinterString(){let e=super.getFootprinterString();if(e&&eLr.has(e))return`cap${e}`;return e}doInitialCreateNetsFromProps(){this._createNetsFromProps([this.props.decouplingFor,this.props.decouplingTo,...this._getNetsFromConnectionsProp()])}doInitialCreateTracesFromProps(){if(this.props.decouplingFor&&this.props.decouplingTo)this.add(new d_({from:`${this.getSubcircuitSelector()} > port.1`,to:this.props.decouplingFor})),this.add(new d_({from:`${this.getSubcircuitSelector()} > port.2`,to:this.props.decouplingTo}));this._createTracesFromConnectionsProp()}doInitialPcbComponentSizeCalculation(){super.doInitialPcbComponentSizeCalculation(),$kr(this)}doInitialSourceRender(){let{db:e}=this.root,{_parsedProps:t}=this,n=e.source_component.insert({ftype:"simple_capacitor",name:this.name,manufacturer_part_number:ii(t),supplier_part_numbers:t.supplierPartNumbers,capacitance:t.capacitance,max_voltage_rating:t.maxVoltageRating,max_decoupling_trace_length:t.maxDecouplingTraceLength??Zkr(this),display_capacitance:this._getSchematicSymbolDisplayValue(),are_pins_interchangeable:!t.polarized,display_name:t.displayName});this.source_component_id=n.source_component_id}},tLr=({pcbComponent:e,db:t,componentName:n})=>{let o=e.center||{x:0,y:0},r=e.rotation||0,i=Fk.inverse(Fk.compose(Fk.translate(o.x,o.y),Fk.rotate(r*Math.PI/180))),s=t.toArray().filter((c)=>("pcb_component_id"in c)&&c.pcb_component_id===e.pcb_component_id),a=structuredClone(s);return NN(a,i),sB({componentName:n,componentRotation:"0deg",preserveSolderPaste:!0},a)},Fb=(e,t)=>{let{injectionDb:n,normalComponent:o}=t;if(!o)return null;let r=tLr({pcbComponent:e,db:n,componentName:o.name});if(r.length===0)return null;let i=new s7e({originalLayer:e.layer});return i.addAll(r),i},zb=({pcbComponent:e,sourceGroupId:t,inflatorContext:n})=>{if(!e?.center)return{pcbX:void 0,pcbY:void 0};if(t){let o=n.injectionDb.pcb_group.getWhere({source_group_id:t});if(o?.anchor_position)return{pcbX:e.center.x-o.anchor_position.x,pcbY:e.center.y-o.anchor_position.y}}return{pcbX:e.center.x,pcbY:e.center.y}};function nLr(e,t){let{injectionDb:n,subcircuit:o,groupsMap:r}=t,i=n.pcb_component.getWhere({source_component_id:e.source_component_id}),s=n.cad_component.getWhere({source_component_id:e.source_component_id}),{pcbX:a,pcbY:c}=zb({pcbComponent:i,sourceGroupId:e.source_group_id,inflatorContext:t}),l=new S4n({name:e.name,capacitance:e.capacitance,layer:i?.layer,pcbX:a,pcbY:c,pcbRotation:i?.rotation,doNotPlace:i?.do_not_place,obstructsWithinBounds:i?.obstructs_within_bounds});if(i){let h=Fb(i,{...t,normalComponent:l});if(h)l.add(h)}if(e.source_group_id&&r?.has(e.source_group_id))r.get(e.source_group_id).add(l);else o.add(l)}var P4n=({circuitJson:e,pcbComponentId:t,sourceComponentId:n})=>{let o=e.filter((i)=>{if(i.type==="pcb_component")return i.pcb_component_id===t;if(i.type==="source_component")return i.source_component_id===n;if("pcb_component_id"in i&&i.pcb_component_id===t)return!0;if("source_component_id"in i&&i.source_component_id===n)return!0;return!1});if(o.length===0)return null;let r=KHt(o);return{x:r.x,y:r.y}},oLr=(e)=>{if(e.root?.pcbDisabled)return;if(!e.name.toUpperCase().startsWith("J"))return;if(!e.pcb_component_id||!e.source_component_id)return;let t=e.root?.platform?.placementDrcChecksDisabled??e.getInheritedProperty("placementDrcChecksDisabled"),n=e.root?.platform?.drcChecksDisabled??e.getInheritedProperty("drcChecksDisabled");if(t||n)return;let{db:o}=e.root;if(o.source_component.get(e.source_component_id)?.ftype!=="simple_chip")return;let i=o.subtree({subcircuit_id:e.getSubcircuit().subcircuit_id}).toArray(),s=P4n({circuitJson:i,pcbComponentId:e.pcb_component_id,sourceComponentId:e.source_component_id});if(!s)return;let a=i.map((h)=>h.type==="pcb_component"&&h.pcb_component_id===e.pcb_component_id?{...h,cable_insertion_center:s}:h),c=DYe(a).find((h)=>h.pcb_component_id===e.pcb_component_id);if(!c)return;if(o.toArray().some((h)=>h.type===c.type&&h.message===c.message))return;o.insertAll([c])},Eue=class extends bl{get config(){return{componentName:"Chip",zodProps:M2,shouldRenderAsSchematicBox:!0}}initPorts(e={}){super.initPorts(e);let{_parsedProps:t}=this;if(t.externallyConnectedPins){let n=new Set;for(let[o,r]of t.externallyConnectedPins)n.add(o),n.add(r);for(let o of n)if(!this.children.find((i)=>i instanceof Lh&&i.isMatchingAnyOf([o]))){let i=o.match(/^pin(\d+)$/);if(i){let s=parseInt(i[1]);this.add(new Lh({pinNumber:s,aliases:[o]}))}else this.add(new Lh({name:o,aliases:[o]}))}}}doInitialSourceRender(){let{db:e}=this.root,{_parsedProps:t}=this,n=e.source_component.insert({ftype:"simple_chip",name:this.name,manufacturer_part_number:ii(t),supplier_part_numbers:t.supplierPartNumbers,display_name:t.displayName});this.source_component_id=n.source_component_id}doInitialPcbComponentRender(){if(this.root?.pcbDisabled)return;let{db:e}=this.root,{_parsedProps:t}=this,{pcbX:n,pcbY:o}=this.getResolvedPcbPositionProp(),r=t.footprint??this._getImpliedFootprintString(),i=this.children.some((l)=>l.componentName==="Footprint");if(!r&&!i&&!this._hasStartedFootprintUrlLoad){let l=e.pcb_missing_footprint_error.insert({message:`No footprint specified for component: ${this.getString()}`,source_component_id:`${this.source_component_id}`,error_type:"pcb_missing_footprint_error"});this.pcb_missing_footprint_error_id=l.pcb_missing_footprint_error_id}let s=this._getPcbComponentLayer();if(s!=="top"&&s!=="bottom"){let l=this.getSubcircuit(),h=uX.parse({type:"pcb_component_invalid_layer_error",message:`Component cannot be placed on layer '${s}'. Components can only be placed on 'top' or 'bottom' layers.`,source_component_id:this.source_component_id,layer:s,subcircuit_id:l.subcircuit_id??void 0});e.pcb_component_invalid_layer_error.insert(h)}let a=this.getGlobalTransformRotation(),c=e.pcb_component.insert({center:{x:n,y:o},width:2,height:3,layer:s==="top"||s==="bottom"?s:"top",rotation:nu(a),insertion_direction:this._getPcbComponentInsertionDirection(s,a),source_component_id:this.source_component_id,subcircuit_id:this.getSubcircuit().subcircuit_id??void 0,do_not_place:t.doNotPlace??!1,obstructs_within_bounds:t.obstructsWithinBounds??!0,is_allowed_to_be_off_board:t.allowOffBoard??!1,metadata:t.kicadFootprintMetadata?{kicad_footprint:t.kicadFootprintMetadata}:void 0});this.pcb_component_id=c.pcb_component_id}doInitialPcbPlacementDesignRuleChecks(){oLr(this)}doInitialCreateTracesFromProps(){let{_parsedProps:e}=this;if(e.externallyConnectedPins)for(let[t,n]of e.externallyConnectedPins)this.add(new d_({from:`${this.getSubcircuitSelector()} > port.${t}`,to:`${this.getSubcircuitSelector()} > port.${n}`}));this._createTracesFromConnectionsProp()}doInitialSimulationRender(){let{db:e}=this.root,{pinAttributes:t}=this.props;if(!t)return;let n=null,o=null,r,i=this.selectAll("port");for(let h of i)for(let d of h.getNameAndAliases())if(t[d]){let u=t[d];if(u.providesPower)n=h,r=u.providesVoltage;if(u.providesGround)o=h}if(!n||!o||r===void 0)return;let s=e.source_port.get(n.source_port_id);if(!s?.subcircuit_connectivity_map_key)return;let a=e.source_port.get(o.source_port_id);if(!a?.subcircuit_connectivity_map_key)return;let c=e.source_net.getWhere({subcircuit_connectivity_map_key:s.subcircuit_connectivity_map_key}),l=e.source_net.getWhere({subcircuit_connectivity_map_key:a.subcircuit_connectivity_map_key});if(!c||!l)return;e.simulation_voltage_source.insert({type:"simulation_voltage_source",positive_source_port_id:n.source_port_id,positive_source_net_id:c.source_net_id,negative_source_port_id:o.source_port_id,negative_source_net_id:l.source_net_id,voltage:r})}},rLr=(e,t)=>{if(!e||e.length===0)return;let{injectionDb:n}=t,o=e.map((r)=>r.map((i)=>{let s=n.source_port.get(i);if(!s)return null;if(s.pin_number!==void 0&&s.pin_number!==null)return`pin${s.pin_number}`;return s.name}).filter((i)=>i!==null)).filter((r)=>r.length>0);return o.length>0?o:void 0},iLr=(e,t)=>{let{injectionDb:n,subcircuit:o,groupsMap:r}=t,i=n.pcb_component.getWhere({source_component_id:e.source_component_id}),s=n.schematic_component.getWhere({source_component_id:e.source_component_id}),a=n.cad_component.getWhere({source_component_id:e.source_component_id}),c=rLr(e.internally_connected_source_port_ids,t),l=a?.footprinter_string??null,{pcbX:h,pcbY:d}=zb({pcbComponent:i,sourceGroupId:e.source_group_id,inflatorContext:t}),u=new Eue({name:e.name,manufacturerPartNumber:e.manufacturer_part_number,supplierPartNumbers:e.supplier_part_numbers??void 0,pinLabels:s?.port_labels??void 0,schWidth:s?.size?.width,schHeight:s?.size?.height,schPinSpacing:s?.pin_spacing,schX:s?.center?.x,schY:s?.center?.y,layer:i?.layer,pcbX:h,pcbY:d,pcbRotation:i?.rotation,doNotPlace:i?.do_not_place,obstructsWithinBounds:i?.obstructs_within_bounds,internallyConnectedPins:c});if(l)Object.assign(u.props,{footprint:l}),Object.assign(u._parsedProps,{footprint:l});if(i){let _=Fb(i,{...t,normalComponent:u});if(_)u.add(_)}if(e.source_group_id&&r?.has(e.source_group_id))r.get(e.source_group_id).add(u);else o.add(u)},sLr=/^(?:pin)?(\d+)$/i,aLr=(e)=>{for(let t of e??[]){let n=t.trim().match(sLr);if(n)return Number.parseInt(n[1],10)}},Ngn=(e,t)=>e!==void 0&&e>=1&&e<=t,cLr=(e,t)=>{let n=new Map;for(let r of e)if(r.type==="source_port"&&typeof r.pin_number==="number")n.set(r.source_port_id,r.pin_number);let o=new Map;for(let r of e){if(r.type!=="pcb_port")continue;let i=n.get(r.source_port_id);if(i!==void 0)o.set(r.pcb_port_id,i)}return e.filter((r)=>!r.type.startsWith("schematic_")).map((r)=>{if(r.type==="source_port"){let c=r.pin_number;return{...r,name:typeof c==="number"?`pin${c}`:r.name,port_hints:Ngn(c,t)?[`pin${c}`]:[]}}if(!("port_hints"in r)&&!("pcb_port_id"in r))return r;let i="port_hints"in r?aLr(r.port_hints):void 0,s="pcb_port_id"in r&&typeof r.pcb_port_id==="string"?o.get(r.pcb_port_id):void 0,a=i??s;return{...r,port_hints:Ngn(a,t)?[`pin${a}`]:[]}})},E4n=[{label:"GND1",aliases:[]},{label:"VBUS1",aliases:[]},{label:"CC1",aliases:[]},{label:"DP1",aliases:[]},{label:"DM1",aliases:["DN1"]},{label:"SBU1",aliases:[]},{label:"SBU2",aliases:[]},{label:"DM2",aliases:["DN2"]},{label:"DP2",aliases:[]},{label:"CC2",aliases:[]},{label:"VBUS2",aliases:[]},{label:"GND2",aliases:[]},{label:"SHELL1",aliases:["MH1","EH1","MOUNT1"]},{label:"SHELL2",aliases:["MH2","EH2","MOUNT2"]},{label:"SHELL3",aliases:["MH3","EH3","MOUNT3"]},{label:"SHELL4",aliases:["MH4","EH4","MOUNT4"]}],lLr=/^(?:pin)?(\d+)$/i,hLr=(e)=>Array.from(new Set(e)),dLr=(e)=>{let t=[];for(let o of e){if(o.type!=="source_port")continue;let r=o.pin_number;if(typeof r!=="number")continue;let i=new Set;for(let s of o.port_hints??[])i.add(s.trim().toUpperCase());t.push({pinKey:`pin${r}`,upperCaseHints:i})}let n={};for(let{label:o,aliases:r}of E4n){let i=[o,...r].map((c)=>c.toUpperCase()),s=t.findIndex((c)=>i.some((l)=>c.upperCaseHints.has(l)));if(s===-1)continue;let{pinKey:a}=t[s];n[a]=[o],t.splice(s,1)}if(Object.keys(n).length===0)return e;return e.map((o)=>{if(!("port_hints"in o)||!Array.isArray(o.port_hints))return o;let r=o.port_hints.filter((a)=>typeof a==="string").map((a)=>a.trim()).filter((a)=>a.length>0);if(r.length===0)return o;let i=new Set;if(o.type==="source_port"&&typeof o.pin_number==="number")i.add(`pin${o.pin_number}`);for(let a of r){let c=a.match(lLr);if(!c)continue;i.add(`pin${Number.parseInt(c[1],10)}`)}let s=[];for(let a of i)s.push(...n[a]??[]);if(s.length===0)return o;return{...o,port_hints:hLr([...r,...s])}})},Rgn=0.5,uLr=0.15;function pLr(e,t){if(!e.schematic_component_id||!e.root)return;let{db:n}=e.root,o=n.schematic_component.get(e.schematic_component_id);if(!o)return;if(o.symbol_name)return;let r=o.size.width*Rgn,i=o.size.height*Rgn,s=Math.min(r/t.size.width,i/t.size.height);if(!Number.isFinite(s)||s<=0)return;let a=e.getSubcircuit()?.subcircuit_id??void 0,c=o.center,l=t.center,h=-o.size.width*uLr,d=(u)=>({x:c.x+h+(u.x-l.x)*s,y:c.y+(u.y-l.y)*s});for(let u of t.primitives)if(u.type==="path"){let _=u.points.map(d);if(u.closed&&_.length>1){let p=_[0],m=_[_.length-1];if(p.x!==m.x||p.y!==m.y)_.push(p)}n.schematic_path.insert({schematic_component_id:e.schematic_component_id,points:_,is_filled:u.fill??!1,is_dashed:!1,fill_color:u.fill?iB:void 0,stroke_width:0.02,subcircuit_id:a,schematic_sheet_id:e._resolveSchematicSheetId()})}else if(u.type==="circle")n.schematic_circle.insert({schematic_component_id:e.schematic_component_id,center:d({x:u.x,y:u.y}),radius:u.radius*s,stroke_width:0.02,color:iB,is_filled:u.fill,fill_color:u.fill?iB:void 0,is_dashed:!1,subcircuit_id:a,schematic_sheet_id:e._resolveSchematicSheetId()});else if(u.type==="box"){let _=d({x:u.x,y:u.y}),p=d({x:u.x+u.width,y:u.y+u.height});n.schematic_rect.insert({schematic_component_id:e.schematic_component_id,center:{x:(_.x+p.x)/2,y:(_.y+p.y)/2},width:Math.abs(p.x-_.x),height:Math.abs(p.y-_.y),stroke_width:0.02,color:iB,is_filled:!1,is_dashed:!1,rotation:0,subcircuit_id:a,schematic_sheet_id:e._resolveSchematicSheetId()})}}var M4n=["VBUS1","VBUS2","CC1","CC2","DP1","DP2","DM1","DM2","SBU1","SBU2","GND1","GND2"],w4n=["SHELL1","SHELL2","SHELL3","SHELL4"],mLr=[...M4n,...w4n],_Lr=new Set([...mLr]),gLr=new Set(["jst_sh","jst_gh","jst_zh","jst_ph","jst_xh","jst_vh"]),Ett=(e)=>e!==void 0&&gLr.has(e),ALr=[["CC1",{marginTop:0.15}],["DP1",{marginTop:0.15}],["SBU1",{marginTop:0.15}],["GND1",{marginTop:0.15}],["SHELL4",{marginRight:0.15}]],B4n=class extends Eue{_getConnectorProps(){return this._parsedProps}initPorts(){let e=this._getConnectorProps();super.initPorts({pinCount:Ett(e.standard)?e.pinCount:void 0})}_hasExplicitFootprint(){return this._getConnectorProps().footprint!==void 0||this.children.some((t)=>t.componentName==="Footprint")}_shouldUseStandardPartsEngineCircuitJsonFlow(){if(!this._getConnectorProps().standard)return!1;if(this._hasExplicitFootprint())return!1;if(this.getInheritedProperty("partsEngineDisabled"))return!1;return!0}_addUsbCCanonicalFallbackPorts(){if(this.selectAll("port").length>0)return;this.addAll(E4n.map(({label:e,aliases:t},n)=>new Lh({pinNumber:n+1,name:e,aliases:[...t]}))),this._markDirty("InitializePortsFromChildren")}_handleStandardConnectorCircuitJsonFailure(e,t){let{db:n}=this.root,o=IN.parse({type:"source_part_not_found_warning",message:`Failed to fetch circuit JSON for ${this.getString()} (standard="${e}"): ${t}`,source_component_id:this.source_component_id??void 0,subcircuit_id:this.getSubcircuit()?.subcircuit_id??void 0,manufacturer_part_number:ii(this._getConnectorProps()),part_name:this.name});if(n.source_part_not_found_warning.insert(o),e==="usb_c")this._addUsbCCanonicalFallbackPorts()}_getSupplierPartNumbersToTry(e){let t=[];for(let n of Object.keys(e??{})){let o=e?.[n];if(Array.isArray(o)&&o.length>0)t.push(o[0])}return t}async _tryFetchPartCircuitJson(e,t){let n=await git({fetchPartCircuitJson:e,...t},this)??null;if(Array.isArray(n)&&n.length>0)return n;return null}async _fetchStandardConnectorCircuitJson(e,t,n){for(let o of this._getSupplierPartNumbersToTry(t)){let r=await this._tryFetchPartCircuitJson(e,{supplierPartNumber:o,manufacturerPartNumber:n});if(r)return r}if(!n)return null;return this._tryFetchPartCircuitJson(e,{manufacturerPartNumber:n})}_addConnectorFootprintFromCircuitJson(e,t){let n=this._getConnectorProps(),o=e==="usb_c"?dLr(t):Ett(e)?cLr(t,n.pinCount??0):t,r=sB({sourcePortOwner:this,componentName:this.name,componentRotation:String(n.pcbRotation??0),footprinterString:`standard:${e}`,pinLabels:n.pinLabels,pcbPinLabels:n.pcbPinLabels},o),i=x4n(o);if(i)this._asyncFootprintCadModel=i;this.addAll(r),this._markDirty("InitializePortsFromChildren")}_getUsbCCanonicalLabelToPinNumberMap(){let e=new Map,t=this.selectAll("port");for(let n of t){let o=n.props.pinNumber;if(typeof o!=="number")continue;for(let r of n.getNameAndAliases()){let i=r.trim().toUpperCase();if(!_Lr.has(i))continue;let s=i;if(!e.has(s))e.set(s,o)}}return e}_getSchematicPortArrangement(){let e=super._getSchematicPortArrangement();if(e&&Object.keys(e).length>0)return e;let t=this._getConnectorProps();if(Ett(t.standard))return{leftSize:0,rightSize:t.pinCount??0};if(t.standard!=="usb_c")return e;let n=this._getUsbCCanonicalLabelToPinNumberMap(),o=M4n.map((s)=>n.get(s)).filter((s)=>typeof s==="number"),r=w4n.map((s)=>n.get(s)).filter((s)=>typeof s==="number");if(o.length===0&&r.length===0)return e;let i={};if(o.length>0)i.rightSide={pins:o,direction:"top-to-bottom"};if(r.length>0)i.bottomSide={pins:r,direction:"left-to-right"};return i}_computeSchematicBoxDimensions(){if(this._getConnectorProps().standard!=="usb_c")return super._computeSchematicBoxDimensions();if(this.getSchematicSymbol())return null;if(!this.config.shouldRenderAsSchematicBox)return null;let{_parsedProps:e}=this,t=this._getPrimaryPinCount(),n=0.2,r={...this._getPinLabelsFromPorts()};if(e.pinLabels){for(let[l,h]of Object.entries(e.pinLabels))if(typeof h==="string")r[l]=h}let i=this._getUsbCCanonicalLabelToPinNumberMap(),s={};for(let[l,h]of ALr){let d=i.get(l);if(typeof d!=="number")continue;s[`pin${d}`]=h}let a={...s,...e.schPinStyle??{}},c=this._getSchematicPortArrangement();return Tit({schWidth:e.schWidth,schHeight:e.schHeight,schPinSpacing:n,numericSchPinStyle:Nde(a,r),pinCount:t,schPortArrangement:c??void 0,pinLabels:r})}get config(){return{componentName:"Connector",zodProps:kTt,shouldRenderAsSchematicBox:!0}}doInitialSourceRender(){let{db:e}=this.root,t=this._getConnectorProps(),n=ii(t),o=e.source_component.insert({ftype:"simple_connector",name:this.name,manufacturer_part_number:n,supplier_part_numbers:t.supplierPartNumbers,display_name:t.displayName,standard:t.standard,pin_count:t.pinCount});this.source_component_id=o.source_component_id}_isUsingStandardPartsEngineCircuitJsonFlow(){if(!this._shouldUseStandardPartsEngineCircuitJsonFlow())return!1;let e=this.getInheritedProperty("partsEngine");return Boolean(e?.fetchPartCircuitJson)}doInitialFetchPartFootprint(){let e=this._getConnectorProps(),t=e.standard;if(!t)return;if(!this._shouldUseStandardPartsEngineCircuitJsonFlow())return;if(this._hasStartedFootprintUrlLoad)return;let n=this.getInheritedProperty("partsEngine");if(n&&!n.fetchPartCircuitJson){this._handleStandardConnectorCircuitJsonFailure(t,"partsEngine.fetchPartCircuitJson is not configured");return}let o=n?.fetchPartCircuitJson;if(!o)return;this._hasStartedFootprintUrlLoad=!0;let r={type:"source_component",ftype:"simple_connector",name:this.name,manufacturer_part_number:ii(e),standard:t,pin_count:e.pinCount};this._queueAsyncEffect("load-standard-connector-circuit-json",async()=>{let{db:i}=this.root;try{let s=await this._getSupplierPartNumbers(n,r,`standard:${t}`);if(this.source_component_id)i.source_component.update(this.source_component_id,{supplier_part_numbers:s});let a=await this._fetchStandardConnectorCircuitJson(o,s,r.manufacturer_part_number);if(!a){this._handleStandardConnectorCircuitJsonFailure(t,"part circuit JSON was not found");return}this._addConnectorFootprintFromCircuitJson(t,a)}catch(s){if(this.source_component_id)i.source_component.update(this.source_component_id,{supplier_part_numbers:{}});this._handleStandardConnectorCircuitJsonFailure(t,s.message)}})}doInitialPartsEngineRender(){if(this._isUsingStandardPartsEngineCircuitJsonFlow())return;super.doInitialPartsEngineRender()}updatePartsEngineRender(){if(this._isUsingStandardPartsEngineCircuitJsonFlow())return;super.updatePartsEngineRender()}doInitialSchematicComponentRender(){if(super.doInitialSchematicComponentRender(),!this.root?.schematicDisabled&&this.schematic_component_id&&this._getConnectorProps().standard==="usb_c"){let e=Es.usbc;if(e)pLr(this,e)}}doInitialPcbComponentSizeCalculation(){if(super.doInitialPcbComponentSizeCalculation(),this.root?.pcbDisabled)return;if(!this.pcb_component_id||!this.source_component_id)return;let{db:e}=this.root,t=P4n({circuitJson:e.toArray(),pcbComponentId:this.pcb_component_id,sourceComponentId:this.source_component_id});if(!t)return;e.pcb_component.update(this.pcb_component_id,{cable_insertion_center:{x:t.x,y:t.y}})}},fLr=(e)=>{let t=e?.port_arrangement;if(!t)return;if("left_size"in t)return{leftPinCount:t.left_size,rightPinCount:t.right_size,topPinCount:t.top_size,bottomPinCount:t.bottom_size};let n={};if(t.left_side)n.leftSide={pins:t.left_side.pins,direction:t.left_side.direction??"top-to-bottom"};if(t.right_side)n.rightSide={pins:t.right_side.pins,direction:t.right_side.direction??"top-to-bottom"};if(t.top_side)n.topSide={pins:t.top_side.pins,direction:t.top_side.direction??"left-to-right"};if(t.bottom_side)n.bottomSide={pins:t.bottom_side.pins,direction:t.bottom_side.direction??"left-to-right"};return n},yLr=(e,t)=>{let n=t.injectionDb.source_port.list().filter((r)=>r.source_component_id===e.source_component_id),o={};for(let r of n){let i=r.pin_number;if(i===void 0||i===null)continue;let s=Array.from(new Set([r.name,...r.port_hints??[]].filter((a)=>typeof a==="string"&&a.length>0)));if(s.length>0)o[`pin${i}`]=s}if(Object.keys(o).length===0)return;return o};function xLr(e,t){let{injectionDb:n,subcircuit:o,groupsMap:r}=t,i=n.pcb_component.getWhere({source_component_id:e.source_component_id}),s=n.schematic_component.getWhere({source_component_id:e.source_component_id}),a=n.cad_component.getWhere({source_component_id:e.source_component_id}),{pcbX:c,pcbY:l}=zb({pcbComponent:i,sourceGroupId:e.source_group_id,inflatorContext:t}),h={name:e.name,standard:e.standard,manufacturerPartNumber:e.manufacturer_part_number,supplierPartNumbers:e.supplier_part_numbers??void 0,pinLabels:yLr(e,t)??s?.port_labels??void 0,schPortArrangement:fLr(s),schWidth:s?.size?.width,schHeight:s?.size?.height,schPinSpacing:s?.pin_spacing,schX:s?.center?.x,schY:s?.center?.y,layer:i?.layer,pcbX:c,pcbY:l,pcbRotation:i?.rotation,doNotPlace:i?.do_not_place,obstructsWithinBounds:i?.obstructs_within_bounds},d=new B4n(h);if(a?.footprinter_string)Object.assign(d.props,{footprint:a.footprinter_string}),Object.assign(d._parsedProps,{footprint:a.footprinter_string});if(i){let u=Fb(i,{...t,normalComponent:d});if(u)d.add(u)}if(e.source_group_id&&r?.has(e.source_group_id))r.get(e.source_group_id).add(d);else o.add(d)}var T4n=(e)=>typeof e==="string"&&!DJ(e)&&!Ck(e)&&!xk(e)&&!ude(e),D4n=class extends bl{get config(){let e={schottky:"schottky_diode",avalanche:"avalanche_diode",zener:"zener_diode",photodiode:"photodiode"},t=this.props.schottky?"schottky":this.props.avalanche?"avalanche":this.props.zener?"zener":this.props.photo?"photo":this.props.standard?"standard":this.props.variant,n=t==="photo"?"photodiode":t,o=n&&e[n]||this.props.symbolName||"diode",r=this.props.schSize==="sm"||this.props.schSize==="xs"?this.props.schSize:void 0,i=r&&(o==="diode"||o==="avalanche_diode"||o==="zener_diode")?`${o}_${r}`:void 0;return{schematicSymbolName:i&&`${i}_right`in Es?i:o,componentName:"Diode",zodProps:NDt,sourceFtype:"simple_diode"}}initPorts(){let e=this.children.some((r)=>r.componentName==="Footprint"),t=this.resolveFootprint(),n=Boolean(this._resolvePinLabels()),o=!n&&!e&&(!t||T4n(t));super.initPorts({pinCount:2,ignoreSymbolPorts:!n&&!o,additionalAliases:{pin1:o?["anode","pos","left"]:[],pin2:o?["cathode","neg","right"]:[]}})}doInitialSourceRender(){let{db:e}=this.root,{_parsedProps:t}=this,n=e.source_component.insert({ftype:"simple_diode",name:this.name,manufacturer_part_number:ii(t),supplier_part_numbers:t.supplierPartNumbers,are_pins_interchangeable:!1,display_name:t.displayName});this.source_component_id=n.source_component_id}getRefDesPrefixes(){return["D"]}get pos(){return this.portMap.pos}get anode(){return this.portMap.anode}get neg(){return this.portMap.neg}get cathode(){return this.portMap.cathode}},CLr=(e)=>Array.from(new Set([e?.name,...e?.port_hints??[]].filter((t)=>typeof t==="string"&&t.length>0))),bLr=(e,t)=>{let n=t.injectionDb.source_port.list().filter((r)=>r.source_component_id===e.source_component_id),o={};for(let r of n){if(r.pin_number===void 0||r.pin_number===null)continue;let i=CLr(r);if(i.length===0)continue;o[`pin${r.pin_number}`]=i}return Object.keys(o).length>0?o:void 0};function ILr(e,t){let{injectionDb:n,subcircuit:o,groupsMap:r}=t,i=n.pcb_component.getWhere({source_component_id:e.source_component_id}),{pcbX:s,pcbY:a}=zb({pcbComponent:i,sourceGroupId:e.source_group_id,inflatorContext:t}),c=bLr(e,t),l={name:e.name,manufacturerPartNumber:e.manufacturer_part_number,supplierPartNumbers:e.supplier_part_numbers??void 0,pinLabels:c,layer:i?.layer,pcbX:s,pcbY:a,pcbRotation:i?.rotation,doNotPlace:i?.do_not_place,obstructsWithinBounds:i?.obstructs_within_bounds},h=new D4n(l);if(i){let d=Fb(i,{...t,normalComponent:h});if(d)h.add(d)}if(e.source_group_id&&r?.has(e.source_group_id))r.get(e.source_group_id).add(h);else o.add(h)}var vLr=class extends bl{get config(){return{componentName:"Fiducial",zodProps:m5e,sourceFtype:"simple_fiducial"}}doInitialSchematicComponentRender(){}};function SLr(e,t){let{injectionDb:n,subcircuit:o,groupsMap:r}=t,i=n.pcb_component.getWhere({source_component_id:e.source_component_id}),{pcbX:s,pcbY:a}=zb({pcbComponent:i,sourceGroupId:e.source_group_id,inflatorContext:t}),c=n.pcb_smtpad.list({pcb_component_id:i?.pcb_component_id}).find((d)=>d.shape==="circle"),l=c&&"radius"in c?c.radius*2:"1mm",h=new vLr({name:e.name,padDiameter:l,layer:i?.layer,pcbX:s,pcbY:a,pcbRotation:i?.rotation,doNotPlace:i?.do_not_place,obstructsWithinBounds:i?.obstructs_within_bounds});if(i){let d=Fb(i,{...t,normalComponent:h});if(d)h.add(d)}if(e.source_group_id&&r?.has(e.source_group_id))r.get(e.source_group_id).add(h);else o.add(h)}function N4n(e,t){let n=t._getGlobalPcbPositionBeforeLayout(),o=t._getGlobalPcbPositionAfterLayout();return l7e.compose(l7e.translate(o.x-n.x,o.y-n.y),e._computePcbGlobalTransformBeforeLayout())}var Qgn=({point:e,endpoint:t},n)=>Math.hypot(e.x-t.x,e.y-t.y)<0.0001&&(e.pcb_port_id?n.pcb_port.get(e.pcb_port_id).layers.some((o)=>o===t.layer):e.layer===t.layer);function PLr(e,t,n){return Q4n({group:e.getGroup(),subcircuit:e.getSubcircuit(),paths:e._parsedProps.pcbTracePaths??[],phaseIndex:e._parsedProps.phaseIndex,input:t,isFanout:n})}function Q4n({group:e,subcircuit:t,paths:n,phaseIndex:o,input:r,isFanout:i}){let s=HY(r.layerCount),a=new Map(r.connections.map((_)=>[_,[..._.pointsToConnect]])),c=new Set,l=new Set,h=[];for(let[_,p]of n.entries()){let m=t.selectOne(p.connection,{type:"port"});if(!m)throw Error(`Saved phase path "${p.connection}" must select a PCB port`);if(l.has(m))throw Error(`Duplicate saved phase path for "${p.connection}"`);l.add(m);let A=r.connections.filter((N)=>N.pointsToConnect.some((D)=>D.pcb_port_id===m.pcb_port_id));if(A.length!==1)throw Error(`Saved phase path "${p.connection}" must select exactly one connection in this phase`);let g=A[0],f=a.get(g),y=f.findIndex((N)=>N.pcb_port_id===m.pcb_port_id);if(y<0)throw Error(`Saved phase path "${p.connection}" starts at an endpoint already joined by another path`);let x=N4n(e,m),C=A5n(p.route).map((N)=>({...N,...R4n.applyToPoint(x,N)}));for(let N of C)if((N.route_type==="wire"?[N.layer]:[N.from_layer,N.to_layer]).some((L)=>!s.includes(L)))throw Error(`Saved phase path "${p.connection}" uses a layer unavailable on this board`);let b=C[0],I=C.at(-1),v=b.route_type==="wire"?b.layer:b.from_layer,P=I.route_type==="wire"?I.layer:I.to_layer;if(!Qgn({point:f[y],endpoint:{...b,layer:v}},m.root.db))throw Error(`Saved phase path "${p.connection}" must start at its PCB port on an available layer`);let M=f.findIndex((N,D)=>D!==y&&Qgn({point:N,endpoint:{...I,layer:P}},m.root.db));if(!r.allowViaInPad&&(b.route_type==="via"||I.route_type==="via"&&M>=0))throw Error(`Saved phase path "${p.connection}" has a via at a pad; enable allowViaInPad`);let B=`saved_phase_${e.pcb_group_id}_${o??"default"}_${_}`;if(M<0&&!i)throw Error(`Saved phase path "${p.connection}" must end at another connection endpoint; use autorouter="fanout" for saved escapes`);if(M>=0)f.splice(y,1);else f[y]={x:I.x,y:I.y,layer:P,pointId:`${B}_exit`};let T=C.flatMap((N,D)=>{if(N.route_type!=="via")return[N];let{fromWidth:L,toWidth:H}=Tde(C,D,r.minTraceWidth);return[{route_type:"wire",x:N.x,y:N.y,layer:N.from_layer,width:L},N,{route_type:"wire",x:N.x,y:N.y,layer:N.to_layer,width:H}]});if(I.route_type==="via"){let{toWidth:N}=Tde(C,C.length-1,r.minTraceWidth);T.push({route_type:"wire",x:I.x,y:I.y,layer:I.to_layer,width:N})}c.add(g),h.push({type:"pcb_trace",pcb_trace_id:B,connection_name:g.name,connectsTo:[g.source_trace_id,...g.pointsToConnect.map((N)=>N.pointId)].filter((N)=>Boolean(N)),route:T})}for(let _ of r.connections){if(!c.has(_))throw Error(`pcbTracePaths must cover every connection in the phase; missing: ${_.name}`);if(!i&&a.get(_).length>1)throw Error(`Saved phase paths for "${_.name}" must connect every endpoint; use autorouter="fanout" for saved escapes`)}let d=r.connections.flatMap((_)=>{let p=a.get(_);return p.length>1?[{..._,pointsToConnect:p}]:[]}),u=new Set(d.map((_)=>_.name));return{traces:h,outputSimpleRouteJson:i?{...r,connections:d,buses:r.buses?.map((_)=>({..._,connectionNames:_.connectionNames.filter((p)=>u.has(p))})).filter((_)=>_.connectionNames.length>0),differentialPairs:r.differentialPairs?.filter((_)=>_.connectionNames.every((p)=>u.has(p))),traces:[...r.traces??[],...h]}:void 0}}var kgn=(e,t,n=!1)=>Math.hypot(e.x-t.x,e.y-t.y)<0.0001&&(e.route_type==="wire"?e.layer:n?e.to_layer:e.from_layer)===t.layer;function ELr({group:e,subcircuit:t,input:n,traces:o,isFanout:r}){try{let i=new Map(t.selectAll("port").filter((_)=>_.pcb_port_id).map((_)=>[_.pcb_port_id,_])),s=n.connections.flatMap((_)=>_.pointsToConnect),a=o.map((_)=>{if(_.route.length<2||_.route.some((p)=>p.route_type!=="wire"&&p.route_type!=="via"))throw Error("Only port-anchored wire/via routes can be saved");return _.route}),c=a.map((_)=>[s.filter((p)=>kgn(_[0],p)),s.filter((p)=>kgn(_.at(-1),p,!0))]),l=new Map;for(let _ of c)for(let p of new Set(_.flat()))l.set(p,(l.get(p)??0)+1);let h=[],d=new Set,u=new Set(a.keys());while(u.size){let _=!1;for(let p of u)for(let m of[!1,!0]){let A=c[p][m?1:0].filter((b)=>b.pcb_port_id);if(A.length!==1)continue;let g=A[0];if(!g.pcb_port_id||l.get(g)!==1)continue;let f=i.get(g.pcb_port_id);if(!f||d.has(f))continue;let y=g.port_selector??f.getPortSelector();if(t.selectOne(y,{type:"port"})!==f)throw Error(`PCB port selector is not unique: ${y}`);let x=m?a[p].toReversed().map((b)=>b.route_type==="via"?{...b,from_layer:b.to_layer,to_layer:b.from_layer}:b):a[p],C=c7e.inverse(N4n(e,f));h.push(Qse.parse({connection:y,route:x.map((b)=>({...b,...c7e.applyToPoint(C,b)}))})),d.add(f),u.delete(p);for(let b of new Set(c[p].flat()))l.set(b,l.get(b)-1);_=!0;break}if(!_)throw Error("Routes contain a junction or endpoint that cannot select a unique PCB port")}return Q4n({group:e,subcircuit:t,paths:h,input:n,isFanout:r}),{pcbTracePaths:h}}catch(i){return{pcbTracePathsUnavailableReason:i instanceof Error?i.message:String(i)}}}function MLr(e,t){if(t.size===0)return e;let n=(e.traces??[]).filter((r)=>t.has(r.pcb_trace_id));if(n.length===0)return e;let o=[];for(let r of n){let i=[r.connection_name??r.pcb_trace_id,...r.connectsTo??[]];for(let[s,a]of r.route.entries()){if(a.route_type==="via"){let u=HY(e.layerCount),_=u.findIndex((A)=>A===a.from_layer),p=u.findIndex((A)=>A===a.to_layer),m=a.via_diameter??e.minViaPadDiameter??e.minViaDiameter??0.6;o.push({type:"rect",center:{x:a.x,y:a.y},width:m,height:m,layers:u.slice(Math.min(_,p),Math.max(_,p)+1),connectedTo:i})}let c=r.route[s+1];if(!c||a.route_type!=="wire"&&a.route_type!=="via"||c.route_type!=="wire"&&c.route_type!=="via")continue;let l=a.route_type==="wire"?a.width:c.route_type==="wire"?c.width:e.minTraceWidth,h=a.route_type==="wire"?a.layer:a.to_layer,d=a.x===c.x||a.y===c.y?1:Math.max(1,Math.ceil(Math.hypot(c.x-a.x,c.y-a.y)/l));for(let u=0;u<d;u++){let _=a.x+(c.x-a.x)*u/d,p=a.y+(c.y-a.y)*u/d,m=a.x+(c.x-a.x)*(u+1)/d,A=a.y+(c.y-a.y)*(u+1)/d;o.push({type:"rect",center:{x:(_+m)/2,y:(p+A)/2},width:Math.abs(m-_)+l,height:Math.abs(A-p)+l,layers:[h],connectedTo:i})}}}return{...e,traces:e.traces?.filter((r)=>!t.has(r.pcb_trace_id)),obstacles:[...e.obstacles,...o]}}function wLr(e){let t=[...e.schematic_net_label.list(),...e.schematic_text.list().filter((a)=>a.source_trace_id)];if(t.length===0)return;let n=oa(e.toArray().filter((a)=>a.type.startsWith("source_")));n.addConnections([...e.source_net.list().map((a)=>[a.source_net_id]),...e.source_component_internal_connection.list().map((a)=>a.source_port_ids)]);let o=t.map((a)=>{let c=a.type==="schematic_net_label",l=a.source_trace_id??(c&&a.schematic_trace_id?e.schematic_trace.get(a.schematic_trace_id)?.source_trace_id:void 0),h=(c?n.getNetConnectedToId(a.source_net_id):void 0)??(l?n.getNetConnectedToId(l):void 0);return{label:a,network:h}}),r=new Map,i=(a,c)=>{if(!a.trim()||c===void 0)return;let l=r.get(a)??[];if(!l.includes(c))l.push(c);r.set(a,l)};for(let{label:a,network:c}of o)i(a.text,c);let s=(a)=>[...n.getIdsConnectedToNet(a)].sort()[0];for(let a of r.values())a.sort((c,l)=>s(c).localeCompare(s(l),"en",{numeric:!0}));for(let{label:a,network:c}of o){let l=r.get(a.text)??[],h=c!==void 0&&l.length>1?String(l.indexOf(c)+1):void 0;if(a.display_superscript===h)continue;if(a.type==="schematic_net_label")e.schematic_net_label.update(a.schematic_net_label_id,{display_superscript:h});else e.schematic_text.update(a.schematic_text_id,{display_superscript:h})}}var s8e=(e)=>typeof e==="object"&&e!==null&&("isAssemblyDeviceContainer"in e)&&e.isAssemblyDeviceContainer===!0;function zY(e){let t=`${e.connectionName}:source-${e.sourcePointIndex}`;return{boundaryExitPointId:`fanout-exit:${t}`,planeExitPointId:`fanout-plane:${t}`,traceId:`fanout:${t}`,viaObstacleId:`fanout-via:${t}`,planeEndpointPointId:`fanout-plane-endpoint-point:${t}`,planeEndpointTraceId:`fanout-plane-endpoint:${t}`,planeEndpointViaObstacleId:`fanout-plane-endpoint-via:${t}`}}function BLr(e){return`fanout-completion:${e.connectionName}:source-${e.sourcePointIndex}:${e.candidateIndex}`}var aB=0.000000001;function h7e(e){return e.shape==="circle"}function Rde(e,t){let n=-(t.ccwRotationDegrees??0)*Math.PI/180,o=e.x-t.center.x,r=e.y-t.center.y;return{x:o*Math.cos(n)-r*Math.sin(n),y:o*Math.sin(n)+r*Math.cos(n)}}function Gt(e,t){return Math.hypot(e.x-t.x,e.y-t.y)}function Hr(e,t,n){let o=n.x-t.x,r=n.y-t.y,i=o*o+r*r,s=i<aB?0:((e.x-t.x)*o+(e.y-t.y)*r)/i,a=Math.max(0,Math.min(1,s));return Math.hypot(e.x-(t.x+a*o),e.y-(t.y+a*r))}function x9e(e,t,n){return(t.x-e.x)*(n.y-e.y)-(t.y-e.y)*(n.x-e.x)}function TLr(e,t,n,o){let r=x9e(n,o,e),i=x9e(n,o,t),s=x9e(e,t,n),a=x9e(e,t,o);return(r>0&&i<0||r<0&&i>0)&&(s>0&&a<0||s<0&&a>0)}function Hh(e,t,n,o){if(TLr(e,t,n,o))return 0;return Math.min(Hr(e,n,o),Hr(t,n,o),Hr(n,e,t),Hr(o,e,t))}function CZ(e,t,n=aB){if(h7e(t))return Gt(e,t.center)<=t.width/2+n;let o=Rde(e,t);return Math.abs(o.x)<=t.width/2+n&&Math.abs(o.y)<=t.height/2+n}function d7e(e){let{center:t,diameter:n,obstacle:o,tolerance:r=aB}=e,i=n/2;if(h7e(o))return Gt(t,o.center)+i<=o.width/2+r;let s=Rde(t,o);return Math.abs(s.x)+i<=o.width/2+r&&Math.abs(s.y)+i<=o.height/2+r}function r5(e,t){if(h7e(t))return Math.max(0,Gt(e,t.center)-t.width/2);let n=Rde(e,t),o=Math.max(Math.abs(n.x)-t.width/2,0),r=Math.max(Math.abs(n.y)-t.height/2,0);return Math.hypot(o,r)}function Cl(e,t){if(h7e(t))return Math.max(0,Hr(t.center,e.start,e.end)-t.width/2);let n=Rde(e.start,t),o=Rde(e.end,t);if(Math.abs(n.x)<=t.width/2+aB&&Math.abs(n.y)<=t.height/2+aB)return 0;if(Math.abs(o.x)<=t.width/2+aB&&Math.abs(o.y)<=t.height/2+aB)return 0;let r=-t.width/2,i=t.width/2,s=-t.height/2,a=t.height/2,c=[{x:r,y:s},{x:i,y:s},{x:i,y:a},{x:r,y:a}],l=Number.POSITIVE_INFINITY;for(let h=0;h<c.length;h++)l=Math.min(l,Hh(n,o,c[h],c[(h+1)%c.length]));return l}function u_(e,t,n){if(e.layer!==t.layer)return!0;let o=(e.width+t.width)/2+n,r=o+aB;if(Math.min(e.start.x,e.end.x)-Math.max(t.start.x,t.end.x)>r||Math.min(t.start.x,t.end.x)-Math.max(e.start.x,e.end.x)>r||Math.min(e.start.y,e.end.y)-Math.max(t.start.y,t.end.y)>r||Math.min(t.start.y,t.end.y)-Math.max(e.start.y,e.end.y)>r)return!0;return Hh(e.start,e.end,t.start,t.end)>=o-aB}var Lgn=new WeakMap;function k4n(e){return e.netConnectionName??e.rootConnectionName??e.name}function OV(e,t,n){if(!t)return!1;let o=e.get(t)??new Set,r=o.size;return o.add(n),e.set(t,o),o.size!==r}function Mtt(e,t){let n=new Set;for(let o of t)for(let r of e.get(o)??[])n.add(r);return n}function DLr(e){let t=new Map,n=new Map;for(let a of e.connections){let c=k4n(a);t.set(a.name,c),OV(n,a.name,c),OV(n,a.rootConnectionName,c),OV(n,a.netConnectionName,c);for(let l of a.pointsToConnect)OV(n,l.pointId,c),OV(n,l.pcb_port_id,c)}for(let a of e.traces??[]){let c=[a.connection_name,a.pcb_trace_id,...a.connectsTo??[]],l=Mtt(n,c);if(l.size!==1)continue;let h=[...l][0];t.set(a.connection_name,h);for(let d of c)OV(n,d,h)}for(let a=0;a<2;a++){let c=!1;for(let l of e.obstacles){let h=Mtt(n,l.connectedTo);if(h.size!==1)continue;let d=[...h][0];for(let u of l.connectedTo)c=OV(n,u,d)||c}if(!c)break}let o=new Map,r=(a)=>{let c=o.get(a)??a;if(o.set(a,c),c===a)return a;let l=r(c);return o.set(a,l),l},i=(a,c)=>{let l=r(a),h=r(c);if(l!==h)o.set(h,l)};for(let a of n.values()){let[c,...l]=[...a];if(!c)continue;for(let h of l)i(c,h)}for(let a of[...e.obstacles.map((c)=>c.connectedTo),...(e.traces??[]).map((c)=>c.connectsTo??[])]){let[c,...l]=[...Mtt(n,a)];if(!c)continue;for(let h of l)i(c,h)}for(let[a,c]of t)t.set(a,r(c));let s=new Map;for(let[a,c]of n){let l=c.values().next().value;if(l!==void 0)s.set(a,r(l))}return{connectionNetKeys:t,tokenNetKeys:s}}function L4n(e){let t=Lgn.get(e);if(t)return t;let n=DLr(e);return Lgn.set(e,n),n}function e5(e,t,n){let o=L4n(e),r=o.connectionNetKeys.get(t),i=o.connectionNetKeys.get(n);return r!==void 0&&r===i}function kb(e,t,n){let o=L4n(e),r=o.connectionNetKeys.get(n);if(!r)return!1;for(let i of t.connectedTo)if(o.tokenNetKeys.get(i)===r)return!0;return!1}function uB(e){if(!Number.isInteger(e)||e<1)throw Error(`FanoutSolver: layerCount must be a positive integer, received ${e}`);if(e===1)return["top"];if(e===2)return["top","bottom"];return["top",...Array.from({length:e-2},(t,n)=>`inner${n+1}`),"bottom"]}function H4n(e,t,n){let o=n.indexOf(e),r=n.indexOf(t);if(o<0||r<0)throw Error(`FanoutSolver: cannot build via span from "${e}" to "${t}"`);let i=Math.min(o,r),s=Math.max(o,r);return n.slice(i,s+1)}function t5(e){let{fromLayer:t,toLayer:n,layerNames:o,allowBlindAndBuriedVias:r}=e,i=H4n(t,n,o);return r?i:[...o]}function F4n(e){let{fromLayer:t,toLayer:n,layers:o,layerNames:r,allowBlindAndBuriedVias:i}=e,s=t5({fromLayer:t,toLayer:n,layerNames:r,allowBlindAndBuriedVias:i});if(!o)return s;if(o.length===0||!o.includes(t)||!o.includes(n)||o.some((a)=>!r.includes(a)))throw Error(`FanoutSolver: route via from "${t}" to "${n}" has an invalid physical layer span`);return[...o]}function NLr(e){let{busIds:t,layers:n,layersByBusId:o,maxAssignments:r}=e;if(n.length===0)throw Error("FanoutSolver: no escape layers are available");if(!Number.isInteger(r)||r<1)throw Error(`FanoutSolver: maxLayerCombinations must be positive, received ${r}`);let i=t.map((m)=>o?.[m]??n),s=i.findIndex((m)=>m.length===0);if(s>=0)throw Error(`FanoutSolver: no escape layers are available for bus "${t[s]}"`);let a=i.reduce((m,A)=>m*A.length,1),c=Math.min(r,Number.isFinite(a)?a:r),l=[],h=new Set;function d(m){let A={};for(let f=0;f<t.length;f++)A[t[f]]=i[f][m[f]];let g=JSON.stringify(A);if(h.has(g))return;h.add(g),l.push(A)}if(a<=r){for(let m=0;m<c;m++){let A=[],g=m;for(let f=0;f<t.length;f++){let y=i[f].length,x=g%y;g=Math.floor(g/y),A.push((x+f)%y)}d(A)}return l}function u(m){let A=m|0;return A=Math.imul(A^A>>>16,569420461),A=Math.imul(A^A>>>15,1935289751),(A^A>>>15)>>>0}let _=t.map((m,A)=>A%i[A].length);d(_);let p=Math.max(...i.map((m)=>m.length));for(let m=1;m<p&&l.length<c;m++)d(_.map((A,g)=>(A+m)%i[g].length));for(let m=0;m<t.length&&l.length<c;m++)for(let A=1;A<i[m].length&&l.length<c;A++){let g=[..._];g[m]=(_[m]+A)%i[m].length,d(g)}for(let m=1;l.length<c&&m<c*20;m++)d(t.map((A,g)=>u(m*2654435761+g*2246822507)%i[g].length));return l}var bS=0.000001;function RLr(e){return"layer"in e?[e.layer]:e.layers}function Dhe(e,t){return e.some((n)=>t.includes(n))}function QLr(e,t){let n=[],o;for(let r of e.route){if(r.route_type==="via"){n.push({type:"via",center:{x:r.x,y:r.y},diameter:r.via_diameter??0,layers:H4n(r.from_layer,r.to_layer,t)}),o=void 0;continue}if(r.route_type!=="wire")continue;if(o&&o.layer===r.layer&&Gt(o,r)>bS)n.push({type:"segment",segment:{start:{x:o.x,y:o.y},end:{x:r.x,y:r.y},width:r.width,layer:r.layer}});o=r}return n}function qw(e,t){if(e.type==="plane"&&t.type==="plane")return e.layer===t.layer;if(e.type==="plane"&&t.type==="via")return t.layers.includes(e.layer);if(e.type==="via"&&t.type==="plane")return qw(t,e);if(e.type==="plane"&&t.type==="segment")return e.layer===t.segment.layer;if(e.type==="segment"&&t.type==="plane")return qw(t,e);if(e.type==="endpoint"&&t.type==="endpoint")return Dhe(e.layers,t.layers)&&Gt(e.point,t.point)<=bS;if(e.type==="endpoint"&&t.type==="obstacle")return Dhe(e.layers,t.obstacle.layers)&&CZ(e.point,t.obstacle,bS);if(e.type==="obstacle"&&t.type==="endpoint")return qw(t,e);if(e.type==="endpoint"&&t.type==="segment")return e.layers.includes(t.segment.layer)&&Hr(e.point,t.segment.start,t.segment.end)<=t.segment.width/2+bS;if(e.type==="segment"&&t.type==="endpoint")return qw(t,e);if(e.type==="endpoint"&&t.type==="via")return Dhe(e.layers,t.layers)&&Gt(e.point,t.center)<=t.diameter/2+bS;if(e.type==="via"&&t.type==="endpoint")return qw(t,e);if(e.type==="obstacle"&&t.type==="segment")return e.obstacle.layers.includes(t.segment.layer)&&Cl(t.segment,e.obstacle)<=t.segment.width/2+bS;if(e.type==="segment"&&t.type==="obstacle")return qw(t,e);if(e.type==="obstacle"&&t.type==="via")return Dhe(e.obstacle.layers,t.layers)&&r5(t.center,e.obstacle)<=t.diameter/2+bS;if(e.type==="via"&&t.type==="obstacle")return qw(t,e);if(e.type==="segment"&&t.type==="segment")return e.segment.layer===t.segment.layer&&Hh(e.segment.start,e.segment.end,t.segment.start,t.segment.end)<=(e.segment.width+t.segment.width)/2+bS;if(e.type==="segment"&&t.type==="via")return t.layers.includes(e.segment.layer)&&Hr(t.center,e.segment.start,e.segment.end)<=t.diameter/2+e.segment.width/2+bS;if(e.type==="via"&&t.type==="segment")return qw(t,e);if(e.type==="via"&&t.type==="via")return Dhe(e.layers,t.layers)&&Gt(e.center,t.center)<=(e.diameter+t.diameter)/2+bS;return!1}var kLr=class{parent;constructor(e){this.parent=Array.from({length:e},(t,n)=>n)}find(e){let t=this.parent[e];if(t===e)return e;let n=this.find(t);return this.parent[e]=n,n}union(e,t){let n=this.find(e),o=this.find(t);if(n!==o)this.parent[o]=n}};function LLr(e,t,n){return Boolean(t.connection_name&&e5(e,t.connection_name,n.name))}function Db(e){let{inputSrj:t,routedSrj:n}=e,o=n.fanoutPlaneConnectivity,r=uB(n.layerCount),i=new Map;for(let h of t.connections){let d=k4n(h),u=i.get(d)??[];u.push(h),i.set(d,u)}let s=[],a=0,c=0;for(let h of i.values()){let d=h[0],u=h.flatMap((y)=>y.pointsToConnect.map((x,C)=>({type:"endpoint",connectionName:y.name,endpointIndex:C,point:x,layers:RLr(x)}))),_=t.obstacles.filter((y)=>kb(t,y,d.name)).map((y)=>({type:"obstacle",obstacle:y})),p=(n.traces??[]).filter((y)=>LLr(t,y,d)).flatMap((y)=>QLr(y,r)),m=[...new Set((o??[]).flatMap((y)=>e5(t,y.connectionName,d.name)?[y.layer]:[]))].map((y)=>({type:"plane",layer:y})),A=[...u,..._,...p,...m],g=new kLr(A.length);for(let y=0;y<A.length;y++)for(let x=y+1;x<A.length;x++)if(qw(A[y],A[x]))g.union(y,x);let f=new Map;for(let y=0;y<u.length;y++){let x=u[y],C=f.get(x.connectionName)??[];C[x.endpointIndex]=y,f.set(x.connectionName,C)}for(let y of h){let x=f.get(y.name)??[],C=x[0],b=C===void 0?void 0:g.find(C),I=x.flatMap((v,P)=>b===void 0||g.find(v)!==b?[P]:[]);if(c+=x.length-I.length,I.length===0)a++;else s.push({code:"original-endpoints-disconnected",connectionName:y.name,disconnectedEndpointIndices:I,message:`Connection ${y.name} has no physical copper path from endpoint 0 to original endpoint${I.length===1?"":"s"} ${I.join(", ")}`})}}let l=t.connections.reduce((h,d)=>h+d.pointsToConnect.length,0);return{valid:s.length===0,checkedConnectionCount:t.connections.length,connectedConnectionCount:a,checkedEndpointCount:l,connectedEndpointCount:c,issues:s}}var vS=0.000001;function Mue(e){let{inputSrj:t,segment:n,bodyObstacle:o,connectionName:r}=e;if(o.connectedTo.length>0||!o.componentId)return!1;let i=t.obstacles.filter((s)=>s.componentId===o.componentId&&s.layers.includes(n.layer)&&kb(t,s,r));for(let s of i)for(let[a,c]of[[n.start,n.end],[n.end,n.start]]){if(!CZ(a,s,vS))continue;let l={x:a.x-o.center.x,y:a.y-o.center.y},h={x:c.x-a.x,y:c.y-a.y};if(l.x*h.x+l.y*h.y>vS)return!0}return!1}function wtt(e,t){return Gt(e,t)<=vS}function K4(e,t){e.push(t)}function HLr(e){let{srj:t,trace:n,connectionName:o,layerNames:r,allowBlindAndBuriedVias:i,issues:s}=e,a=[],c=[],l,h;for(let d of n.route){if(d.route_type==="via"){let u=F4n({fromLayer:d.from_layer,toLayer:d.to_layer,layers:"layers"in d&&Array.isArray(d.layers)?d.layers:void 0,layerNames:r,allowBlindAndBuriedVias:i});if(c.push({center:{x:d.x,y:d.y},diameter:d.via_diameter??t.minViaPadDiameter??t.minTraceWidth,spanLayers:u}),!l||!wtt(l,d)||l.layer!==d.from_layer)K4(s,{code:"disconnected-trace",traceId:n.pcb_trace_id,connectionName:o,message:`Trace ${n.pcb_trace_id} reaches a via without a matching ${d.from_layer} wire endpoint`});h=d;continue}if(d.route_type!=="wire"){K4(s,{code:"unsupported-route-point",traceId:n.pcb_trace_id,connectionName:o,message:`Trace ${n.pcb_trace_id} contains unsupported ${d.route_type} geometry`}),l=void 0,h=void 0;continue}if(h){if(!wtt(d,h)||d.layer!==h.to_layer)K4(s,{code:"disconnected-trace",traceId:n.pcb_trace_id,connectionName:o,message:`Trace ${n.pcb_trace_id} does not continue from its via on ${h.to_layer}`});l=d,h=void 0;continue}if(l){if(l.layer!==d.layer)K4(s,{code:"disconnected-trace",traceId:n.pcb_trace_id,connectionName:o,message:`Trace ${n.pcb_trace_id} changes from ${l.layer} to ${d.layer} without a via`});else if(!wtt(l,d))a.push({start:{x:l.x,y:l.y},end:{x:d.x,y:d.y},width:d.width,layer:d.layer})}l=d}if(h)K4(s,{code:"disconnected-trace",traceId:n.pcb_trace_id,connectionName:o,message:`Trace ${n.pcb_trace_id} ends at a via without a wire on ${h.to_layer}`});return{trace:n,connectionName:o,segments:a,vias:c}}function kd(e){let{inputSrj:t,routedSrj:n,clearance:o,allowBlindAndBuriedVias:r=!0}=e,i=[],s=uB(n.layerCount),a=[],c=[t,n].flatMap((l)=>l.connections.flatMap((h)=>h.pointsToConnect.map((d)=>({connectionName:h.name,point:d}))));for(let l of n.traces??[]){let h=l.connection_name;if(!h||!t.connections.some((d)=>d.name===h)){K4(i,{code:"unknown-trace-connection",traceId:l.pcb_trace_id,...h?{connectionName:h}:{},message:`Trace ${l.pcb_trace_id} does not identify an input connection`});continue}a.push(HLr({srj:n,trace:l,connectionName:h,layerNames:s,allowBlindAndBuriedVias:r,issues:i}))}for(let l of a){let h=new Set(t.obstacles.filter((u)=>kb(t,u,l.connectionName))),d=t.obstacles.filter((u)=>!h.has(u));for(let u of l.segments)for(let _ of d){if(!_.layers.includes(u.layer))continue;if(Mue({inputSrj:t,segment:u,bodyObstacle:_,connectionName:l.connectionName}))continue;let p=Cl(u,_),m=u.width/2+o;if(p<m-vS)K4(i,{code:"trace-obstacle-clearance",traceId:l.trace.pcb_trace_id,connectionName:l.connectionName,layer:u.layer,obstacleId:_.obstacleId,message:`Trace ${l.trace.pcb_trace_id} on ${u.layer} is ${p.toFixed(4)}mm from different-net obstacle ${_.obstacleId}; ${m.toFixed(4)}mm is required`})}for(let u of l.vias){let _=c.find(({point:m})=>Gt(u.center,m)<=vS),p=t.allowViaInPad===!0&&t.obstacles.some((m)=>m.layers.some((A)=>u.spanLayers.includes(A))&&h.has(m)&&d7e({center:u.center,diameter:u.diameter,obstacle:m,tolerance:vS}));if(_&&!p)K4(i,{code:"via-at-endpoint",traceId:l.trace.pcb_trace_id,connectionName:l.connectionName,otherConnectionName:_.connectionName,message:`Via in ${l.trace.pcb_trace_id} is placed directly at an original or routed connection endpoint`});for(let m of d){if(!m.layers.some((f)=>u.spanLayers.includes(f)))continue;let A=r5(u.center,m),g=u.diameter/2+o;if(A<g-vS)K4(i,{code:"via-obstacle-clearance",traceId:l.trace.pcb_trace_id,connectionName:l.connectionName,obstacleId:m.obstacleId,message:`Via in ${l.trace.pcb_trace_id} is ${A.toFixed(4)}mm from different-net obstacle ${m.obstacleId} on its layer span; ${g.toFixed(4)}mm is required`})}}}for(let l=0;l<a.length;l++){let h=a[l];for(let d=l+1;d<a.length;d++){let u=a[d];if(e5(t,h.connectionName,u.connectionName))continue;for(let _ of h.segments){for(let p of u.segments){if(u_(_,p,o))continue;K4(i,{code:"different-net-trace-clearance",traceId:h.trace.pcb_trace_id,connectionName:h.connectionName,otherTraceId:u.trace.pcb_trace_id,otherConnectionName:u.connectionName,layer:_.layer,message:`Different-net traces ${h.trace.pcb_trace_id} and ${u.trace.pcb_trace_id} intersect or violate clearance on ${_.layer}`})}for(let p of u.vias){if(!p.spanLayers.includes(_.layer)||Hr(p.center,_.start,_.end)>=p.diameter/2+_.width/2+o-vS)continue;K4(i,{code:"different-net-trace-via-clearance",traceId:h.trace.pcb_trace_id,connectionName:h.connectionName,otherTraceId:u.trace.pcb_trace_id,otherConnectionName:u.connectionName,layer:_.layer,message:`Trace ${h.trace.pcb_trace_id} violates via clearance to ${u.trace.pcb_trace_id} on ${_.layer}`})}}for(let _ of h.vias){for(let p of u.segments){if(!_.spanLayers.includes(p.layer)||Hr(_.center,p.start,p.end)>=_.diameter/2+p.width/2+o-vS)continue;K4(i,{code:"different-net-trace-via-clearance",traceId:h.trace.pcb_trace_id,connectionName:h.connectionName,otherTraceId:u.trace.pcb_trace_id,otherConnectionName:u.connectionName,layer:p.layer,message:`Via in ${h.trace.pcb_trace_id} violates trace clearance to ${u.trace.pcb_trace_id} on ${p.layer}`})}for(let p of u.vias){if(!_.spanLayers.some((m)=>p.spanLayers.includes(m))||Gt(_.center,p.center)>=(_.diameter+p.diameter)/2+o-vS)continue;K4(i,{code:"different-net-via-clearance",traceId:h.trace.pcb_trace_id,connectionName:h.connectionName,otherTraceId:u.trace.pcb_trace_id,otherConnectionName:u.connectionName,message:`Different-net vias in ${h.trace.pcb_trace_id} and ${u.trace.pcb_trace_id} violate clearance on an overlapping layer span`})}}}}return{valid:i.length===0,checkedTraceCount:n.traces?.length??0,checkedSegmentCount:a.reduce((l,h)=>l+h.segments.length,0),checkedViaCount:a.reduce((l,h)=>l+h.vias.length,0),issues:i}}var Lit=0.000000001;function Qde(e,t){if("layer"in e)return e.layer;if(t&&e.layers.includes(t))return t;let n=e.layers[0];if(!n)throw Error("Endpoint completion received a layerless point");return n}function Hgn(e){let t=[];for(let n of e){if(t.at(-1)&&Gt(t.at(-1),n)<Lit)continue;t.push(n)}return t}function Fgn(e,t){let n=Hgn(e);if(n.length<3)return n;let o=[n[0]];for(let r=1;r<n.length-1;r++){let i=n[r-1],s=n[r],a=n[r+1],c=Gt(i,s),l=Gt(s,a),h={x:(s.x-i.x)/c,y:(s.y-i.y)/c},d={x:(a.x-s.x)/l,y:(a.y-s.y)/l};if(Math.abs(h.x*d.x+h.y*d.y)>0.000001){o.push(s);continue}let u=Math.min(t,c/2,l/2);o.push({x:s.x-h.x*u,y:s.y-h.y*u}),o.push({x:s.x+d.x*u,y:s.y+d.y*u})}return o.push(n.at(-1)),Hgn(o)}function FLr(e){let{inputSrj:t,connectionName:n,target:o,targetLayer:r}=e;return t.obstacles.find((i)=>i.layers.includes(r)&&kb(t,i,n)&&CZ(o,i,0.000001))}function zLr(e){let{inputSrj:t,plan:n}=e,o=Qde(n.targetPoint),r=FLr({inputSrj:t,connectionName:n.connectionName,target:n.targetPoint,targetLayer:o}),i=t.obstacles.find((l)=>l.componentId===r?.componentId&&l.connectedTo.length===0),s=i?{x:n.targetPoint.x-i.center.x,y:n.targetPoint.y-i.center.y}:{x:n.targetPoint.x-n.sourcePoint.x,y:n.targetPoint.y-n.sourcePoint.y},a=Math.hypot(s.x,s.y),c=a>Lit?{x:s.x/a,y:s.y/a}:{x:1,y:0};return{outward:c,perpendicular:{x:-c.y,y:c.x}}}function z4n(e){let{plan:t,branchStart:n,viaPoint:o,assignedLayerPath:r,terminalApproach:i,traceWidth:s,viaDiameter:a,viaHoleDiameter:c,candidateIndex:l,chamfer:h}=e,d=Qde(t.targetPoint),u=Fgn(r,h),_=Fgn([o,...i?[i]:[],t.targetPoint],h),p=u.map((m)=>({route_type:"wire",x:m.x,y:m.y,width:s,layer:n.layer}));if(n.layer!==d)p.push({route_type:"via",x:o.x,y:o.y,from_layer:n.layer,to_layer:d,via_diameter:a,via_hole_diameter:c}),p.push({route_type:"wire",x:o.x,y:o.y,width:s,layer:d});for(let m of _.slice(1))p.push({route_type:"wire",x:m.x,y:m.y,width:s,layer:d});return{type:"pcb_trace",pcb_trace_id:BLr({connectionName:t.connectionName,sourcePointIndex:t.sourcePointIndex,candidateIndex:l}),connection_name:t.connectionName,route:p}}function AY(e,t){return!e.issues.some((n)=>n.connectionName===t)}function Hit(e){let{trace:t,endpointSrjs:n}=e,o=n.flatMap((r)=>r.connections.flatMap((i)=>i.pointsToConnect));return t.route.some((r)=>r.route_type==="via"&&o.some((i)=>Gt(r,i)<=0.000001))}function OLr(e){let{inputSrj:t,fanoutSrj:n,plan:o,acceptedTraces:r,traceWidth:i,viaDiameter:s,viaHoleDiameter:a,clearance:c,allowBlindAndBuriedVias:l}=e,{outward:h,perpendicular:d}=zLr({inputSrj:t,plan:o}),u=[...o.via?[{x:o.via.center.x,y:o.via.center.y,layer:o.targetLayer}]:[],{x:o.sourcePoint.x,y:o.sourcePoint.y,layer:o.sourceLayer}],_=[],p=Number.POSITIVE_INFINITY,m=0,A=t.connections.length>32?600:Number.POSITIVE_INFINITY,g=o.termination.type==="plane"?O4n({trace:o.trace,endpoint:o.exitPoint,layer:o.sourceLayer,distances:[0.2,0.3,0.4]}):[],f=[...o.termination.type==="plane"&&o.via?[{...o.via.center}]:[],...g,...[0.4,0.8,1.2,1.6].flatMap((y)=>[0,0.4,-0.4,0.8,-0.8,1.2,-1.2,1.6,-1.6].map((x)=>({x:o.sourcePoint.x+h.x*y+d.x*x,y:o.sourcePoint.y+h.y*y+d.y*x})))];for(let y of f){let x=[...o.termination.type==="plane"?[{...y,layer:o.targetLayer}]:[],...u,...g.flatMap((C)=>Gt(C,y)<=0.000001?[{...C,layer:o.sourceLayer}]:[])];for(let C of x){let b=Gt(C,y)<=0.000001?[[C]]:[[C,y],[C,{x:y.x,y:C.y},y],[C,{x:C.x,y:y.y},y],...[0.4,-0.4].map((I)=>[C,{x:C.x+I,y:C.y},{x:C.x+I,y:y.y},y])];for(let I of b){let v=[void 0,...[0.4,0.8].map((P)=>({x:o.targetPoint.x+h.x*P,y:o.targetPoint.y+h.y*P})),...[0.4,-0.4].map((P)=>({x:o.targetPoint.x+h.x*0.4+d.x*P,y:o.targetPoint.y+h.y*0.4+d.y*P}))];for(let P of v){if(m>=A)return{blockingConnectionNames:_};let M=z4n({plan:o,branchStart:C,viaPoint:y,assignedLayerPath:I,terminalApproach:P,traceWidth:i,viaDiameter:s,viaHoleDiameter:a,candidateIndex:m++,chamfer:0});if(Hit({trace:M,endpointSrjs:[t,n]}))continue;let B={...n,traces:[...n.traces??[],...r,M]},T=kd({inputSrj:t,routedSrj:B,clearance:c,allowBlindAndBuriedVias:l});if(!T.valid){if(T.issues.length<p)p=T.issues.length,_=[...new Set(T.issues.flatMap((D)=>[D.connectionName,D.otherConnectionName].flatMap((L)=>L&&L!==o.connectionName?[L]:[])))];continue}let N=Db({inputSrj:t,routedSrj:B});if(AY(N,o.connectionName))return{trace:M,blockingConnectionNames:[]}}}}}return{blockingConnectionNames:_}}function VLr(e){let{inputSrj:t,fanoutSrj:n,plans:o,traceWidth:r,viaDiameter:i,viaHoleDiameter:s,clearance:a,allowBlindAndBuriedVias:c}=e,l=[],h=[],d=new Set;for(let _ of o){let p=OLr({inputSrj:t,fanoutSrj:n,plan:_,acceptedTraces:l,traceWidth:r,viaDiameter:i,viaHoleDiameter:s,clearance:a,allowBlindAndBuriedVias:c});if(p.trace)l.push(p.trace);else{h.push(_.connectionName);for(let m of p.blockingConnectionNames)d.add(m)}}let u={...n,traces:[...n.traces??[],...l]};return{traces:l,failedConnectionNames:h,blockingConnectionNames:[...d],connectivity:Db({inputSrj:t,routedSrj:u}),drc:kd({inputSrj:t,routedSrj:u,clearance:a,allowBlindAndBuriedVias:c})}}function zgn(e){let t=0,n;for(let o of e.route){if(o.route_type!=="wire"){n=void 0;continue}if(n?.layer===o.layer)t+=Gt(n,o);n=o}return t}function YLr(e){let{fanoutSrj:t,completionTraces:n}=e,o=new Map(n.flatMap((i)=>{let s=i.route.find((a)=>a.route_type==="wire");return s?[[i.connection_name,{x:s.x,y:s.y,layer:s.layer}]]:[]})),r=(t.traces??[]).map((i)=>{if(!i.pcb_trace_id.startsWith("fanout:"))return i;let s=o.get(i.connection_name);if(!s)return i;let a;for(let c=0;c<i.route.length;c++){let l=i.route[c];if(l?.route_type!=="wire"){a=void 0;continue}if(a!==void 0){let h=i.route[a];if(h?.route_type==="wire"&&h.layer===s.layer&&l.layer===s.layer&&Hr(s,h,l)<=0.000001){let d=i.route.slice(0,a+1);if(Gt(h,s)>0.000001)d.push({route_type:"wire",x:s.x,y:s.y,width:l.width,layer:s.layer});return{...i,route:d}}}a=c}return i});return{...t,traces:r}}function GLr(e){let{inputSrj:t,fanoutSrj:n,localTraces:o,candidates:r,clearance:i,allowBlindAndBuriedVias:s}=e,a=[...n.traces??[],...o],c={...n,traces:a},l=Db({inputSrj:t,routedSrj:c}),d=r.filter((p)=>p.route.length>1&&p.route.every((m)=>m.route_type==="wire"||m.route_type==="via")&&!Hit({trace:p,endpointSrjs:[t,n]})).filter((p)=>{let m=Db({inputSrj:t,routedSrj:{...n,traces:[...a,p]}});return m.connectedConnectionCount>l.connectedConnectionCount&&AY(m,p.connection_name)}),u={...n,traces:[...a,...d]};if(kd({inputSrj:t,routedSrj:u,clearance:i,allowBlindAndBuriedVias:s}).valid)return d;let _=[];for(let p of d.toSorted((m,A)=>zgn(m)-zgn(A))){let m={...n,traces:[...a,..._,p]};if(!kd({inputSrj:t,routedSrj:m,clearance:i,allowBlindAndBuriedVias:s}).valid)continue;let g=Db({inputSrj:t,routedSrj:{...n,traces:[...a,..._]}}),f=Db({inputSrj:t,routedSrj:m});if(f.connectedConnectionCount>g.connectedConnectionCount&&AY(f,p.connection_name))_.push(p)}return _}function O4n(e){let{trace:t,endpoint:n,layer:o,distances:r}=e,i=t.route.findLastIndex((s)=>s.route_type==="wire"&&s.layer===o&&Gt(s,n)<=0.000001);if(i<0)return[];return r.flatMap((s)=>{let a=s,c=n;for(let l=i-1;l>=0;l--){let h=t.route[l];if(h?.route_type!=="wire"||h.layer!==o)break;let d=Gt(c,h);if(d<=Lit)continue;if(a<d-0.000001)return[{x:c.x+(h.x-c.x)*a/d,y:c.y+(h.y-c.y)*a/d}];a-=d,c=h}return[]})}function Ogn(e){let{inputSrj:t,fanoutSrj:n,plan:o,acceptedTraces:r,traceWidth:i,viaDiameter:s,viaHoleDiameter:a,clearance:c,allowBlindAndBuriedVias:l}=e,h={x:o.exitPoint.x,y:o.exitPoint.y,layer:o.targetLayer},d=o.targetPoint,u=Qde(d),_=0,p=(A)=>{let g=z4n({plan:o,branchStart:A.start,viaPoint:A.viaPoint,assignedLayerPath:[A.start,A.viaPoint],terminalApproach:A.terminalApproach,traceWidth:i,viaDiameter:s,viaHoleDiameter:a,candidateIndex:1e4+_++,chamfer:Math.max(i,0.1)});if(Hit({trace:g,endpointSrjs:[t,n]}))return;let f={...n,traces:[...n.traces??[],...r,g]};if(!kd({inputSrj:t,routedSrj:f,clearance:c,allowBlindAndBuriedVias:l}).valid)return;if(AY(Db({inputSrj:t,routedSrj:f}),o.connectionName))return g;return};if(h.layer!==u){let A=O4n({trace:o.trace,endpoint:o.exitPoint,layer:o.targetLayer,distances:[0.4,0.8,1.2,1.6]});for(let g of A){let f={...g,layer:o.targetLayer};for(let y of[void 0,{x:d.x,y:g.y},{x:g.x,y:d.y}]){let x=p({start:f,viaPoint:g,terminalApproach:y});if(x)return x}}}let m=[[d],[{x:d.x,y:h.y},d],[{x:h.x,y:d.y},d]];for(let A of m){let g=A[0],f=Gt(h,g),y=h.layer===u?[0]:[0.4,0.8,1.2,1.6];for(let x of y){if(h.layer!==u&&(f<=x+0.2||x<=0.000001))continue;let C=h.layer===u?{x:h.x,y:h.y}:{x:h.x+(g.x-h.x)*x/f,y:h.y+(g.y-h.y)*x/f},b=p({start:h,viaPoint:C,terminalApproach:A.length>1?g:void 0});if(b)return b}}return}function ULr(e){let{inputSrj:t,fanoutSrj:n,plans:o,traceWidth:r,viaDiameter:i,viaHoleDiameter:s,clearance:a,allowBlindAndBuriedVias:c=!0,effort:l=1,routeDownstreamConnections:h}=e,d=[],u=kd({inputSrj:t,routedSrj:n,clearance:a,allowBlindAndBuriedVias:c}),_=Db({inputSrj:t,routedSrj:n}),p=o.filter((N)=>{let D=Qde(N.sourcePoint),L=Qde(N.targetPoint);return D!==L&&Gt(N.sourcePoint,N.targetPoint)<=0.25&&!AY(_,N.connectionName)}),m={traces:[],failedConnectionNames:p.map((N)=>N.connectionName),blockingConnectionNames:[],connectivity:_,drc:u},A=0;if(!u.valid)d.push("Fanout prefix failed emitted-copper DRC; skipped completion");else{let N=[],D=new Map(p.map((H,V)=>[H.connectionName,V])),L=t.connections.length>32?1:3;for(let H=0;H<L;H++){let V=new Map(N.map((j,Y)=>[j,Y])),O=p.toSorted((j,Y)=>(V.get(j.connectionName)??Number.MAX_SAFE_INTEGER)-(V.get(Y.connectionName)??Number.MAX_SAFE_INTEGER)||(D.get(j.connectionName)??0)-(D.get(Y.connectionName)??0)),U=VLr({inputSrj:t,fanoutSrj:n,plans:O,traceWidth:r,viaDiameter:i,viaHoleDiameter:s,clearance:a,allowBlindAndBuriedVias:c});if(A++,U.drc.valid&&(U.connectivity.connectedConnectionCount>m.connectivity.connectedConnectionCount||U.connectivity.connectedConnectionCount===m.connectivity.connectedConnectionCount&&U.traces.length<m.traces.length))m=U;if(N=[...new Set([...U.failedConnectionNames,...U.blockingConnectionNames,...N])],U.failedConnectionNames.length===0)break}}let g=new Set(p.map((N)=>N.connectionName)),f=o.filter((N)=>!g.has(N.connectionName)&&!AY(_,N.connectionName)),y=[];if(u.valid)for(let N of f){let D=Ogn({inputSrj:t,fanoutSrj:n,plan:N,acceptedTraces:[...m.traces,...y],traceWidth:r,viaDiameter:i,viaHoleDiameter:s,clearance:a,allowBlindAndBuriedVias:c});if(D)y.push(D)}let x={...n,traces:[...n.traces??[],...m.traces,...y]},C=new Set(Db({inputSrj:t,routedSrj:x}).issues.map((N)=>N.connectionName)),b=n.connections.filter((N)=>!g.has(N.name)&&C.has(N.name)),I=[];if(u.valid&&b.length>0&&b.length<=12&&h){let N=new Set(b.map((L)=>L.name)),D={...n,connections:b,buses:n.buses?.map((L)=>({...L,connectionNames:L.connectionNames.filter((H)=>N.has(H))})).filter((L)=>L.connectionNames.length>0),obstacles:n.obstacles,traces:x.traces};try{let L=h(D,{effort:l});I=GLr({inputSrj:t,fanoutSrj:n,localTraces:[...m.traces,...y],candidates:L.filter((H)=>N.has(H.connection_name)),clearance:a,allowBlindAndBuriedVias:c})}catch(L){d.push(`Downstream router failed: ${L instanceof Error?L.message:String(L)}`)}}else if(!u.valid&&b.length>0)d.push("Skipped downstream router because the endpoint-completion baseline failed emitted-copper DRC");else if(b.length>12)d.push(`Skipped downstream router for ${b.length} unresolved connections (bounded at 12)`);else if(b.length>0&&!h)d.push(`Skipped downstream router for ${b.length} unresolved connections because no routeDownstreamConnections callback was provided`);let v=[...m.traces,...y,...I];for(let N of f){let D={...n,traces:[...n.traces??[],...v]};if(AY(Db({inputSrj:t,routedSrj:D}),N.connectionName))continue;let L=Ogn({inputSrj:t,fanoutSrj:n,plan:N,acceptedTraces:v,traceWidth:r,viaDiameter:i,viaHoleDiameter:s,clearance:a,allowBlindAndBuriedVias:c});if(L)v.push(L)}let P={...n,traces:[...n.traces??[],...v]},M=YLr({fanoutSrj:P,completionTraces:v}),B=Db({inputSrj:t,routedSrj:M}),T=kd({inputSrj:t,routedSrj:M,clearance:a,allowBlindAndBuriedVias:c});if(!T.valid)return d.push("Final endpoint-completion output failed emitted-copper DRC"),{simpleRouteJson:n,traces:[],report:{attemptedLocalConnectionCount:p.length,attemptedDownstreamConnectionCount:f.length,completionTraceCount:0,searchPassCount:A,errors:d,connectivity:Db({inputSrj:t,routedSrj:n}),drc:u}};return{simpleRouteJson:M,traces:v,report:{attemptedLocalConnectionCount:p.length,attemptedDownstreamConnectionCount:f.length,completionTraceCount:v.length,searchPassCount:A,errors:d,connectivity:B,drc:T}}}var WLr={topside_left:{direction:"left",preferredExit:"top-left",exitEdge:"top"},topside_center:{direction:"up",preferredExit:"top",exitEdge:"top"},topside_right:{direction:"right",preferredExit:"top-right",exitEdge:"top"},rightside_top:{direction:"up",preferredExit:"top-right",exitEdge:"right"},rightside_center:{direction:"right",preferredExit:"right",exitEdge:"right"},rightside_bottom:{direction:"down",preferredExit:"bottom-right",exitEdge:"right"},bottomside_right:{direction:"right",preferredExit:"bottom-right",exitEdge:"bottom"},bottomside_center:{direction:"down",preferredExit:"bottom",exitEdge:"bottom"},bottomside_left:{direction:"left",preferredExit:"bottom-left",exitEdge:"bottom"},leftside_bottom:{direction:"down",preferredExit:"bottom-left",exitEdge:"left"},leftside_center:{direction:"left",preferredExit:"left",exitEdge:"left"},leftside_top:{direction:"up",preferredExit:"top-left",exitEdge:"left"},center:{}};function V4n(e){let t=WLr[e];if(!t)throw Error(`Invalid fanout exit position "${e}"`);return t}function Fit(e){let t=e.differentialPairs;if(t===void 0)return[];if(!Array.isArray(t))throw Error("Differential pairs must be an array");let n=new Map;return e.connections.forEach((o,r)=>{let i=n.get(o.name)??[];i.push(r),n.set(o.name,i)}),t.map((o,r)=>{let i=o,s=i?.connectionNames,a=i?.lengthTolerance;if(!Array.isArray(s)||s.length!==2||s.some((l)=>typeof l!=="string"||l.length===0)||s[0]===s[1]||typeof a!=="number"||!Number.isFinite(a)||a<0)throw Error(`Differential pair ${r} requires two distinct connection names and a finite nonnegative tolerance`);let c=s.map((l)=>{let h=n.get(l);if(h?.length!==1)throw Error(`Differential pair ${r} cannot resolve original connection ${l}`);return h[0]});return{connectionNames:s,connectionIndices:c,lengthTolerance:a}})}function u7e(e,t,n=!0){let o=uB(e.layerCount),r=[],i=[],s;for(let a of t.route){if(a.route_type==="via"){i.push({center:{x:a.x,y:a.y},diameter:a.via_diameter??e.minViaPadDiameter??e.min_via_pad_diameter??e.minViaDiameter??e.minTraceWidth,spanLayers:F4n({fromLayer:a.from_layer,toLayer:a.to_layer,layers:"layers"in a&&Array.isArray(a.layers)?a.layers:void 0,layerNames:o,allowBlindAndBuriedVias:n})}),s=void 0;continue}if(a.route_type!=="wire"){s=void 0;continue}if(s?.layer===a.layer&&(s.x!==a.x||s.y!==a.y))r.push({start:{x:s.x,y:s.y},end:{x:a.x,y:a.y},width:Math.max(s.width,a.width),layer:a.layer});s=a}return{trace:t,connectionName:t.connection_name,segments:r,vias:i}}function oP(e,t=!0){return(e.traces??[]).map((n)=>u7e(e,n,t))}function*XLr(e){let{plan:t,bus:n,inputSrj:o,layerNames:r,clearance:i,consumeWork:s}=e;if(!t.via||(t.additionalVias?.length??0)>4)return;let a=(n.routableEscapeLayers??n.allowedLayers??r).filter((f)=>f!==t.targetLayer&&r.includes(f)&&(n.allowedLayers??r).includes(f));if(!a.length)return;let c=e.plans.filter((f)=>f.connectionIndex!==t.connectionIndex),l=oP(o,!1),h=[...c.flatMap((f)=>[...f.segments,...f.planeEndpointSegments??[]]),...l.flatMap((f)=>f.segments)],d=[...e.plans.flatMap((f)=>[f.via,...f.additionalVias??[],f.planeEndpointVia].filter((y)=>!!y)),...l.flatMap((f)=>f.vias)],u=t.via.diameter,{sharedBoundary:_,componentBounds:p}=n,m=u/2+i,A=[];for(let[f,y]of t.segments.entries()){if(y.layer!==t.targetLayer||f<(t.sourceEscapeSegmentCount??1))continue;let x=Gt(y.start,y.end),C=Math.max(1,Math.ceil(x/(y.width/2)));for(let b=0;b<=C;b++){s();let I=b/C,v={x:y.start.x+(y.end.x-y.start.x)*I,y:y.start.y+(y.end.y-y.start.y)*I};if(v.x>=p.minX-m&&v.x<=p.maxX+m&&v.y>=p.minY-m&&v.y<=p.maxY+m)continue;if(Math.min(v.x-_.minX,_.maxX-v.x,v.y-_.minY,_.maxY-v.y)<u/2+0.0000001)continue;if(A.some((P)=>Gt(P.point,v)<0.0000001))continue;if(o.obstacles.some((P)=>r5(v,P)<m-0.000000001))continue;if(d.some((P)=>Gt(v,P.center)<(u+P.diameter)/2+i-0.000000001))continue;if(h.some((P)=>Hr(v,P.start,P.end)<(u+P.width)/2+i-0.000000001))continue;if(A.push({index:f,point:v}),A.length===64)break}if(A.length===64)break}let g=A.flatMap((f,y)=>A.slice(y+1).flatMap((x)=>{if(f.index>=x.index||Gt(f.point,x.point)<u+i)return[];let C=t.segments.slice(f.index,x.index+1);if(C.some((b)=>b.layer!==t.targetLayer))return[];return[{a:f,b:x,length:C.reduce((b,I)=>b+Gt(I.start,I.end),0)}]})).sort((f,y)=>y.length-f.length);for(let{a:f,b:y}of g){let x=t.segments[f.index],C=t.segments[y.index],b=[...t.segments.slice(0,f.index),{...x,end:f.point}].filter((D)=>Gt(D.start,D.end)>0.0000001),I=[{...C,start:y.point},...t.segments.slice(y.index+1)].filter((D)=>Gt(D.start,D.end)>0.0000001),v=[{...x,start:f.point},...t.segments.slice(f.index+1,y.index),{...C,end:y.point}].filter((D)=>Gt(D.start,D.end)>0.0000001),P=y.point.x-f.point.x,M=y.point.y-f.point.y,B=Math.min(Math.abs(P),Math.abs(M)),T=[{x:f.point.x+Math.sign(P)*B,y:f.point.y+Math.sign(M)*B},{x:y.point.x-Math.sign(P)*B,y:y.point.y-Math.sign(M)*B}],N=[v,...T.map((D)=>[{...x,start:f.point,end:D},{...x,start:D,end:y.point}].filter((L)=>Gt(L.start,L.end)>0.0000001))];for(let D of a){let L=h.filter((U)=>U.layer===D),H=d.filter((U)=>U.spanLayers.includes(D)),V=o.obstacles.filter((U)=>U.layers.includes(D)),O=[{...t.via,center:f.point,fromLayer:t.targetLayer,toLayer:D,spanLayers:r},{...t.via,center:y.point,fromLayer:D,toLayer:t.targetLayer,spanLayers:r}];for(let U of N){s();let j=U.map((Y)=>({...Y,layer:D}));if(j.some((Y)=>L.some((X)=>!u_(Y,X,i))||H.some((X)=>Hr(X.center,Y.start,Y.end)<(X.diameter+Y.width)/2+i-0.000000001)||V.some((X)=>Cl(Y,X)<Y.width/2+i-0.000000001)))continue;yield{before:b,window:j,after:I,tuningLayer:D,addedVias:O}}}}}function PY(e){let{points:t,chamfer:n,segmentIsClear:o}=e;if(t.length<2)return null;let r=0.0000001,i=[[t[0]]];for(let s=1;s<t.length;s++){let a=t[s-1],c=t[s],l=c.x-a.x,h=c.y-a.y;if(a.z!==c.z||Math.abs(l)<r||Math.abs(h)<r||Math.abs(Math.abs(l)-Math.abs(h))<r){for(let _ of i)_.push(c);continue}let d=Math.min(Math.abs(l),Math.abs(h)),u=[{x:a.x+Math.sign(l)*d,y:a.y+Math.sign(h)*d,z:a.z},{x:c.x-Math.sign(l)*d,y:c.y-Math.sign(h)*d,z:a.z},{x:c.x,y:a.y,z:a.z},{x:a.x,y:c.y,z:a.z}].filter((_)=>o(a,_)&&o(_,c));if(i=i.flatMap((_)=>u.map((p)=>[..._,p,c])).slice(0,16),i.length===0)return null}for(let s of i){let a=[s[0]],c=!0;for(let l=1;l<s.length-1;l++){let h=s[l-1],d=s[l],u=s[l+1],_=Gt(h,d),p=Gt(d,u);if(h.z!==d.z||d.z!==u.z||_<r||p<r){a.push(d);continue}let m=(d.x-h.x)/_,A=(d.y-h.y)/_,g=(u.x-d.x)/p,f=(u.y-d.y)/p,y=m*g+A*f,x=e.repairReversingDiagonalCorners===!0&&Math.abs(y+Math.SQRT1_2)<r;if(Math.abs(y)>r&&!x){a.push(d);continue}let C=Math.min(n,_/3,p/3),b=!1;while(C>=0.000001){let I={x:d.x-m*C,y:d.y-A*C,z:d.z},v={x:d.x+g*C,y:d.y+f*C,z:d.z},P=Math.sign(m*f-A*g),M=x?{x:I.x+(m-P*A)*Math.SQRT1_2*C*(Math.SQRT2-1),y:I.y+(A+P*m)*Math.SQRT1_2*C*(Math.SQRT2-1),z:d.z}:void 0;if(M?o(I,M)&&o(M,v):o(I,v)){a.push(I,...M?[M]:[],v),b=!0;break}C/=2}if(!b){c=!1;break}}if(!c)continue;a.push(s.at(-1));for(let l=1;l<a.length;l++){let h=a[l-1],d=a[l];if(h.z!==d.z){if(Gt(h,d)>r)c=!1;continue}if(!o(h,d)){c=!1;break}let u=Math.abs(h.x-d.x),_=Math.abs(h.y-d.y);if(u>r&&_>r&&Math.abs(u-_)>r){c=!1;break}let p=a[l+1];if(p?.z===d.z&&Gt(h,d)>r&&Gt(d,p)>r){if(((d.x-h.x)*(p.x-d.x)+(d.y-h.y)*(p.y-d.y))/(Gt(h,d)*Gt(d,p))<Math.SQRT1_2-r){c=!1;break}}}if(c)return a}return null}var wue=class{layers=new Map;constructor(e){let t=new Map;for(let n of e){let o=n.width/2,r={segment:n,minX:Math.min(n.start.x,n.end.x)-o,maxX:Math.max(n.start.x,n.end.x)+o,minY:Math.min(n.start.y,n.end.y)-o,maxY:Math.max(n.start.y,n.end.y)+o},i=t.get(n.layer)??[];i.push(r),t.set(n.layer,i)}for(let[n,o]of t)this.layers.set(n,this.build(o))}querySegment(e,t){let n=e.width/2+t+0.00000001;return this.query([e.layer],{minX:Math.min(e.start.x,e.end.x)-n,maxX:Math.max(e.start.x,e.end.x)+n,minY:Math.min(e.start.y,e.end.y)-n,maxY:Math.max(e.start.y,e.end.y)+n})}queryVia(e,t){let n=e.diameter/2+t+0.00000001;return this.query(e.spanLayers,{minX:e.center.x-n,maxX:e.center.x+n,minY:e.center.y-n,maxY:e.center.y+n})}query(e,t){let n=[],o=(i)=>!(i.minX>t.maxX||i.maxX<t.minX||i.minY>t.maxY||i.maxY<t.minY),r=(i)=>{if(!o(i))return;if(i.entries){for(let s of i.entries)if(o(s))n.push(s.segment)}else r(i.left),r(i.right)};for(let i of e){let s=this.layers.get(i);if(s)r(s)}return n}build(e){let t=e.reduce((r,i)=>({minX:Math.min(r.minX,i.minX),maxX:Math.max(r.maxX,i.maxX),minY:Math.min(r.minY,i.minY),maxY:Math.max(r.maxY,i.maxY)}),{minX:1/0,maxX:-1/0,minY:1/0,maxY:-1/0});if(e.length<=8)return{...t,entries:e};let n=t.maxX-t.minX>=t.maxY-t.minY;e.sort((r,i)=>n?r.minX+r.maxX-i.minX-i.maxX:r.minY+r.maxY-i.minY-i.maxY);let o=Math.floor(e.length/2);return{...t,left:this.build(e.slice(0,o)),right:this.build(e.slice(o))}}};function kde(e){switch(e){case"left":return"left";case"right":return"right";case"up":return"top";case"down":return"bottom"}}function zS(e){switch(e){case"left":return"left";case"right":return"right";case"top":return"up";case"bottom":return"down"}}function Y4n(e,t){return e===t||e.includes(t)}function Vi(e,t){if(!e||!t?.includes("-"))return;if(!Y4n(t,e))return;if(e==="left"||e==="right")return t.startsWith("top-")?"maximum":"minimum";return t.endsWith("-right")?"maximum":"minimum"}function jLr(e,t){let n=t==="up"||t==="down"?"y":"x",o=e.slice(0,32).map(({connectionIndex:r})=>[r]);for(let r=0;r<e.length;r++)for(let i=r+1;i<e.length;i++){if(o.length>=32)return o;let s=e[r],a=e[i];if(Math.abs(s.sourcePoint[n]-a.sourcePoint[n])<=0.000000001)o.push([s.connectionIndex,a.connectionIndex])}return o}var hu=0.000000001,KLr=1e5;function G4n(e){for(let[n,o]of[["viaDiameter",e.viaDiameter],["traceWidth",e.traceWidth]])if(!Number.isFinite(o)||o<=0)throw Error(`FanoutSolver: dogbone ${n} must be a positive finite number, received ${o}`);if(!Number.isFinite(e.clearance)||e.clearance<0)throw Error(`FanoutSolver: dogbone clearance must be a non-negative finite number, received ${e.clearance}`);if(e.viaHoleDiameter!==void 0&&(!Number.isFinite(e.viaHoleDiameter)||e.viaHoleDiameter<=0))throw Error(`FanoutSolver: dogbone viaHoleDiameter must be a positive finite number, received ${e.viaHoleDiameter}`);if(e.holeToHoleClearance!==void 0&&(!Number.isFinite(e.holeToHoleClearance)||e.holeToHoleClearance<0))throw Error(`FanoutSolver: dogbone holeToHoleClearance must be a non-negative finite number, received ${e.holeToHoleClearance}`);if(e.holeToHoleClearance!==void 0&&e.viaHoleDiameter===void 0)throw Error("FanoutSolver: dogbone holeToHoleClearance requires viaHoleDiameter");let t=e.maximumSearchStates??KLr;if(!Number.isInteger(t)||t<1)throw Error(`FanoutSolver: dogbone maximumSearchStates must be a positive integer, received ${t}`);return t}function Mot(e){let t=[];for(let n of e.toSorted((o,r)=>o-r)){if(!Number.isFinite(n))continue;if(t.length===0||Math.abs(t.at(-1)-n)>hu)t.push(n)}return t}function U4n(e){let t=new Map,n=new Map,o=new Map;for(let r of e){let i=t.get(r.componentId);if(!i)i={componentId:r.componentId,connections:[],obstacles:[],xCoordinates:[],yCoordinates:[],pitchX:Number.POSITIVE_INFINITY,pitchY:Number.POSITIVE_INFINITY},t.set(r.componentId,i),o.set(r.componentId,new Set);if(i.xCoordinates.push(...r.xCoordinates),i.yCoordinates.push(...r.yCoordinates),Number.isFinite(r.pitchX)&&r.pitchX>hu)i.pitchX=Math.min(i.pitchX,r.pitchX);if(Number.isFinite(r.pitchY)&&r.pitchY>hu)i.pitchY=Math.min(i.pitchY,r.pitchY);let s=o.get(r.componentId);for(let a of r.componentObstacles)if(!s.has(a))s.add(a),i.obstacles.push(a);for(let a of r.connections){let c=n.get(a.connectionIndex);if(c!==void 0){if(c!==r.componentId)throw Error(`FanoutSolver: connection index ${a.connectionIndex} belongs to multiple components`);continue}n.set(a.connectionIndex,r.componentId),i.connections.push({preparedConnection:a,busId:r.busId,direction:r.direction,terminationType:r.termination.type})}}return[...t.values()].map((r)=>({...r,connections:r.connections.toSorted((i,s)=>i.preparedConnection.connectionIndex-s.preparedConnection.connectionIndex),xCoordinates:Mot(r.xCoordinates),yCoordinates:Mot(r.yCoordinates)})).toSorted((r,i)=>r.componentId.localeCompare(i.componentId))}function $Lr(e){let{coordinates:t,pitch:n}=e;if(t.length===0||!Number.isFinite(n)||n<=hu)return[];let o=[t[0]-n/2];for(let r=1;r<t.length;r++)o.push((t[r-1]+t[r])/2);return o.push(t.at(-1)+n/2),Mot(o)}function Vgn(e){let{sourceCoordinate:t,coordinates:n,pitch:o}=e,r=$Lr({coordinates:n,pitch:o}),i=r.filter((a)=>a<t-hu).at(-1),s=r.find((a)=>a>t+hu);return[i,s].filter((a)=>a!==void 0)}function qLr(e,t){let n=Math.abs(t.x-e.x),o=Math.abs(t.y-e.y);return n<=hu||o<=hu||Math.abs(n-o)<=hu}function JLr(e){let{source:t,site:n,direction:o}=e,r=o==="right"?n.x-t.x:o==="left"?t.x-n.x:o==="up"?n.y-t.y:t.y-n.y;return r>hu?0:Math.abs(r)<=hu?1:2}function ZLr(e){let{point:t,obstacles:n,viaDiameter:o,clearance:r}=e,i=o/2+r;return n.every((s)=>r5(t,s)>=i-hu)}function eHr(e){let{segment:t,sourceObstacle:n,obstacles:o,clearance:r}=e,i=t.width/2+r;return o.every((s)=>s===n||!s.layers.includes(t.layer)||Cl(t,s)>=i-hu)}function W4n(e){let{connection:t,component:n,rules:o}=e,{preparedConnection:r,direction:i}=t,s=o.additionalObstacles?[...new Set([...n.obstacles,...o.additionalObstacles])]:n.obstacles,a={x:r.sourcePoint.x,y:r.sourcePoint.y},c=Vgn({sourceCoordinate:a.x,coordinates:n.xCoordinates,pitch:n.pitchX}),l=Vgn({sourceCoordinate:a.y,coordinates:n.yCoordinates,pitch:n.pitchY}),h=[...c.map((I)=>({x:I,y:a.y})),...l.map((I)=>({x:a.x,y:I})),...c.flatMap((I)=>l.map((v)=>({x:I,y:v})))],d=[];for(let I of h)if(!d.some((v)=>Gt(v,I)<=hu))d.push(I);let u=o.fixedViaPointsByConnectionIndex?.get(r.connectionIndex),_=u?[u]:d,p=[];for(let I of _){if(t.terminationType==="plane"&&!qLr(a,I))continue;if(!ZLr({point:I,obstacles:s,viaDiameter:o.viaDiameter,clearance:o.clearance}))continue;let v={start:a,end:I,width:o.traceWidth,layer:r.sourceLayer};if(!eHr({segment:v,sourceObstacle:r.sourceObstacle,obstacles:s,clearance:o.clearance}))continue;if(!(o.blockingSegments??[]).every((B)=>{if(B.connectionIndex===r.connectionIndex)return!0;if(o.canShareCopper?.(r.connectionIndex,B.connectionIndex))return!0;let T=o.viaDiameter/2+B.segment.width/2+o.clearance;if(Hr(I,B.segment.start,B.segment.end)<T-hu)return!1;return B.segment.layer!==v.layer||u_(v,B.segment,o.clearance)}))continue;if(!(o.blockingVias??[]).every((B)=>{if(B.connectionIndex===r.connectionIndex)return!0;if(Gt(I,B.center)<(o.viaDiameter+B.diameter)/2+o.clearance-hu)return!1;if(B.spanLayers.includes(v.layer)&&Hr(B.center,v.start,v.end)<B.diameter/2+v.width/2+o.clearance-hu)return!1;return!0}))continue;p.push({connectionIndex:r.connectionIndex,point:I,sourceSegment:v,outwardRank:JLr({source:a,site:I,direction:i})})}let m=i==="left"||i==="right"?n.yCoordinates:n.xCoordinates,A=i==="left"||i==="right"?a.y:a.x,g=m.findIndex((I)=>Math.abs(I-A)<=hu),f=g>=0?g%2===0?1:-1:void 0,y=t.terminationType==="boundary"?o.preferredBoundaryPerpendicularSideByBusId?.get(t.busId):o.preferPlaneCheckerboardSites&&t.terminationType==="plane"&&(i==="left"||i==="right")?f:void 0,x=t.terminationType==="boundary"?o.preferBoundaryOutwardByBusId?.get(t.busId)??!0:!0,C=o.preferredViaPointsByConnectionIndex?.get(r.connectionIndex),b=(I)=>{if(y===void 0)return 0;let v=i==="left"||i==="right"?I.point.y-a.y:I.point.x-a.x;return v*y>hu?0:Math.abs(v)<=hu?1:2};return p.toSorted((I,v)=>(C?Number(Gt(I.point,C)>hu)-Number(Gt(v.point,C)>hu):0)||(x?I.outwardRank-v.outwardRank:v.outwardRank-I.outwardRank)||b(I)-b(v)||Gt(a,I.point)-Gt(a,v.point)||I.point.x-v.point.x||I.point.y-v.point.y)}function tHr(e){let{first:t,second:n,rules:o}=e,r=o.canShareCopper?.(t.connectionIndex,n.connectionIndex)??!1,i=o.viaHoleDiameter?o.viaHoleDiameter+(o.holeToHoleClearance??o.clearance):0,s=r?i:Math.max(o.viaDiameter+o.clearance,i);if(Gt(t.point,n.point)<s-hu)return!1;let a=o.viaDiameter/2+o.traceWidth/2+o.clearance;if(!r){if(Hr(t.point,n.sourceSegment.start,n.sourceSegment.end)<a-hu||Hr(n.point,t.sourceSegment.start,t.sourceSegment.end)<a-hu)return!1}if(r)return!0;return u_(t.sourceSegment,n.sourceSegment,o.clearance)}function nHr(e){let{component:t,rules:n,consumeSearchState:o}=e,r=t.connections.map((_)=>({connection:_,candidates:W4n({connection:_,component:t,rules:n})}));if(r.some((_)=>_.candidates.length===0))return null;let i=new Map,s=(_,p)=>{let m=i.get(_)?.get(p);if(m!==void 0)return m;let A=tHr({first:_,second:p,rules:n}),g=i.get(_)??new Map;g.set(p,A),i.set(_,g);let f=i.get(p)??new Map;return f.set(_,A),i.set(p,f),A},a=r.flatMap((_)=>_.candidates.length===1?[_.candidates[0]]:[]);for(let _=0;_<a.length;_++){let p=a[_];for(let m=0;m<_;m++)if(!s(p,a[m]))return null}let c=new Map(a.map((_)=>[_.connectionIndex,_])),l=new Set(r.flatMap((_)=>_.candidates.length>1?[_.connection.preparedConnection.connectionIndex]:[])),h=new Map(r.map((_)=>[_.connection.preparedConnection.connectionIndex,_]));if(l.size===0)return new Map([...c.entries()].map(([_,p])=>[_,{...p.point}]));let d=(_)=>_.candidates.filter((p)=>[...c.values()].every((m)=>s(p,m))),u=()=>{if(!o())return!1;if(l.size===0)return!0;let _,p=[];for(let A of[...l].toSorted((g,f)=>g-f)){let g=h.get(A),f=d(g);if(f.length===0)return!1;if(!_||f.length<p.length||f.length===p.length&&A<_.connection.preparedConnection.connectionIndex)_=g,p=f}let m=_.connection.preparedConnection.connectionIndex;l.delete(m);for(let A of p){if(c.set(m,A),u())return!0;c.delete(m)}return l.add(m),!1};if(!u())return null;return new Map([...c.entries()].toSorted(([_],[p])=>_-p).map(([_,p])=>[_,{...p.point}]))}function Yu(e,t){let n=G4n(t);if(e.length===0)return new Map;let o=0,r=()=>(o++,o<=n),i=new Map;for(let s of U4n(e)){let a=nHr({component:s,rules:t,consumeSearchState:r});if(!a)return null;for(let[c,l]of a)i.set(c,l)}return i}function dk(e,t){return G4n(t),U4n(e).flatMap((n)=>n.connections.flatMap((o)=>W4n({connection:o,component:n,rules:t}).map((r)=>({connectionIndex:r.connectionIndex,point:{...r.point}}))))}function*oHr(e,t,n){let o=dk([e],t),r=24;for(let i of e.connections.toReversed()){let s=n.get(i.connectionIndex);if(!s)continue;for(let a of o){if(a.connectionIndex!==i.connectionIndex||Gt(a.point,s)<=hu)continue;if(r--<=0)return;let c=new Map(n);c.set(i.connectionIndex,a.point),yield c}}}var Zl=0.0000001;var rHr=160000,iHr=240000,sHr=5000,aHr=24,Ygn=3.25,cHr=class{constructor(e,t,n,o,r,i,s,a){this.minX=t,this.minY=n,this.cellSize=i,this.columnCount=Math.max(1,Math.ceil((o-t)/i)),this.rowCount=Math.max(1,Math.ceil((r-n)/i)),this.cells=Array(this.columnCount*this.rowCount);for(let c of e){let l={...c,minX:Math.min(c.segment.start.x,c.segment.end.x),maxX:Math.max(c.segment.start.x,c.segment.end.x),minY:Math.min(c.segment.start.y,c.segment.end.y),maxY:Math.max(c.segment.start.y,c.segment.end.y)},h=(c.segment.width+s)/2+a,d=this.column(l.minX-h),u=this.column(l.maxX+h),_=this.row(l.minY-h),p=this.row(l.maxY+h);for(let m=_;m<=p;m++)for(let A=d;A<=u;A++){let g=m*this.columnCount+A;(this.cells[g]??=[]).push(l)}}}minX;minY;cellSize;cells;columnCount;rowCount;seen=new Map;queryCount=0;column(e){return Math.max(0,Math.min(this.columnCount-1,Math.floor((e-this.minX)/this.cellSize)))}row(e){return Math.max(0,Math.min(this.rowCount-1,Math.floor((e-this.minY)/this.cellSize)))}querySegment(e){let t=this.column(Math.min(e.start.x,e.end.x)),n=this.column(Math.max(e.start.x,e.end.x)),o=this.row(Math.min(e.start.y,e.end.y)),r=this.row(Math.max(e.start.y,e.end.y));if(t===n&&o===r)return this.cells[o*this.columnCount+t]??[];let i=[],s=++this.queryCount;for(let a=o;a<=r;a++)for(let c=t;c<=n;c++)for(let l of this.cells[a*this.columnCount+c]??[]){if(this.seen.get(l)===s)continue;this.seen.set(l,s),i.push(l)}return i}};function lHr(e){let t=e;if(t.shape==="circle"){let l=e.width/2;return{minX:e.center.x-l,maxX:e.center.x+l,minY:e.center.y-l,maxY:e.center.y+l,xRadius:l}}let n=(t.ccwRotationDegrees??0)*Math.PI/180,o=Math.abs(Math.cos(n)),r=Math.abs(Math.sin(n)),i=e.width/2,s=e.height/2,a=o*i+r*s,c=r*i+o*s;return{minX:e.center.x-a,maxX:e.center.x+a,minY:e.center.y-c,maxY:e.center.y+c,xRadius:a}}var hHr=class{obstaclesByCenterX;maximumXRadius;constructor(e){this.obstaclesByCenterX=e.map((t)=>({obstacle:t,...lHr(t)})).toSorted((t,n)=>t.obstacle.center.x-n.obstacle.center.x),this.maximumXRadius=this.obstaclesByCenterX.reduce((t,n)=>Math.max(t,n.xRadius),0)}querySegment(e,t){let n=Math.min(e.start.x,e.end.x),o=Math.max(e.start.x,e.end.x),r=Math.min(e.start.y,e.end.y),i=Math.max(e.start.y,e.end.y),s=n-t-this.maximumXRadius,a=o+t+this.maximumXRadius,c=0,l=this.obstaclesByCenterX.length;while(c<l){let d=Math.floor((c+l)/2);if(this.obstaclesByCenterX[d].obstacle.center.x<s)c=d+1;else l=d}let h=[];for(let d=c;d<this.obstaclesByCenterX.length;d++){let u=this.obstaclesByCenterX[d];if(u.obstacle.center.x>a)break;if(u.maxX<n-t||u.minX>o+t||u.maxY<r-t||u.minY>i+t)continue;h.push(u.obstacle)}return h}};function*dHr(e){let{initialOrderFactories:t,rotationBase:n,getItemKey:o,maximumOrderCount:r=Number.POSITIVE_INFINITY}=e,i=new Set,s=0,a=(c)=>c.map(o).join("\x00");for(let c of t){if(s>=r)return;let l=c(),h=a(l);if(i.has(h))continue;i.add(h),s++,yield l}for(let c=1;c<n.length;c++){if(s>=r)return;let l=[...n.slice(c),...n.slice(0,c)],h=a(l);if(i.has(h))continue;i.add(h),s++,yield l}}var uHr=class{values=[];get size(){return this.values.length}sampleEntries(e){if(this.values.length<=e)return this.values;let t=Math.ceil(this.values.length/e);return this.values.filter((n,o)=>o%t===0)}push(e){this.values.push(e);let t=this.values.length-1;while(t>0){let n=Math.floor((t-1)/2);if(this.values[n].score<=e.score)break;this.values[t]=this.values[n],t=n}this.values[t]=e}pop(){let e=this.values[0],t=this.values.pop();if(!e||!t||this.values.length===0)return e;let n=0;while(!0){let o=n*2+1,r=o+1;if(o>=this.values.length)break;let i=r<this.values.length&&this.values[r].score<this.values[o].score?r:o;if(this.values[i].score>=t.score)break;this.values[n]=this.values[i],n=i}return this.values[n]=t,e}};function _J(e,t){return t==="left"||t==="right"?e.y:e.x}function pHr(e,t){let n=t.x-e.x,o=t.y-e.y,r=Math.abs(n),i=Math.abs(o);if(r<Zl||i<Zl||Math.abs(r-i)<Zl)return[[e,t]];if(r>i)return[[e,{x:e.x+Math.sign(n)*i,y:t.y},t],[e,{x:t.x-Math.sign(n)*i,y:e.y},t]];return[[e,{x:t.x,y:e.y+Math.sign(o)*r},t],[e,{x:e.x,y:t.y-Math.sign(o)*r},t]]}function mHr(e){if(e.length<3)return e;let t=[e[0]];for(let n=1;n<e.length-1;n++){let o=t.at(-1),r=e[n],i=e[n+1],s=Math.sign(r.x-o.x),a=Math.sign(r.y-o.y),c=Math.sign(i.x-r.x),l=Math.sign(i.y-r.y);if(s!==c||a!==l)t.push(r)}return t.push(e.at(-1)),t}function pde(e,t,n){return e.slice(1).flatMap((o,r)=>{let i=e[r];return Gt(i,o)<Zl?[]:[{start:i,end:o,width:t,layer:n}]})}function _Hr(e){let t=Math.abs(e.end.x-e.start.x),n=Math.abs(e.end.y-e.start.y);return t<Zl||n<Zl||Math.abs(t-n)<Zl}function gHr(e){for(let t=0;t<e.length;t++)for(let n=t+2;n<e.length;n++){if(t===0&&n===e.length-1&&Gt(e[t].start,e[n].end)<Zl)continue;if(Hh(e[t].start,e[t].end,e[n].start,e[n].end)<Zl)return!1}return!0}function AHr(e){return[e.via,...e.additionalVias??[],e.planeEndpointVia].filter((t)=>Boolean(t))}function fHr(e){let{srj:t,acceptedPlans:n,allowBlindAndBuriedVias:o}=e,r=oP(t,o);return{segments:[...r.flatMap((i)=>i.segments.map((s)=>({connectionName:i.connectionName,segment:s}))),...n.flatMap((i)=>[...i.segments,...i.planeEndpointSegments??[]].map((s)=>({connectionName:i.connectionName,segment:s})))],vias:[...r.flatMap((i)=>i.vias.map((s)=>({connectionName:i.connectionName,via:s}))),...n.flatMap((i)=>AHr(i).map((s)=>({connectionName:i.connectionName,via:s})))]}}function Ob(e){let{bus:t,terminal:n,targetLayer:o,targetLayerPoints:r,layerNames:i,traceWidth:s,viaDiameter:a,viaHoleDiameter:c,allowBlindAndBuriedVias:l}=e,h=n.connection,d={x:h.sourcePoint.x,y:h.sourcePoint.y},u=e.sourceEscapePoints??[d,n.viaPoint];if(u.length<2||Gt(u[0],d)>Zl||Gt(u.at(-1),n.viaPoint)>Zl)throw Error("FanoutSolver: source escape must connect the source pad to its first via");let _=pde([...u],s,h.sourceLayer),p=Gt(d,n.viaPoint)>Zl,m=h.sourceLayer!==o,A=pde(r,s,o),g=t5({fromLayer:h.sourceLayer,toLayer:o,layerNames:i,allowBlindAndBuriedVias:l}),f={center:n.viaPoint,diameter:a,holeDiameter:c,fromLayer:h.sourceLayer,toLayer:o,spanLayers:g},y=[{route_type:"wire",...d,width:s,layer:h.sourceLayer,...h.sourcePoint.pcb_port_id?{start_pcb_port_id:h.sourcePoint.pcb_port_id}:{}},...p?[...u.slice(1).map((I)=>({route_type:"wire",...I,width:s,layer:h.sourceLayer}))]:[],...m?[{route_type:"via",...n.viaPoint,from_layer:h.sourceLayer,to_layer:o,via_diameter:a,via_hole_diameter:c},{route_type:"wire",...n.viaPoint,width:s,layer:o}]:[],...r.slice(1).map((I)=>({route_type:"wire",...I,width:s,layer:o}))],x=zY({connectionName:h.connection.name,sourcePointIndex:h.sourcePointIndex}),C=[...p?_:[],...A],b=Vi(t.exitEdge,t.preferredExit);return{busId:t.busId,connectionName:h.connection.name,connectionIndex:h.connectionIndex,sourcePointIndex:h.sourcePointIndex,sourcePoint:h.sourcePoint,sourceObstacle:h.sourceObstacle,sourceLayer:h.sourceLayer,targetPoint:h.targetPoint,targetLayer:o,termination:t.termination,direction:t.direction,...t.exitEdge?{exitEdge:t.exitEdge}:{},...b?{cornerBandSide:b}:{},exitPoint:n.exitPoint,trace:{type:"pcb_trace",pcb_trace_id:x.traceId,connection_name:h.connection.name,connectsTo:[...h.sourcePoint.pointId?[h.sourcePoint.pointId]:[],...h.sourcePoint.pcb_port_id?[h.sourcePoint.pcb_port_id]:[],x.boundaryExitPointId],route:y},segments:C,..._.length>1?{sourceEscapeSegmentCount:_.length}:{},via:m?f:void 0,length:C.reduce((I,v)=>I+Gt(v.start,v.end),0)}}function*G2(e,t=1,n=!1){if(!Number.isInteger(t)||t<1)throw Error(`FanoutSolver: maximum winding alternatives must be a positive integer, received ${t}`);let{srj:o,bus:r,targetLayer:i,terminals:s,acceptedPlans:a,layerNames:c,traceWidth:l,viaDiameter:h,viaHoleDiameter:d,clearance:u,allowBlindAndBuriedVias:_=!0,allowSameNetMerges:p=!1,maximumRouteOrderAttempts:m,maximumSearchStates:A=iHr,reservedVias:g=[],softReservedVias:f=[],gridStepDivisor:y=1,heuristicWeight:x=1,preferTargetDirectedLaneBias:C=!1,allowSourceLayerRouting:b=!1,adaptiveRouteOrder:I=!1,alignGridToPads:v=!1,includeReverseTargetRotation:P=!1,reserveTerminalExitPoints:M=!1,forbidEarlyExitBoundaryContact:B=!1}=e;if(m!==void 0&&(!Number.isInteger(m)||m<1))throw Error(`FanoutSolver: maximumRouteOrderAttempts must be a positive integer, received ${m}`);if(!Number.isSafeInteger(A)||A<1)throw Error(`FanoutSolver: maximumSearchStates must be a positive safe integer, received ${A}`);if(!Number.isFinite(x)||x<=0)throw Error(`FanoutSolver: heuristicWeight must be a positive finite number, received ${x}`);if(y!==1&&y!==2)throw Error(`FanoutSolver: gridStepDivisor must be 1 or 2, received ${y}`);if(s.length===0||!r.exitEdge||!b&&s.some((je)=>je.connection.sourceLayer===i))return[];let T=(l+u)/y,N=Math.min(r.pitchX,r.pitchY),D=v&&y===2&&Number.isFinite(N),L=e.gridStep??(D?N/(2*Math.ceil(N/(2*T))):T);if(!Number.isFinite(L)||L<=0)return[];let{minX:H,maxX:V,minY:O,maxY:U}=r.sharedBoundary,j=e.gridOrigin?.x??r.xCoordinates[0]??H,Y=e.gridOrigin?.y??r.yCoordinates[0]??O,X=D?j+Math.ceil((H-j)/L)*L:H,K=D?Y+Math.ceil((O-Y)/L)*L:O,J=Math.floor((V-X)/L)+1,ee=Math.floor((U-K)/L)+1,se=J*ee;if(J<2||ee<2||se>rHr)return[];let ne=Array.from({length:se},(je,st)=>{let St=st%J,Nt=Math.floor(st/J);return{column:St,row:Nt,point:{x:X+St*L,y:K+Nt*L}}}),re=f.length?new Float32Array(se):void 0;if(re)for(let{via:je}of f){if(!je.spanLayers.includes(i))continue;let st=je.diameter/2+l/2+u,St=Math.max(0,Math.ceil((je.center.x-st-X)/L)),Nt=Math.min(J-1,Math.floor((je.center.x+st-X)/L)),Ot=Math.max(0,Math.ceil((je.center.y-st-K)/L)),Ut=Math.min(ee-1,Math.floor((je.center.y+st-K)/L));for(let mn=Ot;mn<=Ut;mn++)for(let _n=St;_n<=Nt;_n++){let En=mn*J+_n;if(Gt(ne[En].point,je.center)<st)re[En]=re[En]+25*L}}let Z=n?ne.filter((je,st)=>st%Math.max(1,Math.ceil(ne.length/1000))===0).map((je)=>je.point):[],te=o.obstacles.filter((je)=>je.layers.includes(i)),ie=new hHr(te),ce=fHr({srj:o,acceptedPlans:a,allowBlindAndBuriedVias:_}),ue=ce.segments.filter(({segment:je})=>{if(je.layer!==i)return!1;let st=(je.width+l)/2+u;return!(Math.max(je.start.x,je.end.x)<H-st||Math.min(je.start.x,je.end.x)>V+st||Math.max(je.start.y,je.end.y)<O-st||Math.min(je.start.y,je.end.y)>U+st)});if(b)ue.push(...g.flatMap((je)=>je.sourceEscapeSegment?.layer===i?[{connectionName:je.connectionName,segment:je.sourceEscapeSegment}]:[]));let de=ce.vias.filter(({via:je})=>{if(!je.spanLayers.includes(i))return!1;let st=je.diameter/2+l/2+u;return!(je.center.x<H-st||je.center.x>V+st||je.center.y<O-st||je.center.y>U+st)});de.push(...g.filter(({via:je})=>{if(!je.spanLayers.includes(i))return!1;let st=je.diameter/2+l/2+u;return!(je.center.x<H-st||je.center.x>V+st||je.center.y<O-st||je.center.y>U+st)}));let me=s.filter((je)=>je.connection.sourceLayer!==i).map((je)=>({connectionName:je.connection.connection.name,via:{center:je.viaPoint,diameter:h,spanLayers:t5({fromLayer:je.connection.sourceLayer,toLayer:i,layerNames:c,allowBlindAndBuriedVias:_})}})),ge=zS(r.exitEdge),xe=(je,st)=>je===st||p&&e5(o,je,st),Ee=(je)=>new cHr(je,H,O,V,U,L*8,l,u),Re=Ee(ue),Me=[...de,...me],_e=Me.reduce((je,{via:st})=>Math.max(je,st.diameter/2+l/2+u),l/2+u),ye=Me.toSorted((je,st)=>je.via.center.x-st.via.center.x),Se=(je)=>{let st=0,St=ye.length;while(st<St){let Nt=Math.floor((st+St)/2);if(ye[Nt].via.center.x<je)st=Nt+1;else St=Nt}return st},Ne=(je)=>{let{segment:st,terminal:St,acceptedAttemptSegmentIndex:Nt}=je;if(B){let ln=r.sharedBoundary;for(let hn of[st.start,st.end])if((Math.abs(hn.x-ln.minX)<Zl||Math.abs(hn.x-ln.maxX)<Zl||Math.abs(hn.y-ln.minY)<Zl||Math.abs(hn.y-ln.maxY)<Zl)&&Gt(hn,St.exitPoint)>Zl)return!1}let Ot=St.connection.connection.name,Ut=Math.min(st.start.x,st.end.x),mn=Math.max(st.start.x,st.end.x),_n=Math.min(st.start.y,st.end.y),En=Math.max(st.start.y,st.end.y),Qn=st.width/2+u;for(let ln of ie.querySegment(st,Qn)){if(ln.connectedTo.includes(Ot)||p&&kb(o,ln,Ot))continue;if(Cl(st,ln)<Qn-Zl)return!1}for(let ln of Re.querySegment(st)){if(xe(Ot,ln.connectionName))continue;let hn=(st.width+ln.segment.width)/2+u;if(mn+hn<ln.minX||Ut-hn>ln.maxX||En+hn<ln.minY||_n-hn>ln.maxY)continue;if(Hh(st.start,st.end,ln.segment.start,ln.segment.end)<hn-Zl)return!1}for(let ln of Nt.querySegment(st)){if(xe(Ot,ln.connectionName))continue;let hn=(st.width+ln.segment.width)/2+u;if(mn+hn<ln.minX||Ut-hn>ln.maxX||En+hn<ln.minY||_n-hn>ln.maxY)continue;if(Hh(st.start,st.end,ln.segment.start,ln.segment.end)<(st.width+ln.segment.width)/2+u-Zl)return!1}for(let ln of M?s:[]){if(xe(Ot,ln.connection.connection.name))continue;if(Hr(ln.exitPoint,st.start,st.end)<l+u-Zl)return!1}for(let ln=Se(Ut-_e);ln<ye.length;ln++){let hn=ye[ln];if(hn.via.center.x>mn+_e)break;if(xe(Ot,hn.connectionName))continue;let Zn=hn.via.diameter/2+st.width/2+u;if(hn.via.center.x<Ut-Zn||hn.via.center.x>mn+Zn||hn.via.center.y<_n-Zn||hn.via.center.y>En+Zn)continue;if(Hr(hn.via.center,st.start,st.end)<Zn-Zl)return!1}return!0},Le=(je)=>{let{terminal:st,endpoint:St,acceptedAttemptSegmentIndex:Nt}=je,Ot=[],Ut=L*Ygn,mn=Math.max(0,Math.ceil((St.x-Ut-X)/L)-1),_n=Math.min(J-1,Math.floor((St.x+Ut-X)/L)+1),En=Math.max(0,Math.ceil((St.y-Ut-K)/L)-1),Qn=Math.min(ee-1,Math.floor((St.y+Ut-K)/L)+1);for(let ln=En;ln<=Qn;ln++)for(let hn=mn;hn<=_n;hn++){let Zn=ln*J+hn,bo=ne[Zn],ir=Gt(St,bo.point);if(ir>L*Ygn)continue;for(let gt of pHr(St,bo.point)){let Oe=pde(gt,l,i);if(!Oe.every((mt)=>Ne({segment:mt,terminal:st,acceptedAttemptSegmentIndex:Nt})))continue;Ot.push({nodeIndex:Zn,points:gt,radialDistance:ir,length:Oe.reduce((mt,It)=>mt+Gt(It.start,It.end),0)})}}return Ot.toSorted((ln,hn)=>ln.radialDistance-hn.radialDistance||ln.length-hn.length||ln.nodeIndex-hn.nodeIndex).slice(0,aHr)},nt=(je)=>{let{terminal:st,acceptedAttemptSegments:St,expandedPoints:Nt,frontierPoints:Ot,bestPath:Ut,expandedStateCount:mn,searchBatch:_n,connectionComplete:En}=je;return{title:`Winding ${r.busId}: ${st.connection.connection.name}`,rects:[{center:{x:(H+V)/2,y:(O+U)/2},width:V-H,height:U-O,fill:"rgba(0, 0, 0, 0)",stroke:"rgba(14, 165, 233, 0.9)",label:"A* search boundary"}],points:[...Z.map((Qn)=>({...Qn,color:"rgba(148, 163, 184, 0.22)"})),...Ot.map((Qn)=>({...Qn,color:"rgba(6, 182, 212, 0.75)",label:"open frontier"})),...Nt.map((Qn)=>({...Qn,color:"rgba(244, 63, 94, 0.8)",label:"expanded in current step"})),{...st.connection.sourcePoint,color:"#f97316",label:`source: ${st.connection.connection.name}`},{...st.exitPoint,color:"#a855f7",label:"target exit"}],circles:s.map((Qn)=>({center:Qn.viaPoint,radius:h/2,fill:Qn===st?"rgba(250, 204, 21, 0.85)":"rgba(250, 204, 21, 0.25)",stroke:Qn===st?"#ca8a04":"#a16207",label:Qn===st?"active via":`reserved via: ${Qn.connection.connection.name}`})),lines:[...St.map(({segment:Qn,connectionName:ln})=>({points:[Qn.start,Qn.end],strokeColor:"rgba(34, 197, 94, 0.9)",strokeWidth:Math.max(l,L*0.35),label:`accepted: ${ln}`})),{points:[st.viaPoint,st.exitPoint],strokeColor:"rgba(168, 85, 247, 0.45)",strokeWidth:Math.max(l*0.5,L*0.15),strokeDash:[L,L],label:"active via-to-exit search"},...Ut?[{points:[...Ut],strokeColor:"#facc15",strokeWidth:Math.max(l,L*0.45),label:"best path so far"}]:[]],texts:[{x:H,y:U+L*2,text:En?`connection complete · ${mn.toLocaleString()} states`:`A* batch ${_n} · ${mn.toLocaleString()} states`,color:"#0f172a",fontSize:Math.max(L*2.5,0.5),anchorSide:"bottom_left"}]}},dt=function*(je){let{terminal:st,acceptedAttemptSegments:St,laneBias:Nt}=je,Ot=Ee(St),Ut=Le({terminal:st,endpoint:st.viaPoint,acceptedAttemptSegmentIndex:Ot}),mn=Le({terminal:st,endpoint:st.exitPoint,acceptedAttemptSegmentIndex:Ot});if(Ut.length===0||mn.length===0)return{points:null,expandedStateCount:0};let _n=new Map;for(let qn of mn){let Po=_n.get(qn.nodeIndex)??[];Po.push(qn),_n.set(qn.nodeIndex,Po)}let En=se*9,Qn=new Uint8Array(se*8),ln=x>1?new Uint8Array(En):void 0,hn=new Float64Array(En).fill(Number.POSITIVE_INFINITY),Zn=new Int32Array(En).fill(-1),bo=new uHr,ir=new Float64Array(se),gt=new Float64Array(se),Oe=_J(st.exitPoint,ge);for(let qn=0;qn<se;qn++){let Po=ne[qn].point,To=Math.abs(Po.x-st.exitPoint.x),Tn=Math.abs(Po.y-st.exitPoint.y);ir[qn]=Math.max(To,Tn)+(Math.SQRT2-1)*Math.min(To,Tn);let lo=_J(Po,ge);gt[qn]=Nt===0?0:Nt>0?Math.max(0,Oe-lo)*0.2:Math.max(0,lo-Oe)*0.2}for(let qn of Ut){let Po=qn.nodeIndex*9+8;if(qn.length>=hn[Po])continue;hn[Po]=qn.length;let To=ir[qn.nodeIndex];bo.push({node:qn.nodeIndex,direction:8,score:qn.length+x*To})}let mt=[[1,0],[1,1],[0,1],[-1,1],[-1,0],[-1,-1],[0,-1],[1,-1]],It=Array.from({length:9},(qn,Po)=>mt.flatMap((To,Tn)=>{let lo=Math.abs(Po-Tn);return Po===8||Math.min(lo,8-lo)<=1?[Tn]:[]})),bt=new Map;for(let qn of Ut){let Po=bt.get(qn.nodeIndex)??[];Po.push(qn),bt.set(qn.nodeIndex,Po)}let cn=Number.POSITIVE_INFINITY,dn=null,wn=0,eo=0,_o=0,$n=[];while(bo.size>0&&wn<A){let qn=bo.pop();if(qn.score>=cn-Zl)break;let Po=qn.node*9+qn.direction;if(ln?.[Po])continue;let To=hn[Po];if(qn.score>To+x*ir[qn.node]+Zl)continue;if(ln)ln[Po]=1;if(wn++,eo++,n&&eo%50===0)$n.push(ne[qn.node].point);let Tn=_n.get(qn.node);if(Tn){let fo=[],oo=Po;while(oo>=0)fo.push(ne[Math.floor(oo/9)].point),oo=Zn[oo];fo.reverse();let Ro=Po;while(Zn[Ro]>=0)Ro=Zn[Ro];let or=Math.floor(Ro/9),Er=bt.get(or)??[],Xi=Math.min(...Er.map((Ys)=>Ys.length));for(let Ys of Er)for(let aa of Tn){let Lo=To-Xi+Ys.length+aa.length;if(Lo>=cn-Zl)continue;let Gi=mHr([...Ys.points,...fo.slice(1),...aa.points.toReversed().slice(1)]),bi=pde(Gi,l,i);if(!bi.every(_Hr)||!gHr(bi)||!bi.every((os)=>Ne({segment:os,terminal:st,acceptedAttemptSegmentIndex:Ot})))continue;cn=Lo,dn=Gi}}if(x>1&&dn)return{points:dn,expandedStateCount:wn};let lo=ne[qn.node];for(let fo of It[qn.direction]){let[oo,Ro]=mt[fo],or=lo.column+oo,Er=lo.row+Ro;if(or<0||or>=J||Er<0||Er>=ee)continue;let Xi=Er*J+or,Ys=ne[Xi].point,aa=qn.direction!==8&&qn.direction!==fo,Lo=gt[Xi],Gi=To+(oo!==0&&Ro!==0?L*Math.SQRT2:L)+(aa?L*0.2:0)+Lo+(re?.[Xi]??0),bi=Xi*9+fo;if(ln?.[bi])continue;if(Gi>=hn[bi]-Zl)continue;let os=qn.node*8+fo;if(Qn[os]===0){let dl=Ne({segment:{start:lo.point,end:Ys,width:l,layer:i},terminal:st,acceptedAttemptSegmentIndex:Ot});Qn[os]=dl?1:2,Qn[Xi*8+(fo+4)%8]=dl?1:2}if(Qn[os]===2)continue;hn[bi]=Gi,Zn[bi]=Po;let Lc=ir[Xi];bo.push({node:Xi,direction:fo,score:Gi+x*Lc})}if(eo>=sHr)eo=0,_o++,yield{expandedStateCount:wn,...n?{visualization:nt({terminal:st,acceptedAttemptSegments:St,expandedPoints:$n,frontierPoints:bo.sampleEntries(120).map((fo)=>ne[fo.node].point),bestPath:dn,expandedStateCount:wn,searchBatch:_o,connectionComplete:!1})}:{}},$n=[]}return{points:dn,expandedStateCount:wn}},rt=s.toSorted((je,st)=>_J(je.exitPoint,ge)-_J(st.exitPoint,ge)||je.connection.connection.name.localeCompare(st.connection.connection.name)),pt=s.map((je)=>_J(je.viaPoint,ge)),ct=rt.map((je)=>_J(je.exitPoint,ge)),Ct=pt.reduce((je,st)=>je+st,0)/pt.length,kt=ct.reduce((je,st)=>je+st,0)/ct.length,Lt=Math.max(...pt)<Math.min(...ct)-Zl,Bt=Math.min(...pt)>Math.max(...ct)+Zl,xt=e.routeOrder?[e.laneBias??0]:C?Lt?[0,1,-1]:Bt?[0,-1,1]:r.direction===ge&&kt>Ct+Zl?[1,0,-1]:r.direction===ge&&kt<Ct-Zl?[-1,0,1]:[0,1,-1]:Lt?[1,0,-1]:Bt?[-1,0,1]:[0,1,-1],Yt=[];if(e.routeOrder){if(e.routeOrder.length!==s.length||new Set(e.routeOrder).size!==s.length||e.routeOrder.some((je)=>!Number.isInteger(je)||je<0||je>=s.length))throw Error("FanoutSolver: routeOrder must contain every terminal index exactly once");Yt.push(()=>e.routeOrder.map((je)=>s[je]))}if(v&&C&&Lt)Yt.push(()=>rt);if(Lt)Yt.push(()=>[...rt.slice(1),rt[0]]);else if(Bt){if(Yt.push(()=>[...rt].reverse()),P&&rt.length>2)Yt.push(()=>[...rt.slice(0,-1).toReversed(),rt.at(-1)])}Yt.push(...C&&r.direction===ge&&kt<Ct-Zl&&!Lt&&!Bt?[()=>[...rt].reverse(),()=>rt]:[()=>rt,()=>[...rt].reverse()],()=>s.toSorted((je,st)=>je.viaPoint.x-st.viaPoint.x||je.viaPoint.y-st.viaPoint.y),()=>s.toSorted((je,st)=>st.viaPoint.x-je.viaPoint.x||st.viaPoint.y-je.viaPoint.y),()=>s.toSorted((je,st)=>je.viaPoint.y-st.viaPoint.y||je.viaPoint.x-st.viaPoint.x),()=>s.toSorted((je,st)=>st.viaPoint.y-je.viaPoint.y||st.viaPoint.x-je.viaPoint.x));let ut=m===void 0?void 0:Math.ceil(m/xt.length),Ze=dHr({initialOrderFactories:Yt,rotationBase:rt,getItemKey:(je)=>je.connection.connection.name,maximumOrderCount:ut}),Fe=[],tt=new Set,Je=function*(){while(!0){let je=Fe.shift(),st=je?{done:!1,value:je}:Ze.next();if(st.done)return;let St=st.value.map((Nt)=>Nt.connection.connection.name).join("|");if(tt.has(St))continue;tt.add(St),yield st.value}},$e=[],ft=new Set,vt=new Map,Ye=0;for(let je of Je())for(let st of xt){if(m!==void 0&&Ye>=m)return $e;Ye++;let St=[],Nt=new Map,Ot=!1;for(let _n=0;_n<je.length;_n++){let En=je[_n],Qn=JSON.stringify([s.indexOf(En),st,St.map(({connectionName:It,segment:bt})=>[It,bt.start.x,bt.start.y,bt.end.x,bt.end.y,bt.width,bt.layer])]),ln=vt.get(Qn),hn=dt({terminal:En,acceptedAttemptSegments:St,laneBias:st}),Zn=ln===void 0?hn.next():{done:!0,value:{points:null,expandedStateCount:ln.expandedStateCount}},bo=ln?.searchBatch??0,ir=0;while(!Zn.done)ir=Zn.value.expandedStateCount,yield{phase:"route-connection",routeOrderAttempt:Ye,connectionIndex:_n,connectionCount:je.length,connectionName:En.connection.connection.name,searchBatch:++bo,expandedStateCount:ir,connectionComplete:!1,...Zn.value.visualization?{visualization:Zn.value.visualization}:{}},Zn=hn.next();let{points:gt,expandedStateCount:Oe}=Zn.value;if(ir=Oe,yield{phase:"route-connection",routeOrderAttempt:Ye,connectionIndex:_n,connectionCount:je.length,connectionName:En.connection.connection.name,searchBatch:bo,expandedStateCount:ir,connectionComplete:!0,...n?{visualization:nt({terminal:En,acceptedAttemptSegments:St,expandedPoints:[],frontierPoints:[],bestPath:gt,expandedStateCount:ir,searchBatch:bo,connectionComplete:!0})}:{}},!gt){if(vt.set(Qn,{expandedStateCount:Oe,searchBatch:bo}),I&&m!==void 0&&_n>0){let It=je.filter((bt)=>bt!==En);Fe.push([En,...It])}Ot=!0;break}let mt=En.connection.connection.name;Nt.set(mt,gt),St.push(...pde(gt,l,i).map((It)=>({connectionName:mt,segment:It})))}if(Ot)continue;let Ut=s.map((_n)=>{let En=Nt.get(_n.connection.connection.name);if(!En)throw Error(`FanoutSolver: via-minimal winding route omitted "${_n.connection.connection.name}"`);return Ob({bus:r,terminal:_n,targetLayer:i,targetLayerPoints:En,sourceEscapePoints:e.sourceEscapePaths?.get(_n.connection.connectionIndex),layerNames:c,traceWidth:l,viaDiameter:h,viaHoleDiameter:d,allowBlindAndBuriedVias:_})}),mn=Ut.map((_n)=>_n.segments.map((En)=>`${En.start.x},${En.start.y},${En.end.x},${En.end.y},${En.layer}`).join(";")).join("|");if(ft.has(mn))continue;if(ft.add(mn),$e.push(Ut),$e.length>=t)return $e}return $e}function yHr(e,t=1){let n=G2(e,t),o=n.next();while(!o.done)o=n.next();return o.value}function X4n(e){return yHr(e,1)[0]??null}function zit(e){return e.allowViaInPad===!0}function th(e){return e==="left"||e==="right"}function jS(e){return e==="right"||e==="up"?1:-1}function J4(e,t){return th(t)?e.x:e.y}function Qd(e,t){return th(t)?e.y:e.x}function wb(e){return Vi(e.exitEdge,e.preferredExit)}function xHr(e){return Vi(kde(e.direction),e.preferredExit)}function KJ(e){return Boolean(e.exitEdge&&e.termination.type==="boundary"&&e.connections.length>0&&e.connections.every((t)=>t.hasExplicitLayeredExitTarget===!0))}function C9e(e){if("source_trace_id"in e&&typeof e.source_trace_id==="string")return e.source_trace_id;return e.name}function j4n(e){let{bus:t,boundaryDirection:n,layerNames:o,targetLayer:r}=e,i=(g)=>g.exitTargetPoint?.layer??Vit(g.targetPoint),s=(g,f)=>{let y=Qd(g.exitTargetPoint??g.targetPoint,n)-Qd(f.exitTargetPoint??f.targetPoint,n);if(y!==0)return y;let x=C9e(g.connection),C=C9e(f.connection),b=x.localeCompare(C);if(b!==0)return b;return g.connection.name.localeCompare(f.connection.name)||g.connectionIndex-f.connectionIndex},a=t.connections.toSorted((g,f)=>{let y=Qd(g.exitTargetPoint??g.targetPoint,n)-Qd(f.exitTargetPoint??f.targetPoint,n);if(y!==0)return y;return g.connection.name.localeCompare(f.connection.name)||C9e(g.connection).localeCompare(C9e(f.connection))||o.indexOf(i(g))-o.indexOf(i(f))||g.connectionIndex-f.connectionIndex}),c=new Map;for(let g of t.connections){let f=i(g),y=c.get(f)??[];y.push(g),c.set(f,y)}let l=[...c.keys()].toSorted((g,f)=>Number(f===r)-Number(g===r)||o.indexOf(g)-o.indexOf(f)||g.localeCompare(f)),h=new Map(l.map((g,f)=>[g,f])),d=new Map;for(let g of l)for(let[f,y]of c.get(g).toSorted(s).entries())d.set(y.connectionIndex,f);let u=t.connections.toSorted((g,f)=>(d.get(g.connectionIndex)??0)-(d.get(f.connectionIndex)??0)||(h.get(i(g))??0)-(h.get(i(f))??0)||s(g,f)),_=[u];for(let g=0;g+1<u.length;g++){let f=u[g],y=u[g+1];if(i(f)===i(y))continue;let x=[...u];x[g]=y,x[g+1]=f,_.push(x)}_.push(a);let p=new Set(_.map((g)=>g.map((f)=>f.connectionIndex).join(","))).size;if(!wb(t)&&t.connections.length<=8&&l.length>1){let g=l.map((C)=>c.get(C).toSorted(s)),f=g.map(()=>0),y=[],x=()=>{if(_.length>=128)return;if(y.length===t.connections.length){_.push([...y]);return}for(let C=0;C<g.length;C++){let b=f[C],I=g[C][b];if(!I)continue;f[C]=b+1,y.push(I),x(),y.pop(),f[C]=b}};x()}let m=new Set;return{orders:_.filter((g)=>{let f=g.map((y)=>y.connectionIndex).join(",");if(m.has(f))return!1;return m.add(f),!0}),legacyOrder:a,ordinaryOrderCount:p}}function K4n(e){let{connection:t,windingOrderIndex:n=0}=e,{orders:o,legacyOrder:r}=j4n(e),i=e.windingOrderIndex===void 0?r:o[n]??o[0]??r,s=i.findIndex((a)=>a.connectionIndex===t.connectionIndex);if(s<0)throw Error(`FanoutSolver: connection "${t.connection.name}" is missing from winding order`);return{rank:s,connectionCount:i.length}}function CHr(e){let{bus:t,escapeLayer:n}=e;return(t.routableEscapeLayers??t.allowedLayers)?.find((o)=>o!==n)}function wot(e){let{bus:t,boundaryDirection:n,traceWidth:o,clearance:r}=e;if(wb(t)||!KJ(t))return;let i=new Set(t.connections.map((d)=>d.exitTargetPoint?.layer??Vit(d.targetPoint))),s=th(n)?t.sharedBoundary.minY:t.sharedBoundary.minX,a=th(n)?t.sharedBoundary.maxY:t.sharedBoundary.maxX,c=t.connections.map((d)=>Math.max(s,Math.min(a,Qd(d.exitTargetPoint??d.targetPoint,n)))).toSorted((d,u)=>d-u),l=o+r;if((i.size<2||!e.allowLayerInterleaving)&&c.every((d,u)=>u===0||d-c[u-1]>=l-0.000000001))return;if(a-s<(c.length-1)*l-0.000000001)return;let h=[];for(let[d,u]of c.entries()){h.push({start:d,count:1,mean:u-d*l});while(h.length>1&&h.at(-2).mean>h.at(-1).mean){let _=h.pop(),p=h.pop();h.push({start:p.start,count:p.count+_.count,mean:(p.mean*p.count+_.mean*_.count)/(p.count+_.count)})}}for(let d of h){let u=Math.max(s,Math.min(a-(c.length-1)*l,d.mean));for(let _=d.start;_<d.start+d.count;_++)c[_]=u+_*l}return c}function fY(e){let t=e.fixedBoundaryTracksByConnectionIndex?.get(e.connection.connectionIndex);if(t!==void 0)return t;let n=Qd(e.connection.exitTargetPoint??e.connection.targetPoint,e.boundaryDirection),o=th(e.boundaryDirection)?e.bus.sharedBoundary.minY:e.bus.sharedBoundary.minX,r=th(e.boundaryDirection)?e.bus.sharedBoundary.maxY:e.bus.sharedBoundary.maxX,i=e.traceWidth!==void 0&&e.clearance!==void 0?wot({...e,traceWidth:e.traceWidth,clearance:e.clearance}):void 0;if(i&&e.layerNames&&e.targetLayer){let{rank:s}=K4n({...e,layerNames:e.layerNames,targetLayer:e.targetLayer});return i[s]}return Math.max(o,Math.min(r,n))}function Q9(e){let t=e.fixedBoundaryTracksByConnectionIndex?.get(e.connection.connectionIndex);if(t!==void 0)return t;let{bus:n,connection:o,cornerExitLaneOffset:r,traceWidth:i,viaDiameter:s,clearance:a,layerNames:c,targetLayer:l,windingOrderIndex:h,cornerBandTargetTrackOffset:d=0}=e,u=wb(n);if(!u||!n.exitEdge)return Qd(o.exitTargetPoint??o.targetPoint,n.direction);let _=zS(n.exitEdge),p=th(_)?n.sharedBoundary.minY:n.sharedBoundary.minX,m=th(_)?n.sharedBoundary.maxY:n.sharedBoundary.maxX,A=Math.max(i+a,s+a),g=p+(m-p)*(u==="minimum"?0.25:0.75)+d,f=KJ(n)?K4n({bus:n,connection:o,boundaryDirection:_,layerNames:c,targetLayer:l,windingOrderIndex:h}):void 0,y=Math.max(n.connections.length,n.cornerBandConnectionCount??n.connections.length,r+(f?.connectionCount??0)),x=g-(y-1)*A/2,C=f?.rank??Lde(n,o),b=r+C,v=!f&&u==="maximum"===jS(_)>0?y-1-b:b;return x+v*A}function Ggn(e,t){let n=wb(e);if(!n||!e.exitEdge)return{exit:0,localChannel:0,boundaryChannel:0};let o=t.filter((s)=>s.exitEdge&&s.cornerBandSide!==void 0),r=o.filter((s)=>s.exitEdge===e.exitEdge&&s.cornerBandSide===n),i=o.filter((s)=>s.direction===e.direction);return{exit:r.length,localChannel:i.length,boundaryChannel:r.length}}function EA(e,t,n){return th(n)?{x:e,y:t}:{x:t,y:e}}function DS(e,t=e.direction){switch(t){case"right":return e.sharedBoundary.maxX;case"left":return e.sharedBoundary.minX;case"up":return e.sharedBoundary.maxY;case"down":return e.sharedBoundary.minY}}function $J(e){return th(e.direction)?e.pitchX:e.pitchY}function $4n(e){return th(e.direction)?e.pitchY:e.pitchX}function Ugn(e,t){if(e.length<3)return[...e];let n=[e[0]];for(let o=1;o<e.length-1;o++){let r=e[o-1],i=e[o],s=e[o+1],a={x:i.x-r.x,y:i.y-r.y},c={x:s.x-i.x,y:s.y-i.y},l=Math.hypot(a.x,a.y),h=Math.hypot(c.x,c.y),d=Math.abs(a.x)<=0.000000001||Math.abs(a.y)<=0.000000001,u=Math.abs(c.x)<=0.000000001||Math.abs(c.y)<=0.000000001,_=Math.abs(a.x*c.x+a.y*c.y)<=0.000000001;if(l<=0.000000001||h<=0.000000001||!d||!u||!_){n.push(i);continue}let p=Math.min(t,l/3,h/3);n.push({x:i.x-a.x/l*p,y:i.y-a.y/l*p}),n.push({x:i.x+c.x/h*p,y:i.y+c.y/h*p})}return n.push(e.at(-1)),n.filter((o,r)=>r===0||Gt(o,n[r-1])>0.000000001)}function Wgn(e,t){let n=t.x-e.x,o=t.y-e.y,r=Math.abs(n),i=Math.abs(o);if(r<=0.000000001||i<=0.000000001||Math.abs(r-i)<=0.000000001)return[[e,t]];if(r>i)return[[e,{x:e.x+Math.sign(n)*i,y:t.y},t],[e,{x:t.x-Math.sign(n)*i,y:e.y},t]];return[[e,{x:t.x,y:e.y+Math.sign(o)*r},t],[e,{x:e.x,y:t.y-Math.sign(o)*r},t]]}function bHr(e){let t=(th(e.direction)?e.xCoordinates:e.yCoordinates).toSorted((r,i)=>r-i),n=e.connections.reduce((r,i)=>r+J4(i.sourcePoint,e.direction),0)/e.connections.length,o=jS(e.direction)>0?t.at(-1):t[0];return Math.abs(o-n)/$J(e)}function Oit(e){let t=th(e.direction)?e.xCoordinates:e.yCoordinates,n=e.connections.reduce((r,i)=>r+J4(i.sourcePoint,e.direction),0)/e.connections.length,o=jS(e.direction)>0?Math.max(...t):Math.min(...t);return Math.abs(n-o)<0.000001}function Lde(e,t){let n=[...e.connections].sort((o,r)=>Qd(o.sourcePoint,e.direction)-Qd(r.sourcePoint,e.direction)).findIndex((o)=>o.connectionIndex===t.connectionIndex);if(n<0)throw Error(`FanoutSolver: connection "${t.connection.name}" is missing from bus "${e.busId}"`);return n}function IHr(e,t){return{minX:Math.min(e.minX,t.minX),maxX:Math.max(e.maxX,t.maxX),minY:Math.min(e.minY,t.minY),maxY:Math.max(e.maxY,t.maxY)}}function Btt(e,t){return e.x>=t.minX-0.000001&&e.x<=t.maxX+0.000001&&e.y>=t.minY-0.000001&&e.y<=t.maxY+0.000001}function Ttt(e,t,n,o,r){let i=t-e,s=Math.floor((i-o)/(n+o)+0.000000001);if(s<1)return[];let a=s*n+(s-1)*o,c=e+(i-a)/2+n/2;return Array.from({length:s},(l,h)=>({value:c+h*(n+o),kind:r}))}function vHr(e){let{bus:t,connection:n,preferredTrack:o,traceWidth:r,clearance:i}=e,s=(th(t.direction)?t.yCoordinates:t.xCoordinates).toSorted((A,g)=>A-g),a=Math.max(...t.componentObstacles.map((A)=>th(t.direction)?A.height/2:A.width/2)),c=th(t.direction)?t.sharedBoundary.minY:t.sharedBoundary.minX,l=th(t.direction)?t.sharedBoundary.maxY:t.sharedBoundary.maxX,h=l-c,d=c,u=l,_=[{value:o,kind:"preferred"},...Ttt(d,s[0]-a,r,i,"margin")];for(let A=0;A<s.length;A++)if(_.push({value:s[A],kind:"corridor"}),A<s.length-1)_.push(...Ttt(s[A]+a,s[A+1]-a,r,i,"gap"));_.push(...Ttt(s.at(-1)+a,u,r,i,"margin"));let p=Qd(n.sourcePoint,t.direction),m=(s[0]+s.at(-1))/2;return _.filter((A)=>Math.abs(A.value-p)<=h+0.000000001).filter((A,g,f)=>f.findIndex((y)=>Math.abs(y.value-A.value)<0.000000001)===g).sort((A,g)=>Math.abs(A.value-o)-Math.abs(g.value-o)-(Math.abs(A.value-m)-Math.abs(g.value-m))*0.001)}function SHr(e){let t=wb(e.bus)||KJ(e.bus)?Qd(e.connection.sourcePoint,e.bus.direction):Qd(e.connection.exitTargetPoint??e.connection.targetPoint,e.bus.direction),n=th(e.bus.direction)?e.bus.sharedBoundary.minY:e.bus.sharedBoundary.minX,o=th(e.bus.direction)?e.bus.sharedBoundary.maxY:e.bus.sharedBoundary.maxX;return Math.max(n+e.traceWidth/2,Math.min(o-e.traceWidth/2,t))}function PHr(e){let{bus:t,connection:n,targetUsesVia:o,interstitialEscape:r,compactBusTracks:i,traceWidth:s,viaDiameter:a,clearance:c}=e,l=(th(t.direction)?t.yCoordinates:t.xCoordinates).toSorted((v,P)=>v-P),h=Qd(n.sourcePoint,t.direction);if(i){let v=Lde(t,n);return(l[0]+l.at(-1))/2+(v-(t.connections.length-1)/2)*(s+c)}if(!o||!r)return h;let d=bHr(t),u=s+c,_=Math.ceil(t.connections.length/2),p=(_-1)*u,m=a/2+s/2+c+0.001,A=Math.round(d)+1,g=A*m+(A-1)*p,f=Lde(t,n),y=l[0],x=l.at(-1),C=f<_?y-g-(_-f-1)*u:x+g+(f-_)*u,b=th(t.direction)?t.sharedBoundary.minY:t.sharedBoundary.minX,I=th(t.direction)?t.sharedBoundary.maxY:t.sharedBoundary.maxX;return Math.max(b+s/2,Math.min(I-s/2,C))}function q4n(e){let t=jS(e.direction),n=[...e.connections].sort((i,s)=>{let a=t*(J4(s.sourcePoint,e.direction)-J4(i.sourcePoint,e.direction));if(Math.abs(a)>0.000001)return a;return Qd(i.sourcePoint,e.direction)-Qd(s.sourcePoint,e.direction)}),o=[...e.connections].sort((i,s)=>Qd(i.sourcePoint,e.direction)-Qd(s.sourcePoint,e.direction)||t*(J4(s.sourcePoint,e.direction)-J4(i.sourcePoint,e.direction))),r=[n,[...n].reverse(),o,[...o].reverse()];for(let i=1;i<Math.min(n.length,8);i++)r.push([...n.slice(i),...n.slice(0,i)]);return r}function Xgn(e,t,n,o,r){if(Gt(t,n)<0.000000001)return;e.push({start:t,end:n,width:o,layer:r})}function Dtt(e,t){if(e.length<3)return e;let n=[e[0]];for(let o=1;o<e.length-1;o++){let r=e[o-1],i=e[o],s=e[o+1],a=Gt(r,i),c=Gt(i,s);if(a<0.000000001||c<0.000000001)continue;let l={x:(i.x-r.x)/a,y:(i.y-r.y)/a},h={x:(s.x-i.x)/c,y:(s.y-i.y)/c},d=l.x*h.x+l.y*h.y;if(Math.abs(d)>0.000001){n.push(i);continue}let u=Math.min(t,a/2,c/2);n.push({x:i.x-l.x*u,y:i.y-l.y*u}),n.push({x:i.x+h.x*u,y:i.y+h.y*u})}return n.push(e.at(-1)),n}function a8e(e){let{preparedConnection:t,bus:n,targetLayer:o,traceWidth:r,viaDiameter:i,clearance:s,viaHandedness:a}=e,c={x:t.sourcePoint.x,y:t.sourcePoint.y},l=o!==t.sourceLayer,h=$J(n),d=$4n(n),u=th(n.direction)?t.sourceObstacle.width:t.sourceObstacle.height,_=l&&!Oit(n)?u>=h?u/2+i/2+s+0.001:h*0.5:!l?u/2+r/2+s+0.001:Math.max(h*0.5,u/2+(l?i:r)/2+s+0.001),p=J4(c,n.direction)+jS(n.direction)*_,m=Qd(c,n.direction)+a*d*0.5;return EA(p,m,n.direction)}function Tve(e){let{preparedConnection:t,bus:n,targetLayer:o,track:r,exitAxis:i,layerNames:s,traceWidth:a,viaDiameter:c,viaHoleDiameter:l,viaHandedness:h,interstitialEscape:d,spreadLaneIndex:u,cornerExitLaneOffset:_,cornerLocalChannelLaneOffset:p,cornerBoundaryChannelLaneOffset:m,clearance:A,terminateAtVia:g,allowBlindAndBuriedVias:f,initialViaPoint:y,sourceEscapePath:x,cornerBandTargetTrackOffset:C,fixedBoundaryTracksByConnectionIndex:b}=e,I=b?.get(t.connectionIndex),v=wb(n),P=n.exitEdge?zS(n.exitEdge):n.direction,M=I!==void 0&&!v&&n.direction===P?I:r,B={x:t.sourcePoint.x,y:t.sourcePoint.y},T=o,N=KJ(n)?CHr({bus:n,escapeLayer:T}):void 0,D=Boolean(N),L=jS(n.direction),H=$J(n),V=x?.at(-1),O=V!==void 0?{x:V.x,y:V.y}:y===void 0?a8e({preparedConnection:t,bus:n,targetLayer:o,traceWidth:a,viaDiameter:c,clearance:A,viaHandedness:h}):{x:y.x,y:y.y},U=x?x.map((kt)=>({x:kt.x,y:kt.y})):[B,O];if(U.length<2||Gt(U[0],B)>0.000000001||Gt(U.at(-1),O)>0.000000001)throw Error(`FanoutSolver: source escape path for "${t.connection.name}" must run from its source point to its via`);let j=J4(O,n.direction),Y=Qd(O,n.direction),X=c/2+a/2+A+0.001+u*(a+A),K=d&&H>=X+c/2+A,J=K?EA(j+L*X,Y,n.direction):O,ee=K?J4(J,n.direction):j+L*Math.abs(M-Y),se=EA(ee,M,n.direction),ne=jS(P),re=DS(n,P),Z=I??(v&&n.exitEdge?Q9({bus:n,connection:t,cornerExitLaneOffset:_,traceWidth:a,viaDiameter:c,clearance:A,layerNames:s,targetLayer:o,cornerBandTargetTrackOffset:C}):D?fY({bus:n,connection:t,boundaryDirection:P,traceWidth:a,clearance:A,layerNames:s,targetLayer:o}):M),te=Lde(n,t),ce=xHr(n)==="maximum"?p+te:p+n.connections.length-1-te,ue=m+te,de=Math.max(n.connections.length,n.cornerBandConnectionCount??n.connections.length),me=ne>0?ue:de-1-ue,ge=D?c/2+a/2+A:a+A,xe=(kt)=>c/2+a/2+A+kt*ge,Ee=DS(n,n.direction)-L*xe(ce),Re=re-ne*xe(me),Me=EA(Ee,M,n.direction),_e=EA(Re,Ee,P),ye=EA(Re,Z,P),Se=th(n.direction)!==th(P)?_e:EA(Re,M,P),Ne=g?O:v||D||I!==void 0?EA(re,Z,P):EA(i,M,n.direction),Le=[],nt=[];nt.push({route_type:"wire",x:B.x,y:B.y,width:a,layer:t.sourceLayer,start_pcb_port_id:t.sourcePoint.pcb_port_id});for(let kt=1;kt<U.length;kt++){let Lt=U[kt-1],Bt=U[kt];if(Xgn(Le,Lt,Bt,a,t.sourceLayer),Gt(Lt,Bt)<=0.000000001)continue;nt.push({route_type:"wire",x:Bt.x,y:Bt.y,width:a,layer:t.sourceLayer})}let dt=Le.length,rt;if(o!==t.sourceLayer){let kt=t5({fromLayer:t.sourceLayer,toLayer:o,layerNames:s,allowBlindAndBuriedVias:f});rt={center:O,diameter:c,holeDiameter:l,fromLayer:t.sourceLayer,toLayer:o,spanLayers:kt},nt.push({route_type:"via",x:O.x,y:O.y,from_layer:t.sourceLayer,to_layer:o,via_diameter:c,via_hole_diameter:l}),nt.push({route_type:"wire",x:O.x,y:O.y,width:a,layer:o})}let pt=(kt,Lt)=>{for(let Bt=1;Bt<kt.length;Bt++){let xt=kt[Bt-1],Yt=kt[Bt];Xgn(Le,xt,Yt,a,Lt),nt.push({route_type:"wire",x:Yt.x,y:Yt.y,width:a,layer:Lt})}},ct=[];if(D&&N){let kt=Dtt([O,...K?[J]:[],se,...th(n.direction)!==th(P)?[Me]:[],Se],Math.max(a+A,a*2));pt(kt,T);let Lt=(Bt,xt,Yt)=>{if(xt===Yt)return;ct.push({center:Bt,diameter:c,holeDiameter:l,fromLayer:xt,toLayer:Yt,spanLayers:t5({fromLayer:xt,toLayer:Yt,layerNames:s,allowBlindAndBuriedVias:f})}),nt.push({route_type:"via",x:Bt.x,y:Bt.y,from_layer:xt,to_layer:Yt,via_diameter:c,via_hole_diameter:l}),nt.push({route_type:"wire",x:Bt.x,y:Bt.y,width:a,layer:Yt})};Lt(Se,T,N),pt([Se,ye],N),Lt(ye,N,T),pt([ye,Ne],T)}else{let kt=g?[O]:v?Dtt([O,...K?[J]:[],se,Me,...th(n.direction)!==th(P)?[_e]:[],ye,Ne],Math.max(a+A,a*2)):K?Dtt([O,J,se,Ne],Math.max(a+A,a*2)):[O,se,Ne];pt(kt,T)}let Ct=zY({connectionName:t.connection.name,sourcePointIndex:t.sourcePointIndex});return{busId:n.busId,connectionName:t.connection.name,connectionIndex:t.connectionIndex,sourcePointIndex:t.sourcePointIndex,sourcePoint:t.sourcePoint,sourceObstacle:t.sourceObstacle,sourceLayer:t.sourceLayer,targetPoint:t.targetPoint,targetLayer:o,termination:n.termination,direction:n.direction,...n.exitEdge?{exitEdge:n.exitEdge}:{},...v?{cornerBandSide:v}:{},exitPoint:Ne,trace:{type:"pcb_trace",pcb_trace_id:Ct.traceId,connection_name:t.connection.name,connectsTo:[...t.sourcePoint.pointId?[t.sourcePoint.pointId]:[],...t.sourcePoint.pcb_port_id?[t.sourcePoint.pcb_port_id]:[],Ct.boundaryExitPointId],route:nt},segments:Le,...dt>1?{sourceEscapeSegmentCount:dt}:{},via:rt,...ct.length>0?{additionalVias:ct}:{},length:Le.reduce((kt,Lt)=>kt+Gt(Lt.start,Lt.end),0)}}function Vit(e){let t="layer"in e?e.layer:e.layers[0];if(!t)throw Error("FanoutSolver: plane endpoint has no copper layer");return t}function Ntt(e){let{preparedConnection:t,bus:n,viaDiameter:o,clearance:r}=e,{sourcePoint:i,targetPoint:s}=t,a=Math.max(n.pitchX,n.pitchY)*0.5;if(Gt(i,s)<=0.000001||Gt(i,s)>a)return[];let c=(()=>{switch(n.direction){case"left":return{x:-1,y:0};case"right":return{x:1,y:0};case"up":return{x:0,y:1};case"down":return{x:0,y:-1}}})(),l=Math.SQRT1_2,h=[c,...[{x:l,y:l},{x:l,y:-l},{x:-l,y:l},{x:-l,y:-l},{x:1,y:0},{x:-1,y:0},{x:0,y:1},{x:0,y:-1}].toSorted((p,m)=>m.x*c.x+m.y*c.y-(p.x*c.x+p.y*c.y))],d=Math.max(o,o/2+r),u=[d,Math.max(d,Math.min(n.pitchX,n.pitchY)*0.5),Math.max(d,Math.min(n.pitchX,n.pitchY)*0.625),Math.max(d,Math.min(n.pitchX,n.pitchY)*0.75)],_=[];for(let p of[i,s])for(let m of u)for(let A of h){let g={x:p.x+A.x*m,y:p.y+A.y*m};if(Gt(g,i)<=0.000001||Gt(g,s)<=0.000001||_.some((f)=>Gt(f,g)<=0.000001))continue;_.push(g)}return _}function Rtt(e){let{plan:t,preparedConnection:n,planeLayer:o,viaPoint:r,layerNames:i,traceWidth:s,viaDiameter:a,viaHoleDiameter:c,allowBlindAndBuriedVias:l}=e,h={x:n.targetPoint.x,y:n.targetPoint.y},d=Vit(n.targetPoint),u=t5({fromLayer:o,toLayer:d,layerNames:i,allowBlindAndBuriedVias:l});if(!u.includes(o))throw Error(`FanoutSolver: via for "${n.connection.name}" does not cross plane ${o}`);let _=[{start:r,end:h,width:s,layer:d}],p={center:r,diameter:a,holeDiameter:c,fromLayer:o,toLayer:d,spanLayers:u},m=zY({connectionName:n.connection.name,sourcePointIndex:n.sourcePointIndex}),A={type:"pcb_trace",pcb_trace_id:m.planeEndpointTraceId,connection_name:n.connection.name,connectsTo:[...n.targetPoint.pointId?[n.targetPoint.pointId]:[],...n.targetPoint.pcb_port_id?[n.targetPoint.pcb_port_id]:[],m.planeEndpointPointId],route:[{route_type:"wire",...r,width:s,layer:o},{route_type:"via",...r,from_layer:o,to_layer:d,via_diameter:a,via_hole_diameter:c},{route_type:"wire",...r,width:s,layer:d},{route_type:"wire",...h,width:s,layer:d}]};return{...t,planeEndpointTrace:A,planeEndpointSegments:_,planeEndpointVia:p,length:t.length+_.reduce((g,f)=>g+Gt(f.start,f.end),0)}}function EHr(e){let{segment:t,plan:n,segmentIndex:o,srj:r,allowSameNetMerges:i,obstacles:s,clearance:a}=e;for(let c of s){if(!c.layers.includes(t.layer))continue;if(c.connectedTo.includes(n.connectionName))continue;if(i&&kb(r,c,n.connectionName))continue;if(Mue({inputSrj:r,segment:t,bodyObstacle:c,connectionName:n.connectionName}))continue;if(o>=0&&o<(n.sourceEscapeSegmentCount??1)&&c===n.sourceObstacle&&t.layer===n.sourceLayer)continue;if(Cl(t,c)<t.width/2+a-0.000000001)return!1}return!0}function pB(e){return e.planeEndpointSegments?.length?[...e.segments,...e.planeEndpointSegments]:e.segments}function qJ(e){return[e.via,...e.additionalVias??[],e.planeEndpointVia].filter((t)=>Boolean(t))}function MHr(e,t){return Gt(t.center,e.sourcePoint)<=0.000000001&&d7e({center:t.center,diameter:t.diameter,obstacle:e.sourceObstacle})}function Yit(e){let{plan:t,srj:n,sharedBoundary:o,clearance:r,allowBlindAndBuriedVias:i,allowSameNetMerges:s}=e,a=IHr(n.bounds,o);if(!Btt(t.exitPoint,a)||pB(t).some((h)=>!Btt(h.start,a)||!Btt(h.end,a)))return!1;let c=pB(t),l;if(e.segmentCache){let h=e.segmentCache.byConnection.get(t.connectionName);if(!h)h=new WeakMap,e.segmentCache.byConnection.set(t.connectionName,h);if(l=h.get(t.sourceObstacle),!l)l=[new WeakMap,new WeakMap],h.set(t.sourceObstacle,l)}for(let h=0;h<c.length;h++){let d=c[h],u=h<t.segments.length?h:-1,_=u>=0&&u<(t.sourceEscapeSegmentCount??1)&&d.layer===t.sourceLayer,p=l?.[_?1:0],m=p?.get(d);if(m===void 0)m=EHr({segment:d,plan:t,segmentIndex:u,srj:n,allowSameNetMerges:s,obstacles:e.segmentCache?e.segmentCache.obstaclesByLayer.get(d.layer)??[]:n.obstacles,clearance:r}),p?.set(d,m);if(!m)return!1}for(let h of qJ(t))for(let d of n.obstacles){if(zit(n)&&d===t.sourceObstacle&&MHr(t,h))continue;if(!d.layers.some((u)=>h.spanLayers.includes(u)))continue;if(s&&kb(n,d,t.connectionName))continue;if(r5(h.center,d)<h.diameter/2+r-0.000000001)return!1}for(let h of oP(n,i)){if(t.connectionName===h.connectionName||s&&e5(n,t.connectionName,h.connectionName))continue;for(let d of pB(t)){for(let u of h.segments)if(!u_(d,u,r))return!1;for(let u of h.vias)if(u.spanLayers.includes(d.layer)&&Hr(u.center,d.start,d.end)<u.diameter/2+d.width/2+r-0.000000001)return!1}for(let d of qJ(t)){for(let u of h.segments)if(d.spanLayers.includes(u.layer)&&Hr(d.center,u.start,u.end)<d.diameter/2+u.width/2+r-0.000000001)return!1;for(let u of h.vias)if(d.spanLayers.some((_)=>u.spanLayers.includes(_))&&Gt(d.center,u.center)<(d.diameter+u.diameter)/2+r-0.000000001)return!1}}return!0}function p7e(e){let{plan:t,otherPlans:n,srj:o,allowSameNetMerges:r,clearance:i,blockingBusCounts:s,segmentIndexes:a}=e,c=pB(t),l=qJ(t);for(let h of n){if(r&&e5(o,t.connectionName,h.connectionName))continue;if(t.sourcePoint.pcb_port_id&&t.sourcePoint.pcb_port_id===h.sourcePoint.pcb_port_id||t.sourcePoint.pointId&&t.sourcePoint.pointId===h.sourcePoint.pointId)continue;let u=()=>{if(h.busId===t.busId)return;s?.set(h.busId,(s.get(h.busId)??0)+1)},_=pB(h),p=qJ(h),m=a?.get(h);if(a&&!m)m=new wue(_),a.set(h,m);for(let A of c){for(let g of m?.querySegment(A,i)??_)if(!u_(A,g,i))return u(),!1;for(let g of p)if(g.spanLayers.includes(A.layer)&&Hr(g.center,A.start,A.end)<g.diameter/2+A.width/2+i-0.000000001)return u(),!1}for(let A of l){for(let g of m?.queryVia(A,i)??_)if(A.spanLayers.includes(g.layer)&&Hr(A.center,g.start,g.end)<A.diameter/2+g.width/2+i-0.000000001)return u(),!1;for(let g of p)if(A.spanLayers.some((f)=>g.spanLayers.includes(f))&&Gt(A.center,g.center)<(A.diameter+g.diameter)/2+i-0.000000001)return u(),!1}}return!0}function jgn(e){let{plans:t,srj:n,clearance:o,allowSameNetMerges:r=!1}=e;return t.every((i,s)=>p7e({plan:i,otherPlans:t.filter((a,c)=>c!==s),srj:n,allowSameNetMerges:r,clearance:o}))}function Dve(e){let{plan:t,otherPlans:n,staticClearanceCache:o,blockingBusCounts:r,cacheKey:i,srj:s,sharedBoundary:a,clearance:c,allowBlindAndBuriedVias:l,allowSameNetMerges:h}=e,d=o?.get(i);if(d===void 0)d=Yit({plan:t,srj:s,sharedBoundary:a,clearance:c,allowBlindAndBuriedVias:l,allowSameNetMerges:h}),o?.set(i,d);return d&&p7e({plan:t,otherPlans:n,srj:s,allowSameNetMerges:h,clearance:c,blockingBusCounts:r})}function q0(e){let{plans:t,srj:n,sharedBoundary:o,clearance:r,allowBlindAndBuriedVias:i=!0,allowSameNetMerges:s=!1,allowSameNetPlaneMerges:a=!1}=e;for(let c=0;c<t.length;c++){let l=t[c];if(!Yit({plan:l,srj:n,sharedBoundary:o,clearance:r,allowBlindAndBuriedVias:i,allowSameNetMerges:s||a&&l.termination.type==="plane"}))return!1;let h=t.filter((d,u)=>u!==c&&!(a&&l.termination.type==="plane"&&d.termination.type==="plane"&&e5(n,l.connectionName,d.connectionName)));if(!p7e({plan:l,otherPlans:h,srj:n,allowSameNetMerges:s,clearance:r}))return!1}return!0}function m7e(e){let{srj:t,sharedBoundary:n,clearance:o,allowBlindAndBuriedVias:r=!0,allowSameNetMerges:i=!1,allowSameNetPlaneMerges:s=!1}=e,a={obstaclesByLayer:new Map,byConnection:new Map};for(let A of t.obstacles)for(let g of A.layers){let f=a.obstaclesByLayer.get(g)??[];f.push(A),a.obstaclesByLayer.set(g,f)}let c=s&&!i?{obstaclesByLayer:a.obstaclesByLayer,byConnection:new Map}:a,l=new WeakMap,h=new WeakMap,d=new WeakMap,u=new Set,_=(A)=>{let g=h.get(A);if(g===void 0)g=Yit({segmentCache:A.termination.type==="plane"?c:a,plan:A,srj:t,sharedBoundary:n,clearance:o,allowBlindAndBuriedVias:r,allowSameNetMerges:i||s&&A.termination.type==="plane"}),h.set(A,g);return g},p=(A,g)=>{let f=d.get(A);if(!f)f=new WeakMap,d.set(A,f);let y=f.get(g);if(y===void 0){let x=pB(A).length>pB(g).length;y=p7e({plan:x?g:A,otherPlans:[x?A:g],segmentIndexes:l,srj:t,clearance:o,allowSameNetMerges:i||s&&A.termination.type==="plane"&&g.termination.type==="plane"}),f.set(g,y);let C=d.get(g);if(!C)C=new WeakMap,d.set(g,C);C.set(A,y)}return y};return Object.assign((A)=>{let g=new Set(A);if(g.size===A.length){let f=A.filter((y)=>!u.has(y));for(let y of A){let x=u.has(y);if(!x&&!_(y))return!1;for(let C of x?f:A){if(y===C)continue;if(!p(y,C))return!1}}}else for(let[f,y]of A.entries()){if(!_(y))return!1;for(let[x,C]of A.entries())if(x!==f&&!p(y,C))return!1}return u=g,!0},{mutuallyClear:(A)=>A.every((g,f)=>A.every((y,x)=>x===f?!0:p(g,y)))})}function Kgn(e){let{srj:t,bus:n,targetLayer:o,acceptedPlans:r,layerNames:i,traceWidth:s,viaDiameter:a,viaHoleDiameter:c,clearance:l,staticClearanceCache:h,blockingBusCounts:d,allowBlindAndBuriedVias:u=!0,allowSameNetMerges:_=!1,fixedViaPointsByConnectionIndex:p,planeCandidateSkipCount:m=0}=e,A=n.connections[0]?.sourceObstacle;if(!A||n.termination.type!=="plane")return null;let g=n.connections[0].sourceLayer;if(o===g)return null;let f=m,y=(b,I)=>{for(let[v,P]of b.entries()){if(!I(P,v))continue;if(f>0){f--;continue}if(e.collectAlternative&&!e.collectAlternative(P))continue;return P}return};if(p){let b=[];for(let I of n.connections){let v=p.get(I.connectionIndex);if(!v)return null;let P={x:I.sourcePoint.x,y:I.sourcePoint.y},M=Tve({preparedConnection:I,bus:n,targetLayer:o,track:Qd(P,n.direction),exitAxis:DS(n),layerNames:i,traceWidth:s,viaDiameter:a,viaHoleDiameter:c,viaHandedness:0,interstitialEscape:!1,spreadLaneIndex:0,cornerExitLaneOffset:0,cornerLocalChannelLaneOffset:0,cornerBoundaryChannelLaneOffset:0,clearance:l,terminateAtVia:!0,allowBlindAndBuriedVias:u,initialViaPoint:v,sourceEscapePath:e.sourceEscapePaths?.get(I.connectionIndex)?[...e.sourceEscapePaths.get(I.connectionIndex)]:[P,v]}),T=[...Ntt({preparedConnection:I,bus:n,viaDiameter:a,clearance:l}).map((D)=>Rtt({plan:M,preparedConnection:I,planeLayer:o,viaPoint:D,layerNames:i,traceWidth:s,viaDiameter:a,viaHoleDiameter:c,allowBlindAndBuriedVias:u})),M],N=y(T,(D,L)=>Dve({plan:D,otherPlans:[...r,...b],staticClearanceCache:h,blockingBusCounts:d,cacheKey:`plane-fixed:${n.busId}:${o}:${I.connectionIndex}:${v.x}:${v.y}:${L}`,srj:t,sharedBoundary:n.sharedBoundary,clearance:l,allowBlindAndBuriedVias:u,allowSameNetMerges:_}));if(!N)return null;b.push(N)}return b}if(zit(t)&&n.connections.length===1&&d7e({center:n.connections[0].sourcePoint,diameter:a,obstacle:A})){let b=n.connections[0],I=Tve({preparedConnection:b,bus:n,targetLayer:o,track:Qd(b.sourcePoint,n.direction),exitAxis:DS(n),layerNames:i,traceWidth:s,viaDiameter:a,viaHoleDiameter:c,viaHandedness:0,interstitialEscape:!1,spreadLaneIndex:0,cornerExitLaneOffset:0,cornerLocalChannelLaneOffset:0,cornerBoundaryChannelLaneOffset:0,clearance:l,terminateAtVia:!0,allowBlindAndBuriedVias:u,initialViaPoint:b.sourcePoint}),P=[...Ntt({preparedConnection:b,bus:n,viaDiameter:a,clearance:l}).map((B)=>Rtt({plan:I,preparedConnection:b,planeLayer:o,viaPoint:B,layerNames:i,traceWidth:s,viaDiameter:a,viaHoleDiameter:c,allowBlindAndBuriedVias:u})),I],M=y(P,(B,T)=>Dve({plan:B,otherPlans:r,staticClearanceCache:h,blockingBusCounts:d,cacheKey:`plane-via-in-pad:${n.busId}:${o}:${T}`,srj:t,sharedBoundary:n.sharedBoundary,clearance:l,allowBlindAndBuriedVias:u,allowSameNetMerges:_}));if(M)return[M]}let x=[n.direction,...["left","right","up","down"].filter((b)=>b!==n.direction)],C=[...x.map((b)=>({direction:b,centeredOutward:!1})),...x.map((b)=>({direction:b,centeredOutward:!0}))];for(let{direction:b,centeredOutward:I}of C){let v=b===n.direction?n:{...n,direction:b},P=th(b)?A.width:A.height,M=$J(v)/2-P/2>=a/2+l-0.000000001,B=I?!M&&Oit(v)?[0]:[]:M?[0]:[1,-1];for(let T of B)for(let N of q4n(v)){let D=[],L=!0;for(let H of N){let V=Qd(H.sourcePoint,b),O=a8e({preparedConnection:H,bus:v,targetLayer:o,traceWidth:s,viaDiameter:a,clearance:l,viaHandedness:T}),U=$J(v),j=jS(b),Y=DS(v,b),X=j*(Y-J4(O,b))-(a/2+l),K=Math.max(0,Math.floor(X/U)),J={x:H.sourcePoint.x,y:H.sourcePoint.y},ee=J4(O,b),se=Qd(O,b),ne=$4n(v),re=[],Z=128;for(let ie=0;ie<=K&&re.length<128;ie++){let ce=EA(ee+j*ie*U,se,b);if(ie===0)re.push([J,O]);else{for(let ue of Wgn(J,ce))if(re.push(ue),re.length>=128)break;if(re.length<128)re.push([J,O,ce])}for(let ue=1;ue<=Math.min(3,ie-1)&&re.length<128;ue++){let de=ie-ue;if(de<1||de>K)continue;for(let me of[-1,1]){let ge=se+me*ue*ne,xe=EA(ee,ge,b),Ee=EA(ee+j*de*U,se,b),Re=EA(ee+j*de*U,ge,b),Me=Math.min(U,ne)*0.2;for(let _e of Wgn(J,Re))if(re.push(_e),re.length>=128)break;if(re.length>=128)break;if(re.push(Ugn([J,O,xe,Re],Me),Ugn([J,O,Ee,Re],Me)),re.length>=128)break}}}let te;for(let[ie,ce]of re.entries()){let ue=Tve({preparedConnection:H,bus:v,targetLayer:o,track:V,exitAxis:DS(v),layerNames:i,traceWidth:s,viaDiameter:a,viaHoleDiameter:c,viaHandedness:T,interstitialEscape:!M,spreadLaneIndex:0,cornerExitLaneOffset:0,cornerLocalChannelLaneOffset:0,cornerBoundaryChannelLaneOffset:0,clearance:l,terminateAtVia:!0,allowBlindAndBuriedVias:u,sourceEscapePath:ce}),me=[...Ntt({preparedConnection:H,bus:v,viaDiameter:a,clearance:l}).map((ge)=>Rtt({plan:ue,preparedConnection:H,planeLayer:o,viaPoint:ge,layerNames:i,traceWidth:s,viaDiameter:a,viaHoleDiameter:c,allowBlindAndBuriedVias:u})),ue];if(te=y(me,(ge,xe)=>Dve({plan:ge,otherPlans:[...r,...D],staticClearanceCache:h,blockingBusCounts:d,cacheKey:`plane:${n.busId}:${o}:${b}:${H.connectionIndex}:${T}:${ie}:${xe}`,srj:t,sharedBoundary:n.sharedBoundary,clearance:l,allowBlindAndBuriedVias:u,allowSameNetMerges:_})),te)break}if(!te){L=!1;break}D.push(te)}if(L)return D}}return null}function*_7e(e,t=1,n=!1){let{srj:o,bus:r,targetLayer:i,acceptedPlans:s,layerNames:a,traceWidth:c,viaDiameter:l,viaHoleDiameter:h,clearance:d,compactBusTracks:u,staticClearanceCache:_,blockingBusCounts:p,allowBlindAndBuriedVias:m=!0,allowSameNetMerges:A=!1,rejectedViaMinimalCandidates:g,stopAfterFirstRejectedViaMinimalCandidate:f=!1,fixedViaPointsByConnectionIndex:y,fixedBoundaryTracksByConnectionIndex:x,reservedVias:C=[],softReservedVias:b=[],viaMinimalOnly:I=!1,allowBoundarySideViaFallback:v=!1,preferCornerBoundaryVia:P=!1,adaptiveWindingRouteOrder:M=!1,alignWindingGridToPads:B=!1,fixedViaFallbackRouteOrderAttempts:T=24,allowFixedViaReservedExitFallback:N=!1,cornerBandTargetTrackOffset:D,cornerExitLaneOffset:L,forbidEarlyExitBoundaryContact:H=!1}=e;if(!Number.isInteger(t)||t<1)throw Error(`FanoutSolver: maxAlternatives must be a positive integer, received ${t}`);if(L!==void 0&&(!Number.isSafeInteger(L)||L<0))throw Error(`FanoutSolver: cornerExitLaneOffset must be a non-negative safe integer, received ${L}`);if(y&&r.connections.some((ce)=>!y.has(ce.connectionIndex)))return[];if(r.termination.type==="plane"){let ce=[];if(r.connections.length===1&&t>1)return Kgn({...e,planeCandidateSkipCount:0,collectAlternative:(ue)=>(ce.push([ue]),ce.length>=t)}),ce;for(let ue=0;ue<t;ue++){let de=Kgn({...e,planeCandidateSkipCount:ue});if(!de)break;ce.push(de)}return ce}if(x){if(!r.exitEdge)throw Error("FanoutSolver: fixed boundary tracks require an exit edge");let ce=r.exitEdge==="left"||r.exitEdge==="right",ue=ce?r.sharedBoundary.minY:r.sharedBoundary.minX,de=ce?r.sharedBoundary.maxY:r.sharedBoundary.maxX;for(let me of r.connections){let ge=x.get(me.connectionIndex);if(ge===void 0||!Number.isFinite(ge)||ge<ue-0.000000001||ge>de+0.000000001)throw Error(`FanoutSolver: invalid fixed boundary track for ${me.connection.name}`)}}let V=DS(r),O=r.connections[0]?.sourceObstacle;if(!O)return[[]];let U=th(r.direction)?O.width:O.height,j=r.connections[0].sourceLayer,Y=i!==j,X=Oit(r),K=$J(r)/2-U/2>=l/2+d-0.000000001,J=Y&&!X&&!K,ee=Y?K||X?[0]:m?[1,-1]:[-1,1]:[0],se=(()=>{if(m)return ee;if(ee.length!==2||!ee.includes(-1)||!ee.includes(1))return ee;let ce=r.connections.reduce((de,me)=>de+Qd(me.sourcePoint,r.direction),0)/r.connections.length,ue=r.connections.reduce((de,me)=>de+Qd(me.exitTargetPoint??me.targetPoint,r.direction),0)/r.connections.length;if(ue>ce+0.000000001)return[-1,1];if(ue<ce-0.000000001)return[1,-1];return ee})(),ne=[],re=new Set,Z=Ggn(r,s);if(L!==void 0)Z.exit=L;let te=(ce)=>{if(x&&ce.some((de)=>{let me=x.get(de.connectionIndex),ge=r.exitEdge==="left"||r.exitEdge==="right"?de.exitPoint.y:de.exitPoint.x;return Math.abs(ge-me)>0.000000001}))return;let ue=ce.map((de)=>`${de.connectionIndex}:${de.targetLayer}:${de.exitPoint.x}:${de.exitPoint.y}:${de.segments.map((me)=>`${me.start.x},${me.start.y},${me.end.x},${me.end.y},${me.layer}`).join(";")}`).join("|");if(re.has(ue))return;re.add(ue),ne.push(ce)};if(!KJ(r)&&r.exitEdge&&r.connections.length===1&&a.includes(i)&&(r.allowedLayers===void 0||r.allowedLayers.includes(i))&&(r.routableEscapeLayers===void 0||r.routableEscapeLayers.includes(i))&&r.connections[0].sourceLayer!==i&&y&&e.sourceEscapePaths?.has(r.connections[0].connectionIndex)){let ce=r.connections[0],ue=zS(r.exitEdge),de=G2({srj:o,bus:r,targetLayer:i,terminals:[{connection:ce,viaPoint:y.get(ce.connectionIndex),exitPoint:EA(DS(r,ue),fY({fixedBoundaryTracksByConnectionIndex:x,bus:r,connection:ce,boundaryDirection:ue}),ue)}],acceptedPlans:s,layerNames:a,traceWidth:c,viaDiameter:l,viaHoleDiameter:h,clearance:d,allowBlindAndBuriedVias:m,allowSameNetMerges:A,maximumRouteOrderAttempts:3,reservedVias:C,softReservedVias:b,gridStepDivisor:2,gridStep:e.windingGridStep,alignGridToPads:B,sourceEscapePaths:e.sourceEscapePaths,heuristicWeight:e.windingHeuristicWeight,forbidEarlyExitBoundaryContact:H},t,n),me=de.next();while(!me.done)yield{phase:"via-minimal-winding",busId:r.busId,targetLayer:i,winding:me.value},me=de.next();for(let ge of me.value){if(!q0({plans:[...s,...ge],srj:o,sharedBoundary:r.sharedBoundary,clearance:d,allowBlindAndBuriedVias:m,allowSameNetMerges:A}))continue;if(te(ge),ne.length>=t)return ne}}if(KJ(r)&&r.exitEdge){let ce=zS(r.exitEdge),ue=DS(r,ce),de=wb(r),me=zit(o)&&r.connections.every((Ze)=>d7e({center:Ze.sourcePoint,diameter:l,obstacle:Ze.sourceObstacle})),ge=24,xe=Boolean(de||wot({bus:r,boundaryDirection:ce,traceWidth:c,clearance:d})),Ee=j4n({bus:r,boundaryDirection:ce,layerNames:a,targetLayer:i}),Re=Ee.orders.length,Me=xe?Ee.ordinaryOrderCount:1,_e=se.map((Ze)=>({label:`uniform-${Ze}`,useViaInPad:!1,getViaHandedness:()=>Ze,maximumRouteOrderAttempts:m?void 0:24})),ye=r.connections.toSorted((Ze,Fe)=>Qd(Ze.sourcePoint,r.direction)-Qd(Fe.sourcePoint,r.direction)||J4(Ze.sourcePoint,r.direction)-J4(Fe.sourcePoint,r.direction)||Ze.connectionIndex-Fe.connectionIndex),Se=new Map(ye.map((Ze,Fe)=>[Ze.connectionIndex,Fe])),Ne=(Ze)=>Ze<ye.length/2?1:-1,Le=Math.floor(ye.length/2),nt=[0,1,Le,Le+1,...ye.map((Ze,Fe)=>Fe)].filter((Ze,Fe,tt)=>Ze>=0&&Ze<ye.length&&tt.indexOf(Ze)===Fe),dt=[[Le],[Le+1],[0],[1],[0,Le+1],[1,Le],[0,Le],[1,Le+1],[0,1],[Le,Le+1],...nt.map((Ze)=>[Ze])].map((Ze)=>Ze.filter((Fe)=>Fe>=0&&Fe<ye.length).toSorted((Fe,tt)=>Fe-tt)).filter((Ze,Fe,tt)=>Ze.length>0&&tt.findIndex((Je)=>Je.join(",")===Ze.join(","))===Fe),rt=!m&&(C.length>0||s.some((Ze)=>Ze.termination.type==="plane"))&&se.includes(-1)&&se.includes(1)?[{label:"toward-source-median",useViaInPad:!1,maximumRouteOrderAttempts:24,getViaHandedness:(Ze)=>Ne(Se.get(Ze.connectionIndex)??0)},...dt.slice(0,12).map((Ze)=>({label:`toward-source-median-with-ranks-${Ze.join("-")}-flipped`,useViaInPad:!1,maximumRouteOrderAttempts:6,getViaHandedness:(Fe)=>{let tt=Se.get(Fe.connectionIndex)??0,Je=Ne(tt);return Ze.includes(tt)?-Je:Je}})),{label:"alternating-source-grid-a",useViaInPad:!1,maximumRouteOrderAttempts:3,getViaHandedness:(Ze)=>(Se.get(Ze.connectionIndex)??0)%2===0?-1:1},{label:"alternating-source-grid-b",useViaInPad:!1,maximumRouteOrderAttempts:3,getViaHandedness:(Ze)=>(Se.get(Ze.connectionIndex)??0)%2===0?1:-1},{label:"away-from-source-median",useViaInPad:!1,maximumRouteOrderAttempts:24,getViaHandedness:(Ze)=>(Se.get(Ze.connectionIndex)??0)<ye.length/2?-1:1}]:[],pt={label:"via-in-pad",useViaInPad:!0,getViaHandedness:()=>0},ct=y??(!m&&(r.connections.length>=8||wot({bus:r,boundaryDirection:ce,traceWidth:c,clearance:d}))&&C.length===0?Yu([r],{viaDiameter:l,viaHoleDiameter:h,traceWidth:c,clearance:d,additionalObstacles:o.obstacles,blockingSegments:s.flatMap((Ze)=>pB(Ze).map((Fe)=>({connectionIndex:Ze.connectionIndex,segment:Fe}))),blockingVias:s.flatMap((Ze)=>qJ(Ze).map((Fe)=>({connectionIndex:Ze.connectionIndex,...Fe.center,center:Fe.center,diameter:Fe.diameter,spanLayers:Fe.spanLayers})))}):null),Ct=ct?[...Array.from({length:Me},(Ze,Fe)=>({label:`component-matched-vias-winding-${Fe}`,useViaInPad:!1,getViaHandedness:()=>0,getViaPoint:(tt)=>ct.get(tt.connectionIndex),maximumRouteOrderAttempts:1,windingOrderIndex:Fe,preferTargetDirectedLaneBias:!0})),{label:"component-matched-vias-fallback",useViaInPad:!1,getViaHandedness:()=>0,getViaPoint:(Ze)=>ct.get(Ze.connectionIndex),maximumRouteOrderAttempts:T,windingOrderIndex:0,preferTargetDirectedLaneBias:!0},...!wb(r)&&Re>1?Array.from({length:Re},(Ze,Fe)=>[!0,!1].map((tt)=>({label:`expanded-winding-${Fe}-${tt}`,useViaInPad:!1,getViaHandedness:()=>0,getViaPoint:(Je)=>ct.get(Je.connectionIndex),maximumRouteOrderAttempts:1,windingOrderIndex:Fe,preferTargetDirectedLaneBias:tt,reserveTerminalExitPoints:!tt,allowLayerInterleaving:!0}))).flat():[],...N&&y&&!wb(r)&&Re===1&&r.connections.length>2?[!0,!1].map((Ze)=>({label:`fixed-vias-reserved-exits-${Ze}`,useViaInPad:!1,getViaHandedness:()=>0,getViaPoint:(Fe)=>ct.get(Fe.connectionIndex),maximumRouteOrderAttempts:Math.min(24,T),windingOrderIndex:0,preferTargetDirectedLaneBias:Ze,reserveTerminalExitPoints:!0})):[]]:[],kt=s.some((Ze)=>Ze.termination.type==="plane"),Bt=s.some((Ze)=>Ze.termination.type==="boundary")&&!m?[...rt,..._e]:[..._e,...rt],xt=me?kt?[pt,...Bt]:[...Bt,pt]:Bt,Yt=y?Ct:[...Ct,...xt];if(!y&&!m&&r.connections.length>1&&r.connections.every((Ze)=>Ze.sourceLayer!==i)&&se.includes(-1)&&se.includes(1)){let Ze=jLr(r.connections,r.direction);for(let Fe of se)for(let tt of Ze)Yt.push({label:`local-dogbone-repair-${Fe}-${tt.join("-")}`,useViaInPad:!1,getViaHandedness:()=>Fe,maximumRouteOrderAttempts:6,localDogboneRepair:!0,getViaPoint:(Je)=>{let $e=a8e({preparedConnection:Je,bus:r,targetLayer:i,traceWidth:c,viaDiameter:l,clearance:d,viaHandedness:Fe});if(!tt.includes(Je.connectionIndex))return $e;return r.direction==="up"||r.direction==="down"?{x:$e.x,y:2*Je.sourcePoint.y-$e.y}:{x:2*Je.sourcePoint.x-$e.x,y:$e.y}}})}if(B&&de&&L===void 0){let Ze=Ggn(r,s.filter((Fe)=>Fe.targetLayer===i)).exit;if(Ze!==Z.exit)Yt.push(...Yt.map((Fe)=>({...Fe,label:`${Fe.label}-layer-local-corner`,cornerExitLaneOffset:Ze})))}let ut=new Set;for(let Ze of Yt){let Fe=r.connections.map((je)=>{let st=Ze.getViaHandedness(je),St=de?Q9({fixedBoundaryTracksByConnectionIndex:x,bus:r,connection:je,cornerExitLaneOffset:Ze.cornerExitLaneOffset??Z.exit,traceWidth:c,viaDiameter:l,clearance:d,layerNames:a,targetLayer:i,windingOrderIndex:Ze.windingOrderIndex,cornerBandTargetTrackOffset:D}):fY({fixedBoundaryTracksByConnectionIndex:x,allowLayerInterleaving:Ze.allowLayerInterleaving,bus:r,connection:je,boundaryDirection:ce,traceWidth:c,clearance:d,layerNames:a,targetLayer:i,windingOrderIndex:Ze.windingOrderIndex});return{connection:je,viaPoint:Ze.getViaPoint?Ze.getViaPoint(je):Ze.useViaInPad?{x:je.sourcePoint.x,y:je.sourcePoint.y}:a8e({preparedConnection:je,bus:r,targetLayer:i,traceWidth:c,viaDiameter:l,clearance:d,viaHandedness:st}),exitPoint:EA(ue,St,ce)}}),tt=B||Boolean(Ze.getViaPoint&&!y);if(Ze.localDogboneRepair&&!Yu([r],{viaDiameter:l,viaHoleDiameter:h,traceWidth:c,clearance:d,additionalObstacles:o.obstacles,fixedViaPointsByConnectionIndex:new Map(Fe.map((je)=>[je.connection.connectionIndex,je.viaPoint])),blockingSegments:s.flatMap((je)=>pB(je).map((st)=>({connectionIndex:je.connectionIndex,segment:st}))),blockingVias:[...s.flatMap((je)=>qJ(je).map((st)=>({connectionIndex:je.connectionIndex,center:st.center,diameter:st.diameter,spanLayers:st.spanLayers}))),...C.map(({via:je})=>({connectionIndex:-1,...je}))]}))continue;let Je=Ze.getViaPoint&&Math.min(r.pitchX,r.pitchY)-2*(l/2+c/2+d)<c+d?2:1,$e=`${Fe.map((je)=>`${je.connection.connectionIndex}:${je.viaPoint.x}:${je.viaPoint.y}:${je.exitPoint.x}:${je.exitPoint.y}`).join("|")}:${Ze.maximumRouteOrderAttempts??"all"}:${Je}:${tt}:${Boolean(Ze.localDogboneRepair)}:${Boolean(Ze.preferTargetDirectedLaneBias)}:${Boolean(Ze.reserveTerminalExitPoints)}`;if(ut.has($e))continue;ut.add($e);let ft=G2({heuristicWeight:e.windingHeuristicWeight,srj:o,bus:r,targetLayer:i,terminals:Fe,acceptedPlans:s,layerNames:a,traceWidth:c,viaDiameter:l,viaHoleDiameter:h,clearance:d,allowBlindAndBuriedVias:m,allowSameNetMerges:A,maximumRouteOrderAttempts:Ze.maximumRouteOrderAttempts,adaptiveRouteOrder:M,alignGridToPads:tt,includeReverseTargetRotation:Ze.localDogboneRepair,reservedVias:C,softReservedVias:b,reserveTerminalExitPoints:Ze.reserveTerminalExitPoints,gridStepDivisor:Je,gridStep:e.windingGridStep,sourceEscapePaths:e.sourceEscapePaths,preferTargetDirectedLaneBias:Ze.preferTargetDirectedLaneBias,forbidEarlyExitBoundaryContact:H},y&&I?Math.min(2,Math.max(1,t-ne.length)):Ze.maximumRouteOrderAttempts===void 0?Math.min(2,t-ne.length):2,n),vt=ft.next();while(!vt.done)yield{phase:"via-minimal-winding",busId:r.busId,targetLayer:i,winding:vt.value},vt=ft.next();let Ye=vt.value;for(let je of Ye){if(!q0({plans:[...s,...je],srj:o,sharedBoundary:r.sharedBoundary,clearance:d,allowBlindAndBuriedVias:m,allowSameNetMerges:A})){if(q0({plans:je,srj:o,sharedBoundary:r.sharedBoundary,clearance:d,allowBlindAndBuriedVias:m,allowSameNetMerges:A})&&g){if(g.push(je),f)return ne}continue}if(te(je),ne.length>=t)return ne}}}if(ne.length===0&&v&&y&&r.connections.length<=2&&r.exitEdge&&r.connections.every((ce)=>ce.sourceLayer===r.connections[0].sourceLayer&&ce.sourceLayer!==i)){let ce=r.connections[0].sourceLayer,ue=zS(r.exitEdge),de=DS(r,ue),me=r.connections.map((rt)=>P&&wb(r)?Q9({fixedBoundaryTracksByConnectionIndex:x,bus:r,connection:rt,cornerExitLaneOffset:Z.exit,traceWidth:c,viaDiameter:l,clearance:d,layerNames:a,targetLayer:i,cornerBandTargetTrackOffset:D}):fY({fixedBoundaryTracksByConnectionIndex:x,bus:r,connection:rt,boundaryDirection:ue,traceWidth:c,clearance:d,layerNames:a,targetLayer:i})),ge=me.map((rt)=>EA(de,rt,ue)),xe={...o,obstacles:o.obstacles.map((rt)=>{let pt=r.connections.find((ct)=>rt===ct.sourceObstacle||Gt(rt.center,ct.sourcePoint)<=0.0000001&&rt.layers.includes(ct.sourceLayer));return pt?{...rt,connectedTo:[...rt.connectedTo,pt.connection.name]}:rt})},Ee=Math.max(l/2+d,Math.min(r.pitchX,r.pitchY)/2),Re=P?wb(r):void 0,Me=[1,2,3,4,5].flatMap((rt)=>{let pt=rt*Ee,ct=me.map((Ct)=>EA(de-jS(ue)*pt,Ct,ue));if(!Re)return[ct];return[me.map((Ct)=>EA(de-jS(ue)*pt,Ct+(Re==="maximum"?pt:-pt),ue)),ct]}),_e={x:r.connections.reduce((rt,pt)=>rt+pt.sourcePoint.x,0)/r.connections.length,y:r.connections.reduce((rt,pt)=>rt+pt.sourcePoint.y,0)/r.connections.length},ye=[{x:-1,y:0,distance:_e.x-Math.min(...r.xCoordinates)},{x:1,y:0,distance:Math.max(...r.xCoordinates)-_e.x},{x:0,y:-1,distance:_e.y-Math.min(...r.yCoordinates)},{x:0,y:1,distance:Math.max(...r.yCoordinates)-_e.y}].toSorted((rt,pt)=>rt.distance-pt.distance),Se=r.connections.length===2?ye.flatMap((rt)=>[3].map((pt)=>r.connections.map((ct)=>{let Ct=y.get(ct.connectionIndex);return{x:Ct.x+rt.x*pt*r.pitchX,y:Ct.y+rt.y*pt*r.pitchY}}))):[],Ne=r.connections.map((rt)=>y.get(rt.connectionIndex)),Le=[{distance:_e.x-r.componentBounds.minX,axis:"x",value:r.componentBounds.minX-2*Ee},{distance:r.componentBounds.maxX-_e.x,axis:"x",value:r.componentBounds.maxX+2*Ee},{distance:_e.y-r.componentBounds.minY,axis:"y",value:r.componentBounds.minY-2*Ee},{distance:r.componentBounds.maxY-_e.y,axis:"y",value:r.componentBounds.maxY+2*Ee}].toSorted((rt,pt)=>rt.distance-pt.distance).flatMap(({axis:rt,value:pt})=>{let ct=rt==="x"?"y":"x",Ct=Ne.reduce((xt,Yt)=>xt+Yt[ct],0)/Ne.length,kt=Ne.map((xt,Yt)=>({index:Yt,track:xt[ct]})).toSorted((xt,Yt)=>xt.track-Yt.track||xt.index-Yt.index),Lt=l+d,Bt=Ne.map((xt,Yt)=>({...xt,[rt]:pt,[ct]:kt.length===2&&Math.abs(kt[1].track-kt[0].track)<Lt?Ct+(kt.findIndex((ut)=>ut.index===Yt)-0.5)*Lt:xt[ct]}));return Bt.length===2?[Bt,[Bt[1],Bt[0]]]:[Bt]}),nt=r.connections.length===2&&Boolean(wb(r)),dt=[...(nt?Le:[]).map((rt)=>({points:rt,boundarySide:!1})),...Se.map((rt)=>({points:rt,boundarySide:!1})),...Me.map((rt)=>({points:rt,boundarySide:!0})),...(!nt?Le:[]).map((rt)=>({points:rt,boundarySide:!1}))];for(let{points:rt,boundarySide:pt}of dt){let ct=r.connections.map((Ze,Fe)=>({connectionName:Ze.connection.name,via:{center:rt[Fe],diameter:l,spanLayers:t5({fromLayer:ce,toLayer:i,layerNames:a,allowBlindAndBuriedVias:m})}}));if(ct.some((Ze,Fe)=>ct.some((tt,Je)=>Fe!==Je&&(Gt(Ze.via.center,tt.via.center)<l+d-0.000000001||pt&&Hr(Ze.via.center,tt.via.center,ge[Je])<l/2+c/2+d-0.000000001))))continue;if(ct.some(({via:Ze})=>o.obstacles.some((Fe)=>Fe.layers.some((tt)=>Ze.spanLayers.includes(tt))&&r5(Ze.center,Fe)<Ze.diameter/2+d-0.000000001)))continue;let Ct=G2({heuristicWeight:e.windingHeuristicWeight,srj:xe,bus:r,targetLayer:ce,terminals:r.connections.map((Ze,Fe)=>({connection:Ze,viaPoint:Ze.sourcePoint,exitPoint:rt[Fe]})),acceptedPlans:s,layerNames:a,traceWidth:c,viaDiameter:l,viaHoleDiameter:h,clearance:d,allowBlindAndBuriedVias:m,allowSameNetMerges:A,maximumRouteOrderAttempts:r.connections.length===1?3:6,softReservedVias:b,reservedVias:r.connections.length>1?[...C,...ct]:C,gridStepDivisor:2,allowSourceLayerRouting:!0,alignGridToPads:!0,forbidEarlyExitBoundaryContact:H},1,n),kt=Ct.next();while(!kt.done)yield{phase:"via-minimal-winding",busId:r.busId,targetLayer:ce,winding:kt.value},kt=Ct.next();let Lt=kt.value[0];if(!Lt||Lt.length!==r.connections.length)continue;let Bt;if(!pt){let Ze=G2({heuristicWeight:e.windingHeuristicWeight,srj:o,bus:r,targetLayer:i,terminals:r.connections.map((tt,Je)=>({connection:tt,viaPoint:rt[Je],exitPoint:ge[Je]})),acceptedPlans:s,layerNames:a,traceWidth:c,viaDiameter:l,viaHoleDiameter:h,clearance:d,allowBlindAndBuriedVias:m,allowSameNetMerges:A,maximumRouteOrderAttempts:6,reservedVias:C,softReservedVias:b,gridStepDivisor:2,alignGridToPads:!0,forbidEarlyExitBoundaryContact:H},1,n),Fe=Ze.next();while(!Fe.done)yield{phase:"via-minimal-winding",busId:r.busId,targetLayer:i,winding:Fe.value},Fe=Ze.next();if(Bt=Fe.value[0],!Bt)continue}let xt=Lt.map((Ze,Fe)=>{let tt=rt[Fe],Je=ge[Fe],ft=Bt?Bt[Fe].segments.filter((je)=>je.layer===i):[{start:tt,end:Je,width:c,layer:i}],vt={center:tt,diameter:l,holeDiameter:h,fromLayer:ce,toLayer:i,spanLayers:t5({fromLayer:ce,toLayer:i,layerNames:a,allowBlindAndBuriedVias:m})},Ye=Ze.trace.route.filter((je)=>je.route_type==="wire");return{...Ze,...P||r.connections.length>1||!pt?{sourceEscapeSegmentCount:Ze.segments.length}:{},targetLayer:i,exitPoint:Je,via:vt,segments:[...Ze.segments,...ft],length:Ze.length+ft.reduce((je,st)=>je+Gt(st.start,st.end),0),trace:{...Ze.trace,route:[...Ye,{route_type:"via",...tt,from_layer:ce,to_layer:i,via_diameter:l,via_hole_diameter:h},{route_type:"wire",...tt,width:c,layer:i},...ft.map((je)=>({route_type:"wire",...je.end,width:c,layer:i}))]}}}),Yt=q0({plans:[...s,...xt],srj:o,sharedBoundary:r.sharedBoundary,clearance:d,allowBlindAndBuriedVias:m,allowSameNetMerges:A}),ut=xt.every((Ze)=>C.every((Fe)=>{let tt=Ze.via;if(Fe.connectionName===Ze.connectionName||A&&e5(o,Fe.connectionName,Ze.connectionName))return!0;if(tt.spanLayers.some((Je)=>Fe.via.spanLayers.includes(Je))&&Gt(tt.center,Fe.via.center)<(tt.diameter+Fe.via.diameter)/2+d-0.000000001)return!1;return Ze.segments.every((Je)=>!Fe.via.spanLayers.includes(Je.layer)||Hr(Fe.via.center,Je.start,Je.end)>=Fe.via.diameter/2+c/2+d-0.000000001)}));if(Yt&&ut)return te(xt),ne}}if(I||y||e.sourceEscapePaths||C.length>0)return ne;let ie=(ce,ue,de,me)=>{if(ne.length>=t)return;if(de>=ce.length){te(me);return}let ge=ce[de],xe=Lde(r,ge),Re=[SHr({bus:r,connection:ge,traceWidth:c}),PHr({bus:r,connection:ge,targetUsesVia:Y,interstitialEscape:J,compactBusTracks:u,traceWidth:c,viaDiameter:l,clearance:d})].filter((Me,_e,ye)=>ye.findIndex((Se)=>Math.abs(Se-Me)<0.000000001)===_e).flatMap((Me)=>vHr({bus:r,connection:ge,preferredTrack:Me,traceWidth:c,clearance:d})).filter((Me,_e,ye)=>ye.findIndex((Se)=>Math.abs(Se.value-Me.value)<0.000000001)===_e);for(let Me=0;Me<Re.length;Me++){let _e=Re[Me],ye=Tve({preparedConnection:ge,bus:r,targetLayer:i,track:_e.value,exitAxis:V,layerNames:a,traceWidth:c,viaDiameter:l,viaHoleDiameter:h,viaHandedness:ue,interstitialEscape:J,spreadLaneIndex:Math.min(xe,r.connections.length-xe-1),cornerExitLaneOffset:Z.exit,cornerLocalChannelLaneOffset:Z.localChannel,cornerBoundaryChannelLaneOffset:Z.boundaryChannel,clearance:d,terminateAtVia:!1,allowBlindAndBuriedVias:m,cornerBandTargetTrackOffset:D,fixedBoundaryTracksByConnectionIndex:x});if(!Dve({plan:ye,otherPlans:[...s,...me],staticClearanceCache:_,blockingBusCounts:p,cacheKey:`boundary:${r.busId}:${i}:${ge.connectionIndex}:${ue}:${Me}:${r.exitEdge??"legacy"}:${Z.exit}:${Z.localChannel}:${Z.boundaryChannel}:${D??0}:${x?.get(ge.connectionIndex)??"default"}`,srj:o,sharedBoundary:r.sharedBoundary,clearance:d,allowBlindAndBuriedVias:m,allowSameNetMerges:A}))continue;if(ie(ce,ue,de+1,[...me,ye]),ne.length>=t)return;if(t===1)return}};for(let ce of se)for(let ue of q4n(r))if(ie(ue,ce,0,[]),ne.length>=t)return ne;return ne}function SJ(e,t=1){let n=_7e(e,t),o=n.next();while(!o.done)o=n.next();return o.value}function nY(e){return SJ(e,1)[0]??null}var lu=0.0000001,mde=(e,t,n)=>t==="left"?e.x-n.minX:t==="right"?n.maxX-e.x:t==="top"?n.maxY-e.y:e.y-n.minY;function wHr(e,t,n,o){let r=mde(e.start,t,n),i=mde(e.end,t,n);if(Math.min(r,i)>o)return null;if(Math.max(r,i)<=o)return e;let s=(o-r)/(i-r),a={x:e.start.x+(e.end.x-e.start.x)*s,y:e.start.y+(e.end.y-e.start.y)*s};return{...e,...r>o?{start:a}:{end:a}}}function Bot(e){let t=e.segments.length-1;while(t>0&&e.segments[t-1].layer===e.targetLayer)t--;let n=e.segments.slice(t);return{first:t,points:n.length?[n[0].start,...n.map((o)=>o.end)]:[]}}function $gn(e,t,n){let o=[...e.segments.slice(0,t),...n.slice(1).flatMap((i,s)=>Gt(n[s],i)>lu?[{start:n[s],end:i,layer:e.targetLayer,width:e.segments.at(-1).width}]:[])],r=e.trace.route.length;while(r>0){let i=e.trace.route[r-1];if(i.route_type!=="wire"||i.layer!==e.targetLayer)break;r--}return{...e,segments:o,length:o.reduce((i,s)=>i+Gt(s.start,s.end),0),trace:{...e.trace,route:[...e.trace.route.slice(0,r),...n.map((i)=>({route_type:"wire",x:i.x,y:i.y,layer:e.targetLayer,width:e.segments.at(-1).width}))]}}}function BHr(e,t){let n=[...e],o=(r,i)=>{let s=Math.abs(i.x-r.x),a=Math.abs(i.y-r.y);return s<lu||a<lu||Math.abs(s-a)<lu};for(let r=Math.max(1,t);r<n.length-1;r++){let i=n[r-1],s=n[r],a=n[r+1],c=Gt(i,s),l=Gt(s,a);if(c<lu||l<lu||((s.x-i.x)*(a.x-s.x)+(s.y-i.y)*(a.y-s.y))/(c*l)>=-lu)continue;if(o(i,a)){n.splice(r,1),r--;continue}let h=[];for(let u of["x","y"]){let _=(i[u]-s[u])/(a[u]-s[u]);if(_>lu&&_<1-lu)h.push({x:s.x+(a.x-s.x)*_,y:s.y+(a.y-s.y)*_});let p=(a[u]-i[u])/(s[u]-i[u]);if(p>lu&&p<1-lu)h.push({x:i.x+(s.x-i.x)*p,y:i.y+(s.y-i.y)*p})}let d=h.find((u)=>o(i,u)&&o(u,a));if(d)n[r]=d}return n}function THr(e,t){let n=(o)=>{let r=new Map;for(let i of e)for(let s of Bot(i).points.slice(0,-1)){let a=(s[o]%t+t)%t,c=a<0.000001||t-a<0.000001?0:Math.round(a*1e6)/1e6;r.set(c,(r.get(c)??0)+1)}return[...r].sort((i,s)=>s[1]-i[1]||i[0]-s[0])[0]?.[0]??0};return{x:n("x"),y:n("y")}}function DHr(e,t,n,o){let r=t==="left"||t==="right"?"y":"x",i=e.map((c)=>c.exitPoint[r]).sort((c,l)=>c-l),s=[],a=(c,l)=>Math.abs(c-l-Math.round((c-l)/o)*o)<=lu;if(i.length===1&&!a(i[0],n[r]))s.push({coordinate:i[0],count:1});for(let c=1;c<i.length;c++)for(let l of[i[c-1],i[c]]){if(a(l,n[r]))continue;let h=s.find((d)=>a(d.coordinate,l));if(h)h.count++;else s.push({coordinate:l,count:1})}return[n,...s.sort((c,l)=>l.count-c.count||c.coordinate-l.coordinate).slice(0,3).map(({coordinate:c})=>({...n,[r]:c}))]}function NHr(e,t,n,o,r){let i=o+r,s=e.map((h,d)=>d),a=(h)=>{while(s[h]!==h)h=s[h];return h},c=(h,d)=>{let u={x:d.x+(n==="left"?2*i:n==="right"?-2*i:0),y:d.y+(n==="bottom"?2*i:n==="top"?-2*i:0)};return h.some((_)=>Hh(_.start,_.end,d,u)<(_.width+o)/2+r-lu)};for(let h=0;h<e.length;h++)for(let d=h+1;d<e.length;d++){if(a(h)===a(d))continue;if(Gt(e[h].exitPoint,e[d].exitPoint)<=2*i+lu||c(t[h],e[d].exitPoint)||c(t[d],e[h].exitPoint)||t[h].some((_)=>t[d].some((p)=>Hh(_.start,_.end,p.start,p.end)<(_.width+p.width)/2+r-lu)))s[a(d)]=a(h)}let l=new Map;return e.forEach((h,d)=>{let u=a(d),_=l.get(u)??[];_.push(h),l.set(u,_)}),[...l.values()]}function Tot(e){let{inputSrj:t,preparedBuses:n,reservedPlans:o=[],traceWidth:r,clearance:i}=e,s=r+i,a=e.gridStep??r;if(!(s>0)||!(a>0)||!Number.isFinite(a))throw Error("FanoutSolver: boundary tail repair requires positive finite trace/grid spacing");let c=new Map(n.flatMap((p)=>p.connections.map((m)=>[m.connectionIndex,{bus:p,connection:m}]))),l=[...e.plans],h=new Map;for(let p of l){let m=c.get(p.connectionIndex);if(!m)throw Error(`FanoutSolver: missing prepared boundary-tail connection ${p.connectionIndex}`);if(p.termination.type!=="boundary"||!p.exitEdge||Math.abs(mde(p.exitPoint,p.exitEdge,m.bus.sharedBoundary))>lu)continue;let A=`${p.exitEdge}:${p.targetLayer}`,g=h.get(A)??[];g.push(p),h.set(A,g)}let d=[...h.values()];for(let p=0;p<d.length;p++){let m=d[p],A=m[0].exitEdge,g=m[0].targetLayer,f=c.get(m[0].connectionIndex).bus.sharedBoundary,y=Math.min(24*s,(A==="left"||A==="right"?f.maxX-f.minX:f.maxY-f.minY)/3),x=m.map((B)=>B.segments.filter((T)=>T.layer===g).flatMap((T)=>wHr(T,A,f,y)??[])),C=NHr(m,x,A,r,i);if(C.length>1){d.splice(p,1,...C),p--;continue}let b=new Set;for(let B of m)if(Bot(B).points.slice(0,-1).some((T)=>Math.abs(mde(T,A,f))<=lu&&Gt(T,B.exitPoint)>lu))b.add(B);for(let B=0;B<m.length;B++)for(let T=B+1;T<m.length;T++)if(x[B].some((N)=>x[T].some((D)=>Hh(N.start,N.end,D.start,D.end)<(N.width+D.width)/2+i-lu)))b.add(m[B]),b.add(m[T]);if(!b.size)continue;let I=!0;while(I){I=!1;for(let B of m)if(!b.has(B)&&[...b].some((T)=>{if(Gt(B.exitPoint,T.exitPoint)<=2*s+lu)return!0;let N={x:T.exitPoint.x+(A==="left"?2*s:A==="right"?-2*s:0),y:T.exitPoint.y+(A==="bottom"?2*s:A==="top"?-2*s:0)};return B.segments.some((D)=>D.layer===g&&Hh(D.start,D.end,T.exitPoint,N)<(D.width+r)/2+i-lu)}))b.add(B),I=!0}let v=m.filter((B)=>b.has(B));if(v.length>32)return null;let P=DHr(v,A,e.gridOrigin??THr(v,a),a),M=null;for(let B of P){for(let T of[8,16,24]){let N=Math.min(T*s,y),D=A==="left"||A==="right"?"x":"y",L=A==="left"||A==="bottom"?1:-1,H=A==="left"?f.minX:A==="right"?f.maxX:A==="top"?f.maxY:f.minY,V=H+L*N,O=B[D]+(L>0?Math.ceil((V-B[D])/a):Math.floor((V-B[D])/a))*a,U=(O-H)*L,j=v.map((de)=>{let{first:me,points:ge}=Bot(de),xe=ge.findLastIndex((Se)=>mde(Se,A,f)>=U-lu);if(xe<0){let Se=de.additionalVias?.at(-1)??de.via;if(!Se||Se.toLayer!==de.targetLayer||!ge[0]||Gt(Se.center,ge[0])>lu||me<(de.sourceEscapeSegmentCount??1))return null;return{plan:de,first:me,prefix:[ge[0]],point:ge[0]}}if(xe>=ge.length-1)return null;let Ee=ge[xe],Re=ge[xe+1],Me=(O-Ee[D])/(Re[D]-Ee[D]);if(!Number.isFinite(Me)||Me<-lu||Me>1+lu)return null;let _e={x:Ee.x+(Re.x-Ee.x)*Me,y:Ee.y+(Re.y-Ee.y)*Me},ye=[...ge.slice(0,xe+1),...Gt(Ee,_e)>lu?[_e]:[]];if(me+ye.length-1<(de.sourceEscapeSegmentCount??1))return null;return{plan:de,first:me,prefix:ye,point:_e}});if(j.some((de)=>!de))continue;let Y=j.filter((de)=>de!==null),X=[...l.filter((de)=>!b.has(de)),...o],K=Y.map((de)=>({...$gn(de.plan,de.first,de.prefix),exitPoint:de.point})),J=[...X,...K],ee=Y.map((de)=>({connection:{...c.get(de.plan.connectionIndex).connection,sourcePoint:{...de.point,layer:g},sourceLayer:g},viaPoint:de.point,exitPoint:de.plan.exitPoint})),se={...f};if(A==="left")se.maxX=Math.min(f.maxX,O+3*s);if(A==="right")se.minX=Math.max(f.minX,O-3*s);if(A==="bottom")se.maxY=Math.min(f.maxY,O+3*s);if(A==="top")se.minY=Math.max(f.minY,O-3*s);let ne=D==="x"?"y":"x",re=ee.flatMap((de)=>[de.viaPoint[ne],de.exitPoint[ne]]);if(ne==="x")se.minX=Math.max(se.minX,Math.min(...re)-3*s),se.maxX=Math.min(se.maxX,Math.max(...re)+3*s);else se.minY=Math.max(se.minY,Math.min(...re)-3*s),se.maxY=Math.min(se.maxY,Math.max(...re)+3*s);let Z={...c.get(v[0].connectionIndex).bus,connections:ee.map((de)=>de.connection),sharedBoundary:se},te=G2({...e,srj:t,bus:Z,terminals:ee,targetLayer:g,sourceEscapePaths:void 0,acceptedPlans:J,reservedVias:J.flatMap((de)=>[de.via,...de.additionalVias??[],de.planeEndpointVia].filter((me)=>!!me).map((me)=>({connectionName:de.connectionName,via:me}))),gridStep:a,gridOrigin:B,gridStepDivisor:2,alignGridToPads:!0,heuristicWeight:2,maximumRouteOrderAttempts:72,reserveTerminalExitPoints:!0,adaptiveRouteOrder:!0,allowSourceLayerRouting:!0,forbidEarlyExitBoundaryContact:!0},1,!1),ie=te.next();while(!ie.done)ie=te.next();let ce=ie.value[0];if(!ce)continue;let ue=Y.map((de)=>{let me=ce.find((xe)=>xe.connectionIndex===de.plan.connectionIndex);if(!me||me.via||me.additionalVias?.length)throw Error("FanoutSolver: boundary-tail repair added a physical via");let ge=BHr([...de.prefix,...me.segments.map((xe)=>xe.end)],de.prefix.length-1);return $gn(de.plan,de.first,ge)});if(!q0({plans:ue,srj:{...t,traces:[...t.traces??[],...X.flatMap((de)=>[de.trace,...de.planeEndpointTrace?[de.planeEndpointTrace]:[]])]},sharedBoundary:f,clearance:i,allowBlindAndBuriedVias:e.allowBlindAndBuriedVias,allowSameNetMerges:e.allowSameNetMerges}))continue;M=ue;break}if(M)break}if(!M)return null;for(let B of M)l[l.findIndex((T)=>T.connectionIndex===B.connectionIndex)]=B}let u=[...l,...o];if(t.traces?.length&&u.length){let p=n.map((A)=>A.sharedBoundary);if(!m7e({srj:t,sharedBoundary:{minX:Math.min(...p.map((A)=>A.minX)),maxX:Math.max(...p.map((A)=>A.maxX)),minY:Math.min(...p.map((A)=>A.minY)),maxY:Math.max(...p.map((A)=>A.maxY))},clearance:i,allowBlindAndBuriedVias:e.allowBlindAndBuriedVias,allowSameNetMerges:e.allowSameNetMerges})(u))return null}return kd({inputSrj:t,routedSrj:{...t,traces:[...u.flatMap((p)=>[p.trace,...p.planeEndpointTrace?[p.planeEndpointTrace]:[]])]},clearance:i,allowBlindAndBuriedVias:e.allowBlindAndBuriedVias}).valid?l:null}var Fs=0.0000001;function bZ(e,t,n,o){let r=new Float64Array(t.length+1),i=new Int32Array(t.length);for(let c=0;c<t.length;c++){let l=t[c],h=t[c-1];r[c+1]=r[c]+Gt(l.start,l.end),i[c]=c===0?0:i[c-1]+Number(h.layer!==l.layer||Gt(h.end,l.start)>Fs)}let s=[e.via,...e.additionalVias??[],e.planeEndpointVia].filter((c)=>!!c),a=(c,l)=>{if(i[c]!==i[l])return!1;let h=0,d=0;for(let u=c;u<=l;u++){let _=t[u],p=_.end.x-_.start.x,m=_.end.y-_.start.y;if(Math.abs(p)>Fs){let A=Math.sign(p);if(h&&h!==A)return!1;h=A}if(Math.abs(m)>Fs){let A=Math.sign(m);if(d&&d!==A)return!1;d=A}}return!0};for(let[c,l]of t.entries()){if(o&&!o.has(c))continue;if(!o&&e.segments.some((h)=>h.layer===l.layer&&h.width===l.width&&Hr(l.start,h.start,h.end)<=Fs&&Hr(l.end,h.start,h.end)<=Fs))continue;for(let[h,d]of t.entries()){if(d.layer!==l.layer)continue;let u=(l.width+d.width)/2+n,_=Math.min(c,h),p=Math.max(c,h);if(i[c]===i[h]&&Math.max(0,r[p]-r[_+1])<=u+Fs)continue;if(!u_(l,d,n)){if(!a(_,p))return!1}}for(let h of s){if(!h.spanLayers.includes(l.layer))continue;let d=(l.width+h.diameter)/2+n;if(Hr(h.center,l.start,l.end)>=d-Fs)continue;if([l.start,l.end].some((_)=>Gt(_,h.center)<=Fs))continue;let u=(_)=>{let p=_===-1?l.start:l.end,m=_===-1?l.end:l.start;if(Gt(p,h.center)>d+Fs||(p.x-h.center.x)*(m.x-p.x)+(p.y-h.center.y)*(m.y-p.y)<-Fs)return!1;for(let A=c+_;A>=0&&A<t.length;A+=_){let g=t[A];if(g.layer!==l.layer||Gt(p,_===-1?g.end:g.start)>Fs)return!1;let f=_===-1?g.start:g.end;if(Gt(f,h.center)>d+Fs||(f.x-h.center.x)*(f.x-p.x)+(f.y-h.center.y)*(f.y-p.y)>Fs)return!1;if(p=f,Gt(p,h.center)<=Fs)return!0}return!1};if(!u(-1)&&!u(1))return!1}}return!0}function Bue(e,t,n,o,r=!1,i=e.traceWidth/4){let{inputSrj:s,layerNames:a,traceWidth:c,clearance:l}=e,h=t.trace.route.findIndex((C)=>C.route_type==="via");if(h<0)return null;let d=t.trace.route.slice(h+1).flatMap((C)=>C.route_type==="wire"?[{x:C.x,y:C.y,z:a.indexOf(C.layer)}]:[]);for(let C=1;r&&C<d.length-1;C++){let b=d[C-1],I=d[C],v=d[C+1];if(b.z!==I.z||I.z!==v.z)continue;if(((I.x-b.x)*(v.x-I.x)+(I.y-b.y)*(v.y-I.y))/(Gt(b,I)*Gt(I,v))<-Fs)d.splice(C,1),C--}let u=oP(s,!1),_=new wue([...n.flatMap((C)=>[...C.segments,...C.planeEndpointSegments??[]]),...u.flatMap((C)=>C.segments)]),p=[...n.flatMap((C)=>[C.via,...C.additionalVias??[],C.planeEndpointVia].filter((b)=>!!b)),...u.flatMap((C)=>C.vias)],m=PY({points:d,chamfer:i,repairReversingDiagonalCorners:!0,segmentIsClear:(C,b)=>{let I={start:C,end:b,layer:a[C.z],width:c};for(let v of[C,b]){let P=o.sharedBoundary;if(v.x<P.minX-Fs||v.x>P.maxX+Fs||v.y<P.minY-Fs||v.y>P.maxY+Fs)return!1;if((Math.abs(v.x-P.minX)<Fs||Math.abs(v.x-P.maxX)<Fs||Math.abs(v.y-P.minY)<Fs||Math.abs(v.y-P.maxY)<Fs)&&Gt(v,t.exitPoint)>Fs)return!1}return s.obstacles.every((v)=>!v.layers.includes(I.layer)||Cl(I,v)>=c/2+l-0.000000001)&&_.querySegment(I,l).every((v)=>u_(I,v,l))&&p.every((v)=>!v.spanLayers.includes(I.layer)||Hr(v.center,C,b)>=(c+v.diameter)/2+l-0.000000001)}});if(!m)return null;let A=t.trace.route.slice(0,h+1);for(let C=0;C<m.length;C++){let b=m[C],I=m[C-1];if(I&&I.z!==b.z){let v=t.trace.route.find((P)=>P.route_type==="via"&&Gt(P,b)<Fs&&P.from_layer===a[I.z]&&P.to_layer===a[b.z]);if(!v)return null;A.push(v)}A.push({route_type:"wire",x:b.x,y:b.y,layer:a[b.z],width:c})}A[A.length-1]=t.trace.route.at(-1);let g={...t.trace,route:A},f=u7e(s,g,!1).segments,y=t.sourceEscapeSegmentCount??1,x=[...t.segments.slice(0,y),...f.slice(y)];if(!bZ(t,x,l))return null;return{...t,trace:g,segments:x,length:x.reduce((C,b)=>C+Gt(b.start,b.end),0)}}function qQ(e){for(let t=0;t<e.length;t++){let n=e[t],o=n.end.x-n.start.x,r=n.end.y-n.start.y,i=Math.hypot(o,r);if(Math.min(Math.abs(o),Math.abs(r),Math.abs(Math.abs(o)-Math.abs(r)))>Fs)return!1;let s=e[t+1];if(s&&Gt(n.end,s.start)>Fs)return!1;if(!s||s.layer!==n.layer||i<Fs)continue;let a=s.end.x-s.start.x,c=s.end.y-s.start.y,l=Math.hypot(a,c);if(l<Fs)continue;if((o*a+r*c)/(i*l)<Math.SQRT1_2-Fs)return!1}return!0}function Nhe(e,t){let n=t.sharedBoundary;return e.segments.every((o)=>[o.start,o.end].every((r)=>{if(r.x<n.minX-Fs||r.x>n.maxX+Fs||r.y<n.minY-Fs||r.y>n.maxY+Fs)return!1;if(e.termination.type!=="boundary")return!0;return!(Math.abs(r.x-n.minX)<Fs||Math.abs(r.x-n.maxX)<Fs||Math.abs(r.y-n.minY)<Fs||Math.abs(r.y-n.maxY)<Fs)||Gt(r,e.exitPoint)<Fs}))}function RHr(e,t,n,o,r=!1){let i=t.sourceEscapeSegmentCount??1;if(t.termination.type!==(r?"boundary":"plane")||!t.via||!r&&t.additionalVias?.length||t.planeEndpointTrace||t.planeEndpointSegments?.length||t.planeEndpointVia||!r&&t.segments.length!==i)return null;let s=t.segments.slice(0,i);if(!s.length||s.some((I)=>I.layer!==t.sourceLayer)||Gt(s[0].start,t.sourcePoint)>Fs||Gt(s.at(-1).end,t.via.center)>Fs)return null;let a=o.connections.find((I)=>I.connectionIndex===t.connectionIndex);if(!a?.sourceObstacle)return null;let c=t.trace.route.findIndex((I)=>I.route_type==="via");if(c<1)return null;let{inputSrj:l,traceWidth:h,clearance:d,layerNames:u}=e,_=(I)=>t.termination.type==="plane"&&e5(l,t.connectionName,I),p=n.filter((I)=>I.termination.type!=="plane"||!_(I.connectionName)),m=oP(l,!1).filter((I)=>!_(I.connectionName)),A=new wue([...t.segments.slice(i),...p.flatMap((I)=>[...I.segments,...I.planeEndpointSegments??[]]),...m.flatMap((I)=>I.segments)]),g=[...t.additionalVias??[],...p.flatMap((I)=>[I.via,...I.additionalVias??[],I.planeEndpointVia].filter((v)=>!!v)),...m.flatMap((I)=>I.vias)],f=PY({points:[t.sourcePoint,...s.map((I)=>I.end)].map((I)=>({...I,z:u.indexOf(t.sourceLayer)})),chamfer:h/4,repairReversingDiagonalCorners:!0,segmentIsClear:(I,v)=>{let P={start:I,end:v,layer:t.sourceLayer,width:h},M=o.sharedBoundary;if([I,v].some((B)=>B.x<M.minX||B.x>M.maxX||B.y<M.minY||B.y>M.maxY))return!1;return l.obstacles.every((B)=>{if(!B.layers.includes(t.sourceLayer))return!0;if(Cl(P,B)>=h/2+d-0.000000001)return!0;if(B===a.sourceObstacle&&CZ(I,B,h/2+d)&&(I.x-a.sourcePoint.x)*(v.x-I.x)+(I.y-a.sourcePoint.y)*(v.y-I.y)>=-Fs)return!0;if(B!==a.sourceObstacle&&t.termination.type==="plane"&&kb(l,B,t.connectionName))return!0;return Mue({inputSrj:l,segment:P,bodyObstacle:B,connectionName:t.connectionName})})&&A.querySegment(P,d).every((B)=>u_(P,B,d))&&g.every((B)=>!B.spanLayers.includes(P.layer)||Hr(B.center,I,v)>=(h+B.diameter)/2+d-0.000000001)}});if(!f)return null;let y={...t.trace,route:[t.trace.route[0],...f.slice(1).map((I)=>({route_type:"wire",x:I.x,y:I.y,layer:t.sourceLayer,width:h})),...t.trace.route.slice(c)]},x=u7e(l,{...y,route:y.route.slice(0,f.length)},!1).segments,C=[...x,...t.segments.slice(i)],b=!1;for(let I of x){let v=Cl(I,a.sourceObstacle);if(b&&v<h/2+d-0.000000001)return null;if(r5(I.end,a.sourceObstacle)>=h/2+d-0.000000001)b=!0}if(!qQ(x)||!bZ(t,C,d,new Set(x.map((I,v)=>v))))return null;return{...t,trace:y,segments:C,sourceEscapeSegmentCount:x.length,length:[...C,...t.planeEndpointSegments??[]].reduce((I,v)=>I+Gt(v.start,v.end),0)}}function Git(e){let t=new Map(e.preparedBuses.map((c)=>[c.busId,c]));if(new Set(e.plans.map((c)=>c.connectionIndex)).size!==e.plans.length)return null;let n=[...e.plans],o=!1;if(e.repairPlaneSourceCorners||e.repairSignalSourceCorners)for(let c=0;c<n.length;c++){let l=n[c];if(qQ(l.segments.slice(0,l.sourceEscapeSegmentCount??1)))continue;let h=t.get(l.busId);if(!h)return null;if(l.termination.type==="plane"?!e.repairPlaneSourceCorners:!e.repairSignalSourceCorners)return null;let d=RHr(e,l,n.filter((u,_)=>_!==c),h,l.termination.type==="boundary");if(!d)return null;n[c]=d,o=!0}if(o&&e.rematchRepairedLengths){let c=e.rematchRepairedLengths(n);if(!c)return null;n=c}let r=[...n],i=Fit(e.inputSrj);for(let c of n){if(!t.has(c.busId))throw Error("Final normalization requires each original prepared bus");if(!qQ(c.segments.slice(0,c.sourceEscapeSegmentCount??1))||!Nhe({...c,segments:c.segments.slice(0,c.sourceEscapeSegmentCount??1)},t.get(c.busId))||!qQ(c.planeEndpointSegments??[]))return null}if(n.some((c)=>!Nhe(c,t.get(c.busId)))){let c=Tot({...e,plans:n,allowBlindAndBuriedVias:!1,allowSameNetMerges:!1});if(!c)return null;if(n=c,e.rematchRepairedLengths){let l=e.rematchRepairedLengths(n);if(!l)return null;n=l}}for(let c=0;c<n.length;c++){let l=n[c];if(qQ(l.segments)&&Nhe(l,t.get(l.busId)))continue;let h=t.get(l.busId),d=null,u=null;for(let _=e.traceWidth/4;_>=0.000001;_=Math.max(0.000001,_/4)){let p=Bue(e,l,n.filter((m,A)=>A!==c),h,!1,_);if(p){u??=p;let m=n.filter((g)=>g.busId===h.busId).map((g)=>g===l?p.length:g.length);if(i.every((g)=>{if(!g.connectionIndices.includes(l.connectionIndex))return!0;let f=g.connectionIndices.map((x)=>n.find((C)=>C.connectionIndex===x));if(f.some((x)=>!x))return!0;let y=f.map((x)=>x===l?p.length:x.length);return Math.abs(y[0]-y[1])<=g.lengthTolerance+Fs})&&(h.maxLengthSkew===void 0||Math.max(...m)-Math.min(...m)<=h.maxLengthSkew+Fs)){d=p;break}}if(_===0.000001)break}if(!d&&u&&e.rematchRepairedLengths){let _=e.rematchRepairedLengths(n.map((m,A)=>A===c?u:m)),p=_?.find((m)=>m.connectionIndex===l.connectionIndex);if(_&&p&&qQ(p.segments))n=_,d=p}if(!d)return null;n[c]=d}for(let c=0;c<n.length;c++){let l=n[c],h=r.find((p)=>p.connectionIndex===l.connectionIndex);if(!h||l.targetLayer!==h.targetLayer||Gt(l.exitPoint,h.exitPoint)>Fs||JSON.stringify(l.via)!==JSON.stringify(h.via)||JSON.stringify(l.additionalVias)!==JSON.stringify(h.additionalVias)||!qQ(l.segments)||!Nhe(l,t.get(l.busId)))return null;if(l===h)continue;let d=h.trace.route.findIndex((p)=>p.route_type==="via"),u=l.trace.route.findIndex((p)=>p.route_type==="via");if(d<0||u<0)return null;let _=h.sourceEscapeSegmentCount??1;n[c]={...l,sourcePoint:h.sourcePoint,via:h.via,additionalVias:h.additionalVias,exitPoint:h.exitPoint,sourceEscapeSegmentCount:_,segments:[...h.segments.slice(0,_),...l.segments.slice(l.sourceEscapeSegmentCount??1)],trace:{...h.trace,route:[...h.trace.route.slice(0,d+1),...l.trace.route.slice(u+1)]}}}for(let c of e.preparedBuses){let l=n.filter((h)=>h.busId===c.busId);if(l.length!==c.connections.length||l.some((h)=>!qQ(h.segments)||!Nhe(h,c)))return null;if(c.maxLengthSkew===void 0)continue;if(Math.max(...l.map((h)=>h.length))-Math.min(...l.map((h)=>h.length))>c.maxLengthSkew+Fs)return null}let s=new Map(n.map((c)=>[c.connectionIndex,c]));for(let c of i){let l=c.connectionIndices.map((d)=>s.get(d));if(l.some((d)=>!d))continue;let h=l.map((d)=>[...d.segments,...d.planeEndpointSegments??[]].reduce((u,_)=>u+Gt(_.start,_.end),0));if(h.some((d)=>!Number.isFinite(d))||Math.abs(h[0]-h[1])>c.lengthTolerance+Fs)return null}if(e.inputSrj.traces?.length&&n.length){let c=e.preparedBuses.map((h)=>h.sharedBoundary);if(!m7e({srj:e.inputSrj,sharedBoundary:{minX:Math.min(...c.map((h)=>h.minX)),maxX:Math.max(...c.map((h)=>h.maxX)),minY:Math.min(...c.map((h)=>h.minY)),maxY:Math.max(...c.map((h)=>h.maxY))},clearance:e.clearance,allowBlindAndBuriedVias:!1,allowSameNetPlaneMerges:!0})(n))return null}return kd({inputSrj:e.inputSrj,routedSrj:{...e.inputSrj,traces:[...n.flatMap((c)=>[c.trace,...c.planeEndpointTrace?[c.planeEndpointTrace]:[]])]},clearance:e.clearance,allowBlindAndBuriedVias:!1}).valid?n:null}function QHr(e){let{inputSrj:t,plans:n,unroutedSourceBuses:o,clearance:r}=e,i=new Map(n.map((y)=>[y.connectionIndex,y])),s=uB(t.layerCount),a=o.filter((y)=>y.termination.type==="boundary"&&y.connections.length>0&&y.connections.every((x)=>{let C=i.get(x.connectionIndex),b=C?.segments[0],I=C?.via;return C?.connectionName===x.connection.name&&C.termination.type==="boundary"&&C.segments.length===1&&(C.sourceEscapeSegmentCount??1)===1&&!C.additionalVias?.length&&!C.planeEndpointTrace&&!C.planeEndpointVia&&b&&b.layer===x.sourceLayer&&I&&I.fromLayer===x.sourceLayer&&I.toLayer===C.targetLayer&&I.toLayer!==I.fromLayer&&I.spanLayers.length===s.length&&s.every((v)=>I.spanLayers.includes(v))&&Gt(b.start,x.sourcePoint)<0.0000001&&Gt(b.end,I.center)<0.0000001&&Gt(C.exitPoint,I.center)<0.0000001})),c=a[0]?.connections[0];if(!c)return null;let l=i.get(c.connectionIndex),h=l.via,d=l.segments[0].width;if(a.some((y)=>y.connections.some((x)=>{let C=i.get(x.connectionIndex);return C.via.diameter!==h.diameter||C.via.holeDiameter!==h.holeDiameter||C.segments[0].width!==d})))return null;let u=new Set(a.flatMap((y)=>y.connections.map((x)=>x.connectionIndex))),_=n.filter((y)=>!u.has(y.connectionIndex)),p=oP(t,!1),m=Yu(a,{traceWidth:d,clearance:r,viaDiameter:h.diameter,viaHoleDiameter:h.holeDiameter,maximumSearchStates:1e4,preferredViaPointsByConnectionIndex:new Map(n.filter((y)=>u.has(y.connectionIndex)).map((y)=>[y.connectionIndex,y.via.center])),additionalObstacles:t.obstacles,blockingSegments:[..._.flatMap((y)=>[...y.segments,...y.planeEndpointSegments??[]].map((x)=>({connectionIndex:y.connectionIndex,segment:x}))),...p.flatMap((y)=>y.segments.map((x)=>({connectionIndex:-1,segment:x})))],blockingVias:[..._.flatMap((y)=>[y.via,...y.additionalVias??[],y.planeEndpointVia].filter((x)=>x!==void 0).map((x)=>({connectionIndex:y.connectionIndex,...x}))),...p.flatMap((y)=>y.vias.map((x)=>({connectionIndex:-1,...x})))]});if(!m)return null;let A=new Map;for(let y of a)for(let x of y.connections){let C=i.get(x.connectionIndex),b=m.get(x.connectionIndex);if(Gt(b,C.via.center)<0.0000001)continue;let I=b.x-x.sourcePoint.x,v=b.y-x.sourcePoint.y;if(Math.min(Math.abs(I),Math.abs(v),Math.abs(Math.abs(I)-Math.abs(v)))>0.0000001)return null;A.set(x.connectionIndex,Ob({bus:y,terminal:{connection:x,viaPoint:b,exitPoint:b},targetLayer:C.targetLayer,targetLayerPoints:[b],layerNames:s,traceWidth:d,viaDiameter:h.diameter,viaHoleDiameter:h.holeDiameter,allowBlindAndBuriedVias:!1}))}if(!A.size)return null;let g=n.map((y)=>A.get(y.connectionIndex)??y);if(!q0({plans:g,srj:t,sharedBoundary:a[0].sharedBoundary,clearance:r,allowBlindAndBuriedVias:!1,allowSameNetMerges:!1}))return null;return kd({inputSrj:t,routedSrj:{...t,traces:[...t.traces??[],...g.flatMap((y)=>[y.trace,...y.planeEndpointTrace?[y.planeEndpointTrace]:[]])]},clearance:r,allowBlindAndBuriedVias:!1}).valid?g:null}var ni=0.000001;function Py(e,t){return Gt(e,t)<=ni}function g7e(e){return[e.via,...e.additionalVias??[]].filter((t)=>t!==void 0)}function kHr(e,t){let n=t[0];if(!n)return null;let o=e.trace.route.find((u)=>u.route_type==="wire"),r=e.trace.route.findLast((u)=>u.route_type==="wire"),i=(u)=>{if(u?.route_type!=="wire")return{};let _={...u};return delete _.route_type,delete _.x,delete _.y,delete _.width,delete _.layer,_},s=g7e(e),c=Py(n.start,e.sourcePoint)&&n.layer!==e.sourceLayer&&s.some((u)=>Py(u.center,n.start)&&u.spanLayers.includes(e.sourceLayer)&&u.spanLayers.includes(n.layer))?e.sourceLayer:n.layer,l=[{...i(o),route_type:"wire",...n.start,width:n.width,layer:c}],h=n.start,d=c;for(let[u,_]of t.entries()){if(!Py(h,_.start))return null;if(d!==_.layer){let p=s.find((m)=>Py(m.center,_.start)&&m.spanLayers.includes(d)&&m.spanLayers.includes(_.layer));if(!p)return null;l.push({route_type:"via",..._.start,from_layer:d,to_layer:_.layer,via_diameter:p.diameter,via_hole_diameter:p.holeDiameter}),l.push({route_type:"wire",..._.start,width:_.width,layer:_.layer}),d=_.layer}l.push({...u===t.length-1?i(r):{},route_type:"wire",..._.end,width:_.width,layer:_.layer}),h=_.end}return l}function T9(e,t,n=!1){let o=kHr(e,t);if(!o)return null;let r=[...t,...e.planeEndpointSegments??[]].reduce((s,a)=>s+Gt(a.start,a.end),0),i=t.findIndex((s)=>s.layer!==e.sourceLayer);return{...e,...n&&e.sourceEscapeSegmentCount!==void 0&&i>=0?{sourceEscapeSegmentCount:i}:{},trace:{...e.trace,route:o},segments:t,length:r}}function c8e(e,t,n){let o=[...g7e(e),...e.planeEndpointVia?[e.planeEndpointVia]:[]];for(let r of t){for(let a of o){if(a===r)continue;if(r.spanLayers.some((c)=>a.spanLayers.includes(c))&&Gt(r.center,a.center)<(r.diameter+a.diameter)/2+n-0.000000001)return!1}let i=e.segments.flatMap((a,c)=>{let l=e.segments[c+1];return a.layer===r.fromLayer&&l?.layer===r.toLayer&&Py(a.end,r.center)&&Py(l.start,r.center)?[c]:[]});if(i.length!==1)return!1;let s=new Set;for(let a of[-1,1]){let c=r.center,l=0,h=a===-1?r.fromLayer:r.toLayer;for(let d=i[0]+(a===1?1:0);d>=0&&d<e.segments.length;d+=a){let u=e.segments[d],_=a===-1?u.end:u.start,p=a===-1?u.start:u.end,m=(r.diameter+u.width)/2+n;if(u.layer!==h||!Py(c,_)||l>m+ni)break;s.add(d),l+=Gt(_,p),c=p}}for(let[a,c]of[...e.segments,...e.planeEndpointSegments??[]].entries()){if(s.has(a)||!r.spanLayers.includes(c.layer))continue;if(Hr(r.center,c.start,c.end)<(r.diameter+c.width)/2+n-0.000000001)return!1}}return!0}function*LHr(e){let{plan:t,bus:n,layerNames:o,clearance:r,workBudget:i}=e;if(!t.via||g7e(t).length>5)return;let s=n.allowedLayers??o,a=(n.routableEscapeLayers??s).filter((d)=>s.includes(d)&&o.includes(d)&&d!==t.sourceLayer&&d!==t.targetLayer),c=[];for(let d of t.segments){let u=c.at(-1);if(u?.layer===d.layer&&d.layer===t.targetLayer){let _=u.end.x-u.start.x,p=u.end.y-u.start.y,m=d.end.x-d.start.x,A=d.end.y-d.start.y;if(Math.abs(_*A-p*m)<=ni*Math.hypot(_,p)*Math.hypot(m,A)&&_*m+p*A>0){u.end=d.end;continue}}c.push({...d})}let l=T9(t,c);if(!l)return;let h=(d,u,_)=>({center:d,fromLayer:u,toLayer:_,diameter:t.via.diameter,holeDiameter:t.via.holeDiameter,spanLayers:o});for(let d of a)for(let u of[!0,!1]){if(u&&(l.additionalVias?.length||l.via.toLayer!==l.targetLayer))continue;for(let[_,p]of l.segments.entries()){if(p.layer!==l.targetLayer)continue;if(Gt(p.start,p.end)<=ni)continue;for(let m=0;m<37;m++){let A=0.05+m*0.025;if(!u&&A>=0.5)break;yY(i);let g=(b)=>({x:p.start.x+(p.end.x-p.start.x)*b,y:p.start.y+(p.end.y-p.start.y)*b}),f=g(A),y=g(1-A);if(!u&&Gt(f,y)<t.via.diameter+r)continue;let x=u?[h(y,d,p.layer)]:[h(f,p.layer,d),h(y,d,p.layer)],C=u?T9({...l,via:{...l.via,toLayer:d},additionalVias:x},[...l.segments.slice(0,_).map((b)=>b.layer===l.targetLayer?{...b,layer:d}:b),{...p,end:y,layer:d},{...p,start:y},...l.segments.slice(_+1)]):T9({...l,additionalVias:[...l.additionalVias??[],...x]},[...l.segments.slice(0,_),{...p,end:f},{...p,start:f,end:y,layer:d},{...p,start:y},...l.segments.slice(_+1)]);if(C&&c8e(C,x,r))yield{plan:C,tuningLayer:d,addedVias:x}}}}}function J4n(e,t,n){return e.x<t.minX-n||e.x>t.maxX+n||e.y<t.minY-n||e.y>t.maxY+n}function HHr(e){let{segment:t,bounds:n,margin:o}=e,r={minX:n.minX-o,maxX:n.maxX+o,minY:n.minY-o,maxY:n.maxY+o},i=t.end.x-t.start.x,s=t.end.y-t.start.y,a=[0,1],c=(h)=>{if(h<=ni||h>=1-ni)return;let d={x:t.start.x+i*h,y:t.start.y+s*h};if(d.x<r.minX-ni||d.x>r.maxX+ni||d.y<r.minY-ni||d.y>r.maxY+ni)return;a.push(h)};if(Math.abs(i)>ni)c((r.minX-t.start.x)/i),c((r.maxX-t.start.x)/i);if(Math.abs(s)>ni)c((r.minY-t.start.y)/s),c((r.maxY-t.start.y)/s);let l=a.toSorted((h,d)=>h-d).filter((h,d,u)=>d===0||Math.abs(h-u[d-1])>ni);return l.slice(1).map((h,d)=>{let u=l[d];return{...t,start:{x:t.start.x+i*u,y:t.start.y+s*u},end:{x:t.start.x+i*h,y:t.start.y+s*h}}})}function Z4n(e){return e.componentObstacles.reduce((t,n)=>({minX:Math.min(t.minX,n.center.x-n.width/2),maxX:Math.max(t.maxX,n.center.x+n.width/2),minY:Math.min(t.minY,n.center.y-n.height/2),maxY:Math.max(t.maxY,n.center.y+n.height/2)}),{minX:Number.POSITIVE_INFINITY,maxX:Number.NEGATIVE_INFINITY,minY:Number.POSITIVE_INFINITY,maxY:Number.NEGATIVE_INFINITY})}function Dot(e,t){if(e.layer!==t.layer)return!1;if(Math.min(e.start.x,e.end.x)>Math.max(t.start.x,t.end.x)+ni||Math.min(t.start.x,t.end.x)>Math.max(e.start.x,e.end.x)+ni||Math.min(e.start.y,e.end.y)>Math.max(t.start.y,t.end.y)+ni||Math.min(t.start.y,t.end.y)>Math.max(e.start.y,e.end.y)+ni)return!1;return Hh(e.start,e.end,t.start,t.end)<=ni}function e3n(e){let t;return(n,o,r)=>{if(!t){t=[];for(let a=0;a<e.length;a++)for(let c=a+2;c<e.length;c++)if(Dot(e[a],e[c]))t.push([a,c])}let i=o+r-1,s=(a,c)=>c===a+2&&Py(n[a].end,n[c].start);for(let[a,c]of t){if(a===o||c===o)continue;let l=a>o?a+r-1:a,h=c>o?c+r-1:c;if(!s(l,h))return!0}for(let a=o;a<=i;a++)for(let c=0;c<n.length;c++){if(Math.abs(a-c)<2)continue;if(c>=o&&c<a)continue;let l=Math.min(a,c),h=Math.max(a,c);if(s(l,h))continue;if(Dot(n[l],n[h]))return!0}return!1}}function Uit(e){let{plan:t,segments:n,replacementStartIndex:o,replacementSegmentCount:r,clearance:i}=e,s=o+r-1,a=g7e(t),c=new Int32Array(n.length),l=new Float64Array(n.length+1);for(let d=0;d<n.length;d++){let u=n[d],_=n[d-1];c[d]=d===0?0:c[d-1]+Number(_.layer!==u.layer||!Py(_.end,u.start)),l[d+1]=l[d]+Gt(u.start,u.end)}let h=(d,u)=>{if(d===u)return 0;if(c[d]!==c[u])return Number.POSITIVE_INFINITY;let _=Math.min(d,u),p=Math.max(d,u);return Math.max(0,l[p]-l[_+1])};for(let d=o;d<=s;d++){let u=n[d],_=t.segments[o];if(u.layer===_.layer&&u.width===_.width&&Hr(u.start,_.start,_.end)<=ni&&Hr(u.end,_.start,_.end)<=ni)continue;for(let[p,m]of n.entries()){let A=u.width/2+m.width/2+i;if(h(d,p)<=A+ni)continue;if(!u_(u,m,i))return!1}for(let p of a){if(!p.spanLayers.includes(u.layer))continue;if(Py(p.center,u.start)||Py(p.center,u.end))continue;let m=p.diameter/2+u.width/2+i,A=(g)=>{let f=g===-1?u.start:u.end,y=0;for(let x=d+g;x>=0&&x<n.length;x+=g){let C=n[x];if(C.layer!==u.layer)return!1;let b=g===-1?C.end:C.start;if(!Py(f,b))return!1;if(y+=Gt(C.start,C.end),y>m+ni)return!1;if(f=g===-1?C.start:C.end,Py(f,p.center))return!0}return!1};if(Hr(p.center,u.start,u.end)<m-ni&&!A(-1)&&!A(1))return!1}}return!0}function t3n(e,t){return e.x>=t.minX-ni&&e.x<=t.maxX+ni&&e.y>=t.minY-ni&&e.y<=t.maxY+ni}function Tf(e,t,n){return{x:e.x+t.x*n,y:e.y+t.y*n}}function FHr(e){let{segment:t,toothCount:n,targetAddedLength:o,pitch:r,placementFraction:i,normalSign:s}=e,a=t.end.x-t.start.x,c=t.end.y-t.start.y,l=Math.hypot(a,c);if(l<=ni)return null;let h=Math.abs(a)<=ni||Math.abs(c)<=ni,d=Math.abs(Math.abs(a)-Math.abs(c))<=ni;if(!h&&!d)return null;let u={x:a/l,y:c/l},_={x:-u.y*s,y:u.x*s},p=Math.min(r/2,o/(8*n*(Math.SQRT2-1)),e.chamferLimit??Number.POSITIVE_INFINITY),m=e.plateauLength??r,A=p*4+m,g=r,f=n*A+Math.max(0,n-1)*g,y=r/4;if(f+y*2>l+ni)return null;let x=4*p*(Math.SQRT2-1);if(o+ni<x*n)return null;let C=(o/n-x)/2,b=l-f-y*2,I=y+Math.max(0,b)*i,v=Tf(t.start,u,I),P=[{...t.start},{...v}];for(let M=0;M<n;M++)if(v=Tf(Tf(v,u,p),_,p),P.push(v),v=Tf(v,_,C),P.push(v),v=Tf(Tf(v,u,p),_,p),P.push(v),v=Tf(v,u,m),P.push(v),v=Tf(Tf(v,u,p),_,-p),P.push(v),v=Tf(v,_,-C),P.push(v),v=Tf(Tf(v,u,p),_,-p),P.push(v),M<n-1)v=Tf(v,u,g),P.push(v);return P.push({...t.end}),P.filter((M,B)=>B===0||!Py(M,P[B-1]))}var n3n=class extends Error{};function yY(e){if(e&&e.remaining--<=0)throw new n3n}function*JQ(e){let{plan:t,bus:n,targetAddedLength:o,clearance:r,sharedBoundary:i,allowInsideDenseBounds:s=!1,allowSourcePrefixMatching:a=!1,denseBoundarySplitApplied:c=!1}=e,l=Z4n(n),h=e3n(t.segments),d=t.segments[0]?.width?t.segments[0].width/2+r:r,u=t.segments.map((m,A)=>({segment:m,segmentIndex:A})).filter(({segment:m,segmentIndex:A})=>m.layer===t.targetLayer||e.allowTransitLayerMatching&&m.layer!==t.sourceLayer&&(n.allowedLayers??[t.targetLayer]).includes(m.layer)&&(n.routableEscapeLayers??n.allowedLayers??[t.targetLayer]).includes(m.layer)||a&&t.via&&t.sourceLayer!==t.targetLayer&&A>0&&A<(t.sourceEscapeSegmentCount??1)&&m.layer===t.sourceLayer).toSorted((m,A)=>Gt(A.segment.start,A.segment.end)-Gt(m.segment.start,m.segment.end));for(let{segment:m,segmentIndex:A}of u){let g=m.width+r,f=Gt(m.start,m.end),y=Math.min(12,Math.max(0,e.chamferLimit===void 0?Math.floor((f/g+0.5)/4):Math.floor((f+g/2)/(4*e.chamferLimit+(e.plateauLength??g)+g))));for(let x=1;x<=y;x++)for(let C of e.placementFractions??[0.5,0,1,0.25,0.75])for(let b of[1,-1]){yY(e.workBudget);let I=FHr({segment:m,toothCount:x,targetAddedLength:o,pitch:g,placementFraction:C,normalSign:b,plateauLength:e.plateauLength,chamferLimit:e.chamferLimit});if(!I)continue;if(I.some((B)=>!t3n(B,i)))continue;if(!s&&I.slice(1,-1).some((B)=>!J4n(B,l,d)))continue;let v=I.slice(1).map((B,T)=>({start:I[T],end:B,width:m.width,layer:m.layer})),P=[...t.segments.slice(0,A),...v,...t.segments.slice(A+1)];if(m.layer===t.sourceLayer&&m.layer!==t.targetLayer&&v.some((B)=>Cl(B,t.sourceObstacle)<B.width/2+r-ni))continue;if(h(P,A,v.length))continue;if(!Uit({plan:t,segments:P,replacementStartIndex:A,replacementSegmentCount:v.length,clearance:r}))continue;let M=T9(t,P,a);if(M)yield M}}if(c)return;let _=t.segments.flatMap((m,A)=>a&&A===0?[m]:HHr({segment:m,bounds:l,margin:d})),p=T9(t,_,a);if(!p)return;yield*JQ({...e,plan:p,denseBoundarySplitApplied:!0})}function*b9e(e){let{plan:t,bus:n,targetAddedLength:o,clearance:r}=e,i=Z4n(n);for(let s=0;s<t.segments.length;s++){let a=t.segments[s],c=a.layer===t.sourceLayer&&a.layer!==t.targetLayer;if(c){if(!e.allowSourcePrefixMatching||!t.via||s===0)continue}else if(a.layer!==t.targetLayer&&(!e.allowTransitLayerMatching||!(n.allowedLayers??[t.targetLayer]).includes(a.layer)||!(n.routableEscapeLayers??n.allowedLayers??[t.targetLayer]).includes(a.layer)))continue;let l=Gt(a.start,a.end);if(l<=ni)continue;let h={x:(a.end.x-a.start.x)/l,y:(a.end.y-a.start.y)/l};for(let d=s+2;d<Math.min(t.segments.length,s+16);d++){if(t.segments.slice(s,d+1).some((x)=>x.layer!==a.layer))break;let _=t.segments[d],p=Gt(_.start,_.end);if(p<=ni)continue;let m={x:(_.end.x-_.start.x)/p,y:(_.end.y-_.start.y)/p};if(Math.abs(h.x+m.x)>ni||Math.abs(h.y+m.y)>ni)continue;yY(e.workBudget);let A=(x)=>({...x,x:x.x+h.x*o/2,y:x.y+h.y*o/2}),g=t.segments.map((x,C)=>C<s||C>d?x:C===s?{...x,end:A(x.end)}:C===d?{...x,start:A(x.start)}:{...x,start:A(x.start),end:A(x.end)}),f=g.slice(s,d+1);if(f.some((x,C)=>{let b=s+C;return g.some((I,v)=>{if(Math.abs(b-v)<2)return!1;let P=Math.min(b,v),M=Math.max(b,v);if(M===P+2&&Py(g[P].end,g[M].start))return!1;return Dot(x,I)})}))continue;if(f.some((x)=>[x.start,x.end].some((C)=>!t3n(C,n.sharedBoundary)||!e.allowInsideDenseBounds&&!J4n(C,i,x.width/2+r))))continue;if(c&&f.some((x)=>Cl(x,t.sourceObstacle)<x.width/2+r-ni))continue;if(!Uit({plan:t,segments:g,replacementStartIndex:s,replacementSegmentCount:d-s+1,clearance:r}))continue;let y=T9(t,g);if(y)yield y}}}function ES(e){let t=e.map((n)=>n.length);return Math.max(...t)-Math.min(...t)}function iY(e,t){return e.filter((n)=>t.has(n.connectionIndex))}function*zHr(e,t,n){let o=e3n(e.segments);for(let{segment:r,index:i}of e.segments.map((s,a)=>({segment:s,index:a})).filter(({segment:s})=>s.layer===e.targetLayer).toSorted((s,a)=>Gt(a.segment.start,a.segment.end)-Gt(s.segment.start,s.segment.end))){let s=Gt(r.start,r.end);if(s<=ni)continue;let a=Math.abs(r.end.x-r.start.x),c=Math.abs(r.end.y-r.start.y);if(a>ni&&c>ni&&Math.abs(a-c)>ni)continue;let l={x:(r.end.x-r.start.x)/s,y:(r.end.y-r.start.y)/s},h=r.width+t;for(let d of[2,3,4,6]){let u=h*d;if(s<2*u+h)continue;for(let _ of[1,-1]){yY(n);let p={x:-l.y*_,y:l.x*_},m=[r.start,Tf(Tf(r.start,l,u),p,u),Tf(Tf(r.end,l,-u),p,u),r.end],A=m.slice(1).map((y,x)=>({...r,start:m[x],end:y})),g=[...e.segments.slice(0,i),...A,...e.segments.slice(i+1)];if(o(g,i,A.length))continue;if(!Uit({plan:e,segments:g,replacementStartIndex:i,replacementSegmentCount:A.length,clearance:t}))continue;let f=T9(e,g);if(f)yield f}}}}function Ey(e){if(e.maximumWorkUnits!==void 0&&(!Number.isSafeInteger(e.maximumWorkUnits)||e.maximumWorkUnits<0))throw Error("maximumWorkUnits must be a non-negative safe integer");let t=e.maximumWorkUnits===void 0?void 0:{remaining:e.maximumWorkUnits},n=Fit(e.inputSrj),o=new Map;for(let i of e.plans){let s=o.get(i.connectionIndex)??[];s.push(i),o.set(i.connectionIndex,s)}e={...e,preparedBuses:e.preparedBuses.filter((i)=>i.maxLengthSkew!==void 0||i.connections.some((s)=>o.has(s.connectionIndex)))};for(let i of e.preparedBuses)if(i.connections.some((s)=>{let a=o.get(s.connectionIndex);return a?.length!==1||a[0].busId!==i.busId||a[0].connectionName!==s.connection.name||e.inputSrj.connections[s.connectionIndex]?.name!==s.connection.name}))return{plans:null,failedBus:i};let r=m7e({srj:e.inputSrj,sharedBoundary:e.sharedBoundary,clearance:e.clearance,allowBlindAndBuriedVias:e.allowBlindAndBuriedVias,allowSameNetMerges:e.allowSameNetMerges});try{let i=Wit(e,r,t);return i.plans?OHr(e,i.plans,n,r,t):i}catch(i){if(i instanceof n3n&&t?.activeBus)return{plans:null,failedBus:e.preparedBuses.find((s)=>s.busId===t.activeBus.busId)??t.activeBus};throw i}}function qgn({plans:e,connectionIndex:t,connectionName:n}){let o=e.filter((s)=>s.connectionIndex===t),r=o[0];if(o.length!==1||!r||r.connectionName!==n||!Number.isFinite(r.length))throw Error(`Differential-pair matching cannot resolve exactly one original plan for ${n}`);let i=[...r.segments,...r.planeEndpointSegments??[]].reduce((s,a)=>s+Gt(a.start,a.end),0);if(!Number.isFinite(i)||Math.abs(i-r.length)>ni)throw Error(`Differential-pair matching found inconsistent copper length for ${r.connectionName}`);return r}function I9e({plans:e,pair:t}){return[qgn({plans:e,connectionIndex:t.connectionIndices[0],connectionName:t.connectionNames[0]}),qgn({plans:e,connectionIndex:t.connectionIndices[1],connectionName:t.connectionNames[1]})]}function OHr(e,t,n,o,r){let i=new Map(e.preparedBuses.flatMap((d)=>d.connections.map((u)=>[u.connectionIndex,{bus:d,connection:u}]))),s=n.filter((d)=>d.connectionIndices.some((u)=>i.has(u)));if(!s.length)return{plans:t};let a=e.preparedBuses.map((d)=>({bus:d,indices:new Set(d.connections.map((u)=>u.connectionIndex))})),c=t,l=(d)=>a.every(({bus:u,indices:_})=>{if(u.maxLengthSkew===void 0)return!0;let p=iY(d,_);return p.length===u.connections.length&&ES(p)<=u.maxLengthSkew+ni});for(let d=0;d<=s.length;d++){for(let u of s){let _=I9e({plans:c,pair:u});if(ES(_)<=u.lengthTolerance+ni)continue;let p=u.connectionIndices.map((C)=>i.get(C)),m=p.find((C)=>C).bus;if(p.some((C)=>!C))return{plans:null,failedBus:m};let A=_[0].length<=_[1].length?0:1,g=p[A].bus,f={...g,connections:p.map((C)=>C.connection),maxLengthSkew:u.lengthTolerance},y=Math.max(..._.map((C)=>C.length)),x=Wit({...e,plans:c,preparedBuses:[f],unroutedSourceBuses:void 0,allowUnconstrainedLaneRerouting:!1,allowPairLaneSpreading:p[0].bus===p[1].bus&&e.allowPairLaneSpreading,candidatePlansAreFeasible:(C)=>l(C)&&I9e({plans:C,pair:u}).every((b)=>b.length<=y+ni)&&(!e.candidatePlansAreFeasible||e.candidatePlansAreFeasible(C))},o,r);if(!x.plans)return{plans:null,failedBus:g};c=x.plans}if(s.every((u)=>ES(I9e({plans:c,pair:u}))<=u.lengthTolerance+ni)){if(!l(c))return{plans:null,failedBus:a.find(({bus:u,indices:_})=>u.maxLengthSkew!==void 0&&ES(iY(c,_))>u.maxLengthSkew+ni).bus};return{plans:c}}}return{plans:null,failedBus:s.find((d)=>ES(I9e({plans:c,pair:d}))>d.lengthTolerance+ni).connectionIndices.map((d)=>i.get(d)?.bus).find((d)=>d)}}function Wit(e,t,n){let{preparedBuses:o,inputSrj:r,sharedBoundary:i,clearance:s,allowBlindAndBuriedVias:a=!0,allowSameNetMerges:c=!1,allowMatchingInsideDenseBounds:l=!1,candidatePlansAreFeasible:h}=e,d=(A)=>(yY(n),t(A)),u=[...e.plans],_=0,p=new Set(e.unroutedSourceBuses?.flatMap((A)=>A.connections.map((g)=>g.connectionIndex))),m=o.filter((A)=>A.maxLengthSkew!==void 0&&A.connections.length>1);if(m.length===0)return{plans:u};for(let A of m){let g=new Set(A.connections.map((C)=>C.connectionIndex));if(n)n.activeBus=A;if(A.termination.type!=="boundary")return{plans:null,failedBus:A};let f=A.connections.length*(e.allowDistributedMatching?24:2),y=new Set;for(let C=0;C<f;C++){let b=iY(u,g);if(b.length!==A.connections.length)return{plans:null,failedBus:A};let I=A.maxLengthSkew,v=ES(b);if(v<=I+ni)break;let P=b.filter((V)=>!y.has(V.connectionIndex)).toSorted((V,O)=>V.length-O.length||V.connectionName.localeCompare(O.connectionName))[0],M=Math.max(...b.map((V)=>V.length));if(!P||M-P.length<=I+ni)return{plans:null,failedBus:A};let B=M-P.length,T=Math.max(ni,B-I+ni),N=[T,T+I*0.1,B-I*0.5,B-I*0.75,B,B+I].filter((V,O,U)=>V>ni&&U.findIndex((j)=>Math.abs(j-V)<ni)===O).toSorted((V,O)=>V-O),D=null,L=(V)=>{let O=u.map((j)=>j===P?V:j),U=iY(O,g);if(ES(U)>v+ni)return null;if(!d(O))return null;if(h&&!h(O))return null;return O};if(e.allowMultiSegmentTuningWindows){let V=Math.max(P.length+T,...Fit(r).filter((O)=>O.connectionIndices.includes(P.connectionIndex)).flatMap((O)=>O.connectionIndices.filter((U)=>U!==P.connectionIndex).flatMap((U)=>{let j=u.find((Y)=>Y.connectionIndex===U);return j?[j.length-O.lengthTolerance+ni]:[]})));for(let O of XLr({plan:P,bus:A,inputSrj:r,plans:u,layerNames:uB(r.layerCount),clearance:s,consumeWork:()=>yY(n)})){let U={...P,additionalVias:[...P.additionalVias??[],...O.addedVias]},j=(re)=>T9(U,[...O.before,...re,...O.after]),Y=(re,Z)=>{let te=A.sharedBoundary;for(let[ce,ue]of Z.entries()){let de=ue.end.x-ue.start.x,me=ue.end.y-ue.start.y;if(Math.min(Math.abs(de),Math.abs(me),Math.abs(Math.abs(de)-Math.abs(me)))>0.0000001)return!1;if([ue.start,ue.end].some((xe)=>xe.x<=te.minX+0.0000001||xe.x>=te.maxX-0.0000001||xe.y<=te.minY+0.0000001||xe.y>=te.maxY-0.0000001))return!1;let ge=Z[ce+1];if(ge){let xe=ge.end.x-ge.start.x,Ee=ge.end.y-ge.start.y;if((de*xe+me*Ee)/(Math.hypot(de,me)*Math.hypot(xe,Ee))<Math.SQRT1_2-0.0000001)return!1}if(r.obstacles.some((xe)=>xe.layers.includes(ue.layer)&&Cl(ue,xe)<ue.width/2+s-0.000000001))return!1}let ie=new Set(Z.map((ce,ue)=>O.before.length+ue));return c8e(re,O.addedVias,s)&&bZ(re,re.segments,s,ie)},X=j(O.window);if(!X||!Y(X,O.window)||!d(u.map((re)=>re===P?X:re)))continue;let K={...X,targetLayer:O.tuningLayer,segments:O.window},J=V-X.length,ee={plan:K,bus:A,targetAddedLength:J,clearance:s,sharedBoundary:A.sharedBoundary,allowInsideDenseBounds:l,workBudget:n},se=O.window[0].width+s,ne=[b9e(ee),...[1,2,4,8].map((re)=>JQ({...ee,plateauLength:se*re,chamferLimit:se/4,placementFractions:[0.5,0,1,0.25,0.75,0.1,0.9]}))];for(let re of ne){for(let Z of re){let te=j(Z.segments);if(!te||!Y(te,Z.segments))continue;if(D=L(te),D)break}if(D)break}if(D)break}}let H=(V)=>{let j=0,Y=(K)=>{if(K.length<=48)return[...K];return Array.from({length:48},(J,ee)=>K[Math.floor(ee*K.length/48)])},X=(K,J)=>{yY(n);let ee=K.length-P.length,se=V-ee;if(se<=ni)return L(K);if(J<=0)return null;let ne=se/J,re=Y([...JQ({plan:K,bus:A,targetAddedLength:ne,clearance:s,sharedBoundary:A.sharedBoundary,allowInsideDenseBounds:l,allowSourcePrefixMatching:e.allowSourcePrefixMatching,allowTransitLayerMatching:e.allowTransitLayerMatching,workBudget:n})]);for(let Z of re){if(j++,j>320)return null;if(!L(Z))continue;let te=X(Z,J-1);if(te)return te}return null};for(let K=2;K<=8;K++){let J=X(P,K);if(J)return J;if(j>320)break}return null};for(let V of N){if(D)break;if(e.allowDistributedMatching){for(let U of b9e({plan:P,bus:A,targetAddedLength:V,clearance:s,allowInsideDenseBounds:l,allowSourcePrefixMatching:e.allowSourcePrefixMatching,allowTransitLayerMatching:e.allowTransitLayerMatching,workBudget:n}))if(D=L(U),D)break;if(D)break}let O=JQ({plan:P,bus:A,targetAddedLength:V,clearance:s,sharedBoundary:A.sharedBoundary,allowInsideDenseBounds:l,allowSourcePrefixMatching:e.allowSourcePrefixMatching,allowTransitLayerMatching:e.allowTransitLayerMatching,workBudget:n});for(let U of O){if(D=L(U),!D)continue;break}if(!D&&Math.abs(V-T)<=ni){if(e.allowDistributedMatching)for(let U of[V/2,V/4,Math.min(V,1),Math.min(V,0.5),Math.min(V,0.25),Math.min(V,0.1)]){if(U<=ni)continue;let j={plan:P,bus:A,targetAddedLength:U,clearance:s,sharedBoundary:A.sharedBoundary,allowInsideDenseBounds:l,allowSourcePrefixMatching:e.allowSourcePrefixMatching,allowTransitLayerMatching:e.allowTransitLayerMatching,workBudget:n};for(let Y of[b9e(j),JQ(j)]){for(let X of Y)if(D=L(X),D)break;if(D)break}if(D)break}if(!D)D=H(V)}if(D)break}if(!D&&e.allowAdditionalMatchingVias)for(let V of LHr({plan:P,bus:A,layerNames:uB(r.layerCount),clearance:s,workBudget:n})){if(!d(u.map((U)=>U===P?V.plan:U)))continue;let O={plan:{...V.plan,targetLayer:V.tuningLayer},bus:A,targetAddedLength:T,clearance:s,sharedBoundary:A.sharedBoundary,allowInsideDenseBounds:l,workBudget:n};for(let U of[b9e(O),JQ(O)]){for(let j of U){if(!c8e(j,V.addedVias,s))continue;if(D=L({...j,targetLayer:P.targetLayer}),D)break}if(D)break}if(D)break}if(!D&&e.allowPairLaneSpreading&&A.connections.length===2){let V=b.find((U)=>U!==P),O=0;for(let U of zHr(V,s,n)){let j=u.map((X)=>X===V?U:X);if(!d(j))continue;if(h&&!h(j))continue;let Y=Wit({...e,plans:j,preparedBuses:[A],allowPairLaneSpreading:!1},t,n);if(Y.plans){D=Y.plans;break}if(++O>=4)break}}if(!D&&e.allowUnconstrainedLaneRerouting){let V=0;e:for(let O of N){let U=JQ({plan:P,bus:A,targetAddedLength:O,clearance:s,sharedBoundary:A.sharedBoundary,allowInsideDenseBounds:l,allowSourcePrefixMatching:e.allowSourcePrefixMatching,allowTransitLayerMatching:e.allowTransitLayerMatching,workBudget:n});for(let j of U){if(!d([j]))continue;let Y=u.filter((ee)=>ee!==P&&!t.mutuallyClear([j,ee]));if(Y.length!==1)continue;let X=Y[0],K=o.find((ee)=>ee.busId===X.busId);if(!K||K.termination.type!=="boundary"||K.maxLengthSkew!==void 0||K.connections.length!==1||!X.via||X.additionalVias?.length||X.planeEndpointVia||X.segments.filter((ee)=>ee.layer===X.sourceLayer).length!==1)continue;let J=u.map((ee)=>ee===P?j:ee);for(let ee of[!0,!1]){if(V++>=4)break e;let se=X4n({srj:r,bus:K,terminals:[{connection:K.connections[0],viaPoint:X.via.center,exitPoint:X.exitPoint}],targetLayer:X.targetLayer,acceptedPlans:J.filter((Z)=>Z!==X),layerNames:uB(r.layerCount),traceWidth:X.segments[0].width,viaDiameter:X.via.diameter,viaHoleDiameter:X.via.holeDiameter,clearance:s,allowBlindAndBuriedVias:a,allowSameNetMerges:c,gridStepDivisor:2,alignGridToPads:ee,maximumRouteOrderAttempts:1,preferTargetDirectedLaneBias:!0})?.[0];if(!se)continue;let ne=T9(X,[X.segments[0],...se.segments.slice(1)]);if(!ne)continue;let re=J.map((Z)=>Z===X?ne:Z);if(ES(iY(re,g))>I+ni||!d(re)||h&&!h(re))continue;D=re;break e}}}}if(!D&&e.unroutedSourceBuses?.length)e:for(let V of N)for(let O of JQ({plan:P,bus:A,targetAddedLength:V,clearance:s,sharedBoundary:A.sharedBoundary,allowInsideDenseBounds:l,allowSourcePrefixMatching:e.allowSourcePrefixMatching,allowTransitLayerMatching:e.allowTransitLayerMatching,workBudget:n})){if(_>=4)break e;if(!d([O]))continue;let U=u.filter((Y)=>Y!==P&&!t.mutuallyClear([O,Y]));if(U.length!==1||!p.has(U[0].connectionIndex))continue;_++;let j=QHr({inputSrj:r,plans:u.map((Y)=>Y===P?O:Y),unroutedSourceBuses:e.unroutedSourceBuses,clearance:s});if(!j||ES(iY(j,g))>v+ni||!d(j)||h&&!h(j))continue;D=j;break e}if(!D){if(e.allowDistributedMatching){y.add(P.connectionIndex);continue}return{plans:null,failedBus:A}}u=D}let x=iY(u,g);if(ES(x)>A.maxLengthSkew+ni)return{plans:null,failedBus:A}}return{plans:u}}function o3n(e){let{points:t,topZ:n,traceWidth:o,viaDiameter:r,clearance:i}=e,s=[],a=[],c=0;for(let h=0;h+1<t.length;h++){let d=t[h],u=t[h+1];if(d.z!==u.z){if(Gt(d,u)>0.0000001)return!1;a.push({center:d,fromZ:d.z,toZ:u.z,edge:h}),c++}else if(Gt(d,u)>0.000000001)s.push({a:d,b:u,z:d.z,edge:h,run:c})}let l=s.filter((h)=>h.z===n);for(let h=0;h<l.length;h++)for(let d=h+1;d<l.length;d++){let u=l[h],_=l[d];if(u.run!==_.run&&Hh(u.a,u.b,_.a,_.b)<o+i-0.000000001)return!1}for(let h=0;h<a.length;h++){let d=a[h];for(let p=h+1;p<a.length;p++)if(Gt(d.center,a[p].center)<r+i-0.000000001)return!1;let u=(r+o)/2+i,_=new Set;for(let p of[-1,1]){let m=d.center,A=0,g=p===-1?d.fromZ:d.toZ;for(let f=d.edge+p;f>=0&&f+1<t.length;f+=p){let y=t[f],x=t[f+1],C=p===-1?x:y,b=p===-1?y:x;if(y.z!==g||x.z!==g||Gt(m,C)>0.0000001||A>u+0.0000001)break;_.add(f),A+=Gt(C,b),m=b}}for(let p of s)if(!_.has(p.edge)&&Hr(d.center,p.a,p.b)<u-0.000000001)return!1}return!0}var _g=0.0000001,Qtt=180;function VHr(e,t){let n=t.x-e.x,o=t.y-e.y,r=Math.min(Math.abs(n),Math.abs(o));if(Math.abs(n)<_g||Math.abs(o)<_g||Math.abs(Math.abs(n)-Math.abs(o))<_g)return[[e,t]];return[[e,{x:e.x+Math.sign(n)*r,y:e.y+Math.sign(o)*r,z:e.z},t],[e,{x:t.x-Math.sign(n)*r,y:t.y-Math.sign(o)*r,z:e.z},t],[e,{x:e.x,y:t.y,z:e.z},t],[e,{x:t.x,y:e.y,z:e.z},t]]}function YHr(e,t,n){if(e.length<3)return e;let o=e.length,r=o<=Qtt?e.map((l,h)=>h):[...new Set([0,...Array.from({length:Qtt-2},(l,h)=>Math.round((h+1)*(o-1)/(Qtt-1))),o-1])],i=new Float64Array(o).fill(1/0),s=Array(o);i[0]=0;for(let l=1;l<r.length;l++){let h=r[l];for(let d=0;d<l;d++){let u=r[d],_=e[u],p=e[h],m=Math.abs(p.x-_.x),A=Math.abs(p.y-_.y),g=Math.max(m,A)+(Math.SQRT2-1)*Math.min(m,A);if(i[u]+g>=i[h]-_g)continue;for(let f of VHr(_,p)){let y=f.slice(1).reduce((x,C,b)=>x+Gt(f[b],C),0);if(i[u]+y>=i[h]-_g||!f.slice(1).every((x,C)=>n(f[C],x)))continue;i[h]=i[u]+y,s[h]={previous:u,points:f}}}if(!s[h]){let d=r[l-1],u=e.slice(d,h+1);i[h]=i[d]+u.slice(1).reduce((_,p,m)=>_+Gt(u[m],p),0),s[h]={previous:d,points:u}}}let a=[];for(let l=o-1;l>0;){let h=s[l];if(!h)throw Error("FanoutSolver: shortcut graph lost a retained path");a.unshift(h.points),l=h.previous}let c=a.flatMap((l,h)=>h?l.slice(1):l);return PY({points:c,chamfer:t/4,segmentIsClear:n})??e}function Jgn(e,t,n){if(e.x<t.minX-_g||e.x>t.maxX+_g||e.y<t.minY-_g||e.y>t.maxY+_g)return!1;return!(Math.abs(e.x-t.minX)<_g||Math.abs(e.x-t.maxX)<_g||Math.abs(e.y-t.minY)<_g||Math.abs(e.y-t.maxY)<_g)||Gt(e,n)<_g}function GJ(e){let{inputSrj:t,preparedBuses:n,layerNames:o,clearance:r,allowBlindAndBuriedVias:i=!0,allowSameNetMerges:s=!1}=e,a=new Map(n.map((u)=>[u.busId,u])),c=new Map(n.map((u)=>[u.busId,Math.min(...e.plans.filter((_)=>_.busId===u.busId).map((_)=>_.length))])),l=oP(t,i),h=[...e.plans];for(let u=0;u<3;u++){let _=!1;for(let p of h.toSorted((m,A)=>A.length-m.length)){let m=a.get(p.busId),A=c.get(p.busId);if(!m||A===void 0||!Number.isFinite(A)||m.maxLengthSkew===void 0||p.termination.type!=="boundary"||p.length<=A+m.maxLengthSkew+_g)continue;if(e.selectedBusIds&&!e.selectedBusIds.has(p.busId))continue;if(e.selectedConnectionIndices&&!e.selectedConnectionIndices.has(p.connectionIndex))continue;let g=p.trace.route.findIndex((D)=>D.route_type==="via");if(g<0)continue;let f=(D)=>D===p.connectionName||s&&e5(t,D,p.connectionName),y=h.filter((D)=>D.connectionIndex!==p.connectionIndex&&!f(D.connectionName)),x=l.filter((D)=>!f(D.connectionName)),C=new wue([...y.flatMap((D)=>[...D.segments,...D.planeEndpointSegments??[]]),...x.flatMap((D)=>D.segments)]),b=[...y.flatMap((D)=>[D.via,...D.additionalVias??[],D.planeEndpointVia].filter((L)=>!!L)),...x.flatMap((D)=>D.vias)],I=t.obstacles.filter((D)=>!(s&&kb(t,D,p.connectionName))),v=g+1;if(e.allowSourcePrefixShortcuts){v=1;while(v<g){let D=p.trace.route[v];if(D.route_type==="wire"&&r5(D,p.sourceObstacle)>=D.width/2+r-0.000000001)break;v++}}let P=p.trace.route.slice(0,v),M=v;while(M<p.trace.route.length){let D=p.trace.route[M];if(D.route_type!=="wire"){P.push(D),M++;continue}let L=M+1;while(L<p.trace.route.length){let J=p.trace.route[L];if(J.route_type!=="wire"||J.layer!==D.layer)break;L++}let H=p.trace.route.slice(M,L),V=o.indexOf(D.layer);if(V<0)throw Error(`FanoutSolver: shortcut uses unknown layer ${D.layer}`);let O=H.map((J)=>({x:J.x,y:J.y,z:V})),U=Math.max(...H.map((J)=>J.width)),j=P.at(-1),Y=(J,ee)=>{let se={start:J,end:ee,layer:D.layer,width:U};return Jgn(J,m.sharedBoundary,p.exitPoint)&&Jgn(ee,m.sharedBoundary,p.exitPoint)&&I.every((ne)=>!ne.layers.includes(D.layer)||M<g&&ne===p.sourceObstacle&&j?.route_type==="wire"&&Hr(J,j,O[0])<_g&&Hr(ee,j,O[0])<_g||Cl(se,ne)>=U/2+r-0.000000001)&&C.querySegment(se,r).every((ne)=>u_(se,ne,r))&&b.every((ne)=>!ne.spanLayers.includes(D.layer)||Hr(ne.center,J,ee)>=(U+ne.diameter)/2+r-0.000000001)},X=YHr(O,U,Y),K;if(M<g&&j?.route_type==="wire"&&j.layer===D.layer){let J=PY({points:[{x:j.x,y:j.y,z:V},...X],chamfer:U/4,segmentIsClear:Y});if(J)P.pop(),K=j,X=J;else X=O}P.push(...X.map((J,ee)=>({...ee===0?K:void 0,route_type:"wire",x:J.x,y:J.y,layer:D.layer,width:U}))),M=L}let B={...p.trace,route:P},T=u7e(t,B,i).segments,N={...p,trace:B,segments:T,...e.allowSourcePrefixShortcuts?{sourceEscapeSegmentCount:T.findIndex((D)=>D.layer!==p.sourceLayer)}:{},length:T.reduce((D,L)=>D+Gt(L.start,L.end),0)};if(N.length<A-_g||N.length>=p.length-_g)continue;if(e.allowSourcePrefixShortcuts&&!o3n({points:B.route.flatMap((D)=>D.route_type==="wire"?[{x:D.x,y:D.y,z:o.indexOf(D.layer)}]:[]),topZ:o.indexOf(p.sourceLayer),traceWidth:e.traceWidth,viaDiameter:p.via.diameter,clearance:r}))continue;if(!q0({plans:[N],srj:{...t,traces:[...t.traces??[],...y.flatMap((D)=>[D.trace,...D.planeEndpointTrace?[D.planeEndpointTrace]:[]])]},sharedBoundary:m.sharedBoundary,clearance:r,allowBlindAndBuriedVias:i,allowSameNetMerges:s}))continue;h=h.map((D)=>D===p?N:D),_=!0}if(!_)break}return kd({inputSrj:t,routedSrj:{...t,traces:[...t.traces??[],...h.flatMap((u)=>[u.trace,...u.planeEndpointTrace?[u.planeEndpointTrace]:[]])]},clearance:r,allowBlindAndBuriedVias:i}).valid?h:null}function GHr(e,t,n,o,r,i,s){if(s&&n==="top"&&Cl({start:e,end:e,width:o,layer:n},i)<o/2+r-0.000000001&&Gt(t,s.sourcePoint)>=Gt(e,s.sourcePoint)-0.000000001)return s.connectionName;return}function UHr(e){let t=new Int32Array(e.planeSize+1),n=[],o=[];for(let r=0;r<e.planeSize;r++){t[r]=n.length;let i=new Set;for(let l=e.neighborOffset[r];l<e.neighborOffset[r+1];l++){let h=e.neighborIds[l];i.add(h),n.push(h),o.push(e.neighborCosts[l])}let s=new Set,a=e.cellMaxX[r]-e.cellMinX[r],c=e.cellMaxY[r]-e.cellMinY[r];for(let l=e.neighborOffset[r];l<e.neighborOffset[r+1];l++){let h=e.neighborIds[l];for(let d=e.neighborOffset[h];d<e.neighborOffset[h+1];d++){let u=e.neighborIds[d];if(u===r||i.has(u))continue;let _=Math.abs(e.cellCenterX[u]-e.cellCenterX[r]),p=Math.abs(e.cellCenterY[u]-e.cellCenterY[r]);if(_<0.000000001||Math.abs(_-p)>0.000000001||Math.abs(_-a)>0.000000001||Math.abs(p-c)>0.000000001||Math.abs(e.cellMaxX[u]-e.cellMinX[u]-a)>0.000000001||Math.abs(e.cellMaxY[u]-e.cellMinY[u]-c)>0.000000001)continue;s.add(u)}}for(let l of[...s].sort((h,d)=>h-d))n.push(l),o.push(Math.hypot(e.cellCenterX[l]-e.cellCenterX[r],e.cellCenterY[l]-e.cellCenterY[r]))}return t[e.planeSize]=n.length,{neighborOffset:t,neighborIds:Int32Array.from(n),neighborCosts:Float32Array.from(o)}}function WHr(e){let{edge:t,bounds:n,exit:o,approachLength:r}=e;if(!["left","right","top","bottom"].includes(t))throw Error("Terminal approach requires a valid boundary edge");if(!Number.isFinite(r)||r<=0)throw Error("terminalApproachLength must be finite and positive");let i=t==="left"||t==="right",s=t==="left"?n.minX:t==="right"?n.maxX:t==="bottom"?n.minY:n.maxY,a=t==="left"||t==="bottom"?-1:1,c=i?{x:o.x-a*r,y:o.y}:{x:o.x,y:o.y-a*r};if(![o.x,o.y,c.x,c.y,n.minX,n.maxX,n.minY,n.maxY].every(Number.isFinite)||Math.abs((i?o.x:o.y)-s)>0.0000001||c.x<=n.minX||c.x>=n.maxX||c.y<=n.minY||c.y>=n.maxY)throw Error("Terminal approach must end on its shared edge and start inside it");return{connectionName:e.connectionName,edge:t,layer:e.layer,exit:{...o},goal:c}}function A7e(e,t){let{goal:n,edge:o}=t,r=o==="left"||o==="right",i=o==="left"||o==="bottom"?-1:1,s=r?n.x-e.x:n.y-e.y,a=r?n.y-e.y:n.x-e.x,c=i*s;if(c<Math.abs(a)-0.000000001){if(c<=0.000000001)return null;let h=r?{x:e.x,y:n.y-Math.sign(a)*c}:{x:n.x-Math.sign(a)*c,y:e.y};return[e,h,n]}let l=r?{x:e.x+i*Math.abs(a),y:n.y}:{x:n.x,y:e.y+i*Math.abs(a)};return[e,l,n].filter((h,d,u)=>d===0||Gt(h,u[d-1])>0.0000000001)}var XHr=(e,t,n=t)=>e.some((o)=>Math.max(t.x,n.x)>=o.minX&&Math.min(t.x,n.x)<=o.maxX&&Math.max(t.y,n.y)>=o.minY&&Math.min(t.y,n.y)<=o.maxY);function r3n(e,t,n){let o=[],r=0;for(let[c,l]of e.entries()){if(l.layer===n&&Hr(t,l.start,l.end)<0.00000001){let h=r+Gt(l.start,t);if(!o.some((d)=>Math.abs(d.offset-h)<0.00000001))o.push({index:c,offset:h})}r+=Gt(l.start,l.end)}if(o.length!==1)return null;let i=o[0].index,s=e[i],a=[...e];if(Gt(t,s.end)<0.00000001)i++;else if(Gt(t,s.start)>0.00000001)a.splice(i,1,{...s,end:t},{...s,start:t}),i++;if(i>=a.length)return null;return{segments:a,changed:new Set(a.slice(i).map((c,l)=>i+l))}}function Not(e){let{plan:t,splice:n,clearance:o,maximumJoinLength:r}=e,{rawSegments:i,firstEntrySegmentIndex:s}=n;if(!Number.isInteger(s)||s<0||s>=i.length||!Number.isFinite(r)||r<0)return!1;let a=(u,_,p=u)=>{let m={...t,segments:[...u]},A=[t.via,...t.additionalVias??[],t.planeEndpointVia].filter((g)=>!!g).filter((g)=>[..._].some((f)=>{let y=u[f];return g.spanLayers.includes(y.layer)&&Hr(g.center,y.start,y.end)<(g.diameter+y.width)/2+o+0.0000001}));return c8e({...m,segments:[...p]},A,o)&&bZ(m,u,o,_)};if(!a(i,new Set(i.slice(s).map((u,_)=>s+_))))return!1;let c=i[s],l=i[s-1],h=c.start;if(l?.layer===c.layer&&Gt(l.end,h)<0.00000001){let u=l.start;for(let m=s-2;m>=0;m--){let A=i[m];if(A.layer!==l.layer||Gt(A.end,u)>0.00000001)break;let g=u.x-A.start.x,f=u.y-A.start.y,y=h.x-u.x,x=h.y-u.y;if(Math.abs(g*x-f*y)>=0.0000000001||g*y+f*x<0)break;u=A.start}let _=Gt(u,h);if(_<0.0000000001)return!1;let p=Math.min(r,_/3);h={x:h.x+(u.x-h.x)*p/_,y:h.y+(u.y-h.y)*p/_}}let d=r3n(t.segments,h,c.layer);return!!d&&a(d.segments,d.changed,t.segments)}function*jHr(e){let{splice:t,connector:n,clearance:o}=e,r=t.firstEntrySegmentIndex,i=t.rawSegments[r];if(!i||i.layer!==n.layer)return;let s=4*(i.width+o),a=0;for(let c=r;c>=Math.max(0,r-16);c--){let l=t.rawSegments[c];if(l.layer!==n.layer||c<r&&Gt(l.end,t.rawSegments[c+1].start)>0.0000001)break;if(c<r)a+=Gt(l.start,l.end);if(a>s+0.0000001)break;let h=l.start,{goal:d,exit:u,edge:_}=n,p=_==="left"||_==="right",m=_==="left"||_==="bottom"?-1:1,A=m*(p?d.x-h.x:d.y-h.y),g=Math.abs(p?d.y-h.y:d.x-h.x),f=[];if(c<r){let y=A7e(h,n);if(y)f.push(y)}if(A>=g-0.000000001){let y=p?{x:d.x-m*g,y:h.y}:{x:h.x,y:d.y-m*g};f.push([h,y,d])}for(let y of f){let x=[...y,u].filter((C,b,I)=>b===0||Gt(C,I[b-1])>0.0000000001);yield{replacement:x.slice(1).map((C,b)=>({...l,start:x[b],end:C})),firstEntrySegmentIndex:c}}}}function KHr(e){let t=[...e.plans],n=new Map(e.splices);for(let[o,r]of t.entries()){let i=e.connectors.get(r.connectionName);if(!i)continue;let s=n.get(r.connectionName);if(!s)return null;if(Not({plan:r,splice:s,maximumJoinLength:0,clearance:e.clearance}))continue;let a=t.filter((l)=>l.connectionIndex!==r.connectionIndex),c=!1;for(let{replacement:l,firstEntrySegmentIndex:h}of jHr({splice:s,connector:i,clearance:e.clearance})){let d=l[0],u=r3n(r.segments,d.start,d.layer);if(!u)continue;let _=Math.min(...u.changed),p=[...u.segments.slice(0,_),...l],m=T9(r,p);if(!m)continue;let A={rawSegments:[...s.rawSegments.slice(0,h),...l],firstEntrySegmentIndex:h};if(!Not({plan:m,splice:A,maximumJoinLength:0,clearance:e.clearance}))continue;if(l.some((g)=>!e.segmentIsClear(g,r.connectionName)||a.some((f)=>[...f.segments,...f.planeEndpointSegments??[]].some((y)=>!u_(g,y,e.clearance))||[f.via,...f.additionalVias??[],f.planeEndpointVia].filter((y)=>!!y).some((y)=>y.spanLayers.includes(g.layer)&&Hr(y.center,g.start,g.end)<(y.diameter+g.width)/2+e.clearance-0.000000001))))continue;t[o]=m,n.set(r.connectionName,A),c=!0;break}if(!c)return null}return{plans:t,splices:n}}function $Hr(e){let{grid:t}=e;if(!Number.isFinite(e.margin)||e.margin<0)throw Error("Terminal connector margin must be finite and non-negative");let n=(l)=>({x:t.cellCenterX[l],y:t.cellCenterY[l]}),o=new Map,r=new Set,i=new Map;for(let{connector:l,cellId:h}of e.terminals){if(!Number.isInteger(h)||h<0||h>=t.planeSize)throw Error("Invalid native terminal cell");let d=new Set([h]);for(let m=t.neighborOffset[h];m<t.neighborOffset[h+1];m++){let A=t.neighborIds[m];d.add(A);for(let g=t.neighborOffset[A];g<t.neighborOffset[A+1];g++)d.add(t.neighborIds[g])}let u=[l.exit,l.goal,...[...d].map(n)],_={minX:Math.min(...u.map((m)=>m.x))-e.margin,maxX:Math.max(...u.map((m)=>m.x))+e.margin,minY:Math.min(...u.map((m)=>m.y))-e.margin,maxY:Math.max(...u.map((m)=>m.y))+e.margin},p=i.get(l.edge);i.set(l.edge,p?{minX:Math.min(p.minX,_.minX),maxX:Math.max(p.maxX,_.maxX),minY:Math.min(p.minY,_.minY),maxY:Math.max(p.maxY,_.maxY)}:_);for(let m of d){if(m===h)continue;let A=!1;for(let y=t.neighborOffset[m];y<t.neighborOffset[m+1];y++)if(t.neighborIds[y]===h)A=!0;if(A)continue;let g=A7e(n(m),l);if(!g||g.slice(1).some((y,x)=>!e.segmentIsClear(g[x],y,l)))continue;let f=o.get(m)??new Set;f.add(h),o.set(m,f),r.add(`${m}:${h}`)}}let s=new Int32Array(t.planeSize+1),a=[],c=[];for(let l=0;l<t.planeSize;l++){s[l]=a.length;for(let h=t.neighborOffset[l];h<t.neighborOffset[l+1];h++)a.push(t.neighborIds[h]),c.push(t.neighborCosts[h]);for(let h of o.get(l)??[])a.push(h),c.push(Gt(n(l),n(h)))}return s[t.planeSize]=a.length,{neighborOffset:s,neighborIds:Int32Array.from(a),neighborCosts:Float32Array.from(c),extendedEdges:r,regions:[...i.values()]}}function qHr(e,t,n){let o=e.route.at(-2),r=e.route.at(-1);if(!o||!r||Gt(r,t.goal)>0.0000001)throw Error("Native terminal route does not end at its reserved goal");let i=e.route.slice(0,-2),s=o;if(o.z!==r.z){if(Gt(o,n)>0.0000001)throw Error("Native terminal via has a noncoincident departure");i=[...i,o],s={...n,z:r.z}}let a=A7e(s,t);if(!a)throw Error("Native terminal route has no perpendicular entry");return{...e,route:[...i,...a.map((c)=>({...c,z:r.z})),{...t.exit,z:r.z}]}}var JHr=class{constructor(e){this.params=e,this.padding=Math.max(e.traceWidth,e.viaDiameter)+e.clearance,this.cellSize=Math.max(e.traceWidth+e.clearance,e.viaDiameter)}params;dirty=!0;buckets=new Map;cellSize;padding;invalidate(){this.dirty=!0}intersects(e,t=e){return XHr(this.params.regions,e,t)}cells(e,t,n,o){for(let r=Math.floor((Math.min(e.x,t.x)-n)/this.cellSize);r<=Math.floor((Math.max(e.x,t.x)+n)/this.cellSize);r++)for(let i=Math.floor((Math.min(e.y,t.y)-n)/this.cellSize);i<=Math.floor((Math.max(e.y,t.y)+n)/this.cellSize);i++)o(`${r},${i}`)}refresh(){if(!this.dirty)return;this.buckets.clear();let e=(t,n,o=n)=>{if(!this.intersects(n,o))return;this.cells(n,o,this.padding,(r)=>{let i=this.buckets.get(r)??new Set;i.add(t),this.buckets.set(r,i)})};for(let t of this.params.getRoutes()){for(let n=1;n<t.route.length;n++){let o=t.route[n-1],r=t.route[n];if(o.z===r.z)e({kind:"segment",owner:t.connectionName,a:o,b:r},o,r)}for(let n of t.vias)e({kind:"via",owner:t.connectionName,center:n},n)}this.dirty=!1}nearby(e,t=e){this.refresh();let n=new Set;return this.cells(e,t,0,(o)=>{for(let r of this.buckets.get(o)??[])n.add(r)}),n}blockingSegmentOwners(e,t,n){let o=new Set;for(let r=1;r<t.length;r++){let i=t[r-1],s=t[r];if(!this.intersects(i,s))continue;for(let a of this.nearby(i,s)){if(a.owner===e)continue;let c=a.kind==="via"?Hr(a.center,i,s):a.a.z===n?Hh(i,s,a.a,a.b):1/0,l=(this.params.traceWidth+(a.kind==="via"?this.params.viaDiameter:this.params.traceWidth))/2+this.params.clearance;if(c<l-0.000000001)o.add(a.owner)}}return o}blockingViaOwners(e,t){let n=new Set;if(!this.intersects(t))return n;for(let o of this.nearby(t)){if(o.owner===e)continue;let r=o.kind==="via"?Gt(t,o.center):Hr(t,o.a,o.b),i=(this.params.viaDiameter+(o.kind==="via"?this.params.viaDiameter:this.params.traceWidth))/2+this.params.clearance;if(r<i-0.000000001)n.add(o.owner)}return n}};function ZHr(e){if(typeof e.fillViaOccupants!=="function"||typeof e.pushFlatOccupants!=="function")throw Error("FanoutSolver: native via-occupant interface changed");let t=e.fillViaOccupants.bind(e),n=e.pushFlatOccupants.bind(e),o=new Map;e.fillViaOccupants=(r,i)=>{let s=o.get(r);if(s){let l=e._viaOccs;l.length=0;let{usedCellsFlat:h,sharedCellsFlat:d}=e;for(let u=0;u<s.length;u++){let _=s[u];if(h&&d&&h[_]===-1&&!d[_])continue;n(_,i,l)}return}let a=[],c=e.pushFlatOccupants;e.pushFlatOccupants=(l,h,d)=>{a.push(l),n(l,h,d)};try{t(r,i)}finally{e.pushFlatOccupants=c}o.set(r,Int32Array.from(a))}}var eFr=0.000000001;function Rot(e){let{vias:t,activeConnectionIndices:n,traceWidth:o,clearance:r,gridStep:i}=e;for(let[u,_]of[["traceWidth",o],["gridStep",i]])if(!Number.isFinite(_)||_<=0)throw Error(`FanoutSolver: ${u} must be positive and finite`);if(!Number.isFinite(r)||r<0)throw Error("FanoutSolver: clearance must be non-negative and finite");for(let u of t)if(!Number.isSafeInteger(u.connectionIndex)||u.connectionIndex<0||!Number.isFinite(u.center.x)||!Number.isFinite(u.center.y)||!Number.isFinite(u.diameter)||u.diameter<=0)throw Error("FanoutSolver: invalid via channel grid site");let s=(u)=>(u%i+i)%i,a=(u)=>{let _=s(u+i/2)-i/2;return Math.abs(_)<Number.EPSILON?0:_},c=(o+r)/i,l=Math.ceil(c-Number.EPSILON*Math.max(1,Math.abs(c))*4),h=Number.EPSILON*Math.max(1,i)*32,d=(u)=>{let _=u==="x"?"y":"x",p=t.toSorted((C,b)=>C.center[_]-b.center[_]||C.center[u]-b.center[u]||C.connectionIndex-b.connectionIndex),m=[];for(let C of p){let b=m.at(-1);if(b&&Math.abs(b[0].center[_]-C.center[_])<=eFr)b.push(C);else m.push([C])}let A=[];for(let C of m){C.sort((b,I)=>b.center[u]-I.center[u]);for(let b=1;b<C.length;b++){let I=C[b-1],v=C[b],P=I.center[u]+I.diameter/2+o/2+r,M=v.center[u]-v.diameter/2-o/2-r-l*i;if(!Number.isFinite(P)||!Number.isFinite(M))throw Error("FanoutSolver: non-finite via channel bounds");if(M<P-h)continue;A.push({start:s(P),length:Math.max(0,M-P),active:n.has(I.connectionIndex)||n.has(v.connectionIndex)})}}let g=A.filter((C)=>C.length<i-h).flatMap((C)=>[C.start,s(C.start+C.length)]).sort((C,b)=>C-b).filter((C,b,I)=>b===0||C-I[b-1]>h);if(g.length===0)return 0;let f=(C)=>{let b=0,I=0;for(let v of A)if(v.length>=i-h||s(C-v.start)<=v.length+h){if(I++,v.active)b++}return[b,I]},y={active:-1,total:-1,width:0,phase:0},x=(C,b)=>{C=a(C);let[I,v]=f(C);if(I>y.active||I===y.active&&(v>y.total||v===y.total&&(b>y.width+h||Math.abs(b-y.width)<=h&&(Math.abs(C)<Math.abs(y.phase)-h||Math.abs(Math.abs(C)-Math.abs(y.phase))<=h&&C<y.phase))))y={active:I,total:v,width:b,phase:C}};for(let C=0;C<g.length;C++){let b=g[C],I=g[C+1]??g[0]+i;if(I-b>h)x((b+I)/2,I-b)}if(y.total===0)for(let C of g)x(C,0);return y.phase};return{x:d("x"),y:d("y")}}var tFr=class{constructor(e,t,n,o){this.planeSize=e,this.neighborOffset=n,this.neighborIds=o,this.layerStride=o.length+e,this.classes=new Uint32Array(this.layerStride*t)}planeSize;neighborOffset;neighborIds;classes;layerStride;values=[void 0,!0,!1];ownerIds=new Map;overflow=new Map;getSlot(e,t){let n=e<this.planeSize?e:e%this.planeSize,o=e<this.planeSize?0:(e-n)/this.planeSize*this.layerStride;if(t===n)return o+this.neighborIds.length+n;let r=this.neighborOffset[n+1];for(let i=this.neighborOffset[n];i<r;i++)if(this.neighborIds[i]===t)return o+i;return-1}get(e,t,n=!1){if(n)return;let o=this.getSlot(e,t);return o<0?this.overflow.get(e*this.planeSize+t):this.values[this.classes[o]]}set(e,t,n,o=!1){if(o)return;let r=this.getSlot(e,t);if(r<0){this.overflow.set(e*this.planeSize+t,n);return}let i=n===!0?1:n===!1?2:this.ownerIds.get(n);if(i===void 0)i=this.values.length,this.values.push(n),this.ownerIds.set(n,i);this.classes[r]=i}};function nFr(e,t,n,o){let r=e.planeSize*e.layers;e.visitedStamp=new Uint32Array(r*3),e.bestGStamp=new Uint32Array(r*3),e.bestGValue=new Float64Array(r*3);let i=new Uint8Array(1024),s=new Int32Array(1024),a=0,c=-1,l=-1,h=-1,d=0,u=()=>t[e.activeConnId]===!0,_=(g,f,y,x,C)=>g===0&&f===n&&x!==n?1:g===1&&f!==n&&f===x&&y!==C?2:g,p=e.nodePool.push.bind(e.nodePool);e.nodePool.push=(g,f,y,x,C,b)=>{let I=p(g,f,y,x,C,b);if(I>=i.length){let v=Math.max(I+1,i.length*2),P=new Uint8Array(v),M=new Int32Array(v);P.set(i),M.set(s),i=P,s=M}if(x<0||!u()){i[I]=0,s[I]=-1,d=0;let v=e.activeConnSeg;if(u()&&v&&v.startCellId===v.endCellId&&v.startZ===v.endZ)e.failed=!0}else{let v=i[x],P=e.nodePool.z[x];i[I]=_(v,P,e.nodePool.cellId[x],g,f),s[I]=v===0&&P===n&&g!==n?f:s[x]}return I};let m=e.heap.pop.bind(e.heap);e.heap.pop=()=>{let g=m();return a=i[g],d=a,c=s[g],l=e.nodePool.cellId[g],h=e.nodePool.z[g],g};let A=e.getSearchStateIdx.bind(e);return e.getSearchStateIdx=(g,f)=>A(g,f)+(u()?d*r:0),{beforeFirstVia:()=>!u()||a===0,prepareMove(g,f,y){if(d=u()?_(a,h,l,g,f):0,!u())return!0;if(y&&g===n){if(d!==2||c<0)return!1;if(Math.hypot(e.cellCenterX[f]-e.cellCenterX[c],e.cellCenterY[f]-e.cellCenterY[c])<o-0.000000001)return!1}let x=e.activeConnSeg;return g!==x.endZ||f!==x.endCellId||d===2}}}function fy(e,t){return e.targetLayerByBusId?.get(t)??e.targetLayer}var oFr=class extends co{constructor(e){super();this.options=e,this.activeSubSolver=e.router,this.MAX_ITERATIONS=Math.ceil(e.router.MAX_ITERATIONS/5000)+1}options;partialCandidates=[];partialSignatures=new Set;_step(){let{router:e}=this.options;for(let t=0;t<5000&&!e.solved&&!e.failed;t++)e.step();if(this.collectPartialCandidate(),this.stats={iterations:e.iterations,routedConnectionCount:e.getSolvedRouteCount(),connectionCount:this.options.connectionCount},e.solved||e.failed)this.activeSubSolver=null,this.solved=!0}collectPartialCandidate(){let{router:e,connectionCount:t,sourceOrigin:n,maximumPartialCandidates:o}=this.options;if(o===0||t<(n?2:3)||e.getSolvedRouteCount()!==t-1)return;let r=e.getOutput(),i=r.map((s)=>{let a=s.route[Math.floor(s.route.length/2)];return`${s.connectionName}:${s.route.length}:${a.x},${a.y}`}).sort().join(";");if(this.partialSignatures.has(i)||n&&this.partialCandidates.length>=o)return;if(this.partialSignatures.add(i),this.partialCandidates.push(r),this.partialCandidates.length>o)this.partialCandidates.shift()}computeProgress(){return this.options.router.iterations/this.options.router.MAX_ITERATIONS}getConstructorParams(){return[this.options]}visualize(){return this.activeSubSolver?.visualize()??this.options.router.visualize()}},rFr=class e{constructor(t,n){this.cellSize=t,this.margin=n}cellSize;margin;buckets=new Map;add(t){let n,o,r,i;if(t.kind==="segment"){let s=t.segment,a=this.margin+s.width/2;n=Math.min(s.start.x,s.end.x)-a,o=Math.max(s.start.x,s.end.x)+a,r=Math.min(s.start.y,s.end.y)-a,i=Math.max(s.start.y,s.end.y)+a}else if(t.kind==="via"){let s=this.margin+t.diameter/2;n=t.center.x-s,o=t.center.x+s,r=t.center.y-s,i=t.center.y+s}else{let s=t.obstacle,a=Math.hypot(s.width,s.height)/2+this.margin;n=s.center.x-a,o=s.center.x+a,r=s.center.y-a,i=s.center.y+a}for(let s=this.cell(n);s<=this.cell(o);s++)for(let a=this.cell(r);a<=this.cell(i);a++){let c=`${s},${a}`,l=this.buckets.get(c)??new Set;l.add(t),this.buckets.set(c,l)}}nearby(t,n=t){let o=new Set;for(let r=this.cell(Math.min(t.x,n.x));r<=this.cell(Math.max(t.x,n.x));r++)for(let i=this.cell(Math.min(t.y,n.y));i<=this.cell(Math.max(t.y,n.y));i++)for(let s of this.buckets.get(`${r},${i}`)??[])o.add(s);return[...o]}clone(){let t=new e(this.cellSize,this.margin);for(let[n,o]of this.buckets)t.buckets.set(n,new Set(o));return t}cell(t){return Math.floor(t/this.cellSize)}};function Nve(e){let t=[];for(let n of e){let o=t.at(-2),r=t.at(-1);if(o&&r&&o.z===r.z&&r.z===n.z){let i=r.x-o.x,s=r.y-o.y,a=n.x-r.x,c=n.y-r.y;if(Math.abs(i*c-s*a)<0.0000000001&&i*a+s*c>=0)t.pop()}t.push(n)}return t}function v9e(e,t,n){let o=new Map(e.buses.flatMap((s)=>s.connections.map((a)=>[a.connection.name,{bus:s,connection:a}]))),r=new Map(e.terminals.map((s)=>[s.connection.connection.name,s])),i=[];for(let s of t){let a=o.get(s.connectionName),c=r.get(s.connectionName);if(!a||!c)return null;let{bus:l,connection:h}=a,d=Nve(s.route),u=n.get(h.connectionIndex);if(!d.length||Gt(d[0],c.viaPoint)>0.0000001||Gt(d.at(-1),c.exitPoint)>0.0000001||e.startLayerByBusId!==void 0&&e.layerNames[d[0].z]!==e.startLayerByBusId.get(l.busId)||e.layerNames[d.at(-1).z]!==fy(e,l.busId)||d.some((f)=>!(l.allowedLayers??e.layerNames).includes(e.layerNames[f.z])))return null;let _=Ob({...e,bus:l,terminal:c,targetLayer:e.layerNames[d[0].z],targetLayerPoints:[c.viaPoint,c.exitPoint],sourceEscapePoints:u,allowBlindAndBuriedVias:!1}),p=_.trace.route.findIndex((f)=>f.route_type==="via");if(p<0)return null;let m=_.trace.route.slice(0,p+2),A=u.slice(1).map((f,y)=>({start:u[y],end:f,width:e.traceWidth,layer:h.sourceLayer})),g=[];for(let f=1;f<d.length;f++){let y=d[f],x=d[f-1],C=e.layerNames[x.z],b=e.layerNames[y.z];if(C!==b){if(Gt(x,y)>0.0000001)return null;g.push({center:{x:y.x,y:y.y},diameter:e.viaDiameter,holeDiameter:e.viaHoleDiameter,fromLayer:C,toLayer:b,spanLayers:[...e.layerNames]}),m.push({route_type:"via",x:y.x,y:y.y,from_layer:C,to_layer:b,via_diameter:e.viaDiameter,via_hole_diameter:e.viaHoleDiameter})}else if(Gt(x,y)>0.000000001)A.push({start:{x:x.x,y:x.y},end:{x:y.x,y:y.y},width:e.traceWidth,layer:b});m.push({route_type:"wire",x:y.x,y:y.y,layer:b,width:e.traceWidth})}i.push({..._,targetLayer:fy(e,l.busId),trace:{..._.trace,route:m},segments:A,additionalVias:g,length:A.reduce((f,y)=>f+Gt(y.start,y.end),0)})}return i}function t3(e){return Xit(e,new WeakMap)}function*Xit(e,t){let{buses:n,allBuses:o,targetLayer:r,layerNames:i,traceWidth:s,clearance:a,viaDiameter:c,srj:l}=e,h=e.maximumIterations??30000000,d=e.heuristicWeight??1.5;if(!Number.isFinite(d)||d<=0)throw Error("heuristicWeight must be finite and positive");if(!Number.isSafeInteger(h)||h<1)throw Error("maximumIterations must be a positive safe integer");let u=e.maximumLocalRepairAttempts??3,_=e.maximumSourceOriginRepairAttempts??0;if(!Number.isSafeInteger(u)||u<0)throw Error("maximumLocalRepairAttempts must be a non-negative safe integer");if(!Number.isSafeInteger(_)||_<0)throw Error("maximumSourceOriginRepairAttempts must be a non-negative safe integer");let p=e.ripCost??8;if(!Number.isFinite(p)||p<=0)throw Error("ripCost must be finite and positive");if(e.maximumRipEvents!==void 0&&(!Number.isSafeInteger(e.maximumRipEvents)||e.maximumRipEvents<1))throw Error("maximumRipEvents must be a positive safe integer");let m=e.traceMarginExtra??s/2;if(!Number.isFinite(m)||m<0)throw Error("traceMarginExtra must be finite and non-negative");let A=e.routeFromSourcePads??!1;if(e.terminalApproachLength!==void 0&&(!Number.isFinite(e.terminalApproachLength)||e.terminalApproachLength<=0))throw Error("terminalApproachLength must be finite and positive");let g=A||e.startLayerByBusId!==void 0||e.terminalApproachLength!==void 0,f=e.sourceLayerTravelCost??1;if(!Number.isFinite(f)||f<1)throw Error("sourceLayerTravelCost must be finite and at least one");let y=[...new Set(n.map(($e)=>fy(e,$e.busId)))],x=e.startLayerByBusId?n.map(($e)=>e.startLayerByBusId.get($e.busId)):[],C=A?[...new Set([r,"top",...e.transitLayers??[],...y,...x])]:[...new Set([r,...e.transitLayers??[],...y,...x])],b=i.indexOf(r),I=A&&e.allowSourceOriginTopFinal===!0&&y.includes("top"),v=I?n.filter(($e)=>fy(e,$e.busId)==="top"):[],P=new Map(v.map(($e)=>[$e.busId,o.find((ft)=>ft.busId===$e.busId)])),M=new Set((I?o:[]).flatMap(($e)=>$e.termination.type==="plane"?[$e.termination.layer]:[]));if(v.some(($e)=>{let ft=P.get($e.busId);if(!ft||$e.connections.length!==ft.connections.length||$e.connections.some((Ye)=>!ft.connections.some((je)=>je.connectionIndex===Ye.connectionIndex&&je.connection.name===Ye.connection.name&&je.sourceObstacle===Ye.sourceObstacle)))return!0;let vt=(ft.routableEscapeLayers??ft.allowedLayers??i).filter((Ye)=>(ft.allowedLayers??i).includes(Ye));return!vt.includes("top")||!C.some((Ye)=>Ye!=="top"&&!M.has(Ye)&&vt.includes(Ye)&&($e.routableEscapeLayers??$e.allowedLayers??i).includes(Ye)&&($e.allowedLayers??i).includes(Ye))}))return null;if(n.length===0||b<0||y.some(($e)=>!i.includes($e))||e.targetLayerByBusId&&n.some(($e)=>!e.targetLayerByBusId.has($e.busId))||e.startLayerByBusId&&(A||n.some(($e)=>!e.startLayerByBusId.has($e.busId)))||C.some(($e)=>!i.includes($e)))return null;let B=n.flatMap(($e)=>$e.connections),T=new Set(B.map(($e)=>$e.connectionIndex));if(A&&B.some(($e)=>$e.sourceLayer!=="top")||T.size!==B.length||e.terminals.length!==B.length||new Set(e.terminals.map(($e)=>$e.connection.connectionIndex)).size!==T.size||e.terminals.some(($e)=>!T.has($e.connection.connectionIndex)))return null;if(n.some(($e)=>$e.termination.type!=="boundary"||!($e.allowedLayers??i).includes(fy(e,$e.busId))||!($e.routableEscapeLayers??$e.allowedLayers??i).includes(fy(e,$e.busId)))||(e.startLayerByBusId?n.some(($e)=>{let ft=e.startLayerByBusId.get($e.busId);return!($e.allowedLayers??i).includes(ft)||!($e.routableEscapeLayers??$e.allowedLayers??i).includes(ft)||$e.connections.some((vt)=>vt.sourceLayer===ft)}):!I&&o.some(($e)=>$e.connections.some((ft)=>y.includes(ft.sourceLayer)))))return null;let N=n[0].sharedBoundary;if(n.some(($e)=>Object.keys(N).some((ft)=>$e.sharedBoundary[ft]!==N[ft])))return null;let D=new Map,L=new Map,H=new rFr(Math.max(0.5,c*2),Math.max(s,c)/2+a+0.0000001),V=new Map(B.map(($e)=>[$e.connection.name,$e])),O=new Map(B.map(($e)=>[$e.sourceObstacle,$e])),U=A?new Map(B.map(($e)=>[$e.sourceObstacle,{connectionName:$e.connection.name,sourcePoint:V.get($e.connection.name).sourcePoint}])):void 0;for(let $e of l.obstacles)H.add({kind:"obstacle",obstacle:$e});for(let $e of o)for(let ft of $e.connections){L.set(ft.connection.name,$e);let vt=e.fixedViaPointsByConnectionIndex.get(ft.connectionIndex);if(!vt)return null;let Ye=e.sourceEscapePaths?.get(ft.connectionIndex)??[ft.sourcePoint,vt];if(Ye.length<2||Gt(Ye[0],ft.sourcePoint)>0.0000001||Gt(Ye.at(-1),vt)>0.0000001)return null;if(D.set(ft.connectionIndex,Ye),A&&T.has(ft.connectionIndex))continue;H.add({kind:"via",connectionName:ft.connection.name,center:vt,diameter:c,layers:i});for(let je=1;je<Ye.length;je++)H.add({kind:"segment",connectionName:ft.connection.name,segment:{start:Ye[je-1],end:Ye[je],width:s,layer:ft.sourceLayer}})}for(let $e of e.terminals)if(Gt($e.viaPoint,e.fixedViaPointsByConnectionIndex.get($e.connection.connectionIndex))>0.0000001)return null;for(let $e of e.acceptedPlans){for(let ft of[...$e.segments,...$e.planeEndpointSegments??[]])H.add({kind:"segment",connectionName:$e.connectionName,segment:ft});for(let ft of[$e.via,...$e.additionalVias??[],$e.planeEndpointVia])if(ft)H.add({kind:"via",connectionName:$e.connectionName,...ft,layers:ft.spanLayers})}for(let $e of oP(l,!1)){for(let ft of $e.segments)H.add({kind:"segment",connectionName:$e.connectionName,segment:ft});for(let ft of $e.vias)H.add({kind:"via",connectionName:$e.connectionName,...ft,layers:ft.spanLayers})}let j=new Map;if(e.terminalApproachLength!==void 0)for(let $e of e.terminals){let ft=$e.connection.connection.name,vt=L.get(ft),Ye=WHr({connectionName:ft,edge:vt.exitEdge??kde(vt.direction),layer:fy(e,vt.busId),exit:$e.exitPoint,bounds:N,approachLength:e.terminalApproachLength});j.set(ft,Ye),H.add({kind:"segment",connectionName:ft,segment:{start:Ye.goal,end:Ye.exit,width:s,layer:Ye.layer}})}let Y={capacityMeshNodeId:"reserved-via-buses",center:{x:(N.minX+N.maxX)/2,y:(N.minY+N.maxY)/2},width:N.maxX-N.minX,height:N.maxY-N.minY,availableZ:C.map(($e)=>i.indexOf($e)),portPoints:e.terminals.flatMap(($e)=>[A?$e.connection.sourcePoint:$e.viaPoint,j.get($e.connection.connection.name)?.goal??$e.exitPoint].map((ft,vt)=>({...ft,z:A&&vt===0?i.indexOf($e.connection.sourceLayer):vt===0&&e.startLayerByBusId?i.indexOf(e.startLayerByBusId.get(L.get($e.connection.connection.name).busId)):i.indexOf(fy(e,L.get($e.connection.connection.name).busId)),connectionName:$e.connection.connection.name,rootConnectionName:$e.connection.connection.name})))};if(e.tightViaChannels){let $e=Rot({vias:[...e.fixedViaPointsByConnectionIndex].filter(([ft])=>!A||!e.sourceOriginPhysicalGridPhase||!T.has(ft)).map(([ft,vt])=>({connectionIndex:ft,center:vt,diameter:c})),activeConnectionIndices:T,traceWidth:s,clearance:a,gridStep:s});for(let ft of["x","y"]){let vt=(ft==="x"?N.minX:N.minY)+s/2;Y.center[ft]+=$e[ft]-(vt+Math.round(($e[ft]-vt)/s)*s)}}let K=new dV({nodeWithPortPoints:Y,traceWidth:s,viaDiameter:c}).generateSolver({HIGH_DENSITY_A03:!0});if(typeof K.computeMoveCostAndRips!=="function"||typeof K.markTraceFootprint!=="function"||typeof K.addSharedOccupant!=="function"||typeof K.getSolvedRouteCount!=="function"||j.size>0&&(typeof K.pointToCell!=="function"||typeof K.finalizeRoute!=="function"||typeof K.ripTrace!=="function"))return null;let ee=new K.constructor({nodeWithPortPoints:Y,highResolutionCellSize:s,lowResolutionCellSize:s,traceThickness:s,traceMargin:a+m,viaDiameter:c,maxCellCount:160000*C.length,effort:20,hyperParameters:{shuffleSeed:e.shuffleSeed??1,greedyMultiplier:d,ripCost:p}}),se=ee._setup.bind(ee),ne=ee.computeMoveCostAndRips.bind(ee),re=-1,Z=-1,te=[],ie=[],ce,ue=[],de=new Set,me,ge=new Map,xe=new WeakMap,Ee=new Map,Re,Me=($e)=>({x:ee.cellCenterX[$e],y:ee.cellCenterY[$e]}),_e=($e)=>$e.x>=N.minX-0.000000001&&$e.x<=N.maxX+0.000000001&&$e.y>=N.minY-0.000000001&&$e.y<=N.maxY+0.000000001,ye=($e)=>{let ft=Ee.get($e);if(ft!==void 0)return ft;let vt=Me($e),Ye=H.nearby(vt).every((je)=>{if(je.kind==="via")return Gt(vt,je.center)>=(c+je.diameter)/2+a-0.000000001;if(je.kind==="segment")return Hr(vt,je.segment.start,je.segment.end)>=(c+je.segment.width)/2+a-0.000000001;return Cl({start:vt,end:vt,width:0,layer:r},je.obstacle)>=c/2+a-0.000000001});return Ee.set($e,Ye),Ye};ee._setup=()=>{if(se(),ee.failed)return;if(e.includeDiagonalNeighbors)Object.assign(ee,UHr(ee));if(j.size>0){if(typeof ee.ripChain?.contains!=="function"||typeof ee.ripChain?.append!=="function"||!Number.isFinite(ee.hyperParameters.ripTracePenalty)||!Number.isFinite(ee.hyperParameters.ripViaPenalty)){ee.failed=!0;return}for(let Nt of j.values())if(!Ne(Nt.goal,Nt.exit,Nt.layer,Nt.connectionName)){ee.failed=!0;return}let ft=[...j.values()].map((Nt)=>({connector:Nt,cellId:ee.pointToCell(Nt.goal).cellId})),vt=$Hr({grid:ee,terminals:ft,margin:Math.max(s,c)+a+0.0000001,segmentIsClear:(Nt,Ot,Ut)=>_e(Nt)&&_e(Ot)&&Ne(Nt,Ot,Ut.layer,Ut.connectionName)});ee.neighborOffset=vt.neighborOffset,ee.neighborIds=vt.neighborIds,ee.neighborCosts=vt.neighborCosts,de=vt.extendedEdges;let Ye=new Map(ft.map(({connector:Nt,cellId:Ot})=>[Nt.connectionName,Ot])),je=ee.getOutput.bind(ee);ee.getOutput=()=>je().map((Nt)=>{let Ot=qHr(Nt,j.get(Nt.connectionName),Me(Ye.get(Nt.connectionName))),Ut=[];if(!A){let ln=V.get(Nt.connectionName),hn=D.get(ln.connectionIndex);for(let Zn=1;Zn<hn.length;Zn++)Ut.push({start:hn[Zn-1],end:hn[Zn],width:s,layer:ln.sourceLayer})}let mn=Nt.route.at(-2).z!==Nt.route.at(-1).z,_n=Nt.route.length-(mn?1:2),En=-1;for(let ln=1;ln<Ot.route.length;ln++){let hn=Ot.route[ln-1],Zn=Ot.route[ln];if(hn.z!==Zn.z)continue;if(ln-1===_n)En=Ut.length;Ut.push({start:hn,end:Zn,width:s,layer:i[hn.z]})}let Qn={rawSegments:Ut,firstEntrySegmentIndex:En};return ge.set(Nt.connectionName,Qn),xe.set(Ot,Qn),Ot}),me=new JHr({regions:vt.regions,traceWidth:s,clearance:a,viaDiameter:c,getRoutes:()=>ee.getOutput()});let st=ee.finalizeRoute.bind(ee),St=ee.ripTrace.bind(ee);ee.finalizeRoute=(Nt)=>{st(Nt),me.invalidate()},ee.ripTrace=(Nt)=>{St(Nt),me.invalidate()}}if(ZHr(ee),Re=new tFr(ee.planeSize,C.length,ee.neighborOffset,ee.neighborIds),te=Array.from({length:C.length},(ft,vt)=>i[ee.layerToZ.get(vt)]),ie=ee.connIdToName.map((ft)=>{let vt=L.get(ft),Ye=vt?(vt.routableEscapeLayers??vt.allowedLayers??i).filter((St)=>(vt.allowedLayers??i).includes(St)):[],je=vt&&P.get(vt.busId),st=je?(je.routableEscapeLayers??je.allowedLayers??i).filter((St)=>(je.allowedLayers??i).includes(St)&&!M.has(St)):void 0;return te.map((St)=>(Ye.includes(St)||A&&St==="top")&&(!st||st.includes(St)))}),ee.MAX_ITERATIONS=h,e.maximumRipEvents!==void 0)ee.MAX_RIPS=e.maximumRipEvents;ee.gridToBoundsTransform={a:1,b:0,c:0,d:0,e:1,f:0};let $e=ee.heap.pop.bind(ee.heap);if(ee.heap.pop=()=>{let ft=$e();return re=ee.nodePool.cellId[ft],Z=ee.nodePool.z[ft],ft},I){let ft=ee.layers*ee.planeSize,vt=te.indexOf("top");if(typeof ee.getSearchStateIdx!=="function"||typeof ee.nodePool.push!=="function"||!(ee.visitedStamp instanceof Uint32Array)||!(ee.bestGStamp instanceof Uint32Array)||!(ee.bestGValue instanceof Float64Array)||ee.visitedStamp.length!==ft||ee.bestGStamp.length!==ft||ee.bestGValue.length!==ft||ee.getSearchStateIdx(0,0)!==0||ee.getSearchStateIdx(ft-1,1)!==ft-1||vt<0){ee.failed=!0;return}ue=ee.connIdToName.map((Ye)=>{let je=L.get(Ye);return!!je&&fy(e,je.busId)==="top"}),ce=nFr(ee,ue,vt,c+a)}},ee.markTraceFootprint=($e,ft,vt,Ye)=>{let je=Me(vt),st=ee.traceKeepoutRadius;ee.forEachCellNearCircle(je.x,je.y,st,(St)=>{let Nt=e.tightViaChannels?ee.cellCenterX[St]-je.x:Math.max(ee.cellMinX[St]-je.x,0,je.x-ee.cellMaxX[St]),Ot=e.tightViaChannels?ee.cellCenterY[St]-je.y:Math.max(ee.cellMinY[St]-je.y,0,je.y-ee.cellMaxY[St]),Ut=st-(e.tightViaChannels?0.000000001:0);if(e.tightViaChannels?Nt*Nt+Ot*Ot>=Ut*Ut:Nt*Nt+Ot*Ot>Ut*Ut)return;let mn=ft*ee.planeSize+St;if(St!==vt&&ee.shouldSkipFixedPortHalo(mn,$e))return;let _n=ee.usedCellsFlat[mn];if(_n!==-1&&_n!==$e)ee.addSharedOccupant(mn,$e);else ee.usedCellsFlat[mn]=$e;Ye.push(mn)})};let Se=($e,ft,vt,Ye)=>{if(Ye.kind==="obstacle")return!Ye.obstacle.layers.includes(vt)||Cl({start:$e,end:ft,width:s,layer:vt},Ye.obstacle)>=s/2+a-0.000000001;if(Ye.kind==="via")return!Ye.layers.includes(vt)||Hr(Ye.center,$e,ft)>=(s+Ye.diameter)/2+a-0.000000001;return Ye.segment.layer!==vt||Hh($e,ft,Ye.segment.start,Ye.segment.end)>=(s+Ye.segment.width)/2+a-0.000000001},Ne=($e,ft,vt,Ye,je=H.nearby($e,ft))=>je.every((st)=>st.kind!=="obstacle"&&st.connectionName===Ye||A&&st.kind==="obstacle"&&vt==="top"&&O.get(st.obstacle)?.connection.name===Ye&&Cl({start:$e,end:$e,width:s,layer:vt},st.obstacle)<s/2+a-0.000000001&&Gt(ft,V.get(Ye).sourcePoint)>=Gt($e,V.get(Ye).sourcePoint)-0.000000001||Se($e,ft,vt,st)),Le=($e,ft,vt)=>{let Ye;for(let je of H.nearby($e,ft)){if(Se($e,ft,vt,je))continue;if(je.kind==="obstacle"&&!A)return!1;let st=je.kind==="obstacle"?GHr($e,ft,vt,s,a,je.obstacle,U?.get(je.obstacle)):je.connectionName;if(st===void 0||Ye!==void 0&&Ye!==st)return!1;Ye=st}return Ye??!0};ee.computeMoveCostAndRips=($e,ft,vt,Ye,je,st,St)=>{let Nt=ee.connIdToName[$e],Ot=te[ft],Ut=ee.activeConnSeg;if(ce&&!ce.prepareMove(ft,vt,Ye)||!ie[$e][ft]||Ye&&(A&&Ot==="top"&&!ue[$e]||!ye(vt))){ee._moveCost=-1;return}let mn=re===Ut.startCellId&&(!g||Z===Ut.startZ)&&(!ce||ce.beforeFirstVia()),_n,En,Qn;if(me){let bo=vt===Ut.endCellId&&ft===Ut.endZ;if(de.has(`${re}:${vt}`)&&!bo){ee._moveCost=-1;return}let ir=j.get(Nt);if(_n=mn?Ut.startPoint:Me(re),En=bo?Ut.endPoint:Me(vt),Qn=bo?A7e(Ye?Me(vt):_n,ir):void 0,bo&&(!Qn||Ye&&Gt(_n,Me(vt))>0.0000001)){ee._moveCost=-1;return}}let ln=ft*ee.planeSize+re,hn=mn||vt===Ut.endCellId&&(!g||ft===Ut.endZ),Zn=Re.get(ln,vt,hn);if(Zn===void 0){if(_n??=mn?Ut.startPoint:Me(re),En??=vt===Ut.endCellId&&(!g||ft===Ut.endZ)?Ut.endPoint:Me(vt),!_e(_n)||!_e(En)){ee._moveCost=-1;return}Zn=hn?Qn?Qn.slice(1).every((bo,ir)=>Ne(Qn[ir],bo,Ot,Nt)):Ne(_n,En,Ot,Nt):Le(_n,En,Ot),Re.set(ln,vt,Zn,hn)}if(Zn!==!0&&Zn!==Nt){ee._moveCost=-1;return}if(ne($e,ft,vt,Ye,je,st,St),me&&ee._moveCost>=0){let bo=Ye?me.blockingViaOwners(Nt,Me(vt)):me.blockingSegmentOwners(Nt,Qn??[_n,En],ee.layerToZ.get(ft));if(Ye&&Qn)for(let ir of me.blockingSegmentOwners(Nt,Qn,ee.layerToZ.get(ft)))bo.add(ir);for(let ir of bo){let gt=ee.connIdToName.indexOf(ir);if(gt<0)throw Error("Cannot resolve dynamic terminal copper owner");if(!ee.ripChain.contains(ee._moveRippedHead,gt))ee._moveRippedHead=ee.ripChain.append(ee._moveRippedHead,gt),ee._moveRipCount++,ee._moveCost+=p;ee._moveCost+=Ye?ee.hyperParameters.ripViaPenalty:ee.hyperParameters.ripTracePenalty}}if(A&&!Ye&&Ot==="top"&&ee._moveCost>=0&&(!ce||ce.beforeFirstVia()))ee._moveCost+=St*(f-1)};let nt=A?_:u;ee.setup();let dt=new oFr({router:ee,connectionCount:B.length,sourceOrigin:A,maximumPartialCandidates:nt});yield{type:"subsolver",solver:dt,iterations:ee.iterations,routedConnectionCount:ee.getSolvedRouteCount(),connectionCount:B.length};while(!dt.solved&&!dt.failed)dt.step(),yield{iterations:ee.iterations,routedConnectionCount:ee.getSolvedRouteCount(),connectionCount:B.length};let{partialCandidates:rt}=dt,pt=($e)=>o.flatMap((ft)=>ft.connections.filter((vt)=>!$e.has(vt.connectionIndex)).map((vt)=>{let Ye=e.fixedViaPointsByConnectionIndex.get(vt.connectionIndex),je=ft.termination.type==="plane"?ft.termination.layer:(ft.allowedLayers??i).find((st)=>st!==vt.sourceLayer);return Ob({...e,bus:ft,terminal:{connection:vt,viaPoint:Ye,exitPoint:Ye},targetLayer:je,targetLayerPoints:[Ye],sourceEscapePoints:D.get(vt.connectionIndex),allowBlindAndBuriedVias:!1})})),ct=($e,ft=new Set)=>{let vt=pt(new Set([...[...$e,...e.acceptedPlans].map((Ye)=>Ye.connectionIndex),...ft]));return(j.size===0||$e.every((Ye)=>{let je=j.get(Ye.connectionName);if(!je)return!0;let st=Ye.segments.at(-1);return!!st&&st.layer===je.layer&&Gt(st.end,je.exit)<0.0000001&&Hr(je.goal,st.start,st.end)<0.0000001&&Not({plan:Ye,splice:t.get(Ye)??ge.get(Ye.connectionName)??{rawSegments:[],firstEntrySegmentIndex:-1},maximumJoinLength:s/4,clearance:a})}))&&q0({plans:[...$e],srj:l,sharedBoundary:N,clearance:a,allowBlindAndBuriedVias:!1,allowSameNetMerges:!1})&&kd({inputSrj:l,routedSrj:{...l,traces:[...l.traces??[],...[...$e,...e.acceptedPlans,...vt].flatMap((Ye)=>[Ye.trace,...Ye.planeEndpointTrace?[Ye.planeEndpointTrace]:[]])]},clearance:a,allowBlindAndBuriedVias:!1}).valid},Ct=($e,ft)=>{let vt=$e.findIndex((St,Nt)=>Nt>0&&St.z!==$e[Nt-1].z);if(vt<1||$e.slice(0,vt).some((St)=>i[St.z]!=="top")||Gt($e[vt-1],$e[vt])>0.0000001)return!1;let Ye=L.get(ft);if(!P.has(Ye.busId))return!$e.slice(vt).some((St)=>i[St.z]==="top");let je=!1,st=!1;for(let St=vt+1;St<$e.length;St++){let Nt=$e[St-1],Ot=$e[St];if(Nt.z===Ot.z&&i[Nt.z]!=="top"&&Gt(Nt,Ot)>0.0000001)je=!0;if(Nt.z!==Ot.z&&i[Ot.z]==="top"){if(!je||Gt(Nt,Ot)>0.0000001||Gt($e[vt],Ot)<c+a-0.000000001)return!1;st=!0}}return st&&o3n({points:$e,topZ:i.indexOf("top"),traceWidth:s,viaDiameter:c,clearance:a})},kt=($e)=>{if(ge.clear(),j.size===0)return!0;for(let ft of $e){let vt=xe.get(ft);if(!vt)return!1;ge.set(ft.connectionName,vt)}return!0},Lt=($e,ft=new Set)=>{if(!$e||!ct($e,ft))return null;for(let vt of $e){let Ye=ge.get(vt.connectionName);if(Ye&&!t.has(vt))t.set(vt,Ye)}return $e},Bt=($e)=>{if(j.size===0)return $e;let ft=KHr({plans:$e,splices:ge,connectors:j,clearance:a,segmentIsClear:(vt,Ye)=>_e(vt.start)&&_e(vt.end)&&Ne(vt.start,vt.end,vt.layer,Ye)});if(!ft)return null;for(let[vt,Ye]of ft.splices)ge.set(vt,Ye);return ft.plans},xt=($e,ft=new Set)=>{if(!kt($e))return null;let vt=new Map(D),Ye=[],je=[];for(let ln of $e){let hn=e.terminals.find((ir)=>ir.connection.connection.name===ln.connectionName),Zn=ln.route.findIndex((ir,gt)=>gt>0&&ir.z!==ln.route[gt-1].z);if(!Ct(ln.route,ln.connectionName)||i[ln.route.at(-1).z]!==fy(e,L.get(ln.connectionName).busId)||Gt(ln.route[Zn-1],ln.route[Zn])>0.0000001)return null;let bo=ln.route[Zn];vt.set(hn.connection.connectionIndex,Nve(ln.route.slice(0,Zn)).map(({x:ir,y:gt})=>({x:ir,y:gt}))),Ye.push({...hn,viaPoint:{x:bo.x,y:bo.y}}),je.push({...ln,route:ln.route.slice(Zn),vias:[]})}let st=v9e({...e,terminals:Ye},je,vt);if(!st)return null;let St=Bt(st);if(!St)return null;let Nt=Tot({...e,inputSrj:l,plans:St,preparedBuses:n,reservedPlans:[...e.acceptedPlans,...pt(T)],allowBlindAndBuriedVias:!1,allowSameNetMerges:!1});if(!Nt)return null;let Ot=Nt.map((ln)=>({connectionName:ln.connectionName,route:ln.trace.route.flatMap((hn)=>hn.route_type==="wire"?[{x:hn.x,y:hn.y,z:i.indexOf(hn.layer)}]:[]),vias:[ln.via.center]})),Ut=H.clone(),mn=(ln)=>{for(let hn=1;hn<ln.route.length;hn++){let Zn=ln.route[hn-1],bo=ln.route[hn];if(Zn.z===bo.z)Ut.add({kind:"segment",connectionName:ln.connectionName,segment:{start:Zn,end:bo,width:s,layer:i[Zn.z]}});else Ut.add({kind:"via",connectionName:ln.connectionName,center:Zn,diameter:c,layers:i})}};Ot.forEach(mn);let _n=[],En=[];for(let ln of Ot){let hn=e.terminals.find((gt)=>gt.connection.connection.name===ln.connectionName),Zn=PY({points:Nve(ln.route),chamfer:s/4,segmentIsClear:(gt,Oe)=>{for(let mt of[gt,Oe]){if(!_e(mt))return!1;if((Math.abs(mt.x-N.minX)<0.0000001||Math.abs(mt.x-N.maxX)<0.0000001||Math.abs(mt.y-N.minY)<0.0000001||Math.abs(mt.y-N.maxY)<0.0000001)&&Gt(mt,hn.exitPoint)>0.0000001)return!1}return Ne(gt,Oe,i[gt.z],ln.connectionName,Ut.nearby(gt,Oe))}});if(!Zn)return null;let bo=Zn.findIndex((gt,Oe)=>Oe>0&&gt.z!==Zn[Oe-1].z);if(!Ct(Zn,ln.connectionName)||i[Zn.at(-1).z]!==fy(e,L.get(ln.connectionName).busId))return null;let ir=Zn[bo];D.set(hn.connection.connectionIndex,Zn.slice(0,bo).map(({x:gt,y:Oe})=>({x:gt,y:Oe}))),En.push({...hn,viaPoint:{x:ir.x,y:ir.y}}),_n.push({...ln,route:Zn.slice(bo),vias:[]}),mn({...ln,route:Zn})}let Qn=v9e({...e,terminals:En},_n,D);return Lt(Qn,ft)},Yt=($e)=>{if(!kt($e))return null;let ft=$e,vt=H.clone(),Ye=new Set([...ft.map((mn)=>e.terminals.find((_n)=>_n.connection.connection.name===mn.connectionName).connection.connectionIndex),...e.acceptedPlans.map((mn)=>mn.connectionIndex)]),je=pt(Ye),st=v9e(e,ft,D);if(!st)return null;let St=Bt(st);if(!St)return null;let Nt=Tot({...e,inputSrj:l,plans:St,preparedBuses:n,reservedPlans:[...e.acceptedPlans,...je],allowBlindAndBuriedVias:!1,allowSameNetMerges:!1});if(!Nt)return null;ft=Nt.map((mn)=>{let _n=mn.trace.route.findIndex((En)=>En.route_type==="via");return{connectionName:mn.connectionName,route:mn.trace.route.slice(_n+1).flatMap((En)=>En.route_type==="wire"?[{x:En.x,y:En.y,z:i.indexOf(En.layer)}]:[]),vias:(mn.additionalVias??[]).map((En)=>En.center)}});let Ot=(mn)=>{for(let _n=1;_n<mn.route.length;_n++){let En=mn.route[_n-1],Qn=mn.route[_n];if(En.z===Qn.z)vt.add({kind:"segment",connectionName:mn.connectionName,segment:{start:En,end:Qn,width:s,layer:i[En.z]}})}for(let _n of mn.vias)vt.add({kind:"via",connectionName:mn.connectionName,center:_n,diameter:c,layers:i})};for(let mn of ft)Ot(mn);for(let mn of ft){let _n=e.terminals.find((Qn)=>Qn.connection.connection.name===mn.connectionName),En=PY({points:Nve(mn.route),chamfer:s/4,segmentIsClear:(Qn,ln)=>{for(let hn of[Qn,ln]){if(!_e(hn))return!1;if((Math.abs(hn.x-N.minX)<0.0000001||Math.abs(hn.x-N.maxX)<0.0000001||Math.abs(hn.y-N.minY)<0.0000001||Math.abs(hn.y-N.maxY)<0.0000001)&&Gt(hn,_n.exitPoint)>0.0000001)return!1}return Ne(Qn,ln,i[Qn.z],mn.connectionName,vt.nearby(Qn,ln))}});if(!En)return null;mn.route=En,Ot(mn)}let Ut=v9e(e,ft,D);return Lt(Ut)};if(ee.solved&&!ee.failed){let $e=ee.getOutput();if($e.length!==B.length||new Set($e.map((ft)=>ft.connectionName)).size!==B.length)return null;return A?xt($e):Yt($e)}if(A&&_>0){for(let $e of rt){let ft=new Set($e.map((Ot)=>Ot.connectionName)),vt=e.terminals.filter((Ot)=>!ft.has(Ot.connection.connection.name));if(vt.length!==1)continue;let Ye=vt[0].connection.connectionIndex,je=new Map(D),st=xt($e,new Set([Ye]));D.clear();for(let[Ot,Ut]of je)D.set(Ot,Ut);if(!st)continue;let St=iFr(e,st,t),Nt=St.next();while(!Nt.done)yield{iterations:ee.iterations+Nt.value.iterations,routedConnectionCount:Nt.value.routedConnectionCount,connectionCount:B.length},Nt=St.next();if(Nt.value&&ct(Nt.value))return Nt.value}return null}if(A||u===0||rt.length===0)return null;let ut=pt(new Set(e.acceptedPlans.map(($e)=>$e.connectionIndex))),Ze=new Map(ut.map(($e)=>[$e.connectionIndex,$e])),Fe=ut.flatMap(($e)=>$e.via?[{connectionName:$e.connectionName,via:$e.via}]:[]),tt=Rot({...e,gridStep:s,vias:o.flatMap(($e)=>$e.connections.map((ft)=>({connectionIndex:ft.connectionIndex,center:e.fixedViaPointsByConnectionIndex.get(ft.connectionIndex),diameter:c}))),activeConnectionIndices:T}),Je=0;for(let $e of rt.toReversed()){let ft=Yt($e);if(!ft)continue;let vt=new Set(ft.map((st)=>st.connectionIndex)),Ye=e.terminals.find((st)=>!vt.has(st.connection.connectionIndex)),je=ft.toSorted((st,St)=>Gt(st.exitPoint,Ye.exitPoint)-Gt(St.exitPoint,Ye.exitPoint));for(let st of je.slice(0,16)){let St=Ye.connection.connectionIndex,Nt=ft.filter((Qn)=>Qn!==st),Ot=[...e.acceptedPlans,...Nt,...ut.filter((Qn)=>!vt.has(Qn.connectionIndex)&&Qn.connectionIndex!==St),Ze.get(st.connectionIndex)],Ut=L.get(Ye.connection.connection.name),mn=G2({...e,bus:{...Ut,exitEdge:Ut.exitEdge??kde(Ut.direction),connections:[Ye.connection]},terminals:[Ye],targetLayer:fy(e,Ut.busId),acceptedPlans:Ot,reservedVias:Fe.filter((Qn)=>Qn.connectionName!==Ye.connection.connection.name),sourceEscapePaths:D,gridStep:s,gridOrigin:tt,gridStepDivisor:2,maximumRouteOrderAttempts:1,maximumSearchStates:240000,heuristicWeight:1,alignGridToPads:!0},1,!1),_n=mn.next();while(!_n.done)yield{iterations:ee.iterations+_n.value.expandedStateCount,routedConnectionCount:ft.length,connectionCount:B.length},_n=mn.next();if(!_n.value[0]?.length)continue;let En=Nt.toSorted((Qn,ln)=>{let hn=(Zn)=>Math.min(...Zn.segments.filter((bo)=>bo.layer===fy(e,Ut.busId)).map((bo)=>Hr(Ye.viaPoint,bo.start,bo.end)));return hn(Qn)-hn(ln)});for(let Qn of En.slice(0,1)){if(Je++>=u)return null;let ln=new Set([St,st.connectionIndex,Qn.connectionIndex]),hn=n.map((Oe)=>({...Oe,connections:Oe.connections.filter((mt)=>ln.has(mt.connectionIndex))})).filter((Oe)=>Oe.connections.length>0),Zn=[...e.acceptedPlans,...ft.filter((Oe)=>!ln.has(Oe.connectionIndex)),...ut.filter((Oe)=>!vt.has(Oe.connectionIndex)&&!ln.has(Oe.connectionIndex))],bo=Xit({...e,buses:hn,terminals:e.terminals.filter((Oe)=>ln.has(Oe.connection.connectionIndex)),acceptedPlans:Zn,maximumLocalRepairAttempts:0,maximumIterations:Math.min(h,2000000)},t),ir=bo.next();while(!ir.done)yield{iterations:ee.iterations+ir.value.iterations,routedConnectionCount:ft.length-2+ir.value.routedConnectionCount,connectionCount:B.length},ir=bo.next();if(!ir.value)continue;let gt=[...ft.filter((Oe)=>!ln.has(Oe.connectionIndex)),...ir.value];if(gt.length===B.length&&new Set(gt.map((Oe)=>Oe.connectionIndex)).size===T.size&&ct(gt))return gt}break}}return null}function*iFr(e,t,n){let{buses:o,layerNames:r}=e;if(!e.routeFromSourcePads)return null;let i=new Map(e.terminals.map((g)=>[g.connection.connectionIndex,g])),s=new Set(t.map((g)=>g.connectionIndex));if(i.size<2||s.size!==t.length||t.length!==i.size-1||t.some((g)=>i.get(g.connectionIndex)?.connection.connection.name!==g.connectionName||g.targetLayer!==fy(e,g.busId)||g.sourceLayer!==i.get(g.connectionIndex).connection.sourceLayer||Gt(g.sourcePoint,i.get(g.connectionIndex).connection.sourcePoint)>0.0000001||!g.via||Gt(g.exitPoint,i.get(g.connectionIndex).exitPoint)>0.0000001))return null;let a=e.terminals.filter((g)=>!s.has(g.connection.connectionIndex)),c=a[0].connection.connectionIndex,l=new Map(e.fixedViaPointsByConnectionIndex),h=new Map(e.sourceEscapePaths);for(let g of t)l.set(g.connectionIndex,g.via.center),h.set(g.connectionIndex,[g.sourcePoint,...g.segments.slice(0,g.sourceEscapeSegmentCount??1).map((f)=>f.end)]);let d=o.map((g)=>({...g,connections:g.connections.filter((f)=>f.connectionIndex===c)})).filter((g)=>g.connections.length>0),u=fy(e,d[0].busId),_=r.filter((g)=>g!==u&&d.every((f)=>(f.routableEscapeLayers??f.allowedLayers??r).includes(g)&&f.connections.every((y)=>y.sourceLayer!==g))),p=Xit({...e,buses:d,targetLayer:u,terminals:a,transitLayers:_,fixedViaPointsByConnectionIndex:l,sourceEscapePaths:h,acceptedPlans:[...e.acceptedPlans,...t],includeDiagonalNeighbors:!0,ripCost:256,maximumIterations:Math.min(e.maximumIterations??5000000,5000000),maximumRipEvents:Math.min(e.maximumRipEvents??400,400),maximumLocalRepairAttempts:0,maximumSourceOriginRepairAttempts:0},n),m=p.next();while(!m.done)yield{...m.value,routedConnectionCount:t.length+m.value.routedConnectionCount,connectionCount:i.size},m=p.next();if(!m.value)return null;let A=[...t,...m.value];return A.length===i.size&&new Set(A.map((g)=>g.connectionIndex)).size===i.size?A:null}var h_=0.0000001,q4=(e)=>Math.max(...e.map((t)=>t.length))-Math.min(...e.map((t)=>t.length));function EY(e,t){let n=e.trace.route.findIndex((i)=>i.route_type==="via"),o=t.trace.route.findIndex((i)=>i.route_type==="via");if(n<0||o<0)return null;let r=e.sourceEscapeSegmentCount??1;return{...t,sourcePoint:e.sourcePoint,via:e.via,exitPoint:e.exitPoint,sourceEscapeSegmentCount:r,segments:[...e.segments.slice(0,r),...t.segments.slice(t.sourceEscapeSegmentCount??1)],trace:{...e.trace,route:[...e.trace.route.slice(0,n+1),...t.trace.route.slice(o+1)]}}}function jit(e,t,n){if(!t.exitEdge||e.termination.type!=="boundary")return null;let o=t.sharedBoundary,r=(_)=>t.exitEdge==="left"?_.x-o.minX:t.exitEdge==="right"?o.maxX-_.x:t.exitEdge==="top"?o.maxY-_.y:_.y-o.minY;if(Math.abs(r(e.exitPoint))>h_)return null;let i=e.segments.length-1;while(i>0&&e.segments[i-1].layer===e.targetLayer)i--;if(i<(e.sourceEscapeSegmentCount??1))return null;let s=-1;for(let _=i;_<e.segments.length;_++){let p=e.segments[_];if(r(p.start)>=n&&r(p.end)<=n)s=_}if(s<0)s=i;let a=e.segments[s],c=r(a.start),l=r(a.end),h=c>n&&l<c?(c-n)/(c-l):0,d={x:a.start.x+(a.end.x-a.start.x)*h,y:a.start.y+(a.end.y-a.start.y)*h};if(r(d)<=h_)return null;let u=[{...a,start:d},...e.segments.slice(s+1)].filter((_)=>Gt(_.start,_.end)>h_);if(!u.length||u.some((_)=>_.layer!==e.targetLayer))return null;return{...e,sourcePoint:{...e.sourcePoint,...d},sourceEscapeSegmentCount:0,via:void 0,additionalVias:[],segments:u,length:u.reduce((_,p)=>_+Gt(p.start,p.end),0),trace:{...e.trace,pcb_trace_id:`${e.trace.pcb_trace_id}-retained-tail`,route:[d,...u.map((_)=>_.end)].map((_)=>({route_type:"wire",..._,layer:e.targetLayer,width:u[0].width}))}}}function Kit(e){let{inputSrj:t,preparedBuses:n,layerNames:o,viaDiameter:r,viaHoleDiameter:i}=e,s=new Map(e.plans.map((h)=>[h.connectionIndex,h])),a=n.flatMap((h)=>h.connections);if(a.length!==t.connections.length||s.size!==a.length||s.size!==e.plans.length||a.some((h)=>s.get(h.connectionIndex)?.connectionName!==h.connection.name))throw Error("Retained-tail repair requires every original connection exactly once");let c=new Map,l=new Map;for(let h of a){let d=s.get(h.connectionIndex),u=d.segments.slice(0,d.sourceEscapeSegmentCount??1);if(!d.via||!u.length||u.some((_)=>_.layer!==h.sourceLayer)||Gt(u[0].start,h.sourcePoint)>h_||Gt(u.at(-1).end,d.via.center)>h_||u.some((_,p)=>p>0&&Gt(u[p-1].end,_.start)>h_)||d.via.fromLayer!==h.sourceLayer||d.via.toLayer!==d.targetLayer||d.via.diameter!==r||d.via.holeDiameter!==i||d.via.spanLayers.length!==o.length||!o.every((_)=>d.via.spanLayers.includes(_)))return null;c.set(h.connectionIndex,d.via.center),l.set(h.connectionIndex,[u[0].start,...u.map((_)=>_.end)])}return{fixed:c,sourcePaths:l}}function*sFr(e,t){let{inputSrj:n,preparedBuses:o,layerNames:r,traceWidth:i,clearance:s,viaDiameter:a,viaHoleDiameter:c}=e,l=e.maximumIterationsPerAttempt??1e7;if(!Number.isSafeInteger(l)||l<1)throw Error("maximumIterationsPerAttempt must be a positive safe integer");let h=Kit(e);if(!h)return null;let{fixed:d,sourcePaths:u}=h,_=[...e.plans],p=o.filter((A)=>A.termination.type==="boundary"&&A.maxLengthSkew!==void 0&&A.connections.length>1&&(!e.busIds||e.busIds.includes(A.busId)));for(let A of p){let g=_.filter((O)=>O.busId===A.busId);if(g.length!==A.connections.length)return null;if(q4(g)<=A.maxLengthSkew+h_)continue;let f=g[0].targetLayer;if(g.some((O)=>O.targetLayer!==f||O.planeEndpointTrace||O.planeEndpointSegments||O.planeEndpointVia)||!A.exitEdge)return null;let y=(A.routableEscapeLayers??A.allowedLayers??r).filter((O)=>(A.allowedLayers??r).includes(O));if(!y.includes(f))return null;let x=y.filter((O)=>O!==f);if(!x.length)return null;let C=(O,U,j)=>{let Y={srj:n,allBuses:o,buses:[{...A,connections:O}],targetLayer:f,transitLayers:x,terminals:O.map((X)=>({connection:X,viaPoint:d.get(X.connectionIndex),exitPoint:U.get(X.connectionIndex)})),fixedViaPointsByConnectionIndex:d,sourceEscapePaths:u,acceptedPlans:j,layerNames:r,traceWidth:i,clearance:s,viaDiameter:a,viaHoleDiameter:c,tightViaChannels:!0,includeDiagonalNeighbors:!0,heuristicWeight:1,maximumIterations:l,maximumRipEvents:200,maximumLocalRepairAttempts:0,ripCost:256,shuffleSeed:1};return t3(Y)},b=g.toSorted((O,U)=>U.length-O.length)[0],I=A.connections.find((O)=>O.connectionIndex===b.connectionIndex),v=C([I],new Map([[b.connectionIndex,b.exitPoint]]),_.filter((O)=>O!==b)),P=v.next();while(!P.done)yield{...P.value,busId:A.busId,phase:"lane"},P=v.next();let M=P.value?.[0]?EY(b,P.value[0]):null;if(M&&M.length<b.length-h_&&q4(g.map((O)=>O===b?M:O))<q4(g)-h_)t.push({busId:A.busId,plan:M});if(M&&q4(g.map((O)=>O===b?M:O))<=A.maxLengthSkew+h_){_=_.map((O)=>O===b?M:O);continue}let B=Math.min(12*(i+s),(A.exitEdge==="left"||A.exitEdge==="right"?A.sharedBoundary.maxX-A.sharedBoundary.minX:A.sharedBoundary.maxY-A.sharedBoundary.minY)/3),T=g.map((O)=>jit(O,A,B));if(T.some((O)=>!O))return null;let N=T,D=_.filter((O)=>O.busId!==A.busId),L=C(A.connections,new Map(N.map((O)=>[O.connectionIndex,O.sourcePoint])),[...D,...N]),H=L.next();while(!H.done)yield{...H.value,busId:A.busId,phase:"bus"},H=L.next();if(!H.value||H.value.length!==g.length)return null;let V=_.map((O)=>{let U=H.value.find((K)=>K.connectionIndex===O.connectionIndex);if(!U)return O;let j=EY(O,U);if(!j)throw Error("Retained-tail routing lost its source via");let Y=N.find((K)=>K.connectionIndex===j.connectionIndex),X=[...j.trace.route,...Y.trace.route.slice(1)];return X[X.length-1]=O.trace.route.at(-1),{...j,exitPoint:O.exitPoint,trace:{...O.trace,route:X},segments:[...j.segments,...Y.segments],length:j.length+Y.length}});for(let O of g){let U=V.find((Y)=>Y.connectionIndex===O.connectionIndex),j=Bue(e,U,V.filter((Y)=>Y!==U),A,!0);if(!j)return null;V=V.map((Y)=>Y===U?j:Y)}if(q4(V.filter((O)=>O.busId===A.busId))>A.maxLengthSkew+h_||!q0({plans:V,srj:n,sharedBoundary:A.sharedBoundary,clearance:s,allowBlindAndBuriedVias:!1,allowSameNetMerges:!1}))return null;_=V}return kd({inputSrj:n,routedSrj:{...n,traces:[...n.traces??[],..._.flatMap((A)=>[A.trace,...A.planeEndpointTrace?[A.planeEndpointTrace]:[]])]},clearance:s,allowBlindAndBuriedVias:!1}).valid?_:null}function*aFr(e,t){let n=yield*sFr(e,t);if(n)return n;let o=Kit(e);if(!o)return null;let{fixed:r,sourcePaths:i}=o,{inputSrj:s,preparedBuses:a,layerNames:c,traceWidth:l,clearance:h}=e,d=a.filter((m)=>m.termination.type==="boundary"&&m.connections.length>1&&m.maxLengthSkew!==void 0&&(!e.busIds||e.busIds.includes(m.busId))),u=new Map;for(let m of d){let A=e.plans.filter((y)=>y.busId===m.busId);if(A.length!==m.connections.length||!m.exitEdge)return null;let g=A[0].targetLayer;if(A.some((y)=>y.targetLayer!==g||y.planeEndpointTrace||y.planeEndpointSegments||y.planeEndpointVia))return null;let f=`${g}:${m.exitEdge}`;u.set(f,[...u.get(f)??[],m])}let _=[...e.plans];for(let m of u.values()){let A=new Set(m.map((H)=>H.busId)),g=_.filter((H)=>A.has(H.busId));if(m.every((H)=>q4(g.filter((V)=>V.busId===H.busId))<=H.maxLengthSkew+h_))continue;if(m.length<2)return null;let f=g[0].targetLayer,y=c.filter((H)=>m.every((V)=>(V.routableEscapeLayers??V.allowedLayers??c).includes(H)&&(V.allowedLayers??c).includes(H)));if(!y.includes(f))return null;let x=y.filter((H)=>H!==f);if(!x.length)return null;let C=m[0].sharedBoundary,b=Math.min(12*(l+h),(m[0].exitEdge==="left"||m[0].exitEdge==="right"?C.maxX-C.minX:C.maxY-C.minY)/3),I=g.map((H)=>jit(H,m.find((V)=>V.busId===H.busId),b));if(I.some((H)=>!H))return null;let v=I,P=_.filter((H)=>!A.has(H.busId)),M=t3({...e,srj:s,allBuses:a,buses:m,targetLayer:f,transitLayers:x,terminals:m.flatMap((H)=>H.connections.map((V)=>({connection:V,viaPoint:r.get(V.connectionIndex),exitPoint:v.find((O)=>O.connectionIndex===V.connectionIndex).sourcePoint}))),fixedViaPointsByConnectionIndex:r,sourceEscapePaths:i,acceptedPlans:[...P,...v],tightViaChannels:!0,includeDiagonalNeighbors:!0,heuristicWeight:1,ripCost:8,shuffleSeed:1,maximumIterations:e.maximumIterationsPerAttempt??1e7,maximumRipEvents:200,maximumLocalRepairAttempts:0}),B=M.next();while(!B.done)yield{...B.value,busId:m[0].busId,phase:"layer"},B=M.next();if(!B.value||B.value.length!==g.length)return null;let T=B.value,N=_.map((H)=>{let V=T.find((Y)=>Y.connectionIndex===H.connectionIndex);if(!V)return H;let O=EY(H,V);if(!O)throw Error("Joint retained-tail routing lost its source via");let U=v.find((Y)=>Y.connectionIndex===H.connectionIndex),j=[...O.trace.route,...U.trace.route.slice(1)];return j[j.length-1]=H.trace.route.at(-1),{...O,trace:{...H.trace,route:j},segments:[...O.segments,...U.segments],length:O.length+U.length}});for(let H of g){let V=N.find((U)=>U.connectionIndex===H.connectionIndex),O=Bue(e,V,N.filter((U)=>U!==V),m.find((U)=>U.busId===H.busId),!0);if(!O)return null;N=N.map((U)=>U===V?O:U)}if(!q0({plans:N,srj:s,sharedBoundary:C,clearance:h,allowBlindAndBuriedVias:!1,allowSameNetMerges:!1}))return null;N=GJ({...e,plans:N,preparedBuses:m,selectedBusIds:A,allowBlindAndBuriedVias:!1})??N;let D=Ey({...e,plans:N,preparedBuses:m,sharedBoundary:C,allowBlindAndBuriedVias:!1,allowSameNetMerges:!1,allowMatchingInsideDenseBounds:!0,allowPairLaneSpreading:!0,allowUnconstrainedLaneRerouting:!0,maximumWorkUnits:1000});if(!D.plans)return null;let L=D.plans;if(N=_.map((H)=>{if(!A.has(H.busId))return H;let V=L.find((U)=>U.connectionIndex===H.connectionIndex),O=EY(H,V);if(!O)throw Error("Joint retained-tail tuning lost its source via");return O}),m.some((H)=>q4(N.filter((V)=>V.busId===H.busId))>H.maxLengthSkew+h_))return null;_=N}if(d.some((m)=>q4(_.filter((A)=>A.busId===m.busId))>m.maxLengthSkew+h_))return null;return kd({inputSrj:s,routedSrj:{...s,traces:[...s.traces??[],..._.flatMap((m)=>[m.trace,...m.planeEndpointTrace?[m.planeEndpointTrace]:[]])]},clearance:h,allowBlindAndBuriedVias:!1}).valid?_:null}function*cFr(e){let t=[],n=yield*aFr(e,t);if(n)return n;if(!t.length)return null;let o=[...e.plans],r=!1;for(let{busId:s,plan:a}of t){let c=e.preparedBuses.find((m)=>m.busId===s),l=o.find((m)=>m.connectionIndex===a.connectionIndex),h=Bue(e,a,o.filter((m)=>m!==l),c,!0);if(!h)continue;let d=o.map((m)=>m===l?h:m),u=Ey({...e,plans:d,preparedBuses:[c],sharedBoundary:c.sharedBoundary,allowBlindAndBuriedVias:!1,allowSameNetMerges:!1,allowMatchingInsideDenseBounds:!0,allowPairLaneSpreading:!0,allowUnconstrainedLaneRerouting:!0,maximumWorkUnits:1000});if(!u.plans)continue;let _=o.map((m)=>{if(m.busId!==s)return m;let A=u.plans.find((g)=>g.connectionIndex===m.connectionIndex);return EY(m,A)});if(_.some((m)=>!m))continue;let p=_;if(q4(p.filter((m)=>m.busId===s))>c.maxLengthSkew+h_||!q0({plans:p,srj:e.inputSrj,sharedBoundary:c.sharedBoundary,clearance:e.clearance,allowBlindAndBuriedVias:!1,allowSameNetMerges:!1}))continue;o=p,r=!0}if(!r)return null;if(e.preparedBuses.some((s)=>(!e.busIds||e.busIds.includes(s.busId))&&s.maxLengthSkew!==void 0&&q4(o.filter((a)=>a.busId===s.busId))>s.maxLengthSkew+h_))return null;return kd({inputSrj:e.inputSrj,routedSrj:{...e.inputSrj,traces:[...e.inputSrj.traces??[],...o.flatMap((s)=>[s.trace,...s.planeEndpointTrace?[s.planeEndpointTrace]:[]])]},clearance:e.clearance,allowBlindAndBuriedVias:!1}).valid?o:null}function*lFr(e){let t=Kit(e);if(!t)return null;let{inputSrj:n,preparedBuses:o,layerNames:r}=e,i=e.maximumIterationsPerAttempt??5000000;if(!Number.isSafeInteger(i)||i<1)throw Error("maximumIterationsPerAttempt must be a positive safe integer");let s=Math.min(i,5000000),a=o.filter((d)=>d.termination.type==="boundary"&&d.connections.length>2&&d.maxLengthSkew!==void 0&&(!e.busIds||e.busIds.includes(d.busId))),c=[...e.plans],l=!1;for(let d of a){let u=c.filter((T)=>T.busId===d.busId);if(u.length!==d.connections.length)return null;if(q4(u)<=d.maxLengthSkew+h_)continue;let _=Math.min(...u.map((T)=>T.length)),p=u.filter((T)=>T.length>_+d.maxLengthSkew+h_).toSorted((T,N)=>N.length-T.length||T.connectionIndex-N.connectionIndex).slice(0,2);if(p.length!==2)return null;let m=u[0].targetLayer;if(!d.exitEdge||u.some((T)=>T.targetLayer!==m||T.planeEndpointTrace||T.planeEndpointSegments||T.planeEndpointVia))return null;let A=(d.routableEscapeLayers??d.allowedLayers??r).filter((T)=>(d.allowedLayers??r).includes(T)),g=A.filter((T)=>T!==m);if(!A.includes(m)||!g.length)return null;let f=new Set(p.map((T)=>T.connectionIndex)),y=d.connections.filter((T)=>f.has(T.connectionIndex)),x=t3({...e,srj:n,allBuses:o,buses:[{...d,connections:y}],targetLayer:m,transitLayers:g,terminals:y.map((T)=>({connection:T,viaPoint:t.fixed.get(T.connectionIndex),exitPoint:u.find((N)=>N.connectionIndex===T.connectionIndex).exitPoint})),fixedViaPointsByConnectionIndex:t.fixed,sourceEscapePaths:t.sourcePaths,acceptedPlans:c.filter((T)=>!f.has(T.connectionIndex)),tightViaChannels:!0,includeDiagonalNeighbors:!0,ripCost:64,shuffleSeed:1,maximumIterations:s,maximumRipEvents:80,maximumLocalRepairAttempts:0}),C=x.next();while(!C.done)yield{...C.value,busId:d.busId,phase:"overlong-pair"},C=x.next();if(!C.value||C.value.length!==2)return null;let b=new Map(C.value.map((T)=>[T.connectionIndex,T])),I=c.map((T)=>{let N=b.get(T.connectionIndex);return N?EY(T,N):T});if(I.some((T)=>!T))return null;let v=Ey({...e,plans:I,preparedBuses:[d],sharedBoundary:d.sharedBoundary,allowBlindAndBuriedVias:!1,allowSameNetMerges:!1,allowMatchingInsideDenseBounds:!0,allowPairLaneSpreading:!0,allowUnconstrainedLaneRerouting:!0,maximumWorkUnits:1000});if(!v.plans)return null;let P=new Map(v.plans.map((T)=>[T.connectionIndex,T])),M=c.map((T)=>T.busId===d.busId?EY(T,P.get(T.connectionIndex)):T);if(M.some((T)=>!T))return null;let B=M;if(q4(B.filter((T)=>T.busId===d.busId))>d.maxLengthSkew+h_||!q0({plans:B,srj:n,sharedBoundary:d.sharedBoundary,clearance:e.clearance,allowBlindAndBuriedVias:!1,allowSameNetMerges:!1}))return null;c=B,l=!0}if(!l||o.some((d)=>(!e.busIds||e.busIds.includes(d.busId))&&d.maxLengthSkew!==void 0&&q4(c.filter((u)=>u.busId===d.busId))>d.maxLengthSkew+h_))return null;return kd({inputSrj:n,routedSrj:{...n,traces:[...n.traces??[],...c.flatMap((d)=>[d.trace,...d.planeEndpointTrace?[d.planeEndpointTrace]:[]])]},clearance:e.clearance,allowBlindAndBuriedVias:!1}).valid?c:null}function*hFr(e){let t=yield*cFr(e);if(t)return t;return yield*lFr(e)}function Rve(e,t,n){return e.buses.flatMap((o)=>o.connections.map((r)=>{let i=t.get(r.connectionIndex),s=o.termination.type==="plane"?o.termination.layer:(o.allowedLayers??e.layerNames).filter((a)=>a!==r.sourceLayer).at(-1);return Ob({...e,bus:o,terminal:{connection:r,viaPoint:i,exitPoint:i},targetLayer:s,targetLayerPoints:[i],sourceEscapePoints:n.get(r.connectionIndex),allowBlindAndBuriedVias:!1})}))}function dFr(e){if(!e.buses.length||e.buses.some((r)=>r.connections.some((i)=>i.sourceLayer!=="top")))return null;let t=Yu(e.buses,{...e,maximumSearchStates:1e4,additionalObstacles:e.srj.obstacles});if(!t)return null;let n=new Map(e.buses.flatMap((r)=>r.connections.map((i)=>[i.connectionIndex,[i.sourcePoint,t.get(i.connectionIndex)]]))),o=Rve(e,t,n);if(!kd({inputSrj:e.srj,routedSrj:{...e.srj,traces:[...e.srj.traces??[],...o.map((r)=>r.trace)]},clearance:e.clearance,allowBlindAndBuriedVias:!1}).valid)return null;return{fixedViaPointsByConnectionIndex:t,sourceEscapePaths:n,sourcePlans:o}}function*uFr(e){let t=t3({...e,transitLayers:[],routeFromSourcePads:!0,sourceLayerTravelCost:e.sourceLayerTravelCost??2,maximumRipEvents:1200,maximumIterations:e.maximumSourceIterations??50000000,maximumLocalRepairAttempts:0,shuffleSeed:1}),n=t.next();while(!n.done)yield n.value,n=t.next();if(!n.value)return null;let o=n.value,r=new Map(e.fixedViaPointsByConnectionIndex),i=new Map(e.allBuses.flatMap((l)=>l.connections.map((h)=>[h.connectionIndex,e.sourceEscapePaths?.get(h.connectionIndex)??[h.sourcePoint,r.get(h.connectionIndex)]]))),s=new Map(e.buses.flatMap((l)=>l.connections.map((h)=>[h.connectionIndex,{bus:l,connection:h}]))),a=(l)=>{if(!l.via)throw Error("Source-origin routing lost a required first via");r.set(l.connectionIndex,l.via.center);let h=l.segments.slice(0,l.sourceEscapeSegmentCount??1);i.set(l.connectionIndex,[l.sourcePoint,...h.map((d)=>d.end)])};o.forEach(a);let c=(l)=>{let h=s.get(l.connectionIndex).bus;if(h.connections.length<=2||h.maxLengthSkew===void 0)return!1;let d=Math.min(...o.filter((u)=>u.busId===l.busId).map((u)=>u.length));return l.length>d+h.maxLengthSkew+0.0000001};for(let l=0;l<2;l++){let h=o.filter(c).toSorted((u,_)=>_.length-u.length).slice(0,8),d=!1;for(let u of h){let _=o.find((I)=>I.connectionIndex===u.connectionIndex);if(!c(_))continue;let{bus:p,connection:m}=s.get(_.connectionIndex),A=e.cleanupRetainedBoundaryTails?jit(_,p,(l===0?12:6)*(e.traceWidth+e.clearance)):null;if(e.cleanupRetainedBoundaryTails&&!A)continue;let g=t3({...e,buses:[{...p,connections:[m]}],transitLayers:[],routeFromSourcePads:!0,sourceLayerTravelCost:1,includeDiagonalNeighbors:e.cleanupRetainedBoundaryTails||e.includeDiagonalNeighbors,fixedViaPointsByConnectionIndex:r,sourceEscapePaths:i,acceptedPlans:[...e.acceptedPlans,...o.filter((I)=>I!==_),...A?[A]:[]],terminals:[{connection:m,viaPoint:r.get(m.connectionIndex),exitPoint:A?.sourcePoint??_.exitPoint}],maximumRipEvents:1,maximumIterations:2000000,maximumLocalRepairAttempts:0,shuffleSeed:1}),f=g.next();while(!f.done)yield{...f.value,connectionCount:o.length},f=g.next();let y=f.value?.[0];if(y&&A){let I={...y,exitPoint:_.exitPoint,segments:[...y.segments,...A.segments],length:y.length+A.length,trace:{...y.trace,route:[...y.trace.route,...A.trace.route.slice(1)]}};y=Bue({...e,inputSrj:e.srj},I,[...e.acceptedPlans,...o.filter((v)=>v!==_),...Rve({...e,buses:e.allBuses.filter((v)=>!e.buses.some((P)=>P.busId===v.busId))},r,i)],p,!0)??void 0}if(!y||y.length>=_.length-0.0000001)continue;let x=o.filter((I)=>I.busId===_.busId),C=x.map((I)=>I.length),b=x.map((I)=>I===_?y.length:I.length);if(Math.max(...b)-Math.min(...b)>Math.max(...C)-Math.min(...C)+0.0000001)continue;if(A&&!kd({inputSrj:e.srj,routedSrj:{...e.srj,traces:[...e.srj.traces??[],...e.acceptedPlans.flatMap((I)=>[I.trace,...I.planeEndpointTrace?[I.planeEndpointTrace]:[]]),...o.map((I)=>(I===_?y:I).trace),...Rve({...e,buses:e.allBuses.filter((I)=>!e.buses.some((v)=>v.busId===I.busId)&&!e.acceptedPlans.some((v)=>v.busId===I.busId))},r,i).map((I)=>I.trace)]},clearance:e.clearance,allowBlindAndBuriedVias:!1}).valid)continue;o=o.map((I)=>I===_?y:I),a(y),d=!0}if(!d)break}return{plans:o,fixedViaPointsByConnectionIndex:r,sourceEscapePaths:i,sourcePlans:Rve({...e,buses:e.allBuses},r,i)}}function $it(e){let t=e.filter((n)=>n.termination.type==="boundary"&&n.connections.length>=8&&n.allowedLayers?.length===1&&n.allowedLayers[0]!=="top");if(t.some((n)=>n.connections.length>=16))return!1;return t.some((n,o)=>t.slice(o+1).some((r)=>r.componentId===n.componentId&&r.exitEdge===n.exitEdge&&r.allowedLayers[0]===n.allowedLayers[0]))}function f7e(e){return e.some((t)=>{if(t.termination.type!=="boundary"||t.connections.length<8||t.allowedLayers?.length!==1||t.allowedLayers[0]==="top")return!1;let n=t.exitEdge==="left"||t.exitEdge==="right"?"x":"y",o=t.exitEdge==="left"||t.exitEdge==="bottom"?-1:1,r=n==="x"?(t.componentBounds.minX+t.componentBounds.maxX)/2:(t.componentBounds.minY+t.componentBounds.maxY)/2;return t.connections.every((i)=>o*(i.sourcePoint[n]-r)<-0.0000001)})}function pFr(e,t){let n=e[0];if(!n||t||e.some((c)=>c.componentId!==n.componentId||c.connections.some((l)=>l.sourceLayer!=="top")))return!1;let o=e.filter((c)=>c.termination.type==="boundary"),r=o.filter((c)=>c.connections.length>=8),i=r[0]?.exitEdge;if(!i||r.some((c)=>c.exitEdge!==i)||!(r.some((c)=>c.connections.length>=16&&c.allowedLayers?.length===1&&c.allowedLayers[0]!=="top")||$it(r)))return!1;let s=o.reduce((c,l)=>c+l.connections.length,0);if(e.filter((c)=>c.termination.type==="plane").reduce((c,l)=>c+l.connections.length,0)<s)return!1;return!0}var PJ=0.0000001,mFr={left:"right",right:"left",up:"down",down:"up"};function Qot(e){let t=e;if(t.shape==="circle"||e.type!=="rect")return null;let n=(t.ccwRotationDegrees??0)/90;if(Math.abs(n-Math.round(n))>PJ)return null;return Math.abs(Math.round(n))%2===0?{x:e.width,y:e.height}:{x:e.height,y:e.width}}function Zgn(e,t){let n=Qot(t);if(!n||Math.abs(n.x-n.y)<PJ)return null;let{center:o}=t;if(n.x>n.y){if(Math.abs(o.x-n.x/2-e.minX)<PJ)return"left";if(Math.abs(o.x+n.x/2-e.maxX)<PJ)return"right"}else{if(Math.abs(o.y-n.y/2-e.minY)<PJ)return"down";if(Math.abs(o.y+n.y/2-e.maxY)<PJ)return"up"}return null}function qit(e){let t=e.buses[0];if(!t||e.allowBlindAndBuriedVias||e.buses.some((a)=>a.componentId!==t.componentId||a.connections.some((c)=>c.sourceLayer!=="top")))return null;let n={minX:1/0,maxX:-1/0,minY:1/0,maxY:-1/0};for(let a of t.componentObstacles){let c=Qot(a);if(!c)return null;n.minX=Math.min(n.minX,a.center.x-c.x/2),n.maxX=Math.max(n.maxX,a.center.x+c.x/2),n.minY=Math.min(n.minY,a.center.y-c.y/2),n.maxY=Math.max(n.maxY,a.center.y+c.y/2)}let o=new Set;for(let a of e.buses){if(a.termination.type!=="boundary")continue;for(let c of a.connections){let l=Zgn(n,c.sourceObstacle);if(!l)return null;o.add(l)}}if(o.size!==4)return null;let r=new Map,i=new Map,s=[];for(let a of e.buses){let c=a.termination.type==="plane"?a.termination.layer:(a.routableEscapeLayers??a.allowedLayers??e.layerNames).filter((l)=>l!=="top").at(-1);if(!c||!e.layerNames.includes(c))return null;for(let l of a.connections){let h=l.sourceObstacle,d=Qot(h);if(!d)return null;let u=Zgn(n,h);if(!u){if(a.termination.type!=="plane")return null;u=a.direction}else if((e.side??"inward")==="inward")u=mFr[u];let _=l.sourcePoint,p=e.viaDiameter/2+e.clearance+0.001,m=u==="left"?{x:h.center.x-d.x/2-p,y:_.y}:u==="right"?{x:h.center.x+d.x/2+p,y:_.y}:u==="up"?{x:_.x,y:h.center.y+d.y/2+p}:{x:_.x,y:h.center.y-d.y/2-p},A=a.sharedBoundary,g=e.viaDiameter/2;if(m.x-g<A.minX||m.x+g>A.maxX||m.y-g<A.minY||m.y+g>A.maxY)return null;if(r.has(l.connectionIndex))throw Error("FanoutSolver: duplicate peripheral source connection");r.set(l.connectionIndex,m),i.set(l.connectionIndex,[_,m]),s.push(Ob({...e,bus:a,terminal:{connection:l,viaPoint:m,exitPoint:m},targetLayer:c,targetLayerPoints:[m],sourceEscapePoints:[_,m],allowBlindAndBuriedVias:!1}))}}if(!q0({...e,plans:s,sharedBoundary:t.sharedBoundary,allowBlindAndBuriedVias:!1})||!kd({inputSrj:e.srj,routedSrj:{...e.srj,traces:[...e.srj.traces??[],...s.map((a)=>a.trace)]},clearance:e.clearance,allowBlindAndBuriedVias:!1}).valid)return null;return{fixedViaPointsByConnectionIndex:r,sourceEscapePaths:i,sourcePlans:s}}function i3n(e){let t=new Map;for(let o of e){let r=Vi(o.exitEdge,o.preferredExit);if(o.termination.type!=="boundary"||!o.exitEdge||!r)continue;let i=`${o.exitEdge}:${r}`,s=t.get(i)??[];s.push(o),t.set(i,s)}let n=new Map;for(let o of t.values()){let r=o[0].exitEdge==="left"||o[0].exitEdge==="right"?"y":"x",i=o.map((c,l)=>({bus:c,index:l,min:Math.min(...c.connections.map((h)=>h.sourcePoint[r])),max:Math.max(...c.connections.map((h)=>h.sourcePoint[r]))})).sort((c,l)=>c.min-l.min||c.index-l.index),s=[];for(let c of i){let l=s.at(-1);if(!l||c.min>l.max+0.000000001)s.push({max:c.max,members:[c]});else l.max=Math.max(l.max,c.max),l.members.push(c)}let a=0;for(let c of s)for(let{bus:l}of c.members.sort((h,d)=>h.index-d.index))n.set(l.busId,a),a+=l.connections.length}return n}function kot(e){let{buses:t,targetLayerByBusId:n,traceWidth:o,clearance:r}=e,i=o+r;if(!(o>0)||!(e.viaDiameter>0)||r<0||![o,e.viaDiameter,r].every(Number.isFinite))throw Error("FanoutSolver: invalid boundary packing dimensions");let s=i3n(t),a=[],c=new Map;for(let l of t){if(l.termination.type!=="boundary")continue;if(l.connections.length===0)throw Error(`FanoutSolver: bus ${l.busId} has no connections`);if(!l.exitEdge)throw Error(`FanoutSolver: bus ${l.busId} has no boundary edge`);let h=n.get(l.busId);if(!h||!e.layerNames.includes(h)||!(l.routableEscapeLayers??l.allowedLayers??e.layerNames).includes(h))throw Error(`FanoutSolver: bus ${l.busId} has no legal assigned layer`);let d=zS(l.exitEdge),u=Vi(l.exitEdge,l.preferredExit),_=l.connections.map((y)=>u?Q9({...e,bus:l,connection:y,targetLayer:h,cornerExitLaneOffset:s.get(l.busId)??0,windingOrderIndex:0}):fY({...e,bus:l,connection:y,targetLayer:h,boundaryDirection:d,windingOrderIndex:0})),p=_.toSorted((y,x)=>y-x);if(p.some((y,x)=>!Number.isFinite(y)||x>0&&y-p[x-1]<i-0.00000001))throw Error(`FanoutSolver: bus ${l.busId} already contains overlapping desired lanes`);let m=l.exitEdge==="left"||l.exitEdge==="right",A={busId:l.busId,layer:h,edge:l.exitEdge,minimum:m?l.sharedBoundary.minY:l.sharedBoundary.minX,maximum:m?l.sharedBoundary.maxY:l.sharedBoundary.maxX,connectionIndices:l.connections.map((y)=>y.connectionIndex),desiredTracks:_,tracks:[..._],desiredStart:p[0],desiredEnd:p.at(-1),start:p[0],end:p.at(-1),shift:0};if(![A.minimum,A.maximum].every(Number.isFinite)||A.maximum<A.minimum)throw Error(`FanoutSolver: invalid boundary for ${l.busId}`);a.push(A);let g=`${h}:${l.exitEdge}`,f=c.get(g)??[];f.push(A),c.set(g,f)}for(let l of c.values()){let h=(f)=>Number(((f.desiredStart+f.desiredEnd)/2).toFixed(9)),d=l.toSorted((f,y)=>h(f)-h(y)),u=Math.max(...d.map((f)=>f.minimum)),_=Math.min(...d.map((f)=>f.maximum));if(d.every((f,y)=>f.desiredStart>=u&&f.desiredEnd<=_&&(y===0||f.desiredStart-d[y-1].desiredEnd>=i-0.00000001)))continue;let p=[],m=0;for(let[f,y]of d.entries())p.push(m),m+=y.desiredEnd-y.desiredStart+(f<d.length-1?i:0);if(m>_-u+0.00000001)throw Error(`FanoutSolver: bus intervals do not fit ${d[0].layer}/${d[0].edge}`);let A=[];for(let[f,y]of d.entries()){A.push({first:f,last:f,weight:y.connectionIndices.length,mean:y.desiredStart-p[f]});while(A.length>1&&A.at(-2).mean>A.at(-1).mean){let x=A.pop(),C=A.pop(),b=C.weight+x.weight;A.push({first:C.first,last:x.last,weight:b,mean:(C.mean*C.weight+x.mean*x.weight)/b})}}let g=_-m;for(let f of A){let y=Math.max(u,Math.min(g,f.mean));for(let x=f.first;x<=f.last;x++){let C=d[x];C.start=y+p[x],C.shift=C.start-C.desiredStart,C.end=C.desiredEnd+C.shift,C.tracks=C.desiredTracks.map((b)=>b+C.shift)}}}return{tracksByConnectionIndex:new Map(a.flatMap((l)=>l.connectionIndices.map((h,d)=>[h,l.tracks[d]]))),intervals:a}}function _Fr(e){if(e.exitTargetPoint)return e.exitTargetPoint.layer??"top";let t=e.targetPoint;return"layer"in t?t.layer??"top":t.layers[0]??"top"}function s3n(e){let t=e.exitEdge==="left"||e.exitEdge==="right"?"y":"x",n=new Map;for(let o of e.connections){let r=_Fr(o);n.set(r,[...n.get(r)??[],o])}return[...n.values()].map((o)=>o.toSorted((r,i)=>{let s=(r.exitTargetPoint??r.targetPoint)[t]-(i.exitTargetPoint??i.targetPoint)[t];if(s!==0)return s;let a=(c)=>("source_trace_id"in c.connection)&&typeof c.connection.source_trace_id==="string"?c.connection.source_trace_id:c.connection.name;return a(r).localeCompare(a(i))||r.connection.name.localeCompare(i.connection.name)||r.connectionIndex-i.connectionIndex}))}function gFr(e,t){let n=e.exitEdge==="left"||e.exitEdge==="right"?"y":"x";return s3n(e).every((o)=>o.every((r,i)=>{let s=t.get(r.connectionIndex);if(!s||!Number.isFinite(s.x)||!Number.isFinite(s.y))return!1;return i===0||s[n]>t.get(o[i-1].connectionIndex)[n]}))}function Jit(e){let t=e.maximumSearchStates??4096;if(!Number.isSafeInteger(t)||t<1)throw Error("FanoutSolver: invalid boundary merge work bound");let n=new Map(e.exits);for(let o of e.buses){if(o.termination.type!=="boundary"||!o.exitEdge||o.connections.length<3)continue;if(o.connections.some((m)=>!m.hasExplicitLayeredExitTarget))continue;let r=s3n(o);if(r.length<2)continue;if(r.reduce((m,A)=>m*(A.length+1),1)>t)continue;let s=o.exitEdge==="left"||o.exitEdge==="right"?"y":"x",a=s==="x"?"y":"x",c=o.exitEdge==="left"||o.exitEdge==="bottom"?-1:1,l={x:(o.componentBounds.minX+o.componentBounds.maxX)/2,y:(o.componentBounds.minY+o.componentBounds.maxY)/2},h=new Map(o.connections.map((m)=>[m.connectionIndex,Math.atan2(m.sourcePoint[s]-l[s],c*(m.sourcePoint[a]-l[a]))])),d=o.connections.map((m)=>{let A=n.get(m.connectionIndex);if(!A||!Number.isFinite(A.x)||!Number.isFinite(A.y))throw Error("FanoutSolver: missing packed boundary target");return A[s]}).sort((m,A)=>m-A);if(d.some((m,A)=>A>0&&m<=d[A-1]))throw Error("FanoutSolver: duplicate packed boundary tracks");let u=new Map,_=(m)=>{let A=m.join(","),g=u.get(A);if(g)return g;let f=m.reduce((x,C)=>x+C,0);if(f===d.length)return{inversions:0,length:0,order:[]};let y;for(let[x,C]of r.entries()){let b=C[m[x]];if(!b)continue;let I=r.reduce((T,N,D)=>T+N.slice(0,m[D]).filter((L)=>h.get(L.connectionIndex)>h.get(b.connectionIndex)+0.000000001).length,0),v=[...m];v[x]++;let P=_(v),M={...n.get(b.connectionIndex),[s]:d[f]},B={inversions:I+P.inversions,length:Math.hypot(b.sourcePoint.x-M.x,b.sourcePoint.y-M.y)+P.length,order:[b,...P.order]};if(!y||B.inversions<y.inversions||B.inversions===y.inversions&&B.length<y.length)y=B}if(!y)throw Error("FanoutSolver: incomplete boundary merge state");return u.set(A,y),y},p=new Map(n);for(let[m,A]of _(r.map(()=>0)).order.entries())p.set(A.connectionIndex,{...n.get(A.connectionIndex),[s]:d[m]});if(!gFr(o,p))throw Error("FanoutSolver: boundary merge changed a layer's lane order");for(let m of o.connections)n.set(m.connectionIndex,p.get(m.connectionIndex))}return n}var ktt=(e,t)=>{let n=e.sharedBoundary;switch(e.exitEdge){case"left":return{x:n.minX,y:t};case"right":return{x:n.maxX,y:t};case"top":return{x:t,y:n.maxY};case"bottom":return{x:t,y:n.minY};default:throw Error(`FanoutSolver: bus ${e.busId} has no boundary edge`)}};function AFr(e,t,n,o){let r=(i,s,a)=>(s.x-i.x)*(a.y-i.y)-(s.y-i.y)*(a.x-i.x);return r(e,t,n)*r(e,t,o)<-0.000000000001&&r(n,o,e)*r(n,o,t)<-0.000000000001}function fFr(e){let{buses:t,layerNames:n,traceWidth:o,clearance:r}=e,i=o+r,s=new Map,a=[];for(let d of t){if(d.termination.type==="plane"){s.set(d.busId,d.termination.layer);continue}let u=new Set(d.connections.map((g)=>g.sourceLayer)),_=(d.routableEscapeLayers??d.allowedLayers??n).filter((g)=>e.allowSourceLayerTargets||!u.has(g));if(!_.length)return null;let p=_.map((g)=>kot({...e,buses:[d],targetLayerByBusId:new Map([[d.busId,g]])}).intervals[0]),m=d.connections.length,A=d.connections.reduce((g,f)=>({x:g.x+f.sourcePoint.x/m,y:g.y+f.sourcePoint.y/m}),{x:0,y:0});a.push({bus:d,source:A,intervals:p})}a.sort((d,u)=>d.intervals.length-u.intervals.length||Math.max(...u.intervals.map((_)=>_.end-_.start))-Math.max(...d.intervals.map((_)=>_.end-_.start))||u.bus.connections.length-d.bus.connections.length);let c=[];for(let{bus:d,source:u,intervals:_}of a){let p;for(let m of _){let A=c.filter((M)=>M.interval.layer===m.layer),g=A.filter((M)=>M.interval.edge===m.edge),f=Math.max(m.minimum,...g.map((M)=>M.interval.minimum)),y=Math.min(m.maximum,...g.map((M)=>M.interval.maximum)),x=m.end-m.start+g.reduce((M,B)=>M+B.interval.end-B.interval.start+i,0);if(x>y-f+0.00000001)continue;let C=ktt(d,(m.start+m.end)/2),b=A.reduce((M,B)=>M+(AFr(u,C,B.source,B.target)?Math.min(d.connections.length,B.bus.connections.length):0),0),I=g.reduce((M,B)=>M+B.bus.connections.length,0),v=A.reduce((M,B)=>M+B.bus.connections.length,0),P=b*4+I+v/4+10*x/Math.max(i,y-f);if(!p||P<p.score||P===p.score&&n.indexOf(m.layer)>n.indexOf(p.interval.layer))p={interval:m,score:P}}if(!p)return null;s.set(d.busId,p.interval.layer),c.push({bus:d,source:u,interval:p.interval,target:ktt(d,(p.interval.start+p.interval.end)/2)})}let l=kot({...e,targetLayerByBusId:s}),h=new Map;for(let{bus:d}of a)for(let u of d.connections)h.set(u.connectionIndex,ktt(d,l.tracksByConnectionIndex.get(u.connectionIndex)));return{targetLayerByBusId:s,exits:Jit({buses:t,exits:h})}}function*yFr(e){let{plans:t,bus:n,preparedBuses:o,inputSrj:r,layerNames:i}=e;if(n.termination.type!=="boundary"||n.connections.length!==2||n.maxLengthSkew===void 0||n.connections.some((g)=>g.sourceLayer!=="top"))return null;let s=o.flatMap((g)=>g.connections),a=new Map(t.map((g)=>[g.connectionIndex,g]));if(s.length!==r.connections.length||a.size!==s.length||t.length!==a.size||s.some((g)=>a.get(g.connectionIndex)?.connectionName!==g.connection.name))throw Error("FanoutSolver: transit pair repair requires every original plan");let c=n.connections.map((g)=>a.get(g.connectionIndex)),l=c[0].targetLayer;if(c.some((g)=>g.targetLayer!==l)||Math.abs(c[0].length-c[1].length)<=n.maxLengthSkew+0.000001)return null;let h=(n.routableEscapeLayers??n.allowedLayers??i).filter((g)=>g!=="top"&&g!==l);if(!h.length)return null;let d=new Map,u=new Map;for(let g of s){let f=a.get(g.connectionIndex);if(!f.via)return null;let y=f.segments.slice(0,f.sourceEscapeSegmentCount??1);if(!y.length||y.some((x)=>x.layer!==g.sourceLayer)||Gt(y[0].start,g.sourcePoint)>0.000001||Gt(y.at(-1).end,f.via.center)>0.000001||y.some((x,C)=>C>0&&Gt(y[C-1].end,x.start)>0.000001))return null;d.set(g.connectionIndex,f.via.center),u.set(g.connectionIndex,[g.sourcePoint,...y.map((x)=>x.end)])}let _=new Set(n.connections.map((g)=>g.connectionIndex)),p=(n.routableEscapeLayers??n.allowedLayers??i).filter((g)=>g!=="top"),m=5000000,A;for(let g of[void 0,...p]){if(m<=0)break;let f=new Map(d),y=new Map(u);if(g!==void 0){if(A??=qit({...e,srj:r,buses:o,side:"inward"}),!A)break;for(let T of _)f.set(T,A.fixedViaPointsByConnectionIndex.get(T)),y.set(T,A.sourceEscapePaths.get(T))}let x=t3({...e,srj:r,allBuses:o,buses:[n],targetLayer:l,startLayerByBusId:g===void 0?void 0:new Map([[n.busId,g]]),transitLayers:h,terminals:n.connections.map((T)=>({connection:T,viaPoint:f.get(T.connectionIndex),exitPoint:a.get(T.connectionIndex).exitPoint})),fixedViaPointsByConnectionIndex:f,sourceEscapePaths:y,acceptedPlans:t.filter((T)=>!_.has(T.connectionIndex)),routeFromSourcePads:g===void 0,sourceLayerTravelCost:1,sourceOriginPhysicalGridPhase:!0,tightViaChannels:!0,includeDiagonalNeighbors:!0,traceMarginExtra:0,maximumIterations:Math.min(m,g===void 0?5000000:2000000),maximumRipEvents:80,maximumLocalRepairAttempts:0,ripCost:256,shuffleSeed:1}),C=x.next(),b=0;while(!C.done)b=C.value.iterations,yield C.value,C=x.next();m-=b;let I=C.value;if(!I||I.length!==2)continue;let v=new Map(I.map((T)=>[T.connectionIndex,T])),P=t.map((T)=>v.get(T.connectionIndex)??T),M=Ey({...e,plans:P,preparedBuses:[n],sharedBoundary:n.sharedBoundary,maximumWorkUnits:1e5,allowSourcePrefixMatching:!0,allowDistributedMatching:!0,allowTransitLayerMatching:!0,allowMatchingInsideDenseBounds:!0});if(!M.plans||M.plans.some((T)=>!_.has(T.connectionIndex)&&T!==a.get(T.connectionIndex)))continue;let B=M.plans.filter((T)=>_.has(T.connectionIndex));if(B.length!==2||Math.abs(B[0].length-B[1].length)>n.maxLengthSkew+0.000001)continue;if(kd({inputSrj:r,routedSrj:{...r,traces:[...r.traces??[],...M.plans.flatMap((T)=>[T.trace,...T.planeEndpointTrace?[T.planeEndpointTrace]:[]])]},clearance:e.clearance,allowBlindAndBuriedVias:!1}).valid)return M.plans}return null}var VV=0.000001,Ltt=(e)=>Math.max(...e.map((t)=>t.length))-Math.min(...e.map((t)=>t.length));function*a3n(e){let{plans:t,bus:n,preparedBuses:o,inputSrj:r}=e,i=o.flatMap((p)=>p.connections),s=new Map(t.map((p)=>[p.connectionIndex,p]));if(i.length!==r.connections.length||s.size!==t.length||s.size!==i.length||i.some((p)=>s.get(p.connectionIndex)?.connectionName!==p.connection.name))throw Error("FanoutSolver: source-origin length repair requires every original plan");let a=n.connections.map((p)=>s.get(p.connectionIndex));if(n.termination.type!=="boundary"||n.maxLengthSkew===void 0||a.length<2||Ltt(a)<=n.maxLengthSkew+VV)return null;let c=a[0].targetLayer;if(a.some((p)=>p.targetLayer!==c))return null;let l=Math.min(...a.map((p)=>p.length)),h=new Set((a.length===2?a:a.filter((p)=>p.length>l+n.maxLengthSkew+VV).toSorted((p,m)=>m.length-p.length||p.connectionIndex-m.connectionIndex).slice(0,2)).map((p)=>p.connectionIndex));if(!h.size)return null;let d=new Map,u=new Map;for(let p of i){let m=s.get(p.connectionIndex);if(!m.via)return null;let A=m.segments.slice(0,m.sourceEscapeSegmentCount??1);if(!A.length||A.some((g)=>g.layer!==p.sourceLayer)||Gt(A[0].start,p.sourcePoint)>VV||Gt(A.at(-1).end,m.via.center)>VV||A.some((g,f)=>f>0&&Gt(A[f-1].end,g.start)>VV))return null;d.set(p.connectionIndex,m.via.center),u.set(p.connectionIndex,[p.sourcePoint,...A.map((g)=>g.end)])}let _=n.connections.filter((p)=>h.has(p.connectionIndex));for(let p of[!1,!0]){let m=yield*t3({...e,srj:r,allBuses:o,buses:[{...n,connections:_}],targetLayer:c,transitLayers:e.transitLayers??[],terminals:_.map((x)=>({connection:x,viaPoint:d.get(x.connectionIndex),exitPoint:s.get(x.connectionIndex).exitPoint})),fixedViaPointsByConnectionIndex:d,sourceEscapePaths:u,acceptedPlans:t.filter((x)=>!h.has(x.connectionIndex)),routeFromSourcePads:!0,includeDiagonalNeighbors:p,sourceLayerTravelCost:1,tightViaChannels:!0,ripCost:256,shuffleSeed:1,maximumRipEvents:40,maximumIterations:5000000,maximumLocalRepairAttempts:0});if(!m||m.length!==h.size)continue;let A=new Map(m.map((x)=>[x.connectionIndex,x])),g=t.map((x)=>A.get(x.connectionIndex)??x),f=a.map((x)=>A.get(x.connectionIndex)??x);if(Ltt(f)>=Ltt(a)-VV&&Math.max(...f.map((x)=>x.length))>=Math.max(...a.map((x)=>x.length))-VV)continue;if(kd({inputSrj:r,routedSrj:{...r,traces:[...r.traces??[],...g.flatMap((x)=>[x.trace,...x.planeEndpointTrace?[x.planeEndpointTrace]:[]])]},clearance:e.clearance,allowBlindAndBuriedVias:!1}).valid)return g}return null}function Hde(e){return typeof e==="object"&&e!==null&&"type"in e&&e.type==="subsolver"&&"solver"in e&&e.solver instanceof co}function*xFr(e){let{srj:t,buses:n,layerNames:o}=e;yield{phase:"sources",routedConnectionCount:0};let r=qit(e);if(!r)return null;let i=n.filter((C)=>C.termination.type==="boundary");if(!i.length||i.some((C)=>!C.exitEdge))return null;let s=fFr(e);if(!s)return null;let a=Jit({buses:n,exits:s.exits}),c=new Set(i.map((C)=>s.targetLayerByBusId.get(C.busId))),l=o.findLast((C)=>c.has(C)),h=o.filter((C)=>C!==l&&i.some((b)=>(b.routableEscapeLayers??b.allowedLayers??o).includes(C))),d=r.sourcePlans.filter((C)=>C.termination.type==="plane"),u=t3({...e,allBuses:n,buses:i,targetLayer:l,targetLayerByBusId:s.targetLayerByBusId,transitLayers:h,terminals:i.flatMap((C)=>C.connections.map((b)=>({connection:b,viaPoint:r.fixedViaPointsByConnectionIndex.get(b.connectionIndex),exitPoint:a.get(b.connectionIndex)}))),...r,acceptedPlans:d,routeFromSourcePads:!0,sourceLayerTravelCost:2,sourceOriginPhysicalGridPhase:!0,includeDiagonalNeighbors:!0,traceMarginExtra:0,maximumIterations:60000000,maximumRipEvents:1000,maximumLocalRepairAttempts:0,ripCost:64,shuffleSeed:1}),_=u.next();while(!_.done){if(Hde(_.value)){let C=yield _.value;_=u.next(C);continue}yield{phase:"route-layer",iterations:_.value.iterations,routedConnectionCount:d.length+_.value.routedConnectionCount},_=u.next()}if(!_.value)return null;let p=[..._.value,...d];yield{phase:"repair-lengths",routedConnectionCount:p.length};let m=GJ({...e,inputSrj:t,plans:p,preparedBuses:n});if(!m)return null;p=m;for(let C of i){if(C.maxLengthSkew===void 0)continue;let b=a3n({...e,inputSrj:t,plans:p,preparedBuses:n,bus:C}),I=b.next();while(!I.done)yield{phase:"repair-lengths",iterations:I.value.iterations,routedConnectionCount:p.length},I=b.next();if(I.value)p=I.value}yield{phase:"match-layer",routedConnectionCount:p.length};let A=p,g={...e,inputSrj:t,plans:p,preparedBuses:n,sharedBoundary:i[0].sharedBoundary,maximumWorkUnits:1000,allowSourcePrefixMatching:!0,candidatePlansAreFeasible:(C)=>(A=[...C],!0)},f=Ey(g);if(!f.plans)f=Ey({...g,maximumWorkUnits:1e5,allowDistributedMatching:!0,allowTransitLayerMatching:!0,allowMatchingInsideDenseBounds:!0});let y=new Set;while(!f.plans){let C=f.failedBus.busId,b=i.find((P)=>P.busId===C);if(!b||b.connections.length!==2||b.maxLengthSkew===void 0||y.has(b.busId))return null;y.add(b.busId);let I=yFr({...e,inputSrj:t,plans:A,preparedBuses:n,bus:b}),v=I.next();while(!v.done)yield{phase:"repair-lengths",iterations:v.value.iterations,routedConnectionCount:p.length},v=I.next();if(!v.value)return null;A=v.value,f=Ey({...g,plans:A,maximumWorkUnits:1e5,allowDistributedMatching:!0,allowTransitLayerMatching:!0,allowMatchingInsideDenseBounds:!0})}if(!f.plans)return null;let x=Git({...e,inputSrj:t,plans:f.plans,preparedBuses:n});if(!x||x.length!==t.connections.length||new Set(x.map((C)=>C.connectionIndex)).size!==x.length)return null;return kd({inputSrj:t,routedSrj:{...t,traces:[...t.traces??[],...x.flatMap((C)=>[C.trace,...C.planeEndpointTrace?[C.planeEndpointTrace]:[]])]},clearance:e.clearance,allowBlindAndBuriedVias:!1}).valid?x:null}function CFr(e){let t=e.candidateSets.flat(),n=t.length,o=new Uint8Array(n*n),r=new Set,i=new Map,s=0,a=e.candidateSets.map((x)=>x.map(()=>s++)),c=0,l=(x,C)=>{let b=Math.min(x,C)*n+Math.max(x,C),I=o[b];if(I)return I===1;let v=e.areCompatible(t[x],t[C]);return o[b]=v?1:2,v},h=a.map(()=>[]);for(let x=0;x<a.length;x++)for(let C=x+1;C<a.length;C++)if(a[x].some((b)=>a[C].some((I)=>!l(b,I))))h[x].push(C),h[C].push(x);let d=(x,C,b)=>{let I=[],v=!0;for(let P of C){if(x[P].length===0){r.add(P),v=!1;continue}for(let M of h[P])if(C.includes(M)&&(b===void 0||M===b))I.push([P,M])}for(let P=0;P<I.length;P++){let[M,B]=I[P];if(x[M].length===0||x[B].length===0)continue;let T=x[M].filter((N)=>x[B].some((D)=>l(N,D)));if(T.length===x[M].length)continue;if(i.set(M,B),x[M]=T,T.length===0){r.add(M),v=!1;continue}for(let N of h[M])if(N!==B&&C.includes(N))I.push([N,M])}return v},u=a.map((x,C)=>C),_=(x)=>{let C=[...x],b=new Set(C);for(let I=0;I<C.length;I++){let v=i.get(C[I]);if(v!==void 0&&!b.has(v))b.add(v),C.push(v)}return[...b]},p=a.map((x)=>[...x]);if(!d(p,u))return{selection:null,searchStates:c,emptyDomainIndices:[...r],conflictDomainIndices:_([...r])};let A=(()=>{let C=Math.max(1,Math.min(5000,Math.floor(e.maximumSearchStates/12)));for(let b=0;b<12;b++){let I=p.map((v,P)=>v[(b*17+P*7)%v.length]);for(let v=0;v<C;v++){let P=I.map(()=>0);for(let D=0;D<I.length;D++)for(let L of h[D]){if(L<=D||l(I[D],I[L]))continue;P[D]=P[D]+1,P[L]=P[L]+1}let M=Math.max(...P);if(M===0)return I;let B=P.map((D,L)=>({conflicts:D,index:L})).filter(({conflicts:D})=>D===M),T=B[(v+b)%B.length].index,N=p[T].map((D,L)=>({candidate:D,index:L,conflicts:h[T].filter((H)=>!l(D,I[H])).length})).toSorted((D,L)=>D.conflicts-L.conflicts||(D.index-v-b)%p[T].length-(L.index-v-b)%p[T].length);I[T]=N[0].candidate}}return null})();if(A)return{selection:A.map((x)=>t[x]),searchStates:c,emptyDomainIndices:[],conflictDomainIndices:[]};let g=(x,C,b)=>{if(!d(x,C,b))return null;let I=new Set(C.filter((B)=>x[B].length>1)),v=[];while(I.size>0){let B=[I.values().next().value];I.delete(B[0]);for(let T=0;T<B.length;T++)for(let N of h[B[T]])if(I.delete(N))B.push(N);v.push(B)}if(v.length>1){let B=x;for(let T of v){let N=g(B.slice(),T);if(!N)return null;B=N}return B}let P=-1;for(let B of C)if(x[B].length>1&&(P<0||x[B].length<x[P].length))P=B;if(P<0)return x;let M=x[P].map((B)=>{let T=h[P].filter((N)=>C.includes(N)&&x[N].length>1).map((N)=>x[N].filter((D)=>l(B,D)).length);return{candidate:B,minimumSupport:Math.min(...T),totalSupport:T.reduce((N,D)=>N+D,0)}}).toSorted((B,T)=>T.minimumSupport-B.minimumSupport||T.totalSupport-B.totalSupport);for(let{candidate:B}of M){if(c>=e.maximumSearchStates)return null;c++;let T=x.slice();T[P]=[B];let N=g(T,C,P);if(N)return N}return null},f=g(p,u),y=r.size>0||f?[...r]:[u.toSorted((x,C)=>h[C].length-h[x].length||p[x].length-p[C].length)[0]];return{selection:f?.map((x)=>t[x[0]])??null,searchStates:c,emptyDomainIndices:y,conflictDomainIndices:f?[]:_(y)}}var S9e=0.000000001;function bFr(e){let t=e.candidateBusIds.filter((p)=>!e.activeBusIds.has(p));if(t.length<2)return t;let n=t.length-1,o=e.planeBuses.find((p)=>p.busId===t[n]),r=o?.connections[0]?.sourcePoint;if(!o||!r||o.connections.length!==1||o.termination.type!=="plane")return t;let i=o.termination.layer,s=o.direction==="up"||o.direction==="down"?"x":"y",a=s==="x"?"y":"x",c=s==="x"?o.xCoordinates:o.yCoordinates,l=s==="x"?o.pitchX:o.pitchY;if(c.length===0||!Number.isFinite(l)||l<=S9e)return t;let h=(Math.min(...c)+Math.max(...c))/2,d=Math.sign(h-r[s]);if(d===0)return t;let u=new Set(t),_=e.planeBuses.filter((p)=>{let m=p.connections[0]?.sourcePoint;if(p===o||p.componentId!==o.componentId||p.termination.type!=="plane"||p.termination.layer!==i||p.direction!==o.direction||p.connections.length!==1||!m||e.activeBusIds.has(p.busId)||u.has(p.busId)||Math.abs(m[a]-r[a])>S9e)return!1;let A=(m[s]-r[s])*d;return A>S9e&&A<=l+S9e}).toSorted((p,m)=>{let A=p.connections[0].sourcePoint,g=m.connections[0].sourcePoint;return Math.abs(A[s]-r[s])-Math.abs(g[s]-r[s])||p.connections[0].connectionIndex-m.connections[0].connectionIndex})[0];if(!_)return t;return t.map((p,m)=>m===n?_.busId:p)}function IFr(e){let t=e[0];if(!t||e.some((l)=>l.componentId!==t.componentId))return;let n=e.flatMap((l)=>l.connections.map((h)=>h.sourcePoint));if(n.length===0)return;let o=n.reduce((l,h)=>({x:l.x+h.x,y:l.y+h.y}),{x:0,y:0});o.x/=n.length,o.y/=n.length;let{minX:r,maxX:i,minY:s,maxY:a}=t.componentBounds,c=[{edge:"left",distance:Math.abs(o.x-r)},{edge:"right",distance:Math.abs(i-o.x)},{edge:"bottom",distance:Math.abs(o.y-s)},{edge:"top",distance:Math.abs(a-o.y)}].toSorted((l,h)=>l.distance-h.distance);if(Math.abs(c[0].distance-c[1].distance)<=0.000000001)return;return c[0].edge}function eAn(e,t){if(t)return!1;let n=e.filter((d)=>d.termination.type==="boundary"),o=n.filter((d)=>d.connections.length===1),r=n.filter((d)=>d.connections.length===2),i=n.filter((d)=>d.connections.length>=8),s=e.filter((d)=>d.termination.type==="plane"&&d.connections.length===1).length,a=i[0]?.exitEdge;if(n.length!==9||o.length!==3||r.length!==3||i.length!==3||s<64||a===void 0||i.some((d)=>d.exitEdge!==a))return!1;let c=IFr(i);if(c===void 0)return!1;return(c==="left"||c==="right")!==(a==="left"||a==="right")}function vFr(e){let{trace:t,layerNames:n,allowBlindAndBuriedVias:o}=e;return{...t,route:t.route.map((r)=>r.route_type==="via"&&!o?{...r,layers:t5({fromLayer:r.from_layer,toLayer:r.to_layer,layerNames:n,allowBlindAndBuriedVias:o})}:{...r})}}function SFr(e){let{srj:t,layerNames:n,allowBlindAndBuriedVias:o}=e;return{...t,traces:(t.traces??[]).map((r)=>vFr({trace:r,layerNames:n,allowBlindAndBuriedVias:o}))}}function Htt(e,t,n,o){let r=n.spanLayers.map((s)=>{let a=t.indexOf(s);if(a<0)throw Error(`FanoutSolver: via for "${e.connectionName}" uses unknown layer "${s}"`);return a}),i=zY(e);return{obstacleId:o==="endpoint"?i.planeEndpointViaObstacleId:o===0?i.viaObstacleId:`${i.viaObstacleId}:${o}`,type:"rect",center:n.center,width:n.diameter,height:n.diameter,layers:n.spanLayers,zLayers:r,__zLayers:r,connectedTo:[e.connectionName,e.trace.pcb_trace_id]}}function YV(e){let{inputSrj:t,plans:n,layerNames:o}=e,r=t.connections.map((d)=>({...d,pointsToConnect:d.pointsToConnect.map((u)=>({...u}))})),i=[],s=new Set;for(let d of n){let u=r[d.connectionIndex];if(!u)throw Error(`FanoutSolver: output connection index ${d.connectionIndex} is missing`);let _=zY(d);if(u.pointsToConnect[d.sourcePointIndex]={x:d.exitPoint.x,y:d.exitPoint.y,layer:d.targetLayer,pointId:d.termination.type==="plane"?_.planeExitPointId:_.boundaryExitPointId},d.termination.type==="plane")s.add(d.connectionName);if(d.via){let p=Htt(d,o,d.via,0);if(p)i.push(p)}for(let[p,m]of(d.additionalVias??[]).entries()){let A=Htt(d,o,m,p+1);if(A)i.push(A)}if(d.planeEndpointVia){let p=Htt(d,o,d.planeEndpointVia,"endpoint");if(p)i.push(p)}}let a=n.flatMap((d)=>[d.trace,...d.planeEndpointTrace?[d.planeEndpointTrace]:[]]),c=a.flatMap((d)=>d.route.filter((u)=>("x"in u)&&("y"in u))),l=Math.max(t.defaultObstacleMargin??0,t.minTraceWidth),h=c.length===0?{...t.bounds}:{minX:Math.min(t.bounds.minX,...c.map((d)=>d.x-l)),maxX:Math.max(t.bounds.maxX,...c.map((d)=>d.x+l)),minY:Math.min(t.bounds.minY,...c.map((d)=>d.y-l)),maxY:Math.max(t.bounds.maxY,...c.map((d)=>d.y+l))};return{...t,fanoutPlaneConnectivity:n.flatMap((d)=>d.termination.type==="plane"?[{connectionName:d.connectionName,layer:d.termination.layer}]:[]),bounds:h,connections:r.filter((d)=>!s.has(d.name)),buses:t.buses?.map((d)=>({...d,connectionNames:d.connectionNames.filter((u)=>!s.has(u))})).filter((d)=>d.connectionNames.length>0),obstacles:[...t.obstacles.map((d)=>({...d,center:{...d.center},layers:[...d.layers],connectedTo:[...d.connectedTo]})),...i],traces:[...(t.traces??[]).map((d)=>({...d,route:d.route.map((u)=>({...u}))})),...a]}}var PFr=5,EFr=40,MFr=64,tAn=10,wFr=8;function c3n(e){let t=e.length,n=e.reduce((o,r)=>o+r,0);return t>=PFr&&t<=EFr&&n<=MFr||t===4&&new Set(e).size>1}function BFr({boundaryBusConnectionCounts:e,planeBusCount:t}){let n=e.length;if(n<=tAn-1&&t>=wFr)return"mixed_with_planes";if(n>=tAn&&t===0&&c3n(e))return"large_boundary_only";return null}function P9e(e){if(!e.exitEdge)throw Error(`Cannot order boundary bus ${e.busId} without an exit edge`);let t=zS(e.exitEdge);return e.connections.reduce((n,o)=>n+fY({bus:e,connection:o,boundaryDirection:t}),0)/e.connections.length}function TFr({busesInRoutingOrder:e,busLayerAssignments:t,routingMode:n}){if(n!=="large_boundary_only")return[...e];let o=e.filter((s)=>s.connections.length===1);if(new Set(o.map((s)=>s.exitEdge)).size!==1)return[...e];let r=[...e.filter((s)=>s.connections.length>=8).toSorted((s,a)=>P9e(a)-P9e(s)),...e.filter((s)=>s.connections.length>1&&s.connections.length<8)],i=[];for(let s of o){let a=t[s.busId];if(!a)throw Error(`Cannot order boundary bus ${s.busId} without a layer`);let c=i.find((l)=>l.targetLayer===a);if(!c)c={targetLayer:a,buses:[]},i.push(c);c.buses.push(s)}return[...r,...i.flatMap((s)=>s.buses.toSorted((a,c)=>P9e(c)-P9e(a)))]}var E9e=0.0000001;function _de(e,t){let n=e.sourceObstacle,o={...n,width:n.width-0.00000002,height:n.height-0.00000002},r=[],i=!1,s=!1,a=!1;for(let[c,l]of[...e.segments,...e.planeEndpointSegments??[]].entries()){if(!n.layers.includes(l.layer))continue;let h=Cl(l,n),d=l.width/2;if(i&&o.width>0&&o.height>0&&Cl(l,o)<0.0000000001)r.push({segmentIndex:c,kind:"outline"});if(s&&h<d-E9e)r.push({segmentIndex:c,kind:"copper"});if(a&&h<d+t-E9e)r.push({segmentIndex:c,kind:"clearance"});if(!CZ(l.end,n,0.000000001))i=!0;let u=r5(l.end,n);if(u>d+E9e)s=!0;if(u>=d+t-E9e)a=!0}return r}function*DFr(e,t){let n=e.sourceEscapeSegmentCount??1,o=e.segments.slice(0,n),r=o.slice(0,64).findIndex((s,a)=>!bZ(e,e.segments,t,new Set([a])));if(r<0)return;let i=o[r].width+t;for(let s=r;s>=Math.max(0,r-3);s--){let a=0;for(let c=s;c<Math.min(o.length,r+8);c++){let l=o[c];if(l.layer!==e.sourceLayer||c>s&&Gt(o[c-1].end,l.start)>0.0000001)break;if(a+=Gt(l.start,l.end),a>4*i+0.0000001)break;if(c<=r)continue;let h=o[s].start,d=l.end,u=d.x-h.x,_=d.y-h.y,p=Math.min(Math.abs(u),Math.abs(_));for(let m of[{x:h.x+Math.sign(u)*p,y:h.y+Math.sign(_)*p},{x:d.x-Math.sign(u)*p,y:d.y-Math.sign(_)*p}]){if(Gt(h,m)+Gt(m,d)>=a-0.0000001)continue;yield[o[0].start,...o.slice(0,s).map((A)=>A.end),m,d,...o.slice(c+1).map((A)=>A.end)].filter((A,g,f)=>g===0||Gt(A,f[g-1])>0.0000001)}}}}var ok=0.0000001,NFr=64;function RFr(e,t,n){let o=e,r=(o.ccwRotationDegrees??0)/90;if(e.type!=="rect"||o.shape==="circle"||Math.abs(r-Math.round(r))>ok||Math.abs(e.width-e.height)<ok)return null;let i=Math.abs(Math.round(r))%2===1,s=i?e.height:e.width,a=i?e.width:e.height,c=s>a?"x":"y",l=(c==="x"?s:a)/2;return[-1,1].map((h)=>({...t,[c]:e.center[c]+h*(l+n)}))}function QFr(e){let{inputSrj:t,preparedBuses:n,layerNames:o,traceWidth:r,clearance:i}=e,s=n[0];if(!s)return e.plans.length?null:[];let a=s.sharedBoundary;if(n.some((u)=>["minX","maxX","minY","maxY"].some((_)=>u.sharedBoundary[_]!==a[_])))return null;let c=new Map(n.map((u)=>[u.busId,u]));if(new Set(e.plans.map((u)=>u.connectionIndex)).size!==e.plans.length)return null;let l=[...e.plans],h=oP(t,!1),d=m7e({srj:t,sharedBoundary:a,clearance:i,allowBlindAndBuriedVias:!1,allowSameNetMerges:!1});for(let[u,_]of l.entries()){if(!_de(_,i).length)continue;let m=c.get(_.busId)?.connections.find((D)=>D.connectionIndex===_.connectionIndex),A=_.sourceEscapeSegmentCount??1,g=_.segments.slice(0,A),f=_.trace.route.findIndex((D)=>D.route_type==="via"),y=RFr(_.sourceObstacle,_.sourcePoint,r/2+i+0.000001);if(!m||m.sourceObstacle!==_.sourceObstacle||!_.via||f<1||!y||!g.length||g.some((D)=>D.layer!==_.sourceLayer||D.width!==r)||Gt(g[0].start,_.sourcePoint)>ok||Gt(g.at(-1).end,_.via.center)>ok||!o.includes(_.sourceLayer))return null;let x=l.filter((D,L)=>L!==u),C=new wue([..._.segments.slice(A),..._.planeEndpointSegments??[],...x.flatMap((D)=>[...D.segments,...D.planeEndpointSegments??[]]),...h.flatMap((D)=>D.segments)]),b=[..._.additionalVias??[],..._.planeEndpointVia?[_.planeEndpointVia]:[],...x.flatMap((D)=>[D.via,...D.additionalVias??[],D.planeEndpointVia].filter((L)=>!!L)),...h.flatMap((D)=>D.vias)],I=[...new Set([...Array.from({length:Math.min(g.length,NFr-1)},(D,L)=>L+1),g.length])],v=[],P=new Set;for(let D of I){let L=g[D-1].end;for(let H of[null,...y]){let V=H??_.sourcePoint,O=L.x-V.x,U=L.y-V.y,j=Math.min(Math.abs(O),Math.abs(U));for(let Y of[{x:V.x+Math.sign(O)*j,y:V.y+Math.sign(U)*j},{x:L.x-Math.sign(O)*j,y:L.y-Math.sign(U)*j}]){let X=[_.sourcePoint,...H?[H]:[],Y,L].filter((ee,se,ne)=>se===0||Gt(ee,ne[se-1])>ok),K=JSON.stringify([D,X]);if(P.has(K))continue;P.add(K);let J=X.slice(1).reduce((ee,se,ne)=>ee+Gt(X[ne],se),0)+g.slice(D).reduce((ee,se)=>ee+Gt(se.start,se.end),0);v.push({anchor:D,points:X,length:J})}}}v.sort((D,L)=>D.length-L.length||D.anchor-L.anchor);let M=(D)=>{let L=PY({points:D.map((U)=>({...U,z:o.indexOf(_.sourceLayer)})),chamfer:r/2,segmentIsClear:(U,j)=>{if([U,j].some((X)=>X.x<a.minX||X.x>a.maxX||X.y<a.minY||X.y>a.maxY))return!1;let Y={start:U,end:j,width:r,layer:_.sourceLayer};return t.obstacles.every((X)=>X===_.sourceObstacle||!X.layers.includes(Y.layer)||Cl(Y,X)>=r/2+i-ok||Mue({inputSrj:t,segment:Y,bodyObstacle:X,connectionName:_.connectionName}))&&C.querySegment(Y,i).every((X)=>u_(Y,X,i))&&b.every((X)=>!X.spanLayers.includes(Y.layer)||Hr(X.center,U,j)>=(r+X.diameter)/2+i-ok)}});if(!L)return null;let H=L.slice(1).map((U,j)=>({start:{x:L[j].x,y:L[j].y},end:{x:U.x,y:U.y},width:r,layer:_.sourceLayer})).filter((U)=>Gt(U.start,U.end)>ok),V=[...H,..._.segments.slice(A)],O=T9(_,V,!0);if(!O)return null;return O.sourceEscapeSegmentCount=H.length,O.trace={..._.trace,route:[_.trace.route[0],...H.map((U)=>({route_type:"wire",...U.end,width:U.width,layer:U.layer})),..._.trace.route.slice(f)]},_de(O,i).length||!d([...x,O])?null:O},B=(D)=>bZ(D,D.segments,i,new Set(Array.from({length:D.sourceEscapeSegmentCount??1},(L,H)=>H))),T=null,N=null;for(let D of v){let L=M([...D.points,...g.slice(D.anchor).map((H)=>H.end)]);if(!L)continue;if(!B(L)){N??=L;continue}T=L;break}if(!T&&N)for(let D of DFr(N,i)){let L=M(D);if(L&&B(L)){T=L;break}}if(!T)return null;l[u]=T}if(l.some((u)=>_de(u,i).length)||!d(l))return null;return kd({inputSrj:t,routedSrj:{...t,traces:[...t.traces??[],...l.flatMap((u)=>[u.trace,...u.planeEndpointTrace?[u.planeEndpointTrace]:[]])]},clearance:i,allowBlindAndBuriedVias:!1}).valid?l:null}var kFr=new Set(["left","right","top","bottom","top-left","top-right","bottom-left","bottom-right"]),LFr=new Set(["left","right","top","bottom"]),HFr={top_left:{direction:"up",preferredExit:"top-left",exitEdge:"top"},top_middle:{direction:"up",preferredExit:"top",exitEdge:"top"},top_right:{direction:"up",preferredExit:"top-right",exitEdge:"top"},right_top:{direction:"right",preferredExit:"top-right",exitEdge:"right"},right_middle:{direction:"right",preferredExit:"right",exitEdge:"right"},right_bottom:{direction:"right",preferredExit:"bottom-right",exitEdge:"right"},bottom_right:{direction:"down",preferredExit:"bottom-right",exitEdge:"bottom"},bottom_middle:{direction:"down",preferredExit:"bottom",exitEdge:"bottom"},bottom_left:{direction:"down",preferredExit:"bottom-left",exitEdge:"bottom"},left_bottom:{direction:"left",preferredExit:"bottom-left",exitEdge:"left"},left_middle:{direction:"left",preferredExit:"left",exitEdge:"left"},left_top:{direction:"left",preferredExit:"top-left",exitEdge:"left"},top:{direction:"up",preferredExit:"top",exitEdge:"top"},right:{direction:"right",preferredExit:"right",exitEdge:"right"},bottom:{direction:"down",preferredExit:"bottom",exitEdge:"bottom"},left:{direction:"left",preferredExit:"left",exitEdge:"left"}};function nAn(e){let t=[...e].sort((o,r)=>o-r),n=[];for(let o of t)if(n.length===0||Math.abs(n[n.length-1]-o)>0.000001)n.push(o);return n}function oAn(e){let t=Number.POSITIVE_INFINITY;for(let n=1;n<e.length;n++){let o=e[n]-e[n-1];if(o>0.000001)t=Math.min(t,o)}return t}function rAn(e,t){let n=t==="x"?"y":"x",o=Number.POSITIVE_INFINITY;for(let r=0;r<e.length;r++){let i=e[r];for(let s=r+1;s<e.length;s++){let a=e[s];if(Math.abs(i.center[n]-a.center[n])>0.000001)continue;let c=Math.abs(i.center[t]-a.center[t]);if(c>0.000001)o=Math.min(o,c)}}return o}function FFr(e){return{minX:Math.min(...e.map((t)=>t.center.x-t.width/2)),maxX:Math.max(...e.map((t)=>t.center.x+t.width/2)),minY:Math.min(...e.map((t)=>t.center.y-t.height/2)),maxY:Math.max(...e.map((t)=>t.center.y+t.height/2))}}function l3n(e,t){let n=t.componentBounds?.[e.componentId];if(!n){let r=e.pitchX*2.25,i=e.pitchY*2.25;return{minX:e.bounds.minX-r,maxX:e.bounds.maxX+r,minY:e.bounds.minY-i,maxY:e.bounds.maxY+i}}if([n.minX,n.maxX,n.minY,n.maxY].some((r)=>!Number.isFinite(r))||n.minX>=n.maxX||n.minY>=n.maxY)throw Error(`FanoutSolver: componentBounds for "${e.componentId}" must contain finite, increasing bounds`);if(n.minX>e.bounds.minX+0.000001||n.maxX<e.bounds.maxX-0.000001||n.minY>e.bounds.minY+0.000001||n.maxY<e.bounds.maxY-0.000001)throw Error(`FanoutSolver: componentBounds for "${e.componentId}" must contain every component pad`);return{...n}}function iAn(e,t){if([e.minX,e.maxX,e.minY,e.maxY].some((o)=>!Number.isFinite(o))||e.minX>=e.maxX||e.minY>=e.maxY)throw Error("FanoutSolver: sharedBoundary must contain finite, increasing bounds");for(let o of t)if(e.minX>o.bounds.minX+0.000001||e.maxX<o.bounds.maxX-0.000001||e.minY>o.bounds.minY+0.000001||e.maxY<o.bounds.maxY-0.000001)throw Error(`FanoutSolver: sharedBoundary must contain every pad of component "${o.componentId}"`);return{...e}}function zFr(e,t){if(t.sharedBoundary)return iAn(t.sharedBoundary,e);let n=e.map((i)=>l3n(i,t)),r=Math.max(...e.flatMap((i)=>[i.pitchX,i.pitchY]))*2.25;return iAn({minX:Math.min(...n.map((i)=>i.minX))-r,maxX:Math.max(...n.map((i)=>i.maxX))+r,minY:Math.min(...n.map((i)=>i.minY))-r,maxY:Math.max(...n.map((i)=>i.maxY))+r},e)}function OFr(e){let t=new Map;for(let o of e){if(!o.componentId||o.isCopperPour)continue;let r=t.get(o.componentId)??[];r.push(o),t.set(o.componentId,r)}let n=[];for(let[o,r]of t){let i=nAn(r.map((A)=>A.center.x)),s=nAn(r.map((A)=>A.center.y)),a=rAn(r,"x"),c=rAn(r,"y"),l=oAn(i),h=oAn(s),d=Math.min(...[a,c,l,h].filter(Number.isFinite)),u=Math.max(...r.flatMap((A)=>[A.width,A.height])),_=Number.isFinite(d)?d:u,p=Number.isFinite(a)?a:Number.isFinite(l)?l:_,m=Number.isFinite(c)?c:Number.isFinite(h)?h:_;n.push({componentId:o,obstacles:r,xCoordinates:i,yCoordinates:s,pitchX:p,pitchY:m,bounds:FFr(r)})}return n}function h3n(e){return"layer"in e?[e.layer]:e.layers}function d3n(e){let{point:t,connection:n,componentGrids:o}=e,r=h3n(t),i=[];for(let s of o){let a=s.obstacles.filter((c)=>c.layers.some((l)=>r.includes(l))).filter((c)=>CZ(t,c,0.00001)).sort((c,l)=>{let h=c.connectedTo.includes(n.name)||c.connectedTo.includes(t.pointId??"")||c.connectedTo.includes(t.pcb_port_id??""),d=l.connectedTo.includes(n.name)||l.connectedTo.includes(t.pointId??"")||l.connectedTo.includes(t.pcb_port_id??"");if(h!==d)return h?-1:1;return c.width*c.height-l.width*l.height});if(a[0])i.push({grid:s,obstacle:a[0]})}return i}function VFr(e){for(let n of e.pointsToConnect)if("layers"in n&&n.busId)return n.busId;return/^BUS[_:-]([^_:-]+)(?:[_:-]\d+)?$/i.exec(e.name)?.[1]??null}function gde(e,t){if(t===void 0)return;if(!kFr.has(t))throw Error(`FanoutSolver: bus "${e}" has invalid preferredExit "${t}"`);return t}function YFr(e,t){if(t===void 0)return;if(!LFr.has(t))throw Error(`FanoutSolver: bus "${e}" has invalid exitEdge "${t}"`);return t}function GFr(e,t){if(t===void 0)return;try{return V4n(t)}catch{throw Error(`FanoutSolver: bus "${e}" has invalid exitPosition "${t}"`)}}function Ftt(e){let{busId:t,exitPosition:n,fieldName:o,expected:r,actual:i,sourceName:s}=e;if(i===void 0||i===r)return;throw Error(`FanoutSolver: bus "${t}" exitPosition "${n}" conflicts with ${s} ${o} "${i}"`)}function UFr(e){let{busId:t,requestedBus:n,options:o}=e,r=n.exitPosition,i=GFr(t,r),s=gde(t,n.preferredExit),a=gde(t,o.busExitPreferences?.[t]),c=YFr(t,n.exitEdge);if(i&&r){for(let[d,u]of[[n.direction,"bus"],[o.busDirections?.[t],"busDirections"]])Ftt({busId:t,exitPosition:r,fieldName:"direction",expected:i.direction,actual:d,sourceName:u});for(let[d,u]of[[s,"bus"],[a,"busExitPreferences"]])Ftt({busId:t,exitPosition:r,fieldName:"preferredExit",expected:i.preferredExit,actual:d,sourceName:u});return Ftt({busId:t,exitPosition:r,fieldName:"exitEdge",expected:i.exitEdge,actual:c,sourceName:"bus"}),{exitPosition:r,...i.direction?{direction:i.direction}:{},...i.preferredExit?{preferredExit:i.preferredExit}:{},...i.exitEdge?{exitEdge:i.exitEdge}:{}}}let l=o.busDirections?.[t]??n.direction??o.defaultDirection,h=gde(t,a??s??o.defaultPreferredExit);return{...l?{direction:l}:{},...h?{preferredExit:h}:{},...c?{exitEdge:c}:{}}}function WFr(e,t){if(t===void 0)return;if(t.length===0)throw Error(`FanoutSolver: bus "${e}" must allow at least one layer`);for(let n of t)if(typeof n!=="string"||n.length===0)throw Error(`FanoutSolver: bus "${e}" has an invalid allowed layer`);return[...new Set(t)]}function XFr(e,t){if(t===void 0)return;if(!Number.isFinite(t)||t<0)throw Error(`FanoutSolver: bus "${e}" maxLengthSkew must be a finite non-negative number`);return t}function u3n(e){if(e===void 0)return;if(e.length===0)throw Error("FanoutSolver: availableCornersAndSides must contain at least one boundary region");let t=[],n=new Set;for(let o of e){let r=HFr[o];if(!r)throw Error(`FanoutSolver: invalid availableCornersAndSides value "${o}"`);let i=`${r.exitEdge}:${r.direction}:${r.preferredExit}`;if(n.has(i))continue;n.add(i),t.push(r)}return t}function jFr(e,t){if(t===void 0||t.type==="boundary")return{type:"boundary"};if(t.type!=="plane"||typeof t.layer!=="string"||t.layer.length===0)throw Error(`FanoutSolver: bus "${e}" has an invalid termination target`);return{type:"plane",layer:t.layer}}function KFr(e,t){let n=t.buses??e.buses,o=new Map,r=new Set,i=new Set(e.connections.map((s)=>s.name));for(let s of n??[]){if(o.has(s.busId))throw Error(`FanoutSolver: duplicate bus id "${s.busId}"`);for(let d of s.connectionNames){if(!i.has(d))throw Error(`FanoutSolver: bus "${s.busId}" references unknown connection "${d}"`);if(r.has(d))throw Error(`FanoutSolver: connection "${d}" belongs to more than one bus`);r.add(d)}let a=jFr(s.busId,s.termination),c=UFr({busId:s.busId,requestedBus:s,options:t}),l=WFr(s.busId,s.allowedLayers),h=XFr(s.busId,s.maxLengthSkew);if(a.type==="plane"&&h!==void 0)throw Error(`FanoutSolver: plane-terminated bus "${s.busId}" cannot specify maxLengthSkew`);if(a.type==="plane"&&c.preferredExit!==void 0)throw Error(`FanoutSolver: plane-terminated bus "${s.busId}" cannot also specify preferredExit`);o.set(s.busId,{...s,sourceComponentId:s.sourceComponentId??t.sourceComponentId,...c,...l===void 0?{}:{allowedLayers:l},...h===void 0?{}:{maxLengthSkew:h},termination:a})}for(let s of e.connections){if(r.has(s.name))continue;let a=VFr(s);if(a){let c=o.get(a);if(c)o.set(a,{...c,connectionNames:[...c.connectionNames,s.name]});else o.set(a,{busId:a,connectionNames:[s.name],direction:t.busDirections?.[a]??t.defaultDirection,sourceComponentId:t.sourceComponentId,preferredExit:gde(a,t.busExitPreferences?.[a]??t.defaultPreferredExit),termination:{type:"boundary"}})}else{let c=`connection:${s.name}`;o.set(c,{busId:c,connectionNames:[s.name],sourceComponentId:t.sourceComponentId,direction:t.busDirections?.[c]??t.defaultDirection,preferredExit:gde(c,t.busExitPreferences?.[c]??t.defaultPreferredExit),termination:{type:"boundary"}})}}return[...o.values()]}function $Fr(e){let{busSpec:t,connections:n,componentGrids:o}=e,r=new Map;for(let l of n){let h=new Set;for(let d of l.pointsToConnect)for(let u of d3n({point:d,connection:l,componentGrids:o}))h.add(u.grid.componentId);for(let d of h)r.set(d,(r.get(d)??0)+1)}let i=[...o].sort((l,h)=>{let d=(r.get(h.componentId)??0)-(r.get(l.componentId)??0);if(d!==0)return d;return h.obstacles.length-l.obstacles.length})[0],s=t.sourceComponentId?o.find((l)=>l.componentId===t.sourceComponentId):void 0;if(t.sourceComponentId&&!s)throw Error(`FanoutSolver: source component "${t.sourceComponentId}" for bus "${t.busId}" was not found`);let a=s??i,c=a?r.get(a.componentId)??0:0;if(!a||c!==n.length)throw Error(t.sourceComponentId?`FanoutSolver: source component "${t.sourceComponentId}" is not an endpoint on every connection in bus "${t.busId}"`:`FanoutSolver: bus "${t.busId}" does not have one component endpoint on every connection`);return a}function qFr(e,t,n,o){let i=t.pointsToConnect.filter((s,a)=>a!==n).sort((s,a)=>Gt(e,a)-Gt(e,s))[0];if(!i&&o.type==="plane")return e;if(!i)throw Error(`FanoutSolver: connection "${t.name}" has no target beyond its BGA pad`);return i}function JFr(e){let{connection:t,connectionIndex:n,sourceGrid:o,componentGrids:r,termination:i,exitTargetPoint:s}=e;for(let a=0;a<t.pointsToConnect.length;a++){let c=t.pointsToConnect[a],l=d3n({point:c,connection:t,componentGrids:r}).find((u)=>u.grid.componentId===o.componentId);if(!l)continue;let h=h3n(c).find((u)=>l.obstacle.layers.includes(u));if(!h)throw Error(`FanoutSolver: connection "${t.name}" has no source layer shared with its BGA pad`);let d=qFr(c,t,a,i);return{connection:t,connectionIndex:n,sourcePoint:c,sourcePointIndex:a,sourceLayer:h,sourceObstacle:l.obstacle,targetPoint:d,exitTargetPoint:s??{x:d.x,y:d.y},hasExplicitLayeredExitTarget:s?.layer!==void 0}}throw Error(`FanoutSolver: connection "${t.name}" does not touch component "${o.componentId}"`)}function Lot(e,t){let n=0,o=0;for(let r of t){let i=r.exitTargetPoint??r.targetPoint;n+=i.x-r.sourcePoint.x,o+=i.y-r.sourcePoint.y}if(Math.abs(n)<0.000000001&&Math.abs(o)<0.000000001)throw Error(`FanoutSolver: cannot infer an escape direction for bus "${e}"`);if(Math.abs(n)>=Math.abs(o))return n>=0?"right":"left";return o>=0?"up":"down"}function ZFr(e){switch(e){case"left":return["left"];case"right":return["right"];case"top":return["up"];case"bottom":return["down"];case"top-left":return["up","left"];case"top-right":return["up","right"];case"bottom-left":return["down","left"];case"bottom-right":return["down","right"]}}function p3n(e){return{x:e.reduce((t,n)=>t+n.sourcePoint.x,0)/e.length,y:e.reduce((t,n)=>t+n.sourcePoint.y,0)/e.length}}function l8e(e,t,n){switch(t){case"left":return e.x-n.minX;case"right":return n.maxX-e.x;case"up":return n.maxY-e.y;case"down":return e.y-n.minY}}function h8e(e,t){if(e.direction==="up"||e.direction==="down"){if(e.preferredExit.endsWith("left"))return t.minX;if(e.preferredExit.endsWith("right"))return t.maxX;return(t.minX+t.maxX)/2}if(e.preferredExit.startsWith("top"))return t.maxY;if(e.preferredExit.startsWith("bottom"))return t.minY;return(t.minY+t.maxY)/2}function sAn(e,t){return t==="up"||t==="down"?e.x:e.y}function ezr(e,t){try{return Lot(e,t)}catch{return}}function tzr(e){let{busId:t,explicitDirection:n,preferredExit:o,connections:r,sharedBoundary:i,availableRegions:s}=e,a=s.filter((u)=>(n===void 0||u.direction===n)&&(o===void 0||u.preferredExit===o));if(a.length===0)throw Error(`FanoutSolver: bus "${t}" cannot use its requested exit with availableCornersAndSides`);let c=n?void 0:ezr(t,r),l=c?a.filter((u)=>u.direction===c):[],h=l.length>0?l:a,d=p3n(r);return[...h].toSorted((u,_)=>l8e(d,u.direction,i)-l8e(d,_.direction,i)||Math.abs(sAn(d,u.direction)-h8e(u,i))-Math.abs(sAn(d,_.direction)-h8e(_,i))||u.preferredExit.localeCompare(_.preferredExit))[0]}function nzr(e){let{busId:t,exitEdge:n,preferredExit:o,availableRegions:r}=e,i=Vi(n,o);if(!r.some((a)=>a.exitEdge===n&&Vi(a.exitEdge,a.preferredExit)===i))throw Error(`FanoutSolver: bus "${t}" cannot use its requested exit with availableCornersAndSides`)}function ozr(e){let{busId:t,explicitDirection:n,preferredExit:o,connections:r,sharedBoundary:i,availableRegions:s}=e;if(s)return tzr({busId:t,explicitDirection:n,preferredExit:o,connections:r,sharedBoundary:i,availableRegions:s});if(!o)return{direction:n??Lot(t,r)};let a=ZFr(o);if(n){if(!a.includes(n))throw Error(`FanoutSolver: bus "${t}" direction "${n}" is incompatible with preferredExit "${o}"`);return{direction:n,preferredExit:o}}if(a.length===1)return{direction:a[0],preferredExit:o};let c;try{c=Lot(t,r)}catch{c=void 0}if(c&&a.includes(c))return{direction:c,preferredExit:o};let l=p3n(r);return{direction:a.toSorted((h,d)=>l8e(l,h,i)-l8e(l,d,i)||h.localeCompare(d))[0],preferredExit:o}}function rzr(e,t){let n=OFr(e.obstacles);if(n.length===0&&e.connections.length>0)throw Error("FanoutSolver: no componentId-tagged pad footprint was found");let o=new Map(e.connections.map((h,d)=>[h.name,d])),r=KFr(e,t).map((h)=>{for(let[p,m]of Object.entries(h.connectionExitTargets??{})){if(!h.connectionNames.includes(p))throw Error(`FanoutSolver: connectionExitTargets contains connection "${p}" outside bus "${h.busId}"`);if(!Number.isFinite(m.x)||!Number.isFinite(m.y))throw Error(`FanoutSolver: connectionExitTargets for connection "${p}" must contain finite x and y coordinates`)}let d=h.connectionNames.map((p)=>{let m=o.get(p);if(m===void 0)throw Error(`FanoutSolver: connection "${p}" is missing from the input`);return e.connections[m]}),u=$Fr({busSpec:h,connections:d,componentGrids:n}),_=d.map((p)=>JFr({connection:p,connectionIndex:o.get(p.name),sourceGrid:u,componentGrids:n,termination:h.termination??{type:"boundary"},exitTargetPoint:h.connectionExitTargets?.[p.name]}));return{busSpec:h,sourceGrid:u,preparedConnections:_}}),i=[...new Map(r.map(({sourceGrid:h})=>[h.componentId,h])).values()],s=zFr(i,t),a=u3n(t.availableCornersAndSides),c=[];for(let{busSpec:h,sourceGrid:d,preparedConnections:u}of r){if(h.exitEdge&&!h.preferredExit)throw Error(`FanoutSolver: bus "${h.busId}" exitEdge requires preferredExit`);if(h.exitEdge&&h.preferredExit&&!Y4n(h.preferredExit,h.exitEdge))throw Error(`FanoutSolver: bus "${h.busId}" exitEdge "${h.exitEdge}" is incompatible with preferredExit "${h.preferredExit}"`);let _=ozr({busId:h.busId,explicitDirection:h.direction??t.busDirections?.[h.busId],preferredExit:h.preferredExit,connections:u,sharedBoundary:s,availableRegions:h.termination?.type==="plane"||h.exitEdge?void 0:a});if(h.termination?.type!=="plane"&&h.exitEdge&&_.preferredExit&&a)nzr({busId:h.busId,exitEdge:h.exitEdge,preferredExit:_.preferredExit,availableRegions:a});c.push({busId:h.busId,...h.maxLengthSkew===void 0?{}:{maxLengthSkew:h.maxLengthSkew},direction:_.direction,preferredExit:_.preferredExit,...h.exitEdge?{exitEdge:h.exitEdge}:{},cornerBandConnectionCount:0,allowedLayers:h.allowedLayers,termination:h.termination??{type:"boundary"},connections:u,componentId:d.componentId,componentObstacles:d.obstacles,componentBounds:l3n(d,t),sharedBoundary:s,xCoordinates:[...d.xCoordinates],yCoordinates:[...d.yCoordinates],pitchX:d.pitchX,pitchY:d.pitchY})}let l=new Map;for(let h of c){let d=Vi(h.exitEdge,h.preferredExit);if(!h.exitEdge||!d)continue;let u=`${h.exitEdge}:${d}`;l.set(u,(l.get(u)??0)+h.connections.length)}for(let h of c){let d=Vi(h.exitEdge,h.preferredExit);if(!h.exitEdge||!d)continue;h.cornerBandConnectionCount=l.get(`${h.exitEdge}:${d}`)??h.connections.length}return c}var VQ=0.000000001,aAn=Math.PI*2;function izr(e){let{buses:t,rules:n}=e,o=t.find((T)=>T.busId===e.busId);if(!o||o.termination.type!=="boundary"||!o.exitEdge||o.connections.length<3)return null;let r=e.maximumOrderingStates??1e4,i=e.maximumCompleteAssignments??16;for(let[T,N]of Object.entries({maximumOrderingStates:r,maximumCompleteAssignments:i}))if(!Number.isSafeInteger(N)||N<1)throw Error(`FanoutSolver: ${T} must be a positive safe integer`);let s={x:(o.componentBounds.minX+o.componentBounds.maxX)/2,y:(o.componentBounds.minY+o.componentBounds.maxY)/2},a=(T)=>Math.atan2(T.y-s.y,T.x-s.x),c=(T)=>{let N=T.exitTargetPoint??T.targetPoint;return o.exitEdge==="right"?N.y:o.exitEdge==="top"?-N.x:o.exitEdge==="left"?-N.y:N.x},l=o.connections.toSorted((T,N)=>c(T)-c(N)||T.connectionIndex-N.connectionIndex),h=[];for(let T of l){if(Gt(T.sourcePoint,s)<VQ)return null;let N=a(T.sourcePoint);while(N<(h.at(-1)??N)-VQ)N+=aAn;h.push(N)}if(h.at(-1)-h[0]>=aAn-VQ)return null;let d=new Map(t.flatMap((T)=>T.connections.map((N)=>[N.connectionIndex,N]))),u=new Map(l.map((T,N)=>[T.connectionIndex,N])),_=new Map,p=new Map;for(let T of d.values())p.set(T.connectionIndex,[]);for(let T of dk(t,n)){let N=d.get(T.connectionIndex),D=`${T.point.x.toFixed(9)},${T.point.y.toFixed(9)}`;if(!_.has(D))_.set(D,_.size);let L=u.get(T.connectionIndex),H=a(N.sourcePoint),V=L===void 0?a(T.point):h[L]+Math.atan2(Math.sin(a(T.point)-H),Math.cos(a(T.point)-H));p.get(T.connectionIndex).push({...T,angle:V,siteIndex:_.get(D),sourceSegment:{start:N.sourcePoint,end:T.point,layer:N.sourceLayer,width:n.traceWidth}})}let m=[...p.entries()].map(([T,N])=>({connectionIndex:T,candidates:N}));if(m.some((T)=>T.candidates.length===0))return null;let A=l.map((T,N)=>p.get(T.connectionIndex).toSorted((D,L)=>Math.abs(D.angle-h[N])-Math.abs(L.angle-h[N])||Gt(L.point,s)-Gt(D.point,s))),g=n.viaHoleDiameter?n.viaHoleDiameter+(n.holeToHoleClearance??n.clearance):0,f=n.viaDiameter/2+n.traceWidth/2+n.clearance,y=(T,N)=>{let D=n.canShareCopper?.(T.connectionIndex,N.connectionIndex)??!1,L=D?g:Math.max(g,n.viaDiameter+n.clearance);if(Gt(T.point,N.point)<L-VQ)return!1;if(D)return!0;return Hr(T.point,N.sourceSegment.start,N.sourceSegment.end)>=f-VQ&&Hr(N.point,T.sourceSegment.start,T.sourceSegment.end)>=f-VQ&&u_(T.sourceSegment,N.sourceSegment,n.clearance)},x=new Map;for(let T of A)for(let N of T){let D=new Set;for(let L of m)for(let H of L.candidates)if(N.connectionIndex!==H.connectionIndex&&!y(N,H))D.add(H);x.set(N,D)}let C=[],b=g>VQ||!n.canShareCopper,I=()=>{if(!b)return!0;let T=new Map(C.map((H)=>[H.connectionIndex,H.siteIndex])),N=m.map((H)=>H.candidates.filter((V)=>(!T.has(V.connectionIndex)||T.get(V.connectionIndex)===V.siteIndex)&&C.every((O)=>!x.get(O).has(V))).map((V)=>V.siteIndex)).sort((H,V)=>H.length-V.length);if(N.some((H)=>H.length===0))return!1;let D=new Int32Array(_.size).fill(-1),L=(H,V)=>{for(let O of N[H]){if(V[O])continue;if(V[O]=1,D[O]===-1||L(D[O],V))return D[O]=H,!0}return!1};return N.every((H,V)=>L(V,new Uint8Array(_.size)))},v=0,P=0,M=null,B=(T)=>{if(++v>r)return!1;if(T===A.length){if(++P>i)return!1;let N=new Map(n.fixedViaPointsByConnectionIndex);for(let D of C)N.set(D.connectionIndex,D.point);return M=Yu(t,{...n,fixedViaPointsByConnectionIndex:N}),M!==null}for(let N of A[T]){if(N.angle<(C.at(-1)?.angle??-1/0)-VQ||C.some((D)=>x.get(D).has(N)))continue;if(C.push(N),I()&&B(T+1))return!0;if(C.pop(),v>r||P>=i)break}return!1};return B(0),M}var v0=0.000000001,YQ=1,Fde=globalThis.process?.env?.FANOUT_FLOW_DEBUG==="1";function szr(e){let{boundary:t,sourcePoints:n,traceWidth:o,update:r}=e,i=t.maxX-t.minX,s=t.maxY-t.minY,a=Math.max(Math.min(i,s)*0.02,0.2),c=r.grid?Math.max(1,Math.ceil(r.grid.points.length/1200)):1,l=r.grid?r.grid.points.flatMap((d,u)=>u%c===0?[{point:d,index:u}]:[]):[],h=r.grid?.processedNodeCount??r.grid?.points.length??0;return{title:`Adaptive exits: ${r.phase}`,rects:[{center:{x:(t.minX+t.maxX)/2,y:(t.minY+t.maxY)/2},width:i,height:s,fill:"rgba(0, 0, 0, 0)",stroke:"rgba(14, 165, 233, 0.9)",label:"adaptive flow grid boundary"}],points:[...l.map(({point:d,index:u})=>{let _=u<h;return{...d,color:!_?"rgba(148, 163, 184, 0.18)":r.grid.obstacleFreeNodes[u]?"rgba(34, 197, 94, 0.38)":"rgba(100, 116, 139, 0.28)",label:_?r.grid.obstacleFreeNodes[u]?"available flow node":"blocked flow node":"unprocessed flow node"}}),...n.map((d)=>({...d,color:"#f97316",label:"adaptive route source"})),...(r.candidatePoints??[]).map((d)=>({...d,color:"#06b6d4",label:"selected terminal node"}))],lines:(r.segments??[]).map((d)=>({points:[d.start,d.end],strokeColor:"rgba(250, 204, 21, 0.9)",strokeWidth:Math.max(o,a*0.4),label:"current adaptive route"})),texts:[{x:t.minX,y:t.maxY+a*2,text:`${r.phase}${r.direction?` · ${r.direction}`:""}${r.processed!==void 0&&r.total!==void 0?` · ${r.processed}/${r.total}`:""}`,color:"#0f172a",fontSize:a*1.5,anchorSide:"bottom_left"}]}}function azr(e){let t=e.connection;return e.sourceObstacle.connectedTo.find((o)=>o.startsWith("connectivity_net"))??t.netConnectionName??e.connection.name.replace(/::fanout:\d+$/,"")}function m3n(e,t){return e===t.connection.sourceObstacle||e.connectedTo.includes(t.connection.connection.name)||e.connectedTo.includes(t.netKey)}function d8e(e,t){let n=t.x-e.x,o=t.y-e.y,r=Math.abs(n),i=Math.abs(o);if(r<v0||i<v0||Math.abs(r-i)<v0)return[e,t];if(r>i)return[e,{x:e.x+Math.sign(n)*i,y:t.y},t];return[e,{x:t.x,y:e.y+Math.sign(o)*r},t]}function _3n(e){if(e.length<2)return e;let t=[e[0]];for(let n of e.slice(1)){let o=t.at(-1),r=Math.abs(n.x-o.x),i=Math.abs(n.y-o.y);if(r<v0||i<v0||Math.abs(r-i)<v0){t.push(n);continue}t.push(...d8e(n,o).reverse().slice(1))}return y7e(t)}function y7e(e){if(e.length<3)return e;let t=[e[0]];for(let n=1;n<e.length-1;n++){let o=t.at(-1),r=e[n],i=e[n+1];if(Math.sign(r.x-o.x)!==Math.sign(i.x-r.x)||Math.sign(r.y-o.y)!==Math.sign(i.y-r.y))t.push(r)}return t.push(e.at(-1)),t}function czr(e,t){if(e.length<3)return e;let n=[e[0]];for(let o=1;o<e.length-1;o++){let r=e[o-1],i=e[o],s=e[o+1],a=Gt(r,i),c=Gt(i,s);if(a<v0||c<v0)continue;let l={x:(i.x-r.x)/a,y:(i.y-r.y)/a},h={x:(s.x-i.x)/c,y:(s.y-i.y)/c};if(Math.abs(l.x*h.x+l.y*h.y)>0.000001){n.push(i);continue}let d=Math.min(t,a/2,c/2);n.push({x:i.x-l.x*d,y:i.y-l.y*d}),n.push({x:i.x+h.x*d,y:i.y+h.y*d})}return n.push(e.at(-1)),y7e(n)}function NJ(e,t){let n=[];for(let o=1;o<e.length;o++){if(Gt(e[o-1],e[o])<v0)continue;n.push({start:e[o-1],end:e[o],width:t,layer:"top"})}return n}var lzr=class{edges;levels;nextEdges;constructor(e){this.edges=Array.from({length:e},()=>[]),this.levels=new Int32Array(e),this.nextEdges=new Int32Array(e)}addEdge(e,t,n,o={}){let r={to:t,reverseIndex:this.edges[t].length,capacity:n,initialCapacity:n,...o},i={to:e,reverseIndex:this.edges[e].length,capacity:0,initialCapacity:0};this.edges[e].push(r),this.edges[t].push(i)}buildLevels(e,t){this.levels.fill(-1);let n=new Int32Array(this.edges.length),o=0,r=0;n[r++]=e,this.levels[e]=0;while(o<r){let i=n[o++];for(let s of this.edges[i]){if(s.capacity<=0||this.levels[s.to]>=0)continue;this.levels[s.to]=this.levels[i]+1,n[r++]=s.to}}return this.levels[t]>=0}sendFlow(e,t){if(e===t)return 1;for(let n=this.nextEdges[e];n<this.edges[e].length;n++,this.nextEdges[e]=n){let o=this.edges[e][n];if(o.capacity<=0||this.levels[o.to]!==this.levels[e]+1)continue;let r=this.sendFlow(o.to,t);if(r===0)continue;return o.capacity-=r,this.edges[o.to][o.reverseIndex].capacity+=r,r}return 0}*maximumFlowSteps(e,t,n){let o=0;while(o<n&&this.buildLevels(e,t)){this.nextEdges.fill(0);let r=0;while(o<n){let i=this.sendFlow(e,t);if(i===0)break;if(o+=i,r+=i,r>=4&&o<n)r=0,yield o}}return o}};function*hzr(e){let{boundary:t,obstacles:n,traceWidth:o,clearance:r,reportProgress:i}=e,s=o+r,a=Math.round((t.maxX-t.minX)/s)+1,c=Math.round((t.maxY-t.minY)/s)+1,l=a*c,h=Array.from({length:l},(A,g)=>({x:t.minX+g%a*s,y:t.minY+Math.floor(g/a)*s})),d=o/2+r,u=new Map;for(let A=0;A<n.length;A++){let g=n[A],f=Math.floor((g.center.x-g.width/2-d)/YQ),y=Math.floor((g.center.x+g.width/2+d)/YQ),x=Math.floor((g.center.y-g.height/2-d)/YQ),C=Math.floor((g.center.y+g.height/2+d)/YQ);for(let b=f;b<=y;b++)for(let I=x;I<=C;I++){let v=`${b}:${I}`,P=u.get(v)??[];P.push(A),u.set(v,P)}if((A+1)%128===0)i({phase:"index-obstacles",processed:A+1,total:n.length}),yield}let _=(A,g=A)=>{let f=Math.floor(Math.min(A.x,g.x)/YQ),y=Math.floor(Math.max(A.x,g.x)/YQ),x=Math.floor(Math.min(A.y,g.y)/YQ),C=Math.floor(Math.max(A.y,g.y)/YQ),b=new Set;for(let I=f;I<=y;I++)for(let v=x;v<=C;v++)for(let P of u.get(`${I}:${v}`)??[])b.add(P);return[...b].map((I)=>n[I])},p=new Uint8Array(l);for(let A=0;A<l;A++){let g=h[A];if(_(g).every((f)=>r5(g,f)>=d-v0))p[A]=1;if((A+1)%2048===0)i({phase:"classify-flow-grid",processed:A+1,total:l,grid:{points:h,obstacleFreeNodes:p,processedNodeCount:A+1}}),yield}let m=Array.from({length:l},()=>[]);for(let A=0;A<l;A++){if(!p[A])continue;let g=A%a,f=Math.floor(A/a);for(let[y,x]of[[1,0],[0,1]]){let C=g+y,b=f+x;if(C>=a||b>=c)continue;let I=b*a+C;if(!p[I])continue;let v={start:h[A],end:h[I],width:o,layer:"top"};if(_(v.start,v.end).some((P)=>Cl(v,P)<d-v0))continue;m[A].push(I),m[I].push(A)}if((A+1)%2048===0)i({phase:"connect-flow-grid",processed:A+1,total:l,grid:{points:h,obstacleFreeNodes:p,processedNodeCount:l}}),yield}return{boundary:t,step:s,columnCount:a,rowCount:c,nodeCount:l,points:h,obstacleFreeNodes:p,neighbors:m}}function*dzr(e){let{direction:t,availableDirections:n,items:o,grid:r,obstacles:i,traceWidth:s,clearance:a,occupiedNodes:c,acceptedSegments:l,connectorSelectionOffset:h=0,reportProgress:d}=e;if(o.length===0)return{routes:[],usedNodes:[],unmatchedItems:[]};let{boundary:u,step:_,columnCount:p,rowCount:m,nodeCount:A}=r,g=(se)=>r.points[se],f=s/2+a,y=s+a,x=new Uint8Array(A);for(let se=0;se<A;se++)if(!c[se]&&r.obstacleFreeNodes[se])x[se]=1;let C=(se,ne)=>{let re=NJ(se,s);return re.every((Z)=>i.every((te)=>m3n(te,ne)||Cl(Z,te)>=f-v0))&&re.every((Z)=>l.every((te)=>Hh(Z.start,Z.end,te.start,te.end)>=y-v0))},b=new Map;for(let se of o){let ne=`${se.source.x.toFixed(6)}:${se.source.y.toFixed(6)}:${se.netKey}`,re=b.get(ne)??[];re.push(se),b.set(ne,re)}let I=Array.from({length:3721},(se,ne)=>{let re=ne%61-30,Z=Math.floor(ne/61)-30;return{x:re,y:Z,distanceSquared:re*re+Z*Z}}).sort((se,ne)=>se.distanceSquared-ne.distanceSquared),v=[],P=0;for(let se of b.values()){let ne=se[0],re=Math.hypot(ne.connection.sourceObstacle.width/2,ne.connection.sourceObstacle.height/2)+a+_*2,Z=Math.round((ne.source.x-u.minX)/_),te=Math.round((ne.source.y-u.minY)/_),ie=[],ce=new Set;for(let ue of I){let de=Z+ue.x,me=te+ue.y;if(de<0||de>=p||me<0||me>=m)continue;let ge=me*p+de;if(!x[ge]||ce.has(ge))continue;if(Gt(ne.source,g(ge))>re)continue;let xe=d8e(ne.source,g(ge));if(!C(xe,ne))continue;if(ce.add(ge),ie.push({node:ge,connectorPoints:xe}),ie.length>=12)break}if(ie.length===0)return null;if(v.push({item:ne,equivalentItems:se,candidates:ie}),P++,P%8===0)d({phase:"discover-terminal-connectors",direction:t,processed:P,total:b.size,grid:{points:r.points,obstacleFreeNodes:x,processedNodeCount:A},candidatePoints:v.flatMap((ue)=>ue.candidates.map((de)=>g(de.node))),segments:l}),yield}let M=[],B=0;for(let se of[...v].sort((ne,re)=>ne.candidates.length-re.candidates.length)){let ne=se.candidates.length===0?0:h%se.candidates.length,Z=[...se.candidates.slice(ne),...se.candidates.slice(0,ne)].find((te)=>{let ie=NJ(te.connectorPoints,s);return M.every((ce)=>ce.netKey===se.item.netKey||ie.every((ue)=>ce.segments.every((de)=>Hh(ue.start,ue.end,de.start,de.end)>=y-v0)))});if(!Z)return null;if(se.candidates=[Z],M.push({netKey:se.item.netKey,segments:NJ(Z.connectorPoints,s)}),B++,B%8===0)d({phase:"select-terminal-connectors",direction:t,processed:B,total:v.length,grid:{points:r.points,obstacleFreeNodes:x,processedNodeCount:A},candidatePoints:v.flatMap((te)=>te.candidates.map((ie)=>g(ie.node))),segments:[...l,...M.flatMap((te)=>te.segments)]}),yield}let T=new Set(v.map((se)=>se.candidates[0].node));for(let se of M)for(let ne of se.segments){let re=Math.max(0,Math.floor((Math.min(ne.start.x,ne.end.x)-y-u.minX)/_)),Z=Math.min(p-1,Math.ceil((Math.max(ne.start.x,ne.end.x)+y-u.minX)/_)),te=Math.max(0,Math.floor((Math.min(ne.start.y,ne.end.y)-y-u.minY)/_)),ie=Math.min(m-1,Math.ceil((Math.max(ne.start.y,ne.end.y)+y-u.minY)/_));for(let ce=te;ce<=ie;ce++)for(let ue=re;ue<=Z;ue++){let de=ce*p+ue;if(!x[de]||T.has(de))continue;let me=g(de);if(Hh(ne.start,ne.end,me,me)<y-v0)x[de]=0}}let N=0,D=1,L=D+v.length,H=L+A,V=H+A,O=new lzr(V+1);for(let se=0;se<v.length;se++){let ne=D+se;O.addEdge(N,ne,1);for(let re of v[se].candidates)O.addEdge(ne,L+re.node,1,{gridNode:re.node})}for(let se=0;se<A;se++){if(!x[se])continue;O.addEdge(L+se,H+se,1);let ne=se%p,re=Math.floor(se/p);for(let te of r.neighbors[se]){if(!x[te])continue;O.addEdge(H+se,L+te,1,{gridNode:te})}if(t==="any"&&((!n||n.has("left"))&&ne===0||(!n||n.has("right"))&&ne===p-1||(!n||n.has("down"))&&re===0||(!n||n.has("up"))&&re===m-1)||t==="left"&&ne===0||t==="right"&&ne===p-1||t==="down"&&re===0||t==="up"&&re===m-1)O.addEdge(H+se,V,1,{isSink:!0});if((se+1)%2048===0)d({phase:"build-flow-network",direction:t,processed:se+1,total:A,grid:{points:r.points,obstacleFreeNodes:x,processedNodeCount:A},candidatePoints:v.map((te)=>g(te.candidates[0].node)),segments:[...l,...M.flatMap((te)=>te.segments)]}),yield}let U=O.maximumFlowSteps(N,V,v.length),j=U.next();while(!j.done)d({phase:"augment-terminal-flow",direction:t,processed:j.value,total:v.length,grid:{points:r.points,obstacleFreeNodes:x,processedNodeCount:A},candidatePoints:v.map((se)=>g(se.candidates[0].node)),segments:[...l,...M.flatMap((se)=>se.segments)]}),yield,j=U.next();let Y=j.value,X=(se)=>{let ne=D+se;return O.edges[N].some((re)=>re.to===ne&&re.initialCapacity===1&&re.capacity===0)};if(Y!==v.length){if(Fde){let se=v.flatMap((ne,re)=>X(re)?[]:[ne.item.connection.connection.name]);console.error("single-layer flow group failed",{direction:t,achievedFlow:Y,requiredFlow:v.length,unmatchedConnections:se})}}let K=[],J=[],ee=[];for(let se=0;se<v.length;se++){let ne=v[se];if(!X(se)){ee.push(...ne.equivalentItems);continue}let re=D+se,Z=O.edges[re].find((xe)=>xe.initialCapacity===1&&xe.capacity===0&&xe.gridNode!==void 0);if(Z?.gridNode===void 0)return null;let te=ne.candidates.find((xe)=>xe.node===Z.gridNode);if(!te)return null;let ie=[g(te.node)],ce=te.node,ue=[ce];for(let xe=0;xe<=A;xe++){let Ee=H+ce,Re=O.edges[Ee].find((Me)=>Me.initialCapacity===1&&Me.capacity===0&&(Me.gridNode!==void 0||Me.isSink));if(!Re)return null;if(Re.isSink)break;if(Re.gridNode===void 0)return null;ce=Re.gridNode,ue.push(ce),ie.push(g(ce))}J.push(...ue);let de=y7e([...te.connectorPoints,...ie.slice(1)]),me=_3n(czr(de,_/2)),ge=NJ(me,s);for(let xe of ne.equivalentItems)K.push({item:xe,points:me,segments:ge});if((se+1)%8===0)d({phase:"extract-flow-routes",direction:t,processed:se+1,total:v.length,grid:{points:r.points,obstacleFreeNodes:x,processedNodeCount:A},segments:[...l,...K.flatMap((xe)=>xe.segments)]}),yield}return{routes:K,usedNodes:J,unmatchedItems:ee}}function cAn(e,t){let{item:n,points:o,segments:r}=e,i=o.map((a,c)=>({route_type:"wire",x:a.x,y:a.y,width:t,layer:"top",...c===0&&n.connection.sourcePoint.pcb_port_id?{start_pcb_port_id:n.connection.sourcePoint.pcb_port_id}:{}})),s=zY({connectionName:n.connection.connection.name,sourcePointIndex:n.connection.sourcePointIndex});return{busId:n.bus.busId,connectionName:n.connection.connection.name,connectionIndex:n.connection.connectionIndex,sourcePointIndex:n.connection.sourcePointIndex,sourcePoint:n.connection.sourcePoint,sourceObstacle:n.connection.sourceObstacle,sourceLayer:n.connection.sourceLayer,targetPoint:n.connection.targetPoint,targetLayer:"top",termination:n.bus.termination,direction:n.bus.direction,...n.bus.exitEdge?{exitEdge:n.bus.exitEdge}:{},exitPoint:o.at(-1),trace:{type:"pcb_trace",pcb_trace_id:s.traceId,connection_name:n.connection.connection.name,connectsTo:[...n.connection.sourcePoint.pointId?[n.connection.sourcePoint.pointId]:[],...n.connection.sourcePoint.pcb_port_id?[n.connection.sourcePoint.pcb_port_id]:[],s.boundaryExitPointId],route:i},segments:r,length:r.reduce((a,c)=>a+Gt(c.start,c.end),0)}}function uzr(e,t){let n=d8e(e,t),o=d8e(t,e).reverse();return n.length===o.length&&n.every((r,i)=>Gt(r,o[i])<v0)?[n]:[n,o]}function lAn(e){let{plans:t,items:n,obstacles:o,traceWidth:r,clearance:i}=e,s=new Map(n.map((u)=>[u.connection.connection.name,u.netKey])),a=new Map,c=new Map;for(let u of t){let _=s.get(u.connectionName),p=a.get(_)??[],m=c.get(_)??new Set;for(let A of u.segments){let f=[A.start,A.end].map((y)=>`${y.x.toFixed(6)}:${y.y.toFixed(6)}`).sort().join(":");if(m.has(f))continue;m.add(f),p.push(A)}a.set(_,p),c.set(_,m)}let l=r/2+i;for(let[u,_]of a)for(let p of _)for(let m of o){if(m.connectedTo.includes(u)||Cl(p,m)>=l-v0)continue;if(Fde)console.error("single-layer route violates obstacle clearance",{netKey:u,segment:p,obstacleId:m.obstacleId,distance:Cl(p,m),requiredObstacleDistance:l});return!1}let h=r+i,d=[...a];for(let u=0;u<d.length;u++)for(let _=u+1;_<d.length;_++)for(let p of d[u][1])for(let m of d[_][1])if(Hh(p.start,p.end,m.start,m.end)<h-v0){if(Fde)console.error("single-layer routes violate copper clearance",{firstNetKey:d[u][0],secondNetKey:d[_][0],first:p,second:m,distance:Hh(p.start,p.end,m.start,m.end),requiredRouteDistance:h});return!1}return!0}function pzr(e,t){if(Math.abs(e.x-t.minX)<v0)return"left";if(Math.abs(e.x-t.maxX)<v0)return"right";if(Math.abs(e.y-t.minY)<v0)return"down";if(Math.abs(e.y-t.maxY)<v0)return"up";return null}function*mzr(e){let{items:t,grid:n,obstacles:o,traceWidth:r,clearance:i,availableBoundaryRegions:s,onPartialRoutes:a,reportProgress:c}=e,l=s?new Set(s.map((g)=>g.direction)):void 0,h=new Set(t.filter((g)=>g.connection.sourceObstacle.width>2&&g.connection.sourceObstacle.height>2)),d=null;for(let g=0;g<4;g++){let f=t.filter((b)=>!h.has(b)),y=null;for(let b=0;b<4;b++){let I=yield*dzr({direction:"any",availableDirections:l,items:f,grid:n,obstacles:o,traceWidth:r,clearance:i,occupiedNodes:new Uint8Array(n.nodeCount),acceptedSegments:[],connectorSelectionOffset:b,reportProgress:c});if(!I)continue;if(a&&I.routes.length>0&&I.routes.length<t.length){let v=I.routes.map((P)=>cAn(P,r));if(lAn({plans:v,items:t,obstacles:o,traceWidth:r,clearance:i}))a(v)}if(!y||I.routes.length>y.routes.length)y=I;if(I.routes.length===f.length)break}if(!y)return null;if(y.routes.length===f.length){d=y;break}let x=new Map;for(let b of f)x.set(b.netKey,(x.get(b.netKey)??0)+1);let C=!1;for(let b of y.unmatchedItems){if((x.get(b.netKey)??0)<2)continue;h.add(b),C=!0}if(!C)return null}if(!d)return null;let u=[...d.routes],_=r/2+i,p=r+i;for(let g of h){let f=u.filter((x)=>x.item.netKey===g.netKey).flatMap((x)=>x.points.map((C,b)=>({route:x,point:C,pointIndex:b}))).sort((x,C)=>Number(C.route.item.bus.componentId===g.bus.componentId)-Number(x.route.item.bus.componentId===g.bus.componentId)||Gt(g.source,x.point)-Gt(g.source,C.point)),y=null;for(let x of f){for(let C of uzr(g.source,x.point)){let b=NJ(C,r),I=b.every((M)=>o.every((B)=>m3n(B,g)||Cl(M,B)>=_-v0)),v=b.every((M)=>u.every((B)=>B.item.netKey===g.netKey||B.segments.every((T)=>Hh(M.start,M.end,T.start,T.end)>=p-v0)));if(!I||!v)continue;let P=_3n(y7e([...C,...x.route.points.slice(x.pointIndex+1)]));y={item:g,points:P,segments:NJ(P,r)};break}if(y)break}if(!y)return null;u.push(y),c({phase:"merge-same-net-routes",processed:u.length,total:t.length,grid:{points:n.points,obstacleFreeNodes:n.obstacleFreeNodes,processedNodeCount:n.nodeCount},segments:u.flatMap((x)=>x.segments)}),yield}let m=u.map((g)=>cAn(g,r));if(!lAn({plans:m,items:t,obstacles:o,traceWidth:r,clearance:i})){if(Fde)console.error("single-layer adaptive exits failed exact clearance");return null}for(let g of m){let f=pzr(g.exitPoint,n.boundary);if(!f||l&&!l.has(f))return null;let y=t.find((b)=>b.connection.connection.name===g.connectionName);y.bus.direction=f;let x=s?.filter((b)=>b.direction===f),C=f==="up"||f==="down"?g.exitPoint.x:g.exitPoint.y;y.bus.preferredExit=x?.toSorted((b,I)=>Math.abs(C-h8e(b,n.boundary))-Math.abs(C-h8e(I,n.boundary)))[0]?.preferredExit??(f==="up"?"top":f==="down"?"bottom":f),g.direction=f}let A=new Map(m.map((g)=>[g.connectionName,g]));return t.map((g)=>A.get(g.connection.connection.name))}function*MY(e){let{srj:t,buses:n,traceWidth:o,clearance:r,availableBoundaryRegions:i,onPartialRoutes:s,onProgress:a}=e;if(n.some((m)=>m.connections.length!==1))return null;let c=n.flatMap((m)=>m.connections.map((A)=>({bus:m,connection:A,source:{x:A.sourcePoint.x,y:A.sourcePoint.y},netKey:azr(A)}))),l=t.obstacles.filter((m)=>m.layers.includes("top")),h=n[0]?.sharedBoundary;if(!h)return[];let d=c.map((m)=>m.source),u=(m)=>{a?.(szr({boundary:h,sourcePoints:d,traceWidth:o,update:m}),{adaptivePhase:m.phase,...m.direction?{adaptiveDirection:m.direction}:{},...m.processed!==void 0?{adaptiveWorkUnit:m.processed}:{},...m.total!==void 0?{adaptiveWorkUnitCount:m.total}:{}})};u({phase:"prepare-flow-grid",processed:0,total:l.length});let _=yield*hzr({boundary:h,obstacles:l,traceWidth:o,clearance:r,reportProgress:u});if(Fde)console.error("single-layer adaptive-exit grid ready",{nodeCount:_.nodeCount});let p=yield*mzr({items:c,grid:_,obstacles:l,traceWidth:o,clearance:r,availableBoundaryRegions:i,onPartialRoutes:s,reportProgress:u});if(p)return p;return null}var yy=0.000000001;function _zr(e,t){let n=[e[0]];for(let o=1;o<e.length-1;o++){let r=e[o-1],i=e[o],s=e[o+1],a=i.x-r.x,c=i.y-r.y,l=s.x-i.x,h=s.y-i.y,d=Math.hypot(a,c),u=Math.hypot(l,h);if(d<yy||u<yy)continue;if(Math.abs(a*l+c*h)<yy){let _=Math.min(t,d/2,u/2);n.push({x:i.x-a/d*_,y:i.y-c/d*_},{x:i.x+l/u*_,y:i.y+h/u*_})}else n.push(i)}return n.push(e.at(-1)),n.filter((o,r)=>r===0||Gt(o,n[r-1])>yy)}function gzr(e,t,n){let o=e.toSorted((a,c)=>Math.atan2(a.exitPoint.y-n.y,a.exitPoint.x-n.x)-Math.atan2(c.exitPoint.y-n.y,c.exitPoint.x-n.x)),r=(a,c)=>{for(let l=0;l<Math.min(a.length,c.length);l++){let h=t.get(a[l].connectionIndex)-t.get(c[l].connectionIndex);if(h)return h<0}return!1},i=(a,c)=>a.length>c.length||a.length===c.length&&r(a,c),s=[];for(let a=o.length-1;a>=0;a--){let c=[];for(let l=a+1;l<o.length;l++)if(t.get(o[l].connectionIndex)>t.get(o[a].connectionIndex)&&i(s[l],c))c=s[l];s[a]=[o[a],...c]}return s.reduce((a,c)=>i(c,a)?c:a,[])}function*Azr(e){let{bus:t,srj:n,traceWidth:o,clearance:r,viaDiameter:i}=e;if(t.termination.type!=="boundary"||t.exitEdge!=="right"||t.connections.length<6||t.connections.some((ee)=>ee.sourceLayer!=="top")||!(t.allowedLayers??e.layerNames).includes(e.targetLayer)||e.targetLayer==="top")return null;let s=t.componentObstacles.filter((ee)=>ee.layers.includes("top"));if(!s.length)return null;let a={minX:Math.min(...s.map((ee)=>ee.center.x-ee.width/2)),maxX:Math.max(...s.map((ee)=>ee.center.x+ee.width/2)),minY:Math.min(...s.map((ee)=>ee.center.y-ee.height/2)),maxY:Math.max(...s.map((ee)=>ee.center.y+ee.height/2))},c={x:(a.minX+a.maxX)/2,y:(a.minY+a.maxY)/2},l=o+r,h=Math.max(t.pitchX,t.pitchY);if(!Number.isFinite(h)||h<=0)return null;let d=Math.ceil(((a.maxX-a.minX)/2+h+l)/l)*l,u=Math.ceil(((a.maxY-a.minY)/2+h+l)/l)*l,_={minX:c.x-d,maxX:c.x+d,minY:c.y-u,maxY:c.y+u};if(_.minX<=t.sharedBoundary.minX||_.maxX>=t.sharedBoundary.maxX||_.minY<=t.sharedBoundary.minY||_.maxY>=t.sharedBoundary.maxY)return null;let p=t.connections.map((ee,se)=>({...t,busId:`${t.busId}:source-perimeter:${se}`,sharedBoundary:_,preferredExit:void 0,exitEdge:void 0,connections:[{...ee,exitTargetPoint:void 0,hasExplicitLayeredExitTarget:!1,hasExplicitExitTarget:!1}]})),m=yield*MY({srj:n,buses:p,traceWidth:o,clearance:r});if(!m||m.length!==t.connections.length)return null;let A=(ee)=>e.targetPointsByConnectionIndex?.get(ee.connectionIndex)??{x:t.sharedBoundary.maxX,y:(ee.exitTargetPoint??ee.targetPoint).y},g=t.connections.toSorted((ee,se)=>A(ee).y-A(se).y||ee.connectionIndex-se.connectionIndex),f=new Map(g.map((ee,se)=>[ee.connectionIndex,se])),y=gzr(m,f,c);if(y.length<3||y.length>=t.connections.length||y.some((ee)=>Math.abs(ee.exitPoint.y-_.maxY)>yy&&(Math.abs(ee.exitPoint.x-_.minX)>yy||ee.exitPoint.y<c.y)))return null;let x=new Map(e.buses.flatMap((ee)=>ee.connections.map((se)=>[se.connectionIndex,{bus:ee,connection:se}]))),C=t.sharedBoundary.maxX-Math.max(h/2,i/2+r),b=i/2+o/2+r,v=C-b-0.00001-(y.length-1)*l,M=t.sharedBoundary.maxY-l-(y.length-1)*l;if(v<=a.maxX+b||M<=_.maxY+l)return null;let B=(ee,se)=>{let ne=x.get(ee.connectionIndex).bus,re=ne.busId===t.busId?e.targetLayer:ne.termination.type==="plane"?ne.termination.layer:e.targetLayerByBusId?.get(ne.busId)??(ne.allowedLayers??e.layerNames).find((Z)=>Z!==ee.sourceLayer);if(!re)throw Error("FanoutSolver: missing target layer for peripheral via assignment");return{center:se,diameter:i,holeDiameter:e.viaHoleDiameter,fromLayer:ee.sourceLayer,toLayer:re,spanLayers:t5({fromLayer:ee.sourceLayer,toLayer:re,layerNames:e.layerNames,allowBlindAndBuriedVias:e.allowBlindAndBuriedVias??!1})}},T=(ee,se)=>({connectionIndex:ee.connectionIndex,connectionName:ee.connection.name,segments:se.slice(1).map((ne,re)=>({start:se[re],end:ne,width:o,layer:ee.sourceLayer})),via:B(ee,se.at(-1))}),N=y.map((ee,se)=>{let ne=x.get(ee.connectionIndex).connection,re=A(ne),Z=M+se*l,te=v+se*l;return T(ne,_zr([ee.segments[0].start,...ee.segments.map((ie)=>ie.end),{x:ee.exitPoint.x,y:Z},{x:te,y:Z},{x:te,y:re.y},{x:C,y:re.y}],o))}),D=new Set(N.map((ee)=>ee.connectionIndex)),L=(ee,se)=>{let ne=x.get(ee.connectionIndex).connection;if(ee.segments.some((re)=>[re.start,re.end].some((Z)=>Z.x<t.sharedBoundary.minX-yy||Z.x>t.sharedBoundary.maxX+yy||Z.y<t.sharedBoundary.minY-yy||Z.y>t.sharedBoundary.maxY+yy)))return!1;for(let re of n.obstacles){if(re.layers.some((Z)=>ee.via.spanLayers.includes(Z))&&r5(ee.via.center,re)<i/2+r-yy)return!1;if(re!==ne.sourceObstacle&&ee.segments.some((Z)=>re.layers.includes(Z.layer)&&Cl(Z,re)<o/2+r-yy))return!1}for(let re of se){if(ee.connectionIndex===re.connectionIndex)continue;if(Gt(ee.via.center,re.via.center)<i+r-yy)return!1;if(ee.segments.some((Z)=>Hr(re.via.center,Z.start,Z.end)<b-yy)||re.segments.some((Z)=>Hr(ee.via.center,Z.start,Z.end)<b-yy))return!1;if(ee.segments.some((Z)=>re.segments.some((te)=>!u_(Z,te,r))))return!1}return!0};if(N.some((ee)=>!L(ee,N)))return null;let H=()=>{let ee=new Set(N.map((se)=>se.connectionIndex));return e.buses.map((se)=>({...se,connections:se.connections.filter((ne)=>!ee.has(ne.connectionIndex))})).filter((se)=>se.connections.length)},V=()=>({viaDiameter:i,viaHoleDiameter:e.viaHoleDiameter,traceWidth:o,clearance:r,additionalObstacles:n.obstacles,maximumSearchStates:300000,blockingSegments:N.flatMap((ee)=>ee.segments.map((se)=>({connectionIndex:ee.connectionIndex,segment:se}))),blockingVias:N.map((ee)=>({connectionIndex:ee.connectionIndex,...ee.via})),preferredViaPointsByConnectionIndex:e.initialViaPoints}),O=H(),U=new Set(dk(O,V()).map((ee)=>ee.connectionIndex));for(let ee of O)for(let se of ee.connections){if(U.has(se.connectionIndex))continue;if(ee.termination.type!=="plane")return null;let{sourcePoint:ne,sourceObstacle:re}=se,Z=[{x:0,y:1,gap:a.maxY-ne.y},{x:-1,y:0,gap:ne.x-a.minX},{x:0,y:-1,gap:ne.y-a.minY},{x:1,y:0,gap:a.maxX-ne.x}].sort((ie,ce)=>ie.gap-ce.gap),te=null;for(let ie of Z){for(let ce=0;ce<8;ce++){let ue=(ie.x?re.width:re.height)/2+i/2+r+0.00001+ce*o,de=T(se,[ne,{x:ne.x+ie.x*ue,y:ne.y+ie.y*ue}]);if(L(de,N)){te=de;break}}if(te)break}if(!te)return null;N.push(te)}O=H();let j=V(),Y=Yu(O,j);if(!Y)return null;yield;let X=izr({buses:O,busId:t.busId,rules:{...j,preferredViaPointsByConnectionIndex:Y}});if(!X)return null;let K=[...N,...O.flatMap((ee)=>ee.connections.map((se)=>T(se,[se.sourcePoint,X.get(se.connectionIndex)])))];if(K.some((ee)=>!L(ee,K)))return null;let J=new Map(K.map((ee)=>[ee.connectionIndex,ee.via.center]));return{sourceEscapes:K,viaPointsByConnectionIndex:J,remoteConnectionIndices:D,localBus:O.find((ee)=>ee.busId===t.busId),sourceBoundary:_}}function*fzr(e){let{srj:t,bus:n,targetLayer:o,sourceBoundary:r,sourceEscapes:i,remoteConnectionIndices:s,traceWidth:a,clearance:c}=e;if(n.exitEdge!=="right"||n.termination.type!=="boundary")return null;let l=a+c,h=Math.min(n.pitchX,n.pitchY),d=new Map(i.map((D)=>[D.connectionIndex,D])),u=n.connections.map((D)=>{let L=d.get(D.connectionIndex);if(!L)throw Error(`FanoutSolver: missing source escape for ${D.connection.name}`);let H=D.exitTargetPoint??D.targetPoint;return{connection:D,viaPoint:L.via.center,exitPoint:{x:n.sharedBoundary.maxX,y:H.y}}}).sort((D,L)=>D.exitPoint.y-L.exitPoint.y),_=u.filter((D)=>!s.has(D.connection.connectionIndex));if(_.length<2||_.length===u.length)return null;let p=Math.min(...n.componentObstacles.map((D)=>D.center.x-D.width/2)),m=Math.max(..._.map((D)=>D.viaPoint.x))-a/2,A=p+e.viaDiameter/2;if(m-A<(_.length-1)*l)return null;let g=r.maxY,f={minX:p-h,maxX:Math.max(..._.map((D)=>D.viaPoint.x))+2*h,minY:Math.min(..._.map((D)=>D.viaPoint.y))-3*h,maxY:g},y=new Set(_.map((D)=>D.connection.connectionIndex)),x=_.map((D,L)=>({...D,exitPoint:{x:m+(A-m)*L/(_.length-1),y:g}})),C={...n,exitEdge:"top",direction:"up",preferredExit:void 0,sharedBoundary:f,connections:_.map((D)=>D.connection)},b=new Map(i.map((D)=>[D.connectionIndex,[D.segments[0].start,...D.segments.map((L)=>L.end)]])),I;for(let D of[-1,0,1]){let L=yield*G2({...e,bus:C,srj:{...t,bounds:f},acceptedPlans:[],terminals:x,sourceEscapePaths:b,reservedVias:i.filter((H)=>!y.has(H.connectionIndex)).map((H)=>({connectionName:H.connectionName,via:H.via})),allowBlindAndBuriedVias:!1,allowSameNetMerges:!1,gridStepDivisor:2,gridStep:l/4,alignGridToPads:!0,maximumRouteOrderAttempts:1,routeOrder:_.map((H,V)=>_.length-V-1),laneBias:D},1,!1);if(L.length){I=L[0];break}}if(!I)return null;let v=new Map(I.map((D)=>[D.connectionIndex,D])),P=g+h,M=n.sharedBoundary.maxX-(_.length+1)*l-2*e.viaDiameter;if(P+(_.length-1)*l+a/2>n.sharedBoundary.maxY)return null;let B=0,T=[];for(let D of u){let L=d.get(D.connection.connectionIndex),H=v.get(D.connection.connectionIndex),V;if(H){let O=H.segments.filter((se)=>se.layer===o),U=O.at(-1),j=U.end.x-U.start.x,Y=U.end.y-U.start.y;if(Y<=0||Math.abs(j)>Y+0.0000001)return null;let X=U.end,K=P+B*l,J=M+B*l;B++;let ee=yzr([X,{x:X.x,y:K},{x:J,y:K},{x:J,y:D.exitPoint.y},D.exitPoint],a);V=[O[0].start,...O.map((se)=>se.end),...ee.slice(1)]}else V=[L.via.center,D.exitPoint];T.push(Ob({...e,bus:n,terminal:D,targetLayerPoints:V,sourceEscapePoints:b.get(D.connection.connectionIndex),allowBlindAndBuriedVias:!1}))}let N=T.map((D)=>D.length);if(n.maxLengthSkew!==void 0&&Math.max(...N)-Math.min(...N)>n.maxLengthSkew+0.000001)return null;if(!q0({plans:T,srj:t,sharedBoundary:n.sharedBoundary,clearance:c,allowBlindAndBuriedVias:!1,allowSameNetMerges:!1}))return null;for(let D of T)for(let L of i){if(D.connectionIndex===L.connectionIndex)continue;for(let H of D.segments){if(L.via.spanLayers.includes(H.layer)&&Hr(L.via.center,H.start,H.end)<L.via.diameter/2+H.width/2+c-0.0000001)return null;for(let V of L.segments)if(H.layer===V.layer&&Hh(H.start,H.end,V.start,V.end)<(H.width+V.width)/2+c-0.0000001)return null}}return T}function yzr(e,t){let n=e.filter((o,r)=>r===0||Gt(o,e[r-1])>0.000000001);return n.flatMap((o,r)=>{if(r===0||r===n.length-1)return[o];let i=n[r-1],s=n[r+1],a=Math.min(t,Gt(i,o)/3,Gt(o,s)/3);if(Math.abs((o.x-i.x)*(s.x-o.x)+(o.y-i.y)*(s.y-o.y))>0.000000001)return[o];return[{x:o.x+(i.x-o.x)*a/Gt(i,o),y:o.y+(i.y-o.y)*a/Gt(i,o)},{x:o.x+(s.x-o.x)*a/Gt(o,s),y:o.y+(s.y-o.y)*a/Gt(o,s)}]})}function*xzr(e){let{bus:t,sourceBoundary:n,sourceEscapes:o,traceWidth:r,clearance:i,targetLayer:s}=e,a=Vi(t.exitEdge,t.preferredExit);if(e.allowBlindAndBuriedVias||t.exitEdge!=="right"||a!==void 0&&a!=="minimum"||t.connections.length<3)return null;let c=t.routableEscapeLayers??t.allowedLayers??[],l=c.find((U)=>U!==s);if(!l||!c.includes(s)||t.connections.some((U)=>U.sourceLayer===s))return null;let h=new Map(o.map((U)=>[U.connectionIndex,U])),d=r+i,u=Math.min(t.pitchX,t.pitchY),_=e.viaDiameter+i,p=t.sharedBoundary.minX+Math.max(u/2,e.viaDiameter/2+i);if(p+(t.connections.length-1)*_>=n.minX)return null;let m=e.acceptedPlans.filter((U)=>U.exitEdge===t.exitEdge&&U.cornerBandSide==="minimum").length,A=t.connections.map((U)=>{let j=h.get(U.connectionIndex);if(!j)throw Error(`FanoutSolver: missing crossbar source escape for ${U.connection.name}`);return{connection:U,viaPoint:j.via.center,exitPoint:{x:t.sharedBoundary.maxX,y:a?Q9({...e,connection:U,cornerExitLaneOffset:m}):Q9({...e,bus:{...t,preferredExit:"bottom-right"},connection:U,cornerExitLaneOffset:m,windingOrderIndex:0})}}}),g=A.toSorted((U,j)=>U.exitPoint.y-j.exitPoint.y);if(!a)for(let[U,j]of g.entries())j.exitPoint.y=n.minY+u+U*_;let f=new Map(g.map((U)=>[U.connection.connectionIndex,U.exitPoint.y])),y=Math.min(n.maxY-d,Math.max(...A.map((U)=>U.viaPoint.y))+2*u),x=Math.max(n.minY+d,Math.min(...A.map((U)=>U.viaPoint.y))-2*u,...a?[]:[Math.max(...f.values())+e.viaDiameter/2+r/2+i+d]);if(y-x<(A.length-1)*_||x<=Math.max(...f.values())+e.viaDiameter/2+r/2+i)return null;let C=new Map(o.map((U)=>[U.connectionIndex,[U.segments[0].start,...U.segments.map((j)=>j.end)]])),b=[...e.srj.obstacles.filter((U)=>U.layers.includes(s)).map((U)=>({...U,layers:["top"]})),...o.map((U)=>({type:"rect",shape:"circle",center:U.via.center,width:U.via.diameter,height:U.via.diameter,layers:["top"],connectedTo:[U.connectionName]}))];for(let U=n.minY;U<=n.maxY;U+=d)if(U<x||U>y)b.push({type:"rect",shape:"circle",center:{x:n.minX,y:U},width:r/1000,height:r/1000,layers:["top"],connectedTo:["blocked-port"]});let I=A.map((U,j)=>({...t,busId:t.busId+":"+j,sharedBoundary:n,preferredExit:void 0,exitEdge:void 0,connections:[{...U.connection,sourcePoint:{...U.viaPoint,layer:"top"},sourceLayer:"top",sourceObstacle:b.find((Y)=>Y.connectedTo.includes(U.connection.connection.name)&&Gt(Y.center,U.viaPoint)<0.0000001),exitTargetPoint:void 0,hasExplicitLayeredExitTarget:!1,hasExplicitExitTarget:!1}]})),v=MY({srj:{...e.srj,obstacles:b},buses:I,traceWidth:r,clearance:i,availableBoundaryRegions:[{exitEdge:"left",direction:"left",preferredExit:"left"}]}),P=v.next();while(!P.done)yield{phase:"route-connection",routeOrderAttempt:0,connectionIndex:0,connectionCount:A.length,connectionName:A[0].connection.connection.name,searchBatch:0,expandedStateCount:0,connectionComplete:!1},P=v.next();let M=P.value?.length===A.length?P.value.map((U)=>{let j=A.find((Y)=>Y.connection.connectionIndex===U.connectionIndex);return Ob({...e,terminal:{...j,exitPoint:U.exitPoint},sourceEscapePoints:C.get(U.connectionIndex),targetLayerPoints:[U.segments[0].start,...U.segments.map((Y)=>Y.end)],allowBlindAndBuriedVias:!1})}):void 0;if(!M)return null;let B=M.toSorted((U,j)=>a?U.exitPoint.y-j.exitPoint.y:A.find((Y)=>Y.connection.connectionIndex===U.connectionIndex).exitPoint.y-A.find((Y)=>Y.connection.connectionIndex===j.connectionIndex).exitPoint.y),T=(U,j,Y)=>({center:U,diameter:e.viaDiameter,holeDiameter:e.viaHoleDiameter,fromLayer:j,toLayer:Y,spanLayers:t5({fromLayer:j,toLayer:Y,layerNames:e.layerNames,allowBlindAndBuriedVias:!1})}),N=new Map;for(let[U,j]of B.entries()){let Y=j.segments.at(-1),X=Y.end.x-Y.start.x,K=Y.end.y-Y.start.y;if(X>=0||Math.abs(K)>-X+0.0000001)return null;let J=A.find((Z)=>Z.connection.connectionIndex===j.connectionIndex),ee=p+U*_,se={x:ee,y:j.exitPoint.y},ne={x:ee,y:f.get(j.connectionIndex)},re=[{start:j.exitPoint,end:se,width:r,layer:s},{start:se,end:ne,width:r,layer:l}];N.set(j.connectionIndex,{...j,segments:[...j.segments,...re],additionalVias:[T(se,s,l),T(ne,l,s)],direction:t.direction,exitEdge:t.exitEdge,cornerBandSide:Vi(t.exitEdge,t.preferredExit),exitPoint:J.exitPoint})}let D=[...N.values()],L=A.map((U)=>({...U.connection,sourcePoint:{...N.get(U.connection.connectionIndex).additionalVias[1].center,layer:s},sourceLayer:s})),H={...e,bus:{...t,connections:L},terminals:L.map((U,j)=>({connection:U,viaPoint:U.sourcePoint,exitPoint:A[j].exitPoint})),acceptedPlans:[...e.acceptedPlans,...D],reservedVias:[...o.map((U)=>({connectionName:U.connectionName,via:U.via})),...D.flatMap((U)=>U.additionalVias.map((j)=>({connectionName:U.connectionName,via:j})))],allowSourceLayerRouting:!0,sourceEscapePaths:void 0,gridStep:d*3/8,gridStepDivisor:2,alignGridToPads:!0,maximumRouteOrderAttempts:6,routeOrder:A.map((U,j)=>j).sort((U,j)=>A[U].exitPoint.y-A[j].exitPoint.y)},V=yield*G2(H,1,!1);if(!V.length)return null;let O=M.map((U)=>{let j=N.get(U.connectionIndex),Y=V[0].find((ne)=>ne.connectionIndex===U.connectionIndex),[X,K]=j.additionalVias,J=(ne,re)=>({route_type:"wire",...ne,width:r,layer:re}),ee=(ne)=>({route_type:"via",...ne.center,from_layer:ne.fromLayer,to_layer:ne.toLayer,via_diameter:ne.diameter,via_hole_diameter:ne.holeDiameter}),se=[...j.segments,...Y.segments];return{...j,segments:se,trace:{...U.trace,route:[...U.trace.route,J(X.center,s),ee(X),J(X.center,l),J(K.center,l),ee(K),...Y.trace.route]},length:se.reduce((ne,re)=>ne+Gt(re.start,re.end),0)}});if(!q0({...e,plans:[...e.acceptedPlans,...O],sharedBoundary:t.sharedBoundary}))return null;for(let U of O)for(let j of o){if(U.connectionIndex===j.connectionIndex)continue;for(let Y of U.segments){if(j.via.spanLayers.includes(Y.layer)&&Hr(j.via.center,Y.start,Y.end)<j.via.diameter/2+r/2+i-0.0000001)return null;for(let X of j.segments)if(X.layer===Y.layer&&Hh(Y.start,Y.end,X.start,X.end)<r+i-0.0000001)return null}for(let Y of U.additionalVias){if(Gt(Y.center,j.via.center)<e.viaDiameter+i-0.0000001)return null;for(let X of j.segments)if(Y.spanLayers.includes(X.layer)&&Hr(Y.center,X.start,X.end)<e.viaDiameter/2+r/2+i-0.0000001)return null}}return O}function u8e(e){let t=new Map,n=(o)=>{if(o===null||typeof o!=="object")return o;if(t.has(o))return t.get(o);if(o instanceof Map){let a=new Map;t.set(o,a);for(let[c,l]of o)a.set(c,n(l));return a}if(o instanceof Set){let a=new Set(o);return t.set(o,a),a}if(Array.isArray(o)){let a=[];t.set(o,a);for(let c of o)a.push(n(c));return a}let r=o,i={};t.set(o,i);for(let[a,c]of Object.entries(r))i[a]=n(c);if(typeof r.x==="number"&&typeof r.y==="number")i.x=-r.x;if(typeof r.minX==="number"&&typeof r.maxX==="number")i.minX=-r.maxX,i.maxX=-r.minX;if(Array.isArray(r.xCoordinates))i.xCoordinates=r.xCoordinates.map((a)=>-a).sort((a,c)=>a-c);if(typeof r.ccwRotationDegrees==="number")i.ccwRotationDegrees=-r.ccwRotationDegrees;let s=(a)=>a==="left"?"right":a==="right"?"left":a;for(let a of["direction","exitEdge","preferredExit"])if(typeof r[a]==="string")i[a]=r[a].split("-").map(s).join("-");if(r.cornerBandSide&&(r.exitEdge==="top"||r.exitEdge==="bottom"))i.cornerBandSide=r.cornerBandSide==="minimum"?"maximum":"minimum";return i};return n(e)}function*g3n(e){let{bus:t,srj:n,sourceEscapes:o,sourceBoundary:r,targetLayer:i,acceptedPlans:s,traceWidth:a,clearance:c,viaDiameter:l}=e,h=t.exitEdge==="left",d=h?e.oppositeLayout:void 0,u=t.routableEscapeLayers??t.allowedLayers??[],_=t.connections[0].sourceLayer,p=h?u.find((Ne)=>Ne!==i):_;if(t.termination.type!=="boundary"||t.exitEdge!=="right"&&!h||!p||!u.includes(i)||p===i||!(t.routableEscapeLayers??t.allowedLayers??[]).includes(p))return null;let m=Vi(t.exitEdge,t.preferredExit)==="minimum",A=t.connections.length,g=a+c,f=Math.ceil((l+c)/g)*g,y=new Map(o.map((Ne)=>[Ne.connectionIndex,Ne])),x=t.connections.map((Ne)=>y.get(Ne.connectionIndex));if(A<2||x.some((Ne)=>!Ne))return null;let C=x.map((Ne)=>Ne.via.center),b=Math.round(((h?(r.minX+r.maxX)/2+(d?.sourcePortOffset??0):Math.min(...C.map((Ne)=>Ne.x)))+f-r.minX)/g),I=Math.round(f/g),v=new Set(Array.from({length:A},(Ne,Le)=>b+Le*I)),P=Math.round((r.maxX-r.minX)/g);if(b<1||Math.max(...v)>=P)return null;let M=(Ne,Le,nt)=>({type:"rect",shape:"circle",center:Le,width:nt,height:nt,layers:["top"],connectedTo:[Ne]}),B=[...n.obstacles.filter((Ne)=>Ne.layers.includes(i)).map((Ne)=>({...Ne,layers:["top"]})),...o.map((Ne)=>M(Ne.connectionName,Ne.via.center,Ne.via.diameter)),...s.flatMap((Ne)=>(Ne.additionalVias??[]).map((Le)=>M(Ne.connectionName,Le.center,Le.diameter))),...s.flatMap((Ne)=>Ne.segments.filter((Le)=>Le.layer===i).map((Le)=>({type:"rect",center:{x:(Le.start.x+Le.end.x)/2,y:(Le.start.y+Le.end.y)/2},width:Gt(Le.start,Le.end),height:Le.width,ccwRotationDegrees:Math.atan2(Le.end.y-Le.start.y,Le.end.x-Le.start.x)*180/Math.PI,layers:["top"],connectedTo:[Ne.connectionName]})))];for(let Ne=0;Ne<=P;Ne++)if(!v.has(Ne))B.push(M(`reserved-crossbar-port-${Ne}`,{x:r.minX+Ne*g,y:r.minY},a/1000));let T=t.connections.map((Ne,Le)=>{let nt=C[Le],dt=B.find((rt)=>rt.connectedTo.includes(Ne.connection.name)&&Gt(rt.center,nt)<0.0000001);return{...t,busId:`${t.busId}:source-${Le}`,sharedBoundary:r,preferredExit:void 0,exitEdge:void 0,connections:[{...Ne,sourcePoint:{...Ne.sourcePoint,...nt,layer:"top"},sourceObstacle:dt,sourceLayer:"top",exitTargetPoint:void 0,hasExplicitLayeredExitTarget:!1,hasExplicitExitTarget:!1}]}}),N=MY({srj:{...n,bounds:r,obstacles:B},buses:T,traceWidth:a,clearance:c,availableBoundaryRegions:[{direction:"down",preferredExit:"bottom",exitEdge:"bottom"}]}),D=N.next();while(!D.done)yield{phase:"route-connection",routeOrderAttempt:0,connectionIndex:0,connectionCount:A,connectionName:t.connections[0].connection.name,searchBatch:0,expandedStateCount:0,connectionComplete:!1},D=N.next();if(!D.value||D.value.length!==A)return null;let L=new Map(D.value.map((Ne)=>[Ne.connectionIndex,Ne])),H=(Ne)=>Vi(t.exitEdge,t.preferredExit)!==void 0?Q9({...e,connection:Ne,cornerExitLaneOffset:0}):fY({...e,connection:Ne,boundaryDirection:h?"left":"right"}),V=t.connections.toSorted((Ne,Le)=>H(Ne)-H(Le)),O=Math.max(...t.componentObstacles.map((Ne)=>Ne.center.x+Ne.width/2)),U=o.filter((Ne)=>Ne.via.center.x>r.maxX).map((Ne)=>Ne.via.center.x),j=U.length?Math.min(...U):t.sharedBoundary.maxX,Y=l/2+a/2+c,X=m||d?.compactRows?Math.max(Y,(l+c)/Math.SQRT2)+0.00001:f,K=Math.min(...s.flatMap((Ne)=>Ne.segments).filter((Ne)=>Ne.layer!==p).flatMap((Ne)=>[Ne.start.y,Ne.end.y])),J=Math.min(r.minY-l/2-c-(d?.rowOffset??0),m?K-Y-0.00001:1/0),ee=J-(A-1)*X,se=o.flatMap((Ne)=>Ne.segments).filter((Ne)=>Ne.layer===p&&(!m||Math.max(Ne.start.x,Ne.end.x)>=Math.min(...[...L.values()].map((Le)=>Le.exitPoint.x))-Y)&&Math.min(Ne.start.y,Ne.end.y)<=J+Y&&Math.max(Ne.start.y,Ne.end.y)>=ee-Y),ne=se.length?Math.min(...se.map((Ne)=>Math.min(Ne.start.x,Ne.end.x)))-Y-0.00001:t.sharedBoundary.maxX,re=Math.min(t.sharedBoundary.maxX-l-c,j-Y-a,ne),Z=[...o.map((Ne)=>Ne.via),...s.flatMap((Ne)=>Ne.additionalVias??[])].filter((Ne)=>Ne.spanLayers.includes(i)).map((Ne)=>({minimum:Ne.center.x-Ne.diameter/2-a/2-c-0.00001,maximum:Ne.center.x+Ne.diameter/2+a/2+c+0.00001})),te=Array.from({length:A},(Ne,Le)=>re-Le*X),ie=[];if(te.every((Ne)=>Z.every((Le)=>Ne<Le.minimum||Ne>Le.maximum)))ie.push(...te);else{let Ne=re;for(let Le=0;Le<A;Le++){for(let nt=0;nt<=Z.length;nt++){let dt=Z.filter((rt)=>Ne>=rt.minimum&&Ne<=rt.maximum);if(!dt.length)break;Ne=Math.min(...dt.map((rt)=>rt.minimum))-0.0000001}ie.push(Ne),Ne-=m?X:l+c}}let ce=ie.at(-1),ue=[...o.map((Ne)=>Ne.via),...s.flatMap((Ne)=>Ne.additionalVias??[])].filter((Ne)=>Ne.spanLayers.includes(i)&&Ne.center.x+Ne.diameter/2+a/2+c>=(h?t.sharedBoundary.minX:ce)&&Ne.center.x-Ne.diameter/2-a/2-c<=t.sharedBoundary.maxX).map((Ne)=>({minimum:Ne.center.y-Ne.diameter/2-a/2-c-a/100,maximum:Ne.center.y+Ne.diameter/2+a/2+c+a/100})),de=[],me=t.sharedBoundary.maxY-a/2;for(let Ne=A-1;Ne>=0;Ne--){for(let Le=0;Le<=ue.length;Le++){let nt=ue.filter((dt)=>me>=dt.minimum&&me<=dt.maximum);if(!nt.length)break;me=Math.min(...nt.map((dt)=>dt.minimum))-0.0000001}de[Ne]=me,me-=l+c}if(m)de.splice(0,de.length,...V.map(H));let ge=de[0],xe=J;if(xe-(A-1)*X-l/2<t.sharedBoundary.minY||ce<=Math.max(...[...L.values()].map((Ne)=>Ne.exitPoint.x))+Y||!m&&ge<=(t.sharedBoundary.minY+t.sharedBoundary.maxY)/2)return null;let Ee=V.map((Ne,Le)=>{let nt=L.get(Ne.connectionIndex),dt=y.get(Ne.connectionIndex),rt=de[Le];return{connectionIndex:Ne.connectionIndex,length:dt.segments.reduce((pt,ct)=>pt+Gt(ct.start,ct.end),0)+(d?.compactRows?2*ie[A-1-Le]:0)+nt.length+rt-nt.exitPoint.x}}).sort((Ne,Le)=>Le.length-Ne.length),Re=new Map(Ee.map((Ne,Le)=>[Ne.connectionIndex,Le])),Me=(Ne,Le)=>Ne.slice(1).flatMap((nt,dt)=>Gt(Ne[dt],nt)<0.000000001?[]:[{start:Ne[dt],end:nt,width:a,layer:Le}]),_e=(Ne,Le)=>Ne.map((nt)=>({route_type:"wire",...nt,width:a,layer:Le})),ye=(Ne)=>({route_type:"via",...Ne.center,from_layer:Ne.fromLayer,to_layer:Ne.toLayer,via_diameter:Ne.diameter,via_hole_diameter:Ne.holeDiameter}),Se=V.map((Ne,Le)=>{let nt=y.get(Ne.connectionIndex),dt=L.get(Ne.connectionIndex),rt=xe-Re.get(Ne.connectionIndex)*X,pt={x:dt.exitPoint.x,y:rt},ct={x:ie[h?A-1-Le:Le],y:rt},Ct={x:h?t.sharedBoundary.minX:t.sharedBoundary.maxX,y:de[Le]},kt=[nt.segments[0].start,...nt.segments.map((ut)=>ut.end)],Lt=[dt.segments[0].start,...dt.segments.map((ut)=>ut.end),pt],Bt=[ct,{x:ct.x,y:Ct.y-Math.sign(Ct.y-ct.y)*a},{x:ct.x+(h?-a:a),y:Ct.y},Ct],xt=Ob({...e,terminal:{connection:Ne,viaPoint:nt.via.center,exitPoint:Ct},sourceEscapePoints:kt,targetLayerPoints:[nt.via.center,Ct],allowBlindAndBuriedVias:!1}),Yt=[{center:pt,diameter:l,holeDiameter:e.viaHoleDiameter,spanLayers:e.layerNames,fromLayer:i,toLayer:p},{center:ct,diameter:l,holeDiameter:e.viaHoleDiameter,spanLayers:e.layerNames,fromLayer:p,toLayer:i}];return xt.segments=[...nt.segments,...Me(Lt,i),...Me([pt,ct],p),...Me(Bt,i)],xt.additionalVias=Yt,xt.sourceEscapeSegmentCount=nt.segments.length,xt.length=xt.segments.reduce((ut,Ze)=>ut+Gt(Ze.start,Ze.end),0),xt.trace.route=[..._e(kt,_),ye(xt.via),..._e(Lt,i),ye(Yt[0]),..._e([pt,ct],p),ye(Yt[1]),..._e(Bt,i)],xt});if(t.maxLengthSkew!==void 0&&!d?.compactRows){let Ne=Se.map((Le)=>Le.length);if(Math.max(...Ne)-Math.min(...Ne)>t.maxLengthSkew+0.000001)return null}if(!q0({...e,plans:[...s,...Se],sharedBoundary:t.sharedBoundary}))return null;for(let Ne of Se)for(let Le of o){if(Ne.connectionIndex===Le.connectionIndex)continue;for(let nt of Ne.segments){if(Le.via.spanLayers.includes(nt.layer)&&Hr(Le.via.center,nt.start,nt.end)<Le.via.diameter/2+a/2+c-0.0000001)return null;for(let dt of Le.segments)if(nt.layer===dt.layer&&Hh(nt.start,nt.end,dt.start,dt.end)<(a+dt.width)/2+c-0.0000001)return null}for(let nt of Ne.additionalVias){if(Gt(nt.center,Le.via.center)<(nt.diameter+Le.via.diameter)/2+c-0.0000001)return null;for(let dt of Le.segments)if(nt.spanLayers.includes(dt.layer)&&Hr(nt.center,dt.start,dt.end)<nt.diameter/2+dt.width/2+c-0.0000001)return null}}return Se}function*Czr(e){if(e.bus.exitEdge!=="right")return null;let t=u8e(e),n=Math.min(e.bus.pitchX,e.bus.pitchY),o=e.traceWidth+e.clearance,r=Math.ceil((e.viaDiameter+e.clearance)/o)*o,i=Math.max(0,Math.min(8,Math.floor(((t.sourceBoundary.maxX-t.sourceBoundary.minX)/2-e.bus.connections.length*r-o)/n))),s=[void 0,{sourcePortOffset:-n,rowOffset:0,compactRows:!1},...[0,1,2,3].map((l)=>({sourcePortOffset:-n,rowOffset:l*o,compactRows:!0})),...Array.from({length:i},(l,h)=>i-h).flatMap((l)=>[0,1,2,3].map((h)=>({sourcePortOffset:l*n,rowOffset:h*o,compactRows:!0})))],a=null;for(let l of s)if(a=yield*g3n({...t,oppositeLayout:l}),a)break;if(!a)return null;let c=new Map(e.bus.connections.map((l)=>[l.connectionIndex,l]));return u8e(a).map((l)=>({...l,sourceObstacle:c.get(l.connectionIndex).sourceObstacle}))}function hAn(e){let{bus:t,targetLayer:n,traceWidth:o,clearance:r}=e;if(!t.exitEdge)return[];let i=t.exitEdge==="left"||t.exitEdge==="right",s=i?"y":"x",a=i?"x":"y",c=t.sharedBoundary,l=t.exitEdge==="left"?c.minX:t.exitEdge==="right"?c.maxX:t.exitEdge==="bottom"?c.minY:c.maxY,h=i?c.minY:c.minX,d=i?c.maxY:c.maxX,u=(h+d)/2,_=Vi(t.exitEdge,t.preferredExit),p=(_==="maximum"?u:h)+o/2,m=(_==="minimum"?u:d)-o/2,A=[];for(let C of e.acceptedPlans)for(let b of[...C.segments,...C.planeEndpointSegments??[]]){if(b.layer!==n)continue;let I=(b.width+o)/2+r,v=b.start[a],P=b.end[a]-v,M=0,B=1;if(Math.abs(P)<0.000000001){if(Math.abs(v-l)>I)continue}else{let H=(l-I-v)/P,V=(l+I-v)/P;if(M=Math.max(0,Math.min(H,V)),B=Math.min(1,Math.max(H,V)),M>B)continue}let T=b.start[s],N=b.end[s]-T,D=T+M*N,L=T+B*N;A.push([Math.min(D,L)-I,Math.max(D,L)+I])}let g=[...e.acceptedPlans.flatMap((C)=>[...C.via?[C.via]:[],...C.additionalVias??[],...C.planeEndpointVia?[C.planeEndpointVia]:[]]),...(e.reservedVias??[]).map((C)=>C.via)];for(let C of g){if(!C.spanLayers.includes(n))continue;let b=C.diameter/2+o/2+r,I=Math.abs(C.center[a]-l);if(I>=b)continue;let v=Math.sqrt(b*b-I*I);A.push([C.center[s]-v,C.center[s]+v])}let f=[],y=p;for(let[C,b]of A.sort((I,v)=>I[0]-v[0])){if(b<=y||C>=m)continue;if(C>y)f.push([y,Math.min(C,m)]);if(y=Math.max(y,b),y>=m)break}if(y<m)f.push([y,m]);let x=f.filter(([C,b])=>b-C>0.000001).map(([C,b])=>(C+b)/2);return x.length<=32?x:Array.from({length:32},(C,b)=>x[Math.round(b*(x.length-1)/31)])}function*bzr(e){if(e.buses.some((p)=>p.termination.type!=="boundary"||p.connections.length>2))return null;let t=0,n=192,o=e.traceWidth+e.clearance;function*r(p,m,A=p.preferredExit,g=0){if(t++>=n)return[];return yield*_7e({...e,bus:{...p,preferredExit:A},acceptedPlans:m,reservedVias:e.reservedVias?.filter((f)=>!p.connections.some((y)=>y.connection.name===f.connectionName)),viaMinimalOnly:!0,adaptiveWindingRouteOrder:!0,alignWindingGridToPads:!0,windingGridStep:o/2,fixedViaFallbackRouteOrderAttempts:32,cornerBandTargetTrackOffset:g},1,!1)}let i=(p)=>p.map((m)=>{let A=e.buses.find((g)=>g.busId===m.busId);return A?{...m,cornerBandSide:Vi(A.exitEdge,A.preferredExit)}:m}),s=[...e.acceptedPlans];for(let p of e.buses){let m=yield*r(p,s);if(!m.length){s=[];break}s.push(...m[0])}if(s.length)return i(s.slice(e.acceptedPlans.length));let a=(p,m)=>p.connections.reduce((A,g)=>A+(e.fixedViaPointsByConnectionIndex?.get(g.connectionIndex)??g.sourcePoint)[m],0)/p.connections.length;if(e.buses.length>1)for(let p of[1,-1]){let m=e.buses.toSorted((g,f)=>{let y=Vi(g.exitEdge,g.preferredExit)!==void 0,x=Vi(f.exitEdge,f.preferredExit)!==void 0;if(y!==x)return Number(x)-Number(y);let C=g.exitEdge==="left"||g.exitEdge==="right"?"y":"x";return p*(a(g,C)-a(f,C))}),A=[...e.acceptedPlans];for(let g of m){let f=yield*r(g,A);if(!f.length){A=[];break}A.push(...f[0])}if(A.length)return i(A.slice(e.acceptedPlans.length))}let c=e.buses.toSorted((p,m)=>{let A=Vi(p.exitEdge,p.preferredExit),g=Vi(m.exitEdge,m.preferredExit),f=A==="minimum",y=g==="minimum";if(f!==y)return Number(y)-Number(f);if(f)return a(p,"y")-a(m,"y");if(p.connections.length!==m.connections.length)return p.connections.length-m.connections.length;if(p.connections.length===1)return a(p,"x")-a(m,"x");if(A!==g)return Number(A==="maximum")-Number(g==="maximum");return(A==="maximum"?1:-1)*(a(p,"y")-a(m,"y"))});if(e.buses.length>1){let p=c.toSorted((f,y)=>{let x=(C)=>C.connections.length===1&&!Vi(C.exitEdge,C.preferredExit);return Number(x(y))-Number(x(f))}),m=Math.min(n,t+48);function*A(f,y){if(f===p.length)return y;if(t>=m)return null;let x=p[f],C=yield*r(x,y);for(let I of C){let v=yield*A(f+1,[...y,...I]);if(v)return v}let b=yield*l(x,y,m);for(let I of b){let v=yield*A(f+1,[...y,...I]);if(v)return v}return null}let g=yield*A(0,[...e.acceptedPlans]);if(g)return i(g.slice(e.acceptedPlans.length))}function*l(p,m,A){if(!p.exitEdge)return[];let g=e.reservedVias?.filter((M)=>!p.connections.some((B)=>B.connection.name===M.connectionName)),f={...e,bus:p,acceptedPlans:m,reservedVias:g},y=Vi(p.exitEdge,p.preferredExit),x=p.exitEdge==="left"||p.exitEdge==="right",C=p.sharedBoundary,b=x?C.minY:C.minX,I=x?C.maxY:C.maxX,v=(b+I)/2,P=[];for(let M of hAn(f)){if(t>=A)break;let B=y?p.preferredExit:h(p).find((O)=>Vi(p.exitEdge,O)===(M>v?"maximum":"minimum")),T=p.connections.map((O)=>Q9({...f,bus:{...p,preferredExit:B},connection:O,cornerExitLaneOffset:0,windingOrderIndex:0})),N=T.reduce((O,U)=>O+U,0)/T.length,D=T.map((O)=>O-N+M);if(D.some((O)=>O<=b+e.traceWidth/2||O>=I-e.traceWidth/2||y==="minimum"&&O>=v||y==="maximum"&&O<=v))continue;let L=p.connections.map((O,U)=>{let j=e.fixedViaPointsByConnectionIndex?.get(O.connectionIndex),Y=D[U],X=p.exitEdge==="left"?{x:C.minX,y:Y}:p.exitEdge==="right"?{x:C.maxX,y:Y}:p.exitEdge==="bottom"?{x:Y,y:C.minY}:{x:Y,y:C.maxY};return{connection:O,viaPoint:j,exitPoint:X}});if(L.some((O)=>!O.viaPoint))return[];t++;let H=G2({...f,terminals:L,gridStep:o/2,alignGridToPads:!0,maximumRouteOrderAttempts:p.connections.length===1?3:16,adaptiveRouteOrder:!0},1,!1),V=H.next();while(!V.done)yield{phase:"via-minimal-winding",busId:p.busId,targetLayer:e.targetLayer,winding:V.value},V=H.next();P.push(...V.value)}return P}function h(p){if(Vi(p.exitEdge,p.preferredExit))return[p.preferredExit];switch(p.exitEdge){case"right":return[p.preferredExit,"top-right","bottom-right"];case"left":return[p.preferredExit,"top-left","bottom-left"];case"top":return[p.preferredExit,"top-left","top-right"];case"bottom":return[p.preferredExit,"bottom-left","bottom-right"];default:return[p.preferredExit]}}function d(p,m,A){let g=Vi(p.exitEdge,A);if(!g||e.buses.length>1)return[0];let f=p.exitEdge==="left"||p.exitEdge==="right",y=f?p.sharedBoundary.minY:p.sharedBoundary.minX,x=f?p.sharedBoundary.maxY:p.sharedBoundary.maxX,C=(y+x)/2,b=m.filter((N)=>N.exitEdge===p.exitEdge&&N.cornerBandSide===g).length,I=p.connections.map((N)=>Q9({...e,bus:{...p,preferredExit:A},connection:N,cornerExitLaneOffset:b,windingOrderIndex:0})),v=g==="minimum"?-1:1,P=Math.min(p.pitchX,p.pitchY),M=I.reduce((N,D)=>N+D,0)/I.length,B=g==="minimum"?y+o:x-o,T=[0,v*2*o,-v*2*o,v*P,v*2*P,v*3*P,v*4*P,B-M];return T.filter((N,D)=>T.indexOf(N)===D&&I.every((L)=>L+N>y+e.traceWidth/2&&L+N<x-e.traceWidth/2&&(g==="minimum"?L+N<C:L+N>C)))}function*u(p,m){if(!p.length)return m;if(t>=n)return null;for(let A of p)for(let g of h(A))for(let f of d(A,m,g)){let y=yield*r(A,m,g,f);if(!y.length)continue;let x=yield*u(p.filter((C)=>C!==A),[...m,...y[0]]);if(x)return x;if(t>=n)return null}for(let A of p){if(A.connections.length!==1||!A.exitEdge)continue;let g=A.connections[0],f=e.fixedViaPointsByConnectionIndex?.get(g.connectionIndex);if(!f)continue;let y=e.reservedVias?.filter((C)=>C.connectionName!==g.connection.name),x=hAn({...e,bus:A,acceptedPlans:m,reservedVias:y});for(let C of x){if(t++>=n)return null;let b=A.sharedBoundary,I=A.exitEdge==="left"?{x:b.minX,y:C}:A.exitEdge==="right"?{x:b.maxX,y:C}:A.exitEdge==="bottom"?{x:C,y:b.minY}:{x:C,y:b.maxY},v=G2({...e,bus:A,acceptedPlans:m,reservedVias:y,terminals:[{connection:g,viaPoint:f,exitPoint:I}],gridStep:o/2,alignGridToPads:!0,maximumRouteOrderAttempts:3},1,!1),P=v.next();while(!P.done)yield{phase:"via-minimal-winding",busId:A.busId,targetLayer:e.targetLayer,winding:P.value},P=v.next();if(!P.value.length)continue;let M=yield*u(p.filter((B)=>B!==A),[...m,...P.value[0]]);if(M)return M}}return null}let _=yield*u(c,[...e.acceptedPlans]);return _&&i(_.slice(e.acceptedPlans.length))}function*Izr(e){let{bus:t,sourceBoundary:n,sourceEscapes:o,traceWidth:r,clearance:i,targetLayer:s}=e,a=Vi(t.exitEdge,t.preferredExit);if(e.allowBlindAndBuriedVias||t.exitEdge!=="right"||a!==void 0&&a!=="minimum"||t.connections.length<3)return null;let c=t.routableEscapeLayers??t.allowedLayers??[],l=c.find((Y)=>Y!==s);if(!l||!c.includes(s)||t.connections.some((Y)=>Y.sourceLayer===s))return null;let h=new Map(o.map((Y)=>[Y.connectionIndex,Y])),d=r+i,u=Math.min(t.pitchX,t.pitchY),_=e.viaDiameter+i,p={x:(t.componentBounds.minX+t.componentBounds.maxX)/2,y:(t.componentBounds.minY+t.componentBounds.maxY)/2},m=t.sharedBoundary.minX+Math.max(u/2,e.viaDiameter/2+i);if(m+(t.connections.length-1)*_>=n.minX)return null;let A=e.acceptedPlans.filter((Y)=>Y.exitEdge===t.exitEdge&&Y.cornerBandSide==="minimum").length,g=t.connections.map((Y)=>{let X=h.get(Y.connectionIndex);if(!X)throw Error(`FanoutSolver: missing crossbar source escape for ${Y.connection.name}`);return{connection:Y,viaPoint:X.via.center,exitPoint:{x:t.sharedBoundary.maxX,y:a?Q9({...e,connection:Y,cornerExitLaneOffset:A}):Q9({...e,bus:{...t,preferredExit:"bottom-right"},connection:Y,cornerExitLaneOffset:A,windingOrderIndex:0})}}}),f=g.toSorted((Y,X)=>Y.exitPoint.y-X.exitPoint.y);if(!a)for(let[Y,X]of f.entries())X.exitPoint.y=n.minY+u+Y*_;let y=new Map(f.map((Y)=>[Y.connection.connectionIndex,Y.exitPoint.y])),x=Math.min(n.maxY-d,Math.max(...g.map((Y)=>Y.viaPoint.y))+2*u),C=Math.max(n.minY+d,Math.min(...g.map((Y)=>Y.viaPoint.y))-2*u,...a?[]:[Math.max(...y.values())+e.viaDiameter/2+r/2+i+d]);if(x-C<(g.length-1)*_||C<=Math.max(...y.values())+e.viaDiameter/2+r/2+i)return null;let b=(Y)=>{let X=g[Y].viaPoint,K=Math.atan2(X.y-p.y,X.x-p.x);return K<0?K+2*Math.PI:K},I=g.map((Y,X)=>X).sort((Y,X)=>b(Y)-b(X)),v=new Map(I.map((Y,X)=>[Y,{x:n.minX,y:x-(x-C)*X/(g.length-1)}])),P={minX:n.minX,maxX:p.x,minY:Math.min(C-u,Math.min(...g.map((Y)=>Y.viaPoint.y))-2*u),maxY:n.maxY},M=new Map(o.map((Y)=>[Y.connectionIndex,[Y.segments[0].start,...Y.segments.map((X)=>X.end)]])),B=new Set(g.map((Y)=>Y.connection.connectionIndex)),T=o.filter((Y)=>!B.has(Y.connectionIndex)).map((Y)=>({connectionName:Y.connectionName,via:Y.via})),N;for(let Y of[0,-1,1]){let X=yield*G2({...e,bus:{...t,exitEdge:"left",direction:"left",preferredExit:void 0,sharedBoundary:P},terminals:g.map((K,J)=>({...K,exitPoint:v.get(J)})),sourceEscapePaths:M,reservedVias:T,gridStep:d/4,gridStepDivisor:2,alignGridToPads:!0,maximumRouteOrderAttempts:1,routeOrder:I,laneBias:Y},1,!1);if(X.length){N=X[0];break}}if(!N)return null;let D=N.toSorted((Y,X)=>a?Y.exitPoint.y-X.exitPoint.y:g.find((K)=>K.connection.connectionIndex===Y.connectionIndex).exitPoint.y-g.find((K)=>K.connection.connectionIndex===X.connectionIndex).exitPoint.y),L=(Y,X,K)=>({center:Y,diameter:e.viaDiameter,holeDiameter:e.viaHoleDiameter,fromLayer:X,toLayer:K,spanLayers:t5({fromLayer:X,toLayer:K,layerNames:e.layerNames,allowBlindAndBuriedVias:!1})}),H=new Map;for(let[Y,X]of D.entries()){let K=X.segments.at(-1),J=K.end.x-K.start.x,ee=K.end.y-K.start.y;if(J>=0||Math.abs(ee)>-J+0.0000001)return null;let se=g.find((ie)=>ie.connection.connectionIndex===X.connectionIndex),ne=m+Y*_,re={x:ne,y:X.exitPoint.y},Z={x:ne,y:y.get(X.connectionIndex)},te=[{start:X.exitPoint,end:re,width:r,layer:s},{start:re,end:Z,width:r,layer:l}];H.set(X.connectionIndex,{...X,segments:[...X.segments,...te],additionalVias:[L(re,s,l),L(Z,l,s)],direction:t.direction,exitEdge:t.exitEdge,cornerBandSide:Vi(t.exitEdge,t.preferredExit),exitPoint:se.exitPoint})}let V=[...H.values()],O=g.map((Y)=>({...Y.connection,sourcePoint:{...H.get(Y.connection.connectionIndex).additionalVias[1].center,layer:s},sourceLayer:s})),U=yield*G2({...e,bus:{...t,connections:O},terminals:O.map((Y,X)=>({connection:Y,viaPoint:Y.sourcePoint,exitPoint:g[X].exitPoint})),acceptedPlans:[...e.acceptedPlans,...V],reservedVias:[...o.map((Y)=>({connectionName:Y.connectionName,via:Y.via})),...V.flatMap((Y)=>Y.additionalVias.map((X)=>({connectionName:Y.connectionName,via:X})))],allowSourceLayerRouting:!0,sourceEscapePaths:void 0,gridStep:d/2,gridStepDivisor:2,alignGridToPads:!0,maximumRouteOrderAttempts:12},1,!1);if(!U.length)return null;let j=N.map((Y)=>{let X=H.get(Y.connectionIndex),K=U[0].find((Z)=>Z.connectionIndex===Y.connectionIndex),[J,ee]=X.additionalVias,se=(Z,te)=>({route_type:"wire",...Z,width:r,layer:te}),ne=(Z)=>({route_type:"via",...Z.center,from_layer:Z.fromLayer,to_layer:Z.toLayer,via_diameter:Z.diameter,via_hole_diameter:Z.holeDiameter}),re=[...X.segments,...K.segments];return{...X,segments:re,trace:{...Y.trace,route:[...Y.trace.route,se(J.center,s),ne(J),se(J.center,l),se(ee.center,l),ne(ee),...K.trace.route]},length:re.reduce((Z,te)=>Z+Gt(te.start,te.end),0)}});if(!q0({...e,plans:[...e.acceptedPlans,...j],sharedBoundary:t.sharedBoundary}))return null;for(let Y of j)for(let X of o){if(Y.connectionIndex===X.connectionIndex)continue;for(let K of Y.segments){if(X.via.spanLayers.includes(K.layer)&&Hr(X.via.center,K.start,K.end)<X.via.diameter/2+r/2+i-0.0000001)return null;for(let J of X.segments)if(J.layer===K.layer&&Hh(K.start,K.end,J.start,J.end)<r+i-0.0000001)return null}for(let K of Y.additionalVias){if(Gt(K.center,X.via.center)<e.viaDiameter+i-0.0000001)return null;for(let J of X.segments)if(K.spanLayers.includes(J.layer)&&Hr(K.center,J.start,J.end)<e.viaDiameter/2+r/2+i-0.0000001)return null}}return j}function*A3n(e){if(e.buses.some((p)=>p.termination.type==="boundary")&&e.buses.every((p)=>p.termination.type==="plane"||p.exitEdge==="left")){let p=u8e(e),m=yield*A3n(p);if(!m)return null;let A=u8e(m),g=new Map(e.buses.flatMap((f)=>f.connections.map((y)=>[y.connectionIndex,y])));return A.map((f)=>({...f,sourceObstacle:g.get(f.connectionIndex).sourceObstacle}))}let{buses:t,sourceEscapes:n,initialPlans:o}=e,r=new Map(n.map((p)=>[p.connectionIndex,p])),i=new Set(o.map((p)=>p.connectionIndex)),s=t.filter((p)=>p.connections.some((m)=>!i.has(m.connectionIndex)));if(s.some((p)=>p.connections.some((m)=>i.has(m.connectionIndex))))throw Error("FanoutSolver: a reserved-source continuation cannot start with a partially committed bus");for(let p of s)for(let m of p.connections)if(!r.has(m.connectionIndex))throw Error(`FanoutSolver: missing reserved source escape for ${m.connection.name}`);let a=new Map(n.map((p)=>[p.connectionIndex,p.via.center])),c=new Map(n.map((p)=>[p.connectionIndex,[p.segments[0].start,...p.segments.map((m)=>m.end)]])),l=[...o],h=(p)=>{let m=e.targetLayerByBusId?.get(p.busId)??(p.allowedLayers??e.layerNames).find((A)=>A!==p.connections[0].sourceLayer);return o.filter((A)=>A.targetLayer===m).length},d=s.filter((p)=>p.termination.type==="boundary").sort((p,m)=>m.connections.length-p.connections.length||h(p)-h(m)),u=new Set;for(let p of[...d,...s.filter((m)=>m.termination.type==="plane")]){if(u.has(p.busId))continue;if(p.termination.type==="boundary"&&p.connections.length<=2&&e.targetLayerByBusId){let x=e.targetLayerByBusId.get(p.busId);if(!x)return null;let C=d.filter((I)=>I.connections.length<=2&&e.targetLayerByBusId.get(I.busId)===x),b=yield*bzr({...e,buses:C,targetLayer:x,acceptedPlans:l,fixedViaPointsByConnectionIndex:a,sourceEscapePaths:c,reservedVias:n.map((I)=>({connectionName:I.connectionName,via:I.via}))});if(!b)return null;l.push(...b);for(let I of C)u.add(I.busId);continue}let m=new Set(p.connections.map((x)=>x.connectionIndex)),A=n.filter((x)=>!m.has(x.connectionIndex)).map((x)=>({connectionName:x.connectionName,via:x.via,...x.segments.length===1?{sourceEscapeSegment:x.segments[0]}:{}})),g=e.targetLayerByBusId?.get(p.busId),f=g?[g]:p.termination.type==="plane"?[p.termination.layer]:(p.routableEscapeLayers??p.allowedLayers??e.layerNames).filter((x)=>x!==p.connections[0].sourceLayer),y;for(let x of f){let C={...e,bus:p,targetLayer:x,acceptedPlans:l,fixedViaPointsByConnectionIndex:a,sourceEscapePaths:c,reservedVias:A};if(e.sourceBoundary&&p.termination.type==="boundary"&&p.connections.length>2){for(let I of[g3n,Izr,xzr,Czr]){let v=I({...C,sourceBoundary:e.sourceBoundary}),P=v.next();while(!P.done)yield{phase:"via-minimal-winding",busId:p.busId,targetLayer:x,winding:P.value},P=v.next();if(P.value){y=P.value;break}}if(y)break}let b=yield*_7e({...e,bus:p,targetLayer:x,acceptedPlans:l,fixedViaPointsByConnectionIndex:a,sourceEscapePaths:c,reservedVias:A,viaMinimalOnly:!0,adaptiveWindingRouteOrder:!0,alignWindingGridToPads:!0,windingGridStep:(e.traceWidth+e.clearance)/2,fixedViaFallbackRouteOrderAttempts:32},1,!1);if(b.length){y=b[0];break}}if(!y)return null;l.push(...y)}let _=t[0]?.sharedBoundary;if(!_||!q0({...e,plans:l,sharedBoundary:_}))return null;return l}function*vzr(e,t){let n={reserveFutureApproaches:!0,failedNarrowGroup:!1,failedWideMatching:!1},o=yield*t(n);if(o||!e||!n.failedNarrowGroup&&!n.failedWideMatching)return o;return yield*t({reserveFutureApproaches:!1,failedNarrowGroup:!1,failedWideMatching:!1})}function f3n(e){let{buses:t,fixedViaPointsByConnectionIndex:n,clearance:o}=e,r=t[0];if(!r?.exitEdge||t.some((c)=>c.componentId!==r.componentId||c.exitEdge!==r.exitEdge||c.termination.type!=="boundary"||c.connections.length>2||c.allowedLayers?.length!==1||c.allowedLayers[0]==="top"||c.connections.some((l)=>l.sourceLayer!=="top")))return!1;let i=r.exitEdge==="left"||r.exitEdge==="right"?"x":"y",s=r.exitEdge==="top"||r.exitEdge==="right"?1:-1,a=0;for(let c of t){if(c.connections.length!==2||c.maxLengthSkew===void 0||c.maxLengthSkew>=Math.min(c.pitchX,c.pitchY))continue;let l=c.componentBounds,h=i==="x"?s>0?l.minX:l.maxX:s>0?l.minY:l.maxY,d=c.connections.map((u)=>({source:u.sourcePoint,via:n.get(u.connectionIndex)}));if(d.some((u,_)=>{let p=d[1-_];if(!u.via||!p.via)return!1;return s*(u.via[i]-h)<-0.0000001&&p.via.x>=l.minX&&p.via.x<=l.maxX&&p.via.y>=l.minY&&p.via.y<=l.maxY&&s*(p.via[i]-p.source[i])>o}))a++}return a>=2}function Szr(e){return e.groups.filter((t)=>f3n({...e,buses:t}))}function y3n(e){return e.completedBuses.filter((t)=>e.selectedBusIds.has(t.busId)&&t.termination.type==="boundary"&&t.connections.length>2&&t.allowedLayers?.length===1&&t.maxLengthSkew!==void 0)}function x3n(e){return y3n(e).some((t)=>{let n=e.plans.filter((r)=>r.busId===t.busId),o=Math.min(...n.map((r)=>r.length))+t.maxLengthSkew;return n.some((r)=>r.segments.slice(0,r.sourceEscapeSegmentCount??1).reduce((i,s)=>i+Gt(s.start,s.end),0)>o+0.000001)})}function*Pzr(e){let{inputSrj:t,preparedBuses:n,completedBuses:o,selectedBusIds:r}=e;if(!x3n(e))return null;let i=y3n(e),s=n.flatMap((m)=>m.connections),a=new Map(s.map((m)=>[m.connectionIndex,m])),c=(m)=>{if(a.size!==t.connections.length||m.length!==a.size||new Set(m.map((A)=>A.connectionIndex)).size!==a.size||m.some((A)=>{let g=a.get(A.connectionIndex);return g?.connection.name!==A.connectionName||g.sourceObstacle!==A.sourceObstacle}))throw Error("Wide source length repair requires every original source")};c(e.plans);let l=new Set(o.map((m)=>m.busId)),h=n.filter((m)=>m.termination.type==="boundary"&&!l.has(m.busId)),d=GJ({...e,preparedBuses:o,allowBlindAndBuriedVias:!1,allowSameNetMerges:!1,allowSourcePrefixShortcuts:!0});if(!d)return null;let u=d,_=()=>{let m=u,A=Ey({...e,plans:u,preparedBuses:o,sharedBoundary:i[0].sharedBoundary,allowBlindAndBuriedVias:!1,allowSameNetMerges:!1,allowMatchingInsideDenseBounds:!0,allowSourcePrefixMatching:!0,allowTransitLayerMatching:!0,allowDistributedMatching:!0,allowPairLaneSpreading:!0,allowUnconstrainedLaneRerouting:!0,unroutedSourceBuses:h,maximumWorkUnits:1e5,candidatePlansAreFeasible:(g)=>(c(g),m=[...g],!0)});return u=A.plans??m,A},p=_();if(!p.plans){let m=p.failedBus;if(!i.some((b)=>b.busId===m.busId))return null;let A=u.filter((b)=>b.busId===m.busId),g=Math.max(...A.map((b)=>b.length)),f=A.filter((b)=>g-b.length>m.maxLengthSkew+0.000001);if(f.length!==1||u.some((b)=>!b.via))return null;let y=f[0],x=a.get(y.connectionIndex),C=yield*t3({...e,srj:t,allBuses:n,buses:[{...m,connections:[x]}],targetLayer:y.targetLayer,transitLayers:[],terminals:[{connection:x,viaPoint:y.via.center,exitPoint:y.exitPoint}],fixedViaPointsByConnectionIndex:new Map(u.map((b)=>[b.connectionIndex,b.via.center])),sourceEscapePaths:new Map(u.map((b)=>[b.connectionIndex,[b.sourcePoint,...b.segments.slice(0,b.sourceEscapeSegmentCount??1).map((I)=>I.end)]])),acceptedPlans:u.filter((b)=>b!==y),routeFromSourcePads:!0,sourceLayerTravelCost:3,includeDiagonalNeighbors:!0,tightViaChannels:!0,ripCost:64,shuffleSeed:1,maximumIterations:2000000,maximumLocalRepairAttempts:0});if(!C||C.length!==1)return null;u=u.map((b)=>b===y?C[0]:b),p=_()}if(!p.plans)return null;return c(p.plans),kd({inputSrj:t,routedSrj:{...t,traces:[...t.traces??[],...p.plans.flatMap((m)=>[m.trace,...m.planeEndpointTrace?[m.planeEndpointTrace]:[]])]},clearance:e.clearance,allowBlindAndBuriedVias:!1}).valid?p.plans:null}function Ezr(e){let{buses:t,targetLayer:n,exits:o,layerNames:r,viaDiameter:i,clearance:s}=e,a=t[0];if(!a?.exitEdge||t.length<2||t.some((g)=>g.termination.type!=="boundary"||g.connections.length<=2||g.componentId!==a.componentId||g.exitEdge!==a.exitEdge||g.connections.some((f)=>f.sourceLayer!=="top")))return!1;let c=(g)=>g.routableEscapeLayers??g.allowedLayers??r;if(n==="top"||t.some((g)=>!c(g).includes(n))||!r.some((g)=>g!=="top"&&g!==n&&t.every((f)=>c(f).includes(g))))return!1;let l=t.flatMap((g)=>g.connections),h=a.exitEdge==="left"||a.exitEdge==="right"?"y":"x",d=l.map((g)=>o.get(g.connectionIndex)?.[h]);if(d.some((g)=>g===void 0||!Number.isFinite(g)))return!1;if(Math.max(...d)-Math.min(...d)>=(l.length-1)*(i+s)-0.00000001)return!1;let _=l.reduce((g,f)=>({x:g.x+f.sourcePoint.x/l.length,y:g.y+f.sourcePoint.y/l.length}),{x:0,y:0}),p=a.componentBounds,m=Math.min(Math.abs(_.x-p.minX),Math.abs(_.x-p.maxX)),A=Math.min(Math.abs(_.y-p.minY),Math.abs(_.y-p.maxY));return h==="x"?m+0.00000001<A:A+0.00000001<m}function Mzr(e){let t=e.length*(e.length-1)/2;if(t===0)return!1;let n=0;for(let o=0;o<e.length;o++){let r=e[o];for(let i of e.slice(o+1))if(Hh(r.source,r.target,i.source,i.target)<0.0000001&&++n>t/2)return!0}return!1}var wzr=class{constructor(e){if(this.options=e,this.pending=[e.preferSourceTransit?{ripCost:e.sourceTransitRipCost??8,shuffleSeed:1,transitLayers:e.allTransitLayers}:{ripCost:e.firstRipCost,shuffleSeed:1,transitLayers:e.transitLayers}],e.preferAlternateOrder)this.originalOrder=this.pending[0],this.preferredOrder={...this.originalOrder,shuffleSeed:2},this.pending[0]=this.preferredOrder;if(e.preferSourceOrigin)this.pending.unshift({ripCost:e.sourceOriginRipCost??256,shuffleSeed:1,transitLayers:[],routeFromSourcePads:!0})}options;pending;attempted=new Set;preferredOrder;originalOrder;next(){while(this.pending.length>0){let e=this.pending.shift(),t=JSON.stringify(e);if(this.attempted.has(t))continue;return this.attempted.add(t),e}return}failed(e,t){if(e.routeFromSourcePads)return;let n=(o)=>{if(!this.attempted.has(JSON.stringify(o)))this.pending.unshift(o)};if(e===this.preferredOrder){if(n(this.originalOrder),t==="lengths")this.pending.push({...this.originalOrder,ripCost:256});return}if(e.sourceLayerTravelCost!==void 0){let{reserveFutureApproaches:o,sourceLayerTravelCost:r,maximumSourceIterations:i,...s}=e;if(o===!1&&t==="routing")n({...s,sourceLayerTravelCost:4,reserveFutureApproaches:!0});else this.failed(s,"lengths");return}if(e.sourceOriginPhysicalGridPhase){let{sourceOriginPhysicalGridPhase:o,...r}=e;n({...r,ripCost:256,shuffleSeed:1});return}if(this.options.preferSourceTransit&&e.ripCost===(this.options.sourceTransitRipCost??8)&&e.transitLayers.length===this.options.allTransitLayers.length)n({ripCost:this.options.firstRipCost,shuffleSeed:1,transitLayers:this.options.transitLayers});else if(this.options.wideSingleLayer){if(t==="lengths"&&e.ripCost===64){let o={...e,shuffleSeed:1,sourceLayerTravelCost:3,maximumSourceIterations:20000000,reserveFutureApproaches:!1},r={...e,shuffleSeed:1,sourceOriginPhysicalGridPhase:!0};if(this.options.retrySourceOriginFreshReservations&&!this.attempted.has(JSON.stringify(o)))n(o);else if(this.options.retrySourceOriginPhysicalGridPhase&&!this.attempted.has(JSON.stringify(r)))n(r);else n({...e,ripCost:256,shuffleSeed:1})}if(t==="routing"&&e.shuffleSeed===1)n({...e,ripCost:64,shuffleSeed:2})}else if(e.transitLayers.length<this.options.allTransitLayers.length){let o={ripCost:t==="lengths"?8:this.options.firstRipCost,shuffleSeed:1,transitLayers:this.options.allTransitLayers};if(t==="routing"&&o.ripCost!==256&&this.attempted.has(JSON.stringify(o)))n({...o,ripCost:256});else n(o)}else if(t==="routing"&&e.ripCost!==256)n({...e,ripCost:256})}};function Bzr(e){let t=e.traceWidth+e.clearance;if(!Number.isFinite(t)||!(e.traceWidth>0)||e.clearance<0)throw Error("Boundary approach reservations require valid trace rules");return e.buses.filter((n)=>n.termination.type==="boundary"&&!e.excludedBusIds.has(n.busId)).flatMap((n)=>{let o=e.targetLayerByBusId.get(n.busId);if(!o||!n.exitEdge)throw Error(`Missing boundary approach layer or edge for ${n.busId}`);return n.connections.map((r)=>{let i=e.exits.get(r.connectionIndex);if(!i)throw Error(`Missing boundary approach target for ${r.connectionIndex}`);let s={...i};if(n.exitEdge==="bottom")s.y+=t;else if(n.exitEdge==="top")s.y-=t;else if(n.exitEdge==="left")s.x+=t;else s.x-=t;return{type:"pcb_trace",pcb_trace_id:`fanout-approach-reservation:${r.connectionIndex}`,connection_name:r.connection.name,route:[s,i].map((a)=>({route_type:"wire",...a,layer:o,width:e.traceWidth}))}})})}function Tzr(e){let t={minX:1/0,maxX:-1/0,minY:1/0,maxY:-1/0};for(let n of e){let o=n,r=(o.ccwRotationDegrees??0)*Math.PI/180,i=n.width/2,s=n.height/2,a=o.shape==="circle"?i:Math.abs(Math.cos(r))*i+Math.abs(Math.sin(r))*s,c=o.shape==="circle"?s:Math.abs(Math.sin(r))*i+Math.abs(Math.cos(r))*s;t.minX=Math.min(t.minX,n.center.x-a),t.maxX=Math.max(t.maxX,n.center.x+a),t.minY=Math.min(t.minY,n.center.y-c),t.maxY=Math.max(t.maxY,n.center.y+c)}return t}function Dzr(e,t){let n=e.filter((u)=>u.termination.type==="boundary"),o=n[0]?.exitEdge;if(!o||n.some((u)=>u.exitEdge!==o))return[...e];let r=n.flatMap((u)=>u.connections),i={x:(t.minX+t.maxX)/2,y:(t.minY+t.maxY)/2},s=r.reduce((u,_)=>u+_.sourcePoint.x-i.x,0),a=r.reduce((u,_)=>u+_.sourcePoint.y-i.y,0);if(Math.hypot(s,a)<0.000000001)return[...e];let c=["right","up","left","down"],l=Math.abs(s)>=Math.abs(a)?s>=0?"right":"left":a>=0?"up":"down",h=o==="top"?"up":o==="bottom"?"down":o,d=c.indexOf(l)-c.indexOf(h);return e.map((u)=>u.termination.type==="plane"?u:{...u,direction:c[(c.indexOf(u.direction)+d+4)%4]})}function Nzr(e){return e.flatMap((t)=>{let n=[t.connectionName],o=[t.sourceLayer],r=[];if(t.via)r.push({type:"rect",shape:"circle",center:t.via.center,width:t.via.diameter,height:t.via.diameter,connectedTo:n,layers:o});for(let i of t.segments){let{start:s,end:a,width:c}=i,l=a.x-s.x,h=a.y-s.y;r.push({type:"rect",center:{x:(s.x+a.x)/2,y:(s.y+a.y)/2},width:Math.hypot(l,h),height:c,ccwRotationDegrees:Math.atan2(h,l)*180/Math.PI,connectedTo:n,layers:o})}for(let i of[t.sourcePoint,...t.segments.map((s)=>s.end)])r.push({type:"rect",shape:"circle",center:i,width:t.segments[0]?.width??0,height:t.segments[0]?.width??0,connectedTo:n,layers:o});return r})}function*Rzr(e){let{srj:t,buses:n,layerNames:o,traceWidth:r,clearance:i,viaDiameter:s,viaHoleDiameter:a}=e,c=n[0];if(!c||n.some((N)=>N.componentId!==c.componentId||N.connections.some((D)=>D.sourceLayer!=="top")))return null;let l=c.componentObstacles.filter((N)=>N.layers.includes("top"));if(!l.length)return null;let h=Tzr(l),d=Math.max(c.pitchX,c.pitchY),u=r+i;if(!Number.isFinite(d)||d<=0)return null;let _={x:(h.minX+h.maxX)/2,y:(h.minY+h.maxY)/2},p=Math.ceil(((h.maxX-h.minX)/2+d+u)/u)*u,m=Math.ceil(((h.maxY-h.minY)/2+d+u)/u)*u,A={minX:_.x-p,maxX:_.x+p,minY:_.y-m,maxY:_.y+m};if(n.some((N)=>A.minX<=N.sharedBoundary.minX||A.maxX>=N.sharedBoundary.maxX||A.minY<=N.sharedBoundary.minY||A.maxY>=N.sharedBoundary.maxY))return null;let g=new Map;for(let N of n){if(N.termination.type!=="boundary"||N.allowedLayers?.length!==1||N.allowedLayers[0]==="top")continue;let D=N.allowedLayers[0];g.set(D,[...g.get(D)??[],N])}let f=[...g].sort(([N,D],[L,H])=>Math.max(...H.map((V)=>V.connections.length))-Math.max(...D.map((V)=>V.connections.length))||N.localeCompare(L));if(!f.length)return null;let y=new Map(n.flatMap((N)=>N.connections.map((D)=>[D.connectionIndex,{bus:N,connection:D}])));if(y.size!==n.reduce((N,D)=>N+D.connections.length,0))throw Error("FanoutSolver: source preparation requires unique connection indices");let x=Dzr(n,h),C={traceWidth:r,clearance:i,viaDiameter:s,viaHoleDiameter:a,maximumSearchStates:e.maximumSearchStates??1e4,additionalObstacles:t.obstacles},b=e.initialViaPointsByConnectionIndex;if(b&&(b.size!==y.size||[...b].some(([N,D])=>!y.has(N)||!Number.isFinite(D.x)||!Number.isFinite(D.y))))throw Error("FanoutSolver: initial source sites must contain every connection exactly once");let I=Yu(x,{...C,fixedViaPointsByConnectionIndex:b});if(!I)return null;let v=(N,D,L)=>{let{bus:H,connection:V}=y.get(N),O=H.termination.type==="plane"?H.termination.layer:(H.allowedLayers??o).filter((U)=>U!==V.sourceLayer).at(-1);if(!O)throw Error("FanoutSolver: source through-via preparation requires a non-source target layer");return Ob({...e,allowBlindAndBuriedVias:!1,bus:H,terminal:{connection:V,viaPoint:D,exitPoint:D},targetLayer:O,targetLayerPoints:[D],sourceEscapePoints:L})},P=(N,D)=>[...y.keys()].map((L)=>v(L,N.get(L),D.get(L))),M=(N)=>kd({inputSrj:t,routedSrj:{...t,traces:[...t.traces??[],...N.map((D)=>D.trace)]},clearance:i,allowBlindAndBuriedVias:!1}).valid,B={sourceBoundary:A,fixedViaPointsByConnectionIndex:I,sourceEscapePaths:new Map([...I].map(([N,D])=>[N,[y.get(N).connection.sourcePoint,D]])),sourcePlans:[],prefixPlans:[],remotePlans:[],layerGroups:[]};if(B.sourcePlans=P(I,B.sourceEscapePaths),!M(B.sourcePlans))return null;let T=Math.max(d,s/2+r/2+i);for(let[N,D]of f){let L=new Set(D.flatMap((J)=>J.connections.map((ee)=>ee.connectionIndex))),H=new Set(B.remotePlans.map((J)=>J.connectionIndex)),V=new Map([...B.fixedViaPointsByConnectionIndex].filter(([J])=>!L.has(J)&&!H.has(J))),O={...t,obstacles:[...t.obstacles,...Nzr(B.sourcePlans.filter((J)=>!L.has(J.connectionIndex)))]},U=D.flatMap((J)=>J.connections.map((ee)=>({...J,busId:`${J.busId}:source-${ee.connectionIndex}`,sharedBoundary:A,preferredExit:void 0,exitEdge:void 0,connections:[{...ee,exitTargetPoint:void 0,hasExplicitLayeredExitTarget:!1}]}))),j=null,Y=0,X=(J)=>{if(J.length<=Y)return;let ee=J.map((de)=>({...de,busId:y.get(de.connectionIndex).bus.busId,sourceObstacle:y.get(de.connectionIndex).connection.sourceObstacle,sourceEscapeSegmentCount:de.segments.length}));if(!q0({plans:ee,srj:O,sharedBoundary:A,clearance:i,allowBlindAndBuriedVias:!1,allowSameNetMerges:!1}))return;let se=[],ne=new Map;for(let de of ee){let me=de.exitPoint,ge=Math.abs(me.x-A.maxX)<0.0000001?{x:T,y:0}:Math.abs(me.x-A.minX)<0.0000001?{x:-T,y:0}:Math.abs(me.y-A.maxY)<0.0000001?{x:0,y:T}:Math.abs(me.y-A.minY)<0.0000001?{x:0,y:-T}:null;if(!ge)throw Error("FanoutSolver: source prefix does not end on its source boundary");let xe={x:me.x+ge.x,y:me.y+ge.y},Ee=y.get(de.connectionIndex).bus.sharedBoundary;if(xe.x<Ee.minX||xe.x>Ee.maxX||xe.y<Ee.minY||xe.y>Ee.maxY)return;let Re=[de.sourcePoint,...de.segments.map((Me)=>Me.end),xe];ne.set(de.connectionIndex,Re),se.push(v(de.connectionIndex,xe,Re))}let re=[...B.remotePlans,...se];if(!M(re))return;let Z=new Set(re.map((de)=>de.connectionIndex)),te=x.map((de)=>({...de,connections:de.connections.filter((me)=>!Z.has(me.connectionIndex))})).filter((de)=>de.connections.length),ie=Yu(te,{...C,fixedViaPointsByConnectionIndex:V,preferredViaPointsByConnectionIndex:B.fixedViaPointsByConnectionIndex,blockingSegments:re.flatMap((de)=>de.segments.map((me)=>({connectionIndex:de.connectionIndex,segment:me}))),blockingVias:re.map((de)=>({connectionIndex:de.connectionIndex,center:de.via.center,diameter:de.via.diameter,spanLayers:de.via.spanLayers}))});if(!ie)return;let ce=new Map([...ie,...re.map((de)=>[de.connectionIndex,de.via.center])]);if(ce.size!==y.size)throw Error("FanoutSolver: source preparation lost a connection");for(let de of H)ne.set(de,B.sourceEscapePaths.get(de));for(let[de,me]of ie)ne.set(de,[y.get(de).connection.sourcePoint,me]);let ue=P(ce,ne);if(!M(ue))return;Y=J.length,j={sourceBoundary:A,fixedViaPointsByConnectionIndex:ce,sourceEscapePaths:ne,sourcePlans:ue,prefixPlans:[...B.prefixPlans,...ee],remotePlans:re,layerGroups:[...B.layerGroups,{layer:N,connectionCount:L.size,escapedCount:J.length}]}},K=yield*MY({srj:O,buses:U,traceWidth:r,clearance:i,onPartialRoutes:X});if(K)X(K);if(j)B=j;else B.layerGroups.push({layer:N,connectionCount:L.size,escapedCount:0})}return B.remotePlans.length?B:null}function Qzr(e,t){return e.some((n)=>{if(!f7e([n]))return!1;let o=n.exitEdge==="left"||n.exitEdge==="right"?"x":"y",r=o==="x"?"y":"x",i=n.exitEdge==="left"||n.exitEdge==="bottom"?-1:1,s=o==="x"?(n.componentBounds.minX+n.componentBounds.maxX)/2:(n.componentBounds.minY+n.componentBounds.maxY)/2,a=n.connections.map((c)=>t.get(c.connectionIndex)?.[r]);if(a.some((c)=>c===void 0||!Number.isFinite(c)))return!1;return e.some((c)=>{if(c.termination.type!=="boundary"||c.connections.length!==2||c.componentId!==n.componentId||c.exitEdge!==n.exitEdge||c.allowedLayers?.length!==1||c.allowedLayers[0]===n.allowedLayers[0]||!c.connections.every((d)=>i*(d.sourcePoint[o]-s)<-0.0000001))return!1;let l=c.connections.map((d)=>t.get(d.connectionIndex)?.[r]);if(l.some((d)=>d===void 0||!Number.isFinite(d)))return!1;let h=c.connections.flatMap((d)=>{let u=d.sourceObstacle?.center[r]??d.sourcePoint[r],_=((r==="x"?d.sourceObstacle?.width:d.sourceObstacle?.height)??0)/2;return[u-_,u+_]});return Math.max(Math.min(...a),Math.min(...l),Math.min(...h))<=Math.min(Math.max(...a),Math.max(...l),Math.max(...h))})})}function kzr(e,t){return e.some((n)=>{if(!f7e([n]))return!1;let o=n.exitEdge==="left"||n.exitEdge==="right"?"y":"x",r=n.connections.map((a)=>t.get(a.connectionIndex)?.[o]);if(r.some((a)=>a===void 0||!Number.isFinite(a)))return!1;let i=o==="x"?n.componentBounds.minX:n.componentBounds.minY,s=o==="x"?n.componentBounds.maxX:n.componentBounds.maxY;return Math.min(...r)<=s+0.0000001&&Math.max(...r)>=i-0.0000001})}var fS=0.000001,Rhe=(e)=>Math.max(...e.map((t)=>t.length))-Math.min(...e.map((t)=>t.length));function Lzr(e,t){let n=e.trace.route.findIndex((i)=>i.route_type==="via"),o=t.trace.route.findIndex((i)=>i.route_type==="via");if(n<0||o<0)return null;let r=[...e.trace.route.slice(0,n+1),...t.trace.route.slice(o+1)];return r[r.length-1]=e.trace.route.at(-1),{...e,trace:{...e.trace,route:r},segments:[...e.segments.slice(0,e.sourceEscapeSegmentCount??1),...t.segments.slice(t.sourceEscapeSegmentCount??1)],length:t.length}}function*Hzr(e){let{inputSrj:t,preparedBuses:n,layerNames:o,traceWidth:r,clearance:i,viaDiameter:s,viaHoleDiameter:a,maximumPasses:c=3,maximumConnectionAttempts:l=24,maximumSearchStates:h=1200000}=e;for(let[v,P]of[["maximumPasses",c],["maximumConnectionAttempts",l],["maximumSearchStates",h]])if(!Number.isSafeInteger(P)||P<1)throw Error(`FanoutSolver: ${v} must be a positive safe integer`);let d=new Map(e.plans.map((v)=>[v.connectionIndex,v])),u=n.flatMap((v)=>v.connections);if(d.size!==e.plans.length||d.size!==t.connections.length||u.length!==d.size||u.some((v)=>d.get(v.connectionIndex)?.connectionName!==v.connection.name))throw Error("FanoutSolver: overlong-lane rerouting requires every original plan");let _=n.filter((v)=>v.termination.type==="boundary"&&(!e.selectedBusIds||e.selectedBusIds.has(v.busId))),p=_.filter((v)=>v.maxLengthSkew!==void 0&&v.connections.length>1),m=[...e.plans],A=new Map;for(let v of m){if(!v.via)continue;let P=v.segments.slice(0,v.sourceEscapeSegmentCount??1);if(!P.length||P.some((M)=>M.layer!==v.sourceLayer)||Gt(P[0].start,v.sourcePoint)>fS||Gt(P.at(-1).end,v.via.center)>fS||P.some((M,B)=>B>0&&Gt(P[B-1].end,M.start)>fS))continue;A.set(v.connectionIndex,[P[0].start,...P.map((M)=>M.end)])}let g=new Map,f=(r+i)/2,y=0,x=!1,C=(v,P)=>{let M=v.via;return Boolean(M&&!(v.additionalVias?.length??0)&&!v.planeEndpointTrace&&!v.planeEndpointVia&&A.has(v.connectionIndex)&&M.fromLayer===v.sourceLayer&&M.toLayer===v.targetLayer&&M.diameter===s&&M.holeDiameter===a&&M.spanLayers.length===o.length&&o.every((B)=>M.spanLayers.includes(B))&&(P.routableEscapeLayers??P.allowedLayers??o).includes(v.targetLayer)&&v.segments.slice(v.sourceEscapeSegmentCount??1).every((B)=>B.layer===v.targetLayer))};function*b(v,P,M,B,T){if(y>=l||!C(v,M))return null;y++;let N=G2({srj:t,bus:M,targetLayer:v.targetLayer,terminals:[{connection:M.connections.find((H)=>H.connectionIndex===v.connectionIndex),viaPoint:v.via.center,exitPoint:v.exitPoint}],acceptedPlans:P.filter((H)=>H.connectionIndex!==v.connectionIndex),layerNames:o,traceWidth:r,clearance:i,viaDiameter:s,viaHoleDiameter:a,allowBlindAndBuriedVias:!1,sourceEscapePaths:A,gridStepDivisor:2,gridStep:f,gridOrigin:B,alignGridToPads:!0,heuristicWeight:1,maximumRouteOrderAttempts:1,maximumSearchStates:h,preferTargetDirectedLaneBias:!0},1,!1),D=N.next();while(!D.done)yield{...D.value,busId:M.busId,pass:T,connectionAttempt:y},D=N.next();let L=D.value[0]?.[0];return L?Lzr(v,L):null}for(let v of p){let P=m.filter((T)=>T.busId===v.busId),M=Rhe(P);if(M<=v.maxLengthSkew+fS)continue;let B=[...m];for(let T=0;T<c;T++){let N=Math.min(...P.map((H)=>H.length)),D=!1,L=P.filter((H)=>H.length>N+v.maxLengthSkew+fS).toSorted((H,V)=>V.length-H.length||H.connectionIndex-V.connectionIndex);for(let H of L){if(y>=l)break;let V=H.targetLayer;if(!C(H,v))continue;let O=g.get(V);if(!O)O=Rot({vias:m.flatMap((X)=>[X.via,...X.additionalVias??[],X.planeEndpointVia].filter((K)=>K?.spanLayers.includes(V)).map((K)=>({connectionIndex:X.connectionIndex,center:K.center,diameter:K.diameter}))),activeConnectionIndices:new Set(_.flatMap((X)=>X.connections.filter((K)=>d.get(K.connectionIndex)?.targetLayer===V).map((K)=>K.connectionIndex))),traceWidth:r,clearance:i,gridStep:f}),g.set(V,O);let U=yield*b(H,m,v,O,T);if(!U||U.length>=H.length-fS)continue;let j=m.filter((X)=>X.busId===v.busId),Y=j.map((X)=>X.connectionIndex===H.connectionIndex?U:X);if(Rhe(Y)>Rhe(j)+fS){if(j.length!==2)continue;let X=j.find((ee)=>ee!==H);if(X.targetLayer!==V)continue;let K=m.map((ee)=>ee===H?U:ee),J=yield*b(X,K,v,O,T);if(!J||J.length>=X.length-fS||Rhe([U,J])>v.maxLengthSkew+fS)continue;m=K.map((ee)=>ee===X?J:ee)}else m=m.map((X)=>X===H?U:X);D=!0}if(P=m.filter((H)=>H.busId===v.busId),!D||y>=l)break}if(Rhe(P)<M-fS)x=!0;else m=B;if(y>=l)break}if(!x)return m;return kd({inputSrj:t,routedSrj:{...t,traces:[...t.traces??[],...m.flatMap((v)=>[v.trace,...v.planeEndpointTrace?[v.planeEndpointTrace]:[]])]},clearance:i,allowBlindAndBuriedVias:!1}).valid?m:null}var GQ=0.000001,M9e=(e)=>Math.max(...e.map((t)=>t.length))-Math.min(...e.map((t)=>t.length));function*Fzr(e){let{inputSrj:t,preparedBuses:n,layerNames:o,traceWidth:r,clearance:i,viaDiameter:s,viaHoleDiameter:a,maximumConnectionAttempts:c=8,maximumIterationsPerConnection:l=30000000}=e;for(let[y,x]of[["maximumConnectionAttempts",c],["maximumIterationsPerConnection",l]])if(!Number.isSafeInteger(x)||x<1)throw Error(`FanoutSolver: ${y} must be a positive safe integer`);let h=new Map(e.plans.map((y)=>[y.connectionIndex,y])),d=n.flatMap((y)=>y.connections);if(d.length!==t.connections.length||h.size!==e.plans.length||h.size!==d.length||d.some((y)=>h.get(y.connectionIndex)?.connectionName!==y.connection.name))throw Error("FanoutSolver: transit length repair requires every original plan");let u=n.filter((y)=>y.termination.type==="boundary"&&y.maxLengthSkew!==void 0&&y.connections.length>1&&(!e.busIds||e.busIds.includes(y.busId))),_=[...e.plans],p=u.filter((y)=>M9e(_.filter((x)=>x.busId===y.busId))>y.maxLengthSkew+GQ);if(!p.length)return _;let m=new Map,A=new Map;for(let y of d){let x=h.get(y.connectionIndex);if(!x.via)return null;let C=x.segments.slice(0,x.sourceEscapeSegmentCount??1);if(!C.length||C.some((b)=>b.layer!==y.sourceLayer)||Gt(C[0].start,y.sourcePoint)>GQ||Gt(C.at(-1).end,x.via.center)>GQ||C.some((b,I)=>I>0&&Gt(C[I-1].end,b.start)>GQ))return null;m.set(y.connectionIndex,x.via.center),A.set(y.connectionIndex,[C[0].start,...C.map((b)=>b.end)])}let g=0;for(let y of p){let x=_.filter((P)=>P.busId===y.busId);if(x.length!==y.connections.length)return null;let C=x[0].targetLayer,b=y.routableEscapeLayers??y.allowedLayers??o,I=b.filter((P)=>P!==C);if(!b.includes(C)||!I.length||x.some((P)=>P.targetLayer!==C))return null;let v=new Set;while(M9e(x)>y.maxLengthSkew+GQ){let P=Math.min(...x.map((Y)=>Y.length)),M=x.filter((Y)=>!v.has(Y.connectionIndex)&&Y.length>P+y.maxLengthSkew+GQ).toSorted((Y,X)=>X.length-Y.length||Y.connectionIndex-X.connectionIndex)[0];if(!M||g>=c)return null;v.add(M.connectionIndex);let B=M.via;if(M.planeEndpointTrace!==void 0||M.planeEndpointSegments!==void 0||M.planeEndpointVia!==void 0||B.fromLayer!==M.sourceLayer||B.toLayer!==C||B.diameter!==s||B.holeDiameter!==a||B.spanLayers.length!==o.length||!o.every((Y)=>B.spanLayers.includes(Y)))continue;let T=y.connections.find((Y)=>Y.connectionIndex===M.connectionIndex);g++;let N=t3({srj:t,allBuses:n,buses:[{...y,connections:[T]}],targetLayer:C,transitLayers:I,terminals:[{connection:T,viaPoint:B.center,exitPoint:M.exitPoint}],fixedViaPointsByConnectionIndex:m,sourceEscapePaths:A,acceptedPlans:_.filter((Y)=>Y!==M),layerNames:o,traceWidth:r,clearance:i,viaDiameter:s,viaHoleDiameter:a,tightViaChannels:!0,ripCost:64,shuffleSeed:1,maximumRipEvents:1,maximumIterations:l}),D=N.next();while(!D.done)yield{...D.value,busId:y.busId,connectionName:M.connectionName,connectionAttempt:g},D=N.next();let L=D.value?.[0];if(!L||L.length>=M.length-GQ)continue;let H=M.sourceEscapeSegmentCount??1,V=M.trace.route.findIndex((Y)=>Y.route_type==="via"),O=L.trace.route.findIndex((Y)=>Y.route_type==="via");if(V<0||O<0)return null;let U={...M,via:B,additionalVias:L.additionalVias,segments:[...M.segments.slice(0,H),...L.segments.slice(L.sourceEscapeSegmentCount??1)],trace:{...M.trace,route:[...M.trace.route.slice(0,V+1),...L.trace.route.slice(O+1)]},length:L.length},j=x.map((Y)=>Y===M?U:Y);if(M9e(j)>M9e(x)+GQ)continue;_=_.map((Y)=>Y===M?U:Y),x=j}}return kd({inputSrj:t,routedSrj:{...t,traces:[...t.traces??[],..._.flatMap((y)=>[y.trace,...y.planeEndpointTrace?[y.planeEndpointTrace]:[]])]},clearance:i,allowBlindAndBuriedVias:!1}).valid?_:null}function C3n(e){let{buses:t,layerNames:n,traceWidth:o,clearance:r}=e,i=t.filter((p)=>p.termination.type==="boundary"),s=new Map;for(let p of i)if(p.allowedLayers?.length===1){let m=p.allowedLayers[0];s.set(m,(s.get(m)??0)+p.connections.length)}let a=new Map;for(let p of t){let m=new Set(p.connections.map((f)=>f.sourceLayer)),A=(p.routableEscapeLayers??p.allowedLayers??n).filter((f)=>!m.has(f)).toSorted((f,y)=>(s.get(f)??0)-(s.get(y)??0)||n.indexOf(y)-n.indexOf(f)),g=p.termination.type==="plane"?p.termination.layer:A[0];if(!g)return null;a.set(p.busId,g)}let c=kot({...e,targetLayerByBusId:a}),l=new Map(c.tracksByConnectionIndex),h=i3n(t),d=(p)=>p.exitEdge==="left"||p.exitEdge==="right"?"y":"x",u=o+r;for(let p of i){if(p.allowedLayers?.length!==1)continue;let m=d(p),A=p.sharedBoundary,g=m==="y"?A.minY:A.minX,f=m==="y"?A.maxY:A.maxX,y=p.connections.map((P)=>(P.exitTargetPoint??P.targetPoint)[m]),x=y.toSorted((P,M)=>P-M);if(x.some((P,M)=>!Number.isFinite(P)||M>0&&P-x[M-1]<u-0.00000001))continue;let C=x.at(-1)-x[0];if(C>f-g)continue;let b;if(!h.has(p.busId)){let P=Math.max(g-x[0],Math.min(0,f-x.at(-1)));b=y.map((M)=>M+P)}else if(p.connections.length===2){let P=p.connections.map((T)=>l.get(T.connectionIndex)),M=(P[0]+P[1])/2,B=Math.abs(P[1]-P[0]);b=P.map((T)=>M+(T-M)*C/B)}else continue;let I=new Set(p.connections.map((P)=>P.connectionIndex)),v=i.filter((P)=>P.exitEdge===p.exitEdge&&a.get(P.busId)===a.get(p.busId)).flatMap((P)=>P.connections.filter((M)=>!I.has(M.connectionIndex)).map((M)=>l.get(M.connectionIndex)));if(b.some((P)=>P<g||P>f||v.some((M)=>Math.abs(P-M)<u-0.00000001)))continue;for(let[P,M]of p.connections.entries())l.set(M.connectionIndex,b[P])}let _=new Map;for(let p of i)for(let m of p.connections){let A=l.get(m.connectionIndex),g=p.sharedBoundary,f=p.exitEdge==="left"?{x:g.minX,y:A}:p.exitEdge==="right"?{x:g.maxX,y:A}:p.exitEdge==="top"?{x:A,y:g.maxY}:{x:A,y:g.minY};_.set(m.connectionIndex,f)}return{targetLayerByBusId:a,exits:_}}function*zzr(e){let t=new Set,n,o=()=>ztt(e,{reserveFutureApproaches:!1,failedNarrowGroup:!1,failedWideMatching:!1},t,{travelCost:3,maximumIterations:20000000}),r=!1;if(e.sourceOriginRouting&&$it(e.buses)){let s=C3n(e),a={requested:!!s&&kzr(e.buses,s.exits),reached:!1},c=ztt({...e,sourceOriginRouting:!1},{reserveFutureApproaches:!0,failedNarrowGroup:!1,failedWideMatching:!1},t,void 0,a),l=c.next();while(!l.done&&!a.reached)yield l.value,l=c.next();if(l.done){if(l.value)return l.value}else n=c;if(f7e(e.buses)){if(r=!!s&&Qzr(e.buses,s.exits),!r){let h=yield*o();if(h)return h}}}let i=yield*vzr(e.sourceOriginRouting??!1,(s)=>ztt(e,s,t));if(!i&&r)i=yield*o();if(i)return i;return n?yield*n:null}function*ztt(e,t,n,o,r){let{buses:i,srj:s,layerNames:a}=e,c=C3n(e);if(!c)return null;let l=e.sourceOriginRouting?function*(){return dFr(e)}():Rzr(e),h=l.next();while(!h.done)yield{phase:"sources",routedConnectionCount:0},h=l.next();if(!h.value)return null;let{fixedViaPointsByConnectionIndex:d,sourceEscapePaths:u,sourcePlans:_}=h.value,p=[],m=new Set(i.filter((b)=>b.termination.type==="plane").map((b)=>b.busId)),A=new Map;for(let b of i)if(b.termination.type==="boundary"){let I=c.targetLayerByBusId.get(b.busId);A.set(I,[...A.get(I)??[],b])}let g=[...A].sort(([,b],[,I])=>Math.max(...b.map((v)=>v.allowedLayers?.length??a.length))-Math.max(...I.map((v)=>v.allowedLayers?.length??a.length))||Math.max(...I.map((v)=>v.connections.length))-Math.max(...b.map((v)=>v.connections.length))),f=Szr({groups:g.map(([,b])=>b),fixedViaPointsByConnectionIndex:d,clearance:e.clearance}),y=e.sourceOriginRouting&&$it(i),x=y&&!o&&f7e(i),C=!1;for(let[b,I]of g){if(x&&b===g.at(-1)[0]){let J=Jit({buses:I,exits:c.exits});for(let[ee,se]of J)c.exits.set(ee,se)}let v=Math.max(...I.map((J)=>J.connections.length)),P=v>2&&I.every((J)=>J.allowedLayers?.length===1),M=a.filter((J)=>J!==b&&I.every((ee)=>(ee.routableEscapeLayers??ee.allowedLayers??a).includes(J)&&ee.connections.every((se)=>se.sourceLayer!==J))),B=a.filter((J)=>J!==b&&I.every((ee)=>(ee.routableEscapeLayers??ee.allowedLayers??a).includes(J))),T=f3n({buses:I,fixedViaPointsByConnectionIndex:d,clearance:e.clearance}),N=C&&v>2&&M.length===0&&B.length>0,D=C&&v>2&&M.length>0,L=x&&v>2&&M.length===0&&B.length>0,H=p,V=e.sourceOriginRouting&&b===g[0][0]&&P,O=new wzr({wideSingleLayer:P,retrySourceOriginPhysicalGridPhase:V&&!o,retrySourceOriginFreshReservations:V&&!o&&t.reserveFutureApproaches,preferAlternateOrder:!e.sourceOriginRouting&&P&&b===g[0][0]&&f.some((J)=>I.every((ee)=>J.every((se)=>se.componentId===ee.componentId&&se.exitEdge===ee.exitEdge)))||y&&!P&&v>2&&M.length>0&&b===g.at(-1)[0],firstRipCost:v<=2?256:64,transitLayers:M,allTransitLayers:B,sourceOriginRipCost:D?64:256,sourceTransitRipCost:N?64:8,preferSourceOrigin:T||y&&v<=2&&H.length>0||D||Ezr({...e,buses:I,targetLayer:b,exits:c.exits}),preferSourceTransit:!L&&(N||v>2&&M.length===0&&B.length>0&&Mzr(I.flatMap((J)=>J.connections.map((ee)=>({source:d.get(ee.connectionIndex),target:c.exits.get(ee.connectionIndex)})))))}),U=!1,j=!1,Y=0,X={sites:new Map(d),paths:new Map(u),plans:[..._]},K=(J)=>{d.clear();for(let[ee,se]of J.sites)d.set(ee,se);u.clear();for(let[ee,se]of J.paths)u.set(ee,se);_.splice(0,_.length,...J.plans)};for(let J=O.next();J;J=O.next()){let ee=Y++===0;p=H;for(let Se of I)m.delete(Se.busId);let se=J.sourceOriginPhysicalGridPhase||J.sourceLayerTravelCost!==void 0?{sites:new Map(d),paths:new Map(u),plans:[..._]}:void 0,ne=()=>{if(!se)return;K(se)};if(J.sourceLayerTravelCost!==void 0)K(X);let re=J.routeFromSourcePads||J.transitLayers.length<B.length,Z={...e,srj:V&&(J.reserveFutureApproaches??t.reserveFutureApproaches)?{...s,traces:[...s.traces??[],...Bzr({...e,...c,excludedBusIds:new Set(I.map((Se)=>Se.busId))})]}:s,allBuses:i,buses:I,targetLayer:b,transitLayers:J.transitLayers,fixedViaPointsByConnectionIndex:d,sourceEscapePaths:u,acceptedPlans:p,terminals:I.flatMap((Se)=>Se.connections.map((Ne)=>({connection:Ne,viaPoint:d.get(Ne.connectionIndex),exitPoint:c.exits.get(Ne.connectionIndex)}))),tightViaChannels:!0,heuristicWeight:L?2:void 0,ripCost:J.ripCost,maximumRipEvents:400,maximumLocalRepairAttempts:re?0:3,maximumIterations:1e8,shuffleSeed:J.shuffleSeed,sourceOriginPhysicalGridPhase:J.sourceOriginPhysicalGridPhase,sourceLayerTravelCost:J.sourceLayerTravelCost??(V?o?.travelCost:void 0),maximumSourceIterations:J.maximumSourceIterations??(V?o?.maximumIterations:void 0)},te=function*(){if(J.routeFromSourcePads)return yield*t3({...Z,routeFromSourcePads:!0,sourceLayerTravelCost:2,maximumRipEvents:1200,maximumIterations:50000000,maximumLocalRepairAttempts:0});if(!V)return yield*t3(Z);let Se=yield*uFr({...Z,cleanupRetainedBoundaryTails:J.sourceOriginPhysicalGridPhase});if(!Se)return null;d.clear();for(let[Ne,Le]of Se.fixedViaPointsByConnectionIndex)d.set(Ne,Le);u.clear();for(let[Ne,Le]of Se.sourceEscapePaths)u.set(Ne,Le);return _.splice(0,_.length,...Se.sourcePlans),Se.plans}(),ie=te.next();while(!ie.done){if(Hde(ie.value)){let Se=yield ie.value;ie=te.next(Se);continue}yield{phase:"route-layer",layer:b,routedConnectionCount:p.length+ie.value.routedConnectionCount,iterations:ie.value.iterations},ie=te.next()}let ce=ie.value;if(!ce){if(ne(),V&&!J.sourceOriginPhysicalGridPhase&&J.sourceLayerTravelCost===void 0)return t.failedWideMatching=j,null;if(O.failed(J,"routing"),r?.requested&&!e.sourceOriginRouting&&P&&b===g[0][0]&&ee&&J.shuffleSeed===1&&!J.routeFromSourcePads)r.requested=!1,r.reached=!0,yield{phase:"route-layer",layer:b,routedConnectionCount:p.length};continue}p=[...p,...ce];for(let Se of I)m.add(Se.busId);yield{phase:"match-layer",layer:b,routedConnectionCount:p.length};let ue=new Set(p.map((Se)=>Se.connectionIndex)),de=[...p,..._.filter((Se)=>!ue.has(Se.connectionIndex))],me=i.filter((Se)=>m.has(Se.busId));de=GJ({...e,inputSrj:s,plans:de,preparedBuses:me,selectedBusIds:new Set(I.map((Se)=>Se.busId)),allowBlindAndBuriedVias:!1})??de;let ge=J.routeFromSourcePads&&D,xe=J.routeFromSourcePads??!1,Ee=e.sourceOriginRouting===!0&&v<=2&&H.length>0,Re=e.sourceOriginRouting&&P?i.filter((Se)=>Se.termination.type==="boundary"&&!m.has(Se.busId)):void 0,Me=(Se)=>Ey({...e,inputSrj:s,sharedBoundary:i[0].sharedBoundary,plans:de,preparedBuses:me,allowBlindAndBuriedVias:!1,allowSameNetMerges:!1,allowMatchingInsideDenseBounds:!0,allowSourcePrefixMatching:ge,allowPairLaneSpreading:!0,allowUnconstrainedLaneRerouting:!0,unroutedSourceBuses:Re,maximumWorkUnits:Se});function*_e(){let Se=Hzr({...e,inputSrj:s,plans:de,preparedBuses:i,selectedBusIds:new Set(I.map((Le)=>Le.busId))}),Ne=Se.next();while(!Ne.done)yield{phase:"repair-lengths",layer:b,routedConnectionCount:p.length},Ne=Se.next();de=Ne.value??de}if(P)yield*_e();let ye=Me(P?void 0:1000);if(!ye.plans&&x&&v>2&&b===g.at(-1)[0]){let Se=Ey({...e,inputSrj:s,sharedBoundary:i[0].sharedBoundary,plans:de,preparedBuses:me,allowBlindAndBuriedVias:!1,allowSameNetMerges:!1,allowMatchingInsideDenseBounds:!0,allowSourcePrefixMatching:!0,allowTransitLayerMatching:!0,allowDistributedMatching:!0,allowPairLaneSpreading:!0,allowUnconstrainedLaneRerouting:!0,maximumWorkUnits:1e5});if(Se.plans)ye=Se,xe=!0}if(!ye.plans&&!P&&!Ee)yield*_e(),ye=Me(re||(e.sourceOriginRouting||C)&&v>2?1000:void 0);if(!ye.plans&&Ee&&y&&J.routeFromSourcePads){let Se=ge;ge=!0;let Ne=Me(1000);if(Ne.plans)ye=Ne;else ge=Se}if(!ye.plans&&(Ee||ye.failedBus&&J.routeFromSourcePads&&(T||D))){let Se=de,Ne=ge,Le=xe,nt=new Set,dt=Ee?I.filter((rt)=>rt.connections.length===2).length:1;for(let rt=0;rt<dt;rt++){if(!ye.failedBus||ye.plans)break;let pt=ye.failedBus;if(Ee){if(pt.connections.length!==2||!I.some((Lt)=>Lt.busId===pt.busId)||nt.has(pt.busId))break;nt.add(pt.busId)}let ct=a3n({...e,inputSrj:s,plans:de,preparedBuses:i,bus:pt}),Ct=ct.next();while(!Ct.done)yield{phase:"repair-lengths",layer:b,routedConnectionCount:p.length,iterations:Ct.value.iterations},Ct=ct.next();if(!Ct.value)break;if(de=Ct.value,xe=!0,Ee)ge=!0;let kt=function*(){de=GJ({...e,inputSrj:s,plans:de,preparedBuses:me,selectedBusIds:new Set(I.map((Bt)=>Bt.busId)),allowBlindAndBuriedVias:!1})??de;let Lt=Me(1000);if(!Lt.plans&&!Ee)yield*_e(),Lt=Me(1000);return Lt};if(ye=yield*kt(),!ye.plans&&T)ge=!0,ye=yield*kt()}if(Ee&&!ye.plans)de=Se,ge=Ne,xe=Le,yield*_e(),ye=Me()}if(!ye.plans&&e.sourceOriginRouting&&!P&&v>2&&b===g.at(-1)[0]){let Se=de,Ne=ye,Le=ge,nt=xe,dt=t3({...Z,routeFromSourcePads:!0,transitLayers:[],sourceLayerTravelCost:2,ripCost:64,shuffleSeed:1,maximumIterations:30000000,maximumRipEvents:400,maximumLocalRepairAttempts:0}),rt=dt.next();while(!rt.done){if(Hde(rt.value)){let pt=yield rt.value;rt=dt.next(pt);continue}yield{phase:"repair-lengths",layer:b,routedConnectionCount:p.length,iterations:rt.value.iterations},rt=dt.next()}if(rt.value)de=[...H,...rt.value,..._.filter((pt)=>!ue.has(pt.connectionIndex))],de=GJ({...e,inputSrj:s,plans:de,preparedBuses:me,selectedBusIds:new Set(I.map((pt)=>pt.busId)),allowBlindAndBuriedVias:!1})??de,ge=!0,ye=Me(1000),xe=!0;if(!ye.plans)de=Se,ye=Ne,ge=Le,xe=nt}if(ye.plans)de=ye.plans;else{if(o&&V)return null;if(j=!0,re){ne(),O.failed(J,"lengths");continue}let Se=Fzr({...e,inputSrj:s,plans:de,preparedBuses:i,busIds:I.map((Le)=>Le.busId)}),Ne=Se.next();while(!Ne.done)yield{phase:"repair-lengths",layer:b,routedConnectionCount:p.length,iterations:Ne.value.iterations},Ne=Se.next();if(Ne.value)de=Ne.value;else{let Le=hFr({...e,inputSrj:s,plans:de,preparedBuses:i,busIds:I.map((dt)=>dt.busId)}),nt=Le.next();while(!nt.done)yield{phase:"repair-lengths",layer:b,routedConnectionCount:p.length,iterations:nt.value.iterations},nt=Le.next();if(!nt.value){let dt=new Set(I.map((Ct)=>Ct.busId)),rt=e.sourceOriginRouting&&P&&I.every((Ct)=>!n.has(Ct.busId))&&x3n({plans:de,completedBuses:me,selectedBusIds:dt});if(rt)for(let Ct of I)n.add(Ct.busId);let pt=rt?Pzr({...e,inputSrj:s,plans:de,preparedBuses:i,completedBuses:me,selectedBusIds:dt}):void 0,ct=pt?.next();while(ct&&!ct.done)yield{phase:"repair-lengths",layer:b,routedConnectionCount:p.length,iterations:ct.value.iterations},ct=pt.next();if(!ct?.value){ne(),O.failed(J,"lengths");continue}de=ct.value,xe=!0}else de=nt.value}}if(p=de.filter((Se)=>ue.has(Se.connectionIndex)),xe||Re?.length){let Se=new Map([...I,...Re??[]].flatMap((Ne)=>Ne.connections.map((Le)=>{let nt=de.find((pt)=>pt.connectionIndex===Le.connectionIndex);if(!nt.via)throw Error("Source-origin routing lost its source reservation");let dt=[Le.sourcePoint,...nt.segments.slice(0,nt.sourceEscapeSegmentCount??1).map((pt)=>pt.end)],rt=Ob({...e,bus:Ne,terminal:{connection:Le,viaPoint:nt.via.center,exitPoint:nt.via.center},targetLayer:nt.via.toLayer,targetLayerPoints:[nt.via.center],sourceEscapePoints:dt,allowBlindAndBuriedVias:!1});return[Le.connectionIndex,{plan:rt,path:dt}]})));for(let[Ne,Le]of Se)d.set(Ne,Le.plan.via.center),u.set(Ne,Le.path);for(let Ne=0;Ne<_.length;Ne++)_[Ne]=Se.get(_[Ne].connectionIndex)?.plan??_[Ne]}if(T&&J.routeFromSourcePads)C=!0;U=!0;break}if(!U)return t.failedNarrowGroup=v<=2&&H.length>0,t.failedWideMatching=e.sourceOriginRouting===!0&&v>2&&j,null}return Git({...e,inputSrj:s,preparedBuses:i,plans:[...p,..._.filter((b)=>m.has(b.busId)&&b.termination.type==="plane")]})}function*Ozr(e){let t=(i,s=e.preparedBuses)=>Ey({plans:i,preparedBuses:s,inputSrj:e.inputSrj,sharedBoundary:e.sharedBoundary,clearance:e.clearance,allowBlindAndBuriedVias:e.allowBlindAndBuriedVias,allowSameNetMerges:e.allowSameNetMerges}),n=(i)=>Math.max(...i.map((s)=>s.length))-Math.min(...i.map((s)=>s.length)),o=new Set,r=[...e.plans];while(o.size<3){let i=t(r);if(i.plans)return i.plans;let s=i.failedBus;if(o.has(s.busId)||s.connections.length!==2||s.termination.type!=="boundary"||!s.exitEdge)return null;o.add(s.busId);let a=r.filter((x)=>x.busId===s.busId);if(a.length!==2||a.some((x)=>!x.via||x.additionalVias?.length)||a[0].targetLayer!==a[1].targetLayer)return null;let c=r.filter((x)=>x.busId!==s.busId),l=new Map(a.map((x)=>[x.connectionIndex,[x.sourcePoint,...x.segments.slice(0,x.sourceEscapeSegmentCount??1).map((C)=>C.end)]])),h=s.exitEdge==="left"||s.exitEdge==="right",d=h?"y":"x",u=h?e.sharedBoundary.minY:e.sharedBoundary.minX,_=h?e.sharedBoundary.maxY:e.sharedBoundary.maxX,p=(u+_)/2,m=Vi(s.exitEdge,s.preferredExit),A=e.traceWidth+e.clearance,g=n(a),f=[],y=null;e:for(let x of[0,1,-1,2,-2,3,-3,4,-4]){let C=x*A;if(a.some((b)=>{let I=b.exitPoint[d]+C;return I<u+e.traceWidth/2||I>_-e.traceWidth/2||m==="minimum"&&I>=p||m==="maximum"&&I<=p}))continue;for(let b of[0,-1,1])for(let I of[[0,1],[1,0]]){let v=yield*G2({...e,bus:s,targetLayer:a[0].targetLayer,acceptedPlans:c,terminals:s.connections.map((B)=>{let T=a.find((N)=>N.connectionIndex===B.connectionIndex);return{connection:B,viaPoint:T.via.center,exitPoint:{...T.exitPoint,[d]:T.exitPoint[d]+C}}}),sourceEscapePaths:l,reservedVias:void 0,gridStep:A/2,gridStepDivisor:2,alignGridToPads:!0,maximumRouteOrderAttempts:1,routeOrder:I,laneBias:b},1,!1);if(!v.length||n(v[0])>=g)continue;let P=v[0].map((B)=>({...B,cornerBandSide:m}));if(f.push(P),n(P)>2*s.maxLengthSkew)continue;let M=t([...c,...P],[s]);if(!M.plans)continue;y=M.plans;break e}}if(!y)for(let x of f.toSorted((C,b)=>n(C)-n(b)).slice(0,3)){let C=t([...c,...x],[s]);if(!C.plans)continue;y=C.plans;break}if(!y)return null;r=y}return t(r).plans}var z2=0.0000001;function p8e(e,t){let n=e.filter((o,r)=>!r||Gt(o,e[r-1])>0.000000001);return n.flatMap((o,r)=>{if(!r||r===n.length-1)return[o];let i=n[r-1],s=n[r+1],a=Gt(i,o),c=Gt(o,s);if(Math.abs((o.x-i.x)*(s.x-o.x)+(o.y-i.y)*(s.y-o.y))>0.000000001)return[o];let l=Math.min(t,a/3,c/3);return[{x:o.x+(i.x-o.x)*l/a,y:o.y+(i.y-o.y)*l/a},{x:o.x+(s.x-o.x)*l/c,y:o.y+(s.y-o.y)*l/c}]})}function Vzr(e,t,n){if(e.length>28)return null;let{traceWidth:o,clearance:r,viaDiameter:i}=t,s=t.buses.flatMap((g)=>g.connections),a=dk(t.buses,{...t,additionalObstacles:t.srj.obstacles}),c=new Map(e.map((g,f)=>[g.connectionIndex,f])),l=s.map((g)=>({own:c.get(g.connectionIndex),masks:a.filter((f)=>f.connectionIndex===g.connectionIndex).map((f)=>{let y={start:g.sourcePoint,end:f.point,width:o,layer:g.sourceLayer},x=0;return e.forEach((C,b)=>{if(C.connectionIndex===g.connectionIndex)return;if(Gt(f.point,C.exitPoint)<i+r-z2||Hr(C.exitPoint,y.start,y.end)<i/2+o/2+r-z2||C.segments.some((I)=>Hr(f.point,I.start,I.end)<i/2+o/2+r-z2||!u_(y,I,r)))x|=1<<b}),x})})),h=(g)=>Math.atan2(g.y-n.y,g.x-n.x),d=e.map((g,f)=>f).sort((g,f)=>h(e[f].exitPoint)-h(e[g].exitPoint)),u=t.bus.connections.toSorted((g,f)=>h(f.exitTargetPoint??f.targetPoint)-h(g.exitTargetPoint??g.targetPoint)),_=new Map(u.map((g,f)=>[g.connectionIndex,f])),p=(g)=>l.every((f)=>f.own!==void 0&&g&1<<f.own||f.masks.some((y)=>!(y&g))),m=[],A=0;for(let g=0;g<e.length;g++){let f=[...d.slice(g),...d.slice(0,g)],y=(x,C,b,I)=>{if(++A>1e6||I.length+f.length-x<m.length)return;if(x===f.length){if(I.length>m.length&&p(b))m=[...I];return}let v=f[x],P=_.get(e[v].connectionIndex);if(P>C)y(x+1,P,b|1<<v,[...I,v]);y(x+1,C,b,I)};y(0,-1,0,[])}return m.length>=3?m.map((g)=>e[g]):null}function*Yzr(e){let{bus:t,srj:n,traceWidth:o,clearance:r,viaDiameter:i}=e;if(t.termination.type!=="boundary"||t.exitEdge!=="left"||t.connections.length<8||t.connections.length>28||e.targetLayer==="top"||t.connections.some((ce)=>ce.sourceLayer!=="top"))return null;let s=Math.min(t.pitchX,t.pitchY),a=o+r;if(!Number.isFinite(s)||s<=0)return null;let c=t.componentObstacles.filter((ce)=>ce.layers.includes("top")),l={minX:Math.min(...c.map((ce)=>ce.center.x-ce.width/2)),maxX:Math.max(...c.map((ce)=>ce.center.x+ce.width/2)),minY:Math.min(...c.map((ce)=>ce.center.y-ce.height/2)),maxY:Math.max(...c.map((ce)=>ce.center.y+ce.height/2))},h={x:(l.minX+l.maxX)/2,y:(l.minY+l.maxY)/2},d=Math.ceil(((l.maxX-l.minX)/2+s+a)/a)*a,u=Math.ceil(((l.maxY-l.minY)/2+s+a)/a)*a,_={minX:h.x-d,maxX:h.x+d,minY:h.y-u,maxY:h.y+u};if(_.minX<=t.sharedBoundary.minX||_.maxY>=t.sharedBoundary.maxY||_.minY<=t.sharedBoundary.minY)return null;let p=new Map(e.buses.flatMap((ce)=>ce.connections.map((ue)=>[ue.connectionIndex,{owner:ce,connection:ue}]))),m=(ce)=>e.targetPointsByConnectionIndex?.get(ce.connectionIndex)??{x:t.sharedBoundary.minX,y:(ce.exitTargetPoint??ce.targetPoint).y},A=(ce)=>ce.map((ue,de)=>({...t,busId:`${t.busId}:split-source:${de}`,sharedBoundary:_,preferredExit:void 0,exitEdge:void 0,connections:[{...ue,exitTargetPoint:void 0,hasExplicitLayeredExitTarget:!1,hasExplicitExitTarget:!1}]})),g=yield*MY({srj:n,buses:A(t.connections),traceWidth:o,clearance:r});if(!g||g.length!==t.connections.length)return null;let f=Vzr(g,e,h);if(!f)return null;let y=(ce,ue)=>{let de=p.get(ce.connectionIndex).owner,me=de===t?e.targetLayer:de.termination.type==="plane"?de.termination.layer:e.targetLayerByBusId?.get(de.busId)??(de.allowedLayers??e.layerNames).find((ge)=>ge!==ce.sourceLayer);if(!me)throw Error("FanoutSolver: split source has no legal target layer");return{connectionIndex:ce.connectionIndex,connectionName:ce.connection.name,segments:ue.slice(1).map((ge,xe)=>({start:ue[xe],end:ge,width:o,layer:ce.sourceLayer})),via:{center:ue.at(-1),diameter:i,holeDiameter:e.viaHoleDiameter,fromLayer:ce.sourceLayer,toLayer:me,spanLayers:t5({fromLayer:ce.sourceLayer,toLayer:me,layerNames:e.layerNames,allowBlindAndBuriedVias:!1})}}},x=(ce,ue)=>{let de=p.get(ce.connectionIndex).connection;if(ce.segments.some((me)=>[me.start,me.end].some((ge)=>ge.x<t.sharedBoundary.minX-z2||ge.x>t.sharedBoundary.maxX+z2||ge.y<t.sharedBoundary.minY-z2||ge.y>t.sharedBoundary.maxY+z2)))return!1;for(let me of n.obstacles){if(me.layers.some((ge)=>ce.via.spanLayers.includes(ge))&&r5(ce.via.center,me)<i/2+r-z2)return!1;if(me!==de.sourceObstacle&&ce.segments.some((ge)=>me.layers.includes(ge.layer)&&Cl(ge,me)<o/2+r-z2))return!1}return ue.every((me)=>me.connectionIndex===ce.connectionIndex||Gt(ce.via.center,me.via.center)>=i+r-z2&&ce.segments.every((ge)=>Hr(me.via.center,ge.start,ge.end)>=i/2+o/2+r-z2&&me.segments.every((xe)=>u_(ge,xe,r)))&&me.segments.every((ge)=>Hr(ce.via.center,ge.start,ge.end)>=i/2+o/2+r-z2))},C=(ce)=>{let ue=new Set(ce.map((de)=>de.connectionIndex));return e.buses.map((de)=>({...de,connections:de.connections.filter((me)=>!ue.has(me.connectionIndex))})).filter((de)=>de.connections.length)},b=e.initialViaPoints,I=(ce)=>({...e,additionalObstacles:n.obstacles,maximumSearchStates:300000,blockingSegments:ce.flatMap((ue)=>ue.segments.map((de)=>({connectionIndex:ue.connectionIndex,segment:de}))),blockingVias:ce.map((ue)=>({connectionIndex:ue.connectionIndex,...ue.via})),preferredViaPointsByConnectionIndex:b}),v=f.map((ce)=>y(p.get(ce.connectionIndex).connection,[ce.segments[0].start,...ce.segments.map((ue)=>ue.end)])),P=Yu(C(v),I(v));if(!P)return null;b=new Map([...P,...v.map((ce)=>[ce.connectionIndex,ce.via.center])]);let M=f.toSorted((ce,ue)=>m(p.get(ce.connectionIndex).connection).y-m(p.get(ue.connectionIndex).connection).y),B=[];for(let ce of M){let ue=[ce],de=ce.exitPoint.x;for(let me of M.slice(M.indexOf(ce)+1))if(me.exitPoint.x>de+a-z2)ue.push(me),de=me.exitPoint.x;if(ue.length>B.length)B=ue}if(B.length<3)return null;let T=new Map(B.map((ce)=>[ce.connectionIndex,[ce.segments[0].start,...ce.segments.map((ue)=>ue.end)]])),N=t.sharedBoundary.minX+Math.max(s/2,i/2+r),D=_.maxY+s-a/2,L=_.minX-s+a/2,H=()=>[...T].sort(([ce],[ue])=>m(p.get(ce).connection).y-m(p.get(ue).connection).y).map(([ce,ue],de)=>{let me=m(p.get(ce).connection),ge=ue.at(-1);return y(p.get(ce).connection,p8e([...ue,{x:ge.x,y:D+de*a},{x:L-de*a,y:D+de*a},{x:L-de*a,y:me.y},{x:N,y:me.y}],o))}),V=H();if(V.some((ce)=>!x(ce,V)))return null;for(let ce of t.connections.toSorted((ue,de)=>m(ue).y-m(de).y)){if(T.has(ce.connectionIndex))continue;let ue=[...T].filter(([me])=>m(p.get(me).connection).y<m(ce).y).at(-1)?.[1].at(-1)?.x??_.minX,de=[...T].filter(([me])=>m(p.get(me).connection).y>m(ce).y)[0]?.[1].at(-1)?.x??_.maxX;for(let me of[-1,1]){let ge={x:ce.sourcePoint.x+me*s/2,y:ce.sourcePoint.y+s/2};if(ge.x<ue+a-z2||ge.x>de-a+z2)continue;let xe=[ce.sourcePoint,ge,{x:ge.x,y:_.maxY}];T.set(ce.connectionIndex,xe);let Ee=H();if(Ee.every((Re)=>x(Re,Ee))&&Yu(C(Ee),I(Ee))){V=Ee;break}T.delete(ce.connectionIndex)}}let O=Math.min(...V.map((ce)=>m(p.get(ce.connectionIndex).connection).y));for(let ce of g.filter((ue)=>Math.abs(ue.exitPoint.x-_.minX)<z2&&m(p.get(ue.connectionIndex).connection).y<O).sort((ue,de)=>m(p.get(de.connectionIndex).connection).y-m(p.get(ue.connectionIndex).connection).y)){let ue=p.get(ce.connectionIndex).connection,de=m(ue),me=_.minX-a,ge=y(ue,p8e([ce.segments[0].start,...ce.segments.map((xe)=>xe.end),{x:me,y:ce.exitPoint.y},{x:me,y:de.y},{x:N,y:de.y}],o));if(x(ge,V)&&Yu(C([...V,ge]),I([...V,ge])))V.push(ge)}let U=new Set(V.map((ce)=>ce.connectionIndex)),j=t.connections.filter((ce)=>!U.has(ce.connectionIndex)).sort((ce,ue)=>m(ce).y-m(ue).y);if(j.length<5)return null;let Y=j.slice(0,3),X=Y[1],K=Y[2],J=[...n.obstacles,...V.flatMap((ce)=>ce.segments.map((ue)=>({type:"rect",center:{x:(ue.start.x+ue.end.x)/2,y:(ue.start.y+ue.end.y)/2},width:Gt(ue.start,ue.end),height:ue.width,ccwRotationDegrees:Math.atan2(ue.end.y-ue.start.y,ue.end.x-ue.start.x)*180/Math.PI,layers:[ue.layer],connectedTo:[ce.connectionName]})))],ee=yield*MY({srj:{...n,obstacles:J},buses:A([X,K]),traceWidth:o,clearance:r,availableBoundaryRegions:[{direction:"down",preferredExit:"bottom",exitEdge:"bottom"}]});if(!ee?.length)return null;let se=ee.find((ce)=>ce.connectionIndex===X.connectionIndex),ne=y(X,[se.segments[0].start,...se.segments.map((ce)=>ce.end)]);if(!x(ne,V))return null;V.push(ne),U.add(ne.connectionIndex);let re=C(V),Z=new Map([[K.connectionIndex,{x:K.sourcePoint.x-s/2,y:K.sourcePoint.y-s/2}]]),te=Yu(re,{...I(V),fixedViaPointsByConnectionIndex:Z});if(!te)return null;let ie=[...V,...re.flatMap((ce)=>ce.connections.map((ue)=>y(ue,[ue.sourcePoint,te.get(ue.connectionIndex)])))];if(ie.some((ce)=>!x(ce,ie)))return null;return{sourceEscapes:ie,sourceBoundary:_,remoteConnectionIndices:U,bottomRemoteConnectionIndices:new Set([ne.connectionIndex]),lowerConnectionIndices:Y.map((ce)=>ce.connectionIndex),viaPointsByConnectionIndex:new Map(ie.map((ce)=>[ce.connectionIndex,ce.via.center]))}}function*Ott(e){let t=new Set,n=new Set,o=[],r=0,i=null;function*s(l,h){let d=l.join(",")+":"+h;if(t.has(d)||r>=256)return;t.add(d),r++;let u=0,_=G2({...e,routeOrder:l,laneBias:h,maximumRouteOrderAttempts:1},1,!1),p=_.next();while(!p.done)u=Math.max(u,p.value.connectionIndex),yield p.value,p=_.next();if(p.value.length){i=p.value[0];return}let m=l.slice(0,u+1).join(",")+":"+h;if(!n.has(m))n.add(m),o.push({order:l,bias:h,completed:u})}let c=e.terminals.map((l,h)=>h).toSorted((l,h)=>e.terminals[l].exitPoint.x-e.terminals[h].exitPoint.x);for(let l of[0,1,-1]){if(yield*s(c,l),i)return i;if(yield*s(c.toReversed(),l),i)return i}while(o.length&&r<256){o.sort((u,_)=>_.completed-u.completed);let{order:l,bias:h,completed:d}=o.shift();if(o.length>256)o.length=256;for(let u=d-1;u>=0;u--){let _=[...l],[p]=_.splice(d,1);if(_.splice(u,0,p),yield*s(_,h),i)return i;let m=[...l];if([m[d],m[u]]=[m[u],m[d]],yield*s(m,h),i)return i}}return null}function*b3n(e){let{bus:t,srj:n,sourceBoundary:o,sourceEscapes:r,remoteConnectionIndices:i,bottomRemoteConnectionIndices:s,lowerConnectionIndices:a,targetLayer:c,traceWidth:l,clearance:h}=e;if(t.exitEdge!=="left"||t.termination.type!=="boundary"||a.length!==3)return null;let d=Math.min(t.pitchX,t.pitchY),u=l+h,_=new Map(r.map((ie)=>[ie.connectionIndex,ie])),p=t.connections.map((ie)=>({connection:ie,viaPoint:_.get(ie.connectionIndex).via.center,exitPoint:{x:t.sharedBoundary.minX,y:(ie.exitTargetPoint??ie.targetPoint).y}})).sort((ie,ce)=>ie.exitPoint.y-ce.exitPoint.y),m=new Map(p.map((ie)=>[ie.connection.connectionIndex,ie])),A=a.map((ie)=>m.get(ie)),g=new Set(a),f=p.filter((ie)=>!g.has(ie.connection.connectionIndex)&&!i.has(ie.connection.connectionIndex));if(f.length<2||A.some((ie)=>!ie))return null;let y=new Map(r.map((ie)=>[ie.connectionIndex,[ie.segments[0].start,...ie.segments.map((ce)=>ce.end)]])),x=(ie,ce)=>Ob({...e,bus:t,terminal:ie,targetLayerPoints:ce,sourceEscapePoints:y.get(ie.connection.connectionIndex),allowBlindAndBuriedVias:!1}),C=Math.min(o.minY-e.viaDiameter/2-l/2-h-0.00001,...A.map((ie,ce)=>ie.exitPoint.y+(A.length-1-ce)*u-u-l)),b=(ie,ce,ue)=>{let de=(ue?f:A).findIndex((Re)=>Re.connection.connectionIndex===ie.connection.connectionIndex),me=ce.at(-1),ge=ue?o.maxY+d-u/2+de*u:C-(A.length-1-de)*u,xe=o.minX-e.viaDiameter/2-l/2-h-0.00001-(ue?de:A.length-1-de)*u,Ee=p8e([me,{x:me.x,y:ge},{x:xe,y:ge},{x:xe,y:ie.exitPoint.y},ie.exitPoint],l);return x(ie,[...ce,...Ee.slice(1)])},I=p.filter((ie)=>i.has(ie.connection.connectionIndex)).map((ie)=>s.has(ie.connection.connectionIndex)?b(ie,[ie.viaPoint],!1):x(ie,[ie.viaPoint,ie.exitPoint])),v=!!e.rematchPendingSources,P=(ie,ce,ue,de,me=!1)=>{let ge=new Set(ie.map((Ee)=>Ee.connection.connectionIndex)),xe={...t,connections:ie.map((Ee)=>Ee.connection),exitEdge:ue?"top":"bottom",direction:ue?"up":"down",preferredExit:void 0,sharedBoundary:me?t.sharedBoundary:{...t.sharedBoundary,maxY:o.maxY,...!ue?{minY:o.minY}:{}}};return{...e,bus:xe,terminals:ie.map((Ee,Re)=>({...Ee,exitPoint:de[Re]})),acceptedPlans:ce,reservedVias:r.filter((Ee)=>!ge.has(Ee.connectionIndex)&&(!v||!e.rematchPendingSources?.connectionIndices.has(Ee.connectionIndex))).map((Ee)=>({connectionName:Ee.connectionName,via:Ee.via})),sourceEscapePaths:y,allowBlindAndBuriedVias:!1,allowSameNetMerges:!1,gridStepDivisor:2,gridStep:u/2,alignGridToPads:!0,reserveTerminalExitPoints:!0}},M=A[0],B=A.at(-1),T=f[0],N=B.connection.sourcePoint,D=N.x+d,L=[{x:T.connection.sourcePoint.x,y:T.connection.sourcePoint.y-d},{x:N.x-d,y:N.y},{x:D,y:N.y}],H=[M.viaPoint];for(let ie of L){let ce={...M,viaPoint:H.at(-1)},ue=P([ce],I,!0,[ie],!0);ue.bus={...ue.bus,exitEdge:"right",direction:"right"},ue.sourceEscapePaths=void 0;let de=yield*Ott(ue);if(!de)return null;H.push(...de[0].segments.filter((me)=>me.layer===c).map((me)=>me.end))}H=p8e([...H,{x:D,y:o.minY}],l);let V=b(M,H,!1),U={x:r.find((ie)=>s.has(ie.connectionIndex)).via.center.x-d,y:o.minY};v=!1;let j=yield*Ott(P([B],[...I,V],!1,[U]));if(!j)return null;let Y=j[0].segments.filter((ie)=>ie.layer===c),X=b(B,[Y[0].start,...Y.map((ie)=>ie.end)],!1);if(e.rematchPendingSources){if(!e.rematchPendingSources.afterLowerStage([...I,V,X]))return null;for(let ie of r)y.set(ie.connectionIndex,[ie.segments[0].start,...ie.segments.map((ce)=>ce.end)])}let K=Math.min(...t.componentObstacles.map((ie)=>ie.center.x-ie.width/2)),J=K+e.viaDiameter/2,ee=Math.max(...f.map((ie)=>ie.connection.sourcePoint.x))-d/2-l/2;if(ee-J<(f.length-1)*u)return null;let se=f.map((ie,ce)=>({x:J+(ee-J)*ce/(f.length-1),y:o.maxY})),ne=yield*Ott(P(f,[...I,V,X],!0,se));if(!ne)return null;let re=ne.map((ie)=>{let ce=ie.segments.filter((de)=>de.layer===c),ue=ce.at(-1);if(ue.end.y<=ue.start.y)return null;return b(m.get(ie.connectionIndex),[ce[0].start,...ce.map((de)=>de.end)],!0)});if(re.some((ie)=>!ie))return null;let Z=[...I,V,X,...re];if(Z.length!==t.connections.length)return null;let te=Z.map((ie)=>ie.length);if(t.maxLengthSkew!==void 0&&Math.max(...te)-Math.min(...te)>t.maxLengthSkew+Vtt)return null;if(!q0({plans:Z,srj:n,sharedBoundary:t.sharedBoundary,clearance:h,allowBlindAndBuriedVias:!1,allowSameNetMerges:!1}))return null;for(let ie of Z)for(let ce of r){if(ie.connectionIndex===ce.connectionIndex)continue;for(let ue of ie.segments){if(ce.via.spanLayers.includes(ue.layer)&&Hr(ce.via.center,ue.start,ue.end)<ce.via.diameter/2+ue.width/2+h-Vtt)return null;for(let de of ce.segments)if(ue.layer===de.layer&&Hh(ue.start,ue.end,de.start,de.end)<(ue.width+de.width)/2+h-Vtt)return null}}return Z}var Vtt=0.0000001,b9=0.0000001;function dAn(e,t){let n=new Map(e.buses.flatMap((r)=>r.connections).map((r)=>[r.connectionIndex,r])),o=e.bus.sharedBoundary;for(let r of t){let i=n.get(r.connectionIndex),s=r.via.diameter/2;for(let a of e.srj.obstacles){if(a.layers.some((c)=>r.via.spanLayers.includes(c))&&r5(r.via.center,a)<s+e.clearance-b9)return!1;if(a!==i.sourceObstacle&&r.segments.some((c)=>a.layers.includes(c.layer)&&Cl(c,a)<c.width/2+e.clearance-b9))return!1}for(let a of r.segments)if([a.start,a.end].some((c)=>c.x<o.minX-b9||c.x>o.maxX+b9||c.y<o.minY-b9||c.y>o.maxY+b9))return!1;for(let a of t){if(r.connectionIndex===a.connectionIndex)continue;if(Gt(r.via.center,a.via.center)<s+a.via.diameter/2+e.clearance-b9)return!1;if(r.segments.some((c)=>a.via.spanLayers.includes(c.layer)&&Hr(a.via.center,c.start,c.end)<a.via.diameter/2+c.width/2+e.clearance-b9))return!1;if(r.segments.some((c)=>a.segments.some((l)=>!u_(c,l,e.clearance))))return!1}}return!0}function*Gzr(e){let{bus:t,traceWidth:n,clearance:o,viaDiameter:r}=e;if(t.exitEdge!=="left"||t.termination.type!=="boundary"||e.bottomRemoteConnectionIndices.size!==1)return null;let i=[...e.bottomRemoteConnectionIndices][0],s=e.sourceEscapes.find((p)=>p.connectionIndex===i),a=s?.segments.at(-1);if(!a||Math.abs(a.start.x-a.end.x)>b9||a.start.y<=a.end.y)return null;let c=Math.min(t.pitchX,t.pitchY);if(!Number.isFinite(c)||c<=0)return null;let l=n+o,h=t.yCoordinates.slice(1).map((p,m)=>(p+t.yCoordinates[m])/2).filter((p)=>p>a.end.y+b9&&p<a.start.y-b9).sort((p,m)=>p-m).slice(0,4),d=new Set([...t.connections.map((p)=>p.connectionIndex),...e.sourceEscapes.filter((p)=>p.segments.length>1).map((p)=>p.connectionIndex)]),u=e.buses.map((p)=>({...p,connections:p.connections.filter((m)=>!d.has(m.connectionIndex))})).filter((p)=>p.connections.length),_=new Set(u.flatMap((p)=>p.connections).map((p)=>p.connectionIndex));for(let p of h){yield{phase:"route-connection",routeOrderAttempt:0,connectionIndex:0,connectionCount:t.connections.length,connectionName:s.connectionName,searchBatch:0,expandedStateCount:0,connectionComplete:!1};let m=e.sourceEscapes.map((b)=>({...b,segments:b.segments.map((I)=>({...I,start:{...I.start},end:{...I.end}})),via:{...b.via,center:{...b.via.center}}})),A=new Map(e.viaPointsByConnectionIndex),g=m.find((b)=>b.connectionIndex===i);g.via.center={x:a.end.x,y:p},g.segments.at(-1).end=g.via.center,A.set(i,g.via.center);let f=m.filter((b)=>d.has(b.connectionIndex)),y=(b=[])=>{let I=Yu(u,{...e,additionalObstacles:e.srj.obstacles,maximumSearchStates:300000,preferredViaPointsByConnectionIndex:A,blockingSegments:[...f.flatMap((v)=>v.segments.map((P)=>({connectionIndex:v.connectionIndex,segment:P}))),...b.flatMap((v)=>v.segments.filter((P)=>P.layer===e.targetLayer).map((P)=>({connectionIndex:v.connectionIndex,segment:P})))],blockingVias:f.map((v)=>({connectionIndex:v.connectionIndex,...v.via}))});if(!I)return!1;for(let v of m)if(_.has(v.connectionIndex)){let P=I.get(v.connectionIndex);v.via={...v.via,center:P},v.segments=[{...v.segments[0],end:P}],A.set(v.connectionIndex,P)}return dAn(e,m)};if(!y())continue;let x={...e.sourceBoundary,minY:p-c+r/2+n/2+o+0.00001+l},C=yield*b3n({...e,sourceEscapes:m,sourceBoundary:x,viaPointsByConnectionIndex:A,rematchPendingSources:{connectionIndices:_,afterLowerStage:y}});if(C&&dAn(e,m))return{plans:C,sourceEscapes:m,sourceBoundary:{...e.sourceBoundary},viaPointsByConnectionIndex:A,remoteConnectionIndices:new Set(e.remoteConnectionIndices),bottomRemoteConnectionIndices:new Set(e.bottomRemoteConnectionIndices),lowerConnectionIndices:[...e.lowerConnectionIndices]}}return null}function OS(e){return e==="left"||e==="right"}function x7e(e){return e==="right"||e==="up"?1:-1}function O2(e,t){return OS(t)?e.x:e.y}function VS(e,t){return OS(t)?e.y:e.x}function Kx(e,t,n){return OS(n)?{x:e,y:t}:{x:t,y:e}}function C7e(e){switch(e.direction){case"right":return e.sharedBoundary.maxX;case"left":return e.sharedBoundary.minX;case"up":return e.sharedBoundary.maxY;case"down":return e.sharedBoundary.minY}}function Qve(e){if(e.length<3)return e;let t=[e[0]];for(let n=1;n<e.length-1;n++){let o=t.at(-1),r=e[n],i=e[n+1],s={x:Math.sign(r.x-o.x),y:Math.sign(r.y-o.y)},a={x:Math.sign(i.x-r.x),y:Math.sign(i.y-r.y)};if(s.x!==a.x||s.y!==a.y)t.push(r)}return t.push(e.at(-1)),t}function Ade(e,t){let n=[];for(let o=1;o<e.length;o++){if(Gt(e[o-1],e[o])<0.000000001)continue;n.push({start:e[o-1],end:e[o],width:t,layer:"top"})}return n}function Uzr(e){let{srj:t,bus:n,connection:o,traceWidth:r,clearance:i}=e,s=n.direction,a=x7e(s),c={x:o.sourcePoint.x,y:o.sourcePoint.y},l=O2(c,s),h=VS(c,s),d=r/2+i,u=(()=>{switch(s){case"right":return n.componentBounds.maxX+d;case"left":return n.componentBounds.minX-d;case"up":return n.componentBounds.maxY+d;case"down":return n.componentBounds.minY-d}})(),_=(C)=>Math.min(...t.obstacles.filter((b)=>b!==o.sourceObstacle&&b.layers.includes("top")).map((b)=>Cl(C,b))),p={start:c,end:Kx(u,h,s),width:r,layer:"top"};if(_(p)>=d-0.000000001)return null;let m=OS(s)?{minimum:n.componentBounds.minY,maximum:n.componentBounds.maxY}:{minimum:n.componentBounds.minX,maximum:n.componentBounds.maxX},A=a*(u-l),g=VS(o.exitTargetPoint??o.targetPoint,s),f=r+i,y=C7e(n),x=[-1,1].map((C)=>{let b=C<0?m.minimum-d:m.maximum+d,I=C*(b-h),v=Math.max(A,I),P=Kx(l+a*v,h+C*v,s);if(a*(y-O2(P,s))<f-0.000000001)return null;let M=[c,P];if(!M.every((N)=>N.x>=n.sharedBoundary.minX-0.000000001&&N.x<=n.sharedBoundary.maxX+0.000000001&&N.y>=n.sharedBoundary.minY-0.000000001&&N.y<=n.sharedBoundary.maxY+0.000000001))return null;let T=Math.min(...Ade(M,r).map(_));if(T<d-0.000000001)return null;return{points:M,obstacleDistance:T,targetDistance:Math.abs(VS(P,s)-g)}}).filter((C)=>C!==null).toSorted((C,b)=>b.obstacleDistance-C.obstacleDistance||C.targetDistance-b.targetDistance);return x.length>0?x.map((C)=>C.points):null}function Wzr(e){let{item:t,srj:n,acceptedSegments:o,traceWidth:r,clearance:i}=e,s=t.cornerChannelPrefixes;if(!s)return null;let a=t.direction,c=x7e(a),l=C7e(t.bus),h=r+i,d=r/2+i,u=OS(a)?t.bus.sharedBoundary.minY:t.bus.sharedBoundary.minX,_=OS(a)?t.bus.sharedBoundary.maxY:t.bus.sharedBoundary.maxX,p=u+r/2,m=_-r/2,A=VS(t.connection.exitTargetPoint??t.connection.targetPoint,a),g=h/2,f=new Set([Math.max(p,Math.min(m,A))]);for(let x=Math.ceil(p/g)*g;x<=m+0.000000001;x+=g)f.add(Number(x.toFixed(9)));let y=[...f].toSorted((x,C)=>Math.abs(x-A)-Math.abs(C-A));for(let x of s){let C=x.at(-1),b=VS(C,a);for(let I of y){let v=Math.abs(I-b),P=Kx(O2(C,a)+c*h,b,a),M=Kx(O2(P,a)+c*v,I,a);if(c*(l-O2(M,a))<-0.000000001)continue;let B=Kx(l,I,a),T=[...x,P,...v>0.000000001?[M]:[]];if(Gt(T.at(-1),B)>0.000000001)T.push(B);let N=Qve(T),D=Ade(N,r);if(!D.every((V)=>n.obstacles.every((O)=>O===t.connection.sourceObstacle||!O.layers.includes("top")||Cl(V,O)>=d-0.000000001)))continue;if(!D.every((V)=>o.every((O)=>Hh(V.start,V.end,O.start,O.end)>=r+i-0.000000001)))continue;return{item:t,points:N,track:I}}}return null}function Xzr(e){let{route:t,direction:n,exitAxis:o,signedShift:r,maximumShift:i,obstacles:s,requiredObstacleDistance:a}=e;if(i<=0.000000001||Math.abs(r)<=0.000000001)return 0;let c=Math.sign(r),l=(u)=>{if(u<=0.000000001)return!0;let _={start:Kx(o-x7e(n)*u,t.track,n),end:Kx(o,t.track+c*u,n),width:0,layer:"top"};return s.every((p)=>p===t.item.connection.sourceObstacle||!p.layers.includes("top")||Cl(_,p)>=a-0.000000001)};if(l(i))return i;let h=0,d=i;for(let u=0;u<32;u++){let _=(h+d)/2;if(l(_))h=_;else d=_}return h}function jzr(e){let{requestedTracks:t,currentTracks:n,candidateTracks:o,maximumShifts:r}=e,i=t.length+1,s=o.length+1,a=Array.from({length:i},()=>new Float64Array(s).fill(Number.POSITIVE_INFINITY)),c=Array.from({length:i},()=>new Uint8Array(s));a[0].fill(0);for(let u=1;u<i;u++)for(let _=1;_<s;_++){let p=a[u][_-1],m=Math.abs(t[u-1]-o[_-1]),g=Math.abs(n[u-1]-o[_-1])>r[u-1]+0.000000001?Number.POSITIVE_INFINITY:a[u-1][_-1]+m;if(g<p)a[u][_]=g,c[u][_]=1;else a[u][_]=p}if(!Number.isFinite(a.at(-1).at(-1)))return null;let l=[],h=t.length,d=o.length;while(h>0&&d>0){if(c[h][d])l.push(o[d-1]),h--;d--}if(h>0)return null;return l.reverse()}function Kzr(e){let{direction:t,activeRoutes:n,obstacles:o,boundaryMinimum:r,boundaryMaximum:i,traceWidth:s,clearance:a,requestedTracks:c,maximumShifts:l}=e,h=s+a,d=s/2+a,u=null,_=Number.POSITIVE_INFINITY;for(let p of Array.from({length:Math.round(h/s)},(m,A)=>A*s)){let m=[],A=Math.ceil((r-p)/h)*h+p;for(let y=A;y<=i+0.000000001;y+=h){let x=Math.round(y/s)*s;if(o.every((C)=>{let b=VS(C.center,t),I=OS(t)?C.height:C.width;return Math.abs(x-b)>=I/2+d-0.000000001}))m.push(x)}let g=jzr({requestedTracks:c,currentTracks:n.map((y)=>y.track),candidateTracks:m,maximumShifts:l});if(!g)continue;let f=g.reduce((y,x,C)=>y+Math.abs(x-c[C]),0);if(f<_)_=f,u=g}return u}function $zr(e,t){switch(t){case"up":if(e==="top-left")return"minimum";if(e==="top-right")return"maximum";return null;case"down":if(e==="bottom-left")return"minimum";if(e==="bottom-right")return"maximum";return null;case"left":if(e==="bottom-left")return"minimum";if(e==="top-left")return"maximum";return null;case"right":if(e==="bottom-right")return"minimum";if(e==="top-right")return"maximum";return null}}function qzr(e){let{items:t,direction:n,boundaryMinimum:o,boundaryMaximum:r,traceWidth:i,clearance:s,borderDistribution:a,currentTrackByConnectionName:c}=e,l=(I)=>c.get(I.connection.connection.name)??VS(I.source,n),h=[...t].toSorted((I,v)=>l(I)-l(v)||I.connection.connection.name.localeCompare(v.connection.connection.name)),d=i+s,u=o+i/2,_=r-i/2,p=_-u,m=d*Math.max(h.length-1,0);if(p<m-0.000000001)return null;let A=h.map(l),g=[...A],f=d,y=new Set;if(a==="even"&&h.length>1){let I=A[0],v=A.at(-1),P=Math.max(d,(v-I)/(h.length-1)),M=(T)=>{let N=[...A],D=Math.floor(h.length/2),L=h.length%2===0?D-1:D;if(L!==D){let H=N[D]-N[L];if(H<T){let V=(T-H)/2;N[L]=N[L]-V,N[D]=N[D]+V}}for(let H=L-1;H>=0;H--)N[H]=Math.min(N[H],N[H+1]-T);for(let H=D+1;H<N.length;H++)N[H]=Math.max(N[H],N[H-1]+T);return N},B=(T)=>T[0]>=u-0.000000001&&T.at(-1)<=_+0.000000001;if(g=M(P),B(g))f=P;else{let T=d,N=P;if(g=M(T),!B(g))return null;for(let D=0;D<32;D++){let L=(T+N)/2,H=M(L);if(B(H))T=L,g=H;else N=L}f=T}for(let T of h)y.add(T.connection.connection.name)}let x=[],C=[];for(let I=0;I<h.length;I++){let v=h[I],P=v.bus.preferredExit;if(!P?.includes("-"))continue;let M=$zr(P,n);if(!M)return null;if(y.add(v.connection.connection.name),M==="minimum")x.push(I);else C.push(I)}if(x.some((I,v)=>I!==v)||C.some((I,v)=>I!==h.length-C.length+v))return null;let b=d*2;if(x.length>0){g[0]=u+b;for(let I=1;I<x.length;I++){let v=Math.max(f,A[I]-A[I-1]);g[I]=g[I-1]+v}}if(C.length>0){let I=h.length-1;g[I]=_-b;for(let v=I-1;v>=h.length-C.length;v--){let P=Math.max(f,A[v+1]-A[v]);g[v]=g[v+1]-P}}return{byConnectionName:new Map(h.map((I,v)=>[I.connection.connection.name,g[v]])),enforcedConnectionNames:y}}function Jzr(e){let{item:t,points:n,segments:o}=e,r=n.map((s,a)=>({route_type:"wire",x:s.x,y:s.y,width:o[0]?.width??0.1,layer:"top",...a===0&&t.connection.sourcePoint.pcb_port_id?{start_pcb_port_id:t.connection.sourcePoint.pcb_port_id}:{}})),i=zY({connectionName:t.connection.connection.name,sourcePointIndex:t.connection.sourcePointIndex});return{busId:t.bus.busId,connectionName:t.connection.connection.name,connectionIndex:t.connection.connectionIndex,sourcePointIndex:t.connection.sourcePointIndex,sourcePoint:t.connection.sourcePoint,sourceObstacle:t.connection.sourceObstacle,sourceLayer:t.connection.sourceLayer,targetPoint:t.connection.targetPoint,targetLayer:"top",termination:t.bus.termination,direction:t.direction,...t.bus.exitEdge?{exitEdge:t.bus.exitEdge}:{},exitPoint:n.at(-1),trace:{type:"pcb_trace",pcb_trace_id:i.traceId,connection_name:t.connection.connection.name,connectsTo:[...t.connection.sourcePoint.pointId?[t.connection.sourcePoint.pointId]:[],...t.connection.sourcePoint.pcb_port_id?[t.connection.sourcePoint.pcb_port_id]:[],i.boundaryExitPointId],route:r},segments:o,length:o.reduce((s,a)=>s+Gt(a.start,a.end),0)}}function Zzr(e){let{paths:t,obstacles:n,traceWidth:o,clearance:r}=e,i=o/2+r,s=o+r;for(let a of t){if(Math.abs(O2(a.points.at(-1),a.item.direction)-C7e(a.item.bus))>0.000001)return!1;for(let c of a.segments)for(let l of n){if(l===a.item.connection.sourceObstacle||!l.layers.includes("top"))continue;if(Cl(c,l)<i-0.000000001)return!1}}for(let a=0;a<t.length;a++)for(let c=a+1;c<t.length;c++)for(let l of t[a].segments)for(let h of t[c].segments)if(Hh(l.start,l.end,h.start,h.end)<s-0.000000001)return!1;return!0}function eOr(e){let{srj:t,buses:n,traceWidth:o,clearance:r,borderDistribution:i}=e,s=o/2+r,a=new Map,c=new Map,l=n.flatMap((_)=>_.connections.map((p)=>{let m={x:p.sourcePoint.x,y:p.sourcePoint.y},A=Uzr({srj:t,bus:_,connection:p,traceWidth:o,clearance:r});return{bus:_,connection:p,direction:_.direction,source:m,...A?{cornerChannelPrefixes:A}:{}}}));for(let _ of["left","right","up","down"]){let p=x7e(_),m=l.filter((D)=>D.direction===_&&!D.cornerChannelPrefixes);if(m.length===0)continue;let A=OS(_)?m[0].bus.sharedBoundary.minY:m[0].bus.sharedBoundary.minX,g=OS(_)?m[0].bus.sharedBoundary.maxY:m[0].bus.sharedBoundary.maxX,f=C7e(m[0].bus),y=new Map,x=new Map,C=new Map;for(let D of m){let L=O2(D.source,_),H=L.toFixed(6);C.set(H,L);let V=y.get(H)??[];V.push(D),y.set(H,V)}for(let[D,L]of y){let H=C.get(D),V=new Set(L.map((O)=>O.bus.componentId));x.set(D,t.obstacles.filter((O)=>O.layers.includes("top")&&!!O.componentId&&V.has(O.componentId)&&Math.abs(O2(O.center,_)-H)<0.000001))}let b=[...C.values()].toSorted((D,L)=>p*(D-L)),I=new Map;for(let D=0;D<b.length;D++){let L=b[D],H=L.toFixed(6);for(let X of y.get(H)??[]){let K=OS(_)?X.connection.sourceObstacle.width:X.connection.sourceObstacle.height,J=Math.max(X.connection.sourceObstacle.width,X.connection.sourceObstacle.height)<1.5?K/2+s:0,ee=Kx(L+p*J,VS(X.source,_),_);I.set(X.connection.connection.name,{item:X,points:Gt(X.source,ee)>0.000000001?[X.source,ee]:[X.source],track:VS(X.source,_)})}let V=b[D+1]??f;if(I.size===0||p*(V-L)<=0.000000001)continue;let O=[...I.values()].toSorted((X,K)=>X.track-K.track||X.item.connection.connection.name.localeCompare(K.item.connection.connection.name)),U=b.slice(D+1,D+3).flatMap((X)=>x.get(X.toFixed(6))??[]),j=O.map((X)=>Math.abs(V-O2(X.points.at(-1),_))),Y=Kzr({direction:_,activeRoutes:O,obstacles:U,boundaryMinimum:A,boundaryMaximum:g,traceWidth:o,clearance:r,requestedTracks:O.map((X)=>X.track),maximumShifts:j});if(!Y)return null;for(let X=0;X<O.length;X++){let K=O[X],J=Y[X],ee=Math.abs(J-K.track),se=O2(K.points.at(-1),_),ne=Kx(se+p*ee,J,_);if(Gt(K.points.at(-1),ne)>0.000000001)K.points.push(ne);let re=Kx(V,J,_);if(Gt(K.points.at(-1),re)>0.000000001)K.points.push(re);K.track=J}}let v=qzr({items:m,direction:_,boundaryMinimum:A,boundaryMaximum:g,traceWidth:o,clearance:r,borderDistribution:i,currentTrackByConnectionName:new Map([...I.values()].map((D)=>[D.item.connection.connection.name,D.track]))});if(!v)return null;let P=[...I.values()].toSorted((D,L)=>D.track-L.track||D.item.connection.connection.name.localeCompare(L.item.connection.connection.name)),M=new Map,B=o+r,T=B;for(let D of P){let L=D.item.connection.connection.name;if(!v.enforcedConnectionNames.has(L))continue;if(v.byConnectionName.get(L)-D.track>=-0.000000001)continue;M.set(L,T),T+=B*2}let N=B;for(let D=P.length-1;D>=0;D--){let L=P[D],H=L.item.connection.connection.name;if(!v.enforcedConnectionNames.has(H))continue;if(v.byConnectionName.get(H)-L.track<=0.000000001)continue;M.set(H,N),N+=B*2}for(let D of P){let L=D.item.connection.connection.name,H=v.byConnectionName.get(L)??D.track,V=M.get(L)??0,O=D.points.at(-2),U=O?p*(f-O2(O,_)):0,j=H-D.track,Y=Math.min(Math.abs(j),Math.max(0,U-V)),X=Xzr({route:D,direction:_,exitAxis:f,signedShift:j,maximumShift:Y,obstacles:t.obstacles,requiredObstacleDistance:s}),K=Math.sign(j)*X;v.byConnectionName.set(L,D.track+K)}for(let D of v.enforcedConnectionNames)c.set(D,v.byConnectionName.get(D));for(let D of P){let L=D.item.connection.connection.name,H=v.byConnectionName.get(L)??D.track,V=Math.abs(H-D.track),O=M.get(L)??0,U=V>0.000000001?O+V:0,j=f-p*U,Y=D.points.at(-1);if(Math.abs(O2(Y,_)-f)>0.000001)return null;let X=D.points.at(-2);if(X&&(Math.abs(VS(X,_)-D.track)>0.000001||p*(j-O2(X,_))<-0.000001))return null;let K=Kx(j,D.track,_);if(X&&Gt(X,K)<0.000000001)D.points.pop();else D.points[D.points.length-1]=K}for(let D of P){let L=D.item.connection.connection.name,H=v.byConnectionName.get(L)??D.track,V=Math.abs(H-D.track),O=M.get(L)??0;if(V>0.000000001&&O>0.000000001)D.points.push(Kx(O2(D.points.at(-1),_)+p*O,D.track,_));if(V>0.000000001)D.points.push(Kx(O2(D.points.at(-1),_)+p*V,H,_)),D.track=H;let U=Kx(f,D.track,_);if(Gt(D.points.at(-1),U)>0.000000001){if(p*(f-O2(D.points.at(-1),_))<-0.000001)return null;D.points.push(U)}a.set(L,D)}}let h=[...a.values()].flatMap((_)=>Ade(Qve(_.points),o));for(let _ of l){if(!_.cornerChannelPrefixes)continue;let p=Wzr({item:_,srj:t,acceptedSegments:h,traceWidth:o,clearance:r});if(!p)return null;a.set(_.connection.connection.name,p),h.push(...Ade(Qve(p.points),o))}if(a.size!==l.length)return null;let d=(o+r)/2+0.000001;for(let[_,p]of c){let m=a.get(_);if(!m||Math.abs(m.track-p)>d)return null}let u=l.map((_)=>{let p=a.get(_.connection.connection.name),m=Qve(p.points);return{item:_,points:m,segments:Ade(m,o)}});if(!Zzr({paths:u,obstacles:t.obstacles,traceWidth:o,clearance:r}))return null;return u.map(Jzr)}var tOr=(e)=>e.process??{env:{}};function nOr(e){let{bus:t}=e,n=[...e.plans];if(t.maxLengthSkew===void 0)return n;let o=n.filter((r)=>r.busId===t.busId).toSorted((r,i)=>i.length-r.length);for(let r of o){let i=Math.min(...n.filter((a)=>a.busId===t.busId).map((a)=>a.length));if(r.length-i<=t.maxLengthSkew)continue;if(!r.via||r.additionalVias?.length||r.planeEndpointVia||r.segments.filter((a)=>a.layer===r.sourceLayer).length!==1)continue;let s=t.connections.find((a)=>a.connectionIndex===r.connectionIndex);for(let a of[!0,!1]){let c=X4n({...e,bus:{...t,connections:[s],routableEscapeLayers:[r.targetLayer]},terminals:[{connection:s,viaPoint:r.via.center,exitPoint:r.exitPoint}],targetLayer:r.targetLayer,acceptedPlans:n.filter((h)=>h!==r),allowBlindAndBuriedVias:!1,gridStepDivisor:2,alignGridToPads:a,maximumRouteOrderAttempts:1})?.[0];if(!c||c.length>=r.length-0.000001)continue;let l=n.map((h)=>h===r?c:h);if(!q0({...e,plans:l,allowBlindAndBuriedVias:!1}))continue;n=l;break}}return n}var eh=0.000001;function Df(e,t){return Gt(e,t)<=eh}function uAn(e){return"layer"in e?[e.layer]:e.layers}function hY(e){return[...e.segments,...e.planeEndpointSegments??[]]}function dY(e){return[e.via,...e.additionalVias??[],e.planeEndpointVia].filter((t)=>Boolean(t))}function pAn(e,t){return Df(e,t)&&uAn(e).join("\x00")===uAn(t).join("\x00")&&e.pointId===t.pointId&&e.pcb_port_id===t.pcb_port_id}function mAn(e,t){let n=e.x>=t.minX-eh&&e.x<=t.maxX+eh&&e.y>=t.minY-eh&&e.y<=t.maxY+eh,o=Math.abs(e.x-t.minX)<=eh||Math.abs(e.x-t.maxX)<=eh||Math.abs(e.y-t.minY)<=eh||Math.abs(e.y-t.maxY)<=eh;return n&&o}function oOr(e,t,n){if(!(e.x>=n.minX-eh&&e.x<=n.maxX+eh&&e.y>=n.minY-eh&&e.y<=n.maxY+eh))return!1;switch(t){case"left":return Math.abs(e.x-n.minX)<=eh;case"right":return Math.abs(e.x-n.maxX)<=eh;case"top":return Math.abs(e.y-n.maxY)<=eh;case"bottom":return Math.abs(e.y-n.minY)<=eh}}function _An(e,t){return e.x>=t.minX-eh&&e.x<=t.maxX+eh&&e.y>=t.minY-eh&&e.y<=t.maxY+eh}function $s(e,t,n,o,r){e.push({code:t,message:n,...o?{connectionName:o.connectionName,busId:o.busId}:{},...r?{otherConnectionName:r}:{}})}function gAn(e){let{trace:t,plan:n,issues:o}=e,r=[],i,s;for(let a of t.route){if(a.route_type==="via"){if(!i||!Df(i,a)||i.layer!==a.from_layer)$s(o,"disconnected-trace",`Trace ${t.pcb_trace_id} reaches a via without a matching ${a.from_layer} wire endpoint`,n);s=a;continue}if(a.route_type!=="wire"){$s(o,"unsupported-route-point",`Trace ${t.pcb_trace_id} contains unsupported ${a.route_type} geometry`,n);continue}if(s){if(!Df(a,s)||a.layer!==s.to_layer)$s(o,"disconnected-trace",`Trace ${t.pcb_trace_id} does not continue from its via on ${s.to_layer}`,n);i=a,s=void 0;continue}if(i){if(i.layer!==a.layer)$s(o,"disconnected-trace",`Trace ${t.pcb_trace_id} changes from ${i.layer} to ${a.layer} without a via`,n);else if(!Df(i,a))r.push({start:{x:i.x,y:i.y},end:{x:a.x,y:a.y},width:a.width,layer:a.layer})}i=a}if(s)$s(o,"disconnected-trace",`Trace ${t.pcb_trace_id} ends at a via without a wire on ${s.to_layer}`,n);return r}function rOr(e){let{plan:t,preparedBus:n,inputSrj:o,outputSrj:r,sharedBoundary:i,issues:s}=e,a=o.connections[t.connectionIndex];if(!a||a.name!==t.connectionName){$s(s,"connection-mismatch",`Plan index ${t.connectionIndex} does not identify connection ${t.connectionName}`,t);return}let c=n?.connections.find((g)=>g.connectionIndex===t.connectionIndex);if(!c||c.sourcePointIndex!==t.sourcePointIndex||!pAn(c.sourcePoint,t.sourcePoint)||c.sourceObstacle.obstacleId!==t.sourceObstacle.obstacleId)$s(s,"source-mismatch",`Plan ${t.connectionName} does not start at its prepared component endpoint`,t);if(n?.termination.type!==t.termination.type)$s(s,"termination-mismatch",`Plan ${t.connectionName} does not use its bus termination`,t);let l=Vi(n?.exitEdge,n?.preferredExit);if(n?.exitEdge!==t.exitEdge||l!==t.cornerBandSide)$s(s,"output-exit-mismatch",`Plan ${t.connectionName} does not retain its prepared boundary edge and band`,t);else if(n?.exitEdge&&!oOr(t.exitPoint,n.exitEdge,i))$s(s,"output-exit-mismatch",`Plan ${t.connectionName} does not terminate on its declared ${n.exitEdge} edge`,t);if(!(o.allowViaInPad===!0&&t.termination.type==="plane"&&t.via!==void 0&&Df(t.via.center,t.sourcePoint)&&Df(t.exitPoint,t.sourcePoint))&&(t.segments.length===0||t.length<=eh))$s(s,"not-broken-out",`Plan ${t.connectionName} has no non-zero escape geometry`,t);else{let g={minX:Math.min(o.bounds.minX,i.minX),maxX:Math.max(o.bounds.maxX,i.maxX),minY:Math.min(o.bounds.minY,i.minY),maxY:Math.max(o.bounds.maxY,i.maxY)};if(t.segments.some((f)=>!_An(f.start,g)||!_An(f.end,g)))$s(s,"outside-routing-bounds",`Plan ${t.connectionName} leaves the routable SRJ/shared-boundary area`,t);if(t.segments[0]&&!Df(t.segments[0].start,t.sourcePoint))$s(s,"disconnected-trace",`Plan ${t.connectionName} does not start at its source pad`,t);if(t.segments.at(-1)&&!Df(t.segments.at(-1).end,t.exitPoint))$s(s,"disconnected-trace",`Plan ${t.connectionName} does not end at its declared exit`,t);for(let f=1;f<t.segments.length;f++){let y=t.segments[f-1],x=t.segments[f];if(!Df(y.end,x.start))$s(s,"disconnected-trace",`Plan ${t.connectionName} has a gap between route segments`,t);let C=dY(t).find((b)=>Df(y.end,b.center)&&b.spanLayers.includes(y.layer)&&b.spanLayers.includes(x.layer));if(y.layer!==x.layer&&!C)$s(s,"disconnected-trace",`Plan ${t.connectionName} changes layers without a connecting via`,t)}}let d=[...t.segments,...t.planeEndpointSegments??[]].reduce((g,f)=>g+Gt(f.start,f.end),0);if(Math.abs(d-t.length)>0.000001)$s(s,"plan-length-mismatch",`Plan ${t.connectionName} declares ${t.length.toFixed(6)}mm but contains ${d.toFixed(6)}mm of routed copper`,t);let u=gAn({trace:t.trace,plan:t,issues:s}),_=t.segments.filter((g)=>Gt(g.start,g.end)>eh);if(u.length!==_.length||u.some((g,f)=>{let y=_[f];return!y||g.layer!==y.layer||Math.abs(g.width-y.width)>eh||!Df(g.start,y.start)||!Df(g.end,y.end)}))$s(s,"trace-plan-mismatch",`Trace ${t.trace.pcb_trace_id} does not encode its declared route segments`,t);if(t.planeEndpointTrace||t.planeEndpointSegments||t.planeEndpointVia)if(!t.planeEndpointTrace||!t.planeEndpointSegments||!t.planeEndpointVia)$s(s,"trace-plan-mismatch",`Plane endpoint geometry for ${t.connectionName} is incomplete`,t);else{let g=gAn({trace:t.planeEndpointTrace,plan:t,issues:s});if(g.length!==t.planeEndpointSegments.length||g.some((f,y)=>{let x=t.planeEndpointSegments?.[y];return!x||f.layer!==x.layer||Math.abs(f.width-x.width)>eh||!Df(f.start,x.start)||!Df(f.end,x.end)})||Gt(t.planeEndpointVia.center,t.targetPoint)<=eh)$s(s,"trace-plan-mismatch",`Trace ${t.planeEndpointTrace.pcb_trace_id} does not encode a valid offset plane-to-endpoint dogbone`,t)}let p=t.trace.route.find((g)=>("x"in g)&&("y"in g)),m=[...t.trace.route].reverse().find((g)=>("x"in g)&&("y"in g));if(!p||!m||!Df(p,t.sourcePoint)||!Df(m,t.exitPoint))$s(s,"disconnected-trace",`Trace ${t.trace.pcb_trace_id} does not span its source and exit`,t);let A=r.connections.find((g)=>g.name===t.connectionName);if(t.termination.type==="boundary")if(!A)$s(s,"output-connection-missing",`Boundary connection ${t.connectionName} was removed from the output`,t);else{let g=A.pointsToConnect[t.sourcePointIndex];if(!g||!Df(g,t.exitPoint)||!("layer"in g)||g.layer!==t.targetLayer)$s(s,"output-exit-mismatch",`Output connection ${t.connectionName} is not attached to its fanout exit`,t);for(let f=0;f<a.pointsToConnect.length;f++){if(f===t.sourcePointIndex)continue;let y=a.pointsToConnect[f],x=A.pointsToConnect[f];if(!y||!x||!pAn(y,x))$s(s,"downstream-endpoint-lost",`Output connection ${t.connectionName} did not retain downstream endpoint ${f}`,t)}}else if(A)$s(s,"plane-connection-retained",`Plane-terminated connection ${t.connectionName} remains in the output`,t)}function iOr(e,t){let n=hY(e),o=hY(t),r=dY(e),i=dY(t);for(let s of n){for(let a of o)if(s.layer===a.layer&&Hh(s.start,s.end,a.start,a.end)<=(s.width+a.width)/2+eh)return!0;for(let a of i)if(a.spanLayers.includes(s.layer)&&Hr(a.center,s.start,s.end)<=a.diameter/2+s.width/2+eh)return!0}for(let s of r){for(let a of o)if(s.spanLayers.includes(a.layer)&&Hr(s.center,a.start,a.end)<=s.diameter/2+a.width/2+eh)return!0;for(let a of i)if(s.spanLayers.some((c)=>a.spanLayers.includes(c))&&Gt(s.center,a.center)<=(s.diameter+a.diameter)/2+eh)return!0}return!1}function sOr(e){let{plans:t,inputSrj:n,sharedBoundary:o,issues:r}=e,i=new Set,s=new Map;for(let c of t)s.set(c,[]);for(let c=0;c<t.length;c++){let l=t[c];if(l.termination.type==="plane"?Boolean(l.via):l.segments.some((h)=>mAn(h.start,o)||mAn(h.end,o)))i.add(l);for(let h=c+1;h<t.length;h++){let d=t[h];if(!e5(n,l.connectionName,d.connectionName)||!iOr(l,d))continue;s.get(l).push(d),s.get(d).push(l)}}let a=[...i];while(a.length>0){let c=a.shift();for(let l of s.get(c)??[]){if(i.has(l))continue;i.add(l),a.push(l)}}for(let c of t){if(i.has(c))continue;$s(r,"not-broken-out",c.termination.type==="boundary"?`Connection ${c.connectionName} has no continuous same-net copper path to the shared boundary`:`Plane connection ${c.connectionName} has no terminating via`,c)}return i}function aOr(e){let{plans:t,inputSrj:n,clearance:o,allowBlindAndBuriedVias:r,issues:i}=e;for(let s of t){if(_de(s,o).some((c)=>c.kind!=="clearance"))$s(i,"source-pad-reentry",`Trace ${s.connectionName} returns into its source pad after leaving it`,s);let a=hY(s);for(let c=0;c<a.length;c++){let l=a[c];for(let h of n.obstacles){if(!h.layers.includes(l.layer))continue;if(kb(n,h,s.connectionName))continue;if(c===0&&h.obstacleId===s.sourceObstacle.obstacleId&&l.layer===s.sourceLayer)continue;if(Mue({inputSrj:n,segment:l,bodyObstacle:h,connectionName:s.connectionName}))continue;let d=Cl(l,h),u=l.width/2+o;if(d<u-0.000000001)$s(i,"obstacle-clearance",`Trace ${s.connectionName} on ${l.layer} is ${d.toFixed(4)}mm from different-net obstacle ${h.obstacleId}; ${u.toFixed(4)}mm is required`,s)}}for(let c of dY(s))for(let l of n.obstacles){if(!l.layers.some((u)=>c.spanLayers.includes(u))||kb(n,l,s.connectionName))continue;let h=r5(c.center,l),d=c.diameter/2+o;if(h<d-0.000000001)$s(i,"via-obstacle-clearance",`Via ${s.connectionName} is ${h.toFixed(4)}mm from different-net obstacle ${l.obstacleId} on its layer span; ${d.toFixed(4)}mm is required`,s)}for(let c of oP(n,r)){if(s.connectionName===c.connectionName||e5(n,s.connectionName,c.connectionName))continue;for(let l of hY(s)){for(let h of c.segments)if(!u_(l,h,o))$s(i,"different-net-trace-clearance",`Trace ${s.connectionName} violates routed trace ${c.trace.pcb_trace_id} on ${l.layer}`,s,c.connectionName);for(let h of c.vias)if(h.spanLayers.includes(l.layer)&&Hr(h.center,l.start,l.end)<h.diameter/2+l.width/2+o-0.000000001)$s(i,"different-net-trace-via-clearance",`Trace ${s.connectionName} violates a via in routed trace ${c.trace.pcb_trace_id} on ${l.layer}`,s,c.connectionName)}for(let l of dY(s)){for(let h of c.segments)if(l.spanLayers.includes(h.layer)&&Hr(l.center,h.start,h.end)<l.diameter/2+h.width/2+o-0.000000001)$s(i,"different-net-trace-via-clearance",`Via ${s.connectionName} violates routed trace ${c.trace.pcb_trace_id} on ${h.layer}`,s,c.connectionName);for(let h of c.vias)if(l.spanLayers.some((d)=>h.spanLayers.includes(d))&&Gt(l.center,h.center)<(l.diameter+h.diameter)/2+o-0.000000001)$s(i,"different-net-via-clearance",`Via ${s.connectionName} violates a via in routed trace ${c.trace.pcb_trace_id}`,s,c.connectionName)}}}for(let s=0;s<t.length;s++){let a=t[s];for(let c=s+1;c<t.length;c++){let l=t[c];if(e5(n,a.connectionName,l.connectionName))continue;let h=hY(a),d=hY(l),u=dY(a),_=dY(l);for(let p of h){for(let m of d)if(!u_(p,m,o))$s(i,"different-net-trace-clearance",`Different-net traces ${a.connectionName} and ${l.connectionName} intersect or violate clearance on ${p.layer}`,a,l.connectionName);for(let m of _)if(m.spanLayers.includes(p.layer)&&Hr(m.center,p.start,p.end)<m.diameter/2+p.width/2+o-0.000000001)$s(i,"different-net-trace-via-clearance",`Trace ${a.connectionName} violates via clearance to ${l.connectionName} on ${p.layer}`,a,l.connectionName)}for(let p of u){for(let m of d)if(p.spanLayers.includes(m.layer)&&Hr(p.center,m.start,m.end)<p.diameter/2+m.width/2+o-0.000000001)$s(i,"different-net-trace-via-clearance",`Via ${a.connectionName} violates trace clearance to ${l.connectionName} on ${m.layer}`,a,l.connectionName);for(let m of _)if(p.spanLayers.some((A)=>m.spanLayers.includes(A))&&Gt(p.center,m.center)<(p.diameter+m.diameter)/2+o-0.000000001)$s(i,"different-net-via-clearance",`Vias ${a.connectionName} and ${l.connectionName} violate clearance on an overlapping layer span`,a,l.connectionName)}}}}function cOr(e,t,n){let o=e.differentialPairs;if(o===void 0)return;if(!Array.isArray(o)){$s(n,"invalid-differential-pair","Differential pairs must be an array");return}let r=new Map;e.connections.forEach((i,s)=>{let a=r.get(i.name)??[];a.push(s),r.set(i.name,a)}),o.forEach((i,s)=>{let a=i,c=a?.connectionNames,l=a?.lengthTolerance;if(!Array.isArray(c)||c.length!==2||c.some((_)=>typeof _!=="string"||_.length===0)||c[0]===c[1]||typeof l!=="number"||!Number.isFinite(l)||l<0){$s(n,"invalid-differential-pair",`Differential pair ${s} must name two distinct connections and a finite nonnegative length tolerance`);return}let h=[];for(let _ of c){let p=r.get(_),m=t.get(_);if(p?.length!==1||m?.length!==1||m[0].connectionIndex!==p[0]){$s(n,"invalid-differential-pair",`Differential pair ${s} cannot resolve exactly one original plan for connection ${_}`);return}h.push(m[0])}let d=h.map((_)=>hY(_).reduce((p,m)=>p+Gt(m.start,m.end),0));if(d.some((_)=>!Number.isFinite(_))){$s(n,"invalid-differential-pair",`Differential pair ${s} has nonfinite routed copper length`,h[0],c[1]);return}let u=Math.abs(d[0]-d[1]);if(u>l+eh)$s(n,"differential-pair-length-skew",`Differential pair ${c[0]}/${c[1]} has ${u.toFixed(6)}mm routed-length skew; ${l.toFixed(6)}mm is allowed`,h[0],c[1])})}function lOr(e){let{inputSrj:t,outputSrj:n,plans:o,preparedBuses:r,sharedBoundary:i,clearance:s,allowBlindAndBuriedVias:a=!0}=e,c=[],l=new Map,h=new Map(r.map((u)=>[u.busId,u]));for(let u of o){let _=l.get(u.connectionName)??[];_.push(u),l.set(u.connectionName,_)}cOr(t,l,c);for(let u of r){if(u.maxLengthSkew===void 0)continue;let _=o.filter((A)=>A.busId===u.busId);if(_.length<2)continue;let p=_.map((A)=>A.length),m=Math.max(...p)-Math.min(...p);if(m>u.maxLengthSkew+0.000001)$s(c,"bus-length-skew",`Bus ${u.busId} has ${m.toFixed(6)}mm routed-length skew; ${u.maxLengthSkew.toFixed(6)}mm is allowed`,_[0])}for(let u of t.connections){let _=l.get(u.name)??[];if(_.length===0)$s(c,"missing-plan",`Connection ${u.name} has no fanout plan`);else if(_.length>1)$s(c,"duplicate-plan",`Connection ${u.name} has ${_.length} fanout plans`,_[0])}for(let u of o){if(!t.connections.some((_)=>_.name===u.connectionName)){$s(c,"unknown-plan",`Plan ${u.connectionName} is not an input connection`,u);continue}rOr({plan:u,preparedBus:h.get(u.busId),inputSrj:t,outputSrj:n,sharedBoundary:i,issues:c})}let d=sOr({plans:o,inputSrj:t,sharedBoundary:i,issues:c});return aOr({plans:o,inputSrj:t,clearance:s,allowBlindAndBuriedVias:a,issues:c}),{valid:c.length===0,checkedConnectionCount:t.connections.length,brokenOutConnectionCount:new Set([...d].map((u)=>u.connectionName)).size,issues:c}}var AAn=["#ef4444","#2563eb","#16a34a","#9333ea","#f59e0b","#0891b2","#db2777","#65a30d","#4f46e5","#ea580c"];function hOr(e){if(!Number.isInteger(e)||e<0)throw Error(`FanoutSolver: copper layer index must be a non-negative integer, received ${e}`);return AAn[e%AAn.length]}var dOr=new Set(["top","bottom","inner1","inner2","inner3","inner4","inner5","inner6","inner7","inner8"]),uOr={"0603":{padLength:0.8,padWidth:0.95},"1206":{padLength:0.6,padWidth:1.6},"1206x4_pair":{padLength:0.8,padWidth:0.5}},zde=(e,t)=>{let n=e.indexOf(t);if(n<0)throw Error(`FanoutSolver: cannot visualize unknown copper layer "${t}"`);return n},Qhe=(e,t)=>`z${[...new Set(t.map((o)=>zde(e,o)))].sort((o,r)=>o-r).join(",")}`,pOr=(e)=>{let t="layers"in e?e.layers:void 0;if(t&&t.length>0)return t;return[e.layer]},mOr=(e,t)=>{if(e.__zLayers&&e.__zLayers.length>0)return[...new Set(e.__zLayers)].filter((n)=>Number.isInteger(n)&&n>=0&&n<t.length).sort((n,o)=>n-o);return[...new Set(e.layers.map((n)=>zde(t,n)))].sort((n,o)=>n-o)},_Or=(e,t,n)=>{let o=zde(e,t),r=zde(e,n);return e.slice(Math.min(o,r),Math.max(o,r)+1)},fAn=(...e)=>e.find((t)=>typeof t==="number"&&Number.isFinite(t)),gOr=(e)=>{let t=fAn(e.min_via_hole_diameter,e.minViaHoleDiameter),n=fAn(e.min_via_pad_diameter,e.minViaPadDiameter,e.minViaDiameter);return Math.max(n??e.minViaDiameter??0.3,t??0)},AOr=(e)=>Object.fromEntries(e.map((t,n)=>[t.name,`hsl(${n*340/e.length}, 100%, 50%)`])),fOr=(e,t,n)=>{let o=(1-Math.abs(2*n-1))*t,r=(e%360+360)%360/60,i=o*(1-Math.abs(r%2-1)),[s,a,c]=r<1?[o,i,0]:r<2?[i,o,0]:r<3?[0,o,i]:r<4?[0,i,o]:r<5?[i,0,o]:[o,0,i],l=n-o/2;return[s,a,c].map((h)=>Math.round((h+l)*255))},Ytt=(e,t)=>{let o={blue:[0,0,255],orange:[255,165,0],purple:[128,0,128],red:[255,0,0]}[e],r=1,i=/^rgba?\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)(?:\s*,\s*([\d.]+))?\s*\)$/.exec(e);if(i)o=[Number(i[1]),Number(i[2]),Number(i[3])],r=i[4]===void 0?1:Number(i[4]);let s=/^hsl\(\s*([\d.-]+)\s*,\s*([\d.]+)%\s*,\s*([\d.]+)%\s*\)$/.exec(e);if(s)o=fOr(Number(s[1]),Number(s[2])/100,Number(s[3])/100);if(!o)return e;let a=+Math.max(0,r*100-t*100).toFixed(2)/100;if(a>=1){let c=o.map((l)=>Math.round(l).toString(16).padStart(2,"0")).join("");return c[0]===c[1]&&c[2]===c[3]&&c[4]===c[5]?`#${c[0]}${c[2]}${c[4]}`:`#${c}`}return`rgba(${o.join(",")},${a})`},yOr=(e)=>{let t=new Set;return e.filter((n)=>{if(t.has(n))return!1;return t.add(n),!0})},xOr=(e)=>{let t=new Map,n=(o,r)=>{if(!o)return;let i=t.get(o)??[];if(!i.includes(r))i.push(r);t.set(o,i)};for(let o of e.connections){let r=o.__rootConnectionNames??[o.name];for(let i of r){n(o.name,i),n(i,i),n(o.__netConnectionName,i);for(let s of o.pointsToConnect)n(s.pointId,i),n(s.pcb_port_id,i)}}return(o)=>{let i=yOr([...o.connectedTo.flatMap((s)=>t.get(s)??[]),...(o.offBoardConnectsTo??[]).flatMap((s)=>t.get(s)??[])]).join(", ");return o.layers.map((s)=>i?`${s}
${i}`:s).join(`
`)}};function COr(e){let t=uB(e.layerCount),n=(e.traces??[]).some((u)=>u.route.some((_,p)=>{let m=u.route[p+1];return _.route_type==="wire"&&m?.route_type==="wire"&&m.layer===_.layer&&!dOr.has(_.layer)})),o=new Set(e.connections.map(({name:u})=>u)),r=n?[...new Set((e.traces??[]).map(({connection_name:u})=>u).filter((u)=>u&&!o.has(u)))].map((u)=>({name:u,pointsToConnect:[]})):[],i=[...e.connections,...r],s=AOr(i),a=xOr({...e,connections:i}),c=[],l=[],h=[],d=[];for(let u of i)for(let _ of u.pointsToConnect){let p=pOr(_),m=u.__rootConnectionNames??[u.name];d.push({x:_.x,y:_.y,color:s[u.name],layer:Qhe(t,p),label:[u.name,m.join(", "),p.join(",")].join(`
`)})}for(let u of e.traces??[]){let _=u.route.filter((m)=>m.route_type==="jumper"),p=(m,A)=>_.some((g)=>Math.abs(m.x-g.start.x)<0.01&&Math.abs(m.y-g.start.y)<0.01&&Math.abs(A.x-g.end.x)<0.01&&Math.abs(A.y-g.end.y)<0.01||Math.abs(m.x-g.end.x)<0.01&&Math.abs(m.y-g.end.y)<0.01&&Math.abs(A.x-g.start.x)<0.01&&Math.abs(A.y-g.start.y)<0.01);for(let m of u.route)if(m.route_type==="via"){let A=_Or(t,m.from_layer,m.to_layer);l.push({center:{x:m.x,y:m.y},radius:(m.via_diameter??gOr(e))/2,fill:n?s[u.connection_name]:"blue",stroke:"none",layer:Qhe(t,A)})}else if(m.route_type==="through_obstacle")c.push({points:[m.start,m.end],strokeColor:Ytt(s[u.connection_name]??"purple",0.35),strokeWidth:m.width,strokeDash:[0.1,0.1],layer:Qhe(t,[m.from_layer,m.to_layer]),label:`${u.connection_name} through_obstacle`});for(let m=0;m<u.route.length-1;m++){let A=u.route[m],g=u.route[m+1];if(A.route_type==="jumper"){let f=s[u.connection_name]??"rgba(255, 165, 0, 0.8)",y=uOr[A.footprint==="1206x4_pair"?"1206x4_pair":"0603"],x=Math.abs(A.end.x-A.start.x)>Math.abs(A.end.y-A.start.y),C=x?y.padLength:y.padWidth,b=x?y.padWidth:y.padLength,I=Qhe(t,[A.layer]);for(let v of[A.start,A.end])h.push({center:v,width:C,height:b,fill:Ytt(f,0.5),stroke:"rgba(0, 0, 0, 0.5)",layer:I});c.push({points:[A.start,A.end],strokeColor:"rgba(100, 100, 100, 0.8)",strokeWidth:y.padWidth*0.3,layer:I})}else if(A.route_type==="wire"&&g.route_type==="wire"&&g.layer===A.layer&&!p(A,g)){let f=zde(t,A.layer);c.push({points:[{x:A.x,y:A.y},{x:g.x,y:g.y}],layer:`z${f}`,strokeWidth:A.width,strokeColor:hOr(f),...n?{label:u.connection_name}:{}})}}}for(let u of e.obstacles){if(u.isCopperPour)continue;let _=mOr(u,t);if(_.length===0)throw Error(`FanoutSolver: cannot visualize obstacle "${u.obstacleId??"unknown"}" without a valid layer`);let p=_.length===1?t[_[0]]:void 0,m=Ytt(p==="bottom"?"blue":"red",0.5**_.length),A=u.shape,g={center:u.center,fill:m,layer:`z${_.join(",")}`,label:a(u)};if(A==="circle")l.push({...g,radius:Math.min(u.width,u.height)/2});else h.push({...g,width:u.width,height:u.height,ccwRotationDegrees:u.ccwRotationDegrees})}for(let u of e.jumpers??[])for(let _ of u.pads)h.push({center:_.center,width:_.width,height:_.height,ccwRotationDegrees:_.ccwRotationDegrees,fill:"rgba(255, 165, 0, 0.3)",stroke:"rgba(255, 165, 0, 0.8)",layer:Qhe(t,_.layers)});return{rects:h,circles:l,lines:c,points:d}}var Fa=tOr(globalThis),bOr=class extends co{constructor(e,t,n,o,r){super();this.solverName=e,this.generator=t,this.getVisualization=n,this.getStats=o,this.getProgress=r,this.MAX_ITERATIONS=1e6}solverName;generator;getVisualization;getStats;getProgress;output;hasOutput=!1;nextInput;getSolverName(){return this.solverName}_step(){if(this.activeSubSolver){if(this.activeSubSolver.step(),this.activeSubSolver.failed){this.failedSubSolvers=[...this.failedSubSolvers??[],this.activeSubSolver],this.error=this.activeSubSolver.error,this.failed=!0,this.activeSubSolver=null;return}if(this.activeSubSolver.solved)this.nextInput=this.activeSubSolver.getOutput(),this.activeSubSolver=null;this.stats=this.getStats();return}let e=this.generator.next(this.nextInput);if(this.nextInput=void 0,this.stats=this.getStats(),e.done){this.output=e.value,this.hasOutput=!0,this.solved=!0;return}if(Hde(e.value))this.activeSubSolver=e.value.solver}computeProgress(){return this.getProgress()}getConstructorParams(){return[]}getOutput(){if(!this.solved||!this.hasOutput)throw Error(`${this.solverName}: output requested before completion`);return this.output}visualize(){return this.activeSubSolver?.visualize()??this.getVisualization()}};function khe(e,t){if(!Number.isFinite(t)||t<=0)throw Error(`FanoutSolver: ${e} must be a positive number, received ${t}`);return t}function IOr(e,t){let n=khe("traceWidth",t.traceWidth??e.nominalTraceWidth??e.minTraceWidth),o=khe("viaDiameter",t.viaDiameter??e.minViaPadDiameter??e.min_via_pad_diameter??e.minViaDiameter??Math.max(n*2,0.3)),r=khe("viaHoleDiameter",t.viaHoleDiameter??e.minViaHoleDiameter??e.min_via_hole_diameter??o*0.5);if(r>=o)throw Error(`FanoutSolver: viaHoleDiameter ${r} must be smaller than viaDiameter ${o}`);let i=khe("clearance",t.clearance??e.minViaEdgeToPadEdgeClearance??e.minTraceToPadEdgeClearance??e.defaultObstacleMargin??e.minTraceWidth),s=uB(e.layerCount),a=t.escapeLayers??s;for(let l of a)if(!s.includes(l))throw Error(`FanoutSolver: escape layer "${l}" is not available in a ${e.layerCount}-layer SimpleRouteJson`);if(new Set(a).size!==a.length)throw Error("FanoutSolver: escapeLayers contains duplicates");let c=t.borderDistribution??"preserve";if(c!=="preserve"&&c!=="even")throw Error(`FanoutSolver: borderDistribution must be "preserve" or "even", received "${c}"`);return{traceWidth:n,viaDiameter:o,viaHoleDiameter:r,clearance:i,compactBusTracks:t.compactBusTracks??!1,allowBlindAndBuriedVias:t.allowBlindAndBuriedVias??!0,allowSameNetMerges:t.allowSameNetMerges??!1,densePlaneReservationBusIds:t.densePlaneReservationBusIds??[],denseUnrestrictedPlaneRoutingBusIds:t.denseUnrestrictedPlaneRoutingBusIds??[],singleLayerPushAndShove:t.singleLayerPushAndShove??!1,singleLayerAdaptiveExits:t.singleLayerAdaptiveExits??!1,borderDistribution:c,layerNames:s,escapeLayers:a,maxLayerCombinations:t.maxLayerCombinations===void 0?256:khe("maxLayerCombinations",t.maxLayerCombinations),balanceLayerLoadByConnectionCount:t.balanceLayerLoadByConnectionCount??!1}}function vOr(e,t){let n=new Set,o=Math.max(t.traceWidth+t.clearance,t.viaDiameter+t.clearance),r=Math.max(t.viaDiameter/2+t.clearance,o);for(let i of e){let s=Vi(i.exitEdge,i.preferredExit);if(!i.exitEdge||!s)continue;let a=`${i.exitEdge}:${s}`;if(n.has(a))continue;n.add(a);let c=i.exitEdge==="left"||i.exitEdge==="right"?i.sharedBoundary.maxY-i.sharedBoundary.minY:i.sharedBoundary.maxX-i.sharedBoundary.minX,l=i.cornerBandConnectionCount??i.connections.length,h=(l-1)*o/2,d=c/4-r;if(h>d+0.000001)throw Error(`FanoutSolver: ${s} band on the ${i.exitEdge} edge cannot fit ${l} via-safe exits`)}}function w9e(e,t,n){let o=new Map(t.map((i)=>[i.busId,i.connections.length])),r=new Map;for(let[i,s]of Object.entries(e))r.set(s,(r.get(s)??0)+(n?o.get(i)??1:1));return[...r.values()].reduce((i,s)=>i+s*s,0)}function B9e(e){return e.balanceLayerLoadByConnectionCount?0.25:0.01}function yAn(e,t,n){let o=Number(e.termination.type==="plane")-Number(t.termination.type==="plane");return n?-o:o}function T9e(e){return e.reduce((t,n)=>t+Number(Boolean(n.via))+(n.additionalVias?.length??0)+Number(Boolean(n.planeEndpointVia)),0)}function gJ(e){let t=e.connections.reduce((n,o)=>{let r=e.direction==="left"||e.direction==="right"?o.sourcePoint.x:o.sourcePoint.y;return n+r},0)/e.connections.length;switch(e.direction){case"right":return e.sharedBoundary.maxX-t;case"left":return t-e.sharedBoundary.minX;case"up":return e.sharedBoundary.maxY-t;case"down":return t-e.sharedBoundary.minY}}function Hot(e){let t=e.direction==="left"||e.direction==="right";return e.connections.some((n)=>{let o=n.exitTargetPoint??n.targetPoint,r=t?n.sourcePoint.y:n.sourcePoint.x,i=t?o.y:o.x;return Math.abs(r-i)>0.000001})}function RJ(e){if(e.connections.length===0||e.connections.some((o)=>!o.hasExplicitLayeredExitTarget||!o.exitTargetPoint?.layer))return;let t=new Set(e.connections.map((o)=>o.exitTargetPoint.layer));if(t.size!==1)return;let[n]=t;return n}function SOr(e){let t=e.direction==="left"||e.direction==="right",n=t?e.xCoordinates:e.yCoordinates,o=e.connections.reduce((i,s)=>i+(t?s.sourcePoint.x:s.sourcePoint.y),0)/e.connections.length,r=e.direction==="right"||e.direction==="up"?Math.max(...n):Math.min(...n);return Math.abs(o-r)<0.000001}function Fot(e){let t=e.direction==="left"||e.direction==="right",n=t?e.xCoordinates:e.yCoordinates,o=e.connections.reduce((s,a)=>s+(t?a.sourcePoint.x:a.sourcePoint.y),0)/e.connections.length,r=e.direction==="right"||e.direction==="up"?Math.max(...n):Math.min(...n),i=t?e.pitchX:e.pitchY;return Math.round(Math.abs(o-r)/i)}function POr(e){let{buses:t,escapeLayers:n,escapeLayersByBusId:o,preferOrderedCoordinatedWindingLayers:r}=e,i={},s=new Map,a=0;for(let c of t){let l=s.get(c.componentId)??new Set;l.add(c.direction),s.set(c.componentId,l)}for(let c of t){let l=c.connections[0]?.sourceLayer;if(!l)throw Error(`FanoutSolver: bus "${c.busId}" has no connections`);if(c.termination.type==="plane"){i[c.busId]=c.termination.layer;continue}let h=o[c.busId]??n,d=h.filter((_)=>_!==l),u=RJ(c);if(u&&h.includes(u))i[c.busId]=u;else if(!SS(c)&&h.includes(l)&&(Hot(c)||SOr(c)))i[c.busId]=l;else if(d.length>0){let _=c.connections.map((y)=>y.sourcePoint.x),p=c.connections.map((y)=>y.sourcePoint.y),m=(y)=>t.filter((x)=>{let C=x.connections[0]?.sourcePoint;return x.termination.type==="boundary"&&C!==void 0&&C.x>Math.min(..._)+0.000000001&&C.x<Math.max(..._)-0.000000001&&C.y>Math.min(...p)+0.000000001&&C.y<Math.max(...p)-0.000000001&&RJ(x)===y&&I3n({singletonBus:x,singletonTargetLayer:y,wideBuses:[c]})}).length,A=d.toSorted((y,x)=>m(y)-m(x));if(m(A[0])<m(d[0])){i[c.busId]=A[0];continue}if(r&&SS(c)){let y=Vi(c.exitEdge,c.preferredExit),x=(C)=>{if(!c.exitEdge||c.connections.length<8)return 0;let b=c.exitEdge==="left"||c.exitEdge==="right",I=b?"y":"x",v=b?c.sharedBoundary.minY:c.sharedBoundary.minX,P=b?c.sharedBoundary.maxY:c.sharedBoundary.maxX;if(!y){let N=c.connections.map((Y)=>{let X=Y.exitTargetPoint??Y.targetPoint;return Math.max(v,Math.min(P,X[I]))}),D=Math.min(...N),L=Math.max(...N),H=b?"x":"y",V=c.exitEdge==="right"||c.exitEdge==="top"?1:-1,O=Math.min(...c.connections.map((Y)=>V*Y.sourcePoint[H])),U=Math.min(...c.connections.map((Y)=>Y.sourcePoint[I])),j=Math.max(...c.connections.map((Y)=>Y.sourcePoint[I]));return t.reduce((Y,X)=>{let K=Vi(X.exitEdge,X.preferredExit);if(X===c||X.termination.type!=="boundary"||X.componentId!==c.componentId||X.exitEdge!==c.exitEdge||!K||RJ(X)!==C)return Y;let J=v+(P-v)*(K==="minimum"?0.25:0.75),ee=(Math.max(X.connections.length,X.cornerBandConnectionCount??0)-1)*Math.max(e.traceWidth+e.clearance,e.viaDiameter+e.clearance)/2,se=e.traceWidth+e.clearance,ne=L+se>=J-ee&&D-se<=J+ee,re=Math.max(...X.connections.map((Z)=>V*Z.sourcePoint[H]))<O-0.000000001&&Math.min(...X.connections.map((Z)=>Z.sourcePoint[I]))<=j+se&&Math.max(...X.connections.map((Z)=>Z.sourcePoint[I]))>=U-se;return Y+(ne||re?X.connections.length:0)},0)}let M=v+(P-v)*(y==="minimum"?0.25:0.75),B=Math.max(e.traceWidth+e.clearance,e.viaDiameter+e.clearance),T=(Math.max(c.connections.length,c.cornerBandConnectionCount??0)-1)*B/2;return t.reduce((N,D)=>{if(D===c||D.termination.type!=="boundary"||D.componentId!==c.componentId||D.exitEdge!==c.exitEdge||Vi(D.exitEdge,D.preferredExit)||RJ(D)!==C)return N;return N+D.connections.filter((L)=>{let H=L.exitTargetPoint??L.targetPoint,V=Math.max(v,Math.min(P,H[I]));return Math.abs(V-M)<=T+e.traceWidth+e.clearance}).length},0)};i[c.busId]=d.toSorted((C,b)=>x(C)-x(b))[0];continue}let g=s.get(c.componentId);if(g.has("left")&&g.has("right")||g.has("up")&&g.has("down")){let y=Fot(c);i[c.busId]=d[Math.max(y-1,0)%d.length]}else i[c.busId]=d[a%d.length],a++}else i[c.busId]=l}return i}function EOr(e){let{initialAssignment:t,generatedAssignments:n,maxAssignments:o}=e,r=JSON.stringify(t);return[t,...n.filter((i)=>JSON.stringify(i)!==r)].slice(0,o)}function SS(e){return Boolean(e.exitEdge&&e.termination.type==="boundary"&&e.connections.length>0&&e.connections.every((t)=>t.hasExplicitLayeredExitTarget===!0))}function zot(e){let t=e.length,n=e.filter((o)=>o===1).length;return(t===5||t===6||t===7)&&n===1||t===8&&(n===1||n===2)||t===9&&n>=1&&n<=3}function MOr(e){if(!zot(e))return 0;let t=e.filter((n)=>n===1).length;return Math.max(1,t-1)}function I3n(e){let t=e.singletonBus.connections[0]?.sourcePoint;if(e.singletonBus.connections.length!==1||!t)return!1;return e.wideBuses.some((n)=>{let o=n.routableEscapeLayers??n.allowedLayers??[];if(n.connections.length<8||n.componentId!==e.singletonBus.componentId||n.exitEdge!==e.singletonBus.exitEdge||o.length<2||!o.includes(e.singletonTargetLayer))return!1;let r=n.connections.map((s)=>s.sourcePoint.x),i=n.connections.map((s)=>s.sourcePoint.y);return t.x>=Math.min(...r)-0.000000001&&t.x<=Math.max(...r)+0.000000001&&t.y>=Math.min(...i)-0.000000001&&t.y<=Math.max(...i)+0.000000001})}function wOr(e){let t=Math.max(e.traceWidth+e.clearance,e.viaDiameter+e.clearance);return-e.leadingLaneCount*t/2}function BOr(e){if(e.boundaryBusCount===5||e.boundaryBusCount>9)return!1;if(e.boundaryBusCount===6||e.boundaryBusCount===7||e.boundaryBusCount===8||e.boundaryBusCount===9)return e.connectionCount>2&&e.rawSkew-e.maximumSkew>Math.max(1,e.maximumSkew*0.5);return e.rawSkew-e.maximumSkew>Math.max(1,e.maximumSkew*0.25)}function Ode(e){let t=e.connections[0],n=t?.exitTargetPoint,o=0;if(t&&n){let r=n.x-t.sourcePoint.x,i=n.y-t.sourcePoint.y;o=e.direction==="right"?r:e.direction==="left"?-r:e.direction==="up"?i:-i}return{isCorner:Boolean(Vi(e.exitEdge,e.preferredExit)),targetProjection:o}}function TOr(e,t){let n=Ode(e),o=Ode(t);return Number(n.isCorner)-Number(o.isCorner)||(n.isCorner&&o.isCorner?n.targetProjection-o.targetProjection:0)||e.busId.localeCompare(t.busId)}function DOr(e,t){let n=Ode(e),o=Ode(t);return Number(n.isCorner)-Number(o.isCorner)||(n.isCorner&&o.isCorner?Number(n.targetProjection>0)-Number(o.targetProjection>0):0)||e.busId.localeCompare(t.busId)}function NOr(e){let{pairBuses:t}=e,n=t[0],o=n?.connections[0]?.sourceLayer;if(e.boundaryBusCount!==7&&e.boundaryBusCount!==8&&e.boundaryBusCount!==9||t.length!==3||n===void 0||n.exitEdge===void 0||n.assignedLayer===void 0||o===void 0||t.some((i)=>i.connections.length!==2||i.componentId!==n.componentId||i.exitEdge!==n.exitEdge||i.assignedLayer!==n.assignedLayer||i.connections.some((s)=>{let a=s.exitTargetPoint;return s.sourceLayer!==o||a?.layer!==n.assignedLayer||!Number.isFinite(s.sourcePoint.x)||!Number.isFinite(s.sourcePoint.y)||!Number.isFinite(a?.x)||!Number.isFinite(a?.y)})))return null;let r=(i)=>Math.max(...i.connections.map((s)=>{let a=s.exitTargetPoint;return Math.hypot(a.x-s.sourcePoint.x,a.y-s.sourcePoint.y)}));return t.map((i)=>Number(r(i).toFixed(9)))}function ROr(e){let{bus:t,srj:n,config:o,staticClearanceCache:r}=e,i=t.allowedLayers,s=i===void 0?o.escapeLayers:o.escapeLayers.filter((l)=>i.includes(l));if(SS(t))return s;let a=s.filter((l)=>nY({srj:n,bus:t,targetLayer:l,acceptedPlans:[],layerNames:o.layerNames,traceWidth:o.traceWidth,viaDiameter:o.viaDiameter,viaHoleDiameter:o.viaHoleDiameter,clearance:o.clearance,compactBusTracks:o.compactBusTracks,allowBlindAndBuriedVias:o.allowBlindAndBuriedVias,allowSameNetMerges:o.allowSameNetMerges,staticClearanceCache:r})!==null);return a.length>0?a:s}var kve=class extends co{constructor(e,t={}){super();this.inputSrj=e,this.options=t,this.routingSrj={...e,obstacles:[...e.obstacles]},this.config=IOr(e,t),this.preparedBuses=rzr(this.routingSrj,t),vOr(this.preparedBuses,this.config);for(let r of this.preparedBuses){for(let s of r.connections){if(!s.hasExplicitLayeredExitTarget)continue;let a=s.exitTargetPoint?.layer;if(typeof a!=="string"||a.length===0||!this.config.layerNames.includes(a))throw Error(`FanoutSolver: connection exit target for "${s.connection.name}" uses unavailable layer "${String(a)}"`)}for(let s of r.allowedLayers??[])if(!this.config.layerNames.includes(s))throw Error(`FanoutSolver: bus "${r.busId}" allows unavailable layer "${s}"`);if(r.termination.type==="boundary"&&r.allowedLayers!==void 0&&!r.allowedLayers.some((s)=>this.config.escapeLayers.includes(s)))throw Error(`FanoutSolver: bus "${r.busId}" has no allowed layer in escapeLayers`);if(r.routableEscapeLayers=this.config.escapeLayers.filter((s)=>r.allowedLayers?.includes(s)??!0),r.termination.type!=="plane")continue;let i=r.termination.layer;if(!this.config.layerNames.includes(i))throw Error(`FanoutSolver: plane-terminated bus "${r.busId}" targets unavailable layer "${i}"`);if(r.allowedLayers!==void 0&&!r.allowedLayers.includes(i))throw Error(`FanoutSolver: plane-terminated bus "${r.busId}" targets disallowed layer "${i}"`);if(r.connections.some((s)=>s.sourceLayer===i))throw Error(`FanoutSolver: plane-terminated bus "${r.busId}" must target a layer below its source pad`)}this.boundaryBuses=this.preparedBuses.filter((r)=>r.termination.type==="boundary"),this.fixedPlaneAssignments=Object.fromEntries(this.preparedBuses.flatMap((r)=>r.termination.type==="plane"?[[r.busId,r.termination.layer]]:[]));let n=this.preparedBuses.length*3+8,o=this.boundaryBuses.length+1+this.config.maxLayerCombinations*n+this.preparedBuses.length*2+20;this.MAX_ITERATIONS=Math.max(1e4,o)}inputSrj;options;preparedBuses;attempts=[];layerAssignments=[];config;routingSrj;escapeLayersByBusId={};boundaryBuses;fixedPlaneAssignments;evaluatedAssignmentKeys=new Set;queuedAssignmentKeys=new Set;assignmentRepairDepthByKey=new Map;pendingRepairAssignments=[];routeStaticClearanceCache=new Map;routingPrefixCache=new Map;layerReservedRoutingEvaluated=!1;groupedBeamEvaluated=!1;routingInitialized=!1;nextCandidateLayerBusIndex=0;nextAssignmentIndex=0;nextGeneratedAssignmentIndex=0;activeOperation=null;inProgressPlans=[];activeRoutingVisualization=null;activeAdaptiveVisualization=null;bestAttempt=null;lengthMatchingFailure=null;endpointCompletion=null;getSolverName(){return"FanoutSolver"}shouldTryLayerReservedRouting(){if(this.config.allowBlindAndBuriedVias||this.boundaryBuses.length<4)return!1;if((this.config.compactBusTracks||this.config.borderDistribution==="even")&&this.boundaryBuses.some((i)=>i.connections.length>1&&i.connections.some((s)=>!s.hasExplicitLayeredExitTarget)))return!1;let e=this.preparedBuses[0],t=this.boundaryBuses.reduce((i,s)=>i+s.connections.length,0);if(this.inputSrj.connections.length-t<t||this.preparedBuses.some((i)=>i.componentId!==e.componentId||i.connections.some((s)=>s.sourceLayer!=="top"))||this.boundaryBuses.some((i)=>!i.exitEdge||i.exitEdge!==this.boundaryBuses[0].exitEdge||i.connections.length>8||!i.allowedLayers?.length||i.allowedLayers.some((s)=>!this.config.escapeLayers.includes(s))))return!1;let o=new Map,r=!1;for(let i of this.boundaryBuses){let s=i.allowedLayers.filter((a)=>a!=="top");if(!s.length)return!1;if(s.length>1)r=!0;if(s.length===1&&i.connections.length>2){let a=s[0];o.set(a,(o.get(a)??0)+1)}}return r&&[...o.values()].some((i)=>i>1)}*evaluateLayerReservedRoutingSteps(e=!1,t=!1){let n={...this.config,sourceOriginRouting:e,srj:this.routingSrj,buses:this.preparedBuses},o=t?xFr(n):zzr(n),r=o.next();while(!r.done){if(Hde(r.value)){this.stats={...this.stats,phase:"layer-reserved-route-layer",workUnit:r.value.routedConnectionCount,workUnitCount:this.inputSrj.connections.length,routedConnections:`${r.value.routedConnectionCount}/${this.inputSrj.connections.length}`,routingIterations:r.value.iterations};let l=yield r.value;r=o.next(l);continue}this.stats={...this.stats,phase:`layer-reserved-${r.value.phase}`,targetLayer:r.value.layer,workUnit:r.value.routedConnectionCount,workUnitCount:this.inputSrj.connections.length,routedConnections:`${r.value.routedConnectionCount}/${this.inputSrj.connections.length}`,routingIterations:r.value.iterations},yield,r=o.next()}if(!r.value||r.value.length!==this.inputSrj.connections.length)return null;let i=this.normalizeCompletePlanCorners(r.value);if(!i)return null;let s=YV({inputSrj:this.inputSrj,plans:i,layerNames:this.config.layerNames});if(!this.validateCompletePlans(i,s).valid)return null;let a=Object.fromEntries(i.map((l)=>[l.busId,l.targetLayer])),c=i.reduce((l,h)=>l+h.length,0)+T9e(i)*0.1+w9e(a,this.preparedBuses,this.config.balanceLayerLoadByConnectionCount)*B9e(this.config);return this.inProgressPlans=[...i],{plans:i,outputSrj:s,stopAfterCompleteValidation:!0,blockingBusIds:[],summary:{assignmentIndex:0,busLayerAssignments:a,routedBusCount:this.preparedBuses.length,routedConnectionCount:i.length,failedBusIds:[],score:c}}}stepRoutingInitialization(){let e=this.boundaryBuses[this.nextCandidateLayerBusIndex];if(e){this.escapeLayersByBusId[e.busId]=ROr({bus:e,srj:this.routingSrj,config:this.config,staticClearanceCache:this.routeStaticClearanceCache}),this.nextCandidateLayerBusIndex++,this.stats={phase:"discover-candidate-layers",bus:e.busId,busIndex:this.nextCandidateLayerBusIndex,busCount:this.boundaryBuses.length};return}let t=NLr({busIds:this.boundaryBuses.map((n)=>n.busId),layers:this.config.escapeLayers,layersByBusId:this.escapeLayersByBusId,maxAssignments:this.config.maxLayerCombinations}).map((n)=>({...n,...this.fixedPlaneAssignments}));this.layerAssignments.push(...EOr({initialAssignment:POr({buses:this.preparedBuses,escapeLayers:this.config.escapeLayers,escapeLayersByBusId:this.escapeLayersByBusId,traceWidth:this.config.traceWidth,viaDiameter:this.config.viaDiameter,clearance:this.config.clearance,preferOrderedCoordinatedWindingLayers:this.config.densePlaneReservationBusIds.length>0||this.config.denseUnrestrictedPlaneRoutingBusIds.length>0||eAn(this.preparedBuses,this.config.allowBlindAndBuriedVias)}),generatedAssignments:t,maxAssignments:this.config.maxLayerCombinations})),this.routingInitialized=!0,this.stats={phase:"prepare-layer-assignments",assignmentCount:this.layerAssignments.length}}*initializeRoutingSteps(){while(!this.routingInitialized)if(this.stepRoutingInitialization(),!this.routingInitialized)yield}setInProgressPlans(e){this.inProgressPlans=[...e.plans],this.stats={...this.stats,phase:e.phase,...e.strategy?{routingStrategy:e.strategy}:{},...e.unitIndex!==void 0?{workUnit:e.unitIndex}:{},...e.unitCount!==void 0?{workUnitCount:e.unitCount}:{},...e.busId?{bus:e.busId}:{},routedConnections:`${e.plans.length}/${this.inputSrj.connections.length}`}}visualizeCurrentState(){let e=this.endpointCompletion?.simpleRouteJson??(!this.solved&&!this.failed&&this.inProgressPlans.length>0?YV({inputSrj:this.inputSrj,plans:this.inProgressPlans,layerNames:this.config.layerNames}):void 0)??this.bestAttempt?.outputSrj??this.inputSrj;return COr(e)}visualizeWorkState(e){let t=this.visualizeCurrentState(),n=this.preparedBuses[0]?.sharedBoundary??this.inputSrj.bounds,o=typeof this.stats.bus==="string"?this.stats.bus:void 0,r=o?this.preparedBuses.find((d)=>d.busId===o):void 0,i=n.maxX-n.minX,s=n.maxY-n.minY,a=Math.max(Math.min(i,s)*0.025,0.25),c=typeof this.stats.phase==="string"?this.stats.phase:"starting",l=[typeof this.stats.routeConnection==="string"?`connection ${this.stats.routeConnection}`:void 0,typeof this.stats.searchBatch==="number"?`batch ${this.stats.searchBatch}`:void 0,typeof this.stats.expandedStates==="number"?`${this.stats.expandedStates.toLocaleString()} states`:void 0].filter(Boolean).join(" · "),h=`${e}: ${c}`;return{...WC(t,{rects:[{center:{x:(n.minX+n.maxX)/2,y:(n.minY+n.maxY)/2},width:i,height:s,fill:"rgba(0, 0, 0, 0)",stroke:"rgba(14, 165, 233, 0.8)",label:`${e} working boundary`}],circles:(r?.connections??[]).map((d)=>({center:d.sourcePoint,radius:Math.max(a,Math.min(d.sourceObstacle.width,d.sourceObstacle.height)*0.6),fill:"rgba(250, 204, 21, 0.25)",stroke:"#f59e0b",label:`active bus ${o}: ${d.connection.name}`})),texts:[{x:n.minX,y:n.maxY+a*2,text:`${e} · ${c}${l?` · ${l}`:""}`,color:"#0f172a",fontSize:a*1.5,anchorSide:"bottom_left"}]}),title:h}}visualizeBoundaryRoutingState(){if(!this.activeRoutingVisualization)return this.visualizeWorkState("BoundaryBusRoutingSolver");return{...WC(this.visualizeCurrentState(),this.activeRoutingVisualization),title:this.activeRoutingVisualization.title}}visualizeAdaptiveRoutingState(){if(this.activeAdaptiveVisualization)return this.activeAdaptiveVisualization;let e=this.preparedBuses[0]?.sharedBoundary??this.inputSrj.bounds,t=e.maxX-e.minX,n=e.maxY-e.minY,o=Math.max(Math.min(t,n)*0.02,0.2);return{title:"SingleLayerAdaptiveExitSolver: preparing flow grid",rects:[{center:{x:(e.minX+e.maxX)/2,y:(e.minY+e.maxY)/2},width:t,height:n,fill:"rgba(0, 0, 0, 0)",stroke:"rgba(14, 165, 233, 0.9)",label:"adaptive flow grid boundary"}],points:this.preparedBuses.flatMap((r)=>r.connections.map((i)=>({...i.sourcePoint,color:"#f97316",label:"adaptive route source"}))),texts:[{x:e.minX,y:e.maxY+o*2,text:"preparing adaptive flow grid",color:"#0f172a",fontSize:o*1.5,anchorSide:"bottom_left"}]}}startOperation(e){let t=this.createWorkSolver(e.name,e.generator,e.getProgress);this.MAX_ITERATIONS=Math.max(this.MAX_ITERATIONS,this.iterations+t.MAX_ITERATIONS+1),this.activeOperation={solver:t,onSolved:e.onSolved},this.activeSubSolver=t}createWorkSolver(e,t,n,o){return new bOr(e,t,o??(()=>this.visualizeWorkState(e)),()=>({...this.stats}),n??(()=>0))}*routeBusAlternativesWorkSteps(e,t){let n=_7e(e,t,!0),o=n.next();while(!o.done){let{winding:r}=o.value;if(r.visualization)this.activeRoutingVisualization=r.visualization;this.stats={...this.stats,phase:"route-boundary-bus-connection",bus:o.value.busId,targetLayer:o.value.targetLayer,routeOrderAttempt:r.routeOrderAttempt,routeConnection:`${r.connectionIndex+1}/${r.connectionCount}`,connection:r.connectionName,searchBatch:r.searchBatch,expandedStates:r.expandedStateCount,connectionComplete:r.connectionComplete},yield,o=n.next()}return o.value}stepActiveOperation(){let e=this.activeOperation;if(!e)return;if(e.solver.step(),e.solver.failed){this.failedSubSolvers=[...this.failedSubSolvers??[],e.solver],this.error=e.solver.error,this.failed=!0,this.activeOperation=null,this.activeSubSolver=null;return}if(!e.solver.solved)return;let t=e.solver.getOutput();this.activeOperation=null,this.activeSubSolver=null,e.onSolved(t)}completeBestAttemptEndpoints(){if(!this.options.completeOriginalEndpoints||this.endpointCompletion||!this.bestAttempt)return;this.endpointCompletion=ULr({inputSrj:this.routingSrj,fanoutSrj:this.bestAttempt.outputSrj,plans:this.bestAttempt.plans,traceWidth:this.config.traceWidth,viaDiameter:this.config.viaDiameter,viaHoleDiameter:this.config.viaHoleDiameter,clearance:this.config.clearance,allowBlindAndBuriedVias:this.config.allowBlindAndBuriedVias,effort:this.options.endpointCompletionEffort,routeDownstreamConnections:this.options.routeDownstreamConnections})}getValidationBoundary(){if(this.options.sharedBoundary)return this.options.sharedBoundary;let e=this.preparedBuses[0]?.sharedBoundary;if(!e)return this.inputSrj.bounds;return this.preparedBuses.slice(1).reduce((t,n)=>({minX:Math.min(t.minX,n.sharedBoundary.minX),maxX:Math.max(t.maxX,n.sharedBoundary.maxX),minY:Math.min(t.minY,n.sharedBoundary.minY),maxY:Math.max(t.maxY,n.sharedBoundary.maxY)}),{...e})}validateCompletePlans(e,t){return lOr({inputSrj:this.inputSrj,outputSrj:t,plans:e,preparedBuses:this.preparedBuses,sharedBoundary:this.getValidationBoundary(),clearance:this.config.clearance,allowBlindAndBuriedVias:this.config.allowBlindAndBuriedVias})}matchCompletePlanLengths(e,t={}){return Ey({plans:e,preparedBuses:this.preparedBuses,inputSrj:this.inputSrj,sharedBoundary:this.getValidationBoundary(),clearance:this.config.clearance,allowBlindAndBuriedVias:this.config.allowBlindAndBuriedVias,allowSameNetMerges:this.config.allowSameNetMerges,...t})}normalizeCompletePlanCorners(e){if(this.config.allowBlindAndBuriedVias)return[...e];let t=Git({...this.config,inputSrj:this.inputSrj,preparedBuses:this.preparedBuses,plans:e,repairPlaneSourceCorners:!0,repairSignalSourceCorners:!0,rematchRepairedLengths:(n)=>this.matchCompletePlanLengths(n,{maximumWorkUnits:1e4,allowMatchingInsideDenseBounds:!0}).plans});if(!t||t.every((n)=>_de(n,this.config.clearance).every((o)=>o.kind==="clearance")))return t;return QFr({...this.config,inputSrj:this.inputSrj,preparedBuses:this.preparedBuses,plans:t})}*routePeripheralMixedTerminationSteps(e){if(this.config.allowBlindAndBuriedVias)return null;let t=e.busesInRoutingOrder.find((g)=>g.termination.type==="boundary"&&(g.exitEdge==="right"||g.exitEdge==="left")&&g.connections.length>=16&&g.componentObstacles.length>=200);if(!t)return null;let n=e.busLayerAssignments[t.busId];if(!n)return null;let o=new Map(Object.entries(e.busLayerAssignments));this.setInProgressPlans({phase:"route-peripheral-source-escapes",plans:[],busId:t.busId});let r=(t.exitEdge==="left"?Yzr:Azr)({...this.config,srj:this.routingSrj,buses:this.preparedBuses,bus:t,targetLayer:n,targetLayerByBusId:o}),i=r.next();while(!i.done)yield,i=r.next();if(!i.value)return null;let s=i.value,a={...this.config,...s,srj:this.routingSrj,bus:t,targetLayer:n},c="lowerConnectionIndices"in s?b3n({...a,...s}):fzr(a),l=c.next();while(!l.done)yield,l=c.next();let h=l.value;if(!h&&"lowerConnectionIndices"in s){let g=Gzr({...a,...s,buses:this.preparedBuses}),f=g.next();while(!f.done)yield,f=g.next();if(f.value)s=f.value,h=f.value.plans}if(!h)return null;this.setInProgressPlans({phase:"route-peripheral-bus-continuations",plans:h,busId:t.busId});let d=A3n({...this.config,srj:this.routingSrj,buses:this.preparedBuses,sourceEscapes:s.sourceEscapes,sourceBoundary:s.sourceBoundary,initialPlans:h,targetLayerByBusId:o}),u=d.next();while(!u.done)yield,u=d.next();if(!u.value)return null;let _=Ozr({...this.config,srj:this.routingSrj,inputSrj:this.inputSrj,plans:u.value,preparedBuses:this.preparedBuses,sharedBoundary:this.getValidationBoundary()}),p=_.next();while(!p.done)yield,p=_.next();if(!p.value)return null;let m=this.normalizeCompletePlanCorners(p.value);if(!m)return null;let A=YV({inputSrj:this.inputSrj,plans:m,layerNames:this.config.layerNames});if(!this.validateCompletePlans(m,A).valid)return null;return{plans:m,failedBusIds:[],stopAfterCompleteValidation:!0}}*routeDenseThroughAllMixedTerminationSteps(e){if(this.config.allowBlindAndBuriedVias)return null;let t=e.preferredBoundaryViaPoints,n=e.denseRoutingStrategy!=="boundary-aligned",o=(...Ye)=>{if(Fa.env.FANOUT_DEBUG_DENSE==="1"){if(Fa.env.FANOUT_DEBUG_DENSE_SUMMARY==="1"&&!["start","plane-match:preflight-failed","plane-match:incremental-complete","plane-match:incremental-failed","plane-route:alternate-candidate-counts","plane-route:alternate-search","plane-route:csp","plane-reservation-core","plane-route:promote-failed","plane-route:alternate-choice","plane-route:promote-zero-candidates","length-match:complete","length-match:start","plane-route:failed","dense-validation"].includes(String(Ye[0])))return;console.error("dense:",...Ye)}},r=e.busesInRoutingOrder.filter((Ye)=>Ye.termination.type==="boundary"),i=r.filter((Ye)=>Ye.connections.length>=8),s=(Ye,je)=>je.componentId!==Ye.componentId&&this.config.layerNames.every((st)=>je.layers.includes(st))&&je.center.x>=Ye.componentBounds.minX&&je.center.x<=Ye.componentBounds.maxX&&je.center.y>=Ye.componentBounds.minY&&je.center.y<=Ye.componentBounds.maxY,a=i.some((Ye)=>this.routingSrj.obstacles.some((je)=>s(Ye,je))),c=this.preparedBuses.flatMap((Ye)=>Ye.termination.type==="plane"?Ye.connections.map((je)=>je.connection.name):[]),l=i.some((Ye)=>this.routingSrj.obstacles.some((je)=>s(Ye,je)&&c.some((st)=>kb(this.routingSrj,je,st)))),h=this.config.densePlaneReservationBusIds.length>0||this.config.denseUnrestrictedPlaneRoutingBusIds.length>0,d=!h&&eAn(this.preparedBuses,this.config.allowBlindAndBuriedVias),u=h||d,_=!h&&!d&&l,p=e.boundaryRecovery!==void 0,m=u||_||p,A=p||(d||_)&&((e.planeReservationRetryCount??0)===0||Boolean(e.preferredBoundaryViaPoints)),g=(u||_)&&e.lengthMatchingStage!=="before-planes",f=c3n(r.map((Ye)=>Ye.connections.length)),y=r.filter((Ye)=>Ye.connections.length===2),x=NOr({boundaryBusCount:r.length,pairBuses:y.map((Ye)=>({...Ye,assignedLayer:e.busLayerAssignments[Ye.busId]}))}),C=x?new Map(y.map((Ye,je)=>[Ye.busId,x[je]])):null,b=new Map;if(a)for(let Ye of dk(r,{viaDiameter:this.config.viaDiameter,viaHoleDiameter:this.config.viaHoleDiameter,traceWidth:this.config.traceWidth,clearance:this.config.clearance,additionalObstacles:this.routingSrj.obstacles}))b.set(Ye.connectionIndex,(b.get(Ye.connectionIndex)??0)+1);let I=(Ye)=>Ye.connections.reduce((je,st)=>je+(b.get(st.connectionIndex)??0),0),v=new Map;if(n&&!h)for(let Ye of i){if(!Vi(Ye.exitEdge,Ye.preferredExit)||new Set(Ye.routableEscapeLayers??Ye.allowedLayers??[]).size!==1)continue;let je=Ye.direction==="up"||Ye.direction==="down"?"y":"x",st=je==="x"?"y":"x",St=Ye.direction==="up"||Ye.direction==="right"?1:-1,Nt=Math.max(...Ye.connections.map((En)=>St*En.sourcePoint[je])),Ot=Math.min(...Ye.connections.map((En)=>En.sourcePoint[st])),Ut=Math.max(...Ye.connections.map((En)=>En.sourcePoint[st])),mn=je==="x"?Ye.pitchX:Ye.pitchY,_n=i.find((En)=>{if(En===Ye||En.componentId!==Ye.componentId||En.exitEdge!==Ye.exitEdge||Vi(En.exitEdge,En.preferredExit))return!1;let ln=Math.min(...En.connections.map((hn)=>St*hn.sourcePoint[je]))-Nt;return ln>=-0.000000001&&ln<=mn+0.000000001&&Math.min(...En.connections.map((hn)=>hn.sourcePoint[st]))<=Ut+0.000000001&&Math.max(...En.connections.map((hn)=>hn.sourcePoint[st]))>=Ot-0.000000001});if(_n)v.set(Ye,_n)}let P=u&&i.length===3,M=(Ye)=>{let je=Ye.connections.map((st)=>{let St=st.exitTargetPoint??st.targetPoint;return Ye.exitEdge==="top"||Ye.exitEdge==="bottom"?St.x:St.y});return{minimum:Math.min(...je),maximum:Math.max(...je)}},B=(Ye)=>{if(Ye.connections.length>=8)return!1;let je=M(Ye);return i.some((st)=>{if(st.exitEdge!==Ye.exitEdge)return!1;let St=M(st);return je.maximum>=St.minimum-0.000000001&&je.minimum<=St.maximum+0.000000001})},T=(Ye)=>{if(Ye.connections.length>=8)return;return i.find((je)=>{let st=je.connections.map((_n)=>_n.sourcePoint.x),St=je.connections.map((_n)=>_n.sourcePoint.y),Nt=Math.min(...st),Ot=Math.max(...st),Ut=Math.min(...St),mn=Math.max(...St);return Ye.connections.every((_n)=>_n.sourcePoint.x>=Nt-0.000000001&&_n.sourcePoint.x<=Ot+0.000000001&&_n.sourcePoint.y>=Ut-0.000000001&&_n.sourcePoint.y<=mn+0.000000001)})},N=(Ye)=>Boolean(T(Ye)),D=(Ye)=>B(Ye)&&!N(Ye)?0:Ye.connections.length>=8?1:Ye.connections.length>1?2:3,L=r.toSorted((Ye,je)=>{if(f||i.length>0){if(P){let Qn=D(Ye)-D(je);if(Qn!==0)return Qn}let En=r.length===2&&Math.max(...r.map((Qn)=>Qn.connections.length))>=8?Ye.connections.length-je.connections.length:je.connections.length-Ye.connections.length;if(En!==0)return En;if(a&&Ye.connections.length>=8&&je.connections.length>=8){let Qn=I(Ye)-I(je);if(Qn!==0)return Qn}}let st=e.busLayerAssignments[Ye.busId],St=e.busLayerAssignments[je.busId],Nt=C?.get(Ye.busId),Ot=C?.get(je.busId);if(Nt!==void 0&&Ot!==void 0&&Nt!==Ot)return Nt-Ot;let Ut=Number(Boolean(Vi(je.exitEdge,je.preferredExit)))-Number(Boolean(Vi(Ye.exitEdge,Ye.preferredExit)));if(Ut!==0)return Ut;if(!Boolean(Vi(Ye.exitEdge,Ye.preferredExit))){let En=(ln)=>{let hn=ln.connections.map((bo)=>bo.sourcePoint.x),Zn=ln.connections.map((bo)=>bo.sourcePoint.y);return Math.max(...hn)-Math.min(...hn)+Math.max(...Zn)-Math.min(...Zn)},Qn=En(je)-En(Ye);if(Math.abs(Qn)>0.000000001)return Qn}let _n=this.config.layerNames.indexOf(st??"")-this.config.layerNames.indexOf(St??"");if(_n!==0)return-_n;if(r.length!==6&&r.length!==7&&r.length!==8&&r.length!==9)return 0;return Ye.busId.localeCompare(je.busId)}),H=Fa.env.FANOUT_DEBUG_BOUNDARY_ORDER?.split(",")??(Fa.env.FANOUT_DEBUG_FIRST_BOUNDARY_BUS?[Fa.env.FANOUT_DEBUG_FIRST_BOUNDARY_BUS]:e.boundaryRecovery?[e.boundaryRecovery.busId]:[]),V=H.length>0?L.toSorted((Ye,je)=>{let st=H.indexOf(Ye.busId),St=H.indexOf(je.busId);return(st<0?Number.POSITIVE_INFINITY:st)-(St<0?Number.POSITIVE_INFINITY:St)}):L,O=this.preparedBuses.filter((Ye)=>Ye.termination.type==="plane"),U=new Set(O.flatMap((Ye)=>Ye.connections.map((je)=>je.connectionIndex))),j=this.config.allowSameNetMerges||_,Y=u||_?this.routingSrj.obstacles:void 0,X=Number.parseInt(Fa.env.FANOUT_INITIAL_PLANE_RESERVATIONS??"8",10),K=Fa.env.FANOUT_DEBUG_INITIAL_PLANE_INDICES?.split(",").map((Ye)=>Number(Ye)-1),J=Fa.env.FANOUT_DEBUG_INITIAL_PLANE_BUS_IDS?.split(","),ee=J?O.filter((Ye)=>J.includes(Ye.busId)):K?K.flatMap((Ye)=>O[Ye]?[O[Ye]]:[]):this.config.densePlaneReservationBusIds.length>0?O.filter((Ye)=>this.config.densePlaneReservationBusIds.includes(Ye.busId)):u||_?O.slice(0,Number.isFinite(X)?X:8):O;if(e.promotedPlaneReservationBusIds)ee=[...new Set([...ee,...O.filter((Ye)=>e.promotedPlaneReservationBusIds.includes(Ye.busId))])];let se=new Set,ne,re,Z=V.map((Ye)=>Ye.connections.length),te=BFr({boundaryBusConnectionCounts:Z,planeBusCount:O.length});if(o("start",V.map((Ye)=>`${Ye.busId}:${Ye.connections.length}`),`planes:${O.length}`,`joint:${f}`),V.length===0||te===null||V.some((Ye)=>!SS(Ye))||O.some((Ye)=>Ye.connections.length!==1)||V.length+O.length!==e.busesInRoutingOrder.length)return null;let ie=new Map(this.preparedBuses.flatMap((Ye)=>Ye.connections.map((je)=>[je.connectionIndex,je.connection.name]))),ue=Z.filter((Ye)=>Ye===1).length>1&&zot(Z),de=new Map(V.map((Ye)=>[Ye.busId,P&&Ye.connections.length<8&&N(Ye)?-1:1])),me=new Map(V.map((Ye)=>[Ye.busId,Ye.connections.length===1?P&&N(Ye)?!0:ue&&Vi(Ye.exitEdge,Ye.preferredExit)?Ode(Ye).targetProjection>0:kde(Ye.direction)!==Ye.exitEdge:P&&Ye.connections.length>=8?!1:kde(Ye.direction)!==Ye.exitEdge]));for(let Ye of i){if(u)continue;if(!Vi(Ye.exitEdge,Ye.preferredExit))continue;if(i.some((st)=>{if(st===Ye||st.componentId!==Ye.componentId)return!1;let St=st.connections.map((En)=>En.sourcePoint.x),Nt=st.connections.map((En)=>En.sourcePoint.y),Ot=Math.min(...St),Ut=Math.max(...St),mn=Math.min(...Nt),_n=Math.max(...Nt);return Ye.connections.some(({sourcePoint:En})=>{let Qn=En.x+(Ye.direction==="left"?-Ye.pitchX/2:Ye.direction==="right"?Ye.pitchX/2:0),ln=En.y+(Ye.direction==="down"?-Ye.pitchY/2:Ye.direction==="up"?Ye.pitchY/2:0);return Qn>=Ot&&Qn<=Ut&&ln>=mn&&ln<=_n})}))me.set(Ye.busId,!1)}if(e.boundaryRecovery)de.set(e.boundaryRecovery.busId,e.boundaryRecovery.perpendicularSide),me.set(e.boundaryRecovery.busId,e.boundaryRecovery.preferOutward);let ge=Fa.env.FANOUT_DEBUG_FLIP_BOUNDARY_BUS;if(ge)de.set(ge,-1);let xe=Fa.env.FANOUT_DEBUG_OUTWARD_BOUNDARY_BUS;if(xe)me.set(xe,!0);let Ee=(Ye,je)=>{let st=U.has(Ye)&&U.has(je);if(!this.config.allowSameNetMerges&&!(j&&st))return!1;let St=ie.get(Ye),Nt=ie.get(je);return Boolean(St&&Nt&&e5(this.routingSrj,St,Nt))},Re=V.filter((Ye)=>Ye.connections.length===1),Me=!P&&!_&&zot(Z)?Re.toSorted(V.length===9?TOr:DOr).slice(0,MOr(Z)):[],_e=V.length===8||V.length===9?Me.filter((Ye)=>{let je=e.busLayerAssignments[Ye.busId];return Boolean(je&&I3n({singletonBus:Ye,singletonTargetLayer:je,wideBuses:V}))}):[],ye=P?Re.filter((Ye)=>{let je=T(Ye),st=e.busLayerAssignments[Ye.busId];if(!je||!st)return!1;let St=je.routableEscapeLayers??je.allowedLayers??[],Nt=Ye.exitEdge==="left"||Ye.exitEdge==="right"?"x":"y",Ot=je.connections.map((_n)=>_n.sourcePoint[Nt]),Ut=Ye.exitEdge==="left"||Ye.exitEdge==="bottom"?Math.min(...Ot):Math.max(...Ot),mn=Ye.connections.every((_n)=>Math.abs(_n.sourcePoint[Nt]-Ut)<0.000000001);return Boolean(!St.includes(st)||d&&mn&&Vi(Ye.exitEdge,Ye.preferredExit))}):[],Se=ye.flatMap((Ye)=>{let je=T(Ye),st=e.busLayerAssignments[Ye.busId];return V.filter((St)=>St.connections.length>1&&St.connections.length<8&&St.direction===Ye.direction&&e.busLayerAssignments[St.busId]===st&&T(St)===je)}),Ne=Fa.env.FANOUT_DEBUG_DISABLE_LEADING_NARROW==="1"?[]:ye.flatMap((Ye)=>[Ye,...Se.filter((je)=>je.direction===Ye.direction&&e.busLayerAssignments[je.busId]===e.busLayerAssignments[Ye.busId])]),Le=[..._e,...Ne].filter((Ye,je,st)=>st.indexOf(Ye)===je),nt=new Map;if(V.length===9&&Le.length>0)for(let Ye of Le){me.set(Ye.busId,!0);let je=Vi(Ye.exitEdge,Ye.preferredExit);if(!Ye.exitEdge||!je)continue;let st=`${Ye.exitEdge}:${je}`;if(!V.some((Nt)=>{if(Nt===Ye||Nt.connections.length<8)return!1;return Nt.exitEdge===Ye.exitEdge&&Vi(Nt.exitEdge,Nt.preferredExit)===je}))continue;nt.set(st,(nt.get(st)??0)+Ye.connections.length)}let dt=new Set([...Fa.env.FANOUT_DEBUG_PROVISIONAL_NARROW==="1"?V.filter((Ye)=>Ye.connections.length<8):[],...Me.filter((Ye)=>{let je=T(Ye),st=Ye.connections[0].sourcePoint,St={x:(Ye.componentBounds.minX+Ye.componentBounds.maxX)/2,y:(Ye.componentBounds.minY+Ye.componentBounds.maxY)/2},Nt=Ye.exitEdge?zS(Ye.exitEdge):Ye.direction,Ot=Nt==="right"?St.x-st.x:Nt==="left"?st.x-St.x:Nt==="up"?St.y-st.y:st.y-St.y,Ut=n&&!u&&je&&(e.busLayerAssignments[je.busId]===e.busLayerAssignments[Ye.busId]||Ot>0.000000001);return!Le.includes(Ye)&&!Ut}),...P?V.filter((Ye)=>Ye.connections.length===2&&!B(Ye)&&!Le.includes(Ye)):[]]),rt=(Ye)=>{let je=Vi(Ye.exitEdge,Ye.preferredExit);if(!Ye.exitEdge||!je)return 0;let st=nt.get(`${Ye.exitEdge}:${je}`)??0;return wOr({leadingLaneCount:st,traceWidth:this.config.traceWidth,viaDiameter:this.config.viaDiameter,clearance:this.config.clearance})},pt=V.filter((Ye)=>!dt.has(Ye)),ct=f?Yu([...ee,...pt],{viaDiameter:this.config.viaDiameter,viaHoleDiameter:this.config.viaHoleDiameter,traceWidth:this.config.traceWidth,clearance:this.config.clearance,maximumSearchStates:1e5,preferredViaPointsByConnectionIndex:e.preferredBoundaryViaPoints,preferredBoundaryPerpendicularSideByBusId:de,preferBoundaryOutwardByBusId:me,additionalObstacles:Y,preferPlaneCheckerboardSites:u,canShareCopper:Ee}):null,Ct=ct??Yu([...ee,V[0]],{viaDiameter:this.config.viaDiameter,viaHoleDiameter:this.config.viaHoleDiameter,traceWidth:this.config.traceWidth,clearance:this.config.clearance,maximumSearchStates:20000,preferredViaPointsByConnectionIndex:e.preferredBoundaryViaPoints,preferredBoundaryPerpendicularSideByBusId:de,preferBoundaryOutwardByBusId:me,additionalObstacles:Y,preferPlaneCheckerboardSites:u,canShareCopper:Ee}),kt=Fa.env.FANOUT_DEBUG_FIXED_VIAS;if(Ct&&kt){Ct=new Map(Ct);for(let Ye of kt.split(",")){let je=Ye.split(":"),st=je.pop(),St=je.pop(),Nt=je.join(":"),Ot=[...ie].find(([,_n])=>_n===Nt)?.[0],Ut=Number(St),mn=Number(st);if(Ot!==void 0&&Number.isFinite(Ut)&&Number.isFinite(mn))Ct.set(Ot,{x:Ut,y:mn})}}let Lt=Fa.env.FANOUT_DEBUG_STAGED_PLANE_BUS_IDS?O.filter((Ye)=>Fa.env.FANOUT_DEBUG_STAGED_PLANE_BUS_IDS.split(",").includes(Ye.busId)):Fa.env.FANOUT_DEBUG_STAGED_PLANE_INDICES?.split(",").flatMap((Ye)=>O[Number(Ye)-1]?[O[Number(Ye)-1]]:[])??[];if(Ct&&Lt.length>0)for(let Ye of Lt){if(ee.includes(Ye))continue;let je=Yu([...ee,Ye,...pt],{viaDiameter:this.config.viaDiameter,viaHoleDiameter:this.config.viaHoleDiameter,traceWidth:this.config.traceWidth,clearance:this.config.clearance,maximumSearchStates:1e5,preferredViaPointsByConnectionIndex:e.preferredBoundaryViaPoints,preferredBoundaryPerpendicularSideByBusId:de,preferBoundaryOutwardByBusId:me,fixedViaPointsByConnectionIndex:Ct,additionalObstacles:Y,preferPlaneCheckerboardSites:u,canShareCopper:Ee});if(o("plane-reservation:staged",Ye.busId,je?.size??"failed"),!je)break;Ct=new Map([...Ct,...je]),ee.push(Ye)}if(o("seed",Ct?.size??"failed"),Ct&&Fa.env.FANOUT_DEBUG_DENSE_POINTS==="1")console.error("dense: seed-points",[...Ct].map(([Ye,je])=>({connection:ie.get(Ye),point:je})));let Bt=1,xt=V.length+O.length+3;if(this.setInProgressPlans({phase:"reserve-dense-via-sites",plans:[],strategy:"default",unitIndex:Bt,unitCount:xt}),yield,Ct){let Ye=TFr({busesInRoutingOrder:[...a?[]:_e,...V.filter((Oe)=>(a||!_e.includes(Oe))&&!Ne.includes(Oe)).flatMap((Oe)=>[...Ne.filter((mt)=>T(mt)===Oe),Oe])],busLayerAssignments:e.busLayerAssignments,routingMode:te}),je=i.every((Oe)=>Oe.exitEdge&&Oe.direction===zS(Oe.exitEdge)),st=_&&je?Re.filter((Oe)=>{let mt=T(Oe);return Boolean(mt&&Oe.direction===mt.direction)}):[];if(e.boundaryRecovery&&st.length>0){let Oe=Ye.findIndex((mt)=>mt.busId===e.boundaryRecovery.busId);if(Oe>=0){let mt=Ye[Oe],It=new Set(st),bt=Ye.filter((cn)=>cn!==mt&&!It.has(cn));Ye.splice(0,Ye.length,mt,...st,...bt)}}for(let[Oe]of v){let mt=Oe.direction==="up"||Oe.direction==="down"?"y":"x",It=Oe.direction==="up"||Oe.direction==="right"?1:-1,bt=Math.min(...Oe.connections.map((wn)=>It*wn.sourcePoint[mt])),cn=Ye.indexOf(Oe),dn=Ye.findIndex((wn)=>wn!==Oe&&wn.connections.length>=8&&wn.componentId===Oe.componentId&&wn.direction===Oe.direction&&Math.max(...wn.connections.map((eo)=>It*eo.sourcePoint[mt]))<=bt+0.000000001&&wn.exitEdge===Oe.exitEdge&&Vi(wn.exitEdge,wn.preferredExit)===Vi(Oe.exitEdge,Oe.preferredExit));if(dn>=0&&dn<cn)Ye.splice(cn,1),Ye.splice(dn,0,Oe)}let St=(Oe,mt)=>{if(!n||Oe.componentId!==mt.componentId||Oe.exitEdge!==mt.exitEdge||Oe.direction!==mt.direction||Vi(Oe.exitEdge,Oe.preferredExit)!==Vi(mt.exitEdge,mt.preferredExit)||e.busLayerAssignments[Oe.busId]!==e.busLayerAssignments[mt.busId]||T(Oe)!==T(mt)||!T(Oe))return!1;let It={x:Oe.connections.reduce((wn,eo)=>wn+eo.sourcePoint.x,0)/Oe.connections.length,y:Oe.connections.reduce((wn,eo)=>wn+eo.sourcePoint.y,0)/Oe.connections.length},bt={x:mt.connections.reduce((wn,eo)=>wn+eo.sourcePoint.x,0)/mt.connections.length,y:mt.connections.reduce((wn,eo)=>wn+eo.sourcePoint.y,0)/mt.connections.length};if(Math.hypot(It.x-bt.x,It.y-bt.y)>1.5*Math.min(Oe.pitchX,Oe.pitchY))return!1;let cn=Oe.exitEdge==="left"||Oe.exitEdge==="right"?"y":"x",dn=(wn)=>wn.connections.reduce((eo,_o)=>eo+(_o.exitTargetPoint??_o.targetPoint)[cn],0)/wn.connections.length;return(It[cn]-bt[cn])*(dn(Oe)-dn(mt))<-0.000000001},Nt=new Set;for(let Oe of Le){if(Vi(Oe.exitEdge,Oe.preferredExit))continue;for(let mt of V){if(mt.connections.length!==2||!St(mt,Oe))continue;let It=Ye.indexOf(mt),bt=Ye.indexOf(Oe);if(It>bt)Ye.splice(It,1),Ye.splice(bt,0,mt),Nt.add(`${mt.componentId}:${mt.exitEdge}`)}}for(let Oe of V){if(!Nt.has(`${Oe.componentId}:${Oe.exitEdge}`)||Oe.connections.length!==2||!Vi(Oe.exitEdge,Oe.preferredExit))continue;for(let mt of Re){if(!St(mt,Oe))continue;let It=Ye.indexOf(mt),bt=Ye.indexOf(Oe);if(It>bt)Ye.splice(It,1),Ye.splice(bt,0,mt)}}for(let Oe of v.values())for(let mt of V){if(mt.connections.length!==2||T(mt)!==Oe)continue;for(let It of Re){if(!St(It,mt))continue;let bt=Ye.indexOf(mt),cn=Ye.indexOf(It);if(cn>bt)Ye.splice(cn,1),Ye.splice(bt,0,It)}}let Ot=Ct,Ut=[],mn=!0,_n=(Oe)=>{let mt=new Set(Oe.connections.map((It)=>It.connection.name));return this.preparedBuses.flatMap((It)=>{let bt=e.busLayerAssignments[It.busId];if(!bt)return[];return It.connections.flatMap((cn)=>{if(mt.has(cn.connection.name))return[];let dn=Ot.get(cn.connectionIndex);if(!dn)return[];return[{connectionName:cn.connection.name,sourceEscapeSegment:Ut.some((wn)=>wn.connectionIndex===cn.connectionIndex)?void 0:{start:cn.sourcePoint,end:dn,layer:cn.sourceLayer,width:this.config.traceWidth},via:{center:dn,diameter:this.config.viaDiameter,spanLayers:t5({fromLayer:cn.sourceLayer,toLayer:bt,layerNames:this.config.layerNames,allowBlindAndBuriedVias:!1})}}]})})},En=function*(Oe){if(o("route:start",Oe.busId,Ut.length),Fa.env.FANOUT_DEBUG_DENSE_POINTS==="1")console.error("dense: points",Oe.busId,Oe.connections.map((Tn)=>({source:Tn.sourcePoint,via:Ot.get(Tn.connectionIndex),target:Tn.exitTargetPoint??Tn.targetPoint})));let mt=e.busLayerAssignments[Oe.busId];if(!mt)return!1;let It=!u&&!Vi(Oe.exitEdge,Oe.preferredExit)&&Oe.connections.length>2&&i.some((Tn)=>Vi(Tn.exitEdge,Tn.preferredExit)),bt=this.config.traceWidth+this.config.clearance,cn=Oe.connections.some((Tn)=>{let lo=Tn.exitTargetPoint??Tn.targetPoint,fo=Oe.sharedBoundary;return Oe.exitEdge==="left"||Oe.exitEdge==="right"?lo.y-fo.minY<=bt+0.000000001||fo.maxY-lo.y<=bt+0.000000001:lo.x-fo.minX<=bt+0.000000001||fo.maxX-lo.x<=bt+0.000000001}),dn={srj:this.routingSrj,bus:Oe,targetLayer:mt,acceptedPlans:Ut,layerNames:this.config.layerNames,traceWidth:this.config.traceWidth,viaDiameter:this.config.viaDiameter,viaHoleDiameter:this.config.viaHoleDiameter,clearance:this.config.clearance,compactBusTracks:this.config.compactBusTracks,allowBlindAndBuriedVias:!1,allowSameNetMerges:this.config.allowSameNetMerges,staticClearanceCache:this.routeStaticClearanceCache,fixedViaPointsByConnectionIndex:Ot,reservedVias:_n(Oe),viaMinimalOnly:Fa.env.FANOUT_DEBUG_ALLOW_EXTRA_VIAS!=="1",allowBoundarySideViaFallback:Oe.connections.length===1,preferCornerBoundaryVia:u,adaptiveWindingRouteOrder:It,allowFixedViaReservedExitFallback:p,forbidEarlyExitBoundaryContact:cn,alignWindingGridToPads:n&&!h,fixedViaFallbackRouteOrderAttempts:It?60:u?6:24,cornerBandTargetTrackOffset:rt(Oe)},wn=function*(Tn,lo){return this.activeRoutingVisualization=null,yield{type:"subsolver",solver:this.createWorkSolver("BoundaryBusRoutingSolver",this.routeBusAlternativesWorkSteps(Tn,lo),void 0,()=>this.visualizeBoundaryRoutingState())}}.bind(this),_o=(Oe.routableEscapeLayers??Oe.allowedLayers??[]).some((Tn)=>Tn!==mt)?{...Oe,routableEscapeLayers:[mt]}:Oe,$n=V.some((Tn)=>Tn.connections.length<8&&T(Tn)===Oe&&Ut.some((lo)=>lo.busId===Tn.busId)),qn=u&&_o!==Oe&&!$n,Po=!1,To=(yield*wn(qn?{...dn,bus:_o}:dn,1))[0];if(!To&&qn)To=(yield*wn(dn,1))[0];if(!To){let Tn=Ot,lo=me.get(Oe.busId)??!0,fo=de.get(Oe.busId)??1;for(let[oo,Ro]of[[!lo,fo],[lo,-fo],[!lo,-fo]]){let or=Yu([...new Set([...ee,...pt,...this.preparedBuses.filter((Er)=>Ut.some((Xi)=>Xi.busId===Er.busId)),Oe])],{viaDiameter:this.config.viaDiameter,viaHoleDiameter:this.config.viaHoleDiameter,traceWidth:this.config.traceWidth,clearance:this.config.clearance,maximumSearchStates:1e5,preferredBoundaryPerpendicularSideByBusId:new Map([...de,[Oe.busId,Ro]]),preferBoundaryOutwardByBusId:new Map([...me,[Oe.busId,oo]]),fixedViaPointsByConnectionIndex:new Map(Ut.filter((Er)=>Er.via).map((Er)=>[Er.connectionIndex,Er.via.center])),preferredViaPointsByConnectionIndex:new Map([...Tn].filter(([Er])=>!Oe.connections.some((Xi)=>Xi.connectionIndex===Er))),blockingSegments:Ut.flatMap((Er)=>Er.segments.map((Xi)=>({connectionIndex:Er.connectionIndex,segment:Xi}))),additionalObstacles:this.routingSrj.obstacles,preferPlaneCheckerboardSites:u,canShareCopper:Ee});if(o("retry-sites",Oe.busId,oo,Ro,or?.size??"failed"),!or)continue;if(Ot=or,To=(yield*wn({...dn,fixedViaPointsByConnectionIndex:or,reservedVias:_n(Oe),alignWindingGridToPads:u,fixedViaFallbackRouteOrderAttempts:3},1))[0],To)break}if(!To){if(Ot=Tn,Oe.connections.length===2)To=(yield*wn({...dn,fixedViaPointsByConnectionIndex:Tn,reservedVias:_n(Oe),allowBoundarySideViaFallback:!0,fixedViaFallbackRouteOrderAttempts:1},1))[0]}}if(!To&&d&&Oe.connections.length>=8&&Vi(Oe.exitEdge,Oe.preferredExit)&&new Set(Oe.routableEscapeLayers??Oe.allowedLayers??[]).size===1&&!Ut.some((Tn)=>i.some((lo)=>lo.busId===Tn.busId))){let Tn=_n(Oe),lo=oHr(Oe,{viaDiameter:this.config.viaDiameter,viaHoleDiameter:this.config.viaHoleDiameter,traceWidth:this.config.traceWidth,clearance:this.config.clearance,additionalObstacles:this.routingSrj.obstacles,blockingSegments:[...Ut.flatMap((fo)=>fo.segments.map((oo)=>({connectionIndex:fo.connectionIndex,segment:oo}))),...Tn.flatMap((fo)=>fo.sourceEscapeSegment?[{connectionIndex:-1,segment:fo.sourceEscapeSegment}]:[])],blockingVias:[...Ut.flatMap((fo)=>fo.via?[{connectionIndex:fo.connectionIndex,...fo.via}]:[]),...Tn.map((fo)=>({connectionIndex:-1,...fo.via}))]},Ot);for(let fo of lo){let oo=(yield*wn({...dn,fixedViaPointsByConnectionIndex:fo,reservedVias:Tn,fixedViaFallbackRouteOrderAttempts:1},1))[0];if(!oo)continue;To=oo,Ot=fo,Po=!0;break}}if(!To&&d&&Oe.connections.length>=8&&Vi(Oe.exitEdge,Oe.preferredExit)){if(To=(yield*wn({...dn,fixedViaPointsByConnectionIndex:void 0,reservedVias:_n(Oe)},1))[0],To)Po=!0,Ot=new Map([...Ot,...To.filter((Tn)=>Tn.via).map((Tn)=>[Tn.connectionIndex,Tn.via.center])]);o("local-sites",Oe.busId,To?.length??"failed")}if(!To&&Oe.connections.length>=8&&(v.has(Oe)||V.some((Tn)=>Tn.connections.length>=8&&Ut.some((lo)=>lo.busId===Tn.busId)))){let Tn=new Set(Ut.map((oo)=>oo.connectionName)),lo=new Set(this.preparedBuses.filter((oo)=>oo.termination.type==="plane"||oo===v.get(Oe)).flatMap((oo)=>oo.connections.map((Ro)=>Ro.connection.name)).filter((oo)=>!Tn.has(oo))),fo=(yield*wn({...dn,fixedViaPointsByConnectionIndex:void 0,reservedVias:dn.reservedVias.filter((oo)=>!lo.has(oo.connectionName)),softReservedVias:dn.reservedVias.filter((oo)=>lo.has(oo.connectionName))},1))[0];if(fo){let oo=[...Ut,...fo],Ro=Yu(this.preparedBuses,{viaDiameter:this.config.viaDiameter,viaHoleDiameter:this.config.viaHoleDiameter,traceWidth:this.config.traceWidth,clearance:this.config.clearance,maximumSearchStates:3000000,preferredBoundaryPerpendicularSideByBusId:de,preferBoundaryOutwardByBusId:me,fixedViaPointsByConnectionIndex:new Map(oo.filter((or)=>or.via).map((or)=>[or.connectionIndex,or.via.center])),preferredViaPointsByConnectionIndex:Ot,blockingSegments:oo.flatMap((or)=>or.segments.map((Er)=>({connectionIndex:or.connectionIndex,segment:Er}))),additionalObstacles:this.routingSrj.obstacles,preferPlaneCheckerboardSites:u,canShareCopper:Ee});if(o("free-sites:rematched",Oe.busId,Ro?.size??"failed"),Ro)To=fo,Ot=Ro,Po=!0}}if(To&&Oe.maxLengthSkew!==void 0){let Tn=To.map((oo)=>oo.length),lo=Math.max(...Tn)-Math.min(...Tn);if(BOr({boundaryBusCount:V.length,connectionCount:Oe.connections.length,rawSkew:lo,maximumSkew:Oe.maxLengthSkew})&&!g&&!Po)To=(yield*wn(dn,3)).toSorted((oo,Ro)=>{let or=oo.map((Xi)=>Xi.length),Er=Ro.map((Xi)=>Xi.length);return Math.max(...or)-Math.min(...or)-(Math.max(...Er)-Math.min(...Er))})[0]}if(!To){if(ne??=Oe,Oe.connections.length>=8)re??=Oe;return o("route:failed",Oe.busId),!1}if(Ut.push(...To),Ut.length===V.reduce((Tn,lo)=>Tn+lo.connections.length,0)&&Ut.some((Tn)=>{let lo=V.find((oo)=>oo.busId===Tn.busId);if(lo?.connections.length!==1||!Tn.via)return!1;let{center:fo}=Tn.via;return fo.x<lo.componentBounds.minX||fo.x>lo.componentBounds.maxX||fo.y<lo.componentBounds.minY||fo.y>lo.componentBounds.maxY}))t=new Map(Ut.filter((Tn)=>Tn.via).map((Tn)=>[Tn.connectionIndex,Tn.via.center]));return o("route:complete",Oe.busId,To.length),!0}.bind(this),Qn=[],ln=(Oe)=>{if(Oe.connections.length>=8&&!u&&!_&&Fa.env.FANOUT_DEBUG_NO_PLANE_EXPANSION!=="1"&&ee.length<O.length)ee=O,o("plane-reservations:expanded",O.length)},hn=te==="large_boundary_only"?Ye:Ye.slice(0,1),Zn;for(let Oe of hn){let mt=yield*En(Oe);if(this.setInProgressPlans({phase:"route-dense-boundary-buses",plans:Ut,strategy:"default",unitIndex:++Bt,unitCount:xt,busId:Oe.busId}),yield,!mt)continue;Zn=Oe;break}if(Zn)Qn.push(Zn),ln(Zn);else mn=!1;let bo=Ye.filter((Oe)=>Oe!==Zn);while(mn&&bo.length>0){let Oe=Ut.flatMap((It)=>It.segments.map((bt)=>({connectionIndex:It.connectionIndex,segment:bt}))),mt=-1;for(let It=0;It<bo.length;It++){let bt=bo[It];o("candidate:start",bt.busId);let cn=new Map(Ot),dn=Fa.env.FANOUT_DEBUG_LATE_FIXED_VIAS;if(dn){let Tn=new Set(bt.connections.map((lo)=>lo.connectionIndex));for(let lo of dn.split(",")){let fo=lo.split(":"),oo=fo.pop(),Ro=fo.pop(),or=fo.join(":"),Er=[...ie].find(([,aa])=>aa===or)?.[0],Xi=Number(Ro),Ys=Number(oo);if(Er!==void 0&&Tn.has(Er)&&Number.isFinite(Xi)&&Number.isFinite(Ys))cn.set(Er,{x:Xi,y:Ys})}}let wn=bt.connections.every((Tn)=>cn.has(Tn.connectionIndex)),eo=ct&&wn?new Map(cn):Yu([...ee,...Qn,bt],{viaDiameter:this.config.viaDiameter,viaHoleDiameter:this.config.viaHoleDiameter,traceWidth:this.config.traceWidth,clearance:this.config.clearance,maximumSearchStates:1e5,preferredBoundaryPerpendicularSideByBusId:de,preferBoundaryOutwardByBusId:me,fixedViaPointsByConnectionIndex:cn,blockingSegments:Oe,additionalObstacles:Y,preferPlaneCheckerboardSites:u,canShareCopper:Ee}),_o=eo?new Map([...cn,...eo]):null;if(o("candidate:matched",bt.busId,_o?.size??"failed"),this.setInProgressPlans({phase:"reserve-next-dense-boundary-bus",plans:Ut,strategy:"default",unitIndex:Bt,unitCount:xt,busId:bt.busId}),yield,!_o)continue;let $n=Ot,qn=Ut.length,Po=bo.filter((Tn,lo)=>lo!==It),To=_o;if(Po.length===1){let Tn=Po[0],lo=Yu([...ee,...Qn,bt,Tn],{viaDiameter:this.config.viaDiameter,viaHoleDiameter:this.config.viaHoleDiameter,traceWidth:this.config.traceWidth,clearance:this.config.clearance,maximumSearchStates:1e5,preferredBoundaryPerpendicularSideByBusId:de,preferBoundaryOutwardByBusId:me,fixedViaPointsByConnectionIndex:_o,blockingSegments:Oe,additionalObstacles:Y,preferPlaneCheckerboardSites:u,canShareCopper:Ee});if(o("future:matched",Tn.busId,lo?.size??"failed"),lo){let fo=new Map;for(let or of dk([Tn],{viaDiameter:this.config.viaDiameter,viaHoleDiameter:this.config.viaHoleDiameter,traceWidth:this.config.traceWidth,clearance:this.config.clearance,blockingSegments:Oe,additionalObstacles:Y,preferPlaneCheckerboardSites:u,canShareCopper:Ee}))fo.set(or.connectionIndex,(fo.get(or.connectionIndex)??0)+1);let oo=Tn.connections.toSorted((or,Er)=>(fo.get(or.connectionIndex)??0)-(fo.get(Er.connectionIndex)??0)||or.connectionIndex-Er.connectionIndex),Ro=new Map(_o);for(let or of oo){let Er=lo.get(or.connectionIndex);if(Er)Ro.set(or.connectionIndex,Er)}To=Ro}}if(Ot=To,yield*En(bt)){o("lookahead:start",bt.busId);let Tn=Po.length===0||Po.some((lo)=>{let fo=Ut.flatMap((oo)=>oo.segments.map((Ro)=>({connectionIndex:oo.connectionIndex,segment:Ro})));return Boolean(Yu([...ee,...Qn,bt,lo],{viaDiameter:this.config.viaDiameter,viaHoleDiameter:this.config.viaHoleDiameter,traceWidth:this.config.traceWidth,clearance:this.config.clearance,maximumSearchStates:1e5,preferredBoundaryPerpendicularSideByBusId:de,preferBoundaryOutwardByBusId:me,fixedViaPointsByConnectionIndex:Ot,blockingSegments:fo,additionalObstacles:Y,preferPlaneCheckerboardSites:u,canShareCopper:Ee}))});if(o("lookahead:complete",bt.busId,Tn),Tn){mt=It,Qn.push(bt),ln(bt),this.setInProgressPlans({phase:"route-dense-boundary-buses",plans:Ut,strategy:"default",unitIndex:++Bt,unitCount:xt,busId:bt.busId}),yield;break}Ut.splice(qn)}Ot=$n,this.setInProgressPlans({phase:"retry-dense-boundary-bus",plans:Ut,strategy:"default",unitIndex:Bt,unitCount:xt,busId:bt.busId}),yield}if(mt<0){mn=!1;break}bo.splice(mt,1)}let ir=null;if(mn){let Oe=null,mt=[],It=(cn,dn=new Set)=>{mt=[],ir=null;let wn=new Map(cn.flatMap((Tn)=>Tn.via?[[Tn.connectionIndex,Tn.via.center]]:[])),eo=cn.flatMap((Tn)=>Tn.segments.map((lo)=>({connectionIndex:Tn.connectionIndex,segment:lo}))),_o=!u||cn.some((Tn)=>Tn.segments.filter((lo)=>lo.layer===Tn.sourceLayer).length>1),$n=!_o?V:[],qn=!_o?[]:cn.flatMap((Tn)=>[Tn.via,...Tn.additionalVias??[],Tn.planeEndpointVia].filter((lo)=>lo!==void 0).map((lo)=>({connectionIndex:Tn.connectionIndex,center:lo.center,diameter:lo.diameter,spanLayers:lo.spanLayers}))),Po=!_o?null:Yu(O,{viaDiameter:this.config.viaDiameter,viaHoleDiameter:this.config.viaHoleDiameter,traceWidth:this.config.traceWidth,clearance:this.config.clearance,maximumSearchStates:1,preferredBoundaryPerpendicularSideByBusId:de,preferBoundaryOutwardByBusId:me,fixedViaPointsByConnectionIndex:new Map([...Ot,...wn]),blockingSegments:eo,blockingVias:qn,additionalObstacles:Y,preferPlaneCheckerboardSites:u,canShareCopper:Ee});if(Po)return new Map([...wn,...Po]);if(m||Fa.env.FANOUT_DEBUG_INCREMENTAL_PLANE_MATCH==="1"){let Tn=new Map(wn),lo=p?[]:[...ee];for(let Jo of lo)for(let zr of Jo.connections){let $r=Ot.get(zr.connectionIndex);if($r)Tn.set(zr.connectionIndex,$r)}for(let Jo of lo){let zr=e.busLayerAssignments[Jo.busId];if(!zr)return null;let $r=nY({srj:this.routingSrj,bus:Jo,targetLayer:zr,acceptedPlans:[...cn,...mt],layerNames:this.config.layerNames,traceWidth:this.config.traceWidth,viaDiameter:this.config.viaDiameter,viaHoleDiameter:this.config.viaHoleDiameter,clearance:this.config.clearance,compactBusTracks:this.config.compactBusTracks,allowBlindAndBuriedVias:!1,allowSameNetMerges:j,staticClearanceCache:this.routeStaticClearanceCache,fixedViaPointsByConnectionIndex:Tn});if(!$r)return null;mt.push(...$r)}let fo=O.filter((Jo)=>!lo.includes(Jo)&&!Yu([...lo,Jo,...$n],{viaDiameter:this.config.viaDiameter,viaHoleDiameter:this.config.viaHoleDiameter,traceWidth:this.config.traceWidth,clearance:this.config.clearance,maximumSearchStates:1e5,preferredBoundaryPerpendicularSideByBusId:de,preferBoundaryOutwardByBusId:me,fixedViaPointsByConnectionIndex:Tn,blockingSegments:eo,blockingVias:qn,additionalObstacles:Y,preferPlaneCheckerboardSites:u,canShareCopper:Ee})),oo=Math.min(...O.map((Jo)=>this.config.layerNames.indexOf(e.busLayerAssignments[Jo.busId]??""))),Ro=u||Fa.env.FANOUT_DEBUG_ROUTE_DEEP_PLANES_FIRST==="1"?O.filter((Jo)=>!lo.includes(Jo)&&this.config.layerNames.indexOf(e.busLayerAssignments[Jo.busId]??"")>oo):[],or=new Set([...dn,...this.config.denseUnrestrictedPlaneRoutingBusIds,...Fa.env.FANOUT_DEBUG_ADDITIONAL_ALTERNATE_PLANE_BUS_IDS?.split(",")??[]]),Er=O.filter((Jo)=>!lo.includes(Jo)&&or.has(Jo.busId)),Xi=[...Ro,...fo.filter((Jo)=>!Ro.includes(Jo)),...Er.filter((Jo)=>!Ro.includes(Jo)&&!fo.includes(Jo))],Ys=Fa.env.FANOUT_DEBUG_ALTERNATE_PLANE_ORDER?.split(",")??[],aa=Xi.toSorted((Jo,zr)=>{let $r=this.config.layerNames.indexOf(e.busLayerAssignments[Jo.busId]??""),Sl=this.config.layerNames.indexOf(e.busLayerAssignments[zr.busId]??"");if($r!==Sl&&Fa.env.FANOUT_DEBUG_ALTERNATE_IGNORE_LAYERS!=="1")return Fa.env.FANOUT_DEBUG_ALTERNATE_SHALLOW_FIRST==="1"?$r-Sl:Sl-$r;let ul=Ys.indexOf(Jo.busId),gd=Ys.indexOf(zr.busId);return(ul<0?Ys.length:ul)-(gd<0?Ys.length:gd)||Jo.connections[0].connectionIndex-zr.connections[0].connectionIndex});if(Xi.length>0){if(o("plane-match:preflight-failed",fo.map((ca)=>ca.busId)),!m&&Fa.env.FANOUT_DEBUG_ROUTE_UNMATCHED_PLANES!=="1")return null;let Jo=0,zr=Number(Fa.env.FANOUT_DEBUG_ALTERNATE_SEARCH_STATES??(d&&(e.planeReservationRetryCount??0)===0?1e4:u?3000000:p?1e4:1000)),$r=Number(Fa.env.FANOUT_DEBUG_ALTERNATE_ROUTE_COUNT??(u?128:8)),Sl=0,ul=new Map,gd=(ca,n0,zp=$r)=>{let Yd=e.busLayerAssignments[ca.busId];if(!Yd)return[];return SJ({srj:this.routingSrj,bus:ca,targetLayer:Yd,acceptedPlans:[...cn,...n0],layerNames:this.config.layerNames,traceWidth:this.config.traceWidth,viaDiameter:this.config.viaDiameter,viaHoleDiameter:this.config.viaHoleDiameter,clearance:this.config.clearance,compactBusTracks:this.config.compactBusTracks,allowBlindAndBuriedVias:!1,allowSameNetMerges:j,staticClearanceCache:this.routeStaticClearanceCache},zp)},i1=(ca,n0)=>{if(ca.length===0)return n0;if(Jo>=zr)return null;Sl=Math.max(Sl,aa.length-ca.length);let zp=ca.map((Zr)=>({planeBus:Zr,alternatives:gd(Zr,n0)})),Yd=Fa.env.FANOUT_DEBUG_DYNAMIC_ALTERNATE_ORDER==="1"?zp.toSorted((Zr,Ya)=>Zr.alternatives.length-Ya.alternatives.length||aa.indexOf(Zr.planeBus)-aa.indexOf(Ya.planeBus)):zp,vu=Yd[0],{planeBus:ji,alternatives:pl}=vu;if(Fa.env.FANOUT_DEBUG_ALTERNATE_CHOICES==="1"&&Jo<64)o("plane-route:alternate-choice",`depth:${aa.length-ca.length}`,ji.busId,zp.map((Zr)=>[Zr.planeBus.busId,Zr.alternatives.length]));if(pl.length===0)return ul.set(ji.busId,(ul.get(ji.busId)??0)+1),null;let Cc=(Fa.env.FANOUT_DEBUG_BRANCH_ALTERNATE_ORDER==="1"?Yd:[vu]).flatMap((Zr)=>Zr.alternatives.map((Ya)=>({selection:Zr,alternative:Ya,remaining:ca.filter((sh)=>sh!==Zr.planeBus)}))),ea=Fa.env.FANOUT_DEBUG_LEAST_CONSTRAINING_ALTERNATES==="1"?Cc.map((Zr)=>{let Ya=[...n0,...Zr.alternative],sh=Zr.remaining.map((vs)=>gd(vs,Ya,Math.min(4,$r)).length);return{...Zr,remainingOptionCounts:sh,minimumRemainingOptions:sh.length===0?Number.POSITIVE_INFINITY:Math.min(...sh),totalRemainingOptions:sh.reduce((vs,Ad)=>vs+Ad,0)}}).filter((Zr)=>Zr.minimumRemainingOptions!==0).toSorted((Zr,Ya)=>Ya.minimumRemainingOptions-Zr.minimumRemainingOptions||Ya.totalRemainingOptions-Zr.totalRemainingOptions):Cc;for(let Zr of ea){Jo++;let Ya=i1(Zr.remaining,[...n0,...Zr.alternative]);if(Ya)return Ya;if(Jo>=zr)break}return ul.set(ji.busId,(ul.get(ji.busId)??0)+1),null},Fp;if(m||Fa.env.FANOUT_DEBUG_EXACT_COVER_ALTERNATES==="1"){let ca=aa.map((ji)=>({planeBus:ji,candidates:gd(ji,mt).map((pl,Zs)=>({key:`${ji.busId}:${Zs}`,planeBus:ji,plans:pl}))}));if(A){let ji=[...cn,...mt];for(let pl of O){if(lo.includes(pl)||ca.some((ea)=>ea.planeBus===pl))continue;let Zs=[],Cc=dk([pl],{viaDiameter:this.config.viaDiameter,viaHoleDiameter:this.config.viaHoleDiameter,traceWidth:this.config.traceWidth,clearance:this.config.clearance,blockingSegments:ji.flatMap((ea)=>ea.segments.map((Zr)=>({connectionIndex:ea.connectionIndex,segment:Zr}))),blockingVias:ji.flatMap((ea)=>[ea.via,...ea.additionalVias??[],ea.planeEndpointVia].filter((Zr)=>Zr!==void 0).map((Zr)=>({connectionIndex:ea.connectionIndex,center:Zr.center,diameter:Zr.diameter,spanLayers:Zr.spanLayers}))),additionalObstacles:this.routingSrj.obstacles,preferPlaneCheckerboardSites:!0,canShareCopper:Ee});for(let ea of Cc){let Zr=nY({srj:this.routingSrj,bus:pl,targetLayer:e.busLayerAssignments[pl.busId],acceptedPlans:ji,layerNames:this.config.layerNames,traceWidth:this.config.traceWidth,viaDiameter:this.config.viaDiameter,viaHoleDiameter:this.config.viaHoleDiameter,clearance:this.config.clearance,compactBusTracks:this.config.compactBusTracks,allowBlindAndBuriedVias:!1,allowSameNetMerges:j,fixedViaPointsByConnectionIndex:new Map([[ea.connectionIndex,ea.point]])});if(Zr)Zs.push({key:`${pl.busId}:local:${Zs.length}`,planeBus:pl,plans:Zr})}ca.push({planeBus:pl,candidates:Zs})}}o("plane-route:alternate-candidate-counts",ca.map((ji)=>[ji.planeBus.busId,ji.candidates.length]));for(let ji of ca)if(ji.candidates.length===0)se.add(ji.planeBus.busId);let n0=new Map,zp=(ji,pl)=>{let Zs=[ji.key,pl.key].toSorted().join("|"),Cc=n0.get(Zs);if(Cc!==void 0)return Cc;let ea=jgn({plans:[...ji.plans,...pl.plans],srj:this.routingSrj,clearance:this.config.clearance,allowSameNetMerges:j});return n0.set(Zs,ea),ea},Yd=(ji,pl)=>{if(ji.length===0)return pl;if(Jo>=zr)return null;Sl=Math.max(Sl,aa.length-ji.length);let Zs=ji.toSorted((Zr,Ya)=>Zr.candidates.length-Ya.candidates.length)[0];if(Zs.candidates.length===0)return ul.set(Zs.planeBus.busId,(ul.get(Zs.planeBus.busId)??0)+1),null;let Cc=ji.filter((Zr)=>Zr!==Zs),ea=Number(Fa.env.FANOUT_DEBUG_ALTERNATE_CANDIDATE_BATCH_SIZE??16);for(let Zr=0;Zr<Zs.candidates.length;Zr+=ea){let Ya=Zs.candidates.slice(Zr,Zr+ea).map((sh)=>{let vs=Cc.map((ah)=>({...ah,candidates:ah.candidates.filter((fd)=>zp(sh,fd))})),Ad=vs.map((ah)=>ah.candidates.length);return{candidate:sh,projectedSets:vs,minimumProjectedCount:Ad.length===0?Number.POSITIVE_INFINITY:Math.min(...Ad),totalProjectedCount:Ad.reduce((ah,fd)=>ah+fd,0)}}).filter((sh)=>sh.minimumProjectedCount!==0).toSorted((sh,vs)=>vs.minimumProjectedCount-sh.minimumProjectedCount||vs.totalProjectedCount-sh.totalProjectedCount);for(let sh of Ya){Jo++;let vs=Yd(sh.projectedSets,[...pl,sh.candidate]);if(vs)return vs;if(Jo>=zr)break}if(Jo>=zr)break}return ul.set(Zs.planeBus.busId,(ul.get(Zs.planeBus.busId)??0)+1),null},vu;if(d||_){let ji=(Cc)=>Cc.map((ea)=>[...new Map(ea.candidates.map((Zr)=>[JSON.stringify(Zr.plans.map((Ya)=>[Ya.segments,Ya.via,Ya.additionalVias,Ya.planeEndpointSegments,Ya.planeEndpointVia])),Zr])).values()]),Zs=((Cc,ea=zr)=>CFr({candidateSets:ji(Cc),maximumSearchStates:ea,areCompatible:(Zr,Ya)=>jgn({plans:[...Zr.plans,...Ya.plans],srj:this.routingSrj,clearance:this.config.clearance,allowSameNetMerges:j})}))(ca);if(o("plane-route:csp",Zs.selection?"complete":"failed",Zs.searchStates,Zs.emptyDomainIndices.map((Cc)=>ca[Cc].planeBus.busId)),vu=Zs.selection,Jo=Zs.searchStates,!Zs.selection&&(d||_)){let Cc=Zs.emptyDomainIndices.map((ea)=>ca[ea].planeBus.busId).filter((ea)=>!aa.some((Zr)=>Zr.busId===ea));if(Cc.length>0)return o("plane-route:expand-domains",Cc),It(cn,new Set([...dn,...Cc]))}if(!Zs.selection)for(let Cc of(e.planeReservationRetryCount??0)===0?Zs.conflictDomainIndices:Zs.emptyDomainIndices.slice(0,1))se.add(ca[Cc].planeBus.busId)}else vu=Yd(ca,[]);Fp=vu?[...mt,...vu.flatMap((ji)=>ji.plans)]:null}else Fp=i1(aa,mt);if(o("plane-route:alternate-search",Fp?"complete":"failed",Jo,`depth:${Sl}/${aa.length}`,[...ul].toSorted(([,ca],[,n0])=>n0-ca)),!Fp)return null;if(mt=Fp,A)return ir=[],new Map([...wn,...Fp.filter((ca)=>ca.via).map((ca)=>[ca.connectionIndex,ca.via.center])])}let Lo=new Set,Gi=[...eo],bi=[],os=[...O],Lc=new Map,dl=new Map,Ec=()=>{Lo=new Set(mt.map((zr)=>zr.busId));let Jo=mt.flatMap((zr)=>[...zr.segments,...zr.planeEndpointSegments??[]].map(($r)=>({connectionIndex:zr.connectionIndex,segment:$r})));Gi=[...eo,...Jo],bi=mt.flatMap((zr)=>[zr.via,...zr.additionalVias??[],zr.planeEndpointVia].flatMap(($r)=>$r?[{connectionIndex:zr.connectionIndex,center:$r.center,diameter:$r.diameter,spanLayers:$r.spanLayers}]:[])),os=O.filter((zr)=>!Lo.has(zr.busId)),Lc=new Map,dl=new Map;for(let zr of dk(os,{viaDiameter:this.config.viaDiameter,viaHoleDiameter:this.config.viaHoleDiameter,traceWidth:this.config.traceWidth,clearance:this.config.clearance,blockingSegments:Gi,blockingVias:bi,additionalObstacles:Y,preferPlaneCheckerboardSites:u,canShareCopper:Ee})){Lc.set(zr.connectionIndex,(Lc.get(zr.connectionIndex)??0)+1);let $r=dl.get(zr.connectionIndex)??[];$r.push(zr.point),dl.set(zr.connectionIndex,$r)}};Ec();for(let Jo=0;Jo<O.length;Jo++){let zr=os.filter(($r)=>!Lc.has($r.connections[0].connectionIndex));if(zr.length===0)break;if(o("plane-route:promote-zero-candidates",zr.map(($r)=>$r.busId)),zr.some(($r)=>lo.includes($r)))return null;for(let $r of zr){let Sl=e.busLayerAssignments[$r.busId];if(!Sl)return null;let ul=SJ({srj:this.routingSrj,bus:$r,targetLayer:Sl,acceptedPlans:[...cn,...mt],layerNames:this.config.layerNames,traceWidth:this.config.traceWidth,viaDiameter:this.config.viaDiameter,viaHoleDiameter:this.config.viaHoleDiameter,clearance:this.config.clearance,compactBusTracks:this.config.compactBusTracks,allowBlindAndBuriedVias:!1,allowSameNetMerges:j,staticClearanceCache:this.routeStaticClearanceCache},8)[0];if(!ul)return o("plane-route:promote-failed",$r.busId),It(cn,new Set([...dn,...zr.map((gd)=>gd.busId)]));mt.push(...ul)}Ec()}let _d=Fa.env.FANOUT_DEBUG_PLANE_MATCH_ORDER?.split(",")??[],B0=os.toSorted((Jo,zr)=>{let $r=(Lc.get(Jo.connections[0].connectionIndex)??0)-(Lc.get(zr.connections[0].connectionIndex)??0);if($r!==0)return $r;let Sl=_d.indexOf(Jo.busId),ul=_d.indexOf(zr.busId),gd=(Sl<0?_d.length:Sl)-(ul<0?_d.length:ul);if(gd!==0)return gd;return Jo.connections[0].connectionIndex-zr.connections[0].connectionIndex});for(let Jo of B0){if(lo.includes(Jo))continue;if(Fa.env.FANOUT_DEBUG_PLANE_CANDIDATES?.split(",").includes(Jo.busId))o("plane-match:candidates",Jo.busId,dl.get(Jo.connections[0].connectionIndex));let zr=Yu([...lo,Jo,...$n],{viaDiameter:this.config.viaDiameter,viaHoleDiameter:this.config.viaHoleDiameter,traceWidth:this.config.traceWidth,clearance:this.config.clearance,maximumSearchStates:1e5,preferredBoundaryPerpendicularSideByBusId:de,preferBoundaryOutwardByBusId:me,fixedViaPointsByConnectionIndex:Tn,blockingSegments:Gi,blockingVias:[...qn,...bi],additionalObstacles:Y,preferPlaneCheckerboardSites:u,canShareCopper:Ee});if(o(zr?"plane-match:incremental":"plane-match:incremental-failed",Jo.busId,Lc.get(Jo.connections[0].connectionIndex)??0,zr?.get(Jo.connections[0].connectionIndex),zr?.size??"failed"),!zr)return null;Tn=new Map([...Tn,...zr]),lo.push(Jo)}return ir=lo.filter((Jo)=>!Lo.has(Jo.busId)),o("plane-match:incremental-complete",Tn.size),Tn}let To=Yu([...O,...$n],{viaDiameter:this.config.viaDiameter,viaHoleDiameter:this.config.viaHoleDiameter,traceWidth:this.config.traceWidth,clearance:this.config.clearance,maximumSearchStates:1e5,preferredBoundaryPerpendicularSideByBusId:de,preferBoundaryOutwardByBusId:me,fixedViaPointsByConnectionIndex:wn,blockingSegments:eo,blockingVias:qn,additionalObstacles:Y,preferPlaneCheckerboardSites:u,canShareCopper:Ee});return To?new Map([...wn,...To]):null};o("length-match:start",Ut.length);let bt=g?{plans:Ut}:Ey({plans:Ut,preparedBuses:this.preparedBuses,inputSrj:this.inputSrj,sharedBoundary:this.getValidationBoundary(),clearance:this.config.clearance,allowBlindAndBuriedVias:!1,allowSameNetMerges:this.config.allowSameNetMerges,allowMatchingInsideDenseBounds:!0,candidatePlansAreFeasible:(cn)=>{let dn=It(cn);if(!dn)return!1;return Oe=dn,!0}});if(o("length-match:complete",bt.plans?.length??"failed"),this.setInProgressPlans({phase:"match-dense-boundary-lengths",plans:bt.plans??Ut,strategy:"default",unitIndex:++Bt,unitCount:xt}),yield,bt.plans){Ut=bt.plans;let cn=Oe??It(Ut);if(cn)Ot=cn,Ut.push(...mt);else mn=!1}else mn=!1;this.setInProgressPlans({phase:"rematch-dense-via-sites",plans:Ut,strategy:"default",unitIndex:Bt,unitCount:xt}),yield}if(mn)for(let Oe of ir??O){o("plane-route:start",Oe.busId);let mt=e.busLayerAssignments[Oe.busId],It=new Map,bt=mt?nY({srj:this.routingSrj,bus:Oe,targetLayer:mt,acceptedPlans:Ut,layerNames:this.config.layerNames,traceWidth:this.config.traceWidth,viaDiameter:this.config.viaDiameter,viaHoleDiameter:this.config.viaHoleDiameter,clearance:this.config.clearance,compactBusTracks:this.config.compactBusTracks,allowBlindAndBuriedVias:!1,allowSameNetMerges:j,staticClearanceCache:this.routeStaticClearanceCache,blockingBusCounts:It,fixedViaPointsByConnectionIndex:Ot}):null;if(!bt&&mt&&a){if(bt=nY({srj:this.routingSrj,bus:Oe,targetLayer:mt,acceptedPlans:Ut,layerNames:this.config.layerNames,traceWidth:this.config.traceWidth,viaDiameter:this.config.viaDiameter,viaHoleDiameter:this.config.viaHoleDiameter,clearance:this.config.clearance,compactBusTracks:this.config.compactBusTracks,allowBlindAndBuriedVias:!1,allowSameNetMerges:j,staticClearanceCache:this.routeStaticClearanceCache,blockingBusCounts:It}),bt)Ot=new Map([...Ot,...bt.flatMap((cn)=>cn.via?[[cn.connectionIndex,cn.via.center]]:[])])}if(!bt){o("plane-route:failed",Oe.busId,Ot.get(Oe.connections[0].connectionIndex),[...It]),mn=!1;break}Ut.push(...bt),o("plane-route:complete",Oe.busId),this.setInProgressPlans({phase:"route-dense-plane-buses",plans:Ut,strategy:"default",unitIndex:++Bt,unitCount:xt,busId:Oe.busId}),yield}if(mn&&g){let Oe={plans:Ut,preparedBuses:this.preparedBuses,inputSrj:this.inputSrj,sharedBoundary:this.getValidationBoundary(),clearance:this.config.clearance,allowBlindAndBuriedVias:!1,allowSameNetMerges:j,allowMatchingInsideDenseBounds:!0,allowPairLaneSpreading:!0,allowUnconstrainedLaneRerouting:!0},mt=Ey(Oe),It=new Set;while(!mt.plans&&mt.failedBus&&!It.has(mt.failedBus.busId)){let bt=mt.failedBus;It.add(bt.busId);let cn=nOr({plans:Ut,bus:bt,srj:this.inputSrj,sharedBoundary:this.getValidationBoundary(),layerNames:this.config.layerNames,traceWidth:this.config.traceWidth,viaDiameter:this.config.viaDiameter,viaHoleDiameter:this.config.viaHoleDiameter,clearance:this.config.clearance,allowSameNetMerges:j});if(cn.every((dn,wn)=>dn===Ut[wn]))break;Ut=cn,mt=Ey({...Oe,plans:Ut})}if(mt.plans)Ut=mt.plans;else mn=!1;this.setInProgressPlans({phase:"match-dense-complete-lengths",plans:Ut,strategy:"default",unitIndex:++Bt,unitCount:xt}),yield}let gt=mn&&q0({plans:Ut,srj:this.routingSrj,sharedBoundary:V[0].sharedBoundary,clearance:this.config.clearance,allowBlindAndBuriedVias:!1,allowSameNetMerges:j});if(o("dense-validation",mn,Ut.length,gt),gt){let Oe=this.normalizeCompletePlanCorners(Ut);if(Oe){let mt=YV({inputSrj:this.inputSrj,plans:Oe,layerNames:this.config.layerNames});if(this.validateCompletePlans(Oe,mt).valid)return{plans:Oe,failedBusIds:[],stopAfterCompleteValidation:!0}}}}if((d||_)&&se.size>0&&(e.planeReservationRetryCount??0)<5){let Ye=[...se].filter((st)=>!ee.some((St)=>St.busId===st)),je=(e.planeReservationRetryCount??0)===0?bFr({candidateBusIds:Ye,activeBusIds:new Set(ee.map((st)=>st.busId)),planeBuses:O}):Ye;if(je.length>0)return o("plane-reservation-core",je),o("promote-reservations",je),yield*this.routeDenseThroughAllMixedTerminationSteps({...e,preferredBoundaryViaPoints:t,promotedPlaneReservationBusIds:[...e.promotedPlaneReservationBusIds??[],...je],planeReservationRetryCount:(e.planeReservationRetryCount??0)+1})}if(g&&!ne)return yield*this.routeDenseThroughAllMixedTerminationSteps({...e,lengthMatchingStage:"before-planes"});if(n&&!u){let Ye=yield*this.routeDenseThroughAllMixedTerminationSteps({...e,denseRoutingStrategy:"boundary-aligned"});if(Ye)return Ye;if(!p&&re){let je=re.busId,st=me.get(je)??!0,St=de.get(je)??1;for(let[Nt,Ot]of[[!st,-St],[!st,St],[st,-St],[st,St]]){let Ut=yield*this.routeDenseThroughAllMixedTerminationSteps({...e,boundaryRecovery:{busId:je,preferOutward:Nt,perpendicularSide:Ot}});if(Ut)return Ut}}}if(!n||Fa.env.FANOUT_DEBUG_DENSE_ONLY==="1")return null;let Yt=8,ut=(Ye,je=[])=>{let st=[{plans:[...je],failedBusIds:[]}];for(let St of V){let Nt=e.busLayerAssignments[St.busId];if(!Nt)return null;let Ot=[],Ut=st.map((mn)=>({state:mn,alternatives:SJ({srj:this.routingSrj,bus:St,targetLayer:Nt,acceptedPlans:mn.plans,layerNames:this.config.layerNames,traceWidth:this.config.traceWidth,viaDiameter:this.config.viaDiameter,viaHoleDiameter:this.config.viaHoleDiameter,clearance:this.config.clearance,compactBusTracks:this.config.compactBusTracks,allowBlindAndBuriedVias:!1,allowSameNetMerges:this.config.allowSameNetMerges,staticClearanceCache:this.routeStaticClearanceCache},Ye)}));for(let mn=0;mn<Ye;mn++){for(let{state:_n,alternatives:En}of Ut){let Qn=En[mn];if(!Qn)continue;if(Ot.push({plans:[..._n.plans,...Qn],failedBusIds:[]}),Ot.length>=Yt)break}if(Ot.length>=Yt)break}if(Ot.length===0)return null;st=Ot}return st},Ze=(Ye)=>{if(V.length!==2)return null;let[je,st]=V;if(!je||!st)return null;let St=(ln,hn,Zn)=>{let bo=e.busLayerAssignments[ln.busId];if(!bo)return null;return SJ({srj:this.routingSrj,bus:ln,targetLayer:bo,acceptedPlans:hn,layerNames:this.config.layerNames,traceWidth:this.config.traceWidth,viaDiameter:this.config.viaDiameter,viaHoleDiameter:this.config.viaHoleDiameter,clearance:this.config.clearance,compactBusTracks:this.config.compactBusTracks,allowBlindAndBuriedVias:!1,allowSameNetMerges:this.config.allowSameNetMerges,staticClearanceCache:this.routeStaticClearanceCache,rejectedViaMinimalCandidates:Zn,stopAfterFirstRejectedViaMinimalCandidate:Zn!==void 0},1)[0]??null},Nt=St(je,[...Ye]);if(!Nt)return null;let Ot=[],Ut=St(st,[...Ye,...Nt],Ot);if(Ut)return{plans:[...Ye,...Nt,...Ut],failedBusIds:[]};let mn=Ot[0];if(!mn)return null;let _n=mn.map((ln)=>({...ln,termination:{type:"plane",layer:ln.targetLayer}})),En=St(je,[...Ye,..._n]);if(!En)return null;let Qn=[...Ye,...En,...mn];if(!q0({plans:Qn,srj:this.routingSrj,sharedBoundary:je.sharedBoundary,clearance:this.config.clearance,allowBlindAndBuriedVias:!1,allowSameNetMerges:this.config.allowSameNetMerges}))return null;return{plans:Qn,failedBusIds:[]}},Fe=new Map(O.map((Ye)=>[Ye.busId,Ye])),tt=(Ye,je,st)=>{let St=e.busLayerAssignments[Ye.busId];if(!St)return null;return nY({srj:this.routingSrj,bus:Ye,targetLayer:St,acceptedPlans:je,layerNames:this.config.layerNames,traceWidth:this.config.traceWidth,viaDiameter:this.config.viaDiameter,viaHoleDiameter:this.config.viaHoleDiameter,clearance:this.config.clearance,compactBusTracks:this.config.compactBusTracks,allowBlindAndBuriedVias:!1,allowSameNetMerges:this.config.allowSameNetMerges,staticClearanceCache:this.routeStaticClearanceCache,blockingBusCounts:st})},Je=(Ye,je)=>{let st={plans:[...Ye],failedBusIds:[]};for(let St of je){let Nt=new Map,Ot=tt(St,st.plans,Nt);if(!Ot){let Ut=[...Nt.entries()].filter(([_n])=>st.plans.some((En)=>En.busId===_n)).filter(([_n])=>Fe.has(_n)).toSorted(([,_n],[,En])=>En-_n).slice(0,8).map(([_n])=>_n),mn=[...Ut.map((_n)=>[_n]),...Ut.flatMap((_n,En)=>Ut.slice(En+1).map((Qn)=>[_n,Qn]))];for(let _n of mn){let En=new Set(_n),Qn=st.plans.filter((Zn)=>!En.has(Zn.busId)),ln=tt(St,Qn);if(!ln)continue;Qn.push(...ln);let hn=!0;for(let Zn of _n){let bo=Fe.get(Zn),ir=bo?tt(bo,Qn):null;if(!ir){hn=!1;break}Qn.push(...ir)}if(!hn)continue;st.plans=Qn,Ot=[];break}}if(Ot)st.plans.push(...Ot);else st.failedBusIds.push(St.busId)}return st},$e=null,ft=null,vt=(Ye,je)=>{let st=null;for(let St of Ye){let Nt=[...je],Ot=new Set;for(let Ut=0;Ut<3;Ut++){let mn=Nt.map((Qn)=>Qn.busId).join("\x00");if(Ot.has(mn))break;Ot.add(mn);let _n=Je(St.plans,Nt);if(!$e||_n.plans.length>$e.plans.length||_n.plans.length===$e.plans.length&&_n.failedBusIds.length<$e.failedBusIds.length)$e=_n;if(!st||_n.plans.length>st.plans.length||_n.plans.length===st.plans.length&&_n.failedBusIds.length<st.failedBusIds.length)st=_n;if(_n.failedBusIds.length===0)return _n;let En=new Set(_n.failedBusIds);Nt=[..._n.failedBusIds.flatMap((Qn)=>{let ln=Fe.get(Qn);return ln?[ln]:[]}),...Nt.filter((Qn)=>!En.has(Qn.busId))]}}return ft=st,null};for(let Ye of[1,4]){let je=ut(Ye);if(!je)continue;let st=vt(je,O);if(st)return st;let St=$e?.failedBusIds.slice(0,3);if(Ye===1&&St)for(let Nt of St){let Ot=[],Ut=new Set,mn=Nt;for(let Qn=0;Qn<3&&mn;Qn++){let ln=Fe.get(mn);if(!ln)break;let hn=tt(ln,Ot);if(!hn)break;Ot.push(...hn),Ut.add(mn);let Zn=Ze(Ot);if(!Zn)break;let bo=vt([Zn],O.filter((gt)=>!Ut.has(gt.busId)));if(bo)return bo;mn=ft?.failedBusIds?.find((gt)=>!Ut.has(gt))}if(Ot.length===0)continue;let _n=ut(1,Ot);if(!_n)continue;let En=vt(_n,O.filter((Qn)=>!Ut.has(Qn.busId)));if(En)return En}}return $e}*evaluateAssignmentWithStrategySteps(e,t,n){let o=[],r=[],i=new Map,s=this.config.escapeLayers.length===1,a=s&&this.config.singleLayerPushAndShove&&!this.preparedBuses.some((C)=>C.exitEdge&&C.preferredExit?.includes("-"));if(a){let C={srj:this.routingSrj,buses:this.preparedBuses,traceWidth:this.config.traceWidth,clearance:this.config.clearance,borderDistribution:this.config.borderDistribution},b=eOr(C);if(!b&&this.config.singleLayerAdaptiveExits)this.setInProgressPlans({phase:"prepare-single-layer-adaptive-exits",plans:o,strategy:n}),yield,this.setInProgressPlans({phase:"route-single-layer-adaptive-exits",plans:o,strategy:n}),this.activeAdaptiveVisualization=null,b=yield{type:"subsolver",solver:this.createWorkSolver("SingleLayerAdaptiveExitSolver",MY({...C,availableBoundaryRegions:u3n(this.options.availableCornersAndSides),onProgress:(v,P)=>{this.activeAdaptiveVisualization=v,this.stats={...this.stats,...P}}}),void 0,()=>this.visualizeAdaptiveRoutingState())};if(b)o.push(...b);else r.push(...this.preparedBuses.map((I)=>I.busId));this.setInProgressPlans({phase:"route-single-layer",plans:o,strategy:n,unitIndex:1,unitCount:1}),yield}let c=[...this.preparedBuses].sort((C,b)=>{let I=SS(C),v=SS(b),P=this.config.layerNames.indexOf(t[C.busId]??""),M=this.config.layerNames.indexOf(t[b.busId]??"");return yAn(C,b,this.config.allowBlindAndBuriedVias)||Number(v)-Number(I)||(I&&v?M-P:0)||(n==="group-by-layer"?(t[C.busId]??"").localeCompare(t[b.busId]??""):0)||b.componentObstacles.length-C.componentObstacles.length||(s?gJ(b)-gJ(C):b.connections.length-C.connections.length||(n==="deep-first"?gJ(b)-gJ(C):gJ(C)-gJ(b)))}),l=null;if(!a&&n==="default")l=yield{type:"subsolver",solver:this.createWorkSolver("PeripheralMixedTerminationSolver",this.routePeripheralMixedTerminationSteps({busLayerAssignments:t,busesInRoutingOrder:c}))};if(!l&&!a&&n==="default")l=yield{type:"subsolver",solver:this.createWorkSolver("DenseMixedTerminationSolver",this.routeDenseThroughAllMixedTerminationSteps({busLayerAssignments:t,busesInRoutingOrder:c}),()=>{let b=Number(this.stats.workUnit??0),I=Number(this.stats.workUnitCount??0);return I>0?b/I:0})};if(!l&&!a&&n==="default"&&Fa.env.FANOUT_DEBUG_DENSE_ONLY==="1")l={plans:[],failedBusIds:this.preparedBuses.map((C)=>C.busId)};if(l)o=l.plans,r=l.failedBusIds,this.setInProgressPlans({phase:"route-dense-mixed-terminations",plans:o,strategy:n,unitIndex:this.preparedBuses.length,unitCount:this.preparedBuses.length}),yield;let h=`${n}|`,d=0;for(let C of a||l?[]:c){d++;let b=t[C.busId];if(!b)throw Error(`FanoutSolver: assignment ${e} has no layer for bus "${C.busId}"`);h+=`${C.busId.length}:${C.busId};${b.length}:${b};`;let I=this.routingPrefixCache.get(h);if(I){o=[...I.plans],r=[...I.failedBusIds],i=new Map(I.blockingBusCounts),this.setInProgressPlans({phase:"route-assignment",plans:o,strategy:n,unitIndex:d,unitCount:c.length,busId:C.busId}),yield;continue}let v=new Map,P=nY({srj:this.routingSrj,bus:C,targetLayer:b,acceptedPlans:o,layerNames:this.config.layerNames,traceWidth:this.config.traceWidth,viaDiameter:this.config.viaDiameter,viaHoleDiameter:this.config.viaHoleDiameter,clearance:this.config.clearance,compactBusTracks:this.config.compactBusTracks,allowBlindAndBuriedVias:this.config.allowBlindAndBuriedVias,allowSameNetMerges:this.config.allowSameNetMerges,staticClearanceCache:this.routeStaticClearanceCache,blockingBusCounts:v});if(!P){r.push(C.busId);for(let[M,B]of v)i.set(M,(i.get(M)??0)+B)}else o.push(...P);this.routingPrefixCache.set(h,{plans:[...o],failedBusIds:[...r],blockingBusCounts:new Map(i)}),this.setInProgressPlans({phase:"route-assignment",plans:o,strategy:n,unitIndex:d,unitCount:c.length,busId:C.busId}),yield}let u,_=l?.stopAfterCompleteValidation===!0&&o.length===this.inputSrj.connections.length;if(!_&&o.length===this.inputSrj.connections.length){let C=this.matchCompletePlanLengths(o);if(C.plans)o=C.plans;else{let b=C.failedBus,I={code:"bus-length-skew",message:`Bus ${b.busId} could not satisfy its ${b.maxLengthSkew.toFixed(6)}mm routed-length skew within the fanout boundary`,busId:b.busId};u=[I],this.lengthMatchingFailure??=I,o=[],r=[b.busId,...this.preparedBuses.map((v)=>v.busId).filter((v)=>v!==b.busId)],i.clear()}}if(!_&&o.length===this.inputSrj.connections.length){let C=this.normalizeCompletePlanCorners(o);if(C)o=C;else u=[{code:"fanout-normalization",message:"Completed fanout could not normalize every corner while preserving its original clearance and length constraints"}],o=[],r=this.preparedBuses.map((b)=>b.busId),i.clear()}let p=YV({inputSrj:this.inputSrj,plans:o,layerNames:this.config.layerNames}),m=o.length===this.inputSrj.connections.length?this.validateCompletePlans(o,p):null;if(m&&!m.valid)u=m.issues,o=[],r=this.preparedBuses.map((C)=>C.busId),i.clear(),p=YV({inputSrj:this.inputSrj,plans:o,layerNames:this.config.layerNames});let A=this.preparedBuses.length-r.length,g=o.reduce((C,b)=>C+b.length,0),y=(this.inputSrj.connections.length-o.length)*1e6+r.length*1e5+g+T9e(o)*0.1+w9e(t,this.preparedBuses,this.config.balanceLayerLoadByConnectionCount)*B9e(this.config),x={assignmentIndex:e,busLayerAssignments:t,routedBusCount:A,routedConnectionCount:o.length,failedBusIds:r,score:y,...u?{validationIssues:u}:{}};return this.setInProgressPlans({phase:"finalize-assignment-strategy",plans:o,strategy:n}),{summary:x,plans:o,...l?.stopAfterCompleteValidation&&m?.valid?{stopAfterCompleteValidation:!0}:{},blockingBusIds:[...i.entries()].toSorted(([,C],[,b])=>b-C).map(([C])=>C),outputSrj:p}}*evaluateAssignmentSteps(e,t){let n=yield*this.evaluateAssignmentWithStrategySteps(e,t,"default");if(Fa.env.FANOUT_DEBUG_DENSE_ONLY==="1")return n;if(n.summary.routedConnectionCount===this.inputSrj.connections.length&&(n.stopAfterCompleteValidation||this.getCoordinatedAdditionalViaCount(n.plans)===0))return n;for(let o of["group-by-layer","deep-first"]){let r=yield*this.evaluateAssignmentWithStrategySteps(e,t,o);if(this.isAttemptBetter(r,n))n=r;if(n.summary.routedConnectionCount===this.inputSrj.connections.length&&(n.stopAfterCompleteValidation||this.getCoordinatedAdditionalViaCount(n.plans)===0))return n}return n}*evaluateGroupedBeamSteps(e,t=!1){if(this.config.escapeLayers.length<2)return null;if(this.preparedBuses.length>56)return null;let n=this.inputSrj.connections.length;if(n>64)return null;if(new Set(this.preparedBuses.map((x)=>x.componentId)).size!==1)return null;let o=(x)=>{let C=this.config.layerNames.indexOf(x.connections[0]?.sourceLayer??""),b=x.termination.type==="plane"?[x.termination.layer]:this.escapeLayersByBusId[x.busId]??this.config.escapeLayers;return Math.max(0,...b.map((I)=>Math.abs(this.config.layerNames.indexOf(I)-C)))},r=[...this.preparedBuses].sort((x,C)=>{let b=SS(x),I=SS(C),v=x.termination.type==="plane"?1:this.escapeLayersByBusId[x.busId]?.length??this.config.escapeLayers.length,P=C.termination.type==="plane"?1:this.escapeLayersByBusId[C.busId]?.length??this.config.escapeLayers.length;return yAn(x,C,this.config.allowBlindAndBuriedVias)||Number(I)-Number(b)||(b&&I?o(C)-o(x):0)||(t?x.direction.localeCompare(C.direction):0)||v-P||C.componentObstacles.length-x.componentObstacles.length||C.connections.length-x.connections.length||Fot(C)-Fot(x)||x.busId.localeCompare(C.busId)}),i=n<=24,s=this.preparedBuses.some((x)=>x.connections.length>1),a=i?48:n<=32?24:12,c=i&&!s?4:1,l=[{assignment:{},plans:[]}],h=(x)=>{let C=x.plans.reduce((v,P)=>v+P.length,0),b=T9e(x.plans),I=this.preparedBuses.reduce((v,P)=>{if(P.termination.type!=="boundary"||!Hot(P))return v;let M=P.connections[0]?.sourceLayer,B=RJ(P)??M;return x.assignment[P.busId]===B?v:v+P.connections.length},0);return C+b*0.1+I*1e4+w9e(x.assignment,this.preparedBuses,this.config.balanceLayerLoadByConnectionCount)*B9e(this.config)},d=0;for(let x of r){d++;let C=[];for(let I of l){let v=x.termination.type==="plane"?[x.termination.layer]:this.escapeLayersByBusId[x.busId]??this.config.escapeLayers,P=new Map;for(let[D,L]of Object.entries(I.assignment)){let H=this.preparedBuses.find((V)=>V.busId===D);P.set(L,(P.get(L)??0)+(this.config.balanceLayerLoadByConnectionCount?H?.connections.length??1:1))}let M=x.connections[0]?.sourceLayer,B=RJ(x),T=Hot(x),N=v.toSorted((D,L)=>(P.get(D)??0)-(P.get(L)??0)||Number(L===B)-Number(D===B)||(T?Number(L===M)-Number(D===M):Number(D===M)-Number(L===M))||D.localeCompare(L));for(let D of N){let L=SJ({srj:this.routingSrj,bus:x,targetLayer:D,acceptedPlans:I.plans,layerNames:this.config.layerNames,traceWidth:this.config.traceWidth,viaDiameter:this.config.viaDiameter,viaHoleDiameter:this.config.viaHoleDiameter,clearance:this.config.clearance,compactBusTracks:this.config.compactBusTracks,allowBlindAndBuriedVias:this.config.allowBlindAndBuriedVias,allowSameNetMerges:this.config.allowSameNetMerges,staticClearanceCache:this.routeStaticClearanceCache},c);for(let H of L)C.push({assignment:{...I.assignment,[x.busId]:D},plans:[...I.plans,...H]})}}if(C.length===0)return null;C.sort((I,v)=>{let P=this.getCoordinatedAdditionalViaCount(I.plans)-this.getCoordinatedAdditionalViaCount(v.plans);if(P!==0)return P;let M=h(I)-h(v);if(Math.abs(M)>0.000000001)return M;return JSON.stringify(I.assignment).localeCompare(JSON.stringify(v.assignment))});let b=new Map;l=[];for(let I of C){let v=JSON.stringify(I.assignment),P=b.get(v)??0;if(P>=2)continue;if(b.set(v,P+1),l.push(I),l.length>=a)break}this.setInProgressPlans({phase:"route-grouped-beam",plans:l[0]?.plans??[],strategy:"grouped-beam",unitIndex:d,unitCount:r.length,busId:x.busId}),yield}let u,_,{POSITIVE_INFINITY:p,POSITIVE_INFINITY:m}=Number,A=(x)=>x.plans.reduce((C,b)=>C+b.length,0)+T9e(x.plans)*0.1+w9e(x.assignment,this.preparedBuses,this.config.balanceLayerLoadByConnectionCount)*B9e(this.config),g=this.preparedBuses.some((x)=>x.maxLengthSkew!==void 0);for(let x of l){if(x.plans.length!==this.inputSrj.connections.length){yield;continue}let C=this.matchCompletePlanLengths(x.plans);if(!C.plans){yield;continue}let b=this.normalizeCompletePlanCorners(C.plans);if(!b){yield;continue}let I=YV({inputSrj:this.inputSrj,plans:b,layerNames:this.config.layerNames});if(!this.validateCompletePlans(b,I).valid){yield;continue}let v={...x,plans:b},P=this.getCoordinatedAdditionalViaCount(b),M=A(v);if(!u||P<m||P===m&&M<p)u=v,_=I,p=M,m=P;if(!g)break;this.setInProgressPlans({phase:"validate-grouped-beam",plans:b,strategy:"grouped-beam"}),yield}if(!u||!_)return null;let f=p;if(!Number.isFinite(f))return null;return{summary:{assignmentIndex:e,busLayerAssignments:u.assignment,routedBusCount:this.preparedBuses.length,routedConnectionCount:u.plans.length,failedBusIds:[],score:f},plans:u.plans,blockingBusIds:[],outputSrj:_}}*evaluateGroupedBeamAlternativesSteps(e){let t=yield*this.evaluateGroupedBeamSteps(e);if(t)return t;return yield*this.evaluateGroupedBeamSteps(e,!0)}prioritizeFailedBusRepairs(e,t,n){let o=JSON.stringify(e),r=this.assignmentRepairDepthByKey.get(o)??0;if(r>=2)return;let i=8,s=[],a=new Set,c=(h)=>{let d=JSON.stringify(h);if(a.has(d)||this.evaluatedAssignmentKeys.has(d)||this.queuedAssignmentKeys.has(d))return;a.add(d),this.queuedAssignmentKeys.add(d),this.assignmentRepairDepthByKey.set(d,r+1),s.push(h)},l=[];for(let h=0;h<Math.max(t.length,n.length);h++){let d=t[h],u=n[h];if(d&&!l.includes(d))l.push(d);if(u&&!l.includes(u))l.push(u)}for(let h of t){let d=e[h],u=this.escapeLayersByBusId[h];if(!d||!u)continue;for(let _ of n.slice(0,4)){let p=e[_],m=this.escapeLayersByBusId[_];if(!p||!m||!u.includes(p)||!m.includes(d))continue;if(c({...e,[h]:p,[_]:d}),s.length>=i)break}if(s.length>=i)break}for(let h of l){let d=e[h],u=this.escapeLayersByBusId[h];if(!d||!u)continue;let _=u.indexOf(d);for(let p=1;p<u.length;p++){let m=u[(Math.max(_,0)+p)%u.length];if(m===d)continue;if(c({...e,[h]:m}),s.length>=i)break}if(s.length>=i)break}this.pendingRepairAssignments.push(...s)}hasCompleteBestAttempt(){return this.bestAttempt?.summary.routedConnectionCount===this.inputSrj.connections.length}getCoordinatedAdditionalViaCount(e){let t=new Set(this.preparedBuses.filter(SS).map((n)=>n.busId));return e.reduce((n,o)=>n+(t.has(o.busId)?o.additionalVias?.length??0:0),0)}isAttemptBetter(e,t){if(e.summary.routedConnectionCount!==t.summary.routedConnectionCount)return e.summary.routedConnectionCount>t.summary.routedConnectionCount;if(e.summary.routedBusCount!==t.summary.routedBusCount)return e.summary.routedBusCount>t.summary.routedBusCount;let n=this.getCoordinatedAdditionalViaCount(e.plans),o=this.getCoordinatedAdditionalViaCount(t.plans);if(n!==o)return n<o;return e.summary.score<t.summary.score}hasGloballyViaMinimalBestAttempt(){if(!this.hasCompleteBestAttempt()||!this.bestAttempt)return!1;if(this.preparedBuses.length===0||!this.preparedBuses.every(SS))return!1;return this.bestAttempt.plans.every((e)=>e.via!==void 0&&(e.additionalVias?.length??0)===0)}shouldEvaluateGroupedBeam(){if(this.groupedBeamEvaluated||this.nextAssignmentIndex===0)return!1;return this.hasCompleteBestAttempt()||this.pendingRepairAssignments.length===0||this.nextAssignmentIndex>=this.config.maxLayerCombinations}commitGroupedBeamAttempt(e){if(!e){if(this.hasCompleteBestAttempt()&&this.bestAttempt&&this.getCoordinatedAdditionalViaCount(this.bestAttempt.plans)===0)this.completeBestAttemptEndpoints(),this.solved=!0;return}if(this.attempts.push(e.summary),!this.bestAttempt||this.isAttemptBetter(e,this.bestAttempt))this.bestAttempt=e;let t=this.bestAttempt.summary;if(this.stats={phase:"complete-grouped-beam",assignment:t.assignmentIndex<0?0:t.assignmentIndex+1,assignmentCount:this.config.maxLayerCombinations,routedBuses:`${t.routedBusCount}/${this.preparedBuses.length}`,routedConnections:`${t.routedConnectionCount}/${this.inputSrj.connections.length}`,failedBuses:"none",bestScore:t.score},this.getCoordinatedAdditionalViaCount(this.bestAttempt.plans)===0)this.completeBestAttemptEndpoints(),this.solved=!0}commitAssignmentAttempt(e,t){if(this.nextAssignmentIndex++,this.evaluatedAssignmentKeys.add(JSON.stringify(e)),!this.bestAttempt||t.summary.routedConnectionCount>=this.bestAttempt.summary.routedConnectionCount)this.prioritizeFailedBusRepairs(e,t.summary.failedBusIds,t.blockingBusIds);if(this.attempts.push(t.summary),!this.bestAttempt||this.isAttemptBetter(t,this.bestAttempt))this.bestAttempt=t;if(this.stats={phase:"complete-assignment",assignment:t.summary.assignmentIndex+1,assignmentCount:this.config.maxLayerCombinations,routedBuses:`${t.summary.routedBusCount}/${this.preparedBuses.length}`,routedConnections:`${t.summary.routedConnectionCount}/${this.inputSrj.connections.length}`,failedBuses:t.summary.failedBusIds.join(", ")||"none",bestScore:this.bestAttempt.summary.score},t.stopAfterCompleteValidation&&this.hasCompleteBestAttempt()||this.groupedBeamEvaluated&&t.summary.routedConnectionCount===this.inputSrj.connections.length&&this.getCoordinatedAdditionalViaCount(this.bestAttempt.plans)===0)this.completeBestAttemptEndpoints(),this.solved=!0}getNextAssignment(){let e;while(!e&&this.nextAssignmentIndex<this.config.maxLayerCombinations){let t=this.nextAssignmentIndex%3===0,n,o=!1;if(!this.groupedBeamEvaluated&&this.nextAssignmentIndex>0)n=this.pendingRepairAssignments.pop(),o=n!==void 0;else if(t)n=this.layerAssignments[this.nextGeneratedAssignmentIndex++];else n=this.pendingRepairAssignments.pop(),o=n!==void 0;if(!n&&(this.groupedBeamEvaluated||this.nextAssignmentIndex===0))n=t?this.pendingRepairAssignments.pop():this.layerAssignments[this.nextGeneratedAssignmentIndex++],o=t&&n!==void 0;if(!n)break;let r=JSON.stringify(n);if(o)this.queuedAssignmentKeys.delete(r);if(this.evaluatedAssignmentKeys.has(r))continue;e=n}return e}finishWithoutAnotherAssignment(){if(this.hasCompleteBestAttempt()){this.completeBestAttemptEndpoints(),this.solved=!0;return}this.failed=!0;let e=this.lengthMatchingFailure?.message??this.bestAttempt?.summary.validationIssues?.[0]?.message;this.error=e?`FanoutSolver: ${e}`:this.bestAttempt?`FanoutSolver: best layer assignment routed ${this.bestAttempt.summary.routedConnectionCount}/${this.inputSrj.connections.length} connections`:"FanoutSolver: no layer assignment could be evaluated"}_step(){if(this.activeOperation){this.stepActiveOperation();return}if(!this.layerReservedRoutingEvaluated){this.layerReservedRoutingEvaluated=!0;let t=pFr(this.preparedBuses,this.config.allowBlindAndBuriedVias),n=!t&&qit({...this.config,srj:this.routingSrj,buses:this.preparedBuses})!==null;if(n||t||this.shouldTryLayerReservedRouting()){this.startOperation({name:"FanoutLayerReservedSolver",generator:this.evaluateLayerReservedRoutingSteps(t,n),onSolved:(o)=>{if(!o){this.inProgressPlans=[],this.stats={phase:"layer-reserved-fallback"};return}let r=o.summary.busLayerAssignments;this.layerAssignments.push(r),this.routingInitialized=!0,this.commitAssignmentAttempt(r,o)},getProgress:()=>Number(this.stats.workUnit??0)/Math.max(1,this.inputSrj.connections.length)}),this.stats={phase:"prepare-layer-reserved-routing"};return}}if(!this.routingInitialized){this.startOperation({name:"FanoutCandidateLayerSolver",generator:this.initializeRoutingSteps(),onSolved:()=>{},getProgress:()=>this.nextCandidateLayerBusIndex/Math.max(1,this.boundaryBuses.length+1)});return}if(this.nextAssignmentIndex>0&&this.hasGloballyViaMinimalBestAttempt()){this.completeBestAttemptEndpoints(),this.solved=!0;return}if(this.shouldEvaluateGroupedBeam()){this.groupedBeamEvaluated=!0,this.startOperation({name:"FanoutGroupedBeamSolver",generator:this.evaluateGroupedBeamAlternativesSteps(-1),onSolved:(t)=>this.commitGroupedBeamAttempt(t),getProgress:()=>{let t=Number(this.stats.workUnit??0),n=Number(this.stats.workUnitCount??0);return n>0?t/n:0}}),this.stats={...this.stats,phase:"prepare-grouped-beam"};return}let e=this.getNextAssignment();if(!e&&!this.groupedBeamEvaluated)return;if(!e){this.finishWithoutAnotherAssignment();return}this.startOperation({name:"FanoutAssignmentSolver",generator:this.evaluateAssignmentSteps(this.nextAssignmentIndex,e),onSolved:(t)=>this.commitAssignmentAttempt(e,t),getProgress:()=>{let t=this.stats.routingStrategy==="group-by-layer"?1:this.stats.routingStrategy==="deep-first"?2:0,n=Number(this.stats.workUnit??0),o=Number(this.stats.workUnitCount??0),r=o>0?Math.min(1,n/o):0;return(t+r)/3}}),this.stats={...this.stats,phase:"prepare-assignment",assignment:this.nextAssignmentIndex+1,assignmentCount:this.config.maxLayerCombinations,routedConnections:`0/${this.inputSrj.connections.length}`}}computeProgress(){if(this.solved||this.failed)return 1;if(this.activeSubSolver?.getSolverName()==="FanoutLayerReservedSolver")return Math.min(0.99,Number(this.stats.workUnit??0)/Math.max(1,this.inputSrj.connections.length));if(!this.routingInitialized)return 0.05*(this.nextCandidateLayerBusIndex/Math.max(1,this.boundaryBuses.length+1));let e=0;if(this.activeSubSolver?.getSolverName()==="FanoutAssignmentSolver"){let t=this.stats.routingStrategy==="group-by-layer"?1:this.stats.routingStrategy==="deep-first"?2:0,n=Number(this.stats.workUnit??0),o=Number(this.stats.workUnitCount??0),r=o>0?Math.min(1,n/o):0;e=(t+r)/3}return Math.min(0.99,0.05+0.95*((this.nextAssignmentIndex+e)/this.config.maxLayerCombinations))}getConstructorParams(){return[this.inputSrj,this.options]}getOutput(){if(!this.solved||!this.bestAttempt)throw Error("FanoutSolver: getOutput() called before a complete fanout was solved");let e=this.validateCompletePlans(this.bestAttempt.plans,this.bestAttempt.outputSrj);if(!e.valid)throw Error(`FanoutSolver: completed output failed validation: ${e.issues[0]?.message??"unknown validation error"}`);let t=SFr({srj:this.endpointCompletion?.simpleRouteJson??this.bestAttempt.outputSrj,layerNames:this.config.layerNames,allowBlindAndBuriedVias:this.config.allowBlindAndBuriedVias}),n=new Map((t.traces??[]).map((o)=>[o.pcb_trace_id,o]));return{simpleRouteJson:t,fanoutTraces:this.bestAttempt.plans.flatMap((o)=>[n.get(o.trace.pcb_trace_id)??o.trace,...o.planeEndpointTrace?[n.get(o.planeEndpointTrace.pcb_trace_id)??o.planeEndpointTrace]:[]]),completionTraces:(this.endpointCompletion?.traces??[]).map((o)=>n.get(o.pcb_trace_id)??o),...this.endpointCompletion?{endpointCompletion:this.endpointCompletion.report}:{},planeTerminations:this.bestAttempt.plans.flatMap((o)=>o.termination.type==="plane"&&o.via?[{busId:o.busId,connectionName:o.connectionName,layer:o.termination.layer,via:o.via}]:[]),busLayerAssignments:this.bestAttempt.summary.busLayerAssignments,busDirections:Object.fromEntries(this.preparedBuses.map((o)=>[o.busId,o.direction])),attempts:[...this.attempts],validation:e}}getOutputSimpleRouteJson(){return this.getOutput().simpleRouteJson}visualize(){return this.activeSubSolver?.visualize()??this.visualizeCurrentState()}};var QOr=(e)=>{if(typeof e!=="object"){let t=Ke.parse(e);return{top:t,right:t,bottom:t,left:t}}return{top:e.top===void 0?0:Ke.parse(e.top),right:e.right===void 0?0:Ke.parse(e.right),bottom:e.bottom===void 0?0:Ke.parse(e.bottom),left:e.left===void 0?0:Ke.parse(e.left)}},kOr=(e)=>{let t=(e.ccwRotationDegrees??0)*Math.PI/180,n=Math.abs(Math.cos(t)),o=Math.abs(Math.sin(t));return{x:(n*e.width+o*e.height)/2,y:(o*e.width+n*e.height)/2}},LOr=({preparedBuses:e,padding:t})=>{if(t===void 0)return;let n=new Map;for(let a of e){if(n.has(a.componentId))continue;n.set(a.componentId,a.componentObstacles.filter((c)=>c.connectedTo.length>0))}let o=[...n.values()].flat();if(o.length===0)throw Error("Cannot apply fanout boundary padding without source pad obstacles");let r=o.map((a)=>{let c=kOr(a);return{minX:a.center.x-c.x,maxX:a.center.x+c.x,minY:a.center.y-c.y,maxY:a.center.y+c.y}}),i=QOr(t),s={minX:Math.min(...r.map((a)=>a.minX))-i.left,maxX:Math.max(...r.map((a)=>a.maxX))+i.right,minY:Math.min(...r.map((a)=>a.minY))-i.bottom,maxY:Math.max(...r.map((a)=>a.maxY))+i.top};for(let a of e){if(a.termination.type!=="boundary")continue;for(let c of a.connections)if(a.direction==="left"||a.direction==="right")s.minY=Math.min(s.minY,c.targetPoint.y),s.maxY=Math.max(s.maxY,c.targetPoint.y);else s.minX=Math.min(s.minX,c.targetPoint.x),s.maxX=Math.max(s.maxX,c.targetPoint.x)}return s},HOr=(e)=>Math.round(e*1000)/1000,FOr=(e,t)=>{let n;for(let o of e.obstacles){if(!o.componentId||!t.has(o.componentId))continue;let r=o.center.x-o.width/2,i=o.center.x+o.width/2,s=o.center.y-o.height/2,a=o.center.y+o.height/2;n=n?{minX:Math.min(n.minX,r),maxX:Math.max(n.maxX,i),minY:Math.min(n.minY,s),maxY:Math.max(n.maxY,a)}:{minX:r,maxX:i,minY:s,maxY:a}}return n},zOr=(e,t)=>Math.min(e.minX-t.minX,t.maxX-e.maxX,e.minY-t.minY,t.maxY-e.maxY),OOr=({input:e,solverError:t,componentIds:n,sharedBoundary:o,componentNamesById:r})=>{let i=t?.match(/routed (\d+)\/(\d+) connections/),s=i?Number(i[1]):void 0,a=i?Number(i[2]):e.connections.length,c=[...n].map((u)=>r?.get(u)??u).sort(),l=c.length>0?` for ${c.join(", ")}`:"",h=[s===void 0?`Fanout failed${l}: ${t??"the fanout solver did not report a reason"}.`:`Fanout failed${l}: only ${s} of ${a} connections could escape to the breakout boundary.`],d=FOr(e,n);if(d&&o){let u=zOr(d,o);h.push(`The breakout boundary is ${HOr(u)}mm from the pads at its narrowest point, which all ${a} escapes have to share.`)}return h.push("Give the fanout more room by increasing the breakout's padding, or by extending the breakout to include the parts crowding it (decoupling capacitors, series resistors) so their pads sit inside the boundary instead of against it."),h.join(" ")},VOr=(e,t)=>Math.abs(e.minX-t.minX)>0.000001||Math.abs(e.maxX-t.maxX)>0.000001||Math.abs(e.minY-t.minY)>0.000001||Math.abs(e.maxY-t.maxY)>0.000001,YOr=(e,t)=>{if(!e&&t.length===0)return;return{minX:Math.min(e?.minX??Number.POSITIVE_INFINITY,...t.map((n)=>n.x)),maxX:Math.max(e?.maxX??Number.NEGATIVE_INFINITY,...t.map((n)=>n.x)),minY:Math.min(e?.minY??Number.POSITIVE_INFINITY,...t.map((n)=>n.y)),maxY:Math.max(e?.maxY??Number.NEGATIVE_INFINITY,...t.map((n)=>n.y))}},GOr=(e,t)=>e?.map((n)=>{let{preferredLayer:o,preferredLayers:r,...i}=n,s=t?.[n.busId],a=s===void 0?void 0:Zit(s),c=a&&a!=="center"&&est(a)?a:void 0,l={...i,...n.termination?.type==="plane"?{}:c?{exitPosition:c}:{}},h=[...o===void 0?[]:[o],...r??[]].filter((_,p,m)=>m.indexOf(_)===p);if(h.length===0)return l;let d=n.allowedLayers,u=d===void 0?h:h.filter((_)=>d.includes(_));return{...l,allowedLayers:u}}),Zit=(e)=>typeof e==="string"?e:e.direction,UOr=new Set(eGe),est=(e)=>UOr.has(e),WOr=(e)=>{switch(e){case"top_left":return"top-left";case"top_center":return"top";case"top_right":return"top-right";case"center_left":return"left";case"center":return;case"center_right":return"right";case"bottom_left":return"bottom-left";case"bottom_center":return"bottom";case"bottom_right":return"bottom-right"}},XOr=(e)=>{switch(e){case"top_left":case"top_center":case"top_right":return"up";case"center_left":return"left";case"center":return;case"center_right":return"right";case"bottom_left":case"bottom_center":case"bottom_right":return"down"}},jOr=(e)=>{let t=Zit(e);return est(t)?V4n(t).direction:XOr(t)},KOr=(e,t)=>e.obstacles.find((o)=>o.componentId&&o.layers.includes(t.layer)&&(t.pointId&&o.connectedTo.includes(t.pointId)||t.x>=o.center.x-o.width/2&&t.x<=o.center.x+o.width/2&&t.y>=o.center.y-o.height/2&&t.y<=o.center.y+o.height/2))?.componentId,$Or=(e,t)=>{let n=new Set(t.connectionNames),o=new Map;for(let f of e.connections){if(!n.has(f.name))continue;for(let y of f.pointsToConnect){let x=KOr(e,y);if(!x)continue;let C=o.get(x)??[];C.push(y),o.set(x,C)}}let r=[...o.entries()].sort(([f,y],[x,C])=>C.length-y.length||f.localeCompare(x))[0];if(!r)return;let[i,s]=r,a=e.obstacles.filter((f)=>f.componentId===i);if(a.length===0)return;let c=a.map((f)=>f.center.x),l=a.map((f)=>f.center.y),h=Math.min(...c),d=Math.max(...c),u=Math.min(...l),_=Math.max(...l),p={x:(h+d)/2,y:(u+_)/2},m={x:Math.max((d-h)/2,0.000001),y:Math.max((_-u)/2,0.000001)},A={x:s.reduce((f,y)=>f+y.x,0)/s.length,y:s.reduce((f,y)=>f+y.y,0)/s.length},g={x:(A.x-p.x)/m.x,y:(A.y-p.y)/m.y};if(Math.abs(g.x)>Math.abs(g.y))return g.x>=0?"right":"left";if(Math.abs(g.y)>0.000000001)return g.y>=0?"up":"down";return"right"},qOr=({fanoutSimpleRouteJson:e,sourceComponentIds:t})=>{let n=new Map;for(let r of e.obstacles){if(!r.componentId||!t.has(r.componentId))continue;let i=n.get(r.componentId)??[];i.push(r),n.set(r.componentId,i)}let o=[];for(let[r,i]of n){let s=Math.min(...i.map((h)=>h.center.x-h.width/2)),a=Math.max(...i.map((h)=>h.center.x+h.width/2)),c=Math.min(...i.map((h)=>h.center.y-h.height/2)),l=Math.max(...i.map((h)=>h.center.y+h.height/2));o.push({obstacleId:`fanout-source-keepout:${r}`,componentId:r,isFanoutSourceKeepout:!0,type:"rect",layers:HY(e.layerCount),center:{x:(s+a)/2,y:(c+l)/2},width:a-s,height:l-c,connectedTo:[]})}return{...e,obstacles:[...e.obstacles.filter((r)=>!r.componentId||!t.has(r.componentId)),...o]}},Oot=class e{constructor(t,n){this.input=t,this.options=n}input;options;isRouting=!1;outputSimpleRouteJson;startTimeoutId;eventHandlers={complete:[],error:[],progress:[]};getLegacyBusExitPreferences(){if(!this.options.busFanoutDirections)return;let t=new Set(this.input.buses?.map((r)=>r.busId)??[]),n=new Set(this.input.buses?.filter((r)=>r.termination?.type==="plane").map((r)=>r.busId)??[]),o={};for(let[r,i]of Object.entries(this.options.busFanoutDirections)){if(!t.has(r))throw Error(`Fanout direction references unknown bus "${r}" in this autorouting phase`);if(n.has(r))continue;let s=Zit(i);if(est(s))continue;let a=WOr(s);if(a)o[r]=a}return Object.keys(o).length>0?o:void 0}getPlaneBusDirections(){let t=this.input.buses?.filter((r)=>r.termination?.type==="plane")??[],n=new Set(t.map((r)=>r.busId)),o={};for(let[r,i]of Object.entries(this.options.busFanoutDirections??{})){if(!n.has(r))continue;let s=jOr(i);if(s)o[r]=s}for(let r of t){if(o[r.busId])continue;let i=$Or(this.input,r);if(i)o[r.busId]=i}return Object.keys(o).length>0?o:void 0}getFanoutSolverOptions(){let t={buses:GOr(this.input.buses,this.options.busFanoutDirections),borderDistribution:"even",compactBusTracks:!0,busDirections:this.getPlaneBusDirections(),busExitPreferences:this.getLegacyBusExitPreferences(),escapeLayers:this.options.fanoutRoutingLayers,allowBlindAndBuriedVias:this.options.allowBlindAndBuriedVias??this.input.allowBlindAndBuriedVias};if(this.options.mode==="single_layer_fanout")return{...t,escapeLayers:["top"],singleLayerPushAndShove:!0};return t}static resolveFanoutBounds(t,n){let o,r;if(n.fanoutBoundaryPadding!==void 0){let i=new e(t,n),s=new kve(t,i.getFanoutSolverOptions());o=LOr({preparedBuses:s.preparedBuses,padding:n.fanoutBoundaryPadding})}else if(n.fanoutBounds===void 0){let i=new e(t,n);r=new kve(t,i.getFanoutSolverOptions()).preparedBuses[0]?.sharedBoundary}if(n.fanoutBounds&&o&&VOr(n.fanoutBounds,o))n.onFanoutBoundsConflict?.();return YOr(n.fanoutBounds??o??r,n.breakoutPoints??[])}solveFanout(){let t=this.getFanoutSolverOptions(),n=new kve(this.input,{...t,...this.options.fanoutBounds?{sharedBoundary:this.options.fanoutBounds}:{}}),o=n.getConstructorParams();if(this.options.onSolverStarted?.({solverName:"FanoutSolver",solverParams:o[0],solverConstructorArgs:o}),n.solve(),n.failed)throw Error(OOr({input:this.input,solverError:n.error,componentIds:new Set(n.preparedBuses.map((a)=>a.componentId)),sharedBoundary:this.options.fanoutBounds??t.sharedBoundary,componentNamesById:this.options.componentNamesById}));let r=n.getOutput(),{simpleRouteJson:i,fanoutTraces:s}=r;return{downstreamSimpleRouteJson:qOr({fanoutSimpleRouteJson:i,sourceComponentIds:new Set(n.preparedBuses.map((a)=>a.componentId))}),fanoutTraces:s,debugGraphics:n.visualize()}}startFanout(){try{let{downstreamSimpleRouteJson:t,fanoutTraces:n,debugGraphics:o}=this.solveFanout();if(!this.isRouting)return;this.outputSimpleRouteJson=t,this.emitEvent({type:"progress",steps:1,progress:1,phase:this.options.mode,debugGraphics:o}),this.isRouting=!1,this.emitEvent({type:"complete",traces:n})}catch(t){this.isRouting=!1,this.emitEvent({type:"error",error:t instanceof Error?t:Error(String(t))})}}start(){if(this.isRouting)return;this.isRouting=!0,this.startTimeoutId=setTimeout(()=>{this.startTimeoutId=void 0,this.startFanout()},0)}stop(){if(this.startTimeoutId!==void 0)clearTimeout(this.startTimeoutId),this.startTimeoutId=void 0;this.isRouting=!1}on(t,n){if(t==="complete")this.eventHandlers.complete.push(n);else if(t==="error")this.eventHandlers.error.push(n);else this.eventHandlers.progress.push(n)}emitEvent(t){if(t.type==="complete")for(let n of this.eventHandlers.complete)n(t);else if(t.type==="error")for(let n of this.eventHandlers.error)n(t);else for(let n of this.eventHandlers.progress)n(t)}solveSync(){let{downstreamSimpleRouteJson:t,fanoutTraces:n}=this.solveFanout();return this.outputSimpleRouteJson=t,n}getOutputSimpleRouteJson(){return this.outputSimpleRouteJson}},D9e=0.000001;function JOr(e,t){if(!e.subcircuit_connectivity_map_key||e.subcircuit_connectivity_map_key!==t.subcircuit_connectivity_map_key||e.subcircuit_id!==t.subcircuit_id)return!1;let n=e.layers.toSorted(),o=t.layers.toSorted();return Math.abs(e.x-t.x)<=D9e&&Math.abs(e.y-t.y)<=D9e&&Math.abs(e.hole_diameter-t.hole_diameter)<=D9e&&Math.abs(e.outer_diameter-t.outer_diameter)<=D9e&&n.length===o.length&&n.every((r,i)=>r===o[i])}var ZOr=({db:e,connectedOffboardObstacles:t,simpleRouteJson:n,subcircuit_id:o})=>{if(Object.keys(t).length===0)return;let r=new Map;for(let a of e.pcb_port.list())if(a.source_port_id){let c=e.pcb_smtpad.getWhere({pcb_port_id:a.pcb_port_id});if(c)r.set(c.pcb_smtpad_id,a.source_port_id);let l=e.pcb_plated_hole.getWhere({pcb_port_id:a.pcb_port_id});if(l)r.set(l.pcb_plated_hole_id,a.source_port_id)}let i=new Map;for(let a of n.obstacles)if(a.obstacleId)i.set(a.obstacleId,a);let s=new Map;for(let[a,c]of Object.entries(t)){if(!s.has(c))s.set(c,[]);s.get(c).push(a)}for(let[a,c]of s){let l=new Set;for(let _ of c){let p=i.get(_);if(!p)continue;for(let m of p.connectedTo){let A=r.get(m);if(A)l.add(A)}}if(l.size<2)continue;let h=Array.from(l);if(e.source_trace.list().some((_)=>{let p=new Set(_.connected_source_port_ids);return h.every((m)=>p.has(m))}))continue;e.source_trace.insert({connected_source_port_ids:h,connected_source_net_ids:[],subcircuit_id:o??void 0,display_name:`offboard_${a}`})}},v3n=({traceWidth:e,traceToPadClearance:t,viaPadDiameter:n})=>(n??Math.max(e*2,0.3))+2*(e+t),eVr=(e)=>{let t=new Map;for(let n of e.pcb_component.list()){let o=e.source_component.get(n.source_component_id);if(o?.name)t.set(n.pcb_component_id,o.name)}return t},Gtt=(e)=>e?.replace(/-/g,"_");function S3n(e){if(!e)return null;if(typeof e==="string"){let n=Gtt(e);return n==="sequential_trace"||n==="auto_cloud"?n:null}let t=Gtt(e.preset);if(t==="sequential_trace"||t==="auto_cloud")return t;return Gtt(e.groupMode)==="sequential_trace"?"sequential_trace":null}function fde(e,t){let n={serverUrl:"https://registry-api.tscircuit.com",serverMode:"job",serverCacheEnabled:!0};if(typeof e==="object"&&!e.preset)return{local:!(e.serverUrl||e.serverMode||e.serverCacheEnabled),...n,...e};let o=typeof e==="object"?e.preset:e,r=typeof e==="object"?e:{},i=typeof o==="string"?o.replace(/_/g,"-"):o,s=i&&typeof i==="string"?t?.autorouterMap?.[i]:void 0;if(s)return{local:!0,groupMode:"subcircuit",algorithmFn:async(a)=>s.createAutorouter(a)};switch(i){case"default":case"auto":case"auto-local":return{local:!0,groupMode:"subcircuit"};case"sequential-trace":return{local:!0,groupMode:"sequential-trace"};case"subcircuit":return{local:!0,groupMode:"subcircuit"};case"beta-pipeline9":return{local:!0,groupMode:"subcircuit",autorouterVersion:"beta_pipeline9"};case"single-layer-fanout":return{local:!0,groupMode:"subcircuit",preset:"single_layer_fanout"};case"single-layer-routing":case"bus-lanes":return{...r,local:!0,groupMode:"subcircuit",preset:"bus_lanes"};case"dogbone":return{local:!0,groupMode:"subcircuit",preset:"dogbone"};case"fanout":return{...r,local:!0,groupMode:"subcircuit",preset:"fanout"};case"simplify":return{local:!0,groupMode:"subcircuit",preset:"simplify"};case"auto-cloud":{let{preset:a,local:c,groupMode:l,...h}=r;return{local:!1,groupMode:"subcircuit",...n,...h}}case"laser-prefab":{let{preset:a,local:c,groupMode:l,...h}=r;return{local:!0,groupMode:"subcircuit",preset:"laser_prefab",...h}}case"auto-jumper":{let{preset:a,local:c,groupMode:l,...h}=r;return{local:!0,groupMode:"subcircuit",preset:"auto_jumper",...h}}default:return{local:!0,groupMode:"subcircuit"}}}var uY=0.000000001;function P3n(e){return e.shape==="circle"}function Vot(e,t){let n=-(t.ccwRotationDegrees??0)*Math.PI/180,o=e.x-t.center.x,r=e.y-t.center.y;return{x:o*Math.cos(n)-r*Math.sin(n),y:o*Math.sin(n)+r*Math.cos(n)}}function rk(e,t){return Math.hypot(e.x-t.x,e.y-t.y)}function cB(e,t,n){let o=n.x-t.x,r=n.y-t.y,i=o*o+r*r,s=i<uY?0:((e.x-t.x)*o+(e.y-t.y)*r)/i,a=Math.max(0,Math.min(1,s));return Math.hypot(e.x-(t.x+a*o),e.y-(t.y+a*r))}function N9e(e,t,n){return(t.x-e.x)*(n.y-e.y)-(t.y-e.y)*(n.x-e.x)}function tVr(e,t,n,o){let r=N9e(n,o,e),i=N9e(n,o,t),s=N9e(e,t,n),a=N9e(e,t,o);return(r>0&&i<0||r<0&&i>0)&&(s>0&&a<0||s<0&&a>0)}function E3n(e,t,n,o){if(tVr(e,t,n,o))return 0;return Math.min(cB(e,n,o),cB(t,n,o),cB(n,e,t),cB(o,e,t))}function nVr(e,t){if(P3n(t))return Math.max(0,rk(e,t.center)-t.width/2);let n=Vot(e,t),o=Math.max(Math.abs(n.x)-t.width/2,0),r=Math.max(Math.abs(n.y)-t.height/2,0);return Math.hypot(o,r)}function oVr(e,t){if(P3n(t))return Math.max(0,cB(t.center,e.start,e.end)-t.width/2);let n=Vot(e.start,t),o=Vot(e.end,t);if(Math.abs(n.x)<=t.width/2+uY&&Math.abs(n.y)<=t.height/2+uY)return 0;if(Math.abs(o.x)<=t.width/2+uY&&Math.abs(o.y)<=t.height/2+uY)return 0;let r=-t.width/2,i=t.width/2,s=-t.height/2,a=t.height/2,c=[{x:r,y:s},{x:i,y:s},{x:i,y:a},{x:r,y:a}],l=Number.POSITIVE_INFINITY;for(let h=0;h<c.length;h++)l=Math.min(l,E3n(n,o,c[h],c[(h+1)%c.length]));return l}function M3n(e,t,n){if(e.layer!==t.layer)return!0;let o=(e.width+t.width)/2+n,r=o+uY;if(Math.min(e.start.x,e.end.x)-Math.max(t.start.x,t.end.x)>r||Math.min(t.start.x,t.end.x)-Math.max(e.start.x,e.end.x)>r||Math.min(e.start.y,e.end.y)-Math.max(t.start.y,t.end.y)>r||Math.min(t.start.y,t.end.y)-Math.max(e.start.y,e.end.y)>r)return!0;return E3n(e.start,e.end,t.start,t.end)>=o-uY}var Gu=0.000000001,rVr=1e5;function iVr(e){for(let[n,o]of[["viaDiameter",e.viaDiameter],["traceWidth",e.traceWidth]])if(!Number.isFinite(o)||o<=0)throw Error(`FanoutSolver: dogbone ${n} must be a positive finite number, received ${o}`);if(!Number.isFinite(e.clearance)||e.clearance<0)throw Error(`FanoutSolver: dogbone clearance must be a non-negative finite number, received ${e.clearance}`);if(e.viaHoleDiameter!==void 0&&(!Number.isFinite(e.viaHoleDiameter)||e.viaHoleDiameter<=0))throw Error(`FanoutSolver: dogbone viaHoleDiameter must be a positive finite number, received ${e.viaHoleDiameter}`);if(e.holeToHoleClearance!==void 0&&(!Number.isFinite(e.holeToHoleClearance)||e.holeToHoleClearance<0))throw Error(`FanoutSolver: dogbone holeToHoleClearance must be a non-negative finite number, received ${e.holeToHoleClearance}`);if(e.holeToHoleClearance!==void 0&&e.viaHoleDiameter===void 0)throw Error("FanoutSolver: dogbone holeToHoleClearance requires viaHoleDiameter");let t=e.maximumSearchStates??rVr;if(!Number.isInteger(t)||t<1)throw Error(`FanoutSolver: dogbone maximumSearchStates must be a positive integer, received ${t}`);return t}function Yot(e){let t=[];for(let n of e.toSorted((o,r)=>o-r)){if(!Number.isFinite(n))continue;if(t.length===0||Math.abs(t.at(-1)-n)>Gu)t.push(n)}return t}function sVr(e){let t=new Map,n=new Map,o=new Map;for(let r of e){let i=t.get(r.componentId);if(!i)i={componentId:r.componentId,connections:[],obstacles:[],xCoordinates:[],yCoordinates:[],pitchX:Number.POSITIVE_INFINITY,pitchY:Number.POSITIVE_INFINITY},t.set(r.componentId,i),o.set(r.componentId,new Set);if(i.xCoordinates.push(...r.xCoordinates),i.yCoordinates.push(...r.yCoordinates),Number.isFinite(r.pitchX)&&r.pitchX>Gu)i.pitchX=Math.min(i.pitchX,r.pitchX);if(Number.isFinite(r.pitchY)&&r.pitchY>Gu)i.pitchY=Math.min(i.pitchY,r.pitchY);let s=o.get(r.componentId);for(let a of r.componentObstacles)if(!s.has(a))s.add(a),i.obstacles.push(a);for(let a of r.connections){let c=n.get(a.connectionIndex);if(c!==void 0){if(c!==r.componentId)throw Error(`FanoutSolver: connection index ${a.connectionIndex} belongs to multiple components`);continue}n.set(a.connectionIndex,r.componentId),i.connections.push({preparedConnection:a,busId:r.busId,direction:r.direction,terminationType:r.termination.type})}}return[...t.values()].map((r)=>({...r,connections:r.connections.toSorted((i,s)=>i.preparedConnection.connectionIndex-s.preparedConnection.connectionIndex),xCoordinates:Yot(r.xCoordinates),yCoordinates:Yot(r.yCoordinates)})).toSorted((r,i)=>r.componentId.localeCompare(i.componentId))}function aVr(e){let{coordinates:t,pitch:n}=e;if(t.length===0||!Number.isFinite(n)||n<=Gu)return[];let o=[t[0]-n/2];for(let r=1;r<t.length;r++)o.push((t[r-1]+t[r])/2);return o.push(t.at(-1)+n/2),Yot(o)}function xAn(e){let{sourceCoordinate:t,coordinates:n,pitch:o}=e,r=aVr({coordinates:n,pitch:o}),i=r.filter((a)=>a<t-Gu).at(-1),s=r.find((a)=>a>t+Gu);return[i,s].filter((a)=>a!==void 0)}function cVr(e,t){let n=Math.abs(t.x-e.x),o=Math.abs(t.y-e.y);return n<=Gu||o<=Gu||Math.abs(n-o)<=Gu}function lVr(e){let{source:t,site:n,direction:o}=e,r=o==="right"?n.x-t.x:o==="left"?t.x-n.x:o==="up"?n.y-t.y:t.y-n.y;return r>Gu?0:Math.abs(r)<=Gu?1:2}function hVr(e){let{point:t,obstacles:n,viaDiameter:o,clearance:r}=e,i=o/2+r;return n.every((s)=>nVr(t,s)>=i-Gu)}function dVr(e){let{segment:t,sourceObstacle:n,obstacles:o,clearance:r}=e,i=t.width/2+r;return o.every((s)=>s===n||oVr(t,s)>=i-Gu)}function uVr(e){let{connection:t,component:n,rules:o}=e,{preparedConnection:r,direction:i}=t,s=o.additionalObstacles?[...new Set([...n.obstacles,...o.additionalObstacles])]:n.obstacles,a={x:r.sourcePoint.x,y:r.sourcePoint.y},c=xAn({sourceCoordinate:a.x,coordinates:n.xCoordinates,pitch:n.pitchX}),l=xAn({sourceCoordinate:a.y,coordinates:n.yCoordinates,pitch:n.pitchY}),h=[...c.map((I)=>({x:I,y:a.y})),...l.map((I)=>({x:a.x,y:I})),...c.flatMap((I)=>l.map((v)=>({x:I,y:v})))],d=[];for(let I of h)if(!d.some((v)=>rk(v,I)<=Gu))d.push(I);let u=o.fixedViaPointsByConnectionIndex?.get(r.connectionIndex),_=u?[u]:d,p=[];for(let I of _){if(t.terminationType==="plane"&&!cVr(a,I))continue;if(!hVr({point:I,obstacles:s,viaDiameter:o.viaDiameter,clearance:o.clearance}))continue;let v={start:a,end:I,width:o.traceWidth,layer:r.sourceLayer};if(!dVr({segment:v,sourceObstacle:r.sourceObstacle,obstacles:s,clearance:o.clearance}))continue;if(!(o.blockingSegments??[]).every((B)=>{if(B.connectionIndex===r.connectionIndex)return!0;if(o.canShareCopper?.(r.connectionIndex,B.connectionIndex))return!0;let T=o.viaDiameter/2+B.segment.width/2+o.clearance;if(cB(I,B.segment.start,B.segment.end)<T-Gu)return!1;return B.segment.layer!==v.layer||M3n(v,B.segment,o.clearance)}))continue;if(!(o.blockingVias??[]).every((B)=>{if(B.connectionIndex===r.connectionIndex)return!0;if(rk(I,B.center)<(o.viaDiameter+B.diameter)/2+o.clearance-Gu)return!1;if(B.spanLayers.includes(v.layer)&&cB(B.center,v.start,v.end)<B.diameter/2+v.width/2+o.clearance-Gu)return!1;return!0}))continue;p.push({connectionIndex:r.connectionIndex,point:I,sourceSegment:v,outwardRank:lVr({source:a,site:I,direction:i})})}let m=i==="left"||i==="right"?n.yCoordinates:n.xCoordinates,A=i==="left"||i==="right"?a.y:a.x,g=m.findIndex((I)=>Math.abs(I-A)<=Gu),f=g>=0?g%2===0?1:-1:void 0,y=t.terminationType==="boundary"?o.preferredBoundaryPerpendicularSideByBusId?.get(t.busId):o.preferPlaneCheckerboardSites&&t.terminationType==="plane"&&(i==="left"||i==="right")?f:void 0,x=t.terminationType==="boundary"?o.preferBoundaryOutwardByBusId?.get(t.busId)??!0:!0,C=o.preferredViaPointsByConnectionIndex?.get(r.connectionIndex),b=(I)=>{if(y===void 0)return 0;let v=i==="left"||i==="right"?I.point.y-a.y:I.point.x-a.x;return v*y>Gu?0:Math.abs(v)<=Gu?1:2};return p.toSorted((I,v)=>(C?Number(rk(I.point,C)>Gu)-Number(rk(v.point,C)>Gu):0)||(x?I.outwardRank-v.outwardRank:v.outwardRank-I.outwardRank)||b(I)-b(v)||rk(a,I.point)-rk(a,v.point)||I.point.x-v.point.x||I.point.y-v.point.y)}function pVr(e){let{first:t,second:n,rules:o}=e,r=o.canShareCopper?.(t.connectionIndex,n.connectionIndex)??!1,i=o.viaHoleDiameter?o.viaHoleDiameter+(o.holeToHoleClearance??o.clearance):0,s=r?i:Math.max(o.viaDiameter+o.clearance,i);if(rk(t.point,n.point)<s-Gu)return!1;let a=o.viaDiameter/2+o.traceWidth/2+o.clearance;if(!r){if(cB(t.point,n.sourceSegment.start,n.sourceSegment.end)<a-Gu||cB(n.point,t.sourceSegment.start,t.sourceSegment.end)<a-Gu)return!1}if(r)return!0;return M3n(t.sourceSegment,n.sourceSegment,o.clearance)}function mVr(e){let{component:t,rules:n,consumeSearchState:o}=e,r=t.connections.map((_)=>({connection:_,candidates:uVr({connection:_,component:t,rules:n})}));if(r.some((_)=>_.candidates.length===0))return null;let i=new Map,s=(_,p)=>{let m=i.get(_)?.get(p);if(m!==void 0)return m;let A=pVr({first:_,second:p,rules:n}),g=i.get(_)??new Map;g.set(p,A),i.set(_,g);let f=i.get(p)??new Map;return f.set(_,A),i.set(p,f),A},a=r.flatMap((_)=>_.candidates.length===1?[_.candidates[0]]:[]);for(let _=0;_<a.length;_++){let p=a[_];for(let m=0;m<_;m++)if(!s(p,a[m]))return null}let c=new Map(a.map((_)=>[_.connectionIndex,_])),l=new Set(r.flatMap((_)=>_.candidates.length>1?[_.connection.preparedConnection.connectionIndex]:[])),h=new Map(r.map((_)=>[_.connection.preparedConnection.connectionIndex,_]));if(l.size===0)return new Map([...c.entries()].map(([_,p])=>[_,{...p.point}]));let d=(_)=>_.candidates.filter((p)=>[...c.values()].every((m)=>s(p,m))),u=()=>{if(!o())return!1;if(l.size===0)return!0;let _,p=[];for(let A of[...l].toSorted((g,f)=>g-f)){let g=h.get(A),f=d(g);if(f.length===0)return!1;if(!_||f.length<p.length||f.length===p.length&&A<_.connection.preparedConnection.connectionIndex)_=g,p=f}let m=_.connection.preparedConnection.connectionIndex;l.delete(m);for(let A of p){if(c.set(m,A),u())return!0;c.delete(m)}return l.add(m),!1};if(!u())return null;return new Map([...c.entries()].toSorted(([_],[p])=>_-p).map(([_,p])=>[_,{...p.point}]))}function _Vr(e,t){let n=iVr(t);if(e.length===0)return new Map;let o=0,r=()=>(o++,o<=n),i=new Map;for(let s of sVr(e)){let a=mVr({component:s,rules:t,consumeSearchState:r});if(!a)return null;for(let[c,l]of a)i.set(c,l)}return i}var cXs=Math.PI*2,lXs=globalThis.process?.env?.FANOUT_FLOW_DEBUG==="1",gVr=(e)=>e.process??{env:{}},hXs=gVr(globalThis);function AVr(e){if(e<=1)return["top"];return["top",...Array.from({length:e-2},(t,n)=>`inner${n+1}`),"bottom"]}var w3n=class extends co{constructor(e){super();this.params=e,this.MAX_ITERATIONS=e.input.connections.length*2+10,this.steps=this.solveSteps()}params;phase="preparing";sources=[];sites=new Map;traces=[];steps;getConstructorParams(){return[this.params]}_step(){try{if(this.steps.next().done)this.phase="complete",this.progress=1,this.solved=!0}catch(e){this.error=e instanceof Error?e.message:String(e),this.failed=!0}}getOutput(){if(!this.solved)throw Error(this.error??"Dogbone fanout is not solved");return this.traces}visualize(){return{rects:this.params.input.obstacles.filter((e)=>e.shape!=="circle").map((e)=>({center:e.center,width:e.width,height:e.height,fill:"rgba(200,40,40,0.3)"})),circles:[...this.params.input.obstacles.filter((e)=>e.shape==="circle").map((e)=>({center:e.center,radius:e.width/2,fill:"rgba(200,40,40,0.3)"})),...[...this.sites.values()].map((e)=>({center:e,radius:(this.params.input.minViaPadDiameter??this.params.input.minViaDiameter??0.6)/2,fill:"orange"}))],lines:[...this.sites].map(([e,t])=>({points:[this.sources[e].port,t],strokeColor:"orange",strokeWidth:this.params.input.minTraceWidth}))}}*solveSteps(){let{input:e,fanoutRoutingLayers:t}=this.params,n=e.minTraceWidth,o=e.minTraceToPadEdgeClearance??0.1,r=e.minViaPadDiameter??e.minViaDiameter??0.6,i=e.minViaHoleDiameter??0.3,s=e.minViaEdgeToPadEdgeClearance??o,a=e.minBoardEdgeClearance??o,c=e.minViaHoleEdgeToViaHoleEdgeClearance??o;this.sources=e.connections.map((g)=>{let f=g.pointsToConnect.find((x)=>x.pcb_port_id&&e.obstacles.some((C)=>C.componentId&&Math.hypot(C.center.x-x.x,C.center.y-x.y)<0.000001));if(!f?.pcb_port_id)throw Error(`Dogbone connection ${g.name} has no source pad`);let y=e.obstacles.find((x)=>x.componentId&&Math.hypot(x.center.x-f.x,x.center.y-f.y)<0.000001);return{port:{pcb_port_id:f.pcb_port_id,pcb_component_id:y.componentId,x:f.x,y:f.y,layers:[Bo.parse(f.layer)]},sourceTraceId:g.source_trace_id}});let l=this.sources,h=AVr(e.layerCount),d=t??h;if(d.some((g)=>!h.some((f)=>f===g)))throw Error("Dogbone fanout targets an unavailable board layer");let u=[],_=l.map(({port:g,sourceTraceId:f},y)=>{let x=e.obstacles.find((P)=>P.componentId===g.pcb_component_id&&Math.hypot(P.center.x-g.x,P.center.y-g.y)<0.000001);if(!x)throw Error("Dogbone fanout requires a component pad at each source port");if(g.layers.length!==1||!h.includes(g.layers[0]))throw Error("Dogbone fanout requires a single-layer SMT source pad");let C=g.layers[0],b=d.find((P)=>P!==C);if(!b)throw Error("Dogbone fanout requires a legal layer distinct from the source pad");let I=u.find((P)=>P.componentId===x.componentId);if(!I){let P=e.obstacles.filter((N)=>N.componentId===x.componentId),M=[...new Set(P.map((N)=>Math.round(N.center.x*1e6)/1e6))].sort((N,D)=>N-D),B=[...new Set(P.map((N)=>Math.round(N.center.y*1e6)/1e6))].sort((N,D)=>N-D);if(M.length<2||B.length<2)throw Error("Dogbone fanout requires a two-dimensional pad grid");let T=(N)=>Math.min(...N.slice(1).map((D,L)=>D-N[L]));I={busId:x.componentId,componentId:x.componentId,componentObstacles:P,connections:[],direction:"down",termination:{type:"boundary"},componentBounds:{minX:M[0],maxX:M.at(-1),minY:B[0],maxY:B.at(-1)},sharedBoundary:e.bounds,xCoordinates:M,yCoordinates:B,pitchX:T(M),pitchY:T(B)},u.push(I)}let v={x:g.x,y:g.y,layer:C,pcb_port_id:g.pcb_port_id};return I.connections.push({connectionIndex:y,connection:{name:g.pcb_port_id,pointsToConnect:[v]},sourcePoint:v,sourcePointIndex:0,sourceLayer:C,sourceObstacle:x,targetPoint:v}),{sourceTraceId:f,port:g,sourceLayer:C,targetLayer:b}}),p=this.sites,m=[],A=[];for(let g of u){this.phase="assigning_sites",yield;let f=_Vr([g],{traceWidth:n,clearance:Math.max(o,s),viaDiameter:r,viaHoleDiameter:i,holeToHoleClearance:c,additionalObstacles:e.obstacles,blockingSegments:m,blockingVias:A});if(!f||f.size!==g.connections.length)throw Error("No complete local dogbone assignment within clearance/search limits");for(let y of g.connections){let x=y.connectionIndex,C=f.get(x);p.set(x,C),m.push({connectionIndex:x,segment:{start:y.sourcePoint,end:C,width:n,layer:y.sourceLayer}}),A.push({connectionIndex:x,center:C,diameter:r,spanLayers:h})}}this.phase="creating_traces";for(let[g,{sourceTraceId:f,port:y,sourceLayer:x,targetLayer:C}]of _.entries()){let b=p.get(g),I=Math.abs(b.x-y.x),v=Math.abs(b.y-y.y);if(I>0.000001&&v>0.000001&&Math.abs(I-v)>0.000001)throw Error("Dogbone fanout requires straight or 45-degree local escapes");let P=r/2+a;if(b.x<e.bounds.minX+P||b.x>e.bounds.maxX-P||b.y<e.bounds.minY+P||b.y>e.bounds.maxY-P)throw Error("Dogbone via violates board-edge clearance");this.traces.push({type:"pcb_trace",pcb_trace_id:`dogbone_${y.pcb_port_id}`,source_trace_id:f,connectsTo:[y.pcb_port_id],route:[{route_type:"wire",x:y.x,y:y.y,layer:x,width:n},{route_type:"wire",...b,layer:x,width:n},{route_type:"via",...b,from_layer:x,to_layer:C,via_diameter:r,via_hole_diameter:i,layers:h},{route_type:"wire",...b,layer:C,width:n},{route_type:"wire",...b,layer:C,width:n}]}),this.progress=(g+1)/_.length,yield}}},fVr=class{constructor(e,t={}){this.params=e,this.callbacks=t,this.solver=new w3n(e)}params;callbacks;get input(){return this.params.input}isRouting=!1;solver;timer;listeners=[];finishSolver(){this.callbacks.onSolverEnded?.({solverName:"DogboneFanoutSolver",solved:this.solver.solved,failed:this.solver.failed,iterations:this.solver.iterations,error:this.solver.error})}getTraces(){return this.solver.getOutput().map((e)=>{let t=this.params.input.connections.find((n)=>n.pointsToConnect.some((o)=>o.pcb_port_id&&e.connectsTo?.includes(o.pcb_port_id)));if(!t)throw Error("Dogbone fanout lost its source connection");return{...e,connection_name:t.name,source_trace_id:t.source_trace_id,connectsTo:[...new Set([...e.connectsTo??[],...t.routingPcbGroupId?t.pointsToConnect.flatMap((n)=>!n.pcb_port_id&&n.pointId?[n.pointId]:[]):[`${e.pcb_trace_id}_exit`]])]}})}getOutputSimpleRouteJson(){let e=this.getTraces();return{...this.params.input,traces:e,connections:this.params.input.connections.map((t)=>{let n=e.find((r)=>r.connection_name===t.name);if(!n)return t;let o=n.route.at(-1);if(o.route_type!=="wire")throw Error("Dogbone fanout lost its exit");return{...t,pointsToConnect:t.pointsToConnect.map((r)=>{let i=!r.pcb_port_id;if(!(t.routingPcbGroupId?i:Boolean(r.pcb_port_id&&n.connectsTo?.includes(r.pcb_port_id))))return r;if(t.routingPcbGroupId)return{...r,x:o.x,y:o.y,layer:o.layer};let{pcb_port_id:a,...c}=r;return{...c,pointId:`${n.pcb_trace_id}_exit`,x:o.x,y:o.y,layer:o.layer}})}})}}on(e,t){this.listeners.push({event:e,callback:t})}emit(e){for(let t of this.listeners)if(t.event===e.type)t.callback(e)}start(){if(this.isRouting)return;this.isRouting=!0,this.callbacks.onSolverStarted?.({solverName:"DogboneFanoutSolver",solverParams:this.params,solverConstructorArgs:this.solver.getConstructorParams()});let e=()=>{if(!this.isRouting)return;try{for(let t=0;t<16&&!this.solver.solved&&!this.solver.failed;t++)this.solver.step();if(this.emit({type:"progress",steps:this.solver.iterations,progress:this.solver.progress,phase:this.solver.phase,debugGraphics:this.solver.visualize()}),!this.isRouting)return;if(this.solver.failed){this.finishSolver(),this.isRouting=!1,this.emit({type:"error",error:Error(this.solver.error??"Dogbone routing failed")});return}if(this.solver.solved){this.finishSolver(),this.isRouting=!1,this.emit({type:"complete",traces:this.getTraces()});return}this.timer=setTimeout(e,0)}catch(t){this.isRouting=!1,this.emit({type:"error",error:t instanceof Error?t:Error(String(t))})}};this.timer=setTimeout(e,0)}stop(){if(this.isRouting=!1,this.timer)clearTimeout(this.timer)}solveSync(){if(this.solver.solve(),this.solver.failed)throw Error(this.solver.error??"Dogbone routing failed");return this.getTraces()}},{create:yVr,defineProperty:B3n,getOwnPropertyDescriptor:xVr,getOwnPropertyNames:T3n,getPrototypeOf:CVr}=Object,bVr=Object.prototype.hasOwnProperty,R9e=((e)=>typeof dJ<"u"?dJ:typeof Proxy<"u"?new Proxy(e,{get:(t,n)=>(typeof dJ<"u"?dJ:t)[n]}):e)(function(e){if(typeof dJ<"u")return dJ.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')}),b7e=(e,t)=>function(){return t||(0,e[T3n(e)[0]])((t={exports:{}}).exports,t),t.exports},IVr=(e,t,n,o)=>{if(t&&typeof t==="object"||typeof t==="function"){for(let r of T3n(t))if(!bVr.call(e,r)&&r!==n)B3n(e,r,{get:()=>t[r],enumerable:!(o=xVr(t,r))||o.enumerable})}return e},IZ=(e,t,n)=>(n=e!=null?yVr(CVr(e)):{},IVr(t||!e||!e.__esModule?B3n(n,"default",{value:e,enumerable:!0}):n,e)),D3n=b7e({"node_modules/svgson/dist/svgson.umd.js"(e,t){(function(n,o){typeof e==="object"&&typeof t<"u"?t.exports=o():typeof define==="function"&&define.amd?define(o):(n=typeof globalThis<"u"?globalThis:n||self,n.svgson=o())})(e,function(){var n=function(Y){return Y!=null&&(o(Y)||r(Y)||!!Y._isBuffer)};function o(Y){return!!Y.constructor&&typeof Y.constructor.isBuffer==="function"&&Y.constructor.isBuffer(Y)}function r(Y){return typeof Y.readFloatLE==="function"&&typeof Y.slice==="function"&&o(Y.slice(0,0))}var i=Object.prototype.toString,s=function(X){if(typeof X>"u")return"undefined";if(X===null)return"null";if(X===!0||X===!1||X instanceof Boolean)return"boolean";if(typeof X==="string"||X instanceof String)return"string";if(typeof X==="number"||X instanceof Number)return"number";if(typeof X==="function"||X instanceof Function)return"function";if(typeof Array.isArray<"u"&&Array.isArray(X))return"array";if(X instanceof RegExp)return"regexp";if(X instanceof Date)return"date";var K=i.call(X);if(K==="[object RegExp]")return"regexp";if(K==="[object Date]")return"date";if(K==="[object Arguments]")return"arguments";if(K==="[object Error]")return"error";if(n(X))return"buffer";if(K==="[object Set]")return"set";if(K==="[object WeakSet]")return"weakset";if(K==="[object Map]")return"map";if(K==="[object WeakMap]")return"weakmap";if(K==="[object Symbol]")return"symbol";if(K==="[object Int8Array]")return"int8array";if(K==="[object Uint8Array]")return"uint8array";if(K==="[object Uint8ClampedArray]")return"uint8clampedarray";if(K==="[object Int16Array]")return"int16array";if(K==="[object Uint16Array]")return"uint16array";if(K==="[object Int32Array]")return"int32array";if(K==="[object Uint32Array]")return"uint32array";if(K==="[object Float32Array]")return"float32array";if(K==="[object Float64Array]")return"float64array";return"object"};function a(Y,X){return X={exports:{}},Y(X,X.exports),X.exports}var c=a(function(Y){(function(){function X(K,J){if(typeof J!=="function")return K;var ee={};for(var se in K)if(Object.prototype.hasOwnProperty.call(K,se))ee[J(se,K[se])||se]=K[se];return ee}if(Y.exports)Y.exports=X;else window.rename=X})()}),l=function Y(X,K){var J=s(X);if(J!=="object"&&J!=="array")throw Error("expected an object");var ee=[];if(J==="object")X=c(X,K),ee={};for(var se in X)if(X.hasOwnProperty(se)){var ne=X[se];if(s(ne)==="object"||s(ne)==="array")ee[se]=Y(ne,K);else ee[se]=ne}return ee},h=a(function(Y){var X=Object.prototype.hasOwnProperty,K="~";function J(){}if(Object.create){if(J.prototype=Object.create(null),!new J().__proto__)K=!1}function ee(ne,re,Z){this.fn=ne,this.context=re,this.once=Z||!1}function se(){this._events=new J,this._eventsCount=0}se.prototype.eventNames=function(){var re=[],Z,te;if(this._eventsCount===0)return re;for(te in Z=this._events)if(X.call(Z,te))re.push(K?te.slice(1):te);if(Object.getOwnPropertySymbols)return re.concat(Object.getOwnPropertySymbols(Z));return re},se.prototype.listeners=function(re,Z){var te=K?K+re:re,ie=this._events[te];if(Z)return!!ie;if(!ie)return[];if(ie.fn)return[ie.fn];for(var ce=0,ue=ie.length,de=Array(ue);ce<ue;ce++)de[ce]=ie[ce].fn;return de},se.prototype.emit=function(re,Z,te,ie,ce,ue){var de=K?K+re:re;if(!this._events[de])return!1;var me=this._events[de],ge=arguments.length,xe,Ee;if(me.fn){if(me.once)this.removeListener(re,me.fn,void 0,!0);switch(ge){case 1:return me.fn.call(me.context),!0;case 2:return me.fn.call(me.context,Z),!0;case 3:return me.fn.call(me.context,Z,te),!0;case 4:return me.fn.call(me.context,Z,te,ie),!0;case 5:return me.fn.call(me.context,Z,te,ie,ce),!0;case 6:return me.fn.call(me.context,Z,te,ie,ce,ue),!0}for(Ee=1,xe=Array(ge-1);Ee<ge;Ee++)xe[Ee-1]=arguments[Ee];me.fn.apply(me.context,xe)}else{var Re=me.length,Me;for(Ee=0;Ee<Re;Ee++){if(me[Ee].once)this.removeListener(re,me[Ee].fn,void 0,!0);switch(ge){case 1:me[Ee].fn.call(me[Ee].context);break;case 2:me[Ee].fn.call(me[Ee].context,Z);break;case 3:me[Ee].fn.call(me[Ee].context,Z,te);break;case 4:me[Ee].fn.call(me[Ee].context,Z,te,ie);break;default:if(!xe)for(Me=1,xe=Array(ge-1);Me<ge;Me++)xe[Me-1]=arguments[Me];me[Ee].fn.apply(me[Ee].context,xe)}}}return!0},se.prototype.on=function(re,Z,te){var ie=new ee(Z,te||this),ce=K?K+re:re;if(!this._events[ce])this._events[ce]=ie,this._eventsCount++;else if(!this._events[ce].fn)this._events[ce].push(ie);else this._events[ce]=[this._events[ce],ie];return this},se.prototype.once=function(re,Z,te){var ie=new ee(Z,te||this,!0),ce=K?K+re:re;if(!this._events[ce])this._events[ce]=ie,this._eventsCount++;else if(!this._events[ce].fn)this._events[ce].push(ie);else this._events[ce]=[this._events[ce],ie];return this},se.prototype.removeListener=function(re,Z,te,ie){var ce=K?K+re:re;if(!this._events[ce])return this;if(!Z){if(--this._eventsCount===0)this._events=new J;else delete this._events[ce];return this}var ue=this._events[ce];if(ue.fn){if(ue.fn===Z&&(!ie||ue.once)&&(!te||ue.context===te))if(--this._eventsCount===0)this._events=new J;else delete this._events[ce]}else{for(var de=0,me=[],ge=ue.length;de<ge;de++)if(ue[de].fn!==Z||ie&&!ue[de].once||te&&ue[de].context!==te)me.push(ue[de]);if(me.length)this._events[ce]=me.length===1?me[0]:me;else if(--this._eventsCount===0)this._events=new J;else delete this._events[ce]}return this},se.prototype.removeAllListeners=function(re){var Z;if(re){if(Z=K?K+re:re,this._events[Z])if(--this._eventsCount===0)this._events=new J;else delete this._events[Z]}else this._events=new J,this._eventsCount=0;return this},se.prototype.off=se.prototype.removeListener,se.prototype.addListener=se.prototype.on,se.prototype.setMaxListeners=function(){return this},se.prefixed=K,se.EventEmitter=se,Y.exports=se});function d(Y,X,K){if(X in Y)Object.defineProperty(Y,X,{value:K,enumerable:!0,configurable:!0,writable:!0});else Y[X]=K;return Y}var u=function(){},_={data:"state-data",cdata:"state-cdata",tagBegin:"state-tag-begin",tagName:"state-tag-name",tagEnd:"state-tag-end",attributeNameStart:"state-attribute-name-start",attributeName:"state-attribute-name",attributeNameEnd:"state-attribute-name-end",attributeValueBegin:"state-attribute-value-begin",attributeValue:"state-attribute-value"},p={lt:"action-lt",gt:"action-gt",space:"action-space",equal:"action-equal",quote:"action-quote",slash:"action-slash",char:"action-char",error:"action-error"},m={text:"text",openTag:"open-tag",closeTag:"close-tag",attributeName:"attribute-name",attributeValue:"attribute-value"},A={" ":p.space,"\t":p.space,"\n":p.space,"\r":p.space,"<":p.lt,">":p.gt,'"':p.quote,"'":p.quote,"=":p.equal,"/":p.slash},g=function(X){return A[X]||p.char},f=function(X){var K,J,ee,se,ne,re,Z,te,ie,ce;X=Object.assign({debug:!1},X);var ue=new h,de=_.data,me="",ge="",xe="",Ee="",Re="",Me="",_e=function(Ne,Le){if(ge[0]==="?"||ge[0]==="!")return;var nt={type:Ne,value:Le};if(X.debug)console.log("emit:",nt);ue.emit("data",nt)};ue.stateMachine=(ce={},d(ce,_.data,(K={},d(K,p.lt,function(){if(me.trim())_e(m.text,me);ge="",Re=!1,de=_.tagBegin}),d(K,p.char,function(Se){me+=Se}),K)),d(ce,_.cdata,d({},p.char,function(Se){if(me+=Se,me.substr(-3)==="]]>")_e(m.text,me.slice(0,-3)),me="",de=_.data})),d(ce,_.tagBegin,(J={},d(J,p.space,u),d(J,p.char,function(Se){ge=Se,de=_.tagName}),d(J,p.slash,function(){ge="",Re=!0}),J)),d(ce,_.tagName,(ee={},d(ee,p.space,function(){if(Re)de=_.tagEnd;else de=_.attributeNameStart,_e(m.openTag,ge)}),d(ee,p.gt,function(){if(Re)_e(m.closeTag,ge);else _e(m.openTag,ge);me="",de=_.data}),d(ee,p.slash,function(){de=_.tagEnd,_e(m.openTag,ge)}),d(ee,p.char,function(Se){if(ge+=Se,ge==="![CDATA[")de=_.cdata,me="",ge=""}),ee)),d(ce,_.tagEnd,(se={},d(se,p.gt,function(){_e(m.closeTag,ge),me="",de=_.data}),d(se,p.char,u),se)),d(ce,_.attributeNameStart,(ne={},d(ne,p.char,function(Se){xe=Se,de=_.attributeName}),d(ne,p.gt,function(){me="",de=_.data}),d(ne,p.space,u),d(ne,p.slash,function(){Re=!0,de=_.tagEnd}),ne)),d(ce,_.attributeName,(re={},d(re,p.space,function(){de=_.attributeNameEnd}),d(re,p.equal,function(){_e(m.attributeName,xe),de=_.attributeValueBegin}),d(re,p.gt,function(){Ee="",_e(m.attributeName,xe),_e(m.attributeValue,Ee),me="",de=_.data}),d(re,p.slash,function(){Re=!0,Ee="",_e(m.attributeName,xe),_e(m.attributeValue,Ee),de=_.tagEnd}),d(re,p.char,function(Se){xe+=Se}),re)),d(ce,_.attributeNameEnd,(Z={},d(Z,p.space,u),d(Z,p.equal,function(){_e(m.attributeName,xe),de=_.attributeValueBegin}),d(Z,p.gt,function(){Ee="",_e(m.attributeName,xe),_e(m.attributeValue,Ee),me="",de=_.data}),d(Z,p.char,function(Se){Ee="",_e(m.attributeName,xe),_e(m.attributeValue,Ee),xe=Se,de=_.attributeName}),Z)),d(ce,_.attributeValueBegin,(te={},d(te,p.space,u),d(te,p.quote,function(Se){Me=Se,Ee="",de=_.attributeValue}),d(te,p.gt,function(){Ee="",_e(m.attributeValue,Ee),me="",de=_.data}),d(te,p.char,function(Se){Me="",Ee=Se,de=_.attributeValue}),te)),d(ce,_.attributeValue,(ie={},d(ie,p.space,function(Se){if(Me)Ee+=Se;else _e(m.attributeValue,Ee),de=_.attributeNameStart}),d(ie,p.quote,function(Se){if(Me===Se)_e(m.attributeValue,Ee),de=_.attributeNameStart;else Ee+=Se}),d(ie,p.gt,function(Se){if(Me)Ee+=Se;else _e(m.attributeValue,Ee),me="",de=_.data}),d(ie,p.slash,function(Se){if(Me)Ee+=Se;else _e(m.attributeValue,Ee),Re=!0,de=_.tagEnd}),d(ie,p.char,function(Se){Ee+=Se}),ie)),ce);var ye=function(Ne){if(X.debug)console.log(de,Ne);var Le=ue.stateMachine[de],nt=Le[g(Ne)]||Le[p.error]||Le[p.char];nt(Ne)};return ue.write=function(Se){var Ne=Se.length;for(var Le=0;Le<Ne;Le++)ye(Se[Le])},ue},y={State:_,Action:p,Type:m,create:f},x=y.Type,C={element:"element",text:"text"},b=function(X){return Object.assign({name:"",type:C.element,value:"",parent:null,attributes:{},children:[]},X)},I=function(X){X=Object.assign({stream:!1,parentNodes:!0,doneEvent:"done",tagPrefix:"tag:",emitTopLevelOnly:!1,debug:!1},X);var K=void 0,J=void 0,ee=void 0,se=void 0,ne=new h,re=function(te){switch(te.type){case x.openTag:if(ee===null)ee=J,ee.name=te.value;else{var ie=b({name:te.value,parent:ee});ee.children.push(ie),ee=ie}break;case x.closeTag:var ce=ee.parent;if(!X.parentNodes)ee.parent=null;if(ee.name!==te.value)break;if(X.stream&&ce===J)J.children=[],ee.parent=null;if(!X.emitTopLevelOnly||ce===J)ne.emit(X.tagPrefix+ee.name,ee),ne.emit("tag",ee.name,ee);if(ee===J)K.removeAllListeners("data"),ne.emit(X.doneEvent,ee),J=null;ee=ce;break;case x.text:if(ee)ee.children.push(b({type:C.text,value:te.value,parent:X.parentNodes?ee:null}));break;case x.attributeName:se=te.value,ee.attributes[se]="";break;case x.attributeValue:ee.attributes[se]=te.value;break}};return ne.reset=function(){K=y.create({debug:X.debug}),K.on("data",re),J=b(),ee=null,se="",ne.parse=K.write},ne.reset(),ne},v=function(X,K){K=Object.assign({},K,{stream:!1,tagPrefix:":"});var J=I(K),ee=void 0;return J.on("done",function(se){ee=se}),J.parse(X),ee},P={parseSync:v,create:I,NodeType:C},M=P.parseSync,B=function(X){var K=M("<root>".concat(X,"</root>"),{parentNodes:!1}),J=K.children&&K.children.length>0&&K.children.every(function(ee){return ee.name==="svg"});if(J)return K.children.length===1?K.children[0]:K.children;else throw Error("nothing to parse")},T=function(X){return l(X,function(K){if(!D(K))return N(K);return K})},N=function(X){return X.replace(/[-|:]([a-z])/gi,function(K,J){return J.toUpperCase()})},D=function(X){return/^(data|aria)(-\w+)/.test(X)},L=function(X){if(X){var K=String(X);return/[&<>]/.test(K)?"<![CDATA[".concat(K.replace(/]]>/,"]]]]><![CDATA[>"),"]]>"):K}return""},H=function(X){return String(X).replace(/&/g,"&amp;").replace(/'/g,"&apos;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")},V=function(X){var K=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},J=K.transformNode,ee=J===void 0?function(Z){return Z}:J,se=K.camelcase,ne=se===void 0?!1:se,re=function(te){var ie=ee(te);if(ne)ie=T(ie);return ie};return re(B(X))};function O(){for(var Y=arguments.length,X=Array(Y),K=0;K<Y;K++)X[K]=arguments[K];return new Promise(function(J,ee){try{var se=V.apply(void 0,X);J(se)}catch(ne){ee(ne)}})}var U=function Y(X){var K=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},J=K.transformAttr,ee=J===void 0?function(de,me,ge){return"".concat(de,'="').concat(ge(me),'"')}:J,se=K.transformNode,ne=se===void 0?function(de){return de}:se,re=K.selfClose,Z=re===void 0?!0:re;if(Array.isArray(X))return X.map(function(de){return Y(de,{transformAttr:ee,selfClose:Z,transformNode:ne})}).join("");var te=ne(X);if(te.type==="text")return L(te.value);var ie="";for(var ce in te.attributes){var ue=ee(ce,te.attributes[ce],H,te.name);ie+=ue?" ".concat(ue):""}return te.children&&te.children.length>0||!Z?"<".concat(te.name).concat(ie,">").concat(Y(te.children,{transformAttr:ee,transformNode:ne,selfClose:Z}),"</").concat(te.name,">"):"<".concat(te.name).concat(ie,"/>")},j=Object.assign({},{parse:O,parseSync:V,stringify:U});return j})}}),vVr=b7e({"node_modules/heap/lib/heap.js"(e,t){(function(){var n,o,r,i,s,a,c,l,h,d,u,_,p,m,A;r=Math.floor,d=Math.min,o=function(g,f){if(g<f)return-1;if(g>f)return 1;return 0},h=function(g,f,y,x,C){var b;if(y==null)y=0;if(C==null)C=o;if(y<0)throw Error("lo must be non-negative");if(x==null)x=g.length;while(y<x)if(b=r((y+x)/2),C(f,g[b])<0)x=b;else y=b+1;return[].splice.apply(g,[y,y-y].concat(f)),f},a=function(g,f,y){if(y==null)y=o;return g.push(f),m(g,0,g.length-1,y)},s=function(g,f){var y,x;if(f==null)f=o;if(y=g.pop(),g.length)x=g[0],g[0]=y,A(g,0,f);else x=y;return x},l=function(g,f,y){var x;if(y==null)y=o;return x=g[0],g[0]=f,A(g,0,y),x},c=function(g,f,y){var x;if(y==null)y=o;if(g.length&&y(g[0],f)<0)x=[g[0],f],f=x[0],g[0]=x[1],A(g,0,y);return f},i=function(g,f){var y,x,C,b,I,v,P,M;if(f==null)f=o;v=function(){M=[];for(var B=0,T=r(g.length/2);0<=T?B<T:B>T;0<=T?B++:B--)M.push(B);return M}.apply(this).reverse(),P=[];for(x=0,b=v.length;x<b;x++)y=v[x],P.push(A(g,y,f));return P},p=function(g,f,y){var x;if(y==null)y=o;if(x=g.indexOf(f),x===-1)return;return m(g,0,x,y),A(g,x,y)},u=function(g,f,y){var x,C,b,I,v;if(y==null)y=o;if(C=g.slice(0,f),!C.length)return C;i(C,y),v=g.slice(f);for(b=0,I=v.length;b<I;b++)x=v[b],c(C,x,y);return C.sort(y).reverse()},_=function(g,f,y){var x,C,b,I,v,P,M,B,T,N;if(y==null)y=o;if(f*10<=g.length){if(I=g.slice(0,f).sort(y),!I.length)return I;b=I[I.length-1],B=g.slice(f);for(v=0,M=B.length;v<M;v++)if(x=B[v],y(x,b)<0)h(I,x,0,null,y),I.pop(),b=I[I.length-1];return I}i(g,y),N=[];for(C=P=0,T=d(f,g.length);0<=T?P<T:P>T;C=0<=T?++P:--P)N.push(s(g,y));return N},m=function(g,f,y,x){var C,b,I;if(x==null)x=o;C=g[y];while(y>f){if(I=y-1>>1,b=g[I],x(C,b)<0){g[y]=b,y=I;continue}break}return g[y]=C},A=function(g,f,y){var x,C,b,I,v;if(y==null)y=o;C=g.length,v=f,b=g[f],x=2*f+1;while(x<C){if(I=x+1,I<C&&!(y(g[x],g[I])<0))x=I;g[f]=g[x],f=x,x=2*f+1}return g[f]=b,m(g,v,f,y)},n=function(){g.push=a,g.pop=s,g.replace=l,g.pushpop=c,g.heapify=i,g.updateItem=p,g.nlargest=u,g.nsmallest=_;function g(f){this.cmp=f!=null?f:o,this.nodes=[]}return g.prototype.push=function(f){return a(this.nodes,f,this.cmp)},g.prototype.pop=function(){return s(this.nodes,this.cmp)},g.prototype.peek=function(){return this.nodes[0]},g.prototype.contains=function(f){return this.nodes.indexOf(f)!==-1},g.prototype.replace=function(f){return l(this.nodes,f,this.cmp)},g.prototype.pushpop=function(f){return c(this.nodes,f,this.cmp)},g.prototype.heapify=function(){return i(this.nodes,this.cmp)},g.prototype.updateItem=function(f){return p(this.nodes,f,this.cmp)},g.prototype.clear=function(){return this.nodes=[]},g.prototype.empty=function(){return this.nodes.length===0},g.prototype.size=function(){return this.nodes.length},g.prototype.clone=function(){var f=new g;return f.nodes=this.nodes.slice(0),f},g.prototype.toArray=function(){return this.nodes.slice(0)},g.prototype.insert=g.prototype.push,g.prototype.top=g.prototype.peek,g.prototype.front=g.prototype.peek,g.prototype.has=g.prototype.contains,g.prototype.copy=g.prototype.clone,g}(),function(g,f){if(typeof define==="function"&&define.amd)return define([],f);else if(typeof e==="object")return t.exports=f();else return g.Heap=f()}(this,function(){return n})}).call(e)}}),SVr=b7e({"node_modules/heap/index.js"(e,t){t.exports=vVr()}}),tst=b7e({"node_modules/object-hash/dist/object_hash.js"(e,t){(function(n){var o;typeof e=="object"?t.exports=n():typeof define=="function"&&define.amd?define(n):(typeof window<"u"?o=window:typeof global<"u"?o=global:typeof self<"u"&&(o=self),o.objectHash=n())})(function(){return function n(o,r,i){function s(l,h){if(!r[l]){if(!o[l]){var d=typeof R9e=="function"&&R9e;if(!h&&d)return d(l,!0);if(a)return a(l,!0);throw Error("Cannot find module '"+l+"'")}h=r[l]={exports:{}},o[l][0].call(h.exports,function(u){var _=o[l][1][u];return s(_||u)},h,h.exports,n,o,r,i)}return r[l].exports}for(var a=typeof R9e=="function"&&R9e,c=0;c<i.length;c++)s(i[c]);return s}({1:[function(n,o,r){(function(i,s,a,c,l,h,d,u,_){var p=n("crypto");function m(b,I){I=f(b,I);var v;return(v=I.algorithm!=="passthrough"?p.createHash(I.algorithm):new C).write===void 0&&(v.write=v.update,v.end=v.update),x(I,v).dispatch(b),v.update||v.end(""),v.digest?v.digest(I.encoding==="buffer"?void 0:I.encoding):(b=v.read(),I.encoding!=="buffer"?b.toString(I.encoding):b)}(r=o.exports=m).sha1=function(b){return m(b)},r.keys=function(b){return m(b,{excludeValues:!0,algorithm:"sha1",encoding:"hex"})},r.MD5=function(b){return m(b,{algorithm:"md5",encoding:"hex"})},r.keysMD5=function(b){return m(b,{algorithm:"md5",encoding:"hex",excludeValues:!0})};var A=p.getHashes?p.getHashes().slice():["sha1","md5"],g=(A.push("passthrough"),["buffer","hex","binary","base64"]);function f(b,I){var v={};if(v.algorithm=(I=I||{}).algorithm||"sha1",v.encoding=I.encoding||"hex",v.excludeValues=!!I.excludeValues,v.algorithm=v.algorithm.toLowerCase(),v.encoding=v.encoding.toLowerCase(),v.ignoreUnknown=I.ignoreUnknown===!0,v.respectType=I.respectType!==!1,v.respectFunctionNames=I.respectFunctionNames!==!1,v.respectFunctionProperties=I.respectFunctionProperties!==!1,v.unorderedArrays=I.unorderedArrays===!0,v.unorderedSets=I.unorderedSets!==!1,v.unorderedObjects=I.unorderedObjects!==!1,v.replacer=I.replacer||void 0,v.excludeKeys=I.excludeKeys||void 0,b===void 0)throw Error("Object argument required.");for(var P=0;P<A.length;++P)A[P].toLowerCase()===v.algorithm.toLowerCase()&&(v.algorithm=A[P]);if(A.indexOf(v.algorithm)===-1)throw Error('Algorithm "'+v.algorithm+'"  not supported. supported values: '+A.join(", "));if(g.indexOf(v.encoding)===-1&&v.algorithm!=="passthrough")throw Error('Encoding "'+v.encoding+'"  not supported. supported values: '+g.join(", "));return v}function y(b){if(typeof b=="function")return/^function\s+\w*\s*\(\s*\)\s*{\s+\[native code\]\s+}$/i.exec(Function.prototype.toString.call(b))!=null}function x(b,I,v){v=v||[];function P(M){return I.update?I.update(M,"utf8"):I.write(M,"utf8")}return{dispatch:function(M){return this["_"+((M=b.replacer?b.replacer(M):M)===null?"null":typeof M)](M)},_object:function(M){var B,T=Object.prototype.toString.call(M),N=/\[object (.*)\]/i.exec(T);if(N=(N=N?N[1]:"unknown:["+T+"]").toLowerCase(),0<=(T=v.indexOf(M)))return this.dispatch("[CIRCULAR:"+T+"]");if(v.push(M),a!==void 0&&a.isBuffer&&a.isBuffer(M))return P("buffer:"),P(M);if(N==="object"||N==="function"||N==="asyncfunction")return T=Object.keys(M),b.unorderedObjects&&(T=T.sort()),b.respectType===!1||y(M)||T.splice(0,0,"prototype","__proto__","constructor"),b.excludeKeys&&(T=T.filter(function(D){return!b.excludeKeys(D)})),P("object:"+T.length+":"),B=this,T.forEach(function(D){B.dispatch(D),P(":"),b.excludeValues||B.dispatch(M[D]),P(",")});if(!this["_"+N]){if(b.ignoreUnknown)return P("["+N+"]");throw Error('Unknown object type "'+N+'"')}this["_"+N](M)},_array:function(M,D){D=D!==void 0?D:b.unorderedArrays!==!1;var T=this;if(P("array:"+M.length+":"),!D||M.length<=1)return M.forEach(function(L){return T.dispatch(L)});var N=[],D=M.map(function(L){var H=new C,V=v.slice();return x(b,H,V).dispatch(L),N=N.concat(V.slice(v.length)),H.read().toString()});return v=v.concat(N),D.sort(),this._array(D,!1)},_date:function(M){return P("date:"+M.toJSON())},_symbol:function(M){return P("symbol:"+M.toString())},_error:function(M){return P("error:"+M.toString())},_boolean:function(M){return P("bool:"+M.toString())},_string:function(M){P("string:"+M.length+":"),P(M.toString())},_function:function(M){P("fn:"),y(M)?this.dispatch("[native]"):this.dispatch(M.toString()),b.respectFunctionNames!==!1&&this.dispatch("function-name:"+String(M.name)),b.respectFunctionProperties&&this._object(M)},_number:function(M){return P("number:"+M.toString())},_xml:function(M){return P("xml:"+M.toString())},_null:function(){return P("Null")},_undefined:function(){return P("Undefined")},_regexp:function(M){return P("regex:"+M.toString())},_uint8array:function(M){return P("uint8array:"),this.dispatch(Array.prototype.slice.call(M))},_uint8clampedarray:function(M){return P("uint8clampedarray:"),this.dispatch(Array.prototype.slice.call(M))},_int8array:function(M){return P("int8array:"),this.dispatch(Array.prototype.slice.call(M))},_uint16array:function(M){return P("uint16array:"),this.dispatch(Array.prototype.slice.call(M))},_int16array:function(M){return P("int16array:"),this.dispatch(Array.prototype.slice.call(M))},_uint32array:function(M){return P("uint32array:"),this.dispatch(Array.prototype.slice.call(M))},_int32array:function(M){return P("int32array:"),this.dispatch(Array.prototype.slice.call(M))},_float32array:function(M){return P("float32array:"),this.dispatch(Array.prototype.slice.call(M))},_float64array:function(M){return P("float64array:"),this.dispatch(Array.prototype.slice.call(M))},_arraybuffer:function(M){return P("arraybuffer:"),this.dispatch(new Uint8Array(M))},_url:function(M){return P("url:"+M.toString())},_map:function(M){return P("map:"),M=Array.from(M),this._array(M,b.unorderedSets!==!1)},_set:function(M){return P("set:"),M=Array.from(M),this._array(M,b.unorderedSets!==!1)},_file:function(M){return P("file:"),this.dispatch([M.name,M.size,M.type,M.lastModfied])},_blob:function(){if(b.ignoreUnknown)return P("[blob]");throw Error(`Hashing Blob objects is currently not supported
(see https://github.com/puleos/object-hash/issues/26)
Use "options.replacer" or "options.ignoreUnknown"
`)},_domwindow:function(){return P("domwindow")},_bigint:function(M){return P("bigint:"+M.toString())},_process:function(){return P("process")},_timer:function(){return P("timer")},_pipe:function(){return P("pipe")},_tcp:function(){return P("tcp")},_udp:function(){return P("udp")},_tty:function(){return P("tty")},_statwatcher:function(){return P("statwatcher")},_securecontext:function(){return P("securecontext")},_connection:function(){return P("connection")},_zlib:function(){return P("zlib")},_context:function(){return P("context")},_nodescript:function(){return P("nodescript")},_httpparser:function(){return P("httpparser")},_dataview:function(){return P("dataview")},_signal:function(){return P("signal")},_fsevent:function(){return P("fsevent")},_tlswrap:function(){return P("tlswrap")}}}function C(){return{buf:"",write:function(b){this.buf+=b},end:function(b){this.buf+=b},read:function(){return this.buf}}}r.writeToStream=function(b,I,v){return v===void 0&&(v=I,I={}),x(I=f(b,I),v).dispatch(b)}}).call(this,n("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},n("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/fake_9a5aa49d.js","/")},{buffer:3,crypto:5,lYpoI2:11}],2:[function(n,o,r){(function(i,s,a,c,l,h,d,u,_){(function(p){var m=typeof Uint8Array<"u"?Uint8Array:Array,A=43,g=47,f=48,y=97,x=65,C=45,b=95;function I(v){return v=v.charCodeAt(0),v===A||v===C?62:v===g||v===b?63:v<f?-1:v<f+10?v-f+26+26:v<x+26?v-x:v<y+26?v-y+26:void 0}p.toByteArray=function(v){var P,M;if(0<v.length%4)throw Error("Invalid string. Length must be a multiple of 4");var B=v.length,B=v.charAt(B-2)==="="?2:v.charAt(B-1)==="="?1:0,T=new m(3*v.length/4-B),N=0<B?v.length-4:v.length,D=0;function L(H){T[D++]=H}for(P=0;P<N;P+=4,0)L((16711680&(M=I(v.charAt(P))<<18|I(v.charAt(P+1))<<12|I(v.charAt(P+2))<<6|I(v.charAt(P+3))))>>16),L((65280&M)>>8),L(255&M);return B==2?L(255&(M=I(v.charAt(P))<<2|I(v.charAt(P+1))>>4)):B==1&&(L((M=I(v.charAt(P))<<10|I(v.charAt(P+1))<<4|I(v.charAt(P+2))>>2)>>8&255),L(255&M)),T},p.fromByteArray=function(v){var P,M,B,T,N=v.length%3,D="";function L(H){return"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(H)}for(P=0,B=v.length-N;P<B;P+=3)M=(v[P]<<16)+(v[P+1]<<8)+v[P+2],D+=L((T=M)>>18&63)+L(T>>12&63)+L(T>>6&63)+L(63&T);switch(N){case 1:D=(D+=L((M=v[v.length-1])>>2))+L(M<<4&63)+"==";break;case 2:D=(D=(D+=L((M=(v[v.length-2]<<8)+v[v.length-1])>>10))+L(M>>4&63))+L(M<<2&63)+"="}return D}})(r===void 0?this.base64js={}:r)}).call(this,n("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},n("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/base64-js/lib/b64.js","/node_modules/gulp-browserify/node_modules/base64-js/lib")},{buffer:3,lYpoI2:11}],3:[function(n,o,r){(function(i,s,A,c,l,h,d,u,_){var p=n("base64-js"),m=n("ieee754");function A(Z,te,ie){if(!(this instanceof A))return new A(Z,te,ie);var ce,ue,de,me,ge=typeof Z;if(te==="base64"&&ge=="string")for(Z=(me=Z).trim?me.trim():me.replace(/^\s+|\s+$/g,"");Z.length%4!=0;)Z+="=";if(ge=="number")ce=O(Z);else if(ge=="string")ce=A.byteLength(Z,te);else{if(ge!="object")throw Error("First argument needs to be a number, array or string.");ce=O(Z.length)}if(A._useTypedArrays?ue=A._augment(new Uint8Array(ce)):((ue=this).length=ce,ue._isBuffer=!0),A._useTypedArrays&&typeof Z.byteLength=="number")ue._set(Z);else if(U(me=Z)||A.isBuffer(me)||me&&typeof me=="object"&&typeof me.length=="number")for(de=0;de<ce;de++)A.isBuffer(Z)?ue[de]=Z.readUInt8(de):ue[de]=Z[de];else if(ge=="string")ue.write(Z,0,te);else if(ge=="number"&&!A._useTypedArrays&&!ie)for(de=0;de<ce;de++)ue[de]=0;return ue}function g(Z,te,ie,ce){return A._charsWritten=K(function(ue){for(var de=[],me=0;me<ue.length;me++)de.push(255&ue.charCodeAt(me));return de}(te),Z,ie,ce)}function f(Z,te,ie,ce){return A._charsWritten=K(function(ue){for(var de,me,ge=[],xe=0;xe<ue.length;xe++)me=ue.charCodeAt(xe),de=me>>8,me=me%256,ge.push(me),ge.push(de);return ge}(te),Z,ie,ce)}function y(Z,te,ie){var ce="";ie=Math.min(Z.length,ie);for(var ue=te;ue<ie;ue++)ce+=String.fromCharCode(Z[ue]);return ce}function x(Z,te,ie,de){de||(re(typeof ie=="boolean","missing or invalid endian"),re(te!=null,"missing offset"),re(te+1<Z.length,"Trying to read beyond buffer length"));var ue,de=Z.length;if(!(de<=te))return ie?(ue=Z[te],te+1<de&&(ue|=Z[te+1]<<8)):(ue=Z[te]<<8,te+1<de&&(ue|=Z[te+1])),ue}function C(Z,te,ie,de){de||(re(typeof ie=="boolean","missing or invalid endian"),re(te!=null,"missing offset"),re(te+3<Z.length,"Trying to read beyond buffer length"));var ue,de=Z.length;if(!(de<=te))return ie?(te+2<de&&(ue=Z[te+2]<<16),te+1<de&&(ue|=Z[te+1]<<8),ue|=Z[te],te+3<de&&(ue+=Z[te+3]<<24>>>0)):(te+1<de&&(ue=Z[te+1]<<16),te+2<de&&(ue|=Z[te+2]<<8),te+3<de&&(ue|=Z[te+3]),ue+=Z[te]<<24>>>0),ue}function b(Z,te,ie,ce){if(ce||(re(typeof ie=="boolean","missing or invalid endian"),re(te!=null,"missing offset"),re(te+1<Z.length,"Trying to read beyond buffer length")),!(Z.length<=te))return ce=x(Z,te,ie,!0),32768&ce?-1*(65535-ce+1):ce}function I(Z,te,ie,ce){if(ce||(re(typeof ie=="boolean","missing or invalid endian"),re(te!=null,"missing offset"),re(te+3<Z.length,"Trying to read beyond buffer length")),!(Z.length<=te))return ce=C(Z,te,ie,!0),2147483648&ce?-1*(4294967295-ce+1):ce}function v(Z,te,ie,ce){return ce||(re(typeof ie=="boolean","missing or invalid endian"),re(te+3<Z.length,"Trying to read beyond buffer length")),m.read(Z,te,ie,23,4)}function P(Z,te,ie,ce){return ce||(re(typeof ie=="boolean","missing or invalid endian"),re(te+7<Z.length,"Trying to read beyond buffer length")),m.read(Z,te,ie,52,8)}function M(Z,te,ie,ce,ue){if(ue||(re(te!=null,"missing value"),re(typeof ce=="boolean","missing or invalid endian"),re(ie!=null,"missing offset"),re(ie+1<Z.length,"trying to write beyond buffer length"),ee(te,65535)),ue=Z.length,!(ue<=ie))for(var de=0,me=Math.min(ue-ie,2);de<me;de++)Z[ie+de]=(te&255<<8*(ce?de:1-de))>>>8*(ce?de:1-de)}function B(Z,te,ie,ce,ue){if(ue||(re(te!=null,"missing value"),re(typeof ce=="boolean","missing or invalid endian"),re(ie!=null,"missing offset"),re(ie+3<Z.length,"trying to write beyond buffer length"),ee(te,4294967295)),ue=Z.length,!(ue<=ie))for(var de=0,me=Math.min(ue-ie,4);de<me;de++)Z[ie+de]=te>>>8*(ce?de:3-de)&255}function T(Z,te,ie,ce,ue){ue||(re(te!=null,"missing value"),re(typeof ce=="boolean","missing or invalid endian"),re(ie!=null,"missing offset"),re(ie+1<Z.length,"Trying to write beyond buffer length"),se(te,32767,-32768)),Z.length<=ie||M(Z,0<=te?te:65535+te+1,ie,ce,ue)}function N(Z,te,ie,ce,ue){ue||(re(te!=null,"missing value"),re(typeof ce=="boolean","missing or invalid endian"),re(ie!=null,"missing offset"),re(ie+3<Z.length,"Trying to write beyond buffer length"),se(te,2147483647,-2147483648)),Z.length<=ie||B(Z,0<=te?te:4294967295+te+1,ie,ce,ue)}function D(Z,te,ie,ce,ue){ue||(re(te!=null,"missing value"),re(typeof ce=="boolean","missing or invalid endian"),re(ie!=null,"missing offset"),re(ie+3<Z.length,"Trying to write beyond buffer length"),ne(te,340282346638528860000000000000000000000,-340282346638528860000000000000000000000)),Z.length<=ie||m.write(Z,te,ie,ce,23,4)}function L(Z,te,ie,ce,ue){ue||(re(te!=null,"missing value"),re(typeof ce=="boolean","missing or invalid endian"),re(ie!=null,"missing offset"),re(ie+7<Z.length,"Trying to write beyond buffer length"),ne(te,179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000,-179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)),Z.length<=ie||m.write(Z,te,ie,ce,52,8)}r.Buffer=A,r.SlowBuffer=A,r.INSPECT_MAX_BYTES=50,A.poolSize=8192,A._useTypedArrays=function(){try{var Z=new ArrayBuffer(0),te=new Uint8Array(Z);return te.foo=function(){return 42},te.foo()===42&&typeof te.subarray=="function"}catch(ie){return!1}}(),A.isEncoding=function(Z){switch(String(Z).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"raw":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},A.isBuffer=function(Z){return!(Z==null||!Z._isBuffer)},A.byteLength=function(Z,te){var ie;switch(Z+="",te||"utf8"){case"hex":ie=Z.length/2;break;case"utf8":case"utf-8":ie=Y(Z).length;break;case"ascii":case"binary":case"raw":ie=Z.length;break;case"base64":ie=X(Z).length;break;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":ie=2*Z.length;break;default:throw Error("Unknown encoding")}return ie},A.concat=function(Z,te){if(re(U(Z),`Usage: Buffer.concat(list, [totalLength])
list should be an Array.`),Z.length===0)return new A(0);if(Z.length===1)return Z[0];if(typeof te!="number")for(ue=te=0;ue<Z.length;ue++)te+=Z[ue].length;for(var ie=new A(te),ce=0,ue=0;ue<Z.length;ue++){var de=Z[ue];de.copy(ie,ce),ce+=de.length}return ie},A.prototype.write=function(Z,te,ie,ce){isFinite(te)?isFinite(ie)||(ce=ie,ie=void 0):(xe=ce,ce=te,te=ie,ie=xe),te=Number(te)||0;var ue,de,me,ge,xe=this.length-te;switch((!ie||xe<(ie=Number(ie)))&&(ie=xe),ce=String(ce||"utf8").toLowerCase()){case"hex":ue=function(Ee,Re,Me,_e){Me=Number(Me)||0;var ye=Ee.length-Me;(!_e||ye<(_e=Number(_e)))&&(_e=ye),re((ye=Re.length)%2==0,"Invalid hex string"),ye/2<_e&&(_e=ye/2);for(var Se=0;Se<_e;Se++){var Ne=parseInt(Re.substr(2*Se,2),16);re(!isNaN(Ne),"Invalid hex string"),Ee[Me+Se]=Ne}return A._charsWritten=2*Se,Se}(this,Z,te,ie);break;case"utf8":case"utf-8":de=this,me=te,ge=ie,ue=A._charsWritten=K(Y(Z),de,me,ge);break;case"ascii":case"binary":ue=g(this,Z,te,ie);break;case"base64":de=this,me=te,ge=ie,ue=A._charsWritten=K(X(Z),de,me,ge);break;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":ue=f(this,Z,te,ie);break;default:throw Error("Unknown encoding")}return ue},A.prototype.toString=function(Z,te,ie){var ce,ue,de,me,ge=this;if(Z=String(Z||"utf8").toLowerCase(),te=Number(te)||0,(ie=ie!==void 0?Number(ie):ge.length)===te)return"";switch(Z){case"hex":ce=function(xe,Ee,Re){var Me=xe.length;(!Ee||Ee<0)&&(Ee=0),(!Re||Re<0||Me<Re)&&(Re=Me);for(var _e="",ye=Ee;ye<Re;ye++)_e+=j(xe[ye]);return _e}(ge,te,ie);break;case"utf8":case"utf-8":ce=function(xe,Ee,Re){var Me="",_e="";Re=Math.min(xe.length,Re);for(var ye=Ee;ye<Re;ye++)xe[ye]<=127?(Me+=J(_e)+String.fromCharCode(xe[ye]),_e=""):_e+="%"+xe[ye].toString(16);return Me+J(_e)}(ge,te,ie);break;case"ascii":case"binary":ce=y(ge,te,ie);break;case"base64":ue=ge,me=ie,ce=(de=te)===0&&me===ue.length?p.fromByteArray(ue):p.fromByteArray(ue.slice(de,me));break;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":ce=function(xe,Ee,Re){for(var Me=xe.slice(Ee,Re),_e="",ye=0;ye<Me.length;ye+=2)_e+=String.fromCharCode(Me[ye]+256*Me[ye+1]);return _e}(ge,te,ie);break;default:throw Error("Unknown encoding")}return ce},A.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},A.prototype.copy=function(Z,te,ie,ce){if(te=te||0,(ce=ce||ce===0?ce:this.length)!==(ie=ie||0)&&Z.length!==0&&this.length!==0){re(ie<=ce,"sourceEnd < sourceStart"),re(0<=te&&te<Z.length,"targetStart out of bounds"),re(0<=ie&&ie<this.length,"sourceStart out of bounds"),re(0<=ce&&ce<=this.length,"sourceEnd out of bounds"),ce>this.length&&(ce=this.length);var ue=(ce=Z.length-te<ce-ie?Z.length-te+ie:ce)-ie;if(ue<100||!A._useTypedArrays)for(var de=0;de<ue;de++)Z[de+te]=this[de+ie];else Z._set(this.subarray(ie,ie+ue),te)}},A.prototype.slice=function(Z,te){var ie=this.length;if(Z=V(Z,ie,0),te=V(te,ie,ie),A._useTypedArrays)return A._augment(this.subarray(Z,te));for(var ce=te-Z,ue=new A(ce,void 0,!0),de=0;de<ce;de++)ue[de]=this[de+Z];return ue},A.prototype.get=function(Z){return console.log(".get() is deprecated. Access using array indexes instead."),this.readUInt8(Z)},A.prototype.set=function(Z,te){return console.log(".set() is deprecated. Access using array indexes instead."),this.writeUInt8(Z,te)},A.prototype.readUInt8=function(Z,te){if(te||(re(Z!=null,"missing offset"),re(Z<this.length,"Trying to read beyond buffer length")),!(Z>=this.length))return this[Z]},A.prototype.readUInt16LE=function(Z,te){return x(this,Z,!0,te)},A.prototype.readUInt16BE=function(Z,te){return x(this,Z,!1,te)},A.prototype.readUInt32LE=function(Z,te){return C(this,Z,!0,te)},A.prototype.readUInt32BE=function(Z,te){return C(this,Z,!1,te)},A.prototype.readInt8=function(Z,te){if(te||(re(Z!=null,"missing offset"),re(Z<this.length,"Trying to read beyond buffer length")),!(Z>=this.length))return 128&this[Z]?-1*(255-this[Z]+1):this[Z]},A.prototype.readInt16LE=function(Z,te){return b(this,Z,!0,te)},A.prototype.readInt16BE=function(Z,te){return b(this,Z,!1,te)},A.prototype.readInt32LE=function(Z,te){return I(this,Z,!0,te)},A.prototype.readInt32BE=function(Z,te){return I(this,Z,!1,te)},A.prototype.readFloatLE=function(Z,te){return v(this,Z,!0,te)},A.prototype.readFloatBE=function(Z,te){return v(this,Z,!1,te)},A.prototype.readDoubleLE=function(Z,te){return P(this,Z,!0,te)},A.prototype.readDoubleBE=function(Z,te){return P(this,Z,!1,te)},A.prototype.writeUInt8=function(Z,te,ie){ie||(re(Z!=null,"missing value"),re(te!=null,"missing offset"),re(te<this.length,"trying to write beyond buffer length"),ee(Z,255)),te>=this.length||(this[te]=Z)},A.prototype.writeUInt16LE=function(Z,te,ie){M(this,Z,te,!0,ie)},A.prototype.writeUInt16BE=function(Z,te,ie){M(this,Z,te,!1,ie)},A.prototype.writeUInt32LE=function(Z,te,ie){B(this,Z,te,!0,ie)},A.prototype.writeUInt32BE=function(Z,te,ie){B(this,Z,te,!1,ie)},A.prototype.writeInt8=function(Z,te,ie){ie||(re(Z!=null,"missing value"),re(te!=null,"missing offset"),re(te<this.length,"Trying to write beyond buffer length"),se(Z,127,-128)),te>=this.length||(0<=Z?this.writeUInt8(Z,te,ie):this.writeUInt8(255+Z+1,te,ie))},A.prototype.writeInt16LE=function(Z,te,ie){T(this,Z,te,!0,ie)},A.prototype.writeInt16BE=function(Z,te,ie){T(this,Z,te,!1,ie)},A.prototype.writeInt32LE=function(Z,te,ie){N(this,Z,te,!0,ie)},A.prototype.writeInt32BE=function(Z,te,ie){N(this,Z,te,!1,ie)},A.prototype.writeFloatLE=function(Z,te,ie){D(this,Z,te,!0,ie)},A.prototype.writeFloatBE=function(Z,te,ie){D(this,Z,te,!1,ie)},A.prototype.writeDoubleLE=function(Z,te,ie){L(this,Z,te,!0,ie)},A.prototype.writeDoubleBE=function(Z,te,ie){L(this,Z,te,!1,ie)},A.prototype.fill=function(Z,te,ie){if(te=te||0,ie=ie||this.length,re(typeof(Z=typeof(Z=Z||0)=="string"?Z.charCodeAt(0):Z)=="number"&&!isNaN(Z),"value is not a number"),re(te<=ie,"end < start"),ie!==te&&this.length!==0){re(0<=te&&te<this.length,"start out of bounds"),re(0<=ie&&ie<=this.length,"end out of bounds");for(var ce=te;ce<ie;ce++)this[ce]=Z}},A.prototype.inspect=function(){for(var Z=[],te=this.length,ie=0;ie<te;ie++)if(Z[ie]=j(this[ie]),ie===r.INSPECT_MAX_BYTES){Z[ie+1]="...";break}return"<Buffer "+Z.join(" ")+">"},A.prototype.toArrayBuffer=function(){if(typeof Uint8Array>"u")throw Error("Buffer.toArrayBuffer not supported in this browser");if(A._useTypedArrays)return new A(this).buffer;for(var Z=new Uint8Array(this.length),te=0,ie=Z.length;te<ie;te+=1)Z[te]=this[te];return Z.buffer};var H=A.prototype;function V(Z,te,ie){return typeof Z!="number"?ie:te<=(Z=~~Z)?te:0<=Z||0<=(Z+=te)?Z:0}function O(Z){return(Z=~~Math.ceil(+Z))<0?0:Z}function U(Z){return(Array.isArray||function(te){return Object.prototype.toString.call(te)==="[object Array]"})(Z)}function j(Z){return Z<16?"0"+Z.toString(16):Z.toString(16)}function Y(Z){for(var te=[],ie=0;ie<Z.length;ie++){var ce=Z.charCodeAt(ie);if(ce<=127)te.push(Z.charCodeAt(ie));else for(var ue=ie,de=(55296<=ce&&ce<=57343&&ie++,encodeURIComponent(Z.slice(ue,ie+1)).substr(1).split("%")),me=0;me<de.length;me++)te.push(parseInt(de[me],16))}return te}function X(Z){return p.toByteArray(Z)}function K(Z,te,ie,ce){for(var ue=0;ue<ce&&!(ue+ie>=te.length||ue>=Z.length);ue++)te[ue+ie]=Z[ue];return ue}function J(Z){try{return decodeURIComponent(Z)}catch(te){return String.fromCharCode(65533)}}function ee(Z,te){re(typeof Z=="number","cannot write a non-number as a number"),re(0<=Z,"specified a negative value for writing an unsigned value"),re(Z<=te,"value is larger than maximum value for type"),re(Math.floor(Z)===Z,"value has a fractional component")}function se(Z,te,ie){re(typeof Z=="number","cannot write a non-number as a number"),re(Z<=te,"value larger than maximum allowed value"),re(ie<=Z,"value smaller than minimum allowed value"),re(Math.floor(Z)===Z,"value has a fractional component")}function ne(Z,te,ie){re(typeof Z=="number","cannot write a non-number as a number"),re(Z<=te,"value larger than maximum allowed value"),re(ie<=Z,"value smaller than minimum allowed value")}function re(Z,te){if(!Z)throw Error(te||"Failed assertion")}A._augment=function(Z){return Z._isBuffer=!0,Z._get=Z.get,Z._set=Z.set,Z.get=H.get,Z.set=H.set,Z.write=H.write,Z.toString=H.toString,Z.toLocaleString=H.toString,Z.toJSON=H.toJSON,Z.copy=H.copy,Z.slice=H.slice,Z.readUInt8=H.readUInt8,Z.readUInt16LE=H.readUInt16LE,Z.readUInt16BE=H.readUInt16BE,Z.readUInt32LE=H.readUInt32LE,Z.readUInt32BE=H.readUInt32BE,Z.readInt8=H.readInt8,Z.readInt16LE=H.readInt16LE,Z.readInt16BE=H.readInt16BE,Z.readInt32LE=H.readInt32LE,Z.readInt32BE=H.readInt32BE,Z.readFloatLE=H.readFloatLE,Z.readFloatBE=H.readFloatBE,Z.readDoubleLE=H.readDoubleLE,Z.readDoubleBE=H.readDoubleBE,Z.writeUInt8=H.writeUInt8,Z.writeUInt16LE=H.writeUInt16LE,Z.writeUInt16BE=H.writeUInt16BE,Z.writeUInt32LE=H.writeUInt32LE,Z.writeUInt32BE=H.writeUInt32BE,Z.writeInt8=H.writeInt8,Z.writeInt16LE=H.writeInt16LE,Z.writeInt16BE=H.writeInt16BE,Z.writeInt32LE=H.writeInt32LE,Z.writeInt32BE=H.writeInt32BE,Z.writeFloatLE=H.writeFloatLE,Z.writeFloatBE=H.writeFloatBE,Z.writeDoubleLE=H.writeDoubleLE,Z.writeDoubleBE=H.writeDoubleBE,Z.fill=H.fill,Z.inspect=H.inspect,Z.toArrayBuffer=H.toArrayBuffer,Z}}).call(this,n("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},n("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/buffer/index.js","/node_modules/gulp-browserify/node_modules/buffer")},{"base64-js":2,buffer:3,ieee754:10,lYpoI2:11}],4:[function(n,o,r){(function(i,s,p,c,l,h,d,u,_){var p=n("buffer").Buffer,m=4,A=new p(m);A.fill(0),o.exports={hash:function(g,f,y,x){for(var C=f(function(M,B){M.length%m!=0&&(T=M.length+(m-M.length%m),M=p.concat([M,A],T));for(var T,N=[],D=B?M.readInt32BE:M.readInt32LE,L=0;L<M.length;L+=m)N.push(D.call(M,L));return N}(g=p.isBuffer(g)?g:new p(g),x),8*g.length),f=x,b=new p(y),I=f?b.writeInt32BE:b.writeInt32LE,v=0;v<C.length;v++)I.call(b,C[v],4*v,!0);return b}}}).call(this,n("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},n("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/helpers.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{buffer:3,lYpoI2:11}],5:[function(n,o,r){(function(i,s,p,c,l,h,d,u,_){var p=n("buffer").Buffer,m=n("./sha"),A=n("./sha256"),g=n("./rng"),f={sha1:m,sha256:A,md5:n("./md5")},y=64,x=new p(y);function C(M,B){var T=f[M=M||"sha1"],N=[];return T||b("algorithm:",M,"is not yet supported"),{update:function(D){return p.isBuffer(D)||(D=new p(D)),N.push(D),D.length,this},digest:function(D){var L=p.concat(N),L=B?function(H,V,O){p.isBuffer(V)||(V=new p(V)),p.isBuffer(O)||(O=new p(O)),V.length>y?V=H(V):V.length<y&&(V=p.concat([V,x],y));for(var U=new p(y),j=new p(y),Y=0;Y<y;Y++)U[Y]=54^V[Y],j[Y]=92^V[Y];return O=H(p.concat([U,O])),H(p.concat([j,O]))}(T,B,L):T(L);return N=null,D?L.toString(D):L}}}function b(){var M=[].slice.call(arguments).join(" ");throw Error([M,"we accept pull requests","http://github.com/dominictarr/crypto-browserify"].join(`
`))}x.fill(0),r.createHash=function(M){return C(M)},r.createHmac=C,r.randomBytes=function(M,B){if(!B||!B.call)return new p(g(M));try{B.call(this,void 0,new p(g(M)))}catch(T){B(T)}};var I,v=["createCredentials","createCipher","createCipheriv","createDecipher","createDecipheriv","createSign","createVerify","createDiffieHellman","pbkdf2"],P=function(M){r[M]=function(){b("sorry,",M,"is not implemented yet")}};for(I in v)P(v[I],I)}).call(this,n("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},n("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/index.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{"./md5":6,"./rng":7,"./sha":8,"./sha256":9,buffer:3,lYpoI2:11}],6:[function(n,o,r){(function(i,s,a,c,l,h,d,u,_){var p=n("./helpers");function m(b,I){b[I>>5]|=128<<I%32,b[14+(I+64>>>9<<4)]=I;for(var v=1732584193,P=-271733879,M=-1732584194,B=271733878,T=0;T<b.length;T+=16){var N=v,D=P,L=M,H=B,v=g(v,P,M,B,b[T+0],7,-680876936),B=g(B,v,P,M,b[T+1],12,-389564586),M=g(M,B,v,P,b[T+2],17,606105819),P=g(P,M,B,v,b[T+3],22,-1044525330);v=g(v,P,M,B,b[T+4],7,-176418897),B=g(B,v,P,M,b[T+5],12,1200080426),M=g(M,B,v,P,b[T+6],17,-1473231341),P=g(P,M,B,v,b[T+7],22,-45705983),v=g(v,P,M,B,b[T+8],7,1770035416),B=g(B,v,P,M,b[T+9],12,-1958414417),M=g(M,B,v,P,b[T+10],17,-42063),P=g(P,M,B,v,b[T+11],22,-1990404162),v=g(v,P,M,B,b[T+12],7,1804603682),B=g(B,v,P,M,b[T+13],12,-40341101),M=g(M,B,v,P,b[T+14],17,-1502002290),v=f(v,P=g(P,M,B,v,b[T+15],22,1236535329),M,B,b[T+1],5,-165796510),B=f(B,v,P,M,b[T+6],9,-1069501632),M=f(M,B,v,P,b[T+11],14,643717713),P=f(P,M,B,v,b[T+0],20,-373897302),v=f(v,P,M,B,b[T+5],5,-701558691),B=f(B,v,P,M,b[T+10],9,38016083),M=f(M,B,v,P,b[T+15],14,-660478335),P=f(P,M,B,v,b[T+4],20,-405537848),v=f(v,P,M,B,b[T+9],5,568446438),B=f(B,v,P,M,b[T+14],9,-1019803690),M=f(M,B,v,P,b[T+3],14,-187363961),P=f(P,M,B,v,b[T+8],20,1163531501),v=f(v,P,M,B,b[T+13],5,-1444681467),B=f(B,v,P,M,b[T+2],9,-51403784),M=f(M,B,v,P,b[T+7],14,1735328473),v=y(v,P=f(P,M,B,v,b[T+12],20,-1926607734),M,B,b[T+5],4,-378558),B=y(B,v,P,M,b[T+8],11,-2022574463),M=y(M,B,v,P,b[T+11],16,1839030562),P=y(P,M,B,v,b[T+14],23,-35309556),v=y(v,P,M,B,b[T+1],4,-1530992060),B=y(B,v,P,M,b[T+4],11,1272893353),M=y(M,B,v,P,b[T+7],16,-155497632),P=y(P,M,B,v,b[T+10],23,-1094730640),v=y(v,P,M,B,b[T+13],4,681279174),B=y(B,v,P,M,b[T+0],11,-358537222),M=y(M,B,v,P,b[T+3],16,-722521979),P=y(P,M,B,v,b[T+6],23,76029189),v=y(v,P,M,B,b[T+9],4,-640364487),B=y(B,v,P,M,b[T+12],11,-421815835),M=y(M,B,v,P,b[T+15],16,530742520),v=x(v,P=y(P,M,B,v,b[T+2],23,-995338651),M,B,b[T+0],6,-198630844),B=x(B,v,P,M,b[T+7],10,1126891415),M=x(M,B,v,P,b[T+14],15,-1416354905),P=x(P,M,B,v,b[T+5],21,-57434055),v=x(v,P,M,B,b[T+12],6,1700485571),B=x(B,v,P,M,b[T+3],10,-1894986606),M=x(M,B,v,P,b[T+10],15,-1051523),P=x(P,M,B,v,b[T+1],21,-2054922799),v=x(v,P,M,B,b[T+8],6,1873313359),B=x(B,v,P,M,b[T+15],10,-30611744),M=x(M,B,v,P,b[T+6],15,-1560198380),P=x(P,M,B,v,b[T+13],21,1309151649),v=x(v,P,M,B,b[T+4],6,-145523070),B=x(B,v,P,M,b[T+11],10,-1120210379),M=x(M,B,v,P,b[T+2],15,718787259),P=x(P,M,B,v,b[T+9],21,-343485551),v=C(v,N),P=C(P,D),M=C(M,L),B=C(B,H)}return Array(v,P,M,B)}function A(b,I,v,P,M,B){return C((I=C(C(I,b),C(P,B)))<<M|I>>>32-M,v)}function g(b,I,v,P,M,B,T){return A(I&v|~I&P,b,I,M,B,T)}function f(b,I,v,P,M,B,T){return A(I&P|v&~P,b,I,M,B,T)}function y(b,I,v,P,M,B,T){return A(I^v^P,b,I,M,B,T)}function x(b,I,v,P,M,B,T){return A(v^(I|~P),b,I,M,B,T)}function C(b,I){var v=(65535&b)+(65535&I);return(b>>16)+(I>>16)+(v>>16)<<16|65535&v}o.exports=function(b){return p.hash(b,m,16)}}).call(this,n("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},n("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/md5.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{"./helpers":4,buffer:3,lYpoI2:11}],7:[function(n,o,r){(function(i,s,a,c,l,h,d,u,_){var p;o.exports=p||function(m){for(var A,g=Array(m),f=0;f<m;f++)(3&f)==0&&(A=4294967296*Math.random()),g[f]=A>>>((3&f)<<3)&255;return g}}).call(this,n("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},n("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/rng.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{buffer:3,lYpoI2:11}],8:[function(n,o,r){(function(i,s,a,c,l,h,d,u,_){var p=n("./helpers");function m(f,y){f[y>>5]|=128<<24-y%32,f[15+(y+64>>9<<4)]=y;for(var x,C,b,I=Array(80),v=1732584193,P=-271733879,M=-1732584194,B=271733878,T=-1009589776,N=0;N<f.length;N+=16){for(var D=v,L=P,H=M,V=B,O=T,U=0;U<80;U++){I[U]=U<16?f[N+U]:g(I[U-3]^I[U-8]^I[U-14]^I[U-16],1);var j=A(A(g(v,5),(j=P,C=M,b=B,(x=U)<20?j&C|~j&b:!(x<40)&&x<60?j&C|j&b|C&b:j^C^b)),A(A(T,I[U]),(x=U)<20?1518500249:x<40?1859775393:x<60?-1894007588:-899497514)),T=B,B=M,M=g(P,30),P=v,v=j}v=A(v,D),P=A(P,L),M=A(M,H),B=A(B,V),T=A(T,O)}return Array(v,P,M,B,T)}function A(f,y){var x=(65535&f)+(65535&y);return(f>>16)+(y>>16)+(x>>16)<<16|65535&x}function g(f,y){return f<<y|f>>>32-y}o.exports=function(f){return p.hash(f,m,20,!0)}}).call(this,n("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},n("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/sha.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{"./helpers":4,buffer:3,lYpoI2:11}],9:[function(n,o,r){(function(i,s,a,c,l,h,d,u,_){function p(y,x){var C=(65535&y)+(65535&x);return(y>>16)+(x>>16)+(C>>16)<<16|65535&C}function m(y,x){var C,b=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],I=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],v=Array(64);y[x>>5]|=128<<24-x%32,y[15+(x+64>>9<<4)]=x;for(var P,M,B=0;B<y.length;B+=16){for(var T=I[0],N=I[1],D=I[2],L=I[3],H=I[4],V=I[5],O=I[6],U=I[7],j=0;j<64;j++)v[j]=j<16?y[j+B]:p(p(p((M=v[j-2],g(M,17)^g(M,19)^f(M,10)),v[j-7]),(M=v[j-15],g(M,7)^g(M,18)^f(M,3))),v[j-16]),C=p(p(p(p(U,g(M=H,6)^g(M,11)^g(M,25)),H&V^~H&O),b[j]),v[j]),P=p(g(P=T,2)^g(P,13)^g(P,22),T&N^T&D^N&D),U=O,O=V,V=H,H=p(L,C),L=D,D=N,N=T,T=p(C,P);I[0]=p(T,I[0]),I[1]=p(N,I[1]),I[2]=p(D,I[2]),I[3]=p(L,I[3]),I[4]=p(H,I[4]),I[5]=p(V,I[5]),I[6]=p(O,I[6]),I[7]=p(U,I[7])}return I}var A=n("./helpers"),g=function(y,x){return y>>>x|y<<32-x},f=function(y,x){return y>>>x};o.exports=function(y){return A.hash(y,m,32,!0)}}).call(this,n("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},n("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/sha256.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{"./helpers":4,buffer:3,lYpoI2:11}],10:[function(n,o,r){(function(i,s,a,c,l,h,d,u,_){r.read=function(p,m,A,g,B){var y,x,C=8*B-g-1,b=(1<<C)-1,I=b>>1,v=-7,P=A?B-1:0,M=A?-1:1,B=p[m+P];for(P+=M,y=B&(1<<-v)-1,B>>=-v,v+=C;0<v;y=256*y+p[m+P],P+=M,v-=8);for(x=y&(1<<-v)-1,y>>=-v,v+=g;0<v;x=256*x+p[m+P],P+=M,v-=8);if(y===0)y=1-I;else{if(y===b)return x?NaN:1/0*(B?-1:1);x+=Math.pow(2,g),y-=I}return(B?-1:1)*x*Math.pow(2,y-g)},r.write=function(p,m,A,g,f,T){var x,C,b=8*T-f-1,I=(1<<b)-1,v=I>>1,P=f===23?Math.pow(2,-24)-Math.pow(2,-77):0,M=g?0:T-1,B=g?1:-1,T=m<0||m===0&&1/m<0?1:0;for(m=Math.abs(m),isNaN(m)||m===1/0?(C=isNaN(m)?1:0,x=I):(x=Math.floor(Math.log(m)/Math.LN2),m*(g=Math.pow(2,-x))<1&&(x--,g*=2),2<=(m+=1<=x+v?P/g:P*Math.pow(2,1-v))*g&&(x++,g/=2),I<=x+v?(C=0,x=I):1<=x+v?(C=(m*g-1)*Math.pow(2,f),x+=v):(C=m*Math.pow(2,v-1)*Math.pow(2,f),x=0));8<=f;p[A+M]=255&C,M+=B,C/=256,f-=8);for(x=x<<f|C,b+=f;0<b;p[A+M]=255&x,M+=B,x/=256,b-=8);p[A+M-B]|=128*T}}).call(this,n("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},n("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/ieee754/index.js","/node_modules/gulp-browserify/node_modules/ieee754")},{buffer:3,lYpoI2:11}],11:[function(n,o,r){(function(i,s,a,c,l,h,d,u,_){var p,m,A;function g(){}(i=o.exports={}).nextTick=(m=typeof window<"u"&&window.setImmediate,A=typeof window<"u"&&window.postMessage&&window.addEventListener,m?function(f){return window.setImmediate(f)}:A?(p=[],window.addEventListener("message",function(f){var y=f.source;y!==window&&y!==null||f.data!=="process-tick"||(f.stopPropagation(),0<p.length&&p.shift()())},!0),function(f){p.push(f),window.postMessage("process-tick","*")}):function(f){setTimeout(f,0)}),i.title="browser",i.browser=!0,i.env={},i.argv=[],i.on=g,i.addListener=g,i.once=g,i.off=g,i.removeListener=g,i.removeAllListeners=g,i.emit=g,i.binding=function(f){throw Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(f){throw Error("process.chdir is not supported")}}).call(this,n("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},n("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/process/browser.js","/node_modules/gulp-browserify/node_modules/process")},{buffer:3,lYpoI2:11}]},{},[1])(1)})}});function Fn(e,t){let n=e.x-t.x,o=e.y-t.y;return Math.sqrt(n*n+o*o)}function uk(e,t){return Iy(e,t[0],t[1])}function Iy(e,t,n){let o=n.x-t.x,r=n.y-t.y;if(o===0&&r===0)return Fn(e,t);let i=Math.max(0,Math.min(1,((e.x-t.x)*o+(e.y-t.y)*r)/(o*o+r*r||1))),s=e.x-t.x-i*o,a=e.y-t.y-i*r;return Math.sqrt(s*s+a*a)}var Q9e=(e,t,n)=>(t.x-e.x)*(n.y-e.y)-(t.y-e.y)*(n.x-e.x);function mB(e,t){let[n,o]=e,[r,i]=t;if(Math.max(n.x,o.x)>=Math.min(r.x,i.x)&&Math.max(r.x,i.x)>=Math.min(n.x,o.x)&&Math.max(n.y,o.y)>=Math.min(r.y,i.y)&&Math.max(r.y,i.y)>=Math.min(n.y,o.y)&&Q9e(n,o,r)*Q9e(n,o,i)<=0&&Q9e(r,i,n)*Q9e(r,i,o)<=0)return 0;return Math.min(uk(n,t),uk(o,t),uk(r,e),uk(i,e))}var Ar=(e)=>e.slice(1).reduce((t,n,o)=>t+Fn(e[o],n),0);function W2(e){let t=[];for(let[n,o]of e.entries()){if(t.length&&Fn(t.at(-1),o)<0.000000000001){if(n===e.length-1)t[t.length-1]=o;continue}while(t.length>1){let r=t[t.length-2],i=t.at(-1),s=i.x-r.x,a=i.y-r.y,c=o.x-i.x,l=o.y-i.y,h=Math.hypot(s,a)*Math.hypot(c,l);if(s*c+a*l<=0||Math.abs(s*l-a*c)>h*0.00000001||uk(i,[r,o])>0.0000000001)break;t.pop()}t.push(o)}return t}function Lf(e,t){let n=e.connections.find((o)=>o.name===t);return(e.traces??[]).filter((o)=>o.connection_name===t||o.source_trace_id===(n?.source_trace_id??t)).reduce((o,r)=>o+Ar(r.route),0)}function YS(e,t){return(e.buses??[]).map((n)=>{let o=n.connectionNames.map((a)=>{let c=t.find((l)=>l.connection_name===a);return{name:a,carrierLengthMm:c?Ar(c.route):null,fixedLengthMm:Lf(e,a),totalLengthMm:c?Ar(c.route)+Lf(e,a):null}}),r=o.every((a)=>a.totalLengthMm!==null),i=o.map((a)=>a.totalLengthMm??0),s=r&&i.length?Math.max(...i)-Math.min(...i):null;return{busId:n.busId,minLengthMm:n.minLength??null,aboveMinimumLength:n.minLength===void 0?!0:r&&i.every((a)=>a>=n.minLength-0.0000001),maxLengthMm:n.maxLength??null,withinLengthLimit:n.maxLength===void 0?!0:r&&i.every((a)=>a<=n.maxLength+0.0000001),toleranceMm:n.maxLengthSkew??null,skewMm:s,matched:n.maxLengthSkew!==void 0&&s!==null&&s<=n.maxLengthSkew+0.0000001,lengths:o}})}function nst(e){return[...(e.buses??[]).filter((t)=>t.maxLengthSkew!==void 0).map((t)=>({names:t.connectionNames,tolerance:t.maxLengthSkew})),...(e.differentialPairs??[]).map((t)=>({names:t.connectionNames,tolerance:t.lengthTolerance}))]}function bk(e,t){let n=new Map(t.map((r)=>[r.connection_name,Ar(r.route)+Lf(e,r.connection_name)]));for(let r of e.buses??[])if(r.minLength!==void 0){for(let i of r.connectionNames)if(n.has(i))n.set(i,Math.max(n.get(i),r.minLength))}let o=nst(e);for(let r=0;r<n.size;r++){let i=!1;for(let{names:s,tolerance:a}of o){let c=Math.max(...s.map((l)=>n.get(l)))-a;for(let l of s)if(n.get(l)<c-0.000000001)n.set(l,c),i=!0}if(!i)break}return n}function Got(e,t){return YS({...e,buses:(e.differentialPairs??[]).map((n,o)=>({busId:`pair_${o}`,connectionNames:n.connectionNames,maxLengthSkew:n.lengthTolerance}))},t)}function vy(e,t){return Math.min(1/0,...(e.buses??[]).filter((n)=>n.connectionNames.includes(t)&&n.maxLength!==void 0).map((n)=>n.maxLength-Lf(e,t)))}function PVr(e,t){for(let n of e.buses??[])if(n.maxLength!==void 0&&n.connectionNames.some((o)=>(t.get(o)??1/0)>n.maxLength+0.0000001))throw Error(`${n.busId}: matching would exceed maximum length ${n.maxLength} mm`)}function N3n(e,t){let n=new Set(e.buses?.flatMap((i)=>i.connectionNames)),o=bk(e,t),r=new Set;for(let i of e.differentialPairs??[])if(i.connectionNames.some((s)=>{let a=t.find((u)=>u.connection_name===s);if(!a?.coupledSection||!n.has(s))return!1;let[c,l]=a.coupledSection,h=0;for(let u=c+1;u<=l;u++)h=Math.max(h,Fn(a.route[u-1],a.route[u]));return(o.get(s)??0)-Ar(a.route)-Lf(e,s)>h/2}))for(let s of i.connectionNames)r.add(s);return r}function CAn(e){if(e.some((c)=>!c.coupledSection))return e;let t=e.map((c)=>c.coupledSection[0]),n=e.map((c,l)=>c.route[t[l]]),o=e.map((c,l)=>c.route[t[l]+1]);if(n.some((c)=>c?.route_type!=="wire")||o.some((c)=>c?.route_type!=="wire")||n.some((c)=>c.layer!==n[0].layer)||o.some((c)=>c.layer!==n[0].layer)||e.some((c,l)=>c.curvedSegments?.includes(t[l]+1)))return e;let r=n.map((c,l)=>{let h=Fn(c,o[l]);return{span:h,x:(o[l].x-c.x)/h,y:(o[l].y-c.y)/h}});if(r.some((c)=>c.span<0.00000001)||Fn(r[0],r[1])>0.0000001)return e;let i=r[0],s=(c)=>c.x*i.x+c.y*i.y,a=Math.max(...n.map(s));if(n.some((c,l)=>a-s(c)>r[l].span+0.00000001))return e;return e.map((c,l)=>{let h=t[l],d=a-s(n[l]);if(d<0.00000001)return c;if(Math.abs(d-r[l].span)<0.00000001){if(h+1>=c.coupledSection[1])return c;return{...c,coupledSection:[h+1,c.coupledSection[1]]}}let u={...n[l],x:n[l].x+i.x*d,y:n[l].y+i.y*d};return{...c,route:[...c.route.slice(0,h+1),u,...c.route.slice(h+1)],coupledSection:[h+1,c.coupledSection[1]+1],curvedSegments:c.curvedSegments?.map((_)=>_>h?_+1:_)}})}function bAn(e){let t=e.route.length;return{...e,route:e.route.toReversed(),coupledSection:e.coupledSection&&[t-1-e.coupledSection[1],t-1-e.coupledSection[0]],curvedSegments:e.curvedSegments?.map((n)=>t-n).sort((n,o)=>n-o)}}function I7e(e,t){let n=[...t];for(let o of e.differentialPairs??[]){let r=o.connectionNames.map((a)=>n.findIndex((c)=>c.connection_name===a)),i=r.map((a)=>n[a]);if(i.some((a)=>!a?.coupledSection))continue;let s=CAn(CAn(i).map(bAn)).map(bAn);r.forEach((a,c)=>{n[a]=s[c]})}return n}var by=(e,t)=>e.x>=t.minX&&e.x<=t.maxX&&e.y>=t.minY&&e.y<=t.maxY;function OY(e,t){let n=e.obstacles.filter((i)=>i.componentId),o=new Map,r=(i,s,a,c=a)=>{i.minX=Math.min(i.minX,s.x-a),i.maxX=Math.max(i.maxX,s.x+a),i.minY=Math.min(i.minY,s.y-c),i.maxY=Math.max(i.maxY,s.y+c)};for(let i of n){let s=o.get(i.componentId);if(!s){let c={minX:1/0,maxX:-1/0,minY:1/0,maxY:-1/0};s={pads:c,copper:{...c}},o.set(i.componentId,s)}let a=(i.ccwRotationDegrees??0)*Math.PI/180;r(s.pads,i.center,(Math.abs(Math.cos(a))*i.width+Math.abs(Math.sin(a))*i.height)/2,(Math.abs(Math.sin(a))*i.width+Math.abs(Math.cos(a))*i.height)/2)}for(let i of o.values())i.copper={...i.pads};for(let i of e.traces??[]){let s=i.route.filter((g)=>g.route_type==="via");if(s.length!==1||!i.route.length)continue;let a=i.route[0],c=n.find((g)=>Fn(g.center,a)<0.0001);if(!c)continue;let l=o.get(c.componentId),h=s[0],d=(h.via_diameter??e.minViaPadDiameter??0.6)/2,u=(c.ccwRotationDegrees??0)*Math.PI/180,_=e.minTraceToPadEdgeClearance??e.defaultObstacleMargin??0.075,p=(Math.abs(Math.cos(u))*c.width+Math.abs(Math.sin(u))*c.height)/2+d+_,m=(Math.abs(Math.sin(u))*c.width+Math.abs(Math.cos(u))*c.height)/2+d+_,A=0.001;if(Math.abs(h.x-a.x)>p+A+0.0001||Math.abs(h.y-a.y)>m+A+0.0001)continue;r(l.copper,h,(h.via_diameter??e.minViaPadDiameter??0.6)/2)}for(let i of o.values())i.copper.minX-=t,i.copper.maxX+=t,i.copper.minY-=t,i.copper.maxY+=t;return[...o.values()]}function Tue(e,t,n={}){let o=t.route[0].width,r=(e.traces??[]).filter((a)=>a.connection_name===t.connection_name).flatMap((a)=>a.route.filter((c)=>c.route_type==="via")).map((a)=>({via:a,reach:((a.via_diameter??e.minViaPadDiameter??0.6)+o)/2}));if(!r.length)return(a)=>!0;let i=t.route.filter((a)=>a.route_type==="wire"),s=(a,c)=>Math.abs(a.x-c.x)<0.00000001&&Math.abs(a.y-c.y)<0.00000001;return(a)=>{let c=0,l=0;while(c<Math.min(a.length,i.length)&&s(a[c],i[c]))c++;while(l<Math.min(a.length,i.length)&&s(a[a.length-1-l],i[i.length-1-l]))l++;for(let{via:h,reach:d}of r){let u=s(h,a[0]);if(!u&&!s(h,a.at(-1)))continue;let _=0;for(let p=1;p<a.length;p++){let m=u?p:a.length-p,A=a[u?m-1:m],g=a[u?m:m-1];if(!(n.preserveExistingApproach!==!1&&(u?m<c:m>=a.length-l+1))&&_>d+0.000000001&&Math.min(A.x,g.x)<=h.x+d&&Math.max(A.x,g.x)>=h.x-d&&Math.min(A.y,g.y)<=h.y+d&&Math.max(A.y,g.y)>=h.y-d&&Iy(h,A,g)<=d+0.000000001)return!1;if(_<=d+0.000000001)_+=Fn(A,g)}}return!0}}var Due=class{root;constructor(e){let t=e.map((i)=>({copper:i,...i.rect??{minX:Math.min(i.a.x,i.b.x)-i.radius,maxX:Math.max(i.a.x,i.b.x)+i.radius,minY:Math.min(i.a.y,i.b.y)-i.radius,maxY:Math.max(i.a.y,i.b.y)+i.radius}})),n=(i,s)=>{let a=t[i];t[i]=t[s],t[s]=a},o=(i,s,a,c)=>{let l=(h)=>c?h.minX+h.maxX:h.minY+h.maxY;while(s-i>1){let h=l(t[i]),d=l(t[i+s>>1]),u=l(t[s-1]),_=h<d?d<u?d:Math.max(h,u):h<u?h:Math.max(d,u),p=i,m=s,A=i;while(A<m){let g=l(t[A]);if(g<_)n(p++,A++);else if(g>_)n(A,--m);else A++}if(a<p)s=p;else if(a>=m)i=m;else return}},r=(i,s)=>{let a={minX:1/0,maxX:-1/0,minY:1/0,maxY:-1/0};for(let h=i;h<s;h++){let d=t[h];a.minX=Math.min(a.minX,d.minX),a.maxX=Math.max(a.maxX,d.maxX),a.minY=Math.min(a.minY,d.minY),a.maxY=Math.max(a.maxY,d.maxY)}if(s-i<=8)return{...a,entries:t.slice(i,s)};let c=a.maxX-a.minX>=a.maxY-a.minY,l=i+s>>1;return o(i,s,l,c),{...a,left:r(i,l),right:r(l,s)}};if(t.length)this.root=r(0,t.length)}distanceToPoint(e,t,n=0){let o=1/0,r=(s)=>{let a=Math.max(s.minX-e.x,0,e.x-s.maxX),c=Math.max(s.minY-e.y,0,e.y-s.maxY);return a||c?Math.hypot(a,c)-n:-1/0},i=(s,a)=>{if(a>=o)return;if(s.entries){for(let h of s.entries)if(r(h)<o)o=Math.min(o,t(h.copper));return}let c=r(s.left),l=r(s.right);if(c<=l)i(s.left,c),i(s.right,l);else i(s.right,l),i(s.left,c)};if(this.root)i(this.root,r(this.root));return o}some(e,t){let n=(o)=>{if(o.minX>e.maxX||o.maxX<e.minX||o.minY>e.maxY||o.maxY<e.minY)return!1;if(o.entries){for(let r of o.entries){if(r.minX>e.maxX||r.maxX<e.minX||r.minY>e.maxY||r.maxY<e.minY)continue;if(t(r.copper))return!0}return!1}return n(o.left)||n(o.right)};return this.root?n(this.root):!1}};function sa(e){let t=[];for(let o of e.obstacles){let r=(o.ccwRotationDegrees??0)*Math.PI/180,i=Math.abs(Math.cos(r))*o.width+Math.abs(Math.sin(r))*o.height,s=Math.abs(Math.sin(r))*o.width+Math.abs(Math.cos(r))*o.height;for(let a of o.layers)t.push({a:o.center,b:o.center,radius:o.shape==="circle"?o.width/2:0,layer:a,owners:o.connectedTo,rect:o.shape==="circle"?void 0:{minX:o.center.x-i/2,maxX:o.center.x+i/2,minY:o.center.y-s/2,maxY:o.center.y+s/2}})}let n=Array.from({length:e.layerCount},(o,r)=>r===0?"top":r===e.layerCount-1?"bottom":`inner${r}`);for(let o of e.traces??[])for(let r=0;r<o.route.length;r++){let i=o.route[r],s=o.route[r+1],a=[o.connection_name??"",o.source_trace_id??""];if(i.route_type==="via"){let c=n.indexOf(i.from_layer),l=n.indexOf(i.to_layer);for(let h of i.layers??n.slice(Math.min(c,l),Math.max(c,l)+1))t.push({a:i,b:i,radius:(i.via_diameter??0.3)/2,layer:h,owners:a})}else if(s?.route_type==="wire"){if(i.layer!==s.layer)throw Error("Fixed trace changes layer without a via");t.push({a:i,b:s,radius:i.width/2,layer:i.layer,owners:a})}if(s&&i.route_type!==s.route_type&&Fn(i,s)>0.0000000001){let c=i.route_type==="wire"?i:s;t.push({a:i,b:s,radius:c.width/2,layer:c.layer,owners:a})}}return t}function Jr(e){return e.route.slice(1).map((t,n)=>({a:e.route[n],b:t,radius:t.width/2,layer:t.layer,owners:[e.connection_name??""]}))}var EVr=(e,t,n)=>{let o=0,r=1;for(let[i,s,a,c]of[[e.x,t.x-e.x,n.minX,n.maxX],[e.y,t.y-e.y,n.minY,n.maxY]]){if(Math.abs(s)<0.000000000001){if(i<a||i>c)return!1;continue}let l=(a-i)/s,h=(c-i)/s;if(l>h)[l,h]=[h,l];if(o=Math.max(o,l),r=Math.min(r,h),o>r)return!1}return!0};function Nue(e,t,n){if(!n.rect){if(e.x===t.x&&e.y===t.y){if(n.a.x===n.b.x&&n.a.y===n.b.y)return Fn(e,n.a)-n.radius;return uk(e,[n.a,n.b])-n.radius}if(n.a.x===n.b.x&&n.a.y===n.b.y)return uk(n.a,[e,t])-n.radius;return mB([e,t],[n.a,n.b])-n.radius}let o=n.rect;if(EVr(e,t,o))return 0;let r=[{x:o.minX,y:o.minY},{x:o.maxX,y:o.minY},{x:o.maxX,y:o.maxY},{x:o.minX,y:o.maxY}];return Math.min(...r.map((i,s)=>mB([e,t],[i,r[(s+1)%4]])))}function Uot(e,t,n,o){if(n.rect)return Nue(e,t,n)<o;let{a:r,b:i,radius:s}=n;if(r.x===i.x&&r.y===i.y)return Iy(r,e,t)-s<o;if(e.x===t.x&&e.y===t.y)return Iy(e,r,i)-s<o;if(Math.max(e.x,t.x)>=Math.min(r.x,i.x)&&Math.max(r.x,i.x)>=Math.min(e.x,t.x)&&Math.max(e.y,t.y)>=Math.min(r.y,i.y)&&Math.max(r.y,i.y)>=Math.min(e.y,t.y)&&((t.x-e.x)*(r.y-e.y)-(t.y-e.y)*(r.x-e.x))*((t.x-e.x)*(i.y-e.y)-(t.y-e.y)*(i.x-e.x))<=0&&((i.x-r.x)*(e.y-r.y)-(i.y-r.y)*(e.x-r.x))*((i.x-r.x)*(t.y-r.y)-(i.y-r.y)*(t.x-r.x))<=0)return-s<o;return Iy(e,r,i)-s<o||Iy(t,r,i)-s<o||Iy(r,e,t)-s<o||Iy(i,e,t)-s<o}function MVr(e){let t=e.b.x-e.a.x,n=e.b.y-e.a.y;return{copper:e,ax:e.a.x,ay:e.a.y,bx:e.b.x,by:e.b.y,dx:t,dy:n,denominator:t*t+n*n}}function AJ(e,t,n,o,r,i,s){let a=e-n,c=t-o;if(r===0&&i===0)return Math.sqrt(a*a+c*c);let l=Math.max(0,Math.min(1,(a*r+c*i)/(s||1))),h=a-l*r,d=c-l*i;return Math.sqrt(h*h+d*d)}function IAn(e,t,n,o,r,i,s,a,c){let l=a.copper.radius;if(a.copper.rect)return Uot({x:e,y:t},{x:n,y:o},a.copper,c);if(a.dx===0&&a.dy===0)return AJ(a.ax,a.ay,e,t,r,i,s)-l<c;if(r===0&&i===0)return AJ(e,t,a.ax,a.ay,a.dx,a.dy,a.denominator)-l<c;if(Math.max(e,n)>=Math.min(a.ax,a.bx)&&Math.max(a.ax,a.bx)>=Math.min(e,n)&&Math.max(t,o)>=Math.min(a.ay,a.by)&&Math.max(a.ay,a.by)>=Math.min(t,o)&&(r*(a.ay-t)-i*(a.ax-e))*(r*(a.by-t)-i*(a.bx-e))<=0&&(a.dx*(t-a.ay)-a.dy*(e-a.ax))*(a.dx*(o-a.ay)-a.dy*(n-a.ax))<=0)return-l<c;return AJ(e,t,a.ax,a.ay,a.dx,a.dy,a.denominator)-l<c||AJ(n,o,a.ax,a.ay,a.dx,a.dy,a.denominator)-l<c||AJ(a.ax,a.ay,e,t,r,i,s)-l<c||AJ(a.bx,a.by,e,t,r,i,s)-l<c}var Mi=class{constructor(e,t,n,o){this.input=e,this.connection=t,this.width=n,this.owners=new Set([t.name,t.source_trace_id,...t.pointsToConnect.flatMap((r)=>[r.pointId,r.pcb_port_id])].filter((r)=>!!r)),this.copper=o.filter((r)=>r.layer===t.pointsToConnect[0].layer&&!r.owners.some((i)=>this.owners.has(i))),this.margin=n/2+(e.minTraceToPadEdgeClearance??e.defaultObstacleMargin??0.075)}input;connection;width;visibleCalls=0;copperIndex;copper;owners;margin;visible(e,t){let n=this.width/2+(this.input.minBoardEdgeClearance??0),o=this.input.bounds;if([e,t].some((c)=>c.x<o.minX+n-0.000000001||c.x>o.maxX-n+0.000000001||c.y<o.minY+n-0.000000001||c.y>o.maxY-n+0.000000001))return!1;let r=Math.min(e.x,t.x)-this.margin,i=Math.max(e.x,t.x)+this.margin,s=Math.min(e.y,t.y)-this.margin,a=Math.max(e.y,t.y)+this.margin;if(++this.visibleCalls===16)this.copperIndex=new Due(this.copper);if(this.copperIndex)return!this.copperIndex.some({minX:r,maxX:i,minY:s,maxY:a},(c)=>Uot(e,t,c,this.margin-0.00000001));for(let c of this.copper){let l=c.rect??{minX:Math.min(c.a.x,c.b.x)-c.radius,maxX:Math.max(c.a.x,c.b.x)+c.radius,minY:Math.min(c.a.y,c.b.y)-c.radius,maxY:Math.max(c.a.y,c.b.y)+c.radius};if(l.minX>i||l.maxX<r||l.minY>a||l.maxY<s)continue;if(Uot(e,t,c,this.margin-0.00000001))return!1}return!0}pathVisible(e){return e.slice(1).every((t,n)=>this.visible(e[n],t))}vertices(){let e=[],t=Math.SQRT2-1;for(let r of this.copper)if(r.rect){let i=r.rect,s=this.margin+0.00001;e.push({x:i.minX-s,y:i.minY-s},{x:i.minX-s,y:i.maxY+s},{x:i.maxX+s,y:i.minY-s},{x:i.maxX+s,y:i.maxY+s})}else{let i=r.radius+this.margin+0.00001;for(let s of Fn(r.a,r.b)<0.000000001?[r.a]:[r.a,r.b])for(let[a,c]of[[1,t],[t,1],[-t,1],[-1,t],[-1,-t],[-t,-1],[t,-1],[1,-t]])e.push({x:s.x+a*i,y:s.y+c*i})}let o=new Set;return e.filter((r)=>{let i=`${r.x.toFixed(9)},${r.y.toFixed(9)}`;if(o.has(i))return!1;return o.add(i),this.visible(r,r)})}};function wVr(e,t,n){let o=sa(e);function*r(c,l){let h=e.connections.find((y)=>y.name===c.connection_name),d=c.coupledSection?(y)=>!0:Tue(e,c),u=c.route[0].width,_=Lf(e,h.name),p=n.get(h.name)-Ar(c.route)-_;if(p<0.00000001){yield c;return}let m=e.minTraceToPadEdgeClearance??e.defaultObstacleMargin??0.075,A=Math.max(u+m,3*u),g=2*(A+2*u),f=c.route.slice(1).map((y,x)=>({i:x,span:Fn(c.route[x],y)})).sort((y,x)=>x.span-y.span);for(let{i:y}of f){let x=c.route[y],C=c.route[y+1],b=Fn(x,C);if(b<0.01)continue;let I=(C.x-x.x)/b,v=(C.y-x.y)/b,P=Math.floor(b*0.9/g),M=Math.min(P,Math.max(2,Math.ceil(p/(12*u)))),B=Array.from({length:P},(T,N)=>N+1).sort((T,N)=>Math.abs(T-M)-Math.abs(N-M)||N-T);for(let T of B)for(let N of[0.9,0.65,0.4]){let D=b*N/T;if(D<g)continue;let L=Math.min(p/(2*T),D/10,(D/2-A)/2),H=p/(2*T)+2*L*(2-Math.SQRT2);for(let V of[0.5,0,1])for(let O of[1,-1]){let U=(X,K)=>({x:x.x+I*X-v*K*O,y:x.y+v*X+I*K*O}),j=[U(0,0)];for(let X=0;X<T;X++){let K=b*(1-N)*(0.05+0.9*V)+X*D,J=D*0.5;j.push(...[[K,0],[K+L,L],[K+L,H-L],[K+2*L,H],[K+J-2*L,H],[K+J-L,H-L],[K+J-L,L],[K+J,0]].map(([ee,se])=>U(ee,se)))}if(j.push(U(b,0)),!l.pathVisible(j))continue;let Y=W2([...c.route.slice(0,y),...j,...c.route.slice(y+2)]);if(Math.abs(Ar(Y)+_-n.get(h.name))>0.000001)continue;if(!d(Y)||!Wc(Y,A))continue;yield{...c,route:Y.map((X)=>({...X,route_type:"wire",layer:h.pointsToConnect[0].layer,width:u}))}}}}}let i=[...t],s=new Set(t.map((c,l)=>l)),a=!0;while(s.size&&a){a=!1;for(let c of s){let l=e.connections.find((u)=>u.name===t[c].connection_name),h=new Mi(e,l,t[c].route[0].width,[...o,...i.flatMap(Jr)]),d=r(t[c],h).next().value;if(!d)continue;i[c]=d,s.delete(c),a=!0}}if(s.size)throw Error(`Insufficient tuning clearance for ${[...s].map((c)=>t[c].connection_name).join(", ")}`);return i}function Wc(e,t){let n=[0],o=[0],r=[0];for(let i=1;i<e.length-1;i++){let s={x:e[i].x-e[i-1].x,y:e[i].y-e[i-1].y},a={x:e[i+1].x-e[i].x,y:e[i+1].y-e[i].y},c=Math.abs(Math.atan2(s.x*a.y-s.y*a.x,s.x*a.x+s.y*a.y)),l=Math.abs(s.x*a.y-s.y*a.x),h=l<0.000000000001?1/0:Math.hypot(s.x,s.y)*Math.hypot(a.x,a.y)*Fn(e[i-1],e[i+1])/(2*l);o.push(o[i-1]+c),r.push(r[i-1]+Number(c>Math.PI/8+0.00000001||h<t/2-0.00000001))}for(let i=1;i<e.length;i++)n.push(n[i-1]+Fn(e[i-1],e[i]));for(let i=0;i<e.length-1;i++)for(let s=i+2;s<e.length-1;s++){let a=e[i],c=e[i+1],l=e[s],h=e[s+1],d=Math.max(t,0.000000001);if(Math.max(a.x,c.x)+d<Math.min(l.x,h.x)||Math.max(l.x,h.x)+d<Math.min(a.x,c.x)||Math.max(a.y,c.y)+d<Math.min(l.y,h.y)||Math.max(l.y,h.y)+d<Math.min(a.y,c.y))continue;let u=mB([a,c],[l,h]);if(u<0.000000001&&n[s]-n[i+1]>0.00000001)return!1;if(n[s]-n[i+1]<=Math.PI*t+0.00000001&&(o[s]-o[i]<=Math.PI/2+0.00000001||o[s]-o[i]<=Math.PI+0.00000001&&r[s]===r[i]))continue;if(u>=t-0.00000001)continue;let _=0,p=0;for(let m=i;m<=s;m++){let A=e[m+1].x-e[m].x,g=e[m+1].y-e[m].y;if(Math.abs(A)>0.00000001){if(_&&_!==Math.sign(A))return!1;_=Math.sign(A)}if(Math.abs(g)>0.00000001){if(p&&p!==Math.sign(g))return!1;p=Math.sign(g)}}}return!0}function Mk(e,t,n=sa(e),o=1.5){if(!Number.isFinite(o)||o<=0)throw Error("Corner trim must be a positive finite number of trace widths");let r=t.map((s)=>({...s,route:[...s.route]})),i=e.minTraceToPadEdgeClearance??e.defaultObstacleMargin??0.075;for(let[s,a]of r.entries()){if(a.route.some((d)=>d.route_type!=="wire"))continue;let c=e.connections.find((d)=>d.name===a.connection_name);if(!c)continue;let l=sa({...e,obstacles:[],traces:r.filter((d,u)=>u!==s)}),h=new Map;for(let d=1;d<a.route.length-1;d++){let[u,_,p]=a.route.slice(d-1,d+2);if(u.route_type!=="wire"||_.route_type!=="wire"||p.route_type!=="wire"||u.layer!==_.layer||_.layer!==p.layer||a.curvedSegments?.some((P)=>P===d||P===d+1)||a.coupledSection&&d>a.coupledSection[0]&&d<a.coupledSection[1])continue;let m=Fn(u,_),A=Fn(_,p);if(m<0.00000001||A<0.00000001)continue;let g={x:(_.x-u.x)/m,y:(_.y-u.y)/m},f={x:(p.x-_.x)/A,y:(p.y-_.y)/A},y=(P)=>Math.min(Math.abs(P.x),Math.abs(P.y))<0.00000001||Math.abs(Math.abs(P.x)-Math.abs(P.y))<0.00000001,x=g.x*f.x+g.y*f.y,C=Math.abs(x+Math.SQRT1_2)<0.00000001;if(!y(g)||!y(f)||Math.abs(x)>0.00000001&&!C)continue;let b=`${_.layer}/${_.width}`,I=h.get(b);if(!I)I=new Mi(e,{...c,pointsToConnect:c.pointsToConnect.map((P)=>({...P,layer:_.layer}))},_.width,[...n,...l]),h.set(b,I);let v=Math.min(o*_.width,m/2,A/2);for(let P=0;P<8;P++){let M=v/2**P;if(M<0.000001)break;let B={..._,x:_.x-g.x*M,y:_.y-g.y*M},T={..._,x:_.x+f.x*M,y:_.y+f.y*M},N=Math.sign(g.x*f.y-g.y*f.x),D=(Math.SQRT2-1)*M,L={..._,x:B.x+(g.x-N*g.y)*Math.SQRT1_2*D,y:B.y+(g.y+N*g.x)*Math.SQRT1_2*D},H=C?[B,L,T]:[B,T],V=H.length-1,O=[...a.route.slice(0,d),...H,...a.route.slice(d+1)];if(!I.pathVisible(O)||!Wc(O,_.width+i)&&Wc(a.route,_.width+i))continue;a.route=O,a.curvedSegments=a.curvedSegments?.map((U)=>U>d?U+V:U),a.coupledSection=a.coupledSection?.map((U,j)=>U>d||U===d&&j===0?U+V:U),d+=V;break}}}return r}function xY(e){return e.every((t)=>{let n,o;for(let r of t.route){if(r.route_type!=="wire"){n=o=void 0;continue}if(!n||n.layer!==r.layer){n=r,o=void 0;continue}let i=Fn(n,r);if(i<0.00000001)continue;let s={x:(r.x-n.x)/i,y:(r.y-n.y)/i};if(o&&o.x*s.x+o.y*s.y<Math.cos(45.2*Math.PI/180))return!1;n=r,o=s}return!0})}function wk(e,t){return(e.differentialPairs??[]).map((n)=>{let o=n.connectionNames.map((A)=>t.find((g)=>g.connection_name===A||g.source_trace_id===A)),r=o.map((A)=>A?.coupledSection?A.route.slice(A.coupledSection[0],A.coupledSection[1]+1):[]),i=o.every((A)=>A?.coupledSection?.length===2&&A.coupledSection.every(Number.isInteger)&&A.coupledSection[0]>=0&&A.coupledSection[1]<A.route.length&&A.coupledSection[0]<A.coupledSection[1])&&r.every((A)=>A.length>=2&&A.every((g)=>g.route_type==="wire"&&Number.isFinite(g.x)&&Number.isFinite(g.y)&&Number.isFinite(g.width)&&g.width>0))&&r.flat().every((A)=>A.layer===r[0][0]?.layer),s=n.traceGap!==void 0||n.maxUncoupledLength!==void 0,a=n.traceGap??e.minTraceToPadEdgeClearance??e.defaultObstacleMargin??0.075,c={connectionNames:n.connectionNames,requestedGapMm:n.traceGap??null};if(!i)return{...c,sharedSectionPresent:!1,minEdgeGapMm:null,maxEdgeGapMm:null,maxSamplingErrorMm:null,sharedCopperMm:null,maxAllowedEdgeGapMm:null,matched:!s};let l=r.map((A)=>A[0].width);if(r.some((A,g)=>A.some((f)=>Math.abs(f.width-l[g])>0.00000001)))return{...c,sharedSectionPresent:!1,minEdgeGapMm:null,maxEdgeGapMm:null,maxSamplingErrorMm:null,sharedCopperMm:null,maxAllowedEdgeGapMm:null,matched:!s};let h=(l[0]+l[1])/2,d=(h+a)/Math.cos(Math.PI/8)-h+0.002,u=1/0,_=-1/0,p=0,m=[0,0];for(let A=0;A<2;A++){let g=r[A],f=o[1-A].route,y=f.slice(1).flatMap((C,b)=>{let I=f[b];return I.route_type==="wire"&&C.route_type==="wire"&&I.layer===g[0].layer&&C.layer===g[0].layer?[{a:I,b:C,radius:I.width/2,layer:I.layer,owners:[]}]:[]}),x=new Due(y);for(let C=1;C<g.length;C++){let b=g[C-1],I=g[C],v=Fn(b,I),P=Math.max(1,Math.ceil(v/0.002));m[A]+=v,p=Math.max(p,v/(2*P));for(let M=0;M<P;M++){let B=(M+0.5)/P,T={x:b.x+(I.x-b.x)*B,y:b.y+(I.y-b.y)*B},N=x.distanceToPoint(T,(D)=>Iy(T,D.a,D.b)-D.radius)-b.width/2;u=Math.min(u,N),_=Math.max(_,N)}}}return{...c,sharedSectionPresent:!0,minEdgeGapMm:u,maxEdgeGapMm:_,maxSamplingErrorMm:p,sharedCopperMm:m,maxAllowedEdgeGapMm:d,matched:!s||m.every((A)=>A>0)&&_+p<=d}})}function R3n(e,t,n,o,r,i,s){let a=Fn(e,t),c=s+n/2;if(!Number.isFinite(a+n+o+s)||n<0||i!==1&&i!==-1||s<=0||o<=0||!Number.isInteger(r)||r<1||r>64||a<6*c)return null;let l=(4*r+2)*c,h=(t.x-e.x)/a,d=(t.y-e.y)/a,u=(f)=>{let y=[{x:0,y:0},{x:c,y:0},{x:c,y:l},{x:f,y:l}];for(let b=1;b<=2*r;b++){let I=b%2?3*c:f,v=l-2*c*b;y.push({x:y.at(-1).x,y:v},{x:I,y:v})}y.push({x:f,y:0},{x:a,y:0});let x=[[],[]],C=(b,I,v,P)=>{for(let M=0;M<(n?2:1);M++){let B=(M===0?1:-1)*n/2,T=b-i*P*B,N=i*I+v*B,D={x:e.x+h*T-d*N,y:e.y+d*T+h*N};if(!x[M].length||Fn(x[M].at(-1),D)>0.0000000001)x[M].push(D)}};C(0,0,1,0);for(let b=1;b<y.length-1;b++){let I=y[b-1],v=y[b],P=y[b+1],M=Fn(I,v),B=Fn(v,P),T={x:(v.x-I.x)/M,y:(v.y-I.y)/M},N={x:(P.x-v.x)/B,y:(P.y-v.y)/B},D={x:v.x-T.x*c,y:v.y-T.y*c},L={x:D.x+N.x*c,y:D.y+N.y*c},H=T.x*N.y-T.y*N.x,V=Math.atan2(D.y-L.y,D.x-L.x);for(let O=0;O<=18;O++){let U=V+H*Math.PI/2*O/18;C(L.x+c*Math.cos(U),L.y+c*Math.sin(U),-H*Math.sin(U),H*Math.cos(U))}}if(C(a,0,1,0),!n)x[1]=x[0];return x},_=5*c,p=a-c,m=4*(r+1)*c*(36*Math.sin(Math.PI/72)-2),A=2*l+4*r*c+m;if(A>o+0.00000001)return null;let g=_+(o-A)/(2*r);if(g>p+0.00000001)return null;return u(Math.min(g,p))}function BVr(e,t,n,o,r,i){return R3n(e,t,0,n,o,r,i)?.[0]??null}function TVr(e,t,n,o,r,i){let s=Fn(e,t),a=s/o;if(s<=0||n<=0||o<1)return null;let c=(t.x-e.x)/s,l=(t.y-e.y)/s,h=a*a/(2*Math.PI*Math.PI*i),d=Math.max(48,Math.ceil(a/Math.max(0.005,i/6))),u=[],_=[];for(let f=0;f<o;f++)for(let y=0;y<d;y++)u.push(a*(f+y/d)),_.push(1-Math.cos(2*Math.PI*y/d));let p=(f)=>{let y=[];for(let x=0;x<u.length;x++){let C=u[x],b=r*f*_[x]/2;y.push({x:e.x+c*C-l*b,y:e.y+l*C+c*b})}return y.push(t),y},m=(f)=>{let y=0,x=0,C=0;for(let b=0;b<u.length;b++){let I=u[b],v=r*f*_[b]/2,P=e.x+c*I-l*v,M=e.y+l*I+c*v;if(b>0){let B=x-P,T=C-M;y+=Math.sqrt(B*B+T*T)}x=P,C=M}if(u.length){let b=x-t.x,I=C-t.y;y+=Math.sqrt(b*b+I*I)}return y},A=0,g=Math.min(h,n+s);if(m(g)-s<n)return null;for(let f=0;f<40;f++){let y=(A+g)/2;if(m(y)-s<n)A=y;else g=y}return p((A+g)/2)}function DVr(e,t,n,o,r,i,s){let a=Fn(e,t),c=a/r;if(a<=0||o<=0)return null;let l=(t.x-e.x)/a,h=(t.y-e.y)/a,d=c*c/(2*Math.PI*Math.PI*(s+n/2)),u=Math.max(64,Math.ceil(c/Math.max(0.005,s/6))),_=[],p=[],m=[];for(let x=0;x<=u*r;x++){let C=2*Math.PI*x/u;_.push(x*a/(u*r)),p.push(1-Math.cos(C)),m.push(Math.sin(C))}let A=(x)=>{let C=[[],[]];for(let b=0;b<_.length;b++){let I=_[b],v=i*x*p[b]/2,P=i*x*Math.PI/c*m[b],M=Math.hypot(1,P);for(let B=0;B<2;B++){let T=(B===0?1:-1)*n/2,N=I-T*P/M,D=v+T/M;C[B].push({x:e.x+l*N-h*D,y:e.y+h*N+l*D})}}return C},g=(x)=>{let C=[0,0],b=[0,0],I=[0,0];for(let v=0;v<_.length;v++){let P=_[v],M=i*x*p[v]/2,B=i*x*Math.PI/c*m[v],T=Math.hypot(1,B);for(let N=0;N<2;N++){let D=(N===0?1:-1)*n/2,L=P-D*B/T,H=M+D/T,V=e.x+l*L-h*H,O=e.y+h*L+l*H;if(v>0){let U=b[N]-V,j=I[N]-O;C[N]+=Math.sqrt(U*U+j*j)}b[N]=V,I[N]=O}}return Math.min(C[0]-a,C[1]-a)},f=0,y=Math.min(d,o+a);if(g(y)<o)return null;for(let x=0;x<40;x++){let C=(f+y)/2;if(g(C)<o)f=C;else y=C}return A((f+y)/2)}function Q3n(e,t,n,o,r,i,s){let a=Fn(e,t),c=a/r,l=s+n/2;if(o<=0||r<1||c<4*l)return null;let h=(t.x-e.x)/a,d=(t.y-e.y)/a,u=Math.max(18,Math.ceil(Math.PI*l/(2*Math.max(0.005,s/6)))),_=n===0?1:2,p=[];for(let C=0;C<r;C++)for(let[b,I,v,P]of[[0,0,-Math.PI/2,0],[2*l,1,Math.PI,Math.PI/2],[c-2*l,1,Math.PI/2,0],[c,0,Math.PI,Math.PI*1.5]])for(let M=0;M<=u;M++){let B=v+(P-v)*M/u,T=Math.sign(P-v),N=C*c+b+l*Math.cos(B),D=-Math.sin(B)*T,L=i*Math.cos(B)*T;for(let H=0;H<_;H++){let V=(H===0?1:-1)*n/2;p.push({px:N-L*V,sin:l*Math.sin(B),offsetY:D*V,raised:!!I,rail:H})}}let m=(C)=>{let b=[[],[]];for(let I of p){let v=I.raised?C-l:l,P=i*(v+I.sin)+I.offsetY,M={x:e.x+h*I.px-d*P,y:e.y+d*I.px+h*P},B=b[I.rail];if(!B.length||Fn(B.at(-1),M)>0.0000000001)B.push(M)}if(_===1)b[1]=b[0];return b},A=[p.filter((C)=>C.rail===0),p.filter((C)=>C.rail===1)],g=(C)=>{let b=1/0;for(let I=0;I<_;I++){let v=0,P=0,M=0,B=!0;for(let T of A[I]){let N=T.raised?C-l:l,D=i*(N+T.sin)+T.offsetY,L=e.x+h*T.px-d*D,H=e.y+d*T.px+h*D,V=v-L,O=P-H,U=Math.sqrt(V*V+O*O);if(B||U>0.0000000001){if(!B)M+=U;v=L,P=H,B=!1}}b=Math.min(b,M-a)}return b},f=2*l,y=g(f);if(y>o+0.00000001)return null;let x=f+Math.max(0,o-y)/(2*r);return x=Math.max(f,x+(o-g(x))/(2*r)),m(x)}function NVr(e,t,n,o,r,i){return Q3n(e,t,0,n,o,r,i)?.[0]??null}var RVr=class extends Error{constructor(e,t){super(`Insufficient tuning clearance for ${t.join(", ")}`);this.traces=e,this.unfinished=t}traces;unfinished};function JJ(e,t,n,o={}){let r=0,i=!1,s=sa(e);function*a(p,m,A=1){let g=e.connections.find((L)=>L.name===p.connection_name),f=p.coupledSection?(L)=>!0:Tue(e,p),y=p.route[0].width,x=Lf(e,g.name),C=Ar(p.route)+x,b=(n.get(g.name)-C)*A;if(b<0.00000001){yield p;return}let I=e.minTraceToPadEdgeClearance??e.defaultObstacleMargin??0.075,v=e.differentialPairs?.find((L)=>L.connectionNames.includes(p.connection_name)),P=v&&o.packageOnlyPairTuning?OY(e,y+(v.traceGap??I)/2+I):[],M=y+I,B=4*Math.max(y*1.2,I),T=p.route.slice(1).map((L,H)=>{let V=p.route[H],O=Fn(V,L),U={x:(V.x+L.x)/2,y:(V.y+L.y)/2},j=O>0.00000001?{x:-(L.y-V.y)/O,y:(L.x-V.x)/O}:{x:0,y:0},Y=2*Math.max(y*1.2,I),X=[-1,1].filter((K)=>m.visible(U,{x:U.x+K*j.x*Y,y:U.y+K*j.y*Y})).length;return{i:H,span:O,openSides:X}}).sort((L,H)=>H.openSides-L.openSides||H.span-L.span),N=i,D=0;for(let L of N?[!1]:[!1,!0])for(let{i:H}of T){if(p.curvedSegments?.includes(H+1))continue;if(p.coupledSection&&H>=p.coupledSection[0]&&H<p.coupledSection[1])continue;let V=p.route[H],O=p.route[H+1],U=Fn(V,O);if(U<0.01)continue;let j=(O.x-V.x)/U,Y=(O.y-V.y)/U,X=Math.floor(U*0.9/B),K=Math.min(X,o.packMeanders?X:Math.max(2,Math.ceil(b/(12*y)))),J=Array.from({length:X},(se,ne)=>ne+1).sort((se,ne)=>Math.abs(se-K)-Math.abs(ne-K)||ne-se);function*ee(){if(N){for(let se of[1,2,3])for(let ne of[0.9,0.65,0.4])for(let re of[0.5,0,1])yield{teeth:se,fraction:ne,position:re};return}for(let se of J)if(!L)for(let ne of[0.9,0.65,0.4])for(let re of[0.5,0,1])yield{teeth:se,fraction:ne,position:0.05+0.9*re};else{for(let ne of[0.9,0.65,0.4])for(let re of[0,1])yield{teeth:se,fraction:ne,position:re};for(let ne of[0.25,0.15,0.1])for(let re of[0.5,0.05,0.95,0,1])yield{teeth:se,fraction:ne,position:re}}}for(let{teeth:se,fraction:ne,position:re}of ee()){let Z=U*ne/se;if(!N&&Z<B)continue;for(let te of[1,-1])for(let ie of N?[BVr]:[NVr,TVr]){let ce=U*(1-ne)*re,ue={x:V.x+j*ce,y:V.y+Y*ce},de={x:ue.x+j*U*ne,y:ue.y+Y*U*ne};if(N){if(++D>Math.min(1024,o.maxCandidates??1024))return}if(!N&&++r>(o.maxCandidates??1/0)){if(o.packMeanders)return;throw Error("Smooth tuning candidate budget exhausted")}let me=ie(ue,de,b,se,te,Math.max(y*1.2,I));if(!me||P.length&&!P.some((Re)=>me.every((Me)=>by(Me,Re.copper))))continue;let ge=[V,...me,O];if(!m.pathVisible(ge))continue;let xe=(p.coupledSection?(Re)=>Re:W2)([...p.route.slice(0,H),...ge,...p.route.slice(H+2)]);if(Math.abs(Ar(xe)+x-(C+b))>0.000001)continue;if(!f(xe)||!Wc(xe,M))continue;let Ee={...p,coupledSection:p.coupledSection?p.coupledSection.map((Re)=>Re>H?Re+xe.length-p.route.length:Re):void 0,curvedSegments:xe.slice(1).flatMap((Re,Me)=>{let _e=Math.abs(Re.x-xe[Me].x),ye=Math.abs(Re.y-xe[Me].y);return Math.min(_e,ye)>0.00000001&&Math.abs(_e-ye)>0.00000001?[Me+1]:[]}),route:xe.map((Re)=>({...Re,route_type:"wire",layer:g.pointsToConnect[0].layer,width:y}))};if(xY([Ee]))yield Ee}}}}let c=[...t],l=t.map((p)=>n.get(p.connection_name)-Ar(p.route)-Lf(e,p.connection_name)),h=new Set(t.map((p,m)=>m).sort((p,m)=>{let A=o.priorityConnectionNames??[],g=(f)=>{let y=A.indexOf(t[f].connection_name);return y<0?1/0:y};return g(p)-g(m)||l[m]-l[p]})),d=new Map,u=!1,_=!0;while(h.size&&_){_=!1;for(let p of h){let m=e.connections.find((f)=>f.name===t[p].connection_name),A=new Mi(e,m,c[p].route[0].width,[...s,...c.flatMap(Jr)]),g=a(c[p],A).next().value;if(!g&&u&&(d.get(p)??0)<8){for(let f of[0.5,0.25])if(g=a(c[p],A,f).next().value,g){d.set(p,(d.get(p)??0)+1);break}}if(!g)continue;if(c[p]=g,Ar(g.route)+Lf(e,m.name)>=n.get(m.name)-0.00000001)h.delete(p);_=!0}if(!_&&!u)u=!0,_=!0;else if(!_&&!i&&o.packMeanders){i=!0,u=!1;for(let p of h)c[p]=t[p];d.clear(),_=!0}}if(h.size)throw new RVr(c,[...h].map((p)=>t[p].connection_name));return c}function QVr(e){if(e.length!==2||e.some((a)=>!a.coupledSection))return e;let t=e.map((a)=>a.coupledSection[1]),n=e.map((a,c)=>a.route[t[c]]),o=e.map((a,c)=>{let l=a.route[t[c]-1],h=n[c],d=Fn(l,h);return{x:(h.x-l.x)/d,y:(h.y-l.y)/d}});if(Fn(o[0],o[1])>0.0000001)return e;let r=o[0],i=e.map((a,c)=>{let l=0;for(let h=t[c]+1;h<a.route.length;h++){let d=a.route[h],u=d.x-n[c].x,_=d.y-n[c].y,p=u*r.x+_*r.y;if(Math.abs(u*r.y-_*r.x)>0.00000001||p<l)break;l=p}return l}),s=Math.min(...i);if(s<0.00000001)return e;return e.map((a,c)=>{let l={...n[c],x:n[c].x+r.x*s,y:n[c].y+r.y*s},h=t[c]+1;while(h<a.route.length){let d=a.route[h].x-n[c].x,u=a.route[h].y-n[c].y;if(Math.abs(d*r.y-u*r.x)>0.00000001||d*r.x+u*r.y>s+0.00000001)break;h++}return{...a,curvedSegments:a.curvedSegments?.filter((d)=>d<=t[c]||d>=h).map((d)=>d>=h?d-(h-t[c]-1):d),route:[...a.route.slice(0,t[c]),l,...a.route.slice(h)]}})}var vAn=new WeakMap;function kVr(e,t){let n=JSON.stringify([e,t]),o=vAn.get(e);if(!o||o.scene!==n)o={scene:n,alternatives:new Map},vAn.set(e,o);return{get(r){let i=o.alternatives.get(r);return i?structuredClone(i):void 0},set(r,i){if(o.alternatives.size>=512)o.alternatives.delete(o.alternatives.keys().next().value);o.alternatives.set(r,structuredClone(i))}}}var LVr=class{entries=[];sequence=0;get length(){return this.entries.length}values(){return this.entries.map((e)=>e.value)}before(e,t){return e.value.f<t.value.f||e.value.f===t.value.f&&e.sequence<t.sequence}push(e){let t={value:e,sequence:this.sequence++},n=this.entries.length;this.entries.push(t);while(n>0){let o=n-1>>1;if(!this.before(t,this.entries[o]))break;this.entries[n]=this.entries[o],n=o}this.entries[n]=t}pop(){let e=this.entries[0],t=this.entries.pop();if(this.entries.length){let n=0;while(n*2+1<this.entries.length){let o=n*2+1;if(o+1<this.entries.length&&this.before(this.entries[o+1],this.entries[o]))o++;if(!this.before(this.entries[o],t))break;this.entries[n]=this.entries[o],n=o}this.entries[n]=t}return e.value}};function pk(e,t){let n=t.x-e.x,o=t.y-e.y,r=Math.sign(n),i=Math.sign(o),s=Math.min(Math.abs(n),Math.abs(o));if(Math.min(Math.abs(n),Math.abs(o))<0.0000000001||Math.abs(Math.abs(n)-Math.abs(o))<0.0000000001)return[[e,t]];let a=(Math.max(Math.abs(n),Math.abs(o))-s)/2;return[Math.abs(n)>Math.abs(o)?[e,{x:e.x+r*a,y:e.y},{x:t.x-r*a,y:t.y},t]:[e,{x:e.x,y:e.y+i*a},{x:t.x,y:t.y-i*a},t],[e,{x:e.x+r*s,y:e.y+i*s},t],[e,{x:t.x-r*s,y:t.y-i*s},t],[e,{x:e.x,y:t.y},t],[e,{x:t.x,y:e.y},t]]}var ede=class{constructor(e,t,n){this.scene=e,this.start=t,this.end=n,this.vertices=[t,n],this.open.push({id:0,g:0,f:Fn(t,n)}),this.best.set(0,0)}scene;start;end;vertices;open=new LVr;best=new Map;expanded=0;failed=!1;solved=!1;result=[];geometryLoaded=!1;current;visibleEdges=[];step(){if(!this.geometryLoaded){this.geometryLoaded=!0;let n=Math.max(Math.abs(this.end.x-this.start.x),Math.abs(this.end.y-this.start.y))+(Math.SQRT2-1)*Math.min(Math.abs(this.end.x-this.start.x),Math.abs(this.end.y-this.start.y));for(let o of pk(this.start,this.end)){if(Ar(o)>n+0.000000001||!this.scene.pathVisible(o))continue;this.visibleEdges=[o],this.result=W2(o),this.solved=!0,this.expanded=1;return}this.vertices.push(...this.scene.vertices())}if(!this.open.length){this.failed=!0;return}let e=this.open.pop();if(e.g>(this.best.get(e.id)??1/0)+0.000000001)return;if(this.current=e,this.expanded++,this.visibleEdges=[],e.id===1){let n=[];for(let o=e;o?.parent;o=o.parent)n.push(o.edge);this.result=W2([this.start,...n.reverse().flatMap((o)=>o.slice(1))]),this.solved=!0;return}let t=this.vertices[e.id];for(let n=1;n<this.vertices.length;n++){if(n===e.id)continue;let o=this.vertices[n];if(e.g+Fn(t,o)>=(this.best.get(n)??1/0)-0.000000001)continue;let i=pk(t,o).sort((s,a)=>Ar(s)-Ar(a));for(let s of i){let a=e.g+Ar(s);if(a>=(this.best.get(n)??1/0)-0.000000001)continue;if(!this.scene.pathVisible(s))continue;if(this.best.set(n,a),this.open.push({id:n,g:a,f:a+Fn(o,this.end),parent:e,edge:s}),this.visibleEdges.length<100)this.visibleEdges.push(s);break}}}currentPath(){let e=[];for(let t=this.current;t?.parent;t=t.parent)e.push(t.edge);return[this.start,...e.reverse().flatMap((t)=>t.slice(1))]}};function Hf(e,t){let n=W2(e);for(let o=0;o<12;o++){let r=!1;for(let i=0;i<n.length-2;i++)for(let s=n.length-1;s>i+1;s--){let a=Ar(n.slice(i,s+1)),c=pk(n[i],n[s]).sort((h,d)=>Ar(h)-Ar(d)||h.length-d.length),l=!1;for(let h of c){if(Ar(h)>a+0.00000001||h.length>=s-i+1&&Ar(h)>=a-0.00000001||!t.pathVisible(h))continue;let d=W2([...n.slice(0,i),...h,...n.slice(s+1)]),u=t.width/2+t.margin;if(!Wc(d,u)&&Wc(n,u))continue;n=d,r=!0,l=!0;break}if(l)break}if(!r)break}return Wc(n,t.width/2+t.margin)?n:e}var HVr=class{labels=new Map;heap=[];sequence=0;get length(){return this.heap.length}clear(){this.labels.clear(),this.heap.length=0,this.sequence=0}dominated(e,t,n){return this.labels.get(e)?.some((o)=>o.cost<=t+0.0000000001&&o.travelled<=n+0.0000000001)??!1}add(e,t,n,o,r,i){if(this.dominated(e,t,n))return;let a=(this.labels.get(e)??[]).filter((h)=>{if(t<=h.cost+0.0000000001&&n<=h.travelled+0.0000000001)return h.active=!1,!1;return!0}),c={node:e,cost:t,travelled:n,priority:t+o,sequence:this.sequence++,parent:r,rootPath:i,active:!0};a.push(c),this.labels.set(e,a);let l=this.heap.length;this.heap.push(c);while(l>0){let h=l-1>>1;if(!this.before(c,this.heap[h]))break;this.heap[l]=this.heap[h],l=h}this.heap[l]=c}before(e,t){return e.priority<t.priority||e.priority===t.priority&&(e.cost>t.cost||e.cost===t.cost&&e.sequence<t.sequence)}pop(){while(this.heap.length){let e=this.heap[0],t=this.heap.pop();if(this.heap.length){let n=0;while(2*n+1<this.heap.length){let o=2*n+1;if(o+1<this.heap.length&&this.before(this.heap[o+1],this.heap[o]))o++;if(!this.before(this.heap[o],t))break;this.heap[n]=this.heap[o],n=o}this.heap[n]=t}if(e.active)return e}}},SAn=class{constructor(e,t){this.width=t;let n=[0],o=[0],r=[0],i=[1],s=(l)=>{while(r[l]!==l)r[l]=r[r[l]],l=r[l];return l},a=1,c=1;for(let l=0;l<e.length;l+=t){let h=Math.min(l+t,e.length),d=r.length,u=e.subarray(l,h),_=l,p=a;while(_<h){let m=u.indexOf(0,_-l);if(m<0)break;let A=l+m,g=u.indexOf(1,m),f=g<0?h:l+g,y=r.length;n.push(A),o.push(f),r.push(y);while(p<c&&o[p]+t<A)p++;for(let x=p;x<c&&n[x]+t<=f;x++){let C=s(y),b=s(x);if(C!==b)r[Math.max(C,b)]=Math.min(C,b)}_=f}a=d,c=r.length,i.push(c)}this.starts=Uint32Array.from(n),this.ends=Uint32Array.from(o),this.roots=Uint32Array.from(r.map((l,h)=>s(h))),this.rows=Uint32Array.from(i)}width;starts;ends;roots;rows;get storageBytes(){return this.starts.byteLength+this.ends.byteLength+this.roots.byteLength+this.rows.byteLength}at(e){let t=Math.floor(e/this.width),n=this.rows[t],o=this.rows[t+1];while(n<o){let r=n+o>>>1;if(e<this.starts[r])o=r;else if(e>=this.ends[r])n=r+1;else return this.roots[r]}return 0}},FVr=class{ids=new Int32Array(1024);costs=new Float64Array(1024);priorities=new Float64Array(1024);sequences=new Float64Array(1024);size=0;positions;constructor(e){this.positions=new Int32Array(e)}sequence=0;id=0;g=0;get length(){return this.size}get storageBytes(){return this.positions.byteLength+this.ids.byteLength+this.costs.byteLength+this.priorities.byteLength+this.sequences.byteLength}clear(){for(let e=0;e<this.size;e++)this.positions[this.ids[e]]=0;this.size=0,this.sequence=0,this.id=0,this.g=0}push(e,t,n){let o=this.sequence++,r=this.positions[e];if(r&&(n>this.priorities[r-1]||n===this.priorities[r-1]&&t<=this.costs[r-1])){this.sink(r-1,e,t,n,o);return}let i=r?r-1:this.size++;if(i===this.ids.length){let d=new Int32Array(i*2),u=new Float64Array(i*2),_=new Float64Array(i*2),p=new Float64Array(i*2);d.set(this.ids),u.set(this.costs),_.set(this.priorities),p.set(this.sequences),this.ids=d,this.costs=u,this.priorities=_,this.sequences=p}let{ids:s,positions:a,costs:c,priorities:l,sequences:h}=this;while(i>0){let d=i-1>>2,u=l[d];if(n>u||n===u&&(t<c[d]||t===c[d]&&o>=h[d]))break;s[i]=s[d],a[s[i]]=i+1,c[i]=c[d],l[i]=u,h[i]=h[d],i=d}s[i]=e,a[e]=i+1,c[i]=t,l[i]=n,h[i]=o}pop(){let{ids:e,positions:t,costs:n,priorities:o,sequences:r}=this;this.id=e[0],this.g=n[0],t[this.id]=0;let i=--this.size,s=e[i],a=n[i],c=o[i],l=r[i];if(!i)return;this.sink(0,s,a,c,l)}sink(e,t,n,o,r){let i=this.size,s=e,{ids:a,costs:c,priorities:l,sequences:h,positions:d}=this;while(e*4+1<i){let u=e*4+1,_=l[u],p=c[u],m=h[u],A=Math.min(u+4,i);for(let g=u+1;g<A;g++){let f=l[g];if(f<_||f===_&&(c[g]>p||c[g]===p&&h[g]<m))u=g,_=f,p=c[g],m=h[g]}a[e]=a[u],d[a[e]]=e+1,c[e]=p,l[e]=_,h[e]=m,e=u}while(e>s){let u=e-1>>2,_=l[u];if(o>_||o===_&&(n<c[u]||n===c[u]&&r>=h[u]))break;a[e]=a[u],d[a[e]]=e+1,c[e]=c[u],l[e]=_,h[e]=h[u],e=u}a[e]=t,d[t]=e+1,c[e]=n,l[e]=o,h[e]=r}},PAn=67108864,EAn=new WeakMap;function zVr(e){return e.best.byteLength+e.parent.byteLength+(e.travel?.byteLength??0)+e.heap.storageBytes}var OVr=class{available=new Map;retained=new Map;bytes=0;acquire(e,t){let n=this.available.get(e),o=n?.pop()??{cellCount:e,best:new Float64Array(e),parent:new Int32Array(e),heap:new FVr(e)};if(n&&!n.length)this.available.delete(e);let r=this.retained.get(o);if(r!==void 0)this.bytes-=r,this.retained.delete(o);if(o.best.fill(1/0),t&&!o.travel)o.travel=new Float64Array(e);let i=!0;return{scratch:o,release:()=>{if(!i)return;i=!1,this.retain(o)}}}retain(e){e.heap.clear();let t=zVr(e);if(t>PAn)return;while(this.bytes+t>PAn){let o=this.retained.keys().next().value;this.bytes-=this.retained.get(o),this.retained.delete(o);let r=this.available.get(o.cellCount);if(r.splice(r.indexOf(o),1),!r.length)this.available.delete(o.cellCount)}let n=this.available.get(e.cellCount)??[];n.push(e),this.available.set(e.cellCount,n),this.retained.set(e,t),this.bytes+=t}};function VVr(e,t,n){let o=EAn.get(e);if(!o)EAn.set(e,o=new OVr);return o.acquire(t,n)}var MAn=class{dense;sparse;storageBytes;minX;minY;maxX;maxY;width;constructor(e){this.minX=Math.floor(e.minX),this.minY=Math.floor(e.minY),this.maxX=Math.ceil(e.maxX)+1,this.maxY=Math.ceil(e.maxY)+1,this.width=this.maxX-this.minX+1;let t=this.width*(this.maxY-this.minY+1);if(t<=65536)this.dense=Array(t),this.storageBytes=t*8;else this.sparse=new Map,this.storageBytes=0}add(e,t,n){if(e<this.minX||e>this.maxX||t<this.minY||t>this.maxY)return;let o=e-this.minX+(t-this.minY)*this.width,r=this.dense?this.dense[o]:this.sparse.get(o);if(!r)if(r=[],this.dense)this.dense[o]=r;else this.sparse.set(o,r);if(r[r.length-1]!==n)r.push(n)}addCopper(e,t){let n=e.copper,o=(l,h,d,u)=>{for(let _=Math.floor(l);_<=Math.floor(h);_++)for(let p=Math.floor(d);p<=Math.floor(u);p++)this.add(_,p,e)};if(n.rect){o(e.minX,e.maxX,e.minY,e.maxY);return}let r=n.b.x-n.a.x,i=n.b.y-n.a.y,s=Math.max(1,Math.ceil(Math.max(Math.abs(r),Math.abs(i)))),a=n.radius+t+Math.abs(r)/(2*s)+0.000000001,c=n.radius+t+Math.abs(i)/(2*s)+0.000000001;for(let l=0;l<=s;l++){let h=n.a.x+r*l/s,d=n.a.y+i*l/s;o(h-a,h+a,d-c,d+c)}}get(e,t){if(e<this.minX||e>this.maxX||t<this.minY||t>this.maxY)return;let n=e-this.minX+(t-this.minY)*this.width;return this.dense?this.dense[n]:this.sparse.get(n)}*values(){if(this.dense){for(let e of this.dense)if(e)yield e}else yield*this.sparse.values()}},wAn=new WeakMap,Utt=16777216,BAn=new Uint8Array(0),TAn=new WeakMap,Wtt=67108864;function DAn(e,t){let n=e.rect??{minX:Math.min(e.a.x,e.b.x)-e.radius,maxX:Math.max(e.a.x,e.b.x)+e.radius,minY:Math.min(e.a.y,e.b.y)-e.radius,maxY:Math.max(e.a.y,e.b.y)+e.radius};return{...MVr({...e,a:{...e.a},b:{...e.b},rect:e.rect?{...e.rect}:void 0}),minX:n.minX-t,maxX:n.maxX+t,minY:n.minY-t,maxY:n.maxY+t}}function YVr(e,t){let n=e.input,o=n.bounds,r=e.connection.pointsToConnect[0].layer,i=sa(n).filter((m)=>m.layer===r),s=n.connections.flatMap((m)=>m.pointsToConnect);for(let m of i)if(m.rect)s.push({x:m.rect.minX,y:m.rect.minY,layer:r},{x:m.rect.maxX,y:m.rect.maxY,layer:r});else s.push({x:Math.min(m.a.x,m.b.x)-m.radius,y:Math.min(m.a.y,m.b.y)-m.radius,layer:r},{x:Math.max(m.a.x,m.b.x)+m.radius,y:Math.max(m.a.y,m.b.y)+m.radius,layer:r});let a=Math.min(...s.map((m)=>m.x)),c=Math.max(...s.map((m)=>m.x)),l=Math.min(...s.map((m)=>m.y)),h=Math.max(...s.map((m)=>m.y)),d=n.minTraceWidth+(n.minTraceToPadEdgeClearance??n.defaultObstacleMargin??0.075),u=Math.max(2,n.connections.length*d,Math.min(c-a,h-l)/2),_=(m,A)=>A+Math.floor((m-A)/t)*t,p=(m,A)=>A+Math.ceil((m-A)/t)*t;return{minX:Math.max(o.minX,_(a-u,o.minX)),maxX:Math.min(o.maxX,p(c+u,o.minX)),minY:Math.max(o.minY,_(l-u,o.minY)),maxY:Math.min(o.maxY,p(h+u,o.minY))}}var ost=class{constructor(e,t){this.scene=e,this.packageGrid=e.input.obstacles.some((o)=>o.componentId),this.stepSize=Math.max(0.01,t?.step??e.input.minTraceWidth/(this.packageGrid?2:1));let n=t?.bounds??(this.packageGrid?YVr(e,this.stepSize):e.input.bounds);if(this.gridBounds=n,this.origin={x:n.minX,y:n.minY},this.nx=Math.ceil((n.maxX-n.minX)/this.stepSize)+1,this.ny=Math.ceil((n.maxY-n.minY)/this.stepSize)+1,this.xs=Float64Array.from({length:this.nx},(o,r)=>this.origin.x+r*this.stepSize),this.ys=Float64Array.from({length:this.ny},(o,r)=>this.origin.y+r*this.stepSize),this.cellCount>8000000)throw Error("Dense grid search budget exceeded")}scene;packageGrid;gridBounds;nx;ny;stepSize;origin;xs;ys;get cellCount(){return this.nx*this.ny}penalizeIntersection(e,t,n,o,r,i,s=!1){let a=new Set,c=new Set;for(let[l,h]of[[t,n],[o,r]]){let d=s?new Set:c,u=Math.max(1,Math.ceil(Fn(l,h)/this.stepSize));for(let _=0;_<=u;_++){let p={x:l.x+(h.x-l.x)*_/u,y:l.y+(h.y-l.y)*_/u},m=Math.round((p.x-this.origin.x)/this.stepSize),A=Math.round((p.y-this.origin.y)/this.stepSize),g=Math.ceil(i/this.stepSize);for(let f=-g;f<=g;f++)for(let y=-g;y<=g;y++){if(m+y<0||m+y>=this.nx||A+f<0||A+f>=this.ny)continue;let x=m+y+(A+f)*this.nx;if(a.has(x)||d.has(x))continue;d.add(x);let C=this.point(x);if(mB([C,C],[l,h])>i)continue;if(!s&&(mB([C,C],[t,n])>i||mB([C,C],[o,r])>i))continue;a.add(x)}}}for(let l of a)e[l]+=s?0.3:1}point(e){return{x:this.xs[e%this.nx],y:this.ys[Math.floor(e/this.nx)]}}},al=class extends ost{constructor(e,t,n,o=[],r=4,i,s){super(e,s);this.start=t,this.end=n,this.penalty=r,this.history=i;let a=this.gridBounds;this.softMargin=e.margin,this.hasSoftCopper=o.some((I)=>I.layer===e.connection.pointsToConnect[0].layer),this.copperBuckets=new MAn(a),this.neighbors=[];for(let I=-1;I<=1;I++)for(let v=-1;v<=1;v++){if(!(v||I))continue;let P=(I+1)*3+v+1,M=P>4?P-1:P;this.neighbors.push({dx:v,dy:I,offset:v+I*this.nx,cost:v&&I?Math.SQRT2:1,bit:1<<M,reverse:1<<7-M})}let c=s?.ends??[n];this.goalBounds={minX:Math.min(...c.map((I)=>I.x)),maxX:Math.max(...c.map((I)=>I.x)),minY:Math.min(...c.map((I)=>I.y)),maxY:Math.max(...c.map((I)=>I.y))},this.hx=this.xs.map((I)=>Math.max(this.goalBounds.minX-I,I-this.goalBounds.maxX,0)/this.stepSize),this.hy=this.ys.map((I)=>Math.max(this.goalBounds.minY-I,I-this.goalBounds.maxY,0)/this.stepSize);let l=this.nx*this.ny,h=TAn.get(e.input)??new Map;TAn.set(e.input,h);let d=JSON.stringify([a.minX,a.minY,a.maxX,a.maxY,this.nx,this.ny,this.stepSize,e.margin,e.width,e.input.minBoardEdgeClearance,e.input.bounds,e.copper.map((I)=>[I.a.x,I.a.y,I.b.x,I.b.y,I.radius,I.rect])]),u=h.get(d),_=u?.attachments??new Map;if(u)h.delete(d),h.set(d,u);if(this.blocked=u?.blocked??new Uint8Array(l),this.hardEdgeKnown=u?.edgeKnown??new Uint8Array(l),this.hardEdgeBlocked=u?.edgeBlocked??new Uint8Array(l),u)this.copperBuckets=u.buckets;if(this.maxLength=s?.maxLength??1/0,s?.paretoLength&&Number.isFinite(this.maxLength))this.lengthFrontier=new HVr;let p=u?.components;if(!u){let I=new Uint32Array(l),v=0,P=(B,T,N,D,L)=>{let H=L.copper,V=Math.max(0,Math.floor((B-a.minX)/this.stepSize)),O=Math.min(this.nx-1,Math.ceil((T-a.minX)/this.stepSize)),U=Math.max(0,Math.floor((N-a.minY)/this.stepSize)),j=Math.min(this.ny-1,Math.ceil((D-a.minY)/this.stepSize)),Y=!H.rect&&H.a.x===H.b.x&&H.a.y===H.b.y,X=e.margin-0.00000001;for(let K=U;K<=j;K++){let J=this.ys[K],ee=J-H.a.y,se=K*this.nx;for(let ne=V;ne<=O;ne++){let re=ne+se;if(this.blocked[re]||I[re]===v)continue;if(I[re]=v,Y){let Z=this.xs[ne]-H.a.x;if(Math.sqrt(Z*Z+ee*ee)-H.radius<X)this.blocked[re]=1}else if(IAn(this.xs[ne],J,this.xs[ne],J,0,0,0,L,X))this.blocked[re]=1}}};for(let B of e.copper){v++;let T=DAn(B,e.margin),N=e.margin+B.radius;if(this.copperBuckets.addCopper(T,e.margin),B.rect){let H=B.rect;P(H.minX-N,H.maxX+N,H.minY-N,H.maxY+N,T);continue}let D=Fn(B.a,B.b),L=Math.max(1,Math.ceil(D/this.stepSize));for(let H=0;H<=L;H++){let V={x:B.a.x+(B.b.x-B.a.x)*H/L,y:B.a.y+(B.b.y-B.a.y)*H/L};P(V.x-N,V.x+N,V.y-N,V.y+N,T)}}p=s?.checkReachability?new SAn(this.blocked,this.nx):void 0;let M=(p?.storageBytes??0)+l*3+this.copperBuckets.storageBytes+d.length*2+[...this.copperBuckets.values()].reduce((B,T)=>B+T.length*8+64,0)+e.copper.length*136;if(M<=Wtt){let B=[...h.values()].reduce((T,N)=>T+N.bytes,0);while(B+M>Wtt&&h.size){let T=h.keys().next().value;B-=h.get(T).bytes,h.delete(T)}u={attachments:_,blocked:this.blocked,edgeKnown:this.hardEdgeKnown,edgeBlocked:this.hardEdgeBlocked,buckets:this.copperBuckets,bytes:M,components:p},h.set(d,u)}}if(s?.checkReachability&&!p){if(p=new SAn(this.blocked,this.nx),u){u.components=p,u.bytes+=p.storageBytes;let I=[...h.values()].reduce((v,P)=>v+P.bytes,0);while(I>Wtt&&h.size){let v=h.keys().next().value;I-=h.get(v).bytes,h.delete(v)}}}if(this.hasSoftCopper){this.softBuckets=new MAn(a);let I=JSON.stringify([a.minX,a.minY,a.maxX,a.maxY,this.nx,this.ny,this.stepSize,this.softMargin,e.connection.pointsToConnect[0].layer]),v=wAn.get(e.input)??new Map;wAn.set(e.input,v);let P=v.get(I),M=new Map;for(let N of o){if(N.layer!==e.connection.pointsToConnect[0].layer)continue;let D=JSON.stringify([N.a.x,N.a.y,N.b.x,N.b.y,N.radius,N.rect]),L=P?.copper.get(D)??DAn(N,this.softMargin);this.softBuckets.addCopper(L,this.softMargin),M.set(D,L)}let B=l*2+I.length*2+[...M.keys()].reduce((N,D)=>N+D.length*2+136,0),T=P&&!P.lease.active&&B<=Utt?P:void 0;if(this.softEdgeKnown=T?.edgeKnown??new Uint8Array(l),this.softEdgeBlocked=T?.edgeBlocked??new Uint8Array(l),T){let N=(L,H,V,O)=>{let U=Math.max(0,Math.floor((L-a.minX)/this.stepSize)),j=Math.min(this.nx-1,Math.ceil((H-a.minX)/this.stepSize)),Y=Math.max(0,Math.floor((V-a.minY)/this.stepSize)),X=Math.min(this.ny-1,Math.ceil((O-a.minY)/this.stepSize));if(j<U)return;for(let K=Y;K<=X;K++){let J=K*this.nx;this.softEdgeKnown.fill(0,J+U,J+j+1),this.softEdgeBlocked.fill(0,J+U,J+j+1)}},D=(L)=>{let H=this.stepSize+0.000000001;if(L.copper.rect){N(L.minX-H,L.maxX+H,L.minY-H,L.maxY+H);return}let V=L.copper.radius+this.softMargin+H,O=Math.max(0,Math.floor((Math.min(L.ay,L.by)-V-a.minY)/this.stepSize)),U=Math.min(this.ny-1,Math.ceil((Math.max(L.ay,L.by)+V-a.minY)/this.stepSize));for(let j=O;j<=U;j++){let Y=0,X=1;if(L.dy===0){if(Math.abs(this.ys[j]-L.ay)>V)continue}else{let re=(this.ys[j]-V-L.ay)/L.dy,Z=(this.ys[j]+V-L.ay)/L.dy;if(Y=Math.max(0,Math.min(re,Z)),X=Math.min(1,Math.max(re,Z)),Y>X)continue}let K=L.ax+L.dx*Y,J=L.ax+L.dx*X,ee=Math.max(0,Math.floor((Math.min(K,J)-V-a.minX)/this.stepSize)),se=Math.min(this.nx-1,Math.ceil((Math.max(K,J)+V-a.minX)/this.stepSize));if(se<ee)continue;let ne=j*this.nx;this.softEdgeKnown.fill(0,ne+ee,ne+se+1),this.softEdgeBlocked.fill(0,ne+ee,ne+se+1)}};for(let[L,H]of T.copper)if(!M.has(L))D(H);for(let[L,H]of M)if(!T.copper.has(L))D(H)}if(B<=Utt){if(P)v.delete(I);let N=[...v.values()].reduce((D,L)=>D+L.bytes,0);while(N+B>Utt&&v.size){let D=v.keys().next().value;N-=v.get(D).bytes,v.delete(D)}this.softMemoLease={active:!0},v.set(I,{edgeKnown:this.softEdgeKnown,edgeBlocked:this.softEdgeBlocked,copper:M,lease:this.softMemoLease,bytes:B})}}let m=(I)=>{let v=JSON.stringify(I);if(_.has(v))return structuredClone(_.get(v));let P=Math.round((I.x-a.minX)/this.stepSize),M=Math.round((I.y-a.minY)/this.stepSize),B=[];for(let N=-4;N<=4;N++)for(let D=-4;D<=4;D++){if(P+D<0||P+D>=this.nx||M+N<0||M+N>=this.ny)continue;let L=P+D+(M+N)*this.nx;if(this.blocked[L])continue;for(let H of pk(I,this.point(L)))if(e.pathVisible(H)){B.push({id:L,path:H});break}}let T=B.sort((N,D)=>Ar(N.path)-Ar(D.path)||N.id-D.id).slice(0,8);if(_.size>=128)_.delete(_.keys().next().value);return _.set(v,structuredClone(T)),T},A=(I)=>{let v=new Map;for(let P of I.sort((M,B)=>Ar(M.path)-Ar(B.path)))if(!v.has(P.id))v.set(P.id,P);return[...v.values()]};this.startAttachments=s?.starts?A(s.starts.flatMap((I)=>s.nearestTerminalAttachments?m(I).slice(0,1):m(I))):m(t),this.endAttachments=s?.ends?A(c.flatMap((I)=>s.nearestTerminalAttachments?m(I).slice(0,1):m(I))):m(n);let g=this.startAttachments[0],f=this.endAttachments[0];if(!g||!f){if(this.failed=!0,this.softMemoLease)this.softMemoLease.active=!1;return}let y=p,x=(I,v)=>I.some((P)=>v.some((M)=>y.at(P.id)!==0&&y.at(P.id)===y.at(M.id))),C=!1;if(s?.checkReachability&&!x([g],[f])){if(!x(this.startAttachments,this.endAttachments)){if(this.failed=!0,this.softMemoLease)this.softMemoLease.active=!1;return}C=!0}this.scratchLease=VVr(e.input,l,Number.isFinite(this.maxLength));let b=this.scratchLease.scratch;if(this.heap=b.heap,this.best=b.best,this.parent=b.parent,this.travel=Number.isFinite(this.maxLength)?b.travel:void 0,this.startPath=g.path,this.endPath=f.path.toReversed(),this.goal=f.id,this.best[g.id]=0,this.parent[g.id]=-1,this.travel)this.travel[g.id]=Ar(g.path);if(this.lengthFrontier)this.lengthFrontier.add(g.id,0,Ar(g.path),this.heuristic(t),void 0,g.path);else this.heap.push(g.id,0,this.heuristic(t));if(C||s?.allTerminalAttachments||s?.starts||s?.ends)this.retryAttachments()}start;end;penalty;history;expanded=0;failed=!1;solved=!1;result=[];heap;lengthFrontier;scratchLease;neighbors;travel;maxLength=1/0;best;parent;blocked;softMargin;softBuckets;hasSoftCopper;softEdgeKnown=BAn;softMemoLease;softEdgeBlocked=BAn;hardEdgeKnown;hardEdgeBlocked;copperBuckets;goal=-1;startPath=[];endPath=[];startAttachments=[];endAttachments=[];alternateAttachments=!1;rootPaths=new Map;goalPaths=new Map;attachmentResult;goalBounds;hx;hy;retryAttachments(){if(this.alternateAttachments||this.startAttachments.length<=1&&this.endAttachments.length<=1)return!1;this.alternateAttachments=!0,this.heap.clear(),this.lengthFrontier?.clear(),this.best.fill(1/0);for(let e of this.startAttachments){let t=Ar(e.path);if(t>this.maxLength+0.00000001)continue;let n=t/this.stepSize;if(this.best[e.id]=n,this.parent[e.id]=-1,this.travel)this.travel[e.id]=t;if(this.rootPaths.set(e.id,e.path),this.lengthFrontier)this.lengthFrontier.add(e.id,n,t,this.heuristic(this.point(e.id)),void 0,e.path);else this.heap.push(e.id,n,n+this.heuristic(this.point(e.id)))}for(let e of this.endAttachments)this.goalPaths.set(e.id,e.path.toReversed());return!0}pathTo(e,t,n){if(n){let i=[],s=n;for(let a=n;a;a=a.parent)s=a,i.push(this.point(a.node));return W2([...s.rootPath,...i.reverse().slice(1),...t.slice(1)])}let o=[],r=e;for(let i=e;i>=0;i=this.parent[i])r=i,o.push(this.point(i));return W2([...this.alternateAttachments?this.rootPaths.get(r):this.startPath,...o.reverse().slice(1),...t.slice(1)])}finish(e){if(this.result=e,this.solved=!0,this.softMemoLease)this.softMemoLease.active=!1;this.scratchLease?.release(),this.lengthFrontier?.clear()}edgeClear(e,t,n,o,r,i=this.scene.margin){if(!r)return!0;let s=Math.min(e,n),a=Math.max(e,n),c=Math.min(t,o),l=Math.max(t,o),h=n-e,d=o-t,u=h*h+d*d,_=i-0.00000001,p=Math.floor(a),m=Math.floor(l);for(let A=Math.floor(s);A<=p;A++)for(let g=Math.floor(c);g<=m;g++){let f=r.get(A,g);if(!f)continue;for(let y=0;y<f.length;y++){let x=f[y];if(x.minX>a||x.maxX<s||x.minY>l||x.maxY<c)continue;if(IAn(e,t,n,o,h,d,u,x,_))return!1}}return!0}heuristic(e){let t=Math.max(this.goalBounds.minX-e.x,e.x-this.goalBounds.maxX,0)/this.stepSize,n=Math.max(this.goalBounds.minY-e.y,e.y-this.goalBounds.maxY,0)/this.stepSize;return Math.max(t,n)+(Math.SQRT2-1)*Math.min(t,n)}cancel(){if(!this.solved)this.failed=!0;if(this.softMemoLease)this.softMemoLease.active=!1;this.scratchLease?.release(),this.lengthFrontier?.clear()}step(){let{heap:e,lengthFrontier:t,best:n,parent:o,blocked:r,nx:i,ny:s,xs:a,ys:c,hx:l,hy:h,history:d,travel:u,stepSize:_,maxLength:p,penalty:m,hasSoftCopper:A,softEdgeKnown:g,softEdgeBlocked:f,hardEdgeKnown:y,hardEdgeBlocked:x,softBuckets:C,copperBuckets:b,softMargin:I}=this,v=this.scene.input.bounds,P=this.scene.width/2+(this.scene.input.minBoardEdgeClearance??0),M=v.minX+P,B=v.maxX-P,T=v.minY+P,N=v.maxY-P;for(let D=0;D<500&&!this.failed&&!this.solved;D++){if(!(t?.length??e.length)){if(this.attachmentResult){this.finish(this.attachmentResult.path);return}if(this.retryAttachments())continue;if(this.failed=!0,this.softMemoLease)this.softMemoLease.active=!1;this.scratchLease?.release(),this.lengthFrontier?.clear();return}let L=t?.pop();if(t&&!L)continue;if(!t)e.pop();let H=L?.node??e.id,V=L?.cost??e.g;if(!t&&V!==n[H])continue;if(this.expanded++,this.attachmentResult&&V+this.heuristic(this.point(H))>=this.attachmentResult.score){this.finish(this.attachmentResult.path);return}let O=this.alternateAttachments?this.goalPaths.get(H):H===this.goal?this.endPath:void 0;if(O){let Y=this.pathTo(H,O,L);if(Ar(Y)>p+0.00000001||!this.scene.pathVisible(Y)){if(!this.alternateAttachments&&!t){if(this.retryAttachments())continue;if(this.failed=!0,this.softMemoLease)this.softMemoLease.active=!1;this.scratchLease?.release(),this.lengthFrontier?.clear();return}}else if(this.alternateAttachments){let X=V+Ar(O)/_;if(!this.attachmentResult||X<this.attachmentResult.score)this.attachmentResult={score:X,path:Y}}else{this.finish(Y);return}}let U=H%i,j=Math.floor(H/i);for(let{dx:Y,dy:X,offset:K,cost:J,bit:ee,reverse:se}of this.neighbors){if(U+Y<0||U+Y>=i||j+X<0||j+X>=s)continue;let ne=H+K;if(r[ne])continue;let re=V+J+0+(d?.[ne]??0);if(!t&&m>=0&&re>=n[ne]-0.0000000001)continue;let Z=l[U+Y],te=h[j+X],ie=Math.max(Z,te)+(Math.SQRT2-1)*Math.min(Z,te),ce=(L?.travelled??u?.[H]??0)+J*_;if(u&&ce+ie*_>p+0.00000001)continue;if(t&&m>=0&&t.dominated(ne,re,ce))continue;let ue=a[U+Y],de=c[j+X];if(ue<M||ue>B||de<T||de>N)continue;let me=0;if(A){if(!(g[H]&ee)){if(g[H]|=ee,g[ne]|=se,!this.edgeClear(a[U],c[j],ue,de,C,I))f[H]|=ee,f[ne]|=se}me=f[H]&ee?m:0}let ge=V+J+me+(d?.[ne]??0);if(t?t.dominated(ne,ge,ce):ge>=n[ne]-0.0000000001)continue;if(!(y[H]&ee)){if(y[H]|=ee,y[ne]|=se,!this.edgeClear(a[U],c[j],ue,de,b))x[H]|=ee,x[ne]|=se}if(x[H]&ee)continue;if(t)t.add(ne,ge,ce,ie,L);else{if(n[ne]=ge,u)u[ne]=ce;o[ne]=H,e.push(ne,ge,ge+ie)}}}}};function wA(e,t){let n=e.slice(1).map((o,r)=>{let i=e[r],s=Fn(i,o);return{x:-(o.y-i.y)/s,y:(o.x-i.x)/s}});return e.map((o,r)=>{let i=n[Math.max(0,r-1)],s=n[Math.min(n.length-1,r)],a=1+i.x*s.x+i.y*s.y;if(a<0.00001)throw Error("Pair centerline reverses direction");return{x:o.x+t*(i.x+s.x)/a,y:o.y+t*(i.y+s.y)/a}})}function*zk(e,t,n,o){let r=t.connectionNames.map((Y)=>e.connections.find((X)=>X.name===Y));if(r.some((Y)=>!Y||Y.pointsToConnect.length!==2))throw Error("Pair requires two two-terminal connections");let i=r.map((Y)=>(e.buses??[]).find((X)=>X.connectionNames.includes(Y.name))?.traceWidth??Y.nominalTraceWidth??Y.width??e.minTraceWidth);if(Math.abs(i[0]-i[1])>0.00000001)throw Error("Coupled pair requires equal trace widths");let s=i[0],a=t.traceGap??e.minTraceToPadEdgeClearance??e.defaultObstacleMargin??0.075,c=r.map((Y)=>Lf(e,Y.name)),l=(Y,X)=>{let K=!1;for(let J=0,ee=X.length-1;J<X.length;ee=J++){let se=X[J],ne=X[ee];if(se.y>Y.y!==ne.y>Y.y&&Y.x<(ne.x-se.x)*(Y.y-se.y)/(ne.y-se.y)+se.x)K=!K}return K},h=r[0].pointsToConnect[0].layer;if(r.some((Y)=>Y.pointsToConnect.some((X)=>X.layer!==h)))throw Error("Pair requires a common signal layer");let d=e.minTraceToPadEdgeClearance??e.defaultObstacleMargin??0.075;if(a<d-0.00000001)throw Error("Pair gap is below trace clearance");let u=[0,1].map((Y)=>({x:(r[0].pointsToConnect[Y].x+r[1].pointsToConnect[Y].x)/2,y:(r[0].pointsToConnect[Y].y+r[1].pointsToConnect[Y].y)/2})),_=Math.abs(u[1].y-u[0].y)>=Math.abs(u[1].x-u[0].x),p=_?"y":"x",m=_?"x":"y",A=Math.sign(u[1][p]-u[0][p])||1,g=r.map((Y)=>(e.obstacles??[]).filter((X)=>X.componentId&&X.connectedTo.includes(Y.name))),f=(e.buses??[]).some((Y)=>t.connectionNames.some((X)=>Y.connectionNames.includes(X))),y=u.map((Y,X)=>{let K=g.flat().filter((me)=>Math.abs(me.center[p]-Y[p])<Math.abs(u[1][p]-u[0][p])/2),J=new Set(K.map((me)=>me.componentId)),ee=e.obstacles.filter((me)=>me.componentId&&J.has(me.componentId)),se=X===0?A:-A,ne=ee.length?se>0?Math.max(...ee.map((me)=>me.center[p]+(_?me.height:me.width)/2)):Math.min(...ee.map((me)=>me.center[p]-(_?me.height:me.width)/2)):Y[p],re=2*s+a+d,Z={...Y,[p]:ne+se*re};if(!ee.length)return[Z];let te=Math.min(...ee.map((me)=>me.center.x-me.width/2))-re,ie=Math.max(...ee.map((me)=>me.center.x+me.width/2))+re,ce=Math.min(...ee.map((me)=>me.center.y-me.height/2))-re,ue=Math.max(...ee.map((me)=>me.center.y+me.height/2))+re;return[f?Z:X===0?{...Z,[p]:Z[p]+se*Math.max(4*s,Fn(r[0].pointsToConnect[X],r[1].pointsToConnect[X]))}:{...Z,[m]:_?(te+ie)/2:(ue+ce)/2},Z,{x:te,y:Y.y},{x:ie,y:Y.y},{x:Y.x,y:ce},{x:Y.x,y:ue}]}),x=(e.buses??[]).filter((Y)=>e.connections.some((X)=>Y.connectionNames.includes(X.name)&&X.pointsToConnect[0].layer===h));if(!f&&x.length){let Y=e.obstacles.filter((X)=>X.componentId);if(Y.length){let X=Math.max(...x.map((se)=>se.connectionNames.length))*(s+d),K=(se)=>{let ne=(se.ccwRotationDegrees??0)*Math.PI/180;return(_?Math.abs(Math.cos(ne))*se.width+Math.abs(Math.sin(ne))*se.height:Math.abs(Math.sin(ne))*se.width+Math.abs(Math.cos(ne))*se.height)/2},J=Math.min(...Y.map((se)=>se.center[m]-K(se)))-X-s-a-d,ee=Math.max(...Y.map((se)=>se.center[m]+K(se)))+X+s+a+d;for(let se=0;se<2;se++)y[se].push({...u[se],[m]:J},{...u[se],[m]:ee})}}let C=new Set((e.buses??[]).filter((Y)=>t.connectionNames.some((X)=>Y.connectionNames.includes(X))).flatMap((Y)=>Y.connectionNames)),b=e.connections.filter((Y)=>C.has(Y.name));if(b.length>2&&g.some((Y)=>Y.length)){let Y=b.length*(s+d),X=u[1][m]-u[0][m],K=Math.abs(X)<0.00000001?A:Math.sign(X),J=b.flatMap((se)=>se.pointsToConnect.map((ne)=>ne[m])),ee=(K>0?Math.max(...J):Math.min(...J))+K*(Y+2*s+a+d);for(let se=0;se<2;se++){let ne=y[se][0];if(y[se].unshift({...y[se][0],[p]:y[se][0][p]+(se===0?A:-A)*Y,[m]:ee}),se===0)y[se].unshift({...ne,[p]:ne[p]+A*Y/2})}}for(let Y=0;Y<2;Y++){y[Y]=y[Y].filter((K,J,ee)=>ee.findIndex((se)=>Fn(K,se)<0.00000001)===J);let X=(K)=>2*Fn(K,u[Y])+Fn(K,u[1-Y]);y[Y].sort((K,J)=>X(K)-X(J))}let I=o?.variant??0,v=I%y[0].length,P=o?.handoffOffsets??[v,v+Math.floor(I/y[0].length)];for(let Y=0;Y<2;Y++){let X=P[Y]%y[Y].length;y[Y]=[...y[Y].slice(X),...y[Y].slice(0,X)]}let M=new Set(r.flatMap((Y)=>[Y.name,Y.source_trace_id??Y.name])),B=n.filter((Y)=>!Y.owners.some((X)=>M.has(X))),T=2*s+a,N=(Y,X,K=!1)=>({type:"pcb_trace",pcb_trace_id:`bus_lane_${Y.name}`,connection_name:Y.name,source_trace_id:Y.source_trace_id??Y.name,route:(K?X:W2(X)).map((J)=>({...J,route_type:"wire",layer:h,width:s}))}),D=null,L=1/0,H=0,V=new Map,O=g.some((Y)=>Y.length>0),U=(O?[s/2,s/10]:[void 0]).flatMap((Y)=>y[0].map((X)=>({point:X,approachStep:Y}))),j=o&&!o.copper.length&&!o.penalty&&!o.history?kVr(e,n):void 0;for(let{point:Y,approachStep:X}of U)for(let K of y[1])e:for(let J of[0,-1,1,-2,2]){let ee=[Y,K].map((Ee)=>({...Ee,[m]:Ee[m]+J*T})),se=JSON.stringify([t,h,s,a,X,ee]),ne=j?.get(se);if(ne){if(ne.traces&&ne.score<L)L=ne.score,D=ne.traces;if(ne.hasMatchedAlternative)return D;if(ne.countsAttempt&&D&&++H>=4)return D;continue}let re=null,Z=1/0,te={name:"pair_corridor",pointsToConnect:ee.map((Ee)=>({...Ee,layer:h}))},ie=new Mi(e,te,T,B),ce=o?new Mi(e,te,T,[...B,...o.copper]):ie,ue=pk(ee[0],ee[1]).find((Ee)=>ce.pathVisible(Ee)),de=ue?{solved:!0,failed:!1,expanded:0,result:ue,step(){}}:O||e.connections.length>12?new al(ie,ee[0],ee[1],o?.copper,o?.penalty,o?.history):new ede(ie,ee[0],ee[1]);try{while(!de.solved&&!de.failed&&de.expanded<(de instanceof al?500000:1000))de.step(),yield}finally{if(de instanceof al)de.cancel()}if(!de.solved){j?.set(se,{traces:null,score:1/0,hasMatchedAlternative:!1,countsAttempt:!1});continue}let me=Hf(de.result,ce);if(me.length<2||me.some((Ee,Re)=>{if(!Re)return!1;let Me=me[Re-1],_e=Fn(Me,Ee);if(_e<0.00000001)return!0;if(Re<2)return!1;let ye=me[Re-2],Se=Fn(ye,Me);return 1+((Me.x-ye.x)*(Ee.x-Me.x)+(Me.y-ye.y)*(Ee.y-Me.y))/(Se*_e)<0.00001})){j?.set(se,{traces:null,score:1/0,hasMatchedAlternative:!1,countsAttempt:!1});continue}let ge=[wA(me,(s+a)/2),wA(me,-(s+a)/2)],xe=[!1,!0].sort((Ee,Re)=>{let Me=(_e)=>r.reduce((ye,Se,Ne)=>{let Le=ge[_e?1-Ne:Ne];return ye+Fn(Se.pointsToConnect[0],Le[0])+Fn(Se.pointsToConnect[1],Le.at(-1))},0);return Me(Ee)-Me(Re)});for(let Ee of xe){let Re=Ee?ge.toReversed():ge,Me=r.map((_e,ye)=>N(_e,Re[ye]));for(let _e of[[[0,1],[0,1]],[[0,1],[1,0]],[[1,0],[0,1]],[[1,0],[1,0]]]){let ye=[[],[]],Se=!1;for(let Bt=0;Bt<2;Bt++)for(let xt of _e[Bt]){let Yt=r[xt],ut=Re[xt][Bt===0?0:Re[xt].length-1],Ze=Yt.pointsToConnect[Bt],Fe=e,tt=Bt===0?Re[xt]:Re[xt].toReversed(),Je=4*s,$e=[];for(let Nt=1;Nt<tt.length;Nt++){let Ot=tt[Nt-1],Ut=tt[Nt],mn=Fn(Ot,Ut);if(Je>=mn){Je-=mn;continue}$e.push({a:{x:Ot.x+(Ut.x-Ot.x)*Je/mn,y:Ot.y+(Ut.y-Ot.y)*Je/mn},b:Ut,radius:s/2,layer:h,owners:["reserved_pair_tail"]}),Je=0}let ft=new Mi(Fe,Yt,s,[...n,...$e,...Me.flatMap(Jr),...ye.flat().flatMap(Jr)]),vt=o?new Mi(Fe,Yt,s,[...n,...$e,...Me.flatMap(Jr),...ye.flat().flatMap(Jr),...o.copper]):ft,Ye=pk(Ze,ut).find((Nt)=>vt.pathVisible(Nt)),je=30*s,st={minX:Math.max(e.bounds.minX,Math.min(Ze.x,ut.x)-je),maxX:Math.min(e.bounds.maxX,Math.max(Ze.x,ut.x)+je),minY:Math.max(e.bounds.minY,Math.min(Ze.y,ut.y)-je),maxY:Math.min(e.bounds.maxY,Math.max(Ze.y,ut.y)+je)},St=Ye?{solved:!0,failed:!1,expanded:0,result:Ye,step(){}}:new al(ft,Ze,ut,o?.copper,o?.penalty,O?void 0:o?.history,O?{step:X,bounds:st}:void 0);try{while(!St.solved&&!St.failed&&St.expanded<500000)St.step(),yield}finally{if(St instanceof al)St.cancel()}if(!St.solved){Se=!0;break}ye[xt][Bt]=N(Yt,Hf(St.result,vt))}if(Se)continue;let Ne=QVr(r.map((Bt,xt)=>({...N(Bt,[...ye[xt][0].route,...Re[xt].slice(1),...ye[xt][1].route.toReversed().slice(1)],!0),coupledSection:[ye[xt][0].route.length-1,ye[xt][0].route.length+Re[xt].length-2]})));if(!Ne.every((Bt,xt)=>new Mi(e,r[xt],s,[...n,...Ne.flatMap(Jr)]).pathVisible(Bt.route)))continue;let Le={...e,connections:r,buses:[],differentialPairs:[t]},nt;for(let Bt of[1.5,0.75,0.375,0.1875]){let xt=Mk(Le,Ne,n,Bt);if(!xY(xt)||wk(Le,xt).some((Yt)=>!Yt.matched))continue;if(xt.some((Yt)=>Ar(Yt.route)>vy(e,Yt.connection_name)+0.0000001))continue;try{let Yt=JJ(Le,xt,bk(Le,xt),{maxCandidates:512}),ut=OY(Le,s+a/2+d),Ze=new Map;for(let tt of Le.traces??[])Ze.set(tt.connection_name,(Ze.get(tt.connection_name)??0)+1);if((Le.traces?.length??0)>0&&[...Ze.values()].every((tt)=>tt===2)&&Le.traces.every((tt)=>tt.route.filter((Je)=>Je.route_type==="via").length===1)&&ut.length&&Yt.some((tt)=>tt.curvedSegments?.some((Je)=>!ut.some(($e)=>by(tt.route[Je-1],$e.copper)&&by(tt.route[Je],$e.copper)))))Yt=JJ(Le,xt,bk(Le,xt),{maxCandidates:512,packageOnlyPairTuning:!0});if(xY(Yt)&&wk(Le,Yt).every((tt)=>tt.matched)){nt=Yt;break}}catch{}}if(!nt)continue;Ne=nt;let dt=[...Ne[0].route,...Ne[1].route.toReversed()],rt=e.connections.filter((Bt)=>!t.connectionNames.includes(Bt.name)&&Bt.pointsToConnect.some((xt)=>xt.layer===h&&l(xt,dt))),pt=!1,ct=Math.abs(Ar(Ne[0].route)+c[0]-Ar(Ne[1].route)-c[1]),Ct=o?ct+0.05*Ne.reduce((Bt,xt)=>Bt+Ar(xt.route),0):Ne.reduce((Bt,xt)=>Bt+Ar(xt.route),0),kt=(o?rt:e.connections).filter((Bt)=>!t.connectionNames.includes(Bt.name)&&Bt.pointsToConnect[0].layer===h),Lt=kt.length?JSON.stringify(Ne.map((Bt)=>Bt.route)):"";for(let Bt of kt){let xt=`${Bt.name}:${Lt}`,Yt=V.get(xt);if(!Yt){let ut=(e.buses??[]).find((ft)=>ft.connectionNames.includes(Bt.name))?.traceWidth??Bt.nominalTraceWidth??Bt.width??e.minTraceWidth,Ze=new Mi(e,Bt,ut,[...n,...Ne.flatMap(Jr)]),Fe=pk(Bt.pointsToConnect[0],Bt.pointsToConnect[1]),tt=Ar(Fe[0]),Je=Fe.find((ft)=>Ar(ft)<=tt+0.00000001&&Ze.pathVisible(ft)),$e=Je?{solved:!0,failed:!1,expanded:0,result:Je,step(){},cancel(){}}:new al(Ze,Bt.pointsToConnect[0],Bt.pointsToConnect[1]);try{while(!$e.solved&&!$e.failed&&$e.expanded<500000)$e.step(),yield}finally{$e.cancel()}Yt={reachable:$e.solved,length:$e.solved?Ar($e.result):1/0},V.set(xt,Yt)}if(!Yt.reachable){pt=!0;break}Ct+=o?0.05*Math.max(0,Yt.length-Ar(pk(Bt.pointsToConnect[0],Bt.pointsToConnect[1])[0])):Yt.length}if(!pt&&Ne.every((Bt)=>Wc(Bt.route,s+d))){if(Ct<Z)Z=Ct,re=Ne;if(Ct<L)L=Ct,D=Ne;if(o&&ct<=t.lengthTolerance)return j?.set(se,{traces:re,score:Z,hasMatchedAlternative:!0,countsAttempt:!0}),D;if(!o&&++H>=2)return D;if(!o)continue e}}}if(j?.set(se,{traces:re,score:Z,hasMatchedAlternative:!1,countsAttempt:!0}),o&&D&&++H>=4)return D}return D}function mk(e){let t=new Map,n=e.obstacles.filter((s)=>s.componentId),o=new Map;for(let s of n){let a=s.circuitJsonMetadata?.pcb_port_id;if(a)o.set(a,s.componentId);let c=(s.ccwRotationDegrees??0)*Math.PI/180,l=Math.abs(Math.cos(c))*s.width+Math.abs(Math.sin(c))*s.height,h=Math.abs(Math.sin(c))*s.width+Math.abs(Math.cos(c))*s.height,d=t.get(s.componentId)??{left:1/0,right:-1/0,bottom:1/0,top:-1/0};d.left=Math.min(d.left,s.center.x-l/2),d.right=Math.max(d.right,s.center.x+l/2),d.bottom=Math.min(d.bottom,s.center.y-h/2),d.top=Math.max(d.top,s.center.y+h/2),t.set(s.componentId,d)}let r=new Map([...t].map(([s,a])=>[s,{x:(a.left+a.right)/2,y:(a.bottom+a.top)/2}])),i=new Map;for(let s of e.connections){if(s.pointsToConnect.length!==2)continue;let a=s.pointsToConnect.map((c)=>{let l=c.pcb_port_id?o.get(c.pcb_port_id):void 0;if(l)return l;let h=new Set([s.name,s.source_trace_id,c.pointId,c.pcb_port_id].filter((d)=>!!d));return n.filter((d)=>d.connectedTo.some((u)=>h.has(u))).sort((d,u)=>Fn(c,d.center)-Fn(c,u.center))[0]?.componentId});for(let[c,l]of a.entries()){let h=a[1-c];if(!l||!h||l===h)continue;let d=JSON.stringify([l,h]),u=i.get(d)??{source:l,remote:h,points:[]};u.points.push(s.pointsToConnect[c]),i.set(d,u)}}return[...i.values()].some((s)=>{let a=r.get(s.source),c=r.get(s.remote),l={x:s.points.reduce((h,d)=>h+d.x,0)/s.points.length,y:s.points.reduce((h,d)=>h+d.y,0)/s.points.length};return(l.x-a.x)*(c.x-a.x)+(l.y-a.y)*(c.y-a.y)<-0.000000001})}function*Wot(e,t,n){let o=e.minTraceToPadEdgeClearance??e.defaultObstacleMargin??0.075;for(let r of t){let i=r.route[0].width;if(Wc(r.route,i+o))continue;if(r.coupledSection)return!1;let s=e.connections.find((d)=>d.name===r.connection_name),a=new Mi(e,s,i,[...n,...t.flatMap(Jr)]),c=i*10,l={minX:Math.max(e.bounds.minX,Math.min(...r.route.map((d)=>d.x))-c),maxX:Math.min(e.bounds.maxX,Math.max(...r.route.map((d)=>d.x))+c),minY:Math.max(e.bounds.minY,Math.min(...r.route.map((d)=>d.y))-c),maxY:Math.min(e.bounds.maxY,Math.max(...r.route.map((d)=>d.y))+c)},h=!1;for(let d of[i/4,i/5]){for(let u of[!1,!0]){let _=u?s.pointsToConnect.toReversed():s.pointsToConnect,p=new al(a,_[0],_[1],[],0,void 0,{step:d,bounds:l});try{while(!p.failed&&!p.solved)p.step(),yield;if(!p.solved)continue;let m=Hf(u?p.result.toReversed():p.result,a);if(!Wc(m,i+o))continue;r.route=m.map((A)=>({...A,route_type:"wire",layer:s.pointsToConnect[0].layer,width:i})),h=!0;break}finally{p.cancel()}}if(h)break}if(!h)return!1}return!0}function*GVr(e,t,n,o,r,i,s){let a=new Map,c=0;for(let l=0;l<24&&c<20000;l++){let h=o.select(r,i);if(h)return h;let d=o.unresolvedUnits(r);if(!d?.length)return null;let u=d.join("\x00"),_=a.get(u)??0;a.set(u,_+1);let p=0;for(let m of[...d].sort((A,g)=>Number(e.differentialPairs?.some((f)=>f.connectionNames.includes(A)))-Number(e.differentialPairs?.some((f)=>f.connectionNames.includes(g))))){let A=e.differentialPairs?.find((C)=>C.connectionNames.includes(m));if(A){if(p||_<1)continue;for(let C=0;C<4&&c<20000;C++){let b=o.conditionalRoutes(d.filter((M)=>M!==m),C===0?-1:_*4+C,C%2===0?r.filter((M)=>M!==m):[]);if(!b)continue;let I=zk(e,A,[...t,...b.flatMap(Jr)],{copper:[],penalty:0,variant:_}),v=I.next(),P=0;try{while(!v.done&&c<20000&&P<2000)c++,P++,yield,v=I.next()}finally{if(!v.done)I.return(null)}if(v.done&&v.value){let M=o.revisionNumber;o.add(m,v.value),p+=Number(o.revisionNumber!==M)}}continue}let g=e.connections.find((C)=>C.name===m),y=e.buses?.some((C)=>C.connectionNames.includes(m))?[g.pointsToConnect[0].layer]:s.get(m)??[g.pointsToConnect[0].layer],x=d.filter((C)=>C!==m);for(let C=0;C<12&&c<20000;C++){let b=o.conditionalRoutes(x,C===0?-1:_*12+C,C%2===0?r.filter((I)=>I!==m):[]);if(!b)continue;for(let I of y){let v={...g,pointsToConnect:g.pointsToConnect.map((D)=>({...D,layer:I}))},P=n.get(m)??e.minTraceWidth,M=new Mi(e,v,P,[...t,...b.flatMap(Jr)]),B=new al(M,v.pointsToConnect[0],v.pointsToConnect[1]);try{while(!B.solved&&!B.failed&&B.expanded<500000&&c<20000)B.step(),c++,yield}finally{B.cancel()}if(!B.solved)continue;let T=Hf(B.result,M);if(!Wc(T,P/2+M.margin))continue;let N=o.revisionNumber;o.add(m,[{type:"pcb_trace",pcb_trace_id:`bus_lane_${m}`,connection_name:m,source_trace_id:g.source_trace_id??m,route:T.map((D)=>({...D,route_type:"wire",layer:I,width:P}))}]),p+=Number(o.revisionNumber!==N)}}}if(!p&&_>5)return null}return o.select(r,i)}function*k3n(e,t,n,o,r,i){let[s,a]=e.connection.pointsToConnect,c=new al(e,s,t,n,o,r,{maxLength:i-Fn(t,a)});try{while(!c.solved&&!c.failed)c.step(),yield}finally{c.cancel()}if(!c.solved)return null;let l=Hf(c.result,e),h=[],d=Ar(l)-e.width-e.margin-0.0000001;for(let A=1;A<l.length&&d>0;A++){let g=l[A-1],f=l[A],y=Fn(g,f),x=Math.min(1,d/y);h.push({a:g,b:{x:g.x+(f.x-g.x)*x,y:g.y+(f.y-g.y)*x},radius:e.width/2,layer:s.layer,owners:["waypoint_prefix"]}),d-=y}let u=new Mi(e.input,e.connection,e.width,[...e.copper,...h]),_=new al(u,t,a,n,o,r,{maxLength:i-Ar(l)});try{while(!_.solved&&!_.failed)_.step(),yield}finally{_.cancel()}if(!_.solved)return null;let p=Hf(_.result,u),m=W2([...l,...p.slice(1)]);if(Ar(m)>i+0.00000001||!Wc(m,e.width/2+e.margin))return null;return m}var NAn=new WeakMap;function*UVr(e,t,n,o){let r=JSON.stringify([e.bounds,e.layerCount,e.minTraceWidth,e.obstacles,e.traces,e.connections.map((c)=>c.pointsToConnect),e.minBoardEdgeClearance,e.minTraceToPadEdgeClearance??e.defaultObstacleMargin??0.075,n,t.map((c)=>[c.name,c.source_trace_id,c.pointsToConnect,o.get(c.name)])]),i=NAn.get(e)??new Map;NAn.set(e,i);let s=i.get(r);if(s)return structuredClone(s);let a=[];for(let c of t){let l=o.get(c.name),h=new al(new Mi(e,c,l,n),c.pointsToConnect[0],c.pointsToConnect[1]);try{while(!h.solved&&!h.failed)h.step(),yield;if(h.solved)a.push({type:"pcb_trace",pcb_trace_id:`certificate_${c.name}`,connection_name:c.name,route:h.result.map((d)=>({...d,route_type:"wire",layer:c.pointsToConnect[0].layer,width:l}))})}finally{if(!h.solved&&!h.failed)h.cancel()}}if(i.size>=8)i.delete(i.keys().next().value);return i.set(r,structuredClone(a)),a}var vZ=class{geometry=new WeakMap;conflicts=new WeakMap;getGeometry(e){let t=this.geometry.get(e);if(t)return t;let n=[],o=new Float64Array(Math.max(0,e.length-1)*4),r=1/0,i=-1/0,s=1/0,a=-1/0;for(let l=1;l<e.length;l++){let h=e[l-1],d=e[l],u=(l-1)*4;n.push([h,d]),o[u]=Math.min(h.x,d.x),o[u+1]=Math.max(h.x,d.x),o[u+2]=Math.min(h.y,d.y),o[u+3]=Math.max(h.y,d.y),r=Math.min(r,o[u]),i=Math.max(i,o[u+1]),s=Math.min(s,o[u+2]),a=Math.max(a,o[u+3])}let c={edges:n,bounds:o,minX:r,maxX:i,minY:s,maxY:a};return this.geometry.set(e,c),c}firstConflict(e,t,n){let o=this.conflicts.get(e),r=o?.get(t);if(r?.required===n)return r.result;if(!o)o=new WeakMap,this.conflicts.set(e,o);let i=this.getGeometry(e),s=this.getGeometry(t),a=null;if(i.maxX+n>=s.minX&&s.maxX+n>=i.minX&&i.maxY+n>=s.minY&&s.maxY+n>=i.minY)e:for(let c=0;c<i.edges.length;c++){let l=c*4;for(let h=0;h<s.edges.length;h++){let d=h*4;if(i.bounds[l+1]+n<s.bounds[d]||s.bounds[d+1]+n<i.bounds[l]||i.bounds[l+3]+n<s.bounds[d+2]||s.bounds[d+3]+n<i.bounds[l+2])continue;if(mB(i.edges[c],s.edges[h])<n){a=[c+1,h+1];break e}}}return o.set(t,{required:n,result:a}),a}},WVr=class{bits=new Uint8Array(0);sparse=new Map;get(e){if(e>=4096)return this.sparse.get(e);let t=this.bits[e];return t?t===2:void 0}set(e,t){if(e>=4096){this.sparse.set(e,t);return}if(e>=this.bits.length){let n=new Uint8Array(Math.max(16,2**Math.ceil(Math.log2(e+1))));n.set(this.bits),this.bits=n}this.bits[e]=t?2:1}keys(){return this.sparse.keys()}delete(e){this.sparse.delete(e)}},Xot=class{constructor(e,t=120){this.clearance=e,this.limit=t}clearance;limit;pools=new Map;nextId=0;additions=0;assignments=new Map;routeConflicts=new vZ;signatures=new Map;routeSignatures=new WeakMap;revision=0;selection;add(e,t){let n=this.pools.get(e)??[],o=this.signatures.get(e);if(!o)o=new Set,this.signatures.set(e,o);let r=`[${t.map((a)=>{let c=this.routeSignatures.get(a.route);if(c===void 0)c=JSON.stringify(a.route),this.routeSignatures.set(a.route,c);return c}).join(",")}]`;if(o.has(r))return;let i=t.map((a)=>Ar(a.route)),s={traces:t,key:r,length:i.reduce((a,c)=>a+c,0),peak:Math.max(...i),layers:[...new Set(t.map((a)=>a.route[0].layer))],singleLayer:t.every((a)=>a.route[0].layer===t[0].route[0].layer)?t[0].route[0].layer:void 0,conflicts:new WVr,id:this.nextId++};if(n.push(s),o.add(r),n.length>this.limit)o.delete(n.shift().key);this.pools.set(e,n),this.additions++,this.revision++}transformUnit(e,t){let n=this.pools.get(e)??[];this.pools.delete(e),this.signatures.delete(e),this.revision++;for(let o of n){let r=t(o.traces);if(r)this.add(e,r)}}hasEveryUnit(e){return e.every((t)=>!!this.pools.get(t)?.length)}unresolvedUnits(e){if(this.compatible(e.map((n)=>this.pools.get(n)??[]),500000))return null;let t=e.slice();for(let n of e){let o=t.filter((r)=>r!==n);if(!this.compatible(o.map((r)=>this.pools.get(r)??[]),500000))t=o}return t}conditionalRoutes(e,t,n=[]){if(!e.length)return[];let o=t%e.length,r=Math.floor(t/e.length),i=e.map((c,l)=>{let h=this.pools.get(c)??[];return t<0||l!==o||!h.length?h:[h[r%h.length]]}),s=this.compatible(i,500000);if(!s)return null;let a=s.map((c)=>[c]);for(let c of n){if(e.includes(c))continue;let l=this.pools.get(c)??[],h=this.compatible([...a,l]);if(!h)continue;a.push(l),s=h}return s.flatMap((c)=>c.traces)}get revisionNumber(){return this.revision}collides(e,t){if(e.singleLayer!==void 0&&t.singleLayer!==void 0&&e.singleLayer!==t.singleLayer)return!1;let n=e.id<t.id?e:t,o=Math.max(e.id,t.id),r=n.conflicts,i=r.get(o);if(i!==void 0)return i;if(!e.layers.some((s)=>t.layers.includes(s)))return r.set(o,!1),!1;for(let s of e.traces)for(let a of t.traces){if(s.route[0].layer!==a.route[0].layer)continue;let c=(s.route[0].width+a.route[0].width)/2+this.clearance-0.00000001;if(this.routeConflicts.firstConflict(s.route,a.route,c))return r.set(o,!0),!0}return r.set(o,!1),!1}compatible(e,t=50000){let n=`${t}:`+e.map((r)=>r.map((i)=>i.id).join(",")).join(";");if(this.assignments.has(n))return this.assignments.get(n);let o=this.computeCompatible(e,t);if(this.assignments.size>=128)this.assignments.delete(this.assignments.keys().next().value);return this.assignments.set(n,o),o}computeCompatible(e,t){if(e.some((a)=>!a.length))return null;let n=e.map((a)=>new Set(a.flatMap((c)=>c.layers))),o=new Set(e.map((a,c)=>c)),r=[];while(o.size){let a=[o.values().next().value];o.delete(a[0]);for(let c=0;c<a.length;c++)for(let l of o){if(![...n[l]].some((h)=>n[a[c]].has(h)))continue;o.delete(l),a.push(l)}r.push(a)}if(r.length>1){let a=[];for(let c of r){let l=this.compatible(c.map((h)=>e[h]),t);if(!l)return null;c.forEach((h,d)=>{a[h]=l[d]})}return a}let i=e.map(()=>{return}),s=(a)=>{if(--t<0)return null;let c=-1;for(let l=0;l<a.length;l++){if(i[l])continue;if(!a[l].length)return null;if(c<0||a[l].length<a[c].length)c=l}if(c<0)return i;for(let l of a[c]){i[c]=l;let h=a.map((u,_)=>i[_]?u:u.filter((p)=>!this.collides(l,p))),d=s(h);if(d)return d.slice();if(i[c]=void 0,t<0)break}return null};return s(e.map((a)=>[...a].sort((c,l)=>c.length-l.length)))}pruneConflicts(){let e=new Set([...this.pools.values()].flat().map((t)=>t.id));for(let t of this.pools.values())for(let n of t)for(let o of n.conflicts.keys())if(!e.has(o))n.conflicts.delete(o);this.additions=0}select(e,t=[]){let n=JSON.stringify([e,t]);if(this.selection?.revision===this.revision&&this.selection.key===n)return this.selection.result?.slice()??null;let o=this.computeSelection(e,t);return this.selection={revision:this.revision,key:n,result:o},o?.slice()??null}computeSelection(e,t){if(this.additions>=100)this.pruneConflicts();let n=e.map((i)=>this.pools.get(i)??[]),o=this.compatible(n);if(!o)return null;let r=(i)=>i.peak;for(let i of[e,...t]){let s=new Set(i.map((d)=>e.indexOf(d)).filter((d)=>d>=0));if(!s.size)continue;let a=Math.max(...o.filter((d,u)=>s.has(u)).map(r)),c=[...new Set(n.flatMap((d,u)=>s.has(u)?d.map(r):[]))].filter((d)=>d<a).sort((d,u)=>d-u),l=0,h=c.length-1;while(l<=h){let d=l+h>>1,u=this.compatible(n.map((_,p)=>s.has(p)?_.filter((m)=>r(m)<=c[d]):_));if(u)o=u,a=c[d],h=d-1;else l=d+1}n=n.map((d,u)=>s.has(u)?d.filter((_)=>r(_)<=a):d)}return o.flatMap((i)=>i.traces)}};function*jot(e){if(!e.length)yield[];else for(let t=0;t<e.length;t++)for(let n of jot(e.filter((o,r)=>t!==r)))yield[e[t],...n]}function*XVr(e){if(e.length<=4){yield*jot(e);return}let t=new Set;for(let n of jot(e))for(let o=0;o<n.length;o++){let r=[...n.slice(o),...n.slice(0,o)],i=JSON.stringify(r);if(t.has(i))continue;if(t.add(i),yield r,t.size===24)return}}function*jVr(e,t,n,o,r,i={}){let s=new Map(t.map((p)=>[p.name,p])),a=(p)=>r.get(p)??s.get(p)?.width??s.get(p)?.nominalTraceWidth??e.minTraceWidth,c=(p)=>{let m=s.get(p.connection_name??"");return!!m&&m.pointsToConnect.length===2&&p.route.length>=2&&p.route.every((A)=>A.route_type==="wire"&&Number.isFinite(A.x)&&Number.isFinite(A.y)&&A.layer===m.pointsToConnect[0].layer&&Number.isFinite(A.width)&&A.width>0&&Math.abs(A.width-a(m.name))<0.000000000001)&&Fn(p.route[0],m.pointsToConnect[0])<=0.00000001&&Fn(p.route.at(-1),m.pointsToConnect[1])<=0.00000001};if(o.some((p)=>!c(p)))return null;let l=new Set((e.differentialPairs??[]).flatMap((p)=>p.connectionNames)),h=t.filter((p)=>!o.some((m)=>m.connection_name===p.name));if(!h.length||h.some((p)=>l.has(p.name)||p.pointsToConnect.length!==2||p.pointsToConnect[0].layer!==p.pointsToConnect[1].layer))return null;let d=new Map;for(let p of h){let m=p.pointsToConnect[0].layer,A=d.get(m)??[];A.push(p),d.set(m,A)}if([...d.values()].some((p)=>p.length>2))return null;let u=o.slice(),_={searches:0,searchSteps:0,candidates:0};for(let p of d.keys()){let m=t.filter((y)=>y.pointsToConnect[0].layer===p),A=new Set(m.map((y)=>y.name)),g=u.filter((y)=>!A.has(y.connection_name)),f=yield*KVr(e,m,[...n,...g.flatMap(Jr)],u.filter((y)=>A.has(y.connection_name)),r,i,_);if(!f)return null;u=[...g,...f]}if(u.length!==t.length||new Set(u.map((p)=>p.connection_name)).size!==t.length)return null;for(let p of u){if(!c(p))return null;let m=s.get(p.connection_name);if(!new Mi(e,m,a(m.name),[...n,...u.filter((g)=>g!==p).flatMap(Jr)]).pathVisible(p.route)||!(i.deferRetainedSelfClearance&&o.some((g)=>g.route===p.route))&&!Wc(p.route,a(m.name)+(e.minTraceToPadEdgeClearance??e.defaultObstacleMargin??0.075)))return null}return u}function*KVr(e,t,n,o,r,i,s){let a=Math.min(5,i.maxSubsetSize??4),c=i.maxSearches??1200,l=i.maxSearchSteps??180000,h=i.maxCandidatesPerLane??80,d=e.minTraceToPadEdgeClearance??e.defaultObstacleMargin??0.075,u=new Map(t.map((j)=>[j.name,j])),_=new Set((e.differentialPairs??[]).flatMap((j)=>j.connectionNames)),p=(j)=>!_.has(j.name)&&j.pointsToConnect.length===2&&j.pointsToConnect[0].layer===j.pointsToConnect[1].layer,m=(j)=>r.get(j)??u.get(j)?.width??u.get(j)?.nominalTraceWidth??e.minTraceWidth,A=(j)=>{let Y=u.get(j.connection_name??"");return!!Y&&Y.pointsToConnect.length===2&&j.route.length>=2&&j.route.every((X)=>X.route_type==="wire"&&Number.isFinite(X.x)&&Number.isFinite(X.y)&&X.layer===Y.pointsToConnect[0].layer&&Number.isFinite(X.width)&&X.width>0&&Math.abs(X.width-m(Y.name))<0.000000000001)&&Fn(j.route[0],Y.pointsToConnect[0])<=0.00000001&&Fn(j.route.at(-1),Y.pointsToConnect[1])<=0.00000001};if(o.some((j)=>!A(j)))return null;let g=new Set(o.map((j)=>j.connection_name)),f=t.filter((j)=>!g.has(j.name));if(!f.length||f.length>2||f.length>a||f.some((j)=>!p(j)))return null;let y=new WeakMap,x=(j)=>{let Y=y.get(j);if(!Y)Y=Jr(j),y.set(j,Y);return Y},C=(j,Y)=>({type:"pcb_trace",pcb_trace_id:`lane_closure_repair_${j}`,connection_name:j,source_trace_id:u.get(j).source_trace_id,route:Y.map((X)=>({...X,route_type:"wire",layer:u.get(j).pointsToConnect[0].layer,width:m(j)}))}),b=(j)=>{let Y=u.get(j.connection_name??"");return!!Y&&p(Y)&&!j.coupledSection&&!j.curvedSegments?.length&&j.route.every((X)=>X.route_type==="wire")},I=o,v=f.map((j)=>j.name),P=0,M=()=>s.searches>=c||s.searchSteps>=l,B=()=>i.onProgress?.({searches:s.searches,searchSteps:s.searchSteps,subset:[...v],candidates:s.candidates}),T=2*Math.max(...t.map((j)=>Fn(j.pointsToConnect[0],j.pointsToConnect[1]))),N=new Map;function*D(j,Y,X=!1){if(M())return null;let K=JSON.stringify([j,X,u.get(j).pointsToConnect,m(j),Y.map((Z)=>[Z.connection_name,Z.route])]);if(N.has(K))return N.get(K);let J=(Z)=>{if(N.size>=256)N.delete(N.keys().next().value);return N.set(K,Z),Z};s.searches++,B();let ee=u.get(j),se=new Mi(e,ee,m(j),[...n,...Y.flatMap(x)]),ne=new al(se,ee.pointsToConnect[X?1:0],ee.pointsToConnect[X?0:1],[],0,void 0,{maxLength:i.maxLengths?.get(j)??T}),re=0;try{while(re<(i.maxSearchStepsPerAttempt??500)&&!ne.solved&&!ne.failed&&s.searchSteps<l)ne.step(),re++,s.searchSteps++,yield;if(!ne.solved)return J(null);let Z=X?ne.result.toReversed():ne.result,te=Hf(Z,se);if(!se.pathVisible(te)||!Wc(te,m(j)+d))return J(null);return J(C(j,te))}finally{ne.cancel(),B()}}let L=new Map,H=new Map;for(let j of f){let Y=yield*D(j.name,I);if(Y)L.set(j.name,[Y]);else for(let X of I){if(!b(X)||X.route[0].layer!==j.pointsToConnect[0].layer)continue;let K=yield*D(j.name,I.filter((J)=>J!==X));if(!K)continue;H.set(X.connection_name,(H.get(X.connection_name)??0)+1),L.set(j.name,[...L.get(j.name)??[],K])}}function*V(j,Y,X=0,K=[]){if(!Y){yield K;return}for(let J=X;J<=j.length-Y;J++)yield*V(j,Y-1,J+1,[...K,j[J]])}for(let j of f){if(L.has(j.name))continue;let Y=I.filter((K)=>b(K)&&K.route[0].layer===j.pointsToConnect[0].layer),X=!1;for(let K=2;K<=a-f.length&&!X;K++)for(let J of V(Y,K)){if(M())break;let ee=yield*D(j.name,I.filter((se)=>!J.includes(se)));if(!ee)continue;for(let se of J)H.set(se.connection_name,(H.get(se.connection_name)??0)+1);L.set(j.name,[ee]),X=!0;break}}for(let[j]of[...H].sort((Y,X)=>X[1]-Y[1])){if(v.length>=Math.min(4,a))break;v.push(j)}if(M())return null;function*O(){let j=I.filter((K)=>!v.includes(K.connection_name)),Y=new Map;for(let K of f.map((J)=>J.name)){let J=yield*D(K,j);if(!J)continue;for(let ee of v.filter((se)=>se!==K)){if(yield*D(ee,[...j,J]))continue;for(let se of j){if(!b(se)||se.route[0].layer!==u.get(ee).pointsToConnect[0].layer)continue;if(!(yield*D(ee,[...j.filter((re)=>re!==se),J])))continue;let ne=Y.get(se.connection_name)??new Set;ne.add(ee),Y.set(se.connection_name,ne)}}}let X=[...Y].sort((K,J)=>J[1].size-K[1].size)[0]?.[0];if(X)return X;for(let K of f){let J=yield*D(K.name,I.filter((se)=>!b(se)));if(!J)continue;let ee=j.find((se)=>b(se)&&!new Mi(e,K,m(K.name),[...n,...x(se)]).pathVisible(J.route));if(ee)return ee.connection_name}return null}let U=[...I,...[...L.values()].flat()];for(;;){let j=I.filter((de)=>!v.includes(de.connection_name)),Y=[...n,...j.flatMap(x)],X=new Xot(d,h),K=new Map,J=new Map,ee=(de)=>{let me=de.connection_name;if(!A(de))return!1;if(!new Mi(e,u.get(me),m(me),Y).pathVisible(de.route)||!(i.deferRetainedSelfClearance&&o.some((Me)=>Me.route===de.route))&&!Wc(de.route,m(me)+d))return!1;let xe=JSON.stringify(de.route),Ee=J.get(me)??new Set;if(Ee.has(xe))return!1;let Re=K.get(me)??[];if(Re.push(de),Ee.add(xe),Re.length>h)Ee.delete(JSON.stringify(Re.shift().route));return K.set(me,Re),J.set(me,Ee),X.add(me,[de]),P++,s.candidates++,!0},se=()=>{let de=X.select(v,[v]);if(!de)return null;let me=[...j,...de];if(me.length!==t.length||new Set(me.map((ge)=>ge.connection_name)).size!==t.length)return null;for(let ge of me){let xe=u.get(ge.connection_name);if(!xe||!A(ge))return null;if(!new Mi(e,xe,m(xe.name),[...n,...me.filter((Re)=>Re!==ge).flatMap(x)]).pathVisible(ge.route)||!(i.deferRetainedSelfClearance&&o.some((Re)=>Re.route===ge.route))&&!Wc(ge.route,m(xe.name)+d))return null}return me};for(let de of U)if(v.includes(de.connection_name))ee(de);for(let de of v){let me=yield*D(de,j);if(me)ee(me)}let ne=se();if(ne)return ne;for(let de of XVr(v)){let me=[];for(let ge of de){let xe=yield*D(ge,[...j,...me]);if(!xe)break;if(me.push(xe),ee(xe),ne=se(),ne)return ne}if(M())return null}let re=(de,me)=>{let ge=K.get(de)??[],xe=[...ge].sort((Ee,Re)=>Ar(Ee.route)-Ar(Re.route));return ge.length<=me?xe:[...new Set([ge[0],...xe.slice(0,me/2-1),...ge.slice(-me/2)])]};function*Z(de=!1,me=!1){let ge=de?Math.min(8,h):h;for(let xe=0;xe<(me?0:de?1:i.maxConditionalPasses??4);xe++){let Ee=P,Re=new Map(v.map((Me)=>[Me,re(Me,ge)]));for(let Me of v)for(let _e of v.filter((ye)=>ye!==Me))for(let ye of Re.get(_e)){let Se=yield*D(Me,[...j,ye]);if(Se)ee(Se);let Ne=se();if(Ne)return Ne;if(M())return null}if(P===Ee)break}for(let xe of v){let Ee=v.filter((Me)=>Me!==xe),Re=new Map(Ee.map((Me)=>[Me,re(Me,ge)]));for(let Me of Ee)for(let _e of Re.get(Me)){let ye=new Xot(d,h);for(let nt of Ee)for(let dt of nt===Me?[_e]:Re.get(nt))ye.add(nt,[dt]);let Se=ye.select(Ee,[Ee]);if(!Se)continue;let Ne=yield*D(xe,[...j,...Se]);if(Ne)ee(Ne);let Le=se();if(Le)return Le;if(M())return null}}return null}if(ne=yield*Z(!0),ne||M())return ne;if(v.length<a){let de=yield*O();if(M())return null;if(de){U.push(...[...K.values()].flat()),v.push(de);continue}}let te=t.flatMap((de)=>de.pointsToConnect),ie=(m(f[0].name)+d)*2,ce=e.obstacles.filter((de)=>de.componentId),ue=P;for(let de of[0.1,0.3,0.5,0.7,0.9])for(let me=0;me<11;me++)for(let ge of v){if(M())return null;s.searches++;let xe=u.get(ge),[Ee,Re]=xe.pointsToConnect,Me=Math.abs(Re.y-Ee.y)>=Math.abs(Re.x-Ee.x),_e=(ct)=>Me?ct.x:ct.y,ye=Math.min(...te.map(_e))-ie,Se=Math.max(...te.map(_e))+ie,Ne=Array.from({length:9},(ct,Ct)=>ye+(Se-ye)*Ct/8);if(ce.length)Ne.push(Math.min(...ce.map((ct)=>_e(ct.center)-(Me?ct.width:ct.height)/2))-ie,Math.max(...ce.map((ct)=>_e(ct.center)+(Me?ct.width:ct.height)/2))+ie);let Le=Ne[me%Ne.length],nt=Me?{x:Le,y:Ee.y+(Re.y-Ee.y)*de}:{x:Ee.x+(Re.x-Ee.x)*de,y:Le},dt=new Mi(e,xe,m(ge),Y),rt=k3n(dt,nt,[],0,void 0,i.maxLengths?.get(ge)??T),pt=rt.next();try{while(!pt.done&&s.searchSteps<l)s.searchSteps++,yield,pt=rt.next()}finally{if(!pt.done)rt.return(null)}if(pt.done&&pt.value)ee(C(ge,pt.value));if(ne=se(),ne)return ne;if(P-ue>=12){if(ne=yield*Z(!0,!0),ne||M())return ne;ue=P}}return yield*Z()}}function*VY(e,t,n,o,r,i,s=new Map,a=()=>!0,c=!1,l=!1){let h=t.some((U)=>(s.get(U.name)?.length??1)>1),d=new Map,u=new Map,_=new Map,p=e.minTraceToPadEdgeClearance??e.defaultObstacleMargin??0.075,m=(e.differentialPairs??[]).filter((U)=>(U.traceGap!==void 0||U.maxUncoupledLength!==void 0)&&U.connectionNames.every((j)=>t.some((Y)=>Y.name===j))),A=new Set(m.flatMap((U)=>U.connectionNames)),g=[...m.map((U)=>({pair:U,connections:U.connectionNames.map((j)=>t.find((Y)=>Y.name===j))})),...t.filter((U)=>!A.has(U.name)).map((U)=>({pair:void 0,connections:[U]}))].sort((U,j)=>Number(!U.pair)-Number(!j.pair)||Ar(U.connections[0].pointsToConnect)-Ar(j.connections[0].pointsToConnect)),f=new Map,y=new Map;for(let U of e.buses??[]){let j=t.filter((X)=>U.connectionNames.includes(X.name)),Y=1.4849999999999999*Math.max(...j.map((X)=>Ar(X.pointsToConnect)));for(let X of j){let K=vy(e,X.name);f.set(X.name,Math.min(Y,K)),y.set(X.name,Math.min(Y*4/3,K))}}let x=new Xot(p,240),C=new vZ,b=g.map((U)=>U.connections[0].name),I=[...(e.buses??[]).map((U)=>g.filter((j)=>j.connections.some((Y)=>U.connectionNames.includes(Y.name))).map((j)=>j.connections[0].name)),...g.filter((U)=>!U.connections.some((j)=>(e.buses??[]).some((Y)=>Y.connectionNames.includes(j.name)))).map((U)=>[U.connections[0].name])],v=new WeakMap,P=(U)=>{let j=v.get(U);if(!j)j=Jr(U),v.set(U,j);return j},M=o.flatMap(P),B=new Map,T=[...g],N=0,D=0,L=0,H=0,V=0,O=-1/0;e:for(let U=0;U<12000&&T.length;U++){let Y=10+Math.floor(U/Math.max(1,t.length/4))*4;if(U-D>=g.length*8){for(let[ie,ce]of f){let ue=y.get(ie);if(ce<ue)f.set(ie,Math.min(ue,ce*1.025))}let Z=new Set(T.flatMap((ie)=>ie.connections.map((ce)=>ce.pointsToConnect[0].layer))),te=g.filter((ie)=>ie.pair&&Z.has(ie.connections[0].pointsToConnect[0].layer));if(te.length){let ie=te[L++%te.length],ce=T.indexOf(ie);if(ce>=0)T.splice(ce,1);T.unshift(ie)}D=U}let X=T.shift(),K=[X];for(let Z of K){let te=Z.connections[0],ie=(B.get(te.name)??0)+1;B.set(te.name,ie);let ce=Z.connections.flatMap((rt)=>d.has(rt.name)?[d.get(rt.name)]:[]);for(let rt of Z.connections)d.delete(rt.name);let ue=s.get(te.name)?.filter((rt)=>Z.connections.every((pt)=>s.get(pt.name)?.includes(rt)))??[te.pointsToConnect[0].layer],de=ce.length?ce:Z.connections.map((rt)=>({connection_name:rt.name,route:rt.pointsToConnect})),me=(rt)=>{let pt=rt===te.pointsToConnect[0].layer?0:0.25;for(let ct of d.values()){if(ct.route[0].layer!==rt)continue;if(de.some((kt)=>C.firstConflict(kt.route,ct.route,(r.get(kt.connection_name)+ct.route[0].width)/2+p-0.00000001)))pt++}return pt};if(ue.length>1){let rt=new Map(ue.map((pt)=>[pt,me(pt)]));ue.sort((pt,ct)=>rt.get(pt)-rt.get(ct))}let ge=ue[0];for(let rt of Z.connections)for(let pt of rt.pointsToConnect)pt.layer=ge;let xe=r.get(te.name),Ee=te.pointsToConnect[0].layer;d.delete(te.name);let Re=[...d.values()],Me=[...o,...Re],_e=Re.flatMap(P),ye=[...n,...M,...!Z.pair?Re.filter((rt)=>A.has(rt.connection_name)).flatMap(P):[]],Se=new Mi(e,te,xe,ye);if(Z.pair){let rt=new ost(Se);if(!u.has(Ee))u.set(Ee,new Float32Array(rt.cellCount));_.set(Ee,rt);let pt=zk(e,Z.pair,n,{copper:[],penalty:0,variant:ie-1}),ct=pt.next();try{while(!ct.done)yield Re,ct=pt.next()}finally{if(!ct.done)ct=pt.return(null)}if(!ct.value){if(ce.length!==Z.connections.length)return null;for(let Ct of ce){d.set(Ct.connection_name,Ct);let kt=Z.connections.find((Lt)=>Lt.name===Ct.connection_name);for(let Lt of kt.pointsToConnect)Lt.layer=Ct.route[0].layer}continue}x.add(te.name,ct.value);for(let Ct of ct.value)d.set(Ct.connection_name,Ct);continue}let Ne=[],Le=[];if(e.buses?.length&&U>=g.length*4&&a()){let rt=UVr(e,t.filter((Ct)=>!A.has(Ct.name)),ye,r),pt=rt.next();try{while(!pt.done)yield Me,pt=rt.next()}finally{if(!pt.done)rt.return([])}let ct=pt.value;Le=ct,Ne=ct.filter((Ct)=>Ct.connection_name!==te.name&&!d.has(Ct.connection_name)).flatMap(P)}let nt=new al(Se,te.pointsToConnect[0],te.pointsToConnect[1],[..._e,...Ne],Y,u.get(Ee),{maxLength:f.get(te.name),paretoLength:Number.isFinite(vy(e,te.name)),checkReachability:l});if(!u.has(Ee))u.set(Ee,new Float32Array(nt.cellCount));_.set(Ee,nt);let dt;for(let rt of ue){for(let kt of te.pointsToConnect)kt.layer=rt;let pt=rt===Ee?Se:new Mi(e,te,xe,ye),ct=rt===Ee?nt:new al(pt,te.pointsToConnect[0],te.pointsToConnect[1],[..._e,...Ne],Y,u.get(rt),{maxLength:f.get(te.name),paretoLength:Number.isFinite(vy(e,te.name)),checkReachability:l});if(!u.has(rt))u.set(rt,new Float32Array(ct.cellCount));_.set(rt,ct);try{while(!ct.solved&&!ct.failed)ct.step(),yield Me}finally{if(!ct.solved&&!ct.failed)ct.cancel()}if(!ct.solved&&f.has(te.name)){ct=new al(pt,te.pointsToConnect[0],te.pointsToConnect[1],[],0,void 0,{checkReachability:l,maxLength:vy(e,te.name)});try{while(!ct.solved&&!ct.failed)ct.step(),yield Me}finally{if(!ct.solved&&!ct.failed)ct.cancel()}if(ct.solved&&Ar(ct.result)>f.get(te.name)){let kt=e.buses.find((Lt)=>Lt.connectionNames.includes(te.name));for(let Lt of kt.connectionNames)f.set(Lt,Math.min(Ar(ct.result)*1.05,vy(e,Lt)))}}if(!ct.solved)continue;let Ct=[ct.result];if(ie>1&&ie%2===0&&f.has(te.name)){let[kt,Lt]=te.pointsToConnect,Bt=Math.abs(Lt.y-kt.y)>=Math.abs(Lt.x-kt.x),xt=[...t.flatMap((vt)=>vt.pointsToConnect),...e.obstacles.filter((vt)=>vt.componentId).flatMap((vt)=>[{x:vt.center.x-vt.width/2-0.6,y:vt.center.y-vt.height/2-0.6},{x:vt.center.x+vt.width/2+0.6,y:vt.center.y+vt.height/2+0.6}]),...[...d.values()].filter((vt)=>vt.coupledSection).flatMap((vt)=>vt.route)].map((vt)=>Bt?vt.x:vt.y),Yt=Math.min(...xt)-(xe+p)*2,ut=Math.max(...xt)+(xe+p)*2,Ze=Math.floor(ie/2)-1,Fe=Yt+(ut-Yt)*(Ze*5%9)/8,tt=[-0.15,0.2,0.5,0.8,1.15,0.35,0.65,0.1,0.9][Ze%9],Je=Bt?{x:Fe,y:kt.y+(Lt.y-kt.y)*tt}:{x:kt.x+(Lt.x-kt.x)*tt,y:Fe},$e=k3n(pt,Je,_e,Y,u.get(rt),f.get(te.name)),ft=$e.next();try{while(!ft.done)yield Me,ft=$e.next()}finally{if(!ft.done)$e.return(null)}if(ft.value)Ct.push(ft.value)}for(let kt of Ct){if(Ar(kt)>vy(e,te.name)+0.0000001)continue;let Lt=0;for(let Yt of d.values()){if(Yt.route[0].layer!==rt)continue;if(C.firstConflict(kt,Yt.route,(xe+Yt.route[0].width)/2+p-0.00000001))Lt++}let Bt=Ar(kt)+Lt*Ar(te.pointsToConnect),xt={score:Bt,trace:{type:"pcb_trace",pcb_trace_id:`bus_lane_${te.name}`,connection_name:te.name,source_trace_id:te.source_trace_id??te.name,route:kt.map((Yt)=>({...Yt,route_type:"wire",layer:rt,width:xe}))}};if(x.add(te.name,[xt.trace]),!dt||Bt<dt.score)dt=xt}}if(!dt){if(!Le.length)return null;for(let rt of ce){d.set(rt.connection_name,rt);let pt=Z.connections.find((ct)=>ct.name===rt.connection_name);for(let ct of pt.pointsToConnect)ct.layer=rt.route[0].layer}T.push(Z),i?.(U+1,t.length-d.size),yield[...o,...d.values()];continue e}for(let rt of te.pointsToConnect)rt.layer=dt.trace.route[0].layer;x.add(te.name,[dt.trace]),d.set(te.name,dt.trace)}let J=x.select(b,I);if(J){d.clear();for(let Z of J){d.set(Z.connection_name,Z);let te=t.find((ie)=>ie.name===Z.connection_name);for(let ie of te.pointsToConnect)ie.layer=Z.route[0].layer}}let ee=new Set,se=[...d.values()];for(let Z=0;Z<se.length;Z++)for(let te=0;te<Z;te++){let ie=se[Z],ce=se[te],ue=ie.route[0].layer;if(ue!==ce.route[0].layer)continue;let de=(ie.route[0].width+ce.route[0].width)/2+p,me=C.firstConflict(ie.route,ce.route,de-0.00000001);if(me){let[ge,xe]=me;ee.add(ie.connection_name),ee.add(ce.connection_name),_.get(ue).penalizeIntersection(u.get(ue),ie.route[ge-1],ie.route[ge],ce.route[xe-1],ce.route[xe],de*1.25,!0)}}if(ee.size)for(let Z of g){if(Z===X||!Z.connections.some((te)=>ee.has(te.name)))continue;for(let te of Z.connections)d.delete(te.name);if(!T.includes(Z))T.push(Z)}if(d.size>N)N=d.size,D=U;let ne=t.length-d.size;if(ne>0&&ne<=3&&!h&&H<6&&U>=g.length*2&&U-O>=g.length*4&&t.every((Z)=>d.has(Z.name)||!A.has(Z.name))){H++,O=U;let Z=jVr(e,t,[...n,...M],[...d.values()],r,{deferRetainedSelfClearance:c,maxSubsetSize:5,maxSearches:64,maxSearchSteps:6000,maxLengths:y}),te=Z.next();try{while(!te.done)yield[...o,...d.values()],te=Z.next()}finally{if(!te.done)Z.return(null)}if(te.value){d.clear();for(let ie of te.value)d.set(ie.connection_name,ie);ne=0}}if(ne>0&&ne<=3&&!h&&V<2&&U>=g.length*(e.buses?.length?8+V*4:2+V*2)&&x.hasEveryUnit(b)){V++;let Z=GVr(e,[...n,...M],r,x,b,I,s),te=Z.next();try{while(!te.done)yield[...o,...d.values()],te=Z.next()}finally{if(!te.done)Z.return(null)}if(te.value){d.clear();for(let ie of te.value){d.set(ie.connection_name,ie);for(let ce of t.find((ue)=>ue.name===ie.connection_name).pointsToConnect)ce.layer=ie.route[0].layer}ne=0}}if(i?.(U+1,ne),yield[...o,...d.values()],ne)continue;let re=[...o,...d.values()];for(let Z of d.values()){if(Z.coupledSection)continue;let te=t.find((ue)=>ue.name===Z.connection_name),ie=r.get(te.name),ce=new Mi(e,te,ie,[...n,...re.flatMap(Jr)]);Z.route=Hf(Z.route,ce).map((ue)=>({...ue,route_type:"wire",layer:te.pointsToConnect[0].layer,width:ie}))}return re}return null}function rst(e){if((e.buses?.length??0)<2)return null;let t=new Set([...(e.buses??[]).flatMap((r)=>r.connectionNames),...(e.differentialPairs??[]).flatMap((r)=>r.connectionNames)]);if(e.connections.some((r)=>!t.has(r.name)||r.pointsToConnect.some((i)=>i.layer!==r.pointsToConnect[0].layer)))return null;let n=[...new Set(e.connections.map((r)=>r.pointsToConnect[0].layer))];if(n.length<2)return null;let o=n.map((r)=>{let i=e.connections.filter((l)=>l.pointsToConnect[0].layer===r),s=new Set(i.map((l)=>l.name)),a=(e.buses??[]).filter((l)=>l.connectionNames.some((h)=>s.has(h))),c=(e.differentialPairs??[]).filter((l)=>l.connectionNames.some((h)=>s.has(h)));if(a.some((l)=>l.connectionNames.some((h)=>!s.has(h)))||c.some((l)=>l.connectionNames.some((h)=>!s.has(h)))||c.length>1)return null;return{...e,connections:i,buses:a,differentialPairs:c}});return o.every((r)=>r!==null)?o:null}function*$Vr(e,t,n,o){let r=[];for(let i of e){let s=i.differentialPairs?.[0],a=i.connections.filter((h)=>!s?.connectionNames.includes(h.name)),c=null,l=mk(i)?[0,5,1,4,2,3]:[0,1,2,3,4,5];for(let h of l){if(c)break;let d=[];if(s){let m=zk(i,s,t,{copper:[],penalty:0,variant:h}),A=m.next(),g=0;try{while(!A.done&&g++<12000)yield r,A=m.next()}finally{if(!A.done)m.return(null)}if(!A.done||!A.value)continue;d=A.value}if(!a.length){c=o(i,d);continue}let u=VY(i,a,t,d,n,void 0,new Map,()=>!1),_=u.next(),p=0;try{while(!_.done&&p++<12000)yield[...r,..._.value],_=u.next()}finally{if(!_.done)u.return(null)}if(_.done&&_.value){let m=Wot(i,_.value,t),A=m.next(),g=0;try{while(!A.done&&g++<6000)yield[...r,..._.value],A=m.next()}finally{if(!A.done)m.return(!1)}if(!A.done||!A.value)continue;c=o(i,_.value)}}if(!c)return null;r.push(...c),yield r}return r}function*L3n(e,t,n=0){let o=new Set([...(e.buses??[]).flatMap((h)=>h.connectionNames),...(e.differentialPairs??[]).flatMap((h)=>h.connectionNames)]),r=rst({...e,connections:e.connections.filter((h)=>o.has(h.name))});if(!r||r.some((h)=>h.differentialPairs?.length!==1))return null;let i=sa(e),s=[],a=[];for(let h of r){let d=h.differentialPairs[0],u=!1;for(let _=0;_<6&&!u;_++){let p=zk(h,d,i,{copper:[],penalty:0,variant:(_+(typeof n==="number"?n:n[s.length]??0))%6}),m=p.next(),A=0;try{while(!m.done&&A++<8000)yield,m=p.next()}finally{if(!m.done)p.return(null)}if(!m.done||!m.value)continue;let g=I7e(h,m.value),f=g.map((j)=>j.route.slice(j.coupledSection[0],j.coupledSection[1]+1));if(f[0].length!==f[1].length)continue;let y=f[0].map((j,Y)=>({x:(j.x+f[1][Y].x)/2,y:(j.y+f[1][Y].y)/2})),x=f[0][0].width,C=d.traceGap??e.minTraceToPadEdgeClearance??e.defaultObstacleMargin??0.075,b=x+C,I=x+b,v=f[0][0].layer,P=(j,Y)=>{let X=Fn(j,Y),K=Math.min(X*0.95,x*5);return{x:j.x+(Y.x-j.x)*K/X,y:j.y+(Y.y-j.y)*K/X}},M=P(y[0],y[1]),B=P(y.at(-1),y.at(-2)),T=`pair_${d.connectionNames[0]}`,N=[-b/2,b/2].sort((j,Y)=>Fn(wA(y,j)[0],f[0][0])-Fn(wA(y,Y)[0],f[0][0])),D={name:T,nominalTraceWidth:I,pointsToConnect:[M,B].map((j)=>({...j,layer:v}))},L=[],H=[],V=[];for(let j=0;j<2;j++)for(let Y=0;Y<2;Y++){let X=g[j],K=f[j],J=Y?K.at(-1):K[0],ee=e.connections.find((ie)=>ie.name===X.connection_name).pointsToConnect[Y],se=`approach_${X.connection_name}_${Y}`;L.push({name:se,source_trace_id:X.connection_name,nominalTraceWidth:x,pointsToConnect:[ee,J]});let ne=wA(Y?[B,y.at(-1)]:[y[0],M],N[j]).map((ie)=>({...ie,route_type:"wire",layer:v,width:x})),re={type:"pcb_trace",pcb_trace_id:se,connection_name:T,source_trace_id:X.connection_name,route:ne};H.push(re);let[Z,te]=X.coupledSection;V.push({...re,route:Y?[...ne,...X.route.slice(te+1)]:[...X.route.slice(0,Z),...ne]})}let O=new al(new Mi(e,D,I,[...i,...V.flatMap(Jr)]),D.pointsToConnect[0],D.pointsToConnect[1]);try{let j=0;while(!O.solved&&!O.failed&&j++<4000)O.step(),yield;if(!O.solved)continue}finally{O.cancel()}let U=!e.buses?.some((j)=>d.connectionNames.some((Y)=>j.connectionNames.includes(Y)));s.push({rails:g,sections:f,center:y,width:x,envelope:I,offsets:N,connection:D,approaches:U?[]:L,pair:d}),a.push(...U?V:H),u=!0}if(!u)return null}let c=new Map(s.flatMap((h)=>h.pair.connectionNames.map((d)=>[d,h.connection.name]))),l={...e,obstacles:[...e.obstacles,...s.flatMap((h)=>h.connection.pointsToConnect.map((d)=>({shape:"circle",center:{x:d.x,y:d.y},width:h.envelope,height:h.envelope,layers:[d.layer],connectedTo:[h.connection.name,...h.pair.connectionNames]})))],connections:[...e.connections.filter((h)=>!c.has(h.name)),...s.map((h)=>h.connection),...s.flatMap((h)=>h.approaches)],differentialPairs:[],traces:[...e.traces??[],...a],buses:e.buses?.map((h)=>{let d=[...new Set(h.connectionNames.map((u)=>c.get(u)??u))];return{...h,connectionNames:[...d,...s.filter((u)=>d.includes(u.connection.name)).flatMap((u)=>u.approaches.map((_)=>_.name))]}})};return{input:e,local:l,transforms:s,layers:t,copper:sa(l),widths:new Map(l.connections.map((h)=>[h.name,e.buses?.find((d)=>d.connectionNames.includes(h.name))?.traceWidth??h.nominalTraceWidth??h.width??e.minTraceWidth]))}}function*Kot(e,t,n={}){let{input:o,local:r,transforms:i}=e,s=sa(o),a=[...t],c=o.minTraceToPadEdgeClearance??o.defaultObstacleMargin??0.075,l=a.filter((h)=>o.connections.some((d)=>d.name===h.connection_name));for(let h of i){let{connection:d,center:u,width:_,envelope:p,offsets:m}=h,A=a.findIndex((x)=>x.connection_name===d.name);if(A<0)return null;let g=a[A].route[0].layer,f=a.filter((x,C)=>C!==A),y=null;for(let x of[0,_*6,_*10]){let C=[{x:d.pointsToConnect[0].x-u[0].x,y:d.pointsToConnect[0].y-u[0].y},{x:u.at(-1).x-d.pointsToConnect[1].x,y:u.at(-1).y-d.pointsToConnect[1].y}],b=new Mi({...r},d,p,[...e.copper,...f.flatMap(Jr)]),I=b.visible.bind(b),v=(O,U,j)=>(U.x-O.x)*j.x+(U.y-O.y)*j.y>0&&Math.abs((U.x-O.x)*j.y-(U.y-O.y)*j.x)<0.00000001;b.visible=(O,U)=>{for(let[j,Y]of d.pointsToConnect.entries()){let X=C[j],K={x:-X.x,y:-X.y};if(Fn(O,Y)<0.00000001&&!v(O,U,j?K:X))return!1;if(Fn(U,Y)<0.00000001&&!v(O,U,j?X:K))return!1}return I(O,U)};let P=d.pointsToConnect.map((O,U)=>{let j=C[U],Y=(U?-1:1)*x/Math.hypot(j.x,j.y);return{...O,x:O.x+Y*j.x,y:O.y+Y*j.y}});if(x&&(!b.pathVisible([d.pointsToConnect[0],P[0]])||!b.pathVisible([P[1],d.pointsToConnect[1]])))continue;let M=new al(b,P[0],P[1],[],4,void 0,{allTerminalAttachments:!0}),B=null;try{let O=0;while(!M.solved&&!M.failed&&O++<1000)M.step(),yield;if(M.solved)B=Hf(M.result,b)}finally{M.cancel()}if(!B)continue;if(x)B=[d.pointsToConnect[0],...B,d.pointsToConnect[1]];if(!Wc(B,p+c))continue;let T={...a[A],route:B.map((O)=>({...O,route_type:"wire",layer:g,width:p}))},N={...T,route:W2([u[0],...B,u.at(-1)]).map((O)=>({...O,route_type:"wire",layer:g,width:p}))},D={...r,connections:r.connections.map((O)=>O.name===d.name?{...O,pointsToConnect:[u[0],u.at(-1)].map((U)=>({...U,layer:g}))}:O)},L=Mk(D,[N],[...s,...f.filter((O)=>!h.approaches.some((U)=>U.name===O.connection_name)).flatMap(Jr)],2)[0],H=qVr(h,L,a);if(!H)continue;let V=[...s,...H.flatMap(Jr)];if(h.approaches.length&&H.some((O)=>!new Mi(o,o.connections.find((U)=>U.name===O.connection_name),_,V).pathVisible(O.route)))continue;if(H.some((O)=>!Wc(O.route.slice(O.coupledSection[0],O.coupledSection[1]+1),_+c)))continue;a[A]=T,y=H;break}if(!y)return null;l.push(...y)}for(let h of o.connections){let d=l.find((u)=>u.connection_name===h.name);if(!d){if(n.allowPartial)continue;return null}for(let u of h.pointsToConnect)u.layer=d.route[0].layer}return l}function qVr(e,t,n){let{width:o,offsets:r}=e,i=t.route[0].layer,s=[];for(let[a,c]of e.rails.entries()){let[l,h]=c.coupledSection,d=n.find((p)=>p.connection_name===`approach_${c.connection_name}_0`)?.route??(e.approaches.length?void 0:c.route.slice(0,l+1)),u=n.find((p)=>p.connection_name===`approach_${c.connection_name}_1`)?.route.toReversed()??(e.approaches.length?void 0:c.route.slice(h));if(!d||!u)return null;let _=wA(t.route,r[a]).map((p)=>({...p,route_type:"wire",layer:i,width:o}));if(Fn(d.at(-1),_[0])>0.00000001||Fn(u[0],_.at(-1))>0.00000001)return null;s.push({...c,curvedSegments:e.approaches.length?[]:c.curvedSegments?.flatMap((p)=>p<=l?[p]:p>h?[p+_.length-(h-l+1)]:[]),route:[...d.slice(0,-1),..._,...u.slice(1)],coupledSection:[d.length-1,d.length+_.length-2]})}return s}function H3n(e,t){let n=[...t],o=sa(e),r=e.minTraceToPadEdgeClearance??e.defaultObstacleMargin??0.075;for(let i of e.differentialPairs??[]){let s=i.connectionNames.map((A)=>n.findIndex((g)=>g.connection_name===A)),a=s.map((A)=>n[A]);if(a.some((A)=>!A?.coupledSection||A.curvedSegments?.some((g)=>g>A.coupledSection[0]&&g<=A.coupledSection[1])))continue;let c=a.map((A)=>A.route.slice(A.coupledSection[0],A.coupledSection[1]+1));if(c[0].length!==c[1].length)continue;let l=c[0][0].width,h=(l+(i.traceGap??r))/2,d=c[0].map((A,g)=>({x:(A.x+c[1][g].x)/2,y:(A.y+c[1][g].y)/2})),u=[-h,h].sort((A,g)=>Fn(wA(d,A)[0],c[0][0])-Fn(wA(d,g)[0],c[0][0])),_=(A)=>a.map((g,f)=>{let[y,x]=g.coupledSection,C=wA(A,u[f]).map((I)=>({...I,route_type:"wire",layer:c[f][0].layer,width:l})),b=C.length-(x-y+1);return{...g,route:[...g.route.slice(0,y),...C,...g.route.slice(x+1)],coupledSection:[y,x+b],curvedSegments:g.curvedSegments?.map((I)=>I>x?I+b:I)}}),p=n.filter((A,g)=>!s.includes(g)).flatMap(Jr),m=a;for(let A=1;A+1<d.length;A++){let[g,f,y]=d.slice(A-1,A+2),x=Fn(g,f),C=Fn(f,y);if(Math.min(x,C)<0.00000001)continue;let b={x:(f.x-g.x)/x,y:(f.y-g.y)/x},I={x:(y.x-f.x)/C,y:(y.y-f.y)/C},v=b.x*I.x+b.y*I.y;if(v>Math.SQRT1_2-0.00000001)continue;for(let P=0;P<10;P++){let M=Math.min(l*10,x/2,C/2)/2**P,B={x:f.x-b.x*M,y:f.y-b.y*M},T={x:f.x+I.x*M,y:f.y+I.y*M},N=Math.sign(b.x*I.y-b.y*I.x),D=(Math.SQRT2-1)*M,L={x:B.x+(b.x-N*b.y)*Math.SQRT1_2*D,y:B.y+(b.y+N*b.x)*Math.SQRT1_2*D},H=v<-0.1?[B,L,T]:[B,T],V=[...d.slice(0,A),...H,...d.slice(A+1)],O=_(V);if(O.some((j,Y)=>Wc(m[Y].route,l+r)&&!Wc(j.route,l+r)))continue;let U=[...o,...p,...O.flatMap(Jr)];if(O.some((j)=>!new Mi(e,e.connections.find((Y)=>Y.name===j.connection_name),l,U).pathVisible(j.route)))continue;if(wk({...e,differentialPairs:[i]},O).some((j)=>!j.matched))continue;d=V,m=O,A+=H.length-1;break}}s.forEach((A,g)=>{n[A]=m[g]})}return n}function F3n(e,t,n=sa(e)){let o=[...t],r=e.minTraceToPadEdgeClearance??e.defaultObstacleMargin??0.075,i=32;for(let s of e.differentialPairs??[]){let a=s.connectionNames.map((m)=>o.findIndex((A)=>A.connection_name===m)),c=a.map((m)=>o[m]);if(c.some((m)=>!m?.coupledSection))continue;let l=c.map((m)=>m.route.slice(m.coupledSection[0],m.coupledSection[1]+1)),h=l[0][0].width;if(l[0].length!==l[1].length||l.flat().some((m)=>m.route_type!=="wire"||m.width!==h||m.layer!==l[0][0].layer))continue;let d=l[0].map((m,A)=>({x:(m.x+l[1][A].x)/2,y:(m.y+l[1][A].y)/2})),u=(h+(s.traceGap??r))/2,_=[-u,u].sort((m,A)=>Fn(wA(d,m)[0],l[0][0])-Fn(wA(d,A)[0],l[0][0])),p=o.filter((m,A)=>!a.includes(A)).flatMap(Jr);for(let m=1;m+2<d.length;m++){if(c.some((J)=>J.curvedSegments?.some((ee)=>ee>=J.coupledSection[0]+m&&ee<=J.coupledSection[0]+m+2)))continue;let[A,g,f,y]=d.slice(m-1,m+3),x=Fn(A,g),C=Fn(f,y);if(Math.min(x,C)<0.00000001)continue;let b={x:(g.x-A.x)/x,y:(g.y-A.y)/x},I={x:(y.x-f.x)/C,y:(y.y-f.y)/C};if(b.x*I.x+b.y*I.y>-0.99999999)continue;let v={x:-b.y,y:b.x},P=(f.x-g.x)*v.x+(f.y-g.y)*v.y,M=Math.sign(P),B=Math.abs(P)/2;if(B<u/Math.cos(Math.PI/64)+(h+r)/2+0.00000001)continue;let T=(g.x-f.x)*b.x+(g.y-f.y)*b.y,N=Math.max(0,T),D=Math.max(0,-T);if(N>=x-0.00000001||D>=C-0.00000001)continue;let L={x:g.x-b.x*N,y:g.y-b.y*N},H={x:f.x+I.x*D,y:f.y+I.y*D},V={x:L.x+v.x*B*M,y:L.y+v.y*B*M},O=Math.atan2(L.y-V.y,L.x-V.x),U=Array.from({length:33},(J,ee)=>({x:V.x+B*Math.cos(O+M*Math.PI*ee/32),y:V.y+B*Math.sin(O+M*Math.PI*ee/32)}));U[0]=L,U[32]=H;let j=[...d.slice(0,m),...U,...d.slice(m+2)],Y=31,X=c.map((J,ee)=>{let[se,ne]=J.coupledSection,re=wA(j,_[ee]).map((Z)=>({...Z,route_type:"wire",layer:l[ee][0].layer,width:h}));return re[0]={...J.route[se]},re[re.length-1]={...J.route[ne]},{...J,route:[...J.route.slice(0,se),...re,...J.route.slice(ne+1)],coupledSection:[se,ne+Y],curvedSegments:[...(J.curvedSegments??[]).map((Z)=>Z>se+m+1?Z+Y:Z),...Array.from({length:32},(Z,te)=>se+m+te+1)].sort((Z,te)=>Z-te)}}),K=[...n,...p,...X.flatMap(Jr)];if(X.some((J)=>!Wc(J.route,h+r)||!new Mi(e,e.connections.find((ee)=>ee.name===J.connection_name),h,K).pathVisible(J.route)))continue;if(wk({...e,differentialPairs:[s]},X).some((J)=>!J.matched))continue;a.forEach((J,ee)=>{o[J]=X[ee]});break}}return o}function*QJ(e,t,n,o,r=new Map,i={}){let s=0,a=e.minTraceToPadEdgeClearance??e.defaultObstacleMargin??0.075;function*c(h,d,u){if(++s>(i.maxSearches??200))return null;let _={...h,pointsToConnect:h.pointsToConnect.map((g)=>({...g,layer:u}))},p=o.get(h.name)??e.minTraceWidth,m=new Mi(e,_,p,[...n,...d.flatMap(Jr)]),A=new al(m,_.pointsToConnect[0],_.pointsToConnect[1]);try{let g=0;while(!A.solved&&!A.failed&&g++<1000)A.step(),yield;if(!A.solved)return null;let f=i.requireSelfClear?Hf(A.result,m):A.result;if(i.requireSelfClear&&!Wc(f,p+a))return null;return{type:"pcb_trace",pcb_trace_id:h.name,connection_name:h.name,source_trace_id:h.source_trace_id,route:f.map((y)=>({...y,route_type:"wire",layer:u,width:p}))}}finally{A.cancel()}}function*l(h,d,u=0,_=new Set){if(!h.length)return d;if(s>=(i.maxSearches??200))return null;let p=h[0],m=r.get(p.name)??[p.pointsToConnect[0].layer];for(let A of m){let g=yield*c(p,d,A);if(!g)continue;let f=yield*l(h.slice(1),[...d,g],u,new Set([..._,p.name]));if(f)return f}if(u>=(i.maxDepth??5))return null;for(let A of d){if(A.coupledSection||!A.connection_name||_.has(A.connection_name)||!m.includes(A.route[0].layer))continue;let g=e.connections.find((f)=>f.name===A.connection_name);if(!g)continue;for(let f of m){let y=d.filter((b)=>b!==A),x=yield*c(p,y,f);if(!x)continue;let C=yield*l([...h.slice(1),g],[...y,x],u+1,new Set([..._,p.name]));if(C)return C}}return null}return yield*l(e.connections.filter((h)=>!t.some((d)=>d.connection_name===h.name)),t)}function*z3n(e,t){let{input:n,layers:o,transforms:r}=e,i=sa(n),s=n.minTraceToPadEdgeClearance??n.defaultObstacleMargin??0.075,a=structuredClone(t),c=new Set,l=new Map(n.connections.map((g)=>[g.name,n.buses?.find((f)=>f.connectionNames.includes(g.name))?.traceWidth??g.nominalTraceWidth??g.width??n.minTraceWidth]));for(let g of a){if(g.coupledSection)continue;if(!(yield*Wot(n,[g],[...i,...a.filter((y)=>y!==g).flatMap(Jr)])))c.add(g)}for(let g of a){if(!g.coupledSection)continue;for(let v of[0,1]){let[P,M]=g.coupledSection,B=v?g.route.slice(M):g.route.slice(0,P+1),T=v?g.route.slice(0,M):g.route.slice(P+1),N={...g,coupledSection:void 0,curvedSegments:void 0,route:B},D={...n.connections.find((O)=>O.name===g.connection_name),pointsToConnect:[B[0],B.at(-1)]},L={...n,connections:[D]},H=[...i,...a.filter((O)=>O!==g).flatMap(Jr),...Jr({...g,connection_name:"reserved_other_approach",source_trace_id:void 0,route:T})];if(yield*Wot(L,[N],H)){if(N.route!==B){let O=N.route.length-B.length;g.curvedSegments=g.curvedSegments?.flatMap((U)=>v?U<=M?[U]:[]:U>P?[U+O]:[])}if(g.route=v?[...g.route.slice(0,M),...N.route]:[...N.route,...g.route.slice(P+1)],!v)g.coupledSection=[N.route.length-1,M+N.route.length-B.length]}}let[f,y]=g.coupledSection,x=g.route[0].width,C=new Mi(n,n.connections.find((v)=>v.name===g.connection_name),x,[...i,...a.flatMap(Jr)]),b=g.curvedSegments?.some((v)=>v<=f)?g.route.slice(0,f+1):Hf(g.route.slice(0,f+1),C),I=g.curvedSegments?.some((v)=>v>y)?g.route.slice(y):Hf(g.route.slice(y),C);g.curvedSegments=g.curvedSegments?.map((v)=>v>f?v+b.length-(f+1):v),g.route=[...b.slice(0,-1),...g.route.slice(f,y+1),...I.slice(1)].map((v)=>({...v,route_type:"wire",width:x,layer:g.route[0].layer})),g.coupledSection=[b.length-1,b.length+y-f-1]}let h=yield*QJ(n,a.filter((g)=>!c.has(g)),i,l,o,{requireSelfClear:!0,maxSearches:1000});if(!h)return null;let d=F3n(n,H3n(n,h),i),u=(g)=>Ar(g.route)+Lf(n,g.connection_name);for(let g of r){let f=g.pair.connectionNames.map((v)=>d.find((P)=>P.connection_name===v)),y=f.map((v)=>{let P=g.rails.find((H)=>H.connection_name===v.connection_name),[M,B]=P.coupledSection,[T,N]=v.coupledSection,D=v.route.slice(T,N+1),L=D.length-(B-M+1);return{...v,route:[...P.route.slice(0,M),...D,...P.route.slice(B+1)],coupledSection:[M,M+D.length-1],curvedSegments:[...(P.curvedSegments??[]).flatMap((H)=>H<=M?[H]:H>B?[H+L]:[]),...(v.curvedSegments??[]).filter((H)=>H>T&&H<=N).map((H)=>H+M-T)]}});if(Math.abs(u(y[0])-u(y[1]))>=Math.abs(u(f[0])-u(f[1]))-0.00000001)continue;let x=[...i,...d.filter((v)=>v.coupledSection&&!f.includes(v)).flatMap(Jr),...y.flatMap(Jr)];if(y.some((v)=>!Wc(v.route,v.route[0].width+s)||!new Mi(n,n.connections.find((P)=>P.name===v.connection_name),v.route[0].width,x).pathVisible(v.route)))continue;let b=d.map((v)=>y.find((P)=>P.connection_name===v.connection_name)??v).filter((v)=>v.coupledSection||y.every((P)=>new Mi(n,n.connections.find((M)=>M.name===P.connection_name),P.route[0].width,Jr(v)).pathVisible(P.route))),I=yield*QJ(n,b,i,l,o,{requireSelfClear:!0,maxSearches:200});if(I)d=I}let _=d.filter((g)=>g.coupledSection),p=d.filter((g)=>g.coupledSection||_.every((f)=>new Mi(n,n.connections.find((y)=>y.name===f.connection_name),f.route[0].width,Jr(g)).pathVisible(f.route))),m=yield*QJ(n,p,i,l,o,{requireSelfClear:!0,maxSearches:1000});if(!m)return null;let A=m;for(let g of r.filter((f)=>!f.approaches.length)){let y=A.map((C)=>g.rails.find((b)=>b.connection_name===C.connection_name)??C).filter((C)=>C.coupledSection||g.rails.every((b)=>new Mi(n,n.connections.find((I)=>I.name===b.connection_name),b.route[0].width,Jr(C)).pathVisible(b.route))),x=yield*QJ(n,y,i,l,o,{requireSelfClear:!0,maxSearches:1000});if(!x)return null;A=x}for(let g of n.connections)for(let f of g.pointsToConnect)f.layer=A.find((y)=>y.connection_name===g.name).route[0].layer;return A}function*JVr(e,t){let n=yield*L3n(e,t);if(!n)return null;let{local:o,copper:r,widths:i}=n,s=VY(o,o.connections,r,[],i,void 0,t,()=>!1,!0),a=null,c=0;try{let h=s.next(),d=0;while(!h.done&&d++<200000){if(h.value.length>c){if(c=h.value.length,c>=o.connections.length-1){if(a=yield*QJ(o,h.value,r,i,t,{maxSearches:120}),a)break}}yield,h=s.next()}if(h.done)a=h.value}finally{s.return(null)}if(!a)return null;let l=yield*Kot(n,a);if(!l)return null;return yield*z3n(n,l)}function ZVr(e,t,n,o,r,i,s){let a=n.map((d)=>({...d,route:d.route.map((u)=>({...u}))})),c=r+i,l=(d,u)=>d.x*u.y-d.y*u.x,h=(d,u)=>({x:d.x-u.x,y:d.y-u.y});for(let d=0;d<2;d++){let u=a[d];for(let _=1;_+2<u.route.length;_++){if(u.coupledSection&&_+1>=u.coupledSection[0]&&_<=u.coupledSection[1])continue;let[p,m,A,g]=u.route.slice(_-1,_+3),f=Fn(m,A);if(f<4*c)continue;let y={x:(A.x-m.x)/f,y:(A.y-m.y)/f},x=a[1-d].route;for(let C=0;C+1<x.length;C++){let b=x[C],I=x[C+1],v=h(I,b);if(Math.abs(l(y,v))>0.0000001)continue;let P=l(y,h(b,m));if(Math.abs(P)<=c+0.0000001||Math.abs(P)>2*c)continue;let M=[b,I].map((O)=>(O.x-m.x)*y.x+(O.y-m.y)*y.y);if(Math.min(f,Math.max(...M))-Math.max(0,Math.min(...M))<4*c)continue;let B=P-Math.sign(P)*c,T={x:m.x-y.y*B,y:m.y+y.x*B},N=(O,U)=>{let j=l(U,y);if(Math.abs(j)<0.00000001)return null;let Y=l(h(T,O),y)/j;return{x:O.x+Y*U.x,y:O.y+Y*U.y}},D=N(p,h(m,p)),L=N(g,h(A,g));if(!D||!L||Fn(D,m)>2*c||Fn(L,A)>2*c)continue;let H={...A,x:A.x-y.x*(2*c+Math.abs(B))-y.y*B,y:A.y-y.y*(2*c+Math.abs(B))+y.x*B},V={...A,x:A.x-y.x*2*c,y:A.y-y.y*2*c};for(let O of[[{...m,...D},{...A,...L}],[{...m,...D},H,V,A]]){let U=(Y,X,K)=>(X.x-Y.x)*K.x+(X.y-Y.y)*K.y>0.0000000001;if(!U(p,O[0],h(m,p))||!U(O.at(-1),g,h(g,A))||!U(O[0],O.at(-1),y))continue;let j=[...u.route.slice(0,_),...O,...u.route.slice(_+2)];if(!Wc(j,r+s))continue;if(!new Mi(e,t[d],r,[...o,...Jr(a[1-d])]).pathVisible(j))continue;if(u.route=j,u.coupledSection)u.coupledSection=u.coupledSection.map((Y)=>Y>_?Y+O.length-2:Y);_+=O.length-2;break}if(u.route[_]!==m)break}}}return a}function O3n(e,t,n,o,r,i,s=6){if(!Number.isFinite(s)||s<=0)throw Error("Pair corner trim must be a positive finite number of trace widths");let a=n.map((c)=>({...c,route:[...c.route]}));for(let c=0;c<2;c++){let l=a[c];for(let h=1;h<l.route.length-1;h++){if(l.curvedSegments?.includes(h)||l.curvedSegments?.includes(h+1))continue;if(l.coupledSection&&h>l.coupledSection[0]&&h<l.coupledSection[1])continue;let[d,u,_]=l.route.slice(h-1,h+2),p=Fn(d,u),m=Fn(u,_);if(p<0.00000001||m<0.00000001)continue;let A={x:(u.x-d.x)/p,y:(u.y-d.y)/p},g={x:(_.x-u.x)/m,y:(_.y-u.y)/m};if(Math.abs(A.x*g.x+A.y*g.y+Math.SQRT1_2)>0.000001)continue;let f=Math.sign(A.x*g.y-A.y*g.x),y=Math.min(r*s,p/2,m*0.8),x={...u,x:u.x-A.x*y,y:u.y-A.y*y},C=(Math.SQRT2-1)*y,b={...u,x:x.x+(A.x-f*A.y)*Math.SQRT1_2*C,y:x.y+(A.y+f*A.x)*Math.SQRT1_2*C},I={...u,x:u.x+g.x*y,y:u.y+g.y*y},v=[...l.route.slice(0,h),x,b,I,...l.route.slice(h+1)];if(!Wc(v,r+i)||!new Mi(e,t[c],r,[...o,...Jr(a[1-c])]).pathVisible(v))continue;if(l.route=v,l.curvedSegments)l.curvedSegments=l.curvedSegments.map((P)=>P>h?P+2:P);if(l.coupledSection)l.coupledSection=l.coupledSection.map((P,M)=>P>h?P+2:P===h&&M===0?P+2:P);h+=2}}return a}function eYr(e,t,n,o,r,i,s,a){let c=n.map((h)=>({...h,route:[...h.route]})),l=r+i;for(let h=0;h<2;h++){let d=c[h],u=c[1-h];if(!d.coupledSection||!u.coupledSection)continue;let _=d.coupledSection[1]-1,p=u.coupledSection[1]-1;for(let m=d.coupledSection[1]+1;m<d.route.length-1;m++){let A=d.route[m],g=d.route[m+1],f=Fn(A,g);if(f<4*l)continue;let y={x:(g.x-A.x)/f,y:(g.y-A.y)/f};for(let x=u.coupledSection[1]+1;x<u.route.length-1;x++){let C=u.route[x],b=u.route[x+1],I=Fn(C,b);if(I<4*l||Math.abs((b.x-C.x)/I-y.x)>0.0000001||Math.abs((b.y-C.y)/I-y.y)>0.0000001)continue;let v=-(C.x-A.x)*y.y+(C.y-A.y)*y.x;if(Math.abs(Math.abs(v)-l)>0.0000001)continue;let P=(V)=>(V.x-A.x)*y.x+(V.y-A.y)*y.y;if(P(b)<f-0.0000001||P(C)>f-4*l)continue;let M;try{M=a(d.route.slice(_,m+2),v)}catch{continue}let B=u.route[p],T=u.route[p+1],N=T.x-B.x,D=T.y-B.y;if(Math.abs((M[0].x-B.x)*D-(M[0].y-B.y)*N)>0.0000001)continue;let L={x:M[1].x-M[0].x,y:M[1].y-M[0].y};if((M[1].x-B.x)*L.x+(M[1].y-B.y)*L.y<=0.0000000001)continue;M=M.slice(1);let H=[...u.route.slice(0,p+1),...M.map((V)=>({...u.route[0],...V})),...u.route.slice(Fn(M.at(-1),u.route[x+1])<0.00000001?x+2:x+1)];if(!Wc(H,r+s)||!new Mi(e,t[1-h],r,[...o,...Jr(d)]).pathVisible(H))continue;return u.route=H,u.coupledSection=[u.coupledSection[0],p+M.length],d.coupledSection=[d.coupledSection[0],m+1],c}}}return n}var GV=(e,t)=>e.x*t.x+e.y*t.y,tYr=(e)=>{if(!e.coupledSection)return;let t=e.coupledSection[1];if(t<1||t+2>=e.route.length)return;let n=e.route[t-1],o=e.route[t],r=Fn(n,o);if(r<0.00000001)return;let i={x:(o.x-n.x)/r,y:(o.y-n.y)/r};for(let s=t;s+2<e.route.length;s++){let[a,c,l]=e.route.slice(s,s+3),h=Fn(a,c);if(h<0.00000001)return;let d={x:(c.x-a.x)/h,y:(c.y-a.y)/h};if(Fn(d,i)<0.0000001)continue;let u=Fn(c,l);if(u<0.00000001)return;let _={x:(l.x-c.x)/u,y:(l.y-c.y)/u};if(Math.abs(i.x*d.x+i.y*d.y-Math.SQRT1_2)>0.0000001||Fn(_,i)>0.0000001||e.curvedSegments?.some((p)=>p===s||p===s+1||p===s+2))return;return{index:s,direction:i,handedness:Math.sign(i.x*d.y-i.y*d.x)}}};function nYr(e,t,n,o,r,i,s,a){let c=n.map(tYr);if(!c[0]||!c[1]||c[0].handedness!==c[1].handedness||Fn(c[0].direction,c[1].direction)>0.0000001)return n;let l=c[0].direction,h=r+i,d=n.map((f,y)=>{let x=c[y],C=c[1-y],b=x.index;if(b<=f.coupledSection[1])return;let I=n[1-y],v=I.route[C.index],P=-(f.route[b].x-v.x)*l.y+(f.route[b].y-v.y)*l.x,M;try{M=a(I.route.slice(C.index-1,C.index+3),Math.sign(P)*h)}catch{return}let B=(GV(M[1],l)-GV(f.route[b],l)+(GV(M[2],l)-GV(f.route[b+1],l)))/2;if(Math.abs(B)<0.00000001||Fn(f.route[b-1],f.route[b])+B<=0.00000001||Fn(f.route[b+1],f.route[b+2])-B<=0.00000001)return;let T=f.route.map((N,D)=>D===b||D===b+1?{...N,x:N.x+l.x*B,y:N.y+l.y*B}:N);if(!Wc(T,r+s)||!new Mi(e,t[y],r,[...o,...Jr(I)]).pathVisible(T))return;return{...f,route:T}});if(d.every((f)=>!f))return n;let u=[n,...d.flatMap((f,y)=>f?[n.map((x,C)=>C===y?f:x)]:[])].flatMap((f)=>f.flatMap((y,x)=>[y.route[c[x].index],y.route[c[x].index+1]]).map((y)=>GV(y,l))),_=Math.min(...u)-h,p=Math.max(...u)+h,m=(f)=>{let y=0;for(let x=0;x<2;x++){let C=f[x].route,b=f[1-x].route,I=c[x].index;for(let v=I-1;v<=I+1;v++){let P=C[v],M=C[v+1],B=GV(P,l),T=GV(M,l)-B;if(T<=0||B>p||B+T<_)continue;let N=Math.max(0,(_-B)/T),D=Math.min(1,(p-B)/T),L=Math.max(1,Math.ceil(Fn(P,M)*(D-N)*16/h));for(let H=0;H<=L;H++){let V=N+(D-N)*H/L,O={x:P.x+(M.x-P.x)*V,y:P.y+(M.y-P.y)*V},U=1/0;for(let j=1;j<b.length;j++)U=Math.min(U,uk(O,[b[j-1],b[j]]));y=Math.max(y,U-r)}}}return y},A=n,g=m(n);for(let f=0;f<2;f++){if(!d[f])continue;let y=n.map((C,b)=>b===f?d[f]:C),x=m(y);if(x<g-0.0000001)A=y,g=x}return A}function oYr(e,t,n){let o=[...t],r=e.minTraceToPadEdgeClearance??e.defaultObstacleMargin??0.075;for(let i of e.differentialPairs??[]){let s=i.connectionNames.map((A)=>o.findIndex((g)=>g.connection_name===A)),a=s.map((A)=>o[A]);if(a.some((A)=>!A?.coupledSection))continue;let c=i.connectionNames.map((A)=>e.connections.find((g)=>g.name===A)),l=[...n,...o.filter((A,g)=>!s.includes(g)).flatMap(Jr)],h=a[0].route[0].width,d=i.traceGap??r,u=ZVr(e,c,a,l,h,d,r),_=O3n(e,c,u,l,h,r),p=nYr(e,c,_,l,h,d,r,wA),m=eYr(e,c,p,l,h,d,r,wA);s.forEach((A,g)=>{o[A]=m[g]})}return o}function rYr(e,t,n,o){let r=[...t],i=e.minTraceToPadEdgeClearance??e.defaultObstacleMargin??0.075;for(let s of e.differentialPairs??[]){let a=s.connectionNames.map((u)=>r.findIndex((_)=>_.connection_name===u)),c=a.map((u)=>r[u]);if(c.some((u)=>!u?.coupledSection))continue;let l=s.connectionNames.map((u)=>e.connections.find((_)=>_.name===u)),h=[...n,...r.filter((u,_)=>!a.includes(_)).flatMap(Jr)],d=O3n(e,l,c,h,c[0].route[0].width,i,o);a.forEach((u,_)=>{r[u]=d[_]})}return r}function RAn(e,t){let n=e.map(()=>new Set),o=e.map(()=>0),r=(c,l)=>{if(!n[c].has(l))n[c].add(l),o[l]++};for(let c=0;c<e.length;c++){let l=e[c];if(Math.abs(l.to-l.from)<0.00000001)continue;for(let h=0;h<e.length;h++){if(c===h)continue;let d=e[h],u=(l.width+d.width)/2+t,_=(p)=>p>Math.min(l.from,l.to)-u+0.00000001&&p<Math.max(l.from,l.to)+u-0.00000001;if(_(d.from))r(h,c);if(_(d.to))r(c,h)}}let i=e.map(()=>0),s=o.flatMap((c,l)=>c===0?[l]:[]),a=0;for(let c=0;c<s.length;c++){let l=s[c];a++;for(let h of n[l])if(i[h]=Math.max(i[h],i[l]+(e[l].width+e[h].width)/2+t),--o[h]===0)s.push(h)}return a===e.length?i:null}function Vde(e,t){let n=(e.curvedSegments??[]).flatMap((r)=>r>0&&r<e.route.length?[[e.route[r-1],e.route[r]]]:[]);if(!n.length)return[];let o=new Set(e.curvedSegments);return t.slice(1).flatMap((r,i)=>{let s=t[i];if(n.some(([l,h])=>Fn(s,l)<0.0000001&&Fn(r,h)<0.0000001))return[i+1];let a=e.route.findIndex((l)=>Fn(l,s)<0.0000001),c=e.route.findIndex((l)=>Fn(l,r)<0.0000001);if(a<0||c<=a)return[];for(let l=a+1;l<=c;l++)if(!o.has(l)||Iy(e.route[l-1],s,r)>0.0000000001||Iy(e.route[l],s,r)>0.0000000001)return[];return[i+1]})}function V3n(e){return e.map((t)=>{let[n,o]=t.coupledSection,r=t.route.map((i,s)=>s).filter((i)=>{if(i<=n||i>=o||t.curvedSegments?.includes(i)||t.curvedSegments?.includes(i+1))return!0;let s=t.route[i-1],a=t.route[i],c=t.route[i+1],l=Fn(s,a),h=Fn(a,c);return l<0.00000001||h<0.00000001||Math.abs((a.x-s.x)/l-(c.x-a.x)/h)>0.0000001||Math.abs((a.y-s.y)/l-(c.y-a.y)/h)>0.0000001});return{...t,route:r.map((i)=>t.route[i]),coupledSection:[r.indexOf(n),r.indexOf(o)],curvedSegments:t.curvedSegments?.map((i)=>r.indexOf(i)).filter((i)=>i>0)}})}function iYr(e,t){e=V3n(e);let n;for(let a=e[0].coupledSection[0];a<e[0].coupledSection[1];a++){let c=e[0].route[a],l=e[0].route[a+1],h=Fn(c,l);if(h<0.00000001||e[0].curvedSegments?.includes(a+1))continue;let d={x:(l.x-c.x)/h,y:(l.y-c.y)/h},u=(_)=>_.x*d.x+_.y*d.y;for(let _=e[1].coupledSection[0];_<e[1].coupledSection[1];_++){let p=e[1].route[_],m=e[1].route[_+1],A=Fn(p,m);if(A<0.00000001||e[1].curvedSegments?.includes(_+1))continue;if(Math.abs((m.x-p.x)/A-d.x)>0.0000001||Math.abs((m.y-p.y)/A-d.y)>0.0000001)continue;if(Math.abs(Math.abs((p.x-c.x)*d.y-(p.y-c.y)*d.x)-t)>0.0000001)continue;let g=Math.max(u(c),u(p)),f=Math.min(u(l),u(m));if(f-g>0.00000001&&(!n||f-g>n.high-n.low))n={indices:[a,_],low:g,high:f,direction:d}}}if(!n)return null;let{indices:o,low:r,high:i,direction:s}=n;return e.map((a,c)=>{let l=o[c],h=a.route[l],d=a.route[l+1],u=(y)=>{let x=y-h.x*s.x-h.y*s.y;return{...h,x:h.x+x*s.x,y:h.y+x*s.y}},_=u(r),p=u(i),m=a.route.slice(0,l),A=a.route.slice(l+2);if(Fn(h,_)>0.00000001)m.push(h);if(Fn(d,p)>0.00000001)A.unshift(d);let g=[...m,_,p,...A],f=g.length-a.route.length;return{...a,route:g,coupledSection:[m.length,m.length+1],curvedSegments:a.curvedSegments?.map((y)=>y>l+1?y+f:y)}})}function sYr(e,t,n,o){let r=new Map;for(let l of e.obstacles){let h=l.circuitJsonMetadata?.pcb_port_id;if(h&&l.componentId)r.set(h,l.componentId)}let i=(l,h)=>{let d=h?l.route.at(-1):l.route[0],u=e.connections.find((g)=>g.name===l.connection_name),_=u?.pointsToConnect.slice().sort((g,f)=>Fn(d,g)-Fn(d,f))[0],p=_?.pcb_port_id??d.pcb_port_id,m=p?r.get(p):void 0;if(m)return m;let A=new Set([l.connection_name,l.source_trace_id,u?.source_trace_id,_?.pointId,_?.pcb_port_id].filter((g)=>!!g));return e.obstacles.filter((g)=>g.componentId&&g.connectedTo.some((f)=>A.has(f))).sort((g,f)=>Fn(d,g.center)-Fn(d,f.center))[0]?.componentId},s=sa(e).filter((l)=>l.a.x===l.b.x&&l.a.y===l.b.y),a=(l)=>{let h=1/0,d=-1/0;for(let u of l){let _=e.obstacles.filter((x)=>x.componentId===u);if(!_.length)continue;let p=_.map((x)=>{let C=(x.ccwRotationDegrees??0)*Math.PI/180,b=Math.abs(Math.cos(C))*x.width+Math.abs(Math.sin(C))*x.height,I=Math.abs(Math.sin(C))*x.width+Math.abs(Math.cos(C))*x.height;return{left:x.center.x-b/2,right:x.center.x+b/2,bottom:x.center.y-I/2,top:x.center.y+I/2}}),m=Math.min(...p.map((x)=>x.left)),A=Math.max(...p.map((x)=>x.right)),g=Math.min(...p.map((x)=>x.bottom)),f=Math.max(...p.map((x)=>x.top)),y=Math.max(e.minViaPadDiameter??0.3,..._.flatMap((x)=>[x.width,x.height]))*2;for(let x of[m,A])for(let C of[g,f])h=Math.min(h,n({x,y:C})),d=Math.max(d,n({x,y:C}));for(let x of s){let C=x.a;if(C.x<m-y||C.x>A+y||C.y<g-y||C.y>f+y)continue;h=Math.min(h,n(C)-x.radius),d=Math.max(d,n(C)+x.radius)}}return{min:h,max:d}},c=(l)=>new Set(t.map((h)=>i(h,l)).filter((h)=>!!h));return{start:a(c(!1)).max+o,end:a(c(!0)).min-o}}function QAn(e,t){let n=[];for(let o=1;o<e.length;o++){let r=e[o-1],i=e[o];if(!(r.x<=t&&i.x>t))continue;let s={x:t,y:r.y+(i.y-r.y)*(t-r.x)/(i.x-r.x)};n.push({before:[...e.slice(0,o),s],after:[s,...e.slice(o)],point:s})}return n.length===1?n[0]:void 0}function aYr(e,t,n,o){let r=W2(e.filter((s,a)=>a===0||Fn(s,e[a-1])>0.00000001)),i=[r[0]];for(let s=1;s<r.length-1;s++){if(r[s].x<n-0.00000001||r[s].x>o+0.00000001){i.push(r[s]);continue}let a=r[s-1],c=r[s],l=r[s+1],h=Fn(a,c),d=Fn(c,l),u={x:(c.x-a.x)/h,y:(c.y-a.y)/h},_={x:(l.x-c.x)/d,y:(l.y-c.y)/d},p=u.x*_.x+u.y*_.y;if(p<-0.000001)return null;if(p<0.7){let m=Math.min(t,h*0.4,d*0.4);i.push({x:c.x-u.x*m,y:c.y-u.y*m},{x:c.x+_.x*m,y:c.y+_.y*m})}else i.push(c)}return[...i,r.at(-1)]}function EJ(e,t,n,o="dogleg",r=!1){let i=I7e(e,structuredClone(t)),s=e.minTraceToPadEdgeClearance??e.defaultObstacleMargin??0.075,a=new Set(e.buses?.flatMap((h)=>h.connectionNames)),c=r?N3n(e,t):new Set,l=new Set(i.filter((h)=>a.has(h.connection_name)).map((h)=>h.route[0].layer));for(let h of l){let d=i.filter((P)=>P.route[0].layer===h);if(d.length<3)continue;let u=d[0].route[0],_=d[0].route.at(-1),p=Math.abs(_.y-u.y)>=Math.abs(_.x-u.x),m=Math.sign(p?_.y-u.y:_.x-u.x)||1,A=(P)=>p?{x:P.y*m,y:-P.x*m}:{x:P.x*m,y:P.y*m},g=(P)=>p?{x:-P.y*m,y:P.x*m}:{x:P.x*m,y:P.y*m},f=[],y=new Set;for(let P of d){if(y.has(P.connection_name))continue;let M=e.differentialPairs?.find((T)=>T.connectionNames.includes(P.connection_name)&&T.connectionNames.every((N)=>d.some((D)=>D.connection_name===N))),B=M?.connectionNames.map((T)=>d.find((N)=>N.connection_name===T));if(B?.every((T)=>T.coupledSection)){B=V3n(B);let T=B.map((H)=>H.route.slice(H.coupledSection[0],H.coupledSection[1]+1));if(!(T[0].length===T[1].length&&[0,T[0].length-1].every((H)=>{let V=T[0][H],O=T[1][H],U=T[0][H===0?1:H-1],j=Fn(V,U);return j>0.00000001&&Math.abs(((O.x-V.x)*(U.x-V.x)+(O.y-V.y)*(U.y-V.y))/j)<0.0000001})&&T[0].slice(1).every((H,V)=>{let O=T[0][V],U=T[1][V],j=T[1][V+1],Y=Fn(O,H),X=Fn(U,j);return Y>0.00000001&&X>0.00000001&&Math.abs((H.x-O.x)/Y-(j.x-U.x)/X)<0.0000001&&Math.abs((H.y-O.y)/Y-(j.y-U.y)/X)<0.0000001}))){let H=iYr(B,P.route[0].width+(M.traceGap??s));if(!H)return null;B=H}let D=B.map((H)=>H.route.slice(H.coupledSection[0],H.coupledSection[1]+1));if(D[0].length!==D[1].length)return null;let L=D[0].map((H,V)=>A({x:(H.x+D[1][V].x)/2,y:(H.y+D[1][V].y)/2}));f.push({traces:B,path:L,width:2*P.route[0].width+(M.traceGap??s)}),B.forEach((H)=>y.add(H.connection_name))}else f.push({traces:[P],path:P.route.map(A),width:P.route[0].width}),y.add(P.connection_name)}let x=Math.max(...d.map((P)=>P.route[0].width)),C=Math.max(...f.map((P)=>P.path[0].x))+x*2,b=Math.min(...f.map((P)=>P.path.at(-1).x))-x*2,I=sYr(e,d,(P)=>A(P).x,Math.max(...f.map((P)=>P.width))/2+s);if(C=Math.max(C,I.start),b=Math.min(b,I.end),b-C<n*2)return null;let v;e:for(let P of[0,0.05,0.1,0.2]){let M=C+(b-C)*P,B=b-(b-C)*P,T=f.map((j)=>({channel:j,a:QAn(j.path,M),b:QAn(j.path,B)}));if(T.some((j)=>!j.a||!j.b))continue;if(T.sort((j,Y)=>j.a.point.y-Y.a.point.y),T.some((j,Y)=>Y>0&&j.b.point.y<T[Y-1].b.point.y))continue;let N=Math.min(...T.flatMap((j)=>[j.a.point.y,j.b.point.y])),D=Math.max(...T.flatMap((j)=>[j.a.point.y,j.b.point.y])),L=(N+D)/2,H=Math.floor(T.length/2),V=T.map((j,Y)=>L+(Y-(T.length-1)/2)*n),O=o==="interior"?RAn(T.map((j,Y)=>({from:j.a.point.y,to:V[Y],width:j.channel.width})),s):null,U=o==="interior"?RAn(T.map((j,Y)=>({from:j.b.point.y,to:V[Y],width:j.channel.width})),s):null;if(o==="interior"&&(!O||!U))continue;for(let j of o==="interior"?[1]:[1,2,3]){let Y=Math.max((D-N)/2+n,Math.ceil(T.length/2)*n)+j*x,X=[];for(let[se,ne]of[[-1,T.slice(0,H).toReversed()],[1,T.slice(H)]]){let re=ne.map((ie,ce)=>(ne.length-1-ce)*n);for(let ie=ne.length-2;ie>=0;ie--){let ce=ne[ie].channel,ue=ne[ie+1].channel,de=ue.traces.some((xe)=>a.has(xe.connection_name)),me=[ce,ue].some((xe)=>xe.traces.some((Ee)=>c.has(Ee.connection_name))),ge=r?Math.max((ce.width+ue.width)/2+s+x*0.2,me?n*2:de?n:0):n;if(r)re[ie]=re[ie+1]+ge}let Z=Math.max(r?re[0]+n:Y,...ne.map((ie,ce)=>Math.max(se*(ie.a.point.y-L),se*(ie.b.point.y-L))+re[ce]+x*2)),te=ne.map(()=>0);for(let ie=ne.length-2;ie>=0;ie--)te[ie]=te[ie+1]+(ne[ie].channel.width+ne[ie+1].channel.width)/2+s+x*1.2;for(let[ie,ce]of ne.entries()){let ue=M+te[ie],de=B-te[ie];if(de-ue<n)continue;let me=T.indexOf(ce),ge=o!=="dogleg"?L+(me-(T.length-1)/2)*n:L+se*(Z-re[ie]),xe=Math.abs(ge-ce.a.point.y),Ee=Math.abs(ge-ce.b.point.y),Re=M+(O?O[me]:(ge>ce.a.point.y?T.length-1-me:me)*(x+s)),Me=B-(U?U[me]:(ge>ce.b.point.y?T.length-1-me:me)*(x+s));if(o==="diagonal"&&xe+Ee>=Me-Re-4*x)continue;let _e=[...ce.a.before,{x:Re,y:ce.a.point.y},{x:Re+xe,y:ge},{x:Me-Ee,y:ge},{x:Me,y:ce.b.point.y},...ce.b.after],ye=aYr(o==="diagonal"?_e:[...ce.a.before,{x:o==="interior"?Re:ue,y:ce.a.point.y},{x:o==="interior"?Re:ue,y:ge},{x:o==="interior"?Me:de,y:ge},{x:o==="interior"?Me:de,y:ce.b.point.y},...ce.b.after],x*1.5,M,B);if(!ye)continue;let Se=ce.channel;if(Se.traces.length===1){let Ne=Se.traces[0];X.push({...Ne,curvedSegments:Vde(Ne,ye.map(g)),route:ye.map((Le)=>({...g(Le),route_type:"wire",layer:Ne.route[0].layer,width:Ne.route[0].width}))})}else{let Ne=ye.map(g),Le=Se.traces,nt=Se.width-Le[0].route[0].width,dt=[-nt/2,nt/2].sort((rt,pt)=>Fn(wA(Ne,rt)[0],Le[0].route[Le[0].coupledSection[0]])-Fn(wA(Ne,pt)[0],Le[0].route[Le[0].coupledSection[0]]));for(let[rt,pt]of Le.entries()){let[ct,Ct]=pt.coupledSection,kt=wA(Ne,dt[rt]);if(Fn(kt[0],pt.route[ct])>0.0000001||Fn(kt.at(-1),pt.route[Ct])>0.0000001)continue;X.push({...pt,coupledSection:[ct,ct+kt.length-1],curvedSegments:Vde(pt,[...pt.route.slice(0,ct),...kt,...pt.route.slice(Ct+1)]),route:[...pt.route.slice(0,ct),...kt.map((Lt)=>({...Lt,route_type:"wire",layer:pt.route[0].layer,width:pt.route[0].width})),...pt.route.slice(Ct+1)]})}}}}if(X.length!==d.length)continue;let K=i.map((se)=>X.find((ne)=>ne.connection_name===se.connection_name)??se),J=[...sa(e),...K.flatMap(Jr)];if(X.filter((se)=>!new Mi(e,e.connections.find((ne)=>ne.name===se.connection_name),se.route[0].width,J).pathVisible(se.route)||!Wc(se.route,se.route[0].width+s)).length)continue;v=K;break e}}if(!v)return null;i=v}return i}function*cYr(e,t,n=[]){let o=t.x-e.x,r=t.y-e.y,i=Math.abs(o),s=Math.abs(r),a=Math.sign(o),c=Math.sign(r),l=new Set(Array.from({length:9},(h,d)=>Math.abs(i-s)*d/8));for(let h of n){let d=i>=s?(h.x-e.x)*a-(h.y-e.y)*c:(h.y-e.y)*c-(h.x-e.x)*a;if(d>=0&&d<=Math.abs(i-s))l.add(d)}for(let h of l)yield W2(i>=s?[e,{x:e.x+a*h,y:e.y},{x:e.x+a*(h+s),y:t.y},t]:[e,{x:e.x,y:e.y+c*h},{x:t.x,y:e.y+c*(h+i)},t])}var lYr=(e)=>e.slice(1,-1).every((t,n)=>{let o=e[n],r=e[n+2],i=Fn(o,t)*Fn(t,r);return i<0.000000000001||((t.x-o.x)*(r.x-t.x)+(t.y-o.y)*(r.y-t.y))/i>=Math.SQRT1_2-0.00000001});function Y3n(e,t){let n=structuredClone(t),o=sa(e);for(let r of n){if(r.coupledSection)continue;let i=e.connections.find((h)=>h.name===r.connection_name),s=r.route[0].width,a=new Mi(e,i,s,[...o,...n.flatMap(Jr)]),c=()=>{let h=new Uint32Array(r.route.length);for(let d of new Set(r.curvedSegments))h[d]=1;for(let d=1;d<h.length;d++)h[d]+=h[d-1];return h},l=c();for(let h=0;h<3;h++){let d=!1;for(let u=0;u<r.route.length-3;u++)for(let _=Math.min(r.route.length-1,u+70);_>=u+3;_--){if(l[_]!==l[u])continue;let p=Ar(r.route.slice(u,_+1)),m=!1;for(let A of cYr(r.route[u],r.route[_],r.route.slice(u,_+1))){if(A.length>=_-u+1||Math.abs(Ar(A)-p)>0.00000001||!a.pathVisible(A))continue;if(!lYr([...r.route.slice(Math.max(0,u-1),u),...A,...r.route.slice(_+1,_+2)]))continue;let g=r.route[u],f=[...r.route.slice(0,u),...A.map((x)=>({...x,route_type:"wire",layer:g.layer,width:s})),...r.route.slice(_+1)];if(!Wc(f,s/2+a.margin))continue;let y=A.length-(_-u+1);r.route=f,r.curvedSegments=r.curvedSegments?.map((x)=>x>_?x+y:x),l=c(),d=m=!0;break}if(m)break}if(!d)break}}return n}function hYr(e,t,n,o,r,i,s){let a=Fn(e,t),c=s+n/2,l=2*r+1;if(!Number.isFinite(a+n+o+s)||n<0||o<=0||s<=0||!Number.isInteger(r)||r<1||r>64||i!==1&&i!==-1||a<(4*r+2)*c-0.000000001)return null;let h=(t.x-e.x)/a,d=(t.y-e.y)/a,u=(f)=>{let y=[{x:0,y:0}],x=0;for(let I=0;I<l;I++){let v=c+(a-2*c)*I/(l-1);y.push({x:v,y:x}),x=I===l-1?0:I%2?-f:f,y.push({x:v,y:x})}y.push({x:a,y:0});let C=[[],[]],b=(I,v,P,M)=>{for(let B=0;B<2;B++){let T=(B===0?1:-1)*n/2,N=I-i*M*T,D=i*v+P*T,L={x:e.x+h*N-d*D,y:e.y+d*N+h*D};if(!C[B].length||Fn(C[B].at(-1),L)>0.0000000001)C[B].push(L)}};b(0,0,1,0);for(let I=1;I<y.length-1;I++){let v=y[I-1],P=y[I],M=y[I+1],B=Fn(v,P),T=Fn(P,M),N={x:(P.x-v.x)/B,y:(P.y-v.y)/B},D={x:(M.x-P.x)/T,y:(M.y-P.y)/T},L={x:P.x-N.x*c,y:P.y-N.y*c},H={x:L.x+D.x*c,y:L.y+D.y*c},V=N.x*D.y-N.y*D.x,O=Math.atan2(L.y-H.y,L.x-H.x);for(let U=0;U<=18;U++){let j=O+V*Math.PI/2*U/18;b(H.x+c*Math.cos(j),H.y+c*Math.sin(j),-V*Math.sin(j),V*Math.cos(j))}}return b(a,0,1,0),C},_=(4*r+2)*c*(36*Math.sin(Math.PI/72)-2),p=2*c;if(4*r*p+_>o+0.00000001)return null;let A=Math.max(p,(o-_)/(4*r)),g=u(A);return A=Math.max(p,A+(o-Math.min(...g.map((f)=>Ar(f)-a)))/(4*r)),u(A)}function G3n(e,t,n={}){let o={...e,buses:[]},r=JJ(e,t,bk(o,t),n),i=0,s=sa(e),a=(c)=>Ar(c.route)+Lf(e,c.connection_name);for(let c of e.differentialPairs??[]){let l=c.connectionNames.map((f)=>r.findIndex((y)=>y.connection_name===f)),h=l.map((f)=>r[f]);if(h.some((f)=>!f.coupledSection))continue;let d=bk(e,r),u=Math.max(...h.map((f)=>d.get(f.connection_name)-a(f)));if(u<0.00000001)continue;let _=h[0].route[0].width,p=c.traceGap??e.minTraceToPadEdgeClearance??e.defaultObstacleMargin??0.075,m=_+p,A=e.minTraceToPadEdgeClearance??e.defaultObstacleMargin??0.075,g;for(let f of n.packMeanders?[!1,!0]:[!1]){if(g)break;for(let y=h[0].coupledSection[0];y<h[0].coupledSection[1]&&!g;y++){let x=h[0].route[y],C=h[0].route[y+1],b=Fn(x,C);if(b<_*8)continue;let I=(C.x-x.x)/b,v=(C.y-x.y)/b;for(let P=h[1].coupledSection[0];P<h[1].coupledSection[1]&&!g;P++){let M=h[1].route[P],B=h[1].route[P+1],T=Fn(M,B);if(T<_*8||Math.abs((B.x-M.x)/T-I)>0.000001||Math.abs((B.y-M.y)/T-v)>0.000001)continue;let N=-(M.x-x.x)*v+(M.y-x.y)*I;if(Math.abs(Math.abs(N)-m)>0.000001)continue;let D=(U)=>(U.x-x.x)*I+(U.y-x.y)*v,L=Math.max(0,D(M))+_*2,H=Math.min(b,D(B))-_*2;if(H-L<_*8)continue;let V=(U)=>({x:x.x+I*U-v*N/2,y:x.y+v*U+I*N/2});function*O(){if(!f)for(let U of[0.9,0.65,0.4])for(let j of n.packMeanders?Array.from({length:Math.max(1,Math.floor((H-L)*U/(4*(Math.max(_*1.2,A)+m/2))))},(Y,X)=>X+1).reverse():Array.from({length:16},(Y,X)=>X+1))for(let Y of[1,-1])for(let X of[hYr,Q3n,DVr])yield{fraction:U,lobes:j,createLobes:X,side:Y};if(f)for(let U of[1,2,3])for(let j of[0.9,0.65,0.4])for(let Y of[1,-1])yield{fraction:j,lobes:U,createLobes:R3n,side:Y}}e:for(let{fraction:U,lobes:j,createLobes:Y,side:X}of O()){if(++i>(n.maxCandidates??1/0))throw Error("Coupled tuning candidate budget exhausted");let K=(H-L)*(1-U)/2,J=Y(V(L+K),V(H-K),m,u,j,X,Math.max(_*1.2,A));if(!J)continue;let ee=N>0?J.toReversed():J,se=h.map((re,Z)=>{let te=Z===0?y:P,ie=[...re.route.slice(0,te+1),...ee[Z],...re.route.slice(te+1)],ce=ie.length-re.route.length;return{...re,coupledSection:[re.coupledSection[0],re.coupledSection[1]+ce],curvedSegments:ie.slice(1).flatMap((ue,de)=>{let me=Math.abs(ue.x-ie[de].x),ge=Math.abs(ue.y-ie[de].y);return Math.min(me,ge)>0.00000001&&Math.abs(me-ge)>0.00000001?[de+1]:[]}),route:ie.map((ue)=>({...ue,route_type:"wire",layer:re.route[0].layer,width:_}))}}),ne=[...s,...r.filter((re,Z)=>!l.includes(Z)).flatMap(Jr),...se.flatMap(Jr)];if(se.some((re,Z)=>!new Mi(e,e.connections.find((te)=>te.name===re.connection_name),_,ne).pathVisible(re.route)||!Wc(re.route,_+A)||a(re)<d.get(re.connection_name)-0.000001))continue;if(Math.abs(a(se[0])-a(se[1]))>c.lengthTolerance+0.000001)continue;g=se;break e}}}}if(!g)throw Error(`No shared tuning corridor for ${c.connectionNames.join(", ")}`);l.forEach((f,y)=>{r[f]=g[y]})}return JJ(e,r,bk(e,r),n)}function dYr(e,t){let n=wk(e,t),o=[...e.traces??[],...t],r=(i)=>o.filter((s)=>s.connection_name===i||s.source_trace_id===i).flatMap((s)=>s.route.slice(1).flatMap((a,c)=>{let l=s.route[c];return l.route_type==="wire"&&a.route_type==="wire"&&l.layer===a.layer?[{a:l,b:a}]:[]}));return(e.differentialPairs??[]).filter((i)=>i.traceGap!==void 0||i.maxUncoupledLength!==void 0).map((i)=>{let s=i.connectionNames.map(r),a=i.traceGap??e.minTraceToPadEdgeClearance??e.defaultObstacleMargin??0.075,c=Math.max(0.002,a*0.1),l=s.map((d)=>{let u=new Set(d.map((_)=>_.a.layer));return new Map([...u].map((_)=>[_,new Due(d.filter((p)=>p.a.layer===_).map((p)=>({...p,radius:p.a.width/2,layer:_,owners:[]})))]))}),h=s.map((d,u)=>{let _=0,p=0;for(let{a:m,b:A}of d){let g=Fn(m,A),f=Math.max(1,Math.ceil(g/(c/2)));p+=g;let y=l[1-u].get(m.layer),x=(C)=>y?.distanceToPoint(C,(b)=>Iy(C,b.a,b.b)-(m.width+b.radius*2)/2,m.width/2)??1/0;for(let C=0;C<f;C++){let b=(C+0.5)/f,I={x:m.x+(A.x-m.x)*b,y:m.y+(A.y-m.y)*b};if(Math.abs(x(I)-a)+g/(2*f)>c)_+=g/f}}return{name:i.connectionNames[u],totalLengthMm:p,uncoupledLengthMm:_,coupledFraction:p?1-_/p:0}});return{connectionNames:i.connectionNames,conductors:h,maxUncoupledLengthMm:i.maxUncoupledLength??null,matched:n.find((d)=>d.connectionNames===i.connectionNames).matched&&(i.maxUncoupledLength===void 0||h.every((d)=>d.uncoupledLengthMm<=i.maxUncoupledLength+0.00000001))}})}var kAn={"0":"M0.301025 0.257813 L0.206593 0.283385 L0.122042 0.361307 L0.075923 0.474441 L0.064942 0.642221 L0.091296 0.78289 L0.159376 0.899463 L0.257104 0.961214 L0.344948 0.961214 L0.442678 0.899463 L0.510757 0.78289 L0.537111 0.642221 L0.526131 0.474441 L0.480012 0.361307 L0.39546 0.283385 L0.301025 0.257813","1":"M0.220426 0.40845 L0.381626 0.270996 L0.381626 0.948966","2":"M0.110409 0.39212 L0.125621 0.342293 L0.170571 0.295823 L0.244237 0.26431 L0.291518 0.257813 L0.373319 0.263799 L0.434683 0.290705 L0.468239 0.331966 L0.480292 0.379913 L0.479492 0.411806 L0.465088 0.465192 L0.402571 0.568988 L0.245134 0.766438 L0.07959 0.948045 L0.522462 0.948045","3":"M0.081606 0.345073 L0.119154 0.315633 L0.178996 0.284091 L0.255265 0.257813 L0.349133 0.263062 L0.43127 0.289348 L0.48994 0.336662 L0.525141 0.394491 L0.513407 0.457577 L0.466472 0.504892 L0.384334 0.541692 L0.290464 0.56272 L0.20833 0.573235 L0.290464 0.583749 L0.384334 0.610035 L0.466472 0.652092 L0.519274 0.709922 L0.531007 0.773007 L0.50754 0.841351 L0.454738 0.899179 L0.3726 0.946494 L0.310412 0.961214 L0.209503 0.959111 L0.127367 0.946494 L0.071046 0.929671","4":"M0.418494 0.270996 L0.048828 0.724199 L0.553224 0.724199 M0.414181 0.578167 L0.414181 0.94897","5":"M0.074951 0.270996 L0.074951 0.614701 L0.267655 0.5695 L0.405247 0.586502 L0.460002 0.617189 L0.498028 0.660731 L0.527101 0.779401 L0.513352 0.841049 L0.477274 0.889568 L0.406378 0.93463 L0.324445 0.958337 L0.247399 0.962139 L0.182516 0.949767 L0.130068 0.925508 L0.074951 0.875607 M0.074951 0.270996 L0.527101 0.270996","6":"M0.428549 0.257813 L0.341433 0.285053 L0.26073 0.312099 L0.192188 0.360182 L0.138902 0.410969 L0.098219 0.500422 L0.070249 0.584267 L0.067264 0.670716 L0.065164 0.756863 L0.087163 0.820973 L0.108168 0.861042 L0.157916 0.913131 L0.210981 0.948192 L0.29279 0.961214 L0.384548 0.956206 L0.456409 0.924151 L0.507262 0.881077 L0.5349 0.821975 L0.537111 0.771889 L0.521634 0.718798 L0.498418 0.67372 L0.463042 0.636657 L0.414398 0.613617 L0.34696 0.598591 L0.28284 0.595587 L0.215403 0.605604 L0.145756 0.641665 L0.109274 0.678729 L0.064942 0.724006","7":"M0.071534 0.270996 L0.530519 0.270996 L0.495935 0.291702 L0.477752 0.305407 L0.435186 0.346112 L0.412067 0.374136 L0.388565 0.40796 L0.365315 0.448098 L0.342943 0.495062 L0.322081 0.549366 L0.303364 0.611524 L0.287416 0.68205 L0.270077 0.80465 L0.26253 0.94897","8":"M0.286761 0.257813 L0.210684 0.27162 L0.1414 0.305622 L0.092494 0.382125 L0.111513 0.450128 L0.16857 0.502193 L0.228345 0.539382 L0.377781 0.594635 L0.470161 0.645637 L0.52586 0.706203 L0.538087 0.792269 L0.506841 0.87621 L0.438915 0.927212 L0.339743 0.961214 L0.263666 0.959089 L0.174004 0.929337 L0.102003 0.881523 L0.063965 0.811395 L0.066682 0.741266 L0.102003 0.671139 L0.180797 0.608448 L0.259591 0.580822 L0.358762 0.548945 L0.456576 0.49688 L0.486463 0.446941 L0.487822 0.362999 L0.453859 0.302434 L0.384574 0.265245 L0.286761 0.257813","9":"M0.511026 0.437812 L0.491026 0.347812 L0.451026 0.297812 L0.391026 0.267812 L0.311026 0.257813 L0.231026 0.267812 L0.161026 0.297812 L0.111026 0.347812 L0.091026 0.417812 L0.111026 0.487812 L0.161026 0.537812 L0.231026 0.567812 L0.311026 0.577812 L0.391026 0.557812 L0.451026 0.517812 L0.491026 0.477812 L0.511026 0.437812 M0.510026 0.438812 L0.434026 0.636812 L0.381026 0.777812 L0.337026 0.879812 L0.301026 0.957812","!":"M0.301026 0.270996 L0.301026 0.749566 M0.251466 0.94897 L0.350587 0.94897",'"':"M0.16504 0.270996 L0.16504 0.523022 M0.437013 0.270996 L0.437013 0.523022","#":"M0.20958 0.282227 L0.146515 0.949754 M0.461844 0.282227 L0.398779 0.949754 M0.032999 0.526969 L0.600587 0.452796 M0.001465 0.82366 L0.569055 0.749486",$:"M0.307121 0.240234 L0.307121 1.083502 M0.490031 0.415915 L0.404676 0.328075 L0.23396 0.310507 L0.136407 0.398347 L0.099828 0.521324 L0.124213 0.591596 L0.197379 0.644299 L0.429061 0.697003 L0.502224 0.749708 L0.526613 0.837547 L0.477836 0.960526 L0.355897 1.013228 L0.197379 0.99566 L0.112021 0.942957 L0.07544 0.837547","'":"M0.301026 0.270996 L0.301026 0.523022","(":"M0.413087 0.241211 L0.372337 0.28347 L0.331589 0.334184 L0.290838 0.393349 L0.25009 0.460965 L0.219528 0.528584 L0.199153 0.5962 L0.188966 0.655364 L0.199153 0.714529 L0.219528 0.782146 L0.25009 0.849764 L0.290838 0.91738 L0.331589 0.976544 L0.372337 1.027258 L0.413087 1.069491",")":"M0.188966 0.241211 L0.229716 0.28347 L0.270466 0.334184 L0.311213 0.393349 L0.351964 0.460965 L0.382526 0.528584 L0.4029 0.5962 L0.413087 0.655364 L0.4029 0.714529 L0.382526 0.782146 L0.351964 0.849764 L0.311213 0.91738 L0.270466 0.976544 L0.229716 1.027258 L0.188966 1.069491","*":"M0.301026 0.458702 L0.301026 0.681942 M0.301026 0.458702 L0.520997 0.536834 M0.301026 0.458702 L0.439954 0.257813 M0.301026 0.458702 L0.162098 0.257813 M0.301026 0.458702 L0.081055 0.536834","+":"M0.042969 0.66845 L0.559083 0.66845 M0.301023 0.428223 L0.301023 0.908661",",":"M0.38672 0.852051 L0.215333 1.030661 L0.301025 1.119971","-":"M0.173829 0.686035 L0.428224 0.686035",".":"M0.362549 0.851074 L0.239503 0.851074","/":"M0.062501 1.035249 L0.539551 0.270996","<":"M0.559083 0.441895 L0.042969 0.66939 L0.042969 0.66939 L0.559083 0.896902","=":"M0.042969 0.545898 L0.559083 0.545898 M0.042969 0.80837 L0.559083 0.80837",">":"M0.042969 0.441895 L0.559083 0.66939 L0.559083 0.66939 L0.042969 0.896902",A:"M0.018067 0.94897 L0.290179 0.270996 L0.583986 0.94897 M0.155303 0.684521 L0.433548 0.684521",B:"M0.063965 0.94897 L0.063965 0.278953 L0.209356 0.270996 L0.342486 0.294394 L0.432179 0.37292 L0.418224 0.48773 L0.312686 0.549166 L0.084728 0.575531 L0.306377 0.589434 L0.468877 0.647456 L0.538087 0.736658 L0.5324 0.85202 L0.501247 0.902983 L0.42355 0.944398 L0.063965 0.94897",C:"M0.529054 0.419847 L0.498425 0.345196 L0.442238 0.292341 L0.33583 0.257813 L0.257199 0.268357 L0.187906 0.303748 L0.120243 0.385432 L0.072998 0.599844 L0.110073 0.815385 L0.165381 0.902183 L0.222883 0.942801 L0.334904 0.961214 L0.43253 0.937679 L0.504816 0.868999 L0.529054 0.772065",D:"M0.064454 0.94897 L0.071838 0.285078 L0.171217 0.270996 L0.247348 0.272633 L0.37101 0.306078 L0.462461 0.378304 L0.514748 0.475555 L0.535591 0.576392 L0.537599 0.652313 L0.528065 0.717381 L0.508562 0.772419 L0.445948 0.855695 L0.362356 0.90871 L0.225203 0.945862 L0.064454 0.94897",E:"M0.080078 0.270996 L0.080078 0.94897 M0.080078 0.270996 L0.521974 0.270996 M0.080078 0.609981 L0.389405 0.609981 M0.080078 0.94897 L0.521974 0.94897",F:"M0.086426 0.270996 L0.086426 0.94897 M0.091304 0.275607 L0.515626 0.275607 M0.091304 0.607677 L0.447344 0.607677",G:"M0.498034 0.284943 L0.374621 0.257813 L0.244219 0.268648 L0.160577 0.311997 L0.094556 0.398116 L0.056397 0.58404 L0.076752 0.785532 L0.120865 0.858197 L0.188947 0.916734 L0.271008 0.953591 L0.357069 0.961214 L0.43715 0.932047 L0.501262 0.858539 L0.545656 0.648611 L0.329595 0.648131",H:"M0.066895 0.270996 L0.066895 0.94897 M0.066895 0.595658 L0.530009 0.595658 M0.535157 0.270996 L0.535157 0.94897",I:"M0.301026 0.270996 L0.301026 0.94897",J:"M0.506839 0.270996 L0.507814 0.782193 L0.498468 0.846168 L0.480733 0.880789 L0.455864 0.90832 L0.426095 0.929408 L0.360746 0.954812 L0.302508 0.962139 L0.223573 0.953638 L0.16538 0.930312 L0.137072 0.907715 L0.116428 0.880312 L0.102822 0.848819 L0.095633 0.813947 L0.094239 0.776413",K:"M0.035401 0.270996 L0.035401 0.94897 M0.502258 0.316194 L0.035401 0.687823 M0.212484 0.582361 L0.566652 0.933903",L:"M0.07544 0.270996 L0.07544 0.94897 L0.526613 0.94897",M:"M0.042481 0.94897 L0.042481 0.270996 L0.301027 0.712492 L0.559571 0.270996 L0.559571 0.94897",N:"M0.067871 0.94897 L0.067871 0.270996 L0.534181 0.94897 L0.525031 0.270996",O:"M0.287293 0.961214 L0.19843 0.933567 L0.1172 0.849451 L0.057129 0.563945 L0.114348 0.350255 L0.18455 0.289392 L0.306101 0.257813 L0.42054 0.29572 L0.487543 0.365003 L0.544923 0.625294 L0.516366 0.789624 L0.465476 0.884596 L0.375084 0.949287 L0.287293 0.961214",P:"M0.070557 0.94897 L0.070557 0.28379 L0.20704 0.270996 L0.329134 0.278993 L0.408525 0.300514 L0.444022 0.317908 L0.500637 0.368929 L0.525796 0.423728 L0.531496 0.50384 L0.508934 0.554205 L0.473724 0.582043 L0.417577 0.604365 L0.336375 0.620372 L0.226014 0.629268 L0.082368 0.630258",Q:"M0.282435 1.050813 L0.195447 1.019646 L0.115933 0.924817 L0.057129 0.602943 L0.113139 0.362034 L0.18186 0.293418 L0.300844 0.257813 L0.412868 0.300553 L0.478457 0.37866 L0.534625 0.672103 L0.506671 0.857367 L0.456855 0.964437 L0.368371 1.037368 L0.282435 1.050813 M0.341225 0.815559 L0.544923 1.070653",R:"M0.034912 0.944112 L0.034912 0.288556 L0.227127 0.270996 L0.362038 0.276867 L0.443423 0.294907 L0.477644 0.309614 L0.505809 0.328757 L0.526616 0.352817 L0.544963 0.418061 L0.543241 0.475921 L0.524463 0.517817 L0.49076 0.546518 L0.444265 0.564799 L0.355195 0.578739 L0.047653 0.589627 M0.303054 0.617306 L0.56714 0.94897",S:"M0.483037 0.364333 L0.407613 0.267477 L0.22883 0.257813 L0.128623 0.327565 L0.087712 0.455539 L0.104656 0.518727 L0.168054 0.573307 L0.41928 0.617318 L0.503796 0.669342 L0.535157 0.759324 L0.493846 0.900055 L0.367668 0.961214 L0.205436 0.956661 L0.116711 0.907038 L0.066895 0.790334",T:"M0.022949 0.270996 L0.579103 0.270996 M0.309284 0.270996 L0.309284 0.94897",U:"M0.072022 0.270996 L0.07308 0.648875 L0.080372 0.75167 L0.099024 0.827813 L0.134786 0.885729 L0.181571 0.924023 L0.251464 0.95168 L0.339655 0.962139 L0.401553 0.951668 L0.45232 0.924086 L0.482701 0.891771 L0.495745 0.870529 L0.515699 0.81637 L0.525014 0.744626 L0.530031 0.272017",V:"M0.027832 0.270996 L0.320083 0.94897 L0.57422 0.270996",W:"M0 0.270996 L0.079799 0.940377 L0.285198 0.472884 L0.505255 0.94897 L0.602052 0.270996",X:"M0.009034 0.270996 L0.586805 0.94897 M0.593019 0.270996 L0.015246 0.94897",Y:"M0.018067 0.270996 L0.293132 0.574135 M0.583986 0.271959 L0.294954 0.57606 L0.305277 0.94897",Z:"M0.053711 0.270996 L0.548341 0.270996 L0.053711 0.94897 L0.548341 0.94897","[":"M0.404542 0.240234 L0.197511 0.240234 L0.197511 1.069424 L0.404542 1.069424","\\":"M0.062501 0.270996 L0.539551 1.035249","]":"M0.19751 0.240234 L0.404542 0.240234 L0.404542 1.069424 L0.19751 1.069424","^":"M0.035156 0.523931 L0.301024 0.270996 L0.566896 0.523931",_:"M0 1.160601 L0.602052 1.160601",a:"M0.527101 0.439941 L0.527101 0.973965 M0.527101 0.553824 L0.451366 0.477535 L0.376759 0.439941 L0.263722 0.439941 L0.187989 0.477535 L0.112255 0.553824 L0.074951 0.66881 L0.074951 0.745099 L0.112255 0.85898 L0.187989 0.93527 L0.263722 0.973965 L0.376759 0.973965 L0.451366 0.93527 L0.527101 0.85898",b:"M0.07666 0.240234 L0.07666 0.959985 M0.07666 0.582737 L0.151822 0.514237 L0.225865 0.480483 L0.338045 0.480483 L0.413211 0.514237 L0.488374 0.582737 L0.525392 0.685983 L0.525392 0.754485 L0.488374 0.856739 L0.413211 0.92524 L0.338045 0.959985 L0.225865 0.959985 L0.151822 0.92524 L0.07666 0.856739",c:"M0.512452 0.553823 L0.441624 0.477535 L0.371854 0.439941 L0.26614 0.439941 L0.195312 0.477535 L0.124486 0.553823 L0.0896 0.668808 L0.0896 0.745099 L0.124486 0.858979 L0.195312 0.93527 L0.26614 0.973965 L0.371854 0.973965 L0.441624 0.93527 L0.512452 0.858979",d:"M0.525392 0.240234 L0.525392 0.959985 M0.525392 0.582737 L0.450232 0.514237 L0.376189 0.480483 L0.264006 0.480483 L0.188844 0.514237 L0.11368 0.582737 L0.076661 0.685983 L0.076661 0.754485 L0.11368 0.856739 L0.188844 0.92524 L0.264006 0.959985 L0.376189 0.959985 L0.450232 0.92524 L0.525392 0.856739",e:"M0.059571 0.668808 L0.542482 0.668808 M0.542482 0.592521 L0.502641 0.516231 L0.461594 0.477535 L0.381914 0.439941 L0.261186 0.439941 L0.180299 0.477535 L0.099412 0.553823 L0.059571 0.668808 L0.059571 0.745099 L0.099412 0.858979 L0.180299 0.93527 L0.261186 0.973965 L0.381914 0.973965 L0.461594 0.93527 L0.542482 0.858979",f:"M0.512941 0.240234 L0.406984 0.240234 L0.301026 0.274346 L0.248047 0.374731 L0.248047 0.946817 M0.089112 0.476088 L0.459965 0.476088",g:"M0.525392 0.439941 L0.525392 0.989395 L0.488373 1.091918 L0.45023 1.126757 L0.376189 1.160601 L0.264004 1.160601 L0.188844 1.126757 L0.113681 1.058075 L0.076661 0.954555 M0.525392 0.542467 L0.45023 0.473786 L0.376189 0.439941 L0.264004 0.439941 L0.188844 0.473786 L0.113681 0.542467 L0.076661 0.645988 L0.076661 0.714669 L0.113681 0.817193 L0.188844 0.885875 L0.264004 0.920713 L0.376189 0.920713 L0.45023 0.885875 L0.525392 0.817193",h:"M0.092041 0.240234 L0.092041 0.946817 M0.092041 0.61058 L0.205937 0.509225 L0.282214 0.476086 L0.396109 0.476086 L0.47187 0.509225 L0.510011 0.61058 L0.510011 0.946817",i:"M0.261026 0.240234 L0.341026 0.240234 M0.300978 0.476089 L0.300978 0.946817",j:"M0.3853 0.240234 L0.447023 0.240234 M0.416159 0.465708 L0.416159 1.011689 L0.383887 1.108586 L0.252832 1.140264 L0.15503 1.108586",k:"M0.065186 0.240234 L0.065186 0.946817 M0.493824 0.476086 L0.065186 0.812323 M0.236758 0.677829 L0.536867 0.946817",l:"M0.301026 0.234863 L0.301026 0.946441",m:"M0.050538 0.439941 L0.050538 0.960796 M0.050538 0.588758 L0.114405 0.476607 L0.157178 0.439941 L0.236864 0.439941 L0.279637 0.476607 L0.32241 0.588758 L0.32241 0.960796 M0.32241 0.588758 L0.386281 0.476607 L0.428467 0.439941 L0.50874 0.439941 L0.551515 0.476607 L0.551515 0.960796",n:"M0.092041 0.439941 L0.092041 0.960796 M0.092041 0.588758 L0.205936 0.476607 L0.282216 0.439941 L0.396113 0.439941 L0.471871 0.476607 L0.510011 0.588758 L0.510011 0.960796",o:"M0.247175 0.439941 L0.175178 0.477535 L0.103186 0.553823 L0.066895 0.668808 L0.066895 0.745099 L0.103186 0.858979 L0.175178 0.93527 L0.247175 0.973965 L0.354874 0.973965 L0.426872 0.93527 L0.498866 0.858979 L0.535157 0.745099 L0.535157 0.668808 L0.498866 0.553823 L0.426872 0.477535 L0.354874 0.439941 L0.247175 0.439941",p:"M0.076904 0.439941 L0.076904 1.154244 M0.076904 0.541563 L0.151986 0.473487 L0.225944 0.439941 L0.338005 0.439941 L0.413087 0.473487 L0.488166 0.541563 L0.525148 0.644169 L0.525148 0.712246 L0.488166 0.813866 L0.413087 0.881942 L0.338005 0.916471 L0.225944 0.916471 L0.151986 0.881942 L0.076904 0.813866",q:"M0.525148 0.441895 L0.525148 1.156195 M0.525148 0.5435 L0.450067 0.47544 L0.376106 0.441895 L0.264042 0.441895 L0.188966 0.47544 L0.113885 0.5435 L0.076905 0.646108 L0.076905 0.714187 L0.113885 0.815809 L0.188966 0.883886 L0.264042 0.918418 L0.376106 0.918418 L0.450067 0.883886 L0.525148 0.815809",r:"M0.107422 0.439941 L0.107422 0.960796 M0.107422 0.663164 L0.155824 0.551014 L0.252626 0.476607 L0.349428 0.439941 L0.49463 0.439941",s:"M0.475556 0.477535 L0.400757 0.439941 L0.276092 0.439941 L0.176361 0.477535 L0.101563 0.553823 L0.101563 0.630112 L0.176361 0.668808 L0.301024 0.668808 L0.425688 0.745099 L0.50049 0.821387 L0.50049 0.897677 L0.425688 0.93527 L0.325956 0.973965 L0.201295 0.973965 L0.126496 0.93527 L0.101563 0.858979",t:"M0.246032 0.297852 L0.246032 0.826549 L0.301023 0.919323 L0.411011 0.950848 L0.520997 0.950848 M0.081055 0.515799 L0.466004 0.515799",u:"M0.092041 0.454102 L0.092041 0.826134 L0.13018 0.937211 L0.205936 0.974954 L0.319832 0.974954 L0.396113 0.937211 L0.510011 0.826134 M0.510011 0.454102 L0.510011 0.974954",v:"M0.048828 0.453125 L0.301026 0.961719 M0.553224 0.453125 L0.301026 0.961719",w:"M0 0.453125 L0.150512 0.961719 M0.301024 0.453125 L0.150512 0.961719 M0.301024 0.453125 L0.451539 0.961719 M0.602052 0.453125 L0.451539 0.961719",x:"M0.03711 0.453125 L0.564943 0.961719 M0.564943 0.453125 L0.03711 0.961719",y:"M0.084618 0.453125 L0.320232 0.921476 M0.55713 0.453125 L0.320232 0.921476 L0.242119 1.055289 L0.163369 1.122196 L0.084618 1.155166 L0.044922 1.155166",z:"M0.505373 0.452148 L0.09668 0.961651 M0.09668 0.452148 L0.505373 0.452148 M0.09668 0.961651 L0.505373 0.961651"},LAn={};for(let e in kAn){LAn[e]=[];let t=kAn[e].split("M").slice(1).map((n)=>n.split("L").map((o)=>o.trim().split(" ").map(parseFloat)));for(let n of t)for(let o=0;o<n.length-1;o++)LAn[e].push({x1:n[o][0],y1:1-n[o][1],x2:n[o+1][0],y2:1-n[o+1][1]})}var uXs=(()=>{let e=new Uint8Array(4),t=new Uint32Array(e.buffer);return!((t[0]=1)&e[0])})(),pXs={int8:globalThis.Int8Array,uint8:globalThis.Uint8Array,int16:globalThis.Int16Array,uint16:globalThis.Uint16Array,int32:globalThis.Int32Array,uint32:globalThis.Uint32Array,uint64:globalThis.BigUint64Array,int64:globalThis.BigInt64Array,float32:globalThis.Float32Array,float64:globalThis.Float64Array},uYr=[];for(let e=0;e<256;e++){let t=e;for(let n=0;n<8;n++)if(t&1)t=3988292384^t>>>1;else t=t>>>1;uYr[e]=t}var pYr=new Uint16Array([255]),mYr=new Uint8Array(pYr.buffer),mXs=mYr[0]===255,_Yr=new Uint16Array([255]),gYr=new Uint8Array(_Yr.buffer),_Xs=gYr[0]===255,gXs=new Uint8Array(0),AXs=Uint8Array.of(137,80,78,71,13,10,26,10),fXs=new TextDecoder("latin1"),{cos:yXs,sin:xXs,PI:CXs}=Math,{tan:bXs}=Math,IXs=IZ(D3n(),1),U3n=class{MAX_ITERATIONS=1e5;solved=!1;failed=!1;iterations=0;progress=0;error=null;activeSubSolver;failedSubSolvers;timeToSolve;stats={};_setupDone=!1;getSolverName(){return this.constructor.name}setup(){if(this._setupDone)return;this._setup(),this._setupDone=!0}_setup(){}step(){if(!this._setupDone)this.setup();if(this.solved)return;if(this.failed)return;this.iterations++;try{this._step()}catch(e){throw this.error=`${this.getSolverName()} error: ${e}`,this.failed=!0,e}if(!this.solved&&this.iterations>=this.MAX_ITERATIONS)this.tryFinalAcceptance();if(!this.solved&&this.iterations>=this.MAX_ITERATIONS)this.error=`${this.getSolverName()} ran out of iterations`,this.failed=!0;if("computeProgress"in this)this.progress=this.computeProgress()}_step(){}getConstructorParams(){throw Error("getConstructorParams not implemented")}getOutput(){return null}solve(){let e=Date.now();while(!this.solved&&!this.failed)this.step();let t=Date.now();this.timeToSolve=t-e}visualize(){return{lines:[],points:[],rects:[],circles:[]}}tryFinalAcceptance(){}preview(){return{lines:[],points:[],rects:[],circles:[]}}};function AYr(e){if(!e.length)return[[]];let t=[],n=new Set,o=(l)=>{let h=l.map((d)=>d.name).join("\x00");if(!n.has(h))n.add(h),t.push(l)},r=e.reduce((l,h)=>({x:l.x+h.pointsToConnect[1].x-h.pointsToConnect[0].x,y:l.y+h.pointsToConnect[1].y-h.pointsToConnect[0].y}),{x:0,y:0}),i=(l)=>-r.y*l.pointsToConnect[0].x+r.x*l.pointsToConnect[0].y,s=[...e].sort((l,h)=>l.pointsToConnect[0].layer.localeCompare(h.pointsToConnect[0].layer)||i(l)-i(h)||l.name.localeCompare(h.name)),a=(l,h)=>Math.max(...e.map((d)=>d.pointsToConnect[l][h]))-Math.min(...e.map((d)=>d.pointsToConnect[l][h])),c=a(0,"x")<0.0000001&&a(1,"x")<0.0000001?"y":a(0,"y")<0.0000001&&a(1,"y")<0.0000001?"x":void 0;if(c){let l=e.reduce((h,d)=>h+d.pointsToConnect[1][c]-d.pointsToConnect[0][c],0);if(Math.abs(l)>0.0000001)o([...e].sort((h,d)=>h.pointsToConnect[0].layer.localeCompare(d.pointsToConnect[0].layer)||-Math.sign(l)*(h.pointsToConnect[0][c]-d.pointsToConnect[0][c])||h.name.localeCompare(d.name)))}o(s),o([...s].reverse()),o(e);for(let l of[1,0]){let h=e.reduce((_,p)=>({x:_.x+p.pointsToConnect[l].x/e.length,y:_.y+p.pointsToConnect[l].y/e.length}),{x:0,y:0}),d=(_)=>Math.atan2(_.pointsToConnect[l].y-h.y,_.pointsToConnect[l].x-h.x),u=[...e].sort((_,p)=>d(_)-d(p)||_.name.localeCompare(p.name));o(u),o([...u].reverse());for(let _ of["x","y"]){let p=_==="x"?"y":"x",m=[...e].sort((A,g)=>A.pointsToConnect[l][_]-g.pointsToConnect[l][_]||A.pointsToConnect[l][p]-g.pointsToConnect[l][p]);o(m),o([...m].reverse())}for(let _=1;_<u.length;_++){let p=[...u.slice(_),...u.slice(0,_)];o(p),o([...p].reverse())}}return t}function fYr(e,t,n){if(e.buses?.length&&yYr(e,t))return EJ(e,t,n);let o=t.reduce((u,_)=>u+_.route.at(-1).x-_.route[0].x,0),r=t.reduce((u,_)=>u+_.route.at(-1).y-_.route[0].y,0),i=Math.round(Math.atan2(r,o)/(Math.PI/4))*Math.PI/4,s=Math.cos(i),a=Math.sin(i),c=(u)=>({u:u.x*s+u.y*a,v:-u.x*a+u.y*s}),l=(u,_)=>({x:u*s-_*a,y:u*a+_*s}),h=[];for(let u of new Set(t.map((_)=>_.route[0].layer))){let _=t.filter((m)=>m.route[0].layer===u).sort((m,A)=>c(m.route[0]).v-c(A.route[0]).v),p=_.reduce((m,A)=>m+(c(A.route[0]).v+c(A.route.at(-1)).v)/2,0)/_.length;for(let[m,A]of _.entries()){let g=c(A.route[0]),f=c(A.route.at(-1)),y=p+(m-(_.length-1)/2)*n,x=Math.abs(y-g.v),C=Math.abs(y-f.v),b=f.u-g.u-x-C;if(b<1)return null;let I=b*0.15,v=W2([l(g.u,g.v),l(g.u+I,g.v),l(g.u+I+x,y),l(f.u-I-C,y),l(f.u-I,f.v),l(f.u,f.v)]);h.push({...A,route:v.map((P)=>({...P,route_type:"wire",layer:u,width:A.route[0].width}))})}}let d=[...sa(e),...h.flatMap(Jr)];for(let u of h){let _=e.connections.find((p)=>p.name===u.connection_name);if(!new Mi(e,_,u.route[0].width,d).pathVisible(u.route))return null}return t.map((u)=>h.find((_)=>_.connection_name===u.connection_name))}function yYr(e,t){let n=new Map;for(let r of e.obstacles){if(!r.componentId)continue;let i=(r.ccwRotationDegrees??0)*Math.PI/180,s=Math.abs(Math.cos(i))*r.width+Math.abs(Math.sin(i))*r.height,a=Math.abs(Math.sin(i))*r.width+Math.abs(Math.cos(i))*r.height,c=n.get(r.componentId)??{left:1/0,right:-1/0,bottom:1/0,top:-1/0,padSize:0};c.left=Math.min(c.left,r.center.x-s/2),c.right=Math.max(c.right,r.center.x+s/2),c.bottom=Math.min(c.bottom,r.center.y-a/2),c.top=Math.max(c.top,r.center.y+a/2),c.padSize=Math.max(c.padSize,r.width,r.height),n.set(r.componentId,c)}let o=e.minTraceToPadEdgeClearance??e.defaultObstacleMargin??0.075;return t.some((r)=>[r.route[0],r.route.at(-1)].some((i)=>[...n.values()].some((s)=>{let a=Math.max(e.minViaPadDiameter??0.3,s.padSize)/2+o;return i.x>=s.left-a&&i.x<=s.right+a&&i.y>=s.bottom-a&&i.y<=s.top+a})))}var xYr={top:"#dc2626",inner1:"#ca8a04",inner2:"#16a34a",inner3:"#0891b2",inner4:"#9333ea",inner5:"#ea580c",inner6:"#db2777",bottom:"#2563eb"},Lhe=(e)=>xYr[e]??"#64748b",Nf=class e extends U3n{constructor(t,n={},o=new Map){super();this.terminalLayers=o,this.input=structuredClone(t),this.options=n,this.MAX_ITERATIONS=n.maxSearchIterations??200000}terminalLayers;input;options;phase="validate";failureCode=null;traces=[];widths=new Map;fixed=[];orders=[];attempt=0;lane=0;search;bestPartial=[];pairedTraces=[];pairIndex=0;congestionPass=0;conflictingLanes=0;independent;independentAttempted=!1;pairedNetwork;pairedNetworkAttempted=!1;negotiated;reservePackageExits;pairSearch;reportedRoutes;lengthStats;static forRefinement(t,n,o={}){let r=new e(t,o);if(r.initialize(),r.failed)return r;if(r.search instanceof al)r.search.cancel();return r.search=void 0,r.traces=structuredClone(n),r.phase="match",r}static forValidation(t,n,o={}){let r=e.forRefinement(t,n,o);if(!r.failed)r.phase="validate_output";return r}getConstructorParams(){return[this.input,this.options]}getOutput(){if(!this.solved)throw Error(this.error??"Bus lanes are not solved");return{...this.input,traces:[...this.input.traces??[],...this.traces]}}fail(t,n){if(this.failureCode=t,this.error=n,this.failed=!0,this.phase="failed",this.search instanceof al)this.search.cancel();this.pairedNetwork?.return(null),this.pairedNetwork=void 0,this.pairSearch?.return(null),this.negotiated?.return(null),this.pairSearch=void 0,this.negotiated=void 0}tryFinalAcceptance(){if(this.pairedNetwork?.return(null),this.pairedNetwork=void 0,this.independent?.return(null),this.independent=void 0,!this.solved)this.fail("search_budget_exhausted","Vector visibility search budget exhausted")}initialize(){let t=this.input;if(t.outline?.length){this.fail("unsupported_outline","Custom board outlines are unsupported");return}let n=new Set;for(let s of t.connections){if(n.has(s.name))throw Error(`Duplicate connection ${s.name}`);if(n.add(s.name),s.pointsToConnect.length!==2){this.fail("invalid_terminals",`${s.name}: exactly two terminals required`);return}let[a,c]=s.pointsToConnect;if(a.layers||c.layers||a.layer!==c.layer){this.fail("layer_change_required",`${s.name}: ${a.layer} → ${c.layer}; a common fixed layer is required; fanout handoff layers must agree`);return}if(t.allowedLayers&&!t.allowedLayers.includes(a.layer)){this.fail("forbidden_layer",`${s.name}: forbidden signal layer ${a.layer}`);return}if(![a.x,a.y,c.x,c.y].every(Number.isFinite))throw Error("Nonfinite terminal");this.widths.set(s.name,s.nominalTraceWidth??s.width??t.minTraceWidth)}for(let s of t.buses??[])if(s.maxLength!==void 0&&(!Number.isFinite(s.maxLength)||s.maxLength<0))throw Error("Invalid maximum bus length");for(let s of t.buses??[])if(s.minLength!==void 0&&(!Number.isFinite(s.minLength)||s.minLength<0||s.minLength>(s.maxLength??1/0)))throw Error("Invalid minimum bus length");for(let s of t.buses??[])if(s.maxLengthSkew!==void 0&&(!Number.isFinite(s.maxLengthSkew)||s.maxLengthSkew<0))throw Error("Invalid maximum length skew");for(let{names:s,tolerance:a}of nst(t)){if(!Number.isFinite(a)||a<0)throw Error("Invalid maximum length skew");if(s.length<1||new Set(s).size!==s.length||s.some((c)=>!n.has(c)))throw Error("Invalid length matching members")}let o=new Set;for(let s of t.buses??[])for(let a of s.connectionNames){let c=t.connections.find((d)=>d.name===a);if(!c||o.has(a))throw Error(`Missing or duplicated bus member ${a}`);o.add(a);let l=c.pointsToConnect[0].layer;if(s.allowedLayers&&!s.allowedLayers.includes(l))throw Error(`${s.busId}: forbidden layer ${l}`);let h=s.traceWidth;if(h!==void 0)this.widths.set(a,h)}for(let s of this.widths.values())if(!Number.isFinite(s)||s<=0||s<t.minTraceWidth)throw Error("Invalid trace width");this.fixed=sa(t);for(let s of t.connections)for(let a of s.pointsToConnect)this.fixed.push({a,b:a,layer:a.layer,radius:this.widths.get(s.name)/2,owners:[s.name]});let r=this.useNegotiation,i=new Set(r?[]:this.coupledPairs().flatMap((s)=>s.connectionNames));if(this.orders=AYr(t.connections.filter((s)=>!i.has(s.name))),!t.connections.length){this.solved=!0,this.phase="solved";return}if(!r&&this.coupledPairs().length){this.phase="coupled_pairs";return}this.phase="route",this.startLane()}get useNegotiation(){return this.options.denseSearch&&(this.input.connections.length>12||this.input.connections.some((t)=>(this.terminalLayers.get(t.name)?.length??0)>1))}coupledPairs(){return(this.input.differentialPairs??[]).filter((t)=>t.traceGap!==void 0||t.maxUncoupledLength!==void 0)}routePair(){let t=this.coupledPairs()[this.pairIndex];if(!t){this.pairedTraces=structuredClone(this.traces),this.phase="route",this.startLane();return}this.pairSearch??=zk(this.input,t,[...this.fixed,...this.traces.flatMap(Jr)]);let n=this.pairSearch.next();if(!n.done)return;if(!n.value){this.fail("coupled_routing_failed","No legal coupled corridor and package approaches");return}this.traces.push(...n.value),this.pairSearch=void 0,this.pairIndex++}scene(t){return new Mi(this.input,t,this.widths.get(t.name),[...this.fixed,...this.traces.flatMap(Jr)])}startLane(){if(this.lane===this.orders[this.attempt].length){this.phase="match";return}let t=this.orders[this.attempt][this.lane],[n,o]=t.pointsToConnect;this.search=this.useNegotiation?new al(this.scene(t),n,o):new ede(this.scene(t),n,o)}retry(){if(this.traces.length>this.bestPartial.length)this.bestPartial=structuredClone(this.traces);if(this.options.denseSearch&&this.attempt<300){let t=this.orders[this.attempt],n=t[this.lane];if(n){let o=[...t];o.splice(this.lane,1),o.splice(Math.max(0,this.lane-1-Math.floor(this.attempt/8)),0,n);let r=o.map((i)=>i.name).join("\x00");if(!this.orders.slice(0,this.attempt+1).some((i)=>i.map((s)=>s.name).join("\x00")===r))this.orders.splice(this.attempt+1,0,o)}}if(this.attempt++,this.attempt>=this.orders.length){this.traces=this.bestPartial,this.fail("no_planar_route","No collision-free routing found in the vector visibility graph");return}this.traces=structuredClone(this.pairedTraces),this.lane=0,this.startLane()}route(){if(this.useNegotiation){if(this.search instanceof al)this.search.cancel();if(this.search=void 0,!this.pairedNetworkAttempted){this.pairedNetworkAttempted=!0;let o=new Set([...(this.input.buses??[]).flatMap((r)=>r.connectionNames),...(this.input.differentialPairs??[]).flatMap((r)=>r.connectionNames)]);if(this.input.connections.some((r)=>!o.has(r.name))&&mk(this.input))this.pairedNetwork=JVr(this.input,this.terminalLayers)}if(this.pairedNetwork){let o=this.pairedNetwork.next();if(!o.done)return;if(this.pairedNetwork=void 0,o.value){this.traces=o.value,this.phase="match";return}}if(!this.independentAttempted){this.independentAttempted=!0;let o=rst(this.input);if(o)this.independent=$Vr(o,this.fixed,this.widths,(r,i)=>{let s=new e(r,this.options);if(s.step(),s.traces=i,s.phase="match",s.step(),!s.failed)s.step();return s.solved?s.traces:null})}if(this.independent){let o=this.independent.next();if(!o.done){this.traces=o.value,this.lane=this.traces.length;return}if(this.independent=void 0,o.value){this.traces=o.value,this.phase="validate_output";return}}this.reservePackageExits??=mk(this.input),this.negotiated??=VY(this.input,this.orders[0],this.fixed,this.pairedTraces,this.widths,(o,r)=>{this.congestionPass=o,this.conflictingLanes=r},this.terminalLayers,()=>this.reservePackageExits);let n=this.negotiated.next();if(!n.done){this.traces=n.value,this.lane=this.traces.length-this.pairedTraces.length;return}if(!n.value){this.fail("no_planar_route","Negotiated lane search exhausted without a complete route");return}this.traces=n.value,this.phase="match";return}let t=this.search;if(t.step(),t.solved){let n=this.orders[this.attempt][this.lane];this.traces.push({type:"pcb_trace",pcb_trace_id:`bus_lane_${n.name}`,connection_name:n.name,source_trace_id:n.source_trace_id??n.name,route:Hf(t.result,this.scene(n)).map((o)=>({route_type:"wire",x:o.x,y:o.y,layer:n.pointsToConnect[0].layer,width:this.widths.get(n.name)}))}),this.lane++,this.startLane()}else if(t.failed||t.expanded>=(this.options.maxLaneIterations??(t instanceof al?1e6:4000))){if(t instanceof al)t.cancel();this.retry()}}match(){let t=this.input,n=this.traces,o=this.fixed,r=new WeakSet,i=new WeakSet,s=new WeakSet,a=this.options.smoothTuning&&n.some((u)=>u.coupledSection);function*c(){if(yield n,a){let p=new Set(t.buses?.flatMap((m)=>m.connectionNames));if((t.allowedLayers?.length??t.layerCount)===2&&n.some((m)=>!p.has(m.connection_name))){let m=N3n(t,n).size>0;for(let A of m?[12,14,16,10,8]:[10,8,12,14,16]){let g=EJ(t,n,t.minTraceWidth*A,"dogleg",!0);if(g)r.add(g),i.add(g),yield g}}for(let m of(t.buses?.length??0)>1?[5,6,8,12,16,20]:[5,6,8,12]){let A=EJ(t,n,t.minTraceWidth*m,"interior");if(A){if(m<8)s.add(A);r.add(A),yield A}}for(let m of[8,12]){let A=EJ(t,n,t.minTraceWidth*m);if(A)r.add(A),yield A}}if(a)yield n;let u=F3n(t,n,o);if(u.some((p,m)=>p!==n[m]))yield u;if(n.some((p)=>p.coupledSection)){for(let p of a?[20,16,6,4]:[20,16,12,8,6,4]){let m=EJ(t,n,t.minTraceWidth*p);if(m)yield m}for(let p of[8,12,6,16,4,20]){let m=EJ(t,n,t.minTraceWidth*p,"diagonal");if(m)yield m}return}let _=Math.max(...n.map((p)=>p.route[0].width));for(let p of[16,24,28,32]){let m=fYr(t,n,_*p);if(m)yield m}}let l,h=new Set,d=!1;for(let u of c()){let _=a&&u===n&&!d,p=_||s.has(u);if(u===n)d=!0;let m=function*(A,g){if(yield u,p)return;if(g)yield oYr(t,u,A);if(g&&u.some((f)=>f.coupledSection))for(let f of[2.75,2.5,2.25,2,3,1.5,1,0.5,0.25,0.125,0.0625,0.03125])yield rYr(t,u,A,f)};for(let A of m(this.fixed,this.options.smoothTuning))for(let g of this.options.smoothTuning?p?[1.5]:[1.5,0.75,0.375,0.1875,0.09375,0.046875,0.0234375]:[0]){let f=I7e(t,g?Mk(t,A,this.fixed,g):A),y=JSON.stringify(f.map((x)=>[x.route,x.coupledSection,x.curvedSegments]));if(h.has(y))continue;if(h.add(y),this.options.smoothTuning&&!xY(f)){l=Error("No clear conventional approach corners");continue}if(wk(t,f).some((x)=>!x.matched)){l=Error("Pair approach refinement separated the shared rails");continue}try{let x=bk(t,f);if(PVr(t,x),this.traces=this.options.smoothTuning&&f.some((C)=>C.coupledSection)?G3n(t,f,{maxCandidates:u===n?t.buses?.some((C)=>C.maxLength!==void 0)?65536:512:i.has(u)?65536:16384,packMeanders:_||r.has(u)}):(this.options.smoothTuning?JJ:wVr)(t,f,x),this.options.smoothTuning)this.traces=Y3n(t,this.traces);if(this.options.smoothTuning&&!xY(this.traces))throw Error("Length tuning introduced a sharp corner");if(wk(t,this.traces).some((C)=>!C.matched))throw Error("Length tuning separated the shared pair rails");this.phase="validate_output";return}catch(x){l=x}}}this.fail("length_matching_failed",String(l));return}validateOutput(){if(this.options.smoothTuning&&!xY(this.traces))throw Error("Final route has a nonconventional corner");for(let t of this.input.connections){let n=this.traces.find((r)=>r.connection_name===t.name);if(!n)throw Error("Missing lane");if(n.route.length<2||n.route.some((r)=>!Number.isFinite(r.x)||!Number.isFinite(r.y)||r.route_type!=="wire"||!Number.isFinite(r.width)||r.width<=0))throw Error("Invalid lane geometry");if(n.route.some((r)=>r.route_type!=="wire"||r.layer!==t.pointsToConnect[0].layer))throw Error("Carrier layer does not match its terminals");let o=this.scene(t);if(!Wc(n.route,this.widths.get(t.name)/2+o.margin))throw Error("Final self-clearance violation");if(Fn(n.route[0],t.pointsToConnect[0])>0.00000001||Fn(n.route.at(-1),t.pointsToConnect[1])>0.00000001)throw Error("Broken lane endpoints");for(let r=1;r<n.route.length;r++){let i=n.route[r-1],s=n.route[r],a=Math.abs(i.x-s.x),c=Math.abs(i.y-s.y);if(i.route_type!=="wire"||s.route_type!=="wire"||i.layer!==s.layer)throw Error("Forbidden layer transition");if(Math.min(a,c)>0.00000001&&Math.abs(a-c)>0.00000001&&!n.curvedSegments?.includes(r))throw Error("Non-octilinear segment");if(!o.visible(i,s))throw Error("Final copper clearance violation")}}if([...YS(this.input,this.traces),...Got(this.input,this.traces)].some((t)=>t.toleranceMm!==null&&!t.matched))throw Error("Final bus length skew violation");if(YS(this.input,this.traces).some((t)=>!t.withinLengthLimit||!t.aboveMinimumLength))throw Error("Final absolute bus length violation");if(dYr(this.input,this.traces).some((t)=>!t.matched))throw Error("Final pair spacing or uncoupled length violation");this.phase="solved",this.solved=!0}_step(){try{if(this.phase==="validate")this.initialize();else if(this.phase==="coupled_pairs")this.routePair();else if(this.phase==="route")this.route();else if(this.phase==="match")this.match();else if(this.phase==="validate_output")this.validateOutput()}catch(t){this.fail("constraint_error",String(t))}if(this.progress=this.lane/Math.max(1,this.input.connections.length),!this.reportedRoutes||this.reportedRoutes.length!==this.traces.length||this.reportedRoutes.some((t,n)=>t.trace!==this.traces[n]||t.route!==this.traces[n].route))this.reportedRoutes=this.traces.map((t)=>({trace:t,route:t.route})),this.lengthStats={busLengths:YS(this.input,this.traces),pairLengths:Got(this.input,this.traces),traceLengthsMm:this.traces.map((t)=>({name:t.connection_name,length:Ar(t.route)}))};this.stats={...this.lengthStats,phase:this.phase,algorithm:"octilinear_visibility",attempt:this.attempt,lane:this.lane,totalLanes:this.input.connections.length,congestionPass:this.congestionPass,conflictingLanes:this.conflictingLanes,vertices:(this.search instanceof ede?this.search.vertices.length:0)??0,expandedVertices:this.search?.expanded??0,frontier:(this.search instanceof ede?this.search.open.length:0)??0,failureCode:this.failureCode}}visualize(){let t=[],n=[],o=[],r=[];for(let i of sa(this.input)){if(i.rect){o.push({center:{x:(i.rect.minX+i.rect.maxX)/2,y:(i.rect.minY+i.rect.maxY)/2},width:i.rect.maxX-i.rect.minX,height:i.rect.maxY-i.rect.minY,layer:i.layer,fill:`${Lhe(i.layer)}30`,stroke:Lhe(i.layer)});continue}if(Fn(i.a,i.b)<0.000000001)r.push({center:i.a,radius:i.radius,layer:i.layer,fill:"transparent",stroke:Lhe(i.layer)});else t.push({points:[{x:i.a.x,y:i.a.y},{x:i.b.x,y:i.b.y}],strokeWidth:i.radius*2,strokeColor:Lhe(i.layer),layer:i.layer,label:`Fixed fanout [${i.layer}]`})}for(let i of this.traces)t.push({points:i.route.map(({x:s,y:a})=>({x:s,y:a})),strokeWidth:i.route[0].width,strokeColor:Lhe(i.route[0].layer),layer:i.route[0].layer,label:i.connection_name});for(let i of this.input.connections)for(let[s,a]of i.pointsToConnect.entries())n.push({...a,color:s?"#d97706":"#2563eb",label:`${i.name} ${s?"target":"source"} [${a.layer}]`});if(this.search instanceof ede&&this.phase==="route"){let i=this.orders[this.attempt][this.lane]?.pointsToConnect[0].layer;for(let s of this.search.visibleEdges)t.push({points:s,strokeWidth:0.02,strokeColor:"#67e8f980",layer:i});for(let s of this.search.open.values().slice(0,80))n.push({...this.search.vertices[s.id],color:"#06b6d4",layer:i});t.push({points:this.search.currentPath(),strokeColor:"#f43f5e",strokeWidth:0.09,layer:i})}return{title:`Vector bus lanes · ${this.phase}`,lines:t,points:n,rects:o,circles:r}}};function CYr(e,t,n){let o=[];for(let s of n){let a=0,c=1;for(let[l,h,d]of[["x",s.minX,s.maxX],["y",s.minY,s.maxY]]){let u=t[l]-e[l];if(Math.abs(u)<0.000000000000001){if(e[l]<h||e[l]>d){a=1,c=0;break}}else{let _=(h-e[l])/u,p=(d-e[l])/u;a=Math.max(a,Math.min(_,p)),c=Math.min(c,Math.max(_,p))}}if(a<c)o.push([a,c])}o.sort((s,a)=>s[0]-a[0]);let r=[],i=0;for(let[s,a]of o){if(s>i)r.push([i,s]);i=Math.max(i,a)}if(i<1)r.push([i,1]);return r}function MS(e,t){let n=t.flatMap((o)=>{let r=o.route.flatMap((i,s)=>i.route_type==="via"?[s]:[]);return r.length===2?[{...o,route:o.route.slice(0,r[0]+2)},{...o,route:o.route.slice(r[1]-1).toReversed()}]:[]});return(e.differentialPairs??[]).map((o)=>{let r=o.connectionNames.map((g)=>t.find((f)=>f.connection_name===g||f.source_trace_id===g)),i=Math.max(...r.flatMap((g)=>g?.route.flatMap((f)=>f.route_type==="wire"?[f.width]:[])??[])),s=e.minTraceToPadEdgeClearance??e.defaultObstacleMargin??0.075,a=o.traceGap??s,c=OY({...e,traces:[...e.traces??[],...n]},i+a/2+s),l=[0,1].flatMap((g)=>{let f=c.find((y)=>r.every((x)=>x?.route.length&&by(g?x.route.at(-1):x.route[0],y.copper)));return f?[f.copper]:[]}),h=(o.traceGap!==void 0||o.maxUncoupledLength!==void 0)&&l.length===2&&r.every((g)=>g?.route.length),d={connectionNames:o.connectionNames,applicable:h};if(!h)return{...d,matched:!0,maxExteriorEdgeGapMm:null,maxSamplingErrorMm:null,separatedExteriorLengthMm:null};let u=(g)=>g.route.slice(1).flatMap((f,y)=>{let x=g.route[y];return x.route_type==="wire"&&f.route_type==="wire"&&x.layer===f.layer?[{a:x,b:f,radius:x.width/2,layer:x.layer,owners:[]}]:[]}),_=-1/0,p=0,m=0,A=(i+a)/Math.cos(Math.PI/8)-i+0.002;for(let g=0;g<2;g++){let f=u(r[1-g]),y=new Map([...new Set(f.map((x)=>x.layer))].map((x)=>[x,new Due(f.filter((C)=>C.layer===x))]));for(let{a:x,b:C}of u(r[g])){let b=Fn(x,C);for(let[I,v]of CYr(x,C,l)){let P=Math.max(1,Math.ceil((v-I)*b/0.002)),M=(v-I)*b/P;p=Math.max(p,M/2);for(let B=0;B<P;B++){let T=I+(v-I)*(B+0.5)/P,N={x:x.x+(C.x-x.x)*T,y:x.y+(C.y-x.y)*T},D=(y.get(x.layer)?.distanceToPoint(N,(L)=>Iy(N,L.a,L.b)-L.radius)??1/0)-x.width/2;if(_=Math.max(_,D),D+M/2>A)m+=M}}}}return{...d,matched:m===0,maxExteriorEdgeGapMm:_===-1/0?null:_,maxSamplingErrorMm:p,separatedExteriorLengthMm:m}})}var HAn=(e)=>({...e,route:e.route.toReversed(),coupledSection:e.coupledSection?[e.route.length-1-e.coupledSection[1],e.route.length-1-e.coupledSection[0]]:void 0,curvedSegments:e.curvedSegments?.map((t)=>e.route.length-t)});function*bYr(e,t,n,o){let r=bk(e,t),i=new Set(e.differentialPairs?.flatMap((l)=>l.connectionNames)),s=new Set(n.map((l)=>l.pcb_trace_id)),a=t.filter((l)=>i.has(l.connection_name)&&l.coupledSection&&(r.get(l.connection_name)??0)>Ar(l.route)+Lf(e,l.connection_name)+0.0000001),c=0;for(let l of a)for(let h of[0,1]){let d=h?HAn(l):l,u=d.connection_name,_=d.route[0].layer,p=e.traces?.find((H)=>s.has(H.pcb_trace_id)&&H.connection_name===u&&H.route.filter((V)=>V.route_type==="via").length===1&&Fn(H.route.at(-1),d.route[0])<0.0000001);if(!p)continue;let m=p.route[0],A=p.route.find((H)=>H.route_type==="via");if(m.layer!=="top"||A.from_layer!=="top")continue;let g=e.obstacles.find((H)=>H.componentId&&Fn(H.center,m)<0.0001);if(!g)continue;let f=e.obstacles.filter((H)=>H.componentId===g.componentId),y=Math.min(...f.map((H)=>Fn(H.center,m)).filter((H)=>H>0.0001));if(!Number.isFinite(y))continue;let x=Math.min(2,2.5*y),C=Math.min(...f.map((H)=>H.center.x-H.width/2)),b=Math.max(...f.map((H)=>H.center.x+H.width/2)),I=Math.min(...f.map((H)=>H.center.y-H.height/2)),v=Math.max(...f.map((H)=>H.center.y+H.height/2)),P=[{x:-1,y:0,d:m.x-C},{x:1,y:0,d:b-m.x},{x:0,y:-1,d:m.y-I},{x:0,y:1,d:v-m.y}].sort((H,V)=>H.d-V.d).slice(0,2),M=t.filter((H)=>H!==l),B=e.connections.find((H)=>H.name===u),T={...e,traces:e.traces.filter((H)=>H!==p)},N=[...sa(T),...M.flatMap(Jr)],D=d.route[0].width;function*L(H,V,O,U){let j={...B,pointsToConnect:[{...H,layer:O},{...V,layer:O}]},Y=new Mi(T,j,D,N),X=new al(Y,j.pointsToConnect[0],j.pointsToConnect[1],[],0,void 0,{maxLength:U,paretoLength:!0,checkReachability:!0});try{let K=0;while(!X.solved&&!X.failed&&K++<4000)X.step(),yield;return X.solved?Hf(X.result,Y).map((J)=>({...J,route_type:"wire",layer:O,width:D})):null}finally{X.cancel()}}for(let H of P)for(let V of[1,0.875,1.125,1.25,1.5])for(let O of[1.125,1,0.875,0.75,1.25,1.375,1.5,0.625])for(let U of[-1,1]){if(++c>192)return null;let j={x:m.x+y*(H.x*V-H.y*O*U),y:m.y+y*(H.y*V+H.x*O*U)},Y={...A,...j,to_layer:_};if(Array.from({length:e.layerCount},(ie,ce)=>ce===0?"top":ce===e.layerCount-1?"bottom":`inner${ce}`).some((ie)=>!new Mi(T,{...B,pointsToConnect:[{...j,layer:ie},{...j,layer:ie}]},Y.via_diameter??0.3,N).visible(j,j)))continue;let K=yield*L(m,j,"top",x),J=d.coupledSection[0],ee=yield*L(j,d.route[J],_,4*y);if(!K||!ee)continue;K=Mk({...T,connections:[{...B,pointsToConnect:[m,{...j,layer:"top"}]}]},[{...p,route:K}],N)[0].route;let se={...p,route:[...K,Y,{...j,route_type:"wire",layer:_,width:D}]},ne=ee.length-1-J,re={...d,route:[...ee.slice(0,-1),...d.route.slice(J)],coupledSection:d.coupledSection.map((ie)=>ie+ne),curvedSegments:d.curvedSegments?.filter((ie)=>ie>J).map((ie)=>ie+ne)};if(h)re=HAn(re);let Z={...e,traces:e.traces.map((ie)=>ie===p?se:ie),connections:e.connections.map((ie)=>ie===B?{...ie,pointsToConnect:[re.route[0],re.route.at(-1)]}:ie)},te=Ar(re.route)+Lf(Z,u);if(Math.abs(te-r.get(u))>1)continue;for(let ie of[0.75,0.375,1.5])try{let ce=I7e(Z,Mk(Z,t.map((me)=>me===l?re:me),void 0,ie)),ue=G3n(Z,ce,{maxCandidates:65536,packMeanders:!0,packageOnlyPairTuning:!0});if(ue.some((me)=>!Tue(Z,me,{preserveExistingApproach:!1})(me.route)))continue;let de=Nf.forValidation(Z,ue,o);try{while(!de.solved&&!de.failed)de.step(),yield;let me=MS(Z,ue);if(de.solved&&me.length===(e.differentialPairs?.length??0)&&me.every((ge)=>ge.applicable&&ge.matched))return{input:Z,traces:ue,escapes:n.map((ge)=>ge.pcb_trace_id===p.pcb_trace_id?se:ge)}}finally{if(!de.solved&&!de.failed)de.tryFinalAcceptance()}}catch{yield}}}return null}var IYr=IZ(SVr(),1),$x=(e,t,n)=>e.matrix[Math.imul(t,e.width)+n],Xx=(e,t,n,o)=>{e.matrix[Math.imul(t,e.width)+n]=o},Xtt=(e)=>(Symbol.iterator in e)&&typeof e[Symbol.iterator]==="function"?e:Object.entries(e),FAn=(e)=>e===!0?!0:e===!1?new Set:e instanceof Set?e:new Set(e),vYr=(e)=>{let{direction:t,objective:n,integers:o,binaries:r}=e,i=t==="minimize"?-1:1,s=Xtt(e.constraints),a=Xtt(e.variables),c=Array.isArray(a)?a:Array.from(a),l=[],h=[];if(o!=null||r!=null){let x=FAn(r),C=x===!0?!0:FAn(o);for(let b=1;b<=c.length;b++){let[I]=c[b-1];if(x===!0||x.has(I))l.push(b),h.push(b);else if(C===!0||C.has(I))h.push(b)}}let d=new Map;for(let[x,C]of s){let b=d.get(x)??{row:NaN,lower:-1/0,upper:1/0};if(b.lower=Math.max(b.lower,C.equal??C.min??-1/0),b.upper=Math.min(b.upper,C.equal??C.max??1/0),!d.has(x))d.set(x,b)}let u=1;for(let x of d.values())x.row=u,u+=(Number.isFinite(x.lower)?1:0)+(Number.isFinite(x.upper)?1:0);let _=c.length+1,p=u+l.length,m=_+p,A=new Float64Array(_*p),g=new Int32Array(m),f=new Int32Array(m),y={matrix:A,width:_,height:p,positionOfVariable:g,variableAtPosition:f};for(let x=0;x<m;x++)g[x]=x,f[x]=x;for(let x=1;x<_;x++)for(let[C,b]of Xtt(c[x-1][1])){if(C===n)Xx(y,0,x,i*b);let I=d.get(C);if(I!=null){if(Number.isFinite(I.upper)){if(Xx(y,I.row,x,b),Number.isFinite(I.lower))Xx(y,I.row+1,x,-b)}else if(Number.isFinite(I.lower))Xx(y,I.row,x,-b)}}for(let x of d.values())if(Number.isFinite(x.upper)){if(Xx(y,x.row,0,x.upper),Number.isFinite(x.lower))Xx(y,x.row+1,0,-x.lower)}else if(Number.isFinite(x.lower))Xx(y,x.row,0,-x.lower);for(let x=0;x<l.length;x++){let C=u+x;Xx(y,C,0,1),Xx(y,C,l[x],1)}return{tableau:y,sign:i,variables:c,integers:h}},W3n=(e,t)=>{let n=Math.round(1/t);return Math.round((e+Number.EPSILON)*n)/n},X3n=(e,t,n)=>{let o=$x(e,t,n),r=e.variableAtPosition[e.width+t],i=e.variableAtPosition[n];e.variableAtPosition[e.width+t]=i,e.variableAtPosition[n]=r,e.positionOfVariable[r]=n,e.positionOfVariable[i]=e.width+t;let s=[];for(let a=0;a<e.width;a++){let c=$x(e,t,a);if(Math.abs(c)>0.0000000000000001)Xx(e,t,a,c/o),s.push(a);else Xx(e,t,a,0)}Xx(e,t,n,1/o);for(let a=0;a<e.height;a++){if(a===t)continue;let c=$x(e,a,n);if(Math.abs(c)>0.0000000000000001){for(let l=0;l<s.length;l++){let h=s[l];Xx(e,a,h,$x(e,a,h)-c*$x(e,t,h))}Xx(e,a,n,-c/o)}}},j3n=(e,t,n,o)=>{e.push([t.variableAtPosition[t.width+n],t.variableAtPosition[o]]);for(let r=6;r<=Math.trunc(e.length/2);r++){let i=!0;for(let s=0;s<r;s++){let a=e.length-1-s,[c,l]=e[a],[h,d]=e[a-r];if(c!==h||l!==d){i=!1;break}}if(i)return!0}return!1},SYr=(e,t)=>{let n=[],{precision:o,maxPivots:r,checkCycles:i}=t;for(let s=0;s<r;s++){let a=0,c=o;for(let d=1;d<e.width;d++){let u=$x(e,0,d);if(u>c)c=u,a=d}if(a===0)return["optimal",W3n($x(e,0,0),o)];let l=0,h=1/0;for(let d=1;d<e.height;d++){let u=$x(e,d,a);if(u<=o)continue;let p=$x(e,d,0)/u;if(p<h){if(l=d,h=p,p<=o)break}}if(l===0)return["unbounded",a];if(i&&j3n(n,e,l,a))return["cycled",NaN];X3n(e,l,a)}return["cycled",NaN]},K3n=(e,t)=>{let n=[],{precision:o,maxPivots:r,checkCycles:i}=t;for(let s=0;s<r;s++){let a=0,c=-o;for(let d=1;d<e.height;d++){let u=$x(e,d,0);if(u<c)c=u,a=d}if(a===0)return SYr(e,t);let l=0,h=-1/0;for(let d=1;d<e.width;d++){let u=$x(e,a,d);if(u<-o){let _=-$x(e,0,d)/u;if(_>h)h=_,l=d}}if(l===0)return["infeasible",NaN];if(i&&j3n(n,e,a,l))return["cycled",NaN];X3n(e,a,l)}return["cycled",NaN]},zAn=(e,t)=>({matrix:new Float64Array(e),positionOfVariable:new Int32Array(t),variableAtPosition:new Int32Array(t)}),PYr=(e,{matrix:t,positionOfVariable:n,variableAtPosition:o},r)=>{let{width:i,height:s}=e;t.set(e.matrix);for(let c=0;c<r.length;c++){let[l,h,d]=r[c],u=(s+c)*i,_=e.positionOfVariable[h];if(_<i)t[u]=l*d,t.fill(0,u+1,u+i),t[u+_]=l;else{let p=(_-i)*i;t[u]=l*(d-t[p]);for(let m=1;m<i;m++)t[u+m]=-l*t[p+m]}}n.set(e.positionOfVariable),o.set(e.variableAtPosition);let a=i+s+r.length;for(let c=i+s;c<a;c++)n[c]=c,o[c]=c;return{matrix:t.subarray(0,e.matrix.length+i*r.length),width:i,height:s+r.length,positionOfVariable:n.subarray(0,a),variableAtPosition:o.subarray(0,a)}},OAn=(e,t)=>{let n=0,o=0,r=0;for(let i=0;i<t.length;i++){let s=t[i],a=e.positionOfVariable[s]-e.width;if(a<0)continue;let c=$x(e,a,0),l=Math.abs(c-Math.round(c));if(l>n)n=l,o=s,r=c}return[o,r,n]},EYr=(e,t,n)=>{let{tableau:o,sign:r,integers:i}=e,{precision:s,maxIterations:a,tolerance:c,timeout:l}=n,[h,d,u]=OAn(o,i);if(u<=s)return[e,"optimal",t];let _=new IYr.default((T,N)=>T[0]-N[0]);_.push([t,[[-1,h,Math.ceil(d)]]]),_.push([t,[[1,h,Math.floor(d)]]]);let p=i.length*2,m=o.matrix.length+p*o.width,A=o.positionOfVariable.length+p,g=zAn(m,A),f=zAn(m,A),y=t*(1-r*c),x=l+Date.now(),C=Date.now()>=x,b=!1,I=1/0,v=o,P=0;while(P<a&&!_.empty()&&I>=y&&!C){let[T,N]=_.pop();if(T>I)break;let D=PYr(o,g,N),[L,H]=K3n(D,n);if(L==="optimal"&&H<I){let[V,O,U]=OAn(D,i);if(U<=s){b=!0,I=H,v=D;let j=f;f=g,g=j}else{let j=[],Y=[];for(let X=0;X<N.length;X++){let K=N[X],[J,ee]=K;if(ee===V)if(J<0)Y.push(K);else j.push(K);else j.push(K),Y.push(K)}Y.push([1,V,Math.floor(O)]),j.push([-1,V,Math.ceil(O)]),_.push([H,j]),_.push([H,Y])}}C=Date.now()>=x,P++}let B=(C||P>=a)&&!_.empty()&&I>=y?"timedout":!b?"infeasible":"optimal";return[{...e,tableau:v},B,b?I:NaN]},VAn=({tableau:e,sign:t,variables:n},o,r,{precision:i,includeZeroVariables:s})=>{if(o==="optimal"||o==="timedout"&&!Number.isNaN(r)){let a=[];for(let c=0;c<n.length;c++){let[l]=n[c],h=e.positionOfVariable[c+1]-e.width,d=h>=0?$x(e,h,0):0;if(d>i)a.push([l,W3n(d,i)]);else if(s)a.push([l,0])}return{status:o,result:-t*r,variables:a}}else if(o==="unbounded"){let a=e.variableAtPosition[r]-1;return{status:"unbounded",result:t*(1/0),variables:0<=a&&a<n.length?[[n[a][0],1/0]]:[]}}else return{status:o,result:NaN,variables:[]}},$3n={precision:0.00000001,checkCycles:!1,maxPivots:8192,tolerance:0,timeout:1/0,maxIterations:32768,includeZeroVariables:!1},vXs={...$3n},MYr=(e,t)=>{let n=vYr(e),o={...$3n,...t},[r,i]=K3n(n.tableau,o);if(n.integers.length===0||r!=="optimal")return VAn(n,r,i,o);else{let[s,a,c]=EYr(n,i,o);return VAn(s,a,c,o)}};function wYr(e,t,n,o,r=!1){let i=0,s=new Set(e.differentialPairs?.flatMap((p)=>p.connectionNames)),a=t.map((p)=>{if(n&&(r||!s.has(p.connection_name))){let f=new Set(p.curvedSegments??[]),y=[];for(let v of[...f].sort((P,M)=>P-M)){if(!y.length||v-y.at(-1).at(-1)>4)y.push([]);y.at(-1).push(v)}let x=y.map((v,P)=>{let M=v[0]-1,B=v.at(-1),T=p.route[M],N=p.route[B],D=Fn(T,N),L=D>0.000001?{x:-(N.y-T.y)/D,y:(N.x-T.x)/D}:{x:0,y:1};return{first:M,last:B,n:L,bi:P}}),C=[];for(let v=0;v<p.route.length;v++)if(v>0&&f.has(v))C.at(-1).push(v);else C.push([v]);let b=new Map,I=new Map;for(let v of C){let P;if(!v.includes(0)&&!v.includes(p.route.length-1)){let M=x.find((N)=>v[0]>=N.first&&v.at(-1)<=N.last),B=M?v.map((N)=>p.route[N].x*M.n.x+p.route[N].y*M.n.y):[],T=M&&v.length>2?`${M.bi}:${Math.round(Math.min(...B)*1e6)}:${Math.round(Math.max(...B)*1e6)}`:`vertex${v[0]}`;if(P=I.get(T),P===void 0)P=i++,I.set(T,P)}for(let M of v)b.set(M,P)}return p.route.map((v,P)=>({...v,group:b.get(P)}))}let m=Math.min(...p.curvedSegments??[])-1,A=Math.max(...p.curvedSegments??[]),g=i++;return p.route.map((f,y)=>({...f,group:y===0||y===p.route.length-1||y>=m&&y<=A&&(m===0||A===p.route.length-1)?void 0:y>=m&&y<=A?g:i++}))}),c=new Set,l=sa(e).filter((p)=>!p.rect&&Fn(p.a,p.b)<0.00000001);for(let p=0;o&&p<t.length;p++)for(let m of l){if(!m.owners.includes(t[p].connection_name))continue;let A=a[p],g=m.radius+t[p].route[0].width/2+(e.minTraceToPadEdgeClearance??e.defaultObstacleMargin??0.075);for(let f=1;f<A.length;f++)if(mB([A[f-1],A[f]],[m.a,m.b])<=g+0.00000001){for(let y of[A[f-1],A[f]])if(y.group!==void 0)c.add(y.group)}}let h=Array.from({length:i},(p,m)=>m),d=(p)=>h[p]===p?p:h[p]=d(h[p]),u=new Set(c);for(let p of e.differentialPairs??[]){let m=t.findIndex((f)=>f.connection_name===p.connectionNames[0]),A=t.findIndex((f)=>f.connection_name===p.connectionNames[1]);if(m<0||A<0)continue;let g=(e.minTraceWidth+(p.traceGap??0.1))*1.6;for(let f of a[m])for(let y of a[A]){if(Fn(f,y)>g)continue;if(f.group===void 0&&y.group!==void 0)u.add(y.group);else if(y.group===void 0&&f.group!==void 0)u.add(f.group);else if(f.group!==void 0&&y.group!==void 0)h[d(f.group)]=d(y.group)}}let _=new Set([...u].map(d));for(let p of a)for(let m of p)if(m.group!==void 0)m.group=_.has(d(m.group))?void 0:d(m.group);return a}function YAn(e,t,n=!0){let o=new Map;for(let s of e)for(let a of s)if(a.group!==void 0)o.set(a.group,{x:(t.get(`${a.group}_x_1`)??0)-(t.get(`${a.group}_x_-1`)??0),y:(t.get(`${a.group}_y_1`)??0)-(t.get(`${a.group}_y_-1`)??0)});let r=new Map;for(let s of o.values()){let a={x:!n||Math.abs(s.x)>=0.0000001?1:0,y:!n||Math.abs(s.y)>=0.0000001?1:0};if(!a.x)s.x=0;if(!a.y)s.y=0;r.set(s,a)}let i=e.flatMap((s)=>s.slice(1).flatMap((a,c)=>{let l=s[c],h=Fn(l,a);if(l.group===a.group)return[];return(h<0.00000001?[{x:1,y:0},{x:0,y:1}]:[{x:-(a.y-l.y)/h,y:(a.x-l.x)/h}]).map((u)=>({a:o.get(l.group),b:o.get(a.group),n:u}))}));for(let s=0;s<20000;s++){let a=0;for(let{a:c,b:l,n:h}of i){let d=((l?.x??0)-(c?.x??0))*h.x+((l?.y??0)-(c?.y??0))*h.y;a=Math.max(a,Math.abs(d));let u=c?r.get(c):{x:0,y:0},_=l?r.get(l):{x:0,y:0},p=(u.x+_.x)*h.x*h.x+(u.y+_.y)*h.y*h.y;if(p<0.0000000000000001)continue;let m=d/p;if(c)c.x+=m*h.x*u.x,c.y+=m*h.y*u.y;if(l)l.x-=m*h.x*_.x,l.y-=m*h.y*_.y}if(a<0.00000000000001)break}return o}var BYr=class{constructor(e){this.motion=e}motion;pairs=new Map;add(e){let{a:t,b:n,n:o,min:r}=e;if(t.group===n.group)return;let i=t.group??-1,s=n.group??-1,a=o;if(i>s)[i,s]=[s,i],a={x:-o.x,y:-o.y};let c=`${i}:${s}`,l=i===-1?this.motion:this.motion*2,h=this.pairs.get(c)??{polygon:[{x:-l,y:-l},{x:l,y:-l},{x:l,y:l},{x:-l,y:l}],cuts:[]},d=[],u=h.polygon;for(let m=0;m<u.length;m++){let A=u[(m+u.length-1)%u.length],g=u[m],f=A.x*a.x+A.y*a.y-r,y=g.x*a.x+g.y*a.y-r;if(f<0!==y<0){let x=f/(f-y);d.push({x:A.x+(g.x-A.x)*x,y:A.y+(g.y-A.y)*x,cut:f>=0?g.cut:e})}if(y>=0)d.push(g)}let _=[],p=(m,A)=>Math.abs(m.x-A.x)<0.000000000001&&Math.abs(m.y-A.y)<0.000000000001;for(let m of d)if(!_.length||!p(_.at(-1),m))_.push(m);if(_.length>1&&p(_[0],_.at(-1)))_[0]={..._[0],cut:_.at(-1).cut},_.pop();h.polygon=_,h.cuts.push(e),this.pairs.set(c,h)}*active(){for(let{polygon:e,cuts:t}of this.pairs.values()){let n=e.reduce((o,r,i)=>{let s=e[(i+1)%e.length];return o+r.x*s.y-r.y*s.x},0);if(Math.abs(n)<0.000000000001)yield*t;else yield*new Set(e.map((o)=>o.cut).filter((o)=>!!o))}}};function*q3n(e,t,n="conservative"){let o={},r={};if(!t.length)return t;let i=0,s=0,a=(N,D)=>{let L=`c${i++}`;if(![...N.values()].some((H)=>Math.abs(H)>0.0000000001))return;r[L]=D;for(let[H,V]of N)if(Math.abs(V)>0.0000000001)(o[H]??={})[L]=V},c=(N,D,L,H=1)=>{if(D.group===void 0)return;for(let V of["x","y"])for(let O of[-1,1]){let U=`${D.group}_${V}_${O}`,j=H*L[V]*O;N.set(U,(N.get(U)??0)+j)}},l=n==="cohort"||n==="guarded-cohort",h=n==="guarded"||n==="guarded-cohort",d=n!=="conservative",u=n==="flexible"||n==="guarded"||l,_=u&&!l?4:2,p=d&&!l?12:24,m=h?96000000:64000000,A=new Set(e.differentialPairs?.flatMap((N)=>N.connectionNames)),g=d?wYr(e,t,u,h,l):t.map((N)=>{let D=Math.min(...N.curvedSegments??[])-1,L=Math.max(...N.curvedSegments??[]),H=s++;return N.route.map((V,O)=>({...V,group:O===0||O===N.route.length-1||A.has(N.connection_name)||O>=D&&O<=L&&(D===0||L===N.route.length-1)?void 0:O>=D&&O<=L?H:s++}))});for(let N of g)for(let D of N)if(D.group!==void 0)for(let L of["x","y"])for(let H of[-1,1]){let V=`${D.group}_${L}_${H}`;if(o[V])continue;o[V]={objective:d?0.000001:0.0001},a(new Map([[V,1]]),{max:_})}let f=new Map;for(let[N,D]of g.entries()){let L=new Map;for(let H=1;H<D.length;H++){let V=D[H-1],O=D[H],U=Fn(V,O);if(V.group===O.group)continue;if(U<0.00000001){for(let J of[{x:1,y:0},{x:0,y:1}]){let ee=new Map;c(ee,O,J),c(ee,V,J,-1),a(ee,{equal:0})}continue}let j={x:(O.x-V.x)/U,y:(O.y-V.y)/U},Y={x:-j.y,y:j.x},X=new Map;c(X,O,Y),c(X,V,Y,-1),a(X,{equal:0});let K=new Map;c(K,O,j),c(K,V,j,-1),a(K,{min:Math.min(U,0.01)-U}),c(L,O,j),c(L,V,j,-1)}if(!d)a(L,e.buses?.some((H)=>H.maxLengthSkew!==void 0&&H.connectionNames.includes(t[N].connection_name))?{equal:0}:{max:0});else{let H=t[N].connection_name,V=Ar(t[N].route)+Lf(e,H);f.set(H,{terms:L,total:V}),a(L,{max:0});for(let O of e.buses??[])if(O.connectionNames.includes(H)&&O.minLength!==void 0)a(L,{min:O.minLength-V})}}if(d)for(let[N,{names:D,tolerance:L}]of nst(e).entries()){let H=D.map((j)=>f.get(j)).filter((j)=>!!j);if(!H.length)continue;let V=Math.max(...H.map((j)=>j.total)),O=`bus_shrink_${N}`,U=l?Math.max(0,L-0.00001):Math.max(L+0.00000001,V-Math.min(...H.map((j)=>j.total))+0.000000001);o[O]={objective:0},a(new Map([[O,1]]),{max:V});for(let j of H){let Y=new Map(j.terms);Y.set(O,1),a(Y,{max:V-j.total,min:V-U-j.total})}}for(let N of["x","y"]){let D=Math.min(...g.flat().map((H)=>H[N])),L=Math.max(...g.flat().map((H)=>H[N]));for(let H of[-1,1]){let V=`bound_${N}_${H}`,O=d?1/Math.max(L-D,1):1,U=V+"_out";if(o[V]={objective:-O},d)o[U]={objective:O},a(new Map([[U,1]]),{max:_});a(new Map([[V,1]]),{max:L-D});let j=new Map;for(let Y of g.flat()){let X=String(Y.group),K=H===1?L-Y[N]:Y[N]-D;j.set(X,Math.min(j.get(X)??1/0,K))}for(let[Y,X]of j){let K=new Map([[V,1]]);if(d)K.set(U,-1);c(K,{x:0,y:0,group:Y==="undefined"?void 0:Number(Y)},N==="x"?{x:H,y:0}:{x:0,y:H}),a(K,{max:X})}}}let y=sa(e),x=e.minTraceToPadEdgeClearance??e.defaultObstacleMargin??0.075,C=g.flatMap((N,D)=>N.slice(1).map((L,H)=>({a:N[H],b:L,radius:t[D].route[H].width/2,layer:t[D].route[H].layer,owners:[t[D].connection_name,t[D].source_trace_id??""]}))),b=(N,D,L)=>{let H=L.x-D.x,V=L.y-D.y,O=Math.max(0,Math.min(1,((N.x-D.x)*H+(N.y-D.y)*V)/(H*H+V*V||1)));return{x:D.x+O*H,y:D.y+O*V}},I=new BYr(_),v=[],P=()=>{for(let N of v){delete r[N];for(let D of Object.values(o))delete D[N]}v.length=0;for(let N of I.active()){let D=new Map;c(D,N.a,N.n),c(D,N.b,N.n,-1);let L=`c${i}`;if(a(D,{min:N.min}),r[L])v.push(L)}},M=new Set,B=Object.keys(o).length,T=t;for(let N=0;N<p;N++){if(d)P();if((Object.values(r).reduce((ne,re)=>ne+(re.equal!==void 0||re.min!==void 0&&re.max!==void 0?2:1),0)+1)*(B+1)>m)return T;yield;let L=MYr({direction:"minimize",objective:"objective",variables:o,constraints:r},{precision:l?0.0000001:0.0000000001,maxPivots:4096,checkCycles:d});if(L.status!=="optimal")return T;let H=new Map(L.variables),V=l?YAn(g,H,!1):void 0;if(V&&[...V.values()].some((ne)=>!Number.isFinite(ne.x)||!Number.isFinite(ne.y)||Math.abs(ne.x)>_+0.000001||Math.abs(ne.y)>_+0.000001))return T;let O=(ne)=>({...ne,x:ne.x+(ne.group===void 0?0:V?V.get(ne.group).x:(H.get(`${ne.group}_x_1`)??0)-(H.get(`${ne.group}_x_-1`)??0)),y:ne.y+(ne.group===void 0?0:V?V.get(ne.group).y:(H.get(`${ne.group}_y_1`)??0)-(H.get(`${ne.group}_y_-1`)??0))}),U=l?YAn(g,H):void 0,j=(ne)=>U&&ne.group!==void 0?{x:ne.x+U.get(ne.group).x,y:ne.y+U.get(ne.group).y}:O(ne);if(d)T=t.map((ne,re)=>({...ne,route:ne.route.map((Z,te)=>({...Z,x:j(g[re][te]).x,y:j(g[re][te]).y}))}));let Y=C.map((ne)=>({...ne,a:O(ne.a),b:O(ne.b)})),X=new Due([...y,...Y]),K=new Map(Y.map((ne,re)=>[ne,C[re]])),J=new Map([...y,...Y].map((ne,re)=>[ne,re])),ee=0,se=new Map;for(let ne=0;ne<Y.length;ne++){let re=Y[ne],Z=C[ne],te=[],ie=re.radius+x;X.some({minX:Math.min(re.a.x,re.b.x)-ie,maxX:Math.max(re.a.x,re.b.x)+ie,minY:Math.min(re.a.y,re.b.y)-ie,maxY:Math.max(re.a.y,re.b.y)+ie},(ce)=>(te.push(ce),!1));for(let ce of te){if(re.layer!==ce.layer)continue;let ue=K.get(ce),de=ce.owners.some((Ne)=>Ne&&re.owners.includes(Ne));if(de&&!ue)continue;let me=ue??ce;if(de&&(Z.a===me.a||Z.a===me.b||Z.b===me.a||Z.b===me.b||Z.a.group===Z.b.group&&Z.a.group===me.a.group&&Z.a.group===me.b.group))continue;let ge=de?Math.min(re.radius+x+me.radius,mB([Z.a,Z.b],[me.a,me.b])):re.radius+x+(me.rect?0:me.radius);if(Nue(re.a,re.b,ce)>=ge-(me.rect?0:me.radius)-0.000000001)continue;let xe=`${ne}:${J.get(ce)}`,Ee=`${Z.a.group}:${Z.b.group}:${me.a.group}:${me.b.group}:${K.has(ce)?"moving":"f"+J.get(ce)}`;if(M.has(xe)||!d&&(se.get(Ee)??0)>=4)continue;se.set(Ee,(se.get(Ee)??0)+1),M.add(xe);let Re=me.rect?[{x:me.rect.minX,y:me.rect.minY},{x:me.rect.maxX,y:me.rect.minY},{x:me.rect.maxX,y:me.rect.maxY},{x:me.rect.minX,y:me.rect.maxY}]:[me.a,me.b],Me=[{x:1,y:0},{x:0,y:1}];for(let Ne of[Z.a,Z.b])for(let Le=0;Le<Re.length;Le++){let nt=b(Ne,Re[Le],Re[(Le+1)%Re.length]);Me.push({x:Ne.x-nt.x,y:Ne.y-nt.y})}for(let Ne of Re){let Le=b(Ne,Z.a,Z.b);Me.push({x:Le.x-Ne.x,y:Le.y-Ne.y})}let _e,ye=-1/0;for(let Ne of Me){let Le=Math.hypot(Ne.x,Ne.y);if(Le<0.0000000001)continue;for(let nt of[-1,1]){let dt={x:Ne.x/Le*nt,y:Ne.y/Le*nt},rt=Math.min(...[Z.a,Z.b].map((pt)=>pt.x*dt.x+pt.y*dt.y))-Math.max(...Re.map((pt)=>pt.x*dt.x+pt.y*dt.y));if(rt>ye)ye=rt,_e=dt}}if(!_e||ye<0)return t;let Se=Math.min(ye,ge+0.000001);for(let Ne of[Z.a,Z.b])for(let Le of Re){if(d){I.add({a:Ne,b:Le,n:_e,min:Se-((Ne.x-Le.x)*_e.x+(Ne.y-Le.y)*_e.y)});continue}let nt=new Map;c(nt,Ne,_e),c(nt,Le,_e,-1),a(nt,{min:Se-((Ne.x-Le.x)*_e.x+(Ne.y-Le.y)*_e.y)})}ee++}}if(!ee||N===p-1)return t.map((ne,re)=>({...ne,route:ne.route.map((Z,te)=>({...Z,x:j(g[re][te]).x,y:j(g[re][te]).y}))}))}return t}function GAn(e,t){let n=t.map((s)=>{let a={start:0,end:0,length:0},c=0,l=0;for(let h=1;h<s.route.length;h++){let d=s.route[h-1],u=s.route[h];if(d.route_type!=="wire"||u.route_type!=="wire"||d.layer!==u.layer){c=h,l=0;continue}if(l+=Fn(d,u),l>a.length)a={start:c,end:h,length:l}}return a});if(n.some((s)=>s.end<=s.start))return null;let o=t.map((s,a)=>{let{start:c,end:l}=n[a];return{...s,route:s.route.slice(c,l+1),curvedSegments:s.curvedSegments?.filter((h)=>h>c&&h<=l).map((h)=>h-c),coupledSection:s.coupledSection?.map((h)=>h-c)}}),r=new Map(o.map((s)=>[s.connection_name,s]));if(e.connections.some((s)=>!r.has(s.name)))return null;return{input:{...e,connections:e.connections.map((s)=>{let a=r.get(s.name);return{...s,pointsToConnect:[a.route[0],a.route.at(-1)]}}),traces:[...e.traces??[],...t.flatMap((s,a)=>{let{start:c,end:l}=n[a];return[...c?[{...s,route:s.route.slice(0,c+1)}]:[],...l<s.route.length-1?[{...s,route:s.route.slice(l)}]:[]]})]},carriers:o,join:(s)=>t.map((a,c)=>({...a,route:[...a.route.slice(0,n[c].start),...s[c].route,...a.route.slice(n[c].end+1)]}))}}function V2(e){let t=1/0,n=-1/0,o=1/0,r=-1/0;for(let i of e)for(let s of i.route){let a=s.route_type==="wire"?s.width/2:(s.via_diameter??0.3)/2;t=Math.min(t,s.x-a),n=Math.max(n,s.x+a),o=Math.min(o,s.y-a),r=Math.max(r,s.y+a)}return{minX:t,maxX:n,minY:o,maxY:r,areaMm2:e.length?(n-t)*(r-o):0}}function TYr(e,t){let n=new Set([...e.buses?.flatMap((r)=>r.connectionNames)??[],...e.differentialPairs?.flatMap((r)=>r.connectionNames)??[]]),o=V2(t);return t.some((r)=>{if(!n.has(r.connection_name))return!1;let i=V2([r]);return["minX","minY","maxX","maxY"].some((s)=>Math.abs(i[s]-o[s])<0.00000001)})}function*DYr(e,t,n){let o=e.connections.map((s)=>new Set([s.name]));for(let s of[...e.buses??[],...e.differentialPairs??[]]){let a=o.filter((l)=>s.connectionNames.some((h)=>l.has(h))),c=new Set(a.flatMap((l)=>[...l]));for(let l of a)o.splice(o.indexOf(l),1);if(c.size)o.push(c)}o.sort((s,a)=>s.size-a.size);let r=t,i=e.minTraceToPadEdgeClearance??e.defaultObstacleMargin??0.075;for(let s=0;s<4;s++){let a=V2(r).areaMm2,c=!1;for(let l of o){let h=r.filter((p)=>l.has(p.connection_name)),d={...e,connections:e.connections.filter((p)=>l.has(p.name)),buses:e.buses?.filter((p)=>l.has(p.connectionNames[0])),differentialPairs:e.differentialPairs?.filter((p)=>l.has(p.connectionNames[0])),traces:[...e.traces??[],...r.filter((p)=>!l.has(p.connection_name))]},u=h.map((p)=>Tue(d,p)),_=!1;for(let p of["cohort","guarded-cohort"]){let m=yield*q3n(d,h,p);if(m===h)break;let A=!1;for(let g of[1,0.999,0.99,0.95,0.9,0.75,0.5,0.25,0.1]){let f=m.map((C,b)=>({...C,route:C.route.map((I,v)=>({...I,x:h[b].route[v].x+(I.x-h[b].route[v].x)*g,y:h[b].route[v].y+(I.y-h[b].route[v].y)*g}))})),y=V2(f).areaMm2;if(!Number.isFinite(y)||y>=V2(h).areaMm2-0.000001)continue;if(f.some((C,b)=>!u[b](C.route))){A=!0;continue}if(f.some((C)=>!Wc(C.route,C.route[0].width+i)))continue;let x=Nf.forValidation({...d,minTraceToPadEdgeClearance:i+0.0000000095},f,n);try{while(!x.solved&&!x.failed)x.step(),yield;if(!x.solved)continue;let C=new Map(f.map((I)=>[I.connection_name,I])),b=r.map((I)=>C.get(I.connection_name)??I);if(MS(e,b).some((I)=>!I.matched))continue;r=b,_=c=!0,yield r;break}finally{if(!x.solved&&!x.failed)x.tryFinalAcceptance()}}if(_||!A)break}}if(!c||a-V2(r).areaMm2<a*0.001)break}}var UAn=(e,t)=>e.x*t.y-e.y*t.x,Jw=(e,t)=>({x:t.x-e.x,y:t.y-e.y}),jtt=(e,t)=>e.x*t.x+e.y*t.y;function WAn(e,t,n,o){let r=UAn(t,o);if(Math.abs(r)<0.00000001)return null;let i=UAn(Jw(e,n),o)/r;return{x:e.x+i*t.x,y:e.y+i*t.y}}function NYr(e,t){if(!t.length)return t;let n=new Set([...e.buses?.flatMap((d)=>d.connectionNames)??[],...e.differentialPairs?.flatMap((d)=>d.connectionNames)??[]]),o=structuredClone(t),r=o.filter((d)=>!n.has(d.connection_name)&&!d.coupledSection&&!d.curvedSegments?.length&&d.route.every((u)=>u.route_type==="wire"&&u.layer===d.route[0].layer));if(!r.length)return t;let i=o.flatMap((d)=>[d.route[0],d.route.at(-1)]),s=o.reduce((d,u)=>({x:d.x+Math.abs(u.route[0].x-u.route.at(-1).x),y:d.y+Math.abs(u.route[0].y-u.route.at(-1).y)}),{x:0,y:0}),a=s.x>s.y?"y":"x",c=i.reduce((d,u)=>d+u[a],0)/i.length,l=(d)=>d.slice(1).reduce((u,_,p)=>u+Fn(d[p],_)*(Math.abs(d[p][a]-c)+Math.abs(_[a]-c))/2,0),h=sa(e);for(let d=0;d<8;d++){let u=!1;r.sort((_,p)=>l(_.route)-l(p.route));for(let _ of r){let p=e.connections.find((x)=>x.name===_.connection_name);if(!p)continue;let m=_.route[0].width,A=new Mi(e,p,m,[...h,...o.flatMap(Jr)]),g=_.route,f=l(g),y=Ar(g);for(let x=1;x<g.length-2;x++){let C=g[x-1],b=g[x],I=g[x+1],v=g[x+2],P=Jw(b,I),M=Fn(b,I);if(M<m*2)continue;let B={x:-P.y/M,y:P.x/M},T=g;for(let N of[20,10,5,2.5,1,0.5,-20,-10,-5,-2.5,-1,-0.5]){let D={x:b.x+N*m*B.x,y:b.y+N*m*B.y},L=WAn(C,Jw(C,b),D,P),H=WAn(v,Jw(v,I),D,P);if(!L||!H||jtt(Jw(C,L),Jw(C,b))<=0.00000001||jtt(Jw(v,H),Jw(v,I))<=0.00000001||jtt(Jw(L,H),P)<=0.00000001)continue;if(["x","y"].some((j)=>{let Y=Math.min(...g.map((K)=>K[j])),X=Math.max(...g.map((K)=>K[j]));return[L,H].some((K)=>K[j]<Y-0.00000001||K[j]>X+0.00000001)}))continue;let V=[...g.slice(0,x),{...b,...L},{...I,...H},...g.slice(x+2)],O=l(V),U=Ar(V);if(O>=f-0.000001||U>y+0.00000001||!A.pathVisible([C,L,H,v])||!Wc(V,m/2+A.margin))continue;T=V,f=O,y=U}if(T!==g)g=T,u=!0}_.route=g}if(!u)break}return o}var _k=0.000000001;function ist(e){return e.shape==="circle"}function m8e(e,t){let n=-(t.ccwRotationDegrees??0)*Math.PI/180,o=e.x-t.center.x,r=e.y-t.center.y;return{x:o*Math.cos(n)-r*Math.sin(n),y:o*Math.sin(n)+r*Math.cos(n)}}function Bb(e,t){return Math.hypot(e.x-t.x,e.y-t.y)}function E9(e,t,n){let o=n.x-t.x,r=n.y-t.y,i=o*o+r*r,s=i<_k?0:((e.x-t.x)*o+(e.y-t.y)*r)/i,a=Math.max(0,Math.min(1,s));return Math.hypot(e.x-(t.x+a*o),e.y-(t.y+a*r))}function k9e(e,t,n){return(t.x-e.x)*(n.y-e.y)-(t.y-e.y)*(n.x-e.x)}function RYr(e,t,n,o){let r=k9e(n,o,e),i=k9e(n,o,t),s=k9e(e,t,n),a=k9e(e,t,o);return(r>0&&i<0||r<0&&i>0)&&(s>0&&a<0||s<0&&a>0)}function J3n(e,t,n,o){if(RYr(e,t,n,o))return 0;return Math.min(E9(e,n,o),E9(t,n,o),E9(n,e,t),E9(o,e,t))}function QYr(e,t,n=_k){if(ist(t))return Bb(e,t.center)<=t.width/2+n;let o=m8e(e,t);return Math.abs(o.x)<=t.width/2+n&&Math.abs(o.y)<=t.height/2+n}function Z3n(e,t){if(ist(t))return Math.max(0,Bb(e,t.center)-t.width/2);let n=m8e(e,t),o=Math.max(Math.abs(n.x)-t.width/2,0),r=Math.max(Math.abs(n.y)-t.height/2,0);return Math.hypot(o,r)}function kYr(e,t){if(ist(t))return Math.max(0,E9(t.center,e.start,e.end)-t.width/2);let n=m8e(e.start,t),o=m8e(e.end,t);if(Math.abs(n.x)<=t.width/2+_k&&Math.abs(n.y)<=t.height/2+_k)return 0;if(Math.abs(o.x)<=t.width/2+_k&&Math.abs(o.y)<=t.height/2+_k)return 0;let r=-t.width/2,i=t.width/2,s=-t.height/2,a=t.height/2,c=[{x:r,y:s},{x:i,y:s},{x:i,y:a},{x:r,y:a}],l=Number.POSITIVE_INFINITY;for(let h=0;h<c.length;h++)l=Math.min(l,J3n(n,o,c[h],c[(h+1)%c.length]));return l}function sst(e,t,n){if(e.layer!==t.layer)return!0;let o=(e.width+t.width)/2+n,r=o+_k;if(Math.min(e.start.x,e.end.x)-Math.max(t.start.x,t.end.x)>r||Math.min(t.start.x,t.end.x)-Math.max(e.start.x,e.end.x)>r||Math.min(e.start.y,e.end.y)-Math.max(t.start.y,t.end.y)>r||Math.min(t.start.y,t.end.y)-Math.max(e.start.y,e.end.y)>r)return!0;return J3n(e.start,e.end,t.start,t.end)>=o-_k}function Rue(e){if(!Number.isInteger(e)||e<1)throw Error(`FanoutSolver: layerCount must be a positive integer, received ${e}`);if(e===1)return["top"];if(e===2)return["top","bottom"];return["top",...Array.from({length:e-2},(t,n)=>`inner${n+1}`),"bottom"]}function LYr(e,t,n){let o=n.indexOf(e),r=n.indexOf(t);if(o<0||r<0)throw Error(`FanoutSolver: cannot build via span from "${e}" to "${t}"`);let i=Math.min(o,r),s=Math.max(o,r);return n.slice(i,s+1)}function HYr(e){let{fromLayer:t,toLayer:n,layerNames:o,allowBlindAndBuriedVias:r}=e,i=LYr(t,n,o);return r?i:[...o]}var FYr={topside_left:{direction:"left",preferredExit:"top-left",exitEdge:"top"},topside_center:{direction:"up",preferredExit:"top",exitEdge:"top"},topside_right:{direction:"right",preferredExit:"top-right",exitEdge:"top"},rightside_top:{direction:"up",preferredExit:"top-right",exitEdge:"right"},rightside_center:{direction:"right",preferredExit:"right",exitEdge:"right"},rightside_bottom:{direction:"down",preferredExit:"bottom-right",exitEdge:"right"},bottomside_right:{direction:"right",preferredExit:"bottom-right",exitEdge:"bottom"},bottomside_center:{direction:"down",preferredExit:"bottom",exitEdge:"bottom"},bottomside_left:{direction:"left",preferredExit:"bottom-left",exitEdge:"bottom"},leftside_bottom:{direction:"down",preferredExit:"bottom-left",exitEdge:"left"},leftside_center:{direction:"left",preferredExit:"left",exitEdge:"left"},leftside_top:{direction:"up",preferredExit:"top-left",exitEdge:"left"},center:{}};function zYr(e){let t=FYr[e];if(!t)throw Error(`Invalid fanout exit position "${e}"`);return t}function eCn(e,t){return e===t||e.includes(t)}function _8e(e,t){if(!e||!t?.includes("-"))return;if(!eCn(t,e))return;if(e==="left"||e==="right")return t.startsWith("top-")?"maximum":"minimum";return t.endsWith("-right")?"maximum":"minimum"}var Uu=0.000000001,OYr=1e5;function tCn(e){for(let[n,o]of[["viaDiameter",e.viaDiameter],["traceWidth",e.traceWidth]])if(!Number.isFinite(o)||o<=0)throw Error(`FanoutSolver: dogbone ${n} must be a positive finite number, received ${o}`);if(!Number.isFinite(e.clearance)||e.clearance<0)throw Error(`FanoutSolver: dogbone clearance must be a non-negative finite number, received ${e.clearance}`);if(e.viaHoleDiameter!==void 0&&(!Number.isFinite(e.viaHoleDiameter)||e.viaHoleDiameter<=0))throw Error(`FanoutSolver: dogbone viaHoleDiameter must be a positive finite number, received ${e.viaHoleDiameter}`);if(e.holeToHoleClearance!==void 0&&(!Number.isFinite(e.holeToHoleClearance)||e.holeToHoleClearance<0))throw Error(`FanoutSolver: dogbone holeToHoleClearance must be a non-negative finite number, received ${e.holeToHoleClearance}`);if(e.holeToHoleClearance!==void 0&&e.viaHoleDiameter===void 0)throw Error("FanoutSolver: dogbone holeToHoleClearance requires viaHoleDiameter");let t=e.maximumSearchStates??OYr;if(!Number.isInteger(t)||t<1)throw Error(`FanoutSolver: dogbone maximumSearchStates must be a positive integer, received ${t}`);return t}function $ot(e){let t=[];for(let n of e.toSorted((o,r)=>o-r)){if(!Number.isFinite(n))continue;if(t.length===0||Math.abs(t.at(-1)-n)>Uu)t.push(n)}return t}function nCn(e){let t=new Map,n=new Map,o=new Map;for(let r of e){let i=t.get(r.componentId);if(!i)i={componentId:r.componentId,connections:[],obstacles:[],xCoordinates:[],yCoordinates:[],pitchX:Number.POSITIVE_INFINITY,pitchY:Number.POSITIVE_INFINITY},t.set(r.componentId,i),o.set(r.componentId,new Set);if(i.xCoordinates.push(...r.xCoordinates),i.yCoordinates.push(...r.yCoordinates),Number.isFinite(r.pitchX)&&r.pitchX>Uu)i.pitchX=Math.min(i.pitchX,r.pitchX);if(Number.isFinite(r.pitchY)&&r.pitchY>Uu)i.pitchY=Math.min(i.pitchY,r.pitchY);let s=o.get(r.componentId);for(let a of r.componentObstacles)if(!s.has(a))s.add(a),i.obstacles.push(a);for(let a of r.connections){let c=n.get(a.connectionIndex);if(c!==void 0){if(c!==r.componentId)throw Error(`FanoutSolver: connection index ${a.connectionIndex} belongs to multiple components`);continue}n.set(a.connectionIndex,r.componentId),i.connections.push({preparedConnection:a,busId:r.busId,direction:r.direction,terminationType:r.termination.type})}}return[...t.values()].map((r)=>({...r,connections:r.connections.toSorted((i,s)=>i.preparedConnection.connectionIndex-s.preparedConnection.connectionIndex),xCoordinates:$ot(r.xCoordinates),yCoordinates:$ot(r.yCoordinates)})).toSorted((r,i)=>r.componentId.localeCompare(i.componentId))}function VYr(e){let{coordinates:t,pitch:n}=e;if(t.length===0||!Number.isFinite(n)||n<=Uu)return[];let o=[t[0]-n/2];for(let r=1;r<t.length;r++)o.push((t[r-1]+t[r])/2);return o.push(t.at(-1)+n/2),$ot(o)}function XAn(e){let{sourceCoordinate:t,coordinates:n,pitch:o}=e,r=VYr({coordinates:n,pitch:o}),i=r.filter((a)=>a<t-Uu).at(-1),s=r.find((a)=>a>t+Uu);return[i,s].filter((a)=>a!==void 0)}function YYr(e,t){let n=Math.abs(t.x-e.x),o=Math.abs(t.y-e.y);return n<=Uu||o<=Uu||Math.abs(n-o)<=Uu}function GYr(e){let{source:t,site:n,direction:o}=e,r=o==="right"?n.x-t.x:o==="left"?t.x-n.x:o==="up"?n.y-t.y:t.y-n.y;return r>Uu?0:Math.abs(r)<=Uu?1:2}function UYr(e){let{point:t,obstacles:n,viaDiameter:o,clearance:r}=e,i=o/2+r;return n.every((s)=>Z3n(t,s)>=i-Uu)}function WYr(e){let{segment:t,sourceObstacle:n,obstacles:o,clearance:r}=e,i=t.width/2+r;return o.every((s)=>s===n||kYr(t,s)>=i-Uu)}function oCn(e){let{connection:t,component:n,rules:o}=e,{preparedConnection:r,direction:i}=t,s=o.additionalObstacles?[...new Set([...n.obstacles,...o.additionalObstacles])]:n.obstacles,a={x:r.sourcePoint.x,y:r.sourcePoint.y},c=XAn({sourceCoordinate:a.x,coordinates:n.xCoordinates,pitch:n.pitchX}),l=XAn({sourceCoordinate:a.y,coordinates:n.yCoordinates,pitch:n.pitchY}),h=[...c.map((I)=>({x:I,y:a.y})),...l.map((I)=>({x:a.x,y:I})),...c.flatMap((I)=>l.map((v)=>({x:I,y:v})))],d=[];for(let I of h)if(!d.some((v)=>Bb(v,I)<=Uu))d.push(I);let u=o.fixedViaPointsByConnectionIndex?.get(r.connectionIndex),_=u?[u]:d,p=[];for(let I of _){if(t.terminationType==="plane"&&!YYr(a,I))continue;if(!UYr({point:I,obstacles:s,viaDiameter:o.viaDiameter,clearance:o.clearance}))continue;let v={start:a,end:I,width:o.traceWidth,layer:r.sourceLayer};if(!WYr({segment:v,sourceObstacle:r.sourceObstacle,obstacles:s,clearance:o.clearance}))continue;if(!(o.blockingSegments??[]).every((B)=>{if(B.connectionIndex===r.connectionIndex)return!0;if(o.canShareCopper?.(r.connectionIndex,B.connectionIndex))return!0;let T=o.viaDiameter/2+B.segment.width/2+o.clearance;if(E9(I,B.segment.start,B.segment.end)<T-Uu)return!1;return B.segment.layer!==v.layer||sst(v,B.segment,o.clearance)}))continue;if(!(o.blockingVias??[]).every((B)=>{if(B.connectionIndex===r.connectionIndex)return!0;if(Bb(I,B.center)<(o.viaDiameter+B.diameter)/2+o.clearance-Uu)return!1;if(B.spanLayers.includes(v.layer)&&E9(B.center,v.start,v.end)<B.diameter/2+v.width/2+o.clearance-Uu)return!1;return!0}))continue;p.push({connectionIndex:r.connectionIndex,point:I,sourceSegment:v,outwardRank:GYr({source:a,site:I,direction:i})})}let m=i==="left"||i==="right"?n.yCoordinates:n.xCoordinates,A=i==="left"||i==="right"?a.y:a.x,g=m.findIndex((I)=>Math.abs(I-A)<=Uu),f=g>=0?g%2===0?1:-1:void 0,y=t.terminationType==="boundary"?o.preferredBoundaryPerpendicularSideByBusId?.get(t.busId):o.preferPlaneCheckerboardSites&&t.terminationType==="plane"&&(i==="left"||i==="right")?f:void 0,x=t.terminationType==="boundary"?o.preferBoundaryOutwardByBusId?.get(t.busId)??!0:!0,C=o.preferredViaPointsByConnectionIndex?.get(r.connectionIndex),b=(I)=>{if(y===void 0)return 0;let v=i==="left"||i==="right"?I.point.y-a.y:I.point.x-a.x;return v*y>Uu?0:Math.abs(v)<=Uu?1:2};return p.toSorted((I,v)=>(C?Number(Bb(I.point,C)>Uu)-Number(Bb(v.point,C)>Uu):0)||(x?I.outwardRank-v.outwardRank:v.outwardRank-I.outwardRank)||b(I)-b(v)||Bb(a,I.point)-Bb(a,v.point)||I.point.x-v.point.x||I.point.y-v.point.y)}function XYr(e){let{first:t,second:n,rules:o}=e,r=o.canShareCopper?.(t.connectionIndex,n.connectionIndex)??!1,i=o.viaHoleDiameter?o.viaHoleDiameter+(o.holeToHoleClearance??o.clearance):0,s=r?i:Math.max(o.viaDiameter+o.clearance,i);if(Bb(t.point,n.point)<s-Uu)return!1;let a=o.viaDiameter/2+o.traceWidth/2+o.clearance;if(!r){if(E9(t.point,n.sourceSegment.start,n.sourceSegment.end)<a-Uu||E9(n.point,t.sourceSegment.start,t.sourceSegment.end)<a-Uu)return!1}if(r)return!0;return sst(t.sourceSegment,n.sourceSegment,o.clearance)}function jYr(e){let{component:t,rules:n,consumeSearchState:o}=e,r=t.connections.map((_)=>({connection:_,candidates:oCn({connection:_,component:t,rules:n})}));if(r.some((_)=>_.candidates.length===0))return null;let i=new Map,s=(_,p)=>{let m=i.get(_)?.get(p);if(m!==void 0)return m;let A=XYr({first:_,second:p,rules:n}),g=i.get(_)??new Map;g.set(p,A),i.set(_,g);let f=i.get(p)??new Map;return f.set(_,A),i.set(p,f),A},a=r.flatMap((_)=>_.candidates.length===1?[_.candidates[0]]:[]);for(let _=0;_<a.length;_++){let p=a[_];for(let m=0;m<_;m++)if(!s(p,a[m]))return null}let c=new Map(a.map((_)=>[_.connectionIndex,_])),l=new Set(r.flatMap((_)=>_.candidates.length>1?[_.connection.preparedConnection.connectionIndex]:[])),h=new Map(r.map((_)=>[_.connection.preparedConnection.connectionIndex,_]));if(l.size===0)return new Map([...c.entries()].map(([_,p])=>[_,{...p.point}]));let d=(_)=>_.candidates.filter((p)=>[...c.values()].every((m)=>s(p,m))),u=()=>{if(!o())return!1;if(l.size===0)return!0;let _,p=[];for(let A of[...l].toSorted((g,f)=>g-f)){let g=h.get(A),f=d(g);if(f.length===0)return!1;if(!_||f.length<p.length||f.length===p.length&&A<_.connection.preparedConnection.connectionIndex)_=g,p=f}let m=_.connection.preparedConnection.connectionIndex;l.delete(m);for(let A of p){if(c.set(m,A),u())return!0;c.delete(m)}return l.add(m),!1};if(!u())return null;return new Map([...c.entries()].toSorted(([_],[p])=>_-p).map(([_,p])=>[_,{...p.point}]))}function KYr(e,t){let n=tCn(t);if(e.length===0)return new Map;let o=0,r=()=>(o++,o<=n),i=new Map;for(let s of nCn(e)){let a=jYr({component:s,rules:t,consumeSearchState:r});if(!a)return null;for(let[c,l]of a)i.set(c,l)}return i}function $Yr(e,t){return tCn(t),nCn(e).flatMap((n)=>n.connections.flatMap((o)=>oCn({connection:o,component:n,rules:t}).map((r)=>({connectionIndex:r.connectionIndex,point:{...r.point}}))))}var SXs=IZ(tst(),1),PXs=IZ(tst(),1),EXs=IZ(tst(),1),{create:qYr,defineProperty:qot,getOwnPropertyDescriptor:JYr,getOwnPropertyNames:rCn,getPrototypeOf:ZYr}=Object,eGr=Object.prototype.hasOwnProperty,vm=(e,t)=>function(){return t||(0,e[rCn(e)[0]])((t={exports:{}}).exports,t),t.exports},iCn=(e,t)=>{for(var n in t)qot(e,n,{get:t[n],enumerable:!0})},Jot=(e,t,n)=>(n=e!=null?qYr(ZYr(e)):{},((o,r,i,s)=>{if(r&&typeof r=="object"||typeof r=="function")for(let a of rCn(r))eGr.call(o,a)||a===i||qot(o,a,{get:()=>r[a],enumerable:!(s=JYr(r,a))||s.enumerable});return o})(!t&&e&&e.__esModule?n:qot(n,"default",{value:e,enumerable:!0}),e)),tGr=vm({"node_modules/is-buffer/index.js"(e,t){function n(o){return!!o.constructor&&typeof o.constructor.isBuffer=="function"&&o.constructor.isBuffer(o)}t.exports=function(o){return o!=null&&(n(o)||function(r){return typeof r.readFloatLE=="function"&&typeof r.slice=="function"&&n(r.slice(0,0))}(o)||!!o._isBuffer)}}}),nGr=vm({"node_modules/kind-of/index.js"(e,t){var n=tGr(),o=Object.prototype.toString;t.exports=function(r){if(r===void 0)return"undefined";if(r===null)return"null";if(r===!0||r===!1||r instanceof Boolean)return"boolean";if(typeof r=="string"||r instanceof String)return"string";if(typeof r=="number"||r instanceof Number)return"number";if(typeof r=="function"||r instanceof Function)return"function";if(Array.isArray!==void 0&&Array.isArray(r))return"array";if(r instanceof RegExp)return"regexp";if(r instanceof Date)return"date";var i=o.call(r);return i==="[object RegExp]"?"regexp":i==="[object Date]"?"date":i==="[object Arguments]"?"arguments":i==="[object Error]"?"error":n(r)?"buffer":i==="[object Set]"?"set":i==="[object WeakSet]"?"weakset":i==="[object Map]"?"map":i==="[object WeakMap]"?"weakmap":i==="[object Symbol]"?"symbol":i==="[object Int8Array]"?"int8array":i==="[object Uint8Array]"?"uint8array":i==="[object Uint8ClampedArray]"?"uint8clampedarray":i==="[object Int16Array]"?"int16array":i==="[object Uint16Array]"?"uint16array":i==="[object Int32Array]"?"int32array":i==="[object Uint32Array]"?"uint32array":i==="[object Float32Array]"?"float32array":i==="[object Float64Array]"?"float64array":"object"}}}),oGr=vm({"node_modules/rename-keys/index.js"(e,t){(function(){function n(o,r){if(typeof r!="function")return o;var i={};for(var s in o)Object.prototype.hasOwnProperty.call(o,s)&&(i[r(s,o[s])||s]=o[s]);return i}t!==void 0&&t.exports?t.exports=n:typeof define=="function"&&define.amd?define([],function(){return n}):window.rename=n})()}}),rGr=vm({"node_modules/deep-rename-keys/index.js"(e,t){var n=nGr(),o=oGr();t.exports=function r(i,s){var a=n(i);if(a!=="object"&&a!=="array")throw Error("expected an object");var c=[];for(var l in a==="object"&&(i=o(i,s),c={}),i)if(i.hasOwnProperty(l)){var h=i[l];n(h)==="object"||n(h)==="array"?c[l]=r(h,s):c[l]=h}return c}}}),iGr=vm({"node_modules/xml-reader/node_modules/eventemitter3/index.js"(e,t){var n=Object.prototype.hasOwnProperty,o="~";function r(){}function i(a,c,l){this.fn=a,this.context=c,this.once=l||!1}function s(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),new r().__proto__||(o=!1)),s.prototype.eventNames=function(){var a,c,l=[];if(this._eventsCount===0)return l;for(c in a=this._events)n.call(a,c)&&l.push(o?c.slice(1):c);return Object.getOwnPropertySymbols?l.concat(Object.getOwnPropertySymbols(a)):l},s.prototype.listeners=function(a,c){var l=o?o+a:a,h=this._events[l];if(c)return!!h;if(!h)return[];if(h.fn)return[h.fn];for(var d=0,u=h.length,_=Array(u);d<u;d++)_[d]=h[d].fn;return _},s.prototype.emit=function(a,c,l,h,d,u){var _=o?o+a:a;if(!this._events[_])return!1;var p,m,A=this._events[_],g=arguments.length;if(A.fn){switch(A.once&&this.removeListener(a,A.fn,void 0,!0),g){case 1:return A.fn.call(A.context),!0;case 2:return A.fn.call(A.context,c),!0;case 3:return A.fn.call(A.context,c,l),!0;case 4:return A.fn.call(A.context,c,l,h),!0;case 5:return A.fn.call(A.context,c,l,h,d),!0;case 6:return A.fn.call(A.context,c,l,h,d,u),!0}for(m=1,p=Array(g-1);m<g;m++)p[m-1]=arguments[m];A.fn.apply(A.context,p)}else{var f,y=A.length;for(m=0;m<y;m++)switch(A[m].once&&this.removeListener(a,A[m].fn,void 0,!0),g){case 1:A[m].fn.call(A[m].context);break;case 2:A[m].fn.call(A[m].context,c);break;case 3:A[m].fn.call(A[m].context,c,l);break;case 4:A[m].fn.call(A[m].context,c,l,h);break;default:if(!p)for(f=1,p=Array(g-1);f<g;f++)p[f-1]=arguments[f];A[m].fn.apply(A[m].context,p)}}return!0},s.prototype.on=function(a,c,l){var h=new i(c,l||this),d=o?o+a:a;return this._events[d]?this._events[d].fn?this._events[d]=[this._events[d],h]:this._events[d].push(h):(this._events[d]=h,this._eventsCount++),this},s.prototype.once=function(a,c,l){var h=new i(c,l||this,!0),d=o?o+a:a;return this._events[d]?this._events[d].fn?this._events[d]=[this._events[d],h]:this._events[d].push(h):(this._events[d]=h,this._eventsCount++),this},s.prototype.removeListener=function(a,c,l,h){var d=o?o+a:a;if(!this._events[d])return this;if(!c)return--this._eventsCount===0?this._events=new r:delete this._events[d],this;var u=this._events[d];if(u.fn)u.fn!==c||h&&!u.once||l&&u.context!==l||(--this._eventsCount===0?this._events=new r:delete this._events[d]);else{for(var _=0,p=[],m=u.length;_<m;_++)(u[_].fn!==c||h&&!u[_].once||l&&u[_].context!==l)&&p.push(u[_]);p.length?this._events[d]=p.length===1?p[0]:p:--this._eventsCount===0?this._events=new r:delete this._events[d]}return this},s.prototype.removeAllListeners=function(a){var c;return a?(c=o?o+a:a,this._events[c]&&(--this._eventsCount===0?this._events=new r:delete this._events[c])):(this._events=new r,this._eventsCount=0),this},s.prototype.off=s.prototype.removeListener,s.prototype.addListener=s.prototype.on,s.prototype.setMaxListeners=function(){return this},s.prefixed=o,s.EventEmitter=s,t!==void 0&&(t.exports=s)}});var sGr=vm({"node_modules/xml-lexer/node_modules/eventemitter3/index.js"(e,t){var n=Object.prototype.hasOwnProperty,o="~";function r(){}function i(a,c,l){this.fn=a,this.context=c,this.once=l||!1}function s(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),new r().__proto__||(o=!1)),s.prototype.eventNames=function(){var a,c,l=[];if(this._eventsCount===0)return l;for(c in a=this._events)n.call(a,c)&&l.push(o?c.slice(1):c);return Object.getOwnPropertySymbols?l.concat(Object.getOwnPropertySymbols(a)):l},s.prototype.listeners=function(a,c){var l=o?o+a:a,h=this._events[l];if(c)return!!h;if(!h)return[];if(h.fn)return[h.fn];for(var d=0,u=h.length,_=Array(u);d<u;d++)_[d]=h[d].fn;return _},s.prototype.emit=function(a,c,l,h,d,u){var _=o?o+a:a;if(!this._events[_])return!1;var p,m,A=this._events[_],g=arguments.length;if(A.fn){switch(A.once&&this.removeListener(a,A.fn,void 0,!0),g){case 1:return A.fn.call(A.context),!0;case 2:return A.fn.call(A.context,c),!0;case 3:return A.fn.call(A.context,c,l),!0;case 4:return A.fn.call(A.context,c,l,h),!0;case 5:return A.fn.call(A.context,c,l,h,d),!0;case 6:return A.fn.call(A.context,c,l,h,d,u),!0}for(m=1,p=Array(g-1);m<g;m++)p[m-1]=arguments[m];A.fn.apply(A.context,p)}else{var f,y=A.length;for(m=0;m<y;m++)switch(A[m].once&&this.removeListener(a,A[m].fn,void 0,!0),g){case 1:A[m].fn.call(A[m].context);break;case 2:A[m].fn.call(A[m].context,c);break;case 3:A[m].fn.call(A[m].context,c,l);break;case 4:A[m].fn.call(A[m].context,c,l,h);break;default:if(!p)for(f=1,p=Array(g-1);f<g;f++)p[f-1]=arguments[f];A[m].fn.apply(A[m].context,p)}}return!0},s.prototype.on=function(a,c,l){var h=new i(c,l||this),d=o?o+a:a;return this._events[d]?this._events[d].fn?this._events[d]=[this._events[d],h]:this._events[d].push(h):(this._events[d]=h,this._eventsCount++),this},s.prototype.once=function(a,c,l){var h=new i(c,l||this,!0),d=o?o+a:a;return this._events[d]?this._events[d].fn?this._events[d]=[this._events[d],h]:this._events[d].push(h):(this._events[d]=h,this._eventsCount++),this},s.prototype.removeListener=function(a,c,l,h){var d=o?o+a:a;if(!this._events[d])return this;if(!c)return--this._eventsCount===0?this._events=new r:delete this._events[d],this;var u=this._events[d];if(u.fn)u.fn!==c||h&&!u.once||l&&u.context!==l||(--this._eventsCount===0?this._events=new r:delete this._events[d]);else{for(var _=0,p=[],m=u.length;_<m;_++)(u[_].fn!==c||h&&!u[_].once||l&&u[_].context!==l)&&p.push(u[_]);p.length?this._events[d]=p.length===1?p[0]:p:--this._eventsCount===0?this._events=new r:delete this._events[d]}return this},s.prototype.removeAllListeners=function(a){var c;return a?(c=o?o+a:a,this._events[c]&&(--this._eventsCount===0?this._events=new r:delete this._events[c])):(this._events=new r,this._eventsCount=0),this},s.prototype.off=s.prototype.removeListener,s.prototype.addListener=s.prototype.on,s.prototype.setMaxListeners=function(){return this},s.prefixed=o,s.EventEmitter=s,t!==void 0&&(t.exports=s)}}),aGr=vm({"node_modules/xml-lexer/dist/lexer.js"(e,t){function n(l,h,d){return h in l?Object.defineProperty(l,h,{value:d,enumerable:!0,configurable:!0,writable:!0}):l[h]=d,l}var o=sGr(),r=function(){},i={data:"state-data",cdata:"state-cdata",tagBegin:"state-tag-begin",tagName:"state-tag-name",tagEnd:"state-tag-end",attributeNameStart:"state-attribute-name-start",attributeName:"state-attribute-name",attributeNameEnd:"state-attribute-name-end",attributeValueBegin:"state-attribute-value-begin",attributeValue:"state-attribute-value"},s={lt:"action-lt",gt:"action-gt",space:"action-space",equal:"action-equal",quote:"action-quote",slash:"action-slash",char:"action-char",error:"action-error"},a={text:"text",openTag:"open-tag",closeTag:"close-tag",attributeName:"attribute-name",attributeValue:"attribute-value"},c={" ":s.space,"\t":s.space,"\n":s.space,"\r":s.space,"<":s.lt,">":s.gt,'"':s.quote,"'":s.quote,"=":s.equal,"/":s.slash};t.exports={State:i,Action:s,Type:a,create:function(l){var h,d,u,_,p,m,A,g,f,y;l=Object.assign({debug:!1},l);var x=new o,C=i.data,b="",I="",v="",P="",M="",B="",T=function(D,L){if(I[0]!=="?"&&I[0]!=="!"){var H={type:D,value:L};l.debug&&console.log("emit:",H),x.emit("data",H)}};x.stateMachine=(n(y={},i.data,(n(h={},s.lt,function(){b.trim()&&T(a.text,b),I="",M=!1,C=i.tagBegin}),n(h,s.char,function(D){b+=D}),h)),n(y,i.cdata,n({},s.char,function(D){(b+=D).substr(-3)==="]]>"&&(T(a.text,b.slice(0,-3)),b="",C=i.data)})),n(y,i.tagBegin,(n(d={},s.space,r),n(d,s.char,function(D){I=D,C=i.tagName}),n(d,s.slash,function(){I="",M=!0}),d)),n(y,i.tagName,(n(u={},s.space,function(){M?C=i.tagEnd:(C=i.attributeNameStart,T(a.openTag,I))}),n(u,s.gt,function(){T(M?a.closeTag:a.openTag,I),b="",C=i.data}),n(u,s.slash,function(){C=i.tagEnd,T(a.openTag,I)}),n(u,s.char,function(D){(I+=D)==="![CDATA["&&(C=i.cdata,b="",I="")}),u)),n(y,i.tagEnd,(n(_={},s.gt,function(){T(a.closeTag,I),b="",C=i.data}),n(_,s.char,r),_)),n(y,i.attributeNameStart,(n(p={},s.char,function(D){v=D,C=i.attributeName}),n(p,s.gt,function(){b="",C=i.data}),n(p,s.space,r),n(p,s.slash,function(){M=!0,C=i.tagEnd}),p)),n(y,i.attributeName,(n(m={},s.space,function(){C=i.attributeNameEnd}),n(m,s.equal,function(){T(a.attributeName,v),C=i.attributeValueBegin}),n(m,s.gt,function(){P="",T(a.attributeName,v),T(a.attributeValue,P),b="",C=i.data}),n(m,s.slash,function(){M=!0,P="",T(a.attributeName,v),T(a.attributeValue,P),C=i.tagEnd}),n(m,s.char,function(D){v+=D}),m)),n(y,i.attributeNameEnd,(n(A={},s.space,r),n(A,s.equal,function(){T(a.attributeName,v),C=i.attributeValueBegin}),n(A,s.gt,function(){P="",T(a.attributeName,v),T(a.attributeValue,P),b="",C=i.data}),n(A,s.char,function(D){P="",T(a.attributeName,v),T(a.attributeValue,P),v=D,C=i.attributeName}),A)),n(y,i.attributeValueBegin,(n(g={},s.space,r),n(g,s.quote,function(D){B=D,P="",C=i.attributeValue}),n(g,s.gt,function(){T(a.attributeValue,P=""),b="",C=i.data}),n(g,s.char,function(D){B="",P=D,C=i.attributeValue}),g)),n(y,i.attributeValue,(n(f={},s.space,function(D){B?P+=D:(T(a.attributeValue,P),C=i.attributeNameStart)}),n(f,s.quote,function(D){B===D?(T(a.attributeValue,P),C=i.attributeNameStart):P+=D}),n(f,s.gt,function(D){B?P+=D:(T(a.attributeValue,P),b="",C=i.data)}),n(f,s.slash,function(D){B?P+=D:(T(a.attributeValue,P),M=!0,C=i.tagEnd)}),n(f,s.char,function(D){P+=D}),f)),y);var N=function(D){l.debug&&console.log(C,D);var L=x.stateMachine[C],H=L[function(V){return c[V]||s.char}(D)]||L[s.error]||L[s.char];H(D)};return x.write=function(D){for(var L=D.length,H=0;H<L;H++)N(D[H])},x}}}}),cGr=vm({"node_modules/xml-reader/dist/reader.js"(e,t){var n=iGr(),o=aGr(),r=o.Type,i={element:"element",text:"text"},s=function(c){return Object.assign({name:"",type:i.element,value:"",parent:null,attributes:{},children:[]},c)},a=function(c){c=Object.assign({stream:!1,parentNodes:!0,doneEvent:"done",tagPrefix:"tag:",emitTopLevelOnly:!1,debug:!1},c);var l=void 0,h=void 0,d=void 0,u=void 0,_=new n,p=function(m){switch(m.type){case r.openTag:if(d===null)(d=h).name=m.value;else{var A=s({name:m.value,parent:d});d.children.push(A),d=A}break;case r.closeTag:var g=d.parent;if(c.parentNodes||(d.parent=null),d.name!==m.value)break;c.stream&&g===h&&(h.children=[],d.parent=null),c.emitTopLevelOnly&&g!==h||(_.emit(c.tagPrefix+d.name,d),_.emit("tag",d.name,d)),d===h&&(l.removeAllListeners("data"),_.emit(c.doneEvent,d),h=null),d=g;break;case r.text:d&&d.children.push(s({type:i.text,value:m.value,parent:c.parentNodes?d:null}));break;case r.attributeName:u=m.value,d.attributes[u]="";break;case r.attributeValue:d.attributes[u]=m.value}};return _.reset=function(){(l=o.create({debug:c.debug})).on("data",p),h=s(),d=null,u="",_.parse=l.write},_.reset(),_};t.exports={parseSync:function(c,l){l=Object.assign({},l,{stream:!1,tagPrefix:":"});var h=a(l),d=void 0;return h.on("done",function(u){d=u}),h.parse(c),d},create:a,NodeType:i}}}),v7e=vm({"node_modules/binary-search-bounds/search-bounds.js"(e,t){function n(c,l,h,d,u){for(var _=u+1;d<=u;){var p=d+u>>>1,m=c[p];(h!==void 0?h(m,l):m-l)>=0?(_=p,u=p-1):d=p+1}return _}function o(c,l,h,d,u){for(var _=u+1;d<=u;){var p=d+u>>>1,m=c[p];(h!==void 0?h(m,l):m-l)>0?(_=p,u=p-1):d=p+1}return _}function r(c,l,h,d,u){for(var _=d-1;d<=u;){var p=d+u>>>1,m=c[p];(h!==void 0?h(m,l):m-l)<0?(_=p,d=p+1):u=p-1}return _}function i(c,l,h,d,u){for(var _=d-1;d<=u;){var p=d+u>>>1,m=c[p];(h!==void 0?h(m,l):m-l)<=0?(_=p,d=p+1):u=p-1}return _}function s(c,l,h,d,u){for(;d<=u;){var _=d+u>>>1,p=c[_],m=h!==void 0?h(p,l):p-l;if(m===0)return _;m<=0?d=_+1:u=_-1}return-1}function a(c,l,h,d,u,_){return typeof h=="function"?_(c,l,h,d===void 0?0:0|d,u===void 0?c.length-1:0|u):_(c,l,void 0,h===void 0?0:0|h,d===void 0?c.length-1:0|d)}t.exports={ge:function(c,l,h,d,u){return a(c,l,h,d,u,n)},gt:function(c,l,h,d,u){return a(c,l,h,d,u,o)},lt:function(c,l,h,d,u){return a(c,l,h,d,u,r)},le:function(c,l,h,d,u){return a(c,l,h,d,u,i)},eq:function(c,l,h,d,u){return a(c,l,h,d,u,s)}}}}),ast=vm({"node_modules/two-product/two-product.js"(e,t){t.exports=function(o,r,i){var s=o*r,a=n*o,c=a-(a-o),l=o-c,h=n*r,d=h-(h-r),u=r-d,_=l*u-(s-c*d-l*d-c*u);if(i)return i[0]=_,i[1]=s,i;return[_,s]};var n=+(Math.pow(2,27)+1)}}),sCn=vm({"node_modules/robust-sum/robust-sum.js"(e,t){t.exports=function(n,o){var r=0|n.length,i=0|o.length;if(r===1&&i===1)return function(v,P){var M=v+P,B=M-v,T=M-B,N=P-B,D=v-T,L=D+N;if(L)return[L,M];return[M]}(n[0],o[0]);var s,a,c=Array(r+i),l=0,h=0,d=0,u=Math.abs,_=n[h],p=u(_),m=o[d],A=u(m);p<A?(a=_,(h+=1)<r&&(p=u(_=n[h]))):(a=m,(d+=1)<i&&(A=u(m=o[d]))),h<r&&p<A||d>=i?(s=_,(h+=1)<r&&(p=u(_=n[h]))):(s=m,(d+=1)<i&&(A=u(m=o[d])));var g,f,y=s+a,x=y-s,C=a-x,b=C,I=y;for(;h<r&&d<i;)p<A?(s=_,(h+=1)<r&&(p=u(_=n[h]))):(s=m,(d+=1)<i&&(A=u(m=o[d]))),(C=(a=b)-(x=(y=s+a)-s))&&(c[l++]=C),b=I-((g=I+y)-(f=g-I))+(y-f),I=g;for(;h<r;)(C=(a=b)-(x=(y=(s=_)+a)-s))&&(c[l++]=C),b=I-((g=I+y)-(f=g-I))+(y-f),I=g,(h+=1)<r&&(_=n[h]);for(;d<i;)(C=(a=b)-(x=(y=(s=m)+a)-s))&&(c[l++]=C),b=I-((g=I+y)-(f=g-I))+(y-f),I=g,(d+=1)<i&&(m=o[d]);return b&&(c[l++]=b),I&&(c[l++]=I),l||(c[l++]=0),c.length=l,c}}}),lGr=vm({"node_modules/two-sum/two-sum.js"(e,t){t.exports=function(n,o,r){var i=n+o,s=i-n,a=o-s,c=n-(i-s);if(r)return r[0]=c+a,r[1]=i,r;return[c+a,i]}}}),aCn=vm({"node_modules/robust-scale/robust-scale.js"(e,t){var n=ast(),o=lGr();t.exports=function(r,i){var s=r.length;if(s===1){var a=n(r[0],i);return a[0]?a:[a[1]]}var c=Array(2*s),l=[0.1,0.1],h=[0.1,0.1],d=0;n(r[0],i,l),l[0]&&(c[d++]=l[0]);for(var u=1;u<s;++u){n(r[u],i,h);var _=l[1];o(_,h[0],l),l[0]&&(c[d++]=l[0]);var p=h[1],m=l[1],A=p+m,g=m-(A-p);l[1]=A,g&&(c[d++]=g)}return l[1]&&(c[d++]=l[1]),d===0&&(c[d++]=0),c.length=d,c}}}),cCn=vm({"node_modules/robust-subtract/robust-diff.js"(e,t){t.exports=function(n,o){var r=0|n.length,i=0|o.length;if(r===1&&i===1)return function(v,P){var M=v+P,B=M-v,T=M-B,N=P-B,D=v-T,L=D+N;if(L)return[L,M];return[M]}(n[0],-o[0]);var s,a,c=Array(r+i),l=0,h=0,d=0,u=Math.abs,_=n[h],p=u(_),m=-o[d],A=u(m);p<A?(a=_,(h+=1)<r&&(p=u(_=n[h]))):(a=m,(d+=1)<i&&(A=u(m=-o[d]))),h<r&&p<A||d>=i?(s=_,(h+=1)<r&&(p=u(_=n[h]))):(s=m,(d+=1)<i&&(A=u(m=-o[d])));var g,f,y=s+a,x=y-s,C=a-x,b=C,I=y;for(;h<r&&d<i;)p<A?(s=_,(h+=1)<r&&(p=u(_=n[h]))):(s=m,(d+=1)<i&&(A=u(m=-o[d]))),(C=(a=b)-(x=(y=s+a)-s))&&(c[l++]=C),b=I-((g=I+y)-(f=g-I))+(y-f),I=g;for(;h<r;)(C=(a=b)-(x=(y=(s=_)+a)-s))&&(c[l++]=C),b=I-((g=I+y)-(f=g-I))+(y-f),I=g,(h+=1)<r&&(_=n[h]);for(;d<i;)(C=(a=b)-(x=(y=(s=m)+a)-s))&&(c[l++]=C),b=I-((g=I+y)-(f=g-I))+(y-f),I=g,(d+=1)<i&&(m=-o[d]);return b&&(c[l++]=b),I&&(c[l++]=I),l||(c[l++]=0),c.length=l,c}}}),hGr=vm({"node_modules/robust-orientation/orientation.js"(e,t){var n=ast(),o=sCn(),r=aCn(),i=cCn();function s(m,A,g,f){return function(y,x,C){var b=m(m(A(x[1],C[0]),A(-C[1],x[0])),m(A(y[1],x[0]),A(-x[1],y[0]))),I=m(A(y[1],C[0]),A(-C[1],y[0])),v=f(b,I);return v[v.length-1]}}function a(m,A,g,f){return function(y,x,C,b){var I=m(m(g(m(A(C[1],b[0]),A(-b[1],C[0])),x[2]),m(g(m(A(x[1],b[0]),A(-b[1],x[0])),-C[2]),g(m(A(x[1],C[0]),A(-C[1],x[0])),b[2]))),m(g(m(A(x[1],b[0]),A(-b[1],x[0])),y[2]),m(g(m(A(y[1],b[0]),A(-b[1],y[0])),-x[2]),g(m(A(y[1],x[0]),A(-x[1],y[0])),b[2])))),v=m(m(g(m(A(C[1],b[0]),A(-b[1],C[0])),y[2]),m(g(m(A(y[1],b[0]),A(-b[1],y[0])),-C[2]),g(m(A(y[1],C[0]),A(-C[1],y[0])),b[2]))),m(g(m(A(x[1],C[0]),A(-C[1],x[0])),y[2]),m(g(m(A(y[1],C[0]),A(-C[1],y[0])),-x[2]),g(m(A(y[1],x[0]),A(-x[1],y[0])),C[2])))),P=f(I,v);return P[P.length-1]}}function c(m,A,g,f){return function(y,x,C,b,I){var v=m(m(m(g(m(g(m(A(b[1],I[0]),A(-I[1],b[0])),C[2]),m(g(m(A(C[1],I[0]),A(-I[1],C[0])),-b[2]),g(m(A(C[1],b[0]),A(-b[1],C[0])),I[2]))),x[3]),m(g(m(g(m(A(b[1],I[0]),A(-I[1],b[0])),x[2]),m(g(m(A(x[1],I[0]),A(-I[1],x[0])),-b[2]),g(m(A(x[1],b[0]),A(-b[1],x[0])),I[2]))),-C[3]),g(m(g(m(A(C[1],I[0]),A(-I[1],C[0])),x[2]),m(g(m(A(x[1],I[0]),A(-I[1],x[0])),-C[2]),g(m(A(x[1],C[0]),A(-C[1],x[0])),I[2]))),b[3]))),m(g(m(g(m(A(C[1],b[0]),A(-b[1],C[0])),x[2]),m(g(m(A(x[1],b[0]),A(-b[1],x[0])),-C[2]),g(m(A(x[1],C[0]),A(-C[1],x[0])),b[2]))),-I[3]),m(g(m(g(m(A(b[1],I[0]),A(-I[1],b[0])),x[2]),m(g(m(A(x[1],I[0]),A(-I[1],x[0])),-b[2]),g(m(A(x[1],b[0]),A(-b[1],x[0])),I[2]))),y[3]),g(m(g(m(A(b[1],I[0]),A(-I[1],b[0])),y[2]),m(g(m(A(y[1],I[0]),A(-I[1],y[0])),-b[2]),g(m(A(y[1],b[0]),A(-b[1],y[0])),I[2]))),-x[3])))),m(m(g(m(g(m(A(x[1],I[0]),A(-I[1],x[0])),y[2]),m(g(m(A(y[1],I[0]),A(-I[1],y[0])),-x[2]),g(m(A(y[1],x[0]),A(-x[1],y[0])),I[2]))),b[3]),m(g(m(g(m(A(x[1],b[0]),A(-b[1],x[0])),y[2]),m(g(m(A(y[1],b[0]),A(-b[1],y[0])),-x[2]),g(m(A(y[1],x[0]),A(-x[1],y[0])),b[2]))),-I[3]),g(m(g(m(A(C[1],b[0]),A(-b[1],C[0])),x[2]),m(g(m(A(x[1],b[0]),A(-b[1],x[0])),-C[2]),g(m(A(x[1],C[0]),A(-C[1],x[0])),b[2]))),y[3]))),m(g(m(g(m(A(C[1],b[0]),A(-b[1],C[0])),y[2]),m(g(m(A(y[1],b[0]),A(-b[1],y[0])),-C[2]),g(m(A(y[1],C[0]),A(-C[1],y[0])),b[2]))),-x[3]),m(g(m(g(m(A(x[1],b[0]),A(-b[1],x[0])),y[2]),m(g(m(A(y[1],b[0]),A(-b[1],y[0])),-x[2]),g(m(A(y[1],x[0]),A(-x[1],y[0])),b[2]))),C[3]),g(m(g(m(A(x[1],C[0]),A(-C[1],x[0])),y[2]),m(g(m(A(y[1],C[0]),A(-C[1],y[0])),-x[2]),g(m(A(y[1],x[0]),A(-x[1],y[0])),C[2]))),-b[3]))))),P=m(m(m(g(m(g(m(A(b[1],I[0]),A(-I[1],b[0])),C[2]),m(g(m(A(C[1],I[0]),A(-I[1],C[0])),-b[2]),g(m(A(C[1],b[0]),A(-b[1],C[0])),I[2]))),y[3]),g(m(g(m(A(b[1],I[0]),A(-I[1],b[0])),y[2]),m(g(m(A(y[1],I[0]),A(-I[1],y[0])),-b[2]),g(m(A(y[1],b[0]),A(-b[1],y[0])),I[2]))),-C[3])),m(g(m(g(m(A(C[1],I[0]),A(-I[1],C[0])),y[2]),m(g(m(A(y[1],I[0]),A(-I[1],y[0])),-C[2]),g(m(A(y[1],C[0]),A(-C[1],y[0])),I[2]))),b[3]),g(m(g(m(A(C[1],b[0]),A(-b[1],C[0])),y[2]),m(g(m(A(y[1],b[0]),A(-b[1],y[0])),-C[2]),g(m(A(y[1],C[0]),A(-C[1],y[0])),b[2]))),-I[3]))),m(m(g(m(g(m(A(C[1],I[0]),A(-I[1],C[0])),x[2]),m(g(m(A(x[1],I[0]),A(-I[1],x[0])),-C[2]),g(m(A(x[1],C[0]),A(-C[1],x[0])),I[2]))),y[3]),g(m(g(m(A(C[1],I[0]),A(-I[1],C[0])),y[2]),m(g(m(A(y[1],I[0]),A(-I[1],y[0])),-C[2]),g(m(A(y[1],C[0]),A(-C[1],y[0])),I[2]))),-x[3])),m(g(m(g(m(A(x[1],I[0]),A(-I[1],x[0])),y[2]),m(g(m(A(y[1],I[0]),A(-I[1],y[0])),-x[2]),g(m(A(y[1],x[0]),A(-x[1],y[0])),I[2]))),C[3]),g(m(g(m(A(x[1],C[0]),A(-C[1],x[0])),y[2]),m(g(m(A(y[1],C[0]),A(-C[1],y[0])),-x[2]),g(m(A(y[1],x[0]),A(-x[1],y[0])),C[2]))),-I[3])))),M=f(v,P);return M[M.length-1]}}function l(m){return(m===3?s:m===4?a:c)(o,n,r,i)}var h=l(3),d=l(4),u=[function(){return 0},function(){return 0},function(m,A){return A[0]-m[0]},function(m,A,g){var f,y=(m[1]-g[1])*(A[0]-g[0]),x=(m[0]-g[0])*(A[1]-g[1]),C=y-x;if(y>0){if(x<=0)return C;f=y+x}else{if(!(y<0))return C;if(x>=0)return C;f=-(y+x)}var b=0.00000000000000033306690738754716*f;return C>=b||C<=-b?C:h(m,A,g)},function(m,A,g,f){var y=m[0]-f[0],x=A[0]-f[0],C=g[0]-f[0],b=m[1]-f[1],I=A[1]-f[1],v=g[1]-f[1],P=m[2]-f[2],M=A[2]-f[2],B=g[2]-f[2],T=x*v,N=C*I,D=C*b,L=y*v,H=y*I,V=x*b,O=P*(T-N)+M*(D-L)+B*(H-V),U=0.0000000000000007771561172376103*((Math.abs(T)+Math.abs(N))*Math.abs(P)+(Math.abs(D)+Math.abs(L))*Math.abs(M)+(Math.abs(H)+Math.abs(V))*Math.abs(B));return O>U||-O>U?O:d(m,A,g,f)}];function _(m){var A=u[m.length];return A||(A=u[m.length]=l(m.length)),A.apply(void 0,m)}function p(m,A,g,f,y,x,C){return function(b,I,v,P,M){switch(arguments.length){case 0:case 1:return 0;case 2:return f(b,I);case 3:return y(b,I,v);case 4:return x(b,I,v,P);case 5:return C(b,I,v,P,M)}for(var B=Array(arguments.length),T=0;T<arguments.length;++T)B[T]=arguments[T];return m(B)}}(function(){for(;u.length<=5;)u.push(l(u.length));t.exports=p.apply(void 0,[_].concat(u));for(var m=0;m<=5;++m)t.exports[m]=u[m]})()}}),dGr=vm({"node_modules/cdt2d/lib/monotone.js"(e,t){var n=v7e(),o=hGr()[3];function r(u,_,p,m,A){this.a=u,this.b=_,this.idx=p,this.lowerIds=m,this.upperIds=A}function i(u,_,p,m){this.a=u,this.b=_,this.type=p,this.idx=m}function s(u,_){var p=u.a[0]-_.a[0]||u.a[1]-_.a[1]||u.type-_.type;return p||(u.type!==0&&(p=o(u.a,u.b,_.b))?p:u.idx-_.idx)}function a(u,_){return o(u.a,u.b,_)}function c(u,_,p,m,A){for(var g=n.lt(_,m,a),f=n.gt(_,m,a),y=g;y<f;++y){for(var x=_[y],C=x.lowerIds,b=C.length;b>1&&o(p[C[b-2]],p[C[b-1]],m)>0;)u.push([C[b-1],C[b-2],A]),b-=1;C.length=b,C.push(A);var I=x.upperIds;for(b=I.length;b>1&&o(p[I[b-2]],p[I[b-1]],m)<0;)u.push([I[b-2],I[b-1],A]),b-=1;I.length=b,I.push(A)}}function l(u,_){var p;return(p=u.a[0]<_.a[0]?o(u.a,u.b,_.a):o(_.b,_.a,u.a))?p:(p=_.b[0]<u.b[0]?o(u.a,u.b,_.b):o(_.b,_.a,u.b))||u.idx-_.idx}function h(u,_,p){var m=n.le(u,p,l),A=u[m],g=A.upperIds,f=g[g.length-1];A.upperIds=[f],u.splice(m+1,0,new r(p.a,p.b,p.idx,[f],g))}function d(u,_,p){var m=p.a;p.a=p.b,p.b=m;var A=n.eq(u,p,l),g=u[A];u[A-1].upperIds=g.upperIds,u.splice(A,1)}t.exports=function(u,_){for(var p=u.length,m=_.length,A=[],g=0;g<p;++g)A.push(new i(u[g],null,0,g));for(g=0;g<m;++g){var f=_[g],y=u[f[0]],x=u[f[1]];y[0]<x[0]?A.push(new i(y,x,2,g),new i(x,y,1,g)):y[0]>x[0]&&A.push(new i(x,y,2,g),new i(y,x,1,g))}A.sort(s);for(var C=A[0].a[0]-(1+Math.abs(A[0].a[0]))*Math.pow(2,-52),b=[new r([C,1],[C,0],-1,[],[],[],[])],I=[],v=(g=0,A.length);g<v;++g){var P=A[g],M=P.type;M===0?c(I,b,u,P.a,P.idx):M===2?h(b,u,P):d(b,u,P)}return I}}}),uGr=vm({"node_modules/cdt2d/lib/triangulation.js"(e,t){var n=v7e();function o(s,a){this.stars=s,this.edges=a}t.exports=function(s,a){for(var c=Array(s),l=0;l<s;++l)c[l]=[];return new o(c,a)};var r=o.prototype;function i(s,a,c){for(var l=1,h=s.length;l<h;l+=2)if(s[l-1]===a&&s[l]===c)return s[l-1]=s[h-2],s[l]=s[h-1],void(s.length=h-2)}r.isConstraint=function(){var s=[0,0];function a(c,l){return c[0]-l[0]||c[1]-l[1]}return function(c,l){return s[0]=Math.min(c,l),s[1]=Math.max(c,l),n.eq(this.edges,s,a)>=0}}(),r.removeTriangle=function(s,a,c){var l=this.stars;i(l[s],a,c),i(l[a],c,s),i(l[c],s,a)},r.addTriangle=function(s,a,c){var l=this.stars;l[s].push(a,c),l[a].push(c,s),l[c].push(s,a)},r.opposite=function(s,a){for(var c=this.stars[a],l=1,h=c.length;l<h;l+=2)if(c[l]===s)return c[l-1];return-1},r.flip=function(s,a){var c=this.opposite(s,a),l=this.opposite(a,s);this.removeTriangle(s,a,c),this.removeTriangle(a,s,l),this.addTriangle(s,l,c),this.addTriangle(a,c,l)},r.edges=function(){for(var s=this.stars,a=[],c=0,l=s.length;c<l;++c)for(var h=s[c],d=0,u=h.length;d<u;d+=2)a.push([h[d],h[d+1]]);return a},r.cells=function(){for(var s=this.stars,a=[],c=0,l=s.length;c<l;++c)for(var h=s[c],d=0,u=h.length;d<u;d+=2){var _=h[d],p=h[d+1];c<Math.min(_,p)&&a.push([c,_,p])}return a}}}),pGr=vm({"node_modules/robust-in-sphere/in-sphere.js"(e,t){var n=ast(),o=sCn(),r=cCn(),i=aCn();function s(p){return(p===3?a:p===4?c:p===5?l:h)(o,r,n,i)}function a(p,m,A,g){return function(f,y,x){var C=A(f[0],f[0]),b=g(C,y[0]),I=g(C,x[0]),v=A(y[0],y[0]),P=g(v,f[0]),M=g(v,x[0]),B=A(x[0],x[0]),T=g(B,f[0]),N=g(B,y[0]),D=p(m(N,M),m(P,b)),L=m(T,I),H=m(D,L);return H[H.length-1]}}function c(p,m,A,g){return function(f,y,x,C){var b=p(A(f[0],f[0]),A(f[1],f[1])),I=g(b,y[0]),v=g(b,x[0]),P=g(b,C[0]),M=p(A(y[0],y[0]),A(y[1],y[1])),B=g(M,f[0]),T=g(M,x[0]),N=g(M,C[0]),D=p(A(x[0],x[0]),A(x[1],x[1])),L=g(D,f[0]),H=g(D,y[0]),V=g(D,C[0]),O=p(A(C[0],C[0]),A(C[1],C[1])),U=g(O,f[0]),j=g(O,y[0]),Y=g(O,x[0]),X=p(p(g(m(Y,V),y[1]),p(g(m(j,N),-x[1]),g(m(H,T),C[1]))),p(g(m(j,N),f[1]),p(g(m(U,P),-y[1]),g(m(B,I),C[1])))),K=p(p(g(m(Y,V),f[1]),p(g(m(U,P),-x[1]),g(m(L,v),C[1]))),p(g(m(H,T),f[1]),p(g(m(L,v),-y[1]),g(m(B,I),x[1])))),J=m(X,K);return J[J.length-1]}}function l(p,m,A,g){return function(f,y,x,C,b){var I=p(A(f[0],f[0]),p(A(f[1],f[1]),A(f[2],f[2]))),v=g(I,y[0]),P=g(I,x[0]),M=g(I,C[0]),B=g(I,b[0]),T=p(A(y[0],y[0]),p(A(y[1],y[1]),A(y[2],y[2]))),N=g(T,f[0]),D=g(T,x[0]),L=g(T,C[0]),H=g(T,b[0]),V=p(A(x[0],x[0]),p(A(x[1],x[1]),A(x[2],x[2]))),O=g(V,f[0]),U=g(V,y[0]),j=g(V,C[0]),Y=g(V,b[0]),X=p(A(C[0],C[0]),p(A(C[1],C[1]),A(C[2],C[2]))),K=g(X,f[0]),J=g(X,y[0]),ee=g(X,x[0]),se=g(X,b[0]),ne=p(A(b[0],b[0]),p(A(b[1],b[1]),A(b[2],b[2]))),re=g(ne,f[0]),Z=g(ne,y[0]),te=g(ne,x[0]),ie=g(ne,C[0]),ce=p(p(p(g(p(g(m(ie,se),x[1]),p(g(m(te,Y),-C[1]),g(m(ee,j),b[1]))),y[2]),p(g(p(g(m(ie,se),y[1]),p(g(m(Z,H),-C[1]),g(m(J,L),b[1]))),-x[2]),g(p(g(m(te,Y),y[1]),p(g(m(Z,H),-x[1]),g(m(U,D),b[1]))),C[2]))),p(g(p(g(m(ee,j),y[1]),p(g(m(J,L),-x[1]),g(m(U,D),C[1]))),-b[2]),p(g(p(g(m(ie,se),y[1]),p(g(m(Z,H),-C[1]),g(m(J,L),b[1]))),f[2]),g(p(g(m(ie,se),f[1]),p(g(m(re,B),-C[1]),g(m(K,M),b[1]))),-y[2])))),p(p(g(p(g(m(Z,H),f[1]),p(g(m(re,B),-y[1]),g(m(N,v),b[1]))),C[2]),p(g(p(g(m(J,L),f[1]),p(g(m(K,M),-y[1]),g(m(N,v),C[1]))),-b[2]),g(p(g(m(ee,j),y[1]),p(g(m(J,L),-x[1]),g(m(U,D),C[1]))),f[2]))),p(g(p(g(m(ee,j),f[1]),p(g(m(K,M),-x[1]),g(m(O,P),C[1]))),-y[2]),p(g(p(g(m(J,L),f[1]),p(g(m(K,M),-y[1]),g(m(N,v),C[1]))),x[2]),g(p(g(m(U,D),f[1]),p(g(m(O,P),-y[1]),g(m(N,v),x[1]))),-C[2]))))),ue=p(p(p(g(p(g(m(ie,se),x[1]),p(g(m(te,Y),-C[1]),g(m(ee,j),b[1]))),f[2]),g(p(g(m(ie,se),f[1]),p(g(m(re,B),-C[1]),g(m(K,M),b[1]))),-x[2])),p(g(p(g(m(te,Y),f[1]),p(g(m(re,B),-x[1]),g(m(O,P),b[1]))),C[2]),g(p(g(m(ee,j),f[1]),p(g(m(K,M),-x[1]),g(m(O,P),C[1]))),-b[2]))),p(p(g(p(g(m(te,Y),y[1]),p(g(m(Z,H),-x[1]),g(m(U,D),b[1]))),f[2]),g(p(g(m(te,Y),f[1]),p(g(m(re,B),-x[1]),g(m(O,P),b[1]))),-y[2])),p(g(p(g(m(Z,H),f[1]),p(g(m(re,B),-y[1]),g(m(N,v),b[1]))),x[2]),g(p(g(m(U,D),f[1]),p(g(m(O,P),-y[1]),g(m(N,v),x[1]))),-b[2])))),de=m(ce,ue);return de[de.length-1]}}function h(p,m,A,g){return function(f,y,x,C,b,I){var v=p(p(A(f[0],f[0]),A(f[1],f[1])),p(A(f[2],f[2]),A(f[3],f[3]))),P=g(v,y[0]),M=g(v,x[0]),B=g(v,C[0]),T=g(v,b[0]),N=g(v,I[0]),D=p(p(A(y[0],y[0]),A(y[1],y[1])),p(A(y[2],y[2]),A(y[3],y[3]))),L=g(D,f[0]),H=g(D,x[0]),V=g(D,C[0]),O=g(D,b[0]),U=g(D,I[0]),j=p(p(A(x[0],x[0]),A(x[1],x[1])),p(A(x[2],x[2]),A(x[3],x[3]))),Y=g(j,f[0]),X=g(j,y[0]),K=g(j,C[0]),J=g(j,b[0]),ee=g(j,I[0]),se=p(p(A(C[0],C[0]),A(C[1],C[1])),p(A(C[2],C[2]),A(C[3],C[3]))),ne=g(se,f[0]),re=g(se,y[0]),Z=g(se,x[0]),te=g(se,b[0]),ie=g(se,I[0]),ce=p(p(A(b[0],b[0]),A(b[1],b[1])),p(A(b[2],b[2]),A(b[3],b[3]))),ue=g(ce,f[0]),de=g(ce,y[0]),me=g(ce,x[0]),ge=g(ce,C[0]),xe=g(ce,I[0]),Ee=p(p(A(I[0],I[0]),A(I[1],I[1])),p(A(I[2],I[2]),A(I[3],I[3]))),Re=g(Ee,f[0]),Me=g(Ee,y[0]),_e=g(Ee,x[0]),ye=g(Ee,C[0]),Se=g(Ee,b[0]),Ne=p(p(p(g(p(p(g(p(g(m(Se,xe),C[1]),p(g(m(ye,ie),-b[1]),g(m(ge,te),I[1]))),x[2]),g(p(g(m(Se,xe),x[1]),p(g(m(_e,ee),-b[1]),g(m(me,J),I[1]))),-C[2])),p(g(p(g(m(ye,ie),x[1]),p(g(m(_e,ee),-C[1]),g(m(Z,K),I[1]))),b[2]),g(p(g(m(ge,te),x[1]),p(g(m(me,J),-C[1]),g(m(Z,K),b[1]))),-I[2]))),y[3]),p(g(p(p(g(p(g(m(Se,xe),C[1]),p(g(m(ye,ie),-b[1]),g(m(ge,te),I[1]))),y[2]),g(p(g(m(Se,xe),y[1]),p(g(m(Me,U),-b[1]),g(m(de,O),I[1]))),-C[2])),p(g(p(g(m(ye,ie),y[1]),p(g(m(Me,U),-C[1]),g(m(re,V),I[1]))),b[2]),g(p(g(m(ge,te),y[1]),p(g(m(de,O),-C[1]),g(m(re,V),b[1]))),-I[2]))),-x[3]),g(p(p(g(p(g(m(Se,xe),x[1]),p(g(m(_e,ee),-b[1]),g(m(me,J),I[1]))),y[2]),g(p(g(m(Se,xe),y[1]),p(g(m(Me,U),-b[1]),g(m(de,O),I[1]))),-x[2])),p(g(p(g(m(_e,ee),y[1]),p(g(m(Me,U),-x[1]),g(m(X,H),I[1]))),b[2]),g(p(g(m(me,J),y[1]),p(g(m(de,O),-x[1]),g(m(X,H),b[1]))),-I[2]))),C[3]))),p(p(g(p(p(g(p(g(m(ye,ie),x[1]),p(g(m(_e,ee),-C[1]),g(m(Z,K),I[1]))),y[2]),g(p(g(m(ye,ie),y[1]),p(g(m(Me,U),-C[1]),g(m(re,V),I[1]))),-x[2])),p(g(p(g(m(_e,ee),y[1]),p(g(m(Me,U),-x[1]),g(m(X,H),I[1]))),C[2]),g(p(g(m(Z,K),y[1]),p(g(m(re,V),-x[1]),g(m(X,H),C[1]))),-I[2]))),-b[3]),g(p(p(g(p(g(m(ge,te),x[1]),p(g(m(me,J),-C[1]),g(m(Z,K),b[1]))),y[2]),g(p(g(m(ge,te),y[1]),p(g(m(de,O),-C[1]),g(m(re,V),b[1]))),-x[2])),p(g(p(g(m(me,J),y[1]),p(g(m(de,O),-x[1]),g(m(X,H),b[1]))),C[2]),g(p(g(m(Z,K),y[1]),p(g(m(re,V),-x[1]),g(m(X,H),C[1]))),-b[2]))),I[3])),p(g(p(p(g(p(g(m(Se,xe),C[1]),p(g(m(ye,ie),-b[1]),g(m(ge,te),I[1]))),y[2]),g(p(g(m(Se,xe),y[1]),p(g(m(Me,U),-b[1]),g(m(de,O),I[1]))),-C[2])),p(g(p(g(m(ye,ie),y[1]),p(g(m(Me,U),-C[1]),g(m(re,V),I[1]))),b[2]),g(p(g(m(ge,te),y[1]),p(g(m(de,O),-C[1]),g(m(re,V),b[1]))),-I[2]))),f[3]),g(p(p(g(p(g(m(Se,xe),C[1]),p(g(m(ye,ie),-b[1]),g(m(ge,te),I[1]))),f[2]),g(p(g(m(Se,xe),f[1]),p(g(m(Re,N),-b[1]),g(m(ue,T),I[1]))),-C[2])),p(g(p(g(m(ye,ie),f[1]),p(g(m(Re,N),-C[1]),g(m(ne,B),I[1]))),b[2]),g(p(g(m(ge,te),f[1]),p(g(m(ue,T),-C[1]),g(m(ne,B),b[1]))),-I[2]))),-y[3])))),p(p(p(g(p(p(g(p(g(m(Se,xe),y[1]),p(g(m(Me,U),-b[1]),g(m(de,O),I[1]))),f[2]),g(p(g(m(Se,xe),f[1]),p(g(m(Re,N),-b[1]),g(m(ue,T),I[1]))),-y[2])),p(g(p(g(m(Me,U),f[1]),p(g(m(Re,N),-y[1]),g(m(L,P),I[1]))),b[2]),g(p(g(m(de,O),f[1]),p(g(m(ue,T),-y[1]),g(m(L,P),b[1]))),-I[2]))),C[3]),g(p(p(g(p(g(m(ye,ie),y[1]),p(g(m(Me,U),-C[1]),g(m(re,V),I[1]))),f[2]),g(p(g(m(ye,ie),f[1]),p(g(m(Re,N),-C[1]),g(m(ne,B),I[1]))),-y[2])),p(g(p(g(m(Me,U),f[1]),p(g(m(Re,N),-y[1]),g(m(L,P),I[1]))),C[2]),g(p(g(m(re,V),f[1]),p(g(m(ne,B),-y[1]),g(m(L,P),C[1]))),-I[2]))),-b[3])),p(g(p(p(g(p(g(m(ge,te),y[1]),p(g(m(de,O),-C[1]),g(m(re,V),b[1]))),f[2]),g(p(g(m(ge,te),f[1]),p(g(m(ue,T),-C[1]),g(m(ne,B),b[1]))),-y[2])),p(g(p(g(m(de,O),f[1]),p(g(m(ue,T),-y[1]),g(m(L,P),b[1]))),C[2]),g(p(g(m(re,V),f[1]),p(g(m(ne,B),-y[1]),g(m(L,P),C[1]))),-b[2]))),I[3]),g(p(p(g(p(g(m(ye,ie),x[1]),p(g(m(_e,ee),-C[1]),g(m(Z,K),I[1]))),y[2]),g(p(g(m(ye,ie),y[1]),p(g(m(Me,U),-C[1]),g(m(re,V),I[1]))),-x[2])),p(g(p(g(m(_e,ee),y[1]),p(g(m(Me,U),-x[1]),g(m(X,H),I[1]))),C[2]),g(p(g(m(Z,K),y[1]),p(g(m(re,V),-x[1]),g(m(X,H),C[1]))),-I[2]))),f[3]))),p(p(g(p(p(g(p(g(m(ye,ie),x[1]),p(g(m(_e,ee),-C[1]),g(m(Z,K),I[1]))),f[2]),g(p(g(m(ye,ie),f[1]),p(g(m(Re,N),-C[1]),g(m(ne,B),I[1]))),-x[2])),p(g(p(g(m(_e,ee),f[1]),p(g(m(Re,N),-x[1]),g(m(Y,M),I[1]))),C[2]),g(p(g(m(Z,K),f[1]),p(g(m(ne,B),-x[1]),g(m(Y,M),C[1]))),-I[2]))),-y[3]),g(p(p(g(p(g(m(ye,ie),y[1]),p(g(m(Me,U),-C[1]),g(m(re,V),I[1]))),f[2]),g(p(g(m(ye,ie),f[1]),p(g(m(Re,N),-C[1]),g(m(ne,B),I[1]))),-y[2])),p(g(p(g(m(Me,U),f[1]),p(g(m(Re,N),-y[1]),g(m(L,P),I[1]))),C[2]),g(p(g(m(re,V),f[1]),p(g(m(ne,B),-y[1]),g(m(L,P),C[1]))),-I[2]))),x[3])),p(g(p(p(g(p(g(m(_e,ee),y[1]),p(g(m(Me,U),-x[1]),g(m(X,H),I[1]))),f[2]),g(p(g(m(_e,ee),f[1]),p(g(m(Re,N),-x[1]),g(m(Y,M),I[1]))),-y[2])),p(g(p(g(m(Me,U),f[1]),p(g(m(Re,N),-y[1]),g(m(L,P),I[1]))),x[2]),g(p(g(m(X,H),f[1]),p(g(m(Y,M),-y[1]),g(m(L,P),x[1]))),-I[2]))),-C[3]),g(p(p(g(p(g(m(Z,K),y[1]),p(g(m(re,V),-x[1]),g(m(X,H),C[1]))),f[2]),g(p(g(m(Z,K),f[1]),p(g(m(ne,B),-x[1]),g(m(Y,M),C[1]))),-y[2])),p(g(p(g(m(re,V),f[1]),p(g(m(ne,B),-y[1]),g(m(L,P),C[1]))),x[2]),g(p(g(m(X,H),f[1]),p(g(m(Y,M),-y[1]),g(m(L,P),x[1]))),-C[2]))),I[3]))))),Le=p(p(p(g(p(p(g(p(g(m(Se,xe),C[1]),p(g(m(ye,ie),-b[1]),g(m(ge,te),I[1]))),x[2]),g(p(g(m(Se,xe),x[1]),p(g(m(_e,ee),-b[1]),g(m(me,J),I[1]))),-C[2])),p(g(p(g(m(ye,ie),x[1]),p(g(m(_e,ee),-C[1]),g(m(Z,K),I[1]))),b[2]),g(p(g(m(ge,te),x[1]),p(g(m(me,J),-C[1]),g(m(Z,K),b[1]))),-I[2]))),f[3]),p(g(p(p(g(p(g(m(Se,xe),C[1]),p(g(m(ye,ie),-b[1]),g(m(ge,te),I[1]))),f[2]),g(p(g(m(Se,xe),f[1]),p(g(m(Re,N),-b[1]),g(m(ue,T),I[1]))),-C[2])),p(g(p(g(m(ye,ie),f[1]),p(g(m(Re,N),-C[1]),g(m(ne,B),I[1]))),b[2]),g(p(g(m(ge,te),f[1]),p(g(m(ue,T),-C[1]),g(m(ne,B),b[1]))),-I[2]))),-x[3]),g(p(p(g(p(g(m(Se,xe),x[1]),p(g(m(_e,ee),-b[1]),g(m(me,J),I[1]))),f[2]),g(p(g(m(Se,xe),f[1]),p(g(m(Re,N),-b[1]),g(m(ue,T),I[1]))),-x[2])),p(g(p(g(m(_e,ee),f[1]),p(g(m(Re,N),-x[1]),g(m(Y,M),I[1]))),b[2]),g(p(g(m(me,J),f[1]),p(g(m(ue,T),-x[1]),g(m(Y,M),b[1]))),-I[2]))),C[3]))),p(p(g(p(p(g(p(g(m(ye,ie),x[1]),p(g(m(_e,ee),-C[1]),g(m(Z,K),I[1]))),f[2]),g(p(g(m(ye,ie),f[1]),p(g(m(Re,N),-C[1]),g(m(ne,B),I[1]))),-x[2])),p(g(p(g(m(_e,ee),f[1]),p(g(m(Re,N),-x[1]),g(m(Y,M),I[1]))),C[2]),g(p(g(m(Z,K),f[1]),p(g(m(ne,B),-x[1]),g(m(Y,M),C[1]))),-I[2]))),-b[3]),g(p(p(g(p(g(m(ge,te),x[1]),p(g(m(me,J),-C[1]),g(m(Z,K),b[1]))),f[2]),g(p(g(m(ge,te),f[1]),p(g(m(ue,T),-C[1]),g(m(ne,B),b[1]))),-x[2])),p(g(p(g(m(me,J),f[1]),p(g(m(ue,T),-x[1]),g(m(Y,M),b[1]))),C[2]),g(p(g(m(Z,K),f[1]),p(g(m(ne,B),-x[1]),g(m(Y,M),C[1]))),-b[2]))),I[3])),p(g(p(p(g(p(g(m(Se,xe),x[1]),p(g(m(_e,ee),-b[1]),g(m(me,J),I[1]))),y[2]),g(p(g(m(Se,xe),y[1]),p(g(m(Me,U),-b[1]),g(m(de,O),I[1]))),-x[2])),p(g(p(g(m(_e,ee),y[1]),p(g(m(Me,U),-x[1]),g(m(X,H),I[1]))),b[2]),g(p(g(m(me,J),y[1]),p(g(m(de,O),-x[1]),g(m(X,H),b[1]))),-I[2]))),f[3]),g(p(p(g(p(g(m(Se,xe),x[1]),p(g(m(_e,ee),-b[1]),g(m(me,J),I[1]))),f[2]),g(p(g(m(Se,xe),f[1]),p(g(m(Re,N),-b[1]),g(m(ue,T),I[1]))),-x[2])),p(g(p(g(m(_e,ee),f[1]),p(g(m(Re,N),-x[1]),g(m(Y,M),I[1]))),b[2]),g(p(g(m(me,J),f[1]),p(g(m(ue,T),-x[1]),g(m(Y,M),b[1]))),-I[2]))),-y[3])))),p(p(p(g(p(p(g(p(g(m(Se,xe),y[1]),p(g(m(Me,U),-b[1]),g(m(de,O),I[1]))),f[2]),g(p(g(m(Se,xe),f[1]),p(g(m(Re,N),-b[1]),g(m(ue,T),I[1]))),-y[2])),p(g(p(g(m(Me,U),f[1]),p(g(m(Re,N),-y[1]),g(m(L,P),I[1]))),b[2]),g(p(g(m(de,O),f[1]),p(g(m(ue,T),-y[1]),g(m(L,P),b[1]))),-I[2]))),x[3]),g(p(p(g(p(g(m(_e,ee),y[1]),p(g(m(Me,U),-x[1]),g(m(X,H),I[1]))),f[2]),g(p(g(m(_e,ee),f[1]),p(g(m(Re,N),-x[1]),g(m(Y,M),I[1]))),-y[2])),p(g(p(g(m(Me,U),f[1]),p(g(m(Re,N),-y[1]),g(m(L,P),I[1]))),x[2]),g(p(g(m(X,H),f[1]),p(g(m(Y,M),-y[1]),g(m(L,P),x[1]))),-I[2]))),-b[3])),p(g(p(p(g(p(g(m(me,J),y[1]),p(g(m(de,O),-x[1]),g(m(X,H),b[1]))),f[2]),g(p(g(m(me,J),f[1]),p(g(m(ue,T),-x[1]),g(m(Y,M),b[1]))),-y[2])),p(g(p(g(m(de,O),f[1]),p(g(m(ue,T),-y[1]),g(m(L,P),b[1]))),x[2]),g(p(g(m(X,H),f[1]),p(g(m(Y,M),-y[1]),g(m(L,P),x[1]))),-b[2]))),I[3]),g(p(p(g(p(g(m(ge,te),x[1]),p(g(m(me,J),-C[1]),g(m(Z,K),b[1]))),y[2]),g(p(g(m(ge,te),y[1]),p(g(m(de,O),-C[1]),g(m(re,V),b[1]))),-x[2])),p(g(p(g(m(me,J),y[1]),p(g(m(de,O),-x[1]),g(m(X,H),b[1]))),C[2]),g(p(g(m(Z,K),y[1]),p(g(m(re,V),-x[1]),g(m(X,H),C[1]))),-b[2]))),f[3]))),p(p(g(p(p(g(p(g(m(ge,te),x[1]),p(g(m(me,J),-C[1]),g(m(Z,K),b[1]))),f[2]),g(p(g(m(ge,te),f[1]),p(g(m(ue,T),-C[1]),g(m(ne,B),b[1]))),-x[2])),p(g(p(g(m(me,J),f[1]),p(g(m(ue,T),-x[1]),g(m(Y,M),b[1]))),C[2]),g(p(g(m(Z,K),f[1]),p(g(m(ne,B),-x[1]),g(m(Y,M),C[1]))),-b[2]))),-y[3]),g(p(p(g(p(g(m(ge,te),y[1]),p(g(m(de,O),-C[1]),g(m(re,V),b[1]))),f[2]),g(p(g(m(ge,te),f[1]),p(g(m(ue,T),-C[1]),g(m(ne,B),b[1]))),-y[2])),p(g(p(g(m(de,O),f[1]),p(g(m(ue,T),-y[1]),g(m(L,P),b[1]))),C[2]),g(p(g(m(re,V),f[1]),p(g(m(ne,B),-y[1]),g(m(L,P),C[1]))),-b[2]))),x[3])),p(g(p(p(g(p(g(m(me,J),y[1]),p(g(m(de,O),-x[1]),g(m(X,H),b[1]))),f[2]),g(p(g(m(me,J),f[1]),p(g(m(ue,T),-x[1]),g(m(Y,M),b[1]))),-y[2])),p(g(p(g(m(de,O),f[1]),p(g(m(ue,T),-y[1]),g(m(L,P),b[1]))),x[2]),g(p(g(m(X,H),f[1]),p(g(m(Y,M),-y[1]),g(m(L,P),x[1]))),-b[2]))),-C[3]),g(p(p(g(p(g(m(Z,K),y[1]),p(g(m(re,V),-x[1]),g(m(X,H),C[1]))),f[2]),g(p(g(m(Z,K),f[1]),p(g(m(ne,B),-x[1]),g(m(Y,M),C[1]))),-y[2])),p(g(p(g(m(re,V),f[1]),p(g(m(ne,B),-y[1]),g(m(L,P),C[1]))),x[2]),g(p(g(m(X,H),f[1]),p(g(m(Y,M),-y[1]),g(m(L,P),x[1]))),-C[2]))),b[3]))))),nt=m(Ne,Le);return nt[nt.length-1]}}var d=[function(){return 0},function(){return 0},function(){return 0}];function u(p){var m=d[p.length];return m||(m=d[p.length]=s(p.length)),m.apply(void 0,p)}function _(p,m,A,g,f,y,x,C){return function(b,I,v,P,M,B){switch(arguments.length){case 0:case 1:return 0;case 2:return g(b,I);case 3:return f(b,I,v);case 4:return y(b,I,v,P);case 5:return x(b,I,v,P,M);case 6:return C(b,I,v,P,M,B)}for(var T=Array(arguments.length),N=0;N<arguments.length;++N)T[N]=arguments[N];return p(T)}}(function(){for(;d.length<=6;)d.push(s(d.length));t.exports=_.apply(void 0,[u].concat(d));for(var p=0;p<=6;++p)t.exports[p]=d[p]})()}}),mGr=vm({"node_modules/cdt2d/lib/delaunay.js"(e,t){var n=pGr()[4];v7e();function o(r,i,s,a,c,l){var h=i.opposite(a,c);if(!(h<0)){if(c<a){var d=a;a=c,c=d,d=l,l=h,h=d}i.isConstraint(a,c)||n(r[a],r[c],r[l],r[h])<0&&s.push(a,c)}}t.exports=function(r,i){for(var s=[],a=r.length,c=i.stars,l=0;l<a;++l)for(var h=c[l],d=1;d<h.length;d+=2)if(!((m=h[d])<l)&&!i.isConstraint(l,m)){for(var u=h[d-1],_=-1,p=1;p<h.length;p+=2)if(h[p-1]===m){_=h[p];break}_<0||n(r[l],r[m],r[u],r[_])<0&&s.push(l,m)}for(;s.length>0;){for(var m=s.pop(),A=(u=-1,_=-1,h=c[l=s.pop()],1);A<h.length;A+=2){var g=h[A-1],f=h[A];g===m?_=f:f===m&&(u=g)}u<0||_<0||(n(r[l],r[m],r[u],r[_])>=0||(i.flip(l,m),o(r,i,s,u,l,_),o(r,i,s,l,_,u),o(r,i,s,_,m,u),o(r,i,s,m,u,_)))}}}}),_Gr=vm({"node_modules/cdt2d/lib/filter.js"(e,t){var n=v7e();function o(i,s,a,c,l,h,d){this.cells=i,this.neighbor=s,this.flags=c,this.constraint=a,this.active=l,this.next=h,this.boundary=d}function r(i,s){return i[0]-s[0]||i[1]-s[1]||i[2]-s[2]}t.exports=function(i,s,a){var c=function(C,b){for(var I=C.cells(),v=I.length,P=0;P<v;++P){var M=(j=I[P])[0],B=j[1],T=j[2];B<T?B<M&&(j[0]=B,j[1]=T,j[2]=M):T<M&&(j[0]=T,j[1]=M,j[2]=B)}I.sort(r);var N=Array(v);for(P=0;P<N.length;++P)N[P]=0;var D=[],L=[],H=Array(3*v),V=Array(3*v),O=null;b&&(O=[]);var U=new o(I,H,V,N,D,L,O);for(P=0;P<v;++P)for(var j=I[P],Y=0;Y<3;++Y){M=j[Y],B=j[(Y+1)%3];var X=H[3*P+Y]=U.locate(B,M,C.opposite(B,M)),K=V[3*P+Y]=C.isConstraint(M,B);X<0&&(K?L.push(P):(D.push(P),N[P]=1),b&&O.push([B,M,-1]))}return U}(i,a);if(s===0)return a?c.cells.concat(c.boundary):c.cells;var l=1,{active:h,next:d,flags:u,cells:_,constraint:p,neighbor:m}=c;for(;h.length>0||d.length>0;){for(;h.length>0;){var A=h.pop();if(u[A]!==-l){u[A]=l,_[A];for(var g=0;g<3;++g){var f=m[3*A+g];f>=0&&u[f]===0&&(p[3*A+g]?d.push(f):(h.push(f),u[f]=l))}}}var y=d;d=h,h=y,d.length=0,l=-l}var x=function(C,b,I){for(var v=0,P=0;P<C.length;++P)b[P]===I&&(C[v++]=C[P]);return C.length=v,C}(_,u,s);if(a)return x.concat(c.boundary);return x},o.prototype.locate=function(){var i=[0,0,0];return function(s,a,c){var l=s,h=a,d=c;return a<c?a<s&&(l=a,h=c,d=s):c<s&&(l=c,h=s,d=a),l<0?-1:(i[0]=l,i[1]=h,i[2]=d,n.eq(this.cells,i,r))}}()}}),gGr=vm({"node_modules/cdt2d/cdt2d.js"(e,t){var n=dGr(),o=uGr(),r=mGr(),i=_Gr();function s(l){return[Math.min(l[0],l[1]),Math.max(l[0],l[1])]}function a(l,h){return l[0]-h[0]||l[1]-h[1]}function c(l,h,d){return h in l?l[h]:d}t.exports=function(l,h,d){Array.isArray(h)?(d=d||{},h=h||[]):(d=h||{},h=[]);var u=!!c(d,"delaunay",!0),_=!!c(d,"interior",!0),p=!!c(d,"exterior",!0),m=!!c(d,"infinity",!1);if(!_&&!p||l.length===0)return[];var A=n(l,h);if(u||_!==p||m){for(var g=o(l.length,function(x){return x.map(s).sort(a)}(h)),f=0;f<A.length;++f){var y=A[f];g.addTriangle(y[0],y[1],y[2])}return u&&r(l,g),p?_?m?i(g,0,m):g.cells():i(g,1,m):i(g,-1)}return A}}}),jAn={0:"M0.301025 0.257813 L0.206593 0.283385 L0.122042 0.361307 L0.075923 0.474441 L0.064942 0.642221 L0.091296 0.78289 L0.159376 0.899463 L0.257104 0.961214 L0.344948 0.961214 L0.442678 0.899463 L0.510757 0.78289 L0.537111 0.642221 L0.526131 0.474441 L0.480012 0.361307 L0.39546 0.283385 L0.301025 0.257813",1:"M0.220426 0.40845 L0.381626 0.270996 L0.381626 0.948966",2:"M0.110409 0.39212 L0.125621 0.342293 L0.170571 0.295823 L0.244237 0.26431 L0.291518 0.257813 L0.373319 0.263799 L0.434683 0.290705 L0.468239 0.331966 L0.480292 0.379913 L0.479492 0.411806 L0.465088 0.465192 L0.402571 0.568988 L0.245134 0.766438 L0.07959 0.948045 L0.522462 0.948045",3:"M0.081606 0.345073 L0.119154 0.315633 L0.178996 0.284091 L0.255265 0.257813 L0.349133 0.263062 L0.43127 0.289348 L0.48994 0.336662 L0.525141 0.394491 L0.513407 0.457577 L0.466472 0.504892 L0.384334 0.541692 L0.290464 0.56272 L0.20833 0.573235 L0.290464 0.583749 L0.384334 0.610035 L0.466472 0.652092 L0.519274 0.709922 L0.531007 0.773007 L0.50754 0.841351 L0.454738 0.899179 L0.3726 0.946494 L0.310412 0.961214 L0.209503 0.959111 L0.127367 0.946494 L0.071046 0.929671",4:"M0.418494 0.270996 L0.048828 0.724199 L0.553224 0.724199 M0.414181 0.578167 L0.414181 0.94897",5:"M0.074951 0.270996 L0.074951 0.614701 L0.267655 0.5695 L0.405247 0.586502 L0.460002 0.617189 L0.498028 0.660731 L0.527101 0.779401 L0.513352 0.841049 L0.477274 0.889568 L0.406378 0.93463 L0.324445 0.958337 L0.247399 0.962139 L0.182516 0.949767 L0.130068 0.925508 L0.074951 0.875607 M0.074951 0.270996 L0.527101 0.270996",6:"M0.428549 0.257813 L0.341433 0.285053 L0.26073 0.312099 L0.192188 0.360182 L0.138902 0.410969 L0.098219 0.500422 L0.070249 0.584267 L0.067264 0.670716 L0.065164 0.756863 L0.087163 0.820973 L0.108168 0.861042 L0.157916 0.913131 L0.210981 0.948192 L0.29279 0.961214 L0.384548 0.956206 L0.456409 0.924151 L0.507262 0.881077 L0.5349 0.821975 L0.537111 0.771889 L0.521634 0.718798 L0.498418 0.67372 L0.463042 0.636657 L0.414398 0.613617 L0.34696 0.598591 L0.28284 0.595587 L0.215403 0.605604 L0.145756 0.641665 L0.109274 0.678729 L0.064942 0.724006",7:"M0.071534 0.270996 L0.530519 0.270996 L0.495935 0.291702 L0.477752 0.305407 L0.435186 0.346112 L0.412067 0.374136 L0.388565 0.40796 L0.365315 0.448098 L0.342943 0.495062 L0.322081 0.549366 L0.303364 0.611524 L0.287416 0.68205 L0.270077 0.80465 L0.26253 0.94897",8:"M0.286761 0.257813 L0.210684 0.27162 L0.1414 0.305622 L0.092494 0.382125 L0.111513 0.450128 L0.16857 0.502193 L0.228345 0.539382 L0.377781 0.594635 L0.470161 0.645637 L0.52586 0.706203 L0.538087 0.792269 L0.506841 0.87621 L0.438915 0.927212 L0.339743 0.961214 L0.263666 0.959089 L0.174004 0.929337 L0.102003 0.881523 L0.063965 0.811395 L0.066682 0.741266 L0.102003 0.671139 L0.180797 0.608448 L0.259591 0.580822 L0.358762 0.548945 L0.456576 0.49688 L0.486463 0.446941 L0.487822 0.362999 L0.453859 0.302434 L0.384574 0.265245 L0.286761 0.257813",9:"M0.511026 0.437812 L0.491026 0.347812 L0.451026 0.297812 L0.391026 0.267812 L0.311026 0.257813 L0.231026 0.267812 L0.161026 0.297812 L0.111026 0.347812 L0.091026 0.417812 L0.111026 0.487812 L0.161026 0.537812 L0.231026 0.567812 L0.311026 0.577812 L0.391026 0.557812 L0.451026 0.517812 L0.491026 0.477812 L0.511026 0.437812 M0.510026 0.438812 L0.434026 0.636812 L0.381026 0.777812 L0.337026 0.879812 L0.301026 0.957812","!":"M0.301026 0.270996 L0.301026 0.749566 M0.251466 0.94897 L0.350587 0.94897",'"':"M0.16504 0.270996 L0.16504 0.523022 M0.437013 0.270996 L0.437013 0.523022","#":"M0.20958 0.282227 L0.146515 0.949754 M0.461844 0.282227 L0.398779 0.949754 M0.032999 0.526969 L0.600587 0.452796 M0.001465 0.82366 L0.569055 0.749486",$:"M0.307121 0.240234 L0.307121 1.083502 M0.490031 0.415915 L0.404676 0.328075 L0.23396 0.310507 L0.136407 0.398347 L0.099828 0.521324 L0.124213 0.591596 L0.197379 0.644299 L0.429061 0.697003 L0.502224 0.749708 L0.526613 0.837547 L0.477836 0.960526 L0.355897 1.013228 L0.197379 0.99566 L0.112021 0.942957 L0.07544 0.837547","'":"M0.301026 0.270996 L0.301026 0.523022","(":"M0.413087 0.241211 L0.372337 0.28347 L0.331589 0.334184 L0.290838 0.393349 L0.25009 0.460965 L0.219528 0.528584 L0.199153 0.5962 L0.188966 0.655364 L0.199153 0.714529 L0.219528 0.782146 L0.25009 0.849764 L0.290838 0.91738 L0.331589 0.976544 L0.372337 1.027258 L0.413087 1.069491",")":"M0.188966 0.241211 L0.229716 0.28347 L0.270466 0.334184 L0.311213 0.393349 L0.351964 0.460965 L0.382526 0.528584 L0.4029 0.5962 L0.413087 0.655364 L0.4029 0.714529 L0.382526 0.782146 L0.351964 0.849764 L0.311213 0.91738 L0.270466 0.976544 L0.229716 1.027258 L0.188966 1.069491","*":"M0.301026 0.458702 L0.301026 0.681942 M0.301026 0.458702 L0.520997 0.536834 M0.301026 0.458702 L0.439954 0.257813 M0.301026 0.458702 L0.162098 0.257813 M0.301026 0.458702 L0.081055 0.536834","+":"M0.042969 0.66845 L0.559083 0.66845 M0.301023 0.428223 L0.301023 0.908661",",":"M0.38672 0.852051 L0.215333 1.030661 L0.301025 1.119971","-":"M0.173829 0.686035 L0.428224 0.686035",".":"M0.362549 0.851074 L0.239503 0.851074","/":"M0.062501 1.035249 L0.539551 0.270996","<":"M0.559083 0.441895 L0.042969 0.66939 L0.042969 0.66939 L0.559083 0.896902","=":"M0.042969 0.545898 L0.559083 0.545898 M0.042969 0.80837 L0.559083 0.80837",">":"M0.042969 0.441895 L0.559083 0.66939 L0.559083 0.66939 L0.042969 0.896902",A:"M0.018067 0.94897 L0.290179 0.270996 L0.583986 0.94897 M0.155303 0.684521 L0.433548 0.684521",B:"M0.063965 0.94897 L0.063965 0.278953 L0.209356 0.270996 L0.342486 0.294394 L0.432179 0.37292 L0.418224 0.48773 L0.312686 0.549166 L0.084728 0.575531 L0.306377 0.589434 L0.468877 0.647456 L0.538087 0.736658 L0.5324 0.85202 L0.501247 0.902983 L0.42355 0.944398 L0.063965 0.94897",C:"M0.529054 0.419847 L0.498425 0.345196 L0.442238 0.292341 L0.33583 0.257813 L0.257199 0.268357 L0.187906 0.303748 L0.120243 0.385432 L0.072998 0.599844 L0.110073 0.815385 L0.165381 0.902183 L0.222883 0.942801 L0.334904 0.961214 L0.43253 0.937679 L0.504816 0.868999 L0.529054 0.772065",D:"M0.064454 0.94897 L0.071838 0.285078 L0.171217 0.270996 L0.247348 0.272633 L0.37101 0.306078 L0.462461 0.378304 L0.514748 0.475555 L0.535591 0.576392 L0.537599 0.652313 L0.528065 0.717381 L0.508562 0.772419 L0.445948 0.855695 L0.362356 0.90871 L0.225203 0.945862 L0.064454 0.94897",E:"M0.080078 0.270996 L0.080078 0.94897 M0.080078 0.270996 L0.521974 0.270996 M0.080078 0.609981 L0.389405 0.609981 M0.080078 0.94897 L0.521974 0.94897",F:"M0.086426 0.270996 L0.086426 0.94897 M0.091304 0.275607 L0.515626 0.275607 M0.091304 0.607677 L0.447344 0.607677",G:"M0.498034 0.284943 L0.374621 0.257813 L0.244219 0.268648 L0.160577 0.311997 L0.094556 0.398116 L0.056397 0.58404 L0.076752 0.785532 L0.120865 0.858197 L0.188947 0.916734 L0.271008 0.953591 L0.357069 0.961214 L0.43715 0.932047 L0.501262 0.858539 L0.545656 0.648611 L0.329595 0.648131",H:"M0.066895 0.270996 L0.066895 0.94897 M0.066895 0.595658 L0.530009 0.595658 M0.535157 0.270996 L0.535157 0.94897",I:"M0.301026 0.270996 L0.301026 0.94897",J:"M0.506839 0.270996 L0.507814 0.782193 L0.498468 0.846168 L0.480733 0.880789 L0.455864 0.90832 L0.426095 0.929408 L0.360746 0.954812 L0.302508 0.962139 L0.223573 0.953638 L0.16538 0.930312 L0.137072 0.907715 L0.116428 0.880312 L0.102822 0.848819 L0.095633 0.813947 L0.094239 0.776413",K:"M0.035401 0.270996 L0.035401 0.94897 M0.502258 0.316194 L0.035401 0.687823 M0.212484 0.582361 L0.566652 0.933903",L:"M0.07544 0.270996 L0.07544 0.94897 L0.526613 0.94897",M:"M0.042481 0.94897 L0.042481 0.270996 L0.301027 0.712492 L0.559571 0.270996 L0.559571 0.94897",N:"M0.067871 0.94897 L0.067871 0.270996 L0.534181 0.94897 L0.525031 0.270996",O:"M0.287293 0.961214 L0.19843 0.933567 L0.1172 0.849451 L0.057129 0.563945 L0.114348 0.350255 L0.18455 0.289392 L0.306101 0.257813 L0.42054 0.29572 L0.487543 0.365003 L0.544923 0.625294 L0.516366 0.789624 L0.465476 0.884596 L0.375084 0.949287 L0.287293 0.961214",P:"M0.070557 0.94897 L0.070557 0.28379 L0.20704 0.270996 L0.329134 0.278993 L0.408525 0.300514 L0.444022 0.317908 L0.500637 0.368929 L0.525796 0.423728 L0.531496 0.50384 L0.508934 0.554205 L0.473724 0.582043 L0.417577 0.604365 L0.336375 0.620372 L0.226014 0.629268 L0.082368 0.630258",Q:"M0.282435 1.050813 L0.195447 1.019646 L0.115933 0.924817 L0.057129 0.602943 L0.113139 0.362034 L0.18186 0.293418 L0.300844 0.257813 L0.412868 0.300553 L0.478457 0.37866 L0.534625 0.672103 L0.506671 0.857367 L0.456855 0.964437 L0.368371 1.037368 L0.282435 1.050813 M0.341225 0.815559 L0.544923 1.070653",R:"M0.034912 0.944112 L0.034912 0.288556 L0.227127 0.270996 L0.362038 0.276867 L0.443423 0.294907 L0.477644 0.309614 L0.505809 0.328757 L0.526616 0.352817 L0.544963 0.418061 L0.543241 0.475921 L0.524463 0.517817 L0.49076 0.546518 L0.444265 0.564799 L0.355195 0.578739 L0.047653 0.589627 M0.303054 0.617306 L0.56714 0.94897",S:"M0.483037 0.364333 L0.407613 0.267477 L0.22883 0.257813 L0.128623 0.327565 L0.087712 0.455539 L0.104656 0.518727 L0.168054 0.573307 L0.41928 0.617318 L0.503796 0.669342 L0.535157 0.759324 L0.493846 0.900055 L0.367668 0.961214 L0.205436 0.956661 L0.116711 0.907038 L0.066895 0.790334",T:"M0.022949 0.270996 L0.579103 0.270996 M0.309284 0.270996 L0.309284 0.94897",U:"M0.072022 0.270996 L0.07308 0.648875 L0.080372 0.75167 L0.099024 0.827813 L0.134786 0.885729 L0.181571 0.924023 L0.251464 0.95168 L0.339655 0.962139 L0.401553 0.951668 L0.45232 0.924086 L0.482701 0.891771 L0.495745 0.870529 L0.515699 0.81637 L0.525014 0.744626 L0.530031 0.272017",V:"M0.027832 0.270996 L0.320083 0.94897 L0.57422 0.270996",W:"M0 0.270996 L0.079799 0.940377 L0.285198 0.472884 L0.505255 0.94897 L0.602052 0.270996",X:"M0.009034 0.270996 L0.586805 0.94897 M0.593019 0.270996 L0.015246 0.94897",Y:"M0.018067 0.270996 L0.293132 0.574135 M0.583986 0.271959 L0.294954 0.57606 L0.305277 0.94897",Z:"M0.053711 0.270996 L0.548341 0.270996 L0.053711 0.94897 L0.548341 0.94897","[":"M0.404542 0.240234 L0.197511 0.240234 L0.197511 1.069424 L0.404542 1.069424","\\":"M0.062501 0.270996 L0.539551 1.035249","]":"M0.19751 0.240234 L0.404542 0.240234 L0.404542 1.069424 L0.19751 1.069424","^":"M0.035156 0.523931 L0.301024 0.270996 L0.566896 0.523931",_:"M0 1.160601 L0.602052 1.160601",a:"M0.527101 0.439941 L0.527101 0.973965 M0.527101 0.553824 L0.451366 0.477535 L0.376759 0.439941 L0.263722 0.439941 L0.187989 0.477535 L0.112255 0.553824 L0.074951 0.66881 L0.074951 0.745099 L0.112255 0.85898 L0.187989 0.93527 L0.263722 0.973965 L0.376759 0.973965 L0.451366 0.93527 L0.527101 0.85898",b:"M0.07666 0.240234 L0.07666 0.959985 M0.07666 0.582737 L0.151822 0.514237 L0.225865 0.480483 L0.338045 0.480483 L0.413211 0.514237 L0.488374 0.582737 L0.525392 0.685983 L0.525392 0.754485 L0.488374 0.856739 L0.413211 0.92524 L0.338045 0.959985 L0.225865 0.959985 L0.151822 0.92524 L0.07666 0.856739",c:"M0.512452 0.553823 L0.441624 0.477535 L0.371854 0.439941 L0.26614 0.439941 L0.195312 0.477535 L0.124486 0.553823 L0.0896 0.668808 L0.0896 0.745099 L0.124486 0.858979 L0.195312 0.93527 L0.26614 0.973965 L0.371854 0.973965 L0.441624 0.93527 L0.512452 0.858979",d:"M0.525392 0.240234 L0.525392 0.959985 M0.525392 0.582737 L0.450232 0.514237 L0.376189 0.480483 L0.264006 0.480483 L0.188844 0.514237 L0.11368 0.582737 L0.076661 0.685983 L0.076661 0.754485 L0.11368 0.856739 L0.188844 0.92524 L0.264006 0.959985 L0.376189 0.959985 L0.450232 0.92524 L0.525392 0.856739",e:"M0.059571 0.668808 L0.542482 0.668808 M0.542482 0.592521 L0.502641 0.516231 L0.461594 0.477535 L0.381914 0.439941 L0.261186 0.439941 L0.180299 0.477535 L0.099412 0.553823 L0.059571 0.668808 L0.059571 0.745099 L0.099412 0.858979 L0.180299 0.93527 L0.261186 0.973965 L0.381914 0.973965 L0.461594 0.93527 L0.542482 0.858979",f:"M0.512941 0.240234 L0.406984 0.240234 L0.301026 0.274346 L0.248047 0.374731 L0.248047 0.946817 M0.089112 0.476088 L0.459965 0.476088",g:"M0.525392 0.439941 L0.525392 0.989395 L0.488373 1.091918 L0.45023 1.126757 L0.376189 1.160601 L0.264004 1.160601 L0.188844 1.126757 L0.113681 1.058075 L0.076661 0.954555 M0.525392 0.542467 L0.45023 0.473786 L0.376189 0.439941 L0.264004 0.439941 L0.188844 0.473786 L0.113681 0.542467 L0.076661 0.645988 L0.076661 0.714669 L0.113681 0.817193 L0.188844 0.885875 L0.264004 0.920713 L0.376189 0.920713 L0.45023 0.885875 L0.525392 0.817193",h:"M0.092041 0.240234 L0.092041 0.946817 M0.092041 0.61058 L0.205937 0.509225 L0.282214 0.476086 L0.396109 0.476086 L0.47187 0.509225 L0.510011 0.61058 L0.510011 0.946817",i:"M0.261026 0.240234 L0.341026 0.240234 M0.300978 0.476089 L0.300978 0.946817",j:"M0.3853 0.240234 L0.447023 0.240234 M0.416159 0.465708 L0.416159 1.011689 L0.383887 1.108586 L0.252832 1.140264 L0.15503 1.108586",k:"M0.065186 0.240234 L0.065186 0.946817 M0.493824 0.476086 L0.065186 0.812323 M0.236758 0.677829 L0.536867 0.946817",l:"M0.301026 0.234863 L0.301026 0.946441",m:"M0.050538 0.439941 L0.050538 0.960796 M0.050538 0.588758 L0.114405 0.476607 L0.157178 0.439941 L0.236864 0.439941 L0.279637 0.476607 L0.32241 0.588758 L0.32241 0.960796 M0.32241 0.588758 L0.386281 0.476607 L0.428467 0.439941 L0.50874 0.439941 L0.551515 0.476607 L0.551515 0.960796",n:"M0.092041 0.439941 L0.092041 0.960796 M0.092041 0.588758 L0.205936 0.476607 L0.282216 0.439941 L0.396113 0.439941 L0.471871 0.476607 L0.510011 0.588758 L0.510011 0.960796",o:"M0.247175 0.439941 L0.175178 0.477535 L0.103186 0.553823 L0.066895 0.668808 L0.066895 0.745099 L0.103186 0.858979 L0.175178 0.93527 L0.247175 0.973965 L0.354874 0.973965 L0.426872 0.93527 L0.498866 0.858979 L0.535157 0.745099 L0.535157 0.668808 L0.498866 0.553823 L0.426872 0.477535 L0.354874 0.439941 L0.247175 0.439941",p:"M0.076904 0.439941 L0.076904 1.154244 M0.076904 0.541563 L0.151986 0.473487 L0.225944 0.439941 L0.338005 0.439941 L0.413087 0.473487 L0.488166 0.541563 L0.525148 0.644169 L0.525148 0.712246 L0.488166 0.813866 L0.413087 0.881942 L0.338005 0.916471 L0.225944 0.916471 L0.151986 0.881942 L0.076904 0.813866",q:"M0.525148 0.441895 L0.525148 1.156195 M0.525148 0.5435 L0.450067 0.47544 L0.376106 0.441895 L0.264042 0.441895 L0.188966 0.47544 L0.113885 0.5435 L0.076905 0.646108 L0.076905 0.714187 L0.113885 0.815809 L0.188966 0.883886 L0.264042 0.918418 L0.376106 0.918418 L0.450067 0.883886 L0.525148 0.815809",r:"M0.107422 0.439941 L0.107422 0.960796 M0.107422 0.663164 L0.155824 0.551014 L0.252626 0.476607 L0.349428 0.439941 L0.49463 0.439941",s:"M0.475556 0.477535 L0.400757 0.439941 L0.276092 0.439941 L0.176361 0.477535 L0.101563 0.553823 L0.101563 0.630112 L0.176361 0.668808 L0.301024 0.668808 L0.425688 0.745099 L0.50049 0.821387 L0.50049 0.897677 L0.425688 0.93527 L0.325956 0.973965 L0.201295 0.973965 L0.126496 0.93527 L0.101563 0.858979",t:"M0.246032 0.297852 L0.246032 0.826549 L0.301023 0.919323 L0.411011 0.950848 L0.520997 0.950848 M0.081055 0.515799 L0.466004 0.515799",u:"M0.092041 0.454102 L0.092041 0.826134 L0.13018 0.937211 L0.205936 0.974954 L0.319832 0.974954 L0.396113 0.937211 L0.510011 0.826134 M0.510011 0.454102 L0.510011 0.974954",v:"M0.048828 0.453125 L0.301026 0.961719 M0.553224 0.453125 L0.301026 0.961719",w:"M0 0.453125 L0.150512 0.961719 M0.301024 0.453125 L0.150512 0.961719 M0.301024 0.453125 L0.451539 0.961719 M0.602052 0.453125 L0.451539 0.961719",x:"M0.03711 0.453125 L0.564943 0.961719 M0.564943 0.453125 L0.03711 0.961719",y:"M0.084618 0.453125 L0.320232 0.921476 M0.55713 0.453125 L0.320232 0.921476 L0.242119 1.055289 L0.163369 1.122196 L0.084618 1.155166 L0.044922 1.155166",z:"M0.505373 0.452148 L0.09668 0.961651 M0.09668 0.452148 L0.505373 0.452148 M0.09668 0.961651 L0.505373 0.961651"},KAn={};for(let e in jAn){KAn[e]=[];let t=jAn[e].split("M").slice(1).map((n)=>n.split("L").map((o)=>o.trim().split(" ").map(parseFloat)));for(let n of t)for(let o=0;o<n.length-1;o++)KAn[e].push({x1:n[o][0],y1:1-n[o][1],x2:n[o+1][0],y2:1-n[o+1][1]})}(()=>{let e=new Uint8Array(4);new Uint32Array(e.buffer)[0]=1,e[0]})(),globalThis.Int8Array,globalThis.Uint8Array,globalThis.Int16Array,globalThis.Uint16Array,globalThis.Int32Array,globalThis.Uint32Array,globalThis.BigUint64Array,globalThis.BigInt64Array,globalThis.Float32Array,globalThis.Float64Array;var AGr=[];for(let e=0;e<256;e++){let t=e;for(let n=0;n<8;n++)1&t?t=3988292384^t>>>1:t>>>=1;AGr[e]=t}var fGr=new Uint16Array([255]),yGr=(new Uint8Array(fGr.buffer)[0],new Uint16Array([255]));new Uint8Array(yGr.buffer)[0],new Uint8Array(0),Uint8Array.of(137,80,78,71,13,10,26,10),new TextDecoder("latin1");function n5(){return n5=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)({}).hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},n5.apply(null,arguments)}function g8e(e,t){return(g8e=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n})(e,t)}function lCn(e){return(lCn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(e)}function hCn(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(hCn=function(){return!!e})()}function Zot(e){var t=typeof Map=="function"?new Map:void 0;return Zot=function(n){if(n===null||!function(r){try{return Function.toString.call(r).indexOf("[native code]")!==-1}catch(i){return typeof r=="function"}}(n))return n;if(typeof n!="function")throw TypeError("Super expression must either be null or a function");if(t!==void 0){if(t.has(n))return t.get(n);t.set(n,o)}function o(){return function(r,i,s){if(hCn())return Reflect.construct.apply(null,arguments);var a=[null];a.push.apply(a,i);var c=new(r.bind.apply(r,a));return s&&g8e(c,s.prototype),c}(n,arguments,lCn(this).constructor)}return o.prototype=Object.create(n.prototype,{constructor:{value:o,enumerable:!1,writable:!0,configurable:!0}}),g8e(o,n)},Zot(e)}var xGr={1:`Passed invalid arguments to hsl, please pass multiple numbers e.g. hsl(360, 0.75, 0.4) or an object e.g. rgb({ hue: 255, saturation: 0.4, lightness: 0.75 }).

`,2:`Passed invalid arguments to hsla, please pass multiple numbers e.g. hsla(360, 0.75, 0.4, 0.7) or an object e.g. rgb({ hue: 255, saturation: 0.4, lightness: 0.75, alpha: 0.7 }).

`,3:`Passed an incorrect argument to a color function, please pass a string representation of a color.

`,4:`Couldn't generate valid rgb string from %s, it returned %s.

`,5:`Couldn't parse the color string. Please provide the color as a string in hex, rgb, rgba, hsl or hsla notation.

`,6:`Passed invalid arguments to rgb, please pass multiple numbers e.g. rgb(255, 205, 100) or an object e.g. rgb({ red: 255, green: 205, blue: 100 }).

`,7:`Passed invalid arguments to rgba, please pass multiple numbers e.g. rgb(255, 205, 100, 0.75) or an object e.g. rgb({ red: 255, green: 205, blue: 100, alpha: 0.75 }).

`,8:`Passed invalid argument to toColorString, please pass a RgbColor, RgbaColor, HslColor or HslaColor object.

`,9:`Please provide a number of steps to the modularScale helper.

`,10:`Please pass a number or one of the predefined scales to the modularScale helper as the ratio.

`,11:`Invalid value passed as base to modularScale, expected number or em string but got "%s"

`,12:`Expected a string ending in "px" or a number passed as the first argument to %s(), got "%s" instead.

`,13:`Expected a string ending in "px" or a number passed as the second argument to %s(), got "%s" instead.

`,14:`Passed invalid pixel value ("%s") to %s(), please pass a value like "12px" or 12.

`,15:`Passed invalid base value ("%s") to %s(), please pass a value like "12px" or 12.

`,16:`You must provide a template to this method.

`,17:`You passed an unsupported selector state to this method.

`,18:`minScreen and maxScreen must be provided as stringified numbers with the same units.

`,19:`fromSize and toSize must be provided as stringified numbers with the same units.

`,20:`expects either an array of objects or a single object with the properties prop, fromSize, and toSize.

`,21:"expects the objects in the first argument array to have the properties `prop`, `fromSize`, and `toSize`.\n\n",22:"expects the first argument object to have the properties `prop`, `fromSize`, and `toSize`.\n\n",23:`fontFace expects a name of a font-family.

`,24:`fontFace expects either the path to the font file(s) or a name of a local copy.

`,25:`fontFace expects localFonts to be an array.

`,26:`fontFace expects fileFormats to be an array.

`,27:`radialGradient requries at least 2 color-stops to properly render.

`,28:`Please supply a filename to retinaImage() as the first argument.

`,29:`Passed invalid argument to triangle, please pass correct pointingDirection e.g. 'right'.

`,30:"Passed an invalid value to `height` or `width`. Please provide a pixel based unit.\n\n",31:`The animation shorthand only takes 8 arguments. See the specification for more information: http://mdn.io/animation

`,32:`To pass multiple animations please supply them in arrays, e.g. animation(['rotate', '2s'], ['move', '1s'])
To pass a single animation please supply them in simple values, e.g. animation('rotate', '2s')

`,33:`The animation shorthand arrays can only have 8 elements. See the specification for more information: http://mdn.io/animation

`,34:`borderRadius expects a radius value as a string or number as the second argument.

`,35:`borderRadius expects one of "top", "bottom", "left" or "right" as the first argument.

`,36:`Property must be a string value.

`,37:`Syntax Error at %s.

`,38:`Formula contains a function that needs parentheses at %s.

`,39:`Formula is missing closing parenthesis at %s.

`,40:`Formula has too many closing parentheses at %s.

`,41:`All values in a formula must have the same unit or be unitless.

`,42:`Please provide a number of steps to the modularScale helper.

`,43:`Please pass a number or one of the predefined scales to the modularScale helper as the ratio.

`,44:`Invalid value passed as base to modularScale, expected number or em/rem string but got %s.

`,45:`Passed invalid argument to hslToColorString, please pass a HslColor or HslaColor object.

`,46:`Passed invalid argument to rgbToColorString, please pass a RgbColor or RgbaColor object.

`,47:`minScreen and maxScreen must be provided as stringified numbers with the same units.

`,48:`fromSize and toSize must be provided as stringified numbers with the same units.

`,49:`Expects either an array of objects or a single object with the properties prop, fromSize, and toSize.

`,50:`Expects the objects in the first argument array to have the properties prop, fromSize, and toSize.

`,51:`Expects the first argument object to have the properties prop, fromSize, and toSize.

`,52:`fontFace expects either the path to the font file(s) or a name of a local copy.

`,53:`fontFace expects localFonts to be an array.

`,54:`fontFace expects fileFormats to be an array.

`,55:`fontFace expects a name of a font-family.

`,56:`linearGradient requries at least 2 color-stops to properly render.

`,57:`radialGradient requries at least 2 color-stops to properly render.

`,58:`Please supply a filename to retinaImage() as the first argument.

`,59:`Passed invalid argument to triangle, please pass correct pointingDirection e.g. 'right'.

`,60:"Passed an invalid value to `height` or `width`. Please provide a pixel based unit.\n\n",61:`Property must be a string value.

`,62:`borderRadius expects a radius value as a string or number as the second argument.

`,63:`borderRadius expects one of "top", "bottom", "left" or "right" as the first argument.

`,64:`The animation shorthand only takes 8 arguments. See the specification for more information: http://mdn.io/animation.

`,65:`To pass multiple animations please supply them in arrays, e.g. animation(['rotate', '2s'], ['move', '1s'])\\nTo pass a single animation please supply them in simple values, e.g. animation('rotate', '2s').

`,66:`The animation shorthand arrays can only have 8 elements. See the specification for more information: http://mdn.io/animation.

`,67:`You must provide a template to this method.

`,68:`You passed an unsupported selector state to this method.

`,69:`Expected a string ending in "px" or a number passed as the first argument to %s(), got %s instead.

`,70:`Expected a string ending in "px" or a number passed as the second argument to %s(), got %s instead.

`,71:`Passed invalid pixel value %s to %s(), please pass a value like "12px" or 12.

`,72:`Passed invalid base value %s to %s(), please pass a value like "12px" or 12.

`,73:`Please provide a valid CSS variable.

`,74:`CSS variable not found and no default was provided.

`,75:`important requires a valid style object, got a %s instead.

`,76:`fromSize and toSize must be provided as stringified numbers with the same units as minScreen and maxScreen.

`,77:`remToPx expects a value in "rem" but you provided it in "%s".

`,78:`base must be set in "px" or "%" but you set it in "%s".
`};function CGr(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];var o,r=t[0],i=[];for(o=1;o<t.length;o+=1)i.push(t[o]);return i.forEach(function(s){r=r.replace(/%[a-z]/,s)}),r}var Jx=function(e){var t,n;function o(r){var i;for(var s=arguments.length,a=Array(s>1?s-1:0),c=1;c<s;c++)a[c-1]=arguments[c];return i=e.call(this,CGr.apply(void 0,[xGr[r]].concat(a)))||this,function(l){if(l===void 0)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return l}(i)}return n=e,(t=o).prototype=Object.create(n.prototype),t.prototype.constructor=t,g8e(t,n),o}(Zot(Error));function $An(e,t){return e.substr(-t.length)===t}var bGr=/^([+-]?(?:\d+|\d*\.\d+))([a-z]*|%)$/;function qAn(e){return typeof e!="string"?e:e.match(bGr)?parseFloat(e):e}var JAn=function(e){return function(t,n){n===void 0&&(n="16px");var o=t,r=n;if(typeof t=="string"){if(!$An(t,"px"))throw new Jx(69,e,t);o=qAn(t)}if(typeof n=="string"){if(!$An(n,"px"))throw new Jx(70,e,n);r=qAn(n)}if(typeof o=="string")throw new Jx(71,t,e);if(typeof r=="string")throw new Jx(72,n,e);return""+o/r+e}};JAn("em"),JAn("rem");function Ktt(e){return Math.round(255*e)}function IGr(e,t,n){return Ktt(e)+","+Ktt(t)+","+Ktt(n)}function Yde(e,t,n,o){if(o===void 0&&(o=IGr),t===0)return o(n,n,n);var r=(e%360+360)%360/60,i=(1-Math.abs(2*n-1))*t,s=i*(1-Math.abs(r%2-1)),a=0,c=0,l=0;r>=0&&r<1?(a=i,c=s):r>=1&&r<2?(a=s,c=i):r>=2&&r<3?(c=i,l=s):r>=3&&r<4?(c=s,l=i):r>=4&&r<5?(a=s,l=i):r>=5&&r<6&&(a=i,l=s);var h=n-i/2;return o(a+h,c+h,l+h)}var ZAn={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"00ffff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"0000ff",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"00ffff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"ff00ff",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"639",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},vGr=/^#[a-fA-F0-9]{6}$/,SGr=/^#[a-fA-F0-9]{8}$/,PGr=/^#[a-fA-F0-9]{3}$/,EGr=/^#[a-fA-F0-9]{4}$/,$tt=/^rgb\(\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*\)$/i,MGr=/^rgb(?:a)?\(\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,|\/)\s*([-+]?\d*[.]?\d+[%]?)\s*\)$/i,wGr=/^hsl\(\s*(\d{0,3}[.]?[0-9]+(?:deg)?)\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*\)$/i,BGr=/^hsl(?:a)?\(\s*(\d{0,3}[.]?[0-9]+(?:deg)?)\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*(?:,|\/)\s*([-+]?\d*[.]?\d+[%]?)\s*\)$/i;function ZJ(e){if(typeof e!="string")throw new Jx(3);var t=function(u){if(typeof u!="string")return u;var _=u.toLowerCase();return ZAn[_]?"#"+ZAn[_]:u}(e);if(t.match(vGr))return{red:parseInt(""+t[1]+t[2],16),green:parseInt(""+t[3]+t[4],16),blue:parseInt(""+t[5]+t[6],16)};if(t.match(SGr)){var n=parseFloat((parseInt(""+t[7]+t[8],16)/255).toFixed(2));return{red:parseInt(""+t[1]+t[2],16),green:parseInt(""+t[3]+t[4],16),blue:parseInt(""+t[5]+t[6],16),alpha:n}}if(t.match(PGr))return{red:parseInt(""+t[1]+t[1],16),green:parseInt(""+t[2]+t[2],16),blue:parseInt(""+t[3]+t[3],16)};if(t.match(EGr)){var o=parseFloat((parseInt(""+t[4]+t[4],16)/255).toFixed(2));return{red:parseInt(""+t[1]+t[1],16),green:parseInt(""+t[2]+t[2],16),blue:parseInt(""+t[3]+t[3],16),alpha:o}}var r=$tt.exec(t);if(r)return{red:parseInt(""+r[1],10),green:parseInt(""+r[2],10),blue:parseInt(""+r[3],10)};var i=MGr.exec(t.substring(0,50));if(i)return{red:parseInt(""+i[1],10),green:parseInt(""+i[2],10),blue:parseInt(""+i[3],10),alpha:parseFloat(""+i[4])>1?parseFloat(""+i[4])/100:parseFloat(""+i[4])};var s=wGr.exec(t);if(s){var a="rgb("+Yde(parseInt(""+s[1],10),parseInt(""+s[2],10)/100,parseInt(""+s[3],10)/100)+")",c=$tt.exec(a);if(!c)throw new Jx(4,t,a);return{red:parseInt(""+c[1],10),green:parseInt(""+c[2],10),blue:parseInt(""+c[3],10)}}var l=BGr.exec(t.substring(0,50));if(l){var h="rgb("+Yde(parseInt(""+l[1],10),parseInt(""+l[2],10)/100,parseInt(""+l[3],10)/100)+")",d=$tt.exec(h);if(!d)throw new Jx(4,t,h);return{red:parseInt(""+d[1],10),green:parseInt(""+d[2],10),blue:parseInt(""+d[3],10),alpha:parseFloat(""+l[4])>1?parseFloat(""+l[4])/100:parseFloat(""+l[4])}}throw new Jx(5)}function Ok(e){return function(t){var n,o=t.red/255,r=t.green/255,i=t.blue/255,s=Math.max(o,r,i),a=Math.min(o,r,i),c=(s+a)/2;if(s===a)return t.alpha!==void 0?{hue:0,saturation:0,lightness:c,alpha:t.alpha}:{hue:0,saturation:0,lightness:c};var l=s-a,h=c>0.5?l/(2-s-a):l/(s+a);switch(s){case o:n=(r-i)/l+(r<i?6:0);break;case r:n=(i-o)/l+2;break;default:n=(o-r)/l+4}return n*=60,t.alpha!==void 0?{hue:n,saturation:h,lightness:c,alpha:t.alpha}:{hue:n,saturation:h,lightness:c}}(ZJ(e))}var ert=function(e){return e.length===7&&e[1]===e[2]&&e[3]===e[4]&&e[5]===e[6]?"#"+e[1]+e[3]+e[5]:e};function oY(e){var t=e.toString(16);return t.length===1?"0"+t:t}function qtt(e){return oY(Math.round(255*e))}function TGr(e,t,n){return ert("#"+qtt(e)+qtt(t)+qtt(n))}function L9e(e,t,n){return Yde(e,t,n,TGr)}function trt(e,t,n){if(typeof e=="number"&&typeof t=="number"&&typeof n=="number")return ert("#"+oY(e)+oY(t)+oY(n));if(typeof e=="object"&&t===void 0&&n===void 0)return ert("#"+oY(e.red)+oY(e.green)+oY(e.blue));throw new Jx(6)}function S7e(e,t,n,o){if(typeof e=="string"&&typeof t=="number"){var r=ZJ(e);return"rgba("+r.red+","+r.green+","+r.blue+","+t+")"}if(typeof e=="number"&&typeof t=="number"&&typeof n=="number"&&typeof o=="number")return o>=1?trt(e,t,n):"rgba("+e+","+t+","+n+","+o+")";if(typeof e=="object"&&t===void 0&&n===void 0&&o===void 0)return e.alpha>=1?trt(e.red,e.green,e.blue):"rgba("+e.red+","+e.green+","+e.blue+","+e.alpha+")";throw new Jx(7)}function Vk(e){if(typeof e!="object")throw new Jx(8);if(function(t){return typeof t.red=="number"&&typeof t.green=="number"&&typeof t.blue=="number"&&typeof t.alpha=="number"}(e))return S7e(e);if(function(t){return typeof t.red=="number"&&typeof t.green=="number"&&typeof t.blue=="number"&&(typeof t.alpha!="number"||t.alpha===void 0)}(e))return trt(e);if(function(t){return typeof t.hue=="number"&&typeof t.saturation=="number"&&typeof t.lightness=="number"&&typeof t.alpha=="number"}(e))return function(t,n,o,r){if(typeof t=="number"&&typeof n=="number"&&typeof o=="number"&&typeof r=="number")return r>=1?L9e(t,n,o):"rgba("+Yde(t,n,o)+","+r+")";if(typeof t=="object"&&n===void 0&&o===void 0&&r===void 0)return t.alpha>=1?L9e(t.hue,t.saturation,t.lightness):"rgba("+Yde(t.hue,t.saturation,t.lightness)+","+t.alpha+")";throw new Jx(2)}(e);if(function(t){return typeof t.hue=="number"&&typeof t.saturation=="number"&&typeof t.lightness=="number"&&(typeof t.alpha!="number"||t.alpha===void 0)}(e))return function(t,n,o){if(typeof t=="number"&&typeof n=="number"&&typeof o=="number")return L9e(t,n,o);if(typeof t=="object"&&n===void 0&&o===void 0)return L9e(t.hue,t.saturation,t.lightness);throw new Jx(1)}(e);throw new Jx(8)}function dCn(e,t,n){return function(){var o=n.concat(Array.prototype.slice.call(arguments));return o.length>=t?e.apply(this,o):dCn(e,t,o)}}function r3(e){return dCn(e,e.length,[])}r3(function(e,t){if(t==="transparent")return t;var n=Ok(t);return Vk(n5({},n,{hue:n.hue+parseFloat(e)}))});function SZ(e,t,n){return Math.max(e,Math.min(t,n))}r3(function(e,t){if(t==="transparent")return t;var n=Ok(t);return Vk(n5({},n,{lightness:SZ(0,1,n.lightness-parseFloat(e))}))});r3(function(e,t){if(t==="transparent")return t;var n=Ok(t);return Vk(n5({},n,{saturation:SZ(0,1,n.saturation-parseFloat(e))}))});r3(function(e,t){if(t==="transparent")return t;var n=Ok(t);return Vk(n5({},n,{lightness:SZ(0,1,n.lightness+parseFloat(e))}))});var uCn=r3(function(e,t,n){if(t==="transparent")return n;if(n==="transparent")return t;if(e===0)return n;var o=ZJ(t),r=n5({},o,{alpha:typeof o.alpha=="number"?o.alpha:1}),i=ZJ(n),s=n5({},i,{alpha:typeof i.alpha=="number"?i.alpha:1}),a=r.alpha-s.alpha,c=2*parseFloat(e)-1,l=((c*a===-1?c:c+a)/(1+c*a)+1)/2,h=1-l;return S7e({red:Math.floor(r.red*l+s.red*h),green:Math.floor(r.green*l+s.green*h),blue:Math.floor(r.blue*l+s.blue*h),alpha:r.alpha*parseFloat(e)+s.alpha*(1-parseFloat(e))})});r3(function(e,t){if(t==="transparent")return t;var n=ZJ(t);return S7e(n5({},n,{alpha:SZ(0,1,(100*(typeof n.alpha=="number"?n.alpha:1)+100*parseFloat(e))/100)}))});r3(function(e,t){if(t==="transparent")return t;var n=Ok(t);return Vk(n5({},n,{saturation:SZ(0,1,n.saturation+parseFloat(e))}))});r3(function(e,t){return t==="transparent"?t:Vk(n5({},Ok(t),{hue:parseFloat(e)}))});r3(function(e,t){return t==="transparent"?t:Vk(n5({},Ok(t),{lightness:parseFloat(e)}))});r3(function(e,t){return t==="transparent"?t:Vk(n5({},Ok(t),{saturation:parseFloat(e)}))});r3(function(e,t){return t==="transparent"?t:uCn(parseFloat(e),"rgb(0, 0, 0)",t)});r3(function(e,t){return t==="transparent"?t:uCn(parseFloat(e),"rgb(255, 255, 255)",t)});var MXs=r3(function(e,t){if(t==="transparent")return t;var n=ZJ(t);return S7e(n5({},n,{alpha:SZ(0,1,+(100*(typeof n.alpha=="number"?n.alpha:1)-100*parseFloat(e)).toFixed(2)/100)}))}),{cos:wXs,sin:BXs,PI:TXs}=Math,{tan:DXs}=Math,NXs=(Jot(rGr()),Jot(cGr()),(e,t)=>({...e,rects:[...e.rects??[],...t.rects??[]],points:[...e.points??[],...t.points??[]],lines:[...e.lines??[],...t.lines??[]],infiniteLines:[...e.infiniteLines??[],...t.infiniteLines??[]],polygons:[...e.polygons??[],...t.polygons??[]],circles:[...e.circles??[],...t.circles??[]],arrows:[...e.arrows??[],...t.arrows??[]],texts:[...e.texts??[],...t.texts??[]]}));function Jtt(e,t){if(e.points)for(let n of e.points)n.step=t;if(e.lines)for(let n of e.lines)n.step=t;if(e.infiniteLines)for(let n of e.infiniteLines)n.step=t;if(e.polygons)for(let n of e.polygons)n.step=t;if(e.rects)for(let n of e.rects)n.step=t;if(e.circles)for(let n of e.circles)n.step=t;if(e.texts)for(let n of e.texts)n.step=t;if(e.arrows)for(let n of e.arrows)n.step=t;return e}var IB=class{MAX_ITERATIONS=1e5;solved=!1;failed=!1;iterations=0;progress=0;error=null;activeSubSolver;failedSubSolvers;timeToSolve;stats={};_setupDone=!1;getSolverName(){return this.constructor.name}setup(){this._setupDone||(this._setup(),this._setupDone=!0)}_setup(){}step(){if(this._setupDone||this.setup(),!this.solved&&!this.failed){this.iterations++;try{this._step()}catch(e){throw this.error=`${this.getSolverName()} error: ${e}`,this.failed=!0,e}!this.solved&&this.iterations>=this.MAX_ITERATIONS&&this.tryFinalAcceptance(),!this.solved&&this.iterations>=this.MAX_ITERATIONS&&(this.error=`${this.getSolverName()} ran out of iterations`,this.failed=!0),"computeProgress"in this&&(this.progress=this.computeProgress())}}_step(){}getConstructorParams(){throw Error("getConstructorParams not implemented")}getOutput(){return null}solve(){let e=Date.now();for(;!this.solved&&!this.failed;)this.step();let t=Date.now();this.timeToSolve=t-e}visualize(){return{lines:[],points:[],rects:[],circles:[]}}tryFinalAcceptance(){}preview(){return{lines:[],points:[],rects:[],circles:[]}}};function kJ(e,t,n,o={}){return{solverName:e,solverClass:t,getConstructorParams:n,onSolved:o.onSolved}}var pCn=class extends IB{startTimeOfStage={};endTimeOfStage={};timeSpentOnStage={};firstIterationOfStage={};currentPipelineStageIndex=0;inputProblem;pipelineOutputs={};constructor(e){super(),this.inputProblem=e,this.MAX_ITERATIONS=1e6}_step(){let e=this.pipelineDef[this.currentPipelineStageIndex];if(!e)return void(this.solved=!0);if(this.activeSubSolver){if(this.activeSubSolver.step(),this.activeSubSolver.solved){this.endTimeOfStage[e.solverName]=performance.now(),this.timeSpentOnStage[e.solverName]=this.endTimeOfStage[e.solverName]-this.startTimeOfStage[e.solverName];let n=this.activeSubSolver.getOutput();n!==null&&(this.pipelineOutputs[e.solverName]=n),e.onSolved?.(this),this.activeSubSolver=null,this.currentPipelineStageIndex++}else this.activeSubSolver.failed&&(this.error=this.activeSubSolver?.error,this.failed=!0,this.activeSubSolver=null);return}let t=e.getConstructorParams(this);this.activeSubSolver=new e.solverClass(...t),this[e.solverName]=this.activeSubSolver,this.timeSpentOnStage[e.solverName]=0,this.startTimeOfStage[e.solverName]=performance.now(),this.firstIterationOfStage[e.solverName]=this.iterations}solveUntilStage(e){for(;this.getCurrentStageName().toLowerCase()!==e.toLowerCase()&&(this.step(),!this.failed&&!this.solved););}getCurrentStageName(){return this.pipelineDef[this.currentPipelineStageIndex]?.solverName??"none"}getStageProgress(){let e=this.pipelineDef.length;if(e===0)return 1;let t=this.activeSubSolver?.progress??0;return(this.currentPipelineStageIndex+t)/e}getStageStats(){let e={};for(let t of this.pipelineDef){let n=this.timeSpentOnStage[t.solverName]||0,o=this.firstIterationOfStage[t.solverName]||0,r=this.iterations,i=t.solverName===this.getCurrentStageName()?r-o:0,s=this.currentPipelineStageIndex>this.pipelineDef.findIndex((a)=>a.solverName===t.solverName);e[t.solverName]={timeSpent:n,iterations:i,completed:s}}return e}initialVisualize(){return null}finalVisualize(){return null}visualize(){if(!this.solved&&this.activeSubSolver)return this.activeSubSolver.visualize();let e=0,t=this.initialVisualize();t&&(Jtt(t,0),e=1);let n=null;this.solved&&(n=this.finalVisualize());let o=[t].filter(Boolean).concat(this.pipelineDef.map((r,i)=>{let s=this[r.solverName],a=s?.visualize();return a?(Jtt(a,i+e),a):null}).filter(Boolean));return o.length===0?{points:[],rects:[],lines:[],circles:[],texts:[]}:(this.solved&&n&&(Jtt(n,o.length+e+1),o.push(n)),o.length===1?o[0]:{points:o.flatMap((r)=>r.points||[]),rects:o.flatMap((r)=>r.rects||[]),lines:o.flatMap((r)=>r.lines||[]),circles:o.flatMap((r)=>r.circles||[]),texts:o.flatMap((r)=>r.texts||[])})}preview(){return this.activeSubSolver?this.activeSubSolver.preview():super.preview()}computeProgress(){return this.getStageProgress()}getStageOutput(e){return this.pipelineOutputs[e]}getAllOutputs(){return{...this.pipelineOutputs}}hasStageOutput(e){return e in this.pipelineOutputs}getSolver(e){return this[e]}},DGr=class{constructor(e=1/0,t=Float64Array,n=Uint32Array){let o=e!==1/0;this.ids=o?new n(e):[],this.values=o?new t(e):[],this.capacity=e,this.length=0}clear(){this.length=0}push(e,t){if(this.length===this.capacity)throw RangeError("Queue is at capacity.");let n=this.length++;for(;n>0;){let o=n-1>>1,r=this.values[o];if(t>=r)break;this.ids[n]=this.ids[o],this.values[n]=r,n=o}this.ids[n]=e,this.values[n]=t}pop(){if(this.length===0)return;let e=this.ids,t=this.values,n=e[0],o=--this.length;if(o>0){let r=e[o],i=t[o],s=0,a=o>>1;for(;s<a;){let c=1+(s<<1),l=c+1,h=c+(+(l<o)&+(t[l]<t[c]));if(t[h]>=i)break;e[s]=e[h],t[s]=t[h],s=h}e[s]=r,t[s]=i}return n}peek(){return this.length>0?this.ids[0]:void 0}peekValue(){return this.length>0?this.values[0]:void 0}shrink(){Array.isArray(this.ids)&&(this.ids.length=this.length),Array.isArray(this.values)&&(this.values.length=this.length)}},efn=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],mCn=class e{static from(t,n=0){if(n%8!=0)throw Error("byteOffset must be 8-byte aligned.");if(!t||t.byteLength===void 0||"buffer"in t)throw Error("Data must be an instance of ArrayBuffer or SharedArrayBuffer.");let[o,r]=new Uint8Array(t,n+0,2);if(o!==251)throw Error("Data does not appear to be in a Flatbush format.");let i=r>>4;if(i!==3)throw Error(`Got v${i} data when expected v3.`);let s=efn[15&r];if(!s)throw Error("Unrecognized array type.");let[a]=new Uint16Array(t,n+2,1),[c]=new Uint32Array(t,n+4,1);return new e(c,a,s,void 0,t,n)}constructor(t,n=16,o=Float64Array,r=ArrayBuffer,i,s=0){if(t===void 0)throw Error("Missing required argument: numItems.");if(isNaN(t)||t<=0)throw Error(`Unexpected numItems value: ${t}.`);this.numItems=+t,this.nodeSize=Math.min(Math.max(+n,2),65535),this.byteOffset=s;let a=t,c=a;this._levelBounds=[4*a];do a=Math.ceil(a/this.nodeSize),c+=a,this._levelBounds.push(4*c);while(a!==1);this.ArrayType=o,this.IndexArrayType=c<16384?Uint16Array:Uint32Array;let l=efn.indexOf(o),h=4*c*o.BYTES_PER_ELEMENT;if(l<0)throw Error(`Unexpected typed array class: ${o}.`);let d=o,u=this.IndexArrayType;if(i)this.data=i,this._boxes=new d(i,s+8,4*c),this._indices=new u(i,s+8+h,c),this._pos=4*c,this.minX=this._boxes[this._pos-4],this.minY=this._boxes[this._pos-3],this.maxX=this._boxes[this._pos-2],this.maxY=this._boxes[this._pos-1];else{let _=this.data=new r(8+h+c*this.IndexArrayType.BYTES_PER_ELEMENT);this._boxes=new d(_,8,4*c),this._indices=new u(_,8+h,c),this._pos=0,this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0,new Uint8Array(_,0,2).set([251,48+l]),new Uint16Array(_,2,1)[0]=n,new Uint32Array(_,4,1)[0]=t}this._queue=new DGr}add(t,n,o=t,r=n){let i=this._pos,s=i>>2,a=this._boxes;return this._indices[s]=s,a[i]=t,a[i+1]=n,a[i+2]=o,a[i+3]=r,this._pos=i+4,t<this.minX&&(this.minX=t),n<this.minY&&(this.minY=n),o>this.maxX&&(this.maxX=o),r>this.maxY&&(this.maxY=r),s}finish(){if(this._pos>>2!==this.numItems)throw Error(`Added ${this._pos>>2} items when expected ${this.numItems}.`);let t=this._boxes;if(this.numItems<=this.nodeSize)return t[this._pos++]=this.minX,t[this._pos++]=this.minY,t[this._pos++]=this.maxX,void(t[this._pos++]=this.maxY);let{numItems:n,minX:o,minY:r,nodeSize:i,_indices:s,_levelBounds:a}=this,c=this.maxX-o||1,l=this.maxY-r||1,h=new Int32Array(n),d=65535/c,u=65535/l;for(let p=0,m=0;p<n;p++){let A=t[m++],g=t[m++],f=d*((A+t[m++])/2-o)|0,y=u*((g+t[m++])/2-r)|0;h[p]=QGr(f,y)}(function(p,m,A,g,f,y){let x=[g,f];for(;x.length;){let C=x.pop()||0,b=x.pop()||0;if(C-b<=y&&Math.floor(b/y)>=Math.floor(C/y))continue;let I=p[b],v=p[b+C>>1],P=p[C],M=I>v!=I>P?I:v<I!=v<P?v:P,B=b-1,T=C+1;for(;;){do B++;while(p[B]<M);do T--;while(p[T]>M);if(B>=T)break;RGr(p,m,A,B,T)}x.push(b,T,T+1,C)}})(h,t,s,0,n-1,i);let _=4*n;for(let p=0,m=0;p<a.length-1;p++){let A=a[p];for(;m<A;){let g=m,f=t[m++],y=t[m++],x=t[m++],C=t[m++];for(let b=1;b<i&&m<A;b++)f=Math.min(f,t[m++]),y=Math.min(y,t[m++]),x=Math.max(x,t[m++]),C=Math.max(C,t[m++]);s[_>>2]=g,t[_++]=f,t[_++]=y,t[_++]=x,t[_++]=C}}this._pos=_}search(t,n,o,r,i){if(this._pos!==this._boxes.length)throw Error("Data not yet indexed - call index.finish().");let{_boxes:s,_levelBounds:a,_indices:c,nodeSize:l}=this,h=4*this.numItems,d=s.length-4,u=a.length-1,_=[],p=[],m=!1;for(;d!==void 0;){let A=Math.min(d+4*l,a[u]),g=d>=h;if(m)this._collectContained(d,A,u,h,p,i);else for(let f=d;f<A;f+=4){let y=s[f];if(o<y)continue;let x=s[f+1];if(r<x)continue;let C=s[f+2];if(t>C)continue;let b=s[f+3];if(n>b)continue;let I=0|c[f>>2];if(g){let v=+(t<=y&&n<=x&&o>=C&&r>=b);_.push(I|v,u-1)}else(i===void 0||i(I,y,x,C,b))&&p.push(I)}u=_.pop(),d=_.pop(),d!==void 0&&(m=!(1&~d),d&=-2)}return p}_collectContained(t,n,o,r,i,s){let a=this._boxes,c=this._indices,l=t;for(let d=o;d>0;d--)l=c[l>>2];let h=Math.min(l+(n-t)*this.nodeSize**o,r);if(s===void 0)for(;l<h;l+=4)i.push(0|c[l>>2]);else for(;l<h;l+=4){let d=0|c[l>>2];s(d,a[l],a[l+1],a[l+2],a[l+3])&&i.push(d)}}neighbors(t,n,o=1/0,r=1/0,i){if(this._pos!==this._boxes.length)throw Error("Data not yet indexed - call index.finish().");let{_boxes:s,_levelBounds:a,_indices:c,_queue:l,nodeSize:h}=this,d=4*this.numItems,u=4*h,_=[],p=o===1,m=r*r;for(l.push(s.length-4<<1,0);l.length;){let A=l.ids[0];if(1&A){if(l.pop(),_.push(A>>1),_.length===o)break;continue}l.pop();let g=A>>1,f=g<d,y=Math.min(g+u,NGr(g,a));for(let x=g;x<y;x+=4){let C=s[x],b=s[x+1],I=s[x+2],v=s[x+3],P=Math.max(Math.max(C-t,t-I),0),M=Math.max(Math.max(b-n,n-v),0),B=P*P+M*M;if(B>m)continue;let T=0|c[x>>2];f?(i===void 0||i(T))&&(l.push(T<<1|1,B),p&&B<m&&(m=B)):l.push(T<<1,B)}}return l.clear(),_}};function NGr(e,t){let n=0,o=t.length-1;for(;n<o;){let r=n+o>>1;t[r]>e?o=r:n=r+1}return t[n]}function RGr(e,t,n,o,r){let i=e[o];e[o]=e[r],e[r]=i;let s=4*o,a=4*r,c=t[s],l=t[s+1],h=t[s+2],d=t[s+3];t[s]=t[a],t[s+1]=t[a+1],t[s+2]=t[a+2],t[s+3]=t[a+3],t[a]=c,t[a+1]=l,t[a+2]=h,t[a+3]=d;let u=n[o];n[o]=n[r],n[r]=u}function QGr(e,t){let n=e^t,o=65535^n,r=65535^(e|t),i=e&(65535^t),s=n|o>>1,a=n>>1^n,c=r^r>>1^o&i>>1,l=i^n&r>>1^i>>1;return n=s&s>>2^a&a>>2,o=s&a>>2^a&(s^a)>>2,r=c^s&c>>2^a&l>>2,i=l^a&c>>2^(s^a)&l>>2,s=n&n>>4^o&o>>4,a=n&o>>4^o&(n^o)>>4,c=r^n&r>>4^o&i>>4,l=i^o&r>>4^(n^o)&i>>4,r=c^s&c>>8^a&l>>8,i=l^a&c>>8^(s^a)&l>>8,r^=r>>1,i^=i>>1,n=e^t,o=i|65535^(n|r),n=16711935&(n|n<<8),n=252645135&(n|n<<4),n=858993459&(n|n<<2),n=1431655765&(n|n<<1),o=16711935&(o|o<<8),o=252645135&(o|o<<4),o=858993459&(o|o<<2),o=1431655765&(o|o<<1),((o<<1|n)>>>0)-2147483648}var H9e=[{facingDirection:"x-",dx:-1,dy:0,startX:-0.5,startY:0.5,endX:-0.5,endY:-0.5},{facingDirection:"x+",dx:1,dy:0,startX:0.5,startY:0.5,endX:0.5,endY:-0.5},{facingDirection:"y-",dx:0,dy:-1,startX:-0.5,startY:-0.5,endX:0.5,endY:-0.5},{facingDirection:"y+",dx:0,dy:1,startX:0.5,startY:0.5,endX:-0.5,endY:0.5}],RXs={"x-":H9e.find((e)=>e.facingDirection==="x-"),"x+":H9e.find((e)=>e.facingDirection==="x+"),"y-":H9e.find((e)=>e.facingDirection==="y-"),"y+":H9e.find((e)=>e.facingDirection==="y+")};function kGr(e,t){let n=e.x-t.x,o=e.y-t.y;return Math.sqrt(n*n+o*o)}function cs(e){let t=e.width/2,n=e.height/2;return{minX:e.center.x-t,maxX:e.center.x+t,minY:e.center.y-n,maxY:e.center.y+n}}function tfn(e,t,n){return Math.max(t,Math.min(n,e))}function LGr(e,t){let n=t.width/2,o=t.height/2,r=t.center.x-n,i=t.center.x+n,s=t.center.y-o,a=t.center.y+o;if(e.x>=r&&e.x<=i&&e.y>=s&&e.y<=a)return 0;return kGr(e,{x:tfn(e.x,r,i),y:tfn(e.y,s,a)})}var P7e=(e,t)=>!(e.maxX<t.minX||t.maxX<e.minX||e.maxY<t.minY||t.maxY<e.minY),bm=(e)=>{let{center:t,width:n,height:o}=e,r=n/2,i=o/2;return{minX:t.x-r,maxX:t.x+r,minY:t.y-i,maxY:t.y+i}},HGr=class{cacheHitsByPrefix={};cacheMissesByPrefix={};isSyncCache=!0;cacheHits=0;cacheMisses=0;cache=new Map;getCachedSolutionSync(e){let t=this.cache.get(e);if(t!==void 0){this.cacheHits++;let n=e.split(":")[0];return this.cacheHitsByPrefix[n]=(this.cacheHitsByPrefix[n]||0)+1,structuredClone(t)}{this.cacheMisses++;let n=e.split(":")[0];return void(this.cacheMissesByPrefix[n]=(this.cacheMissesByPrefix[n]||0)+1)}}async getCachedSolution(e){return this.getCachedSolutionSync(e)}setCachedSolutionSync(e,t){this.cache.set(e,structuredClone(t))}async setCachedSolution(e,t){this.setCachedSolutionSync(e,t)}clearCache(){this.cache.clear(),this.cacheHits=0,this.cacheMisses=0,this.cacheHitsByPrefix={},this.cacheMissesByPrefix={}}getAllCacheKeys(){return Array.from(this.cache.keys())}},Ztt="tscircuit_autorouter_cache_",FGr=class{isSyncCache=!0;cacheHits=0;cacheMisses=0;cacheHitsByPrefix={};cacheMissesByPrefix={};constructor(){}getKey(e){return`${Ztt}${e}`}getCachedSolutionSync(e){if(typeof localStorage>"u")return;let t=this.getKey(e);try{let n=localStorage.getItem(t);if(n!==null){let o=JSON.parse(n);this.cacheHits++;let r=e.split(":")[0];return this.cacheHitsByPrefix[r]=(this.cacheHitsByPrefix[r]||0)+1,o}{this.cacheMisses++;let o=e.split(":")[0];return void(this.cacheMissesByPrefix[o]=(this.cacheMissesByPrefix[o]||0)+1)}}catch(n){console.error(`Error getting cached solution sync for ${t}:`,n),this.cacheMisses++;let o=e.split(":")[0];return void(this.cacheMissesByPrefix[o]=(this.cacheMissesByPrefix[o]||0)+1)}}async getCachedSolution(e){return this.getCachedSolutionSync(e)}setCachedSolutionSync(e,t){if(typeof localStorage>"u")return;let n=this.getKey(e);try{let o=JSON.stringify(t);localStorage.setItem(n,o)}catch(o){console.error(`Error setting cached solution sync for ${n}:`,o),o instanceof DOMException&&(o.name==="QuotaExceededError"||o.name==="NS_ERROR_DOM_QUOTA_REACHED")&&console.warn(`LocalStorage quota exceeded. Failed to cache solution for ${n}. Consider clearing the cache.`)}}async setCachedSolution(e,t){this.setCachedSolutionSync(e,t)}clearCache(){if(typeof localStorage<"u")try{let e=[];for(let t=0;t<localStorage.length;t++){let n=localStorage.key(t);n?.startsWith(Ztt)&&e.push(n)}e.forEach((t)=>localStorage.removeItem(t)),console.log(`Cleared ${e.length} items from LocalStorage cache.`)}catch(e){console.error("Error clearing LocalStorage cache:",e)}finally{this.cacheHits=0,this.cacheMisses=0,this.cacheHitsByPrefix={},this.cacheMissesByPrefix={}}}getAllCacheKeys(){let e=[];for(let t=0;t<1e4;t++){let n=localStorage.key(t);if(!n)break;n.includes(Ztt)&&e.push(n)}return e}};function _Cn(){globalThis.TSCIRCUIT_AUTOROUTER_LOCAL_STORAGE_CACHE??=new FGr,globalThis.TSCIRCUIT_AUTOROUTER_IN_MEMORY_CACHE??=new HGr}function zGr(e){return"layers"in e&&Array.isArray(e.layers)}function OGr(e){return zGr(e)?e.layers:[e.layer]}var KS=(e,t)=>e==="top"?0:e==="bottom"?t-1:parseInt(e.slice(5));function gCn(e,t){return[...new Set(e)].filter((n)=>Number.isInteger(n)&&n>=0&&n<t).sort((n,o)=>n-o)}function VGr(e,t){return gCn(e.map((n)=>KS(n,t)),t)}var nfn=(...e)=>e.find((t)=>typeof t=="number"&&Number.isFinite(t)),E7e=(e)=>{let t=nfn(e.min_via_hole_diameter,e.minViaHoleDiameter),n=nfn(e.min_via_pad_diameter,e.minViaPadDiameter,e.minViaDiameter),o=Math.max(n??e.minViaDiameter??0.3,t??0);return{padDiameter:o,holeDiameter:t??0.5*o}};_Cn();var QXs=Array.from({length:6},(e,t)=>t);var yB=(e,t={})=>{let n=Math.min(...e.availableZ);return{center:!t.rectMargin||t.zOffset?{x:e.center.x+n*e.width*(t.zOffset??0.05),y:e.center.y-n*e.width*(t.zOffset??0.05)}:e.center,width:t.rectMargin?e.width-2*t.rectMargin:Math.max(e.width-0.5,0.8*e.width),height:t.rectMargin?e.height-2*t.rectMargin:Math.max(e.height-0.5,0.8*e.height),fill:e._containsObstacle?"rgba(255,0,0,0.1)":{"0,1":"rgba(0,0,0,0.1)",0:"rgba(0,200,200, 0.1)",1:"rgba(0,0,200, 0.1)"}[e.availableZ.join(",")]??"rgba(0,200,200,0.1)",layer:`z${e.availableZ.join(",")}`,label:[e.capacityMeshNodeId,`availableZ: ${e.availableZ.join(",")}`,e._containsTarget?"containsTarget":"",e._containsObstacle?"containsObstacle":""].filter(Boolean).join(`
`)}};_Cn();var{create:YGr,defineProperty:ofn,getOwnPropertyDescriptor:GGr,getOwnPropertyNames:ACn,getPrototypeOf:UGr}=Object,WGr=Object.prototype.hasOwnProperty,YY=(e,t)=>function(){return t||(0,e[ACn(e)[0]])((t={exports:{}}).exports,t),t.exports},rfn=(e,t,n)=>(n=e!=null?YGr(UGr(e)):{},((o,r,i,s)=>{if(r&&typeof r=="object"||typeof r=="function")for(let a of ACn(r))WGr.call(o,a)||a===i||ofn(o,a,{get:()=>r[a],enumerable:!(s=GGr(r,a))||s.enumerable});return o})(!t&&e&&e.__esModule?n:ofn(n,"default",{value:e,enumerable:!0}),e)),XGr=YY({"node_modules/is-buffer/index.js"(e,t){function n(o){return!!o.constructor&&typeof o.constructor.isBuffer=="function"&&o.constructor.isBuffer(o)}t.exports=function(o){return o!=null&&(n(o)||function(r){return typeof r.readFloatLE=="function"&&typeof r.slice=="function"&&n(r.slice(0,0))}(o)||!!o._isBuffer)}}}),jGr=YY({"node_modules/kind-of/index.js"(e,t){var n=XGr(),o=Object.prototype.toString;t.exports=function(r){if(r===void 0)return"undefined";if(r===null)return"null";if(r===!0||r===!1||r instanceof Boolean)return"boolean";if(typeof r=="string"||r instanceof String)return"string";if(typeof r=="number"||r instanceof Number)return"number";if(typeof r=="function"||r instanceof Function)return"function";if(Array.isArray!==void 0&&Array.isArray(r))return"array";if(r instanceof RegExp)return"regexp";if(r instanceof Date)return"date";var i=o.call(r);return i==="[object RegExp]"?"regexp":i==="[object Date]"?"date":i==="[object Arguments]"?"arguments":i==="[object Error]"?"error":n(r)?"buffer":i==="[object Set]"?"set":i==="[object WeakSet]"?"weakset":i==="[object Map]"?"map":i==="[object WeakMap]"?"weakmap":i==="[object Symbol]"?"symbol":i==="[object Int8Array]"?"int8array":i==="[object Uint8Array]"?"uint8array":i==="[object Uint8ClampedArray]"?"uint8clampedarray":i==="[object Int16Array]"?"int16array":i==="[object Uint16Array]"?"uint16array":i==="[object Int32Array]"?"int32array":i==="[object Uint32Array]"?"uint32array":i==="[object Float32Array]"?"float32array":i==="[object Float64Array]"?"float64array":"object"}}}),KGr=YY({"node_modules/rename-keys/index.js"(e,t){(function(){function n(o,r){if(typeof r!="function")return o;var i={};for(var s in o)Object.prototype.hasOwnProperty.call(o,s)&&(i[r(s,o[s])||s]=o[s]);return i}t!==void 0&&t.exports?t.exports=n:typeof define=="function"&&define.amd?define([],function(){return n}):window.rename=n})()}}),$Gr=YY({"node_modules/deep-rename-keys/index.js"(e,t){var n=jGr(),o=KGr();t.exports=function r(i,s){var a=n(i);if(a!=="object"&&a!=="array")throw Error("expected an object");var c=[];for(var l in a==="object"&&(i=o(i,s),c={}),i)if(i.hasOwnProperty(l)){var h=i[l];n(h)==="object"||n(h)==="array"?c[l]=r(h,s):c[l]=h}return c}}}),fCn=YY({"node_modules/eventemitter3/index.js"(e,t){var n=Object.prototype.hasOwnProperty,o="~";function r(){}function i(a,c,l){this.fn=a,this.context=c,this.once=l||!1}function s(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),new r().__proto__||(o=!1)),s.prototype.eventNames=function(){var a,c,l=[];if(this._eventsCount===0)return l;for(c in a=this._events)n.call(a,c)&&l.push(o?c.slice(1):c);return Object.getOwnPropertySymbols?l.concat(Object.getOwnPropertySymbols(a)):l},s.prototype.listeners=function(a,c){var l=o?o+a:a,h=this._events[l];if(c)return!!h;if(!h)return[];if(h.fn)return[h.fn];for(var d=0,u=h.length,_=Array(u);d<u;d++)_[d]=h[d].fn;return _},s.prototype.emit=function(a,c,l,h,d,u){var _=o?o+a:a;if(!this._events[_])return!1;var p,m,A=this._events[_],g=arguments.length;if(A.fn){switch(A.once&&this.removeListener(a,A.fn,void 0,!0),g){case 1:return A.fn.call(A.context),!0;case 2:return A.fn.call(A.context,c),!0;case 3:return A.fn.call(A.context,c,l),!0;case 4:return A.fn.call(A.context,c,l,h),!0;case 5:return A.fn.call(A.context,c,l,h,d),!0;case 6:return A.fn.call(A.context,c,l,h,d,u),!0}for(m=1,p=Array(g-1);m<g;m++)p[m-1]=arguments[m];A.fn.apply(A.context,p)}else{var f,y=A.length;for(m=0;m<y;m++)switch(A[m].once&&this.removeListener(a,A[m].fn,void 0,!0),g){case 1:A[m].fn.call(A[m].context);break;case 2:A[m].fn.call(A[m].context,c);break;case 3:A[m].fn.call(A[m].context,c,l);break;case 4:A[m].fn.call(A[m].context,c,l,h);break;default:if(!p)for(f=1,p=Array(g-1);f<g;f++)p[f-1]=arguments[f];A[m].fn.apply(A[m].context,p)}}return!0},s.prototype.on=function(a,c,l){var h=new i(c,l||this),d=o?o+a:a;return this._events[d]?this._events[d].fn?this._events[d]=[this._events[d],h]:this._events[d].push(h):(this._events[d]=h,this._eventsCount++),this},s.prototype.once=function(a,c,l){var h=new i(c,l||this,!0),d=o?o+a:a;return this._events[d]?this._events[d].fn?this._events[d]=[this._events[d],h]:this._events[d].push(h):(this._events[d]=h,this._eventsCount++),this},s.prototype.removeListener=function(a,c,l,h){var d=o?o+a:a;if(!this._events[d])return this;if(!c)return--this._eventsCount===0?this._events=new r:delete this._events[d],this;var u=this._events[d];if(u.fn)u.fn!==c||h&&!u.once||l&&u.context!==l||(--this._eventsCount===0?this._events=new r:delete this._events[d]);else{for(var _=0,p=[],m=u.length;_<m;_++)(u[_].fn!==c||h&&!u[_].once||l&&u[_].context!==l)&&p.push(u[_]);p.length?this._events[d]=p.length===1?p[0]:p:--this._eventsCount===0?this._events=new r:delete this._events[d]}return this},s.prototype.removeAllListeners=function(a){var c;return a?(c=o?o+a:a,this._events[c]&&(--this._eventsCount===0?this._events=new r:delete this._events[c])):(this._events=new r,this._eventsCount=0),this},s.prototype.off=s.prototype.removeListener,s.prototype.addListener=s.prototype.on,s.prototype.setMaxListeners=function(){return this},s.prefixed=o,s.EventEmitter=s,t!==void 0&&(t.exports=s)}}),qGr=YY({"node_modules/xml-lexer/dist/lexer.js"(e,t){function n(l,h,d){return h in l?Object.defineProperty(l,h,{value:d,enumerable:!0,configurable:!0,writable:!0}):l[h]=d,l}var o=fCn(),r=function(){},i={data:"state-data",cdata:"state-cdata",tagBegin:"state-tag-begin",tagName:"state-tag-name",tagEnd:"state-tag-end",attributeNameStart:"state-attribute-name-start",attributeName:"state-attribute-name",attributeNameEnd:"state-attribute-name-end",attributeValueBegin:"state-attribute-value-begin",attributeValue:"state-attribute-value"},s={lt:"action-lt",gt:"action-gt",space:"action-space",equal:"action-equal",quote:"action-quote",slash:"action-slash",char:"action-char",error:"action-error"},a={text:"text",openTag:"open-tag",closeTag:"close-tag",attributeName:"attribute-name",attributeValue:"attribute-value"},c={" ":s.space,"\t":s.space,"\n":s.space,"\r":s.space,"<":s.lt,">":s.gt,'"':s.quote,"'":s.quote,"=":s.equal,"/":s.slash};t.exports={State:i,Action:s,Type:a,create:function(l){var h,d,u,_,p,m,A,g,f,y;l=Object.assign({debug:!1},l);var x=new o,C=i.data,b="",I="",v="",P="",M="",B="",T=function(D,L){if(I[0]!=="?"&&I[0]!=="!"){var H={type:D,value:L};l.debug&&console.log("emit:",H),x.emit("data",H)}};x.stateMachine=(n(y={},i.data,(n(h={},s.lt,function(){b.trim()&&T(a.text,b),I="",M=!1,C=i.tagBegin}),n(h,s.char,function(D){b+=D}),h)),n(y,i.cdata,n({},s.char,function(D){(b+=D).substr(-3)==="]]>"&&(T(a.text,b.slice(0,-3)),b="",C=i.data)})),n(y,i.tagBegin,(n(d={},s.space,r),n(d,s.char,function(D){I=D,C=i.tagName}),n(d,s.slash,function(){I="",M=!0}),d)),n(y,i.tagName,(n(u={},s.space,function(){M?C=i.tagEnd:(C=i.attributeNameStart,T(a.openTag,I))}),n(u,s.gt,function(){T(M?a.closeTag:a.openTag,I),b="",C=i.data}),n(u,s.slash,function(){C=i.tagEnd,T(a.openTag,I)}),n(u,s.char,function(D){(I+=D)==="![CDATA["&&(C=i.cdata,b="",I="")}),u)),n(y,i.tagEnd,(n(_={},s.gt,function(){T(a.closeTag,I),b="",C=i.data}),n(_,s.char,r),_)),n(y,i.attributeNameStart,(n(p={},s.char,function(D){v=D,C=i.attributeName}),n(p,s.gt,function(){b="",C=i.data}),n(p,s.space,r),n(p,s.slash,function(){M=!0,C=i.tagEnd}),p)),n(y,i.attributeName,(n(m={},s.space,function(){C=i.attributeNameEnd}),n(m,s.equal,function(){T(a.attributeName,v),C=i.attributeValueBegin}),n(m,s.gt,function(){P="",T(a.attributeName,v),T(a.attributeValue,P),b="",C=i.data}),n(m,s.slash,function(){M=!0,P="",T(a.attributeName,v),T(a.attributeValue,P),C=i.tagEnd}),n(m,s.char,function(D){v+=D}),m)),n(y,i.attributeNameEnd,(n(A={},s.space,r),n(A,s.equal,function(){T(a.attributeName,v),C=i.attributeValueBegin}),n(A,s.gt,function(){P="",T(a.attributeName,v),T(a.attributeValue,P),b="",C=i.data}),n(A,s.char,function(D){P="",T(a.attributeName,v),T(a.attributeValue,P),v=D,C=i.attributeName}),A)),n(y,i.attributeValueBegin,(n(g={},s.space,r),n(g,s.quote,function(D){B=D,P="",C=i.attributeValue}),n(g,s.gt,function(){T(a.attributeValue,P=""),b="",C=i.data}),n(g,s.char,function(D){B="",P=D,C=i.attributeValue}),g)),n(y,i.attributeValue,(n(f={},s.space,function(D){B?P+=D:(T(a.attributeValue,P),C=i.attributeNameStart)}),n(f,s.quote,function(D){B===D?(T(a.attributeValue,P),C=i.attributeNameStart):P+=D}),n(f,s.gt,function(D){B?P+=D:(T(a.attributeValue,P),b="",C=i.data)}),n(f,s.slash,function(D){B?P+=D:(T(a.attributeValue,P),M=!0,C=i.tagEnd)}),n(f,s.char,function(D){P+=D}),f)),y);var N=function(D){l.debug&&console.log(C,D);var L=x.stateMachine[C],H=L[function(V){return c[V]||s.char}(D)]||L[s.error]||L[s.char];H(D)};return x.write=function(D){for(var L=D.length,H=0;H<L;H++)N(D[H])},x}}}}),JGr=YY({"node_modules/xml-reader/dist/reader.js"(e,t){var n=fCn(),o=qGr(),r=o.Type,i={element:"element",text:"text"},s=function(c){return Object.assign({name:"",type:i.element,value:"",parent:null,attributes:{},children:[]},c)},a=function(c){c=Object.assign({stream:!1,parentNodes:!0,doneEvent:"done",tagPrefix:"tag:",emitTopLevelOnly:!1,debug:!1},c);var l=void 0,h=void 0,d=void 0,u=void 0,_=new n,p=function(m){switch(m.type){case r.openTag:if(d===null)(d=h).name=m.value;else{var A=s({name:m.value,parent:d});d.children.push(A),d=A}break;case r.closeTag:var g=d.parent;if(c.parentNodes||(d.parent=null),d.name!==m.value)break;c.stream&&g===h&&(h.children=[],d.parent=null),c.emitTopLevelOnly&&g!==h||(_.emit(c.tagPrefix+d.name,d),_.emit("tag",d.name,d)),d===h&&(l.removeAllListeners("data"),_.emit(c.doneEvent,d),h=null),d=g;break;case r.text:d&&d.children.push(s({type:i.text,value:m.value,parent:c.parentNodes?d:null}));break;case r.attributeName:u=m.value,d.attributes[u]="";break;case r.attributeValue:d.attributes[u]=m.value}};return _.reset=function(){(l=o.create({debug:c.debug})).on("data",p),h=s(),d=null,u="",_.parse=l.write},_.reset(),_};t.exports={parseSync:function(c,l){l=Object.assign({},l,{stream:!1,tagPrefix:":"});var h=a(l),d=void 0;return h.on("done",function(u){d=u}),h.parse(c),d},create:a,NodeType:i}}}),{cos:kXs,sin:LXs,PI:HXs}=Math,{tan:FXs}=Math,zXs=(rfn($Gr()),rfn(JGr()),class{MAX_ITERATIONS=1e5;solved=!1;failed=!1;iterations=0;progress=0;error=null;activeSubSolver;failedSubSolvers;timeToSolve;stats={};_setupDone=!1;setup(){this._setupDone||(this._setup(),this._setupDone=!0)}_setup(){}step(){if(this._setupDone||this.setup(),!this.solved&&!this.failed){this.iterations++;try{this._step()}catch(e){throw this.error=`${this.constructor.name} error: ${e}`,this.failed=!0,e}!this.solved&&this.iterations>=this.MAX_ITERATIONS&&this.tryFinalAcceptance(),!this.solved&&this.iterations>=this.MAX_ITERATIONS&&(this.error=`${this.constructor.name} ran out of iterations`,this.failed=!0),"computeProgress"in this&&(this.progress=this.computeProgress())}}_step(){}getConstructorParams(){throw Error("getConstructorParams not implemented")}getOutput(){return null}solve(){let e=Date.now();for(;!this.solved&&!this.failed;)this.step();let t=Date.now();this.timeToSolve=t-e}visualize(){return{lines:[],points:[],rects:[],circles:[]}}tryFinalAcceptance(){}preview(){return{lines:[],points:[],rects:[],circles:[]}}}),{create:ZGr,defineProperty:ifn,getOwnPropertyDescriptor:eUr,getOwnPropertyNames:yCn,getPrototypeOf:tUr}=Object,nUr=Object.prototype.hasOwnProperty,i3=(e,t)=>function(){return t||(0,e[yCn(e)[0]])((t={exports:{}}).exports,t),t.exports},M7e=i3({"node_modules/binary-search-bounds/search-bounds.js"(e,t){function n(c,l,h,d,u){for(var _=u+1;d<=u;){var p=d+u>>>1,m=c[p];(h!==void 0?h(m,l):m-l)>=0?(_=p,u=p-1):d=p+1}return _}function o(c,l,h,d,u){for(var _=u+1;d<=u;){var p=d+u>>>1,m=c[p];(h!==void 0?h(m,l):m-l)>0?(_=p,u=p-1):d=p+1}return _}function r(c,l,h,d,u){for(var _=d-1;d<=u;){var p=d+u>>>1,m=c[p];(h!==void 0?h(m,l):m-l)<0?(_=p,d=p+1):u=p-1}return _}function i(c,l,h,d,u){for(var _=d-1;d<=u;){var p=d+u>>>1,m=c[p];(h!==void 0?h(m,l):m-l)<=0?(_=p,d=p+1):u=p-1}return _}function s(c,l,h,d,u){for(;d<=u;){var _=d+u>>>1,p=c[_],m=h!==void 0?h(p,l):p-l;if(m===0)return _;m<=0?d=_+1:u=_-1}return-1}function a(c,l,h,d,u,_){return typeof h=="function"?_(c,l,h,d===void 0?0:0|d,u===void 0?c.length-1:0|u):_(c,l,void 0,h===void 0?0:0|h,d===void 0?c.length-1:0|d)}t.exports={ge:function(c,l,h,d,u){return a(c,l,h,d,u,n)},gt:function(c,l,h,d,u){return a(c,l,h,d,u,o)},lt:function(c,l,h,d,u){return a(c,l,h,d,u,r)},le:function(c,l,h,d,u){return a(c,l,h,d,u,i)},eq:function(c,l,h,d,u){return a(c,l,h,d,u,s)}}}}),cst=i3({"node_modules/two-product/two-product.js"(e,t){t.exports=function(o,r,i){var s=o*r,a=n*o,c=a-(a-o),l=o-c,h=n*r,d=h-(h-r),u=r-d,_=l*u-(s-c*d-l*d-c*u);if(i)return i[0]=_,i[1]=s,i;return[_,s]};var n=+(Math.pow(2,27)+1)}}),xCn=i3({"node_modules/robust-sum/robust-sum.js"(e,t){t.exports=function(n,o){var r=0|n.length,i=0|o.length;if(r===1&&i===1)return function(v,P){var M=v+P,B=M-v,T=M-B,N=P-B,D=v-T,L=D+N;if(L)return[L,M];return[M]}(n[0],o[0]);var s,a,c=Array(r+i),l=0,h=0,d=0,u=Math.abs,_=n[h],p=u(_),m=o[d],A=u(m);p<A?(a=_,(h+=1)<r&&(p=u(_=n[h]))):(a=m,(d+=1)<i&&(A=u(m=o[d]))),h<r&&p<A||d>=i?(s=_,(h+=1)<r&&(p=u(_=n[h]))):(s=m,(d+=1)<i&&(A=u(m=o[d])));var g,f,y=s+a,x=y-s,C=a-x,b=C,I=y;for(;h<r&&d<i;)p<A?(s=_,(h+=1)<r&&(p=u(_=n[h]))):(s=m,(d+=1)<i&&(A=u(m=o[d]))),(C=(a=b)-(x=(y=s+a)-s))&&(c[l++]=C),b=I-((g=I+y)-(f=g-I))+(y-f),I=g;for(;h<r;)(C=(a=b)-(x=(y=(s=_)+a)-s))&&(c[l++]=C),b=I-((g=I+y)-(f=g-I))+(y-f),I=g,(h+=1)<r&&(_=n[h]);for(;d<i;)(C=(a=b)-(x=(y=(s=m)+a)-s))&&(c[l++]=C),b=I-((g=I+y)-(f=g-I))+(y-f),I=g,(d+=1)<i&&(m=o[d]);return b&&(c[l++]=b),I&&(c[l++]=I),l||(c[l++]=0),c.length=l,c}}}),oUr=i3({"node_modules/two-sum/two-sum.js"(e,t){t.exports=function(n,o,r){var i=n+o,s=i-n,a=o-s,c=n-(i-s);if(r)return r[0]=c+a,r[1]=i,r;return[c+a,i]}}}),CCn=i3({"node_modules/robust-scale/robust-scale.js"(e,t){var n=cst(),o=oUr();t.exports=function(r,i){var s=r.length;if(s===1){var a=n(r[0],i);return a[0]?a:[a[1]]}var c=Array(2*s),l=[0.1,0.1],h=[0.1,0.1],d=0;n(r[0],i,l),l[0]&&(c[d++]=l[0]);for(var u=1;u<s;++u){n(r[u],i,h);var _=l[1];o(_,h[0],l),l[0]&&(c[d++]=l[0]);var p=h[1],m=l[1],A=p+m,g=m-(A-p);l[1]=A,g&&(c[d++]=g)}return l[1]&&(c[d++]=l[1]),d===0&&(c[d++]=0),c.length=d,c}}}),bCn=i3({"node_modules/robust-subtract/robust-diff.js"(e,t){t.exports=function(n,o){var r=0|n.length,i=0|o.length;if(r===1&&i===1)return function(v,P){var M=v+P,B=M-v,T=M-B,N=P-B,D=v-T,L=D+N;if(L)return[L,M];return[M]}(n[0],-o[0]);var s,a,c=Array(r+i),l=0,h=0,d=0,u=Math.abs,_=n[h],p=u(_),m=-o[d],A=u(m);p<A?(a=_,(h+=1)<r&&(p=u(_=n[h]))):(a=m,(d+=1)<i&&(A=u(m=-o[d]))),h<r&&p<A||d>=i?(s=_,(h+=1)<r&&(p=u(_=n[h]))):(s=m,(d+=1)<i&&(A=u(m=-o[d])));var g,f,y=s+a,x=y-s,C=a-x,b=C,I=y;for(;h<r&&d<i;)p<A?(s=_,(h+=1)<r&&(p=u(_=n[h]))):(s=m,(d+=1)<i&&(A=u(m=-o[d]))),(C=(a=b)-(x=(y=s+a)-s))&&(c[l++]=C),b=I-((g=I+y)-(f=g-I))+(y-f),I=g;for(;h<r;)(C=(a=b)-(x=(y=(s=_)+a)-s))&&(c[l++]=C),b=I-((g=I+y)-(f=g-I))+(y-f),I=g,(h+=1)<r&&(_=n[h]);for(;d<i;)(C=(a=b)-(x=(y=(s=m)+a)-s))&&(c[l++]=C),b=I-((g=I+y)-(f=g-I))+(y-f),I=g,(d+=1)<i&&(m=-o[d]);return b&&(c[l++]=b),I&&(c[l++]=I),l||(c[l++]=0),c.length=l,c}}}),rUr=i3({"node_modules/robust-orientation/orientation.js"(e,t){var n=cst(),o=xCn(),r=CCn(),i=bCn();function s(m,A,g,f){return function(y,x,C){var b=m(m(A(x[1],C[0]),A(-C[1],x[0])),m(A(y[1],x[0]),A(-x[1],y[0]))),I=m(A(y[1],C[0]),A(-C[1],y[0])),v=f(b,I);return v[v.length-1]}}function a(m,A,g,f){return function(y,x,C,b){var I=m(m(g(m(A(C[1],b[0]),A(-b[1],C[0])),x[2]),m(g(m(A(x[1],b[0]),A(-b[1],x[0])),-C[2]),g(m(A(x[1],C[0]),A(-C[1],x[0])),b[2]))),m(g(m(A(x[1],b[0]),A(-b[1],x[0])),y[2]),m(g(m(A(y[1],b[0]),A(-b[1],y[0])),-x[2]),g(m(A(y[1],x[0]),A(-x[1],y[0])),b[2])))),v=m(m(g(m(A(C[1],b[0]),A(-b[1],C[0])),y[2]),m(g(m(A(y[1],b[0]),A(-b[1],y[0])),-C[2]),g(m(A(y[1],C[0]),A(-C[1],y[0])),b[2]))),m(g(m(A(x[1],C[0]),A(-C[1],x[0])),y[2]),m(g(m(A(y[1],C[0]),A(-C[1],y[0])),-x[2]),g(m(A(y[1],x[0]),A(-x[1],y[0])),C[2])))),P=f(I,v);return P[P.length-1]}}function c(m,A,g,f){return function(y,x,C,b,I){var v=m(m(m(g(m(g(m(A(b[1],I[0]),A(-I[1],b[0])),C[2]),m(g(m(A(C[1],I[0]),A(-I[1],C[0])),-b[2]),g(m(A(C[1],b[0]),A(-b[1],C[0])),I[2]))),x[3]),m(g(m(g(m(A(b[1],I[0]),A(-I[1],b[0])),x[2]),m(g(m(A(x[1],I[0]),A(-I[1],x[0])),-b[2]),g(m(A(x[1],b[0]),A(-b[1],x[0])),I[2]))),-C[3]),g(m(g(m(A(C[1],I[0]),A(-I[1],C[0])),x[2]),m(g(m(A(x[1],I[0]),A(-I[1],x[0])),-C[2]),g(m(A(x[1],C[0]),A(-C[1],x[0])),I[2]))),b[3]))),m(g(m(g(m(A(C[1],b[0]),A(-b[1],C[0])),x[2]),m(g(m(A(x[1],b[0]),A(-b[1],x[0])),-C[2]),g(m(A(x[1],C[0]),A(-C[1],x[0])),b[2]))),-I[3]),m(g(m(g(m(A(b[1],I[0]),A(-I[1],b[0])),x[2]),m(g(m(A(x[1],I[0]),A(-I[1],x[0])),-b[2]),g(m(A(x[1],b[0]),A(-b[1],x[0])),I[2]))),y[3]),g(m(g(m(A(b[1],I[0]),A(-I[1],b[0])),y[2]),m(g(m(A(y[1],I[0]),A(-I[1],y[0])),-b[2]),g(m(A(y[1],b[0]),A(-b[1],y[0])),I[2]))),-x[3])))),m(m(g(m(g(m(A(x[1],I[0]),A(-I[1],x[0])),y[2]),m(g(m(A(y[1],I[0]),A(-I[1],y[0])),-x[2]),g(m(A(y[1],x[0]),A(-x[1],y[0])),I[2]))),b[3]),m(g(m(g(m(A(x[1],b[0]),A(-b[1],x[0])),y[2]),m(g(m(A(y[1],b[0]),A(-b[1],y[0])),-x[2]),g(m(A(y[1],x[0]),A(-x[1],y[0])),b[2]))),-I[3]),g(m(g(m(A(C[1],b[0]),A(-b[1],C[0])),x[2]),m(g(m(A(x[1],b[0]),A(-b[1],x[0])),-C[2]),g(m(A(x[1],C[0]),A(-C[1],x[0])),b[2]))),y[3]))),m(g(m(g(m(A(C[1],b[0]),A(-b[1],C[0])),y[2]),m(g(m(A(y[1],b[0]),A(-b[1],y[0])),-C[2]),g(m(A(y[1],C[0]),A(-C[1],y[0])),b[2]))),-x[3]),m(g(m(g(m(A(x[1],b[0]),A(-b[1],x[0])),y[2]),m(g(m(A(y[1],b[0]),A(-b[1],y[0])),-x[2]),g(m(A(y[1],x[0]),A(-x[1],y[0])),b[2]))),C[3]),g(m(g(m(A(x[1],C[0]),A(-C[1],x[0])),y[2]),m(g(m(A(y[1],C[0]),A(-C[1],y[0])),-x[2]),g(m(A(y[1],x[0]),A(-x[1],y[0])),C[2]))),-b[3]))))),P=m(m(m(g(m(g(m(A(b[1],I[0]),A(-I[1],b[0])),C[2]),m(g(m(A(C[1],I[0]),A(-I[1],C[0])),-b[2]),g(m(A(C[1],b[0]),A(-b[1],C[0])),I[2]))),y[3]),g(m(g(m(A(b[1],I[0]),A(-I[1],b[0])),y[2]),m(g(m(A(y[1],I[0]),A(-I[1],y[0])),-b[2]),g(m(A(y[1],b[0]),A(-b[1],y[0])),I[2]))),-C[3])),m(g(m(g(m(A(C[1],I[0]),A(-I[1],C[0])),y[2]),m(g(m(A(y[1],I[0]),A(-I[1],y[0])),-C[2]),g(m(A(y[1],C[0]),A(-C[1],y[0])),I[2]))),b[3]),g(m(g(m(A(C[1],b[0]),A(-b[1],C[0])),y[2]),m(g(m(A(y[1],b[0]),A(-b[1],y[0])),-C[2]),g(m(A(y[1],C[0]),A(-C[1],y[0])),b[2]))),-I[3]))),m(m(g(m(g(m(A(C[1],I[0]),A(-I[1],C[0])),x[2]),m(g(m(A(x[1],I[0]),A(-I[1],x[0])),-C[2]),g(m(A(x[1],C[0]),A(-C[1],x[0])),I[2]))),y[3]),g(m(g(m(A(C[1],I[0]),A(-I[1],C[0])),y[2]),m(g(m(A(y[1],I[0]),A(-I[1],y[0])),-C[2]),g(m(A(y[1],C[0]),A(-C[1],y[0])),I[2]))),-x[3])),m(g(m(g(m(A(x[1],I[0]),A(-I[1],x[0])),y[2]),m(g(m(A(y[1],I[0]),A(-I[1],y[0])),-x[2]),g(m(A(y[1],x[0]),A(-x[1],y[0])),I[2]))),C[3]),g(m(g(m(A(x[1],C[0]),A(-C[1],x[0])),y[2]),m(g(m(A(y[1],C[0]),A(-C[1],y[0])),-x[2]),g(m(A(y[1],x[0]),A(-x[1],y[0])),C[2]))),-I[3])))),M=f(v,P);return M[M.length-1]}}function l(m){return(m===3?s:m===4?a:c)(o,n,r,i)}var h=l(3),d=l(4),u=[function(){return 0},function(){return 0},function(m,A){return A[0]-m[0]},function(m,A,g){var f,y=(m[1]-g[1])*(A[0]-g[0]),x=(m[0]-g[0])*(A[1]-g[1]),C=y-x;if(y>0){if(x<=0)return C;f=y+x}else{if(!(y<0))return C;if(x>=0)return C;f=-(y+x)}var b=0.00000000000000033306690738754716*f;return C>=b||C<=-b?C:h(m,A,g)},function(m,A,g,f){var y=m[0]-f[0],x=A[0]-f[0],C=g[0]-f[0],b=m[1]-f[1],I=A[1]-f[1],v=g[1]-f[1],P=m[2]-f[2],M=A[2]-f[2],B=g[2]-f[2],T=x*v,N=C*I,D=C*b,L=y*v,H=y*I,V=x*b,O=P*(T-N)+M*(D-L)+B*(H-V),U=0.0000000000000007771561172376103*((Math.abs(T)+Math.abs(N))*Math.abs(P)+(Math.abs(D)+Math.abs(L))*Math.abs(M)+(Math.abs(H)+Math.abs(V))*Math.abs(B));return O>U||-O>U?O:d(m,A,g,f)}];function _(m){var A=u[m.length];return A||(A=u[m.length]=l(m.length)),A.apply(void 0,m)}function p(m,A,g,f,y,x,C){return function(b,I,v,P,M){switch(arguments.length){case 0:case 1:return 0;case 2:return f(b,I);case 3:return y(b,I,v);case 4:return x(b,I,v,P);case 5:return C(b,I,v,P,M)}for(var B=Array(arguments.length),T=0;T<arguments.length;++T)B[T]=arguments[T];return m(B)}}(function(){for(;u.length<=5;)u.push(l(u.length));t.exports=p.apply(void 0,[_].concat(u));for(var m=0;m<=5;++m)t.exports[m]=u[m]})()}}),iUr=i3({"node_modules/cdt2d/lib/monotone.js"(e,t){var n=M7e(),o=rUr()[3];function r(u,_,p,m,A){this.a=u,this.b=_,this.idx=p,this.lowerIds=m,this.upperIds=A}function i(u,_,p,m){this.a=u,this.b=_,this.type=p,this.idx=m}function s(u,_){var p=u.a[0]-_.a[0]||u.a[1]-_.a[1]||u.type-_.type;return p||(u.type!==0&&(p=o(u.a,u.b,_.b))?p:u.idx-_.idx)}function a(u,_){return o(u.a,u.b,_)}function c(u,_,p,m,A){for(var g=n.lt(_,m,a),f=n.gt(_,m,a),y=g;y<f;++y){for(var x=_[y],C=x.lowerIds,b=C.length;b>1&&o(p[C[b-2]],p[C[b-1]],m)>0;)u.push([C[b-1],C[b-2],A]),b-=1;C.length=b,C.push(A);var I=x.upperIds;for(b=I.length;b>1&&o(p[I[b-2]],p[I[b-1]],m)<0;)u.push([I[b-2],I[b-1],A]),b-=1;I.length=b,I.push(A)}}function l(u,_){var p;return(p=u.a[0]<_.a[0]?o(u.a,u.b,_.a):o(_.b,_.a,u.a))?p:(p=_.b[0]<u.b[0]?o(u.a,u.b,_.b):o(_.b,_.a,u.b))||u.idx-_.idx}function h(u,_,p){var m=n.le(u,p,l),A=u[m],g=A.upperIds,f=g[g.length-1];A.upperIds=[f],u.splice(m+1,0,new r(p.a,p.b,p.idx,[f],g))}function d(u,_,p){var m=p.a;p.a=p.b,p.b=m;var A=n.eq(u,p,l),g=u[A];u[A-1].upperIds=g.upperIds,u.splice(A,1)}t.exports=function(u,_){for(var p=u.length,m=_.length,A=[],g=0;g<p;++g)A.push(new i(u[g],null,0,g));for(g=0;g<m;++g){var f=_[g],y=u[f[0]],x=u[f[1]];y[0]<x[0]?A.push(new i(y,x,2,g),new i(x,y,1,g)):y[0]>x[0]&&A.push(new i(x,y,2,g),new i(y,x,1,g))}A.sort(s);for(var C=A[0].a[0]-(1+Math.abs(A[0].a[0]))*Math.pow(2,-52),b=[new r([C,1],[C,0],-1,[],[],[],[])],I=[],v=(g=0,A.length);g<v;++g){var P=A[g],M=P.type;M===0?c(I,b,u,P.a,P.idx):M===2?h(b,u,P):d(b,u,P)}return I}}}),sUr=i3({"node_modules/cdt2d/lib/triangulation.js"(e,t){var n=M7e();function o(s,a){this.stars=s,this.edges=a}t.exports=function(s,a){for(var c=Array(s),l=0;l<s;++l)c[l]=[];return new o(c,a)};var r=o.prototype;function i(s,a,c){for(var l=1,h=s.length;l<h;l+=2)if(s[l-1]===a&&s[l]===c)return s[l-1]=s[h-2],s[l]=s[h-1],void(s.length=h-2)}r.isConstraint=function(){var s=[0,0];function a(c,l){return c[0]-l[0]||c[1]-l[1]}return function(c,l){return s[0]=Math.min(c,l),s[1]=Math.max(c,l),n.eq(this.edges,s,a)>=0}}(),r.removeTriangle=function(s,a,c){var l=this.stars;i(l[s],a,c),i(l[a],c,s),i(l[c],s,a)},r.addTriangle=function(s,a,c){var l=this.stars;l[s].push(a,c),l[a].push(c,s),l[c].push(s,a)},r.opposite=function(s,a){for(var c=this.stars[a],l=1,h=c.length;l<h;l+=2)if(c[l]===s)return c[l-1];return-1},r.flip=function(s,a){var c=this.opposite(s,a),l=this.opposite(a,s);this.removeTriangle(s,a,c),this.removeTriangle(a,s,l),this.addTriangle(s,l,c),this.addTriangle(a,c,l)},r.edges=function(){for(var s=this.stars,a=[],c=0,l=s.length;c<l;++c)for(var h=s[c],d=0,u=h.length;d<u;d+=2)a.push([h[d],h[d+1]]);return a},r.cells=function(){for(var s=this.stars,a=[],c=0,l=s.length;c<l;++c)for(var h=s[c],d=0,u=h.length;d<u;d+=2){var _=h[d],p=h[d+1];c<Math.min(_,p)&&a.push([c,_,p])}return a}}}),aUr=i3({"node_modules/robust-in-sphere/in-sphere.js"(e,t){var n=cst(),o=xCn(),r=bCn(),i=CCn();function s(p){return(p===3?a:p===4?c:p===5?l:h)(o,r,n,i)}function a(p,m,A,g){return function(f,y,x){var C=A(f[0],f[0]),b=g(C,y[0]),I=g(C,x[0]),v=A(y[0],y[0]),P=g(v,f[0]),M=g(v,x[0]),B=A(x[0],x[0]),T=g(B,f[0]),N=g(B,y[0]),D=p(m(N,M),m(P,b)),L=m(T,I),H=m(D,L);return H[H.length-1]}}function c(p,m,A,g){return function(f,y,x,C){var b=p(A(f[0],f[0]),A(f[1],f[1])),I=g(b,y[0]),v=g(b,x[0]),P=g(b,C[0]),M=p(A(y[0],y[0]),A(y[1],y[1])),B=g(M,f[0]),T=g(M,x[0]),N=g(M,C[0]),D=p(A(x[0],x[0]),A(x[1],x[1])),L=g(D,f[0]),H=g(D,y[0]),V=g(D,C[0]),O=p(A(C[0],C[0]),A(C[1],C[1])),U=g(O,f[0]),j=g(O,y[0]),Y=g(O,x[0]),X=p(p(g(m(Y,V),y[1]),p(g(m(j,N),-x[1]),g(m(H,T),C[1]))),p(g(m(j,N),f[1]),p(g(m(U,P),-y[1]),g(m(B,I),C[1])))),K=p(p(g(m(Y,V),f[1]),p(g(m(U,P),-x[1]),g(m(L,v),C[1]))),p(g(m(H,T),f[1]),p(g(m(L,v),-y[1]),g(m(B,I),x[1])))),J=m(X,K);return J[J.length-1]}}function l(p,m,A,g){return function(f,y,x,C,b){var I=p(A(f[0],f[0]),p(A(f[1],f[1]),A(f[2],f[2]))),v=g(I,y[0]),P=g(I,x[0]),M=g(I,C[0]),B=g(I,b[0]),T=p(A(y[0],y[0]),p(A(y[1],y[1]),A(y[2],y[2]))),N=g(T,f[0]),D=g(T,x[0]),L=g(T,C[0]),H=g(T,b[0]),V=p(A(x[0],x[0]),p(A(x[1],x[1]),A(x[2],x[2]))),O=g(V,f[0]),U=g(V,y[0]),j=g(V,C[0]),Y=g(V,b[0]),X=p(A(C[0],C[0]),p(A(C[1],C[1]),A(C[2],C[2]))),K=g(X,f[0]),J=g(X,y[0]),ee=g(X,x[0]),se=g(X,b[0]),ne=p(A(b[0],b[0]),p(A(b[1],b[1]),A(b[2],b[2]))),re=g(ne,f[0]),Z=g(ne,y[0]),te=g(ne,x[0]),ie=g(ne,C[0]),ce=p(p(p(g(p(g(m(ie,se),x[1]),p(g(m(te,Y),-C[1]),g(m(ee,j),b[1]))),y[2]),p(g(p(g(m(ie,se),y[1]),p(g(m(Z,H),-C[1]),g(m(J,L),b[1]))),-x[2]),g(p(g(m(te,Y),y[1]),p(g(m(Z,H),-x[1]),g(m(U,D),b[1]))),C[2]))),p(g(p(g(m(ee,j),y[1]),p(g(m(J,L),-x[1]),g(m(U,D),C[1]))),-b[2]),p(g(p(g(m(ie,se),y[1]),p(g(m(Z,H),-C[1]),g(m(J,L),b[1]))),f[2]),g(p(g(m(ie,se),f[1]),p(g(m(re,B),-C[1]),g(m(K,M),b[1]))),-y[2])))),p(p(g(p(g(m(Z,H),f[1]),p(g(m(re,B),-y[1]),g(m(N,v),b[1]))),C[2]),p(g(p(g(m(J,L),f[1]),p(g(m(K,M),-y[1]),g(m(N,v),C[1]))),-b[2]),g(p(g(m(ee,j),y[1]),p(g(m(J,L),-x[1]),g(m(U,D),C[1]))),f[2]))),p(g(p(g(m(ee,j),f[1]),p(g(m(K,M),-x[1]),g(m(O,P),C[1]))),-y[2]),p(g(p(g(m(J,L),f[1]),p(g(m(K,M),-y[1]),g(m(N,v),C[1]))),x[2]),g(p(g(m(U,D),f[1]),p(g(m(O,P),-y[1]),g(m(N,v),x[1]))),-C[2]))))),ue=p(p(p(g(p(g(m(ie,se),x[1]),p(g(m(te,Y),-C[1]),g(m(ee,j),b[1]))),f[2]),g(p(g(m(ie,se),f[1]),p(g(m(re,B),-C[1]),g(m(K,M),b[1]))),-x[2])),p(g(p(g(m(te,Y),f[1]),p(g(m(re,B),-x[1]),g(m(O,P),b[1]))),C[2]),g(p(g(m(ee,j),f[1]),p(g(m(K,M),-x[1]),g(m(O,P),C[1]))),-b[2]))),p(p(g(p(g(m(te,Y),y[1]),p(g(m(Z,H),-x[1]),g(m(U,D),b[1]))),f[2]),g(p(g(m(te,Y),f[1]),p(g(m(re,B),-x[1]),g(m(O,P),b[1]))),-y[2])),p(g(p(g(m(Z,H),f[1]),p(g(m(re,B),-y[1]),g(m(N,v),b[1]))),x[2]),g(p(g(m(U,D),f[1]),p(g(m(O,P),-y[1]),g(m(N,v),x[1]))),-b[2])))),de=m(ce,ue);return de[de.length-1]}}function h(p,m,A,g){return function(f,y,x,C,b,I){var v=p(p(A(f[0],f[0]),A(f[1],f[1])),p(A(f[2],f[2]),A(f[3],f[3]))),P=g(v,y[0]),M=g(v,x[0]),B=g(v,C[0]),T=g(v,b[0]),N=g(v,I[0]),D=p(p(A(y[0],y[0]),A(y[1],y[1])),p(A(y[2],y[2]),A(y[3],y[3]))),L=g(D,f[0]),H=g(D,x[0]),V=g(D,C[0]),O=g(D,b[0]),U=g(D,I[0]),j=p(p(A(x[0],x[0]),A(x[1],x[1])),p(A(x[2],x[2]),A(x[3],x[3]))),Y=g(j,f[0]),X=g(j,y[0]),K=g(j,C[0]),J=g(j,b[0]),ee=g(j,I[0]),se=p(p(A(C[0],C[0]),A(C[1],C[1])),p(A(C[2],C[2]),A(C[3],C[3]))),ne=g(se,f[0]),re=g(se,y[0]),Z=g(se,x[0]),te=g(se,b[0]),ie=g(se,I[0]),ce=p(p(A(b[0],b[0]),A(b[1],b[1])),p(A(b[2],b[2]),A(b[3],b[3]))),ue=g(ce,f[0]),de=g(ce,y[0]),me=g(ce,x[0]),ge=g(ce,C[0]),xe=g(ce,I[0]),Ee=p(p(A(I[0],I[0]),A(I[1],I[1])),p(A(I[2],I[2]),A(I[3],I[3]))),Re=g(Ee,f[0]),Me=g(Ee,y[0]),_e=g(Ee,x[0]),ye=g(Ee,C[0]),Se=g(Ee,b[0]),Ne=p(p(p(g(p(p(g(p(g(m(Se,xe),C[1]),p(g(m(ye,ie),-b[1]),g(m(ge,te),I[1]))),x[2]),g(p(g(m(Se,xe),x[1]),p(g(m(_e,ee),-b[1]),g(m(me,J),I[1]))),-C[2])),p(g(p(g(m(ye,ie),x[1]),p(g(m(_e,ee),-C[1]),g(m(Z,K),I[1]))),b[2]),g(p(g(m(ge,te),x[1]),p(g(m(me,J),-C[1]),g(m(Z,K),b[1]))),-I[2]))),y[3]),p(g(p(p(g(p(g(m(Se,xe),C[1]),p(g(m(ye,ie),-b[1]),g(m(ge,te),I[1]))),y[2]),g(p(g(m(Se,xe),y[1]),p(g(m(Me,U),-b[1]),g(m(de,O),I[1]))),-C[2])),p(g(p(g(m(ye,ie),y[1]),p(g(m(Me,U),-C[1]),g(m(re,V),I[1]))),b[2]),g(p(g(m(ge,te),y[1]),p(g(m(de,O),-C[1]),g(m(re,V),b[1]))),-I[2]))),-x[3]),g(p(p(g(p(g(m(Se,xe),x[1]),p(g(m(_e,ee),-b[1]),g(m(me,J),I[1]))),y[2]),g(p(g(m(Se,xe),y[1]),p(g(m(Me,U),-b[1]),g(m(de,O),I[1]))),-x[2])),p(g(p(g(m(_e,ee),y[1]),p(g(m(Me,U),-x[1]),g(m(X,H),I[1]))),b[2]),g(p(g(m(me,J),y[1]),p(g(m(de,O),-x[1]),g(m(X,H),b[1]))),-I[2]))),C[3]))),p(p(g(p(p(g(p(g(m(ye,ie),x[1]),p(g(m(_e,ee),-C[1]),g(m(Z,K),I[1]))),y[2]),g(p(g(m(ye,ie),y[1]),p(g(m(Me,U),-C[1]),g(m(re,V),I[1]))),-x[2])),p(g(p(g(m(_e,ee),y[1]),p(g(m(Me,U),-x[1]),g(m(X,H),I[1]))),C[2]),g(p(g(m(Z,K),y[1]),p(g(m(re,V),-x[1]),g(m(X,H),C[1]))),-I[2]))),-b[3]),g(p(p(g(p(g(m(ge,te),x[1]),p(g(m(me,J),-C[1]),g(m(Z,K),b[1]))),y[2]),g(p(g(m(ge,te),y[1]),p(g(m(de,O),-C[1]),g(m(re,V),b[1]))),-x[2])),p(g(p(g(m(me,J),y[1]),p(g(m(de,O),-x[1]),g(m(X,H),b[1]))),C[2]),g(p(g(m(Z,K),y[1]),p(g(m(re,V),-x[1]),g(m(X,H),C[1]))),-b[2]))),I[3])),p(g(p(p(g(p(g(m(Se,xe),C[1]),p(g(m(ye,ie),-b[1]),g(m(ge,te),I[1]))),y[2]),g(p(g(m(Se,xe),y[1]),p(g(m(Me,U),-b[1]),g(m(de,O),I[1]))),-C[2])),p(g(p(g(m(ye,ie),y[1]),p(g(m(Me,U),-C[1]),g(m(re,V),I[1]))),b[2]),g(p(g(m(ge,te),y[1]),p(g(m(de,O),-C[1]),g(m(re,V),b[1]))),-I[2]))),f[3]),g(p(p(g(p(g(m(Se,xe),C[1]),p(g(m(ye,ie),-b[1]),g(m(ge,te),I[1]))),f[2]),g(p(g(m(Se,xe),f[1]),p(g(m(Re,N),-b[1]),g(m(ue,T),I[1]))),-C[2])),p(g(p(g(m(ye,ie),f[1]),p(g(m(Re,N),-C[1]),g(m(ne,B),I[1]))),b[2]),g(p(g(m(ge,te),f[1]),p(g(m(ue,T),-C[1]),g(m(ne,B),b[1]))),-I[2]))),-y[3])))),p(p(p(g(p(p(g(p(g(m(Se,xe),y[1]),p(g(m(Me,U),-b[1]),g(m(de,O),I[1]))),f[2]),g(p(g(m(Se,xe),f[1]),p(g(m(Re,N),-b[1]),g(m(ue,T),I[1]))),-y[2])),p(g(p(g(m(Me,U),f[1]),p(g(m(Re,N),-y[1]),g(m(L,P),I[1]))),b[2]),g(p(g(m(de,O),f[1]),p(g(m(ue,T),-y[1]),g(m(L,P),b[1]))),-I[2]))),C[3]),g(p(p(g(p(g(m(ye,ie),y[1]),p(g(m(Me,U),-C[1]),g(m(re,V),I[1]))),f[2]),g(p(g(m(ye,ie),f[1]),p(g(m(Re,N),-C[1]),g(m(ne,B),I[1]))),-y[2])),p(g(p(g(m(Me,U),f[1]),p(g(m(Re,N),-y[1]),g(m(L,P),I[1]))),C[2]),g(p(g(m(re,V),f[1]),p(g(m(ne,B),-y[1]),g(m(L,P),C[1]))),-I[2]))),-b[3])),p(g(p(p(g(p(g(m(ge,te),y[1]),p(g(m(de,O),-C[1]),g(m(re,V),b[1]))),f[2]),g(p(g(m(ge,te),f[1]),p(g(m(ue,T),-C[1]),g(m(ne,B),b[1]))),-y[2])),p(g(p(g(m(de,O),f[1]),p(g(m(ue,T),-y[1]),g(m(L,P),b[1]))),C[2]),g(p(g(m(re,V),f[1]),p(g(m(ne,B),-y[1]),g(m(L,P),C[1]))),-b[2]))),I[3]),g(p(p(g(p(g(m(ye,ie),x[1]),p(g(m(_e,ee),-C[1]),g(m(Z,K),I[1]))),y[2]),g(p(g(m(ye,ie),y[1]),p(g(m(Me,U),-C[1]),g(m(re,V),I[1]))),-x[2])),p(g(p(g(m(_e,ee),y[1]),p(g(m(Me,U),-x[1]),g(m(X,H),I[1]))),C[2]),g(p(g(m(Z,K),y[1]),p(g(m(re,V),-x[1]),g(m(X,H),C[1]))),-I[2]))),f[3]))),p(p(g(p(p(g(p(g(m(ye,ie),x[1]),p(g(m(_e,ee),-C[1]),g(m(Z,K),I[1]))),f[2]),g(p(g(m(ye,ie),f[1]),p(g(m(Re,N),-C[1]),g(m(ne,B),I[1]))),-x[2])),p(g(p(g(m(_e,ee),f[1]),p(g(m(Re,N),-x[1]),g(m(Y,M),I[1]))),C[2]),g(p(g(m(Z,K),f[1]),p(g(m(ne,B),-x[1]),g(m(Y,M),C[1]))),-I[2]))),-y[3]),g(p(p(g(p(g(m(ye,ie),y[1]),p(g(m(Me,U),-C[1]),g(m(re,V),I[1]))),f[2]),g(p(g(m(ye,ie),f[1]),p(g(m(Re,N),-C[1]),g(m(ne,B),I[1]))),-y[2])),p(g(p(g(m(Me,U),f[1]),p(g(m(Re,N),-y[1]),g(m(L,P),I[1]))),C[2]),g(p(g(m(re,V),f[1]),p(g(m(ne,B),-y[1]),g(m(L,P),C[1]))),-I[2]))),x[3])),p(g(p(p(g(p(g(m(_e,ee),y[1]),p(g(m(Me,U),-x[1]),g(m(X,H),I[1]))),f[2]),g(p(g(m(_e,ee),f[1]),p(g(m(Re,N),-x[1]),g(m(Y,M),I[1]))),-y[2])),p(g(p(g(m(Me,U),f[1]),p(g(m(Re,N),-y[1]),g(m(L,P),I[1]))),x[2]),g(p(g(m(X,H),f[1]),p(g(m(Y,M),-y[1]),g(m(L,P),x[1]))),-I[2]))),-C[3]),g(p(p(g(p(g(m(Z,K),y[1]),p(g(m(re,V),-x[1]),g(m(X,H),C[1]))),f[2]),g(p(g(m(Z,K),f[1]),p(g(m(ne,B),-x[1]),g(m(Y,M),C[1]))),-y[2])),p(g(p(g(m(re,V),f[1]),p(g(m(ne,B),-y[1]),g(m(L,P),C[1]))),x[2]),g(p(g(m(X,H),f[1]),p(g(m(Y,M),-y[1]),g(m(L,P),x[1]))),-C[2]))),I[3]))))),Le=p(p(p(g(p(p(g(p(g(m(Se,xe),C[1]),p(g(m(ye,ie),-b[1]),g(m(ge,te),I[1]))),x[2]),g(p(g(m(Se,xe),x[1]),p(g(m(_e,ee),-b[1]),g(m(me,J),I[1]))),-C[2])),p(g(p(g(m(ye,ie),x[1]),p(g(m(_e,ee),-C[1]),g(m(Z,K),I[1]))),b[2]),g(p(g(m(ge,te),x[1]),p(g(m(me,J),-C[1]),g(m(Z,K),b[1]))),-I[2]))),f[3]),p(g(p(p(g(p(g(m(Se,xe),C[1]),p(g(m(ye,ie),-b[1]),g(m(ge,te),I[1]))),f[2]),g(p(g(m(Se,xe),f[1]),p(g(m(Re,N),-b[1]),g(m(ue,T),I[1]))),-C[2])),p(g(p(g(m(ye,ie),f[1]),p(g(m(Re,N),-C[1]),g(m(ne,B),I[1]))),b[2]),g(p(g(m(ge,te),f[1]),p(g(m(ue,T),-C[1]),g(m(ne,B),b[1]))),-I[2]))),-x[3]),g(p(p(g(p(g(m(Se,xe),x[1]),p(g(m(_e,ee),-b[1]),g(m(me,J),I[1]))),f[2]),g(p(g(m(Se,xe),f[1]),p(g(m(Re,N),-b[1]),g(m(ue,T),I[1]))),-x[2])),p(g(p(g(m(_e,ee),f[1]),p(g(m(Re,N),-x[1]),g(m(Y,M),I[1]))),b[2]),g(p(g(m(me,J),f[1]),p(g(m(ue,T),-x[1]),g(m(Y,M),b[1]))),-I[2]))),C[3]))),p(p(g(p(p(g(p(g(m(ye,ie),x[1]),p(g(m(_e,ee),-C[1]),g(m(Z,K),I[1]))),f[2]),g(p(g(m(ye,ie),f[1]),p(g(m(Re,N),-C[1]),g(m(ne,B),I[1]))),-x[2])),p(g(p(g(m(_e,ee),f[1]),p(g(m(Re,N),-x[1]),g(m(Y,M),I[1]))),C[2]),g(p(g(m(Z,K),f[1]),p(g(m(ne,B),-x[1]),g(m(Y,M),C[1]))),-I[2]))),-b[3]),g(p(p(g(p(g(m(ge,te),x[1]),p(g(m(me,J),-C[1]),g(m(Z,K),b[1]))),f[2]),g(p(g(m(ge,te),f[1]),p(g(m(ue,T),-C[1]),g(m(ne,B),b[1]))),-x[2])),p(g(p(g(m(me,J),f[1]),p(g(m(ue,T),-x[1]),g(m(Y,M),b[1]))),C[2]),g(p(g(m(Z,K),f[1]),p(g(m(ne,B),-x[1]),g(m(Y,M),C[1]))),-b[2]))),I[3])),p(g(p(p(g(p(g(m(Se,xe),x[1]),p(g(m(_e,ee),-b[1]),g(m(me,J),I[1]))),y[2]),g(p(g(m(Se,xe),y[1]),p(g(m(Me,U),-b[1]),g(m(de,O),I[1]))),-x[2])),p(g(p(g(m(_e,ee),y[1]),p(g(m(Me,U),-x[1]),g(m(X,H),I[1]))),b[2]),g(p(g(m(me,J),y[1]),p(g(m(de,O),-x[1]),g(m(X,H),b[1]))),-I[2]))),f[3]),g(p(p(g(p(g(m(Se,xe),x[1]),p(g(m(_e,ee),-b[1]),g(m(me,J),I[1]))),f[2]),g(p(g(m(Se,xe),f[1]),p(g(m(Re,N),-b[1]),g(m(ue,T),I[1]))),-x[2])),p(g(p(g(m(_e,ee),f[1]),p(g(m(Re,N),-x[1]),g(m(Y,M),I[1]))),b[2]),g(p(g(m(me,J),f[1]),p(g(m(ue,T),-x[1]),g(m(Y,M),b[1]))),-I[2]))),-y[3])))),p(p(p(g(p(p(g(p(g(m(Se,xe),y[1]),p(g(m(Me,U),-b[1]),g(m(de,O),I[1]))),f[2]),g(p(g(m(Se,xe),f[1]),p(g(m(Re,N),-b[1]),g(m(ue,T),I[1]))),-y[2])),p(g(p(g(m(Me,U),f[1]),p(g(m(Re,N),-y[1]),g(m(L,P),I[1]))),b[2]),g(p(g(m(de,O),f[1]),p(g(m(ue,T),-y[1]),g(m(L,P),b[1]))),-I[2]))),x[3]),g(p(p(g(p(g(m(_e,ee),y[1]),p(g(m(Me,U),-x[1]),g(m(X,H),I[1]))),f[2]),g(p(g(m(_e,ee),f[1]),p(g(m(Re,N),-x[1]),g(m(Y,M),I[1]))),-y[2])),p(g(p(g(m(Me,U),f[1]),p(g(m(Re,N),-y[1]),g(m(L,P),I[1]))),x[2]),g(p(g(m(X,H),f[1]),p(g(m(Y,M),-y[1]),g(m(L,P),x[1]))),-I[2]))),-b[3])),p(g(p(p(g(p(g(m(me,J),y[1]),p(g(m(de,O),-x[1]),g(m(X,H),b[1]))),f[2]),g(p(g(m(me,J),f[1]),p(g(m(ue,T),-x[1]),g(m(Y,M),b[1]))),-y[2])),p(g(p(g(m(de,O),f[1]),p(g(m(ue,T),-y[1]),g(m(L,P),b[1]))),x[2]),g(p(g(m(X,H),f[1]),p(g(m(Y,M),-y[1]),g(m(L,P),x[1]))),-b[2]))),I[3]),g(p(p(g(p(g(m(ge,te),x[1]),p(g(m(me,J),-C[1]),g(m(Z,K),b[1]))),y[2]),g(p(g(m(ge,te),y[1]),p(g(m(de,O),-C[1]),g(m(re,V),b[1]))),-x[2])),p(g(p(g(m(me,J),y[1]),p(g(m(de,O),-x[1]),g(m(X,H),b[1]))),C[2]),g(p(g(m(Z,K),y[1]),p(g(m(re,V),-x[1]),g(m(X,H),C[1]))),-b[2]))),f[3]))),p(p(g(p(p(g(p(g(m(ge,te),x[1]),p(g(m(me,J),-C[1]),g(m(Z,K),b[1]))),f[2]),g(p(g(m(ge,te),f[1]),p(g(m(ue,T),-C[1]),g(m(ne,B),b[1]))),-x[2])),p(g(p(g(m(me,J),f[1]),p(g(m(ue,T),-x[1]),g(m(Y,M),b[1]))),C[2]),g(p(g(m(Z,K),f[1]),p(g(m(ne,B),-x[1]),g(m(Y,M),C[1]))),-b[2]))),-y[3]),g(p(p(g(p(g(m(ge,te),y[1]),p(g(m(de,O),-C[1]),g(m(re,V),b[1]))),f[2]),g(p(g(m(ge,te),f[1]),p(g(m(ue,T),-C[1]),g(m(ne,B),b[1]))),-y[2])),p(g(p(g(m(de,O),f[1]),p(g(m(ue,T),-y[1]),g(m(L,P),b[1]))),C[2]),g(p(g(m(re,V),f[1]),p(g(m(ne,B),-y[1]),g(m(L,P),C[1]))),-b[2]))),x[3])),p(g(p(p(g(p(g(m(me,J),y[1]),p(g(m(de,O),-x[1]),g(m(X,H),b[1]))),f[2]),g(p(g(m(me,J),f[1]),p(g(m(ue,T),-x[1]),g(m(Y,M),b[1]))),-y[2])),p(g(p(g(m(de,O),f[1]),p(g(m(ue,T),-y[1]),g(m(L,P),b[1]))),x[2]),g(p(g(m(X,H),f[1]),p(g(m(Y,M),-y[1]),g(m(L,P),x[1]))),-b[2]))),-C[3]),g(p(p(g(p(g(m(Z,K),y[1]),p(g(m(re,V),-x[1]),g(m(X,H),C[1]))),f[2]),g(p(g(m(Z,K),f[1]),p(g(m(ne,B),-x[1]),g(m(Y,M),C[1]))),-y[2])),p(g(p(g(m(re,V),f[1]),p(g(m(ne,B),-y[1]),g(m(L,P),C[1]))),x[2]),g(p(g(m(X,H),f[1]),p(g(m(Y,M),-y[1]),g(m(L,P),x[1]))),-C[2]))),b[3]))))),nt=m(Ne,Le);return nt[nt.length-1]}}var d=[function(){return 0},function(){return 0},function(){return 0}];function u(p){var m=d[p.length];return m||(m=d[p.length]=s(p.length)),m.apply(void 0,p)}function _(p,m,A,g,f,y,x,C){return function(b,I,v,P,M,B){switch(arguments.length){case 0:case 1:return 0;case 2:return g(b,I);case 3:return f(b,I,v);case 4:return y(b,I,v,P);case 5:return x(b,I,v,P,M);case 6:return C(b,I,v,P,M,B)}for(var T=Array(arguments.length),N=0;N<arguments.length;++N)T[N]=arguments[N];return p(T)}}(function(){for(;d.length<=6;)d.push(s(d.length));t.exports=_.apply(void 0,[u].concat(d));for(var p=0;p<=6;++p)t.exports[p]=d[p]})()}}),cUr=i3({"node_modules/cdt2d/lib/delaunay.js"(e,t){var n=aUr()[4];M7e();function o(r,i,s,a,c,l){var h=i.opposite(a,c);if(!(h<0)){if(c<a){var d=a;a=c,c=d,d=l,l=h,h=d}i.isConstraint(a,c)||n(r[a],r[c],r[l],r[h])<0&&s.push(a,c)}}t.exports=function(r,i){for(var s=[],a=r.length,c=i.stars,l=0;l<a;++l)for(var h=c[l],d=1;d<h.length;d+=2)if(!((m=h[d])<l)&&!i.isConstraint(l,m)){for(var u=h[d-1],_=-1,p=1;p<h.length;p+=2)if(h[p-1]===m){_=h[p];break}_<0||n(r[l],r[m],r[u],r[_])<0&&s.push(l,m)}for(;s.length>0;){for(var m=s.pop(),A=(u=-1,_=-1,h=c[l=s.pop()],1);A<h.length;A+=2){var g=h[A-1],f=h[A];g===m?_=f:f===m&&(u=g)}u<0||_<0||(n(r[l],r[m],r[u],r[_])>=0||(i.flip(l,m),o(r,i,s,u,l,_),o(r,i,s,l,_,u),o(r,i,s,_,m,u),o(r,i,s,m,u,_)))}}}}),lUr=i3({"node_modules/cdt2d/lib/filter.js"(e,t){var n=M7e();function o(i,s,a,c,l,h,d){this.cells=i,this.neighbor=s,this.flags=c,this.constraint=a,this.active=l,this.next=h,this.boundary=d}function r(i,s){return i[0]-s[0]||i[1]-s[1]||i[2]-s[2]}t.exports=function(i,s,a){var c=function(C,b){for(var I=C.cells(),v=I.length,P=0;P<v;++P){var M=(j=I[P])[0],B=j[1],T=j[2];B<T?B<M&&(j[0]=B,j[1]=T,j[2]=M):T<M&&(j[0]=T,j[1]=M,j[2]=B)}I.sort(r);var N=Array(v);for(P=0;P<N.length;++P)N[P]=0;var D=[],L=[],H=Array(3*v),V=Array(3*v),O=null;b&&(O=[]);var U=new o(I,H,V,N,D,L,O);for(P=0;P<v;++P)for(var j=I[P],Y=0;Y<3;++Y){M=j[Y],B=j[(Y+1)%3];var X=H[3*P+Y]=U.locate(B,M,C.opposite(B,M)),K=V[3*P+Y]=C.isConstraint(M,B);X<0&&(K?L.push(P):(D.push(P),N[P]=1),b&&O.push([B,M,-1]))}return U}(i,a);if(s===0)return a?c.cells.concat(c.boundary):c.cells;var l=1,{active:h,next:d,flags:u,cells:_,constraint:p,neighbor:m}=c;for(;h.length>0||d.length>0;){for(;h.length>0;){var A=h.pop();if(u[A]!==-l){u[A]=l,_[A];for(var g=0;g<3;++g){var f=m[3*A+g];f>=0&&u[f]===0&&(p[3*A+g]?d.push(f):(h.push(f),u[f]=l))}}}var y=d;d=h,h=y,d.length=0,l=-l}var x=function(C,b,I){for(var v=0,P=0;P<C.length;++P)b[P]===I&&(C[v++]=C[P]);return C.length=v,C}(_,u,s);if(a)return x.concat(c.boundary);return x},o.prototype.locate=function(){var i=[0,0,0];return function(s,a,c){var l=s,h=a,d=c;return a<c?a<s&&(l=a,h=c,d=s):c<s&&(l=c,h=s,d=a),l<0?-1:(i[0]=l,i[1]=h,i[2]=d,n.eq(this.cells,i,r))}}()}}),hUr=i3({"node_modules/cdt2d/cdt2d.js"(e,t){var n=iUr(),o=sUr(),r=cUr(),i=lUr();function s(l){return[Math.min(l[0],l[1]),Math.max(l[0],l[1])]}function a(l,h){return l[0]-h[0]||l[1]-h[1]}function c(l,h,d){return h in l?l[h]:d}t.exports=function(l,h,d){Array.isArray(h)?(d=d||{},h=h||[]):(d=h||{},h=[]);var u=!!c(d,"delaunay",!0),_=!!c(d,"interior",!0),p=!!c(d,"exterior",!0),m=!!c(d,"infinity",!1);if(!_&&!p||l.length===0)return[];var A=n(l,h);if(u||_!==p||m){for(var g=o(l.length,function(x){return x.map(s).sort(a)}(h)),f=0;f<A.length;++f){var y=A[f];g.addTriangle(y[0],y[1],y[2])}return u&&r(l,g),p?_?m?i(g,0,m):g.cells():i(g,1,m):i(g,-1)}return A}}}),{cos:OXs,sin:VXs,PI:YXs}=Math,{tan:GXs}=Math,ICn=!0,yde={CCW:-1,CW:1,NOT_ORIENTABLE:0},dUr=2*Math.PI,A8e=Object.freeze({__proto__:null,BOUNDARY:2,CCW:ICn,CONTAINS:3,CW:!1,END_VERTEX:2,INSIDE:1,INTERLACE:4,NOT_VERTEX:0,ORIENTATION:yde,OUTSIDE:0,OVERLAP_OPPOSITE:2,OVERLAP_SAME:1,PIx2:dUr,START_VERTEX:1}),$S=0.000001;function vCn(e){$S=e}function SCn(){return $S}function nrt(e){return e<$S&&e>-$S}function wY(e,t){return e-t<$S&&e-t>-$S}function PCn(e,t){return e-t>$S}function ECn(e,t){return e-t<-$S}var Xe={Utils:Object.freeze({__proto__:null,DECIMALS:3,EQ:wY,EQ_0:nrt,GE:function(e,t){return e-t>-$S},GT:PCn,LE:function(e,t){return e-t<$S},LT:ECn,getTolerance:SCn,setTolerance:vCn}),Errors:void 0,Matrix:void 0,Planar_set:void 0,Point:void 0,Vector:void 0,Line:void 0,Circle:void 0,Segment:void 0,Arc:void 0,Box:void 0,Edge:void 0,Face:void 0,Ray:void 0,Ray_shooting:void 0,Multiline:void 0,Polygon:void 0,Distance:void 0,Inversion:void 0};for(let e in A8e)Xe[e]=A8e[e];Object.defineProperty(Xe,"DP_TOL",{get:function(){return SCn()},set:function(e){vCn(e)}});var Xu=class{static get ILLEGAL_PARAMETERS(){return ReferenceError("Illegal Parameters")}static get ZERO_DIVISION(){return Error("Zero division")}static get UNRESOLVED_BOUNDARY_CONFLICT(){return Error("Unresolved boundary conflict in boolean operation")}static get INFINITE_LOOP(){return Error("Infinite loop")}static get CANNOT_COMPLETE_BOOLEAN_OPERATION(){return Error("Cannot complete boolean operation")}static get CANNOT_INVOKE_ABSTRACT_METHOD(){return Error("Abstract method cannot be invoked")}static get OPERATION_IS_NOT_SUPPORTED(){return Error("Operation is not supported")}static get UNSUPPORTED_SHAPE_TYPE(){return Error("Unsupported shape type")}};Xe.Errors=Xu;var lst=class{constructor(e,t){this.first=e,this.last=t||this.first}[Symbol.iterator](){let e;return{next:()=>(e=e?e.next:this.first,{value:e,done:e===void 0})}}get size(){let e=0;for(let t of this)e++;return e}toArray(e=void 0,t=void 0){let n=[],o=e||this.first,r=t||this.last,i=o;if(i===void 0)return n;do n.push(i),i=i.next;while(i!==r.next);return n}append(e){return this.isEmpty()?this.first=e:(e.prev=this.last,this.last.next=e),this.last=e,this.last.next=void 0,this.first.prev=void 0,this}insert(e,t){if(this.isEmpty())this.first=e,this.last=e;else if(t==null)e.next=this.first,this.first.prev=e,this.first=e;else{let n=t.next;t.next=e,n&&(n.prev=e),e.prev=t,e.next=n,this.last===t&&(this.last=e)}return this.last.next=void 0,this.first.prev=void 0,this}remove(e){return e===this.first&&e===this.last?(this.first=void 0,this.last=void 0):(e.prev&&(e.prev.next=e.next),e.next&&(e.next.prev=e.prev),e===this.first&&(this.first=e.next),e===this.last&&(this.last=e.prev)),this}isEmpty(){return this.first===void 0}static testInfiniteLoop(e){let t=e,n=e;do{if(t!=e&&t===n)throw Xu.INFINITE_LOOP;t=t.next,n=n.next.next}while(t!=e)}},sfn={stroke:"black"},uUr=class{constructor(e=sfn){for(let t in e)this[t]=e[t];this.stroke=e.stroke??sfn.stroke}toAttributesString(){return Object.keys(this).reduce((e,t)=>e+(this[t]!==void 0?this.toAttrString(t,this[t]):""),"")}toAttrString(e,t){let n=e==="className"?"class":this.convertCamelToKebabCase(e);return t===null?`${n} `:`${n}="${t.toString()}" `}convertCamelToKebabCase(e){return e.match(/[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[0-9]+/g).join("-").toLowerCase()}};function GY(e){return new uUr(e).toAttributesString()}function PZ(e,t){let n=[],[o,r,i]=e.standard,[s,a,c]=t.standard,l=o*a-r*s,h=i*a-r*c,d=o*c-i*s;if(!Xe.Utils.EQ_0(l)){let u,_;r===0?(u=i/o,_=d/l):a===0?(u=c/s,_=d/l):o===0?(u=h/l,_=i/r):s===0?(u=h/l,_=c/a):(u=h/l,_=d/l),n.push(new Xe.Point(u,_))}return n}function UY(e,t){let n=[],o=t.pc.projectionOn(e),r=t.pc.distanceTo(o)[0];if(Xe.Utils.EQ(r,t.r))n.push(o);else if(Xe.Utils.LT(r,t.r)){let i,s,a=Math.sqrt(t.r*t.r-r*r);i=e.norm.rotate90CCW().multiply(a),s=o.translate(i),n.push(s),i=e.norm.rotate90CW().multiply(a),s=o.translate(i),n.push(s)}return n}function eZ(e,t){let n=[];for(let o of t.toSegments()){let r=Que(o,e);for(let i of r)QCn(i,n)||n.push(i)}return n}function w7e(e,t){let n=[];if(eZ(e,t.box).length===0)return n;let o=UY(e,new Xe.Circle(t.pc,t.r));for(let r of o)r.on(t)&&n.push(r);return n}function Que(e,t){let n=[];return e.ps.on(t)&&n.push(e.ps),e.pe.on(t)&&!e.isZeroLength()&&n.push(e.pe),n.length>0||e.isZeroLength()||e.ps.leftTo(t)&&e.pe.leftTo(t)||!e.ps.leftTo(t)&&!e.pe.leftTo(t)?n:PZ(new Xe.Line(e.ps,e.pe),t)}function f8e(e,t){let n=[];if(e.isZeroLength())return e.ps.on(t)&&n.push(e.ps),n;if(t.isZeroLength())return t.ps.on(e)&&n.push(t.ps),n;let o=new Xe.Line(e.ps,e.pe),r=new Xe.Line(t.ps,t.pe);if(o.incidentTo(r))e.ps.on(t)&&n.push(e.ps),e.pe.on(t)&&n.push(e.pe),!t.ps.on(e)||t.ps.equalTo(e.ps)||t.ps.equalTo(e.pe)||n.push(t.ps),!t.pe.on(e)||t.pe.equalTo(e.ps)||t.pe.equalTo(e.pe)||n.push(t.pe);else{let i=PZ(o,r);i.length>0&&afn(i[0],e)&&afn(i[0],t)&&n.push(i[0])}return n}function afn(e,t){let n=t.box;return Xe.Utils.LE(e.x,n.xmax)&&Xe.Utils.GE(e.x,n.xmin)&&Xe.Utils.LE(e.y,n.ymax)&&Xe.Utils.GE(e.y,n.ymin)}function y8e(e,t){let n=[];if(e.isZeroLength()){let[r,i]=e.ps.distanceTo(t.pc);return Xe.Utils.EQ(r,t.r)&&n.push(e.ps),n}let o=UY(new Xe.Line(e.ps,e.pe),t);for(let r of o)r.on(e)&&n.push(r);return n}function tZ(e,t){let n=[];if(e.isZeroLength())return e.ps.on(t)&&n.push(e.ps),n;let o=UY(new Xe.Line(e.ps,e.pe),new Xe.Circle(t.pc,t.r));for(let r of o)r.on(e)&&r.on(t)&&n.push(r);return n}function MCn(e,t){let n=[],o=new Xe.Vector(e.pc,t.pc),r=e.r,i=t.r;if(Xe.Utils.EQ_0(r)||Xe.Utils.EQ_0(i))return n;if(Xe.Utils.EQ_0(o.x)&&Xe.Utils.EQ_0(o.y)&&Xe.Utils.EQ(r,i))return n.push(e.pc.translate(-r,0)),n;let s,a=e.pc.distanceTo(t.pc)[0];if(Xe.Utils.GT(a,r+i))return n;if(Xe.Utils.LT(a,Math.abs(r-i)))return n;if(o.x/=a,o.y/=a,Xe.Utils.EQ(a,r+i)||Xe.Utils.EQ(a,Math.abs(r-i)))return s=e.pc.translate(r*o.x,r*o.y),n.push(s),n;let c=r*r/(2*a)-i*i/(2*a)+a/2,l=e.pc.translate(c*o.x,c*o.y),h=Math.sqrt(r*r-c*c);return s=l.translate(o.rotate90CCW().multiply(h)),n.push(s),s=l.translate(o.rotate90CW().multiply(h)),n.push(s),n}function wCn(e,t){let n=[];if(e.pc.equalTo(t.pc)&&Xe.Utils.EQ(e.r,t.r)){let s;return s=e.start,s.on(t)&&n.push(s),s=e.end,s.on(t)&&n.push(s),s=t.start,s.on(e)&&n.push(s),s=t.end,s.on(e)&&n.push(s),n}let o=new Xe.Circle(e.pc,e.r),r=new Xe.Circle(t.pc,t.r),i=o.intersect(r);for(let s of i)s.on(e)&&s.on(t)&&n.push(s);return n}function hst(e,t){let n=[];if(t.pc.equalTo(e.pc)&&Xe.Utils.EQ(t.r,e.r))return n.push(e.start),n.push(e.end),n;let o=MCn(t,new Xe.Circle(e.pc,e.r));for(let r of o)r.on(e)&&n.push(r);return n}function BCn(e,t){return e.isSegment?f8e(e.shape,t):tZ(t,e.shape)}function TCn(e,t){return e.isSegment?tZ(e.shape,t):wCn(e.shape,t)}function DCn(e,t){return e.isSegment?Que(e.shape,t):w7e(t,e.shape)}function pUr(e,t){return e.isSegment?y8e(e.shape,t):hst(e.shape,t)}function dst(e,t){let n=[];for(let o of t.edges)for(let r of BCn(o,e))n.push(r);return n}function ust(e,t){let n=[];for(let o of t.edges)for(let r of TCn(o,e))n.push(r);return n}function kue(e,t){let n=[];if(t.isEmpty())return n;for(let o of t.edges)for(let r of DCn(o,e))QCn(r,n)||n.push(r);return e.sortPoints(n)}function NCn(e,t){let n=[];if(t.isEmpty())return n;for(let o of t.edges)for(let r of pUr(o,e))n.push(r);return n}function RCn(e,t){return e.isSegment?BCn(t,e.shape):e.isArc?TCn(t,e.shape):e.isLine?DCn(t,e.shape):e.isRay?(n=t,o=e.shape,n.isSegment?pst(o,n.shape):mst(o,n.shape)):[];var n,o}function cfn(e,t){let n=[];if(t.isEmpty()||e.shape.box.not_intersect(t.box))return n;let o=t.edges.search(e.shape.box);for(let r of o)n=[...n,...RCn(e,r)];return n}function QCn(e,t){return t.some((n)=>n.equalTo(e))}function Ik(e){return new Xe.Line(e.start,e.norm)}function pst(e,t){return Que(t,Ik(e)).filter((n)=>e.contains(n))}function mst(e,t){return w7e(Ik(e),t).filter((n)=>e.contains(n))}function kCn(e,t){return UY(Ik(e),t).filter((n)=>e.contains(n))}function LCn(e,t){return PZ(Ik(e),t).filter((n)=>e.contains(n))}function HCn(e,t){return kue(Ik(e),t).filter((n)=>e.contains(n))}function FCn(e,t){if(e.intersect&&e.intersect instanceof Function)return e.intersect(t);throw Xu.UNSUPPORTED_SHAPE_TYPE}function EZ(e,t){let n=[];for(let o of t)n=[...n,...FCn(e,o.shape)];return n}var CY=class e extends lst{constructor(...t){if(super(),this.isInfinite=!1,t.length===1&&t[0]instanceof Array&&t[0].length>0){let n=t[0],o=n.length,r=(s)=>s instanceof Xe.Segment||s instanceof Xe.Arc||s instanceof Xe.Ray,i=(s)=>s instanceof Xe.Segment||s instanceof Xe.Arc;if(!(o===1&&((s)=>s instanceof Xe.Segment||s instanceof Xe.Arc||s instanceof Xe.Ray||s instanceof Xe.Line)(n[0])||o>1&&r(n[0])&&r(n[o-1])&&n.slice(1,o-1).every(i)))throw Xe.Errors.ILLEGAL_PARAMETERS;this.isInfinite=n.some((s)=>s instanceof Xe.Ray||s instanceof Xe.Line);for(let s of n){let a=new Xe.Edge(s);this.append(a)}this.setArcLength()}}get edges(){return[...this]}get box(){return this.edges.reduce((t,n)=>t.merge(n.box),new Xe.Box)}get vertices(){let t=this.edges.map((n)=>n.start);return t.push(this.last.end),t}get length(){if(this.isEmpty())return 0;if(this.isInfinite)return Number.POSITIVE_INFINITY;let t=0;for(let n of this)t+=n.length;return t}clone(){return new e(this.toShapes())}setArcLength(){for(let t of this)this.setOneEdgeArcLength(t)}setOneEdgeArcLength(t){t===this.first?t.arc_length=0:t.arc_length=t.prev.arc_length+t.prev.length}pointAtLength(t){if(t>this.length||t<0)return null;if(this.isInfinite)return null;let n=null;for(let o of this)if(t>=o.arc_length&&(o===this.last||t<o.next.arc_length)){n=o.pointAtLength(t-o.arc_length);break}return n}addVertex(t,n){let o=n.shape.split(t);if(o[0]===null)return n.prev;if(o[1]===null)return n;let r=new Xe.Edge(o[0]),i=n.prev;return this.insert(r,i),n.shape=o[1],r}getChain(t,n){let o=[];for(let r=t;r!==n.next;r=r.next)o.push(r);return o}split(t){for(let n of t){let o=this.findEdgeByPoint(n);this.addVertex(n,o)}return this}findEdgeByPoint(t){let n;for(let o of this)if(o.shape.contains(t)){n=o;break}return n}distanceTo(t){if(t instanceof Point){let[n,o]=Xe.Distance.shape2multiline(t,this);return[n,o.reverse()]}if(t instanceof Xe.Line){let[n,o]=Xe.Distance.shape2multiline(t,this);return[n,o.reverse()]}if(t instanceof Xe.Circle){let[n,o]=Xe.Distance.shape2multiline(t,this);return[n,o.reverse()]}if(t instanceof Xe.Segment){let[n,o]=Xe.Distance.shape2multiline(t,this);return[n,o.reverse()]}if(t instanceof Xe.Arc){let[n,o]=Xe.Distance.shape2multiline(t,this);return[n,o.reverse()]}if(t instanceof Xe.Multiline)return Xe.Distance.multiline2multiline(this,t);throw Xe.Errors.UNSUPPORTED_SHAPE_TYPE}intersect(t){return t instanceof Xe.Multiline?function(n,o){let r=[];for(let i of n)for(let s of o)r=[...r,...FCn(i.shape,s.shape)];return r}(this,t):EZ(t,this)}contains(t){if(t instanceof Xe.Point)return this.edges.some((n)=>n.shape.contains(t));throw Xe.Errors.UNSUPPORTED_SHAPE_TYPE}translate(t){return new e(this.edges.map((n)=>n.shape.translate(t)))}rotate(t=0,n=new Xe.Point){return new e(this.edges.map((o)=>o.shape.rotate(t,n)))}transform(t=new Xe.Matrix){return new e(this.edges.map((n)=>n.shape.transform(t)))}toShapes(){return this.edges.map((t)=>t.shape.clone())}toJSON(){return this.edges.map((t)=>t.toJSON())}svgPoints(){return this.vertices.map((t)=>`${t.x},${t.y}`).join(" ")}dpath(){let t=`M${this.first.start.x},${this.first.start.y}`;for(let n of this)t+=n.svg();return t}svg(t={}){let n=`
<path ${GY({fill:"none",...t})} d="`;n+=`
M${this.first.start.x},${this.first.start.y}`;for(let o of this)n+=o.svg();return n+=`" >
</path>`,n}};Xe.Multiline=CY;function nZ(e,t,n){let o=n.length,r=e.shape.split(t);if(r.length===0)return;let i=0;i=r[0]===null?0:r[1]===null?e.shape.length:r[0].length;let s,a=0;wY(i,0)&&(a|=1),wY(i,e.shape.length)&&(a|=2),s=i===1/0?r[0].coord(t):2&a&&e.next&&e.next.arc_length===0?0:e.arc_length+i,n.push({id:o,pt:t,arc_length:s,edge_before:e,edge_after:void 0,face:e.face,is_vertex:a})}function Gde(e){e.int_points1_sorted=ik(e.int_points1),e.int_points2_sorted=ik(e.int_points2)}function ik(e){let t=new Map,n=0;for(let o of e)t.has(o.face)||(t.set(o.face,n),n++);for(let o of e)o.faceId=t.get(o.face);return e.slice().sort(mUr)}function mUr(e,t){return e.faceId<t.faceId?-1:e.faceId>t.faceId?1:e.arc_length<t.arc_length?-1:e.arc_length>t.arc_length?1:0}function _st(e){if(e.int_points1.length<2)return;let t,n,o,r,i=!1;for(let s=0;s<e.int_points1_sorted.length;s++)if(e.int_points1_sorted[s].id!==-1){t=e.int_points1_sorted[s],n=e.int_points2[t.id];for(let a=s+1;a<e.int_points1_sorted.length&&(o=e.int_points1_sorted[a],wY(o.arc_length,t.arc_length));a++)o.id!==-1&&(r=e.int_points2[o.id],r.id!==-1&&o.edge_before===t.edge_before&&o.edge_after===t.edge_after&&r.edge_before===n.edge_before&&r.edge_after===n.edge_after&&(o.id=-1,r.id=-1,i=!0))}n=e.int_points2_sorted[0],t=e.int_points1[n.id];for(let s=1;s<e.int_points2_sorted.length;s++){let a=e.int_points2_sorted[s];if(a.id===-1)continue;if(n.id===-1||!wY(a.arc_length,n.arc_length)){n=a,t=e.int_points1[n.id];continue}let c=e.int_points1[a.id];c.edge_before===t.edge_before&&c.edge_after===t.edge_after&&a.edge_before===n.edge_before&&a.edge_after===n.edge_after&&(c.id=-1,a.id=-1,i=!0)}i&&(e.int_points1=e.int_points1.filter((s)=>s.id>=0),e.int_points2=e.int_points2.filter((s)=>s.id>=0),e.int_points1.forEach((s,a)=>s.id=a),e.int_points2.forEach((s,a)=>s.id=a))}function ort(e){for(let t of e)t.edge_before&&(t.edge_before.bvStart=void 0,t.edge_before.bvEnd=void 0,t.edge_before.bv=void 0,t.edge_before.overlap=void 0),t.edge_after&&(t.edge_after.bvStart=void 0,t.edge_after.bvEnd=void 0,t.edge_after.bv=void 0,t.edge_after.overlap=void 0);for(let t of e)t.edge_before&&(t.edge_before.bvEnd=2),t.edge_after&&(t.edge_after.bvStart=2)}function rrt(e,t){for(let n of e)n.edge_before&&n.edge_before.setInclusion(t),n.edge_after&&n.edge_after.setInclusion(t)}function oZ(e,t,n){let o,r,i=1;if(e.length===1)return 1;o=e[t];for(let s=t+1;s<e.length&&o.face===n&&(r=e[s],r.pt.equalTo(o.pt)&&r.edge_before===o.edge_before&&r.edge_after===o.edge_after);s++)i++;return i}function rZ(e,t){if(t){for(let n of t){let o=n.edge_before;if(n.is_vertex=0,o.shape.start&&o.shape.start.equalTo(n.pt)&&(n.is_vertex|=1),o.shape.end&&o.shape.end.equalTo(n.pt)&&(n.is_vertex|=2),1&n.is_vertex){n.edge_before=o.prev,o.prev&&(n.is_vertex=2);continue}if(2&n.is_vertex)continue;let r=e.addVertex(n.pt,o);n.edge_before=r}for(let n of t)n.edge_before?n.edge_after=n.edge_before.next:e instanceof CY&&1&n.is_vertex&&(n.edge_after=e.first)}}function lfn(e,t,n){let o=e.edge_before,r=t.edge_after,i=n.length;o.next=n[0],n[0].prev=o,n[i-1].next=r,r.prev=n[i-1]}Xe.multiline=(...e)=>new Xe.Multiline(...e);var{INSIDE:NS,OUTSIDE:RS,BOUNDARY:IA,OVERLAP_SAME:_Ur,OVERLAP_OPPOSITE:gUr}=A8e,{NOT_VERTEX:UXs,START_VERTEX:hfn,END_VERTEX:dfn}=A8e;function irt(e,t){let n=t.clone().reverse(),[o,r]=Lue(e,n,3,!0);return o}function zCn(e,t){let[n,o]=Lue(e,t,2,!0);return n}function OCn(e,t){let[n,o]=Lue(e,t,2,!1),r=[];for(let s of n.faces)r=[...r,...[...s.edges].map((a)=>a.shape)];let i=[];for(let s of o.faces)i=[...i,...[...s.edges].map((a)=>a.shape)];return[r,i]}function srt(e,t){let[n,o]=Lue(e,t,3,!1),r=[];for(let i of n.faces)r=[...r,...[...i.edges].map((s)=>s.shape)];return r}function VCn(e,t){let n=e.clone(),o=t.clone(),r=YCn(n,o);return Gde(r),rZ(n,r.int_points1_sorted),rZ(o,r.int_points2_sorted),_st(r),Gde(r),[r.int_points1_sorted.map((i)=>i.pt),r.int_points2_sorted.map((i)=>i.pt)]}function AUr(e,t,n,o){let r=ufn(e,n.int_points1),i=ufn(t,n.int_points2);for(pfn(r,t),pfn(i,e),ort(n.int_points1),ort(n.int_points2),rrt(n.int_points1,t),rrt(n.int_points2,e);fUr(e,t,n.int_points1,n.int_points1_sorted,n.int_points2,n););(function(s){let a,c,l,h=s.int_points1.length;for(let d=0;d<h;d++){let u=s.int_points1_sorted[d];u.face!==a&&(c=d,a=u.face);let _,p=d,m=oZ(s.int_points1_sorted,d,a);_=p+m<h&&s.int_points1_sorted[p+m].face===a?p+m:c;let A=oZ(s.int_points1_sorted,_,a);l=null;for(let I=_;I<_+A;I++){let v=s.int_points1_sorted[I];if(v.face===a&&s.int_points2[v.id].face===s.int_points2[u.id].face){l=v;break}}if(l===null)continue;let g=u.edge_after,f=l.edge_before;if(g.bv!==2||f.bv!==2)continue;if(g!==f)continue;let y=s.int_points2[u.id],x=s.int_points2[l.id],C=y.edge_after,b=x.edge_before;C.bv===2&&b.bv===2&&C===b||(y=s.int_points2[l.id],x=s.int_points2[u.id],C=y.edge_after,b=x.edge_before),C.bv===2&&b.bv===2&&C===b&&g.setOverlap(C)}})(n),art(e,o,n.int_points1_sorted,!0),art(t,o,n.int_points2_sorted,!1),mfn(e,r,o,!0),mfn(t,i,o,!1)}function Lue(e,t,n,o){let r=e.clone(),i=t.clone(),s=YCn(r,i);return Gde(s),rZ(r,s.int_points1_sorted),rZ(i,s.int_points2_sorted),_st(s),Gde(s),AUr(r,i,s,n),o&&function(a,c,l){(function(h,d,u,_){for(let p of d.faces){for(let m of p)h.edges.add(m);_.find((m)=>m.face===p)===void 0&&h.addFace(p.first,p.last)}})(a,c,0,l.int_points2),function(h,d,u){if(u.int_points1.length!==0)for(let _=0;_<u.int_points1.length;_++){let p=u.int_points1[_],m=u.int_points2[_];if(p.edge_before!==void 0&&p.edge_after===void 0&&m.edge_before===void 0&&m.edge_after!==void 0&&(p.edge_before.next=m.edge_after,m.edge_after.prev=p.edge_before,p.edge_after=m.edge_after,m.edge_before=p.edge_before),m.edge_before!==void 0&&m.edge_after===void 0&&p.edge_before===void 0&&p.edge_after!==void 0&&(m.edge_before.next=p.edge_after,p.edge_after.prev=m.edge_before,m.edge_after=p.edge_after,p.edge_before=m.edge_before),p.edge_before!==void 0&&p.edge_after===void 0)for(let A of u.int_points1_sorted)A!==p&&A.edge_before===void 0&&A.edge_after!==void 0&&A.pt.equalTo(p.pt)&&(p.edge_before.next=A.edge_after,A.edge_after.prev=p.edge_before,p.edge_after=A.edge_after,A.edge_before=p.edge_before);if(m.edge_before!==void 0&&m.edge_after===void 0)for(let A of u.int_points2_sorted)A!==m&&A.edge_before===void 0&&A.edge_after!==void 0&&A.pt.equalTo(m.pt)&&(m.edge_before.next=A.edge_after,A.edge_after.prev=m.edge_before,m.edge_after=A.edge_after,A.edge_before=m.edge_before)}}(0,0,l),crt(a,l.int_points1),crt(c,l.int_points2),lrt(a,l.int_points1,l.int_points2),lrt(a,l.int_points2,l.int_points1)}(r,i,s),[r,i]}function YCn(e,t){let n={int_points1:[],int_points2:[]};for(let o of e.edges){let r=t.edges.search(o.box);for(let i of r){let s=o.shape.intersect(i.shape);for(let a of s)nZ(o,a,n.int_points1),nZ(i,a,n.int_points2)}}return n}function ufn(e,t){let n=[];for(let o of e.faces)t.find((r)=>r.face===o)||n.push(o);return n}function pfn(e,t){for(let n of e)n.first.bv=n.first.bvStart=n.first.bvEnd=void 0,n.first.setInclusion(t)}function fUr(e,t,n,o,r,i){let s,a,c,l=o.length,h=!1;for(let d=0;d<l;d++){let u=o[d];u.face!==s&&(a=d,s=u.face);let _,p=d,m=oZ(o,d,s);_=p+m<l&&o[p+m].face===s?p+m:a;let A=oZ(o,_,s);c=null;for(let y=_;y<_+A;y++){let x=o[y];if(x.face===s&&r[x.id].face===r[u.id].face){c=x;break}}if(c===null)continue;let g=u.edge_after,f=c.edge_before;if(g.bv!==IA||f.bv==IA)if(g.bv==IA||f.bv!==IA){if(g.bv===IA&&f.bv===IA&&g!=f||g.bv===NS&&f.bv===RS||g.bv===RS&&f.bv===NS){let y=g.next;for(;y!=f;)y.bvStart=void 0,y.bvEnd=void 0,y.bv=void 0,y.setInclusion(t),y=y.next}if(g.bv===IA&&f.bv===IA&&g!=f){let y,x=g.next;for(;x!=f;){if(x.bv!=IA){if(y===void 0)y=x.bv;else if(x.bv!=y)throw Xu.UNRESOLVED_BOUNDARY_CONFLICT}x=x.next}y!=null&&(g.bv=y,f.bv=y);continue}if(g.bv===NS&&f.bv===RS||g.bv===RS&&f.bv===NS){let y=g;for(;y!=f;){if(y.bvStart===g.bv&&y.bvEnd===f.bv){let[x,C]=y.shape.distanceTo(t);if(x<10*Xe.DP_TOL){nZ(y,C.ps,n);let b=n[n.length-1];if(b.is_vertex&hfn)b.edge_after=y,b.edge_before=y.prev,y.bvStart=IA,y.bv=void 0,y.setInclusion(t);else if(b.is_vertex&dfn)b.edge_after=y.next,y.bvEnd=IA,y.bv=void 0,y.setInclusion(t);else{let P=t.addVertex(b.pt,y);b.edge_before=P,b.edge_after=P.next,P.setInclusion(t),P.next.bvStart=IA,P.next.bvEnd=void 0,P.next.bv=void 0,P.next.setInclusion(t)}let I=t.findEdgeByPoint(C.pe);nZ(I,C.pe,r);let v=r[r.length-1];if(v.is_vertex&hfn)v.edge_after=I,v.edge_before=I.prev;else if(v.is_vertex&dfn)v.edge_after=I.next;else{let P=r.find((B)=>B.edge_after===I),M=t.addVertex(v.pt,I);v.edge_before=M,v.edge_after=M.next,P&&(P.edge_after=M),M.bvStart=void 0,M.bvEnd=IA,M.bv=void 0,M.setInclusion(e),M.next.bvStart=IA,M.next.bvEnd=void 0,M.next.bv=void 0,M.next.setInclusion(e)}Gde(i),h=!0;break}}y=y.next}if(h)break;throw Xu.UNRESOLVED_BOUNDARY_CONFLICT}}else f.bv=g.bv;else g.bv=f.bv}return h}function art(e,t,n,o){if(!n)return;let r,i,s,a;for(let c=0;c<n.length;c++){if(s=n[c],s.face!==r&&(i=c,r=s.face),r.isEmpty())continue;let l,h=c,d=oZ(n,c,r);l=h+d<n.length&&n[h+d].face===s.face?h+d:i,a=n[l];let u=l,_=oZ(n,u,r),p=s.edge_after,m=a.edge_before;if(p.bv===NS&&m.bv===NS&&t===1||p.bv===RS&&m.bv===RS&&t===2||(p.bv===RS||m.bv===RS)&&t===3&&!o||(p.bv===NS||m.bv===NS)&&t===3&&o||p.bv===IA&&m.bv===IA&&p.overlap&_Ur&&o||p.bv===IA&&m.bv===IA&&p.overlap&gUr){e.removeChain(r,p,m);for(let A=h;A<h+d;A++)n[A].edge_after=void 0;for(let A=u;A<u+_;A++)n[A].edge_before=void 0}c+=d-1}}function crt(e,t){for(let n of t)e.faces.delete(n.face),n.face=void 0,n.edge_before&&(n.edge_before.face=void 0),n.edge_after&&(n.edge_after.face=void 0)}function lrt(e,t,n){for(let o of t){if(o.edge_before===void 0||o.edge_after===void 0)continue;if(o.face)continue;if(o.edge_after.face||o.edge_before.face)continue;let{edge_after:r,edge_before:i}=o;try{lst.testInfiniteLoop(r)}catch(a){throw Xu.CANNOT_COMPLETE_BOOLEAN_OPERATION}let s=e.addFace(r,i);for(let a of t)a.edge_before&&a.edge_after&&a.edge_before.face===s&&a.edge_after.face===s&&(a.face=s);for(let a of n)a.edge_before&&a.edge_after&&a.edge_before.face===s&&a.edge_after.face===s&&(a.face=s)}}function mfn(e,t,n,o){for(let r of t){let i=r.first.bv;(n===1&&i===NS||n===3&&i===NS&&o||n===3&&i===RS&&!o||n===2&&i===RS)&&e.deleteFace(r)}}var yUr=Object.freeze({__proto__:null,BOOLEAN_INTERSECT:2,BOOLEAN_SUBTRACT:3,BOOLEAN_UNION:1,calculateIntersections:VCn,innerClip:OCn,intersect:zCn,outerClip:srt,removeNotRelevantChains:art,removeOldFaces:crt,restoreFaces:lrt,subtract:irt,unify:function(e,t){let[n,o]=Lue(e,t,1,!0);return n}}),xUr=RegExp("T.F..FFF.|T.F...F.."),CUr=RegExp("T........|.T.......|...T.....|....T...."),bUr=RegExp("FT.......|F..T.....|F...T...."),IUr=RegExp("T.F..F..."),vUr=RegExp("T.F..F...|.TF..F...|..FT.F...|..F.TF..."),LJ=class{constructor(){this.m=[,,,,,,,,,].fill(void 0)}get I2I(){return this.m[0]}set I2I(e){this.m[0]=e}get I2B(){return this.m[1]}set I2B(e){this.m[1]=e}get I2E(){return this.m[2]}set I2E(e){this.m[2]=e}get B2I(){return this.m[3]}set B2I(e){this.m[3]=e}get B2B(){return this.m[4]}set B2B(e){this.m[4]=e}get B2E(){return this.m[5]}set B2E(e){this.m[5]=e}get E2I(){return this.m[6]}set E2I(e){this.m[6]=e}get E2B(){return this.m[7]}set E2B(e){this.m[7]=e}get E2E(){return this.m[8]}set E2E(e){this.m[8]=e}toString(){return this.m.map((e)=>e instanceof Array&&e.length>0?"T":e instanceof Array&&e.length===0?"F":"*").join("")}equal(){return xUr.test(this.toString())}intersect(){return CUr.test(this.toString())}touch(){return bUr.test(this.toString())}inside(){return IUr.test(this.toString())}covered(){return vUr.test(this.toString())}};function xde(e,t){let n,o=new Xe.Ray(t),r=new Xe.Line(o.pt,o.norm),i=new Xe.Box(o.box.xmin-Xe.DP_TOL,o.box.ymin-Xe.DP_TOL,o.box.xmax+Xe.DP_TOL,o.box.ymax+Xe.DP_TOL);if(e.box.not_intersect(i))return Xe.OUTSIDE;let s=e.edges.search(i);if(s.length===0)return Xe.OUTSIDE;for(let h of s)if(h.shape.contains(t))return Xe.BOUNDARY;let a=[...e.faces],c=[];for(let h of s)for(let d of o.intersect(h.shape)){if(d.equalTo(t))return Xe.BOUNDARY;c.push({pt:d,edge:h,face_index:a.indexOf(h.face)})}c.sort((h,d)=>ECn(h.pt.x,d.pt.x)?-1:PCn(h.pt.x,d.pt.x)?1:h.face_index<d.face_index?-1:h.face_index>d.face_index?1:h.edge.arc_length<d.edge.arc_length?-1:h.edge.arc_length>d.edge.arc_length?1:0);let l=0;for(let h=0;h<c.length;h++){let d=c[h];if(d.pt.equalTo(d.edge.shape.start)){if(h>0&&d.pt.equalTo(c[h-1].pt)&&d.face_index===c[h-1].face_index&&d.edge.prev===c[h-1].edge)continue;let u=d.edge.prev;for(;nrt(u.length);)u=u.prev;let _=u.shape.tangentInEnd(),p=d.pt.translate(_),m=d.edge.shape.tangentInStart(),A=d.pt.translate(m),g=p.leftTo(r),f=A.leftTo(r);(g&&!f||!g&&f)&&l++}else if(d.pt.equalTo(d.edge.shape.end)){if(h>0&&d.pt.equalTo(c[h-1].pt)&&d.face_index===c[h-1].face_index&&d.edge.next===c[h-1].edge)continue;let u=d.edge.next;for(;nrt(u.length);)u=u.next;let _=u.shape.tangentInStart(),p=d.pt.translate(_),m=d.edge.shape.tangentInEnd(),A=d.pt.translate(m),g=p.leftTo(r),f=A.leftTo(r);(g&&!f||!g&&f)&&l++}else if(d.edge.shape instanceof Xe.Segment)l++;else{let u=d.edge.shape.box;wY(d.pt.y,u.ymin)||wY(d.pt.y,u.ymax)||l++}}return n=l%2==1?1:0,n}function _fn(e,t){return UJ(e,t).intersect()}function gfn(e,t){return UJ(e,t).inside()}function GCn(e,t){return UJ(e,t).covered()}function UCn(e,t){return GCn(t,e)}function UJ(e,t){return e instanceof Xe.Line&&t instanceof Xe.Line?function(n,o){let r=new LJ,i=PZ(n,o);return i.length===0?n.contains(o.pt)&&o.contains(n.pt)?(r.I2I=[n],r.I2E=[],r.E2I=[]):(r.I2I=[],r.I2E=[n],r.E2I=[o]):(r.I2I=i,r.I2E=n.split(i),r.E2I=o.split(i)),r}(e,t):e instanceof Xe.Line&&t instanceof Xe.Circle?function(n,o){let r=new LJ,i=UY(n,o);if(i.length===0)r.I2I=[],r.I2B=[],r.I2E=[n],r.E2I=[o];else if(i.length===1)r.I2I=[],r.I2B=i,r.I2E=n.split(i),r.E2I=[o];else{let s=new CY([n]),a=n.sortPoints(i);s.split(a);let c=s.toShapes();r.I2I=[c[1]],r.I2B=a,r.I2E=[c[0],c[2]],r.E2I=new Xe.Polygon([o.toArc()]).cutWithLine(n)}return r}(e,t):e instanceof Xe.Line&&t instanceof Xe.Box?function(n,o){let r=new LJ,i=eZ(n,o);if(i.length===0)r.I2I=[],r.I2B=[],r.I2E=[n],r.E2I=[o];else if(i.length===1)r.I2I=[],r.I2B=i,r.I2E=n.split(i),r.E2I=[o];else{let s=new CY([n]),a=n.sortPoints(i);s.split(a);let c=s.toShapes();o.toSegments().some((l)=>l.contains(i[0])&&l.contains(i[1]))?(r.I2I=[],r.I2B=[c[1]],r.I2E=[c[0],c[2]],r.E2I=[o]):(r.I2I=[c[1]],r.I2B=a,r.I2E=[c[0],c[2]],r.E2I=new Xe.Polygon(o.toSegments()).cutWithLine(n))}return r}(e,t):e instanceof Xe.Line&&t instanceof Xe.Polygon?function(n,o){let r=new LJ,i=kue(n,o),s=new CY([n]),a=i.length>0?i.slice():n.sortPoints(i);return s.split(a),[...s].forEach((c)=>c.setInclusion(o)),r.I2I=[...s].filter((c)=>c.bv===Xe.INSIDE).map((c)=>c.shape),r.I2B=[...s].slice(1).map((c)=>c.bv===Xe.BOUNDARY?c.shape:c.shape.start),r.I2E=[...s].filter((c)=>c.bv===Xe.OUTSIDE).map((c)=>c.shape),r.E2I=o.cutWithLine(n),r}(e,t):(e instanceof Xe.Segment||e instanceof Xe.Arc)&&t instanceof Xe.Polygon?Afn(e,t):(e instanceof Xe.Segment||e instanceof Xe.Arc)&&(t instanceof Xe.Circle||t instanceof Xe.Box)?Afn(e,new Xe.Polygon(t)):e instanceof Xe.Polygon&&t instanceof Xe.Polygon?F9e(e,t):(e instanceof Xe.Circle||e instanceof Xe.Box)&&(t instanceof Xe.Circle||t instanceof Xe.Box)?F9e(new Xe.Polygon(e),new Xe.Polygon(t)):(e instanceof Xe.Circle||e instanceof Xe.Box)&&t instanceof Xe.Polygon?F9e(new Xe.Polygon(e),t):e instanceof Xe.Polygon&&(t instanceof Xe.Circle||t instanceof Xe.Box)?F9e(e,new Xe.Polygon(t)):void 0}function Afn(e,t){let n=new LJ,o=function(s,a){return s instanceof Xe.Line?kue(s,a):s instanceof Xe.Segment?dst(s,a):s instanceof Xe.Arc?ust(s,a):[]}(e,t),r=o.length>0?o.slice():e.sortPoints(o),i=new CY([e]);i.split(r),[...i].forEach((s)=>s.setInclusion(t)),n.I2I=[...i].filter((s)=>s.bv===Xe.INSIDE).map((s)=>s.shape),n.I2B=[...i].slice(1).map((s)=>s.bv===Xe.BOUNDARY?s.shape:s.shape.start),n.I2E=[...i].filter((s)=>s.bv===Xe.OUTSIDE).map((s)=>s.shape),n.B2I=[],n.B2B=[],n.B2E=[];for(let s of[e.start,e.end])switch(xde(t,s)){case Xe.INSIDE:n.B2I.push(s);break;case Xe.BOUNDARY:n.B2B.push(s);break;case Xe.OUTSIDE:n.B2E.push(s)}return n}function F9e(e,t){let n=new LJ,[o,r]=VCn(e,t),i=zCn(e,t),s=irt(e,t),a=irt(t,e),[c,l]=OCn(e,t),h=srt(e,t),d=srt(t,e);return n.I2I=i.isEmpty()?[]:[i],n.I2B=l,n.I2E=s.isEmpty()?[]:[s],n.B2I=c,n.B2B=o,n.B2E=h,n.E2I=a.isEmpty()?[]:[a],n.E2B=d,n}var SUr=Object.freeze({__proto__:null,contain:function(e,t){return gfn(t,e)},cover:UCn,covered:GCn,disjoint:function(e,t){return!_fn(e,t)},equal:function(e,t){return UJ(e,t).equal()},inside:gfn,intersect:_fn,relate:UJ,touch:function(e,t){return UJ(e,t).touch()}}),Cde=class e{constructor(t=1,n=0,o=0,r=1,i=0,s=0){this.a=t,this.b=n,this.c=o,this.d=r,this.tx=i,this.ty=s}fromMatrix3x3(t){let[n,o,r]=t[0],[i,s,a]=t[1];return new e(n,i,o,s,r,a)}toMatrix3x3(){return[[this.a,this.c,this.tx],[this.b,this.d,this.ty],[0,0,1]]}clone(){return new e(this.a,this.b,this.c,this.d,this.tx,this.ty)}transform(t){return[t[0]*this.a+t[1]*this.c+this.tx,t[0]*this.b+t[1]*this.d+this.ty]}multiply(t){return new e(this.a*t.a+this.c*t.b,this.b*t.a+this.d*t.b,this.a*t.c+this.c*t.d,this.b*t.c+this.d*t.d,this.a*t.tx+this.c*t.ty+this.tx,this.b*t.tx+this.d*t.ty+this.ty)}translate(...t){let n,o;if(t.length!=1||isNaN(t[0].x)||isNaN(t[0].y)){if(t.length!==2||typeof t[0]!="number"||typeof t[1]!="number")throw Xu.ILLEGAL_PARAMETERS;n=t[0],o=t[1]}else n=t[0].x,o=t[0].y;return this.multiply(new e(1,0,0,1,n,o))}rotate(t,n=0,o=0){let r=Math.cos(t),i=Math.sin(t);return this.translate(n,o).multiply(new e(r,i,-i,r,0,0)).translate(-n,-o)}scale(t,n){return this.multiply(new e(t,0,0,n,0,0))}equalTo(t){return!!Xe.Utils.EQ(this.tx,t.tx)&&(!!Xe.Utils.EQ(this.ty,t.ty)&&(!!Xe.Utils.EQ(this.a,t.a)&&(!!Xe.Utils.EQ(this.b,t.b)&&(!!Xe.Utils.EQ(this.c,t.c)&&!!Xe.Utils.EQ(this.d,t.d)))))}};Xe.Matrix=Cde;Xe.matrix=(...e)=>new Xe.Matrix(...e);var PUr=class{constructor(e,t){this.low=e,this.high=t}get max(){return this.clone()}less_than(e){return this.low<e.low||this.low===e.low&&this.high<e.high}equal_to(e){return this.low===e.low&&this.high===e.high}intersect(e){return!this.not_intersect(e)}not_intersect(e){return this.high<e.low||e.high<this.low}merge(e){let t=this.low===void 0?e.low:this.low<e.low?this.low:e.low,n=this.high===void 0?e.high:this.high>e.high?this.high:e.high,o=this.clone();return o.low=t,o.high=n,o}output(){return[this.low,this.high]}comparable_less_than(e,t){return e<t}},EUr=class e extends PUr{clone(){return new e(this.low,this.high)}},UQ=class{constructor(e,t,n=null,o=null,r=null,i=0){if(this.left=n,this.right=o,this.parent=r,this.color=i,this.item={key:void 0,values:[]},t!==void 0&&this.item.values.push(t),e!==void 0)if(Array.isArray(e)){let[s,a]=e;if(!Number.isNaN(s)&&!Number.isNaN(a)){let c=s,l=a;c>l&&([c,l]=[l,c]),this.item.key=new EUr(c,l)}}else this.item.key=e;this.max=this.item.key?this.item.key.max:void 0}isNil(){return this.item.key===void 0&&this.item.values.length===0&&this.left===null&&this.right===null&&this.color===0}requireKey(){if(!this.item.key)throw Error("Node key is undefined (nil/sentinel). Operation is not applicable.");return this.item.key}less_than(e){let t=this.requireKey(),n=e.requireKey();return t.less_than(n)}_value_equal(e){let t=this.item.values[0],n=e.item.values[0];return t&&n&&t.equal_to?t.equal_to(n):t===n}equal_to(e){let t=this.requireKey(),n=e.requireKey();return t.equal_to(n)}intersect(e){let t=this.requireKey(),n=e.requireKey();return t.intersect(n)}copy_data(e){this.item.key=e.item.key,this.item.values=e.item.values.slice()}update_max(){this.max=this.item.key?this.item.key.max:void 0,this.right&&this.right.max&&(this.max=this.max?this.max.merge(this.right.max):this.right.max),this.left&&this.left.max&&(this.max=this.max?this.max.merge(this.left.max):this.left.max)}not_intersect_left_subtree(e){if(!this.left)return!0;let t=this.left.max?this.left.max.high:this.left.item.key.high,n=this.requireKey(),o=e.requireKey();return n.comparable_less_than(t,o.low)}not_intersect_right_subtree(e){if(!this.right)return!0;let t=this.right.max?this.right.max.low:this.right.item.key.low,n=this.requireKey(),o=e.requireKey();return n.comparable_less_than(o.high,t)}},hrt=class e{constructor(){this.root=null,this.nil_node=new UQ}get size(){let t=0;return this.tree_walk(this.root,(n)=>t+=n.item.values.length),t}get keys(){let t=[];return this.tree_walk(this.root,(n)=>t.push(n.item.key.output())),t}get values(){let t=[];return this.tree_walk(this.root,(n)=>{for(let o of n.item.values)t.push(o)}),t}get items(){let t=[];return this.tree_walk(this.root,(n)=>{let o=n.item.key.output();for(let r of n.item.values)t.push({key:o,value:r})}),t}isEmpty(){return this.root==null||this.root===this.nil_node}clear(){this.root=null}insert(t,n=t){if(t===void 0)return;let o=this.tree_search(this.root,new UQ(t));if(o)return o.item.values.push(n),o;let r=new UQ(t,n,this.nil_node,this.nil_node,null,1);return this.tree_insert(r),this.recalc_max(r),r}exist(t,n=t){let o=this.tree_search(this.root,new UQ(t));return!!o&&(arguments.length<2||n===t||o.item.values.some((r)=>r&&r.equal_to?r.equal_to(n):r===n))}remove(t,n=t){let o=this.tree_search(this.root,new UQ(t));if(!o)return;if(arguments.length<2)return this.tree_delete(o),o;let r=o.item.values.findIndex((i)=>i&&i.equal_to?i.equal_to(n):i===n);return r>=0?(o.item.values.splice(r,1),o.item.values.length===0&&this.tree_delete(o),o):void 0}search(t,n=(o,r)=>o===r?r.output():o){let o=new UQ(t),r=[];this.tree_search_interval(this.root,o,r);let i=[];for(let s of r)for(let a of s.item.values)i.push(n(a,s.item.key));return i}intersect_any(t){let n=new UQ(t);return this.tree_find_any_interval(this.root,n)}forEach(t){this.tree_walk(this.root,(n)=>{for(let o of n.item.values)t(n.item.key,o)})}map(t){let n=new e;return this.tree_walk(this.root,(o)=>{for(let r of o.item.values)n.insert(o.item.key,t(r,o.item.key))}),n}*iterate(t,n=(o,r)=>o===r?r.output():o){let o=null;for(t?o=this.tree_search_nearest_forward(this.root,new UQ(t)):this.root&&(o=this.local_minimum(this.root));o;){for(let r of o.item.values)yield n(r,o.item.key);o=this.tree_successor(o)}}recalc_max(t){let n=t;for(;n.parent!=null;)n.parent.update_max(),n=n.parent}tree_insert(t){let n=this.root,o=null;if(this.root==null||this.root===this.nil_node)this.root=t;else{for(;n!==this.nil_node;)o=n,n=t.less_than(n)?n.left:n.right;t.parent=o,t.less_than(o)?o.left=t:o.right=t}this.insert_fixup(t)}insert_fixup(t){let n,o;for(n=t;n!==this.root&&n.parent.color===1;)n.parent===n.parent.parent.left?(o=n.parent.parent.right,o.color===1?(n.parent.color=0,o.color=0,n.parent.parent.color=1,n=n.parent.parent):(n===n.parent.right&&(n=n.parent,this.rotate_left(n)),n.parent.color=0,n.parent.parent.color=1,this.rotate_right(n.parent.parent))):(o=n.parent.parent.left,o.color===1?(n.parent.color=0,o.color=0,n.parent.parent.color=1,n=n.parent.parent):(n===n.parent.left&&(n=n.parent,this.rotate_right(n)),n.parent.color=0,n.parent.parent.color=1,this.rotate_left(n.parent.parent)));this.root.color=0}tree_delete(t){let n,o;n=t.left===this.nil_node||t.right===this.nil_node?t:this.tree_successor(t),o=n.left!==this.nil_node?n.left:n.right,o.parent=n.parent,n===this.root?this.root=o:(n===n.parent.left?n.parent.left=o:n.parent.right=o,n.parent.update_max()),this.recalc_max(o),n!==t&&(t.copy_data(n),t.update_max(),this.recalc_max(t)),n.color===0&&this.delete_fixup(o)}delete_fixup(t){let n,o=t;for(;o!==this.root&&o.parent!=null&&o.color===0;)o===o.parent.left?(n=o.parent.right,n.color===1&&(n.color=0,o.parent.color=1,this.rotate_left(o.parent),n=o.parent.right),n.left.color===0&&n.right.color===0?(n.color=1,o=o.parent):(n.right.color===0&&(n.color=1,n.left.color=0,this.rotate_right(n),n=o.parent.right),n.color=o.parent.color,o.parent.color=0,n.right.color=0,this.rotate_left(o.parent),o=this.root)):(n=o.parent.left,n.color===1&&(n.color=0,o.parent.color=1,this.rotate_right(o.parent),n=o.parent.left),n.left.color===0&&n.right.color===0?(n.color=1,o=o.parent):(n.left.color===0&&(n.color=1,n.right.color=0,this.rotate_left(n),n=o.parent.left),n.color=o.parent.color,o.parent.color=0,n.left.color=0,this.rotate_right(o.parent),o=this.root));o.color=0}tree_search(t,n){if(t!=null&&t!==this.nil_node)return n.equal_to(t)?t:n.less_than(t)?this.tree_search(t.left,n):this.tree_search(t.right,n)}tree_search_nearest_forward(t,n){let o=null,r=t;for(;r&&r!==this.nil_node;)r.less_than(n)?r.intersect(n)?(o=r,r=r.left):r=r.right:(o&&!r.less_than(o)||(o=r),r=r.left);return o||null}tree_search_interval(t,n,o){t!=null&&t!==this.nil_node&&(t.left===this.nil_node||t.not_intersect_left_subtree(n)||this.tree_search_interval(t.left,n,o),t.intersect(n)&&o.push(t),t.right===this.nil_node||t.not_intersect_right_subtree(n)||this.tree_search_interval(t.right,n,o))}tree_find_any_interval(t,n){let o=!1;return t!=null&&t!==this.nil_node&&(t.left===this.nil_node||t.not_intersect_left_subtree(n)||(o=this.tree_find_any_interval(t.left,n)),o||(o=t.intersect(n)),o||t.right===this.nil_node||t.not_intersect_right_subtree(n)||(o=this.tree_find_any_interval(t.right,n))),o}local_minimum(t){let n=t;for(;n.left!=null&&n.left!==this.nil_node;)n=n.left;return n}local_maximum(t){let n=t;for(;n.right!=null&&n.right!==this.nil_node;)n=n.right;return n}tree_successor(t){let n,o,r;if(t.right!==this.nil_node)n=this.local_minimum(t.right);else{for(o=t,r=t.parent;r!=null&&r.right===o;)o=r,r=r.parent;n=r}return n}rotate_left(t){let n=t.right;t.right=n.left,n.left!==this.nil_node&&(n.left.parent=t),n.parent=t.parent,t===this.root?this.root=n:t===t.parent.left?t.parent.left=n:t.parent.right=n,n.left=t,t.parent=n,t!==null&&t!==this.nil_node&&t.update_max(),n!=null&&n!==this.nil_node&&n.update_max()}rotate_right(t){let n=t.left;t.left=n.right,n.right!==this.nil_node&&(n.right.parent=t),n.parent=t.parent,t===this.root?this.root=n:t===t.parent.left?t.parent.left=n:t.parent.right=n,n.right=t,t.parent=n,t!==null&&t!==this.nil_node&&t.update_max(),n!=null&&n!==this.nil_node&&n.update_max()}tree_walk(t,n){t!=null&&t!==this.nil_node&&(this.tree_walk(t.left,n),n(t),this.tree_walk(t.right,n))}testRedBlackProperty(){let t=!0;return this.tree_walk(this.root,function(n){n.color===1&&(n.left.color===0&&n.right.color===0||(t=!1))}),t}testBlackHeightProperty(t){let n=0,o=0,r=0;if(t.color===0&&n++,o=t.left!==this.nil_node?this.testBlackHeightProperty(t.left):1,r=t.right!==this.nil_node?this.testBlackHeightProperty(t.right):1,o!==r)throw Error("Red-black height property violated");return n+=o,n}},MUr=class extends Set{constructor(e){super(e),this.index=new hrt,this.forEach((t)=>this.index.insert(t))}add(e){let t=this.size,{key:n,value:o}=e,r=n||e.box,i=o||e;return super.add(i),this.size>t&&this.index.insert(r,i),this}delete(e){let{key:t,value:n}=e,o=t||e.box,r=n||e,i=super.delete(r);return i&&this.index.remove(o,r),i}clear(){super.clear(),this.index=new hrt}search(e){return this.index.search(e)}hit(e){let t=new Xe.Box(e.x-1,e.y-1,e.x+1,e.y+1);return this.index.search(t).filter((n)=>e.on(n))}svg(){return[...this].reduce((e,t)=>e+t.svg(),"")}};Xe.PlanarSet=MUr;var Yk=class{get name(){throw Xu.CANNOT_INVOKE_ABSTRACT_METHOD}get box(){throw Xu.CANNOT_INVOKE_ABSTRACT_METHOD}clone(){throw Xu.CANNOT_INVOKE_ABSTRACT_METHOD}translate(...e){return this.transform(new Cde().translate(...e))}rotate(e,t=new Xe.Point){return this.transform(new Cde().rotate(e,t.x,t.y))}scale(e,t){return this.transform(new Cde().scale(e,t))}transform(...e){throw Xu.CANNOT_INVOKE_ABSTRACT_METHOD}toJSON(){return Object.assign({},this,{name:this.name})}svg(e={}){throw Xu.CANNOT_INVOKE_ABSTRACT_METHOD}};Xe.Point=class e extends Yk{constructor(...t){if(super(),this.x=0,this.y=0,t.length!==0){if(t.length===1&&t[0]instanceof Array&&t[0].length===2){let n=t[0];if(typeof n[0]=="number"&&typeof n[1]=="number")return this.x=n[0],void(this.y=n[1])}if(t.length===1&&t[0]instanceof Object&&t[0].name==="point"){let{x:n,y:o}=t[0];return this.x=n,void(this.y=o)}if(t.length===2&&typeof t[0]=="number"&&typeof t[1]=="number")return this.x=t[0],void(this.y=t[1]);throw Xu.ILLEGAL_PARAMETERS}}get box(){return new Xe.Box(this.x,this.y,this.x,this.y)}clone(){return new Xe.Point(this.x,this.y)}get vertices(){return[this.clone()]}equalTo(t){return Xe.Utils.EQ(this.x,t.x)&&Xe.Utils.EQ(this.y,t.y)}lessThan(t){return!!Xe.Utils.LT(this.y,t.y)||!(!Xe.Utils.EQ(this.y,t.y)||!Xe.Utils.LT(this.x,t.x))}transform(t){return new Xe.Point(t.transform([this.x,this.y]))}projectionOn(t){if(this.equalTo(t.pt))return this.clone();let n=new Xe.Vector(this,t.pt);if(Xe.Utils.EQ_0(n.cross(t.norm)))return t.pt.clone();let o=n.dot(t.norm),r=t.norm.multiply(o);return this.translate(r)}leftTo(t){let n=new Xe.Vector(t.pt,this);return Xe.Utils.GT(n.dot(t.norm),0)}distanceTo(t){if(t instanceof e){let n=t.x-this.x,o=t.y-this.y;return[Math.sqrt(n*n+o*o),new Xe.Segment(this,t)]}return t instanceof Xe.Line?Xe.Distance.point2line(this,t):t instanceof Xe.Circle?Xe.Distance.point2circle(this,t):t instanceof Xe.Segment?Xe.Distance.point2segment(this,t):t instanceof Xe.Arc?Xe.Distance.point2arc(this,t):t instanceof Xe.Polygon?Xe.Distance.point2polygon(this,t):t instanceof Xe.PlanarSet?Xe.Distance.shape2planarSet(this,t):t instanceof Xe.Multiline?Xe.Distance.shape2multiline(this,t):void 0}on(t){if(t instanceof Xe.Point)return this.equalTo(t);if(t.contains&&t.contains instanceof Function)return t.contains(this);throw Xe.Errors.UNSUPPORTED_SHAPE_TYPE}get name(){return"point"}svg(t={}){let n=t.r??3;return`
<circle cx="${this.x}" cy="${this.y}" r="${n}"
            ${GY({fill:"red",...t})} />`}};Xe.point=(...e)=>new Xe.Point(...e);Xe.Vector=class extends Yk{constructor(...e){if(super(),this.x=0,this.y=0,e.length!==0){if(e.length===1&&e[0]instanceof Array&&e[0].length===2){let t=e[0];if(typeof t[0]=="number"&&typeof t[1]=="number")return this.x=t[0],void(this.y=t[1])}if(e.length===1&&e[0]instanceof Object&&e[0].name==="vector"){let{x:t,y:n}=e[0];return this.x=t,void(this.y=n)}if(e.length===1&&e[0]instanceof Object&&e[0].name==="segment"){let{start:t,end:n}=e[0];return this.x=n.x-t.x,void(this.y=n.y-t.y)}if(e.length===2){let t=e[0],n=e[1];if(typeof t=="number"&&typeof n=="number")return this.x=t,void(this.y=n);if(t instanceof Xe.Point&&n instanceof Xe.Point)return this.x=n.x-t.x,void(this.y=n.y-t.y)}throw Xu.ILLEGAL_PARAMETERS}}clone(){return new Xe.Vector(this.x,this.y)}get slope(){let e=Math.atan2(this.y,this.x);return e<0&&(e=2*Math.PI+e),e}get length(){return Math.sqrt(this.dot(this))}isZeroLength(){return Xe.Utils.EQ_0(this.length)}equalTo(e){return Xe.Utils.EQ(this.x,e.x)&&Xe.Utils.EQ(this.y,e.y)}multiply(e){return new Xe.Vector(e*this.x,e*this.y)}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}normalize(){if(this.isZeroLength())throw Xu.ZERO_DIVISION;return new Xe.Vector(this.x/this.length,this.y/this.length)}rotate(e,t=new Xe.Point){if(t.x===0&&t.y===0)return this.transform(new Cde().rotate(e));throw Xu.OPERATION_IS_NOT_SUPPORTED}transform(e){return new Xe.Vector(e.transform([this.x,this.y]))}rotate90CCW(){return new Xe.Vector(-this.y,this.x)}rotate90CW(){return new Xe.Vector(this.y,-this.x)}invert(){return new Xe.Vector(-this.x,-this.y)}add(e){return new Xe.Vector(this.x+e.x,this.y+e.y)}subtract(e){return new Xe.Vector(this.x-e.x,this.y-e.y)}angleTo(e){let t=this.normalize(),n=e.normalize(),o=Math.atan2(t.cross(n),t.dot(n));return o<0&&(o+=2*Math.PI),o}projectionOn(e){let t=e.normalize(),n=this.dot(t);return t.multiply(n)}get name(){return"vector"}};var WCn=(...e)=>new Xe.Vector(...e);Xe.vector=WCn;Xe.Segment=class e extends Yk{constructor(...t){if(super(),this.ps=new Xe.Point,this.pe=new Xe.Point,t.length!==0){if(t.length===1&&t[0]instanceof Array&&t[0].length===4){let n=t[0];return this.ps=new Xe.Point(n[0],n[1]),void(this.pe=new Xe.Point(n[2],n[3]))}if(t.length===1&&t[0]instanceof Object&&t[0].name==="segment"){let{ps:n,pe:o}=t[0];return this.ps=new Xe.Point(n.x,n.y),void(this.pe=new Xe.Point(o.x,o.y))}if(!(t.length===1&&t[0]instanceof Xe.Point)){if(t.length===2&&t[0]instanceof Xe.Point&&t[1]instanceof Xe.Point)return this.ps=t[0].clone(),void(this.pe=t[1].clone());if(t.length===4)return this.ps=new Xe.Point(t[0],t[1]),void(this.pe=new Xe.Point(t[2],t[3]));throw Xu.ILLEGAL_PARAMETERS}this.ps=t[0].clone()}}clone(){return new Xe.Segment(this.start,this.end)}get start(){return this.ps}get end(){return this.pe}get vertices(){return[this.ps.clone(),this.pe.clone()]}get length(){return this.start.distanceTo(this.end)[0]}get slope(){return new Xe.Vector(this.start,this.end).slope}get box(){return new Xe.Box(Math.min(this.start.x,this.end.x),Math.min(this.start.y,this.end.y),Math.max(this.start.x,this.end.x),Math.max(this.start.y,this.end.y))}equalTo(t){return this.ps.equalTo(t.ps)&&this.pe.equalTo(t.pe)}contains(t){return Xe.Utils.EQ_0(this.distanceToPoint(t))}intersect(t){return t instanceof Xe.Point?this.contains(t)?[t]:[]:t instanceof Xe.Line?Que(this,t):t instanceof Xe.Ray?pst(t,this):t instanceof Xe.Segment?f8e(this,t):t instanceof Xe.Circle?y8e(this,t):t instanceof Xe.Box?function(n,o){let r=[];for(let i of o.toSegments()){let s=f8e(i,n);for(let a of s)r.push(a)}return r}(this,t):t instanceof Xe.Arc?tZ(this,t):t instanceof Xe.Polygon?dst(this,t):t instanceof Xe.Multiline?EZ(this,t):void 0}distanceTo(t){if(t instanceof Xe.Point){let[n,o]=Xe.Distance.point2segment(t,this);return o=o.reverse(),[n,o]}if(t instanceof Xe.Circle){let[n,o]=Xe.Distance.segment2circle(this,t);return[n,o]}if(t instanceof Xe.Line){let[n,o]=Xe.Distance.segment2line(this,t);return[n,o]}if(t instanceof Xe.Segment){let[n,o]=Xe.Distance.segment2segment(this,t);return[n,o]}if(t instanceof Xe.Arc){let[n,o]=Xe.Distance.segment2arc(this,t);return[n,o]}if(t instanceof Xe.Polygon){let[n,o]=Xe.Distance.shape2polygon(this,t);return[n,o]}if(t instanceof Xe.PlanarSet){let[n,o]=Xe.Distance.shape2planarSet(this,t);return[n,o]}if(t instanceof Xe.Multiline)return Xe.Distance.shape2multiline(this,t)}tangentInStart(){return new Xe.Vector(this.start,this.end).normalize()}tangentInEnd(){return new Xe.Vector(this.end,this.start).normalize()}reverse(){return new e(this.end,this.start)}split(t){return this.start.equalTo(t)?[null,this.clone()]:this.end.equalTo(t)?[this.clone(),null]:[new Xe.Segment(this.start,t),new Xe.Segment(t,this.end)]}middle(){return new Xe.Point((this.start.x+this.end.x)/2,(this.start.y+this.end.y)/2)}pointAtLength(t){if(t>this.length||t<0)return null;if(t==0)return this.start;if(t==this.length)return this.end;let n=t/this.length;return new Xe.Point((this.end.x-this.start.x)*n+this.start.x,(this.end.y-this.start.y)*n+this.start.y)}distanceToPoint(t){let[n,...o]=Xe.Distance.point2segment(t,this);return n}definiteIntegral(t=0){return(this.end.x-this.start.x)*(this.start.y-t+(this.end.y-t))/2}transform(t=new Xe.Matrix){return new e(this.ps.transform(t),this.pe.transform(t))}isZeroLength(){return this.ps.equalTo(this.pe)}sortPoints(t){return new Xe.Line(this.start,this.end).sortPoints(t)}get name(){return"segment"}svg(t={}){return`
<line x1="${this.start.x}" y1="${this.start.y}" x2="${this.end.x}" y2="${this.end.y}" ${GY(t)} />`}};Xe.segment=(...e)=>new Xe.Segment(...e);var{vector:Hhe}=Xe;Xe.Line=class e extends Yk{constructor(...t){if(super(),this.pt=new Xe.Point,this.norm=new Xe.Vector(0,1),t.length!==0){if(t.length===1&&t[0]instanceof Object&&t[0].name==="line"){let{pt:n,norm:o}=t[0];return this.pt=new Xe.Point(n),void(this.norm=new Xe.Vector(o))}if(t.length===2){let n=t[0],o=t[1];if(n instanceof Xe.Point&&o instanceof Xe.Point)return this.pt=n,this.norm=e.points2norm(n,o),void(this.norm.dot(Hhe(this.pt.x,this.pt.y))>=0&&this.norm.invert());if(n instanceof Xe.Point&&o instanceof Xe.Vector){if(Xe.Utils.EQ_0(o.x)&&Xe.Utils.EQ_0(o.y))throw Xu.ILLEGAL_PARAMETERS;return this.pt=n.clone(),this.norm=o.clone(),this.norm=this.norm.normalize(),void(this.norm.dot(Hhe(this.pt.x,this.pt.y))>=0&&this.norm.invert())}if(n instanceof Xe.Vector&&o instanceof Xe.Point){if(Xe.Utils.EQ_0(n.x)&&Xe.Utils.EQ_0(n.y))throw Xu.ILLEGAL_PARAMETERS;return this.pt=o.clone(),this.norm=n.clone(),this.norm=this.norm.normalize(),void(this.norm.dot(Hhe(this.pt.x,this.pt.y))>=0&&this.norm.invert())}}throw Xu.ILLEGAL_PARAMETERS}}clone(){return new Xe.Line(this.pt,this.norm)}get start(){}get end(){}get length(){return Number.POSITIVE_INFINITY}get box(){return new Xe.Box(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY)}get middle(){}get slope(){return new Xe.Vector(this.norm.y,-this.norm.x).slope}get standard(){return[this.norm.x,this.norm.y,this.norm.dot(Hhe(this.pt.x,this.pt.y))]}parallelTo(t){return Xe.Utils.EQ_0(this.norm.cross(t.norm))}incidentTo(t){return this.parallelTo(t)&&this.pt.on(t)}contains(t){if(this.pt.equalTo(t))return!0;let n=new Xe.Vector(this.pt,t);return Xe.Utils.EQ_0(this.norm.dot(n))}coord(t){return Hhe(t.x,t.y).cross(this.norm)}intersect(t){return t instanceof Xe.Point?this.contains(t)?[t]:[]:t instanceof Xe.Line?PZ(this,t):t instanceof Xe.Ray?LCn(t,this):t instanceof Xe.Circle?UY(this,t):t instanceof Xe.Box?eZ(this,t):t instanceof Xe.Segment?Que(t,this):t instanceof Xe.Arc?w7e(this,t):t instanceof Xe.Polygon?kue(this,t):t instanceof Xe.Multiline?EZ(this,t):void 0}distanceTo(t){if(t instanceof Xe.Point){let[n,o]=Xe.Distance.point2line(t,this);return o=o.reverse(),[n,o]}if(t instanceof Xe.Circle){let[n,o]=Xe.Distance.circle2line(t,this);return o=o.reverse(),[n,o]}if(t instanceof Xe.Segment){let[n,o]=Xe.Distance.segment2line(t,this);return[n,o.reverse()]}if(t instanceof Xe.Arc){let[n,o]=Xe.Distance.arc2line(t,this);return[n,o.reverse()]}if(t instanceof Xe.Polygon){let[n,o]=Xe.Distance.shape2polygon(this,t);return[n,o]}}split(t){if(t instanceof Xe.Point)return[new Xe.Ray(t,this.norm),new Xe.Ray(t,this.norm)];{let n=new Xe.Multiline([this]),o=this.sortPoints(t);return n.split(o),n.toShapes()}}rotate(t,n=new Xe.Point){return new Xe.Line(this.pt.rotate(t,n),this.norm.rotate(t))}transform(t){return new Xe.Line(this.pt.transform(t),this.norm.clone())}sortPoints(t){return t.slice().sort((n,o)=>this.coord(n)<this.coord(o)?-1:this.coord(n)>this.coord(o)?1:0)}get name(){return"line"}svg(t,n={}){let o=eZ(this,t);if(o.length===0)return"";let r=o[0],i=o.length===2?o[1]:o.find((s)=>!s.equalTo(r));return i===void 0&&(i=r),new Xe.Segment(r,i).svg(n)}static points2norm(t,n){if(t.equalTo(n))throw Xu.ILLEGAL_PARAMETERS;return new Xe.Vector(t,n).normalize().rotate90CCW()}};Xe.line=(...e)=>new Xe.Line(...e);Xe.Circle=class extends Yk{constructor(...e){if(super(),this.pc=new Xe.Point,this.r=1,e.length===1&&e[0]instanceof Object&&e[0].name==="circle"){let{pc:t,r:n}=e[0];this.pc=new Xe.Point(t),this.r=n}else{let[t,n]=[...e];t&&t instanceof Xe.Point&&(this.pc=t.clone()),n!==void 0&&(this.r=n)}}clone(){return new Xe.Circle(this.pc.clone(),this.r)}get center(){return this.pc}get box(){return new Xe.Box(this.pc.x-this.r,this.pc.y-this.r,this.pc.x+this.r,this.pc.y+this.r)}contains(e){return e instanceof Xe.Point?Xe.Utils.LE(e.distanceTo(this.center)[0],this.r):e instanceof Xe.Segment?Xe.Utils.LE(e.start.distanceTo(this.center)[0],this.r)&&Xe.Utils.LE(e.end.distanceTo(this.center)[0],this.r):e instanceof Xe.Arc?this.intersect(e).length===0&&Xe.Utils.LE(e.start.distanceTo(this.center)[0],this.r)&&Xe.Utils.LE(e.end.distanceTo(this.center)[0],this.r):e instanceof Xe.Circle?this.intersect(e).length===0&&Xe.Utils.LE(e.r,this.r)&&Xe.Utils.LE(e.center.distanceTo(this.center)[0],this.r):void 0}toArc(e=!0){return new Xe.Arc(this.center,this.r,Math.PI,-Math.PI,e)}scale(e,t){if(e!==t)throw Xu.OPERATION_IS_NOT_SUPPORTED;if(this.pc.x!==0||this.pc.y!==0)throw Xu.OPERATION_IS_NOT_SUPPORTED;return new Xe.Circle(this.pc,this.r*e)}transform(e=new Xe.Matrix){return new Xe.Circle(this.pc.transform(e),this.r)}intersect(e){return e instanceof Xe.Point?this.contains(e)?[e]:[]:e instanceof Xe.Line?UY(e,this):e instanceof Xe.Ray?kCn(e,this):e instanceof Xe.Segment?y8e(e,this):e instanceof Xe.Circle?MCn(e,this):e instanceof Xe.Box?function(t,n){let o=[];for(let r of n.toSegments()){let i=y8e(r,t);for(let s of i)o.push(s)}return o}(this,e):e instanceof Xe.Arc?hst(e,this):e instanceof Xe.Polygon?NCn(this,e):e instanceof Xe.Multiline?EZ(this,e):void 0}distanceTo(e){if(e instanceof Xe.Point){let[t,n]=Xe.Distance.point2circle(e,this);return n=n.reverse(),[t,n]}if(e instanceof Xe.Circle){let[t,n]=Xe.Distance.circle2circle(this,e);return[t,n]}if(e instanceof Xe.Line){let[t,n]=Xe.Distance.circle2line(this,e);return[t,n]}if(e instanceof Xe.Segment){let[t,n]=Xe.Distance.segment2circle(e,this);return n=n.reverse(),[t,n]}if(e instanceof Xe.Arc){let[t,n]=Xe.Distance.arc2circle(e,this);return n=n.reverse(),[t,n]}if(e instanceof Xe.Polygon){let[t,n]=Xe.Distance.shape2polygon(this,e);return[t,n]}if(e instanceof Xe.PlanarSet){let[t,n]=Xe.Distance.shape2planarSet(this,e);return[t,n]}if(e instanceof Xe.Multiline){let[t,n]=Xe.Distance.shape2multiline(this,e);return[t,n]}}get name(){return"circle"}svg(e={}){return`
<circle cx="${this.pc.x}" cy="${this.pc.y}" r="${this.r}"
                ${GY({fill:"none",...e})} />`}};Xe.circle=(...e)=>new Xe.Circle(...e);Xe.Arc=class extends Yk{constructor(...e){if(super(),this.pc=new Xe.Point,this.r=1,this.startAngle=0,this.endAngle=2*Math.PI,this.counterClockwise=!0,e.length!==0)if(e.length===1&&e[0]instanceof Object&&e[0].name==="arc"){let{pc:t,r:n,startAngle:o,endAngle:r,counterClockwise:i}=e[0];this.pc=new Xe.Point(t.x,t.y),this.r=n,this.startAngle=o,this.endAngle=r,this.counterClockwise=i}else{let[t,n,o,r,i]=[...e];t&&t instanceof Xe.Point&&(this.pc=t.clone()),n!==void 0&&(this.r=n),o!==void 0&&(this.startAngle=o),r!==void 0&&(this.endAngle=r),i!==void 0&&(this.counterClockwise=i)}}clone(){return new Xe.Arc(this.pc.clone(),this.r,this.startAngle,this.endAngle,this.counterClockwise)}get sweep(){let e=this.startAngle,t=this.endAngle;if(Xe.Utils.EQ(Math.abs(e-t),Xe.PIx2))return Xe.PIx2;Math.abs(e)>Xe.PIx2&&(e-=Math.trunc(e/Xe.PIx2)*Xe.PIx2),e<0&&(e+=Xe.PIx2),Math.abs(t)>Xe.PIx2&&(t-=Math.trunc(t/Xe.PIx2)*Xe.PIx2),t<0&&(t+=Xe.PIx2);let n=this.counterClockwise?t-e:e-t;return n<0&&(n+=Xe.PIx2),n}get start(){return new Xe.Point(this.pc.x+this.r,this.pc.y).rotate(this.startAngle,this.pc)}get end(){return new Xe.Point(this.pc.x+this.r,this.pc.y).rotate(this.endAngle,this.pc)}get center(){return this.pc.clone()}get vertices(){return[this.start.clone(),this.end.clone()]}get length(){return Math.abs(this.sweep*this.r)}get box(){let e=this.breakToFunctional().reduce((t,n)=>t.merge(n.start.box),new Xe.Box);return e=e.merge(this.end.box),e}contains(e){if(!Xe.Utils.EQ(this.pc.distanceTo(e)[0],this.r))return!1;if(e.equalTo(this.start))return!0;let t=new Xe.Vector(this.pc,e).slope,n=new Xe.Arc(this.pc,this.r,this.startAngle,t,this.counterClockwise);return Xe.Utils.LE(n.length,this.length)}split(e){if(this.start.equalTo(e))return[null,this.clone()];if(this.end.equalTo(e))return[this.clone(),null];let t=new Xe.Vector(this.pc,e).slope;return[new Xe.Arc(this.pc,this.r,this.startAngle,t,this.counterClockwise),new Xe.Arc(this.pc,this.r,t,this.endAngle,this.counterClockwise)]}middle(){let e=this.counterClockwise?this.startAngle+this.sweep/2:this.startAngle-this.sweep/2;return new Xe.Arc(this.pc,this.r,this.startAngle,e,this.counterClockwise).end}pointAtLength(e){if(e>this.length||e<0)return null;if(e===0)return this.start;if(e===this.length)return this.end;let t=e/this.length,n=this.counterClockwise?this.startAngle+this.sweep*t:this.startAngle-this.sweep*t;return new Xe.Arc(this.pc,this.r,this.startAngle,n,this.counterClockwise).end}chordHeight(){return(1-Math.cos(Math.abs(this.sweep/2)))*this.r}intersect(e){return e instanceof Xe.Point?this.contains(e)?[e]:[]:e instanceof Xe.Line?w7e(e,this):e instanceof Xe.Ray?mst(e,this):e instanceof Xe.Circle?hst(this,e):e instanceof Xe.Segment?tZ(e,this):e instanceof Xe.Box?function(t,n){let o=[];for(let r of n.toSegments()){let i=tZ(r,t);for(let s of i)o.push(s)}return o}(this,e):e instanceof Xe.Arc?wCn(this,e):e instanceof Xe.Polygon?ust(this,e):e instanceof Xe.Multiline?EZ(this,e):void 0}distanceTo(e){if(e instanceof Xe.Point){let[t,n]=Xe.Distance.point2arc(e,this);return n=n.reverse(),[t,n]}if(e instanceof Xe.Circle){let[t,n]=Xe.Distance.arc2circle(this,e);return[t,n]}if(e instanceof Xe.Line){let[t,n]=Xe.Distance.arc2line(this,e);return[t,n]}if(e instanceof Xe.Segment){let[t,n]=Xe.Distance.segment2arc(e,this);return n=n.reverse(),[t,n]}if(e instanceof Xe.Arc){let[t,n]=Xe.Distance.arc2arc(this,e);return[t,n]}if(e instanceof Xe.Polygon){let[t,n]=Xe.Distance.shape2polygon(this,e);return[t,n]}if(e instanceof Xe.PlanarSet){let[t,n]=Xe.Distance.shape2planarSet(this,e);return[t,n]}if(e instanceof Xe.Multiline)return Xe.Distance.shape2multiline(this,e)}breakToFunctional(){let e=[],t=[0,Math.PI/2,Math.PI,3*Math.PI/2],n=this.startAngle,o=this.endAngle;Xe.Utils.EQ(Math.abs(n-o),Xe.PIx2)&&(o=n),Math.abs(n)>Xe.PIx2&&(n-=Math.trunc(n/Xe.PIx2)*Xe.PIx2),n<0&&(n+=Xe.PIx2),Math.abs(o)>Xe.PIx2&&(o-=Math.trunc(o/Xe.PIx2)*Xe.PIx2),o<0&&(o+=Xe.PIx2);let r,i,s,a=n;this.counterClockwise?(i=Math.ceil(n/(Math.PI/2))%4,s=1):(i=Math.floor(n/(Math.PI/2))%4,s=-1);for(let c=0,l=i;c<4;c++,l=(l+s+4)%4){if(r=t[l],r===a)continue;let h=this.counterClockwise?r-n:n-r;if(h<0&&(h+=Xe.PIx2),h>this.sweep)break;e.push(new Xe.Arc(this.pc,this.r,a,r,this.counterClockwise)),a=r}return e.length===0?(e.push(this),e):(r=o,a!==r&&e.push(new Xe.Arc(this.pc,this.r,a,r,this.counterClockwise)),e)}tangentInStart(){let e=new Xe.Vector(this.pc,this.start),t=this.counterClockwise?Math.PI/2:-Math.PI/2;return e.rotate(t).normalize()}tangentInEnd(){let e=new Xe.Vector(this.pc,this.end),t=this.counterClockwise?-Math.PI/2:Math.PI/2;return e.rotate(t).normalize()}reverse(){return new Xe.Arc(this.pc,this.r,this.endAngle,this.startAngle,!this.counterClockwise)}transform(e=new Xe.Matrix){let t=this.start.transform(e),n=this.end.transform(e),o=this.pc.transform(e),r=this.counterClockwise;return e.a*e.d<0&&(r=!r),Xe.Arc.arcSE(o,t,n,r)}static arcSE(e,t,n,o){let{vector:r}=Xe,i=r(e,t).slope,s=r(e,n).slope;Xe.Utils.EQ(i,s)&&(s+=2*Math.PI,o=!0);let a=r(e,t).length;return new Xe.Arc(e,a,i,s,o)}definiteIntegral(e=0){return this.breakToFunctional().reduce((t,n)=>t+n.circularSegmentDefiniteIntegral(e),0)}circularSegmentDefiniteIntegral(e){let t=new Xe.Segment(this.start,this.end).definiteIntegral(e),n=Xe.Utils.EQ(this.sweep,Xe.PIx2)?0:this.circularSegmentArea();return this.counterClockwise?t-n:t+n}circularSegmentArea(){return 0.5*this.r*this.r*(this.sweep-Math.sin(this.sweep))}sortPoints(e){let{vector:t}=Xe;return e.slice().sort((n,o)=>{let r=t(this.pc,n).slope,i=t(this.pc,o).slope;return r<i?-1:r>i?1:0})}get name(){return"arc"}svg(e={}){let t=this.sweep<=Math.PI?"0":"1",n=this.counterClockwise?"1":"0";if(Xe.Utils.EQ(this.sweep,2*Math.PI))return new Xe.Circle(this.pc,this.r).svg(e);return`
<path d="M${this.start.x},${this.start.y}
                             A${this.r},${this.r} 0 ${t},${n} ${this.end.x},${this.end.y}"
                    ${GY({fill:"none",...e})} />`}};Xe.arc=(...e)=>new Xe.Arc(...e);Xe.Box=class e extends Yk{constructor(t=void 0,n=void 0,o=void 0,r=void 0){super(),this.xmin=t,this.ymin=n,this.xmax=o,this.ymax=r}clone(){return new e(this.xmin,this.ymin,this.xmax,this.ymax)}get low(){return new Xe.Point(this.xmin,this.ymin)}get high(){return new Xe.Point(this.xmax,this.ymax)}get max(){return this.clone()}get center(){return new Xe.Point((this.xmin+this.xmax)/2,(this.ymin+this.ymax)/2)}get width(){return Math.abs(this.xmax-this.xmin)}get height(){return Math.abs(this.ymax-this.ymin)}get box(){return this.clone()}not_intersect(t){return this.xmax<t.xmin||this.xmin>t.xmax||this.ymax<t.ymin||this.ymin>t.ymax}intersect(t){return!this.not_intersect(t)}merge(t){return new e(this.xmin===void 0?t.xmin:Math.min(this.xmin,t.xmin),this.ymin===void 0?t.ymin:Math.min(this.ymin,t.ymin),this.xmax===void 0?t.xmax:Math.max(this.xmax,t.xmax),this.ymax===void 0?t.ymax:Math.max(this.ymax,t.ymax))}less_than(t){return!!this.low.lessThan(t.low)||!(!this.low.equalTo(t.low)||!this.high.lessThan(t.high))}equal_to(t){return this.low.equalTo(t.low)&&this.high.equalTo(t.high)}output(){return this.clone()}comparable_less_than(t,n){return t.lessThan(n)}set(t,n,o,r){this.xmin=t,this.ymin=n,this.xmax=o,this.ymax=r}extend(t){return t<=0?this.clone():new e(this.xmin-t,this.ymin-t,this.xmax+t,this.ymax+t)}toPoints(){return[new Xe.Point(this.xmin,this.ymin),new Xe.Point(this.xmax,this.ymin),new Xe.Point(this.xmax,this.ymax),new Xe.Point(this.xmin,this.ymax)]}toSegments(){let t=this.toPoints();return[new Xe.Segment(t[0],t[1]),new Xe.Segment(t[1],t[2]),new Xe.Segment(t[2],t[3]),new Xe.Segment(t[3],t[0])]}rotate(t,n=new Xe.Point){throw Xu.OPERATION_IS_NOT_SUPPORTED}transform(t=new Xe.Matrix){return this.toPoints().map((n)=>n.transform(t)).reduce((n,o)=>n.merge(o.box),new e)}contains(t){return t instanceof Xe.Point?t.x>=this.xmin&&t.x<=this.xmax&&t.y>=this.ymin&&t.y<=this.ymax:t instanceof Xe.Segment?t.vertices.every((n)=>this.contains(n)):t instanceof Xe.Box?t.toSegments().every((n)=>this.contains(n)):t instanceof Xe.Circle?this.contains(t.box):t instanceof Xe.Arc?t.vertices.every((n)=>this.contains(n))&&this.toSegments().every((n)=>tZ(n,t).length===0):!(t instanceof Xe.Line||t instanceof Xe.Ray)&&(t instanceof Xe.Multiline?t.toShapes().every((n)=>this.contains(n)):t instanceof Xe.Polygon?this.contains(t.box):void 0)}distanceTo(t){let n=this.toSegments().map((r)=>r.distanceTo(t)),o=[Number.MAX_SAFE_INTEGER,null];return n.forEach((r)=>{r[0]<o[0]&&(o=r)}),o}get name(){return"box"}svg(t={}){let n=this.xmax-this.xmin,o=this.ymax-this.ymin;return`
<rect x="${this.xmin}" y="${this.ymin}" width="${n}" height="${o}"
                ${GY({fill:"none",...t})} />`}};Xe.box=(...e)=>new Xe.Box(...e);Xe.Edge=class{constructor(e){this.shape=e,this.next=void 0,this.prev=void 0,this.face=void 0,this.arc_length=0,this.bvStart=void 0,this.bvEnd=void 0,this.bv=void 0,this.overlap=void 0}get start(){return this.shape.start}get end(){return this.shape.end}get length(){return this.shape.length}get box(){return this.shape.box}get isSegment(){return this.shape instanceof Xe.Segment}get isArc(){return this.shape instanceof Xe.Arc}get isLine(){return this.shape instanceof Xe.Line}get isRay(){return this.shape instanceof Xe.Ray}middle(){return this.shape.middle()}pointAtLength(e){return this.shape.pointAtLength(e)}contains(e){return this.shape.contains(e)}setInclusion(e){if(this.bv!==void 0)return this.bv;if(this.shape instanceof Xe.Line||this.shape instanceof Xe.Ray)return this.bv=Xe.OUTSIDE,this.bv;if(this.bvStart===void 0&&(this.bvStart=xde(e,this.start)),this.bvEnd===void 0&&(this.bvEnd=xde(e,this.end)),this.bvStart===Xe.OUTSIDE||this.bvEnd==Xe.OUTSIDE)this.bv=Xe.OUTSIDE;else if(this.bvStart===Xe.INSIDE||this.bvEnd==Xe.INSIDE)this.bv=Xe.INSIDE;else{let t=xde(e,this.middle());this.bv=t}return this.bv}setOverlap(e){let t,n=this.shape,o=e.shape;n instanceof Xe.Segment&&o instanceof Xe.Segment?n.start.equalTo(o.start)&&n.end.equalTo(o.end)?t=Xe.OVERLAP_SAME:n.start.equalTo(o.end)&&n.end.equalTo(o.start)&&(t=Xe.OVERLAP_OPPOSITE):(n instanceof Xe.Arc&&o instanceof Xe.Arc||n instanceof Xe.Segment&&o instanceof Xe.Arc||n instanceof Xe.Arc&&o instanceof Xe.Segment)&&(n.start.equalTo(o.start)&&n.end.equalTo(o.end)&&n.middle().equalTo(o.middle())?t=Xe.OVERLAP_SAME:n.start.equalTo(o.end)&&n.end.equalTo(o.start)&&n.middle().equalTo(o.middle())&&(t=Xe.OVERLAP_OPPOSITE)),this.overlap===void 0&&(this.overlap=t),e.overlap===void 0&&(e.overlap=t)}svg(){if(this.shape instanceof Xe.Segment)return` L${this.shape.end.x},${this.shape.end.y}`;if(this.shape instanceof Xe.Arc){let e,t=this.shape,n=t.counterClockwise?"1":"0";if(Xe.Utils.EQ(t.sweep,2*Math.PI)){let o=t.counterClockwise?1:-1,r=new Xe.Arc(t.pc,t.r,t.startAngle,t.startAngle+o*Math.PI,t.counterClockwise),i=new Xe.Arc(t.pc,t.r,t.startAngle+o*Math.PI,t.endAngle,t.counterClockwise);return e="0",` A${r.r},${r.r} 0 ${e},${n} ${r.end.x},${r.end.y}
                    A${i.r},${i.r} 0 ${e},${n} ${i.end.x},${i.end.y}`}return e=t.sweep<=Math.PI?"0":"1",` A${t.r},${t.r} 0 ${e},${n} ${t.end.x},${t.end.y}`}}toJSON(){return this.shape.toJSON()}};var wUr=class extends lst{constructor(e,t){super(e,t),this.setCircularLinks()}setCircularLinks(){this.isEmpty()||(this.last.next=this.first,this.first.prev=this.last)}[Symbol.iterator](){let e;return{next:()=>{let t=e||this.first,n=!this.first||!!e&&e===this.first;return e=t?t.next:void 0,{value:t,done:n}}}}append(e){return super.append(e),this.setCircularLinks(),this}insert(e,t){return super.insert(e,t),this.setCircularLinks(),this}remove(e){return super.remove(e),this}};Xe.Face=class e extends wUr{constructor(t,...n){if(super(),this._box=void 0,this._orientation=void 0,n.length!==0){if(n.length===1){if(n[0]instanceof Array){let o=n[0];if(o.length===0)return;if(o.every((r)=>r instanceof Xe.Point)){let r=e.points2segments(o);this.shapes2face(t.edges,r)}else if(o.every((r)=>r instanceof Array&&r.length===2)){let r=o.map((s)=>new Xe.Point(s[0],s[1])),i=e.points2segments(r);this.shapes2face(t.edges,i)}else if(o.every((r)=>r instanceof Xe.Segment||r instanceof Xe.Arc))this.shapes2face(t.edges,o);else if(o.every((r)=>r.name==="segment"||r.name==="arc")){let r=[];for(let i of o){let s;s=i.name==="segment"?new Xe.Segment(i):new Xe.Arc(i),r.push(s)}this.shapes2face(t.edges,r)}}else if(n[0]instanceof e){let o=n[0];this.first=o.first,this.last=o.last;for(let r of o)t.edges.add(r)}else if(n[0]instanceof Xe.Circle)this.shapes2face(t.edges,[n[0].toArc(ICn)]);else if(n[0]instanceof Xe.Box){let o=n[0];this.shapes2face(t.edges,[new Xe.Segment(new Xe.Point(o.xmin,o.ymin),new Xe.Point(o.xmax,o.ymin)),new Xe.Segment(new Xe.Point(o.xmax,o.ymin),new Xe.Point(o.xmax,o.ymax)),new Xe.Segment(new Xe.Point(o.xmax,o.ymax),new Xe.Point(o.xmin,o.ymax)),new Xe.Segment(new Xe.Point(o.xmin,o.ymax),new Xe.Point(o.xmin,o.ymin))])}}n.length===2&&n[0]instanceof Xe.Edge&&n[1]instanceof Xe.Edge&&(this.first=n[0],this.last=n[1],this.last.next=this.first,this.first.prev=this.last,this.setArcLength())}}get edges(){return this.toArray()}get vertices(){return this.edges.map((t)=>t.shape.start.clone())}get shapes(){return this.edges.map((t)=>t.shape.clone())}get box(){if(this._box===void 0){let t=new Xe.Box;for(let n of this)t=t.merge(n.box);this._box=t}return this._box}get perimeter(){return this.last.arc_length+this.last.length}pointAtLength(t){if(t>this.perimeter||t<0)return null;let n=null;for(let o of this)if(t>=o.arc_length&&(o===this.last||t<o.next.arc_length)){n=o.pointAtLength(t-o.arc_length);break}return n}static points2segments(t){let n=[];for(let o=0;o<t.length;o++)t[o].equalTo(t[(o+1)%t.length])||n.push(new Xe.Segment(t[o],t[(o+1)%t.length]));return n}shapes2face(t,n){for(let o of n){let r=new Xe.Edge(o);this.append(r),t.add(r)}}append(t){return super.append(t),this.setOneEdgeArcLength(t),t.face=this,this}insert(t,n){return super.insert(t,n),this.setOneEdgeArcLength(t),t.face=this,this}remove(t){return super.remove(t),this.setArcLength(),this}merge_with_next_edge(t){return t.shape.end.x=t.next.shape.end.x,t.shape.end.y=t.next.shape.end.y,this.remove(t.next),this}reverse(){let t=[],n=this.last;do n.shape=n.shape.reverse(),t.push(n),n=n.prev;while(n!==this.last);this.first=void 0,this.last=void 0;for(let o of t)this.first===void 0?(o.prev=o,o.next=o,this.first=o,this.last=o):(o.prev=this.last,this.last.next=o,this.last=o,this.last.next=this.first,this.first.prev=this.last),this.setOneEdgeArcLength(o);this._orientation!==void 0&&(this._orientation=void 0,this._orientation=this.orientation())}setArcLength(){for(let t of this)this.setOneEdgeArcLength(t),t.face=this}setOneEdgeArcLength(t){t===this.first?t.arc_length=0:t.arc_length=t.prev.arc_length+t.prev.length}area(){return Math.abs(this.signedArea())}signedArea(){let t=0,n=this.box.ymin;for(let o of this)t+=o.shape.definiteIntegral(n);return t}orientation(){if(this._orientation===void 0){let t=this.signedArea();Xe.Utils.EQ_0(t)?this._orientation=yde.NOT_ORIENTABLE:Xe.Utils.LT(t,0)?this._orientation=yde.CCW:this._orientation=yde.CW}return this._orientation}isSimple(t){return e.getSelfIntersections(this,t,!0).length===0}static getSelfIntersections(t,n,o=!1){let r=[];for(let i of t){let s=n.search(i.box);for(let a of s){if(i===a)continue;if(a.face!==t)continue;if(i.shape instanceof Xe.Segment&&a.shape instanceof Xe.Segment&&(i.next===a||i.prev===a))continue;let c=i.shape.intersect(a.shape);for(let l of c)if((!l.equalTo(i.start)||!l.equalTo(a.end)||a!==i.prev)&&(!l.equalTo(i.end)||!l.equalTo(a.start)||a!==i.next)&&(r.push(l),o))break;if(r.length>0&&o)break}if(r.length>0&&o)break}return r}findEdgeByPoint(t){let n;for(let o of this)if(!t.equalTo(o.shape.start)&&(t.equalTo(o.shape.end)||o.shape.contains(t))){n=o;break}return n}toPolygon(){return new Xe.Polygon(this.shapes)}toJSON(){return this.edges.map((t)=>t.toJSON())}svg(){let t=`M${this.first.start.x},${this.first.start.y}`;for(let n of this)t+=n.svg();return t+=" z",t}};Xe.Ray=class e extends Yk{constructor(...t){if(super(),this.pt=new Xe.Point,this.norm=new Xe.Vector(0,1),t.length!==0&&(t.length>=1&&t[0]instanceof Xe.Point&&(this.pt=t[0].clone()),t.length!==1)){if(!(t.length===2&&t[1]instanceof Xe.Vector))throw Xu.ILLEGAL_PARAMETERS;this.norm=t[1].clone()}}clone(){return new e(this.pt,this.norm)}get slope(){return new Xe.Vector(this.norm.y,-this.norm.x).slope}get box(){let t=this.slope;return new Xe.Box(t>Math.PI/2&&t<3*Math.PI/2?Number.NEGATIVE_INFINITY:this.pt.x,t>=0&&t<=Math.PI?this.pt.y:Number.NEGATIVE_INFINITY,t>=Math.PI/2&&t<=3*Math.PI/2?this.pt.x:Number.POSITIVE_INFINITY,t>=Math.PI&&t<=2*Math.PI||t===0?this.pt.y:Number.POSITIVE_INFINITY)}get start(){return this.pt}get end(){}get length(){return Number.POSITIVE_INFINITY}contains(t){if(this.pt.equalTo(t))return!0;let n=new Xe.Vector(this.pt,t);return Xe.Utils.EQ_0(this.norm.dot(n))&&Xe.Utils.GE(n.cross(this.norm),0)}coord(t){return WCn(t.x,t.y).cross(this.norm)}split(t){return this.contains(t)?this.pt.equalTo(t)?[this]:[new Xe.Segment(this.pt,t),new Xe.Ray(t,this.norm)]:[]}intersect(t){return t instanceof Xe.Point?this.contains(t)?[t]:[]:t instanceof Xe.Segment?pst(this,t):t instanceof Xe.Arc?mst(this,t):t instanceof Xe.Line?LCn(this,t):t instanceof Xe.Ray?(o=t,PZ(Ik(n=this),Ik(o)).filter((r)=>n.contains(r)).filter((r)=>o.contains(r))):t instanceof Xe.Circle?kCn(this,t):t instanceof Xe.Box?function(r,i){return eZ(Ik(r),i).filter((s)=>r.contains(s))}(this,t):t instanceof Xe.Polygon?HCn(this,t):t instanceof Xe.Multiline?EZ(this,t):void 0;var n,o}rotate(t,n=new Xe.Point){return new Xe.Ray(this.pt.rotate(t,n),this.norm.rotate(t))}transform(t){return new Xe.Ray(this.pt.transform(t),this.norm.clone())}get name(){return"ray"}svg(t,n={}){let o=eZ(new Xe.Line(this.pt,this.norm),t);return o=o.filter((r)=>this.contains(r)),o.length===0||o.length===2?"":new Xe.Segment(this.pt,o[0]).svg(n)}};Xe.ray=(...e)=>new Xe.Ray(...e);Xe.Polygon=class e{constructor(){this.faces=new Xe.PlanarSet,this.edges=new Xe.PlanarSet;let t=[...arguments];if(t.length===1&&(t[0]instanceof Array&&t[0].length>0||t[0]instanceof Xe.Circle||t[0]instanceof Xe.Box)){let n=t[0];if(t[0]instanceof Array&&t[0].every((o)=>o instanceof Array))if(n.every((o)=>o instanceof Array&&o.length===2&&typeof o[0]=="number"&&typeof o[1]=="number"))this.faces.add(new Xe.Face(this,n));else for(let o of n)if(o instanceof Array&&o[0]instanceof Array&&o[0].every((r)=>r instanceof Array&&r.length===2&&typeof r[0]=="number"&&typeof r[1]=="number"))for(let r of o)this.faces.add(new Xe.Face(this,r));else this.faces.add(new Xe.Face(this,o));else this.faces.add(new Xe.Face(this,n))}}get box(){return[...this.faces].reduce((t,n)=>t.merge(n.box),new Xe.Box)}get vertices(){return[...this.faces].flatMap((t)=>t.vertices)}clone(){let t=new e;for(let n of this.faces)t.addFace(n.shapes);return t}createFromArray(t){let n=new e;return t.forEach((o)=>[...o.faces].forEach((r)=>n.addFace(r.shapes))),n}isEmpty(){return this.edges.size===0||this.faces.size===0}isValid(){let t=!0;for(let n of this.faces)if(!n.isSimple(this.edges)){t=!1;break}return t}area(){let t=[...this.faces].reduce((n,o)=>n+o.signedArea(),0);return Math.abs(t)}addFace(...t){let n=new Xe.Face(this,...t);return this.faces.add(n),n}deleteFace(t){for(let n of t)this.edges.delete(n);return this.faces.delete(t)}recreateFaces(){this.faces.clear();for(let o of this.edges)o.face=null;let t,n=!0;for(;n;){n=!1;for(let o of this.edges)if(o.face===null){t=o,n=!0;break}if(n){let o=t;do o=o.next;while(o.next!==t);this.addFace(t,o)}}}removeChain(t,n,o){if(o.next!==n){for(let r=n;r!==o.next;r=r.next)if(t.remove(r),this.edges.delete(r),t.isEmpty()){this.deleteFace(t);break}}else this.deleteFace(t)}addVertex(t,n){let o=n.shape.split(t);if(o[0]===null)return n.prev;if(o[1]===null)return n;let r=new Xe.Edge(o[0]),i=n.prev;return n.face.insert(r,i),this.edges.delete(n),this.edges.add(r),n.shape=o[1],this.edges.add(n),r}removeEndVertex(t){let n=t.next;n!==t&&(t.face.merge_with_next_edge(t),this.edges.delete(n))}cut(t){let n=this.splitToIslands().flatMap((o)=>o._cutSingleIsland(t)).filter((o)=>o.isValid()&&o.isEmpty()===!1);return this.createFromArray(n)}_cutSingleIsland(t){let n=this.clone(),o=t.clone(),r,i,s={int_points1:[],int_points2:[],int_points1_sorted:[],int_points2_sorted:[]};for(let a of o.edges)for(let c of n.edges){let l=RCn(a,c);for(let h of l)nZ(a,h,s.int_points1),nZ(c,h,s.int_points2)}if(s.int_points1.length===0)return n;s.int_points1_sorted=ik(s.int_points1),s.int_points2_sorted=ik(s.int_points2),rZ(o,s.int_points1_sorted),rZ(n,s.int_points2_sorted),_st(s),s.int_points1_sorted=ik(s.int_points1),s.int_points2_sorted=ik(s.int_points2),ort(s.int_points1),rrt(s.int_points1,n);for(let a of s.int_points1_sorted)a.edge_before&&a.edge_after&&a.edge_before.bv===a.edge_after.bv&&(s.int_points2[a.id]=-1,a.id=-1);if(s.int_points1=s.int_points1.filter((a)=>a.id>=0),s.int_points2=s.int_points2.filter((a)=>a.id>=0),s.int_points1.forEach((a,c)=>{a.id=c}),s.int_points2.forEach((a,c)=>{a.id=c}),s.int_points1.length===0)return n;s.int_points1_sorted=ik(s.int_points1),s.int_points2_sorted=ik(s.int_points2);for(let a=1;a<s.int_points1_sorted.length;a++)if(i=s.int_points1_sorted[a],r=s.int_points1_sorted[a-1],i.edge_before&&i.edge_before.bv===1){let c=r.edge_after,l=i.edge_before,h=o.getChain(c,l);lfn(s.int_points2[r.id],s.int_points2[i.id],h),h.forEach((d)=>n.edges.add(d)),h=h.reverse().map((d)=>new Xe.Edge(d.shape.reverse()));for(let d=0;d<h.length-1;d++)h[d].next=h[d+1],h[d+1].prev=h[d];lfn(s.int_points2[i.id],s.int_points2[r.id],h),h.forEach((d)=>n.edges.add(d))}return n.recreateFaces(),n}cutWithLine(t){let n=new CY([t]);return this.cut(n)}findEdgeByPoint(t){let n;for(let o of this.faces)if(n=o.findEdgeByPoint(t),n!==void 0)break;return n}splitToIslands(){if(this.isEmpty())return[];let t=this.toArray();t.sort((r,i)=>i.area()-r.area());let n=[...t[0].faces][0].orientation(),o=t.filter((r)=>[...r.faces][0].orientation()===n);for(let r of t){let i=[...r.faces][0];if(i.orientation()!==n){for(let s of o)if(i.shapes.every((a)=>s.contains(a))){s.addFace(i.shapes);break}}}return o}rearrange(){if(this.faces.size<=1)return this.clone();let t=this.splitToIslands(),n=new e;return t.forEach((o)=>{o.faces.forEach((r)=>n.addFace(r.shapes))}),n}orientation(){return this.isEmpty()?yde.NOT_ORIENTABLE:[...this.faces][0].orientation()}isOuter(t){return t.orientation()===this.orientation()}isMultiPolygon(){let t=0;return this.faces.forEach((n)=>{this.isOuter(n)&&t++}),t>1}reverse(){for(let t of this.faces)t.reverse();return this}contains(t){if(t instanceof Xe.Point){let n=xde(this,t);return n===1||n===2}return UCn(this,t)}distanceTo(t){if(t instanceof Xe.Point){let[n,o]=Xe.Distance.point2polygon(t,this);return o=o.reverse(),[n,o]}if(t instanceof Xe.Circle||t instanceof Xe.Line||t instanceof Xe.Segment||t instanceof Xe.Arc){let[n,o]=Xe.Distance.shape2polygon(t,this);return o=o.reverse(),[n,o]}if(t instanceof Xe.Polygon){let n,o,r=[Number.POSITIVE_INFINITY,new Xe.Segment];for(let i of this.edges){let s=r[0];[n,o]=Xe.Distance.shape2planarSet(i.shape,t.edges,s),Xe.Utils.LT(n,s)&&(r=[n,o])}return r}}intersect(t){return t instanceof Xe.Point?this.contains(t)?[t]:[]:t instanceof Xe.Line?kue(t,this):t instanceof Xe.Ray?HCn(t,this):t instanceof Xe.Circle?NCn(t,this):t instanceof Xe.Segment?dst(t,this):t instanceof Xe.Arc?ust(t,this):t instanceof Xe.Polygon?function(n,o){let r=[];if(n.isEmpty()||o.isEmpty())return r;if(n.box.not_intersect(o.box))return r;for(let i of n.edges)r=[...r,...cfn(i,o)];return r}(t,this):t instanceof Xe.Multiline?function(n,o){let r=[];if(o.isEmpty()||n.size===0)return r;for(let i of n)r=[...r,...cfn(i,o)];return r}(t,this):void 0}translate(t){let n=new e;for(let o of this.faces)n.addFace(o.shapes.map((r)=>r.translate(t)));return n}rotate(t=0,n=new Xe.Point){let o=new e;for(let r of this.faces)o.addFace(r.shapes.map((i)=>i.rotate(t,n)));return o}scale(t,n){let o=new e;for(let r of this.faces)o.addFace(r.shapes.map((i)=>i.scale(t,n)));return o}transform(t=new Xe.Matrix){let n=new e;for(let o of this.faces)n.addFace(o.shapes.map((r)=>r.transform(t)));return n}toJSON(){return[...this.faces].map((t)=>t.toJSON())}toArray(){return[...this.faces].map((t)=>t.toPolygon())}dpath(){return[...this.faces].reduce((t,n)=>t+n.svg(),"")}svg(t={}){let n=`
<path ${GY({fillRule:"evenodd",fill:"lightcyan",...t})} d="`;for(let o of this.faces)n+=`
${o.svg()}`;return n+=`" >
</path>`,n}};Xe.polygon=(...e)=>new Xe.Polygon(...e);var{Circle:ent,Line:ffn,Point:yfn,Vector:z9e,Utils:tnt}=Xe;Xe.Inversion=class e{constructor(t){this.circle=t}get inversion_circle(){return this.circle}static inversePoint(t,n){let o=new z9e(t.pc,n),r=t.r*t.r,i=o.dot(o);return tnt.EQ_0(i)?new yfn(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY):t.pc.translate(o.multiply(r/i))}static inverseCircle(t,n){let o=t.pc.distanceTo(n.pc)[0];if(tnt.EQ(o,n.r)){let r=t.r*t.r/(2*n.r),i=new z9e(t.pc,n.pc);i=i.normalize();let s=t.pc.translate(i.multiply(r));return new ffn(s,i)}{let r=new z9e(t.pc,n.pc),i=t.r*t.r/(r.dot(r)-n.r*n.r),s=t.pc.translate(r.multiply(i)),a=Math.abs(i)*n.r;return new ent(s,a)}}static inverseLine(t,n){let[o,r]=t.pc.distanceTo(n);if(tnt.EQ_0(o))return n.clone();{let i=t.r*t.r/(2*o),s=new z9e(t.pc,r.end);return s=s.multiply(i/o),new ent(t.pc.translate(s),i)}}inverse(t){return t instanceof yfn?e.inversePoint(this.circle,t):t instanceof ent?e.inverseCircle(this.circle,t):t instanceof ffn?e.inverseLine(this.circle,t):void 0}};Xe.inversion=(e)=>new Xe.Inversion(e);Xe.Distance=class e{static point2point(t,n){return t.distanceTo(n)}static point2line(t,n){let o=t.projectionOn(n);return[new Xe.Vector(t,o).length,new Xe.Segment(t,o)]}static point2circle(t,n){let[o,r]=t.distanceTo(n.center);if(Xe.Utils.EQ_0(o))return[n.r,new Xe.Segment(t,n.toArc().start)];{let i=Math.abs(o-n.r),s=new Xe.Vector(n.pc,t).normalize().multiply(n.r),a=n.pc.translate(s);return[i,new Xe.Segment(t,a)]}}static point2segment(t,n){if(n.start.equalTo(n.end))return e.point2point(t,n.start);let o,r,i=new Xe.Vector(n.start,n.end),s=new Xe.Vector(n.start,t),a=new Xe.Vector(n.end,t),c=i.dot(s),l=-i.dot(a);if(Xe.Utils.GE(c,0)&&Xe.Utils.GE(l,0)){let h=n.tangentInStart();return o=Math.abs(h.cross(s)),r=n.start.translate(h.multiply(h.dot(s))),[o,new Xe.Segment(t,r)]}return c<0?t.distanceTo(n.start):t.distanceTo(n.end)}static point2arc(t,n){let o,r,i=new Xe.Circle(n.pc,n.r),s=[];return[o,r]=e.point2circle(t,i),r.end.on(n)&&s.push(e.point2circle(t,i)),s.push(e.point2point(t,n.start)),s.push(e.point2point(t,n.end)),e.sort(s),s[0]}static point2edge(t,n){return n.shape instanceof Xe.Segment?e.point2segment(t,n.shape):e.point2arc(t,n.shape)}static segment2line(t,n){let o=t.intersect(n);if(o.length>0)return[0,new Xe.Segment(o[0],o[0])];let r=[];return r.push(e.point2line(t.start,n)),r.push(e.point2line(t.end,n)),e.sort(r),r[0]}static segment2segment(t,n){let o=f8e(t,n);if(o.length>0)return[0,new Xe.Segment(o[0],o[0])];let r,i,s=[];return[r,i]=e.point2segment(n.start,t),s.push([r,i.reverse()]),[r,i]=e.point2segment(n.end,t),s.push([r,i.reverse()]),s.push(e.point2segment(t.start,n)),s.push(e.point2segment(t.end,n)),e.sort(s),s[0]}static segment2circle(t,n){let o=t.intersect(n);if(o.length>0)return[0,new Xe.Segment(o[0],o[0])];let r=new Xe.Line(t.ps,t.pe),[i,s]=e.point2line(n.center,r);if(Xe.Utils.GE(i,n.r)&&s.end.on(t))return e.point2circle(s.end,n);{let[a,c]=e.point2circle(t.start,n),[l,h]=e.point2circle(t.end,n);return Xe.Utils.LT(a,l)?[a,c]:[l,h]}}static segment2arc(t,n){let o=t.intersect(n);if(o.length>0)return[0,new Xe.Segment(o[0],o[0])];let r=new Xe.Line(t.ps,t.pe),i=new Xe.Circle(n.pc,n.r),[s,a]=e.point2line(i.center,r);if(Xe.Utils.GE(s,i.r)&&a.end.on(t)){let[d,u]=e.point2circle(a.end,i);if(u.end.on(n))return[d,u]}let c,l,h=[];return h.push(e.point2arc(t.start,n)),h.push(e.point2arc(t.end,n)),[c,l]=e.point2segment(n.start,t),h.push([c,l.reverse()]),[c,l]=e.point2segment(n.end,t),h.push([c,l.reverse()]),e.sort(h),h[0]}static circle2circle(t,n){let o=t.intersect(n);if(o.length>0)return[0,new Xe.Segment(o[0],o[0])];if(t.center.equalTo(n.center)){let r=t.toArc(),i=n.toArc();return e.point2point(r.start,i.start)}{let r=new Xe.Line(t.center,n.center),i=r.intersect(t),s=r.intersect(n),a=[];return a.push(e.point2point(i[0],s[0])),a.push(e.point2point(i[0],s[1])),a.push(e.point2point(i[1],s[0])),a.push(e.point2point(i[1],s[1])),e.sort(a),a[0]}}static circle2line(t,n){let o=t.intersect(n);if(o.length>0)return[0,new Xe.Segment(o[0],o[0])];let[r,i]=e.point2line(t.center,n),[s,a]=e.point2circle(i.end,t);return a=a.reverse(),[s,a]}static arc2line(t,n){let o=n.intersect(t);if(o.length>0)return[0,new Xe.Segment(o[0],o[0])];let r=new Xe.Circle(t.center,t.r),[i,s]=e.point2line(r.center,n);if(!Xe.Utils.GE(i,r.r)){let a=[];return a.push(e.point2line(t.start,n)),a.push(e.point2line(t.end,n)),e.sort(a),a[0]}{let[a,c]=e.point2circle(s.end,r);if(c.end.on(t))return[a,c]}}static arc2circle(t,n){let o=t.intersect(n);if(o.length>0)return[0,new Xe.Segment(o[0],o[0])];let r=new Xe.Circle(t.center,t.r),[i,s]=e.circle2circle(r,n);if(s.start.on(t))return[i,s];{let a=[];return a.push(e.point2circle(t.start,n)),a.push(e.point2circle(t.end,n)),e.sort(a),a[0]}}static arc2arc(t,n){let o=t.intersect(n);if(o.length>0)return[0,new Xe.Segment(o[0],o[0])];let r=new Xe.Circle(t.center,t.r),i=new Xe.Circle(n.center,n.r),[s,a]=e.circle2circle(r,i);if(a.start.on(t)&&a.end.on(n))return[s,a];{let c,l,h=[];return[c,l]=e.point2arc(t.start,n),l.end.on(n)&&h.push([c,l]),[c,l]=e.point2arc(t.end,n),l.end.on(n)&&h.push([c,l]),[c,l]=e.point2arc(n.start,t),l.end.on(t)&&h.push([c,l.reverse()]),[c,l]=e.point2arc(n.end,t),l.end.on(t)&&h.push([c,l.reverse()]),[c,l]=e.point2point(t.start,n.start),h.push([c,l]),[c,l]=e.point2point(t.start,n.end),h.push([c,l]),[c,l]=e.point2point(t.end,n.start),h.push([c,l]),[c,l]=e.point2point(t.end,n.end),h.push([c,l]),e.sort(h),h[0]}}static point2polygon(t,n){let o=[Number.POSITIVE_INFINITY,new Xe.Segment];for(let r of n.edges){let[i,s]=e.point2edge(t,r);Xe.Utils.LT(i,o[0])&&(o=[i,s])}return o}static shape2polygon(t,n){let o=[Number.POSITIVE_INFINITY,new Xe.Segment];for(let r of n.edges){let[i,s]=t.distanceTo(r.shape);Xe.Utils.LT(i,o[0])&&(o=[i,s])}return o}static polygon2polygon(t,n){let o=[Number.POSITIVE_INFINITY,new Xe.Segment];for(let r of t.edges)for(let i of n.edges){let[s,a]=r.shape.distanceTo(i.shape);Xe.Utils.LT(s,o[0])&&(o=[s,a])}return o}static box2box_minmax(t,n){let o=Math.max(Math.max(t.xmin-n.xmax,0),Math.max(n.xmin-t.xmax,0)),r=Math.max(Math.max(t.ymin-n.ymax,0),Math.max(n.ymin-t.ymax,0)),i=o*o+r*r,s=t.merge(n),a=s.xmax-s.xmin,c=s.ymax-s.ymin;return[i,a*a+c*c]}static minmax_tree_process_level(t,n,o,r){let i,s;for(let c of n){[i,s]=e.box2box_minmax(t.box,c.item.key);for(let l of c.item.values)l instanceof Xe.Edge?r.insert([i,s],l.shape):r.insert([i,s],l);Xe.Utils.LT(s,o)&&(o=s)}if(n.length===0)return o;let a=[...n.map((c)=>c.left.isNil()?void 0:c.left).filter((c)=>c!==void 0),...n.map((c)=>c.right.isNil()?void 0:c.right).filter((c)=>c!==void 0)].filter((c)=>{let[l,h]=e.box2box_minmax(t.box,c.max);return Xe.Utils.LE(l,o)});return o=e.minmax_tree_process_level(t,a,o,r)}static minmax_tree(t,n,o){let r=new hrt,i=[n.index.root],s=o<Number.POSITIVE_INFINITY?o*o:Number.POSITIVE_INFINITY;return s=e.minmax_tree_process_level(t,i,s,r),r}static minmax_tree_calc_distance(t,n,o){let r,i;if(n!=null&&!n.isNil()){if([r,i]=e.minmax_tree_calc_distance(t,n.left,o),i)return[r,i];if(Xe.Utils.LT(r[0],Math.sqrt(n.item.key.low)))return[r,!0];let[s,a]=e.distanceToArray(t,n.item.values);return Xe.Utils.LT(s,r[0])&&(r=[s,a]),[r,i]=e.minmax_tree_calc_distance(t,n.right,r),[r,i]}return[o,!1]}static shape2planarSet(t,n,o=Number.POSITIVE_INFINITY){let r=[o,new Xe.Segment],i=!1;if(n instanceof Xe.PlanarSet){let s=e.minmax_tree(t,n,o);[r,i]=e.minmax_tree_calc_distance(t,s.root,r)}return r}static sort(t){t.sort((n,o)=>Xe.Utils.LT(n[0],o[0])?-1:Xe.Utils.GT(n[0],o[0])?1:0)}static distance(t,n){return t.distanceTo(n)}static distanceToArray(t,n){let o=[Number.POSITIVE_INFINITY,new Xe.Segment];for(let r of n){let[i,s]=t.distanceTo(r);Xe.Utils.LT(i,o[0])&&(o=[i,s])}return o}static shape2multiline(t,n){let o=[Number.POSITIVE_INFINITY,new Xe.Segment];for(let r of n){let[i,s]=e.distance(t,r.shape);Xe.Utils.LT(i,o[0])&&(o=[i,s])}return o}static multiline2multiline(t,n){let o=[Number.POSITIVE_INFINITY,new Xe.Segment];for(let r of t)for(let i of n){let[s,a]=e.distance(r.shape,i.shape);Xe.Utils.LT(s,o[0])&&(o=[s,a])}return o}};var{Multiline:BUr,Point:XCn,Segment:TUr,Polygon:jCn}=Xe;function drt(e){return new XCn(e.split(" ").map(Number))}function KCn(e){return e.split(", ").map(drt)}function nnt(e){let t=KCn(e),n=[];for(let o=0;o<t.length-1;o++)n.push(new TUr(t[o],t[o+1]));return new BUr(n)}function xfn(e){let t=e.replace(/\(\(/,"").replace(/\)\)$/,"").split("), ("),n=new jCn,o;return t.forEach((r,i)=>{let s=r.split(", ").map((c)=>new XCn(c.split(" ").map(Number))),a=n.addFace(s);i===0?o=a.orientation():a.orientation()===o&&a.reverse()}),n}function DUr(e){if(e.startsWith("POLYGON"))return xfn(e.replace(/^POLYGON /,""));return function(t){let n=t.split(/\)\), \(\(/).map((r)=>"(("+r+"))").map(xfn),o=new jCn;return n.reduce((r,i)=>[...r,...i?.faces],[]).forEach((r)=>o.addFace([...r?.shapes])),o}(e.replace(/^MULTIPOLYGON \(\(\((.*)\)\)\)$/,"$1"))}function Cfn(e){return e.split(`
`)?.every((t)=>t.includes("POINT"))}function bfn(e){return e.split(`
`)?.every((t)=>t.includes("LINESTRING"))}Xe.isWktString=function(e){return e.startsWith("POINT")||Cfn(e)||e.startsWith("LINESTRING")||bfn(e)||e.startsWith("MULTILINESTRING")||e.startsWith("POLYGON")||e.startsWith("MULTIPOINT")||e.startsWith("MULTIPOLYGON")||e.startsWith("GEOMETRYCOLLECTION")},Xe.parseWKT=function e(t){if(t.startsWith("POINT"))return drt(t.replace(/^POINT \(/,"").replace(/\)$/,""));if(t.startsWith("MULTIPOINT"))return KCn(t.replace(/^MULTIPOINT \(/,"").replace(/\)$/,""));if(t.startsWith("LINESTRING"))return nnt(t.replace(/^LINESTRING \(/,"").replace(/\)$/,""));if(t.startsWith("MULTILINESTRING"))return function(n){return n.replace(/\(\(/,"").replace(/\)\)$/,"").split("), (").map(nnt)}(t.replace(/^MULTILINESTRING /,""));if(t.startsWith("POLYGON")||t.startsWith("MULTIPOLYGON"))return DUr(t);if(t.startsWith("GEOMETRYCOLLECTION")){let n=/(?<type>POINT|LINESTRING|POLYGON|MULTIPOINT|MULTILINESTRING|MULTIPOLYGON) \((?:[^\(\)]|\([^\)]*\))*\)/g,o=t.match(n);return o[0].startsWith("GEOMETRYCOLLECTION")&&(o[0]=o[0].replace("GEOMETRYCOLLECTION (","")),o.map(e).map((r)=>r instanceof Array?r:[r]).reduce((r,i)=>[...r,...i],[])}return Cfn(t)?function(n){return n.split(`
`).map((o)=>o.match(/\(([^)]+)\)/)[1]).map(drt)}(t):bfn(t)?function(n){return n.split(`
`).map((o)=>o.match(/\(([^)]+)\)/)[1]).map(nnt).reduce((o,r)=>[...o,...r],[])}(t):[]},Xe.BooleanOperations=yUr,Xe.Relations=SUr;UV=hUr(),Ifn=1,ont=UV!=null?ZGr(tUr(UV)):{},((e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of yCn(t))nUr.call(e,r)||r===n||ifn(e,r,{get:()=>t[r],enumerable:!(o=eUr(t,r))||o.enumerable})})(!Ifn&&UV&&UV.__esModule?ont:ifn(ont,"default",{value:UV,enumerable:!0}),UV);var UV,Ifn,ont,{create:NUr,defineProperty:vfn,getOwnPropertyDescriptor:RUr,getOwnPropertyNames:$Cn,getPrototypeOf:QUr}=Object,kUr=Object.prototype.hasOwnProperty,WY=(e,t)=>function(){return t||(0,e[$Cn(e)[0]])((t={exports:{}}).exports,t),t.exports},Sfn=(e,t,n)=>(n=e!=null?NUr(QUr(e)):{},((o,r,i,s)=>{if(r&&typeof r=="object"||typeof r=="function")for(let a of $Cn(r))kUr.call(o,a)||a===i||vfn(o,a,{get:()=>r[a],enumerable:!(s=RUr(r,a))||s.enumerable});return o})(!t&&e&&e.__esModule?n:vfn(n,"default",{value:e,enumerable:!0}),e)),LUr=WY({"node_modules/is-buffer/index.js"(e,t){function n(o){return!!o.constructor&&typeof o.constructor.isBuffer=="function"&&o.constructor.isBuffer(o)}t.exports=function(o){return o!=null&&(n(o)||function(r){return typeof r.readFloatLE=="function"&&typeof r.slice=="function"&&n(r.slice(0,0))}(o)||!!o._isBuffer)}}}),HUr=WY({"node_modules/kind-of/index.js"(e,t){var n=LUr(),o=Object.prototype.toString;t.exports=function(r){if(r===void 0)return"undefined";if(r===null)return"null";if(r===!0||r===!1||r instanceof Boolean)return"boolean";if(typeof r=="string"||r instanceof String)return"string";if(typeof r=="number"||r instanceof Number)return"number";if(typeof r=="function"||r instanceof Function)return"function";if(Array.isArray!==void 0&&Array.isArray(r))return"array";if(r instanceof RegExp)return"regexp";if(r instanceof Date)return"date";var i=o.call(r);return i==="[object RegExp]"?"regexp":i==="[object Date]"?"date":i==="[object Arguments]"?"arguments":i==="[object Error]"?"error":n(r)?"buffer":i==="[object Set]"?"set":i==="[object WeakSet]"?"weakset":i==="[object Map]"?"map":i==="[object WeakMap]"?"weakmap":i==="[object Symbol]"?"symbol":i==="[object Int8Array]"?"int8array":i==="[object Uint8Array]"?"uint8array":i==="[object Uint8ClampedArray]"?"uint8clampedarray":i==="[object Int16Array]"?"int16array":i==="[object Uint16Array]"?"uint16array":i==="[object Int32Array]"?"int32array":i==="[object Uint32Array]"?"uint32array":i==="[object Float32Array]"?"float32array":i==="[object Float64Array]"?"float64array":"object"}}}),FUr=WY({"node_modules/rename-keys/index.js"(e,t){(function(){function n(o,r){if(typeof r!="function")return o;var i={};for(var s in o)Object.prototype.hasOwnProperty.call(o,s)&&(i[r(s,o[s])||s]=o[s]);return i}t!==void 0&&t.exports?t.exports=n:typeof define=="function"&&define.amd?define([],function(){return n}):window.rename=n})()}}),zUr=WY({"node_modules/deep-rename-keys/index.js"(e,t){var n=HUr(),o=FUr();t.exports=function r(i,s){var a=n(i);if(a!=="object"&&a!=="array")throw Error("expected an object");var c=[];for(var l in a==="object"&&(i=o(i,s),c={}),i)if(i.hasOwnProperty(l)){var h=i[l];n(h)==="object"||n(h)==="array"?c[l]=r(h,s):c[l]=h}return c}}}),qCn=WY({"node_modules/eventemitter3/index.js"(e,t){var n=Object.prototype.hasOwnProperty,o="~";function r(){}function i(a,c,l){this.fn=a,this.context=c,this.once=l||!1}function s(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),new r().__proto__||(o=!1)),s.prototype.eventNames=function(){var a,c,l=[];if(this._eventsCount===0)return l;for(c in a=this._events)n.call(a,c)&&l.push(o?c.slice(1):c);return Object.getOwnPropertySymbols?l.concat(Object.getOwnPropertySymbols(a)):l},s.prototype.listeners=function(a,c){var l=o?o+a:a,h=this._events[l];if(c)return!!h;if(!h)return[];if(h.fn)return[h.fn];for(var d=0,u=h.length,_=Array(u);d<u;d++)_[d]=h[d].fn;return _},s.prototype.emit=function(a,c,l,h,d,u){var _=o?o+a:a;if(!this._events[_])return!1;var p,m,A=this._events[_],g=arguments.length;if(A.fn){switch(A.once&&this.removeListener(a,A.fn,void 0,!0),g){case 1:return A.fn.call(A.context),!0;case 2:return A.fn.call(A.context,c),!0;case 3:return A.fn.call(A.context,c,l),!0;case 4:return A.fn.call(A.context,c,l,h),!0;case 5:return A.fn.call(A.context,c,l,h,d),!0;case 6:return A.fn.call(A.context,c,l,h,d,u),!0}for(m=1,p=Array(g-1);m<g;m++)p[m-1]=arguments[m];A.fn.apply(A.context,p)}else{var f,y=A.length;for(m=0;m<y;m++)switch(A[m].once&&this.removeListener(a,A[m].fn,void 0,!0),g){case 1:A[m].fn.call(A[m].context);break;case 2:A[m].fn.call(A[m].context,c);break;case 3:A[m].fn.call(A[m].context,c,l);break;case 4:A[m].fn.call(A[m].context,c,l,h);break;default:if(!p)for(f=1,p=Array(g-1);f<g;f++)p[f-1]=arguments[f];A[m].fn.apply(A[m].context,p)}}return!0},s.prototype.on=function(a,c,l){var h=new i(c,l||this),d=o?o+a:a;return this._events[d]?this._events[d].fn?this._events[d]=[this._events[d],h]:this._events[d].push(h):(this._events[d]=h,this._eventsCount++),this},s.prototype.once=function(a,c,l){var h=new i(c,l||this,!0),d=o?o+a:a;return this._events[d]?this._events[d].fn?this._events[d]=[this._events[d],h]:this._events[d].push(h):(this._events[d]=h,this._eventsCount++),this},s.prototype.removeListener=function(a,c,l,h){var d=o?o+a:a;if(!this._events[d])return this;if(!c)return--this._eventsCount===0?this._events=new r:delete this._events[d],this;var u=this._events[d];if(u.fn)u.fn!==c||h&&!u.once||l&&u.context!==l||(--this._eventsCount===0?this._events=new r:delete this._events[d]);else{for(var _=0,p=[],m=u.length;_<m;_++)(u[_].fn!==c||h&&!u[_].once||l&&u[_].context!==l)&&p.push(u[_]);p.length?this._events[d]=p.length===1?p[0]:p:--this._eventsCount===0?this._events=new r:delete this._events[d]}return this},s.prototype.removeAllListeners=function(a){var c;return a?(c=o?o+a:a,this._events[c]&&(--this._eventsCount===0?this._events=new r:delete this._events[c])):(this._events=new r,this._eventsCount=0),this},s.prototype.off=s.prototype.removeListener,s.prototype.addListener=s.prototype.on,s.prototype.setMaxListeners=function(){return this},s.prefixed=o,s.EventEmitter=s,t!==void 0&&(t.exports=s)}}),OUr=WY({"node_modules/xml-lexer/dist/lexer.js"(e,t){function n(l,h,d){return h in l?Object.defineProperty(l,h,{value:d,enumerable:!0,configurable:!0,writable:!0}):l[h]=d,l}var o=qCn(),r=function(){},i={data:"state-data",cdata:"state-cdata",tagBegin:"state-tag-begin",tagName:"state-tag-name",tagEnd:"state-tag-end",attributeNameStart:"state-attribute-name-start",attributeName:"state-attribute-name",attributeNameEnd:"state-attribute-name-end",attributeValueBegin:"state-attribute-value-begin",attributeValue:"state-attribute-value"},s={lt:"action-lt",gt:"action-gt",space:"action-space",equal:"action-equal",quote:"action-quote",slash:"action-slash",char:"action-char",error:"action-error"},a={text:"text",openTag:"open-tag",closeTag:"close-tag",attributeName:"attribute-name",attributeValue:"attribute-value"},c={" ":s.space,"\t":s.space,"\n":s.space,"\r":s.space,"<":s.lt,">":s.gt,'"':s.quote,"'":s.quote,"=":s.equal,"/":s.slash};t.exports={State:i,Action:s,Type:a,create:function(l){var h,d,u,_,p,m,A,g,f,y;l=Object.assign({debug:!1},l);var x=new o,C=i.data,b="",I="",v="",P="",M="",B="",T=function(D,L){if(I[0]!=="?"&&I[0]!=="!"){var H={type:D,value:L};l.debug&&console.log("emit:",H),x.emit("data",H)}};x.stateMachine=(n(y={},i.data,(n(h={},s.lt,function(){b.trim()&&T(a.text,b),I="",M=!1,C=i.tagBegin}),n(h,s.char,function(D){b+=D}),h)),n(y,i.cdata,n({},s.char,function(D){(b+=D).substr(-3)==="]]>"&&(T(a.text,b.slice(0,-3)),b="",C=i.data)})),n(y,i.tagBegin,(n(d={},s.space,r),n(d,s.char,function(D){I=D,C=i.tagName}),n(d,s.slash,function(){I="",M=!0}),d)),n(y,i.tagName,(n(u={},s.space,function(){M?C=i.tagEnd:(C=i.attributeNameStart,T(a.openTag,I))}),n(u,s.gt,function(){T(M?a.closeTag:a.openTag,I),b="",C=i.data}),n(u,s.slash,function(){C=i.tagEnd,T(a.openTag,I)}),n(u,s.char,function(D){(I+=D)==="![CDATA["&&(C=i.cdata,b="",I="")}),u)),n(y,i.tagEnd,(n(_={},s.gt,function(){T(a.closeTag,I),b="",C=i.data}),n(_,s.char,r),_)),n(y,i.attributeNameStart,(n(p={},s.char,function(D){v=D,C=i.attributeName}),n(p,s.gt,function(){b="",C=i.data}),n(p,s.space,r),n(p,s.slash,function(){M=!0,C=i.tagEnd}),p)),n(y,i.attributeName,(n(m={},s.space,function(){C=i.attributeNameEnd}),n(m,s.equal,function(){T(a.attributeName,v),C=i.attributeValueBegin}),n(m,s.gt,function(){P="",T(a.attributeName,v),T(a.attributeValue,P),b="",C=i.data}),n(m,s.slash,function(){M=!0,P="",T(a.attributeName,v),T(a.attributeValue,P),C=i.tagEnd}),n(m,s.char,function(D){v+=D}),m)),n(y,i.attributeNameEnd,(n(A={},s.space,r),n(A,s.equal,function(){T(a.attributeName,v),C=i.attributeValueBegin}),n(A,s.gt,function(){P="",T(a.attributeName,v),T(a.attributeValue,P),b="",C=i.data}),n(A,s.char,function(D){P="",T(a.attributeName,v),T(a.attributeValue,P),v=D,C=i.attributeName}),A)),n(y,i.attributeValueBegin,(n(g={},s.space,r),n(g,s.quote,function(D){B=D,P="",C=i.attributeValue}),n(g,s.gt,function(){T(a.attributeValue,P=""),b="",C=i.data}),n(g,s.char,function(D){B="",P=D,C=i.attributeValue}),g)),n(y,i.attributeValue,(n(f={},s.space,function(D){B?P+=D:(T(a.attributeValue,P),C=i.attributeNameStart)}),n(f,s.quote,function(D){B===D?(T(a.attributeValue,P),C=i.attributeNameStart):P+=D}),n(f,s.gt,function(D){B?P+=D:(T(a.attributeValue,P),b="",C=i.data)}),n(f,s.slash,function(D){B?P+=D:(T(a.attributeValue,P),M=!0,C=i.tagEnd)}),n(f,s.char,function(D){P+=D}),f)),y);var N=function(D){l.debug&&console.log(C,D);var L=x.stateMachine[C],H=L[function(V){return c[V]||s.char}(D)]||L[s.error]||L[s.char];H(D)};return x.write=function(D){for(var L=D.length,H=0;H<L;H++)N(D[H])},x}}}}),VUr=WY({"node_modules/xml-reader/dist/reader.js"(e,t){var n=qCn(),o=OUr(),r=o.Type,i={element:"element",text:"text"},s=function(c){return Object.assign({name:"",type:i.element,value:"",parent:null,attributes:{},children:[]},c)},a=function(c){c=Object.assign({stream:!1,parentNodes:!0,doneEvent:"done",tagPrefix:"tag:",emitTopLevelOnly:!1,debug:!1},c);var l=void 0,h=void 0,d=void 0,u=void 0,_=new n,p=function(m){switch(m.type){case r.openTag:if(d===null)(d=h).name=m.value;else{var A=s({name:m.value,parent:d});d.children.push(A),d=A}break;case r.closeTag:var g=d.parent;if(c.parentNodes||(d.parent=null),d.name!==m.value)break;c.stream&&g===h&&(h.children=[],d.parent=null),c.emitTopLevelOnly&&g!==h||(_.emit(c.tagPrefix+d.name,d),_.emit("tag",d.name,d)),d===h&&(l.removeAllListeners("data"),_.emit(c.doneEvent,d),h=null),d=g;break;case r.text:d&&d.children.push(s({type:i.text,value:m.value,parent:c.parentNodes?d:null}));break;case r.attributeName:u=m.value,d.attributes[u]="";break;case r.attributeValue:d.attributes[u]=m.value}};return _.reset=function(){(l=o.create({debug:c.debug})).on("data",p),h=s(),d=null,u="",_.parse=l.write},_.reset(),_};t.exports={parseSync:function(c,l){l=Object.assign({},l,{stream:!1,tagPrefix:":"});var h=a(l),d=void 0;return h.on("done",function(u){d=u}),h.parse(c),d},create:a,NodeType:i}}}),{cos:WXs,sin:XXs,PI:jXs}=Math,{tan:KXs}=Math,YUr=(Sfn(zUr()),Sfn(VUr()),Object.create),{defineProperty:Pfn,getOwnPropertyDescriptor:GUr,getOwnPropertyNames:JCn,getPrototypeOf:UUr}=Object,WUr=Object.prototype.hasOwnProperty,XY=(e,t)=>function(){return t||(0,e[JCn(e)[0]])((t={exports:{}}).exports,t),t.exports},Efn=(e,t,n)=>(n=e!=null?YUr(UUr(e)):{},((o,r,i,s)=>{if(r&&typeof r=="object"||typeof r=="function")for(let a of JCn(r))WUr.call(o,a)||a===i||Pfn(o,a,{get:()=>r[a],enumerable:!(s=GUr(r,a))||s.enumerable});return o})(!t&&e&&e.__esModule?n:Pfn(n,"default",{value:e,enumerable:!0}),e)),XUr=XY({"node_modules/is-buffer/index.js"(e,t){function n(o){return!!o.constructor&&typeof o.constructor.isBuffer=="function"&&o.constructor.isBuffer(o)}t.exports=function(o){return o!=null&&(n(o)||function(r){return typeof r.readFloatLE=="function"&&typeof r.slice=="function"&&n(r.slice(0,0))}(o)||!!o._isBuffer)}}}),jUr=XY({"node_modules/kind-of/index.js"(e,t){var n=XUr(),o=Object.prototype.toString;t.exports=function(r){if(r===void 0)return"undefined";if(r===null)return"null";if(r===!0||r===!1||r instanceof Boolean)return"boolean";if(typeof r=="string"||r instanceof String)return"string";if(typeof r=="number"||r instanceof Number)return"number";if(typeof r=="function"||r instanceof Function)return"function";if(Array.isArray!==void 0&&Array.isArray(r))return"array";if(r instanceof RegExp)return"regexp";if(r instanceof Date)return"date";var i=o.call(r);return i==="[object RegExp]"?"regexp":i==="[object Date]"?"date":i==="[object Arguments]"?"arguments":i==="[object Error]"?"error":n(r)?"buffer":i==="[object Set]"?"set":i==="[object WeakSet]"?"weakset":i==="[object Map]"?"map":i==="[object WeakMap]"?"weakmap":i==="[object Symbol]"?"symbol":i==="[object Int8Array]"?"int8array":i==="[object Uint8Array]"?"uint8array":i==="[object Uint8ClampedArray]"?"uint8clampedarray":i==="[object Int16Array]"?"int16array":i==="[object Uint16Array]"?"uint16array":i==="[object Int32Array]"?"int32array":i==="[object Uint32Array]"?"uint32array":i==="[object Float32Array]"?"float32array":i==="[object Float64Array]"?"float64array":"object"}}}),KUr=XY({"node_modules/rename-keys/index.js"(e,t){(function(){function n(o,r){if(typeof r!="function")return o;var i={};for(var s in o)Object.prototype.hasOwnProperty.call(o,s)&&(i[r(s,o[s])||s]=o[s]);return i}t!==void 0&&t.exports?t.exports=n:typeof define=="function"&&define.amd?define([],function(){return n}):window.rename=n})()}}),$Ur=XY({"node_modules/deep-rename-keys/index.js"(e,t){var n=jUr(),o=KUr();t.exports=function r(i,s){var a=n(i);if(a!=="object"&&a!=="array")throw Error("expected an object");var c=[];for(var l in a==="object"&&(i=o(i,s),c={}),i)if(i.hasOwnProperty(l)){var h=i[l];n(h)==="object"||n(h)==="array"?c[l]=r(h,s):c[l]=h}return c}}}),ZCn=XY({"node_modules/eventemitter3/index.js"(e,t){var n=Object.prototype.hasOwnProperty,o="~";function r(){}function i(a,c,l){this.fn=a,this.context=c,this.once=l||!1}function s(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),new r().__proto__||(o=!1)),s.prototype.eventNames=function(){var a,c,l=[];if(this._eventsCount===0)return l;for(c in a=this._events)n.call(a,c)&&l.push(o?c.slice(1):c);return Object.getOwnPropertySymbols?l.concat(Object.getOwnPropertySymbols(a)):l},s.prototype.listeners=function(a,c){var l=o?o+a:a,h=this._events[l];if(c)return!!h;if(!h)return[];if(h.fn)return[h.fn];for(var d=0,u=h.length,_=Array(u);d<u;d++)_[d]=h[d].fn;return _},s.prototype.emit=function(a,c,l,h,d,u){var _=o?o+a:a;if(!this._events[_])return!1;var p,m,A=this._events[_],g=arguments.length;if(A.fn){switch(A.once&&this.removeListener(a,A.fn,void 0,!0),g){case 1:return A.fn.call(A.context),!0;case 2:return A.fn.call(A.context,c),!0;case 3:return A.fn.call(A.context,c,l),!0;case 4:return A.fn.call(A.context,c,l,h),!0;case 5:return A.fn.call(A.context,c,l,h,d),!0;case 6:return A.fn.call(A.context,c,l,h,d,u),!0}for(m=1,p=Array(g-1);m<g;m++)p[m-1]=arguments[m];A.fn.apply(A.context,p)}else{var f,y=A.length;for(m=0;m<y;m++)switch(A[m].once&&this.removeListener(a,A[m].fn,void 0,!0),g){case 1:A[m].fn.call(A[m].context);break;case 2:A[m].fn.call(A[m].context,c);break;case 3:A[m].fn.call(A[m].context,c,l);break;case 4:A[m].fn.call(A[m].context,c,l,h);break;default:if(!p)for(f=1,p=Array(g-1);f<g;f++)p[f-1]=arguments[f];A[m].fn.apply(A[m].context,p)}}return!0},s.prototype.on=function(a,c,l){var h=new i(c,l||this),d=o?o+a:a;return this._events[d]?this._events[d].fn?this._events[d]=[this._events[d],h]:this._events[d].push(h):(this._events[d]=h,this._eventsCount++),this},s.prototype.once=function(a,c,l){var h=new i(c,l||this,!0),d=o?o+a:a;return this._events[d]?this._events[d].fn?this._events[d]=[this._events[d],h]:this._events[d].push(h):(this._events[d]=h,this._eventsCount++),this},s.prototype.removeListener=function(a,c,l,h){var d=o?o+a:a;if(!this._events[d])return this;if(!c)return--this._eventsCount===0?this._events=new r:delete this._events[d],this;var u=this._events[d];if(u.fn)u.fn!==c||h&&!u.once||l&&u.context!==l||(--this._eventsCount===0?this._events=new r:delete this._events[d]);else{for(var _=0,p=[],m=u.length;_<m;_++)(u[_].fn!==c||h&&!u[_].once||l&&u[_].context!==l)&&p.push(u[_]);p.length?this._events[d]=p.length===1?p[0]:p:--this._eventsCount===0?this._events=new r:delete this._events[d]}return this},s.prototype.removeAllListeners=function(a){var c;return a?(c=o?o+a:a,this._events[c]&&(--this._eventsCount===0?this._events=new r:delete this._events[c])):(this._events=new r,this._eventsCount=0),this},s.prototype.off=s.prototype.removeListener,s.prototype.addListener=s.prototype.on,s.prototype.setMaxListeners=function(){return this},s.prefixed=o,s.EventEmitter=s,t!==void 0&&(t.exports=s)}}),qUr=XY({"node_modules/xml-lexer/dist/lexer.js"(e,t){function n(l,h,d){return h in l?Object.defineProperty(l,h,{value:d,enumerable:!0,configurable:!0,writable:!0}):l[h]=d,l}var o=ZCn(),r=function(){},i={data:"state-data",cdata:"state-cdata",tagBegin:"state-tag-begin",tagName:"state-tag-name",tagEnd:"state-tag-end",attributeNameStart:"state-attribute-name-start",attributeName:"state-attribute-name",attributeNameEnd:"state-attribute-name-end",attributeValueBegin:"state-attribute-value-begin",attributeValue:"state-attribute-value"},s={lt:"action-lt",gt:"action-gt",space:"action-space",equal:"action-equal",quote:"action-quote",slash:"action-slash",char:"action-char",error:"action-error"},a={text:"text",openTag:"open-tag",closeTag:"close-tag",attributeName:"attribute-name",attributeValue:"attribute-value"},c={" ":s.space,"\t":s.space,"\n":s.space,"\r":s.space,"<":s.lt,">":s.gt,'"':s.quote,"'":s.quote,"=":s.equal,"/":s.slash};t.exports={State:i,Action:s,Type:a,create:function(l){var h,d,u,_,p,m,A,g,f,y;l=Object.assign({debug:!1},l);var x=new o,C=i.data,b="",I="",v="",P="",M="",B="",T=function(D,L){if(I[0]!=="?"&&I[0]!=="!"){var H={type:D,value:L};l.debug&&console.log("emit:",H),x.emit("data",H)}};x.stateMachine=(n(y={},i.data,(n(h={},s.lt,function(){b.trim()&&T(a.text,b),I="",M=!1,C=i.tagBegin}),n(h,s.char,function(D){b+=D}),h)),n(y,i.cdata,n({},s.char,function(D){(b+=D).substr(-3)==="]]>"&&(T(a.text,b.slice(0,-3)),b="",C=i.data)})),n(y,i.tagBegin,(n(d={},s.space,r),n(d,s.char,function(D){I=D,C=i.tagName}),n(d,s.slash,function(){I="",M=!0}),d)),n(y,i.tagName,(n(u={},s.space,function(){M?C=i.tagEnd:(C=i.attributeNameStart,T(a.openTag,I))}),n(u,s.gt,function(){T(M?a.closeTag:a.openTag,I),b="",C=i.data}),n(u,s.slash,function(){C=i.tagEnd,T(a.openTag,I)}),n(u,s.char,function(D){(I+=D)==="![CDATA["&&(C=i.cdata,b="",I="")}),u)),n(y,i.tagEnd,(n(_={},s.gt,function(){T(a.closeTag,I),b="",C=i.data}),n(_,s.char,r),_)),n(y,i.attributeNameStart,(n(p={},s.char,function(D){v=D,C=i.attributeName}),n(p,s.gt,function(){b="",C=i.data}),n(p,s.space,r),n(p,s.slash,function(){M=!0,C=i.tagEnd}),p)),n(y,i.attributeName,(n(m={},s.space,function(){C=i.attributeNameEnd}),n(m,s.equal,function(){T(a.attributeName,v),C=i.attributeValueBegin}),n(m,s.gt,function(){P="",T(a.attributeName,v),T(a.attributeValue,P),b="",C=i.data}),n(m,s.slash,function(){M=!0,P="",T(a.attributeName,v),T(a.attributeValue,P),C=i.tagEnd}),n(m,s.char,function(D){v+=D}),m)),n(y,i.attributeNameEnd,(n(A={},s.space,r),n(A,s.equal,function(){T(a.attributeName,v),C=i.attributeValueBegin}),n(A,s.gt,function(){P="",T(a.attributeName,v),T(a.attributeValue,P),b="",C=i.data}),n(A,s.char,function(D){P="",T(a.attributeName,v),T(a.attributeValue,P),v=D,C=i.attributeName}),A)),n(y,i.attributeValueBegin,(n(g={},s.space,r),n(g,s.quote,function(D){B=D,P="",C=i.attributeValue}),n(g,s.gt,function(){T(a.attributeValue,P=""),b="",C=i.data}),n(g,s.char,function(D){B="",P=D,C=i.attributeValue}),g)),n(y,i.attributeValue,(n(f={},s.space,function(D){B?P+=D:(T(a.attributeValue,P),C=i.attributeNameStart)}),n(f,s.quote,function(D){B===D?(T(a.attributeValue,P),C=i.attributeNameStart):P+=D}),n(f,s.gt,function(D){B?P+=D:(T(a.attributeValue,P),b="",C=i.data)}),n(f,s.slash,function(D){B?P+=D:(T(a.attributeValue,P),M=!0,C=i.tagEnd)}),n(f,s.char,function(D){P+=D}),f)),y);var N=function(D){l.debug&&console.log(C,D);var L=x.stateMachine[C],H=L[function(V){return c[V]||s.char}(D)]||L[s.error]||L[s.char];H(D)};return x.write=function(D){for(var L=D.length,H=0;H<L;H++)N(D[H])},x}}}}),JUr=XY({"node_modules/xml-reader/dist/reader.js"(e,t){var n=ZCn(),o=qUr(),r=o.Type,i={element:"element",text:"text"},s=function(c){return Object.assign({name:"",type:i.element,value:"",parent:null,attributes:{},children:[]},c)},a=function(c){c=Object.assign({stream:!1,parentNodes:!0,doneEvent:"done",tagPrefix:"tag:",emitTopLevelOnly:!1,debug:!1},c);var l=void 0,h=void 0,d=void 0,u=void 0,_=new n,p=function(m){switch(m.type){case r.openTag:if(d===null)(d=h).name=m.value;else{var A=s({name:m.value,parent:d});d.children.push(A),d=A}break;case r.closeTag:var g=d.parent;if(c.parentNodes||(d.parent=null),d.name!==m.value)break;c.stream&&g===h&&(h.children=[],d.parent=null),c.emitTopLevelOnly&&g!==h||(_.emit(c.tagPrefix+d.name,d),_.emit("tag",d.name,d)),d===h&&(l.removeAllListeners("data"),_.emit(c.doneEvent,d),h=null),d=g;break;case r.text:d&&d.children.push(s({type:i.text,value:m.value,parent:c.parentNodes?d:null}));break;case r.attributeName:u=m.value,d.attributes[u]="";break;case r.attributeValue:d.attributes[u]=m.value}};return _.reset=function(){(l=o.create({debug:c.debug})).on("data",p),h=s(),d=null,u="",_.parse=l.write},_.reset(),_};t.exports={parseSync:function(c,l){l=Object.assign({},l,{stream:!1,tagPrefix:":"});var h=a(l),d=void 0;return h.on("done",function(u){d=u}),h.parse(c),d},create:a,NodeType:i}}}),{cos:$Xs,sin:qXs,PI:JXs}=Math,{tan:ZXs}=Math;Efn($Ur()),Efn(JUr());var x8e={};iCn(x8e,{all_layers:()=>qbn,any_circuit_element:()=>L9n,any_soup_element:()=>w8e,any_source_component:()=>Vbn,asset:()=>xst,base_circuit_json_error:()=>kl,battery_capacity:()=>gbn,brep_shape:()=>Xst,cadModelDefaultDirectionMap:()=>HXr,cad_component:()=>f9n,cad_model_axis_directions:()=>A9n,cad_model_formats:()=>LXr,capacitance:()=>fst,circuit_json_footprint_load_error:()=>UIn,current:()=>lZ,distance:()=>Ln,duration_ms:()=>MZ,experiment_type:()=>S9n,external_footprint_load_error:()=>GIn,frequency:()=>jY,getZodPrefixedIdWithDefault:()=>ro,inductance:()=>mbn,kicadAt:()=>T7e,kicadEffects:()=>Abn,kicadFont:()=>Cst,kicadFootprintAttributes:()=>ybn,kicadFootprintMetadata:()=>bbn,kicadFootprintModel:()=>Cbn,kicadFootprintPad:()=>xbn,kicadFootprintProperties:()=>fbn,kicadProperty:()=>tde,kicadSymbolEffects:()=>Sbn,kicadSymbolMetadata:()=>Ebn,kicadSymbolPinNames:()=>vbn,kicadSymbolPinNumbers:()=>Ibn,kicadSymbolProperties:()=>Pbn,kicadSymbolProperty:()=>ek,layer_ref:()=>$a,layer_string:()=>grt,length:()=>Zo,manufacturing_drc_properties:()=>L6n,ms:()=>gg,ninePointAnchor:()=>vB,parseAndConvertSiUnit:()=>Nb,pcbRenderLayer:()=>dXr,pcb_autorouting_error:()=>XIn,pcb_board:()=>dIn,pcb_breakout_point:()=>qIn,pcb_component:()=>H6n,pcb_component_invalid_layer_error:()=>a9n,pcb_component_not_on_board_edge_error:()=>s9n,pcb_component_outside_board_error:()=>i9n,pcb_connector_not_in_accessible_orientation_warning:()=>KIn,pcb_copper_pour:()=>r9n,pcb_copper_pour_brep:()=>n9n,pcb_copper_pour_polygon:()=>o9n,pcb_copper_pour_rect:()=>t9n,pcb_copper_text:()=>yIn,pcb_courtyard_circle:()=>_9n,pcb_courtyard_outline:()=>p9n,pcb_courtyard_overlap_error:()=>kIn,pcb_courtyard_pill:()=>g9n,pcb_courtyard_polygon:()=>m9n,pcb_courtyard_rect:()=>u9n,pcb_cutout:()=>VIn,pcb_cutout_circle:()=>FIn,pcb_cutout_path:()=>OIn,pcb_cutout_polygon:()=>zIn,pcb_cutout_rect:()=>HIn,pcb_fabrication_note_dimension:()=>wIn,pcb_fabrication_note_path:()=>EIn,pcb_fabrication_note_rect:()=>MIn,pcb_fabrication_note_text:()=>PIn,pcb_footprint_overlap_error:()=>QIn,pcb_ground_plane:()=>JIn,pcb_ground_plane_region:()=>ZIn,pcb_group:()=>WIn,pcb_hole:()=>U6n,pcb_hole_circle_or_square_shape:()=>AXr,pcb_hole_circle_shape:()=>_Xr,pcb_hole_oval_shape:()=>fXr,pcb_hole_pill_shape:()=>yXr,pcb_hole_rect_shape:()=>gXr,pcb_hole_rotated_pill_shape:()=>xXr,pcb_keepout:()=>LIn,pcb_manual_edit_conflict_warning:()=>jIn,pcb_missing_footprint_error:()=>YIn,pcb_net:()=>lIn,pcb_note_dimension:()=>RIn,pcb_note_line:()=>NIn,pcb_note_path:()=>DIn,pcb_note_rect:()=>TIn,pcb_note_text:()=>BIn,pcb_pad_pad_clearance_error:()=>h9n,pcb_pad_trace_clearance_error:()=>d9n,pcb_panel:()=>uIn,pcb_panelization_placement_error:()=>mIn,pcb_placement_error:()=>pIn,pcb_plated_hole:()=>W6n,pcb_port:()=>X6n,pcb_port_not_connected_error:()=>cIn,pcb_port_not_matched_error:()=>aIn,pcb_route_hint:()=>Q6n,pcb_route_hints:()=>mXr,pcb_silkscreen_circle:()=>CIn,pcb_silkscreen_graphic:()=>vIn,pcb_silkscreen_graphic_brep:()=>IIn,pcb_silkscreen_line:()=>gIn,pcb_silkscreen_oval:()=>bIn,pcb_silkscreen_path:()=>AIn,pcb_silkscreen_pill:()=>SIn,pcb_silkscreen_rect:()=>xIn,pcb_silkscreen_text:()=>fIn,pcb_smtpad:()=>K6n,pcb_smtpad_pill:()=>j6n,pcb_solder_paste:()=>$6n,pcb_text:()=>q6n,pcb_thermal_spoke:()=>e9n,pcb_trace:()=>nIn,pcb_trace_error:()=>iIn,pcb_trace_hint:()=>_In,pcb_trace_missing_error:()=>sIn,pcb_trace_route_point:()=>tIn,pcb_trace_route_point_through_pad:()=>eIn,pcb_trace_route_point_via:()=>Z6n,pcb_trace_route_point_wire:()=>J6n,pcb_trace_too_long_warning:()=>rIn,pcb_trace_warning:()=>oIn,pcb_via:()=>hIn,pcb_via_clearance_error:()=>c9n,pcb_via_trace_clearance_error:()=>l9n,point:()=>Rr,point3:()=>lB,point_with_bulge:()=>R6n,port_arrangement:()=>d6n,position:()=>lXr,position3:()=>hXr,resistance:()=>B7e,ring:()=>Art,rotation:()=>Im,route_hint_point:()=>k6n,schematic_arc:()=>A6n,schematic_box:()=>s6n,schematic_circle:()=>g6n,schematic_component:()=>u6n,schematic_component_port_arrangement_by_sides:()=>h6n,schematic_component_port_arrangement_by_size:()=>l6n,schematic_debug_line:()=>S6n,schematic_debug_object:()=>E6n,schematic_debug_object_base:()=>R7e,schematic_debug_point:()=>P6n,schematic_debug_rect:()=>v6n,schematic_error:()=>b6n,schematic_group:()=>B6n,schematic_layout_error:()=>I6n,schematic_line:()=>m6n,schematic_manual_edit_conflict_warning:()=>w6n,schematic_net_label:()=>C6n,schematic_path:()=>a6n,schematic_pin_styles:()=>c6n,schematic_port:()=>x6n,schematic_rect:()=>_6n,schematic_sheet:()=>N6n,schematic_symbol:()=>p6n,schematic_table:()=>T6n,schematic_table_cell:()=>D6n,schematic_text:()=>y6n,schematic_trace:()=>f6n,schematic_voltage_probe:()=>M6n,simulation_ac_current_source:()=>I9n,simulation_ac_voltage_source:()=>x9n,simulation_current_probe:()=>D9n,simulation_current_source:()=>v9n,simulation_dc_current_source:()=>b9n,simulation_dc_voltage_source:()=>y9n,simulation_experiment:()=>E9n,simulation_op_amp:()=>R9n,simulation_oscilloscope_trace:()=>k9n,simulation_spice_subcircuit:()=>Q9n,simulation_switch:()=>B9n,simulation_transient_current_graph:()=>w9n,simulation_transient_voltage_graph:()=>M9n,simulation_unknown_experiment_error:()=>N9n,simulation_voltage_probe:()=>T9n,simulation_voltage_source:()=>C9n,size:()=>yst,source_ambiguous_port_reference:()=>Kbn,source_board:()=>jbn,source_component_base:()=>id,source_component_internal_connection:()=>Gbn,source_component_misconfigured_error:()=>Wst,source_component_pins_underspecified_warning:()=>n6n,source_failed_to_create_component_error:()=>Lbn,source_group:()=>Wbn,source_i2c_misconfigured_error:()=>Ust,source_interconnect:()=>zbn,source_invalid_component_property_error:()=>zst,source_manually_placed_via:()=>Jbn,source_missing_manufacturer_part_number_warning:()=>Yst,source_missing_property_error:()=>kbn,source_net:()=>Xbn,source_no_ground_pin_defined_warning:()=>t6n,source_no_power_pin_defined_warning:()=>e6n,source_part_not_found_warning:()=>i6n,source_pcb_ground_plane:()=>$bn,source_pin_attributes:()=>Nbn,source_pin_missing_trace_warning:()=>Vst,source_pin_must_be_connected_error:()=>o6n,source_port:()=>Ybn,source_project_metadata:()=>Fst,source_property_ignored_warning:()=>Hbn,source_refdes_convention_warning:()=>Gst,source_simple_ammeter:()=>Dbn,source_simple_battery:()=>Est,source_simple_capacitor:()=>bst,source_simple_chip:()=>Sst,source_simple_connector:()=>Qbn,source_simple_crystal:()=>Rbn,source_simple_current_source:()=>Bbn,source_simple_diode:()=>N7e,source_simple_fiducial:()=>Mbn,source_simple_fuse:()=>Tbn,source_simple_ground:()=>wbn,source_simple_inductor:()=>Mst,source_simple_led:()=>vst,source_simple_mosfet:()=>kst,source_simple_op_amp:()=>Lst,source_simple_pin_header:()=>Tst,source_simple_pinout:()=>Dst,source_simple_potentiometer:()=>Bst,source_simple_power_source:()=>Pst,source_simple_push_button:()=>wst,source_simple_resistor:()=>Ist,source_simple_resonator:()=>Nst,source_simple_switch:()=>Hst,source_simple_test_point:()=>Qst,source_simple_transistor:()=>Rst,source_simple_voltage_probe:()=>Fbn,source_simple_voltage_source:()=>Obn,source_trace:()=>Ubn,source_trace_not_connected_error:()=>Ost,source_unnamed_trace_warning:()=>Zbn,spice_simulation_options:()=>P9n,supplier_footprint_mismatch_warning:()=>$In,supplier_name:()=>D7e,time:()=>cXr,timestamp:()=>_bn,unknown_error_finding_part:()=>r6n,visible_layer:()=>fg,voltage:()=>xB,wave_shape:()=>Kst});var ebn=new Map([["T",1000000000000],["G",1e9],["M",1e6],["K",1000],["k",1000],["",1],["m",0.001],["µ",0.000001],["u",0.000001],["n",0.000000001],["p",0.000000000001],["f",0.000000000000001]]),ZUr=[...ebn.keys()];function Mfn(e){return ebn.get(e)}var tbn={Hz:{baseUnit:"Hz",variants:{MHz:1e6,kHz:1000,Hz:1}},g:{baseUnit:"g",variants:{kg:1000,g:1}},"Ω":{baseUnit:"Ω",variants:{"mΩ":0.001,mohm:0.001,mOhm:0.001,milliohm:0.001,"Ω":1,ohm:1,Ohm:1,"kΩ":1000,"KΩ":1000,kohm:1000,kOhm:1000,KOhm:1000,Kohm:1000,"MΩ":1e6,Mohm:1e6,MOhm:1e6,megohm:1e6,Megohm:1e6,"GΩ":1e9,Gohm:1e9,GOhm:1e9,"TΩ":1000000000000,Tohm:1000000000000,TOhm:1000000000000}},V:{baseUnit:"V",variants:{mV:0.001,V:1,kV:1000,KV:1000,MV:1e6,GV:1e9,TV:1000000000000}},A:{baseUnit:"A",variants:{"µA":0.000001,mA:0.001,ma:0.001,A:1,kA:1000,MA:1e6}},F:{baseUnit:"F",variants:{pF:0.000000000001,nF:0.000000001,"µF":0.000001,uF:0.000001,mF:0.001,F:1,kF:1000,KF:1000,MF:1e6}},H:{baseUnit:"H",variants:{pH:0.000000000001,nH:0.000000001,"µH":0.000001,uH:0.000001,mH:0.001,H:1,kH:1000,KH:1000,MH:1e6}},ml:{baseUnit:"ml",variants:{ml:1,mL:1,l:1000,L:1000}},deg:{baseUnit:"deg",variants:{rad:180/Math.PI}},ms:{baseUnit:"ms",variants:{fs:0.000000000001,ps:0.000000001,ns:0.000001,us:0.001,"µs":0.001,ms:1,s:1000}},mm:{baseUnit:"mm",variants:{nm:0.000001,"µm":0.001,um:0.001,mm:1,cm:10,dm:100,m:1000,km:1e6,in:25.4,ft:304.8,IN:25.4,FT:304.8,yd:914.4,mi:1609344,mil:0.0254}}},urt=new Set;for(let[e,t]of Object.entries(tbn)){urt.add(e);for(let n of Object.keys(t.variants))urt.add(n)}function Nb(e,t){if(e==null)return{parsedUnit:null,unitOfValue:null,value:null};if(typeof e=="string"&&e.match(/^-?[\d.]+$/))return{value:Number.parseFloat(e),parsedUnit:null,unitOfValue:null};if(typeof e=="number")return{value:e,parsedUnit:null,unitOfValue:null};if(typeof e=="object"&&"x"in e&&"y"in e){let l=Nb(e.x,t),h=Nb(e.x,t),d=Nb(e.y,t);return h.value===null||d.value===null?{parsedUnit:null,unitOfValue:null,value:null}:{parsedUnit:l.parsedUnit,unitOfValue:l.unitOfValue,value:{x:h.value,y:d.value}}}let n=e.toString().split("").reverse().join(""),o=n.match(/[^\d\s]+/)?.[0];if(!o)throw Error(`Could not determine unit: "${e}"`);let r=o.split("").reverse().join(""),i=e.slice(0,-r.length),s=Mfn(r);if(t&&s!=null)return{parsedUnit:null,unitOfValue:t,value:Number.parseFloat(i)*s};if(s!=null&&!urt.has(r))return{parsedUnit:null,unitOfValue:null,value:Number.parseFloat(i)*s};let{baseUnit:a,conversionFactor:c}=function(l){for(let h of Object.values(tbn)){if(l in h.variants)return{baseUnit:h.baseUnit,conversionFactor:h.variants[l]};for(let[d,u]of Object.entries(h.variants)){if(!l.endsWith(d))continue;let _=Mfn(l.slice(0,-d.length));if(_!=null)return{baseUnit:h.baseUnit,conversionFactor:_*u}}}return{baseUnit:l,conversionFactor:1}}(r);return{parsedUnit:r,unitOfValue:a,value:c*Number.parseFloat(i)}}var cl,Gx,rnt,eWr=ZUr.filter((e)=>e!=="").sort((e,t)=>t.length-e.length).map((e)=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|"),F=(new RegExp(`^([+-]?(?:\\d+(?:\\.\\d*)?|\\.\\d+)(?:[eE][+-]?\\d+)?)(?:(${eWr}))?$`),{});iCn(F,{BRAND:()=>vWr,DIRTY:()=>I8e,EMPTY_PATH:()=>oWr,INVALID:()=>ps,NEVER:()=>aXr,OK:()=>My,ParseStatus:()=>o5,Schema:()=>Ka,ZodAny:()=>aZ,ZodArray:()=>TY,ZodBigInt:()=>Xde,ZodBoolean:()=>jde,ZodBranded:()=>gst,ZodCatch:()=>rue,ZodDate:()=>Kde,ZodDefault:()=>oue,ZodDiscriminatedUnion:()=>sbn,ZodEffects:()=>M9,ZodEnum:()=>Hue,ZodError:()=>D9,ZodFirstPartyTypeKind:()=>bs,ZodFunction:()=>cbn,ZodIntersection:()=>Zde,ZodIssueCode:()=>Oo,ZodLazy:()=>eue,ZodLiteral:()=>tue,ZodMap:()=>P8e,ZodNaN:()=>M8e,ZodNativeEnum:()=>nue,ZodNever:()=>_B,ZodNull:()=>qde,ZodNullable:()=>Tk,ZodNumber:()=>Wde,ZodObject:()=>Tb,ZodOptional:()=>GS,ZodParsedType:()=>Gr,ZodPipeline:()=>Ast,ZodPromise:()=>cZ,ZodReadonly:()=>iue,ZodRecord:()=>abn,ZodSchema:()=>Ka,ZodSet:()=>E8e,ZodString:()=>sZ,ZodSymbol:()=>v8e,ZodTransformer:()=>M9,ZodTuple:()=>Bk,ZodType:()=>Ka,ZodUndefined:()=>$de,ZodUnion:()=>Jde,ZodUnknown:()=>bY,ZodVoid:()=>S8e,addIssueToContext:()=>Sr,any:()=>NWr,array:()=>LWr,bigint:()=>MWr,boolean:()=>pbn,coerce:()=>sXr,custom:()=>hbn,date:()=>wWr,datetimeRegex:()=>ibn,defaultErrorMap:()=>iZ,discriminatedUnion:()=>OWr,effect:()=>Dfn,enum:()=>$Wr,function:()=>XWr,getErrorMap:()=>C8e,getParsedType:()=>tB,instanceof:()=>PWr,intersection:()=>VWr,isAborted:()=>prt,isAsync:()=>Ude,isDirty:()=>mrt,isValid:()=>BY,late:()=>SWr,lazy:()=>jWr,literal:()=>KWr,makeIssue:()=>b8e,map:()=>UWr,nan:()=>EWr,nativeEnum:()=>qWr,never:()=>QWr,null:()=>DWr,nullable:()=>eXr,number:()=>ubn,object:()=>HWr,objectUtil:()=>rnt,oboolean:()=>iXr,onumber:()=>rXr,optional:()=>ZWr,ostring:()=>oXr,pipeline:()=>nXr,preprocess:()=>tXr,promise:()=>JWr,quotelessJson:()=>tWr,record:()=>GWr,set:()=>WWr,setErrorMap:()=>nWr,strictObject:()=>FWr,string:()=>dbn,symbol:()=>BWr,transformer:()=>Dfn,tuple:()=>YWr,undefined:()=>TWr,union:()=>zWr,unknown:()=>RWr,util:()=>cl,void:()=>kWr}),(Gx=cl||(cl={})).assertEqual=(e)=>{},Gx.assertIs=function(e){},Gx.assertNever=function(e){throw Error()},Gx.arrayToEnum=(e)=>{let t={};for(let n of e)t[n]=n;return t},Gx.getValidEnumValues=(e)=>{let t=Gx.objectKeys(e).filter((o)=>typeof e[e[o]]!="number"),n={};for(let o of t)n[o]=e[o];return Gx.objectValues(n)},Gx.objectValues=(e)=>Gx.objectKeys(e).map(function(t){return e[t]}),Gx.objectKeys=typeof Object.keys=="function"?(e)=>Object.keys(e):(e)=>{let t=[];for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.push(n);return t},Gx.find=(e,t)=>{for(let n of e)if(t(n))return n},Gx.isInteger=typeof Number.isInteger=="function"?(e)=>Number.isInteger(e):(e)=>typeof e=="number"&&Number.isFinite(e)&&Math.floor(e)===e,Gx.joinValues=function(e,t=" | "){return e.map((n)=>typeof n=="string"?`'${n}'`:n).join(t)},Gx.jsonStringifyReplacer=(e,t)=>typeof t=="bigint"?t.toString():t,(rnt||(rnt={})).mergeShapes=(e,t)=>({...e,...t});var Gr=cl.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),tB=(e)=>{switch(typeof e){case"undefined":return Gr.undefined;case"string":return Gr.string;case"number":return Number.isNaN(e)?Gr.nan:Gr.number;case"boolean":return Gr.boolean;case"function":return Gr.function;case"bigint":return Gr.bigint;case"symbol":return Gr.symbol;case"object":return Array.isArray(e)?Gr.array:e===null?Gr.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?Gr.promise:typeof Map<"u"&&e instanceof Map?Gr.map:typeof Set<"u"&&e instanceof Set?Gr.set:typeof Date<"u"&&e instanceof Date?Gr.date:Gr.object;default:return Gr.unknown}},Oo=cl.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),tWr=(e)=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),D9=class e extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=(o)=>{this.issues=[...this.issues,o]},this.addIssues=(o=[])=>{this.issues=[...this.issues,...o]};let n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=t}format(t){let n=t||function(i){return i.message},o={_errors:[]},r=(i)=>{for(let s of i.issues)if(s.code==="invalid_union")s.unionErrors.map(r);else if(s.code==="invalid_return_type")r(s.returnTypeError);else if(s.code==="invalid_arguments")r(s.argumentsError);else if(s.path.length===0)o._errors.push(n(s));else{let a=o,c=0;for(;c<s.path.length;){let l=s.path[c];c===s.path.length-1?(a[l]=a[l]||{_errors:[]},a[l]._errors.push(n(s))):a[l]=a[l]||{_errors:[]},a=a[l],c++}}};return r(this),o}static assert(t){if(!(t instanceof e))throw Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,cl.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=(n)=>n.message){let n={},o=[];for(let r of this.issues)if(r.path.length>0){let i=r.path[0];n[i]=n[i]||[],n[i].push(t(r))}else o.push(t(r));return{formErrors:o,fieldErrors:n}}get formErrors(){return this.flatten()}};D9.create=(e)=>new D9(e);var iZ=(e,t)=>{let n;switch(e.code){case Oo.invalid_type:n=e.received===Gr.undefined?"Required":`Expected ${e.expected}, received ${e.received}`;break;case Oo.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,cl.jsonStringifyReplacer)}`;break;case Oo.unrecognized_keys:n=`Unrecognized key(s) in object: ${cl.joinValues(e.keys,", ")}`;break;case Oo.invalid_union:n="Invalid input";break;case Oo.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${cl.joinValues(e.options)}`;break;case Oo.invalid_enum_value:n=`Invalid enum value. Expected ${cl.joinValues(e.options)}, received '${e.received}'`;break;case Oo.invalid_arguments:n="Invalid function arguments";break;case Oo.invalid_return_type:n="Invalid function return type";break;case Oo.invalid_date:n="Invalid date";break;case Oo.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):("startsWith"in e.validation)?n=`Invalid input: must start with "${e.validation.startsWith}"`:("endsWith"in e.validation)?n=`Invalid input: must end with "${e.validation.endsWith}"`:cl.assertNever(e.validation):n=e.validation!=="regex"?`Invalid ${e.validation}`:"Invalid";break;case Oo.too_small:n=e.type==="array"?`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"||e.type==="bigint"?`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:"Invalid input";break;case Oo.too_big:n=e.type==="array"?`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:"Invalid input";break;case Oo.custom:n="Invalid input";break;case Oo.invalid_intersection_types:n="Intersection results could not be merged";break;case Oo.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case Oo.not_finite:n="Number must be finite";break;default:n=t.defaultError,cl.assertNever(e)}return{message:n}},nbn=iZ;function nWr(e){nbn=e}function C8e(){return nbn}var b8e=(e)=>{let{data:t,path:n,errorMaps:o,issueData:r}=e,i=[...n,...r.path||[]],s={...r,path:i};if(r.message!==void 0)return{...r,path:i,message:r.message};let a="",c=o.filter((l)=>!!l).slice().reverse();for(let l of c)a=l(s,{data:t,defaultError:a}).message;return{...r,path:i,message:a}},oWr=[];function Sr(e,t){let n=C8e(),o=b8e({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===iZ?void 0:iZ].filter((r)=>!!r)});e.common.issues.push(o)}var yi,wfn,o5=class e{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,n){let o=[];for(let r of n){if(r.status==="aborted")return ps;r.status==="dirty"&&t.dirty(),o.push(r.value)}return{status:t.value,value:o}}static async mergeObjectAsync(t,n){let o=[];for(let r of n){let i=await r.key,s=await r.value;o.push({key:i,value:s})}return e.mergeObjectSync(t,o)}static mergeObjectSync(t,n){let o={};for(let r of n){let{key:i,value:s}=r;if(i.status==="aborted")return ps;if(s.status==="aborted")return ps;i.status==="dirty"&&t.dirty(),s.status==="dirty"&&t.dirty(),i.value==="__proto__"||s.value===void 0&&!r.alwaysSet||(o[i.value]=s.value)}return{status:t.value,value:o}}},ps=Object.freeze({status:"aborted"}),I8e=(e)=>({status:"dirty",value:e}),My=(e)=>({status:"valid",value:e}),prt=(e)=>e.status==="aborted",mrt=(e)=>e.status==="dirty",BY=(e)=>e.status==="valid",Ude=(e)=>typeof Promise<"u"&&e instanceof Promise;(wfn=yi||(yi={})).errToObj=(e)=>typeof e=="string"?{message:e}:e||{},wfn.toString=(e)=>typeof e=="string"?e:e?.message;var qS=class{constructor(e,t,n,o){this._cachedPath=[],this.parent=e,this.data=t,this._path=n,this._key=o}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},Bfn=(e,t)=>{if(BY(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let n=new D9(e.common.issues);return this._error=n,this._error}}};function Da(e){if(!e)return{};let{errorMap:t,invalid_type_error:n,required_error:o,description:r}=e;if(t&&(n||o))throw Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);if(t)return{errorMap:t,description:r};return{errorMap:(i,s)=>{let{message:a}=e;return i.code==="invalid_enum_value"?{message:a??s.defaultError}:s.data===void 0?{message:a??o??s.defaultError}:i.code!=="invalid_type"?{message:s.defaultError}:{message:a??n??s.defaultError}},description:r}}var int,Ka=class{get description(){return this._def.description}_getType(e){return tB(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:tB(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new o5,ctx:{common:e.parent.common,data:e.data,parsedType:tB(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let t=this._parse(e);if(Ude(t))throw Error("Synchronous parse encountered promise.");return t}_parseAsync(e){let t=this._parse(e);return Promise.resolve(t)}parse(e,t){let n=this.safeParse(e,t);if(n.success)return n.data;throw n.error}safeParse(e,t){let n={common:{issues:[],async:t?.async??!1,contextualErrorMap:t?.errorMap},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:tB(e)},o=this._parseSync({data:e,path:n.path,parent:n});return Bfn(n,o)}"~validate"(e){let t={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:tB(e)};if(!this["~standard"].async)try{let n=this._parseSync({data:e,path:[],parent:t});return BY(n)?{value:n.value}:{issues:t.common.issues}}catch(n){n?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then((n)=>BY(n)?{value:n.value}:{issues:t.common.issues})}async parseAsync(e,t){let n=await this.safeParseAsync(e,t);if(n.success)return n.data;throw n.error}async safeParseAsync(e,t){let n={common:{issues:[],contextualErrorMap:t?.errorMap,async:!0},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:tB(e)},o=this._parse({data:e,path:n.path,parent:n}),r=await(Ude(o)?o:Promise.resolve(o));return Bfn(n,r)}refine(e,t){let n=(o)=>typeof t=="string"||t===void 0?{message:t}:typeof t=="function"?t(o):t;return this._refinement((o,r)=>{let i=e(o),s=()=>r.addIssue({code:Oo.custom,...n(o)});return typeof Promise<"u"&&i instanceof Promise?i.then((a)=>!!a||(s(),!1)):!!i||(s(),!1)})}refinement(e,t){return this._refinement((n,o)=>!!e(n)||(o.addIssue(typeof t=="function"?t(n,o):t),!1))}_refinement(e){return new M9({schema:this,typeName:bs.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:(t)=>this["~validate"](t)}}optional(){return GS.create(this,this._def)}nullable(){return Tk.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return TY.create(this)}promise(){return cZ.create(this,this._def)}or(e){return Jde.create([this,e],this._def)}and(e){return Zde.create(this,e,this._def)}transform(e){return new M9({...Da(this._def),schema:this,typeName:bs.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let t=typeof e=="function"?e:()=>e;return new oue({...Da(this._def),innerType:this,defaultValue:t,typeName:bs.ZodDefault})}brand(){return new gst({typeName:bs.ZodBranded,type:this,...Da(this._def)})}catch(e){let t=typeof e=="function"?e:()=>e;return new rue({...Da(this._def),innerType:this,catchValue:t,typeName:bs.ZodCatch})}describe(e){return new this.constructor({...this._def,description:e})}pipe(e){return Ast.create(this,e)}readonly(){return iue.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},rWr=/^c[^\s-]{8,}$/i,iWr=/^[0-9a-z]+$/,sWr=/^[0-9A-HJKMNP-TV-Z]{26}$/i,aWr=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,cWr=/^[a-z0-9_-]{21}$/i,lWr=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,hWr=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,dWr=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,uWr=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,pWr=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,mWr=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,_Wr=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,gWr=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,AWr=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,obn="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",fWr=new RegExp(`^${obn}$`);function rbn(e){let t="[0-5]\\d";return e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`),`([01]\\d|2[0-3]):[0-5]\\d(:${t})${e.precision?"+":"?"}`}function yWr(e){return new RegExp(`^${rbn(e)}$`)}function ibn(e){let t=`${obn}T${rbn(e)}`,n=[];return n.push(e.local?"Z?":"Z"),e.offset&&n.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${n.join("|")})`,new RegExp(`^${t}$`)}function xWr(e,t){return!(t!=="v4"&&t||!uWr.test(e))||!(t!=="v6"&&t||!mWr.test(e))}function CWr(e,t){if(!lWr.test(e))return!1;try{let[n]=e.split(".");if(!n)return!1;let o=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),r=JSON.parse(atob(o));return typeof r=="object"&&r!==null&&((!("typ"in r)||r?.typ==="JWT")&&(!!r.alg&&(!t||r.alg===t)))}catch{return!1}}function bWr(e,t){return!(t!=="v4"&&t||!pWr.test(e))||!(t!=="v6"&&t||!_Wr.test(e))}var sZ=class e extends Ka{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==Gr.string){let r=this._getOrReturnCtx(t);return Sr(r,{code:Oo.invalid_type,expected:Gr.string,received:r.parsedType}),ps}let n=new o5,o;for(let r of this._def.checks)if(r.kind==="min")t.data.length<r.value&&(o=this._getOrReturnCtx(t,o),Sr(o,{code:Oo.too_small,minimum:r.value,type:"string",inclusive:!0,exact:!1,message:r.message}),n.dirty());else if(r.kind==="max")t.data.length>r.value&&(o=this._getOrReturnCtx(t,o),Sr(o,{code:Oo.too_big,maximum:r.value,type:"string",inclusive:!0,exact:!1,message:r.message}),n.dirty());else if(r.kind==="length"){let i=t.data.length>r.value,s=t.data.length<r.value;(i||s)&&(o=this._getOrReturnCtx(t,o),i?Sr(o,{code:Oo.too_big,maximum:r.value,type:"string",inclusive:!0,exact:!0,message:r.message}):s&&Sr(o,{code:Oo.too_small,minimum:r.value,type:"string",inclusive:!0,exact:!0,message:r.message}),n.dirty())}else if(r.kind==="email")dWr.test(t.data)||(o=this._getOrReturnCtx(t,o),Sr(o,{validation:"email",code:Oo.invalid_string,message:r.message}),n.dirty());else if(r.kind==="emoji")int||(int=new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),int.test(t.data)||(o=this._getOrReturnCtx(t,o),Sr(o,{validation:"emoji",code:Oo.invalid_string,message:r.message}),n.dirty());else if(r.kind==="uuid")aWr.test(t.data)||(o=this._getOrReturnCtx(t,o),Sr(o,{validation:"uuid",code:Oo.invalid_string,message:r.message}),n.dirty());else if(r.kind==="nanoid")cWr.test(t.data)||(o=this._getOrReturnCtx(t,o),Sr(o,{validation:"nanoid",code:Oo.invalid_string,message:r.message}),n.dirty());else if(r.kind==="cuid")rWr.test(t.data)||(o=this._getOrReturnCtx(t,o),Sr(o,{validation:"cuid",code:Oo.invalid_string,message:r.message}),n.dirty());else if(r.kind==="cuid2")iWr.test(t.data)||(o=this._getOrReturnCtx(t,o),Sr(o,{validation:"cuid2",code:Oo.invalid_string,message:r.message}),n.dirty());else if(r.kind==="ulid")sWr.test(t.data)||(o=this._getOrReturnCtx(t,o),Sr(o,{validation:"ulid",code:Oo.invalid_string,message:r.message}),n.dirty());else if(r.kind==="url")try{new URL(t.data)}catch{o=this._getOrReturnCtx(t,o),Sr(o,{validation:"url",code:Oo.invalid_string,message:r.message}),n.dirty()}else if(r.kind==="regex")r.regex.lastIndex=0,r.regex.test(t.data)||(o=this._getOrReturnCtx(t,o),Sr(o,{validation:"regex",code:Oo.invalid_string,message:r.message}),n.dirty());else if(r.kind==="trim")t.data=t.data.trim();else if(r.kind==="includes")t.data.includes(r.value,r.position)||(o=this._getOrReturnCtx(t,o),Sr(o,{code:Oo.invalid_string,validation:{includes:r.value,position:r.position},message:r.message}),n.dirty());else if(r.kind==="toLowerCase")t.data=t.data.toLowerCase();else if(r.kind==="toUpperCase")t.data=t.data.toUpperCase();else if(r.kind==="startsWith")t.data.startsWith(r.value)||(o=this._getOrReturnCtx(t,o),Sr(o,{code:Oo.invalid_string,validation:{startsWith:r.value},message:r.message}),n.dirty());else if(r.kind==="endsWith")t.data.endsWith(r.value)||(o=this._getOrReturnCtx(t,o),Sr(o,{code:Oo.invalid_string,validation:{endsWith:r.value},message:r.message}),n.dirty());else if(r.kind==="datetime")ibn(r).test(t.data)||(o=this._getOrReturnCtx(t,o),Sr(o,{code:Oo.invalid_string,validation:"datetime",message:r.message}),n.dirty());else if(r.kind==="date")fWr.test(t.data)||(o=this._getOrReturnCtx(t,o),Sr(o,{code:Oo.invalid_string,validation:"date",message:r.message}),n.dirty());else if(r.kind==="time")yWr(r).test(t.data)||(o=this._getOrReturnCtx(t,o),Sr(o,{code:Oo.invalid_string,validation:"time",message:r.message}),n.dirty());else r.kind==="duration"?hWr.test(t.data)||(o=this._getOrReturnCtx(t,o),Sr(o,{validation:"duration",code:Oo.invalid_string,message:r.message}),n.dirty()):r.kind==="ip"?xWr(t.data,r.version)||(o=this._getOrReturnCtx(t,o),Sr(o,{validation:"ip",code:Oo.invalid_string,message:r.message}),n.dirty()):r.kind==="jwt"?CWr(t.data,r.alg)||(o=this._getOrReturnCtx(t,o),Sr(o,{validation:"jwt",code:Oo.invalid_string,message:r.message}),n.dirty()):r.kind==="cidr"?bWr(t.data,r.version)||(o=this._getOrReturnCtx(t,o),Sr(o,{validation:"cidr",code:Oo.invalid_string,message:r.message}),n.dirty()):r.kind==="base64"?gWr.test(t.data)||(o=this._getOrReturnCtx(t,o),Sr(o,{validation:"base64",code:Oo.invalid_string,message:r.message}),n.dirty()):r.kind==="base64url"?AWr.test(t.data)||(o=this._getOrReturnCtx(t,o),Sr(o,{validation:"base64url",code:Oo.invalid_string,message:r.message}),n.dirty()):cl.assertNever(r);return{status:n.value,value:t.data}}_regex(t,n,o){return this.refinement((r)=>t.test(r),{validation:n,code:Oo.invalid_string,...yi.errToObj(o)})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...yi.errToObj(t)})}url(t){return this._addCheck({kind:"url",...yi.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...yi.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...yi.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...yi.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...yi.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...yi.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...yi.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...yi.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...yi.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...yi.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...yi.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...yi.errToObj(t)})}datetime(t){return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:t?.precision===void 0?null:t?.precision,offset:t?.offset??!1,local:t?.local??!1,...yi.errToObj(t?.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:t?.precision===void 0?null:t?.precision,...yi.errToObj(t?.message)})}duration(t){return this._addCheck({kind:"duration",...yi.errToObj(t)})}regex(t,n){return this._addCheck({kind:"regex",regex:t,...yi.errToObj(n)})}includes(t,n){return this._addCheck({kind:"includes",value:t,position:n?.position,...yi.errToObj(n?.message)})}startsWith(t,n){return this._addCheck({kind:"startsWith",value:t,...yi.errToObj(n)})}endsWith(t,n){return this._addCheck({kind:"endsWith",value:t,...yi.errToObj(n)})}min(t,n){return this._addCheck({kind:"min",value:t,...yi.errToObj(n)})}max(t,n){return this._addCheck({kind:"max",value:t,...yi.errToObj(n)})}length(t,n){return this._addCheck({kind:"length",value:t,...yi.errToObj(n)})}nonempty(t){return this.min(1,yi.errToObj(t))}trim(){return new e({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new e({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new e({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find((t)=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find((t)=>t.kind==="date")}get isTime(){return!!this._def.checks.find((t)=>t.kind==="time")}get isDuration(){return!!this._def.checks.find((t)=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find((t)=>t.kind==="email")}get isURL(){return!!this._def.checks.find((t)=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find((t)=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find((t)=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find((t)=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find((t)=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find((t)=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find((t)=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find((t)=>t.kind==="ip")}get isCIDR(){return!!this._def.checks.find((t)=>t.kind==="cidr")}get isBase64(){return!!this._def.checks.find((t)=>t.kind==="base64")}get isBase64url(){return!!this._def.checks.find((t)=>t.kind==="base64url")}get minLength(){let t=null;for(let n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxLength(){let t=null;for(let n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}};function IWr(e,t){let n=(e.toString().split(".")[1]||"").length,o=(t.toString().split(".")[1]||"").length,r=n>o?n:o;return Number.parseInt(e.toFixed(r).replace(".",""))%Number.parseInt(t.toFixed(r).replace(".",""))/10**r}sZ.create=(e)=>new sZ({checks:[],typeName:bs.ZodString,coerce:e?.coerce??!1,...Da(e)});var Wde=class e extends Ka{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==Gr.number){let r=this._getOrReturnCtx(t);return Sr(r,{code:Oo.invalid_type,expected:Gr.number,received:r.parsedType}),ps}let n,o=new o5;for(let r of this._def.checks)if(r.kind==="int")cl.isInteger(t.data)||(n=this._getOrReturnCtx(t,n),Sr(n,{code:Oo.invalid_type,expected:"integer",received:"float",message:r.message}),o.dirty());else if(r.kind==="min")(r.inclusive?t.data<r.value:t.data<=r.value)&&(n=this._getOrReturnCtx(t,n),Sr(n,{code:Oo.too_small,minimum:r.value,type:"number",inclusive:r.inclusive,exact:!1,message:r.message}),o.dirty());else if(r.kind==="max")(r.inclusive?t.data>r.value:t.data>=r.value)&&(n=this._getOrReturnCtx(t,n),Sr(n,{code:Oo.too_big,maximum:r.value,type:"number",inclusive:r.inclusive,exact:!1,message:r.message}),o.dirty());else r.kind==="multipleOf"?IWr(t.data,r.value)!==0&&(n=this._getOrReturnCtx(t,n),Sr(n,{code:Oo.not_multiple_of,multipleOf:r.value,message:r.message}),o.dirty()):r.kind==="finite"?Number.isFinite(t.data)||(n=this._getOrReturnCtx(t,n),Sr(n,{code:Oo.not_finite,message:r.message}),o.dirty()):cl.assertNever(r);return{status:o.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,yi.toString(n))}gt(t,n){return this.setLimit("min",t,!1,yi.toString(n))}lte(t,n){return this.setLimit("max",t,!0,yi.toString(n))}lt(t,n){return this.setLimit("max",t,!1,yi.toString(n))}setLimit(t,n,o,r){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:o,message:yi.toString(r)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:yi.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:yi.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:yi.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:yi.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:yi.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:yi.toString(n)})}finite(t){return this._addCheck({kind:"finite",message:yi.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:yi.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:yi.toString(t)})}get minValue(){let t=null;for(let n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(let n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}get isInt(){return!!this._def.checks.find((t)=>t.kind==="int"||t.kind==="multipleOf"&&cl.isInteger(t.value))}get isFinite(){let t=null,n=null;for(let o of this._def.checks){if(o.kind==="finite"||o.kind==="int"||o.kind==="multipleOf")return!0;o.kind==="min"?(n===null||o.value>n)&&(n=o.value):o.kind==="max"&&(t===null||o.value<t)&&(t=o.value)}return Number.isFinite(n)&&Number.isFinite(t)}};Wde.create=(e)=>new Wde({checks:[],typeName:bs.ZodNumber,coerce:e?.coerce||!1,...Da(e)});var Xde=class e extends Ka{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}if(this._getType(t)!==Gr.bigint)return this._getInvalidInput(t);let n,o=new o5;for(let r of this._def.checks)if(r.kind==="min")(r.inclusive?t.data<r.value:t.data<=r.value)&&(n=this._getOrReturnCtx(t,n),Sr(n,{code:Oo.too_small,type:"bigint",minimum:r.value,inclusive:r.inclusive,message:r.message}),o.dirty());else if(r.kind==="max")(r.inclusive?t.data>r.value:t.data>=r.value)&&(n=this._getOrReturnCtx(t,n),Sr(n,{code:Oo.too_big,type:"bigint",maximum:r.value,inclusive:r.inclusive,message:r.message}),o.dirty());else r.kind==="multipleOf"?t.data%r.value!==BigInt(0)&&(n=this._getOrReturnCtx(t,n),Sr(n,{code:Oo.not_multiple_of,multipleOf:r.value,message:r.message}),o.dirty()):cl.assertNever(r);return{status:o.value,value:t.data}}_getInvalidInput(t){let n=this._getOrReturnCtx(t);return Sr(n,{code:Oo.invalid_type,expected:Gr.bigint,received:n.parsedType}),ps}gte(t,n){return this.setLimit("min",t,!0,yi.toString(n))}gt(t,n){return this.setLimit("min",t,!1,yi.toString(n))}lte(t,n){return this.setLimit("max",t,!0,yi.toString(n))}lt(t,n){return this.setLimit("max",t,!1,yi.toString(n))}setLimit(t,n,o,r){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:o,message:yi.toString(r)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:yi.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:yi.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:yi.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:yi.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:yi.toString(n)})}get minValue(){let t=null;for(let n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(let n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}};Xde.create=(e)=>new Xde({checks:[],typeName:bs.ZodBigInt,coerce:e?.coerce??!1,...Da(e)});var jde=class extends Ka{_parse(e){if(this._def.coerce&&(e.data=Boolean(e.data)),this._getType(e)!==Gr.boolean){let t=this._getOrReturnCtx(e);return Sr(t,{code:Oo.invalid_type,expected:Gr.boolean,received:t.parsedType}),ps}return My(e.data)}};jde.create=(e)=>new jde({typeName:bs.ZodBoolean,coerce:e?.coerce||!1,...Da(e)});var Kde=class e extends Ka{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==Gr.date){let r=this._getOrReturnCtx(t);return Sr(r,{code:Oo.invalid_type,expected:Gr.date,received:r.parsedType}),ps}if(Number.isNaN(t.data.getTime()))return Sr(this._getOrReturnCtx(t),{code:Oo.invalid_date}),ps;let n=new o5,o;for(let r of this._def.checks)r.kind==="min"?t.data.getTime()<r.value&&(o=this._getOrReturnCtx(t,o),Sr(o,{code:Oo.too_small,message:r.message,inclusive:!0,exact:!1,minimum:r.value,type:"date"}),n.dirty()):r.kind==="max"?t.data.getTime()>r.value&&(o=this._getOrReturnCtx(t,o),Sr(o,{code:Oo.too_big,message:r.message,inclusive:!0,exact:!1,maximum:r.value,type:"date"}),n.dirty()):cl.assertNever(r);return{status:n.value,value:new Date(t.data.getTime())}}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}min(t,n){return this._addCheck({kind:"min",value:t.getTime(),message:yi.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:yi.toString(n)})}get minDate(){let t=null;for(let n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(let n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t!=null?new Date(t):null}};Kde.create=(e)=>new Kde({checks:[],coerce:e?.coerce||!1,typeName:bs.ZodDate,...Da(e)});var v8e=class extends Ka{_parse(e){if(this._getType(e)!==Gr.symbol){let t=this._getOrReturnCtx(e);return Sr(t,{code:Oo.invalid_type,expected:Gr.symbol,received:t.parsedType}),ps}return My(e.data)}};v8e.create=(e)=>new v8e({typeName:bs.ZodSymbol,...Da(e)});var $de=class extends Ka{_parse(e){if(this._getType(e)!==Gr.undefined){let t=this._getOrReturnCtx(e);return Sr(t,{code:Oo.invalid_type,expected:Gr.undefined,received:t.parsedType}),ps}return My(e.data)}};$de.create=(e)=>new $de({typeName:bs.ZodUndefined,...Da(e)});var qde=class extends Ka{_parse(e){if(this._getType(e)!==Gr.null){let t=this._getOrReturnCtx(e);return Sr(t,{code:Oo.invalid_type,expected:Gr.null,received:t.parsedType}),ps}return My(e.data)}};qde.create=(e)=>new qde({typeName:bs.ZodNull,...Da(e)});var aZ=class extends Ka{constructor(){super(...arguments),this._any=!0}_parse(e){return My(e.data)}};aZ.create=(e)=>new aZ({typeName:bs.ZodAny,...Da(e)});var bY=class extends Ka{constructor(){super(...arguments),this._unknown=!0}_parse(e){return My(e.data)}};bY.create=(e)=>new bY({typeName:bs.ZodUnknown,...Da(e)});var _B=class extends Ka{_parse(e){let t=this._getOrReturnCtx(e);return Sr(t,{code:Oo.invalid_type,expected:Gr.never,received:t.parsedType}),ps}};_B.create=(e)=>new _B({typeName:bs.ZodNever,...Da(e)});var S8e=class extends Ka{_parse(e){if(this._getType(e)!==Gr.undefined){let t=this._getOrReturnCtx(e);return Sr(t,{code:Oo.invalid_type,expected:Gr.void,received:t.parsedType}),ps}return My(e.data)}};S8e.create=(e)=>new S8e({typeName:bs.ZodVoid,...Da(e)});var TY=class e extends Ka{_parse(t){let{ctx:n,status:o}=this._processInputParams(t),r=this._def;if(n.parsedType!==Gr.array)return Sr(n,{code:Oo.invalid_type,expected:Gr.array,received:n.parsedType}),ps;if(r.exactLength!==null){let s=n.data.length>r.exactLength.value,a=n.data.length<r.exactLength.value;(s||a)&&(Sr(n,{code:s?Oo.too_big:Oo.too_small,minimum:a?r.exactLength.value:void 0,maximum:s?r.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:r.exactLength.message}),o.dirty())}if(r.minLength!==null&&n.data.length<r.minLength.value&&(Sr(n,{code:Oo.too_small,minimum:r.minLength.value,type:"array",inclusive:!0,exact:!1,message:r.minLength.message}),o.dirty()),r.maxLength!==null&&n.data.length>r.maxLength.value&&(Sr(n,{code:Oo.too_big,maximum:r.maxLength.value,type:"array",inclusive:!0,exact:!1,message:r.maxLength.message}),o.dirty()),n.common.async)return Promise.all([...n.data].map((s,a)=>r.type._parseAsync(new qS(n,s,n.path,a)))).then((s)=>o5.mergeArray(o,s));let i=[...n.data].map((s,a)=>r.type._parseSync(new qS(n,s,n.path,a)));return o5.mergeArray(o,i)}get element(){return this._def.type}min(t,n){return new e({...this._def,minLength:{value:t,message:yi.toString(n)}})}max(t,n){return new e({...this._def,maxLength:{value:t,message:yi.toString(n)}})}length(t,n){return new e({...this._def,exactLength:{value:t,message:yi.toString(n)}})}nonempty(t){return this.min(1,t)}};function MJ(e){if(e instanceof Tb){let t={};for(let n in e.shape){let o=e.shape[n];t[n]=GS.create(MJ(o))}return new Tb({...e._def,shape:()=>t})}return e instanceof TY?new TY({...e._def,type:MJ(e.element)}):e instanceof GS?GS.create(MJ(e.unwrap())):e instanceof Tk?Tk.create(MJ(e.unwrap())):e instanceof Bk?Bk.create(e.items.map((t)=>MJ(t))):e}TY.create=(e,t)=>new TY({type:e,minLength:null,maxLength:null,exactLength:null,typeName:bs.ZodArray,...Da(t)});var Tb=class e extends Ka{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let t=this._def.shape(),n=cl.objectKeys(t);return this._cached={shape:t,keys:n},this._cached}_parse(t){if(this._getType(t)!==Gr.object){let c=this._getOrReturnCtx(t);return Sr(c,{code:Oo.invalid_type,expected:Gr.object,received:c.parsedType}),ps}let{status:n,ctx:o}=this._processInputParams(t),{shape:r,keys:i}=this._getCached(),s=[];if(!(this._def.catchall instanceof _B&&this._def.unknownKeys==="strip"))for(let c in o.data)i.includes(c)||s.push(c);let a=[];for(let c of i){let l=r[c],h=o.data[c];a.push({key:{status:"valid",value:c},value:l._parse(new qS(o,h,o.path,c)),alwaysSet:c in o.data})}if(this._def.catchall instanceof _B){let c=this._def.unknownKeys;if(c==="passthrough")for(let l of s)a.push({key:{status:"valid",value:l},value:{status:"valid",value:o.data[l]}});else if(c==="strict")s.length>0&&(Sr(o,{code:Oo.unrecognized_keys,keys:s}),n.dirty());else if(c!=="strip")throw Error("Internal ZodObject error: invalid unknownKeys value.")}else{let c=this._def.catchall;for(let l of s){let h=o.data[l];a.push({key:{status:"valid",value:l},value:c._parse(new qS(o,h,o.path,l)),alwaysSet:l in o.data})}}return o.common.async?Promise.resolve().then(async()=>{let c=[];for(let l of a){let h=await l.key,d=await l.value;c.push({key:h,value:d,alwaysSet:l.alwaysSet})}return c}).then((c)=>o5.mergeObjectSync(n,c)):o5.mergeObjectSync(n,a)}get shape(){return this._def.shape()}strict(t){return yi.errToObj,new e({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(n,o)=>{let r=this._def.errorMap?.(n,o).message??o.defaultError;return n.code==="unrecognized_keys"?{message:yi.errToObj(t).message??r}:{message:r}}}:{}})}strip(){return new e({...this._def,unknownKeys:"strip"})}passthrough(){return new e({...this._def,unknownKeys:"passthrough"})}extend(t){return new e({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new e({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:bs.ZodObject})}setKey(t,n){return this.augment({[t]:n})}catchall(t){return new e({...this._def,catchall:t})}pick(t){let n={};for(let o of cl.objectKeys(t))t[o]&&this.shape[o]&&(n[o]=this.shape[o]);return new e({...this._def,shape:()=>n})}omit(t){let n={};for(let o of cl.objectKeys(this.shape))t[o]||(n[o]=this.shape[o]);return new e({...this._def,shape:()=>n})}deepPartial(){return MJ(this)}partial(t){let n={};for(let o of cl.objectKeys(this.shape)){let r=this.shape[o];t&&!t[o]?n[o]=r:n[o]=r.optional()}return new e({...this._def,shape:()=>n})}required(t){let n={};for(let o of cl.objectKeys(this.shape))if(t&&!t[o])n[o]=this.shape[o];else{let r=this.shape[o];for(;r instanceof GS;)r=r._def.innerType;n[o]=r}return new e({...this._def,shape:()=>n})}keyof(){return lbn(cl.objectKeys(this.shape))}};Tb.create=(e,t)=>new Tb({shape:()=>e,unknownKeys:"strip",catchall:_B.create(),typeName:bs.ZodObject,...Da(t)}),Tb.strictCreate=(e,t)=>new Tb({shape:()=>e,unknownKeys:"strict",catchall:_B.create(),typeName:bs.ZodObject,...Da(t)}),Tb.lazycreate=(e,t)=>new Tb({shape:e,unknownKeys:"strip",catchall:_B.create(),typeName:bs.ZodObject,...Da(t)});var Jde=class extends Ka{_parse(e){let{ctx:t}=this._processInputParams(e),n=this._def.options;if(t.common.async)return Promise.all(n.map(async(o)=>{let r={...t,common:{...t.common,issues:[]},parent:null};return{result:await o._parseAsync({data:t.data,path:t.path,parent:r}),ctx:r}})).then(function(o){for(let i of o)if(i.result.status==="valid")return i.result;for(let i of o)if(i.result.status==="dirty")return t.common.issues.push(...i.ctx.common.issues),i.result;let r=o.map((i)=>new D9(i.ctx.common.issues));return Sr(t,{code:Oo.invalid_union,unionErrors:r}),ps});{let o,r=[];for(let s of n){let a={...t,common:{...t.common,issues:[]},parent:null},c=s._parseSync({data:t.data,path:t.path,parent:a});if(c.status==="valid")return c;c.status!=="dirty"||o||(o={result:c,ctx:a}),a.common.issues.length&&r.push(a.common.issues)}if(o)return t.common.issues.push(...o.ctx.common.issues),o.result;let i=r.map((s)=>new D9(s));return Sr(t,{code:Oo.invalid_union,unionErrors:i}),ps}}get options(){return this._def.options}};Jde.create=(e,t)=>new Jde({options:e,typeName:bs.ZodUnion,...Da(t)});var ZQ=(e)=>e instanceof eue?ZQ(e.schema):e instanceof M9?ZQ(e.innerType()):e instanceof tue?[e.value]:e instanceof Hue?e.options:e instanceof nue?cl.objectValues(e.enum):e instanceof oue?ZQ(e._def.innerType):e instanceof $de?[void 0]:e instanceof qde?[null]:e instanceof GS?[void 0,...ZQ(e.unwrap())]:e instanceof Tk?[null,...ZQ(e.unwrap())]:e instanceof gst||e instanceof iue?ZQ(e.unwrap()):e instanceof rue?ZQ(e._def.innerType):[],sbn=class e extends Ka{_parse(t){let{ctx:n}=this._processInputParams(t);if(n.parsedType!==Gr.object)return Sr(n,{code:Oo.invalid_type,expected:Gr.object,received:n.parsedType}),ps;let o=this.discriminator,r=n.data[o],i=this.optionsMap.get(r);return i?n.common.async?i._parseAsync({data:n.data,path:n.path,parent:n}):i._parseSync({data:n.data,path:n.path,parent:n}):(Sr(n,{code:Oo.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[o]}),ps)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,n,o){let r=new Map;for(let i of n){let s=ZQ(i.shape[t]);if(!s.length)throw Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(let a of s){if(r.has(a))throw Error(`Discriminator property ${String(t)} has duplicate value ${String(a)}`);r.set(a,i)}}return new e({typeName:bs.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:r,...Da(o)})}};function _rt(e,t){let n=tB(e),o=tB(t);if(e===t)return{valid:!0,data:e};if(n===Gr.object&&o===Gr.object){let r=cl.objectKeys(t),i=cl.objectKeys(e).filter((a)=>r.indexOf(a)!==-1),s={...e,...t};for(let a of i){let c=_rt(e[a],t[a]);if(!c.valid)return{valid:!1};s[a]=c.data}return{valid:!0,data:s}}if(n===Gr.array&&o===Gr.array){if(e.length!==t.length)return{valid:!1};let r=[];for(let i=0;i<e.length;i++){let s=_rt(e[i],t[i]);if(!s.valid)return{valid:!1};r.push(s.data)}return{valid:!0,data:r}}return n===Gr.date&&o===Gr.date&&+e===+t?{valid:!0,data:e}:{valid:!1}}var Zde=class extends Ka{_parse(e){let{status:t,ctx:n}=this._processInputParams(e),o=(r,i)=>{if(prt(r)||prt(i))return ps;let s=_rt(r.value,i.value);return s.valid?((mrt(r)||mrt(i))&&t.dirty(),{status:t.value,value:s.data}):(Sr(n,{code:Oo.invalid_intersection_types}),ps)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([r,i])=>o(r,i)):o(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};Zde.create=(e,t,n)=>new Zde({left:e,right:t,typeName:bs.ZodIntersection,...Da(n)});var Bk=class e extends Ka{_parse(t){let{status:n,ctx:o}=this._processInputParams(t);if(o.parsedType!==Gr.array)return Sr(o,{code:Oo.invalid_type,expected:Gr.array,received:o.parsedType}),ps;if(o.data.length<this._def.items.length)return Sr(o,{code:Oo.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),ps;!this._def.rest&&o.data.length>this._def.items.length&&(Sr(o,{code:Oo.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());let r=[...o.data].map((i,s)=>{let a=this._def.items[s]||this._def.rest;return a?a._parse(new qS(o,i,o.path,s)):null}).filter((i)=>!!i);return o.common.async?Promise.all(r).then((i)=>o5.mergeArray(n,i)):o5.mergeArray(n,r)}get items(){return this._def.items}rest(t){return new e({...this._def,rest:t})}};Bk.create=(e,t)=>{if(!Array.isArray(e))throw Error("You must pass an array of schemas to z.tuple([ ... ])");return new Bk({items:e,typeName:bs.ZodTuple,rest:null,...Da(t)})};var abn=class e extends Ka{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:n,ctx:o}=this._processInputParams(t);if(o.parsedType!==Gr.object)return Sr(o,{code:Oo.invalid_type,expected:Gr.object,received:o.parsedType}),ps;let r=[],i=this._def.keyType,s=this._def.valueType;for(let a in o.data)r.push({key:i._parse(new qS(o,a,o.path,a)),value:s._parse(new qS(o,o.data[a],o.path,a)),alwaysSet:a in o.data});return o.common.async?o5.mergeObjectAsync(n,r):o5.mergeObjectSync(n,r)}get element(){return this._def.valueType}static create(t,n,o){return new e(n instanceof Ka?{keyType:t,valueType:n,typeName:bs.ZodRecord,...Da(o)}:{keyType:sZ.create(),valueType:t,typeName:bs.ZodRecord,...Da(n)})}},P8e=class extends Ka{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==Gr.map)return Sr(n,{code:Oo.invalid_type,expected:Gr.map,received:n.parsedType}),ps;let o=this._def.keyType,r=this._def.valueType,i=[...n.data.entries()].map(([s,a],c)=>({key:o._parse(new qS(n,s,n.path,[c,"key"])),value:r._parse(new qS(n,a,n.path,[c,"value"]))}));if(n.common.async){let s=new Map;return Promise.resolve().then(async()=>{for(let a of i){let c=await a.key,l=await a.value;if(c.status==="aborted"||l.status==="aborted")return ps;c.status!=="dirty"&&l.status!=="dirty"||t.dirty(),s.set(c.value,l.value)}return{status:t.value,value:s}})}{let s=new Map;for(let a of i){let{key:c,value:l}=a;if(c.status==="aborted"||l.status==="aborted")return ps;c.status!=="dirty"&&l.status!=="dirty"||t.dirty(),s.set(c.value,l.value)}return{status:t.value,value:s}}}};P8e.create=(e,t,n)=>new P8e({valueType:t,keyType:e,typeName:bs.ZodMap,...Da(n)});var E8e=class e extends Ka{_parse(t){let{status:n,ctx:o}=this._processInputParams(t);if(o.parsedType!==Gr.set)return Sr(o,{code:Oo.invalid_type,expected:Gr.set,received:o.parsedType}),ps;let r=this._def;r.minSize!==null&&o.data.size<r.minSize.value&&(Sr(o,{code:Oo.too_small,minimum:r.minSize.value,type:"set",inclusive:!0,exact:!1,message:r.minSize.message}),n.dirty()),r.maxSize!==null&&o.data.size>r.maxSize.value&&(Sr(o,{code:Oo.too_big,maximum:r.maxSize.value,type:"set",inclusive:!0,exact:!1,message:r.maxSize.message}),n.dirty());let i=this._def.valueType;function s(c){let l=new Set;for(let h of c){if(h.status==="aborted")return ps;h.status==="dirty"&&n.dirty(),l.add(h.value)}return{status:n.value,value:l}}let a=[...o.data.values()].map((c,l)=>i._parse(new qS(o,c,o.path,l)));return o.common.async?Promise.all(a).then((c)=>s(c)):s(a)}min(t,n){return new e({...this._def,minSize:{value:t,message:yi.toString(n)}})}max(t,n){return new e({...this._def,maxSize:{value:t,message:yi.toString(n)}})}size(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}};E8e.create=(e,t)=>new E8e({valueType:e,minSize:null,maxSize:null,typeName:bs.ZodSet,...Da(t)});var cbn=class e extends Ka{constructor(){super(...arguments),this.validate=this.implement}_parse(t){let{ctx:n}=this._processInputParams(t);if(n.parsedType!==Gr.function)return Sr(n,{code:Oo.invalid_type,expected:Gr.function,received:n.parsedType}),ps;function o(a,c){return b8e({data:a,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,C8e(),iZ].filter((l)=>!!l),issueData:{code:Oo.invalid_arguments,argumentsError:c}})}function r(a,c){return b8e({data:a,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,C8e(),iZ].filter((l)=>!!l),issueData:{code:Oo.invalid_return_type,returnTypeError:c}})}let i={errorMap:n.common.contextualErrorMap},s=n.data;if(this._def.returns instanceof cZ){let a=this;return My(async function(...c){let l=new D9([]),h=await a._def.args.parseAsync(c,i).catch((u)=>{throw l.addIssue(o(c,u)),l}),d=await Reflect.apply(s,this,h);return await a._def.returns._def.type.parseAsync(d,i).catch((u)=>{throw l.addIssue(r(d,u)),l})})}{let a=this;return My(function(...c){let l=a._def.args.safeParse(c,i);if(!l.success)throw new D9([o(c,l.error)]);let h=Reflect.apply(s,this,l.data),d=a._def.returns.safeParse(h,i);if(!d.success)throw new D9([r(h,d.error)]);return d.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new e({...this._def,args:Bk.create(t).rest(bY.create())})}returns(t){return new e({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,n,o){return new e({args:t||Bk.create([]).rest(bY.create()),returns:n||bY.create(),typeName:bs.ZodFunction,...Da(o)})}},eue=class extends Ka{get schema(){return this._def.getter()}_parse(e){let{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}};eue.create=(e,t)=>new eue({getter:e,typeName:bs.ZodLazy,...Da(t)});var tue=class extends Ka{_parse(e){if(e.data!==this._def.value){let t=this._getOrReturnCtx(e);return Sr(t,{received:t.data,code:Oo.invalid_literal,expected:this._def.value}),ps}return{status:"valid",value:e.data}}get value(){return this._def.value}};function lbn(e,t){return new Hue({values:e,typeName:bs.ZodEnum,...Da(t)})}tue.create=(e,t)=>new tue({value:e,typeName:bs.ZodLiteral,...Da(t)});var Hue=class e extends Ka{_parse(t){if(typeof t.data!="string"){let n=this._getOrReturnCtx(t),o=this._def.values;return Sr(n,{expected:cl.joinValues(o),received:n.parsedType,code:Oo.invalid_type}),ps}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(t.data)){let n=this._getOrReturnCtx(t),o=this._def.values;return Sr(n,{received:n.data,code:Oo.invalid_enum_value,options:o}),ps}return My(t.data)}get options(){return this._def.values}get enum(){let t={};for(let n of this._def.values)t[n]=n;return t}get Values(){let t={};for(let n of this._def.values)t[n]=n;return t}get Enum(){let t={};for(let n of this._def.values)t[n]=n;return t}extract(t,n=this._def){return e.create(t,{...this._def,...n})}exclude(t,n=this._def){return e.create(this.options.filter((o)=>!t.includes(o)),{...this._def,...n})}};Hue.create=lbn;var nue=class extends Ka{_parse(e){let t=cl.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==Gr.string&&n.parsedType!==Gr.number){let o=cl.objectValues(t);return Sr(n,{expected:cl.joinValues(o),received:n.parsedType,code:Oo.invalid_type}),ps}if(this._cache||(this._cache=new Set(cl.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){let o=cl.objectValues(t);return Sr(n,{received:n.data,code:Oo.invalid_enum_value,options:o}),ps}return My(e.data)}get enum(){return this._def.values}};nue.create=(e,t)=>new nue({values:e,typeName:bs.ZodNativeEnum,...Da(t)});var cZ=class extends Ka{unwrap(){return this._def.type}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==Gr.promise&&t.common.async===!1)return Sr(t,{code:Oo.invalid_type,expected:Gr.promise,received:t.parsedType}),ps;let n=t.parsedType===Gr.promise?t.data:Promise.resolve(t.data);return My(n.then((o)=>this._def.type.parseAsync(o,{path:t.path,errorMap:t.common.contextualErrorMap})))}};cZ.create=(e,t)=>new cZ({type:e,typeName:bs.ZodPromise,...Da(t)});var M9=class extends Ka{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===bs.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:t,ctx:n}=this._processInputParams(e),o=this._def.effect||null,r={addIssue:(i)=>{Sr(n,i),i.fatal?t.abort():t.dirty()},get path(){return n.path}};if(r.addIssue=r.addIssue.bind(r),o.type==="preprocess"){let i=o.transform(n.data,r);if(n.common.async)return Promise.resolve(i).then(async(s)=>{if(t.value==="aborted")return ps;let a=await this._def.schema._parseAsync({data:s,path:n.path,parent:n});return a.status==="aborted"?ps:a.status==="dirty"||t.value==="dirty"?I8e(a.value):a});{if(t.value==="aborted")return ps;let s=this._def.schema._parseSync({data:i,path:n.path,parent:n});return s.status==="aborted"?ps:s.status==="dirty"||t.value==="dirty"?I8e(s.value):s}}if(o.type==="refinement"){let i=(s)=>{let a=o.refinement(s,r);if(n.common.async)return Promise.resolve(a);if(a instanceof Promise)throw Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return s};if(n.common.async===!1){let s=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?ps:(s.status==="dirty"&&t.dirty(),i(s.value),{status:t.value,value:s.value})}return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then((s)=>s.status==="aborted"?ps:(s.status==="dirty"&&t.dirty(),i(s.value).then(()=>({status:t.value,value:s.value}))))}if(o.type==="transform"){if(n.common.async===!1){let i=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!BY(i))return ps;let s=o.transform(i.value,r);if(s instanceof Promise)throw Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:s}}return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then((i)=>BY(i)?Promise.resolve(o.transform(i.value,r)).then((s)=>({status:t.value,value:s})):ps)}cl.assertNever(o)}};M9.create=(e,t,n)=>new M9({schema:e,typeName:bs.ZodEffects,effect:t,...Da(n)}),M9.createWithPreprocess=(e,t,n)=>new M9({schema:t,effect:{type:"preprocess",transform:e},typeName:bs.ZodEffects,...Da(n)});var GS=class extends Ka{_parse(e){return this._getType(e)===Gr.undefined?My(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};GS.create=(e,t)=>new GS({innerType:e,typeName:bs.ZodOptional,...Da(t)});var Tk=class extends Ka{_parse(e){return this._getType(e)===Gr.null?My(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Tk.create=(e,t)=>new Tk({innerType:e,typeName:bs.ZodNullable,...Da(t)});var oue=class extends Ka{_parse(e){let{ctx:t}=this._processInputParams(e),n=t.data;return t.parsedType===Gr.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}};oue.create=(e,t)=>new oue({innerType:e,typeName:bs.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...Da(t)});var rue=class extends Ka{_parse(e){let{ctx:t}=this._processInputParams(e),n={...t,common:{...t.common,issues:[]}},o=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return Ude(o)?o.then((r)=>({status:"valid",value:r.status==="valid"?r.value:this._def.catchValue({get error(){return new D9(n.common.issues)},input:n.data})})):{status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new D9(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};rue.create=(e,t)=>new rue({innerType:e,typeName:bs.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...Da(t)});var M8e=class extends Ka{_parse(e){if(this._getType(e)!==Gr.nan){let t=this._getOrReturnCtx(e);return Sr(t,{code:Oo.invalid_type,expected:Gr.nan,received:t.parsedType}),ps}return{status:"valid",value:e.data}}};M8e.create=(e)=>new M8e({typeName:bs.ZodNaN,...Da(e)});var vWr=Symbol("zod_brand"),gst=class extends Ka{_parse(e){let{ctx:t}=this._processInputParams(e),n=t.data;return this._def.type._parse({data:n,path:t.path,parent:t})}unwrap(){return this._def.type}},Ast=class e extends Ka{_parse(t){let{status:n,ctx:o}=this._processInputParams(t);if(o.common.async)return(async()=>{let r=await this._def.in._parseAsync({data:o.data,path:o.path,parent:o});return r.status==="aborted"?ps:r.status==="dirty"?(n.dirty(),I8e(r.value)):this._def.out._parseAsync({data:r.value,path:o.path,parent:o})})();{let r=this._def.in._parseSync({data:o.data,path:o.path,parent:o});return r.status==="aborted"?ps:r.status==="dirty"?(n.dirty(),{status:"dirty",value:r.value}):this._def.out._parseSync({data:r.value,path:o.path,parent:o})}}static create(t,n){return new e({in:t,out:n,typeName:bs.ZodPipeline})}},iue=class extends Ka{_parse(e){let t=this._def.innerType._parse(e),n=(o)=>(BY(o)&&(o.value=Object.freeze(o.value)),o);return Ude(t)?t.then((o)=>n(o)):n(t)}unwrap(){return this._def.innerType}};function Tfn(e,t){let n=typeof e=="function"?e(t):typeof e=="string"?{message:e}:e;return typeof n=="string"?{message:n}:n}function hbn(e,t={},n){return e?aZ.create().superRefine((o,r)=>{let i=e(o);if(i instanceof Promise)return i.then((s)=>{if(!s){let a=Tfn(t,o),c=a.fatal??n??!0;r.addIssue({code:"custom",...a,fatal:c})}});if(!i){let s=Tfn(t,o),a=s.fatal??n??!0;r.addIssue({code:"custom",...s,fatal:a})}}):aZ.create()}iue.create=(e,t)=>new iue({innerType:e,typeName:bs.ZodReadonly,...Da(t)});var bs,kc,SWr={object:Tb.lazycreate};(kc=bs||(bs={})).ZodString="ZodString",kc.ZodNumber="ZodNumber",kc.ZodNaN="ZodNaN",kc.ZodBigInt="ZodBigInt",kc.ZodBoolean="ZodBoolean",kc.ZodDate="ZodDate",kc.ZodSymbol="ZodSymbol",kc.ZodUndefined="ZodUndefined",kc.ZodNull="ZodNull",kc.ZodAny="ZodAny",kc.ZodUnknown="ZodUnknown",kc.ZodNever="ZodNever",kc.ZodVoid="ZodVoid",kc.ZodArray="ZodArray",kc.ZodObject="ZodObject",kc.ZodUnion="ZodUnion",kc.ZodDiscriminatedUnion="ZodDiscriminatedUnion",kc.ZodIntersection="ZodIntersection",kc.ZodTuple="ZodTuple",kc.ZodRecord="ZodRecord",kc.ZodMap="ZodMap",kc.ZodSet="ZodSet",kc.ZodFunction="ZodFunction",kc.ZodLazy="ZodLazy",kc.ZodLiteral="ZodLiteral",kc.ZodEnum="ZodEnum",kc.ZodEffects="ZodEffects",kc.ZodNativeEnum="ZodNativeEnum",kc.ZodOptional="ZodOptional",kc.ZodNullable="ZodNullable",kc.ZodDefault="ZodDefault",kc.ZodCatch="ZodCatch",kc.ZodPromise="ZodPromise",kc.ZodBranded="ZodBranded",kc.ZodPipeline="ZodPipeline",kc.ZodReadonly="ZodReadonly";var PWr=(e,t={message:`Input not instance of ${e.name}`})=>hbn((n)=>n instanceof e,t),dbn=sZ.create,ubn=Wde.create,EWr=M8e.create,MWr=Xde.create,pbn=jde.create,wWr=Kde.create,BWr=v8e.create,TWr=$de.create,DWr=qde.create,NWr=aZ.create,RWr=bY.create,QWr=_B.create,kWr=S8e.create,LWr=TY.create,{create:HWr,strictCreate:FWr}=Tb,zWr=Jde.create,OWr=sbn.create,VWr=Zde.create,YWr=Bk.create,GWr=abn.create,UWr=P8e.create,WWr=E8e.create,XWr=cbn.create,jWr=eue.create,KWr=tue.create,$Wr=Hue.create,qWr=nue.create,JWr=cZ.create,Dfn=M9.create,ZWr=GS.create,eXr=Tk.create,tXr=M9.createWithPreprocess,nXr=Ast.create,oXr=()=>dbn().optional(),rXr=()=>ubn().optional(),iXr=()=>pbn().optional(),sXr={string:(e)=>sZ.create({...e,coerce:!0}),number:(e)=>Wde.create({...e,coerce:!0}),boolean:(e)=>jde.create({...e,coerce:!0}),bigint:(e)=>Xde.create({...e,coerce:!0}),date:(e)=>Kde.create({...e,coerce:!0})},aXr=ps,B7e=F.string().or(F.number()).transform((e)=>Nb(e,"Ω").value),fst=F.string().or(F.number()).transform((e)=>Nb(e,"F").value).transform((e)=>Number.parseFloat(e.toPrecision(12))),mbn=F.string().or(F.number()).transform((e)=>Nb(e,"H").value),xB=F.string().or(F.number()).transform((e)=>Nb(e,"V").value),Zo=F.string().or(F.number()).transform((e)=>Nb(e).value),jY=F.string().or(F.number()).transform((e)=>Nb(e,"Hz").value),Ln=Zo,lZ=F.string().or(F.number()).transform((e)=>Nb(e,"A").value),MZ=F.string().or(F.number()).transform((e)=>Nb(e).value),cXr=MZ,gg=MZ,_bn=F.string().datetime(),Im=F.string().or(F.number()).transform((e)=>typeof e=="number"?e:e.endsWith("deg")?Number.parseFloat(e.split("deg")[0]):e.endsWith("rad")?180*Number.parseFloat(e.split("rad")[0])/Math.PI:Number.parseFloat(e)),gbn=F.number().or(F.string().endsWith("mAh")).transform((e)=>{if(typeof e=="string"){let t=e.replace("mAh",""),n=Number.parseFloat(t);if(Number.isNaN(n))throw Error("Invalid capacity");return n}return e}).describe("Battery capacity in mAh"),Rr=F.object({x:Ln,y:Ln}),lXr=Rr,lB=F.object({x:Ln,y:Ln,z:Ln}),hXr=lB,yst=F.object({width:F.number(),height:F.number()}),ro=(e)=>F.string().optional().default(()=>`${e}_${((t)=>Array.from({length:t},()=>"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"[Math.floor(62*Math.random())]).join(""))(10)}`),vB=F.enum(["top_left","top_center","top_right","center_left","center","center_right","bottom_left","bottom_center","bottom_right"]),dXr=F.enum(["top_silkscreen","bottom_silkscreen","top_copper","bottom_copper","top_soldermask","bottom_soldermask","top_fabrication_note","bottom_fabrication_note","top_user_note","bottom_user_note","top_courtyard","bottom_courtyard","inner1_copper","inner2_copper","inner3_copper","inner4_copper","inner5_copper","inner6_copper","inner7_copper","inner8_copper","edge_cuts","drill"]),xst=F.object({project_relative_path:F.string(),url:F.string(),mimetype:F.string()}),T7e=Rr.extend({rotation:Im.optional()}),Cst=F.object({size:Rr.optional(),thickness:Ln.optional()}),Abn=F.object({font:Cst.optional()}),tde=F.object({value:F.string(),at:T7e.optional(),layer:F.string().optional(),uuid:F.string().optional(),hide:F.boolean().optional(),effects:Abn.optional()}),fbn=F.object({Reference:tde.optional(),Value:tde.optional(),Datasheet:tde.optional(),Description:tde.optional()}),ybn=F.object({through_hole:F.boolean().optional(),smd:F.boolean().optional(),exclude_from_pos_files:F.boolean().optional(),exclude_from_bom:F.boolean().optional()}),xbn=F.object({name:F.string(),type:F.string(),shape:F.string().optional(),at:T7e.optional(),size:Rr.optional(),drill:Ln.optional(),layers:F.array(F.string()).optional(),removeUnusedLayers:F.boolean().optional(),uuid:F.string().optional()}),Cbn=F.object({path:F.string(),offset:lB.optional(),scale:lB.optional(),rotate:lB.optional()}),bbn=F.object({footprintName:F.string().optional(),version:F.union([F.number(),F.string()]).optional(),generator:F.string().optional(),generatorVersion:F.union([F.number(),F.string()]).optional(),layer:F.string().optional(),properties:fbn.optional(),attributes:ybn.optional(),pads:F.array(xbn).optional(),embeddedFonts:F.boolean().optional(),model:Cbn.optional()}),Ibn=F.object({hide:F.boolean().optional()}),vbn=F.object({offset:Ln.optional(),hide:F.boolean().optional()}),Sbn=F.object({font:Cst.optional(),justify:F.union([F.string(),F.array(F.string())]).optional(),hide:F.boolean().optional()}),ek=F.object({value:F.string(),id:F.union([F.number(),F.string()]).optional(),at:T7e.optional(),effects:Sbn.optional()}),Pbn=F.object({Reference:ek.optional(),Value:ek.optional(),Footprint:ek.optional(),Datasheet:ek.optional(),Description:ek.optional(),ki_keywords:ek.optional(),ki_fp_filters:ek.optional()}),Ebn=F.object({symbolName:F.string().optional(),extends:F.string().optional(),pinNumbers:Ibn.optional(),pinNames:vbn.optional(),excludeFromSim:F.boolean().optional(),inBom:F.boolean().optional(),onBoard:F.boolean().optional(),properties:Pbn.optional(),embeddedFonts:F.boolean().optional()}),kl=F.object({error_type:F.string(),message:F.string(),is_fatal:F.boolean().optional()}),D7e=F.enum(["jlcpcb","macrofab","pcbway","digikey","mouser","lcsc"]),id=F.object({type:F.literal("source_component"),ftype:F.string().optional(),source_component_id:F.string(),name:F.string(),manufacturer_part_number:F.string().optional(),supplier_part_numbers:F.record(D7e,F.array(F.string())).optional(),display_value:F.string().optional(),display_name:F.string().optional(),are_pins_interchangeable:F.boolean().optional(),internally_connected_source_port_ids:F.array(F.array(F.string())).optional(),source_group_id:F.string().optional(),subcircuit_id:F.string().optional()}),bst=id.extend({ftype:F.literal("simple_capacitor"),capacitance:fst,max_voltage_rating:xB.optional(),display_capacitance:F.string().optional(),max_decoupling_trace_length:Ln.optional()}),Ist=id.extend({ftype:F.literal("simple_resistor"),resistance:B7e,display_resistance:F.string().optional()}),N7e=id.extend({ftype:F.literal("simple_diode")}),Mbn=id.extend({ftype:F.literal("simple_fiducial")}),vst=N7e.extend({ftype:F.literal("simple_led"),color:F.string().optional(),wavelength:F.string().optional()}),wbn=id.extend({ftype:F.literal("simple_ground")}),Sst=id.extend({ftype:F.literal("simple_chip")}),Pst=id.extend({ftype:F.literal("simple_power_source"),voltage:xB}),Bbn=id.extend({ftype:F.literal("simple_current_source"),current:lZ,frequency:jY.optional(),peak_to_peak_current:lZ.optional(),wave_shape:F.enum(["sine","square","triangle","sawtooth","dc"]).optional().default("dc"),phase:F.number().optional(),duty_cycle:F.number().min(0).max(1).optional()}),Tbn=id.extend({ftype:F.literal("simple_fuse"),current_rating_amps:F.number().describe("Nominal current in amps the fuse is rated for"),voltage_rating_volts:F.number().describe("Voltage rating in volts, e.g. ±5V would be 5")}),Dbn=id.extend({ftype:F.literal("simple_ammeter")}),Nbn=F.object({must_be_connected:F.boolean().optional(),provides_power:F.boolean().optional(),requires_power:F.boolean().optional(),provides_ground:F.boolean().optional(),requires_ground:F.boolean().optional(),provides_voltage:F.union([F.string(),F.number()]).optional(),requires_voltage:F.union([F.string(),F.number()]).optional(),do_not_connect:F.boolean().optional(),include_in_board_pinout:F.boolean().optional(),can_use_internal_pullup:F.boolean().optional(),is_using_internal_pullup:F.boolean().optional(),needs_external_pullup:F.boolean().optional(),can_use_internal_pulldown:F.boolean().optional(),is_using_internal_pulldown:F.boolean().optional(),needs_external_pulldown:F.boolean().optional(),can_use_open_drain:F.boolean().optional(),is_using_open_drain:F.boolean().optional(),can_use_push_pull:F.boolean().optional(),is_using_push_pull:F.boolean().optional(),should_have_decoupling_capacitor:F.boolean().optional(),recommended_decoupling_capacitor_capacitance:F.union([F.string(),F.number()]).optional(),is_configured_for_i2c_sda:F.boolean().optional(),is_configured_for_i2c_scl:F.boolean().optional(),is_configured_for_spi_mosi:F.boolean().optional(),is_configured_for_spi_miso:F.boolean().optional(),is_configured_for_spi_sck:F.boolean().optional(),is_configured_for_spi_cs:F.boolean().optional(),is_configured_for_uart_tx:F.boolean().optional(),is_configured_for_uart_rx:F.boolean().optional(),supports_i2c_sda:F.boolean().optional(),supports_i2c_scl:F.boolean().optional(),supports_spi_mosi:F.boolean().optional(),supports_spi_miso:F.boolean().optional(),supports_spi_sck:F.boolean().optional(),supports_spi_cs:F.boolean().optional(),supports_uart_tx:F.boolean().optional(),supports_uart_rx:F.boolean().optional()}),Est=id.extend({ftype:F.literal("simple_battery"),capacity:gbn}),Mst=id.extend({ftype:F.literal("simple_inductor"),inductance:mbn,display_inductance:F.string().optional(),max_current_rating:F.number().optional()}),wst=id.extend({ftype:F.literal("simple_push_button")}),Bst=id.extend({ftype:F.literal("simple_potentiometer"),max_resistance:B7e,display_max_resistance:F.string().optional()}),Rbn=id.extend({ftype:F.literal("simple_crystal"),frequency:F.number().describe("Frequency in Hz"),load_capacitance:F.number().optional().describe("Load capacitance in pF"),pin_variant:F.enum(["two_pin","four_pin"]).optional()}),Tst=id.extend({ftype:F.literal("simple_pin_header"),pin_count:F.number(),gender:F.enum(["male","female"]).optional().default("male")}),Qbn=id.extend({ftype:F.literal("simple_connector"),standard:F.enum(["usb_c","m2"]).optional()}),Dst=id.extend({ftype:F.literal("simple_pinout")}),Nst=id.extend({ftype:F.literal("simple_resonator"),load_capacitance:fst,equivalent_series_resistance:B7e.optional(),frequency:jY}),Rst=id.extend({ftype:F.literal("simple_transistor"),transistor_type:F.enum(["npn","pnp"])}),Qst=id.extend({ftype:F.literal("simple_test_point"),footprint_variant:F.enum(["pad","through_hole"]).optional(),pad_shape:F.enum(["rect","circle"]).optional(),pad_diameter:F.union([F.number(),F.string()]).optional(),hole_diameter:F.union([F.number(),F.string()]).optional(),width:F.union([F.number(),F.string()]).optional(),height:F.union([F.number(),F.string()]).optional()}),kst=id.extend({ftype:F.literal("simple_mosfet"),channel_type:F.enum(["n","p"]),mosfet_mode:F.enum(["enhancement","depletion"])}),Lst=id.extend({ftype:F.literal("simple_op_amp")}),Hst=id.extend({ftype:F.literal("simple_switch")}),Fst=F.object({type:F.literal("source_project_metadata"),name:F.string().optional(),software_used_string:F.string().optional(),project_url:F.string().optional(),source_filesystem_md5_hash:F.string().optional(),created_at:_bn.optional()}),kbn=kl.extend({type:F.literal("source_missing_property_error"),source_missing_property_error_id:ro("source_missing_property_error"),source_component_id:F.string(),property_name:F.string(),subcircuit_id:F.string().optional(),error_type:F.literal("source_missing_property_error").default("source_missing_property_error")}).describe("The source code is missing a property"),Lbn=kl.extend({type:F.literal("source_failed_to_create_component_error"),source_failed_to_create_component_error_id:ro("source_failed_to_create_component_error"),error_type:F.literal("source_failed_to_create_component_error").default("source_failed_to_create_component_error"),component_name:F.string().optional(),subcircuit_id:F.string().optional(),parent_source_component_id:F.string().optional(),pcb_center:F.object({x:F.number().optional(),y:F.number().optional()}).optional(),schematic_center:F.object({x:F.number().optional(),y:F.number().optional()}).optional()}).describe("Error emitted when a component fails to be constructed"),zst=kl.extend({type:F.literal("source_invalid_component_property_error"),source_invalid_component_property_error_id:ro("source_invalid_component_property_error"),source_component_id:F.string(),property_name:F.string(),property_value:F.unknown().optional(),expected_format:F.string().optional(),subcircuit_id:F.string().optional(),error_type:F.literal("source_invalid_component_property_error").default("source_invalid_component_property_error")}).describe("The source component property is invalid"),Ost=kl.extend({type:F.literal("source_trace_not_connected_error"),source_trace_not_connected_error_id:ro("source_trace_not_connected_error"),error_type:F.literal("source_trace_not_connected_error").default("source_trace_not_connected_error"),subcircuit_id:F.string().optional(),source_group_id:F.string().optional(),source_trace_id:F.string().optional(),connected_source_port_ids:F.array(F.string()).optional(),selectors_not_found:F.array(F.string()).optional()}).describe("Occurs when a source trace selector does not match any ports"),Hbn=F.object({type:F.literal("source_property_ignored_warning"),source_property_ignored_warning_id:ro("source_property_ignored_warning"),source_component_id:F.string(),property_name:F.string(),subcircuit_id:F.string().optional(),error_type:F.literal("source_property_ignored_warning").default("source_property_ignored_warning"),message:F.string()}).describe("The source property was ignored"),Vst=F.object({type:F.literal("source_pin_missing_trace_warning"),source_pin_missing_trace_warning_id:ro("source_pin_missing_trace_warning"),warning_type:F.literal("source_pin_missing_trace_warning").default("source_pin_missing_trace_warning"),message:F.string(),source_component_id:F.string(),source_port_id:F.string(),subcircuit_id:F.string().optional()}).describe("Warning emitted when a source component pin is missing a trace connection"),Yst=F.object({type:F.literal("source_missing_manufacturer_part_number_warning"),source_missing_manufacturer_part_number_warning_id:ro("source_missing_manufacturer_part_number_warning"),warning_type:F.literal("source_missing_manufacturer_part_number_warning").default("source_missing_manufacturer_part_number_warning"),message:F.string(),source_component_id:F.string(),standard:F.string(),subcircuit_id:F.string().optional()}).describe("Warning emitted when a standard connector is missing manufacturer part number"),Gst=F.object({type:F.literal("source_refdes_convention_warning"),source_refdes_convention_warning_id:ro("source_refdes_convention_warning"),warning_type:F.literal("source_refdes_convention_warning").default("source_refdes_convention_warning"),message:F.string(),source_component_id:F.string(),refdes:F.string(),source_component_ftype:F.string(),expected_prefixes:F.array(F.string()),actual_prefix:F.string().optional(),subcircuit_id:F.string().optional()}).describe("Warning emitted when a source component reference designator does not match the component type convention"),Fbn=id.extend({ftype:F.literal("simple_voltage_probe")}),zbn=id.extend({ftype:F.literal("interconnect")}),Ust=kl.extend({type:F.literal("source_i2c_misconfigured_error"),source_i2c_misconfigured_error_id:ro("source_i2c_misconfigured_error"),error_type:F.literal("source_i2c_misconfigured_error").default("source_i2c_misconfigured_error"),source_port_ids:F.array(F.string())}).describe("Error emitted when incompatible I2C pins (e.g. SDA and SCL) are connected to the same net"),Wst=kl.extend({type:F.literal("source_component_misconfigured_error"),source_component_misconfigured_error_id:ro("source_component_misconfigured_error"),error_type:F.literal("source_component_misconfigured_error").default("source_component_misconfigured_error"),source_component_ids:F.array(F.string()),source_port_ids:F.array(F.string()).optional()}).describe("Error emitted when one or more source components have an invalid or conflicting configuration"),Obn=id.extend({ftype:F.literal("simple_voltage_source"),voltage:xB,frequency:jY.optional(),peak_to_peak_voltage:xB.optional(),wave_shape:F.enum(["sinewave","square","triangle","sawtooth"]).optional(),phase:Im.optional(),duty_cycle:F.number().optional().describe("Duty cycle as a fraction (0 to 1)"),pulse_delay:gg.optional(),rise_time:gg.optional(),fall_time:gg.optional(),pulse_width:gg.optional(),period:gg.optional()}),Vbn=F.union([Ist,bst,N7e,Mbn,vst,wbn,Sst,Pst,Bbn,Dbn,Est,Mst,wst,Bst,Rbn,Tst,Qbn,Dst,Nst,Hst,Rst,Qst,kst,Lst,Tbn,Fbn,zbn,Obn,Fst,kbn,zst,Lbn,Ost,Hbn,Vst,Yst,Gst,Ust,Wst]),Ybn=F.object({type:F.literal("source_port"),pin_number:F.number().optional(),port_hints:F.array(F.string()).optional(),name:F.string(),source_port_id:F.string(),source_component_id:F.string().optional(),source_group_id:F.string().optional(),most_frequently_referenced_by_name:F.string().optional(),subcircuit_id:F.string().optional(),subcircuit_connectivity_map_key:F.string().optional()}).merge(Nbn),Gbn=F.object({type:F.literal("source_component_internal_connection"),source_component_internal_connection_id:F.string(),source_component_id:F.string(),source_port_ids:F.array(F.string()),subcircuit_id:F.string().optional()}),Ubn=F.object({type:F.literal("source_trace"),source_trace_id:F.string(),connected_source_port_ids:F.array(F.string()),connected_source_net_ids:F.array(F.string()),subcircuit_id:F.string().optional(),subcircuit_connectivity_map_key:F.string().optional(),max_length:F.number().optional(),name:F.string().optional(),min_trace_thickness:F.number().optional(),display_name:F.string().optional()}),Wbn=F.object({type:F.literal("source_group"),source_group_id:F.string(),subcircuit_id:F.string().optional(),parent_subcircuit_id:F.string().optional(),parent_source_group_id:F.string().optional(),is_subcircuit:F.boolean().optional(),show_as_schematic_box:F.boolean().optional(),name:F.string().optional(),was_automatically_named:F.boolean().optional()}),Xbn=F.object({type:F.literal("source_net"),source_net_id:F.string(),name:F.string(),member_source_group_ids:F.array(F.string()),is_power:F.boolean().optional(),is_ground:F.boolean().optional(),is_digital_signal:F.boolean().optional(),is_analog_signal:F.boolean().optional(),is_positive_voltage_source:F.boolean().optional(),trace_width:F.number().optional(),subcircuit_id:F.string().optional(),subcircuit_connectivity_map_key:F.string().optional()}),jbn=F.object({type:F.literal("source_board"),source_board_id:F.string(),source_group_id:F.string(),title:F.string().optional()}).describe("Defines a board in the source domain"),Kbn=kl.extend({type:F.literal("source_ambiguous_port_reference"),source_ambiguous_port_reference_id:ro("source_ambiguous_port_reference"),error_type:F.literal("source_ambiguous_port_reference").default("source_ambiguous_port_reference"),source_port_id:F.string().optional(),source_component_id:F.string().optional()}).describe("Error emitted when a port hint matches multiple non-overlapping pads, making the port reference ambiguous"),$bn=F.object({type:F.literal("source_pcb_ground_plane"),source_pcb_ground_plane_id:F.string(),source_group_id:F.string(),source_net_id:F.string(),subcircuit_id:F.string().optional()}).describe("Defines a ground plane in the source domain"),qbn=["top","bottom","inner1","inner2","inner3","inner4","inner5","inner6","inner7","inner8"],grt=F.enum(qbn),$a=grt.or(F.object({name:grt})).transform((e)=>typeof e=="string"?e:e.name),fg=F.enum(["top","bottom"]),Jbn=F.object({type:F.literal("source_manually_placed_via"),source_manually_placed_via_id:F.string(),source_group_id:F.string(),source_net_id:F.string(),subcircuit_id:F.string().optional(),source_trace_id:F.string().optional()}).describe("Defines a via that is manually placed in the source domain"),Zbn=F.object({type:F.literal("source_unnamed_trace_warning"),source_unnamed_trace_warning_id:ro("source_unnamed_trace_warning"),warning_type:F.literal("source_unnamed_trace_warning").default("source_unnamed_trace_warning"),message:F.string(),source_trace_id:F.string(),subcircuit_id:F.string().optional()}).describe("Warning emitted when a source trace is missing a name"),e6n=F.object({type:F.literal("source_no_power_pin_defined_warning"),source_no_power_pin_defined_warning_id:ro("source_no_power_pin_defined_warning"),warning_type:F.literal("source_no_power_pin_defined_warning").default("source_no_power_pin_defined_warning"),message:F.string(),source_component_id:F.string(),source_port_ids:F.array(F.string()),subcircuit_id:F.string().optional()}).describe("Warning emitted when a chip has no source ports with requires_power=true"),t6n=F.object({type:F.literal("source_no_ground_pin_defined_warning"),source_no_ground_pin_defined_warning_id:ro("source_no_ground_pin_defined_warning"),warning_type:F.literal("source_no_ground_pin_defined_warning").default("source_no_ground_pin_defined_warning"),message:F.string(),source_component_id:F.string(),source_port_ids:F.array(F.string()),subcircuit_id:F.string().optional()}).describe("Warning emitted when a chip has no source ports marked as ground pins"),n6n=F.object({type:F.literal("source_component_pins_underspecified_warning"),source_component_pins_underspecified_warning_id:ro("source_component_pins_underspecified_warning"),warning_type:F.literal("source_component_pins_underspecified_warning").default("source_component_pins_underspecified_warning"),message:F.string(),source_component_id:F.string(),source_port_ids:F.array(F.string()),subcircuit_id:F.string().optional()}).describe("Warning emitted when all ports on a source component are underspecified"),o6n=kl.extend({type:F.literal("source_pin_must_be_connected_error"),source_pin_must_be_connected_error_id:ro("source_pin_must_be_connected_error"),error_type:F.literal("source_pin_must_be_connected_error").default("source_pin_must_be_connected_error"),source_component_id:F.string(),source_port_id:F.string(),subcircuit_id:F.string().optional()}).describe("Error emitted when a pin with mustBeConnected attribute is not connected to any trace"),r6n=kl.extend({type:F.literal("unknown_error_finding_part"),unknown_error_finding_part_id:ro("unknown_error_finding_part"),error_type:F.literal("unknown_error_finding_part").default("unknown_error_finding_part"),source_component_id:F.string().optional(),subcircuit_id:F.string().optional()}).describe("Error emitted when an unexpected error occurs while finding a part"),i6n=F.object({type:F.literal("source_part_not_found_warning"),source_part_not_found_warning_id:ro("source_part_not_found_warning"),warning_type:F.literal("source_part_not_found_warning").default("source_part_not_found_warning"),message:F.string(),source_component_id:F.string().optional(),subcircuit_id:F.string().optional(),supplier_name:D7e.optional(),manufacturer_part_number:F.string().optional(),supplier_part_number:F.string().optional(),part_name:F.string().optional()}).describe("Warning emitted when a requested part can not be found"),s6n=F.object({type:F.literal("schematic_box"),schematic_sheet_id:F.string().optional(),schematic_component_id:F.string().optional(),schematic_symbol_id:F.string().optional(),width:Ln,height:Ln,is_dashed:F.boolean().default(!1),x:Ln,y:Ln,subcircuit_id:F.string().optional()}).describe("Draws a box on the schematic"),a6n=F.object({type:F.literal("schematic_path"),schematic_path_id:ro("schematic_path"),schematic_sheet_id:F.string().optional(),schematic_component_id:F.string().optional(),schematic_symbol_id:F.string().optional(),fill_color:F.string().optional(),is_filled:F.boolean().optional(),is_dashed:F.boolean().default(!1),stroke_width:Ln.nullable().optional(),stroke_color:F.string().optional(),dash_length:Ln.optional(),dash_gap:Ln.optional(),points:F.array(Rr),subcircuit_id:F.string().optional()}),c6n=F.record(F.object({left_margin:Zo.optional(),right_margin:Zo.optional(),top_margin:Zo.optional(),bottom_margin:Zo.optional()})),l6n=F.object({left_size:F.number(),right_size:F.number(),top_size:F.number().optional(),bottom_size:F.number().optional()}),h6n=F.object({left_side:F.object({pins:F.array(F.number()),direction:F.enum(["top-to-bottom","bottom-to-top"]).optional()}).optional(),right_side:F.object({pins:F.array(F.number()),direction:F.enum(["top-to-bottom","bottom-to-top"]).optional()}).optional(),top_side:F.object({pins:F.array(F.number()),direction:F.enum(["left-to-right","right-to-left"]).optional()}).optional(),bottom_side:F.object({pins:F.array(F.number()),direction:F.enum(["left-to-right","right-to-left"]).optional()}).optional()}),d6n=F.union([l6n,h6n]),u6n=F.object({type:F.literal("schematic_component"),size:yst,center:Rr,source_component_id:F.string().optional(),schematic_component_id:F.string(),schematic_sheet_id:F.string().optional(),schematic_symbol_id:F.string().optional(),pin_spacing:Zo.optional(),pin_styles:c6n.optional(),box_width:Zo.optional(),symbol_name:F.string().optional(),port_arrangement:d6n.optional(),port_labels:F.record(F.string()).optional(),symbol_display_value:F.string().optional(),subcircuit_id:F.string().optional(),schematic_group_id:F.string().optional(),is_schematic_group:F.boolean().optional(),source_group_id:F.string().optional(),is_box_with_pins:F.boolean().optional().default(!0)}),uXr=F.object({kicad_symbol:Ebn.optional()}).catchall(F.unknown()),p6n=F.object({type:F.literal("schematic_symbol"),schematic_symbol_id:F.string(),name:F.string().optional(),metadata:uXr.optional()}).describe("Defines a named schematic symbol that can be referenced by components."),m6n=F.object({type:F.literal("schematic_line"),schematic_line_id:ro("schematic_line"),schematic_sheet_id:F.string().optional(),schematic_component_id:F.string().optional(),schematic_symbol_id:F.string().optional(),x1:Ln,y1:Ln,x2:Ln,y2:Ln,stroke_width:Ln.nullable().optional(),color:F.string().default("#000000"),is_dashed:F.boolean().default(!1),dash_length:Ln.optional(),dash_gap:Ln.optional(),subcircuit_id:F.string().optional()}).describe("Draws a styled line on the schematic"),_6n=F.object({type:F.literal("schematic_rect"),schematic_rect_id:ro("schematic_rect"),schematic_sheet_id:F.string().optional(),schematic_component_id:F.string().optional(),schematic_symbol_id:F.string().optional(),center:Rr,width:Ln,height:Ln,rotation:Im.default(0),stroke_width:Ln.nullable().optional(),color:F.string().default("#000000"),is_filled:F.boolean().default(!1),fill_color:F.string().optional(),is_dashed:F.boolean().default(!1),subcircuit_id:F.string().optional()}).describe("Draws a styled rectangle on the schematic"),g6n=F.object({type:F.literal("schematic_circle"),schematic_circle_id:ro("schematic_circle"),schematic_sheet_id:F.string().optional(),schematic_component_id:F.string().optional(),schematic_symbol_id:F.string().optional(),center:Rr,radius:Ln,stroke_width:Ln.nullable().optional(),color:F.string().default("#000000"),is_filled:F.boolean().default(!1),fill_color:F.string().optional(),is_dashed:F.boolean().default(!1),subcircuit_id:F.string().optional()}).describe("Draws a styled circle on the schematic"),A6n=F.object({type:F.literal("schematic_arc"),schematic_arc_id:ro("schematic_arc"),schematic_sheet_id:F.string().optional(),schematic_component_id:F.string().optional(),schematic_symbol_id:F.string().optional(),center:Rr,radius:Ln,start_angle_degrees:Im,end_angle_degrees:Im,direction:F.enum(["clockwise","counterclockwise"]).default("counterclockwise"),stroke_width:Ln.nullable().optional(),color:F.string().default("#000000"),is_dashed:F.boolean().default(!1),subcircuit_id:F.string().optional()}).describe("Draws a styled arc on the schematic"),f6n=F.object({type:F.literal("schematic_trace"),schematic_trace_id:F.string(),schematic_sheet_id:F.string().optional(),source_trace_id:F.string().optional(),junctions:F.array(F.object({x:F.number(),y:F.number()})),edges:F.array(F.object({from:F.object({x:F.number(),y:F.number()}),to:F.object({x:F.number(),y:F.number()}),is_crossing:F.boolean().optional(),from_schematic_port_id:F.string().optional(),to_schematic_port_id:F.string().optional()})),subcircuit_id:F.string().optional(),subcircuit_connectivity_map_key:F.string().optional()}),pXr=F.enum(["center","left","right","top","bottom"]),y6n=F.object({type:F.literal("schematic_text"),schematic_sheet_id:F.string().optional(),schematic_component_id:F.string().optional(),schematic_symbol_id:F.string().optional(),schematic_text_id:F.string(),text:F.string(),font_size:F.number().default(0.18),position:F.object({x:Ln,y:Ln}),rotation:F.number().default(0),anchor:F.union([pXr.describe("legacy"),vB]).default("center"),color:F.string().default("#000000"),subcircuit_id:F.string().optional()}),x6n=F.object({type:F.literal("schematic_port"),schematic_port_id:F.string(),source_port_id:F.string(),schematic_sheet_id:F.string().optional(),schematic_component_id:F.string().optional(),center:Rr,facing_direction:F.enum(["up","down","left","right"]).optional(),distance_from_component_edge:F.number().optional(),side_of_component:F.enum(["top","bottom","left","right"]).optional(),true_ccw_index:F.number().optional(),pin_number:F.number().optional(),display_pin_label:F.string().optional(),subcircuit_id:F.string().optional(),is_connected:F.boolean().optional(),has_input_arrow:F.boolean().optional(),has_output_arrow:F.boolean().optional(),is_drawn_with_inversion_circle:F.boolean().optional()}).describe("Defines a port on a schematic component"),C6n=F.object({type:F.literal("schematic_net_label"),schematic_net_label_id:ro("schematic_net_label"),schematic_sheet_id:F.string().optional(),schematic_trace_id:F.string().optional(),source_trace_id:F.string().optional(),source_net_id:F.string(),center:Rr,anchor_position:Rr.optional(),anchor_side:F.enum(["top","bottom","left","right"]),text:F.string(),symbol_name:F.string().optional(),is_movable:F.boolean().optional(),subcircuit_id:F.string().optional()}),b6n=kl.extend({type:F.literal("schematic_error"),schematic_error_id:F.string(),error_type:F.literal("schematic_port_not_found").default("schematic_port_not_found"),subcircuit_id:F.string().optional()}).describe("Defines a schematic error on the schematic"),I6n=kl.extend({type:F.literal("schematic_layout_error"),schematic_layout_error_id:ro("schematic_layout_error"),error_type:F.literal("schematic_layout_error").default("schematic_layout_error"),source_group_id:F.string(),schematic_group_id:F.string(),subcircuit_id:F.string().optional()}).describe("Error emitted when schematic layout fails for a group"),R7e=F.object({type:F.literal("schematic_debug_object"),label:F.string().optional(),subcircuit_id:F.string().optional()}),v6n=R7e.extend({shape:F.literal("rect"),center:Rr,size:yst}),S6n=R7e.extend({shape:F.literal("line"),start:Rr,end:Rr}),P6n=R7e.extend({shape:F.literal("point"),center:Rr}),E6n=F.discriminatedUnion("shape",[v6n,S6n,P6n]),M6n=F.object({type:F.literal("schematic_voltage_probe"),schematic_voltage_probe_id:F.string(),schematic_sheet_id:F.string().optional(),source_component_id:F.string().optional(),name:F.string().optional(),position:Rr,schematic_trace_id:F.string(),voltage:xB.optional(),subcircuit_id:F.string().optional(),color:F.string().optional(),label_alignment:vB.optional()}).describe("Defines a voltage probe measurement point on a schematic trace"),w6n=F.object({type:F.literal("schematic_manual_edit_conflict_warning"),schematic_manual_edit_conflict_warning_id:ro("schematic_manual_edit_conflict_warning"),warning_type:F.literal("schematic_manual_edit_conflict_warning").default("schematic_manual_edit_conflict_warning"),message:F.string(),schematic_component_id:F.string(),schematic_group_id:F.string().optional(),subcircuit_id:F.string().optional(),source_component_id:F.string()}).describe("Warning emitted when a component has both manual placement and explicit schX/schY coordinates"),B6n=F.object({type:F.literal("schematic_group"),schematic_group_id:ro("schematic_group"),schematic_sheet_id:F.string().optional(),source_group_id:F.string(),is_subcircuit:F.boolean().optional(),subcircuit_id:F.string().optional(),width:Zo,height:Zo,center:Rr,schematic_component_ids:F.array(F.string()),show_as_schematic_box:F.boolean().optional(),name:F.string().optional(),description:F.string().optional()}).describe("Defines a group of components on the schematic"),T6n=F.object({type:F.literal("schematic_table"),schematic_table_id:ro("schematic_table"),schematic_sheet_id:F.string().optional(),anchor_position:Rr,column_widths:F.array(Ln),row_heights:F.array(Ln),cell_padding:Ln.optional(),border_width:Ln.optional(),subcircuit_id:F.string().optional(),schematic_component_id:F.string().optional(),anchor:vB.optional()}).describe("Defines a table on the schematic"),D6n=F.object({type:F.literal("schematic_table_cell"),schematic_table_cell_id:ro("schematic_table_cell"),schematic_sheet_id:F.string().optional(),schematic_table_id:F.string(),start_row_index:F.number(),end_row_index:F.number(),start_column_index:F.number(),end_column_index:F.number(),text:F.string().optional(),center:Rr,width:Ln,height:Ln,horizontal_align:F.enum(["left","center","right"]).optional(),vertical_align:F.enum(["top","middle","bottom"]).optional(),font_size:Ln.optional(),subcircuit_id:F.string().optional()}).describe("Defines a cell within a schematic_table"),N6n=F.object({type:F.literal("schematic_sheet"),schematic_sheet_id:ro("schematic_sheet"),name:F.string().optional(),sheet_index:F.number().optional(),subcircuit_id:F.string().optional(),outline_color:F.string().optional()}).describe("Defines a schematic sheet or page that components can be placed on"),R6n=F.object({x:Ln,y:Ln,bulge:F.number().optional()}),Art=F.object({vertices:F.array(R6n)}),Xst=F.object({outer_ring:Art,inner_rings:F.array(Art).default([])}),Q6n=F.object({x:Ln,y:Ln,via:F.boolean().optional(),via_to_layer:$a.optional()}),mXr=F.array(Q6n),k6n=F.object({x:Ln,y:Ln,via:F.boolean().optional(),to_layer:$a.optional(),trace_width:Ln.optional()}),L6n=F.object({min_trace_width:Zo.optional(),min_board_edge_clearance:Zo.optional(),min_via_hole_edge_to_via_hole_edge_clearance:Zo.optional(),min_plated_hole_drill_edge_to_drill_edge_clearance:Zo.optional(),min_trace_to_pad_edge_clearance:Zo.optional(),min_pad_edge_to_pad_edge_clearance:Zo.optional(),min_same_net_trace_edge_to_trace_edge_clearance:Zo.optional(),min_different_net_trace_edge_to_trace_edge_clearance:Zo.optional(),min_via_edge_to_pad_edge_clearance:Zo.optional(),min_via_hole_diameter:Zo.optional(),min_via_pad_diameter:Zo.optional()}),H6n=F.object({type:F.literal("pcb_component"),pcb_component_id:ro("pcb_component"),source_component_id:F.string(),center:Rr,layer:$a,rotation:Im,display_offset_x:F.string().optional().describe("How to display the x offset for this part, usually corresponding with how the user specified it"),display_offset_y:F.string().optional().describe("How to display the y offset for this part, usually corresponding with how the user specified it"),width:Zo,height:Zo,do_not_place:F.boolean().optional(),is_allowed_to_be_off_board:F.boolean().optional(),subcircuit_id:F.string().optional(),pcb_group_id:F.string().optional(),position_mode:F.enum(["packed","relative_to_group_anchor","relative_to_another_component","none"]).optional(),anchor_position:Rr.optional(),anchor_alignment:vB.optional(),positioned_relative_to_pcb_group_id:F.string().optional(),positioned_relative_to_pcb_board_id:F.string().optional(),cable_insertion_center:Rr.optional(),insertion_direction:F.enum(["from_above","from_left","from_right","from_front","from_back"]).optional(),metadata:F.object({kicad_footprint:bbn.optional()}).optional(),obstructs_within_bounds:F.boolean().default(!0).describe("Does this component take up all the space within its bounds on a layer. This is generally true except for when separated pin headers are being represented by a single component (in which case, chips can be placed between the pin headers) or for tall modules where chips fit underneath")}).describe("Defines a component on the PCB"),F6n=F.object({type:F.literal("pcb_hole"),pcb_hole_id:ro("pcb_hole"),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),pcb_component_id:F.string().optional(),hole_shape:F.literal("circle"),hole_diameter:F.number(),x:Ln,y:Ln,is_covered_with_solder_mask:F.boolean().optional(),soldermask_margin:F.number().optional()}),_Xr=F6n.describe("Defines a circular hole on the PCB"),z6n=F.object({type:F.literal("pcb_hole"),pcb_hole_id:ro("pcb_hole"),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),pcb_component_id:F.string().optional(),hole_shape:F.literal("rect"),hole_width:F.number(),hole_height:F.number(),x:Ln,y:Ln,is_covered_with_solder_mask:F.boolean().optional(),soldermask_margin:F.number().optional()}),gXr=z6n.describe("Defines a rectangular (square-capable) hole on the PCB. Use equal width/height for square."),O6n=F.object({type:F.literal("pcb_hole"),pcb_hole_id:ro("pcb_hole"),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),pcb_component_id:F.string().optional(),hole_shape:F.enum(["circle","square"]),hole_diameter:F.number(),x:Ln,y:Ln,is_covered_with_solder_mask:F.boolean().optional(),soldermask_margin:F.number().optional()}),AXr=O6n.describe("Defines a circular or square hole on the PCB"),V6n=F.object({type:F.literal("pcb_hole"),pcb_hole_id:ro("pcb_hole"),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),pcb_component_id:F.string().optional(),hole_shape:F.literal("oval"),hole_width:F.number(),hole_height:F.number(),x:Ln,y:Ln,is_covered_with_solder_mask:F.boolean().optional(),soldermask_margin:F.number().optional()}),fXr=V6n.describe("Defines an oval hole on the PCB"),Y6n=F.object({type:F.literal("pcb_hole"),pcb_hole_id:ro("pcb_hole"),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),pcb_component_id:F.string().optional(),hole_shape:F.literal("pill"),hole_width:F.number(),hole_height:F.number(),x:Ln,y:Ln,is_covered_with_solder_mask:F.boolean().optional(),soldermask_margin:F.number().optional()});var yXr=Y6n.describe("Defines a pill-shaped hole on the PCB"),G6n=F.object({type:F.literal("pcb_hole"),pcb_hole_id:ro("pcb_hole"),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),pcb_component_id:F.string().optional(),hole_shape:F.literal("rotated_pill"),hole_width:F.number(),hole_height:F.number(),x:Ln,y:Ln,ccw_rotation:Im,is_covered_with_solder_mask:F.boolean().optional(),soldermask_margin:F.number().optional()}),xXr=G6n.describe("Defines a rotated pill-shaped hole on the PCB"),U6n=O6n.or(V6n).or(Y6n).or(G6n).or(F6n).or(z6n),CXr=F.object({type:F.literal("pcb_plated_hole"),shape:F.literal("circle"),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),outer_diameter:F.number(),hole_diameter:F.number(),is_covered_with_solder_mask:F.boolean().optional(),x:Ln,y:Ln,layers:F.array($a),port_hints:F.array(F.string()).optional(),pcb_component_id:F.string().optional(),pcb_port_id:F.string().optional(),pcb_plated_hole_id:ro("pcb_plated_hole"),soldermask_margin:F.number().optional()}),bXr=F.object({type:F.literal("pcb_plated_hole"),shape:F.enum(["oval","pill"]),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),outer_width:F.number(),outer_height:F.number(),hole_width:F.number(),hole_height:F.number(),is_covered_with_solder_mask:F.boolean().optional(),x:Ln,y:Ln,ccw_rotation:Im,layers:F.array($a),port_hints:F.array(F.string()).optional(),pcb_component_id:F.string().optional(),pcb_port_id:F.string().optional(),pcb_plated_hole_id:ro("pcb_plated_hole"),soldermask_margin:F.number().optional()}),IXr=F.object({type:F.literal("pcb_plated_hole"),shape:F.literal("circular_hole_with_rect_pad"),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),hole_shape:F.literal("circle"),pad_shape:F.literal("rect"),hole_diameter:F.number(),rect_pad_width:F.number(),rect_pad_height:F.number(),rect_border_radius:F.number().optional(),hole_offset_x:Ln.default(0),hole_offset_y:Ln.default(0),is_covered_with_solder_mask:F.boolean().optional(),x:Ln,y:Ln,layers:F.array($a),port_hints:F.array(F.string()).optional(),pcb_component_id:F.string().optional(),pcb_port_id:F.string().optional(),pcb_plated_hole_id:ro("pcb_plated_hole"),soldermask_margin:F.number().optional(),rect_ccw_rotation:Im.optional()}),vXr=F.object({type:F.literal("pcb_plated_hole"),shape:F.literal("pill_hole_with_rect_pad"),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),hole_shape:F.literal("pill"),pad_shape:F.literal("rect"),hole_width:F.number(),hole_height:F.number(),rect_pad_width:F.number(),rect_pad_height:F.number(),rect_border_radius:F.number().optional(),hole_offset_x:Ln.default(0),hole_offset_y:Ln.default(0),is_covered_with_solder_mask:F.boolean().optional(),x:Ln,y:Ln,layers:F.array($a),port_hints:F.array(F.string()).optional(),pcb_component_id:F.string().optional(),pcb_port_id:F.string().optional(),pcb_plated_hole_id:ro("pcb_plated_hole"),soldermask_margin:F.number().optional()}),SXr=F.object({type:F.literal("pcb_plated_hole"),shape:F.literal("rotated_pill_hole_with_rect_pad"),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),hole_shape:F.literal("rotated_pill"),pad_shape:F.literal("rect"),hole_width:F.number(),hole_height:F.number(),hole_ccw_rotation:Im,rect_pad_width:F.number(),rect_pad_height:F.number(),rect_border_radius:F.number().optional(),rect_ccw_rotation:Im,hole_offset_x:Ln.default(0),hole_offset_y:Ln.default(0),is_covered_with_solder_mask:F.boolean().optional(),x:Ln,y:Ln,layers:F.array($a),port_hints:F.array(F.string()).optional(),pcb_component_id:F.string().optional(),pcb_port_id:F.string().optional(),pcb_plated_hole_id:ro("pcb_plated_hole"),soldermask_margin:F.number().optional()}),PXr=F.object({type:F.literal("pcb_plated_hole"),shape:F.literal("hole_with_polygon_pad"),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),hole_shape:F.enum(["circle","oval","pill","rotated_pill"]),hole_diameter:F.number().optional(),hole_width:F.number().optional(),hole_height:F.number().optional(),pad_outline:F.array(F.object({x:Ln,y:Ln})).min(3),hole_offset_x:Ln.default(0),hole_offset_y:Ln.default(0),is_covered_with_solder_mask:F.boolean().optional(),x:Ln,y:Ln,layers:F.array($a),port_hints:F.array(F.string()).optional(),pcb_component_id:F.string().optional(),pcb_port_id:F.string().optional(),pcb_plated_hole_id:ro("pcb_plated_hole"),soldermask_margin:F.number().optional(),ccw_rotation:Im.optional()}),W6n=F.union([CXr,bXr,IXr,vXr,SXr,PXr]),X6n=F.object({type:F.literal("pcb_port"),pcb_port_id:ro("pcb_port"),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),source_port_id:F.string(),pcb_component_id:F.string().optional(),x:Ln,y:Ln,layers:F.array($a),is_board_pinout:F.boolean().optional()}).describe("Defines a port on the PCB"),EXr=F.object({type:F.literal("pcb_smtpad"),shape:F.literal("circle"),pcb_smtpad_id:ro("pcb_smtpad"),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),x:Ln,y:Ln,radius:F.number(),layer:$a,port_hints:F.array(F.string()).optional(),pcb_component_id:F.string().optional(),pcb_port_id:F.string().optional(),is_covered_with_solder_mask:F.boolean().optional(),soldermask_margin:F.number().optional()}),MXr=F.object({type:F.literal("pcb_smtpad"),shape:F.literal("rect"),pcb_smtpad_id:ro("pcb_smtpad"),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),x:Ln,y:Ln,width:F.number(),height:F.number(),rect_border_radius:F.number().optional(),corner_radius:F.number().optional(),layer:$a,port_hints:F.array(F.string()).optional(),pcb_component_id:F.string().optional(),pcb_port_id:F.string().optional(),is_covered_with_solder_mask:F.boolean().optional(),soldermask_margin:F.number().optional(),soldermask_margin_left:F.number().optional(),soldermask_margin_top:F.number().optional(),soldermask_margin_right:F.number().optional(),soldermask_margin_bottom:F.number().optional()}),wXr=F.object({type:F.literal("pcb_smtpad"),shape:F.literal("rotated_rect"),pcb_smtpad_id:ro("pcb_smtpad"),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),x:Ln,y:Ln,width:F.number(),height:F.number(),rect_border_radius:F.number().optional(),corner_radius:F.number().optional(),ccw_rotation:Im,layer:$a,port_hints:F.array(F.string()).optional(),pcb_component_id:F.string().optional(),pcb_port_id:F.string().optional(),is_covered_with_solder_mask:F.boolean().optional(),soldermask_margin:F.number().optional(),soldermask_margin_left:F.number().optional(),soldermask_margin_top:F.number().optional(),soldermask_margin_right:F.number().optional(),soldermask_margin_bottom:F.number().optional()}),j6n=F.object({type:F.literal("pcb_smtpad"),shape:F.literal("pill"),pcb_smtpad_id:ro("pcb_smtpad"),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),x:Ln,y:Ln,width:F.number(),height:F.number(),radius:F.number(),layer:$a,port_hints:F.array(F.string()).optional(),pcb_component_id:F.string().optional(),pcb_port_id:F.string().optional(),is_covered_with_solder_mask:F.boolean().optional(),soldermask_margin:F.number().optional()}),BXr=F.object({type:F.literal("pcb_smtpad"),shape:F.literal("rotated_pill"),pcb_smtpad_id:ro("pcb_smtpad"),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),x:Ln,y:Ln,width:F.number(),height:F.number(),radius:F.number(),ccw_rotation:Im,layer:$a,port_hints:F.array(F.string()).optional(),pcb_component_id:F.string().optional(),pcb_port_id:F.string().optional(),is_covered_with_solder_mask:F.boolean().optional(),soldermask_margin:F.number().optional()}),TXr=F.object({type:F.literal("pcb_smtpad"),shape:F.literal("polygon"),pcb_smtpad_id:ro("pcb_smtpad"),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),points:F.array(Rr),layer:$a,port_hints:F.array(F.string()).optional(),pcb_component_id:F.string().optional(),pcb_port_id:F.string().optional(),is_covered_with_solder_mask:F.boolean().optional(),soldermask_margin:F.number().optional()}),K6n=F.discriminatedUnion("shape",[EXr,MXr,wXr,BXr,j6n,TXr]).describe("Defines an SMT pad on the PCB"),DXr=F.object({type:F.literal("pcb_solder_paste"),shape:F.literal("circle"),pcb_solder_paste_id:ro("pcb_solder_paste"),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),x:Ln,y:Ln,radius:F.number(),layer:$a,pcb_component_id:F.string().optional(),pcb_smtpad_id:F.string().optional()}),NXr=F.object({type:F.literal("pcb_solder_paste"),shape:F.literal("rect"),pcb_solder_paste_id:ro("pcb_solder_paste"),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),x:Ln,y:Ln,width:F.number(),height:F.number(),layer:$a,pcb_component_id:F.string().optional(),pcb_smtpad_id:F.string().optional()}),RXr=F.object({type:F.literal("pcb_solder_paste"),shape:F.literal("pill"),pcb_solder_paste_id:ro("pcb_solder_paste"),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),x:Ln,y:Ln,width:F.number(),height:F.number(),radius:F.number(),layer:$a,pcb_component_id:F.string().optional(),pcb_smtpad_id:F.string().optional()}),QXr=F.object({type:F.literal("pcb_solder_paste"),shape:F.literal("rotated_rect"),pcb_solder_paste_id:ro("pcb_solder_paste"),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),x:Ln,y:Ln,width:F.number(),height:F.number(),ccw_rotation:Ln,layer:$a,pcb_component_id:F.string().optional(),pcb_smtpad_id:F.string().optional()}),kXr=F.object({type:F.literal("pcb_solder_paste"),shape:F.literal("oval"),pcb_solder_paste_id:ro("pcb_solder_paste"),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),x:Ln,y:Ln,width:F.number(),height:F.number(),layer:$a,pcb_component_id:F.string().optional(),pcb_smtpad_id:F.string().optional()}),$6n=F.union([DXr,NXr,RXr,QXr,kXr]).describe("Defines solderpaste on the PCB"),q6n=F.object({type:F.literal("pcb_text"),pcb_text_id:ro("pcb_text"),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),text:F.string(),center:Rr,layer:$a,width:Zo,height:Zo,lines:F.number(),align:F.enum(["bottom-left"])}).describe("Defines text on the PCB"),J6n=F.object({route_type:F.literal("wire"),x:Ln,y:Ln,width:Ln,copper_pour_id:F.string().optional(),is_inside_copper_pour:F.boolean().optional(),start_pcb_port_id:F.string().optional(),end_pcb_port_id:F.string().optional(),layer:$a}),Z6n=F.object({route_type:F.literal("via"),x:Ln,y:Ln,copper_pour_id:F.string().optional(),is_inside_copper_pour:F.boolean().optional(),hole_diameter:Ln.optional(),outer_diameter:Ln.optional(),from_layer:$a,to_layer:$a}),eIn=F.object({route_type:F.literal("through_pad"),start:Rr,end:Rr,width:Ln,start_layer:$a,end_layer:$a,pcb_smtpad_id:F.string().optional(),pcb_plated_hole_id:F.string().optional()}),tIn=F.union([J6n,Z6n,eIn]),nIn=F.object({type:F.literal("pcb_trace"),source_trace_id:F.string().optional(),pcb_component_id:F.string().optional(),pcb_trace_id:ro("pcb_trace"),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),route_thickness_mode:F.enum(["constant","interpolated"]).default("constant").optional(),route_order_index:F.number().optional(),should_round_corners:F.boolean().optional(),trace_length:F.number().optional(),highlight_color:F.string().optional(),route:F.array(tIn)}).describe("Defines a trace on the PCB"),oIn=F.object({type:F.literal("pcb_trace_warning"),pcb_trace_warning_id:ro("pcb_trace_warning"),warning_type:F.literal("pcb_trace_warning").default("pcb_trace_warning"),message:F.string(),center:Rr.optional(),pcb_trace_id:F.string(),source_trace_id:F.string(),pcb_component_ids:F.array(F.string()),pcb_port_ids:F.array(F.string()),subcircuit_id:F.string().optional()}).describe("Defines a trace warning on the PCB"),rIn=F.object({type:F.literal("pcb_trace_too_long_warning"),pcb_trace_too_long_warning_id:ro("pcb_trace_too_long_warning"),warning_type:F.literal("pcb_trace_too_long_warning").default("pcb_trace_too_long_warning"),message:F.string(),pcb_trace_id:F.string(),source_net_id:F.string().optional(),source_trace_id:F.string().optional(),actual_trace_length:Ln,maximum_trace_length:Ln,subcircuit_id:F.string().optional()}).describe("Warning emitted when a PCB trace is longer than its maximum allowed length"),iIn=kl.extend({type:F.literal("pcb_trace_error"),pcb_trace_error_id:ro("pcb_trace_error"),error_type:F.literal("pcb_trace_error").default("pcb_trace_error"),center:Rr.optional(),pcb_trace_id:F.string(),source_trace_id:F.string(),pcb_component_ids:F.array(F.string()),pcb_port_ids:F.array(F.string()),subcircuit_id:F.string().optional()}).describe("Defines a trace error on the PCB"),sIn=kl.extend({type:F.literal("pcb_trace_missing_error"),pcb_trace_missing_error_id:ro("pcb_trace_missing_error"),error_type:F.literal("pcb_trace_missing_error").default("pcb_trace_missing_error"),center:Rr.optional(),source_trace_id:F.string(),pcb_component_ids:F.array(F.string()),pcb_port_ids:F.array(F.string()),subcircuit_id:F.string().optional()}).describe("Defines an error when a source trace has no corresponding PCB trace"),aIn=kl.extend({type:F.literal("pcb_port_not_matched_error"),pcb_error_id:ro("pcb_error"),error_type:F.literal("pcb_port_not_matched_error").default("pcb_port_not_matched_error"),pcb_component_ids:F.array(F.string()),subcircuit_id:F.string().optional()}).describe("Defines a trace error on the PCB where a port is not matched"),cIn=kl.extend({type:F.literal("pcb_port_not_connected_error"),pcb_port_not_connected_error_id:ro("pcb_port_not_connected_error"),error_type:F.literal("pcb_port_not_connected_error").default("pcb_port_not_connected_error"),pcb_port_ids:F.array(F.string()),pcb_component_ids:F.array(F.string()),subcircuit_id:F.string().optional()}).describe("Defines an error when a pcb port is not connected to any trace"),lIn=F.object({type:F.literal("pcb_net"),pcb_net_id:ro("pcb_net"),source_net_id:F.string().optional(),highlight_color:F.string().optional()}).describe("Defines a net on the PCB"),hIn=F.object({type:F.literal("pcb_via"),pcb_via_id:ro("pcb_via"),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),subcircuit_connectivity_map_key:F.string().optional(),x:Ln,y:Ln,outer_diameter:Ln.default("0.6mm"),hole_diameter:Ln.default("0.25mm"),from_layer:$a.optional(),to_layer:$a.optional(),layers:F.array($a),pcb_trace_id:F.string().optional(),net_is_assignable:F.boolean().optional(),net_assigned:F.boolean().optional(),is_tented:F.boolean().optional()}).describe("Defines a via on the PCB"),dIn=F.object({type:F.literal("pcb_board"),pcb_board_id:ro("pcb_board"),pcb_panel_id:F.string().optional(),carrier_pcb_board_id:F.string().optional(),is_subcircuit:F.boolean().optional(),subcircuit_id:F.string().optional(),is_mounted_to_carrier_board:F.boolean().optional(),width:Zo.optional(),height:Zo.optional(),center:Rr,display_offset_x:F.string().optional().describe("How to display the x offset for this board, usually corresponding with how the user specified it"),display_offset_y:F.string().optional().describe("How to display the y offset for this board, usually corresponding with how the user specified it"),thickness:Zo.optional().default(1.4),num_layers:F.number().optional().default(4),outline:F.array(Rr).optional(),shape:F.enum(["rect","polygon"]).optional(),material:F.enum(["fr4","fr1"]).default("fr4"),solder_mask_color:F.string().optional(),silkscreen_color:F.string().optional(),anchor_position:Rr.optional(),anchor_alignment:vB.optional(),position_mode:F.enum(["relative_to_panel_anchor","none"]).optional()}).merge(L6n).describe("Defines the board outline of the PCB"),uIn=F.object({type:F.literal("pcb_panel"),pcb_panel_id:ro("pcb_panel"),width:Zo,height:Zo,center:Rr,thickness:Zo.optional().default(1.4),covered_with_solder_mask:F.boolean().optional().default(!0)}).describe("Defines a PCB panel that can contain multiple boards"),pIn=kl.extend({type:F.literal("pcb_placement_error"),pcb_placement_error_id:ro("pcb_placement_error"),error_type:F.literal("pcb_placement_error").default("pcb_placement_error"),subcircuit_id:F.string().optional()}).describe("Defines a placement error on the PCB"),mIn=kl.extend({type:F.literal("pcb_panelization_placement_error"),pcb_panelization_placement_error_id:ro("pcb_panelization_placement_error"),error_type:F.literal("pcb_panelization_placement_error").default("pcb_panelization_placement_error"),pcb_panel_id:F.string().optional(),pcb_board_id:F.string().optional(),subcircuit_id:F.string().optional()}).describe("Defines a panelization placement error on the PCB"),_In=F.object({type:F.literal("pcb_trace_hint"),pcb_trace_hint_id:ro("pcb_trace_hint"),pcb_port_id:F.string(),pcb_component_id:F.string(),route:F.array(k6n),subcircuit_id:F.string().optional()}).describe("A hint that can be used during generation of a PCB trace"),gIn=F.object({type:F.literal("pcb_silkscreen_line"),pcb_silkscreen_line_id:ro("pcb_silkscreen_line"),pcb_component_id:F.string(),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),stroke_width:Ln.default("0.1mm"),x1:Ln,y1:Ln,x2:Ln,y2:Ln,layer:fg}).describe("Defines a silkscreen line on the PCB"),AIn=F.object({type:F.literal("pcb_silkscreen_path"),pcb_silkscreen_path_id:ro("pcb_silkscreen_path"),pcb_component_id:F.string(),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),layer:fg,route:F.array(Rr),stroke_width:Zo}).describe("Defines a silkscreen path on the PCB"),fIn=F.object({type:F.literal("pcb_silkscreen_text"),pcb_silkscreen_text_id:ro("pcb_silkscreen_text"),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),font:F.literal("tscircuit2024").default("tscircuit2024"),font_size:Ln.default("0.2mm"),pcb_component_id:F.string(),text:F.string(),is_knockout:F.boolean().default(!1).optional(),knockout_padding:F.object({left:Zo,top:Zo,bottom:Zo,right:Zo}).default({left:"0.2mm",top:"0.2mm",bottom:"0.2mm",right:"0.2mm"}).optional(),ccw_rotation:F.number().optional(),layer:$a,is_mirrored:F.boolean().default(!1).optional(),anchor_position:Rr.default({x:0,y:0}),anchor_alignment:vB.default("center")}).describe("Defines silkscreen text on the PCB"),yIn=F.object({type:F.literal("pcb_copper_text"),pcb_copper_text_id:ro("pcb_copper_text"),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),font:F.literal("tscircuit2024").default("tscircuit2024"),font_size:Ln.default("0.2mm"),pcb_component_id:F.string(),text:F.string(),is_knockout:F.boolean().default(!1).optional(),knockout_padding:F.object({left:Zo,top:Zo,bottom:Zo,right:Zo}).default({left:"0.2mm",top:"0.2mm",bottom:"0.2mm",right:"0.2mm"}).optional(),ccw_rotation:F.number().optional(),layer:$a,is_mirrored:F.boolean().default(!1).optional(),anchor_position:Rr.default({x:0,y:0}),anchor_alignment:vB.default("center")}).describe("Defines copper text on the PCB"),xIn=F.object({type:F.literal("pcb_silkscreen_rect"),pcb_silkscreen_rect_id:ro("pcb_silkscreen_rect"),pcb_component_id:F.string(),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),center:Rr,width:Zo,height:Zo,layer:$a,stroke_width:Zo.default("1mm"),corner_radius:Zo.optional(),is_filled:F.boolean().default(!0).optional(),has_stroke:F.boolean().optional(),is_stroke_dashed:F.boolean().optional(),ccw_rotation:F.number().optional()}).describe("Defines a silkscreen rect on the PCB"),CIn=F.object({type:F.literal("pcb_silkscreen_circle"),pcb_silkscreen_circle_id:ro("pcb_silkscreen_circle"),pcb_component_id:F.string(),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),center:Rr,radius:Zo,layer:fg,stroke_width:Zo.default("1mm"),is_filled:F.boolean().optional()}).describe("Defines a silkscreen circle on the PCB"),bIn=F.object({type:F.literal("pcb_silkscreen_oval"),pcb_silkscreen_oval_id:ro("pcb_silkscreen_oval"),pcb_component_id:F.string(),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),center:Rr,radius_x:Ln,radius_y:Ln,layer:fg,ccw_rotation:Im.optional()}).describe("Defines a silkscreen oval on the PCB"),IIn=F.object({type:F.literal("pcb_silkscreen_graphic"),pcb_silkscreen_graphic_id:ro("pcb_silkscreen_graphic"),pcb_component_id:F.string(),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),layer:fg,image_asset:xst.optional()}).extend({shape:F.literal("brep"),brep_shape:Xst}).describe("Defines a BRep silkscreen graphic on the PCB"),vIn=F.discriminatedUnion("shape",[IIn]).describe("Defines a silkscreen graphic on the PCB"),SIn=F.object({type:F.literal("pcb_silkscreen_pill"),pcb_silkscreen_pill_id:ro("pcb_silkscreen_pill"),pcb_component_id:F.string(),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),center:Rr,width:Zo,height:Zo,layer:$a,ccw_rotation:F.number().optional()}).describe("Defines a silkscreen pill on the PCB"),PIn=F.object({type:F.literal("pcb_fabrication_note_text"),pcb_fabrication_note_text_id:ro("pcb_fabrication_note_text"),subcircuit_id:F.string().optional(),pcb_group_id:F.string().optional(),font:F.literal("tscircuit2024").default("tscircuit2024"),font_size:Ln.default("1mm"),pcb_component_id:F.string(),text:F.string(),ccw_rotation:F.number().optional(),layer:fg,anchor_position:Rr.default({x:0,y:0}),anchor_alignment:F.enum(["center","top_left","top_right","bottom_left","bottom_right"]).default("center"),color:F.string().optional()}).describe("Defines a fabrication note in text on the PCB, useful for leaving notes for assemblers or fabricators"),EIn=F.object({type:F.literal("pcb_fabrication_note_path"),pcb_fabrication_note_path_id:ro("pcb_fabrication_note_path"),pcb_component_id:F.string(),subcircuit_id:F.string().optional(),layer:$a,route:F.array(Rr),stroke_width:Zo,color:F.string().optional()}).describe("Defines a fabrication path on the PCB for fabricators or assemblers"),MIn=F.object({type:F.literal("pcb_fabrication_note_rect"),pcb_fabrication_note_rect_id:ro("pcb_fabrication_note_rect"),pcb_component_id:F.string(),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),center:Rr,width:Zo,height:Zo,layer:fg,stroke_width:Zo.default("0.1mm"),corner_radius:Zo.optional(),is_filled:F.boolean().optional(),has_stroke:F.boolean().optional(),is_stroke_dashed:F.boolean().optional(),color:F.string().optional()}).describe("Defines a fabrication note rectangle on the PCB"),wIn=F.object({type:F.literal("pcb_fabrication_note_dimension"),pcb_fabrication_note_dimension_id:ro("pcb_fabrication_note_dimension"),pcb_component_id:F.string(),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),layer:fg,from:Rr,to:Rr,text:F.string().optional(),text_ccw_rotation:F.number().optional(),offset:Zo.optional(),offset_distance:Zo.optional(),offset_direction:F.object({x:F.number(),y:F.number()}).optional(),font:F.literal("tscircuit2024").default("tscircuit2024"),font_size:Zo.default("1mm"),color:F.string().optional(),arrow_size:Zo.default("1mm")}).describe("Defines a measurement annotation within PCB fabrication notes"),BIn=F.object({type:F.literal("pcb_note_text"),pcb_note_text_id:ro("pcb_note_text"),pcb_component_id:F.string().optional(),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),name:F.string().optional(),font:F.literal("tscircuit2024").default("tscircuit2024"),font_size:Ln.default("1mm"),text:F.string().optional(),anchor_position:Rr.default({x:0,y:0}),anchor_alignment:F.enum(["center","top_left","top_right","bottom_left","bottom_right"]).default("center"),layer:fg.default("top"),is_mirrored_from_top_view:F.boolean().optional(),color:F.string().optional()}).describe("Defines a documentation note in text on the PCB"),TIn=F.object({type:F.literal("pcb_note_rect"),pcb_note_rect_id:ro("pcb_note_rect"),pcb_component_id:F.string().optional(),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),name:F.string().optional(),text:F.string().optional(),center:Rr,width:Zo,height:Zo,layer:fg.default("top"),stroke_width:Zo.default("0.1mm"),corner_radius:Zo.optional(),is_filled:F.boolean().optional(),has_stroke:F.boolean().optional(),is_stroke_dashed:F.boolean().optional(),color:F.string().optional()}).describe("Defines a rectangular documentation note on the PCB"),DIn=F.object({type:F.literal("pcb_note_path"),pcb_note_path_id:ro("pcb_note_path"),pcb_component_id:F.string().optional(),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),name:F.string().optional(),text:F.string().optional(),route:F.array(Rr),layer:fg.default("top"),stroke_width:Zo.default("0.1mm"),color:F.string().optional()}).describe("Defines a polyline documentation note on the PCB"),NIn=F.object({type:F.literal("pcb_note_line"),pcb_note_line_id:ro("pcb_note_line"),pcb_component_id:F.string().optional(),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),name:F.string().optional(),text:F.string().optional(),x1:Ln,y1:Ln,x2:Ln,y2:Ln,layer:fg.default("top"),stroke_width:Ln.default("0.1mm"),color:F.string().optional(),is_dashed:F.boolean().optional()}).describe("Defines a straight documentation note line on the PCB"),RIn=F.object({type:F.literal("pcb_note_dimension"),pcb_note_dimension_id:ro("pcb_note_dimension"),pcb_component_id:F.string().optional(),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),name:F.string().optional(),from:Rr,to:Rr,text:F.string().optional(),text_ccw_rotation:F.number().optional(),offset_distance:Zo.optional(),offset_direction:F.object({x:F.number(),y:F.number()}).optional(),font:F.literal("tscircuit2024").default("tscircuit2024"),font_size:Zo.default("1mm"),layer:fg.default("top"),color:F.string().optional(),arrow_size:Zo.default("1mm")}).describe("Defines a measurement annotation within PCB documentation notes"),QIn=kl.extend({type:F.literal("pcb_footprint_overlap_error"),pcb_error_id:ro("pcb_error"),error_type:F.literal("pcb_footprint_overlap_error").default("pcb_footprint_overlap_error"),pcb_smtpad_ids:F.array(F.string()).optional(),pcb_plated_hole_ids:F.array(F.string()).optional(),pcb_hole_ids:F.array(F.string()).optional(),pcb_keepout_ids:F.array(F.string()).optional()}).describe("Error emitted when a pcb footprint overlaps with another element"),kIn=kl.extend({type:F.literal("pcb_courtyard_overlap_error"),pcb_error_id:ro("pcb_error"),error_type:F.literal("pcb_courtyard_overlap_error").default("pcb_courtyard_overlap_error"),pcb_component_ids:F.tuple([F.string(),F.string()])}).describe("Error emitted when the courtyard (CrtYd) of one PCB component overlaps with the courtyard of another"),LIn=F.object({type:F.literal("pcb_keepout"),shape:F.literal("rect"),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),center:Rr,width:Ln,height:Ln,pcb_keepout_id:F.string(),layers:F.array(F.string()),description:F.string().optional()}).or(F.object({type:F.literal("pcb_keepout"),shape:F.literal("circle"),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),center:Rr,radius:Ln,pcb_keepout_id:F.string(),layers:F.array(F.string()),description:F.string().optional()})),Q7e=F.object({type:F.literal("pcb_cutout"),pcb_cutout_id:ro("pcb_cutout"),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),pcb_board_id:F.string().optional(),pcb_panel_id:F.string().optional()}),HIn=Q7e.extend({shape:F.literal("rect"),center:Rr,width:Zo,height:Zo,rotation:Im.optional(),corner_radius:Zo.optional()}),FIn=Q7e.extend({shape:F.literal("circle"),center:Rr,radius:Zo}),zIn=Q7e.extend({shape:F.literal("polygon"),points:F.array(Rr)}),OIn=Q7e.extend({shape:F.literal("path"),route:F.array(Rr),slot_width:Zo,slot_length:Zo.optional(),space_between_slots:Zo.optional(),slot_corner_radius:Zo.optional()}),VIn=F.discriminatedUnion("shape",[HIn,FIn,zIn,OIn]).describe("Defines a cutout on the PCB, removing board material."),YIn=kl.extend({type:F.literal("pcb_missing_footprint_error"),pcb_missing_footprint_error_id:ro("pcb_missing_footprint_error"),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),error_type:F.literal("pcb_missing_footprint_error").default("pcb_missing_footprint_error"),source_component_id:F.string()}).describe("Defines a missing footprint error on the PCB"),GIn=kl.extend({type:F.literal("external_footprint_load_error"),external_footprint_load_error_id:ro("external_footprint_load_error"),pcb_component_id:F.string(),source_component_id:F.string(),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),footprinter_string:F.string().optional(),error_type:F.literal("external_footprint_load_error").default("external_footprint_load_error")}).describe("Defines an error when an external footprint fails to load"),UIn=kl.extend({type:F.literal("circuit_json_footprint_load_error"),circuit_json_footprint_load_error_id:ro("circuit_json_footprint_load_error"),pcb_component_id:F.string(),source_component_id:F.string(),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),error_type:F.literal("circuit_json_footprint_load_error").default("circuit_json_footprint_load_error"),circuit_json:F.array(F.any()).optional()}).describe("Defines an error when a circuit JSON footprint fails to load"),WIn=F.object({type:F.literal("pcb_group"),pcb_group_id:ro("pcb_group"),source_group_id:F.string(),is_subcircuit:F.boolean().optional(),subcircuit_id:F.string().optional(),width:Zo.optional(),height:Zo.optional(),center:Rr,display_offset_x:F.string().optional().describe("How to display the x offset for this group, usually corresponding with how the user specified it"),display_offset_y:F.string().optional().describe("How to display the y offset for this group, usually corresponding with how the user specified it"),outline:F.array(Rr).optional(),anchor_position:Rr.optional(),anchor_alignment:vB.default("center"),position_mode:F.enum(["packed","relative_to_group_anchor","none"]).optional(),positioned_relative_to_pcb_group_id:F.string().optional(),positioned_relative_to_pcb_board_id:F.string().optional(),pcb_component_ids:F.array(F.string()),child_layout_mode:F.enum(["packed","none"]).optional(),name:F.string().optional(),description:F.string().optional(),layout_mode:F.string().optional(),autorouter_configuration:F.object({trace_clearance:Zo}).optional(),autorouter_used_string:F.string().optional()}).describe("Defines a group of components on the PCB"),XIn=kl.extend({type:F.literal("pcb_autorouting_error"),pcb_error_id:ro("pcb_autorouting_error"),error_type:F.literal("pcb_autorouting_error").default("pcb_autorouting_error"),subcircuit_id:F.string().optional()}).describe("The autorouting has failed to route a portion of the board"),jIn=F.object({type:F.literal("pcb_manual_edit_conflict_warning"),pcb_manual_edit_conflict_warning_id:ro("pcb_manual_edit_conflict_warning"),warning_type:F.literal("pcb_manual_edit_conflict_warning").default("pcb_manual_edit_conflict_warning"),message:F.string(),pcb_component_id:F.string(),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),source_component_id:F.string()}).describe("Warning emitted when a component has both manual placement and explicit pcbX/pcbY coordinates"),Nfn=F.enum(["x-","x+","y+","y-"]),KIn=F.object({type:F.literal("pcb_connector_not_in_accessible_orientation_warning"),pcb_connector_not_in_accessible_orientation_warning_id:ro("pcb_connector_not_in_accessible_orientation_warning"),warning_type:F.literal("pcb_connector_not_in_accessible_orientation_warning").default("pcb_connector_not_in_accessible_orientation_warning"),message:F.string(),pcb_component_id:F.string(),source_component_id:F.string().optional(),pcb_board_id:F.string().optional(),facing_direction:Nfn,recommended_facing_direction:Nfn,subcircuit_id:F.string().optional()}).describe("Warning emitted when a connector PCB component is facing inward toward the board and should be reoriented to an outward-facing direction"),$In=F.object({type:F.literal("supplier_footprint_mismatch_warning"),supplier_footprint_mismatch_warning_id:ro("supplier_footprint_mismatch_warning"),warning_type:F.literal("supplier_footprint_mismatch_warning").default("supplier_footprint_mismatch_warning"),message:F.string(),source_component_id:F.string(),pcb_component_id:F.string().optional(),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),supplier_name:D7e.optional(),supplier_part_number:F.string().optional(),supplier_footprint_url:F.string().optional(),footprint_copper_intersection_over_union:F.number()}).describe("Warning emitted when a supplier part footprint does not match the expected footprint"),qIn=F.object({type:F.literal("pcb_breakout_point"),pcb_breakout_point_id:ro("pcb_breakout_point"),pcb_group_id:F.string(),subcircuit_id:F.string().optional(),source_trace_id:F.string().optional(),source_port_id:F.string().optional(),source_net_id:F.string().optional(),x:Ln,y:Ln}).describe("Defines a routing target within a pcb_group for a source_trace or source_net"),JIn=F.object({type:F.literal("pcb_ground_plane"),pcb_ground_plane_id:ro("pcb_ground_plane"),source_pcb_ground_plane_id:F.string(),source_net_id:F.string(),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional()}).describe("Defines a ground plane on the PCB"),ZIn=F.object({type:F.literal("pcb_ground_plane_region"),pcb_ground_plane_region_id:ro("pcb_ground_plane_region"),pcb_ground_plane_id:F.string(),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),layer:$a,points:F.array(Rr)}).describe("Defines a polygon region of a ground plane"),e9n=F.object({type:F.literal("pcb_thermal_spoke"),pcb_thermal_spoke_id:ro("pcb_thermal_spoke"),pcb_ground_plane_id:F.string(),shape:F.string(),spoke_count:F.number(),spoke_thickness:Ln,spoke_inner_diameter:Ln,spoke_outer_diameter:Ln,pcb_plated_hole_id:F.string().optional(),subcircuit_id:F.string().optional()}).describe("Pattern for connecting a ground plane to a plated hole"),jst=F.object({type:F.literal("pcb_copper_pour"),pcb_copper_pour_id:ro("pcb_copper_pour"),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),layer:$a,source_net_id:F.string().optional(),covered_with_solder_mask:F.boolean().optional().default(!0)}),t9n=jst.extend({shape:F.literal("rect"),center:Rr,width:Zo,height:Zo,rotation:Im.optional()}),n9n=jst.extend({shape:F.literal("brep"),brep_shape:Xst}),o9n=jst.extend({shape:F.literal("polygon"),points:F.array(Rr)}),r9n=F.discriminatedUnion("shape",[t9n,n9n,o9n]).describe("Defines a copper pour on the PCB."),i9n=kl.extend({type:F.literal("pcb_component_outside_board_error"),pcb_component_outside_board_error_id:ro("pcb_component_outside_board_error"),error_type:F.literal("pcb_component_outside_board_error").default("pcb_component_outside_board_error"),pcb_component_id:F.string(),pcb_board_id:F.string(),component_center:Rr,component_bounds:F.object({min_x:F.number(),max_x:F.number(),min_y:F.number(),max_y:F.number()}),subcircuit_id:F.string().optional(),source_component_id:F.string().optional()}).describe("Error emitted when a PCB component is placed outside the board boundaries"),s9n=kl.extend({type:F.literal("pcb_component_not_on_board_edge_error"),pcb_component_not_on_board_edge_error_id:ro("pcb_component_not_on_board_edge_error"),error_type:F.literal("pcb_component_not_on_board_edge_error").default("pcb_component_not_on_board_edge_error"),pcb_component_id:F.string(),pcb_board_id:F.string(),component_center:Rr,pad_to_nearest_board_edge_distance:F.number(),source_component_id:F.string().optional(),subcircuit_id:F.string().optional()}).describe("Error emitted when a component that must be placed on the board edge is centered away from the edge"),a9n=kl.extend({type:F.literal("pcb_component_invalid_layer_error"),pcb_component_invalid_layer_error_id:ro("pcb_component_invalid_layer_error"),error_type:F.literal("pcb_component_invalid_layer_error").default("pcb_component_invalid_layer_error"),pcb_component_id:F.string().optional(),source_component_id:F.string(),layer:$a,subcircuit_id:F.string().optional()}).describe("Error emitted when a component is placed on an invalid layer (components can only be on 'top' or 'bottom' layers)"),c9n=kl.extend({type:F.literal("pcb_via_clearance_error"),pcb_error_id:ro("pcb_error"),error_type:F.literal("pcb_via_clearance_error").default("pcb_via_clearance_error"),pcb_via_ids:F.array(F.string()).min(2),minimum_clearance:Ln.optional(),actual_clearance:Ln.optional(),pcb_center:F.object({x:F.number().optional(),y:F.number().optional()}).optional(),subcircuit_id:F.string().optional()}).describe("Error emitted when vias are closer than the allowed clearance"),l9n=kl.extend({type:F.literal("pcb_via_trace_clearance_error"),pcb_via_trace_clearance_error_id:ro("pcb_via_trace_clearance_error"),error_type:F.literal("pcb_via_trace_clearance_error").default("pcb_via_trace_clearance_error"),pcb_via_id:F.string(),pcb_trace_id:F.string(),minimum_clearance:Ln.optional(),actual_clearance:Ln.optional(),center:F.object({x:F.number().optional(),y:F.number().optional()}).optional(),subcircuit_id:F.string().optional()}).describe("Error emitted when a via and trace are closer than the allowed clearance"),h9n=kl.extend({type:F.literal("pcb_pad_pad_clearance_error"),pcb_pad_pad_clearance_error_id:ro("pcb_pad_pad_clearance_error"),error_type:F.literal("pcb_pad_pad_clearance_error").default("pcb_pad_pad_clearance_error"),pcb_pad_ids:F.array(F.string()).min(2),minimum_clearance:Ln.optional(),actual_clearance:Ln.optional(),center:F.object({x:F.number().optional(),y:F.number().optional()}).optional(),subcircuit_id:F.string().optional()}).describe("Error emitted when pads are closer than the allowed clearance"),d9n=kl.extend({type:F.literal("pcb_pad_trace_clearance_error"),pcb_pad_trace_clearance_error_id:ro("pcb_pad_trace_clearance_error"),error_type:F.literal("pcb_pad_trace_clearance_error").default("pcb_pad_trace_clearance_error"),pcb_pad_id:F.string(),pcb_trace_id:F.string(),minimum_clearance:Ln.optional(),actual_clearance:Ln.optional(),center:F.object({x:F.number().optional(),y:F.number().optional()}).optional(),subcircuit_id:F.string().optional()}).describe("Error emitted when a pad and trace are closer than allowed clearance"),u9n=F.object({type:F.literal("pcb_courtyard_rect"),pcb_courtyard_rect_id:ro("pcb_courtyard_rect"),pcb_component_id:F.string(),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),center:Rr,width:Zo,height:Zo,layer:fg,ccw_rotation:Im.optional(),color:F.string().optional()}).describe("Defines a courtyard rectangle on the PCB"),p9n=F.object({type:F.literal("pcb_courtyard_outline"),pcb_courtyard_outline_id:ro("pcb_courtyard_outline"),pcb_component_id:F.string(),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),layer:fg,outline:F.array(Rr).min(2)}).describe("Defines a courtyard outline on the PCB"),m9n=F.object({type:F.literal("pcb_courtyard_polygon"),pcb_courtyard_polygon_id:ro("pcb_courtyard_polygon"),pcb_component_id:F.string(),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),layer:fg,points:F.array(Rr).min(3),color:F.string().optional()}).describe("Defines a courtyard polygon on the PCB"),_9n=F.object({type:F.literal("pcb_courtyard_circle"),pcb_courtyard_circle_id:ro("pcb_courtyard_circle"),pcb_component_id:F.string(),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),center:Rr,radius:Zo,layer:fg,color:F.string().optional()}).describe("Defines a courtyard circle on the PCB"),g9n=F.object({type:F.literal("pcb_courtyard_pill"),pcb_courtyard_pill_id:ro("pcb_courtyard_pill"),pcb_component_id:F.string(),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),center:Rr,width:Zo,height:Zo,radius:Zo,layer:fg,color:F.string().optional()}).describe("Defines a courtyard pill on the PCB"),LXr=["obj","stl","3mf","gltf","glb","step","wrl"],A9n=["x+","x-","y+","y-","z+","z-"],HXr={obj:"z+",stl:"z+","3mf":"z+",gltf:"y+",glb:"y+",step:"z+",wrl:"y+"},f9n=F.object({type:F.literal("cad_component"),cad_component_id:F.string(),pcb_component_id:F.string(),source_component_id:F.string(),position:lB,rotation:lB.optional(),size:lB.optional(),layer:$a.optional(),subcircuit_id:F.string().optional(),footprinter_string:F.string().optional(),model_obj_url:F.string().optional(),model_stl_url:F.string().optional(),model_3mf_url:F.string().optional(),model_gltf_url:F.string().optional(),model_glb_url:F.string().optional(),model_step_url:F.string().optional(),model_wrl_url:F.string().optional(),model_asset:xst.optional(),model_unit_to_mm_scale_factor:F.number().optional(),model_board_normal_direction:F.enum(A9n).optional().describe(`The direction in the model's coordinate space that is considered "up" or "coming out of the board surface"`),model_origin_position:lB.optional(),model_origin_alignment:F.enum(["unknown","center","center_of_component_on_board_surface","bottom_center_of_component"]).optional(),model_object_fit:F.enum(["contain_within_bounds","fill_bounds"]).optional().default("contain_within_bounds"),model_jscad:F.any().optional(),show_as_translucent_model:F.boolean().optional(),show_as_bounding_box:F.boolean().optional(),anchor_alignment:F.enum(["center","center_of_component_on_board_surface"]).optional().default("center")}).describe("Defines a component on the PCB"),Kst=F.enum(["sinewave","square","triangle","sawtooth"]),FXr=F.union([F.string(),F.number()]).transform((e)=>typeof e=="string"?e.endsWith("%")?parseFloat(e.slice(0,-1))/100:parseFloat(e):e).pipe(F.number().min(0,"Duty cycle must be non-negative").max(1,"Duty cycle cannot be greater than 100%")),y9n=F.object({type:F.literal("simulation_voltage_source"),simulation_voltage_source_id:ro("simulation_voltage_source"),is_dc_source:F.literal(!0).optional().default(!0),positive_source_port_id:F.string().optional(),negative_source_port_id:F.string().optional(),positive_source_net_id:F.string().optional(),negative_source_net_id:F.string().optional(),voltage:xB}).describe("Defines a DC voltage source for simulation"),x9n=F.object({type:F.literal("simulation_voltage_source"),simulation_voltage_source_id:ro("simulation_voltage_source"),is_dc_source:F.literal(!1),terminal1_source_port_id:F.string().optional(),terminal2_source_port_id:F.string().optional(),terminal1_source_net_id:F.string().optional(),terminal2_source_net_id:F.string().optional(),voltage:xB.optional(),frequency:jY.optional(),peak_to_peak_voltage:xB.optional(),wave_shape:Kst.optional(),phase:Im.optional(),duty_cycle:FXr.optional(),pulse_delay:gg.optional(),rise_time:gg.optional(),fall_time:gg.optional(),pulse_width:gg.optional(),period:gg.optional()}).describe("Defines an AC voltage source for simulation"),C9n=F.union([y9n,x9n]).describe("Defines a voltage source for simulation"),zXr=F.union([F.string(),F.number()]).transform((e)=>typeof e=="string"?e.endsWith("%")?parseFloat(e.slice(0,-1))/100:parseFloat(e):e).pipe(F.number().min(0,"Duty cycle must be non-negative").max(1,"Duty cycle cannot be greater than 100%")),b9n=F.object({type:F.literal("simulation_current_source"),simulation_current_source_id:ro("simulation_current_source"),is_dc_source:F.literal(!0).optional().default(!0),positive_source_port_id:F.string().optional(),negative_source_port_id:F.string().optional(),positive_source_net_id:F.string().optional(),negative_source_net_id:F.string().optional(),current:lZ}).describe("Defines a DC current source for simulation"),I9n=F.object({type:F.literal("simulation_current_source"),simulation_current_source_id:ro("simulation_current_source"),is_dc_source:F.literal(!1),terminal1_source_port_id:F.string().optional(),terminal2_source_port_id:F.string().optional(),terminal1_source_net_id:F.string().optional(),terminal2_source_net_id:F.string().optional(),current:lZ.optional(),frequency:jY.optional(),peak_to_peak_current:lZ.optional(),wave_shape:Kst.optional(),phase:Im.optional(),duty_cycle:zXr.optional()}).describe("Defines an AC current source for simulation"),v9n=F.union([b9n,I9n]).describe("Defines a current source for simulation"),S9n=F.union([F.literal("spice_dc_sweep"),F.literal("spice_dc_operating_point"),F.literal("spice_transient_analysis"),F.literal("spice_ac_analysis")]),P9n=F.object({method:F.enum(["trap","gear"]).optional(),reltol:F.union([F.number(),F.string()]).optional(),abstol:F.union([F.number(),F.string()]).optional(),vntol:F.union([F.number(),F.string()]).optional()}).describe("SPICE solver options for a simulation experiment"),E9n=F.object({type:F.literal("simulation_experiment"),simulation_experiment_id:ro("simulation_experiment"),name:F.string(),experiment_type:S9n,time_per_step:MZ.optional(),start_time_ms:gg.optional(),end_time_ms:gg.optional(),spice_options:P9n.optional()}).describe("Defines a simulation experiment configuration"),M9n=F.object({type:F.literal("simulation_transient_voltage_graph"),simulation_transient_voltage_graph_id:ro("simulation_transient_voltage_graph"),simulation_experiment_id:F.string(),timestamps_ms:F.array(F.number()).optional(),voltage_levels:F.array(F.number()),source_component_id:F.string().optional(),subcircuit_connectivity_map_key:F.string().optional(),time_per_step:MZ,start_time_ms:gg,end_time_ms:gg,name:F.string().optional(),color:F.string().optional()}).describe("Stores voltage measurements over time for a simulation"),w9n=F.object({type:F.literal("simulation_transient_current_graph"),simulation_transient_current_graph_id:ro("simulation_transient_current_graph"),simulation_experiment_id:F.string(),timestamps_ms:F.array(F.number()).optional(),current_levels:F.array(F.number()),source_component_id:F.string().optional(),subcircuit_connectivity_map_key:F.string().optional(),time_per_step:MZ,start_time_ms:gg,end_time_ms:gg,name:F.string().optional(),color:F.string().optional()}).describe("Stores current measurements over time for a simulation"),B9n=F.object({type:F.literal("simulation_switch"),simulation_switch_id:ro("simulation_switch"),source_component_id:F.string().optional(),closes_at:gg.optional(),opens_at:gg.optional(),starts_closed:F.boolean().optional(),switching_frequency:jY.optional()}).describe("Defines a switch for simulation timing control"),T9n=F.object({type:F.literal("simulation_voltage_probe"),simulation_voltage_probe_id:ro("simulation_voltage_probe"),source_component_id:F.string().optional(),name:F.string().optional(),signal_input_source_port_id:F.string().optional(),signal_input_source_net_id:F.string().optional(),reference_input_source_port_id:F.string().optional(),reference_input_source_net_id:F.string().optional(),subcircuit_id:F.string().optional(),color:F.string().optional()}).describe("Defines a voltage probe for simulation. If a reference input is not provided, it measures against ground. If a reference input is provided, it measures the differential voltage between two points.").superRefine((e,t)=>{if(e.reference_input_source_port_id||e.reference_input_source_net_id){let n=!!e.signal_input_source_port_id||!!e.reference_input_source_port_id,o=!!e.signal_input_source_net_id||!!e.reference_input_source_net_id;n&&o?t.addIssue({code:F.ZodIssueCode.custom,message:"Cannot mix port and net connections in a differential probe."}):n?e.signal_input_source_port_id&&e.reference_input_source_port_id||t.addIssue({code:F.ZodIssueCode.custom,message:"Differential port probe requires both signal_input_source_port_id and reference_input_source_port_id."}):o&&(e.signal_input_source_net_id&&e.reference_input_source_net_id||t.addIssue({code:F.ZodIssueCode.custom,message:"Differential net probe requires both signal_input_source_net_id and reference_input_source_net_id."}))}else!!e.signal_input_source_port_id==!!e.signal_input_source_net_id&&t.addIssue({code:F.ZodIssueCode.custom,message:"A voltage probe must have exactly one of signal_input_source_port_id or signal_input_source_net_id."})}),D9n=F.object({type:F.literal("simulation_current_probe"),simulation_current_probe_id:ro("simulation_current_probe"),source_component_id:F.string().optional(),name:F.string().optional(),positive_source_port_id:F.string().optional(),negative_source_port_id:F.string().optional(),positive_source_net_id:F.string().optional(),negative_source_net_id:F.string().optional(),subcircuit_id:F.string().optional(),color:F.string().optional()}).describe("Defines a current probe for simulation. It measures current flowing from the positive endpoint to the negative endpoint.").superRefine((e,t)=>{let n=!!e.positive_source_port_id,o=!!e.negative_source_port_id,r=!!e.positive_source_net_id,i=!!e.negative_source_net_id,s=n||o,a=r||i;s&&a?t.addIssue({code:F.ZodIssueCode.custom,message:"Cannot mix port and net connections in a current probe."}):s?n&&o||t.addIssue({code:F.ZodIssueCode.custom,message:"Current probe using source ports requires both positive_source_port_id and negative_source_port_id."}):a?r&&i||t.addIssue({code:F.ZodIssueCode.custom,message:"Current probe using source nets requires both positive_source_net_id and negative_source_net_id."}):t.addIssue({code:F.ZodIssueCode.custom,message:"A current probe must have either positive/negative source port ids or positive/negative source net ids."})}),N9n=kl.extend({type:F.literal("simulation_unknown_experiment_error"),simulation_unknown_experiment_error_id:ro("simulation_unknown_experiment_error"),error_type:F.literal("simulation_unknown_experiment_error").default("simulation_unknown_experiment_error"),simulation_experiment_id:F.string().optional(),subcircuit_id:F.string().optional()}).describe("An unknown error occurred during the simulation experiment."),R9n=F.object({type:F.literal("simulation_op_amp"),simulation_op_amp_id:ro("simulation_op_amp"),source_component_id:F.string().optional(),inverting_input_source_port_id:F.string(),non_inverting_input_source_port_id:F.string(),output_source_port_id:F.string(),positive_supply_source_port_id:F.string(),negative_supply_source_port_id:F.string()}).describe("Defines a simple ideal operational amplifier for simulation"),Q9n=F.object({type:F.literal("simulation_spice_subcircuit"),simulation_spice_subcircuit_id:ro("simulation_spice_subcircuit"),source_component_id:F.string(),spice_pin_to_source_port_map:F.record(F.string(),F.string()),subcircuit_source:F.string()}).describe("Defines a custom SPICE subcircuit model for simulation"),Rfn=(e)=>e!==void 0,k9n=F.object({type:F.literal("simulation_oscilloscope_trace"),simulation_oscilloscope_trace_id:ro("simulation_oscilloscope_trace"),simulation_transient_voltage_graph_id:F.string().optional(),simulation_transient_current_graph_id:F.string().optional(),simulation_voltage_probe_id:F.string().optional(),simulation_current_probe_id:F.string().optional(),display_name:F.string().optional(),color:F.string().optional(),display_center_value:F.number().optional(),display_center_offset_divs:F.number().optional(),volts_per_div:F.number().positive().optional(),amps_per_div:F.number().positive().optional()}).describe("Defines how a simulation measurement is rendered as an oscilloscope-style trace.").superRefine((e,t)=>{let n=[e.simulation_transient_voltage_graph_id,e.simulation_voltage_probe_id].filter(Rfn).length,o=[e.simulation_transient_current_graph_id,e.simulation_current_probe_id].filter(Rfn).length;n+o!==1&&t.addIssue({code:F.ZodIssueCode.custom,message:"An oscilloscope trace must reference exactly one voltage graph, current graph, voltage probe, or current probe."}),n>0&&e.amps_per_div!==void 0&&t.addIssue({code:F.ZodIssueCode.custom,message:"Voltage oscilloscope traces must use volts_per_div, not amps_per_div."}),o>0&&e.volts_per_div!==void 0&&t.addIssue({code:F.ZodIssueCode.custom,message:"Current oscilloscope traces must use amps_per_div, not volts_per_div."})}),L9n=F.union([Ubn,Ybn,Gbn,Vbn,Xbn,Wbn,Sst,bst,N7e,vst,Ist,Pst,Est,Mst,Tst,Dst,Nst,Hst,Rst,Qst,kst,Lst,Bst,wst,$bn,Jbn,jbn,Fst,zst,Ost,Vst,Zbn,Yst,Gst,e6n,t6n,n6n,o6n,r6n,i6n,Ust,Wst,Kbn,H6n,U6n,YIn,GIn,UIn,jIn,KIn,$In,W6n,LIn,X6n,lIn,q6n,nIn,oIn,rIn,hIn,K6n,$6n,dIn,uIn,WIn,_In,gIn,AIn,fIn,SIn,yIn,xIn,CIn,bIn,vIn,iIn,sIn,pIn,mIn,aIn,cIn,c9n,l9n,h9n,d9n,EIn,PIn,MIn,wIn,BIn,TIn,DIn,NIn,RIn,XIn,QIn,kIn,qIn,VIn,JIn,ZIn,e9n,r9n,i9n,s9n,a9n,u9n,p9n,m9n,_9n,g9n,s6n,y6n,m6n,_6n,g6n,A6n,u6n,p6n,x6n,f6n,a6n,b6n,I6n,C6n,E6n,M6n,w6n,B6n,N6n,T6n,D6n,f9n,C9n,v9n,E9n,M9n,w9n,B9n,T9n,D9n,k9n,N9n,R9n,Q9n]),w8e=L9n;function Qfn(e,t,n){if(!t||!n)return;let o=e.get(t);o||(o=new Set,e.set(t,o)),o.add(n);let r=e.get(n);r||(r=new Set,e.set(n,r)),r.add(t)}var frt=(e,t={})=>{let n=e,o=n._internal_store;if(!o){o={counts:{},editCount:0},n._internal_store=o;for(let i of n){let s=i.type,a=i[`${s}_id`];if(!a)continue;let c=Number.parseInt(a.split("_").pop());Number.isNaN(c)||(o.counts[s]=Math.max(o.counts[s]??0,c))}}let r=new Proxy({},{get:(i,s)=>{if(s==="toArray")return()=>(n.editCount=o.editCount,n);if(s==="editCount")return o.editCount;if(s==="subtree")return(c)=>frt(function(l,h){if(!h.subcircuit_id&&!h.source_group_id)return[...l];let d=h;if(h.subcircuit_id){let A=new Set([h.subcircuit_id]),g=new Map,f=new Map;for(let x of l)if(x.type==="source_group"){let{source_group_id:C,subcircuit_id:b}=x;b&&f.set(C,b);let I=x.parent_source_group_id;I&&(g.has(I)||g.set(I,[]),g.get(I).push(C))}let y;for(let[x,C]of f)if(C===h.subcircuit_id){y=x;break}if(y){let x=(C)=>{let b=g.get(C)||[];for(let I of b){let v=f.get(I);v&&A.add(v),x(I)}};x(y),d={...h,subcircuit_ids:Array.from(A)}}}let u=new Map;for(let A of l){let g=A[`${A.type}_id`];typeof g=="string"&&u.set(g,A)}let _=new Map;for(let A of l){let g=Object.entries(A);for(let[f,y]of g)if(f!=="parent_source_group_id"){if(f.endsWith("_id")&&typeof y=="string")Qfn(_,A,u.get(y));else if(f.endsWith("_ids")&&Array.isArray(y))for(let x of y)typeof x=="string"&&Qfn(_,A,u.get(x))}}let p=[],m=new Set;for(let A of l){let g=!1;(d.subcircuit_id&&("subcircuit_id"in A)&&A.subcircuit_id===d.subcircuit_id||d.subcircuit_ids&&("subcircuit_id"in A)&&A.subcircuit_id&&d.subcircuit_ids.includes(A.subcircuit_id)||d.source_group_id&&("source_group_id"in A)&&A.source_group_id===d.source_group_id||d.source_group_id&&("member_source_group_ids"in A)&&Array.isArray(A.member_source_group_ids)&&A.member_source_group_ids.includes(d.source_group_id))&&(g=!0),g&&(p.push(A),m.add(A))}for(;p.length>0;){let A=p.shift(),g=_.get(A);if(g)for(let f of g)m.has(f)||(m.add(f),p.push(f))}return l.filter((A)=>m.has(A))}(n,c),t);if(s==="insert")return(c)=>{let l=c.type;if(!l)throw Error("insert requires an element with a type");o.counts[l]??=-1,o.counts[l]++;let h=o.counts[l],d={...c,type:l,[`${l}_id`]:`${l}_${h}`};if(t.validateInserts)(x8e[l]??w8e).parse(d);return n.push(d),o.editCount++,d};if(s==="insertAll")return(c)=>c.map((l)=>r.insert(l));let a=s;return{get:(c)=>n.find((l)=>l.type===a&&l[`${a}_id`]===c),getUsing:(c)=>{let l=Object.keys(c);if(l.length!==1)throw Error("getUsing requires exactly one key, e.g. { pcb_component_id }");let h=l[0],d=h.replace("_id",""),u=n.find((_)=>_.type===d&&_[h]===c[h]);return u?n.find((_)=>_.type===a&&_[`${a}_id`]===u[`${a}_id`]):null},getWhere:(c)=>{let l=Object.keys(c);return n.find((h)=>h.type===a&&l.every((d)=>h[d]===c[d]))},list:(c)=>{let l=c?Object.keys(c):[];return n.filter((h)=>h.type===a&&l.every((d)=>h[d]===c[d]))},insert:(c)=>{o.counts[a]??=-1,o.counts[a]++;let l=o.counts[a],h={type:a,[`${a}_id`]:`${a}_${l}`,...c};if(t.validateInserts)(x8e[a]??w8e).parse(h);return n.push(h),o.editCount++,h},delete:(c)=>{let l=n.find((h)=>h[`${a}_id`]===c);l&&(n.splice(n.indexOf(l),1),o.editCount++)},update:(c,l)=>{let h=n.find((d)=>d.type===a&&d[`${a}_id`]===c);return h?(Object.assign(h,l),o.editCount++,h):null},select:(c)=>{if(a==="source_component")return n.find((l)=>l.type==="source_component"&&l.name===c.replace(/\./g,""));if(a==="pcb_port"||a==="source_port"||a==="schematic_port"){let[l,h]=c.replace(/\./g,"").split(/[\s\>]+/),d=n.find((_)=>_.type==="source_component"&&_.name===l);if(!d)return null;let u=n.find((_)=>_.type==="source_port"&&_.source_component_id===d.source_component_id&&(_.name===h||(_.port_hints??[]).includes(h)));if(!u)return null;if(a==="source_port")return u;if(a==="pcb_port")return n.find((_)=>_.type==="pcb_port"&&_.source_port_id===u.source_port_id);if(a==="schematic_port")return n.find((_)=>_.type==="schematic_port"&&_.source_port_id===u.source_port_id)}}}}});return r};frt.unparsed=frt;function snt(e){let t=e.type;return`${t}:${e[`${t}_id`]}`}var kfn=(e,t={})=>{let n=e._internal_store_indexed;if(!n){n={counts:{},editCount:0,indexes:{}};for(let i of e){let s=i.type,a=i[`${s}_id`];if(!a)continue;let c=Number.parseInt(a.split("_").pop()||"");Number.isNaN(c)||(n.counts[s]=Math.max(n.counts[s]??0,c))}let o=t.indexConfig||{},r=n.indexes;if(o.byId&&(r.byId=new Map),o.byType&&(r.byType=new Map),o.byRelation&&(r.byRelation=new Map),o.bySubcircuit&&(r.bySubcircuit=new Map),o.byCustomField&&o.byCustomField.length>0){r.byCustomField=new Map;for(let i of o.byCustomField)r.byCustomField.set(i,new Map)}for(let i of e){if(o.byId){let s=snt(i);r.byId.set(s,i)}if(o.byType){let s=r.byType.get(i.type)||[];s.push(i),r.byType.set(i.type,s)}if(o.byRelation){let s=Object.entries(i);for(let[a,c]of s)if(a.endsWith("_id")&&a!==`${i.type}_id`&&typeof c=="string"){let l=r.byRelation.get(a)||new Map,h=l.get(c)||[];h.push(i),l.set(c,h),r.byRelation.set(a,l)}}if(o.bySubcircuit&&"subcircuit_id"in i){let s=i.subcircuit_id;if(s&&typeof s=="string"){let a=r.bySubcircuit.get(s)||[];a.push(i),r.bySubcircuit.set(s,a)}}if(o.byCustomField&&r.byCustomField){for(let s of o.byCustomField)if(s in i){let a=i[s];if(a!==void 0&&(typeof a=="string"||typeof a=="number")){let c=String(a),l=r.byCustomField.get(s),h=l.get(c)||[];h.push(i),l.set(c,h)}}}}e._internal_store_indexed=n}return new Proxy({},{get:(o,r)=>{if(r==="toArray")return()=>(e.editCount=n.editCount,e);if(r==="editCount")return n.editCount;let i=r;return{get:(s)=>{let a=t.indexConfig||{};if(a.byId&&n.indexes.byId)return n.indexes.byId.get(`${i}:${s}`)||null;if(a.byType&&n.indexes.byType)return(n.indexes.byType.get(i)||[]).find((c)=>c[`${i}_id`]===s)||null;return e.find((c)=>c.type===i&&c[`${i}_id`]===s)||null},getUsing:(s)=>{let a=t.indexConfig||{},c=Object.keys(s);if(c.length!==1)throw Error("getUsing requires exactly one key, e.g. { pcb_component_id }");let l=c[0],h=l.replace("_id","");if(a.byRelation&&n.indexes.byRelation){let u=n.indexes.byRelation.get(l);if(u){let _=(u.get(s[l])||[]).find((m)=>m.type===h);if(!_)return null;let p=_[`${i}_id`];if(a.byId&&n.indexes.byId)return n.indexes.byId.get(`${i}:${p}`)||null;if(a.byType&&n.indexes.byType)return(n.indexes.byType.get(i)||[]).find((m)=>m[`${i}_id`]===p)||null;return e.find((m)=>m.type===i&&m[`${i}_id`]===p)||null}}let d=e.find((u)=>u.type===h&&u[l]===s[l]);return d&&e.find((u)=>u.type===i&&u[`${i}_id`]===d[`${i}_id`])||null},getWhere:(s)=>{let a=t.indexConfig||{},c=Object.keys(s);if(c.length===1&&a.byCustomField&&n.indexes.byCustomField){let l=c[0],h=n.indexes.byCustomField.get(l);if(h){let d=String(s[l]);return(h.get(d)||[]).find((u)=>u.type===i)||null}}if("subcircuit_id"in s&&a.bySubcircuit&&n.indexes.bySubcircuit){let l=s.subcircuit_id;return(n.indexes.bySubcircuit.get(l)||[]).find((h)=>h.type===i&&c.every((d)=>h[d]===s[d]))||null}if(a.byType&&n.indexes.byType)return(n.indexes.byType.get(i)||[]).find((l)=>c.every((h)=>l[h]===s[h]))||null;return e.find((l)=>l.type===i&&c.every((h)=>l[h]===s[h]))||null},list:(s)=>{let a=t.indexConfig||{},c=s?Object.keys(s):[];if(c.length===0&&a.byType&&n.indexes.byType)return n.indexes.byType.get(i)||[];if(c.length===1&&c[0]==="subcircuit_id"&&a.bySubcircuit&&n.indexes.bySubcircuit){let h=s.subcircuit_id;return(n.indexes.bySubcircuit.get(h)||[]).filter((d)=>d.type===i)}let l;return l=a.byType&&n.indexes.byType?n.indexes.byType.get(i)||[]:e.filter((h)=>h.type===i),c.length>0?l.filter((h)=>c.every((d)=>h[d]===s[d])):l},insert:(s)=>{n.counts[i]??=-1,n.counts[i]++;let a=n.counts[i],c={type:i,[`${i}_id`]:`${i}_${a}`,...s};if(t.validateInserts)(x8e[i]??w8e).parse(c);e.push(c),n.editCount++;let l=t.indexConfig||{};if(l.byId&&n.indexes.byId){let h=snt(c);n.indexes.byId.set(h,c)}if(l.byType&&n.indexes.byType){let h=n.indexes.byType.get(i)||[];h.push(c),n.indexes.byType.set(i,h)}if(l.byRelation&&n.indexes.byRelation){let h=Object.entries(c);for(let[d,u]of h)if(d.endsWith("_id")&&d!==`${c.type}_id`&&typeof u=="string"){let _=n.indexes.byRelation.get(d)||new Map,p=_.get(u)||[];p.push(c),_.set(u,p),n.indexes.byRelation.set(d,_)}}if(l.bySubcircuit&&n.indexes.bySubcircuit&&"subcircuit_id"in c){let h=c.subcircuit_id;if(h&&typeof h=="string"){let d=n.indexes.bySubcircuit.get(h)||[];d.push(c),n.indexes.bySubcircuit.set(h,d)}}if(l.byCustomField&&n.indexes.byCustomField){for(let h of l.byCustomField)if(h in c){let d=c[h];if(d!==void 0&&(typeof d=="string"||typeof d=="number")){let u=String(d),_=n.indexes.byCustomField.get(h),p=_.get(u)||[];p.push(c),_.set(u,p)}}}return c},delete:(s)=>{let a=t.indexConfig||{},c;if(a.byId&&n.indexes.byId)c=n.indexes.byId.get(`${i}:${s}`);else if(a.byType&&n.indexes.byType)c=(n.indexes.byType.get(i)||[]).find((d)=>d[`${i}_id`]===s);else c=e.find((h)=>h[`${i}_id`]===s);if(!c)return;let l=e.indexOf(c);if(l>=0&&(e.splice(l,1),n.editCount++),a.byId&&n.indexes.byId){let h=snt(c);n.indexes.byId.delete(h)}if(a.byType&&n.indexes.byType){let h=(n.indexes.byType.get(i)||[]).filter((d)=>d[`${i}_id`]!==s);n.indexes.byType.set(i,h)}if(a.byRelation&&n.indexes.byRelation)for(let[h,d]of n.indexes.byRelation.entries())for(let[u,_]of d.entries()){let p=_.filter((m)=>m!==c);p.length===0?d.delete(u):d.set(u,p)}if(a.bySubcircuit&&n.indexes.bySubcircuit&&"subcircuit_id"in c){let h=c.subcircuit_id;if(h){let d=(n.indexes.bySubcircuit.get(h)||[]).filter((u)=>u!==c);d.length===0?n.indexes.bySubcircuit.delete(h):n.indexes.bySubcircuit.set(h,d)}}if(a.byCustomField&&n.indexes.byCustomField)for(let h of n.indexes.byCustomField.values())for(let[d,u]of h.entries()){let _=u.filter((p)=>p!==c);_.length===0?h.delete(d):h.set(d,_)}},update:(s,a)=>{let c=t.indexConfig||{},l;if(c.byId&&n.indexes.byId)l=n.indexes.byId.get(`${i}:${s}`);else if(c.byType&&n.indexes.byType)l=(n.indexes.byType.get(i)||[]).find((d)=>d[`${i}_id`]===s);else l=e.find((h)=>h.type===i&&h[`${i}_id`]===s);if(!l)return null;if(c.byRelation&&n.indexes.byRelation){let h=Object.entries(l);for(let[d,u]of h)if(d.endsWith("_id")&&d!==`${l.type}_id`&&typeof u=="string"&&d in a&&a[d]!==u){let _=n.indexes.byRelation.get(d);if(_){let p=(_.get(u)||[]).filter((m)=>m!==l);p.length===0?_.delete(u):_.set(u,p)}}}if(c.bySubcircuit&&n.indexes.bySubcircuit&&"subcircuit_id"in l&&"subcircuit_id"in a){let h=l.subcircuit_id;if(h!==a.subcircuit_id){let d=(n.indexes.bySubcircuit.get(h)||[]).filter((u)=>u!==l);d.length===0?n.indexes.bySubcircuit.delete(h):n.indexes.bySubcircuit.set(h,d)}}if(c.byCustomField&&n.indexes.byCustomField){for(let h of c.byCustomField)if(h in l&&h in a&&l[h]!==a[h]){let d=n.indexes.byCustomField.get(h);if(d){let u=String(l[h]),_=(d.get(u)||[]).filter((p)=>p!==l);_.length===0?d.delete(u):d.set(u,_)}}}if(Object.assign(l,a),n.editCount++,c.byRelation&&n.indexes.byRelation){let h=Object.entries(l);for(let[d,u]of h)if(d.endsWith("_id")&&d!==`${l.type}_id`&&typeof u=="string"&&d in a){let _=n.indexes.byRelation.get(d)||new Map,p=_.get(u)||[];p.includes(l)||(p.push(l),_.set(u,p),n.indexes.byRelation.set(d,_))}}if(c.bySubcircuit&&n.indexes.bySubcircuit&&"subcircuit_id"in l&&"subcircuit_id"in a){let h=l.subcircuit_id;if(h&&typeof h=="string"){let d=n.indexes.bySubcircuit.get(h)||[];d.includes(l)||(d.push(l),n.indexes.bySubcircuit.set(h,d))}}if(c.byCustomField&&n.indexes.byCustomField){for(let h of c.byCustomField)if(h in l&&h in a){let d=l[h];if(d!==void 0&&(typeof d=="string"||typeof d=="number")){let u=String(d),_=n.indexes.byCustomField.get(h),p=_.get(u)||[];p.includes(l)||(p.push(l),_.set(u,p))}}}return l},select:(s)=>{if(i==="source_component")return e.find((a)=>a.type==="source_component"&&a.name===s.replace(/\./g,""))||null;if(i==="pcb_port"||i==="source_port"||i==="schematic_port"){let[a,c]=s.replace(/\./g,"").split(/[\s\>]+/),l=e.find((d)=>d.type==="source_component"&&d.name===a);if(!l)return null;let h=e.find((d)=>d.type==="source_port"&&d.source_component_id===l.source_component_id&&(d.name===c||(d.port_hints??[]).includes(c)));if(!h)return null;if(i==="source_port")return h;if(i==="pcb_port")return e.find((d)=>d.type==="pcb_port"&&d.source_port_id===h.source_port_id)||null;if(i==="schematic_port")return e.find((d)=>d.type==="schematic_port"&&d.source_port_id===h.source_port_id)||null}return null}}}})};kfn.unparsed=kfn;var H9n={Hz:{baseUnit:"Hz",variants:{MHz:1e6,kHz:1000,Hz:1}},g:{baseUnit:"g",variants:{kg:1000,g:1}},"Ω":{baseUnit:"Ω",variants:{"mΩ":0.001,"Ω":1,"kΩ":1000,"KΩ":1000,kohm:1000,"MΩ":1e6,"GΩ":1e9,"TΩ":1000000000000}},V:{baseUnit:"V",variants:{mV:0.001,V:1,kV:1000,KV:1000,MV:1e6,GV:1e9,TV:1000000000000}},A:{baseUnit:"A",variants:{"µA":0.000001,mA:0.001,ma:0.001,A:1,kA:1000,MA:1e6}},F:{baseUnit:"F",variants:{pF:0.000000000001,nF:0.000000001,"µF":0.000001,uF:0.000001,mF:0.001,F:1}},ml:{baseUnit:"ml",variants:{ml:1,mL:1,l:1000,L:1000}},deg:{baseUnit:"deg",variants:{rad:180/Math.PI}},ms:{baseUnit:"ms",variants:{fs:0.000000000001,ps:0.000000001,ns:0.000001,us:0.001,"µs":0.001,ms:1,s:1000}},mm:{baseUnit:"mm",variants:{nm:0.000001,"µm":0.001,um:0.001,mm:1,cm:10,dm:100,m:1000,km:1e6,in:25.4,ft:304.8,IN:25.4,FT:304.8,yd:914.4,mi:1609344,mil:0.0254}}},yrt=new Set;for(let[e,t]of Object.entries(H9n)){yrt.add(e);for(let n of Object.keys(t.variants))yrt.add(n)}var Lfn={tera:1000000000000,T:1000000000000,giga:1e9,G:1e9,mega:1e6,M:1e6,kilo:1000,k:1000,deci:0.1,d:0.1,centi:0.01,c:0.01,milli:0.001,m:0.001,micro:0.000001,u:0.000001,"µ":0.000001,nano:0.000000001,n:0.000000001,pico:0.000000000001,p:0.000000000001};function N9(e){if(e==null)return{parsedUnit:null,unitOfValue:null,value:null};if(typeof e=="string"&&e.match(/^-?[\d\.]+$/))return{value:Number.parseFloat(e),parsedUnit:null,unitOfValue:null};if(typeof e=="number")return{value:e,parsedUnit:null,unitOfValue:null};if(typeof e=="object"&&"x"in e&&"y"in e){let{parsedUnit:a,unitOfValue:c}=N9(e.x),l=N9(e.x),h=N9(e.y);return l.value===null||h.value===null?{parsedUnit:null,unitOfValue:null,value:null}:{parsedUnit:a,unitOfValue:c,value:{x:l.value,y:h.value}}}let t=e.toString().split("").reverse().join(""),n=t.match(/[^\d\s]+/)?.[0];if(!n)throw Error(`Could not determine unit: "${e}"`);let o=n.split("").reverse().join(""),r=e.slice(0,-o.length);if(o in Lfn&&!yrt.has(o)){let a=Lfn[o];return{parsedUnit:null,unitOfValue:null,value:Number.parseFloat(r)*a}}let{baseUnit:i,conversionFactor:s}=function(a){for(let[c,l]of Object.entries(H9n))if(a in l.variants)return{baseUnit:l.baseUnit,conversionFactor:l.variants[a]};return{baseUnit:a,conversionFactor:1}}(o);return{parsedUnit:o,unitOfValue:i,value:s*Number.parseFloat(r)}}var $st=F.string().or(F.number()).transform((e)=>N9(e).value),F9n=F.string().or(F.number()).transform((e)=>N9(e).value).transform((e)=>Number.parseFloat(e.toPrecision(12))),OXr=F.string().or(F.number()).transform((e)=>N9(e).value),Dk=F.string().or(F.number()).transform((e)=>N9(e).value),dr=F.string().or(F.number()).transform((e)=>N9(e).value),wZ=F.string().or(F.number()).transform((e)=>N9(e).value),jn=dr,sue=F.string().or(F.number()).transform((e)=>N9(e).value),qst=F.string().or(F.number()).transform((e)=>N9(e).value),hZ=qst,VXr=F.string().datetime(),p_=F.string().or(F.number()).transform((e)=>typeof e=="number"?e:e.endsWith("deg")?Number.parseFloat(e.split("deg")[0]):e.endsWith("rad")?180*Number.parseFloat(e.split("rad")[0])/Math.PI:Number.parseFloat(e)),YXr=F.number().or(F.string().endsWith("mAh")).transform((e)=>{if(typeof e=="string"){let t=e.replace("mAh",""),n=Number.parseFloat(t);if(Number.isNaN(n))throw Error("Invalid capacity");return n}return e}).describe("Battery capacity in mAh"),qr=F.object({x:jn,y:jn}),pY=F.object({x:jn,y:jn,z:jn}),z9n=F.object({width:F.number(),height:F.number()}),Ao=(e)=>F.string().optional().default(()=>`${e}_${((t)=>Array.from({length:t},()=>"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"[Math.floor(62*Math.random())]).join(""))(10)}`),Gk=F.enum(["top_left","top_center","top_right","center_left","center","center_right","bottom_left","bottom_center","bottom_right"]),GXr=(F.enum(["top_silkscreen","bottom_silkscreen","top_copper","bottom_copper","top_soldermask","bottom_soldermask","top_fabrication_note","bottom_fabrication_note","top_user_note","bottom_user_note","top_courtyard","bottom_courtyard","inner1_copper","inner2_copper","inner3_copper","inner4_copper","inner5_copper","inner6_copper","edge_cuts","drill"]),F.object({project_relative_path:F.string(),url:F.string(),mimetype:F.string()})),Jst=qr.extend({rotation:p_.optional()}),O9n=F.object({size:qr.optional(),thickness:jn.optional()}),UXr=F.object({font:O9n.optional()}),O9e=F.object({value:F.string(),at:Jst.optional(),layer:F.string().optional(),uuid:F.string().optional(),hide:F.boolean().optional(),effects:UXr.optional()}),WXr=F.object({Reference:O9e.optional(),Value:O9e.optional(),Datasheet:O9e.optional(),Description:O9e.optional()}),XXr=F.object({through_hole:F.boolean().optional(),smd:F.boolean().optional(),exclude_from_pos_files:F.boolean().optional(),exclude_from_bom:F.boolean().optional()}),jXr=F.object({name:F.string(),type:F.string(),shape:F.string().optional(),at:Jst.optional(),size:qr.optional(),drill:jn.optional(),layers:F.array(F.string()).optional(),removeUnusedLayers:F.boolean().optional(),uuid:F.string().optional()}),KXr=F.object({path:F.string(),offset:pY.optional(),scale:pY.optional(),rotate:pY.optional()}),$Xr=F.object({footprintName:F.string().optional(),version:F.union([F.number(),F.string()]).optional(),generator:F.string().optional(),generatorVersion:F.union([F.number(),F.string()]).optional(),layer:F.string().optional(),properties:WXr.optional(),attributes:XXr.optional(),pads:F.array(jXr).optional(),embeddedFonts:F.boolean().optional(),model:KXr.optional()}),qXr=F.object({hide:F.boolean().optional()}),JXr=F.object({offset:jn.optional(),hide:F.boolean().optional()}),ZXr=F.object({font:O9n.optional(),justify:F.union([F.string(),F.array(F.string())]).optional(),hide:F.boolean().optional()}),WV=F.object({value:F.string(),id:F.union([F.number(),F.string()]).optional(),at:Jst.optional(),effects:ZXr.optional()}),ejr=F.object({Reference:WV.optional(),Value:WV.optional(),Footprint:WV.optional(),Datasheet:WV.optional(),Description:WV.optional(),ki_keywords:WV.optional(),ki_fp_filters:WV.optional()}),tjr=F.object({symbolName:F.string().optional(),extends:F.string().optional(),pinNumbers:qXr.optional(),pinNames:JXr.optional(),excludeFromSim:F.boolean().optional(),inBom:F.boolean().optional(),onBoard:F.boolean().optional(),properties:ejr.optional(),embeddedFonts:F.boolean().optional()}),Ch=F.object({error_type:F.string(),message:F.string(),is_fatal:F.boolean().optional()}),V9n=F.enum(["jlcpcb","macrofab","pcbway","digikey","mouser","lcsc"]),pu=F.object({type:F.literal("source_component"),ftype:F.string().optional(),source_component_id:F.string(),name:F.string(),manufacturer_part_number:F.string().optional(),supplier_part_numbers:F.record(V9n,F.array(F.string())).optional(),display_value:F.string().optional(),display_name:F.string().optional(),are_pins_interchangeable:F.boolean().optional(),internally_connected_source_port_ids:F.array(F.array(F.string())).optional(),source_group_id:F.string().optional(),subcircuit_id:F.string().optional()}),Y9n=pu.extend({ftype:F.literal("simple_capacitor"),capacitance:F9n,max_voltage_rating:Dk.optional(),display_capacitance:F.string().optional(),max_decoupling_trace_length:jn.optional()}),G9n=pu.extend({ftype:F.literal("simple_resistor"),resistance:$st,display_resistance:F.string().optional()}),Zst=pu.extend({ftype:F.literal("simple_diode")}),njr=pu.extend({ftype:F.literal("simple_fiducial")}),U9n=Zst.extend({ftype:F.literal("simple_led"),color:F.string().optional(),wavelength:F.string().optional()}),ojr=pu.extend({ftype:F.literal("simple_ground")}),W9n=pu.extend({ftype:F.literal("simple_chip")}),X9n=pu.extend({ftype:F.literal("simple_power_source"),voltage:Dk}),rjr=pu.extend({ftype:F.literal("simple_current_source"),current:sue,frequency:wZ.optional(),peak_to_peak_current:sue.optional(),wave_shape:F.enum(["sine","square","triangle","sawtooth","dc"]).optional().default("dc"),phase:F.number().optional(),duty_cycle:F.number().min(0).max(1).optional()}),ijr=F.object({must_be_connected:F.boolean().optional(),provides_power:F.boolean().optional(),requires_power:F.boolean().optional(),provides_ground:F.boolean().optional(),requires_ground:F.boolean().optional(),provides_voltage:F.union([F.string(),F.number()]).optional(),requires_voltage:F.union([F.string(),F.number()]).optional(),do_not_connect:F.boolean().optional(),include_in_board_pinout:F.boolean().optional(),can_use_internal_pullup:F.boolean().optional(),is_using_internal_pullup:F.boolean().optional(),needs_external_pullup:F.boolean().optional(),can_use_internal_pulldown:F.boolean().optional(),is_using_internal_pulldown:F.boolean().optional(),needs_external_pulldown:F.boolean().optional(),can_use_open_drain:F.boolean().optional(),is_using_open_drain:F.boolean().optional(),can_use_push_pull:F.boolean().optional(),is_using_push_pull:F.boolean().optional(),should_have_decoupling_capacitor:F.boolean().optional(),recommended_decoupling_capacitor_capacitance:F.union([F.string(),F.number()]).optional(),is_configured_for_i2c_sda:F.boolean().optional(),is_configured_for_i2c_scl:F.boolean().optional(),is_configured_for_spi_mosi:F.boolean().optional(),is_configured_for_spi_miso:F.boolean().optional(),is_configured_for_spi_sck:F.boolean().optional(),is_configured_for_spi_cs:F.boolean().optional(),is_configured_for_uart_tx:F.boolean().optional(),is_configured_for_uart_rx:F.boolean().optional(),supports_i2c_sda:F.boolean().optional(),supports_i2c_scl:F.boolean().optional(),supports_spi_mosi:F.boolean().optional(),supports_spi_miso:F.boolean().optional(),supports_spi_sck:F.boolean().optional(),supports_spi_cs:F.boolean().optional(),supports_uart_tx:F.boolean().optional(),supports_uart_rx:F.boolean().optional()}),sjr=pu.extend({ftype:F.literal("simple_fuse"),current_rating_amps:F.number().describe("Nominal current in amps the fuse is rated for"),voltage_rating_volts:F.number().describe("Voltage rating in volts, e.g. ±5V would be 5")}),j9n=pu.extend({ftype:F.literal("simple_battery"),capacity:YXr}),K9n=pu.extend({ftype:F.literal("simple_inductor"),inductance:OXr,display_inductance:F.string().optional(),max_current_rating:F.number().optional()}),$9n=pu.extend({ftype:F.literal("simple_push_button")}),q9n=pu.extend({ftype:F.literal("simple_potentiometer"),max_resistance:$st,display_max_resistance:F.string().optional()}),ajr=pu.extend({ftype:F.literal("simple_crystal"),frequency:F.number().describe("Frequency in Hz"),load_capacitance:F.number().optional().describe("Load capacitance in pF"),pin_variant:F.enum(["two_pin","four_pin"]).optional()}),J9n=pu.extend({ftype:F.literal("simple_pin_header"),pin_count:F.number(),gender:F.enum(["male","female"]).optional().default("male")}),cjr=pu.extend({ftype:F.literal("simple_connector"),standard:F.enum(["usb_c","m2"]).optional()}),Z9n=pu.extend({ftype:F.literal("simple_pinout")}),evn=pu.extend({ftype:F.literal("simple_resonator"),load_capacitance:F9n,equivalent_series_resistance:$st.optional(),frequency:wZ}),tvn=pu.extend({ftype:F.literal("simple_transistor"),transistor_type:F.enum(["npn","pnp"])}),nvn=pu.extend({ftype:F.literal("simple_test_point"),footprint_variant:F.enum(["pad","through_hole"]).optional(),pad_shape:F.enum(["rect","circle"]).optional(),pad_diameter:F.union([F.number(),F.string()]).optional(),hole_diameter:F.union([F.number(),F.string()]).optional(),width:F.union([F.number(),F.string()]).optional(),height:F.union([F.number(),F.string()]).optional()}),ovn=pu.extend({ftype:F.literal("simple_mosfet"),channel_type:F.enum(["n","p"]),mosfet_mode:F.enum(["enhancement","depletion"])}),rvn=pu.extend({ftype:F.literal("simple_op_amp")}),ivn=pu.extend({ftype:F.literal("simple_switch")}),svn=F.object({type:F.literal("source_project_metadata"),name:F.string().optional(),software_used_string:F.string().optional(),project_url:F.string().optional(),created_at:VXr.optional()}),ljr=Ch.extend({type:F.literal("source_missing_property_error"),source_missing_property_error_id:Ao("source_missing_property_error"),source_component_id:F.string(),property_name:F.string(),subcircuit_id:F.string().optional(),error_type:F.literal("source_missing_property_error").default("source_missing_property_error")}).describe("The source code is missing a property"),hjr=Ch.extend({type:F.literal("source_failed_to_create_component_error"),source_failed_to_create_component_error_id:Ao("source_failed_to_create_component_error"),error_type:F.literal("source_failed_to_create_component_error").default("source_failed_to_create_component_error"),component_name:F.string().optional(),subcircuit_id:F.string().optional(),parent_source_component_id:F.string().optional(),pcb_center:F.object({x:F.number().optional(),y:F.number().optional()}).optional(),schematic_center:F.object({x:F.number().optional(),y:F.number().optional()}).optional()}).describe("Error emitted when a component fails to be constructed"),avn=Ch.extend({type:F.literal("source_invalid_component_property_error"),source_invalid_component_property_error_id:Ao("source_invalid_component_property_error"),source_component_id:F.string(),property_name:F.string(),property_value:F.unknown().optional(),expected_format:F.string().optional(),subcircuit_id:F.string().optional(),error_type:F.literal("source_invalid_component_property_error").default("source_invalid_component_property_error")}).describe("The source component property is invalid"),cvn=Ch.extend({type:F.literal("source_trace_not_connected_error"),source_trace_not_connected_error_id:Ao("source_trace_not_connected_error"),error_type:F.literal("source_trace_not_connected_error").default("source_trace_not_connected_error"),subcircuit_id:F.string().optional(),source_group_id:F.string().optional(),source_trace_id:F.string().optional(),connected_source_port_ids:F.array(F.string()).optional(),selectors_not_found:F.array(F.string()).optional()}).describe("Occurs when a source trace selector does not match any ports"),djr=F.object({type:F.literal("source_property_ignored_warning"),source_property_ignored_warning_id:Ao("source_property_ignored_warning"),source_component_id:F.string(),property_name:F.string(),subcircuit_id:F.string().optional(),error_type:F.literal("source_property_ignored_warning").default("source_property_ignored_warning"),message:F.string()}).describe("The source property was ignored"),lvn=F.object({type:F.literal("source_pin_missing_trace_warning"),source_pin_missing_trace_warning_id:Ao("source_pin_missing_trace_warning"),warning_type:F.literal("source_pin_missing_trace_warning").default("source_pin_missing_trace_warning"),message:F.string(),source_component_id:F.string(),source_port_id:F.string(),subcircuit_id:F.string().optional()}).describe("Warning emitted when a source component pin is missing a trace connection"),hvn=F.object({type:F.literal("source_missing_manufacturer_part_number_warning"),source_missing_manufacturer_part_number_warning_id:Ao("source_missing_manufacturer_part_number_warning"),warning_type:F.literal("source_missing_manufacturer_part_number_warning").default("source_missing_manufacturer_part_number_warning"),message:F.string(),source_component_id:F.string(),standard:F.string(),subcircuit_id:F.string().optional()}).describe("Warning emitted when a standard connector is missing manufacturer part number"),ujr=pu.extend({ftype:F.literal("simple_voltage_probe")}),pjr=pu.extend({ftype:F.literal("interconnect")}),dvn=Ch.extend({type:F.literal("source_i2c_misconfigured_error"),source_i2c_misconfigured_error_id:Ao("source_i2c_misconfigured_error"),error_type:F.literal("source_i2c_misconfigured_error").default("source_i2c_misconfigured_error"),source_port_ids:F.array(F.string())}).describe("Error emitted when incompatible I2C pins (e.g. SDA and SCL) are connected to the same net"),mjr=pu.extend({ftype:F.literal("simple_voltage_source"),voltage:Dk,frequency:wZ.optional(),peak_to_peak_voltage:Dk.optional(),wave_shape:F.enum(["sinewave","square","triangle","sawtooth"]).optional(),phase:p_.optional(),duty_cycle:F.number().optional().describe("Duty cycle as a fraction (0 to 1)")}),_jr=F.union([G9n,Y9n,Zst,njr,U9n,ojr,W9n,X9n,rjr,j9n,K9n,$9n,q9n,ajr,J9n,cjr,Z9n,evn,ivn,tvn,nvn,ovn,rvn,sjr,ujr,pjr,mjr,svn,ljr,avn,hjr,cvn,djr,lvn,hvn,dvn]),gjr=F.object({type:F.literal("source_port"),pin_number:F.number().optional(),port_hints:F.array(F.string()).optional(),name:F.string(),source_port_id:F.string(),source_component_id:F.string().optional(),source_group_id:F.string().optional(),most_frequently_referenced_by_name:F.string().optional(),subcircuit_id:F.string().optional(),subcircuit_connectivity_map_key:F.string().optional()}).merge(ijr),Ajr=F.object({type:F.literal("source_component_internal_connection"),source_component_internal_connection_id:F.string(),source_component_id:F.string(),source_port_ids:F.array(F.string()),subcircuit_id:F.string().optional()}),fjr=F.object({type:F.literal("source_trace"),source_trace_id:F.string(),connected_source_port_ids:F.array(F.string()),connected_source_net_ids:F.array(F.string()),subcircuit_id:F.string().optional(),subcircuit_connectivity_map_key:F.string().optional(),max_length:F.number().optional(),min_trace_thickness:F.number().optional(),display_name:F.string().optional()}),yjr=F.object({type:F.literal("source_group"),source_group_id:F.string(),subcircuit_id:F.string().optional(),parent_subcircuit_id:F.string().optional(),parent_source_group_id:F.string().optional(),is_subcircuit:F.boolean().optional(),show_as_schematic_box:F.boolean().optional(),name:F.string().optional(),was_automatically_named:F.boolean().optional()}),xjr=F.object({type:F.literal("source_net"),source_net_id:F.string(),name:F.string(),member_source_group_ids:F.array(F.string()),is_power:F.boolean().optional(),is_ground:F.boolean().optional(),is_digital_signal:F.boolean().optional(),is_analog_signal:F.boolean().optional(),is_positive_voltage_source:F.boolean().optional(),trace_width:F.number().optional(),subcircuit_id:F.string().optional(),subcircuit_connectivity_map_key:F.string().optional()}),Cjr=F.object({type:F.literal("source_board"),source_board_id:F.string(),source_group_id:F.string(),title:F.string().optional()}).describe("Defines a board in the source domain"),bjr=Ch.extend({type:F.literal("source_ambiguous_port_reference"),source_ambiguous_port_reference_id:Ao("source_ambiguous_port_reference"),error_type:F.literal("source_ambiguous_port_reference").default("source_ambiguous_port_reference"),source_port_id:F.string().optional(),source_component_id:F.string().optional()}).describe("Error emitted when a port hint matches multiple non-overlapping pads, making the port reference ambiguous"),Ijr=F.object({type:F.literal("source_pcb_ground_plane"),source_pcb_ground_plane_id:F.string(),source_group_id:F.string(),source_net_id:F.string(),subcircuit_id:F.string().optional()}).describe("Defines a ground plane in the source domain"),vjr=["top","bottom","inner1","inner2","inner3","inner4","inner5","inner6"],Hfn=F.enum(vjr),vc=Hfn.or(F.object({name:Hfn})).transform((e)=>typeof e=="string"?e:e.name),j2=F.enum(["top","bottom"]),Sjr=F.object({type:F.literal("source_manually_placed_via"),source_manually_placed_via_id:F.string(),source_group_id:F.string(),source_net_id:F.string(),subcircuit_id:F.string().optional(),source_trace_id:F.string().optional()}).describe("Defines a via that is manually placed in the source domain"),Pjr=F.object({type:F.literal("source_no_power_pin_defined_warning"),source_no_power_pin_defined_warning_id:Ao("source_no_power_pin_defined_warning"),warning_type:F.literal("source_no_power_pin_defined_warning").default("source_no_power_pin_defined_warning"),message:F.string(),source_component_id:F.string(),source_port_ids:F.array(F.string()),subcircuit_id:F.string().optional()}).describe("Warning emitted when a chip has no source ports with requires_power=true"),Ejr=F.object({type:F.literal("source_no_ground_pin_defined_warning"),source_no_ground_pin_defined_warning_id:Ao("source_no_ground_pin_defined_warning"),warning_type:F.literal("source_no_ground_pin_defined_warning").default("source_no_ground_pin_defined_warning"),message:F.string(),source_component_id:F.string(),source_port_ids:F.array(F.string()),subcircuit_id:F.string().optional()}).describe("Warning emitted when a chip has no source ports marked as ground pins"),Mjr=F.object({type:F.literal("source_component_pins_underspecified_warning"),source_component_pins_underspecified_warning_id:Ao("source_component_pins_underspecified_warning"),warning_type:F.literal("source_component_pins_underspecified_warning").default("source_component_pins_underspecified_warning"),message:F.string(),source_component_id:F.string(),source_port_ids:F.array(F.string()),subcircuit_id:F.string().optional()}).describe("Warning emitted when all ports on a source component are underspecified"),wjr=Ch.extend({type:F.literal("source_pin_must_be_connected_error"),source_pin_must_be_connected_error_id:Ao("source_pin_must_be_connected_error"),error_type:F.literal("source_pin_must_be_connected_error").default("source_pin_must_be_connected_error"),source_component_id:F.string(),source_port_id:F.string(),subcircuit_id:F.string().optional()}).describe("Error emitted when a pin with mustBeConnected attribute is not connected to any trace"),Bjr=Ch.extend({type:F.literal("unknown_error_finding_part"),unknown_error_finding_part_id:Ao("unknown_error_finding_part"),error_type:F.literal("unknown_error_finding_part").default("unknown_error_finding_part"),source_component_id:F.string().optional(),subcircuit_id:F.string().optional()}).describe("Error emitted when an unexpected error occurs while finding a part"),Tjr=F.object({type:F.literal("schematic_box"),schematic_component_id:F.string().optional(),schematic_symbol_id:F.string().optional(),width:jn,height:jn,is_dashed:F.boolean().default(!1),x:jn,y:jn,subcircuit_id:F.string().optional()}).describe("Draws a box on the schematic"),Djr=F.object({type:F.literal("schematic_path"),schematic_path_id:Ao("schematic_path"),schematic_component_id:F.string().optional(),schematic_symbol_id:F.string().optional(),fill_color:F.string().optional(),is_filled:F.boolean().optional(),stroke_width:jn.nullable().optional(),stroke_color:F.string().optional(),points:F.array(qr),subcircuit_id:F.string().optional()}),Njr=F.record(F.object({left_margin:dr.optional(),right_margin:dr.optional(),top_margin:dr.optional(),bottom_margin:dr.optional()})),Rjr=F.object({left_size:F.number(),right_size:F.number(),top_size:F.number().optional(),bottom_size:F.number().optional()}),Qjr=F.object({left_side:F.object({pins:F.array(F.number()),direction:F.enum(["top-to-bottom","bottom-to-top"]).optional()}).optional(),right_side:F.object({pins:F.array(F.number()),direction:F.enum(["top-to-bottom","bottom-to-top"]).optional()}).optional(),top_side:F.object({pins:F.array(F.number()),direction:F.enum(["left-to-right","right-to-left"]).optional()}).optional(),bottom_side:F.object({pins:F.array(F.number()),direction:F.enum(["left-to-right","right-to-left"]).optional()}).optional()}),kjr=F.union([Rjr,Qjr]),Ljr=F.object({type:F.literal("schematic_component"),size:z9n,center:qr,source_component_id:F.string().optional(),schematic_component_id:F.string(),schematic_symbol_id:F.string().optional(),pin_spacing:dr.optional(),pin_styles:Njr.optional(),box_width:dr.optional(),symbol_name:F.string().optional(),port_arrangement:kjr.optional(),port_labels:F.record(F.string()).optional(),symbol_display_value:F.string().optional(),subcircuit_id:F.string().optional(),schematic_group_id:F.string().optional(),is_schematic_group:F.boolean().optional(),source_group_id:F.string().optional(),is_box_with_pins:F.boolean().optional().default(!0)}),Hjr=F.object({kicad_symbol:tjr.optional()}).catchall(F.unknown()),Fjr=F.object({type:F.literal("schematic_symbol"),schematic_symbol_id:F.string(),name:F.string().optional(),metadata:Hjr.optional()}).describe("Defines a named schematic symbol that can be referenced by components."),zjr=F.object({type:F.literal("schematic_line"),schematic_line_id:Ao("schematic_line"),schematic_component_id:F.string().optional(),schematic_symbol_id:F.string().optional(),x1:jn,y1:jn,x2:jn,y2:jn,stroke_width:jn.nullable().optional(),color:F.string().default("#000000"),is_dashed:F.boolean().default(!1),subcircuit_id:F.string().optional()}).describe("Draws a styled line on the schematic"),Ojr=F.object({type:F.literal("schematic_rect"),schematic_rect_id:Ao("schematic_rect"),schematic_component_id:F.string().optional(),schematic_symbol_id:F.string().optional(),center:qr,width:jn,height:jn,rotation:p_.default(0),stroke_width:jn.nullable().optional(),color:F.string().default("#000000"),is_filled:F.boolean().default(!1),fill_color:F.string().optional(),is_dashed:F.boolean().default(!1),subcircuit_id:F.string().optional()}).describe("Draws a styled rectangle on the schematic"),Vjr=F.object({type:F.literal("schematic_circle"),schematic_circle_id:Ao("schematic_circle"),schematic_component_id:F.string().optional(),schematic_symbol_id:F.string().optional(),center:qr,radius:jn,stroke_width:jn.nullable().optional(),color:F.string().default("#000000"),is_filled:F.boolean().default(!1),fill_color:F.string().optional(),is_dashed:F.boolean().default(!1),subcircuit_id:F.string().optional()}).describe("Draws a styled circle on the schematic"),Yjr=F.object({type:F.literal("schematic_arc"),schematic_arc_id:Ao("schematic_arc"),schematic_component_id:F.string().optional(),schematic_symbol_id:F.string().optional(),center:qr,radius:jn,start_angle_degrees:p_,end_angle_degrees:p_,direction:F.enum(["clockwise","counterclockwise"]).default("counterclockwise"),stroke_width:jn.nullable().optional(),color:F.string().default("#000000"),is_dashed:F.boolean().default(!1),subcircuit_id:F.string().optional()}).describe("Draws a styled arc on the schematic"),Gjr=F.object({type:F.literal("schematic_trace"),schematic_trace_id:F.string(),source_trace_id:F.string().optional(),junctions:F.array(F.object({x:F.number(),y:F.number()})),edges:F.array(F.object({from:F.object({x:F.number(),y:F.number()}),to:F.object({x:F.number(),y:F.number()}),is_crossing:F.boolean().optional(),from_schematic_port_id:F.string().optional(),to_schematic_port_id:F.string().optional()})),subcircuit_id:F.string().optional(),subcircuit_connectivity_map_key:F.string().optional()}),Ujr=F.enum(["center","left","right","top","bottom"]),Wjr=F.object({type:F.literal("schematic_text"),schematic_component_id:F.string().optional(),schematic_symbol_id:F.string().optional(),schematic_text_id:F.string(),text:F.string(),font_size:F.number().default(0.18),position:F.object({x:jn,y:jn}),rotation:F.number().default(0),anchor:F.union([Ujr.describe("legacy"),Gk]).default("center"),color:F.string().default("#000000"),subcircuit_id:F.string().optional()}),Xjr=F.object({type:F.literal("schematic_port"),schematic_port_id:F.string(),source_port_id:F.string(),schematic_component_id:F.string().optional(),center:qr,facing_direction:F.enum(["up","down","left","right"]).optional(),distance_from_component_edge:F.number().optional(),side_of_component:F.enum(["top","bottom","left","right"]).optional(),true_ccw_index:F.number().optional(),pin_number:F.number().optional(),display_pin_label:F.string().optional(),subcircuit_id:F.string().optional(),is_connected:F.boolean().optional(),has_input_arrow:F.boolean().optional(),has_output_arrow:F.boolean().optional(),is_drawn_with_inversion_circle:F.boolean().optional()}).describe("Defines a port on a schematic component"),jjr=F.object({type:F.literal("schematic_net_label"),schematic_net_label_id:Ao("schematic_net_label"),schematic_trace_id:F.string().optional(),source_trace_id:F.string().optional(),source_net_id:F.string(),center:qr,anchor_position:qr.optional(),anchor_side:F.enum(["top","bottom","left","right"]),text:F.string(),symbol_name:F.string().optional(),is_movable:F.boolean().optional(),subcircuit_id:F.string().optional()}),Kjr=Ch.extend({type:F.literal("schematic_error"),schematic_error_id:F.string(),error_type:F.literal("schematic_port_not_found").default("schematic_port_not_found"),subcircuit_id:F.string().optional()}).describe("Defines a schematic error on the schematic"),$jr=Ch.extend({type:F.literal("schematic_layout_error"),schematic_layout_error_id:Ao("schematic_layout_error"),error_type:F.literal("schematic_layout_error").default("schematic_layout_error"),source_group_id:F.string(),schematic_group_id:F.string(),subcircuit_id:F.string().optional()}).describe("Error emitted when schematic layout fails for a group"),eat=F.object({type:F.literal("schematic_debug_object"),label:F.string().optional(),subcircuit_id:F.string().optional()}),qjr=eat.extend({shape:F.literal("rect"),center:qr,size:z9n}),Jjr=eat.extend({shape:F.literal("line"),start:qr,end:qr}),Zjr=eat.extend({shape:F.literal("point"),center:qr}),eKr=F.discriminatedUnion("shape",[qjr,Jjr,Zjr]),tKr=F.object({type:F.literal("schematic_voltage_probe"),schematic_voltage_probe_id:F.string(),source_component_id:F.string().optional(),name:F.string().optional(),position:qr,schematic_trace_id:F.string(),voltage:Dk.optional(),subcircuit_id:F.string().optional(),color:F.string().optional(),label_alignment:Gk.optional()}).describe("Defines a voltage probe measurement point on a schematic trace"),nKr=F.object({type:F.literal("schematic_manual_edit_conflict_warning"),schematic_manual_edit_conflict_warning_id:Ao("schematic_manual_edit_conflict_warning"),warning_type:F.literal("schematic_manual_edit_conflict_warning").default("schematic_manual_edit_conflict_warning"),message:F.string(),schematic_component_id:F.string(),schematic_group_id:F.string().optional(),subcircuit_id:F.string().optional(),source_component_id:F.string()}).describe("Warning emitted when a component has both manual placement and explicit schX/schY coordinates"),oKr=F.object({type:F.literal("schematic_group"),schematic_group_id:Ao("schematic_group"),source_group_id:F.string(),is_subcircuit:F.boolean().optional(),subcircuit_id:F.string().optional(),width:dr,height:dr,center:qr,schematic_component_ids:F.array(F.string()),show_as_schematic_box:F.boolean().optional(),name:F.string().optional(),description:F.string().optional()}).describe("Defines a group of components on the schematic"),rKr=F.object({type:F.literal("schematic_table"),schematic_table_id:Ao("schematic_table"),anchor_position:qr,column_widths:F.array(jn),row_heights:F.array(jn),cell_padding:jn.optional(),border_width:jn.optional(),subcircuit_id:F.string().optional(),schematic_component_id:F.string().optional(),anchor:Gk.optional()}).describe("Defines a table on the schematic"),iKr=F.object({type:F.literal("schematic_table_cell"),schematic_table_cell_id:Ao("schematic_table_cell"),schematic_table_id:F.string(),start_row_index:F.number(),end_row_index:F.number(),start_column_index:F.number(),end_column_index:F.number(),text:F.string().optional(),center:qr,width:jn,height:jn,horizontal_align:F.enum(["left","center","right"]).optional(),vertical_align:F.enum(["top","middle","bottom"]).optional(),font_size:jn.optional(),subcircuit_id:F.string().optional()}).describe("Defines a cell within a schematic_table"),sKr=F.object({type:F.literal("schematic_sheet"),schematic_sheet_id:Ao("schematic_sheet"),name:F.string().optional(),subcircuit_id:F.string().optional()}).describe("Defines a schematic sheet or page that components can be placed on"),aKr=F.object({x:jn,y:jn,bulge:F.number().optional()}),Ffn=F.object({vertices:F.array(aKr)}),cKr=F.object({outer_ring:Ffn,inner_rings:F.array(Ffn).default([])}),lKr=F.object({x:jn,y:jn,via:F.boolean().optional(),via_to_layer:vc.optional()}),hKr=(F.array(lKr),F.object({x:jn,y:jn,via:F.boolean().optional(),to_layer:vc.optional(),trace_width:jn.optional()})),dKr=F.object({min_trace_width:dr.optional(),min_board_edge_clearance:dr.optional(),min_via_hole_edge_to_via_hole_edge_clearance:dr.optional(),min_plated_hole_drill_edge_to_drill_edge_clearance:dr.optional(),min_trace_to_pad_edge_clearance:dr.optional(),min_pad_edge_to_pad_edge_clearance:dr.optional(),min_same_net_trace_edge_to_trace_edge_clearance:dr.optional(),min_different_net_trace_edge_to_trace_edge_clearance:dr.optional(),min_via_hole_diameter:dr.optional(),min_via_pad_diameter:dr.optional()}),uKr=F.object({type:F.literal("pcb_component"),pcb_component_id:Ao("pcb_component"),source_component_id:F.string(),center:qr,layer:vc,rotation:p_,display_offset_x:F.string().optional().describe("How to display the x offset for this part, usually corresponding with how the user specified it"),display_offset_y:F.string().optional().describe("How to display the y offset for this part, usually corresponding with how the user specified it"),width:dr,height:dr,do_not_place:F.boolean().optional(),is_allowed_to_be_off_board:F.boolean().optional(),subcircuit_id:F.string().optional(),pcb_group_id:F.string().optional(),position_mode:F.enum(["packed","relative_to_group_anchor","relative_to_another_component","none"]).optional(),anchor_position:qr.optional(),anchor_alignment:Gk.optional(),positioned_relative_to_pcb_group_id:F.string().optional(),positioned_relative_to_pcb_board_id:F.string().optional(),cable_insertion_center:qr.optional(),insertion_direction:F.enum(["from_above","from_left","from_right","from_front","from_back"]).optional(),metadata:F.object({kicad_footprint:$Xr.optional()}).optional(),obstructs_within_bounds:F.boolean().default(!0).describe("Does this component take up all the space within its bounds on a layer. This is generally true except for when separated pin headers are being represented by a single component (in which case, chips can be placed between the pin headers) or for tall modules where chips fit underneath")}).describe("Defines a component on the PCB"),uvn=F.object({type:F.literal("pcb_hole"),pcb_hole_id:Ao("pcb_hole"),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),pcb_component_id:F.string().optional(),hole_shape:F.literal("circle"),hole_diameter:F.number(),x:jn,y:jn,is_covered_with_solder_mask:F.boolean().optional(),soldermask_margin:F.number().optional()}),pvn=(uvn.describe("Defines a circular hole on the PCB"),F.object({type:F.literal("pcb_hole"),pcb_hole_id:Ao("pcb_hole"),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),pcb_component_id:F.string().optional(),hole_shape:F.literal("rect"),hole_width:F.number(),hole_height:F.number(),x:jn,y:jn,is_covered_with_solder_mask:F.boolean().optional(),soldermask_margin:F.number().optional()})),mvn=(pvn.describe("Defines a rectangular (square-capable) hole on the PCB. Use equal width/height for square."),F.object({type:F.literal("pcb_hole"),pcb_hole_id:Ao("pcb_hole"),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),pcb_component_id:F.string().optional(),hole_shape:F.enum(["circle","square"]),hole_diameter:F.number(),x:jn,y:jn,is_covered_with_solder_mask:F.boolean().optional(),soldermask_margin:F.number().optional()})),_vn=(mvn.describe("Defines a circular or square hole on the PCB"),F.object({type:F.literal("pcb_hole"),pcb_hole_id:Ao("pcb_hole"),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),pcb_component_id:F.string().optional(),hole_shape:F.literal("oval"),hole_width:F.number(),hole_height:F.number(),x:jn,y:jn,is_covered_with_solder_mask:F.boolean().optional(),soldermask_margin:F.number().optional()})),gvn=(_vn.describe("Defines an oval hole on the PCB"),F.object({type:F.literal("pcb_hole"),pcb_hole_id:Ao("pcb_hole"),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),pcb_component_id:F.string().optional(),hole_shape:F.literal("pill"),hole_width:F.number(),hole_height:F.number(),x:jn,y:jn,is_covered_with_solder_mask:F.boolean().optional(),soldermask_margin:F.number().optional()})),zfn=(gvn.describe("Defines a pill-shaped hole on the PCB"),F.object({type:F.literal("pcb_hole"),pcb_hole_id:Ao("pcb_hole"),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),pcb_component_id:F.string().optional(),hole_shape:F.literal("rotated_pill"),hole_width:F.number(),hole_height:F.number(),x:jn,y:jn,ccw_rotation:p_,is_covered_with_solder_mask:F.boolean().optional(),soldermask_margin:F.number().optional()})),pKr=(zfn.describe("Defines a rotated pill-shaped hole on the PCB"),mvn.or(_vn).or(gvn).or(zfn).or(uvn).or(pvn)),mKr=F.object({type:F.literal("pcb_plated_hole"),shape:F.literal("circle"),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),outer_diameter:F.number(),hole_diameter:F.number(),is_covered_with_solder_mask:F.boolean().optional(),x:jn,y:jn,layers:F.array(vc),port_hints:F.array(F.string()).optional(),pcb_component_id:F.string().optional(),pcb_port_id:F.string().optional(),pcb_plated_hole_id:Ao("pcb_plated_hole"),soldermask_margin:F.number().optional()}),_Kr=F.object({type:F.literal("pcb_plated_hole"),shape:F.enum(["oval","pill"]),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),outer_width:F.number(),outer_height:F.number(),hole_width:F.number(),hole_height:F.number(),is_covered_with_solder_mask:F.boolean().optional(),x:jn,y:jn,ccw_rotation:p_,layers:F.array(vc),port_hints:F.array(F.string()).optional(),pcb_component_id:F.string().optional(),pcb_port_id:F.string().optional(),pcb_plated_hole_id:Ao("pcb_plated_hole"),soldermask_margin:F.number().optional()}),gKr=F.object({type:F.literal("pcb_plated_hole"),shape:F.literal("circular_hole_with_rect_pad"),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),hole_shape:F.literal("circle"),pad_shape:F.literal("rect"),hole_diameter:F.number(),rect_pad_width:F.number(),rect_pad_height:F.number(),rect_border_radius:F.number().optional(),hole_offset_x:jn.default(0),hole_offset_y:jn.default(0),is_covered_with_solder_mask:F.boolean().optional(),x:jn,y:jn,layers:F.array(vc),port_hints:F.array(F.string()).optional(),pcb_component_id:F.string().optional(),pcb_port_id:F.string().optional(),pcb_plated_hole_id:Ao("pcb_plated_hole"),soldermask_margin:F.number().optional(),rect_ccw_rotation:p_.optional()}),AKr=F.object({type:F.literal("pcb_plated_hole"),shape:F.literal("pill_hole_with_rect_pad"),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),hole_shape:F.literal("pill"),pad_shape:F.literal("rect"),hole_width:F.number(),hole_height:F.number(),rect_pad_width:F.number(),rect_pad_height:F.number(),rect_border_radius:F.number().optional(),hole_offset_x:jn.default(0),hole_offset_y:jn.default(0),is_covered_with_solder_mask:F.boolean().optional(),x:jn,y:jn,layers:F.array(vc),port_hints:F.array(F.string()).optional(),pcb_component_id:F.string().optional(),pcb_port_id:F.string().optional(),pcb_plated_hole_id:Ao("pcb_plated_hole"),soldermask_margin:F.number().optional()}),fKr=F.object({type:F.literal("pcb_plated_hole"),shape:F.literal("rotated_pill_hole_with_rect_pad"),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),hole_shape:F.literal("rotated_pill"),pad_shape:F.literal("rect"),hole_width:F.number(),hole_height:F.number(),hole_ccw_rotation:p_,rect_pad_width:F.number(),rect_pad_height:F.number(),rect_border_radius:F.number().optional(),rect_ccw_rotation:p_,hole_offset_x:jn.default(0),hole_offset_y:jn.default(0),is_covered_with_solder_mask:F.boolean().optional(),x:jn,y:jn,layers:F.array(vc),port_hints:F.array(F.string()).optional(),pcb_component_id:F.string().optional(),pcb_port_id:F.string().optional(),pcb_plated_hole_id:Ao("pcb_plated_hole"),soldermask_margin:F.number().optional()}),yKr=F.object({type:F.literal("pcb_plated_hole"),shape:F.literal("hole_with_polygon_pad"),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),hole_shape:F.enum(["circle","oval","pill","rotated_pill"]),hole_diameter:F.number().optional(),hole_width:F.number().optional(),hole_height:F.number().optional(),pad_outline:F.array(F.object({x:jn,y:jn})).min(3),hole_offset_x:jn.default(0),hole_offset_y:jn.default(0),is_covered_with_solder_mask:F.boolean().optional(),x:jn,y:jn,layers:F.array(vc),port_hints:F.array(F.string()).optional(),pcb_component_id:F.string().optional(),pcb_port_id:F.string().optional(),pcb_plated_hole_id:Ao("pcb_plated_hole"),soldermask_margin:F.number().optional(),ccw_rotation:p_.optional()}),xKr=F.union([mKr,_Kr,gKr,AKr,fKr,yKr]),CKr=F.object({type:F.literal("pcb_port"),pcb_port_id:Ao("pcb_port"),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),source_port_id:F.string(),pcb_component_id:F.string().optional(),x:jn,y:jn,layers:F.array(vc),is_board_pinout:F.boolean().optional()}).describe("Defines a port on the PCB"),bKr=F.object({type:F.literal("pcb_smtpad"),shape:F.literal("circle"),pcb_smtpad_id:Ao("pcb_smtpad"),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),x:jn,y:jn,radius:F.number(),layer:vc,port_hints:F.array(F.string()).optional(),pcb_component_id:F.string().optional(),pcb_port_id:F.string().optional(),is_covered_with_solder_mask:F.boolean().optional(),soldermask_margin:F.number().optional()}),IKr=F.object({type:F.literal("pcb_smtpad"),shape:F.literal("rect"),pcb_smtpad_id:Ao("pcb_smtpad"),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),x:jn,y:jn,width:F.number(),height:F.number(),rect_border_radius:F.number().optional(),corner_radius:F.number().optional(),layer:vc,port_hints:F.array(F.string()).optional(),pcb_component_id:F.string().optional(),pcb_port_id:F.string().optional(),is_covered_with_solder_mask:F.boolean().optional(),soldermask_margin:F.number().optional(),soldermask_margin_left:F.number().optional(),soldermask_margin_top:F.number().optional(),soldermask_margin_right:F.number().optional(),soldermask_margin_bottom:F.number().optional()}),vKr=F.object({type:F.literal("pcb_smtpad"),shape:F.literal("rotated_rect"),pcb_smtpad_id:Ao("pcb_smtpad"),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),x:jn,y:jn,width:F.number(),height:F.number(),rect_border_radius:F.number().optional(),corner_radius:F.number().optional(),ccw_rotation:p_,layer:vc,port_hints:F.array(F.string()).optional(),pcb_component_id:F.string().optional(),pcb_port_id:F.string().optional(),is_covered_with_solder_mask:F.boolean().optional(),soldermask_margin:F.number().optional(),soldermask_margin_left:F.number().optional(),soldermask_margin_top:F.number().optional(),soldermask_margin_right:F.number().optional(),soldermask_margin_bottom:F.number().optional()}),SKr=F.object({type:F.literal("pcb_smtpad"),shape:F.literal("pill"),pcb_smtpad_id:Ao("pcb_smtpad"),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),x:jn,y:jn,width:F.number(),height:F.number(),radius:F.number(),layer:vc,port_hints:F.array(F.string()).optional(),pcb_component_id:F.string().optional(),pcb_port_id:F.string().optional(),is_covered_with_solder_mask:F.boolean().optional(),soldermask_margin:F.number().optional()}),PKr=F.object({type:F.literal("pcb_smtpad"),shape:F.literal("rotated_pill"),pcb_smtpad_id:Ao("pcb_smtpad"),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),x:jn,y:jn,width:F.number(),height:F.number(),radius:F.number(),ccw_rotation:p_,layer:vc,port_hints:F.array(F.string()).optional(),pcb_component_id:F.string().optional(),pcb_port_id:F.string().optional(),is_covered_with_solder_mask:F.boolean().optional(),soldermask_margin:F.number().optional()}),EKr=F.object({type:F.literal("pcb_smtpad"),shape:F.literal("polygon"),pcb_smtpad_id:Ao("pcb_smtpad"),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),points:F.array(qr),layer:vc,port_hints:F.array(F.string()).optional(),pcb_component_id:F.string().optional(),pcb_port_id:F.string().optional(),is_covered_with_solder_mask:F.boolean().optional(),soldermask_margin:F.number().optional()}),MKr=F.discriminatedUnion("shape",[bKr,IKr,vKr,PKr,SKr,EKr]).describe("Defines an SMT pad on the PCB"),wKr=F.object({type:F.literal("pcb_solder_paste"),shape:F.literal("circle"),pcb_solder_paste_id:Ao("pcb_solder_paste"),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),x:jn,y:jn,radius:F.number(),layer:vc,pcb_component_id:F.string().optional(),pcb_smtpad_id:F.string().optional()}),BKr=F.object({type:F.literal("pcb_solder_paste"),shape:F.literal("rect"),pcb_solder_paste_id:Ao("pcb_solder_paste"),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),x:jn,y:jn,width:F.number(),height:F.number(),layer:vc,pcb_component_id:F.string().optional(),pcb_smtpad_id:F.string().optional()}),TKr=F.object({type:F.literal("pcb_solder_paste"),shape:F.literal("pill"),pcb_solder_paste_id:Ao("pcb_solder_paste"),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),x:jn,y:jn,width:F.number(),height:F.number(),radius:F.number(),layer:vc,pcb_component_id:F.string().optional(),pcb_smtpad_id:F.string().optional()}),DKr=F.object({type:F.literal("pcb_solder_paste"),shape:F.literal("rotated_rect"),pcb_solder_paste_id:Ao("pcb_solder_paste"),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),x:jn,y:jn,width:F.number(),height:F.number(),ccw_rotation:jn,layer:vc,pcb_component_id:F.string().optional(),pcb_smtpad_id:F.string().optional()}),NKr=F.object({type:F.literal("pcb_solder_paste"),shape:F.literal("oval"),pcb_solder_paste_id:Ao("pcb_solder_paste"),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),x:jn,y:jn,width:F.number(),height:F.number(),layer:vc,pcb_component_id:F.string().optional(),pcb_smtpad_id:F.string().optional()}),RKr=F.union([wKr,BKr,TKr,DKr,NKr]).describe("Defines solderpaste on the PCB"),QKr=F.object({type:F.literal("pcb_text"),pcb_text_id:Ao("pcb_text"),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),text:F.string(),center:qr,layer:vc,width:dr,height:dr,lines:F.number(),align:F.enum(["bottom-left"])}).describe("Defines text on the PCB"),kKr=F.object({route_type:F.literal("wire"),x:jn,y:jn,width:jn,copper_pour_id:F.string().optional(),is_inside_copper_pour:F.boolean().optional(),start_pcb_port_id:F.string().optional(),end_pcb_port_id:F.string().optional(),layer:vc}),LKr=F.object({route_type:F.literal("via"),x:jn,y:jn,copper_pour_id:F.string().optional(),is_inside_copper_pour:F.boolean().optional(),hole_diameter:jn.optional(),outer_diameter:jn.optional(),from_layer:vc,to_layer:vc}),HKr=F.union([kKr,LKr]),FKr=F.object({type:F.literal("pcb_trace"),source_trace_id:F.string().optional(),pcb_component_id:F.string().optional(),pcb_trace_id:Ao("pcb_trace"),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),route_thickness_mode:F.enum(["constant","interpolated"]).default("constant").optional(),route_order_index:F.number().optional(),should_round_corners:F.boolean().optional(),trace_length:F.number().optional(),highlight_color:F.string().optional(),route:F.array(HKr)}).describe("Defines a trace on the PCB"),zKr=F.object({type:F.literal("pcb_trace_warning"),pcb_trace_warning_id:Ao("pcb_trace_warning"),warning_type:F.literal("pcb_trace_warning").default("pcb_trace_warning"),message:F.string(),center:qr.optional(),pcb_trace_id:F.string(),source_trace_id:F.string(),pcb_component_ids:F.array(F.string()),pcb_port_ids:F.array(F.string()),subcircuit_id:F.string().optional()}).describe("Defines a trace warning on the PCB"),OKr=Ch.extend({type:F.literal("pcb_trace_error"),pcb_trace_error_id:Ao("pcb_trace_error"),error_type:F.literal("pcb_trace_error").default("pcb_trace_error"),center:qr.optional(),pcb_trace_id:F.string(),source_trace_id:F.string(),pcb_component_ids:F.array(F.string()),pcb_port_ids:F.array(F.string()),subcircuit_id:F.string().optional()}).describe("Defines a trace error on the PCB"),VKr=Ch.extend({type:F.literal("pcb_trace_missing_error"),pcb_trace_missing_error_id:Ao("pcb_trace_missing_error"),error_type:F.literal("pcb_trace_missing_error").default("pcb_trace_missing_error"),center:qr.optional(),source_trace_id:F.string(),pcb_component_ids:F.array(F.string()),pcb_port_ids:F.array(F.string()),subcircuit_id:F.string().optional()}).describe("Defines an error when a source trace has no corresponding PCB trace"),YKr=Ch.extend({type:F.literal("pcb_port_not_matched_error"),pcb_error_id:Ao("pcb_error"),error_type:F.literal("pcb_port_not_matched_error").default("pcb_port_not_matched_error"),pcb_component_ids:F.array(F.string()),subcircuit_id:F.string().optional()}).describe("Defines a trace error on the PCB where a port is not matched"),GKr=Ch.extend({type:F.literal("pcb_port_not_connected_error"),pcb_port_not_connected_error_id:Ao("pcb_port_not_connected_error"),error_type:F.literal("pcb_port_not_connected_error").default("pcb_port_not_connected_error"),pcb_port_ids:F.array(F.string()),pcb_component_ids:F.array(F.string()),subcircuit_id:F.string().optional()}).describe("Defines an error when a pcb port is not connected to any trace"),UKr=F.object({type:F.literal("pcb_net"),pcb_net_id:Ao("pcb_net"),source_net_id:F.string().optional(),highlight_color:F.string().optional()}).describe("Defines a net on the PCB"),WKr=F.object({type:F.literal("pcb_via"),pcb_via_id:Ao("pcb_via"),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),subcircuit_connectivity_map_key:F.string().optional(),x:jn,y:jn,outer_diameter:jn.default("0.6mm"),hole_diameter:jn.default("0.25mm"),from_layer:vc.optional(),to_layer:vc.optional(),layers:F.array(vc),pcb_trace_id:F.string().optional(),net_is_assignable:F.boolean().optional(),net_assigned:F.boolean().optional(),is_tented:F.boolean().optional()}).describe("Defines a via on the PCB"),XKr=F.object({type:F.literal("pcb_board"),pcb_board_id:Ao("pcb_board"),pcb_panel_id:F.string().optional(),carrier_pcb_board_id:F.string().optional(),is_subcircuit:F.boolean().optional(),subcircuit_id:F.string().optional(),is_mounted_to_carrier_board:F.boolean().optional(),width:dr.optional(),height:dr.optional(),center:qr,display_offset_x:F.string().optional().describe("How to display the x offset for this board, usually corresponding with how the user specified it"),display_offset_y:F.string().optional().describe("How to display the y offset for this board, usually corresponding with how the user specified it"),thickness:dr.optional().default(1.4),num_layers:F.number().optional().default(4),outline:F.array(qr).optional(),shape:F.enum(["rect","polygon"]).optional(),material:F.enum(["fr4","fr1"]).default("fr4"),anchor_position:qr.optional(),anchor_alignment:Gk.optional(),position_mode:F.enum(["relative_to_panel_anchor","none"]).optional()}).merge(dKr).describe("Defines the board outline of the PCB");var jKr=F.object({type:F.literal("pcb_panel"),pcb_panel_id:Ao("pcb_panel"),width:dr,height:dr,center:qr,thickness:dr.optional().default(1.4),covered_with_solder_mask:F.boolean().optional().default(!0)}).describe("Defines a PCB panel that can contain multiple boards"),KKr=Ch.extend({type:F.literal("pcb_placement_error"),pcb_placement_error_id:Ao("pcb_placement_error"),error_type:F.literal("pcb_placement_error").default("pcb_placement_error"),subcircuit_id:F.string().optional()}).describe("Defines a placement error on the PCB"),$Kr=Ch.extend({type:F.literal("pcb_panelization_placement_error"),pcb_panelization_placement_error_id:Ao("pcb_panelization_placement_error"),error_type:F.literal("pcb_panelization_placement_error").default("pcb_panelization_placement_error"),pcb_panel_id:F.string().optional(),pcb_board_id:F.string().optional(),subcircuit_id:F.string().optional()}).describe("Defines a panelization placement error on the PCB"),qKr=F.object({type:F.literal("pcb_trace_hint"),pcb_trace_hint_id:Ao("pcb_trace_hint"),pcb_port_id:F.string(),pcb_component_id:F.string(),route:F.array(hKr),subcircuit_id:F.string().optional()}).describe("A hint that can be used during generation of a PCB trace"),JKr=F.object({type:F.literal("pcb_silkscreen_line"),pcb_silkscreen_line_id:Ao("pcb_silkscreen_line"),pcb_component_id:F.string(),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),stroke_width:jn.default("0.1mm"),x1:jn,y1:jn,x2:jn,y2:jn,layer:j2}).describe("Defines a silkscreen line on the PCB"),ZKr=F.object({type:F.literal("pcb_silkscreen_path"),pcb_silkscreen_path_id:Ao("pcb_silkscreen_path"),pcb_component_id:F.string(),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),layer:j2,route:F.array(qr),stroke_width:dr}).describe("Defines a silkscreen path on the PCB"),e$r=F.object({type:F.literal("pcb_silkscreen_text"),pcb_silkscreen_text_id:Ao("pcb_silkscreen_text"),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),font:F.literal("tscircuit2024").default("tscircuit2024"),font_size:jn.default("0.2mm"),pcb_component_id:F.string(),text:F.string(),is_knockout:F.boolean().default(!1).optional(),knockout_padding:F.object({left:dr,top:dr,bottom:dr,right:dr}).default({left:"0.2mm",top:"0.2mm",bottom:"0.2mm",right:"0.2mm"}).optional(),ccw_rotation:F.number().optional(),layer:vc,is_mirrored:F.boolean().default(!1).optional(),anchor_position:qr.default({x:0,y:0}),anchor_alignment:Gk.default("center")}).describe("Defines silkscreen text on the PCB"),t$r=F.object({type:F.literal("pcb_copper_text"),pcb_copper_text_id:Ao("pcb_copper_text"),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),font:F.literal("tscircuit2024").default("tscircuit2024"),font_size:jn.default("0.2mm"),pcb_component_id:F.string(),text:F.string(),is_knockout:F.boolean().default(!1).optional(),knockout_padding:F.object({left:dr,top:dr,bottom:dr,right:dr}).default({left:"0.2mm",top:"0.2mm",bottom:"0.2mm",right:"0.2mm"}).optional(),ccw_rotation:F.number().optional(),layer:vc,is_mirrored:F.boolean().default(!1).optional(),anchor_position:qr.default({x:0,y:0}),anchor_alignment:Gk.default("center")}).describe("Defines copper text on the PCB"),n$r=F.object({type:F.literal("pcb_silkscreen_rect"),pcb_silkscreen_rect_id:Ao("pcb_silkscreen_rect"),pcb_component_id:F.string(),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),center:qr,width:dr,height:dr,layer:vc,stroke_width:dr.default("1mm"),corner_radius:dr.optional(),is_filled:F.boolean().default(!0).optional(),has_stroke:F.boolean().optional(),is_stroke_dashed:F.boolean().optional(),ccw_rotation:F.number().optional()}).describe("Defines a silkscreen rect on the PCB"),o$r=F.object({type:F.literal("pcb_silkscreen_circle"),pcb_silkscreen_circle_id:Ao("pcb_silkscreen_circle"),pcb_component_id:F.string(),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),center:qr,radius:dr,layer:j2,stroke_width:dr.default("1mm"),is_filled:F.boolean().optional()}).describe("Defines a silkscreen circle on the PCB"),r$r=F.object({type:F.literal("pcb_silkscreen_oval"),pcb_silkscreen_oval_id:Ao("pcb_silkscreen_oval"),pcb_component_id:F.string(),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),center:qr,radius_x:jn,radius_y:jn,layer:j2,ccw_rotation:p_.optional()}).describe("Defines a silkscreen oval on the PCB"),i$r=F.object({type:F.literal("pcb_silkscreen_pill"),pcb_silkscreen_pill_id:Ao("pcb_silkscreen_pill"),pcb_component_id:F.string(),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),center:qr,width:dr,height:dr,layer:vc,ccw_rotation:F.number().optional()}).describe("Defines a silkscreen pill on the PCB"),s$r=F.object({type:F.literal("pcb_fabrication_note_text"),pcb_fabrication_note_text_id:Ao("pcb_fabrication_note_text"),subcircuit_id:F.string().optional(),pcb_group_id:F.string().optional(),font:F.literal("tscircuit2024").default("tscircuit2024"),font_size:jn.default("1mm"),pcb_component_id:F.string(),text:F.string(),layer:j2,anchor_position:qr.default({x:0,y:0}),anchor_alignment:F.enum(["center","top_left","top_right","bottom_left","bottom_right"]).default("center"),color:F.string().optional()}).describe("Defines a fabrication note in text on the PCB, useful for leaving notes for assemblers or fabricators"),a$r=F.object({type:F.literal("pcb_fabrication_note_path"),pcb_fabrication_note_path_id:Ao("pcb_fabrication_note_path"),pcb_component_id:F.string(),subcircuit_id:F.string().optional(),layer:vc,route:F.array(qr),stroke_width:dr,color:F.string().optional()}).describe("Defines a fabrication path on the PCB for fabricators or assemblers"),c$r=F.object({type:F.literal("pcb_fabrication_note_rect"),pcb_fabrication_note_rect_id:Ao("pcb_fabrication_note_rect"),pcb_component_id:F.string(),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),center:qr,width:dr,height:dr,layer:j2,stroke_width:dr.default("0.1mm"),corner_radius:dr.optional(),is_filled:F.boolean().optional(),has_stroke:F.boolean().optional(),is_stroke_dashed:F.boolean().optional(),color:F.string().optional()}).describe("Defines a fabrication note rectangle on the PCB"),l$r=F.object({type:F.literal("pcb_fabrication_note_dimension"),pcb_fabrication_note_dimension_id:Ao("pcb_fabrication_note_dimension"),pcb_component_id:F.string(),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),layer:j2,from:qr,to:qr,text:F.string().optional(),text_ccw_rotation:F.number().optional(),offset:dr.optional(),offset_distance:dr.optional(),offset_direction:F.object({x:F.number(),y:F.number()}).optional(),font:F.literal("tscircuit2024").default("tscircuit2024"),font_size:dr.default("1mm"),color:F.string().optional(),arrow_size:dr.default("1mm")}).describe("Defines a measurement annotation within PCB fabrication notes"),h$r=F.object({type:F.literal("pcb_note_text"),pcb_note_text_id:Ao("pcb_note_text"),pcb_component_id:F.string().optional(),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),name:F.string().optional(),font:F.literal("tscircuit2024").default("tscircuit2024"),font_size:jn.default("1mm"),text:F.string().optional(),anchor_position:qr.default({x:0,y:0}),anchor_alignment:F.enum(["center","top_left","top_right","bottom_left","bottom_right"]).default("center"),layer:j2.default("top"),is_mirrored_from_top_view:F.boolean().optional(),color:F.string().optional()}).describe("Defines a documentation note in text on the PCB"),d$r=F.object({type:F.literal("pcb_note_rect"),pcb_note_rect_id:Ao("pcb_note_rect"),pcb_component_id:F.string().optional(),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),name:F.string().optional(),text:F.string().optional(),center:qr,width:dr,height:dr,layer:j2.default("top"),stroke_width:dr.default("0.1mm"),corner_radius:dr.optional(),is_filled:F.boolean().optional(),has_stroke:F.boolean().optional(),is_stroke_dashed:F.boolean().optional(),color:F.string().optional()}).describe("Defines a rectangular documentation note on the PCB"),u$r=F.object({type:F.literal("pcb_note_path"),pcb_note_path_id:Ao("pcb_note_path"),pcb_component_id:F.string().optional(),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),name:F.string().optional(),text:F.string().optional(),route:F.array(qr),layer:j2.default("top"),stroke_width:dr.default("0.1mm"),color:F.string().optional()}).describe("Defines a polyline documentation note on the PCB"),p$r=F.object({type:F.literal("pcb_note_line"),pcb_note_line_id:Ao("pcb_note_line"),pcb_component_id:F.string().optional(),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),name:F.string().optional(),text:F.string().optional(),x1:jn,y1:jn,x2:jn,y2:jn,layer:j2.default("top"),stroke_width:jn.default("0.1mm"),color:F.string().optional(),is_dashed:F.boolean().optional()}).describe("Defines a straight documentation note line on the PCB"),m$r=F.object({type:F.literal("pcb_note_dimension"),pcb_note_dimension_id:Ao("pcb_note_dimension"),pcb_component_id:F.string().optional(),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),name:F.string().optional(),from:qr,to:qr,text:F.string().optional(),text_ccw_rotation:F.number().optional(),offset_distance:dr.optional(),offset_direction:F.object({x:F.number(),y:F.number()}).optional(),font:F.literal("tscircuit2024").default("tscircuit2024"),font_size:dr.default("1mm"),layer:j2.default("top"),color:F.string().optional(),arrow_size:dr.default("1mm")}).describe("Defines a measurement annotation within PCB documentation notes"),_$r=Ch.extend({type:F.literal("pcb_footprint_overlap_error"),pcb_error_id:Ao("pcb_error"),error_type:F.literal("pcb_footprint_overlap_error").default("pcb_footprint_overlap_error"),pcb_smtpad_ids:F.array(F.string()).optional(),pcb_plated_hole_ids:F.array(F.string()).optional(),pcb_hole_ids:F.array(F.string()).optional(),pcb_keepout_ids:F.array(F.string()).optional()}).describe("Error emitted when a pcb footprint overlaps with another element"),g$r=Ch.extend({type:F.literal("pcb_courtyard_overlap_error"),pcb_error_id:Ao("pcb_error"),error_type:F.literal("pcb_courtyard_overlap_error").default("pcb_courtyard_overlap_error"),pcb_component_ids:F.tuple([F.string(),F.string()])}).describe("Error emitted when the courtyard (CrtYd) of one PCB component overlaps with the courtyard of another"),A$r=F.object({type:F.literal("pcb_keepout"),shape:F.literal("rect"),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),center:qr,width:jn,height:jn,pcb_keepout_id:F.string(),layers:F.array(F.string()),description:F.string().optional()}).or(F.object({type:F.literal("pcb_keepout"),shape:F.literal("circle"),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),center:qr,radius:jn,pcb_keepout_id:F.string(),layers:F.array(F.string()),description:F.string().optional()})),k7e=F.object({type:F.literal("pcb_cutout"),pcb_cutout_id:Ao("pcb_cutout"),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),pcb_board_id:F.string().optional(),pcb_panel_id:F.string().optional()}),f$r=k7e.extend({shape:F.literal("rect"),center:qr,width:dr,height:dr,rotation:p_.optional(),corner_radius:dr.optional()}),y$r=k7e.extend({shape:F.literal("circle"),center:qr,radius:dr}),x$r=k7e.extend({shape:F.literal("polygon"),points:F.array(qr)}),C$r=k7e.extend({shape:F.literal("path"),route:F.array(qr),slot_width:dr,slot_length:dr.optional(),space_between_slots:dr.optional(),slot_corner_radius:dr.optional()}),b$r=F.discriminatedUnion("shape",[f$r,y$r,x$r,C$r]).describe("Defines a cutout on the PCB, removing board material."),I$r=Ch.extend({type:F.literal("pcb_missing_footprint_error"),pcb_missing_footprint_error_id:Ao("pcb_missing_footprint_error"),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),error_type:F.literal("pcb_missing_footprint_error").default("pcb_missing_footprint_error"),source_component_id:F.string()}).describe("Defines a missing footprint error on the PCB"),v$r=Ch.extend({type:F.literal("external_footprint_load_error"),external_footprint_load_error_id:Ao("external_footprint_load_error"),pcb_component_id:F.string(),source_component_id:F.string(),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),footprinter_string:F.string().optional(),error_type:F.literal("external_footprint_load_error").default("external_footprint_load_error")}).describe("Defines an error when an external footprint fails to load"),S$r=Ch.extend({type:F.literal("circuit_json_footprint_load_error"),circuit_json_footprint_load_error_id:Ao("circuit_json_footprint_load_error"),pcb_component_id:F.string(),source_component_id:F.string(),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),error_type:F.literal("circuit_json_footprint_load_error").default("circuit_json_footprint_load_error"),circuit_json:F.array(F.any()).optional()}).describe("Defines an error when a circuit JSON footprint fails to load"),P$r=F.object({type:F.literal("pcb_group"),pcb_group_id:Ao("pcb_group"),source_group_id:F.string(),is_subcircuit:F.boolean().optional(),subcircuit_id:F.string().optional(),width:dr.optional(),height:dr.optional(),center:qr,display_offset_x:F.string().optional().describe("How to display the x offset for this group, usually corresponding with how the user specified it"),display_offset_y:F.string().optional().describe("How to display the y offset for this group, usually corresponding with how the user specified it"),outline:F.array(qr).optional(),anchor_position:qr.optional(),anchor_alignment:Gk.default("center"),position_mode:F.enum(["packed","relative_to_group_anchor","none"]).optional(),positioned_relative_to_pcb_group_id:F.string().optional(),positioned_relative_to_pcb_board_id:F.string().optional(),pcb_component_ids:F.array(F.string()),child_layout_mode:F.enum(["packed","none"]).optional(),name:F.string().optional(),description:F.string().optional(),layout_mode:F.string().optional(),autorouter_configuration:F.object({trace_clearance:dr}).optional(),autorouter_used_string:F.string().optional()}).describe("Defines a group of components on the PCB"),E$r=Ch.extend({type:F.literal("pcb_autorouting_error"),pcb_error_id:Ao("pcb_autorouting_error"),error_type:F.literal("pcb_autorouting_error").default("pcb_autorouting_error"),subcircuit_id:F.string().optional()}).describe("The autorouting has failed to route a portion of the board"),M$r=F.object({type:F.literal("pcb_manual_edit_conflict_warning"),pcb_manual_edit_conflict_warning_id:Ao("pcb_manual_edit_conflict_warning"),warning_type:F.literal("pcb_manual_edit_conflict_warning").default("pcb_manual_edit_conflict_warning"),message:F.string(),pcb_component_id:F.string(),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),source_component_id:F.string()}).describe("Warning emitted when a component has both manual placement and explicit pcbX/pcbY coordinates"),Ofn=F.enum(["x-","x+","y+","y-"]),w$r=F.object({type:F.literal("pcb_connector_not_in_accessible_orientation_warning"),pcb_connector_not_in_accessible_orientation_warning_id:Ao("pcb_connector_not_in_accessible_orientation_warning"),warning_type:F.literal("pcb_connector_not_in_accessible_orientation_warning").default("pcb_connector_not_in_accessible_orientation_warning"),message:F.string(),pcb_component_id:F.string(),source_component_id:F.string().optional(),pcb_board_id:F.string().optional(),facing_direction:Ofn,recommended_facing_direction:Ofn,subcircuit_id:F.string().optional()}).describe("Warning emitted when a connector PCB component is facing inward toward the board and should be reoriented to an outward-facing direction"),B$r=F.object({type:F.literal("supplier_footprint_mismatch_warning"),supplier_footprint_mismatch_warning_id:Ao("supplier_footprint_mismatch_warning"),warning_type:F.literal("supplier_footprint_mismatch_warning").default("supplier_footprint_mismatch_warning"),message:F.string(),source_component_id:F.string(),pcb_component_id:F.string().optional(),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),supplier_name:V9n.optional(),supplier_part_number:F.string().optional(),supplier_footprint_url:F.string().optional(),footprint_copper_intersection_over_union:F.number()}).describe("Warning emitted when a supplier part footprint does not match the expected footprint"),T$r=F.object({type:F.literal("pcb_breakout_point"),pcb_breakout_point_id:Ao("pcb_breakout_point"),pcb_group_id:F.string(),subcircuit_id:F.string().optional(),source_trace_id:F.string().optional(),source_port_id:F.string().optional(),source_net_id:F.string().optional(),x:jn,y:jn}).describe("Defines a routing target within a pcb_group for a source_trace or source_net"),D$r=F.object({type:F.literal("pcb_ground_plane"),pcb_ground_plane_id:Ao("pcb_ground_plane"),source_pcb_ground_plane_id:F.string(),source_net_id:F.string(),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional()}).describe("Defines a ground plane on the PCB"),N$r=F.object({type:F.literal("pcb_ground_plane_region"),pcb_ground_plane_region_id:Ao("pcb_ground_plane_region"),pcb_ground_plane_id:F.string(),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),layer:vc,points:F.array(qr)}).describe("Defines a polygon region of a ground plane"),R$r=F.object({type:F.literal("pcb_thermal_spoke"),pcb_thermal_spoke_id:Ao("pcb_thermal_spoke"),pcb_ground_plane_id:F.string(),shape:F.string(),spoke_count:F.number(),spoke_thickness:jn,spoke_inner_diameter:jn,spoke_outer_diameter:jn,pcb_plated_hole_id:F.string().optional(),subcircuit_id:F.string().optional()}).describe("Pattern for connecting a ground plane to a plated hole"),tat=F.object({type:F.literal("pcb_copper_pour"),pcb_copper_pour_id:Ao("pcb_copper_pour"),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),layer:vc,source_net_id:F.string().optional(),covered_with_solder_mask:F.boolean().optional().default(!0)}),Q$r=tat.extend({shape:F.literal("rect"),center:qr,width:dr,height:dr,rotation:p_.optional()}),k$r=tat.extend({shape:F.literal("brep"),brep_shape:cKr}),L$r=tat.extend({shape:F.literal("polygon"),points:F.array(qr)}),H$r=F.discriminatedUnion("shape",[Q$r,k$r,L$r]).describe("Defines a copper pour on the PCB."),F$r=Ch.extend({type:F.literal("pcb_component_outside_board_error"),pcb_component_outside_board_error_id:Ao("pcb_component_outside_board_error"),error_type:F.literal("pcb_component_outside_board_error").default("pcb_component_outside_board_error"),pcb_component_id:F.string(),pcb_board_id:F.string(),component_center:qr,component_bounds:F.object({min_x:F.number(),max_x:F.number(),min_y:F.number(),max_y:F.number()}),subcircuit_id:F.string().optional(),source_component_id:F.string().optional()}).describe("Error emitted when a PCB component is placed outside the board boundaries"),z$r=Ch.extend({type:F.literal("pcb_component_not_on_board_edge_error"),pcb_component_not_on_board_edge_error_id:Ao("pcb_component_not_on_board_edge_error"),error_type:F.literal("pcb_component_not_on_board_edge_error").default("pcb_component_not_on_board_edge_error"),pcb_component_id:F.string(),pcb_board_id:F.string(),component_center:qr,pad_to_nearest_board_edge_distance:F.number(),source_component_id:F.string().optional(),subcircuit_id:F.string().optional()}).describe("Error emitted when a component that must be placed on the board edge is centered away from the edge"),O$r=Ch.extend({type:F.literal("pcb_component_invalid_layer_error"),pcb_component_invalid_layer_error_id:Ao("pcb_component_invalid_layer_error"),error_type:F.literal("pcb_component_invalid_layer_error").default("pcb_component_invalid_layer_error"),pcb_component_id:F.string().optional(),source_component_id:F.string(),layer:vc,subcircuit_id:F.string().optional()}).describe("Error emitted when a component is placed on an invalid layer (components can only be on 'top' or 'bottom' layers)"),V$r=Ch.extend({type:F.literal("pcb_via_clearance_error"),pcb_error_id:Ao("pcb_error"),error_type:F.literal("pcb_via_clearance_error").default("pcb_via_clearance_error"),pcb_via_ids:F.array(F.string()).min(2),minimum_clearance:jn.optional(),actual_clearance:jn.optional(),pcb_center:F.object({x:F.number().optional(),y:F.number().optional()}).optional(),subcircuit_id:F.string().optional()}).describe("Error emitted when vias are closer than the allowed clearance"),Y$r=Ch.extend({type:F.literal("pcb_via_trace_clearance_error"),pcb_via_trace_clearance_error_id:Ao("pcb_via_trace_clearance_error"),error_type:F.literal("pcb_via_trace_clearance_error").default("pcb_via_trace_clearance_error"),pcb_via_id:F.string(),pcb_trace_id:F.string(),minimum_clearance:jn.optional(),actual_clearance:jn.optional(),center:F.object({x:F.number().optional(),y:F.number().optional()}).optional(),subcircuit_id:F.string().optional()}).describe("Error emitted when a via and trace are closer than the allowed clearance"),G$r=Ch.extend({type:F.literal("pcb_pad_pad_clearance_error"),pcb_pad_pad_clearance_error_id:Ao("pcb_pad_pad_clearance_error"),error_type:F.literal("pcb_pad_pad_clearance_error").default("pcb_pad_pad_clearance_error"),pcb_pad_ids:F.array(F.string()).min(2),minimum_clearance:jn.optional(),actual_clearance:jn.optional(),center:F.object({x:F.number().optional(),y:F.number().optional()}).optional(),subcircuit_id:F.string().optional()}).describe("Error emitted when pads are closer than the allowed clearance"),U$r=Ch.extend({type:F.literal("pcb_pad_trace_clearance_error"),pcb_pad_trace_clearance_error_id:Ao("pcb_pad_trace_clearance_error"),error_type:F.literal("pcb_pad_trace_clearance_error").default("pcb_pad_trace_clearance_error"),pcb_pad_id:F.string(),pcb_trace_id:F.string(),minimum_clearance:jn.optional(),actual_clearance:jn.optional(),center:F.object({x:F.number().optional(),y:F.number().optional()}).optional(),subcircuit_id:F.string().optional()}).describe("Error emitted when a pad and trace are closer than allowed clearance"),W$r=F.object({type:F.literal("pcb_courtyard_rect"),pcb_courtyard_rect_id:Ao("pcb_courtyard_rect"),pcb_component_id:F.string(),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),center:qr,width:dr,height:dr,layer:j2,ccw_rotation:p_.optional(),color:F.string().optional()}).describe("Defines a courtyard rectangle on the PCB"),X$r=F.object({type:F.literal("pcb_courtyard_outline"),pcb_courtyard_outline_id:Ao("pcb_courtyard_outline"),pcb_component_id:F.string(),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),layer:j2,outline:F.array(qr).min(2)}).describe("Defines a courtyard outline on the PCB"),j$r=F.object({type:F.literal("pcb_courtyard_polygon"),pcb_courtyard_polygon_id:Ao("pcb_courtyard_polygon"),pcb_component_id:F.string(),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),layer:j2,points:F.array(qr).min(3),color:F.string().optional()}).describe("Defines a courtyard polygon on the PCB"),K$r=F.object({type:F.literal("pcb_courtyard_circle"),pcb_courtyard_circle_id:Ao("pcb_courtyard_circle"),pcb_component_id:F.string(),pcb_group_id:F.string().optional(),subcircuit_id:F.string().optional(),center:qr,radius:dr,layer:j2,color:F.string().optional()}).describe("Defines a courtyard circle on the PCB"),$$r=F.object({type:F.literal("cad_component"),cad_component_id:F.string(),pcb_component_id:F.string(),source_component_id:F.string(),position:pY,rotation:pY.optional(),size:pY.optional(),layer:vc.optional(),subcircuit_id:F.string().optional(),footprinter_string:F.string().optional(),model_obj_url:F.string().optional(),model_stl_url:F.string().optional(),model_3mf_url:F.string().optional(),model_gltf_url:F.string().optional(),model_glb_url:F.string().optional(),model_step_url:F.string().optional(),model_wrl_url:F.string().optional(),model_asset:GXr.optional(),model_unit_to_mm_scale_factor:F.number().optional(),model_board_normal_direction:F.enum(["x+","x-","y+","y-","z+","z-"]).optional().describe(`The direction in the model's coordinate space that is considered "up" or "coming out of the board surface"`),model_origin_position:pY.optional(),model_origin_alignment:F.enum(["unknown","center","center_of_component_on_board_surface","bottom_center_of_component"]).optional(),model_object_fit:F.enum(["contain_within_bounds","fill_bounds"]).optional().default("contain_within_bounds"),model_jscad:F.any().optional(),show_as_translucent_model:F.boolean().optional(),anchor_alignment:F.enum(["center","center_of_component_on_board_surface"]).optional().default("center")}).describe("Defines a component on the PCB"),Avn=F.enum(["sinewave","square","triangle","sawtooth"]),q$r=F.union([F.string(),F.number()]).transform((e)=>typeof e=="string"?e.endsWith("%")?parseFloat(e.slice(0,-1))/100:parseFloat(e):e).pipe(F.number().min(0,"Duty cycle must be non-negative").max(1,"Duty cycle cannot be greater than 100%")),J$r=F.object({type:F.literal("simulation_voltage_source"),simulation_voltage_source_id:Ao("simulation_voltage_source"),is_dc_source:F.literal(!0).optional().default(!0),positive_source_port_id:F.string().optional(),negative_source_port_id:F.string().optional(),positive_source_net_id:F.string().optional(),negative_source_net_id:F.string().optional(),voltage:Dk}).describe("Defines a DC voltage source for simulation"),Z$r=F.object({type:F.literal("simulation_voltage_source"),simulation_voltage_source_id:Ao("simulation_voltage_source"),is_dc_source:F.literal(!1),terminal1_source_port_id:F.string().optional(),terminal2_source_port_id:F.string().optional(),terminal1_source_net_id:F.string().optional(),terminal2_source_net_id:F.string().optional(),voltage:Dk.optional(),frequency:wZ.optional(),peak_to_peak_voltage:Dk.optional(),wave_shape:Avn.optional(),phase:p_.optional(),duty_cycle:q$r.optional()}).describe("Defines an AC voltage source for simulation"),eqr=F.union([J$r,Z$r]).describe("Defines a voltage source for simulation"),tqr=F.union([F.string(),F.number()]).transform((e)=>typeof e=="string"?e.endsWith("%")?parseFloat(e.slice(0,-1))/100:parseFloat(e):e).pipe(F.number().min(0,"Duty cycle must be non-negative").max(1,"Duty cycle cannot be greater than 100%")),nqr=F.object({type:F.literal("simulation_current_source"),simulation_current_source_id:Ao("simulation_current_source"),is_dc_source:F.literal(!0).optional().default(!0),positive_source_port_id:F.string().optional(),negative_source_port_id:F.string().optional(),positive_source_net_id:F.string().optional(),negative_source_net_id:F.string().optional(),current:sue}).describe("Defines a DC current source for simulation"),oqr=F.object({type:F.literal("simulation_current_source"),simulation_current_source_id:Ao("simulation_current_source"),is_dc_source:F.literal(!1),terminal1_source_port_id:F.string().optional(),terminal2_source_port_id:F.string().optional(),terminal1_source_net_id:F.string().optional(),terminal2_source_net_id:F.string().optional(),current:sue.optional(),frequency:wZ.optional(),peak_to_peak_current:sue.optional(),wave_shape:Avn.optional(),phase:p_.optional(),duty_cycle:tqr.optional()}).describe("Defines an AC current source for simulation"),rqr=F.union([nqr,oqr]).describe("Defines a current source for simulation"),iqr=F.union([F.literal("spice_dc_sweep"),F.literal("spice_dc_operating_point"),F.literal("spice_transient_analysis"),F.literal("spice_ac_analysis")]),sqr=F.object({type:F.literal("simulation_experiment"),simulation_experiment_id:Ao("simulation_experiment"),name:F.string(),experiment_type:iqr,time_per_step:qst.optional(),start_time_ms:hZ.optional(),end_time_ms:hZ.optional()}).describe("Defines a simulation experiment configuration"),aqr=F.object({type:F.literal("simulation_transient_voltage_graph"),simulation_transient_voltage_graph_id:Ao("simulation_transient_voltage_graph"),simulation_experiment_id:F.string(),timestamps_ms:F.array(F.number()).optional(),voltage_levels:F.array(F.number()),source_component_id:F.string().optional(),subcircuit_connectivity_map_key:F.string().optional(),time_per_step:qst,start_time_ms:hZ,end_time_ms:hZ,name:F.string().optional(),color:F.string().optional()}).describe("Stores voltage measurements over time for a simulation"),cqr=F.object({type:F.literal("simulation_switch"),simulation_switch_id:Ao("simulation_switch"),source_component_id:F.string().optional(),closes_at:hZ.optional(),opens_at:hZ.optional(),starts_closed:F.boolean().optional(),switching_frequency:wZ.optional()}).describe("Defines a switch for simulation timing control"),lqr=F.object({type:F.literal("simulation_voltage_probe"),simulation_voltage_probe_id:Ao("simulation_voltage_probe"),source_component_id:F.string().optional(),name:F.string().optional(),signal_input_source_port_id:F.string().optional(),signal_input_source_net_id:F.string().optional(),reference_input_source_port_id:F.string().optional(),reference_input_source_net_id:F.string().optional(),subcircuit_id:F.string().optional(),color:F.string().optional()}).describe("Defines a voltage probe for simulation. If a reference input is not provided, it measures against ground. If a reference input is provided, it measures the differential voltage between two points.").superRefine((e,t)=>{if(e.reference_input_source_port_id||e.reference_input_source_net_id){let n=!!e.signal_input_source_port_id||!!e.reference_input_source_port_id,o=!!e.signal_input_source_net_id||!!e.reference_input_source_net_id;n&&o?t.addIssue({code:F.ZodIssueCode.custom,message:"Cannot mix port and net connections in a differential probe."}):n?e.signal_input_source_port_id&&e.reference_input_source_port_id||t.addIssue({code:F.ZodIssueCode.custom,message:"Differential port probe requires both signal_input_source_port_id and reference_input_source_port_id."}):o&&(e.signal_input_source_net_id&&e.reference_input_source_net_id||t.addIssue({code:F.ZodIssueCode.custom,message:"Differential net probe requires both signal_input_source_net_id and reference_input_source_net_id."}))}else!!e.signal_input_source_port_id==!!e.signal_input_source_net_id&&t.addIssue({code:F.ZodIssueCode.custom,message:"A voltage probe must have exactly one of signal_input_source_port_id or signal_input_source_net_id."})}),hqr=Ch.extend({type:F.literal("simulation_unknown_experiment_error"),simulation_unknown_experiment_error_id:Ao("simulation_unknown_experiment_error"),error_type:F.literal("simulation_unknown_experiment_error").default("simulation_unknown_experiment_error"),simulation_experiment_id:F.string().optional(),subcircuit_id:F.string().optional()}).describe("An unknown error occurred during the simulation experiment."),dqr=F.object({type:F.literal("simulation_op_amp"),simulation_op_amp_id:Ao("simulation_op_amp"),source_component_id:F.string().optional(),inverting_input_source_port_id:F.string(),non_inverting_input_source_port_id:F.string(),output_source_port_id:F.string(),positive_supply_source_port_id:F.string(),negative_supply_source_port_id:F.string()}).describe("Defines a simple ideal operational amplifier for simulation"),fvn=(F.union([fjr,gjr,Ajr,_jr,xjr,yjr,W9n,Y9n,Zst,U9n,G9n,X9n,j9n,K9n,J9n,Z9n,evn,ivn,tvn,nvn,ovn,rvn,q9n,$9n,Ijr,Sjr,Cjr,svn,avn,cvn,lvn,hvn,Pjr,Ejr,Mjr,wjr,Bjr,dvn,bjr,uKr,pKr,I$r,v$r,S$r,M$r,w$r,B$r,xKr,A$r,CKr,UKr,QKr,FKr,zKr,WKr,MKr,RKr,XKr,jKr,P$r,qKr,JKr,ZKr,e$r,i$r,t$r,n$r,o$r,r$r,OKr,VKr,KKr,$Kr,YKr,GKr,V$r,Y$r,G$r,U$r,a$r,s$r,c$r,l$r,h$r,d$r,u$r,p$r,m$r,E$r,_$r,g$r,T$r,b$r,D$r,N$r,R$r,H$r,F$r,z$r,O$r,W$r,X$r,j$r,K$r,Tjr,Wjr,zjr,Ojr,Vjr,Yjr,Ljr,Fjr,Xjr,Gjr,Djr,Kjr,$jr,jjr,eKr,tKr,nKr,oKr,sKr,rKr,iKr,$$r,eqr,rqr,sqr,aqr,cqr,lqr,hqr,dqr]),!0),bde={CCW:-1,CW:1,NOT_ORIENTABLE:0},uqr=2*Math.PI,B8e=Object.freeze({__proto__:null,BOUNDARY:2,CCW:fvn,CONTAINS:3,CW:!1,END_VERTEX:2,INSIDE:1,INTERLACE:4,NOT_VERTEX:0,ORIENTATION:bde,OUTSIDE:0,OVERLAP_OPPOSITE:2,OVERLAP_SAME:1,PIx2:uqr,START_VERTEX:1}),JS=0.000001;function yvn(e){JS=e}function xvn(){return JS}function xrt(e){return e<JS&&e>-JS}function DY(e,t){return e-t<JS&&e-t>-JS}function Cvn(e,t){return e-t>JS}function bvn(e,t){return e-t<-JS}var Ue={Utils:Object.freeze({__proto__:null,DECIMALS:3,EQ:DY,EQ_0:xrt,GE:function(e,t){return e-t>-JS},GT:Cvn,LE:function(e,t){return e-t<JS},LT:bvn,getTolerance:xvn,setTolerance:yvn}),Errors:void 0,Matrix:void 0,Planar_set:void 0,Point:void 0,Vector:void 0,Line:void 0,Circle:void 0,Segment:void 0,Arc:void 0,Box:void 0,Edge:void 0,Face:void 0,Ray:void 0,Ray_shooting:void 0,Multiline:void 0,Polygon:void 0,Distance:void 0,Inversion:void 0};for(let e in B8e)Ue[e]=B8e[e];Object.defineProperty(Ue,"DP_TOL",{get:function(){return xvn()},set:function(e){yvn(e)}});var ju=class{static get ILLEGAL_PARAMETERS(){return ReferenceError("Illegal Parameters")}static get ZERO_DIVISION(){return Error("Zero division")}static get UNRESOLVED_BOUNDARY_CONFLICT(){return Error("Unresolved boundary conflict in boolean operation")}static get INFINITE_LOOP(){return Error("Infinite loop")}static get CANNOT_COMPLETE_BOOLEAN_OPERATION(){return Error("Cannot complete boolean operation")}static get CANNOT_INVOKE_ABSTRACT_METHOD(){return Error("Abstract method cannot be invoked")}static get OPERATION_IS_NOT_SUPPORTED(){return Error("Operation is not supported")}static get UNSUPPORTED_SHAPE_TYPE(){return Error("Unsupported shape type")}};Ue.Errors=ju;var nat=class{constructor(e,t){this.first=e,this.last=t||this.first}[Symbol.iterator](){let e;return{next:()=>(e=e?e.next:this.first,{value:e,done:e===void 0})}}get size(){let e=0;for(let t of this)e++;return e}toArray(e=void 0,t=void 0){let n=[],o=e||this.first,r=t||this.last,i=o;if(i===void 0)return n;do n.push(i),i=i.next;while(i!==r.next);return n}append(e){return this.isEmpty()?this.first=e:(e.prev=this.last,this.last.next=e),this.last=e,this.last.next=void 0,this.first.prev=void 0,this}insert(e,t){if(this.isEmpty())this.first=e,this.last=e;else if(t==null)e.next=this.first,this.first.prev=e,this.first=e;else{let n=t.next;t.next=e,n&&(n.prev=e),e.prev=t,e.next=n,this.last===t&&(this.last=e)}return this.last.next=void 0,this.first.prev=void 0,this}remove(e){return e===this.first&&e===this.last?(this.first=void 0,this.last=void 0):(e.prev&&(e.prev.next=e.next),e.next&&(e.next.prev=e.prev),e===this.first&&(this.first=e.next),e===this.last&&(this.last=e.prev)),this}isEmpty(){return this.first===void 0}static testInfiniteLoop(e){let t=e,n=e;do{if(t!=e&&t===n)throw ju.INFINITE_LOOP;t=t.next,n=n.next.next}while(t!=e)}},Vfn={stroke:"black"},pqr=class{constructor(e=Vfn){for(let t in e)this[t]=e[t];this.stroke=e.stroke??Vfn.stroke}toAttributesString(){return Object.keys(this).reduce((e,t)=>e+(this[t]!==void 0?this.toAttrString(t,this[t]):""),"")}toAttrString(e,t){let n=e==="className"?"class":this.convertCamelToKebabCase(e);return t===null?`${n} `:`${n}="${t.toString()}" `}convertCamelToKebabCase(e){return e.match(/[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[0-9]+/g).join("-").toLowerCase()}};function KY(e){return new pqr(e).toAttributesString()}function BZ(e,t){let n=[],[o,r,i]=e.standard,[s,a,c]=t.standard,l=o*a-r*s,h=i*a-r*c,d=o*c-i*s;if(!Ue.Utils.EQ_0(l)){let u,_;r===0?(u=i/o,_=d/l):a===0?(u=c/s,_=d/l):o===0?(u=h/l,_=i/r):s===0?(u=h/l,_=c/a):(u=h/l,_=d/l),n.push(new Ue.Point(u,_))}return n}function $Y(e,t){let n=[],o=t.pc.projectionOn(e),r=t.pc.distanceTo(o)[0];if(Ue.Utils.EQ(r,t.r))n.push(o);else if(Ue.Utils.LT(r,t.r)){let i,s,a=Math.sqrt(t.r*t.r-r*r);i=e.norm.rotate90CCW().multiply(a),s=o.translate(i),n.push(s),i=e.norm.rotate90CW().multiply(a),s=o.translate(i),n.push(s)}return n}function dZ(e,t){let n=[];for(let o of t.toSegments()){let r=Fue(o,e);for(let i of r)Bvn(i,n)||n.push(i)}return n}function L7e(e,t){let n=[];if(dZ(e,t.box).length===0)return n;let o=$Y(e,new Ue.Circle(t.pc,t.r));for(let r of o)r.on(t)&&n.push(r);return n}function Fue(e,t){let n=[];return e.ps.on(t)&&n.push(e.ps),e.pe.on(t)&&!e.isZeroLength()&&n.push(e.pe),n.length>0||e.isZeroLength()||e.ps.leftTo(t)&&e.pe.leftTo(t)||!e.ps.leftTo(t)&&!e.pe.leftTo(t)?n:BZ(new Ue.Line(e.ps,e.pe),t)}function T8e(e,t){let n=[];if(e.isZeroLength())return e.ps.on(t)&&n.push(e.ps),n;if(t.isZeroLength())return t.ps.on(e)&&n.push(t.ps),n;let o=new Ue.Line(e.ps,e.pe),r=new Ue.Line(t.ps,t.pe);if(o.incidentTo(r))e.ps.on(t)&&n.push(e.ps),e.pe.on(t)&&n.push(e.pe),!t.ps.on(e)||t.ps.equalTo(e.ps)||t.ps.equalTo(e.pe)||n.push(t.ps),!t.pe.on(e)||t.pe.equalTo(e.ps)||t.pe.equalTo(e.pe)||n.push(t.pe);else if(o.parallelTo(r)){let i=new Ue.Vector(e.ps,e.pe),s=new Ue.Vector(t.ps,t.pe),a=new Ue.Vector(e.ps,t.ps),c=i.cross(s);if(!Ue.Utils.EQ_0(c)){let l=a.cross(s)/c,h=a.cross(i)/c;Ue.Utils.GE(l,0)&&Ue.Utils.LE(l,1)&&Ue.Utils.GE(h,0)&&Ue.Utils.LE(h,1)&&n.push(Yfn(e.ps.translate(i.multiply(l)),e,t))}}else{let i=BZ(o,r);i.length>0&&Gfn(i[0],e)&&Gfn(i[0],t)&&n.push(Yfn(i[0],e,t))}return n}function Yfn(e,t,n){for(let o of[t.ps,t.pe,n.ps,n.pe])if(e.equalTo(o))return o;return e}function Gfn(e,t){let n=t.box;return Ue.Utils.LE(e.x,n.xmax)&&Ue.Utils.GE(e.x,n.xmin)&&Ue.Utils.LE(e.y,n.ymax)&&Ue.Utils.GE(e.y,n.ymin)}function D8e(e,t){let n=[];if(e.isZeroLength()){let[r,i]=e.ps.distanceTo(t.pc);return Ue.Utils.EQ(r,t.r)&&n.push(e.ps),n}let o=$Y(new Ue.Line(e.ps,e.pe),t);for(let r of o)r.on(e)&&n.push(r);return n}function uZ(e,t){let n=[];if(e.isZeroLength())return e.ps.on(t)&&n.push(e.ps),n;let o=$Y(new Ue.Line(e.ps,e.pe),new Ue.Circle(t.pc,t.r));for(let r of o)r.on(e)&&r.on(t)&&n.push(r);return n}function Ivn(e,t){let n=[],o=new Ue.Vector(e.pc,t.pc),r=e.r,i=t.r;if(Ue.Utils.EQ_0(r)||Ue.Utils.EQ_0(i))return n;if(Ue.Utils.EQ_0(o.x)&&Ue.Utils.EQ_0(o.y)&&Ue.Utils.EQ(r,i))return n.push(e.pc.translate(-r,0)),n;let s,a=e.pc.distanceTo(t.pc)[0];if(Ue.Utils.GT(a,r+i))return n;if(Ue.Utils.LT(a,Math.abs(r-i)))return n;if(o.x/=a,o.y/=a,Ue.Utils.EQ(a,r+i)||Ue.Utils.EQ(a,Math.abs(r-i)))return s=e.pc.translate(r*o.x,r*o.y),n.push(s),n;let c=r*r/(2*a)-i*i/(2*a)+a/2,l=e.pc.translate(c*o.x,c*o.y),h=Math.sqrt(r*r-c*c);return s=l.translate(o.rotate90CCW().multiply(h)),n.push(s),s=l.translate(o.rotate90CW().multiply(h)),n.push(s),n}function vvn(e,t){let n=[];if(e.pc.equalTo(t.pc)&&Ue.Utils.EQ(e.r,t.r)){let s;return s=e.start,s.on(t)&&n.push(s),s=e.end,s.on(t)&&n.push(s),s=t.start,s.on(e)&&n.push(s),s=t.end,s.on(e)&&n.push(s),n}let o=new Ue.Circle(e.pc,e.r),r=new Ue.Circle(t.pc,t.r),i=o.intersect(r);for(let s of i)s.on(e)&&s.on(t)&&n.push(s);return n}function oat(e,t){let n=[];if(t.pc.equalTo(e.pc)&&Ue.Utils.EQ(t.r,e.r))return n.push(e.start),n.push(e.end),n;let o=Ivn(t,new Ue.Circle(e.pc,e.r));for(let r of o)r.on(e)&&n.push(r);return n}function Svn(e,t){return e.isSegment?T8e(e.shape,t):uZ(t,e.shape)}function Pvn(e,t){return e.isSegment?uZ(e.shape,t):vvn(e.shape,t)}function Evn(e,t){return e.isSegment?Fue(e.shape,t):L7e(t,e.shape)}function mqr(e,t){return e.isSegment?D8e(e.shape,t):oat(e.shape,t)}function rat(e,t){let n=[];for(let o of t.edges)for(let r of Svn(o,e))n.push(r);return n}function iat(e,t){let n=[];for(let o of t.edges)for(let r of Pvn(o,e))n.push(r);return n}function zue(e,t){let n=[];if(t.isEmpty())return n;for(let o of t.edges)for(let r of Evn(o,e))Bvn(r,n)||n.push(r);return e.sortPoints(n)}function Mvn(e,t){let n=[];if(t.isEmpty())return n;for(let o of t.edges)for(let r of mqr(o,e))n.push(r);return n}function wvn(e,t){return e.isSegment?Svn(t,e.shape):e.isArc?Pvn(t,e.shape):e.isLine?Evn(t,e.shape):e.isRay?(n=t,o=e.shape,n.isSegment?sat(o,n.shape):aat(o,n.shape)):[];var n,o}function Ufn(e,t){let n=[];if(t.isEmpty()||e.shape.box.not_intersect(t.box))return n;let o=t.edges.search(e.shape.box);for(let r of o)n=[...n,...wvn(e,r)];return n}function Bvn(e,t){return t.some((n)=>n.equalTo(e))}function vk(e){return new Ue.Line(e.start,e.norm)}function sat(e,t){return Fue(t,vk(e)).filter((n)=>e.contains(n))}function aat(e,t){return L7e(vk(e),t).filter((n)=>e.contains(n))}function Tvn(e,t){return $Y(vk(e),t).filter((n)=>e.contains(n))}function Dvn(e,t){return BZ(vk(e),t).filter((n)=>e.contains(n))}function Nvn(e,t){return zue(vk(e),t).filter((n)=>e.contains(n))}function Rvn(e,t){if(e.intersect&&e.intersect instanceof Function)return e.intersect(t);throw ju.UNSUPPORTED_SHAPE_TYPE}function TZ(e,t){let n=[];for(let o of t)n=[...n,...Rvn(e,o.shape)];return n}var IY=class e extends nat{constructor(...t){if(super(),this.isInfinite=!1,t.length===1&&t[0]instanceof Array&&t[0].length>0){let n=t[0],o=n.length,r=(s)=>s instanceof Ue.Segment||s instanceof Ue.Arc||s instanceof Ue.Ray,i=(s)=>s instanceof Ue.Segment||s instanceof Ue.Arc;if(!(o===1&&((s)=>s instanceof Ue.Segment||s instanceof Ue.Arc||s instanceof Ue.Ray||s instanceof Ue.Line)(n[0])||o>1&&r(n[0])&&r(n[o-1])&&n.slice(1,o-1).every(i)))throw Ue.Errors.ILLEGAL_PARAMETERS;this.isInfinite=n.some((s)=>s instanceof Ue.Ray||s instanceof Ue.Line);for(let s of n){let a=new Ue.Edge(s);this.append(a)}this.setArcLength()}}get edges(){return[...this]}get box(){return this.edges.reduce((t,n)=>t.merge(n.box),new Ue.Box)}get vertices(){let t=this.edges.map((n)=>n.start);return t.push(this.last.end),t}get length(){if(this.isEmpty())return 0;if(this.isInfinite)return Number.POSITIVE_INFINITY;let t=0;for(let n of this)t+=n.length;return t}clone(){return new e(this.toShapes())}setArcLength(){for(let t of this)this.setOneEdgeArcLength(t)}setOneEdgeArcLength(t){t===this.first?t.arc_length=0:t.arc_length=t.prev.arc_length+t.prev.length}pointAtLength(t){if(t>this.length||t<0)return null;if(this.isInfinite)return null;let n=null;for(let o of this)if(t>=o.arc_length&&(o===this.last||t<o.next.arc_length)){n=o.pointAtLength(t-o.arc_length);break}return n}addVertex(t,n){let o=n.shape.split(t);if(o[0]===null)return n.prev;if(o[1]===null)return n;let r=new Ue.Edge(o[0]),i=n.prev;return this.insert(r,i),n.shape=o[1],r}getChain(t,n){let o=[];for(let r=t;r!==n.next;r=r.next)o.push(r);return o}split(t){for(let n of t){let o=this.findEdgeByPoint(n);this.addVertex(n,o)}return this}findEdgeByPoint(t){let n;for(let o of this)if(o.shape.contains(t)){n=o;break}return n}distanceTo(t){if(t instanceof Point){let[n,o]=Ue.Distance.shape2multiline(t,this);return[n,o.reverse()]}if(t instanceof Ue.Line){let[n,o]=Ue.Distance.shape2multiline(t,this);return[n,o.reverse()]}if(t instanceof Ue.Circle){let[n,o]=Ue.Distance.shape2multiline(t,this);return[n,o.reverse()]}if(t instanceof Ue.Segment){let[n,o]=Ue.Distance.shape2multiline(t,this);return[n,o.reverse()]}if(t instanceof Ue.Arc){let[n,o]=Ue.Distance.shape2multiline(t,this);return[n,o.reverse()]}if(t instanceof Ue.Multiline)return Ue.Distance.multiline2multiline(this,t);throw Ue.Errors.UNSUPPORTED_SHAPE_TYPE}intersect(t){return t instanceof Ue.Multiline?function(n,o){let r=[];for(let i of n)for(let s of o)r=[...r,...Rvn(i.shape,s.shape)];return r}(this,t):TZ(t,this)}contains(t){if(t instanceof Ue.Point)return this.edges.some((n)=>n.shape.contains(t));throw Ue.Errors.UNSUPPORTED_SHAPE_TYPE}translate(t){return new e(this.edges.map((n)=>n.shape.translate(t)))}rotate(t=0,n=new Ue.Point){return new e(this.edges.map((o)=>o.shape.rotate(t,n)))}transform(t=new Ue.Matrix){return new e(this.edges.map((n)=>n.shape.transform(t)))}toShapes(){return this.edges.map((t)=>t.shape.clone())}toJSON(){return this.edges.map((t)=>t.toJSON())}svgPoints(){return this.vertices.map((t)=>`${t.x},${t.y}`).join(" ")}dpath(){let t=`M${this.first.start.x},${this.first.start.y}`;for(let n of this)t+=n.svg();return t}svg(t={}){let n=`
<path ${KY({fill:"none",...t})} d="`;n+=`
M${this.first.start.x},${this.first.start.y}`;for(let o of this)n+=o.svg();return n+=`" >
</path>`,n}};Ue.Multiline=IY;function pZ(e,t,n){let o=n.length,r=e.shape.split(t);if(r.length===0)return;let i=0;i=r[0]===null?0:r[1]===null?e.shape.length:r[0].length;let s,a=0;DY(i,0)&&(a|=1),DY(i,e.shape.length)&&(a|=2),s=i===1/0?r[0].coord(t):2&a&&e.next&&e.next.arc_length===0?0:e.arc_length+i,n.push({id:o,pt:t,arc_length:s,edge_before:e,edge_after:void 0,face:e.face,is_vertex:a})}function aue(e){e.int_points1_sorted=sk(e.int_points1),e.int_points2_sorted=sk(e.int_points2)}function sk(e){let t=new Map,n=0;for(let o of e)t.has(o.face)||(t.set(o.face,n),n++);for(let o of e)o.faceId=t.get(o.face);return e.slice().sort(_qr)}function _qr(e,t){return e.faceId<t.faceId?-1:e.faceId>t.faceId?1:e.arc_length<t.arc_length?-1:e.arc_length>t.arc_length?1:0}function cat(e){if(e.int_points1.length<2)return;let t,n,o,r,i=!1;for(let s=0;s<e.int_points1_sorted.length;s++)if(e.int_points1_sorted[s].id!==-1){t=e.int_points1_sorted[s],n=e.int_points2[t.id];for(let a=s+1;a<e.int_points1_sorted.length&&(o=e.int_points1_sorted[a],DY(o.arc_length,t.arc_length));a++)o.id!==-1&&(r=e.int_points2[o.id],r.id!==-1&&o.edge_before===t.edge_before&&o.edge_after===t.edge_after&&r.edge_before===n.edge_before&&r.edge_after===n.edge_after&&(o.id=-1,r.id=-1,i=!0))}n=e.int_points2_sorted[0],t=e.int_points1[n.id];for(let s=1;s<e.int_points2_sorted.length;s++){let a=e.int_points2_sorted[s];if(a.id===-1)continue;if(n.id===-1||!DY(a.arc_length,n.arc_length)){n=a,t=e.int_points1[n.id];continue}let c=e.int_points1[a.id];c.edge_before===t.edge_before&&c.edge_after===t.edge_after&&a.edge_before===n.edge_before&&a.edge_after===n.edge_after&&(c.id=-1,a.id=-1,i=!0)}i&&(e.int_points1=e.int_points1.filter((s)=>s.id>=0),e.int_points2=e.int_points2.filter((s)=>s.id>=0),e.int_points1.forEach((s,a)=>s.id=a),e.int_points2.forEach((s,a)=>s.id=a))}function Crt(e){for(let t of e)t.edge_before&&(t.edge_before.bvStart=void 0,t.edge_before.bvEnd=void 0,t.edge_before.bv=void 0,t.edge_before.overlap=void 0),t.edge_after&&(t.edge_after.bvStart=void 0,t.edge_after.bvEnd=void 0,t.edge_after.bv=void 0,t.edge_after.overlap=void 0);for(let t of e)t.edge_before&&(t.edge_before.bvEnd=2),t.edge_after&&(t.edge_after.bvStart=2)}function brt(e,t){for(let n of e)n.edge_before&&n.edge_before.setInclusion(t),n.edge_after&&n.edge_after.setInclusion(t)}function mZ(e,t,n){let o,r,i=1;if(e.length===1)return 1;o=e[t];for(let s=t+1;s<e.length&&o.face===n&&(r=e[s],r.pt.equalTo(o.pt)&&r.edge_before===o.edge_before&&r.edge_after===o.edge_after);s++)i++;return i}function _Z(e,t){if(t){for(let n of t){let o=n.edge_before;if(n.is_vertex=0,o.shape.start&&o.shape.start.equalTo(n.pt)&&(n.is_vertex|=1),o.shape.end&&o.shape.end.equalTo(n.pt)&&(n.is_vertex|=2),1&n.is_vertex){n.edge_before=o.prev,o.prev&&(n.is_vertex=2);continue}if(2&n.is_vertex)continue;let r=e.addVertex(n.pt,o);n.edge_before=r}for(let n of t)n.edge_before?n.edge_after=n.edge_before.next:e instanceof IY&&1&n.is_vertex&&(n.edge_after=e.first)}}function Wfn(e,t,n){let o=e.edge_before,r=t.edge_after,i=n.length;o.next=n[0],n[0].prev=o,n[i-1].next=r,r.prev=n[i-1]}Ue.multiline=(...e)=>new Ue.Multiline(...e);var{INSIDE:QS,OUTSIDE:kS,BOUNDARY:vA,OVERLAP_SAME:gqr,OVERLAP_OPPOSITE:Aqr}=B8e,{NOT_VERTEX:ejs,START_VERTEX:Xfn,END_VERTEX:jfn}=B8e;function Irt(e,t){let n=t.clone().reverse(),[o,r]=Oue(e,n,3,!0);return o}function Qvn(e,t){let[n,o]=Oue(e,t,2,!0);return n}function kvn(e,t){let[n,o]=Oue(e,t,2,!1),r=[];for(let s of n.faces)r=[...r,...[...s.edges].map((a)=>a.shape)];let i=[];for(let s of o.faces)i=[...i,...[...s.edges].map((a)=>a.shape)];return[r,i]}function vrt(e,t){let[n,o]=Oue(e,t,3,!1),r=[];for(let i of n.faces)r=[...r,...[...i.edges].map((s)=>s.shape)];return r}function Lvn(e,t){let n=e.clone(),o=t.clone(),r=Hvn(n,o);return aue(r),_Z(n,r.int_points1_sorted),_Z(o,r.int_points2_sorted),cat(r),aue(r),[r.int_points1_sorted.map((i)=>i.pt),r.int_points2_sorted.map((i)=>i.pt)]}function fqr(e,t,n,o){let r=Kfn(e,n.int_points1),i=Kfn(t,n.int_points2);for($fn(r,t),$fn(i,e),Crt(n.int_points1),Crt(n.int_points2),brt(n.int_points1,t),brt(n.int_points2,e);yqr(e,t,n.int_points1,n.int_points1_sorted,n.int_points2,n););(function(s){let a,c,l,h=s.int_points1.length;for(let d=0;d<h;d++){let u=s.int_points1_sorted[d];u.face!==a&&(c=d,a=u.face);let _,p=d,m=mZ(s.int_points1_sorted,d,a);_=p+m<h&&s.int_points1_sorted[p+m].face===a?p+m:c;let A=mZ(s.int_points1_sorted,_,a);l=null;for(let I=_;I<_+A;I++){let v=s.int_points1_sorted[I];if(v.face===a&&s.int_points2[v.id].face===s.int_points2[u.id].face){l=v;break}}if(l===null)continue;let g=u.edge_after,f=l.edge_before;if(g.bv!==2||f.bv!==2)continue;if(g!==f)continue;let y=s.int_points2[u.id],x=s.int_points2[l.id],C=y.edge_after,b=x.edge_before;C.bv===2&&b.bv===2&&C===b||(y=s.int_points2[l.id],x=s.int_points2[u.id],C=y.edge_after,b=x.edge_before),C.bv===2&&b.bv===2&&C===b&&g.setOverlap(C)}})(n),Srt(e,o,n.int_points1_sorted,!0),Srt(t,o,n.int_points2_sorted,!1),qfn(e,r,o,!0),qfn(t,i,o,!1)}function Oue(e,t,n,o){let r=e.clone(),i=t.clone(),s=Hvn(r,i);return aue(s),_Z(r,s.int_points1_sorted),_Z(i,s.int_points2_sorted),cat(s),aue(s),fqr(r,i,s,n),o&&function(a,c,l){(function(h,d,u,_){for(let p of d.faces){for(let m of p)h.edges.add(m);_.find((m)=>m.face===p)===void 0&&h.addFace(p.first,p.last)}})(a,c,0,l.int_points2),function(h,d,u){if(u.int_points1.length!==0)for(let _=0;_<u.int_points1.length;_++){let p=u.int_points1[_],m=u.int_points2[_];if(p.edge_before!==void 0&&p.edge_after===void 0&&m.edge_before===void 0&&m.edge_after!==void 0&&(p.edge_before.next=m.edge_after,m.edge_after.prev=p.edge_before,p.edge_after=m.edge_after,m.edge_before=p.edge_before),m.edge_before!==void 0&&m.edge_after===void 0&&p.edge_before===void 0&&p.edge_after!==void 0&&(m.edge_before.next=p.edge_after,p.edge_after.prev=m.edge_before,m.edge_after=p.edge_after,p.edge_before=m.edge_before),p.edge_before!==void 0&&p.edge_after===void 0)for(let A of u.int_points1_sorted)A!==p&&A.edge_before===void 0&&A.edge_after!==void 0&&A.pt.equalTo(p.pt)&&(p.edge_before.next=A.edge_after,A.edge_after.prev=p.edge_before,p.edge_after=A.edge_after,A.edge_before=p.edge_before);if(m.edge_before!==void 0&&m.edge_after===void 0)for(let A of u.int_points2_sorted)A!==m&&A.edge_before===void 0&&A.edge_after!==void 0&&A.pt.equalTo(m.pt)&&(m.edge_before.next=A.edge_after,A.edge_after.prev=m.edge_before,m.edge_after=A.edge_after,A.edge_before=m.edge_before)}}(0,0,l),Prt(a,l.int_points1),Prt(c,l.int_points2),Ert(a,l.int_points1,l.int_points2),Ert(a,l.int_points2,l.int_points1),Jfn(a),Jfn(c)}(r,i,s),[r,i]}function Hvn(e,t){let n={int_points1:[],int_points2:[]};for(let o of e.edges){let r=t.edges.search(o.box);for(let i of r){let s=o.shape.intersect(i.shape);for(let a of s)pZ(o,a,n.int_points1),pZ(i,a,n.int_points2)}}return n}function Kfn(e,t){let n=[];for(let o of e.faces)t.find((r)=>r.face===o)||n.push(o);return n}function $fn(e,t){for(let n of e)n.first.bv=n.first.bvStart=n.first.bvEnd=void 0,n.first.setInclusion(t)}function yqr(e,t,n,o,r,i){let s,a,c,l=o.length,h=!1;for(let d=0;d<l;d++){let u=o[d];u.face!==s&&(a=d,s=u.face);let _,p=d,m=mZ(o,d,s);_=p+m<l&&o[p+m].face===s?p+m:a;let A=mZ(o,_,s);c=null;for(let y=_;y<_+A;y++){let x=o[y];if(x.face===s&&r[x.id].face===r[u.id].face){c=x;break}}if(c===null)continue;let g=u.edge_after,f=c.edge_before;if(g.bv!==vA||f.bv==vA)if(g.bv==vA||f.bv!==vA){if(g.bv===vA&&f.bv===vA&&g!=f||g.bv===QS&&f.bv===kS||g.bv===kS&&f.bv===QS){let y=g.next;for(;y!=f;)y.bvStart=void 0,y.bvEnd=void 0,y.bv=void 0,y.setInclusion(t),y=y.next}if(g.bv===vA&&f.bv===vA&&g!=f){let y,x=g.next;for(;x!=f;){if(x.bv!=vA){if(y===void 0)y=x.bv;else if(x.bv!=y)throw ju.UNRESOLVED_BOUNDARY_CONFLICT}x=x.next}y!=null&&(g.bv=y,f.bv=y);continue}if(g.bv===QS&&f.bv===kS||g.bv===kS&&f.bv===QS){let y=g;for(;y!=f;){if(y.bvStart===g.bv&&y.bvEnd===f.bv){let[x,C]=y.shape.distanceTo(t);if(x<10*Ue.DP_TOL){pZ(y,C.ps,n);let b=n[n.length-1];if(b.is_vertex&Xfn)b.edge_after=y,b.edge_before=y.prev,y.bvStart=vA,y.bv=void 0,y.setInclusion(t);else if(b.is_vertex&jfn)b.edge_after=y.next,y.bvEnd=vA,y.bv=void 0,y.setInclusion(t);else{let P=t.addVertex(b.pt,y);b.edge_before=P,b.edge_after=P.next,P.setInclusion(t),P.next.bvStart=vA,P.next.bvEnd=void 0,P.next.bv=void 0,P.next.setInclusion(t)}let I=t.findEdgeByPoint(C.pe);pZ(I,C.pe,r);let v=r[r.length-1];if(v.is_vertex&Xfn)v.edge_after=I,v.edge_before=I.prev;else if(v.is_vertex&jfn)v.edge_after=I.next;else{let P=r.find((B)=>B.edge_after===I),M=t.addVertex(v.pt,I);v.edge_before=M,v.edge_after=M.next,P&&(P.edge_after=M),M.bvStart=void 0,M.bvEnd=vA,M.bv=void 0,M.setInclusion(e),M.next.bvStart=vA,M.next.bvEnd=void 0,M.next.bv=void 0,M.next.setInclusion(e)}aue(i),h=!0;break}}y=y.next}if(h)break;throw ju.UNRESOLVED_BOUNDARY_CONFLICT}}else f.bv=g.bv;else g.bv=f.bv}return h}function Srt(e,t,n,o){if(!n)return;let r,i,s,a;for(let c=0;c<n.length;c++){if(s=n[c],s.face!==r&&(i=c,r=s.face),r.isEmpty())continue;let l,h=c,d=mZ(n,c,r);l=h+d<n.length&&n[h+d].face===s.face?h+d:i,a=n[l];let u=l,_=mZ(n,u,r),p=s.edge_after,m=a.edge_before;if(p.bv===QS&&m.bv===QS&&t===1||p.bv===kS&&m.bv===kS&&t===2||(p.bv===kS||m.bv===kS)&&t===3&&!o||(p.bv===QS||m.bv===QS)&&t===3&&o||p.bv===vA&&m.bv===vA&&p.overlap&gqr&&o||p.bv===vA&&m.bv===vA&&p.overlap&Aqr){e.removeChain(r,p,m);for(let A=h;A<h+d;A++)n[A].edge_after=void 0;for(let A=u;A<u+_;A++)n[A].edge_before=void 0}c+=d-1}}function Prt(e,t){for(let n of t)e.faces.delete(n.face),n.face=void 0,n.edge_before&&(n.edge_before.face=void 0),n.edge_after&&(n.edge_after.face=void 0)}function Ert(e,t,n){for(let o of t){if(o.edge_before===void 0||o.edge_after===void 0)continue;if(o.face)continue;if(o.edge_after.face||o.edge_before.face)continue;let{edge_after:r,edge_before:i}=o;try{nat.testInfiniteLoop(r)}catch(a){throw ju.CANNOT_COMPLETE_BOOLEAN_OPERATION}let s=e.addFace(r,i);for(let a of t)a.edge_before&&a.edge_after&&a.edge_before.face===s&&a.edge_after.face===s&&(a.face=s);for(let a of n)a.edge_before&&a.edge_after&&a.edge_before.face===s&&a.edge_after.face===s&&(a.face=s)}}function qfn(e,t,n,o){for(let r of t){let i=r.first.bv;(n===1&&i===QS||n===3&&i===QS&&o||n===3&&i===kS&&!o||n===2&&i===kS)&&e.deleteFace(r)}}function Jfn(e){let t=[];for(let n of e.edges)n.face&&e.faces.has(n.face)||t.push(n);for(let n of t)e.edges.delete(n)}var xqr=Object.freeze({__proto__:null,BOOLEAN_INTERSECT:2,BOOLEAN_SUBTRACT:3,BOOLEAN_UNION:1,calculateIntersections:Lvn,innerClip:kvn,intersect:Qvn,outerClip:vrt,removeNotRelevantChains:Srt,removeOldFaces:Prt,restoreFaces:Ert,subtract:Irt,unify:function(e,t){let[n,o]=Oue(e,t,1,!0);return n}}),Cqr=RegExp("T.F..FFF.|T.F...F.."),bqr=RegExp("T........|.T.......|...T.....|....T...."),Iqr=RegExp("FT.......|F..T.....|F...T...."),vqr=RegExp("T.F..F..."),Sqr=RegExp("T.F..F...|.TF..F...|..FT.F...|..F.TF..."),HJ=class{constructor(){this.m=[,,,,,,,,,].fill(void 0)}get I2I(){return this.m[0]}set I2I(e){this.m[0]=e}get I2B(){return this.m[1]}set I2B(e){this.m[1]=e}get I2E(){return this.m[2]}set I2E(e){this.m[2]=e}get B2I(){return this.m[3]}set B2I(e){this.m[3]=e}get B2B(){return this.m[4]}set B2B(e){this.m[4]=e}get B2E(){return this.m[5]}set B2E(e){this.m[5]=e}get E2I(){return this.m[6]}set E2I(e){this.m[6]=e}get E2B(){return this.m[7]}set E2B(e){this.m[7]=e}get E2E(){return this.m[8]}set E2E(e){this.m[8]=e}toString(){return this.m.map((e)=>e instanceof Array&&e.length>0?"T":e instanceof Array&&e.length===0?"F":"*").join("")}equal(){return Cqr.test(this.toString())}intersect(){return bqr.test(this.toString())}touch(){return Iqr.test(this.toString())}inside(){return vqr.test(this.toString())}covered(){return Sqr.test(this.toString())}};function Ide(e,t){let n,o=new Ue.Ray(t),r=new Ue.Line(o.pt,o.norm),i=new Ue.Box(o.box.xmin-Ue.DP_TOL,o.box.ymin-Ue.DP_TOL,o.box.xmax+Ue.DP_TOL,o.box.ymax+Ue.DP_TOL);if(e.box.not_intersect(i))return Ue.OUTSIDE;let s=e.edges.search(i);if(s.length===0)return Ue.OUTSIDE;for(let h of s)if(h.shape.contains(t))return Ue.BOUNDARY;let a=[...e.faces],c=[];for(let h of s)for(let d of o.intersect(h.shape)){if(d.equalTo(t))return Ue.BOUNDARY;c.push({pt:d,edge:h,face_index:a.indexOf(h.face)})}c.sort((h,d)=>bvn(h.pt.x,d.pt.x)?-1:Cvn(h.pt.x,d.pt.x)?1:h.face_index<d.face_index?-1:h.face_index>d.face_index?1:h.edge.arc_length<d.edge.arc_length?-1:h.edge.arc_length>d.edge.arc_length?1:0);let l=0;for(let h=0;h<c.length;h++){let d=c[h];if(d.pt.equalTo(d.edge.shape.start)){if(h>0&&d.pt.equalTo(c[h-1].pt)&&d.face_index===c[h-1].face_index&&d.edge.prev===c[h-1].edge)continue;let u=d.edge.prev;for(;xrt(u.length);)u=u.prev;let _=u.shape.tangentInEnd(),p=d.pt.translate(_),m=d.edge.shape.tangentInStart(),A=d.pt.translate(m),g=p.leftTo(r),f=A.leftTo(r);(g&&!f||!g&&f)&&l++}else if(d.pt.equalTo(d.edge.shape.end)){if(h>0&&d.pt.equalTo(c[h-1].pt)&&d.face_index===c[h-1].face_index&&d.edge.next===c[h-1].edge)continue;let u=d.edge.next;for(;xrt(u.length);)u=u.next;let _=u.shape.tangentInStart(),p=d.pt.translate(_),m=d.edge.shape.tangentInEnd(),A=d.pt.translate(m),g=p.leftTo(r),f=A.leftTo(r);(g&&!f||!g&&f)&&l++}else if(d.edge.shape instanceof Ue.Segment)l++;else{let u=d.edge.shape.box;DY(d.pt.y,u.ymin)||DY(d.pt.y,u.ymax)||l++}}return n=l%2==1?1:0,n}function Zfn(e,t){return WJ(e,t).intersect()}function e2n(e,t){return WJ(e,t).inside()}function Fvn(e,t){return WJ(e,t).covered()}function zvn(e,t){return Fvn(t,e)}function WJ(e,t){return e instanceof Ue.Line&&t instanceof Ue.Line?function(n,o){let r=new HJ,i=BZ(n,o);return i.length===0?n.contains(o.pt)&&o.contains(n.pt)?(r.I2I=[n],r.I2E=[],r.E2I=[]):(r.I2I=[],r.I2E=[n],r.E2I=[o]):(r.I2I=i,r.I2E=n.split(i),r.E2I=o.split(i)),r}(e,t):e instanceof Ue.Line&&t instanceof Ue.Circle?function(n,o){let r=new HJ,i=$Y(n,o);if(i.length===0)r.I2I=[],r.I2B=[],r.I2E=[n],r.E2I=[o];else if(i.length===1)r.I2I=[],r.I2B=i,r.I2E=n.split(i),r.E2I=[o];else{let s=new IY([n]),a=n.sortPoints(i);s.split(a);let c=s.toShapes();r.I2I=[c[1]],r.I2B=a,r.I2E=[c[0],c[2]],r.E2I=new Ue.Polygon([o.toArc()]).cutWithLine(n)}return r}(e,t):e instanceof Ue.Line&&t instanceof Ue.Box?function(n,o){let r=new HJ,i=dZ(n,o);if(i.length===0)r.I2I=[],r.I2B=[],r.I2E=[n],r.E2I=[o];else if(i.length===1)r.I2I=[],r.I2B=i,r.I2E=n.split(i),r.E2I=[o];else{let s=new IY([n]),a=n.sortPoints(i);s.split(a);let c=s.toShapes();o.toSegments().some((l)=>l.contains(i[0])&&l.contains(i[1]))?(r.I2I=[],r.I2B=[c[1]],r.I2E=[c[0],c[2]],r.E2I=[o]):(r.I2I=[c[1]],r.I2B=a,r.I2E=[c[0],c[2]],r.E2I=new Ue.Polygon(o.toSegments()).cutWithLine(n))}return r}(e,t):e instanceof Ue.Line&&t instanceof Ue.Polygon?function(n,o){let r=new HJ,i=zue(n,o),s=new IY([n]),a=i.length>0?i.slice():n.sortPoints(i);return s.split(a),[...s].forEach((c)=>c.setInclusion(o)),r.I2I=[...s].filter((c)=>c.bv===Ue.INSIDE).map((c)=>c.shape),r.I2B=[...s].slice(1).map((c)=>c.bv===Ue.BOUNDARY?c.shape:c.shape.start),r.I2E=[...s].filter((c)=>c.bv===Ue.OUTSIDE).map((c)=>c.shape),r.E2I=o.cutWithLine(n),r}(e,t):(e instanceof Ue.Segment||e instanceof Ue.Arc)&&t instanceof Ue.Polygon?t2n(e,t):(e instanceof Ue.Segment||e instanceof Ue.Arc)&&(t instanceof Ue.Circle||t instanceof Ue.Box)?t2n(e,new Ue.Polygon(t)):e instanceof Ue.Polygon&&t instanceof Ue.Polygon?V9e(e,t):(e instanceof Ue.Circle||e instanceof Ue.Box)&&(t instanceof Ue.Circle||t instanceof Ue.Box)?V9e(new Ue.Polygon(e),new Ue.Polygon(t)):(e instanceof Ue.Circle||e instanceof Ue.Box)&&t instanceof Ue.Polygon?V9e(new Ue.Polygon(e),t):e instanceof Ue.Polygon&&(t instanceof Ue.Circle||t instanceof Ue.Box)?V9e(e,new Ue.Polygon(t)):void 0}function t2n(e,t){let n=new HJ,o=function(s,a){return s instanceof Ue.Line?zue(s,a):s instanceof Ue.Segment?rat(s,a):s instanceof Ue.Arc?iat(s,a):[]}(e,t),r=o.length>0?o.slice():e.sortPoints(o),i=new IY([e]);i.split(r),[...i].forEach((s)=>s.setInclusion(t)),n.I2I=[...i].filter((s)=>s.bv===Ue.INSIDE).map((s)=>s.shape),n.I2B=[...i].slice(1).map((s)=>s.bv===Ue.BOUNDARY?s.shape:s.shape.start),n.I2E=[...i].filter((s)=>s.bv===Ue.OUTSIDE).map((s)=>s.shape),n.B2I=[],n.B2B=[],n.B2E=[];for(let s of[e.start,e.end])switch(Ide(t,s)){case Ue.INSIDE:n.B2I.push(s);break;case Ue.BOUNDARY:n.B2B.push(s);break;case Ue.OUTSIDE:n.B2E.push(s)}return n}function V9e(e,t){let n=new HJ,[o,r]=Lvn(e,t),i=Qvn(e,t),s=Irt(e,t),a=Irt(t,e),[c,l]=kvn(e,t),h=vrt(e,t),d=vrt(t,e);return n.I2I=i.isEmpty()?[]:[i],n.I2B=l,n.I2E=s.isEmpty()?[]:[s],n.B2I=c,n.B2B=o,n.B2E=h,n.E2I=a.isEmpty()?[]:[a],n.E2B=d,n}var Pqr=Object.freeze({__proto__:null,contain:function(e,t){return e2n(t,e)},cover:zvn,covered:Fvn,disjoint:function(e,t){return!Zfn(e,t)},equal:function(e,t){return WJ(e,t).equal()},inside:e2n,intersect:Zfn,relate:WJ,touch:function(e,t){return WJ(e,t).touch()}}),vde=class e{constructor(t=1,n=0,o=0,r=1,i=0,s=0){this.a=t,this.b=n,this.c=o,this.d=r,this.tx=i,this.ty=s}fromMatrix3x3(t){let[n,o,r]=t[0],[i,s,a]=t[1];return new e(n,i,o,s,r,a)}toMatrix3x3(){return[[this.a,this.c,this.tx],[this.b,this.d,this.ty],[0,0,1]]}clone(){return new e(this.a,this.b,this.c,this.d,this.tx,this.ty)}transform(t){return[t[0]*this.a+t[1]*this.c+this.tx,t[0]*this.b+t[1]*this.d+this.ty]}multiply(t){return new e(this.a*t.a+this.c*t.b,this.b*t.a+this.d*t.b,this.a*t.c+this.c*t.d,this.b*t.c+this.d*t.d,this.a*t.tx+this.c*t.ty+this.tx,this.b*t.tx+this.d*t.ty+this.ty)}translate(...t){let n,o;if(t.length!=1||isNaN(t[0].x)||isNaN(t[0].y)){if(t.length!==2||typeof t[0]!="number"||typeof t[1]!="number")throw ju.ILLEGAL_PARAMETERS;n=t[0],o=t[1]}else n=t[0].x,o=t[0].y;return this.multiply(new e(1,0,0,1,n,o))}rotate(t,n=0,o=0){let r=Math.cos(t),i=Math.sin(t);return this.translate(n,o).multiply(new e(r,i,-i,r,0,0)).translate(-n,-o)}scale(t,n){return this.multiply(new e(t,0,0,n,0,0))}equalTo(t){return!!Ue.Utils.EQ(this.tx,t.tx)&&(!!Ue.Utils.EQ(this.ty,t.ty)&&(!!Ue.Utils.EQ(this.a,t.a)&&(!!Ue.Utils.EQ(this.b,t.b)&&(!!Ue.Utils.EQ(this.c,t.c)&&!!Ue.Utils.EQ(this.d,t.d)))))}};Ue.Matrix=vde;Ue.matrix=(...e)=>new Ue.Matrix(...e);var Eqr=class{constructor(e,t){this.low=e,this.high=t}get max(){return this.clone()}less_than(e){return this.low<e.low||this.low===e.low&&this.high<e.high}equal_to(e){return this.low===e.low&&this.high===e.high}intersect(e){return!this.not_intersect(e)}not_intersect(e){return this.high<e.low||e.high<this.low}merge(e){let t=this.low===void 0?e.low:this.low<e.low?this.low:e.low,n=this.high===void 0?e.high:this.high>e.high?this.high:e.high,o=this.clone();return o.low=t,o.high=n,o}output(){return[this.low,this.high]}comparable_less_than(e,t){return e<t}},Mqr=class e extends Eqr{clone(){return new e(this.low,this.high)}},WQ=class{constructor(e,t,n=null,o=null,r=null,i=0){if(this.left=n,this.right=o,this.parent=r,this.color=i,this.item={key:void 0,values:[]},t!==void 0&&this.item.values.push(t),e!==void 0)if(Array.isArray(e)){let[s,a]=e;if(!Number.isNaN(s)&&!Number.isNaN(a)){let c=s,l=a;c>l&&([c,l]=[l,c]),this.item.key=new Mqr(c,l)}}else this.item.key=e;this.max=this.item.key?this.item.key.max:void 0}isNil(){return this.item.key===void 0&&this.item.values.length===0&&this.left===null&&this.right===null&&this.color===0}requireKey(){if(!this.item.key)throw Error("Node key is undefined (nil/sentinel). Operation is not applicable.");return this.item.key}less_than(e){let t=this.requireKey(),n=e.requireKey();return t.less_than(n)}_value_equal(e){let t=this.item.values[0],n=e.item.values[0];return t&&n&&t.equal_to?t.equal_to(n):t===n}equal_to(e){let t=this.requireKey(),n=e.requireKey();return t.equal_to(n)}intersect(e){let t=this.requireKey(),n=e.requireKey();return t.intersect(n)}copy_data(e){this.item.key=e.item.key,this.item.values=e.item.values.slice()}update_max(){this.max=this.item.key?this.item.key.max:void 0,this.right&&this.right.max&&(this.max=this.max?this.max.merge(this.right.max):this.right.max),this.left&&this.left.max&&(this.max=this.max?this.max.merge(this.left.max):this.left.max)}not_intersect_left_subtree(e){if(!this.left)return!0;let t=this.left.max?this.left.max.high:this.left.item.key.high,n=this.requireKey(),o=e.requireKey();return n.comparable_less_than(t,o.low)}not_intersect_right_subtree(e){if(!this.right)return!0;let t=this.right.max?this.right.max.low:this.right.item.key.low,n=this.requireKey(),o=e.requireKey();return n.comparable_less_than(o.high,t)}},Mrt=class e{constructor(){this.root=null,this.nil_node=new WQ}get size(){let t=0;return this.tree_walk(this.root,(n)=>t+=n.item.values.length),t}get keys(){let t=[];return this.tree_walk(this.root,(n)=>t.push(n.item.key.output())),t}get values(){let t=[];return this.tree_walk(this.root,(n)=>{for(let o of n.item.values)t.push(o)}),t}get items(){let t=[];return this.tree_walk(this.root,(n)=>{let o=n.item.key.output();for(let r of n.item.values)t.push({key:o,value:r})}),t}isEmpty(){return this.root==null||this.root===this.nil_node}clear(){this.root=null}insert(t,n=t){if(t===void 0)return;let o=this.tree_search(this.root,new WQ(t));if(o)return o.item.values.push(n),o;let r=new WQ(t,n,this.nil_node,this.nil_node,null,1);return this.tree_insert(r),this.recalc_max(r),r}exist(t,n=t){let o=this.tree_search(this.root,new WQ(t));return!!o&&(arguments.length<2||n===t||o.item.values.some((r)=>r&&r.equal_to?r.equal_to(n):r===n))}remove(t,n=t){let o=this.tree_search(this.root,new WQ(t));if(!o)return;if(arguments.length<2)return this.tree_delete(o),o;let r=o.item.values.findIndex((i)=>i&&i.equal_to?i.equal_to(n):i===n);return r>=0?(o.item.values.splice(r,1),o.item.values.length===0&&this.tree_delete(o),o):void 0}search(t,n=(o,r)=>o===r?r.output():o){let o=new WQ(t),r=[];this.tree_search_interval(this.root,o,r);let i=[];for(let s of r)for(let a of s.item.values)i.push(n(a,s.item.key));return i}intersect_any(t){let n=new WQ(t);return this.tree_find_any_interval(this.root,n)}forEach(t){this.tree_walk(this.root,(n)=>{for(let o of n.item.values)t(n.item.key,o)})}map(t){let n=new e;return this.tree_walk(this.root,(o)=>{for(let r of o.item.values)n.insert(o.item.key,t(r,o.item.key))}),n}*iterate(t,n=(o,r)=>o===r?r.output():o){let o=null;for(t?o=this.tree_search_nearest_forward(this.root,new WQ(t)):this.root&&(o=this.local_minimum(this.root));o;){for(let r of o.item.values)yield n(r,o.item.key);o=this.tree_successor(o)}}recalc_max(t){let n=t;for(;n.parent!=null;)n.parent.update_max(),n=n.parent}tree_insert(t){let n=this.root,o=null;if(this.root==null||this.root===this.nil_node)this.root=t;else{for(;n!==this.nil_node;)o=n,n=t.less_than(n)?n.left:n.right;t.parent=o,t.less_than(o)?o.left=t:o.right=t}this.insert_fixup(t)}insert_fixup(t){let n,o;for(n=t;n!==this.root&&n.parent.color===1;)n.parent===n.parent.parent.left?(o=n.parent.parent.right,o.color===1?(n.parent.color=0,o.color=0,n.parent.parent.color=1,n=n.parent.parent):(n===n.parent.right&&(n=n.parent,this.rotate_left(n)),n.parent.color=0,n.parent.parent.color=1,this.rotate_right(n.parent.parent))):(o=n.parent.parent.left,o.color===1?(n.parent.color=0,o.color=0,n.parent.parent.color=1,n=n.parent.parent):(n===n.parent.left&&(n=n.parent,this.rotate_right(n)),n.parent.color=0,n.parent.parent.color=1,this.rotate_left(n.parent.parent)));this.root.color=0}tree_delete(t){let n,o;n=t.left===this.nil_node||t.right===this.nil_node?t:this.tree_successor(t),o=n.left!==this.nil_node?n.left:n.right,o.parent=n.parent,n===this.root?this.root=o:(n===n.parent.left?n.parent.left=o:n.parent.right=o,n.parent.update_max()),this.recalc_max(o),n!==t&&(t.copy_data(n),t.update_max(),this.recalc_max(t)),n.color===0&&this.delete_fixup(o)}delete_fixup(t){let n,o=t;for(;o!==this.root&&o.parent!=null&&o.color===0;)o===o.parent.left?(n=o.parent.right,n.color===1&&(n.color=0,o.parent.color=1,this.rotate_left(o.parent),n=o.parent.right),n.left.color===0&&n.right.color===0?(n.color=1,o=o.parent):(n.right.color===0&&(n.color=1,n.left.color=0,this.rotate_right(n),n=o.parent.right),n.color=o.parent.color,o.parent.color=0,n.right.color=0,this.rotate_left(o.parent),o=this.root)):(n=o.parent.left,n.color===1&&(n.color=0,o.parent.color=1,this.rotate_right(o.parent),n=o.parent.left),n.left.color===0&&n.right.color===0?(n.color=1,o=o.parent):(n.left.color===0&&(n.color=1,n.right.color=0,this.rotate_left(n),n=o.parent.left),n.color=o.parent.color,o.parent.color=0,n.left.color=0,this.rotate_right(o.parent),o=this.root));o.color=0}tree_search(t,n){if(t!=null&&t!==this.nil_node)return n.equal_to(t)?t:n.less_than(t)?this.tree_search(t.left,n):this.tree_search(t.right,n)}tree_search_nearest_forward(t,n){let o=null,r=t;for(;r&&r!==this.nil_node;)r.less_than(n)?r.intersect(n)?(o=r,r=r.left):r=r.right:(o&&!r.less_than(o)||(o=r),r=r.left);return o||null}tree_search_interval(t,n,o){t!=null&&t!==this.nil_node&&(t.left===this.nil_node||t.not_intersect_left_subtree(n)||this.tree_search_interval(t.left,n,o),t.intersect(n)&&o.push(t),t.right===this.nil_node||t.not_intersect_right_subtree(n)||this.tree_search_interval(t.right,n,o))}tree_find_any_interval(t,n){let o=!1;return t!=null&&t!==this.nil_node&&(t.left===this.nil_node||t.not_intersect_left_subtree(n)||(o=this.tree_find_any_interval(t.left,n)),o||(o=t.intersect(n)),o||t.right===this.nil_node||t.not_intersect_right_subtree(n)||(o=this.tree_find_any_interval(t.right,n))),o}local_minimum(t){let n=t;for(;n.left!=null&&n.left!==this.nil_node;)n=n.left;return n}local_maximum(t){let n=t;for(;n.right!=null&&n.right!==this.nil_node;)n=n.right;return n}tree_successor(t){let n,o,r;if(t.right!==this.nil_node)n=this.local_minimum(t.right);else{for(o=t,r=t.parent;r!=null&&r.right===o;)o=r,r=r.parent;n=r}return n}rotate_left(t){let n=t.right;t.right=n.left,n.left!==this.nil_node&&(n.left.parent=t),n.parent=t.parent,t===this.root?this.root=n:t===t.parent.left?t.parent.left=n:t.parent.right=n,n.left=t,t.parent=n,t!==null&&t!==this.nil_node&&t.update_max(),n!=null&&n!==this.nil_node&&n.update_max()}rotate_right(t){let n=t.left;t.left=n.right,n.right!==this.nil_node&&(n.right.parent=t),n.parent=t.parent,t===this.root?this.root=n:t===t.parent.left?t.parent.left=n:t.parent.right=n,n.right=t,t.parent=n,t!==null&&t!==this.nil_node&&t.update_max(),n!=null&&n!==this.nil_node&&n.update_max()}tree_walk(t,n){t!=null&&t!==this.nil_node&&(this.tree_walk(t.left,n),n(t),this.tree_walk(t.right,n))}testRedBlackProperty(){let t=!0;return this.tree_walk(this.root,function(n){n.color===1&&(n.left.color===0&&n.right.color===0||(t=!1))}),t}testBlackHeightProperty(t){let n=0,o=0,r=0;if(t.color===0&&n++,o=t.left!==this.nil_node?this.testBlackHeightProperty(t.left):1,r=t.right!==this.nil_node?this.testBlackHeightProperty(t.right):1,o!==r)throw Error("Red-black height property violated");return n+=o,n}},wqr=class extends Set{constructor(e){super(e),this.index=new Mrt,this.forEach((t)=>this.index.insert(t))}add(e){let t=this.size,{key:n,value:o}=e,r=n||e.box,i=o||e;return super.add(i),this.size>t&&this.index.insert(r,i),this}delete(e){let{key:t,value:n}=e,o=t||e.box,r=n||e,i=super.delete(r);return i&&this.index.remove(o,r),i}clear(){super.clear(),this.index=new Mrt}search(e){return this.index.search(e)}hit(e){let t=new Ue.Box(e.x-1,e.y-1,e.x+1,e.y+1);return this.index.search(t).filter((n)=>e.on(n))}svg(){return[...this].reduce((e,t)=>e+t.svg(),"")}};Ue.PlanarSet=wqr;var Uk=class{get name(){throw ju.CANNOT_INVOKE_ABSTRACT_METHOD}get box(){throw ju.CANNOT_INVOKE_ABSTRACT_METHOD}clone(){throw ju.CANNOT_INVOKE_ABSTRACT_METHOD}translate(...e){return this.transform(new vde().translate(...e))}rotate(e,t=new Ue.Point){return this.transform(new vde().rotate(e,t.x,t.y))}scale(e,t){return this.transform(new vde().scale(e,t))}transform(...e){throw ju.CANNOT_INVOKE_ABSTRACT_METHOD}toJSON(){return Object.assign({},this,{name:this.name})}svg(e={}){throw ju.CANNOT_INVOKE_ABSTRACT_METHOD}};Ue.Point=class e extends Uk{constructor(...t){if(super(),this.x=0,this.y=0,t.length!==0){if(t.length===1&&t[0]instanceof Array&&t[0].length===2){let n=t[0];if(typeof n[0]=="number"&&typeof n[1]=="number")return this.x=n[0],void(this.y=n[1])}if(t.length===1&&t[0]instanceof Object&&t[0].name==="point"){let{x:n,y:o}=t[0];return this.x=n,void(this.y=o)}if(t.length===2&&typeof t[0]=="number"&&typeof t[1]=="number")return this.x=t[0],void(this.y=t[1]);throw ju.ILLEGAL_PARAMETERS}}get box(){return new Ue.Box(this.x,this.y,this.x,this.y)}clone(){return new Ue.Point(this.x,this.y)}get vertices(){return[this.clone()]}equalTo(t){return Ue.Utils.EQ(this.x,t.x)&&Ue.Utils.EQ(this.y,t.y)}lessThan(t){return!!Ue.Utils.LT(this.y,t.y)||!(!Ue.Utils.EQ(this.y,t.y)||!Ue.Utils.LT(this.x,t.x))}transform(t){return new Ue.Point(t.transform([this.x,this.y]))}projectionOn(t){if(this.equalTo(t.pt))return this.clone();let n=new Ue.Vector(this,t.pt);if(Ue.Utils.EQ_0(n.cross(t.norm)))return t.pt.clone();let o=n.dot(t.norm),r=t.norm.multiply(o);return this.translate(r)}leftTo(t){let n=new Ue.Vector(t.pt,this);return Ue.Utils.GT(n.dot(t.norm),0)}distanceTo(t){if(t instanceof e){let n=t.x-this.x,o=t.y-this.y;return[Math.sqrt(n*n+o*o),new Ue.Segment(this,t)]}return t instanceof Ue.Line?Ue.Distance.point2line(this,t):t instanceof Ue.Circle?Ue.Distance.point2circle(this,t):t instanceof Ue.Segment?Ue.Distance.point2segment(this,t):t instanceof Ue.Arc?Ue.Distance.point2arc(this,t):t instanceof Ue.Polygon?Ue.Distance.point2polygon(this,t):t instanceof Ue.PlanarSet?Ue.Distance.shape2planarSet(this,t):t instanceof Ue.Multiline?Ue.Distance.shape2multiline(this,t):void 0}on(t){if(t instanceof Ue.Point)return this.equalTo(t);if(t.contains&&t.contains instanceof Function)return t.contains(this);throw Ue.Errors.UNSUPPORTED_SHAPE_TYPE}get name(){return"point"}svg(t={}){let n=t.r??3;return`
<circle cx="${this.x}" cy="${this.y}" r="${n}"
            ${KY({fill:"red",...t})} />`}};var Bqr=(...e)=>new Ue.Point(...e);Ue.point=Bqr;Ue.Vector=class extends Uk{constructor(...e){if(super(),this.x=0,this.y=0,e.length!==0){if(e.length===1&&e[0]instanceof Array&&e[0].length===2){let t=e[0];if(typeof t[0]=="number"&&typeof t[1]=="number")return this.x=t[0],void(this.y=t[1])}if(e.length===1&&e[0]instanceof Object&&e[0].name==="vector"){let{x:t,y:n}=e[0];return this.x=t,void(this.y=n)}if(e.length===1&&e[0]instanceof Object&&e[0].name==="segment"){let{start:t,end:n}=e[0];return this.x=n.x-t.x,void(this.y=n.y-t.y)}if(e.length===2){let t=e[0],n=e[1];if(typeof t=="number"&&typeof n=="number")return this.x=t,void(this.y=n);if(t instanceof Ue.Point&&n instanceof Ue.Point)return this.x=n.x-t.x,void(this.y=n.y-t.y)}throw ju.ILLEGAL_PARAMETERS}}clone(){return new Ue.Vector(this.x,this.y)}get slope(){let e=Math.atan2(this.y,this.x);return e<0&&(e=2*Math.PI+e),e}get length(){return Math.sqrt(this.dot(this))}isZeroLength(){return Ue.Utils.EQ_0(this.length)}equalTo(e){return Ue.Utils.EQ(this.x,e.x)&&Ue.Utils.EQ(this.y,e.y)}multiply(e){return new Ue.Vector(e*this.x,e*this.y)}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}normalize(){if(this.isZeroLength())throw ju.ZERO_DIVISION;return new Ue.Vector(this.x/this.length,this.y/this.length)}rotate(e,t=new Ue.Point){if(t.x===0&&t.y===0)return this.transform(new vde().rotate(e));throw ju.OPERATION_IS_NOT_SUPPORTED}transform(e){return new Ue.Vector(e.transform([this.x,this.y]))}rotate90CCW(){return new Ue.Vector(-this.y,this.x)}rotate90CW(){return new Ue.Vector(this.y,-this.x)}invert(){return new Ue.Vector(-this.x,-this.y)}add(e){return new Ue.Vector(this.x+e.x,this.y+e.y)}subtract(e){return new Ue.Vector(this.x-e.x,this.y-e.y)}angleTo(e){let t=this.normalize(),n=e.normalize(),o=Math.atan2(t.cross(n),t.dot(n));return o<0&&(o+=2*Math.PI),o}projectionOn(e){let t=e.normalize(),n=this.dot(t);return t.multiply(n)}get name(){return"vector"}};var Ovn=(...e)=>new Ue.Vector(...e);Ue.vector=Ovn;Ue.Segment=class e extends Uk{constructor(...t){if(super(),this.ps=new Ue.Point,this.pe=new Ue.Point,t.length!==0){if(t.length===1&&t[0]instanceof Array&&t[0].length===4){let n=t[0];return this.ps=new Ue.Point(n[0],n[1]),void(this.pe=new Ue.Point(n[2],n[3]))}if(t.length===1&&t[0]instanceof Object&&t[0].name==="segment"){let{ps:n,pe:o}=t[0];return this.ps=new Ue.Point(n.x,n.y),void(this.pe=new Ue.Point(o.x,o.y))}if(!(t.length===1&&t[0]instanceof Ue.Point)){if(t.length===2&&t[0]instanceof Ue.Point&&t[1]instanceof Ue.Point)return this.ps=t[0].clone(),void(this.pe=t[1].clone());if(t.length===4)return this.ps=new Ue.Point(t[0],t[1]),void(this.pe=new Ue.Point(t[2],t[3]));throw ju.ILLEGAL_PARAMETERS}this.ps=t[0].clone()}}clone(){return new Ue.Segment(this.start,this.end)}get start(){return this.ps}get end(){return this.pe}get vertices(){return[this.ps.clone(),this.pe.clone()]}get length(){return this.start.distanceTo(this.end)[0]}get slope(){return new Ue.Vector(this.start,this.end).slope}get box(){return new Ue.Box(Math.min(this.start.x,this.end.x),Math.min(this.start.y,this.end.y),Math.max(this.start.x,this.end.x),Math.max(this.start.y,this.end.y))}equalTo(t){return this.ps.equalTo(t.ps)&&this.pe.equalTo(t.pe)}contains(t){return Ue.Utils.EQ_0(this.distanceToPoint(t))}intersect(t){return t instanceof Ue.Point?this.contains(t)?[t]:[]:t instanceof Ue.Line?Fue(this,t):t instanceof Ue.Ray?sat(t,this):t instanceof Ue.Segment?T8e(this,t):t instanceof Ue.Circle?D8e(this,t):t instanceof Ue.Box?function(n,o){let r=[];for(let i of o.toSegments()){let s=T8e(i,n);for(let a of s)r.push(a)}return r}(this,t):t instanceof Ue.Arc?uZ(this,t):t instanceof Ue.Polygon?rat(this,t):t instanceof Ue.Multiline?TZ(this,t):void 0}distanceTo(t){if(t instanceof Ue.Point){let[n,o]=Ue.Distance.point2segment(t,this);return o=o.reverse(),[n,o]}if(t instanceof Ue.Circle){let[n,o]=Ue.Distance.segment2circle(this,t);return[n,o]}if(t instanceof Ue.Line){let[n,o]=Ue.Distance.segment2line(this,t);return[n,o]}if(t instanceof Ue.Segment){let[n,o]=Ue.Distance.segment2segment(this,t);return[n,o]}if(t instanceof Ue.Arc){let[n,o]=Ue.Distance.segment2arc(this,t);return[n,o]}if(t instanceof Ue.Polygon){let[n,o]=Ue.Distance.shape2polygon(this,t);return[n,o]}if(t instanceof Ue.PlanarSet){let[n,o]=Ue.Distance.shape2planarSet(this,t);return[n,o]}if(t instanceof Ue.Multiline)return Ue.Distance.shape2multiline(this,t)}tangentInStart(){return new Ue.Vector(this.start,this.end).normalize()}tangentInEnd(){return new Ue.Vector(this.end,this.start).normalize()}reverse(){return new e(this.end,this.start)}split(t){return this.start.equalTo(t)?[null,this.clone()]:this.end.equalTo(t)?[this.clone(),null]:[new Ue.Segment(this.start,t),new Ue.Segment(t,this.end)]}middle(){return new Ue.Point((this.start.x+this.end.x)/2,(this.start.y+this.end.y)/2)}pointAtLength(t){if(t>this.length||t<0)return null;if(t==0)return this.start;if(t==this.length)return this.end;let n=t/this.length;return new Ue.Point((this.end.x-this.start.x)*n+this.start.x,(this.end.y-this.start.y)*n+this.start.y)}distanceToPoint(t){let[n,...o]=Ue.Distance.point2segment(t,this);return n}definiteIntegral(t=0){return(this.end.x-this.start.x)*(this.start.y-t+(this.end.y-t))/2}transform(t=new Ue.Matrix){return new e(this.ps.transform(t),this.pe.transform(t))}isZeroLength(){return this.ps.equalTo(this.pe)}sortPoints(t){return new Ue.Line(this.start,this.end).sortPoints(t)}get name(){return"segment"}svg(t={}){return`
<line x1="${this.start.x}" y1="${this.start.y}" x2="${this.end.x}" y2="${this.end.y}" ${KY(t)} />`}};var Tqr=(...e)=>new Ue.Segment(...e);Ue.segment=Tqr;var{vector:Fhe}=Ue;Ue.Line=class e extends Uk{constructor(...t){if(super(),this.pt=new Ue.Point,this.norm=new Ue.Vector(0,1),t.length!==0){if(t.length===1&&t[0]instanceof Object&&t[0].name==="line"){let{pt:n,norm:o}=t[0];return this.pt=new Ue.Point(n),void(this.norm=new Ue.Vector(o))}if(t.length===2){let n=t[0],o=t[1];if(n instanceof Ue.Point&&o instanceof Ue.Point)return this.pt=n,this.norm=e.points2norm(n,o),void(this.norm.dot(Fhe(this.pt.x,this.pt.y))>=0&&this.norm.invert());if(n instanceof Ue.Point&&o instanceof Ue.Vector){if(Ue.Utils.EQ_0(o.x)&&Ue.Utils.EQ_0(o.y))throw ju.ILLEGAL_PARAMETERS;return this.pt=n.clone(),this.norm=o.clone(),this.norm=this.norm.normalize(),void(this.norm.dot(Fhe(this.pt.x,this.pt.y))>=0&&this.norm.invert())}if(n instanceof Ue.Vector&&o instanceof Ue.Point){if(Ue.Utils.EQ_0(n.x)&&Ue.Utils.EQ_0(n.y))throw ju.ILLEGAL_PARAMETERS;return this.pt=o.clone(),this.norm=n.clone(),this.norm=this.norm.normalize(),void(this.norm.dot(Fhe(this.pt.x,this.pt.y))>=0&&this.norm.invert())}}throw ju.ILLEGAL_PARAMETERS}}clone(){return new Ue.Line(this.pt,this.norm)}get start(){}get end(){}get length(){return Number.POSITIVE_INFINITY}get box(){return new Ue.Box(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY)}get middle(){}get slope(){return new Ue.Vector(this.norm.y,-this.norm.x).slope}get standard(){return[this.norm.x,this.norm.y,this.norm.dot(Fhe(this.pt.x,this.pt.y))]}parallelTo(t){return Ue.Utils.EQ_0(this.norm.cross(t.norm))}incidentTo(t){return this.parallelTo(t)&&this.pt.on(t)}contains(t){if(this.pt.equalTo(t))return!0;let n=new Ue.Vector(this.pt,t);return Ue.Utils.EQ_0(this.norm.dot(n))}coord(t){return Fhe(t.x,t.y).cross(this.norm)}intersect(t){return t instanceof Ue.Point?this.contains(t)?[t]:[]:t instanceof Ue.Line?BZ(this,t):t instanceof Ue.Ray?Dvn(t,this):t instanceof Ue.Circle?$Y(this,t):t instanceof Ue.Box?dZ(this,t):t instanceof Ue.Segment?Fue(t,this):t instanceof Ue.Arc?L7e(this,t):t instanceof Ue.Polygon?zue(this,t):t instanceof Ue.Multiline?TZ(this,t):void 0}distanceTo(t){if(t instanceof Ue.Point){let[n,o]=Ue.Distance.point2line(t,this);return o=o.reverse(),[n,o]}if(t instanceof Ue.Circle){let[n,o]=Ue.Distance.circle2line(t,this);return o=o.reverse(),[n,o]}if(t instanceof Ue.Segment){let[n,o]=Ue.Distance.segment2line(t,this);return[n,o.reverse()]}if(t instanceof Ue.Arc){let[n,o]=Ue.Distance.arc2line(t,this);return[n,o.reverse()]}if(t instanceof Ue.Polygon){let[n,o]=Ue.Distance.shape2polygon(this,t);return[n,o]}}split(t){if(t instanceof Ue.Point)return[new Ue.Ray(t,this.norm),new Ue.Ray(t,this.norm)];{let n=new Ue.Multiline([this]),o=this.sortPoints(t);return n.split(o),n.toShapes()}}rotate(t,n=new Ue.Point){return new Ue.Line(this.pt.rotate(t,n),this.norm.rotate(t))}transform(t){return new Ue.Line(this.pt.transform(t),this.norm.clone())}sortPoints(t){return t.slice().sort((n,o)=>this.coord(n)<this.coord(o)?-1:this.coord(n)>this.coord(o)?1:0)}get name(){return"line"}svg(t,n={}){let o=dZ(this,t);if(o.length===0)return"";let r=o[0],i=o.length===2?o[1]:o.find((s)=>!s.equalTo(r));return i===void 0&&(i=r),new Ue.Segment(r,i).svg(n)}static points2norm(t,n){if(t.equalTo(n))throw ju.ILLEGAL_PARAMETERS;return new Ue.Vector(t,n).normalize().rotate90CCW()}};var Dqr=(...e)=>new Ue.Line(...e);Ue.line=Dqr;Ue.Circle=class extends Uk{constructor(...e){if(super(),this.pc=new Ue.Point,this.r=1,e.length===1&&e[0]instanceof Object&&e[0].name==="circle"){let{pc:t,r:n}=e[0];this.pc=new Ue.Point(t),this.r=n}else{let[t,n]=[...e];t&&t instanceof Ue.Point&&(this.pc=t.clone()),n!==void 0&&(this.r=n)}}clone(){return new Ue.Circle(this.pc.clone(),this.r)}get center(){return this.pc}get box(){return new Ue.Box(this.pc.x-this.r,this.pc.y-this.r,this.pc.x+this.r,this.pc.y+this.r)}contains(e){return e instanceof Ue.Point?Ue.Utils.LE(e.distanceTo(this.center)[0],this.r):e instanceof Ue.Segment?Ue.Utils.LE(e.start.distanceTo(this.center)[0],this.r)&&Ue.Utils.LE(e.end.distanceTo(this.center)[0],this.r):e instanceof Ue.Arc?this.intersect(e).length===0&&Ue.Utils.LE(e.start.distanceTo(this.center)[0],this.r)&&Ue.Utils.LE(e.end.distanceTo(this.center)[0],this.r):e instanceof Ue.Circle?this.intersect(e).length===0&&Ue.Utils.LE(e.r,this.r)&&Ue.Utils.LE(e.center.distanceTo(this.center)[0],this.r):void 0}toArc(e=!0){return new Ue.Arc(this.center,this.r,Math.PI,-Math.PI,e)}scale(e,t){if(e!==t)throw ju.OPERATION_IS_NOT_SUPPORTED;if(this.pc.x!==0||this.pc.y!==0)throw ju.OPERATION_IS_NOT_SUPPORTED;return new Ue.Circle(this.pc,this.r*e)}transform(e=new Ue.Matrix){return new Ue.Circle(this.pc.transform(e),this.r)}intersect(e){return e instanceof Ue.Point?this.contains(e)?[e]:[]:e instanceof Ue.Line?$Y(e,this):e instanceof Ue.Ray?Tvn(e,this):e instanceof Ue.Segment?D8e(e,this):e instanceof Ue.Circle?Ivn(e,this):e instanceof Ue.Box?function(t,n){let o=[];for(let r of n.toSegments()){let i=D8e(r,t);for(let s of i)o.push(s)}return o}(this,e):e instanceof Ue.Arc?oat(e,this):e instanceof Ue.Polygon?Mvn(this,e):e instanceof Ue.Multiline?TZ(this,e):void 0}distanceTo(e){if(e instanceof Ue.Point){let[t,n]=Ue.Distance.point2circle(e,this);return n=n.reverse(),[t,n]}if(e instanceof Ue.Circle){let[t,n]=Ue.Distance.circle2circle(this,e);return[t,n]}if(e instanceof Ue.Line){let[t,n]=Ue.Distance.circle2line(this,e);return[t,n]}if(e instanceof Ue.Segment){let[t,n]=Ue.Distance.segment2circle(e,this);return n=n.reverse(),[t,n]}if(e instanceof Ue.Arc){let[t,n]=Ue.Distance.arc2circle(e,this);return n=n.reverse(),[t,n]}if(e instanceof Ue.Polygon){let[t,n]=Ue.Distance.shape2polygon(this,e);return[t,n]}if(e instanceof Ue.PlanarSet){let[t,n]=Ue.Distance.shape2planarSet(this,e);return[t,n]}if(e instanceof Ue.Multiline){let[t,n]=Ue.Distance.shape2multiline(this,e);return[t,n]}}get name(){return"circle"}svg(e={}){return`
<circle cx="${this.pc.x}" cy="${this.pc.y}" r="${this.r}"
                ${KY({fill:"none",...e})} />`}};Ue.circle=(...e)=>new Ue.Circle(...e);Ue.Arc=class extends Uk{constructor(...e){if(super(),this.pc=new Ue.Point,this.r=1,this.startAngle=0,this.endAngle=2*Math.PI,this.counterClockwise=!0,e.length!==0)if(e.length===1&&e[0]instanceof Object&&e[0].name==="arc"){let{pc:t,r:n,startAngle:o,endAngle:r,counterClockwise:i}=e[0];this.pc=new Ue.Point(t.x,t.y),this.r=n,this.startAngle=o,this.endAngle=r,this.counterClockwise=i}else{let[t,n,o,r,i]=[...e];t&&t instanceof Ue.Point&&(this.pc=t.clone()),n!==void 0&&(this.r=n),o!==void 0&&(this.startAngle=o),r!==void 0&&(this.endAngle=r),i!==void 0&&(this.counterClockwise=i)}}clone(){return new Ue.Arc(this.pc.clone(),this.r,this.startAngle,this.endAngle,this.counterClockwise)}get sweep(){let e=this.startAngle,t=this.endAngle;if(Ue.Utils.EQ(Math.abs(e-t),Ue.PIx2))return Ue.PIx2;Math.abs(e)>Ue.PIx2&&(e-=Math.trunc(e/Ue.PIx2)*Ue.PIx2),e<0&&(e+=Ue.PIx2),Math.abs(t)>Ue.PIx2&&(t-=Math.trunc(t/Ue.PIx2)*Ue.PIx2),t<0&&(t+=Ue.PIx2);let n=this.counterClockwise?t-e:e-t;return n<0&&(n+=Ue.PIx2),n}get start(){return new Ue.Point(this.pc.x+this.r,this.pc.y).rotate(this.startAngle,this.pc)}get end(){return new Ue.Point(this.pc.x+this.r,this.pc.y).rotate(this.endAngle,this.pc)}get center(){return this.pc.clone()}get vertices(){return[this.start.clone(),this.end.clone()]}get length(){return Math.abs(this.sweep*this.r)}get box(){let e=this.breakToFunctional().reduce((t,n)=>t.merge(n.start.box),new Ue.Box);return e=e.merge(this.end.box),e}contains(e){if(!Ue.Utils.EQ(this.pc.distanceTo(e)[0],this.r))return!1;if(e.equalTo(this.start))return!0;let t=new Ue.Vector(this.pc,e).slope,n=new Ue.Arc(this.pc,this.r,this.startAngle,t,this.counterClockwise);return Ue.Utils.LE(n.length,this.length)}split(e){if(this.start.equalTo(e))return[null,this.clone()];if(this.end.equalTo(e))return[this.clone(),null];let t=new Ue.Vector(this.pc,e).slope;return[new Ue.Arc(this.pc,this.r,this.startAngle,t,this.counterClockwise),new Ue.Arc(this.pc,this.r,t,this.endAngle,this.counterClockwise)]}middle(){let e=this.counterClockwise?this.startAngle+this.sweep/2:this.startAngle-this.sweep/2;return new Ue.Arc(this.pc,this.r,this.startAngle,e,this.counterClockwise).end}pointAtLength(e){if(e>this.length||e<0)return null;if(e===0)return this.start;if(e===this.length)return this.end;let t=e/this.length,n=this.counterClockwise?this.startAngle+this.sweep*t:this.startAngle-this.sweep*t;return new Ue.Arc(this.pc,this.r,this.startAngle,n,this.counterClockwise).end}chordHeight(){return(1-Math.cos(Math.abs(this.sweep/2)))*this.r}intersect(e){return e instanceof Ue.Point?this.contains(e)?[e]:[]:e instanceof Ue.Line?L7e(e,this):e instanceof Ue.Ray?aat(e,this):e instanceof Ue.Circle?oat(this,e):e instanceof Ue.Segment?uZ(e,this):e instanceof Ue.Box?function(t,n){let o=[];for(let r of n.toSegments()){let i=uZ(r,t);for(let s of i)o.push(s)}return o}(this,e):e instanceof Ue.Arc?vvn(this,e):e instanceof Ue.Polygon?iat(this,e):e instanceof Ue.Multiline?TZ(this,e):void 0}distanceTo(e){if(e instanceof Ue.Point){let[t,n]=Ue.Distance.point2arc(e,this);return n=n.reverse(),[t,n]}if(e instanceof Ue.Circle){let[t,n]=Ue.Distance.arc2circle(this,e);return[t,n]}if(e instanceof Ue.Line){let[t,n]=Ue.Distance.arc2line(this,e);return[t,n]}if(e instanceof Ue.Segment){let[t,n]=Ue.Distance.segment2arc(e,this);return n=n.reverse(),[t,n]}if(e instanceof Ue.Arc){let[t,n]=Ue.Distance.arc2arc(this,e);return[t,n]}if(e instanceof Ue.Polygon){let[t,n]=Ue.Distance.shape2polygon(this,e);return[t,n]}if(e instanceof Ue.PlanarSet){let[t,n]=Ue.Distance.shape2planarSet(this,e);return[t,n]}if(e instanceof Ue.Multiline)return Ue.Distance.shape2multiline(this,e)}breakToFunctional(){let e=[],t=[0,Math.PI/2,Math.PI,3*Math.PI/2],n=this.startAngle,o=this.endAngle;Ue.Utils.EQ(Math.abs(n-o),Ue.PIx2)&&(o=n),Math.abs(n)>Ue.PIx2&&(n-=Math.trunc(n/Ue.PIx2)*Ue.PIx2),n<0&&(n+=Ue.PIx2),Math.abs(o)>Ue.PIx2&&(o-=Math.trunc(o/Ue.PIx2)*Ue.PIx2),o<0&&(o+=Ue.PIx2);let r,i,s,a=n;this.counterClockwise?(i=Math.ceil(n/(Math.PI/2))%4,s=1):(i=Math.floor(n/(Math.PI/2))%4,s=-1);for(let c=0,l=i;c<4;c++,l=(l+s+4)%4){if(r=t[l],r===a)continue;let h=this.counterClockwise?r-n:n-r;if(h<0&&(h+=Ue.PIx2),h>this.sweep)break;e.push(new Ue.Arc(this.pc,this.r,a,r,this.counterClockwise)),a=r}return e.length===0?(e.push(this),e):(r=o,a!==r&&e.push(new Ue.Arc(this.pc,this.r,a,r,this.counterClockwise)),e)}tangentInStart(){let e=new Ue.Vector(this.pc,this.start),t=this.counterClockwise?Math.PI/2:-Math.PI/2;return e.rotate(t).normalize()}tangentInEnd(){let e=new Ue.Vector(this.pc,this.end),t=this.counterClockwise?-Math.PI/2:Math.PI/2;return e.rotate(t).normalize()}reverse(){return new Ue.Arc(this.pc,this.r,this.endAngle,this.startAngle,!this.counterClockwise)}transform(e=new Ue.Matrix){let t=this.start.transform(e),n=this.end.transform(e),o=this.pc.transform(e),r=this.counterClockwise;return e.a*e.d<0&&(r=!r),Ue.Arc.arcSE(o,t,n,r)}static arcSE(e,t,n,o){let{vector:r}=Ue,i=r(e,t).slope,s=r(e,n).slope;Ue.Utils.EQ(i,s)&&(s+=2*Math.PI,o=!0);let a=r(e,t).length;return new Ue.Arc(e,a,i,s,o)}definiteIntegral(e=0){return this.breakToFunctional().reduce((t,n)=>t+n.circularSegmentDefiniteIntegral(e),0)}circularSegmentDefiniteIntegral(e){let t=new Ue.Segment(this.start,this.end).definiteIntegral(e),n=Ue.Utils.EQ(this.sweep,Ue.PIx2)?0:this.circularSegmentArea();return this.counterClockwise?t-n:t+n}circularSegmentArea(){return 0.5*this.r*this.r*(this.sweep-Math.sin(this.sweep))}sortPoints(e){let{vector:t}=Ue;return e.slice().sort((n,o)=>{let r=t(this.pc,n).slope,i=t(this.pc,o).slope;return r<i?-1:r>i?1:0})}get name(){return"arc"}svg(e={}){let t=this.sweep<=Math.PI?"0":"1",n=this.counterClockwise?"1":"0";if(Ue.Utils.EQ(this.sweep,2*Math.PI))return new Ue.Circle(this.pc,this.r).svg(e);return`
<path d="M${this.start.x},${this.start.y}
                             A${this.r},${this.r} 0 ${t},${n} ${this.end.x},${this.end.y}"
                    ${KY({fill:"none",...e})} />`}};Ue.arc=(...e)=>new Ue.Arc(...e);Ue.Box=class e extends Uk{constructor(t=void 0,n=void 0,o=void 0,r=void 0){super(),this.xmin=t,this.ymin=n,this.xmax=o,this.ymax=r}clone(){return new e(this.xmin,this.ymin,this.xmax,this.ymax)}get low(){return new Ue.Point(this.xmin,this.ymin)}get high(){return new Ue.Point(this.xmax,this.ymax)}get max(){return this.clone()}get center(){return new Ue.Point((this.xmin+this.xmax)/2,(this.ymin+this.ymax)/2)}get width(){return Math.abs(this.xmax-this.xmin)}get height(){return Math.abs(this.ymax-this.ymin)}get box(){return this.clone()}not_intersect(t){return this.xmax<t.xmin||this.xmin>t.xmax||this.ymax<t.ymin||this.ymin>t.ymax}intersect(t){return!this.not_intersect(t)}merge(t){return new e(this.xmin===void 0?t.xmin:Math.min(this.xmin,t.xmin),this.ymin===void 0?t.ymin:Math.min(this.ymin,t.ymin),this.xmax===void 0?t.xmax:Math.max(this.xmax,t.xmax),this.ymax===void 0?t.ymax:Math.max(this.ymax,t.ymax))}less_than(t){return!!this.low.lessThan(t.low)||!(!this.low.equalTo(t.low)||!this.high.lessThan(t.high))}equal_to(t){return this.low.equalTo(t.low)&&this.high.equalTo(t.high)}output(){return this.clone()}comparable_less_than(t,n){return t.lessThan(n)}set(t,n,o,r){this.xmin=t,this.ymin=n,this.xmax=o,this.ymax=r}extend(t){return t<=0?this.clone():new e(this.xmin-t,this.ymin-t,this.xmax+t,this.ymax+t)}toPoints(){return[new Ue.Point(this.xmin,this.ymin),new Ue.Point(this.xmax,this.ymin),new Ue.Point(this.xmax,this.ymax),new Ue.Point(this.xmin,this.ymax)]}toSegments(){let t=this.toPoints();return[new Ue.Segment(t[0],t[1]),new Ue.Segment(t[1],t[2]),new Ue.Segment(t[2],t[3]),new Ue.Segment(t[3],t[0])]}rotate(t,n=new Ue.Point){throw ju.OPERATION_IS_NOT_SUPPORTED}transform(t=new Ue.Matrix){return this.toPoints().map((n)=>n.transform(t)).reduce((n,o)=>n.merge(o.box),new e)}contains(t){return t instanceof Ue.Point?t.x>=this.xmin&&t.x<=this.xmax&&t.y>=this.ymin&&t.y<=this.ymax:t instanceof Ue.Segment?t.vertices.every((n)=>this.contains(n)):t instanceof Ue.Box?t.toSegments().every((n)=>this.contains(n)):t instanceof Ue.Circle?this.contains(t.box):t instanceof Ue.Arc?t.vertices.every((n)=>this.contains(n))&&this.toSegments().every((n)=>uZ(n,t).length===0):!(t instanceof Ue.Line||t instanceof Ue.Ray)&&(t instanceof Ue.Multiline?t.toShapes().every((n)=>this.contains(n)):t instanceof Ue.Polygon?this.contains(t.box):void 0)}distanceTo(t){let n=this.toSegments().map((r)=>r.distanceTo(t)),o=[Number.MAX_SAFE_INTEGER,null];return n.forEach((r)=>{r[0]<o[0]&&(o=r)}),o}get name(){return"box"}svg(t={}){let n=this.xmax-this.xmin,o=this.ymax-this.ymin;return`
<rect x="${this.xmin}" y="${this.ymin}" width="${n}" height="${o}"
                ${KY({fill:"none",...t})} />`}};Ue.box=(...e)=>new Ue.Box(...e);Ue.Edge=class{constructor(e){this.shape=e,this.next=void 0,this.prev=void 0,this.face=void 0,this.arc_length=0,this.bvStart=void 0,this.bvEnd=void 0,this.bv=void 0,this.overlap=void 0}get start(){return this.shape.start}get end(){return this.shape.end}get length(){return this.shape.length}get box(){return this.shape.box}get isSegment(){return this.shape instanceof Ue.Segment}get isArc(){return this.shape instanceof Ue.Arc}get isLine(){return this.shape instanceof Ue.Line}get isRay(){return this.shape instanceof Ue.Ray}middle(){return this.shape.middle()}pointAtLength(e){return this.shape.pointAtLength(e)}contains(e){return this.shape.contains(e)}setInclusion(e){if(this.bv!==void 0)return this.bv;if(this.shape instanceof Ue.Line||this.shape instanceof Ue.Ray)return this.bv=Ue.OUTSIDE,this.bv;if(this.bvStart===void 0&&(this.bvStart=Ide(e,this.start)),this.bvEnd===void 0&&(this.bvEnd=Ide(e,this.end)),this.bvStart===Ue.OUTSIDE||this.bvEnd==Ue.OUTSIDE)this.bv=Ue.OUTSIDE;else if(this.bvStart===Ue.INSIDE||this.bvEnd==Ue.INSIDE)this.bv=Ue.INSIDE;else{let t=Ide(e,this.middle());this.bv=t}return this.bv}setOverlap(e){let t,n=this.shape,o=e.shape;n instanceof Ue.Segment&&o instanceof Ue.Segment?n.start.equalTo(o.start)&&n.end.equalTo(o.end)?t=Ue.OVERLAP_SAME:n.start.equalTo(o.end)&&n.end.equalTo(o.start)&&(t=Ue.OVERLAP_OPPOSITE):(n instanceof Ue.Arc&&o instanceof Ue.Arc||n instanceof Ue.Segment&&o instanceof Ue.Arc||n instanceof Ue.Arc&&o instanceof Ue.Segment)&&(n.start.equalTo(o.start)&&n.end.equalTo(o.end)&&n.middle().equalTo(o.middle())?t=Ue.OVERLAP_SAME:n.start.equalTo(o.end)&&n.end.equalTo(o.start)&&n.middle().equalTo(o.middle())&&(t=Ue.OVERLAP_OPPOSITE)),this.overlap===void 0&&(this.overlap=t),e.overlap===void 0&&(e.overlap=t)}svg(){if(this.shape instanceof Ue.Segment)return` L${this.shape.end.x},${this.shape.end.y}`;if(this.shape instanceof Ue.Arc){let e,t=this.shape,n=t.counterClockwise?"1":"0";if(Ue.Utils.EQ(t.sweep,2*Math.PI)){let o=t.counterClockwise?1:-1,r=new Ue.Arc(t.pc,t.r,t.startAngle,t.startAngle+o*Math.PI,t.counterClockwise),i=new Ue.Arc(t.pc,t.r,t.startAngle+o*Math.PI,t.endAngle,t.counterClockwise);return e="0",` A${r.r},${r.r} 0 ${e},${n} ${r.end.x},${r.end.y}
                    A${i.r},${i.r} 0 ${e},${n} ${i.end.x},${i.end.y}`}return e=t.sweep<=Math.PI?"0":"1",` A${t.r},${t.r} 0 ${e},${n} ${t.end.x},${t.end.y}`}}toJSON(){return this.shape.toJSON()}};var Nqr=class extends nat{constructor(e,t){super(e,t),this.setCircularLinks()}setCircularLinks(){this.isEmpty()||(this.last.next=this.first,this.first.prev=this.last)}[Symbol.iterator](){let e;return{next:()=>{let t=e||this.first,n=!this.first||!!e&&e===this.first;return e=t?t.next:void 0,{value:t,done:n}}}}append(e){return super.append(e),this.setCircularLinks(),this}insert(e,t){return super.insert(e,t),this.setCircularLinks(),this}remove(e){return super.remove(e),this}};Ue.Face=class e extends Nqr{constructor(t,...n){if(super(),this._box=void 0,this._orientation=void 0,n.length!==0){if(n.length===1){if(n[0]instanceof Array){let o=n[0];if(o.length===0)return;if(o.every((r)=>r instanceof Ue.Point)){let r=e.points2segments(o);this.shapes2face(t.edges,r)}else if(o.every((r)=>r instanceof Array&&r.length===2)){let r=o.map((s)=>new Ue.Point(s[0],s[1])),i=e.points2segments(r);this.shapes2face(t.edges,i)}else if(o.every((r)=>r instanceof Ue.Segment||r instanceof Ue.Arc))this.shapes2face(t.edges,o);else if(o.every((r)=>r.name==="segment"||r.name==="arc")){let r=[];for(let i of o){let s;s=i.name==="segment"?new Ue.Segment(i):new Ue.Arc(i),r.push(s)}this.shapes2face(t.edges,r)}}else if(n[0]instanceof e){let o=n[0];this.first=o.first,this.last=o.last;for(let r of o)t.edges.add(r)}else if(n[0]instanceof Ue.Circle)this.shapes2face(t.edges,[n[0].toArc(fvn)]);else if(n[0]instanceof Ue.Box){let o=n[0];this.shapes2face(t.edges,[new Ue.Segment(new Ue.Point(o.xmin,o.ymin),new Ue.Point(o.xmax,o.ymin)),new Ue.Segment(new Ue.Point(o.xmax,o.ymin),new Ue.Point(o.xmax,o.ymax)),new Ue.Segment(new Ue.Point(o.xmax,o.ymax),new Ue.Point(o.xmin,o.ymax)),new Ue.Segment(new Ue.Point(o.xmin,o.ymax),new Ue.Point(o.xmin,o.ymin))])}}n.length===2&&n[0]instanceof Ue.Edge&&n[1]instanceof Ue.Edge&&(this.first=n[0],this.last=n[1],this.last.next=this.first,this.first.prev=this.last,this.setArcLength())}}get edges(){return this.toArray()}get vertices(){return this.edges.map((t)=>t.shape.start.clone())}get shapes(){return this.edges.map((t)=>t.shape.clone())}get box(){if(this._box===void 0){let t=new Ue.Box;for(let n of this)t=t.merge(n.box);this._box=t}return this._box}get perimeter(){return this.last.arc_length+this.last.length}pointAtLength(t){if(t>this.perimeter||t<0)return null;let n=null;for(let o of this)if(t>=o.arc_length&&(o===this.last||t<o.next.arc_length)){n=o.pointAtLength(t-o.arc_length);break}return n}static points2segments(t){let n=[];for(let o=0;o<t.length;o++)t[o].equalTo(t[(o+1)%t.length])||n.push(new Ue.Segment(t[o],t[(o+1)%t.length]));return n}shapes2face(t,n){for(let o of n){let r=new Ue.Edge(o);this.append(r),t.add(r)}}append(t){return super.append(t),this.setOneEdgeArcLength(t),t.face=this,this}insert(t,n){return super.insert(t,n),this.setOneEdgeArcLength(t),t.face=this,this}remove(t){return super.remove(t),this.setArcLength(),this}merge_with_next_edge(t){return t.shape.end.x=t.next.shape.end.x,t.shape.end.y=t.next.shape.end.y,this.remove(t.next),this}reverse(){let t=[],n=this.last;do n.shape=n.shape.reverse(),t.push(n),n=n.prev;while(n!==this.last);this.first=void 0,this.last=void 0;for(let o of t)this.first===void 0?(o.prev=o,o.next=o,this.first=o,this.last=o):(o.prev=this.last,this.last.next=o,this.last=o,this.last.next=this.first,this.first.prev=this.last),this.setOneEdgeArcLength(o);this._orientation!==void 0&&(this._orientation=void 0,this._orientation=this.orientation())}setArcLength(){for(let t of this)this.setOneEdgeArcLength(t),t.face=this}setOneEdgeArcLength(t){t===this.first?t.arc_length=0:t.arc_length=t.prev.arc_length+t.prev.length}area(){return Math.abs(this.signedArea())}signedArea(){let t=0,n=this.box.ymin;for(let o of this)t+=o.shape.definiteIntegral(n);return t}orientation(){if(this._orientation===void 0){let t=this.signedArea();Ue.Utils.EQ_0(t)?this._orientation=bde.NOT_ORIENTABLE:Ue.Utils.LT(t,0)?this._orientation=bde.CCW:this._orientation=bde.CW}return this._orientation}isSimple(t){return e.getSelfIntersections(this,t,!0).length===0}static getSelfIntersections(t,n,o=!1){let r=[];for(let i of t){let s=n.search(i.box);for(let a of s){if(i===a)continue;if(a.face!==t)continue;if(i.shape instanceof Ue.Segment&&a.shape instanceof Ue.Segment&&(i.next===a||i.prev===a))continue;let c=i.shape.intersect(a.shape);for(let l of c)if((!l.equalTo(i.start)||!l.equalTo(a.end)||a!==i.prev)&&(!l.equalTo(i.end)||!l.equalTo(a.start)||a!==i.next)&&(r.push(l),o))break;if(r.length>0&&o)break}if(r.length>0&&o)break}return r}findEdgeByPoint(t){let n;for(let o of this)if(!t.equalTo(o.shape.start)&&(t.equalTo(o.shape.end)||o.shape.contains(t))){n=o;break}return n}toPolygon(){return new Ue.Polygon(this.shapes)}toJSON(){return this.edges.map((t)=>t.toJSON())}svg(){let t=`M${this.first.start.x},${this.first.start.y}`;for(let n of this)t+=n.svg();return t+=" z",t}};Ue.Ray=class e extends Uk{constructor(...t){if(super(),this.pt=new Ue.Point,this.norm=new Ue.Vector(0,1),t.length!==0&&(t.length>=1&&t[0]instanceof Ue.Point&&(this.pt=t[0].clone()),t.length!==1)){if(!(t.length===2&&t[1]instanceof Ue.Vector))throw ju.ILLEGAL_PARAMETERS;this.norm=t[1].clone()}}clone(){return new e(this.pt,this.norm)}get slope(){return new Ue.Vector(this.norm.y,-this.norm.x).slope}get box(){let t=this.slope;return new Ue.Box(t>Math.PI/2&&t<3*Math.PI/2?Number.NEGATIVE_INFINITY:this.pt.x,t>=0&&t<=Math.PI?this.pt.y:Number.NEGATIVE_INFINITY,t>=Math.PI/2&&t<=3*Math.PI/2?this.pt.x:Number.POSITIVE_INFINITY,t>=Math.PI&&t<=2*Math.PI||t===0?this.pt.y:Number.POSITIVE_INFINITY)}get start(){return this.pt}get end(){}get length(){return Number.POSITIVE_INFINITY}contains(t){if(this.pt.equalTo(t))return!0;let n=new Ue.Vector(this.pt,t);return Ue.Utils.EQ_0(this.norm.dot(n))&&Ue.Utils.GE(n.cross(this.norm),0)}coord(t){return Ovn(t.x,t.y).cross(this.norm)}split(t){return this.contains(t)?this.pt.equalTo(t)?[this]:[new Ue.Segment(this.pt,t),new Ue.Ray(t,this.norm)]:[]}intersect(t){return t instanceof Ue.Point?this.contains(t)?[t]:[]:t instanceof Ue.Segment?sat(this,t):t instanceof Ue.Arc?aat(this,t):t instanceof Ue.Line?Dvn(this,t):t instanceof Ue.Ray?(o=t,BZ(vk(n=this),vk(o)).filter((s)=>n.contains(s)).filter((s)=>o.contains(s))):t instanceof Ue.Circle?Tvn(this,t):t instanceof Ue.Box?(i=t,dZ(vk(r=this),i).filter((s)=>r.contains(s))):t instanceof Ue.Polygon?Nvn(this,t):t instanceof Ue.Multiline?TZ(this,t):void 0;var n,o,r,i}rotate(t,n=new Ue.Point){return new Ue.Ray(this.pt.rotate(t,n),this.norm.rotate(t))}transform(t){return new Ue.Ray(this.pt.transform(t),this.norm.clone())}get name(){return"ray"}svg(t,n={}){let o=dZ(new Ue.Line(this.pt,this.norm),t);return o=o.filter((r)=>this.contains(r)),o.length===0||o.length===2?"":new Ue.Segment(this.pt,o[0]).svg(n)}};Ue.ray=(...e)=>new Ue.Ray(...e);var Rqr=class e{constructor(){this.faces=new Ue.PlanarSet,this.edges=new Ue.PlanarSet;let t=[...arguments];if(t.length===1&&(t[0]instanceof Array&&t[0].length>0||t[0]instanceof Ue.Circle||t[0]instanceof Ue.Box)){let n=t[0];if(t[0]instanceof Array&&t[0].every((o)=>o instanceof Array))if(n.every((o)=>o instanceof Array&&o.length===2&&typeof o[0]=="number"&&typeof o[1]=="number"))this.faces.add(new Ue.Face(this,n));else for(let o of n)if(o instanceof Array&&o[0]instanceof Array&&o[0].every((r)=>r instanceof Array&&r.length===2&&typeof r[0]=="number"&&typeof r[1]=="number"))for(let r of o)this.faces.add(new Ue.Face(this,r));else this.faces.add(new Ue.Face(this,o));else this.faces.add(new Ue.Face(this,n))}}get box(){return[...this.faces].reduce((t,n)=>t.merge(n.box),new Ue.Box)}get vertices(){return[...this.faces].flatMap((t)=>t.vertices)}clone(){let t=new e;for(let n of this.faces)t.addFace(n.shapes);return t}createFromArray(t){let n=new e;return t.forEach((o)=>[...o.faces].forEach((r)=>n.addFace(r.shapes))),n}isEmpty(){return this.edges.size===0||this.faces.size===0}isValid(){let t=!0;for(let n of this.faces)if(!n.isSimple(this.edges)){t=!1;break}return t}area(){let t=[...this.faces].reduce((n,o)=>n+o.signedArea(),0);return Math.abs(t)}addFace(...t){let n=new Ue.Face(this,...t);return this.faces.add(n),n}deleteFace(t){for(let n of t)this.edges.delete(n);return this.faces.delete(t)}recreateFaces(){this.faces.clear();for(let o of this.edges)o.face=null;let t,n=!0;for(;n;){n=!1;for(let o of this.edges)if(o.face===null){t=o,n=!0;break}if(n){let o=t;do o=o.next;while(o.next!==t);this.addFace(t,o)}}}removeChain(t,n,o){if(o.next!==n){for(let r=n;r!==o.next;r=r.next)if(t.remove(r),this.edges.delete(r),t.isEmpty()){this.deleteFace(t);break}}else this.deleteFace(t)}addVertex(t,n){let o=n.shape.split(t);if(o[0]===null)return n.prev;if(o[1]===null)return n;let r=new Ue.Edge(o[0]),i=n.prev;return n.face.insert(r,i),this.edges.delete(n),this.edges.add(r),n.shape=o[1],this.edges.add(n),r}removeEndVertex(t){let n=t.next;n!==t&&(t.face.merge_with_next_edge(t),this.edges.delete(n))}cut(t){let n=this.splitToIslands().flatMap((o)=>o._cutSingleIsland(t)).filter((o)=>o.isValid()&&o.isEmpty()===!1);return this.createFromArray(n)}_cutSingleIsland(t){let n=this.clone(),o=t.clone(),r,i,s={int_points1:[],int_points2:[],int_points1_sorted:[],int_points2_sorted:[]};for(let a of o.edges)for(let c of n.edges){let l=wvn(a,c);for(let h of l)pZ(a,h,s.int_points1),pZ(c,h,s.int_points2)}if(s.int_points1.length===0)return n;s.int_points1_sorted=sk(s.int_points1),s.int_points2_sorted=sk(s.int_points2),_Z(o,s.int_points1_sorted),_Z(n,s.int_points2_sorted),cat(s),s.int_points1_sorted=sk(s.int_points1),s.int_points2_sorted=sk(s.int_points2),Crt(s.int_points1),brt(s.int_points1,n);for(let a of s.int_points1_sorted)a.edge_before&&a.edge_after&&a.edge_before.bv===a.edge_after.bv&&(s.int_points2[a.id]=-1,a.id=-1);if(s.int_points1=s.int_points1.filter((a)=>a.id>=0),s.int_points2=s.int_points2.filter((a)=>a.id>=0),s.int_points1.forEach((a,c)=>{a.id=c}),s.int_points2.forEach((a,c)=>{a.id=c}),s.int_points1.length===0)return n;s.int_points1_sorted=sk(s.int_points1),s.int_points2_sorted=sk(s.int_points2);for(let a=1;a<s.int_points1_sorted.length;a++)if(i=s.int_points1_sorted[a],r=s.int_points1_sorted[a-1],i.edge_before&&i.edge_before.bv===1){let c=r.edge_after,l=i.edge_before,h=o.getChain(c,l);Wfn(s.int_points2[r.id],s.int_points2[i.id],h),h.forEach((d)=>n.edges.add(d)),h=h.reverse().map((d)=>new Ue.Edge(d.shape.reverse()));for(let d=0;d<h.length-1;d++)h[d].next=h[d+1],h[d+1].prev=h[d];Wfn(s.int_points2[i.id],s.int_points2[r.id],h),h.forEach((d)=>n.edges.add(d))}return n.recreateFaces(),n}cutWithLine(t){let n=new IY([t]);return this.cut(n)}findEdgeByPoint(t){let n;for(let o of this.faces)if(n=o.findEdgeByPoint(t),n!==void 0)break;return n}splitToIslands(){if(this.isEmpty())return[];let t=this.toArray();t.sort((r,i)=>i.area()-r.area());let n=[...t[0].faces][0].orientation(),o=t.filter((r)=>[...r.faces][0].orientation()===n);for(let r of t){let i=[...r.faces][0];if(i.orientation()!==n){for(let s of o)if(i.shapes.every((a)=>s.contains(a))){s.addFace(i.shapes);break}}}return o}rearrange(){if(this.faces.size<=1)return this.clone();let t=this.splitToIslands(),n=new e;return t.forEach((o)=>{o.faces.forEach((r)=>n.addFace(r.shapes))}),n}orientation(){return this.isEmpty()?bde.NOT_ORIENTABLE:[...this.faces][0].orientation()}isOuter(t){return t.orientation()===this.orientation()}isMultiPolygon(){let t=0;return this.faces.forEach((n)=>{this.isOuter(n)&&t++}),t>1}reverse(){for(let t of this.faces)t.reverse();return this}contains(t){if(t instanceof Ue.Point){let n=Ide(this,t);return n===1||n===2}return zvn(this,t)}distanceTo(t){if(t instanceof Ue.Point){let[n,o]=Ue.Distance.point2polygon(t,this);return o=o.reverse(),[n,o]}if(t instanceof Ue.Circle||t instanceof Ue.Line||t instanceof Ue.Segment||t instanceof Ue.Arc){let[n,o]=Ue.Distance.shape2polygon(t,this);return o=o.reverse(),[n,o]}if(t instanceof Ue.Polygon){let n,o,r=[Number.POSITIVE_INFINITY,new Ue.Segment];for(let i of this.edges){let s=r[0];[n,o]=Ue.Distance.shape2planarSet(i.shape,t.edges,s),Ue.Utils.LT(n,s)&&(r=[n,o])}return r}}intersect(t){return t instanceof Ue.Point?this.contains(t)?[t]:[]:t instanceof Ue.Line?zue(t,this):t instanceof Ue.Ray?Nvn(t,this):t instanceof Ue.Circle?Mvn(t,this):t instanceof Ue.Segment?rat(t,this):t instanceof Ue.Arc?iat(t,this):t instanceof Ue.Polygon?function(n,o){let r=[];if(n.isEmpty()||o.isEmpty())return r;if(n.box.not_intersect(o.box))return r;for(let i of n.edges)r=[...r,...Ufn(i,o)];return r}(t,this):t instanceof Ue.Multiline?function(n,o){let r=[];if(o.isEmpty()||n.size===0)return r;for(let i of n)r=[...r,...Ufn(i,o)];return r}(t,this):void 0}translate(t){let n=new e;for(let o of this.faces)n.addFace(o.shapes.map((r)=>r.translate(t)));return n}rotate(t=0,n=new Ue.Point){let o=new e;for(let r of this.faces)o.addFace(r.shapes.map((i)=>i.rotate(t,n)));return o}scale(t,n){let o=new e;for(let r of this.faces)o.addFace(r.shapes.map((i)=>i.scale(t,n)));return o}transform(t=new Ue.Matrix){let n=new e;for(let o of this.faces)n.addFace(o.shapes.map((r)=>r.transform(t)));return n}toJSON(){return[...this.faces].map((t)=>t.toJSON())}toArray(){return[...this.faces].map((t)=>t.toPolygon())}dpath(){return[...this.faces].reduce((t,n)=>t+n.svg(),"")}svg(t={}){let n=`
<path ${KY({fillRule:"evenodd",fill:"lightcyan",...t})} d="`;for(let o of this.faces)n+=`
${o.svg()}`;return n+=`" >
</path>`,n}};Ue.Polygon=Rqr;Ue.polygon=(...e)=>new Ue.Polygon(...e);var{Circle:ant,Line:n2n,Point:o2n,Vector:Y9e,Utils:cnt}=Ue;Ue.Inversion=class e{constructor(t){this.circle=t}get inversion_circle(){return this.circle}static inversePoint(t,n){let o=new Y9e(t.pc,n),r=t.r*t.r,i=o.dot(o);return cnt.EQ_0(i)?new o2n(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY):t.pc.translate(o.multiply(r/i))}static inverseCircle(t,n){let o=t.pc.distanceTo(n.pc)[0];if(cnt.EQ(o,n.r)){let r=t.r*t.r/(2*n.r),i=new Y9e(t.pc,n.pc);i=i.normalize();let s=t.pc.translate(i.multiply(r));return new n2n(s,i)}{let r=new Y9e(t.pc,n.pc),i=t.r*t.r/(r.dot(r)-n.r*n.r),s=t.pc.translate(r.multiply(i)),a=Math.abs(i)*n.r;return new ant(s,a)}}static inverseLine(t,n){let[o,r]=t.pc.distanceTo(n);if(cnt.EQ_0(o))return n.clone();{let i=t.r*t.r/(2*o),s=new Y9e(t.pc,r.end);return s=s.multiply(i/o),new ant(t.pc.translate(s),i)}}inverse(t){return t instanceof o2n?e.inversePoint(this.circle,t):t instanceof ant?e.inverseCircle(this.circle,t):t instanceof n2n?e.inverseLine(this.circle,t):void 0}};Ue.inversion=(e)=>new Ue.Inversion(e);Ue.Distance=class e{static point2point(t,n){return t.distanceTo(n)}static point2line(t,n){let o=t.projectionOn(n);return[new Ue.Vector(t,o).length,new Ue.Segment(t,o)]}static point2circle(t,n){let[o,r]=t.distanceTo(n.center);if(Ue.Utils.EQ_0(o))return[n.r,new Ue.Segment(t,n.toArc().start)];{let i=Math.abs(o-n.r),s=new Ue.Vector(n.pc,t).normalize().multiply(n.r),a=n.pc.translate(s);return[i,new Ue.Segment(t,a)]}}static point2segment(t,n){if(n.start.equalTo(n.end))return e.point2point(t,n.start);let o,r,i=new Ue.Vector(n.start,n.end),s=new Ue.Vector(n.start,t),a=new Ue.Vector(n.end,t),c=i.dot(s),l=-i.dot(a);if(Ue.Utils.GE(c,0)&&Ue.Utils.GE(l,0)){let h=n.tangentInStart();return o=Math.abs(h.cross(s)),r=n.start.translate(h.multiply(h.dot(s))),[o,new Ue.Segment(t,r)]}return c<0?t.distanceTo(n.start):t.distanceTo(n.end)}static point2arc(t,n){let o,r,i=new Ue.Circle(n.pc,n.r),s=[];return[o,r]=e.point2circle(t,i),r.end.on(n)&&s.push(e.point2circle(t,i)),s.push(e.point2point(t,n.start)),s.push(e.point2point(t,n.end)),e.sort(s),s[0]}static point2edge(t,n){return n.shape instanceof Ue.Segment?e.point2segment(t,n.shape):e.point2arc(t,n.shape)}static segment2line(t,n){let o=t.intersect(n);if(o.length>0)return[0,new Ue.Segment(o[0],o[0])];let r=[];return r.push(e.point2line(t.start,n)),r.push(e.point2line(t.end,n)),e.sort(r),r[0]}static segment2segment(t,n){let o=T8e(t,n);if(o.length>0)return[0,new Ue.Segment(o[0],o[0])];let r,i,s=[];return[r,i]=e.point2segment(n.start,t),s.push([r,i.reverse()]),[r,i]=e.point2segment(n.end,t),s.push([r,i.reverse()]),s.push(e.point2segment(t.start,n)),s.push(e.point2segment(t.end,n)),e.sort(s),s[0]}static segment2circle(t,n){let o=t.intersect(n);if(o.length>0)return[0,new Ue.Segment(o[0],o[0])];let r=new Ue.Line(t.ps,t.pe),[i,s]=e.point2line(n.center,r);if(Ue.Utils.GE(i,n.r)&&s.end.on(t))return e.point2circle(s.end,n);{let[a,c]=e.point2circle(t.start,n),[l,h]=e.point2circle(t.end,n);return Ue.Utils.LT(a,l)?[a,c]:[l,h]}}static segment2arc(t,n){let o=t.intersect(n);if(o.length>0)return[0,new Ue.Segment(o[0],o[0])];let r=new Ue.Line(t.ps,t.pe),i=new Ue.Circle(n.pc,n.r),[s,a]=e.point2line(i.center,r);if(Ue.Utils.GE(s,i.r)&&a.end.on(t)){let[d,u]=e.point2circle(a.end,i);if(u.end.on(n))return[d,u]}let c,l,h=[];return h.push(e.point2arc(t.start,n)),h.push(e.point2arc(t.end,n)),[c,l]=e.point2segment(n.start,t),h.push([c,l.reverse()]),[c,l]=e.point2segment(n.end,t),h.push([c,l.reverse()]),e.sort(h),h[0]}static circle2circle(t,n){let o=t.intersect(n);if(o.length>0)return[0,new Ue.Segment(o[0],o[0])];if(t.center.equalTo(n.center)){let r=t.toArc(),i=n.toArc();return e.point2point(r.start,i.start)}{let r=new Ue.Line(t.center,n.center),i=r.intersect(t),s=r.intersect(n),a=[];return a.push(e.point2point(i[0],s[0])),a.push(e.point2point(i[0],s[1])),a.push(e.point2point(i[1],s[0])),a.push(e.point2point(i[1],s[1])),e.sort(a),a[0]}}static circle2line(t,n){let o=t.intersect(n);if(o.length>0)return[0,new Ue.Segment(o[0],o[0])];let[r,i]=e.point2line(t.center,n),[s,a]=e.point2circle(i.end,t);return a=a.reverse(),[s,a]}static arc2line(t,n){let o=n.intersect(t);if(o.length>0)return[0,new Ue.Segment(o[0],o[0])];let r=new Ue.Circle(t.center,t.r),[i,s]=e.point2line(r.center,n);if(!Ue.Utils.GE(i,r.r)){let a=[];return a.push(e.point2line(t.start,n)),a.push(e.point2line(t.end,n)),e.sort(a),a[0]}{let[a,c]=e.point2circle(s.end,r);if(c.end.on(t))return[a,c]}}static arc2circle(t,n){let o=t.intersect(n);if(o.length>0)return[0,new Ue.Segment(o[0],o[0])];let r=new Ue.Circle(t.center,t.r),[i,s]=e.circle2circle(r,n);if(s.start.on(t))return[i,s];{let a=[];return a.push(e.point2circle(t.start,n)),a.push(e.point2circle(t.end,n)),e.sort(a),a[0]}}static arc2arc(t,n){let o=t.intersect(n);if(o.length>0)return[0,new Ue.Segment(o[0],o[0])];let r=new Ue.Circle(t.center,t.r),i=new Ue.Circle(n.center,n.r),[s,a]=e.circle2circle(r,i);if(a.start.on(t)&&a.end.on(n))return[s,a];{let c,l,h=[];return[c,l]=e.point2arc(t.start,n),l.end.on(n)&&h.push([c,l]),[c,l]=e.point2arc(t.end,n),l.end.on(n)&&h.push([c,l]),[c,l]=e.point2arc(n.start,t),l.end.on(t)&&h.push([c,l.reverse()]),[c,l]=e.point2arc(n.end,t),l.end.on(t)&&h.push([c,l.reverse()]),[c,l]=e.point2point(t.start,n.start),h.push([c,l]),[c,l]=e.point2point(t.start,n.end),h.push([c,l]),[c,l]=e.point2point(t.end,n.start),h.push([c,l]),[c,l]=e.point2point(t.end,n.end),h.push([c,l]),e.sort(h),h[0]}}static point2polygon(t,n){let o=[Number.POSITIVE_INFINITY,new Ue.Segment];for(let r of n.edges){let[i,s]=e.point2edge(t,r);Ue.Utils.LT(i,o[0])&&(o=[i,s])}return o}static shape2polygon(t,n){let o=[Number.POSITIVE_INFINITY,new Ue.Segment];for(let r of n.edges){let[i,s]=t.distanceTo(r.shape);Ue.Utils.LT(i,o[0])&&(o=[i,s])}return o}static polygon2polygon(t,n){let o=[Number.POSITIVE_INFINITY,new Ue.Segment];for(let r of t.edges)for(let i of n.edges){let[s,a]=r.shape.distanceTo(i.shape);Ue.Utils.LT(s,o[0])&&(o=[s,a])}return o}static box2box_minmax(t,n){let o=Math.max(Math.max(t.xmin-n.xmax,0),Math.max(n.xmin-t.xmax,0)),r=Math.max(Math.max(t.ymin-n.ymax,0),Math.max(n.ymin-t.ymax,0)),i=o*o+r*r,s=t.merge(n),a=s.xmax-s.xmin,c=s.ymax-s.ymin;return[i,a*a+c*c]}static minmax_tree_process_level(t,n,o,r){let i,s;for(let c of n){[i,s]=e.box2box_minmax(t.box,c.item.key);for(let l of c.item.values)l instanceof Ue.Edge?r.insert([i,s],l.shape):r.insert([i,s],l);Ue.Utils.LT(s,o)&&(o=s)}if(n.length===0)return o;let a=[...n.map((c)=>c.left.isNil()?void 0:c.left).filter((c)=>c!==void 0),...n.map((c)=>c.right.isNil()?void 0:c.right).filter((c)=>c!==void 0)].filter((c)=>{let[l,h]=e.box2box_minmax(t.box,c.max);return Ue.Utils.LE(l,o)});return o=e.minmax_tree_process_level(t,a,o,r)}static minmax_tree(t,n,o){let r=new Mrt,i=[n.index.root],s=o<Number.POSITIVE_INFINITY?o*o:Number.POSITIVE_INFINITY;return s=e.minmax_tree_process_level(t,i,s,r),r}static minmax_tree_calc_distance(t,n,o){let r,i;if(n!=null&&!n.isNil()){if([r,i]=e.minmax_tree_calc_distance(t,n.left,o),i)return[r,i];if(Ue.Utils.LT(r[0],Math.sqrt(n.item.key.low)))return[r,!0];let[s,a]=e.distanceToArray(t,n.item.values);return Ue.Utils.LT(s,r[0])&&(r=[s,a]),[r,i]=e.minmax_tree_calc_distance(t,n.right,r),[r,i]}return[o,!1]}static shape2planarSet(t,n,o=Number.POSITIVE_INFINITY){let r=[o,new Ue.Segment],i=!1;if(n instanceof Ue.PlanarSet){let s=e.minmax_tree(t,n,o);[r,i]=e.minmax_tree_calc_distance(t,s.root,r)}return r}static sort(t){t.sort((n,o)=>Ue.Utils.LT(n[0],o[0])?-1:Ue.Utils.GT(n[0],o[0])?1:0)}static distance(t,n){return t.distanceTo(n)}static distanceToArray(t,n){let o=[Number.POSITIVE_INFINITY,new Ue.Segment];for(let r of n){let[i,s]=t.distanceTo(r);Ue.Utils.LT(i,o[0])&&(o=[i,s])}return o}static shape2multiline(t,n){let o=[Number.POSITIVE_INFINITY,new Ue.Segment];for(let r of n){let[i,s]=e.distance(t,r.shape);Ue.Utils.LT(i,o[0])&&(o=[i,s])}return o}static multiline2multiline(t,n){let o=[Number.POSITIVE_INFINITY,new Ue.Segment];for(let r of t)for(let i of n){let[s,a]=e.distance(r.shape,i.shape);Ue.Utils.LT(s,o[0])&&(o=[s,a])}return o}};var{Multiline:Qqr,Point:Vvn,Segment:kqr,Polygon:Yvn}=Ue;function wrt(e){return new Vvn(e.split(" ").map(Number))}function Gvn(e){return e.split(", ").map(wrt)}function lnt(e){let t=Gvn(e),n=[];for(let o=0;o<t.length-1;o++)n.push(new kqr(t[o],t[o+1]));return new Qqr(n)}function r2n(e){let t=e.replace(/\(\(/,"").replace(/\)\)$/,"").split("), ("),n=new Yvn,o;return t.forEach((r,i)=>{let s=r.split(", ").map((c)=>new Vvn(c.split(" ").map(Number))),a=n.addFace(s);i===0?o=a.orientation():a.orientation()===o&&a.reverse()}),n}function Lqr(e){if(e.startsWith("POLYGON"))return r2n(e.replace(/^POLYGON /,""));return function(t){let n=t.split(/\)\), \(\(/).map((r)=>"(("+r+"))").map(r2n),o=new Yvn;return n.reduce((r,i)=>[...r,...i?.faces],[]).forEach((r)=>o.addFace([...r?.shapes])),o}(e.replace(/^MULTIPOLYGON \(\(\((.*)\)\)\)$/,"$1"))}function i2n(e){return e.split(`
`)?.every((t)=>t.includes("POINT"))}function s2n(e){return e.split(`
`)?.every((t)=>t.includes("LINESTRING"))}Ue.isWktString=function(e){return e.startsWith("POINT")||i2n(e)||e.startsWith("LINESTRING")||s2n(e)||e.startsWith("MULTILINESTRING")||e.startsWith("POLYGON")||e.startsWith("MULTIPOINT")||e.startsWith("MULTIPOLYGON")||e.startsWith("GEOMETRYCOLLECTION")},Ue.parseWKT=function e(t){if(t.startsWith("POINT"))return wrt(t.replace(/^POINT \(/,"").replace(/\)$/,""));if(t.startsWith("MULTIPOINT"))return Gvn(t.replace(/^MULTIPOINT \(/,"").replace(/\)$/,""));if(t.startsWith("LINESTRING"))return lnt(t.replace(/^LINESTRING \(/,"").replace(/\)$/,""));if(t.startsWith("MULTILINESTRING"))return function(n){return n.replace(/\(\(/,"").replace(/\)\)$/,"").split("), (").map(lnt)}(t.replace(/^MULTILINESTRING /,""));if(t.startsWith("POLYGON")||t.startsWith("MULTIPOLYGON"))return Lqr(t);if(t.startsWith("GEOMETRYCOLLECTION")){let n=/(?<type>POINT|LINESTRING|POLYGON|MULTIPOINT|MULTILINESTRING|MULTIPOLYGON) \((?:[^\(\)]|\([^\)]*\))*\)/g,o=t.match(n);return o[0].startsWith("GEOMETRYCOLLECTION")&&(o[0]=o[0].replace("GEOMETRYCOLLECTION (","")),o.map(e).map((r)=>r instanceof Array?r:[r]).reduce((r,i)=>[...r,...i],[])}return i2n(t)?function(n){return n.split(`
`).map((o)=>o.match(/\(([^)]+)\)/)[1]).map(wrt)}(t):s2n(t)?function(n){return n.split(`
`).map((o)=>o.match(/\(([^)]+)\)/)[1]).map(lnt).reduce((o,r)=>[...o,...r],[])}(t):[]},Ue.BooleanOperations=xqr,Ue.Relations=Pqr;var tjs={DISTANCE_TO_COST:0.05,RIP_THRESHOLD_RAMP_ATTEMPTS:16,RIP_CONGESTION_REGION_COST_FACTOR:0.1,MAX_ITERATIONS:50000,MAX_RIPS_WITHOUT_MAX_REGION_COST_IMPROVEMENT:6,EXTRA_RIPS_AFTER_BEATING_BASELINE_MAX_REGION_COST:Number.POSITIVE_INFINITY};new Int32Array(0);var njs={DISTANCE_TO_COST:0.05,RIP_THRESHOLD_START:0.05,RIP_THRESHOLD_END:0.8,RIP_CONGESTION_REGION_COST_FACTOR:0.1,ACCEPT_BEST_SOLUTION_ON_TIMEOUT:!0,GREEDY_FINAL_ROUTE_ITERS:4,MAX_RIPS_WITHOUT_MAX_REGION_COST_IMPROVEMENT:6,EXTRA_RIPS_AFTER_BEATING_BASELINE_MAX_REGION_COST:Number.POSITIVE_INFINITY},ojs=Math.PI/2,Hqr=0.1,Fqr=0.15,zqr=Hqr+Fqr,rjs=3*zqr/4,ijs=Jot(gGr(),1),sjs=(Number.POSITIVE_INFINITY,0.000000001),ajs=(new Int32Array(0),(e)=>(e.ccwRotationDegrees??0)*Math.PI/180),H7e=class e{static generators=new Map;static register(t){e.generators.set(t.componentKind,t)}static create(t){let n=t.detectedComponent.componentKind,o=e.generators.get(n);if(!o)throw Error(`No topology generator registered for component kind "${n}"`);return new o(t)}},cue=(e)=>[e.obstacle.obstacleId??e.obstacle.componentId??"obstacle",e.start.x.toFixed(4),e.start.y.toFixed(4),e.end.x.toFixed(4),e.end.y.toFixed(4),e.expansionDirection.x,e.expansionDirection.y].join(":"),Uvn=(e)=>{let t=0;for(let n of e)t=31*t+n.charCodeAt(0)>>>0;return t},l_=(e,t)=>`hsla(${Uvn(cue(e))%360},72%,36%,${t})`,lue=(e)=>{let t=e.expansionDirection;return t.x<0?"left":t.x>0?"right":t.y<0?"bottom":"top"},US=(e)=>({x:(e.start.x+e.end.x)/2,y:(e.start.y+e.end.y)/2}),Brt=(e)=>{let t=/^bga-gapfill-(\d+)-/.exec(e.capacityMeshNodeId);return t?Number.parseInt(t[1],10):null},a2n=(e,t)=>{let n=US(e),o=US(t),r=n.y-o.y;if(Math.abs(r)>0.000001)return r;let i=n.x-o.x;return Math.abs(i)>0.000001?i:cue(e).localeCompare(cue(t))},N8e=(e)=>{let t=[...e].sort(a2n),n=[],o=t.shift();for(;o&&(n.push(o),t.length!==0);){let r=US(o),i=0,s=Number.POSITIVE_INFINITY;for(let a=0;a<t.length;a++){let c=t[a],l=US(c),h=(l.x-r.x)**2+(l.y-r.y)**2;h<s-0.000000001?(s=h,i=a):Math.abs(h-s)<=0.000000001&&a2n(c,t[i])<0&&(i=a)}o=t.splice(i,1)[0]}return n},w9=(e,t)=>{let n=cue(e),o=t.findIndex((r)=>cue(r)===n);return o>=0?`E${o+1}`:`E${Uvn(n).toString(36).slice(0,4)}`},Trt=(e)=>e.flatMap((t)=>{let n=bm(t);return[{obstacle:t,start:{x:n.minX,y:n.minY},end:{x:n.minX,y:n.maxY},expansionDirection:{x:-1,y:0}},{obstacle:t,start:{x:n.maxX,y:n.minY},end:{x:n.maxX,y:n.maxY},expansionDirection:{x:1,y:0}},{obstacle:t,start:{x:n.minX,y:n.minY},end:{x:n.maxX,y:n.minY},expansionDirection:{x:0,y:-1}},{obstacle:t,start:{x:n.minX,y:n.maxY},end:{x:n.maxX,y:n.maxY},expansionDirection:{x:0,y:1}}]}),XV=0.001,G9e=0.001,Oqr=class extends IB{constructor(e){super(),this.inputProblem=e}inputProblem;meshIndex;allEdges=[];queueEdges=[];disconnectedEdges=[];currentEdge=null;lastSearchBounds=null;lastCandidateMeshNodes=[];lastMatchedMeshNode=null;_setup(){let e=Math.max(this.inputProblem.meshNodes.length,1);this.meshIndex=new mCn(e);for(let n of this.inputProblem.meshNodes){let o=bm(n);this.meshIndex.add(o.minX,o.minY,o.maxX,o.maxY)}this.meshIndex.finish();let t=Trt(this.inputProblem.unmarkedComponentObstacles);this.queueEdges=t,this.allEdges=N8e(t),this.currentEdge=null,this.lastSearchBounds=null,this.lastCandidateMeshNodes=[],this.lastMatchedMeshNode=null}_step(){let e=this.queueEdges.shift();if(!e)return this.currentEdge=null,this.lastSearchBounds=null,this.lastCandidateMeshNodes=[],this.lastMatchedMeshNode=null,void(this.solved=!0);this.currentEdge=e,this.lastMatchedMeshNode=null;let t=Math.abs(e.start.x-e.end.x)<=XV,n=t?{minX:e.start.x-G9e,maxX:e.start.x+G9e,minY:Math.min(e.start.y,e.end.y),maxY:Math.max(e.start.y,e.end.y)}:{minX:Math.min(e.start.x,e.end.x),maxX:Math.max(e.start.x,e.end.x),minY:e.start.y-G9e,maxY:e.start.y+G9e};this.lastSearchBounds=n;let o=this.meshIndex.search(n.minX,n.minY,n.maxX,n.maxY);this.lastCandidateMeshNodes=o.map((i)=>this.inputProblem.meshNodes[i]);let r=!1;for(let i of o){let s=this.inputProblem.meshNodes[i],a=bm(s);if(t){if(!(Math.min(a.maxY,Math.max(e.start.y,e.end.y))-Math.max(a.minY,Math.min(e.start.y,e.end.y))>XV))continue;if(e.expansionDirection.x===-1&&Math.abs(a.maxX-e.start.x)<=XV){r=!0,this.lastMatchedMeshNode=s;break}if(e.expansionDirection.x===1&&Math.abs(a.minX-e.start.x)<=XV){r=!0,this.lastMatchedMeshNode=s;break}continue}if(Math.min(a.maxX,Math.max(e.start.x,e.end.x))-Math.max(a.minX,Math.min(e.start.x,e.end.x))>XV){if(e.expansionDirection.y===-1&&Math.abs(a.maxY-e.start.y)<=XV){r=!0,this.lastMatchedMeshNode=s;break}if(e.expansionDirection.y===1&&Math.abs(a.minY-e.start.y)<=XV){r=!0,this.lastMatchedMeshNode=s;break}}}r||this.disconnectedEdges.push(e)}getOutput(){return this.disconnectedEdges}visualize(){let e=this.disconnectedEdges,t=this.allEdges.length>0?this.allEdges:[...e,...this.currentEdge?[this.currentEdge]:[]],n=this.currentEdge?l_(this.currentEdge,0.88):"rgba(40,40,40,0.4)",o=this.inputProblem.meshNodes.map((d)=>({...yB(d,{rectMargin:0.01}),fill:d._containsObstacle?"rgba(120,120,120,0.18)":"rgba(120,120,120,0.08)",stroke:d._containsObstacle?"rgba(120,120,120,0.42)":"rgba(120,120,120,0.24)"})),r=this.lastSearchBounds&&this.currentEdge?[{center:(i=this.lastSearchBounds,{x:(i.minX+i.maxX)/2,y:(i.minY+i.maxY)/2}),width:this.lastSearchBounds.maxX-this.lastSearchBounds.minX,height:this.lastSearchBounds.maxY-this.lastSearchBounds.minY,fill:l_(this.currentEdge,0.1),stroke:l_(this.currentEdge,0.36),label:[w9(this.currentEdge,t),"search band"].join(" ")}]:[];var i;let s=this.lastCandidateMeshNodes.map((d)=>({...yB(d,{rectMargin:0.018}),fill:d===this.lastMatchedMeshNode?"rgba(0,180,90,0.24)":this.currentEdge?l_(this.currentEdge,0.16):"rgba(80,120,160,0.16)",stroke:d===this.lastMatchedMeshNode?"rgba(0,150,80,0.88)":n,label:[d===this.lastMatchedMeshNode?"matched":"candidate",d.capacityMeshNodeId,`z:${d.availableZ.join(",")}`].join(`
`)})),a=this.inputProblem.unmarkedComponentObstacles.map((d)=>({center:d.center,width:d.width,height:d.height,fill:"rgba(160,160,160,0.10)",stroke:"rgba(160,160,160,0.40)",label:d.obstacleId??d.componentId??"obstacle"})),c=e.map((d)=>({points:[d.start,d.end],strokeColor:l_(d,0.14),strokeWidth:0.01,strokeDash:"5 4",label:[w9(d,t),lue(d),"disconnected"].join(" ")})),l=[],h=[];if(this.currentEdge){let d=US(this.currentEdge);l.push({points:[this.currentEdge.start,this.currentEdge.end],strokeColor:l_(this.currentEdge,1),strokeWidth:0.06,label:[w9(this.currentEdge,t),lue(this.currentEdge),"checking"].join(" ")},{points:[d,{x:d.x+0.16*this.currentEdge.expansionDirection.x,y:d.y+0.16*this.currentEdge.expansionDirection.y}],strokeColor:l_(this.currentEdge,0.82),strokeWidth:0.02,strokeDash:"3 3"}),h.push({...d,color:l_(this.currentEdge,1),label:w9(this.currentEdge,t)})}return{rects:[...o,...r,...s,...a],lines:[...c,...l],points:h}}},XQ=0.001,jQ=0.001,U9e=0.000001,Vqr=class extends IB{constructor(e){super(),this.inputProblem=e}inputProblem;meshIndex;meshBounds;expandedNodes=[];_setup(){let e=Math.max(this.inputProblem.meshNodes.length,1);this.meshIndex=new mCn(e);let{POSITIVE_INFINITY:t,NEGATIVE_INFINITY:n,POSITIVE_INFINITY:o,NEGATIVE_INFINITY:r}=Number;for(let i of this.inputProblem.meshNodes){let s=bm(i);this.meshIndex.add(s.minX,s.minY,s.maxX,s.maxY),t=Math.min(t,s.minX),n=Math.max(n,s.maxX),o=Math.min(o,s.minY),r=Math.max(r,s.maxY)}this.meshIndex.finish(),this.meshBounds=this.inputProblem.meshNodes.length?{minX:t,maxX:n,minY:o,maxY:r}:{minX:0,maxX:0,minY:0,maxY:0}}getObstacleAvailableZ(e){return e.__zLayers??e.layers.map((t)=>KS(t,this.inputProblem.layerCount))}getSharedOverlapArea(e,t){if(!e.availableZ.some((s)=>t.availableZ.includes(s)))return 0;let n=bm(e),o=bm(t),r=Math.min(n.maxX,o.maxX)-Math.max(n.minX,o.minX),i=Math.min(n.maxY,o.maxY)-Math.max(n.minY,o.minY);return r<=U9e||i<=U9e?0:r*i}getNodeObstacleOverlapArea(e,t){let n=this.getObstacleAvailableZ(t);if(!e.availableZ.some((a)=>n.includes(a)))return 0;let o=bm(e),r=bm(t),i=Math.min(o.maxX,r.maxX)-Math.max(o.minX,r.minX),s=Math.min(o.maxY,r.maxY)-Math.max(o.minY,r.minY);return i<=U9e||s<=U9e?0:i*s}getClosestMeshNode(e,t){let n=Math.abs(e.start.x-e.end.x)<=XQ,o=this.getObstacleAvailableZ(e.obstacle),r=n?e.expansionDirection.x<0?{minX:this.meshBounds.minX,maxX:e.start.x,minY:Math.min(e.start.y,e.end.y)-jQ,maxY:Math.max(e.start.y,e.end.y)+jQ}:{minX:e.start.x,maxX:this.meshBounds.maxX,minY:Math.min(e.start.y,e.end.y)-jQ,maxY:Math.max(e.start.y,e.end.y)+jQ}:e.expansionDirection.y<0?{minX:Math.min(e.start.x,e.end.x)-jQ,maxX:Math.max(e.start.x,e.end.x)+jQ,minY:this.meshBounds.minY,maxY:e.start.y}:{minX:Math.min(e.start.x,e.end.x)-jQ,maxX:Math.max(e.start.x,e.end.x)+jQ,minY:e.start.y,maxY:this.meshBounds.maxY},i=this.meshIndex.search(r.minX,r.minY,r.maxX,r.maxY),s=null,a=Number.POSITIVE_INFINITY,c=[...i.map((l)=>this.inputProblem.meshNodes[l]),...t];for(let l of c){if(l._containsObstacle)continue;if(!l.availableZ.some((u)=>o.includes(u)))continue;let h=bm(l);if((n?Math.min(Math.max(e.start.y,e.end.y),h.maxY)-Math.max(Math.min(e.start.y,e.end.y),h.minY):Math.min(Math.max(e.start.x,e.end.x),h.maxX)-Math.max(Math.min(e.start.x,e.end.x),h.minX))<=XQ)continue;let d=n?e.expansionDirection.x<0?e.start.x-h.maxX:h.minX-e.start.x:e.expansionDirection.y<0?e.start.y-h.maxY:h.minY-e.start.y;d<XQ||(d>=a||(a=d,s=l))}return s}createExpandedNode(e,t,n){let o=bm(t),r=this.getObstacleAvailableZ(e.obstacle);if(Math.abs(e.start.x-e.end.x)<=XQ){let l=Math.max(Math.min(e.start.y,e.end.y),o.minY),h=Math.min(Math.max(e.start.y,e.end.y),o.maxY),d=e.expansionDirection.x<0?o.maxX:e.start.x,u=e.expansionDirection.x<0?e.start.x:o.minX;return u-d<=XQ||h-l<=XQ?null:{capacityMeshNodeId:`bga-gapfill-${n}-${e.obstacle.obstacleId??"no-obstacle"}-${t.capacityMeshNodeId}`,center:{x:(d+u)/2,y:(l+h)/2},width:u-d,height:h-l,layer:`z${r.join(",")}`,availableZ:r}}let i=Math.max(Math.min(e.start.x,e.end.x),o.minX),s=Math.min(Math.max(e.start.x,e.end.x),o.maxX),a=e.expansionDirection.y<0?o.maxY:e.start.y,c=e.expansionDirection.y<0?e.start.y:o.minY;return s-i<=XQ||c-a<=XQ?null:{capacityMeshNodeId:`bga-gapfill-${n}-${e.obstacle.obstacleId??"no-obstacle"}-${t.capacityMeshNodeId}`,center:{x:(i+s)/2,y:(a+c)/2},width:s-i,height:c-a,layer:`z${r.join(",")}`,availableZ:r}}overlapsExistingGeometry(e,t){for(let n of this.inputProblem.meshNodes)if(this.getSharedOverlapArea(e,n)>0)return!0;for(let n of t)if(this.getSharedOverlapArea(e,n)>0)return!0;for(let n of this.inputProblem.edgesWithObstacle)if(this.getNodeObstacleOverlapArea(e,n.obstacle)>0)return!0;return!1}_step(){let e=[];for(let[t,n]of this.inputProblem.edgesWithObstacle.entries()){let o=this.getClosestMeshNode(n,e);if(!o)continue;let r=this.createExpandedNode(n,o,t);r&&(this.overlapsExistingGeometry(r,e)||e.push(r))}this.expandedNodes=e,this.solved=!0}getOutput(){return this.expandedNodes}visualize(){let e=this.inputProblem.edgesWithObstacle,t=N8e(e);return{rects:[...this.inputProblem.meshNodes.map((n)=>({...yB(n,{rectMargin:0.01}),fill:n._containsObstacle?"rgba(255,0,0,0.16)":"rgba(0,120,255,0.08)",stroke:n._containsObstacle?"rgba(255,0,0,0.35)":"rgba(0,120,255,0.28)"})),...this.expandedNodes.map((n)=>{let o=Brt(n),r=o===null?null:e[o]??null;return{...yB(n,{rectMargin:0.012,zOffset:0.01}),fill:r?l_(r,0.24):"rgba(0,160,100,0.24)",stroke:r?l_(r,0.72):"rgba(0,160,100,0.68)",label:[r?w9(r,t):"E?","expanded",n.capacityMeshNodeId,`z:${n.availableZ.join(",")}`].join(`
`)}})],lines:[...this.inputProblem.edgesWithObstacle.map((n)=>({points:[n.start,n.end],strokeColor:l_(n,0.9),strokeWidth:0.034,label:[w9(n,t),lue(n)].join(" ")})),...this.inputProblem.edgesWithObstacle.map((n)=>{let o=US(n);return{points:[o,{x:o.x+0.16*n.expansionDirection.x,y:o.y+0.16*n.expansionDirection.y}],strokeColor:l_(n,0.7),strokeWidth:0.016,strokeDash:"3 3"}})],points:this.inputProblem.edgesWithObstacle.map((n)=>({...US(n),color:l_(n,0.95),label:w9(n,t)}))}}},jV=0.001,Yqr=class extends pCn{constructor(e){super(e),this.inputProblem=e}inputProblem;detectEdgesNotConnectedToMesh;expandUnconnectedEdgesToMesh;pipelineDef=[kJ("detectEdgesNotConnectedToMesh",Oqr,(e)=>[e.inputProblem]),kJ("expandUnconnectedEdgesToMesh",Vqr,(e)=>[{meshNodes:e.inputProblem.meshNodes,edgesWithObstacle:e.detectEdgesNotConnectedToMesh.getOutput(),layerCount:e.inputProblem.layerCount}])];getOutput(){return[...this.inputProblem.meshNodes,...this.expandUnconnectedEdgesToMesh.getOutput()]}getExpandedNodes(){return this.expandUnconnectedEdgesToMesh.getOutput()}getObstacleLayer(e){return`z${(e.obstacle.__zLayers??e.obstacle.layers.map((t)=>KS(t,this.inputProblem.layerCount))).join(",")}`}getObstacleRects(){return this.inputProblem.unmarkedComponentObstacles.map((e)=>{let t=e.__zLayers??e.layers.map((n)=>KS(n,this.inputProblem.layerCount));return{center:e.center,width:e.width,height:e.height,fill:"rgba(150,150,150,0.08)",stroke:"rgba(90,90,90,0.42)",label:e.obstacleId??e.componentId??"bga obstacle",layer:`z${t.join(",")}`}})}getBaseMeshRects(){return this.inputProblem.meshNodes.map((e)=>({...yB(e,{rectMargin:0.025,zOffset:0.01}),fill:e._containsObstacle?"rgba(210,60,60,0.14)":"rgba(80,120,160,0.08)",stroke:e._containsObstacle?"rgba(190,40,40,0.42)":"rgba(80,120,160,0.28)",label:`mesh ${e.capacityMeshNodeId}
z:${e.availableZ.join(",")}`}))}initialVisualize(){let e=Trt(this.inputProblem.unmarkedComponentObstacles),t=N8e(e),n=[...e.map((o)=>({points:[o.start,o.end],strokeColor:l_(o,0.72),strokeWidth:0.018,strokeDash:"0.05 0.035",layer:this.getObstacleLayer(o),label:[w9(o,t),lue(o)].join(" ")})),...e.map((o)=>{let r=US(o);return{points:[r,{x:r.x+0.18*o.expansionDirection.x,y:r.y+0.18*o.expansionDirection.y}],strokeColor:l_(o,0.64),strokeWidth:0.012,strokeDash:"0.035 0.025",layer:this.getObstacleLayer(o)}})];return{title:"BGA GapFill: candidate obstacle edges",rects:[...this.getBaseMeshRects(),...this.getObstacleRects()],lines:n}}finalVisualize(){let e=this.getStageOutput("detectEdgesNotConnectedToMesh")??[],t=this.getStageOutput("expandUnconnectedEdgesToMesh")??[],n=N8e(Trt(this.inputProblem.unmarkedComponentObstacles)),o=new Map;for(let c of t){let l=Brt(c);l!==null&&o.set(l,c)}let r=t.map((c)=>{let l=Brt(c),h=l===null?null:e[l]??null,d=h?(({expandedNode:p,edge:m,meshNodes:A})=>{let g=bm(p),f=Math.abs(m.start.x-m.end.x)<=jV;return A.filter((y)=>{if(y._containsObstacle)return!1;if(!p.availableZ.some((C)=>y.availableZ.includes(C)))return!1;let x=bm(y);return f?!(Math.min(g.maxY,x.maxY)-Math.max(g.minY,x.minY)<=jV)&&(m.expansionDirection.x<0?Math.abs(x.maxX-g.minX)<=jV:Math.abs(x.minX-g.maxX)<=jV):!(Math.min(g.maxX,x.maxX)-Math.max(g.minX,x.minX)<=jV)&&(m.expansionDirection.y<0?Math.abs(x.maxY-g.minY)<=jV:Math.abs(x.minY-g.maxY)<=jV)}).map((y)=>y.capacityMeshNodeId)})({expandedNode:c,edge:h,meshNodes:this.inputProblem.meshNodes}):[],u=h?w9(h,n):"E?",_=h===null?"rgba(0,160,100,0.72)":l_(h,0.72);return{...yB(c,{rectMargin:0.012,zOffset:0.01}),fill:h===null?"rgba(0,160,100,0.24)":l_(h,0.16),stroke:_,label:[`${u} gap fill`,d.length>0?`to ${d.join(",")}`:"target mesh not adjacent",`z:${c.availableZ.join(",")}`].join(`
`)}}),i=e.map((c,l)=>{let h=o.get(l);return{points:[c.start,c.end],strokeColor:h?l_(c,0.68):"rgba(80,80,80,0.14)",strokeWidth:h?0.026:0.008,...h?{}:{strokeDash:"5 4"},layer:this.getObstacleLayer(c),label:[[w9(c,n),lue(c)].join(" "),h?"filled":"no fill created"].join(`
`)}}),s=e.flatMap((c,l)=>{let h=US(c),d=o.get(l);return d?[{points:[h,d.center],strokeColor:l_(c,0.42),strokeWidth:0.012,strokeDash:"0.035 0.025",layer:this.getObstacleLayer(c)}]:[]}),a=e.flatMap((c,l)=>o.has(l)?[{...US(c),color:l_(c,0.82),label:w9(c,n),layer:this.getObstacleLayer(c)}]:[]);return{title:"BGA GapFill: disconnected edges and created mesh",rects:[...this.getBaseMeshRects(),...this.getObstacleRects(),...r],lines:[...i,...s],points:a}}};function c2n(e,t){let n=[];for(let o=0;o<e.length;o++){let r=e[o];n.push(r);let i=e[o+1];if(i===void 0)continue;let s=Math.round((i-r)/t);if(!(s<=1))for(let a=1;a<s;a++){let c=a/s;n.push(Number((r+(i-r)*c).toFixed(6)))}}return n}var wJ=0.001;function l2n(e){let t=[];for(let i=1;i<e.length;i++){let s=e[i]-e[i-1];s>wJ&&t.push(s)}if(t.length===0)return null;let n=Math.min(...t),o=t.filter((i)=>i<=1.5*n).sort((i,s)=>i-s),r=Math.floor(o.length/2);return o.length%2==0?(o[r-1]+o[r])/2:o[r]}function h2n(e){return[...new Set(e)].sort((t,n)=>t-n)}function W9e(e){return Number(e.toFixed(6))}var Gqr=class e{static fromObstacles(t){if(t.length===0)return null;let n=h2n(t.map((s)=>s.center.x)),o=h2n(t.map((s)=>s.center.y)),r=l2n(n),i=l2n(o);return r===null||i===null?null:new e({obstacles:t,xCoordinates:c2n(n,r),yCoordinates:c2n(o,i),pitchX:r,pitchY:i})}xCoordinates;yCoordinates;pitchX;pitchY;originX;originY;rowCount;colCount;padWidth;padHeight;slots=new Map;constructor(t){this.xCoordinates=t.xCoordinates,this.yCoordinates=t.yCoordinates,this.pitchX=t.pitchX,this.pitchY=t.pitchY,this.originX=this.xCoordinates[0],this.originY=this.yCoordinates[0],this.colCount=this.xCoordinates.length,this.rowCount=this.yCoordinates.length,this.padWidth=t.obstacles[0].width,this.padHeight=t.obstacles[0].height;for(let n of t.obstacles){let o=this.getSlotForObstacle(n);o&&this.slots.set(this.getSlotKey(o.row,o.col),{...o,obstacle:n})}}getSlotKey(t,n){return`${t}:${n}`}getAxisIndex(t,n){let o=-1,r=Number.POSITIVE_INFINITY;for(let i=0;i<t.length;i++){let s=Math.abs(t[i]-n);s<r&&(r=s,o=i)}return r<=wJ?o:null}getAxisCoordinate(t,n){return t[n]}hasPadAt(t,n){return this.slots.has(this.getSlotKey(t,n))}getSlotForObstacle(t){let n=this.getAxisIndex(this.yCoordinates,t.center.y),o=this.getAxisIndex(this.xCoordinates,t.center.x);return n===null||o===null||n<0||n>=this.rowCount||o<0||o>=this.colCount?null:{row:n,col:o}}getSlotCenter(t,n){return{x:this.getAxisCoordinate(this.xCoordinates,n),y:this.getAxisCoordinate(this.yCoordinates,t)}}getHorizontalGap(t,n){let o=this.getSlotCenter(t,n),r=this.getSlotCenter(t,n+1),i=Math.abs(r.x-o.x);return{orientation:"horizontal",row:t,col:n,center:{x:W9e((o.x+r.x)/2),y:o.y},width:i-this.padWidth,height:this.padHeight,isBetweenTwoPads:this.hasPadAt(t,n)&&this.hasPadAt(t,n+1)}}getVerticalGap(t,n){let o=this.getSlotCenter(t,n),r=this.getSlotCenter(t+1,n),i=Math.abs(r.y-o.y);return{orientation:"vertical",row:t,col:n,center:{x:o.x,y:W9e((o.y+r.y)/2)},width:this.padWidth,height:i-this.padHeight,isBetweenTwoPads:this.hasPadAt(t,n)&&this.hasPadAt(t+1,n)}}getDiagonalGap(t,n){let o=this.getSlotCenter(t,n),r=this.getSlotCenter(t+1,n+1),i=Math.abs(r.x-o.x),s=Math.abs(r.y-o.y);return{orientation:"diagonal",row:t,col:n,center:{x:W9e((o.x+r.x)/2),y:W9e((o.y+r.y)/2)},width:i-this.padWidth,height:s-this.padHeight,isBetweenTwoPads:this.hasPadAt(t,n)&&this.hasPadAt(t+1,n+1)}}getDiagonalGaps(){let t=[];for(let n=0;n<this.rowCount-1;n++)for(let o=0;o<this.colCount-1;o++)t.push(this.getDiagonalGap(n,o));return t.filter((n)=>n.width>wJ&&n.height>wJ)}getAxisGaps(){let t=[];for(let n=0;n<this.rowCount;n++)for(let o=0;o<this.colCount-1;o++)t.push(this.getHorizontalGap(n,o));for(let n=0;n<this.rowCount-1;n++)for(let o=0;o<this.colCount;o++)t.push(this.getVerticalGap(n,o));return t.filter((n)=>n.width>wJ&&n.height>wJ)}getMissingSlots(){let t=[];for(let n=0;n<this.rowCount;n++)for(let o=0;o<this.colCount;o++)this.hasPadAt(n,o)||t.push({row:n,col:o,center:this.getSlotCenter(n,o),width:this.padWidth,height:this.padHeight});return t}};function Uqr(e){if([e.point.pointId,e.point.pcb_port_id].filter((o)=>typeof o=="string").some((o)=>e.obstacle.connectedTo.includes(o)))return!0;if(e.obstacle.connectedTo.length===0)return!1;if(LGr(e.point,e.obstacle)>0.001)return!1;let t=OGr(e.point).map((o)=>KS(o,e.layerCount)),n=e.obstacle.layers.map((o)=>KS(o,e.layerCount));return t.some((o)=>n.includes(o))}function Wvn(e){return e.obstacleId??[e.componentId??"no-component",e.center.x,e.center.y,e.width,e.height,e.layers.join(",")].join(":")}function Xvn({componentId:e,orientationKey:t,row:n,col:o,center:r,width:i,height:s}){return["cmn",t,e,n,o,r.x,r.y,i,s].join("_")}function d2n(e){let{componentId:t,bgaGap:n,freeLayers:o,multiLayerThreshold:r}=e,i=n.width>r&&n.height>r,s="d";n.orientation==="horizontal"&&(s="h"),n.orientation==="vertical"&&(s="v");let a=Xvn({componentId:t,orientationKey:s,row:n.row,col:n.col,center:n.center,width:n.width,height:n.height});return n.orientation==="diagonal"&&i||!n.isBetweenTwoPads&&i?[{center:n.center,width:n.width,height:n.height,availableZ:[...o],capacityMeshNodeId:`${a}_all`,layer:""}]:o.map((c)=>({center:n.center,width:n.width,height:n.height,availableZ:[c],capacityMeshNodeId:`${a}_${c}`,layer:""}))}function Wqr(e){let{componentId:t,obstacle:n,freeLayers:o,layerCount:r}=e,i=n.layers.map((c)=>KS(c,r)),s=o.filter((c)=>!i.includes(c)),a=Wvn(n);return s.map((c)=>({capacityMeshNodeId:`free-${t}-${a}-${c}`,center:n.center,width:n.width,height:n.height,layer:`z${c}`,availableZ:[c]}))}function u2n(e,t,n){let o=t.layers.map((s)=>KS(s,n.layerCount)),r=Wvn(t),i=function(s){for(let a of s.srj.connections)for(let c of a.pointsToConnect)if(Uqr({point:c,obstacle:s.obstacle,layerCount:s.srj.layerCount}))return a.__rootConnectionNames?.[0]??a.name}({obstacle:t,srj:n});return{capacityMeshNodeId:`obstacle-${e}-${r}-${o.join(",")}-${t.center.x}-${t.center.y}`,_containsObstacle:!0,...i?{_containsTarget:!0,_targetConnectionName:i}:{},center:t.center,width:t.width,height:t.height,layer:`z${o.join(",")}`,availableZ:o}}var Xqr=class extends IB{constructor(e){super(),this.inputProblem=e}inputProblem;componentObstacles=[];meshNodes=[];getConstructorParams(){return[this.inputProblem]}_step(){let{srj:e,componentBounds:t,componentId:n,markedComponentObstacles:o,unmarkedComponentObstacles:r}=this.inputProblem,i=e.obstacles.filter((u)=>u.isCopperPour===!0).filter((u)=>P7e(bm(u),t)).flatMap((u)=>u.layers.map((_)=>KS(_,e.layerCount))),s=Array.from({length:e.layerCount},(u,_)=>_).filter((u)=>!i.includes(u));if(this.componentObstacles=o,o.length===0||s.length===0)return void(this.solved=!0);let a=Gqr.fromObstacles(o);if(!a)return void(this.solved=!0);let c=a.getAxisGaps(),l=a.getDiagonalGaps(),h=a.getMissingSlots(),d=1.2*(this.inputProblem.viaDiameter??E7e(e).padDiameter);this.meshNodes=[...c.flatMap((u)=>d2n({componentId:n,bgaGap:u,freeLayers:s,multiLayerThreshold:d})),...l.flatMap((u)=>d2n({componentId:n,bgaGap:u,freeLayers:s,multiLayerThreshold:d})),...h.flatMap((u)=>function(_){let{componentId:p,missingBgaSlot:m,freeLayers:A,multiLayerThreshold:g}=_,f=Xvn({componentId:p,orientationKey:"missing",row:m.row,col:m.col,center:m.center,width:m.width,height:m.height});return m.width>g&&m.height>g?[{center:m.center,width:m.width,height:m.height,availableZ:[...A],capacityMeshNodeId:`${f}_all`,layer:""}]:A.map((y)=>({center:m.center,width:m.width,height:m.height,availableZ:[y],capacityMeshNodeId:`${f}_${y}`,layer:""}))}({componentId:n,missingBgaSlot:u,freeLayers:s,multiLayerThreshold:d})),...o.flatMap((u)=>[...Wqr({componentId:n,obstacle:u,freeLayers:s,layerCount:e.layerCount}),u2n(n,u,e)]),...r.flatMap((u)=>[u2n(n,u,e)])],this.meshNodes=function(u){let _=new Map;return u.map((p)=>{let m=_.get(p.capacityMeshNodeId)??0;return _.set(p.capacityMeshNodeId,m+1),m===0?p:{...p,capacityMeshNodeId:`${p.capacityMeshNodeId}__dup${m}`}})}(this.meshNodes),this.solved=!0}getOutput(){return this.meshNodes}visualize(){return{rects:[{center:{x:(this.inputProblem.componentBounds.minX+this.inputProblem.componentBounds.maxX)/2,y:(this.inputProblem.componentBounds.minY+this.inputProblem.componentBounds.maxY)/2},width:this.inputProblem.componentBounds.maxX-this.inputProblem.componentBounds.minX,height:this.inputProblem.componentBounds.maxY-this.inputProblem.componentBounds.minY,fill:"rgba(0,0,0,0)",stroke:"rgba(30,30,30,0.65)",label:`component ${this.inputProblem.componentId}`},...this.inputProblem.markedComponentObstacles.map((e)=>({center:e.center,width:e.width,height:e.height,fill:"rgba(255,0,0,0.18)",stroke:"rgba(255,0,0,0.52)",label:`pad ${e.obstacleId??"obstacle"}`})),...this.inputProblem.unmarkedComponentObstacles.map((e)=>({center:e.center,width:e.width,height:e.height,fill:"rgba(255,140,0,0.14)",stroke:"rgba(255,140,0,0.42)",label:`foreign ${e.obstacleId??"obstacle"}`})),...this.meshNodes.map((e)=>({...yB(e,{rectMargin:0.01}),fill:e._containsObstacle?"rgba(255,0,0,0.14)":e.capacityMeshNodeId.includes("missing")?"rgba(0,200,120,0.18)":"rgba(0,120,255,0.12)",stroke:e._containsObstacle?"rgba(255,0,0,0.36)":e.capacityMeshNodeId.includes("missing")?"rgba(0,200,120,0.52)":"rgba(0,120,255,0.38)"}))]}}};function hnt(e){return e.capacityMeshNodeId.startsWith("bga-gapfill-")}function jqr(e){return JSON.stringify({availableZ:[...e.availableZ].sort((t,n)=>t-n),_containsTarget:e._containsTarget??!1,_targetConnectionName:e._targetConnectionName??null,_depth:e._depth??null,_strawNode:e._strawNode??!1,_strawParentCapacityMeshNodeId:e._strawParentCapacityMeshNodeId??null,_qfpRegionType:e._qfpRegionType??null,_isNarrowQfpPadGap:e._isNarrowQfpPadGap??!1,_soicRegionType:e._soicRegionType??null,_offBoardConnectionId:e._offBoardConnectionId??null,_offboardNetName:e._offboardNetName??null,_isVirtualOffboard:e._isVirtualOffboard??!1,_containsObstacle:e._containsObstacle??!1})}function Kqr(e,t){let n=bm(e);for(let o of t){if(!e.availableZ.some((i)=>o.availableZ.includes(i)))continue;let r=bm(o);if(P7e(n,r))return!0}return!1}function $qr(e){let t=e[0];if(!t)throw Error("createMergedNode requires at least one source node");let{POSITIVE_INFINITY:n,NEGATIVE_INFINITY:o,POSITIVE_INFINITY:r,NEGATIVE_INFINITY:i}=Number;for(let s of e){let a=bm(s);n=Math.min(n,a.minX),o=Math.max(o,a.maxX),r=Math.min(r,a.minY),i=Math.max(i,a.maxY)}return{...t,capacityMeshNodeId:`merge:${e.map((s)=>s.capacityMeshNodeId).join(":")}`,center:{x:(n+o)/2,y:(r+i)/2},width:o-n,height:i-r}}function zhe(e,t,n){return{center:e.center,width:e.width,height:e.height,fill:t,stroke:t,label:n}}var qqr=class extends IB{constructor(e){super(),this.inputProblem=e}inputProblem;obstacleNodes=[];passthroughNodes=[];mergedNodes=[];pendingGroups=[];totalGroupCount=0;processedGroupCount=0;debugFilteredNodes=[];debugMergeEvents=[];currentGroupKey=null;currentRootNodeId=null;lastMergedNodeId=null;_setup(){this.obstacleNodes=this.inputProblem.meshNodes.filter((t)=>t._containsObstacle===!0),this.passthroughNodes=[],this.mergedNodes=[],this.pendingGroups=[],this.totalGroupCount=0,this.processedGroupCount=0,this.debugFilteredNodes=[],this.debugMergeEvents=[],this.currentGroupKey=null,this.currentRootNodeId=null,this.lastMergedNodeId=null;let e=new Map;for(let t of this.inputProblem.meshNodes){if(t._containsObstacle===!0){this.passthroughNodes.push(t),this.debugFilteredNodes.push({type:"preserved-obstacle",node:t,reason:"contains-obstacle"});continue}if(hnt(t)){this.passthroughNodes.push(t);continue}if(t.availableZ.length!==this.inputProblem.layerCount){this.passthroughNodes.push(t);continue}let n=!1;for(let i=0;i<this.inputProblem.layerCount;i+=1)if(!t.availableZ.includes(i)){n=!0;break}if(n){this.passthroughNodes.push(t);continue}if(Kqr(t,this.obstacleNodes)){this.passthroughNodes.push(t),this.debugFilteredNodes.push({type:"preserved-overlap",node:t,reason:"overlaps-obstacle"});continue}let o=jqr(t),r=e.get(o);r?r.push(t):e.set(o,[t])}for(let[t,n]of e.entries())n.length<=1?this.passthroughNodes.push(...n):this.pendingGroups.push({groupKey:t,nodes:n});this.pendingGroups.sort((t,n)=>n.nodes.length-t.nodes.length),this.totalGroupCount=this.pendingGroups.length,this.updateStats("setup")}_step(){let e=this.pendingGroups.shift();if(!e)return this.currentGroupKey=null,this.currentRootNodeId=null,this.solved=!0,void this.updateStats("done");let t=e.nodes[0];this.currentGroupKey=e.groupKey,this.currentRootNodeId=t?t.capacityMeshNodeId:null;let n=function(r){if(!r.nodes[0])return{outputNodes:[],mergeEvents:[]};let{POSITIVE_INFINITY:i,POSITIVE_INFINITY:s,POSITIVE_INFINITY:a,POSITIVE_INFINITY:c}=Number;for(let p of r.nodes){i=Math.min(i,p.width),s=Math.min(s,p.height);let m=bm(p);a=Math.min(a,m.minX),c=Math.min(c,m.minY)}let l=new Map,h=[];for(let p of r.nodes){let m=bm(p),A=Math.round((m.minX-a)/i),g=Math.round((m.minY-c)/s),f=Math.max(1,Math.round(p.width/i)),y=Math.max(1,Math.round(p.height/s));for(let x=0;x<y;x+=1)for(let C=0;C<f;C+=1)l.set(`${A+C},${g+x}`,p);h.push({col:A,row:g})}h.sort((p,m)=>p.row-m.row||p.col-m.col);let d=new Set,u=[],_=[];for(let p of h){let m=`${p.col},${p.row}`;if(d.has(m))continue;let A=0;for(;;){let v=`${p.col+A},${p.row}`;if(!l.has(v))break;if(d.has(v))break;A+=1}let g=A,f=1,y=1,x=1;for(let v=1;;v+=1){let P=p.row+v-1,M=0;for(;M<g;){let B=`${p.col+M},${P}`;if(!l.has(B))break;if(d.has(B))break;M+=1}if(M===0)break;g=Math.min(g,M);for(let B=g;B>=1;B-=1){let T=B*i,N=v*s,D=Math.min(T,N);if((D<=0.000001?Number.POSITIVE_INFINITY:Math.max(T,N)/D)>4)continue;let L=B*v;L>x&&(x=L,f=B,y=v);break}}let C=new Map;for(let v=0;v<y;v+=1)for(let P=0;P<f;P+=1){let M=`${p.col+P},${p.row+v}`,B=l.get(M);B&&(d.add(M),C.set(B.capacityMeshNodeId,B))}let b=[...C.values()];if(b.length<=1){let v=b[0];v&&u.push(v);continue}let I=$qr(b);u.push(I),_.push({type:"merge",groupKey:r.groupKey,sourceNodes:b,mergedNode:I})}return{outputNodes:u,mergeEvents:_}}(e);this.mergedNodes.push(...n.outputNodes),this.processedGroupCount+=1,this.debugMergeEvents.push(...n.mergeEvents);let o=n.mergeEvents[n.mergeEvents.length-1];o&&(this.lastMergedNodeId=o.mergedNode.capacityMeshNodeId),this.updateStats(n.mergeEvents.length>0?"merged-group":"passthrough-group")}computeProgress(){return this.totalGroupCount===0?1:this.processedGroupCount/this.totalGroupCount}updateStats(e){let t=new Set(this.debugMergeEvents.map((o)=>o.groupKey)),n={lastAction:e,totalGroupCount:this.totalGroupCount,processedGroupCount:this.processedGroupCount,pendingGroupCount:this.pendingGroups.length,mergedNodeCount:this.mergedNodes.length,passthroughNodeCount:this.passthroughNodes.length,gapFillNodeCount:this.passthroughNodes.filter(hnt).length,preservedObstacleNodeCount:this.debugFilteredNodes.filter((o)=>o.type==="preserved-obstacle").length,preservedOverlapNodeCount:this.debugFilteredNodes.filter((o)=>o.type==="preserved-overlap").length,mergeCount:this.debugMergeEvents.length,mergedGroupCount:t.size,currentGroupKey:this.currentGroupKey,currentRootNodeId:this.currentRootNodeId,lastMergedNodeId:this.lastMergedNodeId};this.stats=n}getConstructorParams(){return[this.inputProblem]}getOutput(){return[...this.mergedNodes,...this.passthroughNodes]}visualize(){let e=this.getOutput(),t=this.currentRootNodeId?e.find((o)=>o.capacityMeshNodeId===this.currentRootNodeId)??null:null,n=this.lastMergedNodeId?e.find((o)=>o.capacityMeshNodeId===this.lastMergedNodeId)??null:null;return{rects:[...this.debugFilteredNodes.map((o)=>zhe(o.node,o.type==="preserved-obstacle"?"rgba(255,64,64,0.35)":"rgba(255,160,64,0.35)",o.reason)),...this.passthroughNodes.map((o)=>zhe(o,o._containsObstacle?"rgba(255,0,0,0.35)":hnt(o)?"rgba(0,120,255,0.18)":"rgba(160,160,160,0.12)")),...this.mergedNodes.map((o)=>zhe(o,"rgba(120,120,120,0.14)")),...t?[zhe(t,"rgba(255,215,0,0.35)","active-group")]:[],...n?[zhe(n,"rgba(0,200,120,0.28)","merged")]:[]]}}},Jqr=class extends IB{constructor(e){super(),this.inputProblem=e}inputProblem;obstacleQueue=[];obstacleQueueIndex=0;meshNodes=[];_setup(){this.obstacleQueue=this.inputProblem.obstacles,this.obstacleQueueIndex=0,this.meshNodes=[...this.inputProblem.meshNodes]}_step(){if(this.obstacleQueueIndex>=this.obstacleQueue.length)return void(this.solved=!0);let e=this.obstacleQueue[this.obstacleQueueIndex],t=e.layers.map((o)=>KS(o,this.inputProblem.layerCount)),n=[];for(let o of this.meshNodes){if(o._containsObstacle){n.push(o);continue}if(!t.some((i)=>o.availableZ.includes(i))){n.push(o);continue}if(!P7e(bm(o),bm(e))){n.push(o);continue}if(o.availableZ.length===1)continue;let r=o.availableZ.filter((i)=>!t.includes(i));for(let i of r){let s={...o,capacityMeshNodeId:`${o.capacityMeshNodeId}:z${i}`,availableZ:[i],layer:`z${i}`};n.push(s)}}this.meshNodes=n,this.obstacleQueueIndex+=1,this.stats={obstaclesProcessed:this.obstacleQueueIndex,obstacleCount:this.obstacleQueue.length,meshNodeCount:this.meshNodes.length}}computeProgress(){return this.obstacleQueue.length===0?1:this.obstacleQueueIndex/this.obstacleQueue.length}getConstructorParams(){return[this.inputProblem]}getOutput(){return this.meshNodes}visualize(){let e=this.obstacleQueueIndex<this.obstacleQueue.length?this.obstacleQueue[this.obstacleQueueIndex]??null:null,t=this.obstacleQueue.slice(0,this.obstacleQueueIndex),n=e?this.obstacleQueue.slice(this.obstacleQueueIndex+1):[];return{rects:[...t.map((o)=>({center:o.center,width:o.width,height:o.height,fill:"rgba(160,160,160,0.10)",stroke:"rgba(160,160,160,0.35)",label:`processed ${o.obstacleId??"obstacle"}`})),...e?[{center:e.center,width:e.width,height:e.height,fill:"rgba(255,140,0,0.22)",stroke:"rgba(255,140,0,0.75)",label:`active ${e.obstacleId??"obstacle"}`}]:[],...n.map((o)=>({center:o.center,width:o.width,height:o.height,fill:"rgba(255,0,0,0.05)",stroke:"rgba(255,0,0,0.22)",label:`pending ${o.obstacleId??"obstacle"}`})),...this.meshNodes.map((o)=>({...yB(o,{rectMargin:0.01}),fill:o._containsObstacle?"rgba(255,0,0,0.18)":"rgba(0,120,255,0.12)",stroke:o._containsObstacle?"rgba(255,0,0,0.45)":"rgba(0,120,255,0.45)"}))]}}};H7e.register(class extends pCn{constructor(e){super(e),this.inputProblem=e}inputProblem;static componentKind="bga";initialTopologySolver;removeMeshNodeOverlappingWithUnmarkedObstacle;gapfillDueToNodeRemoval;mergeMeshNodes;markedComponentObstacles=[];unmarkedComponentObstacles=[];pipelineDef=[kJ("initialTopologySolver",Xqr,(e)=>[{srj:e.inputProblem.inputSrj,componentBounds:e.inputProblem.detectedComponent.bounds,componentId:e.inputProblem.detectedComponent.componentId,markedComponentObstacles:e.markedComponentObstacles,unmarkedComponentObstacles:e.unmarkedComponentObstacles,viaDiameter:e.inputProblem.viaDiameter}]),kJ("removeMeshNodeOverlappingWithUnmarkedObstacle",Jqr,(e)=>[{meshNodes:e.initialTopologySolver.getOutput(),obstacles:e.unmarkedComponentObstacles,layerCount:e.inputProblem.inputSrj.layerCount}]),kJ("gapfillDueToNodeRemoval",Yqr,(e)=>[{meshNodes:e.removeMeshNodeOverlappingWithUnmarkedObstacle.getOutput(),unmarkedComponentObstacles:e.unmarkedComponentObstacles,layerCount:e.inputProblem.inputSrj.layerCount}]),kJ("mergeMeshNodes",qqr,(e)=>[{meshNodes:e.gapfillDueToNodeRemoval.getOutput(),layerCount:e.inputProblem.inputSrj.layerCount}])];_setup(){let e=this.inputProblem.detectedComponent.bounds,t=this.inputProblem.detectedComponent.componentId,n=[],o=[];for(let r of this.inputProblem.inputSrj.obstacles){let i=bm(r);P7e(e,i)&&(r.componentId!==t?o.push(r):n.push(r))}this.markedComponentObstacles=n,this.unmarkedComponentObstacles=o}getConstructorParams(){return[this.inputProblem]}getOutput(){return{routingRegions:this.mergeMeshNodes?.getOutput()??this.gapfillDueToNodeRemoval?.getOutput()??this.removeMeshNodeOverlappingWithUnmarkedObstacle?.getOutput()??[]}}initialVisualize(){return{rects:[{center:{x:(this.inputProblem.detectedComponent.bounds.minX+this.inputProblem.detectedComponent.bounds.maxX)/2,y:(this.inputProblem.detectedComponent.bounds.minY+this.inputProblem.detectedComponent.bounds.maxY)/2},width:this.inputProblem.detectedComponent.bounds.maxX-this.inputProblem.detectedComponent.bounds.minX,height:this.inputProblem.detectedComponent.bounds.maxY-this.inputProblem.detectedComponent.bounds.minY,fill:"rgba(0,0,0,0)",stroke:"rgba(30,30,30,0.65)",label:`bga ${this.inputProblem.detectedComponent.componentId}`},...this.markedComponentObstacles.map((e)=>({center:e.center,width:e.width,height:e.height,fill:"rgba(255,0,0,0.18)",stroke:"rgba(255,0,0,0.52)",label:`pad ${e.obstacleId??"obstacle"}`})),...this.unmarkedComponentObstacles.map((e)=>({center:e.center,width:e.width,height:e.height,fill:"rgba(255,140,0,0.14)",stroke:"rgba(255,140,0,0.42)",label:`foreign ${e.obstacleId??"obstacle"}`}))]}}finalVisualize(){return{rects:this.getOutput().routingRegions.map((e)=>({...yB(e,{rectMargin:0.01}),fill:e._containsObstacle?"rgba(255,0,0,0.16)":"rgba(0,120,255,0.12)",stroke:e._containsObstacle?"rgba(255,0,0,0.36)":"rgba(0,120,255,0.42)"}))}}});var p2n=0.000001;function F7e(e,t){return e.__zLayers&&e.__zLayers.length>0?gCn(e.__zLayers,t):VGr(e.layers,t)}function X9e(e){let t=[...e].sort((i,s)=>i-s),n=[];for(let i=1;i<t.length;i++){let s=t[i]-t[i-1];s>p2n&&n.push(s)}let o=n.length>0?Math.max(p2n,Math.min(...n)/4):0.001,r=[];for(let i of t){let s=r[r.length-1];(s===void 0||Math.abs(i-s)>o)&&r.push(i)}return r}function lat(e){return Array.from({length:Math.max(0,e)},(t,n)=>n)}var m2n=0.000001;function jvn(e){return e.maxX-e.minX>m2n&&e.maxY-e.minY>m2n}function _2n(e){return function(t){let n=Math.min(t.width,t.height),o=Math.max(t.width,t.height);return n<=0?0:o/n}(e)>=1.5}function Zqr(e,t){let n=[{side:"top",distance:Math.abs(e.center.y-t.minY)},{side:"right",distance:Math.abs(t.maxX-e.center.x)},{side:"bottom",distance:Math.abs(t.maxY-e.center.y)},{side:"left",distance:Math.abs(e.center.x-t.minX)}];return n.sort((o,r)=>o.distance-r.distance),n[0].side}function eJr(e,t){return e.map((n,o)=>({key:`pad:${n.obstacleId??o}`,bounds:cs(n),regionType:"pad",obstacleZ:F7e(n,t)}))}function tJr(e,t){return e.map((n,o)=>({key:`thermal-pad:${n.obstacleId??o}`,bounds:cs(n),regionType:"pad",obstacleZ:F7e(n,t)}))}function Kvn(e,t){return!!jvn(e)&&Math.min(e.maxX-e.minX,e.maxY-e.minY)<=t}function j9e({side:e,sideObstacles:t,bounds:n,innerBounds:o,narrowThreshold:r}){let i=[];for(let s=0;s<t.length-1;s++){let a=cs(t[s]),c=cs(t[s+1]),l;l=e==="top"?{minX:a.maxX,maxX:c.minX,minY:n.minY,maxY:o.minY}:e==="right"?{minX:o.maxX,maxX:n.maxX,minY:a.maxY,maxY:c.minY}:e==="bottom"?{minX:a.maxX,maxX:c.minX,minY:o.maxY,maxY:n.maxY}:{minX:n.minX,maxX:o.minX,minY:a.maxY,maxY:c.minY},i.push({key:`${e}-gap-${s}`,bounds:l,regionType:"pad-gap",isNarrowPadGap:Kvn(l,r)})}return i}function K9e({side:e,sideObstacles:t,thermalPadBounds:n,narrowThreshold:o}){let r=[];for(let i=0;i<t.length;i++){let s=cs(t[i]),a=t[i-1]?cs(t[i-1]):null,c=t[i+1]?cs(t[i+1]):null,l;l=e==="top"?{minX:a?(a.maxX+s.minX)/2:s.minX,maxX:c?(s.maxX+c.minX)/2:s.maxX,minY:s.maxY,maxY:n.minY}:e==="right"?{minX:n.maxX,maxX:s.minX,minY:a?(a.maxY+s.minY)/2:s.minY,maxY:c?(s.maxY+c.minY)/2:s.maxY}:e==="bottom"?{minX:a?(a.maxX+s.minX)/2:s.minX,maxX:c?(s.maxX+c.minX)/2:s.maxX,minY:n.maxY,maxY:s.minY}:{minX:s.maxX,maxX:n.minX,minY:a?(a.maxY+s.minY)/2:s.minY,maxY:c?(s.maxY+c.minY)/2:s.maxY},r.push({key:`inner-${e}-pad-${i}`,bounds:l,regionType:"pad-gap",isNarrowPadGap:Kvn(l,o)})}return r}function nJr({bounds:e,innerBounds:t,sideGroups:n}){let o=n.top[0]?cs(n.top[0]):null,r=n.top.at(-1)?cs(n.top.at(-1)):null,i=n.right[0]?cs(n.right[0]):null,s=n.right.at(-1)?cs(n.right.at(-1)):null,a=n.bottom[0]?cs(n.bottom[0]):null,c=n.bottom.at(-1)?cs(n.bottom.at(-1)):null,l=n.left[0]?cs(n.left[0]):null,h=n.left.at(-1)?cs(n.left.at(-1)):null;return[{key:"corner-nw-outer",regionType:"corner",bounds:{minX:e.minX,maxX:t.minX,minY:e.minY,maxY:t.minY}},{key:"corner-nw-top",regionType:"corner",bounds:{minX:t.minX,maxX:o?.minX??t.minX,minY:e.minY,maxY:t.minY}},{key:"corner-nw-left",regionType:"corner",bounds:{minX:e.minX,maxX:t.minX,minY:t.minY,maxY:l?.minY??t.minY}},{key:"corner-ne-outer",regionType:"corner",bounds:{minX:t.maxX,maxX:e.maxX,minY:e.minY,maxY:t.minY}},{key:"corner-ne-top",regionType:"corner",bounds:{minX:r?.maxX??t.maxX,maxX:t.maxX,minY:e.minY,maxY:t.minY}},{key:"corner-ne-right",regionType:"corner",bounds:{minX:t.maxX,maxX:e.maxX,minY:t.minY,maxY:i?.minY??t.minY}},{key:"corner-se-outer",regionType:"corner",bounds:{minX:t.maxX,maxX:e.maxX,minY:t.maxY,maxY:e.maxY}},{key:"corner-se-right",regionType:"corner",bounds:{minX:t.maxX,maxX:e.maxX,minY:s?.maxY??t.maxY,maxY:t.maxY}},{key:"corner-se-bottom",regionType:"corner",bounds:{minX:c?.maxX??t.maxX,maxX:t.maxX,minY:t.maxY,maxY:e.maxY}},{key:"corner-sw-outer",regionType:"corner",bounds:{minX:e.minX,maxX:t.minX,minY:t.maxY,maxY:e.maxY}},{key:"corner-sw-bottom",regionType:"corner",bounds:{minX:t.minX,maxX:a?.minX??t.minX,minY:t.maxY,maxY:e.maxY}},{key:"corner-sw-left",regionType:"corner",bounds:{minX:e.minX,maxX:t.minX,minY:h?.maxY??t.maxY,maxY:t.maxY}}]}function oJr({innerBounds:e,thermalPadBounds:t,sideGroups:n}){let o=n.top[0]?cs(n.top[0]):null,r=n.top.at(-1)?cs(n.top.at(-1)):null,i=n.right[0]?cs(n.right[0]):null,s=n.right.at(-1)?cs(n.right.at(-1)):null,a=n.bottom[0]?cs(n.bottom[0]):null,c=n.bottom.at(-1)?cs(n.bottom.at(-1)):null,l=n.left[0]?cs(n.left[0]):null,h=n.left.at(-1)?cs(n.left.at(-1)):null;return[{key:"inner-corner-nw-core",regionType:"corner",bounds:{minX:e.minX,maxX:t.minX,minY:e.minY,maxY:t.minY}},{key:"inner-corner-nw-top",regionType:"corner",bounds:{minX:t.minX,maxX:o?.minX??t.minX,minY:e.minY,maxY:t.minY}},{key:"inner-corner-nw-left",regionType:"corner",bounds:{minX:e.minX,maxX:t.minX,minY:t.minY,maxY:l?.minY??t.minY}},{key:"inner-corner-ne-core",regionType:"corner",bounds:{minX:t.maxX,maxX:e.maxX,minY:e.minY,maxY:t.minY}},{key:"inner-corner-ne-top",regionType:"corner",bounds:{minX:r?.maxX??t.maxX,maxX:t.maxX,minY:e.minY,maxY:t.minY}},{key:"inner-corner-ne-right",regionType:"corner",bounds:{minX:t.maxX,maxX:e.maxX,minY:t.minY,maxY:i?.minY??t.minY}},{key:"inner-corner-se-core",regionType:"corner",bounds:{minX:t.maxX,maxX:e.maxX,minY:t.maxY,maxY:e.maxY}},{key:"inner-corner-se-right",regionType:"corner",bounds:{minX:t.maxX,maxX:e.maxX,minY:s?.maxY??t.maxY,maxY:t.maxY}},{key:"inner-corner-se-bottom",regionType:"corner",bounds:{minX:c?.maxX??t.maxX,maxX:t.maxX,minY:t.maxY,maxY:e.maxY}},{key:"inner-corner-sw-core",regionType:"corner",bounds:{minX:e.minX,maxX:t.minX,minY:t.maxY,maxY:e.maxY}},{key:"inner-corner-sw-bottom",regionType:"corner",bounds:{minX:t.minX,maxX:a?.minX??t.minX,minY:t.maxY,maxY:e.maxY}},{key:"inner-corner-sw-left",regionType:"corner",bounds:{minX:e.minX,maxX:t.minX,minY:h?.maxY??t.maxY,maxY:t.maxY}}]}H7e.register(class extends IB{constructor(e){super(),this.inputProblem=e}inputProblem;static componentKind="qfp_thermalpad";output=null;getConstructorParams(){return[this.inputProblem]}_step(){if(this.output)return void(this.solved=!0);let{layerCount:e,obstacles:t}=this.inputProblem.inputSrj,{bounds:n,componentId:o}=this.inputProblem.detectedComponent,r=lat(e),i=t.filter((f)=>f.componentId===o),s=i.length>0?i:t,{padRingObstacles:a,thermalPadObstacles:c}=function(f){return{padRingObstacles:f.filter(_2n),thermalPadObstacles:f.filter((y)=>!_2n(y))}}(s),l=function(f,y){let x={top:[],right:[],bottom:[],left:[]};for(let C of f)x[Zqr(C,y)].push(C);return x.top.sort((C,b)=>C.center.x-b.center.x),x.bottom.sort((C,b)=>C.center.x-b.center.x),x.left.sort((C,b)=>C.center.y-b.center.y),x.right.sort((C,b)=>C.center.y-b.center.y),x}(a,n),h=function({bounds:f,sideGroups:y}){return{minX:y.left.length>0?Math.max(...y.left.map((x)=>cs(x).maxX)):f.minX,maxX:y.right.length>0?Math.min(...y.right.map((x)=>cs(x).minX)):f.maxX,minY:y.top.length>0?Math.max(...y.top.map((x)=>cs(x).maxY)):f.minY,maxY:y.bottom.length>0?Math.min(...y.bottom.map((x)=>cs(x).minY)):f.maxY}}({bounds:n,sideGroups:l}),d=function(f){return f.length===0?null:f.reduce((y,x)=>{let C=cs(x);return{minX:Math.min(y.minX,C.minX),maxX:Math.max(y.maxX,C.maxX),minY:Math.min(y.minY,C.minY),maxY:Math.max(y.maxY,C.maxY)}},cs(f[0]))}(c);if(!d)return this.failed=!0,void(this.error="QfpThermalPadTopologyGeneratorSolver requires a thermal pad");let u=o,_=this.inputProblem.viaDiameter??E7e(this.inputProblem.inputSrj).padDiameter,p=this.inputProblem.obstacleMargin??this.inputProblem.inputSrj.defaultObstacleMargin??0.15,m=_+2*p,A=this.inputProblem.inputSrj.minTraceWidth+2*p,g=[...eJr(a,e),...tJr(c,e),...j9e({side:"top",sideObstacles:l.top,bounds:n,innerBounds:h,narrowThreshold:A}),...j9e({side:"right",sideObstacles:l.right,bounds:n,innerBounds:h,narrowThreshold:A}),...j9e({side:"bottom",sideObstacles:l.bottom,bounds:n,innerBounds:h,narrowThreshold:A}),...j9e({side:"left",sideObstacles:l.left,bounds:n,innerBounds:h,narrowThreshold:A}),...K9e({side:"top",sideObstacles:l.top,thermalPadBounds:d,narrowThreshold:A}),...K9e({side:"right",sideObstacles:l.right,thermalPadBounds:d,narrowThreshold:A}),...K9e({side:"bottom",sideObstacles:l.bottom,thermalPadBounds:d,narrowThreshold:A}),...K9e({side:"left",sideObstacles:l.left,thermalPadBounds:d,narrowThreshold:A}),...oJr({innerBounds:h,thermalPadBounds:d,sideGroups:l}),...nJr({bounds:n,innerBounds:h,sideGroups:l})].flatMap((f)=>function({nodeId:y,bounds:x,availableZ:C,multiLayerThreshold:b,regionType:I,isNarrowPadGap:v=!1,obstacleZ:P=[]}){if(!jvn(x))return[];let M=function(N){return{center:{x:(N.minX+N.maxX)/2,y:(N.minY+N.maxY)/2},width:N.maxX-N.minX,height:N.maxY-N.minY}}(x),B=Math.min(M.width,M.height)>b,T=B?[{availableZ:C.filter((N)=>!P.includes(N)),containsObstacle:!1},{availableZ:C.filter((N)=>P.includes(N)),containsObstacle:!0}].filter((N)=>N.availableZ.length>0):C.map((N)=>({availableZ:[N],containsObstacle:P.includes(N)}));return T.map((N)=>({capacityMeshNodeId:T.length===1?y:B?`${y}:${N.containsObstacle?"obstacle":"free"}`:`${y}:z${N.availableZ[0]}`,center:M.center,width:M.width,height:M.height,layer:`z${N.availableZ.join(",")}`,availableZ:N.availableZ,_qfpRegionType:I,_isNarrowQfpPadGap:v,_containsObstacle:N.containsObstacle}))}({nodeId:`qfp_thermalpad:${u}:${f.key}`,bounds:f.bounds,availableZ:r,multiLayerThreshold:m,regionType:f.regionType,isNarrowPadGap:f.isNarrowPadGap,obstacleZ:f.obstacleZ}));this.output={routingRegions:g},this.stats={componentId:o,layerCount:e,viaDiameter:_,obstacleMargin:p,multiLayerThreshold:m,narrowPadGapThreshold:A,thermalPadCount:c.length,perimeterPadCount:a.length,innerCornerRectCount:g.filter((f)=>f.capacityMeshNodeId.includes(":inner-corner-")).length,narrowPadGapNodeCount:g.filter((f)=>f._isNarrowQfpPadGap).length,topPadCount:l.top.length,rightPadCount:l.right.length,bottomPadCount:l.bottom.length,leftPadCount:l.left.length,multiLayerNodeCount:g.filter((f)=>f.availableZ.length>1).length,totalMeshNodeCount:g.length},this.solved=!0}getOutput(){if(!this.output)throw Error("QfpThermalPadTopologyGeneratorSolver has not solved yet");return this.output}});var g2n=0.000001;function $vn(e){return e.maxX-e.minX>g2n&&e.maxY-e.minY>g2n}function rJr(e,t){let n=[{side:"top",distance:Math.abs(e.center.y-t.minY)},{side:"right",distance:Math.abs(t.maxX-e.center.x)},{side:"bottom",distance:Math.abs(t.maxY-e.center.y)},{side:"left",distance:Math.abs(e.center.x-t.minX)}];return n.sort((o,r)=>o.distance-r.distance),n[0].side}function iJr(e,t){return e.map((n,o)=>({key:`pad:${n.obstacleId??o}`,bounds:cs(n),regionType:"pad",obstacleZ:F7e(n,t),connectedTo:[...n.connectedTo]}))}function sJr(e,t){return!!$vn(e)&&Math.min(e.maxX-e.minX,e.maxY-e.minY)<=t}function $9e({side:e,sideObstacles:t,bounds:n,centralBounds:o,narrowThreshold:r}){let i=[];for(let s=0;s<t.length-1;s++){let a=cs(t[s]),c=cs(t[s+1]),l;l=e==="top"?{minX:a.maxX,maxX:c.minX,minY:n.minY,maxY:o.minY}:e==="right"?{minX:o.maxX,maxX:n.maxX,minY:a.maxY,maxY:c.minY}:e==="bottom"?{minX:a.maxX,maxX:c.minX,minY:o.maxY,maxY:n.maxY}:{minX:n.minX,maxX:o.minX,minY:a.maxY,maxY:c.minY},i.push({key:`${e}-gap-${s}`,bounds:l,regionType:"pad-gap",isNarrowPadGap:sJr(l,r)})}return i}function aJr({bounds:e,centralBounds:t,sideGroups:n}){let o=n.top[0]?cs(n.top[0]):null,r=n.top.at(-1)?cs(n.top.at(-1)):null,i=n.right[0]?cs(n.right[0]):null,s=n.right.at(-1)?cs(n.right.at(-1)):null,a=n.bottom[0]?cs(n.bottom[0]):null,c=n.bottom.at(-1)?cs(n.bottom.at(-1)):null,l=n.left[0]?cs(n.left[0]):null,h=n.left.at(-1)?cs(n.left.at(-1)):null;return[{key:"corner-nw-outer",regionType:"corner",bounds:{minX:e.minX,maxX:t.minX,minY:e.minY,maxY:t.minY}},{key:"corner-nw-top",regionType:"corner",bounds:{minX:t.minX,maxX:o?.minX??t.minX,minY:e.minY,maxY:t.minY}},{key:"corner-nw-left",regionType:"corner",bounds:{minX:e.minX,maxX:t.minX,minY:t.minY,maxY:l?.minY??t.minY}},{key:"corner-ne-outer",regionType:"corner",bounds:{minX:t.maxX,maxX:e.maxX,minY:e.minY,maxY:t.minY}},{key:"corner-ne-top",regionType:"corner",bounds:{minX:r?.maxX??t.maxX,maxX:t.maxX,minY:e.minY,maxY:t.minY}},{key:"corner-ne-right",regionType:"corner",bounds:{minX:t.maxX,maxX:e.maxX,minY:t.minY,maxY:i?.minY??t.minY}},{key:"corner-se-outer",regionType:"corner",bounds:{minX:t.maxX,maxX:e.maxX,minY:t.maxY,maxY:e.maxY}},{key:"corner-se-right",regionType:"corner",bounds:{minX:t.maxX,maxX:e.maxX,minY:s?.maxY??t.maxY,maxY:t.maxY}},{key:"corner-se-bottom",regionType:"corner",bounds:{minX:c?.maxX??t.maxX,maxX:t.maxX,minY:t.maxY,maxY:e.maxY}},{key:"corner-sw-outer",regionType:"corner",bounds:{minX:e.minX,maxX:t.minX,minY:t.maxY,maxY:e.maxY}},{key:"corner-sw-bottom",regionType:"corner",bounds:{minX:t.minX,maxX:a?.minX??t.minX,minY:t.maxY,maxY:e.maxY}},{key:"corner-sw-left",regionType:"corner",bounds:{minX:e.minX,maxX:t.minX,minY:h?.maxY??t.maxY,maxY:t.maxY}}]}H7e.register(class extends IB{constructor(e){super(),this.inputProblem=e}inputProblem;static componentKind="qfp";output=null;getConstructorParams(){return[this.inputProblem]}_step(){if(this.output)return void(this.solved=!0);let{layerCount:e,obstacles:t}=this.inputProblem.inputSrj,{bounds:n,componentId:o}=this.inputProblem.detectedComponent,r=lat(e),i=t.filter((m)=>m.componentId===o),s=i.length>0?i:t,a=function(m,A){let g={top:[],right:[],bottom:[],left:[]};for(let f of m)g[rJr(f,A)].push(f);return g.top.sort((f,y)=>f.center.x-y.center.x),g.bottom.sort((f,y)=>f.center.x-y.center.x),g.left.sort((f,y)=>f.center.y-y.center.y),g.right.sort((f,y)=>f.center.y-y.center.y),g}(s,n),c=function({bounds:m,sideGroups:A}){return{minX:A.left.length>0?Math.max(...A.left.map((g)=>cs(g).maxX)):m.minX,maxX:A.right.length>0?Math.min(...A.right.map((g)=>cs(g).minX)):m.maxX,minY:A.top.length>0?Math.max(...A.top.map((g)=>cs(g).maxY)):m.minY,maxY:A.bottom.length>0?Math.min(...A.bottom.map((g)=>cs(g).minY)):m.maxY}}({bounds:n,sideGroups:a}),l=o,h=this.inputProblem.viaDiameter??E7e(this.inputProblem.inputSrj).padDiameter,d=this.inputProblem.obstacleMargin??this.inputProblem.inputSrj.defaultObstacleMargin??0.15,u=h+2*d,_=this.inputProblem.inputSrj.minTraceWidth+2*d,p=[{key:"center",bounds:c,regionType:"center"},...iJr(s,e),...$9e({side:"top",sideObstacles:a.top,bounds:n,centralBounds:c,narrowThreshold:_}),...$9e({side:"right",sideObstacles:a.right,bounds:n,centralBounds:c,narrowThreshold:_}),...$9e({side:"bottom",sideObstacles:a.bottom,bounds:n,centralBounds:c,narrowThreshold:_}),...$9e({side:"left",sideObstacles:a.left,bounds:n,centralBounds:c,narrowThreshold:_}),...aJr({bounds:n,centralBounds:c,sideGroups:a})].flatMap((m)=>function({nodeId:A,bounds:g,availableZ:f,multiLayerThreshold:y,regionType:x,isNarrowPadGap:C=!1,obstacleZ:b=[],connectedTo:I}){if(!$vn(g))return[];let v=function(B){return{center:{x:(B.minX+B.maxX)/2,y:(B.minY+B.maxY)/2},width:B.maxX-B.minX,height:B.maxY-B.minY}}(g),P=Math.min(v.width,v.height)>y,M=P?[{availableZ:f.filter((B)=>!b.includes(B)),containsObstacle:!1},{availableZ:f.filter((B)=>b.includes(B)),containsObstacle:!0}].filter((B)=>B.availableZ.length>0):f.map((B)=>({availableZ:[B],containsObstacle:b.includes(B)}));return M.map((B)=>({capacityMeshNodeId:M.length===1?A:P?`${A}:${B.containsObstacle?"obstacle":"free"}`:`${A}:z${B.availableZ[0]}`,center:v.center,width:v.width,height:v.height,layer:`z${B.availableZ.join(",")}`,availableZ:B.availableZ,_qfpRegionType:x,_isNarrowQfpPadGap:C,_containsObstacle:B.containsObstacle,_connectedTo:B.containsObstacle?I:void 0}))}({nodeId:`qfp:${l}:${m.key}`,bounds:m.bounds,availableZ:r,multiLayerThreshold:u,regionType:m.regionType,isNarrowPadGap:m.isNarrowPadGap,obstacleZ:m.obstacleZ,connectedTo:m.connectedTo}));this.output={routingRegions:p},this.stats={componentId:o,layerCount:e,viaDiameter:h,obstacleMargin:d,multiLayerThreshold:u,narrowPadGapThreshold:_,narrowPadGapNodeCount:p.filter((m)=>m._isNarrowQfpPadGap).length,topPadCount:a.top.length,rightPadCount:a.right.length,bottomPadCount:a.bottom.length,leftPadCount:a.left.length,multiLayerNodeCount:p.filter((m)=>m.availableZ.length>1).length,totalMeshNodeCount:p.length},this.solved=!0}getOutput(){if(!this.output)throw Error("QfpTopologyGeneratorSolver has not solved yet");return this.output}});var A2n=0.000001;function cJr({nodeId:e,bounds:t,availableZ:n,multiLayerThreshold:o,regionType:r,obstacleZ:i=[],connectedTo:s}){if(!function(h){return h.maxX-h.minX>A2n&&h.maxY-h.minY>A2n}(t))return[];let a=function(h){return{center:{x:(h.minX+h.maxX)/2,y:(h.minY+h.maxY)/2},width:h.maxX-h.minX,height:h.maxY-h.minY}}(t),c=Math.min(a.width,a.height)>o,l=c?[{availableZ:n.filter((h)=>!i.includes(h)),containsObstacle:!1},{availableZ:n.filter((h)=>i.includes(h)),containsObstacle:!0}].filter((h)=>h.availableZ.length>0):n.map((h)=>({availableZ:[h],containsObstacle:i.includes(h)}));return l.map((h)=>({capacityMeshNodeId:l.length===1?e:c?`${e}:${h.containsObstacle?"obstacle":"free"}`:`${e}:z${h.availableZ[0]}`,center:a.center,width:a.width,height:a.height,layer:`z${h.availableZ.join(",")}`,availableZ:h.availableZ,_soicRegionType:r,_containsObstacle:h.containsObstacle,_connectedTo:h.containsObstacle?s:void 0}))}function f2n(e,t){let n=0,o=Number.POSITIVE_INFINITY;for(let r=0;r<t.length;r++){let i=Math.abs(e-t[r]);i<o&&(n=r,o=i)}return n}function lJr(e,t){return e.map((n,o)=>({key:`pad:${n.obstacleId??o}`,bounds:cs(n),regionType:"pad",obstacleZ:F7e(n,t),connectedTo:[...n.connectedTo]}))}H7e.register(class extends IB{constructor(e){super(),this.inputProblem=e}inputProblem;static componentKind="soic";output=null;getConstructorParams(){return[this.inputProblem]}_step(){if(this.output)return void(this.solved=!0);let{layerCount:e,obstacles:t}=this.inputProblem.inputSrj,{bounds:n,componentId:o}=this.inputProblem.detectedComponent,r=lat(e),i=t.filter((g)=>g.componentId===o),s=i.length>0?i:t,a=function(g){let f=X9e(g.map((y)=>y.center.y)).length;return X9e(g.map((y)=>y.center.x)).length===2&&f!==2?"vertical-columns":"horizontal-rows"}(s),c=function({obstacles:g,orientation:f}){let y={left:[],right:[],top:[],bottom:[]};if(f==="vertical-columns"){let C=X9e(g.map((b)=>b.center.x));for(let b of g)y[f2n(b.center.x,C)===0?"left":"right"].push(b);return y.left.sort((b,I)=>b.center.y-I.center.y),y.right.sort((b,I)=>b.center.y-I.center.y),y}let x=X9e(g.map((C)=>C.center.y));for(let C of g)y[f2n(C.center.y,x)===0?"top":"bottom"].push(C);return y.top.sort((C,b)=>C.center.x-b.center.x),y.bottom.sort((C,b)=>C.center.x-b.center.x),y}({obstacles:s,orientation:a}),l=function({bounds:g,orientation:f,sideGroups:y}){return f==="vertical-columns"?{minX:Math.max(...y.left.map((x)=>cs(x).maxX)),maxX:Math.min(...y.right.map((x)=>cs(x).minX)),minY:g.minY,maxY:g.maxY}:{minX:g.minX,maxX:g.maxX,minY:Math.max(...y.top.map((x)=>cs(x).maxY)),maxY:Math.min(...y.bottom.map((x)=>cs(x).minY))}}({bounds:n,orientation:a,sideGroups:c}),h=o,d=this.inputProblem.viaDiameter??E7e(this.inputProblem.inputSrj).padDiameter,u=this.inputProblem.obstacleMargin??this.inputProblem.inputSrj.defaultObstacleMargin??0.15,_=2*(d+u),p=a==="vertical-columns"?["left","right"]:["top","bottom"],m=[{key:"center",bounds:l,regionType:"center"},...lJr(s,e),...p.flatMap((g)=>function({side:f,sideObstacles:y,bounds:x,centralBounds:C}){let b=[];for(let I=0;I<y.length-1;I++){let v=cs(y[I]),P=cs(y[I+1]),M;M=f==="left"?{minX:x.minX,maxX:C.minX,minY:v.maxY,maxY:P.minY}:f==="right"?{minX:C.maxX,maxX:x.maxX,minY:v.maxY,maxY:P.minY}:f==="top"?{minX:v.maxX,maxX:P.minX,minY:x.minY,maxY:C.minY}:{minX:v.maxX,maxX:P.minX,minY:C.maxY,maxY:x.maxY},b.push({key:`${f}-gap-${I}`,bounds:M,regionType:"pad-gap"})}return b}({side:g,sideObstacles:c[g],bounds:n,centralBounds:l}))],A=m.flatMap((g)=>cJr({nodeId:`soic:${h}:${g.key}`,bounds:g.bounds,availableZ:r,multiLayerThreshold:_,regionType:g.regionType,obstacleZ:g.obstacleZ,connectedTo:g.connectedTo}));this.output={routingRegions:A},this.stats={componentId:o,layerCount:e,orientation:a,viaDiameter:d,obstacleMargin:u,multiLayerThreshold:_,firstSidePadCount:c[p[0]].length,secondSidePadCount:c[p[1]].length,multiLayerNodeCount:A.filter((g)=>g.availableZ.length>1).length,totalMeshNodeCount:A.length},this.solved=!0}getOutput(){if(!this.output)throw Error("SoicTopologyGeneratorSolver has not solved yet");return this.output}});var cjs=IZ(D3n(),1),hJr=new Set(["left","right","top","bottom","top-left","top-right","bottom-left","bottom-right"]),dJr=new Set(["left","right","top","bottom"]),uJr={top_left:{direction:"up",preferredExit:"top-left",exitEdge:"top"},top_middle:{direction:"up",preferredExit:"top",exitEdge:"top"},top_right:{direction:"up",preferredExit:"top-right",exitEdge:"top"},right_top:{direction:"right",preferredExit:"top-right",exitEdge:"right"},right_middle:{direction:"right",preferredExit:"right",exitEdge:"right"},right_bottom:{direction:"right",preferredExit:"bottom-right",exitEdge:"right"},bottom_right:{direction:"down",preferredExit:"bottom-right",exitEdge:"bottom"},bottom_middle:{direction:"down",preferredExit:"bottom",exitEdge:"bottom"},bottom_left:{direction:"down",preferredExit:"bottom-left",exitEdge:"bottom"},left_bottom:{direction:"left",preferredExit:"bottom-left",exitEdge:"left"},left_middle:{direction:"left",preferredExit:"left",exitEdge:"left"},left_top:{direction:"left",preferredExit:"top-left",exitEdge:"left"},top:{direction:"up",preferredExit:"top",exitEdge:"top"},right:{direction:"right",preferredExit:"right",exitEdge:"right"},bottom:{direction:"down",preferredExit:"bottom",exitEdge:"bottom"},left:{direction:"left",preferredExit:"left",exitEdge:"left"}};function y2n(e){let t=[...e].sort((o,r)=>o-r),n=[];for(let o of t)if(n.length===0||Math.abs(n[n.length-1]-o)>0.000001)n.push(o);return n}function x2n(e){let t=Number.POSITIVE_INFINITY;for(let n=1;n<e.length;n++){let o=e[n]-e[n-1];if(o>0.000001)t=Math.min(t,o)}return t}function C2n(e,t){let n=t==="x"?"y":"x",o=Number.POSITIVE_INFINITY;for(let r=0;r<e.length;r++){let i=e[r];for(let s=r+1;s<e.length;s++){let a=e[s];if(Math.abs(i.center[n]-a.center[n])>0.000001)continue;let c=Math.abs(i.center[t]-a.center[t]);if(c>0.000001)o=Math.min(o,c)}}return o}function pJr(e){return{minX:Math.min(...e.map((t)=>t.center.x-t.width/2)),maxX:Math.max(...e.map((t)=>t.center.x+t.width/2)),minY:Math.min(...e.map((t)=>t.center.y-t.height/2)),maxY:Math.max(...e.map((t)=>t.center.y+t.height/2))}}function qvn(e,t){let n=t.componentBounds?.[e.componentId];if(!n){let r=e.pitchX*2.25,i=e.pitchY*2.25;return{minX:e.bounds.minX-r,maxX:e.bounds.maxX+r,minY:e.bounds.minY-i,maxY:e.bounds.maxY+i}}if([n.minX,n.maxX,n.minY,n.maxY].some((r)=>!Number.isFinite(r))||n.minX>=n.maxX||n.minY>=n.maxY)throw Error(`FanoutSolver: componentBounds for "${e.componentId}" must contain finite, increasing bounds`);if(n.minX>e.bounds.minX+0.000001||n.maxX<e.bounds.maxX-0.000001||n.minY>e.bounds.minY+0.000001||n.maxY<e.bounds.maxY-0.000001)throw Error(`FanoutSolver: componentBounds for "${e.componentId}" must contain every component pad`);return{...n}}function b2n(e,t){if([e.minX,e.maxX,e.minY,e.maxY].some((o)=>!Number.isFinite(o))||e.minX>=e.maxX||e.minY>=e.maxY)throw Error("FanoutSolver: sharedBoundary must contain finite, increasing bounds");for(let o of t)if(e.minX>o.bounds.minX+0.000001||e.maxX<o.bounds.maxX-0.000001||e.minY>o.bounds.minY+0.000001||e.maxY<o.bounds.maxY-0.000001)throw Error(`FanoutSolver: sharedBoundary must contain every pad of component "${o.componentId}"`);return{...e}}function mJr(e,t){if(t.sharedBoundary)return b2n(t.sharedBoundary,e);let n=e.map((i)=>qvn(i,t)),r=Math.max(...e.flatMap((i)=>[i.pitchX,i.pitchY]))*2.25;return b2n({minX:Math.min(...n.map((i)=>i.minX))-r,maxX:Math.max(...n.map((i)=>i.maxX))+r,minY:Math.min(...n.map((i)=>i.minY))-r,maxY:Math.max(...n.map((i)=>i.maxY))+r},e)}function _Jr(e){let t=new Map;for(let o of e){if(!o.componentId||o.isCopperPour)continue;let r=t.get(o.componentId)??[];r.push(o),t.set(o.componentId,r)}let n=[];for(let[o,r]of t){let i=y2n(r.map((A)=>A.center.x)),s=y2n(r.map((A)=>A.center.y)),a=C2n(r,"x"),c=C2n(r,"y"),l=x2n(i),h=x2n(s),d=Math.min(...[a,c,l,h].filter(Number.isFinite)),u=Math.max(...r.flatMap((A)=>[A.width,A.height])),_=Number.isFinite(d)?d:u,p=Number.isFinite(a)?a:Number.isFinite(l)?l:_,m=Number.isFinite(c)?c:Number.isFinite(h)?h:_;n.push({componentId:o,obstacles:r,xCoordinates:i,yCoordinates:s,pitchX:p,pitchY:m,bounds:pJr(r)})}return n}function Jvn(e){return"layer"in e?[e.layer]:e.layers}function Zvn(e){let{point:t,connection:n,componentGrids:o}=e,r=Jvn(t),i=[];for(let s of o){let a=s.obstacles.filter((c)=>c.layers.some((l)=>r.includes(l))).filter((c)=>QYr(t,c,0.00001)).sort((c,l)=>{let h=c.connectedTo.includes(n.name)||c.connectedTo.includes(t.pointId??"")||c.connectedTo.includes(t.pcb_port_id??""),d=l.connectedTo.includes(n.name)||l.connectedTo.includes(t.pointId??"")||l.connectedTo.includes(t.pcb_port_id??"");if(h!==d)return h?-1:1;return c.width*c.height-l.width*l.height});if(a[0])i.push({grid:s,obstacle:a[0]})}return i}function gJr(e){for(let n of e.pointsToConnect)if("layers"in n&&n.busId)return n.busId;return/^BUS[_:-]([^_:-]+)(?:[_:-]\d+)?$/i.exec(e.name)?.[1]??null}function Sde(e,t){if(t===void 0)return;if(!hJr.has(t))throw Error(`FanoutSolver: bus "${e}" has invalid preferredExit "${t}"`);return t}function AJr(e,t){if(t===void 0)return;if(!dJr.has(t))throw Error(`FanoutSolver: bus "${e}" has invalid exitEdge "${t}"`);return t}function fJr(e,t){if(t===void 0)return;try{return zYr(t)}catch{throw Error(`FanoutSolver: bus "${e}" has invalid exitPosition "${t}"`)}}function dnt(e){let{busId:t,exitPosition:n,fieldName:o,expected:r,actual:i,sourceName:s}=e;if(i===void 0||i===r)return;throw Error(`FanoutSolver: bus "${t}" exitPosition "${n}" conflicts with ${s} ${o} "${i}"`)}function yJr(e){let{busId:t,requestedBus:n,options:o}=e,r=n.exitPosition,i=fJr(t,r),s=Sde(t,n.preferredExit),a=Sde(t,o.busExitPreferences?.[t]),c=AJr(t,n.exitEdge);if(i&&r){for(let[d,u]of[[n.direction,"bus"],[o.busDirections?.[t],"busDirections"]])dnt({busId:t,exitPosition:r,fieldName:"direction",expected:i.direction,actual:d,sourceName:u});for(let[d,u]of[[s,"bus"],[a,"busExitPreferences"]])dnt({busId:t,exitPosition:r,fieldName:"preferredExit",expected:i.preferredExit,actual:d,sourceName:u});return dnt({busId:t,exitPosition:r,fieldName:"exitEdge",expected:i.exitEdge,actual:c,sourceName:"bus"}),{exitPosition:r,...i.direction?{direction:i.direction}:{},...i.preferredExit?{preferredExit:i.preferredExit}:{},...i.exitEdge?{exitEdge:i.exitEdge}:{}}}let l=o.busDirections?.[t]??n.direction??o.defaultDirection,h=Sde(t,a??s??o.defaultPreferredExit);return{...l?{direction:l}:{},...h?{preferredExit:h}:{},...c?{exitEdge:c}:{}}}function xJr(e,t){if(t===void 0)return;if(t.length===0)throw Error(`FanoutSolver: bus "${e}" must allow at least one layer`);for(let n of t)if(typeof n!=="string"||n.length===0)throw Error(`FanoutSolver: bus "${e}" has an invalid allowed layer`);return[...new Set(t)]}function CJr(e,t){if(t===void 0)return;if(!Number.isFinite(t)||t<0)throw Error(`FanoutSolver: bus "${e}" maxLengthSkew must be a finite non-negative number`);return t}function bJr(e){if(e===void 0)return;if(e.length===0)throw Error("FanoutSolver: availableCornersAndSides must contain at least one boundary region");let t=[],n=new Set;for(let o of e){let r=uJr[o];if(!r)throw Error(`FanoutSolver: invalid availableCornersAndSides value "${o}"`);let i=`${r.exitEdge}:${r.direction}:${r.preferredExit}`;if(n.has(i))continue;n.add(i),t.push(r)}return t}function IJr(e,t){if(t===void 0||t.type==="boundary")return{type:"boundary"};if(t.type!=="plane"||typeof t.layer!=="string"||t.layer.length===0)throw Error(`FanoutSolver: bus "${e}" has an invalid termination target`);return{type:"plane",layer:t.layer}}function vJr(e,t){let n=t.buses??e.buses,o=new Map,r=new Set,i=new Set(e.connections.map((s)=>s.name));for(let s of n??[]){if(o.has(s.busId))throw Error(`FanoutSolver: duplicate bus id "${s.busId}"`);for(let d of s.connectionNames){if(!i.has(d))throw Error(`FanoutSolver: bus "${s.busId}" references unknown connection "${d}"`);if(r.has(d))throw Error(`FanoutSolver: connection "${d}" belongs to more than one bus`);r.add(d)}let a=IJr(s.busId,s.termination),c=yJr({busId:s.busId,requestedBus:s,options:t}),l=xJr(s.busId,s.allowedLayers),h=CJr(s.busId,s.maxLengthSkew);if(a.type==="plane"&&h!==void 0)throw Error(`FanoutSolver: plane-terminated bus "${s.busId}" cannot specify maxLengthSkew`);if(a.type==="plane"&&c.preferredExit!==void 0)throw Error(`FanoutSolver: plane-terminated bus "${s.busId}" cannot also specify preferredExit`);o.set(s.busId,{...s,sourceComponentId:s.sourceComponentId??t.sourceComponentId,...c,...l===void 0?{}:{allowedLayers:l},...h===void 0?{}:{maxLengthSkew:h},termination:a})}for(let s of e.connections){if(r.has(s.name))continue;let a=gJr(s);if(a){let c=o.get(a);if(c)o.set(a,{...c,connectionNames:[...c.connectionNames,s.name]});else o.set(a,{busId:a,connectionNames:[s.name],direction:t.busDirections?.[a]??t.defaultDirection,sourceComponentId:t.sourceComponentId,preferredExit:Sde(a,t.busExitPreferences?.[a]??t.defaultPreferredExit),termination:{type:"boundary"}})}else{let c=`connection:${s.name}`;o.set(c,{busId:c,connectionNames:[s.name],sourceComponentId:t.sourceComponentId,direction:t.busDirections?.[c]??t.defaultDirection,preferredExit:Sde(c,t.busExitPreferences?.[c]??t.defaultPreferredExit),termination:{type:"boundary"}})}}return[...o.values()]}function SJr(e){let{busSpec:t,connections:n,componentGrids:o}=e,r=new Map;for(let l of n){let h=new Set;for(let d of l.pointsToConnect)for(let u of Zvn({point:d,connection:l,componentGrids:o}))h.add(u.grid.componentId);for(let d of h)r.set(d,(r.get(d)??0)+1)}let i=[...o].sort((l,h)=>{let d=(r.get(h.componentId)??0)-(r.get(l.componentId)??0);if(d!==0)return d;return h.obstacles.length-l.obstacles.length})[0],s=t.sourceComponentId?o.find((l)=>l.componentId===t.sourceComponentId):void 0;if(t.sourceComponentId&&!s)throw Error(`FanoutSolver: source component "${t.sourceComponentId}" for bus "${t.busId}" was not found`);let a=s??i,c=a?r.get(a.componentId)??0:0;if(!a||c!==n.length)throw Error(t.sourceComponentId?`FanoutSolver: source component "${t.sourceComponentId}" is not an endpoint on every connection in bus "${t.busId}"`:`FanoutSolver: bus "${t.busId}" does not have one component endpoint on every connection`);return a}function PJr(e,t,n,o){let i=t.pointsToConnect.filter((s,a)=>a!==n).sort((s,a)=>Bb(e,a)-Bb(e,s))[0];if(!i&&o.type==="plane")return e;if(!i)throw Error(`FanoutSolver: connection "${t.name}" has no target beyond its BGA pad`);return i}function EJr(e){let{connection:t,connectionIndex:n,sourceGrid:o,componentGrids:r,termination:i,exitTargetPoint:s}=e;for(let a=0;a<t.pointsToConnect.length;a++){let c=t.pointsToConnect[a],l=Zvn({point:c,connection:t,componentGrids:r}).find((u)=>u.grid.componentId===o.componentId);if(!l)continue;let h=Jvn(c).find((u)=>l.obstacle.layers.includes(u));if(!h)throw Error(`FanoutSolver: connection "${t.name}" has no source layer shared with its BGA pad`);let d=PJr(c,t,a,i);return{connection:t,connectionIndex:n,sourcePoint:c,sourcePointIndex:a,sourceLayer:h,sourceObstacle:l.obstacle,targetPoint:d,exitTargetPoint:s??{x:d.x,y:d.y},hasExplicitLayeredExitTarget:s?.layer!==void 0}}throw Error(`FanoutSolver: connection "${t.name}" does not touch component "${o.componentId}"`)}function Drt(e,t){let n=0,o=0;for(let r of t){let i=r.exitTargetPoint??r.targetPoint;n+=i.x-r.sourcePoint.x,o+=i.y-r.sourcePoint.y}if(Math.abs(n)<0.000000001&&Math.abs(o)<0.000000001)throw Error(`FanoutSolver: cannot infer an escape direction for bus "${e}"`);if(Math.abs(n)>=Math.abs(o))return n>=0?"right":"left";return o>=0?"up":"down"}function MJr(e){switch(e){case"left":return["left"];case"right":return["right"];case"top":return["up"];case"bottom":return["down"];case"top-left":return["up","left"];case"top-right":return["up","right"];case"bottom-left":return["down","left"];case"bottom-right":return["down","right"]}}function e8n(e){return{x:e.reduce((t,n)=>t+n.sourcePoint.x,0)/e.length,y:e.reduce((t,n)=>t+n.sourcePoint.y,0)/e.length}}function R8e(e,t,n){switch(t){case"left":return e.x-n.minX;case"right":return n.maxX-e.x;case"up":return n.maxY-e.y;case"down":return e.y-n.minY}}function I2n(e,t){if(e.direction==="up"||e.direction==="down"){if(e.preferredExit.endsWith("left"))return t.minX;if(e.preferredExit.endsWith("right"))return t.maxX;return(t.minX+t.maxX)/2}if(e.preferredExit.startsWith("top"))return t.maxY;if(e.preferredExit.startsWith("bottom"))return t.minY;return(t.minY+t.maxY)/2}function v2n(e,t){return t==="up"||t==="down"?e.x:e.y}function wJr(e,t){try{return Drt(e,t)}catch{return}}function BJr(e){let{busId:t,explicitDirection:n,preferredExit:o,connections:r,sharedBoundary:i,availableRegions:s}=e,a=s.filter((u)=>(n===void 0||u.direction===n)&&(o===void 0||u.preferredExit===o));if(a.length===0)throw Error(`FanoutSolver: bus "${t}" cannot use its requested exit with availableCornersAndSides`);let c=n?void 0:wJr(t,r),l=c?a.filter((u)=>u.direction===c):[],h=l.length>0?l:a,d=e8n(r);return[...h].toSorted((u,_)=>R8e(d,u.direction,i)-R8e(d,_.direction,i)||Math.abs(v2n(d,u.direction)-I2n(u,i))-Math.abs(v2n(d,_.direction)-I2n(_,i))||u.preferredExit.localeCompare(_.preferredExit))[0]}function TJr(e){let{busId:t,exitEdge:n,preferredExit:o,availableRegions:r}=e,i=_8e(n,o);if(!r.some((a)=>a.exitEdge===n&&_8e(a.exitEdge,a.preferredExit)===i))throw Error(`FanoutSolver: bus "${t}" cannot use its requested exit with availableCornersAndSides`)}function DJr(e){let{busId:t,explicitDirection:n,preferredExit:o,connections:r,sharedBoundary:i,availableRegions:s}=e;if(s)return BJr({busId:t,explicitDirection:n,preferredExit:o,connections:r,sharedBoundary:i,availableRegions:s});if(!o)return{direction:n??Drt(t,r)};let a=MJr(o);if(n){if(!a.includes(n))throw Error(`FanoutSolver: bus "${t}" direction "${n}" is incompatible with preferredExit "${o}"`);return{direction:n,preferredExit:o}}if(a.length===1)return{direction:a[0],preferredExit:o};let c;try{c=Drt(t,r)}catch{c=void 0}if(c&&a.includes(c))return{direction:c,preferredExit:o};let l=e8n(r);return{direction:a.toSorted((h,d)=>R8e(l,h,i)-R8e(l,d,i)||h.localeCompare(d))[0],preferredExit:o}}function NJr(e,t){let n=_Jr(e.obstacles);if(n.length===0&&e.connections.length>0)throw Error("FanoutSolver: no componentId-tagged pad footprint was found");let o=new Map(e.connections.map((h,d)=>[h.name,d])),r=vJr(e,t).map((h)=>{for(let[p,m]of Object.entries(h.connectionExitTargets??{})){if(!h.connectionNames.includes(p))throw Error(`FanoutSolver: connectionExitTargets contains connection "${p}" outside bus "${h.busId}"`);if(!Number.isFinite(m.x)||!Number.isFinite(m.y))throw Error(`FanoutSolver: connectionExitTargets for connection "${p}" must contain finite x and y coordinates`)}let d=h.connectionNames.map((p)=>{let m=o.get(p);if(m===void 0)throw Error(`FanoutSolver: connection "${p}" is missing from the input`);return e.connections[m]}),u=SJr({busSpec:h,connections:d,componentGrids:n}),_=d.map((p)=>EJr({connection:p,connectionIndex:o.get(p.name),sourceGrid:u,componentGrids:n,termination:h.termination??{type:"boundary"},exitTargetPoint:h.connectionExitTargets?.[p.name]}));return{busSpec:h,sourceGrid:u,preparedConnections:_}}),i=[...new Map(r.map(({sourceGrid:h})=>[h.componentId,h])).values()],s=mJr(i,t),a=bJr(t.availableCornersAndSides),c=[];for(let{busSpec:h,sourceGrid:d,preparedConnections:u}of r){if(h.exitEdge&&!h.preferredExit)throw Error(`FanoutSolver: bus "${h.busId}" exitEdge requires preferredExit`);if(h.exitEdge&&h.preferredExit&&!eCn(h.preferredExit,h.exitEdge))throw Error(`FanoutSolver: bus "${h.busId}" exitEdge "${h.exitEdge}" is incompatible with preferredExit "${h.preferredExit}"`);let _=DJr({busId:h.busId,explicitDirection:h.direction??t.busDirections?.[h.busId],preferredExit:h.preferredExit,connections:u,sharedBoundary:s,availableRegions:h.termination?.type==="plane"||h.exitEdge?void 0:a});if(h.termination?.type!=="plane"&&h.exitEdge&&_.preferredExit&&a)TJr({busId:h.busId,exitEdge:h.exitEdge,preferredExit:_.preferredExit,availableRegions:a});c.push({busId:h.busId,...h.maxLengthSkew===void 0?{}:{maxLengthSkew:h.maxLengthSkew},direction:_.direction,preferredExit:_.preferredExit,...h.exitEdge?{exitEdge:h.exitEdge}:{},cornerBandConnectionCount:0,allowedLayers:h.allowedLayers,termination:h.termination??{type:"boundary"},connections:u,componentId:d.componentId,componentObstacles:d.obstacles,componentBounds:qvn(d,t),sharedBoundary:s,xCoordinates:[...d.xCoordinates],yCoordinates:[...d.yCoordinates],pitchX:d.pitchX,pitchY:d.pitchY})}let l=new Map;for(let h of c){let d=_8e(h.exitEdge,h.preferredExit);if(!h.exitEdge||!d)continue;let u=`${h.exitEdge}:${d}`;l.set(u,(l.get(u)??0)+h.connections.length)}for(let h of c){let d=_8e(h.exitEdge,h.preferredExit);if(!h.exitEdge||!d)continue;h.cornerBandConnectionCount=l.get(`${h.exitEdge}:${d}`)??h.connections.length}return c}var ljs=Math.PI*2,hjs=globalThis.process?.env?.FANOUT_FLOW_DEBUG==="1",RJr=(e)=>e.process??{env:{}},djs=RJr(globalThis);function S2n(e,t){if(e.length<2)return null;let n=(e.at(-1)-e[0])/(e.length-1),o=Number(n.toPrecision(3));if(!(o>0)||Math.abs(o-n)>t)return null;let r=e.reduce((c,l,h)=>c+l-h*o,0)/e.length,i=10**(Math.floor(Math.log10(o))-2),s=Math.round(r/i)*i,a=e.map((c,l)=>s+l*o);if(a.some((c,l)=>Math.abs(c-e[l])>t))return null;return{coordinates:a,pitch:o}}function hat(e,t){let n=structuredClone(e.connections),o=[],r=[],i=[],s=Rue(e.layerCount);for(let[A,g]of n.entries()){let f=t.targetLayers.get(g.name);if(!f||!s.includes(f))throw Error(`Missing or invalid target layer for ${g.name}`);if(g.pointsToConnect.length!==2)throw Error(`${g.name}: two terminals required`);for(let[y,x]of g.pointsToConnect.entries()){if(("layer"in x?[x.layer]:x.layers).includes(f)){let{layers:v,...P}=x;g.pointsToConnect[y]={...P,layer:f};continue}let b=e.obstacles.find((v)=>v.componentId&&Z3n(x,v)<0.00000001&&v.connectedTo.some((P)=>P===x.pcb_port_id||P===x.pointId||P===g.name));if(!b?.componentId)throw Error(`${g.name}: local dogbone requires a component pad terminal`);let I=`dogbone_endpoint_${o.length}`;o.push({connectionIndex:A,pointIndex:y}),r.push({...g,name:I,pointsToConnect:[x,g.pointsToConnect[1-y]]}),i.push({busId:I,connectionNames:[I],sourceComponentId:b.componentId})}}if(!o.length)return{connections:n,traces:[]};let a=NJr({...e,connections:r,buses:[]},{buses:i});for(let A of a){let g=Math.min(...A.componentObstacles.flatMap((I)=>[I.width,I.height]))/100,f=(I)=>{let v=[];for(let P of[...I].sort((M,B)=>M-B))if(v.length&&P-v.at(-1)[0]<g)v.at(-1).push(P);else v.push([P]);return v.map((P)=>P.reduce((M,B)=>M+B,0)/P.length)};A.xCoordinates=f(A.xCoordinates),A.yCoordinates=f(A.yCoordinates);let y=(I,v)=>I.length>1?Math.min(...I.slice(1).map((P,M)=>P-I[M])):v;A.pitchX=y(A.xCoordinates,A.pitchX),A.pitchY=y(A.yCoordinates,A.pitchY);let x=(I,v)=>I.flatMap((P,M)=>{if(M===I.length-1)return[P];let B=I[M+1]-P,T=Math.max(1,Math.round(B/v));if(Math.abs(B/T-v)>g)return[P];return Array.from({length:T},(N,D)=>P+B*D/T)});A.xCoordinates=x(A.xCoordinates,A.pitchX),A.yCoordinates=x(A.yCoordinates,A.pitchY);let C=S2n(A.xCoordinates,g),b=S2n(A.yCoordinates,g);if(C)A.xCoordinates=C.coordinates,A.pitchX=C.pitch;if(b)A.yCoordinates=b.coordinates,A.pitchY=b.pitch}let c=[],l=[];for(let A of e.traces??[])for(let[g,f]of A.route.entries())if(f.route_type==="via"){l.push({connectionIndex:-1,center:f,diameter:f.via_diameter??t.viaDiameter,spanLayers:s});let y=A.route[g+1];if(y?.route_type==="wire")c.push({connectionIndex:-1,segment:{start:f,end:y,layer:y.layer,width:y.width}})}else if(f.route_type==="wire"){let y=A.route[g+1];if(y?.route_type==="wire")c.push({connectionIndex:-1,segment:{start:f,end:y,layer:f.layer,width:f.width}});else if(y?.route_type==="via")c.push({connectionIndex:-1,segment:{start:f,end:y,layer:f.layer,width:f.width}})}else throw Error("Unsupported fixed copper primitive for local dogbones");let h={viaDiameter:t.viaDiameter,viaHoleDiameter:t.viaHoleDiameter,traceWidth:t.traceWidth,clearance:t.clearance,holeToHoleClearance:t.holeToHoleClearance,additionalObstacles:e.obstacles,blockingSegments:c,blockingVias:l},d=$Yr(a,h),u=new Map;for(let A of a.flatMap((g)=>g.connections)){let g=d.filter((x)=>x.connectionIndex===A.connectionIndex),f=A.sourcePoint,y=(x)=>Number(x.x<f.x)*2+Number(x.y>f.y)*2+Math.hypot(x.x-f.x,x.y-f.y);if(g.sort((x,C)=>y(x.point)-y(C.point)),g[0])u.set(A.connectionIndex,g[0].point)}let _=KYr(a,{...h,preferredViaPointsByConnectionIndex:u});if(!_)throw Error("No collision-free local dogbone assignment");let p=a.flatMap((A)=>A.connections);for(let A=0;A<p.length;A++)for(let g=0;g<A;g++){let f=p[A],y=p[g],x=_.get(f.connectionIndex),C=_.get(y.connectionIndex),b={start:f.sourcePoint,end:x,layer:f.sourceLayer,width:t.traceWidth},I={start:y.sourcePoint,end:C,layer:y.sourceLayer,width:t.traceWidth},v=Math.max(t.viaDiameter+t.clearance,t.viaHoleDiameter+(t.holeToHoleClearance??t.clearance)),P=t.viaDiameter/2+t.traceWidth/2+t.clearance;if(Bb(x,C)<v-0.000000001||E9(x,I.start,I.end)<P-0.000000001||E9(C,b.start,b.end)<P-0.000000001||f.sourceLayer===y.sourceLayer&&!sst(b,I,t.clearance))throw Error("Local dogbones collide between components")}let m=[];for(let[A,g]of o.entries()){let f=n[g.connectionIndex],y=f.pointsToConnect[g.pointIndex],C=a.flatMap((M)=>M.connections).find((M)=>M.connectionIndex===A).sourceLayer,b=t.targetLayers.get(f.name),I=_.get(A),v=t.viaDiameter/2+(t.boardEdgeClearance??0);if(I.x<e.bounds.minX+v||I.x>e.bounds.maxX-v||I.y<e.bounds.minY+v||I.y>e.bounds.maxY-v)throw Error(`${f.name}: dogbone outside board bounds`);let P=HYr({fromLayer:C,toLayer:b,layerNames:s,allowBlindAndBuriedVias:t.allowBlindAndBuriedVias??!1});m.push({type:"pcb_trace",pcb_trace_id:`local_dogbone_${f.name}_${g.pointIndex}`,connection_name:f.name,route:[{route_type:"wire",x:y.x,y:y.y,layer:C,width:t.traceWidth},{route_type:"wire",...I,layer:C,width:t.traceWidth},{route_type:"via",...I,from_layer:C,to_layer:b,layers:P,via_diameter:t.viaDiameter,via_hole_diameter:t.viaHoleDiameter},{route_type:"wire",...I,layer:b,width:t.traceWidth}]}),f.pointsToConnect[g.pointIndex]={...I,layer:b}}return{connections:n,traces:m}}function Vue(e,t,n){let o=e.connections.reduce((_,p)=>({x:_.x+p.pointsToConnect[1].x-p.pointsToConnect[0].x,y:_.y+p.pointsToConnect[1].y-p.pointsToConnect[0].y}),{x:0,y:0}),r=Math.abs(o.x)>Math.abs(o.y)?o.x>0?3:1:0,i=new Set((e.buses??[]).flatMap((_)=>_.connectionNames)),s=mk({...e,connections:e.connections.filter((_)=>i.has(_.name))}),a=e.traces?.length?[0,...[0,1,2,3].map((_)=>(r+_)%4).filter((_)=>_!==0)]:[3,0,1,2].map((_)=>(r+_)%4),c=s?(r+n)%4:a[n%4],l=(_,p)=>{let{x:m,y:A}=_;for(let g=0;g<p;g++)[m,A]=[-A,m];return{..._,x:m,y:A}},h=[{x:e.bounds.minX,y:e.bounds.minY},{x:e.bounds.maxX,y:e.bounds.maxY}].map((_)=>l(_,c)),d={...e,bounds:{minX:Math.min(...h.map((_)=>_.x)),maxX:Math.max(...h.map((_)=>_.x)),minY:Math.min(...h.map((_)=>_.y)),maxY:Math.max(...h.map((_)=>_.y))},connections:e.connections.map((_)=>({..._,pointsToConnect:_.pointsToConnect.map((p)=>l(p,c))})),obstacles:e.obstacles.map((_)=>({..._,center:l(_.center,c),ccwRotationDegrees:(_.ccwRotationDegrees??0)+90*c})),traces:e.traces?.map((_)=>({..._,route:_.route.map((p)=>l(p,c))}))},u=hat(d,t);return{connections:u.connections.map((_)=>({..._,pointsToConnect:_.pointsToConnect.map((p)=>l(p,(4-c)%4))})),traces:u.traces.map((_)=>({..._,route:_.route.map((p)=>{if(!("x"in p))throw Error("Unexpected dogbone primitive");return l(p,(4-c)%4)})}))}}function*mY(e,t){let n=e.next(),o=0;try{while(!n.done&&o++<t)yield,n=e.next();return n.done?n.value:null}finally{if(!n.done)e.return(null)}}function Rb(e,t){return e.buses?.find((n)=>n.connectionNames.includes(t.name))?.traceWidth??t.nominalTraceWidth??t.width??e.minTraceWidth}function Yue(e,t){return{targetLayers:t,viaDiameter:e.minViaPadDiameter??0.6,viaHoleDiameter:e.minViaHoleDiameter??0.3,traceWidth:Math.max(e.minTraceWidth,...e.connections.map((n)=>Rb(e,n))),clearance:e.minTraceToPadEdgeClearance??e.defaultObstacleMargin??0.075,boardEdgeClearance:e.minBoardEdgeClearance,holeToHoleClearance:e.minViaHoleEdgeToViaHoleEdgeClearance,allowBlindAndBuriedVias:e.allowBlindAndBuriedVias??!1}}function Gue(e,t){return t.map((n)=>({...n,source_trace_id:e.connections.find((o)=>o.name===n.connection_name)?.source_trace_id??n.connection_name}))}function*QJr(e,t,n,o){let r=structuredClone(t),i=n,s=o,a=new Map(e.connections.map((d)=>[d.name,Rb(e,d)])),c=r.connections.filter((d)=>!i.some((u)=>u.connection_name===d.name));if(!c.length)return{input:r,traces:i,escapes:s};if(c.length>3||c.some((d)=>!r.buses?.some((u)=>u.connectionNames.includes(d.name))))return null;let l=(d)=>c.filter((u)=>d.includes(u.name)).length,h=(r.buses??[]).filter((d)=>l(d.connectionNames)).sort((d,u)=>l(u.connectionNames)-l(d.connectionNames));for(let d of h){let u=new Set(d.connectionNames),_=e.connections.filter((x)=>u.has(x.name)),p=i.filter((x)=>!u.has(x.connection_name)),m=r.differentialPairs?.find((x)=>x.connectionNames.every((C)=>u.has(C)));if(!m||_.length!==u.size)return null;let A=r.connections.find((x)=>u.has(x.name)).pointsToConnect[0].layer,g=l(d.connectionNames)>1,f=g?[1,0,3,5,2,4]:[2,1,0,3,5,4],y=!1;for(let x=0;x<4&&!y;x++){let C=((g?1:0)+x)%4,b={...e,connections:_,traces:[...e.traces??[],...s.filter((T)=>!u.has(T.connection_name)),...p]},I;try{I=Vue(b,Yue(b,new Map(_.map((T)=>[T.name,A]))),C)}catch{yield;continue}let v=Gue(e,I.traces),P={...r,connections:I.connections,buses:[d],differentialPairs:[m],traces:[...b.traces,...v]},M=sa(P),B=P.connections.filter((T)=>!m.connectionNames.includes(T.name));for(let T of f){let N=yield*mY(zk(P,m,M,{copper:[],penalty:0,variant:T}),6000);if(!N)continue;let D=VY(P,B,M,N,a,void 0,new Map,()=>!1,!0),L=D.next(),H=0,V=0,O=null;try{while(!L.done&&H++<1e4){if(L.value.length>V){if(V=L.value.length,V>=P.connections.length-1){let U=yield*mY(QJ({...P,connections:B},L.value.filter((j)=>!m.connectionNames.includes(j.connection_name)),[...M,...N.flatMap(Jr)],a,new Map,{maxSearches:200}),20000);if(U){O=[...N,...U];break}}}yield,L=D.next()}if(L.done)O=L.value}finally{if(!L.done)D.return(null)}if(!O)continue;i=[...p,...O],s=[...s.filter((U)=>!u.has(U.connection_name)),...v],r={...r,connections:r.connections.map((U)=>P.connections.find((j)=>j.name===U.name)??U),traces:[...e.traces??[],...s]},y=!0;break}}if(!y)return null}return i.length===r.connections.length?{input:r,traces:i,escapes:s}:null}function*kJr(e,t,n,o={}){let r=e.connections,i=sa(e),s=new vZ,a=e.minTraceToPadEdgeClearance??e.defaultObstacleMargin??0.075,c=(f)=>{let y=[];for(let x=0;x<f.length;x++)for(let C=0;C<x;C++)if(f[x].route[0].layer===f[C].route[0].layer&&s.firstConflict(f[x].route,f[C].route,(f[x].route[0].width+f[C].route[0].width)/2+a-0.00000001))y.push([x,C]);return y};function*l(f,y,x){let C=[];for(let b of n.get(f.name)??[f.pointsToConnect[0].layer]){let I={...f,pointsToConnect:f.pointsToConnect.map((B)=>({...B,layer:b}))},v=new Mi(e,I,Rb(e,f),[...i,...y.flatMap(Jr)]),P=new al(v,...I.pointsToConnect,x.flatMap(Jr),10,void 0,{maxLength:Math.min(vy(e,f.name),(o.lengthTargets?.get(f.name)??1/0)-Lf(e,f.name)),paretoLength:!0,checkReachability:!0}),M=0;try{while(!P.solved&&!P.failed&&M++<4000)P.step(),yield;if(P.solved){let B={type:"pcb_trace",pcb_trace_id:`bus_lane_${f.name}`,connection_name:f.name,source_trace_id:f.source_trace_id??f.name,route:P.result.map((N)=>({...N,route_type:"wire",layer:b,width:Rb(e,f)}))},T=o.lengthTargets?.get(f.name);if(T===void 0)C.push(B);else try{C.push(JJ({...e,connections:[I],traces:[...e.traces??[],...y],buses:[],differentialPairs:[]},Mk({...e,connections:[I]},[B],[...i,...y.flatMap(Jr)],1.5),new Map([[f.name,T]]),{maxCandidates:65536,packMeanders:!0})[0])}catch{}}}finally{P.cancel()}}return C}let h=t.filter((f)=>{let y=r.find((I)=>I.name===f.connection_name);if(!y||Ar(f.route)>vy(e,y.name)+0.0000001)return!1;let x=o.lengthTargets?.get(y.name);if(x!==void 0&&Math.abs(Ar(f.route)+Lf(e,y.name)-x)>0.0000001)return!1;if(y.pointsToConnect.some((I)=>![f.route[0],f.route.at(-1)].some((v)=>Math.hypot(I.x-v.x,I.y-v.y)<0.0000001)))return!1;let C=f.route[0].layer,b={...y,pointsToConnect:y.pointsToConnect.map((I)=>({...I,layer:C}))};return new Mi(e,b,Rb(e,y),i).pathVisible(f.route)});for(let f of r.filter((y)=>!h.some((x)=>x.connection_name===y.name))){let y=yield*l(f,[],h);if(!y.length)return o.onBlockedConnection?.(f.name),null;y.sort((x,C)=>c([...h,x]).length-c([...h,C]).length||Ar(x.route)-Ar(C.route)),h.push(y[0])}let d=(f,y,x)=>({routes:f,constraints:y,depth:x,collisions:c(f),cost:f.reduce((C,b)=>C+Ar(b.route),0)}),u=[d(h,new Map,0)],_=new Set,p=1/0,m=new WeakMap,A=0,g=(f)=>{if(!m.has(f))m.set(f,A++);return m.get(f)};for(let f=0;u.length&&f<(o.maxNodes??2000);f++){u.sort((b,I)=>b.collisions.length-I.collisions.length||b.depth-I.depth||b.cost-I.cost);let y=u.shift();if(!y.collisions.length)return y.routes;if(y.collisions.length<p||f%20===0){if(y.collisions.length<p)o.onBestCandidate?.(y.routes,y.collisions.map(([b,I])=>[y.routes[b].connection_name,y.routes[I].connection_name]));p=Math.min(p,y.collisions.length),o.onProgress?.({nodes:f,collisions:y.collisions.length,queue:u.length})}let x=new Map;for(let b of y.collisions)for(let I of b)x.set(I,(x.get(I)??0)+1);y.collisions.sort((b,I)=>x.get(b[0])+x.get(b[1])-(x.get(I[0])+x.get(I[1])));let C=y.collisions[0];for(let[b,I]of[C,[C[1],C[0]]]){let v=y.routes[b].connection_name,P=r.find((N)=>N.name===v),M=new Map(y.constraints);M.set(v,[...M.get(v)??[],y.routes[I]]);let B=r.map((N)=>`${N.name}:${(M.get(N.name)??[]).map(g).sort((D,L)=>D-L).join(",")}`).join(";");if(_.has(B))continue;_.add(B);let T=y.routes.filter((N,D)=>D!==b);for(let N of yield*l(P,M.get(v),T)){let D=y.routes.map((L,H)=>H===b?N:L);u.push(d(D,M,y.depth+1))}}if(u.length>256)u.sort((b,I)=>b.collisions.length-I.collisions.length||b.depth-I.depth||b.cost-I.cost),u.length=256;yield}return null}function LJr(e,t){let n=e.connections.find((m)=>m.name===t.connectionNames[0]).pointsToConnect[0].layer,o=e.buses?.find((m)=>t.connectionNames.some((A)=>m.connectionNames.includes(A))),r=o?[o]:(e.buses??[]).filter((m)=>e.connections.some((A)=>m.connectionNames.includes(A.name)&&A.pointsToConnect[0].layer===n));if(!r.length)return[];let i=r[0],s=new Set(r.flatMap((m)=>m.connectionNames)),a=e.connections.filter((m)=>s.has(m.name)),c=OY(e,0),l=a[0].pointsToConnect[0].layer,h=i.traceWidth??e.minTraceWidth,d=e.minTraceToPadEdgeClearance??e.defaultObstacleMargin??0.075,u=Math.max(0,a.length-2)*(h+d),_=new Map;for(let m of a)for(let A of m.pointsToConnect){let g=c.map((b,I)=>({box:b.pads,index:I,distance:Math.hypot(A.x-(b.pads.minX+b.pads.maxX)/2,A.y-(b.pads.minY+b.pads.maxY)/2)})).sort((b,I)=>b.distance-I.distance)[0];if(!g)continue;let{box:f}=g,y=[{side:"left",d:A.x-f.minX,x:-1,y:0},{side:"right",d:f.maxX-A.x,x:1,y:0},{side:"bottom",d:A.y-f.minY,x:0,y:-1},{side:"top",d:f.maxY-A.y,x:0,y:1}].sort((b,I)=>b.d-I.d)[0],x=`${g.index}:${y.side}`,C=_.get(x);if(!C)_.set(x,C=[]);C.push({point:A,edge:y,name:m.name})}let p=[];for(let m of _.values()){let A=Math.min(...m.map((g)=>g.edge.d));for(let{point:g,edge:f,name:y}of m){if(t.connectionNames.includes(y)||f.d>A+h/2)continue;p.push({a:g,b:{x:g.x+f.x*u,y:g.y+f.y*u},radius:h/2,layer:l,owners:[y]})}}return p}function*t8n(e,t,n=!1){let o=e.differentialPairs??[],r=e.buses?.some((m)=>m.maxLength!==void 0),i=o.map(()=>[]),s=o.map(()=>new Set),a=new Set,c=sa(e),l=new vZ,h=e.minTraceToPadEdgeClearance??e.defaultObstacleMargin??0.075,d=new Map,u=0,_=(m,A)=>m.layer===A.layer&&m.traces.some((g)=>A.traces.some((f)=>l.firstConflict(g.route,f.route,(g.route[0].width+f.route[0].width)/2+h-0.00000001))),p=n?[100,2,3,0,1,101,102,103,4,104,5,105,6,106,7,107]:[1,2,[0,1],[1,0],0,[0,2],[2,0],3,[1,2],[2,1],4,5,6,7];for(let m of p){for(let[C,b]of o.entries()){let I=b.connectionNames.map((P)=>e.connections.find((M)=>M.name===P)),v=t.get(I[0].name)?.filter((P)=>I.every((M)=>t.get(M.name)?.includes(P)))??[I[0].pointsToConnect[0].layer];for(let P of v.filter((M)=>!e.allowedLayers||e.allowedLayers.includes(M))){let M=typeof m==="number"&&m>=100,B=JSON.stringify([C,P,M]),T=d.get(B)??{...e,connections:e.connections.map((H)=>b.connectionNames.includes(H.name)?{...H,pointsToConnect:H.pointsToConnect.map((V)=>({...V,layer:P}))}:H)};d.set(B,T);let N=mY(zk(T,b,M?[...c,...LJr(T,b)]:c,{copper:[],penalty:0,...typeof m==="number"?{variant:M?m-100:m}:{handoffOffsets:m}}),6000),D=N.next();try{while(!D.done)yield void 0,D=N.next()}finally{if(!D.done)N.return(null)}if(!D.value)continue;if(r&&D.value.some((H)=>Ar(H.route)>vy(e,H.connection_name)+0.0000001))continue;let L=JSON.stringify(D.value.map((H)=>H.route));if(s[C].has(L))continue;s[C].add(L),i[C].push({id:u++,layer:P,traces:D.value,length:D.value.reduce((H,V)=>H+Ar(V.route),0)})}}if(r)for(let C of i)C.sort((b,I)=>b.length-I.length);let A=[],g=(C,b)=>{if(A.length>=256)return;if(b===i.length){let I=C.map((v)=>v.id).join(",");if(!a.has(I))A.push(C);return}for(let I of i[b])if(!C.some((v)=>_(I,v)))g([...C,I],b+1)};g([],0);let f=new Set(e.buses?.flatMap((C)=>C.connectionNames)),y=new Set(o.flatMap((C)=>C.connectionNames)),x=new Map(A.map((C)=>[C,n?e.connections.filter((b)=>f.has(b.name)&&!y.has(b.name)).reduce((b,I)=>b+C.filter((v)=>v.layer===I.pointsToConnect[0].layer).flatMap((v)=>v.traces).filter((v)=>l.firstConflict(I.pointsToConnect,v.route,(v.route[0].width+e.minTraceWidth)/2+h-0.00000001)).length,0):0]));A.sort((C,b)=>x.get(C)-x.get(b)||C.reduce((I,v)=>I+v.length,0)-b.reduce((I,v)=>I+v.length,0));for(let C of A)a.add(C.map((b)=>b.id).join(",")),yield C.flatMap((b)=>b.traces)}}var Q8e=(e,t)=>Fn(e,t)<0.00000001;function HJr(e,t,n){let o=[[],[]],r={...e,connections:[t]};for(let i=0;i<2;i++){let s=[];for(let a=0;a<8;a++)try{let c=hat({...r,obstacles:[...r.obstacles,...s]},n),l=c.connections[0].pointsToConnect[i];if(o[i].some((d)=>Q8e(d.point,l)))break;let h=Gue(e,c.traces).find((d)=>Q8e(d.route[0],t.pointsToConnect[i]));if(!h)break;o[i].push({point:l,escape:h,copper:sa({...e,obstacles:[],traces:[h]})}),s.push({type:"rect",center:{x:l.x,y:l.y},width:0.000001,height:0.000001,layers:Rue(e.layerCount),connectedTo:[]})}catch{break}o[i].sort((a,c)=>a.point.x-c.point.x||a.point.y-c.point.y)}return o}function*FJr(e,t,n,o=!1){let r=[],i=sa(e);for(let[d,u]of e.connections.entries()){let _=HJr(e,u,t);if(_.some((m)=>!m.length))return null;let p;for(let m of n.get(u.name)??[]){let A=(C)=>C.escape.route.some((b)=>b.route_type==="via"&&b.layers?.includes(m)),g=_[0].filter(A).map((C)=>({...C.point,layer:m})),f=_[1].filter(A).map((C)=>({...C.point,layer:m}));if(!g.length||!f.length)continue;let y={...u,pointsToConnect:[g[0],f[0]]},x=new al(new Mi(e,y,t.traceWidth,i),g[0],f[0],[],0,void 0,{starts:g,ends:f,nearestTerminalAttachments:o,checkReachability:!0});try{let C=0;while(!x.solved&&!x.failed&&C++<4000)x.step(),yield;if(x.solved){let b=Ar(x.result);if(!p||b<p.cost)p={cost:b,start:x.result[0],end:x.result.at(-1)}}}finally{x.cancel()}}if(!p)return null;for(let m=0;m<2;m++){let A=u.pointsToConnect[m],g=u.pointsToConnect[1-m],f=m?p.end:p.start,y=g.x-A.x,x=g.y-A.y,C=(v)=>{let P=Math.abs(y)>=Math.abs(x)?Math.sign(y)*(v.x-A.x):Math.sign(x)*(v.y-A.y);return P>0.000000001?0:Math.abs(P)<=0.000000001?1:2};_[m].sort((v,P)=>{let M=Fn(A,v.point)-Fn(A,P.point);return Number(!Q8e(v.point,f))-Number(!Q8e(P.point,f))||C(v.point)-C(P.point)||(Math.abs(M)<0.00000001?0:M)||v.point.x-P.point.x||v.point.y-P.point.y});let b=[u.name,A.pcb_port_id,A.pointId],I=e.obstacles.filter((v)=>v.componentId&&v.connectedTo.some((P)=>b.includes(P))).sort((v,P)=>Fn(v.center,A)-Fn(P.center,A))[0];if(!I?.componentId)return null;r.push({connectionIndex:d,pointIndex:m,component:I.componentId,sites:_[m]})}}let s=new Map,a=(d,u)=>{if(d.copper.some((m)=>u.copper.some((A)=>m.layer===A.layer&&Nue(m.a,m.b,A)<m.radius+t.clearance-0.00000001)))return!1;let _=d.escape.route.find((m)=>m.route_type==="via"),p=u.escape.route.find((m)=>m.route_type==="via");return Fn(_,p)>=t.viaHoleDiameter+(t.holeToHoleClearance??t.clearance)-0.00000001},c=0;for(let d of new Set(r.map((u)=>u.component))){let u=(_)=>{if(++c>1e5)return!1;if(!_.length)return!0;let p=_.map((g)=>({endpoint:g,sites:g.sites.filter((f)=>[...s.values()].every((y)=>a(f,y)))})).sort((g,f)=>g.sites.length-f.sites.length||g.endpoint.connectionIndex-f.endpoint.connectionIndex||g.endpoint.pointIndex-f.endpoint.pointIndex),{endpoint:m,sites:A}=p[0];for(let g of A){if(s.set(m,g),u(_.filter((f)=>f!==m)))return!0;s.delete(m)}return!1};if(!u(r.filter((_)=>_.component===d)))return null;yield}let l=structuredClone(e.connections),h=[];for(let d of r){let u=s.get(d),_=l[d.connectionIndex];_.pointsToConnect[d.pointIndex]={...u.point,layer:t.targetLayers.get(_.name)},h.push(u.escape)}return{connections:l,traces:h}}function Uue(e,t){return(e.allowedLayers??Rue(e.layerCount)).filter((n)=>!t.pointsToConnect.some((o)=>o.layer===n)&&(e.buses??[]).every((o)=>!o.connectionNames.includes(t.name)||!o.allowedLayers||o.allowedLayers.includes(n)))}function n8n(e,t,n,o){let r=Rb(e,t);return{type:"pcb_trace",pcb_trace_id:`bus_lane_${t.name}`,connection_name:t.name,source_trace_id:t.source_trace_id??t.name,route:n.map((i)=>({...i,route_type:"wire",layer:o,width:r}))}}var o8n=class{geometry=new WeakMap;prepare(e){let t=this.geometry.get(e);if(t)return t;let n=new Float64Array(e.length*4),o=1/0,r=-1/0,i=1/0,s=-1/0;for(let c=0;c<e.length;c++){let l=e[c],h=c*4;if(n[h]=Math.min(l.a.x,l.b.x)-l.radius,n[h+1]=Math.max(l.a.x,l.b.x)+l.radius,n[h+2]=Math.min(l.a.y,l.b.y)-l.radius,n[h+3]=Math.max(l.a.y,l.b.y)+l.radius,l.rect)n[h]=Math.min(n[h],l.rect.minX),n[h+1]=Math.max(n[h+1],l.rect.maxX),n[h+2]=Math.min(n[h+2],l.rect.minY),n[h+3]=Math.max(n[h+3],l.rect.maxY);o=Math.min(o,n[h]),r=Math.max(r,n[h+1]),i=Math.min(i,n[h+2]),s=Math.max(s,n[h+3])}let a={copper:e,bounds:n,minX:o,maxX:r,minY:i,maxY:s};return this.geometry.set(e,a),a}firstConflict(e,t,n){let o=this.prepare(e),r=this.prepare(t);if(o.maxX+n<r.minX||r.maxX+n<o.minX||o.maxY+n<r.minY||r.maxY+n<o.minY)return;for(let i=0;i<e.length;i++){let s=e[i],a=i*4;for(let c=0;c<t.length;c++){let l=t[c],h=c*4;if(s.layer!==l.layer||o.bounds[a+1]+n<r.bounds[h]||r.bounds[h+1]+n<o.bounds[a]||o.bounds[a+3]+n<r.bounds[h+2]||r.bounds[h+3]+n<o.bounds[a+2])continue;if(Nue(s.a,s.b,l)<s.radius+n)return[s,l]}}}};function*zJr(e){let{native:t,pending:n,retained:o,traces:r}=e,i=sa(n),s=new vZ,a=new Set,c=t.minTraceToPadEdgeClearance??t.defaultObstacleMargin??0.075,l=function*(u,_,p=n,m=r){let A=[],g=t.connections.find((y)=>y.name===u.name),f=Rb(t,g);for(let y of Uue(t,g)){let x={...u,pointsToConnect:u.pointsToConnect.map((b)=>({...b,layer:y}))},C=new al(new Mi(p,x,f,_),x.pointsToConnect[0],x.pointsToConnect[1],m.flatMap(Jr),100,void 0,{checkReachability:!0,maxLength:vy(p,x.name),paretoLength:Number.isFinite(vy(p,x.name))});try{let b=0;while(!C.solved&&!C.failed&&b++<3000)C.step(),yield;if(C.solved)A.push({layer:y,blockers:m.filter((I)=>I.route[0].layer===y&&s.firstConflict(C.result,I.route,(f+I.route[0].width)/2+c-0.00000001))})}finally{C.cancel()}}return A};for(let u of n.connections.filter((_)=>!r.some((p)=>p.connection_name===_.name))){let _=(yield*l(u,i)).sort((p,m)=>p.blockers.length-m.blockers.length)[0];a.add(u.name);for(let p of _?.blockers??[])a.add(p.connection_name)}let h=new Set,d=r.filter((u)=>!a.has(u.connection_name));for(let u of n.connections.filter((_)=>a.has(_.name))){let _={...n,traces:[...t.traces??[],...e.escapes.filter((A)=>!a.has(A.connection_name)),...o]},p=yield*l(u,sa(_),_,d);for(let A of p)if(A.blockers.length<=3)for(let g of A.blockers)h.add(g.connection_name);let m=p.sort((A,g)=>A.blockers.length-g.blockers.length)[0];for(let A of m?.blockers??[])h.add(A.connection_name)}for(let u of h)a.add(u);return a}function*OJr(e){let{native:t}=e,n=[...e.retained,...e.traces],o=new Set(t.differentialPairs?.flatMap((l)=>l.connectionNames)),r=new Set,i=t.minTraceToPadEdgeClearance??t.defaultObstacleMargin??0.075,s=[...e.escapes,...n].map((l)=>({name:l.connection_name,copper:sa({...t,obstacles:[],traces:[l]})})),a=new o8n,c=(l)=>new Set(s.filter((h)=>a.firstConflict(l,h.copper,i-0.00000001)).map((h)=>h.name));for(let l of t.connections.filter((h)=>!n.some((d)=>d.connection_name===h.name))){let h=Uue(t,l);if(!h.length)return new Set;let d={...t,connections:[l]},u=[[],[]];for(let p=0;p<4;p++){try{let m=Vue(d,Yue(d,new Map([[l.name,h[0]]])),p);for(let A=0;A<2;A++){let g=m.connections[0].pointsToConnect[A];if(u[A].some((y)=>Math.hypot(y.point.x-g.x,y.point.y-g.y)<0.000001))continue;let f=Gue(t,m.traces).find((y)=>Math.hypot(y.route[0].x-l.pointsToConnect[A].x,y.route[0].y-l.pointsToConnect[A].y)<0.000001);if(f)u[A].push({point:g,escape:f})}}catch{}yield}let _;for(let p of u[0])for(let m of u[1]){let A=sa({...t,obstacles:[],traces:[p.escape,m.escape]}),g=c(A);if([...g].some((x)=>o.has(x)))continue;let f={...t,connections:[l],traces:[...t.traces??[],...e.escapes.filter((x)=>!g.has(x.connection_name)),...n.filter((x)=>o.has(x.connection_name))]},y=sa(f);for(let x of h){let C={...l,pointsToConnect:[p.point,m.point].map((I)=>({...I,layer:x}))},b=new al(new Mi(f,C,Rb(t,l),y),C.pointsToConnect[0],C.pointsToConnect[1],n.filter((I)=>!o.has(I.connection_name)).flatMap(Jr),100,void 0,{checkReachability:!0,maxLength:vy(t,l.name)-Ar(p.escape.route)-Ar(m.escape.route)});try{let I=0;while(!b.solved&&!b.failed&&I++<4000)b.step(),yield;if(b.solved){let v=n8n(t,l,b.result,x),P=c([...A,...Jr(v)]),M=P.size*1000+Ar(v.route);if(![...P].some((B)=>o.has(B))&&(!_||M<_.cost))_={cost:M,names:P}}}finally{b.cancel()}}}r.add(l.name);for(let p of _?.names??[])r.add(p)}return r}function*P2n(e,t,n=!1){if(!t.size)return null;let{native:o}=e,r=[...e.retained,...e.traces],i=r.filter((T)=>!t.has(T.connection_name)),s=e.escapes.filter((T)=>!t.has(T.connection_name)),a=new Map([...e.pending.connections.map((T)=>[T.name,T.pointsToConnect[0].layer]),...r.map((T)=>[T.connection_name,T.route[0].layer])]),c={...o,connections:o.connections.filter((T)=>t.has(T.name)),traces:[...o.traces??[],...s,...i]};if(!c.connections.length)return null;let l=sa(c),h=new Map,d=new Map,u=new Map,_=o.minTraceToPadEdgeClearance??o.defaultObstacleMargin??0.075;for(let T of c.connections){let N={...c,connections:[T]},D=[[],[]];for(let H=0;H<4;H++){try{let V=Vue(N,Yue(N,a),H);for(let O=0;O<2;O++){let U=V.connections[0].pointsToConnect[O];if(D[O].some((Y)=>Math.hypot(Y.point.x-U.x,Y.point.y-U.y)<0.000001))continue;let j=Gue(o,V.traces).find((Y)=>Math.hypot(Y.route[0].x-T.pointsToConnect[O].x,Y.route[0].y-T.pointsToConnect[O].y)<0.000001);if(j)D[O].push({point:U,escape:j})}}catch{}yield}let L=[];for(let H of D[0])for(let V of D[1])for(let O of Uue(o,T)){let U={...T,pointsToConnect:[H.point,V.point].map((ee)=>({...ee,layer:O}))},j=[H.escape,V.escape];if(j.some((ee)=>!ee.route.some((se)=>se.route_type==="via"&&se.layers?.includes(O))))continue;let Y=vy({...o,traces:[...o.traces??[],...j]},T.name),X=sa({...c,obstacles:[],traces:j}),K=new Mi(c,U,Rb(o,T),l),J=new al(K,U.pointsToConnect[0],U.pointsToConnect[1],[],0,void 0,{checkReachability:!0,maxLength:Y});try{let ee=0;while(!J.solved&&!J.failed&&ee++<3000)J.step(),yield;if(J.solved)L.push({connection:U,escapes:j,escapeCopper:X,scene:K,layer:O,length:Ar(J.result),maxLength:Y})}finally{J.cancel()}}if(L.sort((H,V)=>H.length-V.length),!L.length)return null;h.set(T.name,L)}let p=new o8n,m=(T,N)=>p.firstConflict(T,N,_-0.00000001),A=new vZ,g=new Map,f=new Map,y=new Map,x=0,C=(T,N)=>{let D=T.id<N.id?`${T.id},${N.id}`:`${N.id},${T.id}`,L=y.get(D);if(L!==void 0)return L;let H=(T.trace.route[0].width+N.trace.route[0].width)/2+_,V=T.layer===N.layer&&A.firstConflict(T.trace.route,N.trace.route,H-0.00000001)||m(T.escapeCopper,N.copper)||m(N.escapeCopper,T.copper);return y.set(D,!V),!V},b=(T)=>{let N=T.connection.name,D=JSON.stringify([T.escapes.map((V)=>V.route),T.trace.route]),L=f.get(N);if(!L)f.set(N,L=new Set);if(L.has(D))return;L.add(D);let H=g.get(N);if(!H)g.set(N,H=[]);if(H.push(T),H.length>48)H.splice(8,1)},I=()=>{if(c.connections.some((L)=>!g.get(L.name)?.length))return;let T=0,N,D=(L,H)=>{if(++T>4000)return;if(!H.length){N=L;return}H.sort((V,O)=>V.length-O.length);for(let V of H[0]){let O=H.slice(1).map((U)=>U.filter((j)=>C(V,j)));if(O.some((U)=>!U.length))continue;if(D([...L,V],O),N)return}};return D([],c.connections.map((L)=>[...g.get(L.name)].reverse())),N},v=new Map,P=[...c.connections].sort((T,N)=>h.get(T.name).length-h.get(N.name).length),M=new Map,B=()=>{let T=[...v.values()],N=[...s,...T.flatMap((L)=>L.escapes)],D=c.connections.map((L)=>v.get(L.name)?.connection??h.get(L.name)[0].connection);return{native:o,pending:{...c,connections:D,traces:[...o.traces??[],...N,...i]},escapes:N,retained:i,traces:T.map((L)=>L.trace)}};for(let T=0;P.length&&T<1200;T++){let N=P.shift(),D=h.get(N.name),L=M.get(N.name)??0;M.set(N.name,L+1),v.delete(N.name);let H=[...v.values()],V=H.flatMap((U)=>U.copper),O;for(let U=0;U<Math.min(D.length,4);U++){let j=D[(L*4+U)%D.length],{scene:Y,connection:X,layer:K}=j;if(n&&O){let[ee,se]=X.pointsToConnect,ne=H.filter((re)=>m(j.escapeCopper,re.copper)).length;if(Math.hypot(ee.x-se.x,ee.y-se.y)+100*ne>O.score+0.0000001)continue}if(!u.has(K)){let ee=new ost(Y);u.set(K,ee),d.set(K,new Float32Array(ee.cellCount))}let J=new al(Y,X.pointsToConnect[0],X.pointsToConnect[1],V,10+T,d.get(K),{checkReachability:!0,maxLength:j.maxLength,paretoLength:Number.isFinite(j.maxLength)});try{let ee=0;while(!J.solved&&!J.failed&&ee++<3000)J.step(),yield;if(J.solved){let se=n8n(o,N,J.result,K),ne=[...j.escapeCopper,...Jr(se)],re=H.filter((ie)=>m(ne,ie.copper)),Z=Ar(se.route)+re.length*100,te={...j,id:x++,trace:se,copper:ne,hits:re,score:Z};if(!n)b(te);if(!O||Z<O.score)O=te}}finally{J.cancel()}}if(!O){P.push(N);continue}for(let U of O.hits){let j=m(O.copper,U.copper);if(j){let[Y,X]=j;u.get(Y.layer)?.penalizeIntersection(d.get(Y.layer),Y.a,Y.b,X.a,X.b,Y.radius+X.radius+_,!0)}if(v.delete(U.connection.name),!P.some((Y)=>Y.name===U.connection.name))P.push(c.connections.find((Y)=>Y.name===U.connection.name))}if(v.set(N.name,O),n&&v.size>=c.connections.length-1)return B();if(!n&&T%8===0&&v.size>=c.connections.length-3){let U=I();if(U){for(let j of U)v.set(j.connection.name,j);P.length=0}}yield}return v.size===c.connections.length?B():null}function*VJr(e,t,n,o,r){let i=new Set(e.differentialPairs?.flatMap((p)=>p.connectionNames)),s=new Set(e.buses?.flatMap((p)=>p.connectionNames)),a=new Map;for(let p of t.buses??[]){let m=new Set(t.connections.filter((A)=>p.connectionNames.includes(A.name)).map((A)=>A.pointsToConnect[0].layer));for(let A of m)a.set(A,(a.get(A)??0)+1)}let c=[...a.values()].some((p)=>p>1),l=n.filter((p)=>i.has(p.connection_name)),h=new Map(t.connections.map((p)=>[p.name,p.pointsToConnect[0].layer])),d=new Map(e.connections.map((p)=>[p.name,Uue(e,p)])),u=e.connections.reduce((p,m)=>({x:p.x+m.pointsToConnect[1].x-m.pointsToConnect[0].x,y:p.y+m.pointsToConnect[1].y-m.pointsToConnect[0].y}),{x:0,y:0}),_=Math.abs(u.x)>Math.abs(u.y);for(let p of t8n(t,e.buses?.some((m)=>m.maxLength!==void 0)?d:o,!0)){if(!p){yield;continue}if(MS(t,p).some((M)=>s.has(M.connectionNames[0])&&(M.separatedExteriorLengthMm??0)>0.05*Ar(p.find((B)=>B.connection_name===M.connectionNames[0]).route)))continue;let m={...e,connections:e.connections.filter((M)=>!i.has(M.name)),traces:[...e.traces??[],...l,...p]},A=yield*FJr(m,Yue(m,h),d,_);if(!A)continue;let g=[...l,...A.traces],f={...e,connections:A.connections,buses:e.buses?.some((M)=>M.maxLength!==void 0)?e.buses.map((M)=>({...M,connectionNames:M.connectionNames.filter((B)=>A.connections.some((T)=>T.name===B))})).filter((M)=>M.connectionNames.length):[],differentialPairs:[],traces:[...e.traces??[],...g,...p]},y=new Map(f.connections.map((M)=>[M.name,Rb(e,M)])),x=VY(f,f.connections,sa(f),[],y,void 0,d,()=>!1,!0,!0),C;try{let M=x.next(),B=0,T=0,N=0;while(!M.done&&B++<300000){if(N=Math.max(N,M.value.length),e.buses?.some((D)=>D.maxLength!==void 0)&&B>60000&&N<f.connections.length-3)break;if(M.value.length>=Math.max(1,f.connections.length-(e.buses?.some((D)=>D.maxLength!==void 0)?4:2))&&(!C||M.value.length>C.traces.length))T=B,C={native:e,pending:structuredClone(f),escapes:g,retained:p,traces:M.value};if(C&&!c)break;if(M.value.length===f.connections.length)break;if(C&&B-T>=(e.buses?.some((D)=>D.maxLength!==void 0)?12000:60000))break;yield,M=x.next()}if(M.done&&M.value)C={native:e,pending:f,escapes:g,retained:p,traces:M.value}}finally{x.return(null)}if(!C)continue;if(e.buses?.some((M)=>M.maxLength!==void 0)&&C.traces.length<C.pending.connections.length){let M=yield*kJr(C.pending,C.traces,d,{maxNodes:256});if(M)C={...C,traces:M}}if(C.retained.length+C.traces.length<e.connections.length){let M=yield*zJr(C);if(C=(yield*P2n(C,M,!0))??void 0,!C)continue}if(C.retained.length+C.traces.length<e.connections.length){let M=yield*OJr(C);if(C=(yield*P2n(C,M))??void 0,!C)continue}let b=[...C.retained,...C.traces];if(b.length!==e.connections.length)continue;let I={...e,connections:e.connections.map((M)=>{let B=b.find((T)=>T.connection_name===M.name);return{...M,pointsToConnect:[B.route[0],B.route.at(-1)]}}),traces:[...e.traces??[],...C.escapes]},v=sa(I);for(let M=0;M<3;M++){for(let B=0;B<b.length;B++){let T=b[B];if(T.coupledSection)continue;let N=T.route[0].width,D=T.route[0].layer,L=I.connections.find((H)=>H.name===T.connection_name);b[B]={...T,route:Hf(T.route,new Mi(I,L,N,[...v,...b.flatMap(Jr)])).map((H)=>({...H,route_type:"wire",layer:D,width:N}))}}b=Mk(I,b),yield}let P=Nf.forRefinement(I,b,r);try{while(!P.solved&&!P.failed)P.step(),yield;if(P.solved)return{input:I,traces:P.traces,escapes:C.escapes}}finally{if(!P.solved&&!P.failed)P.tryFinalAcceptance()}}return null}function nde(e,t,n){let o=new Set([t.name,t.source_trace_id,n.pointId,n.pcb_port_id].filter((s)=>!!s)),r=n.layers??[n.layer];if(!e.obstacles.find((s)=>{if(!s.componentId||!s.connectedTo.some((u)=>o.has(u))||!s.layers.some((u)=>r.includes(u)))return!1;let a=-(s.ccwRotationDegrees??0)*Math.PI/180,c=n.x-s.center.x,l=n.y-s.center.y;if(s.shape==="circle")return Math.hypot(c,l)<=s.width/2+0.00000001;let h=c*Math.cos(a)-l*Math.sin(a),d=c*Math.sin(a)+l*Math.cos(a);return Math.abs(h)<=s.width/2+0.00000001&&Math.abs(d)<=s.height/2+0.00000001}))return!1;return!sa({...e,obstacles:[]}).some((s)=>r.includes(s.layer)&&s.owners.some((a)=>o.has(a))&&Nue(n,n,s)<=0.00000001)}function*Nrt(e,t,n,o,r,i=t.pointsToConnect[1],s){let a={...t,pointsToConnect:t.pointsToConnect.map((l,h)=>({...h?i:l,layer:r}))},c=new al(new Mi(e,a,o,n),a.pointsToConnect[0],a.pointsToConnect[1],[],0,void 0,s?{bounds:s}:void 0);try{while(!c.solved&&!c.failed)c.step(),yield;return c.solved}finally{if(!c.solved&&!c.failed)c.cancel()}}function YJr(e,t,n){let o=t.pointsToConnect[n],r=new Set([t.name,t.source_trace_id,o.pcb_port_id,o.pointId].filter(Boolean)),i=e.obstacles.filter((c)=>c.componentId&&c.connectedTo.some((l)=>r.has(l))).sort((c,l)=>Fn(c.center,o)-Fn(l.center,o))[0];if(!i)return;let a=e.obstacles.filter((c)=>c.componentId===i.componentId).map((c)=>{let l=(c.ccwRotationDegrees??0)*Math.PI/180;return{center:c.center,width:Math.abs(Math.cos(l))*c.width+Math.abs(Math.sin(l))*c.height,height:Math.abs(Math.sin(l))*c.width+Math.abs(Math.cos(l))*c.height}});return{minX:Math.min(...a.map((c)=>c.center.x-c.width/2)),maxX:Math.max(...a.map((c)=>c.center.x+c.width/2)),minY:Math.min(...a.map((c)=>c.center.y-c.height/2)),maxY:Math.max(...a.map((c)=>c.center.y+c.height/2))}}function*E2n(e,t,n,o,r,i){let s=[],a=e.minTraceToPadEdgeClearance??e.defaultObstacleMargin??0.075,c=3*(r+a);for(let l of[0,1]){let h=YJr(e,t,l);if(!h)continue;let d=n.pointsToConnect[l],u=r/2+(e.minBoardEdgeClearance??0),_={minX:Math.max(e.bounds.minX+u,h.minX-2*c),maxX:Math.min(e.bounds.maxX-u,h.maxX+2*c),minY:Math.max(e.bounds.minY+u,h.minY-2*c),maxY:Math.min(e.bounds.maxY-u,h.maxY+2*c)},p=[{...d,x:Math.max(_.minX,h.minX-c)},{...d,x:Math.min(_.maxX,h.maxX+c)},{...d,y:Math.max(_.minY,h.minY-c)},{...d,y:Math.min(_.maxY,h.maxY+c)}].filter((A)=>A.x<h.minX||A.x>h.maxX||A.y<h.minY||A.y>h.maxY).sort((A,g)=>Fn(d,A)-Fn(d,g)),m=!1;for(let A of i){let g={...n,pointsToConnect:[d,d]};for(let f of p)if(yield*Nrt(e,g,o,r,A,f,_)){m=!0;break}if(m)break}if(p.length&&!m)s.push(l)}return s}function*r8n(e,t,n,o,r,i){let s={connections:structuredClone(t.connections),escapes:[...o]},a=Rue(e.layerCount);for(let[c,l]of s.connections.entries()){let h=e.connections.find((v)=>v.name===l.name),d=s.escapes.filter((v)=>v.connection_name===l.name),u=d.map((v)=>v.route.find((P)=>P.route_type==="via"));if(!h||d.length!==2||u.some((v)=>!v)||h.pointsToConnect.some((v)=>!nde(e,h,v)))continue;let _=(r.get(l.name)??[l.pointsToConnect[0].layer]).filter((v)=>v!=="top"&&a.includes(v));if(!_.length)continue;let p=l.nominalTraceWidth??l.width??e.minTraceWidth,m={...t,connections:s.connections,traces:[...e.traces??[],...s.escapes,...n]},A=sa(m),g=[],f=0;for(let v of _)if(yield*Nrt(m,l,A,p,v))f++;else g.push(v);if(i?.set(l.name,_.filter((v)=>!g.includes(v))),f>=Math.min(2,_.length))continue;let y=!1,x=yield*E2n(m,h,l,A,p,g);if(!x.length&&f===0)x.push(0,1);if(!x.length)continue;let C={...e,connections:[h],traces:[...e.traces??[],...s.escapes.filter((v)=>v.connection_name!==l.name),...n]},b=x.map((v)=>[u[v]]),I=new Set([JSON.stringify(l.pointsToConnect.map(({x:v,y:P})=>[v,P]))]);for(let v=0;v<16&&b.length;v++){let P=b.shift(),M={...C,obstacles:[...C.obstacles,...P.map((U)=>({shape:"circle",center:{x:U.x,y:U.y},width:0.000001,height:0.000001,layers:a,connectedTo:[]}))]},B;try{B=hat(M,{targetLayers:new Map([[l.name,l.pointsToConnect[0].layer]]),viaDiameter:Math.max(...u.map((U)=>U.via_diameter??e.minViaPadDiameter??0.6)),viaHoleDiameter:Math.max(...u.map((U)=>U.via_hole_diameter??e.minViaHoleDiameter??0.3)),traceWidth:Math.max(...d.flatMap((U)=>U.route.flatMap((j)=>j.route_type==="wire"?[j.width]:[]))),clearance:e.minTraceToPadEdgeClearance??e.defaultObstacleMargin??0.075,holeToHoleClearance:e.minViaHoleEdgeToViaHoleEdgeClearance,boardEdgeClearance:e.minBoardEdgeClearance,allowBlindAndBuriedVias:e.allowBlindAndBuriedVias??!1})}catch{yield;continue}yield;let T={...l,pointsToConnect:B.connections[0].pointsToConnect},N=JSON.stringify(T.pointsToConnect.map(({x:U,y:j})=>[U,j]));if(I.has(N))continue;I.add(N);let D=B.traces.map((U)=>({...U,source_trace_id:h.source_trace_id??l.name})),L={...m,traces:[...C.traces,...D]},H=sa(L),V=0,O=[];for(let U of _)if(yield*Nrt(L,T,H,p,U))V++,O.push(U);if(y=V>f,y){i?.set(l.name,O),s.connections[c]=T,s.escapes=[...s.escapes.filter((U)=>U.connection_name!==l.name),...D];break}for(let U of yield*E2n(L,h,T,H,p,g)){let j=T.pointsToConnect[U];if(!P.some((Y)=>Fn(Y,j)<0.00000001))b.push([...P,j])}}}return s}function*GJr(e,t,n,o,r){let i=new Set(t.buses?.flatMap((A)=>A.connectionNames)),s=new Set(t.differentialPairs?.flatMap((A)=>A.connectionNames)),a=new Set([...i,...s]),c=new Map(t.connections.map((A)=>[A.name,Rb(t,A)])),l=new Map,h=new WeakMap,d=0,u=sa(t),_=t.buses?.some((A)=>A.maxLength!==void 0),p=_?new Map(e.connections.map((A)=>[A.name,Uue(e,A)])):o,m=t8n(t,p);for(let A of m){if(!A){yield;continue}let g=structuredClone(t);for(let L of g.connections){let H=A.find((V)=>V.connection_name===L.name);if(H)for(let V of L.pointsToConnect)V.layer=H.route[0].layer}let f={...g,connections:g.connections.filter((L)=>a.has(L.name))},y=f.connections.filter((L)=>!s.has(L.name)),x=!0,C=A.flatMap(Jr),b=new Map;for(let L of y){let H=[];for(let V of _?p.get(L.name):[L.pointsToConnect[0].layer]){let O=JSON.stringify([L.name,V,A.filter((j)=>j.route[0].layer===V).map((j)=>{if(!h.has(j))h.set(j,d++);return h.get(j)})]),U=l.get(O);if(U===void 0){let j={...L,pointsToConnect:L.pointsToConnect.map((X)=>({...X,layer:V}))},Y=new al(new Mi(f,j,c.get(L.name),[...u,...C]),j.pointsToConnect[0],j.pointsToConnect[1],[],0,void 0,_?{checkReachability:!0,maxLength:vy(f,L.name)}:void 0);try{let X=0;while(!Y.solved&&!Y.failed&&X++<4000)Y.step(),yield;if(Y.solved||Y.failed)U=Y.solved,l.set(O,U)}finally{Y.cancel()}}if(U!==!1)H.push(V)}if(!H.length){x=!1;break}b.set(L.name,H)}if(!x)continue;let I=VY(f,y,sa(g),A,c,void 0,_?b:new Map,()=>!_,!0),v=I.next(),P=0;try{while(!v.done&&P++<(_?300000:16000))yield,v=I.next()}finally{if(!v.done)I.return(null)}if(!v.done||!v.value)continue;let M=v.value,B=!0,T=!1;if(_){let L=Nf.forRefinement(f,M,r);try{while(!L.solved&&!L.failed)L.step(),yield;if(L.solved)M=L.traces,T=!0}finally{if(!L.solved&&!L.failed)L.tryFinalAcceptance()}}for(let L of T?[]:g.buses??[]){let H=new Set(L.connectionNames),V={...g,connections:g.connections.filter((U)=>H.has(U.name)),buses:[L],differentialPairs:g.differentialPairs?.filter((U)=>U.connectionNames.every((j)=>H.has(j))),traces:[...g.traces??[],...M.filter((U)=>!H.has(U.connection_name))]},O=Nf.forRefinement(V,M.filter((U)=>H.has(U.connection_name)),r);try{while(!O.solved&&!O.failed)O.step(),yield;if(!O.solved){B=!1;break}M=[...M.filter((U)=>!H.has(U.connection_name)),...O.traces]}finally{if(!O.solved&&!O.failed)O.tryFinalAcceptance()}}if(!B)continue;let N={...g,connections:g.connections.filter((L)=>!a.has(L.name)),buses:[],differentialPairs:[]},D={connections:N.connections,escapes:n};for(let L=0;L<2;L++){if(L){let O=new Map(o);if(D=yield*r8n(e,N,M,n,o,O),N.connections.some((U)=>O.get(U.name)?.length===0)||D.escapes.every((U,j)=>U===n[j]))break}let H={...N,connections:D.connections,traces:[...e.traces??[],...D.escapes,...M]},V=new Nf(H,{...r,maxSearchIterations:Math.min(r.maxSearchIterations??200000,200000)},o);try{while(!V.solved&&!V.failed)V.step(),yield;if(!V.solved)continue;let O=[...M,...V.traces];return{escapes:D.escapes,traces:O,input:{...g,connections:g.connections.map((U)=>{let j=O.find((Y)=>Y.connection_name===U.name);return{...U,pointsToConnect:[j.route[0],j.route.at(-1)]}}),traces:[...e.traces??[],...D.escapes]}}}finally{if(!V.solved&&!V.failed)V.tryFinalAcceptance()}}}return null}var M2n=(e)=>({...e,route:e.route.toReversed(),coupledSection:e.coupledSection?[e.route.length-1-e.coupledSection[1],e.route.length-1-e.coupledSection[0]]:void 0,curvedSegments:e.curvedSegments?.map((t)=>e.route.length-t)}),Rrt=(e,t)=>e.findIndex((n)=>Fn(n,t)<0.0000001),w2n=(e,t)=>{if(Rrt(e,t)>=0)return e;let n=e.findIndex((o,r)=>r>0&&Iy(t,e[r-1],o)<0.00000001);return n<0?e:[...e.slice(0,n),t,...e.slice(n)]};function*Qrt(e,t,n={}){let o=t,r=sa(e),i=e.minTraceToPadEdgeClearance??e.defaultObstacleMargin??0.075,s=2000;for(let a of e.differentialPairs??[])for(let c of[!1,!0])for(let l of[0,1]){if(s<=0)return o;let h=a.connectionNames.map((J)=>o.find((ee)=>ee.connection_name===J));if(h.some((J)=>!J?.coupledSection))continue;let d=h.map((J)=>c?M2n(J):J),u=d[l],_=d[1-l],[p,m]=u.coupledSection,[A,g]=_.coupledSection,f=_.route[0].width,y=f+(a.traceGap??i);if(m<1||g<1||Fn(u.route[m-1],u.route[m])<0.0000001)continue;let C=OY(e,f/2+i).find((J)=>by(u.route.at(-1),J.copper)&&by(_.route.at(-1),J.copper));if(!C||by(u.route[m],C.copper))continue;let b=m+1;while(b<u.route.length&&!by(u.route[b],C.copper))b++;if(b===u.route.length||u.curvedSegments?.some((J)=>J>=m&&J<=b))continue;let I=u.route[b-1],v=u.route[b],P=0,M=1;for(let J=0;J<40;J++){let ee=(P+M)/2;if(by({x:I.x+(v.x-I.x)*ee,y:I.y+(v.y-I.y)*ee},C.copper))M=ee;else P=ee}let B={x:I.x+(v.x-I.x)*M,y:I.y+(v.y-I.y)*M},T={x:(u.route[m-1].x+u.route[m].x)/2,y:(u.route[m-1].y+u.route[m].y)/2},N=W2([T,...u.route.slice(m,b),B]),D;try{D=[y,-y].map((J)=>wA(N,J))}catch{continue}let L=D.find((J)=>Iy(J[0],_.route[g-1],_.route[g])<0.0000001);if(!L)continue;let H=(J)=>({...J,route_type:"wire",width:f,layer:_.route[0].layer}),V=[{...u,route:N.map(H),curvedSegments:[],coupledSection:[0,N.length-1]},{..._,route:L.map(H),curvedSegments:[],coupledSection:[0,L.length-1]}],O=H3n(e,[...o.filter((J)=>!a.connectionNames.includes(J.connection_name)),...V]);N=O.find((J)=>J.connection_name===u.connection_name).route,L=O.find((J)=>J.connection_name===_.connection_name).route;let U=[...u.route.slice(0,m),...N,...u.route.slice(b)].map(H),j=e.connections.find((J)=>J.name===_.connection_name),Y=new Mi(e,j,f,[...r,...o.filter((J)=>J.connection_name!==u.connection_name).flatMap(Jr),...Jr({...u,route:U})]);if(!Y.pathVisible(L))continue;let X=g+1;while(X<_.route.length&&!by(_.route[X],C.copper))X++;if(X===_.route.length)continue;let K=!1;for(;X<_.route.length;X++){if(!by(_.route[X],C.copper))continue;let J=new al(Y,L.at(-1),_.route[X]);try{let te=0;while(!J.solved&&!J.failed&&te++<256&&s-- >0)J.step(),yield;if(!J.solved)continue}finally{J.cancel()}let ee=(te)=>({...te,route_type:"wire",layer:_.route[0].layer,width:f}),se=w2n(w2n(W2([..._.route.slice(0,g),...L,...Hf(J.result,Y).slice(1),..._.route.slice(X+1)]).map(ee),ee(_.route[A])),ee(L.at(-1)));if(!Y.pathVisible(se)||!Wc(se,f+i))continue;let ne=[{...u,route:U,curvedSegments:Vde(u,U),coupledSection:[p,m+N.length-1]},{..._,route:se,curvedSegments:Vde(_,se),coupledSection:[Rrt(se,_.route[A]),Rrt(se,L.at(-1))]}].map((te)=>c?M2n(te):te),re=o.filter((te)=>!a.connectionNames.includes(te.connection_name)),Z=[...r,...re.flatMap(Jr)];for(let te of[1.8,1.5,0.75,0.375,0.1875,0.09375,0.046875,0.0234375]){let ie=Mk(e,o.filter((de)=>a.connectionNames.includes(de.connection_name)).map((de)=>ne.find((me)=>me.connection_name===de.connection_name)),Z,te),ce=o.map((de)=>ie.find((me)=>me.connection_name===de.connection_name)??de);if(!xY(ie)||n.preserveMatching!==!1&&[...YS(e,ce),...Got(e,ce)].some((de)=>!de.withinLengthLimit||!de.aboveMinimumLength||de.toleranceMm!==null&&!de.matched)||wk(e,ce).some((de)=>!de.matched))continue;let ue=[...Z,...ie.flatMap(Jr)];if(ie.some((de)=>{let me=de.route[0].width;return!Wc(de.route,me+i)||!new Mi(e,e.connections.find((ge)=>ge.name===de.connection_name),me,ue).pathVisible(de.route)}))continue;o=ce,K=!0;break}if(K)break}}return o}function UJr(e){let t=new Set(e.buses?.flatMap((o)=>o.connectionNames));return(rst({...e,connections:e.connections.filter((o)=>t.has(o.name))})??[]).map((o)=>{let r=o.differentialPairs?.[0];if(!r)return 0;let i=r.connectionNames.map((h)=>o.connections.find((d)=>d.name===h)),s=[0,1].map((h)=>({x:(i[0].pointsToConnect[h].x+i[1].pointsToConnect[h].x)/2,y:(i[0].pointsToConnect[h].y+i[1].pointsToConnect[h].y)/2})),a=Math.abs(s[1].x-s[0].x),c=Math.abs(s[1].y-s[0].y),l=Rb(e,i[0])+(r.traceGap??e.minTraceToPadEdgeClearance??0.075);return Math.min(a,c)<=4*l?3:0})}function*B2n(e,t,n){let o=Nf.forRefinement(e,t,n);try{while(!o.solved&&!o.failed)o.step(),yield;return o.solved?o.traces:null}finally{if(!o.solved&&!o.failed)o.tryFinalAcceptance()}}function*WJr(e,t,n,o){let r=new Map(t.connections.map((U)=>[U.name,U.pointsToConnect[0].layer])),i=[0,2].map((U)=>Vue(e,Yue(e,r),U)),s=e.connections.map((U,j)=>({...U,pointsToConnect:[i[0].connections[j].pointsToConnect[0],i[1].connections[j].pointsToConnect[1]]})),a=Gue(e,i.flatMap((U,j)=>U.traces.filter((Y)=>{let K=e.connections.find((ee)=>ee.name===Y.connection_name).pointsToConnect[j],J=Y.route[0];return J.route_type==="wire"&&Math.hypot(J.x-K.x,J.y-K.y)<0.00000001}))),c={...e,connections:s,traces:[...e.traces??[],...a]},l=(c.differentialPairs??[]).filter((U)=>!c.buses?.some((j)=>U.connectionNames.some((Y)=>j.connectionNames.includes(Y)))),h=new Set(l.flatMap((U)=>U.connectionNames)),d={...c,connections:c.connections.filter((U)=>!h.has(U.name)),differentialPairs:c.differentialPairs?.filter((U)=>!U.connectionNames.some((j)=>h.has(j)))},u=yield*mY(L3n(d,n,UJr(d)),60000);if(!u)return null;let _=d.minTraceToPadEdgeClearance??d.defaultObstacleMargin??0.075,p=OY(d,Math.max(...u.transforms.map((U)=>U.envelope/2))+_),m=u.transforms.filter((U)=>p.some((j)=>by(U.center[0],j.copper))),A=new Set(m.flatMap((U)=>[U.connection.name,...U.approaches.map((j)=>j.name)])),g=m.flatMap((U)=>U.rails);u.local={...u.local,connections:u.local.connections.filter((U)=>!A.has(U.name)),traces:[...(u.local.traces??[]).filter((U)=>!m.some((j)=>U.connection_name===j.connection.name)),...g],buses:u.local.buses?.map((U)=>({...U,connectionNames:U.connectionNames.filter((j)=>!A.has(j))}))},u.transforms=u.transforms.filter((U)=>!m.includes(U)),u.copper=sa(u.local);let f=VY(u.local,u.local.connections,u.copper,[],u.widths,void 0,n,()=>!1,!0),y=new Set(d.connections.map((U)=>U.name)),x=new Set(d.buses?.flatMap((U)=>U.connectionNames)),C=new WeakMap,b=new Set,I=0,v=null,P=f.next(),M=0;try{while(!P.done&&M++<200000){let U=P.value,j=u.local.connections.filter((Y)=>!U.some((X)=>X.connection_name===Y.name));if(j.length<=3&&j.every((Y)=>y.has(Y.name)&&x.has(Y.name))){let Y=P.value.map((X)=>{if(!C.has(X))C.set(X,I++);return C.get(X)}).join(",");if(!b.has(Y)&&b.size<24){if(b.add(Y),v=yield*mY(Kot(u,[...P.value,...g],{allowPartial:!0}),12000),v)break}}yield,P=f.next()}if(P.done&&P.value)v=yield*mY(Kot(u,[...P.value,...g]),12000)}finally{if(!P.done)f.return(null)}if(!v)return null;let B=yield*QJr(e,d,v,a);if(!B)return null;let T={...c,connections:c.connections.map((U)=>B.input.connections.find((j)=>j.name===U.name)??U),traces:B.input.traces},N=B.traces;for(let U of N)for(let j of T.connections.find((Y)=>Y.name===U.connection_name).pointsToConnect)j.layer=U.route[0].route_type==="wire"?U.route[0].layer:j.layer;for(let U of l){let j=T.connections.filter((K)=>U.connectionNames.includes(K.name)),Y=[...new Set([j[0].pointsToConnect[0].layer,...(n.get(j[0].name)??[]).filter((K)=>j.every((J)=>n.get(J.name)?.includes(K)))])].filter((K)=>K!=="top"),X=null;for(let K of Y){for(let J of j)for(let ee of J.pointsToConnect)ee.layer=K;for(let J=0;J<6&&!X;J++)X=yield*mY(zk(T,U,[...sa(T),...N.flatMap(Jr)],{copper:[],penalty:0,variant:J}),12000);if(X)break}if(!X)return null;N=[...N,...X]}let D=yield*z3n({...u,input:T,transforms:[]},N);if(!D)return null;let L=yield*B2n(T,D,o);if(!L)return null;let H=yield*Qrt(T,L,{preserveMatching:!1});if(MS(T,H).some((U)=>!U.matched))return null;let V=yield*B2n(T,H,o);if(!V||MS(T,V).some((U)=>!U.matched))return null;let O=new Map(YS(T,L).map((U)=>[U.busId,Math.max(...U.lengths.map((j)=>j.totalLengthMm??1/0))]));if(YS(T,V).some((U)=>Math.max(...U.lengths.map((j)=>j.totalLengthMm??1/0))>O.get(U.busId)+0.000001))return null;return{input:T,traces:V,escapes:B.escapes}}function XJr(e,t){let n=[...t],o=sa(e);for(let r=0;r<n.length;r++){let i=n[r];if(!i.coupledSection)continue;let[s,a]=i.coupledSection,c=i.route[0],l=new Mi(e,e.connections.find((m)=>m.name===i.connection_name),c.width,[...o,...n.flatMap(Jr)]),h=OY(e,c.width+(e.differentialPairs?.find((m)=>m.connectionNames.includes(i.connection_name))?.traceGap??0.1)/2+(e.minTraceToPadEdgeClearance??e.defaultObstacleMargin??0.075)),d=(m,A)=>{let g=h.find((y)=>by(i.route[m===0?0:i.route.length-1],y.copper));return(i.curvedSegments??[]).some((y)=>y>m&&y<=A&&(!g||!by(i.route[y-1],g.copper)||!by(i.route[y],g.copper)))?Hf(i.route.slice(m,A+1),l):i.route.slice(m,A+1)},u=d(0,s),_=d(a,i.route.length-1),p=[...u.slice(0,-1),...i.route.slice(s,a+1),..._.slice(1)].map((m)=>({...m,route_type:"wire",layer:c.layer,width:c.width}));n[r]={...i,route:p,curvedSegments:Vde(i,p),coupledSection:[u.length-1,u.length+a-s-1]}}return n}var i8n=class extends U3n{input;options;phase="resolve_layers";traces=[];failureCode=null;acceptedTraces;envelopeOptimization;*optimizeEnvelope(){if(!this.options.smoothTuning)return;let e=V2(this.acceptedTraces),t=performance.now();this.stats={...this.stats,envelopeOptimization:{beforeAreaMm2:e.areaMm2,afterAreaMm2:e.areaMm2,milliseconds:0}};let n,o=!1,r=this.acceptedTraces;try{for(let i of["conservative","coordinated","flexible","guarded"]){if(i!=="conservative"&&V2(this.acceptedTraces).areaMm2<=V2(r).areaMm2*0.95)break;if(i==="flexible"&&o)continue;if(i==="guarded"&&!o)continue;let s=i==="conservative"?this.acceptedTraces:r;for(let a=0;a<(i==="guarded"?1:2);a++){let c=s,l=!1,h=!1,d=V2(c),u=GAn(this.input,c);if(!u)return;let _=u.carriers.map((m)=>Tue(u.input,m)),p=yield*q3n(u.input,u.carriers,i);if(p===u.carriers)break;for(let m of[1,0.999,0.99,0.95,0.9,0.75,0.5,0.25,0.1]){let A=p.map((x,C)=>({...x,route:x.route.map((b,I)=>({...b,x:u.carriers[C].route[I].x+(b.x-u.carriers[C].route[I].x)*m,y:u.carriers[C].route[I].y+(b.y-u.carriers[C].route[I].y)*m}))}));if(A.some((x,C)=>!_[C](x.route))){l=!0;continue}let g=u.join(A),f=V2(g);if(!Number.isFinite(f.areaMm2)||f.areaMm2>=d.areaMm2-0.000001||i==="conservative"&&(f.minX<d.minX-0.00000001||f.maxX>d.maxX+0.00000001||f.minY<d.minY-0.00000001||f.maxY>d.maxY+0.00000001))continue;let y=Nf.forValidation(u.input,A,this.options);try{while(!y.solved&&!y.failed)y.step(),yield;if(!y.solved||MS(u.input,A).some((x)=>!x.matched))continue;if(s=g,f.areaMm2<V2(this.acceptedTraces).areaMm2-0.000001)h=!0,this.acceptedTraces=structuredClone(g),this.stats={...this.stats,envelopeOptimization:{beforeAreaMm2:e.areaMm2,afterAreaMm2:f.areaMm2,milliseconds:performance.now()-t}};break}finally{if(!y.solved&&!y.failed)y.tryFinalAcceptance()}}if(s===c){if(i!=="conservative"&&a===0&&l)o=!0;break}if(i!=="conservative"&&!h)break;if(i!=="conservative"&&d.areaMm2-V2(s).areaMm2<d.areaMm2*0.00001)break}if(i==="conservative")r=this.acceptedTraces}if(this.input.allowedLayers?.length&&this.input.allowedLayers.every((i)=>i!=="top"&&i!=="bottom")&&TYr(this.input,this.acceptedTraces)){let i=GAn(this.input,this.acceptedTraces);if(i){n=performance.now(),this.stats={...this.stats,envelopeOptimization:{...this.stats.envelopeOptimization,cohortBeforeAreaMm2:V2(this.acceptedTraces).areaMm2}};for(let s of DYr(i.input,i.carriers,this.options)){if(s){let a=i.join(s),c=V2(a).areaMm2;if(c<V2(this.acceptedTraces).areaMm2-0.000001&&MS(this.input,a).every((l)=>l.matched)){let l=Nf.forValidation(i.input,s,this.options);try{while(!l.solved&&!l.failed)l.step(),yield;if(!l.solved)continue}finally{if(!l.solved&&!l.failed)l.tryFinalAcceptance()}this.acceptedTraces=structuredClone(a),this.stats={...this.stats,envelopeOptimization:{...this.stats.envelopeOptimization,beforeAreaMm2:e.areaMm2,afterAreaMm2:c,milliseconds:performance.now()-t}}}}yield}}}}finally{this.stats={...this.stats,envelopeOptimization:{...this.stats.envelopeOptimization,milliseconds:performance.now()-t,...n===void 0?{}:{cohortMilliseconds:performance.now()-n}}}}}finishAccepted(e){let t=this.envelopeOptimization;this.envelopeOptimization=void 0;try{t?.return()}catch(n){this.stats={...this.stats,optimizationCleanupError:String(n)}}this.traces=structuredClone(this.acceptedTraces),this.solved=!0,this.failed=!1,this.error=null,this.failureCode=null,this.phase="solved",this.progress=1,this.stats={...this.stats,optimizationStoppedEarly:e}}sharedPackages;backwardPackages;child;escapes=[];attempt=0;completedLanes=[];remainingInput;followingInput;siteRematch;packageCoupling;terminalLayers=new Map;constructor(e,t={}){super();this.input=structuredClone(e),this.options={smoothTuning:!0,denseSearch:!0,...t},this.MAX_ITERATIONS=(t.maxSearchIterations??200000)*Math.max(1,e.layerCount)}getConstructorParams(){return[this.input,this.options]}getOutput(){if(!this.solved)throw Error(this.error??"Bus lane pipeline is not solved");return{...this.input,traces:[...this.input.traces??[],...this.traces]}}tryFinalAcceptance(){if(this.solved)return;if(this.acceptedTraces){this.finishAccepted(!0);return}this.sharedPackages?.return(null),this.sharedPackages=void 0,this.backwardPackages?.return(null),this.backwardPackages=void 0,this.packageCoupling?.return([]),this.packageCoupling=void 0,this.siteRematch?.return({connections:[],escapes:[]}),this.siteRematch=void 0,this.child?.tryFinalAcceptance(),this.failureCode="search_budget_exhausted",this.traces=[]}childOptions(e=!1){let t=Math.max(1,this.MAX_ITERATIONS-this.iterations),n=e?Math.min(200000,Math.floor(t/4)):0;return{...this.options,maxSearchIterations:this.options.maxSearchIterations??Math.max(1,t-n)}}*finishPackageCoupling(e,t){let n=yield*Qrt(e,t);if(MS(e,n).every((r)=>r.matched))return n;if(n=yield*Qrt(e,XJr(e,n),{preserveMatching:!1}),MS(e,n).some((r)=>!r.matched))throw Error("Pair approaches still separate outside native package fanouts");if(e.buses?.some((r)=>r.maxLength!==void 0)){let r=yield*bYr(e,n,this.escapes,this.options);if(r)return this.escapes=r.escapes,r.traces}let o=Nf.forRefinement(e,n,this.options);try{while(!o.solved&&!o.failed)o.step(),yield;if(!o.solved)throw Error(o.error??"Package approach length matching failed");let r=new Map(YS(e,t).map((i)=>[i.busId,Math.max(...i.lengths.map((s)=>s.totalLengthMm??Number.POSITIVE_INFINITY))]));if(YS(e,o.traces).some((i)=>Math.max(...i.lengths.map((s)=>s.totalLengthMm??Number.POSITIVE_INFINITY))>r.get(i.busId)+0.000001))throw Error("Package refinement increased the bus length target");if(MS(e,o.traces).some((i)=>!i.matched))throw Error("Package approach matching separated the pair");return o.traces}finally{if(!o.solved&&!o.failed)o.tryFinalAcceptance()}}prepare(){if(this.options.fanout==="none"){this.child=new Nf(this.input,this.options);return}let e=Rue(this.input.layerCount);if(this.input.allowedLayers?.some((C)=>!e.includes(C)))throw Error("Allowed signal layer is not in the physical stack");let t=e.filter((C)=>!this.input.allowedLayers||this.input.allowedLayers.includes(C));if(!t.length)throw Error("No allowed signal layers");let n=new Set(this.input.connections.map((C)=>C.name));for(let C of this.input.buses??[])if(C.connectionNames.some((b)=>!n.has(b)))throw Error("Unknown bus member");let o=this.input.connections.map((C)=>new Set([C.name]));for(let C of[...(this.input.differentialPairs??[]).map((b)=>b.connectionNames)]){let b=o.filter((v)=>C.some((P)=>v.has(P)));if(C.some((v)=>!b.some((P)=>P.has(v))))throw Error("Unknown bus or differential pair member");let I=new Set(b.flatMap((v)=>[...v]));for(let v of b)o.splice(o.indexOf(v),1);o.push(I)}let r=Math.ceil(this.input.connections.length/t.length),i=this.attempt===0&&(this.input.buses??[]).every((C)=>C.connectionNames.length<=r);for(let C of i?this.input.buses??[]:[]){let b=o.filter((M)=>C.connectionNames.some((B)=>M.has(B))),I=new Set(b.flatMap((M)=>[...M]));if(I.size>r)continue;let v=(this.input.buses??[]).filter((M)=>M.connectionNames.some((B)=>I.has(B))),P=this.input.connections.filter((M)=>I.has(M.name));if(!t.some((M)=>v.every((B)=>!B.allowedLayers||B.allowedLayers.includes(M))&&P.every((B)=>B.pointsToConnect.every((T)=>(T.layers??[T.layer]).includes(M)||nde(this.input,B,T)))))continue;for(let M of b)o.splice(o.indexOf(M),1);o.push(I)}o.sort((C,b)=>b.size-C.size);let s=new Map(t.map((C)=>[C,0])),a=new Map;for(let C of o){let b=(this.input.buses??[]).filter((L)=>L.connectionNames.some((H)=>C.has(H))),I=this.input.connections.filter((L)=>C.has(L.name)),v=t.filter((L)=>b.every((H)=>!H.allowedLayers||H.allowedLayers.includes(L))&&I.every((H)=>H.pointsToConnect.every((V)=>(V.layers??[V.layer]).includes(L)||nde(this.input,H,V))));if(!v.length)throw Error("Bus/pair has no common allowed signal layer; existing fanout handoffs cannot be dogboned again");let P=b.flatMap((L)=>[L.preferredLayer,...L.preferredLayers??[]]).filter((L)=>!!L),M=(L)=>I.flatMap((H)=>H.pointsToConnect).filter((H)=>!(H.layers??[H.layer]).includes(L)).length,B=(L)=>P.includes(L)?P.indexOf(L):P.length,T=new Map(v.map((L)=>[L,M(L)+this.input.obstacles.filter((H)=>H.componentId&&H.layers.includes(L)).length/8])),N=new Map(v.map((L)=>{let H=v.filter((V)=>B(V)===B(L)&&T.get(V)===T.get(L));return[L,(H.indexOf(L)-this.attempt%H.length+H.length)%H.length]}));v.sort((L,H)=>{let V=T.get(L)-T.get(H),O=(U)=>{let j=(X,K,J)=>(K.x-X.x)*(J.y-X.y)-(K.y-X.y)*(J.x-X.x),Y=0;for(let X of I)for(let K of this.input.connections){if(a.get(K.name)!==U)continue;let[J,ee]=X.pointsToConnect,[se,ne]=K.pointsToConnect;if(j(J,ee,se)*j(J,ee,ne)<0&&j(se,ne,J)*j(se,ne,ee)<0)Y++}return Y*(this.attempt===1?0:4)+s.get(U)};return(C.size>2?B(L)-B(H)||V||O(L)-O(H):V||4*(B(L)-B(H))+O(L)-O(H))||N.get(L)-N.get(H)});let D=v[0];for(let L of C)a.set(L,D);s.set(D,s.get(D)+C.size)}let c=this.input.connections.map((C)=>(this.input.buses??[]).find((b)=>b.connectionNames.includes(C.name))?.traceWidth??C.nominalTraceWidth??C.width??this.input.minTraceWidth),l=Vue(this.input,{targetLayers:a,viaDiameter:this.input.minViaPadDiameter??0.6,viaHoleDiameter:this.input.minViaHoleDiameter??0.3,traceWidth:Math.max(this.input.minTraceWidth,...c),clearance:this.input.minTraceToPadEdgeClearance??this.input.defaultObstacleMargin??0.075,boardEdgeClearance:this.input.minBoardEdgeClearance,holeToHoleClearance:this.input.minViaHoleEdgeToViaHoleEdgeClearance,allowBlindAndBuriedVias:this.input.allowBlindAndBuriedVias??!1},this.attempt);this.escapes=l.traces.map((C)=>({...C,source_trace_id:this.input.connections.find((b)=>b.name===C.connection_name)?.source_trace_id??C.connection_name}));let h=new Map;for(let C of this.input.connections){if(o.some((v)=>v.size>2&&v.has(C.name)))continue;let b=this.escapes.filter((v)=>v.connection_name===C.name).flatMap((v)=>v.route.filter((P)=>P.route_type==="via"));if(b.length!==2)continue;let I=t.filter((v)=>(this.input.buses??[]).every((P)=>!P.connectionNames.includes(C.name)||!P.allowedLayers||P.allowedLayers.includes(v))&&b.every((P)=>v!==P.from_layer&&(P.layers??e.slice(Math.min(e.indexOf(P.from_layer),e.indexOf(P.to_layer)),Math.max(e.indexOf(P.from_layer),e.indexOf(P.to_layer))+1)).includes(v)));if(I.length>1)h.set(C.name,I)}this.terminalLayers=h;let d={...this.input,connections:l.connections,traces:[...this.input.traces??[],...this.escapes]},u=new Set(d.buses?.flatMap((C)=>C.connectionNames)),_=(d.buses??[]).some((C)=>new Set(d.connections.filter((b)=>C.connectionNames.includes(b.name)).map((b)=>b.pointsToConnect[0].layer)).size>1),p=new Map;for(let C of d.differentialPairs??[]){let b=d.connections.find((I)=>I.name===C.connectionNames[0]).pointsToConnect[0].layer;p.set(b,(p.get(b)??0)+1)}let m=[...p.values()].some((C)=>C>1),A=new Set([...u,...(d.differentialPairs??[]).filter((C)=>!m||C.connectionNames.some((b)=>u.has(b))).flatMap((C)=>C.connectionNames)]),g=d.connections.filter((C)=>A.has(C.name)),f=d.connections.filter((C)=>!A.has(C.name)),y=d.connections.filter((C)=>u.has(C.name)).reduce((C,b)=>({x:C.x+b.pointsToConnect[1].x-b.pointsToConnect[0].x,y:C.y+b.pointsToConnect[1].y-b.pointsToConnect[0].y}),{x:0,y:0});if(!_&&this.attempt===0&&m&&(d.buses?.length??0)>1&&this.options.smoothTuning&&this.options.denseSearch&&(this.input.buses?.some((C)=>C.maxLength!==void 0)||Math.abs(y.x)>Math.abs(y.y)||mk({...this.input,connections:this.input.connections.filter((C)=>u.has(C.name))}))){let C=t.length===2&&!this.input.allowBlindAndBuriedVias&&this.escapes.length===2*this.input.connections.length&&mk({...this.input,connections:this.input.connections.filter((b)=>u.has(b.name))})&&this.input.connections.every((b)=>b.pointsToConnect.length===2&&b.pointsToConnect.every((I)=>nde(this.input,b,I)));this.sharedPackages=(C?VJr:GJr)(this.input,d,this.escapes,h,this.childOptions());return}if(!_&&this.attempt===0&&this.options.smoothTuning&&this.options.denseSearch&&Math.abs(y.y)>=Math.abs(y.x)&&mk({...this.input,connections:this.input.connections.filter((C)=>u.has(C.name))})&&this.input.connections.every((C)=>C.pointsToConnect.length===2&&C.pointsToConnect.every((b)=>nde(this.input,C,b)))){this.backwardPackages=WJr(this.input,d,h,this.childOptions());return}let x=!_&&(this.attempt>0||Math.abs(y.x)>Math.abs(y.y))&&mk({...this.input,connections:this.input.connections.filter((C)=>u.has(C.name))});if(g.length&&f.length&&!x){if(this.remainingInput={...d,connections:f,buses:[],differentialPairs:(d.differentialPairs??[]).filter((C)=>C.connectionNames.every((b)=>!A.has(b)))},m){let C=new Set(this.remainingInput.differentialPairs?.flatMap((v)=>v.connectionNames)),b=f.filter((v)=>C.has(v.name)),I=f.filter((v)=>!C.has(v.name));if(b.length&&I.length)this.followingInput={...this.remainingInput,connections:I,differentialPairs:[]},this.remainingInput={...this.remainingInput,connections:b}}this.child=new Nf({...d,connections:g,differentialPairs:(d.differentialPairs??[]).filter((C)=>C.connectionNames.every((b)=>A.has(b)))},this.childOptions(!0),h)}else this.child=new Nf(d,this.childOptions(),h)}_step(){try{if(this.envelopeOptimization){if(this.envelopeOptimization.next().done)this.finishAccepted(!1);return}if(this.siteRematch){let e=this.siteRematch.next();if(this.phase="resolve_control_sites",this.stats={...this.stats,routingStage:"control_sites"},!e.done)return;this.escapes=e.value.escapes,this.child=new Nf({...this.remainingInput,connections:e.value.connections,traces:[...this.input.traces??[],...this.escapes,...this.completedLanes]},this.childOptions(),this.terminalLayers),this.remainingInput=void 0,this.siteRematch=void 0;return}if(!this.child&&!this.backwardPackages&&!this.sharedPackages)this.prepare();if(this.sharedPackages){this.phase="route_shared_layers";let e=this.sharedPackages.next();if(!e.done)return;if(this.sharedPackages=void 0,!e.value)throw Error("Shared-layer bus routing exhausted");this.escapes=e.value.escapes,this.child=Nf.forValidation(e.value.input,e.value.traces,this.childOptions())}if(this.backwardPackages){this.phase="route_backward_packages";let e=this.backwardPackages.next();if(!e.done)return;if(this.backwardPackages=void 0,!e.value)throw Error("Backward package bus routing failed");this.escapes=e.value.escapes,this.child=Nf.forRefinement(e.value.input,e.value.traces,this.childOptions())}if(this.child.step(),this.phase=`lanes_${this.child.phase}`,this.stats={...this.child.stats,layerAttempt:this.attempt,dogbones:this.escapes.length,routingStage:this.completedLanes.length?"remaining_signals":this.remainingInput?"matched_buses":"all_signals"},this.progress=this.child.progress,this.child.failed)throw Error(this.child.error??"Bus lanes failed");if(this.child.solved&&!this.remainingInput&&this.followingInput)this.remainingInput=this.followingInput,this.followingInput=void 0;if(this.child.solved&&this.remainingInput){this.completedLanes.push(...this.child.traces),this.siteRematch=r8n(this.input,this.remainingInput,this.completedLanes,this.escapes,this.terminalLayers);return}if(this.child.solved){let e=[...this.completedLanes,...this.child.traces],t=e;if(this.options.smoothTuning&&this.input.differentialPairs?.length){this.packageCoupling??=this.finishPackageCoupling({...this.input,traces:[...this.input.traces??[],...this.escapes],connections:this.input.connections.map((o)=>{let r=e.find((i)=>i.connection_name===o.name);return{...o,pointsToConnect:[r.route[0],r.route.at(-1)]}})},e);let n=this.packageCoupling.next();if(!n.done){this.phase="extend_package_coupling";return}t=n.value,this.packageCoupling=void 0}if(this.options.smoothTuning)t=Y3n({...this.input,traces:[...this.input.traces??[],...this.escapes],connections:this.input.connections.map((n)=>{let o=t.find((r)=>r.connection_name===n.name);return{...n,pointsToConnect:[o.route[0],o.route.at(-1)]}})},t);if(this.options.smoothTuning&&(this.input.allowedLayers?.length??this.input.layerCount)===2)t=NYr({...this.input,traces:[...this.input.traces??[],...this.escapes],connections:this.input.connections.map((n)=>{let o=t.find((r)=>r.connection_name===n.name);return{...n,pointsToConnect:[o.route[0],o.route.at(-1)]}})},t);if(this.traces=t.map((n)=>{let o=n.route.find((u)=>u.route_type==="wire").layer,r=this.escapes.filter((u)=>u.connection_name===n.connection_name).map((u)=>{let _=u.route.find((p)=>p.route_type==="via");return{...u,route:u.route.map((p)=>p.route_type==="via"?{...p,to_layer:o}:p.layer===_.to_layer?{...p,layer:o}:p)}}),i=(u,_)=>Math.hypot(u.x-_.x,u.y-_.y)<0.00000001,s=r.find((u)=>i(u.route.at(-1),n.route[0])),a=r.find((u)=>u!==s&&i(u.route.at(-1),n.route.at(-1))),c=s?.route,h=a?.route?.toReversed().map((u)=>u.route_type==="via"?{...u,from_layer:u.to_layer,to_layer:u.from_layer}:u)??[],d=(s?.route.length??1)-1;return{...n,coupledSection:n.coupledSection?.map((u)=>u+d),curvedSegments:n.curvedSegments?.map((u)=>u+d),route:[...c?.slice(0,-1)??[],...n.route,...h.slice(1)]}}),YS(this.input,this.traces).some((n)=>!n.withinLengthLimit||!n.aboveMinimumLength))throw Error("Final absolute bus length violation");this.acceptedTraces=structuredClone(this.traces),this.phase="optimize_envelope",this.envelopeOptimization=this.optimizeEnvelope()}}catch(e){if(this.acceptedTraces){this.stats={...this.stats,optimizationError:String(e)},this.finishAccepted(!0);return}if(this.sharedPackages?.return(null),this.sharedPackages=void 0,this.backwardPackages?.return(null),this.backwardPackages=void 0,this.packageCoupling?.return([]),this.packageCoupling=void 0,this.siteRematch?.return({connections:[],escapes:[]}),this.siteRematch=void 0,this.attempt++,this.options.fanout!=="none"&&this.attempt<this.input.layerCount){this.child=void 0,this.escapes=[],this.completedLanes=[],this.remainingInput=void 0,this.followingInput=void 0,this.phase="retry_layers";return}this.failureCode=this.child?.failureCode??"local_dogbone_failed",this.error=e instanceof Error?e.message:String(e),this.failed=!0,this.phase="failed",this.traces=[]}}visualize(){return this.child?.visualize()??{points:[],lines:[]}}};var jJr=class{constructor(e){this.input=e,this.solver=new i8n(e)}input;isRouting=!1;solver;cancelScheduledTick;listeners=[];on(e,t){this.listeners.push({event:e,callback:t})}emit(e){for(let t of this.listeners)if(t.event===e.type)t.callback(e)}start(){if(this.isRouting)return;this.isRouting=!0;let e=()=>{if(!this.isRouting)return;try{for(let t=0;t<200&&!this.solver.solved&&!this.solver.failed;t++)this.solver.step();if(this.solver.failed){this.isRouting=!1,this.emit({type:"error",error:Error(this.solver.error??"Bus lanes routing failed")});return}if(this.solver.solved){this.isRouting=!1,this.emit({type:"complete",traces:this.solver.traces});return}this.emit({type:"progress",steps:this.solver.iterations,progress:this.solver.progress,phase:this.solver.phase,debugGraphics:this.solver.visualize()}),this.scheduleTick(e)}catch(t){this.isRouting=!1,this.emit({type:"error",error:t instanceof Error?t:Error(String(t))})}};this.scheduleTick(e)}scheduleTick(e){if(typeof globalThis.setImmediate==="function"){let t=globalThis.setImmediate(e);this.cancelScheduledTick=()=>globalThis.clearImmediate(t)}else{let t=setTimeout(e,0);this.cancelScheduledTick=()=>clearTimeout(t)}}stop(){this.isRouting=!1,this.cancelScheduledTick?.()}solveSync(){if(this.solver.solve(),this.solver.failed)throw Error(this.solver.error??"Bus lanes routing failed");return this.solver.traces}},T2n=new WeakMap,s8n=(e)=>{let t=T2n.get(e);if(t)return t;let n={toLocal:n3.compose(n3.rotateDEG(-e.rotation),n3.translate(-e.x,-e.y)),toWorld:n3.compose(n3.translate(e.x,e.y),n3.rotateDEG(e.rotation))};return T2n.set(e,n),n},KJr=(e,t)=>{if(UC(e,t))return 0;let n=Number.POSITIVE_INFINITY;for(let o=0;o<t.length;o++){let r=t[o],i=t[(o+1)%t.length];n=Math.min(n,ia(e,r,i))}return n},a8n=(e,t,n)=>{let o={x:t,y:n};if(e.kind==="circle")return Math.max(Tl(o,e)-e.radius,0);if(e.kind==="segment")return Math.max(ia(o,{x:e.x1,y:e.y1},{x:e.x2,y:e.y2})-e.halfWidth,0);if(e.kind==="polygon")return KJr(o,e.points);let{toLocal:r}=s8n(e);return KOe(n3.applyToPoint(r,o),{center:{x:0,y:0},width:e.halfWidth*2,height:e.halfHeight*2})},$Jr=(e,t)=>{if(a8n(e,t.x,t.y)===0)return t;if(e.kind==="circle"){let i={x:e.x,y:e.y},s=qj(i,t);return{x:e.x+s.x*e.radius,y:e.y+s.y*e.radius}}if(e.kind==="segment"){let i=W1(t,{x:e.x1,y:e.y1},{x:e.x2,y:e.y2}),s=qj(i,t);return{x:i.x+s.x*e.halfWidth,y:i.y+s.y*e.halfWidth}}if(e.kind==="polygon"){let i=e.points[0],s=Number.POSITIVE_INFINITY;for(let a=0;a<e.points.length;a++){let c=e.points[a],l=e.points[(a+1)%e.points.length],h=W1(t,c,l),d=Tl(t,h);if(d<s)s=d,i=h}return i}let{toLocal:n,toWorld:o}=s8n(e),r=n3.applyToPoint(n,t);return n3.applyToPoint(o,{x:Dh(r.x,-e.halfWidth,e.halfWidth),y:Dh(r.y,-e.halfHeight,e.halfHeight)})},c8n=({start:e,end:t,trace:n,clearance:o=0})=>{let r=n.halfWidth+o,i=Ms([e,t]),s={minX:i.minX-r,minY:i.minY-r,maxX:i.maxX+r,maxY:i.maxY+r},a={x:n.x1,y:n.y1},c={x:n.x2,y:n.y2},l=Ms([a,c]);if(!yp(l,s))return!1;return Ix(e,t,a,c)<=r},l8n=(e,t)=>{let n=new Set(e),o=new Map,r=(s,a,c,l)=>{let h=`${s},${a}`,d=o.get(h)??[];d.push([c,l]),o.set(h,d)};for(let s of e){let a=s%t,c=Math.floor(s/t);if(c===0||!n.has(s-t))r(a,c,a+1,c);if(a===t-1||!n.has(s+1))r(a+1,c,a+1,c+1);if(!n.has(s+t))r(a+1,c+1,a,c+1);if(a===0||!n.has(s-1))r(a,c+1,a,c)}let i=[];for(let[s,a]of o)while(a.length>0){let[c,l]=s.split(",").map(Number),h=[[c,l]],d=a.pop();while(d[0]!==c||d[1]!==l){h.push(d);let _=o.get(`${d[0]},${d[1]}`);if(!_||_.length===0)break;d=_.pop()}let u=h.filter((_,p)=>{let m=h[(p+h.length-1)%h.length],A=h[(p+1)%h.length],g=m[0]===_[0]&&_[0]===A[0],f=m[1]===_[1]&&_[1]===A[1];return!g&&!f});if(u.length>=3)i.push(u)}return i},qJr=2,unt=9,pnt=(e,{nx:t,ny:n})=>{let o=e%t,r=Math.floor(e/t),i=[];if(o>0)i.push(e-1);if(o<t-1)i.push(e+1);if(r>0)i.push(e-t);if(r<n-1)i.push(e+t);return i},JJr=(e,t)=>{let n=new Uint8Array(t.labels.length*2);return(o,r)=>{let i=Math.min(o,r)*2+(Math.abs(o-r)===t.nx?1:0),s=n[i];if(s!==0)return s===1;let a=t.gridCells[o].center,c=t.gridCells[r].center,l=kz(a,c),h=a.y===c.y,d=h?{minX:l.x,minY:l.y-t.gridPitch/2,maxX:l.x,maxY:l.y+t.gridPitch/2}:{minX:l.x-t.gridPitch/2,minY:l.y,maxX:l.x+t.gridPitch/2,maxY:l.y},u=0,_=(1<<unt)-1;for(let p of t.traceBarriers){if(p.netIndex===e||p.maxX<d.minX||p.minX>d.maxX||p.maxY<d.minY||p.minY>d.maxY)continue;for(let m=0;m<unt;m++){let A=1<<m;if((u&A)!==0)continue;let g=-t.gridPitch/2+t.gridPitch*m/(unt-1),f=h?{x:l.x,y:l.y+g}:{x:l.x+g,y:l.y},y=W1(f,p.start,p.end);if(Jj(f,y)<=p.radiusSquared)u|=A}if(u===_)return n[i]=2,!1}return n[i]=1,!0}},mnt=(e,t)=>{let n=t.canCrossGridEdgeByNetIndex.get(e);if(!n)n=JJr(e,t),t.canCrossGridEdgeByNetIndex.set(e,n);return n},ZJr=({labeledLayer:e,insideCells:t,connectivitySeedNetIndices:n,traceBarriers:o,gridCells:r,traceClearance:i,gridPitch:s})=>{if(i===0)return;let{labels:a,nx:c,ny:l}=e,h=o.map((g)=>{let f=g.halfWidth+i,y={x:g.x1,y:g.y1},x={x:g.x2,y:g.y2},C=Ms([y,x]);return{netIndex:g.netIndex,start:y,end:x,radiusSquared:f**2,minX:C.minX-f,minY:C.minY-f,maxX:C.maxX+f,maxY:C.maxY+f}}),d={labels:a,nx:c,traceBarriers:h,gridCells:r,gridPitch:s,canCrossGridEdgeByNetIndex:new Map},u=new Uint8Array(a.length),_=[];for(let g=0;g<a.length;g++){if(t[g]!==1||n[g]!==a[g])continue;u[g]=1,_.push(g)}let p=0;while(p<_.length){let g=_[p++],f=a[g];for(let y of pnt(g,e)){if(t[y]!==1||u[y]===1||a[y]!==f||!mnt(f,d)(g,y))continue;u[y]=1,_.push(y)}}let m=new Uint8Array(a.length),A=[];for(let g=0;g<a.length;g++){if(t[g]!==1||a[g]<0||u[g]===1||m[g]===1)continue;let f=a[g],y=[],x=[g];m[g]=1;while(x.length>0){let I=x.pop();y.push(I);for(let v of pnt(I,e)){if(t[v]!==1||m[v]===1||u[v]===1||a[v]!==f||!mnt(f,d)(I,v))continue;m[v]=1,x.push(v)}}let C=new Map;for(let I of y)for(let v of pnt(I,e)){let P=a[v];if(u[v]!==1||P<0||P===f||!mnt(P,d)(I,v))continue;C.set(P,(C.get(P)??0)+1)}let b=[...C.entries()].sort((I,v)=>v[1]-I[1])[0]?.[0];if(b!==void 0)A.push({cells:y,netIndex:b});else A.push({cells:y,netIndex:-1})}for(let g of A)for(let f of g.cells)a[f]=g.netIndex},eZr=({labeledLayer:e,insideCells:t,visibleCells:n,traceBarriers:o,gridCells:r,traceClearance:i})=>{let{labels:s,nx:a,ny:c}=e,l=new Set;for(let u=0;u<s.length;u++)if(n[u]===1&&s[u]>=0)l.add(s[u]);let h=new Map;for(let u of l){let _=new Int8Array(s.length).fill(-1),p=[];for(let A=0;A<s.length;A++){if(n[A]!==1||s[A]!==u)continue;_[A]=0,p.push(A)}let m=0;while(m<p.length){let A=p[m++];if(_[A]>=qJr)continue;let g=A%a,f=Math.floor(A/a),y=[];if(g>0)y.push(A-1);if(g<a-1)y.push(A+1);if(f>0)y.push(A-a);if(f<c-1)y.push(A+a);let x=r[A].center;for(let C of y){if(t[C]!==1||_[C]>=0||n[C]===1&&s[C]!==u)continue;let b=r[C].center;if(o.some((v)=>v.netIndex!==u&&c8n({start:x,end:b,trace:v,clearance:i})))continue;_[C]=_[A]+1,p.push(C)}}h.set(u,_)}let d=[];for(let u=0;u<s.length;u++){let _=s[u];if(t[u]!==1||_<0||n[u]===1)continue;let p=h.get(_)?.[u]??-1,m=Array.from(h.entries()).map(([A,g])=>({netIndex:A,distance:g[u]})).filter((A)=>A.netIndex!==_&&A.distance>=0&&(p<0||A.distance<p)).sort((A,g)=>A.distance-g.distance)[0];if(m)d.push({cell:u,netIndex:m.netIndex})}for(let u of d)s[u.cell]=u.netIndex},tZr=(e)=>{let{bounds:t,boardOutline:n,gridPitch:o,regionNormalizationArea:r,traceClearance:i}=e,s=Math.max(1,Math.round((t.maxX-t.minX)/o)),a=Math.max(1,Math.round((t.maxY-t.minY)/o)),c=Math.max(1,Math.round(r/o**2)),l=jOe({rows:a,cols:s,xSpacing:o,ySpacing:o,offsetX:t.minX,offsetY:t.minY,yDirection:"up-is-negative",centered:!1}),h=[];for(let d of e.layers){let u=e.primitives.filter((C)=>C.layers.includes(d)&&e.nets[C.netIndex]?.isPower),_=e.primitives.filter((C)=>C.kind==="segment"&&C.isTrace===!0&&C.layers.includes(d)),p=new Int32Array(s*a).fill(-1),m=new Uint8Array(s*a),A=new Uint8Array(s*a),g=new Uint8Array(s*a),f=new Int32Array(s*a).fill(-1),y=o*Math.SQRT2/2;for(let{index:C,center:b}of l){if(!UC(b,n))continue;A[C]=1;let I=u.map((T)=>({primitive:T,distance:a8n(T,b.x,b.y)})).sort((T,N)=>T.distance-N.distance),v=I[0]?.primitive.netIndex??-1,P=I[0]?.distance??Number.POSITIVE_INFINITY,M=!1,B=!1;for(let T of I){if(T.distance===0){v=T.primitive.netIndex,P=T.distance,M=!0,B=!0;break}let N=$Jr(T.primitive,b);if(!_.some((L)=>L.netIndex!==T.primitive.netIndex&&c8n({start:b,end:N,trace:L,clearance:i}))){v=T.primitive.netIndex,P=T.distance,B=!0;break}}if(p[C]=v,M)m[C]=1;if(B)g[C]=1;if(B&&P<=y)f[C]=v}let x={layer:d,labels:p,nx:s,ny:a};eZr({labeledLayer:x,insideCells:A,visibleCells:g,traceBarriers:_,gridCells:l,traceClearance:i}),ZJr({labeledLayer:x,insideCells:A,connectivitySeedNetIndices:f,traceBarriers:_,gridCells:l,traceClearance:i,gridPitch:o}),oZr(x,m,c),h.push(x)}return{...e,labeledLayers:h}},h8n=(e)=>{let{labels:t,nx:n,ny:o}=e,r=new Int32Array(n*o).fill(-1),i=[],s=[];for(let a=0;a<n*o;a++){if(r[a]!==-1||t[a]<0)continue;let c=t[a],l=[];r[a]=i.length,s.push(a);while(s.length>0){let h=s.pop();l.push(h);let d=h%n,u=Math.floor(h/n),_=[];if(d>0)_.push(h-1);if(d<n-1)_.push(h+1);if(u>0)_.push(h-n);if(u<o-1)_.push(h+n);for(let p of _)if(r[p]===-1&&t[p]===c)r[p]=i.length,s.push(p)}i.push({netIndex:c,cells:l})}return{component:r,regions:i}},nZr=(e)=>h8n(e).regions,oZr=(e,t,n)=>{if(n<=1)return;while(!0){let{component:o,regions:r}=h8n(e),i=[];for(let s of r){if(s.cells.length>=n||s.cells.some((l)=>t[l]===1))continue;let a=new Map;for(let l of s.cells){let h=l%e.nx,d=Math.floor(l/e.nx),u=[];if(h>0)u.push(l-1);if(h<e.nx-1)u.push(l+1);if(d>0)u.push(l-e.nx);if(d<e.ny-1)u.push(l+e.nx);for(let _ of u){let p=o[_];if(p<0||r[p]===s)continue;a.set(p,(a.get(p)??0)+1)}}let c=[...a.entries()].map(([l,h])=>({region:r[l],sharedEdges:h})).filter((l)=>l.region.cells.length>s.cells.length).sort((l,h)=>h.sharedEdges-l.sharedEdges||h.region.cells.length-l.region.cells.length)[0]?.region;if(c)i.push({cells:s.cells,netIndex:c.netIndex})}if(i.length===0)return;for(let s of i)for(let a of s.cells)e.labels[a]=s.netIndex}},rZr=(e,t)=>{let n=new Set(e),o=[],r=[];while(n.size>0){let i=n.values().next().value,s=[];n.delete(i),r.push(i);while(r.length>0){let a=r.pop();s.push(a);let c=a%t,l=[a-t,a+t];if(c>0)l.push(a-1);if(c<t-1)l.push(a+1);for(let h of l){if(!n.has(h))continue;n.delete(h),r.push(h)}}o.push(s)}return o},D2n=(e)=>Math.abs(e.reduce((t,n,o)=>{let r=e[(o+1)%e.length];return t+n[0]*r[1]-r[0]*n[1]},0)/2),iZr=(e,t)=>{let n=[e],o=[];while(n.length>0){let r=n.pop(),i=l8n(r,t);if(i.length<=1){o.push(r);continue}let s=i.reduce((_,p,m)=>D2n(p)>D2n(i[_])?m:_,0),c=i.find((_,p)=>p!==s).map((_)=>_[1]),l=Math.round((Math.min(...c)+Math.max(...c))/2),h=r.filter((_)=>Math.floor(_/t)<l),d=r.filter((_)=>Math.floor(_/t)>=l),u=[h,d].filter((_)=>_.length>0).flatMap((_)=>rZr(_,t));if(u.length<2||u.some((_)=>_.length===r.length))throw Error("Unable to split an implicit copper region around a hole");n.push(...u)}return o},N2n=(e)=>e.replace(/[^a-zA-Z0-9_]+/g,"_"),sZr=(e)=>{let t=[],n=Math.max(1,Math.round(e.minRegionArea/e.gridPitch**2)),o=Wk.compose(Wk.translate(e.bounds.minX,e.bounds.minY),Wk.scale(e.gridPitch));for(let r of e.labeledLayers){let i=nZr(r);for(let[s,a]of i.entries()){let c=e.nets[a.netIndex];if(!c?.isPower||a.cells.length<n)continue;let l=iZr(a.cells,r.nx);for(let[h,d]of l.entries()){let u=l8n(d,r.nx);if(u.length!==1)throw Error("Implicit copper region part must have one outline");let p=u[0].map(([m,A])=>{let g=Wk.applyToPoint(o,{x:m,y:A});return{x:Dh(g.x,e.bounds.minX,e.bounds.maxX),y:Dh(g.y,e.bounds.minY,e.bounds.maxY)}});t.push({type:"pcb_copper_pour",pcb_copper_pour_id:`pcb_copper_pour_${N2n(r.layer)}_${N2n(c.sourceNet.source_net_id)}_${s}_${h}`,shape:"polygon",layer:r.layer,source_net_id:c.sourceNet.source_net_id,covered_with_solder_mask:e.coveredWithSolderMask,subcircuit_id:c.sourceNet.subcircuit_id,points:p})}}}return t},d8n=(e)=>e==="top"?"#c2453a":e==="bottom"?"#5b7fd8":"#c58b43",aZr=0.25,cZr=0.2,lZr=0,hZr=0.5,dZr=(e)=>{if(e.outline&&e.outline.length>=3)return e.outline;if(e.width===void 0||e.height===void 0)throw Error("pcb_board must provide an outline or width and height");let t=td({center:e.center,width:e.width,height:e.height});return[{x:t.minX,y:t.minY},{x:t.maxX,y:t.minY},{x:t.maxX,y:t.maxY},{x:t.minX,y:t.maxY}]},u8n=(e,t)=>{let{layers:n,netIndex:o,x:r,y:i,width:s,height:a,rotation:c}=t,l=Math.min(s,a)/2,d=(Math.max(s,a)-l*2)/2,u=Xk.compose(Xk.translate(r,i),Xk.rotateDEG(c+(a>s?90:0))),[_,p]=Xk.applyToPoints(u,[{x:-d,y:0},{x:d,y:0}]);e.push({kind:"segment",layers:n,netIndex:o,x1:_.x,y1:_.y,x2:p.x,y2:p.y,halfWidth:l})},uZr=(e,t,n)=>{let o=[t.layer];if(t.shape==="circle")e.push({kind:"circle",layers:o,netIndex:n,x:t.x,y:t.y,radius:t.radius});else if(t.shape==="rect"||t.shape==="rotated_rect")e.push({kind:"rect",layers:o,netIndex:n,x:t.x,y:t.y,halfWidth:t.width/2,halfHeight:t.height/2,rotation:t.shape==="rotated_rect"?t.ccw_rotation:0});else if(t.shape==="polygon")e.push({kind:"polygon",layers:o,netIndex:n,points:t.points});else u8n(e,{layers:o,netIndex:n,x:t.x,y:t.y,width:t.width,height:t.height,rotation:t.shape==="rotated_pill"?t.ccw_rotation:0})},pZr=(e,t,n)=>{let o=t.layers;if(t.shape==="circle")e.push({kind:"circle",layers:o,netIndex:n,x:t.x,y:t.y,radius:t.outer_diameter/2});else if(t.shape==="oval"||t.shape==="pill")u8n(e,{layers:o,netIndex:n,x:t.x,y:t.y,width:t.outer_width,height:t.outer_height,rotation:t.ccw_rotation});else if(t.shape==="hole_with_polygon_pad")e.push({kind:"polygon",layers:o,netIndex:n,points:t.pad_outline});else if("rect_pad_width"in t&&"rect_pad_height"in t){let r=t.shape==="circular_hole_with_rect_pad"?t.rect_ccw_rotation??0:t.shape==="rotated_pill_hole_with_rect_pad"?t.rect_ccw_rotation:0;e.push({kind:"rect",layers:o,netIndex:n,x:t.x,y:t.y,halfWidth:t.rect_pad_width/2,halfHeight:t.rect_pad_height/2,rotation:r})}},mZr=(e,t,n)=>{let o=null;for(let r of t.route){if(r.route_type!=="wire"){if(o=null,r.route_type==="via")e.push({kind:"circle",layers:[r.from_layer,r.to_layer],netIndex:n,x:r.x,y:r.y,radius:0.3});continue}if(o&&o.layer===r.layer)e.push({kind:"segment",layers:[r.layer],netIndex:n,isTrace:!0,x1:o.x,y1:o.y,x2:r.x,y2:r.y,halfWidth:r.width/2});o=r}},p8n=(e)=>{let t=e.gridPitch??aZr,n=e.traceClearance??cZr,o=e.edgeSimplificationTolerance??t,r=e.minRegionArea??lZr,i=e.regionNormalizationArea??hZr;if(!(t>0))throw Error("gridPitch must be greater than zero");if(!Number.isFinite(n)||n<0)throw Error("traceClearance must be zero or greater");if(!Number.isFinite(o)||o<0)throw Error("edgeSimplificationTolerance must be zero or greater");if(!(r>=0))throw Error("minRegionArea must be zero or greater");if(!(i>=0))throw Error("regionNormalizationArea must be zero or greater");let s=e.circuitJson.find((I)=>I.type==="pcb_board");if(!s)throw Error("No pcb_board found in Circuit JSON");let a=dZr(s),c=Ms(a),l=e.circuitJson.filter((I)=>I.type==="source_net"),h=l.map((I)=>({sourceNet:I,isPower:Boolean(I.is_power||I.is_ground||I.is_positive_voltage_source)})),d=new Map,u=new Map;for(let[I,v]of l.entries())if(d.set(v.source_net_id,I),v.subcircuit_connectivity_map_key)u.set(v.subcircuit_connectivity_map_key,I);let _=new Map,p=(I,v=I)=>{let P=_.get(I);if(P!==void 0)return P;let M=`source_net_implicit_${I.replace(/[^a-zA-Z0-9_]+/g,"_")}`,B=M,T=1;while(d.has(B))B=`${M}_${T++}`;let N={type:"source_net",source_net_id:B,name:v,member_source_group_ids:[],is_ground:!1,is_power:!1,is_positive_voltage_source:!1},D=h.length;return h.push({sourceNet:N,isPower:!1}),d.set(B,D),_.set(I,D),D},m=(I)=>{let v=I.subcircuit_connectivity_map_key;if(!v)return;let P=u.get(v);if(P!==void 0)return P;let M=p(`connectivity:${v}`,v);return u.set(v,M),M},A=q8(e.circuitJson),g=Object.values(A.netMap);for(let I of e.circuitJson){if(I.type==="source_trace"){g.push([I.source_trace_id,...I.connected_source_port_ids,...I.connected_source_net_ids]);continue}if(I.type==="pcb_port"){g.push([I.pcb_port_id,I.source_port_id]);continue}if(I.type==="pcb_smtpad"&&I.pcb_port_id){g.push([I.pcb_smtpad_id,I.pcb_port_id]);continue}if(I.type==="pcb_plated_hole"&&I.pcb_port_id){g.push([I.pcb_plated_hole_id,I.pcb_port_id]);continue}if(I.type==="pcb_trace"){let v=Array.from(new Set(I.route.flatMap((B)=>B.route_type==="wire"?[B.start_pcb_port_id,B.end_pcb_port_id].filter((T)=>Boolean(T)):[]))),P=I.source_net_id,M=[...P?[P]:[],...v.length>0?v:I.source_trace_id?[I.source_trace_id]:[]];if(M.length>0)g.push([I.pcb_trace_id,...M]);continue}if(I.type==="pcb_via"){let v=I,P=v.source_net_id??v.pcb_trace_id??v.source_trace_id;if(P)g.push([v.pcb_via_id,P])}}let f=new fx(fM(g)),y=new Map,x=(I)=>{let v=tz(I),P=f.getNetConnectedToId(v);if(P){let M=l.flatMap((N,D)=>f.areIdsConnected(v,N.source_net_id)?[D]:[]);if(M.length>1){let N=M.map((D)=>l[D].source_net_id);throw Error(`Circuit JSON connectivity assigns ${v} to multiple source nets: ${N.join(", ")}`)}if(M[0]!==void 0)return y.set(P,M[0]),M[0];let B=y.get(P);if(B!==void 0)return B;let T=m(I)??p(`connectivity-network:${P}`,P);return y.set(P,T),T}return m(I)},C=(I)=>{let v=I.source_net_id;if(v)return d.get(v)??p(`source-net-id:${v}`,v);let P=x(I);if(P!==void 0)return P;let M=tz(I);return p(`${I.type}:${M}`,M)},b=[];for(let I of e.circuitJson){if(I.type!=="pcb_smtpad"&&I.type!=="pcb_plated_hole"&&I.type!=="pcb_via"&&I.type!=="pcb_trace")continue;let v=C(I);if(v===void 0)continue;if(I.type==="pcb_smtpad")uZr(b,I,v);else if(I.type==="pcb_plated_hole")pZr(b,I,v);else if(I.type==="pcb_via"){let P=I;b.push({kind:"circle",layers:P.layers,netIndex:v,x:P.x,y:P.y,radius:P.outer_diameter/2})}else if(I.type==="pcb_trace")mZr(b,I,v)}return{bounds:c,boardOutline:a,layers:e.layers??["top","bottom"],nets:h,primitives:b,gridPitch:t,traceClearance:n,minRegionArea:r,regionNormalizationArea:i,coveredWithSolderMask:e.coveredWithSolderMask??!0}},Nk=(e,t)=>e.x===t.x&&e.y===t.y,_Zr=(e,t)=>{if(e.length<=2)return[...e];let n=new Uint8Array(e.length);n[0]=1,n[e.length-1]=1;let o=[[0,e.length-1]];while(o.length>0){let[r,i]=o.pop(),s=e[r],a=e[i],c=-1,l=t;for(let h=r+1;h<i;h++){let d=ia(e[h],s,a);if(d>l)l=d,c=h}if(c!==-1)n[c]=1,o.push([r,c],[c,i])}return e.filter((r,i)=>n[i]===1)},R2n=(e)=>{let t=0;for(let n=0;n<e.length;n++){let o=e[n],r=e[(n+1)%e.length];t+=o.x*r.y-r.x*o.y}return t/2},m8n=(e,t,n)=>(t.x-e.x)*(n.y-e.y)-(t.y-e.y)*(n.x-e.x),krt=(e,t)=>{if(e.length<=2)return[...e];let n=e.map((i,s)=>{if(s===0||s===e.length-1)return 0;return Math.sign(m8n(e[s-1],e[s],e[s+1]))}),o=[0];for(let i=1;i<e.length-1;i++){let s=n[i];if(s===0)continue;let a=s===n[i-1]||s===n[i+1],c=e[i-1],l=e[i],h=e[i+1],d=Math.min(Tl(l,c),Tl(h,l));if(a||d>t)o.push(i)}o.push(e.length-1);let r=[];for(let i=0;i<o.length-1;i++){let s=o[i],a=o[i+1],c=_Zr(e.slice(s,a+1),t);r.push(...i===0?c:c.slice(1))}return r},gZr=(e)=>{for(let t=0;t<e.length;t++){let n=(t+1)%e.length;for(let o=t+1;o<e.length;o++){let r=(o+1)%e.length;if(t===o||t===r||n===o||n===r)continue;if(dA(e[t],e[n],e[o],e[r]))return!1}}return!0},_8n=(e)=>{let t=e.filter((n,o)=>o===0||!Nk(n,e[o-1]));if(t.length>1&&Nk(t[0],t[t.length-1]))t.pop();return t},AZr=(e,t,n)=>{if(Nk(e,t)||Nk(e,n))return!1;let o=m8n(t,n,e);if(Math.abs(o)>0.000000001)return!1;return Qz(t,e,n)},fZr=(e,t)=>{let n=[];for(let o=0;o<e.length;o++){let r=e[o],i=e[(o+1)%e.length],s=i.x-r.x,a=i.y-r.y,c=t.filter((l)=>AZr(l,r,i)).map((l)=>({point:l,position:Math.abs(s)>=Math.abs(a)?(l.x-r.x)/s:(l.y-r.y)/a})).sort((l,h)=>l.position-h.position);n.push(r);for(let{point:l}of c)if(!Nk(n[n.length-1],l))n.push(l)}return n},g8n=(e,t)=>{if(t.length<3)return!1;let n=R2n(e),o=R2n(t);return n!==0&&o!==0&&Math.sign(n)===Math.sign(o)&&gZr(t)},yZr=(e,t)=>{let n=_8n(e);if(n.length<4||t<=0)return n;let o=[...n,n[0]],r=krt(o,t);if(Nk(r[0],r[r.length-1]))r.pop();if(!g8n(n,r))return n;return r},Lrt=(e)=>`${e.x},${e.y}`,xZr=(e,t)=>{let n=Lrt(e),o=Lrt(t);return n<o?`${n}|${o}`:`${o}|${n}`},Q2n=(e)=>e.map(Lrt).join("|"),CZr=(e)=>{let t=Q2n(e),n=[...e].reverse(),o=Q2n(n);return t<=o?{points:[...e],reversed:!1,key:t}:{points:n,reversed:!0,key:o}},bZr=(e)=>{let t=new Map;for(let[o,r]of e.entries())for(let i=0;i<r.length;i++){let s=xZr(r[i],r[(i+1)%r.length]),a=t.get(s)??[];a.push({polygonIndex:o,edgeIndex:i}),t.set(s,a)}let n=e.map((o,r)=>o.map(()=>`outer:${r}`));for(let o of t.values()){if(o.length!==2||o[0].polygonIndex===o[1].polygonIndex)continue;let r=o[0].polygonIndex,i=o[1].polygonIndex,s=r<i?`${r}:${i}`:`${i}:${r}`;for(let a of o)n[a.polygonIndex][a.edgeIndex]=`shared:${s}`}return n},IZr=(e,t,n)=>{let o=[e[t]],r=t;while(r!==n)o.push(e[(r+1)%e.length]),r=(r+1)%e.length;return o},vZr=(e,t)=>{let n=[];for(let o of e.chains){let r=t.get(o.arcKey),i=r.disabled?r.original:r.simplified,s=o.reversed?[...i].reverse():i;if(n.length===0)n.push(...s);else if(Nk(n[n.length-1],s[0]))n.push(...s.slice(1));else return[]}if(n.length>1&&Nk(n[0],n[n.length-1]))n.pop();return n},SZr=(e,t)=>{let n=e.map(_8n),o=n.flat(),r=n.map((l)=>fZr(l,o));if(t<=0||r.length===0)return r;let i=bZr(r),s=new Map,a=[];for(let[l,h]of r.entries()){if(h.length<4){a.push({original:h,mode:"fixed"});continue}let d=i[l],u=d.flatMap((p,m)=>d[(m+h.length-1)%h.length]===p?[]:[m]);if(u.length===0){if(d[0]?.startsWith("shared:"))a.push({original:h,mode:"fixed"});else a.push({original:h,mode:"standalone",simplified:yZr(h,t)});continue}let _=[];for(let p=0;p<u.length;p++){let m=u[p],A=u[(p+1)%u.length],g=IZr(h,m,A),f=d[m];if(f.startsWith("shared:")){let y=CZr(g),x=`${f}:${y.key}`;if(!s.has(x))s.set(x,{original:y.points,simplified:krt(y.points,t),disabled:!1});_.push({arcKey:x,reversed:y.reversed})}else{let y=`outer:${l}:${p}`;s.set(y,{original:g,simplified:krt(g,t),disabled:!1}),_.push({arcKey:y,reversed:!1})}}a.push({original:h,mode:"chains",chains:_})}let c=r;for(let l=0;l<=s.size;l++){c=a.map((u)=>{if(u.mode==="fixed")return u.original;if(u.mode==="standalone")return u.simplified;return vZr(u,s)});let h=c.flatMap((u,_)=>g8n(a[_].original,u)?[]:[_]);if(h.length===0)return c;let d=!1;for(let u of h){let _=a[u];if(_.mode!=="chains")continue;for(let p of _.chains){let m=s.get(p.arcKey);if(!m.disabled)m.disabled=!0,d=!0}}if(!d)return c.map((u,_)=>h.includes(_)?a[_].original:u)}return r},PZr="#555a66",EZr="red",A8n="blue",MZr="rgba(255, 0, 0, 0.5)",wZr="rgba(0, 0, 255, 0.5)",BZr=0.35,k2n=["#ed9148","#d93bd0","#b6df38","#438bd9","#e5485f","#43d16d","#8b48df","#e6b93f","#43ced2","#cf3d99"],TZr=(e,t)=>{let n=Number.parseInt(e.slice(1,3),16),o=Number.parseInt(e.slice(3,5),16),r=Number.parseInt(e.slice(5,7),16);return`rgba(${n}, ${o}, ${r}, ${t})`},f8n=(e)=>{let t=e.map((n)=>n==="top"?0:n==="bottom"?1:null).filter((n)=>n!==null);return`z${Array.from(new Set(t)).join(",")}`},DZr=(e)=>e.includes("top")?EZr:A8n,NZr=(e)=>e.includes("top")?MZr:wZr,RZr=(e,t,n)=>{let o=e.nets[t]?.sourceNet;return`${o?.name??o?.source_net_id??"unknown net"} ${n}`},QZr=(e)=>{let t={coordinateSystem:"cartesian",title:"Circuit JSON copper obstacles",points:[],rects:[],circles:[],lines:[{points:[...e.boardOutline,e.boardOutline[0]],strokeColor:PZr,strokeWidth:0.08,label:"PCB outline"}],polygons:[],texts:[]};for(let n of e.primitives){let o=DZr(n.layers),r=NZr(n.layers),i=f8n(n.layers),s=RZr(e,n.netIndex,n.kind);if(n.kind==="rect"){t.rects.push({center:{x:n.x,y:n.y},width:n.halfWidth*2,height:n.halfHeight*2,ccwRotationDegrees:n.rotation,fill:r,layer:i,label:s});continue}if(n.kind==="segment"){let c=n.layers.includes("top");t.lines.push({points:[{x:n.x1,y:n.y1},{x:n.x2,y:n.y2}],strokeColor:c?o:"rgba(0, 0, 255, 0.5)",strokeWidth:n.halfWidth*2,...c?{}:{strokeDash:[0.2,0.2]},layer:i,label:s});continue}if(n.kind==="polygon"){t.polygons.push({points:n.points,fill:r,stroke:o,strokeWidth:0.04,layer:i,label:s});continue}let a=n.layers.includes("top")&&n.layers.includes("bottom");t.circles.push({center:{x:n.x,y:n.y},radius:n.radius,fill:a?A8n:r,stroke:"none",layer:i,label:s})}return t},kZr=(e,t)=>({coordinateSystem:"cartesian",title:"Power-net copper pour polygons",points:[],rects:[],circles:[],lines:[],polygons:t.flatMap((n)=>{if(n.shape!=="polygon")return[];let o=e.nets.findIndex(({sourceNet:s})=>s.source_net_id===n.source_net_id),r=k2n[Math.max(0,o)%k2n.length],i=e.nets[o]?.sourceNet;return[{points:n.points,fill:TZr(r,BZr),stroke:r,strokeWidth:0.06,layer:f8n([n.layer]),label:`${i?.name??n.source_net_id??"power net"} ${n.layer} pour`}]}),texts:[]}),LZr=(e,t)=>({coordinateSystem:"cartesian",title:t.polygons?.length?t.title:e.title,polygons:[...t.polygons??[],...e.polygons??[]],rects:[...e.rects??[],...t.rects??[]],lines:[...e.lines??[],...t.lines??[]],circles:[...e.circles??[],...t.circles??[]],points:[...e.points??[],...t.points??[]],texts:[...e.texts??[],...t.texts??[]]}),HZr=class extends co{constructor(e){super();this.input=e}input;output;_step(){this.output=p8n(this.input),this.solved=!0}getOutput(){if(!this.output)throw Error("Circuit JSON has not been prepared");return this.output}},FZr=class extends co{constructor(e){super();this.input=e}input;output;_step(){this.output=tZr(this.input),this.stats={layers:this.output.labeledLayers.length,samples:this.output.labeledLayers.reduce((e,t)=>e+t.nx*t.ny,0)},this.solved=!0}getOutput(){if(!this.output)throw Error("Grid cells have not been assigned");return this.output}},zZr=class extends co{constructor(e){super();this.input=e}input;output;_step(){this.output=sZr(this.input),this.stats={polygons:this.output.length},this.solved=!0}getOutput(){if(!this.output)throw Error("Power polygons have not been traced");return this.output}visualize(){return{points:[],rects:[],circles:[],texts:[],lines:(this.output??[]).flatMap((e)=>{if(e.shape!=="polygon")return[];return[{points:[...e.points,e.points[0]],strokeColor:d8n(e.layer),strokeWidth:0.08,label:e.source_net_id}]})}}},OZr=class extends co{constructor(e){super();this.input=e}input;output;_step(){let e=0,t=0,n=[...this.input.pours],o=new Map;for(let[r,i]of this.input.pours.entries()){if(i.shape!=="polygon")continue;e+=i.points.length;let s=o.get(i.layer)??[];s.push(r),o.set(i.layer,s)}for(let r of o.values()){let i=SZr(r.map((s)=>{let a=this.input.pours[s];if(a.shape!=="polygon")return[];return a.points}),this.input.tolerance);for(let[s,a]of i.entries()){let c=r[s],l=this.input.pours[c];if(l.shape!=="polygon")continue;n[c]={...l,points:a},t+=a.length}}this.output=n,this.stats={polygons:this.output.length,inputPoints:e,outputPoints:t,pointsRemoved:e-t},this.solved=!0}getOutput(){if(!this.output)throw Error("Polygon edges have not been simplified");return this.output}visualize(){return{points:[],rects:[],circles:[],texts:[],lines:(this.output??[]).flatMap((e)=>{if(e.shape!=="polygon")return[];return[{points:[...e.points,e.points[0]],strokeColor:d8n(e.layer),strokeWidth:0.08,label:e.source_net_id}]})}}},VZr=class extends XC{initialPreparedProblem;pipelineDef=[xi("prepareCircuitJson",HZr,(e)=>[e.inputProblem]),xi("assignGridCells",FZr,(e)=>[e.getStageOutput("prepareCircuitJson")]),xi("tracePowerPolygons",zZr,(e)=>[e.getStageOutput("assignGridCells")]),xi("simplifyPolygonEdges",OZr,(e)=>{let t=e.getStageOutput("prepareCircuitJson");return[{pours:e.getStageOutput("tracePowerPolygons"),tolerance:e.inputProblem.edgeSimplificationTolerance??t.gridPitch}]})];getSolverName(){return"ImplicitCopperPourPipelineSolver"}getConstructorParams(){return[this.inputProblem]}getOutput(){return this.getStageOutput("simplifyPolygonEdges")??[]}visualize(){let e=this.getStageOutput("prepareCircuitJson")??(this.initialPreparedProblem??=p8n(this.inputProblem)),t=QZr(e),n=this.getStageOutput("simplifyPolygonEdges")??this.getStageOutput("tracePowerPolygons")??[];return LZr(t,kZr(e,n))}},{create:YZr,defineProperty:y8n,getOwnPropertyDescriptor:GZr,getOwnPropertyNames:x8n,getPrototypeOf:UZr}=Object,WZr=Object.prototype.hasOwnProperty,XZr=(e,t)=>function(){return t||(0,e[x8n(e)[0]])((t={exports:{}}).exports,t),t.exports},jZr=(e,t,n,o)=>{if(t&&typeof t==="object"||typeof t==="function"){for(let r of x8n(t))if(!WZr.call(e,r)&&r!==n)y8n(e,r,{get:()=>t[r],enumerable:!(o=GZr(t,r))||o.enumerable})}return e},KZr=(e,t,n)=>(n=e!=null?YZr(UZr(e)):{},jZr(t||!e||!e.__esModule?y8n(n,"default",{value:e,enumerable:!0}):n,e)),$Zr=XZr({"node_modules/svgson/dist/svgson.umd.js"(e,t){(function(n,o){typeof e==="object"&&typeof t<"u"?t.exports=o():typeof define==="function"&&define.amd?define(o):(n=typeof globalThis<"u"?globalThis:n||self,n.svgson=o())})(e,function(){var n=function(Y){return Y!=null&&(o(Y)||r(Y)||!!Y._isBuffer)};function o(Y){return!!Y.constructor&&typeof Y.constructor.isBuffer==="function"&&Y.constructor.isBuffer(Y)}function r(Y){return typeof Y.readFloatLE==="function"&&typeof Y.slice==="function"&&o(Y.slice(0,0))}var i=Object.prototype.toString,s=function(X){if(typeof X>"u")return"undefined";if(X===null)return"null";if(X===!0||X===!1||X instanceof Boolean)return"boolean";if(typeof X==="string"||X instanceof String)return"string";if(typeof X==="number"||X instanceof Number)return"number";if(typeof X==="function"||X instanceof Function)return"function";if(typeof Array.isArray<"u"&&Array.isArray(X))return"array";if(X instanceof RegExp)return"regexp";if(X instanceof Date)return"date";var K=i.call(X);if(K==="[object RegExp]")return"regexp";if(K==="[object Date]")return"date";if(K==="[object Arguments]")return"arguments";if(K==="[object Error]")return"error";if(n(X))return"buffer";if(K==="[object Set]")return"set";if(K==="[object WeakSet]")return"weakset";if(K==="[object Map]")return"map";if(K==="[object WeakMap]")return"weakmap";if(K==="[object Symbol]")return"symbol";if(K==="[object Int8Array]")return"int8array";if(K==="[object Uint8Array]")return"uint8array";if(K==="[object Uint8ClampedArray]")return"uint8clampedarray";if(K==="[object Int16Array]")return"int16array";if(K==="[object Uint16Array]")return"uint16array";if(K==="[object Int32Array]")return"int32array";if(K==="[object Uint32Array]")return"uint32array";if(K==="[object Float32Array]")return"float32array";if(K==="[object Float64Array]")return"float64array";return"object"};function a(Y,X){return X={exports:{}},Y(X,X.exports),X.exports}var c=a(function(Y){(function(){function X(K,J){if(typeof J!=="function")return K;var ee={};for(var se in K)if(Object.prototype.hasOwnProperty.call(K,se))ee[J(se,K[se])||se]=K[se];return ee}if(Y.exports)Y.exports=X;else window.rename=X})()}),l=function Y(X,K){var J=s(X);if(J!=="object"&&J!=="array")throw Error("expected an object");var ee=[];if(J==="object")X=c(X,K),ee={};for(var se in X)if(X.hasOwnProperty(se)){var ne=X[se];if(s(ne)==="object"||s(ne)==="array")ee[se]=Y(ne,K);else ee[se]=ne}return ee},h=a(function(Y){var X=Object.prototype.hasOwnProperty,K="~";function J(){}if(Object.create){if(J.prototype=Object.create(null),!new J().__proto__)K=!1}function ee(ne,re,Z){this.fn=ne,this.context=re,this.once=Z||!1}function se(){this._events=new J,this._eventsCount=0}se.prototype.eventNames=function(){var re=[],Z,te;if(this._eventsCount===0)return re;for(te in Z=this._events)if(X.call(Z,te))re.push(K?te.slice(1):te);if(Object.getOwnPropertySymbols)return re.concat(Object.getOwnPropertySymbols(Z));return re},se.prototype.listeners=function(re,Z){var te=K?K+re:re,ie=this._events[te];if(Z)return!!ie;if(!ie)return[];if(ie.fn)return[ie.fn];for(var ce=0,ue=ie.length,de=Array(ue);ce<ue;ce++)de[ce]=ie[ce].fn;return de},se.prototype.emit=function(re,Z,te,ie,ce,ue){var de=K?K+re:re;if(!this._events[de])return!1;var me=this._events[de],ge=arguments.length,xe,Ee;if(me.fn){if(me.once)this.removeListener(re,me.fn,void 0,!0);switch(ge){case 1:return me.fn.call(me.context),!0;case 2:return me.fn.call(me.context,Z),!0;case 3:return me.fn.call(me.context,Z,te),!0;case 4:return me.fn.call(me.context,Z,te,ie),!0;case 5:return me.fn.call(me.context,Z,te,ie,ce),!0;case 6:return me.fn.call(me.context,Z,te,ie,ce,ue),!0}for(Ee=1,xe=Array(ge-1);Ee<ge;Ee++)xe[Ee-1]=arguments[Ee];me.fn.apply(me.context,xe)}else{var Re=me.length,Me;for(Ee=0;Ee<Re;Ee++){if(me[Ee].once)this.removeListener(re,me[Ee].fn,void 0,!0);switch(ge){case 1:me[Ee].fn.call(me[Ee].context);break;case 2:me[Ee].fn.call(me[Ee].context,Z);break;case 3:me[Ee].fn.call(me[Ee].context,Z,te);break;case 4:me[Ee].fn.call(me[Ee].context,Z,te,ie);break;default:if(!xe)for(Me=1,xe=Array(ge-1);Me<ge;Me++)xe[Me-1]=arguments[Me];me[Ee].fn.apply(me[Ee].context,xe)}}}return!0},se.prototype.on=function(re,Z,te){var ie=new ee(Z,te||this),ce=K?K+re:re;if(!this._events[ce])this._events[ce]=ie,this._eventsCount++;else if(!this._events[ce].fn)this._events[ce].push(ie);else this._events[ce]=[this._events[ce],ie];return this},se.prototype.once=function(re,Z,te){var ie=new ee(Z,te||this,!0),ce=K?K+re:re;if(!this._events[ce])this._events[ce]=ie,this._eventsCount++;else if(!this._events[ce].fn)this._events[ce].push(ie);else this._events[ce]=[this._events[ce],ie];return this},se.prototype.removeListener=function(re,Z,te,ie){var ce=K?K+re:re;if(!this._events[ce])return this;if(!Z){if(--this._eventsCount===0)this._events=new J;else delete this._events[ce];return this}var ue=this._events[ce];if(ue.fn){if(ue.fn===Z&&(!ie||ue.once)&&(!te||ue.context===te))if(--this._eventsCount===0)this._events=new J;else delete this._events[ce]}else{for(var de=0,me=[],ge=ue.length;de<ge;de++)if(ue[de].fn!==Z||ie&&!ue[de].once||te&&ue[de].context!==te)me.push(ue[de]);if(me.length)this._events[ce]=me.length===1?me[0]:me;else if(--this._eventsCount===0)this._events=new J;else delete this._events[ce]}return this},se.prototype.removeAllListeners=function(re){var Z;if(re){if(Z=K?K+re:re,this._events[Z])if(--this._eventsCount===0)this._events=new J;else delete this._events[Z]}else this._events=new J,this._eventsCount=0;return this},se.prototype.off=se.prototype.removeListener,se.prototype.addListener=se.prototype.on,se.prototype.setMaxListeners=function(){return this},se.prefixed=K,se.EventEmitter=se,Y.exports=se});function d(Y,X,K){if(X in Y)Object.defineProperty(Y,X,{value:K,enumerable:!0,configurable:!0,writable:!0});else Y[X]=K;return Y}var u=function(){},_={data:"state-data",cdata:"state-cdata",tagBegin:"state-tag-begin",tagName:"state-tag-name",tagEnd:"state-tag-end",attributeNameStart:"state-attribute-name-start",attributeName:"state-attribute-name",attributeNameEnd:"state-attribute-name-end",attributeValueBegin:"state-attribute-value-begin",attributeValue:"state-attribute-value"},p={lt:"action-lt",gt:"action-gt",space:"action-space",equal:"action-equal",quote:"action-quote",slash:"action-slash",char:"action-char",error:"action-error"},m={text:"text",openTag:"open-tag",closeTag:"close-tag",attributeName:"attribute-name",attributeValue:"attribute-value"},A={" ":p.space,"\t":p.space,"\n":p.space,"\r":p.space,"<":p.lt,">":p.gt,'"':p.quote,"'":p.quote,"=":p.equal,"/":p.slash},g=function(X){return A[X]||p.char},f=function(X){var K,J,ee,se,ne,re,Z,te,ie,ce;X=Object.assign({debug:!1},X);var ue=new h,de=_.data,me="",ge="",xe="",Ee="",Re="",Me="",_e=function(Ne,Le){if(ge[0]==="?"||ge[0]==="!")return;var nt={type:Ne,value:Le};if(X.debug)console.log("emit:",nt);ue.emit("data",nt)};ue.stateMachine=(ce={},d(ce,_.data,(K={},d(K,p.lt,function(){if(me.trim())_e(m.text,me);ge="",Re=!1,de=_.tagBegin}),d(K,p.char,function(Se){me+=Se}),K)),d(ce,_.cdata,d({},p.char,function(Se){if(me+=Se,me.substr(-3)==="]]>")_e(m.text,me.slice(0,-3)),me="",de=_.data})),d(ce,_.tagBegin,(J={},d(J,p.space,u),d(J,p.char,function(Se){ge=Se,de=_.tagName}),d(J,p.slash,function(){ge="",Re=!0}),J)),d(ce,_.tagName,(ee={},d(ee,p.space,function(){if(Re)de=_.tagEnd;else de=_.attributeNameStart,_e(m.openTag,ge)}),d(ee,p.gt,function(){if(Re)_e(m.closeTag,ge);else _e(m.openTag,ge);me="",de=_.data}),d(ee,p.slash,function(){de=_.tagEnd,_e(m.openTag,ge)}),d(ee,p.char,function(Se){if(ge+=Se,ge==="![CDATA[")de=_.cdata,me="",ge=""}),ee)),d(ce,_.tagEnd,(se={},d(se,p.gt,function(){_e(m.closeTag,ge),me="",de=_.data}),d(se,p.char,u),se)),d(ce,_.attributeNameStart,(ne={},d(ne,p.char,function(Se){xe=Se,de=_.attributeName}),d(ne,p.gt,function(){me="",de=_.data}),d(ne,p.space,u),d(ne,p.slash,function(){Re=!0,de=_.tagEnd}),ne)),d(ce,_.attributeName,(re={},d(re,p.space,function(){de=_.attributeNameEnd}),d(re,p.equal,function(){_e(m.attributeName,xe),de=_.attributeValueBegin}),d(re,p.gt,function(){Ee="",_e(m.attributeName,xe),_e(m.attributeValue,Ee),me="",de=_.data}),d(re,p.slash,function(){Re=!0,Ee="",_e(m.attributeName,xe),_e(m.attributeValue,Ee),de=_.tagEnd}),d(re,p.char,function(Se){xe+=Se}),re)),d(ce,_.attributeNameEnd,(Z={},d(Z,p.space,u),d(Z,p.equal,function(){_e(m.attributeName,xe),de=_.attributeValueBegin}),d(Z,p.gt,function(){Ee="",_e(m.attributeName,xe),_e(m.attributeValue,Ee),me="",de=_.data}),d(Z,p.char,function(Se){Ee="",_e(m.attributeName,xe),_e(m.attributeValue,Ee),xe=Se,de=_.attributeName}),Z)),d(ce,_.attributeValueBegin,(te={},d(te,p.space,u),d(te,p.quote,function(Se){Me=Se,Ee="",de=_.attributeValue}),d(te,p.gt,function(){Ee="",_e(m.attributeValue,Ee),me="",de=_.data}),d(te,p.char,function(Se){Me="",Ee=Se,de=_.attributeValue}),te)),d(ce,_.attributeValue,(ie={},d(ie,p.space,function(Se){if(Me)Ee+=Se;else _e(m.attributeValue,Ee),de=_.attributeNameStart}),d(ie,p.quote,function(Se){if(Me===Se)_e(m.attributeValue,Ee),de=_.attributeNameStart;else Ee+=Se}),d(ie,p.gt,function(Se){if(Me)Ee+=Se;else _e(m.attributeValue,Ee),me="",de=_.data}),d(ie,p.slash,function(Se){if(Me)Ee+=Se;else _e(m.attributeValue,Ee),Re=!0,de=_.tagEnd}),d(ie,p.char,function(Se){Ee+=Se}),ie)),ce);var ye=function(Ne){if(X.debug)console.log(de,Ne);var Le=ue.stateMachine[de],nt=Le[g(Ne)]||Le[p.error]||Le[p.char];nt(Ne)};return ue.write=function(Se){var Ne=Se.length;for(var Le=0;Le<Ne;Le++)ye(Se[Le])},ue},y={State:_,Action:p,Type:m,create:f},x=y.Type,C={element:"element",text:"text"},b=function(X){return Object.assign({name:"",type:C.element,value:"",parent:null,attributes:{},children:[]},X)},I=function(X){X=Object.assign({stream:!1,parentNodes:!0,doneEvent:"done",tagPrefix:"tag:",emitTopLevelOnly:!1,debug:!1},X);var K=void 0,J=void 0,ee=void 0,se=void 0,ne=new h,re=function(te){switch(te.type){case x.openTag:if(ee===null)ee=J,ee.name=te.value;else{var ie=b({name:te.value,parent:ee});ee.children.push(ie),ee=ie}break;case x.closeTag:var ce=ee.parent;if(!X.parentNodes)ee.parent=null;if(ee.name!==te.value)break;if(X.stream&&ce===J)J.children=[],ee.parent=null;if(!X.emitTopLevelOnly||ce===J)ne.emit(X.tagPrefix+ee.name,ee),ne.emit("tag",ee.name,ee);if(ee===J)K.removeAllListeners("data"),ne.emit(X.doneEvent,ee),J=null;ee=ce;break;case x.text:if(ee)ee.children.push(b({type:C.text,value:te.value,parent:X.parentNodes?ee:null}));break;case x.attributeName:se=te.value,ee.attributes[se]="";break;case x.attributeValue:ee.attributes[se]=te.value;break}};return ne.reset=function(){K=y.create({debug:X.debug}),K.on("data",re),J=b(),ee=null,se="",ne.parse=K.write},ne.reset(),ne},v=function(X,K){K=Object.assign({},K,{stream:!1,tagPrefix:":"});var J=I(K),ee=void 0;return J.on("done",function(se){ee=se}),J.parse(X),ee},P={parseSync:v,create:I,NodeType:C},M=P.parseSync,B=function(X){var K=M("<root>".concat(X,"</root>"),{parentNodes:!1}),J=K.children&&K.children.length>0&&K.children.every(function(ee){return ee.name==="svg"});if(J)return K.children.length===1?K.children[0]:K.children;else throw Error("nothing to parse")},T=function(X){return l(X,function(K){if(!D(K))return N(K);return K})},N=function(X){return X.replace(/[-|:]([a-z])/gi,function(K,J){return J.toUpperCase()})},D=function(X){return/^(data|aria)(-\w+)/.test(X)},L=function(X){if(X){var K=String(X);return/[&<>]/.test(K)?"<![CDATA[".concat(K.replace(/]]>/,"]]]]><![CDATA[>"),"]]>"):K}return""},H=function(X){return String(X).replace(/&/g,"&amp;").replace(/'/g,"&apos;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")},V=function(X){var K=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},J=K.transformNode,ee=J===void 0?function(Z){return Z}:J,se=K.camelcase,ne=se===void 0?!1:se,re=function(te){var ie=ee(te);if(ne)ie=T(ie);return ie};return re(B(X))};function O(){for(var Y=arguments.length,X=Array(Y),K=0;K<Y;K++)X[K]=arguments[K];return new Promise(function(J,ee){try{var se=V.apply(void 0,X);J(se)}catch(ne){ee(ne)}})}var U=function Y(X){var K=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},J=K.transformAttr,ee=J===void 0?function(de,me,ge){return"".concat(de,'="').concat(ge(me),'"')}:J,se=K.transformNode,ne=se===void 0?function(de){return de}:se,re=K.selfClose,Z=re===void 0?!0:re;if(Array.isArray(X))return X.map(function(de){return Y(de,{transformAttr:ee,selfClose:Z,transformNode:ne})}).join("");var te=ne(X);if(te.type==="text")return L(te.value);var ie="";for(var ce in te.attributes){var ue=ee(ce,te.attributes[ce],H,te.name);ie+=ue?" ".concat(ue):""}return te.children&&te.children.length>0||!Z?"<".concat(te.name).concat(ie,">").concat(Y(te.children,{transformAttr:ee,transformNode:ne,selfClose:Z}),"</").concat(te.name,">"):"<".concat(te.name).concat(ie,"/>")},j=Object.assign({},{parse:O,parseSync:V,stringify:U});return j})}}),mu=class{MAX_ITERATIONS=1e5;solved=!1;failed=!1;iterations=0;progress=0;error=null;activeSubSolver;failedSubSolvers;timeToSolve;stats={};step(){if(this.solved)return;if(this.failed)return;this.iterations++;try{this._step()}catch(e){throw this.error=`${this.constructor.name} error: ${e}`,this.failed=!0,e}if(!this.solved&&this.iterations>this.MAX_ITERATIONS)this.tryFinalAcceptance();if(!this.solved&&this.iterations>this.MAX_ITERATIONS)this.error=`${this.constructor.name} ran out of iterations`,this.failed=!0;if("computeProgress"in this)this.progress=this.computeProgress()}_step(){}getConstructorParams(){throw Error("getConstructorParams not implemented")}solve(){let e=Date.now();while(!this.solved&&!this.failed)this.step();let t=Date.now();this.timeToSolve=t-e}visualize(){return{lines:[],points:[],rects:[],circles:[]}}tryFinalAcceptance(){}preview(){return{lines:[],points:[],rects:[],circles:[]}}};function Z4(e,t,n,o){let r=q9e(e,t,n),i=q9e(e,t,o),s=q9e(n,o,e),a=q9e(n,o,t);if(r!==i&&s!==a)return!0;if(r===0&&J9e(e,n,t))return!0;if(i===0&&J9e(e,o,t))return!0;if(s===0&&J9e(n,e,o))return!0;if(a===0&&J9e(n,t,o))return!0;return!1}function q9e(e,t,n){let o=(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y);if(o===0)return 0;return o>0?1:2}function J9e(e,t,n){return t.x<=Math.max(e.x,n.x)&&t.x>=Math.min(e.x,n.x)&&t.y<=Math.max(e.y,n.y)&&t.y>=Math.min(e.y,n.y)}function Z9e(e,t,n){let o=(n.x-t.x)**2+(n.y-t.y)**2;if(o===0)return k9(e,t);let r=((e.x-t.x)*(n.x-t.x)+(e.y-t.y)*(n.y-t.y))/o;r=Math.max(0,Math.min(1,r));let i={x:t.x+r*(n.x-t.x),y:t.y+r*(n.y-t.y)};return k9(e,i)}function k9(e,t){let n=e.x-t.x,o=e.y-t.y;return Math.sqrt(n*n+o*o)}function rP(e,t,n,o){let r=t.x-e.x,i=t.y-e.y,s=o.x-n.x,a=o.y-n.y,c=e.x-n.x,l=e.y-n.y,h=r*a-i*s;if(Math.abs(h)<0.0000000001)return null;let d=(l*s-c*a)/h,u=(r*l-i*c)/h,_=0.000000001;if(d>=-_&&d<=1+_&&u>=-_&&u<=1+_){let p=e.x+d*r,m=e.y+d*i;return{x:p,y:m}}return null}function qZr(e,t,n){let o=(c)=>c.x>=n.minX&&c.x<=n.maxX&&c.y>=n.minY&&c.y<=n.maxY;if(o(e)||o(t))return!0;let r={x:n.minX,y:n.minY},i={x:n.maxX,y:n.minY},s={x:n.minX,y:n.maxY},a={x:n.maxX,y:n.maxY};return Z4(e,t,r,i)||Z4(e,t,i,a)||Z4(e,t,a,s)||Z4(e,t,s,r)}function eve(e,t,n){return Math.max(t,Math.min(n,e))}function JZr(e,t,n){let o={x:n.minX,y:n.minY},r={x:n.maxX,y:n.minY},i={x:n.minX,y:n.maxY},s={x:n.maxX,y:n.maxY};if(Z4(e,t,o,r)||Z4(e,t,r,s)||Z4(e,t,s,i)||Z4(e,t,i,o))return 0;if(e.x>=n.minX&&e.x<=n.maxX&&e.y>=n.minY&&e.y<=n.maxY&&t.x>=n.minX&&t.x<=n.maxX&&t.y>=n.minY&&t.y<=n.maxY)return 0;let a=[Z9e(o,e,t),Z9e(r,e,t),Z9e(i,e,t),Z9e(s,e,t)];if(e.x>=n.minX&&e.x<=n.maxX&&e.y>=n.minY&&e.y<=n.maxY)return 0;if(t.x>=n.minX&&t.x<=n.maxX&&t.y>=n.minY&&t.y<=n.maxY)return 0;if(e.x<n.minX||e.x>n.maxX||e.y<n.minY||e.y>n.maxY){let c=eve(e.x,n.minX,n.maxX),l=eve(e.y,n.minY,n.maxY);a.push(k9(e,{x:c,y:l}))}if(t.x<n.minX||t.x>n.maxX||t.y<n.minY||t.y>n.maxY){let c=eve(t.x,n.minX,n.maxX),l=eve(t.y,n.minY,n.maxY);a.push(k9(t,{x:c,y:l}))}return Math.min(...a)}function ZZr(e,t,n){let o=n.width/2,r=n.height/2,i={minX:n.center.x-o,maxX:n.center.x+o,minY:n.center.y-r,maxY:n.center.y+r};return JZr(e,t,i)}var eei=(e,t)=>{let n=e.maxX<t.minX?t.minX-e.maxX:t.maxX<e.minX?e.minX-t.maxX:0,o=e.maxY<t.minY?t.minY-e.maxY:t.maxY<e.minY?e.minY-t.maxY:0;return Math.sqrt(n*n+o*o)},C8n=(e,t)=>{let n=Math.max(e.minX,t.minX),o=Math.max(e.minY,t.minY),r=Math.min(e.maxX,t.maxX),i=Math.min(e.maxY,t.maxY);if(n>r||o>i)return null;return{minX:n,minY:o,maxX:r,maxY:i}},tei=(e)=>{let{center:t,width:n,height:o}=e,r=n/2,i=o/2;return{minX:t.x-r,maxX:t.x+r,minY:t.y-i,maxY:t.y+i}},Ic=(e,t=1)=>`hsl(${e.split("").reduce((o,r)=>o*31+r.charCodeAt(0),0)%360}, 100%, 50%, ${t})`,L2n=(e,t,n)=>{if(n.chipId){let o=e.get(n.chipId);if(o)return o}return t.get(n.pinId)},Sk=(e,t,n)=>{let o=new Map,r=new Map;for(let a of e.chips){if(!a.sectionId)continue;o.set(a.chipId,a.sectionId);for(let c of a.pins)r.set(c.pinId,a.sectionId)}if(o.size===0)return!1;let i=L2n(o,r,t),s=L2n(o,r,n);return i!==s},dat=(e,t,n)=>{let{x:o,y:r}=e,{center:i,width:s,height:a}=t,c=i.y+a/2,l=i.y-a/2,h=i.x+s/2,d=i.x-s/2,u=c-r,_=r-l,p=h-o,m=o-d,A=Math.min(u,_,p,m),g=A===u?"y+":A===_?"y-":A===p?"x+":"x-",f=[{direction:"y+",distance:u},{direction:"y-",distance:_},{direction:"x+",distance:p},{direction:"x-",distance:m}].filter(({distance:I})=>Math.abs(I-A)<=0.000000001).map(({direction:I})=>I),y=[g,...f.filter((I)=>I!==g)];if(!n||y.length<=1)return y;let x=n.x-e.x,C=n.y-e.y,b=Math.abs(x)>=Math.abs(C)?x>=0?"x+":"x-":C>=0?"y+":"y-";if(!y.includes(b))return y;return[b,...y.filter((I)=>I!==b)]},Lb=(e,t,n)=>dat(e,t,n)[0],J0=(e,t={})=>{let{connectionAlpha:n=0.8,chipAlpha:o=0.8,hideRatsNet:r=e._hideRatsNet??!1}=t,i={lines:[],points:[],rects:[]},s=new Map;for(let a of e.chips)for(let c of a.pins)s.set(c.pinId,c);for(let a of e.chips){i.rects.push({label:a.chipId,center:a.center,width:a.width,height:a.height,fill:Ic(a.chipId,o)});for(let c of a.pins)i.points.push({label:`${c.displayName??c.pinId}
${c._facingDirection??Lb(c,a)}`,x:c.x,y:c.y,color:Ic(c.pinId,0.8)})}for(let a of e.textBoxes??[])i.rects.push({label:a.text??"schematic_text",center:a.center,width:a.width,height:a.height,fill:"rgba(160, 0, 220, 0.14)",strokeColor:"rgba(160, 0, 220, 0.9)"});if(!r){for(let a of e.directConnections){let[c,l]=a.pinIds,h=s.get(c),d=s.get(l);if(Sk(e,h,d))continue;i.lines.push({points:[{x:h.x,y:h.y},{x:d.x,y:d.y}],strokeColor:Ic(a.netId??`${c}-${l}`,n)})}for(let a of e.netConnections){let c=a.pinIds.map((l)=>s.get(l));for(let l=0;l<c.length-1;l++)for(let h=l+1;h<c.length;h++){let d=c[l],u=c[h];if(Sk(e,d,u))continue;i.lines.push({points:[{x:d.x,y:d.y},{x:u.x,y:u.y}],strokeColor:Ic(a.netId,n),strokeDash:"4 2"})}}}return i},nei=(e)=>{let{pins:t,inputProblem:n,pinIdMap:o,chipMap:r}=e,i=(u)=>{let _=new Set,p=[u];_.add(u);let m=n.directConnections||[];while(p.length){let A=p.shift();for(let g of m)if(g.pinIds.includes(A)){for(let f of g.pinIds)if(!_.has(f))_.add(f),p.push(f)}}return _},s=t[0].pinId,a=t[1].pinId,c=new Set([...i(s),...i(a)]),l=new Map,h=new Map,d=new Set(t.map((u)=>u.chipId));for(let u of c){let _=o.get(u);if(!_)continue;let p=r[_.chipId];if(!p)continue;let m=_._facingDirection??Lb(_,p),A=h.get(p.chipId);if(!A){A={center:p.center};let g={xPos:0,xNeg:0,yPos:0,yNeg:0};for(let f of p.pins){let y=f._facingDirection??Lb(f,p);if(y==="x+")g.xPos++;if(y==="x-")g.xNeg++;if(y==="y+")g.yPos++;if(y==="y-")g.yNeg++}A.counts=g,h.set(p.chipId,A)}if(m==="x+")A.hasXPos=!0;if(m==="x-")A.hasXNeg=!0;if(m==="y+")A.hasYPos=!0;if(m==="y-")A.hasYNeg=!0}for(let[u,_]of h){let p=new Set,m={axes:p},A=_.counts;if(!(!(A&&(A.xPos>1||A.xNeg>1||A.yPos>1||A.yNeg>1))&&d.has(u))){if(_.hasXPos&&_.hasXNeg)m.x=_.center.x,p.add("x");if(_.hasYPos&&_.hasYNeg)m.y=_.center.y,p.add("y")}if(p.size>0)l.set(u,m)}return l},Pde=(e)=>{let{inputProblem:t,chipMap:n,pinIdMap:o,p1:r,p2:i}=e,s=nei({pins:[r,i],inputProblem:t,pinIdMap:o,chipMap:n});if(s.size===0)return!1;let a=0.000000001,c=(_,p)=>{for(let[,m]of s){if(m.axes.has("x")&&typeof m.x==="number"){if((_.x-m.x)*(p.x-m.x)<-a)return!0}if(m.axes.has("y")&&typeof m.y==="number"){if((_.y-m.y)*(p.y-m.y)<-a)return!0}}return!1};if(Math.abs(r.x-i.x)<a||Math.abs(r.y-i.y)<a)return c({x:r.x,y:r.y},{x:i.x,y:i.y});let l={x:i.x,y:r.y},h={x:r.x,y:i.y},d=c({x:r.x,y:r.y},l)||c(l,{x:i.x,y:i.y}),u=c({x:r.x,y:r.y},h)||c(h,{x:i.x,y:i.y});return d&&u},k8e=class{netMap;idToNetMap;constructor(e){this.netMap=e,this.idToNetMap={};for(let[t,n]of Object.entries(e))for(let o of n)this.idToNetMap[o]=t}addConnections(e){for(let t of e){let n=new Set;for(let r of t){let i=this.idToNetMap[r];if(i)n.add(i)}let o;if(n.size===0)o=`connectivity_net${Object.keys(this.netMap).length}`,this.netMap[o]=[];else if(n.size===1)o=n.values().next().value??`connectivity_net${Object.keys(this.netMap).length}`;else{o=n.values().next().value??`connectivity_net${Object.keys(this.netMap).length}`;for(let r of n)if(r!==o){let i=this.netMap[o],s=this.netMap[r];if(i&&s){i.push(...s),this.netMap[r]=i;for(let a of i)this.idToNetMap[a]=o}}}for(let r of t){let i=this.netMap[o];if(i&&!i.includes(r))i.push(r);this.idToNetMap[r]=o}}}getIdsConnectedToNet(e){return this.netMap[e]||[]}getNetConnectedToId(e){return this.idToNetMap[e]}areIdsConnected(e,t){if(e===t)return!0;let n=this.getNetConnectedToId(e);if(!n)return!1;let o=this.getNetConnectedToId(t);if(!o)return!1;return n===o||o===e||o===e}areAllIdsConnected(e){if(e.length===0)return!0;let t=this.getNetConnectedToId(e[0]);if(!t)return!1;for(let n of e){let o=this.getNetConnectedToId(n);if(o===void 0)return!1;if(o!==t)return!1}return!0}},Qb=(e)=>{let t=new k8e({});for(let o of e.directConnections)t.addConnections([o.netId?[o.netId,...o.pinIds]:o.pinIds]);let n=new k8e(t.netMap);for(let o of e.netConnections)n.addConnections([[o.netId,...o.pinIds]]);return{directConnMap:t,netConnMap:n}},oei=1,b8n=(e)=>{let{netConnMap:t}=Qb(e),n=t.getNetConnectedToId("GND"),o=new k8e({}),r=new Set;for(let h of e.directConnections){o.addConnections([h.pinIds]);let d=t.getNetConnectedToId(h.pinIds[0]),u=e.netConnections.some((_)=>_.isGround&&t.getNetConnectedToId(_.netId)===d);if(d&&u)r.add(d)}let i=new Map(e.chips.flatMap((h)=>h.pins.map((d)=>[d.pinId,{pin:d,chip:h}]))),s=[...i.values()].filter(({pin:h,chip:d})=>d.pins.length===2&&t.getNetConnectedToId(h.pinId)===n&&(h._facingDirection??Lb(h,d))==="y-"),a=s.some(({pin:h})=>{let d=o.getNetConnectedToId(h.pinId);return d!==void 0&&s.some(({pin:u})=>h.pinId!==u.pinId&&Math.abs(h.y-u.y)<0.000001&&Math.abs(h.x-u.x)>0.000001&&o.getNetConnectedToId(u.pinId)===d)}),c=(h,d)=>{let u=i.get(h)?.chip.chipId,_=i.get(d)?.chip.chipId;if(u!==void 0&&u===_&&!o.getNetConnectedToId(h)&&!o.getNetConnectedToId(d))return!1;let m=t.getNetConnectedToId(h),A=t.getNetConnectedToId(d);if(!m||m!==A||!r.has(m))return!1;let g=o.getNetConnectedToId(h)??`pin:${h}`,f=o.getNetConnectedToId(d)??`pin:${d}`;return g!==f};if(!a)return(h,d)=>!c(h,d);let l=(h)=>{let d=i.get(h);return d?.chip.pins.length===2&&!o.getNetConnectedToId(h)&&(d.pin._facingDirection??Lb(d.pin,d.chip))==="y-"};return(h,d)=>{let u=t.getNetConnectedToId(h),_=t.getNetConnectedToId(d);if(c(h,d))return!1;if(!n||u!==n||_!==n)return!0;if(!l(h)&&!l(d))return!0;let p=i.get(h)?.pin,m=i.get(d)?.pin;return!p||!m||Math.abs(p.y-m.y)<=oei+0.000001}};function rei(e,t={}){let n=e.length,o=t?.maxDistance??Number.POSITIVE_INFINITY;if(n<=1)return[];{let h=new Set;for(let d of e){if(h.has(d.pinId))throw Error(`Duplicate pinId detected: "${d.pinId}"`);h.add(d.pinId)}}let r=(h,d)=>Math.abs(h.x-d.x)+Math.abs(h.y-d.y),i=Array(n).fill(!1),s=Array(n).fill(Number.POSITIVE_INFINITY),a=Array(n).fill(-1),c=0;for(let h=1;h<n;h++)if(e[h].pinId<e[c].pinId)c=h;s[c]=0;let l=[];for(let h=0;h<n;h++){let d=-1,u=Number.POSITIVE_INFINITY,_="";for(let p=0;p<n;p++)if(!i[p]){let m=s[p];if(m<u||m===u&&(_===""||e[p].pinId<_))u=m,_=e[p].pinId,d=p}if(i[d]=!0,a[d]!==-1)l.push([e[d].pinId,e[a[d]].pinId]);for(let p=0;p<n;p++)if(!i[p]){let m=r(e[d],e[p]),A=t?.forbidEdge?.(e[d],e[p])??!1,g=m>o||A?Number.POSITIVE_INFINITY:m;if(g<s[p]||g===s[p]&&e[d].pinId<e[a[p]]?.pinId)s[p]=g,a[p]=d}}return l}var iei=0.45,uat=0.2;function S9(e){let{orientation:t,netLabelWidth:n,netLabelHeight:o}=e,r=typeof n==="number"?n:iei,i=typeof o==="number"?o:uat;if(t==="y+"||t==="y-")return{width:i,height:r};return{width:r,height:i}}function kf(e,t,n,o){switch(t){case"x+":return{x:e.x+n/2,y:e.y};case"x-":return{x:e.x-n/2,y:e.y};case"y+":return{x:e.x,y:e.y+o/2};case"y-":return{x:e.x,y:e.y-o/2}}}function zi(e,t,n){return{minX:e.x-t/2,minY:e.y-n/2,maxX:e.x+t/2,maxY:e.y+n/2}}var I8n=({inputProblem:e,chipMap:t,pins:n})=>{let[o,r]=n,i=e.directConnections.find((f)=>f.pinIds.includes(o.pinId)&&f.pinIds.includes(r.pinId));if(i?.netLabelWidth===void 0)return null;let s=t[o.chipId],a=t[r.chipId];if(!s||!a)return null;let c=o._facingDirection;if(!c)c=Lb(o,s);let l=r._facingDirection;if(!l)l=Lb(r,a);if(!(c==="x-"&&l==="x+"||c==="x+"&&l==="x-"))return null;if(s.pins.length===1||a.pins.length===1)return"single-pin-peripheral";if(!(s.sectionId&&s.sectionId===a.sectionId?s.sectionId:null))return null;let p=o.x<=r.x?c==="x+"&&l==="x-":c==="x-"&&l==="x+",m=Math.abs(o.x-r.x)<i.netLabelWidth*2,A=Math.abs(o.y-r.y)<uat;return p&&m&&A?"overlapping-fallback-labels":null},sei=(e)=>I8n(e)!==null,v8n=0.000001,aei=3;function H2n({pin:e,netPins:t}){let n=t.filter((r)=>Math.abs(r.y-e.y)<=v8n);return new Set(n.map((r)=>r.chipId)).size>=aei}function cei({netConnection:e,netPins:t,pin1:n,pin2:o}){if(!e?.isGround||n.chipId===o.chipId)return!1;if(Math.abs(n.y-o.y)<=v8n)return!1;return H2n({pin:n,netPins:t})&&H2n({pin:o,netPins:t})}var $w=0.000001,lei=4,F2n=2,Lve=(e,t)=>JSON.stringify([e,t].sort()),S8n=(e,t,n)=>{let o=new Set,r=new Set,i=new Set;for(let h of e.netConnections){for(let u of h.pinIds)r.add(u);let d=t.getNetConnectedToId(h.netId);if(d&&h.isGround)o.add(d)}for(let h of e.directConnections){let d=h.netLabelWidth===void 0?i:r;for(let u of h.pinIds)d.add(u)}let s=[];for(let h of e.chips){if(h.pins.length!==2||h.symbolName&&!h.symbolName.startsWith("capacitor")||!h.pins.every((m)=>r.has(m.pinId))||h.pins.some((m)=>i.has(m.pinId)))continue;let d=h.pins.map((m)=>t.getNetConnectedToId(m.pinId));if(!d[0]||!d[1]||d[0]===d[1]||o.has(d[0])===o.has(d[1]))continue;let u=h.pins.map((m)=>m._facingDirection??Lb(m,h));if(u[0][0]!==u[1][0]||u[0]===u[1])continue;let _=u[0][0],p=_==="x"?"y":"x";if(Math.abs(h.pins[0][p]-h.pins[1][p])>$w)continue;for(let[m,A]of h.pins.entries()){let g=u[m],f=s.find((y)=>y.sectionId===h.sectionId&&y.direction===g&&Math.abs(y.coordinate-A[_])<=$w);if(!f)f={sectionId:h.sectionId,direction:g,coordinate:A[_],axis:_,pins:[]},s.push(f);f.pins.push({...A,chipId:h.chipId,oppositeCoordinate:h.pins[1-m][_]})}}let a=new Set,c=new Set,l=new Set;for(let h of s){let d=h.axis==="x"?"y":"x";h.pins.sort((u,_)=>u[d]-_[d]||u.pinId.localeCompare(_.pinId));for(let u=1;u<h.pins.length;u++){let _=h.pins[u-1],p=h.pins[u],m=p[d]-_[d],A=[_[d]-(h.pins[u-2]?.[d]??_[d]),(h.pins[u+1]?.[d]??p[d])-p[d]].filter((x)=>x>$w),g=Math.max(F2n*n,F2n*(A.length?Math.min(...A):0),lei*Math.max(Math.abs(_[h.axis]-_.oppositeCoordinate),Math.abs(p[h.axis]-p.oppositeCoordinate)));if(m<=$w||t.getNetConnectedToId(_.pinId)!==t.getNetConnectedToId(p.pinId))continue;if(m>g+$w){l.add(_.pinId),l.add(p.pinId);continue}let f=Math.min(_[h.axis],p[h.axis],_.oppositeCoordinate,p.oppositeCoordinate),y=Math.max(_[h.axis],p[h.axis],_.oppositeCoordinate,p.oppositeCoordinate);if(e.chips.some((x)=>{if(x.chipId===_.chipId||x.chipId===p.chipId)return!1;let C=h.axis==="x"?x.width:x.height,b=d==="x"?x.width:x.height;return x.center[h.axis]+C/2>=f-$w&&x.center[h.axis]-C/2<=y+$w&&x.center[d]+b/2>_[d]+$w&&x.center[d]-b/2<p[d]-$w}))continue;if(a.add(Lve(_.pinId,p.pinId)),m>n)c.add(_.pinId),c.add(p.pinId)}}return{pairKeys:a,extendedRailPinIds:c,separatedRailPinIds:l}};var Wue=1,z2n=(e)=>[...e].sort().join("::"),hei=class extends mu{inputProblem;mspConnectionPairs=[];mspConnectionPairIds=new Set;dcConnMap;globalConnMap;queuedDcNetIds;chipMap;maxMspPairDistance;pinMap;userNetIdByPinId;directConnectionPinPairKeys;canRouteGroundPair;parallelRailPairKeys;constructor({inputProblem:e}){super();this.inputProblem=e,this.canRouteGroundPair=b8n(e),this.maxMspPairDistance=e.maxMspPairDistance??Wue;let{directConnMap:t,netConnMap:n}=Qb(e);this.dcConnMap=t,this.globalConnMap=n,this.parallelRailPairKeys=S8n(e,n,this.maxMspPairDistance).pairKeys,this.pinMap={};for(let o of e.chips)for(let r of o.pins)this.pinMap[r.pinId]={...r,chipId:o.chipId};this.chipMap={};for(let o of e.chips)this.chipMap[o.chipId]=o;this.userNetIdByPinId={},this.directConnectionPinPairKeys=new Set;for(let o of e.directConnections)if(this.directConnectionPinPairKeys.add(z2n(o.pinIds)),o.netId){let[r,i]=o.pinIds;this.userNetIdByPinId[r]=o.netId,this.userNetIdByPinId[i]=o.netId}for(let o of e.netConnections)for(let r of o.pinIds)this.userNetIdByPinId[r]=o.netId;this.queuedDcNetIds=Object.keys(n.netMap)}getConstructorParams(){return{inputProblem:this.inputProblem}}addMspConnectionPair(e){if(this.mspConnectionPairIds.has(e.mspPairId))return;this.mspConnectionPairIds.add(e.mspPairId),this.mspConnectionPairs.push(e)}_step(){if(this.queuedDcNetIds.length===0){this.solved=!0;return}let e=this.queuedDcNetIds.shift(),n=this.globalConnMap.getIdsConnectedToNet(e).filter((c)=>!!this.pinMap[c]);if(n.length<=1)return;if(n.length===2){let[c,l]=n,h=this.pinMap[c],d=this.pinMap[l];if(!this.canRouteGroundPair(c,l))return;let u=z2n([c,l]),_=Math.abs(h.x-d.x)+Math.abs(h.y-d.y);if(this.directConnectionPinPairKeys.has(u))_=k9(h,d);let p=I8n({inputProblem:this.inputProblem,chipMap:this.chipMap,pins:[h,d]});if(_>this.maxMspPairDistance&&!this.parallelRailPairKeys.has(Lve(c,l))&&!p)return;if(Sk(this.inputProblem,h,d))return;let m=new Map(Object.entries(this.pinMap));if(Pde({inputProblem:this.inputProblem,chipMap:this.chipMap,pinIdMap:m,p1:h,p2:d}))return;let A=this.globalConnMap.getNetConnectedToId(c),g=this.userNetIdByPinId[c]??this.userNetIdByPinId[l],f=_>this.maxMspPairDistance&&p==="overlapping-fallback-labels";this.addMspConnectionPair({mspPairId:`${c}-${l}`,dcConnNetId:e,globalConnNetId:A,userNetId:g,suppressNetLabel:f,pins:[h,d]});return}let o=new Map(Object.entries(this.pinMap)),r=this.userNetIdByPinId[n[0]],i=this.inputProblem.netConnections.find((c)=>c.netId===r),s=n.map((c)=>this.pinMap[c]),a=rei(s,{forbidEdge:(c,l)=>Math.abs(c.x-l.x)+Math.abs(c.y-l.y)>this.maxMspPairDistance&&!this.parallelRailPairKeys.has(Lve(c.pinId,l.pinId))||!this.canRouteGroundPair(c.pinId,l.pinId)||cei({netConnection:i,netPins:s,pin1:c,pin2:l})||Sk(this.inputProblem,c,l)||Pde({inputProblem:this.inputProblem,chipMap:this.chipMap,pinIdMap:o,p1:c,p2:l})});for(let[c,l]of a){if(this.parallelRailPairKeys.has(Lve(c,l))&&Math.abs(this.pinMap[c].x-this.pinMap[l].x)+Math.abs(this.pinMap[c].y-this.pinMap[l].y)>this.maxMspPairDistance&&n.indexOf(c)>n.indexOf(l))[c,l]=[l,c];let h=this.pinMap[c],d=this.pinMap[l];if(Sk(this.inputProblem,h,d))continue;if(Pde({inputProblem:this.inputProblem,chipMap:this.chipMap,pinIdMap:o,p1:h,p2:d}))continue;let u=this.globalConnMap.getNetConnectedToId(c),_=this.userNetIdByPinId[c]??this.userNetIdByPinId[l];this.addMspConnectionPair({mspPairId:`${c}-${l}`,dcConnNetId:e,globalConnNetId:u,userNetId:_,pins:[h,d]})}}visualize(){let e=J0(this.inputProblem,{chipAlpha:0.1,connectionAlpha:0.1});for(let t of this.mspConnectionPairs)e.lines.push({points:[{x:t.pins[0].x,y:t.pins[0].y},{x:t.pins[1].x,y:t.pins[1].y}],strokeColor:Ic(t.mspPairId,0.75)});return e}},{cos:vjs,sin:Sjs,PI:Pjs}=Math,{tan:Ejs}=Math,Mjs=KZr($Zr(),1);var wjs=(()=>{let e=new Uint8Array(4),t=new Uint32Array(e.buffer);return!((t[0]=1)&e[0])})(),Bjs={int8:globalThis.Int8Array,uint8:globalThis.Uint8Array,int16:globalThis.Int16Array,uint16:globalThis.Uint16Array,int32:globalThis.Int32Array,uint32:globalThis.Uint32Array,uint64:globalThis.BigUint64Array,int64:globalThis.BigInt64Array,float32:globalThis.Float32Array,float64:globalThis.Float64Array},dei=[];for(let e=0;e<256;e++){let t=e;for(let n=0;n<8;n++)if(t&1)t=3988292384^t>>>1;else t=t>>>1;dei[e]=t}var uei=new Uint16Array([255]),pei=new Uint8Array(uei.buffer),Tjs=pei[0]===255,mei=new Uint16Array([255]),_ei=new Uint8Array(mei.buffer),Djs=_ei[0]===255,Njs=new Uint8Array(0),Rjs=Uint8Array.of(137,80,78,71,13,10,26,10),Qjs=new TextDecoder("latin1"),O2n={"0":"M0.301025 0.257813 L0.206593 0.283385 L0.122042 0.361307 L0.075923 0.474441 L0.064942 0.642221 L0.091296 0.78289 L0.159376 0.899463 L0.257104 0.961214 L0.344948 0.961214 L0.442678 0.899463 L0.510757 0.78289 L0.537111 0.642221 L0.526131 0.474441 L0.480012 0.361307 L0.39546 0.283385 L0.301025 0.257813","1":"M0.220426 0.40845 L0.381626 0.270996 L0.381626 0.948966","2":"M0.110409 0.39212 L0.125621 0.342293 L0.170571 0.295823 L0.244237 0.26431 L0.291518 0.257813 L0.373319 0.263799 L0.434683 0.290705 L0.468239 0.331966 L0.480292 0.379913 L0.479492 0.411806 L0.465088 0.465192 L0.402571 0.568988 L0.245134 0.766438 L0.07959 0.948045 L0.522462 0.948045","3":"M0.081606 0.345073 L0.119154 0.315633 L0.178996 0.284091 L0.255265 0.257813 L0.349133 0.263062 L0.43127 0.289348 L0.48994 0.336662 L0.525141 0.394491 L0.513407 0.457577 L0.466472 0.504892 L0.384334 0.541692 L0.290464 0.56272 L0.20833 0.573235 L0.290464 0.583749 L0.384334 0.610035 L0.466472 0.652092 L0.519274 0.709922 L0.531007 0.773007 L0.50754 0.841351 L0.454738 0.899179 L0.3726 0.946494 L0.310412 0.961214 L0.209503 0.959111 L0.127367 0.946494 L0.071046 0.929671","4":"M0.418494 0.270996 L0.048828 0.724199 L0.553224 0.724199 M0.414181 0.578167 L0.414181 0.94897","5":"M0.074951 0.270996 L0.074951 0.614701 L0.267655 0.5695 L0.405247 0.586502 L0.460002 0.617189 L0.498028 0.660731 L0.527101 0.779401 L0.513352 0.841049 L0.477274 0.889568 L0.406378 0.93463 L0.324445 0.958337 L0.247399 0.962139 L0.182516 0.949767 L0.130068 0.925508 L0.074951 0.875607 M0.074951 0.270996 L0.527101 0.270996","6":"M0.428549 0.257813 L0.341433 0.285053 L0.26073 0.312099 L0.192188 0.360182 L0.138902 0.410969 L0.098219 0.500422 L0.070249 0.584267 L0.067264 0.670716 L0.065164 0.756863 L0.087163 0.820973 L0.108168 0.861042 L0.157916 0.913131 L0.210981 0.948192 L0.29279 0.961214 L0.384548 0.956206 L0.456409 0.924151 L0.507262 0.881077 L0.5349 0.821975 L0.537111 0.771889 L0.521634 0.718798 L0.498418 0.67372 L0.463042 0.636657 L0.414398 0.613617 L0.34696 0.598591 L0.28284 0.595587 L0.215403 0.605604 L0.145756 0.641665 L0.109274 0.678729 L0.064942 0.724006","7":"M0.071534 0.270996 L0.530519 0.270996 L0.495935 0.291702 L0.477752 0.305407 L0.435186 0.346112 L0.412067 0.374136 L0.388565 0.40796 L0.365315 0.448098 L0.342943 0.495062 L0.322081 0.549366 L0.303364 0.611524 L0.287416 0.68205 L0.270077 0.80465 L0.26253 0.94897","8":"M0.286761 0.257813 L0.210684 0.27162 L0.1414 0.305622 L0.092494 0.382125 L0.111513 0.450128 L0.16857 0.502193 L0.228345 0.539382 L0.377781 0.594635 L0.470161 0.645637 L0.52586 0.706203 L0.538087 0.792269 L0.506841 0.87621 L0.438915 0.927212 L0.339743 0.961214 L0.263666 0.959089 L0.174004 0.929337 L0.102003 0.881523 L0.063965 0.811395 L0.066682 0.741266 L0.102003 0.671139 L0.180797 0.608448 L0.259591 0.580822 L0.358762 0.548945 L0.456576 0.49688 L0.486463 0.446941 L0.487822 0.362999 L0.453859 0.302434 L0.384574 0.265245 L0.286761 0.257813","9":"M0.511026 0.437812 L0.491026 0.347812 L0.451026 0.297812 L0.391026 0.267812 L0.311026 0.257813 L0.231026 0.267812 L0.161026 0.297812 L0.111026 0.347812 L0.091026 0.417812 L0.111026 0.487812 L0.161026 0.537812 L0.231026 0.567812 L0.311026 0.577812 L0.391026 0.557812 L0.451026 0.517812 L0.491026 0.477812 L0.511026 0.437812 M0.510026 0.438812 L0.434026 0.636812 L0.381026 0.777812 L0.337026 0.879812 L0.301026 0.957812","!":"M0.301026 0.270996 L0.301026 0.749566 M0.251466 0.94897 L0.350587 0.94897",'"':"M0.16504 0.270996 L0.16504 0.523022 M0.437013 0.270996 L0.437013 0.523022","#":"M0.20958 0.282227 L0.146515 0.949754 M0.461844 0.282227 L0.398779 0.949754 M0.032999 0.526969 L0.600587 0.452796 M0.001465 0.82366 L0.569055 0.749486",$:"M0.307121 0.240234 L0.307121 1.083502 M0.490031 0.415915 L0.404676 0.328075 L0.23396 0.310507 L0.136407 0.398347 L0.099828 0.521324 L0.124213 0.591596 L0.197379 0.644299 L0.429061 0.697003 L0.502224 0.749708 L0.526613 0.837547 L0.477836 0.960526 L0.355897 1.013228 L0.197379 0.99566 L0.112021 0.942957 L0.07544 0.837547","'":"M0.301026 0.270996 L0.301026 0.523022","(":"M0.413087 0.241211 L0.372337 0.28347 L0.331589 0.334184 L0.290838 0.393349 L0.25009 0.460965 L0.219528 0.528584 L0.199153 0.5962 L0.188966 0.655364 L0.199153 0.714529 L0.219528 0.782146 L0.25009 0.849764 L0.290838 0.91738 L0.331589 0.976544 L0.372337 1.027258 L0.413087 1.069491",")":"M0.188966 0.241211 L0.229716 0.28347 L0.270466 0.334184 L0.311213 0.393349 L0.351964 0.460965 L0.382526 0.528584 L0.4029 0.5962 L0.413087 0.655364 L0.4029 0.714529 L0.382526 0.782146 L0.351964 0.849764 L0.311213 0.91738 L0.270466 0.976544 L0.229716 1.027258 L0.188966 1.069491","*":"M0.301026 0.458702 L0.301026 0.681942 M0.301026 0.458702 L0.520997 0.536834 M0.301026 0.458702 L0.439954 0.257813 M0.301026 0.458702 L0.162098 0.257813 M0.301026 0.458702 L0.081055 0.536834","+":"M0.042969 0.66845 L0.559083 0.66845 M0.301023 0.428223 L0.301023 0.908661",",":"M0.38672 0.852051 L0.215333 1.030661 L0.301025 1.119971","-":"M0.173829 0.686035 L0.428224 0.686035",".":"M0.362549 0.851074 L0.239503 0.851074","/":"M0.062501 1.035249 L0.539551 0.270996","<":"M0.559083 0.441895 L0.042969 0.66939 L0.042969 0.66939 L0.559083 0.896902","=":"M0.042969 0.545898 L0.559083 0.545898 M0.042969 0.80837 L0.559083 0.80837",">":"M0.042969 0.441895 L0.559083 0.66939 L0.559083 0.66939 L0.042969 0.896902",A:"M0.018067 0.94897 L0.290179 0.270996 L0.583986 0.94897 M0.155303 0.684521 L0.433548 0.684521",B:"M0.063965 0.94897 L0.063965 0.278953 L0.209356 0.270996 L0.342486 0.294394 L0.432179 0.37292 L0.418224 0.48773 L0.312686 0.549166 L0.084728 0.575531 L0.306377 0.589434 L0.468877 0.647456 L0.538087 0.736658 L0.5324 0.85202 L0.501247 0.902983 L0.42355 0.944398 L0.063965 0.94897",C:"M0.529054 0.419847 L0.498425 0.345196 L0.442238 0.292341 L0.33583 0.257813 L0.257199 0.268357 L0.187906 0.303748 L0.120243 0.385432 L0.072998 0.599844 L0.110073 0.815385 L0.165381 0.902183 L0.222883 0.942801 L0.334904 0.961214 L0.43253 0.937679 L0.504816 0.868999 L0.529054 0.772065",D:"M0.064454 0.94897 L0.071838 0.285078 L0.171217 0.270996 L0.247348 0.272633 L0.37101 0.306078 L0.462461 0.378304 L0.514748 0.475555 L0.535591 0.576392 L0.537599 0.652313 L0.528065 0.717381 L0.508562 0.772419 L0.445948 0.855695 L0.362356 0.90871 L0.225203 0.945862 L0.064454 0.94897",E:"M0.080078 0.270996 L0.080078 0.94897 M0.080078 0.270996 L0.521974 0.270996 M0.080078 0.609981 L0.389405 0.609981 M0.080078 0.94897 L0.521974 0.94897",F:"M0.086426 0.270996 L0.086426 0.94897 M0.091304 0.275607 L0.515626 0.275607 M0.091304 0.607677 L0.447344 0.607677",G:"M0.498034 0.284943 L0.374621 0.257813 L0.244219 0.268648 L0.160577 0.311997 L0.094556 0.398116 L0.056397 0.58404 L0.076752 0.785532 L0.120865 0.858197 L0.188947 0.916734 L0.271008 0.953591 L0.357069 0.961214 L0.43715 0.932047 L0.501262 0.858539 L0.545656 0.648611 L0.329595 0.648131",H:"M0.066895 0.270996 L0.066895 0.94897 M0.066895 0.595658 L0.530009 0.595658 M0.535157 0.270996 L0.535157 0.94897",I:"M0.301026 0.270996 L0.301026 0.94897",J:"M0.506839 0.270996 L0.507814 0.782193 L0.498468 0.846168 L0.480733 0.880789 L0.455864 0.90832 L0.426095 0.929408 L0.360746 0.954812 L0.302508 0.962139 L0.223573 0.953638 L0.16538 0.930312 L0.137072 0.907715 L0.116428 0.880312 L0.102822 0.848819 L0.095633 0.813947 L0.094239 0.776413",K:"M0.035401 0.270996 L0.035401 0.94897 M0.502258 0.316194 L0.035401 0.687823 M0.212484 0.582361 L0.566652 0.933903",L:"M0.07544 0.270996 L0.07544 0.94897 L0.526613 0.94897",M:"M0.042481 0.94897 L0.042481 0.270996 L0.301027 0.712492 L0.559571 0.270996 L0.559571 0.94897",N:"M0.067871 0.94897 L0.067871 0.270996 L0.534181 0.94897 L0.525031 0.270996",O:"M0.287293 0.961214 L0.19843 0.933567 L0.1172 0.849451 L0.057129 0.563945 L0.114348 0.350255 L0.18455 0.289392 L0.306101 0.257813 L0.42054 0.29572 L0.487543 0.365003 L0.544923 0.625294 L0.516366 0.789624 L0.465476 0.884596 L0.375084 0.949287 L0.287293 0.961214",P:"M0.070557 0.94897 L0.070557 0.28379 L0.20704 0.270996 L0.329134 0.278993 L0.408525 0.300514 L0.444022 0.317908 L0.500637 0.368929 L0.525796 0.423728 L0.531496 0.50384 L0.508934 0.554205 L0.473724 0.582043 L0.417577 0.604365 L0.336375 0.620372 L0.226014 0.629268 L0.082368 0.630258",Q:"M0.282435 1.050813 L0.195447 1.019646 L0.115933 0.924817 L0.057129 0.602943 L0.113139 0.362034 L0.18186 0.293418 L0.300844 0.257813 L0.412868 0.300553 L0.478457 0.37866 L0.534625 0.672103 L0.506671 0.857367 L0.456855 0.964437 L0.368371 1.037368 L0.282435 1.050813 M0.341225 0.815559 L0.544923 1.070653",R:"M0.034912 0.944112 L0.034912 0.288556 L0.227127 0.270996 L0.362038 0.276867 L0.443423 0.294907 L0.477644 0.309614 L0.505809 0.328757 L0.526616 0.352817 L0.544963 0.418061 L0.543241 0.475921 L0.524463 0.517817 L0.49076 0.546518 L0.444265 0.564799 L0.355195 0.578739 L0.047653 0.589627 M0.303054 0.617306 L0.56714 0.94897",S:"M0.483037 0.364333 L0.407613 0.267477 L0.22883 0.257813 L0.128623 0.327565 L0.087712 0.455539 L0.104656 0.518727 L0.168054 0.573307 L0.41928 0.617318 L0.503796 0.669342 L0.535157 0.759324 L0.493846 0.900055 L0.367668 0.961214 L0.205436 0.956661 L0.116711 0.907038 L0.066895 0.790334",T:"M0.022949 0.270996 L0.579103 0.270996 M0.309284 0.270996 L0.309284 0.94897",U:"M0.072022 0.270996 L0.07308 0.648875 L0.080372 0.75167 L0.099024 0.827813 L0.134786 0.885729 L0.181571 0.924023 L0.251464 0.95168 L0.339655 0.962139 L0.401553 0.951668 L0.45232 0.924086 L0.482701 0.891771 L0.495745 0.870529 L0.515699 0.81637 L0.525014 0.744626 L0.530031 0.272017",V:"M0.027832 0.270996 L0.320083 0.94897 L0.57422 0.270996",W:"M0 0.270996 L0.079799 0.940377 L0.285198 0.472884 L0.505255 0.94897 L0.602052 0.270996",X:"M0.009034 0.270996 L0.586805 0.94897 M0.593019 0.270996 L0.015246 0.94897",Y:"M0.018067 0.270996 L0.293132 0.574135 M0.583986 0.271959 L0.294954 0.57606 L0.305277 0.94897",Z:"M0.053711 0.270996 L0.548341 0.270996 L0.053711 0.94897 L0.548341 0.94897","[":"M0.404542 0.240234 L0.197511 0.240234 L0.197511 1.069424 L0.404542 1.069424","\\":"M0.062501 0.270996 L0.539551 1.035249","]":"M0.19751 0.240234 L0.404542 0.240234 L0.404542 1.069424 L0.19751 1.069424","^":"M0.035156 0.523931 L0.301024 0.270996 L0.566896 0.523931",_:"M0 1.160601 L0.602052 1.160601",a:"M0.527101 0.439941 L0.527101 0.973965 M0.527101 0.553824 L0.451366 0.477535 L0.376759 0.439941 L0.263722 0.439941 L0.187989 0.477535 L0.112255 0.553824 L0.074951 0.66881 L0.074951 0.745099 L0.112255 0.85898 L0.187989 0.93527 L0.263722 0.973965 L0.376759 0.973965 L0.451366 0.93527 L0.527101 0.85898",b:"M0.07666 0.240234 L0.07666 0.959985 M0.07666 0.582737 L0.151822 0.514237 L0.225865 0.480483 L0.338045 0.480483 L0.413211 0.514237 L0.488374 0.582737 L0.525392 0.685983 L0.525392 0.754485 L0.488374 0.856739 L0.413211 0.92524 L0.338045 0.959985 L0.225865 0.959985 L0.151822 0.92524 L0.07666 0.856739",c:"M0.512452 0.553823 L0.441624 0.477535 L0.371854 0.439941 L0.26614 0.439941 L0.195312 0.477535 L0.124486 0.553823 L0.0896 0.668808 L0.0896 0.745099 L0.124486 0.858979 L0.195312 0.93527 L0.26614 0.973965 L0.371854 0.973965 L0.441624 0.93527 L0.512452 0.858979",d:"M0.525392 0.240234 L0.525392 0.959985 M0.525392 0.582737 L0.450232 0.514237 L0.376189 0.480483 L0.264006 0.480483 L0.188844 0.514237 L0.11368 0.582737 L0.076661 0.685983 L0.076661 0.754485 L0.11368 0.856739 L0.188844 0.92524 L0.264006 0.959985 L0.376189 0.959985 L0.450232 0.92524 L0.525392 0.856739",e:"M0.059571 0.668808 L0.542482 0.668808 M0.542482 0.592521 L0.502641 0.516231 L0.461594 0.477535 L0.381914 0.439941 L0.261186 0.439941 L0.180299 0.477535 L0.099412 0.553823 L0.059571 0.668808 L0.059571 0.745099 L0.099412 0.858979 L0.180299 0.93527 L0.261186 0.973965 L0.381914 0.973965 L0.461594 0.93527 L0.542482 0.858979",f:"M0.512941 0.240234 L0.406984 0.240234 L0.301026 0.274346 L0.248047 0.374731 L0.248047 0.946817 M0.089112 0.476088 L0.459965 0.476088",g:"M0.525392 0.439941 L0.525392 0.989395 L0.488373 1.091918 L0.45023 1.126757 L0.376189 1.160601 L0.264004 1.160601 L0.188844 1.126757 L0.113681 1.058075 L0.076661 0.954555 M0.525392 0.542467 L0.45023 0.473786 L0.376189 0.439941 L0.264004 0.439941 L0.188844 0.473786 L0.113681 0.542467 L0.076661 0.645988 L0.076661 0.714669 L0.113681 0.817193 L0.188844 0.885875 L0.264004 0.920713 L0.376189 0.920713 L0.45023 0.885875 L0.525392 0.817193",h:"M0.092041 0.240234 L0.092041 0.946817 M0.092041 0.61058 L0.205937 0.509225 L0.282214 0.476086 L0.396109 0.476086 L0.47187 0.509225 L0.510011 0.61058 L0.510011 0.946817",i:"M0.261026 0.240234 L0.341026 0.240234 M0.300978 0.476089 L0.300978 0.946817",j:"M0.3853 0.240234 L0.447023 0.240234 M0.416159 0.465708 L0.416159 1.011689 L0.383887 1.108586 L0.252832 1.140264 L0.15503 1.108586",k:"M0.065186 0.240234 L0.065186 0.946817 M0.493824 0.476086 L0.065186 0.812323 M0.236758 0.677829 L0.536867 0.946817",l:"M0.301026 0.234863 L0.301026 0.946441",m:"M0.050538 0.439941 L0.050538 0.960796 M0.050538 0.588758 L0.114405 0.476607 L0.157178 0.439941 L0.236864 0.439941 L0.279637 0.476607 L0.32241 0.588758 L0.32241 0.960796 M0.32241 0.588758 L0.386281 0.476607 L0.428467 0.439941 L0.50874 0.439941 L0.551515 0.476607 L0.551515 0.960796",n:"M0.092041 0.439941 L0.092041 0.960796 M0.092041 0.588758 L0.205936 0.476607 L0.282216 0.439941 L0.396113 0.439941 L0.471871 0.476607 L0.510011 0.588758 L0.510011 0.960796",o:"M0.247175 0.439941 L0.175178 0.477535 L0.103186 0.553823 L0.066895 0.668808 L0.066895 0.745099 L0.103186 0.858979 L0.175178 0.93527 L0.247175 0.973965 L0.354874 0.973965 L0.426872 0.93527 L0.498866 0.858979 L0.535157 0.745099 L0.535157 0.668808 L0.498866 0.553823 L0.426872 0.477535 L0.354874 0.439941 L0.247175 0.439941",p:"M0.076904 0.439941 L0.076904 1.154244 M0.076904 0.541563 L0.151986 0.473487 L0.225944 0.439941 L0.338005 0.439941 L0.413087 0.473487 L0.488166 0.541563 L0.525148 0.644169 L0.525148 0.712246 L0.488166 0.813866 L0.413087 0.881942 L0.338005 0.916471 L0.225944 0.916471 L0.151986 0.881942 L0.076904 0.813866",q:"M0.525148 0.441895 L0.525148 1.156195 M0.525148 0.5435 L0.450067 0.47544 L0.376106 0.441895 L0.264042 0.441895 L0.188966 0.47544 L0.113885 0.5435 L0.076905 0.646108 L0.076905 0.714187 L0.113885 0.815809 L0.188966 0.883886 L0.264042 0.918418 L0.376106 0.918418 L0.450067 0.883886 L0.525148 0.815809",r:"M0.107422 0.439941 L0.107422 0.960796 M0.107422 0.663164 L0.155824 0.551014 L0.252626 0.476607 L0.349428 0.439941 L0.49463 0.439941",s:"M0.475556 0.477535 L0.400757 0.439941 L0.276092 0.439941 L0.176361 0.477535 L0.101563 0.553823 L0.101563 0.630112 L0.176361 0.668808 L0.301024 0.668808 L0.425688 0.745099 L0.50049 0.821387 L0.50049 0.897677 L0.425688 0.93527 L0.325956 0.973965 L0.201295 0.973965 L0.126496 0.93527 L0.101563 0.858979",t:"M0.246032 0.297852 L0.246032 0.826549 L0.301023 0.919323 L0.411011 0.950848 L0.520997 0.950848 M0.081055 0.515799 L0.466004 0.515799",u:"M0.092041 0.454102 L0.092041 0.826134 L0.13018 0.937211 L0.205936 0.974954 L0.319832 0.974954 L0.396113 0.937211 L0.510011 0.826134 M0.510011 0.454102 L0.510011 0.974954",v:"M0.048828 0.453125 L0.301026 0.961719 M0.553224 0.453125 L0.301026 0.961719",w:"M0 0.453125 L0.150512 0.961719 M0.301024 0.453125 L0.150512 0.961719 M0.301024 0.453125 L0.451539 0.961719 M0.602052 0.453125 L0.451539 0.961719",x:"M0.03711 0.453125 L0.564943 0.961719 M0.564943 0.453125 L0.03711 0.961719",y:"M0.084618 0.453125 L0.320232 0.921476 M0.55713 0.453125 L0.320232 0.921476 L0.242119 1.055289 L0.163369 1.122196 L0.084618 1.155166 L0.044922 1.155166",z:"M0.505373 0.452148 L0.09668 0.961651 M0.09668 0.452148 L0.505373 0.452148 M0.09668 0.961651 L0.505373 0.961651"},V2n={};for(let e in O2n){V2n[e]=[];let t=O2n[e].split("M").slice(1).map((n)=>n.split("L").map((o)=>o.trim().split(" ").map(parseFloat)));for(let n of t)for(let o=0;o<n.length-1;o++)V2n[e].push({x1:n[o][0],y1:1-n[o][1],x2:n[o+1][0],y2:1-n[o+1][1]})}var gei=(e,t,n)=>{let o=[{x:e.x,y:e.y}],r=(e.x+t.x)/2,i=(e.y+t.y)/2,s={x:t.x,y:t.y};switch(t.facingDirection){case"x+":s.x+=n;break;case"x-":s.x-=n;break;case"y+":s.y+=n;break;case"y-":s.y-=n;break}let a=e.facingDirection??"none",c=t.facingDirection??"none",l=(u)=>{let _=o[o.length-1];if(_.x!==u.x||_.y!==u.y)o.push(u)},h=Math.abs(e.y-t.y)<=Math.max(0.000001,n*0.1),d=Math.abs(e.x-t.x)<=Math.max(0.000001,n*0.1);if(a==="none"&&c==="none")l({x:r,y:e.y}),l({x:r,y:t.y});else if(a==="x+"&&c==="y+")if(e.x>t.x&&e.y<t.y)l({x:e.x+n,y:e.y}),l({x:e.x+n,y:t.y+n}),l({x:t.x,y:t.y+n});else if(!d&&!h&&e.x<t.x&&e.y>t.y)l({x:t.x,y:e.y});else if(d)l({x:e.x+n,y:e.y}),l({x:e.x+n,y:t.y+n}),l({x:t.x,y:t.y+n});else if(e.x<t.x)l({x:r,y:e.y}),l({x:r,y:s.y}),l({x:t.x,y:s.y});else if(e.y<=t.y+n)l({x:e.x+n,y:e.y}),l({x:e.x+n,y:e.y+n}),l({x:t.x,y:e.y+n}),l({x:t.x,y:t.y});else l({x:e.x+n,y:e.y}),l({x:e.x+n,y:(e.y+t.y)/2}),l({x:t.x,y:(e.y+t.y)/2});else if(a==="x+"&&c==="x+"&&!h){let u=Math.max(e.x+n,s.x);l({x:u,y:e.y}),l({x:u,y:t.y})}else if(a==="x+"&&c==="x+"&&h)l({x:e.x+n,y:e.y}),l({x:e.x+n,y:e.y+n}),l({x:t.x+n,y:e.y+n}),l({x:t.x+n,y:t.y});else if(a==="x+"&&c==="y-")if(d&&e.y<=t.y)l({x:e.x+n,y:e.y}),l({x:e.x+n,y:i}),l({x:t.x,y:i});else if(d&&e.y>t.y)l({x:e.x+n,y:e.y}),l({x:e.x+n,y:t.y-n}),l({x:t.x,y:t.y-n});else if(e.x<t.x&&e.y<t.y)l({x:t.x,y:e.y});else if(e.x>t.x&&e.y<t.y){let u=e.x+n;l({x:u,y:e.y}),l({x:u,y:i}),l({x:t.x,y:i})}else if(e.x>t.x&&e.y>t.y){let u=e.x+n;l({x:u,y:e.y}),l({x:u,y:s.y}),l({x:t.x,y:s.y})}else if(e.y===t.y)l({x:e.x+n,y:e.y}),l({x:e.x+n,y:e.y-n}),l({x:t.x,y:e.y-n});else l({x:r,y:e.y}),l({x:r,y:s.y}),l({x:t.x,y:s.y});else if(a==="x+"&&c==="x-"&&e.x+n>=t.x-n&&!h){let u=e.x+n;l({x:u,y:e.y}),l({x:u,y:i}),l({x:s.x,y:i}),l({x:s.x,y:s.y})}else if(a==="x+"&&c==="x-"&&h&&t.x>e.x);else if(a==="x+"&&c==="x-"&&h)l({x:e.x+n,y:e.y}),l({x:e.x+n,y:e.y+n}),l({x:t.x-n,y:e.y+n}),l({x:t.x-n,y:e.y});else{if(a==="x+")l({x:e.x+n,y:e.y});l({x:r,y:o[o.length-1].y}),l({x:r,y:s.y}),l({x:s.x,y:s.y})}return l({x:t.x,y:t.y}),o},pat=(e,t,n={})=>{let o=e,r=t,i=!1;if(o.x>r.x||o.x===r.x&&o.y>r.y)i=!0,[o,r]=[r,o];let s=o.facingDirection==="x-",a=o.facingDirection==="y-",c=(f)=>{let y=s?o.x-(f.x-o.x):f.x,x=a?o.y-(f.y-o.y):f.y,C=f.facingDirection;if(s){if(C==="x+")C="x-";else if(C==="x-")C="x+"}if(a){if(C==="y+")C="y-";else if(C==="y-")C="y+"}return{x:y,y:x,facingDirection:C}},l=(f,y)=>{let x=f.x-y.x,C=f.y-y.y,b=y.x+C,I=y.y-x,v=f.facingDirection;switch(v){case"x+":v="y-";break;case"y-":v="x-";break;case"x-":v="y+";break;case"y+":v="x+";break}return{x:b,y:I,facingDirection:v}},h=(f,y)=>{let x=f.x-y.x,C=f.y-y.y;return{x:y.x-C,y:y.y+x}},d=s||a?c(o):o,u=s||a?c(r):r,_=d,p=u,m=!1;if(d.facingDirection==="y+")m=!0,_={...d,facingDirection:"x+"},p=l(u,d);let A=n?.overshoot??0.1*Math.max(Math.abs(_.x-p.x),Math.abs(_.y-p.y)),g=gei(_,p,A);if(m)g=g.map((f)=>h(f,_));if(s||a)g=g.map(({x:f,y})=>({x:s?o.x-(f-o.x):f,y:a?o.y-(y-o.y):y}));return i?g.reverse():g},Y2n=(e,t)=>{let n=e.find((o)=>o?.netLabelWidth!==void 0)?.netLabelWidth;if(n!==void 0||!t)return n;return e.find((o)=>o?.anchoredNetLabelWidth!==void 0)?.anchoredNetLabelWidth},PS=({inputProblem:e,netId:t,pinIds:n,isPortOnlyLabel:o})=>{if(t){let r=Y2n([e.netConnections.find((i)=>i.netId===t),e.directConnections.find((i)=>i.netId===t)],o);if(r!==void 0)return r}return Y2n([e.directConnections.find((r)=>r.pinIds.some((i)=>n.includes(i))),e.netConnections.find((r)=>r.pinIds.some((i)=>n.includes(i)))],o)};function L9(e,t={}){return{minX:e.center.x-e.width/2-(t.minX??0),minY:e.center.y-e.height/2-(t.minY??0),maxX:e.center.x+e.width/2+(t.maxX??0),maxY:e.center.y+e.height/2+(t.maxY??0)}}function gc(e,t,n=0.000000001){return e.minX<t.maxX-n&&e.maxX>t.minX+n&&e.minY<t.maxY-n&&e.maxY>t.minY+n}function DZ(e,t){for(let n of t.textBoxes??[])if(gc(e,L9(n)))return!0;return!1}var P8n=0.15,ode=P8n/7.5,Aei=0.2;function L8e(e,t){if(t.x>e.x)return"x+";if(t.x<e.x)return"x-";if(t.y>e.y)return"y+";if(t.y<e.y)return"y-";return null}function mat({path:e,pin1:t,pin2:n}){let o=L8e(e[0],e[1]),r=L8e(e[e.length-1],e[e.length-2]);return o===t._facingDirection&&r===n._facingDirection}function fei(e,t){if(e.x===t.x||e.y===t.y)return null;let n=e._facingDirection,o=t._facingDirection,r={x:e.x,y:e.y},i={x:t.x,y:t.y},s=null;if(n?.startsWith("y")&&o?.startsWith("x")){let a=-ode;if(n==="y+")a=ode;let c=r.y+a,l=(r.x+i.x)/2;s=[r,{x:r.x,y:c},{x:l,y:c},{x:l,y:i.y},i]}else if(n?.startsWith("x")&&o?.startsWith("y")){let a=-ode;if(n==="x+")a=ode;let c=r.x+a,l=(r.y+i.y)/2;s=[r,{x:c,y:r.y},{x:c,y:l},{x:i.x,y:l},i]}if(!s)return null;if(mat({path:s,pin1:e,pin2:t}))return s;return null}function yei(e,t){let n=Math.abs(e.x-t.x)+Math.abs(e.y-t.y);if(n>P8n)return null;let o={x:e.x,y:e.y},r={x:t.x,y:t.y},i=fei(e,t);if(i)return i;let s=[];if(e.x!==t.x&&e.y!==t.y)s=[[o,{x:t.x,y:e.y},r],[o,{x:e.x,y:t.y},r]];else s=[[o,r]];for(let a of s)if(mat({path:a,pin1:e,pin2:t}))return a;return pat({x:e.x,y:e.y,facingDirection:e._facingDirection},{x:t.x,y:t.y,facingDirection:t._facingDirection},{overshoot:Math.min(Aei,Math.max(ode,n/4))})}var z7e=0.000000001,MA=(e,t,n=z7e)=>Math.abs(e.x-t.x)<n,Ag=(e,t,n=z7e)=>Math.abs(e.y-t.y)<n,X2=(e,t,n,o=z7e)=>{let r=MA(e,t,o),i=Ag(e,t,o);if(!r&&!i)return!1;if(r){let s=e.x;if(s<n.minX-o||s>n.maxX+o)return!1;let a=Math.min(e.y,t.y),c=Math.max(e.y,t.y);return Math.min(c,n.maxY)-Math.max(a,n.minY)>o}else{let s=e.y;if(s<n.minY-o||s>n.maxY+o)return!1;let a=Math.min(e.x,t.x),c=Math.max(e.x,t.x);return Math.min(c,n.maxX)-Math.max(a,n.minX)>o}},H8e=(e,t,n,o=z7e)=>{if(MA(e,t,o)){if(!(Math.abs(e.x-n.minX)<=o||Math.abs(e.x-n.maxX)<=o))return!1;return Math.min(Math.max(e.y,t.y),n.maxY)-Math.max(Math.min(e.y,t.y),n.minY)>o}if(Ag(e,t,o)){if(!(Math.abs(e.y-n.minY)<=o||Math.abs(e.y-n.maxY)<=o))return!1;return Math.min(Math.max(e.x,t.x),n.maxX)-Math.max(Math.min(e.x,t.x),n.minX)>o}return!1},CB=(e,t,n={})=>{for(let o=0;o<e.length-1;o++){let r=e[o],i=e[o+1],s=n.excludeRectsForSegment?.(o)??new Set;for(let a of t){if(s.has(a))continue;if(X2(r,i,a))return{segIndex:o,rect:a}}}return null},NZ=(e,t)=>{for(let n=0;n<e.length-1;n++)for(let o of t)if(X2(e[n],e[n+1],o))return!0;return!1},E8n=0.000000001,gk=0.2,xei=(e,t)=>({minX:Math.min(e.x,t.x),maxX:Math.max(e.x,t.x),minY:Math.min(e.y,t.y),maxY:Math.max(e.y,t.y)}),Ak=(e,t,n,o=E8n)=>{if(e==="x"){if(t.x<n.minX-o)return[(t.x+n.minX)/2];if(t.x>n.maxX+o)return[(t.x+n.maxX)/2];return[n.minX-gk,n.maxX+gk]}else{if(t.y<n.minY-o)return[(t.y+n.minY)/2];if(t.y>n.maxY+o)return[(t.y+n.maxY)/2];return[n.minY-gk,n.maxY+gk]}},G2n=(e,t,n,o,r={})=>{let{allowOpenSideCandidates:i=!1,eps:s=E8n}=r,a=[...n];if(e==="x"){let c=[o.minX,...a.map((_)=>_.maxX)].filter((_)=>_<t.minX-s),l=[o.maxX,...a.map((_)=>_.minX)].filter((_)=>_>t.maxX+s),h=c.length>0?Math.max(...c):void 0,d=l.length>0?Math.min(...l):void 0,u=[];if(h!==void 0)u.push((h+t.minX)/2);else if(i)u.push(t.minX-gk);if(d!==void 0)u.push((t.maxX+d)/2);else if(i)u.push(t.maxX+gk);return u}else{let c=[o.minY,...a.map((_)=>_.maxY)].filter((_)=>_<t.minY-s),l=[o.maxY,...a.map((_)=>_.minY)].filter((_)=>_>t.maxY+s),h=c.length>0?Math.max(...c):void 0,d=l.length>0?Math.min(...l):void 0,u=[];if(h!==void 0)u.push((h+t.minY)/2);else if(i)u.push(t.minY-gk);if(d!==void 0)u.push((t.maxY+d)/2);else if(i)u.push(t.maxY+gk);return u}},Cei=0.000000001,M8n=(e)=>e.every((t,n)=>{let o=e[n+1];if(!o)return!0;if(!Ag(t,o)&&!MA(t,o))return!1;return Math.abs(t.x-o.x)+Math.abs(t.y-o.y)>0}),_at=(e,t,n,o,r=Cei)=>{if(t<0||t>=e.length-1)return null;let i=e[t],s=e[t+1],a=MA(i,s,r),c=Ag(i,s,r);if(!a&&!c)return null;if(a&&n!=="x")return null;if(c&&n!=="y")return null;let l=e.map((h)=>({...h}));if(n==="x"){if(Math.abs(i.x-o)<r&&Math.abs(s.x-o)<r)return null;l[t]={...l[t],x:o},l[t+1]={...l[t+1],x:o}}else{if(Math.abs(i.y-o)<r&&Math.abs(s.y-o)<r)return null;l[t]={...l[t],y:o},l[t+1]={...l[t+1],y:o}}if(t-1>=0){let h=l[t-1],d=l[t];if(Math.abs(h.x-d.x)+Math.abs(h.y-d.y)<r)return null}if(t+2<=l.length-1){let h=l[t+1],d=l[t+2];if(Math.abs(h.x-d.x)+Math.abs(h.y-d.y)<r)return null}for(let h=0;h<l.length-1;h++){let d=l[h],u=l[h+1];if(!Ag(d,u,r)&&!MA(d,u,r))return null}return l},_nt=(e,t=6)=>e.map((o)=>`${o.x.toFixed(t)},${o.y.toFixed(t)}`).join("|"),U2n=(e,t)=>{if(MA(e,t))return"x";if(Ag(e,t))return"y";return null},bei=({path:e,collidingSegmentIndex:t,obstacle:n})=>{if(e.length<3||e.length>4)return[];let o=e.length-2;if(t!==0&&t!==o)return[];let r=t===o,i=r?[...e].reverse():e,[s,a,c]=i,l=U2n(s,a),h=U2n(a,c);if(!l||!h)return[];if(l===h)return[];let d=[...Ak(h,s,n),...Ak(h,c,n)],u=[...Ak(l,s,n),...Ak(l,c,n)],_=[];for(let p of[...new Set(d)])for(let m of[...new Set(u)]){let g=[...l==="y"?[s,{x:p,y:s.y},{x:p,y:m},{x:c.x,y:m},c]:[s,{x:s.x,y:p},{x:m,y:p},{x:m,y:c.y},c],...i.slice(3)],f=r?g.reverse():g;if(M8n(f))_.push(f)}return _},W2n=0.000000001,Iei=0.2,tve=(e,t,n)=>e>Math.min(t,n)+W2n&&e<Math.max(t,n)-W2n,vei=({path:e,collidingSegmentIndex:t,obstacle:n,clearance:o=Iei})=>{if(t<=0||t>=e.length-2)return[];let r=e[t],i=e[t+1],s=[];if(Ag(r,i)){let a=r.x<i.x,c=a?n.minX-o:n.maxX+o,l=a?n.maxX+o:n.minX-o;if(!tve(c,r.x,i.x)||!tve(l,r.x,i.x))return[];for(let h of[n.minY-o,n.maxY+o])s.push([{x:c,y:r.y},{x:c,y:h},{x:l,y:h},{x:l,y:i.y}])}else if(MA(r,i)){let a=r.y<i.y,c=a?n.minY-o:n.maxY+o,l=a?n.maxY+o:n.minY-o;if(!tve(c,r.y,i.y)||!tve(l,r.y,i.y))return[];for(let h of[n.minX-o,n.maxX+o])s.push([{x:r.x,y:c},{x:h,y:c},{x:h,y:l},{x:i.x,y:l}])}return s.map((a)=>[...e.slice(0,t+1),...a,...e.slice(t+1)]).filter(M8n)};function gat(e){let t=e.width/2,n=e.height/2;return{minX:e.center.x-t,maxX:e.center.x+t,minY:e.center.y-n,maxY:e.center.y+n}}var Sei=0.05,X2n=(e)=>e.kind==="text_box",Pei=(e)=>{let t=gat(e);return{kind:"chip",chipId:e.chipId,...t}},wy=(e,t={})=>{let n=e.chips.map(Pei),o=(e.textBoxes??[]).map((r)=>{let i=L9(r,t.textBoxPadding),s=n.find((l)=>l.chipId===r.chipId),a=s?eei(i,s):Number.POSITIVE_INFINITY,c=s&&a>0&&a<Sei?{minX:Math.min(i.minX,s.maxX),maxX:Math.max(i.maxX,s.minX),minY:Math.min(i.minY,s.maxY),maxY:Math.max(i.maxY,s.minY)}:i;return{kind:"text_box",textBox:r,...c}});return[...n,...o]},j2n=({pin1:e,pin2:t,overshoot:n})=>pat({x:e.x,y:e.y,facingDirection:e._facingDirection},{x:t.x,y:t.y,facingDirection:t._facingDirection},{overshoot:n}),Eei=({pin1:e,pin2:t})=>{let n=t.x-e.x,o=t.y-e.y;if(Math.abs(n)>=Math.abs(o))return n>0?e._facingDirection==="x+"&&t._facingDirection==="x-":e._facingDirection==="x-"&&t._facingDirection==="x+";return o>0?e._facingDirection==="y+"&&t._facingDirection==="y-":e._facingDirection==="y-"&&t._facingDirection==="y+"},Ede=(e)=>{let t=0;for(let n=0;n<e.length-1;n++)t+=Math.abs(e[n+1].x-e[n].x)+Math.abs(e[n+1].y-e[n].y);return t},Mei=({pins:e,obstacles:t})=>{let[n,o]=e,r=yei(n,o),i=j2n({pin1:n,pin2:o,overshoot:0.2}),s=Math.abs(n.x-o.x)+Math.abs(n.y-o.y),a=j2n({pin1:n,pin2:o,overshoot:Math.min(0.2,Math.max(0.02,s/4))}),c=Ede(a)<Ede(i),l=Ede(i)>s+0.000000001,h=CB(a,t)===null&&(Eei({pin1:n,pin2:o})&&l&&c||CB(i,t)!==null);return{path:r??(h?a:i),isDirectShortPath:r!==null}},gZ=class extends mu{pins;connectionPair;inputProblem;chipMap;obstacles;textObstacles;endpointTextObstacles;aabb;baseElbow;preferExteriorDetours;reserveNetLabelClearance;solvedTracePath=null;queue=[];visited=new Set;inferredPinIndexes=new Set;hasAmbiguousPinDirections=!1;constructor(e){super();this.pins=e.pins,this.connectionPair=e.connectionPair,this.inputProblem=e.inputProblem,this.chipMap=e.chipMap,this.preferExteriorDetours=e.preferExteriorDetours??!0,this.reserveNetLabelClearance=e.reserveNetLabelClearance??!0,this.obstacles=wy(this.inputProblem,{textBoxPadding:this.reserveNetLabelClearance?this.getTextBoxPaddingForConnectionPair():void 0}),this.textObstacles=new Set(this.obstacles.filter(X2n));let t=new Set(this.pins.map((c)=>c.chipId));this.endpointTextObstacles=new Set(this.obstacles.filter(X2n).filter((c)=>c.textBox.chipId!==void 0&&t.has(c.textBox.chipId)));let n=this.pins.map((c,l)=>{if(c._facingDirection)return[c._facingDirection];this.inferredPinIndexes.add(l);let h=this.pins[l===0?1:0];return dat(c,this.chipMap[c.chipId],h)}),o=n[0].flatMap((c,l)=>n[1].map((h,d)=>({directions:[c,h],preferenceIndex:l+d})));this.hasAmbiguousPinDirections=n.some((c)=>c.length>1);let r=o.map(({directions:c,preferenceIndex:l})=>{let h=this.pins.map((u,_)=>({...u,_facingDirection:c[_]})),d=Mei({pins:h,obstacles:this.obstacles});return{directions:c,baseElbow:d.path,isDirectShortPath:d.isDirectShortPath,preferenceIndex:l,collisionCount:CB(d.path,this.obstacles)===null?0:1,pathLength:Ede(d.path)}}).sort((c,l)=>c.collisionCount-l.collisionCount||c.pathLength-l.pathLength||c.preferenceIndex-l.preferenceIndex),i=r[0];for(let[c,l]of this.pins.entries())l._facingDirection=i.directions[c];let[s,a]=this.pins;if(this.baseElbow=i.baseElbow,i.isDirectShortPath)this.solvedTracePath=i.baseElbow;this.aabb=xei({x:s.x,y:s.y},{x:a.x,y:a.y});for(let c of r){let l=_nt(c.baseElbow);if(this.visited.has(l))continue;this.visited.add(l),this.queue.push({path:c.baseElbow,collisionRects:new Set,directions:c.directions})}}getConstructorParams(){return{chipMap:this.chipMap,pins:this.pins,connectionPair:this.connectionPair,inputProblem:this.inputProblem,preferExteriorDetours:this.preferExteriorDetours,reserveNetLabelClearance:this.reserveNetLabelClearance}}getTextBoxPaddingForConnectionPair(){if(!this.inputProblem.textBoxes?.length)return{};let e=this.connectionPair?.userNetId;if(!e)return{};let t=this.inputProblem.availableNetLabelOrientations[e]??["x+","x-","y+","y-"],n=PS({inputProblem:this.inputProblem,netId:e,pinIds:this.pins.map((i)=>i.pinId),isPortOnlyLabel:!1}),o=this.getNetLabelHeightForConnectionPair(e),r={minX:0,minY:0,maxX:0,maxY:0};for(let i of t){let{width:s,height:a}=S9({orientation:i,netLabelWidth:n,netLabelHeight:o});if(i==="y+"||i==="y-")if(r.minX=Math.max(r.minX,s/2),r.maxX=Math.max(r.maxX,s/2),i==="y+")r.minY=Math.max(r.minY,a);else r.maxY=Math.max(r.maxY,a);else if(r.minY=Math.max(r.minY,a/2),r.maxY=Math.max(r.maxY,a/2),i==="x+")r.minX=Math.max(r.minX,s);else r.maxX=Math.max(r.maxX,s)}return r}getNetLabelHeightForConnectionPair(e){let t=this.inputProblem.netConnections.find((o)=>o.netId===e)?.netLabelHeight;if(t!==void 0)return t;let n=this.pins.map((o)=>o.pinId);return this.inputProblem.netConnections.find((o)=>o.pinIds.some((r)=>n.includes(r)))?.netLabelHeight}axisOfSegment(e,t){if(MA(e,t))return"x";if(Ag(e,t))return"y";return null}pathLength(e){return Ede(e)}getPinBandPenalty(e){let t=0;for(let n=1;n<e.length-2;n++){let o=e[n],r=e[n+1];if(Ag(o,r)&&o.y>this.aabb.minY&&o.y<this.aabb.maxY)t+=10;else if(MA(o,r)&&o.x>this.aabb.minX&&o.x<this.aabb.maxX)t+=10}return t}isSegmentOutsidePinBand(e,t){if(Ag(e,t))return e.y<=this.aabb.minY||e.y>=this.aabb.maxY;if(MA(e,t))return e.x<=this.aabb.minX||e.x>=this.aabb.maxX;return!1}_step(){if(this.solvedTracePath){this.solved=!0;return}let e=this.queue.shift();if(!e){this.failed=!0,this.error="No collision-free path found";return}let{path:t,collisionRects:n,directions:o}=e,[r,i]=this.pins,s=CB(t,this.obstacles,{excludeRectsForSegment:(v)=>{let P=t.length-2,M=new Set,B=t[v],T=t[v+1],N=v===0?i:v===P?r:null;if(N)for(let V of this.textObstacles){let O=L9(V.textBox);if(V.textBox.chipId!==N.chipId||!X2(B,T,O))M.add(V)}let D=0.000000001,L=(V)=>[B,T].some((O)=>Math.abs(O.x-V.x)<=D&&Math.abs(O.y-V.y)<=D);for(let V of this.pins){if(!L(V))continue;let O=this.obstacles.find((U)=>U.kind==="chip"&&U.chipId===V.chipId);if(O&&H8e(B,T,O))M.add(O)}let H=v===1?2:v===P-1?P-2:null;if(H!==null&&H>=0&&H<P&&this.isSegmentOutsidePinBand(t[H],t[H+1]))for(let V of this.endpointTextObstacles){let O=L9(V.textBox);if(!X2(B,T,O))M.add(V)}return M}});if(!s){let v=t[0],P=t[t.length-1],M=0.000000001,B=(T,N)=>Math.abs(T.x-N.x)<0.000000001&&Math.abs(T.y-N.y)<0.000000001;if(B(v,{x:r.x,y:r.y})&&B(P,{x:i.x,y:i.y})&&(!this.hasAmbiguousPinDirections||mat({path:t,pin1:{...r,_facingDirection:o[0]},pin2:{...i,_facingDirection:o[1]}}))){for(let T of this.inferredPinIndexes){let N=T===0?L8e(t[0],t[1]):L8e(t.at(-1),t.at(-2));if(N)this.pins[T]._facingDirection=N}this.solvedTracePath=t,this.solved=!0}return}let a=s.segIndex,{segIndex:c,rect:l}=s,h=c===0,d=c===t.length-2,u=l.kind==="chip"&&this.pins.some((v)=>v.chipId===l.chipId);if((t.length===3||t.length===4&&this.connectionPair!==void 0&&!u)&&(h||d)){let v=bei({path:t,collidingSegmentIndex:c,obstacle:l}).filter((P)=>{let M=_nt(P);if(this.visited.has(M))return!1;return this.visited.add(M),!0}).sort((P,M)=>{if(t.length===4&&this.preferExteriorDetours)return this.getPinBandPenalty(P)-this.getPinBandPenalty(M)||this.pathLength(P)-this.pathLength(M);return this.pathLength(P)-this.pathLength(M)||this.getPinBandPenalty(P)-this.getPinBandPenalty(M)});for(let P of v){let M=new Set(n);M.add(l),this.queue.push({path:P,collisionRects:M,directions:o})}return}if(h){if(t.length<3)return;c=1}else if(d){if(t.length<3)return;c=t.length-3}let p=t[c],m=t[c+1],A=this.axisOfSegment(p,m);if(!A)return;let g=[],f={allowOpenSideCandidates:this.connectionPair!==void 0};if(n.size===0){let v=Ak(A,{x:r.x,y:r.y},l),P=Ak(A,{x:i.x,y:i.y},l),M=[...v,...P],B=[...new Set(M)];g.push(...B)}else{let v=G2n(A,l,n,this.aabb,f);g.push(...v)}let y=[],x=(v)=>{let P=_nt(v);if(this.visited.has(P))return;this.visited.add(P);let M=new Set(n);M.add(l),y.push({path:v,collisionRects:M,length:this.pathLength(v),pinBandPenalty:this.getPinBandPenalty(v)})},C=(v,P,M)=>{let B=_at(t,v,P,M);if(B)x(B)},b=t.length-2;if(this.connectionPair===void 0&&l.kind==="text_box"&&this.endpointTextObstacles.has(l)&&!n.has(l)&&a>0&&a<b)for(let v of vei({path:t,collidingSegmentIndex:a,obstacle:l}))x(v);for(let v of g)C(c,A,v);let I=a===1?[2]:a===b-1?[b-2]:[];for(let v of I){if(v<0||v>=b)continue;let P=this.axisOfSegment(t[v],t[v+1]);if(!P||P===A)continue;let M=[...Ak(P,{x:r.x,y:r.y},l),...Ak(P,{x:i.x,y:i.y},l)];if(n.size>0)M.push(...G2n(P,l,n,this.aabb,f));for(let B of[...new Set(M)])C(v,P,B)}y.sort((v,P)=>v.length-P.length||v.pinBandPenalty-P.pinBandPenalty);for(let v of y)this.queue.push({path:v.path,collisionRects:v.collisionRects,directions:o})}visualize(){let e=J0(this.inputProblem,{chipAlpha:0.1,connectionAlpha:0.1});e.lines.push({points:this.baseElbow,strokeColor:"red",strokeDash:"4 4"});let[t,n]=this.pins;e.lines.push({points:[{x:t.x,y:t.y},{x:n.x,y:n.y}],strokeColor:"blue",strokeDash:"5 5"});for(let{path:o}of this.queue)e.lines.push({points:o,strokeColor:"teal",strokeDash:"2 2"});if(this.solvedTracePath)e.lines.push({points:this.solvedTracePath,strokeColor:"green"});else if(this.queue.length>0)e.lines.push({points:this.queue[0].path,strokeColor:"orange"});return e}},K2n=({connectionPair:e,allConnectionPairs:t,inputProblem:n})=>{let[o,r]=e.pins;if(n.netConnections.some((s)=>s.pinIds.includes(o.pinId)&&s.pinIds.includes(r.pinId)))return!0;return t.some((s)=>{if(s===e)return!1;let[a,c]=s.pins;if(o.chipId===a.chipId&&r.chipId===c.chipId)return!0;return o.chipId===c.chipId&&r.chipId===a.chipId})},wei=class extends mu{inputProblem;mspConnectionPairs;dcConnMap;globalConnMap;queuedConnectionPairs;chipMap;currentConnectionPair=null;retryingWithoutNetLabelClearance=!1;solvedTracePaths=[];failedConnectionPairs=[];constructor(e){super();this.inputProblem=e.inputProblem,this.mspConnectionPairs=e.mspConnectionPairs,this.dcConnMap=e.dcConnMap,this.globalConnMap=e.globalConnMap,this.chipMap=e.chipMap,this.queuedConnectionPairs=[...this.mspConnectionPairs]}getConstructorParams(){return{inputProblem:this.inputProblem,chipMap:this.chipMap,mspConnectionPairs:this.mspConnectionPairs,dcConnMap:this.dcConnMap,globalConnMap:this.globalConnMap}}_step(){if(this.activeSubSolver?.solved)this.solvedTracePaths.push({...this.currentConnectionPair,pins:this.activeSubSolver.pins,tracePath:this.activeSubSolver.solvedTracePath,mspConnectionPairIds:[this.currentConnectionPair.mspPairId],pinIds:[this.currentConnectionPair.pins[0].pinId,this.currentConnectionPair.pins[1].pinId]}),this.activeSubSolver=null,this.currentConnectionPair=null,this.retryingWithoutNetLabelClearance=!1;if(this.activeSubSolver?.failed){if(this.currentConnectionPair&&!this.retryingWithoutNetLabelClearance&&this.activeSubSolver.hasAmbiguousPinDirections){let o=this.currentConnectionPair;this.retryingWithoutNetLabelClearance=!0,this.activeSubSolver=new gZ({inputProblem:this.inputProblem,pins:o.pins.map((r)=>({...r})),connectionPair:o,chipMap:this.chipMap,preferExteriorDetours:K2n({connectionPair:o,allConnectionPairs:this.mspConnectionPairs,inputProblem:this.inputProblem}),reserveNetLabelClearance:!1});return}if(this.currentConnectionPair)this.failedConnectionPairs.push({...this.currentConnectionPair,error:this.activeSubSolver.error||void 0});this.activeSubSolver=null,this.currentConnectionPair=null,this.retryingWithoutNetLabelClearance=!1}if(this.activeSubSolver){this.activeSubSolver.step();return}let e=this.queuedConnectionPairs.shift();if(!e){this.solved=!0;return}this.currentConnectionPair=e,this.retryingWithoutNetLabelClearance=!1;let n=e.pins.some((o)=>{if(o._facingDirection)return!1;let r=this.chipMap[o.chipId];return r&&dat(o,r).length>1})?e.pins.map((o)=>({...o})):e.pins;this.activeSubSolver=new gZ({inputProblem:this.inputProblem,pins:n,connectionPair:e,chipMap:this.chipMap,preferExteriorDetours:K2n({connectionPair:e,allConnectionPairs:this.mspConnectionPairs,inputProblem:this.inputProblem})})}visualize(){if(this.activeSubSolver)return this.activeSubSolver.visualize();let e=J0(this.inputProblem,{chipAlpha:0.1,connectionAlpha:0.1});for(let{mspPairId:t,tracePath:n}of this.solvedTracePaths)e.lines.push({points:n,strokeColor:"green"});for(let t of this.failedConnectionPairs)e.lines.push({points:[{x:t.pins[0].x,y:t.pins[0].y},{x:t.pins[1].x,y:t.pins[1].y}],strokeColor:"red",strokeDash:"4 2"});return e}},Bei=({pts:e,segmentIndex:t,offset:n,JOG_SIZE:o,EPS:r=0.000001})=>{if(t!==0&&t!==e.length-2)return;let i=e[t],s=e[t+1],a=Math.abs(i.x-s.x)<r,c=Math.abs(i.y-s.y)<r;if(!a&&!c)return;let l=a?s.y>i.y?1:-1:s.x>i.x?1:-1;if(e.length===2){if(a){let h=i.y+l*o,d=s.y-l*o;e.splice(1,0,{x:i.x,y:h},{x:i.x+n,y:h},{x:s.x+n,y:d},{x:s.x,y:d})}else{let h=i.x+l*o,d=s.x-l*o;e.splice(1,0,{x:h,y:i.y},{x:h,y:i.y+n},{x:d,y:s.y+n},{x:d,y:s.y})}return}if(t===0)if(a){let h=i.y+l*o;e.splice(1,1,{x:i.x,y:h},{x:i.x+n,y:h},{x:s.x+n,y:s.y})}else{let h=i.x+l*o;e.splice(1,1,{x:h,y:i.y},{x:h,y:i.y+n},{x:s.x,y:s.y+n})}else if(a){let h=s.y-l*o;e.splice(t,1,{x:i.x+n,y:i.y},{x:s.x+n,y:h},{x:s.x,y:h})}else{let h=s.x-l*o;e.splice(t,1,{x:i.x,y:i.y+n},{x:h,y:s.y+n},{x:h,y:s.y})}},yS=0.000001,Tei=class extends mu{overlappingTraceSegments;interactionKind;traceNetIslands;traceIdsToShift;obstacleRects;SHIFT_DISTANCE=0.1;correctedTraceMap={};constructor(e){super();this.overlappingTraceSegments=e.overlappingTraceSegments,this.interactionKind=e.interactionKind,this.traceNetIslands=e.traceNetIslands,this.traceIdsToShift=e.traceIdsToShift,this.obstacleRects=wy(e.inputProblem);for(let{connNetId:t,pathsWithOverlap:n}of this.overlappingTraceSegments)for(let{solvedTracePathIndex:o,traceSegmentIndex:r}of n){let i=this.traceNetIslands[t][o].mspPairId;this.correctedTraceMap[i]=this.traceNetIslands[t][o]}}_step(){let e=(c)=>c.pathsWithOverlap.some(({solvedTracePathIndex:l})=>this.traceNetIslands[c.connNetId][l].tracePath.length===2),t=this.overlappingTraceSegments.map((c)=>{if(!this.traceIdsToShift)return e(c);return c.pathsWithOverlap.every(({solvedTracePathIndex:l})=>{let h=this.traceNetIslands[c.connNetId][l];return!this.traceIdsToShift.has(h.mspPairId)})}),n=t.some((c)=>!c),o=(c)=>this.overlappingTraceSegments.map((l,h)=>{if(n&&t[h])return 0;let d=Math.floor(h/2)+1,u=h%2===0?c:-c;return this.getObstacleAwareOffset({group:l,offset:u*d*this.SHIFT_DISTANCE})}),r=o(-1);if(this.interactionKind==="overlap"&&this.overlappingTraceSegments.some((c)=>c.pathsWithOverlap.length>1)){this.correctedTraceMap=this.applyOffsets(r),this.solved=!0;return}let s=this.interactionKind==="overlap"?[r,o(1)]:[];if(this.interactionKind==="point_contact"){let c=this.overlappingTraceSegments.map((l,h)=>h).filter((l)=>!n||!t[l]).reverse();for(let l of c){let h=this.overlappingTraceSegments[l];for(let d of[-1,1]){let u=this.overlappingTraceSegments.map(()=>0);u[l]=this.getObstacleAwareOffset({group:h,offset:d*this.SHIFT_DISTANCE}),s.push(u)}}}let a=s.map((c)=>{let l=this.applyOffsets(c);return{correctedTraceMap:l,intersectionCount:this.countDifferentNetIntersections(l),totalDisplacement:c.reduce((h,d)=>h+Math.abs(d),0)}});a.sort((c,l)=>c.intersectionCount-l.intersectionCount||c.totalDisplacement-l.totalDisplacement),this.correctedTraceMap=a[0].correctedTraceMap,this.solved=!0}applyOffsets(e){let t={...this.correctedTraceMap},n=(r,i)=>Math.abs(r-i)<yS,o=(r,i)=>!!r&&!!i&&n(r.x,i.x)&&n(r.y,i.y);return this.overlappingTraceSegments.forEach((r,i)=>{let s=e[i];if(s===0)return;let a=new Map;for(let c of r.pathsWithOverlap){if(!a.has(c.solvedTracePathIndex))a.set(c.solvedTracePathIndex,new Set);a.get(c.solvedTracePathIndex).add(c.traceSegmentIndex)}for(let[c,l]of a){let h=this.traceNetIslands[r.connNetId][c],d=t[h.mspPairId]??h,u=d.tracePath.map((y)=>({...y})),_=Array.from(l).sort((y,x)=>y-x).reverse(),p=new Map;for(let y of _){let x=u[y],C=u[y+1];if(!x||!C)continue;if(Math.abs(x.x-C.x)<yS)p.set(y,"vertical");else if(Math.abs(x.y-C.y)<yS)p.set(y,"horizontal")}let m=new Set,A=new Set,g=this.SHIFT_DISTANCE;for(let y of _){if(y<0||y>=u.length-1)continue;if(y===0||y===u.length-2)Bei({pts:u,segmentIndex:y,offset:s,JOG_SIZE:g,EPS:yS});else{let x=u[y],C=u[y+1],b=p.get(y);if(b==="vertical"){if(!m.has(y))x.x+=s,m.add(y);if(!m.has(y+1))C.x+=s,m.add(y+1)}else if(b==="horizontal"){if(!A.has(y))x.y+=s,A.add(y);if(!A.has(y+1))C.y+=s,A.add(y+1)}}}let f=[];for(let y of u)if(f.length===0||!o(f[f.length-1],y))f.push(y);t[h.mspPairId]={...d,tracePath:f}}}),t}countDifferentNetIntersections(e){let t=Object.values(this.traceNetIslands).flatMap((o)=>o.map((r)=>e[r.mspPairId]??r)),n=0;for(let o=0;o<t.length;o++){let r=t[o];for(let i=o+1;i<t.length;i++){let s=t[i];if(r.globalConnNetId===s.globalConnNetId)continue;for(let a=0;a<r.tracePath.length-1;a++)for(let c=0;c<s.tracePath.length-1;c++)if(Z4(r.tracePath[a],r.tracePath[a+1],s.tracePath[c],s.tracePath[c+1]))n++}}return n}getObstacleAwareOffset({group:e,offset:t}){let n=this.getBlockingCollisions({group:e,offset:t});if(n.length===0)return t;let o=(a)=>n.some(({start:c,isVertical:l,obstacle:h})=>{let d,u,_;if(l)d=c.x,u=h.minX,_=h.maxX;else d=c.y,u=h.minY,_=h.maxY;let p=d+a;return d<=u+yS&&p>=_-yS||d>=_-yS&&p<=u+yS}),r=n.map(({start:a,isVertical:c,obstacle:l})=>{if(c)return{coord:a.x,lowEdge:l.minX,highEdge:l.maxX};return{coord:a.y,lowEdge:l.minY,highEdge:l.maxY}}),i=(a)=>r.flatMap(({coord:l,lowEdge:h,highEdge:d})=>[h-l-a,d-l+a]).filter((l)=>!o(l)).filter((l)=>this.getBlockingCollisions({group:e,offset:l}).length===0).sort((l,h)=>Math.abs(l-t)-Math.abs(h-t))[0],s=this.SHIFT_DISTANCE/10;return i(this.SHIFT_DISTANCE)??i(s)??t}getBlockingCollisions({group:e,offset:t}){let n=[];for(let{solvedTracePathIndex:o,traceSegmentIndex:r}of e.pathsWithOverlap){let i=this.traceNetIslands[e.connNetId][o],s=i.tracePath[r],a=i.tracePath[r+1];if(!s||!a)continue;let c=Math.abs(s.x-a.x)<yS,l=Math.abs(s.y-a.y)<yS;if(!c&&!l)continue;let h=c?[{...s,x:s.x+t},{...a,x:a.x+t}]:[{...s,y:s.y+t},{...a,y:a.y+t}],d=CB(h,this.obstacleRects);if(d)n.push({start:s,isVertical:c,obstacle:d.rect})}return n}visualize(){let e={lines:[],points:[],rects:[],circles:[]};for(let t of this.overlappingTraceSegments)for(let{solvedTracePathIndex:n,traceSegmentIndex:o}of t.pathsWithOverlap){let r=this.traceNetIslands[t.connNetId][n],i=r.tracePath[o],s=r.tracePath[o+1];e.lines.push({points:[i,s],strokeColor:"red"})}for(let t of Object.values(this.correctedTraceMap))e.lines.push({points:t.tracePath,strokeColor:"blue",strokeDash:"4 2"});return e}},$2n=0.000001,q2n=class extends mu{inputProblem;inputTracePaths;globalConnMap;traceIdsToShift;traceNetIslands={};correctedTraceMap={};recentTraceStates=[];cleanupPhase=null;constructor(e){super();this.inputProblem=e.inputProblem,this.inputTracePaths=e.inputTracePaths,this.globalConnMap=e.globalConnMap,this.traceIdsToShift=e.traceIdsToShift;for(let t of this.inputTracePaths){let{mspPairId:n}=t;this.correctedTraceMap[n]=t}this.rememberTraceState(this.correctedTraceMap),this.traceNetIslands=this.computeTraceNetIslands()}getConstructorParams(){return{inputProblem:this.inputProblem,inputTracePaths:this.inputTracePaths,globalConnMap:this.globalConnMap,traceIdsToShift:this.traceIdsToShift}}computeTraceNetIslands(){let e={};for(let t of this.inputTracePaths){let n=this.correctedTraceMap[t.mspPairId]??t,o=n.globalConnNetId;if(!e[o])e[o]=[];e[o].push(n)}return e}findNextOverlapIssue(){let t=Object.keys(this.traceNetIslands);for(let n=0;n<t.length;n++)for(let o=n+1;o<t.length;o++){let r=t[n],i=t[o],s=this.traceNetIslands[r]||[],a=this.traceNetIslands[i]||[],c=[],l=[],h=[],d=new Set,u=new Set,_=(A,g,f,y)=>{let x=Math.min(A,g),C=Math.max(A,g),b=Math.min(f,y),I=Math.max(f,y);return Math.min(C,I)-Math.max(x,b)},p=({pathAIndex:A,segmentAIndex:g,pathBIndex:f,segmentBIndex:y,rangeOverlap:x})=>{if(x>0.002){let T=`${A}:${g}`,N=`${f}:${y}`;if(!d.has(T))c.push({solvedTracePathIndex:A,traceSegmentIndex:g}),d.add(T);if(!u.has(N))l.push({solvedTracePathIndex:f,traceSegmentIndex:y}),u.add(N);return}if(x<-0.002)return;let C=s[A].tracePath,b=a[f].tracePath,I=C[g],v=C[g+1],P=b[y],M=b[y+1];if(g===0||g===C.length-2||y===0||y===b.length-2)return;h.push({pathAIndex:A,segmentAIndex:g,pathBIndex:f,segmentBIndex:y,combinedLength:Math.abs(I.x-v.x)+Math.abs(I.y-v.y)+Math.abs(P.x-M.x)+Math.abs(P.y-M.y)})};for(let A=0;A<s.length;A++){let g=s[A],f=g.tracePath;for(let y=0;y<f.length-1;y++){let x=f[y],C=f[y+1],b=Math.abs(x.x-C.x)<0.002,I=Math.abs(x.y-C.y)<0.002;if(!b&&!I)continue;for(let v=0;v<a.length;v++){let P=a[v];if(this.traceIdsToShift&&!this.traceIdsToShift.has(g.mspPairId)&&!this.traceIdsToShift.has(P.mspPairId))continue;let M=P.tracePath;for(let B=0;B<M.length-1;B++){let T=M[B],N=M[B+1],D=Math.abs(T.x-N.x)<0.002,L=Math.abs(T.y-N.y)<0.002;if(!D&&!L)continue;if(b&&D){if(Math.abs(x.x-T.x)<0.002)p({pathAIndex:A,segmentAIndex:y,pathBIndex:v,segmentBIndex:B,rangeOverlap:_(x.y,C.y,T.y,N.y)})}else if(I&&L){if(Math.abs(x.y-T.y)<0.002)p({pathAIndex:A,segmentAIndex:y,pathBIndex:v,segmentBIndex:B,rangeOverlap:_(x.x,C.x,T.x,N.x)})}}}}}if(c.length>0&&l.length>0)return{interactionKind:"overlap",overlappingTraceSegments:[{connNetId:r,pathsWithOverlap:c},{connNetId:i,pathsWithOverlap:l}]};let m=h.sort((A,g)=>g.combinedLength-A.combinedLength)[0];if(m)return{interactionKind:"point_contact",overlappingTraceSegments:[{connNetId:r,pathsWithOverlap:[{solvedTracePathIndex:m.pathAIndex,traceSegmentIndex:m.segmentAIndex}]},{connNetId:i,pathsWithOverlap:[{solvedTracePathIndex:m.pathBIndex,traceSegmentIndex:m.segmentBIndex}]}]}}return null}findNextDiagonalSegment(){for(let t in this.correctedTraceMap){let n=this.correctedTraceMap[t].tracePath;for(let o=0;o<n.length-1;o++){let r=n[o],i=n[o+1],s=Math.abs(r.y-i.y)<0.002,a=Math.abs(r.x-i.x)<0.002;if(!s&&!a)return{mspPairId:t,tracePath:n,i:o,p1:r,p2:i}}}return null}findAndFixNextDiagonalSegment(){let e=this.findNextDiagonalSegment();if(!e)return!1;let{mspPairId:t,tracePath:n,i:o,p1:r,p2:i}=e,s=0.002,a=o>0?n[o-1]:null,c=o+2<n.length?n[o+2]:null,l=a?Math.abs(a.x-r.x)<s:!1,h=a?Math.abs(a.y-r.y)<s:!1,d=c?Math.abs(i.x-c.x)<s:!1,u=c?Math.abs(i.y-c.y)<s:!1,_={x:r.x,y:i.y},p={x:i.x,y:r.y},m=0;if(l)m++;if(u)m++;let A=0;if(h)A++;if(d)A++;let g=m<A?_:p;return n.splice(o+1,0,g),!0}_step(){if(this.activeSubSolver?.solved){let o={...this.correctedTraceMap,...this.activeSubSolver.correctedTraceMap};if(this.returnsToPreviousTraceState(o)){this.activeSubSolver=null,this.solved=!0;return}this.correctedTraceMap=o,this.rememberTraceState(o),this.activeSubSolver=null,this.traceNetIslands=this.computeTraceNetIslands()}if(this.activeSubSolver){this.activeSubSolver.step();return}let e=this.findNextOverlapIssue();if(e===null){if(this.cleanupPhase===null)this.cleanupPhase="diagonals";if(this.cleanupPhase==="diagonals"){if(!this.findAndFixNextDiagonalSegment())this.cleanupPhase="done",this.solved=!0;return}this.solved=!0;return}let{interactionKind:t,overlappingTraceSegments:n}=e;this.activeSubSolver=new Tei({inputProblem:this.inputProblem,interactionKind:t,overlappingTraceSegments:n,traceNetIslands:this.traceNetIslands,traceIdsToShift:this.traceIdsToShift})}rememberTraceState(e){if(this.recentTraceStates.push({...e}),this.recentTraceStates.length>2)this.recentTraceStates.shift()}returnsToPreviousTraceState(e){if(this.recentTraceStates.length<2)return!1;let t=this.recentTraceStates[0],n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(let o of n){let r=e[o],i=t[o];if(!r||!i)return!1;if(r.tracePath.length!==i.tracePath.length)return!1;for(let s=0;s<r.tracePath.length;s++){let a=r.tracePath[s],c=i.tracePath[s];if(Math.abs(a.x-c.x)>$2n||Math.abs(a.y-c.y)>$2n)return!1}}return!0}visualize(){if(this.activeSubSolver)return this.activeSubSolver.visualize();let e=J0(this.inputProblem);e.circles=e.circles||[];for(let t of Object.values(this.correctedTraceMap))e.lines.push({points:t.tracePath,strokeColor:"purple"});if(this.cleanupPhase==="diagonals"){let t=this.findNextDiagonalSegment();if(t)e.lines.push({points:[t.p1,t.p2],strokeColor:"red",strokeWidth:0.05})}return e}},Dei=class{constructor(e=1/0,t=Float64Array,n=Uint32Array){let o=e!==1/0;this.ids=o?new n(e):[],this.values=o?new t(e):[],this.capacity=e,this.length=0}clear(){this.length=0}push(e,t){if(this.length===this.capacity)throw RangeError("Queue is at capacity.");let n=this.length++;while(n>0){let o=n-1>>1,r=this.values[o];if(t>=r)break;this.ids[n]=this.ids[o],this.values[n]=r,n=o}this.ids[n]=e,this.values[n]=t}pop(){if(this.length===0)return;let e=this.ids,t=this.values,n=e[0],o=--this.length;if(o>0){let r=e[o],i=t[o],s=0,a=o>>1;while(s<a){let c=(s<<1)+1,l=c+1,h=c+(+(l<o)&+(t[l]<t[c]));if(t[h]>=i)break;e[s]=e[h],t[s]=t[h],s=h}e[s]=r,t[s]=i}return n}peek(){return this.length>0?this.ids[0]:void 0}peekValue(){return this.length>0?this.values[0]:void 0}shrink(){if(Array.isArray(this.ids))this.ids.length=this.length;if(Array.isArray(this.values))this.values.length=this.length}},J2n=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],gnt=3,Hrt=class e{static from(t,n=0){if(n%8!==0)throw Error("byteOffset must be 8-byte aligned.");if(!t||t.byteLength===void 0||"buffer"in t)throw Error("Data must be an instance of ArrayBuffer or SharedArrayBuffer.");let[o,r]=new Uint8Array(t,n+0,2);if(o!==251)throw Error("Data does not appear to be in a Flatbush format.");let i=r>>4;if(i!==gnt)throw Error(`Got v${i} data when expected v${gnt}.`);let s=J2n[r&15];if(!s)throw Error("Unrecognized array type.");let[a]=new Uint16Array(t,n+2,1),[c]=new Uint32Array(t,n+4,1);return new e(c,a,s,void 0,t,n)}constructor(t,n=16,o=Float64Array,r=ArrayBuffer,i,s=0){if(t===void 0)throw Error("Missing required argument: numItems.");if(isNaN(t)||t<=0)throw Error(`Unexpected numItems value: ${t}.`);this.numItems=+t,this.nodeSize=Math.min(Math.max(+n,2),65535),this.byteOffset=s;let a=t,c=a;this._levelBounds=[a*4];do a=Math.ceil(a/this.nodeSize),c+=a,this._levelBounds.push(c*4);while(a!==1);this.ArrayType=o,this.IndexArrayType=c<16384?Uint16Array:Uint32Array;let l=J2n.indexOf(o),h=c*4*o.BYTES_PER_ELEMENT;if(l<0)throw Error(`Unexpected typed array class: ${o}.`);let d=o,u=this.IndexArrayType;if(i)this.data=i,this._boxes=new d(i,s+8,c*4),this._indices=new u(i,s+8+h,c),this._pos=c*4,this.minX=this._boxes[this._pos-4],this.minY=this._boxes[this._pos-3],this.maxX=this._boxes[this._pos-2],this.maxY=this._boxes[this._pos-1];else{let _=this.data=new r(8+h+c*this.IndexArrayType.BYTES_PER_ELEMENT);this._boxes=new d(_,8,c*4),this._indices=new u(_,8+h,c),this._pos=0,this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0,new Uint8Array(_,0,2).set([251,(gnt<<4)+l]),new Uint16Array(_,2,1)[0]=n,new Uint32Array(_,4,1)[0]=t}this._queue=new Dei}add(t,n,o=t,r=n){let i=this._pos,s=i>>2,a=this._boxes;if(this._indices[s]=s,a[i]=t,a[i+1]=n,a[i+2]=o,a[i+3]=r,this._pos=i+4,t<this.minX)this.minX=t;if(n<this.minY)this.minY=n;if(o>this.maxX)this.maxX=o;if(r>this.maxY)this.maxY=r;return s}finish(){if(this._pos>>2!==this.numItems)throw Error(`Added ${this._pos>>2} items when expected ${this.numItems}.`);let t=this._boxes;if(this.numItems<=this.nodeSize){t[this._pos++]=this.minX,t[this._pos++]=this.minY,t[this._pos++]=this.maxX,t[this._pos++]=this.maxY;return}let{numItems:n,minX:o,minY:r,nodeSize:i,_indices:s,_levelBounds:a}=this,c=this.maxX-o||1,l=this.maxY-r||1,h=new Int32Array(n),d=65535,u=d/c,_=d/l;for(let m=0,A=0;m<n;m++){let g=t[A++],f=t[A++],y=t[A++],x=t[A++],C=u*((g+y)/2-o)|0,b=_*((f+x)/2-r)|0;h[m]=kei(C,b)}Rei(h,t,s,0,n-1,i);let p=n*4;for(let m=0,A=0;m<a.length-1;m++){let g=a[m];while(A<g){let f=A,y=t[A++],x=t[A++],C=t[A++],b=t[A++];for(let I=1;I<i&&A<g;I++)y=Math.min(y,t[A++]),x=Math.min(x,t[A++]),C=Math.max(C,t[A++]),b=Math.max(b,t[A++]);s[p>>2]=f,t[p++]=y,t[p++]=x,t[p++]=C,t[p++]=b}}this._pos=p}search(t,n,o,r,i){if(this._pos!==this._boxes.length)throw Error("Data not yet indexed - call index.finish().");let{_boxes:s,_levelBounds:a,_indices:c,nodeSize:l}=this,h=this.numItems*4,d=s.length-4,u=a.length-1,_=[],p=[],m=!1;while(d!==void 0){let A=Math.min(d+l*4,a[u]),g=d>=h;if(m)this._collectContained(d,A,u,h,p,i);else for(let f=d;f<A;f+=4){let y=s[f];if(o<y)continue;let x=s[f+1];if(r<x)continue;let C=s[f+2];if(t>C)continue;let b=s[f+3];if(n>b)continue;let I=c[f>>2]|0;if(g){let v=+(t<=y&&n<=x&&o>=C&&r>=b);_.push(I|v,u-1)}else if(i===void 0||i(I,y,x,C,b))p.push(I)}if(u=_.pop(),d=_.pop(),d!==void 0)m=(d&1)===1,d&=-2}return p}_collectContained(t,n,o,r,i,s){let a=this._boxes,c=this._indices,l=t;for(let d=o;d>0;d--)l=c[l>>2];let h=Math.min(l+(n-t)*this.nodeSize**o,r);if(s===void 0)for(;l<h;l+=4)i.push(c[l>>2]|0);else for(;l<h;l+=4){let d=c[l>>2]|0;if(s(d,a[l],a[l+1],a[l+2],a[l+3]))i.push(d)}}neighbors(t,n,o=1/0,r=1/0,i){if(this._pos!==this._boxes.length)throw Error("Data not yet indexed - call index.finish().");let{_boxes:s,_levelBounds:a,_indices:c,_queue:l,nodeSize:h}=this,d=this.numItems*4,u=h*4,_=[],p=r*r,m=o===1,A=p;l.push(s.length-4<<1,0);while(l.length){let g=l.ids[0];if(g&1){if(l.pop(),_.push(g>>1),_.length===o)break;continue}l.pop();let f=g>>1,y=f<d,x=Math.min(f+u,Nei(f,a));for(let C=f;C<x;C+=4){let b=s[C],I=s[C+1],v=s[C+2],P=s[C+3],M=Math.max(Math.max(b-t,t-v),0),B=Math.max(Math.max(I-n,n-P),0),T=M*M+B*B;if(T>A)continue;let N=c[C>>2]|0;if(y){if(i===void 0||i(N)){if(l.push(N<<1|1,T),m&&T<A)A=T}}else l.push(N<<1,T)}}return l.clear(),_}};function Nei(e,t){let n=0,o=t.length-1;while(n<o){let r=n+o>>1;if(t[r]>e)o=r;else n=r+1}return t[n]}function Rei(e,t,n,o,r,i){let s=[o,r];while(s.length){let a=s.pop()||0,c=s.pop()||0;if(a-c<=i&&Math.floor(c/i)>=Math.floor(a/i))continue;let l=e[c],h=e[c+a>>1],d=e[a],u=l>h!==l>d?l:h<l!==h<d?h:d,_=c-1,p=a+1;while(!0){do _++;while(e[_]<u);do p--;while(e[p]>u);if(_>=p)break;Qei(e,t,n,_,p)}s.push(c,p,p+1,a)}}function Qei(e,t,n,o,r){let i=e[o];e[o]=e[r],e[r]=i;let s=4*o,a=4*r,c=t[s],l=t[s+1],h=t[s+2],d=t[s+3];t[s]=t[a],t[s+1]=t[a+1],t[s+2]=t[a+2],t[s+3]=t[a+3],t[a]=c,t[a+1]=l,t[a+2]=h,t[a+3]=d;let u=n[o];n[o]=n[r],n[r]=u}function kei(e,t){let n=e^t,o=65535^n,r=65535^(e|t),i=e&(t^65535),s=n|o>>1,a=n>>1^n,c=r^(r>>1^o&i>>1),l=i^(n&r>>1^i>>1);return n=s&s>>2^a&a>>2,o=s&a>>2^a&(s^a)>>2,r=c^(s&c>>2^a&l>>2),i=l^(a&c>>2^(s^a)&l>>2),s=n&n>>4^o&o>>4,a=n&o>>4^o&(n^o)>>4,c=r^(n&r>>4^o&i>>4),l=i^(o&r>>4^(n^o)&i>>4),r=c^(s&c>>8^a&l>>8),i=l^(a&c>>8^(s^a)&l>>8),r^=r>>1,i^=i>>1,n=e^t,o=i|65535^(n|r),n=(n|n<<8)&16711935,n=(n|n<<4)&252645135,n=(n|n<<2)&858993459,n=(n|n<<1)&1431655765,o=(o|o<<8)&16711935,o=(o|o<<4)&252645135,o=(o|o<<2)&858993459,o=(o|o<<1)&1431655765,((o<<1|n)>>>0)-2147483648}var O7e=class{chips;spatialIndex;spatialIndexIdToChip;constructor(e){this.chips=e.map((t)=>({...t,bounds:gat(t),spatialIndexId:null})),this.spatialIndexIdToChip=new Map,this.spatialIndex=new Hrt(e.length);for(let t of this.chips)t.spatialIndexId=this.spatialIndex.add(t.bounds.minX,t.bounds.minY,t.bounds.maxX,t.bounds.maxY),this.spatialIndexIdToChip.set(t.spatialIndexId,t);this.spatialIndex.finish()}getChipsInBounds(e){return this.spatialIndex.search(e.minX,e.minY,e.maxX,e.maxY).map((n)=>this.spatialIndexIdToChip.get(n))}doesOrthogonalLineIntersectChip(e,t={}){let n=t.excludeChipIds??[],[o,r]=e,{x:i,y:s}=o,{x:a,y:c}=r;return this.getChipsInBounds({minX:Math.min(i,a),minY:Math.min(s,c),maxX:Math.max(i,a),maxY:Math.max(s,c)}).filter((h)=>!n.includes(h.chipId)).length>0}};function H9(e,t,n,o=0.000000001){let r=Math.abs(e.x-t.x)<o,i=Math.abs(e.y-t.y)<o;if(!r&&!i)return!1;if(r){let s=e.x;if(s<n.minX-o||s>n.maxX+o)return!1;let a=Math.min(e.y,t.y),c=Math.max(e.y,t.y);return Math.min(c,n.maxY)-Math.max(a,n.minY)>o}else{let s=e.y;if(s<n.minY-o||s>n.maxY+o)return!1;let a=Math.min(e.x,t.x),c=Math.max(e.x,t.x);return Math.min(c,n.maxX)-Math.max(a,n.minX)>o}}function Aat(e,t,n,o){for(let[r,i]of Object.entries(t)){let s=i.tracePath;for(let a=0;a<s.length-1;a++){if(r===n&&a===o)continue;if(H9(s[a],s[a+1],e))return{hasIntersection:!0,mspPairId:r,segIndex:a}}}return{hasIntersection:!1}}function Z2n(e){let t=0,n=e.tracePath;for(let o=0;o<n.length-1;o++)t+=Math.abs(n[o+1].x-n[o].x)+Math.abs(n[o+1].y-n[o].y);return t}function w8n(e){let{inputProblem:t,inputTraceMap:n,globalConnNetId:o,fallbackTrace:r,mspConnectionPairIds:i}=e,s=Object.fromEntries(t.chips.map((u)=>[u.chipId,u])),a=Object.values(n).filter((u)=>u.globalConnNetId===o);if(i&&i.length>0){let u=new Set(i);a=a.filter((_)=>_.mspConnectionPairIds.some((p)=>u.has(p)))}let c=new Set;for(let u of a)c.add(u.pins[0].chipId),c.add(u.pins[1].chipId);let l=null,h=-1;for(let u of c){let p=s[u]?.pins?.length??0;if(p>h)h=p,l=u}let d=l==null?[]:a.filter((u)=>u.pins[0].chipId===l||u.pins[1].chipId===l);if(d.length>0)return d.reduce((u,_)=>Z2n(u)>=Z2n(_)?u:_);return r}function Lei(e,t){return[{x:e.x,y:e.y},{x:(e.x+t.x)/2,y:(e.y+t.y)/2},{x:t.x,y:t.y}]}function Hei(e){let{inputProblem:t,inputTraceMap:n,chipObstacleSpatialIndex:o,overlappingSameNetTraceGroup:r,availableOrientations:i,netLabelWidth:s,netLabelHeight:a}=e,c=r.portOnlyPinId;if(!c)return{placement:null,testedCandidates:[],error:"No portOnlyPinId provided"};let l=null,h=null;for(let I of t.chips){let v=I.pins.find((P)=>P.pinId===c);if(v){l={x:v.x,y:v.y},h=v._facingDirection||Lb(v,I);break}}if(!l||!h)return{placement:null,testedCandidates:[],error:`Port-only pin not found: ${c}`};let d=i.length>0?i:["x+","x-","y+","y-"],u={x:l.x,y:l.y},_=(I)=>I==="x+"?{x:1,y:0}:I==="x-"?{x:-1,y:0}:I==="y+"?{x:0,y:1}:{x:0,y:-1},p=[];for(let I of d){let{width:v,height:P}=S9({orientation:I,netLabelWidth:s,netLabelHeight:a}),M=kf(u,I,v,P),B=_(I),T=0.001,N={x:M.x+B.x*0.001,y:M.y+B.y*0.001},D=zi(N,v,P);if(o.getChipsInBounds(D).length>0){p.push({center:N,width:v,height:P,bounds:D,anchor:u,orientation:I,status:"chip-collision",hostSegIndex:-1});continue}if(DZ(D,t)){p.push({center:N,width:v,height:P,bounds:D,anchor:u,orientation:I,status:"text-collision",hostSegIndex:-1});continue}if(Aat(D,n,"",-1).hasIntersection){p.push({center:N,width:v,height:P,bounds:D,anchor:u,orientation:I,status:"trace-collision",hostSegIndex:-1});continue}return p.push({center:N,width:v,height:P,bounds:D,anchor:u,orientation:I,status:"ok",hostSegIndex:-1}),{placement:{globalConnNetId:r.globalConnNetId,dcConnNetId:void 0,netId:r.netId,netLabelText:r.netLabelText,mspConnectionPairIds:[],pinIds:[c],orientation:I,anchorPoint:u,width:v,height:P,center:N},testedCandidates:p}}let m=h,{width:A,height:g}=S9({orientation:m,netLabelWidth:s}),f=kf(u,m,A,g),y=_(m),x=0.001,C={x:f.x+y.x*x,y:f.y+y.y*x};return{placement:{globalConnNetId:r.globalConnNetId,dcConnNetId:void 0,netId:r.netId,netLabelText:r.netLabelText,mspConnectionPairIds:[],pinIds:[c],orientation:m,anchorPoint:u,width:A,height:g,center:C},testedCandidates:p}}function Fei(e){let t=J0(e.inputProblem),n=e.overlappingSameNetTraceGroup.globalConnNetId,o=w8n({inputProblem:e.inputProblem,inputTraceMap:e.inputTraceMap,globalConnNetId:n,fallbackTrace:e.overlappingSameNetTraceGroup.overlappingTraces}),r=Ic(n,0.9),i=Ic(n,0.5);for(let s of Object.values(e.inputTraceMap)){let a=o?s.mspPairId===o.mspPairId:!1;t.lines.push({points:s.tracePath})}for(let s of e.testedCandidates){let a=s.status==="ok"?"rgba(0, 180, 0, 0.25)":s.status==="chip-collision"?"rgba(220, 0, 0, 0.25)":s.status==="trace-collision"?"rgba(220, 140, 0, 0.25)":s.status==="text-collision"?"rgba(160, 0, 220, 0.2)":"rgba(120, 120, 120, 0.15)",c=s.status==="ok"?"green":s.status==="chip-collision"?"red":s.status==="trace-collision"?"orange":s.status==="text-collision"?"purple":"gray",l=s.status==="ok"?"status: ok(valid net label candidate)":s.status==="chip-collision"?"status: chip-collision":s.status==="trace-collision"?"status: trace-collision":s.status==="text-collision"?"status: text-collision":"status: parallel-to-segment";t.rects.push({center:{x:(s.bounds.minX+s.bounds.maxX)/2,y:(s.bounds.minY+s.bounds.maxY)/2},width:s.width,height:s.height,fill:a,strokeColor:c,label:`${l}
orientation: ${s.orientation}`}),t.points.push({x:s.anchor.x,y:s.anchor.y,color:c,label:`anchor
orientation: ${s.orientation}`})}if(e.netLabelPlacement){let s=e.netLabelPlacement;t.rects.push({center:s.center,width:s.width,height:s.height,fill:"rgba(0, 128, 255, 0.35)",strokeColor:"blue",label:`netId: ${s.netId}
globalConnNetId: ${s.globalConnNetId}`}),t.points.push({x:s.anchorPoint.x,y:s.anchorPoint.y,color:"blue",label:`anchor
orientation: ${s.orientation}`})}return t}var e1n=class extends mu{inputProblem;inputTraceMap;overlappingSameNetTraceGroup;availableOrientations;chipObstacleSpatialIndex;netLabelWidth;netLabelHeight;netLabelPlacement=null;testedCandidates=[];constructor(e){super();this.inputProblem=e.inputProblem,this.inputTraceMap=e.inputTraceMap,this.overlappingSameNetTraceGroup=e.overlappingSameNetTraceGroup,this.availableOrientations=e.availableOrientations,this.netLabelWidth=e.netLabelWidth,this.netLabelHeight=e.netLabelHeight,this.chipObstacleSpatialIndex=e.inputProblem._chipObstacleSpatialIndex??new O7e(e.inputProblem.chips)}getConstructorParams(){return{inputProblem:this.inputProblem,inputTraceMap:this.inputTraceMap,overlappingSameNetTraceGroup:this.overlappingSameNetTraceGroup,availableOrientations:this.availableOrientations,netLabelWidth:this.netLabelWidth,netLabelHeight:this.netLabelHeight}}_step(){if(this.netLabelPlacement){this.solved=!0;return}if(this.overlappingSameNetTraceGroup.portOnlyPinId){let d=Hei({inputProblem:this.inputProblem,inputTraceMap:this.inputTraceMap,chipObstacleSpatialIndex:this.chipObstacleSpatialIndex,overlappingSameNetTraceGroup:this.overlappingSameNetTraceGroup,availableOrientations:this.availableOrientations,netLabelWidth:this.netLabelWidth,netLabelHeight:this.netLabelHeight});if(this.testedCandidates.push(...d.testedCandidates),d.placement){this.netLabelPlacement=d.placement,this.solved=!0;return}this.failed=!0,this.error=d.error??"Could not place net label at port without collisions";return}let e=this.overlappingSameNetTraceGroup.globalConnNetId,t=w8n({inputProblem:this.inputProblem,inputTraceMap:this.inputTraceMap,globalConnNetId:e,fallbackTrace:this.overlappingSameNetTraceGroup.overlappingTraces,mspConnectionPairIds:this.overlappingSameNetTraceGroup.mspConnectionPairIds});if(!t){this.failed=!0,this.error="No host trace found for net label placement";return}let n=new Set(this.overlappingSameNetTraceGroup.mspConnectionPairIds??[]),o=Object.values(this.inputTraceMap).filter((d)=>d.globalConnNetId===e&&(n.size===0||d.mspConnectionPairIds.some((u)=>n.has(u)))),r=this.availableOrientations.length===1?[t,...o.filter((d)=>d.mspPairId!==t.mspPairId)]:[t],i=this.availableOrientations.length>0?this.availableOrientations:["x+","x-","y+","y-"],s=this.availableOrientations.length===1,a=(d,u)=>{switch(d){case"y+":return u.y;case"y-":return-u.y;case"x+":return u.x;case"x-":return-u.x}},c=null,l=-1/0,h=0.000001;for(let d of r){let u=d.tracePath.slice();for(let _=0;_<u.length-1;_++){let p=u[_],m=u[_+1],A=Math.abs(p.y-m.y)<h,g=Math.abs(p.x-m.x)<h;if(!A&&!g)continue;let f=A?["y+","y-"]:["x+","x-"],y=i.filter((C)=>f.includes(C));if(y.length===0)continue;let x=Lei(p,m);for(let C of x)for(let b of y){let{width:I,height:v}=S9({orientation:b,netLabelWidth:this.netLabelWidth,netLabelHeight:this.netLabelHeight}),P=kf(C,b,I,v),M=b==="x+"?{x:1,y:0}:b==="x-"?{x:-1,y:0}:b==="y+"?{x:0,y:1}:{x:0,y:-1},B=0.0001,T={x:P.x+M.x*0.0001,y:P.y+M.y*0.0001},N=zi(T,I,v);if(this.chipObstacleSpatialIndex.getChipsInBounds(N).length>0){this.testedCandidates.push({center:T,width:I,height:v,bounds:N,anchor:C,orientation:b,status:"chip-collision",hostSegIndex:_});continue}if(DZ(N,this.inputProblem)){this.testedCandidates.push({center:T,width:I,height:v,bounds:N,anchor:C,orientation:b,status:"text-collision",hostSegIndex:_});continue}if(Aat(N,this.inputTraceMap,d.mspPairId,_).hasIntersection){this.testedCandidates.push({center:T,width:I,height:v,bounds:N,anchor:C,orientation:b,status:"trace-collision",hostSegIndex:_});continue}if(this.testedCandidates.push({center:T,width:I,height:v,bounds:N,anchor:C,orientation:b,status:"ok",hostSegIndex:_}),s){let H=a(b,C);if(H>l+0.000000001)l=H,c={anchor:C,orientation:b,width:I,height:v,center:P,hostSegIndex:_,dcConnNetId:d.dcConnNetId,mspPairId:d.mspPairId,pinIds:[d.pins[0].pinId,d.pins[1].pinId]};continue}this.netLabelPlacement={globalConnNetId:this.overlappingSameNetTraceGroup.globalConnNetId,dcConnNetId:d.dcConnNetId,netId:this.overlappingSameNetTraceGroup.netId,netLabelText:this.overlappingSameNetTraceGroup.netLabelText,mspConnectionPairIds:[d.mspPairId],pinIds:[d.pins[0].pinId,d.pins[1].pinId],orientation:b,anchorPoint:C,width:I,height:v,center:P},this.solved=!0;return}}}if(s&&c){this.netLabelPlacement={globalConnNetId:this.overlappingSameNetTraceGroup.globalConnNetId,dcConnNetId:c.dcConnNetId,netId:this.overlappingSameNetTraceGroup.netId,netLabelText:this.overlappingSameNetTraceGroup.netLabelText,mspConnectionPairIds:[c.mspPairId],pinIds:c.pinIds,orientation:c.orientation,anchorPoint:c.anchor,width:c.width,height:c.height,center:c.center},this.solved=!0;return}this.failed=!0,this.error="Could not place net label without collisions"}visualize(){return Fei(this)}};var F8e=({pinIds:e,traces:t})=>{let n=new Map;for(let s of e)n.set(s,new Set);let o=t.filter((s)=>{if(s.pins.length!==2)return!1;let[a,c]=s.pins;return n.has(a.pinId)&&n.has(c.pinId)});for(let s of o){let[a,c]=s.pins;n.get(a.pinId).add(c.pinId),n.get(c.pinId).add(a.pinId)}let r=[],i=new Set;for(let s of e){if(i.has(s))continue;let a=[],c=[s];i.add(s);while(c.length>0){let h=c.pop();a.push(h);for(let d of n.get(h)??[]){if(i.has(d))continue;i.add(d),c.push(d)}}let l=new Set(a);r.push({pinIds:a,traces:o.filter((h)=>h.pins.every((d)=>l.has(d.pinId)))})}return r},t1n=class extends mu{inputProblem;inputTraceMap;overlappingSameNetTraceGroups;queuedOverlappingSameNetTraceGroups;netLabelPlacements=[];failedGroups=[];currentGroup=null;triedAnyOrientationFallbackForCurrentGroup=!1;constructor(e){super();this.inputProblem=e.inputProblem,this.inputTraceMap=e.inputTraceMap,this.overlappingSameNetTraceGroups=this.computeOverlappingSameNetTraceGroups(),this.queuedOverlappingSameNetTraceGroups=[...this.overlappingSameNetTraceGroups]}computeOverlappingSameNetTraceGroups(){let e={};for(let c of Object.values(this.inputTraceMap)){let l=c.globalConnNetId;if(!e[l])e[l]=[];e[l].push(c)}let{netConnMap:t}=Qb(this.inputProblem),n=new Map;for(let c of this.inputProblem.chips)for(let l of c.pins)n.set(l.pinId,l);let o={},r={};for(let c of this.inputProblem.directConnections){if(c.netId){let[h,d]=c.pinIds;o[h]=c.netId,o[d]=c.netId}let l=c.netLabelText?.trim();if(l){let[h,d]=c.pinIds;r[h]=l,r[d]=l}}for(let c of this.inputProblem.netConnections)for(let l of c.pinIds){o[l]=c.netId;let h=c.netLabelText?.trim();if(h)r[l]=h}let i=[],s=this.inputProblem.chips.flatMap((c)=>c.pins.map((l)=>l.pinId)),a=new Set;for(let c of s){let l=t.getNetConnectedToId(c);if(l)a.add(l)}for(let c of a){let h=t.getIdsConnectedToNet(c).filter((d)=>n.has(d));for(let d of F8e({pinIds:h,traces:e[c]??[]})){let u=new Set(d.pinIds),_=d.traces;if(_.length>0){if(_.some((x)=>x.suppressNetLabel))continue;let p=(x)=>{let C=0,b=x.tracePath;for(let I=0;I<b.length-1;I++)C+=Math.abs(b[I+1].x-b[I].x)+Math.abs(b[I+1].y-b[I].y);return C},m=_[0],A=p(m);for(let x=1;x<_.length;x++){let C=p(_[x]);if(C>A)m=_[x],A=C}let g=_.find((x)=>x.userNetId!=null)?.userNetId;if(!g){for(let x of u)if(o[x]){g=o[x];break}}let f=Array.from(new Set(_.flatMap((x)=>x.mspConnectionPairIds??[x.mspPairId]))),y={globalConnNetId:c,netId:g,netLabelText:[...u].map((x)=>r[x]).find((x)=>Boolean(x)),overlappingTraces:m,mspConnectionPairIds:f};i.push(y)}else for(let p of u){let m=o[p];if(!m)continue;i.push({globalConnNetId:c,netId:m,netLabelText:r[p],portOnlyPinId:p})}}}return i}getNetLabelWidthForGroup(e){let t=e.overlappingTraces?.pins.map((n)=>n.pinId)??[];if(e.portOnlyPinId)t.push(e.portOnlyPinId);return PS({inputProblem:this.inputProblem,netId:e.netId,pinIds:t,isPortOnlyLabel:e.portOnlyPinId!==void 0})}getNetLabelHeightForGroup(e){if(e.netId){let n=this.inputProblem.netConnections.find((o)=>o.netId===e.netId)?.netLabelHeight;if(n!==void 0)return n}let t=e.overlappingTraces?.pins.map((n)=>n.pinId)??[];if(e.portOnlyPinId)t.push(e.portOnlyPinId);return this.inputProblem.netConnections.find((n)=>n.pinIds.some((o)=>t.includes(o)))?.netLabelHeight}_step(){if(this.activeSubSolver?.solved){this.netLabelPlacements.push(this.activeSubSolver.netLabelPlacement),this.activeSubSolver=null,this.currentGroup=null,this.triedAnyOrientationFallbackForCurrentGroup=!1;return}if(this.activeSubSolver?.failed){let r=["x+","x-","y+","y-"],i=this.activeSubSolver.availableOrientations,s=i.length===4&&r.every((a)=>i.includes(a));if(!this.triedAnyOrientationFallbackForCurrentGroup&&!s&&this.currentGroup){this.triedAnyOrientationFallbackForCurrentGroup=!0;let a=this.getNetLabelWidthForGroup(this.currentGroup),c=this.getNetLabelHeightForGroup(this.currentGroup);this.activeSubSolver=new e1n({inputProblem:this.inputProblem,inputTraceMap:this.inputTraceMap,overlappingSameNetTraceGroup:this.currentGroup,availableOrientations:r,netLabelWidth:a,netLabelHeight:c});return}if(this.currentGroup)this.failedGroups.push(this.currentGroup);this.activeSubSolver=null,this.currentGroup=null,this.triedAnyOrientationFallbackForCurrentGroup=!1;return}if(this.activeSubSolver){this.activeSubSolver.step();return}let e=this.queuedOverlappingSameNetTraceGroups.shift();if(!e){this.solved=!0;return}let t=e.netId??e.globalConnNetId;this.currentGroup=e,this.triedAnyOrientationFallbackForCurrentGroup=!1;let n=this.getNetLabelWidthForGroup(this.currentGroup),o=this.getNetLabelHeightForGroup(this.currentGroup);this.activeSubSolver=new e1n({inputProblem:this.inputProblem,inputTraceMap:this.inputTraceMap,overlappingSameNetTraceGroup:e,availableOrientations:this.inputProblem.availableNetLabelOrientations[t]??["x+","x-","y+","y-"],netLabelWidth:n,netLabelHeight:o})}visualize(){if(this.activeSubSolver)return this.activeSubSolver.visualize();let e=J0(this.inputProblem);for(let t of Object.values(this.inputTraceMap))e.lines.push({points:t.tracePath,strokeColor:"purple"});for(let t of this.netLabelPlacements)e.rects.push({center:t.center,width:t.width,height:t.height,fill:Ic(t.globalConnNetId,0.35),strokeColor:Ic(t.globalConnNetId,0.9),label:`netId: ${t.netId}
globalConnNetId: ${t.globalConnNetId}`}),e.points.push({x:t.anchorPoint.x,y:t.anchorPoint.y,color:Ic(t.globalConnNetId,0.9),label:`anchorPoint
orientation: ${t.orientation}`});return e}},zei="#ef4444",Oei="#000000",Vei="66",Yei=(e,t)=>{let n=t.availableNetLabelOrientations;if(!n)return;for(let o of e.rects??[]){let r=Gei(o.label,n);if(!r)continue;let i=r.includes("y+"),s=r.includes("y-");if(i===s)continue;let a=i?zei:Oei;o.fill=`${a}${Vei}`,o.stroke=a,o.color=a}},Gei=(e,t)=>{for(let n of Uei(e))if(Object.hasOwn(t,n))return t[n];return},Uei=(e)=>{if(!e)return[];return[e.match(/^netId: (.+)$/m)?.[1],e.match(/^globalConnNetId: (.+)$/m)?.[1]].filter((t)=>Boolean(t&&t!=="undefined"))},Wei=({labels:e,chips:t})=>{let n={},o=new Map(t.flatMap((r)=>r.pins.map((i)=>[i.pinId,r.chipId])));for(let r of e){if(r.pinIds.length===0)continue;let i=r.pinIds[0],a=(i.includes(".")?i.split(".")[0]:void 0)??o.get(i);if(!a)continue;let c=`${a}-${r.orientation}`;if(!n[c])n[c]=[];n[c].push(r)}return n},Xei=(e,t)=>{if(e.length===0)throw Error("Cannot merge an empty group of labels.");let n=1/0,o=1/0,r=-1/0,i=-1/0,s=new Set,a=new Set,c=new Set;for(let m of e){let A=zi(m.center,m.width,m.height);n=Math.min(n,A.minX),o=Math.min(o,A.minY),r=Math.max(r,A.maxX),i=Math.max(i,A.maxY),m.pinIds.forEach((g)=>s.add(g)),m.mspConnectionPairIds.forEach((g)=>a.add(g)),c.add(m.globalConnNetId)}let l=r-n,h=i-o,d={x:n+l/2,y:o+h/2},u=e[0],_=`merged-group-${t}`;return{mergedLabel:{...u,globalConnNetId:_,center:d,width:l,height:h,pinIds:Array.from(s),mspConnectionPairIds:Array.from(a)},originalNetIds:c}},jei=({labels:e,traces:t,distanceThreshold:n=0.5})=>{let o=new Map;if(!t)throw Error("No traces provided to filterLabelsAtTraceEdges");for(let i of t){if(!i.globalConnNetId)continue;if(!o.has(i.globalConnNetId))o.set(i.globalConnNetId,[]);o.get(i.globalConnNetId).push(i)}let r=[];for(let i of e){if(i.mspConnectionPairIds.length===0){r.push(i);continue}let s=o.get(i.globalConnNetId),a=!1;if(!s||s.length===0)continue;for(let c of s){if(c.tracePath.length===0)continue;let l=c.tracePath[0],h=c.tracePath[c.tracePath.length-1],d=k9(i.center,l),u=k9(i.center,h);if(d<=n||u<=n){a=!0;break}}if(a)r.push(i)}return r},n1n=class extends mu{input;output;inputProblem;traces;pipelineStep="filtering_labels";filteredLabels=[];labelGroups={};groupKeysToProcess=[];finalPlacements=[];mergedLabelNetIdMap={};activeMergingGroupKey=null;constructor(e){super();this.input=e,this.inputProblem=e.inputProblem,this.traces=e.traces,this.output={netLabelPlacements:e.netLabelPlacements,mergedLabelNetIdMap:{}}}_step(){switch(this.pipelineStep){case"filtering_labels":this.filteredLabels=jei({labels:this.input.netLabelPlacements,traces:this.traces}),this.pipelineStep="grouping_labels";break;case"grouping_labels":this.labelGroups=Wei({labels:this.filteredLabels,chips:this.inputProblem.chips}),this.groupKeysToProcess=Object.keys(this.labelGroups),this.pipelineStep="merging_groups";break;case"merging_groups":if(this.groupKeysToProcess.length===0){this.pipelineStep="finalizing",this.activeMergingGroupKey=null;break}let e=this.groupKeysToProcess.pop();this.activeMergingGroupKey=e;let t=this.labelGroups[e];if(t.length>1){let{mergedLabel:r,originalNetIds:i}=Xei(t,e);this.finalPlacements.push(r),this.mergedLabelNetIdMap[r.globalConnNetId]=i}else this.finalPlacements.push(...t);break;case"finalizing":let n=new Set(this.finalPlacements.flatMap((r)=>this.mergedLabelNetIdMap[r.globalConnNetId]?[...this.mergedLabelNetIdMap[r.globalConnNetId]]:[r.globalConnNetId])),o=this.input.netLabelPlacements.filter((r)=>!n.has(r.globalConnNetId));this.output={netLabelPlacements:[...this.finalPlacements,...o],mergedLabelNetIdMap:this.mergedLabelNetIdMap},this.solved=!0;break}}getOutput(){return this.output}visualize(){let e=J0(this.inputProblem,{chipAlpha:0.1,connectionAlpha:0.1});if(!e.rects)e.rects=[];if(!e.lines)e.lines=[];if(!e.points)e.points=[];if(!e.texts)e.texts=[];let t=new Map;for(let n of this.input.netLabelPlacements)t.set(n.globalConnNetId,n);for(let n of this.traces){let o={points:n.tracePath.map((r)=>({x:r.x,y:r.y})),strokeColor:"blue"};e.lines.push(o)}if(this.activeMergingGroupKey&&this.labelGroups[this.activeMergingGroupKey]){let n=this.labelGroups[this.activeMergingGroupKey];for(let o of n)e.rects.push({center:o.center,width:o.width,height:o.height,fill:"rgba(255, 165, 0, 0.5)",stroke:"orange"})}for(let n of this.output.netLabelPlacements){let o=n.globalConnNetId.startsWith("merged-group-"),r=Ic(n.globalConnNetId);if(o){e.rects.push({center:n.center,width:n.width,height:n.height,fill:r.replace(/, 1\)/,", 0.2)"),stroke:r,label:n.globalConnNetId});let i=this.output.mergedLabelNetIdMap[n.globalConnNetId];if(i)for(let s of i){let a=t.get(s);if(a){let c=zi(a.center,a.width,a.height),l={x:c.minX,y:c.minY},h={x:c.maxX,y:c.minY},d={x:c.maxX,y:c.maxY},u={x:c.minX,y:c.maxY};e.lines.push({points:[l,h,d,u,l],strokeColor:r,strokeDash:"4 4"}),e.lines.push({points:[a.center,n.center],strokeColor:r,strokeDash:"2 2"})}}}else e.rects.push({center:n.center,width:n.width,height:n.height,stroke:r,label:n.globalConnNetId})}return e}},$0=({traces:e,netLabels:t=[]})=>{let n=[];for(let o of e)for(let r of t){let i=zi(r.center,r.width,r.height);for(let s=0;s<o.tracePath.length-1;s++){let a=o.tracePath[s],c=o.tracePath[s+1];if(H9(a,c,i)){if(o.globalConnNetId===r.globalConnNetId)break;n.push({trace:o,label:r});break}}}return n},Kei=({path:e,labelBounds:t,paddedBounds:n=t})=>{let o=-1,r=-1;for(let c=0;c<e.length-1;c++)if(H9(e[c],e[c+1],t)){if(o===-1)o=c;r=c}if(o===-1)return{firstInsideIndex:-1,lastInsideIndex:-1};let i=(c)=>c.x>n.minX&&c.x<n.maxX&&c.y>n.minY&&c.y<n.maxY,s=o;while(s>0&&i(e[s]))s--;let a=r+1;while(a<e.length-1&&i(e[a]))a++;return{firstInsideIndex:s+1,lastInsideIndex:a-1}},$ei=({initialTrace:e,firstInsideIndex:t,lastInsideIndex:n,labelBounds:o,paddingBuffer:r,detourCount:i})=>{if(t<=0||n>=e.tracePath.length-1)return[];let s=e.tracePath[t-1],a=e.tracePath[n+1],c=e.tracePath.slice(0,t),l=e.tracePath.slice(n+1),h=[];if(s.x!==a.x&&s.y!==a.y)h.push([{x:a.x,y:s.y}]),h.push([{x:s.x,y:a.y}]);else if(s.x===a.x||s.y===a.y)h.push([]);let d=r+i*r,u=o.minX-d,_=o.maxX+d,p=o.maxY+d,m=o.minY-d;if((s.x<=o.minX||a.x<=o.minX)&&s.x<o.maxX&&a.x<o.maxX)h.push([{x:u,y:s.y},{x:u,y:a.y}]);if((s.x>=o.maxX||a.x>=o.maxX)&&s.x>o.minX&&a.x>o.minX)h.push([{x:_,y:s.y},{x:_,y:a.y}]);if((s.y>=o.maxY||a.y>=o.maxY)&&s.y>o.minY&&a.y>o.minY)h.push([{x:s.x,y:p},{x:a.x,y:p}]);if((s.y<=o.minY||a.y<=o.minY)&&s.y<o.maxY&&a.y<o.maxY)h.push([{x:s.x,y:m},{x:a.x,y:m}]);return h.map((A)=>[...c,...A,...l])},qei=({initialTrace:e,label:t,labelBounds:n,paddingBuffer:o,detourCount:r})=>{let i=t.globalConnNetId.startsWith("merged-group-"),s=o+r*o,a={minX:n.minX-s,maxX:n.maxX+s,minY:n.minY-s,maxY:n.maxY+s},c,l,h,d,u=(A)=>A.x>=a.minX&&A.x<=a.maxX&&A.y>=a.minY&&A.y<=a.maxY;if(i){let A=-1;for(let f=0;f<e.tracePath.length;f++)if(u(e.tracePath[f])){A=f;break}if(A===-1)return[];h=Math.max(0,A-1),c=e.tracePath[h];let g=-1;for(let f=A;f<e.tracePath.length;f++)if(!u(e.tracePath[f])){g=f;break}if(g===-1)d=e.tracePath.length-1;else d=g;l=e.tracePath[d]}else{let A=-1,g=-1;for(let f=0;f<e.tracePath.length-1;f++)if(X2(e.tracePath[f],e.tracePath[f+1],{...n,chipId:"temp-obstacle"})){if(A===-1)A=f;g=f}if(A===-1)return[];h=A,d=g+1,c=e.tracePath[h],l=e.tracePath[d]}if(!c||!l||h>=d)return[];let _=[],p=l.x-c.x,m=l.y-c.y;if(Math.abs(p)>Math.abs(m)){let A=[a.maxY,a.minY];for(let g of A)_.push(p>0?[{x:a.minX,y:c.y},{x:a.minX,y:g},{x:a.maxX,y:g},{x:a.maxX,y:l.y}]:[{x:a.maxX,y:c.y},{x:a.maxX,y:g},{x:a.minX,y:g},{x:a.minX,y:l.y}])}else{let A=[a.maxX,a.minX];for(let g of A)_.push(m>0?[{x:c.x,y:a.minY},{x:g,y:a.minY},{x:g,y:a.maxY},{x:l.x,y:a.maxY}]:[{x:c.x,y:a.maxY},{x:g,y:a.maxY},{x:g,y:a.minY},{x:l.x,y:a.minY}])}return _.map((A)=>[...e.tracePath.slice(0,h),c,...A,l,...e.tracePath.slice(d+1)])},vi=(e)=>{if(e.length<3)return e;let t=[e[0]];for(let o=1;o<e.length-1;o++){let r=t[t.length-1],i=e[o],s=e[o+1];if(MA(r,i)&&MA(i,s)||Ag(r,i)&&Ag(i,s))continue;t.push(i)}if(t.push(e[e.length-1]),t.length<3)return t;let n=[t[0]];for(let o=1;o<t.length-1;o++){let r=n[n.length-1],i=t[o],s=t[o+1];if(MA(r,i)&&MA(i,s)||Ag(r,i)&&Ag(i,s))continue;n.push(i)}return n.push(t[t.length-1]),n},B8n=({trace:e,label:t,paddingBuffer:n,detourCount:o})=>{let r={...e,tracePath:vi(e.tracePath)};if(e.globalConnNetId===t.globalConnNetId)return[r.tracePath];let i=zi(t.center,t.width,t.height),s={minX:i.minX,minY:i.minY,maxX:i.maxX,maxY:i.maxY,chipId:`netlabel-${t.netId}`},a=qei({initialTrace:r,label:t,labelBounds:s,paddingBuffer:n,detourCount:o}),c=n+o*n,l={minX:s.minX-c,maxX:s.maxX+c,minY:s.minY-c,maxY:s.maxY+c},{firstInsideIndex:h,lastInsideIndex:d}=Kei({path:r.tracePath,labelBounds:s,paddedBounds:l}),u=$ei({initialTrace:r,firstInsideIndex:h,lastInsideIndex:d,labelBounds:s,paddingBuffer:n,detourCount:o});return[...a,...u]},wS=0.002,Jei=0.000001,T8n=0.02,D8n=T8n+Jei,Zei=T8n*3,Rk=(e,t)=>N8n(e,t.map((n)=>n.tracePath)),N8n=(e,t)=>{let n=(o,r,i,s)=>Math.min(Math.max(o,r),Math.max(i,s))-Math.max(Math.min(o,r),Math.min(i,s))>wS;for(let o=0;o<e.length-1;o++){let r=e[o],i=e[o+1],s=Math.abs(r.x-i.x)<wS,a=Math.abs(r.y-i.y)<wS;if(!s&&!a)continue;let c=s?"x":"y",l=s?"y":"x";for(let h of t)for(let d=0;d<h.length-1;d++){let u=h[d],_=h[d+1];if(!(Math.abs(u[c]-_[c])<wS))continue;if(!(Math.abs(r[c]-u[c])<wS))continue;if(n(r[l],i[l],u[l],_[l]))return!0}}return!1},R8n=(e,t)=>{let n=D8n/2,o=(r,i,s)=>s?{minX:r.x-n,maxX:r.x+n,minY:Math.min(r.y,i.y),maxY:Math.max(r.y,i.y)}:{minX:Math.min(r.x,i.x),maxX:Math.max(r.x,i.x),minY:r.y-n,maxY:r.y+n};for(let r=0;r<e.length-1;r++){let i=e[r],s=e[r+1],a=Math.abs(i.x-s.x)<wS,c=Math.abs(i.y-s.y)<wS;if(!a&&!c)continue;let l=o(i,s,a);for(let h of t)for(let d=0;d<h.tracePath.length-1;d++){let u=h.tracePath[d],_=h.tracePath[d+1];if(!(a?Math.abs(u.x-_.x)<wS:Math.abs(u.y-_.y)<wS))continue;let m=C8n(l,o(u,_,a));if(!m)continue;if((a?m.maxY-m.minY:m.maxX-m.minX)>wS)return!0}}return!1},eti=5,tti=0.000000001,o1n=(e)=>{let t=0;for(let n=0;n<e.length-1;n++){let o=e[n],r=e[n+1];t+=Math.abs(r.x-o.x)+Math.abs(r.y-o.y)}return t},Hve=class extends mu{queuedCandidatePaths;solvedTracePath=null;initialTrace;problem;obstacles;label;tracesToAvoidOverlapping;netLabelPlacements;detourCount;_tried=0;constructor(e){super();this.initialTrace=e.trace,this.problem=e.problem,this.label=e.label,this.detourCount=e.detourCount,this.tracesToAvoidOverlapping=(e.tracesToAvoidOverlapping??[]).filter((i)=>i.globalConnNetId!==e.trace.globalConnNetId),this.netLabelPlacements=e.netLabelPlacements??[e.label],this.obstacles=wy(this.problem);let t=e.paddingBuffer+e.detourCount*e.paddingBuffer,n=B8n({...e,paddingBuffer:t}),o=(i)=>$0({traces:[{...this.initialTrace,tracePath:i}],netLabels:this.netLabelPlacements}).length,r=new Map;for(let i of n){let s=vi(i);r.set(s.map((a)=>`${a.x},${a.y}`).join(";"),s)}this.queuedCandidatePaths=[...r.values()].sort((i,s)=>{let a=o1n(i)-o1n(s);if(Math.abs(a)>=tti)return a;let c=o(i)-o(s);if(c!==0)return c;return i.length-s.length})}_step(){if(this.queuedCandidatePaths.length===0||this._tried>=eti){this.failed=!0;return}this._tried++;let e=this.queuedCandidatePaths.shift(),t=vi(e),n=$0({traces:[{...this.initialTrace,tracePath:t}],netLabels:[this.label]}).length>0,o=vi(this.initialTrace.tracePath),r=$0({traces:[{...this.initialTrace,tracePath:o}],netLabels:this.netLabelPlacements}),i=$0({traces:[{...this.initialTrace,tracePath:t}],netLabels:this.netLabelPlacements});if(!n&&i.length<=r.length&&!NZ(t,this.obstacles)&&!Rk(t,this.tracesToAvoidOverlapping))this.solvedTracePath=t,this.solved=!0}visualize(){let e=J0(this.problem,{chipAlpha:0.1,connectionAlpha:0.1});if(!e.lines)e.lines=[];if(!e.rects)e.rects=[];if(e.lines.push({points:this.initialTrace.tracePath,strokeColor:"red",strokeDash:"4 4"}),e.rects.push({center:this.label.center,width:this.label.width,height:this.label.height,fill:"rgba(255, 0, 0, 0.2)"}),!this.solvedTracePath&&this.queuedCandidatePaths.length>0)e.lines.push({points:this.queuedCandidatePaths[0],strokeColor:"orange"});if(this.solvedTracePath)e.lines.push({points:this.solvedTracePath,strokeColor:"green"});return e}},nti=({trace:e,label:t})=>{if(e.tracePath.length<2)return!1;let n={...e,tracePath:[e.tracePath[0],e.tracePath[1]]};if($0({traces:[n],netLabels:[t]}).length>0)return!0;if(e.tracePath.length>2){let r=e.tracePath[e.tracePath.length-1],i=e.tracePath[e.tracePath.length-2],s={...e,tracePath:[i,r]};if($0({traces:[s],netLabels:[t]}).length>0)return!0}return!1},oti=(e)=>{let{decomposedChildLabels:t,collidingTrace:n,mergedLabel:o,graphics:r}=e;if(!r.rects)r.rects=[];if(!r.texts)r.texts=[];for(let i of t){let s=i.globalConnNetId===n.globalConnNetId;r.rects.push({center:i.center,width:i.width,height:i.height,fill:s?"green":"red"})}return r.texts.push({x:o.center.x,y:o.center.y+o.height/2+0.5,text:`DECOMPOSITION: Trace ${n.mspPairId} vs Merged Label ${o.globalConnNetId}`,fontSize:0.3,color:"blue"}),r},rti=class extends mu{inputProblem;initialNetLabelPlacements;mergedNetLabelPlacements;mergedLabelNetIdMap;allTraces;tracesToAvoidOverlapping;modifiedTraces=[];completedReroutes=[];PADDING_BUFFER=0.1;detourCounts=new Map;activeSubSolver=null;overlapQueue=[];activeOverlap=null;recentlyFailed=new Set;currentlyProcessingOverlap=null;decomposedChildLabels=null;constructor(e){super();this.inputProblem=e.inputProblem,this.initialNetLabelPlacements=e.initialNetLabelPlacements,this.mergedNetLabelPlacements=e.mergedNetLabelPlacements,this.mergedLabelNetIdMap=e.mergedLabelNetIdMap,this.allTraces=[...e.traces],this.tracesToAvoidOverlapping=e.tracesToAvoidOverlapping??[],this.detourCounts=e.detourCounts}_step(){if(this.currentlyProcessingOverlap=null,this.decomposedChildLabels=null,this.activeSubSolver){if(this.activeSubSolver.step(),this.activeSubSolver.solved){let o=this.activeSubSolver.solvedTracePath;if(o){this.completedReroutes.push({initialTrace:{...this.activeSubSolver.initialTrace,tracePath:this.activeSubSolver.initialTrace.tracePath.map((i)=>({...i}))},reroutedTracePath:o.map((i)=>({...i})),label:this.activeSubSolver.label,detourCount:this.activeSubSolver.detourCount});let r=this.allTraces.findIndex((i)=>i.mspPairId===this.activeSubSolver.initialTrace.mspPairId);if(r!==-1)this.allTraces[r].tracePath=o,this.modifiedTraces.push(this.allTraces[r])}this.activeSubSolver=null,this.activeOverlap=null,this.recentlyFailed.clear()}else if(this.activeSubSolver.failed){let o=`${this.activeOverlap.trace.mspPairId}-${this.activeOverlap.label.globalConnNetId}`;this.recentlyFailed.add(o),this.activeSubSolver=null,this.activeOverlap=null}return}let e=$0({traces:this.allTraces,netLabels:this.mergedNetLabelPlacements});if(e.length===0){this.solved=!0;return}let t=e.filter((o)=>{let r=`${o.trace.mspPairId}-${o.label.globalConnNetId}`;return!this.recentlyFailed.has(r)});if(t.length===0){this.solved=!0;return}this.overlapQueue=t;let n=this.overlapQueue.shift();if(this.currentlyProcessingOverlap=n??null,n){let o=this.allTraces.find((c)=>c.mspPairId===n.trace.mspPairId),r=n.label,i=this.mergedLabelNetIdMap[r.globalConnNetId];if(i?.has(o.globalConnNetId)){let c=this.initialNetLabelPlacements.filter((h)=>i.has(h.globalConnNetId));this.decomposedChildLabels=c;let l=null;for(let h of c)if($0({traces:[o],netLabels:[h]}).length>0){l=h;break}if(l){let h=this.detourCounts.get(l.globalConnNetId)??0;this.detourCounts.set(l.globalConnNetId,h+1),this.activeOverlap=n,this.activeSubSolver=new Hve({trace:o,label:l,problem:this.inputProblem,paddingBuffer:this.PADDING_BUFFER,detourCount:h,tracesToAvoidOverlapping:this.tracesToAvoidOverlapping,netLabelPlacements:this.initialNetLabelPlacements})}else{let h=`${o.mspPairId}-${r.globalConnNetId}`;this.recentlyFailed.add(h)}return}if(i&&nti({trace:o,label:r})){let c=this.initialNetLabelPlacements.filter((h)=>i.has(h.globalConnNetId));this.decomposedChildLabels=c;let l=null;for(let h of c)if($0({traces:[o],netLabels:[h]}).length>0){l=h;break}if(l){let h=this.detourCounts.get(l.globalConnNetId)??0;this.detourCounts.set(l.globalConnNetId,h+1),this.activeOverlap=n,this.activeSubSolver=new Hve({trace:o,label:l,problem:this.inputProblem,paddingBuffer:this.PADDING_BUFFER,detourCount:h,tracesToAvoidOverlapping:this.tracesToAvoidOverlapping,netLabelPlacements:this.initialNetLabelPlacements})}else{let h=`${o.mspPairId}-${r.globalConnNetId}`;this.recentlyFailed.add(h)}return}let a=this.detourCounts.get(r.globalConnNetId)??0;this.detourCounts.set(r.globalConnNetId,a+1),this.activeOverlap=n,this.activeSubSolver=new Hve({trace:o,label:r,problem:this.inputProblem,paddingBuffer:this.PADDING_BUFFER,detourCount:a,tracesToAvoidOverlapping:this.tracesToAvoidOverlapping,netLabelPlacements:this.initialNetLabelPlacements})}}getOutput(){return{allTraces:this.allTraces,modifiedTraces:this.modifiedTraces,detourCounts:this.detourCounts}}visualize(){if(this.activeSubSolver)return this.activeSubSolver.visualize();let e=J0(this.inputProblem);if(!e.lines)e.lines=[];for(let t of this.allTraces)e.lines.push({points:t.tracePath,strokeColor:"purple"});if(this.currentlyProcessingOverlap){let{trace:t,label:n}=this.currentlyProcessingOverlap;if(e.lines.push({points:t.tracePath,strokeColor:"red"}),this.decomposedChildLabels)oti({decomposedChildLabels:this.decomposedChildLabels,collidingTrace:t,mergedLabel:n,graphics:e});else{if(!e.rects)e.rects=[];if(e.rects.push({center:n.center,width:n.width,height:n.height,fill:"yellow"}),!e.texts)e.texts=[];e.texts.push({x:n.center.x,y:n.center.y+n.height/2+0.5,text:`COLLISION: Trace ${t.mspPairId} vs Label ${n.globalConnNetId}`,fontSize:0.3,color:"red"})}}return e}},iti=class extends mu{inputProblem;netLabelPlacements;unprocessedTraces=[];cleanTraces=[];subSolvers=[];phase="searching_for_overlaps";detourCounts=new Map;labelMergingSolver;allInputTraces;constructor(e){super();this.inputProblem=e.inputProblem,this.unprocessedTraces=[...e.traces],this.allInputTraces=e.traces,this.netLabelPlacements=e.netLabelPlacements,this.cleanTraces=[],this.subSolvers=[]}_step(){if(this.phase==="searching_for_overlaps"){if(this.unprocessedTraces.length===0){this.phase="fixing_overlaps";return}let e=this.unprocessedTraces.shift(),t=$0({traces:[e],netLabels:this.netLabelPlacements});if(t.length===0)this.cleanTraces.push(e);else{let n=t.map((s)=>s.label),o=new n1n({netLabelPlacements:n,inputProblem:this.inputProblem,traces:[e]});o.solve();let r=o.getOutput(),i=new rti({inputProblem:this.inputProblem,traces:[e],initialNetLabelPlacements:this.netLabelPlacements,mergedNetLabelPlacements:r.netLabelPlacements,mergedLabelNetIdMap:r.mergedLabelNetIdMap,detourCounts:this.detourCounts,tracesToAvoidOverlapping:this.allInputTraces.filter((s)=>s.mspPairId!==e.mspPairId)});this.subSolvers.push(i)}}else if(this.phase==="fixing_overlaps"){if(this.subSolvers.every((e)=>e.solved||e.failed)){if(!this.labelMergingSolver)this.labelMergingSolver=new n1n({netLabelPlacements:this.netLabelPlacements,inputProblem:this.inputProblem,traces:this.getOutput().traces}),this.labelMergingSolver.solve();this.solved=!0;return}for(let e of this.subSolvers)if(!e.solved&&!e.failed)e.step()}}getOutput(){let e=this.subSolvers.flatMap((t)=>t.getOutput().allTraces);return{traces:[...this.cleanTraces,...e],completedReroutes:this.subSolvers.flatMap((t)=>t.completedReroutes),netLabelPlacements:this.labelMergingSolver?.getOutput().netLabelPlacements??this.netLabelPlacements}}visualize(){let e=J0(this.inputProblem);if(!e.lines)e.lines=[];if(!e.rects)e.rects=[];for(let t of this.cleanTraces)e.lines.push({points:t.tracePath,strokeColor:"purple"});for(let t of this.subSolvers){let n=t.visualize();e.lines.push(...n.lines??[]),e.rects.push(...n.rects??[]),e.points.push(...n.points??[])}for(let t of this.netLabelPlacements){let n=Ic(t.globalConnNetId,0.3);e.rects.push({center:t.center,width:t.width,height:t.height,fill:n,stroke:n.replace("0.3","1"),label:t.globalConnNetId})}return e}},sti=(e)=>{for(let t of e.chips){let n=gat(t);for(let o of t.pins){if(!(o.x>n.minX&&o.x<n.maxX&&o.y>n.minY&&o.y<n.maxY))continue;if(o._facingDirection){if(o._facingDirection==="x-")o.x=n.minX;else if(o._facingDirection==="x+")o.x=n.maxX;else if(o._facingDirection==="y-")o.y=n.minY;else o.y=n.maxY;continue}let i=o.x-n.minX,s=n.maxX-o.x,a=o.y-n.minY,c=n.maxY-o.y,l=Math.min(i,s,a,c);if(l===i)o.x=n.minX;else if(l===s)o.x=n.maxX;else if(l===a)o.y=n.minY;else o.y=n.maxY;o._facingDirection=void 0}}};function ati(e,t){for(let n=0;n<e.length-1;n++){let o=e[n],r=e[n+1];for(let i of t)for(let s=0;s<i.tracePath.length-1;s++){let a=i.tracePath[s],c=i.tracePath[s+1];if(Z4(o,r,a,c))return!0}}return!1}var Q8n=(e,t,n)=>{let o=e.maxMspPairDistance??Wue,{extendedRailPinIds:r,separatedRailPinIds:i}=S8n(e,t,o),s=new Set,a=new Set;for(let d of e.netConnections){let u=t.getNetConnectedToId(d.netId);if(!u)continue;for(let _ of d.pinIds)a.add(_);if(d.isGround)s.add(u)}let c=new Map;for(let d of e.chips){if(d.pins.length!==2||!d.pins.every((A)=>a.has(A.pinId))||d.pins.some((A)=>n.has(A.pinId)&&!r.has(A.pinId)))continue;let[u,_]=d.pins.map((A)=>t.getNetConnectedToId(A.pinId));if(!u||!_||u===_||s.has(u)===s.has(_))continue;let p=JSON.stringify([d.sectionId??null,...[u,_].sort()]),m=c.get(p)??[];m.push(d.pins.map((A)=>A.pinId)),c.set(p,m)}let l=new Set([...c.values()].filter((d)=>d.length>1).flat(2));for(let d of[...r,...i])l.add(d);let h=new k8e({});for(let d of e.directConnections)if(d.netLabelWidth===void 0)h.addConnections([d.pinIds]);return(d,u)=>{if(!l.has(d.pinId)&&!l.has(u.pinId))return!0;if(Math.abs(d.x-u.x)+Math.abs(d.y-u.y)<=o)return!0;let _=h.getNetConnectedToId(d.pinId);return _!==void 0&&_===h.getNetConnectedToId(u.pinId)}},cti=0.000001,lti=({connection:e,sourcePin:t,targetPin:n,chipMap:o,directConnMap:r})=>{let i=o[t.chipId],s=o[n.chipId];return e.isGround===!0&&t.chipId!==n.chipId&&Math.abs(i.center.y-s.center.y)>(i.height+s.height)/2+cti&&i.pins.length>2&&s.pins.length>2&&!r.areIdsConnected(t.pinId,n.pinId)},hti=3,Fve=(e,t)=>Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2)),dti=(e,t)=>Math.abs(e.x-t.x)+Math.abs(e.y-t.y),I9=0.000000001,nve=(e,t,n)=>e>=Math.min(t,n)-I9&&e<=Math.max(t,n)+I9,uti=(e,t,n,o)=>{let r=Math.abs(e.y-t.y)<=I9,i=Math.abs(e.x-t.x)<=I9,s=Math.abs(n.y-o.y)<=I9,a=Math.abs(n.x-o.x)<=I9;if(r&&a){let c={x:n.x,y:e.y};return nve(c.x,e.x,t.x)&&nve(c.y,n.y,o.y)?c:null}if(i&&s){let c={x:e.x,y:n.y};return nve(c.y,e.y,t.y)&&nve(c.x,n.x,o.x)?c:null}if(r&&s&&Math.abs(e.y-n.y)<=I9){let c=Math.max(Math.min(e.x,t.x),Math.min(n.x,o.x)),l=Math.min(Math.max(e.x,t.x),Math.max(n.x,o.x));if(c>l+I9)return null;return{x:Math.max(c,Math.min(e.x,l)),y:e.y}}if(i&&a&&Math.abs(e.x-n.x)<=I9){let c=Math.max(Math.min(e.y,t.y),Math.min(n.y,o.y)),l=Math.min(Math.max(e.y,t.y),Math.max(n.y,o.y));if(c>l+I9)return null;return{x:e.x,y:Math.max(c,Math.min(e.y,l))}}return null},pti=(e,t)=>{for(let n=0;n<e.length-1;n++){let o=e[n],r=e[n+1],i=t.flatMap((c)=>c.tracePath.slice(0,-1).flatMap((l,h)=>{let d=uti(o,r,l,c.tracePath[h+1]);return d?[d]:[]}));i.sort((c,l)=>Fve(o,c)-Fve(o,l));let s=i[0];if(!s)continue;let a=e.slice(0,n+1);if(Fve(a.at(-1),s)>I9)a.push(s);return a}return null},mti=class extends mu{constructor(e){super();this.params=e;let{inputProblem:t,primaryMspConnectionPairs:n,alreadySolvedTraces:o}=this.params,r=b8n(t);this.inputProblem=t,this.allSolvedTraces=[...o],this.maxMspPairDistance=t.maxMspPairDistance??Wue;let i=new Set;for(let u of n)i.add(u.pins[0].pinId),i.add(u.pins[1].pinId);let{netConnMap:s,directConnMap:a}=Qb(t);this.netConnMap=s;let c=Q8n(t,s,i),l=new Map;for(let u of t.chips){this.chipMap[u.chipId]=u;for(let _ of u.pins)l.set(_.pinId,{..._,chipId:u.chipId})}this.queuedFailedConnectionPairs=this.params.failedConnectionPairs.filter((u)=>r(u.pins[0].pinId,u.pins[1].pinId)&&sei({inputProblem:this.inputProblem,chipMap:this.chipMap,pins:u.pins}));let h=[],d=new Set;for(let u of Object.keys(s.netMap)){let _=s.getIdsConnectedToNet(u);if(_.length<2)continue;let p=_.filter((m)=>!i.has(m));for(let m of p){let A=l.get(m);if(!A)continue;let g=_.filter((f)=>f!==m).flatMap((f)=>{let y=l.get(f);if(!y)return[];if(!r(A.pinId,y.pinId))return[];if(!c(A,y))return[];if(t.netConnections.some((C)=>(C.pinIds.length===2||lti({connection:C,sourcePin:A,targetPin:y,chipMap:this.chipMap,directConnMap:a}))&&C.pinIds.includes(A.pinId)&&C.pinIds.includes(y.pinId))&&dti(A,y)>this.maxMspPairDistance)return[];return[{pin:y,distance:Fve(A,y)}]}).sort((f,y)=>f.distance-y.distance).slice(0,hti);for(let f of g){let y=[A,f.pin];if(Sk(t,y[0],y[1]))continue;let x=y.map((C)=>C.pinId).sort().join("--");if(!d.has(x))h.push(y),d.add(x)}}}this.queuedCandidatePairs=h}params;solvedLongDistanceTraces=[];queuedCandidatePairs=[];currentCandidatePair=null;queuedFailedConnectionPairs=[];currentFailedConnectionPair=null;subSolver=null;chipMap={};inputProblem;netConnMap;newlyConnectedPinIds=new Set;allSolvedTraces=[];maxMspPairDistance;getConstructorParams(){return this.params}acceptFailedConnectionPair(e){let t=this.currentFailedConnectionPair;if(!t)return;let n={...t,tracePath:e,mspConnectionPairIds:[t.mspPairId],pinIds:t.pins.map((o)=>o.pinId)};this.solvedLongDistanceTraces.push(n),this.allSolvedTraces.push(n);for(let o of t.pins)this.newlyConnectedPinIds.add(o.pinId)}_step(){if(this.subSolver?.solved&&this.currentFailedConnectionPair){let t=this.subSolver.solvedTracePath;if(t)this.acceptFailedConnectionPair(t);this.subSolver=null,this.currentCandidatePair=null,this.currentFailedConnectionPair=null}else if(this.subSolver?.solved){let t=this.subSolver.solvedTracePath;if(t&&this.currentCandidatePair){let[n,o]=this.currentCandidatePair,r=this.netConnMap.getNetConnectedToId(n.pinId),i=this.allSolvedTraces.filter((p)=>p.globalConnNetId===r),s=this.inputProblem.netConnections.find((p)=>p.pinIds.length===3&&p.pinIds.includes(n.pinId)&&p.pinIds.includes(o.pinId)),a=this.chipMap[n.chipId],c=i.find((p)=>p.pinIds.includes(o.pinId)&&p.pins.every((m)=>m.chipId===o.chipId)),h=s!==void 0&&a?.pins.length===2&&c!==void 0?pti(t,i):null,d=h??t,u=h?this.allSolvedTraces.filter((p)=>p.globalConnNetId!==r):this.allSolvedTraces;if(!ati(d,u)){let p=`${n.pinId}-${o.pinId}`,m={mspPairId:p,dcConnNetId:r,globalConnNetId:r,pins:[n,o],tracePath:d,mspConnectionPairIds:[p],pinIds:[n.pinId,o.pinId]};this.solvedLongDistanceTraces.push(m),this.allSolvedTraces.push(m),this.newlyConnectedPinIds.add(n.pinId),this.newlyConnectedPinIds.add(o.pinId)}}this.subSolver=null,this.currentCandidatePair=null}else if(this.subSolver?.failed)this.subSolver=null,this.currentCandidatePair=null,this.currentFailedConnectionPair=null;if(this.subSolver){this.subSolver.step();return}let e=this.queuedFailedConnectionPairs.shift();if(e){this.currentFailedConnectionPair=e,this.currentCandidatePair=e.pins,this.subSolver=new gZ({inputProblem:this.params.inputProblem,pins:e.pins,chipMap:this.chipMap});return}while(this.queuedCandidatePairs.length>0){let t=this.queuedCandidatePairs.shift(),[n,o]=t;if(this.newlyConnectedPinIds.has(n.pinId)||this.newlyConnectedPinIds.has(o.pinId))continue;this.currentCandidatePair=t,this.subSolver=new gZ({inputProblem:this.params.inputProblem,pins:this.currentCandidatePair,chipMap:this.chipMap});return}this.solved=!0}visualize(){if(this.subSolver)return this.subSolver.visualize();let e=J0(this.inputProblem);for(let t of this.solvedLongDistanceTraces)e.lines.push({points:t.tracePath,strokeColor:"purple"});for(let[t,n]of this.queuedCandidatePairs)e.lines.push({points:[t,n],strokeColor:"gray",strokeDash:"4 4"});return e}getOutput(){if(!this.solved)return{newTraces:[],allTracesMerged:this.params.alreadySolvedTraces};return{newTraces:this.solvedLongDistanceTraces,allTracesMerged:[...this.params.alreadySolvedTraces,...this.solvedLongDistanceTraces]}}},Ant=(e,t)=>{for(let n=0;n<e.length-1;n++){let o=e[n],r=e[n+1];for(let i of t){let s={center:{x:i.minX+(i.maxX-i.minX)/2,y:i.minY+(i.maxY-i.minY)/2},width:i.maxX-i.minX,height:i.maxY-i.minY};if(ZZr(o,r,s)<=0)return!0}}return!1},Qf=(e)=>{let t=0;for(let n=1;n<e.length-1;n++){let o=e[n-1],r=e[n],i=e[n+1],s=o.x===r.x,a=r.x===i.x;if(s!==a)t++}return t},Frt=(e,t)=>{let n=[];if(e.x===t.x||e.y===t.y)n.push([e,t]);else n.push([e,{x:t.x,y:e.y},t]),n.push([e,{x:e.x,y:t.y},t]);return n},xy=0.000000001,r1n=(e,t,n,o)=>t>=n-xy&&o>=e-xy&&Math.min(t,o)-Math.max(e,n)<=xy,i1n=(e,t)=>Math.abs(e.x-t.x)<=xy&&Math.abs(e.y-t.y)<=xy,_ti=({start:e,end:t,label:n,originalPath:o})=>{let r=Math.abs(e.x-t.x)<=xy,i=Math.abs(e.y-t.y)<=xy;if(!(r?Math.abs(e.x-n.minX)<=xy||Math.abs(e.x-n.maxX)<=xy:i?Math.abs(e.y-n.minY)<=xy||Math.abs(e.y-n.maxY)<=xy:!1))return!1;for(let a=0;a<o.length-1;a++){if(!(a===0||a===o.length-2))continue;let l=o[a],h=o[a+1],d=a===0?h:l;if(!i1n(e,d)&&!i1n(t,d))continue;if(!X2(l,h,n))continue;if(r&&Math.abs(l.x-h.x)<=xy&&Math.abs(l.x-e.x)<=xy&&r1n(Math.min(e.y,t.y),Math.max(e.y,t.y),Math.min(l.y,h.y),Math.max(l.y,h.y)))return!0;if(i&&Math.abs(l.y-h.y)<=xy&&Math.abs(l.y-e.y)<=xy&&r1n(Math.min(e.x,t.x),Math.max(e.x,t.x),Math.min(l.x,h.x),Math.max(l.x,h.x)))return!0}return!1},zve=(e,t,n={})=>{for(let o=0;o<e.length-1;o++){let r=e[o],i=e[o+1];for(let s of t)if(X2(r,i,s)){if(n.originalPath&&_ti({start:r,end:i,label:s,originalPath:n.originalPath}))continue;return!0}}return!1},gti=(e,t)=>{if(t>=e.length-3)return-1;let n=t,o=!0;for(let r=t;r<e.length-2&&r<t+10;r++){if(r+2>=e.length)break;let i=e[r],s=e[r+1],a=e[r+2],c=i.x===s.x,l=s.x===a.x;if(c===l)break;let h=c?Math.sign(s.y-i.y):Math.sign(s.x-i.x);if(r>t){let d=e[r-1],u=d.x===i.x,_=u?Math.sign(i.y-d.y):Math.sign(i.x-d.x);if(c&&u&&h!==_||!c&&!u&&h!==_){o=!1;break}}n=r+2}return o&&n-t>=3?n:-1},fJ=(e,t,n)=>{if(n.length<2)return!1;let o=n[0],r=n[n.length-1];if(e.x===o.x&&e.y===o.y&&t.x===n[1].x&&t.y===n[1].y)return!0;if(e.x===n[n.length-2].x&&e.y===n[n.length-2].y&&t.x===r.x&&t.y===r.y)return!0;return!1},s1n=({path:e,obstacles:t,labelBounds:n,originalPath:o,allowLabelBoundaryExtension:r=!1})=>{if(e.length<=2)return e;let i=[...e],s=Qf(i),a=!0;while(a){a=!1;for(let l=0;l<i.length-3;l++){let h=gti(i,l);if(h>0){if(fJ(i[l],i[l+1],o)||fJ(i[h-1],i[h],o))continue;let d=i[l],u=i[h],_=Frt(d,u);for(let p of _){let m=[...i.slice(0,l+1),...p.slice(1,-1),...i.slice(h)],A=Ant(p,t),g=zve(p,n,r?{originalPath:o}:{});if(!A&&!g){let f=Qf(m);i=m,s=f,a=!0;break}}if(a)break}}if(!a)for(let l=0;l<i.length-2;l++){let h=Math.min(i.length-l-2,i.length-2);for(let d=1;d<=h;d++){let u=l+d+1;if(u>=i.length)continue;if(fJ(i[l],i[l+1],o)||fJ(i[u-1],i[u],o))continue;let _=i[l],p=i[u],m=Frt(_,p);for(let A of m){let g=[...i.slice(0,l+1),...A.slice(1,-1),...i.slice(u)],f=A,y=Ant(f,t),x=zve(f,n,r?{originalPath:o}:{});if(!y&&!x){let C=Qf(g);if(C<s||C===s&&g.length<i.length){i=g,s=C,a=!0;break}}}if(a)break}if(a)break}if(!a)for(let l=0;l<i.length-2;l++){let h=i[l],d=i[l+1],u=i[l+2];if(fJ(h,d,o)||fJ(d,u,o))continue;let _=h.x===d.x&&d.x===u.x,p=h.y===d.y&&d.y===u.y;if(_||p){let m=[...i.slice(0,l+1),...i.slice(l+2)],A=Ant([h,u],t),g=zve([h,u],n,r?{originalPath:o}:{});if(!A&&!g){i=m,a=!0;break}}}}return vi(i)},U2=0.002,ns=(e,t)=>Math.abs(e-t)<U2,o3=(e,t)=>ns(e.y,t.y),Y2=(e,t)=>ns(e.x,t.x),Ati=(e,t)=>Math.abs(e.x-t.x)>=U2||Math.abs(e.y-t.y)>=U2,Pk=(e,t)=>{if(!Ati(e,t))return null;if(Y2(e,t))return"vertical";if(o3(e,t))return"horizontal";return null},k8n=(e,t)=>Math.min(e.maxAlong,t.maxAlong)-Math.max(e.minAlong,t.minAlong)>=-U2,bB=(e,t)=>ns(e.x,t.x)&&ns(e.y,t.y),fat=(e)=>{let t=[];for(let n of e)if(!t.some((o)=>ns(o,n)))t.push(n);return t},a1n=(e)=>{let t=[];for(let n of e){let o=t.find((r)=>ns(r[0].coordinate,n.coordinate));if(o)o.push(n);else t.push([n])}return t.reduce((n,o)=>{let r=[...o].sort((l,h)=>l.min-h.min),i=0,s=1,a=r[0].min,c=r[0].max;for(let l of r.slice(1))if(l.min<=c+U2)c=Math.max(c,l.max);else i+=c-a,s++,a=l.min,c=l.max;return{length:n.length+i+c-a,segmentCount:n.segmentCount+s}},{length:0,segmentCount:0})},L8n=(e)=>{let t=[],n=[];for(let i of e)for(let s=0;s<i.tracePath.length-1;s++){let a=i.tracePath[s],c=i.tracePath[s+1];if(o3(a,c))t.push({coordinate:a.y,min:Math.min(a.x,c.x),max:Math.max(a.x,c.x)});else if(Y2(a,c))n.push({coordinate:a.x,min:Math.min(a.y,c.y),max:Math.max(a.y,c.y)})}let o=a1n(t),r=a1n(n);return{length:o.length+r.length,segmentCount:o.segmentCount+r.segmentCount}},LS=(e)=>L8n(e).length,z8e=(e)=>L8n(e).segmentCount,fti=2.5,c1n=(e)=>{let t=0;for(let n=1;n<e.length;n++){let o=e[n-1],r=e[n];t+=Math.abs(r.x-o.x)+Math.abs(r.y-o.y)}return t},yti=({inputProblem:e,trace:t})=>{let n=e.directConnections.find((a)=>a.pinIds.every((c)=>t.pinIds.includes(c)));if(!n)return t;let o={};for(let a of e.chips)o[a.chipId]=a;let r=new gZ({pins:t.pins,connectionPair:t,inputProblem:{...e,directConnections:[n,...e.directConnections.filter((a)=>a!==n)]},chipMap:o});if(r.solve(),!r.solvedTracePath)return t;let i=c1n(t.tracePath),s=c1n(r.solvedTracePath);if(i<=s*fti)return t;return{...t,tracePath:r.solvedTracePath}},xti=0.000000001,l1n=(e)=>e.slice(1).reduce((t,n,o)=>{let r=e[o];return t+Math.abs(n.x-r.x)+Math.abs(n.y-r.y)},0),Cti=({strictPath:e,boundaryPath:t})=>{let n=Qf(t)<=Qf(e),o=Math.abs(l1n(t)-l1n(e))<=xti;return n&&o?t:e},H8n=({targetMspConnectionPairId:e,traces:t,inputProblem:n,allLabelPlacements:o,mergedLabelNetIdMap:r,paddingBuffer:i})=>{let s=t.find((B)=>B.mspPairId===e);if(!s)throw Error(`Target trace ${e} not found`);let a=yti({inputProblem:n,trace:s}),c=new Set(a.pinIds),l=t.filter((B)=>B.mspPairId!==e),h=l.filter((B)=>{let T=B.pinIds.some((N)=>c.has(N));return B.globalConnNetId!==a.globalConnNetId||!T}),d=0.01,u=(B)=>B.flatMap((T,N)=>T.tracePath.slice(0,-1).map((D,L)=>{let H=T.tracePath[L+1];return{chipId:`trace-obstacle-${N}-${L}`,minX:Math.min(D.x,H.x)-d/2,minY:Math.min(D.y,H.y)-d/2,maxX:Math.max(D.x,H.x)+d/2,maxY:Math.max(D.y,H.y)+d/2}})),_=wy(n),p=0.01,m=_.map((B)=>({...B,minX:B.minX-p,minY:B.minY-p,maxX:B.maxX+p,maxY:B.maxY+p})),A=a.tracePath,f=o.filter((B)=>{let T=r[B.globalConnNetId];if(T)return!T.has(a.globalConnNetId);return B.globalConnNetId!==a.globalConnNetId}).map((B)=>({minX:B.center.x-B.width/2-i,maxX:B.center.x+B.width/2+i,minY:B.center.y-B.height/2-i,maxY:B.center.y+B.height/2+i})),y=(B)=>{let T=s1n({path:A,obstacles:B,labelBounds:f,originalPath:A}),N=s1n({path:A,obstacles:B,labelBounds:f,originalPath:A,allowLabelBoundaryExtension:!0});return Cti({strictPath:T,boundaryPath:N})},x=y([...m,...u(l)]),C=y([...m,...u(h)]),b=l.filter((B)=>B.globalConnNetId===a.globalConnNetId),I=(B)=>{let T=[...b,{...a,tracePath:B}];return{segmentCount:z8e(T),visibleLength:LS(T)}},v=Qf(x),P=Qf(C),M=x;if(P<v)M=C;else if(P===v){let B=I(x),T=I(C);if(T.segmentCount<B.segmentCount||T.segmentCount===B.segmentCount&&T.visibleLength<B.visibleLength-U2)M=C}return{...a,tracePath:M}},bti=({targetMspConnectionPairId:e,traces:t,inputProblem:n,allLabelPlacements:o,mergedLabelNetIdMap:r,paddingBuffer:i})=>{let s=t.find((y)=>y.mspPairId===e);if(!s)throw Error(`Target trace ${e} not found`);let a=0.00001,c=(y,x)=>Math.abs(y-x)<a,l=t.filter((y)=>y.mspPairId!==e),h=0.01,d=l.flatMap((y,x)=>y.tracePath.slice(0,-1).map((C,b)=>{let I=y.tracePath[b+1];return{chipId:`trace-obstacle-${x}-${b}`,minX:Math.min(C.x,I.x)-h/2,minY:Math.min(C.y,I.y)-h/2,maxX:Math.max(C.x,I.x)+h/2,maxY:Math.max(C.y,I.y)+h/2}})),_=[...wy(n).map((y)=>({...y,minX:y.minX+a,maxX:y.maxX-a,minY:y.minY+a,maxY:y.maxY-a})),...d],p=(y,x,C)=>{for(let b of C)if(X2(y,x,b))return!0;return!1},A=o.filter((y)=>{let x=r[y.globalConnNetId];if(x)return!x.has(s.globalConnNetId);return y.globalConnNetId!==s.globalConnNetId}).map((y)=>({minX:y.center.x-y.width/2+a,maxX:y.center.x+y.width/2-a,minY:y.center.y-y.height/2+a,maxY:y.center.y+y.height/2-a})),g=[...s.tracePath];if(g.length<4)return{...s};if(g.length===4){let[y,x,C,b]=g,I,v,P=c(y.y,x.y)&&c(x.x,C.x)&&c(C.y,b.y),M=c(y.x,x.x)&&c(x.y,C.y)&&c(C.x,b.x),B=P?Math.sign(x.x-y.x)===Math.sign(b.x-C.x):Math.sign(x.y-y.y)===Math.sign(b.y-C.y);if(!(P||M)||!B)return{...s};if(P){let N=(y.x+b.x)/2;I={x:N,y:x.y},v={x:N,y:C.y}}else{let N=(y.y+b.y)/2;I={x:x.x,y:N},v={x:C.x,y:N}}if(!(p(y,I,_)||p(I,v,_)||p(v,b,_)||p(y,I,A)||p(I,v,A)||p(v,b,A)))g[1]=I,g[2]=v;return{...s,tracePath:vi(g)}}for(let y=1;y<g.length-4;y++){let x=g[y],C=g[y+1],b=g[y+2],I=g[y+3],v=c(x.y,C.y)&&c(C.x,b.x)&&c(b.y,I.y),P=c(x.x,C.x)&&c(C.y,b.y)&&c(b.x,I.x),M=c(x.y,C.y)&&c(C.y,b.y)&&c(b.y,I.y),B=c(x.x,C.x)&&c(C.x,b.x)&&c(b.x,I.x),T=M||B,N=!1;if(v)N=Math.sign(C.x-x.x)===Math.sign(I.x-b.x);else if(P)N=Math.sign(C.y-x.y)===Math.sign(I.y-b.y);if(!((v||P)&&!T&&N))continue;let L,H,V=v?Math.abs(x.x-C.x):Math.abs(x.y-C.y),O=v?Math.abs(b.x-I.x):Math.abs(b.y-I.y);if(Math.abs(V-O)<0.001)continue;if(v){let j=(x.x+I.x)/2;L={x:j,y:C.y},H={x:j,y:b.y}}else{let j=(x.y+I.y)/2;L={x:C.x,y:j},H={x:b.x,y:j}}if(!(p(x,L,_)||p(L,H,_)||p(H,I,_)||p(x,L,A)||p(L,H,A)||p(H,I,A)))g[y+1]=L,g[y+2]=H,y=0}let f=vi(g);return{...s,tracePath:f}},xm=0.05,h1n=2000,j4=0.001,Tr=0.000000001,ove=j4+Tr,Iti="blue",F8n="red",Rd=(e)=>e==="y+"||e==="y-",yJ=(e)=>e==="x+"||e==="x-",rde=(e,t)=>Math.min(e.maxX,t.maxX)-Math.max(e.minX,t.minX)>Tr&&Math.min(e.maxY,t.maxY)-Math.max(e.minY,t.minY)>Tr,O8e=(e,t,n,o)=>Math.min(t,o)-Math.max(e,n)>Tr,Mde=(e,t)=>{for(let n of Object.values(t)){let o=n.tracePath;for(let r=0;r<o.length-1;r++)if(hue(o[r],o[r+1],e))return!0}return!1},hue=(e,t,n)=>{let o={minX:n.minX+ove,minY:n.minY+ove,maxX:n.maxX-ove,maxY:n.maxY-ove};if(o.minX>=o.maxX||o.minY>=o.maxY)return!1;if(V8e(e,t)){if(e.x<=o.minX+Tr||e.x>=o.maxX-Tr)return!1;return O8e(Math.min(e.y,t.y),Math.max(e.y,t.y),o.minY,o.maxY)}if(Y8e(e,t)){if(e.y<=o.minY+Tr||e.y>=o.maxY-Tr)return!1;return O8e(Math.min(e.x,t.x),Math.max(e.x,t.x),o.minX,o.maxX)}return!1},vti=(e,t)=>{for(let n=0;n<e.length-1;n++)if(hue(e[n],e[n+1],t))return!0;return!1},fnt=(e,t)=>{for(let n=0;n<e.length-1;n++)if(H9(e[n],e[n+1],t))return!0;return!1},d1n=(e,t)=>[["left",Math.abs(e.x-t.minX)],["right",Math.abs(e.x-t.maxX)],["bottom",Math.abs(e.y-t.minY)],["top",Math.abs(e.y-t.maxY)]],ynt=(e,t,n)=>zrt(Rd(n)?[e,{x:t.x,y:e.y},t]:[e,{x:e.x,y:t.y},t]),zrt=(e)=>{let t=e.filter((o,r)=>r===0||!Sti(o,e[r-1]));if(t.length<3)return t;let n=[t[0]];for(let o=1;o<t.length-1;o++){let r=n[n.length-1],i=t[o],s=t[o+1];if(V8e(r,i)&&V8e(i,s)||Y8e(r,i)&&Y8e(i,s))continue;n.push(i)}return n.push(t[t.length-1]),n},Sti=(e,t)=>V8e(e,t)&&Y8e(e,t),V8e=(e,t)=>Math.abs(e.x-t.x)<=Tr,Y8e=(e,t)=>Math.abs(e.y-t.y)<=Tr,z8n=(e)=>Math.max(...e.chips.map((n)=>n.width),1)*3,du=0.000001,O8n=(e)=>Pti(e.pinIds)>=2,B9=(e,t)=>Math.min(e.maxX,t.maxX)-Math.max(e.minX,t.minX)>du&&Math.min(e.maxY,t.maxY)-Math.max(e.minY,t.minY)>du,tk=(e)=>{let t=[];for(let n=1;n<e.length-1;n++){let o=e[n-1],r=e[n],i=e[n+1];if(Eti(o,r,i))t.push(r)}return t},Ts=(e,t)=>{for(let n=0;n<e.length-1;n++)if(Mti(t,e[n],e[n+1]))return!0;return!1},hB=(e,t)=>Math.abs(e.x-t.x)+Math.abs(e.y-t.y),Pti=(e)=>new Set(e).size,Eti=(e,t,n)=>Ort(e,t)!==Ort(t,n),Mti=(e,t,n)=>{if(Ort(t,n)==="horizontal")return Math.abs(e.y-t.y)<=du&&e.x>=Math.min(t.x,n.x)-du&&e.x<=Math.max(t.x,n.x)+du;return Math.abs(e.x-t.x)<=du&&e.y>=Math.min(t.y,n.y)-du&&e.y<=Math.max(t.y,n.y)+du},Ort=(e,t)=>Math.abs(e.y-t.y)<=du?"horizontal":"vertical",V8n=(e,t)=>{let n=new Set;for(let o of e.netConnections){if(!o.isGround)continue;let r=t.getNetConnectedToId(o.netId);if(r)n.add(r)}return n},Y8n=({inputProblem:e,traces:t,netLabelPlacements:n})=>{let{netConnMap:o}=Qb(e),r=V8n(e,o);if(r.size===0)return n;let i=new Map(e.chips.map((l)=>[l.chipId,l])),s=Object.fromEntries(t.map((l)=>[l.mspPairId,l])),a=wy(e),c=[...n];for(let l of t){if(!r.has(l.globalConnNetId))continue;let[h,d]=l.pins;if(h.chipId===d.chipId||!ns(h.y,d.y)||![h,d].every((_)=>_._facingDirection==="y-"&&i.get(_.chipId)?.pins.length===2))continue;let u=vi(l.tracePath);if(u.length!==4||!Y2(u[0],u[1])||!o3(u[1],u[2])||!Y2(u[2],u[3])||u[1].y>=h.y)continue;for(let _ of t){if(_.globalConnNetId!==l.globalConnNetId)continue;let p=_.pins.find((f)=>l.pinIds.includes(f.pinId)),m=_.pins.find((f)=>!l.pinIds.includes(f.pinId)&&(i.get(f.chipId)?.pins.length??0)>2);if(!p||!m||!ns(m.y,u[1].y))continue;let A=p.pinId===h.pinId?d:h;if(Math.abs(A.x-m.x)<=Math.abs(p.x-m.x))continue;let g={x:A.x,y:u[1].y};if(!Ts(l.tracePath,g))continue;for(let f=0;f<c.length;f++){let y=c[f];if(y.globalConnNetId!==l.globalConnNetId||y.orientation!=="y-"||!y.mspConnectionPairIds.some((b)=>b===_.mspPairId||b===l.mspPairId)||!Ts(_.tracePath,y.anchorPoint)&&!Ts(l.tracePath,y.anchorPoint))continue;let x=kf(g,y.orientation,y.width,y.height),C=zi(x,y.width,y.height);if(a.some((b)=>B9(C,b))||Mde(C,s)||c.some((b,I)=>I!==f&&B9(C,zi(b.center,b.width,b.height))))continue;c[f]={...y,anchorPoint:g,center:x,mspConnectionPairIds:[l.mspPairId],pinIds:[...l.pinIds]}}}}for(let l=0;l<c.length;l++){let h=c[l];if(h.orientation!=="y-"||!r.has(h.globalConnNetId))continue;if(!e.netConnections.some((g)=>g.pinIds.length>2&&o.getNetConnectedToId(g.netId)===h.globalConnNetId))continue;let u=t.filter((g)=>g.globalConnNetId===h.globalConnNetId).flatMap((g)=>g.tracePath.slice(1).flatMap((f,y)=>{let x=g.tracePath[y];return ns(x.x,h.anchorPoint.x)&&ns(f.x,h.anchorPoint.x)?[{minY:Math.min(x.y,f.y),maxY:Math.max(x.y,f.y)}]:[]})).sort((g,f)=>f.maxY-g.maxY),_=h.anchorPoint.y;for(let g of u)if(g.maxY+U2>=_&&g.minY<_)_=g.minY;if(ns(_,h.anchorPoint.y))continue;let p={x:h.anchorPoint.x,y:_},m=kf(p,h.orientation,h.width,h.height),A=zi(m,h.width,h.height);if(a.some((g)=>B9(A,g))||Mde(A,s)||c.some((g,f)=>f!==l&&B9(A,zi(g.center,g.width,g.height))))continue;c[l]={...h,anchorPoint:p,center:m}}return c},u1n=(e,t,n)=>e==="vertical"?{minX:0,maxX:0,minY:t,maxY:n}:{minX:t,maxX:n,minY:0,maxY:0},wti=(e,t,n)=>{let o=C8n(t,n);if(!o)return!1;return(e==="vertical"?o.maxY-o.minY:o.maxX-o.minX)>U2},Bti=({group:e,originalCoordinates:t,otherNetTraces:n})=>{let o=e[0].orientation,r=e.map((a)=>u1n(o,a.minAlong,a.maxAlong)),i=Zei,s=[];for(let a of n)for(let c=0;c<a.tracePath.length-1;c++){let l=a.tracePath[c],h=a.tracePath[c+1];if(Pk(l,h)!==o)continue;let d=o==="vertical"?Math.min(l.y,h.y):Math.min(l.x,h.x),u=o==="vertical"?Math.max(l.y,h.y):Math.max(l.x,h.x),_=u1n(o,d,u);if(!r.some((A)=>wti(o,A,_)))continue;let p=o==="vertical"?l.x:l.y;if(!t.some((A)=>Math.abs(A-p)<=D8n))continue;s.push(p-i,p+i)}return fat(s)},Tti=(e,t,n)=>[t.tracePath.slice(0,e.segmentIndex+1).reverse(),t.tracePath.slice(e.segmentIndex+1)].some((r)=>{let[i,s,a]=vi(r);if(!i||!s||!a)return!1;let c=Pk(i,s);return c!==null&&c!==e.orientation&&Pk(s,a)===e.orientation&&Ts([i,s],n)}),Dti=(e,t)=>{let n=e[0].globalConnNetId,o=t.filter((s)=>s.globalConnNetId===n),r=new Set(e.map((s)=>s.traceId)),i=new Set(o.filter((s)=>r.has(s.mspPairId)).flatMap((s)=>s.pinIds));for(let s=!0;s;){s=!1;for(let a of o){if(r.has(a.mspPairId))continue;if(!a.pinIds.some((c)=>i.has(c)))continue;r.add(a.mspPairId);for(let c of a.pinIds)i.add(c);s=!0}}return r},Nti=(e,t,n)=>{let o=Dti(e,n);return t.filter((r)=>r.mspConnectionPairIds.some((i)=>o.has(i)))},G8n=(e,t,n)=>{let o=new Map(n.map((m)=>[m.mspPairId,m])),i=[...new Set(e.map((m)=>m.traceId))].every((m)=>o.get(m)?.pins.every((A)=>A.chipId===e[0].componentId)===!0),s=e[0].orientation,a=Nti(e,t,n),c=new Set(a.filter((m)=>s==="vertical"&&(m.orientation==="y+"||m.orientation==="y-")||s==="horizontal"&&(m.orientation==="x+"||m.orientation==="x-"))),l=a.filter((m)=>{if(m.orientation!==e[0].componentFacingDirection&&(!i||!c.has(m)))return!1;return m.mspConnectionPairIds.some((A)=>{let g=o.get(A);return g&&Ts(g.tracePath,m.anchorPoint)})}),h=fat(l.flatMap((m)=>{let A=i&&c.has(m)?e.filter((g)=>{let f=o.get(g.traceId);return f&&m.mspConnectionPairIds.includes(g.traceId)&&Tti(g,f,m.anchorPoint)}):[];if(A.length>0)return A.map((g)=>g.coordinate);return[s==="vertical"?m.anchorPoint.x:m.anchorPoint.y]}));if(h.length!==1)return null;let d=h[0],u=e.find((m)=>Math.abs(m.coordinate-d)<=U2)?.coordinate??d;if(e.some((m)=>o.get(m.traceId)?.tracePath.length!==4&&!ns(m.coordinate,u)))return null;if(l.some((m)=>m.mspConnectionPairIds.some((A)=>(o.get(A)?.tracePath.length??0)>4)))return u;if(l.some((m)=>c.has(m))){let m=Math.max(...e.map((g)=>g.maxAlong))-Math.min(...e.map((g)=>g.minAlong));if(e.every((g)=>Math.abs(g.coordinate-u)<=m+U2))return u;return null}if(e.every((m)=>{let A=o.get(m.traceId);if(!A)return!1;return Math.abs(m.coordinate-u)<=k9(A.pins[0],A.pins[1])+U2}))return u;return null},Rti=(e,t,n)=>{let o=new Set;for(let s of t){if(ns(s.coordinate,n))continue;o.add(s.segmentIndex),o.add(s.segmentIndex+1)}let r=t[0].orientation,i=vi(e.tracePath.map((s,a)=>{if(!o.has(a))return s;return r==="vertical"?{...s,x:n}:{...s,y:n}}));return{...e,tracePath:i}},p1n=(e,t)=>new Set(t.filter((n)=>n.globalConnNetId===e.globalConnNetId&&Ts(n.tracePath,e.anchorPoint)).map((n)=>n.mspPairId)),due=(e,t,n)=>e.every((o)=>{let r=p1n(o,t);if(r.size===0)return!0;let i=p1n(o,n);return[...r].every((s)=>i.has(s))}),uu=0.000000001,yat=(e,t,n)=>{let o=Math.abs(e.x-t.x)<uu,r=Math.abs(e.y-t.y)<uu;if(o)return Math.abs(e.x-n.minX)<uu||Math.abs(e.x-n.maxX)<uu;if(r)return Math.abs(e.y-n.minY)<uu||Math.abs(e.y-n.maxY)<uu;return!1},Qti=(e)=>e.map((t)=>`${t.x},${t.y}`).join(";"),Zx=(e)=>{let t=0;for(let n=0;n<e.length-1;n++)t+=Math.abs(e[n+1].x-e[n].x)+Math.abs(e[n+1].y-e[n].y);return t},U8n=(e,t)=>Math.abs(e.x-t.x)+Math.abs(e.y-t.y),W8n=(e,t)=>Math.abs(e.x-t.x)<uu||Math.abs(e.y-t.y)<uu,X8n=(e,t)=>Math.abs(e.y-t.y)<uu?"horizontal":"vertical",xat=(e,t,n)=>{if(Math.abs(t.x-n.x)<uu)return{x:t.x,y:Math.min(Math.max(e.y,Math.min(t.y,n.y)),Math.max(t.y,n.y))};if(Math.abs(t.y-n.y)<uu)return{x:Math.min(Math.max(e.x,Math.min(t.x,n.x)),Math.max(t.x,n.x)),y:t.y};return t},kti=(e,t,n)=>U8n(e,xat(e,t,n)),Lti=(e)=>{let t=[];for(let n=0;n<e.length-1;n++){let o=e[n],r=e[n+1];if(!W8n(o,r))continue;t.push({start:o,end:r,orientation:X8n(o,r)})}return t},Hti=(e,t)=>{for(let n=0;n<e.length-1;n++){let o=e[n],r=e[n+1];if(!W8n(o,r))continue;if(kti(t,o,r)>0.000001)continue;return{index:n,start:o,end:r,orientation:X8n(o,r)}}return null},Fti=(e,t)=>{if(t.orientation==="horizontal")return e.x>=Math.min(t.start.x,t.end.x)-uu&&e.x<=Math.max(t.start.x,t.end.x)+uu;return e.y>=Math.min(t.start.y,t.end.y)-uu&&e.y<=Math.max(t.start.y,t.end.y)+uu},zti=(e,t,n,o,r)=>{let i=Lti(e).filter((l)=>l.orientation===o);if(i.length===0)return null;let s=i.filter((l)=>Fti(r,l)),a=s.length>0?s:i;return t<n/2?a[0]:a[a.length-1]},Oti=(e,t)=>{let n=null,o=Number.POSITIVE_INFINITY;for(let r=0;r<t.length-1;r++){let i=xat(e,t[r],t[r+1]),s=U8n(e,i);if(s<o)n=i,o=s}return n},j8n=(e,t,n,o)=>{let r=Math.abs(e.x-t.x)<uu,i=Math.abs(n.x-o.x)<uu,s=(d,u,_)=>d>=Math.min(u,_)-uu&&d<=Math.max(u,_)+uu;if(r&&i){if(Math.abs(e.x-n.x)>uu)return!1;return Math.min(Math.max(e.y,t.y),Math.max(n.y,o.y))-Math.max(Math.min(e.y,t.y),Math.min(n.y,o.y))>uu}if(!r&&!i){if(Math.abs(e.y-n.y)>uu)return!1;return Math.min(Math.max(e.x,t.x),Math.max(n.x,o.x))-Math.max(Math.min(e.x,t.x),Math.min(n.x,o.x))>uu}let a=r?e:n,c=r?t:o,l=r?n:e,h=r?o:t;return s(a.x,l.x,h.x)&&s(l.y,a.y,c.y)},ZS=(e,t)=>{let n=0;for(let o=0;o<e.length-1;o++)for(let r=0;r<t.length-1;r++)if(j8n(e[o],e[o+1],t[r],t[r+1]))n++;return n},K8n=(e,t)=>{for(let n=0;n<e.length-1;n++){let o=e[n],r=e[n+1];for(let i of t){if(!X2(o,r,i))continue;if(yat(o,r,i))continue;return!0}}return!1},Vti=(e,t)=>{let n=0;for(let o of e)for(let r of t){if(o.globalConnNetId===r.globalConnNetId)continue;n+=ZS(o.tracePath,r.tracePath)}return n},m1n=(e,t)=>({turnCount:e.reduce((n,o)=>n+Qf(o.tracePath),0),visibleLength:LS(e),pathLength:e.reduce((n,o)=>n+Zx(o.tracePath),0),otherNetCrossings:Vti(e,t)}),Yti=(e,t)=>{if(e.turnCount!==t.turnCount)return e.turnCount<t.turnCount;if(!ns(e.visibleLength,t.visibleLength))return e.visibleLength<t.visibleLength;if(!ns(e.pathLength,t.pathLength))return e.pathLength<t.pathLength;if(e.otherNetCrossings!==t.otherNetCrossings)return e.otherNetCrossings<t.otherNetCrossings;if(!ns(e.displacement,t.displacement))return e.displacement<t.displacement;return e.coordinate<t.coordinate},Gti=(e,t)=>e.turnCount<=t.turnCount&&(e.turnCount<t.turnCount||e.visibleLength<=t.visibleLength+U2),Uti=(e,t)=>e.tracePath.length!==t.tracePath.length||t.tracePath.some((n,o)=>!bB(n,e.tracePath[o])),Wti=({inputProblem:e,group:t,traces:n,netLabelPlacements:o,obstacles:r,eligibleTraceIds:i})=>{let s=new Set(t.map((f)=>f.traceId)),a=n.filter((f)=>s.has(f.mspPairId)),c=m1n(a,n),l=fat(t.map((f)=>f.coordinate)),h=G8n(t,o,n),d=n.filter((f)=>f.globalConnNetId!==t[0].globalConnNetId),{netConnMap:u}=Qb(e),_=V8n(e,u),p=o.flatMap((f,y)=>f.globalConnNetId===t[0].globalConnNetId&&_.has(f.globalConnNetId)?[y]:[]),m=n.filter((f)=>f.globalConnNetId===t[0].globalConnNetId&&!i.has(f.mspPairId)),A=(f,y)=>{let x=null;for(let C of f){let b=new Map;for(let H of a){let V=Rti(H,t.filter((O)=>O.traceId===H.mspPairId),C);b.set(H.mspPairId,V)}let I=[...b.values()],v=n.map((H)=>b.get(H.mspPairId)??H),P=p.length?Y8n({inputProblem:e,traces:v,netLabelPlacements:o}):o,M=p.map((H)=>{let V=P[H];return zi(V.center,V.width,V.height)});if(!I.every((H)=>!NZ(H.tracePath,r)&&$0({traces:[H],netLabels:o}).length===0&&!M.some((V)=>vti(H.tracePath,V))&&!R8n(H.tracePath,d)&&!Rk(H.tracePath,m.filter((V)=>V.mspPairId!==H.mspPairId))))continue;if(!due(o,n,v))continue;let T=m1n(I,v);if(T.otherNetCrossings>c.otherNetCrossings)continue;if(y?.coordinateIsFixedByLabel?T.turnCount>c.turnCount:!Gti(T,c))continue;let N={...T,displacement:t.reduce((H,V)=>H+Math.abs(V.coordinate-C),0),coordinate:C},D=I.filter((H)=>{let V=n.find((O)=>O.mspPairId===H.mspPairId);return Uti(V,H)}).map((H)=>H.mspPairId);if(D.length===0)continue;let L={traces:v,changedTraceIds:D,score:N};if(!x||Yti(L.score,x.score))x=L}return x},g=A(h===null?l:[h],{coordinateIsFixedByLabel:h!==null});if(g)return g;if(h!==null)return null;return A(Bti({group:t,originalCoordinates:l,otherNetTraces:d}))},Xti=(e)=>{let t=[],n=e.tracePath;for(let o=1;o<n.length-2;o++){let r=n[o-1],i=n[o],s=n[o+1],a=n[o+2],c=Pk(i,s);if(!c)continue;let l=Pk(r,i),h=Pk(s,a);if(!l||!h)continue;if(l===c||h===c)continue;let d=c==="vertical"?[i.y,s.y]:[i.x,s.x];t.push({traceId:e.mspPairId,segmentIndex:o,globalConnNetId:e.globalConnNetId,orientation:c,coordinate:c==="vertical"?i.x:i.y,minAlong:Math.min(...d),maxAlong:Math.max(...d)})}return t},jti=(e,t,n)=>{let o=t.center.x-t.width/2,r=t.center.x+t.width/2,i=t.center.y-t.height/2,s=t.center.y+t.height/2;switch(n){case"x-":return e.orientation==="vertical"&&e.coordinate<=o+U2;case"x+":return e.orientation==="vertical"&&e.coordinate>=r-U2;case"y+":return e.orientation==="horizontal"&&e.coordinate>=s-U2;case"y-":return e.orientation==="horizontal"&&e.coordinate<=i+U2}},_1n=(e,t,n)=>{let o=[],r=k9(e.pins[0],e.pins[1])<=(n?.maxMspPairDistance??Wue);for(let i of Xti(e)){let s=e.pins.flatMap((l,h)=>{let d=t.get(l.chipId);if(!d)return[];let u=l._facingDirection??Lb(l,d);if(!jti(i,d,u))return[];return[{componentId:d.chipId,componentFacingDirection:u,distanceFromEndpoint:h===0?i.segmentIndex:e.tracePath.length-2-i.segmentIndex}]});s.sort((l,h)=>l.distanceFromEndpoint-h.distanceFromEndpoint);let a=s[0]?.distanceFromEndpoint,c=new Set;for(let l of s){if(c.size>0&&(!n?.includeTiedEndpointAssociations||!r))break;if(l.distanceFromEndpoint!==a)continue;let h=`${l.componentId}:${l.componentFacingDirection}`;if(c.has(h))continue;c.add(h),o.push({...i,...l})}}return o};var Kti=(e,t)=>{let n=Math.max(e.minAlong,t.minAlong),o=Math.min(e.maxAlong,t.maxAlong),r=(n+o)/2;return e.orientation==="vertical"?[{x:e.coordinate,y:r},{x:t.coordinate,y:r}]:[{x:r,y:e.coordinate},{x:r,y:t.coordinate}]},$ti=(e,t,n)=>{if(!k8n(e,t))return!0;let[o,r]=Kti(e,t);return!n.some((i)=>X2(o,r,i))},qti=(e,t,n)=>{if(e.traceId===t.traceId)return!0;let o=new Set(n.get(e.traceId).pins.map((r)=>r.pinId));return n.get(t.traceId).pins.some((r)=>o.has(r.pinId))},Jti=(e,t,n,o,r)=>n.globalConnNetId===e.globalConnNetId&&n.orientation===e.orientation&&n.componentId===e.componentId&&n.componentFacingDirection===e.componentFacingDirection&&(k8n(t,n)||qti(t,n,o))&&$ti(t,n,r),Zti=(e,t,n,o,r)=>{let i=new Map(n.chips.map((m)=>[m.chipId,m])),s=new Map(e.map((m)=>[m.mspPairId,m])),a=e.filter((m)=>t.has(m.mspPairId)),c=(m)=>{let A=new Set,g=[];for(let f=0;f<m.length;f++){if(A.has(f))continue;let y=m[f],x=[f],C=[];A.add(f);for(let b=0;b<x.length;b++){let I=m[x[b]];C.push(I);for(let v=0;v<m.length;v++){if(A.has(v))continue;let P=m[v];if(!Jti(y,I,P,s,o))continue;A.add(v),x.push(v)}}g.push(C)}return g},l=(m)=>[m[0].componentId,m[0].componentFacingDirection,m[0].orientation,...m.map((A)=>`${A.traceId}:${A.segmentIndex}`).sort()].join("|"),h=[],d=new Set,u=(m,A)=>{if(new Set(m.map((b)=>b.traceId)).size<2)return;let f=G8n(m,r,e);if(A?.requireFixedLabel&&f===null)return;let y=m.some((b)=>!ns(b.coordinate,m[0].coordinate)),x=f!==null&&!ns(f,m[0].coordinate);if(!y&&!x)return;let C=l(m);if(d.has(C))return;d.add(C),h.push(m)},_=a.flatMap((m)=>_1n(m,i));for(let m of c(_))u(m);let p=a.flatMap((m)=>_1n(m,i,{includeTiedEndpointAssociations:!0,maxMspPairDistance:n.maxMspPairDistance}));for(let m of c(p))u(m,{requireFixedLabel:!0});return h},g1n=(e)=>JSON.stringify(e.map((t)=>({mspPairId:t.mspPairId,tracePath:t.tracePath}))),eni=({inputProblem:e,traces:t,netLabelPlacements:n,eligibleTraceIds:o})=>{let r=[...t],i=new Set([g1n(r)]),s=wy(e),a=new Set,c=0,l=Math.max(1,t.reduce((h,d)=>h+d.tracePath.length,0));for(let h=0;h<l;h++){let d=Zti(r,o,e,s,n),u=null;for(let m of d)if(u=Wti({inputProblem:e,group:m,traces:r,netLabelPlacements:n,obstacles:s,eligibleTraceIds:o}),u)break;if(!u)break;let _=g1n(u.traces),p=i.has(_);if(!p)i.add(_);r=u.traces,c++;for(let m of u.changedTraceIds)a.add(m);if(p)break}return{traces:r,alignedRailGroupCount:c,alignedTraceCount:a.size}},tni=(e)=>{let t=[];if(e.length<3)return t;for(let n=0;n<e.length-2;n++){let o=e[n],r=e[n+1],i=e[n+2],s=r.x-o.x,a=r.y-o.y,c=i.x-r.x,l=i.y-r.y;if((s===0&&l===0&&a!==0&&c!==0||a===0&&c===0&&s!==0&&l!==0)&&s*s+a*a>=0.25&&c*c+l*l>=0.25)t.push({p1:o,p2:r,p3:i})}return t},nni=(e,t)=>{let n=[];for(let o of e)if(o.mspPairId!==t)n.push({points:o.tracePath});return n},G8e=0.000001,A1n=(e,t,n)=>{let o=[];for(let r of n){let i=r.points;for(let s=0;s<i.length-1;s++){let a=i[s],c=i[s+1];if(!a||!c)continue;let l=rP(e,t,a,c);if(l)o.push(l)}}return o},oni=(e,t)=>Math.abs(e.x-t.x)<G8e&&Math.abs(e.y-t.y)<G8e,NY=(e,t,n={})=>{let o=[],r=n.includeTerminalSegments?0:1,i=n.includeTerminalSegments?e.length-1:e.length-2,s=n.includeTerminalSegments?0:1,a=n.includeTerminalSegments?t.length-1:t.length-2;for(let c=r;c<i;c++){let l=e[c],h=e[c+1],d=Math.abs(l.x-h.x)<G8e;for(let u=s;u<a;u++){let _=t[u],p=t[u+1],m=Math.abs(_.x-p.x)<G8e;if(d===m)continue;let A=rP(l,h,_,p);if(!A||[l,h,_,p].some((g)=>oni(g,A)))continue;o.push({pathSegmentIndex:c,otherPathSegmentIndex:u})}}return o},IS=0.000001,KQ=(e,t,n=IS)=>Math.abs(e.x-t.x)<n,rni=({lShape:e,rectangle:t,padding:n=0.5,interactionPoint1:o,interactionPoint2:r})=>{let{p1:i,p2:s,p3:a}=e,{x:c,y:l,width:h,height:d}=t,u,_=o,p=r;if(Math.abs(s.x-c)<IS&&Math.abs(s.y-(l+d))<IS){if(u={x:c+h+n,y:l-n},KQ(i,s))_={x:o.x,y:o.y-n};else _={x:o.x+n,y:o.y};if(KQ(s,a))p={x:r.x,y:r.y-n};else p={x:r.x+n,y:r.y}}else if(Math.abs(s.x-(c+h))<IS&&Math.abs(s.y-(l+d))<IS){if(u={x:c-n,y:l-n},KQ(i,s))_={x:o.x,y:o.y-n};else _={x:o.x-n,y:o.y};if(KQ(s,a))p={x:r.x,y:r.y-n};else p={x:r.x-n,y:r.y}}else if(Math.abs(s.x-c)<IS&&Math.abs(s.y-l)<IS){if(u={x:c+h+n,y:l+d+n},KQ(i,s))_={x:o.x,y:o.y+n};else _={x:o.x+n,y:o.y};if(KQ(s,a))p={x:r.x,y:r.y+n};else p={x:r.x+n,y:r.y}}else if(Math.abs(s.x-(c+h))<IS&&Math.abs(s.y-l)<IS){if(u={x:c-n,y:l+d+n},KQ(i,s))_={x:o.x,y:o.y+n};else _={x:o.x-n,y:o.y};if(KQ(s,a))p={x:r.x,y:r.y+n};else p={x:r.x-n,y:r.y}}else return[];return[[_,u,p]]},f1n=({trace:e,chipBounds:t,clearance:n})=>{if(e.tracePath.length<4||t.length===0)return[];let o=e.tracePath[0],r=e.tracePath[1],i=e.tracePath.at(-2),s=e.tracePath.at(-1),a=Math.min(...t.map((u)=>u.minX))-n,c=Math.max(...t.map((u)=>u.maxX))+n,l=Math.min(...t.map((u)=>u.minY))-n,h=Math.max(...t.map((u)=>u.maxY))+n,d=[];for(let u of[a,c])for(let _ of[l,h])d.push({traceId:e.mspPairId,path:vi([o,r,{x:r.x,y:_},{x:u,y:_},{x:u,y:i.y},i,s])}),d.push({traceId:e.mspPairId,path:vi([o,r,{x:u,y:r.y},{x:u,y:_},{x:i.x,y:_},i,s])});return d},Vrt=({trace:e,segmentIndex:t,obstacleStart:n,obstacleEnd:o,obstacleBounds:r,chipBounds:i,clearance:s})=>{let a=(h,d)=>{let u=h[d],_=h[d+1],p=Math.abs(u.x-_.x)<IS?"y":"x",m=p==="x"?"y":"x",A=r??{minX:Math.min(n.x,o.x),minY:Math.min(n.y,o.y),maxX:Math.max(n.x,o.x),maxY:Math.max(n.y,o.y)},g=p==="x"?"minX":"minY",f=p==="x"?"maxX":"maxY",y=n[p]+Math.sign(u[p]-n[p])*s;if(r){let T=u[p]<(A[g]+A[f])/2?-1:1;y=A[T<0?g:f]+T*s}let x=m==="x"?"minX":"minY",C=m==="x"?"maxX":"maxY",b=A[x]-s,I=A[C]+s,v=r?h[d+2]:void 0,M=[v?v[m]<b?(v[m]+b)/2:v[m]>I?(v[m]+I)/2:void 0:void 0,b,I,...i.flatMap((T)=>[T[x]-s,T[C]+s])].filter((T)=>T!==void 0),B=h.slice(d+2);if(B.length===0)B.push(_);return[...new Set(M)].map((T)=>vi([...h.slice(0,d+1),{...u,[p]:y},{...u,[p]:y,[m]:T},{..._,[m]:T},...B]))},c=[...e.tracePath].reverse(),l=e.tracePath.length-2-t;return[...a(e.tracePath,t),...a(c,l).map((h)=>h.reverse())].map((h)=>({traceId:e.mspPairId,path:h}))},Ove=(e,t,n)=>{if(e.length<2)return{isColliding:!1};for(let o=0;o<e.length-1;o++){let r=e[o],i=e[o+1];for(let s of t){if(s.mspPairId===n)continue;for(let a=0;a<s.tracePath.length-1;a++){let c=s.tracePath[a],l=s.tracePath[a+1],h=rP(r,i,c,l);if(h)return{isColliding:!0,collidingTraceId:s.mspPairId,collisionPoint:h}}}}return{isColliding:!1}},ini=(e,t)=>{let n=[];for(let o of e)for(let r of t){let i=Math.min(o.x,r.x),s=Math.min(o.y,r.y),a=Math.max(o.x,r.x),c=Math.max(o.y,r.y),l=a-i,h=c-s;if(l>0.000001&&h>0.000001)n.push({rect:{x:i,y:s,width:l,height:h},i1:o,i2:r})}return n},rve=(e)=>{let t={circles:[],lines:[]},n=Array.isArray(e)?e:[e];for(let o of n)t.circles.push({center:{x:o.p2.x,y:o.p2.y},radius:0.01,fill:"blue"}),t.lines.push({points:[o.p1,o.p2,o.p3],strokeColor:"lightblue"});return t},y1n=(e,t="red")=>{let n={circles:[]};for(let o of e)n.circles.push({center:{x:o.x,y:o.y},radius:0.01,fill:t});return n},x1n=(e)=>{let t={rects:[]};return t.rects.push({center:{x:e.x+e.width/2,y:e.y+e.height/2},width:e.width,height:e.height,stroke:"green"}),t},sni=(e,t="gray",n=[])=>{let o={lines:[],circles:[]};for(let r of e)o.lines.push({points:r,strokeColor:t});for(let r of n)o.circles.push({center:r,radius:0.01,fill:"green"});return o},xnt=(e)=>{let t={lines:[],points:[],rects:[],circles:[],texts:[]};for(let n of e){if(!n)continue;if(n.lines)t.lines.push(...n.lines);if(n.points)t.points.push(...n.points);if(n.rects)t.rects.push(...n.rects);if(n.circles)t.circles.push(...n.circles);if(n.texts)t.texts.push(...n.texts)}return t},ani=(e)=>{let t={circles:[]};if(e?.isColliding&&e.collisionPoint)t.circles.push({center:e.collisionPoint,radius:0.01,fill:"red"});return t},cni=class extends mu{input;chipObstacleSpatialIndex;lShapesToProcess=[];ignoredCrossings=new Set;reroutedTraceIds=new Set;processingCrossings=!0;visualizationMode="l_shapes";currentLShape=null;intersectionPoints=[];tightRectangle=null;candidates=[];bestRoute=null;lastCollision=null;collidingCandidate=null;rectangleCandidates=[];currentRectangleIndex=0;isInitialStep=!0;currentCandidateIndex=0;lShapeProcessingStep="idle";lShapeJustProcessed=!1;bestRouteFound=null;constructor(e){super();if(this.input=e,this.visualizationMode="l_shapes",this.chipObstacleSpatialIndex=this.input.inputProblem._chipObstacleSpatialIndex??new O7e(this.input.inputProblem.chips),!this.input.inputProblem._chipObstacleSpatialIndex)this.input.inputProblem._chipObstacleSpatialIndex=this.chipObstacleSpatialIndex}_step(){if(this.isInitialStep){this.isInitialStep=!1;return}if(this.processingCrossings){let e=this._findCrossing();if(e){if(!this._resolveCrossing(e))this.ignoredCrossings.add(this._crossingKey(e));return}this.processingCrossings=!1,this._initializeLShapes();return}if(this.lShapeJustProcessed){this._resetAfterLShapProcessing();return}if(this.lShapesToProcess.length===0&&this.currentLShape===null){this.solved=!0;return}switch(this.lShapeProcessingStep){case"idle":this._handleIdleStep();break;case"intersections":this._handleIntersectionsStep();break;case"rectangle_selection":this._handleRectangleSelectionStep();break;case"candidate_evaluation":this._handleCandidateEvaluationStep();break}}_initializeLShapes(){for(let e of this.input.allTraces)this.lShapesToProcess.push(...tni(e.tracePath).map((t)=>({...t,traceId:e.mspPairId})))}_crossingKey(e){return`${e.trace.mspPairId}:${e.segmentIndex}:${e.otherTrace.mspPairId}:${e.otherSegmentIndex}`}_isTraceBundle(e,t){let n=(o)=>o.pins.map((r)=>r.chipId).sort().join(":");if(n(e)!==n(t))return!1;return Object.values(this.input.mergedLabelNetIdMap).some((o)=>o.has(e.globalConnNetId)&&o.has(t.globalConnNetId))}_findCrossing(){let e=this.input.allTraces;for(let t=0;t<e.length;t++){let n=e[t];for(let o=t+1;o<e.length;o++){let r=e[o];if(n.globalConnNetId===r.globalConnNetId)continue;let i=this._isTraceBundle(n,r),s=this.input.eligibleTraceIds?.has(n.mspPairId)===!0||this.input.eligibleTraceIds?.has(r.mspPairId)===!0;if(!i&&!s&&!this.reroutedTraceIds.has(n.mspPairId)&&!this.reroutedTraceIds.has(r.mspPairId))continue;let a=NY(n.tracePath,r.tracePath);for(let{pathSegmentIndex:c,otherPathSegmentIndex:l}of a){let h={trace:n,segmentIndex:c,otherTrace:r,otherSegmentIndex:l,isInitialBundleCrossing:i};if(!this.ignoredCrossings.has(this._crossingKey(h)))return h}}}return null}_resolveCrossing(e){let t=this.chipObstacleSpatialIndex.chips.map((a)=>a.bounds),n=[...Vrt({trace:e.trace,segmentIndex:e.segmentIndex,obstacleStart:e.otherTrace.tracePath[e.otherSegmentIndex],obstacleEnd:e.otherTrace.tracePath[e.otherSegmentIndex+1],chipBounds:t,clearance:this.input.paddingBuffer}),...Vrt({trace:e.otherTrace,segmentIndex:e.otherSegmentIndex,obstacleStart:e.trace.tracePath[e.segmentIndex],obstacleEnd:e.trace.tracePath[e.segmentIndex+1],chipBounds:t,clearance:this.input.paddingBuffer}),...f1n({trace:e.trace,chipBounds:t,clearance:this.input.paddingBuffer}),...f1n({trace:e.otherTrace,chipBounds:t,clearance:this.input.paddingBuffer})],o=wy(this.input.inputProblem).filter((a)=>a.kind==="chip"),i=n.map((a)=>({...a,collision:Ove(a.path,this.input.allTraces,a.traceId)})).filter((a)=>!K8n(a.path,o)&&!Ove(a.path,[e.trace,e.otherTrace],a.traceId).isColliding&&(e.isInitialBundleCrossing||!a.collision.isColliding)).sort((a,c)=>Number(a.collision.isColliding)-Number(c.collision.isColliding)||Zx(a.path)-Zx(c.path))[0];if(!i)return!1;let s=this.input.allTraces.findIndex((a)=>a.mspPairId===i.traceId);return this.input.allTraces[s]={...this.input.allTraces[s],tracePath:i.path},this.reroutedTraceIds.add(i.traceId),!0}_resetAfterLShapProcessing(){this.lShapeProcessingStep="idle",this.currentLShape=null,this.currentCandidateIndex=0,this.lShapeJustProcessed=!1,this.visualizationMode="l_shapes",this.intersectionPoints=[],this.tightRectangle=null,this.candidates=[],this.bestRoute=null,this.lastCollision=null,this.collidingCandidate=null}_handleIdleStep(){if(this.currentLShape=this.lShapesToProcess.shift(),!this.currentLShape){this.solved=!0;return}this.lShapeProcessingStep="intersections",this.visualizationMode="l_shapes"}_handleIntersectionsStep(){if(!this.currentLShape.traceId){this.lShapeProcessingStep="idle";return}let e=nni(this.input.allTraces,this.currentLShape.traceId),t=A1n(this.currentLShape.p1,this.currentLShape.p2,e),n=A1n(this.currentLShape.p2,this.currentLShape.p3,e);if(this.intersectionPoints=[...t,...n],t.length===0||n.length===0){this.lShapeProcessingStep="idle";return}this.rectangleCandidates=ini(t,n),this.currentRectangleIndex=0,this.lShapeProcessingStep="rectangle_selection"}_handleRectangleSelectionStep(){if(this.currentRectangleIndex>=this.rectangleCandidates.length){this.lShapeProcessingStep="idle";return}let{rect:e,i1:t,i2:n}=this.rectangleCandidates[this.currentRectangleIndex];this.tightRectangle=e,this.candidates=rni({lShape:this.currentLShape,rectangle:this.tightRectangle,padding:2*this.input.paddingBuffer,interactionPoint1:t,interactionPoint2:n}),this.currentCandidateIndex=0,this.lastCollision=null,this.collidingCandidate=null,this.visualizationMode="candidates",this.lShapeProcessingStep="candidate_evaluation"}_handleCandidateEvaluationStep(){if(this.visualizationMode="candidates",this.bestRouteFound){this._applyBestRoute(this.bestRouteFound),this.bestRouteFound=null;return}if(this.currentCandidateIndex>=this.candidates.length){this.currentRectangleIndex++,this.lShapeProcessingStep="rectangle_selection";return}let e=this.candidates[this.currentCandidateIndex],t=Ove(e,this.input.allTraces,this.currentLShape.traceId);if(!t?.isColliding&&this._doesCandidateCrossChip(e)){this.lastCollision=null,this.collidingCandidate=e,this.currentCandidateIndex++;return}if(!t?.isColliding)this.bestRouteFound=e,this.lastCollision=null,this.collidingCandidate=null;else this.lastCollision=t,this.collidingCandidate=e,this.currentCandidateIndex++}_doesCandidateCrossChip(e){for(let t=0;t<e.length-1;t++)if(this.chipObstacleSpatialIndex.doesOrthogonalLineIntersectChip([e[t],e[t+1]]))return!0;return!1}_applyBestRoute(e){this.bestRoute=e,this.collidingCandidate=null,this.lastCollision=null;let t=this.input.allTraces.findIndex((n)=>n.mspPairId===this.currentLShape.traceId);if(t!==-1){let n=this.input.allTraces[t],o=n.tracePath.findIndex((r)=>r.x===this.currentLShape.p2.x&&r.y===this.currentLShape.p2.y);if(o!==-1){let r=[...n.tracePath.slice(0,o),...e,...n.tracePath.slice(o+1)];this.input.allTraces[t]={...n,tracePath:r},this.lShapesToProcess=this.lShapesToProcess.filter((i)=>i.traceId!==this.currentLShape.traceId)}}this.lShapeJustProcessed=!0}getOutput(){return{traces:this.input.allTraces}}visualize(){switch(this.visualizationMode){case"l_shapes":return rve(this.lShapesToProcess);case"intersection_points":return xnt([this.currentLShape?rve(this.currentLShape):void 0,y1n(this.intersectionPoints)]);case"tight_rectangle":return xnt([this.currentLShape?rve(this.currentLShape):void 0,y1n(this.intersectionPoints),this.tightRectangle?x1n(this.tightRectangle):void 0]);case"candidates":{if(this.lShapeJustProcessed){let n={lines:[]};for(let o of this.input.allTraces){let r=o.mspPairId===this.currentLShape?.traceId;for(let i=0;i<o.tracePath.length-1;i++)n.lines.push({points:[o.tracePath[i],o.tracePath[i+1]],strokeColor:r?"green":"#ccc"})}return n}let e={lines:[]};for(let n of this.input.allTraces)for(let o=0;o<n.tracePath.length-1;o++)e.lines.push({points:[n.tracePath[o],n.tracePath[o+1]],strokeColor:"#ccc"});let t;if(this.bestRouteFound)t=this.bestRouteFound;else if(this.lastCollision?.isColliding)t=this.collidingCandidate??void 0;else if(this.currentCandidateIndex<this.candidates.length)t=this.candidates[this.currentCandidateIndex];return xnt([e,this.currentLShape?rve(this.currentLShape):void 0,this.tightRectangle?x1n(this.tightRectangle):void 0,t?sni([t],this.bestRouteFound?"green":"blue",this.intersectionPoints):void 0,this.lastCollision?ani(this.lastCollision):void 0])}default:return{}}}},$8n=0.000001,ive=(e,t)=>Math.abs(e.x-t.x)<=$8n,sve=(e,t)=>Math.abs(e.y-t.y)<=$8n,lni=(e)=>{if(e.length!==4)return!1;let[t,n,o,r]=e,i=sve(t,n)&&ive(n,o)&&sve(o,r)&&ive(t,r),s=ive(t,n)&&sve(n,o)&&ive(o,r)&&sve(t,r);return i||s},q8n=(e)=>{let t=[e];for(let n=1;n<e.length-3;n++)for(let o=n+2;o<e.length-1;o++)for(let r of Frt(e[n],e[o])){let i=vi([...e.slice(0,n),...r,...e.slice(o+1)]);if([[0,1],[-1,-2]].every(([a,c])=>{let l=e.at(a),h=e.at(c),d=i.at(c);return(h.x-l.x)*(d.x-l.x)+(h.y-l.y)*(d.y-l.y)>0}))t.push(i)}return t},C1n=0.000001,hni=(e,t,n)=>{let o=e.tracePath[t],r=e.tracePath[t+1],i={minX:Math.min(o.x,r.x),minY:Math.min(o.y,r.y),maxX:Math.max(o.x,r.x),maxY:Math.max(o.y,r.y)};for(let s of n){if(s.globalConnNetId!==e.globalConnNetId)continue;if(!s.pinIds.every((c)=>e.pinIds.includes(c)))continue;if(!Ts(e.tracePath,s.anchorPoint))continue;let a=zi(s.center,s.width,s.height);i.minX=Math.min(i.minX,a.minX),i.minY=Math.min(i.minY,a.minY),i.maxX=Math.max(i.maxX,a.maxX),i.maxY=Math.max(i.maxY,a.maxY)}return i},dni=(e,t,n)=>{let o=[];for(let r of e){if(!t.has(r.mspPairId))continue;for(let i=0;i<e.length;i++){let s=e[i];if(s.mspPairId===r.mspPairId)continue;if(t.has(s.mspPairId))continue;if(s.globalConnNetId===r.globalConnNetId)continue;if(n&&!n.has(s.mspPairId))continue;for(let a of NY(s.tracePath,r.tracePath,{includeTerminalSegments:!0}))o.push({traceIndex:i,connector:r,connectorSegmentIndex:a.otherPathSegmentIndex,traceSegmentIndex:a.pathSegmentIndex})}}return o},uni=({inputProblem:e,traces:t,netLabelPlacements:n,mergedLabelNetIdMap:o,clearance:r,eligibleTraceIds:i,connectorTraceIds:s})=>{let a=[...t],c=wy(e).filter((h)=>h.kind==="chip"||h.kind==="text_box"),l=0;while(!0){let h=dni(a,s,i).flatMap((u)=>{let _=a[u.traceIndex],p=hni(u.connector,u.connectorSegmentIndex,n),m=a.filter((g)=>g.mspPairId!==_.mspPairId&&g.globalConnNetId!==_.globalConnNetId),A=n.filter((g)=>{let f=o[g.globalConnNetId];return f?!f.has(_.globalConnNetId):g.globalConnNetId!==_.globalConnNetId}).map((g)=>zi(g.center,g.width,g.height));return Vrt({trace:_,segmentIndex:u.traceSegmentIndex,obstacleStart:u.connector.tracePath[u.connectorSegmentIndex],obstacleEnd:u.connector.tracePath[u.connectorSegmentIndex+1],obstacleBounds:p,chipBounds:[],clearance:r}).flatMap((g)=>q8n(g.path).map((f)=>({...g,path:f}))).filter((g)=>Zx(g.path)<=Zx(_.tracePath)+C1n&&Qf(g.path)<=Qf(_.tracePath)+2&&!NZ(g.path,c)&&!zve(g.path,A)&&!Ove(g.path,m,_.mspPairId).isColliding&&!Rk(g.path,m)).map((g)=>({...g,traceIndex:u.traceIndex}))});h.sort((u,_)=>{let p=Zx(u.path)-Zx(_.path);return Math.abs(p)>C1n?p:Qf(u.path)-Qf(_.path)});let d=h[0];if(!d)break;a[d.traceIndex]={...a[d.traceIndex],tracePath:d.path},l++}return{traces:a,reroutedTraceCount:l}},pni=["untangling_traces","minimizing_turns","balancing_l_shapes"],b1n=class extends mu{input;outputTraces;traceIdQueue;tracesMap;operations;operationIndex=0;pipelineStep;activeTraceId=null;activeSubSolver=null;constructor(e){super();this.input=e,this.outputTraces=[...e.allTraces],this.tracesMap=new Map(this.outputTraces.map((t)=>[t.mspPairId,t])),this.operations=e.operations??pni,this.pipelineStep=this.operations[0]??null,this.traceIdQueue=Array.from(e.allTraces.map((t)=>t.mspPairId))}_step(){if(this.activeSubSolver){if(this.activeSubSolver.step(),this.activeSubSolver.solved){let e=this.activeSubSolver.getOutput();this.outputTraces=e.traces,this.tracesMap=new Map(this.outputTraces.map((t)=>[t.mspPairId,t])),this.activeSubSolver=null,this._advancePipeline()}else if(this.activeSubSolver.failed)this.activeSubSolver=null,this._advancePipeline();return}if(!this.pipelineStep){this.solved=!0;return}switch(this.pipelineStep){case"untangling_traces":this._runUntangleTracesStep();break;case"rerouting_generated_net_label_connector_crossings":this._runGeneratedNetLabelConnectorCrossingRerouteStep();break;case"minimizing_turns":this._runMinimizeTurnsStep();break;case"balancing_l_shapes":this._runBalanceLShapesStep();break;case"aligning_same_net_rails":this._runAlignSameNetRailsStep();break}}_advancePipeline(){if(this.operationIndex++,this.pipelineStep=this.operations[this.operationIndex]??null,this.traceIdQueue=this.outputTraces.map((e)=>e.mspPairId),this.pipelineStep)this.activeTraceId=null}_runUntangleTracesStep(){this.activeSubSolver=new cni({...this.input,allTraces:Array.from(this.tracesMap.values())})}_runGeneratedNetLabelConnectorCrossingRerouteStep(){let e=uni({inputProblem:this.input.inputProblem,traces:this.outputTraces,netLabelPlacements:this.input.allLabelPlacements,mergedLabelNetIdMap:this.input.mergedLabelNetIdMap,clearance:this.input.paddingBuffer,eligibleTraceIds:this.input.eligibleTraceIds,connectorTraceIds:this.input.netLabelConnectorTraceIds??new Set});this.outputTraces=e.traces,this.tracesMap=new Map(this.outputTraces.map((t)=>[t.mspPairId,t])),this.stats.reroutedGeneratedConnectorCrossingTraceCount=e.reroutedTraceCount,this._advancePipeline()}_runMinimizeTurnsStep(){if(this.traceIdQueue.length===0){this._advancePipeline();return}this._processTrace("minimizing_turns")}_runBalanceLShapesStep(){if(this.traceIdQueue.length===0){this._advancePipeline();return}this._processTrace("balancing_l_shapes")}_processTrace(e){let t=this.traceIdQueue.shift();this.activeTraceId=t;let n=this.tracesMap.get(t);if(lni(n.tracePath))return;let o=Array.from(this.tracesMap.values()),r;if(e==="minimizing_turns")r=H8n({...this.input,targetMspConnectionPairId:t,traces:o});else r=bti({...this.input,targetMspConnectionPairId:t,traces:o});this.tracesMap.set(t,r),this.outputTraces=Array.from(this.tracesMap.values())}_runAlignSameNetRailsStep(){let e=eni({inputProblem:this.input.inputProblem,traces:this.outputTraces,netLabelPlacements:this.input.allLabelPlacements,eligibleTraceIds:this.input.eligibleTraceIds??new Set(this.outputTraces.map((t)=>t.mspPairId))});this.outputTraces=e.traces,this.tracesMap=new Map(this.outputTraces.map((t)=>[t.mspPairId,t])),this.stats.alignedRailGroupCount=e.alignedRailGroupCount,this.stats.alignedTraceCount=e.alignedTraceCount,this._advancePipeline()}getOutput(){return{traces:this.outputTraces}}visualize(){if(this.activeSubSolver)return this.activeSubSolver.visualize();let e=J0(this.input.inputProblem,{chipAlpha:0.1,connectionAlpha:0.1});if(!e.lines)e.lines=[];if(!e.points)e.points=[];if(!e.rects)e.rects=[];if(!e.circles)e.circles=[];if(!e.texts)e.texts=[];for(let t of this.outputTraces){let n={points:t.tracePath.map((o)=>({x:o.x,y:o.y})),strokeColor:t.mspPairId===this.activeTraceId?"red":"blue"};e.lines.push(n)}return e}},mni=({tracePath:e,sourcePoint:t,extensionEndPoint:n})=>{let o=e.findIndex((s)=>bB(s,t));if(o<=0||o>=e.length-1)return null;let r=n.y-t.y,i=[o-1,o+1].find((s)=>{let a=e[s];return Y2(a,t)&&(a.y-t.y)*r<0});if(i===void 0)return null;return e.toSpliced(Math.max(o,i),0,n)},Cat=(e)=>{let t={};for(let n of e.chips)for(let o of n.pins)t[o.pinId]={...o,chipId:n.chipId};return t},bat=(e,t)=>{let n=e.pinIds.flatMap((r)=>{let i=t[r];return i?[i]:[]});if(n.length>=2)return[n[0],n[1]];if(n.length===1)return[n[0],n[0]];let o={pinId:`${e.globalConnNetId}-netlabel-anchor`,x:e.anchorPoint.x,y:e.anchorPoint.y,chipId:"available-net-orientation"};return[o,o]},_ni=(e)=>({orientation:e.orientation,anchorPoint:e.anchorPoint,center:e.center,width:e.width,height:e.height}),j0=(e)=>{switch(e){case"x+":return{x:1,y:0};case"x-":return{x:-1,y:0};case"y+":return{x:0,y:1};case"y-":return{x:0,y:-1}}throw Error(`Invalid facing direction: ${e}`)},Iat=(e,t,n)=>{let o=Hti(t,e);if(!o)return null;let r=zti(n,o.index,t.length-1,o.orientation,e);if(!r)return Oti(e,n);return xat(e,r.start,r.end)},J8n=(e,t)=>e.globalConnNetId===t.globalConnNetId||e.mspConnectionPairIds.includes(t.mspPairId),RZ=({trace:e,originalTracePath:t,reroutedTracePath:n,netLabelPlacements:o})=>o.map((r)=>{if(!J8n(r,e))return r;let i=Iat(r.anchorPoint,t,n);if(!i)return r;let s={x:i.x-r.anchorPoint.x,y:i.y-r.anchorPoint.y};return{...r,anchorPoint:i,center:{x:r.center.x+s.x,y:r.center.y+s.y}}}),gni=({originalTraces:e,reroutedTraces:t,netLabelPlacements:n})=>{let o=[...t],r=new Map(t.map((s)=>[s.mspPairId,s])),i=n.map((s)=>{let a=e.find((m)=>{if(!s.mspConnectionPairIds.includes(m.mspPairId))return!1;let A=r.get(m.mspPairId);if(!A)return!1;return A.tracePath!==m.tracePath});if(!a)return s;let c=r.get(a.mspPairId),l=e.findIndex((m)=>{if(m.mspPairId===a.mspPairId)return!1;if(m.globalConnNetId!==s.globalConnNetId)return!1;if(!Ts(m.tracePath,s.anchorPoint))return!1;return s.pinIds.every((A)=>m.pinIds.includes(A))});if(l<0)return s;let h=e[l],d=h.tracePath.find((m)=>Ts(a.tracePath,m));if(!d)return s;let u=Iat(d,a.tracePath,c.tracePath);if(!u)return s;let _={x:u.x-d.x,y:u.y-d.y},p={...h,tracePath:h.tracePath.map((m)=>({x:m.x+_.x,y:m.y+_.y}))};return o[l]=p,RZ({trace:h,originalTracePath:h.tracePath,reroutedTracePath:p.tracePath,netLabelPlacements:[s]})[0]});return{traces:o,netLabelPlacements:i}},Ani=(e,t)=>{for(let n=0;n<e.length-1;n++){let o=e[n],r=e[n+1];for(let i of t){if(!yat(o,r,i))continue;if(Z8n(o,r,i)>uu)return!0}}return!1},fni=(e,t)=>{let n=0;for(let o=0;o<e.length-1;o++){let r=e[o],i=e[o+1];for(let s of t){if(!yat(r,i,s))continue;let a=Z8n(r,i,s);if(a>uu)n+=a}}return n},Z8n=(e,t,n)=>{if(Math.abs(e.x-t.x)<uu)return Math.min(Math.max(e.y,t.y),n.maxY)-Math.max(Math.min(e.y,t.y),n.minY);return Math.min(Math.max(e.x,t.x),n.maxX)-Math.max(Math.min(e.x,t.x),n.minX)},e3=0.1,yni=16,xni=({x:e,lowY:t,highY:n,outputTraces:o,netId:r})=>{for(let i of o){if(i.globalConnNetId===r)continue;let s=i.tracePath;for(let a=0;a+1<s.length;a++){let c=s[a],l=s[a+1];if(Math.abs(c.x-l.x)>=0.000000001)continue;if(Math.abs(c.x-e)>=e3/2)continue;let h=Math.min(c.y,l.y),d=Math.max(c.y,l.y);if(Math.min(n,d)-Math.max(t,h)>0.000001)return!0}}return!1},Cni=({trace:e,obstacleLabel:t,inputProblem:n,outputTraces:o,outputNetLabelPlacements:r,chipObstacles:i})=>{let s=bni({trace:e,label:t,inputProblem:n,outputTraces:o,outputNetLabelPlacements:r,chipObstacles:i}),a=Sni({trace:e,obstacleLabel:t,outputTraces:o,outputNetLabelPlacements:r,candidateResults:s,chipObstacles:i});return Eni(s,a),{bestPath:a,candidateResults:s}},bni=({trace:e,label:t,inputProblem:n,outputTraces:o,outputNetLabelPlacements:r,chipObstacles:i})=>{let s=new Set,a=[],c=Pni({trace:e,label:t,outputTraces:o});if(c)a.push(I1n({trace:e,obstacleLabel:t,path:c,seen:s,outputTraces:o,outputNetLabelPlacements:r,chipObstacles:i,usesHorizontalSegmentPush:!0}));let l=[...vni(e,t),...B8n({trace:e,label:t,problem:n,paddingBuffer:e3,detourCount:0}),...Ini(e,t)];for(let h of l)a.push(I1n({trace:e,obstacleLabel:t,path:vi(h),seen:s,outputTraces:o,outputNetLabelPlacements:r,chipObstacles:i}));return a},I1n=({trace:e,obstacleLabel:t,path:n,seen:o,outputTraces:r,outputNetLabelPlacements:i,chipObstacles:s,usesHorizontalSegmentPush:a})=>{let c=Qti(n);if(o.has(c))return{path:n,status:"duplicate",usesHorizontalSegmentPush:a,selected:!1};if(o.add(c),K8n(n,s))return{path:n,status:"chip-collision",usesHorizontalSegmentPush:a,selected:!1};return{path:n,score:e7n({trace:e,tracePath:n,obstacleLabel:t,outputTraces:r,outputNetLabelPlacements:i,chipObstacles:s}),status:"valid",usesHorizontalSegmentPush:a,selected:!1}},Ini=(e,t)=>{let n=e.tracePath[0],o=e.tracePath[e.tracePath.length-1];if(!n||!o)return[];let r=e.tracePath[1]??n,i=e.tracePath[e.tracePath.length-2]??o,s=zi(t.center,t.width,t.height),a=e3,c=j0(t.orientation),l=c.x<0?s.minX-a:s.maxX+a,h=c.x<0?s.maxX+a:s.minX-a,d=s.maxY+a,u=s.minY-a,_=[];for(let p of[l,h])_.push([n,r,{x:r.x,y:d},{x:p,y:d},{x:p,y:u},{x:i.x,y:u},i,o],[n,r,{x:r.x,y:u},{x:p,y:u},{x:p,y:d},{x:i.x,y:d},i,o]);return _},vni=(e,t)=>{let n=e.tracePath[0],o=e.tracePath[e.tracePath.length-1];if(!n||!o)return[];let r=e.tracePath[1]??n,i=e.tracePath[e.tracePath.length-2]??o,s=j0(t.orientation);if(s.x===0)return[];let a=zi(t.center,t.width,t.height),c=s.x<0?a.minX-e3:a.maxX+e3,l=a.maxY+e3,h=a.minY-e3,d=r.y>=i.y,u=d?l:h,_=d?h:l;return[[n,r,{x:r.x,y:u},{x:c,y:u},{x:c,y:_},{x:i.x,y:_},i,o],[n,r,{x:r.x,y:_},{x:c,y:_},{x:c,y:u},{x:i.x,y:u},i,o]]},Sni=({trace:e,obstacleLabel:t,outputTraces:n,outputNetLabelPlacements:o,candidateResults:r,chipObstacles:i})=>{for(let c of r){if(!c.usesHorizontalSegmentPush)continue;if(c.status!=="valid")continue;if(!c.score)continue;return c.path}let s=null,a=e7n({trace:e,tracePath:e.tracePath,obstacleLabel:t,outputTraces:n,outputNetLabelPlacements:o,chipObstacles:i});for(let c of r){if(c.status!=="valid"||!c.score)continue;if(!wni(c.score,a))continue;a=c.score,s=c.path}return s},Pni=({trace:e,label:t,outputTraces:n})=>{let o=j0(t.orientation);if(o.x===0)return null;let r=e.tracePath,i=zi(t.center,t.width,t.height),s=r.findIndex((f,y)=>{let x=r[y+1];if(!x)return!1;if(Math.abs(f.x-x.x)>=0.000000001)return!1;return H9(f,x,i)});if(s<=0||s>=r.length-2)return null;let a=r[s-1],c=r[s],l=r[s+1],h=r[s+2];if(Math.abs(a.y-c.y)>=0.000000001||Math.abs(l.y-h.y)>=0.000000001)return null;let d=i.minX-e3;if(o.x>0)d=i.maxX+e3;let u=o.x>0?e3:-e3,_=Math.min(c.y,l.y),p=Math.max(c.y,l.y);for(let f=0;f<yni;f++){if(!xni({x:d,lowY:_,highY:p,outputTraces:n,netId:e.globalConnNetId}))break;d+=u}let m=v1n({start:a,end:{x:d,y:c.y},labelBounds:i}),A=v1n({start:{x:d,y:l.y},end:h,labelBounds:i}),g=[...r.slice(0,s-1),a];if(Math.abs(a.y-m)>=0.000000001)g.push({x:a.x,y:m});if(g.push({x:d,y:m}),g.push({x:d,y:A}),Math.abs(h.y-A)>=0.000000001)g.push({x:h.x,y:A});return g.push(h,...r.slice(s+3)),vi(g)},v1n=({start:e,end:t,labelBounds:n})=>{if(!H9(e,t,n))return e.y;let o=(n.minY+n.maxY)/2;if(e.y>=o)return n.maxY+e3;return n.minY-e3},Eni=(e,t)=>{if(!t)return;for(let n of e)n.selected=n.path===t},e7n=({trace:e,tracePath:t,obstacleLabel:n,outputTraces:o,outputNetLabelPlacements:r,chipObstacles:i})=>{let s={...e,tracePath:t};return{labelIntersections:$0({traces:[s],netLabels:r}).length,labelHugDistance:Bni(t,n),traceIntersections:Mni(s,o),chipBoundaryOverlap:fni(t,i),pathLength:Zx(t)}},Mni=(e,t)=>{let n=0;for(let o of t){if(o.mspPairId===e.mspPairId)continue;n+=ZS(e.tracePath,o.tracePath)}return n},wni=(e,t)=>{let n=e.labelIntersections>0,o=t.labelIntersections>0;if(n!==o)return!n;if(e.chipBoundaryOverlap!==t.chipBoundaryOverlap)return e.chipBoundaryOverlap<t.chipBoundaryOverlap;if(e.labelIntersections!==t.labelIntersections)return e.labelIntersections<t.labelIntersections;if(e.labelHugDistance!==t.labelHugDistance)return e.labelHugDistance<t.labelHugDistance;if(e.traceIntersections!==t.traceIntersections)return e.traceIntersections<t.traceIntersections;return e.pathLength<t.pathLength},Bni=(e,t)=>{let n=zi(t.center,t.width,t.height),o=0;for(let r of e)o+=Tni(r,n);return o},Tni=(e,t)=>{let n=Math.max(t.minX-e.x,0,e.x-t.maxX),o=Math.max(t.minY-e.y,0,e.y-t.maxY);return n+o},Dni=(e)=>{let{trace:t,outputTraces:n}=e,o=0;for(let r of n){if(r.mspPairId===t.mspPairId)continue;if(r.globalConnNetId===t.globalConnNetId)continue;o+=ZS(t.tracePath,r.tracePath)}return o},S1n=(e)=>{let{traces:t,outputTraces:n,chipObstacles:o}=e,r=0,i=0;for(let s of t){if(Ani(s.tracePath,o))r+=1;i+=Dni({trace:s,outputTraces:n})}return{chipEdgeRuns:r,traceCrossings:i}},Nni="blue",t7n="red",Rni=(e)=>{let t=J0(e.inputProblem);if(Qni(t,e),kni(t,e),!e.solved)Lni(t,e.currentCandidateResults),Hni(t,e);return t},Qni=(e,t)=>{for(let n of t.outputTraces)e.lines.push({points:n.tracePath,strokeColor:"purple"})},kni=(e,t)=>{for(let n of t.outputNetLabelPlacements){let o=Ic(n.globalConnNetId,0.35);e.rects.push({center:n.center,width:n.width,height:n.height,fill:o,strokeColor:Ic(n.globalConnNetId,0.9),label:`netId: ${n.netId}
globalConnNetId: ${n.globalConnNetId}`}),e.points.push({...n.anchorPoint,color:Ic(n.globalConnNetId,0.9),label:`anchorPoint
orientation: ${n.orientation}`})}},Lni=(e,t)=>{for(let n of t){let o=n.score?`
label intersections: ${n.score.labelIntersections}
trace intersections: ${n.score.traceIntersections}`:"";e.lines.push({points:n.path,strokeColor:n.selected?Nni:t7n,strokeDash:n.selected?void 0:"4 2",label:`${n.selected?"selected":n.status} reroute${o}`})}},Hni=(e,t)=>{if(!t.currentOverlap)return;let n=t.currentOverlap.label;e.rects.push({center:n.center,width:n.width,height:n.height,fill:"rgba(255, 0, 0, 0.2)",strokeColor:t7n,label:`overlap target
${n.netId??n.globalConnNetId}`})},Fni=0.1,zni=10,P1n=0.1,Oni=(e,t)=>{if(!e)return!1;if(e.chipEdgeRuns!==t.chipEdgeRuns)return e.chipEdgeRuns<t.chipEdgeRuns;return e.traceCrossings<t.traceCrossings},Vni=class extends mu{inputProblem;traces;netLabelPlacements;outputTraces;outputNetLabelPlacements;queuedOverlaps=[];currentOverlap=null;currentCandidateResults=[];chipObstacles;pinMap;constructor(e){super();this.inputProblem=e.inputProblem,this.traces=e.traces,this.netLabelPlacements=e.netLabelPlacements,this.outputTraces=[...e.traces],this.outputNetLabelPlacements=[...e.netLabelPlacements],this.chipObstacles=wy(e.inputProblem),this.pinMap=Cat(e.inputProblem),this.initializeQueuedOverlaps(),this.currentOverlap=this.queuedOverlaps[0]??null}getConstructorParams(){return{inputProblem:this.inputProblem,traces:this.traces,netLabelPlacements:this.netLabelPlacements}}_step(){let e=this.queuedOverlaps.shift();if(!e){this.finish();return}if(!this.isOverlapStillPresent(e)){this.currentOverlap=e,this.currentCandidateResults=[];return}this.rerouteOverlappingTrace(e)}finish(){this.currentOverlap=null,this.currentCandidateResults=[],this.solved=!0}initializeQueuedOverlaps(){let e=[],t=new Set;for(let n of this.getTraceLabelOverlaps()){if(!this.shouldRerouteOverlap(n))continue;let o=this.getOverlapKey(n);if(t.has(o))continue;t.add(o),e.push(n)}this.queuedOverlaps=e}getTraceLabelOverlaps(){return $0({traces:this.outputTraces,netLabels:this.outputNetLabelPlacements})}shouldRerouteOverlap(e){return this.isXFacingLabel(e.label)&&!this.hasExplicitOrientationConstraint(e.label)}isXFacingLabel(e){return e.orientation==="x+"||e.orientation==="x-"}hasExplicitOrientationConstraint(e){let t=e.netId??e.globalConnNetId;return Object.hasOwn(this.inputProblem.availableNetLabelOrientations,t)}getOverlapKey(e){let t=e.label.netId??e.label.globalConnNetId;return`${e.trace.mspPairId}:${t}:${e.label.anchorPoint.x}:${e.label.anchorPoint.y}`}isOverlapStillPresent(e){let t=this.getCurrentTrace(e.trace);if(!t)return!1;return $0({traces:[t],netLabels:[e.label]}).length>0}getCurrentTrace(e){return this.outputTraces.find((t)=>t.mspPairId===e.mspPairId)}rerouteOverlappingTrace(e){this.currentOverlap=e,this.currentCandidateResults=[];let t=this.outputTraces.findIndex((a)=>a.mspPairId===e.trace.mspPairId);if(t===-1)return;let n=this.outputTraces[t],o=this.tryMoveLabelOutward(e.label),r=Cni({trace:n,obstacleLabel:e.label,inputProblem:this.inputProblem,outputTraces:this.outputTraces,outputNetLabelPlacements:this.outputNetLabelPlacements,chipObstacles:this.chipObstacles});this.currentCandidateResults=r.candidateResults;let i=null;if(r.bestPath)i=S1n({traces:[{...n,tracePath:r.bestPath}],outputTraces:this.outputTraces,chipObstacles:this.chipObstacles});if(o){let a=S1n({traces:[o.connectorTrace,n],outputTraces:this.outputTraces,chipObstacles:this.chipObstacles});if(!Oni(i,a)){this.outputNetLabelPlacements[o.labelIndex]=o.movedLabel,this.outputTraces.push(o.connectorTrace);return}}if(!r.bestPath)return;let s=n.tracePath;this.outputTraces[t]={...n,tracePath:r.bestPath},this.outputNetLabelPlacements=RZ({trace:n,originalTracePath:s,reroutedTracePath:r.bestPath,netLabelPlacements:this.outputNetLabelPlacements})}tryMoveLabelOutward(e){let t=this.outputNetLabelPlacements.findIndex((r)=>r.globalConnNetId===e.globalConnNetId&&r.anchorPoint.x===e.anchorPoint.x&&r.anchorPoint.y===e.anchorPoint.y&&r.pinIds.join(",")===e.pinIds.join(","));if(t===-1)return null;let n=this.outputNetLabelPlacements[t];if(n.mspConnectionPairIds.length>0)return null;if(n.pinIds.length!==1)return null;if(this.outputNetLabelPlacements.filter((r)=>r.globalConnNetId===n.globalConnNetId).length!==1)return null;let o=j0(n.orientation);if(o.x===0&&o.y===0)return null;for(let r=1;r<=zni;r++){let i=r*Fni,s={...n,anchorPoint:{x:n.anchorPoint.x+o.x*i,y:n.anchorPoint.y+o.y*i},center:{x:n.center.x+o.x*i,y:n.center.y+o.y*i}},a={...s,width:s.width+P1n*2,height:s.height+P1n*2};if($0({traces:this.outputTraces,netLabels:[a]}).length>0)continue;let c=Gni({label:n,movedLabel:s,pinMap:this.pinMap});if($0({traces:[c],netLabels:this.outputNetLabelPlacements}).length>0)continue;return{labelIndex:t,movedLabel:s,connectorTrace:c}}return null}visualize(){return Rni({inputProblem:this.inputProblem,outputTraces:this.outputTraces,outputNetLabelPlacements:this.outputNetLabelPlacements,solved:this.solved,currentOverlap:this.currentOverlap,currentCandidateResults:this.currentCandidateResults})}},Yni=(e)=>`port-only-label-connector-${e.globalConnNetId}-${e.pinIds[0]}`,Gni=({label:e,movedLabel:t,pinMap:n})=>{let o=Yni(e);return{mspPairId:o,dcConnNetId:e.dcConnNetId??e.globalConnNetId,globalConnNetId:e.globalConnNetId,userNetId:e.netId,pins:bat(e,n),tracePath:[e.anchorPoint,t.anchorPoint],mspConnectionPairIds:[o],pinIds:e.pinIds}},E1n=(e)=>e.mspConnectionPairIds.length===0,Uni=({labelIndices:e,netLabelPlacements:t})=>{let n=[...e];for(let o of e){let r=t[o];if(E1n(r))continue;let i=zi(r.center,r.width,r.height),s=n.findIndex((c)=>{let l=t[c];if(!E1n(l))return!1;if(l.globalConnNetId===r.globalConnNetId)return!1;let h=zi(l.center,l.width,l.height);return rde(i,h)}),a=n.indexOf(o);if(s===-1||s>a)continue;n.splice(a,1),n.splice(s,0,o)}return n},Wni=(e)=>{let t=J0(e.inputProblem);return qni(t),Xni(t,e.traces),jni(t,e.outputNetLabelPlacements),Kni(t,e.currentLabel,e.solved),$ni(t,e.currentCandidateResults,e.solved),t},Xni=(e,t)=>{for(let n of t)e.lines.push({points:n.tracePath,strokeColor:"purple"})},jni=(e,t)=>{for(let n of t)e.rects.push({center:n.center,width:n.width,height:n.height,fill:Ic(n.globalConnNetId,0.35),strokeColor:Ic(n.globalConnNetId,0.9),label:`netId: ${n.netId}
globalConnNetId: ${n.globalConnNetId}`}),e.points.push({x:n.anchorPoint.x,y:n.anchorPoint.y,color:Ic(n.globalConnNetId,0.9),label:`anchorPoint
orientation: ${n.orientation}`})},Kni=(e,t,n)=>{if(!t||n)return;e.rects.push({center:t.center,width:t.width,height:t.height,fill:"rgba(255, 0, 0, 0.2)",strokeColor:F8n,label:`available orientation target
${t.netId??t.globalConnNetId}`})},$ni=(e,t,n)=>{if(n)return;for(let o of t){let r=o.selected?Iti:F8n,i=o.distance===void 0?"":`
distance: ${o.distance.toFixed(3)}`,s=o.outwardDistance===void 0||o.outwardDistance===0?"":`
outward distance: ${o.outwardDistance.toFixed(3)}`;e.rects.push({center:o.center,width:o.width,height:o.height,fill:o.selected?"rgba(0, 0, 255, 0.2)":"rgba(255, 0, 0, 0.15)",strokeColor:r,strokeDash:o.selected?void 0:"4 2",label:`${o.selected?"selected":o.status} available orientation
phase: ${o.phase}
orientation: ${o.orientation}${i}${s}`}),e.points.push({x:o.anchorPoint.x,y:o.anchorPoint.y,color:r,label:`candidate anchor
${o.phase}
${o.orientation}`})}},qni=(e)=>{if(!e.lines)e.lines=[];if(!e.points)e.points=[];if(!e.rects)e.rects=[];if(!e.circles)e.circles=[];if(!e.texts)e.texts=[]},Jni=class{chipObstacleSpatialIndex;labelIndex=null;traceSegmentIndex=null;traceSegments=[];constructor(e){this.chipObstacleSpatialIndex=e.chipObstacleSpatialIndex,this.rebuild(e)}rebuild(e){this.labelIndex=this.buildLabelIndex(e.netLabelPlacements),this.traceSegments=this.getTraceSegments(e.traces),this.traceSegmentIndex=this.buildTraceSegmentIndex(this.traceSegments)}getLabelIndicesInBounds(e){if(!this.labelIndex)return[];return this.labelIndex.search(e.minX,e.minY,e.maxX,e.maxY)}getTraceSegmentsInBounds(e){if(!this.traceSegmentIndex)return[];let t=Cnt(e,Tr);return this.traceSegmentIndex.search(t.minX,t.minY,t.maxX,t.maxY).map((n)=>this.traceSegments[n])}getLabelIndicesNearTracePath(e){let t=new Set;for(let n=0;n<e.length-1;n++){let o=Cnt(M1n(e[n],e[n+1]),Tr);for(let r of this.getLabelIndicesInBounds(o))t.add(r)}return[...t].sort((n,o)=>n-o)}doesTracePathCrossChip(e){for(let t=0;t<e.length-1;t++){let n=e[t],o=e[t+1],r=this.chipObstacleSpatialIndex.getChipsInBounds(Cnt(M1n(n,o),Tr));for(let i of r)if(hue(n,o,i.bounds))return!0}return!1}doesTraceCrossBoundsInterior(e){for(let t of this.getTraceSegmentsInBounds(e))if(hue(t.start,t.end,e))return!0;return!1}doesTraceIntersectBounds(e){for(let t of this.getTraceSegmentsInBounds(e.bounds)){if(t.trace.globalConnNetId===e.excludedGlobalConnNetId)continue;if(H9(t.start,t.end,e.bounds))return!0}return!1}buildLabelIndex(e){if(e.length===0)return null;let t=new Hrt(e.length);for(let n of e)t.add(n.center.x-n.width/2,n.center.y-n.height/2,n.center.x+n.width/2,n.center.y+n.height/2);return t.finish(),t}getTraceSegments(e){let t=[];for(let n of e)for(let o=0;o<n.tracePath.length-1;o++)t.push({trace:n,start:n.tracePath[o],end:n.tracePath[o+1]});return t}buildTraceSegmentIndex(e){if(e.length===0)return null;let t=new Hrt(e.length);for(let n of e)t.add(Math.min(n.start.x,n.end.x),Math.min(n.start.y,n.end.y),Math.max(n.start.x,n.end.x),Math.max(n.start.y,n.end.y));return t.finish(),t}};function M1n(e,t){return{minX:Math.min(e.x,t.x),minY:Math.min(e.y,t.y),maxX:Math.max(e.x,t.x),maxY:Math.max(e.y,t.y)}}function Cnt(e,t){return{minX:e.minX-t,minY:e.minY-t,maxX:e.maxX+t,maxY:e.maxY+t}}var Ohe=0.1,Zni=0.2,w1n=0.1,eoi=class extends mu{inputProblem;traces;netLabelPlacements;netLabelConnectorTraceIds=new Set;outputNetLabelPlacements;queuedLabelIndices=[];currentLabelIndex=null;currentLabel=null;currentCandidateResults=[];crowdedPortOnlyLabelIndices=new Set;blockedStandaloneLabelIndex=null;blockedStandaloneLabelTargetAnchorX=null;traceMap;chipObstacleSpatialIndex;maxSearchDistance;pinMap;obstacleIndex;constructor(e){super();this.inputProblem=e.inputProblem,this.traces=[...e.traces],this.netLabelPlacements=e.netLabelPlacements,this.outputNetLabelPlacements=[...e.netLabelPlacements],this.traceMap=Object.fromEntries(this.traces.map((t)=>[t.mspPairId,t])),this.pinMap=Cat(e.inputProblem),this.chipObstacleSpatialIndex=e.inputProblem._chipObstacleSpatialIndex??new O7e(e.inputProblem.chips),this.maxSearchDistance=z8n(e.inputProblem),this.obstacleIndex=new Jni({chipObstacleSpatialIndex:this.chipObstacleSpatialIndex,netLabelPlacements:this.outputNetLabelPlacements,traces:this.traces}),this.crowdedPortOnlyLabelIndices=this.getCrowdedPortOnlyLabelIndices(),this.queuedLabelIndices=this.getProcessableLabelIndices(),this.setCurrentLabel(this.queuedLabelIndices[0]??null)}getConstructorParams(){return{inputProblem:this.inputProblem,traces:this.traces,netLabelPlacements:this.netLabelPlacements}}_step(){let e=this.queuedLabelIndices.shift();if(e===void 0){this.finish();return}this.processLabel(e)}getOutput(){return{traces:this.traces,netLabelPlacements:this.outputNetLabelPlacements,netLabelConnectorTraceIds:this.netLabelConnectorTraceIds}}getProcessableLabelIndices(){let e=[];for(let h=0;h<this.outputNetLabelPlacements.length;h++)if(this.shouldProcessLabel(this.outputNetLabelPlacements[h],h))e.push(h);this.sortCrowdedTopBankByPin(e);let t=Uni({labelIndices:e,netLabelPlacements:this.outputNetLabelPlacements}),n=t.find((h)=>{let d=this.outputNetLabelPlacements[h],u=this.getAvailableOrientations(d);return this.isPortOnlyLabel(d)&&this.isStandaloneSinglePinNetLabel(d)&&u.length===1&&Rd(u[0])&&this.labelIntersectsDifferentNetTrace(d)});if(n===void 0)return t;this.blockedStandaloneLabelIndex=n,this.blockedStandaloneLabelTargetAnchorX=null;let o=this.outputNetLabelPlacements[n],r=this.getAvailableOrientations(o)[0],i=this.getChipSideForPoint(o.anchorPoint),s=[],a=[];for(let h=0;h<t.length;h++){let d=t[h],u=this.outputNetLabelPlacements[d],_=this.getAvailableOrientations(u);if(this.getChipSideForPoint(u.anchorPoint)===i&&_.length===1&&_[0]===r)s.push(h),a.push(d)}a.sort((h,d)=>{let u=this.outputNetLabelPlacements[h].anchorPoint.y,_=this.outputNetLabelPlacements[d].anchorPoint.y;return r==="y+"?_-u:u-_});let c=PS({inputProblem:this.inputProblem,netId:o.netId,pinIds:o.pinIds,isPortOnlyLabel:this.isPortOnlyLabel(o)}),l;if(c!==void 0)l=a.find((h)=>{if(h===n)return!1;let d=this.outputNetLabelPlacements[h];return PS({inputProblem:this.inputProblem,netId:d.netId,pinIds:d.pinIds,isPortOnlyLabel:this.isPortOnlyLabel(d)})===c});if(l!==void 0){let h=this.outputNetLabelPlacements[l];this.blockedStandaloneLabelTargetAnchorX=this.getSearchStartAnchor(h,r).x}for(let h=0;h<s.length;h++)t[s[h]]=a[h];return t}sortCrowdedTopBankByPin(e){let t=new Map;for(let n=0;n<e.length;n++){let o=e[n];if(!this.crowdedPortOnlyLabelIndices.has(o))continue;let r=this.outputNetLabelPlacements[o];if(this.getChipSideForPoint(r.anchorPoint)!=="top")continue;let i=this.pinMap[r.pinIds[0]];if(!i)continue;let s=t.get(i.chipId)??[];s.push(n),t.set(i.chipId,s)}for(let n of t.values()){let o=n.map((r)=>e[r]).sort((r,i)=>{let s=this.pinMap[this.outputNetLabelPlacements[r].pinIds[0]],a=this.pinMap[this.outputNetLabelPlacements[i].pinIds[0]];return s.x-a.x});for(let r=0;r<n.length;r++)e[n[r]]=o[r]}}shouldProcessLabel(e,t){let n=this.getAvailableOrientations(e);if(n.length===0)return!1;if(!n.includes(e.orientation))return!0;if(this.getTextBlockedMultiPinRailTraces(e,n[0]))return!0;if(n.length===1&&Rd(n[0])&&this.isGroundLabel(e)){let i=zi(e.center,e.width,e.height);if(this.outputNetLabelPlacements.some((a,c)=>{if(c===t)return!1;if(a.globalConnNetId===e.globalConnNetId)return!1;let l=this.getHorizontalConstraintMismatchBounds(a);return l?rde(i,l):!1}))return!0}if(!this.crowdedPortOnlyLabelIndices.has(t))return!1;let r=zi(e.center,e.width,e.height);return this.outputNetLabelPlacements.some((i,s)=>{if(s===t)return!1;if(i.globalConnNetId===e.globalConnNetId)return!1;return rde(r,zi(i.center,i.width,i.height))})}getCrowdedPortOnlyLabelIndices(){let e=new Map;for(let n=0;n<this.outputNetLabelPlacements.length;n++){let o=this.outputNetLabelPlacements[n];if(!this.isPortOnlyLabel(o))continue;if(!this.isStandaloneSinglePinNetLabel(o))continue;if(this.getAvailableOrientations(o).length===0)continue;let r=this.pinMap[o.pinIds[0]];if(!r)continue;let i=this.getChipSideForPoint(o.anchorPoint);if(!i)continue;let s=e.get(r.chipId)??new Map,a=s.get(i)??[];a.push(n),s.set(i,a),e.set(r.chipId,s)}let t=new Set;for(let n of e.values())for(let o of n.values()){let r=o.some((s)=>{let a=this.outputNetLabelPlacements[s];return!this.getAvailableOrientations(a).includes(a.orientation)}),i=o.some((s,a)=>{let c=this.outputNetLabelPlacements[s],l=zi(c.center,c.width,c.height);return o.slice(a+1).some((h)=>{let d=this.outputNetLabelPlacements[h];return rde(l,zi(d.center,d.width,d.height))})});if(!r||!i)continue;for(let s of o)t.add(s)}return t}processLabel(e){let t=this.outputNetLabelPlacements[e];this.setCurrentLabel(e),this.currentCandidateResults=[];let n=this.findCorrectedCandidate(t,e);if(!n)return;this.applyCandidate(t,n,e)}applyCandidate(e,t,n){this.outputNetLabelPlacements[n]={...e,..._ni(t)},this.addConnectorTrace(e,t,n),this.obstacleIndex.rebuild({netLabelPlacements:this.outputNetLabelPlacements,traces:this.traces})}addConnectorTrace(e,t,n){if(t.phase==="trace-anchor")return;if(t.phase==="downward-ground-rail-extension")for(let s of e.mspConnectionPairIds){let a=this.traceMap[s];if(!a)continue;let c=mni({tracePath:a.tracePath,sourcePoint:e.anchorPoint,extensionEndPoint:t.anchorPoint});if(!c)continue;a.tracePath=c;return}let o=this.getCandidateConnectorTrace(e,t,n);if(o.length<2)return;let r=`available-net-orientation-${n}-${e.netId??e.globalConnNetId}`,i={mspPairId:r,dcConnNetId:e.dcConnNetId??e.globalConnNetId,globalConnNetId:e.globalConnNetId,userNetId:e.netId,pins:bat(e,this.pinMap),tracePath:o,mspConnectionPairIds:[r],pinIds:e.pinIds};this.traces.push(i),this.traceMap[r]=i,this.netLabelConnectorTraceIds.add(r)}finish(){this.currentLabelIndex=null,this.currentLabel=null,this.currentCandidateResults=[],this.solved=!0}setCurrentLabel(e){this.currentLabelIndex=e,this.currentLabel=e===null?null:this.outputNetLabelPlacements[e]}findCorrectedCandidate(e,t){let n=this.getAvailableOrientations(e),o=n[0];if(this.crowdedPortOnlyLabelIndices.has(t)&&this.getChipSideForPoint(e.anchorPoint)==="top"&&Rd(o)){let p=this.findValidCrowdedTopVerticalFanoutCandidate(e,t,o);if(p)return p}let r=this.inputProblem.netConnections.find((p)=>p.netId===e.netId),i=r?.pinIds.length===2,s=r?.isGround&&yJ(e.orientation)&&n.length===1&&o==="y-"&&this.hasTraceContinuingInOrientation(e,"y+"),a=(r?.pinIds.length??0)>2&&Rd(o)&&this.hasPortOnlyLabelOnSameNet(e),c=this.getTextBlockedMultiPinRailTraces(e,o),l=Rd(o)&&this.hasOppositeVerticalRailOnSameChipSide(e,o);if(c){let p=this.findValidNearbyRailCandidate(e,o,t,c);if(p)return p}if(n.length===1&&Rd(o)&&this.isOutwardHorizontalFallback(e)&&this.hasTraceContinuingInOrientation(e,o)&&(a||l)){let p=this.findValidTraceAnchorCandidate(e,o,t);if(p){if(this.canPlaceVerticalLabelOnHostRail(p,e))return p;p.selected=!1}let m=this.findValidOutwardTraceAnchorCandidate(e,o,t);if(m)return m}if(i&&n.length===1&&Rd(o)&&this.hasTraceContinuingInOrientation(e,o)){let p=this.findValidCandidateInShiftColumn({label:e,labelIndex:t,orientation:o,direction:j0(o),baseAnchor:this.getWickOffsetAnchor(e.anchorPoint,o),maxSearchDistance:this.maxSearchDistance,outwardDistance:0,stopOnTraceCollision:!1});if(p)return p}let h=this.findValidRotatedCandidate(e,t,n),d=h!==null&&Math.abs(h.anchorPoint.x-e.anchorPoint.x)>Tr;if(s&&d){let p=this.findValidCandidateInShiftColumn({label:e,labelIndex:t,orientation:o,direction:j0(o),baseAnchor:e.anchorPoint,maxSearchDistance:this.getSearchDistanceLimit(e,o),outwardDistance:0,phase:"downward-ground-rail-extension",stopOnTraceCollision:!1,connectorSource:e.anchorPoint,startDistance:Zni});if(p)return p}if(h)return h;let u=this.findValidTraceAnchorCandidate(e,n[0],t);if(u)return u;let _=this.findValidShiftedCandidate(e,n[0],t);if(_)return _;return this.findValidLateralShiftedCandidate(e,n[0],t)}findValidCrowdedTopVerticalFanoutCandidate(e,t,n){let o=this.pinMap[e.pinIds[0]],r=o?this.chipObstacleSpatialIndex.chips.find((A)=>A.chipId===o.chipId):void 0;if(!r)return null;let{width:i,height:s}=S9({orientation:n,netLabelWidth:PS({inputProblem:this.inputProblem,netId:e.netId,pinIds:e.pinIds,isPortOnlyLabel:this.isPortOnlyLabel(e)}),netLabelHeight:this.getNetLabelHeight(e)}),a=this.outputNetLabelPlacements.map((A,g)=>({index:g,pin:this.pinMap[A.pinIds[0]]})).filter(({index:A,pin:g})=>this.crowdedPortOnlyLabelIndices.has(A)&&g?.chipId===o.chipId&&g.x>o.x+Tr).sort((A,g)=>A.pin.x-g.pin.x)[0]?.pin;if(n==="y-"&&a)return null;let c=n==="y-"?Math.max(e.anchorPoint.x+xm,r.bounds.maxX+i/2+Ohe):Math.min(e.anchorPoint.x,(a?.x??r.bounds.maxX)-xm-i/2),l=r.bounds.maxY,{POSITIVE_INFINITY:h,NEGATIVE_INFINITY:d}=Number;for(let A=0;A<this.outputNetLabelPlacements.length;A++){if(A===t)continue;if(!this.crowdedPortOnlyLabelIndices.has(A))continue;if(this.queuedLabelIndices.includes(A))continue;let g=this.outputNetLabelPlacements[A],f=zi(g.center,g.width,g.height);if(l=Math.max(l,f.maxY),g.orientation!=="y+")continue;h=Math.min(h,f.minY),d=Math.max(d,f.maxY)}let u=l+xm+(n==="y-"?s:0),p=Number.isFinite(h)&&Number.isFinite(d)?(h+d)/2:u,m=n==="y-"?[p,u]:[u];for(let A of m){if(A-e.anchorPoint.y>this.maxSearchDistance+Tr)continue;let g=this.createCandidate(e,{x:c,y:A},n),f=this.evaluateCandidate(g,e,t,"lateral-shift",A-e.anchorPoint.y,c-e.anchorPoint.x);if(this.recordCandidateResult(f),f.status!=="valid")continue;return f.selected=!0,f}return null}hasTraceContinuingInOrientation(e,t){let n=j0(t);return Object.values(this.traceMap).some((o)=>{if(o.globalConnNetId!==e.globalConnNetId)return!1;let r=o.tracePath;return r.some((i,s)=>{if(Math.abs(i.x-e.anchorPoint.x)>Tr||Math.abs(i.y-e.anchorPoint.y)>Tr)return!1;return[r[s-1],r[s+1]].some((a)=>a&&Math.abs(a.x-i.x)<=Tr&&(a.y-i.y)*n.y>Tr)})})}findValidRotatedCandidate(e,t,n){for(let o of n){let r=this.createCandidate(e,this.getSearchStartAnchor(e,o),o),i=this.evaluateCandidate(r,e,t,"rotate");if(this.recordCandidateResult(i),i.status==="valid")return i.selected=!0,i}return null}findValidTraceAnchorCandidate(e,t,n){let o=j0(t),{points:r}=this.getTraceAnchorCandidates(e,t),i=r.sort((s,a)=>{let c=s.x*o.x+s.y*o.y;return a.x*o.x+a.y*o.y-c});for(let s of i){let a=this.createCandidate(e,s,t),c=this.evaluateCandidate(a,e,n,"trace-anchor");if(this.recordCandidateResult(c),c.status==="valid")return c.selected=!0,c}return null}findValidOutwardTraceAnchorCandidate(e,t,n){let o=j0(t),r=this.getSearchStartAnchor(e,t),{points:i,preferNearestBendOnOutwardRow:s}=this.getTraceAnchorCandidates(e,t),a=i.sort((c,l)=>{let h=c.x*o.x+c.y*o.y,d=l.x*o.x+l.y*o.y;if(!s)return d-h;let u=Rd(t)?Math.abs(c.x-r.x):Math.abs(c.y-r.y),_=Rd(t)?Math.abs(l.x-r.x):Math.abs(l.y-r.y);return d-h||u-_});for(let c of a){let l=this.createCandidate(e,{x:r.x,y:c.y},t,c),h=this.evaluateCandidate(l,e,n,"outward-trace-anchor");if(this.recordCandidateResult(h),h.status==="valid")return h.selected=!0,h;let d=this.getPerpendicularOutwardDirection(c,t);if(d.x===0&&d.y===0)continue;for(let u=xm;u<=this.maxSearchDistance+Tr;u+=xm){let _={x:c.x+d.x*u,y:c.y+d.y*u},p=this.createCandidate(e,_,t,c),m=this.evaluateCandidate(p,e,n,"outward-trace-anchor",u);if(this.recordCandidateResult(m),m.status==="valid")return m.selected=!0,m}}return null}getTraceAnchorCandidates(e,t){let n=new Set,o=[],r=new Set(e.mspConnectionPairIds??[]),i=new Set(r);if(Rd(t)){let d=new Set;for(let _ of i)for(let p of this.traceMap[_]?.pinIds??[])d.add(p);let u=!0;while(u){u=!1;for(let _ of Object.values(this.traceMap)){if(i.has(_.mspPairId))continue;if(this.netLabelConnectorTraceIds.has(_.mspPairId))continue;if(_.globalConnNetId!==e.globalConnNetId)continue;if(!_.pinIds.some((m)=>d.has(m)))continue;let p=[...i].flatMap((m)=>{let A=this.traceMap[m];return A?[A]:[]});if(!this.sharesVerticalRailWithAny(_,p))continue;i.add(_.mspPairId);for(let m of _.pinIds)d.add(m);u=!0}}}for(let d of i){let u=this.traceMap[d];if(!u)continue;for(let _ of u.tracePath){let p=`${_.x.toFixed(9)},${_.y.toFixed(9)}`;if(n.has(p))continue;n.add(p),o.push(_)}}let s=j0(t),a=Math.max(...o.map((d)=>d.x*s.x+d.y*s.y)),c=o.filter((d)=>Math.abs(d.x*s.x+d.y*s.y-a)<=Tr),l=new Set([...r].flatMap((d)=>this.traceMap[d]?.pinIds??[])),h=[...i].flatMap((d)=>{if(r.has(d))return[];let u=this.traceMap[d];if(!u?.pinIds.some((_)=>l.has(_)))return[];return[u]});return{points:o,preferNearestBendOnOutwardRow:h.some((d)=>c.some((u)=>d.tracePath.some((_)=>Math.abs(_.x-u.x)<=Tr&&Math.abs(_.y-u.y)<=Tr)))}}sharesVerticalRailWithAny(e,t){let n=new Set;for(let o of t)for(let r=0;r<o.tracePath.length-1;r++){let i=o.tracePath[r],s=o.tracePath[r+1];if(Math.abs(i.x-s.x)<=Tr&&Math.abs(i.y-s.y)>Tr)n.add(i.x)}for(let o=0;o<e.tracePath.length-1;o++){let r=e.tracePath[o],i=e.tracePath[o+1];if(Math.abs(r.x-i.x)<=Tr&&Math.abs(r.y-i.y)>Tr&&[...n].some((s)=>Math.abs(s-r.x)<=Tr))return!0}return!1}getAvailableOrientations(e){let t=e.netId??e.globalConnNetId;return this.inputProblem.availableNetLabelOrientations[t]??[]}findValidShiftedCandidate(e,t,n){let o=j0(t),r=this.getSearchStartAnchor(e,t),i=this.getPerpendicularOutwardDirection(e.anchorPoint,t),s=this.getSearchDistanceLimit(e,t),a=i.x===0&&i.y===0?0:this.maxSearchDistance;for(let c=0;c<=a+Tr;c+=xm){let l={x:r.x+i.x*c,y:r.y+i.y*c},h=this.findValidCandidateInShiftColumn({label:e,labelIndex:n,orientation:t,direction:o,baseAnchor:l,maxSearchDistance:s,outwardDistance:c});if(h)return h}return null}findValidLateralShiftedCandidate(e,t,n){let o=j0(t),r=this.getSearchStartAnchor(e,t),i={x:Rd(t)?1:0,y:yJ(t)?1:0},s=Math.ceil(this.maxSearchDistance/xm);for(let a=1;a<=s;a++)for(let c of[-1,1]){let l=c*a*xm,h={x:r.x+i.x*l,y:r.y+i.y*l},d=this.getLateralColumnMaxDistance(e,t,h),u=this.findValidCandidateInShiftColumn({label:e,labelIndex:n,orientation:t,direction:o,baseAnchor:h,maxSearchDistance:d,outwardDistance:l,phase:"lateral-shift"});if(u)return u}return null}findValidCandidateInShiftColumn(e){let{label:t,labelIndex:n,orientation:o,direction:r,baseAnchor:i,maxSearchDistance:s,outwardDistance:a,phase:c="shift",stopOnTraceCollision:l=!0,connectorSource:h,startDistance:d=xm}=e;for(let u=d;u<=s+Tr;u+=xm){let _={x:i.x+r.x*u,y:i.y+r.y*u},p=h??(c==="lateral-shift"?this.findProjectedConnectorSourceOnHostTrace(t,_,o):void 0),m=this.createCandidate(t,_,o,p),A=this.evaluateCandidate(m,t,n,c,u,a);if(this.recordCandidateResult(A),A.status==="valid")return A.selected=!0,A;if(l&&A.status==="trace-collision"&&(!p||o!=="y-"||!this.isGroundLabel(t)))break}return null}evaluateCandidate(e,t,n,o,r,i){return{...e,phase:o,distance:r,outwardDistance:i,selected:!1,status:this.getCandidateStatus({candidate:e,label:t,labelIndex:n,phase:o})}}recordCandidateResult(e){if(this.stats.candidateEvaluations=(this.stats.candidateEvaluations??0)+1,this.currentCandidateResults.length<h1n)this.currentCandidateResults.push(e);else if(e.status==="valid")this.currentCandidateResults[h1n-1]=e;this.stats.maxRecordedCandidates=Math.max(this.stats.maxRecordedCandidates??0,this.currentCandidateResults.length)}getCandidateConnectorTrace(e,t,n){if(this.crowdedPortOnlyLabelIndices.has(n)&&this.getChipSideForPoint(e.anchorPoint)==="top"&&Rd(t.orientation))return zrt([e.anchorPoint,{x:e.anchorPoint.x,y:t.anchorPoint.y},t.anchorPoint]);if(t.connectorSource)return ynt(t.connectorSource,t.anchorPoint,t.orientation);if(t.phase==="lateral-shift"){let o=this.crowdedPortOnlyLabelIndices.has(n)?this.getChipOutwardDirection(e.anchorPoint):(()=>{let i=j0(t.orientation);return{x:-i.x,y:-i.y}})(),r={x:e.anchorPoint.x+o.x*xm,y:e.anchorPoint.y+o.y*xm};return zrt([e.anchorPoint,...ynt(r,t.anchorPoint,t.orientation)])}return ynt(e.anchorPoint,t.anchorPoint,t.orientation)}findProjectedConnectorSourceOnHostTrace(e,t,n){let o=j0(n),r=[];for(let i of e.mspConnectionPairIds){let s=this.traceMap[i];if(!s)continue;for(let a=0;a<s.tracePath.length-1;a++){let c=s.tracePath[a],l=s.tracePath[a+1];if(!(Rd(n)?Math.abs(c.y-l.y)<=Tr:Math.abs(c.x-l.x)<=Tr))continue;let d=Rd(n)?{x:t.x,y:c.y}:{x:c.x,y:t.y};if(!Ts([c,l],e.anchorPoint)||!Ts([c,l],d))continue;if((t.x-d.x)*o.x+(t.y-d.y)*o.y>=-Tr)r.push(d)}}return r.sort((i,s)=>Math.abs(i.x-t.x)+Math.abs(i.y-t.y)-(Math.abs(s.x-t.x)+Math.abs(s.y-t.y)))[0]}isStandaloneSinglePinNetLabel(e){return this.inputProblem.netConnections.some((t)=>t.netId===e.netId&&t.pinIds.length===1&&t.pinIds[0]===e.pinIds[0])}labelIntersectsDifferentNetTrace(e){let{width:t,height:n}=S9({orientation:e.orientation,netLabelWidth:PS({inputProblem:this.inputProblem,netId:e.netId,pinIds:e.pinIds,isPortOnlyLabel:this.isPortOnlyLabel(e)}),netLabelHeight:this.getNetLabelHeight(e)}),o=kf(e.anchorPoint,e.orientation,t,n),r=zi(o,t,n);return Object.values(this.traceMap).some((i)=>i.globalConnNetId!==e.globalConnNetId&&fnt(i.tracePath,r))}getSearchStartAnchor(e,t){let n=this.getWickOffsetAnchor(e.anchorPoint,t),{width:o,height:r}=S9({orientation:t,netLabelWidth:PS({inputProblem:this.inputProblem,netId:e.netId,pinIds:e.pinIds,isPortOnlyLabel:this.isPortOnlyLabel(e)}),netLabelHeight:this.getNetLabelHeight(e)}),i=this.getSideOffsetAnchor({anchorPoint:n,labelAnchorPoint:e.anchorPoint,orientation:t,width:o,height:r});if(this.blockedStandaloneLabelIndex!==null&&e===this.outputNetLabelPlacements[this.blockedStandaloneLabelIndex]&&Rd(t)&&this.blockedStandaloneLabelTargetAnchorX!==null)i.x=this.blockedStandaloneLabelTargetAnchorX;return i}getWickOffsetAnchor(e,t){let n=j0(t);return{x:e.x+n.x*j4,y:e.y+n.y*j4}}getSideOffsetAnchor(e){let{anchorPoint:t,labelAnchorPoint:n,orientation:o,width:r,height:i}=e,s=this.getChipSideForPoint(n),a=this.getContainingChipSide(n)?j4:xm;if(Rd(o)&&s==="left")return{x:t.x-r/2-a,y:t.y};if(Rd(o)&&s==="right")return{x:t.x+r/2+a,y:t.y};if(yJ(o)&&s==="bottom")return{x:t.x,y:t.y-i/2-a};if(yJ(o)&&s==="top")return{x:t.x,y:t.y+i/2+a};return t}getSearchDistanceLimit(e,t){let{width:n,height:o}=S9({orientation:t,netLabelWidth:PS({inputProblem:this.inputProblem,netId:e.netId,pinIds:e.pinIds,isPortOnlyLabel:this.isPortOnlyLabel(e)}),netLabelHeight:this.getNetLabelHeight(e)}),r=t==="y+"||t==="y-"?o:n;return Math.min(this.maxSearchDistance,r*2)}getLateralColumnMaxDistance(e,t,n){let o=this.getAvailableOrientations(e),r=o.length===1&&Rd(o[0]),i=new Set(e.pinIds.map((h)=>this.pinMap[h]?.chipId).filter((h)=>Boolean(h))),s=this.chipObstacleSpatialIndex.chips.filter((h)=>i.has(h.chipId)),a=e.pinIds.map((h)=>this.pinMap[h]?.chipId).find(Boolean),c=s.find((h)=>h.chipId===a),l=r?s:c?[c]:[];if(l.length>0){if(t==="y-")return Math.max(0,...l.map((h)=>n.y-h.bounds.minY));if(t==="y+")return Math.max(0,...l.map((h)=>h.bounds.maxY-n.y));if(t==="x-")return Math.max(0,...l.map((h)=>n.x-h.bounds.minX));if(t==="x+")return Math.max(0,...l.map((h)=>h.bounds.maxX-n.x))}return this.getSearchDistanceLimit(e,t)}createCandidate(e,t,n,o){let{width:r,height:i}=S9({orientation:n,netLabelWidth:PS({inputProblem:this.inputProblem,netId:e.netId,pinIds:e.pinIds,isPortOnlyLabel:this.isPortOnlyLabel(e)}),netLabelHeight:this.getNetLabelHeight(e)});return{orientation:n,anchorPoint:t,connectorSource:o,width:r,height:i,center:kf(t,n,r,i)}}getNetLabelHeight(e){if(e.netId){let t=this.inputProblem.netConnections.find((n)=>n.netId===e.netId)?.netLabelHeight;if(t!==void 0)return t}return this.inputProblem.netConnections.find((t)=>t.pinIds.some((n)=>e.pinIds.includes(n)))?.netLabelHeight}getCandidateStatus(e){let{candidate:t,label:n,labelIndex:o,phase:r}=e,i=zi(t.center,t.width,t.height),s=this.getBoundsStatus({bounds:i,labelIndex:o,label:n});if(s!=="valid"){if(!(r==="trace-anchor"||r==="connected-rail-shift"||r==="downward-ground-rail-extension")||s!=="chip-collision"||!this.isAcceptableConnectedChipBoundaryOverlap(t,n,i)||r==="connected-rail-shift"&&!this.staysOutsideConnectedPinRow({candidate:t,label:n,bounds:i}))return s;let h=this.getBoundsStatus({bounds:i,labelIndex:o,label:n,ignoreChipCollisions:!0});if(h!=="valid")return h}let a=this.getCandidateConnectorTrace(n,{anchorPoint:t.anchorPoint,connectorSource:r==="lateral-shift"?t.connectorSource:void 0,orientation:t.orientation,phase:r},o);if(this.obstacleIndex.doesTracePathCrossChip(a))return"chip-collision";for(let l of this.inputProblem.textBoxes??[])if(fnt(a,L9(l)))return"text-collision";let c=this.includeHorizontalConstraintMismatches(this.obstacleIndex.getLabelIndicesNearTracePath(a),this.isGroundLabel(n));for(let l of c){if(l===o)continue;if(this.shouldIgnorePendingCrowdedLabel(o,l))continue;let h=this.outputNetLabelPlacements[l];if(fnt(a,this.getLabelBoundsForCollisionWithGround(h,n)))return"netlabel-collision"}return"valid"}isAcceptableConnectedChipBoundaryOverlap(e,t,n){let o=this.chipObstacleSpatialIndex.getChipsInBounds(n);if(o.length===0)return!1;let r=new Set(t.pinIds.map((i)=>this.pinMap[i]?.chipId).filter((i)=>Boolean(i)));return o.every((i)=>{if(!r.has(i.chipId))return!1;let{anchorPoint:s,orientation:a}=e,c=i.bounds;if(Rd(a))return s.x<c.minX-Tr||s.x>c.maxX+Tr;return s.y<c.minY-Tr||s.y>c.maxY+Tr})}staysOutsideConnectedPinRow(e){let{candidate:t,label:n,bounds:o}=e,r=this.pinMap[n.pinIds[0]];if(!r||!Rd(t.orientation))return!1;if(t.anchorPoint.x<r.x)return o.maxX<=r.x+w1n+Tr;return o.minX>=r.x-w1n-Tr}getBoundsStatus(e){let{bounds:t,labelIndex:n,label:o,ignoreChipCollisions:r}=e;if(!r){if(this.chipObstacleSpatialIndex.getChipsInBounds(t).length>0)return"chip-collision";if(this.sharesChipBoundary(t))return"chip-collision"}if(DZ(t,this.inputProblem))return"text-collision";if(this.obstacleIndex.doesTraceCrossBoundsInterior(t))return"trace-collision";if(this.isTraceTooCloseToLabel(t,o))return"trace-clearance-violation";if(this.intersectsAnyOtherNetLabel(t,n,o))return"netlabel-collision";return"valid"}isTraceTooCloseToLabel(e,t){if(!this.shouldCheckTraceClearanceForLabel(t))return!1;let n=this.getLabelTraceClearanceBounds(e);return this.obstacleIndex.doesTraceIntersectBounds({bounds:n,excludedGlobalConnNetId:t.globalConnNetId})}getLabelTraceClearanceBounds(e){return{minX:e.minX-Ohe,minY:e.minY-Ohe,maxX:e.maxX+Ohe,maxY:e.maxY+Ohe}}shouldCheckTraceClearanceForLabel(e){if(!this.isPortOnlyLabel(e))return!1;if(!this.hasRoutedLabelOnSameNet(e))return!1;return this.getAvailableOrientations(e).length===1}hasRoutedLabelOnSameNet(e){for(let t of this.outputNetLabelPlacements){if(t.globalConnNetId!==e.globalConnNetId)continue;if(t.mspConnectionPairIds.length>0)return!0}return!1}isOutwardHorizontalFallback(e){let t=this.getChipSideForPoint(e.anchorPoint);return t==="left"&&e.orientation==="x-"||t==="right"&&e.orientation==="x+"}canPlaceVerticalLabelOnHostRail(e,t){if(!t.mspConnectionPairIds.some((s)=>{let a=this.traceMap[s];return a&&Ts(a.tracePath,e.anchorPoint)}))return!1;let o=this.pinMap[t.pinIds[0]];if(!o)return!1;if(t.pinIds.some((s)=>this.pinMap[s]?.chipId!==o.chipId))return!1;let r=this.chipObstacleSpatialIndex.chips.find((s)=>s.chipId===o.chipId);if(!r)return!1;let i=zi(e.center,e.width,e.height);if(i.minY<r.bounds.minY-Tr||i.maxY>r.bounds.maxY+Tr)return!1;if(e.anchorPoint.x>=r.bounds.minX-Tr&&e.anchorPoint.x<=r.bounds.maxX+Tr)return!1;return r.pins.every((s)=>t.pinIds.includes(s.pinId)||s.y<=i.minY+Tr||s.y>=i.maxY-Tr)}getTextBlockedMultiPinRailTraces(e,t){if(!Rd(t))return null;let n=this.pinMap[e.pinIds[0]]?.chipId,o=Object.values(this.traceMap).filter((p)=>p.globalConnNetId===e.globalConnNetId&&p.pins.every((m)=>m.chipId===n)),r=new Set(e.pinIds),i=new Set;for(let p=!0;p;){p=!1;for(let m of o){if(i.has(m))continue;if(!m.pinIds.some((A)=>r.has(A)))continue;i.add(m);for(let A of m.pinIds)r.add(A);p=!0}}if(r.size<3||r.size===3&&!this.hasPortOnlyLabelOnSameNet(e))return null;let s=[...r].map((p)=>this.pinMap[p]),a=j0(t),c=s[0].x;if(s.some((p)=>Math.abs(p.x-c)>Tr))return null;let l=this.inputProblem.chips.find((p)=>p.chipId===n).pins.filter((p)=>Math.abs(p.x-c)<=Tr),h=Math.min(...s.map((p)=>p.y)),d=Math.max(...s.map((p)=>p.y));if(l.some((p)=>p.y>=h-Tr&&p.y<=d+Tr&&!r.has(p.pinId))||t==="y-"&&h>Math.min(...l.map((p)=>p.y))+Tr||t==="y+"&&d<Math.max(...l.map((p)=>p.y))-Tr)return null;let u=Math.max(...s.map((p)=>p.x*a.x+p.y*a.y));return(this.inputProblem.textBoxes??[]).some((p)=>p.chipId===n&&p.center.x*a.x+p.center.y*a.y>u+Tr)?[...i]:null}findValidNearbyRailCandidate(e,t,n,o){if(!Rd(t))return null;let r=j0(t),i=[...new Set(o.flatMap((c)=>c.pinIds))].map((c)=>this.pinMap[c]).sort((c,l)=>l.y*r.y-c.y*r.y)[0]?.y;if(i===void 0)return null;let s=this.pinMap[e.pinIds[0]].x,a=[...new Set(o.flatMap((c)=>c.tracePath.map((l)=>l.x)))].filter((c)=>Math.abs(c-s)>Tr).sort((c,l)=>Math.abs(c-s)-Math.abs(l-s));for(let c of a){let l={x:c,y:i};if(!Object.values(this.traceMap).some((d)=>d.globalConnNetId===e.globalConnNetId&&Ts(d.tracePath,l)))continue;let h=this.findValidCandidateInShiftColumn({label:e,labelIndex:n,orientation:t,direction:r,baseAnchor:l,maxSearchDistance:this.getSearchDistanceLimit(e,t),outwardDistance:0,phase:"connected-rail-shift",stopOnTraceCollision:!1,connectorSource:l,startDistance:0});if(h)return h}return null}hasPortOnlyLabelOnSameNet(e){return this.outputNetLabelPlacements.some((t)=>t!==e&&t.globalConnNetId===e.globalConnNetId&&this.isPortOnlyLabel(t))}hasOppositeVerticalRailOnSameChipSide(e,t){let n=this.inputProblem.netConnections.find((i)=>i.netId===e.netId);if(!n)return!1;let o=this.getSingleChipSideForNetConnection(n);if(!o)return!1;let r=t==="y+"?"y-":"y+";return this.inputProblem.netConnections.some((i)=>{if(i===n||i.pinIds.length<2)return!1;let s=this.inputProblem.availableNetLabelOrientations[i.netId]??[];if(s.length!==1||s[0]!==r)return!1;let a=this.getSingleChipSideForNetConnection(i);return a?.chipId===o.chipId&&a.side===o.side})}getSingleChipSideForNetConnection(e){if(e.pinIds.length<2)return null;let t=e.pinIds.map((s)=>this.pinMap[s]);if(t.some((s)=>!s))return null;if(new Set(t.map((s)=>s.chipId)).size!==1)return null;let o=t[0].chipId,r=this.chipObstacleSpatialIndex.chips.find((s)=>s.chipId===o);if(!r)return null;let i=new Set(t.map((s)=>{if(Math.abs(s.x-r.bounds.minX)<=Tr)return"left";if(Math.abs(s.x-r.bounds.maxX)<=Tr)return"right";return null}));if(i.size!==1||i.has(null))return null;return{chipId:o,side:[...i][0]}}isPortOnlyLabel(e){return e.mspConnectionPairIds.length===0}getNetConnectionForLabel(e){return e.netId?this.inputProblem.netConnections.find((t)=>t.netId===e.netId):this.inputProblem.netConnections.find((t)=>t.pinIds.some((n)=>e.pinIds.includes(n)))}isGroundLabel(e){return this.getNetConnectionForLabel(e)?.isGround===!0}getHorizontalConstraintMismatchBounds(e){if(!this.isPortOnlyLabel(e))return null;if(e.orientation!=="x+"&&e.orientation!=="x-")return null;let t=e.netId??e.globalConnNetId,n=this.inputProblem.availableNetLabelOrientations[t]??[];if(n.length===0||n.some((s)=>!Rd(s)))return null;let o=this.getNetConnectionForLabel(e)?.netLabelHeight;if(o===void 0||o<=e.width+e.height+Tr)return null;let r=kf(e.anchorPoint,e.orientation,e.width,e.height),i=kf(e.anchorPoint,e.orientation,o,e.height);return zi({x:i.x+e.center.x-r.x,y:i.y+e.center.y-r.y},o,e.height)}includeHorizontalConstraintMismatches(e,t){if(!t)return[...e].sort((o,r)=>o-r);let n=new Set(e);for(let o=0;o<this.outputNetLabelPlacements.length;o++)if(this.getHorizontalConstraintMismatchBounds(this.outputNetLabelPlacements[o]))n.add(o);return[...n].sort((o,r)=>o-r)}getLabelBoundsForCollisionWithGround(e,t){if(this.isGroundLabel(t)){let n=this.getHorizontalConstraintMismatchBounds(e);if(n)return n}return zi(e.center,e.width,e.height)}shouldIgnorePendingCrowdedLabel(e,t){return this.crowdedPortOnlyLabelIndices.has(e)&&this.crowdedPortOnlyLabelIndices.has(t)&&this.queuedLabelIndices.includes(t)}intersectsAnyOtherNetLabel(e,t,n){let o={minX:e.minX-xm,minY:e.minY-xm,maxX:e.maxX+xm,maxY:e.maxY+xm},r=this.includeHorizontalConstraintMismatches(this.obstacleIndex.getLabelIndicesInBounds(o),this.isGroundLabel(n));for(let i of r){if(i===t)continue;if(this.shouldIgnorePendingCrowdedLabel(t,i))continue;let s=this.outputNetLabelPlacements[i],a=this.getLabelBoundsForCollisionWithGround(s,n);if(i===this.blockedStandaloneLabelIndex&&Rd(s.orientation))a.minX-=xm,a.maxX+=xm;if(rde(e,a))return!0}return!1}sharesChipBoundary(e){let t={minX:e.minX-j4-Tr,minY:e.minY-j4-Tr,maxX:e.maxX+j4+Tr,maxY:e.maxY+j4+Tr},n=this.chipObstacleSpatialIndex.getChipsInBounds(t);for(let o of n){let r=o.bounds,i=Math.abs(e.minX-r.maxX)<=j4+Tr||Math.abs(e.maxX-r.minX)<=j4+Tr,s=Math.abs(e.minY-r.maxY)<=j4+Tr||Math.abs(e.maxY-r.minY)<=j4+Tr;if(i&&O8e(e.minY,e.maxY,r.minY,r.maxY))return!0;if(s&&O8e(e.minX,e.maxX,r.minX,r.maxX))return!0}return!1}getChipSideForPoint(e){let t=this.getContainingChipSide(e);if(t)return t;let n=this.getOutsideChipSide(e);if(n)return n;return this.getNearestChipSide(e)}getPerpendicularOutwardDirection(e,t){let n=this.getChipSideForPoint(e);if(Rd(t)&&n==="left")return{x:-1,y:0};if(Rd(t)&&n==="right")return{x:1,y:0};if(yJ(t)&&n==="bottom")return{x:0,y:-1};if(yJ(t)&&n==="top")return{x:0,y:1};return{x:0,y:0}}getChipOutwardDirection(e){switch(this.getChipSideForPoint(e)){case"left":return{x:-1,y:0};case"right":return{x:1,y:0};case"bottom":return{x:0,y:-1};case"top":return{x:0,y:1};default:return{x:0,y:0}}}getContainingChipSide(e){let t=null,n=Number.POSITIVE_INFINITY;for(let o of this.chipObstacleSpatialIndex.chips){let r=o.bounds;if(e.x<r.minX-Tr||e.x>r.maxX+Tr||e.y<r.minY-Tr||e.y>r.maxY+Tr)continue;for(let[i,s]of d1n(e,r))if(s<n)t=i,n=s}return t}getOutsideChipSide(e){let t=null,n=Number.POSITIVE_INFINITY;for(let o of this.chipObstacleSpatialIndex.chips){let r=o.bounds,i=e.x<r.minX-Tr?r.minX-e.x:e.x>r.maxX+Tr?e.x-r.maxX:0,s=e.y<r.minY-Tr?r.minY-e.y:e.y>r.maxY+Tr?e.y-r.maxY:0;if(i===0&&s===0)continue;let a=i**2+s**2;if(a>=n)continue;if(n=a,i>0)t=e.x<r.minX?"left":"right";else t=e.y<r.minY?"bottom":"top"}return t}getNearestChipSide(e){let t=null,n=Number.POSITIVE_INFINITY;for(let o of this.chipObstacleSpatialIndex.chips)for(let[r,i]of d1n(e,o.bounds))if(i<n)t=r,n=i;return t}visualize(){return Wni({inputProblem:this.inputProblem,traces:this.traces,outputNetLabelPlacements:this.outputNetLabelPlacements,currentLabel:this.currentLabel,currentCandidateResults:this.currentCandidateResults,solved:this.solved})}};var toi="blue",n7n="red",noi=(e)=>{let t=J0(e.inputProblem);if(aoi(t),ooi(t,e.traces),roi(t,e.outputNetLabelPlacements),!e.solved)ioi(t,e.currentLabel),soi(t,e.currentCandidateResults);return t},ooi=(e,t)=>{for(let n of t)e.lines.push({points:n.tracePath,strokeColor:"purple"})},roi=(e,t)=>{for(let n of t)e.rects.push({center:n.center,width:n.width,height:n.height,fill:Ic(n.globalConnNetId,0.35),strokeColor:Ic(n.globalConnNetId,0.9),label:`netId: ${n.netId}
globalConnNetId: ${n.globalConnNetId}`}),e.points.push({x:n.anchorPoint.x,y:n.anchorPoint.y,color:Ic(n.globalConnNetId,0.9),label:`anchorPoint
orientation: ${n.orientation}`})},ioi=(e,t)=>{if(!t)return;e.rects.push({center:t.center,width:t.width,height:t.height,fill:"rgba(255, 0, 0, 0.2)",strokeColor:n7n,label:`trace-line VCC target
${t.netId??t.globalConnNetId}`})},soi=(e,t)=>{for(let n of t){let o=n.selected?toi:n7n;e.rects.push({center:n.center,width:n.width,height:n.height,fill:n.selected?"rgba(0, 0, 255, 0.2)":"rgba(255, 0, 0, 0.15)",strokeColor:o,strokeDash:n.selected?void 0:"4 2",label:`${n.selected?"selected":n.status} trace corner
trace: ${n.traceId}
distance: ${n.distance.toFixed(3)}`}),e.points.push({...n.anchorPoint,color:o,label:`candidate anchor
${n.status}`})}},aoi=(e)=>{if(!e.lines)e.lines=[];if(!e.points)e.points=[];if(!e.rects)e.rects=[];if(!e.circles)e.circles=[];if(!e.texts)e.texts=[]},vat=(e,t)=>t.filter((n)=>n.mspPairId!==e.mspPairId&&n.globalConnNetId===e.globalConnNetId).flatMap((n)=>[...n.tracePath.filter((o)=>Ts(e.tracePath,o)),...e.tracePath.slice(1).flatMap((o,r)=>n.tracePath.slice(1).flatMap((i,s)=>{let a=rP(e.tracePath[r],o,n.tracePath[s],i);return a?[a]:[]}))]),o7n=({label:e,traces:t,rails:n,netLabelPlacements:o,netLabelConnectorTraceIds:r,inputProblem:i})=>{let s=[];for(let a of t){if(!r.has(a.mspPairId))continue;if(a.globalConnNetId!==e.globalConnNetId)continue;let c=[a.tracePath[0],a.tracePath.at(-1)];if(!c[0]||!c[1])continue;let l=c.findIndex((_)=>hB(_,e.anchorPoint)<=du);if(l===-1)continue;let h=c[1-l],d=o.filter((_)=>_!==e);if(d.some((_)=>_.mspConnectionPairIds.includes(a.mspPairId)))continue;let u=[...vat(a,t),...i.chips.flatMap((_)=>_.pins),...d.map((_)=>_.anchorPoint)].filter((_)=>Ts(a.tracePath,_));for(let _ of n){if(r.has(_.mspPairId)||!O8n(_))continue;if(_.globalConnNetId!==e.globalConnNetId)continue;if(e.mspConnectionPairIds.length>0&&!e.mspConnectionPairIds.includes(_.mspPairId))continue;if(!Ts(_.tracePath,h))continue;if(!u.every((p)=>Ts(_.tracePath,p)))continue;s.push({connector:a,rail:_})}}return s},coi=({label:e,traces:t,netLabelPlacements:n,netLabelConnectorTraceIds:o,inputProblem:r})=>{if(e.pinIds.length!==1||e.orientation!=="y+"&&e.orientation!=="y-")return;let i=r.chips.flatMap((a)=>a.pins),s=i.find((a)=>a.pinId===e.pinIds[0]);if(!s)return;for(let a of t){if(!o.has(a.mspPairId)||a.globalConnNetId!==e.globalConnNetId||a.pinIds.length!==1||a.pinIds[0]!==s.pinId)continue;let c=vi(a.tracePath);if(c.length<4)continue;if(hB(c.at(-1),s)<=du)c.reverse();if(hB(c[0],s)>du||hB(c.at(-1),e.anchorPoint)>du||Math.abs(c[1].y-s.y)>du)continue;let l={x:e.anchorPoint.x,y:s.y};if((l.x-s.x)*(c[1].x-s.x)<=du)continue;let h=[c[0],l];if(![...vat(a,t),...i,...n.filter((u)=>u!==e).map((u)=>u.anchorPoint)].filter((u)=>Ts(c,u)).every((u)=>Ts(h,u)))continue;if(t.some((u)=>u.globalConnNetId!==a.globalConnNetId&&ZS(h,u.tracePath)>ZS(c,u.tracePath)))continue;return{anchorPoint:l,traceId:a.mspPairId,distance:hB(l,e.anchorPoint),pinAligned:!0,reroutedTracePath:h}}},loi=(e)=>{let{label:t,traces:n}=e;if(t.orientation!=="y+"&&t.orientation!=="y-")return[];let o=t.orientation==="y+"?1:-1,r=[],i=o7n({...e,rails:n});for(let{connector:s,rail:a}of i){let c=vi(s.tracePath);if(Qf(c)<2)continue;for(let l of tk(vi(a.tracePath))){let h=t.anchorPoint;if((h.y-l.y)*o<-du)continue;let d=vi([l,{x:h.x,y:l.y},h]);if(Qf(d)>=Qf(c)||Zx(d)>Zx(c)+du)continue;if(n.some((u)=>u.globalConnNetId!==s.globalConnNetId&&ZS(d,u.tracePath)>ZS(c,u.tracePath)))continue;r.push({anchorPoint:h,traceId:s.mspPairId,distance:0,pinAligned:!0,reroutedTracePath:d})}}return r.sort((s,a)=>Zx(s.reroutedTracePath)-Zx(a.reroutedTracePath)||Qf(s.reroutedTracePath)-Qf(a.reroutedTracePath))},ave=0.1,B1n=class extends mu{inputProblem;traces;netLabelPlacements;outputNetLabelPlacements;queuedLabelIndices=[];currentLabelIndex=null;currentLabel=null;currentCandidateResults=[];queuedCornerCandidates=[];shouldAdvanceToNextLabel=!1;traceMap;netLabelConnectorTraceIds;originalTraces;onlyOverlappingLabels;constructor(e){super();this.inputProblem=e.inputProblem,this.traces=e.traces,this.netLabelPlacements=e.netLabelPlacements,this.outputNetLabelPlacements=[...e.netLabelPlacements],this.traceMap=Object.fromEntries(e.traces.map((t)=>[t.mspPairId,t])),this.netLabelConnectorTraceIds=e.netLabelConnectorTraceIds??new Set,this.originalTraces=e.originalTraces,this.onlyOverlappingLabels=e.onlyOverlappingLabels??!1,this.queuedLabelIndices=this.getProcessableLabelIndices(),this.prepareNextLabel()}getConstructorParams(){return{inputProblem:this.inputProblem,traces:this.traces,netLabelPlacements:this.netLabelPlacements,netLabelConnectorTraceIds:this.netLabelConnectorTraceIds,originalTraces:this.originalTraces,onlyOverlappingLabels:this.onlyOverlappingLabels}}_step(){if(this.shouldAdvanceToNextLabel){this.advanceToNextLabel();return}let e=this.currentLabel,t=this.currentLabelIndex;if(e===null||t===null){this.finish();return}let n=this.queuedCornerCandidates.shift();if(!n){this.shouldAdvanceToNextLabel=!0;return}let o=this.evaluateCornerCandidate(e,t,n);if(this.currentCandidateResults.push(o),o.status!=="valid")return;o.selected=!0,this.applyCandidate(t,e,o),this.shouldAdvanceToNextLabel=!0}getOutput(){return{traces:this.traces,netLabelPlacements:this.outputNetLabelPlacements}}getProcessableLabelIndices(){let e=[];for(let t=0;t<this.outputNetLabelPlacements.length;t++){let n=this.outputNetLabelPlacements[t];if(!this.shouldProcessLabel(n))continue;e.push(t)}return e}prepareNextLabel(){let e=this.queuedLabelIndices.shift();if(e===void 0)return this.clearCurrentLabel(),!1;let t=this.outputNetLabelPlacements[e];return this.currentLabelIndex=e,this.currentLabel=t,this.currentCandidateResults=[],this.queuedCornerCandidates=[...this.getSimplifiedConnectorCandidates(t),...this.getCornerCandidatesForLabel(t)],!0}advanceToNextLabel(){if(this.shouldAdvanceToNextLabel=!1,!this.prepareNextLabel())this.finish()}clearCurrentLabel(){this.currentLabelIndex=null,this.currentLabel=null,this.currentCandidateResults=[],this.queuedCornerCandidates=[]}finish(){this.clearCurrentLabel(),this.solved=!0}evaluateCornerCandidate(e,t,n){let o=kf(n.anchorPoint,e.orientation,e.width,e.height),r=zi(o,e.width,e.height);return{...n,center:o,width:e.width,height:e.height,status:this.getCandidateStatus(r,t,n),selected:!1}}getCandidateStatus(e,t,n){if(this.intersectsAnyChip(e))return"chip-collision";if(DZ(e,this.inputProblem))return"text-collision";let o=n.obsoleteConnectorTraceId?Object.fromEntries(Object.entries(this.traceMap).filter(([i])=>i!==n.obsoleteConnectorTraceId)):this.traceMap,r=n.reroutedTracePath?{...o,[n.traceId]:{...this.traceMap[n.traceId],tracePath:n.reroutedTracePath}}:o;if(Mde(e,r))return"trace-collision";if(n.reroutedTracePath&&!this.isReroutedTraceClear(n,t))return"trace-collision";if(this.intersectsAnyOtherNetLabel(e,t))return"netlabel-collision";return"valid"}applyCandidate(e,t,n){if(n.reroutedTracePath){let o=this.traceMap[n.traceId],r={...o,tracePath:n.reroutedTracePath};this.traces=this.traces.map((i)=>i.mspPairId===n.traceId?r:i),this.traceMap[n.traceId]=r,this.outputNetLabelPlacements=RZ({trace:o,originalTracePath:o.tracePath,reroutedTracePath:n.reroutedTracePath,netLabelPlacements:this.outputNetLabelPlacements})}if(n.obsoleteConnectorTraceId)this.traces=this.traces.filter((o)=>o.mspPairId!==n.obsoleteConnectorTraceId),delete this.traceMap[n.obsoleteConnectorTraceId];this.outputNetLabelPlacements[e]={...t,...n.obsoleteConnectorTraceId||!this.pointsEqual(t.anchorPoint,n.anchorPoint)&&!t.mspConnectionPairIds.includes(n.traceId)?{mspConnectionPairIds:[n.traceId],pinIds:[...this.traceMap[n.traceId].pinIds]}:{},anchorPoint:n.anchorPoint,center:n.center}}shouldProcessLabel(e){if(this.originalTraces||this.onlyOverlappingLabels){let n=this.originalTraces&&this.hasMovedCorner(e),o=this.onlyOverlappingLabels&&this.isLabelCrossedByTrace(e),r=this.getNewRailCornerCandidates(e).length>0,i=this.getSimplifiedConnectorCandidates(e).length>0;if(!n&&!o&&!r&&!i)return!1}return(e.orientation==="y+"||e.orientation==="y-")&&(this.getSimplifiedConnectorCandidates(e).length>0||this.getCornerCandidatesForLabel(e).length>0)}hasMovedCorner(e){return this.originalTraces.some((t)=>{if(!this.isTraceForLabel(t,e))return!1;if(!tk(t.tracePath).some((o)=>this.pointsEqual(o,e.anchorPoint)))return!1;let n=this.traceMap[t.mspPairId];return n!==void 0&&!tk(n.tracePath).some((o)=>this.pointsEqual(o,e.anchorPoint))})}intersectsAnyChip(e){return this.inputProblem.chips.some((t)=>B9(e,zi(t.center,t.width,t.height)))}intersectsAnyOtherNetLabel(e,t){return this.outputNetLabelPlacements.some((n,o)=>{if(o===t)return!1;return B9(e,zi(n.center,n.width,n.height))})}getCornerCandidatesForLabel(e){let t=[],n=this.getNewRailCornerCandidates(e),o=this.getTraceLinesForLabel(e),r=this.isConfiguredRailLabel(e)&&(this.isLabelCrossedByTrace(e)||!o.some((i)=>tk(i.tracePath).some((s)=>this.pointsEqual(s,e.anchorPoint))));for(let i of o){let s=i.tracePath,a=[s[0],s[s.length-1]];for(let c of tk(s)){let l=s.indexOf(c),h=a.some((_)=>Math.abs(_.x-c.x)<=du),d=h||r&&this.isPinAlignedCorner(s,l);if(!d)continue;(h?t:n).push({anchorPoint:c,traceId:i.mspPairId,distance:hB(c,e.anchorPoint),pinAligned:d},...this.getClearanceShiftedCornerCandidates({label:e,trace:i,cornerIndex:l,pinAligned:d}))}}return[...t.sort((i,s)=>i.distance-s.distance),...n.sort((i,s)=>i.distance-s.distance)]}getNewRailCornerCandidates(e){if(!this.originalTraces||!this.isConfiguredRailLabel(e))return[];let t=new Map,n=this.traces.filter((r)=>{if(this.netLabelConnectorTraceIds.has(r.mspPairId))return!1;if(r.globalConnNetId!==e.globalConnNetId)return!1;if(e.mspConnectionPairIds.length>0&&!e.mspConnectionPairIds.includes(r.mspPairId))return!1;let i=this.originalTraces.find((c)=>c.mspPairId===r.mspPairId);if(!i)return!1;let s=tk(i.tracePath),a=tk(r.tracePath).filter((c)=>!s.some((l)=>this.pointsEqual(l,c))&&this.isPinAlignedCorner(r.tracePath,r.tracePath.indexOf(c)));if(a.length===0)return!1;return t.set(r.mspPairId,a),!0});if(n.length===0)return[];return o7n({label:e,traces:this.traces,rails:n,netLabelPlacements:this.outputNetLabelPlacements,netLabelConnectorTraceIds:this.netLabelConnectorTraceIds,inputProblem:this.inputProblem}).flatMap(({connector:r,rail:i})=>t.get(i.mspPairId).map((s)=>({anchorPoint:s,traceId:i.mspPairId,distance:hB(s,e.anchorPoint),pinAligned:!0,obsoleteConnectorTraceId:r.mspPairId})))}getSimplifiedConnectorCandidates(e){return[...this.originalTraces?loi({label:e,traces:this.traces,netLabelPlacements:this.outputNetLabelPlacements,netLabelConnectorTraceIds:this.netLabelConnectorTraceIds,inputProblem:this.inputProblem}):[],...this.getStraightConnectorCandidates(e)]}getStraightConnectorCandidates(e){let t=this.originalTraces?coi({label:e,traces:this.traces,netLabelPlacements:this.outputNetLabelPlacements,netLabelConnectorTraceIds:this.netLabelConnectorTraceIds,inputProblem:this.inputProblem}):void 0;if(t)return[t];if(e.pinIds.length!==2||!this.isConfiguredRailLabel(e))return[];let n=this.inputProblem.chips.flatMap((l)=>l.pins).filter((l)=>e.pinIds.includes(l.pinId));if(n.length!==2||n[0]._facingDirection!==n[1]._facingDirection||n[0]._facingDirection!=="x+"&&n[0]._facingDirection!=="x-"||Math.abs(n[0].y-n[1].y)>du)return[];let o=this.inputProblem.availableNetLabelOrientations[e.netId];if(o?.length!==1||o[0]!==e.orientation)return[];if(this.inputProblem.netConnections.find((l)=>l.netId===e.netId)?.isGround)return[];let i=this.traces.find((l)=>this.netLabelConnectorTraceIds.has(l.mspPairId)&&l.globalConnNetId===e.globalConnNetId&&e.pinIds.every((h)=>l.pinIds.includes(h))&&l.tracePath.length>=2&&(this.pointsEqual(l.tracePath[0],e.anchorPoint)||this.pointsEqual(l.tracePath.at(-1),e.anchorPoint)));if(!i)return[];let s=this.pointsEqual(i.tracePath[0],e.anchorPoint)?i.tracePath.at(-1):i.tracePath[0];if(!this.isComponentAdjacentCorner(e,s))return[];let a=e.orientation==="y+"?1:-1,c=Math.min(z8n(this.inputProblem),e.height*2);for(let l=j4+xm;l<=c+du;l+=xm){let h={x:s.x,y:s.y+a*l},d=kf(h,e.orientation,e.width,e.height);if(this.intersectsAnyChip(zi(d,e.width,e.height)))continue;return[{anchorPoint:h,traceId:i.mspPairId,distance:hB(h,e.anchorPoint),pinAligned:!0,reroutedTracePath:[s,h]}]}return[]}isComponentAdjacentCorner(e,t){return e.mspConnectionPairIds.some((n)=>{let o=this.traceMap[n];if(!o||o.tracePath.length<2)return!1;return[{point:o.tracePath[0],neighbor:o.tracePath[1]},{point:o.tracePath.at(-1),neighbor:o.tracePath.at(-2)}].some(({point:r,neighbor:i})=>this.pointsEqual(i,t)&&o.pins.some((s)=>this.pointsEqual(s,r)))})}isConfiguredRailLabel(e){if(!e.netId)return!1;return this.inputProblem.availableNetLabelOrientations[e.netId]?.some((t)=>t==="y+"||t==="y-")}isLabelCrossedByTrace(e){let t=zi(e.center,e.width,e.height);return Mde(t,this.traceMap)}pointsEqual(e,t){return Math.abs(e.x-t.x)<=du&&Math.abs(e.y-t.y)<=du}getVerticalSegmentPointIndices(e,t){let n=e[t],o=Math.abs(e[t-1].x-n.x)<=du,r=Math.abs(e[t+1].x-n.x)<=du;if(o===r)return null;return o?[t-1,t]:[t,t+1]}isPinAlignedCorner(e,t){let n=this.getVerticalSegmentPointIndices(e,t);if(!n)return!1;let[o,r]=n;return o<=1||r>=e.length-2}getClearanceShiftedCornerCandidates({label:e,trace:t,cornerIndex:n,pinAligned:o}){if(e.orientation!=="y+"&&e.orientation!=="y-")return[];let r=t.tracePath,i=r[n],s=this.getVerticalSegmentPointIndices(r,n);if(!s||s.includes(0)||s.includes(r.length-1))return[];let a=kf(i,e.orientation,e.width,e.height),c=zi(a,e.width,e.height),l=this.inputProblem.chips.map((d)=>zi(d.center,d.width,d.height)).filter((d)=>B9(c,d)),h=new Set;for(let d of l)h.add(d.minX-e.width/2),h.add(d.maxX+e.width/2);for(let d of this.traces){if(d.globalConnNetId===e.globalConnNetId)continue;for(let u=0;u<d.tracePath.length-1;u++){let _=d.tracePath[u],p=d.tracePath[u+1];if(!hue(_,p,c))continue;let m=e.width/2;if(Math.abs(_.x-p.x)<=du)h.add(_.x-m-ave),h.add(_.x+m+ave);else h.add(Math.min(_.x,p.x)-m-ave),h.add(Math.max(_.x,p.x)+m+ave)}}return[...h].flatMap((d)=>{if(Math.abs(d-i.x)<=du)return[];let u=vi(r.map((m,A)=>s.includes(A)?{...m,x:d}:m)),_={x:d,y:i.y};if(!tk(u).some((m)=>this.pointsEqual(m,_)))return[];return[{anchorPoint:_,traceId:t.mspPairId,distance:hB(_,e.anchorPoint),pinAligned:o,reroutedTracePath:u}]})}isReroutedTraceClear(e,t){let n=e.reroutedTracePath;if(NZ(n,wy(this.inputProblem)))return!1;let o=this.traceMap[e.traceId],r=this.traces.filter((s)=>s.mspPairId!==e.traceId&&s.globalConnNetId!==o.globalConnNetId);if(R8n(n,r))return!1;let i={[e.traceId]:{...o,tracePath:n}};return this.outputNetLabelPlacements.every((s,a)=>{if(a===t)return!0;return!Mde(zi(s.center,s.width,s.height),i)})}getTraceLinesForLabel(e){return this.traces.filter((t)=>O8n(t)&&this.isTraceForLabel(t,e))}isTraceForLabel(e,t){if(!Ts(e.tracePath,t.anchorPoint))return!1;if(e.globalConnNetId===t.globalConnNetId&&this.isLabelCrossedByTrace(t))return!0;let n=new Set(t.mspConnectionPairIds);if(n.size>0)return n.has(e.mspPairId);return e.globalConnNetId===t.globalConnNetId}visualize(){return noi({inputProblem:this.inputProblem,traces:this.traces,outputNetLabelPlacements:this.outputNetLabelPlacements,currentLabel:this.currentLabel,currentCandidateResults:this.currentCandidateResults,solved:this.solved})}},Sat=(e)=>[...new Set(e)],hoi=(e)=>[...new Set(e.filter((t)=>t!==void 0))],doi=(e,t)=>hoi([t.netId,t.globalConnNetId,...e.netConnections.filter((n)=>t.pinIds.some((o)=>n.pinIds.includes(o))).map((n)=>n.netId)]),uoi=(e)=>{switch(e){case"x+":case"+x":return"x+";case"x-":case"-x":return"x-";case"y+":case"+y":return"y+";case"y-":case"-y":return"y-"}},poi=(e,t)=>{let n=e.availableNetLabelOrientations??{};for(let o of doi(e,t))if(Object.hasOwn(n,o))return Sat((n[o]??[]).map(uoi).filter((r)=>r!==void 0));return null},Wu=0.000001,cve=0.000001,Vhe=(e)=>zi(e.center,e.width,e.height),T1n=(e,t)=>Math.min(e.maxX,t.maxX)-Math.max(e.minX,t.minX)>Wu&&Math.min(e.maxY,t.maxY)-Math.max(e.minY,t.minY)>Wu,moi=(e,t)=>Math.min(e.maxX,t.maxX)-Math.max(e.minX,t.minX)>=-Wu&&Math.min(e.maxY,t.maxY)-Math.max(e.minY,t.minY)>=-Wu,D1n=(e,t)=>t.tracePath.slice(1).some((n,o)=>H9(t.tracePath[o],n,e)),_oi=(e,t)=>{for(let n of t){let o=n.tracePath;for(let r=0;r<o.length-1;r++)if(yoi(o[r],o[r+1],e))return!0}return!1},N1n=(e,t)=>{let n=[];for(let o of t){if(boi(o.pinIds)<2)continue;let r=0;for(let i=0;i<o.tracePath.length-1;i++){let s=o.tracePath[i],a=o.tracePath[i+1],c=AZ(s,a);if(xoi(e,s,a))n.push({trace:o,distance:r+AZ(s,e)});r+=c}}return n},goi=(e)=>{let t=0;for(let n=0;n<e.tracePath.length-1;n++)t+=AZ(e.tracePath[n],e.tracePath[n+1]);return t},Aoi=(e,t)=>{let n=0;for(let o=0;o<e.tracePath.length-1;o++){let r=e.tracePath[o],i=e.tracePath[o+1],s=AZ(r,i),a=n+s;if(t<=a+Wu){let c=Math.max(0,Math.min(s,t-n)),l=Coi(r,i);return{x:r.x+l.x*c,y:r.y+l.y*c}}n=a}return e.tracePath[e.tracePath.length-1]},foi=(e)=>{let t=[],n=0;for(let o=0;o<e.tracePath.length;o++){t.push(n);let r=e.tracePath[o+1];if(r)n+=AZ(e.tracePath[o],r)}return t},AZ=(e,t)=>Math.abs(e.x-t.x)+Math.abs(e.y-t.y),yoi=(e,t,n)=>{let o={minX:n.minX+cve,minY:n.minY+cve,maxX:n.maxX-cve,maxY:n.maxY-cve};if(o.minX>=o.maxX||o.minY>=o.maxY)return!1;if(Eat(e,t)){if(e.x<=o.minX+Wu||e.x>=o.maxX-Wu)return!1;return R1n(Math.min(e.y,t.y),Math.max(e.y,t.y),o.minY,o.maxY)}if(Pat(e,t)){if(e.y<=o.minY+Wu||e.y>=o.maxY-Wu)return!1;return R1n(Math.min(e.x,t.x),Math.max(e.x,t.x),o.minX,o.maxX)}return!1},xoi=(e,t,n)=>{if(Pat(t,n))return Math.abs(e.y-t.y)<=Wu&&e.x>=Math.min(t.x,n.x)-Wu&&e.x<=Math.max(t.x,n.x)+Wu;if(Eat(t,n))return Math.abs(e.x-t.x)<=Wu&&e.y>=Math.min(t.y,n.y)-Wu&&e.y<=Math.max(t.y,n.y)+Wu;return!1},Coi=(e,t)=>({x:Eat(e,t)?0:Math.sign(t.x-e.x),y:Pat(e,t)?0:Math.sign(t.y-e.y)}),Pat=(e,t)=>Math.abs(e.y-t.y)<=Wu,Eat=(e,t)=>Math.abs(e.x-t.x)<=Wu,R1n=(e,t,n,o)=>Math.min(t,o)-Math.max(e,n)>Wu,boi=(e)=>new Set(e).size,Q1n=0.1,Ioi=(e)=>{let{inputProblem:t,label:n,traceLocation:o}=e,r=goi(o.trace),i=poi(t,n),s=voi(r,foi(o.trace)),a=Qoi(t,n),c=koi(t,n),l=[],h=new Set;for(let d of s){let u=Aoi(o.trace,d),_=Soi({inputProblem:t,label:n,point:u,orientationConstraint:i});for(let p of _){if(Loi(n,u,p))continue;let m=[u.x.toFixed(6),u.y.toFixed(6),p].join(":");if(h.has(m))continue;h.add(m),l.push(Poi({point:u,orientation:p,netLabelWidth:a,netLabelHeight:c,traceLocation:o,pathDistance:d,label:n}))}}return l},voi=(e,t)=>{let n=new Set,o=Math.ceil(e/Q1n);for(let r=0;r<=o;r++){let i=Math.min(e,r*Q1n);n.add(L1n(i))}for(let r of t)n.add(L1n(r));return[...n].filter((r)=>r>=-Wu&&r<=e+Wu).sort((r,i)=>r-i)},Soi=(e)=>{let{inputProblem:t,label:n,point:o,orientationConstraint:r}=e;if(r)return r;return Eoi({label:n,inputProblem:t,point:o})},Poi=(e)=>{let{point:t,orientation:n,netLabelWidth:o,netLabelHeight:r,traceLocation:i,pathDistance:s,label:a}=e,{width:c,height:l}=S9({orientation:n,netLabelWidth:o,netLabelHeight:r});return{anchorPoint:t,center:kf(t,n,c,l),width:c,height:l,orientation:n,traceId:i.trace.mspPairId,pathDistance:s,distanceFromOriginal:AZ(t,a.anchorPoint),status:"valid",selected:!1}},Eoi=(e)=>{let{label:t,inputProblem:n,point:o}=e;return Sat([...Moi(t),...woi({inputProblem:n,point:o}),...Doi])},Moi=(e)=>[e.orientation,Noi(e.orientation)],woi=(e)=>{let{inputProblem:t,point:n}=e,o=Roi(t);return Sat(Boi(n,o).sort((r,i)=>i.outwardScore-r.outwardScore).map(({orientation:r})=>r))},Boi=(e,t)=>{let n=[];return n.push(k1n({value:e.y,min:t.minY,max:t.maxY,center:t.centerY,positiveOrientation:"y+",negativeOrientation:"y-"})),n.push(k1n({value:e.x,min:t.minX,max:t.maxX,center:t.centerX,positiveOrientation:"x+",negativeOrientation:"x-"})),n},k1n=(e)=>{let{value:t,min:n,max:o,center:r,positiveOrientation:i,negativeOrientation:s}=e;if(t>o+Wu)return{orientation:i,outwardScore:1+t-o};if(t<n-Wu)return{orientation:s,outwardScore:1+n-t};return{orientation:t>=r?i:s,outwardScore:Toi(t,r,o-n)}},Toi=(e,t,n)=>Math.abs(e-t)/Math.max(Wu,n/2),Doi=["x+","x-","y+","y-"],Noi=(e)=>{switch(e){case"x+":return"x-";case"x-":return"x+";case"y+":return"y-";case"y-":return"y+"}},Roi=(e)=>{if(e.chips.length===0)return{minX:0,minY:0,maxX:0,maxY:0,centerX:0,centerY:0};let t=e.chips.reduce((n,o)=>({minX:Math.min(n.minX,o.center.x-o.width/2),minY:Math.min(n.minY,o.center.y-o.height/2),maxX:Math.max(n.maxX,o.center.x+o.width/2),maxY:Math.max(n.maxY,o.center.y+o.height/2)}),{minX:Number.POSITIVE_INFINITY,minY:Number.POSITIVE_INFINITY,maxX:Number.NEGATIVE_INFINITY,maxY:Number.NEGATIVE_INFINITY});return{...t,centerX:(t.minX+t.maxX)/2,centerY:(t.minY+t.maxY)/2}},Qoi=(e,t)=>{let n=PS({inputProblem:e,netId:t.netId,pinIds:t.pinIds,isPortOnlyLabel:t.mspConnectionPairIds.length===0});if(n!==void 0)return n;if(t.orientation==="y+"||t.orientation==="y-")return t.height;return t.width},koi=(e,t)=>{let n=e.netConnections.find((o)=>o.netId===t.netId)?.netLabelHeight;if(n!==void 0)return n;return e.netConnections.find((o)=>o.pinIds.some((r)=>t.pinIds.includes(r)))?.netLabelHeight},L1n=(e)=>Number(e.toFixed(6)),Loi=(e,t,n)=>Math.abs(t.x-e.anchorPoint.x)<=Wu&&Math.abs(t.y-e.anchorPoint.y)<=Wu&&n===e.orientation,Hoi="blue",r7n="red",Foi=(e)=>{let t=J0(e.inputProblem);if(Goi(t),zoi(t,e.traces),Ooi(t,e.inputProblem,e.outputNetLabelPlacements),!e.solved)Voi(t,e),Yoi(t,e.currentCandidateResults);return t},zoi=(e,t)=>{for(let n of t)e.lines.push({points:n.tracePath,strokeColor:"purple"})},Ooi=(e,t,n)=>{for(let o of n)e.rects.push({center:o.center,width:o.width,height:o.height,fill:Ic(o.globalConnNetId,0.35),strokeColor:Ic(o.globalConnNetId,0.9),label:Uoi(t,o)}),e.points.push({x:o.anchorPoint.x,y:o.anchorPoint.y,color:Ic(o.globalConnNetId,0.9),label:`anchorPoint
orientation: ${o.orientation}`})},Voi=(e,t)=>{if(!t.currentOverlap)return;let n=t.currentOverlap.type==="trace"?[t.currentOverlap.labelIndex]:[t.currentOverlap.firstLabelIndex,t.currentOverlap.secondLabelIndex];for(let o of n){let r=t.outputNetLabelPlacements[o];if(!r)continue;e.rects.push({center:r.center,width:r.width,height:r.height,fill:"rgba(255, 0, 0, 0.2)",strokeColor:r7n,label:`netlabel overlap target
${r.netId??r.globalConnNetId}
${i7n(t.inputProblem,r)}`})}},Yoi=(e,t)=>{for(let n of t){let o=n.selected?Hoi:r7n;e.rects.push({center:n.center,width:n.width,height:n.height,fill:n.selected?"rgba(0, 0, 255, 0.2)":"rgba(255, 0, 0, 0.15)",strokeColor:o,strokeDash:n.selected?void 0:"4 2",label:`${n.selected?"selected":n.status} netlabel overlap candidate
trace: ${n.traceId}
path distance: ${n.pathDistance.toFixed(3)}
orientation: ${n.orientation}
distance from original: ${n.distanceFromOriginal.toFixed(3)}`}),e.points.push({...n.anchorPoint,color:o,label:`candidate anchor
${n.status}`})}},Goi=(e)=>{if(!e.lines)e.lines=[];if(!e.points)e.points=[];if(!e.rects)e.rects=[];if(!e.circles)e.circles=[];if(!e.texts)e.texts=[]},i7n=(e,t)=>`available orientations: ${Woi(e,t)?.join(", ")??"any"}`,Uoi=(e,t)=>[`netId: ${t.netId}`,`globalConnNetId: ${t.globalConnNetId}`,i7n(e,t)].join(`
`),Woi=(e,t)=>{let n=e.availableNetLabelOrientations??{};for(let o of[t.netId,t.globalConnNetId])if(o&&Object.hasOwn(n,o))return n[o];return},H1n=class extends mu{inputProblem;traces;netLabelPlacements;outputNetLabelPlacements;currentOverlap=null;currentCandidateResults=[];activeSearch=null;skippedOverlapKeys=new Set;overlapMode;netLabelConnectorTraceIds;constructor(e){super();this.overlapMode=e.overlapMode??"labels",this.netLabelConnectorTraceIds=e.netLabelConnectorTraceIds??new Set,this.inputProblem=e.inputProblem,this.traces=e.traces,this.netLabelPlacements=e.netLabelPlacements,this.outputNetLabelPlacements=[...e.netLabelPlacements]}getConstructorParams(){return{overlapMode:this.overlapMode,netLabelConnectorTraceIds:this.netLabelConnectorTraceIds,inputProblem:this.inputProblem,traces:this.traces,netLabelPlacements:this.netLabelPlacements}}_step(){if(this.activeSearch?.completed)this.clearActiveSearch();let e=this.getNextSearchWithCandidates();if(!e){this.finish();return}this.evaluateNextCandidate(e)}getOutput(){return{netLabelPlacements:this.outputNetLabelPlacements}}findNextOverlap(){if(this.overlapMode==="traces")return this.findNextTraceOverlap();for(let e=0;e<this.outputNetLabelPlacements.length;e++)for(let t=e+1;t<this.outputNetLabelPlacements.length;t++){if(!this.isLabelEligible(e)&&!this.isLabelEligible(t))continue;let n={type:"labels",firstLabelIndex:e,secondLabelIndex:t};if(this.skippedOverlapKeys.has(this.getOverlapKey(n)))continue;if(this.labelsOverlap(n))return n}return null}findNextTraceOverlap(){for(let e=0;e<this.outputNetLabelPlacements.length;e++){if(!this.isLabelEligible(e))continue;let t=this.outputNetLabelPlacements[e],n=Vhe(t);for(let o of this.traces){if(o.globalConnNetId===t.globalConnNetId)continue;let r={type:"trace",labelIndex:e,traceId:o.mspPairId};if(this.skippedOverlapKeys.has(this.getOverlapKey(r)))continue;if(D1n(n,o))return r}}return null}isLabelEligible(e){return this.getTraceLocationsForLabel(e).length>0}labelsOverlap(e){let t=this.outputNetLabelPlacements[e.firstLabelIndex],n=this.outputNetLabelPlacements[e.secondLabelIndex];if(!t||!n)return!1;return T1n(Vhe(t),Vhe(n))}startNextOverlapSearch(){let e=this.findNextOverlap();if(!e)return null;let t={overlap:e,queuedLabelIndices:this.getMoveLabelIndices(e),labelIndex:null,candidates:[],candidateIndex:0,candidateResults:[],completed:!1};return this.setActiveSearch(t),t}getMoveLabelIndices(e){if(e.type==="trace")return[e.labelIndex];let t=[];if(this.isLabelEligible(e.secondLabelIndex))t.push(e.secondLabelIndex);if(this.isLabelEligible(e.firstLabelIndex))t.push(e.firstLabelIndex);return t}getNextSearchWithCandidates(){while(!0){let e=this.activeSearch??this.startNextOverlapSearch();if(!e)return null;if(this.activateNextLabelSearch(e))return e;this.skipSearch(e)}}activateNextLabelSearch(e){if(e.labelIndex!==null&&e.candidateIndex<e.candidates.length)return!0;while(e.queuedLabelIndices.length>0){let t=e.queuedLabelIndices.shift(),n=this.outputNetLabelPlacements[t];if(!n)continue;if(e.labelIndex=t,e.candidates=this.getCandidatesForLabel(n),e.candidateIndex=0,e.candidates.length>0)return!0}return e.labelIndex=null,e.candidates=[],e.candidateIndex=0,!1}skipSearch(e){this.skippedOverlapKeys.add(this.getOverlapKey(e.overlap)),this.clearActiveSearch()}evaluateNextCandidate(e){let t=e.labelIndex;if(t===null)return;let n=this.outputNetLabelPlacements[t],o=e.candidates[e.candidateIndex];if(!n||!o)return;e.candidateIndex+=1;let r={...o,status:this.getCandidateStatus(o,t)};if(e.candidateResults.push(r),r.status!=="valid")return;r.selected=!0,this.applyCandidate(t,n,r),e.completed=!0}getCandidatesForLabel(e){let t=[];for(let n of N1n(e.anchorPoint,this.traces).filter(({trace:o})=>this.isHostTraceForLabel(o,e)))t.push(...Ioi({inputProblem:this.inputProblem,label:e,traceLocation:n}));return t}getCandidateStatus(e,t){let n=Vhe(e);if(this.intersectsAnyChip(n))return"chip-collision";if(DZ(n,this.inputProblem))return"text-collision";if(_oi(n,this.traces))return"trace-collision";if(this.overlapMode==="traces"&&this.traces.some((o)=>o.globalConnNetId!==this.outputNetLabelPlacements[t].globalConnNetId&&D1n(n,o)))return"trace-collision";if(this.intersectsAnyOtherLabel(n,t))return"netlabel-collision";return"valid"}applyCandidate(e,t,n){this.outputNetLabelPlacements[e]={...t,anchorPoint:n.anchorPoint,center:n.center,width:n.width,height:n.height,orientation:n.orientation}}intersectsAnyChip(e){return this.inputProblem.chips.some((t)=>moi(e,zi(t.center,t.width,t.height)))}intersectsAnyOtherLabel(e,t){return this.outputNetLabelPlacements.some((n,o)=>{if(o===t)return!1;return T1n(e,Vhe(n))})}getTraceLocationsForLabel(e){let t=this.outputNetLabelPlacements[e];if(!t)return[];return N1n(t.anchorPoint,this.traces).filter(({trace:n})=>this.isHostTraceForLabel(n,t))}isHostTraceForLabel(e,t){if(this.netLabelConnectorTraceIds.has(e.mspPairId))return!1;if(t.mspConnectionPairIds.includes(e.mspPairId))return!0;if(t.netId!==void 0&&t.netId===e.userNetId)return!0;return t.globalConnNetId===e.globalConnNetId}getOverlapKey(e){if(e.type==="trace"){let o=this.outputNetLabelPlacements[e.labelIndex];return["trace",e.traceId,e.labelIndex,o.anchorPoint.x,o.anchorPoint.y,o.orientation].join(":")}let t=this.outputNetLabelPlacements[e.firstLabelIndex],n=this.outputNetLabelPlacements[e.secondLabelIndex];return[e.firstLabelIndex,e.secondLabelIndex,t?.anchorPoint.x,t?.anchorPoint.y,n?.anchorPoint.x,n?.anchorPoint.y].join(":")}finish(){this.clearActiveSearch(),this.solved=!0}setActiveSearch(e){this.activeSearch=e,this.currentOverlap=e.overlap,this.currentCandidateResults=e.candidateResults}clearActiveSearch(){this.activeSearch=null,this.currentOverlap=null,this.currentCandidateResults=[]}visualize(){return Foi({inputProblem:this.inputProblem,traces:this.traces,outputNetLabelPlacements:this.outputNetLabelPlacements,currentOverlap:this.currentOverlap,currentCandidateResults:this.currentCandidateResults,solved:this.solved})}},Xoi=0.000001;function joi(e){let{point:t,segmentStart:n,segmentEnd:o}=e,r=o.x-n.x,i=o.y-n.y,s=r*r+i*i;if(s===0)return{x:n.x,y:n.y};let a=((t.x-n.x)*r+(t.y-n.y)*i)/s,c=Math.max(0,Math.min(1,a));return{x:n.x+c*r,y:n.y+c*i}}function s7n(e,t){let n=t[0],o=1/0;for(let r=0;r<t.length-1;r++){let i=joi({point:e,segmentStart:t[r],segmentEnd:t[r+1]}),s=i.x-e.x,a=i.y-e.y,c=s*s+a*a;if(c<o)o=c,n=i}return n}function F1n(e,t){let n=s7n(e,t);return Math.hypot(n.x-e.x,n.y-e.y)<Xoi}function Koi(e,t){let o=(m)=>zi(m.center,m.width,m.height),r=(m,A)=>{let g=o(m),f=o(A);return g.minX<=f.maxX+0.01&&g.maxX>=f.minX-0.01&&g.minY<=f.maxY+0.01&&g.maxY>=f.minY-0.01},i=new Set([e]),s=!0;while(s){s=!1;for(let m of t){if(i.has(m))continue;if([...i].some((A)=>r(A,m)))i.add(m),s=!0}}let a=1/0,c=1/0,l=-1/0,h=-1/0;for(let m of i){let A=o(m);if(A.minX<a)a=A.minX;if(A.minY<c)c=A.minY;if(A.maxX>l)l=A.maxX;if(A.maxY>h)h=A.maxY}let d=(a+l)/2,u=(c+h)/2,_=l-a,p=h-c;return{...e,center:{x:d,y:u},width:_,height:p}}function $oi(e,t){let n=[];for(let o of e)for(let r of t){if(o.globalConnNetId===r.globalConnNetId)continue;let i=zi(r.center,r.width,r.height),s=o.tracePath;for(let a=0;a<s.length-1;a++)if(H9(s[a],s[a+1],i)){n.push({trace:o,label:r});break}}return n}var qoi=0.1,Joi=3,z1n=class extends mu{inputProblem;traces;netLabelPlacements;outputTraces;outputNetLabelPlacements;completedReroutes=[];activeSubSolver=null;recentlyFailed=new Set;detourCounts=new Map;currentOverlap=null;constructor(e){super();this.inputProblem=e.inputProblem,this.traces=e.traces,this.netLabelPlacements=e.netLabelPlacements,this.outputTraces=[...e.traces],this.outputNetLabelPlacements=[...e.netLabelPlacements]}getConstructorParams(){return{inputProblem:this.inputProblem,traces:this.traces,netLabelPlacements:this.netLabelPlacements}}_step(){if(this.activeSubSolver){if(this.activeSubSolver.step(),this.activeSubSolver.solved){let a=this.activeSubSolver.solvedTracePath;if(a){this.completedReroutes.push({initialTrace:{...this.activeSubSolver.initialTrace,tracePath:this.activeSubSolver.initialTrace.tracePath.map((l)=>({...l}))},reroutedTracePath:a.map((l)=>({...l})),label:this.activeSubSolver.label,detourCount:this.activeSubSolver.detourCount});let c=this.outputTraces.findIndex((l)=>l.mspPairId===this.activeSubSolver.initialTrace.mspPairId);if(c!==-1){let l=this.outputTraces[c].tracePath;this.outputTraces[c]={...this.outputTraces[c],tracePath:a},this.reanchorLabelsOnMovedTrace(this.outputTraces[c],l)}}this.activeSubSolver=null,this.currentOverlap=null}else if(this.activeSubSolver.failed){let a=this.getOverlapKey(this.activeSubSolver.initialTrace,this.activeSubSolver.label);this.recentlyFailed.add(a),this.activeSubSolver=null,this.currentOverlap=null}return}let t=$oi(this.outputTraces,this.outputNetLabelPlacements).filter((a)=>{let c=this.getOverlapKey(a.trace,a.label);return!this.recentlyFailed.has(c)});if(t.length===0){this.solved=!0;return}let n=t[0],o=this.outputTraces.find((a)=>a.mspPairId===n.trace.mspPairId);this.currentOverlap=n;let r=Koi(n.label,this.outputNetLabelPlacements.filter((a)=>a.globalConnNetId!==o.globalConnNetId)),i=`${n.trace.mspPairId}::merged::${r.center.x},${r.center.y},${r.width},${r.height}`,s=this.detourCounts.get(i)??0;if(s>=Joi){this.recentlyFailed.add(this.getOverlapKey(n.trace,n.label)),this.currentOverlap=null;return}this.detourCounts.set(i,s+1),this.activeSubSolver=new Hve({trace:o,label:r,problem:this.inputProblem,paddingBuffer:qoi,detourCount:s,tracesToAvoidOverlapping:this.outputTraces,netLabelPlacements:this.outputNetLabelPlacements})}reanchorLabelsOnMovedTrace(e,t){for(let n=0;n<this.outputNetLabelPlacements.length;n++){let o=this.outputNetLabelPlacements[n];if(o.globalConnNetId!==e.globalConnNetId)continue;if(F1n(o.anchorPoint,e.tracePath))continue;if(!F1n(o.anchorPoint,t))continue;let r=s7n(o.anchorPoint,e.tracePath);this.outputNetLabelPlacements[n]={...o,anchorPoint:r,center:kf(r,o.orientation,o.width,o.height)}}}getOutput(){return{traces:this.outputTraces,completedReroutes:this.completedReroutes,netLabelPlacements:this.outputNetLabelPlacements}}getOverlapKey(e,t){return`${e.mspPairId}::${t.globalConnNetId}`}visualize(){if(this.activeSubSolver)return this.activeSubSolver.visualize();let e=J0(this.inputProblem);if(!e.lines)e.lines=[];if(!e.rects)e.rects=[];if(!e.points)e.points=[];for(let t of this.outputTraces)e.lines.push({points:t.tracePath,strokeColor:"purple"});for(let t of this.outputNetLabelPlacements)e.rects.push({center:t.center,width:t.width,height:t.height,fill:Ic(t.globalConnNetId,0.35),strokeColor:Ic(t.globalConnNetId,0.9),label:`netId: ${t.netId}
globalConnNetId: ${t.globalConnNetId}`}),e.points.push({x:t.anchorPoint.x,y:t.anchorPoint.y,color:Ic(t.globalConnNetId,0.9)});if(this.currentOverlap)e.lines.push({points:this.currentOverlap.trace.tracePath,strokeColor:"red"}),e.rects.push({center:this.currentOverlap.label.center,width:this.currentOverlap.label.width,height:this.currentOverlap.label.height,fill:"rgba(255,0,0,0.3)",strokeColor:"red"});return e}},I0=(e)=>{if(e.orientation!=="x-"&&e.orientation!=="x+"){if(e.netLabelText&&e.width>e.height){let{height:r,width:i}=e,s=kf(e.anchorPoint,e.orientation,r,i);return zi(s,r,i)}return zi(e.center,e.width,e.height)}let t=Math.max(e.width,e.height),n=uat,o=kf(e.anchorPoint,e.orientation,t,n);return zi(o,t,n)},O1n=0.0001,bnt=0.000001,Zoi=0.1,eri={"x+":{x:1,y:0},"x-":{x:-1,y:0},"y+":{x:0,y:1},"y-":{x:0,y:-1}},tri={ok:"green","label-collision":"orange","trace-collision":"darkorange","chip-collision":"red","text-collision":"purple"},nri={ok:"rgba(0, 200, 0, 0.25)","label-collision":"rgba(255, 160, 0, 0.2)","trace-collision":"rgba(200, 80, 0, 0.2)","chip-collision":"rgba(220, 0, 0, 0.15)","text-collision":"rgba(128, 0, 128, 0.15)"};function V1n(e,t){return e.minX<t.maxX-0.000000001&&e.maxX>t.minX+0.000000001&&e.minY<t.maxY-0.000000001&&e.maxY>t.minY+0.000000001}function ori(e,t){let n=t.x-e.x,o=t.y-e.y,r=Math.sqrt(n*n+o*o),i=Math.max(1,Math.round(r/Zoi)),s=[];for(let a=0;a<=i;a++){let c=a/i;s.push({x:e.x+c*n,y:e.y+c*o})}return s}var Mat=class extends mu{constructor(e){super();this.params=e,this.inputProblem=e.inputProblem,this.traces=e.traces,this.netLabelPlacements=e.netLabelPlacements,this.outputNetLabelPlacements=[...e.netLabelPlacements],this.chipIndex=e.inputProblem._chipObstacleSpatialIndex??(e.inputProblem.chips.length>0?new O7e(e.inputProblem.chips):void 0),this.traceMap=Object.fromEntries(e.traces.map((t)=>[t.mspPairId,t]))}params;inputProblem;traces;netLabelPlacements;outputNetLabelPlacements;currentCollision=null;currentLabelToMove=null;candidateResults=[];chipIndex;traceMap;skippedCollisionKeys=new Set;labelsToTry=[];candidateQueue=[];candidateIndex=0;getConstructorParams(){return{inputProblem:this.inputProblem,traces:this.traces,netLabelPlacements:this.netLabelPlacements,fixedNetLabelPlacements:this.params.fixedNetLabelPlacements,useRenderedLabelBounds:this.params.useRenderedLabelBounds,preserveNonInlineLabelsAgainstInlineEligibleCollisions:this.params.preserveNonInlineLabelsAgainstInlineEligibleCollisions}}getOutput(){return{netLabelPlacements:this.outputNetLabelPlacements}}labelBounds(e){if(!this.params.useRenderedLabelBounds||this.params.fixedNetLabelPlacements?.includes(e))return zi(e.center,e.width,e.height);return I0(e)}collisionKey(e,t){return[e.globalConnNetId,t.globalConnNetId].sort().join("::")}isSingleTerminalInlineEligible(e){if(!e.netId)return!1;return[...this.inputProblem.netConnections,...this.inputProblem.directConnections].some((t)=>t.allowInlineNetLabel&&t.pinIds.length===1&&t.netId===e.netId&&e.pinIds.every((n)=>t.pinIds.includes(n)))}hasSatisfiedSingleOrientation(e){if(!e.netId)return!1;let t=this.inputProblem.availableNetLabelOrientations[e.netId];return t?.length===1&&t[0]===e.orientation}isAlignedWithHostTrace(e){let t=e.orientation.startsWith("x")?"x":"y";return e.mspConnectionPairIds.some((n)=>{let o=this.traceMap[n];return o?.tracePath.slice(1).some((r,i)=>{let s=o.tracePath[i];if(!Ts([s,r],e.anchorPoint))return!1;return(Math.abs(s.x-r.x)<bnt?"y":"x")===t})})}isProtectedAgainstTemporaryInlineCollision(e){return!this.isSingleTerminalInlineEligible(e)&&this.hasSatisfiedSingleOrientation(e)&&this.isAlignedWithHostTrace(e)}findNextCollidingPair(){let e=[...this.outputNetLabelPlacements,...this.params.fixedNetLabelPlacements??[]];for(let t=0;t<this.outputNetLabelPlacements.length;t++)for(let n=t+1;n<e.length;n++){let o=e[t],r=e[n];if(o.globalConnNetId===r.globalConnNetId&&!this.params.fixedNetLabelPlacements?.includes(r))continue;if(this.skippedCollisionKeys.has(this.collisionKey(o,r)))continue;if(V1n(this.labelBounds(o),this.labelBounds(r)))return[o,r]}return null}netLabelWidthOf(e){if(e.orientation==="x+"||e.orientation==="x-")return e.width;return e.height}netLabelHeightOf(e){if(e.orientation==="x+"||e.orientation==="x-")return e.height;return e.width}buildCandidatesForLabel(e){let t=this.netLabelWidthOf(e),n=this.netLabelHeightOf(e),o=[],r=(c,l,h,d)=>{let{width:u,height:_}=S9({orientation:c,netLabelWidth:t,netLabelHeight:n}),p=kf(l,c,u,_),m=eri[c],A={x:p.x+m.x*O1n,y:p.y+m.y*O1n};return{orientation:c,anchor:l,center:A,width:u,height:_,bounds:this.params.useRenderedLabelBounds?I0({...e,orientation:c,anchorPoint:l,center:A,width:u,height:_}):zi(A,u,_),hostPairId:h,hostSegIndex:d,status:null}},i=e.mspConnectionPairIds.some((c)=>{let l=this.traceMap[c];return l&&Ts(l.tracePath,e.anchorPoint)}),s=this.traces.some((c)=>(this.params.netLabelConnectorTraceIds?.has(c.mspPairId)||!i&&!e.mspConnectionPairIds.includes(c.mspPairId))&&c.globalConnNetId===e.globalConnNetId&&Ts(c.tracePath,e.anchorPoint));if(e.mspConnectionPairIds.length===0||s){let c=["x+","x-","y+","y-"],l=[e.orientation,...c.filter((h)=>h!==e.orientation)];for(let h of l)o.push(r(h,e.anchorPoint))}else for(let c of e.mspConnectionPairIds){let l=this.traceMap[c];if(!l)continue;let h=l.tracePath;for(let d=0;d<h.length-1;d++){let u=h[d],_=h[d+1],p=Math.abs(u.y-_.y)<bnt,m=Math.abs(u.x-_.x)<bnt;if(!p&&!m)continue;let A;if(p)A=["y+","y-"];else A=["x+","x-"];for(let g of ori(u,_))for(let f of A)o.push(r(f,g,c,d))}}let a=e.netId?this.inputProblem.availableNetLabelOrientations[e.netId]:void 0;return s&&a?.length?o.filter((c)=>a.includes(c.orientation)):o}checkCandidate(e,t,n){let{bounds:o,hostPairId:r,hostSegIndex:i}=e;if((this.chipIndex?.getChipsInBounds(o).length??0)>0)return"chip-collision";if(DZ(o,this.inputProblem))return"text-collision";if(Aat(o,this.traceMap,r,i).hasIntersection)return"trace-collision";for(let s of n){if(s.globalConnNetId===t&&!this.params.fixedNetLabelPlacements?.includes(s))continue;if(V1n(o,this.labelBounds(s)))return"label-collision"}return"ok"}beginSearchForLabel(e){this.currentLabelToMove=e,this.candidateQueue=this.buildCandidatesForLabel(e),this.candidateIndex=0,this.candidateResults=[]}getNearbyValidPlacements(e,t){let n=(r)=>Math.hypot(r.anchor.x-e.anchorPoint.x,r.anchor.y-e.anchorPoint.y),o=[...this.outputNetLabelPlacements.filter((r)=>r!==e),...this.params.fixedNetLabelPlacements??[]];return this.buildCandidatesForLabel(e).filter((r)=>n(r)<=t&&this.checkCandidate(r,e.globalConnNetId,o)==="ok").sort((r,i)=>n(r)-n(i)).map((r)=>({...e,orientation:r.orientation,anchorPoint:r.anchor,center:r.center,width:r.width,height:r.height}))}clearActiveSearch(){this.currentCollision=null,this.currentLabelToMove=null,this.labelsToTry=[],this.candidateQueue=[],this.candidateIndex=0,this.candidateResults=[]}_step(){if(!this.currentCollision){let s=this.findNextCollidingPair();if(!s){this.solved=!0;return}if(this.currentCollision=s,this.labelsToTry=[s[1],s[0]].filter((a)=>!(this.params.fixedNetLabelPlacements??[]).includes(a)),this.params.preserveNonInlineLabelsAgainstInlineEligibleCollisions&&s.some((a)=>this.isSingleTerminalInlineEligible(a))&&s.some((a)=>this.isProtectedAgainstTemporaryInlineCollision(a)))this.labelsToTry=this.labelsToTry.filter((a)=>this.isSingleTerminalInlineEligible(a)||!this.isProtectedAgainstTemporaryInlineCollision(a));if(this.labelsToTry.length===0){this.skippedCollisionKeys.add(this.collisionKey(s[0],s[1])),this.clearActiveSearch();return}this.beginSearchForLabel(this.labelsToTry.shift());return}if(this.candidateIndex>=this.candidateQueue.length){if(this.labelsToTry.length>0)this.beginSearchForLabel(this.labelsToTry.shift());else this.skippedCollisionKeys.add(this.collisionKey(this.currentCollision[0],this.currentCollision[1])),this.clearActiveSearch();return}let e=this.candidateQueue[this.candidateIndex++],[t,n]=this.currentCollision,o;if(this.currentLabelToMove===n)o=t;else o=n;let r=[...[...this.outputNetLabelPlacements,...this.params.fixedNetLabelPlacements??[]].filter((s)=>s!==t&&s!==n),o],i=this.checkCandidate(e,this.currentLabelToMove.globalConnNetId,r);if(e.status=i,this.candidateResults.push({...e}),i==="ok"){let s=this.outputNetLabelPlacements.indexOf(this.currentLabelToMove);if(s!==-1)this.outputNetLabelPlacements[s]={...this.currentLabelToMove,orientation:e.orientation,anchorPoint:e.anchor,width:e.width,height:e.height,center:e.center};this.clearActiveSearch()}}visualize(){let e=J0(this.inputProblem);if(!e.lines)e.lines=[];if(!e.rects)e.rects=[];if(!e.points)e.points=[];for(let n of this.traces)e.lines.push({points:n.tracePath,strokeColor:"purple"});for(let n of this.outputNetLabelPlacements){let o=this.currentCollision!=null&&(n===this.currentCollision[0]||n===this.currentCollision[1]),r,i,s,a;if(o)r="rgba(255, 0, 0, 0.2)",i="red",s=`netId: ${n.netId}
globalConnNetId: ${n.globalConnNetId}
⚠ COLLIDING`,a="red";else r=Ic(n.globalConnNetId,0.35),i=Ic(n.globalConnNetId,0.9),s=`netId: ${n.netId}
globalConnNetId: ${n.globalConnNetId}`,a=Ic(n.globalConnNetId,0.9);e.rects.push({center:n.center,width:n.width,height:n.height,fill:r,strokeColor:i,label:s}),e.points.push({x:n.anchorPoint.x,y:n.anchorPoint.y,color:a,label:`anchorPoint
orientation: ${n.orientation}`})}let t=this.currentLabelToMove?this.currentLabelToMove.netId:"?";for(let n of this.candidateResults){let o=tri[n.status],r=nri[n.status],i;if(n.status!=="ok")i="4 2";e.rects.push({center:n.center,width:n.width,height:n.height,fill:r,strokeColor:o,strokeDash:i,label:`candidate: ${n.status}
orientation: ${n.orientation}
moving: ${t}`}),e.points.push({x:n.anchor.x,y:n.anchor.y,color:o,label:`candidate anchor
${n.status}`})}return e}},Rf=0.2,uue=0.000000001,rri="GND",_Y=(e,t)=>Math.abs(e.x-t.x)<=uue&&Math.abs(e.y-t.y)<=uue,FJ=(e)=>{let t=[];for(let n of e){let o=t.at(-1);if(!o||!_Y(o,n))t.push(n)}return t},fk=(e)=>{let t=0;for(let n=0;n<e.length-1;n++){let o=e[n],r=e[n+1];t+=Math.abs(r.x-o.x)+Math.abs(r.y-o.y)}return t},Yrt=({pin:e,facingDirection:t})=>{let n={x:e.x,y:e.y};if(t==="x+")n.x+=Rf;if(t==="x-")n.x-=Rf;if(t==="y+")n.y+=Rf;if(t==="y-")n.y-=Rf;return n},a7n=(e)=>({minX:Math.min(...e.map((t)=>t.minX)),minY:Math.min(...e.map((t)=>t.minY)),maxX:Math.max(...e.map((t)=>t.maxX)),maxY:Math.max(...e.map((t)=>t.maxY))}),Y1n=({connectionPair:e,obstacles:t,channelObstacles:n=t})=>{let[o,r]=e.pins,i=Yrt({pin:o,facingDirection:o._facingDirection}),s=Yrt({pin:r,facingDirection:r._facingDirection}),a=a7n(t),c=[a.minY-Rf,a.maxY+Rf,...n.flatMap((d)=>[d.minY-Rf,d.maxY+Rf])],l=[a.minX-Rf,a.maxX+Rf,...n.flatMap((d)=>[d.minX-Rf,d.maxX+Rf])],h=[pat({...o,facingDirection:o._facingDirection},{...r,facingDirection:r._facingDirection},{overshoot:Rf})];for(let d of new Set(c))h.push(FJ([o,i,{x:i.x,y:d},{x:s.x,y:d},s,r]));for(let d of new Set(l))h.push(FJ([o,i,{x:d,y:i.y},{x:d,y:s.y},s,r]));return h.sort((d,u)=>fk(d)-fk(u))},iri=(e,t)=>({x:(e.x+t.x)/2,y:(e.y+t.y)/2}),sri=(e)=>{let t=[];for(let n of e){for(let r=0;r<n.tracePath.length-1;r++){let i=n.tracePath[r],s=n.tracePath[r+1];t.push(i),t.push(iri(i,s))}let o=n.tracePath.at(-1);if(o)t.push(o)}return t},ari=({connectionPair:e,sameNetTraces:t})=>{let n=new Set(t.flatMap((o)=>o.pinIds));return e.pins.filter((o)=>!n.has(o.pinId))},cri=(e,t)=>{for(let n=0;n<e.length-1;n++)for(let o=0;o<t.length-1;o++)if(Z4(e[n],e[n+1],t[o],t[o+1]))return!0;return!1},lri=({connectionPair:e,sameNetTraces:t})=>{let[n,o]=e.pins,r=new Set(t.flatMap((s,a)=>s.pinIds.includes(n.pinId)?[a]:[])),i=-1;while(r.size!==i){i=r.size;for(let s=0;s<t.length;s++){if(r.has(s))continue;let a=t[s];if([...r].some((l)=>{let h=t[l];return a.pinIds.some((d)=>h.pinIds.includes(d))||cri(a.tracePath,h.tracePath)}))r.add(s)}}return[...r].some((s)=>t[s].pinIds.includes(o.pinId))},hri=({connectionPair:e,sameNetTraces:t,obstacles:n,maxConnectionDistance:o})=>{let r=a7n(n),i=[r.minY-Rf,r.maxY+Rf],s=[r.minX-Rf,r.maxX+Rf],a=[],c=sri(t),l=ari({connectionPair:e,sameNetTraces:t});for(let h of l){let d=Yrt({pin:h,facingDirection:h._facingDirection});for(let u of c){if(k9(h,u)>o)continue;a.push(FJ([h,d,{x:d.x,y:u.y},u])),a.push(FJ([h,d,{x:u.x,y:d.y},u]));for(let _ of i)a.push(FJ([h,d,{x:d.x,y:_},{x:u.x,y:_},u]));for(let _ of s)a.push(FJ([h,d,{x:_,y:d.y},{x:_,y:u.y},u]))}}return a.sort((h,d)=>fk(h)-fk(d))},dri=({path:e,obstacles:t,connectionPair:n,rejectComponentBoundaryTravel:o})=>{let r=e[0],i=e.at(-1),s=n.pins.find((u)=>_Y(u,r)),a=n.pins.find((u)=>_Y(u,i));for(let[u,_]of[[s,e[1]],[a,e[e.length-2]]]){if(!u?._facingDirection)continue;let p=j0(u._facingDirection);if((_.x-u.x)*p.x+(_.y-u.y)*p.y<-uue)return!0}let c=s!==void 0&&a!==void 0,l=t.find((u)=>u.kind==="chip"&&u.chipId===s?.chipId),h=t.find((u)=>u.kind==="chip"&&u.chipId===a?.chipId);if(o&&l&&H8e(e[0],e[1],l))return!0;if(o&&h&&H8e(e[e.length-2],e[e.length-1],h))return!0;return CB(e,t,{excludeRectsForSegment:(u)=>{let _=new Set;if(u===0&&l)_.add(l);if(c&&u===e.length-2&&h)_.add(h);return _}})!==null},uri=({connectionPair:e,failedConnectionPairs:t})=>{let n=new Set(e.pins.map((o)=>o.chipId));return t.some((o)=>{if(o.mspPairId===e.mspPairId)return!1;return o.pins.every((r)=>n.has(r.chipId))})},pri=({firstStart:e,firstEnd:t,secondStart:n,secondEnd:o})=>{if(Ag(e,t)&&Ag(n,o))return Math.min(Math.max(e.x,t.x),Math.max(n.x,o.x))-Math.max(Math.min(e.x,t.x),Math.min(n.x,o.x))>uue;if(MA(e,t)&&MA(n,o))return Math.min(Math.max(e.y,t.y),Math.max(n.y,o.y))-Math.max(Math.min(e.y,t.y),Math.min(n.y,o.y))>uue;return!1},mri=({connectionPair:e,existingTrace:t})=>{let n=new Set(t.pinIds);return e.pins.filter((o)=>n.has(o.pinId))},_ri=({path:e,connectionPair:t,existingTraces:n})=>{for(let o of n){if(o.globalConnNetId===t.globalConnNetId)continue;let r=mri({connectionPair:t,existingTrace:o});for(let i=0;i<e.length-1;i++){let s=e[i],a=e[i+1];for(let c=0;c<o.tracePath.length-1;c++){let l=o.tracePath[c],h=o.tracePath[c+1];if(!Z4(s,a,l,h))continue;if(r.some((u)=>(_Y(s,u)||_Y(a,u))&&(_Y(l,u)||_Y(h,u)))&&!pri({firstStart:s,firstEnd:a,secondStart:l,secondEnd:h}))continue;return!0}}}return!1},gri=class extends mu{constructor(e){super();this.params=e,this.inputProblem=e.inputProblem,this.alreadySolvedTraces=e.alreadySolvedTraces,this.failedConnectionPairs=e.failedConnectionPairs,this.queuedConnectionPairs=[...e.failedConnectionPairs],this.maxConnectionDistance=this.inputProblem.maxMspPairDistance??Wue;let{netConnMap:t}=Qb(this.inputProblem);this.groundGlobalConnNetId=t.getNetConnectedToId(rri)??void 0}params;inputProblem;alreadySolvedTraces;failedConnectionPairs;queuedConnectionPairs;maxConnectionDistance;groundGlobalConnNetId;solvedUnroutedTraces=[];getConstructorParams(){return this.params}_step(){let e=this.queuedConnectionPairs.shift();if(!e){this.solved=!0;return}if(e.globalConnNetId===this.groundGlobalConnNetId)return;if(k9(e.pins[0],e.pins[1])>this.maxConnectionDistance)return;let t=wy(this.inputProblem),n=[...this.alreadySolvedTraces,...this.solvedUnroutedTraces],o=n.filter((l)=>l.globalConnNetId===e.globalConnNetId);if(lri({connectionPair:e,sameNetTraces:o}))return;let r=hri({connectionPair:e,sameNetTraces:o,obstacles:t,maxConnectionDistance:this.maxConnectionDistance}),i=Y1n({connectionPair:e,obstacles:t,channelObstacles:[]}),s=[...r,...i].sort((l,h)=>fk(l)-fk(h)),a=uri({connectionPair:e,failedConnectionPairs:this.failedConnectionPairs}),c;for(let l of s){if(c&&fk(l)>=fk(c))continue;if(dri({path:l,obstacles:t,connectionPair:e,rejectComponentBoundaryTravel:a}))continue;if(_ri({path:l,connectionPair:e,existingTraces:n}))continue;if(!c)s.push(...Y1n({connectionPair:e,obstacles:t}));c=l}if(c)this.solvedUnroutedTraces.push({...e,tracePath:c,mspConnectionPairIds:[e.mspPairId],pinIds:e.pins.map((l)=>l.pinId)})}getOutput(){return{newTraces:this.solvedUnroutedTraces,allTracesMerged:[...this.alreadySolvedTraces,...this.solvedUnroutedTraces]}}visualize(){let e=J0(this.inputProblem);for(let t of this.solvedUnroutedTraces)e.lines.push({points:t.tracePath,strokeColor:"blue"});return e}},lve=0.000001,Vve=({path:e,netLabelPlacements:t})=>{for(let n of t){let o=zi(n.center,n.width,n.height);for(let r=0;r<e.length-1;r++)if(H9(e[r],e[r+1],o))return!0}return!1},c7n=({path:e,netLabelPlacements:t})=>{for(let n of t){let o=zi(n.center,n.width,n.height),r={minX:o.minX+lve,minY:o.minY+lve,maxX:o.maxX-lve,maxY:o.maxY-lve};for(let i=0;i<e.length-1;i++)if(H9(e[i],e[i+1],r))return!0}return!1},pue=(e)=>{if(!e._facingDirection)return null;return j0(e._facingDirection).x===0?"y":"x"},U8e=({coordinate:e,axis:t,pin:n})=>{if(!n._facingDirection)return!1;let o=j0(n._facingDirection);return(e-n[t])*o[t]>0},Ari=(e,t)=>{if(o3(e,t))return"x";if(Y2(e,t))return"y";return null},G1n=(e)=>{let t=[];for(let n=0;n<e.length-1;n++){let o=e[n],r=e[n+1],i=Ari(o,r);if(!i)continue;let s=i==="x"?"y":"x";t.push({start:o,end:r,axis:i,coordinate:o[s]})}return t},U1n=({pin:e,departureAxis:t,railCoordinate:n})=>t==="x"?{x:n,y:e.y}:{x:e.x,y:n},fri=({donorPath:e,branchDepartureSegment:t,sharedPin:n,adjacentPin:o})=>{let r=pue(n);if(!r)return null;let i=r==="x"?"y":"x",s=G1n(t)[0];if(!s||s.axis!==r)return null;let a=null,c=Number.POSITIVE_INFINITY;for(let l of G1n(e)){if(l.axis!==i)continue;if(!U8e({coordinate:l.coordinate,axis:r,pin:n}))continue;let h=U1n({pin:n,departureAxis:r,railCoordinate:l.coordinate}),d=U1n({pin:o,departureAxis:r,railCoordinate:l.coordinate});if(!Ts([l.start,l.end],h)||!Ts([l.start,l.end],d)||!Ts([s.start,s.end],h))continue;let u=Math.abs(l.coordinate-n[r]);if(u>=c)continue;a={segment:l,sharedPinExit:h},c=u}return a},qY=({donorTrace:e,branchTrace:t})=>{let n=new Set(t.pins.map((o)=>o.pinId));return e.pins.find((o)=>n.has(o.pinId))??null},hve=(e,t)=>{if(ns(e.x,t.x))return"y";if(ns(e.y,t.y))return"x";return null},W1n=({trace:e,sharedPinId:t})=>{let n=vi(e.tracePath),o=e.pins.find((i)=>i.pinId===t);if(!o)return null;let r=e.pins[0]?.pinId===t?n:n.reverse();return bB(r[0],o)?r:null},dve=({trace:e,sharedPrefix:t,netLabelPlacements:n})=>!n.some((o)=>o.mspConnectionPairIds.includes(e.mspPairId)&&Ts(t,o.anchorPoint)),X1n=({trace:e,pathFromSharedPin:t,sharedPinId:n,branchPoint:o})=>{let r=t.findIndex((a,c)=>{let l=t[c+1];if(!l)return!1;return Ts([a,l],o)});if(r<0)return null;let i=vi([o,...t.slice(r+1)]),s=i;if(e.pins[0]?.pinId!==n)s=i.reverse();return{...e,tracePath:s}},yri=({traces:e,netLabelPlacements:t,netLabelConnectorTraceIds:n,multiPinNetPinIds:o})=>{let r=[...e];for(let i=0;i<r.length;i++){if(n.has(r[i].mspPairId))continue;for(let s=i+1;s<r.length;s++){let a=r[i],c=r[s];if(n.has(c.mspPairId)||a.globalConnNetId!==c.globalConnNetId)continue;let l=qY({donorTrace:a,branchTrace:c});if(!l||!o.has(l.pinId))continue;let h=W1n({trace:a,sharedPinId:l.pinId}),d=W1n({trace:c,sharedPinId:l.pinId});if(!h||!d)continue;if(h.length<2||d.length<2)continue;let u=hve(h[0],h[1]),_=hve(d[0],d[1]);if(!u||u!==_)continue;let p=h[1][u]-h[0][u],m=d[1][u]-d[0][u];if(!bB(h[1],d[1])&&Math.sign(p)===Math.sign(m)){let T=s,N=c,D=d;if(Math.abs(p)<Math.abs(m))T=i,N=a,D=h;let L=D[1];if(!dve({trace:N,sharedPrefix:[D[0],L],netLabelPlacements:t}))if(T===i)T=s,N=c,D=d;else T=i,N=a,D=h;if(!dve({trace:N,sharedPrefix:[D[0],L],netLabelPlacements:t}))continue;let H=X1n({trace:N,pathFromSharedPin:D,sharedPinId:l.pinId,branchPoint:L});if(!H)continue;r[T]=H;continue}if(h.length<3||d.length<3)continue;if(!bB(h[1],d[1]))continue;let A=hve(h[1],h[2]),g=hve(d[1],d[2]);if(!A||A!==g||A===u)continue;let f=h[2][A]-h[1][A],y=d[2][A]-d[1][A],x=Math.sign(f)===Math.sign(y),C=h.slice(0,2);if(!x&&!ns(Math.abs(f),Math.abs(y))&&t.some((T)=>T.globalConnNetId===a.globalConnNetId&&Ts(C,T.anchorPoint)))continue;let b=s,I=c,v=d,P=h[1];if(x&&Math.abs(f)<Math.abs(y))b=i,I=a,v=h,P=h[2];else if(x)P=d[2];let M=[v[0],v[1],P];if(!dve({trace:I,sharedPrefix:M,netLabelPlacements:t}))if(b===i)b=s,I=c,v=d;else b=i,I=a,v=h;if(!dve({trace:I,sharedPrefix:[v[0],v[1],P],netLabelPlacements:t}))continue;let B=X1n({trace:I,pathFromSharedPin:v,sharedPinId:l.pinId,branchPoint:P});if(!B)continue;r[b]=B}}return r},Grt=0.000001,j1n=(e,t)=>{let n=e.tracePath[0],o=e.tracePath.at(-1);if(!n||!o)return null;if(bB(n,t))return e.tracePath;if(bB(o,t))return[...e.tracePath].reverse();return null},xri=(e,t)=>{let n=[],o=e[0];for(let r=0;r<e.length-1;r++){let i=e[r],s=e[r+1],a=Pk(i,s);if(!a)continue;for(let c=0;c<t.length-1;c++){let l=t[c],h=t[c+1],d=Pk(l,h);if(!d||d===a)continue;let u=rP(i,s,l,h);if(!u||bB(u,o))continue;n.push({intersectionPoint:u,targetSegmentIndex:r,donorSegmentIndex:c})}}return n},Cri=(e,t,n)=>{let o=rP(e[t],e[t+1],e[n],e[n+1]);if(!o)return e;return vi([...e.slice(0,t+1),o,...e.slice(n+1)])},bri=({targetTrace:e,targetPath:t,donorPath:n,crossing:o})=>{let r=vi([...n.slice(0,o.donorSegmentIndex+1),o.intersectionPoint,...t.slice(o.targetSegmentIndex+1)]);if(bB(e.tracePath[0],t[0]))return r;return r.reverse()},Iri=({targetTrace:e,tracePath:t,netLabelPlacements:n})=>{let o=RZ({trace:e,originalTracePath:e.tracePath,reroutedTracePath:t,netLabelPlacements:n});for(let s=0;s<n.length;s++){let a=n[s];if(a.globalConnNetId!==e.globalConnNetId)continue;if(!Ts(e.tracePath,a.anchorPoint))continue;let c=o[s];if(!Ts(t,c.anchorPoint))return null}let r=o.filter((s)=>s.globalConnNetId!==e.globalConnNetId);if(Vve({path:t,netLabelPlacements:r}))return null;let i=o.filter((s)=>s.globalConnNetId===e.globalConnNetId);if(c7n({path:t,netLabelPlacements:i}))return null;return o},vri=(e,t)=>{if(!t)return!0;let n=e.netVisibleLength-t.netVisibleLength;if(Math.abs(n)>Grt)return n<0;return e.netVisibleSegmentCount<t.netVisibleSegmentCount},Sri=({targetTrace:e,traces:t,netLabelPlacements:n})=>{let o=t.filter((l)=>l.globalConnNetId===e.globalConnNetId),r=LS(o),i=LS([e]),s=null,a=(l)=>{let h={...e,tracePath:l};if(LS([h])>i+Grt)return;let u=Iri({targetTrace:e,tracePath:l,netLabelPlacements:n});if(!u)return;let _=o.map((A)=>{if(A.mspPairId===e.mspPairId)return h;return A}),p=LS(_);if(p>=r-Grt)return;let m={tracePath:l,netLabelPlacements:u,netVisibleLength:p,netVisibleSegmentCount:z8e(_)};if(vri(m,s))s=m},c=NY(e.tracePath,e.tracePath,{includeTerminalSegments:!0}).filter(({pathSegmentIndex:l,otherPathSegmentIndex:h})=>l<h);for(let l of c)a(Cri(e.tracePath,l.pathSegmentIndex,l.otherPathSegmentIndex));for(let l of o){if(l.mspPairId===e.mspPairId)continue;let h=qY({donorTrace:l,branchTrace:e});if(!h)continue;let d=j1n(e,h),u=j1n(l,h);if(!d||!u)continue;let _=xri(d,u);for(let p of _){let m=bri({targetTrace:e,targetPath:d,donorPath:u,crossing:p});a(m)}}return s},Pri=({traces:e,netLabelPlacements:t})=>{let n=[...e],o=[...t],r=0,i=0;while(i<n.length){let s=n[i],a=Sri({targetTrace:s,traces:n,netLabelPlacements:o});if(!a){i++;continue}n[i]={...s,tracePath:a.tracePath},o=a.netLabelPlacements,r++,i=0}return{traces:n,netLabelPlacements:o,collapsedCycleCount:r}},Urt=0.2,Eri=0.2,Mri=0.05,l7n=0.8,wri=0.05,Bri=(e)=>{let{netConnMap:t}=Qb(e),n=new Set(e.chips.flatMap((o)=>o.pins.map((r)=>r.pinId)));return new Set([...n].filter((o)=>{let r=t.getNetConnectedToId(o);if(!r)return!1;return t.getIdsConnectedToNet(r).filter((i)=>n.has(i)).length>2}))},SA=(e,t)=>{if(o3(e,t))return"x";if(Y2(e,t))return"y";return null},eP=({trace:e,sharedPin:t})=>e.pins.find((n)=>n.pinId!==t.pinId)??null,mue=(e)=>{let t=null;for(let n=0;n<e.tracePath.length-1;n++){let o=e.tracePath[n],r=e.tracePath[n+1];if(!o3(o,r))continue;if(!t||Math.abs(r.x-o.x)>Math.abs(t.end.x-t.start.x))t={start:o,end:r}}return t},Tri=({segment:e,sharedPin:t})=>{let n=Math.abs(e.start.x-t.x),o=Math.abs(e.end.x-t.x);if(n<=o)return e.start;return e.end},wde=({railY:e,pin:t})=>{if(t._facingDirection==="y+")return e>t.y;if(t._facingDirection==="y-")return e<t.y;return!1},Dri=({railY:e,pin:t})=>{if(t._facingDirection==="y+")return e>t.y;if(t._facingDirection==="y-")return e<t.y;return!1},Nri=({branchTrace:e,sharedPin:t,otherPin:n})=>{if(n._facingDirection!=="x-"&&n._facingDirection!=="x+")return null;let r=(e.pins[0].pinId===t.pinId?e.tracePath:[...e.tracePath].reverse()).at(-2);if(!r||!ns(r.y,n.y))return null;return(n._facingDirection==="x-"?r.x<n.x:r.x>n.x)?r:null},K1n=(e,t)=>t.flatMap((n,o)=>{if(J8n(n,e)&&Ts(e.tracePath,n.anchorPoint))return[o];return[]}),Rri=({trace:e,reroutedTracePath:t,netLabelPlacements:n,attachedLabelIndexes:o})=>{let r=o.map((a)=>n[a]),i=RZ({trace:e,originalTracePath:e.tracePath,reroutedTracePath:t,netLabelPlacements:r}),s=new Map(o.map((a,c)=>[a,i[c]]));return n.map((a,c)=>s.get(c)??a)},Qri=({donorTrace:e,branchTrace:t})=>{let n=qY({donorTrace:e,branchTrace:t});if(!n)return null;let o=eP({trace:e,sharedPin:n});if(!o)return null;let r=eP({trace:t,sharedPin:n});if(!r)return null;if(Math.abs(n.y-r.y)>Urt)return null;let i=mue(e);if(!i)return null;let s=mue(t);if(s&&ns(s.start.y,i.start.y))return null;if(o.chipId!==n.chipId&&r.chipId===n.chipId&&r._facingDirection===n._facingDirection&&s&&Math.abs(s.start.y-n.y)<Math.abs(i.start.y-n.y))return null;let a=wde({railY:i.start.y,pin:r}),c=Dri({railY:i.start.y,pin:n})&&Math.abs(i.start.y-n.y)<=Mri;if(!a&&!c)return null;let l=Tri({segment:i,sharedPin:n});if(!(o.x<l.x&&r.x>l.x||o.x>l.x&&r.x<l.x))return null;let d;if(!a&&c){let u=Nri({branchTrace:t,sharedPin:n,otherPin:r});if(!u)return null;d=vi([{x:n.x,y:n.y},{x:l.x,y:n.y},{x:l.x,y:l.y},{x:u.x,y:l.y},{x:u.x,y:r.y},{x:r.x,y:r.y}])}else d=vi([{x:n.x,y:n.y},{x:l.x,y:n.y},{x:l.x,y:l.y},{x:r.x,y:l.y},{x:r.x,y:r.y}]);if(t.pins[0].pinId===n.pinId)return d;return[...d].reverse()},kri=({donorTrace:e,branchTrace:t})=>{let n=qY({donorTrace:e,branchTrace:t});if(!n)return null;let o=eP({trace:e,sharedPin:n}),r=eP({trace:t,sharedPin:n});if(!o||!r)return null;let i=n._facingDirection,s=pue(n);if(!i||!s)return null;let a=s==="x"?"y":"x";if(o.chipId!==n.chipId||o._facingDirection!==i||!ns(o[s],n[s])||pue(r)!==a)return null;let c=Math.abs(o[a]-n[a]);if(c>Urt&&!ns(c,Urt))return null;let l=t.pins[0].pinId===n.pinId,h=vi(t.tracePath);if(!l)h.reverse();if(h.length<2)return null;let d=[h[0],h[1]],u=fri({donorPath:e.tracePath,branchDepartureSegment:d,sharedPin:n,adjacentPin:o});if(!u)return null;let _=o[a];if(!U8e({coordinate:_,axis:a,pin:r}))return null;let p={...u.sharedPinExit,[a]:_},m={x:r.x,y:r.y,[a]:_},A=vi([{x:n.x,y:n.y},u.sharedPinExit,p,m,{x:r.x,y:r.y}]);return l?A:A.reverse()},Int=({donorTrace:e,branchTrace:t,netLabelConnectorTraceIds:n,compactPinBankOnly:o=!1,outwardPinBankOnly:r=!1,traces:i})=>{if(n.has(e.mspPairId)||n.has(t.mspPairId))return null;let s=qY({donorTrace:e,branchTrace:t});if(!s)return null;let a=(O)=>{let U=vi(O.tracePath);return O.pins[0].pinId===s.pinId?U:[...U].reverse()},c=a(e),l=a(t);if(c.length<3||l.length<4)return null;let h=SA(c[0],c[1]),d=SA(l[0],l[1]);if(!h||!d)return null;if(h!==d){if(!ns(c[0].x,l[0].x)||!ns(c[0].y,l[0].y))return null;let O=SA(l[1],l[2]),U=SA(c[1],c[2]);if(O!==h||U!==d||pue(s)!==d||!U8e({coordinate:l[1][d],axis:d,pin:s}))return null;let j=c[1][h]-c[0][h],Y=l[2][O]-l[1][O];if(Math.sign(j)===Math.sign(Y))return null;let X=O==="x"?"y":"x",K=vi([l[0],{...l[2],[X]:c[0][X]},...l.slice(3)]);return t.pins[0].pinId===s.pinId?K:K.reverse()}let u=c[1][h]-c[0][h],_=l[1][d]-l[0][d];if(Math.sign(u)!==Math.sign(_))return null;let p=1,m=SA(c[1],c[2]),A=SA(l[1],l[2]);if(!m||m!==A||m===h)return null;let g=m==="x"&&ns(c[1].y,l[1].y)||m==="y"&&ns(c[1].x,l[1].x),f=eP({trace:e,sharedPin:s}),y=eP({trace:t,sharedPin:s}),x=y!==null&&!i.some((O)=>O.mspPairId!==t.mspPairId&&!n.has(O.mspPairId)&&O.pinIds.includes(y.pinId)),C=Math.abs(u)>Math.abs(_),b=f!==null&&Ts([l[1],l[2]],{x:f.x,y:f.y,[h]:l[1][h]});if(x&&C&&b)return null;if(g){if(p++,!c[p+2]||!l[p+2])return null;if(m=SA(c[p],c[p+1]),A=SA(l[p],l[p+1]),!m||m!==A)return null}let I=0;for(let O=1;O<l.length-2;O++)if(SA(l[O],l[O+1])===A)I++;if(I!==1)return null;let v=m==="x"?"y":"x",P=c[p][v],M=l[p][v],B=Math.abs(P-M),T=[...e.pins,...t.pins],N=p===1&&pue(s)===v&&T.every((O)=>O.chipId===s.chipId&&O._facingDirection===s._facingDirection&&ns(O[v],s[v]))&&U8e({coordinate:P,axis:v,pin:s});if(o&&(!N||Math.abs(P-s[v])>=Math.abs(M-s[v])))return null;if(r&&(!N||Math.abs(P-s[v])<=Math.abs(M-s[v])))return null;if(ns(P,M)||B>l7n&&!N)return null;let D=[c[p][m],c[p+1][m]].sort((O,U)=>O-U),L=[l[p][A],l[p+1][A]].sort((O,U)=>O-U);if(!(Math.min(D[1],L[1])>=Math.max(D[0],L[0])-0.000001))return null;let V=vi(l.map((O,U)=>U===p||U===p+1?{...O,[v]:P}:O));return t.pins[0].pinId===s.pinId?V:V.reverse()};var Lri=({donorTrace:e,connectorTrace:t,netLabelConnectorTraceIds:n})=>{if(n.has(e.mspPairId)||!n.has(t.mspPairId))return null;let o=(a)=>{if(a.length<3)return null;let c=a[0],l=a[1],h=a[2],d=SA(c,l),u=SA(l,h);if(!d||!u||d===u)return null;let _=e.tracePath.findIndex((C,b,I)=>{let v=I[b+1];return v&&SA(C,v)===d&&Ts([C,v],c)&&Ts([C,v],l)});if(_<0)return null;let p=e.tracePath[_],m=e.tracePath[_+1];if(ns(c.x,p.x)&&ns(c.y,p.y)||ns(c.x,m.x)&&ns(c.y,m.y))return null;let A=[_>0?[e.tracePath[_-1],p]:null,_+2<e.tracePath.length?[m,e.tracePath[_+2]]:null].flatMap((C)=>C&&SA(C[0],C[1])===u?[C]:[]);if(A.length===0)return null;let g=u==="x"?"y":"x",f=l[g],y=[l[u],h[u]].sort((C,b)=>C-b),x=A.map((C)=>({segment:C,coordinate:C[0][g],offset:Math.abs(C[0][g]-f)})).filter(({segment:C,offset:b})=>{if(b>l7n)return!1;let I=[C[0][u],C[1][u]].sort((M,B)=>M-B),v=Math.max(I[0],y[0]),P=Math.min(I[1],y[1]);return P>=v-0.000001&&Math.abs(P-v)<=0.000001}).sort((C,b)=>C.offset-b.offset)[0];if(!x||ns(x.offset,0))return null;return vi(a.map((C,b)=>b===1||b===2?{...C,[g]:x.coordinate}:C))},r=vi(t.tracePath),i=o(r);if(i)return i;let s=o([...r].reverse());return s?s.reverse():null},vnt=(e,t)=>{if(e.some((n)=>Ts(t,n))||t.some((n)=>Ts(e,n)))return!0;for(let n=1;n<e.length;n++)for(let o=1;o<t.length;o++)if(rP(e[n-1],e[n],t[o-1],t[o]))return!0;return!1},Hri=({originalTrace:e,candidateTrace:t,traces:n,preserveRemovedStems:o=!1})=>{let r=n.map((i)=>i.mspPairId===e.mspPairId?t:i);for(let i of n){if(i.mspPairId===e.mspPairId||i.globalConnNetId!==e.globalConnNetId||!vnt(e.tracePath,i.tracePath)||vnt(t.tracePath,i.tracePath))continue;let s=[0,i.tracePath.length-1].find((p)=>Ts(e.tracePath,i.tracePath[p]));if(s===void 0)return null;let a=i.tracePath[s];if(i.pins.some((p)=>ns(p.x,a.x)&&ns(p.y,a.y)))return null;let c=Iat(a,e.tracePath,t.tracePath);if(!c)return null;let l=s===0?1:s-1,h=i.tracePath[l];if(!h)return null;let d=SA(a,h)===SA(c,h),u=o&&SA(a,c)!==null&&e.tracePath.some((p,m)=>{let A=e.tracePath[m+1];return A&&Ts([p,A],a)&&Ts([p,A],c)});if(!d&&!u)return null;let _={...i,tracePath:u?vi(s===0?[c,...i.tracePath]:[...i.tracePath,c]):i.tracePath.map((p,m)=>m===s?c:p)};if(!vnt(t.tracePath,_.tracePath))return null;r=r.map((p)=>p.mspPairId===i.mspPairId?_:p)}return r},$1n=({trace:e,endpointPin:t})=>{let n=eP({trace:e,sharedPin:t});if(!n)return null;let o=e.pins[0].pinId===t.pinId,r=vi(e.tracePath);if(!o)r.reverse();if(r.length!==3)return null;let[i,s,a]=r,c=t._facingDirection;if(c==="y+"||c==="y-"){if(n._facingDirection!=="x+"&&n._facingDirection!=="x-")return null;if(!Y2(i,s)||!o3(s,a)||!wde({railY:s.y,pin:t}))return null;return(n._facingDirection==="x-"?s.x<n.x:s.x>n.x)?{railCoordinate:s.y}:null}if(c!=="x+"&&c!=="x-")return null;if(n._facingDirection!=="y+"&&n._facingDirection!=="y-")return null;if(!o3(i,s)||!Y2(s,a))return null;let l=c==="x+"?s.x>t.x:s.x<t.x,h=n._facingDirection==="y+"?s.y>n.y:s.y<n.y;return l&&h?{railCoordinate:s.x}:null},Fri=({donorTrace:e,branchTrace:t,traces:n})=>{let o=qY({donorTrace:e,branchTrace:t});if(!o)return null;let r=eP({trace:t,sharedPin:o});if(!r)return null;let i=(f)=>n.filter((y)=>y.mspPairId!==t.mspPairId&&y.globalConnNetId===t.globalConnNetId&&y.pinIds.includes(f.pinId)),s=i(o),a=i(r);if(s.length!==1||s[0].mspPairId!==e.mspPairId||a.length!==1)return null;let c=$1n({trace:e,endpointPin:o});if(!c)return null;let l=o._facingDirection,h=l==="y+"||l==="y-";if(!h&&!(l==="x+"||l==="x-"))return null;if(h!==(r._facingDirection==="y+"||r._facingDirection==="y-"))return null;let u=t.pins[0].pinId===o.pinId,_=vi(t.tracePath);if(!u)_.reverse();if(_.length!==6)return null;let p=h?["V","H","V","H","V"]:["H","V","H","V","H"];if(_.slice(1).map((f,y)=>o3(_[y],f)?"H":Y2(_[y],f)?"V":"D").some((f,y)=>f!==p[y]))return null;let A=$1n({trace:a[0],endpointPin:r});if(!A)return null;let g=h?vi([{x:o.x,y:o.y},{x:o.x,y:c.railCoordinate},{x:_[2].x,y:c.railCoordinate},{x:_[3].x,y:A.railCoordinate},{x:r.x,y:A.railCoordinate},{x:r.x,y:r.y}]):vi([{x:o.x,y:o.y},{x:c.railCoordinate,y:o.y},{x:c.railCoordinate,y:_[2].y},{x:A.railCoordinate,y:_[3].y},{x:A.railCoordinate,y:r.y},{x:r.x,y:r.y}]);return u?g:g.reverse()},Snt=({trace:e,obstacles:t})=>CB(e.tracePath,t,{excludeRectsForSegment:(n)=>new Set(t.filter((o)=>o.kind==="chip"&&e.pins.some((r)=>o.chipId===r.chipId&&[e.tracePath[n],e.tracePath[n+1]].some((i)=>ns(i.x,r.x)&&ns(i.y,r.y)))&&H8e(e.tracePath[n],e.tracePath[n+1],o)))})!==null,q1n=({path:e,rect:t})=>e.slice(1).reduce((n,o,r)=>{let i=e[r];if(ns(i.x,o.x)){if(i.x<t.minX||i.x>t.maxX)return n;return n+Math.max(0,Math.min(Math.max(i.y,o.y),t.maxY)-Math.max(Math.min(i.y,o.y),t.minY))}if(ns(i.y,o.y)){if(i.y<t.minY||i.y>t.maxY)return n;return n+Math.max(0,Math.min(Math.max(i.x,o.x),t.maxX)-Math.max(Math.min(i.x,o.x),t.minX))}return n},0),J1n=({candidateTrace:e,originalTrace:t,traces:n,inputProblem:o,originalNetLabelPlacements:r,candidateNetLabelPlacements:i,attachedLabelIndexes:s,preserveExistingObstacleContact:a=!1})=>{let c=wy(o);if(!a&&Snt({trace:e,obstacles:c}))return!1;for(let m of a?c:[]){if(!Snt({trace:e,obstacles:[m]}))continue;if(!Snt({trace:t,obstacles:[m]})||q1n({path:e.tracePath,rect:m})>q1n({path:t.tracePath,rect:m})+0.000001)return!1}let l=n.filter((m)=>m.globalConnNetId!==e.globalConnNetId);if(Rk(e.tracePath,l))return!1;for(let m of l){let A=(g)=>{let f=new Set;for(let y=1;y<g.length;y++)for(let x=1;x<m.tracePath.length;x++){let C=rP(g[y-1],g[y],m.tracePath[x-1],m.tracePath[x]);if(C)f.add(`${C.x.toFixed(6)},${C.y.toFixed(6)}`)}return f.size};if(A(e.tracePath)>A(t.tracePath))return!1}if(!s.every((m)=>Ts(e.tracePath,i[m].anchorPoint)))return!1;let h=(m,A)=>Vve({path:A.tracePath,netLabelPlacements:[m]});for(let m of s){let A=r[m],g=i[m],f=zi(A.center,A.width,A.height),y=zi(g.center,g.width,g.height);for(let x of n){if(x.globalConnNetId===g.globalConnNetId)continue;if(h(g,x)&&!h(A,x))return!1}for(let x of c)if(B9(y,x)&&!B9(f,x))return!1;for(let x=0;x<i.length;x++){if(x===m)continue;let C=r[x],b=i[x],I=zi(C.center,C.width,C.height),v=zi(b.center,b.width,b.height);if(B9(y,v)&&!B9(f,I))return!1}}let d=i.filter((m)=>m.globalConnNetId!==e.globalConnNetId);if(Vve({path:e.tracePath,netLabelPlacements:d}))return!1;let u=i.filter((m)=>m.globalConnNetId===e.globalConnNetId);if(!Vve({path:e.tracePath,netLabelPlacements:u}))return!0;if(c7n({path:e.tracePath,netLabelPlacements:u}))return!1;let _=mue(t),p=mue(e);if(!_||!p)return!1;return Math.abs(_.start.y-p.start.y)<=Eri},zri=({donorTrace:e,branchTrace:t,returnStemScale:n=1})=>{let o=qY({donorTrace:e,branchTrace:t});if(!o)return null;let r=eP({trace:e,sharedPin:o}),i=eP({trace:t,sharedPin:o});if(!r||!i)return null;let s=o._facingDirection;if(s!=="y+"&&s!=="y-")return null;if(r._facingDirection!==s||i._facingDirection!==s)return null;if(!ns(o.y,r.y))return null;let a=vi(e.tracePath);if(a.length!==4)return null;let c=mue(e);if(!c||!wde({railY:c.start.y,pin:o}))return null;if(!Y2(a[0],a[1])||!Y2(a[2],a[3]))return null;let l=t.pins[0].pinId===o.pinId,h=vi(l?t.tracePath:[...t.tracePath].reverse());if(h.length!==6)return null;if(!Y2(h[0],h[1])||!o3(h[1],h[2])||!Y2(h[2],h[3])||!o3(h[3],h[4])||!Y2(h[4],h[5]))return null;if(!wde({railY:h[1].y,pin:o})||!wde({railY:h[4].y,pin:i}))return null;if((s==="y+"?1:-1)*(i.y-c.start.y)<=0)return null;let u=Math.min(o.x,r.x),_=Math.max(o.x,r.x);if(h[2].x<u||h[2].x>_)return null;if(ns(h[2].x,r.x)&&ns(h[1].y,c.start.y))return null;let p=i.y+(h[4].y-i.y)*n;if(Math.abs(p-i.y)<wri-0.000001)return null;let m=vi([{x:o.x,y:o.y},{x:o.x,y:c.start.y},{x:r.x,y:c.start.y},{x:r.x,y:p},{x:i.x,y:p},{x:i.x,y:i.y}]);return l?m:m.reverse()},Ori=({inputProblem:e,traces:t,netLabelPlacements:n,netLabelConnectorTraceIds:o})=>{let r=[...t],i=[...n],s=0,a=new Set;for(let l of["compact-pin-banks","loads","returns","established-pin-bank-rails"]){let h=l==="compact-pin-banks",d=l==="returns",u=l==="established-pin-bank-rails",_=t.map((m)=>m.mspPairId),p=new Set(_);for(let m=0;m<_.length;m++){let A=_[m];p.delete(A);let g=r.find((f)=>f.mspPairId===A);for(let f of r){if(!u&&a.has(f.mspPairId))continue;if(g.mspPairId===f.mspPairId)continue;if(g.globalConnNetId!==f.globalConnNetId)continue;let y=o.has(g.mspPairId),x=o.has(f.mspPairId),C=vi(g.tracePath),b=C[1]&&C[2]?SA(C[1],C[2]):null,I=b==="x"?"y":"x",v=Boolean(u&&b&&r.some((M)=>{if(M.mspPairId===g.mspPairId||M.mspPairId===f.mspPairId||M.globalConnNetId!==g.globalConnNetId||!M.pins.every((T)=>g.pins.every((N)=>T.chipId===N.chipId&&T._facingDirection===N._facingDirection)))return!1;let B=vi(M.tracePath);return B.some((T,N)=>N<B.length-1&&SA(T,B[N+1])===b&&ns(T[I],C[1][I]))})),P=u?y||x||!v?[]:[Int({donorTrace:g,branchTrace:f,netLabelConnectorTraceIds:o,outwardPinBankOnly:!0,traces:r})]:h?y||x?[]:[Int({donorTrace:g,branchTrace:f,netLabelConnectorTraceIds:o,compactPinBankOnly:!0,traces:r})]:x?d&&!y?[Lri({donorTrace:g,connectorTrace:f,netLabelConnectorTraceIds:o})]:[]:y?[]:d?[...[1,0.5,0.25].map((M)=>zri({donorTrace:g,branchTrace:f,returnStemScale:M})),Fri({donorTrace:g,branchTrace:f,traces:r}),Int({donorTrace:g,branchTrace:f,netLabelConnectorTraceIds:o,traces:r})]:[Qri({donorTrace:g,branchTrace:f}),kri({donorTrace:g,branchTrace:f})];for(let M of P){if(!M)continue;let B={...f,tracePath:M},T=[g,f],N=[g,B],D=z8e(N)<z8e(T),L=LS(N)<LS(T)&&!ns(LS(N),LS(T));if(!u&&!D&&!L)continue;let H=K1n(f,i),V=Rri({trace:f,reroutedTracePath:M,netLabelPlacements:i,attachedLabelIndexes:H});if(u)V=V.map((j,Y)=>{if(!H.includes(Y))return j;let X=f.tracePath.findIndex((J,ee)=>ee>0&&ee<f.tracePath.length-1&&ns(J.x,j.anchorPoint.x)&&ns(J.y,j.anchorPoint.y)),K=M[X];if(X<0||!K||!ns(j.anchorPoint.x,i[Y].anchorPoint.x)||!ns(j.anchorPoint.y,i[Y].anchorPoint.y))return j;return{...j,anchorPoint:K,center:{x:j.center.x+K.x-j.anchorPoint.x,y:j.center.y+K.y-j.anchorPoint.y}}});let O=Hri({originalTrace:f,candidateTrace:B,traces:r,preserveRemovedStems:h});if(!O)continue;if(!J1n({candidateTrace:B,originalTrace:f,traces:O,inputProblem:e,originalNetLabelPlacements:i,candidateNetLabelPlacements:V,attachedLabelIndexes:H,preserveExistingObstacleContact:u}))continue;if(!O.every((j)=>{if(j.mspPairId===f.mspPairId)return!0;let Y=r.find((X)=>X.mspPairId===j.mspPairId);if(Y.tracePath===j.tracePath)return!0;return J1n({candidateTrace:j,originalTrace:Y,traces:O,inputProblem:e,originalNetLabelPlacements:i,candidateNetLabelPlacements:V,attachedLabelIndexes:K1n(Y,i)})}))continue;if(r=O,i=V,a.add(f.mspPairId),s++,!p.has(f.mspPairId))_.push(f.mspPairId),p.add(f.mspPairId);break}}}}let c=Pri({traces:r,netLabelPlacements:i});return r=yri({traces:c.traces,netLabelPlacements:c.netLabelPlacements,netLabelConnectorTraceIds:o,multiPinNetPinIds:Bri(e)}),i=c.netLabelPlacements,{traces:r,netLabelPlacements:i,alignedJunctionCount:s,collapsedCycleCount:c.collapsedCycleCount}},Vri=0.5,Yri=1,Gri=({traces:e,netLabelPlacements:t})=>e.map((n)=>{let o=n.tracePath,r=o[0],i=o.at(-1);if(!r||!i||!ns(r.x,i.x))return n;let s=o.findIndex((d,u)=>u>0&&u<o.length-2&&o3(o[u-1],d)&&Y2(d,o[u+1])&&o3(o[u+1],o[u+2]));if(s<0)return n;let a=o[s],c=o[s+1],l=Math.abs(a.x-r.x),h=t.find(({anchorPoint:d,orientation:u,mspConnectionPairIds:_})=>_.includes(n.mspPairId)&&(u==="y-"&&d.y<Math.min(r.y,i.y)||u==="y+"&&d.y>Math.max(r.y,i.y))&&d.x>=Math.min(r.x,a.x)&&d.x<=Math.max(r.x,a.x)&&Math.abs(d.x-r.x)<l&&Math.abs(d.x-a.x)<=Vri&&l>=Yri);if(!h)return n;return{...n,tracePath:o.map((d,u)=>u===s||u===s+1?{...d,x:h.anchorPoint.x}:d)}}),Uri=class extends mu{input;outputTraces;outputNetLabelPlacements;constructor(e){super();this.input=e,this.outputTraces=e.traces,this.outputNetLabelPlacements=e.netLabelPlacements}_step(){let e=Ori(this.input);this.outputTraces=Gri({traces:e.traces,netLabelPlacements:e.netLabelPlacements}),this.outputNetLabelPlacements=Y8n({inputProblem:this.input.inputProblem,traces:this.outputTraces,netLabelPlacements:e.netLabelPlacements}),this.stats.alignedJunctionCount=e.alignedJunctionCount,this.stats.collapsedCycleCount=e.collapsedCycleCount,this.solved=!0}getOutput(){return{traces:this.outputTraces,netLabelPlacements:this.outputNetLabelPlacements}}visualize(){let e=J0(this.input.inputProblem);e.lines??=[],e.rects??=[],e.points??=[];for(let t of this.outputTraces)e.lines.push({points:t.tracePath,strokeColor:"purple"});for(let t of this.outputNetLabelPlacements){let n={center:t.center,width:t.width,height:t.height,fill:Ic(t.globalConnNetId,0.35),strokeColor:Ic(t.globalConnNetId,0.9),label:`netId: ${t.netId}
globalConnNetId: ${t.globalConnNetId}`};e.rects.push(n),e.points.push({x:t.anchorPoint.x,y:t.anchorPoint.y,color:Ic(t.globalConnNetId,0.9),label:`anchorPoint
orientation: ${t.orientation}`})}return e}},h7n=(e)=>{let t=vi(e);if(t.length!==6)return!1;let n=t.slice(0,-1).map((o,r)=>Ag(o,t[r+1]));return n.every((o,r)=>r===0||o!==n[r-1])},Wri=({trace:e,label:t,paddingBuffer:n,detourCount:o})=>{if(e.globalConnNetId===t.globalConnNetId)return[];let r=vi(e.tracePath);if(!h7n(r))return[];let i=zi(t.center,t.width,t.height),s=n+o*n,a={minX:i.minX-s,maxX:i.maxX+s,minY:i.minY-s,maxY:i.maxY+s},c=[];for(let l=1;l<r.length-2;l++){let h=r[l],d=r[l+1];if(!X2(h,d,i))continue;let u=Ag(h,d),_=MA(h,d);if(!u&&!_)continue;let p=u?"y":"x",m=u?[a.minY,a.maxY]:[a.minX,a.maxX];for(let A of m){let g=_at(r,l,p,A);if(g)c.push(g)}}return c},Xri=({trace:e,label:t,paddingBuffer:n,detourCount:o})=>{let r=vi(e.tracePath);if(!h7n(r))return[];let i=zi(t.center,t.width,t.height),s=n+o*n,a={minX:i.minX-s,maxX:i.maxX+s,minY:i.minY-s,maxY:i.maxY+s},c=r[0],l=r[r.length-1],h=2,d=[];for(let u=0;u<r.length-1;u++){let _=r[u],p=r[u+1];if(!X2(_,p,i))continue;if(Math.abs(u-h)!==1)continue;let m=Ag(_,p),A=MA(_,p);if(!m&&!A)continue;let g=m?"x":"y",f=m?a.minX:a.minY,y=m?a.maxX:a.maxY,x=m?c.x:c.y,C=m?l.x:l.y,b=[];if(x<f)b.push((x+f)/2);else if(x>y)b.push((x+y)/2);if(C<f)b.push((C+f)/2);else if(C>y)b.push((C+y)/2);for(let I of new Set(b)){let v=_at(r,h,g,I);if(v)d.push(v)}}return d},jri=({trace:e,label:t,netLabelPlacements:n,paddingBuffer:o,detourCount:r})=>Xri({trace:e,label:t,paddingBuffer:o,detourCount:r}).flatMap((s)=>{let a={...e,tracePath:s};return $0({traces:[a],netLabels:n}).flatMap(({label:l})=>Wri({trace:a,label:l,paddingBuffer:o,detourCount:r}))}),uve=0.000000001,$Q=(e)=>e.slice(1).reduce((t,n,o)=>{let r=e[o];return t+Math.abs(n.x-r.x)+Math.abs(n.y-r.y)},0),Pnt=class extends mu{input;outputTraces;traceIdQueue;obstacles;constructor(e){super();this.input=e,this.outputTraces=[...e.traces];let t=new Set(e.completedReroutes.map((n)=>n.initialTrace.mspPairId));this.traceIdQueue=e.traces.map((n)=>n.mspPairId).filter((n)=>t.has(n)),this.obstacles=wy(e.inputProblem)}_step(){let e=this.traceIdQueue.shift();if(!e){this.solved=!0;return}let t=this.outputTraces.findIndex((p)=>p.mspPairId===e),n=this.outputTraces[t],o=vi(n.tracePath),r=$0({traces:[{...n,tracePath:o}],netLabels:this.input.netLabelPlacements}),i=this.outputTraces.filter((p)=>p.mspPairId!==n.mspPairId&&p.globalConnNetId!==n.globalConnNetId),s=$Q(o),a=vat(n,this.outputTraces),c=new Map;for(let p of q8n(o)){if(this.input.allowShorterPaths?$Q(p)>s+uve:Math.abs($Q(p)-s)>uve)continue;c.set(p.map((m)=>`${m.x},${m.y}`).join(";"),p)}let l=this.input.completedReroutes.filter((p)=>p.initialTrace.mspPairId===n.mspPairId);for(let p of l){let m=vi(p.initialTrace.tracePath),A=vi(p.reroutedTracePath),g=$0({traces:[{...p.initialTrace,tracePath:m}],netLabels:this.input.netLabelPlacements}).length,f=jri({trace:p.initialTrace,label:p.label,netLabelPlacements:this.input.netLabelPlacements,paddingBuffer:this.input.paddingBuffer,detourCount:p.detourCount});for(let y of f){let x=vi(y),C={...p.initialTrace,tracePath:x};if($0({traces:[C],netLabels:this.input.netLabelPlacements}).length<g&&Math.abs($Q(x)-$Q(A))<uve&&x.length<A.length&&due(this.input.netLabelPlacements,[p.initialTrace],[C]))c.set(x.map((v)=>`${v.x},${v.y}`).join(";"),x)}}let h=new Set(r.map(({label:p})=>`${p.globalConnNetId}:${p.netId}`)),d=[...c.values()].filter((p)=>{let m={...n,tracePath:p},A=$0({traces:[m],netLabels:this.input.netLabelPlacements}),g=A.every(({label:x})=>h.has(`${x.globalConnNetId}:${x.netId}`)),f=A.length<r.length,y=A.length===r.length&&$Q(p)<=s+uve&&p.length<o.length;return g&&(f||y)&&due(this.input.netLabelPlacements,[n],[m])&&a.every((x)=>Ts(p,x))&&!NZ(p,this.obstacles)&&!Rk(p,i)&&i.every((x)=>ZS(p,x.tracePath)<=ZS(o,x.tracePath))}),u=(p)=>$0({traces:[{...n,tracePath:p}],netLabels:this.input.netLabelPlacements}).length;d.sort((p,m)=>{let A=u(p)-u(m);if(A!==0)return A;return $Q(p)-$Q(m)||p.length-m.length});let _=d[0];if(!_)return;if(this.outputTraces[t]={...n,tracePath:_},this.stats.simplifiedTraceCount=(this.stats.simplifiedTraceCount??0)+1,this.input.allowShorterPaths)this.traceIdQueue.push(e)}getOutput(){return{traces:this.outputTraces,netLabelPlacements:this.input.netLabelPlacements}}visualize(){let e=J0(this.input.inputProblem);e.lines??=[];for(let t of this.outputTraces)e.lines.push({points:t.tracePath,strokeColor:"purple"});return e}},d7n=(e)=>{if(!e.stubTracePath)return null;let t=0.000001;return{minX:Math.min(...e.stubTracePath.map((n)=>n.x))-t,maxX:Math.max(...e.stubTracePath.map((n)=>n.x))+t,minY:Math.min(...e.stubTracePath.map((n)=>n.y))-t,maxY:Math.max(...e.stubTracePath.map((n)=>n.y))+t}},Wrt=(e,t)=>{let n=t.map((r)=>({globalConnNetId:r.globalConnNetId,netId:r.netId,pinIds:r.pinIds,mspConnectionPairIds:[],anchorPoint:r.anchorPoint,orientation:"y+",center:r.center,width:r.axis==="x"?r.width:r.height,height:r.axis==="x"?r.height:r.width})),o=t.flatMap((r)=>{if(!r.stubTracePath)return[];let i=e.chips.find((c)=>c.pins.some((l)=>r.pinIds.includes(l.pinId))),s=i?.pins.find((c)=>r.pinIds.includes(c.pinId));if(!i||!s)return[];let a=JSON.stringify(["inline-terminal",r.globalConnNetId,[...r.pinIds].sort()]);return[{mspPairId:a,mspConnectionPairIds:[a],globalConnNetId:r.globalConnNetId,dcConnNetId:r.globalConnNetId,pinIds:r.pinIds,pins:[{...s,chipId:i.chipId},{...s,...r.stubTracePath[1],chipId:i.chipId}],tracePath:r.stubTracePath}]});return{fixedLabels:n,terminalTraces:o}},F2=0.000001,X4=0.05,KV=(e,t)=>e.slice(1).some((n,o)=>X2(e[o],n,t)),Z1n=(e,t)=>Math.hypot(e.x-t.x,e.y-t.y)<F2,$V=(e,t,n)=>({...e,[t]:e[t]+n}),Ent=(e,t)=>e.slice(1).flatMap((n,o)=>t.slice(1).flatMap((r,i)=>{let s=rP(e[o],n,t[i],r);return s?[s]:[]}));function*eyn(e,t,n=[]){let o=[...t.inlineNetLabelPlacements,...n],{fixedLabels:r,terminalTraces:i}=Wrt(e,o),s=o.flatMap((d)=>{let u=d7n(d);return u?[{label:d,bounds:u}]:[]}),a=[...e.chips.map((d)=>({minX:d.center.x-d.width/2,maxX:d.center.x+d.width/2,minY:d.center.y-d.height/2,maxY:d.center.y+d.height/2})),...(e.textBoxes??[]).map((d)=>L9(d))],c=r.map((d)=>({minX:d.center.x-d.width/2,maxX:d.center.x+d.width/2,minY:d.center.y-d.height/2,maxY:d.center.y+d.height/2})),l=t.netLabelPlacements.filter((d)=>n.some((u)=>u.globalConnNetId===d.globalConnNetId&&u.pinIds.length===d.pinIds.length&&u.pinIds.every((_)=>d.pinIds.includes(_)))).map(I0),h=[...e.chips.flatMap((d)=>d.pins),...t.traces.flatMap((d)=>d.pins)];for(let d of t.traces){let u=vi(d.tracePath);for(let _=0;_<u.length-1;_++){let p=u[_],m=u[_+1],A=Math.abs(p.x-m.x)<F2?"x":"y",g=A==="x"?"y":"x";if(Math.abs(p[A]-m[A])>F2||Z1n(p,m))continue;let f=[...t.netLabelPlacements.filter((D)=>D.globalConnNetId!==d.globalConnNetId).map(I0),...c,...s.filter(({label:D})=>!d.pinIds.some((L)=>D.pinIds.includes(L))).map(({bounds:D})=>D)],y=t.netLabelPlacements.filter((D)=>D.globalConnNetId===d.globalConnNetId&&D.netId!=null&&e.availableNetLabelOrientations[D.netId]?.length===1&&e.availableNetLabelOrientations[D.netId]?.[0]===D.orientation&&(A==="x"?D.orientation==="y+"||D.orientation==="y-":D.orientation==="x+"||D.orientation==="x-")&&Ts([p,m],D.anchorPoint)).map(I0),x=[...f.filter((D)=>X2(p,m,D)),...l.filter((D)=>y.some((L)=>gc(L,D)))];if(!x.length)continue;let C=Math.min(p[g],m[g]),b=Math.max(p[g],m[g]),I=!0;while(I){I=!1;for(let D of t.traces){if(D.globalConnNetId!==d.globalConnNetId)continue;for(let L=1;L<D.tracePath.length;L++){let H=D.tracePath[L-1],V=D.tracePath[L];if(Math.abs(H[A]-p[A])>F2||Math.abs(V[A]-p[A])>F2)continue;let O=Math.min(H[g],V[g]),U=Math.max(H[g],V[g]);if(U<C-F2||O>b+F2)continue;if(O<C||U>b)I=!0;C=Math.min(C,O),b=Math.max(b,U)}}}let v=(D)=>Math.abs(D[A]-p[A])<F2&&D[g]>=C-F2&&D[g]<=b+F2;if(h.some(v))continue;let P=A==="x"?"minX":"minY",M=A==="x"?"maxX":"maxY",B=Math.max(...x.map((D)=>D[M]-D[P])),T=t.netLabelPlacements.filter((D)=>D.globalConnNetId===d.globalConnNetId&&v(D.anchorPoint)).map(I0),N=[...new Set(x.flatMap((D)=>[D[P]-X4,D[M]+X4,...T.filter((L)=>gc(L,D)).flatMap((L)=>[p[A]+D[P]-X4-L[M],p[A]+D[M]+X4-L[P]])]))].sort((D,L)=>Math.abs(D-p[A])-Math.abs(L-p[A]));for(let D of N){let L=D-p[A];if(Math.abs(L)>B+2*X4)continue;let H=t.traces.map((Y)=>{if(Y.globalConnNetId!==d.globalConnNetId||!Y.tracePath.some(v))return Y;return{...Y,tracePath:Y.tracePath.map((X)=>v(X)?$V(X,A,L):X)}}),V=H.filter((Y,X)=>Y!==t.traces[X]).map((Y)=>Y.tracePath),O=t.netLabelPlacements.map((Y)=>{if(Y.globalConnNetId!==d.globalConnNetId||!v(Y.anchorPoint))return Y;return{...Y,anchorPoint:$V(Y.anchorPoint,A,L),center:$V(Y.center,A,L)}}),U=!1,j=O.flatMap((Y,X)=>Y!==t.netLabelPlacements[X]?[I0(Y)]:[]);for(let[Y,X]of O.entries()){if(X.globalConnNetId===d.globalConnNetId)continue;let K=I0(X),J=j.filter((ce)=>gc(ce,K)).map((ce)=>ce[L>0?M:P]);if(V.some((ce)=>KV(ce,K))&&!t.traces.some((ce)=>ce.globalConnNetId===d.globalConnNetId&&KV(ce.tracePath,K)))J.push(D);if(!J.length)continue;let ee=H.findIndex((ce)=>ce.globalConnNetId===X.globalConnNetId&&ce.pinIds.length===1&&ce.tracePath.length===3&&Z1n(ce.tracePath.at(-1),X.anchorPoint)),se=H[ee];if(!se){let ue=new Mat({inputProblem:e,traces:[...H,...i],netLabelPlacements:O,fixedNetLabelPlacements:r,useRenderedLabelBounds:!0}).getNearbyValidPlacements(X,B+Math.max(X.width,X.height))[0];if(!ue){U=!0;break}O[Y]=ue;continue}let[ne,re,Z]=se.tracePath;if(Math.abs(re[A]-Z[A])>F2||Math.abs(ne[g]-re[g])>F2){U=!0;break}let te=L>0?Math.max(...J)+X4-K[P]:Math.min(...J)-X4-K[M];if(Math.abs(te)>B+K[M]-K[P]+2*X4){U=!0;break}let ie={...X,anchorPoint:$V(X.anchorPoint,A,te),center:$V(X.center,A,te)};O[Y]=ie,H[ee]={...se,tracePath:[ne,$V(re,A,te),ie.anchorPoint]}}if(U)continue;for(let[Y,X]of H.entries()){if(X.globalConnNetId===d.globalConnNetId||vi(X.tracePath).length<=4||!V.some((J)=>Rk(J,[X])))continue;let K=H8n({inputProblem:e,traces:[...H,...i],targetMspConnectionPairId:X.mspPairId,allLabelPlacements:[...O,...r],mergedLabelNetIdMap:{},paddingBuffer:X4});if(vi(K.tracePath).length<vi(X.tracePath).length&&due(O,[X],[K]))H[Y]=K}for(let[Y,X]of H.entries()){let K=t.traces[Y];if(X===K)continue;let J=X.tracePath,ee=K.tracePath;if(J.slice(1).some((re,Z)=>Math.abs(re.x-J[Z].x)>F2&&Math.abs(re.y-J[Z].y)>F2)){U=!0;break}let se=(re,Z,te,ie)=>(Z.x-re.x)*(ie.x-te.x)+(Z.y-re.y)*(ie.y-te.y);if(se(ee[0],ee[1],J[0],J[1])<=F2||se(ee.at(-1),ee.at(-2),J.at(-1),J.at(-2))<=F2){U=!0;break}for(let[re,Z]of t.traces.entries()){if(Z===K||Z.globalConnNetId!==K.globalConnNetId)continue;let te=[...Z.tracePath,...Ent(ee,Z.tracePath)].filter((ie)=>Ts(ee,ie));for(let ie of te){if(K.globalConnNetId===d.globalConnNetId&&v(ie))ie=$V(ie,A,L);if(!Ts(J,ie)||!Ts(H[re].tracePath,ie)){U=!0;break}}if(U)break}if(U)break;if(h.filter((re)=>Ts(ee,re)).some((re)=>!Ts(J,re))||h.some((re)=>{let Z={minX:re.x-X4,maxX:re.x+X4,minY:re.y-X4,maxY:re.y+X4};return KV(J,Z)&&!KV(ee,Z)})||a.some((re)=>KV(J,re)&&!KV(ee,re))){U=!0;break}for(let re of[...H,...i]){if(re.mspPairId===X.mspPairId||re.globalConnNetId===X.globalConnNetId)continue;let Z=t.traces.find((te)=>te.mspPairId===re.mspPairId)??re;if(Rk(J,[re])||Ent(J,re.tracePath).length>Ent(ee,Z.tracePath).length){U=!0;break}}if(U)break}if(U)continue;for(let[Y,X]of O.entries()){if(X===t.netLabelPlacements[Y])continue;let K=I0(X);if(a.some((J)=>gc(K,J))||c.some((J)=>gc(K,J))){U=!0;break}if(O.some((J,ee)=>Y!==ee&&gc(K,I0(J)))){U=!0;break}if([...H,...i].some((J)=>J.globalConnNetId!==X.globalConnNetId&&KV(J.tracePath,K))){U=!0;break}}if(!U)yield{...t,traces:H,netLabelPlacements:O}}}}}var xJ=(e,t)=>{let n=[...e.pinIds].sort(),o=[...t.pinIds].sort();return e.globalConnNetId===t.globalConnNetId&&n.length===o.length&&n.every((r,i)=>r===o[i])},u7n=(e,t)=>{if(e.kind==="label-label"&&t.kind==="label-label")return xJ(e.labels[0],t.labels[0])&&xJ(e.labels[1],t.labels[1])||xJ(e.labels[0],t.labels[1])&&xJ(e.labels[1],t.labels[0]);if(e.kind!=="trace-label"||t.kind!=="trace-label")return!1;return(e.trace.kind==="routed"&&t.trace.kind==="routed"?e.trace.id===t.trace.id:e.trace.kind==="terminal"&&t.trace.kind==="terminal"&&xJ(e.trace.label,t.trace.label))&&e.target===t.target&&xJ(e.label,t.label)},tyn=(e)=>{let t=[...e.netLabelPlacements,...e.inlineNetLabelPlacements].map((i)=>({label:i,bounds:"axis"in i?{minX:i.center.x-(i.axis==="x"?i.width:i.height)/2,maxX:i.center.x+(i.axis==="x"?i.width:i.height)/2,minY:i.center.y-(i.axis==="x"?i.height:i.width)/2,maxY:i.center.y+(i.axis==="x"?i.height:i.width)/2}:I0(i)})),n=[],o=(i)=>{if(!n.some((s)=>u7n(i,s)))n.push(i)};for(let i=0;i<t.length;i++)for(let s of t.slice(i+1))if(gc(t[i].bounds,s.bounds))o({kind:"label-label",labels:[t[i].label,s.label]});let r=[...e.traces.map((i)=>({...i,identity:{kind:"routed",id:i.mspPairId}})),...e.inlineNetLabelPlacements.flatMap((i)=>i.stubTracePath?[{identity:{kind:"terminal",label:i},globalConnNetId:i.globalConnNetId,tracePath:i.stubTracePath}]:[])];for(let i of r)for(let{label:s,bounds:a}of t)if((("axis"in s)||s.globalConnNetId!==i.globalConnNetId)&&i.tracePath.slice(1).some((c,l)=>X2(i.tracePath[l],c,a)))o({kind:"trace-label",trace:i.identity,label:s,target:"text"});for(let i of e.inlineNetLabelPlacements){let s=d7n(i);if(!s)continue;for(let a of e.traces){if(a.pinIds.some((c)=>i.pinIds.includes(c)))continue;if(a.tracePath.slice(1).some((c,l)=>X2(a.tracePath[l],c,s)))o({kind:"trace-label",trace:{kind:"routed",id:a.mspPairId},label:i,target:"terminal"})}}return n},Xrt=(e,t)=>e.pinIds.length>0&&e.pinIds.every((n)=>t.some((o)=>o.globalConnNetId===e.globalConnNetId&&o.pinIds.includes(n))),Kri=(e)=>{let[t,n]=e;if(Math.abs(n.x-t.x)>=Math.abs(n.y-t.y))return n.x>=t.x?"x+":"x-";return n.y>=t.y?"y+":"y-"},$ri=(e)=>{let[t,n]=e;return Math.abs(n.x-t.x)+Math.abs(n.y-t.y)},pve=(e)=>{let t=e.axis==="y",n=t?e.height:e.width,o=t?e.width:e.height;return{minX:e.center.x-n/2,maxX:e.center.x+n/2,minY:e.center.y-o/2,maxY:e.center.y+o/2}},p7n=(e)=>({minX:Math.min(...e.map((t)=>t.x)),maxX:Math.max(...e.map((t)=>t.x)),minY:Math.min(...e.map((t)=>t.y)),maxY:Math.max(...e.map((t)=>t.y))}),Yhe=(e,t)=>{for(let n=0;n<e.length-1;n++){let o=p7n([e[n],e[n+1]]);if(gc(o,t))return!0}return!1},qri=(e,t,n)=>{let[o]=e.stubTracePath,r=t==="x+"?{x:o.x+n,y:o.y}:t==="x-"?{x:o.x-n,y:o.y}:t==="y+"?{x:o.x,y:o.y+n}:{x:o.x,y:o.y-n},i={x:(o.x+r.x)/2,y:(o.y+r.y)/2};return{...e,stubTracePath:[o,r],anchorPoint:i,center:e.center}},Jri=({placements:e,inputProblem:t,traces:n,netLabelPlacements:o})=>{let r=new Map;for(let c of t.chips)for(let l of c.pins)r.set(l.pinId,c.chipId);let i=new Map;for(let[c,l]of e.entries()){if(!l.stubTracePath||l.pinIds.length!==1)continue;let h=Kri(l.stubTracePath);if(!h)continue;let d=r.get(l.pinIds[0]),u=`${d??l.pinIds[0]}::${h}`,_=i.get(u)??[];_.push({placementIndex:c,placement:l,direction:h,ownerChipId:d}),i.set(u,_)}let s=[...e],a=o.filter((c)=>!Xrt(c,e)).map(pve);for(let c of i.values()){if(c.length<2)continue;let l=Math.max(...c.map(({placement:p})=>$ri(p.stubTracePath))),h=c.map(({placement:p,direction:m})=>qri(p,m,l)),d=new Set(c.map(({placementIndex:p})=>p)),u=e.filter((p,m)=>!d.has(m));if(h.some((p,m)=>{let A=pve(p),g=p.stubTracePath,f=p7n(g),y=c[m].ownerChipId;for(let x of t.chips){let C={minX:x.center.x-x.width/2,maxX:x.center.x+x.width/2,minY:x.center.y-x.height/2,maxY:x.center.y+x.height/2};if(gc(A,C))return!0;if(x.chipId!==y&&gc(f,C))return!0}for(let x of t.textBoxes??[]){let C=L9(x);if(gc(A,C)||gc(f,C))return!0}for(let x of n){if(x.globalConnNetId===p.globalConnNetId)continue;if(Yhe(x.tracePath,A)||Yhe(x.tracePath,f))return!0}if(a.some((x)=>gc(A,x)||gc(f,x)))return!0;for(let x of u){let C=pve(x);if(gc(A,C)||gc(f,C))return!0;if(x.stubTracePath&&(Yhe(x.stubTracePath,A)||Yhe(g,C)))return!0}for(let[x,C]of h.entries()){if(x===m)continue;let b=pve(C);if(gc(A,b))return!0;if(Yhe(g,b))return!0}return!1}))continue;for(let[p,{placementIndex:m}]of c.entries())s[m]=h[p]}return s},nyn=(e,t=0.000001)=>{let n=[],o=null,r=null,i=0,s=(a)=>{if(o&&r){let c=r==="x"?Math.abs(a.x-o.x):Math.abs(a.y-o.y);if(c>t)n.push({start:o,end:a,axis:r,length:c})}o=null,r=null,i=0};for(let a=0;a<e.length-1;a++){let c=e[a],l=e[a+1],h=l.x-c.x,d=l.y-c.y;if(Math.abs(h)<=t&&Math.abs(d)<=t)continue;let u=Math.abs(d)<=t?"x":Math.abs(h)<=t?"y":null;if(!u){s(c);continue}let _=Math.sign(u==="x"?h:d);if(o&&r===u&&i===_)continue;s(c),o=c,r=u,i=_}if(e.length>=2)s(e[e.length-1]);return n.sort((a,c)=>c.length-a.length)},Mb=0.05,jx=0.000001,Zri=0.01,oyn=5,eii=(e)=>{let t=e.axis==="y"?e.height:e.width,n=e.axis==="y"?e.width:e.height;return{minX:e.center.x-t/2,maxX:e.center.x+t/2,minY:e.center.y-n/2,maxY:e.center.y+n/2}},_ue=(e,t)=>Math.abs(e.x-t.x)<=jx&&Math.abs(e.y-t.y)<=jx,Ghe=(e,t)=>{for(let n=0;n<e.length-1;n++){let o=e[n],r=e[n+1],i={minX:Math.min(o.x,r.x),maxX:Math.max(o.x,r.x),minY:Math.min(o.y,r.y),maxY:Math.max(o.y,r.y)};if(gc(i,t))return!0}return!1},tii=(e,t)=>{for(let n=0;n<t.length-1;n++){let o=t[n],r=t[n+1],i=Math.min(o.x,r.x)-jx,s=Math.max(o.x,r.x)+jx,a=Math.min(o.y,r.y)-jx,c=Math.max(o.y,r.y)+jx,l=Math.abs(o.y-r.y)<=jx,h=Math.abs(o.x-r.x)<=jx;if((l&&Math.abs(e.y-o.y)<=jx||h&&Math.abs(e.x-o.x)<=jx)&&e.x>=i&&e.x<=s&&e.y>=a&&e.y<=c)return!0}return!1},nii=(e,t)=>{let n=0;for(let o=0;o<t.length;o++){let r=I0(Yve(e,e.orientation,n)),i=e.orientation==="x-"||e.orientation==="x+",s=t.filter((a)=>gc(r,{minX:a.minX-(i?Mb:0),maxX:a.maxX+(i?Mb:0),minY:a.minY-(i?0:Mb),maxY:a.maxY+(i?0:Mb)}));if(s.length===0)break;switch(e.orientation){case"x-":n+=r.maxX-Math.min(...s.map((a)=>a.minX))+Mb;break;case"x+":n+=Math.max(...s.map((a)=>a.maxX))-r.minX+Mb;break;case"y-":n+=r.maxY-Math.min(...s.map((a)=>a.minY))+Mb;break;case"y+":n+=Math.max(...s.map((a)=>a.maxY))-r.minY+Mb;break}}return n},Yve=(e,t,n)=>{let o=j0(t);return{...e,anchorPoint:{x:e.anchorPoint.x+o.x*n,y:e.anchorPoint.y+o.y*n},center:{x:e.center.x+o.x*n,y:e.center.y+o.y*n}}},oii=(e,t,n)=>{switch(n){case"x-":return e.maxX-t.minX+Mb;case"x+":return t.maxX-e.minX+Mb;case"y-":return e.maxY-t.minY+Mb;case"y+":return t.maxY-e.minY+Mb}},rii=(e,t,n)=>{if(n==="x-"||n==="x+")return Math.max(0,e.minY-t.maxY,t.minY-e.maxY);return Math.max(0,e.minX-t.maxX,t.minX-e.maxX)},m7n=(e,t,n)=>e.pinIds.some((o)=>t.has(n.get(o)??"")),ryn=(e,t,n)=>t.findIndex((o)=>{if(o.globalConnNetId!==e.globalConnNetId)return!1;if(!n.has(o.mspPairId))return!1;let r=o.tracePath[0],i=o.tracePath.at(-1);return Boolean(r&&_ue(r,e.anchorPoint)||i&&_ue(i,e.anchorPoint))}),iyn=(e,t,n)=>{if(e.pinIds.some((o)=>{let r=n[o];return r&&_ue(r,e.anchorPoint)}))return!0;return t.some((o)=>o.globalConnNetId===e.globalConnNetId&&tii(e.anchorPoint,o.tracePath))},iii=(e,t,n)=>{let o=e.tracePath.map((r)=>({...r}));if(_ue(o[0],t))o[0]=n;if(_ue(o.at(-1),t))o[o.length-1]=n;return{...e,tracePath:o}},sii=({label:e,labelIndex:t,newAnchor:n,pinMap:o})=>{let r=`inline-net-label-clearance-${t}-${e.netId??e.globalConnNetId}`;return{mspPairId:r,dcConnNetId:e.dcConnNetId??e.globalConnNetId,globalConnNetId:e.globalConnNetId,userNetId:e.netId,pins:bat(e,o),tracePath:[e.anchorPoint,n],mspConnectionPairIds:[r],pinIds:e.pinIds}},aii=({triggerIndex:e,labels:t,chipIdByPinId:n})=>{let o=t[e],r=new Set(o.pinIds.flatMap((c)=>{let l=n.get(c);return l?[l]:[]})),i=t.map((c,l)=>({label:c,labelIndex:l})).filter(({label:c})=>c.orientation===o.orientation&&c.mspConnectionPairIds.length===0&&m7n(c,r,n)),s=new Set([e]),a=!0;while(a){a=!1;for(let{label:c,labelIndex:l}of i){if(s.has(l))continue;if([...s].some((h)=>rii(I0(t[h]),I0(c),o.orientation)<=Zri))s.add(l),a=!0}}return{group:s,ownerChipIds:r}},cii=({inputProblem:e,traces:t,netLabelPlacements:n,inlineNetLabelPlacements:o,netLabelConnectorTraceIds:r=new Set})=>{let i=new Set(r),s=t.map((u)=>({...u,tracePath:u.tracePath.map((_)=>({..._}))})),a=n.map((u)=>({...u})),c=o.map(eii),l=Cat(e),h=new Map;for(let u of e.chips)for(let _ of u.pins)h.set(_.pinId,u.chipId);let d=new Set;for(let u=0;u<a.length;u++){let _=a[u],p=nii(_,c);if(p<=jx||p>oyn)continue;let{group:m,ownerChipIds:A}=aii({triggerIndex:u,labels:a,chipIdByPinId:h}),g=new Map([...m].map((b)=>[b,p])),f=!1;for(let b=0;b<a.length;b++){let I=!1;for(let[v,P]of g){let M=I0(Yve(a[v],_.orientation,P));for(let B=0;B<a.length;B++){if(B===v||m.has(B))continue;let T=a[B],N=g.get(B)??0,D=I0(Yve(T,_.orientation,N));if(!gc(M,D))continue;if(!m7n(T,A,h)||ryn(T,s,i)===-1&&!iyn(T,s,l)){f=!0;break}let L=oii(I0(T),M,_.orientation);if(L>oyn||L<=N+jx){f=!0;break}g.set(B,L),I=!0}if(f)break}if(f||!I)break}if(f)continue;let y=new Map;for(let[b,I]of g)y.set(b,Yve(a[b],_.orientation,I));let x=(b)=>y.get(b)??a[b];for(let[b,I]of y){let v=I0(I);if(c.some((P)=>gc(v,P))){f=!0;break}if(e.chips.some((P)=>gc(v,{minX:P.center.x-P.width/2,maxX:P.center.x+P.width/2,minY:P.center.y-P.height/2,maxY:P.center.y+P.height/2}))||(e.textBoxes??[]).some((P)=>gc(v,L9(P)))){f=!0;break}if(a.some((P,M)=>M!==b&&gc(v,I0(x(M))))){f=!0;break}if(s.some((P)=>P.globalConnNetId!==I.globalConnNetId&&Ghe(P.tracePath,v))){f=!0;break}}if(f)continue;let C=[];for(let[b,I]of y){let v=a[b],P=ryn(v,s,i);if(P===-1&&!iyn(v,s,l)){f=!0;break}let M=P===-1?sii({label:v,labelIndex:b,newAnchor:I.anchorPoint,pinMap:l}):iii(s[P],v.anchorPoint,I.anchorPoint);if(M.tracePath.slice(1).some((T,N)=>{let D=M.tracePath[N];return Math.abs(T.x-D.x)>jx&&Math.abs(T.y-D.y)>jx})||s.some((T)=>T.globalConnNetId!==M.globalConnNetId&&NY(M.tracePath,T.tracePath,{includeTerminalSegments:!0}).length>0)||c.some((T)=>Ghe(M.tracePath,T))||e.chips.some((T)=>!A.has(T.chipId)&&Ghe(M.tracePath,{minX:T.center.x-T.width/2,maxX:T.center.x+T.width/2,minY:T.center.y-T.height/2,maxY:T.center.y+T.height/2}))||(e.textBoxes??[]).some((T)=>Ghe(M.tracePath,L9(T)))||a.some((T,N)=>N!==b&&Ghe(M.tracePath,I0(x(N))))){f=!0;break}C.push({labelIndex:b,connectorIndex:P,trace:M})}if(f)continue;for(let[b,I]of y)a[b]=I,d.add(b);for(let b of C)if(i.add(b.trace.mspPairId),b.connectorIndex===-1)s.push(b.trace);else s[b.connectorIndex]=b.trace}return{traces:s,netLabelPlacements:a,movedLabelCount:d.size,netLabelConnectorTraceIds:i}},mve=0.05,lii=5,hii=(e)=>{let[t,n]=e;if(Math.abs(n.x-t.x)>=Math.abs(n.y-t.y))return n.x>=t.x?"x+":"x-";return n.y>=t.y?"y+":"y-"},Mnt=(e)=>{let t=e.axis==="y"?e.height:e.width,n=e.axis==="y"?e.width:e.height;return{minX:e.center.x-t/2,maxX:e.center.x+t/2,minY:e.center.y-n/2,maxY:e.center.y+n/2}},_7n=(e)=>({minX:Math.min(...e.map((t)=>t.x)),maxX:Math.max(...e.map((t)=>t.x)),minY:Math.min(...e.map((t)=>t.y)),maxY:Math.max(...e.map((t)=>t.y))}),qV=(e,t)=>{for(let n=0;n<e.length-1;n++)if(gc(_7n([e[n],e[n+1]]),t))return!0;return!1},wnt=(e,t,n)=>{switch(t){case"x+":return{x:e.x+n,y:e.y};case"x-":return{x:e.x-n,y:e.y};case"y+":return{x:e.x,y:e.y+n};case"y-":return{x:e.x,y:e.y-n}}},syn=(e,t,n)=>{let[o,r]=e.stubTracePath,i=wnt(r,t,n);return{...e,stubTracePath:[o,i],anchorPoint:wnt(e.anchorPoint,t,n),center:wnt(e.center,t,n)}},dii=(e,t,n)=>{switch(n){case"x+":return t.maxX-e.minX+mve;case"x-":return e.maxX-t.minX+mve;case"y+":return t.maxY-e.minY+mve;case"y-":return e.maxY-t.minY+mve}},uii=({inputProblem:e,traces:t,anchoredNetLabelPlacements:n,inlineNetLabelPlacements:o})=>{let r=new Map;for(let c of e.chips)for(let l of c.pins)r.set(l.pinId,c.chipId);let i=new Map;for(let[c,l]of o.entries()){if(!l.stubTracePath||l.pinIds.length!==1)continue;let h=hii(l.stubTracePath),d=r.get(l.pinIds[0]),u=`${d??l.pinIds[0]}::${h}`,_=i.get(u)??[];_.push({placementIndex:c,placement:l,direction:h,ownerChipId:d}),i.set(u,_)}let s=[...o],a=0;for(let c of i.values()){let l=new Set(c.map(({placementIndex:m})=>m)),h=s.filter((m,A)=>!l.has(A)),d=c[0].direction,u=0;for(let m=0;m<=n.length;m++){let A=0;for(let{placement:g}of c){let f=syn(g,d,u),y=Mnt(f);for(let x of n){if(x.globalConnNetId===g.globalConnNetId)continue;let C=I0(x);if(!gc(y,C))continue;A=Math.max(A,dii(y,C,d))}}if(A<=0)break;u+=A}if(u<=0||u>lii)continue;let _=c.map(({placement:m})=>syn(m,d,u));if(_.some((m,A)=>{let f=c[A].placement.stubTracePath[1],y=m.stubTracePath[1],x=[f,y],C=Mnt(m),b=c[A].ownerChipId;if(n.some((I)=>{if(I.globalConnNetId===m.globalConnNetId)return!1;let v=I0(I);return gc(C,v)||qV(x,v)}))return!0;for(let I of e.chips){if(I.chipId===b)continue;let v={minX:I.center.x-I.width/2,maxX:I.center.x+I.width/2,minY:I.center.y-I.height/2,maxY:I.center.y+I.height/2};if(gc(C,v)||qV(x,v))return!0}for(let I of e.textBoxes??[]){let v=L9(I);if(gc(C,v)||qV(x,v))return!0}for(let I of t){if(I.globalConnNetId===m.globalConnNetId)continue;if(qV(I.tracePath,C)||qV(I.tracePath,_7n(x)))return!0}for(let I of h){let v=Mnt(I);if(gc(C,v)||qV(x,v)||I.stubTracePath&&qV(I.stubTracePath,C))return!0}return!1}))continue;for(let[m,{placementIndex:A}]of c.entries())s[A]=_[m];a++}return{inlineNetLabelPlacements:s,movedGroupCount:a}},jrt=(e,t)=>{let{width:n,height:o}=t;if("axis"in t&&t.axis==="y")n=t.height,o=t.width;let r=tei({center:t.center,width:n,height:o});for(let i=0;i<e.length-1;i++)if(qZr(e[i],e[i+1],r))return!0;return!1},Krt=0.000001,ayn=(e)=>e.slice(1).reduce((t,n,o)=>{let r=e[o];return t+Math.abs(n.x-r.x)+Math.abs(n.y-r.y)},0),pii=(e,t)=>e.length===t.length&&e.every((n,o)=>Math.abs(n.x-t[o].x)<=Krt&&Math.abs(n.y-t[o].y)<=Krt),mii=(e,t)=>e.length<t.length&&ayn(e)<=ayn(t)+Krt,cyn=(e,t)=>{let n=new Set;for(let o=0;o<e.length-1;o++)for(let r=0;r<t.length-1;r++){let i=rP(e[o],e[o+1],t[r],t[r+1]);if(i)n.add(`${i.x.toFixed(6)},${i.y.toFixed(6)}`)}return n},lyn=(e,t,n)=>n.some((o)=>{let r=cyn(t,o);return[...cyn(e,o)].some((s)=>!r.has(s))}),_ii=({inputProblem:e,traces:t,netLabelPlacements:n,inlineNetLabelPlacements:o,completedReroutes:r})=>{let i=[...t],s=new Set(o.map((l)=>l.globalConnNetId)),a=wy(e),c=0;for(let l of[...r].reverse()){if(!s.has(l.label.globalConnNetId))continue;let h=i.findIndex((y)=>y.mspPairId===l.initialTrace.mspPairId);if(h<0)continue;let d=i[h],u=vi(d.tracePath),_=vi(l.reroutedTracePath);if(!pii(u,_))continue;let p=vi(l.initialTrace.tracePath);if(!mii(p,u))continue;let m={...d,tracePath:p},A=i.filter((y)=>y.mspPairId!==d.mspPairId&&y.globalConnNetId!==d.globalConnNetId),g=o.filter((y)=>y.globalConnNetId!==d.globalConnNetId),f=g.flatMap((y)=>y.stubTracePath?[[...y.stubTracePath]]:[]);if(NZ(p,a)||$0({traces:[m],netLabels:n}).length>0||g.some((y)=>jrt(p,y))||Rk(p,A)||N8n(p,f)||lyn(p,u,A.map((y)=>y.tracePath))||lyn(p,u,f)||!due(n,[d],[m]))continue;i[h]=m,c++}return{traces:i,restoredTraceCount:c}},$rt=0.18,Bnt=0.05,Gve=0.05,gii=0.4,hyn=(e)=>JSON.stringify([...e].sort()),dyn=(e)=>{let t=0;for(let n=0;n<e.tracePath.length-1;n++){let o=e.tracePath[n],r=e.tracePath[n+1];t+=Math.abs(r.x-o.x)+Math.abs(r.y-o.y)}return t},Aii=(e,t)=>e.size===t.size&&[...e].every((n)=>t.has(n)),Tnt=(e)=>{let t=e.axis==="y"?e.height:e.width,n=e.axis==="y"?e.width:e.height;return{minX:e.center.x-t/2,maxX:e.center.x+t/2,minY:e.center.y-n/2,maxY:e.center.y+n/2}},xS=(e)=>JSON.stringify([e.globalConnNetId,[...e.pinIds].sort(),e.mspPairId??null]),fii=(e,t)=>{let n=Gve-Ux,o={minX:Math.min(e[0].x,e[1].x)-n,maxX:Math.max(e[0].x,e[1].x)+n,minY:Math.min(e[0].y,e[1].y)-n,maxY:Math.max(e[0].y,e[1].y)+n};return BJ(t.tracePath,o)},yii=class e extends mu{constructor(t){super();this.input=t,this.netLabelConnectorTraceIds=t.netLabelConnectorTraceIds??new Set,this.inputProblem=t.inputProblem,this.traces=t.traces,this.inputNetLabelPlacements=t.netLabelPlacements,this.completedReroutes=t.completedReroutes??[],this.globalConnMap=Qb(this.inputProblem).netConnMap,this.queuedConnections=[...this.inputProblem.directConnections.filter((n)=>n.allowInlineNetLabel&&n.netId&&!this.inputProblem.netConnections.some((o)=>o.allowInlineNetLabel&&o.netId&&n.pinIds.every((r)=>o.pinIds.includes(r)))).map((n)=>({kind:"direct_connection",connection:n})),...this.inputProblem.netConnections.filter((n)=>n.allowInlineNetLabel&&n.pinIds.length>=1&&n.netId).map((n)=>({kind:"net_connection",connection:n}))],this.tracesByPinPairKey=new Map;for(let n of this.traces){if(this.netLabelConnectorTraceIds.has(n.mspPairId))continue;let o=hyn(n.pins.map((i)=>i.pinId)),r=this.tracesByPinPairKey.get(o);if(r)r.push(n);else this.tracesByPinPairKey.set(o,[n])}}input;inputProblem;traces;inputNetLabelPlacements;completedReroutes;inlineNetLabelPlacements=[];queuedConnections;netLabelConnectorTraceIds;tracesByPinPairKey;globalConnMap;inlineConversions=[];hasAlignedPortOnlyStubs=!1;postProcessedOutput;refinementComplete=!1;refinement;currentProposal;getConstructorParams(){return[{inputProblem:this.inputProblem,traces:this.traces,netLabelPlacements:this.inputNetLabelPlacements,completedReroutes:this.completedReroutes,resolveTraceCollisions:this.input.resolveTraceCollisions,netLabelConnectorTraceIds:this.netLabelConnectorTraceIds}]}_step(){let t=this.queuedConnections.shift();if(t){if(t.kind==="net_connection"&&t.connection.pinIds.length>2){let r=[t.connection,...this.queuedConnections.filter((i)=>i.kind==="net_connection"&&i.connection.pinIds.length>2).map((i)=>i.connection)];this.queuedConnections=this.queuedConnections.filter((i)=>i.kind!=="net_connection"||i.connection.pinIds.length<=2);for(let i of this.computeNetConnectionInlineConversions(r))this.inlineNetLabelPlacements.push(...i.placements),this.inlineConversions.push(i);return}let{connection:n}=t,o=n.pinIds.length===2?this.tracesByPinPairKey.get(hyn(n.pinIds))??[]:[];if(o.length>0){let r=this.computeInlinePlacement({connection:n,trace:o[0],pinIds:n.pinIds});if(r)this.inlineNetLabelPlacements.push(r)}else for(let r of n.pinIds){let i=this.computeTerminalInlinePlacement(n,r);if(i)this.inlineNetLabelPlacements.push(i)}return}if(!this.hasAlignedPortOnlyStubs){this.inlineNetLabelPlacements=Jri({placements:this.inlineNetLabelPlacements,inputProblem:this.inputProblem,traces:this.traces,netLabelPlacements:this.inputNetLabelPlacements}),this.hasAlignedPortOnlyStubs=!0;return}if(!this.postProcessedOutput){this.postProcessedOutput=this.buildPostProcessedOutput();return}if(this.input.resolveTraceCollisions&&!this.refinementComplete){this.stepTraceRefinement();return}this.solved=!0,this.stats.inlineNetLabelCount=this.inlineNetLabelPlacements.length}computeNetConnectionInlineConversions(t){let n=new Map;for(let r of t){let i=new Set;for(let s of this.getNetConnectionComponents(r)){if(s.traces.length===0)continue;if(!s.traces.some((c)=>Boolean(this.computeInlinePlacement({connection:r,trace:c,pinIds:s.pinIds}))))for(let c of s.traces)i.add(c.mspPairId)}n.set(r,i)}let o=new Set([...n.values()].flatMap((r)=>[...r]));while(!0){let r=t.map((s)=>({connection:s,conversion:this.computeNetConnectionInlinePlacements(s,o,n.get(s)??new Set)})),i=new Set(r.flatMap(({conversion:s})=>s.flatMap((a)=>[...a.supersededTraceIds])));if(Aii(o,i))return r.flatMap(({conversion:s})=>s);o=i}}getNetConnectionComponents(t){let n=t.pinIds[0];if(!n)return[];let o=this.globalConnMap.getNetConnectedToId(n);if(!o)return[];let r=new Set(this.inputProblem.chips.flatMap((a)=>a.pins.map((c)=>c.pinId))),i=this.globalConnMap.getIdsConnectedToNet(o).filter((a)=>r.has(a)),s=new Set(t.pinIds);return F8e({pinIds:i,traces:this.traces.filter((a)=>!this.netLabelConnectorTraceIds.has(a.mspPairId))}).map((a)=>({pinIds:a.pinIds,labeledPinIds:a.pinIds.filter((c)=>s.has(c)),traces:a.traces.sort((c,l)=>dyn(l)-dyn(c))})).filter((a)=>a.labeledPinIds.length>0)}getGlobalConnNetId(t){let n=t.pinIds[0];if(!n)return;let o=new Set(t.pinIds);return this.traces.find((r)=>r.pins.some((i)=>o.has(i.pinId)))?.globalConnNetId??this.inputNetLabelPlacements.find((r)=>r.netId===t.netId)?.globalConnNetId??this.globalConnMap.getNetConnectedToId(n)??void 0}computeNetConnectionInlinePlacements(t,n,o){let r=this.getNetConnectionComponents(t),i=this.getGlobalConnNetId(t);if(!i)return[];let s=[];for(let a of r){let c=a.traces.some((d)=>o.has(d.mspPairId)),l=null;if(!c){for(let d of a.traces)if(l=this.computeInlinePlacement({connection:t,trace:d,pinIds:a.pinIds,ignoredTraceIds:n}),l)break}if(l){s.push({globalConnNetId:i,placements:[l],supersededTraceIds:new Set});continue}if(a.traces.length>0&&!c)continue;if(a.labeledPinIds.length!==a.pinIds.length)continue;let h=a.pinIds.map((d)=>this.computeTerminalInlinePlacement(t,d,i,n));if(h.some((d)=>d===null))continue;s.push({globalConnNetId:i,placements:h,supersededTraceIds:new Set(a.traces.map((d)=>d.mspPairId))})}return s}getInlineOffsets(t,n,o,r,i,s,a){let c=i/2+Bnt,l=n==="x"?"y":"x",h=o==="x+"||o==="y+"?1:-1,d=1/0;for(let u of s){if(a.has(u.mspPairId))continue;for(let _ of nyn(u.tracePath)){if(_.axis!==n)continue;if(Math.max(_.start[n],_.end[n])<=t[n]-r/2||Math.min(_.start[n],_.end[n])>=t[n]+r/2)continue;let p=h*(_.start[l]-t[l]);if(p>Ux)d=Math.min(d,p)}}return d>i+Ux&&d/2<c-Ux?[c,d/2]:[c]}computeTerminalInlinePlacement(t,n,o,r=new Set,i){if(!t.netId)return null;let s=this.inputNetLabelPlacements.find((C)=>C.netId===t.netId&&C.pinIds.length===1&&C.pinIds[0]===n),a=o??s?.globalConnNetId;if(!a)return null;let c=this.inputProblem.chips.find((C)=>C.pins.some((b)=>b.pinId===n)),l=c?.pins.find((C)=>C.pinId===n),h=t.inlineNetLabelHeight??$rt,d=t.netLabelText?.trim()||void 0,u=t.inlineNetLabelWidth??t.netLabelWidth??uyn(d??t.netId,h),_=Math.max(u+0.2,0.6);if(!l&&!s)return null;let p=l?{x:l.x,y:l.y}:s.anchorPoint,m=l&&c?l._facingDirection??Lb(l,c):s.orientation,A=m==="x+"?{x:p.x+_,y:p.y}:m==="x-"?{x:p.x-_,y:p.y}:m==="y+"?{x:p.x,y:p.y+_}:{x:p.x,y:p.y-_},g=Cii({start:p,intendedEnd:A,minimumLength:u+2*Bnt,traces:i?.traces??this.traces,ownGlobalConnNetId:a,ignoredTraceIds:r});if(!g)return null;let f=m==="x+"||m==="x-"?"x":"y",y={x:(p.x+g.x)/2,y:(p.y+g.y)/2},x=f==="x"?["y+","y-"]:["x-","x+"];for(let C of x)for(let b of this.getInlineOffsets(y,f,C,u,h,i?.traces??this.traces,r)){let I=C==="y+"?{x:y.x,y:y.y+b}:C==="y-"?{x:y.x,y:y.y-b}:C==="x-"?{x:y.x-b,y:y.y}:{x:y.x+b,y:y.y},v=u/2,P=h/2,M=f==="x"?{minX:I.x-v,maxX:I.x+v,minY:I.y-P,maxY:I.y+P}:{minX:I.x-P,maxX:I.x+P,minY:I.y-v,maxY:I.y+v};if(this.isObstructed(M,{ownGlobalConnNetId:a,ignoredTraceIds:r,obstacles:i}))continue;return{globalConnNetId:a,netId:t.netId,netLabelText:d,pinIds:[n],stubTracePath:[p,g],axis:f,anchorPoint:y,center:I,width:u,height:h,side:C}}return null}computeInlinePlacement({connection:t,trace:n,pinIds:o,ignoredTraceIds:r=new Set}){let i=nyn(n.tracePath);if(i.length===0)return null;let s=t.inlineNetLabelHeight??$rt,a=t.netLabelText?.trim()||void 0,c=t.inlineNetLabelWidth??t.netLabelWidth??uyn(a??t.netId,s),l=s/2+Bnt,h=i.filter((u)=>u.length>=c).sort((u,_)=>_.length-u.length);for(let u of h){let _=u.axis==="x"?["y+","y-"]:["x-","x+"];for(let p of _)for(let m of xii(u,c))for(let A of this.getInlineOffsets(m,u.axis,p,c,s,this.traces,r)){let g=p==="y+"?{x:m.x,y:m.y+A}:p==="y-"?{x:m.x,y:m.y-A}:p==="x-"?{x:m.x-A,y:m.y}:{x:m.x+A,y:m.y},f=c/2,y=s/2,x=u.axis==="x"?{minX:g.x-f,maxX:g.x+f,minY:g.y-y,maxY:g.y+y}:{minX:g.x-y,maxX:g.x+y,minY:g.y-f,maxY:g.y+f};if(this.isObstructed(x,{ownTrace:n,ownGlobalConnNetId:n.globalConnNetId,ignoredTraceIds:r}))continue;return{globalConnNetId:n.globalConnNetId,netId:t.netId,netLabelText:a,mspPairId:n.mspPairId,pinIds:[...o],axis:u.axis,anchorPoint:m,center:g,width:c,height:s,side:p}}}let d=this.computeSpanPlacement({trace:n,connection:t,netLabelText:a,width:c,height:s,offset:l,pinIds:o,ignoredTraceIds:r});if(d)return d;return null}computeSpanPlacement({trace:t,connection:n,netLabelText:o,width:r,height:i,offset:s,pinIds:a,ignoredTraceIds:c}){let l=t.tracePath;if(l.length<2)return null;let h=1/0,d=-1/0,u=1/0,_=-1/0;for(let P of l)h=Math.min(h,P.x),d=Math.max(d,P.x),u=Math.min(u,P.y),_=Math.max(_,P.y);let p=d-h,m=_-u,A=p>=m?"x":"y",g=A==="x"?p:m;if((A==="x"?m:p)>gii)return null;if(g<r)return null;let C=((A==="x"?h:u)+(A==="x"?d:_))/2,b=(g-r)/2,I=[0];for(let P=0.1;P<=b+0.000000001;P+=0.1)I.push(P,-P);I.push(b,-b);let v=A==="x"?["y+","y-"]:["x-","x+"];for(let P of v)for(let M of I){let B=C+M,T=P==="y+"?{x:B,y:_+s}:P==="y-"?{x:B,y:u-s}:P==="x-"?{x:h-s,y:B}:{x:d+s,y:B},N=r/2,D=i/2,L=A==="x"?{minX:T.x-N,maxX:T.x+N,minY:T.y-D,maxY:T.y+D}:{minX:T.x-D,maxX:T.x+D,minY:T.y-N,maxY:T.y+N};if(this.isObstructed(L,{ownTrace:t,ownGlobalConnNetId:t.globalConnNetId,ignoredTraceIds:c}))continue;let H=A==="x"?{x:B,y:P==="y+"?_:u}:{x:P==="x-"?h:d,y:B};return{globalConnNetId:t.globalConnNetId,netId:n.netId,netLabelText:o,mspPairId:t.mspPairId,pinIds:[...a],axis:A,anchorPoint:H,center:T,width:r,height:i,side:P}}return null}isObstructed(t,{ownTrace:n,ownGlobalConnNetId:o,ignoredTraceIds:r=new Set,obstacles:i}){for(let s of this.inputProblem.chips){let a={minX:s.center.x-s.width/2,maxX:s.center.x+s.width/2,minY:s.center.y-s.height/2,maxY:s.center.y+s.height/2};if(gc(t,a))return!0}for(let s of this.inputProblem.textBoxes??[])if(gc(t,L9(s)))return!0;for(let s of i?.traces??this.traces){if(r.has(s.mspPairId))continue;if(n&&s.mspPairId===n.mspPairId)continue;if(s.globalConnNetId===o)continue;if(BJ(s.tracePath,t))return!0}if(i?.anchored.some((s)=>gc(t,I0(s))))return!0;if(i?.inline.some((s)=>gc(t,Tnt(s))||s.stubTracePath&&s.globalConnNetId!==o&&BJ(s.stubTracePath,t)))return!0;return!1}getOutputTraces(t){let n=new Set(t.map(xS)),o=new Set(this.inlineConversions.filter((r)=>r.placements.every((i)=>n.has(xS(i)))).flatMap((r)=>[...r.supersededTraceIds]));return this.traces.filter((r)=>!o.has(r.mspPairId)&&!(this.netLabelConnectorTraceIds.has(r.mspPairId)&&Xrt(r,t)))}getBlockedInlinePlacements({inlineNetLabelPlacements:t,anchoredNetLabelPlacements:n,traces:o}){let r=new Set;for(let i of t){let s=Tnt(i),a=n.some((d)=>{let u=I0(d);return gc(s,u)||i.stubTracePath&&BJ(i.stubTracePath,u)}),c=o.some((d)=>d.globalConnNetId!==i.globalConnNetId&&(BJ(d.tracePath,s)||i.stubTracePath&&fii(i.stubTracePath,d))),l=t.some((d)=>d!==i&&d.globalConnNetId!==i.globalConnNetId&&d.stubTracePath&&BJ(d.stubTracePath,s)),h=t.some((d)=>d!==i&&gc(s,Tnt(d)));if(a||c||l||h)r.add(xS(i))}for(let i of this.inlineConversions)if(i.placements.some((s)=>r.has(xS(s))))for(let s of i.placements)r.add(xS(s));return r}buildPostProcessedOutput(){let t=this.inlineNetLabelPlacements;while(!0){let n=this.inputNetLabelPlacements.filter((l)=>!Xrt(l,t)),o=this.getOutputTraces(t),{fixedLabels:r,terminalTraces:i}=Wrt(this.inputProblem,t),s=new Mat({inputProblem:this.inputProblem,traces:[...o,...i],netLabelPlacements:n,fixedNetLabelPlacements:r,netLabelConnectorTraceIds:this.netLabelConnectorTraceIds,useRenderedLabelBounds:t.length>0,preserveNonInlineLabelsAgainstInlineEligibleCollisions:!0});if(t.length>0)s.solve();let a=cii({inputProblem:this.inputProblem,traces:o,netLabelPlacements:s.solved&&!s.failed?s.getOutput().netLabelPlacements:n,inlineNetLabelPlacements:t,netLabelConnectorTraceIds:this.netLabelConnectorTraceIds}),c=this.getBlockedInlinePlacements({inlineNetLabelPlacements:t,anchoredNetLabelPlacements:a.netLabelPlacements,traces:a.traces});if(c.size>0){let l=uii({inputProblem:this.inputProblem,traces:a.traces,anchoredNetLabelPlacements:a.netLabelPlacements,inlineNetLabelPlacements:t});if(l.movedGroupCount>0){t=l.inlineNetLabelPlacements;continue}let{terminalTraces:h}=Wrt(this.inputProblem,t),d=t.filter((p)=>!p.stubTracePath),u=t.filter((p)=>p.stubTracePath).sort((p,m)=>Number(c.has(xS(m)))-Number(c.has(xS(p))));for(let p of u){let m=[...this.inputProblem.netConnections,...this.inputProblem.directConnections].find((g)=>g.netId===p.netId&&g.allowInlineNetLabel),A=m?this.computeTerminalInlinePlacement(m,p.pinIds[0],p.globalConnNetId,new Set,{traces:[...a.traces,...h],anchored:a.netLabelPlacements,inline:d}):null;d.push(A??p)}let _=new Map(d.map((p)=>[xS(p),p]));t=t.map((p)=>_.get(xS(p))??p),c=this.getBlockedInlinePlacements({inlineNetLabelPlacements:t,anchoredNetLabelPlacements:a.netLabelPlacements,traces:a.traces})}if(c.size===0){this.inlineNetLabelPlacements=t,this.stats.pushedAnchoredNetLabelCount=a.movedLabelCount;let l=_ii({inputProblem:this.inputProblem,traces:a.traces,netLabelPlacements:a.netLabelPlacements,inlineNetLabelPlacements:t,completedReroutes:this.completedReroutes});this.stats.restoredSupersededLabelRerouteCount=l.restoredTraceCount;let h={traces:l.traces,netLabelConnectorTraceIds:a.netLabelConnectorTraceIds,netLabelPlacements:a.netLabelPlacements,inlineNetLabelPlacements:t};return this.inlineNetLabelPlacements=h.inlineNetLabelPlacements,h}t=t.filter((l)=>!c.has(xS(l)))}}*getTraceRefinementProposals(t){yield*eyn(this.inputProblem,t);for(let n of t.netLabelPlacements){if(n.pinIds.length!==1)continue;let o=[...this.inputProblem.netConnections,...this.inputProblem.directConnections].find((i)=>i.allowInlineNetLabel&&i.netId===n.netId&&i.pinIds.includes(n.pinIds[0]));if(!o)continue;let r=this.computeTerminalInlinePlacement(o,n.pinIds[0],n.globalConnNetId,new Set,{traces:[],anchored:[],inline:[]});if(r)yield*eyn(this.inputProblem,t,[r])}}createRefinementCandidate(t){let n=new Map(t.traces.map((s)=>[s.mspPairId,s])),o=(s)=>JSON.stringify([s.globalConnNetId,[...s.pinIds].sort()]),r=new Map(t.netLabelPlacements.map((s)=>[o(s),s])),i=new Set(this.traces.map((s)=>s.mspPairId));return new e({inputProblem:this.inputProblem,traces:[...this.traces.map((s)=>n.get(s.mspPairId)??s),...t.traces.filter((s)=>!i.has(s.mspPairId))],netLabelPlacements:this.inputNetLabelPlacements.map((s)=>r.get(o(s))??s),completedReroutes:this.completedReroutes,netLabelConnectorTraceIds:t.netLabelConnectorTraceIds})}acceptRefinementCandidate(t,n){let o=this.postProcessedOutput,r=this.refinement.before,i=tyn(n);if(i.some((a)=>!r.some((c)=>u7n(a,c))))return!1;let s=new Set(t.traces.filter((a,c)=>a!==o.traces[c]).map((a)=>a.mspPairId));if(i.some((a)=>a.kind==="trace-label"&&a.trace.kind==="routed"&&s.has(a.trace.id)))return!1;if(i.length>=r.length&&n.inlineNetLabelPlacements.length<=o.inlineNetLabelPlacements.length)return!1;return this.postProcessedOutput=n,this.inlineNetLabelPlacements=n.inlineNetLabelPlacements,!0}stepTraceRefinement(){if(this.activeSubSolver){if(this.activeSubSolver.step(),!this.activeSubSolver.solved&&!this.activeSubSolver.failed)return;if(this.activeSubSolver.solved&&!this.activeSubSolver.failed&&this.acceptRefinementCandidate(this.currentProposal,this.activeSubSolver.getOutput()))this.refinement=void 0;this.activeSubSolver=null,this.currentProposal=void 0;return}let t=this.postProcessedOutput;if(!this.refinement)this.refinement={proposals:this.getTraceRefinementProposals(t),queue:[],collecting:!0,before:tyn(t)};let n=this.refinement;if(n.collecting){let r=n.proposals.next();if(!r.done){let i=r.value.traces.reduce((s,a,c)=>s+a.tracePath.reduce((l,h,d)=>{let u=t.traces[c].tracePath[d];return l+Math.abs(h.x-u.x)+Math.abs(h.y-u.y)},0),0);n.queue.push({output:r.value,distance:i})}else n.queue.sort((i,s)=>i.distance-s.distance),n.collecting=!1;return}let o=n.queue.shift();if(!o){this.refinementComplete=!0;return}this.currentProposal=o.output,this.activeSubSolver=this.createRefinementCandidate(o.output)}getOutput(){if(this.postProcessedOutput)return this.postProcessedOutput;return this.buildPostProcessedOutput()}visualize(){return g7n({inputProblem:this.inputProblem,...this.getOutput()})}};var g7n=({inputProblem:e,traces:t,netLabelPlacements:n,inlineNetLabelPlacements:o})=>{let r=J0(e);r.lines??=[],r.rects??=[],r.points??=[],r.texts??=[];for(let i of t)r.lines.push({points:i.tracePath,strokeColor:"purple"});for(let i of n)r.rects.push({center:i.center,width:i.width,height:i.height,fill:Ic(i.globalConnNetId,0.35),strokeColor:Ic(i.globalConnNetId,0.9),label:`netId: ${i.netId}
globalConnNetId: ${i.globalConnNetId}`}),r.points.push({x:i.anchorPoint.x,y:i.anchorPoint.y,color:Ic(i.globalConnNetId,0.9),label:`anchorPoint
orientation: ${i.orientation}`});for(let i of o){if(i.stubTracePath)r.lines.push({points:i.stubTracePath,strokeColor:"purple"});let s=i.axis==="x",{width:a,height:c}=i;if(!s)a=i.height,c=i.width;r.rects.push({center:i.center,width:a,height:c,fill:Ic(i.globalConnNetId,0.35),strokeColor:"green",label:[`INLINE netId: ${i.netId}`,`axis: ${i.axis}`,`side: ${i.side}`].join(`
`)});let l=i.center.x,h=i.center.y,d="center",u;if(i.stubTracePath){let _=i.stubTracePath[0],p=i.stubTracePath[1],m=i.width/2;if(p[i.axis]>_[i.axis])m=-i.width/2,d="center_left";else d="center_right";if(i.axis==="x")l+=m;else h+=m}if(i.axis==="y")u=90;r.texts.push({x:l,y:h,text:i.netLabelText??i.netId??"",color:"green",fontSize:i.height,anchorSide:d,rotation:u}),r.points.push({x:i.anchorPoint.x,y:i.anchorPoint.y,color:"green",label:`inline anchor
${i.netLabelText??i.netId}`})}return r},uyn=(e,t=$rt)=>{let n=t/0.18;return e.length*0.12*n+0.12*n},xii=(e,t,n=0.1)=>{let o=e.axis==="x"?"x":"y",r=e.start[o],i=e.end[o],s=(r+i)/2,a=Math.sign(i-r)||1,c=(d)=>e.axis==="x"?{x:d,y:e.start.y}:{x:e.start.x,y:e.start.y+(d-r)},l=e.length-t;if(l<=0)return[c(s)];let h=[0];for(let d=n;d<=l/2+0.000000001;d+=n)h.push(d,-d);return h.push(l/2,-l/2),h.map((d)=>c(s+d*a))},BJ=(e,t)=>{for(let n=0;n<e.length-1;n++){let o=e[n],r=e[n+1],i={minX:Math.min(o.x,r.x),maxX:Math.max(o.x,r.x),minY:Math.min(o.y,r.y),maxY:Math.max(o.y,r.y)};if(gc(i,t))return!0}return!1},Ux=0.000001,Cii=({start:e,intendedEnd:t,minimumLength:n,traces:o,ownGlobalConnNetId:r,ignoredTraceIds:i})=>{let s=Math.abs(t.x-e.x)>=Math.abs(t.y-e.y),a=s?"x":"y",c=s?"y":"x",l=Math.sign(t[a]-e[a])||1,h=Math.abs(t[a]-e[a]),d=h;for(let u of o){if(i.has(u.mspPairId))continue;if(u.globalConnNetId===r)continue;for(let _=0;_<u.tracePath.length-1;_++){let p=u.tracePath[_],m=u.tracePath[_+1],A=(p[a]-e[a])*l,g=(m[a]-e[a])*l,f=p[c]-e[c],y=m[c]-e[c],x=Math.min(A,g),C=Math.max(A,g),b=Math.min(f,y),I=Math.max(f,y),v;if(Math.abs(f)<=Ux&&Math.abs(y)<=Ux&&C>=-Ux&&x<=h+Gve+Ux)v=Math.max(0,x);else{let M=b<=Ux&&I>=-Ux,B=(A+g)/2;if(M&&Math.abs(A-g)<=Ux&&B>=-Ux&&B<=h+Gve+Ux)v=Math.max(0,B)}if(v!==void 0)d=Math.min(d,v-Gve)}}if(d+Ux<n)return null;return s?{x:e.x+l*d,y:e.y}:{x:e.x,y:e.y+l*d}},zJ=0.000001,pyn=({coordinate:e,segmentStartCoordinate:t,segmentEndCoordinate:n})=>e>Math.min(t,n)+zJ&&e<Math.max(t,n)-zJ,bii=({firstSegmentStart:e,firstSegmentEnd:t,secondSegmentStart:n,secondSegmentEnd:o})=>{let r=Math.abs(e.y-t.y)<=zJ,i=Math.abs(e.x-t.x)<=zJ,s=Math.abs(n.y-o.y)<=zJ,a=Math.abs(n.x-o.x)<=zJ,c,l;if(r)c=e,l=t;else if(s)c=n,l=o;else return!1;let h,d;if(i)h=e,d=t;else if(a)h=n,d=o;else return!1;return pyn({coordinate:h.x,segmentStartCoordinate:c.x,segmentEndCoordinate:l.x})&&pyn({coordinate:c.y,segmentStartCoordinate:h.y,segmentEndCoordinate:d.y})},myn=(e,t)=>{for(let n=0;n<e.length-1;n++){let o=e[n],r=e[n+1];for(let i of t)for(let s=0;s<i.tracePath.length-1;s++){let a=i.tracePath[s],c=i.tracePath[s+1];if(!Z4(o,r,a,c))continue;if(bii({firstSegmentStart:o,firstSegmentEnd:r,secondSegmentStart:a,secondSegmentEnd:c}))continue;return!0}}return!1},Iii=(e)=>{let t={},n=new Map;for(let o of e.chips){t[o.chipId]=o;for(let r of o.pins)n.set(r.pinId,{...r,chipId:o.chipId,_facingDirection:r._facingDirection??Lb(r,o)})}return{chipMap:t,pinMap:n}},_yn=(e,t)=>{let n=j0(e._facingDirection),o=j0(t._facingDirection),r=t.x-e.x,i=t.y-e.y;if((n.x?Math.abs(i)<=0.000001:Math.abs(r)<=0.000001)&&n.x===-o.x&&n.y===-o.y&&r*n.x+i*n.y>0.000001)return[{x:e.x,y:e.y},{x:t.x,y:t.y}];if(n.x*o.x||n.y*o.y)return;let a=n.x?{x:t.x,y:e.y}:{x:e.x,y:t.y};for(let[c,l]of[[e,n],[t,o]])if((a.x-c.x)*l.x+(a.y-c.y)*l.y<=0.000001)return;return[{x:e.x,y:e.y},a,{x:t.x,y:t.y}]},gue=0.000000001,Uve=(e,t)=>Math.abs(e.y-t.y)<gue,Wve=(e,t)=>Math.abs(e.x-t.x)<gue,vii=(e)=>e.filter((t,n)=>{let o=e[n-1];return!o||Math.abs(t.x-o.x)>=gue||Math.abs(t.y-o.y)>=gue}),Sii=(e)=>{if(e.length<2||!e.every((t,n)=>{let o=e[n+1];if(!o)return!0;return Uve(t,o)||Wve(t,o)}))return!1;for(let t=0;t<e.length-1;t++)for(let n=t+2;n<e.length-1;n++)if(j8n(e[t],e[t+1],e[n],e[n+1]))return!1;return!0},Pii=(e)=>{let t=[];for(let n=2;n<=e.length-4;n++){let o=e[n-1],r=e[n],i=e[n+1],s=e[n+2],a=Wve(r,i),c=Uve(r,i);if(!a&&!c||a&&(!Uve(o,r)||!Uve(i,s))||c&&(!Wve(o,r)||!Wve(i,s)))continue;let l=a?[o.x,s.x]:[o.y,s.y];for(let h of l){if(Math.abs(h-(a?r.x:r.y))<gue)continue;let d=e.map((_)=>({..._}));if(a)d[n].x=h,d[n+1].x=h;else d[n].y=h,d[n+1].y=h;let u=vii(d);if(Sii(u))t.push(u)}}return t},gyn=({tracePath:e,globalConnNetId:t,otherTraces:n})=>n.reduce((o,r)=>o+(r.globalConnNetId===t?0:ZS(e,r.tracePath)),0),Eii=({tracePath:e,globalConnNetId:t,otherTraces:n,isCandidateValid:o})=>{let r=e,i=gyn({tracePath:e,globalConnNetId:t,otherTraces:n}),s=Zx(e);for(let a of Pii(e)){if(!o(a))continue;let c=gyn({tracePath:a,globalConnNetId:t,otherTraces:n}),l=Zx(a);if(c<i||c===i&&l<s)r=a,i=c,s=l}return r},Mii="net-label-to-trace-",wii=0.05,Dnt=0.25,Ayn=(e,t)=>[e,t].sort().join("--"),Nnt=(e,t)=>{let n=Math.abs(e.x-t.x),o=Math.abs(e.y-t.y);if(n>=o)return o;return n},Bii=(e,t)=>{if(e._facingDirection!==t._facingDirection)return!1;let n=Math.abs(e.x-t.x),o=Math.abs(e.y-t.y);if(n>=o)return e._facingDirection==="x+"||e._facingDirection==="x-";return e._facingDirection==="y+"||e._facingDirection==="y-"},fyn=class extends mu{constructor(e,t={}){super();this.input=e,this.options=t,this.inputProblem=e.inputProblem,this.outputTraces=[...e.traces],this.outputNetLabelPlacements=[...e.netLabelPlacements];let{chipMap:n,pinMap:o}=Iii(this.inputProblem);this.chipMap=n,this.pinMap=o,this.canRecoverParallelPair=Q8n(this.inputProblem,Qb(this.inputProblem).netConnMap,new Set(e.traces.filter((r)=>r.pinIds.length>1).flatMap((r)=>r.pinIds))),this.queuedCandidates=this.buildCandidatePairs(),this.stats.candidateCount=this.queuedCandidates.length,this.stats.recoveredTraceCount=0}input;options;inputProblem;outputTraces;outputNetLabelPlacements;recoveredTraceIds=new Set;chipMap;pinMap;canRecoverParallelPair;queuedCandidates;currentCandidate=null;getConstructorParams(){return[this.input,this.options]}isPortOnlyFallbackLabel(e,t){return!(e.pinIds.length!==1||e.mspConnectionPairIds.length!==0||!e.netId||t.has(e.globalConnNetId))}isDirectConnectionLabel(e){if(!e.netId||e.pinIds.length!==1)return!1;let t=e.pinIds[0];return this.inputProblem.directConnections.some((n)=>n.netId===e.netId&&n.pinIds.includes(t))}getMultiPinNetConnection(e){if(!e.netId||e.pinIds.length!==1)return;let t=e.pinIds[0];return this.inputProblem.netConnections.find((n)=>n.isGround===!1&&n.pinIds.length>2&&n.netId===e.netId&&n.pinIds.includes(t))}getTwoPinNetConnection(e){return this.inputProblem.netConnections.find((t)=>!t.isGround&&t.pinIds.length===2&&t.netId===e.netId&&t.pinIds.includes(e.pinIds[0]))}buildCandidatePairs(){let{netConnMap:e}=Qb(this.inputProblem),t=new Set;for(let i of this.inputProblem.netConnections){if(!i.isGround)continue;let s=e.getNetConnectedToId(i.netId);if(s)t.add(s)}let n=new Map;for(let i of this.input.netLabelPlacements){if(!this.isPortOnlyFallbackLabel(i,t)||!this.isDirectConnectionLabel(i)&&!this.getMultiPinNetConnection(i)&&!this.getTwoPinNetConnection(i))continue;let s=n.get(i.globalConnNetId)??[];s.push(i),n.set(i.globalConnNetId,s)}let o=[];for(let i of n.values())for(let s=0;s<i.length;s++)for(let a=s+1;a<i.length;a++){let c=i[s],l=i[a],h=this.pinMap.get(c.pinIds[0]),d=this.pinMap.get(l.pinIds[0]);if(!h||!d)continue;if(!this.canRecoverParallelPair(h,d))continue;let u=Nnt(h,d),_=this.isDirectConnectionLabel(c)&&this.isDirectConnectionLabel(l),p=this.getMultiPinNetConnection(c),m=this.getMultiPinNetConnection(l),A=this.getTwoPinNetConnection(c),g=!_&&A&&h.chipId!==d.chipId&&A===this.getTwoPinNetConnection(l)?_yn(h,d):void 0;if(!g&&!_&&(!p||p!==m||u>wii))continue;if(Sk(this.inputProblem,h,d))continue;if(Pde({inputProblem:this.inputProblem,chipMap:this.chipMap,pinIdMap:this.pinMap,p1:h,p2:d}))continue;o.push({firstLabel:c,secondLabel:l,pins:[h,d],perpendicularOffset:u,routeDistance:Math.abs(h.x-d.x)+Math.abs(h.y-d.y),key:Ayn(h.pinId,d.pinId),recoveryMode:"fallback_labels",simpleConnectionPath:g})}o.push(...this.buildRoutedComponentCandidates(t));let r=this.options.onlyInlineDirectConnections||this.options.onlyInlineConnections?o.filter((i)=>this.options.onlyInlineConnections&&i.simpleConnectionPath?.length===2&&this.inputProblem.netConnections.some((s)=>s.allowInlineNetLabel&&!s.isGround&&s.pinIds.length===2&&i.pins.every((a)=>s.pinIds.includes(a.pinId)))||this.inputProblem.directConnections.some((s)=>i.pins.every((a)=>s.pinIds.includes(a.pinId))&&(s.allowInlineNetLabel||this.inputProblem.netConnections.some((a)=>a.allowInlineNetLabel&&i.pins.every((c)=>a.pinIds.includes(c.pinId)))))):o;return r.sort((i,s)=>i.perpendicularOffset-s.perpendicularOffset||i.routeDistance-s.routeDistance||i.key.localeCompare(s.key)),r}buildRoutedComponentCandidates(e){let{netConnMap:t}=Qb(this.inputProblem),n=[],o=new Set(this.inputProblem.directConnections);for(let r of[...this.inputProblem.netConnections.filter((i)=>i.pinIds.length>2&&i.isGround===!1),...this.inputProblem.directConnections]){let i=o.has(r),s=i&&(this.options.onlyInlineDirectConnections||this.options.onlyInlineConnections),a=t.getNetConnectedToId(r.pinIds[0]);if(!a||i&&e.has(a))continue;let c=r.pinIds;if(i)c=[...this.pinMap.keys()].filter((h)=>t.getNetConnectedToId(h)===a);let l=F8e({pinIds:c,traces:this.outputTraces.filter((h)=>h.globalConnNetId===a)}).filter((h)=>h.traces.length>0);for(let h=0;h<l.length;h++)for(let d=h+1;d<l.length;d++){let u=l[h],_=l[d];if(i&&!(u.pinIds.includes(r.pinIds[0])&&_.pinIds.includes(r.pinIds[1])||u.pinIds.includes(r.pinIds[1])&&_.pinIds.includes(r.pinIds[0])))continue;let p=this.input.netLabelPlacements.find((x)=>x.globalConnNetId===a&&x.mspConnectionPairIds.length>0&&x.pinIds.some((C)=>u.pinIds.includes(C))),m=this.input.netLabelPlacements.find((x)=>x.globalConnNetId===a&&x.mspConnectionPairIds.length>0&&x.pinIds.some((C)=>_.pinIds.includes(C)));if(!p||!m||p===m)continue;let A=Nnt(p.anchorPoint,m.anchorPoint)<=Dnt;if(!A&&!s)continue;let g,f=u.pinIds,y=_.pinIds;if(i)f=r.pinIds.filter((x)=>u.pinIds.includes(x)),y=r.pinIds.filter((x)=>_.pinIds.includes(x));for(let x of f)for(let C of y){let b=this.pinMap.get(x),I=this.pinMap.get(C);if(!b||!I)continue;if(!this.canRecoverParallelPair(b,I))continue;if(i&&b.chipId===I.chipId)continue;let v=Nnt(b,I),P=s&&(!A||v>Dnt)?_yn(b,I):void 0;if((!A||v>Dnt)&&!P||Bii(b,I)||Sk(this.inputProblem,b,I)||Pde({inputProblem:this.inputProblem,chipMap:this.chipMap,pinIdMap:this.pinMap,p1:b,p2:I}))continue;let M=Math.abs(b.x-I.x)+Math.abs(b.y-I.y),B="routed_components";if(i)B="routed_direct_connection";let T={firstLabel:p,secondLabel:m,pins:[b,I],perpendicularOffset:v,routeDistance:M,key:Ayn(b.pinId,I.pinId),recoveryMode:B,netConnectionPinIds:c,simpleConnectionPath:P};if(!g||T.routeDistance<g.routeDistance||T.routeDistance===g.routeDistance&&(T.perpendicularOffset<g.perpendicularOffset||T.perpendicularOffset===g.perpendicularOffset&&T.key.localeCompare(g.key)<0))g=T}if(g)n.push(g)}}return n}isSupersededConnectorTrace(e,t){if(!this.input.netLabelConnectorTraceIds?.has(e.mspPairId))return!1;if(e.pinIds.length!==1)return!1;return t.pins.some((n)=>n.pinId===e.pinIds[0])}routeIntersectsRemainingLabels(e,t){for(let n of this.outputNetLabelPlacements){if(n===t.firstLabel||n===t.secondLabel)continue;if(jrt(e,n))return!0}return this.input.inlineNetLabelPlacements.some((n)=>jrt(e,n))}tryAcceptCurrentRoute(){let e=this.currentCandidate,t=this.activeSubSolver?.solvedTracePath;if(!e||!t)return;let n=this.outputTraces.filter((c)=>!this.isSupersededConnectorTrace(c,e)),o=n;if(e.recoveryMode!=="fallback_labels")o=n.filter((c)=>c.globalConnNetId!==e.firstLabel.globalConnNetId);if(e.simpleConnectionPath){if(t=e.simpleConnectionPath,CB(t,this.activeSubSolver.obstacles)||o.reduce((c,l)=>c+NY(t,l.tracePath,{includeTerminalSegments:!0}).length,0)>1)return}if(myn(t,o)||this.routeIntersectsRemainingLabels(t,e))return;t=Eii({tracePath:t,globalConnNetId:e.firstLabel.globalConnNetId,otherTraces:o,isCandidateValid:(c)=>CB(c,this.activeSubSolver.obstacles)===null&&!myn(c,o)&&!this.routeIntersectsRemainingLabels(c,e)});let[r,i]=e.pins,s=`${Mii}${e.key}`,a={mspPairId:s,dcConnNetId:e.firstLabel.globalConnNetId,globalConnNetId:e.firstLabel.globalConnNetId,pins:[r,i],tracePath:t,mspConnectionPairIds:[s],pinIds:[r.pinId,i.pinId]};if(this.recoveredTraceIds.add(s),this.outputTraces=[...n,a],e.recoveryMode!=="routed_components")this.outputNetLabelPlacements=this.outputNetLabelPlacements.filter((c)=>c!==e.firstLabel&&c!==e.secondLabel);this.stats.recoveredTraceCount++}areCandidatePinsAlreadyConnected(e){if(!e.netConnectionPinIds)return!1;return F8e({pinIds:e.netConnectionPinIds,traces:this.outputTraces}).some((t)=>t.pinIds.includes(e.pins[0].pinId)&&t.pinIds.includes(e.pins[1].pinId))}_step(){if(this.activeSubSolver){if(this.activeSubSolver.step(),this.activeSubSolver.solved)this.tryAcceptCurrentRoute(),this.activeSubSolver=null,this.currentCandidate=null;else if(this.activeSubSolver.failed)this.activeSubSolver=null,this.currentCandidate=null;return}let e=this.queuedCandidates.shift();while(e&&(!this.outputNetLabelPlacements.includes(e.firstLabel)||!this.outputNetLabelPlacements.includes(e.secondLabel)||this.areCandidatePinsAlreadyConnected(e)))e=this.queuedCandidates.shift();if(!e){this.solved=!0;return}this.currentCandidate=e,this.activeSubSolver=new gZ({inputProblem:this.inputProblem,pins:e.pins,chipMap:this.chipMap})}getOutput(){return{traces:this.outputTraces,netLabelPlacements:this.outputNetLabelPlacements,inlineNetLabelPlacements:this.input.inlineNetLabelPlacements}}visualize(){if(this.activeSubSolver)return this.activeSubSolver.visualize();let e=g7n({inputProblem:this.inputProblem,...this.getOutput()});for(let t of this.outputTraces){if(!this.recoveredTraceIds.has(t.mspPairId))continue;e.lines.push({points:t.tracePath,strokeColor:"green",label:`recovered from net labels: ${t.pinIds.join(" -> ")}`})}return e}};function Nd(e,t,n,o={}){return{solverName:e,solverClass:t,getConstructorParams:n,onSolved:o.onSolved,shouldSkip:o.shouldSkip}}var A7n=class extends mu{getSolverName(){return"SchematicTracePipelineSolver"}mspConnectionPairSolver;schematicTraceLinesSolver;longDistancePairSolver;unroutedTraceRecoverySolver;traceOverlapShiftSolver;netLabelPlacementSolver;labelMergingSolver;traceLabelOverlapAvoidanceSolver;traceCleanupSolver;example28Solver;availableNetOrientationSolver;postLabelTraceOverlapShiftSolver;railNetLabelCornerPlacementSolver;traceAnchoredNetLabelOverlapSolver;finalTraceAnchoredNetLabelOverlapSolver;preAlignmentNetLabelTraceCollisionSolver;netLabelTraceCollisionSolver;traceCleanupSolver2;netLabelNetLabelCollisionSolver;finalRailNetLabelCornerPlacementSolver;traceElbowTransitionSimplificationSolver;preAlignmentTraceElbowTransitionSimplificationSolver;finalTraceElbowTransitionSimplificationSolver;sameNetJunctionAlignmentSolver;inlineDirectTraceRecoverySolver;inlineNetLabelSolver;netLabelToTraceSolver;startTimeOfPhase;endTimeOfPhase;timeSpentOnPhase;firstIterationOfPhase;inputProblem;hideRatsNet;pipelineDef=[Nd("mspConnectionPairSolver",hei,()=>[{inputProblem:this.inputProblem}],{onSolved:(e)=>{}}),Nd("schematicTraceLinesSolver",wei,()=>[{mspConnectionPairs:this.mspConnectionPairSolver.mspConnectionPairs,dcConnMap:this.mspConnectionPairSolver.dcConnMap,globalConnMap:this.mspConnectionPairSolver.globalConnMap,inputProblem:this.inputProblem,chipMap:this.mspConnectionPairSolver.chipMap}]),Nd("longDistancePairSolver",mti,(e)=>[{inputProblem:e.inputProblem,primaryMspConnectionPairs:e.mspConnectionPairSolver.mspConnectionPairs,alreadySolvedTraces:e.schematicTraceLinesSolver.solvedTracePaths,failedConnectionPairs:e.schematicTraceLinesSolver.failedConnectionPairs}],{onSolved:(e)=>{}}),Nd("unroutedTraceRecoverySolver",gri,(e)=>[{inputProblem:e.inputProblem,failedConnectionPairs:e.schematicTraceLinesSolver.failedConnectionPairs,alreadySolvedTraces:e.longDistancePairSolver.getOutput().allTracesMerged}]),Nd("traceOverlapShiftSolver",q2n,()=>[{inputProblem:this.inputProblem,inputTracePaths:this.unroutedTraceRecoverySolver?.getOutput().allTracesMerged,globalConnMap:this.mspConnectionPairSolver.globalConnMap}],{onSolved:(e)=>{}}),Nd("netLabelPlacementSolver",t1n,()=>[{inputProblem:this.inputProblem,inputTraceMap:this.traceOverlapShiftSolver?.correctedTraceMap??Object.fromEntries(this.unroutedTraceRecoverySolver.getOutput().allTracesMerged.map((e)=>[e.mspPairId,e]))}],{onSolved:(e)=>{}}),Nd("traceLabelOverlapAvoidanceSolver",iti,(e)=>{let t=e.traceOverlapShiftSolver?.correctedTraceMap??Object.fromEntries(e.unroutedTraceRecoverySolver.getOutput().allTracesMerged.map((r)=>[r.mspPairId,r])),n=Object.values(t),o=e.netLabelPlacementSolver.netLabelPlacements;return[{inputProblem:e.inputProblem,traces:n,netLabelPlacements:o}]}),Nd("traceElbowTransitionSimplificationSolver",Pnt,(e)=>{let t=e.traceLabelOverlapAvoidanceSolver.getOutput();return[{inputProblem:e.inputProblem,traces:t.traces,completedReroutes:t.completedReroutes,netLabelPlacements:e.traceLabelOverlapAvoidanceSolver.netLabelPlacements,paddingBuffer:0.1}]}),Nd("traceCleanupSolver",b1n,(e)=>{let n=e.traceElbowTransitionSimplificationSolver.getOutput().traces,o=e.traceOverlapShiftSolver,r=new Set([...e.inputProblem.directConnections,...e.inputProblem.netConnections].filter((a)=>a.allowInlineNetLabel).map((a)=>a.netId)),i=new Set;for(let a=0;a<o.inputTracePaths.length;a++){let c=o.inputTracePaths[a],l=o.correctedTraceMap[c.mspPairId];for(let h=a+1;h<o.inputTracePaths.length;h++){let d=o.inputTracePaths[h];if(c.globalConnNetId===d.globalConnNetId)continue;if(!r.has(c.userNetId??"")&&!r.has(d.userNetId??""))continue;let u=o.correctedTraceMap[d.mspPairId],_=NY(c.tracePath,d.tracePath).length;if(NY(l.tracePath,u.tracePath).length>_)i.add(c.mspPairId),i.add(d.mspPairId)}}let s=e.traceLabelOverlapAvoidanceSolver.labelMergingSolver.getOutput();return[{inputProblem:e.inputProblem,allTraces:n,allLabelPlacements:s.netLabelPlacements,mergedLabelNetIdMap:s.mergedLabelNetIdMap,paddingBuffer:0.1,eligibleTraceIds:i}]}),Nd("netLabelPlacementSolver",t1n,(e)=>{let t=e.traceCleanupSolver?.getOutput().traces??e.traceLabelOverlapAvoidanceSolver.getOutput().traces;return[{inputProblem:e.inputProblem,inputTraceMap:Object.fromEntries(t.map((n)=>[n.mspPairId,n]))}]}),Nd("example28Solver",Vni,(e)=>{let t=e.traceCleanupSolver?.getOutput().traces??e.traceLabelOverlapAvoidanceSolver.getOutput().traces;return[{inputProblem:e.inputProblem,traces:t,netLabelPlacements:e.netLabelPlacementSolver.netLabelPlacements}]}),Nd("availableNetOrientationSolver",eoi,(e)=>[{inputProblem:e.inputProblem,traces:e.example28Solver.outputTraces,netLabelPlacements:e.example28Solver.outputNetLabelPlacements}]),Nd("postLabelTraceOverlapShiftSolver",q2n,(e)=>[{inputProblem:e.inputProblem,inputTracePaths:e.availableNetOrientationSolver.traces,globalConnMap:e.mspConnectionPairSolver.globalConnMap,traceIdsToShift:new Set(e.availableNetOrientationSolver.netLabelConnectorTraceIds)}]),Nd("railNetLabelCornerPlacementSolver",B1n,(e)=>[{inputProblem:e.inputProblem,traces:Object.values(e.postLabelTraceOverlapShiftSolver.correctedTraceMap),netLabelPlacements:e.availableNetOrientationSolver.outputNetLabelPlacements,netLabelConnectorTraceIds:e.availableNetOrientationSolver.netLabelConnectorTraceIds}]),Nd("traceAnchoredNetLabelOverlapSolver",H1n,(e)=>[{inputProblem:e.inputProblem,netLabelConnectorTraceIds:e.availableNetOrientationSolver.netLabelConnectorTraceIds,traces:e.railNetLabelCornerPlacementSolver.getOutput().traces,netLabelPlacements:e.railNetLabelCornerPlacementSolver.outputNetLabelPlacements}]),Nd("preAlignmentNetLabelTraceCollisionSolver",z1n,(e)=>[{inputProblem:e.inputProblem,traces:e.railNetLabelCornerPlacementSolver.getOutput().traces,netLabelPlacements:e.traceAnchoredNetLabelOverlapSolver.outputNetLabelPlacements}]),Nd("preAlignmentTraceElbowTransitionSimplificationSolver",Pnt,(e)=>{let t=e.preAlignmentNetLabelTraceCollisionSolver.getOutput();return[{inputProblem:e.inputProblem,traces:t.traces,completedReroutes:t.completedReroutes,netLabelPlacements:t.netLabelPlacements,paddingBuffer:0.1,allowShorterPaths:!0}]}),Nd("traceCleanupSolver2",b1n,(e)=>{let t=e.preAlignmentTraceElbowTransitionSimplificationSolver.getOutput(),n=e.traceLabelOverlapAvoidanceSolver.labelMergingSolver.getOutput();return[{inputProblem:e.inputProblem,allTraces:t.traces,allLabelPlacements:t.netLabelPlacements,mergedLabelNetIdMap:n.mergedLabelNetIdMap,paddingBuffer:0.1,operations:["rerouting_generated_net_label_connector_crossings","aligning_same_net_rails"],eligibleTraceIds:new Set(e.traceCleanupSolver.getOutput().traces.map((o)=>o.mspPairId)),netLabelConnectorTraceIds:e.availableNetOrientationSolver.netLabelConnectorTraceIds}]}),Nd("netLabelTraceCollisionSolver",z1n,(e)=>{let t=e.preAlignmentNetLabelTraceCollisionSolver.getOutput(),n=e.traceCleanupSolver2.getOutput(),o=gni({originalTraces:t.traces,reroutedTraces:n.traces,netLabelPlacements:t.netLabelPlacements}),r=new Map(t.traces.map((s)=>[s.mspPairId,s])),i=o.netLabelPlacements;for(let s of o.traces){let a=r.get(s.mspPairId);if(!a||a.tracePath===s.tracePath)continue;let c=i;i=RZ({trace:a,originalTracePath:a.tracePath,reroutedTracePath:s.tracePath,netLabelPlacements:c}).map((h,d)=>{let u=c[d];return u.orientation==="y+"||u.orientation==="y-"?h:u})}return[{inputProblem:e.inputProblem,traces:o.traces,netLabelPlacements:i}]}),Nd("finalTraceElbowTransitionSimplificationSolver",Pnt,(e)=>{let t=e.netLabelTraceCollisionSolver.getOutput(),n=[...e.traceLabelOverlapAvoidanceSolver.getOutput().completedReroutes,...e.preAlignmentNetLabelTraceCollisionSolver.getOutput().completedReroutes,...t.completedReroutes];return[{inputProblem:e.inputProblem,traces:t.traces,completedReroutes:n,netLabelPlacements:t.netLabelPlacements,paddingBuffer:0.1,allowShorterPaths:!0}]}),Nd("finalRailNetLabelCornerPlacementSolver",B1n,(e)=>[{inputProblem:e.inputProblem,...e.finalTraceElbowTransitionSimplificationSolver.getOutput(),originalTraces:e.railNetLabelCornerPlacementSolver.getOutput().traces,netLabelConnectorTraceIds:e.availableNetOrientationSolver.netLabelConnectorTraceIds,onlyOverlappingLabels:!0}]),Nd("netLabelNetLabelCollisionSolver",Mat,(e)=>{let t=e.finalRailNetLabelCornerPlacementSolver.getOutput();return[{inputProblem:e.inputProblem,traces:t.traces,netLabelPlacements:t.netLabelPlacements,preserveNonInlineLabelsAgainstInlineEligibleCollisions:!0}]}),Nd("finalTraceAnchoredNetLabelOverlapSolver",H1n,(e)=>[{inputProblem:e.inputProblem,netLabelConnectorTraceIds:e.availableNetOrientationSolver.netLabelConnectorTraceIds,traces:e.netLabelNetLabelCollisionSolver.traces,netLabelPlacements:e.netLabelNetLabelCollisionSolver.getOutput().netLabelPlacements,overlapMode:"traces"}]),Nd("sameNetJunctionAlignmentSolver",Uri,(e)=>{let t=e.finalTraceAnchoredNetLabelOverlapSolver.getOutput();return[{inputProblem:e.inputProblem,traces:e.netLabelNetLabelCollisionSolver.traces,netLabelPlacements:t.netLabelPlacements,netLabelConnectorTraceIds:e.availableNetOrientationSolver.netLabelConnectorTraceIds}]}),Nd("inlineDirectTraceRecoverySolver",fyn,(e)=>[{inputProblem:e.inputProblem,...e.sameNetJunctionAlignmentSolver.getOutput(),inlineNetLabelPlacements:[],netLabelConnectorTraceIds:e.availableNetOrientationSolver.netLabelConnectorTraceIds},{onlyInlineConnections:!0}]),Nd("inlineNetLabelSolver",yii,(e)=>{let t=e.inlineDirectTraceRecoverySolver.getOutput(),n=[...e.traceLabelOverlapAvoidanceSolver.getOutput().completedReroutes,...e.preAlignmentNetLabelTraceCollisionSolver.getOutput().completedReroutes,...e.netLabelTraceCollisionSolver.getOutput().completedReroutes];return[{inputProblem:e.inputProblem,traces:t.traces,netLabelPlacements:t.netLabelPlacements,completedReroutes:n,resolveTraceCollisions:!0,netLabelConnectorTraceIds:e.availableNetOrientationSolver.netLabelConnectorTraceIds}]}),Nd("netLabelToTraceSolver",fyn,(e)=>{let t=e.inlineNetLabelSolver.getOutput();return[{inputProblem:e.inputProblem,...t}]})];constructor(e,t){super();this.hideRatsNet=t?.hideRatsNet??!1,this.inputProblem=this.cloneAndCorrectInputProblem(e),this.MAX_ITERATIONS=1e6,this.startTimeOfPhase={},this.endTimeOfPhase={},this.timeSpentOnPhase={},this.firstIterationOfPhase={}}getConstructorParams(){return[this.inputProblem,{hideRatsNet:this.hideRatsNet}]}currentPipelineStepIndex=0;cloneAndCorrectInputProblem(e){let t=structuredClone({...e,_chipObstacleSpatialIndex:void 0,_hideRatsNet:this.hideRatsNet});return sti(t),t}_step(){let e=this.pipelineDef[this.currentPipelineStepIndex];if(!e){this.solved=!0;return}if(this.activeSubSolver){if(this.activeSubSolver.step(),this.activeSubSolver.solved)this.endTimeOfPhase[e.solverName]=performance.now(),this.timeSpentOnPhase[e.solverName]=this.endTimeOfPhase[e.solverName]-this.startTimeOfPhase[e.solverName],e.onSolved?.(this),this.activeSubSolver=null,this.currentPipelineStepIndex++;else if(this.activeSubSolver.failed)this.error=this.activeSubSolver?.error,this.failed=!0,this.activeSubSolver=null;return}let t=e.getConstructorParams(this);this.activeSubSolver=new e.solverClass(...t),this[e.solverName]=this.activeSubSolver,this.timeSpentOnPhase[e.solverName]=0,this.startTimeOfPhase[e.solverName]=performance.now(),this.firstIterationOfPhase[e.solverName]=this.iterations}solveUntilPhase(e){while(this.getCurrentPhase().toLowerCase()!==e.toLowerCase())this.step()}getCurrentPhase(){return this.pipelineDef[this.currentPipelineStepIndex]?.solverName??"none"}visualize(){if(!this.solved&&this.activeSubSolver)return this.activeSubSolver.visualize();let e=[J0(this.inputProblem,{hideRatsNet:this.hideRatsNet}),...this.pipelineDef.map((n)=>this[n.solverName]?.visualize()).filter(Boolean).map((n,o)=>{for(let r of n.rects??[])r.step=o;for(let r of n.points??[])r.step=o;for(let r of n.circles??[])r.step=o;for(let r of n.texts??[])r.step=o;for(let r of n.lines??[])r.step=o;return n})];if(e.length===1)return e[0];let t={points:e.flatMap((n)=>n.points||[]),rects:e.flatMap((n)=>n.rects||[]),lines:e.flatMap((n)=>n.lines||[]),circles:e.flatMap((n)=>n.circles||[]),texts:e.flatMap((n)=>n.texts||[])};return Yei(t,this.inputProblem),t}preview(){if(this.activeSubSolver)return this.activeSubSolver.preview();return super.preview()}},Rnt=0.00000001,Tii=(e,t,n)=>{let o=(e.y-t.y)*(n.x-t.x)-(e.x-t.x)*(n.y-t.y);if(Math.abs(o)>Rnt)return!1;let r=(e.x-t.x)*(n.x-t.x)+(e.y-t.y)*(n.y-t.y);if(r<-Rnt)return!1;let i=(n.x-t.x)**2+(n.y-t.y)**2;return r<=i+Rnt},yyn=(e,t)=>{let n=!1;for(let o=0,r=t.vertices.length-1;o<t.vertices.length;r=o++){let i=t.vertices[o],s=t.vertices[r];if(Tii(e,s,i))return!0;if(i.y>e.y!==s.y>e.y&&e.x<(s.x-i.x)*(e.y-i.y)/(s.y-i.y)+i.x)n=!n}return n},Dii=(e,t)=>yyn(e,t.outer_ring)&&!t.inner_rings.some((n)=>yyn(e,n)),Nii=(e,t)=>t.some((n)=>Dii(e,n)),xyn=(e)=>{let t=e.flatMap((n)=>n.outer_ring.vertices);if(t.length===0)return;return{minX:Math.min(...t.map((n)=>n.x)),maxX:Math.max(...t.map((n)=>n.x)),minY:Math.min(...t.map((n)=>n.y)),maxY:Math.max(...t.map((n)=>n.y))}},Cyn=({center:e,radius:t,shapes:n})=>{let o=[e];for(let r=0;r<32;r++){let i=r/32*Math.PI*2;o.push({x:e.x+Math.cos(i)*t,y:e.y+Math.sin(i)*t})}return o.every((r)=>Nii(r,n))},Qnt=(e,t)=>t.some((n)=>String(n)===String(e)),Rii=(e)=>{if(e.do_not_place||!e.obstructs_within_bounds)return;return{kind:"rect",center:e.center,width:e.width,height:e.height,ccwRotation:e.rotation}},Qii=(e)=>{if(e.shape==="circle")return{kind:"circle",center:{x:e.x,y:e.y},radius:e.radius};if(e.shape==="polygon")return{kind:"polygon",points:e.points};return{kind:"rect",center:{x:e.x,y:e.y},width:e.width,height:e.height,ccwRotation:e.shape==="rotated_rect"||e.shape==="rotated_pill"?e.ccw_rotation:0}},kii=(e)=>{if(e.shape==="circle")return{kind:"circle",center:{x:e.x,y:e.y},radius:e.outer_diameter/2};if("outer_width"in e)return{kind:"rect",center:{x:e.x,y:e.y},width:e.outer_width,height:e.outer_height,ccwRotation:e.ccw_rotation};if(e.shape==="hole_with_polygon_pad"){let t=(e.ccw_rotation??0)*Math.PI/180,n=Math.cos(t),o=Math.sin(t);return{kind:"polygon",points:e.pad_outline.map((r)=>({x:e.x+r.x*n-r.y*o,y:e.y+r.x*o+r.y*n}))}}return{kind:"rect",center:{x:e.x,y:e.y},width:e.rect_pad_width,height:e.rect_pad_height,ccwRotation:"rect_ccw_rotation"in e?e.rect_ccw_rotation??0:0}},Lii=(e)=>{if("hole_diameter"in e){if(e.hole_shape==="circle")return{kind:"circle",center:{x:e.x,y:e.y},radius:e.hole_diameter/2};return{kind:"rect",center:{x:e.x,y:e.y},width:e.hole_diameter,height:e.hole_diameter,ccwRotation:0}}return{kind:"rect",center:{x:e.x,y:e.y},width:e.hole_width,height:e.hole_height,ccwRotation:e.hole_shape==="rotated_pill"?e.ccw_rotation:0}},Hii=(e,t,n)=>{let o=n.x-t.x,r=n.y-t.y,i=o**2+r**2;if(i===0)return Math.hypot(e.x-t.x,e.y-t.y);let s=Math.max(0,Math.min(1,((e.x-t.x)*o+(e.y-t.y)*r)/i));return Math.hypot(e.x-(t.x+s*o),e.y-(t.y+s*r))},Fii=(e,t)=>{let n=!1;for(let o=0,r=t.length-1;o<t.length;r=o++){let i=t[o],s=t[r];if(i.y>e.y!==s.y>e.y&&e.x<(s.x-i.x)*(e.y-i.y)/(s.y-i.y)+i.x)n=!n}return n},zii=(e,t,n)=>{if(n.kind==="circle")return Math.hypot(e.x-n.center.x,e.y-n.center.y)<t+n.radius;if(n.kind==="polygon"){if(Fii(e,n.points))return!0;return n.points.some((h,d)=>Boolean(Hii(e,h,n.points[(d+1)%n.points.length])<t))}let o=-n.ccwRotation*Math.PI/180,r=e.x-n.center.x,i=e.y-n.center.y,s=r*Math.cos(o)-i*Math.sin(o),a=r*Math.sin(o)+i*Math.cos(o),c=Math.max(Math.abs(s)-n.width/2,0),l=Math.max(Math.abs(a)-n.height/2,0);return Math.hypot(c,l)<t},Oii=(e,t)=>e.flatMap((n)=>{if(n.type==="pcb_component"&&Qnt(n.layer,t)){let o=Rii(n);return o?[o]:[]}if(n.type==="pcb_smtpad"&&Qnt(n.layer,t))return[Qii(n)];if(n.type==="pcb_plated_hole"&&n.layers.some((o)=>Qnt(o,t)))return[kii(n)];if(n.type==="pcb_hole")return[Lii(n)];return[]}),Vii=({center:e,radius:t,obstacles:n})=>n.some((o)=>zii(e,t,o)),Yii=(e={})=>{let t={sourceNetIds:e.sourceNetIds?new Set(e.sourceNetIds):void 0,layers:e.layers??["top","bottom"],viaStitchPitch:e.viaStitchPitch??1,viaHoleDiameter:e.viaHoleDiameter??0.3,viaOuterDiameter:e.viaOuterDiameter??0.6,pourEdgeClearance:e.pourEdgeClearance??0.2,obstacleClearance:e.obstacleClearance??0.2,minimumViaSeparation:e.minimumViaSeparation??Math.max(e.viaOuterDiameter??0.6,0.8),gridOrigin:e.gridOrigin??{x:0,y:0},isTented:e.isTented??!0};for(let[n,o]of[["viaStitchPitch",t.viaStitchPitch],["viaHoleDiameter",t.viaHoleDiameter],["viaOuterDiameter",t.viaOuterDiameter],["minimumViaSeparation",t.minimumViaSeparation]])if(!Number.isFinite(o)||o<=0)throw Error(`${n} must be a finite number greater than zero`);if(!Number.isFinite(t.pourEdgeClearance)||t.pourEdgeClearance<0)throw Error("pourEdgeClearance must be a finite non-negative number");if(!Number.isFinite(t.obstacleClearance)||t.obstacleClearance<0)throw Error("obstacleClearance must be a finite non-negative number");if(!Number.isFinite(t.gridOrigin.x)||!Number.isFinite(t.gridOrigin.y))throw Error("gridOrigin coordinates must be finite numbers");if(t.viaHoleDiameter>=t.viaOuterDiameter)throw Error("viaHoleDiameter must be smaller than viaOuterDiameter");if(String(t.layers[0])===String(t.layers[1]))throw Error("layers must contain two distinct PCB layers");return t},Gii=(e)=>e.type==="pcb_copper_pour"&&e.shape==="brep",Uii=(e,t)=>{let n=new Map(e.circuitJson.filter((a)=>a.type==="source_net").map((a)=>[a.source_net_id,a])),o=new Map;for(let a of e.circuitJson){if(!Gii(a)||!a.source_net_id)continue;if(t.sourceNetIds&&!t.sourceNetIds.has(a.source_net_id))continue;let c=o.get(a.source_net_id)??[];c.push(a),o.set(a.source_net_id,c)}let[r,i]=t.layers,s=[];for(let[a,c]of o){let l=c.filter((d)=>String(d.layer)===String(r)),h=c.filter((d)=>String(d.layer)===String(i));if(l.length===0||h.length===0)continue;s.push({sourceNetId:a,sourceNet:n.get(a),fromLayerPours:l,toLayerPours:h})}return s},Wii=(e,t)=>(e.outer_diameter??t*2)/2,Xii=({center:e,radius:t,occupiedVias:n,minimumViaSeparation:o})=>n.some((r)=>Math.hypot(e.x-r.center.x,e.y-r.center.y)<Math.max(o,t+r.radius)),byn=({minimum:e,maximum:t,origin:n,pitch:o})=>{let r=[],i=Math.ceil((e-n)/o),s=Math.floor((t-n)/o);for(let a=i;a<=s;a++)r.push(n+a*o);return r},f7n=class extends co{constructor(e){super();this.input=e,this.options=Yii(e.options),this.copperPourPairContexts=Uii(e,this.options),this.stitchingObstacles=Oii(e.circuitJson,this.options.layers);let t=this.options.viaOuterDiameter/2;for(let n of e.circuitJson)if(n.type==="pcb_via"){let o=n;this.existingPcbViaIds.add(o.pcb_via_id),this.occupiedVias.push({center:{x:o.x,y:o.y},radius:o.outer_diameter/2})}else if(n.type==="pcb_trace")for(let o of n.route){if(o.route_type!=="via")continue;this.occupiedVias.push({center:{x:o.x,y:o.y},radius:Wii(o,t)})}}input;options;copperPourPairContexts;pcbVias=[];occupiedVias=[];existingPcbViaIds=new Set;stitchingObstacles;nextCopperPourPairIndex=0;nextViaId=0;_step(){let e=this.copperPourPairContexts[this.nextCopperPourPairIndex];if(!e){this.solved=!0,this.progress=1;return}this.processCopperPourPair(e),this.nextCopperPourPairIndex+=1,this.progress=this.copperPourPairContexts.length===0?1:this.nextCopperPourPairIndex/this.copperPourPairContexts.length,this.solved=this.nextCopperPourPairIndex===this.copperPourPairContexts.length}processCopperPourPair(e){let[t,n]=this.options.layers,o=e.fromLayerPours.map((_)=>_.brep_shape),r=e.toLayerPours.map((_)=>_.brep_shape),i=xyn(o),s=xyn(r);if(!i||!s)return;let a={minX:Math.max(i.minX,s.minX),maxX:Math.min(i.maxX,s.maxX),minY:Math.max(i.minY,s.minY),maxY:Math.min(i.maxY,s.maxY)};if(a.minX>a.maxX||a.minY>a.maxY)return;let c=this.options.viaOuterDiameter/2,l=c+this.options.pourEdgeClearance,h=c+this.options.obstacleClearance,d=byn({minimum:a.minX+l,maximum:a.maxX-l,origin:this.options.gridOrigin.x,pitch:this.options.viaStitchPitch}),u=byn({minimum:a.minY+l,maximum:a.maxY-l,origin:this.options.gridOrigin.y,pitch:this.options.viaStitchPitch});for(let _ of u)for(let p of d){let m={x:p,y:_};if(Xii({center:m,radius:c,occupiedVias:this.occupiedVias,minimumViaSeparation:this.options.minimumViaSeparation})||Vii({center:m,radius:h,obstacles:this.stitchingObstacles})||!Cyn({center:m,radius:l,shapes:o})||!Cyn({center:m,radius:l,shapes:r}))continue;let A=`via_stitch_via_${this.nextViaId++}`;while(this.existingPcbViaIds.has(A))A=`via_stitch_via_${this.nextViaId++}`;let g=e.fromLayerPours[0],f={type:"pcb_via",pcb_via_id:A,x:p,y:_,hole_diameter:this.options.viaHoleDiameter,outer_diameter:this.options.viaOuterDiameter,layers:[t,n],from_layer:t,to_layer:n,source_net_id:e.sourceNetId,subcircuit_id:g.subcircuit_id,pcb_group_id:g.pcb_group_id,subcircuit_connectivity_map_key:e.sourceNet?.subcircuit_connectivity_map_key,is_tented:this.options.isTented};this.pcbVias.push(f),this.existingPcbViaIds.add(A),this.occupiedVias.push({center:m,radius:c})}}getOutput(){return{processedCopperPourPairCount:this.copperPourPairContexts.length,pcbVias:this.pcbVias}}},jii={DogboneFanoutSolver:w3n,BusLanesSolver:Nf,BusLanesPipelineSolver:i8n,PackSolver2:Ow,LayoutPipelineSolver:$6e,AutoroutingPipelineSolver:jle,AssignableAutoroutingPipeline2:Xsn,AssignableAutoroutingPipeline3:Yan,AutoroutingPipeline1_OriginalUnravel:Ysn,AutoroutingPipelineSolver3_HgPortPointPathing:Wan,AutoroutingPipelineSolver4:pZe,AutoroutingPipelineSolver5:Xcn,AutoroutingPipelineSolver7_MultiGraph:Sln,AutoroutingPipelineSolver8:Pln,AutoroutingPipelineSolver9_PreloadedTraceGraph:jle,AutoroutingPipelineSolver9_Networked:S6e,AutoroutingPipelineSolver11_Simplification:Kln,CopperPourPipelineSolver:w6e,CreateFdmEnclosureSolver:D6e,FanoutSolver:kve,ImplicitCopperPourPipelineSolver:VZr,SchematicTracePipelineSolver:A7n,ViaStitchSolver:f7n},Kii="capacity-autorouter:",Iyn=new WeakMap;function knt(e){return typeof e==="object"&&e!==null&&"then"in e&&typeof e.then==="function"}function vyn(e){return e.constructor.name==="AsyncFunction"}var $ii=class{constructor(e){this.localCacheEngine=e,this.isSyncCache=!vyn(e.getItem)&&!vyn(e.setItem)}localCacheEngine;isSyncCache;cacheHits=0;cacheMisses=0;cacheHitsByPrefix={};cacheMissesByPrefix={};knownCacheKeys=new Set;getCachedSolutionSync(e){if(!this.isSyncCache)return;this.knownCacheKeys.add(e);try{let t=this.localCacheEngine.getItem(this.getLocalCacheEngineKey(e));if(knt(t)){this.isSyncCache=!1,Promise.resolve(t).catch(()=>{}),this.recordCacheMiss(e);return}return this.parseCachedItem(e,t)}catch{this.recordCacheMiss(e);return}}async getCachedSolution(e){this.knownCacheKeys.add(e);try{let t=await this.localCacheEngine.getItem(this.getLocalCacheEngineKey(e));return this.parseCachedItem(e,t)}catch{this.recordCacheMiss(e);return}}setCachedSolutionSync(e,t){if(!this.isSyncCache)return;this.knownCacheKeys.add(e);try{let n=JSON.stringify(t);if(n===void 0)return;let o=this.localCacheEngine.setItem(this.getLocalCacheEngineKey(e),n);if(knt(o))this.isSyncCache=!1,Promise.resolve(o).catch(()=>{})}catch{}}async setCachedSolution(e,t){this.knownCacheKeys.add(e);try{let n=JSON.stringify(t);if(n===void 0)return;await this.localCacheEngine.setItem(this.getLocalCacheEngineKey(e),n)}catch{}}getAllCacheKeys(){return[...this.knownCacheKeys]}clearCache(){for(let e of this.knownCacheKeys){let t=this.getLocalCacheEngineKey(e);try{let n=this.localCacheEngine.removeItem?this.localCacheEngine.removeItem(t):this.localCacheEngine.setItem(t,"null");if(knt(n))Promise.resolve(n).catch(()=>{})}catch{}}this.knownCacheKeys.clear(),this.cacheHits=0,this.cacheMisses=0,this.cacheHitsByPrefix={},this.cacheMissesByPrefix={}}getLocalCacheEngineKey(e){return`${Kii}${e}`}parseCachedItem(e,t){if(t===null){this.recordCacheMiss(e);return}try{let n=JSON.parse(t);if(n===null){this.recordCacheMiss(e);return}return this.recordCacheHit(e),n}catch{this.recordCacheMiss(e);return}}recordCacheHit(e){this.cacheHits++;let t=e.split(":")[0];this.cacheHitsByPrefix[t]=(this.cacheHitsByPrefix[t]??0)+1}recordCacheMiss(e){this.cacheMisses++;let t=e.split(":")[0];this.cacheMissesByPrefix[t]=(this.cacheMissesByPrefix[t]??0)+1}};function qii(e){let t=Iyn.get(e);if(!t)t=new $ii(e),Iyn.set(e,t);return t}var y7n=({useAssignableSolver:e=!1,useAutoJumperSolver:t=!1,autorouterVersion:n,useLaserPrefabSolver:o=!1,useTraceSimplificationSolver:r=!1,platformConfig:i,effort:s})=>{let a=i?.useCloudAutorouter&&(s===void 0||s===1)?"AutoroutingPipelineSolver9_Networked":"AutoroutingPipelineSolver9_PreloadedTraceGraph";if(r)return"AutoroutingPipelineSolver11_Simplification";if(n==="beta_pipeline1")return"AutoroutingPipeline1_OriginalUnravel";if(n==="beta_pipeline3")return"AutoroutingPipelineSolver3_HgPortPointPathing";if(n==="beta_pipeline4")return"AutoroutingPipelineSolver4";if(n==="beta_pipeline5")return"AutoroutingPipelineSolver5";if(n==="beta_pipeline7")return"AutoroutingPipelineSolver7_MultiGraph";if(n==="beta_pipeline9"||n==="latest")return a;if(o)return"AutoroutingPipelineSolver8";if(t)return"AssignableAutoroutingPipeline3";if(e)return"AssignableAutoroutingPipeline2";return a};function Jii(e){if(!e?.localCacheEngine)return null;return qii(e.localCacheEngine)}var Zii=class{input;isRouting=!1;solver;eventHandlers={complete:[],error:[],progress:[]};cycleCount=0;stepDelay;timeoutId;constructor(e,t={}){this.input=e;let{capacityDepth:n,targetMinCapacity:o,stepDelay:r=0,useAssignableSolver:i=!1,useAutoJumperSolver:s=!1,autorouterVersion:a,useLaserPrefabSolver:c=!1,useTraceSimplificationSolver:l=!1,effort:h,platformConfig:d,onSolverStarted:u}=t,_=y7n({useAssignableSolver:i,useAutoJumperSolver:s,autorouterVersion:a,useLaserPrefabSolver:c,useTraceSimplificationSolver:l,platformConfig:d,effort:h}),p=Jii(d),m={capacityDepth:n,targetMinCapacity:o,cacheProvider:p,effort:h};this.solver=_==="AutoroutingPipelineSolver9_Networked"?new S6e(e,{...m,effort:1}):new jii[_](e,m),u?.({solverName:_,solverParams:{input:e,options:{capacityDepth:n,targetMinCapacity:o,cacheProvider:p,effort:h}}}),this.stepDelay=r}start(){if(this.isRouting)return;this.isRouting=!0,this.cycleCount=0,this.runCycleAndQueueNextCycle()}async stepSolver(){if("stepAsync"in this.solver&&typeof this.solver.stepAsync==="function"){await this.solver.stepAsync();return}this.solver.step()}async runCycleAndQueueNextCycle(){if(!this.isRouting)return;try{if(this.solver.solved||this.solver.failed){if(this.solver.failed)this.emitEvent({type:"error",error:new qhe(this.solver.error||"Routing failed")});else this.emitEvent({type:"complete",traces:this.solver.getOutputSimplifiedPcbTraces()});this.isRouting=!1;return}let e=Date.now(),t=this.solver.iterations;while(Date.now()-e<250&&!this.solver.failed&&!this.solver.solved)await this.stepSolver();let n=(this.solver.iterations-t)/(Date.now()-e)*1000;this.cycleCount++;let o=this.solver?.preview()||void 0,r=this.solver.progress;if(this.emitEvent({type:"progress",steps:this.cycleCount,iterationsPerSecond:n,progress:r,phase:"getCurrentPhase"in this.solver?this.solver.getCurrentPhase():this.solver.activeSubSolver?.getSolverName()??this.solver.getSolverName(),debugGraphics:o}),this.stepDelay>0)this.timeoutId=setTimeout(()=>void this.runCycleAndQueueNextCycle(),this.stepDelay);else this.timeoutId=setTimeout(()=>void this.runCycleAndQueueNextCycle(),0)}catch(e){this.emitEvent({type:"error",error:e instanceof Error?new qhe(e.message):new qhe(String(e))}),this.isRouting=!1}}stop(){if(!this.isRouting)return;if(this.isRouting=!1,this.timeoutId!==void 0)clearTimeout(this.timeoutId),this.timeoutId=void 0}on(e,t){if(e==="complete")this.eventHandlers.complete.push(t);else if(e==="error")this.eventHandlers.error.push(t);else if(e==="progress")this.eventHandlers.progress.push(t)}emitEvent(e){if(e.type==="complete")for(let t of this.eventHandlers.complete)t(e);else if(e.type==="error")for(let t of this.eventHandlers.error)t(e);else if(e.type==="progress")for(let t of this.eventHandlers.progress)t(e)}solveSync(){if(this.solver.solve(),this.solver.failed)throw new qhe(this.solver.error||"Routing failed");return this.solver.getOutputSimplifiedPcbTraces()}getConnectedOffboardObstacles(){if("getConnectedOffboardObstacles"in this.solver)return this.solver.getConnectedOffboardObstacles();return{}}},x7n=(e,t)=>({name:e,cacheable:!0,getSolverName:(n)=>y7n({...n,...t}),create:({simpleRouteJson:n,commonAutorouterOptions:o,onSolverStarted:r})=>new Zii(n,{...o,...t,onSolverStarted:(i)=>r?.({...i,solverConstructorArgs:[i.solverParams]})})}),esi=x7n("tscircuit",{}),tsi=x7n("tscircuit_simplify",{useTraceSimplificationSolver:!0}),Syn=(e)=>({name:e,cacheable:!1,followUpAutorouter:"default",getSolverName:()=>"FanoutSolver",create:({simpleRouteJson:t,busFanoutDirections:n,fanoutBounds:o,fanoutRoutingLayers:r,allowBlindAndBuriedVias:i,componentNamesById:s,onSolverStarted:a})=>new Oot(t,{mode:e,busFanoutDirections:n,fanoutBounds:o,fanoutRoutingLayers:r,allowBlindAndBuriedVias:i,componentNamesById:s,onSolverStarted:a})}),nsi=new Map([["single_layer_fanout",Syn("single_layer_fanout")],["fanout",Syn("fanout")],["dogbone",{name:"dogbone",preserveOutputTraces:!0,followUpAutorouter:"default",cacheable:!1,getSolverName:()=>"DogboneFanoutSolver",create:({simpleRouteJson:e,fanoutRoutingLayers:t,onSolverStarted:n,onSolverEnded:o})=>new fVr({input:e,fanoutRoutingLayers:t},{onSolverStarted:n,onSolverEnded:o})}],["bus_lanes",{name:"bus_lanes",preserveOutputTraces:!0,cacheable:!1,getSolverName:()=>"BusLanesPipelineSolver",create:({simpleRouteJson:e,onSolverStarted:t})=>(t?.({solverName:"BusLanesPipelineSolver",solverParams:e,solverConstructorArgs:[e]}),new jJr(e))}],["simplify",tsi]]),Pyn=(e)=>nsi.get(e??"")??esi,osi=(e,t)=>{let n=Pyn(e.preset),o=[{autorouterConfig:e,strategy:n,usesPreviousStageOutput:!1}];if(n.followUpAutorouter&&!e.algorithmFn){let r=fde(n.followUpAutorouter,t);o.push({autorouterConfig:r,strategy:Pyn(r.preset),usesPreviousStageOutput:!0})}return o};var wat=({bus:e,busSourceTraces:t,traceNameOrPortSelector:n})=>{let o=t.filter((c)=>c.name===n),i=(o.length===0?e.getSubcircuit().selectOne(n,{type:"port"}):null)?.source_port_id??void 0,s=i?t.filter((c)=>c.connected_source_port_ids.includes(i)):o;if(s.length===0)throw Error(`Could not find source trace for trace name or port selector "${n}" in bus "${e.name}"`);if(s.length>1)throw Error(`Trace name or port selector "${n}" matches multiple source traces in bus "${e.name}"`);return s[0].source_trace_id},isi=({bus:e,busSourceTraces:t})=>{let n=e._parsedProps.targetLength;if(n===void 0||typeof n==="number")return n;return{reference:n.reference,offset:n.offset,source_trace_ids:n.of?.map((o)=>wat({bus:e,busSourceTraces:t,traceNameOrPortSelector:o}))}},ssi=class extends nr{source_bus_id;get config(){return{componentName:"Bus",zodProps:sDt}}doInitialSourceAddConnectivityMapKey(){let{db:e}=this.root,t=this.getSubcircuit().subcircuit_id,n=e.source_trace.list().filter((i)=>i.subcircuit_id===t),o=this._parsedProps.connections.map((i)=>wat({bus:this,busSourceTraces:n,traceNameOrPortSelector:i}));if(new Set(o).size!==o.length)throw Error(`Bus "${this.name}" resolves multiple entries to one trace`);let r=e.source_bus.insert({name:this._parsedProps.name,source_trace_ids:o,max_length_skew:this._parsedProps.maxLengthSkew,target_length:isi({bus:this,busSourceTraces:n}),length_tolerance:this._parsedProps.lengthTolerance,subcircuit_id:t});this.source_bus_id=r.source_bus_id}},asi=(e,t)=>{let{db:n}=e.root,o=e.getSubcircuit(),r=n.source_trace.list().filter((l)=>l.subcircuit_id===o.subcircuit_id),i=r.filter((l)=>l.name===t),s=new Set;if(i.length>0){for(let l of i)if(l.subcircuit_connectivity_map_key)s.add(l.subcircuit_connectivity_map_key)}else{let l=o.selectOne(t,{type:"port"});if(l?.source_port_id){let h=n.source_port.get(l.source_port_id);if(h?.subcircuit_connectivity_map_key)s.add(h.subcircuit_connectivity_map_key)}}if(s.size!==1)return;let a=s.values().next().value;if(!a)return;let c=n.source_port.list().filter((l)=>l.subcircuit_connectivity_map_key===a);return{sourceTraceIds:r.filter((l)=>l.subcircuit_connectivity_map_key===a).map((l)=>l.source_trace_id),sourcePorts:c,sourceTraceName:i.length>0?t:void 0}},csi=(e)=>{if(e.length<=1)return e.join("");if(e.length===2)return`${e[0]} and ${e[1]}`;return`${e.slice(0,-1).join(", ")}, and ${e.at(-1)}`},lsi=(e,t)=>{let n;if(e.source_component_id)n=t.get(e.source_component_id);if(!n?.name)return e.source_port_id;let o=e.most_frequently_referenced_by_name??e.name;return`.${n.name} > .${o}`},hsi=({differentialPairName:e,connectionPolarity:t,connectionSelector:n,sourceTraceName:o,terminalPinSelectors:r})=>{let i=csi(r),s=i?`: ${i}`:"";if(o&&r.length>2)return`Differential pair "${e}" ${t}Connection uses the ambiguous trace name "${o}": its connection has more than 2 terminal pins${s}.`;return`Differential pair "${e}" ${t}Connection="${n}" is not point-to-point: expected exactly 2 terminal pins, found ${r.length}${s}.`},dsi=(e)=>{let{db:t}=e.root,n=new Map;for(let i of t.source_component.list())n.set(i.source_component_id,{name:i.name});let o=[],r=0;for(let i of["positive","negative"]){let s=e._parsedProps.negativeConnection;if(i==="positive")s=e._parsedProps.positiveConnection;let a=asi(e,s);if(!a)continue;r++,o.push(...a.sourceTraceIds);let c=a.sourcePorts;if(c.length===2)continue;let l="",h=c[0];if(h){if(!h.source_component_id)throw Error(`Differential pair "${e.name}" resolved terminal port "${h.source_port_id}" without a source_component_id`);l=h.source_component_id}let d=c.map((u)=>lsi(u,n)).sort((u,_)=>u.localeCompare(_));t.source_property_ignored_warning.insert({source_component_id:l,property_name:`${i}Connection`,error_type:"source_property_ignored_warning",message:hsi({differentialPairName:e.name,connectionPolarity:i,connectionSelector:s,sourceTraceName:a.sourceTraceName,terminalPinSelectors:d}),subcircuit_id:e.getSubcircuit().subcircuit_id??void 0})}if(r===2&&o.length>0)t.source_bus.insert({name:e.name,source_trace_ids:[...new Set(o)],max_length_skew:e._parsedProps.maxLengthSkew,subcircuit_id:e.getSubcircuit().subcircuit_id??void 0})},usi=class extends nr{get config(){return{componentName:"DifferentialPair",zodProps:aDt}}doInitialSourceDesignRuleChecks(){dsi(this)}},C7n=(e)=>{let t={...e.bounds};for(let n of e.connections){if(n.isOffBoard)continue;for(let o of n.pointsToConnect)t.minX=Math.min(t.minX,o.x),t.maxX=Math.max(t.maxX,o.x),t.minY=Math.min(t.minY,o.y),t.maxY=Math.max(t.maxY,o.y)}return t},b7n=({bounds:e,outline:t},n)=>{if(t)return t;if(e.minX===n.minX&&e.maxX===n.maxX&&e.minY===n.minY&&e.maxY===n.maxY)return;return new rA(e.minX,e.minY,e.maxX,e.maxY).toPoints().map(({x:o,y:r})=>({x:o,y:r}))},psi=(e)=>{if(!e.source_bus_id)return{};let{db:t}=e.root,n=t.source_bus.get(e.source_bus_id);if(n.target_length===void 0)return{};let o=n.length_tolerance;if(o===void 0)throw Error(`Bus "${e.name}" requires lengthTolerance with targetLength`);let r;if(typeof n.target_length==="number")r=n.target_length;else{let i=n.target_length,a=(i.source_trace_ids??n.source_trace_ids).map((c)=>{let l=t.source_trace.get(c),h=t.pcb_port.list().filter((d)=>l.connected_source_port_ids.includes(d.source_port_id));if(h.length!==2)throw Error(`Bus "${e.name}" targetLength requires two placed endpoint pads per reference trace`);return Math.abs(h[0].x-h[1].x)+Math.abs(h[0].y-h[1].y)});r=Math.max(...a)+(i.offset??0)}return{minLength:Math.max(0,r-o),maxLength:r+o}},msi=({srjConnections:e,bus:t,sourceTraceId:n,traceNameOrPortSelector:o,busSourceTraces:r})=>{let i=e.filter((h)=>h.source_trace_id===n);if(i.length>0)return i.map((h)=>h.name);let s=r.find((h)=>h.source_trace_id===n),a=r.filter((h)=>h.source_trace_id===n||s.subcircuit_connectivity_map_key!==void 0&&h.subcircuit_connectivity_map_key===s.subcircuit_connectivity_map_key),c=new Set(a.flatMap((h)=>h.connected_source_net_ids??[])),l=e.filter((h)=>c.has(h.name));if(l.length===0)throw Error(`Could not find an SRJ connection for "${o}" in bus "${t.name}"`);return l.map((h)=>h.name)},_si=(e)=>e.trim().replace(/^net\./,"").replace(/^\./,""),gsi=({fanoutPourNetMap:e,sourceNets:t,sourceTraces:n,subcircuitId:o})=>{let r=new Map;if(!e)return r;let i=new Map;for(let[s,a]of Object.entries(e)){let c=Array.isArray(a)?a:[a];for(let l of c){let h=_si(l);for(let d of t){if(d.name!==h)continue;let u=i.get(d.source_net_id);if(u&&u!==s)throw Error(`Fanout plane net "${h}" maps to multiple layers ("${u}" and "${s}"); use fanoutPourNetMap to select one`);i.set(d.source_net_id,s)}}}for(let s of n){if(o&&s.subcircuit_id!==o)continue;if(s.connected_source_port_ids.length!==1)continue;let a=new Set((s.connected_source_net_ids??[]).map((l)=>i.get(l)).filter((l)=>l!==void 0));if(a.size>1)throw Error(`Source trace "${s.name??s.source_trace_id}" connects to fanout planes on multiple layers`);let c=a.values().next().value;if(c)r.set(s.source_trace_id,c)}return r},Asi=({srjConnections:e,buses:t,sourceTraces:n,subcircuitId:o,planeTerminatedSourceTraceLayers:r,preservedSourceTraceIds:i})=>{let s=[];for(let l of t){let h=l.getSubcircuit().subcircuit_id;if(o&&h!==o)continue;let d=n.filter((_)=>_.subcircuit_id===h),u=l._parsedProps.connections.flatMap((_)=>{let p=wat({bus:l,busSourceTraces:d,traceNameOrPortSelector:_});if(i?.has(p))return[];return msi({srjConnections:e,bus:l,sourceTraceId:p,traceNameOrPortSelector:_,busSourceTraces:d})});if(new Set(u).size!==u.length)throw Error(`Bus "${l.name}" resolves multiple entries to one trace`);if(u.length===0)continue;s.push({busId:l.name,name:l.name,connectionNames:u,...psi(l),...l._parsedProps.maxLengthSkew!==void 0?{maxLengthSkew:l._parsedProps.maxLengthSkew}:{},...l._parsedProps.pcbTraceWidth!==void 0?{traceWidth:l._parsedProps.pcbTraceWidth}:{},...l._parsedProps.pcbAllowedLayers!==void 0?{allowedLayers:l._parsedProps.pcbAllowedLayers}:{},...l._parsedProps.preferredLayer!==void 0?{preferredLayer:l._parsedProps.preferredLayer}:{},...l._parsedProps.preferredLayers!==void 0?{preferredLayers:l._parsedProps.preferredLayers}:{}})}let a=[];for(let[l,h]of r??[]){let d=n.find((p)=>p.source_trace_id===l),u=e.find((p)=>p.source_trace_id===l);if(!d||!u)continue;let _=d.name??d.source_trace_id;if([...s,...a].some((p)=>p.busId===_))throw Error(`Fanout plane trace "${_}" conflicts with an existing bus name`);a.push({busId:_,name:_,connectionNames:[u.name],termination:{type:"plane",layer:h}})}let c=[...a,...s];return c.length>0?c:void 0},fsi=(e,t)=>e.filter((n)=>n.name===t),ysi=(e,t)=>e.filter((n)=>n.connected_source_port_ids.includes(t)),Eyn=({differentialPair:e,differentialPairSourceTraces:t,traceNameOrPortSelector:n})=>{let o=e.getSubcircuit(),r=fsi(t,n),s=(r.length===0?o.selectOne(n,{type:"port"}):null)?.source_port_id??void 0,a=s?ysi(t,s):r;if(a.length===0)throw Error(`Could not find source trace for trace name or port selector "${n}" in differential pair "${e.name}"`);if(a.length>1)throw Error(`Trace name or port selector "${n}" matches multiple source traces for differential pair "${e.name}"`);let c=a[0];if(!c)throw Error(`Expected one source trace for trace name or port selector "${n}" in differential pair "${e.name}"`);let l=c.subcircuit_connectivity_map_key;if(!l)throw Error(`Source trace "${c.source_trace_id}" does not have a subcircuit connectivity map key for differential pair "${e.name}"`);return l},Myn=({srjConnections:e,differentialPairName:t,differentialPairSourceTraces:n,traceSubcircuitConnectivityMapKey:o,traceNameOrPortSelector:r})=>{let i=[],s=new Set;for(let l of n)if(l.subcircuit_connectivity_map_key===o){i.push(l.source_trace_id);for(let h of l.connected_source_net_ids??[])s.add(h)}let a=[];for(let l of e)if(s.has(l.name)||l.source_trace_id&&i.includes(l.source_trace_id))a.push(l);if(a.length===0)throw Error(`Could not find an SRJ connection for trace name or port selector "${r}" in differential pair "${t}"`);let c=new Map;for(let l of a){let h=l.routingPcbGroupId;if(c.has(h)){let d=h===void 0?"the global routing cohort":`routing PCB group "${h}"`;throw Error(`Subcircuit connectivity map key "${o}" matches multiple SRJ connections in ${d} for differential pair "${t}"`)}c.set(h,l.name)}return c},wyn=(e)=>e===void 0?"the global routing cohort":`routing PCB group "${e}"`,xsi=({srjConnections:e,differentialPairs:t,sourceTraces:n,subcircuitId:o})=>{let r=[];for(let i of t){let s=i.getSubcircuit().subcircuit_id;if(o&&s!==o)continue;let a=n.filter((m)=>m.subcircuit_id===s),c=i._parsedProps.positiveConnection,l=i._parsedProps.negativeConnection,h=Eyn({differentialPair:i,differentialPairSourceTraces:a,traceNameOrPortSelector:c}),d=Eyn({differentialPair:i,differentialPairSourceTraces:a,traceNameOrPortSelector:l}),u=Myn({srjConnections:e,differentialPairName:i.name,differentialPairSourceTraces:a,traceSubcircuitConnectivityMapKey:h,traceNameOrPortSelector:c}),_=Myn({srjConnections:e,differentialPairName:i.name,differentialPairSourceTraces:a,traceSubcircuitConnectivityMapKey:d,traceNameOrPortSelector:l}),p=i._parsedProps.maxLengthSkew??0.1;for(let m of u.keys()){if(_.has(m))continue;throw Error(`Differential pair "${i.name}" has a positive SRJ connection in ${wyn(m)} without a matching negative SRJ connection`)}for(let m of _.keys()){if(u.has(m))continue;throw Error(`Differential pair "${i.name}" has a negative SRJ connection in ${wyn(m)} without a matching positive SRJ connection`)}for(let[m,A]of u){let g=_.get(m);r.push({connectionNames:[A,g],lengthTolerance:p,...i._parsedProps.pcbTraceGap!==void 0?{traceGap:i._parsedProps.pcbTraceGap}:{},...i._parsedProps.maxUncoupledLength!==void 0?{maxUncoupledLength:i._parsedProps.maxUncoupledLength}:{}})}}return r.length>0?r:void 0},Uhe=(e)=>typeof e==="string"?e:e.name,Csi=(e)=>e.source_trace_id??e.connection_name??e.pcb_trace_id,bsi=(e)=>{let t=new Set(e.connectsTo??[]);for(let n of e.route){if(n.route_type!=="wire")continue;for(let o of[n.start_pcb_port_id,n.end_pcb_port_id])if(o)t.add(o)}return Array.from(t)},Isi=(e)=>e.route.map((t)=>{if(t.route_type==="wire")return{route_type:"wire",x:t.x,y:t.y,width:t.width,layer:Uhe(t.layer)};if(t.route_type==="via"){let n=t,o=n.outer_diameter??n.via_diameter,r=n.hole_diameter??n.via_hole_diameter;return{route_type:"via",x:t.x,y:t.y,from_layer:Uhe(t.from_layer),to_layer:Uhe(t.to_layer),...o!==void 0?{via_diameter:o}:{},...r!==void 0?{via_hole_diameter:r}:{}}}return{route_type:"through_obstacle",start:t.start,end:t.end,from_layer:Uhe(t.start_layer),to_layer:Uhe(t.end_layer),width:t.width}}),vsi=({scopedDb:e,relevantSubcircuitIds:t})=>e.pcb_trace.list().filter((n)=>{if(!n.subcircuit_id)return!1;if(n.pcb_component_id&&!n.source_trace_id)return!1;return t===null||t.has(n.subcircuit_id)}).map((n)=>{let o=n,r=Csi(o);return{type:"pcb_trace",pcb_trace_id:n.pcb_trace_id,source_trace_id:n.source_trace_id,connection_name:r,connectsTo:bsi(o),route:Isi(o)}}).filter((n)=>n.route.length>=2),Ssi=0.5,Psi=(e)=>Array.from(new Set(e.filter((t)=>Boolean(t)))),Esi=(e)=>typeof e==="string"?e:e.name,Byn=({layer:e,connectedTo:t,center:n,width:o,height:r})=>({type:"rect",layers:[e],center:n,width:o,height:r,connectedTo:t,isCopperPour:!0}),Msi=({outline:e,group:t,board:n})=>{if(e&&e.length>=3)return e;if(t?.outline&&t.outline.length>=3)return t.outline;if(n?.outline&&n.outline.length>=3)return n.outline;return null},wsi=({group:e,board:t})=>{if(e?.width&&e.height)return{center:e.center,width:e.width,height:e.height};if(t?.width&&t.height)return{center:t.center,width:t.width,height:t.height};return null},Bsi=(e,t)=>Psi([e.source_net_id,e.subcircuit_connectivity_map_key,e.source_net_id?t.getNetConnectedToId(e.source_net_id):null]),Tsi=({connMap:e,subcircuitComponent:t,board:n,group:o})=>{if(!t)return[];let r=[],i=t.selectAll("copperpour");for(let s of i){let a=s._parsedProps;if(!a.unbroken)continue;let c=s.getSubcircuit().selectOne(a.connectsTo);if(!c?.source_net_id)continue;let l=Esi(a.layer),h=Bsi(c,e);if(h.length===0)continue;let d=Msi({outline:a.outline,group:o,board:n});if(d){let _=sot(d,{rectHeight:Ssi});if(_.length>0){r.push(..._.map((p)=>Byn({layer:l,connectedTo:h,center:p.center,width:p.width,height:p.height})));continue}}let u=wsi({group:o,board:n});if(!u)continue;r.push(Byn({layer:l,connectedTo:h,center:u.center,width:u.width,height:u.height}))}return r},Tyn=(e,t)=>{let n=new Map(e.map((o)=>[o.pcb_port_id,o]));return t.flatMap((o)=>{let r=n.get(o.pcb_port_id);if(!r)return[];let i=r.layers?.[0]??"top";return o.route.map((s)=>({x:s.x,y:s.y,layer:i}))})},Dsi=(e,t)=>{let n=new Set,o=t,r=!0;while(o&&!n.has(o)){n.add(o);let i=e.source_group.getWhere({subcircuit_id:o}),s=i?e.source_board.getWhere({source_group_id:i.source_group_id}):void 0;if(s)return{board:e.pcb_board.getWhere({source_board_id:s.source_board_id})??null,subcircuitIsBoard:r};o=i?.parent_subcircuit_id??null,r=!1}return{board:null,subcircuitIsBoard:!1}},Lnt=({db:e,circuitJson:t,subcircuit_id:n,minTraceWidth:o,minTraceToPadEdgeClearance:r,minTraceToHoleEdgeClearance:i,minViaEdgeToPadEdgeClearance:s,minViaHoleEdgeToViaHoleEdgeClearance:a,minPlatedHoleDrillEdgeToDrillEdgeClearance:c,minPadEdgeToPadEdgeClearance:l,minBoardEdgeClearance:h,minViaHoleDiameter:d,minViaPadDiameter:u,nominalTraceWidth:_,subcircuitComponent:p,routingPcbGroupId:m,fanoutPourNetMap:A,ignoreExistingTopLevelPcbRouteState:g=!1})=>{if(!e&&t)e=Ho(t);if(!e)throw Error("db or circuitJson is required");let f=e.pcb_trace_hint.list(),y=n?new Set([n]):null;if(n){let Je=kit(e,n);for(let $e of Je)y.add($e)}let x=t??e.toArray(),C=new Map(x.flatMap((Je)=>Je.type==="source_trace"?[[Je.source_trace_id,Je]]:[])),I=x.map((Je)=>{if(g||Je.type!=="pcb_trace"||Je.subcircuit_id||!Je.source_trace_id)return Je;let $e=C.get(Je.source_trace_id)?.subcircuit_id;return $e?{...Je,subcircuit_id:$e}:Je}).filter((Je)=>!n||("subcircuit_id"in Je)&&y.has(Je.subcircuit_id)),v=null,P=!1;if(n){let Je=Dsi(e,n);v=Je.board,P=Je.subcircuitIsBoard&&v!==null}if(!v)v=e.pcb_board.list()[0];e=Ho(I);let M=(Je)=>{if(!Je?.source_component_id)return;let $e=e.source_component.get(Je.source_component_id);if(!$e?.name)return;return`${$e.name}.${Je.name}`},B=m?e.pcb_group.get(m):n?e.pcb_group.getWhere({subcircuit_id:n}):void 0,T=p?.pcb_group_id;if(T==null&&!P)T=B?.pcb_group_id;let N=oa(I),D=e.pcb_breakout_point.list().filter((Je)=>!n||y?.has(Je.subcircuit_id)),L=(Je)=>Je.subcircuit_id===n&&(T?Je.pcb_group_id===T:!P),H=vsi({scopedDb:e,relevantSubcircuitIds:y}),V=new Map(H.map((Je)=>[Je.pcb_trace_id,Je])),O=(Je)=>{if(!Je.pcb_trace_id)return!1;let $e=V.get(Je.pcb_trace_id);if(!$e)return!1;let ft=new Set(Je.layers);return $e.route.some((vt)=>{if(vt.route_type!=="via"||vt.x!==Je.x||vt.y!==Je.y)return!1;let Ye=new Set(WS({fromLayer:vt.from_layer,toLayer:vt.to_layer,layerCount:v?.num_layers??2}));return Ye.size===ft.size&&[...Ye].every((je)=>ft.has(je))})},U=l5n([...v?[v]:[],...e.source_component.list(),...e.source_port.list(),...e.pcb_port.list(),...e.pcb_component.list(),...e.pcb_smtpad.list(),...e.pcb_plated_hole.list(),...e.pcb_hole.list(),...e.pcb_trace.list().filter((Je)=>!Je.source_trace_id),...e.pcb_via.list().filter((Je)=>(!g||Boolean(Je.subcircuit_id))&&!O(Je)),...e.pcb_keepout.list(),...e.pcb_cutout.list()].filter((Je)=>Je.type==="pcb_board"||!n||y?.has(Je.subcircuit_id)),N);U.push(...Tsi({connMap:N,subcircuitComponent:p,board:v,group:B}));for(let Je of U){let $e=Je.connectedTo.flatMap((ft)=>N.getIdsConnectedToNet(ft));Je.connectedTo=[...new Set([...Je.connectedTo,...$e])]}let j=e.source_component_internal_connection.list(),Y=new Map;for(let Je of j)for(let $e of Je.source_port_ids)Y.set($e,Je.source_component_internal_connection_id);let X=new Map;for(let Je of e.pcb_port.list())if(Je.source_port_id){let $e=e.pcb_smtpad.getWhere({pcb_port_id:Je.pcb_port_id});if($e)X.set($e.pcb_smtpad_id,Je.source_port_id);let ft=e.pcb_plated_hole.getWhere({pcb_port_id:Je.pcb_port_id});if(ft)X.set(ft.pcb_plated_hole_id,Je.source_port_id)}for(let Je of U)for(let $e of Je.connectedTo){let ft=X.get($e);if(ft){let vt=Y.get(ft);if(vt){Je.offBoardConnectsTo=[vt],Je.netIsAssignable=!0;break}}}let K=U.flatMap((Je)=>[{x:Je.center.x-Je.width/2,y:Je.center.y-Je.height/2},{x:Je.center.x+Je.width/2,y:Je.center.y+Je.height/2}]).concat(v?.outline??[]),J=v&&!v.outline?{minX:v.center.x-v.width/2,maxX:v.center.x+v.width/2,minY:v.center.y-v.height/2,maxY:v.center.y+v.height/2}:void 0,ee,se=!!(B?.width&&B.height&&n&&!P);if(se)ee={minX:B.center.x-B.width/2,maxX:B.center.x+B.width/2,minY:B.center.y-B.height/2,maxY:B.center.y+B.height/2};else if(J)ee=J;else ee={minX:Math.min(...K.map((Je)=>Je.x))-1,maxX:Math.max(...K.map((Je)=>Je.x))+1,minY:Math.min(...K.map((Je)=>Je.y))-1,maxY:Math.max(...K.map((Je)=>Je.y))+1};if(B?.width&&B.height&&!se){let Je={minX:B.center.x-B.width/2,maxX:B.center.x+B.width/2,minY:B.center.y-B.height/2,maxY:B.center.y+B.height/2};ee={minX:Math.min(ee.minX,Je.minX),maxX:Math.max(ee.maxX,Je.maxX),minY:Math.min(ee.minY,Je.minY),maxY:Math.max(ee.maxY,Je.maxY)}}let ne=new Set(e.pcb_trace.list().filter((Je)=>{if(!Je.source_trace_id)return!1;if(n)return Je.subcircuit_id===n;if(!Je.subcircuit_id)return!1;return e.source_trace.get(Je.source_trace_id)?.subcircuit_id===Je.subcircuit_id}).map((Je)=>Je.source_trace_id).filter((Je)=>Boolean(Je))),re=new Map;for(let Je of D){let $e=Je.source_port_id;if($e)re.set($e,Je)}let Z=(Je)=>{let $e=Je.layers?.[0]??"top",ft=re.get(Je.source_port_id),vt=M(e.source_port.get(Je.source_port_id));if(ft&&!L(ft))return{x:ft.x,y:ft.y,layer:ft.layer??$e,pointId:ft.pcb_breakout_point_id,port_selector:vt};return{x:Je.x,y:Je.y,layer:$e,pointId:Je.pcb_port_id,pcb_port_id:Je.pcb_port_id,port_selector:vt}},te=e.source_trace.list(),ie=gsi({fanoutPourNetMap:A,sourceNets:e.source_net.list(),sourceTraces:te,subcircuitId:n}),ce=te.filter((Je)=>!ne.has(Je.source_trace_id)).filter((Je)=>!n||Je.subcircuit_id===n).filter((Je)=>Je.connected_source_net_ids.length===0||ie.has(Je.source_trace_id)).map((Je)=>{let $e=Je.connected_source_port_ids.map((St)=>e.pcb_port.getWhere({source_port_id:St})).filter((St)=>St!==null),ft=ie.has(Je.source_trace_id);if($e.length<2&&!(ft&&$e.length===1))return null;for(let St of $e)if(St.x===void 0||St.y===void 0)return console.error(`(source_port_id: ${St.source_port_id}) for trace ${Je.source_trace_id} does not have x/y coordinates. Skipping this trace.`),null;let vt=Tyn($e,f),Ye=$e.map((St)=>Z(St)),[je,...st]=Ye;return{name:Je.source_trace_id??N.getNetConnectedToId(Je.source_trace_id)??"",source_trace_id:Je.source_trace_id,nominalTraceWidth:Je.min_trace_thickness,width:Je.min_trace_thickness,pointsToConnect:[je,...vt,...st]}}).filter((Je)=>Je!==null),ue=e.source_net.list().filter((Je)=>!n||Je.subcircuit_id===n),de=[],me=new Map,ge=new Set,xe=new Set(ue.map((Je)=>Je.source_net_id)),Ee=e.source_trace.list().filter((Je)=>!n||Je.subcircuit_id===n),Re=new Set((p?.selectAll("trace")??[]).flatMap((Je)=>{let $e=Je;return $e._exposesSubcircuitConnection&&$e.source_trace_id?[$e.source_trace_id]:[]})),Me=new Set;for(let Je of Ee){if(!Re.has(Je.source_trace_id))continue;for(let $e of Je.connected_source_net_ids??[])if(!xe.has($e))Me.add($e)}let _e=new Set(n?e.pcb_trace.list().filter((Je)=>Je.subcircuit_id&&Je.subcircuit_id!==n&&y?.has(Je.subcircuit_id)).map((Je)=>Je.source_trace_id).filter((Je)=>Boolean(Je)):[]),ye=e.source_trace.list().filter((Je)=>!ie.has(Je.source_trace_id)).filter((Je)=>!ne.has(Je.source_trace_id)||n!=null&&Je.subcircuit_id===n).filter((Je)=>!n||Je.subcircuit_id===n||(Je.connected_source_net_ids?.some(($e)=>xe.has($e))??!1)||(Je.connected_source_net_ids?.some(($e)=>Me.has($e))??!1)&&!_e.has(Je.source_trace_id)),Se=(Je)=>Je?N.getNetConnectedToId(Je)??Je:null;for(let Je of ue){let $e=Se(Je.source_net_id);if(!$e||ge.has($e))continue;ge.add($e);let ft=ue.filter((Ut)=>Se(Ut.source_net_id)===$e),vt=ft.map((Ut)=>Ut.source_net_id),Ye=ye.filter((Ut)=>[Ut.source_trace_id,...Ut.connected_source_net_ids??[]].some((mn)=>Se(mn)===$e)),je;for(let Ut of ft){if(Ut.trace_width===void 0)continue;je=Math.max(je??0,Ut.trace_width)}for(let Ut of Ye){if(Ut.min_trace_thickness===void 0)continue;je=Math.max(je??0,Ut.min_trace_thickness)}let st=[],St=new Set,Nt=[];for(let Ut of Ye){let mn=e.pcb_port.list().filter((_n)=>Ut.connected_source_port_ids.includes(_n.source_port_id));for(let _n of mn){let En=Z(_n);if(St.has(En.pointId))continue;St.add(En.pointId),Nt.push(_n),st.push(En)}}st.push(...Tyn(Nt,f));let Ot={name:Je.source_net_id??N.getNetConnectedToId(Je.source_net_id),nominalTraceWidth:je,width:je,pointsToConnect:st};if(st.length===0)continue;de.push(Ot);for(let Ut of vt)me.set(Ut,Ot)}let Ne=[];for(let Je of D){let $e=Je.source_port_id,ft={x:Je.x,y:Je.y,layer:Je.layer??"top",pointId:Je.pcb_breakout_point_id};if($e){let vt=e.pcb_port.getWhere({source_port_id:$e});if(!vt)continue;let Ye={x:vt.x,y:vt.y,layer:vt.layers?.[0]??"top",pointId:vt.pcb_port_id,pcb_port_id:vt.pcb_port_id,port_selector:M(e.source_port.get(vt.source_port_id))},je=L(Je),st=!je&&Je.subcircuit_id===n;if(je||st){Ne.push({name:st?`breakout:${Je.pcb_breakout_point_id}`:$e,source_trace_id:Je.source_trace_id,routingPcbGroupId:st?Je.pcb_group_id:void 0,pointsToConnect:[Ye,ft]});continue}if(!Je.source_trace_id)Ne.push({name:$e,pointsToConnect:[Ye,ft]});continue}if(Je.source_net_id){let vt=me.get(Je.source_net_id);if(vt)vt.pointsToConnect.push(ft);else Ne.push({name:Je.source_net_id,pointsToConnect:[ft]})}}let Le=de.filter((Je)=>Je.pointsToConnect.length>=2),nt=[...ce,...Le,...Ne],dt=o??v?.min_trace_width??0.1;for(let Je of nt)Je.nominalTraceWidth??=_??dt,Je.width??=_??dt;ee=C7n({bounds:ee,connections:nt});let rt=p?.selectAll("differentialpair")??[],pt=p?.selectAll("bus")??[],ct=xsi({srjConnections:nt,differentialPairs:rt,sourceTraces:e.source_trace.list(),subcircuitId:n}),Ct=Asi({srjConnections:nt,buses:pt,sourceTraces:e.source_trace.list(),subcircuitId:n,planeTerminatedSourceTraceLayers:ie,preservedSourceTraceIds:ne});if(n){let Je=new Map;for(let ft of nt)for(let vt of ft.pointsToConnect)if(vt.pointId)Je.set(vt.pointId,ft);let $e=e.pcb_trace.list().filter((ft)=>y?.has(ft.subcircuit_id));for(let ft of $e){let vt=new Set;for(let st of ft.route){if(st.start_pcb_port_id)vt.add(st.start_pcb_port_id);if(st.end_pcb_port_id)vt.add(st.end_pcb_port_id)}if(vt.size<2)continue;let Ye=vt.values().next().value;if(!Ye)continue;let je=Je.get(Ye);if(!je)continue;if(![...vt].every((st)=>Je.get(st)===je))continue;je.externallyConnectedPointIds??=[],je.externallyConnectedPointIds.push([...vt])}}let kt=d??v?.min_via_hole_diameter,Lt=u??v?.min_via_pad_diameter,Bt=i??v?.min_trace_to_hole_edge_clearance,xt=r??v?.min_trace_to_pad_edge_clearance,Yt=s??v?.min_via_edge_to_pad_edge_clearance,ut=a??v?.min_via_hole_edge_to_via_hole_edge_clearance,Ze=c??v?.min_plated_hole_drill_edge_to_drill_edge_clearance,Fe=l??v?.min_pad_edge_to_pad_edge_clearance,tt=h??v?.min_board_edge_clearance;return{simpleRouteJson:{bounds:ee,obstacles:U,connections:nt,differentialPairs:ct,...Ct?{buses:Ct}:{},traces:H.length>0?H:void 0,layerCount:v?.num_layers??2,allowBlindAndBuriedVias:v?.allow_blind_and_buried_vias??!1,allowViaInPad:v?.is_via_in_pad_allowed??!1,minTraceWidth:Math.min(dt,...nt.map((Je)=>Je.width)),minViaDiameter:Lt,minViaHoleDiameter:kt,minViaPadDiameter:Lt,min_via_hole_diameter:kt,min_via_pad_diameter:Lt,minTraceToPadEdgeClearance:xt,minTraceToHoleEdgeClearance:Bt,minViaEdgeToPadEdgeClearance:Yt,minViaHoleEdgeToViaHoleEdgeClearance:ut,minPlatedHoleDrillEdgeToDrillEdgeClearance:Ze,minPadEdgeToPadEdgeClearance:Fe,minBoardEdgeClearance:tt,nominalTraceWidth:_,outline:b7n({bounds:J??ee,outline:v?.outline?.map((Je)=>({...Je}))},ee)},connMap:N}};var v7n=class extends nr{matchedPort=null;get config(){return{componentName:"TraceHint",zodProps:INt}}doInitialPortMatching(){let{db:e}=this.root,{_parsedProps:t,parent:n}=this;if(!n)return;if(n.componentName==="Trace"){this.renderError(`Port inference inside trace is not yet supported (${this})`);return}if(!n)throw Error("TraceHint has no parent");if(!t.for){this.renderError(`TraceHint has no for property (${this})`);return}let o=n.selectOne(t.for,{type:"port"});if(!o)this.renderError(`${this} could not find port for selector "${t.for}"`);this.matchedPort=o,o.registerMatch(this)}getPcbRouteHints(){let{_parsedProps:e}=this,t=e.offset?[e.offset]:e.offsets;if(!t)return[];let n=this._computePcbGlobalTransformBeforeLayout();return t.map((o)=>({...I7n.applyToPoint(n,o),via:o.via,to_layer:o.to_layer,trace_width:o.trace_width}))}doInitialPcbTraceHintRender(){if(this.root?.pcbDisabled)return;let{db:e}=this.root,{_parsedProps:t}=this;e.pcb_trace_hint.insert({pcb_component_id:this.matchedPort?.pcb_component_id,pcb_port_id:this.matchedPort?.pcb_port_id,route:this.getPcbRouteHints()})}};function Nsi({anchor:e,x:t,y:n,width:o,height:r,isInside:i}){switch(e){case"top_left":return{x:t,y:n+r,textAnchor:i?"top_left":"bottom_left"};case"top_center":return{x:t+o/2,y:n+r,textAnchor:i?"top_center":"bottom_center"};case"top_right":return{x:t+o,y:n+r,textAnchor:i?"top_right":"bottom_right"};case"center_left":return{x:t,y:n+r/2,textAnchor:i?"center_left":"center_right"};case"center":return{x:t+o/2,y:n+r/2,textAnchor:"center"};case"center_right":return{x:t+o,y:n+r/2,textAnchor:i?"center_right":"center_left"};case"bottom_left":return{x:t,y:n,textAnchor:i?"bottom_left":"top_left"};case"bottom_center":return{x:t+o/2,y:n,textAnchor:i?"bottom_center":"top_center"};case"bottom_right":return{x:t+o,y:n,textAnchor:i?"bottom_right":"top_right"};default:return{x:t+o/2,y:n+r,textAnchor:"center"}}}var S7n=(e)=>{if(!e)return[];return Object.entries($he(e)).map(([t,n])=>{let o=nB(t);if(o===null)throw Error(`Invalid schematicbox pinLabels key "${t}". Expected pin<number>.`);let r=typeof n==="string"?[n]:[...n];return{pinNumber:o,displayPinLabel:r[0]??t,pinAliases:r}})},Rsi=({referencedChip:e,schematicBoxPins:t})=>{let n=Nde(e._parsedProps.schPinStyle,e._parsedProps.pinLabels);if(!n)return;let o={};for(let{pinNumber:r,referencedSourcePort:i}of t){if(i.pin_number===void 0)continue;let s=n[`pin${i.pin_number}`];if(s)o[`pin${r}`]=s}return Object.keys(o).length>0?o:void 0},Qsi=({inheritedPinStyle:e,overridePinStyle:t})=>{if(!e&&!t)return;let n={...e};for(let[o,r]of Object.entries(t??{}))n[o]={...n[o],...r};return Object.keys(n).length>0?n:void 0},ksi=(e)=>{if(e.root?.schematicDisabled)return;let{db:t}=e.root,n=e._parsedProps;if(!n.chipRef)return;let o=e.getSubcircuit().selectOne(n.chipRef);if(!o?.source_component_id)throw Error(`Could not resolve chipRef "${n.chipRef}" for ${e.getString()}`);let r=S7n(n.pinLabels),i=Object.fromEntries(r.map(({pinNumber:f,displayPinLabel:y})=>[`pin${f}`,y])),s=t.source_port.list({source_component_id:o.source_component_id}),a=r.map((f)=>{let y=s.find((x)=>f.pinAliases.some((C)=>x.name===C||x.port_hints?.includes(C)));if(!y)throw Error(`Could not find pin "${f.displayPinLabel}" on chipRef "${n.chipRef}"`);return{...f,referencedSourcePort:y}}),c=Rsi({referencedChip:o,schematicBoxPins:a}),l=Qsi({inheritedPinStyle:c,overridePinStyle:Nde(n.schPinStyle,n.pinLabels)}),h=Tit({schWidth:n.width,schHeight:n.height,schPinSpacing:0.2,pinCount:r.length,schPortArrangement:n.schPinArrangement,numericSchPinStyle:Nde(l),pinLabels:i}),d=e._getGlobalSchematicPositionBeforeLayout(),u=h.getSize(),_=e._resolveSchematicSheetId(),p=Object.fromEntries(r.map(({pinNumber:f,displayPinLabel:y})=>[String(f),y])),m=t.schematic_component.insert({center:d,size:u,source_component_id:o.source_component_id,is_box_with_pins:!0,port_arrangement:Eit(n.schPinArrangement),port_labels:p,pin_spacing:0.2,pin_styles:Pit(l),schematic_sheet_id:_});e.schematic_component_id=m.schematic_component_id;for(let{pinNumber:f,displayPinLabel:y,referencedSourcePort:x}of a){let C=h.getPortPositionByPinNumber(f);if(!C)throw Error(`Could not determine schematic position for ${e.getString()} pin${f}`);let b={left:"left",right:"right",top:"up",bottom:"down"}[C.side];t.schematic_port.insert({schematic_component_id:m.schematic_component_id,center:{x:d.x+C.x,y:d.y+C.y},source_port_id:x.source_port_id,facing_direction:b,distance_from_component_edge:0.4,side_of_component:C.side,pin_number:f,true_ccw_index:C.trueIndex,display_pin_label:y,is_connected:!1,schematic_sheet_id:_})}let A=n.name??n.chipRef;t.schematic_text.insert({text:A,schematic_component_id:m.schematic_component_id,anchor:"left",rotation:0,position:{x:d.x-u.width/2,y:d.y+u.height/2+0.13},color:"#006464",font_size:0.18,schematic_sheet_id:_});let g=t.source_component.get(o.source_component_id);t.schematic_text.insert({text:g?.manufacturer_part_number??"",schematic_component_id:m.schematic_component_id,anchor:"left",rotation:0,position:{x:d.x-u.width/2,y:d.y-u.height/2-0.13},color:"#006464",font_size:0.18,schematic_sheet_id:_})},P7n=class extends nr{isSchematicPrimitive=!0;get config(){return{componentName:"SchematicBox",zodProps:oNt,shouldRenderAsSchematicBox:!0}}doInitialSchematicComponentRender(){ksi(this)}doInitialSchematicPrimitiveRender(){if(this.root?.schematicDisabled)return;if(this.getCollapsedSchematicBoxAncestor())return;let{db:e}=this.root,{_parsedProps:t}=this;if(t.chipRef)return;let n=0.6,o=typeof t.padding==="number"?t.padding:0,r=typeof t.paddingTop==="number"?t.paddingTop:o,i=typeof t.paddingBottom==="number"?t.paddingBottom:o,s=typeof t.paddingLeft==="number"?t.paddingLeft:o,a=typeof t.paddingRight==="number"?t.paddingRight:o,c=t.overlay&&t.overlay.length>0,l=typeof t.width==="number"&&typeof t.height==="number",h,d,u,_,p,m;if(c){let g=t.overlay.map((j)=>({selector:j,port:this.getSubcircuit().selectOne(j,{type:"port"})})).filter(({port:j})=>j!=null).map(({port:j})=>({position:j._getGlobalSchematicPositionAfterLayout()}));if(g.length===0)return;let f=g.map((j)=>j.position.x),y=g.map((j)=>j.position.y),x=Math.min(...f),C=Math.max(...f),b=Math.min(...y),I=Math.max(...y),v=C-x,P=I-b,M=v===0?n:0,B=P===0?n:0,T=s+M/2,N=a+M/2,D=r+B/2,L=i+B/2,H=x-T,V=C+N,O=b-L,U=I+D;h=V-H,d=U-O,u=H+(t.schX??0),_=O+(t.schY??0),p=u+h/2,m=_+d/2}else if(l){h=t.width,d=t.height;let A=this._getGlobalSchematicPositionBeforeLayout();p=A.x,m=A.y,u=p-h/2,_=m-d/2}else return;if(e.schematic_box.insert({height:d,width:h,x:u,y:_,is_dashed:t.strokeStyle==="dashed",schematic_sheet_id:this._resolveSchematicSheetId()}),t.title){let A=t.titleInside,g=0.1,f=t.titleAlignment,y=Nsi({anchor:f,x:u,y:_,width:h,height:d,isInside:A}),x,C,b=y.textAnchor;if(A)x=f.includes("top")?-0.1:f.includes("bottom")?0.1:0,C=f.includes("left")?0.1:f.includes("right")?-0.1:0;else x=f.includes("top")?0.1:f.includes("bottom")?-0.1:0,C=f.includes("center_left")?-0.1:f.includes("center_right")?0.1:0;let I=y.x+C,v=y.y+x;e.schematic_text.insert({anchor:b,text:t.title,font_size:t.titleFontSize??0.18,color:t.titleColor??"#000000",position:{x:I,y:v},rotation:0,schematic_sheet_id:this._resolveSchematicSheetId()})}}},Lsi=(e)=>{if(!e.isSubcircuit||e.root?.schematicDisabled)return;let{db:t}=e.root,n=new Map,o=new Set,r=e.getDescendants().filter((s)=>s instanceof P7n&&s.getSubcircuit()===e);for(let s of r){let{chipRef:a,pinLabels:c}=s._parsedProps,l=s._resolveSchematicSheetId();if(!a||!l)continue;let h=s.getSubcircuit().selectOne(a);if(!(h instanceof bl))continue;if(!h.source_component_id)continue;o.add(h.source_component_id);let d=t.source_port.list({source_component_id:h.source_component_id});for(let{pinAliases:u}of S7n(c)){let p=d.find((A)=>u.some((g)=>A.name===g||A.port_hints?.includes(g)))?.subcircuit_connectivity_map_key;if(!p)continue;let m=n.get(p)??new Set;m.add(l),n.set(p,m)}}let i=e.getDescendants().filter((s)=>s instanceof bl&&s.getSubcircuit()===e);for(let s of i){if(!s.source_component_id)continue;if(o.has(s.source_component_id))continue;if(s._resolveSchematicSheetId())continue;let a=new Set,c=t.source_port.list({source_component_id:s.source_component_id});for(let h of c){let d=h.subcircuit_connectivity_map_key;if(!d)continue;let u=n.get(d);if(!u)continue;for(let _ of u)a.add(_)}if(a.size!==1)continue;let[l]=a;if(!l)continue;s.schematic_sheet_id=l}},Hsi=new Set(["x","y","minx","maxx","miny","maxy","width","height"]);function Fsi(e){if(e.root?.pcbDisabled)return;if(!e.isSubcircuit)return;let{db:t}=e.root,n=e.getNormalComponentNameMap?.()??new Map,o=zsi(e);if(!o.some(Dyn))return;let r={};for(let d of o)Nyn(d,r);let i=new Map,s=new Map,a=new Map;for(let d of o){if(!Dyn(d))continue;let u=Osi(d);if(!d.name)throw Error(`Invalid pcb position expression for ${d.getString()}: component-relative calc requires the component to have a name`);i.set(d.name,{component:d,refs:u}),s.set(d.name,0)}for(let[d,u]of i.entries()){let _=new Set;for(let p of u.refs){let{referencePath:m,field:A}=Vsi(p);if(!Hsi.has(A))throw Error(`Invalid pcb position expression for ${u.component.getString()}: unsupported component field "${A}" in "${p}"`);let g=Ysi({token:p,referencePath:m,candidate:u,normalComponentNameMap:n});if(i.has(g)&&g!==d)_.add(g)}for(let p of _){if(s.set(d,(s.get(d)??0)+1),!a.has(p))a.set(p,new Set);a.get(p).add(d)}}let c=[...s.entries()].filter(([,d])=>d===0).map(([d])=>d),l=0;while(c.length>0){let d=c.shift(),u=i.get(d);if(!u)continue;h(u.component,r),l++;for(let _ of a.get(d)??[]){let p=(s.get(_)??0)-1;if(s.set(_,p),p===0)c.push(_)}}if(l<i.size){let d=[...i.keys()].filter((u)=>(s.get(u)??0)>0);throw Error(`Circular pcb position calc references detected among: ${d.join(", ")}`)}function h(d,u){if(!d.pcb_component_id)return;let _=t.pcb_component.get(d.pcb_component_id);if(!_)return;let p=d._parsedProps.pcbX,m=d._parsedProps.pcbY,A=d.props,g=d._parsedProps.pcbLeftEdgeX??A.pcbLeftEdgeX,f=d._parsedProps.pcbRightEdgeX??A.pcbRightEdgeX,y=d._parsedProps.pcbTopEdgeY??A.pcbTopEdgeY,x=d._parsedProps.pcbBottomEdgeY??A.pcbBottomEdgeY;if(g!==void 0&&f!==void 0)throw Error(`${d.componentName} cannot set both pcbLeftEdgeX and pcbRightEdgeX`);if(y!==void 0&&x!==void 0)throw Error(`${d.componentName} cannot set both pcbTopEdgeY and pcbBottomEdgeY`);let C=_.width??0,b=_.height??0,I={x:_.center.x,y:_.center.y};if(p!==void 0){let v=d.resolvePcbCoordinate({rawValue:p,axis:"pcbX",allowComponentVariables:!0,componentVariables:u});d._resolvedPcbCalcOffsetX=v,I.x=v}else if(g!==void 0){let P=d.resolvePcbCoordinate({rawValue:g,axis:"pcbX",allowComponentVariables:!0,componentVariables:u,propertyName:"pcbLeftEdgeX"})+C/2;d._resolvedPcbCalcOffsetX=P,I.x=P}else if(f!==void 0){let P=d.resolvePcbCoordinate({rawValue:f,axis:"pcbX",allowComponentVariables:!0,componentVariables:u,propertyName:"pcbRightEdgeX"})-C/2;d._resolvedPcbCalcOffsetX=P,I.x=P}if(m!==void 0){let v=d.resolvePcbCoordinate({rawValue:m,axis:"pcbY",allowComponentVariables:!0,componentVariables:u});d._resolvedPcbCalcOffsetY=v,I.y=v}else if(y!==void 0){let P=d.resolvePcbCoordinate({rawValue:y,axis:"pcbY",allowComponentVariables:!0,componentVariables:u,propertyName:"pcbTopEdgeY"})-b/2;d._resolvedPcbCalcOffsetY=P,I.y=P}else if(x!==void 0){let P=d.resolvePcbCoordinate({rawValue:x,axis:"pcbY",allowComponentVariables:!0,componentVariables:u,propertyName:"pcbBottomEdgeY"})+b/2;d._resolvedPcbCalcOffsetY=P,I.y=P}d._repositionOnPcb(I),Nyn(d,u)}}function Dyn(e){let{_parsedProps:t,props:n}=e,{pcbX:o,pcbY:r}=t,i=t.pcbLeftEdgeX??n.pcbLeftEdgeX,s=t.pcbRightEdgeX??n.pcbRightEdgeX,a=t.pcbTopEdgeY??n.pcbTopEdgeY,c=t.pcbBottomEdgeY??n.pcbBottomEdgeY;if(i!==void 0||s!==void 0||a!==void 0||c!==void 0)return!0;return typeof o==="string"||typeof r==="string"}function zsi(e){let t=[],n=(o)=>{if(o._isNormalComponent)t.push(o);for(let r of o.children)if(!r.isSubcircuit)n(r)};for(let o of e.children)if(!o.isSubcircuit)n(o);return t}function Osi(e){let t=new Set,n=e._parsedProps.pcbX,o=e._parsedProps.pcbY,r=e.props,i=e._parsedProps.pcbLeftEdgeX??r.pcbLeftEdgeX,s=e._parsedProps.pcbRightEdgeX??r.pcbRightEdgeX,a=e._parsedProps.pcbTopEdgeY??r.pcbTopEdgeY,c=e._parsedProps.pcbBottomEdgeY??r.pcbBottomEdgeY,l=(h)=>{if(typeof h!=="string")return;let d=oot(h);for(let u of d)if(!u.startsWith("board."))t.add(u)};return l(n),l(o),l(i),l(s),l(a),l(c),t}function Vsi(e){let t=e.lastIndexOf(".");if(t<=0||t===e.length-1)throw Error(`Invalid component reference token: "${e}"`);return{referencePath:e.slice(0,t),field:e.slice(t+1).toLowerCase()}}function Ysi(e){let{token:t,referencePath:n,candidate:o,normalComponentNameMap:r}=e,i=r.get(n);if(i&&i.length>0){if(i.length>1)throw Error(`Invalid pcb position expression for ${o.component.getString()}: ambiguous component reference "${n}" in "${t}"`);return n}let s=null;for(let a of r.keys()){if(!n.startsWith(`${a}.`))continue;if(!s||a.length>s.length)s=a}if(!s)throw Error(`Invalid pcb position expression for ${o.component.getString()}: unknown component reference "${n}" in "${t}"`);return s}function Nyn(e,t){if(!e.name||!e.pcb_component_id||!e.root)return;let n=e.root.db.pcb_component.get(e.pcb_component_id);if(!n)return;let o=n.width??0,r=n.height??0,i=n.center.x,s=n.center.y;s5n({vars:t,componentName:e.name,position:{x:i,y:s},size:{width:o,height:r}});let a=Gsi(e);for(let[c,l]of a.entries()){let h=V1(l),{minX:d,maxX:u,minY:_,maxY:p}=h;t[`${c}.x`]=(d+u)/2,t[`${c}.y`]=(_+p)/2,t[`${c}.width`]=u-d,t[`${c}.height`]=p-_,t[`${c}.minX`]=d,t[`${c}.maxX`]=u,t[`${c}.minY`]=_,t[`${c}.maxY`]=p}}function Gsi(e){let t=new Map;if(!e.name||!e.pcb_component_id||!e.root)return t;let{db:n}=e.root,o=[...n.pcb_smtpad.list({pcb_component_id:e.pcb_component_id}),...n.pcb_plated_hole.list({pcb_component_id:e.pcb_component_id})];for(let r of o){let i=new Set;for(let a of r.port_hints??[])if(typeof a==="string"&&a.length>0)i.add(a);let s=r.pcb_port_id;if(s){let a=n.pcb_port.get(s),c=a?.source_port_id?n.source_port.get(a.source_port_id):null;if(c?.name)i.add(c.name);if(c?.pin_number!=null)i.add(`pin${c.pin_number}`)}for(let a of i){let c=`${e.name}.${a}`;if(!t.has(c))t.set(c,[]);t.get(c).push(r)}}return t}function Usi(e){if(e.root?.pcbDisabled)return;if(!e.pcb_group_id)return;let t=e._parsedProps?.pcbPositionAnchor;if(!t)return;let n=e._getGlobalPcbPositionBeforeLayout(),{pcbX:o,pcbY:r}=e._parsedProps;if(o===void 0&&r===void 0)return;let{db:i}=e.root,s=i.pcb_group.get(e.pcb_group_id);if(!s)return;let{width:a,height:c}=s,{center:l}=s;if(s.outline&&s.outline.length>0){let m=Ms(s.outline);if(m)a=m.maxX-m.minX,c=m.maxY-m.minY}if(!a||!c)return;let h={left:l.x-a/2,right:l.x+a/2,top:l.y+c/2,bottom:l.y-c/2},d={...l},u=null;if(new Set(["center","top_left","top_center","top_right","center_left","center_right","bottom_left","bottom_center","bottom_right"]).has(t))switch(t){case"center":u=d;break;case"top_left":u={x:h.left,y:h.top};break;case"top_center":u={x:d.x,y:h.top};break;case"top_right":u={x:h.right,y:h.top};break;case"center_left":u={x:h.left,y:d.y};break;case"center_right":u={x:h.right,y:d.y};break;case"bottom_left":u={x:h.left,y:h.bottom};break;case"bottom_center":u={x:d.x,y:h.bottom};break;case"bottom_right":u={x:h.right,y:h.bottom};break}if(!u)return;let p={...d};if(n.x!==void 0)p.x+=n.x-u.x;if(n.y!==void 0)p.y+=n.y-u.y;if(Math.abs(p.x-d.x)>0.000001||Math.abs(p.y-d.y)>0.000001)e._repositionOnPcb(p),i.pcb_group.update(e.pcb_group_id,{center:p});i.pcb_group.update(e.pcb_group_id,{anchor_position:n,anchor_alignment:t,display_offset_x:o,display_offset_y:r})}var Wsi=(e)=>{let{db:t}=e.root,{_parsedProps:n}=e,o=e.children.filter((C)=>C.pcb_component_id||C.pcb_group_id);if(o.some((C)=>{let b=C._parsedProps;return b?.pcbX!==void 0||b?.pcbY!==void 0}))return;let i=n.pcbJustifyContent??n.justifyContent,s=n.pcbAlignItems??n.alignItems,a=n.pcbFlexGap??n.pcbGap??n.gap,c=n.pcbFlexDirection??"row",l={start:"flex-start",end:"flex-end","flex-start":"flex-start","flex-end":"flex-end",stretch:"space-between","space-between":"space-between","space-around":"space-around","space-evenly":"space-evenly",center:"center"}[i??"space-between"],h={start:"flex-start",end:"flex-end","flex-start":"flex-start","flex-end":"flex-end",stretch:"stretch",center:"center"}[s??"center"];if(!l)throw Error(`Invalid justifyContent value: "${i}"`);if(!h)throw Error(`Invalid alignItems value: "${s}"`);let d=0,u=0;if(typeof a==="object")d=a.y??0,u=a.x??0;else if(typeof a==="number")d=a,u=a;else if(typeof a==="string")d=be.parse(a),u=be.parse(a);let _,p=n.width??n.pcbWidth??void 0,m=n.height??n.pcbHeight??void 0;if(Boolean(p===void 0||m===void 0))_=YAe(o.map((C)=>C._getMinimumFlexContainerSize()).filter((C)=>C!==null),{alignItems:h,justifyContent:l,direction:c,rowGap:d,columnGap:u}),p=_.width,m=_.height;let g=new q6e(p,m,{alignItems:h,justifyContent:l,direction:c,rowGap:d,columnGap:u});for(let C of o){let b=C._getMinimumFlexContainerSize();g.addChild({metadata:C,width:b?.width??0,height:b?.height??0,flexBasis:!b?void 0:c==="row"?b.width:b.height})}g.build();let f={minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0,width:0,height:0};for(let C of g.children)f.minX=Math.min(f.minX,C.position.x),f.minY=Math.min(f.minY,C.position.y),f.maxX=Math.max(f.maxX,C.position.x+C.size.width),f.maxY=Math.max(f.maxY,C.position.y+C.size.height);f.width=f.maxX-f.minX,f.height=f.maxY-f.minY;let y=e._getGlobalPcbPositionBeforeLayout(),x={x:y.x-(f.maxX+f.minX)/2,y:y.y-(f.maxY+f.minY)/2};for(let C of g.children)C.metadata._repositionOnPcb({x:C.position.x+C.size.width/2+x.x,y:C.position.y+C.size.height/2+x.y});t.pcb_group.update(e.pcb_group_id,{width:f.width,height:f.height,center:y})},Hnt=1;function Xsi(e){let{db:t}=e.root,n=e._parsedProps,o=jsi(e);if(o.length===0)return;let r=Ksi({db:t,pcbChildren:o}),i=$si(n),s=qsi({props:n,pcbChildren:o,childDimensions:r,gridConfig:i}),a=eai({pcbChildren:o,childDimensions:r,gridLayout:s,gridConfig:i}),{itemCoordinates:c}=a.layout();tai({db:t,group:e,pcbChildren:o,itemCoordinates:c,gridLayout:s}),nai({db:t,group:e,props:n,gridLayout:s})}function jsi(e){return e.children.filter((t)=>t.pcb_component_id||t.pcb_group_id)}function Ksi(e){let{db:t,pcbChildren:n}=e,o=0,r=0;for(let i of n){let s=0,a=0;if(i.pcb_group_id){let c=t.pcb_group.get(i.pcb_group_id);s=c?.width??0,a=c?.height??0}else if(i.pcb_component_id){let c=t.pcb_component.get(i.pcb_component_id);s=c?.width??0,a=c?.height??0}o=Math.max(o,s),r=Math.max(r,a)}return{width:o,height:r}}function $si(e){let t=e.pcbGridCols??e.gridCols??e.pcbLayout?.grid?.cols,n=e.pcbGridRows??e.pcbLayout?.grid?.rows,{pcbGridTemplateColumns:o,pcbGridTemplateRows:r}=e,i=(d)=>{if(d===void 0)return Hnt;return typeof d==="number"?d:be.parse(d)},s=e.pcbGridGap??e.gridGap??e.pcbLayout?.gridGap,a=e.pcbGridRowGap??e.gridRowGap??e.pcbLayout?.gridRowGap,c=e.pcbGridColumnGap??e.gridColumnGap??e.pcbLayout?.gridColumnGap,l=Hnt,h=Hnt;if(a!==void 0||c!==void 0){let d=typeof s==="object"?s?.x:s,u=typeof s==="object"?s?.y:s;l=i(c??d),h=i(a??u)}else if(typeof s==="object"&&s!==null)l=i(s.x),h=i(s.y);else{let d=i(s);l=d,h=d}return{cols:t,rows:n,gapX:l,gapY:h,templateColumns:o,templateRows:r}}function qsi(e){let{props:t,pcbChildren:n,childDimensions:o,gridConfig:r}=e;if(t.pcbGridTemplateColumns||t.pcbGridTemplateRows)return Jsi({props:t,gridConfig:r,pcbChildren:n,childDimensions:o});return Zsi({gridConfig:r,pcbChildren:n,childDimensions:o})}function Jsi(e){let{props:t,gridConfig:n,pcbChildren:o,childDimensions:r}=e,i=t.pcbGridTemplateColumns??"",s=t.pcbGridTemplateRows??"",a=(u)=>{let _=u.match(/repeat\((\d+),/);return _?parseInt(_[1]):Math.ceil(Math.sqrt(o.length))},c=t.pcbGridTemplateColumns?a(i):Math.ceil(Math.sqrt(o.length)),l=t.pcbGridTemplateRows?a(s):Math.ceil(o.length/c),h=c*r.width+Math.max(0,c-1)*n.gapX,d=l*r.height+Math.max(0,l-1)*n.gapY;return{gridTemplateColumns:i,gridTemplateRows:s,containerWidth:h,containerHeight:d}}function Zsi(e){let{gridConfig:t,pcbChildren:n,childDimensions:o}=e,r,i;if(t.cols!==void 0&&t.rows!==void 0)r=t.cols,i=t.rows;else if(t.cols!==void 0)r=t.cols,i=Math.ceil(n.length/r);else if(t.rows!==void 0)i=t.rows,r=Math.ceil(n.length/i);else r=Math.ceil(Math.sqrt(n.length)),i=Math.ceil(n.length/r);r=Math.max(1,r),i=Math.max(1,i);let s=r*o.width+Math.max(0,r-1)*t.gapX,a=i*o.height+Math.max(0,i-1)*t.gapY,c=`repeat(${r}, ${o.width}px)`,l=`repeat(${i}, ${o.height}px)`;return{gridTemplateColumns:c,gridTemplateRows:l,containerWidth:s,containerHeight:a}}function eai(e){let{pcbChildren:t,childDimensions:n,gridLayout:o,gridConfig:r}=e,i=t.map((s,a)=>({key:s.getString()||`child-${a}`,contentWidth:n.width,contentHeight:n.height}));return new zdn({containerWidth:o.containerWidth,containerHeight:o.containerHeight,gridTemplateColumns:o.gridTemplateColumns,gridTemplateRows:o.gridTemplateRows,gap:[r.gapY,r.gapX],children:i})}function tai(e){let{db:t,group:n,pcbChildren:o,itemCoordinates:r,gridLayout:i}=e,s=n._getGlobalPcbPositionBeforeLayout(),a=t.toArray();for(let c=0;c<o.length;c++){let l=o[c],h=l.getString()||`child-${c}`,d=r[h];if(!d){console.warn(`PCB grid layout: No coordinates found for child ${h}`);continue}let u=s.x-i.containerWidth/2+d.x+d.width/2,_=s.y+i.containerHeight/2-d.y-d.height/2;if(l.pcb_component_id)OAe(a,l.pcb_component_id,{x:u,y:_});else{let p=l;if(p.pcb_group_id&&p.source_group_id)VAe(a,p.source_group_id,{x:u,y:_})}}}function nai(e){let{db:t,group:n,props:o,gridLayout:r}=e;if(n.pcb_group_id){let i=n._getGlobalPcbPositionBeforeLayout();t.pcb_group.update(n.pcb_group_id,{width:o.width??r.containerWidth,height:o.height??r.containerHeight,center:i})}}var oai=(e,t,n=()=>performance.now())=>{if(t===void 0||!Number.isFinite(t)||t<=0)return e.solve(),{elapsedMs:0,timedOut:!1};let o=n(),r=0;while(!e.solved&&!e.failed){if(e.step(),e.solved||e.failed)break;if(r=n()-o,r>=t)return{elapsedMs:r,timedOut:!0}}return{elapsedMs:r,timedOut:!1}},rai=(e,t)=>{let n=e.children.filter((d)=>d.componentName==="Constraint"&&d._parsedProps.pcb),o=new Map,r={},i=(d)=>{if(r[d]!==d)r[d]=i(r[d]);return r[d]},s=(d,u)=>{let _=i(d),p=i(u);if(_!==p)r[p]=_},a=(d)=>{if(!(d in r))r[d]=d},c=(d)=>{let u=d.startsWith(".")?d.slice(1):d;return e.children.find((p)=>p.name===u)?.pcb_component_id??void 0};for(let d of n){let u=d._parsedProps;if("left"in u&&"right"in u){let _=c(u.left),p=c(u.right);if(_&&p)a(_),a(p),s(_,p)}else if("top"in u&&"bottom"in u){let _=c(u.top),p=c(u.bottom);if(_&&p)a(_),a(p),s(_,p)}else if("for"in u&&Array.isArray(u.for)){let _=u.for.map((p)=>c(p)).filter((p)=>!!p);for(let p of _)a(p);for(let p=1;p<_.length;p++)s(_[0],_[p])}}for(let d of Object.keys(r)){let u=i(d);if(!o.has(u))o.set(u,{componentIds:[],constraints:[]});o.get(u).componentIds.push(d)}for(let d of n){let u=d._parsedProps,_;if("left"in u)_=c(u.left);else if("top"in u)_=c(u.top);else if("for"in u)_=c(u.for[0]);if(!_)continue;let p=i(_);o.get(p)?.constraints.push(d)}let l={},h=Object.fromEntries(t.components.map((d)=>[d.componentId,d]));for(let[d,u]of o.entries()){if(u.componentIds.length<=1)continue;let _=new uae,p={},m=(P,M)=>{let B=`${P}_${M}`;if(!p[B])p[B]=new wR(B);return p[B]},A=u.componentIds[0];_.addConstraint(new mA(m(A,"x"),Ip.Eq,0,fh.required)),_.addConstraint(new mA(m(A,"y"),Ip.Eq,0,fh.required));for(let P of u.constraints){let M=P._parsedProps;if("xDist"in M){let B=c(M.left),T=c(M.right);if(B&&T)_.addConstraint(new mA(new od(m(T,"x"),[-1,m(B,"x")]),Ip.Eq,M.xDist,fh.required))}else if("yDist"in M){let B=c(M.top),T=c(M.bottom);if(B&&T)_.addConstraint(new mA(new od(m(B,"y"),[-1,m(T,"y")]),Ip.Eq,M.yDist,fh.required))}else if("sameX"in M&&Array.isArray(M.for)){let B=M.for.map((T)=>c(T)).filter((T)=>!!T);if(B.length>1){let T=m(B[0],"x");for(let N=1;N<B.length;N++)_.addConstraint(new mA(new od(m(B[N],"x"),[-1,T]),Ip.Eq,0,fh.required))}}else if("sameY"in M&&Array.isArray(M.for)){let B=M.for.map((T)=>c(T)).filter((T)=>!!T);if(B.length>1){let T=m(B[0],"y");for(let N=1;N<B.length;N++)_.addConstraint(new mA(new od(m(B[N],"y"),[-1,T]),Ip.Eq,0,fh.required))}}}_.updateVariables();let g={};for(let P of u.componentIds)g[P]={x:m(P,"x").value(),y:m(P,"y").value()};let f=1/0,y=1/0,x=-1/0,C=-1/0;for(let P of u.componentIds){let M=h[P],B=g[P];if(!M)continue;for(let T of M.pads){let N=B.x+T.offset.x,D=B.y+T.offset.y;f=Math.min(f,N-T.size.x/2),x=Math.max(x,N+T.size.x/2),y=Math.min(y,D-T.size.y/2),C=Math.max(C,D+T.size.y/2)}}let b={x:(f+x)/2,y:(y+C)/2},I=[],v={};for(let P of u.componentIds){let M=h[P],B=g[P];if(!M)continue;v[P]={x:B.x-b.x,y:B.y-b.y};for(let T of M.pads)I.push({padId:T.padId,networkId:T.networkId,type:T.type,size:T.size,offset:{x:B.x+T.offset.x-b.x,y:B.y+T.offset.y-b.y}})}t.components=t.components.filter((P)=>!u.componentIds.includes(P.componentId)),t.components.push({componentId:u.componentIds[0],pads:I,availableRotationDegrees:[0]}),u.relativeCenters=v,l[u.componentIds[0]]=u}return l},Ryn=({db:e,pcbComponentId:t,rotationDegrees:n,layer:o})=>{if(n==null)return;if(!e?.cad_component?.list)return;let r=e.cad_component.getWhere({pcb_component_id:t});if(!r)return;let i=o?.toLowerCase?.()==="bottom"?-n:n,s=r.rotation?.z??0,a={...r.rotation??{x:0,y:0,z:0},z:nu(s+i)};e.cad_component.update(r.cad_component_id,{rotation:a}),r.rotation=a},ide=(e,t,n)=>{if(t===n)return!0;let o=e.source_group.get(t);if(!o||!o.parent_source_group_id)return!1;return ide(e,o.parent_source_group_id,n)},iai=(e,t,n,o)=>{let{db:r}=e.root;for(let i of t.components){if(i.isStatic)continue;let{center:s,componentId:a,ccwRotationOffset:c,ccwRotationDegrees:l}=i,h=n[a];if(h){let f=l??c??0,y=f*Math.PI/180;for(let x of h.componentIds){let C=h.relativeCenters[x];if(!C)continue;r.pcb_component.update(x,{position_mode:"packed"});let b={x:C.x*Math.cos(y)-C.y*Math.sin(y),y:C.x*Math.sin(y)+C.y*Math.cos(y)},I=r.pcb_component.get(x);if(!I)continue;let v=I.center,P=Sy.compose(e._computePcbGlobalTransformBeforeLayout(),Sy.translate(s.x+b.x,s.y+b.y),Sy.rotate(y),Sy.translate(-v.x,-v.y)),M=r.toArray().filter((B)=>("pcb_component_id"in B)&&B.pcb_component_id===x);NN(M,P),Ryn({db:r,pcbComponentId:x,rotationDegrees:f,layer:I.layer})}continue}let d=r.pcb_component.get(a);if(d){r.pcb_component.update(a,{position_mode:"packed"});let f=e.source_group_id,x=r.source_component.get(d.source_component_id)?.source_group_id;if(x!==void 0&&!ide(r,x,f))continue;let C=d.center,b=l??c??0,I=Sy.compose(e._computePcbGlobalTransformBeforeLayout(),Sy.translate(s.x,s.y),Sy.rotate(b*Math.PI/180),Sy.translate(-C.x,-C.y)),v=r.toArray().filter((P)=>("pcb_component_id"in P)&&P.pcb_component_id===a);NN(v,I),Ryn({db:r,pcbComponentId:a,rotationDegrees:b,layer:d.layer});continue}let u=r.pcb_group.list().find((f)=>f.source_group_id===a);if(!u)continue;let p=o.components.find((f)=>f.componentId===a)?.center??u.center,m=l??c??0,A=Sy.compose(e._computePcbGlobalTransformBeforeLayout(),Sy.translate(s.x,s.y),Sy.rotate(m*Math.PI/180),Sy.translate(-p.x,-p.y)),g=r.toArray().filter((f)=>{if("source_group_id"in f&&f.source_group_id){if(f.source_group_id===a)return!0;if(ide(r,f.source_group_id,a))return!0}if("source_component_id"in f&&f.source_component_id){let y=r.source_component.get(f.source_component_id);if(y?.source_group_id){if(y.source_group_id===a)return!0;if(ide(r,y.source_group_id,a))return!0}}if("pcb_component_id"in f&&f.pcb_component_id){let y=r.pcb_component.get(f.pcb_component_id);if(y?.source_component_id){let x=r.source_component.get(y.source_component_id);if(x?.source_group_id){if(x.source_group_id===a)return!0;if(ide(r,x.source_group_id,a))return!0}}}return!1});for(let f of g)if(f.type==="pcb_component")r.pcb_component.update(f.pcb_component_id,{position_mode:"packed"});NN(g,A),r.pcb_group.update(u.pcb_group_id,{center:s})}if(e.pcb_group_id){let i=r.pcb_component.list({pcb_group_id:e.pcb_group_id});e.calculatePcbGroupBounds(zAe(i))}},Qyn=(e)=>(e??"top").toLowerCase(),M7n=(e,t)=>{let n=new Set,o=t.pcb_component.get(e.componentId);if(o)n.add(Qyn(o.layer));for(let r of e.pads){let i=t.pcb_via.get(r.padId),s=t.pcb_smtpad.get(r.padId)?.pcb_component_id??t.pcb_plated_hole.get(r.padId)?.pcb_component_id??i?.pcb_component_id;if(!s)continue;let a=t.pcb_component.get(s);if(a)n.add(Qyn(a.layer))}return n.size===1?n.values().next().value:void 0},sai=(e,t)=>{let n=new Map;for(let r of e.components){let i=M7n(r,t);if(!i)return[e];let s=n.get(i)??[];s.push(r),n.set(i,s)}if(n.size<=1)return[e];let o=(r)=>{if(r==="top")return 0;if(r==="bottom")return 1;return 2};return Array.from(n.entries()).sort(([r],[i])=>o(r)-o(i)||r.localeCompare(i)).map(([,r])=>({...e,components:r}))},aai="1mm",kyn=E7n.default("Group_doInitialPcbLayoutPack"),Lyn=(e)=>{if(e.courtyard&&e.center)return{obstacleId:e.componentId,absoluteCenter:{x:e.center.x+e.courtyard.offsetFromCenter.x,y:e.center.y+e.courtyard.offsetFromCenter.y},width:e.courtyard.width,height:e.courtyard.height};if(e.pads.length===0)return;let t=1/0,n=1/0,o=-1/0,r=-1/0;for(let i of e.pads){let s=i.absoluteCenter??(e.center?{x:e.center.x+i.offset.x,y:e.center.y+i.offset.y}:i.offset);t=Math.min(t,s.x-i.size.x/2),n=Math.min(n,s.y-i.size.y/2),o=Math.max(o,s.x+i.size.x/2),r=Math.max(r,s.y+i.size.y/2)}return{obstacleId:e.componentId,absoluteCenter:{x:(t+o)/2,y:(n+r)/2},width:o-t,height:r-n}},cai=({components:e,targetLayer:t,db:n})=>e.flatMap((o)=>o.pads.flatMap((r)=>{let i=n.pcb_plated_hole.get(r.padId),s=n.pcb_via.get(r.padId);if(!(i?.layers??s?.layers)?.includes(t))return[];let c=r.absoluteCenter??(o.center?{x:o.center.x+r.offset.x,y:o.center.y+r.offset.y}:r.offset);return[{obstacleId:`cross_layer_${t}_${r.padId}`,absoluteCenter:c,width:r.size.x,height:r.size.y}]})),lai=(e)=>{let{db:t}=e.root,{_parsedProps:n}=e;e.root?.emit("packing:start",{subcircuit_id:e.subcircuit_id,componentDisplayName:e.getString()});let{packOrderStrategy:o,packPlacementStrategy:r,gap:i,pcbGap:s,pcbPackGap:a}=n,c=a??s??i,l=be.parse(c??aai),h={},d=new Set,u=(v)=>{if(v?.pcb_component_id&&v?._parsedProps){let P=v._parsedProps,M=be.parse(P.pcbMarginLeft??P.pcbMarginX??0),B=be.parse(P.pcbMarginRight??P.pcbMarginX??0),T=be.parse(P.pcbMarginTop??P.pcbMarginY??0),N=be.parse(P.pcbMarginBottom??P.pcbMarginY??0);if(M||B||T||N)h[v.pcb_component_id]={left:M,right:B,top:T,bottom:N}}if(v?.children)v.children.forEach(u)};u(e);let _=new Set;for(let v of e.children){let P=v;if(P._isNormalComponent&&P.isRelativelyPositioned?.()){if(P.pcb_component_id)d.add(P.pcb_component_id);if(P.pcb_group_id)_.add(P.pcb_group_id)}}let p=(v,P,M)=>{if(P===M)return!0;let B=v.source_group.get(P);if(!B||!B.parent_source_group_id)return!1;return p(v,B.parent_source_group_id,M)};if(_.size>0)for(let v of t.toArray()){if(v.type!=="pcb_component")continue;let P=t.source_component.get(v.source_component_id);if(!P?.source_group_id)continue;for(let M of _)if(p(t,P.source_group_id,M))d.add(v.pcb_component_id)}let m=t.toArray(),A;if(n.width!==void 0&&n.height!==void 0){let v=be.parse(n.width),P=be.parse(n.height);A={minX:-v/2,maxX:v/2,minY:-P/2,maxY:P/2}}let g=Lhn(m,{source_group_id:e.source_group_id,chipMarginsMap:h,staticPcbComponentIds:Array.from(d)}),f={...Hhn(g),packOrderStrategy:o??"largest_to_smallest",packPlacementStrategy:r??"minimum_sum_squared_distance_to_network",minGap:l,bounds:A},y=rai(e,f);if(kyn.enabled)e.root?.emit("debug:logOutput",{type:"debug:logOutput",name:`packInput-circuitjson-${e.name}`,content:JSON.stringify(t.toArray())}),e.root?.emit("debug:logOutput",{type:"debug:logOutput",name:`packInput-${e.name}`,content:f});let x=sai(f,t),C={...f,components:[]},b=!1,I=(v)=>{let P=`Unable to pack all PCB components within the layout bounds: ${v}`;t.pcb_packing_error.insert({error_type:"pcb_packing_error",message:P,pcb_group_id:e.pcb_group_id??void 0,subcircuit_id:e.subcircuit_id??void 0}),e.root?.emit("packing:error",{subcircuit_id:e.subcircuit_id,componentDisplayName:e.getString(),error:{message:P}})};try{for(let v of x){let P=M7n(v.components[0],t),M=new Set(v.components.map((J)=>J.componentId)),B=v.components.flatMap((J)=>{if(!J.isStatic)return[];let ee=Lyn(J);return ee?[ee]:[]}),T=v.components.every((J)=>Boolean(t.pcb_component.get(J.componentId))&&!y[J.componentId]),N=f.components.filter((J)=>J.isStatic&&!M.has(J.componentId)),D=T?[]:N.flatMap((J)=>{let ee=Lyn(J);return ee?[ee]:[]}),L=new Set([...v.components.filter((J)=>J.isStatic),...T?[]:N].flatMap((J)=>J.pads.map((ee)=>ee.padId))),H=new Map([...C.components.map((J)=>[J.componentId,{component:J,courtyardSize:Number.EPSILON}]),...T?N.map((J)=>[J.componentId,{component:J,courtyardSize:0.000001}]):[]]),V=Array.from(H.values(),({component:J,courtyardSize:ee})=>({...J,componentId:`network_reference_${J.componentId}`,isStatic:!0,courtyard:{offsetFromCenter:{x:0,y:0},width:ee,height:ee}})),O=P?cai({components:Array.from(H.values(),({component:J})=>J),targetLayer:P,db:t}):[],U={...v,weightedConnections:v.weightedConnections?.filter((J)=>J.padIds.every((ee)=>!L.has(ee))),obstacles:[...v.obstacles??[],...B,...D,...O],components:[...V,...v.components.filter((J)=>!J.isStatic)]},j=new Ow(U),Y=j.getConstructorParams();e.root?.emit("solver:started",{type:"solver:started",solverName:"PackSolver2",solverParams:Y,solverConstructorArgs:[Y],componentName:e.getString()});let X=e.root?.platform?.pcbPackSolverTimeoutMs,{timedOut:K}=oai(j,X);if(K)b=!0,I(`PackSolver2 timed out after ${X}ms`);if(j.failed){b=!0;let J=j.error??j.activeSubSolver?.error??"No valid packing solution found";I(J)}if(C.components.push(...j.packedComponents.filter((J)=>M.has(J.componentId))),K)break}}catch(v){throw I(v instanceof Error?v.message:String(v)),v}if(kyn.enabled&&global?.debugGraphics){let v=zZe(C);v.title=`packOutput-${e.name}`,global.debugGraphics?.push(v)}if(iai(e,C,y,g),b)return;e.root?.emit("packing:end",{subcircuit_id:e.subcircuit_id,componentDisplayName:e.getString()})},hai=(e)=>{if(!e)return null;let t=e.match(/^pin(\d+)$/i)??e.match(/^(\d+)$/);if(!t)return null;let n=Number(t[1]);return Number.isFinite(n)&&n>0?n:null},w7n=(e)=>e.children.filter((t)=>t.componentName==="Port"),dai=(e)=>{let{db:t}=e.root,n=w7n(e);for(let i of n){if(i._parsedProps.pinNumber!==void 0)continue;let s=hai(i._parsedProps.name);if(s===null)continue;i._parsedProps.pinNumber=s}let o=new Set(n.map((i)=>i._parsedProps.pinNumber).filter((i)=>i!==void 0)),r=1;for(let i of n){if(i._parsedProps.pinNumber===void 0){while(o.has(r))r++;i._parsedProps.pinNumber=r,o.add(r)}if(i.source_port_id)t.source_port.update(i.source_port_id,{pin_number:i._parsedProps.pinNumber,port_hints:i.getNameAndAliases()})}},uai=(e)=>{let t={};for(let n of w7n(e)){let o=n._parsedProps.pinNumber,r=n._parsedProps.name;if(o===void 0||!r)continue;if(r===`pin${o}`||r===String(o))continue;t[`pin${o}`]=r}return t},pai=(e)=>{if(e.root?.schematicDisabled)return;let{db:t}=e.root,n=e._parsedProps;if(n.schPinSpacing!==void 0)t.source_property_ignored_warning.insert({source_component_id:e.source_group_id??"",property_name:"schPinSpacing",error_type:"source_property_ignored_warning",message:"schPinSpacing is deprecated and will be ignored. Pin spacing is always 0.2."});dai(e);let o=e._getSchematicBoxDimensions();if(!o)return;let r=e._getGlobalSchematicPositionBeforeLayout(),i=o.getSize(),s=e._getPinLabelsFromPorts(),a=e._getSchematicPortArrangement(),c=t.schematic_component.insert({center:r,size:i,source_group_id:e.source_group_id,schematic_group_id:e.schematic_group_id??void 0,subcircuit_id:e.subcircuit_id??e.getSubcircuit()?.subcircuit_id??void 0,is_schematic_group:!0,is_box_with_pins:!0,port_arrangement:Eit(a),pin_spacing:0.2,pin_styles:Pit(n.schPinStyle,s),port_labels:s,schematic_sheet_id:e._resolveSchematicSheetId()});if(e.schematic_component_id=c.schematic_component_id,e.schematic_group_id)t.schematic_group.update(e.schematic_group_id,{center:r,width:i.width,height:i.height,schematic_component_ids:[c.schematic_component_id]});let l=n.schTitle??n.name;if(l)t.schematic_text.insert({text:l,schematic_component_id:c.schematic_component_id,anchor:"left",rotation:0,position:{x:r.x-i.width/2,y:r.y+i.height/2+0.13},color:"#006464",font_size:0.18,schematic_sheet_id:e._resolveSchematicSheetId()})},Hyn=(e,t)=>{let{sourceComponent:n,sourceGroup:o}=t;if(t.nodeType==="component"){let r=e.schematic_component.getWhere({source_component_id:n?.source_component_id});if(!r?.size)return null;return{width:r.size.width,height:r.size.height}}if(t.nodeType==="group"){let r=e.schematic_group.getWhere({source_group_id:o?.source_group_id});if(r?.width&&r?.height)return{width:r.width,height:r.height};let i=e.schematic_component.list({schematic_group_id:r?.schematic_group_id}),s=1/0,a=-1/0,c=1/0,l=-1/0;for(let u of i)if(u.center&&u.size){let _=u.size.width/2,p=u.size.height/2;s=Math.min(s,u.center.x-_),a=Math.max(a,u.center.x+_),c=Math.min(c,u.center.y-p),l=Math.max(l,u.center.y+p)}let h=a-s,d=l-c;return{width:h,height:d}}return null},mai=(e)=>{let{db:t}=e.root,n=e._parsedProps,o=CM(t.toArray(),{source_group_id:e.source_group_id}),r=n.schJustifyContent??n.justifyContent,i=n.schAlignItems??n.alignItems,s=n.schFlexGap??n.schGap??n.gap,a=n.schFlexDirection??"row",c={start:"flex-start",end:"flex-end","flex-start":"flex-start","flex-end":"flex-end",stretch:"space-between","space-between":"space-between","space-around":"space-around","space-evenly":"space-evenly",center:"center"}[r??"space-between"],l={start:"flex-start",end:"flex-end","flex-start":"flex-start","flex-end":"flex-end",stretch:"stretch",center:"center"}[i??"center"];if(!c)throw Error(`Invalid justifyContent value: "${r}"`);if(!l)throw Error(`Invalid alignItems value: "${i}"`);let h=0,d=0;if(typeof s==="object")h=s.y??0,d=s.x??0;else if(typeof s==="number")h=s,d=s;else if(typeof s==="string")h=be.parse(s),d=be.parse(s);let u,_=n.width??n.schWidth??void 0,p=n.height??n.schHeight??void 0;if(Boolean(_===void 0||p===void 0))u=YAe(o.childNodes.map((x)=>Hyn(t,x)).filter((x)=>x!==null),{alignItems:l,justifyContent:c,direction:a,rowGap:h,columnGap:d}),_=u.width,p=u.height;let A=new q6e(_,p,{alignItems:l,justifyContent:c,direction:a,rowGap:h,columnGap:d});for(let x of o.childNodes){let C=Hyn(t,x);A.addChild({metadata:x,width:C?.width??0,height:C?.height??0,flexBasis:!C?void 0:a==="row"?C.width:C.height})}A.build();let g={minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0,width:0,height:0};for(let x of A.children)g.minX=Math.min(g.minX,x.position.x),g.minY=Math.min(g.minY,x.position.y),g.maxX=Math.max(g.maxX,x.position.x+x.size.width),g.maxY=Math.max(g.maxY,x.position.y+x.size.height);g.width=g.maxX-g.minX,g.height=g.maxY-g.minY;let f={x:-(g.maxX+g.minX)/2,y:-(g.maxY+g.minY)/2},y=t.toArray();for(let x of A.children){let{sourceComponent:C,sourceGroup:b}=x.metadata;if(C){let I=t.schematic_component.getWhere({source_component_id:C.source_component_id});if(!I)continue;gbt(y,I.schematic_component_id,{x:x.position.x+x.size.width/2+f.x,y:x.position.y+x.size.height/2+f.y})}if(b){if(!t.schematic_group.getWhere({source_group_id:b.source_group_id}))continue;ybt(y,b.source_group_id,{x:x.position.x+x.size.width/2+f.x,y:x.position.y+x.size.height/2+f.y})}}if(e.schematic_group_id)t.schematic_group.update(e.schematic_group_id,{width:g.width,height:g.height})};function fZ({db:e,schematicComponentId:t,deltaX:n,deltaY:o}){let r=e.schematic_rect.list({schematic_component_id:t});for(let l of r)l.center.x+=n,l.center.y+=o;let i=e.schematic_line.list({schematic_component_id:t});for(let l of i)l.x1+=n,l.y1+=o,l.x2+=n,l.y2+=o;let s=e.schematic_circle.list({schematic_component_id:t});for(let l of s)l.center.x+=n,l.center.y+=o;let a=e.schematic_arc.list({schematic_component_id:t});for(let l of a)l.center.x+=n,l.center.y+=o;let c=e.schematic_path.list({schematic_component_id:t});for(let l of c)for(let h of l.points)h.x+=n,h.y+=o}function _ai(e){let{db:t}=e.root,n=e._parsedProps,o=e.children.filter((C)=>{let b=C._parsedProps?.schX!==void 0||C._parsedProps?.schY!==void 0;return C.schematic_component_id&&!b});if(o.length===0)return;let r=0,i=0;for(let C of o){let b=t.schematic_component.get(C.schematic_component_id);if(b?.size)r=Math.max(r,b.size.width),i=Math.max(i,b.size.height)}if(r===0&&o.length>0)r=1;if(i===0&&o.length>0)i=1;let s=n.gridCols,a=void 0,{gridGap:c,gridRowGap:l,gridColumnGap:h}=n;if(n.schLayout?.grid)s=n.schLayout.grid.cols??s,a=n.schLayout.grid.rows,c=n.schLayout.gridGap??c,l=n.schLayout.gridRowGap??l,h=n.schLayout.gridColumnGap??h;let d,u;if(s!==void 0&&a!==void 0)d=s,u=a;else if(s!==void 0)d=s,u=Math.ceil(o.length/d);else if(a!==void 0)u=a,d=Math.ceil(o.length/u);else d=Math.ceil(Math.sqrt(o.length)),u=Math.ceil(o.length/d);if(d===0&&o.length>0)d=1;if(u===0&&o.length>0)u=o.length;let _,p,m=(C)=>{if(C===void 0)return;return typeof C==="number"?C:be.parse(C)};if(l!==void 0||h!==void 0){let C=typeof c==="object"&&c!==null?c.x:c,b=typeof c==="object"&&c!==null?c.y:c;_=m(h??C)??1,p=m(l??b)??1}else if(typeof c==="number")_=c,p=c;else if(typeof c==="string"){let C=be.parse(c);_=C,p=C}else if(typeof c==="object"&&c!==null){let C=c.x,b=c.y;_=typeof C==="number"?C:be.parse(C??"0mm"),p=typeof b==="number"?b:be.parse(b??"0mm")}else _=1,p=1;let A=d*r+Math.max(0,d-1)*_,g=u*i+Math.max(0,u-1)*p,f=e._getGlobalSchematicPositionBeforeLayout(),y=f.x-A/2+r/2,x=f.y+g/2-i/2;for(let C=0;C<o.length;C++){let b=o[C];if(!b.schematic_component_id)continue;let I=Math.floor(C/d),v=C%d;if(I>=u||v>=d){console.warn(`Schematic grid layout: Child ${b.getString()} at index ${C} (row ${I}, col ${v}) exceeds specified grid dimensions (${u}x${d}). Skipping placement.`);continue}let P=y+v*(r+_),M=x-I*(i+p),B=t.schematic_component.get(b.schematic_component_id);if(B){let T=B.center,N={x:P,y:M};t.schematic_component.update(b.schematic_component_id,{center:N});let D=N.x-T.x,L=N.y-T.y,H=t.schematic_port.list({schematic_component_id:b.schematic_component_id});for(let O of H)t.schematic_port.update(O.schematic_port_id,{center:{x:O.center.x+D,y:O.center.y+L}});let V=t.schematic_text.list({schematic_component_id:b.schematic_component_id});for(let O of V)t.schematic_text.update(O.schematic_text_id,{position:{x:O.position.x+D,y:O.position.y+L}});fZ({db:t,schematicComponentId:b.schematic_component_id,deltaX:D,deltaY:L})}}if(e.schematic_group_id)t.schematic_group.update(e.schematic_group_id,{width:A,height:g,center:f})}var Fyn=B7n.default("Group_doInitialSchematicLayoutMatchAdapt");function gai(e){let{db:t}=e.root,n=HX(t.toArray(),{source_group_id:e.source_group_id});if(n.filter((c)=>c.type==="source_component").length<=1)return;let r=Gdn(n);if(Fyn.enabled&&global?.debugGraphics)global.debugGraphics?.push(kQ(r,{title:`floatingBpcGraph-${e.name}`}));let i={boxes:r.boxes,pins:r.pins.map((c)=>({...c,color:c.color.replace("not_connected","normal")}))},{result:s}=eun([{variantName:"default",floatingGraph:r},{variantName:"noNotConnected",floatingGraph:i}],{singletonKeys:["vcc/2","gnd/2"],centerPinColors:["netlabel_center","component_center"],floatingBoxIdsWithMutablePinOffsets:new Set(r.boxes.filter((c)=>{if(r.pins.filter((d)=>d.boxId===c.boxId).filter((d)=>!d.color.includes("center")).length<=2)return!0;return!1}).map((c)=>c.boxId)),corpus:{}});if(Fyn.enabled&&global?.debugGraphics)global.debugGraphics?.push(kQ(s,{title:`laidOutBpcGraph-${e.name}`}));let a=e._getGlobalSchematicPositionBeforeLayout();for(let c of s.boxes){if(!c.center)continue;let l=t.schematic_component.get(c.boxId);if(l){let d={x:c.center.x+a.x,y:c.center.y+a.y},u=t.schematic_port.list({schematic_component_id:l.schematic_component_id}),_=t.schematic_text.list({schematic_component_id:l.schematic_component_id}),p={x:d.x-l.center.x,y:d.y-l.center.y};for(let m of u)m.center.x+=p.x,m.center.y+=p.y;for(let m of _)m.position.x+=p.x,m.position.y+=p.y;fZ({db:t,schematicComponentId:l.schematic_component_id,deltaX:p.x,deltaY:p.y}),l.center=d;continue}let h=t.schematic_net_label.get(c.boxId);if(h){let d=s.pins.find((_)=>_.boxId===c.boxId&&_.color==="netlabel_center");if(!d)throw Error(`No pin found for net label: ${c.boxId}`);let u={x:c.center.x+a.x,y:c.center.y+a.y};h.center=u,h.anchor_position={x:u.x+d.offset.x,y:u.y+d.offset.y};continue}console.error(`No schematic element found for box: ${c.boxId}. This is a bug in the matchAdapt binding with @tscircuit/core`)}}function D7n({text:e,fontSize:t}){let o=0.12*(t/0.18);return e.length*o}var Aai=0.18,fai=new Set(["simple_resistor","simple_capacitor","simple_inductor","simple_crystal","simple_resonator","simple_potentiometer","simple_fuse","simple_diode","simple_led","simple_transistor","simple_mosfet","simple_op_amp","simple_voltage_source","simple_test_point"]);function N7n({text:e,position:t,anchor:n,fontSize:o}){let r=D7n({text:e,fontSize:o}),i=o,s,a;if(n.includes("left"))s=0,a=r;else if(n.includes("right"))s=-r,a=0;else s=-r/2,a=r/2;let c,l;if(n.includes("top"))c=-i,l=0;else if(n.includes("bottom"))c=0,l=i;else c=-i/2,l=i/2;return{minX:t.x+s,maxX:t.x+a,minY:t.y+c,maxY:t.y+l}}function yai({schematicComponent:e,sourceComponent:t}){if(!e.symbol_name)return[];let n=Es[e.symbol_name];if(!n?.primitives||!n.center)return[];let o=[];for(let r of n.primitives){if(r.type!=="text")continue;let i;if(r.text==="{REF}")i=t?.display_name??t?.name??"";else if(r.text==="{VAL}")i=e.symbol_display_value??"";else i=r.text??"";if(!i)continue;o.push(N7n({text:i,position:{x:r.x-n.center.x+e.center.x,y:r.y-n.center.y+e.center.y},anchor:r.anchor??"center",fontSize:Aai}))}return o}function R7n(e){return td({center:e.center,width:e.size.width,height:e.size.height})}function xai(e,t){if(!t.center||!t.size)return null;let n=t.source_component_id?e.source_component.get(t.source_component_id):void 0;if(!n||!fai.has(n.ftype))return null;let o=yai({schematicComponent:t,sourceComponent:n});if(o.length===0)return null;let r=R7n(t),i={...r};for(let s of o)i.minX=Math.min(i.minX,s.minX),i.maxX=Math.max(i.maxX,s.maxX),i.minY=Math.min(i.minY,s.minY),i.maxY=Math.max(i.maxY,s.maxY);if(i.minX===r.minX&&i.maxX===r.maxX&&i.minY===r.minY&&i.maxY===r.maxY)return null;return i}function Cai(e,t){let n=e.size;if(n)n=iot(n,t);return{...e,symbol_name:yit(e.symbol_name,t),size:n}}function V7e({db:e,schematicComponent:t,ccwRotationDegrees:n=0}){let o=Cai(t,n),r=xai(e,o);if(!r)return null;let i=R7n(o);if(o.size.height>o.size.width)return r;let a=Math.max(0,i.minX-r.minX),c=Math.max(0,r.maxX-i.maxX),l=Math.max(0,r.maxY-i.maxY),h=Math.max(0,i.minY-r.minY),d=a,u=c;if(a>0&&c>0)d=Math.max(a,c),u=d;let _=l,p=h;if(l>0&&h>0)_=Math.max(l,h),p=_;return{minX:i.minX-d,maxX:i.maxX+u,minY:i.minY-p,maxY:i.maxY+_}}var as=T7n.default("Group_doInitialSchematicLayoutMatchpack"),zyn=[0,90,180,270],bai={"y+":0,"x+":90,"y-":180,"x-":270};function qrt(e){switch(e){case"up":return"y+";case"down":return"y-";case"left":return"x-";case"right":return"x+";default:return"y+"}}function Iai(e,t){if(t.length!==2)return null;let n=new Set;for(let o of t){let i=e.source_port.get(o.source_port_id)?.subcircuit_connectivity_map_key;if(!i)continue;let s=e.source_net.getWhere({subcircuit_connectivity_map_key:i});if(!s)continue;let a=s.is_ground??!1,c=s.is_power===!0||s.is_positive_voltage_source===!0;if(c===a)continue;let l=bai[qrt(o.facing_direction)],h=c?l:(l+180)%360;n.add(h)}return n.size===1?n.values().next().value:null}function Oyn({db:e,schematicComponent:t,component:n,ccwRotationDegrees:o}){let r=t.size;if(r)r=iot(r,o);let i=V7e({db:e,schematicComponent:t,ccwRotationDegrees:o}),s=0,a=0,c=0,l=0;if(i&&t.center){let A=(r?.width??0)/2,g=(r?.height??0)/2;s=t.center.x-A-i.minX,a=i.maxX-(t.center.x+A),c=i.maxY-(t.center.y+g),l=t.center.y-g-i.minY}let h=(n?._parsedProps?.schMarginLeft??n?._parsedProps?.schMarginX??0)+s,d=(n?._parsedProps?.schMarginRight??n?._parsedProps?.schMarginX??0)+a,u=(n?._parsedProps?.schMarginTop??n?._parsedProps?.schMarginY??0)+c,_=(n?._parsedProps?.schMarginBottom??n?._parsedProps?.schMarginY??0)+l;if(n?.config.shouldRenderAsSchematicBox)u+=0.4,_+=0.4;let p={width:(r?.width||1)+h+d,height:(r?.height||1)+u+_},m=iot(p,o);return{x:m.width,y:m.height}}function vai({db:e,schematicComponent:t,component:n,ccwRotationDegrees:o,chipGap:r}){let i=Oyn({db:e,schematicComponent:t,component:n,ccwRotationDegrees:0});if(!xit(o))return i;let s=Oyn({db:e,schematicComponent:t,component:n,ccwRotationDegrees:o});return s.x-i.x>=r||s.y-i.y>=r?s:i}function Sai({db:e,schematicGroup:t,groupComponents:n,groupInstance:o}){let r=1/0,i=-1/0,s=1/0,a=-1/0,c=!1;for(let p of n){if(!p.center||!p.size)continue;c=!0;let m=V7e({db:e,schematicComponent:p})??td({center:p.center,width:p.size.width,height:p.size.height});r=Math.min(r,m.minX),i=Math.max(i,m.maxX),s=Math.min(s,m.minY),a=Math.max(a,m.maxY)}let l=o?._parsedProps?.schMarginLeft??o?._parsedProps?.schMarginX??0,h=o?._parsedProps?.schMarginRight??o?._parsedProps?.schMarginX??0,d=o?._parsedProps?.schMarginTop??o?._parsedProps?.schMarginY??0,u=o?._parsedProps?.schMarginBottom??o?._parsedProps?.schMarginY??0,_=c?{x:(r+i)/2,y:(s+a)/2}:t.center??{x:0,y:0};return{center:{x:_.x+(h-l)/2,y:_.y+(d-u)/2},size:{x:(c?i-r:2)+l+h,y:(c?a-s:2)+d+u}}}function Pai(e,t){if(e.nodeType==="component"&&e.sourceComponent){let n=t.children.find((o)=>o.source_component_id===e.sourceComponent?.source_component_id);return n?._parsedProps?.schX!==void 0||n?._parsedProps?.schY!==void 0}if(e.nodeType==="group"&&e.sourceGroup){let n=t.children.find((o)=>o.source_group_id===e.sourceGroup?.source_group_id);return n?._parsedProps?.schX!==void 0||n?._parsedProps?.schY!==void 0}return!1}function OJ(e,t){if(e.nodeType==="component"&&e.sourceComponent)return e.sourceComponent.name||`chip_${t}`;if(e.nodeType==="group"&&e.sourceGroup)return e.sourceGroup.name||`group_${t}`;return null}var Q7n=({db:e,sourceComponentId:t,schematicSheetId:n})=>e.schematic_component.getWhere({source_component_id:t,...n?{schematic_sheet_id:n}:{}});function Eai(e,t,n,o={}){let r={chipMap:{},chipPinMap:{},netMap:{},pinStrongConnMap:{},netConnMap:{},chipGap:0.6,decouplingCapsGap:0.4,partitionGap:1.2},i={},s=n._getGlobalSchematicPositionBeforeLayout();as(`[${n.name}] Processing ${e.childNodes.length} child nodes for input problem`),e.childNodes.forEach((c,l)=>{let h=Pai(c,n);if(h)as(`[${n.name}] Child ${l} explicitly positioned, including as fixed chip`);else as(`[${n.name}] Processing child ${l}: nodeType=${c.nodeType}`);if(c.nodeType==="component")as(`[${n.name}] - Component: ${c.sourceComponent?.name}`);else if(c.nodeType==="group")as(`[${n.name}] - Group: ${c.sourceGroup?.name}`);if(c.nodeType==="component"&&c.sourceComponent){let d=OJ(c,l),u=Q7n({db:t,sourceComponentId:c.sourceComponent.source_component_id,schematicSheetId:o.schematicSheetId});if(!u)return;let _=n.children.find((g)=>g.source_component_id===c.sourceComponent?.source_component_id),p=t.schematic_port.list({schematic_component_id:u.schematic_component_id}),m=[...zyn];if(_?._parsedProps?.schOrientation)m=[0];if(_?._parsedProps?.schRotation!==void 0)m=[0];if(_?._parsedProps?.facingDirection)m=[0];if(_?._parsedProps?.schFacingDirection)m=[0];if(_?.componentName==="Chip")m=[0];if(m.length===zyn.length){let g=Iai(t,p);if(g!==null)m=[g]}let A=m.length===1?m[0]:0;r.chipMap[d]={chipId:d,pins:[],size:vai({db:t,schematicComponent:u,component:_,ccwRotationDegrees:A,chipGap:r.chipGap}),isCapacitor:c.sourceComponent.ftype==="simple_capacitor",isCrystal:c.sourceComponent.ftype==="simple_crystal",isResistor:c.sourceComponent.ftype==="simple_resistor",isTestPoint:c.sourceComponent.ftype==="simple_test_point",availableRotations:m,...h&&{fixedPosition:{x:u.center.x-s.x,y:u.center.y-s.y}}};for(let g of p){let f=t.source_port.get(g.source_port_id);if(!f)continue;let y=`${d}.${f.pin_number||f.name||g.schematic_port_id}`;r.chipMap[d].pins.push(y);let x=qrt(g.facing_direction);r.chipPinMap[y]={pinId:y,offset:{x:(g.center?.x||0)-(u.center.x||0),y:(g.center?.y||0)-(u.center.y||0)},side:x}}}else if(c.nodeType==="group"&&c.sourceGroup){let d=OJ(c,l);as(`[${n.name}] Processing nested group: ${d}`);let u=t.schematic_group?.getWhere?.({source_group_id:c.sourceGroup.source_group_id}),_=n.children.find((p)=>p.source_group_id===c.sourceGroup?.source_group_id);if(as(`[${n.name}] Found schematic_group for ${d}:`,u),u){as(`[${n.name}] Treating group ${d} as composite chip`);let p=t.schematic_component.list({schematic_group_id:u.schematic_group_id});as(`[${n.name}] Group ${d} has ${p.length} components:`,p.map((g)=>g.source_component_id));let m=Sai({db:t,schematicGroup:u,groupComponents:p,groupInstance:_});i[d]=m,as(`[${n.name}] Group ${d} computed proxy: ${m.size.x} x ${m.size.y} centered at (${m.center.x}, ${m.center.y})`);let A=[];for(let g of p){let f=t.schematic_port.list({schematic_component_id:g.schematic_component_id});for(let y of f){let x=t.source_port.get(y.source_port_id);if(!x)continue;let C=`${d}.${x.pin_number||x.name||y.schematic_port_id}`;A.push(C);let b=qrt(y.facing_direction);r.chipPinMap[C]={pinId:C,offset:{x:(y.center?.x||0)-m.center.x,y:(y.center?.y||0)-m.center.y},side:b}}}as(`[${n.name}] Group ${d} has ${A.length} pins:`,A),r.chipMap[d]={chipId:d,pins:A,size:m.size},as(`[${n.name}] Added group ${d} to chipMap`)}else as(`[${n.name}] Warning: No schematic_group found for group ${d}`)}}),as(`[${n.name}] Creating connections using connectivity keys`);let a=new Map;for(let[c,l]of Object.entries(r.chipMap))for(let h of l.pins){let d=h.split(".").pop(),u=e.childNodes.find((_)=>OJ(_,e.childNodes.indexOf(_))===c);if(u?.nodeType==="group"&&u.sourceGroup){let _=t.schematic_group?.getWhere?.({source_group_id:u.sourceGroup.source_group_id});if(_){let p=t.schematic_component.list({schematic_group_id:_.schematic_group_id});for(let m of p){let A=t.source_port.list({source_component_id:m.source_component_id});for(let g of A){let f=g.pin_number||g.name;if(String(f)===String(d))if(g.subcircuit_connectivity_map_key){let y=g.subcircuit_connectivity_map_key;if(!a.has(y))a.set(y,[]);a.get(y).push(h),as(`[${n.name}] ✓ Pin ${h} has connectivity key: ${y}`)}else as(`[${n.name}] Pin ${h} has no connectivity key`)}}}}else if(u?.nodeType==="component"&&u.sourceComponent){let _=t.source_port.list({source_component_id:u.sourceComponent.source_component_id});for(let p of _){let m=p.pin_number||p.name;if(String(m)===String(d)&&p.subcircuit_connectivity_map_key){let A=p.subcircuit_connectivity_map_key;if(!a.has(A))a.set(A,[]);a.get(A).push(h),as(`[${n.name}] Pin ${h} has connectivity key: ${A}`)}}}}as(`[${n.name}] Found ${a.size} connectivity groups:`,Array.from(a.entries()).map(([c,l])=>({key:c,pins:l})));for(let[c,l]of a){let h=t.source_trace.list().filter((_)=>_.subcircuit_connectivity_map_key===c),d=h.some((_)=>_.connected_source_net_ids&&_.connected_source_net_ids.length>0),u=h.some((_)=>_.connected_source_port_ids&&_.connected_source_port_ids.length>=2);if(as(`[${n.name}] Connectivity ${c}: hasNetConnections=${d}, hasDirectConnections=${u}`),l.length>=2){if(u){for(let _ of h)if(_.connected_source_port_ids&&_.connected_source_port_ids.length>=2){let p=[];for(let m of _.connected_source_port_ids)for(let A of l){let g=A.split(".").pop(),f=t.source_port.get(m);if(f&&String(f.pin_number||f.name)===String(g)){let y=A.split(".")[0],x=e.childNodes.find((C)=>OJ(C,e.childNodes.indexOf(C))===y);if(x?.nodeType==="component"&&x.sourceComponent){if(t.source_port.list({source_component_id:x.sourceComponent.source_component_id}).some((b)=>b.source_port_id===m))p.push(A)}}}for(let m=0;m<p.length;m++)for(let A=m+1;A<p.length;A++){let g=p[m],f=p[A];r.pinStrongConnMap[`${g}-${f}`]=!0,r.pinStrongConnMap[`${f}-${g}`]=!0,as(`[${n.name}] Created strong connection: ${g} <-> ${f}`)}}}}if(d){let _=t.source_net.getWhere({subcircuit_connectivity_map_key:c}),p=_?.is_ground??!1,m=_?.is_power===!0||_?.is_positive_voltage_source===!0;r.netMap[c]={netId:c,isGround:p,isPositiveVoltageSource:m};for(let A of l)r.netConnMap[`${A}-${c}`]=!0;as(`[${n.name}] Created net ${c} with ${l.length} pins:`,l)}}return{inputProblem:r,nestedGroupMatchpackProxyMap:i}}function k7n(e,t,n={}){let{db:o}=e.root;if(as(`[${e.name}] Starting matchpack layout with ${t.childNodes.length} children`),as(`[${e.name}] Tree structure:`,JSON.stringify(t,null,2)),t.childNodes.length<=1){as(`[${e.name}] Only ${t.childNodes.length} children, skipping layout`);return}as("Converting circuit tree to InputProblem...");let{inputProblem:r,nestedGroupMatchpackProxyMap:i}=Eai(t,o,e,n);if(as.enabled)e.root?.emit("debug:logOutput",{type:"debug:logOutput",name:`matchpack-input-problem-${e.name}`,content:JSON.stringify(r,null,2)});let s=new $6e(r);if(e.root?.emit("solver:started",{type:"solver:started",solverName:"LayoutPipelineSolver",solverParams:r,solverConstructorArgs:[r],componentName:e.getString()}),as("Starting LayoutPipelineSolver..."),as.enabled&&global?.debugGraphics){let h=s.visualize();global.debugGraphics.push({...h,title:`matchpack-initial-${e.name}`})}if(s.solve(),e.root?.emit("solver:ended",{type:"solver:ended",solverName:"LayoutPipelineSolver",componentName:e.getString(),solved:s.solved,failed:s.failed,iterations:s.iterations,error:s.error}),as(`Solver completed in ${s.iterations} iterations`),as(`Solved: ${s.solved}, Failed: ${s.failed}`),s.failed){let h=s.error??"Unknown Matchpack failure";as(`Solver failed with error: ${h}`),o.schematic_layout_error.insert({error_type:"schematic_layout_error",message:`Matchpack layout solver failed: ${h}`,is_fatal:!1,source_group_id:e.source_group_id,schematic_group_id:e.schematic_group_id,subcircuit_id:e.subcircuit_id??void 0});return}let a=s.getOutputLayout();if(as("OutputLayout:",JSON.stringify(a,null,2)),as("Solver completed successfully:",!s.failed),as.enabled&&global?.debugGraphics){let h=s.visualize();global.debugGraphics.push({...h,title:`matchpack-final-${e.name}`})}let c=s.checkForOverlaps(a);if(c.length>0){as(`Warning: Found ${c.length} overlapping components:`);for(let h of c)as(`  ${h.chip1} overlaps ${h.chip2} (area: ${h.overlapArea})`)}let l=e._getGlobalSchematicPositionBeforeLayout();as(`Group offset: x=${l.x}, y=${l.y}`),as(`Applying layout results for ${Object.keys(a.chipPlacements).length} chip placements`);for(let[h,d]of Object.entries(a.chipPlacements)){as(`Processing placement for chip: ${h} at (${d.x}, ${d.y})`);let u=t.childNodes.find((p)=>{let m=OJ(p,t.childNodes.indexOf(p)),A=m===h;return as(`  Checking child ${m}: matches=${A}`),A});if(!u){as(`Warning: No tree node found for chip: ${h}`),as("Available tree nodes:",t.childNodes.map((p,m)=>({type:p.nodeType,name:p.nodeType==="component"?p.sourceComponent?.name:p.sourceGroup?.name,expectedChipId:OJ(p,m)})));continue}let _={x:d.x+l.x,y:d.y+l.y};if(u.nodeType==="component"&&u.sourceComponent){let p=e.children.find((A)=>A.source_component_id===u.sourceComponent?.source_component_id);if(p?._parsedProps?.schX!==void 0||p?._parsedProps?.schY!==void 0){as(`Skipping position update for fixed chip ${h}`);continue}let m=Q7n({db:o,sourceComponentId:u.sourceComponent.source_component_id,schematicSheetId:n.schematicSheetId});if(m){as(`Moving component ${h} to (${_.x}, ${_.y})`);let A=o.schematic_port.list({schematic_component_id:m.schematic_component_id}),g=o.schematic_text.list({schematic_component_id:m.schematic_component_id}),f={x:_.x-m.center.x,y:_.y-m.center.y};for(let y of A)y.center.x+=f.x,y.center.y+=f.y;for(let y of g)y.position.x+=f.x,y.position.y+=f.y;if(fZ({db:o,schematicComponentId:m.schematic_component_id,deltaX:f.x,deltaY:f.y}),m.center=_,d.ccwRotationDegrees!==0){as(`Component ${h} has rotation: ${d.ccwRotationDegrees}°`);let y=(Math.round(d.ccwRotationDegrees)%360+360)%360;if((y===90||y===270)&&m.size){let I=m.size.width;m.size.width=m.size.height,m.size.height=I}let x=d.ccwRotationDegrees*Math.PI/180,C=Math.cos(x),b=Math.sin(x);for(let I of A){let v=I.center.x-_.x,P=I.center.y-_.y,M=v*C-P*b,B=v*b+P*C;I.center.x=_.x+M,I.center.y=_.y+B;let T=I.facing_direction||"right";I.facing_direction=fit(T,d.ccwRotationDegrees),I.side_of_component=(I.facing_direction==="up"?"top":I.facing_direction==="down"?"bottom":I.facing_direction)||I.side_of_component}for(let I of g){let v=I.position.x-_.x,P=I.position.y-_.y,M=v*C-P*b,B=v*b+P*C;I.position.x=_.x+M,I.position.y=_.y+B}if(m.symbol_name)m.symbol_name=yit(m.symbol_name,d.ccwRotationDegrees)}}}else if(u.nodeType==="group"&&u.sourceGroup){let p=o.schematic_group?.getWhere?.({source_group_id:u.sourceGroup.source_group_id});if(p){as(`Moving group ${h} to (${_.x}, ${_.y}) from (${p.center?.x}, ${p.center?.y})`);let m=o.schematic_component.list({schematic_group_id:p.schematic_group_id});as(`Group ${h} has ${m.length} components to move`);let A=i[h],g=A?.center??p.center??{x:0,y:0},f={x:_.x-g.x,y:_.y-g.y};as(`Position delta for group ${h}: (${f.x}, ${f.y})`);for(let y of m)if(y.center){let x={...y.center};y.center.x+=f.x,y.center.y+=f.y,as(`Moved component ${y.source_component_id} from (${x.x}, ${x.y}) to (${y.center.x}, ${y.center.y})`);let C=o.schematic_port.list({schematic_component_id:y.schematic_component_id}),b=o.schematic_text.list({schematic_component_id:y.schematic_component_id});for(let I of C)if(I.center)I.center.x+=f.x,I.center.y+=f.y;for(let I of b)if(I.position)I.position.x+=f.x,I.position.y+=f.y;fZ({db:o,schematicComponentId:y.schematic_component_id,deltaX:f.x,deltaY:f.y})}if(p.center=_,A)p.width=A.size.x,p.height=A.size.y;as(`Updated group ${h} center to (${_.x}, ${_.y})`)}}}as("Matchpack layout completed successfully")}function Mai({circuitJson:e,schematicSheetIdsBySourceComponentId:t}){let n=new Map;for(let r of e)if(r.type==="source_group")n.set(r.source_group_id,r.parent_source_group_id);let o=new Map;for(let r of e){if(r.type!=="source_component")continue;if(!r.source_group_id)continue;let i=t.get(r.source_component_id);if(i===void 0)continue;for(let s of i){let a=r.source_group_id,c=new Set;while(a&&!c.has(a)){c.add(a);let l=o.get(a)??new Set;l.add(s),o.set(a,l),a=n.get(a)}}}return o}function wai({circuitJson:e,schematicSheetId:t,rootSourceGroupId:n,schematicSheetIdsBySourceComponentId:o,schematicSheetIdsBySourceGroupId:r}){let i=(s)=>s===n||r.get(s)?.has(t)===!0;return e.filter((s)=>{if(s.type==="source_group")return i(s.source_group_id);if(s.type==="source_component"){if(o.get(s.source_component_id)?.has(t)!==!0)return!1;return s.source_group_id?i(s.source_group_id):!0}return!0})}function Bai(e,t){let{source_group_id:n}=t,o=new Map;for(let s of e){if(s.type!=="schematic_component")continue;if(!s.source_component_id)continue;if(!s.schematic_sheet_id)continue;let a=o.get(s.source_component_id)??new Set;a.add(s.schematic_sheet_id),o.set(s.source_component_id,a)}let r=new Set;for(let s of o.values())for(let a of s)r.add(a);if(r.size<=1)return[{tree:CM(e,{source_group_id:n}),schematicSheetId:r.values().next().value}];let i=Mai({circuitJson:e,schematicSheetIdsBySourceComponentId:o});return Array.from(r).map((s)=>({tree:CM(wai({circuitJson:e,schematicSheetId:s,rootSourceGroupId:n,schematicSheetIdsBySourceComponentId:o,schematicSheetIdsBySourceGroupId:i}),{source_group_id:n}),schematicSheetId:s}))}function Tai(e){let{db:t}=e.root,n=Bai(t.toArray(),{source_group_id:e.source_group_id});for(let{tree:o,schematicSheetId:r}of n)k7n(e,o,{schematicSheetId:r})}var Fnt=1,_ve=1.5;function Dai({sectionBlocks:e,groupSchPositionBeforeLayout:t}){let n=e.reduce((l,h)=>{let d=Math.max(h.size.x,0.5)+_ve*2,u=Math.max(h.size.y,0.5)+_ve*2;return l+d*u},0),o=Math.sqrt(n)*2,r=[],i=[],s=0;for(let l of e){let h=Math.max(l.size.x,0.5)+_ve*2,d=Math.max(l.size.y,0.5)+_ve*2,u=s>0?s+Fnt+h:h;if(i.length>0&&u>o)r.push(i),i=[],s=0;let _=s>0?s+Fnt:0;i.push({sectionName:l.sectionName,rowOffset:_,width:h,height:d}),s=_+h}if(i.length>0)r.push(i);let a=new Map,c=0;for(let l of r){let h=Math.max(...l.map((_)=>_.height)),u=-(l[l.length-1].rowOffset+l[l.length-1].width)/2;for(let _ of l)a.set(_.sectionName,{x:u+_.rowOffset+_.width/2+t.x,y:c-h/2+t.y});c-=h+Fnt}return a}var Nai=L7n.default("Group_doInitialSchematicLayoutSections");function Rai(e){let{db:t}=e.root,n=new Set,o=!1;for(let l of e.children){if(!l.source_component_id)continue;let h=l.getSchematicSectionName();if(h!==null)n.add(h);else o=!0}let r=Array.from(n);if(o)r.push(null);if(r.length===0)return;for(let l of r){let h=CM(t.toArray(),{source_group_id:e.source_group_id});h.childNodes=h.childNodes.filter((d)=>{if(d.nodeType!=="component"||!d.sourceComponent)return!1;return(e.children.find((p)=>p.source_component_id===d.sourceComponent?.source_component_id)?.getSchematicSectionName()??null)===l}),k7n(e,h)}if(r.length<=1)return;let i=new Map;for(let l of r){let h=1/0,d=-1/0,u=1/0,_=-1/0,p=new Set;for(let m of e.children){let A=m.source_component_id;if(!A)continue;if(m.getSchematicSectionName()!==l)continue;let f=t.schematic_component.getWhere({source_component_id:A});if(!f)continue;p.add(A);let y=f.size.width/2,x=f.size.height/2;h=Math.min(h,f.center.x-y),d=Math.max(d,f.center.x+y),u=Math.min(u,f.center.y-x),_=Math.max(_,f.center.y+x)}if(!Number.isFinite(h)||p.size===0)continue;i.set(l,{sectionName:l,center:{x:(h+d)/2,y:(u+_)/2},size:{x:d-h,y:_-u},sourceCompIds:p})}if(i.size<=1)return;let s=new Set;for(let l of e.children){if(!l.source_component_id)continue;let h=l._parsedProps;if(h?.schX!==void 0||h?.schY!==void 0)s.add(l.getSchematicSectionName())}let a=e._getGlobalSchematicPositionBeforeLayout(),c=Dai({sectionBlocks:Array.from(i.values()).map((l)=>({sectionName:l.sectionName,size:l.size})),groupSchPositionBeforeLayout:a});for(let[l,h]of c){let d=i.get(l);if(!d)continue;if(s.has(l)){Nai(`[${e.name}] Section "${l}" anchored by manual position, skipping shift`);continue}let u={x:h.x-d.center.x,y:h.y-d.center.y};for(let _ of d.sourceCompIds){let p=t.schematic_component.getWhere({source_component_id:_});if(!p)continue;let m=t.schematic_port.list({schematic_component_id:p.schematic_component_id}),A=t.schematic_text.list({schematic_component_id:p.schematic_component_id});for(let g of m)g.center.x+=u.x,g.center.y+=u.y;for(let g of A)g.position.x+=u.x,g.position.y+=u.y;fZ({db:t,schematicComponentId:p.schematic_component_id,deltaX:u.x,deltaY:u.y}),p.center={x:p.center.x+u.x,y:p.center.y+u.y}}}}var Qai=({db:e,schematicDisabled:t})=>{let n=e.schematic_missing_sheet_warning.list()[0],o=e.schematic_component.list().length>0;if(!(!t&&o&&e.schematic_sheet.list().length===0)){if(n)e.schematic_missing_sheet_warning.delete(n.schematic_missing_sheet_warning_id);return}if(n)return;e.schematic_missing_sheet_warning.insert({warning_type:"schematic_missing_sheet_warning",message:"No <schematicsheet> was found. Add a <schematicsheet> to define the schematic drawing area."})},H7n=(e)=>{let t=e.root;if(!t?.isRootCircuit)return;let n=t.firstChild===e,o=s8e(t.firstChild)&&e.parent===t.firstChild;if(!n&&!o)return;Qai({db:t.db,schematicDisabled:t.schematicDisabled})},kai=(e)=>{H7n(e)},Lai=class extends nr{source_net_label_id;schematic_net_label_id;get config(){return{componentName:"NetLabel",zodProps:pDt}}_getAnchorSide(){let{_parsedProps:e}=this;if(e.anchorSide)return e.anchorSide;if(!this._resolveConnectsTo())return"right";let n=this.getSubcircuit().selectOne(`net.${this._getNetName()}`),o;if(n?.source_net_id)o=this.root?.db.source_net.get(n.source_net_id);if(o?.is_ground)return"top";if(o?.is_power)return"bottom";let r=this._getGlobalSchematicPositionBeforeLayout(),i=this._getConnectedPorts();if(i.length===0)return"right";let s=i[0];if(s.facingDirection)return jJ(s.facingDirection);let a=s._getGlobalSchematicPositionBeforeLayout(),c=a.x-r.x,l=a.y-r.y;if(Math.abs(c)>Math.abs(l)){if(c>0)return"right";if(c<0)return"left"}else{if(l>0)return"top";if(l<0)return"bottom"}return"right"}_getConnectedPorts(){let e=this._resolveConnectsTo();if(!e)return[];let t=[];for(let n of e){let o=this.getSubcircuit().selectOne(n);if(o)t.push(o)}return t}computeSchematicPropsTransform(){let{_parsedProps:e}=this;if(e.schX===void 0&&e.schY===void 0){let t=this._getConnectedPorts();if(t.length>0){let n=t[0]._getGlobalSchematicPositionBeforeLayout(),o=QZ.applyToPoint(this.parent?.computeSchematicGlobalTransform?.()??QZ.identity(),{x:0,y:0});return QZ.translate(n.x-o.x,n.y-o.y)}}return super.computeSchematicPropsTransform()}doInitialSchematicPrimitiveRender(){if(this.root?.schematicDisabled)return;if(this.getCollapsedSchematicBoxAncestor())return;let{db:e}=this.root,{_parsedProps:t}=this;if(t.inline&&this.root?._featureMspSchematicTraceRouting&&this._getConnectedPorts().length>0)return;let n=this._getGlobalSchematicPositionBeforeLayout(),o=this.getSubcircuit().selectOne(`net.${this._getNetName()}`),r=this._getAnchorSide(),i=FS({anchor_position:n,anchor_side:r,text:t.net}),s=e.schematic_net_label.insert({text:t.net,source_net_id:o.source_net_id,anchor_position:n,center:i,anchor_side:r,schematic_sheet_id:this._resolveSchematicSheetId()});this.source_net_label_id=s.source_net_id,this.schematic_net_label_id=s.schematic_net_label_id}_resolveConnectsTo(){let{_parsedProps:e}=this,t=e.connectsTo??e.connection;if(Array.isArray(t))return t;if(typeof t==="string")return[t];return}_getNetName(){let{_parsedProps:e}=this;return e.net}doInitialCreateNetsFromProps(){let{_parsedProps:e}=this;if(e.net)Cue(this,[`net.${e.net}`])}doInitialCreateTracesFromNetLabels(){let e=this._resolveConnectsTo();if(!e)return;for(let t of e)this.add(new d_({from:t,to:`net.${this._getNetName()}`}))}doInitialSchematicTraceRender(){if(!this.root?._featureMspSchematicTraceRouting)return;if(this.root?.schematicDisabled)return;if(this.getCollapsedSchematicBoxAncestor())return;if(this._parsedProps.inline)return;let{schX:e,schY:t}=this._parsedProps;if(e===void 0&&t===void 0)return;let{db:n}=this.root,o=this._resolveConnectsTo();if(!o||o.length===0)return;let r=this._getGlobalSchematicPositionBeforeLayout(),i=this._getAnchorSide(),a={left:"x-",right:"x+",top:"y+",bottom:"y-"}[i],c=this.getSubcircuit().selectOne(`net.${this._getNetName()}`);for(let l of o){let h=this.getSubcircuit().selectOne(l,{type:"port"});if(!h||!h.schematic_port_id)continue;let d=!1;if(c?.source_net_id){let f=n.source_trace.list().find((y)=>y.connected_source_net_ids?.includes(c.source_net_id)&&y.connected_source_port_ids?.includes(h.source_port_id??""));if(f)d=n.schematic_trace.list().some((y)=>y.source_trace_id===f.source_trace_id);if(d)continue}let u=h._getGlobalSchematicPositionAfterLayout(),_=o8e(h.facingDirection??"right")??"x+",p=oz({x:u.x,y:u.y,facingDirection:_},{x:r.x,y:r.y,facingDirection:a});if(!Array.isArray(p)||p.length<2)continue;let m=[];for(let f=0;f<p.length-1;f++)m.push({from:{x:p[f].x,y:p[f].y},to:{x:p[f+1].x,y:p[f+1].y}});let A,g;if(c?.source_net_id&&h.source_port_id){let f=n.source_trace.list().find((y)=>y.connected_source_net_ids?.includes(c.source_net_id)&&y.connected_source_port_ids?.includes(h.source_port_id));A=f?.source_trace_id,g=f?.subcircuit_connectivity_map_key||n.source_net.get(c.source_net_id)?.subcircuit_connectivity_map_key}n.schematic_trace.insert({source_trace_id:A,edges:m,junctions:[],subcircuit_connectivity_map_key:g,schematic_sheet_id:this._resolveSchematicSheetId()}),n.schematic_port.update(h.schematic_port_id,{is_connected:!0})}}},Bat=(e)=>{let t=[...new Set(e.flatMap((s)=>s._getDirectlyConnectedTraces()))],n=t.find((s)=>s._parsedProps.schDisplayLabel)?._parsedProps.schDisplayLabel??t.find((s)=>s._parsedProps.displayName)?._parsedProps.displayName??t.find((s)=>s._parsedProps.name)?._parsedProps.name;if(n)return{name:n,wasAssignedDisplayLabel:!0};let o=e.find((s)=>s.root)?.root?.db,r=e.map((s)=>s.source_port_id).filter((s)=>Boolean(s));return{name:(o?vit(o,r):e.map((s)=>s._getNetLabelText()).filter((s)=>Boolean(s)).sort((s,a)=>s.localeCompare(a,void 0,{numeric:!0,sensitivity:"base"}))[0])??"",wasAssignedDisplayLabel:!1}},Vyn=(e,t,n)=>{let o=e.get(t);if(o)o.push(n);else e.set(t,[n])},Tat=(e)=>{let{db:t}=e.root,n=new Map,o=new Map,r=new Map,i=new Map;for(let s of t.source_net.list())if(s.subcircuit_connectivity_map_key)n.set(s.subcircuit_connectivity_map_key,s);for(let s of e.selectAll("port")){let a=s._getSubcircuitConnectivityKey();if(a)Vyn(o,a,s)}for(let s of t.source_port.list())if(s.subcircuit_connectivity_map_key)Vyn(r,s.subcircuit_connectivity_map_key,s.source_port_id);return({subcircuitConnectivityMapKey:s})=>{let a=i.get(s);if(a)return a;let c=n.get(s);if(c?.name){let d={name:c.name,wasAssignedDisplayLabel:!0};return i.set(s,d),d}let l=Bat(o.get(s)??[]);if(l.name)return i.set(s,l),l;let h={name:vit(t,r.get(s)??[])??"",wasAssignedDisplayLabel:!1};return i.set(s,h),h}},K0=(e)=>e,TJ=(e)=>e,Hai=z7n.default("Group_doInitialSchematicTraceRender"),Fai="rgb(132, 0, 0)",zai=-90;function Oai(e){let{group:t,solver:n,userNetIdToConnKey:o,sourceTraceIdByPinPairKey:r,crossScopeSourceTraceIdBySchematicPortIdAndNetId:i}=e,{db:s}=t.root,a=n.inlineNetLabelSolver?.getOutput().inlineNetLabelPlacements??[];if(a.length===0)return;let c=Tat(t),l=n.mspConnectionPairSolver.globalConnMap;for(let h of a){let d=h.pinIds.map(K0),u=l.getIdsConnectedToNet(h.globalConnNetId).find((P)=>o.has(P)),_=d.length===1?i.get(d[0])?.get(h.netId??h.globalConnNetId):void 0,p=(_?s.source_trace.get(_)?.subcircuit_connectivity_map_key:void 0)??(u?o.get(u):void 0),m=h.netLabelText??(p?c({subcircuitConnectivityMapKey:p}).name:h.netId??h.globalConnNetId);if(!m){Hai(`skipping inline net label for "${h.netId}" REASON:no resolvable text`);continue}let A=_??r.get([...d].sort().join("::"));if(!A&&p){let P=d.flatMap((M)=>{let B=s.schematic_port.get(M)?.source_port_id;return B?[B]:[]});A=s.source_trace.list().find((M)=>M.subcircuit_connectivity_map_key===p&&P.some((B)=>M.connected_source_port_ids.includes(B)))?.source_trace_id}let g=t._resolveSchematicSheetId(),f=s.schematic_port.get(d[0]);if(f?.schematic_sheet_id)g=f.schematic_sheet_id;let y={x:0,y:0},x=h.stubTracePath?.map((P)=>({...P}));if(x&&d.length===1){let P=s.schematic_port.get(d[0])?.center;if(P)y={x:P.x-x[0].x,y:P.y-x[0].y},x=x.map((M)=>({x:M.x+y.x,y:M.y+y.y}))}let C={x:h.anchorPoint.x+y.x,y:h.anchorPoint.y+y.y},b={x:h.center.x+y.x,y:h.center.y+y.y},I="center",v=h.height/2;switch(h.side){case"y+":b.y=C.y+v;break;case"y-":b.y=C.y-v;break;case"x+":b.x=C.x+v;break;case"x-":b.x=C.x-v;break}if(x&&x.length===2){let[P,M]=x;if(h.axis==="x"){let B=M.x>P.x;I=B?"left":"right",b.x+=B?-h.width/2:h.width/2}else{let B=M.y>P.y;I=B?"left":"right",b.y+=B?-h.width/2:h.width/2}}if(x&&x.length===2)s.schematic_trace.insert({source_trace_id:A,edges:[{from:x[0],to:x[1]}],junctions:[],subcircuit_connectivity_map_key:p,schematic_sheet_id:g}),s.schematic_port.update(d[0],{is_connected:!0});s.schematic_text.insert({text:m,source_trace_id:A,anchor:I,position:b,rotation:h.axis==="y"?zai:0,font_size:h.height,color:Fai,schematic_sheet_id:g})}}var Vai=0.18,V7n=({center:e,text:t})=>{let o=rB({text:t})/2,r=Vai/2;return{minX:e.x-o,maxX:e.x+o,minY:e.y-r,maxY:e.y+r}},Yai=(e)=>{switch(e){case"x+":return"left";case"x-":return"right";case"y+":return"bottom";case"y-":return"top";case"left":return"right";case"top":return"bottom";case"right":return"left";case"bottom":return"top"}},Whe=O7n.default("Group_doInitialSchematicTraceRender"),Y7n=(e,t)=>e.schematicNetLabel.source_net_id!=null&&e.schematicNetLabel.source_net_id===t.source_net_id,Gai=(e,t)=>{if(!Y7n(e,t.sourceNet))return!1;if(e.schematicPortIds.some((n)=>t.schematicPortIds.has(n)))return!0;if(!e.schematicNetLabel.center)return!1;return yp(V7n({center:e.schematicNetLabel.center,text:e.schematicNetLabel.text}),t.bounds)};function Uai(e){let{group:t,routedSchematicPortIdBySchematicPortId:n,solver:o,connKeyToSourceNet:r,userNetIdToConnKey:i,crossScopeSourceTraceIdBySchematicPortIdAndNetId:s,sourceTraceIdByPortOnlyLabelSchematicPortId:a,connKeysWithExplicitPortNetTraces:c,schematicPortIdsWithPreExistingNetLabels:l,schematicPortIdsWithRoutedTraces:h,netLabels:d}=e,{db:u}=t.root,_=Tat(t),p=o.inlineNetLabelSolver?.getOutput().netLabelPlacements??o.netLabelNetLabelCollisionSolver?.getOutput().netLabelPlacements??o.netLabelTraceCollisionSolver?.getOutput().netLabelPlacements??o.netLabelPlacementSolver?.netLabelPlacements??o.traceLabelOverlapAvoidanceSolver?.getOutput().netLabelPlacements??[],m=[],A=new Set;for(let b of p){let I=[...b.pinIds??[]].sort(),v=`${b.globalConnNetId}|${I.join("::")}|${b.netId??""}`;if(A.has(v)){Whe(`skipping duplicate placement for "${b.netId}" REASON:identical net label placement`);continue}A.add(v),m.push(b)}let g=new Map,f=new Map,y=new Set;for(let b of m){if(g.set(b.globalConnNetId,(g.get(b.globalConnNetId)??0)+1),(b.pinIds?.length??0)>1){if(!f.has(b.globalConnNetId))f.set(b.globalConnNetId,new Set);f.get(b.globalConnNetId).add(b.pinIds.slice().sort().join("::"))}if((b.pinIds?.length??0)<=1)y.add(b.globalConnNetId)}let x=o.mspConnectionPairSolver.globalConnMap,C=d.map((b)=>{if(!b.schematic_net_label_id)return null;let I=u.schematic_net_label.get(b.schematic_net_label_id);if(!I)return null;return{schematicNetLabel:I,schematicPortIds:b._getConnectedPorts().map((v)=>v.schematic_port_id).filter((v)=>Boolean(v)).map((v)=>n.get(v)??v),shouldUseSchematicTraceSolver:b._parsedProps.schX===void 0&&b._parsedProps.schY===void 0}}).filter((b)=>b!==null);for(let b of m){Whe(`processing placement: ${b.netId}`);let I=b.pinIds.map(K0),P=(I.length===1?s.get(I[0])?.get(b.netId??b.globalConnNetId):void 0)??(I.length===1?a.get(I[0]):void 0),M=P?u.source_trace.get(P):void 0,B=x.getIdsConnectedToNet(b.globalConnNetId).find((ne)=>i.get(ne)),T=M?.subcircuit_connectivity_map_key??i.get(B),N=b.orientation,D=Yai(N),L;if(T)L=r.get(T);let H=T?_({subcircuitConnectivityMapKey:T}):{name:b.netId??b.globalConnNetId,wasAssignedDisplayLabel:!1},V=b.netLabelText?{name:b.netLabelText,wasAssignedDisplayLabel:!0}:H,O=t._resolveSchematicSheetId(),U=u.schematic_port.get(I[0]);if(U?.schematic_sheet_id)O=U.schematic_sheet_id;let j=b.anchorPoint;if(I.length===1&&I[0]){let ne=u.schematic_port.get(I[0]);if(ne?.center&&!ne.is_connected)j=ne.center}if(I.some((ne)=>l.has(ne))){Whe(`skipping net label placement for "${b.netId}" REASON:schematic port has pre-existing net label`);continue}if(L){let ne=L.is_ground||L.is_power,re=c.has(T),Z=I.some((ge)=>h.has(ge)),te=(g.get(b.globalConnNetId)??0)<=1;if(!re&&!ne&&Z&&te){Whe(`skipping net label placement for "${b.netId}" REASON:schematic port has routed trace`);continue}let ce=V.name,ue=FS({anchor_position:j,anchor_side:D,text:ce}),de=C.find((ge)=>ge.shouldUseSchematicTraceSolver&&Y7n(ge,L)&&ge.schematicPortIds.some((xe)=>I.includes(xe)));if(de){u.schematic_net_label.update(de.schematicNetLabel.schematic_net_label_id,{anchor_position:j,center:ue,anchor_side:D,schematic_sheet_id:O,source_trace_id:P});continue}if(!ne){let ge={sourceNet:L,text:ce,schematicPortIds:new Set(I),bounds:V7n({center:ue,text:ce})};if(C.some((xe)=>Gai(xe,ge)))continue}let me={text:ce,source_net_id:L.source_net_id,anchor_position:j,center:ue,anchor_side:D,schematic_sheet_id:O,source_trace_id:P};u.schematic_net_label.insert(me);continue}let{name:Y,wasAssignedDisplayLabel:X}=V,J=(b.pinIds?.length??0)>1&&(y.has(b.globalConnNetId)||(f.get(b.globalConnNetId)?.size??0)>1);if(!X&&!J&&I.some((ne)=>h.has(ne))){Whe(`skipping net label placement for "${b.netId}" REASON:schematic port has routed traces and no display label`);continue}let ee=FS({anchor_position:j,anchor_side:D,text:Y}),se={text:Y,source_net_id:T??b.netId??b.globalConnNetId,anchor_position:j,center:ee,anchor_side:D,schematic_sheet_id:O,source_trace_id:P};u.schematic_net_label.insert(se)}}var gve=(e,t,n,o)=>e*o-t*n;function Dat(e,t,n,o,r){let i={x:t.x-e.x,y:t.y-e.y},s={x:o.x-n.x,y:o.y-n.y},a=gve(i.x,i.y,s.x,s.y),c={x:n.x-e.x,y:n.y-e.y},l=gve(c.x,c.y,i.x,i.y);if(Math.abs(a)<r&&Math.abs(l)<r)return null;if(Math.abs(a)<r&&Math.abs(l)>=r)return null;let h=gve(c.x,c.y,s.x,s.y)/a,d=gve(c.x,c.y,i.x,i.y)/a;if(h<-r||h>1+r||d<-r||d>1+r)return null;return{x:e.x+h*i.x,y:e.y+h*i.y}}var ck=0.000001;function Yyn(e){let t=Math.abs(e.to.x-e.from.x),n=Math.abs(e.to.y-e.from.y);return t>=n}function RY(e,t){return Math.hypot(t.x-e.x,t.y-e.y)}function sY(e,t,n){return{x:e.x+(t.x-e.x)*n,y:e.y+(t.y-e.y)*n}}function VJ(e,t,n){let o=RY(e,t);if(o<ck)return 0;let r=((n.x-e.x)*(t.x-e.x)+(n.y-e.y)*(t.y-e.y))/((t.x-e.x)*(t.x-e.x)+(t.y-e.y)*(t.y-e.y));return Math.max(0,Math.min(1,r))*o}function W7n(e,t=ck){if(e.length===0)return e;e.sort((r,i)=>r.start-i.start);let n=[],o={...e[0]};for(let r=1;r<e.length;r++){let i=e[r];if(i.start<=o.end+t)o.end=Math.max(o.end,i.end);else n.push(o),o={...i}}return n.push(o),n}function Wai(e,t,n){let o=RY(e.from,e.to);if(o<ck||t.length===0)return[e];let r=n/2,i=t.map((d)=>({start:Math.max(0,d-r),end:Math.min(o,d+r)})).filter((d)=>d.end-d.start>ck),s=W7n(i),a=[],c=0,l={x:e.to.x-e.from.x,y:e.to.y-e.from.y},h=(d,u,_)=>{if(u-d<=ck)return;let p=d/o,m=u/o;a.push({from:sY(e.from,e.to,p),to:sY(e.from,e.to,m),..._?{is_crossing:!0}:{}})};for(let d of s){if(d.start-c>ck)h(c,d.start,!1);h(d.start,d.end,!0),c=d.end}if(o-c>ck)h(c,o,!1);return a.length>0?a:[e]}function Xai(e,t={}){let n=t.crossSegmentLength??0.075,o=t.tolerance??ck,r=new Map,i=(c)=>`${c.traceIdx}:${c.edgeIdx}`,s=(c)=>e[c.traceIdx].edges[c.edgeIdx];for(let c=0;c<e.length;c++){let l=e[c];for(let h=0;h<l.edges.length;h++){let d=l.edges[h];for(let u=c;u<e.length;u++){let _=e[u];for(let p=u===c?h+1:0;p<_.edges.length;p++){let m=_.edges[p];if(l.connectivity_key!==void 0&&l.connectivity_key===_.connectivity_key)continue;let A=Dat(d.from,d.to,m.from,m.to,o);if(!A)continue;let g=RY(d.from,d.to),f=RY(m.from,m.to);if(g<o||f<o)continue;let y=VJ(d.from,d.to,A),x=VJ(m.from,m.to,A),C=y<=o||Math.abs(g-y)<=o||Number.isNaN(y),b=x<=o||Math.abs(f-x)<=o||Number.isNaN(x);if(!C&&!b){let I=Yyn(d),v=Yyn(m),P;if(I!==v)P=I;else{let T=Math.abs(d.to.x-d.from.x),N=Math.abs(d.to.y-d.from.y),D=Math.abs(m.to.x-m.from.x),L=Math.abs(m.to.y-m.from.y),H=T-N,V=D-L;P=H===V?!0:H>V}let M=i({traceIdx:P?c:u,edgeIdx:P?h:p}),B=r.get(M)??[];B.push(P?y:x),r.set(M,B)}}}}}let a=e.map((c)=>({...c,edges:[]}));for(let c=0;c<e.length;c++){let l=e[c];for(let h=0;h<l.edges.length;h++){let d=i({traceIdx:c,edgeIdx:h}),u=r.get(d)??[];if(u.length===0){a[c].edges.push(l.edges[h]);continue}let _=Array.from(new Set(u.map((m)=>Number(m.toFixed(6))))).sort((m,A)=>m-A),p=Wai(l.edges[h],_,n);a[c].edges.push(...p)}}return a}var F9=0.000001;function W8e(e,t,n=F9){return Math.abs(e-t)<=n}function Qk(e,t,n=F9){return W8e(e.x,t.x,n)&&W8e(e.y,t.y,n)}function Gyn(e,t,n,o=F9){let r=Math.min(t.x,n.x)-o,i=Math.max(t.x,n.x)+o,s=Math.min(t.y,n.y)-o,a=Math.max(t.y,n.y)+o;if(e.x<r||e.x>i||e.y<s||e.y>a)return!1;return Math.abs((n.x-t.x)*(e.y-t.y)-(n.y-t.y)*(e.x-t.x))<=o}function Uyn(e,t=F9){let n=new Map;for(let o of e){let r=`${o.x.toFixed(6)},${o.y.toFixed(6)}`;if(!n.has(r))n.set(r,o)}return Array.from(n.values())}function Wyn(e){return{x:e.to.x-e.from.x,y:e.to.y-e.from.y}}function Xyn(e,t,n=F9){return Qk(e,t.from,n)||Qk(e,t.to,n)}function znt(e,t,n=F9){let o=Wyn(e),r=Wyn(t),i=Math.hypot(o.x,o.y),s=Math.hypot(r.x,r.y);if(i<n||s<n)return!0;let a=o.x*r.y-o.y*r.x;return Math.abs(a)<=n*i*s}function sde(e,t,n=F9){return e.edges.filter((o)=>Qk(o.from,t,n)||Qk(o.to,t,n))}function jyn(e,t,n=F9){for(let o of e.edges){if(Qk(o.from,t,n))return o.from;if(Qk(o.to,t,n))return o.to}return null}function jai(e,t,n=F9){let o=Qk(e.from,t,n)||W8e(e.from.x,t.x,n)&&W8e(e.from.y,t.y,n)?e.to:e.from,r=o.x-t.x,i=o.y-t.y;if(Math.abs(r)<n&&Math.abs(i)<n)return null;if(Math.abs(r)>=Math.abs(i))return r>=0?"right":"left";return i>=0?"up":"down"}function CJ(e,t,n=F9){let o=sde(e,t,n);if(o.length<2)return null;let r=o.map((d)=>jai(d,t,n)),i=r.includes("up"),s=r.includes("down"),a=r.includes("left"),c=r.includes("right"),l=i?"up":s?"down":null,h=c?"right":a?"left":null;if(l&&h)return`${l}-${h}`;return null}function Kai(e,t={}){let n=t.tolerance??F9,o={};for(let i of e)o[i.source_trace_id]=[];let r=e.map((i)=>{let s=[];for(let a of i.edges)s.push(a.from,a.to);return Uyn(s,n)});for(let i=0;i<e.length;i++){let s=e[i],a=r[i];for(let c=i+1;c<e.length;c++){let l=e[c],h=r[c];if(!(s.connectivity_key!==void 0&&s.connectivity_key===l.connectivity_key))continue;for(let u of s.edges)for(let _ of l.edges){let p=Dat(u.from,u.to,_.from,_.to,n);if(!p)continue;if(Xyn(p,u,n)||Xyn(p,_,n))continue;if(o[s.source_trace_id].push(p),s.source_trace_id!==l.source_trace_id)o[l.source_trace_id].push(p)}for(let u of a)for(let _ of h)if(Qk(u,_,n)){let p=sde(s,u,n),m=sde(l,_,n),A=p.some((x)=>m.some((C)=>!znt(x,C,n))),g=CJ(s,u,n),f=CJ(l,_,n);if(A&&!(g!==null&&f!==null&&g===f)){if(o[s.source_trace_id].push(u),s.source_trace_id!==l.source_trace_id)o[l.source_trace_id].push(_)}}for(let u of a)for(let _ of l.edges)if(Gyn(u,_.from,_.to,n)){let m=sde(s,u,n).some((x)=>!znt(x,_,n)),A=CJ(s,u,n),g=jyn(l,u,n*1000),f=g?CJ(l,g,n):null;if(m&&!(A!==null&&f!==null&&A===f)){if(o[s.source_trace_id].push(u),s.source_trace_id!==l.source_trace_id)o[l.source_trace_id].push(u)}}for(let u of h)for(let _ of s.edges)if(Gyn(u,_.from,_.to,n)){let m=sde(l,u,n).some((x)=>!znt(_,x,n)),A=CJ(l,u,n),g=jyn(s,u,n*1000),f=g?CJ(s,g,n):null;if(m&&!(f!==null&&A!==null&&f===A)){if(o[l.source_trace_id].push(u),s.source_trace_id!==l.source_trace_id)o[s.source_trace_id].push(u)}}}}for(let i of Object.keys(o))o[i]=Uyn(o[i],n);return o}var yk=0.000001;function $ai(e,t,n=yk){let o=e.to.x-e.from.x,r=e.to.y-e.from.y,i=t.to.x-t.from.x,s=t.to.y-t.from.y,a=Math.hypot(o,r),c=Math.hypot(i,s);if(a<=n||c<=n)return!1;let l=o*s-r*i;if(Math.abs(l)>n*a*c)return!1;let h=o*(t.from.y-e.from.y)-r*(t.from.x-e.from.x);return Math.abs(h)<=n*a}function qai(e,t){let n=W7n(t);if(n.length===0)return[e];let o=RY(e.from,e.to);if(o<=yk)return[e];let r=[],i=0;for(let s of n){if(s.start-i>yk)r.push({from:sY(e.from,e.to,i/o),to:sY(e.from,e.to,s.start/o)});if(s.end-s.start>yk)r.push({from:sY(e.from,e.to,s.start/o),to:sY(e.from,e.to,s.end/o),is_crossing:!0});i=Math.max(i,s.end)}if(o-i>yk)r.push({from:sY(e.from,e.to,i/o),to:e.to});return r}function Jai(e){let t=new Map;for(let n=0;n<e.length;n++){let o=e[n];if(!o.connectivity_key)continue;for(let r of o.edges){if(!r.is_crossing||RY(r.from,r.to)<=yk)continue;for(let i=0;i<e.length;i++){let s=e[i];if(i===n||s.connectivity_key!==o.connectivity_key)continue;for(let a=0;a<s.edges.length;a++){let c=s.edges[a],l=RY(c.from,c.to);if(c.is_crossing||l<=yk)continue;if(!$ai(c,r))continue;let h=Math.max(0,Math.min(VJ(c.from,c.to,r.from),VJ(c.from,c.to,r.to))),d=Math.min(l,Math.max(VJ(c.from,c.to,r.from),VJ(c.from,c.to,r.to)));if(d-h<=yk)continue;let u=`${i}:${a}`,_=t.get(u)??[];_.push({start:h,end:d}),t.set(u,_)}}}}if(t.size===0)return e;return e.map((n,o)=>({...n,edges:n.edges.flatMap((r,i)=>{let s=t.get(`${o}:${i}`);return s?qai(r,s):[r]})}))}var Ave=0.000001;function Zai({traces:e,existingTraces:t,netLabelTerminals:n,terminals:o,inlineNetLabelTraces:r=new Set}){let i=new Map;for(let s of new Set(n.map((a)=>a.connectivityKey))){let a=[],c=(p)=>{let m=a.find((A)=>Tl(A.position,p)<=Ave);if(!m)m={position:p,segments:[],distanceToLabel:1/0},a.push(m);return m},l=[...t.filter((p)=>p.subcircuit_connectivity_map_key===s).flatMap((p)=>p.edges.map((m)=>({edge:m,isPreserved:!0}))),...e.filter((p)=>p.subcircuit_connectivity_map_key===s).flatMap((p)=>p.edges.map((m)=>({edge:m,isPreserved:r.has(p)})))];for(let{edge:p}of l)c(p.from),c(p.to);for(let p=0;p<l.length;p++)for(let m=p+1;m<l.length;m++){let A=l[p].edge,g=l[m].edge,f=Dat(A.from,A.to,g.from,g.to,Ave);if(f)c(f)}let h=o.filter((p)=>p.connectivityKey===s).map((p)=>c(p.position));for(let p of n)if(p.connectivityKey===s)c(p.position).distanceToLabel=0;let d=new Map;for(let{edge:p,isPreserved:m}of l){let A=a.filter((f)=>ia(f.position,p.from,p.to)<=Ave).sort((f,y)=>Tl(p.from,f.position)-Tl(p.from,y.position)),g=[];for(let f=1;f<A.length;f++){let y=A[f-1],x=A[f],C={from:y,to:x,cost:m?0:Tl(y.position,x.position)};y.segments.push(C),x.segments.push(C),g.push(C)}if(!m)d.set(p,g)}let u=new Set(a);while(u.size>0){let p;for(let m of u)if(m.distanceToLabel<(p?.distanceToLabel??1/0))p=m;if(!p)break;u.delete(p);for(let m of p.segments){let A=m.from===p?m.to:m.from,g=p.distanceToLabel+m.cost;if(u.has(A)&&g<A.distanceToLabel)A.distanceToLabel=g,A.pathToLabel={node:p,segment:m}}}let _=new Set;for(let p of h)while(p.pathToLabel){let{segment:m,node:A}=p.pathToLabel;if(_.has(m))break;_.add(m),p=A}for(let[p,m]of d){let A=[];for(let g of m){if(!_.has(g)&&Number.isFinite(g.from.distanceToLabel))continue;let f=A.at(-1);if(f&&Tl(f.to,g.from.position)<=Ave)f.to=g.to.position;else A.push({...p,from:g.from.position,to:g.to.position})}i.set(p,A)}}return e.map((s)=>({...s,edges:s.edges.flatMap((a)=>i.get(a)??[a])})).filter((s)=>s.edges.length>0)}var Ont=G7n.default("Group_doInitialSchematicTraceRender"),eci=1.5;function tci(e,t){let{points:n,schematicPortIds:o,componentBoundsByPortId:r}=e,i=o.map((_)=>{let p=t.schematic_port.get(_)?.center,m=r.get(_);if(!p||!m)return null;return{center:p,bounds:m}}).filter((_)=>Boolean(_));if(i.length===0)return n;let s=n.map((_)=>({x:_.x,y:_.y})),a=(_,p)=>(_.x-p.x)**2+(_.y-p.y)**2,c=new Set;for(let _=0;_<i.length;_++)if(s.some((p)=>a(i[_].center,p)<=0.000000000001))c.add(_);let l=0.001,h=["start","end"],d=[];for(let _ of h){let p=_==="start"?s[0]:s[s.length-1];for(let m=0;m<i.length;m++){if(c.has(m))continue;let{center:A,bounds:g}=i[m],f=a(A,p);if(Math.abs(A.x-p.x)>l&&Math.abs(A.y-p.y)>l)continue;if(f>eci**2&&$Oe(p,g)>l)continue;d.push({endpoint:_,centerIndex:m,dist:f})}}d.sort((_,p)=>_.dist-p.dist);let u=new Set;for(let{endpoint:_,centerIndex:p,dist:m}of d){if(u.has(_)||c.has(p))continue;if(c.add(p),u.add(_),m<=0.000000000001)continue;let A=i[p].center;if(_==="start")s.unshift({x:A.x,y:A.y});else s.push({x:A.x,y:A.y})}return s}function nci(e){let{group:t,solver:n,userNetIdToConnKey:o,schematicPortIdsWithPreExistingNetLabels:r,schematicSheetId:i}=e,{db:s}=t.root,a=new Map(n.inputProblem.chips.flatMap((v)=>v.pins.map((P)=>[K0(P.pinId),P]))),c=new Set(t.selectAll("port").filter((v)=>{if(!v._getSymbolAncestor())return!1;let P=v.getParentNormalComponent()?._parsedProps.symbol;return U7n.isValidElement(P)||Cot(P)}).map((v)=>v.schematic_port_id).filter((v)=>v!==null&&v!==void 0).map(K0)),l=new Map;for(let v of s.schematic_component.list()){let P=V7e({db:s,schematicComponent:v}),M=td({center:v.center,width:v.size.width,height:v.size.height});for(let B of s.schematic_port.list({schematic_component_id:v.schematic_component_id})){let T=B.center.x>M.minX&&B.center.x<M.maxX&&B.center.y>M.minY&&B.center.y<M.maxY,N=K0(B.schematic_port_id);if(!P&&!c.has(N))continue;if(!P&&T)continue;l.set(N,P??M)}}let h=n.inlineNetLabelSolver?.getOutput().traces??n.sameNetJunctionAlignmentSolver?.getOutput().traces??n.netLabelTraceCollisionSolver?.getOutput().traces??n.traceCleanupSolver?.getOutput().traces??n.traceLabelOverlapAvoidanceSolver?.getOutput().traces??n.schematicTraceLinesSolver?.solvedTracePaths,d=[],u=[],_=[];Ont(`Traces inside SchematicTraceSolver output: ${(h??[]).length}`);for(let v of h??[]){let M=Array.from(new Set(v.pinIds??[])).map(K0),B=v?.tracePath;if(!Array.isArray(B)||B.length<2){Ont(`Skipping trace ${v?.pinIds.join(",")} because it has less than 2 points`);continue}let T=tci({points:B,schematicPortIds:M,componentBoundsByPortId:l},s),N=[];for(let O=0;O<T.length-1;O++)N.push({from:{x:T[O].x,y:T[O].y},to:{x:T[O+1].x,y:T[O+1].y}});let D=String(v?.mspPairId),L;if(Array.isArray(v?.pins)&&v.pins.length===2){let O=v.pins[0]?.pinId,U=v.pins[1]?.pinId,j=O?K0(O):void 0,Y=U?K0(U):void 0;if(j&&Y){let X=new Set([j,Y]);for(let K of X)s.schematic_port.update(K,{is_connected:!0});L=o.get(String(v.userNetId))}}if(!L)L=o.get(String(v.userNetId));if(!L){let O=M.map((j)=>{let X=s.schematic_port.get(j)?.source_port_id;if(!X)return;return s.source_port.get(X)?.subcircuit_connectivity_map_key}).filter((j)=>Boolean(j));if(new Set(O).size===1)L=O[0]}if(L)for(let O of M){let U=s.schematic_port.get(O);if(!U)continue;let j={position:U.center,connectivityKey:L};u.push(j);let Y=a.get(O);if(Y)u.push({position:{x:Y.x,y:Y.y},connectivityKey:L});if(r.has(O))_.push(j)}let H=new Set(M.map((O)=>s.schematic_port.get(O)?.schematic_sheet_id).filter((O)=>Boolean(O))),V;if(H.size===1)V=H.values().next().value;else if(H.size===0)V=t._resolveSchematicSheetId();d.push({source_trace_id:D,edges:N,subcircuit_connectivity_map_key:L,schematic_sheet_id:V})}Ont(`Applying ${d.length} traces from SchematicTraceSolver output`);let p=s.schematic_trace.list().filter((v)=>v.schematic_sheet_id===i),m=n.inlineNetLabelSolver?.getOutput().netLabelPlacements??n.netLabelNetLabelCollisionSolver?.getOutput().netLabelPlacements??n.netLabelTraceCollisionSolver?.getOutput().netLabelPlacements??n.netLabelPlacementSolver?.netLabelPlacements??n.traceLabelOverlapAvoidanceSolver?.getOutput().netLabelPlacements??[];for(let v of m){if(v.pinIds.some((B)=>r.has(K0(B))))continue;let P=n.mspConnectionPairSolver.globalConnMap.getIdsConnectedToNet(v.globalConnNetId).find((B)=>o.has(B)),M=P?o.get(P):void 0;if(M)u.push({position:v.anchorPoint,connectivityKey:M})}let A=new Set((n.inlineNetLabelSolver?.getOutput().inlineNetLabelPlacements??[]).flatMap((v)=>v.mspPairId?[v.mspPairId]:[])),g=Zai({traces:d,existingTraces:p,netLabelTerminals:_,terminals:u,inlineNetLabelTraces:new Set(d.filter((v)=>A.has(v.source_trace_id)))}),f=[];for(let v of p){if(v.edges.length===0)continue;let P=v.source_trace_id?s.source_trace.get(v.source_trace_id):void 0;f.push({schematic_trace_id:v.schematic_trace_id,source_trace_id:v.source_trace_id??v.schematic_trace_id,edges:v.edges,connectivity_key:v.subcircuit_connectivity_map_key??P?.subcircuit_connectivity_map_key})}let y=Xai([...g.map((v)=>({source_trace_id:v.source_trace_id,edges:v.edges,connectivity_key:v.subcircuit_connectivity_map_key})),...f]),x=Jai(y),C=x.slice(0,g.length),b=x.slice(g.length);for(let v of b){if(!v.schematic_trace_id)continue;s.schematic_trace.update(v.schematic_trace_id,{edges:v.edges})}let I=Kai([...C,...b]);for(let v of C){let P=d.find((B)=>B.source_trace_id===v.source_trace_id),M=i;if(P?.schematic_sheet_id)M=P.schematic_sheet_id;s.schematic_trace.insert({source_trace_id:v.source_trace_id,edges:v.edges,junctions:I[v.source_trace_id]??[],subcircuit_connectivity_map_key:P?.subcircuit_connectivity_map_key,schematic_sheet_id:M})}}var Kyn=0.12,$yn=(e,t)=>{e.anchoredNetLabelWidth??=Number(rB({text:t}).toFixed(2)),e.allowInlineNetLabel=!0,e.inlineNetLabelHeight=Kyn,e.inlineNetLabelWidth=Number(rB({text:t,font_size:Kyn}).toFixed(2))},oci=({directConnections:e,netConnections:t,connKeyToSchematicPortIds:n,connKeyToSourceNet:o,connKeysWithExplicitPortNetTraces:r,schematicPortIdsWithExplicitNetLabels:i,schematicPortIdsWithInlineNetLabels:s,areSchematicPortsOnDifferentComponents:a,resolveCanonicalNetLabelText:c})=>{for(let l of e){let{connKey:h}=l;if(!h)continue;if(n.get(h)?.length!==2)continue;let u=o.get(h);if(u?.is_power||u?.is_ground)continue;let{name:_,wasAssignedDisplayLabel:p}=c({subcircuitConnectivityMapKey:h});if(!_||!p)continue;$yn(l,_)}for(let l of t){let{schematicPortIds:h}=l,{isSameSheetCrossSectionConnection:d}=l,u=h.some((x)=>s.has(x)),_=h.length===1,p=h[0],m=p!==void 0&&h.slice(1).some((x)=>a([p,x]));if(!u&&!d&&!_&&!m)continue;if(!u&&h.some((x)=>i.has(x)))continue;let{connKey:A}=l;if(!A&&!d)continue;if(A&&!d&&!r.has(A))continue;let g=A?o.get(A):void 0;if(!u&&(l.isPowerOrGroundConnection||g?.is_power||g?.is_ground))continue;let f=l.netLabelText??"",y=Boolean(f);if(!d){if(!A)continue;let x=c({subcircuitConnectivityMapKey:A});f=x.name,y=x.wasAssignedDisplayLabel}if(!f||!u&&!y)continue;$yn(l,f)}},rci=(e)=>{let{schX:t,schY:n}=e._parsedProps;if(t!==void 0&&n!==void 0)return e;if(!e.getParentNormalComponent()?.getSchematicSymbol())return e;let o=e._getPortsInternallyConnectedToThisPort(),r=e.schematicSymbolPortDef??o.find((i)=>i.schematicSymbolPortDef)?.schematicSymbolPortDef;if(!r)return e;return o.find((i)=>i.schematicSymbolPortDef===r)??e};function ici(e){let{db:t}=e.root,n=new Map;for(let o of e.selectAll("port")){if(!o.schematic_port_id)continue;let r=t.schematic_port.get(o.schematic_port_id),i=rci(o),s=i.schematic_port_id?t.schematic_port.get(i.schematic_port_id):void 0;if(!r||!s||r.schematic_component_id!==s.schematic_component_id||r.schematic_sheet_id!==s.schematic_sheet_id)continue;n.set(K0(r.schematic_port_id),K0(s.schematic_port_id))}return n}var X7n=({db:e,sourcePortId:t,otherSourcePortId:n,sourcePortIdsInSchematicScope:o,schematicSheetId:r})=>{if(o.has(n))return!1;let i=e.source_port.get(t),s=e.source_port.get(n);if(!i||!s)return!1;if(i.subcircuit_id!==s.subcircuit_id)return!0;if(!r)return!1;let a=e.schematic_port.list({source_port_id:n});if(a.some((l)=>l.schematic_sheet_id===r))return!1;return a.some((l)=>l.schematic_sheet_id!==void 0)},j7n=({db:e,sourcePortId:t,sourcePortIdsInSchematicScope:n,schematicSheetId:o})=>{if(!e.source_port.get(t))return;for(let r of e.source_trace.list()){let i=(r.connected_source_port_ids??[]).map(TJ);if(i.length!==2)continue;if((r.connected_source_net_ids??[]).length>0)continue;if(!i.includes(t))continue;let s=i.find((a)=>a!==t);if(!s)continue;if(!X7n({db:e,sourcePortId:t,otherSourcePortId:s,sourcePortIdsInSchematicScope:n,schematicSheetId:o}))continue;return s}},K7n=({group:e,sourcePortId:t,connectedSourcePortIdsForKey:n,sourcePortIdsInSchematicScope:o,schematicSheetId:r,connKey:i,sourceNet:s})=>{let{db:a}=e.root,c=e.selectAll("port").filter((A)=>A._getSubcircuitConnectivityKey()===i),{name:l,wasAssignedDisplayLabel:h}=Bat(c),d=h?l:void 0,u=h?void 0:l||void 0,_=vit(a,n),p=j7n({db:a,sourcePortId:t,sourcePortIdsInSchematicScope:o,schematicSheetId:r}),m=p?u5n(a,p):void 0;return{text:s?.name||s?.source_net_id||d||m||u||_||i,wasAssignedDisplayLabel:h,directConnectionOutsideSchematicScopeSourcePortId:p}},sci=[28,28,35,56,56,89,67,19,33,33,39,58,28,33,28,28,56,56,56,56,56,56,56,56,56,56,28,28,58,58,58,56,102,67,67,72,72,67,61,78,72,28,50,67,56,83,72,78,67,78,72,67,61,72,67,94,67,67,61,28,28,28,47,56,33,56,56,50,56,56,28,56,56,22,22,50,22,83,56,56,56,56,33,50,28,56,50,72,50,50,50,33,26,33,58];function aci({text:e,fontSize:t}){let n=0;for(let o of e){let r=sci[o.charCodeAt(0)-32];if(r===void 0)return D7n({text:e,fontSize:t});n+=r}return n*(t/100)}var cci=0.18;function lci(e){let t=e.font_size??cci,n=aci({text:e.text??"",fontSize:t}),o=t,r=e.anchor??"center",i,s;if(r.includes("left"))i=0,s=n;else if(r.includes("right"))i=-n,s=0;else i=-n/2,s=n/2;let a,c;if(r.includes("top"))a=-o,c=0;else if(r.includes("bottom"))a=0,c=o;else a=-o/2,c=o/2;let l=(e.rotation??0)*Math.PI/180,h=Math.cos(l),d=Math.sin(l),u=[{x:i,y:a},{x:i,y:c},{x:s,y:a},{x:s,y:c}].map((_)=>({x:e.position.x+_.x*h-_.y*d,y:e.position.y+_.x*d+_.y*h}));return Ms(u)}var hci=0.01,Vnt=0.06;function dci(e,t){if(!t)return!1;return e.text===t.display_name||e.text===t.name}function uci(e,t={}){if(!e.text)return null;let n=lci(e);if(dci(e,t.sourceComponent)&&t.schematicComponent?.center&&t.schematicComponent?.size){let o=td({center:t.schematicComponent.center,width:t.schematicComponent.size.width,height:t.schematicComponent.size.height}),r=n.maxY-n.minY;if(n.minY>o.maxY)n.minX-=Vnt,n.maxX+=Vnt,n.minY=o.maxY-hci,n.maxY=o.maxY+r+Vnt}return{chipId:e.schematic_component_id,center:b4(n),width:n.maxX-n.minX,height:n.maxY-n.minY,text:e.text}}var qyn=2.4,pci=0.42;function mci(e,t={}){let{db:n}=e.root,o=ici(e),r=(ge)=>o.get(ge)??ge,i=q8(n.toArray()),s=(ge)=>{let xe=[...i.getIdsConnectedToNet(ge)].sort()[0];return xe?`source_connectivity_${xe}`:`source_${ge}`},a=(ge)=>{let xe=[...ge.connected_source_port_ids,...ge.connected_source_net_ids].map((Ee)=>i.getNetConnectedToId(Ee)).find((Ee)=>Boolean(Ee));return xe?s(xe):ge.subcircuit_connectivity_map_key??ge.source_trace_id},c=new Set;for(let ge of n.source_net.list()){if(!ge.is_power&&!ge.is_ground)continue;let xe=i.getNetConnectedToId(ge.source_net_id);if(xe)c.add(s(xe))}let l=new Map,h=[],d=[...e.children].reverse();while(d.length>0){let ge=d.pop();if(ge instanceof tP){if(ge.isSubcircuit){if(ge._parsedProps.showAsSchematicBox)h.push(ge);continue}h.push(ge)}d.push(...[...ge.children].reverse())}let u=[e.schematic_group_id,...h.map((ge)=>ge.schematic_group_id)],_=n.schematic_component.list().filter((ge)=>u.includes(ge.schematic_group_id)).filter((ge)=>t.schematicSheetId===void 0||ge.schematic_sheet_id===t.schematicSheetId),p=new Set(_.map((ge)=>ge.schematic_component_id)),m=new Map(_.map((ge)=>[ge.schematic_component_id,ge])),A=n.schematic_text.list().filter((ge)=>ge.schematic_component_id&&p.has(ge.schematic_component_id)).map((ge)=>{let xe=m.get(ge.schematic_component_id);if(!xe)return;let Ee=n.source_component.get(xe.source_component_id);return uci(ge,{schematicComponent:xe,sourceComponent:Ee})}).filter((ge)=>Boolean(ge)),g=new Map,f=e._getBoard()?.getDescendants()??[];for(let ge of f){let xe=ge.schematic_component_id,Ee=ge.getSchematicSectionName();if(xe&&Ee)g.set(xe,Ee)}let y=[];for(let ge of _){let xe=ge.schematic_component_id,Ee=n.schematic_port.list({schematic_component_id:ge.schematic_component_id}),Re=Ee.filter((ye)=>{let Se=K0(ye.schematic_port_id);return r(Se)===Se}).map((ye)=>{let Se=K0(ye.schematic_port_id),Ne=ye.source_port_id?n.source_port.get(ye.source_port_id):void 0;return{pinId:Se,displayName:ye.display_pin_label??ye.pin_number?.toString()??Ne?.name,x:ye.center.x,y:ye.center.y,_facingDirection:o8e(ye.facing_direction??null)}}),Me=g.get(ge.schematic_component_id),_e=(ge.is_box_with_pins===!1?void 0:V7e({db:n,schematicComponent:ge}))??td({center:ge.center,width:ge.size.width,height:ge.size.height});for(let ye of Ee)_e.minX=Math.min(_e.minX,ye.center.x),_e.maxX=Math.max(_e.maxX,ye.center.x),_e.minY=Math.min(_e.minY,ye.center.y),_e.maxY=Math.max(_e.maxY,ye.center.y);y.push({chipId:xe,center:b4(_e),width:_e.maxX-_e.minX,height:_e.maxY-_e.minY,pins:Re,sectionId:Me})}let x=new Set,C=new Map,b=new Map,I=new Map,v=new Map(e.selectAll("port").filter((ge)=>ge.schematic_port_id).map((ge)=>[K0(ge.schematic_port_id),ge])),P=Tat(e);for(let ge of _){let xe=n.schematic_port.list({schematic_component_id:ge.schematic_component_id});for(let Ee of xe){let Re=K0(Ee.schematic_port_id);if(x.add(Re),Ee.source_port_id){let Me=TJ(Ee.source_port_id);C.set(Re,Me),b.set(Me,Re)}}}let M=new Set(b.keys()),B=(t.netLabels??[]).filter((ge)=>ge._getConnectedPorts().some((xe)=>{if(!xe.schematic_port_id)return!1;return x.has(K0(xe.schematic_port_id))})),T=new Set(B.filter((ge)=>!ge._parsedProps.inline).flatMap((ge)=>ge._getConnectedPorts()).map((ge)=>ge.schematic_port_id).filter((ge)=>ge!==null&&ge!==void 0).map(K0).map(r)),N=new Set(B.filter((ge)=>ge._parsedProps.inline||ge._parsedProps.schX===void 0&&ge._parsedProps.schY===void 0).flatMap((ge)=>ge._getConnectedPorts()).map((ge)=>ge.schematic_port_id).filter((ge)=>ge!==null&&ge!==void 0).map(K0).map(r)),D=new Set(B.filter((ge)=>ge._parsedProps.inline).flatMap((ge)=>ge._getConnectedPorts()).map((ge)=>ge.schematic_port_id).filter((ge)=>ge!==null&&ge!==void 0).map(K0).map(r)),L=new Set;if(e.subcircuit_id)L.add(e.subcircuit_id);for(let ge of h)if(ge.subcircuit_id)L.add(ge.subcircuit_id);let H=n.source_trace.list().filter((ge)=>{if(ge.subcircuit_id===e.subcircuit_id)return!0;for(let xe of ge.connected_source_port_ids)if(b.has(TJ(xe)))return!0;return!1}),V=new Set;for(let ge of H){if(ge.subcircuit_id===e.subcircuit_id)continue;if(ge.connected_source_net_ids.length===0)continue;for(let xe of ge.connected_source_port_ids){let Ee=TJ(xe),Re=b.get(Ee);if(!Re)continue;if(N.has(Re))continue;if(!n.schematic_port.list({source_port_id:xe}).some((_e)=>{if(_e.schematic_port_id===Re)return!1;return(_e.schematic_component_id?n.schematic_component.get(_e.schematic_component_id):void 0)?.schematic_sheet_id===t.schematicSheetId}))continue;V.add(Re)}}let O=H.flatMap((ge)=>ge.connected_source_net_ids);for(let ge of O){let xe=n.source_net.get(ge);if(xe?.subcircuit_id)L.add(xe.subcircuit_id)}for(let ge of n.source_net.list().filter((xe)=>!xe.subcircuit_id||L.has(xe.subcircuit_id)))if(ge.subcircuit_connectivity_map_key)l.set(ge.subcircuit_connectivity_map_key,ge);let U=[],j=[],Y=new Set,X=new Map,K=new Map,J=({schematicPortId:ge,netId:xe,sourceTraceId:Ee,replaceExisting:Re=!1})=>{let Me=X.get(ge)??new Map;if(Me.has(xe)&&!Re)return!1;return Me.set(xe,Ee),X.set(ge,Me),!0},ee=({sourceConnectivityNetId:ge,schematicPortId:xe,text:Ee,sourceTraceId:Re,connKey:Me,preferInScopeTraceMetadata:_e=!1})=>{let ye=ge;if(J({schematicPortId:xe,netId:ye,sourceTraceId:Re,replaceExisting:_e}),T.has(xe))return;let Se=K.get(ge);if(!Se)Se={netId:ye,netLabelText:Ee,schematicPortIds:[],netLabelWidth:Number(rB({text:Ee}).toFixed(2)),connKey:Me,isSameSheetCrossSectionConnection:!0,isPowerOrGroundConnection:c.has(ye)},K.set(ge,Se),j.push(Se);else if(_e)Se.netLabelText=Ee,Se.netLabelWidth=Number(rB({text:Ee}).toFixed(2)),Se.connKey=Me??Se.connKey;if(!Se.schematicPortIds.includes(xe))Se.schematicPortIds.push(xe)},se=new Map,ne=new Map,re=new Set;for(let ge of H)if(ge?.subcircuit_connectivity_map_key&&(ge.connected_source_port_ids?.length??0)>0&&(ge.connected_source_net_ids?.length??0)>0)re.add(ge.subcircuit_connectivity_map_key);let Z=(ge,xe)=>{let Ee=n.schematic_port.get(ge),Re=n.schematic_port.get(xe);if(!Ee||!Re)return!1;if(Ee.schematic_sheet_id!==Re.schematic_sheet_id)return!1;let _e=Ee.schematic_component_id?g.get(Ee.schematic_component_id):void 0,ye=Re.schematic_component_id?g.get(Re.schematic_component_id):void 0;return _e!==ye&&(_e!==void 0||ye!==void 0)},te=({schematicPortId:ge,otherSourcePortId:xe})=>n.schematic_port.list({source_port_id:xe}).some((Ee)=>Z(ge,K0(Ee.schematic_port_id)));for(let ge of H){let xe=Array.from(new Set((ge.connected_source_port_ids??[]).map((ye)=>b.get(TJ(ye))).filter((ye)=>Boolean(ye)&&x.has(ye)).map(r))),Ee=xe.length===1?C.get(xe[0]):void 0,Re=Ee?ge.connected_source_port_ids.map(TJ).find((ye)=>ye!==Ee):void 0,Me=Boolean(Ee&&Re&&X7n({db:n,sourcePortId:Ee,otherSourcePortId:Re,sourcePortIdsInSchematicScope:M,schematicSheetId:t.schematicSheetId})),_e=Boolean(xe.length===1&&Re&&te({schematicPortId:xe[0],otherSourcePortId:Re}));if(xe.length===1&&ge.connected_source_port_ids.length===2&&Me&&ge.connected_source_net_ids.length===0&&ge.subcircuit_connectivity_map_key){let ye=xe[0],Se=C.get(ye);if(Se){let Ne=ge.subcircuit_connectivity_map_key,Le=n.source_port.get(Se)?.subcircuit_connectivity_map_key,nt=n.source_net.list().find((ct)=>ct.subcircuit_id===e.subcircuit_id&&i.areIdsConnected(ct.source_net_id,Se)),dt=l.get(Ne)??(Le?l.get(Le):void 0)??nt,rt=Array.from(x).map((ct)=>C.get(ct)).filter((ct)=>{if(!ct)return!1;return n.source_port.get(ct)?.subcircuit_connectivity_map_key===Ne}),{text:pt}=K7n({group:e,sourcePortId:Se,connectedSourcePortIdsForKey:rt,sourcePortIdsInSchematicScope:M,schematicSheetId:t.schematicSheetId,connKey:Ne,sourceNet:dt});if(pt){let ct=a(ge);if(!I.has(ct))I.set(ct,Ne);if(_e)ee({sourceConnectivityNetId:ct,schematicPortId:ye,text:pt,sourceTraceId:ge.source_trace_id,connKey:Ne});else if(J({schematicPortId:ye,netId:ct,sourceTraceId:ge.source_trace_id}))j.push({netId:ct,netLabelText:pt,schematicPortIds:[ye],netLabelWidth:Number(rB({text:pt}).toFixed(2)),connKey:Ne})}}}else if(xe.length>=2){for(let ct of xe){let Ct=se.get(ct)??new Set;Ct.add(ge.source_trace_id),se.set(ct,Ct)}let ye=ge.name??ge.display_name,Se=ye??ge.source_trace_id;if(ge.subcircuit_connectivity_map_key)I.set(Se,ge.subcircuit_connectivity_map_key);let Ne=e._parsedProps.schMaxTraceDistance??qyn,Le=xe.map((ct)=>v.get(ct)).filter((ct)=>Boolean(ct)),nt=ge.subcircuit_connectivity_map_key?P({subcircuitConnectivityMapKey:ge.subcircuit_connectivity_map_key}).name:Bat(Le).name||ye,dt=xe.slice(1).some((ct,Ct)=>{let kt=xe[Ct],Lt=n.schematic_port.get(kt),Bt=n.schematic_port.get(ct);if(!Lt||!Bt)return!1;return Math.sqrt((Lt.center.x-Bt.center.x)**2+(Lt.center.y-Bt.center.y)**2)>Ne}),rt=nt&&dt?Number(rB({text:nt}).toFixed(2)):void 0,pt=nt;for(let ct=0;ct<xe.length-1;ct++){let Ct=xe[ct],kt=xe[ct+1],Lt=[Ct,kt].sort().join("::");if(Y.has(Lt))continue;if(Y.add(Lt),pt&&Z(Ct,kt)){let Bt=a(ge);if(ge.subcircuit_connectivity_map_key)I.set(Bt,ge.subcircuit_connectivity_map_key);ee({sourceConnectivityNetId:Bt,schematicPortId:Ct,text:pt,sourceTraceId:ge.source_trace_id,connKey:ge.subcircuit_connectivity_map_key,preferInScopeTraceMetadata:!0}),ee({sourceConnectivityNetId:Bt,schematicPortId:kt,text:pt,sourceTraceId:ge.source_trace_id,connKey:ge.subcircuit_connectivity_map_key,preferInScopeTraceMetadata:!0});continue}ne.set(Lt,ge.source_trace_id),U.push({schematicPortIds:[Ct,kt],netId:Se,netLabelWidth:rt,connKey:ge.subcircuit_connectivity_map_key})}}}let ie=[...j],ce=new Map;for(let[ge,xe]of C){if(V.has(ge))continue;let Ee=n.source_port.get(xe);if(!Ee?.subcircuit_connectivity_map_key)continue;let Re=Ee.subcircuit_connectivity_map_key;if(!ce.has(Re))ce.set(Re,[]);let Me=r(ge),_e=ce.get(Re);if(!_e.includes(Me))_e.push(Me)}for(let[ge,xe]of ce){let Ee=l.get(ge);if(Ee&&xe.length>=1){let Re=String(Ee.name||Ee.source_net_id||ge);I.set(Re,ge);let Me=Number(rB({text:String(Re)}).toFixed(2)),_e=Me,ye;if(Ee.is_ground||Ee.is_power)_e=pci,ye=Me;ie.push({netId:Re,schematicPortIds:xe,isGround:Ee.is_ground,netLabelWidth:_e,netLabelHeight:ye,connKey:ge})}}oci({directConnections:U,netConnections:ie,connKeyToSchematicPortIds:ce,connKeyToSourceNet:l,connKeysWithExplicitPortNetTraces:re,schematicPortIdsWithExplicitNetLabels:T,schematicPortIdsWithInlineNetLabels:D,areSchematicPortsOnDifferentComponents:(ge)=>{let xe=ge.map((Ee)=>n.schematic_port.get(Ee)?.schematic_component_id);return xe.every((Ee)=>Boolean(Ee))&&xe[0]!==xe[1]},resolveCanonicalNetLabelText:P});let ue=(()=>{let ge={},xe=new Set(ie.map((Ee)=>Ee.netId));for(let Ee of n.source_net.list().filter((Re)=>!Re.subcircuit_id||L.has(Re.subcircuit_id))){if(!Ee.name)continue;if(!xe.has(Ee.name))continue;if(Ee.is_ground)ge[Ee.name]=["y-"];else if(Ee.is_power)ge[Ee.name]=["y+"];else ge[Ee.name]=["x-","x+"]}for(let{netId:Ee}of j)ge[Ee]??=["x-","x+"];return ge})(),de={chips:y,directConnections:U.map(({schematicPortIds:ge,connKey:xe,...Ee})=>({...Ee,pinIds:ge})),netConnections:ie.map(({schematicPortIds:ge,connKey:xe,isSameSheetCrossSectionConnection:Ee,isPowerOrGroundConnection:Re,...Me})=>({...Me,pinIds:ge})),textBoxes:A,availableNetLabelOrientations:ue,maxMspPairDistance:e._parsedProps.schMaxTraceDistance??qyn},me=new Map(Array.from(se).flatMap(([ge,xe])=>{if(xe.size!==1)return[];return[[ge,xe.values().next().value]]}));return{inputProblem:de,routedSchematicPortIdBySchematicPortId:o,connKeyToSourceNet:l,userNetIdToConnKey:I,crossScopeSourceTraceIdBySchematicPortIdAndNetId:X,sourceTraceIdByPortOnlyLabelSchematicPortId:me,connKeysWithExplicitPortNetTraces:re,schematicPortIdsInScope:x,schematicPortIdsWithExternallyRoutedRepresentations:V,schPortIdToSourcePortId:C,netLabelsInScope:B,sourceTraceIdByPinPairKey:ne}}var _ci=(e,t)=>{let n=new Set;for(let o of e){let{inline:r,schX:i,schY:s}=o._parsedProps;if(r)continue;if(i===void 0&&s===void 0)continue;let a=o._getConnectedPorts();for(let c of a){if(!c.schematic_port_id)continue;n.add(t.get(K0(c.schematic_port_id))??K0(c.schematic_port_id))}}return n},gci=({solver:e})=>{let t=e.traceCleanupSolver?.getOutput().traces??e.traceLabelOverlapAvoidanceSolver?.getOutput().traces??e.schematicTraceLinesSolver?.solvedTracePaths??[],n=new Set;for(let o of t){let r=o?.tracePath;if(!Array.isArray(r)||r.length<2)continue;let i=Array.isArray(o.pins)?o.pins.map((s)=>s.pinId):o.pinIds;for(let s of i){let a=K0(s);if(a)n.add(a)}}return n},Jyn=0.5,fve=0.1,Zyn=(e)=>{let{nl:t,connKey:n,sourceNet:o,text:r}=e;if(o?.source_net_id&&t.source_net_id)return t.source_net_id===o.source_net_id;if(t.source_net_id)return t.source_net_id===n;return t.text===r},exn=({schematicPortIdsInScope:e,schematicPortIdsWithExternallyRoutedRepresentations:t,group:n,schPortIdToSourcePortId:o,connKeyToSourceNet:r})=>{let{db:i}=n.root,s=new Set(Array.from(e).map((a)=>o.get(a)).filter((a)=>a!==void 0));for(let a of e){if(t.has(a))continue;let c=i.schematic_port.get(a);if(!c)continue;if(c.is_connected)continue;let l=o.get(a);if(!l)continue;let h=i.source_port.get(l);if(n._parsedProps.showAsSchematicBox&&h?.subcircuit_id===n.subcircuit_id&&!h.source_component_id&&j7n({db:i,sourcePortId:l,sourcePortIdsInSchematicScope:s,schematicSheetId:c.schematic_sheet_id}))continue;let d=h?.subcircuit_connectivity_map_key;if(!d)continue;let u=r.get(d),_=c.schematic_component_id?i.schematic_component.get(c.schematic_component_id):void 0,p=_?.schematic_sheet_id??n._resolveSchematicSheetId(),m=Array.from(e).map((L)=>o.get(L)).filter((L)=>{if(!L)return!1;return i.source_port.get(L)?.subcircuit_connectivity_map_key===d}),{text:A,wasAssignedDisplayLabel:g,directConnectionOutsideSchematicScopeSourcePortId:f}=K7n({group:n,sourcePortId:l,connectedSourcePortIdsForKey:m,sourcePortIdsInSchematicScope:s,schematicSheetId:c.schematic_sheet_id,connKey:d,sourceNet:u}),x=f?i.schematic_port.list({source_port_id:f}).some((L)=>!L.is_connected):!1,C=_?.is_box_with_pins&&h&&!h.source_component_id,b=i.source_trace.list().some((L)=>L.connected_source_port_ids.includes(l)&&L.subcircuit_id!==h?.subcircuit_id),I=Boolean(u||g);if(C&&!b&&!I)continue;let v=Array.from(e).filter((L)=>{let H=o.get(L);if(!H)return!1;return i.source_port.get(H)?.subcircuit_connectivity_map_key===d}).length,P=u?.is_ground??!1,M=!P&&(u?.is_power??!1),B;if(P)B="top";else if(M)B="bottom";else B=jJ(c.facing_direction||"right")||"right";let T=FS({anchor_position:c.center,anchor_side:B,text:A}),N=i.schematic_net_label.list().find((L)=>{if(L.schematic_sheet_id!==p)return!1;return Zyn({nl:L,connKey:d,sourceNet:u,text:A})});if(N&&v<=1&&!x){i.schematic_net_label.update(N.schematic_net_label_id,{text:A,anchor_position:c.center,center:T,anchor_side:B});continue}if(N){let L=N.anchor_position.x-c.center.x,H=N.anchor_position.y-c.center.y;if(L*L+H*H<Jyn*Jyn){if(P){let U=N.anchor_side??B;i.schematic_net_label.update(N.schematic_net_label_id,{text:A,anchor_position:c.center,center:FS({anchor_position:c.center,anchor_side:U,text:A}),anchor_side:U})}else if(!M&&N.text===A){let U=N.anchor_side??B;i.schematic_net_label.update(N.schematic_net_label_id,{text:A,anchor_position:c.center,center:FS({anchor_position:c.center,anchor_side:U,text:A}),anchor_side:U})}continue}if(i.schematic_net_label.list().some((U)=>{if(U.schematic_sheet_id!==p)return!1;let j=U.anchor_position.x-c.center.x,Y=U.anchor_position.y-c.center.y;if(j*j+Y*Y>=fve*fve)return!1;return Zyn({nl:U,connKey:d,sourceNet:u,text:A})}))continue}if(!u&&!x)for(let L of i.schematic_net_label.list()){if(L.source_net_id!==d)continue;if(L.schematic_sheet_id!==p)continue;if(!m.some((V)=>{let O=Array.from(o.entries()).find(([,X])=>X===V)?.[0],U;if(O)U=i.schematic_port.get(O);if(!U?.center||!L.anchor_position)return!1;let j=L.anchor_position.x-U.center.x,Y=L.anchor_position.y-U.center.y;return j*j+Y*Y<fve*fve}))i.schematic_net_label.delete(L.schematic_net_label_id)}let D={text:A,source_net_id:u?.source_net_id??d,anchor_position:c.center,center:T,anchor_side:B,schematic_sheet_id:p};i.schematic_net_label.insert(D)}},Aci=F7n.default("Group_doInitialSchematicTraceRender"),txn=({group:e,schematicSheetId:t,netLabels:n})=>{let{inputProblem:o,routedSchematicPortIdBySchematicPortId:r,connKeyToSourceNet:i,schematicPortIdsInScope:s,schematicPortIdsWithExternallyRoutedRepresentations:a,schPortIdToSourcePortId:c,userNetIdToConnKey:l,crossScopeSourceTraceIdBySchematicPortIdAndNetId:h,sourceTraceIdByPortOnlyLabelSchematicPortId:d,connKeysWithExplicitPortNetTraces:u,netLabelsInScope:_,sourceTraceIdByPinPairKey:p}=mci(e,{schematicSheetId:t,netLabels:n});if(o.chips.length===0)return;let m=_ci(_,r);if(!(o.directConnections.length>0||o.netConnections.length>0)){exn({group:e,schematicPortIdsInScope:s,schematicPortIdsWithExternallyRoutedRepresentations:a,schPortIdToSourcePortId:c,connKeyToSourceNet:i});return}if(Aci.enabled)e.root?.emit("debug:logOutput",{type:"debug:logOutput",name:"group-trace-render-input-problem",content:JSON.stringify(o,null,2)});let g=new A7n(o),f=g.getConstructorParams();e.root?.emit("solver:started",{type:"solver:started",solverName:"SchematicTracePipelineSolver",solverParams:f[0],solverConstructorArgs:f,componentName:e.getString()}),g.solve();let y=gci({solver:g});nci({group:e,solver:g,userNetIdToConnKey:l,schematicPortIdsWithPreExistingNetLabels:m,schematicSheetId:t}),Uai({group:e,routedSchematicPortIdBySchematicPortId:r,solver:g,connKeyToSourceNet:i,userNetIdToConnKey:l,crossScopeSourceTraceIdBySchematicPortIdAndNetId:h,sourceTraceIdByPortOnlyLabelSchematicPortId:d,connKeysWithExplicitPortNetTraces:u,schematicPortIdsWithPreExistingNetLabels:m,schematicPortIdsWithRoutedTraces:y,netLabels:_}),Oai({group:e,solver:g,userNetIdToConnKey:l,sourceTraceIdByPinPairKey:p,crossScopeSourceTraceIdBySchematicPortIdAndNetId:h});let{db:x}=e.root;for(let[C,b]of r)if(x.schematic_port.get(b)?.is_connected)x.schematic_port.update(C,{is_connected:!0});exn({group:e,schematicPortIdsInScope:s,schematicPortIdsWithExternallyRoutedRepresentations:a,schPortIdToSourcePortId:c,connKeyToSourceNet:i})};var fci=(e)=>{if(!e.root?._featureMspSchematicTraceRouting)return;if(!e.isSubcircuit)return;if(e.root?.schematicDisabled)return;let t=new Set,n=e._getBoard(),o=e;while(o){if(o instanceof tP)for(let a of o.selectAll("netlabel"))t.add(a);if(o===n)break;o=o.parent}let r=[...t],i=new Set([e,...e.getDescendants().filter((a)=>a instanceof tP)].map((a)=>a.schematic_group_id).filter((a)=>Boolean(a))),s=new Set(e.root.db.schematic_component.list().filter((a)=>i.has(a.schematic_group_id)).map((a)=>a.schematic_sheet_id).filter((a)=>Boolean(a)));if(s.size===0){txn({group:e,netLabels:r});return}for(let a of s)txn({group:e,schematicSheetId:a,netLabels:r})};function yci(e){let t=[];for(let n of e.printStatements){let o=n.match(/^\.PRINT\s+TRAN\s+(.+)$/i);if(!o)continue;for(let r of o[1].match(/V\(([^)]+)\)/g)??[]){let i=r.slice(2,-1);t.push(i.replace(",","-"))}}return t}var nxn=["rgb(0, 150, 0)","rgb(0, 0, 220)","rgb(220, 0, 0)","rgb(0, 160, 160)","rgb(180, 0, 180)","rgb(170, 140, 0)","rgb(220, 120, 0)","rgb(128, 128, 128)","rgb(100, 0, 180)","rgb(140, 70, 0)","rgb(220, 80, 120)","rgb(0, 120, 220)","rgb(0, 120, 120)","rgb(120, 0, 0)","rgb(0, 0, 132)","rgb(80, 80, 80)"],Xve=new Map,jve=0;function xci(e){if(Xve.has(e))return Xve.get(e);let t=nxn[jve];return jve=(jve+1)%nxn.length,Xve.set(e,t),t}function Cci(){Xve.clear(),jve=0}var bci=()=>({async simulate(e){let{circuit:n,tran:o}=nun(e);return{simulationResultCircuitJson:oun(o,n,"spice-experiment-1")}}}),Jrt=(e)=>e.type==="simulation_transient_current_graph",q7n=(e)=>e.type==="simulation_dc_operating_point_current"||e.type==="simulation_dc_sweep_current_graph"||e.type==="simulation_ac_sweep_current_graph",J7n=(e)=>e.type==="simulation_dc_operating_point_voltage"||e.type==="simulation_dc_sweep_voltage_graph"||e.type==="simulation_ac_sweep_voltage_graph",Zrt=(e)=>e.type==="simulation_transient_voltage_graph",Ici=(e)=>Zrt(e)||Jrt(e)||J7n(e)||q7n(e),vci=({simulationResult:e,simulationParameterSweepCoordinate:t})=>{if(!t||!Ici(e))return e;let n={...e},o=`${n.type}_id`;return Reflect.deleteProperty(n,o),n.simulation_parameter_sweep_coordinate=t,n},Ynt=({circuitJson:e,sourceComponentId:t,isMatchingSourceComponent:n})=>{let o=e.find((r)=>n(r)&&r.source_component_id===t);if(!o)throw Error(`Parameter sweep target ${t} was not found`);return o},Sci=({circuitJson:e,parameterSweep:t,simulationParameterSweepCoordinate:n})=>{let o=structuredClone(e),r=n.parameter_value;if(t.parameter_type==="resistance"){let i=Ynt({circuitJson:o,sourceComponentId:t.resistor_source_component_id,isMatchingSourceComponent:(s)=>s.type==="source_component"&&s.ftype==="simple_resistor"});return i.resistance=r,o}if(t.parameter_type==="capacitance"){let i=Ynt({circuitJson:o,sourceComponentId:t.capacitor_source_component_id,isMatchingSourceComponent:(s)=>s.type==="source_component"&&s.ftype==="simple_capacitor"});return i.capacitance=r,o}if(t.parameter_type==="inductance"){let i=Ynt({circuitJson:o,sourceComponentId:t.inductor_source_component_id,isMatchingSourceComponent:(s)=>s.type==="source_component"&&s.ftype==="simple_inductor"});return i.inductance=r,o}if(t.parameter_type==="voltage"){let i=o.find((a)=>a.type==="source_net"&&a.name.toUpperCase()==="GND");if(!i||i.type!=="source_net")throw Error("A voltage parameter sweep requires a GND net");let s={type:"simulation_voltage_source",simulation_voltage_source_id:`simulation_voltage_source_${n.simulation_parameter_sweep_id}_${n.sweep_index}`,is_dc_source:!0,positive_source_net_id:t.source_net_id,negative_source_net_id:i.source_net_id,voltage:r};return o.push(s),o}if(t.parameter_type==="current"){let i=new Set(o.filter((a)=>a.type==="source_port"&&a.source_component_id===t.current_source_component_id).map((a)=>a.source_port_id)),s=o.find((a)=>a.type==="simulation_current_source"&&(a.is_dc_source?Boolean(a.positive_source_port_id&&i.has(a.positive_source_port_id)):Boolean(a.terminal1_source_port_id&&i.has(a.terminal1_source_port_id))));if(!s)throw Error(`Current sweep target ${t.current_source_component_id} has no simulation source`);return s.current=r,o}throw Error("Parameter sweep target is incomplete")},oxn=({circuitJson:e,simulationParameterSweepCoordinate:t})=>{let n=vun(e);return{spiceNetlist:n,spiceString:n.toSpiceString(),simulationParameterSweepCoordinate:t}},Pci=({circuitJson:e,simulationExperimentId:t})=>{let n=e.find((o)=>o.type==="simulation_parameter_sweep"&&o.simulation_experiment_id===t);if(!n)return[oxn({circuitJson:e})];return n.parameter_values.map((o,r)=>{let i={simulation_parameter_sweep_id:n.simulation_parameter_sweep_id,sweep_index:r,parameter_value:o,parameter_unit:n.parameter_unit};return oxn({circuitJson:Sci({circuitJson:e,parameterSweep:n,simulationParameterSweepCoordinate:i}),simulationParameterSweepCoordinate:i})})},Eci={p:0.000000000001,n:0.000000001,u:0.000001,µ:0.000001,m:0.001,"":1,k:1000,K:1000,M:1e6,G:1e9},kk=(e)=>{if(e===void 0)return;if(typeof e==="number")return e;let n=e.trim().match(/^([+-]?(?:\d+(?:\.\d*)?|\.\d+))\s*([pnumµkKMG]?)/);if(!n)return;let o=Number(n[1]);if(!Number.isFinite(o))return;return o*(Eci[n[2]??""]??1)},Mci=(e)=>{let{graphDisplayName:t,graphCenter:n,graphVerticalOffset:o,graphVoltagePerDiv:r}=e._parsedProps;return{displayName:t,color:e.color??void 0,center:n,verticalOffset:kk(o),valuePerDiv:kk(r)}},wci=(e)=>{let{color:t,graphDisplayName:n,graphCenter:o,graphVerticalOffset:r,graphCurrentPerDiv:i}=e._parsedProps;return{displayName:n,color:t,center:o,verticalOffset:kk(r),valuePerDiv:kk(i)}},Bci=(e)=>{let{POSITIVE_INFINITY:t,NEGATIVE_INFINITY:n}=Number;for(let o of e){if(!Number.isFinite(o))continue;t=Math.min(t,o),n=Math.max(n,o)}if(t===Number.POSITIVE_INFINITY||n===Number.NEGATIVE_INFINITY)return null;return{min:t,max:n}},Tci=(e)=>e.type==="simulation_transient_current_graph"?e.current_levels:e.voltage_levels,rxn=2,Dci=0.8,Nci=({graph:e,index:t,graphCount:n})=>{let o=Bci(Tci(e));if(!o)return null;let r=(o.min+o.max)/2,i=o.max-o.min,s=i>0?i/(rxn*Dci):Math.max(Math.abs(r)/10,Number.EPSILON);return{display_center_value:r,display_center_offset_divs:((n-1)/2-t)*rxn,value_per_div:s}},Rci=(e)=>e!==void 0,Qci=(e)=>{let t=new Map;for(let n of e)if(n.simulation_voltage_probe_id)t.set(n.simulation_voltage_probe_id,n);return t},kci=(e)=>{let t=new Map;for(let n of e)if(n.simulation_current_probe_id)t.set(n.simulation_current_probe_id,n);return t},Lci=({db:e,graphs:t,graphDisplayOverridesByProbeId:n})=>{if(t.length===0)return;let o=e.simulation_oscilloscope_trace.list(),r=Qci(o),i=kci(o),s=new Set(o.flatMap((a)=>[a.simulation_transient_voltage_graph_id,a.simulation_transient_current_graph_id]).filter(Rci));for(let[a,{type:c,graph:l}]of t.entries()){let h=Nci({graph:l,index:a,graphCount:t.length});if(!h)continue;let d=c==="voltage"?l.simulation_transient_voltage_graph_id:l.simulation_transient_current_graph_id;if(s.has(d))continue;let u=l.source_probe_id??void 0,_=u===void 0?void 0:c==="voltage"?r.get(u):i.get(u),p=u===void 0?void 0:n?.get(u),m=p?.valuePerDiv??h.value_per_div,A=p?.center??h.display_center_value,g=p?.verticalOffset!==void 0&&m!==0?p.verticalOffset/m:_?.display_center_offset_divs??h.display_center_offset_divs;e.simulation_oscilloscope_trace.insert({...c==="voltage"?{simulation_transient_voltage_graph_id:l.simulation_transient_voltage_graph_id,volts_per_div:m}:{simulation_transient_current_graph_id:l.simulation_transient_current_graph_id,amps_per_div:m},display_name:p?.displayName??_?.display_name,color:p?.color??_?.color??l.color,display_center_value:A,display_center_offset_divs:g})}},Hci=(e)=>Boolean(e&&typeof e==="object"&&"type"in e),x9=$7n.default("tscircuit:core:Group_doInitialSimulationSpiceEngineRender"),Fci=({circuitJson:e,simulationExperimentId:t,voltageProbes:n,ammeters:o})=>{let r=new Set(n.map((s)=>s.simulation_voltage_probe_id).filter((s)=>Boolean(s))),i=new Set(o.map((s)=>s.simulation_current_probe_id).filter((s)=>Boolean(s)));return e.filter((s)=>{if(s.type==="simulation_experiment")return s.simulation_experiment_id===t;if(s.type==="simulation_voltage_probe")return r.has(s.simulation_voltage_probe_id);if(s.type==="simulation_current_probe")return i.has(s.simulation_current_probe_id);if(s.type==="simulation_parameter_sweep")return s.simulation_experiment_id===t;if(s.type==="simulation_oscilloscope_trace"){if(s.simulation_voltage_probe_id)return r.has(s.simulation_voltage_probe_id);if(s.simulation_current_probe_id)return i.has(s.simulation_current_probe_id)}if(s.type==="simulation_transient_voltage_graph"||s.type==="simulation_transient_current_graph"||s.type==="simulation_dc_operating_point_voltage"||s.type==="simulation_dc_operating_point_current"||s.type==="simulation_dc_sweep_voltage_graph"||s.type==="simulation_dc_sweep_current_graph"||s.type==="simulation_ac_sweep_voltage_graph"||s.type==="simulation_ac_sweep_current_graph"||s.type==="simulation_unknown_experiment_error")return!1;return!0})};function zci(e){if(e.getInheritedProperty("analogSimulationDisabled"))return;if(!e.isSubcircuit)return;let{root:t}=e;if(!t)return;let n=[...e.selectAll("analogsimulation"),...e.selectAll("analogtransientsimulation"),...e.selectAll("analogdcoperatingpointsimulation"),...e.selectAll("analogdcsweepsimulation"),...e.selectAll("analogacsweepsimulation")];if(n.length===0)return;Cci();let o={...t.platform?.spiceEngineMap};if(!o.spicey)o.spicey=bci();for(let r of n){let i=r.simulation_experiment_id;if(!i){x9("No simulation experiment id found, skipping simulation");continue}let s=t.db.simulation_experiment.get(i);if(!s){x9("No simulation experiment found, skipping simulation");continue}let a=r.getGroup()??e,c=a.selectAll("voltageprobe"),l=a.selectAll("ammeter"),h=Fci({circuitJson:t.db.toArray(),simulationExperimentId:i,voltageProbes:c,ammeters:l}),d;try{d=Pci({circuitJson:h,simulationExperimentId:i}),x9(`Generated ${d.length} SPICE run(s):
${d.map((v)=>v.spiceString).join(`
`)}`)}catch(v){x9(`Failed to convert circuit JSON to SPICE: ${v}`),t.db.simulation_unknown_experiment_error.insert({simulation_experiment_id:i,error_type:"simulation_unknown_experiment_error",message:v instanceof Error?v.message:String(v)});continue}let u=new Map,_=new Map,p=new Map;for(let v of c){if(v.finalProbeName)u.set(v.finalProbeName,v);if(v.simulation_voltage_probe_id)_.set(v.simulation_voltage_probe_id,v),p.set(v.simulation_voltage_probe_id,Mci(v))}for(let v of l)if(v.simulation_current_probe_id)p.set(v.simulation_current_probe_id,wci(v));let m=new Set(l.map((v)=>v.simulation_current_probe_id).filter((v)=>Boolean(v))),A=new Map,g=new Map;for(let v of t.db.simulation_current_probe.list().filter((P)=>m.has(P.simulation_current_probe_id)))if(A.set(v.simulation_current_probe_id,v),v.name!==void 0)g.set(v.name,v);let f=t.db.simulation_voltage_probe.list().filter((v)=>_.has(v.simulation_voltage_probe_id)),y=d[0]?.spiceNetlist,x=y?yci(y):[];if(x.length===f.length)for(let[v,P]of f.entries()){let M=_.get(P.simulation_voltage_probe_id),B=x[v];if(M&&B)u.set(B,M)}else x9(`Skipping probe-to-graph order mapping because counts differ: probes=${f.length} graphNames=${x.length}`);let C=r.getSpiceEngineName()??"spicey",b=o[C];if(!b)throw Error(`SPICE engine "${C}" not found in platform config. Available engines: ${JSON.stringify(Object.keys(o).filter((v)=>v!=="spicey"))}`);let I=`spice-simulation-${C}-${i}`;x9(`Queueing simulation for spice engine: ${C} (id: ${I})`),e._queueAsyncEffect(I,async()=>{try{let v=[],P=[];for(let M of d){x9(`Running simulation with engine: ${C}`);let B=await b.simulate(M.spiceString);x9(`Simulation completed, received ${B.simulationResultCircuitJson.length} elements`);for(let T of B.simulationResultCircuitJson){if(!Hci(T)){x9("Skipping invalid simulation result element");continue}let N=vci({simulationResult:T,simulationParameterSweepCoordinate:M.simulationParameterSweepCoordinate});if(Zrt(N)){N.simulation_experiment_id=s.simulation_experiment_id;let L=N.name?u.get(N.name):void 0;if(L)N.color=L.color??void 0,N.source_probe_id=L.simulation_voltage_probe_id??void 0}else if(J7n(N)){N.simulation_experiment_id=s.simulation_experiment_id;let L=_.get(N.simulation_voltage_probe_id)??(N.name?u.get(N.name):void 0);if(L?.simulation_voltage_probe_id)N.color=L.color??void 0,N.simulation_voltage_probe_id=L.simulation_voltage_probe_id}if(Jrt(N)){N.simulation_experiment_id=s.simulation_experiment_id;let L=(N.source_probe_id?A.get(N.source_probe_id):void 0)??(N.name?g.get(N.name):void 0);if(L)N.color=L.color,N.source_probe_id=L.simulation_current_probe_id}else if(q7n(N)){N.simulation_experiment_id=s.simulation_experiment_id;let L=A.get(N.simulation_current_probe_id)??(N.name?g.get(N.name):void 0);if(L)N.color=L.color,N.simulation_current_probe_id=L.simulation_current_probe_id}let D=t.db.insert(N);if(Zrt(D))v.push({type:"voltage",graph:D});if(Jrt(D))P.push({type:"current",graph:D});x9(`Inserted ${N.type} into database`)}}if(r.usesIndependentGraphAxes())Lci({db:t.db,graphs:[...v,...P],graphDisplayOverridesByProbeId:p});e._markDirty("SimulationSpiceEngineRender")}catch(v){x9(`Simulation failed for engine ${C}: ${v}`),t.db.simulation_unknown_experiment_error.insert({simulation_experiment_id:i,error_type:"simulation_unknown_experiment_error",message:v instanceof Error?v.message:String(v)})}})}}function Oci(e){if(!e.isSubcircuit)return;let{db:t}=e.root,n=e.selectAll("trace"),o=e.selectAll("via"),r=e.selectAll("net"),i=new fx({});i.addConnections(n.map((h)=>{let d=t.source_trace.get(h.source_trace_id);if(!d)return null;return[d.source_trace_id,...d.connected_source_port_ids,...d.connected_source_net_ids]}).filter((h)=>h!==null));let s=t.source_net.list().filter((h)=>h.subcircuit_id===e.subcircuit_id);for(let h of s)i.addConnections([[h.source_net_id]]);let{name:a}=e._parsedProps;for(let h of n){if(!h.source_trace_id)continue;let d=i.getNetConnectedToId(h.source_trace_id);if(!d)continue;h.subcircuit_connectivity_map_key=`${a??`unnamedsubcircuit${e.subcircuit_id??e.source_group_id??e._renderId}`}_${d}`,t.source_trace.update(h.source_trace_id,{subcircuit_connectivity_map_key:h.subcircuit_connectivity_map_key})}let c=new Set;for(let h of n){if(!h.source_trace_id)continue;let d=t.source_trace.get(h.source_trace_id);if(!d)continue;for(let u of d.connected_source_port_ids)c.add(u)}for(let h of c){let d=i.getNetConnectedToId(h);if(!d)continue;let u=`${a??`unnamedsubcircuit${e.subcircuit_id??e.source_group_id??e._renderId}`}_${d}`;t.source_port.update(h,{subcircuit_connectivity_map_key:u})}let l=new Set;for(let h of n){if(!h.source_trace_id)continue;let d=t.source_trace.get(h.source_trace_id);if(!d)continue;for(let u of d.connected_source_net_ids)l.add(u)}for(let h of s)l.add(h.source_net_id);for(let h of l){let d=i.getNetConnectedToId(h);if(!d)continue;let u=`${a??`unnamedsubcircuit${e.subcircuit_id??e.source_group_id??e._renderId}`}_${d}`;t.source_net.update(h,{subcircuit_connectivity_map_key:u});let _=r.find((p)=>p.source_net_id===h);if(_)_.subcircuit_connectivity_map_key=u}for(let h of o){let d=h._getConnectedNetOrTrace();if(!d)continue;if(d.subcircuit_connectivity_map_key)h.subcircuit_connectivity_map_key=d.subcircuit_connectivity_map_key}}var Vci=(e)=>{let t=e.root?.firstChild===e;if(!e.isSubcircuit||!t||e._getBoard())return;let n=e.root?.pcbRoutingDisabled||e.getInheritedProperty("routingDisabled"),o=e.root?.platform?.drcChecksDisabled??e.getInheritedProperty("drcChecksDisabled"),r=e.root?.platform?.routingDrcChecksDisabled??e.getInheritedProperty("routingDrcChecksDisabled");if(e.root?.pcbDisabled||n||o||r)return;if(e._hasIncompleteAsyncEffectsInSubtreeForPhase("PcbTraceRender"))return;if(e._hasTracesToRoute()&&!e._areChildSubcircuitsRouted())return;if(e._standaloneSubcircuitDrcChecksComplete||e._standaloneSubcircuitDrcChecksInProgress)return;let{db:i}=e.root,s=i.subtree({subcircuit_id:e.subcircuit_id}).toArray();e._standaloneSubcircuitDrcChecksInProgress=!0,e._queueAsyncEffect("standalone-subcircuit:routing-drc-checks",async()=>{try{let a=await n5e(s);i.insertAll(Zxe(a)),e._standaloneSubcircuitDrcChecksComplete=!0}finally{e._standaloneSubcircuitDrcChecksInProgress=!1}})},ixn=(e,t)=>{for(let[n,o]of Object.entries(t)){if(!o)continue;let r=Array.isArray(o)?o:[o],i=e.get(n)??new Set;for(let s of r)i.add(s);e.set(n,i)}},sxn=(e)=>Object.fromEntries(Array.from(e,([t,n])=>[t,n.size===1?Array.from(n)[0]:Array.from(n)])),Yci=(e,t)=>{let n=t.map((i)=>i.fanoutPourNetMap).filter((i)=>i!==void 0),o=new Map;if(n.length>0){for(let i of n)ixn(o,i);return sxn(o)}let r=e;while(r){if(r.isSubcircuit){let i=r,s=i.selectAll("copperpour");for(let a of s){if(a.getSubcircuit()!==i)continue;let{layer:c,connectsTo:l}=a._parsedProps;ixn(o,{[c]:l})}}r=r.parent}return o.size>0?sxn(o):void 0},Gci=ws.omit({pcbRotation:!0,layer:!0}),Z7n=class extends nr{pcb_breakout_point_id=null;matchedPort=null;matchedNet=null;matchedSourceTraceId=null;isPcbPrimitive=!0;_getSourceTraceIdForPort(e){let{db:t}=this.root;return t.source_trace.list().find((o)=>o.connected_source_port_ids.includes(e.source_port_id))?.source_trace_id}_getSourceNetIdForPort(e){let{db:t}=this.root;return t.source_trace.list().find((o)=>o.connected_source_port_ids.includes(e.source_port_id))?.connected_source_net_ids[0]}_renderPcbBreakoutPoint({layer:e}={}){if(this.pcb_breakout_point_id)return;if(this.root?.pcbDisabled)return;let{db:t}=this.root,n=this._getGlobalPcbPositionBeforeLayout(),o=this.parent?.getGroup(),r=this.getSubcircuit();if(!o||!o.pcb_group_id)return;let i=t.pcb_breakout_point.insert({pcb_group_id:o.pcb_group_id,subcircuit_id:r?.subcircuit_id??void 0,source_port_id:this.matchedPort?.source_port_id??void 0,source_trace_id:this.matchedPort?this.matchedSourceTraceId??this._getSourceTraceIdForPort(this.matchedPort):void 0,source_net_id:this.matchedNet?this.matchedNet.source_net_id:this.matchedPort?this._getSourceNetIdForPort(this.matchedPort):void 0,layer:e,x:n.x,y:n.y});this.pcb_breakout_point_id=i.pcb_breakout_point_id}_getPcbCircuitJsonBounds(){let e=this._getGlobalPcbPositionBeforeLayout();return{center:{x:e.x,y:e.y},bounds:{left:e.x,top:e.y,right:e.x,bottom:e.y},width:0,height:0}}_setPositionFromLayout(e){let{db:t}=this.root;if(!this.pcb_breakout_point_id)return;let n={x:e.x,y:e.y};if(this.matchedSourceTraceId)n.source_trace_id=this.matchedSourceTraceId;t.pcb_breakout_point.update(this.pcb_breakout_point_id,n)}_moveCircuitJsonElements({deltaX:e,deltaY:t}){if(this.root?.pcbDisabled)return;let{db:n}=this.root;if(!this.pcb_breakout_point_id)return;let o=n.pcb_breakout_point.get(this.pcb_breakout_point_id);if(o)n.pcb_breakout_point.update(this.pcb_breakout_point_id,{x:o.x+e,y:o.y+t})}getPcbSize(){return{width:0,height:0}}},kY=class extends Z7n{get config(){return{componentName:"BreakoutPoint",zodProps:VDt}}_matchConnection(){if(this.matchedPort)return;let{connection:e}=this._parsedProps,t=this.getSubcircuit();if(!t)return;if(this.matchedPort=t.selectOne(e,{type:"port"}),!this.matchedPort)this.matchedNet=t.selectOne(e,{type:"net"});if(!this.matchedPort&&!this.matchedNet)this.renderError(`Could not find connection target "${e}"`)}doInitialPcbPrimitiveRender(){this._matchConnection(),this._renderPcbBreakoutPoint()}},eSn=class extends kY{exitLayer="top";doInitialPcbPrimitiveRender(){this._matchConnection(),this._renderPcbBreakoutPoint({layer:this.exitLayer})}};function Uci(e,t){let{db:n}=e.root,o=HY(t.layerCount),r=new Set,i=e.children.filter((c)=>c instanceof eSn),s=(e._parsedProps.pcbTracePaths??[]).map((c,l)=>{for(let M of c.route)if((M.route_type==="wire"?[M.layer]:[M.from_layer,M.to_layer]).some((T)=>!o.includes(T)))throw Error(`Saved fanout path "${c.connection}" uses a layer unavailable on this board`);let h=i[l],d=h.matchedPort,u=t.connections.find((M)=>M.pointsToConnect.some((B)=>B.pcb_port_id===d.pcb_port_id));if(!u)throw Error(`No fanout connection for saved path "${c.connection}"`);let _=n.pcb_breakout_point.get(h.pcb_breakout_point_id),p=c.route.at(-1),m=QY.compose(h._computePcbGlobalTransformBeforeLayout(),QY.translate(-p.x,-p.y)),A=QY.applyToPoint(m,p),g=A5n(c.route).map((M)=>{let B=QY.applyToPoint(m,M);return{...M,x:B.x+_.x-A.x,y:B.y+_.y-A.y}}),f=g[0],y=f.route_type==="wire"?f.layer:f.from_layer,x=d._getGlobalPcbPositionAfterLayout();if(Math.hypot(f.x-x.x,f.y-x.y)>0.0001||!d.getAvailablePcbLayers().includes(y))throw Error(`Saved fanout path "${c.connection}" must start at its PCB port on an available layer`);if(f.route_type==="via"&&!t.allowViaInPad)throw Error(`Saved fanout path "${c.connection}" starts with a via at a pad; enable allowViaInPad`);let C=g.at(-1),b=C.route_type==="wire"?C.layer:C.to_layer,I=[{...f,layer:y},{...C,layer:b}];if(u.pointsToConnect.some((M)=>!I.some((B)=>Math.hypot(M.x-B.x,M.y-B.y)<0.0001&&M.layer===B.layer)))throw Error(`Saved fanout path "${c.connection}" does not cover its connection endpoints`);let v=Tde(g,0,t.minTraceWidth),P=Tde(g,g.length-1,t.minTraceWidth);if(f.route_type==="via")g.splice(1,0,{route_type:"wire",x:f.x,y:f.y,layer:f.to_layer,width:v.toWidth}),g.unshift({route_type:"wire",x:f.x,y:f.y,layer:f.from_layer,width:v.fromWidth});if(C.route_type==="via")g.splice(g.length-1,0,{route_type:"wire",x:C.x,y:C.y,layer:C.from_layer,width:P.fromWidth}),g.push({route_type:"wire",x:C.x,y:C.y,layer:C.to_layer,width:P.toWidth});if(C.route_type==="via")g.push({route_type:"wire",x:C.x,y:C.y,layer:C.to_layer,width:P.toWidth});return r.add(u),{type:"pcb_trace",pcb_trace_id:`saved_fanout_${e.pcb_group_id}_${l}`,connection_name:u.name,source_trace_id:u.source_trace_id,connectsTo:[u.source_trace_id,...u.pointsToConnect.map((M)=>M.pointId)].filter((M)=>Boolean(M)),route:g}}),a=t.connections.filter((c)=>!r.has(c));if(a.length)throw Error(`pcbTracePaths must cover every fanout connection; missing: ${a.map((c)=>c.name).join(", ")}`);return s}function axn(e){return e===null?Number.POSITIVE_INFINITY:e}function Wci(e,t){return axn(e.routingPhaseIndex)-axn(t.routingPhaseIndex)}function yve(e,t){let n=e.get(t);if(!n)n={routingPhaseIndex:t,nets:[],traces:[]},e.set(t,n);return n}function tSn(e){return e.props.routingPhaseIndex??null}function Xci(e,t=[]){let n=new Set;for(let a of t){if(a._parsedProps.routingPhaseIndex===void 0)continue;if(a._parsedProps.connections.some((l)=>l===e.name||Nat(e,X8e(l))))n.add(a._parsedProps.routingPhaseIndex)}if(n.size>1)throw Error(`Trace "${e.name}" belongs to buses with different routing phases`);let o=n.values().next().value;if(o!==void 0)return o;let r=e.props.routingPhaseIndex;if(r!==void 0)return r;let i=null,s=e._findConnectedNets().nets;for(let a of s){let c=tSn(a);if(typeof c==="number"){if(i===null||c<i)i=c}}return i}function X8e(e){return e.trim().replace(/\s*>\s*/g,".").replace(/\s+/g,".").replace(/^\./,"").replace(/\.\./g,".")}function ade(e){if(e.connection===void 0&&e.connections===void 0)return e.pcbTracePaths?.map((t)=>t.connection)??[];return[...e.connection?[e.connection]:[],...e.connections??[]]}function Nat(e,t){let n=X8e(t);if(e.getTracePortPathSelectors().some((r)=>X8e(r)===n))return!0;let o=e.getSubcircuit().selectOne(t,{type:"port"});return o!==null&&(e._findConnectedPorts().ports?.includes(o)??!1)}function jci(e,t,n){let o=new Set,r=n.name??"unnamed phase";for(let i of ade(n)){let s=i.trim(),a=s.startsWith("trace."),c=a?e.selectAll(s).filter((d)=>t.includes(d)):t.filter((d)=>d.name===s),l=a?[]:t.filter((d)=>Nat(d,s));if(c.length>1||c.length>0&&l.length>0)throw Error(`Autorouting phase "${r}": connection "${i}" is ambiguous. Use a unique trace name qualified as "trace.DDR_D0" or a port such as ".U1 > .A1".`);let h=c.length>0?c:l;if(h.length===0)throw Error(`Autorouting phase "${r}": connection "${i}" matched no trace or endpoint. Use a trace name such as "DDR_D0" or a port such as ".U1 > .A1".`);for(let d of h)o.add(d)}return o}function Kci(e){let t=e.selectAll("autoroutingphase"),n=new Map;for(let o of t){let{phaseIndex:r,autorouter:i}=o._parsedProps;if(i===void 0)continue;n.set(r??null,i)}return n}function $ci(e){let t=e.selectAll("autoroutingphase"),n=new Map;for(let o of t){let r=o._parsedProps;n.set(r.phaseIndex??null,r)}return n}function CS(e){if(e===void 0)return;return Number(e)}function qci(e){let{minTraceWidth:t,minViaHoleEdgeToViaHoleEdgeClearance:n,minPlatedHoleDrillEdgeToDrillEdgeClearance:o,minTraceToPadEdgeClearance:r,minTraceToHoleEdgeClearance:i,minPadEdgeToPadEdgeClearance:s,minBoardEdgeClearance:a,minViaEdgeToPadEdgeClearance:c,minViaHoleDiameter:l,minViaPadDiameter:h}=e;if(t===void 0&&n===void 0&&o===void 0&&r===void 0&&i===void 0&&s===void 0&&a===void 0&&c===void 0&&l===void 0&&h===void 0)return;return{minTraceWidth:CS(t),minViaHoleEdgeToViaHoleEdgeClearance:CS(n),minPlatedHoleDrillEdgeToDrillEdgeClearance:CS(o),minTraceToPadEdgeClearance:CS(r),minTraceToHoleEdgeClearance:CS(i),minPadEdgeToPadEdgeClearance:CS(s),minBoardEdgeClearance:CS(a),minViaEdgeToPadEdgeClearance:CS(c),minViaHoleDiameter:CS(l),minViaPadDiameter:CS(h)}}function Jci(e){let t=e.selectAll("trace"),n=e.selectAll("net"),o=e.selectAll("bus"),r=e.selectAll("group").filter((x)=>x.isRoutingDirective),i=new Map,s=new Map;for(let x of t){let C=x.parent;while(C&&C!==e){if(C.isRoutingDirective){i.set(x,C);break}C=C.parent}}for(let x of n)if(x.parent?.isRoutingDirective&&r.includes(x.parent))s.set(x,x.parent);let a=new Map,c=Kci(e),l=$ci(e),h=new Map(Array.from(l,([x,C])=>[x,jci(e,t,C)])),d=e._parsedProps,u=e.getInheritedProperty("routeRemaining")!==!1,_=l.get(null),p=u||_!==void 0&&!_.reroute&&ade(_).length===0,m=t.length>0||n.length>0,A=Array.from(l.values()).some((x)=>x.reroute),g=Array.from(l.values()).some((x)=>ade(x).length>0);if(!m&&!A&&!g&&r.length===0)return[];for(let x of n){if(s.has(x))continue;let C=tSn(x);if(C===null&&!p)continue;yve(a,C).nets.push(x)}for(let x of t){if(i.has(x))continue;let C=Xci(x,o);if(C===null&&!p)continue;yve(a,C).traces.push(x)}for(let[x,C]of l){let b=ade(C);if(b.length>0){let I=yve(a,x);I.connectionSelectors=b;for(let v of t){if(i.has(v))continue;if(h.get(x).has(v)){if(!C.reroute)for(let P of a.values()){if(P===I)continue;P.traces=P.traces.filter((M)=>M!==v)}if(I.traces.includes(v))continue;I.traces.push(v)}}}if(C.reroute||C.pcbTracePaths!==void 0)yve(a,x)}let f=Array.from(a.values()).sort(Wci);for(let x of f){x.autorouter=c.get(x.routingPhaseIndex);let C=l.get(x.routingPhaseIndex);x.algorithmFn=C?.algorithmFn,x.isImplicitRemainingPhase=x.routingPhaseIndex===null&&C===void 0,x.phaseName=C?.name,x.reroute=C?.reroute,x.region=C?.region,x.connectionSelectors=C?ade(C):void 0,x.busFanoutDirections=C?.busFanoutDirections??d.busFanoutDirections,x.fanoutBoundaryPadding=C?.fanoutBoundaryPadding??d.fanoutBoundaryPadding;let b=C?.fanoutRoutingLayers??d.fanoutRoutingLayers;x.fanoutRoutingLayers=b?.map((I)=>typeof I==="string"?I:I.name),x.fanoutPourNetMap=C?.fanoutPourNetMap??d.fanoutPourNetMap,x.drcTolerances=C?qci(C):void 0}for(let x of e.selectAll("autoroutingphase")){let C=a.get(x._parsedProps.phaseIndex??null);if(!C)continue;if(C.autoroutingPhase=x,x._parsedProps.pcbTracePaths===void 0)continue;let b=C.autorouter!==void 0?fde(C.autorouter,e.root?.platform):e._getAutorouterConfig(),I=["fanout","single_layer_fanout"].includes(b.preset??"");C.getPrecomputedRoutingResult=(v)=>PLr(x,v,I)}let y=[];for(let x of r){let C=x._parsedProps,I=x.children.some((U)=>U instanceof kY)&&x.props.autorouter===void 0,v=t.filter((U)=>i.get(U)===x),P=v.filter((U)=>!U.pcb_trace_id),M=x.pcb_group_id?x.root?.db.pcb_group.get(x.pcb_group_id):null,B=M?.outline?Ms(M.outline):null,T=M?.width??(B?B.maxX-B.minX:void 0),N=M?.height??(B?B.maxY-B.minY:void 0),D=M&&T&&N?{minX:M.center.x-T/2,maxX:M.center.x+T/2,minY:M.center.y-N/2,maxY:M.center.y+N/2}:void 0,L=x.props,H=L.width!==void 0||L.height!==void 0||Boolean(L.outline?.length),V=L.fanoutBoundaryPadding!==void 0,O={routingPhaseIndex:null,routingPcbGroupId:x.pcb_group_id??void 0,fanoutRegionPcbGroupId:x.pcb_group_id??void 0,routingBounds:D,fanoutBounds:H?D:V?void 0:D,autorouter:C.autorouter??"fanout",busFanoutDirections:C.busFanoutDirections,fanoutBoundaryPadding:C.fanoutBoundaryPadding,fanoutRoutingLayers:C.fanoutRoutingLayers?.map((U)=>typeof U==="string"?U:U.name),fanoutPourNetMap:C.fanoutPourNetMap,nets:n.filter((U)=>s.get(U)===x),traces:v};if(x.isDogboneFanout&&C.pcbTracePaths===void 0){y.push({...O,routingBounds:void 0,fanoutBounds:D});continue}if(x._parsedProps.pcbTracePaths!==void 0){y.push({...O,autorouter:{local:!0,groupMode:"subcircuit",allowViaInPad:(typeof C.autorouter==="object"?C.autorouter.allowViaInPad:void 0)??e._getAutorouterConfig().allowViaInPad},getPrecomputedRoutingResult:(U)=>({traces:Uci(x,U)})});continue}if(!I){y.push(O);continue}if(y.push({...O,autorouter:"default",traces:[]}),P.length>0){let U=new Set(o.filter((Y)=>P.some((X)=>Y._parsedProps.connections.some((K)=>K===X.name||Nat(X,X8e(K))))).map((Y)=>Y.name));for(let Y of P)if(Y.name)U.add(Y.name);let j=C.busFanoutDirections?Object.fromEntries(Object.entries(C.busFanoutDirections).filter(([Y])=>U.has(Y))):void 0;y.push({...O,routingPcbGroupId:void 0,busFanoutDirections:j,traces:P})}}if(u&&m&&l.size===1&&_?.reroute&&f.length===1&&f[0]?.routingPhaseIndex===null){let x=f[0];return[...y,{routingPhaseIndex:null,isImplicitRemainingPhase:!0,nets:[...x.nets],traces:[...x.traces]},x]}return[...y,...f]}var nSn=class extends Error{},oSn={name:"@tscircuit/core",type:"module",version:"0.0.2179",types:"dist/index.d.ts",main:"dist/index.js",module:"dist/index.js",exports:{".":{import:"./dist/index.js",types:"./dist/index.d.ts"}},files:["dist"],repository:{type:"git",url:"https://github.com/tscircuit/core"},scripts:{build:"tsup-node",format:"biome format . --write","measure-bundle":"howfat -r table .","pkg-pr-new-release":"bunx pkg-pr-new publish --comment=off --peerDeps","smoke-test:dist":"bun run scripts/smoke-tests/test-dist-simple-circuit.tsx && bun run scripts/smoke-tests/check-dist-bundled-schematic-solver.ts","build:benchmarking":"bun build --experimental-html ./benchmarking/website/index.html --outdir ./benchmarking-dist","build:benchmarking:watch":`chokidar "./{benchmarking,lib}/**/*.{ts,tsx}" -c 'bun build --experimental-html ./benchmarking/website/index.html --outdir ./benchmarking-dist'`,"start:benchmarking":'concurrently "bun run build:benchmarking:watch" "live-server ./benchmarking-dist"',"generate-test-plan":"bun run scripts/generate-test-plan.ts"},devDependencies:{"@biomejs/biome":"^1.8.3","@jscad/modeling":"^2.13.0","@resvg/resvg-js":"^2.6.2","@tsci/tscircuit.ti":"github:tscircuit/ti#57e314be4b2b06bc546d4def7453e619604d1157","@tscircuit/alphabet":"0.0.25","@tscircuit/bga-fanout-solver":"github:tscircuit/bga-fanout-solver#247c835cb8d69b65e53891dcf869731079415b39","@tscircuit/bus-lanes-solver":"https://jscdn.tscircuit.com/@tscircuit/bus-lanes-solver/0.0.21.tgz","@tscircuit/cableprinter":"^0.0.6","@tscircuit/capacity-autorouter":"^0.0.988","@tscircuit/checks":"^0.0.258","@tscircuit/circuit-json-util":"^0.0.123","@tscircuit/common":"^0.0.20","@tscircuit/copper-pour-solver":"^0.0.67","@tscircuit/create-fdm-enclosure":"0.0.4","@tscircuit/dogbone-solver":"https://jscdn.tscircuit.com/@tscircuit/dogbone-solver/0.0.1.tgz","@tscircuit/fanout-solver":"0.0.81","@tscircuit/flex-utils":"https://jscdn.tscircuit.com/@tscircuit/flex-utils/0.0.8.tgz","@tscircuit/footprinter":"^0.0.442","@tscircuit/image-utils":"^0.0.8","@tscircuit/implicit-copper-pour-solver":"github:tscircuit/implicit-copper-pour-solver#a5cbbda0cd65fd4707c5c1af25779837c25aba92","@tscircuit/infer-cable-insertion-point":"^0.0.4","@tscircuit/infgrid-ijump-astar":"^0.0.35","@tscircuit/jlcpcb-manufacturing-specs":"git+https://github.com/tscircuit/jlcpcb-manufacturing-specs#23260504fceffff2d64bf11720f74e974d1d9321","@tscircuit/krt-wasm":"^0.1.1","@tscircuit/log-soup":"^1.0.2","@tscircuit/matchpack":"^0.0.97","@tscircuit/math-utils":"^0.0.36","@tscircuit/miniflex":"^0.0.4","@tscircuit/modelprinter":"^0.0.18","@tscircuit/ngspice-spice-engine":"^0.0.20","@tscircuit/props":"^0.0.704","@tscircuit/schematic-match-adapt":"^0.0.18","@tscircuit/schematic-trace-solver":"https://jscdn.tscircuit.com/@tscircuit/schematic-trace-solver/0.0.230.tgz","@tscircuit/solver-utils":"^0.0.16","@tscircuit/soup-util":"^0.0.41","@tscircuit/via-stitch-solver":"github:tscircuit/via-stitch-solver#64f2ac7781b795bdc0d74ba411988e60767fa653","@tscircuit/winding-breakout-point-solver":"github:tscircuit/winding-breakout-point-solver#202dbe9eb0088633b6fa094120dba6f2f41f8803","@types/bun":"^1.2.16","@types/debug":"^4.1.12","@types/react":"^19.1.8","@types/react-dom":"^19.1.6","@types/react-reconciler":"^0.28.9","bpc-graph":"^0.0.57","bun-match-svg":"0.0.12","calculate-elbow":"^0.0.12","chokidar-cli":"^3.0.0","circuit-json":"^0.0.528","circuit-json-to-bpc":"^0.0.13","circuit-json-to-connectivity-map":"^0.0.33","circuit-json-to-gltf":"^0.0.151","circuit-json-to-spice":"^0.0.45","circuit-to-svg":"^0.0.450",concurrently:"^9.1.2","connectivity-map":"^1.0.1",debug:"^4.3.6",flatbush:"^4.5.0","graphics-debug":"^0.0.95",howfat:"^0.3.8","kicad-to-circuit-json":"^0.0.142",kicadts:"^0.0.53","live-server":"^1.2.2",minicssgrid:"^0.0.9","pkg-pr-new":"^0.0.37",poppygl:"0.0.34",react:"^19.1.0","react-dom":"^19.1.0","schematic-symbols":"^0.0.248",spicets:"^0.0.4",spicey:"^0.0.14","stack-svgs":"^0.0.1","ts-expect":"^1.3.0",tsup:"^8.2.4"},peerDependencies:{"@tscircuit/capacity-autorouter":"*","@tscircuit/checks":"*","@tscircuit/circuit-json-util":"*","@tscircuit/create-fdm-enclosure":"*","@tscircuit/footprinter":"*","@tscircuit/infgrid-ijump-astar":"*","@tscircuit/math-utils":"*","@tscircuit/modelprinter":"*","@tscircuit/props":"*","@tscircuit/schematic-match-adapt":"*","circuit-json-to-bpc":"*","bpc-graph":"*","@tscircuit/matchpack":"*","circuit-json":"*","circuit-json-to-connectivity-map":"*","circuit-json-to-spice":"*","schematic-symbols":"*",spicets:"*",typescript:"^5.0.0","@tscircuit/cableprinter":"*"},dependencies:{"@flatten-js/core":"^1.6.2","@lume/kiwi":"^0.4.3","calculate-cell-boundaries":"^0.0.25","calculate-packing":"^0.0.90","css-select":"5.1.0","format-si-unit":"^0.0.12","gl-matrix":"^3.4.4",nanoid:"^5.0.7","performance-now":"^2.1.0","react-reconciler":"^0.32.0","svg-path-commander":"^2.1.11","transformation-matrix":"^2.16.1",zod:"^3.25.67","jscad-planner":"^0.0.18","jscad-fiber":"^0.0.88"},overrides:{"@tscircuit/props":"^0.0.704","circuit-json":"^0.0.528","@tscircuit/cableprinter":"^0.0.6"}},cxn=(e)=>{let t=2166136261;for(let n=0;n<e.length;n++)t^=e.charCodeAt(n),t=Math.imul(t,16777619);return t>>>0},lxn=(e)=>{let t=JSON.stringify(e),n=cxn(t),o=cxn(`${t}${n}`);return`${n.toString(16).padStart(8,"0")}${o.toString(16).padStart(8,"0")}`},Zci=(e,t)=>`routes:core@${oSn.version}:solver:${lxn(t)}:srj:${lxn(e)}`,eli=async({cacheEngine:e,cacheKey:t})=>{if(!e)return null;try{let n=await e.getItem(t);if(!n)return null;let o=JSON.parse(n);if(!o||!Array.isArray(o.traces))return null;return o}catch{return null}},tli=async({cacheEngine:e,cacheKey:t,result:n})=>{if(!e)return;try{await e.setItem(t,JSON.stringify(n))}catch{}},hxn=0.000001,rSn=(e,t)=>e.pointId!==void 0&&t.pointId!==void 0&&e.pointId===t.pointId,iSn=(e,t)=>Math.abs(e.x-t.x)<=hxn&&Math.abs(e.y-t.y)<=hxn&&e.layer===t.layer,Aue=(e,t)=>e.pointId!==void 0&&t.pointId!==void 0?rSn(e,t):iSn(e,t),nli=(e,t)=>{let n=e.connections.find((r)=>r.routingPcbGroupId!==t.routingPcbGroupId&&r.source_trace_id===t.source_trace_id&&r.pointsToConnect.some((i)=>t.pointsToConnect.some((s)=>Aue(i,s))));if(!n)return;let o=n.pointsToConnect.filter((r)=>!t.pointsToConnect.some((i)=>Aue(r,i)));return o.length===1?o[0]:void 0},oli=(e,t)=>{if(!t.routingPcbGroupId||!t.source_trace_id)return;let n=nli(e,t);if(!n)return;if(!e.connections.some((r)=>r.routingPcbGroupId!==void 0&&r.routingPcbGroupId!==t.routingPcbGroupId&&r.source_trace_id===t.source_trace_id&&r.pointsToConnect.some((i)=>Aue(i,n))))return;return{x:n.x,y:n.y,layer:n.layer}};function sSn(e,t){if(e.routingPcbGroupId)return e.routingPcbGroupId===t.routingPcbGroupId;for(let n of t.traces){if(!n.source_trace_id)continue;if(e.source_trace_id===n.source_trace_id)return!0;if(e.name===n.source_trace_id)return!0;if(e.rootConnectionName===n.source_trace_id)return!0;if(e.mergedConnectionNames?.includes(n.source_trace_id))return!0}for(let n of t.nets){if(!n.source_net_id)continue;if(e.name===n.source_net_id)return!0}return!1}function rli(e){for(let t of e){if(t.routingPcbGroupId)return!0;if(t.routingPhaseIndex!==null)return!0}return!1}function xve(e,t){let n=[];for(let c of e.connections)if(sSn(c,t))n.push(c);let o=new Set;for(let c of n)o.add(c.name);let r=[];for(let c of e.differentialPairs??[]){let l=o.has(c.connectionNames[0]),h=o.has(c.connectionNames[1]);if(l!==h)throw Error(`Differential pair "${c.connectionNames.join("/")}" cannot be split across autorouting phases`);if(l)r.push(c)}let i=new Map(e.connections.map((c)=>[c.name,c])),s=(e.buses??[]).map((c)=>{let l=c.connectionNames.filter((u)=>o.has(u)),h=c.connectionNames.filter((u)=>i.get(u)?.routingPcbGroupId===t.routingPcbGroupId);if(c.maxLengthSkew!==void 0&&l.length>0&&l.length!==h.length)throw new nSn(`Length-matched bus "${c.name||"unnamed bus"}" cannot be split across autorouting phases. Assign the complete bus to one routingPhaseIndex.`);let d=Object.fromEntries(l.flatMap((u)=>{let _=i.get(u);if(!_)return[];let p=oli(e,_);return p?[[u,p]]:[]}));return{...c,connectionNames:l,...Object.keys(d).length>0?{connectionExitTargets:d}:{}}}).filter((c)=>c.connectionNames.length>0),a=C7n({bounds:t.routingBounds??e.bounds,connections:n});return{...e,bounds:a,outline:b7n(e,a),connections:n,differentialPairs:r.length>0?r:void 0,buses:s.length>0?s:void 0}}function ili(e){if(!e)return!1;return Object.values(e).some((t)=>t!==void 0)}function sli(e,t){if(t===void 0)return e;return e.map((n)=>({...n,nominalTraceWidth:Math.max(n.nominalTraceWidth??t,t),width:Math.max(n.width??t,t)}))}function dxn(e,t){if(!ili(t))return e;let n=t.minTraceWidth??e.minTraceWidth,o=t.minViaHoleDiameter??e.minViaHoleDiameter,r=t.minViaPadDiameter??e.minViaPadDiameter,i=t.minTraceToHoleEdgeClearance??e.minTraceToHoleEdgeClearance,s=t.minTraceToPadEdgeClearance??e.minTraceToPadEdgeClearance,a=t.minViaEdgeToPadEdgeClearance??e.minViaEdgeToPadEdgeClearance,c=t.minViaHoleEdgeToViaHoleEdgeClearance??e.minViaHoleEdgeToViaHoleEdgeClearance,l=t.minPlatedHoleDrillEdgeToDrillEdgeClearance??e.minPlatedHoleDrillEdgeToDrillEdgeClearance,h=t.minPadEdgeToPadEdgeClearance??e.minPadEdgeToPadEdgeClearance,d=t.minBoardEdgeClearance??e.minBoardEdgeClearance;return{...e,connections:sli(e.connections,t.minTraceWidth),minTraceWidth:n,minViaDiameter:r,minViaHoleDiameter:o,minViaPadDiameter:r,min_via_hole_diameter:o,min_via_pad_diameter:r,minTraceToPadEdgeClearance:s,minTraceToHoleEdgeClearance:i,minViaEdgeToPadEdgeClearance:a,minViaHoleEdgeToViaHoleEdgeClearance:c,minPlatedHoleDrillEdgeToDrillEdgeClearance:l,minPadEdgeToPadEdgeClearance:h,minBoardEdgeClearance:d}}var ali=(e,t)=>{let n=e.connections.filter((s)=>s.routingPcbGroupId!==t),o=new Set(n.map((s)=>s.name)),r=[];for(let s of e.differentialPairs??[]){let a=o.has(s.connectionNames[0]),c=o.has(s.connectionNames[1]);if(a!==c)throw Error(`Differential pair "${s.connectionNames.join("/")}" cannot be split at a breakout boundary`);if(a)r.push(s)}let i=(e.buses??[]).map((s)=>({...s,connectionNames:s.connectionNames.filter((a)=>o.has(a))})).filter((s)=>s.connectionNames.length>0);return{...e,connections:n,differentialPairs:r.length>0?r:void 0,buses:i.length>0?i:void 0}},cli=(e,t)=>({...e,traces:e.traces?.map((n)=>{let o=t.get(n.connection_name??"");if(!o)return n;return{...n,connectsTo:[...new Set([...n.connectsTo??[],o])]}})});function lli({fanoutInputSimpleRouteJson:e,fanoutOutputSimpleRouteJson:t,baseSimpleRouteJson:n,routingPhasePlan:o}){let r=o.routingPcbGroupId;if(!r)return{downstreamSimpleRouteJson:t,baseSimpleRouteJson:n,synchronizedBreakoutPoints:[]};let i=new Map(t.connections.map((u)=>[u.name,u])),s=n.connections.map((u)=>({...u,pointsToConnect:u.pointsToConnect.map((_)=>({..._}))})),a=[],c=new Map;for(let u of e.connections){if(u.routingPcbGroupId!==r||!u.source_trace_id)continue;let _=i.get(u.name);if(!_)continue;let m=s.filter((f)=>{if(f.routingPcbGroupId===r)return!1;let y=f.source_trace_id===u.source_trace_id,x=f.pointsToConnect.some((C)=>u.pointsToConnect.some((b)=>rSn(C,b)));if(!y&&!x)return!1;return f.pointsToConnect.some((C)=>u.pointsToConnect.some((b)=>Aue(C,b)))}).flatMap((f)=>f.pointsToConnect.flatMap((y,x)=>u.pointsToConnect.some((C)=>Aue(y,C))?[{globalConnection:f,pointIndex:x,previousPoint:y}]:[])),A=_.pointsToConnect.findIndex((f,y)=>{let x=u.pointsToConnect[y];return x!==void 0&&!iSn(f,x)});if(A<0)continue;let g=_.pointsToConnect[A];if(m.length===0)a.push({sourceTraceId:u.source_trace_id,routingPcbGroupId:r,previousPoint:u.pointsToConnect[A],fanoutExitPoint:g});for(let{globalConnection:f,pointIndex:y,previousPoint:x}of m){let{terminalVia:C,...b}=x,I={...b,x:g.x,y:g.y,layer:g.layer,...g.terminalVia?{terminalVia:{...g.terminalVia}}:{}};if(f.pointsToConnect[y]=I,x.pointId)c.set(u.name,x.pointId);a.push({sourceTraceId:u.source_trace_id,routingPcbGroupId:r,previousPoint:x,fanoutExitPoint:g})}}let l=t.obstacles.filter((u)=>u.isFanoutSourceKeepout===!0&&u.componentId!==void 0),h=new Set(l.flatMap((u)=>u.componentId===void 0?[]:[u.componentId])),d=n.obstacles.filter((u)=>!u.componentId||!h.has(u.componentId));return{downstreamSimpleRouteJson:ali(cli(t,c),r),baseSimpleRouteJson:{...n,connections:s,obstacles:[...d,...l]},synchronizedBreakoutPoints:a}}function hli(e){let t=[],n=new Set(e.source_component.list().filter((i)=>i.name?.startsWith("__autoplaced_jumper")).map((i)=>i.source_component_id));if(n.size===0)return t;let o=new Set(e.pcb_component.list().filter((i)=>n.has(i.source_component_id)).map((i)=>i.pcb_component_id)),r=e.pcb_smtpad.list().filter((i)=>o.has(i.pcb_component_id));for(let i of r){if(i.shape==="polygon")continue;if(!i.pcb_port_id)continue;if(i.shape==="rect"||i.shape==="rotated_rect"){let s=i.width/2,a=i.height/2;t.push({pcb_port_id:i.pcb_port_id,x:i.x,y:i.y,minX:i.x-s,maxX:i.x+s,minY:i.y-a,maxY:i.y+a})}else if(i.shape==="circle"){let s=i.radius;t.push({pcb_port_id:i.pcb_port_id,x:i.x,y:i.y,minX:i.x-s,maxX:i.x+s,minY:i.y-s,maxY:i.y+s})}}return t}function uxn(e,t,n,o=0.01){for(let r of e)if(Math.abs(r.x-t)<o&&Math.abs(r.y-n)<o)return r.pcb_port_id;return}function dli(e,t,n){for(let o of e)if(t>=o.minX&&t<=o.maxX&&n>=o.minY&&n<=o.maxY)return o;return}function uli(e,t){if(e.length===0||t.length===0)return[e];let n=[],o=[];for(let r=0;r<e.length;r++){let i=e[r];if(o.push(i),i.route_type==="wire"&&r>0&&r<e.length-1){let s=dli(t,i.x,i.y);if(s){if(!i.end_pcb_port_id)i.end_pcb_port_id=s.pcb_port_id;n.push(o);let a={...i};if(delete a.end_pcb_port_id,!a.start_pcb_port_id)a.start_pcb_port_id=s.pcb_port_id;o=[a]}}}if(o.length>0)n.push(o);return n}function pli(e,t){if(t.length===0)return e;let n=[];for(let o of e){let r=uli(o,t);for(let i of r)if(i.length>0){let s=i[0],a=i[i.length-1];if(s.route_type==="wire"&&!s.start_pcb_port_id){let c=uxn(t,s.x,s.y);if(c)s.start_pcb_port_id=c}if(a.route_type==="wire"&&!a.end_pcb_port_id){let c=uxn(t,a.x,a.y);if(c)a.end_pcb_port_id=c}n.push(i)}}return n}var pxn=({db:e,pcbTrace:t,routeWithSrjMetadata:n})=>{for(let o of n){if(o.route_type!=="through_pad")continue;let r=o.circuitJsonMetadata?.pcb_via_id;if(!r)continue;let i=e.pcb_via.get(r);if(!i?.net_is_assignable||i.net_assigned&&i.pcb_trace_id!==t.pcb_trace_id)continue;e.pcb_via.update(i.pcb_via_id,{pcb_trace_id:t.pcb_trace_id,net_assigned:!0})}},mxn=(e,t,n,o)=>Math.max(n-t,e-o),mli=(e)=>{for(let t=0;t<e.length;t++){let n=e[t];for(let o=t+1;o<e.length;o++){let r=e[o];if(n.regionId&&n.regionId===r.regionId)continue;let i=mxn(n.bounds.minX,n.bounds.maxX,r.bounds.minX,r.bounds.maxX),s=mxn(n.bounds.minY,n.bounds.maxY,r.bounds.minY,r.bounds.maxY),a=Math.max(i,s),c=n.boundaryKeepaway+r.boundaryKeepaway;if(a+0.000001<c)return{firstRegion:n,secondRegion:r,availableGap:a,requiredGap:c}}}return};function JV({accumulatedPcbTraces:e,stageOutputPcbTraces:t}){let n=new Set(t.flatMap((o)=>[o.pcb_trace_id,...o.__replaces_pcb_trace_id?[o.__replaces_pcb_trace_id]:[]]));return[...e.filter((o)=>!n.has(o.pcb_trace_id)),...t]}var _li=0.000001;function gli({point:e,segmentStart:t,segmentEnd:n}){if(e.layer&&(t.layer!==e.layer||n.layer!==e.layer))return!1;return ia(e,t,n)<=_li}function Ali({point:e,pad:t,traceWidth:n=0}){if(t.shape==="rect"||t.shape==="rotated_rect"){let o=t.shape==="rotated_rect"?Y7e.applyToPoint(Y7e.rotateDEG(-t.ccw_rotation,t.x,t.y),e):e;return Math.abs(o.x-t.x)<=t.width/2+n/2&&Math.abs(o.y-t.y)<=t.height/2+n/2}if(t.shape==="circle")return Tl(e,t)<=t.radius+n/2;return!1}function fli({point:e,hole:t,traceWidth:n=0}){return Tl(e,t)<=(t.outer_diameter??t.hole_diameter??0)/2+n/2}function yli(e,t){let n=new Set,o=t.route,r=[o[0],o[o.length-1]].filter((i)=>Boolean(i)&&i.route_type==="wire"&&i.x!==void 0&&i.y!==void 0);for(let i of r){let s=new Set;for(let a of e.pcb_port.list()){if(!a.source_port_id)continue;if(i.layer&&a.layers&&!a.layers.includes(i.layer))continue;if(Tl(i,a)<=0.01)s.add(a.source_port_id)}if(s.size>0){for(let a of s)n.add(a);continue}for(let a of e.pcb_smtpad.list()){if(!a.pcb_port_id)continue;if(i.layer&&a.layer!==i.layer)continue;if(!Ali({point:i,pad:a,traceWidth:i.width}))continue;let c=e.pcb_port.get(a.pcb_port_id)?.source_port_id;if(c)n.add(c)}for(let a of e.pcb_plated_hole.list()){if(!a.pcb_port_id)continue;if(!fli({point:i,hole:a,traceWidth:i.width}))continue;let c=e.pcb_port.get(a.pcb_port_id)?.source_port_id;if(c)n.add(c)}}return[...n]}function xli(e){let t=e.route.filter((n)=>n.route_type==="wire"&&n.x!==void 0&&n.y!==void 0);return[t[0],t[t.length-1]].filter((n)=>Boolean(n))}function Cli(e,t){let n=new Set,o=xli(t);if(o.length===0)return[];for(let r of e.pcb_trace.list()){if(!r.source_trace_id)continue;if(r.pcb_trace_id===t.pcb_trace_id)continue;if(!e.source_trace.get(r.source_trace_id)&&!e.source_net.get(r.source_trace_id))continue;let i=r.route.filter((s)=>s.route_type==="wire");for(let s=0;s<i.length-1;s++){let a=i[s],c=i[s+1];if(!a||!c)continue;for(let l of o)if(gli({point:l,segmentStart:a,segmentEnd:c}))n.add(r.source_trace_id)}}return[...n]}function bli(e,t){let n=new Set;for(let o of t.route)for(let r of[o.start_pcb_port_id,o.end_pcb_port_id]){if(!r)continue;let i=e.pcb_port.get(r)?.source_port_id;if(i)n.add(i)}if(n.size>0)return[...n];return yli(e,t)}function Ili(e){let t=new fx({});return t.addConnections(e.map((n)=>[n.source_trace_id,...n.connected_source_port_ids,...n.connected_source_net_ids])),t}function Gnt({db:e,trace:t,subcircuit_id:n}){if(t.source_trace_id&&(e.source_trace.get(t.source_trace_id)??e.source_net.get(t.source_trace_id)))return t.source_trace_id;let o=bli(e,t);if(o.length===0)return Cli(e,t)[0];let r=e.source_trace.list(),i=Ili(r),s=o.map((d)=>i.getNetConnectedToId(d)).filter((d)=>Boolean(d)),a=o.length>=2?r.find((d)=>o.every((u)=>d.connected_source_port_ids.includes(u))):void 0;if(a)return a.source_trace_id;let c=r.filter((d)=>{let u=i.getNetConnectedToId(d.source_trace_id);return s.some((_)=>_===u)}),l=c.filter((d)=>d.connected_source_port_ids.some((u)=>o.includes(u))),h=l.length>0?l:c;if(h.length===0)return;return(h.find((d)=>d.subcircuit_id===n)??h[0])?.source_trace_id}function vli(e,t){let o=[];for(let r of e){let i=t==="vertical"?r.center.y:r.center.x,s=!1;for(let a of o){let c=t==="vertical"?a[0].center.y:a[0].center.x;if(Math.abs(i-c)<0.01){a.push(r),s=!0;break}}if(!s)o.push([r])}return o.filter((r)=>r.length>=2)}function Sli(e){let{db:t,output_jumpers:n,subcircuit_id:o}=e;for(let r=0;r<n.length;r++){let i=n[r],s=t.source_component.insert({ftype:"simple_chip",name:`__autoplaced_jumper_${r}`,supplier_part_numbers:{}}),a=i.orientation==="horizontal"?0:90,c=i.pads[0]?.layer||i.pads[0]?.layers?.[0]||"top",l=t.pcb_component.insert({source_component_id:s.source_component_id,center:i.center,rotation:a,layer:c,width:i.width||0,height:i.height||0,obstructs_within_bounds:!1}),h=[];for(let u=0;u<i.pads.length;u++){let _=i.pads[u],p=u+1,m=t.source_port.insert({source_component_id:s.source_component_id,name:`pin${p}`,pin_number:p}),A=_.layer||_.layers?.[0]||"top",g=t.pcb_port.insert({pcb_component_id:l.pcb_component_id,source_port_id:m.source_port_id,x:_.center.x,y:_.center.y,layers:[A]}),f=t.pcb_smtpad.insert({pcb_component_id:l.pcb_component_id,pcb_port_id:g.pcb_port_id,shape:"rect",x:_.center.x,y:_.center.y,width:_.width,height:_.height,layer:A});h.push({pad:_,sourcePortId:m.source_port_id,pcbSmtpadId:f.pcb_smtpad_id})}let d=vli(i.pads,i.orientation);for(let u of d){let _=[];for(let p of u){let m=h.find((A)=>Math.abs(A.pad.center.x-p.center.x)<0.01&&Math.abs(A.pad.center.y-p.center.y)<0.01);if(m)_.push(m.sourcePortId)}if(_.length>=2)t.source_component_internal_connection.insert({source_component_id:s.source_component_id,subcircuit_id:o??void 0,source_port_ids:_})}}}function Pli(e){return{...e,type:"pcb_trace",pcb_trace_id:e.pcb_trace_id,connection_name:e.connection_name??e.source_trace_id??e.pcb_trace_id,route:e.route.map((t)=>({...t}))}}function Eli(e){let t=new Set;if(!e.subcircuit_id)return t;t.add(e.subcircuit_id);let n=e.root?.db;if(!n)return t;for(let o of kit(n,e.subcircuit_id))t.add(o);return t}function Rat(e){let t=e.root?.db;if(!t)return[];let n=Eli(e);return t.pcb_trace.list().filter((o)=>{if(!o.route||o.route.length<2)return!1;if(!e.subcircuit_id)return!0;return Boolean(o.subcircuit_id&&n.has(o.subcircuit_id))})}function eit(e){if(typeof e!=="string"||e.length===0)return[];return e.split("__").flatMap((t)=>{if(t.length===0)return[];let n=[t],o=t.indexOf("_reroute_");if(o>0)n.push(t.slice(0,o));return n})}function Unt(e,t){if(typeof t!=="string"||t.length===0)return;e.add(t);for(let n of eit(t))e.add(n)}function Mli({group:e,outputPcbTraces:t,pcbTraceIdsToReplace:n=[]}){let o=e.root?.db;if(!o)return;let r=new Set(n),i=new Set;for(let c of t){if(c.type!=="pcb_trace")continue;let l=c;r.add(l.pcb_trace_id),Unt(i,l.source_trace_id),Unt(i,l.connection_name),Unt(i,l.rootConnectionName)}if(r.size===0&&i.size===0)return;let s=Rat(e).filter((c)=>r.has(c.pcb_trace_id)||Boolean(c.source_trace_id&&c.subcircuit_id===e.subcircuit_id&&i.has(c.source_trace_id)));if(s.length===0)return;let a=new Set(s.map((c)=>c.pcb_trace_id));for(let c of o.pcb_via.list())if(c.pcb_trace_id&&a.has(c.pcb_trace_id))o.pcb_via.delete(c.pcb_via_id);for(let c of s)o.pcb_trace.delete(c.pcb_trace_id)}function wli(e){return Rat(e).map(Pli)}function Bli(e){let t=e.filter((s)=>s.route_type==="jumper"),n=e.filter((s)=>s.route_type!=="jumper");if(t.length===0)return null;let o=[];for(let s of t){let{start:a,end:c}=s,l=-1,h=-1,d=1/0,u=1/0;for(let _=0;_<n.length;_++){let p=n[_];if(p.route_type!=="wire")continue;let m=Math.hypot(p.x-a.x,p.y-a.y),A=Math.hypot(p.x-c.x,p.y-c.y);if(m<d)d=m,l=_;if(A<u)u=A,h=_}if(l>h)[l,h]=[h,l];if(l>=0&&h>=0&&l!==h)o.push({startIdx:l,endIdx:h})}o.sort((s,a)=>s.startIdx-a.startIdx);let r=[],i=0;for(let s of o){if(i<s.startIdx)r.push(n.slice(i,s.startIdx+1));i=s.endIdx}if(i<n.length)r.push(n.slice(i));return r}function _xn(e,t){let{width:n,height:o,pcbAnchorAlignment:r}=t;if(!r)return e;let i=r;if(typeof n!=="number"||typeof o!=="number")return e;let{x:s,y:a}=e;switch(i){case"top_left":return{x:s+n/2,y:a-o/2};case"top_center":return{x:s,y:a-o/2};case"top_right":return{x:s-n/2,y:a-o/2};case"center_left":return{x:s+n/2,y:a};case"center_right":return{x:s-n/2,y:a};case"bottom_left":return{x:s+n/2,y:a+o/2};case"bottom_center":return{x:s,y:a+o/2};case"bottom_right":return{x:s-n/2,y:a+o/2};default:return e}}var gxn=(e,t)=>{let n=lk(e);return Math.hypot(n.x-t.x,n.y-t.y)},aSn=(e)=>{let t=e.root?.platform;return t!==void 0&&"allowLegacyAutorouters"in t&&t.allowLegacyAutorouters===!0},cSn=(e)=>{if(aSn(e))return null;let t=e._parsedProps.autorouter??e.getInheritedProperty("autorouter");return S3n(t)},Axn=(e)=>{if(aSn(e))return null;let t=cSn(e);if(t)return t;let n=e.selectAll("autoroutingphase").map((o)=>o._parsedProps.autorouter);for(let o of n){let r=S3n(o);if(r)return r}return null},Tli=({db:e,route:t,routeThicknessMode:n,sourceTraceId:o})=>{if(!o||t.length<2)return t;let i=e.source_trace.get(o)?.connected_source_port_ids[0];if(!i)return t;let s=e.pcb_port.list().find((l)=>l.source_port_id===i);if(!s)return t;let a=t[0],c=t[t.length-1];return gxn(c,s)<gxn(a,s)?qve(t,n):t},tP=class extends bl{pcb_group_id=null;schematic_group_id=null;subcircuit_id=null;_hasStartedAsyncAutorouting=!1;_pcbPlacementDrcErrorCount=null;_pcbPlacementDrcCheckError=null;_pcbPlacementDrcChecksPending=!1;_standaloneSubcircuitDrcChecksComplete=!1;_standaloneSubcircuitDrcChecksInProgress=!1;_isInflatedFromCircuitJson=!1;_isolatedCircuitJson=null;get _isIsolatedSubcircuit(){return Boolean(this.getInheritedProperty("_subcircuitCachingEnabled"))}_normalComponentNameMap=null;getNormalComponentNameMap(){if(this._normalComponentNameMap)return this._normalComponentNameMap;let e=new Map,t=(n)=>{if(n._isNormalComponent&&n.name){let o=e.get(n.name);if(o)o.push(n);else e.set(n.name,[n])}for(let o of n.children)if(!o.isSubcircuit)t(o)};for(let n of this.children)if(!n.isSubcircuit)t(n);return this._normalComponentNameMap=e,e}_asyncAutoroutingResult=null;get config(){return{zodProps:STt,componentName:"Group"}}initPorts(e={}){let t=this._getSchematicPortArrangement();if(this._parsedProps?.showAsSchematicBox&&!this._parsedProps.pinLabels&&t&&Bve(t).some((o)=>typeof o==="string"))return;super.initPorts(e)}_getSchematicPortArrangementFromPortDirections(){if(!this._parsedProps?.showAsSchematicBox)return null;let e={leftSide:[],rightSide:[],topSide:[],bottomSide:[]};for(let n of this.children){if(n.componentName!=="Port")continue;let o=n._parsedProps.direction;if(!o)continue;let r=n._parsedProps.pinNumber??n._parsedProps.name??void 0;if(r===void 0)continue;e[o==="left"?"leftSide":o==="right"?"rightSide":o==="up"?"topSide":"bottomSide"].push(r)}if(e.leftSide.length===0&&e.rightSide.length===0&&e.topSide.length===0&&e.bottomSide.length===0)return null;let t={};if(e.leftSide.length>0)t.leftSide={pins:e.leftSide,direction:"top-to-bottom"};if(e.rightSide.length>0)t.rightSide={pins:e.rightSide,direction:"top-to-bottom"};if(e.topSide.length>0)t.topSide={pins:e.topSide,direction:"left-to-right"};if(e.bottomSide.length>0)t.bottomSide={pins:e.bottomSide,direction:"left-to-right"};return t}_getSchematicPortArrangement(){return super._getSchematicPortArrangement()??this._getSchematicPortArrangementFromPortDirections()}_ensureSchematicBoxPortsFromConnections(){if(!this._parsedProps?.showAsSchematicBox)return;if(!this._parsedProps?.connections)return;for(let[e,t]of Object.entries(this._parsedProps.connections)){if(this.children.find((i)=>i.componentName==="Port"&&i.isMatchingAnyOf([e])))continue;let o=e.match(/^pin(\d+)$/i)??e.match(/^(\d+)$/),r=o?Number(o[1]):void 0;this.add(new Lh({name:e,pinNumber:r,connectsTo:t}))}}doInitialInitializePortsFromChildren(){super.doInitialInitializePortsFromChildren(),this._ensureSchematicBoxPortsFromConnections()}updateInitializePortsFromChildren(){super.updateInitializePortsFromChildren(),this._ensureSchematicBoxPortsFromConnections()}_getPrimaryPinCount(){let e=super._getPrimaryPinCount();if(!this._parsedProps?.showAsSchematicBox)return e;let t=this.children.filter((n)=>n.componentName==="Port").map((n)=>n._parsedProps.pinNumber).filter((n)=>n!==void 0);if(t.length===0)return e;return Math.max(e,...t)}_getPinLabelsFromPorts(){if(!this._parsedProps?.showAsSchematicBox)return super._getPinLabelsFromPorts();return uai(this)}doInitialSourceGroupRender(){let{db:e}=this.root,t=typeof this._parsedProps.name==="string"&&this._parsedProps.name.length>0,n=e.source_group.insert({name:this.name,is_subcircuit:this.isSubcircuit,was_automatically_named:!t});if(this.source_group_id=n.source_group_id,this.isSubcircuit)this.subcircuit_id=`subcircuit_${n.source_group_id}`,e.source_group.update(n.source_group_id,{subcircuit_id:this.subcircuit_id})}doInitialSourceRender(){let{db:e}=this.root;for(let n of this.getDescendants()){if(n.getGroup()?.source_group_id!==this.source_group_id)continue;e.source_component.update(n.source_component_id,{source_group_id:this.source_group_id})}if(!this.isSubcircuit)return;let t=Axn(this);if(!t)return;e.source_invalid_component_property_error.insert({source_component_id:this.source_component_id??"",property_name:"autorouter",error_type:"source_invalid_component_property_error",message:`The "${t}" autorouter is deprecated and is not enabled by this platform. Use the default autorouter and introduce <autoroutingphase /> or <fanout /> elements as needed.`})}doInitialSourceParentAttachment(){let{db:e}=this.root,t=this.parent?.getGroup?.();if(t?.source_group_id)e.source_group.update(this.source_group_id,{parent_source_group_id:t.source_group_id});if(!this.isSubcircuit)return;if(s8e(this.parent))return;let n=this.parent?.getSubcircuit?.()?.subcircuit_id;if(!n)return;e.source_group.update(this.source_group_id,{parent_subcircuit_id:n})}doInitialPcbComponentRender(){if(this.root?.pcbDisabled)return;let{db:e}=this.root,{_parsedProps:t}=this,n=t,o=n.outline&&n.outline.length>0,r=o?n.outline.map((l)=>({x:Ke.parse(l.x),y:Ke.parse(l.y)})):void 0,i=this.props,s=this._getGlobalPcbPositionBeforeLayout(),a=_xn(s,i),c=e.pcb_group.insert({is_subcircuit:this.isSubcircuit,subcircuit_id:this.subcircuit_id??this.getSubcircuit()?.subcircuit_id,name:this.name,anchor_position:s,center:a,...o?{outline:r}:{width:0,height:0},pcb_component_ids:[],source_group_id:this.source_group_id,autorouter_configuration:t.autorouter?{trace_clearance:t.autorouter.traceClearance}:void 0,anchor_alignment:t.pcbAnchorAlignment??null});this.pcb_group_id=c.pcb_group_id;for(let l of this.children)e.pcb_component.update(l.pcb_component_id,{pcb_group_id:c.pcb_group_id})}doInitialPcbPrimitiveRender(){this.calculatePcbGroupBounds()}calculatePcbGroupBounds(e){if(!this.pcb_group_id)return;if(this.root?.pcbDisabled)return;let{db:t}=this.root,n=this._parsedProps,o=n.outline&&n.outline.length>0,r=this._parsedProps.pcbX!==void 0||this._parsedProps.pcbY!==void 0;if(o){let A=n.outline.map((C)=>({x:Ke.parse(C.x),y:Ke.parse(C.y)})),g=Ms(A);if(!g)return;let f=(g.minX+g.maxX)/2,y=(g.minY+g.maxY)/2,x=r?t.pcb_group.get(this.pcb_group_id)?.center??{x:f,y}:{x:f,y};t.pcb_group.update(this.pcb_group_id,{center:x});return}let i=e;if(!i){let A=o7e(this.children);i={center:{x:(A.minX+A.maxX)/2,y:(A.minY+A.maxY)/2},width:A.width,height:A.height}}let{width:s,height:a}=i,{x:c,y:l}=i.center;if(this.isSubcircuit||this.isRoutingDirective){let{padLeft:A,padRight:g,padTop:f,padBottom:y}=this._resolvePcbPadding();s+=A+g,a+=f+y,c+=(g-A)/2,l+=(f-y)/2}let h=Number(n.width??s),d=Number(n.height??a),_=t.pcb_group.get(this.pcb_group_id)?.center??{x:c,y:l},p=this.isSubcircuit||this.isRoutingDirective||e!==void 0,m=r?p?{x:n.width===void 0?c:_.x,y:n.height===void 0?l:_.y}:_:{x:c,y:l};if(r&&n.pcbAnchorAlignment){let A=this._getGlobalPcbPositionBeforeLayout(),g=_xn(A,{...this.props,width:h,height:d});if(Math.abs(g.x-m.x)>0.000001||Math.abs(g.y-m.y)>0.000001)this._repositionOnPcb(g);m=g}t.pcb_group.update(this.pcb_group_id,{width:h,height:d,center:m})}updatePcbPrimitiveRender(){this.calculatePcbGroupBounds()}unnamedElementCounter={};getNextAvailableName(e){return this.unnamedElementCounter[e.lowercaseComponentName]??=1,`unnamed_${e.lowercaseComponentName}${this.unnamedElementCounter[e.lowercaseComponentName]++}`}_resolvePcbPadding(){let e=this._parsedProps,t=e.pcbLayout,n=(h)=>{let d=t?.[h],u=e[h];if(typeof d==="number")return d;if(typeof u==="number")return u;return},o=n("padding")??0,r=n("paddingX"),i=n("paddingY"),s=n("paddingLeft")??r??o,a=n("paddingRight")??r??o,c=n("paddingTop")??i??o,l=n("paddingBottom")??i??o;return{padLeft:s,padRight:a,padTop:c,padBottom:l}}doInitialCreateTraceHintsFromProps(){let{_parsedProps:e}=this,{db:t}=this.root,n=e;if(!this.isSubcircuit)return;let o=n.manualEdits?.manual_trace_hints;if(!o)return;for(let r of o)this.add(new v7n({for:r.pcb_port_selector,offsets:r.offsets}))}doInitialSourceAddConnectivityMapKey(){Oci(this),Lsi(this)}_areChildSubcircuitsRouted(){let e=this._findDirectChildSubcircuits();for(let t of e){if(t._isInflatedFromCircuitJson)continue;if(!t._hasTracesToRoute())continue;if(t._shouldRouteAsync()&&!t._asyncAutoroutingResult)return!1}return!0}_findDirectChildSubcircuits(){let e=[],t=(n)=>{for(let o of n)if(o.isSubcircuit&&o!==this)e.push(o);else t(o.children)};return t(this.children),e}_shouldRouteAsync(){if(this._isLegacyAutorouterDisabled())return!1;let e=this._getAutorouterConfig();if(e.groupMode==="sequential-trace")return!1;if(e.local&&e.groupMode==="subcircuit")return!0;if(!e.local)return!0;return!1}_getRoutingPhasePlans(){return Jci(this)}_hasTracesToRoute(){let e=vJ.default("tscircuit:core:_hasTracesToRoute"),t=this._getRoutingPhasePlans(),n=0,o=!1;for(let r of t){n+=r.traces.length;let i=r.autorouter?fde(r.autorouter,this.root?.platform):void 0;o||=Boolean(r.reroute&&(r.region||i?.preset==="simplify"))}if(e(`[${this.getString()}] has ${n} traces to route`),n>0)return!0;if(o){let r=Rat(this).length;return e(`[${this.getString()}] has ${r} existing pcb traces available for reroute`),r>0}return!1}async _runEffectMakeHttpAutoroutingRequest(){let{db:e}=this.root,t=vJ.default("tscircuit:core:_runEffectMakeHttpAutoroutingRequest"),n=this._parsedProps,o=this._getAutorouterConfig(),{serverUrl:r,serverMode:i}=o,s=(l,h)=>{if(t("fetching",l),h.headers)h.headers["Tscircuit-Core-Version"]=this.root?.getCoreVersion();return fetch(l,h)},a=this.root.db.toArray().filter((l)=>l.type.startsWith("source_")||l.type.startsWith("pcb_"));if(i==="solve-endpoint"){if(this.props.autorouter?.inputFormat==="simplified"){let h=n.defaultTraceWidth??n.nominalTraceWidth,{simpleRouteJson:d}=Lnt({db:e,minTraceWidth:Number(n.minTraceWidth??0.15),nominalTraceWidth:h!=null?Number(h):void 0,subcircuit_id:this.subcircuit_id,subcircuitComponent:this});d.allowViaInPad=o.allowViaInPad??d.allowViaInPad;let{autorouting_result:u}=await s(`${r}/autorouting/solve`,{method:"POST",body:JSON.stringify({input_simple_route_json:d,subcircuit_id:this.subcircuit_id}),headers:{"Content-Type":"application/json"}}).then((_)=>_.json());this._asyncAutoroutingResult=u,this._markDirty("PcbTraceRender");return}let{autorouting_result:l}=await s(`${r}/autorouting/solve`,{method:"POST",body:JSON.stringify({input_circuit_json:a,subcircuit_id:this.subcircuit_id}),headers:{"Content-Type":"application/json"}}).then((h)=>h.json());this._asyncAutoroutingResult=l,this._markDirty("PcbTraceRender");return}let{autorouting_job:c}=await s(`${r}/autorouting/jobs/create`,{method:"POST",body:JSON.stringify({input_circuit_json:a,provider:"freerouting",autostart:!0,display_name:this.root?.name,subcircuit_id:this.subcircuit_id,server_cache_enabled:o.serverCacheEnabled}),headers:{"Content-Type":"application/json"}}).then((l)=>l.json());while(!0){let{autorouting_job:l}=await s(`${r}/autorouting/jobs/get`,{method:"POST",body:JSON.stringify({autorouting_job_id:c.autorouting_job_id}),headers:{"Content-Type":"application/json"}}).then((h)=>h.json());if(l.is_finished){let{autorouting_job_output:h}=await s(`${r}/autorouting/jobs/get_output`,{method:"POST",body:JSON.stringify({autorouting_job_id:c.autorouting_job_id}),headers:{"Content-Type":"application/json"}}).then((d)=>d.json());this._asyncAutoroutingResult={output_pcb_traces:h.output_pcb_traces},this._markDirty("PcbTraceRender");break}if(l.has_error){let h=new qhe(`Autorouting job failed: ${JSON.stringify(l.error)}`);throw e.pcb_autorouting_error.insert({pcb_error_id:c.autorouting_job_id,error_type:"pcb_autorouting_error",message:h.message}),h}await new Promise((h)=>setTimeout(h,100))}}async _runLocalAutorouting(){let{db:e}=this.root,t=this._parsedProps,n=vJ.default("tscircuit:core:_runLocalAutorouting");n(`[${this.getString()}] starting local autorouting`);let o=this._getAutorouterConfig(),r=this._isLaserPrefabAutorouter(o),i=this._isAutoJumperAutorouter(o),s=this._getSubcircuitLayerCount()===1,a=Number(t.minTraceWidth??0.15),c=Number(t.defaultTraceWidth??t.nominalTraceWidth??a),l=this._getRoutingPhasePlans(),h=this.getInheritedProperty("routeRemaining")===!1||rli(l),d=l.length>1,u=new Map;if(d){for(let O of e.pcb_debug_object.list())if(O.subcircuit_id===this.subcircuit_id&&(O.label?.startsWith("Autorouting phase: ")||O.label?.startsWith("autorouting phase ")))e.pcb_debug_object.delete(O.pcb_debug_object_id)}let _=(O,U)=>{if(!d)return;let j=u.get(O),Y=O.phaseName?.trim();e.pcb_debug_object.insert({shape:"rect",center:{x:(U.minX+U.maxX)/2,y:(U.minY+U.maxY)/2},size:{width:U.maxX-U.minX,height:U.maxY-U.minY},label:`autorouting phase ${j}${Y?` ${Y}`:""}`,subcircuit_id:this.subcircuit_id??void 0})},p=l.flatMap((O)=>{let U=O.autorouter?fde(O.autorouter,this.root?.platform):o,j=U.preset,Y=O.reroute?j==="simplify"?"simplify":"reroute":O.fanoutRegionPcbGroupId?O.autorouter==="default"&&!O.getPrecomputedRoutingResult?"breakout":"fanout":j&&j!=="default"?j.replaceAll("_"," "):"default";u.set(O,O.routingPhaseIndex?.toString()??Y);let X=O.getPrecomputedRoutingResult?{...U,allowViaInPad:(typeof O.autorouter==="object"?O.autorouter.allowViaInPad:void 0)??o.allowViaInPad}:U,K=osi(O.algorithmFn?{...X,algorithmFn:O.algorithmFn}:X,this.root?.platform);return K.map((J,ee)=>({...J,routingPhasePlan:O,phaseStageIndex:ee,phaseStageCount:K.length}))}),m=new Map;for(let O of l){if(O.routingPhaseIndex!==null)continue;let U=u.get(O);m.set(U,(m.get(U)??0)+1)}let A=new Map;for(let O of l){if(O.routingPhaseIndex!==null)continue;let U=u.get(O);if(m.get(U)<=1)continue;let j=(A.get(U)??0)+1;A.set(U,j),u.set(O,`${U} ${j}`)}let f=p.some(({autorouterConfig:O})=>["fanout","single_layer_fanout","dogbone"].includes(O.preset??""))?Yci(this,l):void 0,{simpleRouteJson:y}=Lnt({db:e,minTraceWidth:a,nominalTraceWidth:c,subcircuit_id:this.subcircuit_id,subcircuitComponent:this,fanoutPourNetMap:f}),x=(O)=>{let U=O.fanoutRegionPcbGroupId;if(!U)return;let j=e.pcb_group.get(U),Y=e.pcb_component.list().find((J)=>J.pcb_group_id===U)?.source_component_id;if(!Y)return;let X=`${j?.name??"Breakout"} defines conflicting fanout bounds with explicit breakout geometry and fanoutBoundaryPadding. Explicit breakout geometry takes precedence, so fanoutBoundaryPadding is ignored.`;if(e.source_property_ignored_warning.list().some((J)=>J.source_component_id===Y&&J.property_name==="fanoutBoundaryPadding"&&J.message===X))return;e.source_property_ignored_warning.insert({source_component_id:Y,property_name:"fanoutBoundaryPadding",message:X,error_type:"source_property_ignored_warning",subcircuit_id:j?.subcircuit_id})},C=new Map;for(let O of p){let U=O.autorouterConfig.preset;if((U==="fanout"||U==="single_layer_fanout")&&!C.has(O.routingPhasePlan))C.set(O.routingPhasePlan,O.autorouterConfig)}let b=[];for(let[O,U]of C){let j=O.fanoutRegionPcbGroupId;if(!j)continue;let Y=xve(y,O);if(Y.connections.length===0)continue;Y=dxn(Y,O.drcTolerances);let X=e.pcb_breakout_point.list().filter((Z)=>Z.pcb_group_id===j).map((Z)=>({x:Z.x,y:Z.y})),K=U.preset,J=Oot.resolveFanoutBounds(Y,{mode:K,busFanoutDirections:O.busFanoutDirections,fanoutBounds:O.fanoutBounds,fanoutBoundaryPadding:O.fanoutBoundaryPadding,fanoutRoutingLayers:O.fanoutRoutingLayers,allowBlindAndBuriedVias:Y.allowBlindAndBuriedVias,breakoutPoints:X,onFanoutBoundsConflict:()=>x(O)});if(O.fanoutBounds=J,!J)continue;let ee=e.pcb_group.get(j),se=Math.max(Y.minTraceWidth,...Y.connections.map((Z)=>Z.nominalTraceWidth??Z.width??Y.minTraceWidth)),ne=Y.minViaPadDiameter??Y.min_via_pad_diameter??Y.minViaDiameter,re=Y.minTraceToPadEdgeClearance??Y.defaultObstacleMargin??se;b.push({regionId:j,name:ee?.name??O.phaseName??j,bounds:J,boundaryKeepaway:v3n({traceWidth:se,traceToPadClearance:re,viaPadDiameter:ne})/2})}let I=mli(b);if(I){let{firstRegion:O,secondRegion:U,availableGap:j,requiredGap:Y}=I,X=j<0?`overlap by ${Math.abs(j).toFixed(3)}mm`:`are only ${j.toFixed(3)}mm apart`,K=`Fanout regions "${O.name}" and "${U.name}" ${X}, but at least ${Y.toFixed(3)}mm of separation is required for a via-safe routing channel. Move the components farther apart or reduce their facing fanout padding.`;throw e.pcb_autorouting_error.insert({pcb_error_id:`pcb_autorouter_error_subcircuit_${this.subcircuit_id}`,error_type:"pcb_autorouting_error",message:K}),this.root?.emit("autorouting:error",{subcircuit_id:this.subcircuit_id,componentDisplayName:this.getString(),error:{message:K},simpleRouteJson:y}),Error(K)}for(let{regionId:O,bounds:U}of b)e.pcb_group.update(O,{center:{x:(U.minX+U.maxX)/2,y:(U.minY+U.maxY)/2},width:U.maxX-U.minX,height:U.maxY-U.minY});let v=[],P=[],M=new Set,B=wli(this),T=(O,U)=>{let j=O.connection_name??O.pcb_trace_id,Y=new Set([j,O.pcb_trace_id,...eit(j),...eit(O.pcb_trace_id)]);return y.connections.some((X)=>{if(!sSn(X,U))return!1;return Y.has(X.name)||(X.source_trace_id?Y.has(X.source_trace_id):!1)||(X.rootConnectionName?Y.has(X.rootConnectionName):!1)||X.mergedConnectionNames?.some((K)=>Y.has(K))})},N=new Set(this.getDescendants().filter((O)=>O instanceof d_&&!O.getSubcircuit()._isInflatedFromCircuitJson&&Boolean(O._parsedProps.pcbPath?.length)).map((O)=>O.source_trace_id)),D=new Set(e.pcb_trace.list().filter((O)=>O.source_trace_id&&N.has(O.source_trace_id)).map((O)=>O.pcb_trace_id)),L=new Set(D),H,V=new Set;for(let[O,{routingPhasePlan:U,autorouterConfig:j,strategy:Y,usesPreviousStageOutput:X,phaseStageIndex:K,phaseStageCount:J}]of p.entries()){if(V.has(U))continue;if(!X)H=void 0;if(X&&H===void 0)throw Error("Autorouting follow-up stage is missing the preceding stage output");let ee=H??y,se=Boolean(U.reroute&&j.preset==="simplify"),ne=Boolean(U.reroute&&U.region&&!se),re=Boolean(U.reroute&&!se&&!U.region&&U.traces.length>0),Z=ne||re||se,te=ne?{...y,traces:[...B,...v]}:null;if(!X&&se)ee={...xve(y,U),traces:JV({accumulatedPcbTraces:B,stageOutputPcbTraces:v})};else if(!X&&ne&&te)ee=$ln(te,{shape:"rect",...U.region});else if(!X&&re){let ct=xve(y,U);ee={...ct,traces:[...ct.traces??[],...v.filter((Ct)=>!T(Ct,U))]}}else if(!X&&h){let ct=xve(y,U),Ct=U.routingPcbGroupId;if(Ct){let Lt=Lnt({db:e,minTraceWidth:a,nominalTraceWidth:c,subcircuit_id:this.subcircuit_id,subcircuitComponent:this,routingPcbGroupId:Ct,fanoutPourNetMap:f}).simpleRouteJson.obstacles.filter((xt)=>xt.isCopperPour),Bt=ct.obstacles.filter((xt)=>!xt.isCopperPour);ct.obstacles=Bt.concat(Lt)}ee={...ct,traces:JV({accumulatedPcbTraces:ct.traces??[],stageOutputPcbTraces:v})}}if(j.preset!=="bus_lanes"){let ct=!j.algorithmFn&&(j.preset==="fanout"||j.preset==="single_layer_fanout");ee=MLr(ee,ct?new Set([...L].filter((Ct)=>!D.has(Ct))):L)}ee=dxn(ee,U.drcTolerances),ee.allowViaInPad=j.allowViaInPad??ee.allowViaInPad;let ie=X?void 0:U.getPrecomputedRoutingResult,ce=this.getInheritedProperty("preflightRoutingCheckPolicy")??"basic";if(U.isImplicitRemainingPhase&&K===0&&this.getInheritedProperty("routeRemaining")===void 0&&(ce==="basic"||ce==="conservative")&&ee.connections.length>50){V.add(U),e.pcb_autorouting_error.insert({pcb_error_id:`pcb_autorouting_error_remaining_routes_${this.subcircuit_id}`,subcircuit_id:this.subcircuit_id??void 0,error_type:"pcb_autorouting_error",message:`Remaining routes left unrouted (over 50 traces remaining and preflightRoutingCheckPolicy="${ce}"). Set <board routeRemaining={true} /> or create <autoroutingphase /> elements for specific connections in the order you'd like to route them. The autorouter may hang unless you create autorouting phases incrementally.`});continue}let ue=Boolean(se&&ee.traces?.length===0);if((h||Z||X)&&(ee.connections.length===0&&!se&&!ie||ue)){if(K===0)_(U,ee.bounds);H=ee;continue}let de=U.autorouter!==void 0?this._isAutoJumperAutorouter(j):i,me=U.autorouter!==void 0?this._isLaserPrefabAutorouter(j):r;if(de){if(ee.allowJumpers=!0,j.availableJumperTypes)ee.availableJumperTypes=j.availableJumperTypes}let ge=j.preset;if((ge==="fanout"||ge==="single_layer_fanout")&&!U.fanoutRegionPcbGroupId&&!ie)U.fanoutBounds=Oot.resolveFanoutBounds(ee,{mode:ge,busFanoutDirections:U.busFanoutDirections,fanoutBounds:U.fanoutBounds,fanoutBoundaryPadding:U.fanoutBoundaryPadding,fanoutRoutingLayers:U.fanoutRoutingLayers,allowBlindAndBuriedVias:ee.allowBlindAndBuriedVias});if(K===0)_(U,U.fanoutBounds??ee.bounds);if(n.enabled)global.debugOutputArray?.push({name:`simpleroutejson-${this.props.name}.json`,obj:ee});if(n.enabled){let ct=py(ee);ct.title=`autorouting-${this.props.name}`,global.debugGraphics?.push(ct)}let xe=j.autorouterVersion??this.props.autorouterVersion,Ee=this.props.autorouterEffortLevel,Re=Ee?Number.parseInt(Ee.replace("x",""),10):void 0,Me={capacityDepth:j.capacityDepth,targetMinCapacity:j.targetMinCapacity,platformConfig:this.root?.platform,useAssignableSolver:me||s,useAutoJumperSolver:de,useLaserPrefabSolver:me,autorouterVersion:xe,effort:Re},_e=ie?"precomputed":j.algorithmFn?"custom":Y.name,ye=ie||j.algorithmFn?void 0:Y.getSolverName(Me),Se={autorouterName:_e,solverName:ye,capacityDepth:Me.capacityDepth,targetMinCapacity:Me.targetMinCapacity,useAssignableSolver:Me.useAssignableSolver,useAutoJumperSolver:Me.useAutoJumperSolver,useLaserPrefabSolver:Me.useLaserPrefabSolver,useTraceSimplificationSolver:j.preset==="simplify",autorouterVersion:Me.autorouterVersion,effort:Me.effort},Ne=ie||j.algorithmFn||!Y.cacheable?void 0:this.root?.platform?.localCacheEngine,Le=Ne?Zci(ee,Se):void 0,nt=Le?await eli({cacheEngine:Ne,cacheKey:Le}):null,dt=ie?"precomputed":j.algorithmFn?"custom_algorithm":!Y.cacheable?"strategy_not_cacheable":!Ne?"no_cache_engine":void 0,rt={routingPhaseIndex:U.routingPhaseIndex,_actualRoutingPhaseOrderIndex:O,phaseOrdinal:O+1,phaseCount:p.length,connectionCount:ee.connections.length,obstacleCount:ee.obstacles.length,previousTraceCount:ee.traces?.length??0,isReroutePhase:Z,autorouterName:_e,autorouterVersion:xe,solverName:ye,effort:Re,cacheStatus:Ne?nt?"hit":"miss":"disabled",cacheKey:Le,cacheDisabledReason:dt};this.root?.emit("autorouting:start",{type:"autorouting:start",subcircuit_id:this.subcircuit_id,componentDisplayName:this.getString(),...U.phaseName!==void 0?{phaseName:U.phaseName,phaseStageIndex:K,phaseStageCount:J}:{},...rt,simpleRouteJson:ee});let pt;try{let ct,Ct;if(ie){let Ze=ie(ee);ct=Ze.traces,Ct=Ze.outputSimpleRouteJson;for(let Fe of ct)L.add(Fe.pcb_trace_id)}else if(nt)n(`[${this.getString()}] using cached local autorouting result`),ct=nt.traces;else{if(j.algorithmFn)pt=await j.algorithmFn(ee);else pt=Y.create({simpleRouteJson:ee,onSolverEnded:(tt)=>this.root?.emit("solver:ended",{...tt,type:"solver:ended",componentName:this.getString()}),commonAutorouterOptions:Me,busFanoutDirections:U.busFanoutDirections,fanoutBounds:U.fanoutBounds,fanoutRoutingLayers:U.fanoutRoutingLayers,allowBlindAndBuriedVias:ee.allowBlindAndBuriedVias,componentNamesById:eVr(e),onSolverStarted:({solverName:tt,solverParams:Je,solverConstructorArgs:$e})=>this.root?.emit("solver:started",{type:"solver:started",solverName:tt,solverParams:Je,solverConstructorArgs:$e,componentName:this.getString()})});if(!pt)throw Error("Failed to create local autorouter");let Ze=pt,Fe=new Promise((tt,Je)=>{Ze.on("complete",($e)=>{n(`[${this.getString()}] local autorouting complete`),tt($e.traces)}),Ze.on("error",($e)=>{n(`[${this.getString()}] local autorouting error: ${$e.error.message}`),Je($e.error)})});Ze.on("progress",(tt)=>{this.root?.emit("autorouting:progress",{subcircuit_id:this.subcircuit_id,componentDisplayName:this.getString(),...U.phaseName!==void 0?{phaseName:U.phaseName,phaseStageIndex:K,phaseStageCount:J}:{},...rt,...tt,type:"autorouting:progress"})}),Ze.start(),ct=await Fe}let kt=Ct??pt?.getOutputSimpleRouteJson?.();if(Y.preserveOutputTraces&&kt?.traces)kt={...kt,traces:JV({accumulatedPcbTraces:ee.traces??[],stageOutputPcbTraces:kt.traces})};if(kt&&!X&&["fanout","single_layer_fanout","dogbone"].includes(j.preset??"")&&U.routingPcbGroupId){let Ze=lli({fanoutInputSimpleRouteJson:ee,fanoutOutputSimpleRouteJson:kt,baseSimpleRouteJson:y,routingPhasePlan:U});y=Ze.baseSimpleRouteJson,kt=Ze.downstreamSimpleRouteJson;for(let Fe of Ze.synchronizedBreakoutPoints){let tt=e.pcb_breakout_point.list().find((Je)=>Je.pcb_group_id===Fe.routingPcbGroupId&&Je.source_trace_id===Fe.sourceTraceId&&Math.abs(Je.x-Fe.previousPoint.x)<=0.000001&&Math.abs(Je.y-Fe.previousPoint.y)<=0.000001);if(!tt)continue;e.pcb_breakout_point.update(tt.pcb_breakout_point_id,{x:Fe.fanoutExitPoint.x,y:Fe.fanoutExitPoint.y,layer:Fe.fanoutExitPoint.layer})}}if(Y.preserveOutputTraces)for(let Ze of ct)L.add(Ze.pcb_trace_id);let Lt=ct;if(kt?.traces)Lt=kt.traces;else if(X)Lt=JV({accumulatedPcbTraces:ee.traces??[],stageOutputPcbTraces:ct});let Bt=Lt;if(!kt&&!X&&U.routingPhaseIndex!==null)Bt=JV({accumulatedPcbTraces:ee.traces??[],stageOutputPcbTraces:ct});let xt={...kt??ee,traces:Bt};if(H=kt?xt:void 0,!nt&&Le)await tli({cacheEngine:Ne,cacheKey:Le,result:{...ee,traces:ct}});let Yt=ELr({group:this.selectAll("group").find((Ze)=>Ze.pcb_group_id===U.fanoutRegionPcbGroupId)??U.autoroutingPhase?.getGroup()??this,subcircuit:this,input:ee,traces:ct,isFanout:["fanout","single_layer_fanout","dogbone"].includes(j.preset??"")});if(this.root?.emit("autorouting:end",{...Yt,type:"autorouting:end",subcircuit_id:this.subcircuit_id,componentDisplayName:this.getString(),...U.phaseName!==void 0?{phaseName:U.phaseName,phaseStageIndex:K,phaseStageCount:J}:{},...rt,simpleRouteJson:xt}),pt?.getConnectedOffboardObstacles){let Ze=pt.getConnectedOffboardObstacles();ZOr({db:e,connectedOffboardObstacles:Ze,simpleRouteJson:ee,subcircuit_id:this.subcircuit_id})}let ut=pt?.solver;if(ut?.getOutputJumpers)P.push(...ut.getOutputJumpers()||[]);if(ne&&te){for(let Fe of te.traces??[])if(Fe.type==="pcb_trace")M.add(Fe.pcb_trace_id);let Ze=qln(te,{...ee,traces:[...ee.traces??[],...ct]});v.splice(0,v.length,...Ze.traces??[])}else if(re){let Ze=v.filter((Fe)=>!T(Fe,U));v.splice(0,v.length,...JV({accumulatedPcbTraces:Ze,stageOutputPcbTraces:Lt}))}else{if(se)for(let Ze of B){if(L.has(Ze.pcb_trace_id))continue;M.add(Ze.pcb_trace_id)}v.splice(0,v.length,...JV({accumulatedPcbTraces:v,stageOutputPcbTraces:Lt}))}}catch(ct){let{db:Ct}=this.root;throw Ct.pcb_autorouting_error.insert({pcb_error_id:`pcb_autorouter_error_subcircuit_${this.subcircuit_id}`,error_type:"pcb_autorouting_error",message:ct instanceof Error?ct.message:String(ct)}),this.root?.emit("autorouting:error",{type:"autorouting:error",subcircuit_id:this.subcircuit_id,componentDisplayName:this.getString(),...U.phaseName!==void 0?{phaseName:U.phaseName,phaseStageIndex:K,phaseStageCount:J}:{},...rt,error:{message:ct instanceof Error?ct.message:String(ct)},simpleRouteJson:ee}),ct}finally{pt?.stop()}}this._asyncAutoroutingResult={output_pcb_traces:v,output_jumpers:P,pcb_trace_ids_to_be_replaced:[...M]},this._markDirty("PcbTraceRender")}_startAsyncAutorouting(){if(this._hasStartedAsyncAutorouting)return;if(this._hasStartedAsyncAutorouting=!0,this._getAutorouterConfig().local)this._queueAsyncEffect("autorouting",async()=>{try{await this._runLocalAutorouting()}catch(e){if(!(e instanceof nSn))throw e;let{db:t}=this.root,n=`pcb_autorouter_error_subcircuit_${this.subcircuit_id}`;if(!t.pcb_autorouting_error.list().some((r)=>r.pcb_error_id===n&&r.message===e.message))t.pcb_autorouting_error.insert({pcb_error_id:n,error_type:"pcb_autorouting_error",message:e.message,subcircuit_id:this.subcircuit_id??void 0}),this.root?.emit("autorouting:error",{type:"autorouting:error",subcircuit_id:this.subcircuit_id,componentDisplayName:this.getString(),error:{message:e.message}});throw e}});else this._queueAsyncEffect("make-http-autorouting-request",async()=>this._runEffectMakeHttpAutoroutingRequest())}doInitialPcbTraceRender(){let e=vJ.default("tscircuit:core:doInitialPcbTraceRender");if(!this.isSubcircuit)return;if(this.root?.pcbDisabled)return;if(this.root?.pcbRoutingDisabled||this.getInheritedProperty("routingDisabled"))return;if(this._isInflatedFromCircuitJson)return;if(this._isLegacyAutorouterDisabled())return;if(this._shouldUseTraceByTraceRouting())return;if(!this._areChildSubcircuitsRouted()){e(`[${this.getString()}] child subcircuits are not routed, skipping async autorouting until subcircuits routed`);return}if(e(`[${this.getString()}] no child subcircuits to wait for, initiating async routing`),!this._hasTracesToRoute())return;let t=dot({component:this,subcircuit:this}),n=uot({component:this,subcircuit:this});if(t||n)return;this._startAsyncAutorouting()}doInitialSchematicTraceRender(){if(this._parsedProps.showAsSchematicBox)return;fci(this)}doInitialSchematicSheetRender(){H7n(this)}updateSchematicSheetRender(){kai(this)}updatePcbTraceRender(){let e=vJ.default("tscircuit:core:updatePcbTraceRender");if(e(`[${this.getString()}] updating...`),!this.isSubcircuit)return;if(this.root?.pcbDisabled)return;if(this.root?.pcbRoutingDisabled||this.getInheritedProperty("routingDisabled"))return;if(this._isInflatedFromCircuitJson)return;if(this._isLegacyAutorouterDisabled())return;if(this._shouldRouteAsync()&&this._hasTracesToRoute()&&!this._hasStartedAsyncAutorouting){if(this._areChildSubcircuitsRouted()){let n=dot({component:this,subcircuit:this}),o=uot({component:this,subcircuit:this});if(n||o)return;e(`[${this.getString()}] child subcircuits are now routed, starting async autorouting`),this._startAsyncAutorouting()}return}if(!this._asyncAutoroutingResult)return;if(this._shouldUseTraceByTraceRouting())return;let{db:t}=this.root;if(this._asyncAutoroutingResult.output_simple_route_json){e(`[${this.getString()}] updating PCB traces from simple route json (${this._asyncAutoroutingResult.output_simple_route_json.traces?.length} traces)`),this._updatePcbTraceRenderFromSimpleRouteJson();return}if(this._asyncAutoroutingResult.output_pcb_traces){e(`[${this.getString()}] updating PCB traces from ${this._asyncAutoroutingResult.output_pcb_traces.length} traces`),this._updatePcbTraceRenderFromPcbTraces();return}}_updatePcbTraceRenderFromSimpleRouteJson(){let{db:e}=this.root,{traces:t}=this._asyncAutoroutingResult.output_simple_route_json;if(!t)return;for(let n of t){let o=n.route.map((i)=>{if(i.route_type!=="through_obstacle")return i;return{route_type:"through_pad",start:i.start,end:i.end,start_layer:i.from_layer,end_layer:i.to_layer,width:i.width,circuitJsonMetadata:i.circuitJsonMetadata}}),r=e.pcb_trace.insert({subcircuit_id:this.subcircuit_id,route:hot(o)});pxn({db:e,pcbTrace:r,routeWithSrjMetadata:o})}}_updatePcbTraceRenderFromPcbTraces(){let{output_pcb_traces:e,output_jumpers:t,pcb_trace_ids_to_be_replaced:n}=this._asyncAutoroutingResult;if(!e)return;let{db:o}=this.root,r=this.getInheritedMergedProperty("pcbStyle"),{holeDiameter:i,padDiameter:s}=gB(r),a=this._getBoard(),c=a?.pcb_board_id?o.pcb_board.get(a.pcb_board_id):o.pcb_board.list()[0],l=c?.min_via_hole_diameter??i,h=c?.min_via_pad_diameter??s;if(t&&t.length>0)Sli({db:o,output_jumpers:t,subcircuit_id:this.subcircuit_id});Mli({group:this,outputPcbTraces:e,pcbTraceIdsToReplace:n});let d=o.pcb_via.list(),u=hli(o);for(let _ of e){if(_.type!=="pcb_trace")continue;_.subcircuit_id??=this.subcircuit_id;let p=_.route.map((f)=>{if(f.route_type!=="through_obstacle")return f;return{route_type:"through_pad",start:f.start,end:f.end,start_layer:f.from_layer,end_layer:f.to_layer,width:f.width,circuitJsonMetadata:f.circuitJsonMetadata}}),m=Gnt({db:o,trace:{..._,route:p},subcircuit_id:this.subcircuit_id});p=Tli({db:o,route:p,routeThicknessMode:_.route_thickness_mode,sourceTraceId:m}),_.route=p;let A=Bli(p);if(A===null)A=[p];let g=pli(A,u);for(let f of g)if(f.length>0){let y=hot(f),x=Gnt({db:o,trace:{..._,route:y},subcircuit_id:this.subcircuit_id}),C=o.pcb_trace.insert({..._,source_trace_id:x,route:y});pxn({db:o,pcbTrace:C,routeWithSrjMetadata:f})}}for(let _ of e){if(_.type==="pcb_via")continue;if(_.type==="pcb_trace"){let p=Gnt({db:o,trace:_,subcircuit_id:this.subcircuit_id}),{connection_name:m}=_,A;if(p)A=o.source_trace.get(p)?.subcircuit_connectivity_map_key;if(!A&&m){let g=o.source_net.get(m);if(g)A=g.subcircuit_connectivity_map_key}for(let g of _.route)if(g.route_type==="via"){let f=g,{from_layer:y,to_layer:x}=g,C={pcb_trace_id:_.pcb_trace_id,x:g.x,y:g.y,hole_diameter:f.via_hole_diameter??f.hole_diameter??l,outer_diameter:f.via_diameter??f.outer_diameter??h,layers:c5n({fromLayer:y,toLayer:x,layerCount:this._getSubcircuitLayerCount(),allowBlindAndBuriedVias:c?.allow_blind_and_buried_vias??!1,physicalLayers:f.layers}),from_layer:y,to_layer:x,subcircuit_id:this.subcircuit_id,pcb_group_id:this.pcb_group_id??void 0,subcircuit_connectivity_map_key:A};if(d.some((b)=>JOr(b,C)))continue;d.push(o.pcb_via.insert(C))}}}}doInitialSchematicComponentRender(){if(this.root?.schematicDisabled)return;let{db:e}=this.root,{_parsedProps:t}=this,n=e.schematic_group.insert({is_subcircuit:this.isSubcircuit,subcircuit_id:this.subcircuit_id,name:this.name,center:this._getGlobalSchematicPositionBeforeLayout(),width:0,height:0,schematic_component_ids:[],source_group_id:this.source_group_id,show_as_schematic_box:t.showAsSchematicBox??!1});if(this.schematic_group_id=n.schematic_group_id,t.showAsSchematicBox)pai(this);for(let o of this.getDescendants()){if(o.getGroup()?.source_group_id!==this.source_group_id)continue;if(o._parsedProps?.showAsSchematicBox)continue;if(o.schematic_component_id)e.schematic_component.update(o.schematic_component_id,{schematic_group_id:n.schematic_group_id})}}_getSchematicLayoutMode(){let e=this._parsedProps,t=e.schAutoLayoutEnabled??!1;if(e.schLayout?.layoutMode==="none")return"relative";if(e.schLayout?.layoutMode==="relative")return"relative";if(e.schLayout?.matchAdapt)return"match-adapt";if(e.schLayout?.flex)return"flex";if(e.schLayout?.grid)return"grid";if(e.schMatchAdapt)return"match-adapt";if(e.schFlex)return"flex";if(e.schGrid)return"grid";if(e.matchAdapt)return"match-adapt";if(e.flex)return"flex";if(e.grid)return"grid";if(e.relative)return"relative";if(e.schRelative)return"relative";let n=this.children.some((r)=>{let i=r._parsedProps;return(r.source_component_id!==null||r.source_group_id!==null)&&(i?.schX!==void 0||i?.schY!==void 0)}),o=(e.manualEdits?.schematic_placements?.length??0)>0;if(t&&!o)return"match-adapt";if(!n&&!o)return"match-adapt";return"relative"}doInitialSchematicLayout(){if(this._parsedProps.showAsSchematicBox){this._insertSchematicBorder();return}if(this.children.some((o)=>o.source_component_id!==null&&o._parsedProps?.schSectionName!==void 0)){this._doInitialSchematicLayoutSections(),this._insertSchematicBorder();return}let n=this._getSchematicLayoutMode();if(n==="match-adapt")this._doInitialSchematicLayoutMatchpack();if(n==="grid")this._doInitialSchematicLayoutGrid();if(n==="flex")this._doInitialSchematicLayoutFlex();this._insertSchematicBorder()}_doInitialSchematicLayoutSections(){Rai(this)}_doInitialSchematicLayoutMatchAdapt(){gai(this)}_doInitialSchematicLayoutMatchpack(){Tai(this)}_doInitialSchematicLayoutGrid(){_ai(this)}_doInitialSchematicLayoutFlex(){mai(this)}_getPcbLayoutMode(){let e=this._parsedProps,t=this.props;if(this._isInflatedFromCircuitJson)return"none";if(e.pcbRelative)return"none";if(e.pcbLayout?.matchAdapt)return"match-adapt";if(e.pcbLayout?.flex)return"flex";if(e.pcbLayout?.grid)return"grid";if(e.pcbLayout?.pack)return"pack";if(e.pcbFlex)return"flex";if(e.pcbGrid)return"grid";if(e.pcbPack)return"pack";if(e.pack)return"pack";if(e.matchAdapt)return"match-adapt";if(e.flex)return"flex";if(e.grid)return"grid";let n=e.pcbX!==void 0||e.pcbY!==void 0||e.pcbLeftEdgeX!==void 0||e.pcbRightEdgeX!==void 0||e.pcbTopEdgeY!==void 0||e.pcbBottomEdgeY!==void 0||t.pcbLeftEdgeX!==void 0||t.pcbRightEdgeX!==void 0||t.pcbTopEdgeY!==void 0||t.pcbBottomEdgeY!==void 0,o=(e.manualEdits?.pcb_placements?.length??0)>0,r=this.children.reduce((i,s)=>{if(!s.pcb_component_id&&!s.pcb_group_id)return i;let{_parsedProps:a,props:c}=s,l=a?.pcbX!==void 0||a?.pcbY!==void 0||a?.pcbLeftEdgeX!==void 0||a?.pcbRightEdgeX!==void 0||a?.pcbTopEdgeY!==void 0||a?.pcbBottomEdgeY!==void 0||c?.pcbLeftEdgeX!==void 0||c?.pcbRightEdgeX!==void 0||c?.pcbTopEdgeY!==void 0||c?.pcbBottomEdgeY!==void 0;return i+(l?0:1)},0);if(!o&&r>1)return"pack";return"none"}doInitialPcbLayout(){if(this.root?.pcbDisabled)return;if(this.pcb_group_id){let{db:t}=this.root,n=this._parsedProps;if(n.pcbX!==void 0||n.pcbY!==void 0){let r=this.parent?.getGroup?.(),i=r?.pcb_group_id?t.pcb_group.get(r.pcb_group_id)?.pcb_group_id:void 0,s=!i?this._getBoard()?.pcb_board_id??void 0:void 0;t.pcb_group.update(this.pcb_group_id,{position_mode:"relative_to_group_anchor",positioned_relative_to_pcb_group_id:i,positioned_relative_to_pcb_board_id:s,display_offset_x:n.pcbX,display_offset_y:n.pcbY})}}let e=this._getPcbLayoutMode();if(e==="grid")this._doInitialPcbLayoutGrid();else if(e==="pack")this._doInitialPcbLayoutPack();else if(e==="flex")this._doInitialPcbLayoutFlex()}_doInitialPcbLayoutGrid(){Xsi(this)}_doInitialPcbLayoutPack(){lai(this)}_doInitialPcbLayoutFlex(){Wsi(this)}_insertSchematicBorder(){if(this.root?.schematicDisabled)return;let{db:e}=this.root,t=this._parsedProps;if(!t.border)return;let n=typeof t.schWidth==="number"?t.schWidth:void 0,o=typeof t.schHeight==="number"?t.schHeight:void 0,r=typeof t.schPadding==="number"?t.schPadding:0,i=typeof t.schPaddingLeft==="number"?t.schPaddingLeft:r,s=typeof t.schPaddingRight==="number"?t.schPaddingRight:r,a=typeof t.schPaddingTop==="number"?t.schPaddingTop:r,c=typeof t.schPaddingBottom==="number"?t.schPaddingBottom:r,l=this.schematic_group_id?e.schematic_group.get(this.schematic_group_id):null;if(l){if(n===void 0&&typeof l.width==="number")n=l.width;if(o===void 0&&typeof l.height==="number")o=l.height}if(n===void 0||o===void 0)return;let h=l?.center??this._getGlobalSchematicPositionBeforeLayout(),d=h.x-n/2-i,u=h.y-o/2-c,_=n+i+s,p=o+a+c;e.schematic_box.insert({width:_,height:p,x:d,y:u,is_dashed:t.border?.dashed??!1})}_determineSideFromPosition(e,t){if(!e.center||!t.center)return"left";let n=e.center.x-t.center.x,o=e.center.y-t.center.y;if(Math.abs(n)>Math.abs(o))return n>0?"right":"left";return o>0?"bottom":"top"}_calculateSchematicBounds(e){if(e.length===0)return{minX:0,maxX:0,minY:0,maxY:0};let t=1/0,n=-1/0,o=1/0,r=-1/0;for(let s of e)t=Math.min(t,s.centerX),n=Math.max(n,s.centerX),o=Math.min(o,s.centerY),r=Math.max(r,s.centerY);let i=2;return{minX:t-i,maxX:n+i,minY:o-i,maxY:r+i}}_getAutorouterConfig(){let e=this._parsedProps.autorouter||this.getInheritedProperty("autorouter");return fde(e,this.root?.platform)}_isLegacyAutorouterDisabled(){return Axn(this)!==null}_isLaserPrefabAutorouter(e=this._getAutorouterConfig()){let t=this.props.autorouter,n=(o)=>o?.replace(/-/g,"_")??o;if(e.preset==="laser_prefab")return!0;if(typeof t==="string")return n(t)==="laser_prefab";if(typeof t==="object"&&t)return n(t.preset)==="laser_prefab";return!1}_isAutoJumperAutorouter(e=this._getAutorouterConfig()){let t=this.props.autorouter,n=(o)=>o?.replace(/-/g,"_")??o;if(e.preset==="auto_jumper")return!0;if(typeof t==="string")return n(t)==="auto_jumper";if(typeof t==="object"&&t)return n(t.preset)==="auto_jumper";return!1}_getSubcircuitLayerCount(){let e=this.getInheritedProperty("layers");return typeof e==="number"?e:2}_shouldUseTraceByTraceRouting(){if(cSn(this))return!1;return this._getAutorouterConfig().groupMode==="sequential-trace"}doInitialPcbDesignRuleChecks(){if(this.root?.pcbDisabled)return;if(this._isLegacyAutorouterDisabled())return;if(this.root?.pcbRoutingDisabled||this.getInheritedProperty("routingDisabled"))return;let{db:e}=this.root;if(this.isSubcircuit){let t=new Map;for(let n of this.children){if(n.isSubcircuit)continue;if(n._parsedProps.name){let o=t.get(n._parsedProps.name)||[];o.push(n),t.set(n._parsedProps.name,o)}}for(let[n,o]of t.entries()){if(o.length<=1)continue;let r=o.filter((c)=>c instanceof d_),i=r.length===o.length,s=r.map((c)=>c.subcircuit_connectivity_map_key),a=i&&s.every(Boolean)&&new Set(s).size===1;if(!i||!a){let c=this.name||"unnamed",l=i?`Trace "${n}" in subcircuit "${c}" shares a name with another trace, but the traces are not mutually connected. Same-named traces must have the same subcircuit connectivity map key.`:`Multiple immediate children found with name "${n}" in subcircuit "${c}". Names must be unique.`;e.pcb_trace_error.insert({error_type:"pcb_trace_error",message:l,source_trace_id:"",pcb_trace_id:"",pcb_component_ids:o.map((h)=>h.pcb_component_id).filter(Boolean),pcb_port_ids:[]})}}}Vci(this)}doInitialSchematicLabelNetsWithConflictingNames(){if(this.root?.schematicDisabled)return;if(this.getTopLevelRenderable()!==this)return;wLr(this.root.db)}updateSchematicLabelNetsWithConflictingNames(){this.doInitialSchematicLabelNetsWithConflictingNames()}doInitialSchematicReplaceNetLabelsWithSymbols(){if(this.root?.schematicDisabled)return;if(!this.isSubcircuit)return;let{db:e}=this.root,t=e;for(let n of t.schematic_net_label.list()){let o=t.source_net.get(n.source_net_id),r=n.text||o?.name||"",i=o?.is_ground||xue.test(r),s=o?.is_power||Cit.test(r);if(n.anchor_side==="top"&&i){t.schematic_net_label.update(n.schematic_net_label_id,{symbol_name:"rail_down"});continue}if(n.anchor_side==="bottom"&&s)t.schematic_net_label.update(n.schematic_net_label_id,{symbol_name:"rail_up"})}}doInitialSimulationSpiceEngineRender(){zci(this)}doInitialPcbComponentAnchorAlignment(){Usi(this)}updatePcbComponentAnchorAlignment(){this.doInitialPcbComponentAnchorAlignment()}doInitialPcbCalcPlacementResolution(){Fsi(this)}updatePcbCalcPlacementResolution(){this.doInitialPcbCalcPlacementResolution()}_getMinimumFlexContainerSize(){return super._getMinimumFlexContainerSize()}_repositionOnPcb(e){return super._repositionOnPcb(e)}};function Dli(e,t){let{injectionDb:n,subcircuit:o,groupsMap:r}=t,i=n.pcb_group.getWhere({source_group_id:e.source_group_id}),s={name:e.name??`inflated_group_${e.source_group_id}`};if(i?.position_mode==="relative_to_group_anchor"&&i.anchor_position){let c={x:0,y:0};if(e.parent_source_group_id){let l=n.pcb_group.getWhere({source_group_id:e.parent_source_group_id});if(l?.anchor_position)c=l.anchor_position}s.pcbX=i.anchor_position.x-c.x,s.pcbY=i.anchor_position.y-c.y}if(i?.anchor_alignment)s.pcbAnchorAlignment=i.anchor_alignment;let a=new tP(s);if(a._isInflatedFromCircuitJson=!0,a.source_group_id=e.source_group_id,r)r.set(e.source_group_id,a);if(e.parent_source_group_id&&r?.has(e.parent_source_group_id))r.get(e.parent_source_group_id).add(a);else o.add(a);return a}var lSn=class extends bl{_adjustSilkscreenTextAutomatically=!0;get config(){return{componentName:"Inductor",schematicSymbolName:this.props.symbolName??"inductor",zodProps:TDt,sourceFtype:XS.simple_inductor}}_getSchematicSymbolDisplayValue(){return`${qh(this._parsedProps.inductance)}H`}initPorts(){super.initPorts({additionalAliases:{pin1:["anode","pos","left"],pin2:["cathode","neg","right"]}})}doInitialSourceRender(){let{db:e}=this.root,{_parsedProps:t}=this,n=e.source_component.insert({name:this.name,ftype:XS.simple_inductor,inductance:this.props.inductance,max_current_rating:t.maxCurrentRating===void 0?void 0:Aa(t.maxCurrentRating,"A").value,display_inductance:this._getSchematicSymbolDisplayValue(),supplier_part_numbers:t.supplierPartNumbers,manufacturer_part_number:ii(t),are_pins_interchangeable:!0,display_name:t.displayName});this.source_component_id=n.source_component_id}};function Nli(e,t){let{injectionDb:n,subcircuit:o,groupsMap:r}=t,i=n.pcb_component.getWhere({source_component_id:e.source_component_id}),s=n.cad_component.getWhere({source_component_id:e.source_component_id}),{pcbX:a,pcbY:c}=zb({pcbComponent:i,sourceGroupId:e.source_group_id,inflatorContext:t}),l=new lSn({name:e.name,inductance:e.inductance,layer:i?.layer,pcbX:a,pcbY:c,pcbRotation:i?.rotation,doNotPlace:i?.do_not_place,obstructsWithinBounds:i?.obstructs_within_bounds});if(i){let h=Fb(i,{...t,normalComponent:l});if(h)l.add(h)}if(e.source_group_id&&r?.has(e.source_group_id))r.get(e.source_group_id).add(l);else o.add(l)}var Wnt=new WeakMap,fxn=(e)=>{let t=[e.name,...e.port_hints??[]].map((r)=>r.toLowerCase().replace(/[^a-z0-9+-]/g,"")),n=t.some((r)=>["a","anode","pos","positive","+"].includes(r)),o=t.some((r)=>["k","c","cathode","neg","negative","-"].includes(r));if(n===o)return null;return n?"anode":"cathode"},Rli=(e)=>{let t=e.root;if(!t)return;let{db:n}=t,o=Wnt.get(e);for(let C of o??[])n.pcb_fabrication_note_path.delete(C.pcb_fabrication_note_path_id);if(Wnt.delete(e),t.pcbDisabled||!e.pcb_component_id)return;let r=n.pcb_component.get(e.pcb_component_id);if(!r||r.layer!=="top"&&r.layer!=="bottom")return;let i=n.source_port.list({source_component_id:e.source_component_id}),s=i.filter((C)=>fxn(C)==="anode"),a=i.filter((C)=>fxn(C)==="cathode");if(s.length!==1||a.length!==1)return;let c=s[0],l=a[0],h=n.pcb_port.getWhere({source_port_id:c.source_port_id}),d=n.pcb_port.getWhere({source_port_id:l.source_port_id});if(!h||!d)return;let u=Math.hypot(d.x-h.x,d.y-h.y);if(u<0.000001)return;let _=Math.atan2(d.y-h.y,d.x-h.x),p=jk.compose(jk.translate((h.x+d.x)/2,(h.y+d.y)/2),jk.rotate(_)),m=(C,b)=>jk.applyToPoint(p,{x:C,y:b}),A={pcb_component_id:r.pcb_component_id,subcircuit_id:e.getSubcircuit()?.subcircuit_id??void 0,layer:r.layer},g=[];Wnt.set(e,g);let f=Math.min(u*0.2,0.4),y=f*0.75,x=[[m(-u/2,0),m(-f,0)],[m(-f,-y),m(f,0),m(-f,y),m(-f,-y)],[m(f,-y),m(f,y)],[m(f,0),m(u/2,0)]];for(let C of x)g.push(n.pcb_fabrication_note_path.insert({...A,route:C,stroke_width:0.08}))},hSn=class extends bl{get config(){let e={laser:"laser_diode"},t=this.props.laser?"laser":null,n=t?e[t]:this.props.symbolName??"led",o=this.props.schSize==="sm"||this.props.schSize==="xs"?this.props.schSize:void 0,r=o&&n==="led"?`led_${o}`:void 0;return{schematicSymbolName:r&&`${r}_right`in Es?r:n,componentName:"Led",zodProps:RDt,sourceFtype:"simple_led"}}initPorts(){let e=this.children.some((r)=>r.componentName==="Footprint"),t=this.resolveFootprint(),n=Boolean(this._resolvePinLabels()),o=!n&&!e&&(!t||T4n(t));super.initPorts({pinCount:2,ignoreSymbolPorts:!n&&!o,additionalAliases:{pin1:o?["anode","pos","left"]:[],pin2:o?["cathode","neg","right"]:[]}})}_getSchematicSymbolDisplayValue(){return this._parsedProps.schDisplayValue||this._parsedProps.color||void 0}getFootprinterString(){let e=super.getFootprinterString();if(e&&this.props.color)return`${e}_color(${this.props.color})`;return e}doInitialSourceRender(){let{db:e}=this.root,{_parsedProps:t}=this,n=e.source_component.insert({ftype:"simple_led",name:this.name,wave_length:t.wavelength,color:t.color,symbol_display_value:this._getSchematicSymbolDisplayValue(),manufacturer_part_number:ii(t),supplier_part_numbers:t.supplierPartNumbers,are_pins_interchangeable:!1,display_name:t.displayName});this.source_component_id=n.source_component_id}get pos(){return this.portMap.pos}doInitialPcbComponentSizeCalculation(){super.doInitialPcbComponentSizeCalculation(),Rli(this)}get anode(){return this.portMap.anode}get neg(){return this.portMap.neg}get cathode(){return this.portMap.cathode}};function Qli(e,t){let{injectionDb:n,subcircuit:o,groupsMap:r}=t,i=n.pcb_component.getWhere({source_component_id:e.source_component_id}),s=n.cad_component.getWhere({source_component_id:e.source_component_id}),{pcbX:a,pcbY:c}=zb({pcbComponent:i,sourceGroupId:e.source_group_id,inflatorContext:t}),l=new hSn({name:e.name,color:e.color,wavelength:e.wavelength??e.wave_length,layer:i?.layer,pcbX:a,pcbY:c,pcbRotation:i?.rotation,doNotPlace:i?.do_not_place,obstructsWithinBounds:i?.obstructs_within_bounds});if(i){let h=Fb(i,{...t,normalComponent:l});if(h)l.add(h)}if(e.source_group_id&&r?.has(e.source_group_id))r.get(e.source_group_id).add(l);else o.add(l)}var kli=[{gate:"left",drain:"top",source:"bottom"},{gate:"left",drain:"bottom",source:"top"},{gate:"right",drain:"top",source:"bottom"},{gate:"right",drain:"bottom",source:"top"},{gate:"top",drain:"left",source:"right"},{gate:"top",drain:"right",source:"left"},{gate:"bottom",drain:"left",source:"right"},{gate:"bottom",drain:"right",source:"left"}],Lli=(e)=>{let t=(e%360+360)%360;if(t%90!==0)throw Error(`Schematic rotation ${e} is not supported for Mosfet`);return[{gate:"left",drain:"top",source:"bottom"},{gate:"top",drain:"right",source:"left"},{gate:"right",drain:"bottom",source:"top"},{gate:"bottom",drain:"left",source:"right"}][t/90]},Hli=(e)=>{let t={drain:e.symbolDrainSide,source:e.symbolSourceSide,gate:e.symbolGateSide},n=Lli(Number(e.schRotation??0)),o=kli.filter((r)=>Object.keys(t).every((i)=>t[i]===void 0||t[i]===r[i]));if(o.length===0){let r=Object.entries(t).filter(([,i])=>i!==void 0).map(([i,s])=>`${i}=${s}`).join(", ");throw Error(`Invalid MOSFET symbol port side combination (${r}). The gate must be perpendicular to the drain and source, and the drain and source must be opposite.`)}return o.sort((r,i)=>{let s=(a)=>Object.keys(n).filter((c)=>a[c]!==n[c]).length;return s(r)-s(i)})[0]},Fli=(e)=>{let t=e.mosfetMode==="depletion"?"d":"e",n=`${e.channelType}_channel_${t}_mosfet_transistor`;if(!(e.symbolDrainSide!==void 0||e.symbolSourceSide!==void 0||e.symbolGateSide!==void 0))return n;let{gate:r,drain:i}=Hli(e);return`${n}_gate_${r}_drain_${i}`},dSn=class extends bl{get config(){return{componentName:"Mosfet",schematicSymbolName:this.props.symbolName??Fli(this.props),zodProps:wDt,shouldRenderAsSchematicBox:!1}}doInitialSourceRender(){let{db:e}=this.root,{_parsedProps:t}=this,n=e.source_component.insert({ftype:"simple_mosfet",name:this.name,manufacturer_part_number:ii(t),supplier_part_numbers:t.supplierPartNumbers,mosfet_mode:t.mosfetMode,channel_type:t.channelType,display_name:t.displayName});this.source_component_id=n.source_component_id}};function zli(e,t){let{injectionDb:n,subcircuit:o,groupsMap:r}=t,i=n.pcb_component.getWhere({source_component_id:e.source_component_id}),{pcbX:s,pcbY:a}=zb({pcbComponent:i,sourceGroupId:e.source_group_id,inflatorContext:t}),c=new dSn({name:e.name,channelType:e.channel_type,mosfetMode:e.mosfet_mode,manufacturerPartNumber:e.manufacturer_part_number,supplierPartNumbers:e.supplier_part_numbers??void 0,displayName:e.display_name,layer:i?.layer,pcbX:s,pcbY:a,pcbRotation:i?.rotation,doNotPlace:i?.do_not_place,obstructsWithinBounds:i?.obstructs_within_bounds});if(i){let l=Fb(i,{...t,normalComponent:c});if(l)c.add(l)}if(e.source_group_id&&r?.has(e.source_group_id))r.get(e.source_group_id).add(c);else o.add(c)}function Oli(e,t){let{injectionDb:n,subcircuit:o}=t;if(e.source_component_id!==null)return;let r=n.pcb_port.getWhere({source_port_id:e.source_port_id}),i=new Lh({name:e.name,pinNumber:e.pin_number});o.add(i),i.source_port_id=e.source_port_id;let s=o.root;if(s&&r){let{db:a}=s,c=a.pcb_port.insert({pcb_component_id:void 0,layers:r.layers,subcircuit_id:o.subcircuit_id??void 0,pcb_group_id:o.getGroup()?.pcb_group_id??void 0,x:r.x,y:r.y,source_port_id:e.source_port_id,is_board_pinout:!1});i.pcb_port_id=c.pcb_port_id}}var uSn=class extends bl{get config(){return{componentName:"PushButton",schematicSymbolName:this.props.symbolName??"push_button_normally_open_momentary",zodProps:mDt,sourceFtype:XS.simple_push_button}}get defaultInternallyConnectedPinNames(){return[]}initPorts(){super.initPorts({pinCount:2,ignoreSymbolPorts:!0});let e=Es[this._getSchematicSymbolNameOrThrow()],t=e.ports.find((a)=>a.labels.includes("1")),n=e.ports.find((a)=>a.labels.includes("2")),o=this.selectAll("port"),r=o.find((a)=>a.props.pinNumber===1);r.schematicSymbolPortDef=t;let i=new Set(r._getPortsInternallyConnectedToThisPort()),s=o.filter((a)=>a!==r&&!i.has(a)).sort((a,c)=>(a.props.pinNumber??0)-(c.props.pinNumber??0))[0];if(s)s.schematicSymbolPortDef=n}doInitialSourceRender(){let{db:e}=this.root,{_parsedProps:t}=this,n=e.source_component.insert({name:this.name,ftype:XS.simple_push_button,supplier_part_numbers:t.supplierPartNumbers,manufacturer_part_number:ii(t),are_pins_interchangeable:!0,display_name:t.displayName});this.source_component_id=n.source_component_id}};function Vli(e,t){let{injectionDb:n,subcircuit:o,groupsMap:r}=t,i=n.pcb_component.getWhere({source_component_id:e.source_component_id}),s=n.cad_component.getWhere({source_component_id:e.source_component_id}),{pcbX:a,pcbY:c}=zb({pcbComponent:i,sourceGroupId:e.source_group_id,inflatorContext:t}),l=new uSn({name:e.name,layer:i?.layer,pcbX:a,pcbY:c,pcbRotation:i?.rotation,doNotPlace:i?.do_not_place,obstructsWithinBounds:i?.obstructs_within_bounds});if(i){let h=Fb(i,{...t,normalComponent:l});if(h)l.add(h)}if(e.source_group_id&&r?.has(e.source_group_id))r.get(e.source_group_id).add(l);else o.add(l)}var pSn=class extends bl{_adjustSilkscreenTextAutomatically=!0;get config(){let e=this.props.symbolName??"boxresistor",t=this.props.schSize==="sm"||this.props.schSize==="xs"?this.props.schSize:void 0,n=t&&(e==="boxresistor"||e==="resistor")?`${e}_${t}`:void 0;return{componentName:"Resistor",schematicSymbolName:n&&`${n}_right`in Es?n:e,zodProps:zTt,sourceFtype:"simple_resistor"}}initPorts(){super.initPorts({additionalAliases:{pin1:["anode","pos","left"],pin2:["cathode","neg","right"]}})}_getSchematicSymbolDisplayValue(){return`${qh(this._parsedProps.resistance)}Ω`}doInitialCreateNetsFromProps(){this._createNetsFromProps([this.props.pullupFor,this.props.pullupTo,this.props.pulldownFor,this.props.pulldownTo,...this._getNetsFromConnectionsProp()])}doInitialCreateTracesFromProps(){if(this.props.pullupFor&&this.props.pullupTo)this.add(new d_({from:`${this.getSubcircuitSelector()} > port.1`,to:this.props.pullupFor})),this.add(new d_({from:`${this.getSubcircuitSelector()} > port.2`,to:this.props.pullupTo}));if(this.props.pulldownFor&&this.props.pulldownTo)this.add(new d_({from:`${this.getSubcircuitSelector()} > port.1`,to:this.props.pulldownFor})),this.add(new d_({from:`${this.getSubcircuitSelector()} > port.2`,to:this.props.pulldownTo}));this._createTracesFromConnectionsProp()}doInitialSourceRender(){let{db:e}=this.root,{_parsedProps:t}=this,n=e.source_component.insert({ftype:"simple_resistor",name:this.name,manufacturer_part_number:ii(t),supplier_part_numbers:t.supplierPartNumbers,resistance:t.resistance,display_resistance:this._getSchematicSymbolDisplayValue(),are_pins_interchangeable:!0,display_name:t.displayName});this.source_component_id=n.source_component_id}};function Yli(e,t){let{injectionDb:n,subcircuit:o,groupsMap:r}=t,i=n.pcb_component.getWhere({source_component_id:e.source_component_id}),s=n.cad_component.getWhere({source_component_id:e.source_component_id}),{pcbX:a,pcbY:c}=zb({pcbComponent:i,sourceGroupId:e.source_group_id,inflatorContext:t}),l=new pSn({name:e.name,resistance:e.resistance,layer:i?.layer,pcbX:a,pcbY:c,pcbRotation:i?.rotation,doNotPlace:i?.do_not_place,obstructsWithinBounds:i?.obstructs_within_bounds});if(i){let h=Fb(i,{...t,normalComponent:l});if(h)l.add(h)}if(e.source_group_id&&r?.has(e.source_group_id))r.get(e.source_group_id).add(l);else o.add(l)}function Gli(e){return e.simSwitchFrequency!==void 0||e.simCloseAt!==void 0||e.simOpenAt!==void 0||e.simStartClosed!==void 0||e.simStartOpen!==void 0}var mSn=class extends bl{_getSwitchType(){let e=this._parsedProps;if(!e)return"spst";if(e.dpdt)return"dpdt";if(e.spst)return"spst";if(e.spdt)return"spdt";if(e.dpst)return"dpst";return e.type??"spst"}get config(){let e=this._getSwitchType(),t=this._parsedProps?.isNormallyClosed??!1,n={spst:t?"spst_normally_closed_switch":"spst_switch",spdt:t?"spdt_normally_closed_switch":"spdt_switch",dpst:t?"dpst_normally_closed_switch":"dpst_switch",dpdt:t?"dpdt_normally_closed_switch":"dpdt_switch"};return{componentName:"Switch",schematicSymbolName:this.props.symbolName??n[e],zodProps:kDt,shouldRenderAsSchematicBox:!1}}doInitialSourceRender(){let{db:e}=this.root,t=this._parsedProps??{},n=e.source_component.insert({ftype:"simple_switch",name:this.name,manufacturer_part_number:ii(t),supplier_part_numbers:t.supplierPartNumbers,are_pins_interchangeable:this._getSwitchType()==="spst",display_name:t?.displayName});this.source_component_id=n.source_component_id}doInitialSimulationRender(){let{_parsedProps:e}=this;if(!Gli(e))return;let{db:t}=this.root,n={type:"simulation_switch",source_component_id:this.source_component_id||""};if(e.simSwitchFrequency!==void 0)n.switching_frequency=mp.parse(e.simSwitchFrequency);if(e.simCloseAt!==void 0)n.closes_at=lc.parse(e.simCloseAt);if(e.simOpenAt!==void 0)n.opens_at=lc.parse(e.simOpenAt);if(e.simStartOpen!==void 0)n.starts_closed=!e.simStartOpen;if(e.simStartClosed!==void 0)n.starts_closed=e.simStartClosed;t.simulation_switch.insert(n)}},Uli=(e,t)=>{let n=t.injectionDb.source_port.list().filter((s)=>s.source_component_id===e.source_component_id),o={},r=0;for(let s of n){let a=s.pin_number;if(a===void 0||a===null)continue;r=Math.max(r,a);let c=Array.from(new Set([s.name,...s.port_hints??[]].filter((l)=>typeof l==="string"&&l.length>0)));if(c.length>0)o[`pin${a}`]=c}let i="spst";if(r>=5)i="dpdt";else if(r===4)i="dpst";else if(r===3)i="spdt";return{type:i,pinLabels:Object.keys(o).length>0?o:void 0}};function Wli(e,t){let{injectionDb:n,subcircuit:o,groupsMap:r}=t,i=n.pcb_component.getWhere({source_component_id:e.source_component_id}),{pcbX:s,pcbY:a}=zb({pcbComponent:i,sourceGroupId:e.source_group_id,inflatorContext:t}),c=Uli(e,t),l=new mSn({name:e.name,displayName:e.display_name,...c,layer:i?.layer,pcbX:s,pcbY:a,pcbRotation:i?.rotation,doNotPlace:i?.do_not_place,obstructsWithinBounds:i?.obstructs_within_bounds});if(i){let h=Fb(i,{...t,normalComponent:l});if(h)l.add(h)}if(e.source_group_id&&r?.has(e.source_group_id))r.get(e.source_group_id).add(l);else o.add(l)}function Xli(e){if(e.length<=2)return[];let t=e[0],n=e[e.length-1];return e.slice(1,-1).filter((o)=>{let r=lk(o),i=lk(t),s=lk(n),a=r.x===i.x&&r.y===i.y,c=r.x===s.x&&r.y===s.y;return!a&&!c}).map((o)=>{if(o.route_type==="via")return{x:o.x,y:o.y,via:!0,fromLayer:o.from_layer,toLayer:o.to_layer};let r=lk(o);return{x:r.x,y:r.y}})}var jli=(e,t)=>{let{injectionDb:n,subcircuit:o,groupsMap:r}=t,i=[],s=e.source_group_id;while(s&&s!==o.source_group_id){let a=n.source_group.get(s),c=r?.get(s);if(!a||!c)break;let l=c.props.name??c.fallbackUnassignedName;i.unshift(`.${l}`),s=a.parent_source_group_id}return i.push(`.${e.name}`),i.join(" > ")};function Kli(e,t){let{injectionDb:n,subcircuit:o}=t,r=[];for(let d of e.connected_source_port_ids){let u=n.source_port.get(d);if(!u)continue;let _;if(u.source_component_id){let p=n.source_component.get(u.source_component_id);if(p)_=`${jli({name:p.name,source_group_id:p.source_group_id},t)} > .${u.name}`}else _=`.${u.name}`;if(_)r.push(_)}for(let d of e.connected_source_net_ids){let u=n.source_net.get(d);if(u)r.push(`net.${u.name}`)}if(r.length<2)return;let i=n.pcb_trace.list().filter((d)=>d.source_trace_id===e.source_trace_id),s=i[0],a;if(s)a=Xli(s.route);let c=e.min_trace_thickness;if(!c&&s?.route){let d=s.route.find((u)=>u.route_type==="wire");if(d&&d.route_type==="wire")c=d.width}let l={path:r};if(c!==void 0)l.thickness=c;if(a&&a.length>0)l.pcbPath=a;else if(!s&&e.connected_source_port_ids.length===2&&e.connected_source_net_ids.length===0)l.pcbStraightLine=!0;let h=new d_(l);h._inflatedPcbTraces=i.length>0?i:void 0,h._inflatedPcbVias=s?n.pcb_via.list().filter((d)=>i.some((u)=>d.pcb_trace_id===u.pcb_trace_id)):void 0,o.add(h)}var $li={collector:["c"],base:["b"],emitter:["e"]},_Sn=class extends bl{get config(){let e=this.props.type==="npn"?"npn_bipolar_transistor":"pnp_bipolar_transistor";return{componentName:"Transistor",schematicSymbolName:this.props.symbolName??e,zodProps:MDt,sourceFtype:"simple_transistor",shouldRenderAsSchematicBox:!1}}initPorts(){let e={},t=this.getSchematicSymbol();for(let n of t?.ports??[]){let o=r7e(n.labels);if(!o)continue;for(let r of n.labels){let i=$li[r];if(i)e[`pin${o}`]=i}}super.initPorts({pinCount:3,additionalAliases:e})}get collector(){return this.portMap.collector}get base(){return this.portMap.base}get emitter(){return this.portMap.emitter}doInitialCreateNetsFromProps(){this._createNetsFromProps([...this._getNetsFromConnectionsProp()])}doInitialCreateTracesFromProps(){this._createTracesFromConnectionsProp()}doInitialSourceRender(){let{db:e}=this.root,{_parsedProps:t}=this,n=e.source_component.insert({ftype:"simple_transistor",name:this.name,manufacturer_part_number:ii(t),supplier_part_numbers:t.supplierPartNumbers,transistor_type:t.type,display_name:t.displayName});this.source_component_id=n.source_component_id}};function qli(e,t){let{injectionDb:n,subcircuit:o,groupsMap:r}=t,i=n.pcb_component.getWhere({source_component_id:e.source_component_id}),s=n.cad_component.getWhere({source_component_id:e.source_component_id}),{pcbX:a,pcbY:c}=zb({pcbComponent:i,sourceGroupId:e.source_group_id,inflatorContext:t}),l=new _Sn({name:e.name,type:e.transistor_type,layer:i?.layer,pcbX:a,pcbY:c,pcbRotation:i?.rotation,doNotPlace:i?.do_not_place,obstructsWithinBounds:i?.obstructs_within_bounds});if(i){let h=Fb(i,{...t,normalComponent:l});if(h)l.add(h)}if(e.source_group_id&&r?.has(e.source_group_id))r.get(e.source_group_id).add(l);else o.add(l)}function Jli(e){let{injectionDb:t,subcircuit:n,groupsMap:o}=e,r=["pcb_silkscreen_rect","pcb_silkscreen_circle","pcb_silkscreen_line","pcb_silkscreen_path","pcb_silkscreen_text","pcb_fabrication_note_text","pcb_fabrication_note_path","pcb_fabrication_note_rect","pcb_note_text","pcb_note_rect","pcb_note_path","pcb_note_line","pcb_via","pcb_hole","pcb_plated_hole","pcb_cutout","pcb_soldermask_opening","pcb_solder_paste"],i=t.toArray().filter((a)=>{if(!r.includes(a.type))return!1;if(a.type==="pcb_via"){if(!a.pcb_trace_id)return!0;let c=t.pcb_trace.get(a.pcb_trace_id),l=c?.source_trace_id;return!(l&&t.source_trace.get(l)&&c?.route.some((d)=>d.route_type==="via"&&Math.abs(d.x-a.x)<0.0001&&Math.abs(d.y-a.y)<0.0001))}if(a.type==="pcb_cutout")return!0;if(a.type==="pcb_solder_paste")return a.pcb_component_id===void 0&&!a.pcb_smtpad_id;if(a.type==="pcb_soldermask_opening")return a.pcb_component_id===void 0;return"pcb_component_id"in a&&(a.pcb_component_id===null||a.pcb_component_id===void 0)});if(i.length===0)return;let s=sB({componentName:"",componentRotation:"0deg"},i);for(let a of s)n.add(a)}var j8e=(e,t,n)=>{if(!t)return;let o=As(t);if(t&&n?.length>0)throw Error("Component cannot have both circuitJson and children");let i={injectionDb:o,subcircuit:e,groupsMap:new Map},s=o.source_group.list(),a=new Set,c=[...s];while(c.length>0){let _=c.findIndex((m)=>!m.parent_source_group_id||a.has(m.parent_source_group_id));if(_===-1){let m=c.map((A)=>A.source_group_id).join(", ");throw Error(`Cannot inflate source_groups: cyclic dependency or missing parent detected. Remaining groups: ${m}`)}let p=c[_];Dli(p,i),a.add(p.source_group_id),c.splice(_,1)}let l=o.pcb_board.list();for(let _ of l)Kkr(_,i);let h=o.source_component.list();for(let _ of h)switch(_.ftype){case"simple_resistor":Yli(_,i);break;case"simple_capacitor":nLr(_,i);break;case"simple_inductor":Nli(_,i);break;case"simple_diode":ILr(_,i);break;case"simple_fiducial":SLr(_,i);break;case"simple_led":Qli(_,i);break;case"simple_chip":iLr(_,i);break;case"simple_connector":xLr(_,i);break;case"simple_transistor":qli(_,i);break;case"simple_mosfet":zli(_,i);break;case"simple_push_button":Vli(_,i);break;case"simple_switch":Wli(_,i);break;default:throw Error(`No inflator implemented for source component ftype: "${_.ftype}"`)}let d=o.source_port.list();for(let _ of d)Oli(_,i);let u=o.source_trace.list();for(let _ of u)Kli(_,i);Jli(i)},gSn=(e)=>{if(GQr(e)){SY(e);return}let{mountedTo:t,mountRotation:n,mountRotationAnchor:o,mountOrientation:r}=e._parsedProps;if(!t){if(n||o||r)throw Error(`board "${e.name}" mounting alignment requires mountedTo`);return}let i=t.lastIndexOf("."),s=t.slice(0,i),a=t.slice(i+1);if(i<1||a!=="backface")throw Error(`board "${e.name}" mountedTo "${t}" must name a motor backface, e.g. "NEMA17.backface"`);let c=FY(e).filter((d)=>d.componentName==="AssemblyMotor"&&Sue(d,s));if(c.length!==1)throw Error(`board "${e.name}" mountedTo "${t}" matched ${c.length} motors; expected exactly one in the assembly device`);let l=c[0];if(l._parsedProps.mountedTo){SY(e);return}let h=l._parsedProps.shaftFacingDirection;if(h!=="z+"&&h!=="z-")throw Error(`board "${e.name}" cannot mount to motor "${s}" facing ${h}: rotated PCB boards are not yet supported; use shaftFacingDirection="z+" or "z-"`);if(o&&!n)throw Error(`board "${e.name}" mountRotationAnchor requires mountRotation`);if(l.props.shaftFacingDirection&&r){if(r!==(h==="z+"?"top_layer_toward_mount_face":"bottom_layer_toward_mount_face"))throw Error(`board "${e.name}" mountOrientation "${r}" conflicts with motor "${s}" shaftFacingDirection "${h}"`)}return l},ASn=(e)=>{let t=FY(e).filter((n)=>n.componentName==="Board").filter((n)=>gSn(n)===e);if(t.length>1)throw Error(`assembly.motor "${e.name}" has multiple mounted boards; only one board may determine its placement`);return t[0]};function Zli(){if(typeof jRe!=="function")return As([]);let e=jRe([],{indexConfig:{byId:!0,byType:!0}});if(typeof e.insert!=="function"||typeof e.insertAll!=="function"||typeof e.subtree!=="function")return As([]);return e}var ySn=class{firstChild=null;children;db;root=null;isRootCircuit=!1;cachedSubcircuits;pendingSubcircuitRenders;_schematicDisabledOverride;get schematicDisabled(){if(this._schematicDisabledOverride!==void 0)return this._schematicDisabledOverride;if(this.platform?.schematicDisabled!==void 0)return this.platform.schematicDisabled;return this._getBoard()?._parsedProps?.schematicDisabled??!1}set schematicDisabled(e){this._schematicDisabledOverride=e}pcbDisabled=!1;pcbRoutingDisabled=!1;_featureMspSchematicTraceRouting=!0;_featurePcbViaStitching=!0;name;platform;projectUrl;_hasRenderedAtleastOnce=!1;_asyncEffectIdsByPhase=new Map;_asyncEffectPhaseById=new Map;_hasUnrenderedUpdatesFromAsyncEffects=!1;_runningAsyncEffectsById=new Map;constructor({platform:e,projectUrl:t,cachedSubcircuits:n,pendingSubcircuitRenders:o}={}){this.children=[],this.db=Zli(),this.platform=e,this.projectUrl=t,this.pcbDisabled=e?.pcbDisabled??!1,this.pcbRoutingDisabled=e?.routingDisabled??!1,this.cachedSubcircuits=n,this.pendingSubcircuitRenders=o,this.root=this}add(e){let t;if(fSn.isValidElement(e))t=Iue(e);else t=e;this.children.push(t)}setPlatform(e){if(this.platform={...this.platform,...e},e.pcbDisabled!==void 0)this.pcbDisabled=e.pcbDisabled;if(e.routingDisabled!==void 0)this.pcbRoutingDisabled=e.routingDisabled}_getBoard(){let e=(t)=>{for(let n of t){if(n.componentName==="Board")return n;if(s8e(n)){let o=e(n.children);if(o)return o}}return};return e(this.children)}_guessRootComponent(){if(this.firstChild)return;if(this.children.length===0)throw Error("Not able to guess root component: IsolatedCircuit has no children (use circuit.add(...))");let e=this.children.filter((n)=>n.lowercaseComponentName==="panel");if(e.length>1)throw Error("Only one <panel> is allowed per circuit");if(e.length===1){if(this.children.length!==1)throw Error("<panel> must be the root element of the circuit");this.firstChild=e[0];return}if(this.children.length===1&&(this.children[0].isGroup||s8e(this.children[0]))){this.firstChild=this.children[0];return}let t=new tP({subcircuit:!0});t.parent=this,t.addAll(this.children),this.children=[t],this.firstChild=t}render(){if(!this.firstChild)this._guessRootComponent();let{firstChild:e,db:t}=this;if(!e)throw Error("IsolatedCircuit has no root component");e.parent=this,e.runRenderCycle(),this._hasUnrenderedUpdatesFromAsyncEffects=!1,this._hasRenderedAtleastOnce=!0}async renderUntilSettled(){if(!this.db.source_project_metadata.list()?.[0])this.db.source_project_metadata.insert({software_used_string:`@tscircuit/core@${this.getCoreVersion()}`,...this.projectUrl?{project_url:this.projectUrl}:{}});this.render();while(!this.isDoneRendering())if(await new Promise((t)=>{let n=()=>{clearTimeout(o),this.removeListener("asyncEffect:end",n),t()},o=setTimeout(n,100);if(this.on("asyncEffect:end",n),this._hasUnrenderedUpdatesFromAsyncEffects)n()}),this._hasUnrenderedUpdatesFromAsyncEffects||this._asyncEffectPhaseById.size===0)this.render();this.emit("renderComplete")}isDoneRendering(){return this._hasRenderedAtleastOnce&&!this._hasIncompleteAsyncEffects()}_hasIncompleteAsyncEffects(){if(this._asyncEffectPhaseById.size>0)return!0;if(this._hasUnrenderedUpdatesFromAsyncEffects)return!0;return this.children.some((e)=>e._hasIncompleteAsyncEffects())}_hasIncompleteAsyncEffectsForPhase(e){return(this._asyncEffectIdsByPhase.get(e)?.size??0)>0}getRunningAsyncEffects(){return Array.from(this._runningAsyncEffectsById.values())}getCircuitJson(){if(!this._hasRenderedAtleastOnce)this.render();return this.db.toArray()}toJson(){return this.getCircuitJson()}async getSvg(e){let t=await Promise.resolve().then(() => (bze(),OSt)).catch((n)=>{throw Error(`To use circuit.getSvg, you must install the "circuit-to-svg" package.

"${n.message}"`)});if(e.view==="pcb")return t.convertCircuitJsonToPcbSvg(this.getCircuitJson());if(e.view==="schematic")return t.convertCircuitJsonToSchematicSvg(this.getCircuitJson());throw Error(`Invalid view: ${e.view}`)}getCoreVersion(){let[e,t,n]=oSn.version.split(".").map(Number);return`${e}.${t}.${n+1}`}async preview(e){let t=typeof e==="object"?e:{previewName:e};throw Error("project.preview is not yet implemented")}computeSchematicGlobalTransform(){return nit.identity()}_computePcbGlobalTransformBeforeLayout(){return nit.identity()}selectAll(e){return this._guessRootComponent(),this.firstChild?.selectAll(e)??[]}selectOne(e,t){return this._guessRootComponent(),this.firstChild?.selectOne(e,t)??null}_hasRenderLifecycleListeners=!1;_eventListeners={};emit(e,...t){if(e==="asyncEffect:start")this._registerAsyncEffectStart(t[0]);else if(e==="asyncEffect:end")this._registerAsyncEffectEnd(t[0]);if(!this._eventListeners[e])return;for(let n of this._eventListeners[e])n(...t)}hasEventListener(e){return(this._eventListeners[e]?.length??0)>0}on(e,t){if(!this._eventListeners[e])this._eventListeners[e]=[];if(this._eventListeners[e].push(t),e.startsWith("renderable:renderLifecycle:"))this._hasRenderLifecycleListeners=!0}removeListener(e,t){if(!this._eventListeners[e])return;if(this._eventListeners[e]=this._eventListeners[e].filter((n)=>n!==t),e.startsWith("renderable:renderLifecycle:"))this._hasRenderLifecycleListeners=Object.entries(this._eventListeners).some(([n,o])=>n.startsWith("renderable:renderLifecycle:")&&o.length>0)}enableDebug(e){if(typeof e==="string")tit.default.enable(e);else if(e===null||e===!1)tit.default.disable()}getClientOrigin(){if(typeof window<"u"&&window.location)return window.location.origin;if(typeof self<"u"&&self.location)return self.location.origin;return""}_registerAsyncEffectStart(e){if(!e?.asyncEffectId||!e.phase)return;let{asyncEffectId:t,phase:n}=e,o=this._asyncEffectPhaseById.get(t);if(o&&o!==n)this._asyncEffectIdsByPhase.get(o)?.delete(t);if(!this._asyncEffectIdsByPhase.has(n))this._asyncEffectIdsByPhase.set(n,new Set);this._asyncEffectIdsByPhase.get(n).add(t),this._asyncEffectPhaseById.set(t,n),this._runningAsyncEffectsById.set(t,{asyncEffectId:t,effectName:e.effectName,componentDisplayName:e.componentDisplayName,phase:n,error:e.error})}_registerAsyncEffectEnd(e){if(!e?.asyncEffectId)return;let{asyncEffectId:t}=e,n=this._asyncEffectPhaseById.get(t)??e.phase;if(n){let o=this._asyncEffectIdsByPhase.get(n);if(o?.delete(t),o&&o.size===0)this._asyncEffectIdsByPhase.delete(n)}this._asyncEffectPhaseById.delete(t),this._runningAsyncEffectsById.delete(t),this._hasUnrenderedUpdatesFromAsyncEffects=!0}};function xSn(e){if(!e._isIsolatedSubcircuit)return;if(e._isolatedCircuitJson)return;if(!e.getSubcircuitPropHash)return;let t=e.getSubcircuitPropHash(),n=e.root?.cachedSubcircuits,o=e.root?.pendingSubcircuitRenders,r=n?.get(t);if(r){e._isolatedCircuitJson=r,e.children=[],e._normalComponentNameMap=null;return}let i=[...e.children];e.children=[],e._normalComponentNameMap=null;let s=e.root;e._queueAsyncEffect("render-isolated-subcircuit",async()=>{let a=n?.get(t);if(a){e._isolatedCircuitJson=a;return}let c=o?.get(t);if(c){e._isolatedCircuitJson=await c;return}let l,h,d=new Promise((u,_)=>{l=u,h=_});o?.set(t,d);try{let u=new ySn({platform:{...s.platform,pcbDisabled:s.pcbDisabled,schematicDisabled:s.schematicDisabled},cachedSubcircuits:n,pendingSubcircuitRenders:o});for(let p of i)u.add(p);await u.renderUntilSettled();let _=u.getCircuitJson();n?.set(t,_),e._isolatedCircuitJson=_,l(_)}catch(u){throw h(u instanceof Error?u:Error(String(u))),u}finally{o?.delete(t)}})}var ehi=new Set(["name","key","pcbX","pcbY","schX","schY","pcbLeftEdgeX","pcbRightEdgeX","pcbTopEdgeY","pcbBottomEdgeY","pcbRotation","schRotation"]);function Kve(e,t=new WeakSet){if(e===null)return"null";if(e===void 0)return"undefined";let n=typeof e;if(n==="string")return`"${e}"`;if(n==="number"||n==="boolean")return String(e);if(n==="function")return"[function]";if(n==="symbol")return"[symbol]";if(n==="object"){if(t.has(e))return"[circular]";if(t.add(e),e.$$typeof!==void 0){let i=typeof e.type==="string"?e.type:e.type?.name||"[component]",s=e.props?Kve(e.props,t):"{}";return`ReactElement(${i},${s})`}if(Array.isArray(e))return`[${e.map((s)=>Kve(s,t)).join(",")}]`;return`{${Object.keys(e).sort().map((i)=>`${i}:${Kve(e[i],t)}`).join(",")}}`}return String(e)}function CSn(e){let t={},n=Object.keys(e).sort();for(let o of n)if(!ehi.has(o)&&e[o]!==void 0)t[o]=e[o];return t}function bSn(e){return e.map((t)=>({componentName:t.componentName,props:CSn(t.props??{}),children:bSn(t.children)}))}function yxn(e){let t=2166136261;for(let n=0;n<e.length;n++)t^=e.charCodeAt(n),t=Math.imul(t,16777619);return t>>>0}function thi(e){let t=Kve(e),n=yxn(t),o=yxn(t+n.toString());return n.toString(16).padStart(8,"0")+o.toString(16).padStart(8,"0")}function ISn(e){let t={props:CSn(e.props??{}),children:bSn(e.children)};return thi(t)}var nhi=(e)=>{let{db:t}=e.root,n=e.root?.pcbRoutingDisabled||e.getInheritedProperty("routingDisabled"),o=e.root?.pcbDisabled,r=e.root?.schematicDisabled,i=e.root?.platform?.drcChecksDisabled??e.getInheritedProperty("drcChecksDisabled");if(i){e._drcChecksComplete=!0;return}let s=e.root?.platform?.netlistDrcChecksDisabled??e.getInheritedProperty("netlistDrcChecksDisabled"),a=e.root?.platform?.placementDrcChecksDisabled??e.getInheritedProperty("placementDrcChecksDisabled"),c=e.root?.platform?.routingDrcChecksDisabled??e.getInheritedProperty("routingDrcChecksDisabled"),l=!i&&!s,h=!i&&!r,d=!i&&!o&&!a,u=!i&&!o&&!n&&!c,_=e.root?.platform?.fabricatorEngine,p=e._parsedProps.fabricatorPreset,m=!i&&!o&&!!_&&!!p;if((u||m)&&e._hasIncompleteAsyncEffectsInSubtreeForPhase("PcbTraceRender"))return;let A=e._hasTracesToRoute();if((u||m)&&A&&!e._areChildSubcircuitsRouted())return;if(e._drcChecksComplete||e._drcChecksInProgress)return;let g=async(x)=>{let C=[],b=(P,M)=>{C.push(Promise.resolve().then(M).catch((B)=>{let T=B instanceof Error?B.message:String(B);return t.source_runtime_error.insert({error_type:"source_runtime_error",phase_name:"PcbDesignRuleChecks",message:`DRC could not complete (${P}): ${T}`}),[]}))},I=e.pcb_board_id;if(m&&_&&p&&I)b("fabricator",()=>_.runDrcChecks({circuitJson:x,fabricatorPreset:p,pcbBoardId:I}));if(u)b("routing",()=>n5e(x).then((P)=>P.filter((M)=>!e._isExpectedCastellatedHoleDrcError(M))));if(d){let P=t.toArray();b("placement",()=>t5e(x,{consolidateOverlaps:!1}).then((M)=>_K(x,M.filter((B)=>!e._isExpectedCastellatedHoleDrcError(B))).filter((B)=>!P.some((T)=>T.type===B.type&&("message"in T)&&T.message===B.message))))}if(l)b("netlist",()=>LBt(x));if(h)b("schematic",()=>HBt(x));if(!i)for(let P of e.selectAll("drccheck"))b(P.getString(),()=>P.runCustomDrcCheck(x));let v=await Promise.all(C);t.insertAll(_K(x,Zxe(v.flat())))},y=t.subtree({subcircuit_id:e.subcircuit_id}).toArray();e._drcChecksInProgress=!0,e._queueAsyncEffect("board:drc-checks",async()=>{try{await g(y),e._drcChecksComplete=!0}finally{e._drcChecksInProgress=!1}})},oit=1e6,Xhe=0.0000001*oit,xxn=(e,t)=>{if(e.route_type==="wire")return{point:e,layer:e.layer};if(e.route_type==="via")return{point:e,layer:t==="start"?e.from_layer:e.to_layer};return{point:e[t],layer:t==="start"?e.start_layer:e.end_layer}},ohi=(e,t=new Set)=>{let n=oa(e),o=e.filter((f)=>f.type==="pcb_copper_pour"),r=new Set(o.flatMap((f)=>f.source_net_id?[n.getNetConnectedToId(f.source_net_id)??f.source_net_id]:[])),i=[],s=(f)=>{if(r.has(f.netId)&&!f.polygon.isEmpty())i.push({...f,polygon:f.polygon.scale(oit,oit)})},a=new Map(e.filter((f)=>f.type==="pcb_component").map((f)=>[f.pcb_component_id,f])),c=e.filter((f)=>f.type==="pcb_via"),l=e.find((f)=>f.type==="pcb_board");for(let f of o){if(!f.source_net_id)continue;s({polygon:RN(f),layers:[f.layer],netId:n.getNetConnectedToId(f.source_net_id)??f.source_net_id,isTerminal:!1,pourId:f.pcb_copper_pour_id})}for(let f of e)if(f.type==="pcb_smtpad"){let y=n.getNetConnectedToId(f.pcb_smtpad_id);if(y&&r.has(y))s({polygon:zX(f),layers:[f.layer],netId:y,isTerminal:!!f.pcb_port_id})}else if(f.type==="pcb_plated_hole"){let y=n.getNetConnectedToId(f.pcb_plated_hole_id);if(y&&r.has(y))s({polygon:kN(f,f.pcb_component_id?a.get(f.pcb_component_id)?.rotation:0),layers:f.layers,netId:y,isTerminal:!!f.pcb_port_id})}else if(f.type==="pcb_via"){let y=n.getNetConnectedToId(f.pcb_via_id);if(y&&r.has(y))s({polygon:QN(f,f.outer_diameter,f.hole_diameter),layers:f.layers,netId:y,isTerminal:!t.has(f.pcb_via_id),viaId:f.pcb_via_id})}else if(f.type==="pcb_trace"){let y=n.getNetConnectedToId(f.pcb_trace_id);if(!y||!r.has(y))continue;for(let x=0;x<f.route.length;x++){let C=f.route[x];if(C.route_type==="via"){let B=c.find((T)=>T.x===C.x&&T.y===C.y&&T.layers.includes(C.from_layer)&&T.layers.includes(C.to_layer));s({polygon:QN(C,B?.outer_diameter??C.outer_diameter??l?.min_via_pad_diameter??0.3,B?.hole_diameter??C.hole_diameter??l?.min_via_hole_diameter??0.2),layers:B?.layers??WS({fromLayer:C.from_layer,toLayer:C.to_layer,layerCount:l?.num_layers??2}),netId:y,isTerminal:!1})}let b=f.route[x+1];if(!b)continue;let I=xxn(C,"end"),v=xxn(b,"start");if(I.layer!==v.layer)continue;let P=C.route_type==="via"?b.route_type==="via"?void 0:b.width:C.width;if(P===void 0)continue;let M=f.route_thickness_mode==="interpolated"&&b.route_type!=="via"?b.width:P;s({polygon:nz(I.point,v.point,P,M),layers:[I.layer],netId:y,isTerminal:!1})}}let h=new Set,d=new Set;if(i.length===0)return{floatingPourIds:h,floatingViaIds:d};let u=i.map((f,y)=>y),_=(f)=>{while(u[f]!==f)u[f]=u[u[f]],f=u[f];return f},p=i.map((f)=>f.polygon.box),m=new I4(i.length);for(let f of p)m.add(f.xmin,f.ymin,f.xmax,f.ymax);m.finish();for(let[f,y]of i.entries()){let x=p[f];for(let C of m.search(x.xmin-Xhe,x.ymin-Xhe,x.xmax+Xhe,x.ymax+Xhe)){if(C<=f||_(f)===_(C))continue;let b=i[C];if(y.netId!==b.netId||!y.layers.some((I)=>b.layers.includes(I)))continue;if(bbt(y.polygon,b.polygon,Xhe))u[_(C)]=_(f)}}let A=new Set(i.flatMap((f)=>f.isTerminal?[f.netId]:[])),g=new Set(i.flatMap((f,y)=>f.isTerminal?[_(y)]:[]));for(let[f,y]of i.entries()){if(!A.has(y.netId)||g.has(_(f)))continue;if(y.pourId)h.add(y.pourId);if(y.viaId)d.add(y.viaId)}return{floatingPourIds:h,floatingViaIds:d}},rhi=(e)=>{if(!e.root||e.root.pcbDisabled)return;let{db:t}=e.root;if(t.pcb_copper_pour.list().length===0)return;let n=t.subtree({subcircuit_id:e.subcircuit_id}).toArray();if(t.pcb_autorouting_error.list().length>0)return;if(!n.some((i)=>i.type==="pcb_copper_pour"))return;let{floatingPourIds:o,floatingViaIds:r}=ohi(n,e._generatedStitchingViaIds);for(let i of o)t.pcb_copper_pour.delete(i);for(let i of r)if(e._generatedStitchingViaIds.has(i))t.pcb_via.delete(i);for(let i of t.pcb_trace.list()){if(!i.route.some((s)=>("copper_pour_id"in s)&&s.copper_pour_id&&o.has(s.copper_pour_id)))continue;t.pcb_trace.update(i.pcb_trace_id,{route:i.route.map((s)=>{if(!("copper_pour_id"in s)||!s.copper_pour_id||!o.has(s.copper_pour_id))return s;let{copper_pour_id:a,is_inside_copper_pour:c,...l}=s;return l})})}},vSn=(e)=>{if(e._pcbTraceRenderWaitingForPlacementChecks)e.renderPhaseStates.PcbTraceRender.initialized=!1,e.renderPhaseStates.PcbTraceRender.dirty=!1,e._pcbTraceRenderWaitingForPlacementChecks=!1;for(let t of e.children)vSn(t)},ihi=(e)=>{if(e.root?.pcbDisabled)return;let t=e.root?.platform?.placementDrcChecksDisabled??e.getInheritedProperty("placementDrcChecksDisabled"),n=e.root?.platform?.drcChecksDisabled??e.getInheritedProperty("drcChecksDisabled");if(e._pcbPlacementDrcErrorCount=null,e._pcbPlacementDrcCheckError=null,e._pcbPlacementDrcChecksPending=!1,t||n){e._pcbPlacementDrcErrorCount=0;return}let{db:o}=e.root,r=o.subtree({subcircuit_id:e.subcircuit_id}).toArray(),i=o.toArray();e._pcbPlacementDrcChecksPending=!0,e._queueAsyncEffect("board:pre-route-placement-checks",async()=>{try{let s=await t5e(r,{consolidateOverlaps:!1}),a=_K(r,s.filter((l)=>!e._isExpectedCastellatedHoleDrcError(l))),c=a.filter((l)=>!i.some((h)=>h.type===l.type&&("message"in h)&&h.message===l.message));o.insertAll(c),e._pcbPlacementDrcErrorCount=a.filter((l)=>l.type.endsWith("_error")).length}catch(s){e._pcbPlacementDrcCheckError=s instanceof Error?s.message:String(s)}finally{e._pcbPlacementDrcChecksPending=!1,vSn(e)}})},shi=0.000001,ahi=(e)=>{if(!e)return[];return Array.isArray(e)?e:[e]},chi=class e extends Zw{outlinePointIndex;holeDiameter;padDiameter;port;trace;static fromBoardOutline(t){return(t??[]).flatMap((n,o)=>n.isCastellatedHole?[new e(n,o)]:[])}constructor(t,n){let o=`castellated_hole_${n+1}`,r=ahi(t.connectsTo),i=Ke.parse(t.holeDiameter),s=Ke.parse(t.padDiameter);super({shape:"circle",holeDiameter:i,outerDiameter:s,portHints:[o]});this.outlinePointIndex=n,this.holeDiameter=i,this.padDiameter=s,this.port=r.length>0?new Lh({name:o}):null,this.trace=this.port?new d_({path:[`port.${o}`,...r],displayName:`Castellated hole ${n+1} connectivity`}):null}_getParentBoard(){if(this.parent?.componentName!=="Board")throw Error("A board castellated hole must be a direct board child");return this.parent}_getPositionFromBoardOutline(){let t=this._getParentBoard(),o=(t.pcb_board_id?t.root?.db.pcb_board.get(t.pcb_board_id):null)?.outline?.[this.outlinePointIndex];if(!o)throw Error(`Missing emitted board outline point ${this.outlinePointIndex}`);return o}_getGlobalPcbPositionBeforeLayout(){return this._getPositionFromBoardOutline()}doInitialPcbPrimitiveRender(){if(this.root?.pcbDisabled)return;let{db:t}=this.root,n=this._getPositionFromBoardOutline(),o=t.pcb_plated_hole.insert({shape:"circle",outer_diameter:this.padDiameter,hole_diameter:this.holeDiameter,...n,layers:this.getAvailablePcbLayers(),port_hints:this.getNameAndAliases(),subcircuit_id:this.getSubcircuit()?.subcircuit_id??void 0});this.pcb_plated_hole_id=o.pcb_plated_hole_id}syncPositionToBoardOutline(){if(!this.pcb_plated_hole_id)return;this._setPositionFromLayout(this._getPositionFromBoardOutline())}removePcbPrimitiveRender(){let{db:t}=this.root;if(this.pcb_plated_hole_id)t.pcb_plated_hole.delete(this.pcb_plated_hole_id),this.pcb_plated_hole_id=null;if(this.matchedPort?.pcb_port_id)t.pcb_port.delete(this.matchedPort.pcb_port_id),this.matchedPort.pcb_port_id=null}isExpectedBoardEdgeDrcError(t){if(!this.pcb_plated_hole_id)return!1;if(t.type==="pcb_placement_error")return t.pcb_placement_error_id===`copper_too_close_to_board_edge_${this.pcb_plated_hole_id}`;if(t.type!=="pcb_trace_error"||!t.pcb_trace_error_id.startsWith("trace_too_close_to_board_"))return!1;let n=t.pcb_trace_error_id.match(/_segment_(\d+)$/);if(!n)return!1;let o=this.root?.db.pcb_trace.get(t.pcb_trace_id),r=Number(n[1]),i=[o?.route[r],o?.route[r+1]].flatMap((a)=>a&&("x"in a)&&("y"in a)?[{x:a.x,y:a.y}]:[]),s=this.root?.db.pcb_plated_hole.get(this.pcb_plated_hole_id);if(!s)return!1;return i.some((a)=>Math.hypot(a.x-s.x,a.y-s.y)<=shi)}},lhi=0.01,hhi=0.15,Cxn=(e,t,n)=>{let o=e/2,r=t/2,i=Math.min(n,o,r);if(i<lhi)return[{x:-o,y:-r},{x:o,y:-r},{x:o,y:r},{x:-o,y:r}];let s=0.1,a=Math.max(1,Math.ceil(Math.PI/2*i/s)),c=Math.PI/2/a,l=[];l.push({x:-o+i,y:-r}),l.push({x:o-i,y:-r});for(let h=1;h<=a;h++){let d=-Math.PI/2+h*c;l.push({x:o-i+i*Math.cos(d),y:-r+i+i*Math.sin(d)})}l.push({x:o,y:r-i});for(let h=1;h<=a;h++){let d=0+h*c;l.push({x:o-i+i*Math.cos(d),y:r-i+i*Math.sin(d)})}l.push({x:-o+i,y:r});for(let h=1;h<=a;h++){let d=Math.PI/2+h*c;l.push({x:-o+i+i*Math.cos(d),y:r-i+i*Math.sin(d)})}l.push({x:-o,y:-r+i});for(let h=1;h<=a;h++){let d=Math.PI+h*c;l.push({x:-o+i+i*Math.cos(d),y:-r+i+i*Math.sin(d)})}return l},P9=class extends tP{pcbFold;pcb_board_id=null;source_board_id=null;_drcChecksComplete=!1;_drcChecksInProgress=!1;_connectedSchematicPortPairs=new Set;_panelPositionOffset=null;_castellatedHoles;doInitialCadModelRender(){if(this.root?.pcbDisabled)return;gSn(this),super.doInitialCadModelRender()}constructor(e){super(e);this._castellatedHoles=chi.fromBoardOutline(this._parsedProps.outline);for(let t of this._castellatedHoles){if(t.port)this.add(t.port);if(this.add(t),t.trace)this.add(t.trace)}}doInitialPcbFlexRender(){if(!this.pcb_board_id)return;let e=this.root.db.pcb_bend.list().filter((o)=>o.pcb_board_id===this.pcb_board_id);if(this.pcbFold=void 0,!e.length)return;let t=this.root.db.pcb_board.get(this.pcb_board_id),n=wNr(e,this.boardThickness,{outline:t.outline?.map((o)=>({x:o.x-t.center.x,y:o.y-t.center.y}))});if(n.ok)this.pcbFold=n.value;else this.root.db.pcb_placement_error.insert({error_type:"pcb_placement_error",subcircuit_id:this.subcircuit_id??void 0,message:`Unable to fold PCB board ${this._parsedProps.name??"unnamed board"}; CAD remains flat: ${$xn(n.issue,e)}`})}get isSubcircuit(){return!0}get isGroup(){return!0}get config(){return{componentName:"Board",zodProps:JYe}}get boardThickness(){return this._parsedProps.thickness??1.4}get allLayers(){return bit(this._parsedProps.layers??2)}_getSubcircuitLayerCount(){return this._parsedProps.layers??2}_computePcbGlobalTransformBeforeLayout(){if(this._panelPositionOffset){let e=this.parent?._computePcbGlobalTransformBeforeLayout?.()??{a:1,b:0,c:0,d:1,e:0,f:0};return a7e.compose(e,a7e.translate(this._panelPositionOffset.x,this._panelPositionOffset.y))}return super._computePcbGlobalTransformBeforeLayout()}_getBoardCalcVariables(){let{_parsedProps:e}=this;if((e.width==null||e.height==null)&&!e.outline)return{};let n=this.pcb_board_id?this.root?.db.pcb_board.get(this.pcb_board_id):null,o=n?.width??e.width,r=n?.height??e.height;if((o==null||r==null)&&e.outline?.length){let h=Ms(e.outline);if(h)o??=h.maxX-h.minX,r??=h.maxY-h.minY}let{pcbX:i,pcbY:s}=this.getResolvedPcbPositionProp(),a=n?.center??{x:i+(e.outlineOffsetX??0),y:s+(e.outlineOffsetY??0)},c=o??0,l=r??0;return{"board.minX":a.x-c/2,"board.maxX":a.x+c/2,"board.minY":a.y-l/2,"board.maxY":a.y+l/2}}doInitialPcbBoardAutoSize(){if(this.root?.pcbDisabled)return;if(!this.pcb_board_id)return;let{db:e}=this.root,{_parsedProps:t}=this,n=this._getGlobalPcbPositionBeforeLayout(),o=e.pcb_board.get(this.pcb_board_id);if(o?.width&&o?.height||o?.outline&&o.outline.length>0)return;let r=1/0,i=1/0,s=-1/0,a=-1/0,c=kit(e,this.subcircuit_id),l=new Set([this.subcircuit_id,...c]),h=e.pcb_component.list().filter((b)=>b.subcircuit_id&&l.has(b.subcircuit_id)),d=e.pcb_group.list().filter((b)=>b.subcircuit_id&&l.has(b.subcircuit_id)),u=!1,_=(b,I,v)=>{if(I===0||v===0)return;u=!0,r=Math.min(r,b.x-I/2),i=Math.min(i,b.y-v/2),s=Math.max(s,b.x+I/2),a=Math.max(a,b.y+v/2)};for(let b of h)_(b.center,b.width,b.height);for(let b of d){let I=b.width??0,v=b.height??0;if(b.outline&&b.outline.length>0){let P=Ms(b.outline);if(P)I=P.maxX-P.minX,v=P.maxY-P.minY}_(b.center,I,v)}if(t.boardAnchorPosition){let{x:b,y:I}=t.boardAnchorPosition;r=Math.min(r,b),i=Math.min(i,I),s=Math.max(s,b),a=Math.max(a,I)}let p=2,m=u?s-r+p*2:0,A=u?a-i+p*2:0,g={x:u?(r+s)/2+(t.outlineOffsetX??0):(t.outlineOffsetX??0)+n.x,y:u?(i+a)/2+(t.outlineOffsetY??0):(t.outlineOffsetY??0)+n.y},f=t.width??m,y=t.height??A,x=t.outline;if(!x&&t.borderRadius!=null&&f>0&&y>0)x=Cxn(f,y,t.borderRadius).map((b)=>({x:b.x+g.x,y:b.y+g.y}));let C={width:f,height:y,center:g};if(x)C.outline=t.outline?x.map((b)=>({x:b.x+(t.outlineOffsetX??0),y:b.y+(t.outlineOffsetY??0)})):x;e.pcb_board.update(this.pcb_board_id,C)}updatePcbBoardAutoSize(){this.doInitialPcbBoardAutoSize()}_addBoardInformationToSilkscreen(){let e=this.root?.platform;if(!e?.printBoardInformationToSilkscreen)return;let t=this.root.db.pcb_board.get(this.pcb_board_id);if(!t)return;let n=[];if(e.projectName)n.push(e.projectName);if(e.version)n.push(`v${e.version}`);if(e.url)n.push(e.url);if(n.length===0)return;let o=n.join(`
`),r=0.25,i=1,s={x:t.center.x+t.width/2-r,y:t.center.y-t.height/2+i};this.root.db.pcb_silkscreen_text.insert({pcb_component_id:this.pcb_board_id,layer:"top",font:"tscircuit2024",font_size:0.45,text:o,ccw_rotation:0,anchor_alignment:"bottom_right",anchor_position:s})}doInitialSourceRender(){let e=this.getDescendants().find((o)=>o.lowercaseComponentName==="board");if(e)throw Error(`Nested boards are not supported: found board "${e.name}" inside board "${this.name}"`);super.doInitialSourceRender();let{db:t}=this.root,n=t.source_board.insert({source_group_id:this.source_group_id,title:this.props.title||this.props.name});this.source_board_id=n.source_board_id}getSubcircuitPropHash(){return ISn(this)}doInitialRenderIsolatedSubcircuits(){xSn(this)}doInitialInflateSubcircuitCircuitJson(){let e=this._isolatedCircuitJson;if(e){this._isInflatedFromCircuitJson=!0,this._isolatedCircuitJson=null,j8e(this,e,[]);return}let{circuitJson:t,children:n}=this._parsedProps;if(t)this._isInflatedFromCircuitJson=!0;j8e(this,t,n)}doInitialPcbComponentRender(){if(this.root?.pcbDisabled)return;let{db:e}=this.root,{_parsedProps:t}=this,o=t.circuitJson?.find((I)=>I.type==="pcb_board"),r=Iit(t.defaultViaTenting),i=this.props,s=i.isViaInPadAllowed??o?.is_via_in_pad_allowed,a=i.allowBlindAndBuriedVias??o?.allow_blind_and_buried_vias,c=t.width??o?.width??0,l=t.height??o?.height??0,h=this._getGlobalPcbPositionBeforeLayout(),d={x:h.x+(t.outlineOffsetX??0),y:h.y+(t.outlineOffsetY??0)},{boardAnchorPosition:u,boardAnchorAlignment:_}=t;if(u)d=jkr({boardAnchorPosition:u,boardAnchorAlignment:_??"center",width:c,height:l});if(t.outline){let I=t.outline.map((N)=>N.x),v=t.outline.map((N)=>N.y),P=Math.min(...I),M=Math.max(...I),B=Math.min(...v),T=Math.max(...v);c=M-P,l=T-B}let p=t.outline;if(!p&&t.borderRadius!=null&&c>0&&l>0)p=Cxn(c,l,t.borderRadius).map((I)=>({x:I.x+d.x,y:I.y+d.y}));let m={x:0,y:0};if(t.outline&&p&&p.length>0&&(this.parent?.lowercaseComponentName==="panel"||this.parent?.lowercaseComponentName==="subpanel")){let I=Ms(p);if(I){let v=(I.minX+I.maxX)/2,P=(I.minY+I.maxY)/2;m={x:d.x-v,y:d.y-P}}}let A=this.getSubcircuit()._parsedProps,g=this.getInheritedMergedProperty("pcbStyle"),f=gB(g),y=A.minViaHoleDiameter??(g?.viaHoleDiameter!==void 0?f.holeDiameter:void 0),x=y??Pb.min_via_hole_diameter,C=A.minViaPadDiameter??(g?.viaPadDiameter!==void 0?f.padDiameter:y!==void 0?y+hhi:Pb.min_via_pad_diameter),b=e.pcb_board.insert({source_board_id:this.source_board_id,subcircuit_id:this.subcircuit_id??void 0,center:d,default_via_tented_on_top:r.tented_on_top??o?.default_via_tented_on_top,default_via_tented_on_bottom:r.tented_on_bottom??o?.default_via_tented_on_bottom,thickness:this.boardThickness,num_layers:this.allLayers.length,width:c,height:l,outline:t.outline?p?.map((I)=>({x:I.x+(t.outlineOffsetX??0)+m.x,y:I.y+(t.outlineOffsetY??0)+m.y})):p,material:t.material,...s!==void 0&&{is_via_in_pad_allowed:s},...a!==void 0&&{allow_blind_and_buried_vias:a},...t.solderMaskColor!==void 0&&{solder_mask_color:t.solderMaskColor},...t.silkscreenColor!==void 0&&{silkscreen_color:t.silkscreenColor},min_trace_width:A.minTraceWidth??Pb.min_trace_width,min_via_hole_diameter:x,min_via_pad_diameter:C,min_via_hole_edge_to_via_hole_edge_clearance:A.minViaHoleEdgeToViaHoleEdgeClearance??Pb.min_via_hole_edge_to_via_hole_edge_clearance,min_via_edge_to_pad_edge_clearance:A.minViaEdgeToPadEdgeClearance??Pb.min_via_edge_to_pad_edge_clearance,min_trace_to_hole_edge_clearance:A.minTraceToHoleEdgeClearance??Pb.min_trace_to_hole_edge_clearance,min_trace_to_pad_edge_clearance:A.minTraceToPadEdgeClearance??Pb.min_trace_to_pad_edge_clearance,min_pad_edge_to_pad_edge_clearance:A.minPadEdgeToPadEdgeClearance??Pb.min_pad_edge_to_pad_edge_clearance,min_plated_hole_drill_edge_to_drill_edge_clearance:A.minPlatedHoleDrillEdgeToDrillEdgeClearance??Pb.min_plated_hole_drill_edge_to_drill_edge_clearance,min_board_edge_clearance:A.minBoardEdgeClearance??Pb.min_board_edge_clearance});this.pcb_board_id=b.pcb_board_id,this._addBoardInformationToSilkscreen()}removePcbComponentRender(){let{db:e}=this.root;if(!this.pcb_board_id)return;e.pcb_board.delete(this.pcb_board_id),this.pcb_board_id=null}doInitialPcbDesignRuleChecks(){super.doInitialPcbDesignRuleChecks(),this.updatePcbDesignRuleChecks()}doInitialPcbPlacementDesignRuleChecks(){ihi(this)}_generatedStitchingViaIds=new Set;doInitialPcbCopperPourCleanup(){rhi(this)}updatePcbDesignRuleChecks(){nhi(this)}runRenderPhaseForChildren(e){this.root?.emit("board:renderPhaseStarted",{renderId:this._renderId,phase:e}),super.runRenderPhaseForChildren(e)}_repositionOnPcb(e){let{db:t}=this.root,n=this.pcb_board_id?t.pcb_board.get(this.pcb_board_id):null,o=n?.center;if(!o){if(this.pcb_board_id)t.pcb_board.update(this.pcb_board_id,{center:e});return}let r=e.x-o.x,i=e.y-o.y;if(Math.abs(r)<0.000001&&Math.abs(i)<0.000001)return;if(this.pcb_board_id){if(t.pcb_board.update(this.pcb_board_id,{center:e}),n?.outline){let s=Ms(n.outline);if(s){let a={x:(s.minX+s.maxX)/2,y:(s.minY+s.maxY)/2},c=e.x-a.x,l=e.y-a.y,h=n.outline.map((d)=>({x:d.x+c,y:d.y+l}));t.pcb_board.update(this.pcb_board_id,{outline:h});for(let d of this._castellatedHoles)d.syncPositionToBoardOutline()}}}}_isExpectedCastellatedHoleDrcError(e){return this._castellatedHoles.some((t)=>t.isExpectedBoardEdgeDrcError(e))}},SSn=class extends tP{constructor(e){super({...e,subcircuit:!0})}getSubcircuitPropHash(){return ISn(this)}doInitialRenderIsolatedSubcircuits(){xSn(this)}doInitialCreateNetsFromProps(){super.doInitialCreateNetsFromProps(),this._createTracesForExposedConnections()}_createTracesForExposedConnections(){let e=this._getNetNamesToExpose();if(!e?.length)return;let t=this.parent?.getSubcircuit?.();if(!t)return;if(!this.name)return;for(let n of e){let o=dhi(n),r=`> net.${o}`,i=`.${this.name} > net.${o}`;if(!t.children.find((l)=>l instanceof dB&&l._parsedProps.name===o))t.add(new dB({name:o}));if(t.children.find((l)=>{if(!(l instanceof d_))return!1;if(!l._exposesSubcircuitConnection)return!1;let h=l._parsedProps;return h.from===i&&h.to===r}))continue;let c=new d_({from:i,to:r,displayName:o});c._exposesSubcircuitConnection=!0,t.add(c)}}_getNetNamesToExpose(){let e=this._parsedProps.exposedNets??[];if(!this._parsedProps.exposeNets)return e;let t=this.selectAll("net").filter((n)=>n instanceof dB&&n.getSubcircuit()===this).map((n)=>n._parsedProps.name);return Array.from(new Set([...e,...t]))}doInitialInflateSubcircuitCircuitJson(){let e=this._isolatedCircuitJson;if(e){this._isInflatedFromCircuitJson=!0,this._isolatedCircuitJson=null,j8e(this,e,[]);return}let{circuitJson:t,children:n}=this._parsedProps;if(t)this._isInflatedFromCircuitJson=!0;j8e(this,t,n)}},dhi=(e)=>e.startsWith("net.")?e.slice(4):e,uhi=class extends SSn{pcb_board_id=null;get config(){return{componentName:"MountedBoard",zodProps:dDt}}get boardThickness(){return 1.4}get allLayers(){return["top","bottom"]}_connectedSchematicPortPairs=new Set;_getBoardCalcVariables(){return this._findCarrierBoard()?._getBoardCalcVariables()??{}}_findCarrierBoard(){let e=this.parent;while(e){if(e instanceof P9)return e;e=e.parent}return null}doInitialPcbComponentRender(){if(this.root?.pcbDisabled)return;let{db:e}=this.root,{_parsedProps:t}=this,n=this._getGlobalPcbPositionBeforeLayout(),o=e.pcb_board.insert({center:{x:n.x,y:n.y},width:t.width??0,height:t.height??0,is_mounted_to_carrier_board:!0});this.pcb_board_id=o.pcb_board_id}doInitialPcbBoardAutoSize(){if(!this.pcb_board_id||!this.root)return;let e=this._findCarrierBoard();if(e?.pcb_board_id)this.root.db.pcb_board.update(this.pcb_board_id,{carrier_pcb_board_id:e.pcb_board_id})}},PSn=5,rit=2,ESn=(e,t)=>{let{gapLength:n,cutoutWidth:o,mouseBites:r,mouseBiteHoleDiameter:i,mouseBiteHoleSpacing:s}=t,a=[],c=[];if(e.length<2)return{tabCutouts:a,mouseBiteHoles:c};let l=new tl(e.map((d)=>jm(d.x,d.y))),h;if(e.length>2){let d=jm(e[0].x,e[0].y),u=jm(e[1].x,e[1].y),_=JF(d,u).normalize(),p=_.rotate(Math.PI/2),A=d.translate(_.multiply(QAe(d,u).length/2)).translate(p.multiply(0.01));h=l.contains(A)}else h=l.area()>0;for(let d=0;d<e.length;d++){let u=e[d],_=e[(d+1)%e.length];if(!u||!_)continue;let p=jm(u.x,u.y),m=jm(_.x,_.y),A=QAe(p,m),g=A.length;if(g<0.000001)continue;let f=JF(p,m),y=f.normalize(),x=y.rotate(Math.PI/2),b=A.middle().translate(x.multiply(0.01));if(l.contains(b))x=x.multiply(-1);let I=2,v=I*i+(I-1)*s,P;if(r)P=v;else P=n;P=Math.min(P,g*0.9);let M=(g-P)/2,B=M+P;if(r){let O=i+s;if(P>=v&&O>0){let U=(P-v)/2+i/2,j=M+U;for(let Y=0;Y<I;Y++){let X=j+Y*O,K=p.translate(y.multiply(X));c.push({x:K.x,y:K.y})}}}let T=e[(d-1+e.length)%e.length],N=e[(d+2)%e.length],D=0,L=0;if(T&&N){let O=JF(jm(T.x,T.y),p),U=O.cross(f),j=h?U>0.000000001:U<-0.000000001,Y=JF(m,jm(N.x,N.y)),X=f.cross(Y),K=h?X>0.000000001:X<-0.000000001;if(j){let J=O.angleTo(f);if(J>Math.PI)J=2*Math.PI-J;D=o*Math.tan(J/2)}else D=0;if(K){let J=f.angleTo(Y);if(J>Math.PI)J=2*Math.PI-J;L=o*Math.tan(J/2)}else L=0}let H=P<0.000001?[{start:0-D,end:g+L}]:[{start:0-D,end:M},{start:B,end:g+L}],V=x.multiply(o);for(let O of H){let U=O.end-O.start;if(U<0.000001)continue;let Y=p.translate(y.multiply(O.start+U/2)).translate(V.multiply(0.5)),X=U,K=o,J=y.slope*180/Math.PI;a.push({type:"pcb_cutout",shape:"rect",center:{x:Y.x,y:Y.y},width:X,height:K,rotation:J,corner_radius:o/2})}}return{tabCutouts:a,mouseBiteHoles:c}};function phi(e,t){let n=[],o=[],{tabWidth:r,tabLength:i,mouseBites:s}=t,a=[];for(let u of e)if(u.width&&u.height)a.push(Math.min(u.width,u.height));else if(u.outline&&u.outline.length>0){let _=new tl(u.outline.map((m)=>jm(m.x,m.y))),p=Math.abs(_.area());if(p>0)a.push(Math.sqrt(p))}if(a.length>0){let _=Math.min(...a)/20;r=Math.min(r,rit*Math.max(_,0.3)),i=Math.min(i,PSn*Math.max(_,0.3))}let c=e.map((u)=>{if((!u.outline||u.outline.length===0)&&u.width&&u.height){let _=u.width/2,p=u.height/2;return{...u,outline:[{x:u.center.x-_,y:u.center.y-p},{x:u.center.x+_,y:u.center.y-p},{x:u.center.x+_,y:u.center.y+p},{x:u.center.x-_,y:u.center.y+p}]}}return u});for(let u of c)if(u.outline&&u.outline.length>0){let _=r*0.45,p=_*0.1,m=ESn(u.outline,{gapLength:i,cutoutWidth:r,mouseBites:s,mouseBiteHoleDiameter:_,mouseBiteHoleSpacing:p});n.push(...m.tabCutouts),o.push(...m.mouseBiteHoles)}let l=n.map((u,_)=>({...u,pcb_cutout_id:`panel_tab_${_}`})),h=r*0.45,d=o.map((u,_)=>({type:"pcb_hole",pcb_hole_id:`panel_mouse_bite_${_}`,hole_shape:"circle",hole_diameter:h,x:u.x,y:u.y}));return{tabCutouts:l,mouseBiteHoles:d}}function mhi(e,t){return e.map((r)=>{if((!r.outline||r.outline.length===0)&&r.width&&r.height){let i=r.width/2,s=r.height/2;return{...r,outline:[{x:r.center.x-i,y:r.center.y-s},{x:r.center.x+i,y:r.center.y-s},{x:r.center.x+i,y:r.center.y+s},{x:r.center.x-i,y:r.center.y+s}]}}return r}).flatMap((r)=>{if(!r.outline||r.outline.length===0)return[];let{tabCutouts:i}=ESn(r.outline,{gapLength:0,cutoutWidth:t.cutoutWidth,mouseBites:!1,mouseBiteHoleDiameter:0,mouseBiteHoleSpacing:0});return i.map((s)=>({...s,pcb_board_id:r.pcb_board_id}))}).map((r,i)=>({...r,pcb_cutout_id:`panel_outline_routing_cutout_${i}`}))}var Cve=(e)=>{let t=e._parsedProps,n=t.width!=null?Ke.parse(t.width):void 0,o=t.height!=null?Ke.parse(t.height):void 0;if((n===void 0||o===void 0)&&t.outline?.length){let r=Ms(t.outline);if(r)n??=r.maxX-r.minX,o??=r.maxY-r.minY}if((n===void 0||o===void 0)&&t.circuitJson?.length){let r=t.circuitJson.find((i)=>i.type==="pcb_board");if(r)n??=r.width,o??=r.height}return{width:n??0,height:o??0}};function _hi({items:e,db:t,row:n,col:o,cellWidth:r,cellHeight:i,boardGap:s,availablePanelWidth:a,availablePanelHeight:c}){let l=e.map((I)=>{let v=ghi(I,t);return{item:I,width:v.width,height:v.height}}).filter((I)=>!(I.width===0&&I.height===0));if(l.length===0)return{positions:[],gridWidth:0,gridHeight:0};let h,d,u=r?Ke.parse(r):0,_=i?Ke.parse(i):0;if(o!==void 0)h=o,d=n??Math.ceil(l.length/h);else if(n!==void 0)d=n,h=Math.ceil(l.length/d);else if(a!==void 0&&c!==void 0){let I=Math.max(...l.map((B)=>B.width),u),v=Math.max(...l.map((B)=>B.height),_),P=Math.max(1,Math.floor((a+s)/(I+s))),M=Math.max(1,Math.floor((c+s)/(v+s)));if(h=P,d=Math.ceil(l.length/h),d>M){if(d=M,h=Math.ceil(l.length/d),h>P)h=P,d=Math.ceil(l.length/h)}h=Math.max(1,h),d=Math.max(1,d)}else h=Math.ceil(Math.sqrt(l.length)),d=Math.ceil(l.length/h);let p=Array(h).fill(0),m=Array(d).fill(0);l.forEach((I,v)=>{let P=v%h,M=Math.floor(v/h);if(M<m.length&&I.height>m[M])m[M]=I.height;if(P<p.length&&I.width>p[P])p[P]=I.width});for(let I=0;I<p.length;I++)p[I]=Math.max(p[I],u);for(let I=0;I<m.length;I++)m[I]=Math.max(m[I],_);let A=p.reduce((I,v)=>I+v,0)+(h>1?(h-1)*s:0),g=m.reduce((I,v)=>I+v,0)+(d>1?(d-1)*s:0),f=-A/2,y=-g/2,x=[f];for(let I=1;I<h;I++)x.push(x[I-1]+p[I-1]+s);let C=[y];for(let I=1;I<d;I++)C.push(C[I-1]+m[I-1]+s);let b=[];return l.forEach((I,v)=>{let P=v%h,M=Math.floor(v/h);if(M>=C.length||P>=x.length)return;let B=x[P]+p[P]/2,T=C[M]+m[M]/2;b.push({item:I.item,pos:{x:B,y:T}})}),{positions:b,gridWidth:A,gridHeight:g}}function ghi(e,t){if(e.componentName==="Board"){let n=e;if(t&&n.pcb_board_id){let o=t.pcb_board.get(n.pcb_board_id);if(o?.width!==void 0&&o?.height!==void 0)return{width:o.width,height:o.height}}return Cve(n)}if(e.componentName==="Subpanel"){let n=e,o=n._parsedProps;if(o.width!==void 0&&o.height!==void 0)return{width:Ke.parse(o.width),height:Ke.parse(o.height)};let r=n._getDirectBoardChildren();if(r.length===0){let a=n._getAllBoardInstances();if(a.length===0)return{width:0,height:0};let c=1/0,l=1/0,h=-1/0,d=-1/0;for(let u of a){let _=Cve(u);if(_.width===0||_.height===0)continue;let p=u._panelPositionOffset??{x:0,y:0};c=Math.min(c,p.x-_.width/2),h=Math.max(h,p.x+_.width/2),l=Math.min(l,p.y-_.height/2),d=Math.max(d,p.y+_.height/2)}if(c===1/0)return{width:0,height:0};return{width:h-c,height:d-l}}if(r.length===1)return Cve(r[0]);if(n._cachedGridWidth>0&&n._cachedGridHeight>0){let a=Ke.parse(o.edgePadding??5);return{width:n._cachedGridWidth+a*2,height:n._cachedGridHeight+a*2}}let i=0,s=0;for(let a of r){let c=Cve(a);i=Math.max(i,c.width),s=Math.max(s,c.height)}return{width:i,height:s}}return{width:0,height:0}}var MSn=class e extends tP{pcb_panel_id=null;_panelizationFeaturesGenerated=!1;get config(){return{componentName:"Subpanel",zodProps:wTt}}get _errorComponentName(){return this.componentName.toLowerCase()}get isGroup(){return!0}get isSubcircuit(){return!0}_getPcbLayoutMode(){return"none"}doInitialSchematicComponentRender(){}doInitialSchematicLayout(){}doInitialSchematicTraceRender(){}add(t){if(t.lowercaseComponentName!=="board"&&t.lowercaseComponentName!=="subpanel")throw Error(`<${this._errorComponentName}> can only contain <board> or <subpanel> elements`);super.add(t)}_cachedGridWidth=0;_cachedGridHeight=0;_panelPositionOffset=null;_computePcbGlobalTransformBeforeLayout(){if(this._panelPositionOffset){let t=this.parent?._computePcbGlobalTransformBeforeLayout?.()??kZ.identity();return kZ.compose(t,kZ.translate(this._panelPositionOffset.x,this._panelPositionOffset.y))}return super._computePcbGlobalTransformBeforeLayout()}_getAllBoardInstances(){let t=[];for(let n of this.children)if(n instanceof P9)t.push(n);else if(n instanceof e)t.push(...n._getAllBoardInstances());return t}_containsBoards(){for(let t of this.children){if(t.componentName==="Board")return!0;if(t.componentName==="Subpanel"&&"_containsBoards"in t){if(t._containsBoards())return!0}}return!1}_getDirectBoardChildren(){return this.children.filter((t)=>t instanceof P9)}doInitialPanelBoardLayout(){if(this.root?.pcbDisabled)return;let t=this._parsedProps.layoutMode??"none",n=this.children.filter((_)=>_ instanceof P9||_ instanceof e);if(t!=="none")for(let _ of n){if(!(_ instanceof P9))continue;if(_._hasUserDefinedPcbPosition())this.root.db.source_property_ignored_warning.insert({source_component_id:_.source_component_id,property_name:"pcbX/pcbY",message:`Board has manual positioning but ${this._errorComponentName} layout mode is "${t}". Manual positioning will be ignored.`,error_type:"source_property_ignored_warning"})}if(t==="none"&&n.length>1){if(n.filter((p)=>!p._hasUserDefinedPcbPosition()).length>1)this.root.db.pcb_placement_error.insert({error_type:"pcb_placement_error",message:`Multiple boards/subpanels in ${this._errorComponentName} without positions. When layoutMode="none", each item must have explicit positioning. Use layoutMode="grid" for automatic positioning.`})}if(t!=="grid")return;let o=this._parsedProps.tabWidth??rit,r=this._parsedProps.boardGap??o,i,s,a=this._parsedProps.row!==void 0||this._parsedProps.col!==void 0,c=this._parsedProps.width!==void 0,l=this._parsedProps.height!==void 0;if(!a&&c&&l){let{edgePadding:_,edgePaddingLeft:p,edgePaddingRight:m,edgePaddingTop:A,edgePaddingBottom:g}=this._parsedProps,f=Ke.parse(_??5),y=Ke.parse(p??f),x=Ke.parse(m??f),C=Ke.parse(A??f),b=Ke.parse(g??f),I=Ke.parse(this._parsedProps.width),v=Ke.parse(this._parsedProps.height);i=I-y-x,s=v-C-b}let{positions:h,gridWidth:d,gridHeight:u}=_hi({items:n,row:this._parsedProps.row,col:this._parsedProps.col,cellWidth:this._parsedProps.cellWidth,cellHeight:this._parsedProps.cellHeight,boardGap:r,availablePanelHeight:s,availablePanelWidth:i});this._cachedGridWidth=d,this._cachedGridHeight=u;for(let{item:_,pos:p}of h)_._panelPositionOffset=p}doInitialPanelLayout(){if(this.root?.pcbDisabled)return;let{db:t}=this.root;if((this._parsedProps.layoutMode??"none")==="grid"){for(let o of this.children)if(o instanceof P9){if(!o.pcb_board_id||!o._panelPositionOffset)continue;t.pcb_board.update(o.pcb_board_id,{position_mode:"relative_to_panel_anchor",display_offset_x:`${o._panelPositionOffset.x}mm`,display_offset_y:`${o._panelPositionOffset.y}mm`})}else if(o instanceof e&&o._panelPositionOffset)for(let r of o._getAllBoardInstances()){if(!r.pcb_board_id)continue;let i=r._panelPositionOffset??{x:0,y:0};t.pcb_board.update(r.pcb_board_id,{position_mode:"relative_to_panel_anchor",display_offset_x:`${o._panelPositionOffset.x+i.x}mm`,display_offset_y:`${o._panelPositionOffset.y+i.y}mm`})}this._updatePanelDimensions()}else{let o=this._getGlobalPcbPositionBeforeLayout();for(let r of this._getDirectBoardChildren()){if(!r.pcb_board_id)continue;let i=t.pcb_board.get(r.pcb_board_id);if(!i)continue;let s=i.center.x-o.x,a=i.center.y-o.y;t.pcb_board.update(r.pcb_board_id,{position_mode:"relative_to_panel_anchor",display_offset_x:`${s}mm`,display_offset_y:`${a}mm`})}}this._generatePanelizationFeatures()}_updatePanelDimensions(){let{db:t}=this.root,n=this._parsedProps.width!==void 0,o=this._parsedProps.height!==void 0,r=this._cachedGridWidth,i=this._cachedGridHeight;if(!this.pcb_group_id)return;if(n&&o)t.pcb_group.update(this.pcb_group_id,{width:Ke.parse(this._parsedProps.width),height:Ke.parse(this._parsedProps.height)});else if(r>0||i>0){let{edgePadding:s,edgePaddingLeft:a,edgePaddingRight:c,edgePaddingTop:l,edgePaddingBottom:h}=this._parsedProps,d=Ke.parse(s??5),u=Ke.parse(a??d),_=Ke.parse(c??d),p=Ke.parse(l??d),m=Ke.parse(h??d);t.pcb_group.update(this.pcb_group_id,{width:n?Ke.parse(this._parsedProps.width):r+u+_,height:o?Ke.parse(this._parsedProps.height):i+p+m})}}_generatePanelizationFeatures(){if(this._panelizationFeaturesGenerated)return;let{db:t}=this.root,n=this._parsedProps,o=n.panelizationMethod??"none",r=this._getAllBoardInstances();if(o!=="none"){let i=r.map((c)=>c.pcb_board_id).filter((c)=>!!c),s=t.pcb_board.list().filter((c)=>i.includes(c.pcb_board_id));if(s.length===0)return;let a=n.tabWidth??rit;if(o==="outline_routing"){let c=mhi(s,{cutoutWidth:a});for(let l of c)t.pcb_cutout.insert({...l,pcb_group_id:this.pcb_group_id??void 0,pcb_panel_id:this.pcb_panel_id??void 0})}else{let c=n.boardGap??a,{tabCutouts:l,mouseBiteHoles:h}=phi(s,{boardGap:c,tabWidth:a,tabLength:n.tabLength??PSn,mouseBites:n.mouseBites??!0});for(let d of l)t.pcb_cutout.insert(d);for(let d of h)t.pcb_hole.insert(d)}}this._panelizationFeaturesGenerated=!0}doInitialPcbComponentRender(){if(this.root?.pcbDisabled)return;if(!this._containsBoards())throw Error(`<${this._errorComponentName}> must contain at least one <board>`);super.doInitialPcbComponentRender()}};var Ahi=class extends MSn{get config(){return{componentName:"Panel",zodProps:ZYe}}doInitialPcbComponentRender(){if(this.root?.pcbDisabled)return;if(!this._containsBoards())throw Error(`<${this._errorComponentName}> must contain at least one <board>`);let{db:e}=this.root,t=this._parsedProps,n=e.pcb_panel.insert({width:t.width!==void 0?Ke.parse(t.width):0,height:t.height!==void 0?Ke.parse(t.height):0,thickness:1.6,center:this._getGlobalPcbPositionBeforeLayout(),covered_with_solder_mask:!(t.noSolderMask??!1)});this.pcb_panel_id=n.pcb_panel_id}_updatePanelDimensions(){let{db:e}=this.root,t=this._parsedProps.width!==void 0,n=this._parsedProps.height!==void 0,o=this._cachedGridWidth,r=this._cachedGridHeight;if(!this.pcb_panel_id)return;if(t&&n)e.pcb_panel.update(this.pcb_panel_id,{width:Ke.parse(this._parsedProps.width),height:Ke.parse(this._parsedProps.height)});else if(o>0||r>0){let{edgePadding:i,edgePaddingLeft:s,edgePaddingRight:a,edgePaddingTop:c,edgePaddingBottom:l}=this._parsedProps,h=Ke.parse(i??5),d=Ke.parse(s??h),u=Ke.parse(a??h),_=Ke.parse(c??h),p=Ke.parse(l??h);e.pcb_panel.update(this.pcb_panel_id,{width:t?Ke.parse(this._parsedProps.width):o+d+u,height:n?Ke.parse(this._parsedProps.height):r+_+p})}}updatePcbComponentRender(){if(this.root?.pcbDisabled)return;if(!this.pcb_panel_id)return;let{db:e}=this.root,t=this._parsedProps,n=e.pcb_panel.get(this.pcb_panel_id);e.pcb_panel.update(this.pcb_panel_id,{width:t.width!==void 0?Ke.parse(t.width):n?.width,height:t.height!==void 0?Ke.parse(t.height):n?.height,center:this._getGlobalPcbPositionBeforeLayout(),covered_with_solder_mask:!(t.noSolderMask??!1)})}removePcbComponentRender(){if(!this.pcb_panel_id)return;this.root?.db.pcb_panel.delete(this.pcb_panel_id),this.pcb_panel_id=null}},fhi=1,bve=1,yhi=(e)=>{let t=e.route.map((m)=>m.x),n=e.route.map((m)=>m.y),o=e.traceWidth/2+fhi,r=Math.min(...t)-o,i=Math.max(...t)+o,s=Math.min(...n)-o,a=Math.max(...n)+o,c=[e.feedPoint,...e.secondaryPort?[e.secondaryPort.point]:[]],l=Math.min(...c.map((m)=>m.x))-bve,h=Math.max(...c.map((m)=>m.x))+bve,d=Math.min(...c.map((m)=>m.y))-bve,u=Math.max(...c.map((m)=>m.y))+bve,_=[],p=(m,A,g,f)=>{if(A<=m||f<=g)return;_.push({center:{x:(m+A)/2,y:(g+f)/2},width:A-m,height:f-g})};if(e.feedKeepoutOpeningDirection==="left")p(r,i,u,a),p(r,i,s,d),p(h,i,d,u);else p(r,l,s,u),p(h,i,s,u),p(r,i,u,a);return _},xhi=(e)=>{switch(e){case"2.4ghz_quarter_wave_monopole":return{traceWidth:0.6,feedPoint:{x:0,y:0},feedKeepoutOpeningDirection:"left",route:[{x:0,y:0},{x:31,y:0}]};case"2.4ghz_meandered_monopole":return{traceWidth:0.5,feedPoint:{x:0,y:0},feedKeepoutOpeningDirection:"bottom",route:[{x:0,y:0},{x:0,y:6},{x:3,y:6},{x:3,y:1.5},{x:6,y:1.5},{x:6,y:6},{x:9,y:6},{x:9,y:1.5},{x:12,y:1.5},{x:12,y:6},{x:15,y:6}]};case"2.4ghz_inverted_f":return{traceWidth:0.8,feedPoint:{x:0,y:0},feedKeepoutOpeningDirection:"bottom",secondaryPort:{point:{x:-4,y:0},role:"ground"},groundViaPoint:{x:-4,y:0},route:[{x:-4,y:0},{x:-4,y:3},{x:0,y:3},{x:0,y:0},{x:0,y:3},{x:-4,y:3},{x:-4,y:8},{x:22,y:8}]};case"2.4ghz_meandered_inverted_f":return{traceWidth:0.5,feedPoint:{x:0,y:0},feedKeepoutOpeningDirection:"bottom",secondaryPort:{point:{x:-1.7,y:0},role:"ground"},groundViaPoint:{x:-1.7,y:0},route:[{x:-1.7,y:0},{x:-1.7,y:4.9},{x:0,y:4.9},{x:0,y:0},{x:0,y:4.9},{x:-1.7,y:4.9},{x:2.3,y:4.9},{x:2.3,y:1.4},{x:5.3,y:1.4},{x:5.3,y:4.9},{x:8.3,y:4.9},{x:8.3,y:1.4},{x:11.3,y:1.4},{x:11.3,y:4.9},{x:13.3,y:4.9}]};case"2.4ghz_folded_dipole":return{traceWidth:0.9,feedPoint:{x:0,y:0},feedKeepoutOpeningDirection:"bottom",secondaryPort:{point:{x:1.2,y:0},role:"feed2"},route:[{x:0,y:0},{x:-22.4,y:0},{x:-22.4,y:9},{x:23.6,y:9},{x:23.6,y:0},{x:1.2,y:0}]}}},Chi=class extends bl{get config(){return{componentName:"Antenna",zodProps:eDt,sourceFtype:XS.simple_chip,shouldRenderAsSchematicBox:!0}}getRefDesPrefixes(){return["ANT"]}initPorts(){let{antennaShape:e,pcbPath:t}=this._parsedProps,n=t?void 0:e==="2.4ghz_inverted_f"||e==="2.4ghz_meandered_inverted_f"?"ground":e==="2.4ghz_folded_dipole"?"feed2":void 0;super.initPorts({pinCount:n?2:1,additionalAliases:{pin1:n==="feed2"?["feed","feed1"]:["feed"],...n==="ground"?{pin2:["ground","gnd"]}:n==="feed2"?{pin2:["feed2"]}:{}}})}doInitialReactSubtreesRender(){super.doInitialReactSubtreesRender();let{antennaShape:e,pcbPath:t}=this._parsedProps;if(!e)return;let n=this.children.some((i)=>i.componentName==="Footprint");if(t&&n)return;let o=t?void 0:xhi(e),r=new s7e({name:`${this.name}_generated_antenna`});if(!n)r.add(new eB({shape:"rect",width:0.8,height:0.8,pcbX:o?.feedPoint.x??0,pcbY:o?.feedPoint.y??0,layer:"top",portHints:["pin1"],coveredWithSolderMask:!0}));if(o){let i=yhi(o);for(let a of i)r.add(new i8e({shape:"rect",pcbX:a.center.x,pcbY:a.center.y,width:a.width,height:a.height,layers:[...this.root?._getBoard()?.allLayers??["top","bottom"]],excludeRefs:[this.getSubcircuitSelector()]}));let s=new Mit({route:o.route.map((a)=>({route_type:"wire",...a,width:o.traceWidth,layer:"top"}))});if(s.isAntennaTrace=!0,r.add(s),o.secondaryPort&&!o.groundViaPoint&&!n)r.add(new eB({shape:"rect",width:0.8,height:0.8,pcbX:o.secondaryPort.point.x,pcbY:o.secondaryPort.point.y,layer:"top",portHints:["pin2"],coveredWithSolderMask:!0}));if(o.groundViaPoint)r.add(new Zw({shape:"circle",pcbX:o.groundViaPoint.x,pcbY:o.groundViaPoint.y,holeDiameter:0.3,outerDiameter:0.7,portHints:["pin2"],coveredWithSolderMask:!0}))}this.add(r)}doInitialCreateTracesFromProps(){super.doInitialCreateTracesFromProps();let{pcbPath:e}=this._parsedProps;if(!e)return;let t=new d_({name:`${this.name}_pcb_path`,path:[`${this.getSubcircuitSelector()} > port.pin1`],pcbPath:e});t.isAntennaTrace=!0,this.add(t)}},bhi=class extends Eue{constructor(e){super(e)}get config(){return{...super.config,componentName:"Pinout",zodProps:RTt}}doInitialSourceRender(){let{db:e}=this.root,{_parsedProps:t}=this,n=e.source_component.insert({ftype:"simple_pinout",name:this.name,manufacturer_part_number:ii(t),supplier_part_numbers:t.supplierPartNumbers,display_name:t.displayName});this.source_component_id=n.source_component_id}},Ihi=class extends bl{get config(){return{componentName:"fuse",schematicSymbolName:this.props.symbolName??"fuse",zodProps:HTt,sourceFtype:XS.simple_fuse}}_getSchematicSymbolDisplayValue(){if(this._parsedProps.schShowRatings===!1)return"";let e=this._parsedProps.currentRating,t=this._parsedProps.voltageRating,n=Aa(e,"A").value,o=Aa(t,"V").value;return`${qh(n)}A / ${qh(o)}V`}doInitialSourceRender(){let{db:e}=this.root,{_parsedProps:t}=this,n=Aa(t.currentRating,"A").value,o=Aa(t.voltageRating,"V").value,r,i;if(t.schShowRatings!==!1)r=`${qh(n)}A`,i=`${qh(o)}V`;let s=e.source_component.insert({name:this.name,ftype:XS.simple_fuse,manufacturer_part_number:ii(t),supplier_part_numbers:t.supplierPartNumbers,...n!=null?{current_rating_amps:n}:{},...o!=null?{voltage_rating_volts:o}:{},display_current_rating:r,display_voltage_rating:i,display_name:t.displayName});this.source_component_id=s.source_component_id}},vhi=class extends bl{schematicDimensions=null;get config(){return{schematicSymbolName:void 0,componentName:"Jumper",zodProps:nGe,shouldRenderAsSchematicBox:!0}}_getSchematicPortArrangement(){let e=super._getSchematicPortArrangement();if(e&&Object.keys(e).length>0)return e;let t=this._parsedProps.pinCount??(Array.isArray(this._parsedProps.pinLabels)?this._parsedProps.pinLabels.length:this._parsedProps.pinLabels?Object.keys(this._parsedProps.pinLabels).length:this.getPortsFromFootprint().length),n=this._parsedProps.schDirection??"right";return{leftSize:n==="left"?t:0,rightSize:n==="right"?t:0}}doInitialSourceRender(){let{db:e}=this.root,{_parsedProps:t}=this,{pcbX:n,pcbY:o}=this.getResolvedPcbPositionProp(),r=e.source_component.insert({ftype:"simple_chip",name:this.name,manufacturer_part_number:ii(t),supplier_part_numbers:t.supplierPartNumbers,are_pins_interchangeable:!0,display_name:t.displayName});this.source_component_id=r.source_component_id}doInitialPcbComponentRender(){if(this.root?.pcbDisabled)return;let{db:e}=this.root,{_parsedProps:t}=this,{pcbX:n,pcbY:o}=this.getResolvedPcbPositionProp(),r=this.getGlobalTransformRotation(),i=e.pcb_component.insert({center:{x:n,y:o},width:2,height:3,layer:t.layer??"top",rotation:nu(r),insertion_direction:this._getPcbComponentInsertionDirection(t.layer??"top",r),source_component_id:this.source_component_id,subcircuit_id:this.getSubcircuit().subcircuit_id??void 0,do_not_place:t.doNotPlace??!1,obstructs_within_bounds:t.obstructsWithinBounds??!0,is_allowed_to_be_off_board:t.allowOffBoard??!1,metadata:t.kicadFootprintMetadata?{kicad_footprint:t.kicadFootprintMetadata}:void 0});this.pcb_component_id=i.pcb_component_id}doInitialPcbPortAttachment(){let{db:e}=this.root,t=e.pcb_port.list({pcb_component_id:this.pcb_component_id}),n={};for(let i=0;i<t.length;i++){let s=t[i],a=e.source_port.get(s.source_port_id),c="";if(typeof a?.pin_number==="number")c=a.pin_number.toString();else if(Array.isArray(a?.port_hints)){let l=a.port_hints.find((h)=>/^(pin)?\d+$/.test(h));if(l)if(/^pin\d+$/.test(l))c=l.replace(/^pin/,"");else c=l}n[c]=s.pcb_port_id}let o=e.pcb_trace.list({pcb_component_id:this.pcb_component_id}),r=(i)=>{if(i&&typeof i==="string"&&i.startsWith("{PIN")){let s=i.replace("{PIN","").replace("}","");return n[s]||i}return i};for(let i of o){if(!i.route)continue;for(let s of i.route){if(s.route_type!=="wire")continue;s.start_pcb_port_id=r(s.start_pcb_port_id),s.end_pcb_port_id=r(s.end_pcb_port_id)}}}},bxn={"0402":"0402","0603":"0603","0805":"0805","1206":"1206"},Shi=class extends bl{get config(){return{componentName:"Interconnect",zodProps:LTt,shouldRenderAsSchematicBox:!0,sourceFtype:"interconnect"}}get defaultInternallyConnectedPinNames(){let{standard:e}=this._parsedProps;if(e&&bxn[e])return[["pin1","pin2"]];return[]}_getImpliedFootprintString(){let{standard:e}=this._parsedProps;if(!e)return null;return bxn[e]??null}doInitialSourceRender(){let{db:e}=this.root,{_parsedProps:t}=this,n=e.source_component.insert({ftype:"interconnect",name:this.name,manufacturer_part_number:ii(t),supplier_part_numbers:t.supplierPartNumbers,are_pins_interchangeable:!0,display_name:t.displayName});this.source_component_id=n.source_component_id}doInitialSourceParentAttachment(){let{db:e}=this.root,t=this._getInternallyConnectedPins();for(let n of t){let o=n.map((r)=>r.source_port_id).filter((r)=>r!==null);if(o.length>=2)e.source_component_internal_connection.insert({source_component_id:this.source_component_id,subcircuit_id:this.getSubcircuit()?.subcircuit_id,source_port_ids:o})}}},Phi=class extends bl{schematicDimensions=null;_getPinCountFromFootprintString(e){let t=e.match(/^solderjumper([23])(?:_|$)/);if(!t)return null;return Number(t[1])}_getPinNumberFromBridgedPinsProp(e){let t=e.match(/^(?:pin)?(\d+)$/i);if(t)return Number(t[1]);let n=this._parsedProps.pinLabels??this.props.pinLabels;if(Array.isArray(n)){let o=n.findIndex((r)=>r===e);return o>=0?o+1:null}if(n&&typeof n==="object")for(let[o,r]of Object.entries(n)){if(!(Array.isArray(r)?r:[r]).includes(e))continue;let s=o.match(/^(?:pin)?(\d+)$/i);return s?Number(s[1]):null}return null}_getBridgedPinNumbersForFootprint(e){let t=this._parsedProps??this.props;if(Array.isArray(t.bridgedPins)&&t.bridgedPins.length>0)return Array.from(new Set(t.bridgedPins.flat().map((n)=>this._getPinNumberFromBridgedPinsProp(n)).filter((n)=>n!==null&&n>=1&&n<=e))).sort((n,o)=>n-o);if(!t.bridged)return[];return Array.from({length:e},(n,o)=>o+1)}resolveFootprint(){let e=super.resolveFootprint();if(typeof e!=="string")return e;let t=this._getPinCountFromFootprintString(e);if(!t)return e;if(/_bridged\d+/.test(e))return e;let n=this._getBridgedPinNumbersForFootprint(t);if(n.length===0)return e;return e.replace(/^solderjumper[23]/,`solderjumper${t}_bridged${n.join("")}`)}_getPinNumberFromBridgedPinName(e){return this.selectOne(`port.${e}`,{type:"port"})?._parsedProps.pinNumber??null}get defaultInternallyConnectedPinNames(){if(this._parsedProps.bridged){let e=this.children.filter((t)=>t.componentName==="Port").map((t)=>t.name);return e.length>0?[e]:[]}return this._parsedProps.bridgedPins??[]}get config(){let e=this._parsedProps??this.props,t=e.pinCount;if(e.pinCount==null&&!e.footprint)t=2;if(e.pinCount==null){let r=(e.bridgedPins??[]).flat().map((c)=>this._getPinNumberFromBridgedPinName(c)).filter((c)=>c!==null),i=r.length>0?Math.max(...r):0,s=e.pinLabels?Object.keys(e.pinLabels).length:0,a=Math.max(i,s);if(a===2||a===3)t=a;if(t==null&&e.footprint&&[2,3].includes(this.getPortsFromFootprint().length))t=this.getPortsFromFootprint().length}let n="";if(t)n+=`solderjumper${t}`;else n="solderjumper";let o=[];if(Array.isArray(e.bridgedPins)&&e.bridgedPins.length>0)o=Array.from(new Set(e.bridgedPins.flat().map((r)=>this._getPinNumberFromBridgedPinName(r)).filter((r)=>r!==null))).sort((r,i)=>r-i);else if(e.bridged&&t)o=Array.from({length:t},(r,i)=>i+1);if(o.length>0)n+=`_bridged${o.join("")}`;return{schematicSymbolName:e.symbolName??n,componentName:"SolderJumper",zodProps:QTt,shouldRenderAsSchematicBox:!0}}_getSchematicPortArrangement(){let e=super._getSchematicPortArrangement();if(e&&Object.keys(e).length>0)return e;let t=this._parsedProps.pinCount??(Array.isArray(this._parsedProps.pinLabels)?this._parsedProps.pinLabels.length:this._parsedProps.pinLabels?Object.keys(this._parsedProps.pinLabels).length:this.getPortsFromFootprint().length);if(t==null&&!this._parsedProps.footprint)t=2;let n=this._parsedProps.schDirection??"right";return{leftSize:n==="left"?t:0,rightSize:n==="right"?t:0}}doInitialSourceRender(){let{db:e}=this.root,{_parsedProps:t}=this,{pcbX:n,pcbY:o}=this.getResolvedPcbPositionProp(),r=e.source_component.insert({ftype:"simple_chip",name:this.name,manufacturer_part_number:ii(t),supplier_part_numbers:t.supplierPartNumbers,are_pins_interchangeable:!0,display_name:t.displayName});this.source_component_id=r.source_component_id}doInitialPcbComponentRender(){if(this.root?.pcbDisabled)return;let{db:e}=this.root,{_parsedProps:t}=this,{pcbX:n,pcbY:o}=this.getResolvedPcbPositionProp(),r=this.getGlobalTransformRotation(),i=e.pcb_component.insert({center:{x:n,y:o},width:2,height:3,layer:t.layer??"top",rotation:nu(r),insertion_direction:this._getPcbComponentInsertionDirection(t.layer??"top",r),source_component_id:this.source_component_id,subcircuit_id:this.getSubcircuit().subcircuit_id??void 0,do_not_place:t.doNotPlace??!1,obstructs_within_bounds:t.obstructsWithinBounds??!0,is_allowed_to_be_off_board:t.allowOffBoard??!1,metadata:t.kicadFootprintMetadata?{kicad_footprint:t.kicadFootprintMetadata}:void 0});this.pcb_component_id=i.pcb_component_id}doInitialPcbPortAttachment(){let{db:e}=this.root,t=e.pcb_port.list({pcb_component_id:this.pcb_component_id}),n={};for(let i=0;i<t.length;i++){let s=t[i],a=e.source_port.get(s.source_port_id),c="";if(typeof a?.pin_number==="number")c=a.pin_number.toString();else if(Array.isArray(a?.port_hints)){let l=a.port_hints.find((h)=>/^(pin)?\d+$/.test(h));if(l)if(/^pin\d+$/.test(l))c=l.replace(/^pin/,"");else c=l}n[c]=s.pcb_port_id}let o=e.pcb_trace.list({pcb_component_id:this.pcb_component_id}),r=(i)=>{if(i&&typeof i==="string"&&i.startsWith("{PIN")){let s=i.replace("{PIN","").replace("}","");return n[s]||i}return i};for(let i of o){if(!i.route)continue;for(let s of i.route){if(s.route_type!=="wire")continue;s.start_pcb_port_id=r(s.start_pcb_port_id),s.end_pcb_port_id=r(s.end_pcb_port_id)}}}},Ehi=class extends bl{get config(){return{schematicSymbolName:this.props.symbolName??"power_factor_meter_horz",componentName:"PowerSource",zodProps:qDt,sourceFtype:"simple_power_source"}}initPorts(){this.add(new Lh({name:"pin1",pinNumber:1,aliases:["positive","pos"]})),this.add(new Lh({name:"pin2",pinNumber:2,aliases:["negative","neg"]}))}doInitialSourceRender(){let{db:e}=this.root,{_parsedProps:t}=this,n=e.source_component.insert({ftype:"simple_power_source",name:this.name,voltage:t.voltage,supplier_part_numbers:t.supplierPartNumbers,manufacturer_part_number:ii(t),are_pins_interchangeable:!1,display_name:t.displayName});this.source_component_id=n.source_component_id}pos=this.portMap.pin1;positive=this.portMap.pin1;neg=this.portMap.pin2;negative=this.portMap.pin2},wSn=class extends bl{simulation_voltage_source_id=null;get config(){return{componentName:"VoltageSource",schematicSymbolName:this.props.waveShape==="square"?"square_wave":"ac_voltmeter",zodProps:JDt,sourceFtype:"simple_voltage_source"}}runRenderPhaseForChildren(e){if(e.startsWith("Pcb"))return;for(let t of this.children)t.runRenderPhaseForChildren(e),t.runRenderPhase(e)}doInitialPcbComponentRender(){let e=this._hasUserDefinedPcbPosition();if(!this._parsedProps.footprint){if(!e)return;throw Error("VoltageSource requires a footprint when pcbX/pcbY or pcb edge position props are used")}super.doInitialPcbComponentRender()}initPorts(){super.initPorts({additionalAliases:{pin1:["terminal1"],pin2:["terminal2"]}})}_getSchematicSymbolDisplayValue(){let{voltage:e,frequency:t}=this._parsedProps,n=[];if(e!==void 0)n.push(`${qh(e)}V`);if(t!==void 0)n.push(`${qh(t)}Hz`);return n.length>0?n.join(" "):void 0}doInitialSourceRender(){let{db:e}=this.root,{_parsedProps:t}=this,n=e.source_component.insert({ftype:"simple_voltage_source",name:this.name,voltage:t.voltage,frequency:t.frequency,peak_to_peak_voltage:t.peakToPeakVoltage,wave_shape:t.waveShape,phase:t.phase,duty_cycle:t.dutyCycle,pulse_delay:t.pulseDelay,rise_time:t.riseTime,fall_time:t.fallTime,pulse_width:t.pulseWidth,period:t.period,supplier_part_numbers:t.supplierPartNumbers,manufacturer_part_number:ii(t),are_pins_interchangeable:!0,display_name:t.displayName});this.source_component_id=n.source_component_id}doInitialSimulationRender(){let{db:e}=this.root,{_parsedProps:t}=this,n=this.portMap.terminal1,o=this.portMap.terminal2,r=e.simulation_voltage_source.insert({is_dc_source:!1,terminal1_source_port_id:n.source_port_id??void 0,terminal2_source_port_id:o.source_port_id??void 0,voltage:t.voltage,frequency:t.frequency,peak_to_peak_voltage:t.peakToPeakVoltage,wave_shape:t.waveShape,phase:t.phase,duty_cycle:t.dutyCycle,pulse_delay:t.pulseDelay,rise_time:t.riseTime,fall_time:t.fallTime,pulse_width:t.pulseWidth,period:t.period,ac_magnitude:t.acMagnitude,ac_phase:t.acPhase});this.simulation_voltage_source_id=r.simulation_voltage_source_id}terminal1=this.portMap.terminal1;terminal2=this.portMap.terminal2},BSn=class extends bl{simulation_current_source_id=null;get config(){return{componentName:"CurrentSource",schematicSymbolName:"current_source",zodProps:ZDt,sourceFtype:"simple_current_source"}}runRenderPhaseForChildren(e){if(e.startsWith("Pcb"))return;for(let t of this.children)t.runRenderPhaseForChildren(e),t.runRenderPhase(e)}doInitialPcbComponentRender(){let e=this._hasUserDefinedPcbPosition();if(!this._parsedProps.footprint){if(!e)return;throw Error("CurrentSource requires a footprint when pcbX/pcbY or pcb edge position props are used")}super.doInitialPcbComponentRender()}initPorts(){super.initPorts({additionalAliases:{pin1:["pos"],pin2:["neg"]}})}_getSchematicSymbolDisplayValue(){let{current:e,frequency:t,peakToPeakCurrent:n}=this._parsedProps,o=[];if(e!==void 0)o.push(`${qh(e)}A`);if(n!==void 0)o.push(`${qh(n)}A p-p`);if(t!==void 0)o.push(`${qh(t)}Hz`);return o.length>0?o.join(" "):void 0}doInitialSourceRender(){let{db:e}=this.root,{_parsedProps:t}=this,n=e.source_component.insert({ftype:"simple_current_source",name:this.name,current:t.current,frequency:t.frequency,peak_to_peak_current:t.peakToPeakCurrent,wave_shape:t.waveShape,phase:t.phase,duty_cycle:t.dutyCycle,supplier_part_numbers:t.supplierPartNumbers,manufacturer_part_number:ii(t),are_pins_interchangeable:!0,display_name:t.displayName});this.source_component_id=n.source_component_id}doInitialSimulationRender(){let{db:e}=this.root,{_parsedProps:t}=this,n=t.frequency!==void 0||t.peakToPeakCurrent!==void 0||t.waveShape!==void 0||t.acMagnitude!==void 0||t.acPhase!==void 0,o=this.portMap.pos,r=this.portMap.neg;if(n){let i=e.simulation_current_source.insert({is_dc_source:!1,terminal1_source_port_id:o.source_port_id??void 0,terminal2_source_port_id:r.source_port_id??void 0,current:t.current,frequency:t.frequency,peak_to_peak_current:t.peakToPeakCurrent,wave_shape:t.waveShape,phase:t.phase,duty_cycle:t.dutyCycle,ac_magnitude:t.acMagnitude,ac_phase:t.acPhase});this.simulation_current_source_id=i.simulation_current_source_id}else{if(t.current===void 0)return;let i=e.simulation_current_source.insert({is_dc_source:!0,positive_source_port_id:o.source_port_id??void 0,negative_source_port_id:r.source_port_id??void 0,current:t.current,ac_magnitude:t.acMagnitude,ac_phase:t.acPhase});this.simulation_current_source_id=i.simulation_current_source_id}}pos=this.portMap.pos;neg=this.portMap.neg},K8e=0.25,Ixn=(e,t)=>({left:e.center.x-e.size.width/2-t,right:e.center.x+e.size.width/2+t,bottom:e.center.y-e.size.height/2-t,top:e.center.y+e.size.height/2+t}),Mhi=(e,t)=>e.left<t.right&&e.right>t.left&&e.bottom<t.top&&e.top>t.bottom,whi=({baseCenter:e,size:t})=>{let n=t.width+K8e*2,o=t.height+K8e*2;return[e,{x:e.x,y:e.y+o},{x:e.x,y:e.y-o},{x:e.x+n,y:e.y},{x:e.x-n,y:e.y},{x:e.x+n,y:e.y+o},{x:e.x-n,y:e.y+o},{x:e.x+n,y:e.y-o},{x:e.x-n,y:e.y-o},{x:e.x,y:e.y+o*2},{x:e.x,y:e.y-o*2}]},Bhi=({ammeterSourcePortId:e,schematicPorts:t,sourceTraces:n})=>{for(let o of n){if(!o.connected_source_port_ids.includes(e))continue;let r=o.connected_source_port_ids.find((s)=>s!==e);if(r===void 0)continue;let i=t.find((s)=>s.source_port_id===r);if(i)return i}return null},Thi=(e)=>({x:e.reduce((t,n)=>t+n.center.x,0)/e.length,y:e.reduce((t,n)=>t+n.center.y,0)/e.length}),Dhi=({ammeter:e,db:t,oldCenter:n,newCenter:o})=>{let r=e.schematic_component_id;if(!r)return;let i=o.x-n.x,s=o.y-n.y;if(i===0&&s===0)return;t.schematic_component.update(r,{center:o});for(let a of t.schematic_port.list({schematic_component_id:r}))t.schematic_port.update(a.schematic_port_id,{center:{x:a.center.x+i,y:a.center.y+s}});for(let a of t.schematic_text.list({schematic_component_id:r}))t.schematic_text.update(a.schematic_text_id,{position:{x:a.position.x+i,y:a.position.y+s}});fZ({db:t,schematicComponentId:r,deltaX:i,deltaY:s})},Nhi=(e)=>{let{root:t}=e;if(!t||t.schematicDisabled)return;if(!e.schematic_component_id)return;if(e._parsedProps.schX!==void 0||e._parsedProps.schY!==void 0)return;if(e.getGroup()?._getSchematicLayoutMode()!=="relative")return;let{db:n}=t,o=n.schematic_component.get(e.schematic_component_id);if(!o)return;let r=[e.portMap.pos.source_port_id,e.portMap.neg.source_port_id].filter((d)=>typeof d==="string");if(r.length===0)return;let i=n.schematic_port.list(),s=n.source_trace.list(),a=r.map((d)=>Bhi({ammeterSourcePortId:d,schematicPorts:i,sourceTraces:s})).filter((d)=>d!==null);if(a.length===0)return;let c=Thi(a),l=n.schematic_component.list().filter((d)=>d.schematic_component_id!==o.schematic_component_id&&!d.is_schematic_group&&d.schematic_sheet_id===o.schematic_sheet_id).map((d)=>Ixn(d,K8e)),h=whi({baseCenter:c,size:o.size}).find((d)=>{let u=Ixn({...o,center:d},K8e);return!l.some((_)=>Mhi(u,_))})??c;Dhi({ammeter:e,db:n,oldCenter:o.center,newCenter:h})},Rhi=class extends bl{simulation_current_probe_id=null;get config(){return{componentName:"Ammeter",schematicSymbolName:"dc_ammeter",zodProps:tNt,sourceFtype:"simple_ammeter"}}runRenderPhaseForChildren(e){if(e.startsWith("Pcb"))return;for(let t of this.children)t.runRenderPhaseForChildren(e),t.runRenderPhase(e)}doInitialPcbComponentRender(){let e=this._hasUserDefinedPcbPosition();if(!this._parsedProps.footprint){if(!e)return;throw Error("Ammeter requires a footprint when pcbX/pcbY or pcb edge position props are used")}super.doInitialPcbComponentRender()}initPorts(){super.initPorts({ignoreSymbolPorts:!0,pinCount:2,additionalAliases:{pin1:["pos"],pin2:["neg"]}});let e=Es[this._getSchematicSymbolNameOrThrow()];this.portMap.pos.schematicSymbolPortDef=e.ports.find((t)=>t.labels.includes("1"))??null,this.portMap.neg.schematicSymbolPortDef=e.ports.find((t)=>t.labels.includes("2"))??null}doInitialSourceRender(){let{db:e}=this.root,{supplierPartNumbers:t,displayName:n}=this._parsedProps,o=e.source_component.insert({ftype:"simple_ammeter",name:this.name,supplier_part_numbers:t,manufacturer_part_number:ii(this._parsedProps),display_name:n});this.source_component_id=o.source_component_id}doInitialSimulationRender(){let{db:e}=this.root,{color:t,graphDisplayName:n,graphCenter:o,graphVerticalOffset:r,graphCurrentPerDiv:i}=this._parsedProps,s=this.portMap.pos,a=this.portMap.neg,{simulation_current_probe_id:c}=e.simulation_current_probe.insert({type:"simulation_current_probe",name:this.name,source_component_id:this.source_component_id,positive_source_port_id:s.source_port_id,negative_source_port_id:a.source_port_id,subcircuit_id:this.getSubcircuit()?.subcircuit_id??void 0,color:t});if(this.simulation_current_probe_id=c,n!==void 0||o!==void 0||r!==void 0||i!==void 0){let h=kk(i),d=kk(r);e.simulation_oscilloscope_trace.insert({simulation_current_probe_id:c,display_name:n,color:t,display_center_value:o,amps_per_div:h,display_center_offset_divs:d!==void 0&&h!==void 0&&h!==0?d/h:void 0})}}doInitialSchematicLayout(){Nhi(this)}pos=this.portMap.pos;neg=this.portMap.neg},Qhi=["leftedge","rightedge","topedge","bottomedge","center"],khi=class extends nr{get config(){return{componentName:"Constraint",zodProps:jTt}}constructor(e){super(e);if("xdist"in e||"ydist"in e){if(!("edgeToEdge"in e)&&!("centerToCenter"in e))throw Error(`edgeToEdge, centerToCenter must be set for xDist or yDist for ${this}`)}if("for"in e&&e.for.length<2)throw Error(`"for" must have at least two selectors for ${this}`)}_getAllReferencedComponents(){let e=[],t=this.getPrimitiveContainer();function n(o){let r=o.split(" ").pop(),i=Qhi.includes(r)?r:void 0,s=i?o.replace(` ${i}`,""):o,a=t.selectOne(s,{pcbPrimitive:!0});if(a)e.push({selector:o,component:a,componentSelector:s,edge:i})}for(let o of["left","right","top","bottom"])if(o in this._parsedProps)n(this._parsedProps[o]);if("for"in this._parsedProps)for(let o of this._parsedProps.for)n(o);return{componentsWithSelectors:e}}},Lhi=(e)=>{if(!e||typeof e!=="object")return!1;return typeof e.getSourcePort==="function"},Hhi=(e)=>{if(!e||typeof e!=="object")return!1;return typeof e.getSourceNet==="function"},Fhi=(e)=>{if(!e||typeof e!=="object")return!1;return typeof e.getPorts==="function"},zhi=(e)=>{if(!e||typeof e!=="object")return!1;return typeof e.type==="string"},jhe=(e)=>typeof e==="string"&&e.length>0,iit=class{constructor(e){this.port=e}port;getPcbPort(){let e=this.port.pcb_port_id;if(!e)return null;return this.port.root?.db.pcb_port.get(e)??null}getSourcePort(){let e=this.port.source_port_id;if(!e)return null;return this.port.root?.db.source_port.get(e)??null}},Ohi=class{constructor(e){this.net=e}net;getSourceNet(){let e=this.net.source_net_id;if(!e)return null;return this.net.root?.db.source_net.get(e)??null}},Vhi=class{constructor(e){this.component=e}component;getPort(e){let t=this.component.selectOne(`port.${e}`,{type:"port"})??this.component.selectOne(`.${e}`,{type:"port"});if(!t)return null;return new iit(t)}getPorts(){return this.component.selectAll("port").map((e)=>new iit(e))}getPcbComponent(){let e=this.component.pcb_component_id;if(!e)return null;return this.component.root?.db.pcb_component.get(e)??null}getSourceComponent(){let e=this.component.source_component_id;if(!e)return null;return this.component.root?.db.source_component.get(e)??null}},Yhi=class extends nr{get config(){return{componentName:"DrcCheck",zodProps:$Tt}}constructor(e){super(e)}async runCustomDrcCheck(e){let t=await this._parsedProps.checkFn(this.createCustomDrcCheckContext(e)),n=[];if(Array.isArray(t))n=t;else if(t)n=[t];return n.map((o,r)=>this.createCircuitJsonDiagnostic(o,r)).filter((o)=>!!o)}createCustomDrcCheckContext(e){return{select:this.selectCustomDrcElement.bind(this),selectAll:this.selectAllCustomDrcElements.bind(this),isConnected:(t,n)=>this.isConnected(t,n,e),isPulledUp:(t)=>this.isConnected(t,"net.VCC",e)||this.isConnected(t,"net.VDD",e)||this.getResistanceBetween(t,"net.VCC",e)!==null||this.getResistanceBetween(t,"net.VDD",e)!==null,isPulledDown:(t)=>this.isConnected(t,"net.GND",e)||this.getResistanceBetween(t,"net.GND",e)!==null,getResistanceBetween:(t,n)=>this.getResistanceBetween(t,n,e)}}selectCustomDrcElement(e){return this.wrapSelectionResult(this.getSubcircuit().selectOne(e))}selectAllCustomDrcElements(e){let t=[];for(let n of this.getSubcircuit().selectAll(e)){let o=this.wrapSelectionResult(n);if(o)t.push(o)}return t}wrapSelectionResult(e){if(!e)return null;if(e instanceof Lh)return new iit(e);if(e instanceof dB)return new Ohi(e);return new Vhi(e)}createCircuitJsonDiagnostic(e,t){let n=e,o="source_component_misconfigured_error";if(typeof n.error_type==="string")o=n.error_type;else if(typeof n.warning_type==="string")o=n.warning_type;let r={...e};if(typeof n.type==="string")r.type=n.type;else r.type=o;if(typeof n.warning_type!=="string")if(typeof n.error_type==="string")r.error_type=n.error_type;else r.error_type=o;let i=`${o}_id`;if(n[i])r[i]=n[i];else r[i]=`${o}_${this._renderId}_${t}`;return yAe.parse(r)}isConnected(e,t,n){let o=this.getConnectivityKeys(e,n),r=this.getConnectivityKeys(t,n);return o.some((i)=>r.includes(i))}getResistanceBetween(e,t,n){if(this.isConnected(e,t,n))return 0;let o=this.getConnectivityKeys(e,n),r=this.getConnectivityKeys(t,n);if(o.length===0||r.length===0)return null;let i=n.filter((a)=>a.type==="source_component"&&a.ftype==="simple_resistor"),s=this.root;if(!s)return null;for(let a of i){let c=s.db.source_port.list({source_component_id:a.source_component_id});if(c.length!==2)continue;let l=c.map((u)=>u.subcircuit_connectivity_map_key),h=l.some((u)=>u&&o.includes(u)),d=l.some((u)=>u&&r.includes(u));if(h&&d)return a.resistance}return null}getConnectivityKeys(e,t){if(!e)return[];if(typeof e==="string"){let n=this.selectCustomDrcElement(e);if(n)return this.getConnectivityKeys(n,t);return[]}if(Lhi(e))return[e.getSourcePort()?.subcircuit_connectivity_map_key].filter(jhe);if(Hhi(e))return[e.getSourceNet()?.subcircuit_connectivity_map_key].filter(jhe);if(Fhi(e))return e.getPorts().flatMap((n)=>this.getConnectivityKeys(n,t));if(zhi(e))return this.getCircuitJsonElementConnectivityKeys(e,t);return[]}getCircuitJsonElementConnectivityKeys(e,t){if(!e)return[];if(e.type==="source_port")return[e.subcircuit_connectivity_map_key].filter(jhe);if(e.type==="source_net")return[e.subcircuit_connectivity_map_key].filter(jhe);if(e.type==="pcb_port")return this.getConnectivityKeys(e.source_port_id,t);if(e.type==="source_component"){let n=this.root;if(!n)return[];return n.db.source_port.list({source_component_id:e.source_component_id}).map((o)=>o.subcircuit_connectivity_map_key).filter(jhe)}return[]}},Ghi=class extends nr{get config(){return{componentName:"AutoroutingPhase",zodProps:PDt}}add(e){throw Error("<autoroutingphase> cannot contain children")}},DSn=({from:e,offset:t,offsetDirection:n,to:o,transform:r})=>{if(n)return TSn.applyToPoint({...r,e:0,f:0},n);let i=o.x-e.x,s=o.y-e.y,a=Math.hypot(i,s);if(t===void 0||a===0)return;return{x:-s/a,y:i/a}},Uhi=class extends nr{fabrication_note_dimension_id=null;isPcbPrimitive=!0;get config(){return{componentName:"FabricationNoteDimension",zodProps:zDt}}_resolvePoint(e,t){if(typeof e==="string"){let r=this.getSubcircuit().selectOne(e);if(!r)return this.renderError(`FabricationNoteDimension could not find selector "${e}"`),sit.applyToPoint(t,{x:0,y:0});return r._getGlobalPcbPositionBeforeLayout()}let n=typeof e.x==="string"?parseFloat(e.x):e.x,o=typeof e.y==="string"?parseFloat(e.y):e.y;return sit.applyToPoint(t,{x:n,y:o})}doInitialPcbPrimitiveRender(){if(this.root?.pcbDisabled)return;let{db:e}=this.root,{_parsedProps:t}=this,n=this._computePcbGlobalTransformBeforeLayout(),o=this._resolvePoint(t.from,n),r=this._resolvePoint(t.to,n),i=this.getSubcircuit(),s=this.getGroup(),{maybeFlipLayer:a}=this._getPcbPrimitiveFlippedHelpers(),c=a(t.layer??"top");if(c!=="top"&&c!=="bottom")throw Error(`Invalid layer "${c}" for FabricationNoteDimension. Must be "top" or "bottom".`);let l=this.parent?.pcb_component_id??this.getPrimitiveContainer()?.pcb_component_id,h=t.text??this._formatDistanceText({from:o,to:r,units:t.units??"mm"}),d=DSn({from:o,offset:t.offset,offsetDirection:t.offsetDirection,to:r,transform:n}),u=e.pcb_fabrication_note_dimension.insert({pcb_component_id:l,subcircuit_id:i?.subcircuit_id??void 0,pcb_group_id:s?.pcb_group_id??void 0,layer:c,from:o,to:r,text:h,offset:t.offset,offset_distance:t.offset,offset_direction:d,font:t.font??"tscircuit2024",font_size:t.fontSize??1,color:t.color,arrow_size:t.arrowSize??1});this.fabrication_note_dimension_id=u.pcb_fabrication_note_dimension_id}_moveCircuitJsonElements({deltaX:e,deltaY:t}){if(this.root?.pcbDisabled)return;let{db:n}=this.root;if(!this.fabrication_note_dimension_id)return;let o=n.pcb_fabrication_note_dimension.get(this.fabrication_note_dimension_id);if(o)n.pcb_fabrication_note_dimension.update(this.fabrication_note_dimension_id,{from:{x:o.from.x+e,y:o.from.y+t},to:{x:o.to.x+e,y:o.to.y+t}})}getPcbSize(){let e=this._computePcbGlobalTransformBeforeLayout(),t=this._resolvePoint(this._parsedProps.from,e),n=this._resolvePoint(this._parsedProps.to,e);return{width:Math.abs(n.x-t.x),height:Math.abs(n.y-t.y)}}_formatDistanceText({from:e,to:t,units:n}){let o=t.x-e.x,r=t.y-e.y,i=Math.sqrt(o*o+r*r),s=n==="in"?i/25.4:i,a=Math.round(s);if(Math.abs(s-a)<0.000000001)return`${a}${n}`;let l=n==="in"?3:2;return`${n==="in"?Number(s.toFixed(l)).toString():s.toFixed(l)}${n}`}},Whi=class extends nr{pcb_note_dimension_id=null;isPcbPrimitive=!0;get config(){return{componentName:"PcbNoteDimension",zodProps:wNt}}_resolvePoint(e,t){if(typeof e==="string"){let r=this.getSubcircuit().selectOne(`.${e}`);if(!r)return this.renderError(`PcbNoteDimension could not find selector "${e}"`),ait.applyToPoint(t,{x:0,y:0});let i=r.pcb_component_id,s=this.root;if(i&&s){let a=s.db.pcb_component.get(i);if(a?.center)return{x:a.center.x,y:a.center.y}}return r._getGlobalPcbPositionBeforeLayout()}let n=typeof e.x==="string"?parseFloat(e.x):e.x,o=typeof e.y==="string"?parseFloat(e.y):e.y;return ait.applyToPoint(t,{x:n,y:o})}doInitialPcbPrimitiveRender(){if(this.root?.pcbDisabled)return;let{db:e}=this.root,{_parsedProps:t}=this,n=this._computePcbGlobalTransformBeforeLayout(),o=this._resolvePoint(t.from,n),r=this._resolvePoint(t.to,n),i=this.getSubcircuit(),s=this.getGroup(),a=this.parent?.pcb_component_id??this.getPrimitiveContainer()?.pcb_component_id??void 0,c=t.text??this._formatDistanceText({from:o,to:r,units:t.units??"mm"}),l=DSn({from:o,offset:t.offset,offsetDirection:t.offsetDirection,to:r,transform:n}),h=e.pcb_note_dimension.insert({pcb_component_id:a,subcircuit_id:i?.subcircuit_id??void 0,pcb_group_id:s?.pcb_group_id??void 0,from:o,to:r,text:c,offset_distance:t.offset,offset_direction:l,font:t.font??"tscircuit2024",font_size:t.fontSize??1,layer:t.layer==="bottom"?"bottom":"top",color:t.color,arrow_size:t.arrowSize??1});this.pcb_note_dimension_id=h.pcb_note_dimension_id}doInitialPcbLayout(){let e=this.root;if(!e||e.pcbDisabled)return;if(!this.pcb_note_dimension_id)return;let{db:t}=e,n=this._computePcbGlobalTransformBeforeLayout(),o=this._resolvePoint(this._parsedProps.from,n),r=this._resolvePoint(this._parsedProps.to,n);t.pcb_note_dimension.update(this.pcb_note_dimension_id,{from:o,to:r})}getPcbSize(){let e=this._computePcbGlobalTransformBeforeLayout(),t=this._resolvePoint(this._parsedProps.from,e),n=this._resolvePoint(this._parsedProps.to,e);return{width:Math.abs(n.x-t.x),height:Math.abs(n.y-t.y)}}_formatDistanceText({from:e,to:t,units:n}){let o=t.x-e.x,r=t.y-e.y,i=Math.sqrt(o*o+r*r),s=n==="in"?i/25.4:i,a=Math.round(s);if(Math.abs(s-a)<0.000000001)return`${a}${n}`;let l=n==="in"?3:2;return`${n==="in"?Number(s.toFixed(l)).toString():s.toFixed(l)}${n}`}_moveCircuitJsonElements({deltaX:e,deltaY:t}){if(this.root?.pcbDisabled)return;let{db:n}=this.root;if(!this.pcb_note_dimension_id)return;let o=n.pcb_note_dimension.get(this.pcb_note_dimension_id);if(o)n.pcb_note_dimension.update(this.pcb_note_dimension_id,{from:{x:o.from.x+e,y:o.from.y+t},to:{x:o.to.x+e,y:o.to.y+t}})}},Bde=class extends Z7n{get config(){return{componentName:"AutoplacedBreakoutPoint",zodProps:Gci}}_applySolvedBreakoutPoint({sourceTraceId:e,layer:t,position:n}){this.matchedSourceTraceId=e,this._renderPcbBreakoutPoint({layer:Bo.parse(t)}),this._setPositionFromLayout(n)}},NSn=[{id:"DQ0",layer:"inner3",soc:{x:-6,y:-3},ram:{x:3.941917,y:-3.650917}},{id:"DQ1",layer:"inner6",fullLayer:"inner2",soc:{x:-5.5,y:-3},ram:{x:4.591917,y:-3.650917}},{id:"DQ2",layer:"inner5",fullLayer:"inner4",soc:{x:-4.5,y:-3},ram:{x:5.891917,y:-3.650917}},{id:"DQ3",layer:"inner2",fullLayer:"inner6",soc:{x:-4.5,y:-3.5},ram:{x:6.541917,y:-3.650917}},{id:"DQ4",layer:"inner3",fullLayer:"inner2",soc:{x:-6,y:-2.5},ram:{x:6.541917,y:-2.050917}},{id:"DQ5",layer:"inner2",fullLayer:"inner5",soc:{x:-6,y:-2},ram:{x:5.891917,y:-2.050917}},{id:"DQ6",layer:"inner5",fullLayer:"inner4",soc:{x:-5,y:-2},ram:{x:4.591917,y:-2.050917}},{id:"DQ7",layer:"inner4",fullLayer:"inner6",soc:{x:-5.5,y:-2},ram:{x:3.941917,y:-2.050917}},{id:"DM0",layer:"inner4",fullLayer:"inner5",soc:{x:-5,y:-3},ram:{x:4.591917,y:-2.850917}},{id:"DQS0",layer:"inner1",differentialPairId:"DQS0",soc:{x:-4.5,y:-2.5},ram:{x:5.241917,y:-2.850917}},{id:"DQS0_n",layer:"inner1",differentialPairId:"DQS0",soc:{x:-5,y:-2.5},ram:{x:5.891917,y:-2.850917}}],RSn=[{id:"DQ8",layer:"inner6",fullLayer:"inner4",soc:{x:-6,y:3},ram:{x:3.941917,y:3.549083}},{id:"DQ9",layer:"inner3",fullLayer:"inner4",soc:{x:-5.5,y:2},ram:{x:4.591917,y:3.549083}},{id:"DQ10",layer:"inner3",fullLayer:"inner2",soc:{x:-4.5,y:2},ram:{x:5.891917,y:3.549083}},{id:"DQ11",layer:"inner6",fullLayer:"inner5",soc:{x:-4.5,y:2.5},ram:{x:6.541917,y:3.549083}},{id:"DQ12",layer:"inner5",fullLayer:"inner1",soc:{x:-6,y:2.5},ram:{x:6.541917,y:1.949083}},{id:"DQ13",layer:"inner2",fullLayer:"inner3",soc:{x:-6.5,y:3},ram:{x:5.891917,y:1.949083}},{id:"DQ14",layer:"inner5",fullLayer:"inner6",soc:{x:-5,y:2.5},ram:{x:4.591917,y:1.949083}},{id:"DQ15",layer:"inner4",fullLayer:"inner1",soc:{x:-4.5,y:3.5},ram:{x:3.941917,y:1.949083}},{id:"DM1",layer:"inner4",fullLayer:"inner5",soc:{x:-5,y:3.5},ram:{x:4.591917,y:2.749083}},{id:"DQS1",layer:"inner1",fullLayer:"bottom",differentialPairId:"DQS1",soc:{x:-4.5,y:3},ram:{x:5.241917,y:2.749083}},{id:"DQS1_n",layer:"inner1",fullLayer:"bottom",differentialPairId:"DQS1",soc:{x:-5,y:3},ram:{x:5.891917,y:2.749083}}],QSn=[{id:"A0",layer:"bottom",soc:{x:-6.5,y:-0.5},ram:{x:7.841917,y:-3.650917}},{id:"A1",layer:"inner3",soc:{x:-7,y:-2},ram:{x:8.491917,y:-3.650917}},{id:"A2",layer:"inner3",soc:{x:-7,y:-0.5},ram:{x:7.841917,y:1.949083}},{id:"A3",layer:"inner6",soc:{x:-5,y:-1},ram:{x:7.841917,y:2.749083}},{id:"A4",layer:"inner4",soc:{x:-4.5,y:-1.5},ram:{x:7.841917,y:3.549083}},{id:"A5",layer:"inner2",soc:{x:-6.5,y:-2},ram:{x:8.491917,y:3.549083}},{id:"CS0_n",layer:"inner5",soc:{x:-5.5,y:-0.5},ram:{x:7.841917,y:-2.050917}},{id:"CKE0",layer:"inner1",soc:{x:-4.5,y:-1},ram:{x:8.491917,y:-2.050917}},{id:"CK0",layer:"bottom",differentialPairId:"CK0",soc:{x:-4.5,y:1},ram:{x:8.491917,y:1.149083}},{id:"CK0_n",layer:"bottom",differentialPairId:"CK0",soc:{x:-5,y:1},ram:{x:8.491917,y:1.949083}},{id:"DDR_LINK_RESET0_n",layer:"inner6",soc:{x:-5,y:-1.5},ram:{x:13.041917,y:3.549083}}],G7e=(e)=>{let t=e.buses.flatMap((s)=>s.ports),n=new Set,o=(s)=>[{regionId:"soc",position:s.soc},{regionId:"ram",position:s.ram}],r=[];for(let s of t){if(!s.differentialPairId){r.push({id:s.id,endpoints:o(s)});continue}if(n.has(s.differentialPairId))continue;n.add(s.differentialPairId);let a=t.filter((h)=>h.differentialPairId===s.differentialPairId);if(a.length!==2)throw Error(`Differential pair ${s.differentialPairId} must have two members`);let[c,l]=a;r.push({type:"differential",connections:[{id:c.id,endpoints:o(c)},{id:l.id,endpoints:o(l)}]})}let i=e.buses.map((s)=>{let a={id:s.id,connectionIds:s.ports.map((c)=>c.id)};if(s.preferredLayer!==void 0)a={...a,preferredLayer:s.preferredLayer};if(s.preferredLayers!==void 0)a={...a,preferredLayers:s.preferredLayers};return a});return{regions:[{id:"soc",bounds:{minX:-16.62808,maxX:-2.37192,minY:-10.62808,maxY:10.62808},edge:"right"},{id:"ram",bounds:{minX:1.091917,maxX:18.141917,minY:-9.650917,maxY:9.549083},edge:"left"}],connections:r,buses:i,boundaryPointSpacing:0.48}},H$s=G7e({buses:[{id:"DDR_BYTE0",ports:NSn,preferredLayers:["inner1","inner4"]}]}),F$s=G7e({buses:[{id:"DDR_BYTE1",ports:RSn,preferredLayers:["inner2","inner5"]}]}),z$s=G7e({buses:[{id:"DDR_BYTE0",ports:NSn,preferredLayers:["inner1","inner4"]},{id:"DDR_BYTE1",ports:RSn,preferredLayers:["inner2","inner5"]},{id:"DDR_ADDR_CTRL",ports:QSn,preferredLayers:["inner3","inner6"]}]}),O$s=G7e({buses:[{id:"DDR_ADDR_CTRL",ports:QSn,preferredLayers:["inner3","inner6"]}]}),Xhi=class extends Error{name="WindingBreakoutInputError"},kSn=class extends Error{name="WindingBreakoutInfeasibleError"},Qat=class extends Error{name="WindingBreakoutInvariantError"},jhi=class extends Error{name="WindingBreakoutOutputUnavailableError"},U7e=(e)=>{let t=[];for(let n of e.connections)if("type"in n)t.push(...n.connections);else t.push(n);return t},kat=(e)=>{if(e.preferredLayer!==void 0)return[e.preferredLayer];if(e.preferredLayers!==void 0)return[...new Set(e.preferredLayers)];return["top"]},Lat=(e)=>{let t=new Map;for(let n of e.buses){let o=kat(n);for(let r of n.connectionIds)t.set(r,o)}return Object.fromEntries(U7e(e).map((n)=>[n.id,t.get(n.id)??["top"]]))},yh=(e)=>{throw new Xhi(`WindingBreakoutSolver: ${e}`)},Khi=(e)=>typeof e==="object"&&e!==null&&!Array.isArray(e),aY=(e,t)=>{if(!Khi(e))yh(`${t} must be an object`)},ZV=(e,t)=>{if(typeof e!=="string"||e.trim().length===0)yh(`${t} must be a non-empty string`)},gY=(e,t)=>{if(typeof e!=="number"||!Number.isFinite(e))yh(`${t} must be finite`)},$hi=(e,t)=>{if(gY(e,t),e<=0)yh(`${t} must be positive`)},Khe=(e,t)=>{if(Array.isArray(e))return e;return yh(t)},qhi=(e,t)=>(aY(e,t),gY(e.x,`${t}.x`),gY(e.y,`${t}.y`),e),Jhi=(e,t)=>{if(aY(e,t),gY(e.minX,`${t}.minX`),gY(e.maxX,`${t}.maxX`),gY(e.minY,`${t}.minY`),gY(e.maxY,`${t}.maxY`),e.minX>=e.maxX||e.minY>=e.maxY)yh(`${t} must have positive width and height`);return{minX:e.minX,maxX:e.maxX,minY:e.minY,maxY:e.maxY}},Zhi=(e,t)=>e.x>=t.minX&&e.x<=t.maxX&&e.y>=t.minY&&e.y<=t.maxY,edi=(e)=>{if(!Array.isArray(e.regions)||e.regions.length===0)yh("at least one region is required");$hi(e.boundaryPointSpacing,"boundaryPointSpacing");let t=new Set,n=e.regions.map((p,m)=>{if(aY(p,`regions[${m}]`),ZV(p.id,`regions[${m}].id`),t.has(p.id))yh(`duplicate region id "${p.id}"`);t.add(p.id);let A=Jhi(p.bounds,`region "${p.id}" bounds`);if(typeof p.edge!=="string"||!new Set(["left","right","bottom","top"]).has(p.edge))yh(`region "${p.id}" has invalid edge`);return{id:p.id,bounds:A,edge:p.edge,center:{x:(A.minX+A.maxX)/2,y:(A.minY+A.maxY)/2}}}),o=n.every((p)=>p.edge==="left"||p.edge==="right"),r=n.every((p)=>p.edge==="bottom"||p.edge==="top");if(!o&&!r)yh("all coordinated region edges must be parallel");if(!Array.isArray(e.connections)||e.connections.length===0)yh("at least one connection is required");let i=[],s=new Set,a=[],c=(p,m)=>{if(aY(p,m),ZV(p.id,`${m}.id`),s.has(p.id))yh(`duplicate connection id "${p.id}"`);if("layer"in p)yh(`${m}.layer is not accepted; declare layer preferences on a bus`);let A=Khe(p.endpoints,`${m}.endpoints must be an array`),g=new Set,f=A.map((y,x)=>{let C=`${m}.endpoints[${x}]`;if(aY(y,C),ZV(y.regionId,`${C}.regionId`),!t.has(y.regionId))yh(`${C} references unknown region "${y.regionId}"`);if(g.has(y.regionId))yh(`${m} has duplicate endpoint for region "${y.regionId}"`);g.add(y.regionId);let b=qhi(y.position,`${C}.position`),I=n.find((v)=>v.id===y.regionId);if(!Zhi(b,I.bounds))yh(`${m} endpoint for region "${I.id}" is outside its bounds`);return{regionId:y.regionId,position:b}});for(let y of n)if(!g.has(y.id))yh(`${m} is missing endpoint for region "${y.id}"`);if(f.length!==n.length)yh(`${m} must contain exactly one endpoint for every region`);return s.add(p.id),{id:p.id,endpoints:f}};for(let[p,m]of e.connections.entries()){let A=`connections[${p}]`;if(aY(m,A),"type"in m||"connections"in m){if(m.type!=="differential")yh(`${A} has invalid differential-pair type`);if("layer"in m)yh(`${A}.layer is not accepted; declare layer preferences on a bus`);let g=Khe(m.connections,`${A}.connections must contain exactly two members`);if(g.length!==2)yh(`${A}.connections must contain exactly two members`);let f=c(g[0],`${A}.connections[0]`),y=c(g[1],`${A}.connections[1]`);if(f.id===y.id)yh(`${A} members must have distinct connection ids`);i.push(f,y),a.push([f.id,y.id])}else i.push(c(m,A))}let l=Khe(e.buses,"buses must be an array"),h=new Set,d=new Map,u=l.map((p,m)=>{let A=`buses[${m}]`;aY(p,A),ZV(p.id,`${A}.id`);let g=p.id;if(h.has(g))yh(`duplicate bus id "${g}"`);h.add(g);let f=Khe(p.connectionIds,`${A}.connectionIds must be a non-empty array`);if(f.length===0)yh(`${A}.connectionIds must be a non-empty array`);let y=new Set,x=f.map((v,P)=>{if(ZV(v,`${A}.connectionIds[${P}]`),!s.has(v))yh(`${A} references unknown connection "${v}"`);if(y.has(v))yh(`${A} contains duplicate connection "${v}"`);y.add(v);let M=d.get(v);if(M!==void 0)yh(`connection "${v}" belongs to multiple buses "${M}" and "${p.id}"`);return d.set(v,g),v}),C;if(p.preferredLayer!==void 0)ZV(p.preferredLayer,`${A}.preferredLayer`),C=p.preferredLayer;let b;if(p.preferredLayers!==void 0){let v=Khe(p.preferredLayers,`${A}.preferredLayers must be a non-empty array`);if(v.length===0)yh(`${A}.preferredLayers must be a non-empty array`);let P=new Set;b=v.map((M,B)=>{if(ZV(M,`${A}.preferredLayers[${B}]`),P.has(M))yh(`${A}.preferredLayers contains duplicate layer "${M}"`);return P.add(M),M})}let I={id:g,connectionIds:x};if(C!==void 0)I={...I,preferredLayer:C};if(b!==void 0)I={...I,preferredLayers:b};return I});for(let[p,m]of a){let A=d.get(p),g=d.get(m);if(A!==g)yh(`differential pair "${p}/${m}" must belong to the same bus`)}let _=[...new Set([...u.flatMap((p)=>kat(p)),...i.filter((p)=>!d.has(p.id)).map(()=>"top")])].sort((p,m)=>p.localeCompare(m));return{regions:n,connections:i,buses:u,layerNames:_,atomicConnectionGroups:a}},tdi=0.000000001,ndi=(e)=>e==="left"||e==="right",odi=(e,t)=>{if(t)return e.bounds.minY;return e.bounds.minX},rdi=(e,t)=>{if(t)return e.bounds.maxY;return e.bounds.maxX},idi=(e,t)=>{if(t)return e.y;return e.x},sdi=(e,t)=>{let n=t/2;return Object.fromEntries(e.map((o,r)=>[o,(r-(e.length-1)/2)*n]))},adi=({referenceOrder:e,layer:t,layerByConnection:n,atomicGroups:o})=>{let r=e.filter((c)=>n[c]===t),i=new Map(o.flatMap((c)=>c.map((l)=>[l,c]))),s=new Set,a=[];for(let c of r){let l=i.get(c);if(!l){a.push(c);continue}if(s.has(l))continue;s.add(l),a.push(...r.filter((h)=>l.includes(h)))}return a},cdi=({regions:e,connections:t,spacing:n,count:o,layerOffsets:r})=>{let i=e.every((_)=>ndi(_.edge)),s=Math.max(...e.map((_)=>odi(_,i))),a=Math.min(...e.map((_)=>rdi(_,i))),c=Math.min(...Object.values(r)),l=Math.max(...Object.values(r)),h=n*Math.max(0,o-1)+l-c;if(a-s+tdi<h)throw new kSn(`WindingBreakoutSolver: declared breakout edges need ${h.toFixed(2)}mm but expose only ${(a-s).toFixed(2)}mm`);let d=e.reduce((_,p)=>{let m=t.map((A)=>A.endpoints.find((g)=>g.regionId===p.id).position);return _+m.reduce((A,g)=>A+idi(g,i),0)/m.length},0)/e.length,u=Math.max(s-c,Math.min(a-n*Math.max(0,o-1)-l,d-n*Math.max(0,o-1)/2));return{vertical:i,axes:Array.from({length:o},(_,p)=>u+p*n)}},ldi=(e,t,n)=>{if(n){let r=e.bounds.maxX;if(e.edge==="left")r=e.bounds.minX;return{x:r,y:t}}let o=e.bounds.maxY;if(e.edge==="bottom")o=e.bounds.minY;return{x:t,y:o}},hdi=({regions:e,connections:t,referenceOrder:n,layerNames:o,layerByConnection:r,boundaryPointSpacing:i,atomicGroups:s})=>{let a=sdi(o,i),c=Object.fromEntries(o.map((_)=>[_,adi({referenceOrder:n,layer:_,layerByConnection:r,atomicGroups:s})])),l=Math.max(...o.map((_)=>t.filter((p)=>r[p.id]===_).length)),{vertical:h,axes:d}=cdi({regions:e,connections:t,spacing:i,count:l,layerOffsets:a});return{breakoutPoints:e.flatMap((_)=>o.flatMap((p)=>c[p].map((m,A)=>({regionId:_.id,connectionId:m,layer:p,...ldi(_,d[A]+a[p],h)}))))}},ddi=(e,t)=>{let n=new Set(e),o=new Map(t.flatMap((s)=>s.map((a)=>[a,s]))),r=new Set,i=[];for(let s of e){let a=o.get(s);if(!a){i.push([s]);continue}if(r.has(a))continue;r.add(a),i.push(a.filter((c)=>n.has(c)))}return i},udi=({validated:e,referenceOrder:t})=>{let n=new Map;for(let i of e.buses){let s=new Set(i.connectionIds),a=t.filter((h)=>s.has(h)),c=kat(i),l=ddi(a,e.atomicConnectionGroups);for(let[h,d]of l.entries()){let u=c[h%c.length];for(let _ of d)n.set(_,u)}}for(let i of t)if(!n.has(i))n.set(i,"top");let o=Object.fromEntries(t.map((i)=>[i,n.get(i)])),r=[...new Set(Object.values(o))].sort((i,s)=>i.localeCompare(s));return{layerByConnection:o,layerNames:r}},Hat=(e)=>[...new Set(Object.values(Lat(e)).flat())].sort((t,n)=>t.localeCompare(n)),vxn=["#2563eb","#dc2626","#059669","#7c3aed","#d97706","#0891b2","#db2777","#4f46e5","#65a30d","#c2410c","#0f766e","#9333ea"],$8e=(e)=>{let t=2166136261;for(let n of e)t^=n.charCodeAt(0),t=Math.imul(t,16777619);return vxn[(t>>>0)%vxn.length]},Ek=(e,t)=>{let n=Hat(e),o=[...new Set(t)].map((r)=>{let i=n.indexOf(r);if(i<0)throw Error(`Cannot visualize unknown signal layer "${r}"`);return i});if(o.length===0)throw Error("Cannot create graphics metadata without a signal layer");return o.sort((r,i)=>r-i),`z${o.join(",")}`},pdi=(e,t)=>{let n={circles:[],rects:[],texts:[]},r=Hat(e);if(t)r=[t];let i=Ek(e,r),s=U7e(e),a=Lat(e),c=Math.min(0.12,e.boundaryPointSpacing/4);for(let l of e.regions){let h={x:(l.bounds.minX+l.bounds.maxX)/2,y:(l.bounds.minY+l.bounds.maxY)/2};n.rects.push({center:h,width:l.bounds.maxX-l.bounds.minX,height:l.bounds.maxY-l.bounds.minY,fill:"rgba(226, 232, 240, 0.035)",stroke:"rgba(71, 85, 105, 0.55)",layer:i});for(let d of s){let u=a[d.id];if(t&&!u.includes(t))continue;let _=d.endpoints.find((m)=>m.regionId===l.id);if(!_)continue;let p=$8e(d.id);n.circles.push({center:_.position,radius:c,fill:`${p}70`,stroke:p,layer:Ek(e,u)})}n.texts.push({x:h.x,y:l.bounds.maxY+0.35,text:l.id,anchorSide:"bottom_center",color:"#334155",fontSize:0.34,layer:i})}return n},mdi=(e,t,n)=>{let o=U7e(e),r=t.breakoutPoints.filter((a)=>!n||a.layer===n),i=new Map;for(let a of t.breakoutPoints){let c=`${a.regionId}:${a.x.toFixed(9)}:${a.y.toFixed(9)}`,l=i.get(c)??{x:a.x,y:a.y,layers:new Set};l.layers.add(a.layer),i.set(c,l)}return{lines:t.referenceOrder.flatMap((a)=>{let c=o.find((u)=>u.id===a);if(!c)return[];let l=r.filter((u)=>u.connectionId===a),h=l[0]?.layer;if(!h||n&&h!==n)return[];if(l.length!==e.regions.length)return[];let d=e.regions.flatMap((u,_)=>{let p=c.endpoints.find((A)=>A.regionId===u.id),m=l.find((A)=>A.regionId===u.id);if(!p||!m)return[];if(_===0)return[p.position,m];return[m,p.position]});if(d.length<2)return[];return[{points:d,strokeColor:`${$8e(a)}55`,strokeWidth:0.012,strokeDash:[0.025,0.07],layer:Ek(e,[h])}]}),circles:[...i.values()].flatMap((a)=>{let c=[...a.layers].filter((l)=>!n||l===n);if(c.length===0)return[];return[{center:a,radius:0.11,fill:"rgba(15, 23, 42, 0.06)",stroke:"#475569",layer:Ek(e,c)}]}),points:r.map((a)=>({x:a.x,y:a.y,color:$8e(a.connectionId),label:`${a.connectionId} · ${a.layer}`,layer:Ek(e,[a.layer])}))}},q8e=({input:e,phase:t,detail:n,activeLayer:o,referenceOrder:r,referenceRegionId:i,showReferenceNumbers:s=!1,state:a})=>{let c=pdi(e,o),l;if(a)l=mdi(e,a,o);let h=Hat(e);if(o)h=[o];let d=Ek(e,h),u=Math.max(...e.regions.map((g)=>g.bounds.maxY)),_=Math.min(...e.regions.map((g)=>g.bounds.minX)),p=[...c.texts??[],...l?.texts??[],{x:_,y:u+1.05,text:t,anchorSide:"bottom_left",color:"#0f172a",fontSize:0.42,layer:d},{x:_,y:u+0.68,text:n,anchorSide:"bottom_left",color:"#475569",fontSize:0.25,layer:d}],m=[],A=[];if(s&&r){let g=e.regions.find((b)=>b.id===i)??e.regions[0],f=U7e(e),y=Lat(e),x=[];for(let[b,I]of r.entries()){let v=f.find((B)=>B.id===I),P=y[I];if(!v||!P||o&&!P.includes(o))continue;let M=v.endpoints.find((B)=>B.regionId===g.id);if(!M)continue;x.push(M.position),p.push({x:M.position.x+0.18,y:M.position.y+0.18,text:`${b+1} · ${I}`,anchorSide:"bottom_left",color:$8e(I),fontSize:0.21,layer:Ek(e,P)})}let C={x:(g.bounds.minX+g.bounds.maxX)/2,y:(g.bounds.minY+g.bounds.maxY)/2};if(m.push(...x.map((b)=>({points:[C,b],strokeColor:"rgba(100, 116, 139, 0.35)",strokeWidth:0.01,strokeDash:[0.03,0.05],layer:d}))),x.length>1)m.push({points:x,strokeColor:"rgba(15, 23, 42, 0.65)",strokeWidth:0.018,strokeDash:[0.04,0.04],label:`${g.id} angular winding order`,layer:d});A.push({center:C,radius:0.07,fill:"#0f172a",stroke:"#ffffff",label:`${g.id} angular reference center`,layer:d})}return{title:t,coordinateSystem:"cartesian",rects:c.rects,polygons:c.polygons,lines:[...l?.lines??[],...m],circles:[...c.circles??[],...l?.circles??[],...A],points:l?.points,texts:p}},Sxn=(e)=>new Set(e.map((t)=>`${t.regionId}:${t.x.toFixed(9)}:${t.y.toFixed(9)}`)).size,_di=class extends co{constructor(e){super();this.params=e,this.visualizationLayer=e.visualizationLayer;let t=udi({validated:e.validated,referenceOrder:e.ordering.referenceOrder});this.layerByConnection=t.layerByConnection,this.placementBatches=e.validated.regions.flatMap((n)=>t.layerNames.map((o)=>({regionId:n.id,layer:o}))),this.MAX_ITERATIONS=this.placementBatches.length+2}params;batchIndex=0;output;plannedPlacement;placementBatches;visibleBreakoutPoints=[];layerByConnection;visualizationLayer;setVisualizationLayer(e){this.visualizationLayer=e}_step(){if(!this.plannedPlacement){this.plannedPlacement=hdi({regions:this.params.validated.regions,connections:this.params.validated.connections,referenceOrder:this.params.ordering.referenceOrder,layerNames:[...new Set(Object.values(this.layerByConnection))].sort((t,n)=>t.localeCompare(n)),layerByConnection:this.layerByConnection,boundaryPointSpacing:this.params.input.boundaryPointSpacing,atomicGroups:this.params.validated.atomicConnectionGroups}),this.stats={phase:"plan-gate-grid",regionLayerBatches:this.placementBatches.length,placedBreakpoints:0};return}let e=this.placementBatches[this.batchIndex];if(e){this.visibleBreakoutPoints.push(...this.plannedPlacement.breakoutPoints.filter((t)=>t.regionId===e.regionId&&t.layer===e.layer)),this.batchIndex+=1,this.stats={phase:"place-region-layer-batch",regionId:e.regionId,layer:e.layer,completedBatches:this.batchIndex,totalBatches:this.placementBatches.length,placedBreakpoints:this.visibleBreakoutPoints.length};return}this.output=this.plannedPlacement,this.stats={phase:"finalize-shared-gate-slots",placedBreakpoints:this.output.breakoutPoints.length,sharedGateSlots:Sxn(this.output.breakoutPoints)},this.solved=!0}computeProgress(){let e=this.batchIndex;if(this.plannedPlacement)e+=1;if(this.output)e+=1;return e/this.MAX_ITERATIONS}getConstructorParams(){return[this.params]}getOutput(){if(!this.solved||!this.output)throw new Qat("WindingBreakoutSolver: gate placement requested before placement completed");return this.output}visualize(){let e="Next microstep: derive layer offsets, atomic gate orders, and the common boundary slot grid";if(this.plannedPlacement&&this.batchIndex===0)e=`Gate grid planned · ${this.placementBatches.length} region/layer batches remain`;else if(this.plannedPlacement&&!this.output){let r=this.placementBatches[this.batchIndex-1];e=`Placed region “${r.regionId}” on layer “${r.layer}” · ${this.batchIndex}/${this.placementBatches.length} batches`}else if(this.output){let r=Sxn(this.output.breakoutPoints);e=`${this.output.breakoutPoints.length} gates placed; coincident layer positions form ${r} shared slots`}let t;if(this.plannedPlacement){let r=this.visibleBreakoutPoints;if(this.output)r=this.output.breakoutPoints;t={referenceOrder:this.params.ordering.referenceOrder,breakoutPoints:r}}let n=q8e({input:this.params.input,activeLayer:this.visualizationLayer,phase:"Step 2 · Place boundary gates",detail:e,state:t}),o=(this.plannedPlacement?.breakoutPoints??[]).filter((r)=>!this.visualizationLayer||r.layer===this.visualizationLayer).map((r)=>({center:r,radius:0.065,fill:"rgba(255, 255, 255, 0.75)",stroke:"rgba(100, 116, 139, 0.5)",label:`planned slot ${r.regionId} · ${r.layer}`,layer:Ek(this.params.input,[r.layer])}));return{...n,circles:[...n.circles??[],...o]}}},gdi=(e,t)=>t.map((n)=>{let o=n.endpoints.find((r)=>r.regionId===e.id).position;return{id:n.id,angle:Math.atan2(o.y-e.center.y,o.x-e.center.x),radius:Math.hypot(o.x-e.center.x,o.y-e.center.y)}}).sort((n,o)=>n.angle-o.angle||o.radius-n.radius||n.id.localeCompare(o.id)).map((n)=>n.id),Adi=(e,t,n)=>{let o=new Map(t.flatMap((l)=>l.map((h)=>[h,l]))),r=new Set,i=[];for(let l of e){let h=o.get(l);if(!h){i.push(l);continue}if(r.has(h))continue;r.add(h),i.push(...e.filter((d)=>h.includes(d)))}let s=new Map(n.flatMap((l)=>l.connectionIds.map((h)=>[h,l]))),a=new Set,c=[];for(let l of i){let h=s.get(l);if(!h){c.push(l);continue}if(a.has(h))continue;a.add(h);let d=new Set(h.connectionIds);c.push(...i.filter((u)=>d.has(u)))}return c},fdi=class extends co{constructor(e){super();this.params=e,this.visualizationLayer=e.visualizationLayer,this.MAX_ITERATIONS=e.validated.regions.length+1}params;naturalOrderByRegion={};currentRegionIndex=0;output;visualizedOrder;visualizedRegionId;visualizationLayer;setVisualizationLayer(e){this.visualizationLayer=e}_step(){let e=this.params.validated.regions[this.currentRegionIndex];if(e){let o=gdi(e,this.params.validated.connections);this.naturalOrderByRegion[e.id]=o,this.visualizedRegionId=e.id,this.visualizedOrder=o,this.currentRegionIndex+=1,this.stats={phase:"derive-natural-order",regionId:e.id,completedRegions:this.currentRegionIndex,totalRegions:this.params.validated.regions.length,naturalOrder:o};return}let t=this.params.validated.regions[0],n=Adi(this.naturalOrderByRegion[t.id],this.params.validated.atomicConnectionGroups,this.params.validated.buses);this.output={naturalOrderByRegion:this.naturalOrderByRegion,referenceOrder:n},this.visualizedRegionId=t.id,this.visualizedOrder=n,this.stats={phase:"atomicize-reference-order",referenceRegion:t.id,referenceOrder:n},this.solved=!0}computeProgress(){let e=this.currentRegionIndex;if(this.output)e+=1;return e/this.MAX_ITERATIONS}getConstructorParams(){return[this.params]}getOutput(){if(!this.solved||!this.output)throw new Qat("WindingBreakoutSolver: reference order requested before ordering completed");return this.output}visualize(){let e=this.params.validated.regions[0].id,t=`Next microstep: derive natural order for region “${e}”`;if(this.visualizedRegionId&&!this.output)t=`Natural order for region “${this.visualizedRegionId}” · ${this.currentRegionIndex}/${this.params.validated.regions.length} regions processed`;if(this.output)t=`Reference region “${e}” finalized; buses are contiguous and differential pairs are atomic`;return q8e({input:this.params.input,activeLayer:this.visualizationLayer,phase:"Step 1 · Derive reference order",detail:t,referenceOrder:this.visualizedOrder,referenceRegionId:this.visualizedRegionId,showReferenceNumbers:!0})}},ydi=({points:e,connectionIds:t,regions:n,atomicGroups:o})=>{let r=n.map((d)=>d.id),i=new Map,s=new Map,a=!0;for(let d of e){let u=`${d.regionId}:${d.connectionId}`;i.set(u,(i.get(u)??0)+1);let _=s.get(d.connectionId);if(_!==void 0&&_!==d.layer)a=!1;s.set(d.connectionId,d.layer)}let c=r.flatMap((d)=>t.map((u)=>`${d}:${u}`)),l=i.size===c.length&&c.every((d)=>i.get(d)===1),h=o.every((d)=>{let u=s.get(d[0]);if(!u)return!1;if(d.some((_)=>s.get(_)!==u))return!1;return n.every((_)=>{let p=e.filter((y)=>y.regionId===_.id&&y.layer===u),m=_.edge==="left"||_.edge==="right",A=[...p].sort((y,x)=>m?y.y-x.y:y.x-x.x).map((y)=>y.connectionId),g=A.indexOf(d[0]),f=A.indexOf(d[1]);return g!==-1&&f!==-1&&Math.abs(g-f)===1})});return l&&a&&h},xdi=({validated:e,placement:t})=>{if(!ydi({points:t.breakoutPoints,connectionIds:e.connections.map((o)=>o.id),regions:e.regions,atomicGroups:e.atomicConnectionGroups}))throw new Qat("WindingBreakoutSolver: generated invalid breakout points");return{breakoutPoints:t.breakoutPoints}},Cdi=["referenceOrdering","gatePlacement"],bdi=class extends XC{validatedInput;output;visualizationLayer;pipelineDef=[xi("referenceOrdering",fdi,(e)=>[{input:e.inputProblem,validated:e.getValidatedInput(),visualizationLayer:e.visualizationLayer}]),xi("gatePlacement",_di,(e)=>[{input:e.inputProblem,validated:e.getValidatedInput(),ordering:e.getRequiredStageOutput("referenceOrdering"),visualizationLayer:e.visualizationLayer}])];constructor(e){super(e)}_setup(){this.validatedInput=edi(this.inputProblem),this.stats={phase:"setup-input-validation",regionCount:this.validatedInput.regions.length,connectionCount:this.validatedInput.connections.length,layerCount:this.validatedInput.layerNames.length}}getValidatedInput(){if(!this.validatedInput)throw Error("WindingBreakoutSolver: input has not been validated");return this.validatedInput}_step(){if(super._step(),!this.output&&!this.activeSubSolver&&this.currentPipelineStageIndex>=this.pipelineDef.length)this.output=xdi({validated:this.getValidatedInput(),placement:this.getRequiredStageOutput("gatePlacement")}),this.solved=!0;if(this.stats={phase:this.getCurrentStageName(),completedStages:this.currentPipelineStageIndex,totalStages:this.pipelineDef.length},this.solved)this.stats.phase="finalize-output-validation";if(this.output)this.stats.valid=!0,this.stats.breakoutPointCount=this.output.breakoutPoints.length}getRequiredStageOutput(e){let t=this.getStageOutput(e);if(t===void 0)throw Error(`WindingBreakoutSolver: pipeline stage “${e}” has no output`);return t}setVisualizationLayer(e){this.visualizationLayer=e;for(let t of Cdi){let n=this.getSolver(t);if(n&&"setVisualizationLayer"in n)n.setVisualizationLayer(e)}}getConstructorParams(){return[this.inputProblem]}getOutput(){if(!this.solved||!this.output)throw new jhi("WindingBreakoutSolver: getOutput() called before successful completion");return this.output}initialVisualize(){return q8e({input:this.inputProblem,activeLayer:this.visualizationLayer,phase:"Input · Validated during setup",detail:"Region bounds, breakout edges, bus layer preferences, and canonical endpoints"})}finalVisualize(){if(!this.output)return null;let e=this.getRequiredStageOutput("referenceOrdering");return q8e({input:this.inputProblem,activeLayer:this.visualizationLayer,phase:"Output · Validated after gate placement",detail:"Valid: one bus-constrained breakout point per connection and region; pairs are adjacent",state:{referenceOrder:e.referenceOrder,breakoutPoints:this.output.breakoutPoints}})}visualize(){return{...super.visualize(),title:"Winding breakout solver · step-by-step pipeline",coordinateSystem:"cartesian"}}},Pxn=(e)=>({id:e.connectionId,endpoints:e.endpoints}),Idi=(e)=>{let t={regions:e.regions.map((o)=>({id:o.regionId,bounds:o.bounds,edge:o.edge})),connections:e.connections.map((o)=>("type"in o)?{type:"differential",connections:o.connections.map(Pxn)}:Pxn(o)),buses:e.buses.map((o)=>({id:o.busId,connectionIds:o.connectionIds,preferredLayers:o.targetLayers})),boundaryPointSpacing:e.boundaryPointSpacing},n=new bdi(t);return n.solve(),n.getOutput()},Exn=(e)=>{let t=e.outline?Ms(e.outline):null,n=e.width??(t?t.maxX-t.minX:void 0),o=e.height??(t?t.maxY-t.minY:void 0);if(n===void 0||o===void 0)return null;return{minX:e.center.x-n/2,maxX:e.center.x+n/2,minY:e.center.y-o/2,maxY:e.center.y+o/2}},Mxn=(e,t,n,o)=>Math.max(e-o,n-t,0),vdi=(e)=>{if(e.root?.pcbDisabled||!e.pcb_group_id)return;let t=e.root;if(!t)return;let n=e.parent?.children.filter((a)=>a instanceof e.constructor);if(!n)return;let o=n.indexOf(e);if(o<0)return;let{db:r}=t,i=r.pcb_group.get(e.pcb_group_id);if(!i)return;let s=Exn(i);if(!s)return;for(let a of n.slice(o+1)){if(!a.pcb_group_id)continue;let c=r.pcb_group.get(a.pcb_group_id);if(!c)continue;let l=Exn(c);if(!l)continue;let h=e._parsedProps.fanoutMargin,d=a._parsedProps.fanoutMargin,u=Math.max(typeof h==="number"?h:0,typeof d==="number"?d:0),_=Mxn(s.minX,s.maxX,l.minX,l.maxX),p=Mxn(s.minY,s.maxY,l.minY,l.maxY),m=Math.min(s.maxX,l.maxX)-Math.max(s.minX,l.minX),A=Math.min(s.maxY,l.maxY)-Math.max(s.minY,l.minY),g=m>0&&A>0,f=u>0&&_<u&&p<u;if(!g&&!f)continue;let y=g?`Fanout boundaries "${e.name}" and "${a.name}" overlap. Fanout boundaries may not overlap.`:`Fanout boundaries "${e.name}" and "${a.name}" do not maintain the required ${u}mm fanoutMargin.`;if(r.pcb_placement_error.list().some((C)=>C.message===y))continue;r.pcb_placement_error.insert({error_type:"pcb_placement_error",message:y,subcircuit_id:e.subcircuit_id??void 0})}},Sdi=(e,t)=>{if(!(t instanceof kSn))return!1;if(!e.root||!e.pcb_group_id)return!1;let n=e.root.db.pcb_component.list().filter((o)=>o.pcb_group_id===e.pcb_group_id).map((o)=>o.source_component_id?e.root.db.source_component.get(o.source_component_id)?.name:void 0).filter((o)=>Boolean(o));return e.root.db.pcb_autorouting_error.insert({pcb_error_id:`pcb_autorouting_error_winding_breakout_${e.pcb_group_id}`,error_type:"pcb_autorouting_error",message:`Winding fanout failed for ${n.join(", ")||e.name}: ${t.message}. The connections could not escape to the breakout boundary. Give the fanout more room by increasing the breakout's padding, or by extending the breakout to include the parts crowding it (decoupling capacitors, series resistors).`}),!0};var Pdi=(e)=>{let t=e.parent;if(!t?.selectAll)throw Error(`Automatic breakout "${e.name}" has no coordinated routing scope`);return t},Edi=(e,t)=>{let n=[];for(let i of e.selectAll("group")){if(!i.isRoutingDirective||i.parent!==e)continue;let s=i;if(s.children.some((c)=>c instanceof Bde))n.push(s)}let o=(i)=>new Set(LSn(i).endpointBySourceTraceId.keys()),r=o(t);return n.filter((i)=>{let s=o(i);return s.size===r.size&&[...r].every((a)=>s.has(a))})},LSn=(e)=>{if(!e.root||!e.pcb_group_id)throw Error(`Automatic breakout "${e.name}" has no PCB region`);let t=e.root.db.pcb_group.get(e.pcb_group_id);if(!t||!t.width||!t.height)throw Error(`Automatic breakout "${e.name}" has invalid PCB region bounds`);let n={minX:t.center.x-t.width/2,maxX:t.center.x+t.width/2,minY:t.center.y-t.height/2,maxY:t.center.y+t.height/2},o={x:(n.minX+n.maxX)/2,y:(n.minY+n.maxY)/2},r=new Map,i=new Map;for(let s of e.children.filter((a)=>a instanceof Bde)){let a=s.matchedPort;if(!a?.pcb_port_id||!a.source_port_id)throw Error(`Automatic breakout "${e.name}" is missing a PCB endpoint`);let c=s.matchedSourceTraceId;if(!c){let h=e.root.db.source_trace.list().filter((_)=>_.connected_source_port_ids.includes(a.source_port_id));if(h.length===0)throw Error(`Automatic breakout "${e.name}" has a point without a source trace identity`);let d=h.filter((_)=>_.connected_source_port_ids.some((p)=>{if(p===a.source_port_id)return!1;let m=e.root.db.pcb_port.getWhere({source_port_id:p});if(!m||m.pcb_group_id===e.pcb_group_id)return!1;return!(m.x>=n.minX&&m.x<=n.maxX&&m.y>=n.minY&&m.y<=n.maxY)}));c=(d.length>0?d:h).slice().sort((_,p)=>_.source_trace_id.localeCompare(p.source_trace_id))[0].source_trace_id,s.matchedSourceTraceId=c}if(r.has(c))throw Error(`Connection "${c}" has duplicate endpoint for region "${e.pcb_group_id}"`);let l=e.root.db.pcb_port.get(a.pcb_port_id);if(!l)throw Error(`Connection "${c}" references unknown PCB endpoint "${a.pcb_port_id}"`);if(l.pcb_group_id!==e.pcb_group_id)throw Error(`Connection "${c}" endpoint references unknown region "${l.pcb_group_id??"unassigned"}" instead of "${e.pcb_group_id}"`);if(l.x===void 0||l.y===void 0)throw Error(`Connection "${c}" is missing endpoint coordinates for region "${e.pcb_group_id}"`);r.set(c,{regionId:e.pcb_group_id,position:{x:l.x,y:l.y}}),i.set(c,a.source_port_id)}return{breakout:e,pcbGroupId:e.pcb_group_id,bounds:n,center:o,endpointBySourceTraceId:r,sourcePortIdBySourceTraceId:i}},Mdi=(e)=>{let t=e.map((s)=>s.center.x),n=e.map((s)=>s.center.y),o=Math.max(...t)-Math.min(...t),r=Math.max(...n)-Math.min(...n),i=o>=r;return e.sort((s,a)=>{if(i){let c=s.center.x-a.center.x;if(c!==0)return c;let l=s.center.y-a.center.y;if(l!==0)return l}else{let c=s.center.y-a.center.y;if(c!==0)return c;let l=s.center.x-a.center.x;if(l!==0)return l}return s.breakout.name.localeCompare(a.breakout.name)}),{regions:e,horizontalPlacement:i}},wdi=({region:e,regionIndex:t,regions:n,horizontalPlacement:o,singleRegionPreferredEdge:r})=>{if(n.length===1&&r)return r;let i=n.filter((a)=>a!==e),s=i.reduce((a,c)=>({x:a.x+c.center.x/i.length,y:a.y+c.center.y/i.length}),{x:0,y:0});if(o){if(s.x>e.center.x)return"right";if(s.x<e.center.x)return"left";if(t<n.length/2)return"right";return"left"}if(s.y>e.center.y)return"top";if(s.y<e.center.y)return"bottom";if(t<n.length/2)return"top";return"bottom"},Bdi=({region:e,sourceTraces:t})=>{let n=e.breakout.root;if(!n)return;let o=new Set(e.sourcePortIdBySourceTraceId.values()),r=new Map;for(let a of t){if(!a.connected_source_port_ids.some((c)=>o.has(c)))continue;for(let c of a.connected_source_port_ids){if(o.has(c))continue;let l=n.db.pcb_port.getWhere({source_port_id:c});if(!l?.pcb_port_id||l.x===void 0||l.y===void 0)continue;if(l.x>=e.bounds.minX&&l.x<=e.bounds.maxX&&l.y>=e.bounds.minY&&l.y<=e.bounds.maxY)continue;r.set(l.pcb_port_id,{x:l.x,y:l.y})}}if(r.size===0)return;let i=(a,c)=>{let l=c==="left"||c==="right"?{x:c==="left"?e.bounds.minX:e.bounds.maxX,y:Math.max(e.bounds.minY,Math.min(e.bounds.maxY,a.y))}:{x:Math.max(e.bounds.minX,Math.min(e.bounds.maxX,a.x)),y:c==="bottom"?e.bounds.minY:e.bounds.maxY};return Math.hypot(a.x-l.x,a.y-l.y)},s=["right","left","top","bottom"];return s.reduce((a,c)=>{let l=[...r.values()].reduce((d,u)=>d+i(u,a),0);return[...r.values()].reduce((d,u)=>d+i(u,c),0)<l?c:a},s[0])},cit=({connectionOwner:e,connectionOwnerLabel:t,connectionSelector:n,sourceTraces:o})=>{let i=o.filter((s)=>s.name===n);if(i.length===0){let s=e.getSubcircuit().selectOne(n,{type:"port"});if(s?.source_port_id)i=o.filter((a)=>a.connected_source_port_ids.includes(s.source_port_id))}if(i.length===0)throw Error(`Could not resolve "${n}" in ${t}`);if(i.length>1)throw Error(`Connection "${n}" resolves to multiple source traces in ${t}`);return i[0]},Tdi=({routingScope:e,sourceTraces:t,coordinatedSourceTraceIds:n,availableLayers:o})=>{let r=[],i=e.getSubcircuit().subcircuit_id;for(let s of e.selectAll("bus")){if(s.getSubcircuit().subcircuit_id!==i)continue;let a=[];for(let l of s._parsedProps.connections){let h=cit({connectionOwner:s,connectionOwnerLabel:`bus "${s.name}"`,connectionSelector:l,sourceTraces:t});if(n.has(h.source_trace_id))a.push(h.source_trace_id)}if(a.length===0)continue;let c={busId:s.name,connectionIds:a};if(s._parsedProps.preferredLayer!==void 0)c={...c,targetLayers:[s._parsedProps.preferredLayer]};else if(s._parsedProps.preferredLayers!==void 0)c={...c,targetLayers:s._parsedProps.preferredLayers};else{let l=s._parsedProps.pcbAllowedLayers??o;c={...c,targetLayers:[...new Set(l)]}}r.push(c)}return r},Ddi=({routingScope:e,sourceTraces:t})=>{let n=e.getSubcircuit().subcircuit_id,o=[];for(let r of e.selectAll("differentialpair")){if(r.getSubcircuit().subcircuit_id!==n)continue;let i=cit({connectionOwner:r,connectionOwnerLabel:`differential pair "${r.name}"`,connectionSelector:r._parsedProps.positiveConnection,sourceTraces:t}),s=cit({connectionOwner:r,connectionOwnerLabel:`differential pair "${r.name}"`,connectionSelector:r._parsedProps.negativeConnection,sourceTraces:t});o.push({differentialPair:r,positiveSourceTraceId:i.source_trace_id,negativeSourceTraceId:s.source_trace_id})}return o},Ndi=(e)=>{let t=e.root?.db.pcb_board.list()[0],n=t?.min_trace_width??0.15,o=t?.min_trace_to_pad_edge_clearance??0.2,r=t?.min_via_pad_diameter??0.3;return v3n({traceWidth:n,traceToPadClearance:o,viaPadDiameter:r})},Rdi=({routingScope:e,automaticBreakouts:t})=>{let n=bit(e._getSubcircuitLayerCount());for(let o of t){let r=o._parsedProps.fanoutRoutingLayers?.map(String);if(!r)continue;let i=new Set(r);n=n.filter((s)=>i.has(s))}if(n.length===0)throw Error(`Automatic breakouts in routing scope "${e.name}" have no shared fanout routing layer`);return n},Qdi=(e)=>{if(!e.root)throw Error(`Automatic breakout "${e.name}" has no circuit root`);let t=Pdi(e),n=Edi(t,e),o=new Set,r=n.map((y)=>{let x=LSn(y);if(o.has(x.pcbGroupId))throw Error(`Duplicate automatic breakout region "${x.pcbGroupId}"`);return o.add(x.pcbGroupId),x}),{regions:i,horizontalPlacement:s}=Mdi(r),a=new Set;for(let y of i)for(let x of y.endpointBySourceTraceId.keys())a.add(x);let c=e.root.db.source_trace.list().filter((y)=>y.subcircuit_id===t.getSubcircuit().subcircuit_id),l=new Map;for(let y of c){if(l.has(y.source_trace_id))throw Error(`Duplicate connection identity "${y.source_trace_id}"`);l.set(y.source_trace_id,y)}let h=[...a].sort((y,x)=>{let C=l.get(y)?.name??y,b=l.get(x)?.name??x,I=C.localeCompare(b);if(I!==0)return I;return y.localeCompare(x)});for(let y of h){if(!l.has(y))throw Error(`Unknown connection identity "${y}"`);for(let x of i)if(!x.endpointBySourceTraceId.has(y))throw Error(`Connection "${y}" is missing endpoint for region "${x.pcbGroupId}"`)}let d=Tdi({routingScope:t,sourceTraces:c,coordinatedSourceTraceIds:a,availableLayers:Rdi({routingScope:t,automaticBreakouts:n})}),u=new Map;for(let y of h)u.set(y,i.map((x)=>x.endpointBySourceTraceId.get(y)));let _=new Map;for(let y of Ddi({routingScope:t,sourceTraces:c})){let x=a.has(y.positiveSourceTraceId),C=a.has(y.negativeSourceTraceId);if(x!==C)throw Error(`Differential pair "${y.differentialPair.name}" is missing one coordinated member`);if(!x)continue;if(_.has(y.positiveSourceTraceId)||_.has(y.negativeSourceTraceId))throw Error("A connection belongs to multiple differential pairs");_.set(y.positiveSourceTraceId,y),_.set(y.negativeSourceTraceId,y)}let p=[],m=new Set;for(let y of h){let x=_.get(y);if(!x){p.push({connectionId:y,endpoints:u.get(y)});continue}if(m.has(x.differentialPair))continue;m.add(x.differentialPair),p.push({type:"differential",connections:[{connectionId:x.positiveSourceTraceId,endpoints:u.get(x.positiveSourceTraceId)},{connectionId:x.negativeSourceTraceId,endpoints:u.get(x.negativeSourceTraceId)}]})}let A=new Map,g=i.length===1?Bdi({region:i[0],sourceTraces:c}):void 0;return{input:{regions:i.map((y,x)=>(A.set(y.pcbGroupId,y.sourcePortIdBySourceTraceId),{regionId:y.pcbGroupId,bounds:y.bounds,edge:wdi({region:y,regionIndex:x,regions:i,horizontalPlacement:s,singleRegionPreferredEdge:g})})),connections:p,buses:d,boundaryPointSpacing:Ndi(e)},sourcePortIdByConnectionIdByRegionId:A}},wxn=new WeakMap,kdi=(e,t)=>{let n=Qdi(e),o=t(n.input);if(o instanceof Promise)throw Error("Implicit breakout point solvers must return synchronously during PCB layout");let r=0;for(let a of n.input.connections){if("type"in a){r+=a.connections.length;continue}r+=1}let i=new Map,s=new Set;for(let a of n.input.regions)i.set(a.regionId,[]);for(let a of o.breakoutPoints){let c=i.get(a.regionId);if(!c)throw Error(`Implicit breakout point solver returned unknown region "${a.regionId}"`);let l=`${a.regionId}:${a.connectionId}`;if(s.has(l))throw Error(`Implicit breakout point solver returned duplicate endpoint for connection "${a.connectionId}" in region "${a.regionId}"`);s.add(l);let h=n.sourcePortIdByConnectionIdByRegionId.get(a.regionId)?.get(a.connectionId);if(!h)throw Error(`Implicit breakout point solver returned unknown connection "${a.connectionId}" for region "${a.regionId}"`);c.push({sourcePortId:h,sourceTraceId:a.connectionId,layer:a.layer,x:a.x,y:a.y})}for(let[a,c]of i)if(c.length!==r)throw Error(`Implicit breakout point solver output is missing endpoints for region "${a}"`);return{breakoutPointsByRegionId:i}},Ldi=(e,t)=>{let n=e.parent;if(!n||!e.pcb_group_id)throw Error(`Automatic breakout "${e.name}" has no coordinated PCB region`);let o=wxn.get(n);if(!o||o.solverFn!==t)o={solverFn:t,solutions:[]},wxn.set(n,o);let r=o.solutions.find((s)=>s.breakoutPointsByRegionId.has(e.pcb_group_id));if(!r)r=kdi(e,t),o.solutions.push(r);let i=r.breakoutPointsByRegionId.get(e.pcb_group_id);if(!i)throw Error(`Automatic breakout "${e.name}" references unknown implicit-breakout region "${e.pcb_group_id}"`);return i},lit=class extends tP{get isDogboneFanout(){let e=this._parsedProps.autorouter;return(typeof e==="string"?e:e?.preset)==="dogbone"}get isRoutingDirective(){return!0}get config(){return{...super.config,zodProps:TTt}}doInitialCreateAutoplacedBreakoutPoints(){for(let s of this._parsedProps.pcbTracePaths??[]){let a=s.route.at(-1),c=new eSn({connection:s.connection,pcbX:a.x,pcbY:a.y});if(c.exitLayer=a.route_type==="wire"?a.layer:a.to_layer,this.add(c),c._matchConnection(),!c.matchedPort||!this.selectAll("port").includes(c.matchedPort))throw Error(`Fanout trace path "${s.connection}" must select a port inside the fanout`);if(this.children.some((h)=>{if(!(h instanceof kY)||h===c)return!1;return h._matchConnection(),h.matchedPort===c.matchedPort}))throw Error(`Duplicate fanout exit for "${s.connection}"`)}let e=this.selectAll("port"),t=new Set(e),n=this.children.filter((s)=>s instanceof kY),o=new Set(n.map((s)=>(s._matchConnection(),s.matchedPort)).filter(Boolean)),r=this.getSubcircuit().selectAll("trace"),i=new Set;for(let s of r){let a=s._findConnectedPorts();if(!a.allPortsFound||!a.ports)continue;for(let c of a.ports){let l=t.has(c),h=a.ports.some((u)=>!t.has(u));if(!l||!h&&!this.isDogboneFanout)continue;if(o.has(c))continue;if(i.has(c))continue;i.add(c);let d=new Bde({});d.matchedPort=c,d.matchedSourceTraceId=s.source_trace_id,this.add(d)}}}doInitialPcbAutoplaceBreakoutPoints(){if(this.root?.pcbDisabled)return;if(this.isDogboneFanout&&this._parsedProps.pcbTracePaths===void 0){for(let l of this.children){if(!(l instanceof Bde))continue;let h=this.root.db.pcb_port.get(l.matchedPort.pcb_port_id);l._applySolvedBreakoutPoint({sourceTraceId:l.matchedSourceTraceId,layer:h.layers[0],position:h})}return}let e=this.props.autorouter,t=e===void 0?this.parent?.getInheritedProperty("autorouter"):void 0,n=typeof e==="object"?e.implicitBreakoutPointSolverFn:typeof t==="object"?t.implicitBreakoutPointSolverFn:void 0,o=this.children.filter((l)=>l instanceof Bde);if(o.length===0)return;if(!this.root||!this.pcb_group_id)return;let r=this.root.db.pcb_group.get(this.pcb_group_id);if(!r?.width||!r.height)return;let i={minX:r.center.x-r.width/2,maxX:r.center.x+r.width/2,minY:r.center.y-r.height/2,maxY:r.center.y+r.height/2},s;try{s=Ldi(this,n??Idi)}catch(l){if(n||!Sdi(this,l))throw l;return}let a=0.0001,c=(l,h)=>({x:Math.max(i.minX+a,Math.min(i.maxX-a,l)),y:Math.max(i.minY+a,Math.min(i.maxY-a,h))});for(let l of s){let h=o.find((d)=>d.matchedPort?.source_port_id===l.sourcePortId);if(h){let d=c(l.x,l.y);h._applySolvedBreakoutPoint({sourceTraceId:l.sourceTraceId,layer:l.layer,position:d})}}}doInitialPcbPrimitiveRender(){super.doInitialPcbPrimitiveRender()}doInitialPcbPlacementDesignRuleChecks(){vdi(this)}},Hdi=class extends nr{pcb_silkscreen_graphic_id=null;pcb_silkscreen_graphic_ids=[];pcb_silkscreen_path_ids=[];isPcbPrimitive=!0;get config(){return{componentName:"SilkscreenGraphic",zodProps:bNt}}doInitialPcbPrimitiveRender(){if(this.root?.pcbDisabled)return;this._queueAsyncEffect("SilkscreenGraphicRender",async()=>{if(this.root?.pcbDisabled)return;let{db:e}=this.root,{_parsedProps:t}=this,{maybeFlipLayer:n}=this._getPcbPrimitiveFlippedHelpers(),o=n(t.layer??"top");if(o!=="top"&&o!=="bottom")throw Error(`Invalid layer "${o}" for SilkscreenGraphic. Must be "top" or "bottom".`);let r=await uIe(t.imageUrl);if(r.mimetype!==g9&&r.mimetype!==get)throw Error(`Unsupported imageUrl for SilkscreenGraphic: "${t.imageUrl}". Expected an SVG or PNG image.`);let i={project_relative_path:r.projectRelativePath,url:r.dataUrl,mimetype:r.mimetype},s=r.mimetype===g9?Bun({svg:r.text,width:t.width,height:t.height,transform:this._computePcbGlobalTransformBeforeLayout()}):[this.getPlacementBoxBRepShape()],a=this.parent?.pcb_component_id??this.getPrimitiveContainer()?.pcb_component_id??"";for(let c of s){let l=e.insert({type:"pcb_silkscreen_graphic",pcb_component_id:a,pcb_group_id:this.getGroup()?.pcb_group_id??void 0,subcircuit_id:this.getSubcircuit()?.subcircuit_id??void 0,layer:o,shape:"brep",brep_shape:c,image_asset:i});this.pcb_silkscreen_graphic_ids.push(l.pcb_silkscreen_graphic_id)}if(this.pcb_silkscreen_graphic_id=this.pcb_silkscreen_graphic_ids[0]??null,r.mimetype===g9)this.insertRenderableSilkscreenPaths(r.text,o)})}insertRenderableSilkscreenPaths(e,t){let{db:n}=this.root,{_parsedProps:o}=this,r=this._computePcbGlobalTransformBeforeLayout(),i=this.parent?.pcb_component_id??this.getPrimitiveContainer()?.pcb_component_id??"";for(let s of Aet({svg:e,width:o.width,height:o.height,transform:r})){if(s.length<2)continue;let a=n.pcb_silkscreen_path.insert({pcb_component_id:i,layer:t,route:s,stroke_width:Math.max(Math.min(o.width,o.height)/60,0.05),subcircuit_id:this.getSubcircuit()?.subcircuit_id??void 0,pcb_group_id:this.getGroup()?.pcb_group_id??void 0});this.pcb_silkscreen_path_ids.push(a.pcb_silkscreen_path_id)}}getPcbSize(){let{_parsedProps:e}=this;return{width:e.width,height:e.height}}getPlacementBoxBRepShape(){let{_parsedProps:e}=this,t=e.width/2,n=e.height/2,o=this._computePcbGlobalTransformBeforeLayout();return{outer_ring:{vertices:fet([{x:-t,y:n},{x:t,y:n},{x:t,y:-n},{x:-t,y:-n}]).map((r)=>HSn.applyToPoint(o,r))},inner_rings:[]}}_moveCircuitJsonElements({deltaX:e,deltaY:t}){if(this.root?.pcbDisabled)return;let{db:n}=this.root,o=(r)=>({...r,x:r.x+e,y:r.y+t});for(let r of this.pcb_silkscreen_graphic_ids){let i=n.pcb_silkscreen_graphic.get(r);if(!i)continue;n.pcb_silkscreen_graphic.update(r,{brep_shape:{outer_ring:{vertices:i.brep_shape.outer_ring.vertices.map(o)},inner_rings:i.brep_shape.inner_rings.map((s)=>({vertices:s.vertices.map(o)}))}})}for(let r of this.pcb_silkscreen_path_ids){let i=n.pcb_silkscreen_path.get(r);if(!i)continue;n.pcb_silkscreen_path.update(r,{route:i.route.map((s)=>({...s,x:s.x+e,y:s.y+t}))})}}},Fdi=class extends nr{pcb_smtpad_id=null;isPcbPrimitive=!0;get config(){return{componentName:"Fiducial",zodProps:m5e,sourceFtype:"simple_fiducial"}}doInitialPcbPrimitiveRender(){if(this.root?.pcbDisabled)return;let{db:e}=this.root,{_parsedProps:t}=this,n=this._getGlobalPcbPositionBeforeLayout(),{maybeFlipLayer:o}=this._getPcbPrimitiveFlippedHelpers(),r=this.parent?.pcb_component_id??this.getPrimitiveContainer()?.pcb_component_id,i=e.pcb_smtpad.insert({pcb_component_id:r,layer:o(t.layer||"top"),shape:"circle",x:n.x,y:n.y,radius:Ke.parse(t.padDiameter)/2,soldermask_margin:t.soldermaskPullback?Ke.parse(t.soldermaskPullback):Ke.parse(t.padDiameter)/2,is_covered_with_solder_mask:!0});this.pcb_smtpad_id=i.pcb_smtpad_id}getPcbSize(){let{_parsedProps:e}=this,t=Ke.parse(e.padDiameter);return{width:t,height:t}}_setPositionFromLayout(e){if(!this.pcb_smtpad_id)return;let{db:t}=this.root;t.pcb_smtpad.update(this.pcb_smtpad_id,{x:e.x,y:e.y})}_moveCircuitJsonElements({deltaX:e,deltaY:t}){if(this.root?.pcbDisabled)return;let{db:n}=this.root;if(!this.pcb_smtpad_id)return;let o=n.pcb_smtpad.get(this.pcb_smtpad_id);if(!o)return;if(o.shape==="rect"||o.shape==="circle"||o.shape==="rotated_rect"||o.shape==="pill")this._setPositionFromLayout({x:o.x+e,y:o.y+t});else if(o.shape==="polygon")n.pcb_smtpad.update(this.pcb_smtpad_id,{points:o.points.map((r)=>({x:r.x+e,y:r.y+t}))})}},XJ=0.000000001,Bxn=(e)=>e.route_type==="wire",zdi=(e,t,n)=>{let o=(e.y-t.y)*(n.x-t.x)-(e.x-t.x)*(n.y-t.y);if(Math.abs(o)>XJ)return!1;let r=(e.x-t.x)*(n.x-t.x)+(e.y-t.y)*(n.y-t.y);if(r<-XJ)return!1;let i=(n.x-t.x)**2+(n.y-t.y)**2;if(r-i>XJ)return!1;return!0},Txn=(e,t)=>{if(t.length<3)return!1;let n=!1,o=t[t.length-1];for(let r of t){if(zdi(e,o,r))return!0;if(r.y>e.y!==o.y>e.y&&e.x<(o.x-r.x)*(e.y-r.y)/(o.y-r.y)+r.x)n=!n;o=r}return n},Odi=(e,t)=>{let{center:n,width:o,height:r}=t,i=(t.rotation??0)*Math.PI/180,s=Math.cos(-i),a=Math.sin(-i),c=e.x-n.x,l=e.y-n.y,h=c*s-l*a,d=c*a+l*s;return Math.abs(h)<=o/2+XJ&&Math.abs(d)<=r/2+XJ},Vdi=(e,t)=>{let n=t.brep_shape.outer_ring.vertices.map((o)=>({x:o.x,y:o.y}));if(!Txn(e,n))return!1;for(let o of t.brep_shape.inner_rings){let r=o.vertices.map((i)=>({x:i.x,y:i.y}));if(Txn(e,r))return!1}return!0},Ydi=(e,t)=>{if(t.shape==="rect")return Odi(e,t);if(t.shape==="brep")return Vdi(e,t);return!1},Gdi=(e,t,n)=>{if(e.source_trace_id===t)return!0;if(!e.source_trace_id)return!1;let o=n.get(e.source_trace_id);if(!o)return!1;return o.connected_source_net_ids.includes(t)},Udi=(e,t,n)=>{let o=t.x-e.x,r=t.y-e.y;if(Math.hypot(o,r)<=XJ)return!1;return[0,0.25,0.5,0.75,1].every((a)=>Ydi({x:e.x+o*a,y:e.y+r*a},n))},Wdi=({db:e,copperPour:t})=>{if(!t.source_net_id)return;let n=new Map(e.source_trace.list().map((o)=>[o.source_trace_id,o]));for(let o of e.pcb_trace.list()){if(!Gdi(o,t.source_net_id,n))continue;let r=!1,i=o.route.map((s)=>({...s}));for(let s=0;s<i.length-1;s++){let a=i[s],c=i[s+1];if(!a||!c)continue;if(!Bxn(a)||!Bxn(c))continue;if(a.layer!==t.layer||c.layer!==t.layer)continue;if(Udi({x:a.x,y:a.y},{x:c.x,y:c.y},t))a.is_inside_copper_pour=!0,a.copper_pour_id=t.pcb_copper_pour_id,c.is_inside_copper_pour=!0,c.copper_pour_id=t.pcb_copper_pour_id,r=!0}if(r)e.pcb_trace.update(o.pcb_trace_id,{route:i})}},Xnt=new WeakMap,Xdi=0.3,jdi=async(e)=>{if(!e.root)return;let{db:t}=e.root,n=e.selectAll("copperpour").filter((d)=>d.getSubcircuit()===e),o=[];for(let d of n){let{_parsedProps:u}=d,p=e.selectOne(u.connectsTo)?.source_net_id;if(!p){d.renderError(`Net "${u.connectsTo}" not found for copper pour`);continue}o.push({copperPour:d,sourceNetId:p})}if(o.length===0)return;let r=t.toArray(),i=e._getBoard(),s=i?.pcb_board_id?t.pcb_board.get(i.pcb_board_id):void 0,a=s?.outline?.length?s.outline:void 0;if(!a&&s?.width!==void 0&&s.height!==void 0){let{center:d,width:u,height:_}=s;a=[{x:d.x-u/2,y:d.y-_/2},{x:d.x+u/2,y:d.y-_/2},{x:d.x+u/2,y:d.y+_/2},{x:d.x-u/2,y:d.y+_/2}]}let c=BZe(r,o.map(({copperPour:d,sourceNetId:u})=>{let{_parsedProps:_}=d,p=_.clearance??0.2;return{layer:_.layer,crosshatch:_.crosshatch,crosshatchPitch:_.crosshatchPitch,crosshatchWidth:_.crosshatchWidth,subcircuit_id:e.subcircuit_id??void 0,source_net_id:u,pad_margin:_.padMargin??p,trace_margin:_.traceMargin??p,pour_margin:p,board_edge_margin:_.boardEdgeMargin??p,board_edge_outline:d._isImplicitCopperPour?a:void 0,cutout_margin:_.cutoutMargin??p,..._.useThermalReliefs?{use_thermal_reliefs:!0,thermal_relief_spoke_width:Xdi}:{},outline:_.outline??a}}));await ahn();let l=new w6e(c);e.root.emit("solver:started",{type:"solver:started",solverName:"CopperPourPipelineSolver",solverParams:c,solverConstructorArgs:[c],componentName:e.getString()});let{brep_shapes_by_region:h}=l.getOutput();for(let[d,{copperPour:u,sourceNetId:_}]of o.entries()){let{_parsedProps:p}=u,m=p.coveredWithSolderMask??!1;for(let A of h[d]??[]){let g=t.pcb_copper_pour.insert({shape:"brep",layer:p.layer,brep_shape:A,source_net_id:_,subcircuit_id:e.subcircuit_id??void 0,covered_with_solder_mask:m});Wdi({db:t,copperPour:g})}}};function Kdi(e){if(e.root?.pcbDisabled)return;e._queueAsyncEffect("PcbCopperPourRender",async()=>{let t=e.getSubcircuit(),n=Xnt.get(t);if(n){await n;return}let o=jdi(t);Xnt.set(t,o);try{await o}finally{Xnt.delete(t)}})}var $di=(e)=>{let t=e.getSubcircuit();if(!t.root)return;let n=t.selectAll("copperpour").filter((u)=>u.getSubcircuit()===t);if(n[0]!==e)return;let o=n.flatMap((u)=>{let _=t.selectOne(u._parsedProps.connectsTo);return _?.source_net_id?[_.source_net_id]:[]});if(o.length===0)return;let{db:r}=t.root,i=e.getInheritedMergedProperty("pcbStyle"),{holeDiameter:s,padDiameter:a}=gB(i),c=e._getBoard(),l=c?.pcb_board_id?r.pcb_board.get(c.pcb_board_id):void 0,h={circuitJson:r.toArray(),options:{sourceNetIds:[...new Set(o)],viaHoleDiameter:l?.min_via_hole_diameter??s,viaOuterDiameter:l?.min_via_pad_diameter??a,viaStitchPitch:c?._parsedProps.viaStitchPitch}},d=new f7n(h);if(t.root.emit("solver:started",{type:"solver:started",solverName:"ViaStitchSolver",solverParams:h,solverConstructorArgs:[h],componentName:t.getString()}),d.solve(),d.failed)throw Error(d.error??"Via stitching solver failed");for(let u of d.getOutput().pcbVias){let{pcb_via_id:_,...p}=vN.parse(u),m=r.pcb_via.insert({...p,tented_on_top:void 0,tented_on_bottom:void 0});c?._generatedStitchingViaIds?.add(m.pcb_via_id)}};function qdi(e){if(e.root?.pcbDisabled||!e.root?._featurePcbViaStitching)return;if(!e._getBoard()?._parsedProps.enableViaStitching)return;e._queueAsyncEffect("PcbViaStitchRender",async()=>{$di(e)})}var Jdi=class extends nr{isPcbPrimitive=!0;_isImplicitCopperPour=!1;get config(){return{componentName:"CopperPour",zodProps:XDt}}getPcbSize(){return{width:0,height:0}}doInitialCreateNetsFromProps(){let{_parsedProps:e}=this;Cue(this,[e.connectsTo])}doInitialPcbCopperPourRender(){Kdi(this)}doInitialPcbViaStitchRender(){qdi(this)}},LZ=(e)=>{if(e.model!==void 0){if(/^https?:\/\//i.test(e.model))return Pot(e.model);return{glbUrl:`https://modelcdn.tscircuit.com/jscad_models/${encodeURIComponent(e.model)}.glb`}}if(e.modelUrl!==void 0)return Pot(e.modelUrl);return},FSn=class extends nr{isAssemblyDeviceContainer=!0;get config(){return{componentName:"AssemblyDevice",zodProps:lTt}}doInitialAssignNameToUnnamedComponents(){}computeSchematicGlobalTransform(){return hit.identity()}_computePcbGlobalTransformBeforeLayout(){return hit.identity()}doInitialSourceRender(){if(this._parsedProps.modelUrl===void 0&&this._parsedProps.model===void 0||!this.root)return;this.source_component_id=this.root.db.source_component.insert({ftype:"subassembly",name:this.name}).source_component_id}doInitialCadModelRender(){let e=LZ(this._parsedProps);if(!this.root||this.root.pcbDisabled||!this.source_component_id||!e)return;this.cad_component_id=fB(this,e,{position:{x:0,y:0,z:0},pcbRotation:0,layer:"top"})}},Zdi=(e)=>{let t=e._parsedProps.mountRotationAnchor??"rightedge",n=e._computePcbGlobalTransformBeforeLayout();switch(t){case"rightedge":return[n.a,n.b,0];case"leftedge":return[-n.a,-n.b,0];case"topedge":return[n.c,n.d,0];case"bottomedge":return[-n.c,-n.d,0]}let o=e.getDescendants().filter((l)=>Sue(l,t));if(o.length!==1)throw Error(`board "${e.name}" mountRotationAnchor "${t}" matched ${o.length} components; expected exactly one on this board`);let r=o[0],i=r.pcb_component_id&&e.root.db.pcb_component.get(r.pcb_component_id);if(!i)throw Error(`board "${e.name}" mountRotationAnchor "${t}" has no PCB component geometry`);let s=e.root.db.pcb_board.get(e.pcb_board_id),a=i.center.x-s.center.x,c=i.center.y-s.center.y;if(Math.hypot(a,c)<0.000001)throw Error(`board "${e.name}" mountRotationAnchor "${t}" is on the mounting axis and has no direction`);return[a,c,0]},Ive=(e)=>e*Math.PI/180,jnt=(e)=>nu(e*180/Math.PI),eui=(e)=>{switch(e){case"x+":return{x:0,y:90,z:0};case"x-":return{x:0,y:270,z:0};case"y+":return{x:270,y:0,z:0};case"y-":return{x:90,y:0,z:0};default:return{x:0,y:0,z:0}}},zSn=(e,t)=>{let n=eui(e._parsedProps.shaftFacingDirection),o=ASn(e),r=o?._parsedProps.mountRotation;if(!o||!r)return n;let i=t.layer==="bottom",s=i?-1:1,a=Cm.mat4.create();Cm.mat4.rotateX(a,a,Ive(n.x)),Cm.mat4.rotateY(a,a,Ive(n.y+(i?180:0))),Cm.mat4.rotateZ(a,a,Ive(s*t.pcbRotation));let c=r.startsWith("calc(")?r.match(/^calc\(\s*(.*?)\s*(?:([+-])\s*((?:\d+(?:\.\d*)?|\.\d+))\s*(degcw|degccw))?\s*\)$/):[r,r],l=c[1],h=l.lastIndexOf("."),d=l.slice(0,h),u=l.slice(h+1);if(!Sue(e,d))throw Error(`board "${o.name}" mountRotation "${r}" must reference its mounted motor "${e.name}"`);let _=Object.entries(e.motorReferencePoints).find(([P])=>P===u)?.[1];if(!_)throw Error(`assembly.motor "${e.name}" has no ${u} reference`);if(Math.abs(_.direction.z)>0.000001)throw Error(`board "${o.name}" mountRotation "${r}" must reference a direction in the mounting face, e.g. "${d}.wireside"`);let p=Ive((c[2]==="-"?-1:1)*Number(c[3]??0)*(c[4]==="degccw"?-1:1)),m=Cm.vec3.normalize(Cm.vec3.create(),Zdi(o)),A=Cm.vec3.transformMat4(Cm.vec3.create(),[0,0,1],a),g=Cm.mat4.fromRotation(Cm.mat4.create(),-p,A),f=Cm.vec3.transformMat4(Cm.vec3.create(),m,g),y=Cm.vec3.transformMat4(Cm.vec3.create(),[_.direction.x,_.direction.y,_.direction.z],a),x=Math.atan2(Cm.vec3.dot(A,Cm.vec3.cross(Cm.vec3.create(),y,f)),Cm.vec3.dot(y,f));Cm.mat4.rotateZ(a,a,x);let C=Math.asin(Math.max(-1,Math.min(1,a[8]))),b=Math.abs(a[8])<0.999999,I=b?Math.atan2(-a[9],a[10]):Math.atan2(a[6],a[5]),v=b?Math.atan2(-a[4],a[0]):0;return{x:jnt(I),y:jnt(C)-(i?180:0),z:s*jnt(v)-t.pcbRotation}},OSn=(e)=>{let t=YQr(e);if(t)return t;let n=ASn(e),o=n?._parsedProps.mountOrientation,r=o?o==="bottom_layer_toward_mount_face"?"bottom":"top":e._parsedProps.shaftFacingDirection==="z-"?"bottom":"top";if(!n)return{position:{x:0,y:0,z:0},pcbRotation:0,layer:r};let i=n.root.db.pcb_board.get(n.pcb_board_id);if(!i)throw Error(`Mounted board "${n.name}" has no PCB geometry`);let s=r==="bottom"?-1:1,a=n._computePcbGlobalTransformBeforeLayout();return{position:{...i.center,z:s*(-e.motorReferencePoints.backface.position.z+(n._parsedProps.mountGap??0)+i.thickness/2)},pcbRotation:nu(Math.atan2(a.b,a.a)*180/Math.PI),layer:r,subcircuit_id:i.subcircuit_id}},VSn=(e)=>{if(!FY(e).some((d)=>d.componentName==="AssemblyMotor"&&d._parsedProps.mountedTo))return;let{transforms:t,roots:n,motorMountRoots:o,subcircuitId:r}=SY(e);if(!o.has(n.get(e)))return;let i=t.get(e),s=Math.asin(Math.max(-1,Math.min(1,i[8]))),a=Math.abs(i[8])<0.999999,c=a?Math.atan2(-i[9],i[10]):Math.atan2(i[6],i[5]),l=a?Math.atan2(-i[4],i[0]):0,h=(d)=>nu(d*180/Math.PI);return{position:{x:i[12],y:i[13],z:i[14]},rotation:{x:h(c),y:h(s),z:h(l)},subcircuit_id:r}},YSn=class extends nr{get config(){return{componentName:"AssemblyMotor",zodProps:pTt}}get motorModelString(){let e=this._parsedProps.model??this._parsedProps.standard,t=this._parsedProps.wireConnection;if(t===void 0)return e;return`${e}_${t}`}get motorModel(){let e=(()=>{try{return ymn(this.motorModelString)}catch(t){throw Error(`assembly.motor "${this.name}" requires a NEMA modelprinter model: ${t instanceof Error?t.message:t}`,{cause:t})}})();if(e.fn!=="nema")throw Error(`assembly.motor "${this.name}" requires a NEMA modelprinter model`);return e}get motorReferencePoints(){let{fn:e,...t}=this.motorModel;return XIe(t)}doInitialSourceRender(){this.motorModel,this.source_component_id=this.root.db.source_component.insert({ftype:"motor",name:this.name}).source_component_id}doInitialCadModelRender(){if(!this.root||this.root.pcbDisabled||!this.source_component_id)return;let e=LZ({model:this.motorModelString}),t=VSn(this);if(t){this.cad_component_id=fB(this,{...e,rotationOffset:t.rotation},{...t,pcbRotation:0,layer:"top"});return}let n=OSn(this);this.cad_component_id=fB(this,{...e,rotationOffset:zSn(this,n)},n)}},Dxn=(e)=>Number(e.toFixed(6)).toString(),tui=(e)=>{let{width:t,height:n}=e._parsedProps;if(t===void 0||n===void 0)throw Error(`assembly.screen "${e.name}" requires both width and height when cadModel is omitted`);return`flexscreen_w${Dxn(t)}mm_h${Dxn(n)}mm`},nui=(e)=>{if(!e.root||e.root.pcbDisabled||!e.source_component_id)return;let t=xZ(e);e.cad_component_id=fB(e,LZ(e._parsedProps)??e._parsedProps.cadModel??tui(e),t)},GSn=class extends nr{isAssemblyDeviceContainer=!0;get config(){return{componentName:"AssemblyScreen",zodProps:mTt}}doInitialAssignNameToUnnamedComponents(){if(this._parsedProps.name)return;throw Error("assembly.screen requires a non-empty name")}doInitialSourceRender(){let e=this.root.db.source_component.insert({ftype:"subassembly",name:this.name});this.source_component_id=e.source_component_id}doInitialCadModelRender(){nui(this)}},dit=class extends nr{isAssemblyDeviceContainer=!0;get config(){return{componentName:"AssemblySubassembly",zodProps:aTt}}doInitialAssignNameToUnnamedComponents(){if(this._parsedProps.name)return;throw Error("assembly.subassembly requires a non-empty name")}doInitialReactSubtreesRender(){if(USn.isValidElement(this.props.cadModel))this.add(Iue(this.props.cadModel))}doInitialSourceRender(){let e=this.root.db.source_component.insert({ftype:"subassembly",name:this.name});this.source_component_id=e.source_component_id}doInitialCadModelRender(){if(!this.root||this.root.pcbDisabled||!this.source_component_id)return;let e=xZ(this),t=LZ(this._parsedProps)??this._parsedProps.cadModel;if(t&&!(typeof t==="object"&&("type"in t)))this.cad_component_id=fB(this,t,e)}},XSn=(e)=>{let t=i7e(e);if(!t.length)return;let{transforms:n,subcircuitId:o}=SY(e),r=n.get(e),i=Wx.mat3.fromMat4(Wx.mat3.create(),r),s=(a)=>({x:a[0],y:a[1],z:a[2]});for(let a of t){let c=e.children.find((l)=>l.componentName==="AssemblyReferenceSurface"&&l.name===a.name);e.root.db.cad_reference_surface.insert({source_component_id:e.source_component_id,name:a.name,shape:"rect",center:s(Wx.vec3.transformMat4(Wx.vec3.create(),a.origin,r)),normal:s(Wx.vec3.normalize(Wx.vec3.create(),Wx.vec3.transformMat3(Wx.vec3.create(),a.normal,i))),x_axis:s(Wx.vec3.normalize(Wx.vec3.create(),Wx.vec3.transformMat3(Wx.vec3.create(),a.xAxis,i))),width:c?._parsedProps.width,height:c?._parsedProps.height,subcircuit_id:o})}},jSn=class extends nr{isAssemblyDeviceContainer=!0;get config(){return{componentName:"AssemblyPart",zodProps:XYe}}doInitialReactSubtreesRender(){if(WSn.isValidElement(this.props.cadModel))this.add(Iue(this.props.cadModel))}doInitialSourceRender(){i7e(this),this.source_component_id=this.root.db.source_component.insert({ftype:"subassembly",name:this.name,display_name:this._parsedProps.displayName}).source_component_id}doInitialCadModelRender(){if(!this.root||this.root.pcbDisabled||!this.source_component_id)return;XSn(this);let e=LZ(this._parsedProps)??this._parsedProps.cadModel;if(e&&!(typeof e==="object"&&("type"in e)))this.cad_component_id=fB(this,e,xZ(this))}},KSn=class extends nr{get config(){return{componentName:"AssemblyReferenceSurface",zodProps:hTt}}doInitialSourceRender(){if(this.parent?.componentName!=="AssemblyPart"&&this.parent?.componentName!=="AssemblyPrintedPart")throw Error(`Reference surface "${this.name}" must be a child of assembly.part or assembly.printedpart`)}get referenceFrame(){let{name:e,plane:t,normalDirection:n,centerXOffset:o,centerYOffset:r,centerZOffset:i}=this._parsedProps,s=n.endsWith("-")?-1:1;return{name:e,origin:[o,r,i],normal:t==="xy"?[0,0,s]:t==="xz"?[0,s,0]:[s,0,0],xAxis:t==="yz"?[0,1,0]:[1,0,0]}}},oui=({cad:e,authoredModel:t})=>{let n=e.model_bounds??t?.modelBounds,o=e.model_origin_position??t?.modelOriginPosition;if(!n?.min||!n?.max||!o)return;let r=e.model_board_normal_direction??t?.modelBoardNormalDirection??"z+",i=r[0];if(i!=="x"&&i!=="y"&&i!=="z")return;let s=n.min[i],a=n.max[i],c=o[i];if(s===void 0||a===void 0||c===void 0)return;let l=r.endsWith("-")?c-s:a-c;return Number.isFinite(l)&&l>=0?l:void 0},rui=({owner:e,pcbComponent:t,cadComponent:n,boardSurfaceZ:o})=>{let r=e?._parsedProps?.cadModel,i=r&&typeof r==="object"?r:void 0,s=n?.size??i?.size,a=s?.x,c=s?.y,l=s?.z,h=n?oui({cad:n,authoredModel:i}):void 0,d=n?.position?.z,u=h!==void 0&&d!==void 0?h+Math.abs(d-o):void 0;return{size:a!==void 0&&c!==void 0?{x:a,y:c,z:l}:void 0,aboveBoardHeight:u,rotation:n?.rotation?.z??t.rotation??0,footprint:{width:t.width,height:t.height}}},iui=({point:e,board:t})=>{let n=(t.width??0)/2,o=(t.height??0)/2,r=[["x_neg",Math.abs(e.x-(t.center.x-n))],["x_pos",Math.abs(e.x-(t.center.x+n))],["y_neg",Math.abs(e.y-(t.center.y-o))],["y_pos",Math.abs(e.y-(t.center.y+o))]];return r.sort((i,s)=>i[1]-s[1]),r[0][0]},sui=(e)=>e,aui={from_top:"y_pos",from_bottom:"y_neg",from_left:"x_neg",from_right:"x_pos"},cui=(e,{board:t,pcbBoard:n})=>{let o=e.parent;while(o&&o!==t&&!o.pcb_component_id)o=o.parent;let r=o?.pcb_component_id?e.root?.db.pcb_component.get(o.pcb_component_id):null;if(!r)throw Error("<enclosure.cutoutaperture /> must be nested inside a component with a PCB footprint");let i=e._parsedProps,a=o?._getEnclosureApertureAxisDirection?.(r.layer,r.rotation??0),c=a?a.z!==0?a.z>0?"from_above":"from_below":Math.abs(a.x)>=Math.abs(a.y)?a.x>=0?"from_right":"from_left":a.y>=0?"from_top":"from_bottom":r.insertion_direction,l=c==="from_above"?"z_pos":c==="from_below"?"z_neg":void 0,h=r.layer==="bottom"?"bottom":"top",d,u;if(l)d=l,u={x:r.center.x-n.center.x,y:r.center.y-n.center.y};else{let g=r.cable_insertion_center??r.center,f=aui[c]??iui({point:g,board:n}),y=r.cable_insertion_center?{x:r.cable_insertion_center.x-r.center.x,y:r.cable_insertion_center.y-r.center.y}:null,x=y!=null&&(f==="x_neg"||f==="x_pos"?Math.abs(y.x)>=Math.abs(y.y):Math.abs(y.y)>=Math.abs(y.x)),C=a?r.center:x?g:r.center;d=sui(f),u={x:C.x-n.center.x,y:C.y-n.center.y}}let _=e.root?.db.cad_component.getWhere({pcb_component_id:r.pcb_component_id})??null,p=(h==="bottom"?-1:1)*((n.thickness??t.boardThickness)/2),m=rui({owner:o,pcbComponent:r,cadComponent:_,boardSurfaceZ:p}),A={face:d,center:u,boardSide:h,apertureAxisDirection:a,rotation:r.rotation??void 0,depth:i.depth,componentBody:m,widthDimensionOffset:i.widthDimensionOffset,heightDimensionOffset:i.heightDimensionOffset,margin:i.margin};switch(i.shape){case"pill":case"rect":return{...A,shape:i.shape,width:i.width,height:i.height};case"circle":return{...A,shape:"circle",radius:i.radius}}},Fat=class extends nr{get config(){return{componentName:"EnclosureCutoutAperture",zodProps:gTt}}getFdmEnclosureSolverInput(e){return cui(this,e)}},$Sn=(e,t)=>{let n=e.root?.firstChild,o=n?SK(t,n,{adapter:yZ}):null,r=o instanceof P9?o:[n,...n?.getDescendants()??[]].find((i)=>i instanceof P9&&i.isMatchingNameOrAlias(t));if(!(r instanceof P9))throw Error(`Could not find a <board /> matching enclosure boardRef "${t}"`);return r},lui=(e)=>{let t=e.root;if(!t||t.pcbDisabled||!e.source_component_id||!e.pcb_component_id)return;let{db:n}=t,o=e._parsedProps,r=$Sn(e,o.boardRef),i=r.pcb_board_id?n.pcb_board.get(r.pcb_board_id):null;if(!i?.width||!i.height)throw Error(`Could not resolve dimensions for boardRef "${o.boardRef}"`);let s=i.thickness??r.boardThickness,a={board:{width:i.width,height:i.height,thickness:s},width:o.width,height:o.height,depth:o.depth,wallThickness:o.wallThickness,floorThickness:o.floorThickness,lidThickness:o.lidThickness,boardClearance:o.boardClearance,standoffHeight:o.standoffHeight,topHeadroom:o.topHeadroom,lidLipDepth:o.lidLipDepth,apertures:o.disableCutouts?[]:r.getDescendants().filter((_)=>_ instanceof Fat).map((_)=>_.getFdmEnclosureSolverInput({board:r,pcbBoard:i}))},c=new D6e(a),l=c.getConstructorParams();if(t.emit("solver:started",{type:"solver:started",solverName:"CreateFdmEnclosureSolver",solverParams:l[0],solverConstructorArgs:l,componentName:e.getString()}),c.solve(),c.failed)throw Error(c.error??"Failed to create FDM enclosure");let h=c.getOutput();n.pcb_component.update(e.pcb_component_id,{center:i.center,width:h.dimensions.width,height:h.dimensions.height});let d={x:i.center.x,y:i.center.y,z:-s/2-h.dimensions.floorThickness-h.dimensions.standoffHeight},u=h.parts.map((_)=>n.cad_component.insert({position:d,rotation:{x:0,y:0,z:0},pcb_component_id:e.pcb_component_id,source_component_id:e.source_component_id,model_jscad:_.jscadPlan,model_unit_to_mm_scale_factor:1,model_object_fit:"contain_within_bounds",model_origin_alignment:"bottom_center_of_component",anchor_alignment:"center",show_as_translucent_model:!1,show_hidden_edges:o.showHiddenEdges}));e.cad_component_id=u[0]?.cad_component_id??null},qSn=class e extends nr{get config(){return{componentName:"EnclosureFdmBox",zodProps:ATt}}doInitialAssignNameToUnnamedComponents(){if(this._parsedProps.name)return;let t=this;while(t.parent instanceof nr)t=t.parent;let o=[t,...t.getDescendants()].filter((r)=>r instanceof e).indexOf(this);this.fallbackUnassignedName=`unnamed_enclosure_fdm_box_${o===-1?0:o+1}`}doInitialSourceRender(){let t=this.root.db.source_component.insert({ftype:"simple_chip",name:this.name});this.source_component_id=t.source_component_id}doInitialPcbComponentRender(){let t=this.root;if(!t||t.pcbDisabled||!this.source_component_id)return;let n=$Sn(this,this._parsedProps.boardRef),r=(n.pcb_board_id?t.db.pcb_board.get(n.pcb_board_id):null)?.center??n._getGlobalPcbPositionBeforeLayout(),i=t.db.pcb_component.insert({center:r,width:0,height:0,layer:"top",rotation:0,source_component_id:this.source_component_id,obstructs_within_bounds:!1,do_not_place:!0,is_allowed_to_be_off_board:!0});this.pcb_component_id=i.pcb_component_id}doInitialCadModelRender(){lui(this)}},hui=class extends bl{get config(){return{componentName:"Battery",schematicSymbolName:this.props.symbolName??"battery",zodProps:hDt,sourceFtype:"simple_power_source"}}initPorts(){super.initPorts({additionalAliases:{pin1:["anode","pos","left"],pin2:["cathode","neg","right"]}})}doInitialSourceRender(){let{db:e}=this.root,{_parsedProps:t}=this,n=e.source_component.insert({name:this.name,ftype:"simple_power_source",capacity:t.capacity,supplier_part_numbers:t.supplierPartNumbers,manufacturer_part_number:ii(t),are_pins_interchangeable:!1,display_name:t.displayName});this.source_component_id=n.source_component_id}},dui=class extends bl{_getPcbRotationBeforeLayout(){let e=this.props.pcbOrientation==="vertical"?-90:0;return(super._getPcbRotationBeforeLayout()??0)+e}get config(){return{componentName:"PinHeader",zodProps:uDt,shouldRenderAsSchematicBox:!0}}_getImpliedFootprintString(){let e=this._parsedProps.pinCount??(Array.isArray(this._parsedProps.pinLabels)?this._parsedProps.pinLabels.length:this._parsedProps.pinLabels?Object.keys(this._parsedProps.pinLabels).length:0),t=this._parsedProps.holeDiameter,n=this._parsedProps.platedDiameter,o=this._parsedProps.pitch,r=this._parsedProps.showSilkscreenPinLabels,i=this._parsedProps.doubleRow?2:1,s=this._parsedProps.gender;if(e>0){let a;if(o)if(!t&&!n)a=`pinrow${e}_p${o}`;else a=`pinrow${e}_p${o}_id${t}_od${n}`;else if(!t&&!n)a=`pinrow${e}`;else return null;if(r!==!0)a+="_nopinlabels";if(s==="female")a+="_female";if(i>1)a+=`_rows${i}`;return a}return null}initPorts(){let e=this._parsedProps.pinCount??(Array.isArray(this._parsedProps.pinLabels)?this._parsedProps.pinLabels.length:this._parsedProps.pinLabels?Object.keys(this._parsedProps.pinLabels).length:1);for(let t=1;t<=e;t++){let n=Array.isArray(this._parsedProps.pinLabels)?this._parsedProps.pinLabels[t-1]:this._parsedProps.pinLabels?.[`pin${t}`];if(n){let o=Array.isArray(n)?n[0]:n,r=Array.isArray(n)?n.slice(1):[];this.add(new Lh({pinNumber:t,name:o,aliases:[`pin${t}`,...r]}))}else this.add(new Lh({pinNumber:t,name:`pin${t}`}))}}_getSchematicPortArrangement(){let e=this._parsedProps.pinCount??1,t=this._parsedProps.schFacingDirection??this._parsedProps.facingDirection??"right",n=this._parsedProps.schPinArrangement,o=Array.from({length:e},(r,i)=>`pin${i+1}`);if(t==="left")return{leftSide:{direction:n?.leftSide?.direction??"top-to-bottom",pins:n?.leftSide?.pins??o}};if(t==="up")return{topSide:{direction:n?.topSide?.direction??"left-to-right",pins:n?.topSide?.pins??o}};if(t==="down")return{bottomSide:{direction:n?.bottomSide?.direction??"left-to-right",pins:n?.bottomSide?.pins??o}};return{rightSide:{direction:n?.rightSide?.direction??"top-to-bottom",pins:n?.rightSide?.pins??o}}}doInitialSourceRender(){let{db:e}=this.root,{_parsedProps:t}=this,n=e.source_component.insert({ftype:"simple_pin_header",name:this.name,supplier_part_numbers:t.supplierPartNumbers,manufacturer_part_number:ii(t),pin_count:t.pinCount,gender:t.gender,are_pins_interchangeable:!0,display_name:t.displayName});this.source_component_id=n.source_component_id}};function uui(e){switch(e){case"two_ground_pins":return"crystal_4pin";case"ground_pin":return"resonator";case"no_ground":return"crystal";default:return"crystal"}}var pui=class extends bl{get config(){return{componentName:"Resonator",schematicSymbolName:this.props.symbolName??uui(this.props.pinVariant),zodProps:GTt,shouldRenderAsSchematicBox:!1}}doInitialSourceRender(){let{db:e}=this.root,{_parsedProps:t}=this,n=t.pinVariant||"no_ground",o=e.source_component.insert({ftype:"simple_resonator",name:this.name,manufacturer_part_number:ii(t),frequency:t.frequency,load_capacitance:t.loadCapacitance,supplier_part_numbers:t.supplierPartNumbers,pin_variant:n,are_pins_interchangeable:n==="no_ground"||n==="ground_pin",display_name:t.displayName});this.source_component_id=o.source_component_id}_getSchematicSymbolDisplayValue(){let e=`${qh(this._parsedProps.frequency)}Hz`;if(this._parsedProps.loadCapacitance)return`${e} / ${qh(this._parsedProps.loadCapacitance)}F`;return e}};function mui(e){switch(e){case"three_pin":return"potentiometer3";case"two_pin":return"potentiometer2";default:return"potentiometer2"}}var _ui=class extends bl{get config(){return{componentName:"Potentiometer",schematicSymbolName:this.props.symbolName??mui(this.props.pinVariant),zodProps:VTt,shouldRenderAsSchematicBox:!1}}_getSchematicSymbolDisplayValue(){return`${qh(this._parsedProps.maxResistance)}Ω`}doInitialSourceRender(){let{db:e}=this.root,{_parsedProps:t}=this,n=t.pinVariant||"two_pin",o=e.source_component.insert({ftype:"simple_potentiometer",name:this.name,manufacturer_part_number:ii(t),supplier_part_numbers:t.supplierPartNumbers,max_resistance:t.maxResistance,pin_variant:n,are_pins_interchangeable:n==="two_pin",display_name:t.displayName,display_max_resistance:this._getSchematicSymbolDisplayValue()});this.source_component_id=o.source_component_id}},gui=10,Nxn=0,Aui=class extends bl{get config(){return{schematicSymbolName:this.props.symbolName??(this.props.pinVariant==="four_pin"?"crystal_4pin":"crystal"),componentName:"Crystal",zodProps:YTt,sourceFtype:"simple_crystal"}}initPorts(){let e=this.props.pinVariant==="four_pin"?{pin1:["left1","1","X1"],pin2:["top1","2","gnd1"],pin3:["right1","3","X2"],pin4:["bottom1","4","gnd2"]}:{pin1:["pos","left","X1"],pin2:["neg","right","X2"]};super.initPorts({additionalAliases:e})}_getSchematicSymbolDisplayValue(){let e=`${qh(this._parsedProps.frequency)}Hz`;if(this._parsedProps.loadCapacitance)return`${e} / ${qh(this._parsedProps.loadCapacitance)}F`;return e}doInitialSourceRender(){let{db:e}=this.root,{_parsedProps:t}=this,n=e.source_component.insert({name:this.name,ftype:"simple_crystal",manufacturer_part_number:ii(t),supplier_part_numbers:t.supplierPartNumbers,frequency:t.frequency,load_capacitance:t.loadCapacitance,pin_variant:t.pinVariant||"two_pin",are_pins_interchangeable:(t.pinVariant||"two_pin")==="two_pin",display_name:t.displayName});this.source_component_id=n.source_component_id}doInitialSourceDesignRuleChecks(){if(super.doInitialSourceDesignRuleChecks(),!this.source_component_id)return;let{db:e}=this.root,t=this._parsedProps.maxTraceLength??gui,n=new Set,o=new Set;for(let r of[this.portMap.X1,this.portMap.X2]){if(!r.source_port_id)continue;let i=e.source_port.get(r.source_port_id);if(!i)continue;if(n.add(r.source_port_id),i.subcircuit_connectivity_map_key)o.add(i.subcircuit_connectivity_map_key)}for(let r of e.source_trace.list()){let i=r.connected_source_port_ids.some((l)=>n.has(l)),s=r.subcircuit_connectivity_map_key!==void 0&&o.has(r.subcircuit_connectivity_map_key);if(!i&&!s)continue;let a=typeof r.max_length!=="number"||r.max_length>t,c=r.max_via_count!==Nxn;if(!a&&!c)continue;e.source_trace.update(r.source_trace_id,{...a?{max_length:t}:{},...c?{max_via_count:Nxn}:{}})}}},fui=class extends bl{getSchematicSymbolName(){if(this.props.symbolName)return this.props.symbolName;if(this.props.connections?.positive_supply||this.props.connections?.negative_supply)return"opamp_with_power";return"opamp_no_power"}get config(){return{componentName:"OpAmp",schematicSymbolName:this.getSchematicSymbolName(),zodProps:BDt,sourceFtype:"simple_op_amp"}}initPorts(){let e={pin1:["non_inverting_input"],pin2:["inverting_input"]};if(this.getSchematicSymbolName()==="opamp_with_power")Object.assign(e,{pin4:["output"],pin5:["positive_supply","vcc","vdd"],pin3:["negative_supply","vee","vss","gnd"]});else Object.assign(e,{pin3:["output"],pin4:["positive_supply","vcc","vdd"],pin5:["negative_supply","vee","vss","gnd"]});super.initPorts({pinCount:5,additionalAliases:e})}doInitialSourceRender(){let{db:e}=this.root,{_parsedProps:t}=this,n=e.source_component.insert({ftype:"simple_op_amp",name:this.name,supplier_part_numbers:t.supplierPartNumbers,manufacturer_part_number:ii(t),display_name:t.displayName});this.source_component_id=n.source_component_id}doInitialSimulationRender(){let{db:e}=this.root,t=this.portMap.inverting_input,n=this.portMap.non_inverting_input,o=this.portMap.output,r=this.portMap.positive_supply,i=this.portMap.negative_supply;if(!t?.source_port_id||!n?.source_port_id||!o?.source_port_id||!r?.source_port_id||!i?.source_port_id)return;e.simulation_op_amp.insert({type:"simulation_op_amp",source_component_id:this.source_component_id,inverting_input_source_port_id:t.source_port_id,non_inverting_input_source_port_id:n.source_port_id,output_source_port_id:o.source_port_id,positive_supply_source_port_id:r.source_port_id,negative_supply_source_port_id:i.source_port_id})}inverting_input=this.portMap.inverting_input;non_inverting_input=this.portMap.non_inverting_input;output=this.portMap.output;positive_supply=this.portMap.positive_supply;negative_supply=this.portMap.negative_supply},Knt={HOLE_DIAMETER:0.5,SMT_CIRCLE_DIAMETER:1.2,SMT_RECT_SIZE:2},yui=class extends bl{get config(){return{componentName:"TestPoint",schematicSymbolName:this.props.symbolName??"testpoint",zodProps:ODt,sourceFtype:XS.simple_test_point}}_getPropsWithDefaults(){let{padShape:e,holeDiameter:t,footprintVariant:n,padDiameter:o,width:r,height:i}=this._parsedProps;if(!n&&t)n="through_hole";if(n??="through_hole",e??="circle",n==="pad"){if(e==="circle")o??=Knt.SMT_CIRCLE_DIAMETER;else if(e==="rect")r??=Knt.SMT_RECT_SIZE,i??=r}else if(n==="through_hole")t??=Knt.HOLE_DIAMETER;return{padShape:e,holeDiameter:t,footprintVariant:n,padDiameter:o,width:r,height:i}}_getImpliedFootprintString(){let{padShape:e,holeDiameter:t,footprintVariant:n,padDiameter:o,width:r,height:i}=this._getPropsWithDefaults();if(n==="through_hole")return`platedhole_d${t}`;if(n==="pad"){if(e==="circle")return`smtpad_circle_d${o}`;if(e==="rect")return`smtpad_rect_w${r}_h${i}`}throw Error(`Footprint variant "${n}" with pad shape "${e}" not implemented`)}doInitialSourceRender(){let{db:e}=this.root,{_parsedProps:t}=this,{padShape:n,holeDiameter:o,footprintVariant:r,padDiameter:i,width:s,height:a}=this._getPropsWithDefaults(),c=e.source_component.insert({ftype:XS.simple_test_point,name:this.name,supplier_part_numbers:t.supplierPartNumbers,manufacturer_part_number:ii(t),footprint_variant:r,pad_shape:n,pad_diameter:i,hole_diameter:o,width:s,height:a,are_pins_interchangeable:!0,display_name:t.displayName});this.source_component_id=c.source_component_id}},xui=(e)=>{if(e.root?.schematicDisabled)return;if(e.getCollapsedSchematicBoxAncestor())return;let{db:t}=e.root,n=e._getSchematicSymbolNameOrThrow(),o=Es[n];if(!o)throw Error(`No schematic symbol found for "${n}"`);let r=e._getGlobalSchematicPositionBeforeLayout(),i=e._resolveSchematicSheetId(),s=e.getSubcircuit().subcircuit_id??void 0,a=t.schematic_component.insert({center:r,size:{...o.size},is_box_with_pins:!0,symbol_name:n,source_component_id:e.source_component_id??void 0,schematic_sheet_id:i});e.schematic_component_id=a.schematic_component_id;for(let c of o.ports){let l=e.getPortForSymbolPort(c);if(!l?.source_port_id)throw Error(`Missing source port for schematic symbol port "${c.labels.join("/")}" on ${e.getString()}`);let h={x:r.x+c.x-o.center.x,y:r.y+c.y-o.center.y},d=t.schematic_port.insert({schematic_component_id:a.schematic_component_id,center:h,source_port_id:l.source_port_id,facing_direction:h5n(r,h),distance_from_component_edge:0.4,pin_number:l._parsedProps.pinNumber,display_pin_label:l._parsedProps.aliases?.[0],is_connected:!1,schematic_sheet_id:i,subcircuit_id:s});l.schematic_port_id=d.schematic_port_id}},Cui=(e,t)=>{let n=Array.isArray(t)?t:[t];if(n.length!==1)throw Error(`SchematicSymbol connection "${e}" must select exactly one physical port`);return n[0]},bui=(e)=>{let{db:t}=e.root,{chipRef:n,connections:o}=e._parsedProps;if(n&&!o){t.source_property_ignored_warning.insert({source_component_id:e.source_component_id,property_name:"chipRef",message:`${e.getString()} has chipRef "${n}" without connections. chipRef will be ignored.`,error_type:"source_property_ignored_warning",subcircuit_id:e.getSubcircuit().subcircuit_id??void 0});return}if(o&&!n){t.source_property_ignored_warning.insert({source_component_id:e.source_component_id,property_name:"connections",message:`${e.getString()} has connections without chipRef. connections will be ignored.`,error_type:"source_property_ignored_warning",subcircuit_id:e.getSubcircuit().subcircuit_id??void 0});return}if(!n||!o)return;let r=e.getSubcircuit().selectOne(n);if(!r?.source_component_id)throw Error(`Could not resolve chipRef "${n}" for ${e.getString()}`);let i=new Set;for(let a of e.ports){let c=a.schematicSymbolPortDef,l=Object.entries(o).filter(([m])=>a.isMatchingAnyOf([m]));if(l.length===0)throw Error(`${e.getString()} is missing an explicit connection for symbol port "${c.labels.join("/")}"`);if(l.length>1)throw Error(`${e.getString()} has multiple connections for symbol port "${c.labels.join("/")}"`);let[h,d]=l[0];i.add(h);let u=Cui(h,d),_=e.getSubcircuit().selectOne(u,{type:"port"});if(!_?.source_port_id)throw Error(`Could not resolve connection "${h}" target "${u}" for ${e.getString()}`);if(t.source_port.get(_.source_port_id)?.source_component_id!==r.source_component_id)throw Error(`Connection "${h}" target "${u}" does not belong to chipRef "${n}"`);a.source_port_id=_.source_port_id,a.source_component_id=_.source_component_id}let s=Object.keys(o).filter((a)=>!i.has(a));if(s.length>0)throw Error(`${e.getString()} has connections that do not match symbol ports: ${s.join(", ")}`)},Iui=class extends nr{isSchematicPrimitive=!0;isPrimitiveContainer=!0;get config(){return{componentName:"SchematicSymbol",schematicSymbolName:this.props.symbolName,zodProps:rNt}}initPorts(){let e=Es[this._getSchematicSymbolNameOrThrow()],t=!(this._parsedProps.chipRef&&this._parsedProps.connections);for(let n of e.ports){let o=r7e(n.labels);if(!o)throw Error(`Schematic symbol port must have a numeric pin label: ${n.labels.join("/")}`);let r=this.ports.find((a)=>a._parsedProps.pinNumber===o);if(r){r.schematicSymbolPortDef=n;continue}let i=n.labels.filter((a)=>a!==o.toString()&&a!==`pin${o}`),s=new Lh({pinNumber:o,aliases:i},{shouldCreateSourcePort:t});s.schematicSymbolPortDef=n,this.add(s)}}doInitialInitializePortsFromChildren(){this.initPorts()}updateInitializePortsFromChildren(){this.initPorts()}get ports(){return this.children.filter((e)=>e instanceof Lh)}getPortForSymbolPort(e){return this.ports.find((t)=>t.schematicSymbolPortDef===e)??null}doInitialSourceRender(){let e=this.root.db.source_component.insert({ftype:"simple_chip",name:this.name,display_name:this._parsedProps.displayName,are_pins_interchangeable:!1});this.source_component_id=e.source_component_id}doInitialPortMatching(){bui(this)}doInitialSchematicComponentRender(){xui(this)}},vui=class e extends nr{isSchematicPrimitive=!0;get config(){return{componentName:"SchematicSection",zodProps:pNt}}_computeSectionBounds(t,n,o){let{db:r}=this.root,i=t.getDescendants().filter((a)=>a.getSchematicSectionName()===n);if(i.length===0)return null;let s=[];for(let a of i){let c=a.schematic_component_id;if(!c)continue;let l=r.schematic_component.get(c);if(!l)continue;if(l.schematic_sheet_id!==o)continue;let h=l.size.width/2,d=l.size.height/2;s.push({minX:l.center.x-h,maxX:l.center.x+h,minY:l.center.y-d,maxY:l.center.y+d});for(let u of r.schematic_text.list({schematic_component_id:c}))s.push(N7n({text:u.text,position:u.position,anchor:u.anchor,fontSize:u.font_size}))}if(s.length===0)return null;return s9e(s)}doInitialSchematicSectionRender(){if(this.root?.schematicDisabled)return;let t=this.root?._getBoard();if(!t)return;let n=this._resolveSchematicSheetId(),o=t.getDescendants().filter((g)=>g instanceof e&&g._resolveSchematicSheetId()===n);if(o[0]!==this)return;let{db:r}=this.root,i=0.5,s=0.2,a=0.02,c=0.001,l=o.map((g)=>{let f=g._computeSectionBounds(t,g._parsedProps.name,n);if(!f)return null;return{displayName:g._parsedProps.displayName,sectionTitleFontSize:g._parsedProps.sectionTitleFontSize,rawBounds:f,cell:{minX:f.minX-i,maxX:f.maxX+i,minY:f.minY-i,maxY:f.maxY+i}}}).filter((g)=>g!==null),h=this._computeSectionBounds(t,null,n),d=[...l];if(h)d.push({displayName:void 0,sectionTitleFontSize:void 0,rawBounds:h,cell:{minX:h.minX-i,maxX:h.maxX+i,minY:h.minY-i,maxY:h.maxY+i}});if(d.length===0)return;let u=d.map((g)=>g.cell),_=s9e(u),p=Umn(d.map((g)=>g.rawBounds),{cellMargin:1});for(let g of p)r.schematic_line.insert({x1:g.start.x,y1:g.start.y,x2:g.end.x,y2:g.end.y,stroke_width:a,color:"#000000",is_dashed:!0,schematic_sheet_id:n});let m=p.filter((g)=>Math.abs(g.start.y-g.end.y)<c),A=p.filter((g)=>Math.abs(g.start.x-g.end.x)<c);for(let g of d){let{displayName:f,sectionTitleFontSize:y,rawBounds:x,cell:C}=g;if(!f)continue;let b=d.some((T)=>T!==g&&yp(T.rawBounds,x)),I=m.map((T)=>T.start.y).filter((T)=>T>x.maxY),v=I.length>0?Math.min(...I):_.maxY,P=A.map((T)=>T.start.x).filter((T)=>T<x.minX),M=_.minX;if(b)M=C.minX;if(P.length>0)M=Math.max(...P);let B=y??0.18;r.schematic_text.insert({anchor:"top_left",text:f,font_size:B,color:"#000000",position:{x:M+s,y:Math.max(v-s,x.maxY+s+B)},rotation:0,schematic_sheet_id:n})}}},Sui=(e)=>rAe.parse(e.toLowerCase()),Pui={a4:{width:297,height:210},ansi_b:{width:431.8,height:279.4}},$nt=({sheetSize:e,sheetWidth:t,sheetHeight:n})=>{let o=Sui(e),r=Pui[o];return{sheetSize:o,sheetWidth:t??r.width,sheetHeight:n??r.height}},uit=9.236363636363636,vve=5/uit,Sve=0.000001,Eui=(e)=>{switch(e.type){case"schematic_component":return e.schematic_component_id;case"schematic_net_label":return e.schematic_net_label_id;case"schematic_trace":return e.schematic_trace_id}},Rxn=({db:e,schematicSheetId:t,schematicSheetName:n,schematicSheetCenter:o,sheetWidth:r,sheetHeight:i})=>{let s=r/uit,a=i/uit,c={minX:o.x-s/2+vve,maxX:o.x+s/2-vve,minY:o.y-a/2+vve,maxY:o.y+a/2-vve},l=[...e.schematic_component.list(),...e.schematic_net_label.list(),...e.schematic_trace.list()].filter((h)=>h.schematic_sheet_id===t);for(let h of l){let d=dbt(h);if(!d)continue;if(!(d.minX<c.minX-Sve||d.maxX>c.maxX+Sve||d.minY<c.minY-Sve||d.maxY>c.maxY+Sve))continue;let _=Eui(h);e.schematic_element_outside_sheet_warning.insert({warning_type:"schematic_element_outside_sheet_warning",message:`${h.type} ${_} extends outside the drawing area of schematic sheet "${n}"`,schematic_sheet_id:t,schematic_element_type:h.type,schematic_element_id:_})}},Mui=class extends nr{isSchematicPrimitive=!0;resolvedSchematicSheetDisplayName="Schematic Sheet";get config(){return{componentName:"SchematicSheet",zodProps:mNt}}doInitialSourceGroupRender(){if(this.root?.schematicDisabled)return;let{db:e}=this.root,{_parsedProps:t}=this,n=new Set(this.root.children.flatMap((d)=>[d,...d.getDescendants()]).filter((d)=>d.componentName==="SchematicSheet").map((d)=>d._parsedProps.sheetIndex).filter((d)=>d!==void 0)),o=new Set([...n,...e.schematic_sheet.list().map((d)=>d.sheet_index).filter((d)=>d!==void 0)]),r=0;while(o.has(r))r+=1;let i=t.sheetIndex??r,s=t.name??t.displayName??`Sheet ${i+1}`,a=t.displayName??s;this.resolvedSchematicSheetDisplayName=a;let c=$nt(t),l=e.schematic_sheet.insert({name:s,display_name:a,sheet_index:i,sheet_size:c.sheetSize,sheet_width:c.sheetWidth,sheet_height:c.sheetHeight,subcircuit_id:this.getSubcircuit().subcircuit_id??void 0});this.schematic_sheet_id=l.schematic_sheet_id;let h=$nt({sheetSize:"A4"});if(c.sheetSize!==h.sheetSize||c.sheetWidth!==h.sheetWidth||c.sheetHeight!==h.sheetHeight)e.schematic_sheet_styling_warning.insert({warning_type:"schematic_sheet_styling_warning",styling_issue_type:"non_default_sheet_size",schematic_sheet_id:this.schematic_sheet_id,subcircuit_id:l.subcircuit_id,message:`Schematic sheet "${a}" uses a non-default size (${c.sheetWidth} × ${c.sheetHeight} mm). Prefer the default A4 sheet size (297 × 210 mm) for consistent schematic styling.`})}doInitialSchematicSheetRender(){if(this.root?.schematicDisabled)return;if(!this.schematic_sheet_id)return;let{db:e}=this.root,t=$nt(this._parsedProps);if(this._parsedProps.sheetWidth!==void 0||this._parsedProps.sheetHeight!==void 0){Rxn({db:e,schematicSheetId:this.schematic_sheet_id,schematicSheetName:this.resolvedSchematicSheetDisplayName,schematicSheetCenter:{x:0,y:0},sheetWidth:t.sheetWidth,sheetHeight:t.sheetHeight});return}let o=[...e.schematic_component.list(),...e.schematic_port.list(),...e.schematic_text.list(),...e.schematic_line.list(),...e.schematic_rect.list(),...e.schematic_circle.list(),...e.schematic_arc.list(),...e.schematic_path.list()].filter((i)=>i.schematic_sheet_id===this.schematic_sheet_id),r={x:0,y:0};if(o.length>0){let i=bue(o);if(Number.isFinite(i.minX)&&Number.isFinite(i.maxX)&&Number.isFinite(i.minY)&&Number.isFinite(i.maxY))r={x:(i.minX+i.maxX)/2,y:(i.minY+i.maxY)/2},e.schematic_sheet.update(this.schematic_sheet_id,{center:r})}Rxn({db:e,schematicSheetId:this.schematic_sheet_id,schematicSheetName:this.resolvedSchematicSheetDisplayName,schematicSheetCenter:r,sheetWidth:t.sheetWidth,sheetHeight:t.sheetHeight})}},wui=class extends nr{isSchematicPrimitive=!0;schematic_graphic_id;get config(){return{componentName:"SchematicGraphic",zodProps:_Nt}}doInitialSchematicPrimitiveRender(){if(this.root?.schematicDisabled)return;if(this.getCollapsedSchematicBoxAncestor())return;let{db:e}=this.root,{imageUrl:t,svgContent:n,width:o,height:r}=this._parsedProps;if(t!==void 0){this._queueAsyncEffect("SchematicGraphicRender",async()=>{if(this.root?.schematicDisabled)return;let i=await b4n(t,this.root?.platform),s=await uIe(i).catch((h)=>{if(n===void 0||i.startsWith("data:"))throw h;return null});if(s===null){let h={project_relative_path:t.startsWith("data:")?"inline":t,url:i,mimetype:g9},d=this.root.db.schematic_graphic.insert({asset:h,schematic_sheet_id:this._resolveSchematicSheetId(),svg_content:n,...o===void 0?{}:{width:o},...r===void 0?{}:{height:r}});this.schematic_graphic_id=d.schematic_graphic_id;return}if(s.mimetype!==g9)throw Error(`Unsupported imageUrl for SchematicGraphic: "${t}". Expected an SVG image.`);let a={project_relative_path:t.startsWith("data:")?s.projectRelativePath:t,url:s.dataUrl,mimetype:s.mimetype},c=s.dataUrl.startsWith("data:")?n:s.text,l=this.root.db.schematic_graphic.insert({asset:a,schematic_sheet_id:this._resolveSchematicSheetId(),...c===void 0?{}:{svg_content:c},...o===void 0?{}:{width:o},...r===void 0?{}:{height:r}});this.schematic_graphic_id=l.schematic_graphic_id});return}if(n!==void 0){let i={project_relative_path:"inline",url:`data:image/svg+xml,${encodeURIComponent(n)}`,mimetype:g9},s=e.schematic_graphic.insert({asset:i,schematic_sheet_id:this._resolveSchematicSheetId(),...o===void 0?{}:{width:o},...r===void 0?{}:{height:r}});this.schematic_graphic_id=s.schematic_graphic_id}}},Bui=class extends nr{isSchematicPrimitive=!0;schematic_table_id=null;get config(){return{componentName:"SchematicTable",zodProps:hNt}}doInitialSchematicPrimitiveRender(){if(this.root?.schematicDisabled)return;if(this.getCollapsedSchematicBoxAncestor())return;let{db:e}=this.root,{_parsedProps:t}=this,n=this.children.filter((d)=>d.componentName==="SchematicRow");if(n.length===0)return;let o=[],r=0;for(let d of n){let u=d.children.filter((_)=>_.componentName==="SchematicCell");r=Math.max(r,u.length)}for(let d=0;d<n.length;d++)o[d]=[];for(let d=0;d<n.length;d++){let _=n[d].children.filter((m)=>m.componentName==="SchematicCell"),p=0;for(let m=0;m<_.length;m++){while(o[d][p])p++;let A=_[m],g=A._parsedProps.colSpan??1,f=A._parsedProps.rowSpan??1;for(let y=0;y<f;y++)for(let x=0;x<g;x++){if(!o[d+y])o[d+y]=[];o[d+y][p+x]=A}p+=g}}r=Math.max(0,...o.map((d)=>d.length));let i=n.map((d,u)=>d._parsedProps.height??1),s=Array.from({length:r},(d,u)=>{let _=0;for(let p=0;p<n.length;p++){let m=o[p]?.[u];if(m){let A=m._parsedProps.text??m._parsedProps.children,g=m._parsedProps.width??(A?.length??2)*0.5;if(g>_)_=g}}return _||10}),a=this._getGlobalSchematicPositionBeforeLayout(),c=e.schematic_table.insert({anchor_position:a,column_widths:s,row_heights:i,cell_padding:t.cellPadding,border_width:t.borderWidth,anchor:t.anchor,subcircuit_id:this.getSubcircuit()?.subcircuit_id||"",schematic_component_id:this.parent?.schematic_component_id||"",schematic_sheet_id:this._resolveSchematicSheetId()});this.schematic_table_id=c.schematic_table_id;let l=new Set,h=0;for(let d=0;d<n.length;d++){let u=0;for(let _=0;_<r;_++){let p=o[d]?.[_];if(p&&!l.has(p)){l.add(p);let m=p._parsedProps,A=m.rowSpan??1,g=m.colSpan??1,f=0;for(let x=0;x<g;x++)f+=s[_+x];let y=0;for(let x=0;x<A;x++)y+=i[d+x];e.schematic_table_cell.insert({schematic_table_id:this.schematic_table_id,start_row_index:d,end_row_index:d+A-1,start_column_index:_,end_column_index:_+g-1,text:m.text??m.children,center:{x:a.x+u+f/2,y:a.y-h-y/2},width:f,height:y,horizontal_align:m.horizontalAlign,vertical_align:m.verticalAlign,font_size:m.fontSize??t.fontSize,subcircuit_id:this.getSubcircuit()?.subcircuit_id||""})}if(s[_])u+=s[_]}h+=i[d]}}};var Tui=class extends nr{isSchematicPrimitive=!0;get config(){return{componentName:"SchematicRow",zodProps:dNt}}},Dui=class extends nr{isSchematicPrimitive=!0;canHaveTextChildren=!0;get config(){return{componentName:"SchematicCell",zodProps:uNt}}},Nui=class extends nr{simulation_experiment_id=null;get config(){return{componentName:"AnalogSimulation",zodProps:ADt}}getSpiceEngineName(){return this._parsedProps.spiceEngine}usesIndependentGraphAxes(){return this._parsedProps.graphIndependentAxes===!0}doInitialSimulationRender(){let{db:e}=this.root,{duration:t,name:n,startTime:o,timePerStep:r,spiceOptions:i}=this._parsedProps,s=t||10,a=r||0.01,c=e.simulation_experiment.insert({name:n??"spice_transient_analysis",experiment_type:"spice_transient_analysis",end_time_ms:s,start_time_ms:o,time_per_step:a,spice_options:i});this.simulation_experiment_id=c.simulation_experiment_id}},HZ=class extends nr{simulation_experiment_id=null;getSpiceEngineName(){return typeof this.props.spiceEngine==="string"?this.props.spiceEngine:void 0}usesIndependentGraphAxes(){return this.props.graphIndependentAxes===!0}getOrCreateSimulationExperiment(){if(this.simulation_experiment_id)return this.root?.db.simulation_experiment.get(this.simulation_experiment_id)??null;if(this.children.filter((n)=>n.componentName==="AnalogSweepParameter").length>1)return this.renderError("An analog simulation can contain at most one sweep parameter."),null;let t=this.insertSimulationExperiment();return this.simulation_experiment_id=t?.simulation_experiment_id??null,t}doInitialSimulationRender(){this.getOrCreateSimulationExperiment()}},Rui=class extends HZ{get config(){return{componentName:"AnalogTransientSimulation",zodProps:fDt}}insertSimulationExperiment(){let{db:e}=this.root,{duration:t,name:n,startTime:o,timePerStep:r,spiceOptions:i}=this._parsedProps;return e.simulation_experiment.insert({name:n??"spice_transient_analysis",experiment_type:"spice_transient_analysis",end_time_ms:t,start_time_ms:o,time_per_step:r,spice_options:i})}},Qui=class extends HZ{get config(){return{componentName:"AnalogDcOperatingPointSimulation",zodProps:yDt}}insertSimulationExperiment(){let{name:e,spiceOptions:t}=this._parsedProps;return this.root.db.simulation_experiment.insert({name:e??"spice_dc_operating_point",experiment_type:"spice_dc_operating_point",spice_options:t})}},kui=class extends HZ{get config(){return{componentName:"AnalogDcSweepSimulation",zodProps:xDt}}insertSimulationExperiment(){let{name:e,spiceOptions:t,sweepSource:n,sweepStart:o,sweepStop:r,sweepStep:i}=this._parsedProps,a=(this.getGroup()??this.getSubcircuit())?.selectOne(n),c;if(a instanceof wSn){a.runRenderPhase("SimulationRender");let l=a.simulation_voltage_source_id;if(!l)return this.renderError(`DC sweep source "${n}" must resolve to one voltage or current source.`),null;c={dc_sweep_voltage_source_id:l,dc_sweep_unit:"V"}}else if(a instanceof BSn){a.runRenderPhase("SimulationRender");let l=a.simulation_current_source_id;if(!l)return this.renderError(`DC sweep source "${n}" must resolve to one voltage or current source.`),null;c={dc_sweep_current_source_id:l,dc_sweep_unit:"A"}}else return this.renderError(`DC sweep source "${n}" must resolve to one voltage or current source.`),null;return this.root.db.simulation_experiment.insert({name:e??"spice_dc_sweep",experiment_type:"spice_dc_sweep",spice_options:t,...c,dc_sweep_start:o,dc_sweep_stop:r,dc_sweep_step:i})}},Lui=class extends HZ{get config(){return{componentName:"AnalogAcSweepSimulation",zodProps:CDt}}insertSimulationExperiment(){let{name:e,spiceOptions:t,sweepType:n,samplesPerInterval:o,sampleCount:r,startFrequency:i,stopFrequency:s}=this._parsedProps;return this.root.db.simulation_experiment.insert({name:e??"spice_ac_analysis",experiment_type:"spice_ac_analysis",spice_options:t,ac_sweep_type:n,ac_samples_per_interval:o,ac_sample_count:r,ac_start_frequency_hz:i,ac_stop_frequency_hz:s})}},Hui={resistance:"Ω",capacitance:"F",inductance:"H",voltage:"V",current:"A"},Fui=({parameterSweepCoordinate:e,stop:t,step:n})=>{let o=Math.abs(n)*0.000000001;return n>0?e<=t+o:e>=t-o},zui=({start:e,stop:t,step:n})=>{let o=[];for(let r=e;Fui({parameterSweepCoordinate:r,stop:t,step:n});r=e+o.length*n)if(o.push(r),o.length>1e6)throw Error("Parameter sweep exceeds 1,000,000 points");return o},Oui=(e)=>{if(e.parameterType==="resistance")return e.resistorRef;if(e.parameterType==="capacitance")return e.capacitorRef;if(e.parameterType==="inductance")return e.inductorRef;if(e.parameterType==="voltage")return e.net;return e.currentSourceRef},Vui=(e)=>{if(!(e.parent instanceof HZ)){e.renderError("analog.sweepparameter must be nested directly in an analog simulation.");return}let t=e.parent.getOrCreateSimulationExperiment();if(!t)return;let n=e._parsedProps,o=n.values??zui({start:n.start,stop:n.stop,step:n.step}),r=e.parent.getGroup()??e.parent.getSubcircuit(),i=Oui(n),s=Hui[n.parameterType],a=e.root.db.simulation_parameter_sweep,c={simulation_experiment_id:t.simulation_experiment_id,name:n.name,parameter_type:n.parameterType,parameter_values:o,parameter_unit:s},l;if(n.parameterType==="voltage"){let h=r?.selectOne(i,{type:"net"});if(!h?.source_net_id){e.renderError(`Voltage sweep net "${i}" could not be resolved.`);return}l=a.insert({...c,parameter_type:"voltage",source_net_id:h.source_net_id}).simulation_parameter_sweep_id}else{let d=r?.selectOne(i)?.source_component_id;if(!d){e.renderError(`Parameter sweep target "${i}" could not be resolved.`);return}if(n.parameterType==="resistance")l=a.insert({...c,parameter_type:"resistance",resistor_source_component_id:d}).simulation_parameter_sweep_id;else if(n.parameterType==="capacitance")l=a.insert({...c,parameter_type:"capacitance",capacitor_source_component_id:d}).simulation_parameter_sweep_id;else if(n.parameterType==="inductance")l=a.insert({...c,parameter_type:"inductance",inductor_source_component_id:d}).simulation_parameter_sweep_id;else l=a.insert({...c,parameter_type:"current",current_source_component_id:d}).simulation_parameter_sweep_id}e.simulation_parameter_sweep_id=l},Yui=class extends nr{simulation_parameter_sweep_id=null;get config(){return{componentName:"AnalogSweepParameter",zodProps:SDt}}doInitialSimulationRender(){Vui(this)}},Gui=class extends nr{simulation_experiment_id=null;get config(){return{componentName:"PcbReturnCurrentSimulation",zodProps:vDt}}doInitialSimulationRender(){if(this.root?.pcbDisabled)return;if(this.parent?.componentName==="PcbReturnCurrentSimulation")this.renderError("A PCB return-current simulation cannot contain another simulation.");if(this.children.some((t)=>t.componentName!=="PcbReturnCurrentExcitation"))this.renderError("A PCB return-current simulation can contain only return-current excitations.");let e=this.root.db.simulation_experiment.insert({name:this._parsedProps.name??"PCB return current",experiment_type:"pcb_return_current"});this.simulation_experiment_id=e.simulation_experiment_id}updateSimulationRender(){if(!this.simulation_experiment_id)return;this.root.db.simulation_experiment.update(this.simulation_experiment_id,{name:this._parsedProps.name??"PCB return current"})}removeSimulationRender(){if(!this.simulation_experiment_id)return;this.root.db.simulation_experiment.delete(this.simulation_experiment_id),this.simulation_experiment_id=null}},Qxn=0.000001;function Uui(e){if(e.root?.pcbDisabled)return;let{db:t}=e.root,{_parsedProps:n,parent:o}=e;if(o?.componentName!=="PcbReturnCurrentSimulation"){e.renderError("A PCB return-current excitation must be directly inside a PCB return-current simulation.");return}if(!o.simulation_experiment_id){e.renderError("The PCB return-current simulation has not been declared.");return}let r=e.getSubcircuit(),i=(C,b)=>{let I=r.selectAll(C).filter((B)=>B.componentName==="Port");if(I.length!==1)e.renderError(`${b} selector "${C}" must identify exactly one physical PCB port.`);let v=I[0],P=v?.pcb_port_id?t.pcb_port.get(v.pcb_port_id):null,M=P&&(t.pcb_smtpad.list({pcb_port_id:P.pcb_port_id}).length>0||t.pcb_plated_hole.list({pcb_port_id:P.pcb_port_id}).length>0);if(!P||!M)e.renderError(`${b} selector "${C}" needs a physical PCB pad or plated-hole port.`);return P},s=i(n.source,"Signal source"),a=i(n.load,"Signal load"),c=i(n.returnSource,"Return source (load-side ground)"),l=i(n.returnSink,"Return sink (driver-side ground)");if(new Set([s.pcb_port_id,a.pcb_port_id,c.pcb_port_id,l.pcb_port_id]).size!==4)e.renderError("Signal source, signal load, return source and return sink must be four distinct physical PCB ports.");let h=r.selectAll(n.ground.startsWith("net.")?"net":n.ground).filter((C)=>C.componentName==="Net"&&(!n.ground.startsWith("net.")||C.getPortSelector()===n.ground));if(h.length!==1||!h[0].source_net_id)e.renderError(`Ground selector "${n.ground}" must identify exactly one source net.`);let d=t.source_net.get(h[0].source_net_id),u=d.subcircuit_connectivity_map_key;for(let[C,b]of[[s,n.source],[a,n.load]])if(u&&t.source_port.get(C.source_port_id)?.subcircuit_connectivity_map_key===u)e.renderError(`Signal terminal "${b}" is electrically connected to ground net "${d.name}".`);for(let[C,b]of[[c,n.returnSource],[l,n.returnSink]]){let I=t.source_port.get(C.source_port_id);if(!u||I?.subcircuit_connectivity_map_key!==u)e.renderError(`Return contact "${b}" is not electrically connected to ground net "${d.name}".`)}let _=(C,b,I,v)=>{let P=[...new Set(C.layers)];if(!I&&P.length!==1)e.renderError(`${v} "${b}" spans multiple layers; specify ${v==="Return source"?"returnSourceLayer":"returnSinkLayer"}.`);let M=I??P[0];if(!P.includes(M))e.renderError(`${v} "${b}" has no physical port on layer "${M}".`);return{contact_type:"pcb_port",pcb_port_id:C.pcb_port_id,x:C.x,y:C.y,layer:M}},p=_(c,n.returnSource,n.returnSourceLayer,"Return source"),m=_(l,n.returnSink,n.returnSinkLayer,"Return sink");for(let[C,b]of[[s,m],[a,p]])if(Math.hypot(C.x-b.x,C.y-b.y)<=Qxn&&C.layers.includes(b.layer))e.renderError("A signal terminal and its ground reference must occupy different physical PCB locations on the same layer.");let A;if(n.trace){let C=r.selectAll(n.trace).filter((b)=>b.componentName==="Trace");if(C.length!==1||!C[0].source_trace_id)e.renderError(`Trace selector "${n.trace}" must identify exactly one routed source trace.`);A=C[0].source_trace_id}let g=(C,b,I)=>C?.route_type==="wire"&&Math.hypot(C.x-b.x,C.y-b.y)<=Qxn&&b.layers.includes(C.layer)&&(!C[`${I}_pcb_port_id`]||C[`${I}_pcb_port_id`]===b.pcb_port_id),f=t.pcb_trace.list().filter((C)=>{if(C.subcircuit_id!==r.subcircuit_id)return!1;if(A&&C.source_trace_id!==A)return!1;let b=C.source_trace_id?t.source_trace.get(C.source_trace_id):null;if(!b||b.connected_source_port_ids.length!==2||!b.connected_source_port_ids.includes(s.source_port_id)||!b.connected_source_port_ids.includes(a.source_port_id))return!1;let I=C.route[0],v=C.route.at(-1);return g(I,s,"start")&&g(v,a,"end")||g(I,a,"start")&&g(v,s,"end")});if(f.length!==1)e.renderError(`The connection from "${n.source}" to "${n.load}" must have exactly one complete routed PCB trace${n.trace?` selected by "${n.trace}"`:"; use trace to disambiguate multiple routes"}. Split or branched routes are not supported.`);let y=t.simulation_return_current_excitation.list({simulation_experiment_id:o.simulation_experiment_id});if(y.some((C)=>C.pcb_trace_id===f[0].pcb_trace_id))e.renderError("A PCB return-current simulation can excite each signal trace only once. Use separate experiments to compare different currents or directions.");if(y.some((C)=>C.ground_source_net_id!==d.source_net_id))e.renderError("All excitations in a PCB return-current simulation must use the same ground net. Use separate experiments for different ground nets.");let x=t.simulation_return_current_excitation.insert({simulation_experiment_id:o.simulation_experiment_id,pcb_trace_id:f[0].pcb_trace_id,ground_source_net_id:d.source_net_id,current:n.current,return_source:p,return_sink:m,source_port:{signal_pcb_port_id:s.pcb_port_id,reference_pcb_port_id:l.pcb_port_id,reference_layer:m.layer,resistance:n.sourceImpedance},load_port:{signal_pcb_port_id:a.pcb_port_id,reference_pcb_port_id:c.pcb_port_id,reference_layer:p.layer,resistance:n.loadImpedance}});e.simulation_return_current_excitation_id=x.simulation_return_current_excitation_id}var Wui=class extends nr{simulation_return_current_excitation_id=null;get config(){return{componentName:"PcbReturnCurrentExcitation",zodProps:IDt}}doInitialPcbSimulationRender(){Uui(this)}updatePcbSimulationRender(){this.removePcbSimulationRender(),this.doInitialPcbSimulationRender()}removePcbSimulationRender(){if(!this.simulation_return_current_excitation_id)return;this.root.db.simulation_return_current_excitation.delete(this.simulation_return_current_excitation_id),this.simulation_return_current_excitation_id=null}};function Xui(e,t,n,o=0.3){let i=Math.max(t.length*0.1,0.3),s=0.25,a=0.45,{x:c,y:l}=e,h=o+i/2;if(n.includes("top"))l+=h;else if(n.includes("bottom"))l-=h;if(n.includes("right"))c+=h;else if(n.includes("left"))c-=h;let d,u,_,p;if(n.includes("left"))d=c,u=c+i;else if(n.includes("right"))d=c-i,u=c;else d=c-i/2,u=c+i/2;if(n.includes("top"))_=l-0.45,p=l;else if(n.includes("bottom"))_=l,p=l+0.45;else _=l-0.225,p=l+0.225;return{minX:d,maxX:u,minY:_,maxY:p}}function jui(e){let t,n,o,r;if(e.type==="schematic_component")t=e.center?.x,n=e.center?.y,o=e.size?.width,r=e.size?.height;else if(e.type==="schematic_text")t=e.position?.x,n=e.position?.y,o=(e.text?.length??0)*0.1,r=0.2;else return null;if(typeof t==="number"&&typeof n==="number"&&typeof o==="number"&&typeof r==="number")return{minX:t-o/2,maxX:t+o/2,minY:n-r/2,maxY:n+r/2};return null}function Kui(e,t){if(!yp(e,t))return 0;let n=Math.min(e.maxX,t.maxX)-Math.max(e.minX,t.minX),o=Math.min(e.maxY,t.maxY)-Math.max(e.minY,t.minY);return n*o}function $ui({probePosition:e,labelText:t,schematicElements:n,defaultAlignment:o="top_right"}){let i=[o,...["top_right","top_left","bottom_right","bottom_left","top_center","bottom_center","center_right","center_left"].filter((c)=>c!==o)],s=o,a=1/0;for(let c of i){let l=Xui(e,t,c),h=0;for(let d of n){let u=jui(d);if(u)h+=Kui(l,u)}if(h===0)return c;if(h<a)a=h,s=c}return s}var qui=class extends nr{simulation_voltage_probe_id=null;schematic_voltage_probe_id=null;finalProbeName=null;color=null;get config(){return{componentName:"VoltageProbe",zodProps:eNt}}doInitialSimulationRender(){let{db:e}=this.root,{connectsTo:t,name:n,referenceTo:o,color:r,graphDisplayName:i,graphCenter:s,graphVerticalOffset:a,graphVoltagePerDiv:c}=this._parsedProps,l=this.getSubcircuit();if(!l){this.renderError("VoltageProbe must be inside a subcircuit");return}let h=Array.isArray(t)?t:[t];if(h.length!==1){this.renderError("VoltageProbe must connect to exactly one port or net");return}let d=h[0],u=l.selectOne(d,{type:"port"}),_=!u?l.selectOne(d,{type:"net"}):null;if(_&&_.componentName!=="Net"){this.renderError(`VoltageProbe connection target "${d}" resolved to a non-net component "${_.componentName}".`);return}if(!u&&!_){this.renderError(`VoltageProbe could not find connection target "${d}"`);return}let p=u?.source_port_id??_?.source_net_id;if(!p){this.renderError("Could not identify connected source for VoltageProbe");return}let m=null,A=null;if(o){let x=Array.isArray(o)?o:[o];if(x.length!==1){this.renderError("VoltageProbe must reference exactly one port or net");return}let C=x[0];if(m=l.selectOne(C,{type:"port"}),A=!m?l.selectOne(C,{type:"net"}):null,A&&A.componentName!=="Net"){this.renderError(`VoltageProbe reference target "${C}" resolved to a non-net component "${A.componentName}".`);return}if(!m&&!A){this.renderError(`VoltageProbe could not find reference target "${C}"`);return}}this.color=r??xci(p);let g=n;if(!g)g=h[0].split(" > ").map((x)=>x.replace(/^\./,"")).join(".");this.finalProbeName=g??null;let{simulation_voltage_probe_id:f}=e.simulation_voltage_probe.insert({name:g,signal_input_source_port_id:u?.source_port_id??void 0,signal_input_source_net_id:_?.source_net_id??void 0,reference_input_source_port_id:m?.source_port_id??void 0,reference_input_source_net_id:A?.source_net_id??void 0,subcircuit_id:l.subcircuit_id||void 0,color:this.color});if(this.simulation_voltage_probe_id=f,i!==void 0||s!==void 0||a!==void 0||c!==void 0){let x=kk(c),C=kk(a);e.simulation_oscilloscope_trace.insert({simulation_voltage_probe_id:f,display_name:i,color:r??void 0,display_center_value:s,volts_per_div:x,display_center_offset_divs:C!==void 0&&x!==void 0&&x!==0?C/x:void 0})}}doInitialSchematicReplaceNetLabelsWithSymbols(){if(this.root?.schematicDisabled)return;let{db:e}=this.root,{connectsTo:t,name:n}=this._parsedProps,o=this.getSubcircuit();if(!o)return;let r=Array.isArray(t)?t:[t];if(r.length!==1)return;let i=r[0],s=o.selectOne(i,{type:"port"});if(!s)return;if(!s.schematic_port_id)return;let a=s._getGlobalSchematicPositionAfterLayout(),c=null;for(let u of e.schematic_trace.list()){for(let _ of u.edges)if(Math.abs(_.from.x-a.x)<0.000001&&Math.abs(_.from.y-a.y)<0.000001||Math.abs(_.to.x-a.x)<0.000001&&Math.abs(_.to.y-a.y)<0.000001){c=u.schematic_trace_id;break}if(c)break}if(!c)return;let l=this.finalProbeName,h=$ui({probePosition:a,labelText:l,schematicElements:[...e.schematic_component.list(),...e.schematic_text.list()],defaultAlignment:"top_right"}),d=e.schematic_voltage_probe.insert({name:l,position:a,schematic_trace_id:c,subcircuit_id:o.subcircuit_id||void 0,color:this.color??void 0,label_alignment:h});this.schematic_voltage_probe_id=d.schematic_voltage_probe_id}},Jui=class extends nr{get config(){return{componentName:"SpiceModel",zodProps:EDt}}doInitialSimulationRender(){if(this.getInheritedProperty("analogSimulationDisabled"))return;let e=this.parent;if(!e)return;let t=e.source_component_id;if(!t){this._insertSpiceModelError("spicemodel must be attached to a source component.",this._parsedProps);return}let{source:n,spicePinMapping:o}=this._parsedProps,r=yun(n).subckts[0]??null,i=r?.pins.map((l)=>l.name);if(!r||!i||i.length===0){this._insertSpiceModelError("spicemodel source must contain a .subckt declaration with a model name and pins.",n);return}let s=o??{};for(let l of Object.keys(s))if(!i.includes(l)){this._insertSpiceModelError(`spicePinMapping references SPICE pin "${l}", but it is not present in .subckt ${r.name}.`,s);return}let a={},c=new Set;for(let l of i){let h=s[l]??l,d=e.selectAll("port").filter((_)=>_ instanceof Lh&&_.isMatchingAnyOf([h]));if(d.length!==1||!d[0].source_port_id){this._insertSpiceModelError(`Could not resolve SPICE pin "${l}" to exactly one component port using "${h}".`,s);return}let u=d[0].source_port_id;if(c.has(u)){this._insertSpiceModelError(`spicePinMapping maps more than one SPICE pin to component port "${h}".`,s);return}c.add(u),a[l]=u}this.root.db.simulation_spice_subcircuit.insert({source_component_id:t,spice_pin_to_source_port_map:a,subcircuit_source:n})}_insertSpiceModelError(e,t){this.root.db.source_invalid_component_property_error.insert({source_component_id:this.parent?.source_component_id||"",property_name:"spiceModel",property_value:t,message:e,error_type:"source_invalid_component_property_error"})}};function JSn(e){let t=e._getBoard()?.pcb_board_id,n=t?e.root.db.pcb_board.get(t):null;if(!n)throw Error(`${e.componentName} must be inside a board`);let o=W7e.compose(W7e.translate(-n.center.x,-n.center.y),e._computePcbGlobalTransformBeforeLayout());return{board:n,transform:o}}var Zui=class extends nr{pcb_bend_id=null;tearReliefCutoutIds=[];get config(){return{componentName:"PcbBend",zodProps:PTt}}doInitialPcbFlexRender(){if(this.root?.pcbDisabled)return;let{db:e}=this.root,t=this._parsedProps,{board:n,transform:o}=JSn(this),r=e.pcb_bend.insert({pcb_board_id:n.pcb_board_id,pcb_group_id:this.getGroup()?.pcb_group_id??void 0,subcircuit_id:this.getSubcircuit().subcircuit_id??void 0,name:t.name,start:pit.applyToPoint(o,{x:t.x1,y:t.y1}),end:pit.applyToPoint(o,{x:t.x2,y:t.y2}),bend_angle:t.bendAngle,bend_radius:t.bendRadius,bend_side:t.bendSide});if(this.pcb_bend_id=r.pcb_bend_id,t.tearReliefRadius!==void 0)for(let i of[r.start,r.end]){let s=e.pcb_cutout.insert({shape:"circle",center:{x:i.x+n.center.x,y:i.y+n.center.y},radius:t.tearReliefRadius,pcb_board_id:n.pcb_board_id,pcb_group_id:r.pcb_group_id,subcircuit_id:r.subcircuit_id});this.tearReliefCutoutIds.push(s.pcb_cutout_id)}}removePcbFlexRender(){for(let e of this.tearReliefCutoutIds)this.root.db.pcb_cutout.delete(e);if(this.tearReliefCutoutIds=[],!this.pcb_bend_id)return;this.root.db.pcb_bend.delete(this.pcb_bend_id),this.pcb_bend_id=null}},e0i=class extends nr{pcb_stiffener_id=null;get config(){return{componentName:"PcbStiffener",zodProps:MTt}}doInitialPcbFlexRender(){if(this.root?.pcbDisabled)return;let{db:e}=this.root,t=this._parsedProps,{board:n,transform:o}=JSn(this),r={pcb_board_id:n.pcb_board_id,pcb_group_id:this.getGroup()?.pcb_group_id??void 0,subcircuit_id:this.getSubcircuit().subcircuit_id??void 0,name:t.name,layer:t.layer,material:t.material,thickness:t.thickness,adhesive_thickness:t.adhesiveThickness},i=t.shape==="rect"?{shape:"rect",center:fue.applyToPoint(o,{x:0,y:0}),rotation:fue.decomposeTSR(o).rotation.angle*180/Math.PI,width:t.width,height:t.height}:{shape:"polygon",outline:t.outline.map((s)=>fue.applyToPoint(o,s))};this.pcb_stiffener_id=e.pcb_stiffener.insert({...r,...i}).pcb_stiffener_id}doRemovePcbFlexRender(){if(!this.pcb_stiffener_id)return;this.root.db.pcb_stiffener.delete(this.pcb_stiffener_id),this.pcb_stiffener_id=null}},ePn=class extends nr{isAssemblyDeviceContainer=!0;compiledJscadInput;compiledJscad;get config(){return{componentName:"AssemblyPrintedPart",zodProps:uTt}}get printedPartPlan(){if(!this._parsedProps.jscad)return;if(!this.compiledJscad||this.compiledJscadInput!==this._parsedProps.jscad){let{geometry:e,referencePlanes:t}=mit.resolveReferencePlanes(_tt(this._parsedProps.jscad));if(!e)throw Error(`assembly.printedpart "${this.name}" needs solid geometry in addition to references`);this.compiledJscad={geometry:e,referencePlanes:t},this.compiledJscadInput=this._parsedProps.jscad}return this.compiledJscad}doInitialReactSubtreesRender(){if(ZSn.isValidElement(this.props.cadModel))this.add(Iue(this.props.cadModel))}doInitialSourceRender(){this.printedPartPlan,i7e(this),this.source_component_id=this.root.db.source_component.insert({ftype:"printedpart",name:this.name,color:this._parsedProps.color,material:this._parsedProps.material}).source_component_id}doInitialCadModelRender(){if(!this.root||this.root.pcbDisabled||!this.source_component_id)return;XSn(this);let e=this.printedPartPlan;if(!e){let i=LZ(this._parsedProps)??this._parsedProps.cadModel,s=xZ(this);if(!i||typeof i==="object"&&"type"in i)return;if(typeof i==="object"&&"jscad"in i){let{geometry:a}=mit.resolveReferencePlanes(i.jscad);if(!a)throw Error(`assembly.printedpart "${this.name}" needs solid geometry in addition to references`);i={...i,jscad:a}}this.cad_component_id=fB(this,i,s);return}let{transforms:t,subcircuitId:n}=SY(this),o=t.get(this),r=m4n(o);this.cad_component_id=fB(this,{jscad:{type:"rotate",angles:r,shape:e.geometry}},{position:{x:o[12],y:o[13],z:o[14]},pcbRotation:0,layer:"top",subcircuit_id:n})}},yue=un([he(2),he(3),he(3.5),he(4),he(5),he(5.5),he(6),he(8)]),kxn=Pt(["male","female"]);function Lxn({diameter:e,gender:t,pinCount:n=1,pitch:o=e+2}){let r=e*2,i=e+(t==="female"?1:0.6);return{kind:t==="male"?"bullet_male":"bullet_female",diameter:e,contactDepth:r,pinCount:n,pitch:o,bodyWidth:i+(n-1)*o,bodyHeight:i,bodyDepth:r+e*1.5}}var t0i=Pt(["usb_c","jst_sh","jst_ph","us_mains","bullet","adaptercable"]),$4=Ae().finite().positive(),Hxn=k().regex(/^#[0-9a-fA-F]{6}$/),eY={bodyWidth:$4,bodyHeight:$4,bodyDepth:$4},J8e=ss("kind",[we({kind:he("bullet_male"),...eY,diameter:yue,pinCount:Ae().int().min(1).max(16).default(1),pitch:$4,contactDepth:$4}).strict(),we({kind:he("bullet_female"),...eY,diameter:yue,pinCount:Ae().int().min(1).max(16).default(1),pitch:$4,contactDepth:$4}).strict(),we({kind:he("usb_c_plug"),...eY,shellWidth:$4,shellHeight:$4,shellDepth:$4}).strict(),we({kind:he("jst_sh_housing"),...eY,pinCount:Ae().int().min(2).max(15),pitch:he(1)}).strict(),we({kind:he("jst_ph_housing"),...eY,pinCount:Ae().int().min(2).max(16),pitch:he(2)}).strict(),we({kind:he("nema_5_15p"),...eY}).strict(),we({kind:he("iec_c13"),...eY}).strict()]),tPn=ss("kind",[we({kind:he("round_jacket"),diameter:$4,color:Hxn}).strict(),we({kind:he("wire_bundle"),wires:it(we({diameter:$4,color:Hxn}).strict()).min(2),wirePitch:$4}).strict()]),cde=we({standard:t0i,connectorA:J8e,connectorB:J8e,crossSection:tPn}).strict().superRefine((e,t)=>{let{connectorA:n,connectorB:o,crossSection:r}=e,i={usb_c:["usb_c_plug","usb_c_plug"],jst_sh:["jst_sh_housing","jst_sh_housing"],jst_ph:["jst_ph_housing","jst_ph_housing"],us_mains:["nema_5_15p","iec_c13"],bullet:[n.kind,o.kind],adaptercable:[n.kind,o.kind]}[e.standard];if(n.kind!==i[0]||o.kind!==i[1])t.addIssue({code:Vt.custom,message:"Connector kinds must match the cable standard"});if(e.standard==="bullet"){if(!("diameter"in n)||!("diameter"in o)||n.diameter!==o.diameter||"pinCount"in n&&"pinCount"in o&&n.pinCount!==o.pinCount)t.addIssue({code:Vt.custom,message:"Bullet connectors require supported nominal diameters and matching contact counts"});if("pinCount"in n&&(n.pinCount===1&&r.kind!=="round_jacket"||n.pinCount>1&&r.kind!=="wire_bundle"))t.addIssue({code:Vt.custom,message:"Bullet cables require one insulated wire per contact"});for(let s of[n,o])if("diameter"in s&&(s.bodyHeight<=s.diameter||s.pitch<s.bodyHeight||Math.abs(s.bodyWidth-(s.bodyHeight+(s.pinCount-1)*s.pitch))>0.000001||r.kind==="wire_bundle"&&(r.wirePitch!==s.pitch||r.wires.some((a)=>a.diameter>s.bodyHeight))||s.contactDepth>=s.bodyDepth||r.kind==="round_jacket"&&r.diameter>s.bodyHeight))t.addIssue({code:Vt.custom,message:"Bullet contact, body, and wire dimensions must fit"})}else if(e.standard!=="adaptercable"&&(("diameter"in n)||("diameter"in o)))t.addIssue({code:Vt.custom,message:"Bullet connectors require the bullet cable standard"});if(e.standard==="adaptercable"){if("pinCount"in n&&"pinCount"in o&&n.pinCount!==o.pinCount)t.addIssue({code:Vt.custom,message:"Adapter connector pin counts must match"});if("pinCount"in n&&"pinCount"in o&&n.pinCount>1&&r.kind!=="wire_bundle")t.addIssue({code:Vt.custom,message:"Adapter cables require one wire per explicit contact"});for(let s of[n,o])if("diameter"in s&&(s.bodyHeight<=s.diameter||s.pitch<s.bodyHeight||Math.abs(s.bodyWidth-(s.bodyHeight+(s.pinCount-1)*s.pitch))>0.000001||s.contactDepth>=s.bodyDepth||s.pinCount===1&&(r.kind!=="round_jacket"||r.diameter>s.bodyHeight)||s.pinCount>1&&(r.kind!=="wire_bundle"||r.wires.some((a)=>a.diameter>s.bodyHeight))))t.addIssue({code:Vt.custom,message:"Bullet contact, body, and wire dimensions must fit"})}if(r.kind==="wire_bundle"){for(let s of[n,o]){if(!("pinCount"in s)||s.pinCount!==r.wires.length)t.addIssue({code:Vt.custom,message:"Bundle wire count must match each connector pin count"});if("pitch"in s&&r.wires.some((a)=>a.diameter>s.pitch))t.addIssue({code:Vt.custom,message:"Insulated wires must fit each connector pitch"})}if(r.wires.some((s)=>s.diameter>r.wirePitch))t.addIssue({code:Vt.custom,message:"Bundle wires must not overlap in the cross section"})}else if(e.standard==="jst_sh"||e.standard==="jst_ph")t.addIssue({code:Vt.custom,message:"JST cables require a wire bundle"})}),nPn=we({standard:he("adaptercable"),connectorA:J8e,connectorB:J8e,crossSection:tPn.optional()}).strict(),oPn=k().regex(/^#[0-9a-fA-F]{6}$/),qnt={jacketDiameter:Ae().finite().positive().default(4),color:oPn.default("#263449")},n0i=ss("standard",[we({standard:he("bullet"),diameter:yue,pinCount:Ae().int().min(1).max(16).default(1),genderA:kxn.default("male"),genderB:kxn.default("female"),wireDiameter:Ae().finite().positive().default(2),color:oPn.default("#263449")}).strict(),we({standard:he("usb_c"),...qnt}).strict(),we({standard:he("jst_sh"),pinCount:Ae().int().min(2).max(15).default(4),wireDiameter:Ae().finite().min(0.4).max(0.8).default(0.6)}).strict(),we({standard:he("jst_ph"),pinCount:Ae().int().min(2).max(16).default(2),wireDiameter:Ae().finite().min(0.8).max(1.5).default(1.2)}).strict(),we({standard:he("us_mains"),...qnt,jacketDiameter:qnt.jacketDiameter.default(6.2)}).strict(),nPn]),Fxn=["#df4049","#263449","#e1b13c","#347dc9","#27a782","#af62bd"];function rPn(e){let t=nPn.parse({standard:"adaptercable",...e}),{connectorA:n,connectorB:o}=t,r="pinCount"in n&&"pinCount"in o&&n.pinCount>1,i=[n,o].flatMap((a)=>("pitch"in a)?[a.pitch]:[]),s=Math.min(2,...i.map((a)=>a*0.6));return cde.parse({...t,crossSection:t.crossSection??(r?{kind:"wire_bundle",wirePitch:Math.max(...i),wires:Array.from({length:n.pinCount},(a,c)=>({diameter:s,color:Fxn[c%Fxn.length]}))}:{kind:"round_jacket",diameter:Math.min(4,n.bodyHeight,o.bodyHeight,...i.map((a)=>Math.min(2,a*0.6))),color:"#263449"})})}var Pve=["#df4049","#263449","#e1b13c","#347dc9","#27a782","#af62bd"];function BS(e){let t=n0i.parse(e);if(t.standard==="adaptercable")return rPn(t);if(t.standard==="bullet"){let r=t.diameter+2;return cde.parse({standard:"bullet",connectorA:Lxn({diameter:t.diameter,gender:t.genderA,pinCount:t.pinCount,pitch:r}),connectorB:Lxn({diameter:t.diameter,gender:t.genderB,pinCount:t.pinCount,pitch:r}),crossSection:t.pinCount===1?{kind:"round_jacket",diameter:t.wireDiameter,color:t.color}:{kind:"wire_bundle",wirePitch:r,wires:Array.from({length:t.pinCount},(i,s)=>({diameter:t.wireDiameter,color:Pve[s%Pve.length]}))}})}if(t.standard==="usb_c"){let r={kind:"usb_c_plug",bodyWidth:12,bodyHeight:6,bodyDepth:18,shellWidth:8.25,shellHeight:2.4,shellDepth:6.5};return cde.parse({standard:t.standard,connectorA:r,connectorB:{...r},crossSection:{kind:"round_jacket",diameter:t.jacketDiameter,color:t.color}})}if(t.standard==="us_mains")return cde.parse({standard:t.standard,connectorA:{kind:"nema_5_15p",bodyWidth:32,bodyHeight:28,bodyDepth:35},connectorB:{kind:"iec_c13",bodyWidth:24,bodyHeight:18,bodyDepth:30},crossSection:{kind:"round_jacket",diameter:t.jacketDiameter,color:t.color}});let n=t.standard==="jst_sh",o={kind:n?"jst_sh_housing":"jst_ph_housing",pinCount:t.pinCount,pitch:n?1:2,bodyWidth:n?t.pinCount+1:(t.pinCount-1)*2+3.8,bodyHeight:n?2.8:4.5,bodyDepth:n?5:6.85};return cde.parse({standard:t.standard,connectorA:o,connectorB:{...o},crossSection:{kind:"wire_bundle",wirePitch:o.pitch,wires:Array.from({length:t.pinCount},(r,i)=>({diameter:t.wireDiameter,color:Pve[i%Pve.length]}))}})}function zxn(e){let t=e.trim().toLowerCase(),n=/^bullet([1-9][0-9]*)?_(.+)$/.exec(t);if(n){let r,i,s=new Set;for(let a of n[2].split("_")){let c=/^d([0-9]+(?:\.[0-9]+)?)mm$/.exec(a)??/^g(male|female)$/.exec(a),l=a[0];if(!c||s.has(l))throw Error(`Invalid or duplicate connector parameter: "${a}"`);if(s.add(l),l==="d")r=Number(c[1]);else i=c[1]}if(r===void 0||i===void 0)throw Error("Bullet connector strings require dNmm and gmale or gfemale");return BS({standard:"bullet",diameter:yue.parse(r),pinCount:n[1]?Number(n[1]):1,genderA:i}).connectorA}let o=/^(jst_sh|jst_ph)(?:_pins([0-9]+))?$/.exec(t);if(o)return BS({standard:o[1],...o[2]?{pinCount:Number(o[2])}:{}}).connectorA;if(t==="usb_c")return BS({standard:"usb_c"}).connectorA;if(t==="nema_5_15p")return BS({standard:"us_mains"}).connectorA;if(t==="iec_c13")return BS({standard:"us_mains"}).connectorB;throw Error(`Unsupported connector string: "${e}"`)}function o0i(e){let t=e.trim().toLowerCase();if(t.startsWith("adaptercable")){let r=/^adaptercable_(a|b)\(([^()]+)\)_(a|b)\(([^()]+)\)$/.exec(t);if(!r||r[1]===r[3])throw Error("Adapter cables require exactly one named a(CONNECTOR) and b(CONNECTOR)");let i=zxn(r[2]),s=zxn(r[4]);return rPn({connectorA:r[1]==="a"?i:s,connectorB:r[1]==="b"?i:s})}if(t==="usb_c"||t==="us_mains")return BS({standard:t});let n=/^bullet([1-9][0-9]*)?_(.+)$/.exec(t);if(n){let r,i,s,a=new Set;for(let c of n[2].split("_")){let l=/^d([0-9]+(?:\.[0-9]+)?)mm$/.exec(c)??/^(a|b)(male|female)$/.exec(c),h=c[0];if(!l||a.has(h))throw Error(`Invalid or duplicate bullet parameter: "${c}"`);if(a.add(h),h==="d")r=Number(l[1]);else if(h==="a")i=l[2];else s=l[2]}if(r===void 0)throw Error("Bullet cables require dNmm");return BS({standard:"bullet",diameter:yue.parse(r),pinCount:n[1]?Number(n[1]):1,genderA:i??"male",genderB:s??"female"})}let o=/^(jst_sh|jst_ph)(?:_pins([0-9]+))?$/.exec(t);if(o)return BS({standard:o[1],...o[2]?{pinCount:Number(o[2])}:{}});throw Error(`Unsupported cable string: "${e}". Expected usb_c, jst_sh[_pinsN], jst_ph[_pinsN], us_mains, bullet[CONTACTS]_dNmm[_amale][_bfemale], or adaptercable_a(CONNECTOR)_b(CONNECTOR).`)}function r0i(e,t,n,o){let r=e.root.db,i=r.source_port.list().flatMap((h)=>{if(h.source_component_id!==t.source_component_id)return[];let d=r.pcb_port.list().find((p)=>p.source_port_id===h.source_port_id&&p.pcb_component_id===t.pcb_component_id);if(!d)return[];let u=[h.name,...h.port_hints??[]].find((p)=>/^(?:pin)?\d+$/.test(p)),_=h.pin_number??(u?Number(u.replace(/^pin/,"")):void 0);return[{position:d,pin:_}]}),s=i.find(({pin:h})=>h===1)?.position;if(!s||i.length<2)return;let a=i.reduce((h,{position:d})=>({x:h.x+d.x/i.length,y:h.y+d.y/i.length}),{x:0,y:0}),c=rY.vec3.fromValues(s.x-a.x,s.y-a.y,0),l=rY.vec3.normalize(rY.vec3.create(),[o.x,o.y,o.z]);if(rY.vec3.scaleAndAdd(c,c,l,-rY.vec3.dot(c,l)),rY.vec3.length(c)<0.000001)return;return{x:n.x+c[0],y:n.y+c[1],z:n.z+c[2]}}function Oxn(e,t,n){let o=FY(e),r=t.match(/^(.+)\.wireside$/);if(r){let y=o.filter((H)=>H.componentName==="AssemblyMotor"&&H.name===r[1]);if(y.length!==1)throw Error(`assembly.cable "${e.name}" endpoint "${t}" must match exactly one motor in its assembly device`);let x=y[0],C=oJ(x.motorModel.wireConnection);if(!C)throw Error(`assembly.cable "${e.name}" requires motor "${x.name}" to have a JST PH or SH wireConnection, e.g. "jst4_ph" or "jst4_sh", for its connector endpoint`);let b=VSn(x),I=b?{position:b.position,pcbRotation:0,layer:"top"}:OSn(x),v=b?.rotation??zSn(x,I),P=Cy.mat4.create(),M=I.layer==="bottom";Cy.mat4.rotateX(P,P,v.x*Math.PI/180),Cy.mat4.rotateY(P,P,(v.y+(M?180:0))*Math.PI/180),Cy.mat4.rotateZ(P,P,(M?-1:1)*(I.pcbRotation+v.z)*Math.PI/180);let B=x.motorReferencePoints.wireside,T=Cy.vec3.transformMat4(Cy.vec3.create(),[B.direction.x,B.direction.y,B.direction.z],P),N=Cy.vec3.transformMat4(Cy.vec3.create(),[B.position.x,B.position.y,B.position.z],P),D=(C.pinCount-1)*C.pitch/2,L=Cy.vec3.transformMat4(Cy.vec3.create(),[B.direction.y*D,-B.direction.x*D,0],P);return{sourceComponentId:x.source_component_id,position:{x:N[0]+I.position.x+T[0]*C.matingDepth,y:N[1]+I.position.y+T[1]*C.matingDepth,z:N[2]+I.position.z+T[2]*C.matingDepth},pin1Position:{x:N[0]+I.position.x+T[0]*C.matingDepth+L[0],y:N[1]+I.position.y+T[1]*C.matingDepth+L[1],z:N[2]+I.position.z+T[2]*C.matingDepth+L[2]},direction:{x:T[0],y:T[1],z:T[2]},cableInput:{standard:C.standard,pinCount:C.pinCount}}}let i=vot(e),s=oO(Jve(t,e),i,{adapter:yZ}).filter((y)=>o.includes(y));if(s.length!==1)throw Error(`assembly.cable "${e.name}" endpoint "${t}" matched ${s.length} components; expected exactly one in its assembly device`);let a=s[0];if(!(a instanceof bl)||a.componentName!=="Connector"||!a.pcb_component_id||!a.source_component_id)throw Error(`assembly.cable "${e.name}" endpoint "${t}" must name a PCB connector or MOTOR.wireside`);let c=a._parsedProps;if(!n&&c.standard!=="usb_c"&&c.standard!=="jst_sh"&&c.standard!=="jst_ph")throw Error(`assembly.cable "${e.name}" cannot infer endpoint "${t}"; use a connector with standard="usb_c", "jst_sh", or "jst_ph"`);let l=e.root.db.pcb_component.get(a.pcb_component_id),h=a._getBoard(),d=l.layer==="bottom"?"bottom":"top",u=l.cable_insertion_center??l.center,_=Cy.vec3.normalize(Cy.vec3.create(),[u.x-l.center.x,u.y-l.center.y,0]),p=a._getPcbComponentInsertionAxisDirection(d,l.rotation)??(c.standard==="usb_c"&&Cy.vec3.length(_)>0?{x:_[0],y:_[1],z:0}:{x:0,y:0,z:d==="bottom"?-1:1}),m=Math.abs(p.z)>0.5?l.center:u,A=d==="bottom"?-1:1,g=!c.standard&&n?Math.abs(p.z)>0.5?n.bodyDepth:n.bodyHeight/2:Math.abs(p.z)>0.5?c.standard==="jst_ph"?6:c.standard==="jst_sh"?4.25:1.5:c.standard==="usb_c"?1.5:c.standard==="jst_sh"?1.4:2.25,f={x:m.x,y:m.y,z:A*(h.boardThickness/2+g)};return{sourceComponentId:a.source_component_id,position:f,pin1Position:r0i(e,a,f,p),direction:p,cableInput:c.standard==="usb_c"?{standard:"usb_c"}:c.standard==="jst_sh"||c.standard==="jst_ph"?{standard:c.standard,pinCount:c.pinCount}:void 0}}function i0i({from:e,to:t,fromDirection:n,toDirection:o}){let r=Math.hypot(t.x-e.x,t.y-e.y,t.z-e.z);if(r<0.000001)throw Error("Cable wire exits must be at different positions");let i=C9.vec3.fromValues(t.x-e.x,t.y-e.y,t.z-e.z),s=C9.vec3.cross(C9.vec3.create(),i,[n.x,n.y,n.z]);if(C9.vec3.length(s)<0.000001)C9.vec3.cross(s,i,Math.abs(i[2])/r>0.95?[0,1,0]:[0,0,1]);let a=C9.vec3.normalize(C9.vec3.create(),C9.vec3.cross(C9.vec3.create(),s,i)),c=e.z<0&&t.z<0?-1:1;if(a[2]*c<0)C9.vec3.scale(a,a,-1);let l=Math.min(25,Math.max(8,r/3)),h={x:e.x+n.x*l,y:e.y+n.y*l,z:e.z+n.z*l},d={x:t.x+o.x*l,y:t.y+o.y*l,z:t.z+o.z*l},u=[e,{x:e.x+n.x*0.1,y:e.y+n.y*0.1,z:e.z+n.z*0.1}];for(let _=1;_<48;_++){let p=_/48,m=1-p,A=Math.sin(Math.PI*p)**2*Math.min(12,r*0.15);u.push({x:m**3*e.x+3*m**2*p*h.x+3*m*p**2*d.x+p**3*t.x+a[0]*A,y:m**3*e.y+3*m**2*p*h.y+3*m*p**2*d.y+p**3*t.y+a[1]*A,z:m**3*e.z+3*m**2*p*h.z+3*m*p**2*d.z+p**3*t.z+a[2]*A})}return u.push({x:t.x+o.x*0.1,y:t.y+o.y*0.1,z:t.z+o.z*0.1},t),u}var Vxn=(e)=>e.bodyDepth+(e.kind==="usb_c_plug"?e.shellDepth:0);function Yxn(e){let t=e._parsedProps.model,n=t?o0i(t):void 0,o=Oxn(e,e._parsedProps.from,n?.connectorA),r=Oxn(e,e._parsedProps.to,n?.connectorB),i=n??BS(o.cableInput),s=n??BS(r.cableInput);if(o.sourceComponentId===r.sourceComponentId)throw Error(`assembly.cable "${e.name}" must connect two different endpoints`);if(!n&&(i.standard!==s.standard||i.connectorA.kind!==s.connectorA.kind||("pinCount"in i.connectorA)&&("pinCount"in s.connectorA)&&i.connectorA.pinCount!==s.connectorA.pinCount))throw Error(`assembly.cable "${e.name}" endpoints "${e._parsedProps.from}" and "${e._parsedProps.to}" have incompatible connector standards or pin counts`);if(e._parsedProps.standard&&e._parsedProps.standard!==i.standard)throw Error(`assembly.cable "${e.name}" standard="${e._parsedProps.standard}" conflicts with its endpoints`);let a=i,c=(d,u,_)=>{let p=_it.vec3.scaleAndAdd(_it.vec3.create(),[d.x,d.y,d.z],[u.x,u.y,u.z],_);return{x:p[0],y:p[1],z:p[2]}},l=c(o.position,o.direction,Vxn(a.connectorA)),h=c(r.position,r.direction,Vxn(a.connectorB));return{name:e.name,from_source_component_id:o.sourceComponentId,to_source_component_id:r.sourceComponentId,from_connector_pin1_position:o.pin1Position,to_connector_pin1_position:r.pin1Position,cableprinter_string:t??("pinCount"in a.connectorA?`${a.standard}_pins${a.connectorA.pinCount}`:a.standard),path:i0i({from:l,to:h,fromDirection:o.direction,toDirection:r.direction})}}var iPn=class extends nr{cadCableId;get config(){return{componentName:"AssemblyCable",zodProps:cTt}}doInitialCadModelRender(){if(!this.root||this.root.pcbDisabled)return;let e=Yxn(this);this.cadCableId=this.root.db.cad_cable.insert(e).cad_cable_id}updateCadModelRender(){if(!this.root||this.root.pcbDisabled||!this.cadCableId)return;this.root.db.cad_cable.update(this.cadCableId,Yxn(this))}},PA=(e)=>{let t=(n)=>sPn.createElement(e,n);return t.displayName=e,t},sJs={transientsimulation:PA("analogtransientsimulation"),dcoperatingpointsimulation:PA("analogdcoperatingpointsimulation"),dcsweepsimulation:PA("analogdcsweepsimulation"),acsweepsimulation:PA("analogacsweepsimulation"),sweepparameter:PA("analogsweepparameter")},aJs={referencesurface:PA("assembly.referencesurface"),part:PA("assembly.part"),cable:PA("assembly.cable"),printedpart:PA("assembly.printedpart"),motor:PA("assembly.motor"),subassembly:PA("assembly.subassembly"),cadassembly:PA("assembly.cadassembly"),device:PA("assembly.device"),screen:PA("assembly.screen")},Gxn=PA("enclosure.fdm.box"),cJs={cutoutaperture:PA("enclosure.cutoutaperture"),fdm:{box:Gxn,Box:Gxn}},lJs={pcbreturncurrentsimulation:PA("pcbreturncurrentsimulation"),pcbreturncurrentexcitation:PA("pcbreturncurrentexcitation")},s0i=class extends ySn{isRootCircuit=!0;constructor({platform:e,projectUrl:t}={}){super({platform:e,projectUrl:t,cachedSubcircuits:new Map,pendingSubcircuitRenders:new Map});this.root=this}};var aPn=s0i;var X7e=(e,t)=>(n,o)=>{let r=[];if(Array.isArray(t))r.push(...t.flat());else if(typeof t==="object")r.push(...Object.values(t).flat(),...Object.keys(t));let i=(s)=>{if(s?.name&&s.name!==n)throw Error(`Component name mismatch. Hook name: ${n}, Component prop name: ${s.name}`);let a={...o,...s,name:n},c=[];for(let l of r)if(a[l]){let h=`.${n} > .${l}`,d=a[l];c.push({from:h,to:d}),delete a[l]}return LY.jsxs(LY.Fragment,{children:[LY.jsx(e,{...a}),c.map((l,h)=>LY.jsx("trace",{...l},h))]})};for(let s of r)i[s]=`.${n} > .${s}`;return i},pJs=X7e((e)=>cPn.jsx("capacitor",{...e}),WTt);var _Js=X7e((e)=>lPn.jsx("diode",{...e}),rGe),AJs=X7e((e)=>hPn.jsx("led",{...e}),QDt),yJs=X7e((e)=>dPn.jsx("resistor",{...e}),OTt),xJs=new Proxy((e)=>new Proxy({},{get:(t,n)=>`.${e} > .${n}`}),{get:(e,t)=>new Proxy((...o)=>{let r=o[0];return new Proxy({},{get:(i,s)=>`.${t} > .${s}`})},{get:(o,r)=>{if(t==="net")return`net.${r}`;if(t==="subcircuit")return new Proxy({},{get:(i,s)=>new Proxy({},{get:(a,c)=>`subcircuit.${r} > .${s} > .${c}`})});return`.${t} > .${r}`},apply:(o,r,i)=>{if(t==="net")return new Proxy({},{get:(s,a)=>`net.${a}`});return new Proxy({},{get:(s,a)=>{let c=`.${t} > .${a}`;if(["U","J","CN"].some((h)=>t.startsWith(h)))return c;return new Proxy(new String(c),{get:(h,d)=>{if(typeof d==="symbol"||d==="toString")return()=>c;return`.${t} > .${a} > .${d}`}})}})}})});y5n(Uxn);y5n({"assembly.cable":iPn,"assembly.device":FSn,"assembly.motor":YSn,"assembly.part":jSn,"assembly.referencesurface":KSn,"assembly.printedpart":ePn,"assembly.screen":GSn,"assembly.subassembly":dit,"assembly.cadassembly":dit,Bug:Eue,"enclosure.cutoutaperture":Fat,"enclosure.fdm.box":qSn,Fanout:lit,FanoutPoint:kY});/*! Bundled license information:

@tscircuit/bus-lanes-solver/dist/index.js:
  (*! Bundled license information:
  
  svgson/dist/svgson.umd.js:
    (*!
     * Determine if an object is a Buffer
     *
     * @author   Feross Aboukhadijeh <https://feross.org>
     * @license  MIT
     *)
  
  @tscircuit/capacity-autorouter/dist/index.js:
    (*! Bundled license information:
    
    is-buffer/index.js:
      (*!
       * Determine if an object is a Buffer
       *
       * @author   Feross Aboukhadijeh <https://feross.org>
       * @license  MIT
       *)
    
    deep-rename-keys/index.js:
      (*!
       * deep-rename-keys <https://github.com/jonschlinkert/deep-rename-keys>
       *
       * Copyright (c) 2015 Jon Schlinkert, contributors.
       * Licensed under the MIT license.
       *)
    
    @tscircuit/curvy-trace-solver/dist/index.js:
    @tscircuit/find-convex-regions/dist/index.js:
      (*! Bundled license information:
      
      is-buffer/index.js:
        (*!
         * Determine if an object is a Buffer
         *
         * @author   Feross Aboukhadijeh <https://feross.org>
         * @license  MIT
         *)
      
      deep-rename-keys/index.js:
        (*!
         * deep-rename-keys <https://github.com/jonschlinkert/deep-rename-keys>
         *
         * Copyright (c) 2015 Jon Schlinkert, contributors.
         * Licensed under the MIT license.
         *)
      *)
    
    @tscircuit/hypergraph/dist/index.js:
      (*! Bundled license information:
      
      @tscircuit/find-convex-regions/dist/index.js:
        (*! Bundled license information:
        
        is-buffer/index.js:
          (*!
           * Determine if an object is a Buffer
           *
           * @author   Feross Aboukhadijeh <https://feross.org>
           * @license  MIT
           *)
        
        deep-rename-keys/index.js:
          (*!
           * deep-rename-keys <https://github.com/jonschlinkert/deep-rename-keys>
           *
           * Copyright (c) 2015 Jon Schlinkert, contributors.
           * Licensed under the MIT license.
           *)
        *)
      *)
    *)
  *)

@tscircuit/schematic-trace-solver/dist/index.js:
  (*! Bundled license information:
  
  svgson/dist/svgson.umd.js:
    (*!
     * Determine if an object is a Buffer
     *
     * @author   Feross Aboukhadijeh <https://feross.org>
     * @license  MIT
     *)
  *)
*/Ko();Ko();Ko();var b$n=Qe(rn(),1),FB=Qe(rn(),1),QA=Qe(rn(),1),q9=Qe(rn(),1),I$n=Qe(so(),1),S$n=Qe(rn(),1),ote=Qe(rn(),1),E$n=Qe(Y8(),1);var SVn=Qe(c5(),1);var PVn=Qe(c5(),1);var R0e=Qe(c5(),1);var TB=Qe(c5(),1),dP=Qe(c5(),1);var Xda=Qe(c5(),1);var $da=Qe(c5(),1);var vVn=Symbol("Fragment");function Tht(e,t,...n){let o=n.length?n:t?.children!==void 0?[t.children]:[],r=[],i=(Array.isArray(o)?o:[o]).flat(1/0);for(let s of i){if(s==null||s===!1)continue;if(Array.isArray(s))r.push(...s);else r.push(s)}return{type:e,props:(t&&t.children!==void 0?{...t,children:void 0}:t)||{},children:r}}var Qr={moldedPlastic:{metalness:0,roughness:0.7},rubber:{metalness:0,roughness:0.9},sleeve:{metalness:0,roughness:0.45},tinnedLead:{metalness:0.8,roughness:0.55},goldContact:{metalness:1,roughness:0.25},copper:{metalness:1,roughness:0.35},brushedMetal:{metalness:1,roughness:0.4},steel:{metalness:1,roughness:0.25}},Ht=Symbol("Cuboid"),GOn=Symbol("Cube"),Yi=Symbol("Cylinder"),vee=Symbol("Sphere"),yg=Symbol("RoundedCuboid"),ho=Symbol("Translate"),ic=Symbol("Rotate"),S0=Symbol("Union"),Il=Symbol("Subtract"),Oa=Symbol("Hull"),Gn=Symbol("Colorize"),See=Symbol("Polygon"),Pee=Symbol("ExtrudeLinear"),Dy=Symbol("RoundedCylinder"),sd=Symbol("Custom"),Uo=vVn,Pe=(e,t,n)=>Tht(e,t),pn=(e,t,n)=>Tht(e,t);var Dht=({hole:e,isPin1:t})=>{let n=t?"#00ff00":"#b87333";if(e.shape==="circle")return Pe(Gn,{color:n,material:Qr.copper,children:Pe(ho,{offset:[e.x,e.y,-0.005],children:pn(Il,{children:[Pe(Yi,{radius:e.outer_diameter/2,height:0.01}),Pe(Yi,{radius:e.hole_diameter/2,height:0.01})]})})});if(e.shape==="circular_hole_with_rect_pad")return Pe(Gn,{color:n,material:Qr.copper,children:Pe(ho,{offset:[e.x,e.y,0],children:pn(Il,{children:[Pe(Ht,{size:[e.rect_pad_width,e.rect_pad_height,0.01],center:[0,0,0]}),Pe(Yi,{radius:e.hole_diameter/2,height:0.01})]})})});if(e.shape==="pill"){let{outer_width:o,outer_height:r}=e,i=Math.min(o,r)/2,s=o>r,a=e.hole_width??0.8,c=e.hole_height??0.8;return Pe(Gn,{color:n,material:Qr.copper,children:Pe(ho,{offset:[e.x,e.y,0],children:pn(Il,{children:[pn(Oa,{children:[Pe(Yi,{radius:i,height:0.01,center:[s?-(o/2-i):0,s?0:-(r/2-i),0]}),Pe(Yi,{radius:i,height:0.01,center:[s?o/2-i:0,s?0:r/2-i,0]})]}),a===c?Pe(Yi,{radius:a/2,height:0.01}):pn(Oa,{children:[Pe(Yi,{radius:Math.min(a,c)/2,height:0.01,center:[a>c?-(a/2-c/2):0,a>c?0:-(c/2-a/2),0]}),Pe(Yi,{radius:Math.min(a,c)/2,height:0.01,center:[a>c?a/2-c/2:0,a>c?0:c/2-a/2,0]})]})]})})})}throw Error("Shape not supported: "+e.shape)};function _u(e){return e}var VIi=class{models=new Map;register(e){if(typeof e.name!=="string"||!/^[a-z]+$/.test(e.name))throw Error("Model renderer names must contain only lowercase letters");if(this.models.has(e.name))throw Error(`Model renderer "${e.name}" is already registered`);if(e.pads!=="none"&&e.pads!=="footprinter")throw Error('Model renderer pads must be "none" or "footprinter"');let{name:t,schema:n,render:o,pads:r}=e;this.models.set(t,{name:t,schema:n,pads:r,render:(i)=>{if(!i||i.fn!==t)throw Error(`Renderer for "${t}" requires a model with fn "${t}"`);return o(i)}})}get(e){return this.models.get(e)}getModelNames(){return[...this.models.keys()]}render(e){return this.models.get(e.fn)?.render(e)}};function gu(e){let t=[];for(let n=0;n<e.indices.length;n+=3)t.push(e.indices.slice(n,n+3).map((o)=>[e.positions[o*3],e.positions[o*3+1],e.positions[o*3+2]]));return SVn.default.geometries.geom3.fromPoints(t)}function YIi(e={},t={}){let n=U0n(e),o=GIi(t.segments);UIi([n.outerDiameter,n.boreRadius,n.width,n.outerRadius-n.boreRadius,n.ballRadius]);let{rimChamfer:r,midZ:i,grooveHalfWidth:s}=n,a=[[n.innerRaceOuterRadius-r,0],[n.innerRaceOuterRadius,r]];for(let h=0;h<=24;h++){let d=i-s+2*s*h/24;a.push([n.pitchRadius-Math.sqrt(Math.max(0,n.grooveRadius**2-(d-i)**2)),d])}a.push([n.innerRaceOuterRadius,n.width-r],[n.innerRaceOuterRadius-r,n.width],[n.boreRadius+r,n.width],[n.boreRadius,n.width-r],[n.boreRadius,r],[n.boreRadius+r,0]);let c=[[n.outerRadius-r,0],[n.outerRadius,r],[n.outerRadius,n.width-r],[n.outerRadius-r,n.width],[n.outerRaceInnerRadius+r,n.width],[n.outerRaceInnerRadius,n.width-r]];for(let h=0;h<=24;h++){let d=i+s-2*s*h/24;c.push([n.pitchRadius+Math.sqrt(Math.max(0,n.grooveRadius**2-(d-i)**2)),d])}c.push([n.outerRaceInnerRadius,r],[n.outerRaceInnerRadius+r,0]);let l=[{name:"inner race",color:"#9da4ac",mesh:tPe(a,o)},{name:"outer race",color:"#9da4ac",mesh:tPe(c,o)}];for(let h=0;h<n.ballCount;h++){let d=h*Math.PI*2/n.ballCount,u=[n.pitchRadius*Math.cos(d),n.pitchRadius*Math.sin(d),i];l.push({name:`ball ${h+1}`,color:"#d5d9df",mesh:XIi(u,n.ballRadius),center:u,radius:n.ballRadius});let _=(h+0.5)*Math.PI*2/n.ballCount;l.push({name:`cage separator ${h+1}`,color:"#b89b58",mesh:WIi(n.cageInnerRadius,n.cageOuterRadius,i-1.1*n.ballRadius,i+1.1*n.ballRadius,_-n.cageSeparatorHalfAngle,_+n.cageSeparatorHalfAngle,o)})}for(let h of[-1,1]){let d=i+(h===-1?-1.25:1.1)*n.ballRadius,u=i+(h===-1?-1.1:1.25)*n.ballRadius;l.push({name:`cage ${h<0?"lower":"upper"} band`,color:"#b89b58",mesh:tPe([[n.cageOuterRadius,d],[n.cageOuterRadius,u],[n.cageInnerRadius,u],[n.cageInnerRadius,d]],o)})}for(let h of[-1,1]){let d=h<0?n.bottomSideShielded?"shielded":n.bottomSideSealed?"sealed":"open":n.topSideShielded?"shielded":n.topSideSealed?"sealed":"open";if(d==="open")continue;let{closureThickness:u,innerRaceOuterRadius:_,outerRaceInnerRadius:p}=n,m=d==="shielded"?[[p,0],[p,u*0.45],[_,u*0.45],[_,0]]:[[p,0],[p,u],[_,u],[_,0],[_+0.15*(p-_),0.5*u],[p-0.15*(p-_),0.5*u]],A=h===-1?m:m.map(([g,f])=>[g,n.width-f]).reverse();l.push({name:`${d} ${h<0?"lower":"upper"}`,color:d==="sealed"?"#252a30":"#b5bbc3",mesh:tPe(A,o)})}return{...jIi(l),parts:l}}function GIi(e=96){if(!Number.isInteger(e)||e<96||e>192||e%24!==0)throw Error("Segments must be a multiple of 24 from 96 to 192");return e}function UIi(e){let t=Math.max(...e);if(!e.every(Number.isFinite)||t>1e6||Math.min(...e)<Math.max(0.00001,t*0.0000001))throw Error("Bearing dimensions exceed the renderer's numerical resolution")}function tPe(e,t){let n=[],o=[];for(let[r,i]of e)for(let s=0;s<t;s++){let a=s*Math.PI*2/t,c=typeof r==="number"?r:r(a);n.push(c*Math.cos(a),c*Math.sin(a),i)}for(let r=0;r<e.length;r++)for(let i=0;i<t;i++){let s=r*t+i,a=r*t+(i+1)%t,c=(r+1)%e.length*t+(i+1)%t,l=(r+1)%e.length*t+i;o.push(s,a,c,s,c,l)}return{positions:n,indices:o}}function WIi(e,t,n,o,r,i,s){let a=Math.max(2,Math.ceil((i-r)/(2*Math.PI)*s)),c=a+1,l=[[t,n],[t,o],[e,o],[e,n]],h=[],d=[];for(let[A,g]of l)for(let f=0;f<=a;f++){let y=r+(i-r)*f/a;h.push(A*Math.cos(y),A*Math.sin(y),g)}for(let A=0;A<4;A++)for(let g=0;g<a;g++){let f=A*c+g,y=f+1,x=(A+1)%4*c+g+1,C=(A+1)%4*c+g;d.push(f,y,x,f,x,C)}d.push(0,c,2*c,0,2*c,3*c);let u=a,_=c+a,p=2*c+a,m=3*c+a;return d.push(u,p,_,u,m,p),{positions:h,indices:d}}function XIi(e,t){let r=[e[0],e[1],e[2]+t],i=[];for(let a=1;a<12;a++){let c=a*Math.PI/12;for(let l=0;l<24;l++){let h=l*Math.PI*2/24;r.push(e[0]+t*Math.sin(c)*Math.cos(h),e[1]+t*Math.sin(c)*Math.sin(h),e[2]+t*Math.cos(c))}}let s=r.length/3;r.push(e[0],e[1],e[2]-t);for(let a=0;a<24;a++){let c=(a+1)%24;i.push(0,1+a,1+c);for(let h=0;h<10;h++){let d=1+h*24+a,u=1+(h+1)*24+a,_=1+(h+1)*24+c,p=1+h*24+c;i.push(d,u,_,d,_,p)}let l=241;i.push(s,l+c,l+a)}return{positions:r,indices:i}}function jIi(e){let t=[],n=[];for(let{mesh:o}of e){let r=t.length/3;t.push(...o.positions),n.push(...o.indices.map((i)=>i+r))}return{positions:t,indices:n}}function KIi({color:e,...t}){let{parts:n}=YIi(t);return Pe(Uo,{children:n.map((o)=>Pe(Gn,{color:e??o.color,children:Pe(sd,{geometry:gu(o.mesh)})},o.name))})}var $Ii=_u({name:"ballbearing",schema:SIe,render:({fn:e,...t})=>Pe(KIi,{...t}),pads:"none"});function qIi(e){e.register($Ii)}function JIi(e){let t=e.radialSegments??96,n=e.segmentsPerPitch??32;if(!Number.isInteger(t)||t<24||t>192||t%12!==0||!Number.isInteger(n)||n<8||n>64)throw Error("Mesh resolution limit: radial segments must be a multiple of 12 in [24,192], pitch segments an integer in [8,64]");return{radial:t,axial:n}}function ZIi(e){let t=[],n=[];return{positions:t,indices:n,ring:(s,a)=>{let c=t.length/3;for(let l=0;l<e;l++){let h=l*2*Math.PI/e,d=a(h);t.push(d*Math.cos(h),d*Math.sin(h),s)}return c},connect:(s,a)=>{for(let c=0;c<e;c++){let l=(c+1)%e;n.push(s+c,s+l,a+l,s+c,a+l,a+c)}},cap:(s,a,c)=>{let l=t.length/3;t.push(0,0,a);for(let h=0;h<e;h++){let d=(h+1)%e;n.push(l,s+(c?h:d),s+(c?d:h))}}}}function UOn(e,t){let n=Math.PI/3,o=((e-Math.PI/2+n/2)%n+n)%n-n/2;return t/2/Math.cos(o)}function e9i(e,t,n,o=1){let r=((e/n-o*t/(2*Math.PI))%1+1)%1;return Math.min(r,1-r)}function t9i(e,t={}){let n=Ret.parse(e),o=q0n(e),{radial:r,axial:i}=JIi(t),s=Math.max(2,Math.ceil(n.length/o.threadPitch*i));if(s>24000||!Number.isFinite(s))throw Error("Mesh resolution limit: too many thread turns");let a=ZIi(r),c=o.diameter/2,l=(o.diameter-o.threadMinorDiameter)/2,h=o.underHeadRadius,d=new Set(n.showThreads?Array.from({length:s+1},(m,A)=>-n.length+n.length*A/s):[-n.length,0]);d.add(-n.length+o.tipChamfer),d.add(-o.threadPitch);for(let m=0;m<=16;m++)d.add(-h+h*Math.sin(m*Math.PI/32));let u=-1,_=[...d].sort((m,A)=>m-A).filter((m,A,g)=>A===0||m-g[A-1]>0.0000000001);for(let m of _){let A=a.ring(m,(g)=>{let f=m>=-h?c+h-Math.sqrt(Math.max(0,h**2-(m+h)**2)):c,y=Math.min(l,Math.max(0,(e9i(m+n.length,g,o.threadPitch)-0.0625)*o.threadPitch*Math.sqrt(3))),x=f-(n.showThreads?y*Math.min(1,-m/o.threadPitch):0),C=m+n.length<o.tipChamfer?c-(o.tipChamfer-(m+n.length)):1/0;return Math.min(x,C)});if(u<0)a.cap(A,m,!1);else a.connect(u,A);u=A}let p=(m,A)=>{let g=a.ring(m,A);a.connect(u,g),u=g};p(0,()=>o.headDiameter/2);for(let m=1;m<=24;m++){let A=o.headHeight*m/24;p(A,()=>o.crownArcCenterR+Math.sqrt(Math.max(0,o.crownRadius**2-(A-o.crownArcCenterZ)**2)))}return p(o.topZ,(m)=>UOn(m,o.socketWidth)),p(o.topZ-o.socketDepth,(m)=>UOn(m,o.socketWidth)),a.cap(u,o.topZ-o.socketDepth,!0),{positions:a.positions,indices:a.indices}}function n9i(e,t){return gu(t9i(e,t))}function o9i({color:e="#737e8f",...t}){return Pe(Gn,{color:e,children:Pe(sd,{geometry:n9i(t)})})}var r9i=_u({name:"buttonscrew",schema:PIe,render:({fn:e,...t})=>Pe(o9i,{...t}),pads:"none"});function i9i(e){e.register(r9i)}function s9i(e,t={}){let n=Qet.parse(e),o=tpn(n),r=n.innerDiameter/2,i=o.grooveRootDiameter/2,s=n.outerDiameter/2,a=t.radialSegments??96;if(!Number.isInteger(a)||a<12||a>4096||a%4!==0)throw Error("Grommet radial segments must be a multiple of four in [12,4096]");let c=Math.acos((r+i)/(2*i)),l=Math.max(a,4*Math.ceil(Math.PI/c/4));if(!Number.isFinite(l)||l>4096)throw Error("Grommet wall exceeds mesh resolution limit (4096 segments)");let h=[[r,-n.height/2],[s,-n.height/2],[s,o.grooveStartZ],[i,o.grooveStartZ],[i,o.grooveEndZ],[s,o.grooveEndZ],[s,n.height/2],[r,n.height/2]],d=[],u=[];for(let[_,p]of h)for(let m=0;m<l;m++){let A=m*2*Math.PI/l;d.push(_*Math.cos(A),_*Math.sin(A),p)}for(let _=0;_<h.length;_++){let p=_*l,m=(_+1)%h.length*l;for(let A=0;A<l;A++){let g=(A+1)%l;u.push(p+A,p+g,m+g,p+A,m+g,m+A)}}return{positions:d,indices:u}}function a9i(e){return gu(s9i(e))}function c9i({color:e="#343943",...t}){return Pe(Gn,{color:e,children:Pe(sd,{geometry:a9i(t)})})}var l9i=_u({name:"cablegrommet",schema:EIe,render:({fn:e,...t})=>Pe(c9i,{...t}),pads:"none"});function h9i(e){e.register(l9i)}var BB=64,EVn=24,MVn=12;function cPe(e){let t=0;for(let n of e){let o=n.threadPitch?Math.ceil(n.depth/n.threadPitch*MVn):1;if(!Number.isFinite(o)||o>768)throw Error("Shaft mount exceeds mesh resolution limit (64 thread turns per hole)");t+=(o+1)*EVn*2}if(t>1e5)throw Error("Shaft mount exceeds total mesh resolution limit")}function Nht({outerRadius:e,boreARadius:t,boreBRadius:n=t,length:o,chamfer:r,stepZ:i=o/2}){let s=Math.PI/BB,a=Math.cos(s);if((Math.max(t,n)+r)/a>=(e-r)*a-0.000001)throw Error("Shaft mount wall/chamfer ligament exceeds mesh resolution limit");let c=[[0,e-r,!1],[r,e,!1],[o-r,e,!1],[o,e-r,!1],[o,n+r,!0],[o-r,n,!0],[i,n,!0],[i,t,!0],[r,t,!0],[0,t+r,!0]],l=c.filter(([u,_],p)=>p===0||u!==c[p-1][0]||_!==c[p-1][1]),h=[],d=[];for(let[u,_,p]of l)for(let m=0;m<BB;m++){let A=(m+(p?0.5:0))*Math.PI*2/BB,g=p?_/a:_;h.push(g*Math.cos(A),g*Math.sin(A),u)}for(let u=0;u<l.length;u++)for(let _=0;_<BB;_++){let p=(_+1)%BB,m=u*BB+_,A=u*BB+p,g=(u+1)%l.length*BB+p,f=(u+1)%l.length*BB+_;d.push(m,A,g,m,g,f)}return gu({positions:h,indices:d})}function aPe(e){cPe([e]);let t=e.threadPitch,n=t?Math.max(2,Math.ceil(e.depth/t*MVn)):1,o=t?EVn:48,r=0.0001,i=e.diameter/2,s=t?Math.min(t*0.541266,i*0.8):0,a=e.threadHand==="left"?-1:1,c=[],l=[],[h,d,u]=e.direction;if(Math.abs(u)>0.0000000001||Math.abs(Math.hypot(h,d)-1)>0.0000000001)throw Error("Expected a horizontal unit hole axis");let _=(p,m,A)=>{c.push(e.start[0]+m*d+A*h,e.start[1]-m*h+A*d,e.start[2]+p)};for(let p=0;p<=n;p++){let m=-r+(e.depth+2*r)*p/n;for(let A=0;A<o;A++){let g=A*Math.PI*2/o,f=t?((m/t-a*g/(Math.PI*2))%1+1)%1:0,y=Math.min(f,1-f),x=i-Math.min(s,Math.max(0,(y-0.125)*(t??0)*Math.sqrt(3)));_(x*Math.cos(g),x*Math.sin(g),m)}}for(let p=0;p<n;p++)for(let m=0;m<o;m++){let A=(m+1)%o,g=p*o+m,f=p*o+A,y=(p+1)*o+A,x=(p+1)*o+m;l.push(g,f,y,g,y,x)}for(let p of[0,n]){let m=c.length/3;_(0,0,p===0?-r:e.depth+r);for(let A=0;A<o;A++){let g=p*o+A,f=p*o+(A+1)%o;l.push(m,p===0?f:g,p===0?g:f)}}return gu({positions:c,indices:l})}function Rht(e,...t){let o=[e,...t].map((i)=>R0e.default.transforms.scale([100,100,100],i)),r=R0e.default.booleans.subtract(o[0],...o.slice(1));return R0e.default.transforms.scale([0.01,0.01,0.01],r)}function Qht(e){let t=[],n=new Map,o=0.000001,r=(p)=>{let m=p.map((f)=>Math.floor(f/0.000001));for(let f=-1;f<=1;f++)for(let y=-1;y<=1;y++)for(let x=-1;x<=1;x++){let C=n.get([m[0]+f,m[1]+y,m[2]+x].join(","))??[];for(let b of C)if(Math.hypot(...p.map((I,v)=>I-t[b*3+v]))<0.000001)return b}let A=t.length/3;t.push(...p);let g=m.join(",");return n.set(g,[...n.get(g)??[],A]),A},i=R0e.default.geometries.geom3.toPolygons(e).map((p)=>p.vertices.map(r).filter((m,A,g)=>m!==g[(A+g.length-1)%g.length])).map((p)=>[...new Set(p)]).filter((p)=>p.length>=3).filter((p)=>{let m=0,A=[],g=[];for(let f=0;f<p.length;f++)for(let y=f+1;y<p.length;y++){let x=t.slice(p[f]*3,p[f]*3+3),C=t.slice(p[y]*3,p[y]*3+3).map((I,v)=>I-x[v]),b=C.reduce((I,v)=>I+v*v,0);if(b>m)m=b,A=x,g=C}return p.some((f)=>{let y=t.slice(f*3,f*3+3).map((C,b)=>C-A[b]),x=y.reduce((C,b,I)=>C+b*g[I],0)/m;return Math.hypot(...y.map((C,b)=>C-x*g[b]))>=0.000001})}),s=(p,m)=>`${Math.min(p,m)},${Math.max(p,m)}`,a=new Map;for(let p of i)for(let m=0;m<p.length;m++){let A=p[m],g=p[(m+1)%p.length],f=s(A,g),y=a.get(f)??{a:A,b:g,count:0};y.count++,a.set(f,y)}let c=[...a.values()].filter((p)=>p.count===1),l=[...new Set(c.flatMap((p)=>[p.a,p.b]))],h=new Map;for(let{a:p,b:m}of c){let A=t.slice(p*3,p*3+3),g=t.slice(m*3,m*3+3).map((x,C)=>x-A[C]),f=g.reduce((x,C)=>x+C*C,0),y=[];for(let x of l){if(x===p||x===m)continue;let C=t.slice(x*3,x*3+3).map((v,P)=>v-A[P]),b=C.reduce((v,P,M)=>v+P*g[M],0)/f;if(b<=0||b>=1)continue;if(Math.hypot(...C.map((v,P)=>v-b*g[P]))<0.000001)y.push({id:x,t:b})}y.sort((x,C)=>x.t-C.t),h.set(`${p},${m}`,y.map((x)=>x.id)),h.set(`${m},${p}`,y.map((x)=>x.id).reverse())}let d=[];for(let p of i){let m=p.flatMap((f,y)=>[f,...(h.get(`${f},${p[(y+1)%p.length]}`)??[]).filter((x)=>!p.includes(x))]),A=m.filter((f,y)=>f!==m[(y+m.length-1)%m.length]);if(A.length===3){d.push(...A);continue}let g=t.length/3;t.push(...[0,1,2].map((f)=>A.reduce((y,x)=>y+t[x*3+f],0)/A.length));for(let f=0;f<A.length;f++)d.push(g,A[f],A[(f+1)%A.length])}let u=[],_=new Map;return{positions:u,indices:d.map((p)=>{let m=_.get(p);if(m===void 0)m=u.length/3,_.set(p,m),u.push(...t.slice(p*3,p*3+3));return m})}}function d9i(e){let t=Let.parse(e),n=spn(t);cPe([n.threadedHole]);let o=Nht({outerRadius:t.outerDiameter/2,boreARadius:t.boreDiameter/2,length:t.width,chamfer:t.chamfer}),r=n.split,i=0.0001,s=PVn.default.primitives.cuboid({size:[r.xMax-r.xMin+i,r.yMax-r.yMin,r.zMax-r.zMin+2*i],center:[(r.xMax+r.xMin+i)/2,(r.yMax+r.yMin)/2,(r.zMax+r.zMin)/2]});return Qht(Rht(o,s,aPe(n.clearanceHole),aPe(n.threadedHole)))}function u9i(e){return gu(d9i(e))}function p9i({color:e="#737e8f",...t}){return Pe(Gn,{color:e,children:Pe(sd,{geometry:u9i(t)})})}var m9i=_u({name:"clampingshaftcollar",schema:MIe,render:({fn:e,...t})=>Pe(p9i,{...t}),pads:"none"});function _9i(e){e.register(m9i)}function g9i(e,t,n){let o=[],r=32*Number.EPSILON*(n-t);for(let m=0;m<e.positions.length/3;m++)o.push({key:`v${m}`,coordinates:[e.positions[m*3],e.positions[m*3+1],Math.abs(e.positions[m*3+2]-t)<=r?t:Math.abs(e.positions[m*3+2]-n)<=r?n:e.positions[m*3+2]]});let i=new Map,s=(m,A,g)=>{if(m.coordinates[2]===g)return m;if(A.coordinates[2]===g)return A;let[f,y]=m.key<A.key?[m,A]:[A,m],x=`${g}:${f.key}:${y.key}`,C=i.get(x);if(!C){let b=(g-f.coordinates[2])/(y.coordinates[2]-f.coordinates[2]);C={key:x,coordinates:[f.coordinates[0]+b*(y.coordinates[0]-f.coordinates[0]),f.coordinates[1]+b*(y.coordinates[1]-f.coordinates[1]),g]},i.set(x,C)}return C},a=(m,A,g)=>{let f=[],y=(x)=>g?x.coordinates[2]>=A:x.coordinates[2]<=A;for(let x=0;x<m.length;x++){let C=m[x],b=m[(x+1)%m.length];if(y(C))f.push(C);if(y(C)!==y(b))f.push(s(C,b,A))}return f.filter((x,C)=>x.key!==f[(C+f.length-1)%f.length]?.key)},c=[],l=[],h=new Map,d=(m)=>{let A=h.get(m.key);if(A===void 0)A=c.length/3,c.push(...m.coordinates),h.set(m.key,A);return A};for(let m=0;m<e.indices.length;m+=3){let A=e.indices.slice(m,m+3).map((f)=>o[f]),g=a(a(A,t,!0),n,!1);for(let f=1;f+1<g.length;f++){let y=[g[0],g[f],g[f+1]];if(new Set(y.map((x)=>x.key)).size===3)l.push(...y.map(d))}}let u=new Map;for(let m=0;m<l.length;m+=3)for(let A=0;A<3;A++){let g=l[m+A],f=l[m+(A+1)%3],y=`${Math.min(g,f)},${Math.max(g,f)}`,x=u.get(y);if(x)x.count++;else u.set(y,{from:g,to:f,count:1})}let _=[...u.values()].filter((m)=>m.count===1),p=new Map(_.map(({from:m,to:A})=>[m,A]));if(p.size!==_.length)throw Error("Ground clipping produced an ambiguous boundary");while(p.size>0){let m=p.keys().next().value,A=[],g=m;do{A.push(g);let C=p.get(g);if(C===void 0)throw Error("Ground clipping produced an open boundary");p.delete(g),g=C}while(g!==m);let f=c[3*m+2];if(f!==t&&f!==n||A.some((C)=>c[3*C+2]!==f))throw Error("Ground clipping boundary must lie on an end plane");let y=A.flatMap((C)=>[c[3*C],c[3*C+1]]),x=jI(y);for(let C=0;C<x.length;C+=3){let b=A[x[C]],I=A[x[C+1]],v=A[x[C+2]],P=(c[I*3]-c[b*3])*(c[v*3+1]-c[b*3+1])-(c[I*3+1]-c[b*3+1])*(c[v*3]-c[b*3]);if(f===t&&P>0||f===n&&P<0)[I,v]=[v,I];l.push(b,I,v)}}return{positions:c,indices:l}}function A9i(e,t={}){let n=wIe.parse(e),o=dpn(n),r=t.segmentsPerTurn??64,i=t.wireSegments??24;for(let[u,_,p,m]of[["segmentsPerTurn",r,16,256],["wireSegments",i,8,64]])if(!Number.isInteger(_)||_<p||_>m||_%4!==0)throw Error(`${u} must be a multiple of four in [${p},${m}]`);let s=n.totalTurns*r;if(!Number.isSafeInteger(s)||(s+1)*i>250000)throw Error("Spring exceeds mesh resolution limit (250000 vertices)");let a=Math.max(n.outerDiameter,n.freeLength);if(o.activePitch-n.wireDiameter<=a*0.0000000001||n.wireDiameter<=a*0.0000000001||o.insideDiameter<=a*0.0000000001)throw Error("Spring clearance exceeds mesh resolution limit");let c=[],l=[],h=n.wireDiameter/2;for(let u=0;u<=s;u++){let _=upn(n,u/r),p=Math.hypot(_.x,_.y);for(let m=0;m<i;m++){let A=m*2*Math.PI/i,g=m===i/4||m===3*i/4?0:Math.cos(A),f=m===0||m===i/2?0:Math.sin(A),y=h*g;c.push(_.x+y*_.x/p,_.y+y*_.y/p,_.z+h*f)}}let d=(u,_,p)=>{if(n.hand==="left")l.push(u,p,_);else l.push(u,_,p)};for(let u=0;u<s;u++)for(let _=0;_<i;_++){let p=(_+1)%i,m=u*i,A=(u+1)*i;d(m+_,A+_,A+p),d(m+_,A+p,m+p)}for(let u=1;u+1<i;u++){d(0,u,u+1);let _=s*i;d(_,_+u+1,_+u)}return g9i({positions:c,indices:l},o.lowerBearingZ,o.upperBearingZ)}function f9i(e){return gu(A9i(e))}function y9i({color:e="#737e8f",...t}){return Pe(Gn,{color:e,children:Pe(sd,{geometry:f9i(t)})})}var x9i=_u({name:"compressionspring",schema:BIe,render:({fn:e,...t})=>Pe(y9i,{...t}),pads:"none"});function C9i(e){e.register(x9i)}function b9i(e){let t=Het.parse(e),n=gpn(t),o=n.innerDiameter/2,r=n.outerDiameter/2,i=n.flangeDiameter/2,s=[[i,0],[i,n.shoulderZ],[r,n.shoulderZ],[r,n.length],[o,n.length],[o,0]],a=96,c=[],l=[];for(let[h,d]of s)for(let u=0;u<96;u++){let _=u*Math.PI*2/96;c.push(h*Math.cos(_),h*Math.sin(_),d)}for(let h=0;h<s.length;h++){let d=h*96,u=(h+1)%s.length*96;for(let _=0;_<96;_++){let p=(_+1)%96;l.push(d+_,d+p,u+p,d+_,u+p,u+_)}}return{positions:c,indices:l}}function I9i(e){return gu(b9i(e))}function v9i({color:e="#a18450",...t}){return Pe(Gn,{color:e,children:Pe(sd,{geometry:I9i(t)})})}var S9i=_u({name:"flangedbushing",schema:TIe,render:({fn:e,...t})=>Pe(v9i,{...t}),pads:"none"});function P9i(e){e.register(S9i)}function E9i(e,t={}){let n=xpn.parse(e),o=t.radialSegments??96,r=t.threadStepsPerTurn??24;if(!Number.isInteger(o)||o<24||o>192||o%24!==0||!Number.isInteger(r)||r<24||r>96)throw Error("Screw mesh resolution requires 24..192 radial segments divisible by 24 and 24..96 thread steps");let i=[],s=[],a=new Map,c=(v,P,M)=>{let B=[v,P,M].map((D)=>Math.round(D*10000000000)).join(":"),T=a.get(B);if(T!==void 0)return T;let N=i.length/3;return i.push(v,P,M),a.set(B,N),N},l=(v,P,M)=>{if(v===P||P===M||M===v)return;let B=(O)=>i.slice(3*O,3*O+3),T=B(v),N=B(P),D=B(M),L=N.map((O,U)=>O-T[U]),H=D.map((O,U)=>O-T[U]);if(Math.hypot(L[1]*H[2]-L[2]*H[1],L[2]*H[0]-L[0]*H[2],L[0]*H[1]-L[1]*H[0])>0.000000000001)s.push(v,P,M)},h=(v,P)=>Array.from({length:o},(M,B)=>{let T=B*2*Math.PI/o,N=v(T);return c(N*Math.cos(T),N*Math.sin(T),typeof P==="number"?P:P(T))}),d=(v,P)=>{for(let M=0;M<o;M++){let B=(M+1)%o;l(v[M],v[B],P[B]),l(v[M],P[B],P[M])}},u=(v,P,M)=>{let B=c(0,0,P);for(let T=0;T<o;T++){let N=(T+1)%o;M?l(B,v[T],v[N]):l(B,v[N],v[T])}},_=[],p=(v,P)=>{let M=h(v,P);if(_.length)d(_,M);return _=M,M},m=n.diameter/2,A=n.threadRootDiameter/2,g=n.threadPitch,f=-n.headHeight-n.underHeadRadius*(Math.sqrt(2)-1),y=n.showThreads?Math.ceil((f+n.length)/g*r):1;if((y+100)*o>400000)throw Error("Screw exceeds mesh resolution limit");let x=new Set([-n.length,-n.length+n.tipChamfer,f]);if(n.showThreads)for(let v=0;v<=y;v++)x.add(-n.length+(f+n.length)*v/y);for(let v of[...x].sort((P,M)=>P-M)){let P=p((M)=>{let B=(((v+n.length)/g-(n.threadHand==="right"?1:-1)*M/(2*Math.PI))%1+1)%1,T=Math.min(B,1-B),N=Math.min(m-A,Math.max(0,(T-0.0625)*g*Math.sqrt(3))),D=n.showThreads?m-N:m;return Math.min(D,m-Math.max(0,n.tipChamfer-(v+n.length)))},v);if(v===-n.length)u(P,v,!1)}p(()=>m,f);let C=m+n.underHeadRadius,b=f;for(let v=1;v<=16;v++){let P=Math.PI-(Math.PI-3*Math.PI/4)*v/16;p(()=>C+n.underHeadRadius*Math.cos(P),b+n.underHeadRadius*Math.sin(P))}let I=(v)=>n.socketAcrossFlats/2/Math.max(Math.abs(Math.sin(v)),Math.abs(Math.sin(v+2*Math.PI/3)),Math.abs(Math.sin(v+4*Math.PI/3)));return p(()=>n.headDiameter/2,0),p(I,0),p(I,-n.socketDepth),u(_,-n.socketDepth,!0),{positions:i,indices:s}}function M9i(e,t){return gu(E9i(e,t))}function w9i({color:e="#737e8f",...t}){return Pe(Gn,{color:e,children:Pe(sd,{geometry:M9i(t)})})}var B9i=_u({name:"flatheadscrew",schema:DIe,render:({fn:e,...t})=>Pe(w9i,{...t}),pads:"none"});function T9i(e){e.register(B9i)}var wVn=({width:e=30,height:t=22,thickness:n=1,bezelInset:o=2,bezelDepth:r=1,screenColor:i="#001414",bezelColor:s="#0f1116",screenWidth:a,screenHeight:c,offset:l})=>{let h=e,d=t,u=Math.max(n,0.4),_=Math.max(Math.min(r,u),0.2),p=Math.max(u-_,0),m=Math.max(o,0),A=Math.max(a??h-m*2,2),g=Math.max(c??d-m*2,2),f=Math.min(Math.max(_*0.6,0.2),_),y=l?.x??0,x=l?.y??0,C=l?.z??0;return pn(ho,{offset:{x:y,y:x,z:C},children:[p>0&&Pe(Gn,{color:s,children:Pe(Ht,{size:[h,d,p],offset:[0,0,p/2]})}),Pe(Gn,{color:s,children:pn(Il,{children:[Pe(Ht,{size:[h,d,_],offset:[0,0,p+_/2]}),Pe(Ht,{size:[A,g,_+0.02],offset:[0,0,p+_/2]})]})}),Pe(Gn,{color:i,children:Pe(Ht,{size:[A,g,f],offset:[0,0,p+f/2]})})]})},D9i=1.7777777777777777,N9i=40,uP=0.000001,Pm=(e,t)=>{if(!Number.isFinite(t)||t<=0)throw Error(`${e} must be a finite number greater than zero`)},R9i=(e)=>{if(e===void 0)return D9i;if(typeof e==="number")return Pm("aspectRatio",e),e;if(typeof e!=="string"){let[r,i]=e;return Pm("aspectRatio width",r),Pm("aspectRatio height",i),r/i}let t=e.split(":");if(t.length!==2)throw Error('aspectRatio must look like "16:9"');let n=Number(t[0]),o=Number(t[1]);return Pm("aspectRatio width",n),Pm("aspectRatio height",o),n/o},Q9i=({width:e,height:t,diagonal:n,aspectRatio:o,ratio:r,defaultDiagonal:i=N9i})=>{let s=R9i(o??r);if(e!==void 0)Pm("width",e);if(t!==void 0)Pm("height",t);if(n!==void 0)Pm("diagonal",n);Pm("defaultDiagonal",i);let a,c;if(e!==void 0&&t!==void 0)a=e,c=t;else if(n!==void 0&&e!==void 0){if(e>=n)throw Error("width must be smaller than diagonal");a=e,c=Math.sqrt(n**2-e**2)}else if(n!==void 0&&t!==void 0){if(t>=n)throw Error("height must be smaller than diagonal");a=Math.sqrt(n**2-t**2),c=t}else if(e!==void 0)a=e,c=e/s;else if(t!==void 0)a=t*s,c=t;else c=(n??i)/Math.sqrt(s**2+1),a=c*s;return{width:a,height:c,diagonal:Math.hypot(a,c),aspectRatio:a/c}},k9i=(e)=>{let t=[["sitsFlat",e.sitsFlat],["sitsFlatBelowBoard",e.sitsFlatBelowBoard],["foldedToFaceAboveBoard",e.foldedToFaceAboveBoard],["foldedToFaceBelowBoard",e.foldedToFaceBelowBoard],["foldedToFaceAboveBoard",e.foldsAboveBoard],["foldedToFaceBelowBoard",e.foldsBelowBoard],["foldedToRightAngleAboveBoard",e.foldedToRightAngleAboveBoard],["foldedToRightAngleBelowBoard",e.foldedToRightAngleBelowBoard]].filter((n)=>n[1]);if(t.length>1)throw Error("Only one FlexScreen boolean orientation shortcut can be true");return t[0]?.[0]??e.orientation??"sitsFlat"},L9i=(e,t)=>Math.hypot(t[0]-e[0],t[1]-e[1],t[2]-e[2]),H9i=(e,t,n)=>[e[0]+(t[0]-e[0])*n,e[1]+(t[1]-e[1])*n,e[2]+(t[2]-e[2])*n],lPe=(e)=>{let t=[0];for(let n=1;n<e.length;n+=1)t.push(t[n-1]+L9i(e[n-1],e[n]));return t},WOn=(e,t,n)=>{if(n<=0)return e[0];let o=t.at(-1);if(n>=o)return e.at(-1);for(let r=1;r<e.length;r+=1)if(t[r]>=n){let i=t[r-1],s=t[r]-i;return H9i(e[r-1],e[r],(n-i)/s)}return e.at(-1)},cG=(e,t,n)=>{let o=lPe(e),r=o.at(-1),i=Math.max(0,Math.min(t,r)),s=Math.max(i,Math.min(n,r)),a=[WOn(e,o,i)];for(let c=1;c<e.length-1;c+=1)if(o[c]>i&&o[c]<s)a.push(e[c]);return a.push(WOn(e,o,s)),a},F9i=(e,t)=>[e,[e[0],e[1]+t,e[2]]],z9i=({start:e,endZ:t,flexCableLength:n,foldDistanceFromConnector:o,foldOutset:r,foldSegments:i})=>{let s=[e],a=[e[0],e[1]+o,e[2]];if(o>uP)s.push(a);for(let h=1;h<=i;h+=1){let d=Math.PI*h/i;s.push([e[0],a[1]+r*Math.sin(d),e[2]+(t-e[2])*(1-Math.cos(d))/2])}let c=lPe(s).at(-1);if(c>n+uP)throw Error(`flexCableLength must be at least ${c.toFixed(2)} for this 180-degree fold`);let l=Math.max(0,n-c);if(l>uP){let h=s.at(-1);s.push([h[0],h[1]-l,h[2]])}return s},O9i=({start:e,flexCableLength:t,bendRadius:n,bendSegments:o,verticalLead:r,direction:i})=>{let s=2*o*Math.sin(Math.PI/(4*o)),a=Math.min(n,t/s),c=a*s,l=Math.max(0,t-c),h=Math.min(r,l*0.45),d=l-h,u=[e];if(d>uP)u.push([e[0],e[1]+d,e[2]]);for(let _=1;_<=o;_+=1){let p=Math.PI/2*_/o;u.push([e[0],e[1]+d+a*Math.sin(p),e[2]+i*a*(1-Math.cos(p))])}if(h>uP){let _=u.at(-1);u.push([_[0],_[1],_[2]+i*h])}return u},v0e=({points:e,width:t,thickness:n,color:o,acrossOffset:r=0,normalOffset:i=0,overlap:s=0.03,widthAtDistance:a,startDistance:c=0})=>{let l=lPe(e);return Pe(Gn,{color:o,children:e.slice(1).map((h,d)=>{let u=e[d],_=h[0]-u[0],p=h[1]-u[1],m=h[2]-u[2],A=Math.hypot(_,p,m);if(A<uP)return null;let g=Math.asin(m/A),f=Math.atan2(-_,p),y=[(u[0]+h[0])/2,(u[1]+h[1])/2,(u[2]+h[2])/2],x=Math.max(0.001,Math.min(t,n,A)/2-0.001),C=a?.(c+l[d])??t,b=a?.(c+l[d+1])??t;return Pe(ho,{offset:y,children:Pe(ic,{rotation:[g,0,f],children:a?pn(Oa,{children:[Pe(Ht,{size:[C,s,n],center:[r,-A/2,i]}),Pe(Ht,{size:[b,s,n],center:[r,A/2,i]})]}):Pe(yg,{size:[t,A+s,n],center:[r,0,i],roundRadius:x})})},`${d}:${y.join(":")}`)})})},V9i=(e)=>{let{width:t,height:n,diagonal:o,aspectRatio:r,ratio:i,defaultDiagonal:s,screenThickness:a=1.2,bezelInset:c=2,bezelDepth:l=0.65,activeAreaWidth:h,activeAreaHeight:d,screenColor:u="#071b24",bezelColor:_="#15181d",showScreen:p=!0,flexCableLength:m=28,flexCableThickness:A=0.18,flexCableColor:g="#d79528",pinCount:f=e.conductorCount??8,pitch:y=e.conductorPitch,padWidth:x=e.conductorWidth,conductorThickness:C=0.035,conductorColor:b="#8c4a18",cableEdgeMargin:I=0.6,padLength:v=e.exposedContactLength??2.4,tailLength:P,taperLength:M,showConductors:B=!0,showFlexCable:T=!0,showStiffeners:N=!0,stiffenerLength:D=3,stiffenerThickness:L=0.16,stiffenerColor:H="#416bb3",bendRadius:V=3,bendSegments:O=10,rightAngleVerticalLead:U=3,distanceAboveBoard:j=7,distanceBelowBoard:Y=7,foldDistanceFromConnector:X=7,foldOutset:K=4,foldSegments:J=18,screenGap:ee=0.08,boardTopZ:se=0,boardThickness:ne=1.6,boardClearance:re=0.15,cableStartX:Z=0,cableStartY:te=0,cableStartZ:ie,cableLateralOffset:ce=0,screenOffset:ue,screenRotation:de,rotation:me=[0,0,0],offset:ge}=e,xe=Q9i({width:t,height:n,diagonal:o,aspectRatio:r,ratio:i,defaultDiagonal:s}),Ee=k9i(e),Re=Ee==="sitsFlatBelowBoard"||Ee==="foldedToFaceBelowBoard"||Ee==="foldedToRightAngleBelowBoard",Me=Ee==="foldedToFaceAboveBoard"||Ee==="foldedToFaceBelowBoard",_e=Ee==="foldedToRightAngleAboveBoard"||Ee==="foldedToRightAngleBelowBoard";if(Pm("screenThickness",a),Pm("flexCableLength",m),Pm("flexCableThickness",A),Pm("conductorThickness",C),Pm("bendRadius",V),Pm("foldOutset",K),Pm("boardThickness",ne),N)Pm("stiffenerThickness",L);if(!Number.isFinite(v)||v<0)throw Error("padLength must be a finite nonnegative length");if(!Number.isInteger(f)||f<1)throw Error("pinCount must be a positive integer");if(!Number.isInteger(O)||O<2)throw Error("bendSegments must be an integer of at least 2");if(!Number.isInteger(J)||J<4)throw Error("foldSegments must be an integer of at least 4");if(re<0||ee<0||I<0||v<0||D<0||U<0||j<0||Y<0||X<0)throw Error("clearances, margins, contact lengths, and lead lengths cannot be negative");let ye=e.flexCableWidth??Math.min(12,Math.max(5,xe.width*0.3));Pm("flexCableWidth",ye);let Se=ye-I*2;if(Se<=0)throw Error("cableEdgeMargin leaves no usable flex cable width");let Ne=y??(f===1?0:Se/f);if((y!==void 0||f>1)&&(!Number.isFinite(Ne)||Ne<=0))throw Error("pitch must be greater than zero");let Le=x??(f===1?Math.min(Se,ye*0.45):Ne*0.48);Pm("padWidth",Le);let nt=(f-1)*Ne+Le,dt=Math.max(ye,nt+I*2),rt=dt>ye+uP,pt=rt?f===1?0:Se/f:Ne,ct=rt?Math.min(Le,f===1?Se:pt*0.48):Le,kt=Re&&!Me?se-ne-re-A/2:se+re+A/2,Lt=[Z+ce,te,ie??kt],Bt=Re?-1:1,xt=Ee==="foldedToFaceAboveBoard"?se+j:se-ne-Y,Yt=Ee==="foldedToFaceAboveBoard"?xt-ee-A/2:xt+ee+A/2,ut=Me?z9i({start:Lt,endZ:Yt,flexCableLength:m,foldDistanceFromConnector:X,foldOutset:K,foldSegments:J}):_e?O9i({start:Lt,flexCableLength:m,bendRadius:V,bendSegments:O,verticalLead:U,direction:Bt}):F9i(Lt,m),Ze=lPe(ut).at(-1);if(P!==void 0){if(Pm("tailLength",P),P>=Ze)throw Error("tailLength must be shorter than flexCableLength")}if(M!==void 0)Pm("taperLength",M);let Fe=Math.min(Math.max(0,v),Ze/2,P??1/0),tt=Math.min(Math.max(0,D),Ze/2,P??1/0),Je=P??Math.max(Fe,tt);if(M!==void 0&&Je+M>Ze+uP)throw Error("tailLength and taperLength must fit within flexCableLength");let $e=Math.min(Ze,Je+(M??Math.max(3,(dt-ye)/2))),ft=(hn)=>{if(hn<=Je)return dt;let Zn=Math.min(1,(hn-Je)/($e-Je));return dt+(ye-dt)*Zn},vt=rt?[...cG(ut,0,Je),...cG(ut,Je,$e).slice(1),...cG(ut,$e,Ze).slice(1)]:ut,Ye=rt?ft:void 0,je=cG(ut,0,Fe),st=cG(ut,Ze-Fe,Ze),St=cG(vt,0,tt),Nt=cG(vt,Ze-tt,Ze),Ot=ut.at(-1),Ut,mn;if(Ee==="sitsFlat")Ut=[0,0,0],mn=[Ot[0],Ot[1]+xe.height/2,Ot[2]+A/2+ee];else if(Ee==="sitsFlatBelowBoard")Ut=[0,Math.PI,0],mn=[Ot[0],Ot[1]+xe.height/2,Ot[2]-A/2-ee];else if(Ee==="foldedToFaceAboveBoard")Ut=[0,0,0],mn=[Ot[0],Ot[1]-xe.height/2,xt];else if(Ee==="foldedToFaceBelowBoard")Ut=[0,Math.PI,0],mn=[Ot[0],Ot[1]-xe.height/2,xt];else if(Ee==="foldedToRightAngleAboveBoard")Ut=[Math.PI/2,0,0],mn=[Ot[0],Ot[1]-A/2-ee,Ot[2]+xe.height/2];else Ut=[-Math.PI/2,0,0],mn=[Ot[0],Ot[1]+A/2+ee,Ot[2]-xe.height/2];mn=[mn[0]+(ue?.x??0),mn[1]+(ue?.y??0),mn[2]+(ue?.z??0)];let _n=Array.from({length:f},(hn,Zn)=>(Zn-(f-1)/2)*Ne),En=(A+C)/2,Qn=-(A+L)/2,ln=pn(Uo,{children:[T&&Pe(v0e,{points:vt,width:ye,widthAtDistance:Ye,thickness:A,color:g}),T&&N&&tt>uP&&pn(Uo,{children:[Pe(v0e,{points:St,width:dt,thickness:L,color:H,normalOffset:Qn}),Pe(v0e,{points:Nt,width:ye,widthAtDistance:Ye,startDistance:Ze-tt,thickness:L,color:H,normalOffset:Qn})]}),T&&B&&Fe>uP&&_n.map((hn,Zn)=>pn(Uo,{children:[Pe(v0e,{points:je,width:Le,thickness:C,color:b,acrossOffset:hn,normalOffset:En}),Pe(v0e,{points:st,width:ct,thickness:C,color:b,acrossOffset:(Zn-(f-1)/2)*pt,normalOffset:En})]},`conductor:${Zn}`)),p&&Pe(ho,{offset:mn,children:Pe(ic,{rotation:de??Ut,children:Pe(wVn,{width:xe.width,height:xe.height,thickness:a,bezelInset:c,bezelDepth:l,screenWidth:h,screenHeight:d,screenColor:u,bezelColor:_})})})]});return Pe(ho,{offset:{x:ge?.x??0,y:ge?.y??0,z:ge?.z??0},children:Pe(ho,{offset:Lt,children:Pe(ic,{rotation:me,children:Pe(ho,{offset:[-Lt[0],-Lt[1],-Lt[2]],children:ln})})})})},Y9i=_u({name:"flexscreen",schema:IIe,render:({fn:e,...t})=>Pe(V9i,{...t}),pads:"footprinter"});function G9i(e){e.register(Y9i)}function U9i(e){return BVn(e)}function BVn(e,t=0,n=32){let o=_he.parse(e),r=Bet(o),i=r.pitchDiameter/2,s=r.baseDiameter/2,a=r.outsideDiameter/2,c=r.rootDiameter/2,l=o.pressureAngle*Math.PI/180,h=Math.PI*2/o.toothCount,d=(o.phase%360+360)%360*(Math.PI/180),u=r.toothThickness/(2*i)+Math.tan(l)-l,_=Math.max(s,c),p=Math.sqrt(Math.max(0,(_/s)**2-1)),m=Math.sqrt((a/s)**2-1),A=(Z)=>u-(Z-Math.atan(Z)),g=A(p),f=A(m),y=Math.max(2,Math.ceil(o.segmentsPerTooth/2)),x=Math.max(1,Math.ceil(o.segmentsPerTooth/4)),C=h-2*g,b=Math.max(o.boreDiameter,o.hubDiameter)/2,I=b>0?(t===0?1.8:0.8)*Math.acos(b/c):Math.PI,v=Math.max(x,Math.ceil(C/I)),P=Math.min(h/16,2*Math.PI/n,I),M=Math.max(1,Math.ceil(Math.abs(t)/P)),B=2*y+x+v+(c<s?2:0);if(!Number.isFinite(v)||!Number.isFinite(M)||(M+1)*o.toothCount*B+1024>1e6)throw Error("Involute gear exceeds mesh resolution limit (1 million vertices); reduce twist or resolution, or increase bore/hub wall thickness");let T=[],N=(Z,te)=>{T.push([Z*Math.cos(te),Z*Math.sin(te)])};for(let Z=0;Z<o.toothCount;Z++){let te=d+Z*h;if(N(c,te-g),c<s)N(s,te-u);for(let ie=1;ie<=y;ie++){let ce=p+(m-p)*ie/y;N(s*Math.sqrt(1+ce*ce),te-A(ce))}for(let ie=1;ie<=x;ie++)N(a,te-f+2*f*ie/x);for(let ie=y-1;ie>=0;ie--){let ce=p+(m-p)*ie/y;N(s*Math.sqrt(1+ce*ce),te+A(ce))}if(c<s)N(c,te+u);for(let ie=1;ie<v;ie++)N(c,te+g+C*ie/v)}let D=[],L=[],H=(Z,te)=>{let ie=D.length/3;for(let[ce,ue]of Z)D.push(ce,ue,te);return ie},V=Math.max(48,Math.min(256,o.toothCount*4)),O=(Z)=>Array.from({length:V},(te,ie)=>{let ce=d+ie*Math.PI*2/V;return[Z*Math.cos(ce),Z*Math.sin(ce)]}),U=(Z,te,ie,ce=!1)=>{for(let ue=0;ue<ie;ue++){let de=(ue+1)%ie;if(ce)L.push(Z+ue,te+de,Z+de,Z+ue,te+ue,te+de);else L.push(Z+ue,Z+de,te+de,Z+ue,te+de,te+ue)}},j=(Z,te,ie,ce)=>{let ue=ce?[...Z,...ce.points]:Z,de=jI(ue.flatMap(([ge,xe])=>[ge,xe]),ce?[Z.length]:[]),me=(ge)=>ge<Z.length?te+ge:ce.start+ge-Z.length;for(let ge=0;ge<de.length;ge+=3){let xe=de[ge],Ee=de[ge+1],Re=de[ge+2],Me=ue[xe],_e=ue[Ee],ye=ue[Re];if((_e[0]-Me[0])*(ye[1]-Me[1])-(_e[1]-Me[1])*(ye[0]-Me[0])>0===ie)L.push(me(xe),me(Ee),me(Re));else L.push(me(xe),me(Re),me(Ee))}},Y=H(T,0),X=Y,K=T;for(let Z=1;Z<=M;Z++){let te=t*(Z/M);K=t===0?T:T.map(([ce,ue])=>[ce*Math.cos(te)-ue*Math.sin(te),ce*Math.sin(te)+ue*Math.cos(te)]);let ie=H(K,o.faceWidth*(Z/M));U(X,ie,T.length),X=ie}let J=o.hubDiameter>0&&o.hubLength>0,ee=o.faceWidth+(J?o.hubLength:0),se=o.boreDiameter>0?O(o.boreDiameter/2):void 0,ne=se?H(se,0):void 0,re=se?H(se,ee):void 0;if(se)U(ne,re,se.length,!0);if(j(T,Y,!1,se?{points:se,start:ne}:void 0),J){let Z=O(o.hubDiameter/2),te=H(Z,o.faceWidth),ie=H(Z,ee);if(j(K,X,!0,{points:Z,start:te}),U(te,ie,Z.length),se)U(ie,re,Z.length);else j(Z,ie,!0)}else j(K,X,!0,se?{points:se,start:re}:void 0);return{positions:D,indices:L}}function W9i(e){let t=Tet.parse(e),{twistAngle:n}=x0n(t),{helixAngle:o,handedness:r,segmentsPerTurn:i,...s}=t;return BVn(s,n*Math.PI/180,i)}function X9i(e){return gu(W9i(e))}function j9i({color:e="#737e8f",...t}){return Pe(Gn,{color:e,children:Pe(sd,{geometry:X9i(t)})})}var K9i=_u({name:"helicalgear",schema:fIe,render:({fn:e,...t})=>Pe(j9i,{...t}),pads:"none"});function $9i(e){e.register(K9i)}function q9i(e,t={}){let n=h0n.parse(e),o=t.radialSegments??96,r=t.threadStepsPerTurn??24;if(!Number.isInteger(o)||o<24||o>192||o%24!==0||!Number.isInteger(r)||r<24||r>96)throw Error("Screw mesh resolution requires 24..192 radial segments divisible by 24 and 24..96 thread steps");let i=[],s=[],a=new Map,c=(M,B,T)=>{let N=[M,B,T].map((H)=>Math.round(H*10000000000)).join(":"),D=a.get(N);if(D!==void 0)return D;let L=i.length/3;return i.push(M,B,T),a.set(N,L),L},l=(M,B,T)=>{if(M===B||B===T||T===M)return;let N=(j)=>i.slice(3*j,3*j+3),D=N(M),L=N(B),H=N(T),V=L.map((j,Y)=>j-D[Y]),O=H.map((j,Y)=>j-D[Y]);if(Math.hypot(V[1]*O[2]-V[2]*O[1],V[2]*O[0]-V[0]*O[2],V[0]*O[1]-V[1]*O[0])>0.000000000001)s.push(M,B,T)},h=(M,B)=>Array.from({length:o},(T,N)=>{let D=N*2*Math.PI/o,L=M(D);return c(L*Math.cos(D),L*Math.sin(D),typeof B==="number"?B:B(D))}),d=(M,B)=>{for(let T=0;T<o;T++){let N=(T+1)%o;l(M[T],M[N],B[N]),l(M[T],B[N],B[T])}},u=(M,B,T)=>{let N=c(0,0,B);for(let D=0;D<o;D++){let L=(D+1)%o;T?l(N,M[D],M[L]):l(N,M[L],M[D])}},_=[],p=(M,B)=>{let T=h(M,B);if(_.length)d(_,T);return _=T,T},m=n.diameter/2,A=n.threadRootDiameter/2,g=n.threadPitch,f=-n.underHeadRadius,y=n.showThreads?Math.ceil((f+n.length)/g*r):1;if((y+100)*o>400000)throw Error("Screw exceeds mesh resolution limit");let x=new Set([-n.length,-n.length+n.tipChamfer,f]);if(n.showThreads)for(let M=0;M<=y;M++)x.add(-n.length+(f+n.length)*M/y);for(let M of[...x].sort((B,T)=>B-T)){let B=p((T)=>{let N=(((M+n.length)/g-(n.threadHand==="right"?1:-1)*T/(2*Math.PI))%1+1)%1,D=Math.min(N,1-N),L=Math.min(m-A,Math.max(0,(D-0.0625)*g*Math.sqrt(3))),H=n.showThreads?m-L:m;return Math.min(H,m-Math.max(0,n.tipChamfer-(M+n.length)))},M);if(M===-n.length)u(B,M,!1)}p(()=>m,f);let C=m+n.underHeadRadius,b=f;for(let M=1;M<=16;M++){let B=Math.PI-(Math.PI-Math.PI/2)*M/16;p(()=>C+n.underHeadRadius*Math.cos(B),b+n.underHeadRadius*Math.sin(B))}let I=(M)=>n.headAcrossFlats/2/Math.max(Math.abs(Math.sin(M)),Math.abs(Math.sin(M+2*Math.PI/3)),Math.abs(Math.sin(M+4*Math.PI/3)));p(I,0);let v=Math.tan(n.headChamferAngle*Math.PI/180),P=n.headHeight-(n.headCornerDiameter-n.headChamferDiameter)/2*v;p(I,P);for(let M=1;M<=12;M++){let B=P+(n.headHeight-P)*M/12;p((T)=>Math.min(I(T),n.headChamferDiameter/2+(n.headHeight-B)/v),B)}return u(_,n.headHeight,!0),{positions:i,indices:s}}function J9i(e,t){return gu(q9i(e,t))}function Z9i({color:e="#737e8f",...t}){return Pe(Gn,{color:e,children:Pe(sd,{geometry:J9i(t)})})}var evi=_u({name:"hexbolt",schema:_Ie,render:({fn:e,...t})=>Pe(Z9i,{...t}),pads:"none"});function tvi(e){e.register(evi)}function nvi(e){let t=e.radialSegments??96,n=e.segmentsPerPitch??32;if(!Number.isInteger(t)||t<24||t>192||t%12!==0||!Number.isInteger(n)||n<8||n>64)throw Error("Mesh resolution limit: radial segments must be a multiple of 12 in [24,192], pitch segments an integer in [8,64]");return{radial:t,axial:n}}function ovi(e){let t=[],n=[];return{positions:t,indices:n,ring:(s,a)=>{let c=t.length/3;for(let l=0;l<e;l++){let h=l*2*Math.PI/e,d=a(h);t.push(d*Math.cos(h),d*Math.sin(h),s)}return c},connect:(s,a)=>{for(let c=0;c<e;c++){let l=(c+1)%e;n.push(s+c,s+l,a+l,s+c,a+l,a+c)}},cap:(s,a,c)=>{let l=t.length/3;t.push(0,0,a);for(let h=0;h<e;h++){let d=(h+1)%e;n.push(l,s+(c?h:d),s+(c?d:h))}}}}function XOn(e,t){let n=Math.PI/3,o=((e-Math.PI/2+n/2)%n+n)%n-n/2;return t/2/Math.cos(o)}function rvi(e,t,n,o=1){let r=((e/n-o*t/(2*Math.PI))%1+1)%1;return Math.min(r,1-r)}function ivi(e,t={}){let n=Oet.parse(e),o=Spn(e),{radial:r,axial:i}=nvi(t),s=Math.max(2,Math.ceil(o.height/o.threadPitch*i));if(s>24000||!Number.isFinite(s))throw Error("Mesh resolution limit: too many thread turns");let a=ovi(r),c=(A,g)=>Math.min(XOn(g,o.acrossFlats),o.faceDiameter/2+Math.min(A,o.height-A)*Math.sqrt(3)),l=[0,o.outerChamferDepth,o.height-o.outerChamferDepth,o.height];for(let A=0;A<r;A++){let g=A*2*Math.PI/r,f=(XOn(g,o.acrossFlats)-o.faceDiameter/2)/Math.sqrt(3);if(f>0.000000001&&f<o.outerChamferDepth-0.000000001)l.push(f,o.height-f)}let h=l.sort((A,g)=>A-g).filter((A,g,f)=>g===0||A-f[g-1]>0.0000000001),d=a.ring(0,(A)=>c(0,A)),u=d;for(let A of h.slice(1)){let g=a.ring(A,(f)=>c(A,f));a.connect(u,g),u=g}let _=new Set(n.showThreads?Array.from({length:s+1},(A,g)=>o.height*g/s):[0,o.height]);_.add(o.boreChamferDepth),_.add(o.height-o.boreChamferDepth);let p=o.boreMinorDiameter/2,m=(o.diameter-o.boreMinorDiameter)/2;for(let A of[..._].sort((g,f)=>f-g)){let g=a.ring(A,(f)=>{let y=Math.min(m,Math.max(0,(rvi(A,f,o.threadPitch)-0.125)*o.threadPitch*Math.sqrt(3))),x=p+(n.showThreads?y:0);return Math.max(x,o.mouthDiameter/2-Math.min(A,o.height-A))});a.connect(u,g),u=g}return a.connect(u,d),{positions:a.positions,indices:a.indices}}function svi(e,t){return gu(ivi(e,t))}function avi({color:e="#737e8f",...t}){return Pe(Gn,{color:e,children:Pe(sd,{geometry:svi(t)})})}var cvi=_u({name:"hexnut",schema:NIe,render:({fn:e,...t})=>Pe(avi,{...t}),pads:"none"});function lvi(e){e.register(cvi)}var hvi=(e)=>{let t=I0n.parse(e),{diameter:n,threadPitch:o,headDiameter:r,headHeight:i,socketWidth:s,socketDepth:a}=Vx[t.metricSize],{length:c,showThreads:l}=t,h=96,d=l?Math.max(2,Math.ceil(c/o*24)):2;if(d>24000)throw Error("Bolt length exceeds mesh resolution limit (1000 thread turns)");let u=[],_=[],p=n/2,m=o*0.61343,A=Math.min(0.2,i*0.08),g=Math.min(o*0.6,c/3),f=(P,M)=>{let B=u.length/3;for(let T=0;T<96;T++){let N=T*Math.PI*2/96,D=M(N);u.push(D*Math.cos(N),D*Math.sin(N),P)}return B},y=(P,M)=>{for(let B=0;B<96;B++){let T=(B+1)%96;_.push(P+B,P+T,M+T,P+B,M+T,M+B)}},x=(P,M,B)=>{let T=u.length/3;u.push(0,0,M);for(let N=0;N<96;N++){let D=P+N,L=P+(N+1)%96;_.push(T,B?D:L,B?L:D)}},C=-1,b=l?Array.from({length:d+1},(P,M)=>-c+c*M/d):[-c,-c+g,0];for(let P of b){let M=f(P,(B)=>{let T=((P/o-B/(2*Math.PI))%1+1)%1,N=Math.min(T,1-T),D=Math.min(m,Math.max(0,(N-0.0625)*o*Math.sqrt(3))),L=Math.min(1,(P+c)/g,-P/Math.min(o/2,c/3)),H=g*Math.max(0,1-(P+c)/g);return p-(l?D*L:0)-H});if(C<0)x(M,P,!1);else y(C,M);C=M}let I=(P,M)=>{let B=f(P,M);y(C,B),C=B};I(0,()=>r/2-A),I(A,()=>r/2),I(i-A,()=>r/2),I(i,()=>r/2-A);let v=(P,M)=>M/2/Math.cos((P+Math.PI/6)%(Math.PI/3)-Math.PI/6);return I(i,(P)=>v(P,s+A)),I(i-A/2,(P)=>v(P,s)),I(i-a,(P)=>v(P,s)),x(C,i-a,!0),{positions:u,indices:_}};function TVn(e){return gu(hvi(e))}function dvi({color:e="#737e8f",...t}){return Pe(Gn,{color:e,material:Qr.steel,children:Pe(sd,{geometry:TVn(t)})})}var uvi=_u({name:"hexsocketbolt",schema:yIe,render:({fn:e,...t})=>Pe(dvi,{...t}),pads:"none"});function pvi(e){e.register(uvi)}function mvi(e,t={}){let n=RIe.parse(e),o=Vet(n),r=t.radialSegments??24,i=t.segmentsPerRib??4;for(let[I,v,P,M]of[["radialSegments",r,12,128],["segmentsPerRib",i,4,32]])if(!Number.isInteger(v)||v<P||v>M||v%4!==0)throw Error(`${I} must be a multiple of four in [${P},${M}]`);let{totalLength:s,bendLength:a,minimumWallThickness:c}=o,l=n.innerDiameter/2,d=Math.max(s,n.outerDiameter)*0.0000000001;if(Math.min(l,c,s)<=d)throw Error("Hollow positioning arm tube wall, bore or length exceeds mesh resolution limit");let u=Math.min(l,c)*0.02,_=Math.min(Math.PI/36,2*Math.acos(1-Math.min(u/n.bendRadius,1))),p=n.bendAngle===0?0:Math.ceil(n.bendAngle*Math.PI/180/_),m=n.ribDepth===0?0:Math.ceil(s/n.ribPitch*i),A=Math.floor(250000/(2*r));if(!Number.isSafeInteger(p+m)||p+m+5>A)throw Error("Hollow positioning arm tube exceeds mesh resolution limit (250000 vertices)");let g=[0,n.startLength,n.startLength+a,s];for(let I=1;I<p;I++)g.push(n.startLength+a*I/p);for(let I=1;I<m;I++)g.push(I*n.ribPitch/i);g.sort((I,v)=>I-v);let f=g.filter((I,v)=>v===0||I-g[v-1]>d);if(s-f[f.length-1]<=d)f[f.length-1]=s;let y=[],x=[],C=r*2;for(let I of f){let{position:v,normal:P}=Bpn(n,I),M=n.outerDiameter/2-(n.ribDepth===0?0:n.ribDepth/2*(1+Math.cos(2*Math.PI*(I/n.ribPitch%1))));for(let B of[M,l])for(let T=0;T<r;T++){let N=T*2*Math.PI/r,D=T===r/4||T===3*r/4?0:Math.cos(N),L=T===0||T===r/2?0:Math.sin(N);y.push(v[0]+B*D*P[0],B*L,v[2]+B*D*P[2])}}let b=(I,v,P,M)=>{x.push(I,v,P,I,P,M)};for(let I=0;I+1<f.length;I++)for(let v=0;v<r;v++){let P=(v+1)%r,M=I*C,B=(I+1)*C;b(M+v,M+P,B+P,B+v),b(M+r+v,B+r+v,B+r+P,M+r+P)}for(let I=0;I<r;I++){let v=(I+1)%r;b(I,r+I,r+v,v);let P=(f.length-1)*C;b(P+I,P+v,P+r+v,P+r+I)}return{positions:y,indices:x}}function _vi(e){return gu(mvi(e))}function gvi({color:e="#343943",...t}){return Pe(Gn,{color:e,children:Pe(sd,{geometry:_vi(t)})})}var Avi=_u({name:"hollowpositioningarmtube",schema:QIe,render:({fn:e,...t})=>Pe(gvi,{...t}),pads:"none"});function fvi(e){e.register(Avi)}var kht=xIe.parse.bind(xIe);function yvi(e){let t=kht(e);if(t.wireConnection==="none")return[];let{position:n}=XIe(t).wireside,o=t.wireSideAngle*Math.PI/180,r=(m)=>dP.default.transforms.translate([n.x,n.y,n.z],dP.default.transforms.rotateZ(o,m));if(t.wireConnection==="stubs"){let m=["#d53f3f","#2463af","#3b934b","#252830","#e5d049","#eeeeee","#ce7432","#803e91"];return Array.from({length:t.wireCount},(A,g)=>({color:m[g],geometry:r(dP.default.transforms.translate([(t.wireLength-0.15)/2,(g-(t.wireCount-1)/2)*t.wireDiameter*1.5,0],dP.default.transforms.rotateY(Math.PI/2,dP.default.primitives.cylinder({height:t.wireLength+0.15,radius:t.wireDiameter/2,segments:24}))))}))}let i=oJ(t.wireConnection),{pinCount:s,pitch:a,bodyWidth:c,bodyHeight:l,matingDepth:h}=i,d=a===2?0.6:0.3,u=a===2?3.4:2.4,_=a===2?0.5:0.3,p=dP.default.booleans.subtract(dP.default.primitives.cuboid({size:[h+0.1,c,l],center:[(h-0.1)/2,0,0]}),dP.default.primitives.cuboid({size:[h-0.5,c-2*d,l-2*d],center:[h/2+0.55,0,0]}));return[{color:"#eeeeea",geometry:r(p)},...Array.from({length:s},(m,A)=>({color:"#b8bec6",geometry:r(dP.default.primitives.cuboid({size:[u,_,_],center:[u/2,(A-(s-1)/2)*a,0]}))}))]}var nPe=(e,t=0,n=0)=>Array.from({length:96},(o,r)=>[t+e*Math.cos(r*Math.PI/48),n+e*Math.sin(r*Math.PI/48)]),jOn=(e,t)=>{let n=e/2,o=t;if(o===0)return[[-n,-n],[n,-n],[n,n],[-n,n]];return[[-n+o,-n],[n-o,-n],[n,-n+o],[n,n-o],[n-o,n],[-n+o,n],[-n,n-o],[-n,-n+o]]};function xvi(e){let t=kht(e),n=[],o=(u,_,p,m,A=[])=>{if(m>p)n.push({name:u,outline:_,holes:A,zMin:p,zMax:m})},r=jOn(t.bodyWidth,t.faceCornerChamfer),i=jOn(t.bodyWidth,t.bodyCornerChamfer),s=t.mountingHoleSpacing/2,c=[[-s,-s],[s,-s],[s,s],[-s,s]].map(([u,_])=>nPe(t.mountingHoleDiameter/2,u,_)),l=t.mountingHoleThrough?t.frontCapLength:t.mountingHoleDepth;if(o("frontCap",r,-l,0,c),o("frontCap",r,-t.frontCapLength,-l),o("body",i,-t.bodyLength+t.rearCapLength,-t.frontCapLength),t.backFace==="plain")o("rearCap",t.mountingHoleThrough?i:r,-t.bodyLength,-t.bodyLength+t.rearCapLength);else{let u=t.backFaceHoleSpacing/2,_=[-u,u].flatMap((p)=>[-u,u].map((m)=>nPe(t.backFaceHoleDiameter/2,p,m)));o("rearCap",r,-t.bodyLength,-t.bodyLength+t.backFaceHoleDepth,_),o("rearCap",r,-t.bodyLength+t.backFaceHoleDepth,-t.bodyLength+t.rearCapLength)}o("pilot",nPe(t.pilotDiameter/2),0,t.pilotLength);let h=t.shaftDiameter/2,d=nPe(h);if(t.shaftShape==="round")o("shaft",d,t.pilotLength,t.shaftLength);else{let u=h-t.shaftFlatDepth,_=Math.acos(u/h),p=Array.from({length:97},(g,f)=>{let y=_+(2*Math.PI-2*_)*f/96;return[h*Math.cos(y),h*Math.sin(y)]}),m=t.shaftFlatAngle*Math.PI/180,A=p.map(([g,f])=>[g*Math.cos(m)-f*Math.sin(m),g*Math.sin(m)+f*Math.cos(m)]);o("shaft",d,t.pilotLength,t.shaftLength-t.shaftFlatLength),o("shaft",A,t.shaftLength-t.shaftFlatLength,t.shaftLength)}return n}var hht=TB.default.modifiers.generalize;function Cvi({bodyColor:e="#242830",capColor:t="#aeb5bd",shaftColor:n="#b8bec6",screwColor:o="#626b78",...r}){let i=kht(r),s=i.backFace==="screws"?TB.default.transforms.rotateX(Math.PI,TVn({metricSize:i.backFaceScrewSize,length:i.backFaceHoleDepth,showThreads:!1})):void 0,a=i.backFaceHoleSpacing/2;return pn(Uo,{children:[xvi(i).map((c,l)=>{let h=TB.default.geometries.geom2.fromPoints(c.outline),d=c.holes.length?TB.default.booleans.subtract(h,...c.holes.map((_)=>TB.default.geometries.geom2.fromPoints(_))):h,u=TB.default.transforms.translate([0,0,c.zMin],TB.default.extrusions.extrudeLinear({height:c.zMax-c.zMin},d));return Pe(Gn,{material:c.name==="body"?Qr.moldedPlastic:c.name==="shaft"?Qr.steel:Qr.brushedMetal,color:c.name==="body"?e:c.name==="shaft"?n:t,children:Pe(sd,{geometry:hht({simplify:!0},u)})},`${c.name}-${l}`)}),yvi(i).map(({geometry:c,color:l},h)=>Pe(Gn,{material:Qr.rubber,color:l,children:Pe(sd,{geometry:hht({simplify:!0},c)})},`wire-${h}`)),s&&[-a,a].flatMap((c)=>[-a,a].map((l)=>Pe(Gn,{material:Qr.steel,color:o,children:Pe(sd,{geometry:TB.default.transforms.translate([c,l,-i.bodyLength],hht({simplify:!0},s))})},`rear-screw-${c}-${l}`)))]})}var bvi=_u({name:"nema",schema:CIe,render:({fn:e,...t})=>Pe(Cvi,{...t}),pads:"none"});function Ivi(e){e.register(bvi)}function vvi(e,t={}){let n=Rpn.parse(e),o=t.radialSegments??96,r=t.threadStepsPerTurn??24;if(!Number.isInteger(o)||o<24||o>192||o%24!==0||!Number.isInteger(r)||r<24||r>96)throw Error("Screw mesh resolution requires 24..192 radial segments divisible by 24 and 24..96 thread steps");let i=[],s=[],a=new Map,c=(xe,Ee,Re)=>{let Me=[xe,Ee,Re].map((Se)=>Math.round(Se*10000000000)).join(":"),_e=a.get(Me);if(_e!==void 0)return _e;let ye=i.length/3;return i.push(xe,Ee,Re),a.set(Me,ye),ye},l=(xe,Ee,Re)=>{if(xe===Ee||Ee===Re||Re===xe)return;let Me=(dt)=>i.slice(3*dt,3*dt+3),_e=Me(xe),ye=Me(Ee),Se=Me(Re),Ne=ye.map((dt,rt)=>dt-_e[rt]),Le=Se.map((dt,rt)=>dt-_e[rt]);if(Math.hypot(Ne[1]*Le[2]-Ne[2]*Le[1],Ne[2]*Le[0]-Ne[0]*Le[2],Ne[0]*Le[1]-Ne[1]*Le[0])>0.000000000001)s.push(xe,Ee,Re)},h=(xe,Ee)=>Array.from({length:o},(Re,Me)=>{let _e=Me*2*Math.PI/o,ye=xe(_e);return c(ye*Math.cos(_e),ye*Math.sin(_e),typeof Ee==="number"?Ee:Ee(_e))}),d=(xe,Ee)=>{for(let Re=0;Re<o;Re++){let Me=(Re+1)%o;l(xe[Re],xe[Me],Ee[Me]),l(xe[Re],Ee[Me],Ee[Re])}},u=(xe,Ee,Re)=>{let Me=c(0,0,Ee);for(let _e=0;_e<o;_e++){let ye=(_e+1)%o;Re?l(Me,xe[_e],xe[ye]):l(Me,xe[ye],xe[_e])}},_=[],p=(xe,Ee)=>{let Re=h(xe,Ee);if(_.length)d(_,Re);return _=Re,Re},m=n.diameter/2,A=n.threadRootDiameter/2,g=n.threadPitch,f=-n.underHeadRadius,y=n.showThreads?Math.ceil((f+n.length)/g*r):1;if((y+160)*o>400000)throw Error("Screw exceeds mesh resolution limit");let x=new Set([-n.length,-n.length+n.tipChamfer,f]);if(n.showThreads)for(let xe=0;xe<=y;xe++)x.add(-n.length+(f+n.length)*xe/y);for(let xe of[...x].sort((Ee,Re)=>Ee-Re)){let Ee=p((Re)=>{let Me=(((xe+n.length)/g-(n.threadHand==="right"?1:-1)*Re/(2*Math.PI))%1+1)%1,_e=Math.min(Me,1-Me),ye=Math.min(m-A,Math.max(0,(_e-0.0625)*g*Math.sqrt(3))),Se=n.showThreads?m-ye:m;return Math.min(Se,m-Math.max(0,n.tipChamfer-(xe+n.length)))},xe);if(xe===-n.length)u(Ee,xe,!1)}p(()=>m,f);let C=m+n.underHeadRadius,b=f;for(let xe=1;xe<=16;xe++){let Ee=Math.PI-(Math.PI-Math.PI/2)*xe/16;p(()=>C+n.underHeadRadius*Math.cos(Ee),b+n.underHeadRadius*Math.sin(Ee))}let I=(xe)=>n.headHeight-n.crownRadius+Math.sqrt(n.crownRadius*n.crownRadius-xe*xe),v=n.recessOuterWingAngle*Math.PI/180,P=n.recessInnerWingAngle*Math.PI/180,M=(n.recessReferenceDiameter-n.recessG)/2/Math.tan(v),B=M+n.recessG/2*Math.tan(P),T=M+(n.recessG-n.recessB)/2*Math.tan(P),N=n.recessBeta*Math.PI/180,D=Math.atan(Math.tan(n.recessAlpha*Math.PI/360)/Math.cos(N)),L=Math.atan(Math.tan(46*Math.PI/180)/Math.cos(N)),H=n.recessE/2/Math.tan(D),V=(xe,Ee)=>{let Re=n.recessReferencePlaneHeight-xe,Me=n.recessB/2-(Re-T)*Math.tan(N),_e=Math.abs((Ee-Math.PI/4+Math.PI/4+4*Math.PI)%(Math.PI/2)-Math.PI/4),ye=Math.cos(_e),Se=Math.sin(_e),Ne=Math.tan(D),Le=Math.tan(L),nt=Ne*Me/(Ne*ye-Se),dt=nt*ye<=Me+H?nt:(Le*(Me+H)-n.recessE/2)/(Le*ye-Se);return Math.max(0,dt)},O=(xe,Ee)=>{let Re=n.recessReferencePlaneHeight-xe,Me=Re<=M?n.recessReferenceDiameter/2-Re*Math.tan(v):(B-Re)/Math.tan(P);return Math.max(0,Math.min(Me,V(xe,Ee)))},U=n.recessRadius,j=n.headHeight-n.crownRadius,Y=Math.tan(v),X=n.recessReferenceDiameter/2-Y*n.recessReferencePlaneHeight+U/Math.cos(v),K=Y*j+X,J=n.crownRadius-U,ee=(-Y*K+Math.sqrt((1+Y*Y)*J**2-K**2))/(1+Y*Y),se=j+ee,ne=Y*se+X,re=Math.atan2(ee,ne),Z=Math.PI-v,te=ne+U*Math.cos(re),ie=se+U*Math.sin(Z);p(()=>n.headDiameter/2,0),p(()=>n.headDiameter/2,I(n.headDiameter/2));let ce=Array.from({length:o},(xe,Ee)=>{let Re=Ee*2*Math.PI/o,Me=0,_e=te;for(let ye=0;ye<48;ye++){let Se=(Me+_e)/2;if(Se<V(I(Se),Re))Me=Se;else _e=Se}return(Me+_e)/2});for(let xe=1;xe<=20;xe++){let Ee=(Re)=>{let Me=Math.round(Re*o/(2*Math.PI))%o;return n.headDiameter/2+(ce[Me]-n.headDiameter/2)*xe/20};p(Ee,(Re)=>I(Ee(Re)))}let ue=Array.from({length:o},(xe,Ee)=>{let Re=Ee*2*Math.PI/o,Me=(Le)=>({r:ne+U*Math.cos(Le),z:se+U*Math.sin(Le)}),_e=(Le)=>{let nt=Me(Le);return nt.r>V(nt.z,Re)};if(!_e(re))return{angle:re,...Me(re)};if(_e(Z))return{angle:Z,r:V(ie,Re),z:ie};let ye=re,Se=Z;for(let Le=0;Le<48;Le++){let nt=(ye+Se)/2;if(_e(nt))ye=nt;else Se=nt}let Ne=(ye+Se)/2;return{angle:Ne,...Me(Ne)}});for(let xe=0;xe<=24;xe++){let Ee=re+(Z-re)*xe/24,Re=ne+U*Math.cos(Ee),Me=se+U*Math.sin(Ee),_e=(ye)=>ue[Math.round(ye*o/(2*Math.PI))%o];p((ye)=>Ee<=_e(ye).angle?_e(ye).r:Re,(ye)=>Ee<=_e(ye).angle?_e(ye).z:Me)}let de=n.recessReferencePlaneHeight-B,me=new Set([n.recessReferencePlaneHeight-M]);for(let xe=1;xe<48;xe++)me.add(ie+(de-ie)*xe/48);for(let xe of[...me].filter((Ee)=>Ee<ie&&Ee>de).sort((Ee,Re)=>Re-Ee))p((Ee)=>O(xe,Ee),xe);let ge=c(0,0,de);for(let xe=0;xe<o;xe++)l(ge,_[xe],_[(xe+1)%o]);return{positions:i,indices:s}}function Svi(e,t){return gu(vvi(e,t))}function Pvi({color:e="#737e8f",...t}){return Pe(Gn,{color:e,children:Pe(sd,{geometry:Svi(t)})})}var Evi=_u({name:"panscrew",schema:kIe,render:({fn:e,...t})=>Pe(Pvi,{...t}),pads:"none"});function Mvi(e){e.register(Evi)}function wvi(e){let t=Get.parse(e),n=Fpn(t),o=n.innerDiameter/2,r=n.outerDiameter/2,i=t.edgeChamfer,s=i>0?[[n.endOuterDiameter/2,0],[r,i],[r,n.length-i],[n.endOuterDiameter/2,n.length],[n.endInnerDiameter/2,n.length],[o,n.length-i],[o,i],[n.endInnerDiameter/2,0]]:[[r,0],[r,n.length],[o,n.length],[o,0]],a=96,c=[],l=[];for(let[h,d]of s)for(let u=0;u<96;u++){let _=u*Math.PI*2/96;c.push(h*Math.cos(_),h*Math.sin(_),d)}for(let h=0;h<s.length;h++){let d=h*96,u=(h+1)%s.length*96;for(let _=0;_<96;_++){let p=(_+1)%96;l.push(d+_,d+p,u+p,d+_,u+p,u+_)}}return{positions:c,indices:l}}function Bvi(e){return gu(wvi(e))}function Tvi({color:e="#a18450",...t}){return Pe(Gn,{color:e,children:Pe(sd,{geometry:Bvi(t)})})}var Dvi=_u({name:"plainbushing",schema:LIe,render:({fn:e,...t})=>Pe(Tvi,{...t}),pads:"none"});function Nvi(e){e.register(Dvi)}function Rvi(e){let t=Wet.parse(e),n=Gpn(t);cPe(n.screwHoles);let o=Nht({outerRadius:t.outerDiameter/2,boreARadius:t.boreDiameter/2,boreBRadius:t.boreBDiameter/2,length:t.length,chamfer:t.chamfer,stepZ:n.boreADepth});return Qht(Rht(o,...n.screwHoles.map(aPe)))}function Qvi(e){return gu(Rvi(e))}function kvi({color:e="#737e8f",...t}){return Pe(Gn,{color:e,children:Pe(sd,{geometry:Qvi(t)})})}var Lvi=_u({name:"rigidcoupler",schema:HIe,render:({fn:e,...t})=>Pe(kvi,{...t}),pads:"none"});function Hvi(e){e.register(Lvi)}function Fvi(e){let t=jet.parse(e),n=Kpn(t);cPe([n.screwHole]);let o=Nht({outerRadius:t.outerDiameter/2,boreARadius:t.boreDiameter/2,length:t.width,chamfer:t.chamfer});return Qht(Rht(o,aPe(n.screwHole)))}function zvi(e){return gu(Fvi(e))}function Ovi({color:e="#737e8f",...t}){return Pe(Gn,{color:e,children:Pe(sd,{geometry:zvi(t)})})}var Vvi=_u({name:"shaftcollar",schema:FIe,render:({fn:e,...t})=>Pe(Ovi,{...t}),pads:"none"});function Yvi(e){e.register(Vvi)}function Gvi(e){let t=(e.shape==="round"?e.diameter:e.width)/2,n=e.shape==="slot"?(e.length-e.width)/2:0;if(n<0)throw Error("Slot length must be at least its width");return Array.from({length:64},(o,r)=>{if(e.shape==="round"){let l=r*Math.PI/32;return{u:e.u+t*Math.cos(l),v:e.v+t*Math.sin(l)}}let i=r<32?1:-1,s=-Math.PI/2+(r<32?r:r-32)*Math.PI/31+(r<32?0:Math.PI),a=i*n+t*Math.cos(s),c=t*Math.sin(s);return e.shape==="slot"&&e.axis==="v"?{u:e.u-c,v:e.v+a}:{u:e.u+a,v:e.v+c}})}function Uvi(e){let t=w0n.parse(e),{width:n,baseLength:o,flangeHeight:r,thickness:i,profile:s}=t,a=t.insideBendRadius+i/2,c=[],l=[],h=(p,m=!1)=>{let A=c.length/3;for(let g of p)c.push(...g);l.push(A,A+(m?2:1),A+(m?1:2))},d=(p,m=!1)=>{h([p[0],p[1],p[2]],m),h([p[0],p[2],p[3]],m)},u=s==="plate"?["base"]:s==="angle"?["base","right"]:["base","left","right"];for(let p of t.holes)if(!u.includes(p.panel))throw Error(`No ${p.panel} panel on ${s}`);for(let p of u){let m=p==="base"?o:r,A=t.holes.filter((P)=>P.panel===p).map(Gvi),g=A.map((P)=>({minU:Math.min(...P.map((M)=>M.u)),maxU:Math.max(...P.map((M)=>M.u)),minV:Math.min(...P.map((M)=>M.v)),maxV:Math.max(...P.map((M)=>M.v))}));for(let[P,M]of g.entries()){if(M.minU<=-m/2||M.maxU>=m/2||M.minV<=-n/2||M.maxV>=n/2)throw Error(`Hole crosses ${p} panel edge or bend tangent`);for(let B of g.slice(0,P))if(M.minU<=B.maxU&&M.maxU>=B.minU&&M.minV<=B.maxV&&M.maxV>=B.minV)throw Error("Hole bounding boxes must not overlap")}let y=[[{u:-m/2,v:-n/2},{u:m/2,v:-n/2},{u:m/2,v:n/2},{u:-m/2,v:n/2}],...A.map((P)=>[...P].reverse())],x=y.flat(),C=A.map((P,M)=>4+M*64),b=jI(x.flatMap((P)=>[P.u,P.v]),C),I=(P,M)=>p==="base"?[P.u,P.v,M]:[(p==="left"?-1:1)*(o/2+a-M),P.v,a+r/2+P.u],v=p==="left";for(let P=0;P<b.length;P+=3){let M=b.slice(P,P+3).map((B)=>x[B]);h(M.map((B)=>I(B,i/2)),v),h(M.map((B)=>I(B,-i/2)),!v)}for(let[P,M]of y.entries())for(let B=0;B<M.length;B++){let T=M[B],N=M[(B+1)%M.length];if(P===0&&T.u===N.u&&(p==="base"&&(T.u>0&&s!=="plate"||T.u<0&&s==="channel")||p!=="base"&&T.u<0))continue;d([I(T,-i/2),I(N,-i/2),I(N,i/2),I(T,i/2)],v)}}let _=s==="plate"?[]:s==="angle"?[1]:[-1,1];for(let p of _){let m=(A,g)=>{let f=a-g.offset;return[p*(o/2+f*Math.sin(A)),g.y,a-f*Math.cos(A)]};for(let A=0;A<32;A++){let g=A*Math.PI/64,f=(A+1)*Math.PI/64;for(let y of[-i/2,i/2])d([m(g,{y:-n/2,offset:y}),m(f,{y:-n/2,offset:y}),m(f,{y:n/2,offset:y}),m(g,{y:n/2,offset:y})],y<0!==p<0);for(let y of[-n/2,n/2])d([m(g,{y,offset:-i/2}),m(f,{y,offset:-i/2}),m(f,{y,offset:i/2}),m(g,{y,offset:i/2})],y>0!==p<0)}}return{positions:c,indices:l}}function Wvi(e){return gu(Uvi(e))}function Xvi({color:e="#737e8f",...t}){return Pe(Gn,{color:e,material:Qr.brushedMetal,children:Pe(sd,{geometry:Wvi(t)})})}var jvi=_u({name:"sheetmetal",schema:bIe,render:({fn:e,...t})=>Pe(Xvi,{...t}),pads:"none"});function Kvi(e){e.register(jvi)}function $vi(e){return gu(U9i(e))}function qvi({color:e="#737e8f",...t}){return Pe(Gn,{color:e,children:Pe(sd,{geometry:$vi(t)})})}var Jvi=_u({name:"spurgear",schema:AIe,render:({fn:e,...t})=>Pe(qvi,{...t}),pads:"none"});function Zvi(e){e.register(Jvi)}function e8i(e){let t=e.radialSegments??96,n=e.segmentsPerPitch??32;if(!Number.isInteger(t)||t<24||t>192||t%12!==0||!Number.isInteger(n)||n<8||n>64)throw Error("Mesh resolution limit: radial segments must be a multiple of 12 in [24,192], pitch segments an integer in [8,64]");return{radial:t,axial:n}}function t8i(e){let t=[],n=[];return{positions:t,indices:n,ring:(s,a)=>{let c=t.length/3;for(let l=0;l<e;l++){let h=l*2*Math.PI/e,d=a(h);t.push(d*Math.cos(h),d*Math.sin(h),s)}return c},connect:(s,a)=>{for(let c=0;c<e;c++){let l=(c+1)%e;n.push(s+c,s+l,a+l,s+c,a+l,a+c)}},cap:(s,a,c)=>{let l=t.length/3;t.push(0,0,a);for(let h=0;h<e;h++){let d=(h+1)%e;n.push(l,s+(c?h:d),s+(c?d:h))}}}}function n8i(e,t,n,o=1){let r=((e/n-o*t/(2*Math.PI))%1+1)%1;return Math.min(r,1-r)}function o8i(e,t={}){let n=$et.parse(e),o=emn(e),{radial:r,axial:i}=e8i(t),s=Math.max(2,Math.ceil(o.length/o.threadPitch*i));if(s>24000||!Number.isFinite(s)||Math.min(o.minorDiameter,o.endDiameter)<o.diameter*0.00000001)throw Error("Mesh resolution limit: excessive turns or vanishing end/root radius");let a=t8i(r),c=new Set(Array.from({length:s+1},(u,_)=>o.length*_/s));c.add(n.chamfer),c.add(o.length-n.chamfer);let l=o.diameter/2,h=(o.diameter-o.minorDiameter)/2,d=-1;for(let u of[...c].sort((_,p)=>_-p)){let _=a.ring(u,(p)=>{let m=Math.min(h,Math.max(0,(n8i(u,p,o.threadPitch,n.threadHand==="right"?1:-1)-0.0625)*o.threadPitch*Math.sqrt(3))),A=l-Math.max(0,n.chamfer-Math.min(u,o.length-u));return Math.min(l-m,A)});if(d<0)a.cap(_,u,!1);else a.connect(d,_);d=_}return a.cap(d,o.length,!0),{positions:a.positions,indices:a.indices}}function r8i(e,t){return gu(o8i(e,t))}function i8i({color:e="#737e8f",...t}){return Pe(Gn,{color:e,children:Pe(sd,{geometry:r8i(t)})})}var s8i=_u({name:"threadedrod",schema:zIe,render:({fn:e,...t})=>Pe(i8i,{...t}),pads:"none"});function a8i(e){e.register(s8i)}function c8i(e,t={}){let n=OIe.parse(e),o=qet(n),r=t.segmentsPerTurn??64,i=t.wireSegments??24;for(let[p,m,A,g]of[["segmentsPerTurn",r,16,256],["wireSegments",i,8,64]])if(!Number.isInteger(m)||m<A||m>g||m%4!==0)throw Error(`${p} must be a multiple of four in [${A},${g}]`);let s=Math.ceil(n.turns*r);if((s+3)*i+2>250000)throw Error("Spring exceeds mesh resolution limit (250000 vertices)");let a=Math.max(n.outerDiameter,o.axialAdvance,n.startLegLength,n.endLegLength);if(Math.min(n.wireDiameter,n.startLegLength,n.endLegLength,o.insideDiameter,n.pitch-n.wireDiameter)<=a*0.0000000001)throw Error("Spring clearance exceeds mesh resolution limits");let c=[0,...Array.from({length:s+1},(p,m)=>n.startLegLength+o.coilLength*m/s),o.centerlineLength],l={...n,leftHand:!1},h=[],d=[];for(let p of c){let m=YIe(l,p);for(let A=0;A<i;A++){let g=2*Math.PI*A/i,f=A===i/4||A===3*i/4?0:Math.cos(g),y=A===0||A===i/2?0:Math.sin(g);for(let x=0;x<3;x++)h.push(m.position[x]+n.wireDiameter/2*(m.normal[x]*f+m.binormal[x]*y))}}for(let p=0;p<c.length-1;p++)for(let m=0;m<i;m++){let A=(m+1)%i,g=p*i,f=(p+1)*i;d.push(g+m,g+A,f+m,g+A,f+A,f+m)}let u=h.length/3;h.push(...YIe(l,0).position,...YIe(l,o.centerlineLength).position);let _=(c.length-1)*i;for(let p=0;p<i;p++){let m=(p+1)%i;d.push(u,m,p,u+1,_+p,_+m)}if(n.leftHand){for(let p=1;p<h.length;p+=3)h[p]=-h[p];for(let p=0;p<d.length;p+=3)[d[p+1],d[p+2]]=[d[p+2],d[p+1]]}return{positions:h,indices:d}}function l8i(e){return gu(c8i(e))}function h8i({color:e="#929ba6",...t}){return Pe(Gn,{color:e,children:Pe(sd,{geometry:l8i(t)})})}var d8i=_u({name:"torsionspring",schema:VIe,render:({fn:e,...t})=>Pe(h8i,{...t}),pads:"none"});function u8i(e){e.register(d8i)}function Q0e({outer:e,holes:t=[],start:n,end:o,project:r=(a,c,l)=>[a,c,l],reverse:i=!1,skipWall:s=()=>!1}){let a=(A,g)=>{A=A.filter((y,x)=>{let C=A[(x+A.length-1)%A.length];return y[0]!==C[0]||y[1]!==C[1]});let f=A.reduce((y,x,C)=>{let b=A[(C+1)%A.length];return y+x[0]*b[1]-x[1]*b[0]},0);if(!Number.isFinite(f)||f===0)throw Error("Profile exceeds mesh resolution limits");return f<0===g?A:[...A].reverse()},c=[a(e,!1),...t.map((A)=>a(A,!0))],l=c.flat(),h=[],d=c[0].length;for(let A of c.slice(1))h.push(d),d+=A.length;let u=jI(l.flat(),h),_=[n,o].flatMap((A)=>l.flatMap(([g,f])=>r(g,f,A))),p=[];for(let A=0;A<u.length;A+=3){let[g,f,y]=u.slice(A,A+3);p.push(g,y,f,g+d,f+d,y+d)}let m=0;for(let[A,g]of c.entries()){for(let f=0;f<g.length;f++){let y=(f+1)%g.length;if(A===0&&s(g[f],g[y]))continue;let x=m+f,C=m+y;p.push(x,C,C+d,x,C+d,x+d)}m+=g.length}if(i)for(let A=0;A<p.length;A+=3)[p[A+1],p[A+2]]=[p[A+2],p[A+1]];return{positions:_,indices:p}}function p8i(e){let t=[],n=[],o=new Map;for(let r of e)for(let i of r.indices){let s=r.positions.slice(i*3,i*3+3),a=s.map((l)=>l.toFixed(12)).join(","),c=o.get(a);if(c===void 0)c=t.length/3,o.set(a,c),t.push(...s);n.push(c)}return{positions:t,indices:n}}function Lht(e,t,n,o=96){return Array.from({length:o},(r,i)=>{let s=i*2*Math.PI/o;return[e+n*Math.cos(s),t+n*Math.sin(s)]})}function m8i(e={}){let t=cmn.parse(e),{width:n,height:o,length:r,cornerRadius:i,lipThickness:s,pocketDepth:a}=t,c=t.slotWidth/2,l=t.pocketWidth/2,h=s+a,d=[];for(let u=0;u<4;u++){let _=(u%2===0?n:o)/2,p=(u%2===0?o:n)/2,m=[[-_+i,-p],[-c,-p],[-c,-p+s],[-l,-p+s],[-l,-p+h],[l,-p+h],[l,-p+s],[c,-p+s],[c,-p],[_-i,-p]];if(i>0)for(let A=1;A<24;A++){let g=-Math.PI/2+A*Math.PI/48;m.push([_-i+i*Math.cos(g),-p+i+i*Math.sin(g)])}for(let[A,g]of m)d.push(u===0?[A,g]:u===1?[-g,A]:u===2?[-A,-g]:[g,-A])}return Q0e({outer:d,holes:t.boreDiameter>0?[Lht(0,0,t.boreDiameter/2)]:[],start:0,end:r})}function _8i(e={}){return gu(m8i(e))}function g8i({color:e="#8995a3",...t}){return Pe(Gn,{color:e,children:Pe(sd,{geometry:_8i(t)})})}var A8i=_u({name:"tslotextrusion",schema:GIe,render:({fn:e,...t})=>Pe(g8i,{...t}),pads:"none"});function f8i(e){e.register(A8i)}function y8i(e={}){let t=Jet.parse(e),n=umn(t).map((o)=>{let r=o.width/2,i=(o.length-o.width)/2,s=(c,l)=>o.orientation===0?[o.center.x+c,o.center.y+l]:[o.center.x-l,o.center.y+c];if(i===0)return Lht(0,0,r).map(([c,l])=>s(c,l));let a=[];for(let c of[1,-1])for(let l=0;l<=48;l++){let h=-Math.PI/2+l*Math.PI/48+(c<0?Math.PI:0);a.push(s(c*i+r*Math.cos(h),r*Math.sin(h)))}return a});return Q0e({outer:[[0,0],[t.width,0],[0,t.height]],holes:n,start:0,end:t.thickness})}function x8i(e={}){return gu(y8i(e))}function C8i({color:e="#8995a3",...t}){return Pe(Gn,{color:e,children:Pe(sd,{geometry:x8i(t)})})}var b8i=_u({name:"tslotgusset",schema:UIe,render:({fn:e,...t})=>Pe(C8i,{...t}),pads:"none"});function I8i(e){e.register(b8i)}function v8i(e={}){let t=gmn.parse(e),{width:n,legLength:o,thickness:r,bendRadius:i,holeOffset:s,holeDiameter:a}=t,c=i,l=c+r,h=[[c,-n/2],[o,-n/2],[o,n/2],[c,n/2]],d=[Lht(s,0,a/2)],u=[];if(c===0)u.push([0,0]);else for(let _=0;_<=48;_++){let p=-Math.PI/2-_*Math.PI/96;u.push(_===0?[c,0]:_===48?[0,c]:[c+c*Math.cos(p),c+c*Math.sin(p)])}for(let _=0;_<=48;_++){let p=-Math.PI+_*Math.PI/96;u.push(_===0?[-r,c]:_===48?[c,-r]:[c+l*Math.cos(p),c+l*Math.sin(p)])}return p8i([Q0e({outer:h,holes:d,start:-r,end:0,skipWall:(_,p)=>_[0]===c&&p[0]===c}),Q0e({outer:h,holes:d,start:-r,end:0,project:(_,p,m)=>[m,p,_],reverse:!0,skipWall:(_,p)=>_[0]===c&&p[0]===c}),Q0e({outer:u,start:-n/2,end:n/2,project:(_,p,m)=>[_,m,p],reverse:!0,skipWall:(_,p)=>_[0]===c&&p[0]===c||_[1]===c&&p[1]===c})])}function S8i(e={}){return gu(v8i(e))}function P8i({color:e="#8995a3",...t}){return Pe(Gn,{color:e,children:Pe(sd,{geometry:S8i(t)})})}var E8i=_u({name:"tslotinsidecorner",schema:WIe,render:({fn:e,...t})=>Pe(P8i,{...t}),pads:"none"});function M8i(e){e.register(E8i)}var w8i=(e)=>{let t=Det.parse(e),{outsideDiameter:n,rootDiameter:o,axialPitch:r,lead:i,toothThickness:s}=z0n(t),a=n/2,c=o/2,l=t.pitchDiameter/2,h=Math.tan(t.pressureAngle*Math.PI/180),d=s/2-t.module*h,u=s/2+(t.module+t.clearance)*h,_=t.boreDiameter/2,p=_>0?Math.acos(_/c)*0.8:1/0,m=Math.max(Math.ceil(t.radialSegments/t.starts),Math.ceil(Math.PI*2/(t.starts*p))),A=Math.max(t.segmentsPerTurn,t.radialSegments,t.starts*12,Math.ceil(Math.PI*2/p)),g=Math.max(1,Math.ceil(t.length/i*A)),f=_>0?t.radialSegments*2:2;if(!Number.isFinite(m)||!Number.isFinite(g)||(g+1)*(m+6)*t.starts+f>1e6)throw Error("Worm gear exceeds mesh resolution limit (1000000 vertices); reduce length or resolution, or increase module or bore wall thickness");let y=[0,d/r,s/(2*r),u/r,1-u/r,1-s/(2*r),1-d/r,1],x=[];for(let H=0;H<y.length-1;H++){let V=y[H],O=y[H+1]-V,U=Math.max(1,Math.ceil(O*m));for(let j=0;j<U;j++){let Y=V+O*j/U;if(x.length===0||Y-x[x.length-1]>0.000000000001)x.push(Y)}}let C=[];for(let H=0;H<t.starts;H++)for(let V of x){let O=Math.min(V,1-V)*r;C.push({angle:(H+V)*Math.PI*2/t.starts,radius:O<=d?a:O>=u?c:l+(s/2-O)/h})}let b=C.length,I=[],v=[],P=t.phase%360*Math.PI/180,M=t.handedness==="right"?1:-1,B=(H)=>{let V=I.length/3,O=P+M*(H/i)*Math.PI*2;for(let U of C){let j=U.angle+O;I.push(U.radius*Math.cos(j),U.radius*Math.sin(j),H)}return V},T=(H,V)=>{for(let O=0;O<b;O++){let U=(O+1)%b;v.push(H+O,H+U,V+U,H+O,V+U,V+O)}},N=B(0),D=N;for(let H=1;H<=g;H++){let V=B(t.length*(H/g));T(D,V),D=V}let L=D;if(t.boreDiameter===0){let H=(V,O,U)=>{let j=I.length/3;I.push(0,0,O);for(let Y=0;Y<b;Y++){let X=(Y+1)%b;v.push(j,V+(U?Y:X),V+(U?X:Y))}};H(N,0,!1),H(L,t.length,!0)}else{let H=t.radialSegments,V=(Y)=>{let X=I.length/3;for(let K=0;K<H;K++){let J=P+K*Math.PI*2/H;I.push(_*Math.cos(J),_*Math.sin(J),Y)}return X},O=V(0),U=V(t.length);for(let Y=0;Y<H;Y++){let X=(Y+1)%H;v.push(O+Y,U+X,O+X,O+Y,U+Y,U+X)}let j=(Y,X,K)=>{let J=Array.from({length:b},(ne,re)=>Y+re);J.push(...Array.from({length:H},(ne,re)=>X+re));let ee=J.flatMap((ne)=>[I[ne*3],I[ne*3+1]]),se=jI(ee,[b],2);for(let ne=0;ne<se.length;ne+=3){let re=J[se[ne]],Z=J[se[ne+1]],te=J[se[ne+2]],ie=(I[Z*3]-I[re*3])*(I[te*3+1]-I[re*3+1])-(I[Z*3+1]-I[re*3+1])*(I[te*3]-I[re*3]);v.push(re,ie>0===K?Z:te,ie>0===K?te:Z)}};j(N,O,!1),j(L,U,!0)}return{positions:I,indices:v}};function B8i(e){return gu(w8i(e))}function T8i({color:e="#737e8f",...t}){return Pe(Gn,{color:e,children:Pe(sd,{geometry:B8i(t)})})}var D8i=_u({name:"wormgear",schema:vIe,render:({fn:e,...t})=>Pe(T8i,{...t}),pads:"none"});function N8i(e){e.register(D8i)}function R8i(e){qIi(e),i9i(e),h9i(e),_9i(e),C9i(e),P9i(e),T9i(e),G9i(e),$9i(e),tvi(e),lvi(e),pvi(e),fvi(e),Ivi(e),Mvi(e),Nvi(e),Hvi(e),Yvi(e),Kvi(e),Zvi(e),a8i(e),u8i(e),f8i(e),I8i(e),M8i(e),N8i(e)}var DVn=new VIi;R8i(DVn);function Q8i(e){for(let o of["bodyWidth","bodyLength","bodyHeight","pitch","landWidth","landLength","landThickness"])if(!Number.isFinite(e[o])||e[o]<=0)throw Error(`${o} must be finite and positive`);for(let o of["landsPerSideX","landsPerSideY"])if(!Number.isInteger(e[o])||e[o]<0)throw Error(`${o} must be a nonnegative integer`);if(!Number.isFinite(e.edgeInset)||e.edgeInset<0||e.landThickness>=e.bodyHeight||e.landWidth>=e.pitch||e.landsPerSideX+e.landsPerSideY<1)throw Error("Invalid land layout or thickness");let t=[{count:e.landsPerSideX,across:e.bodyWidth,along:e.bodyLength,horizontal:!0},{count:e.landsPerSideY,across:e.bodyLength,along:e.bodyWidth,horizontal:!1}];for(let o of t){if(o.count===0)continue;let r=(o.count-1)*e.pitch+e.landWidth;if(r>=o.along-2*e.edgeInset||2*(e.edgeInset+e.landLength)>=o.across)throw Error("Lands must fit below the body without opposite-row overlap");let i=o.horizontal?e.landsPerSideY:e.landsPerSideX;if(i>0&&r>=o.along-2*(e.edgeInset+e.landLength)&&(i-1)*e.pitch+e.landWidth>=o.across-2*(e.edgeInset+e.landLength))throw Error("Adjacent land rows overlap at corners")}let n=Math.min(e.bodyWidth,e.bodyLength)*0.035;return pn(Uo,{children:[Pe(Gn,{color:"#353535",children:pn(Il,{children:[Pe(ho,{z:(e.bodyHeight+e.landThickness/2)/2,children:Pe(Ht,{size:[e.bodyWidth,e.bodyLength,e.bodyHeight-e.landThickness/2]})}),Pe(ho,{offset:[-e.bodyWidth/2+2*n,e.bodyLength/2-2*n,e.bodyHeight],children:Pe(Yi,{radius:n,height:Math.min(0.04,e.bodyHeight/10)})})]})}),Pe(Gn,{color:"#c5b987",children:t.flatMap((o)=>[-1,1].flatMap((r)=>Array.from({length:o.count},(i,s)=>{let a=r*(o.across/2-e.edgeInset-e.landLength/2),c=((o.count-1)/2-s)*e.pitch;return Pe(ho,{offset:[o.horizontal?a:c,o.horizontal?c:a,e.landThickness/2],children:Pe(Ht,{size:o.horizontal?[e.landLength,e.landWidth,e.landThickness]:[e.landWidth,e.landLength,e.landThickness]})},`${o.horizontal}-${r}-${s}`)})))})]})}function hPe(e){let{pinCount:t,pitch:n,bodyWidth:o,bodyLength:r,bodyHeight:i,standoff:s,leadSpan:a,leadWidth:c,leadThickness:l,contactLength:h,taperInset:d,exposedPadWidth:u=0,exposedPadLength:_=0}=e;for(let I of["pitch","bodyWidth","bodyLength","bodyHeight","leadSpan","leadWidth","leadThickness","contactLength"])if(!Number.isFinite(e[I])||e[I]<=0)throw Error(`${I} must be finite and positive`);for(let[I,v]of Object.entries({standoff:s,taperInset:d,exposedPadWidth:u,exposedPadLength:_}))if(!Number.isFinite(v)||v<0)throw Error(`${I} must be finite and nonnegative`);if(!Number.isInteger(t)||t<4||t%2)throw Error("pinCount must be even and at least 4");let p=i-s,m=(a-o)/2,A=(t/2-1)*n+c;if(p<=l*2||c>=n||A>=r-2*d||d*2>=Math.min(o,r)||h>=m)throw Error("Invalid mold, lead spacing, or terminal reach");if(u===0!==(_===0)||u>=o-2*d||_>=r-2*d)throw Error("Exposed pad must fit inside the bottom mold face");let g=s+p/2,f=Math.min(0.002,p/100),y=pn(Oa,{children:[Pe(ho,{z:s+f/2,children:Pe(Ht,{size:[o-2*d,r-2*d,f]})}),Pe(ho,{z:g,children:Pe(Ht,{size:[o,r,f]})}),Pe(ho,{z:i-f/2,children:Pe(Ht,{size:[o-2*d,r-2*d,f]})})]}),x=Math.min(o,r)*0.045,C=Math.min(0.04,p/10),b=(I,v)=>{let P=a/2,M=o/2-Math.min(o/8,0.15),B=P-h,T=o/2+Math.min(0.08,(m-h)/4),N=[[P-f/2,l/2],[B,l/2]];for(let L=1;L<=12;L++){let H=L/12;N.push([B+(T-B)*H,l/2+(g-l/2)*H*H*(3-2*H)])}N.push([M,g]);let D=([L,H])=>Pe(ho,{offset:{x:I*L,y:v,z:H},children:Pe(Ht,{size:[f,c,l]})});return Pe(S0,{children:N.slice(1).map((L,H)=>pn(Oa,{children:[D(N[H]),D(L)]},H))})};return pn(Uo,{children:[Pe(Gn,{color:"#353535",children:pn(Il,{children:[y,Pe(ho,{offset:{x:-o/2+d+x*2,y:r/2-d-x*2,z:i},children:Pe(Yi,{radius:x,height:C*2})})]})}),Pe(Gn,{color:"#bfc1c4",children:Array.from({length:t},(I,v)=>b(v<t/2?-1:1,((t/2-1)/2-v%(t/2))*n))}),u>0&&Pe(Gn,{color:"#bfc1c4",children:Pe(ho,{z:(s+l)/2,children:Pe(Ht,{size:[u,_,s+l]})})})]})}var k8i=(e)=>hPe(e);function L8i(e){if(e.bodywidth===void 0&&e.bodyheight===void 0&&e.bodythickness===void 0)return null;if(e.fn==="ssop"){let t=e.bodywidth??e.w*0.55,n=e.bodyheight??(e.num_pins/2-1)*e.p+e.pw+0.4,o=e.bodythickness??1,r=Math.min(e.pw,e.p*0.5),i=(e.num_pins/2-1)*e.p+r;if(n<=i)throw Error("SSOP bodyheight must contain the lead row");let s=Math.max(e.w+0.2+e.pl/2,t+e.p),a=Math.min(0.1,o/10);return Pe(k8i,{pinCount:e.num_pins,pitch:e.p,bodyWidth:t,bodyLength:n,bodyHeight:o+a,standoff:a,leadSpan:s,leadWidth:r,leadThickness:Math.min(0.15,o/4),contactLength:Math.min(e.pl/2,(s-t)/4),taperInset:Math.min(0.12,(n-i)/4,t/8)})}if(e.fn==="lga"){let t=e.bodywidth??e.w,n=e.bodyheight??e.h,o=e.bodythickness??1,r=e.grid,i=Math.min(e.pw,e.p/2),s=t-((r.y-1)*e.p+i),a=n-((r.x-1)*e.p+i),c=Math.min(e.pl/2,t/8,n/8,s/4,a/4);return Pe(Q8i,{bodyWidth:t,bodyLength:n,bodyHeight:o,landsPerSideX:r.x,landsPerSideY:r.y,pitch:e.p,landWidth:i,landLength:c,edgeInset:0,landThickness:Math.min(0.015,o/10)})}return null}var Hd=({center:e,width:t,length:n,height:o,heightAboveSurface:r=0.15,color:i="#555",taperRatio:s=0.12,faceRatio:a=0.75,straightHeightRatio:c=0.5,includeNotch:l=!0,notchRadius:h,notchPosition:d,notchRotation:u=[0,0,0],notchLength:_=0.5,notchWidth:p=0.25,chamferSize:m=0})=>{let A=o*c,g=o-A,f=Math.min(t,n)*s,y=Math.max(t-f,t*a),x=Math.max(n-f,n*a),C=Math.min(t,n)*0.12,b=h??C,I={x:0,y:n/2-b*0.25,z:o},v=d??I,P=pn(S0,{children:[pn(Oa,{children:[Pe(ho,{z:0.005,children:Pe(Ht,{size:[y,x,0.01]})}),Pe(ho,{z:A,children:Pe(Ht,{size:[t,n,0.01]})})]}),pn(Oa,{children:[Pe(ho,{z:A,children:Pe(Ht,{size:[t,n,0.01]})}),Pe(ho,{z:A+g,children:Pe(Ht,{size:[y,x,0.01]})})]})]}),M=(T,N)=>Pe(ho,{offset:{x:T,y:N,z:0},children:Pe(ic,{rotation:[0,0,Math.PI/4],children:Pe(Ht,{size:[m*Math.SQRT2,m*Math.SQRT2,o*3]})})}),B=P;if(m>0){let T=t/2,N=n/2;B=pn(Il,{children:[P,M(T,N),M(-T,N),M(T,-N),M(-T,-N)]})}return Pe(Gn,{color:i,material:Qr.moldedPlastic,children:Pe(ho,{offset:e,children:Pe(ho,{offset:{x:0,y:0,z:r},children:l?pn(Il,{children:[B,Pe(ho,{offset:v,children:Pe(ic,{rotation:u,children:Pe(Yi,{radius:b,height:p})})})]}):B})})})},H8i=(e)=>Array.from({length:e},(t,n)=>n);function Hht(e,t){if(e.length<2)throw Error("Stroke must have at least two points");let n=Array.isArray(e[0])?e.map(([h,d])=>({x:h,y:d})):e,o=t/2,r=[],i=[];function s(h,d){let u=d.x-h.x,_=d.y-h.y,p=Math.sqrt(u*u+_*_);return{x:-_/p,y:u/p}}function a(h,d,u){let _={x:h.x+d.x*o*u,y:h.y+d.y*o*u};if(u>0)r.push(_);else i.unshift(_)}let c=s(n[0],n[1]);a(n[0],c,1),a(n[0],c,-1);for(let h=1;h<n.length-1;h++){let d=n[h-1],u=n[h],_=n[h+1],p=s(d,u),m=s(u,_),A=p.x+m.x,g=p.y+m.y,f=Math.sqrt(A*A+g*g),y=2;if(f/2>2*o)a(u,p,1),a(u,m,1),a(u,p,-1),a(u,m,-1);else{let x=1/f;a(u,{x:A*x,y:g*x},1),a(u,{x:A*x,y:g*x},-1)}}let l=s(n[n.length-2],n[n.length-1]);return a(n[n.length-1],l,1),a(n[n.length-1],l,-1),[...r,...i]}var F8i=(e)=>{let t=Math.min(...e.map((a)=>a.x)),n=Math.max(...e.map((a)=>a.x)),o=Math.min(...e.map((a)=>a.y)),s=5.47/(Math.max(...e.map((a)=>a.y))-o);return e.map((a)=>({x:(a.x-t-(n-t)/2)*s,y:(a.y-o)*s}))},z8i=F8i([{x:20,y:105},{x:20,y:109},{x:20,y:102},{x:26,y:102},{x:26,y:109},{x:24,y:111},{x:24,y:118},{x:22,y:118},{x:22,y:111},{x:20,y:109}]),KOn=5.47,oPe=0.5,O8i=({x:e,y:t,z:n})=>{let o=e>0;return pn(Uo,{children:[Pe(ho,{material:Qr.tinnedLead,offset:{x:e+0.125,y:t,z:n},children:Pe(ic,{rotation:["-90deg",0,"90deg"],children:Pe(Pee,{height:0.25,children:Pe(See,{points:z8i.slice().reverse().map((r)=>[r.x,r.y])})})})}),Pe(ho,{offset:{x:e,y:t+(o?1:-1),z:n},children:Pe(ic,{rotation:["-90deg","90deg",o?"180deg":"0deg"],children:Pe(Pee,{height:2,children:Pe(See,{points:Hht([[0,0],[-1,0],[-1,-1]],0.25).map((r)=>[r.x,r.y])})})})})]})},V8i=({numPins:e=8,pitch:t=2.54,bodyWidth:n=6.4,rowSpacing:o})=>{let r=Math.floor(e/2),i=o??(n>=7?n:n+1.22),s=n>=7?i-1.22:n;return pn(Uo,{children:[H8i(e).map((a)=>{let c=a%r,l=(Math.floor(a/r)-0.5)*2;return Pe(O8i,{x:l*i/2,y:c*t-(r-1)/2*t,z:KOn/2+oPe},a)}),Pe(Hd,{width:s,length:r*t+0.5,height:KOn-oPe,heightAboveSurface:oPe,center:{x:0,y:0,z:oPe}})]})};function Y8i(e,{height:t,padContactLength:n,curveLength:o,bodyDistance:r,steepness:i=10}){if(!o)o=r*0.3;let s=r-n-o;if(s<0)o+=s,s=0;let a=n*0.75,c=n+o+(r-n-o)*0.25;if(e<=a)return 0;if(e>=c)return t;let l=(e-a)/(c-a);return t/(1+Math.exp(-i*(l-0.5)))}var _i=(e)=>{let{thickness:t,width:n,padContactLength:o,bodyDistance:r,height:i,rotation:s}=e,a=15,c=Array.from({length:15}).map((h,d)=>d/14*r).map((h)=>[h,Y8i(h,e)]),l=Hht(c,t);return Pe(Gn,{color:"#c4c7ca",material:Qr.tinnedLead,children:Pe(ho,{offset:{z:0,y:0,x:0,...e.position},children:Pe(ic,{rotation:["90deg",0,s??0],children:Pe(ho,{offset:{x:0,y:0,z:-n/2},children:Pe(Pee,{height:n,children:Pe(See,{points:l.map((h)=>[h.x,h.y])})})})})})})},G8i=({pinCount:e,leadLength:t,leadWidth:n,pitch:o,bodyWidth:r})=>{let i=Math.ceil(e/2),s=i<=4,a=(i-1)*o/2,c=o*Math.max(i-1,0)+(s?1.5:1.15),l=r-(s?0.66:0.58),h=0.15,d=0.8,u=1.22,_=0.24,p=t*0.5,m=p+Math.max(0.22,Math.min(0.4,t*0.65)),A=r/2+t/2,g=m*0.1,f=Math.min(Math.min(l,c)*0.18,1),y=Math.min(Math.min(l,c)*0.12,0.45);return pn(Uo,{children:[Array.from({length:i}).map((x,C)=>Pe(_i,{position:{x:-A,y:C*o-a,z:0.075},width:n,thickness:0.15,padContactLength:p,bodyDistance:m,curveLength:g,height:0.8},`left-${C}`)),Array.from({length:i}).map((x,C)=>Pe(_i,{rotation:Math.PI,position:{x:A,y:C*o-a,z:0.075},width:n,thickness:0.15,padContactLength:p,bodyDistance:m,curveLength:g,height:0.8},`right-${C}`)),Pe(Hd,{center:{x:0,y:0,z:0},width:l,length:c,height:1.22,notchPosition:{x:-(l/2-f-0.2),y:c/2-f-0.2,z:1.22},notchRadius:y})]})},U8i=(e)=>("leadSpan"in e)?hPe(e):G8i(e),W8i=({pinCount:e,padContactLength:t=0.4,leadWidth:n=0.2,pitch:o=0.65,bodyWidth:r=3})=>{let i=Math.ceil(e/2),s=(i-1)*o/2,a=0.2;return pn(Uo,{children:[Array.from({length:i}).map((c,l)=>Pe(_i,{position:{x:-r/2-t-0.3,y:l*o-s,z:0.1},width:n,thickness:0.2,padContactLength:t,bodyDistance:t+0.4,height:0.6},l)),Array.from({length:i}).map((c,l)=>Pe(_i,{rotation:Math.PI,position:{x:r/2+t+0.3,y:l*o-s,z:0.1},width:n,thickness:0.2,padContactLength:t,bodyDistance:t+0.4,height:0.6},l)),Pe(Hd,{center:{x:0,y:0,z:0.1},width:r,length:r,height:1.1,notchRadius:0.35,heightAboveSurface:0.1,taperRatio:0.09})]})},X8i=(e)=>("leadSpan"in e)?hPe(e):W8i(e),bht=1,dht=0.5,pee=0.5,P0e=0.2,j8i=bht-P0e*2,$On=({color:e="#333"})=>pn(Uo,{children:[Pe(Ht,{size:[j8i,dht,pee],offset:[0,0,pee/2],material:Qr.moldedPlastic,color:e}),Pe(Ht,{size:[P0e,pee,dht],offset:[bht/2-P0e/2,0,pee/2],material:Qr.tinnedLead,color:"#ccc"}),Pe(Ht,{size:[P0e,pee,dht],offset:[-bht/2+P0e/2,0,pee/2],material:Qr.tinnedLead,color:"#ccc"})]}),Iht=1.6,K8i=Iht-0.6,rPe=0.3,uht=0.85,mee=0.6,qOn=({color:e="#333"})=>pn(Uo,{children:[Pe(Ht,{size:[K8i,uht,mee],offset:[0,0,mee/2],material:Qr.moldedPlastic,color:e}),Pe(Ht,{size:[rPe,uht,mee],offset:[Iht/2-rPe/2,0,mee/2],material:Qr.tinnedLead,color:"#ccc"}),Pe(Ht,{size:[rPe,uht,mee],offset:[-Iht/2+rPe/2,0,mee/2],material:Qr.tinnedLead,color:"#ccc"})]}),$8i={"0402":{length:1,width:0.5,height:0.5,terminalLength:0.2},"0603":{length:1.62,width:0.8,height:0.615,terminalLength:0.21},"0805":{length:2,width:1.25,height:0.75,terminalLength:0.35}};function q8i({footprint:e,color:t="#ffe8a0"}){let n=$8i[e];if(e==="0603")return pn(Uo,{children:[Pe(Gn,{color:"#f0eee7",children:Pe(yg,{size:[1.2,0.79,0.6],roundRadius:0.02,center:[0,0,0.31]})}),Pe(Gn,{color:"#c7c9ca",children:[-1,1].map((i)=>Pe(Ht,{size:[0.21,0.8,0.22],center:[i*0.705,0,0.11]},i))}),Pe(Gn,{color:t,children:Pe(Ht,{size:[0.72,0.52,0.01],center:[0,0,0.61]})})]});let o=Math.min(0.1,n.height/4),r=0.02;return pn(Uo,{children:[Pe(Gn,{color:"#f0eee7",children:Pe(ho,{z:(n.height+o-r)/2,children:Pe(Ht,{size:[n.length,n.width,n.height-o-r]})})}),Pe(Gn,{color:"#c7c9ca",children:[-1,1].map((i)=>Pe(ho,{offset:[i*(n.length-n.terminalLength)/2,0,o/2],children:Pe(Ht,{size:[n.terminalLength,n.width,o]})},i))}),Pe(Gn,{color:t,children:Pe(ho,{z:n.height-r/2,children:Pe(Ht,{size:[n.length*0.45,n.width*0.65,r]})})})]})}var vht=2,pht=1.25,_ee=0.55,E0e=0.5,J8i=vht-E0e*2,JOn=({color:e="#333"})=>pn(Uo,{children:[Pe(Ht,{size:[J8i,pht,_ee],offset:[0,0,_ee/2],material:Qr.moldedPlastic,color:e}),Pe(Ht,{size:[E0e,pht,_ee],offset:[vht/2-E0e/2,0,_ee/2],material:Qr.tinnedLead,color:"#ccc"}),Pe(Ht,{size:[E0e,pht,_ee],offset:[-vht/2+E0e/2,0,_ee/2],material:Qr.tinnedLead,color:"#ccc"})]}),ZOn=({pinCount:e,pitch:t,leadWidth:n,padContactLength:o,bodyWidth:r})=>{let i=e/4;if(!t)t=Z8i(e,r);if(!o)o=e7i(e);if(!n)n=t7i(e,r);if(!r)r=t*(i+4);let s=o,a=r,c=(i-1)*t/2,l=s*0.5,h=a+2*l,d=h,u=0.8,_=0.15,p=l,m=l*0.5,A=l*0.18;return pn(Uo,{children:[Array.from({length:i}).map((g,f)=>Pe(_i,{position:{x:-d/2,y:f*t-c,z:_/2},width:n,thickness:_,padContactLength:m,bodyDistance:p,curveLength:A,height:u},`left-${f}`)),Array.from({length:i}).map((g,f)=>Pe(_i,{rotation:Math.PI,position:{x:d/2,y:f*t-c,z:_/2},width:n,thickness:_,padContactLength:m,bodyDistance:p,curveLength:A,height:u},`right-${f}`)),Array.from({length:i}).map((g,f)=>Pe(_i,{rotation:Math.PI/2,position:{x:f*t-c,y:-h/2,z:_/2},width:n,thickness:_,padContactLength:m,bodyDistance:p,curveLength:A,height:u},`bottom-${f}`)),Array.from({length:i}).map((g,f)=>Pe(_i,{rotation:-Math.PI/2,position:{x:f*t-c,y:h/2,z:_/2},width:n,thickness:_,padContactLength:m,bodyDistance:p,curveLength:A,height:u},`top-${f}`)),Pe(Hd,{center:{x:0,y:0,z:0},width:r,length:a,height:1.5,taperRatio:0.03,chamferSize:0.7,notchPosition:{x:-(a/2-1.5),y:r/2-1.5,z:1.5},notchRadius:0.75})]})},Z8i=(e,t)=>{switch(e){case 44:case 64:return 0.8;case 52:return t===14?1:0.65;case 208:return 0.5;default:return 0.5}},e7i=(e)=>{switch(e){case 32:return 0.6;case 40:return 0.6;case 52:case 64:return 0.65;case 208:return 1.65;default:return 0.6}},t7i=(e,t)=>{switch(e){case 44:case 64:return 0.5;case 52:return t===14?0.45:0.55;case 208:return 0.3;default:return 0.25}},gee="#c0c0c0",NVn=({x:e,y:t,pinThickness:n,shortSidePinLength:o,longSidePinLength:r,bodyHeight:i,bodyLength:s=2.54,bodyWidth:a=2.54,flipZ:c,smd:l,rightangle:h})=>pn(Uo,{children:[Pe(ho,{y:h?-3:0,children:Pe(Ht,{color:"#222",material:Qr.moldedPlastic,size:[s,a,i],center:[e,t,c(i/2)]})}),Pe(Gn,{color:gee,material:Qr.goldContact,children:l?Pe(_i,{rotation:-Math.PI/2,position:{x:e,y:t+1,z:n/2},thickness:n,width:n,height:n,padContactLength:2,bodyDistance:3}):pn(Oa,{children:[Pe(Ht,{color:gee,size:[n,n,o*0.9],center:[e,t,c(i*0.9+i/2)]}),Pe(Ht,{color:gee,size:[n/1.8,n/1.8,o],center:[e,t,c(i+i/2)]})]})}),Pe(Gn,{color:gee,material:Qr.goldContact,children:Pe(ho,{y:h?-3.9:0,z:h?1:0,children:Pe(ic,{rotation:h?[-Math.PI/2,0,0]:[0,0,0],children:pn(Oa,{children:[Pe(Ht,{color:gee,size:[n,n,r*0.9],center:[e,t,c(-r/2*0.9)]}),Pe(Ht,{color:gee,size:[n/1.8,n/1.8,r],center:[e,t,c(-r/2)]})]})})})})]}),eVn=({numberOfPins:e,pitch:t=2.54,longSidePinLength:n=6,invert:o,rows:r=1,smd:i,rightangle:s})=>{let l=Math.ceil(e/r),h=2.54,d=3,u=-((l-1)/2)*t,p=!i&&!s?!o:Boolean(o),m=(A)=>p?-A+2:A;return Pe(Uo,{children:Array.from({length:e},(A,g)=>{let f=Math.floor(g/l),y=g%l,x=u+y*t,C=((r-1)/2-f)*2.54;return Pe(NVn,{x,y:C,pinThickness:0.63,shortSidePinLength:3,longSidePinLength:n,bodyHeight:2,flipZ:m,smd:i,rightangle:s},g)})})};function n7i(e){let{num_pins:t,bodyWidth:n,bodyLength:o,bodyHeight:r,standoff:i,terminalSpanX:s,terminalSpanY:a,terminalThickness:c,padWidth:l,padLength:h,pitch:d,exposedPadWidth:u,exposedPadLength:_}=e;for(let g of["bodyWidth","bodyLength","bodyHeight","terminalSpanX","terminalSpanY","terminalThickness","padWidth","padLength","pitch","exposedPadWidth","exposedPadLength"])if(!Number.isFinite(e[g])||e[g]<=0)throw Error(`${g} must be finite and positive`);if(!Number.isInteger(t)||t<8||t%4)throw Error("num_pins must be divisible by four and at least eight");if(!Number.isFinite(i)||i<0)throw Error("standoff must be finite and nonnegative");let p=(t/4-1)*d+l;if(c<=i||c>=r||l>=d||p>=Math.min(n,o))throw Error("Invalid mold, terminal thickness or spacing");if(s<n||a<o||s/2-h>=n/2||a/2-h>=o/2||u>=Math.min(n,s-2*h)||_>=Math.min(o,a-2*h)||p>=Math.min(s,a)-2*h)throw Error("Terminals must enter the mold and clear the exposed pad and corners");let m=Pe(ho,{z:(r+i)/2,children:Pe(Ht,{size:[n,o,r-i]})}),A=Math.min(n,o)*0.035;return pn(Uo,{children:[Pe(Gn,{color:"#353535",children:pn(Il,{children:[m,Pe(ho,{offset:{x:-n/2+A*2,y:o/2-A*2,z:r},children:Pe(Yi,{radius:A,height:Math.min(0.06,(r-i)/5)})})]})}),Pe(Gn,{color:"#bfc1c4",children:Array.from({length:t},(g,f)=>{let y=Math.floor(f/(t/4)),x=((t/4-1)/2-f%(t/4))*d,C=y%2===0,b=y<2?-1:1,I=((C?s:a)-h)/2*b;return Pe(ho,{offset:{x:C?I:x,y:C?x:I,z:c/2},children:Pe(Ht,{size:C?[h,l,c]:[l,h,c]})},f)})}),Pe(Gn,{color:"#bfc1c4",children:Pe(ho,{z:c/2,children:Pe(Ht,{size:[u,_,c]})})})]})}var o7i=(e)=>{let t=["left","bottom","right","top"],{pin_count:n,pn:o,w:r,h:i,p:s,pl:a,legsoutside:c}=e,l=n/4,h=t[Math.floor((o-1)/l)],d=(o-1)%l,u=s*(l-1),_=s*(l-1),p=c?a/2:-a/2;switch(h){case"left":return{x:-r/2-p,y:_/2-d*s,o:"vert"};case"bottom":return{x:-u/2+d*s,y:-i/2-p,o:"horz"};case"right":return{x:r/2+p,y:-_/2+d*s,o:"vert"};case"top":return{x:u/2-d*s,y:i/2+p,o:"horz"};default:throw Error("Invalid pin number")}},r7i=({num_pins:e,cw:t,ccw:n,startingpin:o})=>{let r=[],i=e/4,s=1,a={};for(let c of o??[])a[c]=!0;if(!a.leftside&&!a.topside&&!a.rightside&&!a.bottomside)a.leftside=!0;if(!a.bottompin&&!a.leftpin&&!a.rightpin&&!a.toppin){if(a.leftside)a.toppin=!0;else if(a.topside)a.rightpin=!0;else if(a.rightside)a.bottompin=!0;else if(a.bottomside)a.leftpin=!0}if(a.leftside&&a.toppin)s=1;else if(a.leftside&&a.bottompin)s=i;else if(a.bottomside&&a.leftpin)s=i+1;else if(a.bottomside&&a.rightpin)s=i*2;else if(a.rightside&&a.bottompin)s=i*2+1;else if(a.rightside&&a.toppin)s=i*3;else if(a.topside&&a.rightpin)s=i*3+1;else if(a.topside&&a.leftpin)s=i*4;r.push(-1);for(let c=0;c<e;c++)if(r[s]=c+1,n||!t){if(s++,s>e)s=1}else if(s--,s<1)s=e;return r},i7i=({num_pins:e=16,bodyWidth:t=9,bodyLength:n=9,bodyThickness:o=0.8,thermalPadSize:r,padWidth:i=0.25,padLength:s=0.25,pitch:a=0.5,thermalPadThickness:c=0.05})=>{let l=r7i({num_pins:e,cw:!0,ccw:!0}),h=[],d=e/4;for(let u=0;u<e;u++){let{x:_,y:p,o:m}=o7i({pin_count:e,pn:u+1,w:t,h:n,p:a,pl:s,legsoutside:!1}),A=i,g=s;if(m==="vert")[A,g]=[g,A];let f=l[u+1];h.push({pn:f,x:_,y:p,pw:A,pl:g})}return pn(Uo,{children:[Pe(Gn,{material:Qr.tinnedLead,color:"grey",children:Pe(Ht,{center:[0,0,o/2],size:[t,n,o]})}),h.map((u,_)=>Pe(Ht,{center:[u.x,u.y,c/2],size:[u.pw,u.pl,c]},_)),r?.length!==void 0&&r?.width!==void 0&&Pe(Ht,{center:[0,0,c/2],size:[r.width,r.length,c]})]})},s7i=(e)=>("bodyHeight"in e)?n7i(e):i7i(e),tVn=s7i,a7i=()=>pn(Uo,{children:[Pe(_i,{rotation:Math.PI,position:{x:1.6999999999999997,y:-1,z:0.075},width:0.4,thickness:0.15,padContactLength:0.5,bodyDistance:1.1999999999999997,height:0.95},1),Pe(_i,{rotation:Math.PI,position:{x:1.6999999999999997,y:1,z:0.075},width:0.4,thickness:0.15,padContactLength:0.5,bodyDistance:1.1999999999999997,height:0.95},2),Pe(_i,{position:{x:-1.6999999999999997,y:0,z:0.075},width:0.4,thickness:0.15,padContactLength:0.5,bodyDistance:1.1999999999999997,height:0.95},3),Pe(_i,{position:{x:-1.6999999999999997,y:-1,z:0.075},width:0.4,thickness:0.15,padContactLength:0.5,bodyDistance:1.1999999999999997,height:0.95},1),Pe(_i,{position:{x:-1.6999999999999997,y:1,z:0.075},width:0.4,thickness:0.15,padContactLength:0.5,bodyDistance:1.1999999999999997,height:0.95},2),Pe(Hd,{center:{x:0,y:0,z:0},width:1.6,length:2.9,height:1.2})]}),nVn=a7i,c7i=({fullWidth:e=2.9,fullLength:t=2.8,color:n}={})=>{let d=(e-1.3)/2+0.3;return pn(Uo,{children:[Pe(_i,{position:{x:-e/2,y:0.95,z:0.075},width:0.4,thickness:0.15,padContactLength:0.4,bodyDistance:d,height:0.95},1),Pe(_i,{position:{x:-e/2,y:-0.95,z:0.075},width:0.4,thickness:0.15,padContactLength:0.4,bodyDistance:d,height:0.95},2),Pe(_i,{rotation:Math.PI,position:{x:e/2,y:0,z:0.075},width:0.4,thickness:0.15,padContactLength:0.4,bodyDistance:d,height:0.95},3),Pe(Hd,{center:{x:0,y:0,z:0},width:1.3,length:2.9,height:1.1,color:n})]})},l7i=({fullWidth:e=2.9,fullLength:t=2.8})=>{let h=(e-1.92)/2+0.3;return pn(Uo,{children:[Pe(_i,{rotation:Math.PI,position:{x:e/2,y:0,z:0.075},width:0.4,thickness:0.15,padContactLength:0.25,bodyDistance:h,height:0.45},1),Pe(_i,{position:{x:-e/2,y:-0.95,z:0.075},width:0.4,thickness:0.15,padContactLength:0.25,bodyDistance:h,height:0.45},2),Pe(_i,{position:{x:-e/2,y:0.95,z:0.075},width:0.4,thickness:0.15,padContactLength:0.25,bodyDistance:h,height:0.45},3),Pe(Hd,{center:{x:0,y:0,z:0},width:1.92,length:2.9,height:1.1,straightHeightRatio:0.45,heightAboveSurface:0.05})]})},Sht=0.6,mht=0.3,Aee=0.33,M0e=0.1,h7i=Sht-M0e*2,oVn=({color:e="#333"})=>pn(Uo,{children:[Pe(Ht,{size:[h7i,mht,Aee],offset:[0,0,Aee/2],material:Qr.moldedPlastic,color:e}),Pe(Ht,{size:[M0e,mht,Aee],offset:[Sht/2-M0e/2,0,Aee/2],material:Qr.tinnedLead,color:"#ccc"}),Pe(Ht,{size:[M0e,mht,Aee],offset:[-Sht/2+M0e/2,0,Aee/2],material:Qr.tinnedLead,color:"#ccc"})]}),Pht=0.4,_ht=0.2,fee=0.13,w0e=0.07,d7i=Pht-w0e*2,rVn=({color:e="#333"})=>pn(Uo,{children:[Pe(Ht,{size:[d7i,_ht,fee],offset:[0,0,fee/2],material:Qr.moldedPlastic,color:e}),Pe(Ht,{size:[w0e,_ht,fee],offset:[Pht/2-w0e/2,0,fee/2],material:Qr.tinnedLead,color:"#ccc"}),Pe(Ht,{size:[w0e,_ht,fee],offset:[-Pht/2+w0e/2,0,fee/2],material:Qr.tinnedLead,color:"#ccc"})]}),Eht=3.2,ght=1.6,yee=0.9,B0e=0.5,u7i=Eht-B0e*2,iVn=({color:e="#333"})=>pn(Uo,{children:[Pe(Ht,{size:[u7i,ght,yee],offset:[0,0,yee/2],material:Qr.moldedPlastic,color:e}),Pe(Ht,{size:[B0e,ght,yee],offset:[Eht/2-B0e/2,0,yee/2],material:Qr.tinnedLead,color:"#ccc"}),Pe(Ht,{size:[B0e,ght,yee],offset:[-Eht/2+B0e/2,0,yee/2],material:Qr.tinnedLead,color:"#ccc"})]}),Mht=3.2,Aht=2.5,xee=1,T0e=0.6,p7i=Mht-T0e*2,sVn=({color:e="#333"})=>pn(Uo,{children:[Pe(Ht,{size:[p7i,Aht,xee],offset:[0,0,xee/2],material:Qr.moldedPlastic,color:e}),Pe(Ht,{size:[T0e,Aht,xee],offset:[Mht/2-T0e/2,0,xee/2],material:Qr.tinnedLead,color:"#ccc"}),Pe(Ht,{size:[T0e,Aht,xee],offset:[-Mht/2+T0e/2,0,xee/2],material:Qr.tinnedLead,color:"#ccc"})]}),wht=5,fht=2.5,Cee=1.4,D0e=0.6,m7i=wht-D0e*2,aVn=({color:e="#333"})=>pn(Uo,{children:[Pe(Ht,{size:[m7i,fht,Cee],offset:[0,0,Cee/2],material:Qr.moldedPlastic,color:e}),Pe(Ht,{size:[D0e,fht,Cee],offset:[wht/2-D0e/2,0,Cee/2],material:Qr.tinnedLead,color:"#ccc"}),Pe(Ht,{size:[D0e,fht,Cee],offset:[-wht/2+D0e/2,0,Cee/2],material:Qr.tinnedLead,color:"#ccc"})]}),Bht=6.3,yht=3.2,bee=1.8,N0e=0.8,_7i=Bht-N0e*2,cVn=({color:e="#333"})=>pn(Uo,{children:[Pe(Ht,{size:[_7i,yht,bee],offset:[0,0,bee/2],material:Qr.moldedPlastic,color:e}),Pe(Ht,{size:[N0e,yht,bee],offset:[Bht/2-N0e/2,0,bee/2],material:Qr.tinnedLead,color:"#ccc"}),Pe(Ht,{size:[N0e,yht,bee],offset:[-Bht/2+N0e/2,0,bee/2],material:Qr.tinnedLead,color:"#ccc"})]}),RVn=({x:e,y:t,z:n=0,pitch:o=2.54,legsLength:r=3,innerDiameter:i=0.945,bodyHeight:s=5,bodyLength:a=o,bodyWidth:c=o,flipZ:l})=>{let h=i||0.945,d=h/1.5,u=h,_=u*1.8,p=Math.min(s*0.18,o*0.24),m=s+0.1,A=l(n+m/2),g=n+s-p,f=d*1.6;return pn(Uo,{children:[Pe(Gn,{color:"#1a1a1a",children:pn(Il,{children:[Pe(Ht,{color:"#000",size:[a,c,s],center:[e,t,l(n+s/2)]}),Pe(Ht,{size:[u,u,m],center:[e,t,A]}),pn(Oa,{children:[Pe(Ht,{size:[u,u,0.01],center:[e,t,l(g)]}),Pe(Ht,{size:[_,_,0.01],center:[e,t,l(n+s)]})]})]})}),pn(Gn,{color:"silver",children:[pn(Oa,{children:[Pe(Ht,{color:"silver",size:[d,d,r*0.9],center:[e,t,l(n+-r/2*0.9)]}),Pe(Ht,{color:"silver",size:[d/1.8,d/1.8,r],center:[e,t,l(n+-r/2)]})]}),Pe(Ht,{color:"silver",size:[f,f,f*0.5],center:[e,t,l(n+f/2*0.5)]})]})]})},g7i=({numberOfPins:e,pitch:t=2.54,legsLength:n=3,innerDiameter:o=0.945,rows:r=1,invert:i})=>{let a=Math.ceil(e/r),c=2.54,l=-((a-1)/2)*t,h=(d)=>i?-d+5:d;return Pe(Uo,{children:Array.from({length:e},(d,u)=>{let _=Math.floor(u/a),p=u%a,m=l+p*t,A=((r-1)/2-_)*2.54;return Pe(RVn,{x:m,y:A,pitch:t,legsLength:n,innerDiameter:o,flipZ:h},u)})})},A7i=({width:e,length:t,innerDiameter:n=1})=>{let o=e,r=t,i=e*0.7,s=n/2.5;return pn(Uo,{children:[Pe(yg,{color:"#1a1a1f",center:[0,0,i/2],size:[r,r,i],roundRadius:0.3}),Pe(yg,{color:"#f2f2f2",center:[0,0,i+i*0.1/2.5],size:[r,r,i*0.1],roundRadius:0.14}),Pe(Yi,{color:"#1a1a1f",height:i*0.8,radius:o/3,center:[0,0,i+i*0.8/2]}),Pe(Yi,{color:"#1a1a1f",height:i*0.2,radius:n/2,center:[r/3,r/3,i+i*0.1/2]}),Pe(Yi,{color:"#1a1a1f",height:i*0.2,radius:n/2,center:[-r/3,-r/3,i+i*0.1/2]}),Pe(Yi,{color:"#1a1a1f",height:i*0.2,radius:n/2,center:[-r/3,r/3,i+i*0.1/2]}),Pe(Yi,{color:"#1a1a1f",height:i*0.2,radius:n/2,center:[r/3,-r/3,i+i*0.1/2]}),Pe(iPe,{thickness:n/3,width:s,horizontalLength:r*0.8,verticalLength:i/2,position:{x:-o/2,y:-r/2,z:-i*1.2}}),Pe(iPe,{thickness:n/3,width:s,horizontalLength:r*0.8,verticalLength:i/2,position:{x:-o/2,y:r/2,z:-i*1.2},rotation:Math.PI}),Pe(iPe,{thickness:n/3,width:s,horizontalLength:r*0.8,verticalLength:i/2,position:{x:o/2,y:r/2,z:-i*1.2},rotation:Math.PI}),Pe(iPe,{thickness:n/3,width:s,horizontalLength:r*0.8,verticalLength:i/2,position:{x:o/2+n/3.6,y:-r/2,z:-i*1.2}})]})},iPe=(e)=>{let{thickness:t,width:n,horizontalLength:o,verticalLength:r,rotation:i=0,position:s}=e,a=[[0,o],[-r/3,o/3],[-r/5,o/4],[0,0]],c=Hht(a,t);return Pe(Gn,{color:"#f2f2f2",children:Pe(ho,{offset:{x:s?.x||0,y:s?.y||0,z:s?.z||0},children:Pe(ic,{rotation:[0,55,i],children:Pe(Pee,{height:n,children:Pe(See,{points:c.map((l)=>[l.y,l.x])})})})})})},f7i=({pinCount:e,leadLength:t,leadWidth:n,pitch:o,bodyWidth:r})=>{let i=Math.ceil(e/2),s=(i-1)*o/2,a=0.25,c=1,l=0.8,h=t*0,d=o*(i-1)+n+0.2,u=r*0.55;return pn(Uo,{children:[Array.from({length:i}).map((_,p)=>Pe(_i,{position:{x:-r/2-h,y:p*o-s,z:0.125},width:n,thickness:0.25,padContactLength:t/2,bodyDistance:t+0.3,height:0.8},p)),Array.from({length:i}).map((_,p)=>Pe(_i,{rotation:Math.PI,position:{x:r/2+h,y:p*o-s,z:0.125},width:n,thickness:0.25,padContactLength:t/2,bodyDistance:t+0.3,height:0.8},p)),Pe(Hd,{center:{x:0,y:0,z:0.125},width:u,length:d,height:1})]})},y7i=(e)=>("leadSpan"in e)?hPe(e):f7i(e),x7i=({pinCount:e,pitch:t,leadWidth:n,leadLength:o,bodyWidth:r,bodyLength:i})=>{let s=e===8?{pitch:0.65,leadWidth:0.3,leadLength:1.6}:{pitch:0.5,leadWidth:0.225,leadLength:1.45},a=!isNaN(parseFloat(t))?parseFloat(t):s.pitch,c=!isNaN(parseFloat(n))?parseFloat(n)*0.8:s.leadWidth,l=!isNaN(parseFloat(o))?parseFloat(o):s.leadLength,h=!isNaN(parseFloat(r))?parseFloat(r)*0.8:2.6,d=!isNaN(parseFloat(i))?parseFloat(i):2+Number(a)*1.4,u=e/2,_=(u-1)*a/2,p=0.15,m=0.8,A=4.5,g=(4.5-h)/2,f=g*0.5;return pn(Uo,{children:[Array.from({length:u}).map((y,x)=>Pe(_i,{position:{x:-2.25,y:_-x*a,z:0.075},width:c,thickness:0.15,padContactLength:f+0.05,bodyDistance:g+0.1,height:0.8},`left-${x}`)),Array.from({length:u}).map((y,x)=>Pe(_i,{rotation:Math.PI,position:{x:2.25,y:_-x*a,z:0.075},width:c,thickness:0.15,padContactLength:f+0.05,bodyDistance:g+0.1,height:0.8},`right-${x}`)),Pe(Hd,{center:{x:0,y:0,z:0.075},width:h,length:d,height:1})]})},C7i=()=>pn(Uo,{children:[Pe(Ht,{color:"#ccc",size:[0.5,0.6,0.12],center:[-0.725,0,0.06]}),Pe(Ht,{color:"#ccc",size:[0.5,0.6,0.12],center:[0.725,0,0.06]}),Pe(Gn,{color:"#222",children:pn(S0,{children:[Pe(ho,{z:0.15,children:Pe(Ht,{size:[1.65,0.8,0.3]})}),pn(Oa,{children:[Pe(ho,{z:0.3,children:Pe(Ht,{size:[1.65,0.8,0.01]})}),Pe(ho,{z:0.6,children:Pe(Ht,{size:[1.45,0.6000000000000001,0.01]})})]})]})})]}),lVn=()=>pn(Uo,{children:[Pe(Ht,{color:"#ccc",size:[0.26,0.51,0.12],center:[-0.325,0,0.06]}),Pe(Ht,{color:"#ccc",size:[0.26,0.51,0.12],center:[0.325,0,0.06]}),Pe(Gn,{color:"#222",children:Pe(ho,{z:0.255,children:Pe(Ht,{size:[0.98,0.58,0.47]})})}),Pe(Ht,{color:"#ccc",size:[0.981,0.13,0.065],center:[0,0.13,0.1175]}),Pe(Ht,{color:"#ccc",size:[0.981,0.13,0.065],center:[0,-0.13,0.1175]}),Pe(Ht,{color:"#ccc",size:[0.17333333333333334,0.581,0.065],center:[0.325,0,0.1175]}),Pe(Ht,{color:"#ccc",size:[0.17333333333333334,0.581,0.065],center:[-0.325,0,0.1175]})]}),b7i=()=>{let l=Pe(Gn,{color:"#1a1a1a",children:pn(S0,{children:[pn(Oa,{children:[Pe(ho,{z:0.13,children:Pe(Ht,{size:[4,3,0.03]})}),Pe(ho,{z:1.15,children:Pe(Ht,{size:[4.4,3.4,0.01]})})]}),pn(Oa,{children:[Pe(ho,{z:1.15,children:Pe(Ht,{size:[4.4,3.4,0.01]})}),Pe(ho,{z:2.3,children:Pe(Ht,{size:[4,3,0.01]})})]})]})}),h=({xDir:d})=>{let p=d*1.78,m=d*2.5999999999999996,A=d*1.5999999999999999,g=Math.abs(A-m),f=(m+A)/2;return Pe(Gn,{color:"#c0c0c0",children:pn(S0,{children:[Pe(Ht,{size:[1.8399999999999999,1.45,0.2],center:[p,0,0.1]}),Pe(Ht,{size:[0.2,1.45,1.14],center:[m,0,0.77]}),Pe(Ht,{size:[g,1.45,0.2],center:[f,0,1.24]})]})})};return pn(Uo,{children:[Pe(h,{xDir:1}),Pe(h,{xDir:-1}),l]})},hVn=()=>{let l=Pe(Gn,{color:"#1a1a1a",children:pn(S0,{children:[pn(Oa,{children:[Pe(ho,{z:0.13,children:Pe(Ht,{size:[4.199999999999999,3.6,0.03]})}),Pe(ho,{z:1.15,children:Pe(Ht,{size:[4.6,4,0.01]})})]}),pn(Oa,{children:[Pe(ho,{z:1.15,children:Pe(Ht,{size:[4.6,4,0.01]})}),Pe(ho,{z:2.3,children:Pe(Ht,{size:[4.199999999999999,3.6,0.01]})})]})]})}),h=({xDir:d})=>{let p=d*2.08,m=d*2.9,A=d*1.9,g=Math.abs(A-m),f=(m+A)/2;return Pe(Gn,{color:"#c0c0c0",children:pn(S0,{children:[Pe(Ht,{size:[1.8399999999999999,1.45,0.2],center:[p,0,0.1]}),Pe(Ht,{size:[0.2,1.45,1.14],center:[m,0,0.77]}),Pe(Ht,{size:[g,1.45,0.2],center:[f,0,1.24]})]})})};return pn(Uo,{children:[Pe(h,{xDir:1}),Pe(h,{xDir:-1}),l]})},I7i=()=>{let l=Pe(Gn,{color:"#1a1a1a",children:pn(S0,{children:[pn(Oa,{children:[Pe(ho,{z:0.21000000000000002,children:Pe(Ht,{size:[6.3999999999999995,5.6,0.03]})}),Pe(ho,{z:1.15,children:Pe(Ht,{size:[6.8,6,0.01]})})]}),pn(Oa,{children:[Pe(ho,{z:1.15,children:Pe(Ht,{size:[6.8,6,0.01]})}),Pe(ho,{z:2.3,children:Pe(Ht,{size:[6.3999999999999995,5.6,0.01]})})]})]})}),h=({xDir:d})=>{let p=d*3.08,m=d*3.9,A=d*2.9,g=Math.abs(A-m),f=(m+A)/2;return Pe(Gn,{color:"#c0c0c0",children:pn(S0,{children:[Pe(Ht,{size:[1.8399999999999999,2.95,0.2],center:[p,0,0.1]}),Pe(Ht,{size:[0.2,2.95,1.14],center:[m,0,0.77]}),Pe(Ht,{size:[g,2.95,0.2],center:[f,0,1.24]})]})})};return pn(Uo,{children:[Pe(h,{xDir:1}),Pe(h,{xDir:-1}),l]})},v7i=()=>pn(Uo,{children:[Pe(Ht,{color:"#ccc",size:[1,1.2,0.25],center:[-1.3,0,0.125]}),Pe(Ht,{color:"#ccc",size:[1,1.2,0.25],center:[1.3,0,0.125]}),Pe(Gn,{color:"#222",children:pn(S0,{children:[Pe(ho,{z:0.27,children:Pe(Ht,{size:[2.9,1.9,0.54]})}),pn(Oa,{children:[Pe(ho,{z:0.54,children:Pe(Ht,{size:[2.9,1.9,0.01]})}),Pe(ho,{z:1.08,children:Pe(Ht,{size:[2.6999999999999997,1.7,0.01]})})]})]})})]}),S7i=()=>pn(Uo,{children:[Pe(Ht,{color:"#ccc",size:[1,0.6,0.12],center:[-1.3,0,0.06]}),Pe(Ht,{color:"#ccc",size:[1,0.6,0.12],center:[1.3,0,0.06]}),Pe(Gn,{color:"#222",children:pn(S0,{children:[Pe(ho,{z:0.275,children:Pe(Ht,{size:[2.7,1.6,0.55]})}),pn(Oa,{children:[Pe(ho,{z:0.55,children:Pe(Ht,{size:[2.7,1.6,0.01]})}),Pe(ho,{z:1.1,children:Pe(Ht,{size:[2.5,1.4000000000000001,0.01]})})]})]})})]}),P7i=()=>pn(Uo,{children:[Pe(Ht,{color:"#ccc",size:[1,0.9,0.2],center:[-1.3,0,0.1]}),Pe(Ht,{color:"#ccc",size:[1,0.9,0.2],center:[1.3,0,0.1]}),Pe(Gn,{color:"#222",children:pn(S0,{children:[Pe(ho,{z:0.1,children:Pe(Ht,{size:[2.75,1.8,0.2]})}),pn(Oa,{children:[Pe(ho,{z:0.2,children:Pe(Ht,{size:[2.75,1.8,0.01]})}),Pe(ho,{z:1,children:Pe(Ht,{size:[2.35,1.4,0.01]})})]})]})}),Pe(Ht,{color:"#777",size:[0.2,1.4,0.01],center:[-0.9,0,1]})]}),dVn=({bodyWidth:e=2.6,bodyLength:t=1.7,bodyHeight:n=1}={})=>{let o=e,r=t*0.53,i=e*0.35,s=0.2,a=-(o/2-0.075),c=o/2-0.075,l=0.4,h=0.1,d=n*0.2;return pn(Uo,{children:[Pe(Ht,{color:"#ccc",size:[i,r,0.2],center:[a,0,0.1]}),Pe(Ht,{color:"#ccc",size:[i,r,0.2],center:[c,0,0.1]}),Pe(Gn,{color:"#222",children:pn(S0,{children:[pn(Oa,{children:[Pe(ho,{z:d,children:Pe(Ht,{size:[o-0.05,t-0.05,0.01]})}),Pe(ho,{z:0.01,children:Pe(Ht,{size:[o-0.1,t-0.1,0.01]})})]}),pn(Oa,{children:[Pe(ho,{z:d,children:Pe(Ht,{size:[o,t,0.01]})}),Pe(ho,{z:n,children:Pe(Ht,{size:[o-0.4,t-0.4,0.01]})})]})]})}),Pe(Ht,{color:"#777",size:[0.54,t-0.4,0.02],center:[a+0.4,0,n]})]})},E7i=({fullWidth:e=3.7,fullLength:t=1.55}={})=>{let n=e-1,o=t,r=1.175,i=0.1,s=1.075,a=0.55,c=0.12,l=0.35,h=(e-n)/2,d=0.25,u=0.2;return pn(Uo,{children:[Pe(_i,{position:{x:-e/2,y:0,z:0.06},width:0.55,thickness:0.12,padContactLength:0.25,bodyDistance:h,curveLength:0.2,height:0.35}),Pe(_i,{rotation:Math.PI,position:{x:e/2,y:0,z:0.06},width:0.55,thickness:0.12,padContactLength:0.25,bodyDistance:h,curveLength:0.2,height:0.35}),Pe(Hd,{center:{x:0,y:0,z:0},width:n,length:o,height:1.075,heightAboveSurface:0.1,includeNotch:!1,color:"#222",taperRatio:0.06,straightHeightRatio:0.6}),Pe(Ht,{color:"#777",size:[0.45,o-0.15,0.02],center:[-n/4,0,1.175]})]})},M7i=()=>pn(Uo,{children:[Pe(Ht,{color:"#ccc",size:[0.9,1.75,0.2],center:[-1.825,0,0.1]}),Pe(Ht,{color:"#ccc",size:[0.9,1.75,0.2],center:[1.825,0,0.1]}),Pe(Gn,{color:"#222",children:pn(S0,{children:[pn(Oa,{children:[Pe(ho,{z:0.2,children:Pe(Ht,{size:[3.775,2.475,0.01]})}),Pe(ho,{z:0.01,children:Pe(Ht,{size:[3.75,2.45,0.01]})})]}),pn(Oa,{children:[Pe(ho,{z:0.2,children:Pe(Ht,{size:[3.8,2.5,0.01]})}),Pe(ho,{z:1,children:Pe(Ht,{size:[3.4,2.1,0.01]})})]})]})}),Pe(Ht,{color:"#777",size:[0.54,2.1,0.02],center:[-1.4249999999999998,0,1]})]}),w7i=()=>pn(Uo,{children:[Pe(Ht,{color:"#ccc",size:[0.4,0.25,0.14],center:[-0.4,0,0.07]}),Pe(Ht,{color:"#ccc",size:[0.4,0.25,0.14],center:[0.4,0,0.07]}),Pe(Gn,{color:"#222",children:pn(S0,{children:[Pe(ho,{z:0.07,children:Pe(Ht,{size:[0.8,0.6,0.14]})}),pn(Oa,{children:[Pe(ho,{z:0.14,children:Pe(Ht,{size:[0.8,0.6,0.01]})}),Pe(ho,{z:0.37,children:Pe(Ht,{size:[0.7000000000000001,0.5,0.01]})})]})]})})]}),uVn=({fullWidth:e=6.6,bodyWidth:t=3.5,bodyLength:n=6.5,bodyHeight:o=1.7,leadWidth:r=0.7,tabLeadWidth:i=3,padPitch:s=2.3,leadHeight:a=0.75}={})=>{let c=i,l=0.25,h=0.5,d=e-t;return pn(Uo,{children:[Pe(_i,{rotation:Math.PI,position:{x:e/2+d/4,y:0,z:0.125},width:c,thickness:0.25,padContactLength:0.5,bodyDistance:d,height:a},4),Pe(_i,{position:{x:-e/2-d/4,y:0,z:0.125},width:r,thickness:0.25,padContactLength:0.5,bodyDistance:d,height:a},3),Pe(_i,{position:{x:-e/2-d/4,y:-s,z:0.125},width:r,thickness:0.25,padContactLength:0.5,bodyDistance:d,height:a},1),Pe(_i,{position:{x:-e/2-d/4,y:s,z:0.125},width:r,thickness:0.25,padContactLength:0.5,bodyDistance:d,height:a},2),Pe(Hd,{center:{x:0,y:0,z:0},width:t,length:n,height:o,includeNotch:!1,taperRatio:0.06,straightHeightRatio:0.45})]})},B7i=()=>pn(Uo,{children:[Array.from({length:16}).map((_,p)=>Pe(_i,{position:{x:-5.25,y:p*0.5-3.75,z:0.125},width:0.2,thickness:0.25,padContactLength:0.45,bodyDistance:0.95,height:0.65},`left-${p}`)),Array.from({length:16}).map((_,p)=>Pe(_i,{rotation:Math.PI,position:{x:5.25,y:p*0.5-3.75,z:0.125},width:0.2,thickness:0.25,padContactLength:0.45,bodyDistance:0.95,height:0.65},`right-${p}`)),Array.from({length:16}).map((_,p)=>Pe(_i,{rotation:Math.PI/2,position:{x:p*0.5-3.75,y:-5.25,z:0.125},width:0.2,thickness:0.25,padContactLength:0.45,bodyDistance:0.95,height:0.65},`bottom-${p}`)),Array.from({length:16}).map((_,p)=>Pe(_i,{rotation:-Math.PI/2,position:{x:p*0.5-3.75,y:5.25,z:0.125},width:0.2,thickness:0.25,padContactLength:0.45,bodyDistance:0.95,height:0.65},`top-${p}`)),Pe(Hd,{center:{x:0,y:0,z:0},width:9,length:9,height:1.2,chamferSize:0.7,taperRatio:0.05,notchPosition:{x:-3.5,y:3.5,z:1.2},notchRadius:0.6})]}),T7i=B7i,D7i=()=>pn(Uo,{children:[Pe(_i,{rotation:Math.PI,position:{x:1.2249999999999999,y:0,z:0.09},width:0.3,thickness:0.18,padContactLength:0.2,bodyDistance:0.7999999999999998,height:0.65},4),Pe(_i,{position:{x:-1.2249999999999999,y:-0.65,z:0.09},width:0.3,thickness:0.18,padContactLength:0.2,bodyDistance:0.7999999999999998,height:0.65},1),Pe(_i,{position:{x:-1.2249999999999999,y:0.65,z:0.09},width:0.3,thickness:0.18,padContactLength:0.2,bodyDistance:0.7999999999999998,height:0.65},2),Pe(Hd,{center:{x:0,y:0,z:0},width:1.25,length:2,height:0.9,includeNotch:!1,taperRatio:0.06,straightHeightRatio:0.7,heightAboveSurface:0.05})]});function N7i(e){let{pinCount:t,pitch:n,bodyWidth:o,bodyLength:r,bodyHeight:i,standoff:s,leadSpanX:a,leadSpanY:c,leadWidth:l,leadThickness:h,contactLength:d,taperInset:u}=e;for(let b of["pitch","bodyWidth","bodyLength","bodyHeight","leadSpanX","leadSpanY","leadWidth","leadThickness","contactLength"])if(!Number.isFinite(e[b])||e[b]<=0)throw Error(`${b} must be finite and positive`);for(let[b,I]of Object.entries({standoff:s,taperInset:u}))if(!Number.isFinite(I)||I<0)throw Error(`${b} must be finite and nonnegative`);if(!Number.isInteger(t)||t<8||t%4)throw Error("pinCount must be divisible by four and at least eight");let _=i-s,p=Math.min(a-o,c-r)/2,m=(t/4-1)*n+l;if(_<=h*2||l>=n||m>=Math.min(o,r)-2*u||u*2>=Math.min(o,r)||d>=p)throw Error("Invalid mold, lead spacing, or terminal reach");let A=s+_/2,g=Math.min(0.002,_/100),f=pn(Oa,{children:[Pe(ho,{z:s+g/2,children:Pe(Ht,{size:[o-2*u,r-2*u,g]})}),Pe(ho,{z:A,children:Pe(Ht,{size:[o,r,g]})}),Pe(ho,{z:i-g/2,children:Pe(Ht,{size:[o-2*u,r-2*u,g]})})]}),y=Math.min(o,r)*0.045,x=Math.min(0.04,_/10),C=(b,I)=>{let v=b%2===0,P=b<2?-1:1,M=v?o:r,B=(v?a:c)/2,T=M/2-Math.min(M/8,0.15),N=B-d,D=M/2+Math.min(0.08,(p-d)/4),L=[[B-g/2,h/2],[N,h/2]];for(let V=1;V<=12;V++){let O=V/12;L.push([N+(D-N)*O,h/2+(A-h/2)*O*O*(3-2*O)])}L.push([T,A]);let H=([V,O])=>Pe(ho,{offset:{x:v?P*V:I,y:v?I:P*V,z:O},children:Pe(Ht,{size:v?[g,l,h]:[l,g,h]})});return Pe(S0,{children:L.slice(1).map((V,O)=>pn(Oa,{children:[H(L[O]),H(V)]},O))})};return pn(Uo,{children:[Pe(Gn,{color:"#353535",children:pn(Il,{children:[f,Pe(ho,{offset:{x:-o/2+u+y*2,y:r/2-u-y*2,z:i},children:Pe(Yi,{radius:y,height:x*2})})]})}),Pe(Gn,{color:"#bfc1c4",children:Array.from({length:t},(b,I)=>C(Math.floor(I/(t/4)),((t/4-1)/2-I%(t/4))*n))})]})}var R7i=({pinCount:e,pitch:t,leadWidth:n,padContactLength:o,bodyWidth:r})=>{let i=e/4;if(i!==Math.floor(i))throw Error(`LQFP pinCount must be divisible by 4, got ${e}`);if(!t)t=0.5;if(!o)o=0.6;if(!n)n=0.22;if(!r)r=t*(i+4);let s=r,a=(i-1)*t/2,c=s+3.3*o,l=c,h=0.8,d=0.2,u=(l-r)/2+0.4;return pn(Uo,{children:[Array.from({length:i}).map((_,p)=>Pe(_i,{position:{x:-l/2-0.36,y:p*t-a,z:d/2},width:n,thickness:d,padContactLength:o,bodyDistance:u,height:h},`left-${p}`)),Array.from({length:i}).map((_,p)=>Pe(_i,{rotation:Math.PI,position:{x:l/2+0.36,y:p*t-a,z:d/2},width:n,thickness:d,padContactLength:o,bodyDistance:u,height:h},`right-${p}`)),Array.from({length:i}).map((_,p)=>Pe(_i,{rotation:Math.PI/2,position:{x:p*t-a,y:-c/2-0.36,z:d/2},width:n,thickness:d,padContactLength:o,bodyDistance:u,height:h},`bottom-${p}`)),Array.from({length:i}).map((_,p)=>Pe(_i,{rotation:-Math.PI/2,position:{x:p*t-a,y:c/2+0.36,z:d/2},width:n,thickness:d,padContactLength:o,bodyDistance:u,height:h},`top-${p}`)),Pe(Hd,{center:{x:0,y:0,z:0},width:r,length:s,height:1.5,heightAboveSurface:0.1,taperRatio:0.04,chamferSize:0.7,notchPosition:{x:-(s/2-1.5),y:s/2-1.5,z:1.5},notchRadius:0.75})]})},Q7i=(e)=>("leadSpanX"in e)?N7i(e):R7i(e),k7i=()=>pn(Uo,{children:[Pe(Gn,{color:"#222",children:pn(S0,{children:[Pe(Ht,{size:[0.85,1.2,0.20900000000000002],center:[0,0,0.10450000000000001]}),pn(Oa,{children:[Pe(ho,{z:0.20900000000000002,children:Pe(Ht,{size:[0.85,1.2,0.01]})}),Pe(ho,{z:0.38,children:Pe(Ht,{size:[0.75,1.0999999999999999,0.01]})})]})]})}),Pe(Ht,{color:"#ccc",size:[0.3,0.25,0.1],center:[0.55,0,0.05]}),Pe(Ht,{color:"#ccc",size:[0.3,0.2,0.1],center:[-0.55,0.4,0.05]}),Pe(Ht,{color:"#ccc",size:[0.3,0.2,0.1],center:[-0.55,-0.4,0.05]})]}),pVn=({num_pins:e,bodyWidth:t=5.3,bodyLength:n=5.3,bodyThickness:o=1,thermalPadSize:r,padWidth:i=n/5.3*0.6,padLength:s=n/5.3*1,pitch:a=0.5,thermalPadThickness:c=0.2,bodyStyle:l="chamfered",standoff:h=0,terminalInset:d=0,terminalThickness:u=c,pin1TerminalChamfer:_=0,pin1MarkWidth:p=0})=>{if(l==="rectangular"){if(!Number.isInteger(e)||e<2||e%2!==0)throw Error("DFN requires an even pin count of at least two");for(let f of[t,n,o,i,s,a,u])if(!Number.isFinite(f)||f<=0)throw Error("DFN dimensions must be finite and positive");for(let f of[h,d,_,p])if(!Number.isFinite(f)||f<0)throw Error("DFN offsets must be finite and nonnegative");if(u<=h||u>h+o||d+s>=t/2||(e/2-1)*a+i>n||e>2&&i>=a||_>=Math.min(s,i/2)||p>=t/4)throw Error("DFN dimensions leave disconnected or overlapping terminals")}let m=[],A=Math.floor(e/2),g=a*(A-1);for(let f=0;f<e;f++){let y=f<A?"left":"right",x=f%A,C=g/2-x*a,b=s,I=i,v=y==="left"?-t/2+b/2+d:t/2-b/2-d,P=f+1;m.push({pinNumber:P,x:v,y:C,padSizeX:b,padSizeY:I})}if(l==="rectangular"){let f=h+o,y=Math.min(o,n)/100,x=Pe(Ht,{size:[p,n*0.8,y],center:[-t/2+p*1.5,0,f-y/2]}),C=Pe(Ht,{size:[t,n,o],center:[0,0,h+o/2]});return pn(Uo,{children:[Pe(Gn,{material:Qr.moldedPlastic,color:"#25272a",children:p>0?pn(Il,{children:[C,x]}):C}),Pe(Gn,{material:Qr.tinnedLead,color:"#c7c9cd",children:m.map((b)=>b.pinNumber===1&&_>0?pn(Oa,{children:[Pe(Ht,{size:[s-_,i,u],center:[b.x+_/2,b.y,u/2]}),Pe(Ht,{size:[s,i-2*_,u],center:[b.x,b.y,u/2]})]},b.pinNumber):Pe(Ht,{size:[b.padSizeX,b.padSizeY,u],center:[b.x,b.y,u/2]},b.pinNumber))}),r&&Pe(Ht,{material:Qr.tinnedLead,color:"#c7c9cd",size:[r.width,r.length,c],center:[0,0,c/2]}),p>0&&Pe(Gn,{color:"#969997",children:x})]})}return pn(Uo,{children:[Pe(Hd,{center:{x:0,y:0,z:0},width:t,length:n,height:o,heightAboveSurface:0,color:"grey",chamferSize:0.2,taperRatio:0,notchPosition:{x:-(t/2-s),y:n/2-s,z:o}}),m.map((f,y)=>Pe(Ht,{center:[f.x,f.y,c/2],size:[f.padSizeX,f.padSizeY,c]},y)),r?.length!==void 0&&r?.width!==void 0&&Pe(Ht,{center:[0,0,c/2],size:[r.width,r.length,c]})]})},L7i=({bodyLength:e=10.2,bodyWidth:t=4.65,bodyHeight:n=13.46,leadSpacing:o=5,leadDiameter:r=0.8,leadLength:i=12.7,color:s="#ddd",leadColor:a="#b87333"})=>{let c=e/2,l=t/2,h=c-l,d=o/2,u=0.85;return pn(Uo,{children:[pn(Gn,{color:s,children:[pn(Oa,{children:[Pe(Dy,{height:n,roundRadius:0.5,radius:l,center:[-h,0,n]}),Pe(Dy,{height:n,roundRadius:0.5,radius:l,center:[h,0,n]})]}),pn(Oa,{children:[Pe(Dy,{height:0.85,roundRadius:0.1,radius:l+0.85,center:[-h,0,n/2+0.425]}),Pe(Dy,{height:0.85,roundRadius:0.1,radius:l+0.85,center:[h,0,n/2+0.425]})]})]}),pn(Gn,{color:a,children:[Pe(Yi,{height:i+n/2,radius:r/2,center:[-d+0.06,0,-(i/2)+n/2]}),Pe(Yi,{height:i+n/2,radius:r/2,center:[d-0.06,0,-(i/2)+n/2]})]})]})},H7i=({bodyLength:e=1.4,bodyDiameter:t=1.1,color:n="#3a3a3aff",contactColor:o="#c6c6c6",cathodeIdentification:r="#111"})=>pn(Uo,{children:[Pe(Gn,{color:n,children:pn(ic,{rotation:[0,"90deg",0],children:[Pe(yg,{size:[t,t,e-0.2],roundRadius:0.2,center:[-t/2,0,0.05]}),Pe(Yi,{height:0.1,radius:t/2-0.2,center:[-t/2,0,-e/2+0.1]})]})}),Pe(Gn,{color:r,children:Pe(ic,{rotation:[0,"90deg",0],children:Pe(yg,{size:[t*1.01,t*1.01,e/3],roundRadius:0.2,center:[-t/2,0,-e/4+0.1]})})}),Pe(Gn,{color:o,children:Pe(ic,{rotation:[0,"90deg",0],children:Pe(Dy,{height:0.2,radius:t/2,roundRadius:0.06666666666666667,center:[-t/2,0,-e/2]})})}),Pe(Gn,{color:o,children:Pe(ic,{rotation:[0,"90deg",0],children:Pe(Dy,{height:0.2,radius:t/2,roundRadius:0.06666666666666667,center:[-t/2,0,e/2]})})})]}),mVn=({bodyLength:e=3.5,bodyDiameter:t=1.5,color:n="#202020",contactColor:o="#c6c6c6",bandColor:r="#f2f2f2"})=>{let s=e-0.8+0.04,a=(e-0.4)/2,c=t/2+0.02,l=0.14,h=-e/2+0.4+0.35;return pn(Uo,{children:[Pe(Gn,{color:n,children:Pe(ic,{rotation:[0,"90deg",0],children:Pe(Dy,{height:s,radius:t/2,roundRadius:0.05,center:[-t/2,0,0]})})}),Pe(Gn,{color:r,children:Pe(ic,{rotation:[0,"90deg",0],children:Pe(Yi,{height:0.14,radius:t/2+0.002,center:[-t/2,0,h]})})}),Pe(Gn,{color:o,children:Pe(ic,{rotation:[0,"90deg",0],children:Pe(Dy,{height:0.4,radius:c,roundRadius:0.04,center:[-t/2,0,-a]})})}),Pe(Gn,{color:o,children:Pe(ic,{rotation:[0,"90deg",0],children:Pe(Dy,{height:0.4,radius:c,roundRadius:0.04,center:[-t/2,0,a]})})})]})},F7i=({bodyLength:e=3.9,bodyDiameter:t=2.5,color:n="#3a3a3aff",contactColor:o="#c6c6c6"})=>pn(Uo,{children:[Pe(Gn,{color:n,children:Pe(ic,{rotation:[0,"90deg",0],children:Pe(Dy,{height:e,radius:t/2,roundRadius:0.3,center:[-t/2,0,0]})})}),Pe(Gn,{color:o,children:Pe(ic,{rotation:[0,"90deg",0],children:Pe(Dy,{height:0.55,radius:t/2,roundRadius:0.2,center:[-t/2,0,-e/2]})})}),Pe(Gn,{color:o,children:Pe(ic,{rotation:[0,"90deg",0],children:Pe(Dy,{height:0.55,radius:t/2,roundRadius:0.2,center:[-t/2,0,e/2]})})})]}),z7i=({pinCount:e,padContactLength:t=0.6,leadWidth:n=0.41,pitch:o=1.27})=>{if(e%2!==0)throw Error("MS012 pinCount must be even");let r=e/2,i=4.9,s=3.9,a=(r-1)*o/2,c=0.2;return pn(Uo,{children:[Array.from({length:r}).map((l,h)=>Pe(_i,{position:{x:-s/2-t-0.3,y:h*o-a,z:c/2},width:n,thickness:c,padContactLength:t,bodyDistance:t+0.4,height:0.85},h)),Array.from({length:r}).map((l,h)=>Pe(_i,{rotation:Math.PI,position:{x:s/2+t+0.3,y:h*o-a,z:c/2},width:n,thickness:c,padContactLength:t,bodyDistance:t+0.4,height:0.85},`right-${h}`)),Pe(Hd,{center:{x:0,y:0,z:c/2},width:s,length:i,height:1.55,notchPosition:{x:-(s/2-1),y:i/2-1,z:1.55},heightAboveSurface:0.17,taperRatio:0.09})]})},O7i=({pinCount:e=16,padContactLength:t=0.6,leadWidth:n=0.41,pitch:o=1.27})=>{if(e!==16)throw Error("MS013 only supports 16 pins");let r=e/2,i=7.5,s=10.3,a=(r-1)*o/2,c=0.2;return pn(Uo,{children:[Array.from({length:r}).map((l,h)=>Pe(_i,{position:{x:-i/2-t-0.3,y:h*o-a,z:c/2},width:n,thickness:c,padContactLength:t,bodyDistance:t+0.4,height:0.85},h)),Array.from({length:r}).map((l,h)=>Pe(_i,{rotation:Math.PI,position:{x:i/2+t+0.3,y:h*o-a,z:c/2},width:n,thickness:c,padContactLength:t,bodyDistance:t+0.4,height:0.85},`right-${h}`)),Pe(Hd,{center:{x:0,y:0,z:c/2},width:i,length:s,height:1.1,notchPosition:{x:-(i/2-1.5),y:s/2-1.5,z:1.1},heightAboveSurface:0.17,taperRatio:0.05})]})},V7i=[{x:-2.54,y:-1},{x:0,y:-1},{x:2.54,y:-1}],_Vn=({mouldedTab:e=!1,leads:t=V7i,bodyWidth:n=10,bodyThickness:o=4.5,bodyHeight:r=9.2,tabHeight:i=6.4,tabThickness:s=1.4,mountingHoleDiameter:a=3.6,standoff:c=3,leadLength:l=3,bodyColor:h="#222",tabColor:d="#ccc",leadColor:u="#d4b106"}={})=>{let _=t.reduce((b,I)=>b+I.x,0)/t.length,p=t.reduce((b,I)=>b+I.y,0)/t.length,m=c,A=m+r,g=A+i,f=p+(o-s)/2,y=g-Math.max(a*0.8,2.6),x=0.8,C=0.5;return pn(Uo,{children:[Pe(Gn,{color:h,children:Pe(Ht,{size:[n,o,r],center:[_,p,m+r/2]})}),Pe(Gn,{color:e?h:d,children:pn(Il,{children:[Pe(Ht,{size:[n,s,i],center:[_,f,A+i/2]}),Pe(ic,{rotation:["90deg",0,0],children:Pe(ho,{center:[_,y,-f],children:Pe(Yi,{radius:a/2,height:s*3})})})]})}),t.map((b)=>Pe(Gn,{color:u,children:Pe(Ht,{size:[0.8,0.5,c+l],center:[b.x,b.y,(c-l)/2]})},`lead-${b.x}-${b.y}`))]})},Y7i=()=>pn(Uo,{children:[Pe(_i,{rotation:Math.PI,position:{x:1.6999999999999997,y:-0.95,z:0.075},width:0.4,thickness:0.15,padContactLength:0.5,bodyDistance:1.1999999999999997,height:0.95},1),Pe(_i,{rotation:Math.PI,position:{x:1.6999999999999997,y:0,z:0.075},width:0.4,thickness:0.15,padContactLength:0.5,bodyDistance:1.1999999999999997,height:0.95},2),Pe(_i,{rotation:Math.PI,position:{x:1.6999999999999997,y:0.95,z:0.075},width:0.4,thickness:0.15,padContactLength:0.5,bodyDistance:1.1999999999999997,height:0.95},3),Pe(_i,{position:{x:-1.6999999999999997,y:0,z:0.075},width:0.4,thickness:0.15,padContactLength:0.5,bodyDistance:1.1999999999999997,height:0.95},3),Pe(_i,{position:{x:-1.6999999999999997,y:-0.95,z:0.075},width:0.4,thickness:0.15,padContactLength:0.5,bodyDistance:1.1999999999999997,height:0.95},1),Pe(_i,{position:{x:-1.6999999999999997,y:0.95,z:0.075},width:0.4,thickness:0.15,padContactLength:0.5,bodyDistance:1.1999999999999997,height:0.95},2),Pe(Hd,{center:{x:0,y:0,z:0},width:1.6,length:2.9,height:1.2,straightHeightRatio:0.6,notchPosition:{x:-0.4,y:1,z:1.25},notchRadius:0.1})]}),G7i=()=>pn(Uo,{children:[Pe(Hd,{center:{x:0,y:0,z:0},width:0.8,length:1,height:0.37,heightAboveSurface:0,color:"#1a1a1a",taperRatio:0.15,straightHeightRatio:0,notchPosition:{x:-0.2,y:0.3181818181818181,z:0.47}}),[0,1,2].map((l)=>{let h=-0.35+l*0.35;return Pe(Ht,{center:[-0.405,h,0.06],size:[0.19,0.15,0.12]},`left-${l}`)}),[0,1,2].map((l)=>{let h=-0.35+l*0.35;return Pe(Ht,{center:[0.405,h,0.06],size:[0.19,0.15,0.12]},`right-${l}`)})]});var U7i=[{x:-1.27,y:0.98},{x:0,y:2.25},{x:1.27,y:0.98}],W7i=(e)=>{let t=[e[0],e[e.length-1]],n=-1;for(let o=0;o<e.length;o++)for(let r=o+1;r<e.length;r++){let i=Math.hypot(e[o].x-e[r].x,e[o].y-e[r].y);if(i>n)n=i,t=[e[o],e[r]]}return{outer:t,separation:n}},gVn=({bodyDiameter:e=4.8,bodyHeight:t=4.5,flatCut:n=1.1,leads:o=U7i,standoff:r=1.5,leadLength:i=3,bodyColor:s="#222"}={})=>{let a=e/2,c=0.4,l=0.25,{outer:h,separation:d}=W7i(o),[u,_]=h,p={x:(u.x+_.x)/2,y:(u.y+_.y)/2},m=Math.max(d,0.001),A={x:(_.x-u.x)/m,y:(_.y-u.y)/m},g=d/2,f=(x)=>{let C=(x-(o.length-1)/2)*g;return{x:p.x+A.x*C,y:p.y+A.y*C}},y=[0.25,0.4,0.25];return pn(Uo,{children:[Pe(Gn,{color:s,children:pn(Il,{children:[Pe(ho,{center:[p.x,p.y,r+t/2],children:Pe(Yi,{radius:a,height:t})}),Pe(ho,{center:[p.x,p.y-(a-n/2),r+t/2],children:Pe(Ht,{size:[a*2,n,t+0.2]})})]})}),o.map((x,C)=>{let b=f(C);return pn(ho,{center:[0,0,0],children:[pn(Oa,{children:[Pe(ho,{center:[x.x,x.y,0],children:Pe(Ht,{size:y})}),Pe(ho,{center:[b.x,b.y,r],children:Pe(Ht,{size:y})})]}),Pe(ho,{center:[x.x,x.y,-i/2],children:Pe(Ht,{size:[0.25,0.4,i]})})]},`lead-${x.x}-${x.y}`)})]})},X7i=()=>pn(Uo,{children:[Pe(_i,{rotation:Math.PI,position:{x:1.1875,y:-0.65,z:0.075},width:0.25,thickness:0.15,padContactLength:0.3,bodyDistance:0.75,height:0.85},1),Pe(_i,{rotation:Math.PI,position:{x:1.1875,y:0,z:0.075},width:0.25,thickness:0.15,padContactLength:0.3,bodyDistance:0.75,height:0.85},2),Pe(_i,{rotation:Math.PI,position:{x:1.1875,y:0.65,z:0.075},width:0.25,thickness:0.15,padContactLength:0.3,bodyDistance:0.75,height:0.85},3),Pe(_i,{position:{x:-1.1875,y:0,z:0.075},width:0.25,thickness:0.15,padContactLength:0.3,bodyDistance:0.75,height:0.85},3),Pe(_i,{position:{x:-1.1875,y:-0.65,z:0.075},width:0.25,thickness:0.15,padContactLength:0.3,bodyDistance:0.75,height:0.85},1),Pe(_i,{position:{x:-1.1875,y:0.65,z:0.075},width:0.25,thickness:0.15,padContactLength:0.3,bodyDistance:0.75,height:0.85},2),Pe(Hd,{center:{x:0,y:0,z:0},width:1.25,length:2,height:1.1,straightHeightRatio:0.6,notchPosition:{x:-0.375,y:0.75,z:1.1},heightAboveSurface:0.1})]}),j7i=X7i,K7i=()=>pn(Uo,{children:[Pe(Hd,{center:{x:0,y:0,z:0.05},width:1,length:1.45,height:0.5,heightAboveSurface:0,color:"#1a1a1a",taperRatio:0,includeNotch:!1}),[0,1,2].map((l)=>{let h=-0.5+l*0.5;return Pe(Ht,{center:[-0.35,h,0.025],size:[0.3,0.2,0.05]},`left-${l}`)}),[0,1,2].map((l)=>{let h=-0.5+l*0.5;return Pe(Ht,{center:[0.35,h,0.025],size:[0.3,0.2,0.05]},`right-${l}`)})]}),AVn=()=>pn(Uo,{children:[Pe(_i,{position:{x:-1.25,y:0,z:0.0875},width:0.3,thickness:0.175,padContactLength:0.3,bodyDistance:0.45,height:0.7},1),Pe(_i,{rotation:Math.PI,position:{x:1.25,y:0,z:0.0875},width:0.3,thickness:0.175,padContactLength:0.3,bodyDistance:0.45,height:0.7},1),Pe(Gn,{color:"#222",children:Pe(Hd,{center:{x:0,y:0,z:0},width:1.8,length:1.4,height:0.95,includeNotch:!1,taperRatio:0.06,straightHeightRatio:0.7,heightAboveSurface:0.05})}),Pe(Ht,{color:"#777",size:[0.6,1.325,0.02],center:[-0.565,0,1]})]}),$7i=()=>pn(Uo,{children:[Pe(Ht,{color:"#ccc",size:[0.4,0.325,0.175],center:[-1.05,0,0.0875]}),Pe(Ht,{color:"#ccc",size:[0.4,0.325,0.175],center:[1.05,0,0.0875]}),Pe(Gn,{color:"#222",children:pn(S0,{children:[Pe(ho,{z:0.0875,children:Pe(Ht,{size:[1.7,1.25,0.175]})}),pn(Oa,{children:[Pe(ho,{z:0.175,children:Pe(Ht,{size:[1.7,1.25,0.01]})}),Pe(ho,{z:0.725,children:Pe(Ht,{size:[1.5,1.05,0.01]})})]})]})}),Pe(Ht,{color:"#777",size:[0.5666666666666667,1.05,0.02],center:[-0.4636363636363638,0,0.725]})]}),q7i=()=>pn(Uo,{children:[Pe(Ht,{color:"#ccc",size:[0.4,0.325,0.13],center:[-1.0474999999999999,0,0.065]}),Pe(Ht,{color:"#ccc",size:[0.4,0.325,0.13],center:[1.0474999999999999,0,0.065]}),Pe(Gn,{color:"#222",children:Pe(Hd,{width:1.775,length:1.25,height:0.725,center:{x:0,y:0,z:0},heightAboveSurface:0,straightHeightRatio:0.7,taperRatio:0.06,includeNotch:!1})}),Pe(Ht,{color:"#777",size:[0.5916666666666667,1.2,0.02],center:[-0.44409090909090904,0,0.725]})]}),J7i=({pitch:e=10})=>pn(Uo,{children:[Pe(Yi,{height:4,radius:0.5,center:[-e/2,0,0.5]}),Pe(vee,{radius:0.5,center:[-e/2,0,2.5]}),Pe(ho,{x:-2.5,y:0,z:2.5,children:pn(ic,{rotation:[0,Math.PI/2,0],children:[Pe(Yi,{height:e,radius:0.5,center:[0,0,2.5]}),Pe(Gn,{color:"#d2b48c",children:Pe(Yi,{height:5,radius:1.3,center:[0,0,2.5]})})]})}),Pe(Yi,{height:4,radius:0.5,center:[e/2,0,0.5]}),Pe(vee,{radius:0.5,center:[e/2,0,2.5]})]}),Z7i=({bodyWidth:e=21,boardThickness:t=0.5,leadWidth:n=1.6,leadLength:o=2.4,leadsPitch:r=2.54,leadsLeft:i,leadsRight:s,leadsTop:a,leadsBottom:c,innerHoles:l=!0,innerHoleEdgeDistance:h=1.61,innerHoleDiameter:d=1})=>{let u=e/2,_=t/2,p=t*1.05,m=d/2,A=Math.max(i||0,s||0,a||0,c||0)*r||51,g=[],f=[];if(s){let b=-((s-1)/2)*r;for(let I=0;I<s;I++){let v=b+I*r;if(g.push({x:u-o/2,y:-v,pl:o,pw:n}),l)f.push({x:u,y:-v},{x:u-h,y:-v})}}if(i){let b=-((i-1)/2)*r;for(let I=0;I<i;I++){let v=b+I*r;if(g.push({x:-u+o/2,y:-v,pl:o,pw:n}),l)f.push({x:-u,y:-v},{x:-u+h,y:-v})}}if(a){let b=-((a-1)/2)*r;for(let I=0;I<a;I++){let v=b+I*r;if(g.push({x:-v,y:A/2-o/2,pl:n,pw:o}),l)f.push({x:-v,y:A/2},{x:-v,y:A/2-h})}}if(c){let b=-((c-1)/2)*r;for(let I=0;I<c;I++){let v=b+I*r;if(g.push({x:-v,y:-A/2+o/2,pl:n,pw:o}),l)f.push({x:-v,y:-A/2},{x:-v,y:-A/2+h})}}let y=Pe(Gn,{color:"#051a0a",children:pn(Il,{children:[Pe(Ht,{center:[0,0,_],size:[e,A,t]}),g.map((b,I)=>Pe(Ht,{center:[b.x,b.y,_],size:[b.pl+0.01,b.pw+0.01,p]},I))]})}),x=l&&f.map((b,I)=>Pe(Yi,{color:"black",center:[b.x,b.y,_],radius:m,height:t*1.07},I)),C=g.map((b,I)=>Pe(Ht,{center:[b.x,b.y,_],size:[b.pl+0.01,b.pw+0.01,p]},I));return pn(Uo,{children:[y,Pe(Gn,{color:"#FFD700",children:l?pn(Il,{children:[Pe(S0,{children:g.map((b,I)=>Pe(Ht,{center:[b.x,b.y,_],size:[b.pl+0.01,b.pw+0.01,p]},I))}),x]}):C})]})},eSi=({numPins:e=5,rows:t=1,p:n=2.54,id:o=1,od:r=1.5,boardThickness:i=1.6,width:s,height:a,pinRowSide:c="left",holes:l=[],holeInset:h=1,pinRowHoleEdgeToEdgeDist:d=2,female:u,nopin:_,screen:p,screenWidth:m,screenHeight:A,screenCenterOffsetX:g,screenCenterOffsetY:f})=>{let y=p??!1,x=i/2,C=Math.ceil(e/t),b,I;if(c==="left"||c==="right")b=(t-1)*n+2*d,I=(C-1)*n+2*d;else I=(t-1)*n+2*d,b=(C-1)*n+2*d;if(e===0)b=10,I=10;let v=Number(s??b),P=Number(a??I),M=[],B=0,T=0,N=0,D=0,L=0,H=0;if(c==="left"||c==="right")B=c==="left"?-v/2+d:v/2-d,T=-((C-1)/2)*n,N=0,D=n,L=c==="left"?n:-n,H=0;else B=-((C-1)/2)*n,T=c==="top"?P/2-d:-P/2+d,N=n,D=0,L=0,H=c==="top"?-n:n;let V=0;for(let Z=0;Z<t&&V<e;Z++)for(let te=0;te<C&&V<e;te++){let ie=B+te*N+Z*L,ce=T+te*D+Z*H;M.push({x:ie,y:ce}),V++}let O=[];if(l)for(let Z of l){let te=0,ie=0;if(Z==="topleft")te=-v/2+h,ie=P/2-h;else if(Z==="topright")te=v/2-h,ie=P/2-h;else if(Z==="bottomleft")te=-v/2+h,ie=-P/2+h;else if(Z==="bottomright")te=v/2-h,ie=-P/2+h;else if(Z==="center")te=0,ie=0;O.push({x:te,y:ie})}let U=0.63,j=2,Y=6,X=3,K=_||u?0:j,J=K+i,ee=Pe(Gn,{color:"#008080",children:pn(Il,{children:[Pe(Ht,{center:[0,0,x+K],size:[v,P,i]}),O.map((Z,te)=>Pe(Yi,{center:[Z.x,Z.y,x+K],radius:r/2,height:i},`hole-${te}`)),M.map((Z,te)=>Pe(Yi,{center:[Z.x,Z.y,x+K],radius:r/2,height:i},`pin-hole-${te}`))]})}),se=M.map((Z,te)=>Pe(Gn,{color:"#FFD700",children:pn(Il,{children:[Pe(Yi,{center:[Z.x,Z.y,i/2+K],radius:r/2,height:i}),Pe(Yi,{center:[Z.x,Z.y,i/2+K],radius:o/2,height:i})]})},`pin-${te}`)),ne=M.map((Z,te)=>Pe(NVn,{x:Z.x,y:Z.y,pinThickness:U,shortSidePinLength:X,longSidePinLength:Y,bodyHeight:j,flipZ:(ie)=>ie},`pin-3d-${te}`)),re=M.map((Z,te)=>Pe(RVn,{x:Z.x,y:Z.y,flipZ:(ie)=>-ie},`female-pin-3d-${te}`));return pn(Uo,{children:[ee,se,!u&&!_&&ne,u&&re,y&&Pe(wVn,{width:m??v*0.8,height:A??P*0.6,offset:{x:g??0,y:f??0,z:J}})]})},tSi=()=>pn(Uo,{children:[Pe(Ht,{color:"#ccc",size:[0.5,0.28,0.12],center:[-0.35,0,0.06]}),Pe(Ht,{color:"#ccc",size:[0.5,0.28,0.12],center:[0.35,0,0.06]}),Pe(Gn,{color:"#222",children:pn(S0,{children:[Pe(ho,{z:0.06,children:Pe(Ht,{size:[0.8999999999999999,0.6,0.12]})}),pn(Oa,{children:[Pe(ho,{z:0.12,children:Pe(Ht,{size:[0.8999999999999999,0.6,0.01]})}),Pe(ho,{z:0.5,children:Pe(Ht,{size:[0.7,0.39999999999999997,0.01]})})]})]})}),Pe(Ht,{color:"#777",size:[0.2333333333333333,0.39999999999999997,0.02],center:[-0.22499999999999998,0,0.5]})]}),nSi=tSi,oSi=({numPins:e=7,showPins:t=!0,showFootprint:n=!0,bodyColor:o="#f5f5f5",pinColor:r="#635959"})=>{let d=(e-1)*1.5+4,u=-((e-1)*1.5)/2;return pn(Uo,{children:[Pe(ho,{offset:[0,0,6],children:Pe(ic,{angles:[Math.PI,0,0],children:Pe(Gn,{material:Qr.moldedPlastic,color:o,children:pn(Il,{children:[Pe(Ht,{size:[d,3.5,6],center:[0,0,3]}),Pe(Ht,{size:[d-1,2.5,3.5999999999999996],center:[0,0,1.7999999999999998]}),Pe(Ht,{size:[d,1.1666666666666667,3.5999999999999996],center:[0,0,0.6]}),Pe(Ht,{size:[d-1,0.25,3.5999999999999996],center:[0,1.625,1.7999999999999998]}),Pe(Ht,{size:[d-1,0.25,3.5999999999999996],center:[0,-1.625,1.7999999999999998]}),Pe(Ht,{size:[1,2.5,1],center:[-d/4,1.75,3]}),Pe(Ht,{size:[1,3.5,1],center:[d/4,1.75,3]}),Pe(Ht,{size:[1,2.5,1],center:[-d/4,-1.75,3]}),Pe(Ht,{size:[1,3.5,1],center:[d/4,-1.75,3]})]})})})}),t&&Array.from({length:e}).map((_,p)=>Pe(Gn,{material:Qr.tinnedLead,color:r,children:Pe(Yi,{height:6,radius:0.35,center:[u+p*1.5,0,2.5]})},p)),n&&Array.from({length:e}).map((_,p)=>{let m=p===0,A=m?{type:"pcb_plated_hole",pcb_plated_hole_id:`jstzh_${p}`,shape:"circular_hole_with_rect_pad",x:u+p*1.5,y:0,hole_diameter:0.73,rect_pad_width:1.03,rect_pad_height:1.73,hole_shape:"circle",pad_shape:"rect",layers:["top","bottom"],port_hints:[`${p+1}`]}:{type:"pcb_plated_hole",pcb_plated_hole_id:`jstzh_${p}`,shape:"pill",x:u+p*1.5,y:0,hole_height:0.73,hole_width:0.73,outer_height:1.73,outer_width:1.03,layers:["top","bottom"],port_hints:[`${p+1}`]};return Pe(Dht,{hole:A,isPin1:m},`footprint_${p}`)})]})},rSi=({numPins:e=2,showPins:t=!0,showFootprint:n=!0,bodyColor:o="#f5f5f5",pinColor:r="#635959"})=>{let p=(e-1)*2+3.9,m=-((e-1)*2)/2,A=1,g=1.8,f=0.7,y=0.8,x=0.65;return pn(Uo,{children:[Pe(ho,{offset:[0,0,6],children:Pe(ic,{angles:[Math.PI,0,0],children:Pe(Gn,{color:o,material:Qr.moldedPlastic,children:pn(Il,{children:[Pe(Ht,{size:[p,4.5,6],center:[0,0,3]}),Pe(Ht,{size:[p-1,3.5,3.5999999999999996],center:[0,0,1.7999999999999998]}),Pe(Ht,{size:[p,1.5,3.5999999999999996],center:[0,0,0.6]}),Pe(Ht,{size:[p-1,0.25,3.5999999999999996],center:[0,2.125,1.7999999999999998]}),Pe(Ht,{size:[p-1,0.25,3.5999999999999996],center:[0,-2.125,1.7999999999999998]}),Pe(Ht,{size:[1,5,1.8],center:[-p/2+0.7,0,3]}),Pe(Ht,{size:[1,5,1.8],center:[p/2-0.7,0,3]}),Pe(Ht,{size:[1.5,0.8,0.65],center:[-p/2,0,0.325]}),Pe(ho,{offset:[-p/2,0,0.65],children:Pe(ic,{angles:[0,Math.PI/2,0],children:Pe(Yi,{height:1.5,radius:0.4})})}),Pe(Ht,{size:[1.5,0.8,0.65],center:[p/2,0,0.325]}),Pe(ho,{offset:[p/2,0,0.65],children:Pe(ic,{angles:[0,Math.PI/2,0],children:Pe(Yi,{height:1.5,radius:0.4})})})]})})})}),t&&Array.from({length:e}).map((C,b)=>Pe(Gn,{color:r,material:Qr.tinnedLead,children:Pe(Ht,{size:[0.5,0.5,8.9],center:[m+b*2,0,1.05]})},b)),n&&Array.from({length:e}).map((C,b)=>{let I=b===0,v=I?{type:"pcb_plated_hole",pcb_plated_hole_id:`jstph_${b}`,shape:"circular_hole_with_rect_pad",x:m+b*2,y:0,hole_diameter:0.73,rect_pad_width:1.2,rect_pad_height:1.2,hole_shape:"circle",pad_shape:"rect",layers:["top","bottom"],port_hints:[`${b+1}`]}:{type:"pcb_plated_hole",pcb_plated_hole_id:`jstph_${b}`,shape:"pill",x:m+b*2,y:0,hole_height:0.73,hole_width:0.73,outer_height:1.2,outer_width:1.2,layers:["top","bottom"],port_hints:[`${b+1}`]};return Pe(Dht,{hole:v,isPin1:I},`footprint_${b}`)})]})},iSi=({numPins:e=4,showPins:t=!0,showFootprint:n=!0,bodyColor:o="#f8fafc",pinColor:r="#635959"})=>{let u=(e-1)*2.5+4.9,_=-((e-1)*2.5)/2,p=0.8,m=1.05,A=3.5,g=u/2-1.3,f=Math.min(u-3.4,Math.max(3,(e-1)*2.5*0.4+2.2)),y=2.4;return pn(Uo,{children:[Pe(ho,{offset:[0,0,3.5],children:Pe(Gn,{material:Qr.moldedPlastic,color:o,children:pn(Il,{children:[Pe(Ht,{size:[u,5.75,7]}),Pe(ho,{offset:[0,0,0.9250000000000002],children:Pe(Ht,{size:[u-1.7,4.05,5.55]})}),Pe(ho,{offset:[0,-2.45,2.4],children:Pe(Ht,{size:[f,1.05,2.6]})}),Pe(ho,{offset:[-g,-2.45,1.85],children:Pe(Ht,{size:[0.8,1.05,3.7]})}),Pe(ho,{offset:[g,-2.45,1.85],children:Pe(Ht,{size:[0.8,1.05,3.7]})}),Array.from({length:e}).map((x,C)=>Pe(ho,{offset:[_+C*2.5,-2.575,-3.25],children:Pe(Ht,{size:[1,0.8,0.5]})},`vent_${C}`))]})})}),t&&Array.from({length:e}).map((x,C)=>Pe(Gn,{material:Qr.tinnedLead,color:r,children:Pe(ho,{offset:[_+C*2.5,0,0.9750000000000001],children:Pe(Ht,{size:[0.64,0.64,8.75]})})},C)),n&&(()=>{try{return Kl.string(`jst${e}_xh`).circuitJson().filter((b)=>b.type==="pcb_plated_hole").map((b,I)=>Pe(Dht,{hole:b,isPin1:I===0},`footprint_${I}`))}catch{return null}})()]})};function QVn(e){let t=Kl.string(e).json();if(t.fn!=="jst")return!1;return Boolean(t.sh||t.smd&&Math.abs(Ni(t.p)-1)<0.01&&Math.abs(Ni(t.mpx??0)-(t.num_pins-1+2.6))<0.15&&Math.abs(Ni(t.mpy??0)-2.525)<0.15)}var sSi=({footprint:e="jst6_sh"})=>{if(!QVn(e))throw Error("JstSh requires a named SH or matching 1mm SH top-entry footprint");let t=e.replace(/_pin1location\([^)]*\)/g,""),n=Kl.string(t).json(),o=Kl.string(t).circuitJson().filter((g)=>g.type==="pcb_smtpad"&&g.shape==="rect"),r=Kl.string(e).circuitJson().filter((g)=>g.type==="pcb_smtpad"&&(g.shape==="rect"||g.shape==="rotated_rect")),i=n.num_pins;if(!Number.isInteger(i)||i<2||i>20||o.length!==i+2)throw Error("JstSh requires 2–20 contacts and two hold-down pads");let s=o.slice(0,i),a=o.slice(i),c=Math.atan2(r[1].y-r[0].y,r[1].x-r[0].x)-Math.atan2(o[1].y-o[0].y,o[1].x-o[0].x),l=s.reduce((g,f)=>g+f.x,0)/i,h=s[0].y,d=a[0].y>h?1:-1,u=h+d*1.8,_=i+2,p=2.9,m=4.2,A=u-d*0.25;return pn(ic,{rotation:[0,0,c],children:[Pe(Gn,{material:Qr.moldedPlastic,color:"#e4e1d6",children:pn(Il,{children:[Pe(Ht,{size:[_,p,m],center:[l,u,m/2+0.05]}),Pe(Ht,{size:[_-1.3,1.8,m],center:[l,u,m/2+0.8]}),a.map((g,f)=>Pe(Ht,{size:[0.7,g.height*0.8,1.5],center:[g.x,g.y,0.75]},`recess-${f}`)),[-1,1].map((g)=>Pe(Ht,{size:[0.55,0.6,1],center:[l+g*(_/2-0.9),u+d*p/2,4]},g))]})}),pn(Gn,{material:Qr.tinnedLead,color:"#c6c7c9",children:[s.map((g,f)=>{let y=g.y-d*g.height*0.4;return pn(S0,{children:[Pe(Ht,{size:[0.2,Math.abs(A-y)+0.1,0.2],center:[g.x,(A+y)/2,0.1]}),Pe(Ht,{size:[0.2,0.2,3.45],center:[g.x,A,1.725]})]},f)}),a.map((g,f)=>pn(S0,{children:[Pe(Ht,{size:[0.7,g.height*0.75,0.2],center:[g.x,g.y,0.1]}),Pe(Ht,{size:[0.2,g.height*0.6,1.35],center:[g.x,g.y,0.675]})]},`mount-${f}`))]})]})},aSi=([e,t],n,o,r,i)=>{let s=Math.sign(e),a=Math.sign(t),c=n/2,l=o/2,h=i?Math.min(0.32,o*0.36):0,d=Math.min(r,c,l),u=[[-c,-l],[c,-l],[c,l-d],[c-d,l],[-c,l]];if(h)u[0]=[-c+h,-l],u.push([-c,-l+h]);let _=u.map(([p,m])=>[e+p*s,t+m*a]);return s*a<0?_.reverse():_},xht=({width:e,length:t,radius:n,height:o,z:r})=>{let i=e/2-n,s=t/2-n;return[[-i,-s],[i,-s],[i,s],[-i,s]].map(([a,c],l)=>Pe(Yi,{center:[a,c,r+o/2],height:o,radius:n},`${r}-${l}`))},cSi=({horizontalPadPitch:e=2.2,verticalPadPitch:t=1.7,padWidth:n=1.4,padHeight:o=1.2,bodyHeight:r=0.7})=>{let i=e+n*0.7142857142857143,s=t+o*0.6666666666666666,a=Math.min(0.01,r*0.02),c=n*0.7142857142857143,l=o*0.75,h=r*0.7142857142857143,d=h-a,u=r*0.05714285714285714,_=i*0.95,p=s*0.94,m=i*0.905,A=s*0.9,g=i*0.83,f=s*0.82,y=h+u,x=Math.min(0.01,r*0.015),C=Math.min(0.12,s*0.05),b=(i-c)/2,I=(s-l)/2,v=[[-b,-I],[b,-I],[b,I],[-b,I]],P=xht({width:_,length:p,radius:Math.min(0.13,p*0.08),height:u,z:h}),M=[...xht({width:m,length:A,radius:Math.min(0.14,A*0.08),height:x,z:y}),...xht({width:g,length:f,radius:Math.min(0.15,f*0.09),height:x,z:r-x})];return pn(Uo,{children:[v.map((B,T)=>Pe(Gn,{color:"#d6a258",material:Qr.goldContact,children:Pe(Pee,{height:a,children:Pe(See,{points:aSi(B,c,l,C,T===0)})})},T)),Pe(Hd,{center:{x:0,y:0,z:a},width:i,length:s,height:d-0.005,heightAboveSurface:0,color:"#34343d",taperRatio:0,straightHeightRatio:1,includeNotch:!1,chamferSize:C}),Pe(Gn,{color:"#d2a057",material:Qr.goldContact,children:Pe(Oa,{children:P})}),Pe(Gn,{color:"#b9bec2",material:Qr.brushedMetal,children:Pe(Oa,{children:M})})]})},lSi="#303339",sPe="#1f2227",fVn="#eee8d8",yVn="#f8f3e7",Cht="#b7bdc2",hSi="#d2d6d9",dSi="#767d82",uSi="#9ba1a5",pSi=({pinCount:e=12,pitch:t=0.5,padWidth:n=0.3,padLength:o=1.25,staggered:r=!1,reverse:i=!1,rowPitch:s=2.4,topPadLength:a=o,bottomPadLength:c=o,mountPadPitchX:l,mountPadOffsetY:h=2.575,mountTop:d=!1,mountPadWidth:u=2,mountPadLength:_=2.5})=>{let p=Math.max((e-1)*t,t),m=-p/2,A=l??p+(r?3.5:3.38),g=h===0?0:(d?1:-1)*h,f=Array.from({length:e},(Se,Ne)=>{let Le=r&&Ne%2===1!==i,nt=r?Le?s/2:-s/2:0,dt=Le?a:c;return{index:Ne,x:m+Ne*t,y:nt,length:dt}}),y=Math.max(...f.map((Se)=>Se.y+Se.length/2)),x=Math.min(...f.map((Se)=>Se.y-Se.length/2)),C=g-_/2,b=g+_/2,I=d?x:y,v=d?Math.max(b,y)+0.67:Math.min(C,x)-0.67,P=d?-1:1,M=I-P*Math.max(o*0.86,1.05),B=v+P*0.22,T=Math.abs(M-B),N=(M+B)/2,D=B-P*0.01,L=Math.max(p+4.9,A+u*0.76),H=Math.min(L-2.3,p+1.1),V=0.3,O=1.42,U=2,j=Math.min(0.92,T*0.28),Y=D+P*(j/2-0.04),X=1.6,K=1.1,J=Math.max(T-0.78,1.5),ee=D+P*(J/2+0.68),se=L-0.72,ne=0.34,re=1.83,Z=D+P*Math.min(0.68,T*0.22),te=1.48,ie=Math.max(n*0.82,0.15),ce=I,ue=Math.abs(ce-M),de=(ce+M)/2,me=Math.max(j*0.8,0.5),ge=D+P*(me/2+0.08),xe=A/2,Ee=0.75,Re=L/2-0.04,Me=L/2-0.23,_e=L/2-0.32,ye=0.68;return pn(Uo,{children:[[-1,1].map((Se)=>Pe(Ht,{color:Cht,center:[Se*xe,g,0.07],size:[u,_,0.14]},`mount-pad:${Se}`)),f.map((Se)=>Pe(Ht,{color:Cht,center:[Se.x,de,0.065],size:[ie,ue,0.13]},`terminal:${Se.index}`)),Pe(yg,{color:sPe,center:[0,N,0.15],size:[L,T,0.3],roundRadius:0.1}),Pe(Gn,{color:lSi,children:pn(Il,{children:[Pe(yg,{center:[0,N,1.01],size:[L-0.2,T-0.12,1.42],roundRadius:0.14}),Pe(Ht,{center:[0,Y,1.1],size:[H,j,1.6]}),Pe(Ht,{center:[0,ee,1.7551999999999999],size:[se-0.32,J-0.16,0.34]})]})}),f.map((Se)=>Pe(yg,{color:hSi,center:[Se.x,ge,1.1199999999999999],size:[ie*0.82,me,0.14],roundRadius:0.035},`spring:${Se.index}`)),f.map((Se)=>Pe(Ht,{color:Cht,center:[Se.x,M-P*0.03,0.62],size:[ie,0.13,0.62]},`terminal-rise:${Se.index}`)),Pe(Ht,{color:sPe,center:[0,D+P*0.1,1.01],size:[H+0.18,0.16,0.8]}),Pe(yg,{color:fVn,center:[0,ee,1.83],size:[se,J,0.34],roundRadius:0.11}),Pe(Ht,{color:yVn,center:[0,ee-P*(J/2-0.12),1.965],size:[se-0.36,0.24,0.07]}),[-1,1].map((Se)=>Pe(yg,{color:fVn,center:[Se*_e,Z,1.48],size:[0.68,0.92,0.72],roundRadius:0.1},`actuator-ear:${Se}`)),[-1,1].map((Se)=>Pe(ho,{x:Se*_e,y:Z,z:1.48,children:Pe(ic,{rotation:[0,Math.PI/2,0],children:Pe(Yi,{color:yVn,height:0.8,radius:0.24})})},`hinge:${Se}`)),[-1,1].map((Se)=>Pe(yg,{color:dSi,center:[Se*Re,g,0.375],size:[0.17,Math.min(_*0.3,0.7),0.75],roundRadius:0.04},`hold-down-wall:${Se}`)),[-1,1].map((Se)=>Pe(yg,{color:uSi,center:[Se*Me,g,0.7],size:[0.42,Math.min(_*0.3,0.7),0.1],roundRadius:0.035},`hold-down-cap:${Se}`)),Pe(Ht,{color:sPe,center:[0,N,0.025],size:[H+0.7,T*0.58,0.05]}),Pe(Ht,{color:sPe,center:[0,M-P*0.06,1.1199999999999999],size:[H+0.4,0.15,0.92]})]})},mSi=({numberOfPins:e,pitch:t=2.54,pinThickness:n=0.64,bodyWidth:o=2.5,bodyHeight:r=2.54,standoffHeight:i=1.27,matingPinLength:s=5.8,tailSpan:a=5.08})=>{let c=-((e-1)*t)/2,l=i+r,h=a/2,d=n*0.35;return Pe(Uo,{children:Array.from({length:e},(u,_)=>{let p=c+_*t,m=_%2===0?1:-1,A=s-d,g=i-n/2;return pn(ho,{x:p,children:[Pe(Ht,{color:"#222",size:[t,o,r],center:[0,0,i+r/2]}),pn(Gn,{color:"#d4af37",children:[Pe(Ht,{size:[n,h,n],center:[0,m*(h/2),n/2]}),Pe(Ht,{size:[n,n,g],center:[0,0,n/2+g/2]}),Pe(Ht,{size:[n,n,A],center:[0,0,l+A/2]}),pn(Oa,{children:[Pe(Ht,{size:[n,n,0.01],center:[0,0,l+A]}),Pe(Ht,{size:[n*0.65,n*0.65,0.01],center:[0,0,l+s]})]})]})]},_)})})},S0e=(e)=>Kl.string(e).circuitJson().filter((n)=>n.type==="pcb_plated_hole"&&Number.isFinite(n.x)&&Number.isFinite(n.y)).map((n)=>({x:n.x,y:n.y,pin:n.port_hints?.[0]})),xVn=(e)=>Kl.string(e).circuitJson().filter((n)=>n.type==="pcb_smtpad"&&n.shape==="rect"&&Number.isFinite(n.x)&&Number.isFinite(n.y)).map((n)=>({x:n.x,y:n.y,width:n.width??0.4,height:n.height??0.4,pin:n.port_hints?.[0]})),_Si=({bodyWidth:e,bodyLength:t,bodyHeight:n=1,pads:o,leadThickness:r=0.15,leadHeightRatio:i=0.75})=>{let s=o.reduce((l,h)=>l+h.x,0)/(o.length||1),a=o.reduce((l,h)=>l+h.y,0)/(o.length||1),c=n*i;return pn(Uo,{children:[Pe(Hd,{center:{x:s,y:a,z:0},width:e,length:t,height:n}),o.map((l)=>{let h=l.width??0.4,d=l.height??0.4,u=l.x>=s?1:-1,_=l.x+u*h/2,p=Math.max(Math.abs(_-s)-e/2,0.1),m=Math.min(0.15,e*0.15);return Pe(_i,{rotation:u>0?Math.PI:0,position:{x:_,y:l.y,z:r/2},width:d,thickness:r,padContactLength:h*0.6,bodyDistance:p+m,height:c},`lead-${l.x}-${l.y}`)})]})},gSi=({padPitch:e,padHeight:t,color:n="#333"})=>{let o=e,r=t*0.85,i=r,s=o*0.2,a=o-s*2;return pn(Uo,{children:[Pe(Ht,{size:[a,r,i],offset:[0,0,i/2],material:Qr.moldedPlastic,color:n}),Pe(Ht,{size:[s,i,r],offset:[o/2-s/2,0,i/2],material:Qr.tinnedLead,color:"#ccc"}),Pe(Ht,{size:[s,i,r],offset:[-o/2+s/2,0,i/2],material:Qr.tinnedLead,color:"#ccc"})]})},ASi=({color:e="#ffff00",bodyColor:t="#ffffff",leadColor:n="#dedede"})=>{let A=[-1.7,0,1.7],g=[-1,1];return pn(Uo,{children:[A.flatMap((f)=>g.map((y)=>Pe(Ht,{color:n,size:[1.4,1,0.2],center:[y*2,f,0.1]},`${y}-${f}`))),Pe(Gn,{color:t,children:pn(Il,{children:[Pe(Hd,{width:5,length:5,height:1.3,heightAboveSurface:0.2,center:{x:0,y:0,z:0},color:t,taperRatio:0.036,straightHeightRatio:0.01,includeNotch:!1}),Pe(Yi,{radius:2,height:0.25,center:[0,0,1.375]}),Pe(ho,{offset:[-2.5,2.5,1.355],children:Pe(ic,{rotation:[0,0,Math.PI/4],children:Pe(Ht,{size:[0.9,0.9,0.31]})})})]})}),Pe(Yi,{color:e,radius:2,height:0.25,center:[0,0,1.425]})]})},fSi=({bodyWidth:e=3.5,bodyLength:t=2.8,bodyHeight:n=0.8,color:o="#ffe08a",bodyColor:r="#f2f2f2",padColor:i="#cccccc",pad1X:s=-0.9,pad1Width:a=2.2,pad2X:c=1.375,pad2Width:l=1.25,padLength:h=2.2}={})=>{let _=(s+c)/2,p=e*0.55,m=t*0.55;return pn(Uo,{children:[[{x:s,w:a,key:"pad-1"},{x:c,w:l,key:"pad-2"}].map(({x:A,w:g,key:f})=>Pe(Gn,{color:i,children:Pe(Ht,{size:[g,h,0.1],center:[A,0,0.05]})},f)),Pe(Gn,{color:r,children:Pe(Ht,{size:[e,t,n],center:[_,0,0.1+n/2]})}),Pe(Gn,{color:o,children:Pe(Ht,{size:[p,m,0.15],center:[_,0,0.1+n+0.075-0.05]})})]})},CVn=(e)=>Array.from({length:e},(t,n)=>n),ySi=({bodyWidth:e=16.26,bodyDepth:t=15.88,bodyHeight:n=13.5,bodyCenterY:o=-0.96,ledPins:r=!1,firstPinLeft:i=!1,firstPinTop:s=!1,signalPitch:a=1.02,signalRowPitch:c=1.78,signalHoleDiameter:l=0.9144,shieldPinX:h=8.13,shieldPinY:d=0.13,shieldHoleDiameter:u=1.8,locatorHoleX:_=6.35,locatorHoleY:p=-3.43,locatorHoleDiameter:m=3.25,ledPinX:A=4.57,ledPinPitch:g=2.29,ledPinY:f=5.7,openingDirection:y,shellColor:x="#b7bdc2",housingColor:C="#20242a",contactColor:b="#d6a928"})=>{let I=y??(o>0?1:-1),v=o+I*t/2,P=Math.min(0.38,e*0.024),M=Math.max(e-2.5,e*0.72),B=Math.min(n-2.4,9.6),T=1.3+B/2,N=Math.min(4.4,t*0.34),D=v-I*N/2,L=v-I*(N+P*0.7),H=Math.max(0.22,Math.min(l*0.36,0.38)),V=CVn(8).map((K)=>{let J=(3.5-K)*a,ee=K%2===0?-c/2:c/2;return{x:i?-J:J,y:s?-ee:ee}}),O=[-A-g,-A,A,A+g],U=M/10,j=v-I*Math.max(N*0.48,1.2),Y=T+B*0.18,X=v+I*P*0.2;return pn(Uo,{children:[pn(Gn,{color:x,children:[pn(Il,{children:[Pe(Ht,{center:[0,o,n/2],size:[e,t,n]}),Pe(Ht,{center:[0,D,T],size:[M,N+P*2,B]})]}),Pe(Ht,{center:[0,X,0.72],size:[M+0.5,P*1.25,1.05]}),[-1,1].map((K)=>Pe(Ht,{center:[K*h,d,0.25],size:[Math.max(u*0.46,0.65),Math.max(u*0.72,1.1),3.4]},`shield-tab:${K}`)),[-1,1].map((K)=>Pe(Ht,{center:[K*e*0.24,o-I*t*0.08,n+0.04],size:[e*0.22,t*0.42,0.1]},`top-seam:${K}`))]}),pn(Gn,{color:C,children:[pn(Il,{children:[Pe(yg,{center:[0,D,T],size:[M-0.2,N+P*0.5,B-0.2],roundRadius:0.22}),Pe(Ht,{center:[0,D-I*P*0.2,T-0.05],size:[M-1.25,N+P,B-1.35]})]}),Pe(Ht,{center:[0,L,T],size:[M-1.15,P,B-1.25]}),Pe(yg,{center:[0,v-I*N*0.28,1.55],size:[M-2.6,N*0.5,1.15],roundRadius:0.16}),[-1,1].map((K)=>Pe(Yi,{center:[K*_,p,-0.25],radius:Math.max(m*0.41,0.65),height:2.7},`locator:${K}`))]}),pn(Gn,{color:b,children:[V.map(({x:K,y:J},ee)=>Pe(Yi,{center:[K,J,0.15],radius:H,height:3.1},`signal-lead:${ee}`)),CVn(8).map((K)=>Pe(ho,{offset:[(K-3.5)*U,j,Y+(K%2===0?0.03:-0.03)],children:Pe(ic,{rotation:[I*0.2,0,0],children:Pe(yg,{size:[Math.max(U*0.28,0.28),3.25,0.16],roundRadius:0.05})})},`socket-contact:${K}`)),r&&O.map((K,J)=>Pe(Yi,{center:[K,f,0.15],radius:H,height:3.1},`led-lead:${J}`))]}),r&&pn(Uo,{children:[Pe(yg,{color:"#73b744",center:[-e/2+2.05,v+I*P*0.35,n-2.05],size:[2.15,P*1.55,1.45],roundRadius:0.18}),Pe(yg,{color:"#e0aa35",center:[e/2-2.05,v+I*P*0.35,n-2.05],size:[2.15,P*1.55,1.45],roundRadius:0.18})]})]})},xSi=({bodyWidth:e=6.1,bodyLength:t=6.5,bodyHeight:n=2.3,tabWidth:o=6.2,tabLength:r=5.8,span:i=6.85,pitch:s=2.29,leadWidth:a=0.9,leadContactLength:c=1.5,color:l="#222",tabColor:h="#cccccc",leadColor:d="#cccccc"})=>{let _=i/2,p=-i/2,m=_+(o-e)/2,A=m-e/2,g=0.25,f=0.4;return pn(Uo,{children:[Pe(Gn,{material:Qr.tinnedLead,color:h,children:Pe(Ht,{size:[o,r,0.5],center:[_,0,0.25]})}),Pe(Gn,{material:Qr.moldedPlastic,color:l,children:Pe(Ht,{size:[e,t,n],center:[m,0,0.5+n/2]})}),[-1,1].map((y)=>pn(Gn,{material:Qr.tinnedLead,color:d,children:[Pe(Ht,{size:[c,a,0.4],center:[p+c/2,y*s,0.2]}),pn(Oa,{children:[Pe(Ht,{size:[0.1,a,0.4],center:[p+c,y*s,0.2]}),Pe(Ht,{size:[0.1,a,0.4],center:[A,y*s,0.5]})]})]},`lead-${y}`))]})},CSi=({diameter:e=6.3,heightToDiameterRatio:t=1.4,height:n=e*t,leadPitch:o=2.5,leadDiameter:r=0.6,leadLength:i=3,sleeveColor:s="#1b2a6b",baseColor:a="#1a1a1a"})=>{let c=e/2,l=Math.min(1,e*0.12),h=Math.max(n-l,0.1),d=l,u=d+h,_=Math.max(e*0.06,0.2),p=0.3;return pn(Uo,{children:[Pe(Gn,{color:a,material:Qr.rubber,children:Pe(Yi,{radius:c-0.05,height:l,center:[0,0,l/2]})}),Pe(Gn,{color:s,material:Qr.sleeve,children:pn(Il,{children:[Pe(Dy,{radius:c,height:h,roundRadius:Math.min(0.3,c*0.15),center:[0,0,d+h/2]}),Pe(Ht,{size:[e,_,0.6],center:[0,0,u]}),Pe(Ht,{size:[_,e,0.6],center:[0,0,u]})]})}),[-1,1].map((m)=>Pe(Gn,{material:Qr.tinnedLead,color:"#c0c0c0",children:Pe(Yi,{radius:r/2,height:i+l,center:[m*o/2,0,(l-i)/2]})},`lead-${m}`))]})},bSi=({bodyWidth:e=5.35,bodyLength:t=14,bodyHeight:n=4,bodyCenterX:o=e/2,adjusterDiameter:r=Math.min(e,t)*0.55,shaftDiameter:i=0,shaftHeight:s=0,leads:a=[],leadDiameter:c=0.6,leadLength:l=3,bodyColor:h="#1f4fa3",adjusterColor:d="#d8d8d8"})=>{let _=n+0.4,p=Math.max(r*0.16,0.3);return pn(Uo,{children:[Pe(Gn,{color:h,children:Pe(Ht,{size:[e,t,n],center:[o,0,n/2]})}),Pe(Gn,{color:d,children:pn(Il,{children:[Pe(Yi,{radius:r/2,height:0.8,center:[o,0,_]}),Pe(Ht,{size:[r,p,0.48],center:[o,0,_+0.4]})]})}),s>0&&i>0?Pe(Gn,{color:d,children:Pe(Yi,{radius:i/2,height:s,center:[o,0,n+s/2]})}):null,a.map((m)=>Pe(Gn,{color:"#c0c0c0",children:Pe(Yi,{radius:c/2,height:n/2+l,center:[m.x,m.y,(n/2-l)/2]})},`lead-${m.x}-${m.y}`))]})},ISi=({bodyWidth:e=2.9,bodyLength:t=3,bodyHeight:n=1.4,actuatorDiameter:o=1.5,actuatorHeight:r=0.5,padSpanX:i=4.2,padSpanY:s=2.15,padWidth:a=1.05,padLength:c=0.7,bodyColor:l="#2b2b2b",actuatorColor:h="#d9d9d9",leadColor:d="#cccccc"})=>pn(Uo,{children:[Pe(Gn,{color:l,children:Pe(Ht,{size:[e,t,n],center:[0,0,n/2]})}),Pe(Gn,{color:h,children:Pe(Yi,{radius:o/2,height:r,center:[0,0,n+r/2]})}),[-1,1].flatMap((_)=>[-1,1].map((p)=>Pe(Gn,{color:d,children:Pe(Ht,{size:[a,c,0.15],center:[_*i/2,p*s/2,0.075]})},`lead-${_}-${p}`)))]}),vSi=({footprint:e="smdslideswitch7",position:t=0})=>{let n=e.replace(/_pin1location\([^)]*\)/g,""),o=Kl.string(n).json(),r=Kl.string(n).circuitJson(),i=r.filter((u)=>u.type==="pcb_smtpad"&&u.shape==="rect"),s=Kl.string(e).circuitJson().filter((u)=>u.type==="pcb_smtpad"&&(u.shape==="rect"||u.shape==="rotated_rect"));if(i.length<7||!Number.isFinite(o.mpx)||o.mpx<3)throw Error("SmdSlideSwitch needs signal pads and four mounting pads");let a=Math.atan2(s[1].y-s[0].y,s[1].x-s[0].x)-Math.atan2(i[1].y-i[0].y,i[1].x-i[0].x),c=o.mpx-0.5,l=2.7,h=o.mpx>6?1.5:1.4,d=o.mounty;return pn(ic,{rotation:[0,0,a],children:[Pe(Gn,{color:"#aeb4ba",children:pn(Il,{children:[Pe(Ht,{size:[c,l,h],center:[0,d,h/2]}),Pe(Ht,{size:[c-0.3,l-0.3,h],center:[0,d,h/2-0.15]}),Pe(Ht,{size:[2.7,0.5,0.9],center:[0,d-l/2,0.65]})]})}),pn(Gn,{color:"#28292c",children:[Pe(Ht,{size:[c-0.32,l-0.32,0.35],center:[0,d,0.175]}),Pe(Ht,{size:[1,2.25,0.65],center:[t===0?-0.5:0.5,d-1.5,0.65]}),r.filter((u)=>u.type==="pcb_hole").map((u,_)=>("hole_diameter"in u)&&("x"in u)?Pe(Yi,{radius:u.hole_diameter*0.42,height:0.6,center:[u.x,u.y,-0.2]},_):null)]}),Pe(Gn,{color:"#c6c7c9",children:i.map((u,_)=>{let p=_<i.length-4,m=u.y+u.height*0.4,A=Math.min(u.y-u.height*0.4,d+l/2-0.2);return Pe(Ht,{size:[u.width*0.8,p?m-A:u.height*0.8,0.18],center:[u.x,p?(m+A)/2:u.y,0.09]},_)})})]})},SSi=({fullWidth:e=1.94,fullLength:t=1.6})=>pn(Uo,{children:[Pe(ic,{rotation:[45*Math.PI,0,0],children:Pe(ho,{center:[0,0,-0.4],children:Pe(Gn,{color:"grey",children:Pe(Ht,{size:[1.2,1.6,0.55]})})})}),[-1,0,1].flatMap((h,d)=>[Pe(ho,{center:[-0.63,h*0.5,0.065],children:Pe(Ht,{size:[0.67,0.3,0.13]})},`left-${d}`),Pe(ho,{center:[0.63,h*0.5,0.065],children:Pe(Ht,{size:[0.67,0.3,0.13]})},`right-${d}`)])]}),PSi=({packageWidth:e=10,packageLength:t=10,packageHeight:n=1.2,standoffHeight:o=0.2,ballPitch:r=0.8,ballDiameter:i=0.5,ballRows:s=8,ballColumns:a=8,missingBalls:c=[],footprintString:l})=>{let h=n-o,d=o+h/2,u=Math.max(o/2,i/2),_=l?Kl.string(l).circuitJson():null;return pn(Uo,{children:[Pe(ho,{z:d,children:Pe(Gn,{color:"#555",children:Pe(Ht,{size:[e,t,h]})})}),!l&&Array.from({length:s*a}).map((p,m)=>{if(c.includes(m+1))return null;let A=Math.floor(m/a),f=(m%a-(a-1)/2)*r,y=(A-(s-1)/2)*r;return Pe(ho,{x:f,y,z:u,children:Pe(vee,{radius:i/2})},m)}),_&&_.map((p,m)=>{if(p.type==="pcb_smtpad")return Pe(ho,{x:p.x,y:p.y,z:u,children:Pe(vee,{radius:i/2})},m);return null})]})},bVn=({width:e,height:t,depth:n})=>Pe(Oa,{children:[-1,1].map((o)=>Pe(ho,{offset:[o*(e-t)/2,0,0],children:Pe(ic,{rotation:[Math.PI/2,0,0],children:Pe(Yi,{radius:t/2,height:n})})},o))}),ESi=({footprint:e="usbcmidmount16"})=>{let t=e.replace(/_pin1location\([^)]*\)/g,""),n=Kl.string(t).json(),o=Kl.string(t).circuitJson(),r=o.filter((x)=>x.type==="pcb_smtpad"&&x.shape==="rect"),i=o.filter((x)=>x.type==="pcb_plated_hole"),s=o.filter((x)=>x.type==="pcb_hole"),a=Kl.string(e).circuitJson().find((x)=>x.type==="pcb_plated_hole"),c=i[0],l=c&&a&&"x"in a?Math.atan2(a.y,a.x)-Math.atan2(c.y,c.x):0,h=8.94,d=3.2,u=0.22,_=n.rowy+0.23,p=-n.bodybottom,m=_-p,A=(_+p)/2,g=1.65;if(!Number.isFinite(m)||m<3||i.length!==4)throw Error("UsbCMidmount requires four mounting slots and a positive body depth");let f=-0.9,y=1.75;return pn(ic,{rotation:[0,0,l],children:[Pe(Gn,{color:"#b8bdc4",material:Qr.brushedMetal,children:Pe(ho,{offset:[0,A,1.65],children:pn(Il,{children:[Pe(bVn,{width:8.94,height:3.2,depth:m}),Pe(bVn,{width:8.5,height:2.7600000000000002,depth:m+0.2})]})})}),pn(Gn,{color:"#242529",material:Qr.moldedPlastic,children:[Pe(Ht,{size:[6.65,m-1.1,0.7],center:[0,A+0.3,1.65]}),Pe(Ht,{size:[7.6,1,2.45],center:[0,_-0.65,1.65]}),s.map((x,C)=>("x"in x)&&("hole_diameter"in x)?Pe(Yi,{radius:x.hole_diameter*0.42,height:0.8,center:[x.x,x.y,-0.3]},C):null)]}),pn(Gn,{color:"#d3ad57",material:Qr.goldContact,children:[[-1,1].flatMap((x)=>[-2.75,-2.25,-1.25,-0.25,0.25,1.25,2.25,2.75].map((C)=>Pe(Ht,{size:[0.24,m-2,0.04],center:[C,A+0.1,1.65+x*0.365]},`${x}-${C}`))),r.map((x,C)=>Pe(Ht,{size:[Math.min(x.width*0.7,0.35),x.height*0.8+0.35,0.15],center:[x.x,x.y-0.175,0.075]},C))]}),Pe(Gn,{color:"#b8bdc4",material:Qr.brushedMetal,children:i.map((x,C)=>Pe(Ht,{size:[0.4,"hole_height"in x?Math.max(0.3,x.hole_height-0.2):1,y-f],center:[x.x,x.y,(y+f)/2]},C))})]})},IVn=(e)=>Kl.string(e).circuitJson().filter((t)=>t.type==="pcb_smtpad"&&(t.shape==="rect"||t.shape==="rotated_rect")).map((t)=>({x:t.x,y:t.y,pin:t.port_hints?.[0]})),MSi=({footprint:e="sot143"})=>{let t=IVn(e);if(t.length!==4)throw Error("SOT143 requires four signal pads");let n=IVn("sot143"),o=Kl.string(e).json(),r=n[1],i=t.find((c)=>c.pin==="2"),s=o.pin1location?Math.round((Math.atan2(i.y,i.x)-Math.atan2(r.y,r.x))/(Math.PI/2))*(Math.PI/2):0,a=t.map((c)=>({...c,x:c.x*Math.cos(s)+c.y*Math.sin(s),y:-c.x*Math.sin(s)+c.y*Math.cos(s)}));return pn(ic,{rotation:[0,0,s],children:[Pe(Hd,{width:2.9,length:1.3,height:0.95,heightAboveSurface:0.05,center:{x:0,y:0,z:0},includeNotch:!1,taperRatio:0.06}),a.map((c)=>{let l=c.y<0?-1:1,h=c.pin==="1"?0.83:0.43;return Pe(_i,{width:h,thickness:0.12,height:0.45,padContactLength:0.3,bodyDistance:0.6,rotation:l<0?Math.PI/2:-Math.PI/2,position:{x:c.x,y:l*1.15,z:0.06}},c.pin)})]})},wSi=({footprint:e})=>{let t=rJ.string(e.split("_",1)[0]).params().fn;if(rJ.getModelNames().includes(t)){let c=rJ.string(e).json(),l=DVn.get(c.fn);if(l)return l.render(c)}let n=e;if(e.startsWith("jstzh1_5mm")){let c=e.match(/jstzh1_5mm(\d+)?/);n=`zh${c&&c[1]?c[1]:"7"}`}else if(e.startsWith("jstph2_0mm")){let c=e.match(/jstph2_0mm(\d+)?/);n=`jst${c&&c[1]?c[1]:"2"}_ph`}else if(e.startsWith("jstxh2_5mm")){let c=e.match(/jstxh2_5mm(\d+)?/);n=`jst${c&&c[1]?c[1]:"2"}_xh`}let o=Kl.string(n).json(),r=e.match(/_color\(([^)]+)\)/),i=r?r[1]:void 0,s=(c,l)=>{if(c===void 0||c===null)return l;let h=Ni(c);return Number.isFinite(h)?h:l},a=L8i(o);if(a)return a;switch(o.fn){case"crystal":return Pe(cSi,{horizontalPadPitch:o.px,verticalPadPitch:o.py,padWidth:o.pw,padHeight:o.ph});case"dip":return Pe(V8i,{numPins:o.num_pins,pitch:o.p,bodyWidth:o.w});case"axial":return Pe(J7i,{pitch:o.p});case"tssop":return Pe(U8i,{pinCount:o.num_pins,leadLength:o.pl,leadWidth:o.pw,pitch:o.p,bodyWidth:o.w});case"msop":return Pe(X8i,{pinCount:o.num_pins,padContactLength:o.pl,leadWidth:o.pw,pitch:o.p,bodyWidth:o.w});case"vssop":return Pe(x7i,{pinCount:o.num_pins,leadLength:o.pl,leadWidth:o.pw,pitch:o.p,bodyWidth:o.w,bodyLength:o.h});case"qfp":return Pe(ZOn,{pinCount:o.num_pins,pitch:o.p,leadWidth:o.pw,padContactLength:o.pl,bodyWidth:o.w});case"tqfp":return Pe(T7i,{});case"lqfp":return Pe(Q7i,{pinCount:o.num_pins});case"qfn":{let c=typeof o.thermalpad?.x==="number"&&typeof o.thermalpad?.y==="number";return Pe(tVn,{num_pins:o.num_pins,bodyWidth:o.w,bodyLength:o.h,pitch:o.p,padLength:o.pl,padWidth:o.pw,thermalPadSize:c?{width:o.thermalpad.x,length:o.thermalpad.y}:void 0})}case"dfn":{let c=typeof o.thermalpad?.x==="number"&&typeof o.thermalpad?.y==="number";return Pe(pVn,{num_pins:o.num_pins,bodyWidth:o.w,bodyLength:o.h,pitch:o.p,padLength:o.pl,padWidth:o.pw,thermalPadSize:c?{width:o.thermalpad.x,length:o.thermalpad.y}:void 0})}case"pinrow":case"headermodule":{let c=e.match(/_rows(\d+)/),l=c&&c[1]?parseInt(c[1],10):1;if(o.male)return Pe(eVn,{numberOfPins:o.num_pins,pitch:o.p,invert:o.invert,rows:l,smd:o.smd||o.surface_mount,rightangle:o.rightangle});if(o.female)return Pe(g7i,{numberOfPins:o.num_pins,pitch:o.p,rows:l})}case"smdpinheader":return Pe(mSi,{numberOfPins:o.num_pins,pitch:o.p,bodyWidth:o.bh});case"led5050":return Pe(ASi,{color:i});case"led":{let c=String(o.imperial);if(c==="0402"||c==="0603"||c==="0805")return Pe(q8i,{footprint:c,color:i});break}case"cap":{switch(o.imperial){case"0402":return Pe($On,{color:"#856c4d"});case"0603":return Pe(qOn,{color:"#856c4d"});case"0805":return Pe(JOn,{color:"#856c4d"});case"0201":return Pe(oVn,{color:"#856c4d"});case"01005":return Pe(rVn,{color:"#856c4d"});case"1206":return Pe(iVn,{color:"#856c4d"});case"1210":return Pe(sVn,{color:"#856c4d"});case"2010":return Pe(aVn,{color:"#856c4d"});case"2512":return Pe(cVn,{color:"#856c4d"})}break}case"sot23":switch(o.num_pins){case 3:return Pe(c7i,{color:i});case 5:return Pe(nVn,{})}break;case"sot25":return Pe(nVn,{});case"sot":case"sot343":{let c=o.fn==="sot343";return Pe(_Si,{pads:xVn(n),bodyWidth:c?1.25:1.6,bodyLength:c?2:2.9,bodyHeight:c?1.1:1.3})}case"sot563":return Pe(SSi,{});case"sot89":{let c=s(o.w,4.2);return Pe(uVn,{fullWidth:c,bodyWidth:c*0.6,bodyLength:s(o.h,4.8)*0.94,bodyHeight:1.5,leadWidth:s(o.pw,0.48),tabLeadWidth:s(o.pw,0.48)*2,padPitch:s(o.p,1.5),leadHeight:0.66})}case"sot457":return Pe(Y7i,{});case"smdslideswitch":return Pe(vSi,{footprint:n});case"usbcmidmount":return Pe(ESi,{footprint:n});case"sot143":return Pe(MSi,{footprint:n});case"sot223":return Pe(uVn,{});case"sot23w":return Pe(l7i,{});case"sot323":return Pe(D7i,{});case"sod323f":return Pe($7i,{});case"sod323fl":return Pe(q7i,{});case"sot363":return Pe(j7i,{});case"sot886":return Pe(K7i,{});case"sot963":return Pe(G7i,{});case"pushbutton":return Pe(A7i,{width:o.w,length:o.h,innerDiameter:o.id});case"jst":if(QVn(n))return Pe(sSi,{footprint:n});if(o.zh)return Pe(oSi,{numPins:o.num_pins});if(o.ph)return Pe(rSi,{numPins:o.num_pins});if(o.xh)return Pe(iSi,{numPins:o.num_pins});break;case"fpc":return Pe(pSi,{pinCount:o.num_pins,pitch:o.p,padWidth:o.pw,padLength:o.pl,staggered:o.staggered,reverse:o.reverse,rowPitch:o.py,topPadLength:o.toppl,bottomPadLength:o.bottompl,mountPadPitchX:o.mpx,mountPadOffsetY:o.mpy,mountTop:o.mounttop,mountPadWidth:o.mpw,mountPadLength:o.mpl});case"rj45":return Pe(ySi,{bodyWidth:o.w,bodyDepth:o.h,bodyCenterY:o.bodyy,ledPins:o.ledpins||o.num_pins===14,firstPinLeft:o.firstpinleft,firstPinTop:o.firstpintop,signalPitch:o.p,signalRowPitch:o.py,signalHoleDiameter:o.id,shieldPinX:o.shieldx,shieldPinY:o.shieldy,shieldHoleDiameter:o.shieldid,locatorHoleX:o.holex,locatorHoleY:o.holey,locatorHoleDiameter:o.holed,ledPinX:o.ledx,ledPinPitch:o.ledp,ledPinY:o.ledy});case"soic":case"sop8":case"ssop":return Pe(y7i,{pinCount:o.num_pins,leadLength:o.pl,leadWidth:o.pw,pitch:o.p,bodyWidth:o.w});case"son":case"wson":case"vson":{let c=o.fn==="vson"?s(o.grid?.x,3):s(o.w,3),l=o.fn==="vson"?s(o.grid?.y,3):s(o.h,3),h=s(o.epw,0),d=s(o.eph,0),u=o.pl!==void 0?s(o.pl,0):void 0,_=o.pw!==void 0?s(o.pw,0):void 0,p=xVn(n).filter((f)=>Number(f.pin??0)<=o.num_pins),m=(f)=>new Set(f.map((y)=>y.toFixed(3))).size,A=p.length>2&&m(p.map((f)=>f.y))===2&&m(p.map((f)=>f.x))>2,g=Pe(pVn,{num_pins:o.num_pins,bodyWidth:A?l:c,bodyLength:A?c:l,pitch:s(o.p,0.5),padLength:u,padWidth:_,thermalPadSize:o.ep&&h>0&&d>0?{width:A?d:h,length:A?h:d}:void 0});return A?Pe(ic,{rotation:[0,0,"90deg"],children:g}):g}case"mlp":case"lga":case"quad":{if(o.legsoutside)return Pe(ZOn,{pinCount:o.num_pins,pitch:s(o.p,0.5),leadWidth:s(o.pw,0.25),padContactLength:s(o.pl,0.25),bodyWidth:s(o.w,6)});return Pe(tVn,{num_pins:o.num_pins,bodyWidth:s(o.w,6),bodyLength:s(o.h,6),pitch:s(o.p,0.5),padLength:s(o.pl,0.25),padWidth:s(o.pw,0.25)})}case"bga":{let c=s(o.p,0.8),l=o.grid?.x??8,h=o.grid?.y??8;return Pe(PSi,{ballPitch:c,ballColumns:l,ballRows:h,ballDiameter:c*0.625,packageWidth:l*c,packageLength:h*c})}case"sod523":return Pe(C7i,{});case"sod723":return Pe(nSi,{});case"sod882":return Pe(lVn,{});case"sma":return Pe(b7i,{});case"smb":return Pe(hVn,{});case"smc":return Pe(I7i,{});case"smf":return Pe(v7i,{});case"sod123":return Pe(E7i,{});case"sod123f":return Pe(S7i,{});case"sod123fl":return Pe(P7i,{});case"sod123w":return Pe(dVn,{});case"sod110":return Pe(dVn,{bodyWidth:2.1,bodyLength:1.4});case"sod128":return Pe(M7i,{});case"sod323":return Pe(AVn,{});case"sod323w":return Pe(AVn,{});case"sod80":return Pe(mVn,{});case"sod882d":return Pe(lVn,{});case"smbf":return Pe(hVn,{});case"led2835":return Pe(fSi,{color:i,bodyWidth:s(o.w,3.5),bodyLength:s(o.h,2.8),pad1X:s(o.p1x,-0.9),pad1Width:s(o.p1w,2.2),pad2X:s(o.p2x,1.375),pad2Width:s(o.p2w,1.25),padLength:s(o.ph,2.2)});case"electrolytic":case"radial":{let c=s(o.p,2.5),l=e.match(/_d([\d.]+)/),h=o.d!==void 0?s(o.d,c*2):l?Number(l[1]):c*2;return Pe(CSi,{diameter:h,leadPitch:c})}case"potentiometer":return Pe(bSi,{bodyWidth:s(o.w,5.35),bodyLength:s(o.ca,14),bodyHeight:s(o.h,4),leads:S0e(n)});case"smdpushbutton":return Pe(ISi,{padSpanX:s(o.px,4.2),padSpanY:s(o.py,2.15),padWidth:s(o.pw,1.05),padLength:s(o.ph,0.7)});case"breakoutheaders":{let c=s(o.p,2.54),l=s(o.w,10)/2,h=[{x:-l,pins:o.left??0,key:"left"},{x:l,pins:o.right??0,key:"right"}];return Pe(Uo,{children:h.filter(({pins:d})=>d>0).map(({x:d,pins:u,key:_})=>Pe(ho,{center:[d,0,0],children:Pe(ic,{rotation:[0,0,"90deg"],children:Pe(eVn,{numberOfPins:u,pitch:c})})},_))})}case"sod923":return Pe(w7i,{});case"hc49":return Pe(L7i,{});case"micromelf":return Pe(H7i,{});case"minimelf":return Pe(mVn,{});case"melf":return Pe(F7i,{});case"ms012":return Pe(z7i,{pinCount:o.num_pins,padContactLength:o.pl,leadWidth:o.pw,pitch:o.p});case"ms013":return Pe(O7i,{pinCount:o.num_pins,padContactLength:o.pl,leadWidth:o.pw,pitch:o.p});case"sot723":return Pe(k7i,{});case"to220":return Pe(_Vn,{leads:S0e(n)});case"to220f":return Pe(_Vn,{mouldedTab:!0,leads:S0e(n)});case"to92":return Pe(gVn,{leads:S0e(n)});case"to92l":case"to92s":{let c=s(o.w,4.8),l=s(o.h,4),h=Math.max(c,l);return Pe(gVn,{bodyDiameter:h,flatCut:Math.max(h-Math.min(c,l),0.4),leads:S0e(n)})}case"to252":case"dpak":case"to263":case"d2pak":{let c=o.fn==="to263"||o.fn==="d2pak",l=s(o.tabw,c?8.38:6.2),h=Math.min(s(o.tabh,c?10:5.8),c?10:6.5);return Pe(xSi,{bodyWidth:l,bodyLength:s(o.w,c?10.1:6.6),bodyHeight:c?4.4:2.3,tabWidth:l,tabLength:h,span:s(o.span,c?10.21:6.85),pitch:s(o.p,c?2.54:2.29),leadWidth:s(o.pw,1.5),leadContactLength:s(o.pl,3)})}case"stampboard":case"stampreceiver":return Pe(Z7i,{bodyWidth:o.w,leadsLeft:o.left,leadsRight:o.right,leadsTop:o.top,leadsBottom:o.bottom,leadsPitch:o.p,leadWidth:o.pw,leadLength:o.pl,innerHoles:o.innerhole,innerHoleEdgeDistance:o.innerholeedgedistance});case"mountedpcbmodule":{let c=o.rows??1,l=o.pinRowSide??"left",{holeInset:h,width:d,height:u,pinrow:_,pinRowHoleEdgeToEdgeDist:p}=o,m=Array.isArray(o.holes)?o.holes:[];return Pe(eSi,{numPins:_,rows:c,p:o.p,id:o.id,od:o.od,width:d,height:u,pinRowSide:l,holes:m,holeInset:h,pinRowHoleEdgeToEdgeDist:p,nopin:o.nopin,female:o.female,screen:o.screen,screenWidth:o.screenwidth,screenHeight:o.screenheight,screenCenterOffsetX:o.screencenteroffsetx,screenCenterOffsetY:o.screencenteroffsety})}}switch(o.imperial){case"0402":return Pe($On,{color:i});case"0603":return Pe(qOn,{color:i});case"0805":return Pe(JOn,{color:i});case"0201":return Pe(oVn,{color:i});case"01005":return Pe(rVn,{color:i});case"1206":return Pe(iVn,{color:i});case"1210":return Pe(sVn,{color:i});case"2010":return Pe(aVn,{color:i});case"2512":return Pe(cVn,{color:i})}if((o.fn==="res"||o.fn==="cap")&&o.p!==void 0&&o.ph!==void 0){let c=Ni(o.p),l=Ni(o.ph);if(Number.isFinite(c)&&Number.isFinite(l))return Pe(gSi,{padPitch:c,padHeight:l,color:i??(o.fn==="cap"?"#856c4d":void 0)})}return null},BSi=(e)=>e&&typeof e==="object"&&("type"in e),Iee=(e)=>{if(typeof e==="number")return e;if(typeof e==="string"){let t=/^(-?\d+(?:\.\d+)?)\s*deg$/i.exec(e);if(t)return parseFloat(t[1])*Math.PI/180;let n=Number(e);if(!Number.isNaN(n))return n}return 0},TSi=(e)=>{if(Array.isArray(e))return[Number(e[0])||0,Number(e[1])||0,Number(e[2])||0];if(typeof e==="object"&&e)return[Number(e.x)||0,Number(e.y)||0,Number(e.z)||0];return[0,0,0]};function V9(e,t,n){let{jscad:{primitives:o,booleans:r,hulls:i,geometries:s,extrusions:a,transforms:c}}=n;if(e==null||e===!1)return[];if(Array.isArray(e))return e.flatMap((u)=>V9(u,t,n));if(!BSi(e))return[];let{type:l,props:h,children:d}=e;if(h?.material){let{material:u,..._}=h;return V9({...e,props:_},t,n).map((p)=>({...p,material:{...u},geom:{...p.geom,material:{...u}}}))}if(l===vVn)return(d??[]).flatMap((u)=>V9(u,t,n));if(l===Gn){let u=h?.color;return(d??[]).flatMap((_)=>V9(_,u??t,n))}if(l===ho){let u=TSi(h?.offset??h?.center??{x:h?.x,y:h?.y,z:h?.z});return(d??[]).flatMap((p)=>V9(p,t,n)).map(({geom:p,color:m,material:A})=>({material:A,geom:c.translate(u,p),color:m??t}))}if(l===ic){let u=h?.angles??h?.rotation,_=Array.isArray(u)?[Iee(u[0]),Iee(u[1]),Iee(u[2])]:[Iee(h?.x??0),Iee(h?.y??0),Iee(h?.z??0)];return(d??[]).flatMap((m)=>V9(m,t,n)).map(({geom:m,color:A,material:g})=>({material:g,geom:c.rotateZ(_[2],c.rotateY(_[1],c.rotateX(_[0],m))),color:A}))}if(l===S0||l===Il||l===Oa){let u=(d??[]).flatMap((m)=>V9(m,t,n)),_=u.map((m)=>m.geom);if(_.length===0)return[];let p;if(l===S0)p=r.union(_);else if(l===Il)p=r.subtract(_[0],_.slice(1));else p=i.hull(_);return[{geom:p,color:t,material:l===Il?u[0]?.material:void 0}]}if(l===sd)return[{geom:h.geometry,color:t}];if(l===See){let u=h?.points??[];return[{geom:s.geom2.fromPoints(u),color:t??h?.color}]}if(l===Pee){let u=(d??[]).flatMap((g)=>V9(g,t,n)),_=u.map((g)=>g.geom);if(_.length===0)return[];let p=_.length>1?r.union(_):_[0],m=h?.height??h?.h??1,A=a.extrudeLinear({height:m},p);if(A.polygons)for(let g of A.polygons){if(!g.plane||!g.vertices||g.vertices.length<3)continue;g.vertices.reverse()}return[{geom:A,color:t??h?.color,material:u.length===1?u[0]?.material:void 0}]}if(l===Ht||l===GOn||l===Yi||l===vee||l===yg||l===Dy){let u;if(l===Ht){let _=h?.size??[1,1,1],p=h?.offset,m=h?.center??(p?[p[0],p[1],p[2]]:[0,0,0]);u=o.cuboid({size:_,center:m})}else if(l===GOn){let _=h?.size??1,p=h?.offset,m=h?.center??(p?[p[0],p[1],p[2]]:[0,0,0]);u=o.cube({size:_,center:m})}else if(l===Yi){let _=h?.height??1,p=h?.radius??1,m=h?.center??[0,0,0];u=o.cylinder({height:_,radius:p,center:m})}else if(l===vee){let _=h?.radius??1,p=h?.center??[0,0,0];u=o.sphere({radius:_,center:p})}else if(l===Dy){let _=h?.height??1,p=h?.radius??1,m=h?.roundRadius??0.1,A=h?.center??[0,0,0];u=o.roundedCylinder({height:_,radius:p,roundRadius:m,center:A})}else{let _=h?.size??[1,1,1],p=h?.roundRadius??0.1,m=h?.center??[0,0,0];u=o.roundedCuboid({size:_,roundRadius:p,center:m})}return[{geom:u,color:t??h?.color}]}if(typeof l==="function"){let u=l(h??{});return V9(u,t,n)}return(d??[]).flatMap((u)=>V9(u,t,n))}function DSi(e,t){return{geometries:V9(e,void 0,{jscad:t}).map((o)=>o.material?{...o,geom:{...o.geom,material:o.material}}:o)}}function k0e(e){if(e.polygons){let t=[],n=[],o=[],r=0;for(let s of e.polygons){for(let c of s.vertices){if(c.index=r,t.push(c[0],c[1],c[2]),e.color&&e.color.length>=3)o.push(e.color[0],e.color[1],e.color[2]);else o.push(1,1,1);r++}let a=s.vertices[0].index;for(let c=2;c<s.vertices.length;c++){let l=s.vertices[c-1].index,h=s.vertices[c].index;n.push(a,l,h)}}let i=new ha;if(i.setAttribute("position",new ol(new Float32Array(t),3)),i.setIndex(n),o.length>0)i.setAttribute("color",new ol(new Float32Array(o),3));if(e.transforms){let s=new Fi;s.fromArray(e.transforms),i.applyMatrix4(s)}return i.computeVertexNormals(),i}if(e.sides){let t=[],n=[];for(let r of e.sides)if(t.push(r[0][0],r[0][1],0),e.color&&e.color.length>=3)n.push(e.color[0],e.color[1],e.color[2]);else n.push(1,1,1);let o=new ha;if(o.setAttribute("position",new ol(new Float32Array(t),3)),n.length>0)o.setAttribute("color",new ol(new Float32Array(n),3));if(e.transforms){let r=new Fi;r.fromArray(e.transforms),o.applyMatrix4(r)}return o}return console.error("Invalid CSG object: neither polygons nor sides found"),new ha}function Fht(e,t){let n=Tht(wSi,{footprint:e});return DSi(n,t)}var Uee=Qe(rn(),1);var w$n=Qe(rn(),1),x_=Qe(rn(),1);var B$n=Qe(so(),1),JEe=Qe(so(),1);var D$n=Qe(so(),1),IG=Qe(rn(),1);var dPe=(()=>parseInt(eEt.replace(/\D+/g,"")))();var NSi=Object.defineProperty,RSi=(e,t,n)=>(t in e)?NSi(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,QSi=(e,t,n)=>(RSi(e,typeof t!=="symbol"?t+"":t,n),n);async function kVn(e){let t=await e.arrayBuffer(),n=btoa(String.fromCharCode(...new Uint8Array(t)));return`data:${e.type||""};base64,${n}`}var uPe,zht,Eee,pPe;function Oht(e,t=1/0,n=null){if(!zht)zht=new v2(2,2,1,1);if(!Eee)Eee=new y4({uniforms:{blitTexture:new sxe(e)},vertexShader:`
        varying vec2 vUv;
        void main(){
            vUv = uv;
            gl_Position = vec4(position.xy * 1.0,0.,.999999);
        }
      `,fragmentShader:`
          uniform sampler2D blitTexture; 
          varying vec2 vUv;

          void main(){ 
              gl_FragColor = vec4(vUv.xy, 0, 1);
              
              #ifdef IS_SRGB
              gl_FragColor = LinearTosRGB( texture2D( blitTexture, vUv) );
              #else
              gl_FragColor = texture2D( blitTexture, vUv);
              #endif
          }
      `});if(Eee.uniforms.blitTexture.value=e,Eee.defines.IS_SRGB="colorSpace"in e?e.colorSpace==="srgb":e.encoding===3001,Eee.needsUpdate=!0,!pPe)pPe=new Qo(zht,Eee),pPe.frustrumCulled=!1;let o=new wl,r=new C4;if(r.add(pPe),!n)n=uPe=new zM({antialias:!1});n.setSize(Math.min(e.image.width,t),Math.min(e.image.height,t)),n.clear(),n.render(r,o);let i=new Bl(n.domElement);if(i.minFilter=e.minFilter,i.magFilter=e.magFilter,i.wrapS=e.wrapS,i.wrapT=e.wrapT,i.name=e.name,uPe)uPe.dispose(),uPe=null;return i}var LVn={POSITION:["byte","byte normalized","unsigned byte","unsigned byte normalized","short","short normalized","unsigned short","unsigned short normalized"],NORMAL:["byte normalized","short normalized"],TANGENT:["byte normalized","short normalized"],TEXCOORD:["byte","byte normalized","unsigned byte","short","short normalized","unsigned short"]},Mee=(()=>{class e{constructor(){this.pluginCallbacks=[],this.register(function(t){return new UVn(t)}),this.register(function(t){return new WVn(t)}),this.register(function(t){return new KVn(t)}),this.register(function(t){return new $Vn(t)}),this.register(function(t){return new qVn(t)}),this.register(function(t){return new JVn(t)}),this.register(function(t){return new XVn(t)}),this.register(function(t){return new jVn(t)}),this.register(function(t){return new ZVn(t)}),this.register(function(t){return new eYn(t)}),this.register(function(t){return new tYn(t)})}register(t){if(this.pluginCallbacks.indexOf(t)===-1)this.pluginCallbacks.push(t);return this}unregister(t){if(this.pluginCallbacks.indexOf(t)!==-1)this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(t),1);return this}parse(t,n,o,r){let i=new GVn,s=[];for(let a=0,c=this.pluginCallbacks.length;a<c;a++)s.push(this.pluginCallbacks[a](i));i.setPlugins(s),i.write(t,n,r).catch(o)}parseAsync(t,n){let o=this;return new Promise(function(r,i){o.parse(t,r,i,n)})}}return QSi(e,"Utils",{insertKeyframe:function(t,n){let r=t.getValueSize(),i=new t.TimeBufferType(t.times.length+1),s=new t.ValueBufferType(t.values.length+r),a=t.createInterpolant(new t.ValueBufferType(r)),c;if(t.times.length===0){i[0]=n;for(let l=0;l<r;l++)s[l]=0;c=0}else if(n<t.times[0]){if(Math.abs(t.times[0]-n)<0.001)return 0;i[0]=n,i.set(t.times,1),s.set(a.evaluate(n),0),s.set(t.values,r),c=0}else if(n>t.times[t.times.length-1]){if(Math.abs(t.times[t.times.length-1]-n)<0.001)return t.times.length-1;i[i.length-1]=n,i.set(t.times,0),s.set(t.values,0),s.set(a.evaluate(n),t.values.length),c=i.length-1}else for(let l=0;l<t.times.length;l++){if(Math.abs(t.times[l]-n)<0.001)return l;if(t.times[l]<n&&t.times[l+1]>n){i.set(t.times.slice(0,l+1),0),i[l+1]=n,i.set(t.times.slice(l+1),l+2),s.set(t.values.slice(0,(l+1)*r),0),s.set(a.evaluate(n),(l+1)*r),s.set(t.values.slice((l+1)*r),(l+2)*r),c=l+1;break}}return t.times=i,t.values=s,c},mergeMorphTargetTracks:function(t,n){let o=[],r={},i=t.tracks;for(let s=0;s<i.length;++s){let a=i[s],c=Gc.parseTrackName(a.name),l=Gc.findNode(n,c.nodeName);if(c.propertyName!=="morphTargetInfluences"||c.propertyIndex===void 0){o.push(a);continue}if(a.createInterpolant!==a.InterpolantFactoryMethodDiscrete&&a.createInterpolant!==a.InterpolantFactoryMethodLinear){if(a.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline)throw Error("THREE.GLTFExporter: Cannot merge tracks with glTF CUBICSPLINE interpolation.");console.warn("THREE.GLTFExporter: Morph target interpolation mode not yet supported. Using LINEAR instead."),a=a.clone(),a.setInterpolation(zie)}let h=l.morphTargetInfluences.length,d=l.morphTargetDictionary[c.propertyIndex];if(d===void 0)throw Error("THREE.GLTFExporter: Morph target name not found: "+c.propertyIndex);let u;if(r[l.uuid]===void 0){u=a.clone();let p=new u.ValueBufferType(h*u.times.length);for(let m=0;m<u.times.length;m++)p[m*h+d]=u.values[m];u.name=(c.nodeName||"")+".morphTargetInfluences",u.values=p,r[l.uuid]=u,o.push(u);continue}let _=a.createInterpolant(new a.ValueBufferType(1));u=r[l.uuid];for(let p=0;p<u.times.length;p++)u.values[p*h+d]=_.evaluate(u.times[p]);for(let p=0;p<a.times.length;p++){let m=this.insertKeyframe(u,a.times[p]);u.values[m*h+d]=a.values[p]}}return t.tracks=o,t}}),e})(),Sc={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,ARRAY_BUFFER:34962,ELEMENT_ARRAY_BUFFER:34963,NEAREST:9728,LINEAR:9729,NEAREST_MIPMAP_NEAREST:9984,LINEAR_MIPMAP_NEAREST:9985,NEAREST_MIPMAP_LINEAR:9986,LINEAR_MIPMAP_LINEAR:9987,CLAMP_TO_EDGE:33071,MIRRORED_REPEAT:33648,REPEAT:10497},Vht="KHR_mesh_quantization",l3={};l3[Hye]=Sc.NEAREST;l3[Fye]=Sc.NEAREST_MIPMAP_NEAREST;l3[zye]=Sc.NEAREST_MIPMAP_LINEAR;l3[uc]=Sc.LINEAR;l3[Oye]=Sc.LINEAR_MIPMAP_NEAREST;l3[Pd]=Sc.LINEAR_MIPMAP_LINEAR;l3[VC]=Sc.CLAMP_TO_EDGE;l3[x4]=Sc.REPEAT;l3[Lye]=Sc.MIRRORED_REPEAT;var HVn={scale:"scale",position:"translation",quaternion:"rotation",morphTargetInfluences:"weights"},kSi=new Do,FVn=12,LSi=1179937895,HSi=2,zVn=8,FSi=1313821514,zSi=5130562;function L0e(e,t){return e.length===t.length&&e.every(function(n,o){return n===t[o]})}function OSi(e){return new TextEncoder().encode(e).buffer}function VSi(e){return L0e(e.elements,[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}function YSi(e,t,n){let o={min:Array(e.itemSize).fill(Number.POSITIVE_INFINITY),max:Array(e.itemSize).fill(Number.NEGATIVE_INFINITY)};for(let r=t;r<t+n;r++)for(let i=0;i<e.itemSize;i++){let s;if(e.itemSize>4)s=e.array[r*e.itemSize+i];else{if(i===0)s=e.getX(r);else if(i===1)s=e.getY(r);else if(i===2)s=e.getZ(r);else if(i===3)s=e.getW(r);if(e.normalized===!0)s=d7.normalize(s,e.array)}o.min[i]=Math.min(o.min[i],s),o.max[i]=Math.max(o.max[i],s)}return o}function YVn(e){return Math.ceil(e/4)*4}function Yht(e,t=0){let n=YVn(e.byteLength);if(n!==e.byteLength){let o=new Uint8Array(n);if(o.set(new Uint8Array(e)),t!==0)for(let r=e.byteLength;r<n;r++)o[r]=t;return o.buffer}return e}function OVn(){if(typeof document>"u"&&typeof OffscreenCanvas<"u")return new OffscreenCanvas(1,1);return document.createElement("canvas")}function VVn(e,t){if(e.toBlob!==void 0)return new Promise((o)=>e.toBlob(o,t));let n;if(t==="image/jpeg")n=0.92;else if(t==="image/webp")n=0.8;return e.convertToBlob({type:t,quality:n})}class GVn{constructor(){this.plugins=[],this.options={},this.pending=[],this.buffers=[],this.byteOffset=0,this.buffers=[],this.nodeMap=new Map,this.skins=[],this.extensionsUsed={},this.extensionsRequired={},this.uids=new Map,this.uid=0,this.json={asset:{version:"2.0",generator:"THREE.GLTFExporter"}},this.cache={meshes:new Map,attributes:new Map,attributesNormalized:new Map,materials:new Map,textures:new Map,images:new Map}}setPlugins(e){this.plugins=e}async write(e,t,n={}){if(this.options=Object.assign({binary:!1,trs:!1,onlyVisible:!0,maxTextureSize:1/0,animations:[],includeCustomExtensions:!1},n),this.options.animations.length>0)this.options.trs=!0;this.processInput(e),await Promise.all(this.pending);let o=this,{buffers:r,json:i}=o;n=o.options;let{extensionsUsed:s,extensionsRequired:a}=o,c=new Blob(r,{type:"application/octet-stream"}),l=Object.keys(s),h=Object.keys(a);if(l.length>0)i.extensionsUsed=l;if(h.length>0)i.extensionsRequired=h;if(i.buffers&&i.buffers.length>0)i.buffers[0].byteLength=c.size;if(n.binary===!0)c.arrayBuffer().then((d)=>{let u=Yht(d),_=new DataView(new ArrayBuffer(zVn));_.setUint32(0,u.byteLength,!0),_.setUint32(4,zSi,!0);let p=Yht(OSi(JSON.stringify(i)),32),m=new DataView(new ArrayBuffer(zVn));m.setUint32(0,p.byteLength,!0),m.setUint32(4,FSi,!0);let A=new ArrayBuffer(FVn),g=new DataView(A);g.setUint32(0,LSi,!0),g.setUint32(4,HSi,!0);let f=FVn+m.byteLength+p.byteLength+_.byteLength+u.byteLength;g.setUint32(8,f,!0),new Blob([A,m,p,_,u],{type:"application/octet-stream"}).arrayBuffer().then(t)});else if(i.buffers&&i.buffers.length>0)kVn(c).then((d)=>{i.buffers[0].uri=d,t(i)});else t(i)}serializeUserData(e,t){if(Object.keys(e.userData).length===0)return;let n=this.options,o=this.extensionsUsed;try{let r=JSON.parse(JSON.stringify(e.userData));if(n.includeCustomExtensions&&r.gltfExtensions){if(t.extensions===void 0)t.extensions={};for(let i in r.gltfExtensions)t.extensions[i]=r.gltfExtensions[i],o[i]=!0;delete r.gltfExtensions}if(Object.keys(r).length>0)t.extras=r}catch(r){console.warn("THREE.GLTFExporter: userData of '"+e.name+"' won't be serialized because of JSON.stringify error - "+r.message)}}getUID(e,t=!1){if(this.uids.has(e)===!1){let o=new Map;o.set(!0,this.uid++),o.set(!1,this.uid++),this.uids.set(e,o)}return this.uids.get(e).get(t)}isNormalizedNormalAttribute(e){if(this.cache.attributesNormalized.has(e))return!1;let n=new Dt;for(let o=0,r=e.count;o<r;o++)if(Math.abs(n.fromBufferAttribute(e,o).length()-1)>0.0005)return!1;return!0}createNormalizedNormalAttribute(e){let t=this.cache;if(t.attributesNormalized.has(e))return t.attributesNormalized.get(e);let n=e.clone(),o=new Dt;for(let r=0,i=n.count;r<i;r++){if(o.fromBufferAttribute(n,r),o.x===0&&o.y===0&&o.z===0)o.setX(1);else o.normalize();n.setXYZ(r,o.x,o.y,o.z)}return t.attributesNormalized.set(e,n),n}applyTextureTransform(e,t){let n=!1,o={};if(t.offset.x!==0||t.offset.y!==0)o.offset=t.offset.toArray(),n=!0;if(t.rotation!==0)o.rotation=t.rotation,n=!0;if(t.repeat.x!==1||t.repeat.y!==1)o.scale=t.repeat.toArray(),n=!0;if(n)e.extensions=e.extensions||{},e.extensions.KHR_texture_transform=o,this.extensionsUsed.KHR_texture_transform=!0}buildMetalRoughTexture(e,t){if(e===t)return e;function n(u){if("colorSpace"in u?u.colorSpace==="srgb":u.encoding===3001)return function(p){return p<0.04045?p*0.0773993808:Math.pow(p*0.9478672986+0.0521327014,2.4)};return function(p){return p}}if(console.warn("THREE.GLTFExporter: Merged metalnessMap and roughnessMap textures."),e instanceof Uie)e=Oht(e);if(t instanceof Uie)t=Oht(t);let o=e?e.image:null,r=t?t.image:null,i=Math.max(o?o.width:0,r?r.width:0),s=Math.max(o?o.height:0,r?r.height:0),a=OVn();a.width=i,a.height=s;let c=a.getContext("2d");c.fillStyle="#00ffff",c.fillRect(0,0,i,s);let l=c.getImageData(0,0,i,s);if(o){c.drawImage(o,0,0,i,s);let u=n(e),_=c.getImageData(0,0,i,s).data;for(let p=2;p<_.length;p+=4)l.data[p]=u(_[p]/256)*256}if(r){c.drawImage(r,0,0,i,s);let u=n(t),_=c.getImageData(0,0,i,s).data;for(let p=1;p<_.length;p+=4)l.data[p]=u(_[p]/256)*256}c.putImageData(l,0,0);let d=(e||t).clone();if(d.source=new Bl(a).source,"colorSpace"in d)d.colorSpace="";else d.encoding=3000;if(d.channel=(e||t).channel,e&&t&&e.channel!==t.channel)console.warn("THREE.GLTFExporter: UV channels for metalnessMap and roughnessMap textures must match.");return d}processBuffer(e){let t=this.json,n=this.buffers;if(!t.buffers)t.buffers=[{byteLength:0}];return n.push(e),0}processBufferView(e,t,n,o,r){let i=this.json;if(!i.bufferViews)i.bufferViews=[];let s;switch(t){case Sc.BYTE:case Sc.UNSIGNED_BYTE:s=1;break;case Sc.SHORT:case Sc.UNSIGNED_SHORT:s=2;break;default:s=4}let a=e.itemSize*s;if(r===Sc.ARRAY_BUFFER)a=Math.ceil(a/4)*4;let c=YVn(o*a),l=new DataView(new ArrayBuffer(c)),h=0;for(let _=n;_<n+o;_++){for(let p=0;p<e.itemSize;p++){let m;if(e.itemSize>4)m=e.array[_*e.itemSize+p];else{if(p===0)m=e.getX(_);else if(p===1)m=e.getY(_);else if(p===2)m=e.getZ(_);else if(p===3)m=e.getW(_);if(e.normalized===!0)m=d7.normalize(m,e.array)}if(t===Sc.FLOAT)l.setFloat32(h,m,!0);else if(t===Sc.INT)l.setInt32(h,m,!0);else if(t===Sc.UNSIGNED_INT)l.setUint32(h,m,!0);else if(t===Sc.SHORT)l.setInt16(h,m,!0);else if(t===Sc.UNSIGNED_SHORT)l.setUint16(h,m,!0);else if(t===Sc.BYTE)l.setInt8(h,m);else if(t===Sc.UNSIGNED_BYTE)l.setUint8(h,m);h+=s}if(h%a!==0)h+=a-h%a}let d={buffer:this.processBuffer(l.buffer),byteOffset:this.byteOffset,byteLength:c};if(r!==void 0)d.target=r;if(r===Sc.ARRAY_BUFFER)d.byteStride=a;return this.byteOffset+=c,i.bufferViews.push(d),{id:i.bufferViews.length-1,byteLength:0}}processBufferViewImage(e){let t=this,n=t.json;if(!n.bufferViews)n.bufferViews=[];return e.arrayBuffer().then((o)=>{let r=Yht(o),i={buffer:t.processBuffer(r),byteOffset:t.byteOffset,byteLength:r.byteLength};return t.byteOffset+=r.byteLength,n.bufferViews.push(i)-1})}processAccessor(e,t,n,o){let r=this.json,i={1:"SCALAR",2:"VEC2",3:"VEC3",4:"VEC4",9:"MAT3",16:"MAT4"},s;if(e.array.constructor===Float32Array)s=Sc.FLOAT;else if(e.array.constructor===Int32Array)s=Sc.INT;else if(e.array.constructor===Uint32Array)s=Sc.UNSIGNED_INT;else if(e.array.constructor===Int16Array)s=Sc.SHORT;else if(e.array.constructor===Uint16Array)s=Sc.UNSIGNED_SHORT;else if(e.array.constructor===Int8Array)s=Sc.BYTE;else if(e.array.constructor===Uint8Array)s=Sc.UNSIGNED_BYTE;else throw Error("THREE.GLTFExporter: Unsupported bufferAttribute component type: "+e.array.constructor.name);if(n===void 0)n=0;if(o===void 0)o=e.count;if(o===0)return null;let a=YSi(e,n,o),c;if(t!==void 0)c=e===t.index?Sc.ELEMENT_ARRAY_BUFFER:Sc.ARRAY_BUFFER;let l=this.processBufferView(e,s,n,o,c),h={bufferView:l.id,byteOffset:l.byteOffset,componentType:s,count:o,max:a.max,min:a.min,type:i[e.itemSize]};if(e.normalized===!0)h.normalized=!0;if(!r.accessors)r.accessors=[];return r.accessors.push(h)-1}processImage(e,t,n,o="image/png"){if(e!==null){let r=this,{cache:i,json:s,options:a,pending:c}=r;if(!i.images.has(e))i.images.set(e,{});let l=i.images.get(e),h=o+":flipY/"+n.toString();if(l[h]!==void 0)return l[h];if(!s.images)s.images=[];let d={mimeType:o},u=OVn();u.width=Math.min(e.width,a.maxTextureSize),u.height=Math.min(e.height,a.maxTextureSize);let _=u.getContext("2d");if(n===!0)_.translate(0,u.height),_.scale(1,-1);if(e.data!==void 0){if(t!==cOe)console.error("GLTFExporter: Only RGBAFormat is supported.",t);if(e.width>a.maxTextureSize||e.height>a.maxTextureSize)console.warn("GLTFExporter: Image size is bigger than maxTextureSize",e);let m=new Uint8ClampedArray(e.height*e.width*4);for(let A=0;A<m.length;A+=4)m[A+0]=e.data[A+0],m[A+1]=e.data[A+1],m[A+2]=e.data[A+2],m[A+3]=e.data[A+3];_.putImageData(new ImageData(m,e.width,e.height),0,0)}else _.drawImage(e,0,0,u.width,u.height);if(a.binary===!0)c.push(VVn(u,o).then((m)=>r.processBufferViewImage(m)).then((m)=>{d.bufferView=m}));else if(u.toDataURL!==void 0)d.uri=u.toDataURL(o);else c.push(VVn(u,o).then(kVn).then((m)=>{d.uri=m}));let p=s.images.push(d)-1;return l[h]=p,p}else throw Error("THREE.GLTFExporter: No valid image data found. Unable to process texture.")}processSampler(e){let t=this.json;if(!t.samplers)t.samplers=[];let n={magFilter:l3[e.magFilter],minFilter:l3[e.minFilter],wrapS:l3[e.wrapS],wrapT:l3[e.wrapT]};return t.samplers.push(n)-1}processTexture(e){let n=this.options,o=this.cache,r=this.json;if(o.textures.has(e))return o.textures.get(e);if(!r.textures)r.textures=[];if(e instanceof Uie)e=Oht(e,n.maxTextureSize);let i=e.userData.mimeType;if(i==="image/webp")i="image/png";let s={sampler:this.processSampler(e),source:this.processImage(e.image,e.format,e.flipY,i)};if(e.name)s.name=e.name;this._invokeAll(function(c){c.writeTexture&&c.writeTexture(e,s)});let a=r.textures.push(s)-1;return o.textures.set(e,a),a}processMaterial(e){let t=this.cache,n=this.json;if(t.materials.has(e))return t.materials.get(e);if(e.isShaderMaterial)return console.warn("GLTFExporter: THREE.ShaderMaterial not supported."),null;if(!n.materials)n.materials=[];let o={pbrMetallicRoughness:{}};if(e.isMeshStandardMaterial!==!0&&e.isMeshBasicMaterial!==!0)console.warn("GLTFExporter: Use MeshStandardMaterial or MeshBasicMaterial for best results.");let r=e.color.toArray().concat([e.opacity]);if(!L0e(r,[1,1,1,1]))o.pbrMetallicRoughness.baseColorFactor=r;if(e.isMeshStandardMaterial)o.pbrMetallicRoughness.metallicFactor=e.metalness,o.pbrMetallicRoughness.roughnessFactor=e.roughness;else o.pbrMetallicRoughness.metallicFactor=0.5,o.pbrMetallicRoughness.roughnessFactor=0.5;if(e.metalnessMap||e.roughnessMap){let s=this.buildMetalRoughTexture(e.metalnessMap,e.roughnessMap),a={index:this.processTexture(s),channel:s.channel};this.applyTextureTransform(a,s),o.pbrMetallicRoughness.metallicRoughnessTexture=a}if(e.map){let s={index:this.processTexture(e.map),texCoord:e.map.channel};this.applyTextureTransform(s,e.map),o.pbrMetallicRoughness.baseColorTexture=s}if(e.emissive){let s=e.emissive;if(Math.max(s.r,s.g,s.b)>0)o.emissiveFactor=e.emissive.toArray();if(e.emissiveMap){let c={index:this.processTexture(e.emissiveMap),texCoord:e.emissiveMap.channel};this.applyTextureTransform(c,e.emissiveMap),o.emissiveTexture=c}}if(e.normalMap){let s={index:this.processTexture(e.normalMap),texCoord:e.normalMap.channel};if(e.normalScale&&e.normalScale.x!==1)s.scale=e.normalScale.x;this.applyTextureTransform(s,e.normalMap),o.normalTexture=s}if(e.aoMap){let s={index:this.processTexture(e.aoMap),texCoord:e.aoMap.channel};if(e.aoMapIntensity!==1)s.strength=e.aoMapIntensity;this.applyTextureTransform(s,e.aoMap),o.occlusionTexture=s}if(e.transparent)o.alphaMode="BLEND";else if(e.alphaTest>0)o.alphaMode="MASK",o.alphaCutoff=e.alphaTest;if(e.side===A0)o.doubleSided=!0;if(e.name!=="")o.name=e.name;this.serializeUserData(e,o),this._invokeAll(function(s){s.writeMaterial&&s.writeMaterial(e,o)});let i=n.materials.push(o)-1;return t.materials.set(e,i),i}processMesh(e){let t=this.cache,n=this.json,o=[e.geometry.uuid];if(Array.isArray(e.material))for(let f=0,y=e.material.length;f<y;f++)o.push(e.material[f].uuid);else o.push(e.material.uuid);let r=o.join(":");if(t.meshes.has(r))return t.meshes.get(r);let i=e.geometry,s;if(e.isLineSegments)s=Sc.LINES;else if(e.isLineLoop)s=Sc.LINE_LOOP;else if(e.isLine)s=Sc.LINE_STRIP;else if(e.isPoints)s=Sc.POINTS;else s=e.material.wireframe?Sc.LINES:Sc.TRIANGLES;let a={},c={},l=[],h=[],d={...dPe>=152?{uv:"TEXCOORD_0",uv1:"TEXCOORD_1",uv2:"TEXCOORD_2",uv3:"TEXCOORD_3"}:{uv:"TEXCOORD_0",uv2:"TEXCOORD_1"},color:"COLOR_0",skinWeight:"WEIGHTS_0",skinIndex:"JOINTS_0"},u=i.getAttribute("normal");if(u!==void 0&&!this.isNormalizedNormalAttribute(u))console.warn("THREE.GLTFExporter: Creating normalized normal attribute from the non-normalized one."),i.setAttribute("normal",this.createNormalizedNormalAttribute(u));let _=null;for(let f in i.attributes){if(f.slice(0,5)==="morph")continue;let y=i.attributes[f];if(f=d[f]||f.toUpperCase(),!/^(POSITION|NORMAL|TANGENT|TEXCOORD_\d+|COLOR_\d+|JOINTS_\d+|WEIGHTS_\d+)$/.test(f))f="_"+f;if(t.attributes.has(this.getUID(y))){c[f]=t.attributes.get(this.getUID(y));continue}_=null;let C=y.array;if(f==="JOINTS_0"&&!(C instanceof Uint16Array)&&!(C instanceof Uint8Array))console.warn('GLTFExporter: Attribute "skinIndex" converted to type UNSIGNED_SHORT.'),_=new ol(new Uint16Array(C),y.itemSize,y.normalized);let b=this.processAccessor(_||y,i);if(b!==null){if(!f.startsWith("_"))this.detectMeshQuantization(f,y);c[f]=b,t.attributes.set(this.getUID(y),b)}}if(u!==void 0)i.setAttribute("normal",u);if(Object.keys(c).length===0)return null;if(e.morphTargetInfluences!==void 0&&e.morphTargetInfluences.length>0){let f=[],y=[],x={};if(e.morphTargetDictionary!==void 0)for(let C in e.morphTargetDictionary)x[e.morphTargetDictionary[C]]=C;for(let C=0;C<e.morphTargetInfluences.length;++C){let b={},I=!1;for(let v in i.morphAttributes){if(v!=="position"&&v!=="normal"){if(!I)console.warn("GLTFExporter: Only POSITION and NORMAL morph are supported."),I=!0;continue}let P=i.morphAttributes[v][C],M=v.toUpperCase(),B=i.attributes[v];if(t.attributes.has(this.getUID(P,!0))){b[M]=t.attributes.get(this.getUID(P,!0));continue}let T=P.clone();if(!i.morphTargetsRelative)for(let N=0,D=P.count;N<D;N++)for(let L=0;L<P.itemSize;L++){if(L===0)T.setX(N,P.getX(N)-B.getX(N));if(L===1)T.setY(N,P.getY(N)-B.getY(N));if(L===2)T.setZ(N,P.getZ(N)-B.getZ(N));if(L===3)T.setW(N,P.getW(N)-B.getW(N))}b[M]=this.processAccessor(T,i),t.attributes.set(this.getUID(B,!0),b[M])}if(h.push(b),f.push(e.morphTargetInfluences[C]),e.morphTargetDictionary!==void 0)y.push(x[C])}if(a.weights=f,y.length>0)a.extras={},a.extras.targetNames=y}let p=Array.isArray(e.material);if(p&&i.groups.length===0)return null;let m=p?e.material:[e.material],A=p?i.groups:[{materialIndex:0,start:void 0,count:void 0}];for(let f=0,y=A.length;f<y;f++){let x={mode:s,attributes:c};if(this.serializeUserData(i,x),h.length>0)x.targets=h;if(i.index!==null){let b=this.getUID(i.index);if(A[f].start!==void 0||A[f].count!==void 0)b+=":"+A[f].start+":"+A[f].count;if(t.attributes.has(b))x.indices=t.attributes.get(b);else x.indices=this.processAccessor(i.index,i,A[f].start,A[f].count),t.attributes.set(b,x.indices);if(x.indices===null)delete x.indices}let C=this.processMaterial(m[A[f].materialIndex]);if(C!==null)x.material=C;l.push(x)}if(a.primitives=l,!n.meshes)n.meshes=[];this._invokeAll(function(f){f.writeMesh&&f.writeMesh(e,a)});let g=n.meshes.push(a)-1;return t.meshes.set(r,g),g}detectMeshQuantization(e,t){if(this.extensionsUsed[Vht])return;let n=void 0;switch(t.array.constructor){case Int8Array:n="byte";break;case Uint8Array:n="unsigned byte";break;case Int16Array:n="short";break;case Uint16Array:n="unsigned short";break;default:return}if(t.normalized)n+=" normalized";let o=e.split("_",1)[0];if(LVn[o]&&LVn[o].includes(n))this.extensionsUsed[Vht]=!0,this.extensionsRequired[Vht]=!0}processCamera(e){let t=this.json;if(!t.cameras)t.cameras=[];let n=e.isOrthographicCamera,o={type:n?"orthographic":"perspective"};if(n)o.orthographic={xmag:e.right*2,ymag:e.top*2,zfar:e.far<=0?0.001:e.far,znear:e.near<0?0:e.near};else o.perspective={aspectRatio:e.aspect,yfov:d7.degToRad(e.fov),zfar:e.far<=0?0.001:e.far,znear:e.near<0?0:e.near};if(e.name!=="")o.name=e.type;return t.cameras.push(o)-1}processAnimation(e,t){let n=this.json,o=this.nodeMap;if(!n.animations)n.animations=[];e=Mee.Utils.mergeMorphTargetTracks(e.clone(),t);let r=e.tracks,i=[],s=[];for(let a=0;a<r.length;++a){let c=r[a],l=Gc.parseTrackName(c.name),h=Gc.findNode(t,l.nodeName),d=HVn[l.propertyName];if(l.objectName==="bones")if(h.isSkinnedMesh===!0)h=h.skeleton.getBoneByName(l.objectIndex);else h=void 0;if(!h||!d)return console.warn('THREE.GLTFExporter: Could not export animation track "%s".',c.name),null;let u=1,_=c.values.length/c.times.length;if(d===HVn.morphTargetInfluences)_/=h.morphTargetInfluences.length;let p;if(c.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline===!0)p="CUBICSPLINE",_/=3;else if(c.getInterpolation()===Vye)p="STEP";else p="LINEAR";s.push({input:this.processAccessor(new ol(c.times,u)),output:this.processAccessor(new ol(c.values,_)),interpolation:p}),i.push({sampler:s.length-1,target:{node:o.get(h),path:d}})}return n.animations.push({name:e.name||"clip_"+n.animations.length,samplers:s,channels:i}),n.animations.length-1}processSkin(e){let t=this.json,n=this.nodeMap,o=t.nodes[n.get(e)],r=e.skeleton;if(r===void 0)return null;let i=e.skeleton.bones[0];if(i===void 0)return null;let s=[],a=new Float32Array(r.bones.length*16),c=new Fi;for(let h=0;h<r.bones.length;++h)s.push(n.get(r.bones[h])),c.copy(r.boneInverses[h]),c.multiply(e.bindMatrix).toArray(a,h*16);if(t.skins===void 0)t.skins=[];return t.skins.push({inverseBindMatrices:this.processAccessor(new ol(a,16)),joints:s,skeleton:n.get(i)}),o.skin=t.skins.length-1}processNode(e){let t=this.json,n=this.options,o=this.nodeMap;if(!t.nodes)t.nodes=[];let r={};if(n.trs){let s=e.quaternion.toArray(),a=e.position.toArray(),c=e.scale.toArray();if(!L0e(s,[0,0,0,1]))r.rotation=s;if(!L0e(a,[0,0,0]))r.translation=a;if(!L0e(c,[1,1,1]))r.scale=c}else{if(e.matrixAutoUpdate)e.updateMatrix();if(VSi(e.matrix)===!1)r.matrix=e.matrix.elements}if(e.name!=="")r.name=String(e.name);if(this.serializeUserData(e,r),e.isMesh||e.isLine||e.isPoints){let s=this.processMesh(e);if(s!==null)r.mesh=s}else if(e.isCamera)r.camera=this.processCamera(e);if(e.isSkinnedMesh)this.skins.push(e);if(e.children.length>0){let s=[];for(let a=0,c=e.children.length;a<c;a++){let l=e.children[a];if(l.visible||n.onlyVisible===!1){let h=this.processNode(l);if(h!==null)s.push(h)}}if(s.length>0)r.children=s}this._invokeAll(function(s){s.writeNode&&s.writeNode(e,r)});let i=t.nodes.push(r)-1;return o.set(e,i),i}processScene(e){let t=this.json,n=this.options;if(!t.scenes)t.scenes=[],t.scene=0;let o={};if(e.name!=="")o.name=e.name;t.scenes.push(o);let r=[];for(let i=0,s=e.children.length;i<s;i++){let a=e.children[i];if(a.visible||n.onlyVisible===!1){let c=this.processNode(a);if(c!==null)r.push(c)}}if(r.length>0)o.nodes=r;this.serializeUserData(e,o)}processObjects(e){let t=new C4;t.name="AuxScene";for(let n=0;n<e.length;n++)t.children.push(e[n]);this.processScene(t)}processInput(e){let t=this.options;e=e instanceof Array?e:[e],this._invokeAll(function(o){o.beforeParse&&o.beforeParse(e)});let n=[];for(let o=0;o<e.length;o++)if(e[o]instanceof C4)this.processScene(e[o]);else n.push(e[o]);if(n.length>0)this.processObjects(n);for(let o=0;o<this.skins.length;++o)this.processSkin(this.skins[o]);for(let o=0;o<t.animations.length;++o)this.processAnimation(t.animations[o],e[0]);this._invokeAll(function(o){o.afterParse&&o.afterParse(e)})}_invokeAll(e){for(let t=0,n=this.plugins.length;t<n;t++)e(this.plugins[t])}}class UVn{constructor(e){this.writer=e,this.name="KHR_lights_punctual"}writeNode(e,t){if(!e.isLight)return;if(!e.isDirectionalLight&&!e.isPointLight&&!e.isSpotLight){console.warn("THREE.GLTFExporter: Only directional, point, and spot lights are supported.",e);return}let n=this.writer,{json:o,extensionsUsed:r}=n,i={};if(e.name)i.name=e.name;if(i.color=e.color.toArray(),i.intensity=e.intensity,e.isDirectionalLight)i.type="directional";else if(e.isPointLight){if(i.type="point",e.distance>0)i.range=e.distance}else if(e.isSpotLight){if(i.type="spot",e.distance>0)i.range=e.distance;i.spot={},i.spot.innerConeAngle=(e.penumbra-1)*e.angle*-1,i.spot.outerConeAngle=e.angle}if(e.decay!==void 0&&e.decay!==2)console.warn("THREE.GLTFExporter: Light decay may be lost. glTF is physically-based, and expects light.decay=2.");if(e.target&&(e.target.parent!==e||e.target.position.x!==0||e.target.position.y!==0||e.target.position.z!==-1))console.warn("THREE.GLTFExporter: Light direction may be lost. For best results, make light.target a child of the light with position 0,0,-1.");if(!r[this.name])o.extensions=o.extensions||{},o.extensions[this.name]={lights:[]},r[this.name]=!0;let s=o.extensions[this.name].lights;s.push(i),t.extensions=t.extensions||{},t.extensions[this.name]={light:s.length-1}}}class WVn{constructor(e){this.writer=e,this.name="KHR_materials_unlit"}writeMaterial(e,t){if(!e.isMeshBasicMaterial)return;let o=this.writer.extensionsUsed;t.extensions=t.extensions||{},t.extensions[this.name]={},o[this.name]=!0,t.pbrMetallicRoughness.metallicFactor=0,t.pbrMetallicRoughness.roughnessFactor=0.9}}class XVn{constructor(e){this.writer=e,this.name="KHR_materials_clearcoat"}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||e.clearcoat===0)return;let n=this.writer,o=n.extensionsUsed,r={};if(r.clearcoatFactor=e.clearcoat,e.clearcoatMap){let i={index:n.processTexture(e.clearcoatMap),texCoord:e.clearcoatMap.channel};n.applyTextureTransform(i,e.clearcoatMap),r.clearcoatTexture=i}if(r.clearcoatRoughnessFactor=e.clearcoatRoughness,e.clearcoatRoughnessMap){let i={index:n.processTexture(e.clearcoatRoughnessMap),texCoord:e.clearcoatRoughnessMap.channel};n.applyTextureTransform(i,e.clearcoatRoughnessMap),r.clearcoatRoughnessTexture=i}if(e.clearcoatNormalMap){let i={index:n.processTexture(e.clearcoatNormalMap),texCoord:e.clearcoatNormalMap.channel};n.applyTextureTransform(i,e.clearcoatNormalMap),r.clearcoatNormalTexture=i}t.extensions=t.extensions||{},t.extensions[this.name]=r,o[this.name]=!0}}class jVn{constructor(e){this.writer=e,this.name="KHR_materials_iridescence"}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||e.iridescence===0)return;let n=this.writer,o=n.extensionsUsed,r={};if(r.iridescenceFactor=e.iridescence,e.iridescenceMap){let i={index:n.processTexture(e.iridescenceMap),texCoord:e.iridescenceMap.channel};n.applyTextureTransform(i,e.iridescenceMap),r.iridescenceTexture=i}if(r.iridescenceIor=e.iridescenceIOR,r.iridescenceThicknessMinimum=e.iridescenceThicknessRange[0],r.iridescenceThicknessMaximum=e.iridescenceThicknessRange[1],e.iridescenceThicknessMap){let i={index:n.processTexture(e.iridescenceThicknessMap),texCoord:e.iridescenceThicknessMap.channel};n.applyTextureTransform(i,e.iridescenceThicknessMap),r.iridescenceThicknessTexture=i}t.extensions=t.extensions||{},t.extensions[this.name]=r,o[this.name]=!0}}class KVn{constructor(e){this.writer=e,this.name="KHR_materials_transmission"}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||e.transmission===0)return;let n=this.writer,o=n.extensionsUsed,r={};if(r.transmissionFactor=e.transmission,e.transmissionMap){let i={index:n.processTexture(e.transmissionMap),texCoord:e.transmissionMap.channel};n.applyTextureTransform(i,e.transmissionMap),r.transmissionTexture=i}t.extensions=t.extensions||{},t.extensions[this.name]=r,o[this.name]=!0}}class $Vn{constructor(e){this.writer=e,this.name="KHR_materials_volume"}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||e.transmission===0)return;let n=this.writer,o=n.extensionsUsed,r={};if(r.thicknessFactor=e.thickness,e.thicknessMap){let i={index:n.processTexture(e.thicknessMap),texCoord:e.thicknessMap.channel};n.applyTextureTransform(i,e.thicknessMap),r.thicknessTexture=i}r.attenuationDistance=e.attenuationDistance,r.attenuationColor=e.attenuationColor.toArray(),t.extensions=t.extensions||{},t.extensions[this.name]=r,o[this.name]=!0}}class qVn{constructor(e){this.writer=e,this.name="KHR_materials_ior"}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||e.ior===1.5)return;let o=this.writer.extensionsUsed,r={};r.ior=e.ior,t.extensions=t.extensions||{},t.extensions[this.name]=r,o[this.name]=!0}}class JVn{constructor(e){this.writer=e,this.name="KHR_materials_specular"}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||e.specularIntensity===1&&e.specularColor.equals(kSi)&&!e.specularIntensityMap&&!e.specularColorTexture)return;let n=this.writer,o=n.extensionsUsed,r={};if(e.specularIntensityMap){let i={index:n.processTexture(e.specularIntensityMap),texCoord:e.specularIntensityMap.channel};n.applyTextureTransform(i,e.specularIntensityMap),r.specularTexture=i}if(e.specularColorMap){let i={index:n.processTexture(e.specularColorMap),texCoord:e.specularColorMap.channel};n.applyTextureTransform(i,e.specularColorMap),r.specularColorTexture=i}r.specularFactor=e.specularIntensity,r.specularColorFactor=e.specularColor.toArray(),t.extensions=t.extensions||{},t.extensions[this.name]=r,o[this.name]=!0}}class ZVn{constructor(e){this.writer=e,this.name="KHR_materials_sheen"}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||e.sheen==0)return;let n=this.writer,o=n.extensionsUsed,r={};if(e.sheenRoughnessMap){let i={index:n.processTexture(e.sheenRoughnessMap),texCoord:e.sheenRoughnessMap.channel};n.applyTextureTransform(i,e.sheenRoughnessMap),r.sheenRoughnessTexture=i}if(e.sheenColorMap){let i={index:n.processTexture(e.sheenColorMap),texCoord:e.sheenColorMap.channel};n.applyTextureTransform(i,e.sheenColorMap),r.sheenColorTexture=i}r.sheenRoughnessFactor=e.sheenRoughness,r.sheenColorFactor=e.sheenColor.toArray(),t.extensions=t.extensions||{},t.extensions[this.name]=r,o[this.name]=!0}}class eYn{constructor(e){this.writer=e,this.name="KHR_materials_anisotropy"}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||e.anisotropy==0)return;let n=this.writer,o=n.extensionsUsed,r={};if(e.anisotropyMap){let i={index:n.processTexture(e.anisotropyMap)};n.applyTextureTransform(i,e.anisotropyMap),r.anisotropyTexture=i}r.anisotropyStrength=e.anisotropy,r.anisotropyRotation=e.anisotropyRotation,t.extensions=t.extensions||{},t.extensions[this.name]=r,o[this.name]=!0}}class tYn{constructor(e){this.writer=e,this.name="KHR_materials_emissive_strength"}writeMaterial(e,t){if(!e.isMeshStandardMaterial||e.emissiveIntensity===1)return;let o=this.writer.extensionsUsed,r={};r.emissiveStrength=e.emissiveIntensity,t.extensions=t.extensions||{},t.extensions[this.name]=r,o[this.name]=!0}}function Ght(){let e=new C4,t=new qm;t.deleteAttribute("uv");let n=new Ls({side:Fie}),o=new Ls,r=new Wie(16777215,5,28,2);r.position.set(0.418,16.199,0.3),e.add(r);let i=new Qo(t,n);i.position.set(-0.757,13.219,0.717),i.scale.set(31.713,28.305,28.591),e.add(i);let s=new Qo(t,o);s.position.set(-10.906,2.009,1.846),s.rotation.set(0,-0.195,0),s.scale.set(2.328,7.905,4.651),e.add(s);let a=new Qo(t,o);a.position.set(-5.607,-0.754,-0.758),a.rotation.set(0,0.994,0),a.scale.set(1.97,1.534,3.955),e.add(a);let c=new Qo(t,o);c.position.set(6.167,0.857,7.803),c.rotation.set(0,0.561,0),c.scale.set(3.927,6.285,3.687),e.add(c);let l=new Qo(t,o);l.position.set(-2.017,0.018,6.124),l.rotation.set(0,0.333,0),l.scale.set(2.002,4.566,2.064),e.add(l);let h=new Qo(t,o);h.position.set(2.291,-0.756,-2.621),h.rotation.set(0,-0.286,0),h.scale.set(1.546,1.552,1.496),e.add(h);let d=new Qo(t,o);d.position.set(-2.193,-0.369,-5.547),d.rotation.set(0,0.516,0),d.scale.set(3.875,3.487,2.986),e.add(d);let u=new Qo(t,f(50));u.position.set(-16.116,14.37,8.208),u.scale.set(0.1,2.428,2.739),e.add(u);let _=new Qo(t,f(50));_.position.set(-16.109,18.021,-8.207),_.scale.set(0.1,2.425,2.751),e.add(_);let p=new Qo(t,f(17));p.position.set(14.904,12.198,-1.832),p.scale.set(0.15,4.265,6.331),e.add(p);let m=new Qo(t,f(43));m.position.set(-0.462,8.89,14.52),m.scale.set(4.38,5.441,0.088),e.add(m);let A=new Qo(t,f(20));A.position.set(3.235,11.486,-12.541),A.scale.set(2.5,2,0.1),e.add(A);let g=new Qo(t,f(100));g.position.set(0,20,0),g.scale.set(1,0.1,1),e.add(g);function f(y){let x=new lA;return x.color.setScalar(y),x}return e}function lG(e){if(typeof TextDecoder<"u")return new TextDecoder().decode(e);let t="";for(let n=0,o=e.length;n<o;n++)t+=String.fromCharCode(e[n]);try{return decodeURIComponent(escape(t))}catch(n){return t}}class mPe extends S2{constructor(e){super(e)}load(e,t,n,o){let r=this,i=new GC(this.manager);i.setPath(this.path),i.setResponseType("arraybuffer"),i.setRequestHeader(this.requestHeader),i.setWithCredentials(this.withCredentials),i.load(e,function(s){try{t(r.parse(s))}catch(a){if(o)o(a);else console.error(a);r.manager.itemError(e)}},n,o)}parse(e){function t(c){let l=new DataView(c),h=50;if(84+l.getUint32(80,!0)*50===l.byteLength)return!0;let _=[115,111,108,105,100];for(let p=0;p<5;p++)if(n(_,l,p))return!1;return!0}function n(c,l,h){for(let d=0,u=c.length;d<u;d++)if(c[d]!==l.getUint8(h+d,!1))return!1;return!0}function o(c){let l=new DataView(c),h=l.getUint32(80,!0),d,u,_,p=!1,m,A,g,f,y;for(let P=0;P<70;P++)if(l.getUint32(P,!1)==1129270351&&l.getUint8(P+4)==82&&l.getUint8(P+5)==61)p=!0,m=new Float32Array(h*3*3),A=l.getUint8(P+6)/255,g=l.getUint8(P+7)/255,f=l.getUint8(P+8)/255,y=l.getUint8(P+9)/255;let x=84,C=50,b=new ha,I=new Float32Array(h*3*3),v=new Float32Array(h*3*3);for(let P=0;P<h;P++){let M=x+P*C,B=l.getFloat32(M,!0),T=l.getFloat32(M+4,!0),N=l.getFloat32(M+8,!0);if(p){let D=l.getUint16(M+48,!0);if((D&32768)===0)d=(D&31)/31,u=(D>>5&31)/31,_=(D>>10&31)/31;else d=A,u=g,_=f}for(let D=1;D<=3;D++){let L=M+D*12,H=P*3*3+(D-1)*3;if(I[H]=l.getFloat32(L,!0),I[H+1]=l.getFloat32(L+4,!0),I[H+2]=l.getFloat32(L+8,!0),v[H]=B,v[H+1]=T,v[H+2]=N,p)m[H]=d,m[H+1]=u,m[H+2]=_}}if(b.setAttribute("position",new ol(I,3)),b.setAttribute("normal",new ol(v,3)),p)b.setAttribute("color",new ol(m,3)),b.hasColors=!0,b.alpha=y;return b}function r(c){let l=new ha,h=/solid([\s\S]*?)endsolid/g,d=/facet([\s\S]*?)endfacet/g,u=0,_=/[\s]+([+-]?(?:\d*)(?:\.\d*)?(?:[eE][+-]?\d+)?)/.source,p=new RegExp("vertex"+_+_+_,"g"),m=new RegExp("normal"+_+_+_,"g"),A=[],g=[],f=new Dt,y,x=0,C=0,b=0;while((y=h.exec(c))!==null){C=b;let I=y[0];while((y=d.exec(I))!==null){let M=0,B=0,T=y[0];while((y=m.exec(T))!==null)f.x=parseFloat(y[1]),f.y=parseFloat(y[2]),f.z=parseFloat(y[3]),B++;while((y=p.exec(T))!==null)A.push(parseFloat(y[1]),parseFloat(y[2]),parseFloat(y[3])),g.push(f.x,f.y,f.z),M++,b++;if(B!==1)console.error("THREE.STLLoader: Something isn't right with the normal of face number "+u);if(M!==3)console.error("THREE.STLLoader: Something isn't right with the vertices of face number "+u);u++}let v=C,P=b-C;l.addGroup(v,P,x),x++}return l.setAttribute("position",new jr(A,3)),l.setAttribute("normal",new jr(g,3)),l}function i(c){if(typeof c!=="string")return lG(new Uint8Array(c));return c}function s(c){if(typeof c==="string"){let l=new Uint8Array(c.length);for(let h=0;h<c.length;h++)l[h]=c.charCodeAt(h)&255;return l.buffer||l}else return c}let a=s(e);return t(a)?o(a):r(i(e))}}class _Pe extends S2{constructor(e){super(e)}load(e,t,n,o){let r=this,i=this.path===""?YI.extractUrlBase(e):this.path,s=new GC(this.manager);s.setPath(this.path),s.setRequestHeader(this.requestHeader),s.setWithCredentials(this.withCredentials),s.load(e,function(a){try{t(r.parse(a,i))}catch(c){if(o)o(c);else console.error(c);r.manager.itemError(e)}},n,o)}setMaterialOptions(e){return this.materialOptions=e,this}parse(e,t){let n=e.split(`
`),o={},r=/\s+/,i={};for(let a=0;a<n.length;a++){let c=n[a];if(c=c.trim(),c.length===0||c.charAt(0)==="#")continue;let l=c.indexOf(" "),h=l>=0?c.substring(0,l):c;h=h.toLowerCase();let d=l>=0?c.substring(l+1):"";if(d=d.trim(),h==="newmtl")o={name:d},i[d]=o;else if(h==="ka"||h==="kd"||h==="ks"||h==="ke"){let u=d.split(r,3);o[h]=[parseFloat(u[0]),parseFloat(u[1]),parseFloat(u[2])]}else o[h]=d}let s=new nYn(this.resourcePath||t,this.materialOptions);return s.setCrossOrigin(this.crossOrigin),s.setManager(this.manager),s.setMaterials(i),s}}class nYn{constructor(e="",t={}){this.baseUrl=e,this.options=t,this.materialsInfo={},this.materials={},this.materialsArray=[],this.nameLookup={},this.crossOrigin="anonymous",this.side=this.options.side!==void 0?this.options.side:h7,this.wrap=this.options.wrap!==void 0?this.options.wrap:x4}setCrossOrigin(e){return this.crossOrigin=e,this}setManager(e){this.manager=e}setMaterials(e){this.materialsInfo=this.convert(e),this.materials={},this.materialsArray=[],this.nameLookup={}}convert(e){if(!this.options)return e;let t={};for(let n in e){let o=e[n],r={};t[n]=r;for(let i in o){let s=!0,a=o[i],c=i.toLowerCase();switch(c){case"kd":case"ka":case"ks":if(this.options&&this.options.normalizeRGB)a=[a[0]/255,a[1]/255,a[2]/255];if(this.options&&this.options.ignoreZeroRGBs){if(a[0]===0&&a[1]===0&&a[2]===0)s=!1}break}if(s)r[c]=a}}return t}preload(){for(let e in this.materialsInfo)this.create(e)}getIndex(e){return this.nameLookup[e]}getAsArray(){let e=0;for(let t in this.materialsInfo)this.materialsArray[e]=this.create(t),this.nameLookup[t]=e,e++;return this.materialsArray}create(e){if(this.materials[e]===void 0)this.createMaterial_(e);return this.materials[e]}createMaterial_(e){let t=this,n=this.materialsInfo[e],o={name:e,side:this.side};function r(s,a){if(typeof a!=="string"||a==="")return"";if(/^https?:\/\//i.test(a))return a;return s+a}function i(s,a){if(o[s])return;let c=t.getTextureParams(a,o),l=t.loadTexture(r(t.baseUrl,c.url));l.repeat.copy(c.scale),l.offset.copy(c.offset),l.wrapS=t.wrap,l.wrapT=t.wrap,o[s]=l}for(let s in n){let a=n[s],c;if(a==="")continue;switch(s.toLowerCase()){case"kd":o.color=new Do().fromArray(a);break;case"ks":o.specular=new Do().fromArray(a);break;case"ke":o.emissive=new Do().fromArray(a);break;case"map_kd":i("map",a);break;case"map_ks":i("specularMap",a);break;case"map_ke":i("emissiveMap",a);break;case"norm":i("normalMap",a);break;case"map_bump":case"bump":i("bumpMap",a);break;case"map_d":i("alphaMap",a),o.transparent=!0;break;case"ns":o.shininess=parseFloat(a);break;case"d":if(c=parseFloat(a),c<1)o.opacity=c,o.transparent=!0;break;case"tr":if(c=parseFloat(a),this.options&&this.options.invertTrProperty)c=1-c;if(c>0)o.opacity=1-c,o.transparent=!0;break}}return this.materials[e]=new Pz(o),this.materials[e]}getTextureParams(e,t){let n={scale:new go(1,1),offset:new go(0,0)},o=e.split(/\s+/),r;if(r=o.indexOf("-bm"),r>=0)t.bumpScale=parseFloat(o[r+1]),o.splice(r,2);if(r=o.indexOf("-s"),r>=0)n.scale.set(parseFloat(o[r+1]),parseFloat(o[r+2])),o.splice(r,4);if(r=o.indexOf("-o"),r>=0)n.offset.set(parseFloat(o[r+1]),parseFloat(o[r+2])),o.splice(r,4);return n.url=o.join(" ").trim(),n}loadTexture(e,t,n,o,r){let i=this.manager!==void 0?this.manager:BOe,s=i.getHandler(e);if(s===null)s=new Bz(i);if(s.setCrossOrigin)s.setCrossOrigin(this.crossOrigin);let a=s.load(e,n,o,r);if(t!==void 0)a.mapping=t;return a}}var pP={};jW(pP,{CstParser:()=>Uht,Lexer:()=>H0e,createToken:()=>Dp});var{CstParser:Uht,Lexer:H0e,createToken:Dp}=(()=>{var e=typeof global=="object"&&global&&global.Object===Object&&global;let t=e;var n=typeof self=="object"&&self&&self.Object===Object&&self,o=t||n||Function("return this")();let r=o;var i=r.Symbol;let s=i;var a=Object.prototype,{hasOwnProperty:c,toString:l}=a,h=s?s.toStringTag:void 0;function d(G){var le=c.call(G,h),fe=G[h];try{G[h]=void 0;var ze=!0}catch(yt){}var et=l.call(G);if(ze)if(le)G[h]=fe;else delete G[h];return et}var u=Object.prototype,_=u.toString;function p(G){return _.call(G)}var m="[object Null]",A="[object Undefined]",g=s?s.toStringTag:void 0;function f(G){if(G==null)return G===void 0?A:m;return g&&g in Object(G)?d(G):p(G)}function y(G){return G!=null&&typeof G=="object"}var x="[object Symbol]";function C(G){return typeof G=="symbol"||y(G)&&f(G)==x}function b(G,le){var fe=-1,ze=G==null?0:G.length,et=Array(ze);while(++fe<ze)et[fe]=le(G[fe],fe,G);return et}var I=Array.isArray;let v=I;var P=1/0,M=s?s.prototype:void 0,B=M?M.toString:void 0;function T(G){if(typeof G=="string")return G;if(v(G))return b(G,T)+"";if(C(G))return B?B.call(G):"";var le=G+"";return le=="0"&&1/G==-P?"-0":le}var N=/\s/;function D(G){var le=G.length;while(le--&&N.test(G.charAt(le)));return le}var L=/^\s+/;function H(G){return G?G.slice(0,D(G)+1).replace(L,""):G}function V(G){var le=typeof G;return G!=null&&(le=="object"||le=="function")}var O=NaN,U=/^[-+]0x[0-9a-f]+$/i,j=/^0b[01]+$/i,Y=/^0o[0-7]+$/i,X=parseInt;function K(G){if(typeof G=="number")return G;if(C(G))return O;if(V(G)){var le=typeof G.valueOf=="function"?G.valueOf():G;G=V(le)?le+"":le}if(typeof G!="string")return G===0?G:+G;G=H(G);var fe=j.test(G);return fe||Y.test(G)?X(G.slice(2),fe?2:8):U.test(G)?O:+G}var J=1/0,ee=179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000;function se(G){if(!G)return G===0?G:0;if(G=K(G),G===J||G===-J){var le=G<0?-1:1;return le*ee}return G===G?G:0}function ne(G){var le=se(G),fe=le%1;return le===le?fe?le-fe:le:0}function re(G){return G}var Z="[object AsyncFunction]",te="[object Function]",ie="[object GeneratorFunction]",ce="[object Proxy]";function ue(G){if(!V(G))return!1;var le=f(G);return le==te||le==ie||le==Z||le==ce}var de=r["__core-js_shared__"];let me=de;var ge=function(){var G=/[^.]+$/.exec(me&&me.keys&&me.keys.IE_PROTO||"");return G?"Symbol(src)_1."+G:""}();function xe(G){return!!ge&&ge in G}var Ee=Function.prototype,Re=Ee.toString;function Me(G){if(G!=null){try{return Re.call(G)}catch(le){}try{return G+""}catch(le){}}return""}var _e=/[\\^$.*+?()[\]{}|]/g,ye=/^\[object .+?Constructor\]$/,Se=Function.prototype,Ne=Object.prototype,Le=Se.toString,nt=Ne.hasOwnProperty,dt=RegExp("^"+Le.call(nt).replace(_e,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function rt(G){if(!V(G)||xe(G))return!1;var le=ue(G)?dt:ye;return le.test(Me(G))}function pt(G,le){return G==null?void 0:G[le]}function ct(G,le){var fe=pt(G,le);return rt(fe)?fe:void 0}var Ct=ct(r,"WeakMap");let kt=Ct;var Lt=Object.create,Bt=function(){function G(){}return function(le){if(!V(le))return{};if(Lt)return Lt(le);G.prototype=le;var fe=new G;return G.prototype=void 0,fe}}();let xt=Bt;function Yt(G,le,fe){switch(fe.length){case 0:return G.call(le);case 1:return G.call(le,fe[0]);case 2:return G.call(le,fe[0],fe[1]);case 3:return G.call(le,fe[0],fe[1],fe[2])}return G.apply(le,fe)}function ut(){}function Ze(G,le){var fe=-1,ze=G.length;le||(le=Array(ze));while(++fe<ze)le[fe]=G[fe];return le}var Fe=800,tt=16,Je=Date.now;function $e(G){var le=0,fe=0;return function(){var ze=Je(),et=tt-(ze-fe);if(fe=ze,et>0){if(++le>=Fe)return arguments[0]}else le=0;return G.apply(void 0,arguments)}}function ft(G){return function(){return G}}var vt=function(){try{var G=ct(Object,"defineProperty");return G({},"",{}),G}catch(le){}}();let Ye=vt;var je=!Ye?re:function(G,le){return Ye(G,"toString",{configurable:!0,enumerable:!1,value:ft(le),writable:!0})},St=$e(je);let Nt=St;function Ot(G,le){var fe=-1,ze=G==null?0:G.length;while(++fe<ze)if(le(G[fe],fe,G)===!1)break;return G}function Ut(G,le,fe,ze){var et=G.length,yt=fe+(ze?1:-1);while(ze?yt--:++yt<et)if(le(G[yt],yt,G))return yt;return-1}function mn(G){return G!==G}function _n(G,le,fe){var ze=fe-1,et=G.length;while(++ze<et)if(G[ze]===le)return ze;return-1}function En(G,le,fe){return le===le?_n(G,le,fe):Ut(G,mn,fe)}function Qn(G,le){var fe=G==null?0:G.length;return!!fe&&En(G,le,0)>-1}var ln=9007199254740991,hn=/^(?:0|[1-9]\d*)$/;function Zn(G,le){var fe=typeof G;return le=le==null?ln:le,!!le&&(fe=="number"||fe!="symbol"&&hn.test(G))&&G>-1&&G%1==0&&G<le}function bo(G,le,fe){if(le=="__proto__"&&Ye)Ye(G,le,{configurable:!0,enumerable:!0,value:fe,writable:!0});else G[le]=fe}function ir(G,le){return G===le||G!==G&&le!==le}var gt=Object.prototype,Oe=gt.hasOwnProperty;function mt(G,le,fe){var ze=G[le];if(!(Oe.call(G,le)&&ir(ze,fe))||fe===void 0&&!(le in G))bo(G,le,fe)}function It(G,le,fe,ze){var et=!fe;fe||(fe={});var yt=-1,Mt=le.length;while(++yt<Mt){var Rt=le[yt],Wt=ze?ze(fe[Rt],G[Rt],Rt,fe,G):void 0;if(Wt===void 0)Wt=G[Rt];if(et)bo(fe,Rt,Wt);else mt(fe,Rt,Wt)}return fe}var bt=Math.max;function cn(G,le,fe){return le=bt(le===void 0?G.length-1:le,0),function(){var ze=arguments,et=-1,yt=bt(ze.length-le,0),Mt=Array(yt);while(++et<yt)Mt[et]=ze[le+et];et=-1;var Rt=Array(le+1);while(++et<le)Rt[et]=ze[et];return Rt[le]=fe(Mt),Yt(G,this,Rt)}}function dn(G,le){return Nt(cn(G,le,re),G+"")}var wn=9007199254740991;function eo(G){return typeof G=="number"&&G>-1&&G%1==0&&G<=wn}function _o(G){return G!=null&&eo(G.length)&&!ue(G)}function $n(G,le,fe){if(!V(fe))return!1;var ze=typeof le;if(ze=="number"?_o(fe)&&Zn(le,fe.length):ze=="string"&&(le in fe))return ir(fe[le],G);return!1}function qn(G){return dn(function(le,fe){var ze=-1,et=fe.length,yt=et>1?fe[et-1]:void 0,Mt=et>2?fe[2]:void 0;if(yt=G.length>3&&typeof yt=="function"?(et--,yt):void 0,Mt&&$n(fe[0],fe[1],Mt))yt=et<3?void 0:yt,et=1;le=Object(le);while(++ze<et){var Rt=fe[ze];if(Rt)G(le,Rt,ze,yt)}return le})}var Po=Object.prototype;function To(G){var le=G&&G.constructor,fe=typeof le=="function"&&le.prototype||Po;return G===fe}function Tn(G,le){var fe=-1,ze=Array(G);while(++fe<G)ze[fe]=le(fe);return ze}var lo="[object Arguments]";function fo(G){return y(G)&&f(G)==lo}var oo=Object.prototype,{hasOwnProperty:Ro,propertyIsEnumerable:or}=oo,Er=fo(function(){return arguments}())?fo:function(G){return y(G)&&Ro.call(G,"callee")&&!or.call(G,"callee")};let Xi=Er;function Ys(){return!1}var aa=typeof pP=="object"&&pP&&!pP.nodeType&&pP,Lo=aa&&typeof Vb=="object"&&Vb&&!Vb.nodeType&&Vb,Gi=Lo&&Lo.exports===aa,bi=Gi?r.Buffer:void 0,os=bi?bi.isBuffer:void 0,Lc=os||Ys;let dl=Lc;var Ec="[object Arguments]",_d="[object Array]",B0="[object Boolean]",Jo="[object Date]",zr="[object Error]",$r="[object Function]",Sl="[object Map]",ul="[object Number]",gd="[object Object]",i1="[object RegExp]",Fp="[object Set]",ca="[object String]",n0="[object WeakMap]",zp="[object ArrayBuffer]",Yd="[object DataView]",vu="[object Float32Array]",ji="[object Float64Array]",pl="[object Int8Array]",Zs="[object Int16Array]",Cc="[object Int32Array]",ea="[object Uint8Array]",Zr="[object Uint8ClampedArray]",Ya="[object Uint16Array]",sh="[object Uint32Array]",vs={};vs[vu]=vs[ji]=vs[pl]=vs[Zs]=vs[Cc]=vs[ea]=vs[Zr]=vs[Ya]=vs[sh]=!0,vs[Ec]=vs[_d]=vs[zp]=vs[B0]=vs[Yd]=vs[Jo]=vs[zr]=vs[$r]=vs[Sl]=vs[ul]=vs[gd]=vs[i1]=vs[Fp]=vs[ca]=vs[n0]=!1;function Ad(G){return y(G)&&eo(G.length)&&!!vs[f(G)]}function ah(G){return function(le){return G(le)}}var fd=typeof pP=="object"&&pP&&!pP.nodeType&&pP,Rg=fd&&typeof Vb=="object"&&Vb&&!Vb.nodeType&&Vb,Su=Rg&&Rg.exports===fd,s1=Su&&t.process,KA=function(){try{var G=Rg&&Rg.require&&Rg.require("util").types;if(G)return G;return s1&&s1.binding&&s1.binding("util")}catch(le){}}();let T0=KA;var Q_=T0&&T0.isTypedArray,Gd=Q_?ah(Q_):Ad;let Dm=Gd;var Ph=Object.prototype,Yy=Ph.hasOwnProperty;function Nm(G,le){var fe=v(G),ze=!fe&&Xi(G),et=!fe&&!ze&&dl(G),yt=!fe&&!ze&&!et&&Dm(G),Mt=fe||ze||et||yt,Rt=Mt?Tn(G.length,String):[],Wt=Rt.length;for(var Rn in G)if((le||Yy.call(G,Rn))&&!(Mt&&(Rn=="length"||et&&(Rn=="offset"||Rn=="parent")||yt&&(Rn=="buffer"||Rn=="byteLength"||Rn=="byteOffset")||Zn(Rn,Wt))))Rt.push(Rn);return Rt}function $f(G,le){return function(fe){return G(le(fe))}}var a1=$f(Object.keys,Object);let u6=a1;var o0=Object.prototype,p6=o0.hasOwnProperty;function c1(G){if(!To(G))return u6(G);var le=[];for(var fe in Object(G))if(p6.call(G,fe)&&fe!="constructor")le.push(fe);return le}function yd(G){return _o(G)?Nm(G):c1(G)}var Rs=Object.prototype,So=Rs.hasOwnProperty,Gh=qn(function(G,le){if(To(le)||_o(le)){It(le,yd(le),G);return}for(var fe in le)if(So.call(le,fe))mt(G,fe,le[fe])});let Hc=Gh;function ua(G){var le=[];if(G!=null)for(var fe in Object(G))le.push(fe);return le}var Qg=Object.prototype,L3=Qg.hasOwnProperty;function vT(G){if(!V(G))return ua(G);var le=To(G),fe=[];for(var ze in G)if(!(ze=="constructor"&&(le||!L3.call(G,ze))))fe.push(ze);return fe}function H3(G){return _o(G)?Nm(G,!0):vT(G)}var nH=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,M5=/^\w*$/;function w5(G,le){if(v(G))return!1;var fe=typeof G;if(fe=="number"||fe=="symbol"||fe=="boolean"||G==null||C(G))return!0;return M5.test(G)||!nH.test(G)||le!=null&&G in Object(le)}var xv=ct(Object,"create");let Pu=xv;function Mc(){this.__data__=Pu?Pu(null):{},this.size=0}function Cv(G){var le=this.has(G)&&delete this.__data__[G];return this.size-=le?1:0,le}var k_="__lodash_hash_undefined__",l1=Object.prototype,Op=l1.hasOwnProperty;function D0(G){var le=this.__data__;if(Pu){var fe=le[G];return fe===k_?void 0:fe}return Op.call(le,G)?le[G]:void 0}var Vp=Object.prototype,Yp=Vp.hasOwnProperty;function bv(G){var le=this.__data__;return Pu?le[G]!==void 0:Yp.call(le,G)}var Rm="__lodash_hash_undefined__";function JP(G,le){var fe=this.__data__;return this.size+=this.has(G)?0:1,fe[G]=Pu&&le===void 0?Rm:le,this}function r0(G){var le=-1,fe=G==null?0:G.length;this.clear();while(++le<fe){var ze=G[le];this.set(ze[0],ze[1])}}r0.prototype.clear=Mc,r0.prototype.delete=Cv,r0.prototype.get=D0,r0.prototype.has=bv,r0.prototype.set=JP;function $A(){this.__data__=[],this.size=0}function ap(G,le){var fe=G.length;while(fe--)if(ir(G[fe][0],le))return fe;return-1}var m6=Array.prototype,Ol=m6.splice;function qA(G){var le=this.__data__,fe=ap(le,G);if(fe<0)return!1;var ze=le.length-1;if(fe==ze)le.pop();else Ol.call(le,fe,1);return--this.size,!0}function F3(G){var le=this.__data__,fe=ap(le,G);return fe<0?void 0:le[fe][1]}function h1(G){return ap(this.__data__,G)>-1}function d1(G,le){var fe=this.__data__,ze=ap(fe,G);if(ze<0)++this.size,fe.push([G,le]);else fe[ze][1]=le;return this}function Eu(G){var le=-1,fe=G==null?0:G.length;this.clear();while(++le<fe){var ze=G[le];this.set(ze[0],ze[1])}}Eu.prototype.clear=$A,Eu.prototype.delete=qA,Eu.prototype.get=F3,Eu.prototype.has=h1,Eu.prototype.set=d1;var ZP=ct(r,"Map");let B5=ZP;function eE(){this.size=0,this.__data__={hash:new r0,map:new(B5||Eu),string:new r0}}function T5(G){var le=typeof G;return le=="string"||le=="number"||le=="symbol"||le=="boolean"?G!=="__proto__":G===null}function qe(G,le){var fe=G.__data__;return T5(le)?fe[typeof le=="string"?"string":"hash"]:fe.map}function at(G){var le=qe(this,G).delete(G);return this.size-=le?1:0,le}function Tt(G){return qe(this,G).get(G)}function Jt(G){return qe(this,G).has(G)}function yn(G,le){var fe=qe(this,G),ze=fe.size;return fe.set(G,le),this.size+=fe.size==ze?0:1,this}function Pn(G){var le=-1,fe=G==null?0:G.length;this.clear();while(++le<fe){var ze=G[le];this.set(ze[0],ze[1])}}Pn.prototype.clear=eE,Pn.prototype.delete=at,Pn.prototype.get=Tt,Pn.prototype.has=Jt,Pn.prototype.set=yn;var Nn="Expected a function";function ao(G,le){if(typeof G!="function"||le!=null&&typeof le!="function")throw TypeError(Nn);var fe=function(){var ze=arguments,et=le?le.apply(this,ze):ze[0],yt=fe.cache;if(yt.has(et))return yt.get(et);var Mt=G.apply(this,ze);return fe.cache=yt.set(et,Mt)||yt,Mt};return fe.cache=new(ao.Cache||Pn),fe}ao.Cache=Pn;var wo=500;function $o(G){var le=ao(G,function(ze){if(fe.size===wo)fe.clear();return ze}),fe=le.cache;return le}var Mr=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Gs=/\\(\\)?/g,pa=$o(function(G){var le=[];if(G.charCodeAt(0)===46)le.push("");return G.replace(Mr,function(fe,ze,et,yt){le.push(et?yt.replace(Gs,"$1"):ze||fe)}),le});let Qs=pa;function Us(G){return G==null?"":T(G)}function sc(G,le){if(v(G))return G;return w5(G,le)?[G]:Qs(Us(G))}var cp=1/0;function Xt(G){if(typeof G=="string"||C(G))return G;var le=G+"";return le=="0"&&1/G==-cp?"-0":le}function bn(G,le){le=sc(le,G);var fe=0,ze=le.length;while(G!=null&&fe<ze)G=G[Xt(le[fe++])];return fe&&fe==ze?G:void 0}function to(G,le,fe){var ze=G==null?void 0:bn(G,le);return ze===void 0?fe:ze}function yo(G,le){var fe=-1,ze=le.length,et=G.length;while(++fe<ze)G[et+fe]=le[fe];return G}var ci=s?s.isConcatSpreadable:void 0;function Ws(G){return v(G)||Xi(G)||!!(ci&&G&&G[ci])}function rs(G,le,fe,ze,et){var yt=-1,Mt=G.length;fe||(fe=Ws),et||(et=[]);while(++yt<Mt){var Rt=G[yt];if(le>0&&fe(Rt))if(le>1)rs(Rt,le-1,fe,ze,et);else yo(et,Rt);else if(!ze)et[et.length]=Rt}return et}function ma(G){var le=G==null?0:G.length;return le?rs(G,1):[]}var ch=$f(Object.getPrototypeOf,Object);let L_=ch;function H_(G,le,fe){var ze=-1,et=G.length;if(le<0)le=-le>et?0:et+le;if(fe=fe>et?et:fe,fe<0)fe+=et;et=le>fe?0:fe-le>>>0,le>>>=0;var yt=Array(et);while(++ze<et)yt[ze]=G[ze+le];return yt}function ml(G,le,fe,ze){var et=-1,yt=G==null?0:G.length;if(ze&&yt)fe=G[++et];while(++et<yt)fe=le(fe,G[et],et,G);return fe}function tE(){this.__data__=new Eu,this.size=0}function D5(G){var le=this.__data__,fe=le.delete(G);return this.size=le.size,fe}function N5(G){return this.__data__.get(G)}function oH(G){return this.__data__.has(G)}var nE=200;function kg(G,le){var fe=this.__data__;if(fe instanceof Eu){var ze=fe.__data__;if(!B5||ze.length<nE-1)return ze.push([G,le]),this.size=++fe.size,this;fe=this.__data__=new Pn(ze)}return fe.set(G,le),this.size=fe.size,this}function JA(G){var le=this.__data__=new Eu(G);this.size=le.size}JA.prototype.clear=tE,JA.prototype.delete=D5,JA.prototype.get=N5,JA.prototype.has=oH,JA.prototype.set=kg;function Iv(G,le){return G&&It(le,yd(le),G)}function vv(G,le){return G&&It(le,H3(le),G)}var z3=typeof pP=="object"&&pP&&!pP.nodeType&&pP,oE=z3&&typeof Vb=="object"&&Vb&&!Vb.nodeType&&Vb,R5=oE&&oE.exports===z3,Sv=R5?r.Buffer:void 0,O3=Sv?Sv.allocUnsafe:void 0;function Q5(G,le){if(le)return G.slice();var fe=G.length,ze=O3?O3(fe):new G.constructor(fe);return G.copy(ze),ze}function qf(G,le){var fe=-1,ze=G==null?0:G.length,et=0,yt=[];while(++fe<ze){var Mt=G[fe];if(le(Mt,fe,G))yt[et++]=Mt}return yt}function Mu(){return[]}var Pv=Object.prototype,Gy=Pv.propertyIsEnumerable,k5=Object.getOwnPropertySymbols,Uy=!k5?Mu:function(G){if(G==null)return[];return G=Object(G),qf(k5(G),function(le){return Gy.call(G,le)})};let Kc=Uy;function _6(G,le){return It(G,Kc(G),le)}var rH=Object.getOwnPropertySymbols,Wy=!rH?Mu:function(G){var le=[];while(G)yo(le,Kc(G)),G=L_(G);return le};let L5=Wy;function Jf(G,le){return It(G,L5(G),le)}function u1(G,le,fe){var ze=le(G);return v(G)?ze:yo(ze,fe(G))}function Ev(G){return u1(G,yd,Kc)}function ZA(G){return u1(G,H3,L5)}var iH=ct(r,"DataView");let Zf=iH;var rE=ct(r,"Promise");let ef=rE;var g6=ct(r,"Set");let N0=g6;var Qm="[object Map]",e2="[object Object]",tf="[object Promise]",p1="[object Set]",Vl="[object WeakMap]",iE="[object DataView]",ST=Me(Zf),sH=Me(B5),m1=Me(ef),aH=Me(N0),nf=Me(kt),of=f;if(Zf&&of(new Zf(new ArrayBuffer(1)))!=iE||B5&&of(new B5)!=Qm||ef&&of(ef.resolve())!=tf||N0&&of(new N0)!=p1||kt&&of(new kt)!=Vl)of=function(G){var le=f(G),fe=le==e2?G.constructor:void 0,ze=fe?Me(fe):"";if(ze)switch(ze){case ST:return iE;case sH:return Qm;case m1:return tf;case aH:return p1;case nf:return Vl}return le};let A6=of;var cH=Object.prototype,vU=cH.hasOwnProperty;function sE(G){var le=G.length,fe=new G.constructor(le);if(le&&typeof G[0]=="string"&&vU.call(G,"index"))fe.index=G.index,fe.input=G.input;return fe}var Mv=r.Uint8Array;let f6=Mv;function aE(G){var le=new G.constructor(G.byteLength);return new f6(le).set(new f6(G)),le}function PT(G,le){var fe=le?aE(G.buffer):G.buffer;return new G.constructor(fe,G.byteOffset,G.byteLength)}var cE=/\w*$/;function Xy(G){var le=new G.constructor(G.source,cE.exec(G));return le.lastIndex=G.lastIndex,le}var ET=s?s.prototype:void 0,MT=ET?ET.valueOf:void 0;function wT(G){return MT?Object(MT.call(G)):{}}function km(G,le){var fe=le?aE(G.buffer):G.buffer;return new G.constructor(fe,G.byteOffset,G.length)}var _1="[object Boolean]",wv="[object Date]",BT="[object Map]",jy="[object Number]",Lg="[object RegExp]",lE="[object Set]",TT="[object String]",hE="[object Symbol]",lH="[object ArrayBuffer]",Bv="[object DataView]",DT="[object Float32Array]",hH="[object Float64Array]",Tv="[object Int8Array]",y6="[object Int16Array]",Fc="[object Int32Array]",V3="[object Uint8Array]",dE="[object Uint8ClampedArray]",uE="[object Uint16Array]",Hg="[object Uint32Array]";function Dv(G,le,fe){var ze=G.constructor;switch(le){case lH:return aE(G);case _1:case wv:return new ze(+G);case Bv:return PT(G,fe);case DT:case hH:case Tv:case y6:case Fc:case V3:case dE:case uE:case Hg:return km(G,fe);case BT:return new ze;case jy:case TT:return new ze(G);case Lg:return Xy(G);case lE:return new ze;case hE:return wT(G)}}function NT(G){return typeof G.constructor=="function"&&!To(G)?xt(L_(G)):{}}var pE="[object Map]";function x6(G){return y(G)&&A6(G)==pE}var RT=T0&&T0.isMap,mE=RT?ah(RT):x6;let QT=mE;var Y3="[object Set]";function dH(G){return y(G)&&A6(G)==Y3}var kT=T0&&T0.isSet,G3=kT?ah(kT):dH;let Gp=G3;var Fg=1,LT=2,HT=4,Xs="[object Arguments]",Eo="[object Array]",C6="[object Boolean]",Nv="[object Date]",Uh="[object Error]",b6="[object Function]",uH="[object GeneratorFunction]",pH="[object Map]",FT="[object Number]",SU="[object Object]",zT="[object RegExp]",OT="[object Set]",rf="[object String]",Up="[object Symbol]",zc="[object WeakMap]",VT="[object ArrayBuffer]",I6="[object DataView]",Ud="[object Float32Array]",U3="[object Float64Array]",Wh="[object Int8Array]",YT="[object Int16Array]",zg="[object Int32Array]",GT="[object Uint8Array]",g1="[object Uint8ClampedArray]",UT="[object Uint16Array]",t2="[object Uint32Array]",_l={};_l[Xs]=_l[Eo]=_l[VT]=_l[I6]=_l[C6]=_l[Nv]=_l[Ud]=_l[U3]=_l[Wh]=_l[YT]=_l[zg]=_l[pH]=_l[FT]=_l[SU]=_l[zT]=_l[OT]=_l[rf]=_l[Up]=_l[GT]=_l[g1]=_l[UT]=_l[t2]=!0,_l[Uh]=_l[b6]=_l[zc]=!1;function v6(G,le,fe,ze,et,yt){var Mt,Rt=le&Fg,Wt=le&LT,Rn=le&HT;if(fe)Mt=et?fe(G,ze,et,yt):fe(G);if(Mt!==void 0)return Mt;if(!V(G))return G;var no=v(G);if(no){if(Mt=sE(G),!Rt)return Ze(G,Mt)}else{var xo=A6(G),qo=xo==b6||xo==uH;if(dl(G))return Q5(G,Rt);if(xo==SU||xo==Xs||qo&&!et){if(Mt=Wt||qo?{}:NT(G),!Rt)return Wt?Jf(G,vv(Mt,G)):_6(G,Iv(Mt,G))}else{if(!_l[xo])return et?G:{};Mt=Dv(G,xo,Rt)}}yt||(yt=new JA);var Br=yt.get(G);if(Br)return Br;if(yt.set(G,Mt),Gp(G))G.forEach(function(kr){Mt.add(v6(kr,le,fe,kr,G,yt))});else if(QT(G))G.forEach(function(kr,Cr){Mt.set(Cr,v6(kr,le,fe,Cr,G,yt))});var Hi=Rn?Wt?ZA:Ev:Wt?H3:yd,ri=no?void 0:Hi(G);return Ot(ri||G,function(kr,Cr){if(ri)Cr=kr,kr=G[Cr];mt(Mt,Cr,v6(kr,le,fe,Cr,G,yt))}),Mt}var A1=4;function R0(G){return v6(G,A1)}function f1(G){var le=-1,fe=G==null?0:G.length,ze=0,et=[];while(++le<fe){var yt=G[le];if(yt)et[ze++]=yt}return et}var WT="__lodash_hash_undefined__";function S6(G){return this.__data__.set(G,WT),this}function H5(G){return this.__data__.has(G)}function W3(G){var le=-1,fe=G==null?0:G.length;this.__data__=new Pn;while(++le<fe)this.add(G[le])}W3.prototype.add=W3.prototype.push=S6,W3.prototype.has=H5;function XT(G,le){var fe=-1,ze=G==null?0:G.length;while(++fe<ze)if(le(G[fe],fe,G))return!0;return!1}function X3(G,le){return G.has(le)}var PU=1,_E=2;function jT(G,le,fe,ze,et,yt){var Mt=fe&PU,Rt=G.length,Wt=le.length;if(Rt!=Wt&&!(Mt&&Wt>Rt))return!1;var Rn=yt.get(G),no=yt.get(le);if(Rn&&no)return Rn==le&&no==G;var xo=-1,qo=!0,Br=fe&_E?new W3:void 0;yt.set(G,le),yt.set(le,G);while(++xo<Rt){var Hi=G[xo],ri=le[xo];if(ze)var kr=Mt?ze(ri,Hi,xo,le,G,yt):ze(Hi,ri,xo,G,le,yt);if(kr!==void 0){if(kr)continue;qo=!1;break}if(Br){if(!XT(le,function(Cr,Io){if(!X3(Br,Io)&&(Hi===Cr||et(Hi,Cr,fe,ze,yt)))return Br.push(Io)})){qo=!1;break}}else if(!(Hi===ri||et(Hi,ri,fe,ze,yt))){qo=!1;break}}return yt.delete(G),yt.delete(le),qo}function mH(G){var le=-1,fe=Array(G.size);return G.forEach(function(ze,et){fe[++le]=[et,ze]}),fe}function P6(G){var le=-1,fe=Array(G.size);return G.forEach(function(ze){fe[++le]=ze}),fe}var KT=1,$T=2,E6="[object Boolean]",M6="[object Date]",EU="[object Error]",MU="[object Map]",Lm="[object Number]",w6="[object RegExp]",xd="[object Set]",j3="[object String]",F_="[object Symbol]",qT="[object ArrayBuffer]",K3="[object DataView]",B6=s?s.prototype:void 0,$3=B6?B6.valueOf:void 0;function q3(G,le,fe,ze,et,yt,Mt){switch(fe){case K3:if(G.byteLength!=le.byteLength||G.byteOffset!=le.byteOffset)return!1;G=G.buffer,le=le.buffer;case qT:if(G.byteLength!=le.byteLength||!yt(new f6(G),new f6(le)))return!1;return!0;case E6:case M6:case Lm:return ir(+G,+le);case EU:return G.name==le.name&&G.message==le.message;case w6:case j3:return G==le+"";case MU:var Rt=mH;case xd:var Wt=ze&KT;if(Rt||(Rt=P6),G.size!=le.size&&!Wt)return!1;var Rn=Mt.get(G);if(Rn)return Rn==le;ze|=$T,Mt.set(G,le);var no=jT(Rt(G),Rt(le),ze,et,yt,Mt);return Mt.delete(G),no;case F_:if($3)return $3.call(G)==$3.call(le)}return!1}var _H=1,JT=Object.prototype,gE=JT.hasOwnProperty;function ZT(G,le,fe,ze,et,yt){var Mt=fe&_H,Rt=Ev(G),Wt=Rt.length,Rn=Ev(le),no=Rn.length;if(Wt!=no&&!Mt)return!1;var xo=Wt;while(xo--){var qo=Rt[xo];if(!(Mt?qo in le:gE.call(le,qo)))return!1}var Br=yt.get(G),Hi=yt.get(le);if(Br&&Hi)return Br==le&&Hi==G;var ri=!0;yt.set(G,le),yt.set(le,G);var kr=Mt;while(++xo<Wt){qo=Rt[xo];var Cr=G[qo],Io=le[qo];if(ze)var No=Mt?ze(Io,Cr,qo,le,G,yt):ze(Cr,Io,qo,G,le,yt);if(!(No===void 0?Cr===Io||et(Cr,Io,fe,ze,yt):No)){ri=!1;break}kr||(kr=qo=="constructor")}if(ri&&!kr){var Ss=G.constructor,Ul=le.constructor;if(Ss!=Ul&&"constructor"in G&&"constructor"in le&&!(typeof Ss=="function"&&Ss instanceof Ss&&typeof Ul=="function"&&Ul instanceof Ul))ri=!1}return yt.delete(G),yt.delete(le),ri}var Rv=1,Qv="[object Arguments]",kv="[object Array]",Lv="[object Object]",wU=Object.prototype,eD=wU.hasOwnProperty;function tD(G,le,fe,ze,et,yt){var Mt=v(G),Rt=v(le),Wt=Mt?kv:A6(G),Rn=Rt?kv:A6(le);Wt=Wt==Qv?Lv:Wt,Rn=Rn==Qv?Lv:Rn;var no=Wt==Lv,xo=Rn==Lv,qo=Wt==Rn;if(qo&&dl(G)){if(!dl(le))return!1;Mt=!0,no=!1}if(qo&&!no)return yt||(yt=new JA),Mt||Dm(G)?jT(G,le,fe,ze,et,yt):q3(G,le,Wt,fe,ze,et,yt);if(!(fe&Rv)){var Br=no&&eD.call(G,"__wrapped__"),Hi=xo&&eD.call(le,"__wrapped__");if(Br||Hi){var ri=Br?G.value():G,kr=Hi?le.value():le;return yt||(yt=new JA),et(ri,kr,fe,ze,yt)}}if(!qo)return!1;return yt||(yt=new JA),ZT(G,le,fe,ze,et,yt)}function nD(G,le,fe,ze,et){if(G===le)return!0;if(G==null||le==null||!y(G)&&!y(le))return G!==G&&le!==le;return tD(G,le,fe,ze,nD,et)}var F5=1,AE=2;function oD(G,le,fe,ze){var et=fe.length,yt=et,Mt=!ze;if(G==null)return!yt;G=Object(G);while(et--){var Rt=fe[et];if(Mt&&Rt[2]?Rt[1]!==G[Rt[0]]:!(Rt[0]in G))return!1}while(++et<yt){Rt=fe[et];var Wt=Rt[0],Rn=G[Wt],no=Rt[1];if(Mt&&Rt[2]){if(Rn===void 0&&!(Wt in G))return!1}else{var xo=new JA;if(ze)var qo=ze(Rn,no,Wt,G,le,xo);if(!(qo===void 0?nD(no,Rn,F5|AE,ze,xo):qo))return!1}}return!0}function fE(G){return G===G&&!V(G)}function gH(G){var le=yd(G),fe=le.length;while(fe--){var ze=le[fe],et=G[ze];le[fe]=[ze,et,fE(et)]}return le}function yE(G,le){return function(fe){if(fe==null)return!1;return fe[G]===le&&(le!==void 0||(G in Object(fe)))}}function AH(G){var le=gH(G);if(le.length==1&&le[0][2])return yE(le[0][0],le[0][1]);return function(fe){return fe===G||oD(fe,G,le)}}function BU(G,le){return G!=null&&le in Object(G)}function z5(G,le,fe){le=sc(le,G);var ze=-1,et=le.length,yt=!1;while(++ze<et){var Mt=Xt(le[ze]);if(!(yt=G!=null&&fe(G,Mt)))break;G=G[Mt]}if(yt||++ze!=et)return yt;return et=G==null?0:G.length,!!et&&eo(et)&&Zn(Mt,et)&&(v(G)||Xi(G))}function J3(G,le){return G!=null&&z5(G,le,BU)}var rD=1,TU=2;function $c(G,le){if(w5(G)&&fE(le))return yE(Xt(G),le);return function(fe){var ze=to(fe,G);return ze===void 0&&ze===le?J3(fe,G):nD(le,ze,rD|TU)}}function iD(G){return function(le){return le==null?void 0:le[G]}}function xE(G){return function(le){return bn(le,G)}}function sD(G){return w5(G)?iD(Xt(G)):xE(G)}function sf(G){if(typeof G=="function")return G;if(G==null)return re;if(typeof G=="object")return v(G)?$c(G[0],G[1]):AH(G);return sD(G)}function DU(G,le,fe,ze){var et=-1,yt=G==null?0:G.length;while(++et<yt){var Mt=G[et];le(ze,Mt,fe(Mt),G)}return ze}function aD(G){return function(le,fe,ze){var et=-1,yt=Object(le),Mt=ze(le),Rt=Mt.length;while(Rt--){var Wt=Mt[G?Rt:++et];if(fe(yt[Wt],Wt,yt)===!1)break}return le}}var cD=aD();let lD=cD;function fH(G,le){return G&&lD(G,le,yd)}function Hv(G,le){return function(fe,ze){if(fe==null)return fe;if(!_o(fe))return G(fe,ze);var et=fe.length,yt=le?et:-1,Mt=Object(fe);while(le?yt--:++yt<et)if(ze(Mt[yt],yt,Mt)===!1)break;return fe}}var T6=Hv(fH);let Z3=T6;function eC(G,le,fe,ze){return Z3(G,function(et,yt,Mt){le(ze,et,fe(et),Mt)}),ze}function hD(G,le){return function(fe,ze){var et=v(fe)?DU:eC,yt=le?le():{};return et(fe,G,sf(ze),yt)}}var Fv=Object.prototype,yH=Fv.hasOwnProperty,CE=dn(function(G,le){G=Object(G);var fe=-1,ze=le.length,et=ze>2?le[2]:void 0;if(et&&$n(le[0],le[1],et))ze=1;while(++fe<ze){var yt=le[fe],Mt=H3(yt),Rt=-1,Wt=Mt.length;while(++Rt<Wt){var Rn=Mt[Rt],no=G[Rn];if(no===void 0||ir(no,Fv[Rn])&&!yH.call(G,Rn))G[Rn]=yt[Rn]}}return G});let bE=CE;function zv(G){return y(G)&&_o(G)}function Ky(G,le,fe){var ze=-1,et=G==null?0:G.length;while(++ze<et)if(fe(le,G[ze]))return!0;return!1}var i0=200;function dD(G,le,fe,ze){var et=-1,yt=Qn,Mt=!0,Rt=G.length,Wt=[],Rn=le.length;if(!Rt)return Wt;if(fe)le=b(le,ah(fe));if(ze)yt=Ky,Mt=!1;else if(le.length>=i0)yt=X3,Mt=!1,le=new W3(le);e:while(++et<Rt){var no=G[et],xo=fe==null?no:fe(no);if(no=ze||no!==0?no:0,Mt&&xo===xo){var qo=Rn;while(qo--)if(le[qo]===xo)continue e;Wt.push(no)}else if(!yt(le,xo,ze))Wt.push(no)}return Wt}var IE=dn(function(G,le){return zv(G)?dD(G,rs(le,1,zv,!0)):[]});let y1=IE;function O5(G){var le=G==null?0:G.length;return le?G[le-1]:void 0}function Cd(G,le,fe){var ze=G==null?0:G.length;if(!ze)return[];return le=fe||le===void 0?1:ne(le),H_(G,le<0?0:le,ze)}function Ov(G,le,fe){var ze=G==null?0:G.length;if(!ze)return[];return le=fe||le===void 0?1:ne(le),le=ze-le,H_(G,0,le<0?0:le)}function vE(G){return typeof G=="function"?G:re}function Li(G,le){var fe=v(G)?Ot:Z3;return fe(G,vE(le))}function NU(G,le){var fe=-1,ze=G==null?0:G.length;while(++fe<ze)if(!le(G[fe],fe,G))return!1;return!0}function D6(G,le){var fe=!0;return Z3(G,function(ze,et,yt){return fe=!!le(ze,et,yt),fe}),fe}function Og(G,le,fe){var ze=v(G)?NU:D6;if(fe&&$n(G,le,fe))le=void 0;return ze(G,sf(le))}function uD(G,le){var fe=[];return Z3(G,function(ze,et,yt){if(le(ze,et,yt))fe.push(ze)}),fe}function z_(G,le){var fe=v(G)?qf:uD;return fe(G,sf(le))}function RU(G){return function(le,fe,ze){var et=Object(le);if(!_o(le)){var yt=sf(fe);le=yd(le),fe=function(Rt){return yt(et[Rt],Rt,et)}}var Mt=G(le,fe,ze);return Mt>-1?et[yt?le[Mt]:Mt]:void 0}}var xH=Math.max;function _a(G,le,fe){var ze=G==null?0:G.length;if(!ze)return-1;var et=fe==null?0:ne(fe);if(et<0)et=xH(ze+et,0);return Ut(G,sf(le),et)}var Q0=RU(_a);let N6=Q0;function k0(G){return G&&G.length?G[0]:void 0}function $y(G,le){var fe=-1,ze=_o(G)?Array(G.length):[];return Z3(G,function(et,yt,Mt){ze[++fe]=le(et,yt,Mt)}),ze}function Or(G,le){var fe=v(G)?b:$y;return fe(G,sf(le))}function O_(G,le){return rs(Or(G,le),1)}var pD=Object.prototype,QU=pD.hasOwnProperty,Vv=hD(function(G,le,fe){if(QU.call(G,fe))G[fe].push(le);else bo(G,fe,[le])});let x1=Vv;var R6=Object.prototype,mD=R6.hasOwnProperty;function C1(G,le){return G!=null&&mD.call(G,le)}function Ai(G,le){return G!=null&&z5(G,le,C1)}var af="[object String]";function lp(G){return typeof G=="string"||!v(G)&&y(G)&&f(G)==af}function V5(G,le){return b(le,function(fe){return G[fe]})}function Wd(G){return G==null?[]:V5(G,yd(G))}var kU=Math.max;function wc(G,le,fe,ze){G=_o(G)?G:Wd(G),fe=fe&&!ze?ne(fe):0;var et=G.length;if(fe<0)fe=kU(et+fe,0);return lp(G)?fe<=et&&G.indexOf(le,fe)>-1:!!et&&En(G,le,fe)>-1}var kn=Math.max;function gl(G,le,fe){var ze=G==null?0:G.length;if(!ze)return-1;var et=fe==null?0:ne(fe);if(et<0)et=kn(ze+et,0);return En(G,le,et)}var Qne="[object Map]",LU="[object Set]",Q6=Object.prototype,qy=Q6.hasOwnProperty;function Yl(G){if(G==null)return!0;if(_o(G)&&(v(G)||typeof G=="string"||typeof G.splice=="function"||dl(G)||Dm(G)||Xi(G)))return!G.length;var le=A6(G);if(le==Qne||le==LU)return!G.size;if(To(G))return!c1(G).length;for(var fe in G)if(qy.call(G,fe))return!1;return!0}var CH="[object RegExp]";function SE(G){return y(G)&&f(G)==CH}var k6=T0&&T0.isRegExp,_D=k6?ah(k6):SE;let n2=_D;function cf(G){return G===void 0}var HU="Expected a function";function kne(G){if(typeof G!="function")throw TypeError(HU);return function(){var le=arguments;switch(le.length){case 0:return!G.call(this);case 1:return!G.call(this,le[0]);case 2:return!G.call(this,le[0],le[1]);case 3:return!G.call(this,le[0],le[1],le[2])}return!G.apply(this,le)}}function FU(G,le,fe,ze){if(!V(G))return G;le=sc(le,G);var et=-1,yt=le.length,Mt=yt-1,Rt=G;while(Rt!=null&&++et<yt){var Wt=Xt(le[et]),Rn=fe;if(Wt==="__proto__"||Wt==="constructor"||Wt==="prototype")return G;if(et!=Mt){var no=Rt[Wt];if(Rn=ze?ze(no,Wt,Rt):void 0,Rn===void 0)Rn=V(no)?no:Zn(le[et+1])?[]:{}}mt(Rt,Wt,Rn),Rt=Rt[Wt]}return G}function L6(G,le,fe){var ze=-1,et=le.length,yt={};while(++ze<et){var Mt=le[ze],Rt=bn(G,Mt);if(fe(Rt,Mt))FU(yt,sc(Mt,G),Rt)}return yt}function Pl(G,le){if(G==null)return{};var fe=b(ZA(G),function(ze){return[ze]});return le=sf(le),L6(G,fe,function(ze,et){return le(ze,et[0])})}function Bc(G,le,fe,ze,et){return et(G,function(yt,Mt,Rt){fe=ze?(ze=!1,yt):le(fe,yt,Mt,Rt)}),fe}function wu(G,le,fe){var ze=v(G)?ml:Bc,et=arguments.length<3;return ze(G,sf(le),fe,et,Z3)}function V_(G,le){var fe=v(G)?qf:uD;return fe(G,kne(sf(le)))}function gD(G,le){var fe;return Z3(G,function(ze,et,yt){return fe=le(ze,et,yt),!fe}),!!fe}function bH(G,le,fe){var ze=v(G)?XT:gD;if(fe&&$n(G,le,fe))le=void 0;return ze(G,sf(le))}var Xd=1/0,b1=!(N0&&1/P6(new N0([,-0]))[1]==Xd)?ut:function(G){return new N0(G)};let IH=b1;var vH=200;function SH(G,le,fe){var ze=-1,et=Qn,yt=G.length,Mt=!0,Rt=[],Wt=Rt;if(fe)Mt=!1,et=Ky;else if(yt>=vH){var Rn=le?null:IH(G);if(Rn)return P6(Rn);Mt=!1,et=X3,Wt=new W3}else Wt=le?[]:Rt;e:while(++ze<yt){var no=G[ze],xo=le?le(no):no;if(no=fe||no!==0?no:0,Mt&&xo===xo){var qo=Wt.length;while(qo--)if(Wt[qo]===xo)continue e;if(le)Wt.push(xo);Rt.push(no)}else if(!et(Wt,xo,fe)){if(Wt!==Rt)Wt.push(xo);Rt.push(no)}}return Rt}function AD(G){return G&&G.length?SH(G):[]}function Yv(G){if(console&&console.error)console.error(`Error: ${G}`)}function fD(G){if(console&&console.warn)console.warn(`Warning: ${G}`)}function Gv(G){let le=new Date().getTime(),fe=G();return{time:new Date().getTime()-le,value:fe}}function zU(G){function le(){}le.prototype=G;let fe=new le;function ze(){return typeof fe.bar}return ze(),ze(),G}function H6(G){if(tC(G))return G.LABEL;else return G.name}function tC(G){return lp(G.LABEL)&&G.LABEL!==""}class o2{get definition(){return this._definition}set definition(G){this._definition=G}constructor(G){this._definition=G}accept(G){G.visit(this),Li(this.definition,(le)=>{le.accept(G)})}}class L0 extends o2{constructor(G){super([]);this.idx=1,Hc(this,Pl(G,(le)=>le!==void 0))}set definition(G){}get definition(){if(this.referencedRule!==void 0)return this.referencedRule.definition;return[]}accept(G){G.visit(this)}}class nC extends o2{constructor(G){super(G.definition);this.orgText="",Hc(this,Pl(G,(le)=>le!==void 0))}}class Xh extends o2{constructor(G){super(G.definition);this.ignoreAmbiguities=!1,Hc(this,Pl(G,(le)=>le!==void 0))}}class bd extends o2{constructor(G){super(G.definition);this.idx=1,Hc(this,Pl(G,(le)=>le!==void 0))}}class lf extends o2{constructor(G){super(G.definition);this.idx=1,Hc(this,Pl(G,(le)=>le!==void 0))}}class hf extends o2{constructor(G){super(G.definition);this.idx=1,Hc(this,Pl(G,(le)=>le!==void 0))}}class jd extends o2{constructor(G){super(G.definition);this.idx=1,Hc(this,Pl(G,(le)=>le!==void 0))}}class Wp extends o2{constructor(G){super(G.definition);this.idx=1,Hc(this,Pl(G,(le)=>le!==void 0))}}class Vg extends o2{get definition(){return this._definition}set definition(G){this._definition=G}constructor(G){super(G.definition);this.idx=1,this.ignoreAmbiguities=!1,this.hasPredicates=!1,Hc(this,Pl(G,(le)=>le!==void 0))}}class Gl{constructor(G){this.idx=1,Hc(this,Pl(G,(le)=>le!==void 0))}accept(G){G.visit(this)}}function OU(G){return Or(G,Uv)}function Uv(G){function le(fe){return Or(fe,Uv)}if(G instanceof L0){let fe={type:"NonTerminal",name:G.nonTerminalName,idx:G.idx};if(lp(G.label))fe.label=G.label;return fe}else if(G instanceof Xh)return{type:"Alternative",definition:le(G.definition)};else if(G instanceof bd)return{type:"Option",idx:G.idx,definition:le(G.definition)};else if(G instanceof lf)return{type:"RepetitionMandatory",idx:G.idx,definition:le(G.definition)};else if(G instanceof hf)return{type:"RepetitionMandatoryWithSeparator",idx:G.idx,separator:Uv(new Gl({terminalType:G.separator})),definition:le(G.definition)};else if(G instanceof Wp)return{type:"RepetitionWithSeparator",idx:G.idx,separator:Uv(new Gl({terminalType:G.separator})),definition:le(G.definition)};else if(G instanceof jd)return{type:"Repetition",idx:G.idx,definition:le(G.definition)};else if(G instanceof Vg)return{type:"Alternation",idx:G.idx,definition:le(G.definition)};else if(G instanceof Gl){let fe={type:"Terminal",name:G.terminalType.name,label:H6(G.terminalType),idx:G.idx};if(lp(G.label))fe.terminalLabel=G.label;let ze=G.terminalType.PATTERN;if(G.terminalType.PATTERN)fe.pattern=n2(ze)?ze.source:ze;return fe}else if(G instanceof nC)return{type:"Rule",name:G.name,orgText:G.orgText,definition:le(G.definition)};else throw Error("non exhaustive match")}class oC{visit(G){let le=G;switch(le.constructor){case L0:return this.visitNonTerminal(le);case Xh:return this.visitAlternative(le);case bd:return this.visitOption(le);case lf:return this.visitRepetitionMandatory(le);case hf:return this.visitRepetitionMandatoryWithSeparator(le);case Wp:return this.visitRepetitionWithSeparator(le);case jd:return this.visitRepetition(le);case Vg:return this.visitAlternation(le);case Gl:return this.visitTerminal(le);case nC:return this.visitRule(le);default:throw Error("non exhaustive match")}}visitNonTerminal(G){}visitAlternative(G){}visitOption(G){}visitRepetition(G){}visitRepetitionMandatory(G){}visitRepetitionMandatoryWithSeparator(G){}visitRepetitionWithSeparator(G){}visitAlternation(G){}visitTerminal(G){}visitRule(G){}}function VU(G){return G instanceof Xh||G instanceof bd||G instanceof jd||G instanceof lf||G instanceof hf||G instanceof Wp||G instanceof Gl||G instanceof nC}function PE(G,le=[]){if(G instanceof bd||G instanceof jd||G instanceof Wp)return!0;if(G instanceof Vg)return bH(G.definition,(ze)=>PE(ze,le));else if(G instanceof L0&&wc(le,G))return!1;else if(G instanceof o2){if(G instanceof L0)le.push(G);return Og(G.definition,(ze)=>PE(ze,le))}else return!1}function YU(G){return G instanceof Vg}function Jy(G){if(G instanceof L0)return"SUBRULE";else if(G instanceof bd)return"OPTION";else if(G instanceof Vg)return"OR";else if(G instanceof lf)return"AT_LEAST_ONE";else if(G instanceof hf)return"AT_LEAST_ONE_SEP";else if(G instanceof Wp)return"MANY_SEP";else if(G instanceof jd)return"MANY";else if(G instanceof Gl)return"CONSUME";else throw Error("non exhaustive match")}class rC{walk(G,le=[]){Li(G.definition,(fe,ze)=>{let et=Cd(G.definition,ze+1);if(fe instanceof L0)this.walkProdRef(fe,et,le);else if(fe instanceof Gl)this.walkTerminal(fe,et,le);else if(fe instanceof Xh)this.walkFlat(fe,et,le);else if(fe instanceof bd)this.walkOption(fe,et,le);else if(fe instanceof lf)this.walkAtLeastOne(fe,et,le);else if(fe instanceof hf)this.walkAtLeastOneSep(fe,et,le);else if(fe instanceof Wp)this.walkManySep(fe,et,le);else if(fe instanceof jd)this.walkMany(fe,et,le);else if(fe instanceof Vg)this.walkOr(fe,et,le);else throw Error("non exhaustive match")})}walkTerminal(G,le,fe){}walkProdRef(G,le,fe){}walkFlat(G,le,fe){let ze=le.concat(fe);this.walk(G,ze)}walkOption(G,le,fe){let ze=le.concat(fe);this.walk(G,ze)}walkAtLeastOne(G,le,fe){let ze=[new bd({definition:G.definition})].concat(le,fe);this.walk(G,ze)}walkAtLeastOneSep(G,le,fe){let ze=PH(G,le,fe);this.walk(G,ze)}walkMany(G,le,fe){let ze=[new bd({definition:G.definition})].concat(le,fe);this.walk(G,ze)}walkManySep(G,le,fe){let ze=PH(G,le,fe);this.walk(G,ze)}walkOr(G,le,fe){let ze=le.concat(fe);Li(G.definition,(et)=>{let yt=new Xh({definition:[et]});this.walk(yt,ze)})}}function PH(G,le,fe){return[new bd({definition:[new Gl({terminalType:G.separator})].concat(G.definition)})].concat(le,fe)}function F6(G){if(G instanceof L0)return F6(G.referencedRule);else if(G instanceof Gl)return GU(G);else if(VU(G))return EH(G);else if(YU(G))return MH(G);else throw Error("non exhaustive match")}function EH(G){let le=[],fe=G.definition,ze=0,et=fe.length>ze,yt,Mt=!0;while(et&&Mt)yt=fe[ze],Mt=PE(yt),le=le.concat(F6(yt)),ze=ze+1,et=fe.length>ze;return AD(le)}function MH(G){let le=Or(G.definition,(fe)=>F6(fe));return AD(ma(le))}function GU(G){return[G.terminalType]}let r2="_~IN~_";class wH extends rC{constructor(G){super();this.topProd=G,this.follows={}}startWalking(){return this.walk(this.topProd),this.follows}walkTerminal(G,le,fe){}walkProdRef(G,le,fe){let ze=WU(G.referencedRule,G.idx)+this.topProd.name,et=le.concat(fe),yt=new Xh({definition:et}),Mt=F6(yt);this.follows[ze]=Mt}}function UU(G){let le={};return Li(G,(fe)=>{let ze=new wH(fe).startWalking();Hc(le,ze)}),le}function WU(G,le){return G.name+le+r2}function Ui(G){return G.charCodeAt(0)}function z6(G,le){if(Array.isArray(G))G.forEach(function(fe){le.push(fe)});else le.push(G)}function H0(G,le){if(G[le]===!0)throw"duplicate flag "+le;G[le],G[le]=!0}function iC(G){if(G===void 0)throw Error("Internal Error - Should never get here!");return!0}function Hm(){throw Error("Internal Error - Should never get here!")}function yD(G){return G.type==="Character"}let I1=[];for(let G=Ui("0");G<=Ui("9");G++)I1.push(G);let O6=[Ui("_")].concat(I1);for(let G=Ui("a");G<=Ui("z");G++)O6.push(G);for(let G=Ui("A");G<=Ui("Z");G++)O6.push(G);let i2=[Ui(" "),Ui("\f"),Ui(`
`),Ui("\r"),Ui("\t"),Ui("\v"),Ui("\t"),Ui(" "),Ui(" "),Ui(" "),Ui(" "),Ui(" "),Ui(" "),Ui(" "),Ui(" "),Ui(" "),Ui(" "),Ui(" "),Ui(" "),Ui(" "),Ui("\u2028"),Ui("\u2029"),Ui(" "),Ui(" "),Ui(" "),Ui("\uFEFF")],XU=/[0-9a-fA-F]/,v1=/[0-9]/,jU=/[1-9]/;class Y_{constructor(){this.idx=0,this.input="",this.groupIdx=0}saveState(){return{idx:this.idx,input:this.input,groupIdx:this.groupIdx}}restoreState(G){this.idx=G.idx,this.input=G.input,this.groupIdx=G.groupIdx}pattern(G){this.idx=0,this.input=G,this.groupIdx=0,this.consumeChar("/");let le=this.disjunction();this.consumeChar("/");let fe={type:"Flags",loc:{begin:this.idx,end:G.length},global:!1,ignoreCase:!1,multiLine:!1,unicode:!1,sticky:!1};while(this.isRegExpFlag())switch(this.popChar()){case"g":H0(fe,"global");break;case"i":H0(fe,"ignoreCase");break;case"m":H0(fe,"multiLine");break;case"u":H0(fe,"unicode");break;case"y":H0(fe,"sticky");break}if(this.idx!==this.input.length)throw Error("Redundant input: "+this.input.substring(this.idx));return{type:"Pattern",flags:fe,value:le,loc:this.loc(0)}}disjunction(){let G=[],le=this.idx;G.push(this.alternative());while(this.peekChar()==="|")this.consumeChar("|"),G.push(this.alternative());return{type:"Disjunction",value:G,loc:this.loc(le)}}alternative(){let G=[],le=this.idx;while(this.isTerm())G.push(this.term());return{type:"Alternative",value:G,loc:this.loc(le)}}term(){if(this.isAssertion())return this.assertion();else return this.atom()}assertion(){let G=this.idx;switch(this.popChar()){case"^":return{type:"StartAnchor",loc:this.loc(G)};case"$":return{type:"EndAnchor",loc:this.loc(G)};case"\\":switch(this.popChar()){case"b":return{type:"WordBoundary",loc:this.loc(G)};case"B":return{type:"NonWordBoundary",loc:this.loc(G)}}throw Error("Invalid Assertion Escape");case"(":this.consumeChar("?");let le;switch(this.popChar()){case"=":le="Lookahead";break;case"!":le="NegativeLookahead";break}iC(le);let fe=this.disjunction();return this.consumeChar(")"),{type:le,value:fe,loc:this.loc(G)}}return Hm()}quantifier(G=!1){let le=void 0,fe=this.idx;switch(this.popChar()){case"*":le={atLeast:0,atMost:1/0};break;case"+":le={atLeast:1,atMost:1/0};break;case"?":le={atLeast:0,atMost:1};break;case"{":let ze=this.integerIncludingZero();switch(this.popChar()){case"}":le={atLeast:ze,atMost:ze};break;case",":let et;if(this.isDigit())et=this.integerIncludingZero(),le={atLeast:ze,atMost:et};else le={atLeast:ze,atMost:1/0};this.consumeChar("}");break}if(G===!0&&le===void 0)return;iC(le);break}if(G===!0&&le===void 0)return;if(iC(le)){if(this.peekChar(0)==="?")this.consumeChar("?"),le.greedy=!1;else le.greedy=!0;return le.type="Quantifier",le.loc=this.loc(fe),le}}atom(){let G,le=this.idx;switch(this.peekChar()){case".":G=this.dotAll();break;case"\\":G=this.atomEscape();break;case"[":G=this.characterClass();break;case"(":G=this.group();break}if(G===void 0&&this.isPatternCharacter())G=this.patternCharacter();if(iC(G)){if(G.loc=this.loc(le),this.isQuantifier())G.quantifier=this.quantifier();return G}}dotAll(){return this.consumeChar("."),{type:"Set",complement:!0,value:[Ui(`
`),Ui("\r"),Ui("\u2028"),Ui("\u2029")]}}atomEscape(){switch(this.consumeChar("\\"),this.peekChar()){case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":return this.decimalEscapeAtom();case"d":case"D":case"s":case"S":case"w":case"W":return this.characterClassEscape();case"f":case"n":case"r":case"t":case"v":return this.controlEscapeAtom();case"c":return this.controlLetterEscapeAtom();case"0":return this.nulCharacterAtom();case"x":return this.hexEscapeSequenceAtom();case"u":return this.regExpUnicodeEscapeSequenceAtom();default:return this.identityEscapeAtom()}}decimalEscapeAtom(){return{type:"GroupBackReference",value:this.positiveInteger()}}characterClassEscape(){let G,le=!1;switch(this.popChar()){case"d":G=I1;break;case"D":G=I1,le=!0;break;case"s":G=i2;break;case"S":G=i2,le=!0;break;case"w":G=O6;break;case"W":G=O6,le=!0;break}if(iC(G))return{type:"Set",value:G,complement:le}}controlEscapeAtom(){let G;switch(this.popChar()){case"f":G=Ui("\f");break;case"n":G=Ui(`
`);break;case"r":G=Ui("\r");break;case"t":G=Ui("\t");break;case"v":G=Ui("\v");break}if(iC(G))return{type:"Character",value:G}}controlLetterEscapeAtom(){this.consumeChar("c");let G=this.popChar();if(/[a-zA-Z]/.test(G)===!1)throw Error("Invalid ");return{type:"Character",value:G.toUpperCase().charCodeAt(0)-64}}nulCharacterAtom(){return this.consumeChar("0"),{type:"Character",value:Ui("\x00")}}hexEscapeSequenceAtom(){return this.consumeChar("x"),this.parseHexDigits(2)}regExpUnicodeEscapeSequenceAtom(){return this.consumeChar("u"),this.parseHexDigits(4)}identityEscapeAtom(){let G=this.popChar();return{type:"Character",value:Ui(G)}}classPatternCharacterAtom(){switch(this.peekChar()){case`
`:case"\r":case"\u2028":case"\u2029":case"\\":case"]":throw Error("TBD");default:let G=this.popChar();return{type:"Character",value:Ui(G)}}}characterClass(){let G=[],le=!1;if(this.consumeChar("["),this.peekChar(0)==="^")this.consumeChar("^"),le=!0;while(this.isClassAtom()){let fe=this.classAtom();if(fe.type,yD(fe)&&this.isRangeDash()){this.consumeChar("-");let ze=this.classAtom();if(ze.type,yD(ze)){if(ze.value<fe.value)throw Error("Range out of order in character class");G.push({from:fe.value,to:ze.value})}else z6(fe.value,G),G.push(Ui("-")),z6(ze.value,G)}else z6(fe.value,G)}return this.consumeChar("]"),{type:"Set",complement:le,value:G}}classAtom(){switch(this.peekChar()){case"]":case`
`:case"\r":case"\u2028":case"\u2029":throw Error("TBD");case"\\":return this.classEscape();default:return this.classPatternCharacterAtom()}}classEscape(){switch(this.consumeChar("\\"),this.peekChar()){case"b":return this.consumeChar("b"),{type:"Character",value:Ui("\b")};case"d":case"D":case"s":case"S":case"w":case"W":return this.characterClassEscape();case"f":case"n":case"r":case"t":case"v":return this.controlEscapeAtom();case"c":return this.controlLetterEscapeAtom();case"0":return this.nulCharacterAtom();case"x":return this.hexEscapeSequenceAtom();case"u":return this.regExpUnicodeEscapeSequenceAtom();default:return this.identityEscapeAtom()}}group(){let G=!0;switch(this.consumeChar("("),this.peekChar(0)){case"?":this.consumeChar("?"),this.consumeChar(":"),G=!1;break;default:this.groupIdx++;break}let le=this.disjunction();this.consumeChar(")");let fe={type:"Group",capturing:G,value:le};if(G)fe.idx=this.groupIdx;return fe}positiveInteger(){let G=this.popChar();if(jU.test(G)===!1)throw Error("Expecting a positive integer");while(v1.test(this.peekChar(0)))G+=this.popChar();return parseInt(G,10)}integerIncludingZero(){let G=this.popChar();if(v1.test(G)===!1)throw Error("Expecting an integer");while(v1.test(this.peekChar(0)))G+=this.popChar();return parseInt(G,10)}patternCharacter(){let G=this.popChar();switch(G){case`
`:case"\r":case"\u2028":case"\u2029":case"^":case"$":case"\\":case".":case"*":case"+":case"?":case"(":case")":case"[":case"|":throw Error("TBD");default:return{type:"Character",value:Ui(G)}}}isRegExpFlag(){switch(this.peekChar(0)){case"g":case"i":case"m":case"u":case"y":return!0;default:return!1}}isRangeDash(){return this.peekChar()==="-"&&this.isClassAtom(1)}isDigit(){return v1.test(this.peekChar(0))}isClassAtom(G=0){switch(this.peekChar(G)){case"]":case`
`:case"\r":case"\u2028":case"\u2029":return!1;default:return!0}}isTerm(){return this.isAtom()||this.isAssertion()}isAtom(){if(this.isPatternCharacter())return!0;switch(this.peekChar(0)){case".":case"\\":case"[":case"(":return!0;default:return!1}}isAssertion(){switch(this.peekChar(0)){case"^":case"$":return!0;case"\\":switch(this.peekChar(1)){case"b":case"B":return!0;default:return!1}case"(":return this.peekChar(1)==="?"&&(this.peekChar(2)==="="||this.peekChar(2)==="!");default:return!1}}isQuantifier(){let G=this.saveState();try{return this.quantifier(!0)!==void 0}catch(le){return!1}finally{this.restoreState(G)}}isPatternCharacter(){switch(this.peekChar()){case"^":case"$":case"\\":case".":case"*":case"+":case"?":case"(":case")":case"[":case"|":case"/":case`
`:case"\r":case"\u2028":case"\u2029":return!1;default:return!0}}parseHexDigits(G){let le="";for(let ze=0;ze<G;ze++){let et=this.popChar();if(XU.test(et)===!1)throw Error("Expecting a HexDecimal digits");le+=et}return{type:"Character",value:parseInt(le,16)}}peekChar(G=0){return this.input[this.idx+G]}popChar(){let G=this.peekChar(0);return this.consumeChar(void 0),G}consumeChar(G){if(G!==void 0&&this.input[this.idx]!==G)throw Error("Expected: '"+G+"' but found: '"+this.input[this.idx]+"' at offset: "+this.idx);if(this.idx>=this.input.length)throw Error("Unexpected end of input");this.idx++}loc(G){return{begin:G,end:this.idx}}}class Wv{visitChildren(G){for(let le in G){let fe=G[le];if(G.hasOwnProperty(le)){if(fe.type!==void 0)this.visit(fe);else if(Array.isArray(fe))fe.forEach((ze)=>{this.visit(ze)},this)}}}visit(G){switch(G.type){case"Pattern":this.visitPattern(G);break;case"Flags":this.visitFlags(G);break;case"Disjunction":this.visitDisjunction(G);break;case"Alternative":this.visitAlternative(G);break;case"StartAnchor":this.visitStartAnchor(G);break;case"EndAnchor":this.visitEndAnchor(G);break;case"WordBoundary":this.visitWordBoundary(G);break;case"NonWordBoundary":this.visitNonWordBoundary(G);break;case"Lookahead":this.visitLookahead(G);break;case"NegativeLookahead":this.visitNegativeLookahead(G);break;case"Character":this.visitCharacter(G);break;case"Set":this.visitSet(G);break;case"Group":this.visitGroup(G);break;case"GroupBackReference":this.visitGroupBackReference(G);break;case"Quantifier":this.visitQuantifier(G);break}this.visitChildren(G)}visitPattern(G){}visitFlags(G){}visitDisjunction(G){}visitAlternative(G){}visitStartAnchor(G){}visitEndAnchor(G){}visitWordBoundary(G){}visitNonWordBoundary(G){}visitLookahead(G){}visitNegativeLookahead(G){}visitCharacter(G){}visitSet(G){}visitGroup(G){}visitGroupBackReference(G){}visitQuantifier(G){}}let Xv={},s2=new Y_;function EE(G){let le=G.toString();if(Xv.hasOwnProperty(le))return Xv[le];else{let fe=s2.pattern(le);return Xv[le]=fe,fe}}function jv(){Xv={}}let BH="Complement Sets are not supported for first char optimization",sC=`Unable to use "first char" lexer optimizations:
`;function V6(G,le=!1){try{let fe=EE(G);return xD(fe.value,{},fe.flags.ignoreCase)}catch(fe){if(fe.message===BH){if(le)fD(`${sC}	Unable to optimize: < ${G.toString()} >
	Complement Sets cannot be automatically optimized.
	This will disable the lexer's first char optimizations.
	See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#COMPLEMENT for details.`)}else{let ze="";if(le)ze=`
	This will disable the lexer's first char optimizations.
	See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#REGEXP_PARSING for details.`;Yv(`${sC}
	Failed parsing: < ${G.toString()} >
	Using the @chevrotain/regexp-to-ast library
	Please open an issue at: https://github.com/chevrotain/chevrotain/issues`+ze)}}return[]}function xD(G,le,fe){switch(G.type){case"Disjunction":for(let et=0;et<G.value.length;et++)xD(G.value[et],le,fe);break;case"Alternative":let ze=G.value;for(let et=0;et<ze.length;et++){let yt=ze[et];switch(yt.type){case"EndAnchor":case"GroupBackReference":case"Lookahead":case"NegativeLookahead":case"StartAnchor":case"WordBoundary":case"NonWordBoundary":continue}let Mt=yt;switch(Mt.type){case"Character":ME(Mt.value,le,fe);break;case"Set":if(Mt.complement===!0)throw Error(BH);Li(Mt.value,(Wt)=>{if(typeof Wt==="number")ME(Wt,le,fe);else{let Rn=Wt;if(fe===!0)for(let no=Rn.from;no<=Rn.to;no++)ME(no,le,fe);else{for(let no=Rn.from;no<=Rn.to&&no<TE;no++)ME(no,le,fe);if(Rn.to>=TE){let no=Rn.from>=TE?Rn.from:TE,xo=Rn.to,qo=P1(no),Br=P1(xo);for(let Hi=qo;Hi<=Br;Hi++)le[Hi]=Hi}}}});break;case"Group":xD(Mt.value,le,fe);break;default:throw Error("Non Exhaustive Match")}let Rt=Mt.quantifier!==void 0&&Mt.quantifier.atLeast===0;if(Mt.type==="Group"&&Kv(Mt)===!1||Mt.type!=="Group"&&Rt===!1)break}break;default:throw Error("non exhaustive match!")}return Wd(le)}function ME(G,le,fe){let ze=P1(G);if(le[ze]=ze,fe===!0)wE(G,le)}function wE(G,le){let fe=String.fromCharCode(G),ze=fe.toUpperCase();if(ze!==fe){let et=P1(ze.charCodeAt(0));le[et]=et}else{let et=fe.toLowerCase();if(et!==fe){let yt=P1(et.charCodeAt(0));le[yt]=yt}}}function CD(G,le){return N6(G.value,(fe)=>{if(typeof fe==="number")return wc(le,fe);else{let ze=fe;return N6(le,(et)=>ze.from<=et&&et<=ze.to)!==void 0}})}function Kv(G){let le=G.quantifier;if(le&&le.atLeast===0)return!0;if(!G.value)return!1;return v(G.value)?Og(G.value,Kv):Kv(G.value)}class TH extends Wv{constructor(G){super();this.targetCharCodes=G,this.found=!1}visitChildren(G){if(this.found===!0)return;switch(G.type){case"Lookahead":this.visitLookahead(G);return;case"NegativeLookahead":this.visitNegativeLookahead(G);return}super.visitChildren(G)}visitCharacter(G){if(wc(this.targetCharCodes,G.value))this.found=!0}visitSet(G){if(G.complement){if(CD(G,this.targetCharCodes)===void 0)this.found=!0}else if(CD(G,this.targetCharCodes)!==void 0)this.found=!0}}function bD(G,le){if(le instanceof RegExp){let fe=EE(le),ze=new TH(G);return ze.visit(fe),ze.found}else return N6(le,(fe)=>wc(G,fe.charCodeAt(0)))!==void 0}let Y6="PATTERN",G6="defaultMode",Xp="modes",ID=typeof new RegExp("(?:)").sticky==="boolean";function U6(G,le){le=bE(le,{useSticky:ID,debug:!1,safeMode:!1,positionTracking:"full",lineTerminatorCharacters:["\r",`
`],tracer:(Io,No)=>No()});let fe=le.tracer;fe("initCharCodeToOptimizedIndexMap",()=>{Jv()});let ze;fe("Reject Lexer.NA",()=>{ze=V_(G,(Io)=>Io[Y6]===G_.NA)});let et=!1,yt;fe("Transform Patterns",()=>{et=!1,yt=Or(ze,(Io)=>{let No=Io[Y6];if(n2(No)){let Ss=No.source;if(Ss.length===1&&Ss!=="^"&&Ss!=="$"&&Ss!=="."&&!No.ignoreCase)return Ss;else if(Ss.length===2&&Ss[0]==="\\"&&!wc(["d","D","s","S","t","r","n","t","0","c","b","B","f","v","w","W"],Ss[1]))return Ss[1];else return le.useSticky?QH(No):Bu(No)}else if(ue(No))return et=!0,{exec:No};else if(typeof No==="object")return et=!0,No;else if(typeof No==="string")if(No.length===1)return No;else{let Ss=No.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&"),Ul=new RegExp(Ss);return le.useSticky?QH(Ul):Bu(Ul)}else throw Error("non exhaustive match")})});let Mt,Rt,Wt,Rn,no;fe("misc mapping",()=>{Mt=Or(ze,(Io)=>Io.tokenTypeIdx),Rt=Or(ze,(Io)=>{let No=Io.GROUP;if(No===G_.SKIPPED)return;else if(lp(No))return No;else if(cf(No))return!1;else throw Error("non exhaustive match")}),Wt=Or(ze,(Io)=>{let No=Io.LONGER_ALT;if(No)return v(No)?Or(No,(Ul)=>gl(ze,Ul)):[gl(ze,No)]}),Rn=Or(ze,(Io)=>Io.PUSH_MODE),no=Or(ze,(Io)=>Ai(Io,"POP_MODE"))});let xo;fe("Line Terminator Handling",()=>{let Io=Fm(le.lineTerminatorCharacters);if(xo=Or(ze,(No)=>!1),le.positionTracking!=="onlyOffset")xo=Or(ze,(No)=>{if(Ai(No,"LINE_BREAKS"))return!!No.LINE_BREAKS;else return S1(No,Io)===!1&&bD(Io,No.PATTERN)})});let qo,Br,Hi,ri;fe("Misc Mapping #2",()=>{qo=Or(ze,X6),Br=Or(yt,cC),Hi=wu(ze,(Io,No)=>{let Ss=No.GROUP;if(lp(Ss)&&Ss!==G_.SKIPPED)Io[Ss]=[];return Io},{}),ri=Or(yt,(Io,No)=>({pattern:yt[No],longerAlt:Wt[No],canLineTerminator:xo[No],isCustom:qo[No],short:Br[No],group:Rt[No],push:Rn[No],pop:no[No],tokenTypeIdx:Mt[No],tokenType:ze[No]}))});let kr=!0,Cr=[];if(!le.safeMode)fe("First Char Optimization",()=>{Cr=wu(ze,(Io,No,Ss)=>{if(typeof No.PATTERN==="string"){let Ul=No.PATTERN.charCodeAt(0),dp=P1(Ul);HH(Io,dp,ri[Ss])}else if(v(No.START_CHARS_HINT)){let Ul;Li(No.START_CHARS_HINT,(dp)=>{let AC=typeof dp==="string"?dp.charCodeAt(0):dp,X_=P1(AC);if(Ul!==X_)Ul=X_,HH(Io,X_,ri[Ss])})}else if(n2(No.PATTERN))if(No.PATTERN.unicode){if(kr=!1,le.ensureOptimizations)Yv(`${sC}	Unable to analyze < ${No.PATTERN.toString()} > pattern.
	The regexp unicode flag is not currently supported by the regexp-to-ast library.
	This will disable the lexer's first char optimizations.
	For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNICODE_OPTIMIZE`)}else{let Ul=V6(No.PATTERN,le.ensureOptimizations);if(Yl(Ul))kr=!1;Li(Ul,(dp)=>{HH(Io,dp,ri[Ss])})}else{if(le.ensureOptimizations)Yv(`${sC}	TokenType: <${No.name}> is using a custom token pattern without providing <start_chars_hint> parameter.
	This will disable the lexer's first char optimizations.
	For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_OPTIMIZE`);kr=!1}return Io},[])});return{emptyGroups:Hi,patternIdxToConfig:ri,charCodeToPatternIdxToConfig:Cr,hasCustom:et,canBeOptimized:kr}}function Id(G,le){let fe=[],ze=a2(G);fe=fe.concat(ze.errors);let et=$U(ze.valid),yt=et.valid;return fe=fe.concat(et.errors),fe=fe.concat(KU(yt)),fe=fe.concat(qU(yt)),fe=fe.concat(JU(yt,le)),fe=fe.concat(SD(yt)),fe}function KU(G){let le=[],fe=z_(G,(ze)=>n2(ze[Y6]));return le=le.concat(W6(fe)),le=le.concat($v(fe)),le=le.concat(DH(fe)),le=le.concat(NH(fe)),le=le.concat(vD(fe)),le}function a2(G){let le=z_(G,(et)=>!Ai(et,Y6)),fe=Or(le,(et)=>({message:"Token Type: ->"+et.name+"<- missing static 'PATTERN' property",type:jh.MISSING_PATTERN,tokenTypes:[et]})),ze=y1(G,le);return{errors:fe,valid:ze}}function $U(G){let le=z_(G,(et)=>{let yt=et[Y6];return!n2(yt)&&!ue(yt)&&!Ai(yt,"exec")&&!lp(yt)}),fe=Or(le,(et)=>({message:"Token Type: ->"+et.name+"<- static 'PATTERN' can only be a RegExp, a Function matching the {CustomPatternMatcherFunc} type or an Object matching the {ICustomPattern} interface.",type:jh.INVALID_PATTERN,tokenTypes:[et]})),ze=y1(G,le);return{errors:fe,valid:ze}}let Zy=/[^\\][$]/;function W6(G){class le extends Wv{constructor(){super(...arguments);this.found=!1}visitEndAnchor(et){this.found=!0}}let fe=z_(G,(et)=>{let yt=et.PATTERN;try{let Mt=EE(yt),Rt=new le;return Rt.visit(Mt),Rt.found}catch(Mt){return Zy.test(yt.source)}});return Or(fe,(et)=>({message:`Unexpected RegExp Anchor Error:
	Token Type: ->`+et.name+`<- static 'PATTERN' cannot contain end of input anchor '$'
	See chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS	for details.`,type:jh.EOI_ANCHOR_FOUND,tokenTypes:[et]}))}function vD(G){let le=z_(G,(ze)=>ze.PATTERN.test(""));return Or(le,(ze)=>({message:"Token Type: ->"+ze.name+"<- static 'PATTERN' must not match an empty string",type:jh.EMPTY_MATCH_PATTERN,tokenTypes:[ze]}))}let aC=/[^\\[][\^]|^\^/;function $v(G){class le extends Wv{constructor(){super(...arguments);this.found=!1}visitStartAnchor(et){this.found=!0}}let fe=z_(G,(et)=>{let yt=et.PATTERN;try{let Mt=EE(yt),Rt=new le;return Rt.visit(Mt),Rt.found}catch(Mt){return aC.test(yt.source)}});return Or(fe,(et)=>({message:`Unexpected RegExp Anchor Error:
	Token Type: ->`+et.name+`<- static 'PATTERN' cannot contain start of input anchor '^'
	See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS	for details.`,type:jh.SOI_ANCHOR_FOUND,tokenTypes:[et]}))}function DH(G){let le=z_(G,(ze)=>{let et=ze[Y6];return et instanceof RegExp&&(et.multiline||et.global)});return Or(le,(ze)=>({message:"Token Type: ->"+ze.name+"<- static 'PATTERN' may NOT contain global('g') or multiline('m')",type:jh.UNSUPPORTED_FLAGS_FOUND,tokenTypes:[ze]}))}function NH(G){let le=[],fe=Or(G,(yt)=>wu(G,(Mt,Rt)=>{if(yt.PATTERN.source===Rt.PATTERN.source&&!wc(le,Rt)&&Rt.PATTERN!==G_.NA)return le.push(Rt),Mt.push(Rt),Mt;return Mt},[]));fe=f1(fe);let ze=z_(fe,(yt)=>yt.length>1);return Or(ze,(yt)=>{let Mt=Or(yt,(Wt)=>Wt.name);return{message:`The same RegExp pattern ->${k0(yt).PATTERN}<-has been used in all of the following Token Types: ${Mt.join(", ")} <-`,type:jh.DUPLICATE_PATTERNS_FOUND,tokenTypes:yt}})}function qU(G){let le=z_(G,(ze)=>{if(!Ai(ze,"GROUP"))return!1;let et=ze.GROUP;return et!==G_.SKIPPED&&et!==G_.NA&&!lp(et)});return Or(le,(ze)=>({message:"Token Type: ->"+ze.name+"<- static 'GROUP' can only be Lexer.SKIPPED/Lexer.NA/A String",type:jh.INVALID_GROUP_TYPE_FOUND,tokenTypes:[ze]}))}function JU(G,le){let fe=z_(G,(et)=>et.PUSH_MODE!==void 0&&!wc(le,et.PUSH_MODE));return Or(fe,(et)=>({message:`Token Type: ->${et.name}<- static 'PUSH_MODE' value cannot refer to a Lexer Mode ->${et.PUSH_MODE}<-which does not exist`,type:jh.PUSH_MODE_DOES_NOT_EXIST,tokenTypes:[et]}))}function SD(G){let le=[],fe=wu(G,(ze,et,yt)=>{let Mt=et.PATTERN;if(Mt===G_.NA)return ze;if(lp(Mt))ze.push({str:Mt,idx:yt,tokenType:et});else if(n2(Mt)&&RH(Mt))ze.push({str:Mt.source,idx:yt,tokenType:et});return ze},[]);return Li(G,(ze,et)=>{Li(fe,({str:yt,idx:Mt,tokenType:Rt})=>{if(et<Mt&&BE(yt,ze.PATTERN)){let Wt=`Token: ->${Rt.name}<- can never be matched.
Because it appears AFTER the Token Type ->${ze.name}<-in the lexer's definition.
See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNREACHABLE`;le.push({message:Wt,type:jh.UNREACHABLE_PATTERN,tokenTypes:[ze,Rt]})}})}),le}function BE(G,le){if(n2(le)){let fe=le.exec(G);return fe!==null&&fe.index===0}else if(ue(le))return le(G,0,[],{});else if(Ai(le,"exec"))return le.exec(G,0,[],{});else if(typeof le==="string")return le===G;else throw Error("non exhaustive match")}function RH(G){return N6([".","\\","[","]","|","^","$","(",")","?","*","+","{"],(fe)=>G.source.indexOf(fe)!==-1)===void 0}function Bu(G){let le=G.ignoreCase?"i":"";return new RegExp(`^(?:${G.source})`,le)}function QH(G){let le=G.ignoreCase?"iy":"y";return new RegExp(`${G.source}`,le)}function Lne(G,le,fe){let ze=[];if(!Ai(G,G6))ze.push({message:"A MultiMode Lexer cannot be initialized without a <"+G6+`> property in its definition
`,type:jh.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE});if(!Ai(G,Xp))ze.push({message:"A MultiMode Lexer cannot be initialized without a <"+Xp+`> property in its definition
`,type:jh.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY});if(Ai(G,Xp)&&Ai(G,G6)&&!Ai(G.modes,G.defaultMode))ze.push({message:`A MultiMode Lexer cannot be initialized with a ${G6}: <${G.defaultMode}>which does not exist
`,type:jh.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST});if(Ai(G,Xp))Li(G.modes,(et,yt)=>{Li(et,(Mt,Rt)=>{if(cf(Mt))ze.push({message:`A Lexer cannot be initialized using an undefined Token Type. Mode:<${yt}> at index: <${Rt}>
`,type:jh.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED});else if(Ai(Mt,"LONGER_ALT")){let Wt=v(Mt.LONGER_ALT)?Mt.LONGER_ALT:[Mt.LONGER_ALT];Li(Wt,(Rn)=>{if(!cf(Rn)&&!wc(et,Rn))ze.push({message:`A MultiMode Lexer cannot be initialized with a longer_alt <${Rn.name}> on token <${Mt.name}> outside of mode <${yt}>
`,type:jh.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE})})}})});return ze}function kH(G,le,fe){let ze=[],et=!1,yt=f1(ma(Wd(G.modes))),Mt=V_(yt,(Wt)=>Wt[Y6]===G_.NA),Rt=Fm(fe);if(le)Li(Mt,(Wt)=>{let Rn=S1(Wt,Rt);if(Rn!==!1){let xo={message:ex(Wt,Rn),type:Rn.issue,tokenType:Wt};ze.push(xo)}else if(Ai(Wt,"LINE_BREAKS")){if(Wt.LINE_BREAKS===!0)et=!0}else if(bD(Rt,Wt.PATTERN))et=!0});if(le&&!et)ze.push({message:`Warning: No LINE_BREAKS Found.
	This Lexer has been defined to track line and column information,
	But none of the Token Types can be identified as matching a line terminator.
	See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#LINE_BREAKS 
	for details.`,type:jh.NO_LINE_BREAKS_FLAGS});return ze}function LH(G){let le={},fe=yd(G);return Li(fe,(ze)=>{let et=G[ze];if(v(et))le[ze]=[];else throw Error("non exhaustive match")}),le}function X6(G){let le=G.PATTERN;if(n2(le))return!1;else if(ue(le))return!0;else if(Ai(le,"exec"))return!0;else if(lp(le))return!1;else throw Error("non exhaustive match")}function cC(G){if(lp(G)&&G.length===1)return G.charCodeAt(0);else return!1}let qv={test:function(G){let le=G.length;for(let fe=this.lastIndex;fe<le;fe++){let ze=G.charCodeAt(fe);if(ze===10)return this.lastIndex=fe+1,!0;else if(ze===13){if(G.charCodeAt(fe+1)===10)this.lastIndex=fe+2;else this.lastIndex=fe+1;return!0}}return!1},lastIndex:0};function S1(G,le){if(Ai(G,"LINE_BREAKS"))return!1;else if(n2(G.PATTERN)){try{bD(le,G.PATTERN)}catch(fe){return{issue:jh.IDENTIFY_TERMINATOR,errMsg:fe.message}}return!1}else if(lp(G.PATTERN))return!1;else if(X6(G))return{issue:jh.CUSTOM_LINE_BREAK};else throw Error("non exhaustive match")}function ex(G,le){if(le.issue===jh.IDENTIFY_TERMINATOR)return`Warning: unable to identify line terminator usage in pattern.
	The problem is in the <${G.name}> Token Type
	 Root cause: ${le.errMsg}.
	For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#IDENTIFY_TERMINATOR`;else if(le.issue===jh.CUSTOM_LINE_BREAK)return`Warning: A Custom Token Pattern should specify the <line_breaks> option.
	The problem is in the <${G.name}> Token Type
	For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_LINE_BREAK`;else throw Error("non exhaustive match")}function Fm(G){return Or(G,(fe)=>{if(lp(fe))return fe.charCodeAt(0);else return fe})}function HH(G,le,fe){if(G[le]===void 0)G[le]=[fe];else G[le].push(fe)}let TE=256,j6=[];function P1(G){return G<TE?G:j6[G]}function Jv(){if(Yl(j6)){j6=Array(65536);for(let G=0;G<65536;G++)j6[G]=G>255?255+~~(G/255):G}}function K6(G,le){let fe=G.tokenTypeIdx;if(fe===le.tokenTypeIdx)return!0;else return le.isParent===!0&&le.categoryMatchesMap[fe]===!0}function Zv(G,le){return G.tokenTypeIdx===le.tokenTypeIdx}let FH=1,df={};function E1(G){let le=PD(G);e8(le),zH(le),Tc(le),Li(le,(fe)=>{fe.isParent=fe.categoryMatches.length>0})}function PD(G){let le=R0(G),fe=G,ze=!0;while(ze){fe=f1(ma(Or(fe,(yt)=>yt.CATEGORIES)));let et=y1(fe,le);if(le=le.concat(et),Yl(et))ze=!1;else fe=et}return le}function e8(G){Li(G,(le)=>{if(!lC(le))df[FH]=le,le.tokenTypeIdx=FH++;if(jp(le)&&!v(le.CATEGORIES))le.CATEGORIES=[le.CATEGORIES];if(!jp(le))le.CATEGORIES=[];if(!gr(le))le.categoryMatches=[];if(!c2(le))le.categoryMatchesMap={}})}function Tc(G){Li(G,(le)=>{le.categoryMatches=[],Li(le.categoryMatchesMap,(fe,ze)=>{le.categoryMatches.push(df[ze].tokenTypeIdx)})})}function zH(G){Li(G,(le)=>{ZU([],le)})}function ZU(G,le){Li(G,(fe)=>{le.categoryMatchesMap[fe.tokenTypeIdx]=!0}),Li(le.CATEGORIES,(fe)=>{let ze=G.concat(le);if(!wc(ze,fe))ZU(ze,fe)})}function lC(G){return Ai(G,"tokenTypeIdx")}function jp(G){return Ai(G,"CATEGORIES")}function gr(G){return Ai(G,"categoryMatches")}function c2(G){return Ai(G,"categoryMatchesMap")}function l2(G){return Ai(G,"tokenTypeIdx")}let t8={buildUnableToPopLexerModeMessage(G){return`Unable to pop Lexer Mode after encountering Token ->${G.image}<- The Mode Stack is empty`},buildUnexpectedCharactersMessage(G,le,fe,ze,et){return`unexpected character: ->${G.charAt(le)}<- at offset: ${le}, skipped ${fe} characters.`}};var jh;(function(G){G[G.MISSING_PATTERN=0]="MISSING_PATTERN",G[G.INVALID_PATTERN=1]="INVALID_PATTERN",G[G.EOI_ANCHOR_FOUND=2]="EOI_ANCHOR_FOUND",G[G.UNSUPPORTED_FLAGS_FOUND=3]="UNSUPPORTED_FLAGS_FOUND",G[G.DUPLICATE_PATTERNS_FOUND=4]="DUPLICATE_PATTERNS_FOUND",G[G.INVALID_GROUP_TYPE_FOUND=5]="INVALID_GROUP_TYPE_FOUND",G[G.PUSH_MODE_DOES_NOT_EXIST=6]="PUSH_MODE_DOES_NOT_EXIST",G[G.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE=7]="MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE",G[G.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY=8]="MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY",G[G.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST=9]="MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST",G[G.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED=10]="LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED",G[G.SOI_ANCHOR_FOUND=11]="SOI_ANCHOR_FOUND",G[G.EMPTY_MATCH_PATTERN=12]="EMPTY_MATCH_PATTERN",G[G.NO_LINE_BREAKS_FLAGS=13]="NO_LINE_BREAKS_FLAGS",G[G.UNREACHABLE_PATTERN=14]="UNREACHABLE_PATTERN",G[G.IDENTIFY_TERMINATOR=15]="IDENTIFY_TERMINATOR",G[G.CUSTOM_LINE_BREAK=16]="CUSTOM_LINE_BREAK",G[G.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE=17]="MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE"})(jh||(jh={}));let tx={deferDefinitionErrorsHandling:!1,positionTracking:"full",lineTerminatorsPattern:/\n|\r\n?/g,lineTerminatorCharacters:[`
`,"\r"],ensureOptimizations:!1,safeMode:!1,errorMessageProvider:t8,traceInitPerf:!1,skipValidations:!1,recoveryEnabled:!0};Object.freeze(tx);class G_{constructor(G,le=tx){if(this.lexerDefinition=G,this.lexerDefinitionErrors=[],this.lexerDefinitionWarning=[],this.patternIdxToConfig={},this.charCodeToPatternIdxToConfig={},this.modes=[],this.emptyGroups={},this.trackStartLines=!0,this.trackEndLines=!0,this.hasCustom=!1,this.canModeBeOptimized={},this.TRACE_INIT=(ze,et)=>{if(this.traceInitPerf===!0){this.traceInitIndent++;let yt=Array(this.traceInitIndent+1).join("\t");if(this.traceInitIndent<this.traceInitMaxIdent)console.log(`${yt}--> <${ze}>`);let{time:Mt,value:Rt}=Gv(et),Wt=Mt>10?console.warn:console.log;if(this.traceInitIndent<this.traceInitMaxIdent)Wt(`${yt}<-- <${ze}> time: ${Mt}ms`);return this.traceInitIndent--,Rt}else return et()},typeof le==="boolean")throw Error(`The second argument to the Lexer constructor is now an ILexerConfig Object.
a boolean 2nd argument is no longer supported`);this.config=Hc({},tx,le);let fe=this.config.traceInitPerf;if(fe===!0)this.traceInitMaxIdent=1/0,this.traceInitPerf=!0;else if(typeof fe==="number")this.traceInitMaxIdent=fe,this.traceInitPerf=!0;this.traceInitIndent=-1,this.TRACE_INIT("Lexer Constructor",()=>{let ze,et=!0;if(this.TRACE_INIT("Lexer Config handling",()=>{if(this.config.lineTerminatorsPattern===tx.lineTerminatorsPattern)this.config.lineTerminatorsPattern=qv;else if(this.config.lineTerminatorCharacters===tx.lineTerminatorCharacters)throw Error(`Error: Missing <lineTerminatorCharacters> property on the Lexer config.
	For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#MISSING_LINE_TERM_CHARS`);if(le.safeMode&&le.ensureOptimizations)throw Error('"safeMode" and "ensureOptimizations" flags are mutually exclusive.');if(this.trackStartLines=/full|onlyStart/i.test(this.config.positionTracking),this.trackEndLines=/full/i.test(this.config.positionTracking),v(G))ze={modes:{defaultMode:R0(G)},defaultMode:G6};else et=!1,ze=R0(G)}),this.config.skipValidations===!1)this.TRACE_INIT("performRuntimeChecks",()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(Lne(ze,this.trackStartLines,this.config.lineTerminatorCharacters))}),this.TRACE_INIT("performWarningRuntimeChecks",()=>{this.lexerDefinitionWarning=this.lexerDefinitionWarning.concat(kH(ze,this.trackStartLines,this.config.lineTerminatorCharacters))});ze.modes=ze.modes?ze.modes:{},Li(ze.modes,(Mt,Rt)=>{ze.modes[Rt]=V_(Mt,(Wt)=>cf(Wt))});let yt=yd(ze.modes);if(Li(ze.modes,(Mt,Rt)=>{this.TRACE_INIT(`Mode: <${Rt}> processing`,()=>{if(this.modes.push(Rt),this.config.skipValidations===!1)this.TRACE_INIT("validatePatterns",()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(Id(Mt,yt))});if(Yl(this.lexerDefinitionErrors)){E1(Mt);let Wt;this.TRACE_INIT("analyzeTokenTypes",()=>{Wt=U6(Mt,{lineTerminatorCharacters:this.config.lineTerminatorCharacters,positionTracking:le.positionTracking,ensureOptimizations:le.ensureOptimizations,safeMode:le.safeMode,tracer:this.TRACE_INIT})}),this.patternIdxToConfig[Rt]=Wt.patternIdxToConfig,this.charCodeToPatternIdxToConfig[Rt]=Wt.charCodeToPatternIdxToConfig,this.emptyGroups=Hc({},this.emptyGroups,Wt.emptyGroups),this.hasCustom=Wt.hasCustom||this.hasCustom,this.canModeBeOptimized[Rt]=Wt.canBeOptimized}})}),this.defaultMode=ze.defaultMode,!Yl(this.lexerDefinitionErrors)&&!this.config.deferDefinitionErrorsHandling){let Rt=Or(this.lexerDefinitionErrors,(Wt)=>Wt.message).join(`-----------------------
`);throw Error(`Errors detected in definition of Lexer:
`+Rt)}Li(this.lexerDefinitionWarning,(Mt)=>{fD(Mt.message)}),this.TRACE_INIT("Choosing sub-methods implementations",()=>{if(ID)this.chopInput=re,this.match=this.matchWithTest;else this.updateLastIndex=ut,this.match=this.matchWithExec;if(et)this.handleModes=ut;if(this.trackStartLines===!1)this.computeNewColumn=re;if(this.trackEndLines===!1)this.updateTokenEndLineColumnLocation=ut;if(/full/i.test(this.config.positionTracking))this.createTokenInstance=this.createFullToken;else if(/onlyStart/i.test(this.config.positionTracking))this.createTokenInstance=this.createStartOnlyToken;else if(/onlyOffset/i.test(this.config.positionTracking))this.createTokenInstance=this.createOffsetOnlyToken;else throw Error(`Invalid <positionTracking> config option: "${this.config.positionTracking}"`);if(this.hasCustom)this.addToken=this.addTokenUsingPush,this.handlePayload=this.handlePayloadWithCustom;else this.addToken=this.addTokenUsingMemberAccess,this.handlePayload=this.handlePayloadNoCustom}),this.TRACE_INIT("Failed Optimization Warnings",()=>{let Mt=wu(this.canModeBeOptimized,(Rt,Wt,Rn)=>{if(Wt===!1)Rt.push(Rn);return Rt},[]);if(le.ensureOptimizations&&!Yl(Mt))throw Error(`Lexer Modes: < ${Mt.join(", ")} > cannot be optimized.
	 Disable the "ensureOptimizations" lexer config flag to silently ignore this and run the lexer in an un-optimized mode.
	 Or inspect the console log for details on how to resolve these issues.`)}),this.TRACE_INIT("clearRegExpParserCache",()=>{jv()}),this.TRACE_INIT("toFastProperties",()=>{zU(this)})})}tokenize(G,le=this.defaultMode){if(!Yl(this.lexerDefinitionErrors)){let ze=Or(this.lexerDefinitionErrors,(et)=>et.message).join(`-----------------------
`);throw Error(`Unable to Tokenize because Errors detected in definition of Lexer:
`+ze)}return this.tokenizeInternal(G,le)}tokenizeInternal(G,le){let fe,ze,et,yt,Mt,Rt,Wt,Rn,no,xo,qo,Br,Hi,ri,kr,Cr=G,Io=Cr.length,No=0,Ss=0,Ul=this.hasCustom?0:Math.floor(G.length/10),dp=Array(Ul),AC=[],X_=this.trackStartLines?1:void 0,B1=this.trackStartLines?1:void 0,Zp=LH(this.emptyGroups),T1=this.trackStartLines,fC=this.config.lineTerminatorsPattern,yC=0,dh=[],xC=[],lI=[],VE=[];Object.freeze(VE);let hI;function FD(){return dh}function dI(em){let tm=P1(em),CC=xC[tm];if(CC===void 0)return VE;else return CC}let iW=(em)=>{if(lI.length===1&&em.tokenType.PUSH_MODE===void 0){let tm=this.config.errorMessageProvider.buildUnableToPopLexerModeMessage(em);AC.push({offset:em.startOffset,line:em.startLine,column:em.startColumn,length:em.image.length,message:tm})}else{lI.pop();let tm=O5(lI);dh=this.patternIdxToConfig[tm],xC=this.charCodeToPatternIdxToConfig[tm],yC=dh.length;let CC=this.canModeBeOptimized[tm]&&this.config.safeMode===!1;if(xC&&CC)hI=dI;else hI=FD}};function zD(em){lI.push(em),xC=this.charCodeToPatternIdxToConfig[em],dh=this.patternIdxToConfig[em],yC=dh.length,yC=dh.length;let tm=this.canModeBeOptimized[em]&&this.config.safeMode===!1;if(xC&&tm)hI=dI;else hI=FD}zD.call(this,le);let j_,OD=this.config.recoveryEnabled;while(No<Io){Rt=null;let em=Cr.charCodeAt(No),tm=hI(em),CC=tm.length;for(fe=0;fe<CC;fe++){j_=tm[fe];let vd=j_.pattern;Wt=null;let p2=j_.short;if(p2!==!1){if(em===p2)Rt=vd}else if(j_.isCustom===!0)if(kr=vd.exec(Cr,No,dp,Zp),kr!==null){if(Rt=kr[0],kr.payload!==void 0)Wt=kr.payload}else Rt=null;else this.updateLastIndex(vd,No),Rt=this.match(vd,G,No);if(Rt!==null){if(Mt=j_.longerAlt,Mt!==void 0){let D1=Mt.length;for(et=0;et<D1;et++){let Al=dh[Mt[et]],e4=Al.pattern;if(Rn=null,Al.isCustom===!0)if(kr=e4.exec(Cr,No,dp,Zp),kr!==null){if(yt=kr[0],kr.payload!==void 0)Rn=kr.payload}else yt=null;else this.updateLastIndex(e4,No),yt=this.match(e4,G,No);if(yt&&yt.length>Rt.length){Rt=yt,Wt=Rn,j_=Al;break}}}break}}if(Rt!==null){if(no=Rt.length,xo=j_.group,xo!==void 0)if(qo=j_.tokenTypeIdx,Br=this.createTokenInstance(Rt,No,qo,j_.tokenType,X_,B1,no),this.handlePayload(Br,Wt),xo===!1)Ss=this.addToken(dp,Ss,Br);else Zp[xo].push(Br);if(G=this.chopInput(G,no),No=No+no,B1=this.computeNewColumn(B1,no),T1===!0&&j_.canLineTerminator===!0){let vd=0,p2,D1;fC.lastIndex=0;do if(p2=fC.test(Rt),p2===!0)D1=fC.lastIndex-1,vd++;while(p2===!0);if(vd!==0)X_=X_+vd,B1=no-D1,this.updateTokenEndLineColumnLocation(Br,xo,D1,vd,X_,B1,no)}this.handleModes(j_,iW,zD,Br)}else{let vd=No,p2=X_,D1=B1,Al=OD===!1;while(Al===!1&&No<Io){G=this.chopInput(G,1),No++;for(ze=0;ze<yC;ze++){let e4=dh[ze],{pattern:t4,short:YE}=e4;if(YE!==!1){if(Cr.charCodeAt(No)===YE)Al=!0}else if(e4.isCustom===!0)Al=t4.exec(Cr,No,dp,Zp)!==null;else this.updateLastIndex(t4,No),Al=t4.exec(G)!==null;if(Al===!0)break}}if(Hi=No-vd,B1=this.computeNewColumn(B1,Hi),ri=this.config.errorMessageProvider.buildUnexpectedCharactersMessage(Cr,vd,Hi,p2,D1),AC.push({offset:vd,line:p2,column:D1,length:Hi,message:ri}),OD===!1)break}}if(!this.hasCustom)dp.length=Ss;return{tokens:dp,groups:Zp,errors:AC}}handleModes(G,le,fe,ze){if(G.pop===!0){let et=G.push;if(le(ze),et!==void 0)fe.call(this,et)}else if(G.push!==void 0)fe.call(this,G.push)}chopInput(G,le){return G.substring(le)}updateLastIndex(G,le){G.lastIndex=le}updateTokenEndLineColumnLocation(G,le,fe,ze,et,yt,Mt){let Rt,Wt;if(le!==void 0){if(Rt=fe===Mt-1,Wt=Rt?-1:0,!(ze===1&&Rt===!0))G.endLine=et+Wt,G.endColumn=yt-1+-Wt}}computeNewColumn(G,le){return G+le}createOffsetOnlyToken(G,le,fe,ze){return{image:G,startOffset:le,tokenTypeIdx:fe,tokenType:ze}}createStartOnlyToken(G,le,fe,ze,et,yt){return{image:G,startOffset:le,startLine:et,startColumn:yt,tokenTypeIdx:fe,tokenType:ze}}createFullToken(G,le,fe,ze,et,yt,Mt){return{image:G,startOffset:le,endOffset:le+Mt-1,startLine:et,endLine:et,startColumn:yt,endColumn:yt+Mt-1,tokenTypeIdx:fe,tokenType:ze}}addTokenUsingPush(G,le,fe){return G.push(fe),le}addTokenUsingMemberAccess(G,le,fe){return G[le]=fe,le++,le}handlePayloadNoCustom(G,le){}handlePayloadWithCustom(G,le){if(le!==null)G.payload=le}matchWithTest(G,le,fe){if(G.test(le)===!0)return le.substring(fe,G.lastIndex);return null}matchWithExec(G,le){let fe=G.exec(le);return fe!==null?fe[0]:null}}G_.SKIPPED="This marks a skipped Token pattern, this means each token identified by it willbe consumed and then thrown into oblivion, this can be used to for example to completely ignore whitespace.",G_.NA=/NOT_APPLICABLE/;function n8(G){if(h2(G))return G.LABEL;else return G.name}function h2(G){return lp(G.LABEL)&&G.LABEL!==""}let o8="parent",OH="categories",r8="label",ED="group",DE="push_mode",NE="pop_mode",i8="longer_alt",hC="line_breaks",Y5="start_chars_hint";function $6(G){return MD(G)}function MD(G){let le=G.pattern,fe={};if(fe.name=G.name,!cf(le))fe.PATTERN=le;if(Ai(G,o8))throw`The parent property is no longer supported.
See: https://github.com/chevrotain/chevrotain/issues/564#issuecomment-349062346 for details.`;if(Ai(G,OH))fe.CATEGORIES=G[OH];if(E1([fe]),Ai(G,r8))fe.LABEL=G[r8];if(Ai(G,ED))fe.GROUP=G[ED];if(Ai(G,NE))fe.POP_MODE=G[NE];if(Ai(G,DE))fe.PUSH_MODE=G[DE];if(Ai(G,i8))fe.LONGER_ALT=G[i8];if(Ai(G,hC))fe.LINE_BREAKS=G[hC];if(Ai(G,Y5))fe.START_CHARS_HINT=G[Y5];return fe}let Tu=$6({name:"EOF",pattern:G_.NA});E1([Tu]);function U_(G,le,fe,ze,et,yt,Mt,Rt){return{image:le,startOffset:fe,endOffset:ze,startLine:et,endLine:yt,startColumn:Mt,endColumn:Rt,tokenTypeIdx:G.tokenTypeIdx,tokenType:G}}function ks(G,le){return K6(G,le)}let d2={buildMismatchTokenMessage({expected:G,actual:le,previous:fe,ruleName:ze}){return`Expecting ${h2(G)?`--> ${n8(G)} <--`:`token of type --> ${G.name} <--`} but found --> '${le.image}' <--`},buildNotAllInputParsedMessage({firstRedundant:G,ruleName:le}){return"Redundant input, expecting EOF but found: "+G.image},buildNoViableAltMessage({expectedPathsPerAlt:G,actual:le,previous:fe,customUserDescription:ze,ruleName:et}){let Rt=`
but found: '`+k0(le).image+"'";if(ze)return"Expecting: "+ze+Rt;else{let Wt=wu(G,(qo,Br)=>qo.concat(Br),[]),Rn=Or(Wt,(qo)=>`[${Or(qo,(Br)=>n8(Br)).join(", ")}]`);return`Expecting: one of these possible Token sequences:
${Or(Rn,(qo,Br)=>`  ${Br+1}. ${qo}`).join(`
`)}`+Rt}},buildEarlyExitMessage({expectedIterationPaths:G,actual:le,customUserDescription:fe,ruleName:ze}){let Mt=`
but found: '`+k0(le).image+"'";if(fe)return"Expecting: "+fe+Mt;else return`Expecting: expecting at least one iteration which starts with one of these possible Token sequences::
  <${Or(G,(Rn)=>`[${Or(Rn,(no)=>n8(no)).join(",")}]`).join(" ,")}>`+Mt}};Object.freeze(d2);let M1={buildRuleNotFoundError(G,le){return"Invalid grammar, reference to a rule which is not defined: ->"+le.nonTerminalName+`<-
inside top level rule: ->`+G.name+"<-"}},W_={buildDuplicateFoundError(G,le){function fe(no){if(no instanceof Gl)return no.terminalType.name;else if(no instanceof L0)return no.nonTerminalName;else return""}let ze=G.name,et=k0(le),yt=et.idx,Mt=Jy(et),Rt=fe(et),Wt=yt>0,Rn=`->${Mt}${Wt?yt:""}<- ${Rt?`with argument: ->${Rt}<-`:""}
                  appears more than once (${le.length} times) in the top level rule: ->${ze}<-.                  
                  For further details see: https://chevrotain.io/docs/FAQ.html#NUMERICAL_SUFFIXES 
                  `;return Rn=Rn.replace(/[ \t]+/g," "),Rn=Rn.replace(/\s\s+/g,`
`),Rn},buildNamespaceConflictError(G){return`Namespace conflict found in grammar.
The grammar has both a Terminal(Token) and a Non-Terminal(Rule) named: <${G.name}>.
To resolve this make sure each Terminal and Non-Terminal names are unique
This is easy to accomplish by using the convention that Terminal names start with an uppercase letter
and Non-Terminal names start with a lower case letter.`},buildAlternationPrefixAmbiguityError(G){let le=Or(G.prefixPath,(et)=>n8(et)).join(", "),fe=G.alternation.idx===0?"":G.alternation.idx;return`Ambiguous alternatives: <${G.ambiguityIndices.join(" ,")}> due to common lookahead prefix
in <OR${fe}> inside <${G.topLevelRule.name}> Rule,
<${le}> may appears as a prefix path in all these alternatives.
See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#COMMON_PREFIX
For Further details.`},buildAlternationAmbiguityError(G){let le=Or(G.prefixPath,(et)=>n8(et)).join(", "),fe=G.alternation.idx===0?"":G.alternation.idx,ze=`Ambiguous Alternatives Detected: <${G.ambiguityIndices.join(" ,")}> in <OR${fe}> inside <${G.topLevelRule.name}> Rule,
<${le}> may appears as a prefix path in all these alternatives.
`;return ze=ze+`See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#AMBIGUOUS_ALTERNATIVES
For Further details.`,ze},buildEmptyRepetitionError(G){let le=Jy(G.repetition);if(G.repetition.idx!==0)le+=G.repetition.idx;return`The repetition <${le}> within Rule <${G.topLevelRule.name}> can never consume any tokens.
This could lead to an infinite loop.`},buildTokenNameError(G){return"deprecated"},buildEmptyAlternationError(G){return`Ambiguous empty alternative: <${G.emptyChoiceIdx+1}> in <OR${G.alternation.idx}> inside <${G.topLevelRule.name}> Rule.
Only the last alternative may be an empty alternative.`},buildTooManyAlternativesError(G){return`An Alternation cannot have more than 256 alternatives:
<OR${G.alternation.idx}> inside <${G.topLevelRule.name}> Rule.
 has ${G.alternation.definition.length+1} alternatives.`},buildLeftRecursionError(G){let le=G.topLevelRule.name,fe=Or(G.leftRecursionPath,(yt)=>yt.name),ze=`${le} --> ${fe.concat([le]).join(" --> ")}`;return`Left Recursion found in grammar.
rule: <${le}> can be invoked from itself (directly or indirectly)
without consuming any Tokens. The grammar path that causes this is: 
 ${ze}
 To fix this refactor your grammar to remove the left recursion.
see: https://en.wikipedia.org/wiki/LL_parser#Left_factoring.`},buildInvalidRuleNameError(G){return"deprecated"},buildDuplicateRuleNameError(G){let le;if(G.topLevelRule instanceof nC)le=G.topLevelRule.name;else le=G.topLevelRule;return`Duplicate definition, rule: ->${le}<- is already defined in the grammar: ->${G.grammarName}<-`}};function q6(G,le){let fe=new uf(G,le);return fe.resolveRefs(),fe.errors}class uf extends oC{constructor(G,le){super();this.nameToTopRule=G,this.errMsgProvider=le,this.errors=[]}resolveRefs(){Li(Wd(this.nameToTopRule),(G)=>{this.currTopLevel=G,G.accept(this)})}visitNonTerminal(G){let le=this.nameToTopRule[G.nonTerminalName];if(!le){let fe=this.errMsgProvider.buildRuleNotFoundError(this.currTopLevel,G);this.errors.push({message:fe,type:qd.UNRESOLVED_SUBRULE_REF,ruleName:this.currTopLevel.name,unresolvedRefName:G.nonTerminalName})}else G.referencedRule=le}}class dC extends rC{constructor(G,le){super();this.topProd=G,this.path=le,this.possibleTokTypes=[],this.nextProductionName="",this.nextProductionOccurrence=0,this.found=!1,this.isAtEndOfPath=!1}startWalking(){if(this.found=!1,this.path.ruleStack[0]!==this.topProd.name)throw Error("The path does not start with the walker's top Rule!");return this.ruleStack=R0(this.path.ruleStack).reverse(),this.occurrenceStack=R0(this.path.occurrenceStack).reverse(),this.ruleStack.pop(),this.occurrenceStack.pop(),this.updateExpectedNext(),this.walk(this.topProd),this.possibleTokTypes}walk(G,le=[]){if(!this.found)super.walk(G,le)}walkProdRef(G,le,fe){if(G.referencedRule.name===this.nextProductionName&&G.idx===this.nextProductionOccurrence){let ze=le.concat(fe);this.updateExpectedNext(),this.walk(G.referencedRule,ze)}}updateExpectedNext(){if(Yl(this.ruleStack))this.nextProductionName="",this.nextProductionOccurrence=0,this.isAtEndOfPath=!0;else this.nextProductionName=this.ruleStack.pop(),this.nextProductionOccurrence=this.occurrenceStack.pop()}}class VH extends dC{constructor(G,le){super(G,le);this.path=le,this.nextTerminalName="",this.nextTerminalOccurrence=0,this.nextTerminalName=this.path.lastTok.name,this.nextTerminalOccurrence=this.path.lastTokOccurrence}walkTerminal(G,le,fe){if(this.isAtEndOfPath&&G.terminalType.name===this.nextTerminalName&&G.idx===this.nextTerminalOccurrence&&!this.found){let ze=le.concat(fe),et=new Xh({definition:ze});this.possibleTokTypes=F6(et),this.found=!0}}}class Yg extends rC{constructor(G,le){super();this.topRule=G,this.occurrence=le,this.result={token:void 0,occurrence:void 0,isEndOfRule:void 0}}startWalking(){return this.walk(this.topRule),this.result}}class pf extends Yg{walkMany(G,le,fe){if(G.idx===this.occurrence){let ze=k0(le.concat(fe));if(this.result.isEndOfRule=ze===void 0,ze instanceof Gl)this.result.token=ze.terminalType,this.result.occurrence=ze.idx}else super.walkMany(G,le,fe)}}class ac extends Yg{walkManySep(G,le,fe){if(G.idx===this.occurrence){let ze=k0(le.concat(fe));if(this.result.isEndOfRule=ze===void 0,ze instanceof Gl)this.result.token=ze.terminalType,this.result.occurrence=ze.idx}else super.walkManySep(G,le,fe)}}class Kd extends Yg{walkAtLeastOne(G,le,fe){if(G.idx===this.occurrence){let ze=k0(le.concat(fe));if(this.result.isEndOfRule=ze===void 0,ze instanceof Gl)this.result.token=ze.terminalType,this.result.occurrence=ze.idx}else super.walkAtLeastOne(G,le,fe)}}class Ra extends Yg{walkAtLeastOneSep(G,le,fe){if(G.idx===this.occurrence){let ze=k0(le.concat(fe));if(this.result.isEndOfRule=ze===void 0,ze instanceof Gl)this.result.token=ze.terminalType,this.result.occurrence=ze.idx}else super.walkAtLeastOneSep(G,le,fe)}}function w1(G,le,fe=[]){fe=R0(fe);let ze=[],et=0;function yt(Rt){return Rt.concat(Cd(G,et+1))}function Mt(Rt){let Wt=w1(yt(Rt),le,fe);return ze.concat(Wt)}while(fe.length<le&&et<G.length){let Rt=G[et];if(Rt instanceof Xh)return Mt(Rt.definition);else if(Rt instanceof L0)return Mt(Rt.definition);else if(Rt instanceof bd)ze=Mt(Rt.definition);else if(Rt instanceof lf){let Wt=Rt.definition.concat([new jd({definition:Rt.definition})]);return Mt(Wt)}else if(Rt instanceof hf){let Wt=[new Xh({definition:Rt.definition}),new jd({definition:[new Gl({terminalType:Rt.separator})].concat(Rt.definition)})];return Mt(Wt)}else if(Rt instanceof Wp){let Wt=Rt.definition.concat([new jd({definition:[new Gl({terminalType:Rt.separator})].concat(Rt.definition)})]);ze=Mt(Wt)}else if(Rt instanceof jd){let Wt=Rt.definition.concat([new jd({definition:Rt.definition})]);ze=Mt(Wt)}else if(Rt instanceof Vg)return Li(Rt.definition,(Wt)=>{if(Yl(Wt.definition)===!1)ze=Mt(Wt.definition)}),ze;else if(Rt instanceof Gl)fe.push(Rt.terminalType);else throw Error("non exhaustive match");et++}return ze.push({partialPath:fe,suffixDef:Cd(G,et)}),ze}function $d(G,le,fe,ze){let yt=["EXIT_NONE_TERMINAL"],Mt="EXIT_ALTERNATIVE",Rt=!1,Wt=le.length,Rn=Wt-ze-1,no=[],xo=[];xo.push({idx:-1,def:G,ruleStack:[],occurrenceStack:[]});while(!Yl(xo)){let qo=xo.pop();if(qo==="EXIT_ALTERNATIVE"){if(Rt&&O5(xo).idx<=Rn)xo.pop();continue}let{def:Br,idx:Hi,ruleStack:ri,occurrenceStack:kr}=qo;if(Yl(Br))continue;let Cr=Br[0];if(Cr==="EXIT_NONE_TERMINAL"){let Io={idx:Hi,def:Cd(Br),ruleStack:Ov(ri),occurrenceStack:Ov(kr)};xo.push(Io)}else if(Cr instanceof Gl)if(Hi<Wt-1){let Io=Hi+1,No=le[Io];if(fe(No,Cr.terminalType)){let Ss={idx:Io,def:Cd(Br),ruleStack:ri,occurrenceStack:kr};xo.push(Ss)}}else if(Hi===Wt-1)no.push({nextTokenType:Cr.terminalType,nextTokenOccurrence:Cr.idx,ruleStack:ri,occurrenceStack:kr}),Rt=!0;else throw Error("non exhaustive match");else if(Cr instanceof L0){let Io=R0(ri);Io.push(Cr.nonTerminalName);let No=R0(kr);No.push(Cr.idx);let Ss={idx:Hi,def:Cr.definition.concat(yt,Cd(Br)),ruleStack:Io,occurrenceStack:No};xo.push(Ss)}else if(Cr instanceof bd){let Io={idx:Hi,def:Cd(Br),ruleStack:ri,occurrenceStack:kr};xo.push(Io),xo.push("EXIT_ALTERNATIVE");let No={idx:Hi,def:Cr.definition.concat(Cd(Br)),ruleStack:ri,occurrenceStack:kr};xo.push(No)}else if(Cr instanceof lf){let Io=new jd({definition:Cr.definition,idx:Cr.idx}),No=Cr.definition.concat([Io],Cd(Br)),Ss={idx:Hi,def:No,ruleStack:ri,occurrenceStack:kr};xo.push(Ss)}else if(Cr instanceof hf){let Io=new Gl({terminalType:Cr.separator}),No=new jd({definition:[Io].concat(Cr.definition),idx:Cr.idx}),Ss=Cr.definition.concat([No],Cd(Br)),Ul={idx:Hi,def:Ss,ruleStack:ri,occurrenceStack:kr};xo.push(Ul)}else if(Cr instanceof Wp){let Io={idx:Hi,def:Cd(Br),ruleStack:ri,occurrenceStack:kr};xo.push(Io),xo.push("EXIT_ALTERNATIVE");let No=new Gl({terminalType:Cr.separator}),Ss=new jd({definition:[No].concat(Cr.definition),idx:Cr.idx}),Ul=Cr.definition.concat([Ss],Cd(Br)),dp={idx:Hi,def:Ul,ruleStack:ri,occurrenceStack:kr};xo.push(dp)}else if(Cr instanceof jd){let Io={idx:Hi,def:Cd(Br),ruleStack:ri,occurrenceStack:kr};xo.push(Io),xo.push("EXIT_ALTERNATIVE");let No=new jd({definition:Cr.definition,idx:Cr.idx}),Ss=Cr.definition.concat([No],Cd(Br)),Ul={idx:Hi,def:Ss,ruleStack:ri,occurrenceStack:kr};xo.push(Ul)}else if(Cr instanceof Vg)for(let Io=Cr.definition.length-1;Io>=0;Io--){let No=Cr.definition[Io],Ss={idx:Hi,def:No.definition.concat(Cd(Br)),ruleStack:ri,occurrenceStack:kr};xo.push(Ss),xo.push("EXIT_ALTERNATIVE")}else if(Cr instanceof Xh)xo.push({idx:Hi,def:Cr.definition.concat(Cd(Br)),ruleStack:ri,occurrenceStack:kr});else if(Cr instanceof nC)xo.push(uC(Cr,Hi,ri,kr));else throw Error("non exhaustive match")}return no}function uC(G,le,fe,ze){let et=R0(fe);et.push(G.name);let yt=R0(ze);return yt.push(1),{idx:le,def:G.definition,ruleStack:et,occurrenceStack:yt}}var ba;(function(G){G[G.OPTION=0]="OPTION",G[G.REPETITION=1]="REPETITION",G[G.REPETITION_MANDATORY=2]="REPETITION_MANDATORY",G[G.REPETITION_MANDATORY_WITH_SEPARATOR=3]="REPETITION_MANDATORY_WITH_SEPARATOR",G[G.REPETITION_WITH_SEPARATOR=4]="REPETITION_WITH_SEPARATOR",G[G.ALTERNATION=5]="ALTERNATION"})(ba||(ba={}));function RE(G){if(G instanceof bd||G==="Option")return ba.OPTION;else if(G instanceof jd||G==="Repetition")return ba.REPETITION;else if(G instanceof lf||G==="RepetitionMandatory")return ba.REPETITION_MANDATORY;else if(G instanceof hf||G==="RepetitionMandatoryWithSeparator")return ba.REPETITION_MANDATORY_WITH_SEPARATOR;else if(G instanceof Wp||G==="RepetitionWithSeparator")return ba.REPETITION_WITH_SEPARATOR;else if(G instanceof Vg||G==="Alternation")return ba.ALTERNATION;else throw Error("non exhaustive match")}function qc(G,le,fe,ze,et,yt){let Mt=Z6(G,le,fe),Rt=GH(Mt)?Zv:K6;return yt(Mt,ze,Rt,et)}function YH(G,le,fe,ze,et,yt){let Mt=nx(G,le,et,fe),Rt=GH(Mt)?Zv:K6;return yt(Mt[0],Rt,ze)}function hp(G,le,fe,ze){let et=G.length,yt=Og(G,(Mt)=>Og(Mt,(Rt)=>Rt.length===1));if(le)return function(Mt){let Rt=Or(Mt,(Wt)=>Wt.GATE);for(let Wt=0;Wt<et;Wt++){let Rn=G[Wt],no=Rn.length,xo=Rt[Wt];if(xo!==void 0&&xo.call(this)===!1)continue;e:for(let qo=0;qo<no;qo++){let Br=Rn[qo],Hi=Br.length;for(let ri=0;ri<Hi;ri++){let kr=this.LA(ri+1);if(fe(kr,Br[ri])===!1)continue e}return Wt}}return};else if(yt&&!ze){let Mt=Or(G,(Wt)=>ma(Wt)),Rt=wu(Mt,(Wt,Rn,no)=>(Li(Rn,(xo)=>{if(!Ai(Wt,xo.tokenTypeIdx))Wt[xo.tokenTypeIdx]=no;Li(xo.categoryMatches,(qo)=>{if(!Ai(Wt,qo))Wt[qo]=no})}),Wt),{});return function(){let Wt=this.LA(1);return Rt[Wt.tokenTypeIdx]}}else return function(){for(let Mt=0;Mt<et;Mt++){let Rt=G[Mt],Wt=Rt.length;e:for(let Rn=0;Rn<Wt;Rn++){let no=Rt[Rn],xo=no.length;for(let qo=0;qo<xo;qo++){let Br=this.LA(qo+1);if(fe(Br,no[qo])===!1)continue e}return Mt}}return}}function Hne(G,le,fe){let ze=Og(G,(yt)=>yt.length===1),et=G.length;if(ze&&!fe){let yt=ma(G);if(yt.length===1&&Yl(yt[0].categoryMatches)){let Rt=yt[0].tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===Rt}}else{let Mt=wu(yt,(Rt,Wt,Rn)=>(Rt[Wt.tokenTypeIdx]=!0,Li(Wt.categoryMatches,(no)=>{Rt[no]=!0}),Rt),[]);return function(){let Rt=this.LA(1);return Mt[Rt.tokenTypeIdx]===!0}}}else return function(){e:for(let yt=0;yt<et;yt++){let Mt=G[yt],Rt=Mt.length;for(let Wt=0;Wt<Rt;Wt++){let Rn=this.LA(Wt+1);if(le(Rn,Mt[Wt])===!1)continue e}return!0}return!1}}class Kp extends rC{constructor(G,le,fe){super();this.topProd=G,this.targetOccurrence=le,this.targetProdType=fe}startWalking(){return this.walk(this.topProd),this.restDef}checkIsTarget(G,le,fe,ze){if(G.idx===this.targetOccurrence&&this.targetProdType===le)return this.restDef=fe.concat(ze),!0;return!1}walkOption(G,le,fe){if(!this.checkIsTarget(G,ba.OPTION,le,fe))super.walkOption(G,le,fe)}walkAtLeastOne(G,le,fe){if(!this.checkIsTarget(G,ba.REPETITION_MANDATORY,le,fe))super.walkOption(G,le,fe)}walkAtLeastOneSep(G,le,fe){if(!this.checkIsTarget(G,ba.REPETITION_MANDATORY_WITH_SEPARATOR,le,fe))super.walkOption(G,le,fe)}walkMany(G,le,fe){if(!this.checkIsTarget(G,ba.REPETITION,le,fe))super.walkOption(G,le,fe)}walkManySep(G,le,fe){if(!this.checkIsTarget(G,ba.REPETITION_WITH_SEPARATOR,le,fe))super.walkOption(G,le,fe)}}class Jc extends oC{constructor(G,le,fe){super();this.targetOccurrence=G,this.targetProdType=le,this.targetRef=fe,this.result=[]}checkIsTarget(G,le){if(G.idx===this.targetOccurrence&&this.targetProdType===le&&(this.targetRef===void 0||G===this.targetRef))this.result=G.definition}visitOption(G){this.checkIsTarget(G,ba.OPTION)}visitRepetition(G){this.checkIsTarget(G,ba.REPETITION)}visitRepetitionMandatory(G){this.checkIsTarget(G,ba.REPETITION_MANDATORY)}visitRepetitionMandatoryWithSeparator(G){this.checkIsTarget(G,ba.REPETITION_MANDATORY_WITH_SEPARATOR)}visitRepetitionWithSeparator(G){this.checkIsTarget(G,ba.REPETITION_WITH_SEPARATOR)}visitAlternation(G){this.checkIsTarget(G,ba.ALTERNATION)}}function s8(G){let le=Array(G);for(let fe=0;fe<G;fe++)le[fe]=[];return le}function zm(G){let le=[""];for(let fe=0;fe<G.length;fe++){let ze=G[fe],et=[];for(let yt=0;yt<le.length;yt++){let Mt=le[yt];et.push(Mt+"_"+ze.tokenTypeIdx);for(let Rt=0;Rt<ze.categoryMatches.length;Rt++){let Wt="_"+ze.categoryMatches[Rt];et.push(Mt+Wt)}}le=et}return le}function wD(G,le,fe){for(let ze=0;ze<G.length;ze++){if(ze===fe)continue;let et=G[ze];for(let yt=0;yt<le.length;yt++){let Mt=le[yt];if(et[Mt]===!0)return!1}}return!0}function J6(G,le){let fe=Or(G,(Mt)=>w1([Mt],1)),ze=s8(fe.length),et=Or(fe,(Mt)=>{let Rt={};return Li(Mt,(Wt)=>{let Rn=zm(Wt.partialPath);Li(Rn,(no)=>{Rt[no]=!0})}),Rt}),yt=fe;for(let Mt=1;Mt<=le;Mt++){let Rt=yt;yt=s8(Rt.length);for(let Wt=0;Wt<Rt.length;Wt++){let Rn=Rt[Wt];for(let no=0;no<Rn.length;no++){let xo=Rn[no].partialPath,qo=Rn[no].suffixDef,Br=zm(xo);if(wD(et,Br,Wt)||Yl(qo)||xo.length===le){let ri=ze[Wt];if(G5(ri,xo)===!1){ri.push(xo);for(let kr=0;kr<Br.length;kr++){let Cr=Br[kr];et[Wt][Cr]=!0}}}else{let ri=w1(qo,Mt+1,xo);yt[Wt]=yt[Wt].concat(ri),Li(ri,(kr)=>{let Cr=zm(kr.partialPath);Li(Cr,(Io)=>{et[Wt][Io]=!0})})}}}}return ze}function Z6(G,le,fe,ze){let et=new Jc(G,ba.ALTERNATION,ze);return le.accept(et),J6(et.result,fe)}function nx(G,le,fe,ze){let et=new Jc(G,fe);le.accept(et);let yt=et.result,Rt=new Kp(le,G,fe).startWalking(),Wt=new Xh({definition:yt}),Rn=new Xh({definition:Rt});return J6([Wt,Rn],ze)}function G5(G,le){e:for(let fe=0;fe<G.length;fe++){let ze=G[fe];if(ze.length!==le.length)continue;for(let et=0;et<ze.length;et++){let yt=le[et],Mt=ze[et];if((yt===Mt||Mt.categoryMatchesMap[yt.tokenTypeIdx]!==void 0)===!1)continue e}return!0}return!1}function Fne(G,le){return G.length<le.length&&Og(G,(fe,ze)=>{let et=le[ze];return fe===et||et.categoryMatchesMap[fe.tokenTypeIdx]})}function GH(G){return Og(G,(le)=>Og(le,(fe)=>Og(fe,(ze)=>Yl(ze.categoryMatches))))}function zne(G){let le=G.lookaheadStrategy.validate({rules:G.rules,tokenTypes:G.tokenTypes,grammarName:G.grammarName});return Or(le,(fe)=>Object.assign({type:qd.CUSTOM_LOOKAHEAD_VALIDATION},fe))}function lh(G,le,fe,ze){let et=O_(G,(Wt)=>eI(Wt,fe)),yt=nI(G,le,fe),Mt=O_(G,(Wt)=>tI(Wt,fe)),Rt=O_(G,(Wt)=>a8(Wt,G,ze,fe));return et.concat(yt,Mt,Rt)}function eI(G,le){let fe=new pC;G.accept(fe);let ze=fe.allProductions,et=x1(ze,QE),yt=Pl(et,(Rt)=>Rt.length>1);return Or(Wd(yt),(Rt)=>{let Wt=k0(Rt),Rn=le.buildDuplicateFoundError(G,Rt),no=Jy(Wt),xo={message:Rn,type:qd.DUPLICATE_PRODUCTIONS,ruleName:G.name,dslName:no,occurrence:Wt.idx},qo=Om(Wt);if(qo)xo.parameter=qo;return xo})}function QE(G){return`${Jy(G)}_#_${G.idx}_#_${Om(G)}`}function Om(G){if(G instanceof Gl)return G.terminalType.name;else if(G instanceof L0)return G.nonTerminalName;else return""}class pC extends oC{constructor(){super(...arguments);this.allProductions=[]}visitNonTerminal(G){this.allProductions.push(G)}visitOption(G){this.allProductions.push(G)}visitRepetitionWithSeparator(G){this.allProductions.push(G)}visitRepetitionMandatory(G){this.allProductions.push(G)}visitRepetitionMandatoryWithSeparator(G){this.allProductions.push(G)}visitRepetition(G){this.allProductions.push(G)}visitAlternation(G){this.allProductions.push(G)}visitTerminal(G){this.allProductions.push(G)}}function a8(G,le,fe,ze){let et=[];if(wu(le,(Mt,Rt)=>{if(Rt.name===G.name)return Mt+1;return Mt},0)>1){let Mt=ze.buildDuplicateRuleNameError({topLevelRule:G,grammarName:fe});et.push({message:Mt,type:qd.DUPLICATE_RULE_NAME,ruleName:G.name})}return et}function BD(G,le,fe){let ze=[],et;if(!wc(le,G))et=`Invalid rule override, rule: ->${G}<- cannot be overridden in the grammar: ->${fe}<-as it is not defined in any of the super grammars `,ze.push({message:et,type:qd.INVALID_RULE_OVERRIDE,ruleName:G});return ze}function U5(G,le,fe,ze=[]){let et=[],yt=mf(le.definition);if(Yl(yt))return[];else{let Mt=G.name;if(wc(yt,G))et.push({message:fe.buildLeftRecursionError({topLevelRule:G,leftRecursionPath:ze}),type:qd.LEFT_RECURSION,ruleName:Mt});let Wt=y1(yt,ze.concat([G])),Rn=O_(Wt,(no)=>{let xo=R0(ze);return xo.push(no),U5(G,no,fe,xo)});return et.concat(Rn)}}function mf(G){let le=[];if(Yl(G))return le;let fe=k0(G);if(fe instanceof L0)le.push(fe.referencedRule);else if(fe instanceof Xh||fe instanceof bd||fe instanceof lf||fe instanceof hf||fe instanceof Wp||fe instanceof jd)le=le.concat(mf(fe.definition));else if(fe instanceof Vg)le=ma(Or(fe.definition,(yt)=>mf(yt.definition)));else if(fe instanceof Gl);else throw Error("non exhaustive match");let ze=PE(fe),et=G.length>1;if(ze&&et){let yt=Cd(G);return le.concat(mf(yt))}else return le}class c8 extends oC{constructor(){super(...arguments);this.alternations=[]}visitAlternation(G){this.alternations.push(G)}}function UH(G,le){let fe=new c8;G.accept(fe);let ze=fe.alternations;return O_(ze,(yt)=>{let Mt=Ov(yt.definition);return O_(Mt,(Rt,Wt)=>{let Rn=$d([Rt],[],K6,1);if(Yl(Rn))return[{message:le.buildEmptyAlternationError({topLevelRule:G,alternation:yt,emptyChoiceIdx:Wt}),type:qd.NONE_LAST_EMPTY_ALT,ruleName:G.name,occurrence:yt.idx,alternative:Wt+1}];else return[]})})}function TD(G,le,fe){let ze=new c8;G.accept(ze);let et=ze.alternations;return et=V_(et,(Mt)=>Mt.ignoreAmbiguities===!0),O_(et,(Mt)=>{let Rt=Mt.idx,Wt=Mt.maxLookahead||le,Rn=Z6(Rt,G,Wt,Mt),no=l8(Rn,Mt,G,fe),xo=ox(Rn,Mt,G,fe);return no.concat(xo)})}class DD extends oC{constructor(){super(...arguments);this.allProductions=[]}visitRepetitionWithSeparator(G){this.allProductions.push(G)}visitRepetitionMandatory(G){this.allProductions.push(G)}visitRepetitionMandatoryWithSeparator(G){this.allProductions.push(G)}visitRepetition(G){this.allProductions.push(G)}}function tI(G,le){let fe=new c8;G.accept(fe);let ze=fe.alternations;return O_(ze,(yt)=>{if(yt.definition.length>255)return[{message:le.buildTooManyAlternativesError({topLevelRule:G,alternation:yt}),type:qd.TOO_MANY_ALTS,ruleName:G.name,occurrence:yt.idx}];else return[]})}function WH(G,le,fe){let ze=[];return Li(G,(et)=>{let yt=new DD;et.accept(yt);let Mt=yt.allProductions;Li(Mt,(Rt)=>{let Wt=RE(Rt),Rn=Rt.maxLookahead||le,no=Rt.idx,qo=nx(no,et,Wt,Rn)[0];if(Yl(ma(qo))){let Br=fe.buildEmptyRepetitionError({topLevelRule:et,repetition:Rt});ze.push({message:Br,type:qd.NO_NON_EMPTY_LOOKAHEAD,ruleName:et.name})}})}),ze}function l8(G,le,fe,ze){let et=[],yt=wu(G,(Rt,Wt,Rn)=>{if(le.definition[Rn].ignoreAmbiguities===!0)return Rt;return Li(Wt,(no)=>{let xo=[Rn];if(Li(G,(qo,Br)=>{if(Rn!==Br&&G5(qo,no)&&le.definition[Br].ignoreAmbiguities!==!0)xo.push(Br)}),xo.length>1&&!G5(et,no))et.push(no),Rt.push({alts:xo,path:no})}),Rt},[]);return Or(yt,(Rt)=>{let Wt=Or(Rt.alts,(no)=>no+1);return{message:ze.buildAlternationAmbiguityError({topLevelRule:fe,alternation:le,ambiguityIndices:Wt,prefixPath:Rt.path}),type:qd.AMBIGUOUS_ALTS,ruleName:fe.name,occurrence:le.idx,alternatives:Rt.alts}})}function ox(G,le,fe,ze){let et=wu(G,(Mt,Rt,Wt)=>{let Rn=Or(Rt,(no)=>({idx:Wt,path:no}));return Mt.concat(Rn)},[]);return f1(O_(et,(Mt)=>{if(le.definition[Mt.idx].ignoreAmbiguities===!0)return[];let{idx:Wt,path:Rn}=Mt,no=z_(et,(qo)=>le.definition[qo.idx].ignoreAmbiguities!==!0&&qo.idx<Wt&&Fne(qo.path,Rn));return Or(no,(qo)=>{let Br=[qo.idx+1,Wt+1],Hi=le.idx===0?"":le.idx;return{message:ze.buildAlternationPrefixAmbiguityError({topLevelRule:fe,alternation:le,ambiguityIndices:Br,prefixPath:qo.path}),type:qd.AMBIGUOUS_PREFIX_ALTS,ruleName:fe.name,occurrence:Hi,alternatives:Br}})}))}function nI(G,le,fe){let ze=[],et=Or(le,(yt)=>yt.name);return Li(G,(yt)=>{let Mt=yt.name;if(wc(et,Mt)){let Rt=fe.buildNamespaceConflictError(yt);ze.push({message:Rt,type:qd.CONFLICT_TOKENS_RULES_NAMESPACE,ruleName:Mt})}}),ze}function h8(G){let le=bE(G,{errMsgProvider:M1}),fe={};return Li(G.rules,(ze)=>{fe[ze.name]=ze}),q6(fe,le.errMsgProvider)}function XH(G){return G=bE(G,{errMsgProvider:W_}),lh(G.rules,G.tokenTypes,G.errMsgProvider,G.grammarName)}let W5="MismatchedTokenException",eW="NoViableAltException",u2="EarlyExitException",d8="NotAllInputParsedException",u8=[W5,eW,u2,d8];Object.freeze(u8);function mC(G){return wc(u8,G.name)}class X5 extends Error{constructor(G,le){super(G);if(this.token=le,this.resyncedTokens=[],Object.setPrototypeOf(this,new.target.prototype),Error.captureStackTrace)Error.captureStackTrace(this,this.constructor)}}class oI extends X5{constructor(G,le,fe){super(G,le);this.previousToken=fe,this.name=W5}}class rI extends X5{constructor(G,le,fe){super(G,le);this.previousToken=fe,this.name=eW}}class j5 extends X5{constructor(G,le){super(G,le);this.name=d8}}class p8 extends X5{constructor(G,le,fe){super(G,le);this.previousToken=fe,this.name=u2}}let m8={},_8="InRuleRecoveryException";class ND extends Error{constructor(G){super(G);this.name=_8}}class kE{initRecoverable(G){if(this.firstAfterRepMap={},this.resyncFollows={},this.recoveryEnabled=Ai(G,"recoveryEnabled")?G.recoveryEnabled:Nu.recoveryEnabled,this.recoveryEnabled)this.attemptInRepetitionRecovery=RD}getTokenToInsert(G){let le=U_(G,"",NaN,NaN,NaN,NaN,NaN,NaN);return le.isInsertedInRecovery=!0,le}canTokenTypeBeInsertedInRecovery(G){return!0}canTokenTypeBeDeletedInRecovery(G){return!0}tryInRepetitionRecovery(G,le,fe,ze){let et=this.findReSyncTokenType(),yt=this.exportLexerState(),Mt=[],Rt=!1,Wt=this.LA(1),Rn=this.LA(1),no=()=>{let xo=this.LA(0),qo=this.errorMessageProvider.buildMismatchTokenMessage({expected:ze,actual:Wt,previous:xo,ruleName:this.getCurrRuleFullName()}),Br=new oI(qo,Wt,this.LA(0));Br.resyncedTokens=Ov(Mt),this.SAVE_ERROR(Br)};while(!Rt)if(this.tokenMatcher(Rn,ze)){no();return}else if(fe.call(this)){no(),G.apply(this,le);return}else if(this.tokenMatcher(Rn,et))Rt=!0;else Rn=this.SKIP_TOKEN(),this.addToResyncTokens(Rn,Mt);this.importLexerState(yt)}shouldInRepetitionRecoveryBeTried(G,le,fe){if(fe===!1)return!1;if(this.tokenMatcher(this.LA(1),G))return!1;if(this.isBackTracking())return!1;if(this.canPerformInRuleRecovery(G,this.getFollowsForInRuleRecovery(G,le)))return!1;return!0}getFollowsForInRuleRecovery(G,le){let fe=this.getCurrentGrammarPath(G,le);return this.getNextPossibleTokenTypes(fe)}tryInRuleRecovery(G,le){if(this.canRecoverWithSingleTokenInsertion(G,le))return this.getTokenToInsert(G);if(this.canRecoverWithSingleTokenDeletion(G)){let fe=this.SKIP_TOKEN();return this.consumeToken(),fe}throw new ND("sad sad panda")}canPerformInRuleRecovery(G,le){return this.canRecoverWithSingleTokenInsertion(G,le)||this.canRecoverWithSingleTokenDeletion(G)}canRecoverWithSingleTokenInsertion(G,le){if(!this.canTokenTypeBeInsertedInRecovery(G))return!1;if(Yl(le))return!1;let fe=this.LA(1);return N6(le,(et)=>this.tokenMatcher(fe,et))!==void 0}canRecoverWithSingleTokenDeletion(G){if(!this.canTokenTypeBeDeletedInRecovery(G))return!1;return this.tokenMatcher(this.LA(2),G)}isInCurrentRuleReSyncSet(G){let le=this.getCurrFollowKey(),fe=this.getFollowSetFromFollowKey(le);return wc(fe,G)}findReSyncTokenType(){let G=this.flattenFollowSet(),le=this.LA(1),fe=2;while(!0){let ze=N6(G,(et)=>ks(le,et));if(ze!==void 0)return ze;le=this.LA(fe),fe++}}getCurrFollowKey(){if(this.RULE_STACK.length===1)return m8;let G=this.getLastExplicitRuleShortName(),le=this.getLastExplicitRuleOccurrenceIndex(),fe=this.getPreviousExplicitRuleShortName();return{ruleName:this.shortRuleNameToFullName(G),idxInCallingRule:le,inRule:this.shortRuleNameToFullName(fe)}}buildFullFollowKeyStack(){let G=this.RULE_STACK,le=this.RULE_OCCURRENCE_STACK;return Or(G,(fe,ze)=>{if(ze===0)return m8;return{ruleName:this.shortRuleNameToFullName(fe),idxInCallingRule:le[ze],inRule:this.shortRuleNameToFullName(G[ze-1])}})}flattenFollowSet(){let G=Or(this.buildFullFollowKeyStack(),(le)=>this.getFollowSetFromFollowKey(le));return ma(G)}getFollowSetFromFollowKey(G){if(G===m8)return[Tu];let le=G.ruleName+G.idxInCallingRule+r2+G.inRule;return this.resyncFollows[le]}addToResyncTokens(G,le){if(!this.tokenMatcher(G,Tu))le.push(G);return le}reSyncTo(G){let le=[],fe=this.LA(1);while(this.tokenMatcher(fe,G)===!1)fe=this.SKIP_TOKEN(),this.addToResyncTokens(fe,le);return Ov(le)}attemptInRepetitionRecovery(G,le,fe,ze,et,yt,Mt){}getCurrentGrammarPath(G,le){let fe=this.getHumanReadableRuleStack(),ze=R0(this.RULE_OCCURRENCE_STACK);return{ruleStack:fe,occurrenceStack:ze,lastTok:G,lastTokOccurrence:le}}getHumanReadableRuleStack(){return Or(this.RULE_STACK,(G)=>this.shortRuleNameToFullName(G))}}function RD(G,le,fe,ze,et,yt,Mt){let Rt=this.getKeyForAutomaticLookahead(ze,et),Wt=this.firstAfterRepMap[Rt];if(Wt===void 0){let qo=this.getCurrRuleFullName(),Br=this.getGAstProductions()[qo];Wt=new yt(Br,et).startWalking(),this.firstAfterRepMap[Rt]=Wt}let Rn=Wt.token,no=Wt.occurrence,xo=Wt.isEndOfRule;if(this.RULE_STACK.length===1&&xo&&Rn===void 0)Rn=Tu,no=1;if(Rn===void 0||no===void 0)return;if(this.shouldInRepetitionRecoveryBeTried(Rn,no,Mt))this.tryInRepetitionRecovery(G,le,fe,Rn)}let g8=4,$p=8,Gg=1<<$p,Eh=2<<$p,qp=3<<$p,F0=4<<$p,hh=5<<$p,Vm=6<<$p;function K5(G,le,fe){return fe|le|G}class LE{constructor(G){var le;this.maxLookahead=(le=G===null||G===void 0?void 0:G.maxLookahead)!==null&&le!==void 0?le:Nu.maxLookahead}validate(G){let le=this.validateNoLeftRecursion(G.rules);if(Yl(le)){let fe=this.validateEmptyOrAlternatives(G.rules),ze=this.validateAmbiguousAlternationAlternatives(G.rules,this.maxLookahead),et=this.validateSomeNonEmptyLookaheadPath(G.rules,this.maxLookahead);return[...le,...fe,...ze,...et]}return le}validateNoLeftRecursion(G){return O_(G,(le)=>U5(le,le,W_))}validateEmptyOrAlternatives(G){return O_(G,(le)=>UH(le,W_))}validateAmbiguousAlternationAlternatives(G,le){return O_(G,(fe)=>TD(fe,le,W_))}validateSomeNonEmptyLookaheadPath(G,le){return WH(G,le,W_)}buildLookaheadForAlternation(G){return qc(G.prodOccurrence,G.rule,G.maxLookahead,G.hasPredicates,G.dynamicTokensEnabled,hp)}buildLookaheadForOptional(G){return YH(G.prodOccurrence,G.rule,G.maxLookahead,G.dynamicTokensEnabled,RE(G.prodType),Hne)}}class HE{initLooksAhead(G){this.dynamicTokensEnabled=Ai(G,"dynamicTokensEnabled")?G.dynamicTokensEnabled:Nu.dynamicTokensEnabled,this.maxLookahead=Ai(G,"maxLookahead")?G.maxLookahead:Nu.maxLookahead,this.lookaheadStrategy=Ai(G,"lookaheadStrategy")?G.lookaheadStrategy:new LE({maxLookahead:this.maxLookahead}),this.lookAheadFuncsCache=new Map}preComputeLookaheadFunctions(G){Li(G,(le)=>{this.TRACE_INIT(`${le.name} Rule Lookahead`,()=>{let{alternation:fe,repetition:ze,option:et,repetitionMandatory:yt,repetitionMandatoryWithSeparator:Mt,repetitionWithSeparator:Rt}=KH(le);Li(fe,(Wt)=>{let Rn=Wt.idx===0?"":Wt.idx;this.TRACE_INIT(`${Jy(Wt)}${Rn}`,()=>{let no=this.lookaheadStrategy.buildLookaheadForAlternation({prodOccurrence:Wt.idx,rule:le,maxLookahead:Wt.maxLookahead||this.maxLookahead,hasPredicates:Wt.hasPredicates,dynamicTokensEnabled:this.dynamicTokensEnabled}),xo=K5(this.fullRuleNameToShort[le.name],Gg,Wt.idx);this.setLaFuncCache(xo,no)})}),Li(ze,(Wt)=>{this.computeLookaheadFunc(le,Wt.idx,qp,"Repetition",Wt.maxLookahead,Jy(Wt))}),Li(et,(Wt)=>{this.computeLookaheadFunc(le,Wt.idx,Eh,"Option",Wt.maxLookahead,Jy(Wt))}),Li(yt,(Wt)=>{this.computeLookaheadFunc(le,Wt.idx,F0,"RepetitionMandatory",Wt.maxLookahead,Jy(Wt))}),Li(Mt,(Wt)=>{this.computeLookaheadFunc(le,Wt.idx,Vm,"RepetitionMandatoryWithSeparator",Wt.maxLookahead,Jy(Wt))}),Li(Rt,(Wt)=>{this.computeLookaheadFunc(le,Wt.idx,hh,"RepetitionWithSeparator",Wt.maxLookahead,Jy(Wt))})})})}computeLookaheadFunc(G,le,fe,ze,et,yt){this.TRACE_INIT(`${yt}${le===0?"":le}`,()=>{let Mt=this.lookaheadStrategy.buildLookaheadForOptional({prodOccurrence:le,rule:G,maxLookahead:et||this.maxLookahead,dynamicTokensEnabled:this.dynamicTokensEnabled,prodType:ze}),Rt=K5(this.fullRuleNameToShort[G.name],fe,le);this.setLaFuncCache(Rt,Mt)})}getKeyForAutomaticLookahead(G,le){let fe=this.getLastExplicitRuleShortName();return K5(fe,G,le)}getLaFuncFromCache(G){return this.lookAheadFuncsCache.get(G)}setLaFuncCache(G,le){this.lookAheadFuncsCache.set(G,le)}}class jH extends oC{constructor(){super(...arguments);this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}}reset(){this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}}visitOption(G){this.dslMethods.option.push(G)}visitRepetitionWithSeparator(G){this.dslMethods.repetitionWithSeparator.push(G)}visitRepetitionMandatory(G){this.dslMethods.repetitionMandatory.push(G)}visitRepetitionMandatoryWithSeparator(G){this.dslMethods.repetitionMandatoryWithSeparator.push(G)}visitRepetition(G){this.dslMethods.repetition.push(G)}visitAlternation(G){this.dslMethods.alternation.push(G)}}let FE=new jH;function KH(G){FE.reset(),G.accept(FE);let le=FE.dslMethods;return FE.reset(),le}function $5(G,le){if(isNaN(G.startOffset)===!0)G.startOffset=le.startOffset,G.endOffset=le.endOffset;else if(G.endOffset<le.endOffset===!0)G.endOffset=le.endOffset}function $H(G,le){if(isNaN(G.startOffset)===!0)G.startOffset=le.startOffset,G.startColumn=le.startColumn,G.startLine=le.startLine,G.endOffset=le.endOffset,G.endColumn=le.endColumn,G.endLine=le.endLine;else if(G.endOffset<le.endOffset===!0)G.endOffset=le.endOffset,G.endColumn=le.endColumn,G.endLine=le.endLine}function qH(G,le,fe){if(G.children[fe]===void 0)G.children[fe]=[le];else G.children[fe].push(le)}function QD(G,le,fe){if(G.children[le]===void 0)G.children[le]=[fe];else G.children[le].push(fe)}let A8="name";function f8(G,le){Object.defineProperty(G,A8,{enumerable:!1,configurable:!0,writable:!1,value:le})}function iI(G,le){let fe=yd(G),ze=fe.length;for(let et=0;et<ze;et++){let yt=fe[et],Mt=G[yt],Rt=Mt.length;for(let Wt=0;Wt<Rt;Wt++){let Rn=Mt[Wt];if(Rn.tokenTypeIdx===void 0)this[Rn.name](Rn.children,le)}}}function tW(G,le){let fe=function(){};f8(fe,G+"BaseSemantics");let ze={visit:function(et,yt){if(v(et))et=et[0];if(cf(et))return;return this[et.name](et.children,yt)},validateVisitor:function(){let et=nW(this,le);if(!Yl(et)){let yt=Or(et,(Mt)=>Mt.msg);throw Error(`Errors Detected in CST Visitor <${this.constructor.name}>:
	${yt.join(`

`).replace(/\n/g,`
	`)}`)}}};return fe.prototype=ze,fe.prototype.constructor=fe,fe._RULE_NAMES=le,fe}function kD(G,le,fe){let ze=function(){};f8(ze,G+"BaseSemanticsWithDefaults");let et=Object.create(fe.prototype);return Li(le,(yt)=>{et[yt]=iI}),ze.prototype=et,ze.prototype.constructor=ze,ze}var zE;(function(G){G[G.REDUNDANT_METHOD=0]="REDUNDANT_METHOD",G[G.MISSING_METHOD=1]="MISSING_METHOD"})(zE||(zE={}));function nW(G,le){return q5(G,le)}function q5(G,le){let fe=z_(le,(et)=>ue(G[et])===!1),ze=Or(fe,(et)=>({msg:`Missing visitor method: <${et}> on ${G.constructor.name} CST Visitor.`,type:zE.MISSING_METHOD,methodName:et}));return f1(ze)}class Wi{initTreeBuilder(G){if(this.CST_STACK=[],this.outputCst=G.outputCst,this.nodeLocationTracking=Ai(G,"nodeLocationTracking")?G.nodeLocationTracking:Nu.nodeLocationTracking,!this.outputCst)this.cstInvocationStateUpdate=ut,this.cstFinallyStateUpdate=ut,this.cstPostTerminal=ut,this.cstPostNonTerminal=ut,this.cstPostRule=ut;else if(/full/i.test(this.nodeLocationTracking))if(this.recoveryEnabled)this.setNodeLocationFromToken=$H,this.setNodeLocationFromNode=$H,this.cstPostRule=ut,this.setInitialNodeLocation=this.setInitialNodeLocationFullRecovery;else this.setNodeLocationFromToken=ut,this.setNodeLocationFromNode=ut,this.cstPostRule=this.cstPostRuleFull,this.setInitialNodeLocation=this.setInitialNodeLocationFullRegular;else if(/onlyOffset/i.test(this.nodeLocationTracking))if(this.recoveryEnabled)this.setNodeLocationFromToken=$5,this.setNodeLocationFromNode=$5,this.cstPostRule=ut,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRecovery;else this.setNodeLocationFromToken=ut,this.setNodeLocationFromNode=ut,this.cstPostRule=this.cstPostRuleOnlyOffset,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRegular;else if(/none/i.test(this.nodeLocationTracking))this.setNodeLocationFromToken=ut,this.setNodeLocationFromNode=ut,this.cstPostRule=ut,this.setInitialNodeLocation=ut;else throw Error(`Invalid <nodeLocationTracking> config option: "${G.nodeLocationTracking}"`)}setInitialNodeLocationOnlyOffsetRecovery(G){G.location={startOffset:NaN,endOffset:NaN}}setInitialNodeLocationOnlyOffsetRegular(G){G.location={startOffset:this.LA(1).startOffset,endOffset:NaN}}setInitialNodeLocationFullRecovery(G){G.location={startOffset:NaN,startLine:NaN,startColumn:NaN,endOffset:NaN,endLine:NaN,endColumn:NaN}}setInitialNodeLocationFullRegular(G){let le=this.LA(1);G.location={startOffset:le.startOffset,startLine:le.startLine,startColumn:le.startColumn,endOffset:NaN,endLine:NaN,endColumn:NaN}}cstInvocationStateUpdate(G){let le={name:G,children:Object.create(null)};this.setInitialNodeLocation(le),this.CST_STACK.push(le)}cstFinallyStateUpdate(){this.CST_STACK.pop()}cstPostRuleFull(G){let le=this.LA(0),fe=G.location;if(fe.startOffset<=le.startOffset===!0)fe.endOffset=le.endOffset,fe.endLine=le.endLine,fe.endColumn=le.endColumn;else fe.startOffset=NaN,fe.startLine=NaN,fe.startColumn=NaN}cstPostRuleOnlyOffset(G){let le=this.LA(0),fe=G.location;if(fe.startOffset<=le.startOffset===!0)fe.endOffset=le.endOffset;else fe.startOffset=NaN}cstPostTerminal(G,le){let fe=this.CST_STACK[this.CST_STACK.length-1];qH(fe,le,G),this.setNodeLocationFromToken(fe.location,le)}cstPostNonTerminal(G,le){let fe=this.CST_STACK[this.CST_STACK.length-1];QD(fe,le,G),this.setNodeLocationFromNode(fe.location,G.location)}getBaseCstVisitorConstructor(){if(cf(this.baseCstVisitorConstructor)){let G=tW(this.className,yd(this.gastProductionsCache));return this.baseCstVisitorConstructor=G,G}return this.baseCstVisitorConstructor}getBaseCstVisitorConstructorWithDefaults(){if(cf(this.baseCstVisitorWithDefaultsConstructor)){let G=kD(this.className,yd(this.gastProductionsCache),this.getBaseCstVisitorConstructor());return this.baseCstVisitorWithDefaultsConstructor=G,G}return this.baseCstVisitorWithDefaultsConstructor}getLastExplicitRuleShortName(){let G=this.RULE_STACK;return G[G.length-1]}getPreviousExplicitRuleShortName(){let G=this.RULE_STACK;return G[G.length-2]}getLastExplicitRuleOccurrenceIndex(){let G=this.RULE_OCCURRENCE_STACK;return G[G.length-1]}}class Oc{initLexerAdapter(){this.tokVector=[],this.tokVectorLength=0,this.currIdx=-1}set input(G){if(this.selfAnalysisDone!==!0)throw Error("Missing <performSelfAnalysis> invocation at the end of the Parser's constructor.");this.reset(),this.tokVector=G,this.tokVectorLength=G.length}get input(){return this.tokVector}SKIP_TOKEN(){if(this.currIdx<=this.tokVector.length-2)return this.consumeToken(),this.LA(1);else return x8}LA(G){let le=this.currIdx+G;if(le<0||this.tokVectorLength<=le)return x8;else return this.tokVector[le]}consumeToken(){this.currIdx++}exportLexerState(){return this.currIdx}importLexerState(G){this.currIdx=G}resetLexerState(){this.currIdx=-1}moveToTerminatedState(){this.currIdx=this.tokVector.length-1}getLexerPosition(){return this.exportLexerState()}}class Du{ACTION(G){return G.call(this)}consume(G,le,fe){return this.consumeInternal(le,G,fe)}subrule(G,le,fe){return this.subruleInternal(le,G,fe)}option(G,le){return this.optionInternal(le,G)}or(G,le){return this.orInternal(le,G)}many(G,le){return this.manyInternal(G,le)}atLeastOne(G,le){return this.atLeastOneInternal(G,le)}CONSUME(G,le){return this.consumeInternal(G,0,le)}CONSUME1(G,le){return this.consumeInternal(G,1,le)}CONSUME2(G,le){return this.consumeInternal(G,2,le)}CONSUME3(G,le){return this.consumeInternal(G,3,le)}CONSUME4(G,le){return this.consumeInternal(G,4,le)}CONSUME5(G,le){return this.consumeInternal(G,5,le)}CONSUME6(G,le){return this.consumeInternal(G,6,le)}CONSUME7(G,le){return this.consumeInternal(G,7,le)}CONSUME8(G,le){return this.consumeInternal(G,8,le)}CONSUME9(G,le){return this.consumeInternal(G,9,le)}SUBRULE(G,le){return this.subruleInternal(G,0,le)}SUBRULE1(G,le){return this.subruleInternal(G,1,le)}SUBRULE2(G,le){return this.subruleInternal(G,2,le)}SUBRULE3(G,le){return this.subruleInternal(G,3,le)}SUBRULE4(G,le){return this.subruleInternal(G,4,le)}SUBRULE5(G,le){return this.subruleInternal(G,5,le)}SUBRULE6(G,le){return this.subruleInternal(G,6,le)}SUBRULE7(G,le){return this.subruleInternal(G,7,le)}SUBRULE8(G,le){return this.subruleInternal(G,8,le)}SUBRULE9(G,le){return this.subruleInternal(G,9,le)}OPTION(G){return this.optionInternal(G,0)}OPTION1(G){return this.optionInternal(G,1)}OPTION2(G){return this.optionInternal(G,2)}OPTION3(G){return this.optionInternal(G,3)}OPTION4(G){return this.optionInternal(G,4)}OPTION5(G){return this.optionInternal(G,5)}OPTION6(G){return this.optionInternal(G,6)}OPTION7(G){return this.optionInternal(G,7)}OPTION8(G){return this.optionInternal(G,8)}OPTION9(G){return this.optionInternal(G,9)}OR(G){return this.orInternal(G,0)}OR1(G){return this.orInternal(G,1)}OR2(G){return this.orInternal(G,2)}OR3(G){return this.orInternal(G,3)}OR4(G){return this.orInternal(G,4)}OR5(G){return this.orInternal(G,5)}OR6(G){return this.orInternal(G,6)}OR7(G){return this.orInternal(G,7)}OR8(G){return this.orInternal(G,8)}OR9(G){return this.orInternal(G,9)}MANY(G){this.manyInternal(0,G)}MANY1(G){this.manyInternal(1,G)}MANY2(G){this.manyInternal(2,G)}MANY3(G){this.manyInternal(3,G)}MANY4(G){this.manyInternal(4,G)}MANY5(G){this.manyInternal(5,G)}MANY6(G){this.manyInternal(6,G)}MANY7(G){this.manyInternal(7,G)}MANY8(G){this.manyInternal(8,G)}MANY9(G){this.manyInternal(9,G)}MANY_SEP(G){this.manySepFirstInternal(0,G)}MANY_SEP1(G){this.manySepFirstInternal(1,G)}MANY_SEP2(G){this.manySepFirstInternal(2,G)}MANY_SEP3(G){this.manySepFirstInternal(3,G)}MANY_SEP4(G){this.manySepFirstInternal(4,G)}MANY_SEP5(G){this.manySepFirstInternal(5,G)}MANY_SEP6(G){this.manySepFirstInternal(6,G)}MANY_SEP7(G){this.manySepFirstInternal(7,G)}MANY_SEP8(G){this.manySepFirstInternal(8,G)}MANY_SEP9(G){this.manySepFirstInternal(9,G)}AT_LEAST_ONE(G){this.atLeastOneInternal(0,G)}AT_LEAST_ONE1(G){return this.atLeastOneInternal(1,G)}AT_LEAST_ONE2(G){this.atLeastOneInternal(2,G)}AT_LEAST_ONE3(G){this.atLeastOneInternal(3,G)}AT_LEAST_ONE4(G){this.atLeastOneInternal(4,G)}AT_LEAST_ONE5(G){this.atLeastOneInternal(5,G)}AT_LEAST_ONE6(G){this.atLeastOneInternal(6,G)}AT_LEAST_ONE7(G){this.atLeastOneInternal(7,G)}AT_LEAST_ONE8(G){this.atLeastOneInternal(8,G)}AT_LEAST_ONE9(G){this.atLeastOneInternal(9,G)}AT_LEAST_ONE_SEP(G){this.atLeastOneSepFirstInternal(0,G)}AT_LEAST_ONE_SEP1(G){this.atLeastOneSepFirstInternal(1,G)}AT_LEAST_ONE_SEP2(G){this.atLeastOneSepFirstInternal(2,G)}AT_LEAST_ONE_SEP3(G){this.atLeastOneSepFirstInternal(3,G)}AT_LEAST_ONE_SEP4(G){this.atLeastOneSepFirstInternal(4,G)}AT_LEAST_ONE_SEP5(G){this.atLeastOneSepFirstInternal(5,G)}AT_LEAST_ONE_SEP6(G){this.atLeastOneSepFirstInternal(6,G)}AT_LEAST_ONE_SEP7(G){this.atLeastOneSepFirstInternal(7,G)}AT_LEAST_ONE_SEP8(G){this.atLeastOneSepFirstInternal(8,G)}AT_LEAST_ONE_SEP9(G){this.atLeastOneSepFirstInternal(9,G)}RULE(G,le,fe=z0){if(wc(this.definedRulesNames,G)){let yt={message:W_.buildDuplicateRuleNameError({topLevelRule:G,grammarName:this.className}),type:qd.DUPLICATE_RULE_NAME,ruleName:G};this.definitionErrors.push(yt)}this.definedRulesNames.push(G);let ze=this.defineRule(G,le,fe);return this[G]=ze,ze}OVERRIDE_RULE(G,le,fe=z0){let ze=BD(G,this.definedRulesNames,this.className);this.definitionErrors=this.definitionErrors.concat(ze);let et=this.defineRule(G,le,fe);return this[G]=et,et}BACKTRACK(G,le){return function(){this.isBackTrackingStack.push(1);let fe=this.saveRecogState();try{return G.apply(this,le),!0}catch(ze){if(mC(ze))return!1;else throw ze}finally{this.reloadRecogState(fe),this.isBackTrackingStack.pop()}}}getGAstProductions(){return this.gastProductionsCache}getSerializedGastProductions(){return OU(Wd(this.gastProductionsCache))}}class Jp{initRecognizerEngine(G,le){if(this.className=this.constructor.name,this.shortRuleNameToFull={},this.fullRuleNameToShort={},this.ruleShortNameIdx=256,this.tokenMatcher=Zv,this.subruleIdx=0,this.definedRulesNames=[],this.tokensMap={},this.isBackTrackingStack=[],this.RULE_STACK=[],this.RULE_OCCURRENCE_STACK=[],this.gastProductionsCache={},Ai(le,"serializedGrammar"))throw Error(`The Parser's configuration can no longer contain a <serializedGrammar> property.
	See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_6-0-0
	For Further details.`);if(v(G)){if(Yl(G))throw Error(`A Token Vocabulary cannot be empty.
	Note that the first argument for the parser constructor
	is no longer a Token vector (since v4.0).`);if(typeof G[0].startOffset==="number")throw Error(`The Parser constructor no longer accepts a token vector as the first argument.
	See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_4-0-0
	For Further details.`)}if(v(G))this.tokensMap=wu(G,(et,yt)=>(et[yt.name]=yt,et),{});else if(Ai(G,"modes")&&Og(ma(Wd(G.modes)),l2)){let et=ma(Wd(G.modes)),yt=AD(et);this.tokensMap=wu(yt,(Mt,Rt)=>(Mt[Rt.name]=Rt,Mt),{})}else if(V(G))this.tokensMap=R0(G);else throw Error("<tokensDictionary> argument must be An Array of Token constructors, A dictionary of Token constructors or an IMultiModeLexerDefinition");this.tokensMap.EOF=Tu;let fe=Ai(G,"modes")?ma(Wd(G.modes)):Wd(G),ze=Og(fe,(et)=>Yl(et.categoryMatches));this.tokenMatcher=ze?Zv:K6,E1(Wd(this.tokensMap))}defineRule(G,le,fe){if(this.selfAnalysisDone)throw Error(`Grammar rule <${G}> may not be defined after the 'performSelfAnalysis' method has been called'
Make sure that all grammar rule definitions are done before 'performSelfAnalysis' is called.`);let ze=Ai(fe,"resyncEnabled")?fe.resyncEnabled:z0.resyncEnabled,et=Ai(fe,"recoveryValueFunc")?fe.recoveryValueFunc:z0.recoveryValueFunc,yt=this.ruleShortNameIdx<<g8+$p;this.ruleShortNameIdx++,this.shortRuleNameToFull[yt]=G,this.fullRuleNameToShort[G]=yt;let Mt;if(this.outputCst===!0)Mt=function(...Rn){try{this.ruleInvocationStateUpdate(yt,G,this.subruleIdx),le.apply(this,Rn);let no=this.CST_STACK[this.CST_STACK.length-1];return this.cstPostRule(no),no}catch(no){return this.invokeRuleCatch(no,ze,et)}finally{this.ruleFinallyStateUpdate()}};else Mt=function(...Rn){try{return this.ruleInvocationStateUpdate(yt,G,this.subruleIdx),le.apply(this,Rn)}catch(no){return this.invokeRuleCatch(no,ze,et)}finally{this.ruleFinallyStateUpdate()}};return Object.assign(Mt,{ruleName:G,originalGrammarAction:le})}invokeRuleCatch(G,le,fe){let ze=this.RULE_STACK.length===1,et=le&&!this.isBackTracking()&&this.recoveryEnabled;if(mC(G)){let yt=G;if(et){let Mt=this.findReSyncTokenType();if(this.isInCurrentRuleReSyncSet(Mt))if(yt.resyncedTokens=this.reSyncTo(Mt),this.outputCst){let Rt=this.CST_STACK[this.CST_STACK.length-1];return Rt.recoveredNode=!0,Rt}else return fe(G);else{if(this.outputCst){let Rt=this.CST_STACK[this.CST_STACK.length-1];Rt.recoveredNode=!0,yt.partialCstResult=Rt}throw yt}}else if(ze)return this.moveToTerminatedState(),fe(G);else throw yt}else throw G}optionInternal(G,le){let fe=this.getKeyForAutomaticLookahead(Eh,le);return this.optionInternalLogic(G,le,fe)}optionInternalLogic(G,le,fe){let ze=this.getLaFuncFromCache(fe),et;if(typeof G!=="function"){et=G.DEF;let yt=G.GATE;if(yt!==void 0){let Mt=ze;ze=()=>yt.call(this)&&Mt.call(this)}}else et=G;if(ze.call(this)===!0)return et.call(this);return}atLeastOneInternal(G,le){let fe=this.getKeyForAutomaticLookahead(F0,G);return this.atLeastOneInternalLogic(G,le,fe)}atLeastOneInternalLogic(G,le,fe){let ze=this.getLaFuncFromCache(fe),et;if(typeof le!=="function"){et=le.DEF;let yt=le.GATE;if(yt!==void 0){let Mt=ze;ze=()=>yt.call(this)&&Mt.call(this)}}else et=le;if(ze.call(this)===!0){let yt=this.doSingleRepetition(et);while(ze.call(this)===!0&&yt===!0)yt=this.doSingleRepetition(et)}else throw this.raiseEarlyExitException(G,ba.REPETITION_MANDATORY,le.ERR_MSG);this.attemptInRepetitionRecovery(this.atLeastOneInternal,[G,le],ze,F0,G,Kd)}atLeastOneSepFirstInternal(G,le){let fe=this.getKeyForAutomaticLookahead(Vm,G);this.atLeastOneSepFirstInternalLogic(G,le,fe)}atLeastOneSepFirstInternalLogic(G,le,fe){let{DEF:ze,SEP:et}=le;if(this.getLaFuncFromCache(fe).call(this)===!0){ze.call(this);let Mt=()=>this.tokenMatcher(this.LA(1),et);while(this.tokenMatcher(this.LA(1),et)===!0)this.CONSUME(et),ze.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[G,et,Mt,ze,Ra],Mt,Vm,G,Ra)}else throw this.raiseEarlyExitException(G,ba.REPETITION_MANDATORY_WITH_SEPARATOR,le.ERR_MSG)}manyInternal(G,le){let fe=this.getKeyForAutomaticLookahead(qp,G);return this.manyInternalLogic(G,le,fe)}manyInternalLogic(G,le,fe){let ze=this.getLaFuncFromCache(fe),et;if(typeof le!=="function"){et=le.DEF;let Mt=le.GATE;if(Mt!==void 0){let Rt=ze;ze=()=>Mt.call(this)&&Rt.call(this)}}else et=le;let yt=!0;while(ze.call(this)===!0&&yt===!0)yt=this.doSingleRepetition(et);this.attemptInRepetitionRecovery(this.manyInternal,[G,le],ze,qp,G,pf,yt)}manySepFirstInternal(G,le){let fe=this.getKeyForAutomaticLookahead(hh,G);this.manySepFirstInternalLogic(G,le,fe)}manySepFirstInternalLogic(G,le,fe){let{DEF:ze,SEP:et}=le;if(this.getLaFuncFromCache(fe).call(this)===!0){ze.call(this);let Mt=()=>this.tokenMatcher(this.LA(1),et);while(this.tokenMatcher(this.LA(1),et)===!0)this.CONSUME(et),ze.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[G,et,Mt,ze,ac],Mt,hh,G,ac)}}repetitionSepSecondInternal(G,le,fe,ze,et){while(fe())this.CONSUME(le),ze.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[G,le,fe,ze,et],fe,Vm,G,et)}doSingleRepetition(G){let le=this.getLexerPosition();return G.call(this),this.getLexerPosition()>le}orInternal(G,le){let fe=this.getKeyForAutomaticLookahead(Gg,le),ze=v(G)?G:G.DEF,yt=this.getLaFuncFromCache(fe).call(this,ze);if(yt!==void 0)return ze[yt].ALT.call(this);this.raiseNoAltException(le,G.ERR_MSG)}ruleFinallyStateUpdate(){if(this.RULE_STACK.pop(),this.RULE_OCCURRENCE_STACK.pop(),this.cstFinallyStateUpdate(),this.RULE_STACK.length===0&&this.isAtEndOfInput()===!1){let G=this.LA(1),le=this.errorMessageProvider.buildNotAllInputParsedMessage({firstRedundant:G,ruleName:this.getCurrRuleFullName()});this.SAVE_ERROR(new j5(le,G))}}subruleInternal(G,le,fe){let ze;try{let et=fe!==void 0?fe.ARGS:void 0;return this.subruleIdx=le,ze=G.apply(this,et),this.cstPostNonTerminal(ze,fe!==void 0&&fe.LABEL!==void 0?fe.LABEL:G.ruleName),ze}catch(et){throw this.subruleInternalError(et,fe,G.ruleName)}}subruleInternalError(G,le,fe){if(mC(G)&&G.partialCstResult!==void 0)this.cstPostNonTerminal(G.partialCstResult,le!==void 0&&le.LABEL!==void 0?le.LABEL:fe),delete G.partialCstResult;throw G}consumeInternal(G,le,fe){let ze;try{let et=this.LA(1);if(this.tokenMatcher(et,G)===!0)this.consumeToken(),ze=et;else this.consumeInternalError(G,et,fe)}catch(et){ze=this.consumeInternalRecovery(G,le,et)}return this.cstPostTerminal(fe!==void 0&&fe.LABEL!==void 0?fe.LABEL:G.name,ze),ze}consumeInternalError(G,le,fe){let ze,et=this.LA(0);if(fe!==void 0&&fe.ERR_MSG)ze=fe.ERR_MSG;else ze=this.errorMessageProvider.buildMismatchTokenMessage({expected:G,actual:le,previous:et,ruleName:this.getCurrRuleFullName()});throw this.SAVE_ERROR(new oI(ze,le,et))}consumeInternalRecovery(G,le,fe){if(this.recoveryEnabled&&fe.name==="MismatchedTokenException"&&!this.isBackTracking()){let ze=this.getFollowsForInRuleRecovery(G,le);try{return this.tryInRuleRecovery(G,ze)}catch(et){if(et.name===_8)throw fe;else throw et}}else throw fe}saveRecogState(){let G=this.errors,le=R0(this.RULE_STACK);return{errors:G,lexerState:this.exportLexerState(),RULE_STACK:le,CST_STACK:this.CST_STACK}}reloadRecogState(G){this.errors=G.errors,this.importLexerState(G.lexerState),this.RULE_STACK=G.RULE_STACK}ruleInvocationStateUpdate(G,le,fe){this.RULE_OCCURRENCE_STACK.push(fe),this.RULE_STACK.push(G),this.cstInvocationStateUpdate(le)}isBackTracking(){return this.isBackTrackingStack.length!==0}getCurrRuleFullName(){let G=this.getLastExplicitRuleShortName();return this.shortRuleNameToFull[G]}shortRuleNameToFullName(G){return this.shortRuleNameToFull[G]}isAtEndOfInput(){return this.tokenMatcher(this.LA(1),Tu)}reset(){this.resetLexerState(),this.subruleIdx=0,this.isBackTrackingStack=[],this.errors=[],this.RULE_STACK=[],this.CST_STACK=[],this.RULE_OCCURRENCE_STACK=[]}}class _C{initErrorHandler(G){this._errors=[],this.errorMessageProvider=Ai(G,"errorMessageProvider")?G.errorMessageProvider:Nu.errorMessageProvider}SAVE_ERROR(G){if(mC(G))return G.context={ruleStack:this.getHumanReadableRuleStack(),ruleOccurrenceStack:R0(this.RULE_OCCURRENCE_STACK)},this._errors.push(G),G;else throw Error("Trying to save an Error which is not a RecognitionException")}get errors(){return R0(this._errors)}set errors(G){this._errors=G}raiseEarlyExitException(G,le,fe){let ze=this.getCurrRuleFullName(),et=this.getGAstProductions()[ze],Mt=nx(G,et,le,this.maxLookahead)[0],Rt=[];for(let Rn=1;Rn<=this.maxLookahead;Rn++)Rt.push(this.LA(Rn));let Wt=this.errorMessageProvider.buildEarlyExitMessage({expectedIterationPaths:Mt,actual:Rt,previous:this.LA(0),customUserDescription:fe,ruleName:ze});throw this.SAVE_ERROR(new p8(Wt,this.LA(1),this.LA(0)))}raiseNoAltException(G,le){let fe=this.getCurrRuleFullName(),ze=this.getGAstProductions()[fe],et=Z6(G,ze,this.maxLookahead),yt=[];for(let Wt=1;Wt<=this.maxLookahead;Wt++)yt.push(this.LA(Wt));let Mt=this.LA(0),Rt=this.errorMessageProvider.buildNoViableAltMessage({expectedPathsPerAlt:et,actual:yt,previous:Mt,customUserDescription:le,ruleName:this.getCurrRuleFullName()});throw this.SAVE_ERROR(new rI(Rt,this.LA(1),Mt))}}class J5{initContentAssist(){}computeContentAssist(G,le){let fe=this.gastProductionsCache[G];if(cf(fe))throw Error(`Rule ->${G}<- does not exist in this grammar.`);return $d([fe],le,this.tokenMatcher,this.maxLookahead)}getNextPossibleTokenTypes(G){let le=k0(G.ruleStack),ze=this.getGAstProductions()[le];return new VH(ze,G).startWalking()}}let Z5={description:"This Object indicates the Parser is during Recording Phase"};Object.freeze(Z5);let sI=!0,rx=Math.pow(2,$p)-1,oW=$6({name:"RECORDING_PHASE_TOKEN",pattern:G_.NA});E1([oW]);let rW=U_(oW,`This IToken indicates the Parser is in Recording Phase
	See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,-1,-1,-1,-1,-1,-1);Object.freeze(rW);let Un={name:`This CSTNode indicates the Parser is in Recording Phase
	See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,children:{}};class _f{initGastRecorder(G){this.recordingProdStack=[],this.RECORDING_PHASE=!1}enableRecording(){this.RECORDING_PHASE=!0,this.TRACE_INIT("Enable Recording",()=>{for(let G=0;G<10;G++){let le=G>0?G:"";this[`CONSUME${le}`]=function(fe,ze){return this.consumeInternalRecord(fe,G,ze)},this[`SUBRULE${le}`]=function(fe,ze){return this.subruleInternalRecord(fe,G,ze)},this[`OPTION${le}`]=function(fe){return this.optionInternalRecord(fe,G)},this[`OR${le}`]=function(fe){return this.orInternalRecord(fe,G)},this[`MANY${le}`]=function(fe){this.manyInternalRecord(G,fe)},this[`MANY_SEP${le}`]=function(fe){this.manySepFirstInternalRecord(G,fe)},this[`AT_LEAST_ONE${le}`]=function(fe){this.atLeastOneInternalRecord(G,fe)},this[`AT_LEAST_ONE_SEP${le}`]=function(fe){this.atLeastOneSepFirstInternalRecord(G,fe)}}this.consume=function(G,le,fe){return this.consumeInternalRecord(le,G,fe)},this.subrule=function(G,le,fe){return this.subruleInternalRecord(le,G,fe)},this.option=function(G,le){return this.optionInternalRecord(le,G)},this.or=function(G,le){return this.orInternalRecord(le,G)},this.many=function(G,le){this.manyInternalRecord(G,le)},this.atLeastOne=function(G,le){this.atLeastOneInternalRecord(G,le)},this.ACTION=this.ACTION_RECORD,this.BACKTRACK=this.BACKTRACK_RECORD,this.LA=this.LA_RECORD})}disableRecording(){this.RECORDING_PHASE=!1,this.TRACE_INIT("Deleting Recording methods",()=>{let G=this;for(let le=0;le<10;le++){let fe=le>0?le:"";delete G[`CONSUME${fe}`],delete G[`SUBRULE${fe}`],delete G[`OPTION${fe}`],delete G[`OR${fe}`],delete G[`MANY${fe}`],delete G[`MANY_SEP${fe}`],delete G[`AT_LEAST_ONE${fe}`],delete G[`AT_LEAST_ONE_SEP${fe}`]}delete G.consume,delete G.subrule,delete G.option,delete G.or,delete G.many,delete G.atLeastOne,delete G.ACTION,delete G.BACKTRACK,delete G.LA})}ACTION_RECORD(G){}BACKTRACK_RECORD(G,le){return()=>!0}LA_RECORD(G){return x8}topLevelRuleRecord(G,le){try{let fe=new nC({definition:[],name:G});return fe.name=G,this.recordingProdStack.push(fe),le.call(this),this.recordingProdStack.pop(),fe}catch(fe){if(fe.KNOWN_RECORDER_ERROR!==!0)try{fe.message=fe.message+`
	 This error was thrown during the "grammar recording phase" For more info see:
	https://chevrotain.io/docs/guide/internals.html#grammar-recording`}catch(ze){throw fe}throw fe}}optionInternalRecord(G,le){return Ug.call(this,bd,G,le)}atLeastOneInternalRecord(G,le){Ug.call(this,lf,le,G)}atLeastOneSepFirstInternalRecord(G,le){Ug.call(this,hf,le,G,sI)}manyInternalRecord(G,le){Ug.call(this,jd,le,G)}manySepFirstInternalRecord(G,le){Ug.call(this,Wp,le,G,sI)}orInternalRecord(G,le){return OE.call(this,G,le)}subruleInternalRecord(G,le,fe){if(gC(le),!G||Ai(G,"ruleName")===!1){let Mt=Error(`<SUBRULE${y8(le)}> argument is invalid expecting a Parser method reference but got: <${JSON.stringify(G)}>
 inside top level rule: <${this.recordingProdStack[0].name}>`);throw Mt.KNOWN_RECORDER_ERROR=!0,Mt}let ze=O5(this.recordingProdStack),et=G.ruleName,yt=new L0({idx:le,nonTerminalName:et,label:fe===null||fe===void 0?void 0:fe.LABEL,referencedRule:void 0});return ze.definition.push(yt),this.outputCst?Un:Z5}consumeInternalRecord(G,le,fe){if(gC(le),!lC(G)){let yt=Error(`<CONSUME${y8(le)}> argument is invalid expecting a TokenType reference but got: <${JSON.stringify(G)}>
 inside top level rule: <${this.recordingProdStack[0].name}>`);throw yt.KNOWN_RECORDER_ERROR=!0,yt}let ze=O5(this.recordingProdStack),et=new Gl({idx:le,terminalType:G,label:fe===null||fe===void 0?void 0:fe.LABEL});return ze.definition.push(et),rW}}function Ug(G,le,fe,ze=!1){gC(fe);let et=O5(this.recordingProdStack),yt=ue(le)?le:le.DEF,Mt=new G({definition:[],idx:fe});if(ze)Mt.separator=le.SEP;if(Ai(le,"MAX_LOOKAHEAD"))Mt.maxLookahead=le.MAX_LOOKAHEAD;return this.recordingProdStack.push(Mt),yt.call(this),et.definition.push(Mt),this.recordingProdStack.pop(),Z5}function OE(G,le){gC(le);let fe=O5(this.recordingProdStack),ze=v(G)===!1,et=ze===!1?G:G.DEF,yt=new Vg({definition:[],idx:le,ignoreAmbiguities:ze&&G.IGNORE_AMBIGUITIES===!0});if(Ai(G,"MAX_LOOKAHEAD"))yt.maxLookahead=G.MAX_LOOKAHEAD;let Mt=bH(et,(Rt)=>ue(Rt.GATE));return yt.hasPredicates=Mt,fe.definition.push(yt),Li(et,(Rt)=>{let Wt=new Xh({definition:[]});if(yt.definition.push(Wt),Ai(Rt,"IGNORE_AMBIGUITIES"))Wt.ignoreAmbiguities=Rt.IGNORE_AMBIGUITIES;else if(Ai(Rt,"GATE"))Wt.ignoreAmbiguities=!0;this.recordingProdStack.push(Wt),Rt.ALT.call(this),this.recordingProdStack.pop()}),Z5}function y8(G){return G===0?"":`${G}`}function gC(G){if(G<0||G>rx){let le=Error(`Invalid DSL Method idx value: <${G}>
	Idx value must be a none negative value smaller than ${rx+1}`);throw le.KNOWN_RECORDER_ERROR=!0,le}}class aI{initPerformanceTracer(G){if(Ai(G,"traceInitPerf")){let le=G.traceInitPerf,fe=typeof le==="number";this.traceInitMaxIdent=fe?le:1/0,this.traceInitPerf=fe?le>0:le}else this.traceInitMaxIdent=0,this.traceInitPerf=Nu.traceInitPerf;this.traceInitIndent=-1}TRACE_INIT(G,le){if(this.traceInitPerf===!0){this.traceInitIndent++;let fe=Array(this.traceInitIndent+1).join("\t");if(this.traceInitIndent<this.traceInitMaxIdent)console.log(`${fe}--> <${G}>`);let{time:ze,value:et}=Gv(le),yt=ze>10?console.warn:console.log;if(this.traceInitIndent<this.traceInitMaxIdent)yt(`${fe}<-- <${G}> time: ${ze}ms`);return this.traceInitIndent--,et}else return le()}}function LD(G,le){le.forEach((fe)=>{let ze=fe.prototype;Object.getOwnPropertyNames(ze).forEach((et)=>{if(et==="constructor")return;let yt=Object.getOwnPropertyDescriptor(ze,et);if(yt&&(yt.get||yt.set))Object.defineProperty(G.prototype,et,yt);else G.prototype[et]=fe.prototype[et]})})}let x8=U_(Tu,"",NaN,NaN,NaN,NaN,NaN,NaN);Object.freeze(x8);let Nu=Object.freeze({recoveryEnabled:!1,maxLookahead:3,dynamicTokensEnabled:!1,outputCst:!0,errorMessageProvider:d2,nodeLocationTracking:"none",traceInitPerf:!1,skipValidations:!1}),z0=Object.freeze({recoveryValueFunc:()=>{return},resyncEnabled:!0});var qd;(function(G){G[G.INVALID_RULE_NAME=0]="INVALID_RULE_NAME",G[G.DUPLICATE_RULE_NAME=1]="DUPLICATE_RULE_NAME",G[G.INVALID_RULE_OVERRIDE=2]="INVALID_RULE_OVERRIDE",G[G.DUPLICATE_PRODUCTIONS=3]="DUPLICATE_PRODUCTIONS",G[G.UNRESOLVED_SUBRULE_REF=4]="UNRESOLVED_SUBRULE_REF",G[G.LEFT_RECURSION=5]="LEFT_RECURSION",G[G.NONE_LAST_EMPTY_ALT=6]="NONE_LAST_EMPTY_ALT",G[G.AMBIGUOUS_ALTS=7]="AMBIGUOUS_ALTS",G[G.CONFLICT_TOKENS_RULES_NAMESPACE=8]="CONFLICT_TOKENS_RULES_NAMESPACE",G[G.INVALID_TOKEN_NAME=9]="INVALID_TOKEN_NAME",G[G.NO_NON_EMPTY_LOOKAHEAD=10]="NO_NON_EMPTY_LOOKAHEAD",G[G.AMBIGUOUS_PREFIX_ALTS=11]="AMBIGUOUS_PREFIX_ALTS",G[G.TOO_MANY_ALTS=12]="TOO_MANY_ALTS",G[G.CUSTOM_LOOKAHEAD_VALIDATION=13]="CUSTOM_LOOKAHEAD_VALIDATION"})(qd||(qd={}));class cI{static performSelfAnalysis(G){throw Error("The **static** `performSelfAnalysis` method has been deprecated.\t\nUse the **instance** method with the same name instead.")}performSelfAnalysis(){this.TRACE_INIT("performSelfAnalysis",()=>{let G;this.selfAnalysisDone=!0;let le=this.className;this.TRACE_INIT("toFastProps",()=>{zU(this)}),this.TRACE_INIT("Grammar Recording",()=>{try{this.enableRecording(),Li(this.definedRulesNames,(ze)=>{let yt=this[ze].originalGrammarAction,Mt;this.TRACE_INIT(`${ze} Rule`,()=>{Mt=this.topLevelRuleRecord(ze,yt)}),this.gastProductionsCache[ze]=Mt})}finally{this.disableRecording()}});let fe=[];if(this.TRACE_INIT("Grammar Resolving",()=>{fe=h8({rules:Wd(this.gastProductionsCache)}),this.definitionErrors=this.definitionErrors.concat(fe)}),this.TRACE_INIT("Grammar Validations",()=>{if(Yl(fe)&&this.skipValidations===!1){let ze=XH({rules:Wd(this.gastProductionsCache),tokenTypes:Wd(this.tokensMap),errMsgProvider:W_,grammarName:le}),et=zne({lookaheadStrategy:this.lookaheadStrategy,rules:Wd(this.gastProductionsCache),tokenTypes:Wd(this.tokensMap),grammarName:le});this.definitionErrors=this.definitionErrors.concat(ze,et)}}),Yl(this.definitionErrors)){if(this.recoveryEnabled)this.TRACE_INIT("computeAllProdsFollows",()=>{let ze=UU(Wd(this.gastProductionsCache));this.resyncFollows=ze});this.TRACE_INIT("ComputeLookaheadFunctions",()=>{var ze,et;(et=(ze=this.lookaheadStrategy).initialize)===null||et===void 0||et.call(ze,{rules:Wd(this.gastProductionsCache)}),this.preComputeLookaheadFunctions(Wd(this.gastProductionsCache))})}if(!cI.DEFER_DEFINITION_ERRORS_HANDLING&&!Yl(this.definitionErrors))throw G=Or(this.definitionErrors,(ze)=>ze.message),Error(`Parser Definition Errors detected:
 ${G.join(`
-------------------------------
`)}`)})}constructor(G,le){this.definitionErrors=[],this.selfAnalysisDone=!1;let fe=this;if(fe.initErrorHandler(le),fe.initLexerAdapter(),fe.initLooksAhead(le),fe.initRecognizerEngine(G,le),fe.initRecoverable(le),fe.initTreeBuilder(le),fe.initContentAssist(),fe.initGastRecorder(le),fe.initPerformanceTracer(le),Ai(le,"ignoredIssues"))throw Error(`The <ignoredIssues> IParserConfig property has been deprecated.
	Please use the <IGNORE_AMBIGUITIES> flag on the relevant DSL method instead.
	See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#IGNORING_AMBIGUITIES
	For further details.`);this.skipValidations=Ai(le,"skipValidations")?le.skipValidations:Nu.skipValidations}}cI.DEFER_DEFINITION_ERRORS_HANDLING=!1,LD(cI,[kE,HE,Wi,Oc,Jp,Du,_C,J5,_f,aI]);class HD extends cI{constructor(G,le=Nu){let fe=R0(le);fe.outputCst=!0;super(G,fe)}}return{CstParser:HD,Lexer:G_,createToken:$6}})();class gPe extends S2{constructor(e){super(e)}load(e,t,n,o){let r=this,i=r.path===""?YI.extractUrlBase(e):r.path,s=new GC(r.manager);s.setPath(r.path),s.setRequestHeader(r.requestHeader),s.setWithCredentials(r.withCredentials),s.load(e,function(a){try{t(r.parse(a,i))}catch(c){if(o)o(c);else console.error(c);r.manager.itemError(e)}},n,o)}parse(e,t){let n={};function o(_e){let ye=r(),Se=new rYn(ye.tokens),Ne=new iYn(ye.tokenVocabulary),Le=i(Ne.getBaseCstVisitorConstructor()),nt=Se.lex(_e);Ne.input=nt.tokens;let dt=Ne.vrml();if(Ne.errors.length>0)throw console.error(Ne.errors),Error("THREE.VRMLLoader: Parsing errors detected.");return Le.visit(dt)}function r(){let _e=Dp({name:"RouteIdentifier",pattern:/[^\x30-\x39\0-\x20\x22\x27\x23\x2b\x2c\x2d\x2e\x5b\x5d\x5c\x7b\x7d][^\0-\x20\x22\x27\x23\x2b\x2c\x2d\x2e\x5b\x5d\x5c\x7b\x7d]*[\.][^\x30-\x39\0-\x20\x22\x27\x23\x2b\x2c\x2d\x2e\x5b\x5d\x5c\x7b\x7d][^\0-\x20\x22\x27\x23\x2b\x2c\x2d\x2e\x5b\x5d\x5c\x7b\x7d]*/}),ye=Dp({name:"Identifier",pattern:/[^\x30-\x39\0-\x20\x22\x27\x23\x2b\x2c\x2d\x2e\x5b\x5d\x5c\x7b\x7d][^\0-\x20\x22\x27\x23\x2b\x2c\x2d\x2e\x5b\x5d\x5c\x7b\x7d]*/,longer_alt:_e}),Se=["Anchor","Billboard","Collision","Group","Transform","Inline","LOD","Switch","AudioClip","DirectionalLight","PointLight","Script","Shape","Sound","SpotLight","WorldInfo","CylinderSensor","PlaneSensor","ProximitySensor","SphereSensor","TimeSensor","TouchSensor","VisibilitySensor","Box","Cone","Cylinder","ElevationGrid","Extrusion","IndexedFaceSet","IndexedLineSet","PointSet","Sphere","Color","Coordinate","Normal","TextureCoordinate","Appearance","FontStyle","ImageTexture","Material","MovieTexture","PixelTexture","TextureTransform","ColorInterpolator","CoordinateInterpolator","NormalInterpolator","OrientationInterpolator","PositionInterpolator","ScalarInterpolator","Background","Fog","NavigationInfo","Viewpoint","Text"],Ne=Dp({name:"Version",pattern:/#VRML.*/,longer_alt:ye}),Le=Dp({name:"NodeName",pattern:new RegExp(Se.join("|")),longer_alt:ye}),nt=Dp({name:"DEF",pattern:/DEF/,longer_alt:ye}),dt=Dp({name:"USE",pattern:/USE/,longer_alt:ye}),rt=Dp({name:"ROUTE",pattern:/ROUTE/,longer_alt:ye}),pt=Dp({name:"TO",pattern:/TO/,longer_alt:ye}),ct=Dp({name:"StringLiteral",pattern:/"(?:[^\\"\n\r]|\\[bfnrtv"\\/]|\\u[0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F])*"/}),Ct=Dp({name:"HexLiteral",pattern:/0[xX][0-9a-fA-F]+/}),kt=Dp({name:"NumberLiteral",pattern:/[-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?/}),Lt=Dp({name:"TrueLiteral",pattern:/TRUE/}),Bt=Dp({name:"FalseLiteral",pattern:/FALSE/}),xt=Dp({name:"NullLiteral",pattern:/NULL/}),Yt=Dp({name:"LSquare",pattern:/\[/}),ut=Dp({name:"RSquare",pattern:/]/}),Ze=Dp({name:"LCurly",pattern:/{/}),Fe=Dp({name:"RCurly",pattern:/}/}),tt=Dp({name:"Comment",pattern:/#.*/,group:H0e.SKIPPED}),$e=[Dp({name:"WhiteSpace",pattern:/[ ,\s]/,group:H0e.SKIPPED}),Le,nt,dt,rt,pt,Lt,Bt,xt,Ne,ye,_e,ct,Ct,kt,Yt,ut,Ze,Fe,tt],ft={};for(let vt=0,Ye=$e.length;vt<Ye;vt++){let je=$e[vt];ft[je.name]=je}return{tokens:$e,tokenVocabulary:ft}}function i(_e){function ye(){_e.call(this),this.validateVisitor()}ye.prototype=Object.assign(Object.create(_e.prototype),{constructor:ye,vrml:function(Ne){let Le={version:this.visit(Ne.version),nodes:[],routes:[]};for(let nt=0,dt=Ne.node.length;nt<dt;nt++){let rt=Ne.node[nt];Le.nodes.push(this.visit(rt))}if(Ne.route)for(let nt=0,dt=Ne.route.length;nt<dt;nt++){let rt=Ne.route[nt];Le.routes.push(this.visit(rt))}return Le},version:function(Ne){return Ne.Version[0].image},node:function(Ne){let Le={name:Ne.NodeName[0].image,fields:[]};if(Ne.field)for(let nt=0,dt=Ne.field.length;nt<dt;nt++){let rt=Ne.field[nt];Le.fields.push(this.visit(rt))}if(Ne.def)Le.DEF=this.visit(Ne.def[0]);return Le},field:function(Ne){let Le={name:Ne.Identifier[0].image,type:null,values:null},nt;if(Ne.singleFieldValue)nt=this.visit(Ne.singleFieldValue[0]);if(Ne.multiFieldValue)nt=this.visit(Ne.multiFieldValue[0]);return Le.type=nt.type,Le.values=nt.values,Le},def:function(Ne){return(Ne.Identifier||Ne.NodeName)[0].image},use:function(Ne){return{USE:(Ne.Identifier||Ne.NodeName)[0].image}},singleFieldValue:function(Ne){return Se(this,Ne)},multiFieldValue:function(Ne){return Se(this,Ne)},route:function(Ne){return{FROM:Ne.RouteIdentifier[0].image,TO:Ne.RouteIdentifier[1].image}}});function Se(Ne,Le){let nt={type:null,values:[]};if(Le.node){nt.type="node";for(let dt=0,rt=Le.node.length;dt<rt;dt++){let pt=Le.node[dt];nt.values.push(Ne.visit(pt))}}if(Le.use){nt.type="use";for(let dt=0,rt=Le.use.length;dt<rt;dt++){let pt=Le.use[dt];nt.values.push(Ne.visit(pt))}}if(Le.StringLiteral){nt.type="string";for(let dt=0,rt=Le.StringLiteral.length;dt<rt;dt++){let pt=Le.StringLiteral[dt];nt.values.push(pt.image.replace(/'|"/g,""))}}if(Le.NumberLiteral){nt.type="number";for(let dt=0,rt=Le.NumberLiteral.length;dt<rt;dt++){let pt=Le.NumberLiteral[dt];nt.values.push(parseFloat(pt.image))}}if(Le.HexLiteral){nt.type="hex";for(let dt=0,rt=Le.HexLiteral.length;dt<rt;dt++){let pt=Le.HexLiteral[dt];nt.values.push(pt.image)}}if(Le.TrueLiteral){nt.type="boolean";for(let dt=0,rt=Le.TrueLiteral.length;dt<rt;dt++)if(Le.TrueLiteral[dt].image==="TRUE")nt.values.push(!0)}if(Le.FalseLiteral){nt.type="boolean";for(let dt=0,rt=Le.FalseLiteral.length;dt<rt;dt++)if(Le.FalseLiteral[dt].image==="FALSE")nt.values.push(!1)}if(Le.NullLiteral)nt.type="null",Le.NullLiteral.forEach(function(){nt.values.push(null)});return nt}return new ye}function s(_e){let ye=_e.nodes,Se=new C4;for(let Ne=0,Le=ye.length;Ne<Le;Ne++){let nt=ye[Ne];a(nt)}for(let Ne=0,Le=ye.length;Ne<Le;Ne++){let nt=ye[Ne],dt=c(nt);if(dt instanceof nl)Se.add(dt);if(nt.name==="WorldInfo")Se.userData.worldInfo=dt}return Se}function a(_e){if(_e.DEF)n[_e.DEF]=_e;let ye=_e.fields;for(let Se=0,Ne=ye.length;Se<Ne;Se++){let Le=ye[Se];if(Le.type==="node"){let nt=Le.values;for(let dt=0,rt=nt.length;dt<rt;dt++)a(nt[dt])}}}function c(_e){if(_e.USE)return L(_e.USE);if(_e.build!==void 0)return _e.build;return _e.build=l(_e),_e.build}function l(_e){let ye=_e.name,Se;switch(ye){case"Group":case"Transform":case"Collision":Se=h(_e);break;case"Background":Se=d(_e);break;case"Shape":Se=u(_e);break;case"Appearance":Se=_(_e);break;case"Material":Se=p(_e);break;case"ImageTexture":Se=f(_e);break;case"PixelTexture":Se=g(_e);break;case"TextureTransform":Se=y(_e);break;case"IndexedFaceSet":Se=b(_e);break;case"IndexedLineSet":Se=I(_e);break;case"PointSet":Se=v(_e);break;case"Box":Se=P(_e);break;case"Cone":Se=M(_e);break;case"Cylinder":Se=B(_e);break;case"Sphere":Se=T(_e);break;case"ElevationGrid":Se=N(_e);break;case"Extrusion":Se=D(_e);break;case"Color":case"Coordinate":case"Normal":case"TextureCoordinate":Se=x(_e);break;case"WorldInfo":Se=C(_e);break;case"Anchor":case"Billboard":case"Inline":case"LOD":case"Switch":case"AudioClip":case"DirectionalLight":case"PointLight":case"Script":case"Sound":case"SpotLight":case"CylinderSensor":case"PlaneSensor":case"ProximitySensor":case"SphereSensor":case"TimeSensor":case"TouchSensor":case"VisibilitySensor":case"Text":case"FontStyle":case"MovieTexture":case"ColorInterpolator":case"CoordinateInterpolator":case"NormalInterpolator":case"OrientationInterpolator":case"PositionInterpolator":case"ScalarInterpolator":case"Fog":case"NavigationInfo":case"Viewpoint":break;default:console.warn("THREE.VRMLLoader: Unknown node:",ye);break}if(Se!==void 0&&_e.DEF!==void 0&&Se.hasOwnProperty("name")===!0)Se.name=_e.DEF;return Se}function h(_e){let ye=new dc,Se=_e.fields;for(let Ne=0,Le=Se.length;Ne<Le;Ne++){let nt=Se[Ne],{name:dt,values:rt}=nt;switch(dt){case"bboxCenter":break;case"bboxSize":break;case"center":break;case"children":H(rt,ye);break;case"collide":break;case"rotation":let pt=new Dt(rt[0],rt[1],rt[2]).normalize(),ct=rt[3];ye.quaternion.setFromAxisAngle(pt,ct);break;case"scale":ye.scale.set(rt[0],rt[1],rt[2]);break;case"scaleOrientation":break;case"translation":ye.position.set(rt[0],rt[1],rt[2]);break;case"proxy":break;default:console.warn("THREE.VRMLLoader: Unknown field:",dt);break}}return ye}function d(_e){let ye=new dc,Se,Ne,Le,nt,dt=_e.fields;for(let pt=0,ct=dt.length;pt<ct;pt++){let Ct=dt[pt],{name:kt,values:Lt}=Ct;switch(kt){case"groundAngle":Se=Lt;break;case"groundColor":Ne=Lt;break;case"backUrl":break;case"bottomUrl":break;case"frontUrl":break;case"leftUrl":break;case"rightUrl":break;case"topUrl":break;case"skyAngle":Le=Lt;break;case"skyColor":nt=Lt;break;default:console.warn("THREE.VRMLLoader: Unknown field:",kt);break}}let rt=1e4;if(nt){let pt=new YM(rt,32,16),ct=new lA({fog:!1,side:Fie,depthWrite:!1,depthTest:!1});if(nt.length>3)xe(pt,rt,Le,ge(nt),!0),ct.vertexColors=!0;else ct.color.setRGB(nt[0],nt[1],nt[2]);let Ct=new Qo(pt,ct);ye.add(Ct)}if(Ne){if(Ne.length>0){let pt=new YM(rt,32,16,0,2*Math.PI,0.5*Math.PI,1.5*Math.PI),ct=new lA({fog:!1,side:Fie,vertexColors:!0,depthWrite:!1,depthTest:!1});xe(pt,rt,Se,ge(Ne),!1);let Ct=new Qo(pt,ct);ye.add(Ct)}}return ye.renderOrder=-1/0,ye}function u(_e){let ye=_e.fields,Se=new lA({color:0}),Ne;for(let nt=0,dt=ye.length;nt<dt;nt++){let rt=ye[nt],{name:pt,values:ct}=rt;switch(pt){case"appearance":if(ct[0]!==null)Se=c(ct[0]);break;case"geometry":if(ct[0]!==null)Ne=c(ct[0]);break;default:console.warn("THREE.VRMLLoader: Unknown field:",pt);break}}let Le;if(Ne&&Ne.attributes.position){let nt=Ne._type;if(nt==="points"){let dt=new zI({color:16777215});if(Ne.attributes.color!==void 0)dt.vertexColors=!0;else if(Se.isMeshPhongMaterial)dt.color.copy(Se.emissive);Le=new OM(Ne,dt)}else if(nt==="line"){let dt=new YC({color:16777215});if(Ne.attributes.color!==void 0)dt.vertexColors=!0;else if(Se.isMeshPhongMaterial)dt.color.copy(Se.emissive);Le=new p7(Ne,dt)}else{if(Ne._solid!==void 0)Se.side=Ne._solid?h7:A0;if(Ne.attributes.color!==void 0)Se.vertexColors=!0;Le=new Qo(Ne,Se)}}else Le=new nl,Le.visible=!1;return Le}function _(_e){let ye=new Pz,Se,Ne=_e.fields;for(let Le=0,nt=Ne.length;Le<nt;Le++){let dt=Ne[Le],{name:rt,values:pt}=dt;switch(rt){case"material":if(pt[0]!==null){let Ct=c(pt[0]);if(Ct.diffuseColor)ye.color.copy(Ct.diffuseColor);if(Ct.emissiveColor)ye.emissive.copy(Ct.emissiveColor);if(Ct.shininess)ye.shininess=Ct.shininess;if(Ct.specularColor)ye.specular.copy(Ct.specularColor);if(Ct.transparency)ye.opacity=1-Ct.transparency;if(Ct.transparency>0)ye.transparent=!0}else ye=new lA({color:0});break;case"texture":let ct=pt[0];if(ct!==null){if(ct.name==="ImageTexture"||ct.name==="PixelTexture")ye.map=c(ct)}break;case"textureTransform":if(pt[0]!==null)Se=c(pt[0]);break;default:console.warn("THREE.VRMLLoader: Unknown field:",rt);break}}if(ye.map){if(ye.map.__type){switch(ye.map.__type){case Y9.INTENSITY_ALPHA:ye.opacity=1;break;case Y9.RGB:ye.color.set(16777215);break;case Y9.RGBA:ye.color.set(16777215),ye.opacity=1;break}delete ye.map.__type}if(Se)ye.map.center.copy(Se.center),ye.map.rotation=Se.rotation,ye.map.repeat.copy(Se.scale),ye.map.offset.copy(Se.translation)}return ye}function p(_e){let ye={},Se=_e.fields;for(let Ne=0,Le=Se.length;Ne<Le;Ne++){let nt=Se[Ne],{name:dt,values:rt}=nt;switch(dt){case"ambientIntensity":break;case"diffuseColor":ye.diffuseColor=new Do(rt[0],rt[1],rt[2]);break;case"emissiveColor":ye.emissiveColor=new Do(rt[0],rt[1],rt[2]);break;case"shininess":ye.shininess=rt[0];break;case"specularColor":ye.emissiveColor=new Do(rt[0],rt[1],rt[2]);break;case"transparency":ye.transparency=rt[0];break;default:console.warn("THREE.VRMLLoader: Unknown field:",dt);break}}return ye}function m(_e,ye,Se){let Ne;switch(ye){case Y9.INTENSITY:Ne=parseInt(_e),Se.r=Ne,Se.g=Ne,Se.b=Ne,Se.a=1;break;case Y9.INTENSITY_ALPHA:Ne=parseInt("0x"+_e.substring(2,4)),Se.r=Ne,Se.g=Ne,Se.b=Ne,Se.a=parseInt("0x"+_e.substring(4,6));break;case Y9.RGB:Se.r=parseInt("0x"+_e.substring(2,4)),Se.g=parseInt("0x"+_e.substring(4,6)),Se.b=parseInt("0x"+_e.substring(6,8)),Se.a=1;break;case Y9.RGBA:Se.r=parseInt("0x"+_e.substring(2,4)),Se.g=parseInt("0x"+_e.substring(4,6)),Se.b=parseInt("0x"+_e.substring(6,8)),Se.a=parseInt("0x"+_e.substring(8,10));break}}function A(_e){let ye;switch(_e){case 1:ye=Y9.INTENSITY;break;case 2:ye=Y9.INTENSITY_ALPHA;break;case 3:ye=Y9.RGB;break;case 4:ye=Y9.RGBA;break}return ye}function g(_e){let ye,Se=x4,Ne=x4,Le=_e.fields;for(let nt=0,dt=Le.length;nt<dt;nt++){let rt=Le[nt],{name:pt,values:ct}=rt;switch(pt){case"image":let Ct=ct[0],kt=ct[1],Lt=ct[2],Bt=A(Lt),xt=new Uint8Array(4*Ct*kt),Yt={r:0,g:0,b:0,a:0};for(let ut=3,Ze=0,Fe=ct.length;ut<Fe;ut++,Ze++){m(ct[ut],Bt,Yt);let tt=Ze*4;xt[tt+0]=Yt.r,xt[tt+1]=Yt.g,xt[tt+2]=Yt.b,xt[tt+3]=Yt.a}ye=new Xj(xt,Ct,kt),ye.needsUpdate=!0,ye.__type=Bt;break;case"repeatS":if(ct[0]===!1)Se=VC;break;case"repeatT":if(ct[0]===!1)Ne=VC;break;default:console.warn("THREE.VRMLLoader: Unknown field:",pt);break}}if(ye)ye.wrapS=Se,ye.wrapT=Ne;return ye}function f(_e){let ye,Se=x4,Ne=x4,Le=_e.fields;for(let nt=0,dt=Le.length;nt<dt;nt++){let rt=Le[nt],{name:pt,values:ct}=rt;switch(pt){case"url":let Ct=ct[0];if(Ct)ye=Ee.load(Ct);break;case"repeatS":if(ct[0]===!1)Se=VC;break;case"repeatT":if(ct[0]===!1)Ne=VC;break;default:console.warn("THREE.VRMLLoader: Unknown field:",pt);break}}if(ye)ye.wrapS=Se,ye.wrapT=Ne;return ye}function y(_e){let ye={center:new go,rotation:new go,scale:new go,translation:new go},Se=_e.fields;for(let Ne=0,Le=Se.length;Ne<Le;Ne++){let nt=Se[Ne],{name:dt,values:rt}=nt;switch(dt){case"center":ye.center.set(rt[0],rt[1]);break;case"rotation":ye.rotation=rt[0];break;case"scale":ye.scale.set(rt[0],rt[1]);break;case"translation":ye.translation.set(rt[0],rt[1]);break;default:console.warn("THREE.VRMLLoader: Unknown field:",dt);break}}return ye}function x(_e){return _e.fields[0].values}function C(_e){let ye={},Se=_e.fields;for(let Ne=0,Le=Se.length;Ne<Le;Ne++){let nt=Se[Ne],{name:dt,values:rt}=nt;switch(dt){case"title":ye.title=rt[0];break;case"info":ye.info=rt;break;default:console.warn("THREE.VRMLLoader: Unknown field:",dt);break}}return ye}function b(_e){let ye,Se,Ne,Le,nt=!0,dt=!0,rt=0,pt,ct,Ct,kt,Lt=!0,Bt=!0,xt=_e.fields;for(let $e=0,ft=xt.length;$e<ft;$e++){let vt=xt[$e],{name:Ye,values:je}=vt;switch(Ye){case"color":let st=je[0];if(st!==null)ye=c(st);break;case"coord":let St=je[0];if(St!==null)Se=c(St);break;case"normal":let Nt=je[0];if(Nt!==null)Ne=c(Nt);break;case"texCoord":let Ot=je[0];if(Ot!==null)Le=c(Ot);break;case"ccw":nt=je[0];break;case"colorIndex":pt=je;break;case"colorPerVertex":Lt=je[0];break;case"convex":break;case"coordIndex":ct=je;break;case"creaseAngle":rt=je[0];break;case"normalIndex":Ct=je;break;case"normalPerVertex":Bt=je[0];break;case"solid":dt=je[0];break;case"texCoordIndex":kt=je;break;default:console.warn("THREE.VRMLLoader: Unknown field:",Ye);break}}if(ct===void 0)return console.warn("THREE.VRMLLoader: Missing coordIndex."),new ha;let Yt=V(ct,nt),ut,Ze,Fe;if(ye)if(Lt===!0)if(pt&&pt.length>0){let $e=V(pt,nt);ut=re(Yt,$e,ye,3)}else ut=ie(Yt,new jr(ye,3));else if(pt&&pt.length>0){let $e=U(ye,pt),ft=O($e,ct);ut=Z(Yt,ft)}else{let $e=O(ye,ct);ut=Z(Yt,$e)}if(Ne)if(Bt===!0)if(Ct&&Ct.length>0){let $e=V(Ct,nt);Ze=re(Yt,$e,Ne,3)}else Ze=ie(Yt,new jr(Ne,3));else if(Ct&&Ct.length>0){let $e=U(Ne,Ct),ft=O($e,ct);Ze=Z(Yt,ft)}else{let $e=O(Ne,ct);Ze=Z(Yt,$e)}else Ze=de(Yt,Se,rt);if(Le)if(kt&&kt.length>0){let $e=V(kt,nt);Fe=re(Yt,$e,Le,2)}else Fe=ie(Yt,new jr(Le,2));let tt=new ha,Je=ie(Yt,new jr(Se,3));if(tt.setAttribute("position",Je),tt.setAttribute("normal",Ze),ut)tt.setAttribute("color",ut);if(Fe)tt.setAttribute("uv",Fe);return tt._solid=dt,tt._type="mesh",tt}function I(_e){let ye,Se,Ne,Le,nt=!0,dt=_e.fields;for(let kt=0,Lt=dt.length;kt<Lt;kt++){let Bt=dt[kt],{name:xt,values:Yt}=Bt;switch(xt){case"color":let ut=Yt[0];if(ut!==null)ye=c(ut);break;case"coord":let Ze=Yt[0];if(Ze!==null)Se=c(Ze);break;case"colorIndex":Ne=Yt;break;case"colorPerVertex":nt=Yt[0];break;case"coordIndex":Le=Yt;break;default:console.warn("THREE.VRMLLoader: Unknown field:",xt);break}}let rt,pt=j(Le);if(ye)if(nt===!0)if(Ne.length>0){let kt=j(Ne);rt=re(pt,kt,ye,3)}else rt=ie(pt,new jr(ye,3));else if(Ne.length>0){let kt=U(ye,Ne),Lt=Y(kt,Le);rt=te(pt,Lt)}else{let kt=Y(ye,Le);rt=te(pt,kt)}let ct=new ha,Ct=ie(pt,new jr(Se,3));if(ct.setAttribute("position",Ct),rt)ct.setAttribute("color",rt);return ct._type="line",ct}function v(_e){let ye,Se,Ne=_e.fields;for(let nt=0,dt=Ne.length;nt<dt;nt++){let rt=Ne[nt],{name:pt,values:ct}=rt;switch(pt){case"color":let Ct=ct[0];if(Ct!==null)ye=c(Ct);break;case"coord":let kt=ct[0];if(kt!==null)Se=c(kt);break;default:console.warn("THREE.VRMLLoader: Unknown field:",pt);break}}let Le=new ha;if(Le.setAttribute("position",new jr(Se,3)),ye)Le.setAttribute("color",new jr(ye,3));return Le._type="points",Le}function P(_e){let ye=new Dt(2,2,2),Se=_e.fields;for(let Le=0,nt=Se.length;Le<nt;Le++){let dt=Se[Le],{name:rt,values:pt}=dt;switch(rt){case"size":ye.x=pt[0],ye.y=pt[1],ye.z=pt[2];break;default:console.warn("THREE.VRMLLoader: Unknown field:",rt);break}}return new qm(ye.x,ye.y,ye.z)}function M(_e){let ye=1,Se=2,Ne=!1,Le=_e.fields;for(let dt=0,rt=Le.length;dt<rt;dt++){let pt=Le[dt],{name:ct,values:Ct}=pt;switch(ct){case"bottom":Ne=!Ct[0];break;case"bottomRadius":ye=Ct[0];break;case"height":Se=Ct[0];break;case"side":break;default:console.warn("THREE.VRMLLoader: Unknown field:",ct);break}}return new txe(ye,Se,16,1,Ne)}function B(_e){let ye=1,Se=2,Ne=_e.fields;for(let nt=0,dt=Ne.length;nt<dt;nt++){let rt=Ne[nt],{name:pt,values:ct}=rt;switch(pt){case"bottom":break;case"radius":ye=ct[0];break;case"height":Se=ct[0];break;case"side":break;case"top":break;default:console.warn("THREE.VRMLLoader: Unknown field:",pt);break}}return new VM(ye,ye,Se,16,1)}function T(_e){let ye=1,Se=_e.fields;for(let Le=0,nt=Se.length;Le<nt;Le++){let dt=Se[Le],{name:rt,values:pt}=dt;switch(rt){case"radius":ye=pt[0];break;default:console.warn("THREE.VRMLLoader: Unknown field:",rt);break}}return new YM(ye,16,16)}function N(_e){let ye,Se,Ne,Le,nt=!0,dt=!0,rt=!0,pt=!0,ct=0,Ct=2,kt=2,Lt=1,Bt=1,xt=_e.fields;for(let je=0,st=xt.length;je<st;je++){let St=xt[je],{name:Nt,values:Ot}=St;switch(Nt){case"color":let Ut=Ot[0];if(Ut!==null)ye=c(Ut);break;case"normal":let mn=Ot[0];if(mn!==null)Se=c(mn);break;case"texCoord":let _n=Ot[0];if(_n!==null)Ne=c(_n);break;case"height":Le=Ot;break;case"ccw":pt=Ot[0];break;case"colorPerVertex":nt=Ot[0];break;case"creaseAngle":ct=Ot[0];break;case"normalPerVertex":dt=Ot[0];break;case"solid":rt=Ot[0];break;case"xDimension":Ct=Ot[0];break;case"xSpacing":Lt=Ot[0];break;case"zDimension":kt=Ot[0];break;case"zSpacing":Bt=Ot[0];break;default:console.warn("THREE.VRMLLoader: Unknown field:",Nt);break}}let Yt=[],ut=[],Ze=[],Fe=[];for(let je=0;je<kt;je++)for(let st=0;st<Ct;st++){let St=je*Ct+st,Nt=Lt*je,Ot=Le[St],Ut=Bt*st;if(Yt.push(Nt,Ot,Ut),ye&&nt===!0){let mn=ye[St*3+0],_n=ye[St*3+1],En=ye[St*3+2];Ze.push(mn,_n,En)}if(Se&&dt===!0){let mn=Se[St*3+0],_n=Se[St*3+1],En=Se[St*3+2];ut.push(mn,_n,En)}if(Ne){let mn=Ne[St*2+0],_n=Ne[St*2+1];Fe.push(mn,_n)}else Fe.push(je/(Ct-1),st/(kt-1))}let tt=[];for(let je=0;je<Ct-1;je++)for(let st=0;st<kt-1;st++){let St=je+st*Ct,Nt=je+(st+1)*Ct,Ot=je+1+(st+1)*Ct,Ut=je+1+st*Ct;if(pt===!0)tt.push(St,Ot,Nt),tt.push(Ot,St,Ut);else tt.push(St,Nt,Ot),tt.push(Ot,Ut,St)}let Je=ie(tt,new jr(Yt,3)),$e=ie(tt,new jr(Fe,2)),ft,vt;if(ye)if(nt===!1){for(let je=0;je<Ct-1;je++)for(let st=0;st<kt-1;st++){let St=je+st*(Ct-1),Nt=ye[St*3+0],Ot=ye[St*3+1],Ut=ye[St*3+2];Ze.push(Nt,Ot,Ut),Ze.push(Nt,Ot,Ut),Ze.push(Nt,Ot,Ut),Ze.push(Nt,Ot,Ut),Ze.push(Nt,Ot,Ut),Ze.push(Nt,Ot,Ut)}ft=new jr(Ze,3)}else ft=ie(tt,new jr(Ze,3));if(Se)if(dt===!1){for(let je=0;je<Ct-1;je++)for(let st=0;st<kt-1;st++){let St=je+st*(Ct-1),Nt=Se[St*3+0],Ot=Se[St*3+1],Ut=Se[St*3+2];ut.push(Nt,Ot,Ut),ut.push(Nt,Ot,Ut),ut.push(Nt,Ot,Ut),ut.push(Nt,Ot,Ut),ut.push(Nt,Ot,Ut),ut.push(Nt,Ot,Ut)}vt=new jr(ut,3)}else vt=ie(tt,new jr(ut,3));else vt=de(tt,Yt,ct);let Ye=new ha;if(Ye.setAttribute("position",Je),Ye.setAttribute("normal",vt),Ye.setAttribute("uv",$e),ft)Ye.setAttribute("color",ft);return Ye._solid=rt,Ye._type="mesh",Ye}function D(_e){let ye=[1,1,1,-1,-1,-1,-1,1,1,1],Se=[0,0,0,0,1,0],Ne,Le,nt=!0,dt=!0,rt=0,pt=!0,ct=!0,Ct=_e.fields;for(let Ye=0,je=Ct.length;Ye<je;Ye++){let st=Ct[Ye],{name:St,values:Nt}=st;switch(St){case"beginCap":nt=Nt[0];break;case"ccw":dt=Nt[0];break;case"convex":break;case"creaseAngle":rt=Nt[0];break;case"crossSection":ye=Nt;break;case"endCap":pt=Nt[0];break;case"orientation":Le=Nt;break;case"scale":Ne=Nt;break;case"solid":ct=Nt[0];break;case"spine":Se=Nt;break;default:console.warn("THREE.VRMLLoader: Unknown field:",St);break}}let kt=ye[0]===ye[ye.length-2]&&ye[1]===ye[ye.length-1],Lt=[],Bt=new Dt,xt=new Dt,Yt=new Dt,ut=new Dt,Ze=new hm;for(let Ye=0,je=0,st=0,St=Se.length;Ye<St;Ye+=3,je+=2,st+=4){Bt.fromArray(Se,Ye),xt.x=Ne?Ne[je+0]:1,xt.y=1,xt.z=Ne?Ne[je+1]:1,Yt.x=Le?Le[st+0]:0,Yt.y=Le?Le[st+1]:0,Yt.z=Le?Le[st+2]:1;let Nt=Le?Le[st+3]:0;for(let Ot=0,Ut=ye.length;Ot<Ut;Ot+=2)ut.x=ye[Ot+0],ut.y=0,ut.z=ye[Ot+1],ut.multiply(xt),Ze.setFromAxisAngle(Yt,Nt),ut.applyQuaternion(Ze),ut.add(Bt),Lt.push(ut.x,ut.y,ut.z)}let Fe=[],tt=Se.length/3,Je=ye.length/2;for(let Ye=0;Ye<tt-1;Ye++)for(let je=0;je<Je-1;je++){let st=je+Ye*Je,St=je+1+Ye*Je,Nt=je+(Ye+1)*Je,Ot=je+1+(Ye+1)*Je;if(je===Je-2&&kt===!0)St=Ye*Je,Ot=(Ye+1)*Je;if(dt===!0)Fe.push(st,St,Nt),Fe.push(Nt,St,Ot);else Fe.push(st,Nt,St),Fe.push(Nt,Ot,St)}if(nt===!0||pt===!0){let Ye=[];for(let St=0,Nt=ye.length;St<Nt;St+=2)Ye.push(new go(ye[St],ye[St+1]));let je=bz.triangulateShape(Ye,[]),st=[];for(let St=0,Nt=je.length;St<Nt;St++){let Ot=je[St];st.push(Ot[0],Ot[1],Ot[2])}if(nt===!0)for(let St=0,Nt=st.length;St<Nt;St+=3)if(dt===!0)Fe.push(st[St+0],st[St+1],st[St+2]);else Fe.push(st[St+0],st[St+2],st[St+1]);if(pt===!0){let St=Je*(tt-1);for(let Nt=0,Ot=st.length;Nt<Ot;Nt+=3)if(dt===!0)Fe.push(St+st[Nt+0],St+st[Nt+2],St+st[Nt+1]);else Fe.push(St+st[Nt+0],St+st[Nt+1],St+st[Nt+2])}}let $e=ie(Fe,new jr(Lt,3)),ft=de(Fe,Lt,rt),vt=new ha;return vt.setAttribute("position",$e),vt.setAttribute("normal",ft),vt._solid=ct,vt._type="mesh",vt}function L(_e){let ye=n[_e],Se=c(ye);return Se.isObject3D||Se.isMaterial?Se.clone():Se}function H(_e,ye){for(let Se=0,Ne=_e.length;Se<Ne;Se++){let Le=c(_e[Se]);if(Le instanceof nl)ye.add(Le)}}function V(_e,ye){let Se=[],Ne=0;for(let Le=0,nt=_e.length;Le<nt;Le++){let dt=_e[Ne],rt=_e[Le+(ye?1:2)],pt=_e[Le+(ye?2:1)];if(Se.push(dt,rt,pt),_e[Le+3]===-1||Le+3>=nt)Le+=3,Ne=Le+1}return Se}function O(_e,ye){let Se=[],Ne=0;for(let Le=0,nt=ye.length;Le<nt;Le++){let dt=Ne*3,rt=_e[dt],pt=_e[dt+1],ct=_e[dt+2];if(Se.push(rt,pt,ct),ye[Le+3]===-1||Le+3>=nt)Le+=3,Ne++}return Se}function U(_e,ye){let Se=[];for(let Ne=0,Le=ye.length;Ne<Le;Ne++){let dt=ye[Ne]*3,rt=_e[dt],pt=_e[dt+1],ct=_e[dt+2];Se.push(rt,pt,ct)}return Se}function j(_e){let ye=[];for(let Se=0,Ne=_e.length;Se<Ne;Se++){let Le=_e[Se],nt=_e[Se+1];if(ye.push(Le,nt),_e[Se+2]===-1||Se+2>=Ne)Se+=2}return ye}function Y(_e,ye){let Se=[],Ne=0;for(let Le=0,nt=ye.length;Le<nt;Le++){let dt=Ne*3,rt=_e[dt],pt=_e[dt+1],ct=_e[dt+2];if(Se.push(rt,pt,ct),ye[Le+2]===-1||Le+2>=nt)Le+=2,Ne++}return Se}let X=new Dt,K=new Dt,J=new Dt,ee=new go,se=new go,ne=new go;function re(_e,ye,Se,Ne){let Le=[];for(let nt=0,dt=_e.length;nt<dt;nt+=3){let rt=ye[nt],pt=ye[nt+1],ct=ye[nt+2];if(Ne===2)ee.fromArray(Se,rt*Ne),se.fromArray(Se,pt*Ne),ne.fromArray(Se,ct*Ne),Le.push(ee.x,ee.y),Le.push(se.x,se.y),Le.push(ne.x,ne.y);else X.fromArray(Se,rt*Ne),K.fromArray(Se,pt*Ne),J.fromArray(Se,ct*Ne),Le.push(X.x,X.y,X.z),Le.push(K.x,K.y,K.z),Le.push(J.x,J.y,J.z)}return new jr(Le,Ne)}function Z(_e,ye){let Se=[];for(let Ne=0,Le=0,nt=_e.length;Ne<nt;Ne+=3,Le++)X.fromArray(ye,Le*3),Se.push(X.x,X.y,X.z),Se.push(X.x,X.y,X.z),Se.push(X.x,X.y,X.z);return new jr(Se,3)}function te(_e,ye){let Se=[];for(let Ne=0,Le=0,nt=_e.length;Ne<nt;Ne+=2,Le++)X.fromArray(ye,Le*3),Se.push(X.x,X.y,X.z),Se.push(X.x,X.y,X.z);return new jr(Se,3)}function ie(_e,ye){let{array:Se,itemSize:Ne}=ye,Le=new Se.constructor(_e.length*Ne),nt=0,dt=0;for(let rt=0,pt=_e.length;rt<pt;rt++){nt=_e[rt]*Ne;for(let ct=0;ct<Ne;ct++)Le[dt++]=Se[nt++]}return new jr(Le,Ne)}let ce=new Dt,ue=new Dt;function de(_e,ye,Se){let Ne=[],Le={};for(let dt=0,rt=_e.length;dt<rt;dt+=3){let pt=_e[dt],ct=_e[dt+1],Ct=_e[dt+2],kt=new sYn(pt,ct,Ct);if(X.fromArray(ye,pt*3),K.fromArray(ye,ct*3),J.fromArray(ye,Ct*3),ue.subVectors(J,K),ce.subVectors(X,K),ue.cross(ce),ue.normalize(),kt.normal.copy(ue),Le[pt]===void 0)Le[pt]=[];if(Le[ct]===void 0)Le[ct]=[];if(Le[Ct]===void 0)Le[Ct]=[];Le[pt].push(kt.normal),Le[ct].push(kt.normal),Le[Ct].push(kt.normal),Ne.push(kt)}let nt=[];for(let dt=0,rt=Ne.length;dt<rt;dt++){let pt=Ne[dt],ct=me(Le[pt.a],pt.normal,Se),Ct=me(Le[pt.b],pt.normal,Se),kt=me(Le[pt.c],pt.normal,Se);X.fromArray(ye,pt.a*3),K.fromArray(ye,pt.b*3),J.fromArray(ye,pt.c*3),nt.push(ct.x,ct.y,ct.z),nt.push(Ct.x,Ct.y,Ct.z),nt.push(kt.x,kt.y,kt.z)}return new jr(nt,3)}function me(_e,ye,Se){let Ne=new Dt;if(Se===0)Ne.copy(ye);else for(let Le=0,nt=_e.length;Le<nt;Le++)if(_e[Le].angleTo(ye)<Se)Ne.add(_e[Le]);return Ne.normalize()}function ge(_e){let ye=[];for(let Se=0,Ne=_e.length;Se<Ne;Se+=3)ye.push(new Do(_e[Se],_e[Se+1],_e[Se+2]));return ye}function xe(_e,ye,Se,Ne,Le){let nt=[],dt=Le===!0?0:Math.PI;for(let Lt=0,Bt=Ne.length;Lt<Bt;Lt++){let xt=Lt===0?0:Se[Lt-1];xt=Le===!0?xt:dt-xt;let Yt=new Dt;Yt.setFromSphericalCoords(ye,xt,0),nt.push(Yt)}let rt=_e.index,pt=_e.attributes.position,ct=new ol(new Float32Array(_e.attributes.position.count*3),3),Ct=new Dt,kt=new Do;for(let Lt=0;Lt<rt.count;Lt++){let Bt=rt.getX(Lt);Ct.fromBufferAttribute(pt,Bt);let xt,Yt,ut=1;for(let tt=1;tt<nt.length;tt++){xt=tt-1,Yt=tt;let Je=nt[xt],$e=nt[Yt];if(Le===!0){if(Ct.y<=Je.y&&Ct.y>$e.y){ut=Math.abs(Je.y-Ct.y)/Math.abs(Je.y-$e.y);break}}else if(Ct.y>=Je.y&&Ct.y<$e.y){ut=Math.abs(Je.y-Ct.y)/Math.abs(Je.y-$e.y);break}}let Ze=Ne[xt],Fe=Ne[Yt];kt.copy(Ze).lerp(Fe,ut),ct.setXYZ(Bt,kt.r,kt.g,kt.b)}_e.setAttribute("color",ct)}let Ee=new Bz(this.manager);if(Ee.setPath(this.resourcePath||t).setCrossOrigin(this.crossOrigin),e.indexOf("#VRML V2.0")===-1)throw Error("THREE.VRMLLexer: Version of VRML asset not supported.");let Re=o(e);return s(Re)}}class rYn{constructor(e){this.lexer=new H0e(e)}lex(e){let t=this.lexer.tokenize(e);if(t.errors.length>0)throw console.error(t.errors),Error("THREE.VRMLLexer: Lexing errors detected.");return t}}class iYn extends Uht{constructor(e){super(e);let t=this,{Version:n,LCurly:o,RCurly:r,LSquare:i,RSquare:s,Identifier:a,RouteIdentifier:c,StringLiteral:l,HexLiteral:h,NumberLiteral:d,TrueLiteral:u,FalseLiteral:_,NullLiteral:p,DEF:m,USE:A,ROUTE:g,TO:f,NodeName:y}=e;t.RULE("vrml",function(){t.SUBRULE(t.version),t.AT_LEAST_ONE(function(){t.SUBRULE(t.node)}),t.MANY(function(){t.SUBRULE(t.route)})}),t.RULE("version",function(){t.CONSUME(n)}),t.RULE("node",function(){t.OPTION(function(){t.SUBRULE(t.def)}),t.CONSUME(y),t.CONSUME(o),t.MANY(function(){t.SUBRULE(t.field)}),t.CONSUME(r)}),t.RULE("field",function(){t.CONSUME(a),t.OR2([{ALT:function(){t.SUBRULE(t.singleFieldValue)}},{ALT:function(){t.SUBRULE(t.multiFieldValue)}}])}),t.RULE("def",function(){t.CONSUME(m),t.OR([{ALT:function(){t.CONSUME(a)}},{ALT:function(){t.CONSUME(y)}}])}),t.RULE("use",function(){t.CONSUME(A),t.OR([{ALT:function(){t.CONSUME(a)}},{ALT:function(){t.CONSUME(y)}}])}),t.RULE("singleFieldValue",function(){t.AT_LEAST_ONE(function(){t.OR([{ALT:function(){t.SUBRULE(t.node)}},{ALT:function(){t.SUBRULE(t.use)}},{ALT:function(){t.CONSUME(l)}},{ALT:function(){t.CONSUME(h)}},{ALT:function(){t.CONSUME(d)}},{ALT:function(){t.CONSUME(u)}},{ALT:function(){t.CONSUME(_)}},{ALT:function(){t.CONSUME(p)}}])})}),t.RULE("multiFieldValue",function(){t.CONSUME(i),t.MANY(function(){t.OR([{ALT:function(){t.SUBRULE(t.node)}},{ALT:function(){t.SUBRULE(t.use)}},{ALT:function(){t.CONSUME(l)}},{ALT:function(){t.CONSUME(h)}},{ALT:function(){t.CONSUME(d)}},{ALT:function(){t.CONSUME(p)}}])}),t.CONSUME(s)}),t.RULE("route",function(){t.CONSUME(g),t.CONSUME(c),t.CONSUME(f),t.CONSUME2(c)}),this.performSelfAnalysis()}}class sYn{constructor(e,t,n){this.a=e,this.b=t,this.c=n,this.normal=new Dt}}var Y9={INTENSITY:1,INTENSITY_ALPHA:2,RGB:3,RGBA:4};function Wht(e,t){if(t===rEt)return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."),e;if(t===Oie||t===Yye){let n=e.getIndex();if(n===null){let s=[],a=e.getAttribute("position");if(a!==void 0){for(let c=0;c<a.count;c++)s.push(c);e.setIndex(s),n=e.getIndex()}else return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."),e}let o=n.count-2,r=[];if(n)if(t===Oie)for(let s=1;s<=o;s++)r.push(n.getX(0)),r.push(n.getX(s)),r.push(n.getX(s+1));else for(let s=0;s<o;s++)if(s%2===0)r.push(n.getX(s)),r.push(n.getX(s+1)),r.push(n.getX(s+2));else r.push(n.getX(s+2)),r.push(n.getX(s+1)),r.push(n.getX(s));if(r.length/3!==o)console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unable to generate correct amount of triangles.");let i=e.clone();return i.setIndex(r),i.clearGroups(),i}else return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unknown draw mode:",t),e}var dG="srgb",NB="srgb-linear",aYn=3001,GSi=3000;class APe extends S2{constructor(e){super(e);this.dracoLoader=null,this.ktx2Loader=null,this.meshoptDecoder=null,this.pluginCallbacks=[],this.register(function(t){return new _Yn(t)}),this.register(function(t){return new gYn(t)}),this.register(function(t){return new SYn(t)}),this.register(function(t){return new PYn(t)}),this.register(function(t){return new EYn(t)}),this.register(function(t){return new fYn(t)}),this.register(function(t){return new yYn(t)}),this.register(function(t){return new xYn(t)}),this.register(function(t){return new CYn(t)}),this.register(function(t){return new mYn(t)}),this.register(function(t){return new bYn(t)}),this.register(function(t){return new AYn(t)}),this.register(function(t){return new vYn(t)}),this.register(function(t){return new IYn(t)}),this.register(function(t){return new uYn(t)}),this.register(function(t){return new MYn(t)}),this.register(function(t){return new wYn(t)})}load(e,t,n,o){let r=this,i;if(this.resourcePath!=="")i=this.resourcePath;else if(this.path!==""){let c=YI.extractUrlBase(e);i=YI.resolveURL(c,this.path)}else i=YI.extractUrlBase(e);this.manager.itemStart(e);let s=function(c){if(o)o(c);else console.error(c);r.manager.itemError(e),r.manager.itemEnd(e)},a=new GC(this.manager);a.setPath(this.path),a.setResponseType("arraybuffer"),a.setRequestHeader(this.requestHeader),a.setWithCredentials(this.withCredentials),a.load(e,function(c){try{r.parse(c,i,function(l){t(l),r.manager.itemEnd(e)},s)}catch(l){s(l)}},n,s)}setDRACOLoader(e){return this.dracoLoader=e,this}setDDSLoader(){throw Error('THREE.GLTFLoader: "MSFT_texture_dds" no longer supported. Please update to "KHR_texture_basisu".')}setKTX2Loader(e){return this.ktx2Loader=e,this}setMeshoptDecoder(e){return this.meshoptDecoder=e,this}register(e){if(this.pluginCallbacks.indexOf(e)===-1)this.pluginCallbacks.push(e);return this}unregister(e){if(this.pluginCallbacks.indexOf(e)!==-1)this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(e),1);return this}parse(e,t,n,o){let r,i={},s={};if(typeof e==="string")r=JSON.parse(e);else if(e instanceof ArrayBuffer)if(lG(new Uint8Array(e.slice(0,4)))===BYn){try{i[Pc.KHR_BINARY_GLTF]=new TYn(e)}catch(l){if(o)o(l);return}r=JSON.parse(i[Pc.KHR_BINARY_GLTF].content)}else r=JSON.parse(lG(new Uint8Array(e)));else r=e;if(r.asset===void 0||r.asset.version[0]<2){if(o)o(Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported."));return}let a=new kYn(r,{path:t||this.resourcePath||"",crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});a.fileLoader.setRequestHeader(this.requestHeader);for(let c=0;c<this.pluginCallbacks.length;c++){let l=this.pluginCallbacks[c](a);if(!l.name)console.error("THREE.GLTFLoader: Invalid plugin found: missing name");s[l.name]=l,i[l.name]=!0}if(r.extensionsUsed)for(let c=0;c<r.extensionsUsed.length;++c){let l=r.extensionsUsed[c],h=r.extensionsRequired||[];switch(l){case Pc.KHR_MATERIALS_UNLIT:i[l]=new pYn;break;case Pc.KHR_DRACO_MESH_COMPRESSION:i[l]=new DYn(r,this.dracoLoader);break;case Pc.KHR_TEXTURE_TRANSFORM:i[l]=new NYn;break;case Pc.KHR_MESH_QUANTIZATION:i[l]=new RYn;break;default:if(h.indexOf(l)>=0&&s[l]===void 0)console.warn('THREE.GLTFLoader: Unknown extension "'+l+'".')}}a.setExtensions(i),a.setPlugins(s),a.parse(n,o)}parseAsync(e,t){let n=this;return new Promise(function(o,r){n.parse(e,t,o,r)})}}function USi(){let e={};return{get:function(t){return e[t]},add:function(t,n){e[t]=n},remove:function(t){delete e[t]},removeAll:function(){e={}}}}var Pc={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_DRACO_MESH_COMPRESSION:"KHR_draco_mesh_compression",KHR_LIGHTS_PUNCTUAL:"KHR_lights_punctual",KHR_MATERIALS_CLEARCOAT:"KHR_materials_clearcoat",KHR_MATERIALS_DISPERSION:"KHR_materials_dispersion",KHR_MATERIALS_IOR:"KHR_materials_ior",KHR_MATERIALS_SHEEN:"KHR_materials_sheen",KHR_MATERIALS_SPECULAR:"KHR_materials_specular",KHR_MATERIALS_TRANSMISSION:"KHR_materials_transmission",KHR_MATERIALS_IRIDESCENCE:"KHR_materials_iridescence",KHR_MATERIALS_ANISOTROPY:"KHR_materials_anisotropy",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",KHR_MATERIALS_VOLUME:"KHR_materials_volume",KHR_TEXTURE_BASISU:"KHR_texture_basisu",KHR_TEXTURE_TRANSFORM:"KHR_texture_transform",KHR_MESH_QUANTIZATION:"KHR_mesh_quantization",KHR_MATERIALS_EMISSIVE_STRENGTH:"KHR_materials_emissive_strength",EXT_MATERIALS_BUMP:"EXT_materials_bump",EXT_TEXTURE_WEBP:"EXT_texture_webp",EXT_TEXTURE_AVIF:"EXT_texture_avif",EXT_MESHOPT_COMPRESSION:"EXT_meshopt_compression",EXT_MESH_GPU_INSTANCING:"EXT_mesh_gpu_instancing"};class uYn{constructor(e){this.parser=e,this.name=Pc.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){let e=this.parser,t=this.parser.json.nodes||[];for(let n=0,o=t.length;n<o;n++){let r=t[n];if(r.extensions&&r.extensions[this.name]&&r.extensions[this.name].light!==void 0)e._addNodeRef(this.cache,r.extensions[this.name].light)}}_loadLight(e){let t=this.parser,n="light:"+e,o=t.cache.get(n);if(o)return o;let r=t.json,a=((r.extensions&&r.extensions[this.name]||{}).lights||[])[e],c,l=new Do(16777215);if(a.color!==void 0)l.setRGB(a.color[0],a.color[1],a.color[2],NB);let h=a.range!==void 0?a.range:0;switch(a.type){case"directional":c=new Xie(l),c.target.position.set(0,0,-1),c.add(c.target);break;case"point":c=new Wie(l),c.distance=h;break;case"spot":c=new DOe(l),c.distance=h,a.spot=a.spot||{},a.spot.innerConeAngle=a.spot.innerConeAngle!==void 0?a.spot.innerConeAngle:0,a.spot.outerConeAngle=a.spot.outerConeAngle!==void 0?a.spot.outerConeAngle:Math.PI/4,c.angle=a.spot.outerConeAngle,c.penumbra=1-a.spot.innerConeAngle/a.spot.outerConeAngle,c.target.position.set(0,0,-1),c.add(c.target);break;default:throw Error("THREE.GLTFLoader: Unexpected light type: "+a.type)}if(c.position.set(0,0,0),c.decay=2,DB(c,a),a.intensity!==void 0)c.intensity=a.intensity;return c.name=t.createUniqueName(a.name||"light_"+e),o=Promise.resolve(c),t.cache.add(n,o),o}getDependency(e,t){if(e!=="light")return;return this._loadLight(t)}createNodeAttachment(e){let t=this,n=this.parser,r=n.json.nodes[e],s=(r.extensions&&r.extensions[this.name]||{}).light;if(s===void 0)return null;return this._loadLight(s).then(function(a){return n._getNodeRef(t.cache,s,a)})}}class pYn{constructor(){this.name=Pc.KHR_MATERIALS_UNLIT}getMaterialType(){return lA}extendParams(e,t,n){let o=[];e.color=new Do(1,1,1),e.opacity=1;let r=t.pbrMetallicRoughness;if(r){if(Array.isArray(r.baseColorFactor)){let i=r.baseColorFactor;e.color.setRGB(i[0],i[1],i[2],NB),e.opacity=i[3]}if(r.baseColorTexture!==void 0)o.push(n.assignTexture(e,"map",r.baseColorTexture,dG))}return Promise.all(o)}}class mYn{constructor(e){this.parser=e,this.name=Pc.KHR_MATERIALS_EMISSIVE_STRENGTH}extendMaterialParams(e,t){let o=this.parser.json.materials[e];if(!o.extensions||!o.extensions[this.name])return Promise.resolve();let r=o.extensions[this.name].emissiveStrength;if(r!==void 0)t.emissiveIntensity=r;return Promise.resolve()}}class _Yn{constructor(e){this.parser=e,this.name=Pc.KHR_MATERIALS_CLEARCOAT}getMaterialType(e){let n=this.parser.json.materials[e];if(!n.extensions||!n.extensions[this.name])return null;return hA}extendMaterialParams(e,t){let n=this.parser,o=n.json.materials[e];if(!o.extensions||!o.extensions[this.name])return Promise.resolve();let r=[],i=o.extensions[this.name];if(i.clearcoatFactor!==void 0)t.clearcoat=i.clearcoatFactor;if(i.clearcoatTexture!==void 0)r.push(n.assignTexture(t,"clearcoatMap",i.clearcoatTexture));if(i.clearcoatRoughnessFactor!==void 0)t.clearcoatRoughness=i.clearcoatRoughnessFactor;if(i.clearcoatRoughnessTexture!==void 0)r.push(n.assignTexture(t,"clearcoatRoughnessMap",i.clearcoatRoughnessTexture));if(i.clearcoatNormalTexture!==void 0){if(r.push(n.assignTexture(t,"clearcoatNormalMap",i.clearcoatNormalTexture)),i.clearcoatNormalTexture.scale!==void 0){let s=i.clearcoatNormalTexture.scale;t.clearcoatNormalScale=new go(s,s)}}return Promise.all(r)}}class gYn{constructor(e){this.parser=e,this.name=Pc.KHR_MATERIALS_DISPERSION}getMaterialType(e){let n=this.parser.json.materials[e];if(!n.extensions||!n.extensions[this.name])return null;return hA}extendMaterialParams(e,t){let o=this.parser.json.materials[e];if(!o.extensions||!o.extensions[this.name])return Promise.resolve();let r=o.extensions[this.name];return t.dispersion=r.dispersion!==void 0?r.dispersion:0,Promise.resolve()}}class AYn{constructor(e){this.parser=e,this.name=Pc.KHR_MATERIALS_IRIDESCENCE}getMaterialType(e){let n=this.parser.json.materials[e];if(!n.extensions||!n.extensions[this.name])return null;return hA}extendMaterialParams(e,t){let n=this.parser,o=n.json.materials[e];if(!o.extensions||!o.extensions[this.name])return Promise.resolve();let r=[],i=o.extensions[this.name];if(i.iridescenceFactor!==void 0)t.iridescence=i.iridescenceFactor;if(i.iridescenceTexture!==void 0)r.push(n.assignTexture(t,"iridescenceMap",i.iridescenceTexture));if(i.iridescenceIor!==void 0)t.iridescenceIOR=i.iridescenceIor;if(t.iridescenceThicknessRange===void 0)t.iridescenceThicknessRange=[100,400];if(i.iridescenceThicknessMinimum!==void 0)t.iridescenceThicknessRange[0]=i.iridescenceThicknessMinimum;if(i.iridescenceThicknessMaximum!==void 0)t.iridescenceThicknessRange[1]=i.iridescenceThicknessMaximum;if(i.iridescenceThicknessTexture!==void 0)r.push(n.assignTexture(t,"iridescenceThicknessMap",i.iridescenceThicknessTexture));return Promise.all(r)}}class fYn{constructor(e){this.parser=e,this.name=Pc.KHR_MATERIALS_SHEEN}getMaterialType(e){let n=this.parser.json.materials[e];if(!n.extensions||!n.extensions[this.name])return null;return hA}extendMaterialParams(e,t){let n=this.parser,o=n.json.materials[e];if(!o.extensions||!o.extensions[this.name])return Promise.resolve();let r=[];t.sheenColor=new Do(0,0,0),t.sheenRoughness=0,t.sheen=1;let i=o.extensions[this.name];if(i.sheenColorFactor!==void 0){let s=i.sheenColorFactor;t.sheenColor.setRGB(s[0],s[1],s[2],NB)}if(i.sheenRoughnessFactor!==void 0)t.sheenRoughness=i.sheenRoughnessFactor;if(i.sheenColorTexture!==void 0)r.push(n.assignTexture(t,"sheenColorMap",i.sheenColorTexture,dG));if(i.sheenRoughnessTexture!==void 0)r.push(n.assignTexture(t,"sheenRoughnessMap",i.sheenRoughnessTexture));return Promise.all(r)}}class yYn{constructor(e){this.parser=e,this.name=Pc.KHR_MATERIALS_TRANSMISSION}getMaterialType(e){let n=this.parser.json.materials[e];if(!n.extensions||!n.extensions[this.name])return null;return hA}extendMaterialParams(e,t){let n=this.parser,o=n.json.materials[e];if(!o.extensions||!o.extensions[this.name])return Promise.resolve();let r=[],i=o.extensions[this.name];if(i.transmissionFactor!==void 0)t.transmission=i.transmissionFactor;if(i.transmissionTexture!==void 0)r.push(n.assignTexture(t,"transmissionMap",i.transmissionTexture));return Promise.all(r)}}class xYn{constructor(e){this.parser=e,this.name=Pc.KHR_MATERIALS_VOLUME}getMaterialType(e){let n=this.parser.json.materials[e];if(!n.extensions||!n.extensions[this.name])return null;return hA}extendMaterialParams(e,t){let n=this.parser,o=n.json.materials[e];if(!o.extensions||!o.extensions[this.name])return Promise.resolve();let r=[],i=o.extensions[this.name];if(t.thickness=i.thicknessFactor!==void 0?i.thicknessFactor:0,i.thicknessTexture!==void 0)r.push(n.assignTexture(t,"thicknessMap",i.thicknessTexture));t.attenuationDistance=i.attenuationDistance||1/0;let s=i.attenuationColor||[1,1,1];return t.attenuationColor=new Do().setRGB(s[0],s[1],s[2],NB),Promise.all(r)}}class CYn{constructor(e){this.parser=e,this.name=Pc.KHR_MATERIALS_IOR}getMaterialType(e){let n=this.parser.json.materials[e];if(!n.extensions||!n.extensions[this.name])return null;return hA}extendMaterialParams(e,t){let o=this.parser.json.materials[e];if(!o.extensions||!o.extensions[this.name])return Promise.resolve();let r=o.extensions[this.name];return t.ior=r.ior!==void 0?r.ior:1.5,Promise.resolve()}}class bYn{constructor(e){this.parser=e,this.name=Pc.KHR_MATERIALS_SPECULAR}getMaterialType(e){let n=this.parser.json.materials[e];if(!n.extensions||!n.extensions[this.name])return null;return hA}extendMaterialParams(e,t){let n=this.parser,o=n.json.materials[e];if(!o.extensions||!o.extensions[this.name])return Promise.resolve();let r=[],i=o.extensions[this.name];if(t.specularIntensity=i.specularFactor!==void 0?i.specularFactor:1,i.specularTexture!==void 0)r.push(n.assignTexture(t,"specularIntensityMap",i.specularTexture));let s=i.specularColorFactor||[1,1,1];if(t.specularColor=new Do().setRGB(s[0],s[1],s[2],NB),i.specularColorTexture!==void 0)r.push(n.assignTexture(t,"specularColorMap",i.specularColorTexture,dG));return Promise.all(r)}}class IYn{constructor(e){this.parser=e,this.name=Pc.EXT_MATERIALS_BUMP}getMaterialType(e){let n=this.parser.json.materials[e];if(!n.extensions||!n.extensions[this.name])return null;return hA}extendMaterialParams(e,t){let n=this.parser,o=n.json.materials[e];if(!o.extensions||!o.extensions[this.name])return Promise.resolve();let r=[],i=o.extensions[this.name];if(t.bumpScale=i.bumpFactor!==void 0?i.bumpFactor:1,i.bumpTexture!==void 0)r.push(n.assignTexture(t,"bumpMap",i.bumpTexture));return Promise.all(r)}}class vYn{constructor(e){this.parser=e,this.name=Pc.KHR_MATERIALS_ANISOTROPY}getMaterialType(e){let n=this.parser.json.materials[e];if(!n.extensions||!n.extensions[this.name])return null;return hA}extendMaterialParams(e,t){let n=this.parser,o=n.json.materials[e];if(!o.extensions||!o.extensions[this.name])return Promise.resolve();let r=[],i=o.extensions[this.name];if(i.anisotropyStrength!==void 0)t.anisotropy=i.anisotropyStrength;if(i.anisotropyRotation!==void 0)t.anisotropyRotation=i.anisotropyRotation;if(i.anisotropyTexture!==void 0)r.push(n.assignTexture(t,"anisotropyMap",i.anisotropyTexture));return Promise.all(r)}}class SYn{constructor(e){this.parser=e,this.name=Pc.KHR_TEXTURE_BASISU}loadTexture(e){let t=this.parser,n=t.json,o=n.textures[e];if(!o.extensions||!o.extensions[this.name])return null;let r=o.extensions[this.name],i=t.options.ktx2Loader;if(!i)if(n.extensionsRequired&&n.extensionsRequired.indexOf(this.name)>=0)throw Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");else return null;return t.loadTextureImage(e,r.source,i)}}class PYn{constructor(e){this.parser=e,this.name=Pc.EXT_TEXTURE_WEBP,this.isSupported=null}loadTexture(e){let t=this.name,n=this.parser,o=n.json,r=o.textures[e];if(!r.extensions||!r.extensions[t])return null;let i=r.extensions[t],s=o.images[i.source],a=n.textureLoader;if(s.uri){let c=n.options.manager.getHandler(s.uri);if(c!==null)a=c}return this.detectSupport().then(function(c){if(c)return n.loadTextureImage(e,i.source,a);if(o.extensionsRequired&&o.extensionsRequired.indexOf(t)>=0)throw Error("THREE.GLTFLoader: WebP required by asset but unsupported.");return n.loadTexture(e)})}detectSupport(){if(!this.isSupported)this.isSupported=new Promise(function(e){let t=new Image;t.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA",t.onload=t.onerror=function(){e(t.height===1)}});return this.isSupported}}class EYn{constructor(e){this.parser=e,this.name=Pc.EXT_TEXTURE_AVIF,this.isSupported=null}loadTexture(e){let t=this.name,n=this.parser,o=n.json,r=o.textures[e];if(!r.extensions||!r.extensions[t])return null;let i=r.extensions[t],s=o.images[i.source],a=n.textureLoader;if(s.uri){let c=n.options.manager.getHandler(s.uri);if(c!==null)a=c}return this.detectSupport().then(function(c){if(c)return n.loadTextureImage(e,i.source,a);if(o.extensionsRequired&&o.extensionsRequired.indexOf(t)>=0)throw Error("THREE.GLTFLoader: AVIF required by asset but unsupported.");return n.loadTexture(e)})}detectSupport(){if(!this.isSupported)this.isSupported=new Promise(function(e){let t=new Image;t.src="data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAABcAAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAEAAAABAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQAMAAAAABNjb2xybmNseAACAAIABoAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAAB9tZGF0EgAKCBgABogQEDQgMgkQAAAAB8dSLfI=",t.onload=t.onerror=function(){e(t.height===1)}});return this.isSupported}}class MYn{constructor(e){this.name=Pc.EXT_MESHOPT_COMPRESSION,this.parser=e}loadBufferView(e){let t=this.parser.json,n=t.bufferViews[e];if(n.extensions&&n.extensions[this.name]){let o=n.extensions[this.name],r=this.parser.getDependency("buffer",o.buffer),i=this.parser.options.meshoptDecoder;if(!i||!i.supported)if(t.extensionsRequired&&t.extensionsRequired.indexOf(this.name)>=0)throw Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");else return null;return r.then(function(s){let a=o.byteOffset||0,c=o.byteLength||0,{count:l,byteStride:h}=o,d=new Uint8Array(s,a,c);if(i.decodeGltfBufferAsync)return i.decodeGltfBufferAsync(l,h,d,o.mode,o.filter).then(function(u){return u.buffer});else return i.ready.then(function(){let u=new ArrayBuffer(l*h);return i.decodeGltfBuffer(new Uint8Array(u),l,h,d,o.mode,o.filter),u})})}else return null}}class wYn{constructor(e){this.name=Pc.EXT_MESH_GPU_INSTANCING,this.parser=e}createNodeMesh(e){let t=this.parser.json,n=t.nodes[e];if(!n.extensions||!n.extensions[this.name]||n.mesh===void 0)return null;let o=t.meshes[n.mesh];for(let c of o.primitives)if(c.mode!==Yb.TRIANGLES&&c.mode!==Yb.TRIANGLE_STRIP&&c.mode!==Yb.TRIANGLE_FAN&&c.mode!==void 0)return null;let i=n.extensions[this.name].attributes,s=[],a={};for(let c in i)s.push(this.parser.getDependency("accessor",i[c]).then((l)=>(a[c]=l,a[c])));if(s.length<1)return null;return s.push(this.parser.createNodeMesh(e)),Promise.all(s).then((c)=>{let l=c.pop(),h=l.isGroup?l.children:[l],d=c[0].count,u=[];for(let _ of h){let p=new Fi,m=new Dt,A=new hm,g=new Dt(1,1,1),f=new xOe(_.geometry,_.material,d);for(let y=0;y<d;y++){if(a.TRANSLATION)m.fromBufferAttribute(a.TRANSLATION,y);if(a.ROTATION)A.fromBufferAttribute(a.ROTATION,y);if(a.SCALE)g.fromBufferAttribute(a.SCALE,y);f.setMatrixAt(y,p.compose(m,A,g))}for(let y in a)if(y==="_COLOR_0"){let x=a[y];f.instanceColor=new Iz(x.array,x.itemSize,x.normalized)}else if(y!=="TRANSLATION"&&y!=="ROTATION"&&y!=="SCALE")_.geometry.setAttribute(y,a[y]);nl.prototype.copy.call(f,_),this.parser.assignFinalMaterial(f),u.push(f)}if(l.isGroup)return l.clear(),l.add(...u),l;return u[0]})}}var BYn="glTF",F0e=12,cYn={JSON:1313821514,BIN:5130562};class TYn{constructor(e){this.name=Pc.KHR_BINARY_GLTF,this.content=null,this.body=null;let t=new DataView(e,0,F0e);if(this.header={magic:lG(new Uint8Array(e.slice(0,4))),version:t.getUint32(4,!0),length:t.getUint32(8,!0)},this.header.magic!==BYn)throw Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");else if(this.header.version<2)throw Error("THREE.GLTFLoader: Legacy binary file detected.");let n=this.header.length-F0e,o=new DataView(e,F0e),r=0;while(r<n){let i=o.getUint32(r,!0);r+=4;let s=o.getUint32(r,!0);if(r+=4,s===cYn.JSON){let a=new Uint8Array(e,F0e+r,i);this.content=lG(a)}else if(s===cYn.BIN){let a=F0e+r;this.body=e.slice(a,a+i)}r+=i}if(this.content===null)throw Error("THREE.GLTFLoader: JSON content not found.")}}class DYn{constructor(e,t){if(!t)throw Error("THREE.GLTFLoader: No DRACOLoader instance provided.");this.name=Pc.KHR_DRACO_MESH_COMPRESSION,this.json=e,this.dracoLoader=t,this.dracoLoader.preload()}decodePrimitive(e,t){let n=this.json,o=this.dracoLoader,r=e.extensions[this.name].bufferView,i=e.extensions[this.name].attributes,s={},a={},c={};for(let l in i){let h=$ht[l]||l.toLowerCase();s[h]=i[l]}for(let l in e.attributes){let h=$ht[l]||l.toLowerCase();if(i[l]!==void 0){let d=n.accessors[e.attributes[l]],u=wee[d.componentType];c[h]=u.name,a[h]=d.normalized===!0}}return t.getDependency("bufferView",r).then(function(l){return new Promise(function(h,d){o.decodeDracoFile(l,function(u){for(let _ in u.attributes){let p=u.attributes[_],m=a[_];if(m!==void 0)p.normalized=m}h(u)},s,c,NB,d)})})}}class NYn{constructor(){this.name=Pc.KHR_TEXTURE_TRANSFORM}extendTexture(e,t){if((t.texCoord===void 0||t.texCoord===e.channel)&&t.offset===void 0&&t.rotation===void 0&&t.scale===void 0)return e;if(e=e.clone(),t.texCoord!==void 0)e.channel=t.texCoord;if(t.offset!==void 0)e.offset.fromArray(t.offset);if(t.rotation!==void 0)e.rotation=t.rotation;if(t.scale!==void 0)e.repeat.fromArray(t.scale);return e.needsUpdate=!0,e}}class RYn{constructor(){this.name=Pc.KHR_MESH_QUANTIZATION}}class Jht extends Ez{constructor(e,t,n,o){super(e,t,n,o)}copySampleValue_(e){let t=this.resultBuffer,n=this.sampleValues,o=this.valueSize,r=e*o*3+o;for(let i=0;i!==o;i++)t[i]=n[r+i];return t}interpolate_(e,t,n,o){let r=this.resultBuffer,i=this.sampleValues,s=this.valueSize,a=s*2,c=s*3,l=o-t,h=(n-t)/l,d=h*h,u=d*h,_=e*c,p=_-c,m=-2*u+3*d,A=u-d,g=1-m,f=A-d+h;for(let y=0;y!==s;y++){let x=i[p+y+s],C=i[p+y+a]*l,b=i[_+y+s],I=i[_+y]*l;r[y]=g*x+f*C+m*b+A*I}return r}}var WSi=new hm;class QYn extends Jht{interpolate_(e,t,n,o){let r=super.interpolate_(e,t,n,o);return WSi.fromArray(r).normalize().toArray(r),r}}var Yb={FLOAT:5126,FLOAT_MAT3:35675,FLOAT_MAT4:35676,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,LINEAR:9729,REPEAT:10497,SAMPLER_2D:35678,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,UNSIGNED_BYTE:5121,UNSIGNED_SHORT:5123},wee={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},lYn={9728:Hye,9729:uc,9984:Fye,9985:Oye,9986:zye,9987:Pd},hYn={33071:VC,33648:Lye,10497:x4},Xht={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},$ht={POSITION:"position",NORMAL:"normal",TANGENT:"tangent",...dPe>=152?{TEXCOORD_0:"uv",TEXCOORD_1:"uv1",TEXCOORD_2:"uv2",TEXCOORD_3:"uv3"}:{TEXCOORD_0:"uv",TEXCOORD_1:"uv2"},COLOR_0:"color",WEIGHTS_0:"skinWeight",JOINTS_0:"skinIndex"},iL={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},XSi={CUBICSPLINE:void 0,LINEAR:zie,STEP:Vye},jht={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"};function jSi(e){if(e.DefaultMaterial===void 0)e.DefaultMaterial=new Ls({color:16777215,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:h7});return e.DefaultMaterial}function hG(e,t,n){for(let o in n.extensions)if(e[o]===void 0)t.userData.gltfExtensions=t.userData.gltfExtensions||{},t.userData.gltfExtensions[o]=n.extensions[o]}function DB(e,t){if(t.extras!==void 0)if(typeof t.extras==="object")Object.assign(e.userData,t.extras);else console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, "+t.extras)}function KSi(e,t,n){let o=!1,r=!1,i=!1;for(let l=0,h=t.length;l<h;l++){let d=t[l];if(d.POSITION!==void 0)o=!0;if(d.NORMAL!==void 0)r=!0;if(d.COLOR_0!==void 0)i=!0;if(o&&r&&i)break}if(!o&&!r&&!i)return Promise.resolve(e);let s=[],a=[],c=[];for(let l=0,h=t.length;l<h;l++){let d=t[l];if(o){let u=d.POSITION!==void 0?n.getDependency("accessor",d.POSITION):e.attributes.position;s.push(u)}if(r){let u=d.NORMAL!==void 0?n.getDependency("accessor",d.NORMAL):e.attributes.normal;a.push(u)}if(i){let u=d.COLOR_0!==void 0?n.getDependency("accessor",d.COLOR_0):e.attributes.color;c.push(u)}}return Promise.all([Promise.all(s),Promise.all(a),Promise.all(c)]).then(function(l){let h=l[0],d=l[1],u=l[2];if(o)e.morphAttributes.position=h;if(r)e.morphAttributes.normal=d;if(i)e.morphAttributes.color=u;return e.morphTargetsRelative=!0,e})}function $Si(e,t){if(e.updateMorphTargets(),t.weights!==void 0)for(let n=0,o=t.weights.length;n<o;n++)e.morphTargetInfluences[n]=t.weights[n];if(t.extras&&Array.isArray(t.extras.targetNames)){let n=t.extras.targetNames;if(e.morphTargetInfluences.length===n.length){e.morphTargetDictionary={};for(let o=0,r=n.length;o<r;o++)e.morphTargetDictionary[n[o]]=o}else console.warn("THREE.GLTFLoader: Invalid extras.targetNames length. Ignoring names.")}}function qSi(e){let t,n=e.extensions&&e.extensions[Pc.KHR_DRACO_MESH_COMPRESSION];if(n)t="draco:"+n.bufferView+":"+n.indices+":"+Kht(n.attributes);else t=e.indices+":"+Kht(e.attributes)+":"+e.mode;if(e.targets!==void 0)for(let o=0,r=e.targets.length;o<r;o++)t+=":"+Kht(e.targets[o]);return t}function Kht(e){let t="",n=Object.keys(e).sort();for(let o=0,r=n.length;o<r;o++)t+=n[o]+":"+e[n[o]]+";";return t}function qht(e){switch(e){case Int8Array:return 0.007874015748031496;case Uint8Array:return 0.00392156862745098;case Int16Array:return 0.00003051850947599719;case Uint16Array:return 0.000015259021896696422;default:throw Error("THREE.GLTFLoader: Unsupported normalized accessor component type.")}}function JSi(e){if(e.search(/\.jpe?g($|\?)/i)>0||e.search(/^data\:image\/jpeg/)===0)return"image/jpeg";if(e.search(/\.webp($|\?)/i)>0||e.search(/^data\:image\/webp/)===0)return"image/webp";return"image/png"}var ZSi=new Fi;class kYn{constructor(e={},t={}){this.json=e,this.extensions={},this.plugins={},this.options=t,this.cache=new USi,this.associations=new Map,this.primitiveCache={},this.nodeCache={},this.meshCache={refs:{},uses:{}},this.cameraCache={refs:{},uses:{}},this.lightCache={refs:{},uses:{}},this.sourceCache={},this.textureCache={},this.nodeNamesUsed={};let n=!1,o=!1,r=-1;if(typeof navigator<"u"&&typeof navigator.userAgent<"u")n=/^((?!chrome|android).)*safari/i.test(navigator.userAgent)===!0,o=navigator.userAgent.indexOf("Firefox")>-1,r=o?navigator.userAgent.match(/Firefox\/([0-9]+)\./)[1]:-1;if(typeof createImageBitmap>"u"||n||o&&r<98)this.textureLoader=new Bz(this.options.manager);else this.textureLoader=new ROe(this.options.manager);if(this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new GC(this.options.manager),this.fileLoader.setResponseType("arraybuffer"),this.options.crossOrigin==="use-credentials")this.fileLoader.setWithCredentials(!0)}setExtensions(e){this.extensions=e}setPlugins(e){this.plugins=e}parse(e,t){let n=this,o=this.json,r=this.extensions;this.cache.removeAll(),this.nodeCache={},this._invokeAll(function(i){return i._markDefs&&i._markDefs()}),Promise.all(this._invokeAll(function(i){return i.beforeRoot&&i.beforeRoot()})).then(function(){return Promise.all([n.getDependencies("scene"),n.getDependencies("animation"),n.getDependencies("camera")])}).then(function(i){let s={scene:i[0][o.scene||0],scenes:i[0],animations:i[1],cameras:i[2],asset:o.asset,parser:n,userData:{}};return hG(r,s,o),DB(s,o),Promise.all(n._invokeAll(function(a){return a.afterRoot&&a.afterRoot(s)})).then(function(){for(let a of s.scenes)a.updateMatrixWorld();e(s)})}).catch(t)}_markDefs(){let e=this.json.nodes||[],t=this.json.skins||[],n=this.json.meshes||[];for(let o=0,r=t.length;o<r;o++){let i=t[o].joints;for(let s=0,a=i.length;s<a;s++)e[i[s]].isBone=!0}for(let o=0,r=e.length;o<r;o++){let i=e[o];if(i.mesh!==void 0){if(this._addNodeRef(this.meshCache,i.mesh),i.skin!==void 0)n[i.mesh].isSkinnedMesh=!0}if(i.camera!==void 0)this._addNodeRef(this.cameraCache,i.camera)}}_addNodeRef(e,t){if(t===void 0)return;if(e.refs[t]===void 0)e.refs[t]=e.uses[t]=0;e.refs[t]++}_getNodeRef(e,t,n){if(e.refs[t]<=1)return n;let o=n.clone(),r=(i,s)=>{let a=this.associations.get(i);if(a!=null)this.associations.set(s,a);for(let[c,l]of i.children.entries())r(l,s.children[c])};return r(n,o),o.name+="_instance_"+e.uses[t]++,o}_invokeOne(e){let t=Object.values(this.plugins);t.push(this);for(let n=0;n<t.length;n++){let o=e(t[n]);if(o)return o}return null}_invokeAll(e){let t=Object.values(this.plugins);t.unshift(this);let n=[];for(let o=0;o<t.length;o++){let r=e(t[o]);if(r)n.push(r)}return n}getDependency(e,t){let n=e+":"+t,o=this.cache.get(n);if(!o){switch(e){case"scene":o=this.loadScene(t);break;case"node":o=this._invokeOne(function(r){return r.loadNode&&r.loadNode(t)});break;case"mesh":o=this._invokeOne(function(r){return r.loadMesh&&r.loadMesh(t)});break;case"accessor":o=this.loadAccessor(t);break;case"bufferView":o=this._invokeOne(function(r){return r.loadBufferView&&r.loadBufferView(t)});break;case"buffer":o=this.loadBuffer(t);break;case"material":o=this._invokeOne(function(r){return r.loadMaterial&&r.loadMaterial(t)});break;case"texture":o=this._invokeOne(function(r){return r.loadTexture&&r.loadTexture(t)});break;case"skin":o=this.loadSkin(t);break;case"animation":o=this._invokeOne(function(r){return r.loadAnimation&&r.loadAnimation(t)});break;case"camera":o=this.loadCamera(t);break;default:if(o=this._invokeOne(function(r){return r!=this&&r.getDependency&&r.getDependency(e,t)}),!o)throw Error("Unknown type: "+e);break}this.cache.add(n,o)}return o}getDependencies(e){let t=this.cache.get(e);if(!t){let n=this,o=this.json[e+(e==="mesh"?"es":"s")]||[];t=Promise.all(o.map(function(r,i){return n.getDependency(e,i)})),this.cache.add(e,t)}return t}loadBuffer(e){let t=this.json.buffers[e],n=this.fileLoader;if(t.type&&t.type!=="arraybuffer")throw Error("THREE.GLTFLoader: "+t.type+" buffer type is not supported.");if(t.uri===void 0&&e===0)return Promise.resolve(this.extensions[Pc.KHR_BINARY_GLTF].body);let o=this.options;return new Promise(function(r,i){n.load(YI.resolveURL(t.uri,o.path),r,void 0,function(){i(Error('THREE.GLTFLoader: Failed to load buffer "'+t.uri+'".'))})})}loadBufferView(e){let t=this.json.bufferViews[e];return this.getDependency("buffer",t.buffer).then(function(n){let o=t.byteLength||0,r=t.byteOffset||0;return n.slice(r,r+o)})}loadAccessor(e){let t=this,n=this.json,o=this.json.accessors[e];if(o.bufferView===void 0&&o.sparse===void 0){let i=Xht[o.type],s=wee[o.componentType],a=o.normalized===!0,c=new s(o.count*i);return Promise.resolve(new ol(c,i,a))}let r=[];if(o.bufferView!==void 0)r.push(this.getDependency("bufferView",o.bufferView));else r.push(null);if(o.sparse!==void 0)r.push(this.getDependency("bufferView",o.sparse.indices.bufferView)),r.push(this.getDependency("bufferView",o.sparse.values.bufferView));return Promise.all(r).then(function(i){let s=i[0],a=Xht[o.type],c=wee[o.componentType],l=c.BYTES_PER_ELEMENT,h=l*a,d=o.byteOffset||0,u=o.bufferView!==void 0?n.bufferViews[o.bufferView].byteStride:void 0,_=o.normalized===!0,p,m;if(u&&u!==h){let A=Math.floor(d/u),g="InterleavedBuffer:"+o.bufferView+":"+o.componentType+":"+A+":"+o.count,f=t.cache.get(g);if(!f)p=new c(s,A*u,o.count*u/l),f=new $ye(p,u/l),t.cache.add(g,f);m=new Yie(f,a,d%u/l,_)}else{if(s===null)p=new c(o.count*a);else p=new c(s,d,o.count*a);m=new ol(p,a,_)}if(o.sparse!==void 0){let A=Xht.SCALAR,g=wee[o.sparse.indices.componentType],f=o.sparse.indices.byteOffset||0,y=o.sparse.values.byteOffset||0,x=new g(i[1],f,o.sparse.count*A),C=new c(i[2],y,o.sparse.count*a);if(s!==null)m=new ol(m.array.slice(),m.itemSize,m.normalized);for(let b=0,I=x.length;b<I;b++){let v=x[b];if(m.setX(v,C[b*a]),a>=2)m.setY(v,C[b*a+1]);if(a>=3)m.setZ(v,C[b*a+2]);if(a>=4)m.setW(v,C[b*a+3]);if(a>=5)throw Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return m})}loadTexture(e){let t=this.json,n=this.options,r=t.textures[e].source,i=t.images[r],s=this.textureLoader;if(i.uri){let a=n.manager.getHandler(i.uri);if(a!==null)s=a}return this.loadTextureImage(e,r,s)}loadTextureImage(e,t,n){let o=this,r=this.json,i=r.textures[e],s=r.images[t],a=(s.uri||s.bufferView)+":"+i.sampler;if(this.textureCache[a])return this.textureCache[a];let c=this.loadImageSource(t,n).then(function(l){if(l.flipY=!1,l.name=i.name||s.name||"",l.name===""&&typeof s.uri==="string"&&s.uri.startsWith("data:image/")===!1)l.name=s.uri;let d=(r.samplers||{})[i.sampler]||{};return l.magFilter=lYn[d.magFilter]||uc,l.minFilter=lYn[d.minFilter]||Pd,l.wrapS=hYn[d.wrapS]||x4,l.wrapT=hYn[d.wrapT]||x4,o.associations.set(l,{textures:e}),l}).catch(function(){return null});return this.textureCache[a]=c,c}loadImageSource(e,t){let n=this,o=this.json,r=this.options;if(this.sourceCache[e]!==void 0)return this.sourceCache[e].then((h)=>h.clone());let i=o.images[e],s=self.URL||self.webkitURL,a=i.uri||"",c=!1;if(i.bufferView!==void 0)a=n.getDependency("bufferView",i.bufferView).then(function(h){c=!0;let d=new Blob([h],{type:i.mimeType});return a=s.createObjectURL(d),a});else if(i.uri===void 0)throw Error("THREE.GLTFLoader: Image "+e+" is missing URI and bufferView");let l=Promise.resolve(a).then(function(h){return new Promise(function(d,u){let _=d;if(t.isImageBitmapLoader===!0)_=function(p){let m=new Bl(p);m.needsUpdate=!0,d(m)};t.load(YI.resolveURL(h,r.path),_,void 0,u)})}).then(function(h){if(c===!0)s.revokeObjectURL(a);return DB(h,i),h.userData.mimeType=i.mimeType||JSi(i.uri),h}).catch(function(h){throw console.error("THREE.GLTFLoader: Couldn't load texture",a),h});return this.sourceCache[e]=l,l}assignTexture(e,t,n,o){let r=this;return this.getDependency("texture",n.index).then(function(i){if(!i)return null;if(n.texCoord!==void 0&&n.texCoord>0)i=i.clone(),i.channel=n.texCoord;if(r.extensions[Pc.KHR_TEXTURE_TRANSFORM]){let s=n.extensions!==void 0?n.extensions[Pc.KHR_TEXTURE_TRANSFORM]:void 0;if(s){let a=r.associations.get(i);i=r.extensions[Pc.KHR_TEXTURE_TRANSFORM].extendTexture(i,s),r.associations.set(i,a)}}if(o!==void 0){if(typeof o==="number")o=o===aYn?dG:NB;if("colorSpace"in i)i.colorSpace=o;else i.encoding=o===dG?aYn:GSi}return e[t]=i,i})}assignFinalMaterial(e){let{geometry:t,material:n}=e,o=t.attributes.tangent===void 0,r=t.attributes.color!==void 0,i=t.attributes.normal===void 0;if(e.isPoints){let s="PointsMaterial:"+n.uuid,a=this.cache.get(s);if(!a)a=new zI,cA.prototype.copy.call(a,n),a.color.copy(n.color),a.map=n.map,a.sizeAttenuation=!1,this.cache.add(s,a);n=a}else if(e.isLine){let s="LineBasicMaterial:"+n.uuid,a=this.cache.get(s);if(!a)a=new YC,cA.prototype.copy.call(a,n),a.color.copy(n.color),a.map=n.map,this.cache.add(s,a);n=a}if(o||r||i){let s="ClonedMaterial:"+n.uuid+":";if(o)s+="derivative-tangents:";if(r)s+="vertex-colors:";if(i)s+="flat-shading:";let a=this.cache.get(s);if(!a){if(a=n.clone(),r)a.vertexColors=!0;if(i)a.flatShading=!0;if(o){if(a.normalScale)a.normalScale.y*=-1;if(a.clearcoatNormalScale)a.clearcoatNormalScale.y*=-1}this.cache.add(s,a),this.associations.set(a,this.associations.get(n))}n=a}e.material=n}getMaterialType(){return Ls}loadMaterial(e){let t=this,n=this.json,o=this.extensions,r=n.materials[e],i,s={},a=r.extensions||{},c=[];if(a[Pc.KHR_MATERIALS_UNLIT]){let h=o[Pc.KHR_MATERIALS_UNLIT];i=h.getMaterialType(),c.push(h.extendParams(s,r,t))}else{let h=r.pbrMetallicRoughness||{};if(s.color=new Do(1,1,1),s.opacity=1,Array.isArray(h.baseColorFactor)){let d=h.baseColorFactor;s.color.setRGB(d[0],d[1],d[2],NB),s.opacity=d[3]}if(h.baseColorTexture!==void 0)c.push(t.assignTexture(s,"map",h.baseColorTexture,dG));if(s.metalness=h.metallicFactor!==void 0?h.metallicFactor:1,s.roughness=h.roughnessFactor!==void 0?h.roughnessFactor:1,h.metallicRoughnessTexture!==void 0)c.push(t.assignTexture(s,"metalnessMap",h.metallicRoughnessTexture)),c.push(t.assignTexture(s,"roughnessMap",h.metallicRoughnessTexture));i=this._invokeOne(function(d){return d.getMaterialType&&d.getMaterialType(e)}),c.push(Promise.all(this._invokeAll(function(d){return d.extendMaterialParams&&d.extendMaterialParams(e,s)})))}if(r.doubleSided===!0)s.side=A0;let l=r.alphaMode||jht.OPAQUE;if(l===jht.BLEND)s.transparent=!0,s.depthWrite=!1;else if(s.transparent=!1,l===jht.MASK)s.alphaTest=r.alphaCutoff!==void 0?r.alphaCutoff:0.5;if(r.normalTexture!==void 0&&i!==lA){if(c.push(t.assignTexture(s,"normalMap",r.normalTexture)),s.normalScale=new go(1,1),r.normalTexture.scale!==void 0){let h=r.normalTexture.scale;s.normalScale.set(h,h)}}if(r.occlusionTexture!==void 0&&i!==lA){if(c.push(t.assignTexture(s,"aoMap",r.occlusionTexture)),r.occlusionTexture.strength!==void 0)s.aoMapIntensity=r.occlusionTexture.strength}if(r.emissiveFactor!==void 0&&i!==lA){let h=r.emissiveFactor;s.emissive=new Do().setRGB(h[0],h[1],h[2],NB)}if(r.emissiveTexture!==void 0&&i!==lA)c.push(t.assignTexture(s,"emissiveMap",r.emissiveTexture,dG));return Promise.all(c).then(function(){let h=new i(s);if(r.name)h.name=r.name;if(DB(h,r),t.associations.set(h,{materials:e}),r.extensions)hG(o,h,r);return h})}createUniqueName(e){let t=Gc.sanitizeNodeName(e||"");if(t in this.nodeNamesUsed)return t+"_"+ ++this.nodeNamesUsed[t];else return this.nodeNamesUsed[t]=0,t}loadGeometries(e){let t=this,n=this.extensions,o=this.primitiveCache;function r(s){return n[Pc.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(s,t).then(function(a){return dYn(a,s,t)})}let i=[];for(let s=0,a=e.length;s<a;s++){let c=e[s],l=qSi(c),h=o[l];if(h)i.push(h.promise);else{let d;if(c.extensions&&c.extensions[Pc.KHR_DRACO_MESH_COMPRESSION])d=r(c);else d=dYn(new ha,c,t);o[l]={primitive:c,promise:d},i.push(d)}}return Promise.all(i)}loadMesh(e){let t=this,n=this.json,o=this.extensions,r=n.meshes[e],i=r.primitives,s=[];for(let a=0,c=i.length;a<c;a++){let l=i[a].material===void 0?jSi(this.cache):this.getDependency("material",i[a].material);s.push(l)}return s.push(t.loadGeometries(i)),Promise.all(s).then(function(a){let c=a.slice(0,a.length-1),l=a[a.length-1],h=[];for(let u=0,_=l.length;u<_;u++){let p=l[u],m=i[u],A,g=c[u];if(m.mode===Yb.TRIANGLES||m.mode===Yb.TRIANGLE_STRIP||m.mode===Yb.TRIANGLE_FAN||m.mode===void 0){if(A=r.isSkinnedMesh===!0?new yOe(p,g):new Qo(p,g),A.isSkinnedMesh===!0)A.normalizeSkinWeights();if(m.mode===Yb.TRIANGLE_STRIP)A.geometry=Wht(A.geometry,Yye);else if(m.mode===Yb.TRIANGLE_FAN)A.geometry=Wht(A.geometry,Oie)}else if(m.mode===Yb.LINES)A=new p7(p,g);else if(m.mode===Yb.LINE_STRIP)A=new Gie(p,g);else if(m.mode===Yb.LINE_LOOP)A=new COe(p,g);else if(m.mode===Yb.POINTS)A=new OM(p,g);else throw Error("THREE.GLTFLoader: Primitive mode unsupported: "+m.mode);if(Object.keys(A.geometry.morphAttributes).length>0)$Si(A,r);if(A.name=t.createUniqueName(r.name||"mesh_"+e),DB(A,r),m.extensions)hG(o,A,m);t.assignFinalMaterial(A),h.push(A)}for(let u=0,_=h.length;u<_;u++)t.associations.set(h[u],{meshes:e,primitives:u});if(h.length===1){if(r.extensions)hG(o,h[0],r);return h[0]}let d=new dc;if(r.extensions)hG(o,d,r);t.associations.set(d,{meshes:e});for(let u=0,_=h.length;u<_;u++)d.add(h[u]);return d})}loadCamera(e){let t,n=this.json.cameras[e],o=n[n.type];if(!o){console.warn("THREE.GLTFLoader: Missing camera parameters.");return}if(n.type==="perspective")t=new wl(d7.radToDeg(o.yfov),o.aspectRatio||1,o.znear||1,o.zfar||2000000);else if(n.type==="orthographic")t=new u7(-o.xmag,o.xmag,o.ymag,-o.ymag,o.znear,o.zfar);if(n.name)t.name=this.createUniqueName(n.name);return DB(t,n),Promise.resolve(t)}loadSkin(e){let t=this.json.skins[e],n=[];for(let o=0,r=t.joints.length;o<r;o++)n.push(this._loadNodeShallow(t.joints[o]));if(t.inverseBindMatrices!==void 0)n.push(this.getDependency("accessor",t.inverseBindMatrices));else n.push(null);return Promise.all(n).then(function(o){let r=o.pop(),i=o,s=[],a=[];for(let c=0,l=i.length;c<l;c++){let h=i[c];if(h){s.push(h);let d=new Fi;if(r!==null)d.fromArray(r.array,c*16);a.push(d)}else console.warn('THREE.GLTFLoader: Joint "%s" could not be found.',t.joints[c])}return new Jye(s,a)})}loadAnimation(e){let t=this.json,n=this,o=t.animations[e],r=o.name?o.name:"animation_"+e,i=[],s=[],a=[],c=[],l=[];for(let h=0,d=o.channels.length;h<d;h++){let u=o.channels[h],_=o.samplers[u.sampler],p=u.target,m=p.node,A=o.parameters!==void 0?o.parameters[_.input]:_.input,g=o.parameters!==void 0?o.parameters[_.output]:_.output;if(p.node===void 0)continue;i.push(this.getDependency("node",m)),s.push(this.getDependency("accessor",A)),a.push(this.getDependency("accessor",g)),c.push(_),l.push(p)}return Promise.all([Promise.all(i),Promise.all(s),Promise.all(a),Promise.all(c),Promise.all(l)]).then(function(h){let d=h[0],u=h[1],_=h[2],p=h[3],m=h[4],A=[];for(let g=0,f=d.length;g<f;g++){let y=d[g],x=u[g],C=_[g],b=p[g],I=m[g];if(y===void 0)continue;if(y.updateMatrix)y.updateMatrix();let v=n._createAnimationTracks(y,x,C,b,I);if(v)for(let P=0;P<v.length;P++)A.push(v[P])}return new wOe(r,void 0,A)})}createNodeMesh(e){let t=this.json,n=this,o=t.nodes[e];if(o.mesh===void 0)return null;return n.getDependency("mesh",o.mesh).then(function(r){let i=n._getNodeRef(n.meshCache,o.mesh,r);if(o.weights!==void 0)i.traverse(function(s){if(!s.isMesh)return;for(let a=0,c=o.weights.length;a<c;a++)s.morphTargetInfluences[a]=o.weights[a]});return i})}loadNode(e){let t=this.json,n=this,o=t.nodes[e],r=n._loadNodeShallow(e),i=[],s=o.children||[];for(let c=0,l=s.length;c<l;c++)i.push(n.getDependency("node",s[c]));let a=o.skin===void 0?Promise.resolve(null):n.getDependency("skin",o.skin);return Promise.all([r,Promise.all(i),a]).then(function(c){let l=c[0],h=c[1],d=c[2];if(d!==null)l.traverse(function(u){if(!u.isSkinnedMesh)return;u.bind(d,ZSi)});for(let u=0,_=h.length;u<_;u++)l.add(h[u]);return l})}_loadNodeShallow(e){let t=this.json,n=this.extensions,o=this;if(this.nodeCache[e]!==void 0)return this.nodeCache[e];let r=t.nodes[e],i=r.name?o.createUniqueName(r.name):"",s=[],a=o._invokeOne(function(c){return c.createNodeMesh&&c.createNodeMesh(e)});if(a)s.push(a);if(r.camera!==void 0)s.push(o.getDependency("camera",r.camera).then(function(c){return o._getNodeRef(o.cameraCache,r.camera,c)}));return o._invokeAll(function(c){return c.createNodeAttachment&&c.createNodeAttachment(e)}).forEach(function(c){s.push(c)}),this.nodeCache[e]=Promise.all(s).then(function(c){let l;if(r.isBone===!0)l=new qye;else if(c.length>1)l=new dc;else if(c.length===1)l=c[0];else l=new nl;if(l!==c[0])for(let h=0,d=c.length;h<d;h++)l.add(c[h]);if(r.name)l.userData.name=r.name,l.name=i;if(DB(l,r),r.extensions)hG(n,l,r);if(r.matrix!==void 0){let h=new Fi;h.fromArray(r.matrix),l.applyMatrix4(h)}else{if(r.translation!==void 0)l.position.fromArray(r.translation);if(r.rotation!==void 0)l.quaternion.fromArray(r.rotation);if(r.scale!==void 0)l.scale.fromArray(r.scale)}if(!o.associations.has(l))o.associations.set(l,{});return o.associations.get(l).nodes=e,l}),this.nodeCache[e]}loadScene(e){let t=this.extensions,n=this.json.scenes[e],o=this,r=new dc;if(n.name)r.name=o.createUniqueName(n.name);if(DB(r,n),n.extensions)hG(t,r,n);let i=n.nodes||[],s=[];for(let a=0,c=i.length;a<c;a++)s.push(o.getDependency("node",i[a]));return Promise.all(s).then(function(a){for(let l=0,h=a.length;l<h;l++)r.add(a[l]);let c=(l)=>{let h=new Map;for(let[d,u]of o.associations)if(d instanceof cA||d instanceof Bl)h.set(d,u);return l.traverse((d)=>{let u=o.associations.get(d);if(u!=null)h.set(d,u)}),h};return o.associations=c(r),r})}_createAnimationTracks(e,t,n,o,r){let i=[],s=e.name?e.name:e.uuid,a=[];if(iL[r.path]===iL.weights)e.traverse(function(d){if(d.morphTargetInfluences)a.push(d.name?d.name:d.uuid)});else a.push(s);let c;switch(iL[r.path]){case iL.weights:c=ZN;break;case iL.rotation:c=oR;break;case iL.position:case iL.scale:c=eR;break;default:switch(n.itemSize){case 1:c=ZN;break;case 2:case 3:default:c=eR;break}break}let l=o.interpolation!==void 0?XSi[o.interpolation]:zie,h=this._getArrayFromAccessor(n);for(let d=0,u=a.length;d<u;d++){let _=new c(a[d]+"."+iL[r.path],t.array,h,l);if(o.interpolation==="CUBICSPLINE")this._createCubicSplineTrackInterpolant(_);i.push(_)}return i}_getArrayFromAccessor(e){let t=e.array;if(e.normalized){let n=qht(t.constructor),o=new Float32Array(t.length);for(let r=0,i=t.length;r<i;r++)o[r]=t[r]*n;t=o}return t}_createCubicSplineTrackInterpolant(e){e.createInterpolant=function(n){return new(this instanceof oR?QYn:Jht)(this.times,this.values,this.getValueSize()/3,n)},e.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline=!0}}function ePi(e,t,n){let o=t.attributes,r=new dm;if(o.POSITION!==void 0){let a=n.json.accessors[o.POSITION],{min:c,max:l}=a;if(c!==void 0&&l!==void 0){if(r.set(new Dt(c[0],c[1],c[2]),new Dt(l[0],l[1],l[2])),a.normalized){let h=qht(wee[a.componentType]);r.min.multiplyScalar(h),r.max.multiplyScalar(h)}}else{console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.");return}}else return;let i=t.targets;if(i!==void 0){let a=new Dt,c=new Dt;for(let l=0,h=i.length;l<h;l++){let d=i[l];if(d.POSITION!==void 0){let u=n.json.accessors[d.POSITION],{min:_,max:p}=u;if(_!==void 0&&p!==void 0){if(c.setX(Math.max(Math.abs(_[0]),Math.abs(p[0]))),c.setY(Math.max(Math.abs(_[1]),Math.abs(p[1]))),c.setZ(Math.max(Math.abs(_[2]),Math.abs(p[2]))),u.normalized){let m=qht(wee[u.componentType]);c.multiplyScalar(m)}a.max(c)}else console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.")}}r.expandByVector(a)}e.boundingBox=r;let s=new bx;r.getCenter(s.center),s.radius=r.min.distanceTo(r.max)/2,e.boundingSphere=s}function dYn(e,t,n){let o=t.attributes,r=[];function i(s,a){return n.getDependency("accessor",s).then(function(c){e.setAttribute(a,c)})}for(let s in o){let a=$ht[s]||s.toLowerCase();if(a in e.attributes)continue;r.push(i(o[s],a))}if(t.indices!==void 0&&!e.index){let s=n.getDependency("accessor",t.indices).then(function(a){e.setIndex(a)});r.push(s)}return DB(e,t),ePi(e,t,n),Promise.all(r).then(function(){return t.targets!==void 0?KSi(e,t.targets,n):e})}var tPi=/^[og]\s*(.+)?/,nPi=/^mtllib /,oPi=/^usemtl /,rPi=/^usemap /,LYn=new Dt,Zht=new Dt,HYn=new Dt,FYn=new Dt,Gb=new Dt;function iPi(){let e={objects:[],object:{},vertices:[],normals:[],colors:[],uvs:[],materials:{},materialLibraries:[],startObject:function(t,n){if(this.object&&this.object.fromDeclaration===!1){this.object.name=t,this.object.fromDeclaration=n!==!1;return}let o=this.object&&typeof this.object.currentMaterial==="function"?this.object.currentMaterial():void 0;if(this.object&&typeof this.object._finalize==="function")this.object._finalize(!0);if(this.object={name:t||"",fromDeclaration:n!==!1,geometry:{vertices:[],normals:[],colors:[],uvs:[],hasUVIndices:!1},materials:[],smooth:!0,startMaterial:function(r,i){let s=this._finalize(!1);if(s&&(s.inherited||s.groupCount<=0))this.materials.splice(s.index,1);let a={index:this.materials.length,name:r||"",mtllib:Array.isArray(i)&&i.length>0?i[i.length-1]:"",smooth:s!==void 0?s.smooth:this.smooth,groupStart:s!==void 0?s.groupEnd:0,groupEnd:-1,groupCount:-1,inherited:!1,clone:function(c){let l={index:typeof c==="number"?c:this.index,name:this.name,mtllib:this.mtllib,smooth:this.smooth,groupStart:0,groupEnd:-1,groupCount:-1,inherited:!1};return l.clone=this.clone.bind(l),l}};return this.materials.push(a),a},currentMaterial:function(){if(this.materials.length>0)return this.materials[this.materials.length-1];return},_finalize:function(r){let i=this.currentMaterial();if(i&&i.groupEnd===-1)i.groupEnd=this.geometry.vertices.length/3,i.groupCount=i.groupEnd-i.groupStart,i.inherited=!1;if(r&&this.materials.length>1){for(let s=this.materials.length-1;s>=0;s--)if(this.materials[s].groupCount<=0)this.materials.splice(s,1)}if(r&&this.materials.length===0)this.materials.push({name:"",smooth:this.smooth});return i}},o&&o.name&&typeof o.clone==="function"){let r=o.clone(0);r.inherited=!0,this.object.materials.push(r)}this.objects.push(this.object)},finalize:function(){if(this.object&&typeof this.object._finalize==="function")this.object._finalize(!0)},parseVertexIndex:function(t,n){let o=parseInt(t,10);return(o>=0?o-1:o+n/3)*3},parseNormalIndex:function(t,n){let o=parseInt(t,10);return(o>=0?o-1:o+n/3)*3},parseUVIndex:function(t,n){let o=parseInt(t,10);return(o>=0?o-1:o+n/2)*2},addVertex:function(t,n,o){let r=this.vertices,i=this.object.geometry.vertices;i.push(r[t+0],r[t+1],r[t+2]),i.push(r[n+0],r[n+1],r[n+2]),i.push(r[o+0],r[o+1],r[o+2])},addVertexPoint:function(t){let n=this.vertices;this.object.geometry.vertices.push(n[t+0],n[t+1],n[t+2])},addVertexLine:function(t){let n=this.vertices;this.object.geometry.vertices.push(n[t+0],n[t+1],n[t+2])},addNormal:function(t,n,o){let r=this.normals,i=this.object.geometry.normals;i.push(r[t+0],r[t+1],r[t+2]),i.push(r[n+0],r[n+1],r[n+2]),i.push(r[o+0],r[o+1],r[o+2])},addFaceNormal:function(t,n,o){let r=this.vertices,i=this.object.geometry.normals;LYn.fromArray(r,t),Zht.fromArray(r,n),HYn.fromArray(r,o),Gb.subVectors(HYn,Zht),FYn.subVectors(LYn,Zht),Gb.cross(FYn),Gb.normalize(),i.push(Gb.x,Gb.y,Gb.z),i.push(Gb.x,Gb.y,Gb.z),i.push(Gb.x,Gb.y,Gb.z)},addColor:function(t,n,o){let r=this.colors,i=this.object.geometry.colors;if(r[t]!==void 0)i.push(r[t+0],r[t+1],r[t+2]);if(r[n]!==void 0)i.push(r[n+0],r[n+1],r[n+2]);if(r[o]!==void 0)i.push(r[o+0],r[o+1],r[o+2])},addUV:function(t,n,o){let r=this.uvs,i=this.object.geometry.uvs;i.push(r[t+0],r[t+1]),i.push(r[n+0],r[n+1]),i.push(r[o+0],r[o+1])},addDefaultUV:function(){let t=this.object.geometry.uvs;t.push(0,0),t.push(0,0),t.push(0,0)},addUVLine:function(t){let n=this.uvs;this.object.geometry.uvs.push(n[t+0],n[t+1])},addFace:function(t,n,o,r,i,s,a,c,l){let h=this.vertices.length,d=this.parseVertexIndex(t,h),u=this.parseVertexIndex(n,h),_=this.parseVertexIndex(o,h);if(this.addVertex(d,u,_),this.addColor(d,u,_),a!==void 0&&a!==""){let p=this.normals.length;d=this.parseNormalIndex(a,p),u=this.parseNormalIndex(c,p),_=this.parseNormalIndex(l,p),this.addNormal(d,u,_)}else this.addFaceNormal(d,u,_);if(r!==void 0&&r!==""){let p=this.uvs.length;d=this.parseUVIndex(r,p),u=this.parseUVIndex(i,p),_=this.parseUVIndex(s,p),this.addUV(d,u,_),this.object.geometry.hasUVIndices=!0}else this.addDefaultUV()},addPointGeometry:function(t){this.object.geometry.type="Points";let n=this.vertices.length;for(let o=0,r=t.length;o<r;o++){let i=this.parseVertexIndex(t[o],n);this.addVertexPoint(i),this.addColor(i)}},addLineGeometry:function(t,n){this.object.geometry.type="Line";let o=this.vertices.length,r=this.uvs.length;for(let i=0,s=t.length;i<s;i++)this.addVertexLine(this.parseVertexIndex(t[i],o));for(let i=0,s=n.length;i<s;i++)this.addUVLine(this.parseUVIndex(n[i],r))}};return e.startObject("",!1),e}class fPe extends S2{constructor(e){super(e);this.materials=null}load(e,t,n,o){let r=this,i=new GC(this.manager);i.setPath(this.path),i.setRequestHeader(this.requestHeader),i.setWithCredentials(this.withCredentials),i.load(e,function(s){try{t(r.parse(s))}catch(a){if(o)o(a);else console.error(a);r.manager.itemError(e)}},n,o)}setMaterials(e){return this.materials=e,this}parse(e){let t=new iPi;if(e.indexOf(`\r
`)!==-1)e=e.replace(/\r\n/g,`
`);if(e.indexOf("\\\n")!==-1)e=e.replace(/\\\n/g,"");let n=e.split(`
`),o="",r="",i=0,s=[],a=typeof"".trimLeft==="function";for(let h=0,d=n.length;h<d;h++){if(o=n[h],o=a?o.trimLeft():o.trim(),i=o.length,i===0)continue;if(r=o.charAt(0),r==="#")continue;if(r==="v"){let u=o.split(/\s+/);switch(u[0]){case"v":if(t.vertices.push(parseFloat(u[1]),parseFloat(u[2]),parseFloat(u[3])),u.length>=7)t.colors.push(parseFloat(u[4]),parseFloat(u[5]),parseFloat(u[6]));else t.colors.push(void 0,void 0,void 0);break;case"vn":t.normals.push(parseFloat(u[1]),parseFloat(u[2]),parseFloat(u[3]));break;case"vt":t.uvs.push(parseFloat(u[1]),parseFloat(u[2]));break}}else if(r==="f"){let _=o.substr(1).trim().split(/\s+/),p=[];for(let A=0,g=_.length;A<g;A++){let f=_[A];if(f.length>0){let y=f.split("/");p.push(y)}}let m=p[0];for(let A=1,g=p.length-1;A<g;A++){let f=p[A],y=p[A+1];t.addFace(m[0],f[0],y[0],m[1],f[1],y[1],m[2],f[2],y[2])}}else if(r==="l"){let u=o.substring(1).trim().split(" "),_=[],p=[];if(o.indexOf("/")===-1)_=u;else for(let m=0,A=u.length;m<A;m++){let g=u[m].split("/");if(g[0]!=="")_.push(g[0]);if(g[1]!=="")p.push(g[1])}t.addLineGeometry(_,p)}else if(r==="p"){let _=o.substr(1).trim().split(" ");t.addPointGeometry(_)}else if((s=tPi.exec(o))!==null){let u=(" "+s[0].substr(1).trim()).substr(1);t.startObject(u)}else if(oPi.test(o))t.object.startMaterial(o.substring(7).trim(),t.materialLibraries);else if(nPi.test(o))t.materialLibraries.push(o.substring(7).trim());else if(rPi.test(o))console.warn('THREE.OBJLoader: Rendering identifier "usemap" not supported. Textures must be defined in MTL files.');else if(r==="s"){if(s=o.split(" "),s.length>1){let _=s[1].trim().toLowerCase();t.object.smooth=_!=="0"&&_!=="off"}else t.object.smooth=!0;let u=t.object.currentMaterial();if(u)u.smooth=t.object.smooth}else{if(o==="\x00")continue;console.warn('THREE.OBJLoader: Unexpected line: "'+o+'"')}}t.finalize();let c=new dc;if(c.materialLibraries=[].concat(t.materialLibraries),!(t.objects.length===1&&t.objects[0].geometry.vertices.length===0)===!0)for(let h=0,d=t.objects.length;h<d;h++){let u=t.objects[h],{geometry:_,materials:p}=u,m=_.type==="Line",A=_.type==="Points",g=!1;if(_.vertices.length===0)continue;let f=new ha;if(f.setAttribute("position",new jr(_.vertices,3)),_.normals.length>0)f.setAttribute("normal",new jr(_.normals,3));if(_.colors.length>0)g=!0,f.setAttribute("color",new jr(_.colors,3));if(_.hasUVIndices===!0)f.setAttribute("uv",new jr(_.uvs,2));let y=[];for(let C=0,b=p.length;C<b;C++){let I=p[C],v=I.name+"_"+I.smooth+"_"+g,P=t.materials[v];if(this.materials!==null){if(P=this.materials.create(I.name),m&&P&&!(P instanceof YC)){let M=new YC;cA.prototype.copy.call(M,P),M.color.copy(P.color),P=M}else if(A&&P&&!(P instanceof zI)){let M=new zI({size:10,sizeAttenuation:!1});cA.prototype.copy.call(M,P),M.color.copy(P.color),M.map=P.map,P=M}}if(P===void 0){if(m)P=new YC;else if(A)P=new zI({size:1,sizeAttenuation:!1});else P=new Pz;P.name=I.name,P.flatShading=I.smooth?!1:!0,P.vertexColors=g,t.materials[v]=P}y.push(P)}let x;if(y.length>1){for(let C=0,b=p.length;C<b;C++){let I=p[C];f.addGroup(I.groupStart,I.groupCount,C)}if(m)x=new p7(f,y);else if(A)x=new OM(f,y);else x=new Qo(f,y)}else if(m)x=new p7(f,y[0]);else if(A)x=new OM(f,y[0]);else x=new Qo(f,y[0]);x.name=u.name,c.add(x)}else if(t.vertices.length>0){let h=new zI({size:1,sizeAttenuation:!1}),d=new ha;if(d.setAttribute("position",new jr(t.vertices,3)),t.colors.length>0&&t.colors[0]!==void 0)d.setAttribute("color",new jr(t.colors,3)),h.vertexColors=!0;let u=new OM(d,h);c.add(u)}return c}}var g3=Qe(rn(),1);var N$n=Qe(so(),1);var Wee=Qe(rn(),1),Q$n=Qe(so(),1),ZEe=Qe(rn(),1);var k$n=Qe(rn(),1);var L$n=Qe(so(),1),eMe=Qe(rn(),1);var H$n=Qe(so(),1);var z$n=Qe(rn(),1),g5=Qe(so(),1),bP=Qe(rn(),1);var jb=Qe(rn(),1),Y$n=Qe(so(),1),kA=Qe(rn(),1);var X$n=Qe(so(),1),A5=Qe(rn(),1);var YB=Qe(rn(),1),bg=Qe(rn(),1);var sEe=Qe(so(),1),tMe=Qe(rn(),1);var mpe=Qe(rn(),1);var VB=Qe(rn(),1);var zYn={type:"change"},edt={type:"start"},OYn={type:"end"},yPe=new nR,VYn=new c7,sPi=Math.cos(70*d7.DEG2RAD);class tdt extends FM{constructor(e,t){super();this.object=e,this.domElement=t,this.domElement.style.touchAction="none",this.enabled=!0,this.target=new Dt,this.cursor=new Dt,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minTargetRadius=0,this.maxTargetRadius=1/0,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.enableDamping=!1,this.dampingFactor=0.05,this.enableZoom=!0,this.zoomSpeed=1,this.enableRotate=!0,this.rotateSpeed=1,this.enablePan=!0,this.panSpeed=1,this.screenSpacePanning=!0,this.keyPanSpeed=7,this.zoomToCursor=!1,this.autoRotate=!1,this.autoRotateSpeed=2,this.keys={LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",BOTTOM:"ArrowDown"},this.mouseButtons={LEFT:l7.ROTATE,MIDDLE:l7.DOLLY,RIGHT:l7.PAN},this.touches={ONE:Sz.ROTATE,TWO:Sz.DOLLY_PAN},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this._domElementKeyEvents=null,this.getPolarAngle=function(){return s.phi},this.getAzimuthalAngle=function(){return s.theta},this.getDistance=function(){return this.object.position.distanceTo(this.target)},this.listenToKeyEvents=function(ut){ut.addEventListener("keydown",dt),this._domElementKeyEvents=ut},this.stopListenToKeyEvents=function(){this._domElementKeyEvents.removeEventListener("keydown",dt),this._domElementKeyEvents=null},this.saveState=function(){n.target0.copy(n.target),n.position0.copy(n.object.position),n.zoom0=n.object.zoom},this.reset=function(){n.target.copy(n.target0),n.object.position.copy(n.position0),n.object.zoom=n.zoom0,n.object.updateProjectionMatrix(),n.dispatchEvent(zYn),n.update(),r=o.NONE},this.update=function(){let ut=new Dt,Ze=new hm().setFromUnitVectors(e.up,new Dt(0,1,0)),Fe=Ze.clone().invert(),tt=new Dt,Je=new hm,$e=new Dt,ft=2*Math.PI;return function(Ye=null){let je=n.object.position;if(ut.copy(je).sub(n.target),ut.applyQuaternion(Ze),s.setFromVector3(ut),n.autoRotate&&r===o.NONE)B(P(Ye));if(n.enableDamping)s.theta+=a.theta*n.dampingFactor,s.phi+=a.phi*n.dampingFactor;else s.theta+=a.theta,s.phi+=a.phi;let{minAzimuthAngle:st,maxAzimuthAngle:St}=n;if(isFinite(st)&&isFinite(St)){if(st<-Math.PI)st+=ft;else if(st>Math.PI)st-=ft;if(St<-Math.PI)St+=ft;else if(St>Math.PI)St-=ft;if(st<=St)s.theta=Math.max(st,Math.min(St,s.theta));else s.theta=s.theta>(st+St)/2?Math.max(st,s.theta):Math.min(St,s.theta)}if(s.phi=Math.max(n.minPolarAngle,Math.min(n.maxPolarAngle,s.phi)),s.makeSafe(),n.enableDamping===!0)n.target.addScaledVector(l,n.dampingFactor);else n.target.add(l);n.target.sub(n.cursor),n.target.clampLength(n.minTargetRadius,n.maxTargetRadius),n.target.add(n.cursor);let Nt=!1;if(n.zoomToCursor&&C||n.object.isOrthographicCamera)s.radius=U(s.radius);else{let Ot=s.radius;s.radius=U(s.radius*c),Nt=Ot!=s.radius}if(ut.setFromSpherical(s),ut.applyQuaternion(Fe),je.copy(n.target).add(ut),n.object.lookAt(n.target),n.enableDamping===!0)a.theta*=1-n.dampingFactor,a.phi*=1-n.dampingFactor,l.multiplyScalar(1-n.dampingFactor);else a.set(0,0,0),l.set(0,0,0);if(n.zoomToCursor&&C){let Ot=null;if(n.object.isPerspectiveCamera){let Ut=ut.length();Ot=U(Ut*c);let mn=Ut-Ot;n.object.position.addScaledVector(y,mn),n.object.updateMatrixWorld(),Nt=!!mn}else if(n.object.isOrthographicCamera){let Ut=new Dt(x.x,x.y,0);Ut.unproject(n.object);let mn=n.object.zoom;n.object.zoom=Math.max(n.minZoom,Math.min(n.maxZoom,n.object.zoom/c)),n.object.updateProjectionMatrix(),Nt=mn!==n.object.zoom;let _n=new Dt(x.x,x.y,0);_n.unproject(n.object),n.object.position.sub(_n).add(Ut),n.object.updateMatrixWorld(),Ot=ut.length()}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."),n.zoomToCursor=!1;if(Ot!==null)if(this.screenSpacePanning)n.target.set(0,0,-1).transformDirection(n.object.matrix).multiplyScalar(Ot).add(n.object.position);else if(yPe.origin.copy(n.object.position),yPe.direction.set(0,0,-1).transformDirection(n.object.matrix),Math.abs(n.object.up.dot(yPe.direction))<sPi)e.lookAt(n.target);else VYn.setFromNormalAndCoplanarPoint(n.object.up,n.target),yPe.intersectPlane(VYn,n.target)}else if(n.object.isOrthographicCamera){let Ot=n.object.zoom;if(n.object.zoom=Math.max(n.minZoom,Math.min(n.maxZoom,n.object.zoom/c)),Ot!==n.object.zoom)n.object.updateProjectionMatrix(),Nt=!0}if(c=1,C=!1,Nt||tt.distanceToSquared(n.object.position)>i||8*(1-Je.dot(n.object.quaternion))>i||$e.distanceToSquared(n.target)>i)return n.dispatchEvent(zYn),tt.copy(n.object.position),Je.copy(n.object.quaternion),$e.copy(n.target),!0;return!1}}(),this.dispose=function(){if(n.domElement.removeEventListener("contextmenu",ct),n.domElement.removeEventListener("pointerdown",Ee),n.domElement.removeEventListener("pointercancel",Me),n.domElement.removeEventListener("wheel",Se),n.domElement.removeEventListener("pointermove",Re),n.domElement.removeEventListener("pointerup",Me),n.domElement.getRootNode().removeEventListener("keydown",Le,{capture:!0}),n._domElementKeyEvents!==null)n._domElementKeyEvents.removeEventListener("keydown",dt),n._domElementKeyEvents=null};let n=this,o={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6},r=o.NONE,i=0.000001,s=new axe,a=new axe,c=1,l=new Dt,h=new go,d=new go,u=new go,_=new go,p=new go,m=new go,A=new go,g=new go,f=new go,y=new Dt,x=new go,C=!1,b=[],I={},v=!1;function P(ut){if(ut!==null)return 2*Math.PI/60*n.autoRotateSpeed*ut;else return 2*Math.PI/60/60*n.autoRotateSpeed}function M(ut){let Ze=Math.abs(ut*0.01);return Math.pow(0.95,n.zoomSpeed*Ze)}function B(ut){a.theta-=ut}function T(ut){a.phi-=ut}let N=function(){let ut=new Dt;return function(Fe,tt){ut.setFromMatrixColumn(tt,0),ut.multiplyScalar(-Fe),l.add(ut)}}(),D=function(){let ut=new Dt;return function(Fe,tt){if(n.screenSpacePanning===!0)ut.setFromMatrixColumn(tt,1);else ut.setFromMatrixColumn(tt,0),ut.crossVectors(n.object.up,ut);ut.multiplyScalar(Fe),l.add(ut)}}(),L=function(){let ut=new Dt;return function(Fe,tt){let Je=n.domElement;if(n.object.isPerspectiveCamera){let $e=n.object.position;ut.copy($e).sub(n.target);let ft=ut.length();ft*=Math.tan(n.object.fov/2*Math.PI/180),N(2*Fe*ft/Je.clientHeight,n.object.matrix),D(2*tt*ft/Je.clientHeight,n.object.matrix)}else if(n.object.isOrthographicCamera)N(Fe*(n.object.right-n.object.left)/n.object.zoom/Je.clientWidth,n.object.matrix),D(tt*(n.object.top-n.object.bottom)/n.object.zoom/Je.clientHeight,n.object.matrix);else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),n.enablePan=!1}}();function H(ut){if(n.object.isPerspectiveCamera||n.object.isOrthographicCamera)c/=ut;else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),n.enableZoom=!1}function V(ut){if(n.object.isPerspectiveCamera||n.object.isOrthographicCamera)c*=ut;else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),n.enableZoom=!1}function O(ut,Ze){if(!n.zoomToCursor)return;C=!0;let Fe=n.domElement.getBoundingClientRect(),tt=ut-Fe.left,Je=Ze-Fe.top,{width:$e,height:ft}=Fe;x.x=tt/$e*2-1,x.y=-(Je/ft)*2+1,y.set(x.x,x.y,1).unproject(n.object).sub(n.object.position).normalize()}function U(ut){return Math.max(n.minDistance,Math.min(n.maxDistance,ut))}function j(ut){h.set(ut.clientX,ut.clientY)}function Y(ut){O(ut.clientX,ut.clientX),A.set(ut.clientX,ut.clientY)}function X(ut){_.set(ut.clientX,ut.clientY)}function K(ut){d.set(ut.clientX,ut.clientY),u.subVectors(d,h).multiplyScalar(n.rotateSpeed);let Ze=n.domElement;B(2*Math.PI*u.x/Ze.clientHeight),T(2*Math.PI*u.y/Ze.clientHeight),h.copy(d),n.update()}function J(ut){if(g.set(ut.clientX,ut.clientY),f.subVectors(g,A),f.y>0)H(M(f.y));else if(f.y<0)V(M(f.y));A.copy(g),n.update()}function ee(ut){p.set(ut.clientX,ut.clientY),m.subVectors(p,_).multiplyScalar(n.panSpeed),L(m.x,m.y),_.copy(p),n.update()}function se(ut){if(O(ut.clientX,ut.clientY),ut.deltaY<0)V(M(ut.deltaY));else if(ut.deltaY>0)H(M(ut.deltaY));n.update()}function ne(ut){let Ze=!1;switch(ut.code){case n.keys.UP:if(ut.ctrlKey||ut.metaKey||ut.shiftKey)T(2*Math.PI*n.rotateSpeed/n.domElement.clientHeight);else L(0,n.keyPanSpeed);Ze=!0;break;case n.keys.BOTTOM:if(ut.ctrlKey||ut.metaKey||ut.shiftKey)T(-2*Math.PI*n.rotateSpeed/n.domElement.clientHeight);else L(0,-n.keyPanSpeed);Ze=!0;break;case n.keys.LEFT:if(ut.ctrlKey||ut.metaKey||ut.shiftKey)B(2*Math.PI*n.rotateSpeed/n.domElement.clientHeight);else L(n.keyPanSpeed,0);Ze=!0;break;case n.keys.RIGHT:if(ut.ctrlKey||ut.metaKey||ut.shiftKey)B(-2*Math.PI*n.rotateSpeed/n.domElement.clientHeight);else L(-n.keyPanSpeed,0);Ze=!0;break}if(Ze)ut.preventDefault(),n.update()}function re(ut){if(b.length===1)h.set(ut.pageX,ut.pageY);else{let Ze=xt(ut),Fe=0.5*(ut.pageX+Ze.x),tt=0.5*(ut.pageY+Ze.y);h.set(Fe,tt)}}function Z(ut){if(b.length===1)_.set(ut.pageX,ut.pageY);else{let Ze=xt(ut),Fe=0.5*(ut.pageX+Ze.x),tt=0.5*(ut.pageY+Ze.y);_.set(Fe,tt)}}function te(ut){let Ze=xt(ut),Fe=ut.pageX-Ze.x,tt=ut.pageY-Ze.y,Je=Math.sqrt(Fe*Fe+tt*tt);A.set(0,Je)}function ie(ut){if(n.enableZoom)te(ut);if(n.enablePan)Z(ut)}function ce(ut){if(n.enableZoom)te(ut);if(n.enableRotate)re(ut)}function ue(ut){if(b.length==1)d.set(ut.pageX,ut.pageY);else{let Fe=xt(ut),tt=0.5*(ut.pageX+Fe.x),Je=0.5*(ut.pageY+Fe.y);d.set(tt,Je)}u.subVectors(d,h).multiplyScalar(n.rotateSpeed);let Ze=n.domElement;B(2*Math.PI*u.x/Ze.clientHeight),T(2*Math.PI*u.y/Ze.clientHeight),h.copy(d)}function de(ut){if(b.length===1)p.set(ut.pageX,ut.pageY);else{let Ze=xt(ut),Fe=0.5*(ut.pageX+Ze.x),tt=0.5*(ut.pageY+Ze.y);p.set(Fe,tt)}m.subVectors(p,_).multiplyScalar(n.panSpeed),L(m.x,m.y),_.copy(p)}function me(ut){let Ze=xt(ut),Fe=ut.pageX-Ze.x,tt=ut.pageY-Ze.y,Je=Math.sqrt(Fe*Fe+tt*tt);g.set(0,Je),f.set(0,Math.pow(g.y/A.y,n.zoomSpeed)),H(f.y),A.copy(g);let $e=(ut.pageX+Ze.x)*0.5,ft=(ut.pageY+Ze.y)*0.5;O($e,ft)}function ge(ut){if(n.enableZoom)me(ut);if(n.enablePan)de(ut)}function xe(ut){if(n.enableZoom)me(ut);if(n.enableRotate)ue(ut)}function Ee(ut){if(n.enabled===!1)return;if(b.length===0)n.domElement.setPointerCapture(ut.pointerId),n.domElement.addEventListener("pointermove",Re),n.domElement.addEventListener("pointerup",Me);if(Lt(ut))return;if(Ct(ut),ut.pointerType==="touch")rt(ut);else _e(ut)}function Re(ut){if(n.enabled===!1)return;if(ut.pointerType==="touch")pt(ut);else ye(ut)}function Me(ut){switch(kt(ut),b.length){case 0:n.domElement.releasePointerCapture(ut.pointerId),n.domElement.removeEventListener("pointermove",Re),n.domElement.removeEventListener("pointerup",Me),n.dispatchEvent(OYn),r=o.NONE;break;case 1:let Ze=b[0],Fe=I[Ze];rt({pointerId:Ze,pageX:Fe.x,pageY:Fe.y});break}}function _e(ut){let Ze;switch(ut.button){case 0:Ze=n.mouseButtons.LEFT;break;case 1:Ze=n.mouseButtons.MIDDLE;break;case 2:Ze=n.mouseButtons.RIGHT;break;default:Ze=-1}switch(Ze){case l7.DOLLY:if(n.enableZoom===!1)return;Y(ut),r=o.DOLLY;break;case l7.ROTATE:if(ut.ctrlKey||ut.metaKey||ut.shiftKey){if(n.enablePan===!1)return;X(ut),r=o.PAN}else{if(n.enableRotate===!1)return;j(ut),r=o.ROTATE}break;case l7.PAN:if(ut.ctrlKey||ut.metaKey||ut.shiftKey){if(n.enableRotate===!1)return;j(ut),r=o.ROTATE}else{if(n.enablePan===!1)return;X(ut),r=o.PAN}break;default:r=o.NONE}if(r!==o.NONE)n.dispatchEvent(edt)}function ye(ut){switch(r){case o.ROTATE:if(n.enableRotate===!1)return;K(ut);break;case o.DOLLY:if(n.enableZoom===!1)return;J(ut);break;case o.PAN:if(n.enablePan===!1)return;ee(ut);break}}function Se(ut){if(n.enabled===!1||n.enableZoom===!1||r!==o.NONE)return;ut.preventDefault(),n.dispatchEvent(edt),se(Ne(ut)),n.dispatchEvent(OYn)}function Ne(ut){let Ze=ut.deltaMode,Fe={clientX:ut.clientX,clientY:ut.clientY,deltaY:ut.deltaY};switch(Ze){case 1:Fe.deltaY*=16;break;case 2:Fe.deltaY*=100;break}if(ut.ctrlKey&&!v)Fe.deltaY*=10;return Fe}function Le(ut){if(ut.key==="Control")v=!0,n.domElement.getRootNode().addEventListener("keyup",nt,{passive:!0,capture:!0})}function nt(ut){if(ut.key==="Control")v=!1,n.domElement.getRootNode().removeEventListener("keyup",nt,{passive:!0,capture:!0})}function dt(ut){if(n.enabled===!1||n.enablePan===!1)return;ne(ut)}function rt(ut){switch(Bt(ut),b.length){case 1:switch(n.touches.ONE){case Sz.ROTATE:if(n.enableRotate===!1)return;re(ut),r=o.TOUCH_ROTATE;break;case Sz.PAN:if(n.enablePan===!1)return;Z(ut),r=o.TOUCH_PAN;break;default:r=o.NONE}break;case 2:switch(n.touches.TWO){case Sz.DOLLY_PAN:if(n.enableZoom===!1&&n.enablePan===!1)return;ie(ut),r=o.TOUCH_DOLLY_PAN;break;case Sz.DOLLY_ROTATE:if(n.enableZoom===!1&&n.enableRotate===!1)return;ce(ut),r=o.TOUCH_DOLLY_ROTATE;break;default:r=o.NONE}break;default:r=o.NONE}if(r!==o.NONE)n.dispatchEvent(edt)}function pt(ut){switch(Bt(ut),r){case o.TOUCH_ROTATE:if(n.enableRotate===!1)return;ue(ut),n.update();break;case o.TOUCH_PAN:if(n.enablePan===!1)return;de(ut),n.update();break;case o.TOUCH_DOLLY_PAN:if(n.enableZoom===!1&&n.enablePan===!1)return;ge(ut),n.update();break;case o.TOUCH_DOLLY_ROTATE:if(n.enableZoom===!1&&n.enableRotate===!1)return;xe(ut),n.update();break;default:r=o.NONE}}function ct(ut){if(n.enabled===!1)return;ut.preventDefault()}function Ct(ut){b.push(ut.pointerId)}function kt(ut){delete I[ut.pointerId];for(let Ze=0;Ze<b.length;Ze++)if(b[Ze]==ut.pointerId){b.splice(Ze,1);return}}function Lt(ut){for(let Ze=0;Ze<b.length;Ze++)if(b[Ze]==ut.pointerId)return!0;return!1}function Bt(ut){let Ze=I[ut.pointerId];if(Ze===void 0)Ze=new go,I[ut.pointerId]=Ze;Ze.set(ut.pageX,ut.pageY)}function xt(ut){let Ze=ut.pointerId===b[0]?b[1]:b[0];return I[Ze]}n.domElement.addEventListener("contextmenu",ct),n.domElement.addEventListener("pointerdown",Ee),n.domElement.addEventListener("pointercancel",Me),n.domElement.addEventListener("wheel",Se,{passive:!1}),n.domElement.getRootNode().addEventListener("keydown",Le,{passive:!0,capture:!0}),this.update()}}var nMe=Qe(rn(),1);var J$n=Qe(so(),1),Lpe=Qe(rn(),1);Ko();var $2=Qe(so(),1),_pe=Qe(rn(),1),oqn=Qe(pGn(),1),ite=Qe(rn(),1);Ko();Ko();var y3=Qe(rn(),1),oMe=Qe(rn(),1);Ko();var GB=Qe(so(),1),Xee=Qe(rn(),1);Ko();function Jn(e,t){return Array.isArray(t)?[e.a*t[0]+e.c*t[1]+e.e,e.b*t[0]+e.d*t[1]+e.f]:{x:e.a*t.x+e.c*t.y+e.e,y:e.b*t.x+e.d*t.y+e.f}}function mGn(){return{a:1,c:0,e:0,b:0,d:1,f:0}}function uG(e){return typeof e>"u"}function Ny(e,t=0){return{a:1,c:0,e,b:0,d:1,f:t}}function pG(...e){e=Array.isArray(e[0])?e[0]:e;let t=(n,o)=>({a:n.a*o.a+n.c*o.b,c:n.a*o.c+n.c*o.d,e:n.a*o.e+n.c*o.f+n.e,b:n.b*o.a+n.d*o.b,d:n.b*o.c+n.d*o.d,f:n.b*o.e+n.d*o.f+n.f});switch(e.length){case 0:throw Error("no matrices provided");case 1:return e[0];case 2:return t(e[0],e[1]);default:{let[n,o,...r]=e,i=t(n,o);return pG(i,...r)}}}function sL(...e){return pG(...e)}var{cos:SPi,sin:PPi,PI:Y5a}=Math;function z0e(e,t,n){let o=SPi(e),r=PPi(e),i={a:o,c:-r,e:0,b:r,d:o,f:0};if(uG(t)||uG(n))return i;return pG([Ny(t,n),i,Ny(-t,-n)])}function O0e(e,t=void 0,n=void 0,o=void 0){if(uG(t))t=e;let r={a:e,c:0,e:0,b:0,d:t,f:0};if(uG(n)||uG(o))return r;return pG([Ny(n,o),r,Ny(-n,-o)])}var{tan:$5a}=Math;$8();$8();var EPi={"0":[[{x:0.019944796633211075,y:0.35828068632415006},{x:0.020222641007547733,y:0.3550960892473839},{x:0.020327535068617307,y:0.3519011161217302},{x:0.02060526835904108,y:0.3507104904820116},{x:0.02071153113201321,y:0.34949252766745387},{x:0.047065531132013214,y:0.20882352766745393},{x:0.047989939967683706,y:0.20564918300405605},{x:0.04875673163473768,y:0.20243312543665407},{x:0.04922094308839032,y:0.20142201853303832},{x:0.04953201774467938,y:0.20035381349539033},{x:0.05105794824635218,y:0.1974208061920286},{x:0.05243742793298141,y:0.1944161379022362},{x:0.1205174279329814,y:0.07784313790223615},{x:0.1216536619223176,y:0.07627409360623287},{x:0.12261018498510404,y:0.07458945972562232},{x:0.1242345189777056,y:0.07271014544101197},{x:0.12569143736362237,y:0.07069826276137084},{x:0.12711194429242206,y:0.06938103546641537},{x:0.12837874379901673,y:0.06791537974577894},{x:0.130338502698373,y:0.06638906779986004},{x:0.132159925645859,y:0.06470007355882942},{x:0.13381011622947792,y:0.06368528357115737},{x:0.13533850978527173,y:0.062494930337889824},{x:0.2330665097852717,y:0.000743930337889824},{x:0.2364974226485404,y:-0.000978818921256936},{x:0.23988324554357096,y:-0.0027885789630079164},{x:0.24043487144166406,y:-0.0029559128497863825},{x:0.24095002304009888,y:-0.0032145836671228292},{x:0.2446511035824589,y:-0.0042348928870151745},{x:0.24832493550927423,y:-0.005349337618145378},{x:0.24889860729226898,y:-0.005405839357118937},{x:0.2494543245702404,y:-0.005559038796006631},{x:0.2532833423420387,y:-0.0058376980655201055},{x:0.257104,y:-0.006214000000000011},{x:0.344948,y:-0.006214000000000011},{x:0.34876845169289644,y:-0.005837718351308385},{x:0.352597265623821,y:-0.005559109487024962},{x:0.35315318526669126,y:-0.00540585978827806},{x:0.3537270644907258,y:-0.005349337618145378},{x:0.3574006983675983,y:-0.004234952964808514},{x:0.36110158881940224,y:-0.0032147329490055873},{x:0.36161692908913895,y:-0.0029559733581057666},{x:0.36216875445642904,y:-0.0027885789630079164},{x:0.36555439482758706,y:-0.000978916482299381},{x:0.3689851386556908,y:0.0007437082019616584},{x:0.4667151386556908,y:0.06249470820196166},{x:0.46824382031514195,y:0.0636852631221029},{x:0.4698943035897058,y:0.06470024765114774},{x:0.4717154585013725,y:0.06638901501054441},{x:0.47367495473362387,y:0.0679150932923645},{x:0.4749419974608878,y:0.0693810030307532},{x:0.47636275350351887,y:0.0706984782301942},{x:0.4778194532662604,y:0.07271008609647399},{x:0.47944357522443626,y:0.07458911996296573},{x:0.4804002872780698,y:0.07627405043044727},{x:0.48153671723081914,y:0.07784338646721853},{x:0.5496157172308191,y:0.19441638646721857},{x:0.5509951179002539,y:0.19742093333312605},{x:0.5525209822553206,y:0.20035381349539033},{x:0.5528320971760705,y:0.20142215679791795},{x:0.5532963622471587,y:0.2024333975455826},{x:0.5540631001039363,y:0.20564932060673602},{x:0.5549874688679868,y:0.20882352766745393},{x:0.5813414688679868,y:0.34949252766745387},{x:0.5814477200321959,y:0.3507103574246747},{x:0.581725430046729,y:0.351900851345405},{x:0.5818303474337426,y:0.35509595676374855},{x:0.5821082033667889,y:0.35828068632415006},{x:0.5819748261451739,y:0.3594958443979094},{x:0.5820149461972951,y:0.36071764184793353},{x:0.5710349461972951,y:0.5284976418479336},{x:0.5705756858728281,y:0.5312810757499365},{x:0.5703149436633981,y:0.5340900680661724},{x:0.5698592272920282,y:0.5356233082419208},{x:0.5695988288779222,y:0.5372015019922555},{x:0.5686053720955593,y:0.5398418557477263},{x:0.5678016327590553,y:0.5425460057826548},{x:0.5216826327590552,y:0.6556800057826547},{x:0.5211943471023096,y:0.656605995281004},{x:0.5208498728309648,y:0.6575945381025444},{x:0.5191405880551111,y:0.6605007631972294},{x:0.5175679428069421,y:0.6634831423933323},{x:0.5169083878327574,y:0.664296079457111},{x:0.5163776774005638,y:0.665198424109003},{x:0.5141342596628157,y:0.6677153419860701},{x:0.5120099990343735,y:0.6703336077343061},{x:0.511204521070525,y:0.6710022516480534},{x:0.510507969381766,y:0.6717837215313657},{x:0.425955969381766,y:0.7497057215313657},{x:0.4243831978740034,y:0.750892537075826},{x:0.42294870744900304,y:0.7522432326643229},{x:0.4208707687817478,y:0.7535430209032156},{x:0.4189143183619635,y:0.7550193610827685},{x:0.4171402309909699,y:0.7558765397994217},{x:0.4154697962599445,y:0.7569214269519826},{x:0.41317820849544135,y:0.7577908544006052},{x:0.41097133104084405,y:0.7588571425751742},{x:0.40906410498936707,y:0.7593517435666508},{x:0.4072219198222394,y:0.7600506678559823},{x:0.3127869198222394,y:0.7856226678559822},{x:0.3097655669518694,y:0.7861297177594856},{x:0.3067801557646532,y:0.7868174624905968},{x:0.3054245519856559,y:0.7868582361795984},{x:0.30408703940192616,y:0.7870827004032797},{x:0.3010248204508113,y:0.7869905707806608},{x:0.2979626007613803,y:0.7870826758597451},{x:0.29662508997676323,y:0.7868582009159747},{x:0.29526948652460844,y:0.786817416361878},{x:0.2922840808497275,y:0.7861296477028675},{x:0.28926273204343433,y:0.7856225735833884},{x:0.19483073204343437,y:0.7600505735833885},{x:0.19298859701529922,y:0.7593516514268194},{x:0.1910814199885863,y:0.7588570511522524},{x:0.1888745059729717,y:0.757790729268721},{x:0.18658288068670334,y:0.7569212665731724},{x:0.18491249471518256,y:0.7558763912940257},{x:0.18313845528709377,y:0.7550192228447639},{x:0.18118197558509466,y:0.7535428424712565},{x:0.17910400699337814,y:0.7522430123425641},{x:0.17766956207459372,y:0.7508923379118444},{x:0.17609683558545802,y:0.7497055417906873},{x:0.09154583558545802,y:0.6717835417906872},{x:0.09084937681091164,y:0.6710021668773223},{x:0.09004400096562647,y:0.6703336077343061},{x:0.087919657143162,y:0.6677152394449524},{x:0.08567616637982708,y:0.6651982097729843},{x:0.0851455285488078,y:0.6642959763928821},{x:0.08448605719305789,y:0.6634831423933323},{x:0.08291335035419628,y:0.6605006463960624},{x:0.08120401576602496,y:0.6575942974079984},{x:0.08085959099279398,y:0.6566058778839782},{x:0.08037136724094471,y:0.6556800057826547},{x:0.03425236724094472,y:0.5425460057826548},{x:0.03344866581310472,y:0.5398419832899659},{x:0.03245524021837327,y:0.537201759963462},{x:0.0321948107181119,y:0.5356234361255728},{x:0.03173905633660196,y:0.5340900680661724},{x:0.03147832642517492,y:0.5312812082371015},{x:0.031019071243648687,y:0.5284979083423142},{x:0.020038071243648682,y:0.36071790834231426},{x:0.020078188427320915,y:0.3594959771633442},{x:0.019944796633211075,y:0.35828068632415006}],[{x:0.11021604810185967,y:0.3604951889884744},{x:0.12035004420691338,y:0.5153337161267963},{x:0.1599220965290545,y:0.612407472440097},{x:0.22898846858521874,y:0.6760588762479813},{x:0.301025186831377,y:0.6955662779655215},{x:0.373064807645506,y:0.6760587099720985},{x:0.44213195602343713,y:0.6124073435241713},{x:0.48170390405887986,y:0.5153338430353971},{x:0.49183697687726113,y:0.3604953223188204},{x:0.4679633532090146,y:0.23306575687188358},{x:0.4093572783633461,y:0.13271343144136735},{x:0.3319224534250481,y:0.08378599999999999},{x:0.27012977192577264,y:0.08378599999999999},{x:0.19269670382412518,y:0.13271332265415062},{x:0.13408961949133952,y:0.23306590258843124},{x:0.11021604810185967,y:0.3604951889884744}]],"1":[[{x:0.17556757075794932,y:0.5951166967821685},{x:0.17573368487361973,y:0.586296718297643},{x:0.17761729959585784,y:0.5776786204828649},{x:0.18114602866723137,y:0.5695935920037709},{x:0.1861842650084615,y:0.5623523359706766},{x:0.19253839202243023,y:0.5562331297919906},{x:0.19996422417142623,y:0.5514711311294693},{x:0.20817639089041826,y:0.548249340921154},{x:0.21685930321783156,y:0.5466915707579493},{x:0.225679281702357,y:0.5468576848736197},{x:0.2342973795171352,y:0.5487412995958578},{x:0.24238240799622912,y:0.5522700286672314},{x:0.24962366402932343,y:0.5573082650084615},{x:0.33662600000000004,y:0.6314944876419193},{x:0.33662600000000004,y:0.051034000000000024},{x:0.33749066238185466,y:0.042254935509274234},{x:0.3400514210369921,y:0.033813245543570986},{x:0.3442098674463855,y:0.026033339514117928},{x:0.34980619484660536,y:0.019214194846605387},{x:0.35662533951411796,y:0.013617867446385483},{x:0.364405245543571,y:0.00945942103699212},{x:0.3728469355092743,y:0.006898662381854659},{x:0.381626,y:0.0060340000000000255},{x:0.3904050644907258,y:0.006898662381854659},{x:0.3988467544564291,y:0.00945942103699212},{x:0.40662666048588214,y:0.01361786744638549},{x:0.4134458051533947,y:0.019214194846605387},{x:0.41904213255361455,y:0.026033339514117928},{x:0.42320057896300795,y:0.033813245543570986},{x:0.4257613376181454,y:0.042254935509274255},{x:0.426626,y:0.051034000000000024},{x:0.426626,y:0.729004},{x:0.42636789988195944,y:0.7316245344755278},{x:0.4263183151263803,y:0.7342572817023569},{x:0.42593657376816557,y:0.7360038620015019},{x:0.4257613376181454,y:0.7377830644907257},{x:0.42499695590681574,y:0.7403028932959718},{x:0.4244347004041422,y:0.7428753795171351},{x:0.42371955318609683,y:0.744513925721078},{x:0.42320057896300795,y:0.746224754456429},{x:0.4219592904188853,y:0.7485470419835442},{x:0.42090597133276864,y:0.7509604079962291},{x:0.419884900961423,y:0.7524279516932593},{x:0.41904213255361455,y:0.7540046604858821},{x:0.41737163919932724,y:0.7560401625275525},{x:0.41586773499153856,y:0.7582016640293234},{x:0.4145799806286405,y:0.7594418083381722},{x:0.4134458051533947,y:0.7608238051533946},{x:0.41141030311172405,y:0.7624942985076821},{x:0.4095136079775698,y:0.7643208702080094},{x:0.40800865730110464,y:0.7652859570783687},{x:0.40662666048588214,y:0.7664201325536145},{x:0.40430437295876726,y:0.767661421097737},{x:0.4020877758285738,y:0.7690828688705307},{x:0.4004234632490515,y:0.7697358105551997},{x:0.3988467544564291,y:0.7705785789630079},{x:0.39632692565118355,y:0.7713429606743374},{x:0.3938756091095818,y:0.772304659078846},{x:0.39211589322607654,y:0.7726203633950566},{x:0.3904050644907258,y:0.7731393376181454},{x:0.3877845300151986,y:0.7733974377361859},{x:0.3851926967821685,y:0.7738624292420507},{x:0.38340520248922366,y:0.7738287638499798},{x:0.381626,y:0.774004},{x:0.37900546552447173,y:0.7737458998819594},{x:0.376372718297643,y:0.7736963151263803},{x:0.37462613799849803,y:0.7733145737681656},{x:0.3728469355092743,y:0.7731393376181454},{x:0.3703271067040287,y:0.7723749559068158},{x:0.36775462048286484,y:0.7718127004041422},{x:0.3661160742789217,y:0.7710975531860966},{x:0.364405245543571,y:0.7705785789630079},{x:0.3620829580164563,y:0.7693372904188854},{x:0.3596695920037709,y:0.7682839713327686},{x:0.35820204830674063,y:0.7672629009614229},{x:0.35662533951411796,y:0.7664201325536145},{x:0.3545898374724472,y:0.7647496391993269},{x:0.35242833597067663,y:0.7632457349915385},{x:0.1912283359706766,y:0.6257917349915385},{x:0.18510912979199054,y:0.6194376079775697},{x:0.18034713112946932,y:0.6120117758285738},{x:0.17712534092115398,y:0.6037996091095817},{x:0.17556757075794932,y:0.5951166967821685}]],"2":[[{x:0.034589999999999996,y:0.05195499999999997},{x:0.034692251306008066,y:0.05091682506774448},{x:0.03463809526377374,y:0.04987503351343359},{x:0.03512383076438082,y:0.04653492529109402},{x:0.03545466238185463,y:0.043175935509274184},{x:0.03575748683953214,y:0.042177657057450094},{x:0.03590761484026801,y:0.04114531791601493},{x:0.0370356398580977,y:0.03796415123181852},{x:0.03801542103699209,y:0.034734245543570935},{x:0.03850718127225641,y:0.0338142268532408},{x:0.03885582398108696,y:0.03283101233894428},{x:0.040582789147307716,y:0.02993103764454602},{x:0.04217386744638545,y:0.02695433951411788},{x:0.04283566538917773,y:0.026147936387598623},{x:0.04336942466232366,y:0.025251630882832152},{x:0.04562896367409083,y:0.022744292579413156},{x:0.04777019484660536,y:0.020135194846605337},{x:0.04857659797312457,y:0.019473396903813094},{x:0.04927496174105457,y:0.01869844492647086},{x:0.0519802417813102,y:0.01668009861889986},{x:0.05458933951411791,y:0.014538867446385433},{x:0.055509358204447995,y:0.01404710721112114},{x:0.05634548873920743,y:0.013423289731094336},{x:0.05939254741314285,y:0.011971499336069797},{x:0.062369245543570956,y:0.01038042103699207},{x:0.0633675239953951,y:0.010077596579314544},{x:0.06430928926944049,y:0.00962888655251979},{x:0.06758102982102647,y:0.008799443560749052},{x:0.07081093550927423,y:0.007819662381854608},{x:0.0718491104415297,y:0.007717411075846537},{x:0.07286031894352762,y:0.007461052176974015},{x:0.07623101021818018,y:0.0072858316174737835},{x:0.07959,y:0.006954999999999975},{x:0.522462,y:0.006954999999999975},{x:0.5312410644907257,y:0.007819662381854608},{x:0.539682754456429,y:0.01038042103699207},{x:0.5474626604858821,y:0.014538867446385433},{x:0.5542818051533946,y:0.020135194846605337},{x:0.5598781325536145,y:0.02695433951411788},{x:0.5640365789630079,y:0.034734245543570935},{x:0.5665973376181453,y:0.043175935509274205},{x:0.567462,y:0.05195499999999997},{x:0.5665973376181453,y:0.06073406449072574},{x:0.5640365789630079,y:0.06917575445642901},{x:0.5598781325536145,y:0.07695566048588207},{x:0.5542818051533946,y:0.08377480515339461},{x:0.5474626604858821,y:0.08937113255361451},{x:0.539682754456429,y:0.09352957896300787},{x:0.5312410644907257,y:0.09609033761814534},{x:0.522462,y:0.09695499999999997},{x:0.1815000359059797,y:0.09695499999999997},{x:0.2783905550735291,y:0.2032469617410546},{x:0.2792807818102756,y:0.20444017254595384},{x:0.28031851181367967,y:0.20550758629318672},{x:0.43775551181367967,y:0.4029575862931866},{x:0.4393581707982963,y:0.4054309283363016},{x:0.4411189018513206,y:0.4077943501865292},{x:0.5036359018513206,y:0.5115903501865292},{x:0.5044316302389797,y:0.5132634494776924},{x:0.5054127007337849,y:0.5148350555317778},{x:0.5063216043693862,y:0.5172373109446714},{x:0.5074247535047713,y:0.5195567934026113},{x:0.5078787867151084,y:0.5213529834674229},{x:0.5085344010842773,y:0.5230857889106145},{x:0.5229384010842772,y:0.5764717889106146},{x:0.5230947969602031,y:0.5774089507908463},{x:0.5233933154704733,y:0.5783109589719573},{x:0.5238196553887738,y:0.5817524776504878},{x:0.5243904806061233,y:0.5851730002877248},{x:0.5243610401661515,y:0.586122666187007},{x:0.5244778496604383,y:0.5870655806061408},{x:0.5252778496604383,y:0.6189585806061408},{x:0.525154398698275,y:0.6206444560860672},{x:0.5252359209411441,y:0.6223328785443973},{x:0.5248330095087286,y:0.6250334227224941},{x:0.5246336028763079,y:0.6277565667648055},{x:0.5241836259995084,y:0.6293859645321488},{x:0.5239341869342451,y:0.6310578486269935},{x:0.5118811869342451,y:0.6790048486269935},{x:0.5115474759395316,y:0.6799350391147754},{x:0.5113589931552627,y:0.6809051378786065},{x:0.5100605296725933,y:0.6840797730170447},{x:0.5089023081582834,y:0.6873082151493771},{x:0.5083935381649621,y:0.6881554285023456},{x:0.5080194201443183,y:0.6890701159233712},{x:0.5061265656819337,y:0.6919304336788418},{x:0.5043607612540449,y:0.6948708843926746},{x:0.5036964840076373,y:0.6956025626767983},{x:0.5031511078963445,y:0.6964266878303904},{x:0.4695951078963445,y:0.7376876878303904},{x:0.46829294792790443,y:0.7390014838193654},{x:0.46714904955699066,y:0.7404551608815331},{x:0.46519525859727806,y:0.7421268539092958},{x:0.4633851429208498,y:0.7439531446668906},{x:0.4618516947085211,y:0.7449876576267703},{x:0.4604461776978856,y:0.7461902391902692},{x:0.4582037971525157,y:0.7474486453977692},{x:0.45607217068925404,y:0.7488867084403534},{x:0.4543663637878686,y:0.7496021826182516},{x:0.45275324136800726,y:0.7505074541480116},{x:0.3913892413680073,y:0.7774134541480116},{x:0.3883140702117422,y:0.7784156528007931},{x:0.3852957573995619,y:0.7795779210778271},{x:0.3841283231887951,y:0.779779788263216},{x:0.3830018757962646,y:0.7801468976050565},{x:0.3797902739335826,y:0.7805299031606142},{x:0.3766032098633093,y:0.781080995160135},{x:0.2948022098633093,y:0.7870669951601349},{x:0.29450281220893076,y:0.7870594704966325},{x:0.2942070489499988,y:0.7871065838776864},{x:0.29009611613079095,y:0.7869487184427649},{x:0.2859834519838158,y:0.7868453561974301},{x:0.28569127516043946,y:0.7867795665334233},{x:0.28539200354491423,y:0.7867680740946454},{x:0.2381110035449142,y:0.7802710740946455},{x:0.2365476307297285,y:0.7798972084805876},{x:0.2349498387179436,y:0.7797212234138579},{x:0.23226739693423346,y:0.7788736316211718},{x:0.2295313767481002,y:0.7782193386355017},{x:0.22807098126622102,y:0.7775476578384392},{x:0.22653822336325463,y:0.7770633405173258},{x:0.15287222336325462,y:0.7455503405173259},{x:0.15277120515837472,y:0.7454948388638573},{x:0.15266147866932564,y:0.7454595513468599},{x:0.14890641990559073,y:0.7433714396994592},{x:0.14514076206912752,y:0.7413025033471496},{x:0.1450525127361761,y:0.7412283604682699},{x:0.14495177886390068,y:0.7411723444149347},{x:0.14167624287507044,y:0.7383917796239132},{x:0.1383865705572421,y:0.7356279539035645},{x:0.138314481468594,y:0.7355380190685297},{x:0.13822661135931125,y:0.7354634271443719},{x:0.09327661135931127,y:0.6889934271443718},{x:0.09215967204365061,y:0.6875853345117547},{x:0.09088652507606766,y:0.6863167230283468},{x:0.0894249598835053,y:0.6841377631074377},{x:0.0877944205712414,y:0.6820821900242812},{x:0.08697364817646357,y:0.6804832494460014},{x:0.08597245819367963,y:0.6789906353246448},{x:0.0849640705590952,y:0.6765684062835642},{x:0.08376588401722862,y:0.6742342280213215},{x:0.08327282036617045,y:0.6725058858871059},{x:0.08258206253775009,y:0.6708466294514168},{x:0.06737006253775008,y:0.6210196294514168},{x:0.06563362911198059,y:0.61237067498716},{x:0.06561788807912042,y:0.6035491464015462},{x:0.0673234443582347,y:0.5948940500909503},{x:0.07068475437800403,y:0.5867379965527546},{x:0.07557264487941309,y:0.5793944183504645},{x:0.08179927697165325,y:0.5731455250760676},{x:0.08912536467535526,y:0.5682314581936796},{x:0.09726937054858317,y:0.56484106253775},{x:0.10591832501283995,y:0.5631046291119806},{x:0.11473985359845373,y:0.5630888880791204},{x:0.12339494990904962,y:0.5647944443582347},{x:0.13155100344724535,y:0.568155754378004},{x:0.13889458164953555,y:0.5730436448794131},{x:0.14514347492393234,y:0.5792702769716532},{x:0.15005754180632036,y:0.5865963646753553},{x:0.1534479374622499,y:0.5947403705485832},{x:0.16549687462406137,y:0.6342067386764809},{x:0.19660916323298405,y:0.666371100226128},{x:0.2563653288901179,y:0.6919337213587163},{x:0.29295461470925055,y:0.696961546277117},{x:0.3623268316838737,y:0.6918850546595318},{x:0.40664087103378327,y:0.672454875030618},{x:0.4270299373286165,y:0.6473841495451277},{x:0.4351521014718352,y:0.6150740687208592},{x:0.4346413299816387,y:0.5947115247998124},{x:0.4232850296720603,y:0.5526213103922067},{x:0.3655461500158852,y:0.45675834907300783},{x:0.21087613207581168,y:0.2627785664153893},{x:0.04633344492647088,y:0.0822700382589454},{x:0.04431509861889995,y:0.07956475821868986},{x:0.04217386744638545,y:0.07695566048588207},{x:0.04168210721112112,y:0.0760356417955519},{x:0.04105828973109435,y:0.07519951126079251},{x:0.03960649933606985,y:0.07215245258685718},{x:0.03801542103699209,y:0.06917575445642901},{x:0.037712596579314576,y:0.0681774760046049},{x:0.037263886552519804,y:0.06723571073055948},{x:0.036434443560749034,y:0.06396397017897336},{x:0.03545466238185463,y:0.06073406449072574},{x:0.03535241107584656,y:0.059695889558470286},{x:0.035096052176974035,y:0.05868468105647236},{x:0.03492083161747381,y:0.05531398978181981},{x:0.034589999999999996,y:0.05195499999999997}]],"3":[[{x:0.02624429558875499,y:0.07454886751538828},{x:0.02628189246403191,y:0.06572740500388341},{x:0.028039748887915363,y:0.057082779207475086},{x:0.03145031142385274,y:0.04894719824755728},{x:0.036382514066253493,y:0.04163330793793327},{x:0.042646815033581253,y:0.035422176981524986},{x:0.05000248075272204,y:0.030552495657744837},{x:0.05816683711519421,y:0.027211403088916904},{x:0.11448783711519421,y:0.010388403088916982},{x:0.11753114712885143,y:0.009796523380387901},{x:0.12053464064709668,y:0.009027703431080128},{x:0.20267064064709667,y:-0.0035892965689199724},{x:0.20562630159751,y:-0.003749783589053152},{x:0.20856537842676282,y:-0.004101230781641964},{x:0.30947437842676284,y:-0.00620423078164193},{x:0.31075400531193675,y:-0.006105070212514369},{x:0.31203499449415534,y:-0.0061847225744922005},{x:0.3151428517207607,y:-0.005764970678224511},{x:0.3182695531731509,y:-0.005522677007230838},{x:0.31950524711917533,y:-0.005175778959545043},{x:0.3207771618583987,y:-0.005003992231664048},{x:0.3829651618583987,y:0.009716007768336019},{x:0.3849642059743718,y:0.010402067561162992},{x:0.38702295869345676,y:0.010879972006216251},{x:0.389126076828856,y:0.011830396347599064},{x:0.3913090018652735,y:0.012579562954916447},{x:0.3931357912831918,y:0.013642434461507345},{x:0.39506175111398195,y:0.014512798837572657},{x:0.47719975111398194,y:0.06182779883757265},{x:0.47924722409526294,y:0.06329195880211928},{x:0.48141099047099317,y:0.06457804786673271},{x:0.4828265323572166,y:0.06585154318044145},{x:0.484375351035892,y:0.06695911252196202},{x:0.4860978389589892,y:0.06879458122658251},{x:0.48796912564078,y:0.07047808832945178},{x:0.54077112564078,y:0.12830608832945176},{x:0.5409949120745448,y:0.12860551518367325},{x:0.5412686389329152,y:0.1288600940829806},{x:0.5436334835107667,y:0.13213593090859313},{x:0.5460522072884215,y:0.13537218987116906},{x:0.5462132784472015,y:0.1357095218897727},{x:0.546432079841298,y:0.13601261058785885},{x:0.5481124005325159,y:0.13968686141763526},{x:0.5498532864078638,y:0.14333280617235186},{x:0.5499454524173568,y:0.14369507987504085},{x:0.5501009199323095,y:0.14403503084321223},{x:0.5735679199323094,y:0.2123790308432122},{x:0.5742003382158373,y:0.21504899342087444},{x:0.5750294951185407,y:0.21766455299430504},{x:0.5752146521018063,y:0.21933125436759},{x:0.575601167738761,y:0.22096305773765262},{x:0.575700550423256,y:0.22370509641963415},{x:0.5760035049491392,y:0.22643215923642232},{x:0.5758599468852712,y:0.22810295774565637},{x:0.5759206866877095,y:0.2297788119316045},{x:0.5754832145523405,y:0.2324875517091097},{x:0.575248324328873,y:0.23522131827456078},{x:0.563515324328873,y:0.2983063182745607},{x:0.5624930457986839,y:0.30183400865706583},{x:0.561587550163308,y:0.3053934651440046},{x:0.5612670272694029,y:0.3060647673464004},{x:0.5610599744254687,y:0.30677926765590185},{x:0.5593691204378909,y:0.31003973780923805},{x:0.5577866081350055,y:0.3133541469027738},{x:0.5573412794357957,y:0.31395001930700017},{x:0.5569988129587381,y:0.31461039668740554},{x:0.5547043620842722,y:0.317478348572073},{x:0.5525056481741942,y:0.32042033938948294},{x:0.4997036481741942,y:0.378250339389483},{x:0.4970091109540712,y:0.38067456957783247},{x:0.49440132723244246,y:0.38319188697894757},{x:0.4937347452782226,y:0.3836204617554604},{x:0.49314561461057166,y:0.3841504927896343},{x:0.49002990831948917,y:0.38600246394071897},{x:0.48698112816844114,y:0.387962658427834},{x:0.4171684643874312,y:0.4237087345514058},{x:0.48487098803351525,y:0.4540412587201935},{x:0.4882241875669253,y:0.4559584413246188},{x:0.4916233115558361,y:0.4577929691542233},{x:0.4920492459188098,y:0.45814540790983926},{x:0.4925291804180174,y:0.45841980913886743},{x:0.49544392539098053,y:0.4609543303938907},{x:0.49841983754054403,y:0.46341674447922576},{x:0.545354837540544,y:0.5107317444792258},{x:0.5454749496657809,y:0.5108793107625336},{x:0.5456205162109946,y:0.5110018387655073},{x:0.548258239278959,y:0.5142987798858712},{x:0.5509236260451226,y:0.5175733969812307},{x:0.5510126414958236,y:0.5177415605329735},{x:0.5511315069931322,y:0.5178901328189077},{x:0.5530753456471339,y:0.5216383183828395},{x:0.5550506716503533,y:0.525370005791429},{x:0.5551051696126684,y:0.5255523041806199},{x:0.555192766127671,y:0.525721211199887},{x:0.5563680197383496,y:0.5297766005381628},{x:0.5575773743081012,y:0.5338219516056334},{x:0.5575952604559016,y:0.5340113792074108},{x:0.557648221703651,y:0.5341941299579837},{x:0.569382221703651,y:0.5972801299579837},{x:0.5696549699390315,y:0.6004540423597167},{x:0.5701008412017201,y:0.6036082951002054},{x:0.5700318821169291,y:0.6048400880993865},{x:0.5701375119403227,y:0.6060692795769916},{x:0.5697858198023349,y:0.6092354166829699},{x:0.5696077595908724,y:0.6124160465097288},{x:0.5692998146426919,y:0.6136107177017713},{x:0.5691636114574624,y:0.614836897966064},{x:0.5682009942777376,y:0.6178735869028962},{x:0.5674058453461934,y:0.6209583639953996},{x:0.5668707486862845,y:0.622070002836373},{x:0.5664979467044567,y:0.623246050467446},{x:0.5649613973213707,y:0.6260365929822823},{x:0.5635797167972587,y:0.6289069710868302},{x:0.5283787167972587,y:0.6867359710868302},{x:0.526364685994031,y:0.6894131274243959},{x:0.524479650893362,y:0.6921826271628648},{x:0.5237177195860089,y:0.6929316152663909},{x:0.5230754099184859,y:0.6937854072711274},{x:0.5205777908604191,y:0.6960182048823972},{x:0.5181886735848373,y:0.6983667373551676},{x:0.4595186735848373,y:0.7456807373551677},{x:0.45627545779875317,y:0.7478078267647688},{x:0.4530837115337172,y:0.7500113951823929},{x:0.4525909707504246,y:0.7502243275150239},{x:0.4521421155924859,y:0.7505187128152536},{x:0.44854624273044896,y:0.7519722107862162},{x:0.4449859301027389,y:0.7535107594479447},{x:0.362848930102739,y:0.7797967594479446},{x:0.36158078031831586,y:0.7800691142952486},{x:0.3603625229719573,y:0.7805143446587972},{x:0.35727696699365546,y:0.7809934249999153},{x:0.35422405316989464,y:0.781649085623381},{x:0.352927136733123,y:0.7816688034988555},{x:0.3516454277250751,y:0.7818678086678129},{x:0.2577774277250751,y:0.7871168086678129},{x:0.2534831925795917,y:0.7869349938938289},{x:0.24918809681378723,y:0.7867747925856998},{x:0.2490774333618657,y:0.786748457272228},{x:0.24896378128970398,y:0.7867436453266514},{x:0.24478752897123962,y:0.7857275603552258},{x:0.2406062159909945,y:0.7847325056542677},{x:0.16433721599099446,y:0.7584545056542678},{x:0.1612047546311144,y:0.7570179671101032},{x:0.15801334200327716,y:0.7557176430739929},{x:0.09817134200327716,y:0.7241756430739928},{x:0.09479788711775466,y:0.721949723610623},{x:0.09138819905405325,y:0.7197797137879894},{x:0.05384019905405325,y:0.6903397137879895},{x:0.04746503339724546,y:0.6842424293748122},{x:0.0424018859405069,y:0.677018569451043},{x:0.0388453306011542,y:0.6689457429023652},{x:0.036932043806339465,y:0.6603341839257509},{x:0.036735552094603836,y:0.6515148299032538},{x:0.03826340653223549,y:0.6428266036640077},{x:0.041456892530026886,y:0.6346033888699733},{x:0.046193286212010486,y:0.6271611990540533},{x:0.05229057062518783,y:0.6207860333972455},{x:0.05951443054895701,y:0.615722885940507},{x:0.06758725709763488,y:0.6121663306011542},{x:0.07619881607424907,y:0.6102530438063395},{x:0.08501817009674617,y:0.6100565520946039},{x:0.09370639633599236,y:0.6115844065322356},{x:0.1019296111300268,y:0.6147778925300269},{x:0.10937180094594674,y:0.6195142862120105},{x:0.14372643260130716,y:0.6464504840370294},{x:0.1969218011618275,y:0.6744891243755197},{x:0.2615721948597163,y:0.6967640072977177},{x:0.3408866683163358,y:0.6923288252210377},{x:0.40955721054777616,y:0.6703524458415177},{x:0.4555820596629536,y:0.6332360369266462},{x:0.477752059875079,y:0.596814658492312},{x:0.4716998550115053,y:0.5642759337587675},{x:0.44042564505409965,y:0.532748518309004},{x:0.3700728058889163,y:0.5012285825754976},{x:0.28267158635688694,y:0.4816496665818946},{x:0.2026156257994338,y:0.47140070238604853},{x:0.19958923290487823,y:0.4707064281346213},{x:0.19652752938874105,y:0.4701896668089735},{x:0.19529880233776667,y:0.46972217540403877},{x:0.1940174323454584,y:0.4694282207777866},{x:0.19118463692903986,y:0.4681568668470777},{x:0.18828257832087977,y:0.4670527262205195},{x:0.18716866396437967,y:0.46635450477580015},{x:0.18596926283986664,y:0.4658162155208443},{x:0.1834389276407875,y:0.4640166393294268},{x:0.18080803842542348,y:0.46236755090702814},{x:0.17985174386742717,y:0.4614654316810775},{x:0.17878040392329292,y:0.4607034939516098},{x:0.17664976830422657,y:0.45844485220330683},{x:0.1743911520787843,y:0.45631418952832026},{x:0.17362922718285934,y:0.45524284045707714},{x:0.17272711941234267,y:0.45428653509274164},{x:0.17107806250525512,y:0.45165562612327925},{x:0.16927851662463225,y:0.44912526936741537},{x:0.1687402417372368,y:0.44792586179486843},{x:0.1680420336360506,y:0.4468119390745141},{x:0.1669379277730794,y:0.44390986724015796},{x:0.1656666077762714,y:0.4410770565945043},{x:0.16537266849946,y:0.43979568308103084},{x:0.16490519181337332,y:0.438566950430106},{x:0.16438846716364272,y:0.4355052407239498},{x:0.16369422916516244,y:0.43247883951296023},{x:0.16365592142049992,y:0.43116474252408066},{x:0.16343714101639506,y:0.42986841944927895},{x:0.1635276550184117,y:0.4267647316583033},{x:0.16343717819520762,y:0.42366104278329114},{x:0.1636559741278381,y:0.4223647223293339},{x:0.1636942976139514,y:0.42105062579943375},{x:0.1643885718653787,y:0.41802423290487795},{x:0.16490533319102646,y:0.414962529388741},{x:0.1653728245959611,y:0.41373380233776696},{x:0.1656667792222133,y:0.41245243234545836},{x:0.1669381331529224,y:0.40961963692903947},{x:0.16804227377948042,y:0.40671757832087974},{x:0.16874049522419982,y:0.4056036639643795},{x:0.16927878447915568,y:0.4044042628398666},{x:0.17107836067057278,y:0.40187392764078794},{x:0.1727274490929718,y:0.3992430384254234},{x:0.17362956831892262,y:0.3982867438674269},{x:0.17439150604839013,y:0.3972154039232929},{x:0.1766501477966929,y:0.39508476830422673},{x:0.1787808104716797,y:0.39282615207878424},{x:0.17985215954292283,y:0.39206422718285927},{x:0.18080846490725827,y:0.39116211941234263},{x:0.18343937387672077,y:0.38951306250525497},{x:0.18596973063258454,y:0.3877135166246322},{x:0.18716913820513145,y:0.3871752417372368},{x:0.1882830609254858,y:0.38647703363605057},{x:0.19118513275984234,y:0.3853729277730792},{x:0.19401794340549564,y:0.3841016077762714},{x:0.19529931691896882,y:0.38380766849946},{x:0.19652804956989395,y:0.38334019181337325},{x:0.19958975927605035,y:0.38282346716364263},{x:0.20261616048703973,y:0.3821292291651624},{x:0.28149235433605535,y:0.37203226198800626},{x:0.3678476199052635,y:0.34785057975990136},{x:0.4387239808422848,y:0.31155986033736477},{x:0.4773813812672204,y:0.26922136053481893},{x:0.48460036747312013,y:0.2304069273293995},{x:0.4680118822440525,y:0.1820955353962423},{x:0.4262197745588727,y:0.1363254129914362},{x:0.35583608100487274,y:0.09578139608686695},{x:0.3056218275014876,y:0.083895601213743},{x:0.2134048551529998,y:0.08581745449589688},{x:0.13726972612583144,y:0.09751265420048184},{x:0.0839251628848058,y:0.11344659691108305},{x:0.0752658675153883,y:0.11513070441124498},{x:0.06644440500388343,y:0.11509310753596806},{x:0.05779977920747511,y:0.11333525111208462},{x:0.0496641982475573,y:0.10992468857614723},{x:0.04235030793793329,y:0.10499248593374648},{x:0.036139176981525016,y:0.09872818496641873},{x:0.03126949565774486,y:0.09137251924727793},{x:0.027928403088916927,y:0.08320816288480577},{x:0.02624429558875499,y:0.07454886751538828}]],"4":[[{x:0.003828000000000005,y:0.27580099999999996},{x:0.0040512821902059844,y:0.2735339778783202},{x:0.004058111165048277,y:0.2712559968420181},{x:0.004482570943879651,y:0.26915502967601196},{x:0.004692662381854638,y:0.26702193550927417},{x:0.005353928343121064,y:0.26484203377636983},{x:0.005805038155045426,y:0.26260915577382815},{x:0.0066312204192078995,y:0.26063136609773396},{x:0.0072534210369921,y:0.25858024554357095},{x:0.008327258689269697,y:0.2565712366005347},{x:0.009205313441189196,y:0.2544692698811785},{x:0.010401468469599332,y:0.25269066304309135},{x:0.011411867446385462,y:0.25080033951411784},{x:0.01285700981091242,y:0.2490394284479652},{x:0.014128266351129452,y:0.24714915041402313},{x:0.01564842657685691,y:0.24563807727727646},{x:0.017008194846605366,y:0.24398119484660533},{x:0.018769105912757822,y:0.24253605248207852},{x:0.020384710565360974,y:0.24093010545831445},{x:0.022170457083446928,y:0.23974463571613375},{x:0.023827339514117918,y:0.23838486744638543},{x:0.025836348457154004,y:0.2373110297941079},{x:0.027734214441385185,y:0.2360511294240198},{x:0.029716922014597604,y:0.23523682001377813},{x:0.031607245543570965,y:0.23422642103699207},{x:0.03378714727647517,y:0.23356515507572567},{x:0.03589434066689576,y:0.23269971862397582},{x:0.03799781495511128,y:0.23228786299963877},{x:0.040048935509274235,y:0.2316656623818546},{x:0.04231595763095386,y:0.23144238019164864},{x:0.0445515001672978,y:0.23100466589573537},{x:0.046694905833262405,y:0.23101109143797494},{x:0.048828,y:0.23080099999999998},{x:0.36918100000000004,y:0.23080099999999998},{x:0.36918100000000004,y:0.05103000000000002},{x:0.37004566238185466,y:0.04225093550927423},{x:0.3726064210369921,y:0.03380924554357098},{x:0.3767648674463855,y:0.026029339514117924},{x:0.38236119484660536,y:0.019210194846605383},{x:0.38918033951411796,y:0.013613867446385479},{x:0.396960245543571,y:0.009455421036992116},{x:0.4054019355092743,y:0.006894662381854655},{x:0.414181,y:0.0060300000000000215},{x:0.4229600644907258,y:0.006894662381854655},{x:0.4314017544564291,y:0.009455421036992116},{x:0.43918166048588214,y:0.013613867446385486},{x:0.4460008051533947,y:0.019210194846605383},{x:0.45159713255361456,y:0.026029339514117924},{x:0.45575557896300795,y:0.03380924554357098},{x:0.4583163376181454,y:0.04225093550927425},{x:0.459181,y:0.05103000000000002},{x:0.459181,y:0.23080099999999998},{x:0.553224,y:0.23080099999999998},{x:0.5620030644907258,y:0.2316656623818546},{x:0.5704447544564291,y:0.23422642103699207},{x:0.5782246604858822,y:0.23838486744638543},{x:0.5850438051533947,y:0.24398119484660533},{x:0.5906401325536146,y:0.25080033951411784},{x:0.5947985789630079,y:0.25858024554357095},{x:0.5973593376181454,y:0.26702193550927417},{x:0.5982240000000001,y:0.27580099999999996},{x:0.5973593376181454,y:0.28458006449072576},{x:0.5947985789630079,y:0.293021754456429},{x:0.5906401325536146,y:0.3008016604858821},{x:0.5850438051533947,y:0.3076208051533946},{x:0.5782246604858822,y:0.3132171325536145},{x:0.5704447544564291,y:0.3173755789630079},{x:0.5620030644907258,y:0.31993633761814533},{x:0.553224,y:0.32080099999999995},{x:0.459181,y:0.32080099999999995},{x:0.459181,y:0.421833},{x:0.4583163376181454,y:0.4306120644907258},{x:0.45575557896300795,y:0.439053754456429},{x:0.45159713255361456,y:0.4468336604858821},{x:0.4460008051533947,y:0.4536528051533947},{x:0.43918166048588214,y:0.45924913255361455},{x:0.4314017544564291,y:0.4634075789630079},{x:0.4229600644907258,y:0.4659683376181454},{x:0.414181,y:0.466833},{x:0.4054019355092743,y:0.4659683376181454},{x:0.396960245543571,y:0.4634075789630079},{x:0.38918033951411796,y:0.45924913255361455},{x:0.38236119484660536,y:0.4536528051533947},{x:0.3767648674463855,y:0.4468336604858821},{x:0.3726064210369921,y:0.439053754456429},{x:0.37004566238185466,y:0.4306120644907258},{x:0.36918100000000004,y:0.421833},{x:0.36918100000000004,y:0.32080099999999995},{x:0.1436046917940101,y:0.32080099999999995},{x:0.4533648945416855,y:0.700560710565361},{x:0.45824387057598015,y:0.7079102144413851},{x:0.4615952813760241,y:0.7160703406668958},{x:0.46329033410426457,y:0.7247275001672978},{x:0.46326388883495173,y:0.7335490031579818},{x:0.46151696184495455,y:0.7421958442261718},{x:0.45811668655881077,y:0.7503357301188214},{x:0.4531937336488705,y:0.7576558495859769},{x:0.446937289434639,y:0.7638748945416856},{x:0.4395877855586148,y:0.7687538705759801},{x:0.43142765933310423,y:0.7721052813760241},{x:0.42277049983270215,y:0.7738003341042645},{x:0.41394899684201814,y:0.7737738888349517},{x:0.40530215577382817,y:0.7720269618449546},{x:0.39716226988117853,y:0.7686266865588108},{x:0.38984215041402315,y:0.7637037336488706},{x:0.38362310545831446,y:0.757447289434639},{x:0.013957105458314502,y:0.304244289434639},{x:0.012771635716133971,y:0.30245854291655333},{x:0.011411867446385462,y:0.3008016604858821},{x:0.010338029794107799,y:0.29879265154284573},{x:0.009078129424019837,y:0.29689478555861476},{x:0.008263820013778204,y:0.2949120779854024},{x:0.0072534210369921,y:0.293021754456429},{x:0.006592155075725704,y:0.29084185272352475},{x:0.005726718623975863,y:0.2887346593331042},{x:0.0053148629996388475,y:0.28663118504488877},{x:0.004692662381854638,y:0.28458006449072576},{x:0.00446938019164866,y:0.282313042369046},{x:0.00403166589573542,y:0.2800774998327022},{x:0.00403809143797499,y:0.27793409416673776},{x:0.003828000000000005,y:0.27580099999999996}]],"5":[[{x:0.029951000000000005,y:0.38529899999999995},{x:0.030026331329377584,y:0.3845341481773043},{x:0.029977079633894697,y:0.38376717530271315},{x:0.030458063889865227,y:0.38015069392879464},{x:0.03081566238185464,y:0.37651993550927415},{x:0.03103876142924568,y:0.3757844765131909},{x:0.03114008507636279,y:0.3750226322781917},{x:0.0323173678705276,y:0.3715694759531816},{x:0.0333764210369921,y:0.36807824554357094},{x:0.033738714231120716,y:0.3674004426508694},{x:0.033986719409902104,y:0.366673004302166},{x:0.03581505842470893,y:0.3635158758870829},{x:0.03753486744638546,y:0.3602983395141178},{x:0.03802243206297786,y:0.35970424030984804},{x:0.03840758807348568,y:0.3590391628952293},{x:0.04081672126593952,y:0.35629938906452685},{x:0.04313119484660537,y:0.3534791948466053},{x:0.04372529405087513,y:0.3529916302300129},{x:0.04423279956362368,y:0.3524144723015426},{x:0.04713014529619686,y:0.3501973410270508},{x:0.04995033951411792,y:0.3478828674463854},{x:0.05062814240681941,y:0.3475205742522568},{x:0.05123849426956635,y:0.347053515665452},{x:0.054512709170605814,y:0.34544423005866864},{x:0.057730245543570965,y:0.343724421036992},{x:0.05846570453965444,y:0.3435013219896009},{x:0.05915544727260316,y:0.34316231154402344},{x:0.06268070509966306,y:0.34222271554831923},{x:0.06617193550927424,y:0.3411636623818546},{x:0.0669367873319697,y:0.34108833105247705},{x:0.06767941450870582,y:0.34089039672943083},{x:0.07132024158048059,y:0.34065659849198926},{x:0.074951,y:0.34029899999999996},{x:0.0757158518226955,y:0.3403743313293775},{x:0.07648282469728679,y:0.34032507963389463},{x:0.08009930607120508,y:0.3408060638898651},{x:0.08373006449072577,y:0.3411636623818546},{x:0.0844655234868091,y:0.3413867614292456},{x:0.08522736772180821,y:0.34148808507636275},{x:0.2701097088502776,y:0.3848544225750548},{x:0.39095673206080095,y:0.3699215697302287},{x:0.4312208460684155,y:0.34735587040502247},{x:0.4569274445394237,y:0.3179203076157562},{x:0.4808881134259603,y:0.2201177906149206},{x:0.47151862074291284,y:0.1781066999956386},{x:0.4461217481742335,y:0.14395206669668215},{x:0.3876788357927069,y:0.10680533743499816},{x:0.3169820044514503,y:0.08634947983662909},{x:0.2505487358362677,y:0.08307118781270932},{x:0.19638270317906092,y:0.09339965838335124},{x:0.15518503458472022,y:0.11245499400015477},{x:0.1051531598037562,y:0.15775209985578706},{x:0.09806479623887651,y:0.16300326318775482},{x:0.09008818244690309,y:0.16677065575830224},{x:0.0815298552225249,y:0.16890949878372125},{x:0.07271870628140957,y:0.16933759772602197},{x:0.06399334313601493,y:0.16803850098293246},{x:0.05568907659877849,y:0.16506213211374782},{x:0.04812503497563989,y:0.16052287130494386},{x:0.041591900144212934,y:0.15459515980375618},{x:0.03634073681224515,y:0.1475067962388765},{x:0.03257334424169774,y:0.13953018244690307},{x:0.03043450121627874,y:0.13097185522252489},{x:0.03000640227397801,y:0.12216070628140954},{x:0.031305499017067515,y:0.1134353431360149},{x:0.034281867886252176,y:0.10513107659877846},{x:0.03882112869505611,y:0.09756703497563987},{x:0.044748840196243804,y:0.09103390014421289},{x:0.09986584019624378,y:0.041132900144212926},{x:0.10178680031290575,y:0.03970982481314967},{x:0.10357183338498165,y:0.03811957700249835},{x:0.10532248536915285,y:0.037090537646117014},{x:0.10695420376112348,y:0.035881736812245144},{x:0.10911588139237749,y:0.0348607662023731},{x:0.11117685751196796,y:0.03364931723433351},{x:0.16362485751196798,y:0.009390317234333478},{x:0.1646572774363771,y:0.009030847933342759},{x:0.16562545909873666,y:0.008523173483185618},{x:0.16881529925253239,y:0.0075831025339957205},{x:0.1719558576504946,y:0.006489618860012841},{x:0.17303856889723523,y:0.006338471796353147},{x:0.17408718959239433,y:0.0060294350406820685},{x:0.23897018959239436,y:-0.00634256495931787},{x:0.2399001168767359,y:-0.006426714843400178},{x:0.24080591100583193,y:-0.006653392925378379},{x:0.24428588214420577,y:-0.0068235863462415185},{x:0.247755834543085,y:-0.007137585190079683},{x:0.24868431036339586,y:-0.007038698344381461},{x:0.24961692261229596,y:-0.007084309202250054},{x:0.32666292261229596,y:-0.003282309202250082},{x:0.32746661284147915,y:-0.0031629125067284265},{x:0.32827905619988357,y:-0.00317336931171093},{x:0.3318231917274382,y:-0.002515696572186591},{x:0.33538870069659477,y:-0.001986002452099067},{x:0.33615365510360457,y:-0.0017121077449900682},{x:0.3369525276121403,y:-0.0015638637889859724},{x:0.4188855276121403,y:0.02214313621101406},{x:0.4207304127428032,y:0.02287964098341223},{x:0.42264402370761556,y:0.023412682727046455},{x:0.4248170355152836,y:0.024511079778651145},{x:0.4270783417525648,y:0.02541382586724525},{x:0.42874409297954025,y:0.02649609814118395},{x:0.43051694316083267,y:0.027392224616519634},{x:0.5014129431608326,y:0.07245422461651957},{x:0.5044011686844615,y:0.0747943741105689},{x:0.5074525565132345,y:0.07705154573740032},{x:0.5078697672823866,y:0.07751071502587484},{x:0.5083582165656543,y:0.07789323111579813},{x:0.5108324836553944,y:0.0807713891731658},{x:0.5133848875831327,y:0.08358048611421783},{x:0.5494628875831328,y:0.1320994861142178},{x:0.5497798823390716,y:0.1326268676033582},{x:0.5501811109693575,y:0.13309337858567127},{x:0.5520495631508493,y:0.13640291633591076},{x:0.5540074974944301,y:0.13966031511116345},{x:0.5542155142604781,y:0.14023940572188273},{x:0.5545180216173755,y:0.1407752286491667},{x:0.5557049132287019,y:0.14438569149730107},{x:0.5569897394368822,y:0.14796247431004633},{x:0.5570807842453774,y:0.1485710199149322},{x:0.5572729451408087,y:0.14915556341258465},{x:0.5710219451408087,y:0.2108035634125847},{x:0.5712046210163666,y:0.21230267395853206},{x:0.5715791512667351,y:0.2137656948046034},{x:0.571736996194895,y:0.21667155541097086},{x:0.5720890113736304,y:0.2195603313107129},{x:0.5719757152243157,y:0.2210662751632623},{x:0.5720576277729665,y:0.2225742517011615},{x:0.5716455344736617,y:0.2254550710286549},{x:0.5714272135589309,y:0.2283570146640783},{x:0.5710222992922247,y:0.22981191924551903},{x:0.5708084462858501,y:0.23130690078257787},{x:0.5417354462858501,y:0.3499769007825779},{x:0.5411002871662289,y:0.3517814599872898},{x:0.540669734049328,y:0.3536454570484658},{x:0.5396393400617131,y:0.355932176655931},{x:0.5388066121493867,y:0.3582980512419798},{x:0.5378316053978042,y:0.3599440229503987},{x:0.537045677451414,y:0.361688207084494},{x:0.5355889653307644,y:0.36372996812105773},{x:0.5343106788169316,y:0.36588792593376723},{x:0.5330332933960605,y:0.36731205637621067},{x:0.5319221933904076,y:0.36886939956510134},{x:0.49389619339040763,y:0.4124113995651013},{x:0.49150876583293945,y:0.41465677330496736},{x:0.4892379705562563,y:0.41702003426923534},{x:0.48830169237996507,y:0.41767302336482964},{x:0.48747017448549057,y:0.4184550652905171},{x:0.4846905699931398,y:0.420191530792605},{x:0.4820023580684325,y:0.4220663721783498},{x:0.4272473580684325,y:0.4527533721783498},{x:0.42330567688981036,y:0.45447898255061825},{x:0.4193723578126433,y:0.45622356923745777},{x:0.4192660752068488,y:0.4562474610875831},{x:0.4191662841579818,y:0.4562911481493166},{x:0.41496369139475175,y:0.45721461755172516},{x:0.4107655979622113,y:0.4581583300092093},{x:0.27317359796221125,y:0.47516033000920926},{x:0.26964530070808584,y:0.4752477446385603},{x:0.2661231753027132,y:0.4754739203661053},{x:0.26524270860794985,y:0.4753568201865933},{x:0.26435476148695686,y:0.47537881934450843},{x:0.2608772057270339,y:0.4747762176787918},{x:0.2573786322781918,y:0.4743109149236372},{x:0.119951,y:0.44207564006371447},{x:0.119951,y:0.684004},{x:0.527101,y:0.684004},{x:0.5358800644907258,y:0.6848686623818546},{x:0.544321754456429,y:0.6874294210369921},{x:0.5521016604858822,y:0.6915878674463855},{x:0.5589208051533947,y:0.6971841948466053},{x:0.5645171325536146,y:0.7040033395141179},{x:0.5686755789630079,y:0.711783245543571},{x:0.5712363376181454,y:0.7202249355092742},{x:0.5721010000000001,y:0.729004},{x:0.5712363376181454,y:0.7377830644907257},{x:0.5686755789630079,y:0.746224754456429},{x:0.5645171325536146,y:0.7540046604858821},{x:0.5589208051533947,y:0.7608238051533946},{x:0.5521016604858822,y:0.7664201325536145},{x:0.544321754456429,y:0.7705785789630079},{x:0.5358800644907258,y:0.7731393376181454},{x:0.527101,y:0.774004},{x:0.074951,y:0.774004},{x:0.06617193550927424,y:0.7731393376181454},{x:0.05773024554357094,y:0.7705785789630079},{x:0.04995033951411792,y:0.7664201325536145},{x:0.04313119484660537,y:0.7608238051533946},{x:0.03753486744638546,y:0.7540046604858821},{x:0.0333764210369921,y:0.746224754456429},{x:0.03081566238185464,y:0.7377830644907257},{x:0.029951000000000005,y:0.729004},{x:0.029951000000000005,y:0.38529899999999995}]],"6":[[{x:0.01994450211145162,y:0.2755194646798348},{x:0.020758274672659796,y:0.26806396163938684},{x:0.0201773643330274,y:0.24423363638780976},{x:0.020440223451033163,y:0.2406784570189078},{x:0.020568639264984916,y:0.237115887070161},{x:0.02076496657089406,y:0.23628629421823594},{x:0.02082782677693791,y:0.23543610758842642},{x:0.021779216218601925,y:0.23200052126419074},{x:0.022600187477202785,y:0.22853145778054884},{x:0.04459918747720279,y:0.16442145778054884},{x:0.04602253566469808,y:0.16130748249724527},{x:0.047307319174730654,y:0.15813382633120915},{x:0.06831231917473066,y:0.11806482633120913},{x:0.06934150993632018,y:0.11649740482650416},{x:0.07018719324152095,y:0.11482382676006757},{x:0.07175673818837072,y:0.11281909673987861},{x:0.07315419088510985,y:0.11069082519836773},{x:0.0744693948008918,y:0.10935430641546007},{x:0.07562532742241568,y:0.1078778703106287},{x:0.1253733274224157,y:0.055788870310628645},{x:0.12585541612958862,y:0.055374327647901005},{x:0.12626130847256478,y:0.0548849335871293},{x:0.1291958120945167,y:0.0525019586891126},{x:0.1320620582603259,y:0.05003730581521479},{x:0.13261575702973094,y:0.04972477931463493},{x:0.1331093263100589,y:0.049323974491408525},{x:0.1861743263100589,y:0.014262974491408516},{x:0.18683955107784095,y:0.013911818906951787},{x:0.187438960697758,y:0.013457349607970202},{x:0.1907349034619545,y:0.011855559414887177},{x:0.19397565070571454,y:0.010144849670490022},{x:0.19469660042216425,y:0.009930220356283175},{x:0.19537315511619574,y:0.009601422573216056},{x:0.19891826102894206,y:0.008673416864759805},{x:0.2024304811380398,y:0.007627816351770726},{x:0.20317945010986724,y:0.007557961391993223},{x:0.20390715026053782,y:0.0073674706392518954},{x:0.2857161502605378,y:-0.005654529360748083},{x:0.2860775594607644,y:-0.005676122674759226},{x:0.28642923596273784,y:-0.0057621838110407525},{x:0.2904772893795591,y:-0.005938995755027237},{x:0.2945219894833068,y:-0.006180656673914681},{x:0.2948806669536751,y:-0.006131327641200151},{x:0.2952423757850646,y:-0.006147126454864343},{x:0.38700037578506463,y:-0.001139126454864331},{x:0.39074801870473747,y:-0.000562375362895672},{x:0.3945101708776463,y:-0.00008942684208443352},{x:0.395102371884912,y:0.00010774663253235539},{x:0.3957192721812796,y:0.00020268575218489876},{x:0.39928238663684656,y:0.0014994835976446027},{x:0.4028799824314506,y:0.002697304024131271},{x:0.47474098243145063,y:0.03475230402413133},{x:0.4764407459001163,y:0.03572046389197228},{x:0.4782361407270164,y:0.03649705052245801},{x:0.48026428101539703,y:0.03789829234877595},{x:0.4824063061811086,y:0.03911835786940705},{x:0.4838845305509628,y:0.04039952221931584},{x:0.48549392283388365,y:0.041511451110380196},{x:0.5363469228338836,y:0.08458545111038014},{x:0.5369424578291695,y:0.08519979361043255},{x:0.5376274627831791,y:0.08571247952886965},{x:0.5400078699953618,y:0.08836201411598918},{x:0.5424869876672573,y:0.09091942444541115},{x:0.5429512273484354,y:0.09163814564059086},{x:0.5435230500634102,y:0.09227461827992436},{x:0.5453408198626901,y:0.09533763721244376},{x:0.5472733759789791,y:0.0983295594844189},{x:0.5475884798754501,y:0.09912503932225875},{x:0.5480251455251356,y:0.09986083939589693},{x:0.5756631455251356,y:0.15896283939589692},{x:0.5756676990332947,y:0.1589757429605767},{x:0.575674675284325,y:0.15898751446598428},{x:0.5771354507402345,y:0.1631350040011944},{x:0.5785987361645655,y:0.16728160865370237},{x:0.5786006848177536,y:0.16729515262537814},{x:0.5786052305152959,y:0.16730805894366996},{x:0.5792288025114348,y:0.17166083878445604},{x:0.5798550088797246,y:0.1760132404159827},{x:0.5798542777922926,y:0.17602690430741857},{x:0.5798562182477396,y:0.17604044945602063},{x:0.5820672182477395,y:0.2261264494560206},{x:0.5819074721227447,y:0.22907858468741052},{x:0.5819395990078049,y:0.232034864293962},{x:0.5816696541741431,y:0.23347350033714379},{x:0.5815905637246603,y:0.23493510513282764},{x:0.580857954063737,y:0.2377993509905685},{x:0.5803127220992973,y:0.2407050941577823},{x:0.5648357220992973,y:0.2937960941577823},{x:0.5632290277642941,y:0.2977974374258546},{x:0.5616400226499054,y:0.30180583827676916},{x:0.5384240226499054,y:0.3468838382767692},{x:0.5373215489467563,y:0.3485896803397862},{x:0.5364060617863755,y:0.35040275195151915},{x:0.5349331318310961,y:0.3522852445680167},{x:0.5336357086983223,y:0.35429272914301846},{x:0.5322216254408594,y:0.35575071197935654},{x:0.5309700163849885,y:0.3573503432435408},{x:0.49559401638498846,y:0.39441334324354077},{x:0.4926979475395651,y:0.39690515537305066},{x:0.48986855873600776,y:0.3994724304741097},{x:0.48935820160472765,y:0.3997787125549045},{x:0.48890701524930746,y:0.4001669186691625},{x:0.48558046512393155,y:0.4020458563236817},{x:0.4823045917066957,y:0.404011815580751},{x:0.4336605917066957,y:0.42705181558075106},{x:0.43309173356321873,y:0.4272557130907893},{x:0.4325654489917744,y:0.42755269513041455},{x:0.42894434743018467,y:0.4287422729922158},{x:0.4253563740806812,y:0.43002832091195864},{x:0.42475866795602985,y:0.4301173218701226},{x:0.42418455747331046,y:0.430305924456616},{x:0.35674655747331047,y:0.44533192445661596},{x:0.3529000911149492,y:0.4457998510145922},{x:0.3490659246900917,y:0.4463596961147396},{x:0.28494592469009167,y:0.4493636961147396},{x:0.2805873413475358,y:0.449139645094856},{x:0.27622830276644406,y:0.44892463285807194},{x:0.20879130276644411,y:0.4389076328580719},{x:0.2058686377582091,y:0.4381749274884603},{x:0.2029059705898912,y:0.4376259000221244},{x:0.2015992206546876,y:0.4371045944779896},{x:0.20023455588710068,y:0.4367624761715421},{x:0.19751099279397463,y:0.4354736658725529},{x:0.19471236238975773,y:0.4343572001231398},{x:0.1250653623897577,y:0.39829620012313977},{x:0.12281565387932818,y:0.3968352958512946},{x:0.12046004217050754,y:0.3955521266688945},{x:0.11912493361112,y:0.39443863469229795},{x:0.1176668837895426,y:0.39349181371392206},{x:0.11574541108214431,y:0.3916200839502759},{x:0.11440461043594556,y:0.3905018447245139},{x:0.11499744675527566,y:0.4076710597897629},{x:0.14015918883207887,y:0.48309781218266834},{x:0.17625691985197756,y:0.5624688107059582},{x:0.22079283681825793,y:0.6049160879451294},{x:0.2812243215554422,y:0.6473094683632384},{x:0.35529887985725983,y:0.6721340784004237},{x:0.44197867319461825,y:0.699237682451455},{x:0.450099621980826,y:0.7026829408131323},{x:0.45739239245003865,y:0.7076463180152294},{x:0.4635767275229571,y:0.7139370742553635},{x:0.4684149666709443,y:0.7213134592991232},{x:0.47172117907685873,y:0.729492002806001},{x:0.4733683088520865,y:0.7381584079356077},{x:0.4732930577230865,y:0.7469796295989887},{x:0.471498317548545,y:0.7556166731946181},{x:0.4680530591868676,y:0.7637376219808258},{x:0.4630896819847706,y:0.7710303924500386},{x:0.4567989257446365,y:0.7772147275229571},{x:0.4494225407008768,y:0.7820529666709441},{x:0.4412439971939989,y:0.7853591790768587},{x:0.43257759206439217,y:0.7870063088520864},{x:0.4237563704010112,y:0.7869310577230865},{x:0.41511932680538177,y:0.7851363175485448},{x:0.32800332680538175,y:0.7578963175485449},{x:0.32758097645219697,y:0.7577171382279785},{x:0.32713377373466446,y:0.7576146941984534},{x:0.2464307737346645,y:0.7305686941984535},{x:0.24453959681011464,y:0.7297206474805041},{x:0.2425703892464572,y:0.7290741531131611},{x:0.24052462272791658,y:0.727920241844807},{x:0.2383814751569417,y:0.7269592057619036},{x:0.2366920823739949,y:0.725758503708645},{x:0.23488683737580707,y:0.7247402582115807},{x:0.16634483737580705,y:0.6766572582115807},{x:0.16379281785599412,y:0.6744641039532857},{x:0.16114120086592887,y:0.6723924725748345},{x:0.10785520086592887,y:0.6216054725748346},{x:0.10512406158167997,y:0.61843588774195},{x:0.10236095541706475,y:0.6152941312068447},{x:0.10224621895073822,y:0.6150960484276141},{x:0.1020967920615373,y:0.6149226331776604},{x:0.10003648617852028,y:0.6112811321861437},{x:0.09793939861820375,y:0.6076606883504815},{x:0.057256398618203745,y:0.5182076883504814},{x:0.05649445644348035,y:0.515973451082899},{x:0.055531562043165734,y:0.5138181769891187},{x:0.02756156204316574,y:0.4299731769891187},{x:0.02710606704062858,y:0.4279720709807987},{x:0.026442901166776424,y:0.42602987841114226},{x:0.0261294707087366,y:0.42368163359604843},{x:0.025603668479436986,y:0.4213716499642221},{x:0.02554732210120287,y:0.4193201319800137},{x:0.025275801747494525,y:0.4172858808521062},{x:0.022290801747494524,y:0.3308368808521062},{x:0.022305383523873214,y:0.330608131273329},{x:0.022277364333027405,y:0.33038063638780973},{x:0.021194122115214913,y:0.2859434614650037},{x:0.02071653916751727,y:0.2843071590959475},{x:0.01994450211145162,y:0.2755194646798348}],[{x:0.11034731747482908,y:0.25010871966048204},{x:0.11054573733688708,y:0.2582483748303443},{x:0.14138614929871246,y:0.28974619429248377},{x:0.17280436841728808,y:0.32166563054627706},{x:0.2294333737827033,y:0.3509863272379111},{x:0.2851142784460479,y:0.35925709287120927},{x:0.3409693478959939,y:0.3566403020317264},{x:0.39969116147327427,y:0.34355637352239615},{x:0.43624565447916347,y:0.3262425111990739},{x:0.46138408324665353,y:0.29990528863548604},{x:0.47964461062187336,y:0.2644492215688011},{x:0.49182659739178797,y:0.22266115801633354},{x:0.4903391577658353,y:0.18896604218391924},{x:0.47066764412974615,y:0.14689983627465894},{x:0.4322187986209955,y:0.11433252320671945},{x:0.3738017517723872,y:0.08827446060346957},{x:0.29512698962943984,y:0.08398052210424463},{x:0.22766698305582697,y:0.09471851188045},{x:0.18695506157646963,y:0.1216176107024183},{x:0.1450838647757246,y:0.1654591474507099},{x:0.12861258258928074,y:0.1968796571354811},{x:0.11034731747482908,y:0.25010871966048204}]],"7":[[{x:0.026534000000000002,y:0.729004},{x:0.027398662381854635,y:0.7202249355092742},{x:0.029959421036992097,y:0.711783245543571},{x:0.03411786744638546,y:0.7040033395141179},{x:0.039714194846605363,y:0.6971841948466053},{x:0.046533339514117915,y:0.6915878674463855},{x:0.05431324554357096,y:0.6874294210369921},{x:0.06275493550927423,y:0.6848686623818546},{x:0.071534,y:0.684004},{x:0.4019606654607806,y:0.684004},{x:0.4004737160341744,y:0.6825246433416329},{x:0.3773547160341744,y:0.6545006433416328},{x:0.37631768094411194,y:0.6529571778549935},{x:0.37511206403824765,y:0.6515414747212956},{x:0.3516100640382476,y:0.6177174747212957},{x:0.35070717908442606,y:0.6160998190359583},{x:0.34962595461558005,y:0.6145955036421288},{x:0.32637595461558006,y:0.5744575036421288},{x:0.32562538351875275,y:0.5728072168885044},{x:0.3246890272988689,y:0.5712547864166106},{x:0.3023170272988689,y:0.5242907864166106},{x:0.3017220252289498,y:0.5226423026482856},{x:0.3009361907094137,y:0.5210757809262708},{x:0.2800741907094137,y:0.4667717809262708},{x:0.2796297795277362,y:0.4651572895546526},{x:0.27899211910181604,y:0.46360891205912846},{x:0.26027511910181605,y:0.40145091205912853},{x:0.2599700482242006,y:0.399900691568321},{x:0.2594722021762355,y:0.3984012246220316},{x:0.2435242021762355,y:0.3278752246220315},{x:0.24329560198997774,y:0.32604433113097486},{x:0.24285939794168837,y:0.32425152465814894},{x:0.22552039794168838,y:0.201651524658149},{x:0.22543629437721757,y:0.19966542745190077},{x:0.2251384028560513,y:0.1976999971774209},{x:0.21759140285605127,y:0.0533799971774209},{x:0.2179964236931644,y:0.04456775725283754},{x:0.22011284489303193,y:0.03600385769296016},{x:0.22385933357584556,y:0.028017404355184638},{x:0.22909191428257988,y:0.020915312162427036},{x:0.23560950187114016,y:0.014970510534755857},{x:0.24316162910560324,y:0.010411454864839347},{x:0.25145807197163045,y:0.007413347105324521},{x:0.2601800028225791,y:0.006091402856051323},{x:0.26899224274716244,y:0.0064964236931644576},{x:0.27755614230703984,y:0.008612844893031955},{x:0.2855425956448154,y:0.0123593335758456},{x:0.29264468783757297,y:0.017591914282579925},{x:0.29858948946524416,y:0.02410950187114019},{x:0.30314854513516065,y:0.03166162910560326},{x:0.30614665289467546,y:0.03995807197163046},{x:0.3074685971439487,y:0.04868000282257914},{x:0.3149118365119932,y:0.19101580586964154},{x:0.33171443080019297,y:0.3098230069615897},{x:0.3469078029209317,y:0.3770118558572018},{x:0.3646876244488305,y:0.43605754408347375},{x:0.3843219343355222,y:0.48716585412502805},{x:0.40516196826036527,y:0.5309139031705462},{x:0.42657620329737017,y:0.5678827017045378},{x:0.4479617026009278,y:0.5986606409626235},{x:0.4682073320853445,y:0.6232016470905397},{x:0.5069453480603512,y:0.6602460238293135},{x:0.5211069187127709,y:0.670919967941474},{x:0.553634852004927,y:0.6903949675582732},{x:0.5545334052571363,y:0.6910607030437311},{x:0.5555196604858821,y:0.6915878674463855},{x:0.5580709875097788,y:0.6936816874233654},{x:0.5607229359621996,y:0.6956465083018619},{x:0.5614743452153894,y:0.6964747509099635},{x:0.5623388051533946,y:0.6971841948466053},{x:0.5644326251303754,y:0.699735521870503},{x:0.5666502995990071,y:0.7021799587443133},{x:0.5672256886169725,y:0.7031388795761127},{x:0.5679351325536145,y:0.7040033395141179},{x:0.5694909811561905,y:0.7069141275182039},{x:0.5711891576548912,y:0.709744242049125},{x:0.5715664145603537,y:0.7107969903148255},{x:0.5720935789630078,y:0.711783245543571},{x:0.5730516658019124,y:0.7149416345772374},{x:0.5741650843601849,y:0.7180486670509921},{x:0.5743297113818354,y:0.7191547862251302},{x:0.5746543376181453,y:0.7202249355092742},{x:0.574977843953461,y:0.7235095504532041},{x:0.5754637165205229,y:0.7267740993542682},{x:0.5754093871342436,y:0.7278910818973009},{x:0.575519,y:0.729004},{x:0.5751954936646845,y:0.7322886149439295},{x:0.5750351484302645,y:0.735585225488817},{x:0.5747639504839017,y:0.7366701463880269},{x:0.5746543376181453,y:0.7377830644907257},{x:0.5736962507792408,y:0.7409414535243923},{x:0.5728958497207748,y:0.7441434388186243},{x:0.5724182051993175,y:0.7451546051722857},{x:0.5720935789630078,y:0.746224754456429},{x:0.570537730360432,y:0.749135542460515},{x:0.5691280324417267,y:0.752119852004927},{x:0.5684622969562688,y:0.7530184052571364},{x:0.5679351325536145,y:0.7540046604858821},{x:0.5658413125766343,y:0.756555987509779},{x:0.563876491698138,y:0.7592079359621996},{x:0.5630482490900365,y:0.7599593452153895},{x:0.5623388051533946,y:0.7608238051533946},{x:0.5597874781294971,y:0.7629176251303754},{x:0.5573430412556867,y:0.7651352995990072},{x:0.5563841204238874,y:0.7657106886169726},{x:0.5555196604858821,y:0.7664201325536145},{x:0.5526088724817957,y:0.7679759811561907},{x:0.5497787579508749,y:0.7696741576548912},{x:0.5487260096851745,y:0.7700514145603538},{x:0.547739754456429,y:0.7705785789630079},{x:0.5445813654227618,y:0.7715366658019126},{x:0.5414743329490078,y:0.7726500843601849},{x:0.5403682137748697,y:0.7728147113818356},{x:0.5392980644907257,y:0.7731393376181454},{x:0.5360134495467959,y:0.773462843953461},{x:0.5327489006457318,y:0.7739487165205229},{x:0.531631918102699,y:0.7738943871342436},{x:0.530519,y:0.774004},{x:0.071534,y:0.774004},{x:0.06275493550927423,y:0.7731393376181454},{x:0.054313245543570934,y:0.7705785789630079},{x:0.046533339514117915,y:0.7664201325536145},{x:0.039714194846605363,y:0.7608238051533946},{x:0.03411786744638546,y:0.7540046604858821},{x:0.029959421036992097,y:0.746224754456429},{x:0.027398662381854635,y:0.7377830644907257},{x:0.026534000000000002,y:0.729004}]],"8":[[{x:0.018998734783549534,y:0.19034712298183487},{x:0.01918983868826437,y:0.187136446932327},{x:0.01920952916989005,y:0.18392014879903562},{x:0.019451409422642358,y:0.18274188004279768},{x:0.019522877627479743,y:0.18154116541629586},{x:0.0203366813486396,y:0.1784294641291047},{x:0.020983462121705806,y:0.17527880768498513},{x:0.021450563544301488,y:0.17417036752890672},{x:0.021754906310756543,y:0.17300666705236456},{x:0.02316013582774355,y:0.17011352146289485},{x:0.024409151469860245,y:0.16714958466818597},{x:0.06244715146986025,y:0.097021584668186},{x:0.06364531823888224,y:0.0952519506947441},{x:0.06465809579443724,y:0.09337006609963419},{x:0.0661122558858275,y:0.09160840391706095},{x:0.06739294989385258,y:0.08971688123025286},{x:0.06891333268610705,y:0.08821500101819715},{x:0.07027378747657535,y:0.08656685940733966},{x:0.07204368953204261,y:0.0851227396301211},{x:0.07366879313388441,y:0.08351741302778071},{x:0.0754529644913056,y:0.08234100299139627},{x:0.07710881500204132,y:0.08098994152260804},{x:0.14910981500204132,y:0.03317594152260801},{x:0.1504928100364302,y:0.03244176283843531},{x:0.15177178054792087,y:0.031538475488709236},{x:0.15438005907773164,y:0.030378172358910993},{x:0.15690151209615905,y:0.029039630272177964},{x:0.1584011644246711,y:0.028589367572161194},{x:0.15983178249634203,y:0.027952951404511282},{x:0.24949378249634205,y:-0.0017990485954887184},{x:0.251605077566582,y:-0.002276091838878668},{x:0.25365804064979064,y:-0.002962007073194259},{x:0.2558970148670134,y:-0.0032458471890824472},{x:0.2580984148155577,y:-0.003743249464233246},{x:0.2602622084630055,y:-0.003799233220341744},{x:0.26240953986016613,y:-0.0040714555567724145},{x:0.33848653986016614,y:-0.006196455556772458},{x:0.34211630259529946,y:-0.0059410451417675775},{x:0.3457527120689106,y:-0.005810898556388326},{x:0.34651004211407876,y:-0.005631877045722989},{x:0.3472863241290845,y:-0.005577253499755554},{x:0.35079651389094996,y:-0.004618619143417753},{x:0.3543376604369356,y:-0.0037815449929937683},{x:0.4535096604369356,y:0.03022045500700621},{x:0.45591274590665615,y:0.03131812424947078},{x:0.4583949217344816,y:0.03222283453480715},{x:0.45991547545056405,y:0.03314647083206772},{x:0.461533744189149,y:0.033885655452327273},{x:0.46367651039942226,y:0.035431052006208004},{x:0.4659344916938285,y:0.03680262701864639},{x:0.5338604916938285,y:0.08780462701864639},{x:0.5368034713408607,y:0.09050382186837246},{x:0.5397962541268131,y:0.09314768896709699},{x:0.5400513850489728,y:0.09348269124727963},{x:0.5403617177400871,y:0.09376731720532937},{x:0.5427215620660051,y:0.09698879462990716},{x:0.5451410464862535,y:0.10016572352111452},{x:0.5453259194365666,y:0.1005440624001799},{x:0.5455747614022292,y:0.10088376225489704},{x:0.547260782913003,y:0.10450372268352329},{x:0.5490139895381407,y:0.10809162577156875},{x:0.5802599895381407,y:0.1920326257715688},{x:0.5808621946470703,y:0.19431314395649216},{x:0.5816704362178704,y:0.19652903198349428},{x:0.5819856183913868,y:0.19856748893015458},{x:0.5825122482529622,y:0.20056180773987195},{x:0.5826579751325236,y:0.20291599079595712},{x:0.5830183882594349,y:0.20524698126417715},{x:0.5829298310737253,y:0.20730775882392333},{x:0.5830572695913885,y:0.20936649774620245},{x:0.5827409180393249,y:0.21170387573884492},{x:0.582639652248002,y:0.21406038999182395},{x:0.570412652248002,y:0.30012638999182395},{x:0.5703409363500996,y:0.30042034316527866},{x:0.5703238989157716,y:0.30072243812390526},{x:0.5692961437829783,y:0.3047027979582916},{x:0.5683217827960937,y:0.30869656381164773},{x:0.5681940974797931,y:0.30897087767968473},{x:0.5681184516122305,y:0.3092638441298401},{x:0.5663339148242972,y:0.3129672173863048},{x:0.5645991308441736,y:0.31669415574996157},{x:0.5644203829845738,y:0.31693828858446854},{x:0.5642890357120441,y:0.31721086798977133},{x:0.5618162960169492,y:0.32049493611094637},{x:0.5593877558190667,y:0.3238118228336772},{x:0.5591648145961691,y:0.32401639274673566},{x:0.5589828135206953,y:0.3242581100335041},{x:0.5032838135206953,y:0.3848241100335041},{x:0.5011622073766187,y:0.38671918495638496},{x:0.4991781602202921,y:0.38875783119234486},{x:0.4978799327840818,y:0.3896509997457094},{x:0.496704700181234,y:0.39070074870143656},{x:0.4942541493273608,y:0.39214550546522026},{x:0.4919105049301597,y:0.39375791128677606},{x:0.42072451102124153,y:0.4330589294870645},{x:0.4777200661568854,y:0.4633968522602595},{x:0.4805213378044988,y:0.46526159042857346},{x:0.48340658539474834,y:0.46699355971902134},{x:0.4841865730327025,y:0.4677014480666941},{x:0.48506339053858555,y:0.46828512408085676},{x:0.487447044167244,y:0.4706605328159332},{x:0.4899389620874836,y:0.4729221066835925},{x:0.4905658603159866,y:0.4737685611946159},{x:0.49131196047780046,y:0.47451208064740324},{x:0.493186393615322,y:0.4773068743236967},{x:0.4951892188573616,y:0.48001114175313947},{x:0.5250762188573616,y:0.5299501417531395},{x:0.5263287500632193,y:0.5326029758232522},{x:0.5277533683388757,y:0.5351675080991},{x:0.5282078804872482,y:0.5365829335183069},{x:0.5288425912810938,y:0.5379272372855163},{x:0.5295535131980511,y:0.5407734546091212},{x:0.5304504424054924,y:0.5435666393545394},{x:0.5306200854295579,y:0.5450435386925929},{x:0.5309803397786421,y:0.5464858379730204},{x:0.5311223320761199,y:0.5494160600145488},{x:0.5314571037289079,y:0.5523305567062068},{x:0.5328161037289079,y:0.6362725567062067},{x:0.5325682225912138,y:0.6392892202473488},{x:0.5325070847315841,y:0.6423154334158161},{x:0.5322077563487247,y:0.6436760218476847},{x:0.5320936668790056,y:0.6450644677251389},{x:0.5312620268462096,y:0.647974807711247},{x:0.530611678831884,y:0.6509309456375182},{x:0.530052664324664,y:0.6522069946735811},{x:0.5296698946987799,y:0.6535465042014387},{x:0.5282864552309536,y:0.656238677898982},{x:0.5270718895714029,y:0.659011137860374},{x:0.493108889571403,y:0.7195761378603741},{x:0.49086599866607616,y:0.7227903647520136},{x:0.4886941713149356,y:0.7260530293196586},{x:0.4883443495413535,y:0.7264040725827037},{x:0.48806074906628455,y:0.7268104928286833},{x:0.4852338901214668,y:0.7295253929429124},{x:0.4824672795427586,y:0.7323016638284542},{x:0.4820556943532359,y:0.7325777150511769},{x:0.48169825452511067,y:0.7329209983380867},{x:0.4783960621447291,y:0.7350322395860499},{x:0.4751409876314614,y:0.737215426256307},{x:0.4058559876314614,y:0.774404426256307},{x:0.40535390944732597,y:0.7746134197603937},{x:0.4048950878292554,y:0.7749053846735706},{x:0.40128606998249994,y:0.7763066859700772},{x:0.39771184087056327,y:0.7777944834687843},{x:0.3971786373679402,y:0.7779015106266721},{x:0.3966716723496766,y:0.778098353858693},{x:0.39285862044769176,y:0.7787686450898307},{x:0.3890628142527955,y:0.7795305574683767},{x:0.38851897614326597,y:0.7795315052864096},{x:0.3879833501061526,y:0.7796256622622586},{x:0.29017035010615255,y:0.7870576622622585},{x:0.28883979914978264,y:0.7870279344512828},{x:0.28751770557027906,y:0.7871806372910648},{x:0.2844390802539456,y:0.7869296114679608},{x:0.28135100845003463,y:0.7868606162788429},{x:0.2800518232654171,y:0.7865718820648824},{x:0.2787253424971381,y:0.7864637231002555},{x:0.20264834249713812,y:0.7726567231002556},{x:0.20090732012312768,y:0.7721604024311715},{x:0.19912055356042774,y:0.7718689262507037},{x:0.1966754417776232,y:0.7709540028332816},{x:0.19416478523538352,y:0.7702382792713757},{x:0.19255404347725652,y:0.7694118386491953},{x:0.19085847331495095,y:0.7687773822377194},{x:0.12157447331495094,y:0.7347753822377193},{x:0.11864840230662128,y:0.7329636093328938},{x:0.1156466869822177,y:0.7312801255296781},{x:0.11490452792065226,y:0.7306454666247165},{x:0.11407427694169714,y:0.7301313894804525},{x:0.11155788892673538,y:0.7277835811487093},{x:0.10894228211787771,y:0.7255468394054793},{x:0.1083381992447159,y:0.7247795872431081},{x:0.10762419278113186,y:0.7241134140161837},{x:0.10561419113974596,y:0.7213197952150451},{x:0.1034852091492498,y:0.7186157522626143},{x:0.05457920914924981,y:0.6421127522626143},{x:0.05400544809690788,y:0.6409849569633866},{x:0.05327967340990527,y:0.639948436299892},{x:0.05200937551205521,y:0.6370614399018406},{x:0.05057918033015655,y:0.6342502218929852},{x:0.050236465883645505,y:0.633032161635733},{x:0.04972685190376166,y:0.6318739658087451},{x:0.04904418748077848,y:0.6287946194110116},{x:0.04818991452487371,y:0.6257584009293389},{x:0.04809141700817653,y:0.6244968850866522},{x:0.047817547914863534,y:0.6232615229122788},{x:0.04774875137767971,y:0.6201081640700103},{x:0.04750322987838258,y:0.6169636252890404},{x:0.04765273449582791,y:0.6157071332072875},{x:0.04762513492475421,y:0.6144420789610904},{x:0.04817285008571219,y:0.6113358894861711},{x:0.048545515296550656,y:0.608203873267779},{x:0.04893727666953319,y:0.607000691233013},{x:0.04915700725673716,y:0.6057545602402229},{x:0.06817600725673716,y:0.537751560240223},{x:0.0695259178796919,y:0.5342803033966695},{x:0.07076883034011841,y:0.5307693133112962},{x:0.07112252784165454,y:0.530174666206544},{x:0.07137329591617819,y:0.5295298232221028},{x:0.07337447700044117,y:0.5263886201035727},{x:0.07527846743280868,y:0.5231875729003385},{x:0.0757413786311829,y:0.522673354732434},{x:0.07611313089295507,y:0.5220898246495332},{x:0.07868867817173447,y:0.5193993899302627},{x:0.08118057729149615,y:0.5166313000580217},{x:0.13823757729149616,y:0.46456630005802163},{x:0.1415344063491032,y:0.46210392848613274},{x:0.14479841194755694,y:0.45959821041612353},{x:0.17870395742216458,y:0.4385038845164132},{x:0.16590813892329467,y:0.43401753680148847},{x:0.1630836262780146,y:0.43270367241359486},{x:0.16018787852971583,y:0.4315553012665589},{x:0.15909238677042803,y:0.43084708753997614},{x:0.15790960896480868,y:0.43029690071741367},{x:0.15539569076452509,y:0.4284572467838155},{x:0.15277962009410193,y:0.4267660089056696},{x:0.07398562009410191,y:0.3640750089056696},{x:0.07334669706368892,y:0.36345515994886657},{x:0.07261876409580822,y:0.3629427646304707},{x:0.07018582297292754,y:0.3603886489381779},{x:0.067654053855944,y:0.3579324619307791},{x:0.06714833408498834,y:0.3571998754981266},{x:0.06653435151263618,y:0.35655531303498644},{x:0.06464644192410274,y:0.3535756306924294},{x:0.06264249835499126,y:0.3506727149773525},{x:0.06228941637067996,y:0.3498555439546183},{x:0.061812979199786275,y:0.3491035845207174},{x:0.026491979199786284,y:0.27897658452071744},{x:0.026206182636496978,y:0.2782362375154344},{x:0.02580526951533789,y:0.27755135647970497},{x:0.024619992088609113,y:0.2741272608068926},{x:0.023315086847465263,y:0.27074694483548933},{x:0.02317921632066564,y:0.26996506724675395},{x:0.022919620294515476,y:0.2692151317381758},{x:0.022425125568608657,y:0.2656255929487299},{x:0.02180476064715109,y:0.2620556544171705},{x:0.02182403758498896,y:0.26126229336223583},{x:0.021715734783549545,y:0.26047612298183487},{x:0.018998734783549534,y:0.19034712298183487}],[{x:0.10940940002433477,y:0.19920410482166873},{x:0.1112697837122767,y:0.2472228194523932},{x:0.137749803196691,y:0.2997967648781603},{x:0.20286290613296581,y:0.3516028102138205},{x:0.27392321813344717,y:0.3765172983642545},{x:0.30180455045059645,y:0.38547932587505673},{x:0.3589974388819276,y:0.364332623176267},{x:0.44199758150171664,y:0.31850914110336725},{x:0.48327372240847105,y:0.27362627516037924},{x:0.4919267227459848,y:0.21271770175329152},{x:0.46927072007314496,y:0.15185335046477932},{x:0.41758736799183827,y:0.11304708595854013},{x:0.33285528741119674,y:0.08399594043457195},{x:0.2715476841223936,y:0.0857083982994813},{x:0.19388634557978268,y:0.1114782912788902},{x:0.13622191473335832,y:0.14977174687660325},{x:0.10940940002433477,y:0.19920410482166873}],[{x:0.1412545940070051,y:0.610603192179028},{x:0.17253143522148345,y:0.6595291354872365},{x:0.22488466829434647,y:0.6852221473073319},{x:0.28911227954018853,y:0.6968786351876549},{x:0.37167628924266627,y:0.6906052797020977},{x:0.4210229734590171,y:0.664118250196117},{x:0.4426312796779887,y:0.6255849325813003},{x:0.4416638895166663,y:0.5658316839266069},{x:0.4243877259953326,y:0.5369644730960824},{x:0.3411654121752423,y:0.49266641996418925},{x:0.3038587353431559,y:0.48067475972705925},{x:0.2482367446999157,y:0.5012406330709052},{x:0.1958501022844071,y:0.5338329684082593},{x:0.1513751879049268,y:0.5744167077770947},{x:0.1412545940070051,y:0.610603192179028}]],"9":[[{x:0.04617702144416433,y:0.5785043710151274},{x:0.046308257010348054,y:0.5777836867379841},{x:0.04632014162646953,y:0.5770512474182771},{x:0.047097404355444614,y:0.5734500590446777},{x:0.04775742235616295,y:0.5698255492446179},{x:0.06775742235616294,y:0.499825549244618},{x:0.06870401207934061,y:0.497431122678351},{x:0.06945142103699212,y:0.4949672455435709},{x:0.07032179921115676,y:0.4933388825112154},{x:0.07100061044171635,y:0.4916218095236955},{x:0.07239614115864691,y:0.4894580616864063},{x:0.07360986744638548,y:0.48718733951411786},{x:0.07478119941633177,y:0.4857600673791044},{x:0.07578195180149752,y:0.48420841696912487},{x:0.07757279404935197,y:0.4823584994767568},{x:0.07920619484660538,y:0.4803681948466053},{x:0.1292061948466054,y:0.43036819484660543},{x:0.1324047212320044,y:0.4277432320802026},{x:0.1355710052680468,y:0.42507946670648067},{x:0.13581237417673697,y:0.4249466435819557},{x:0.13602533951411794,y:0.4247718674463855},{x:0.13967451194327588,y:0.422821344145996},{x:0.14329963156393744,y:0.42082647364918746},{x:0.21329963156393744,y:0.39082647364918743},{x:0.21510775104315333,y:0.39025382151681987},{x:0.2168404136401385,y:0.3894823898342746},{x:0.21930272871556003,y:0.3889252240779052},{x:0.22170947225776405,y:0.3881629808537447},{x:0.22359456811709633,y:0.38795407868297094},{x:0.22544443694348562,y:0.38753549554788497},{x:0.30544443694348566,y:0.37753549554788496},{x:0.30933066171136914,y:0.37743373006124875},{x:0.3132134481214367,y:0.3772411973248817},{x:0.31373545479679327,y:0.3773183852372503},{x:0.314262956584918,y:0.37730457196617717},{x:0.3180943620951528,y:0.37796292671622445},{x:0.321940103126635,y:0.37853158749346005},{x:0.39912055139763536,y:0.39782669956121014},{x:0.3920145202755848,y:0.3793136184800785},{x:0.3919728818872528,y:0.3791621799808353},{x:0.39190347676812315,y:0.3790212888743934},{x:0.33928123709710245,y:0.23902627390054626},{x:0.29593066247424293,y:0.13853176000209894},{x:0.2601678276974797,y:0.06104561798577861},{x:0.25727396725620644,y:0.05271224015242973},{x:0.25606147289685455,y:0.04397442167208486},{x:0.2565769400976792,y:0.035167952008718584},{x:0.2588005597432301,y:0.02663125885276897},{x:0.2626468793775489,y:0.018692402534786497},{x:0.2679680870941297,y:0.011656468850909336},{x:0.274559691864592,y:0.005793844786811796},{x:0.2821683820142214,y:0.0013298276974796769},{x:0.29050175984757026,y:-0.0015640327437935753},{x:0.29923957832791515,y:-0.002776527103145486},{x:0.30804604799128144,y:-0.002261059902320825},{x:0.31658274114723106,y:-0.00003744025676995222},{x:0.32452159746521353,y:0.003808879377548882},{x:0.3315575311490907,y:0.009130087094129706},{x:0.33742015521318824,y:0.015721691864591977},{x:0.34188417230252033,y:0.023330382014221395},{x:0.3778841723025203,y:0.10133038201422136},{x:0.3780704961344211,y:0.10186693411204945},{x:0.37834550457920557,y:0.10236389998544072},{x:0.42234550457920556,y:0.2043638999854408},{x:0.4226728981736059,y:0.20538920106595157},{x:0.42314852323187685,y:0.20635471112560658},{x:0.47609350933819694,y:0.3472083534084579},{x:0.5496013805841499,y:0.5387157021808093},{x:0.5512752235949963,y:0.542063388202502},{x:0.5520259437659378,y:0.5440252139743784},{x:0.5529745491659372,y:0.5458993775022888},{x:0.553598518494472,y:0.5481347580495968},{x:0.5544279630456541,y:0.5503023109672317},{x:0.5547815251174404,y:0.5523728990468965},{x:0.5553462721645,y:0.554396114781092},{x:0.555522150986547,y:0.5567102734952235},{x:0.5559127893965689,y:0.5589979940959194},{x:0.5558556061770612,y:0.5610977729446709},{x:0.5560147919588762,y:0.5631922898391183},{x:0.5557358213499382,y:0.5654962948984841},{x:0.5556726416037749,y:0.5678162673625252},{x:0.5552069106120301,y:0.5698645436567753},{x:0.5549544177082778,y:0.5719498706018395},{x:0.5349544177082779,y:0.6619498706018395},{x:0.5345092452033302,y:0.663307558548854},{x:0.5342480120020212,y:0.6647122835522489},{x:0.5331378863550271,y:0.6674899313564284},{x:0.5322058990004909,y:0.6703323081518522},{x:0.5315044085816177,y:0.6715770596583215},{x:0.5309741466497647,y:0.6729038291953012},{x:0.5293434595512297,y:0.6754115305058349},{x:0.5278748598680685,y:0.6780174701150343},{x:0.5269440094186665,y:0.6791014500786302},{x:0.5261650964249364,y:0.6802992771399491},{x:0.4861650964249363,y:0.7302992771399491},{x:0.4855393928217795,y:0.7309407996522789},{x:0.48502142797480674,y:0.7316720783612058},{x:0.48246447922773295,y:0.7340934525762789},{x:0.48000567043073006,y:0.7366144244690945},{x:0.4792668347133476,y:0.7371215515888083},{x:0.4786161570168623,y:0.7377377290536072},{x:0.47563595264764597,y:0.7396137412876539},{x:0.4727325719538572,y:0.7416065836124539},{x:0.4719089971645242,y:0.7419598267287414},{x:0.4711506117974981,y:0.7424372235949962},{x:0.4111506117974981,y:0.7724372235949962},{x:0.40814803697660645,y:0.7735862009991664},{x:0.4052110607504687,y:0.7748937847545917},{x:0.4040364518244048,y:0.77515955677446},{x:0.40291168903276836,y:0.7755899630456542},{x:0.39974265347336024,y:0.7761310898824948},{x:0.39660701348596056,y:0.7768405731449995},{x:0.3166070134859606,y:0.7868395731449994},{x:0.31542693671630134,y:0.7868704603456931},{x:0.31426350899694466,y:0.7870703881908964},{x:0.3110259999999998,y:0.7869856499834279},{x:0.3077884910030554,y:0.7870703881908964},{x:0.3066250632836987,y:0.7868704603456931},{x:0.30544498651403945,y:0.7868395731449994},{x:0.22544498651403946,y:0.7768405731449995},{x:0.22359484289355938,y:0.7764219517671516},{x:0.22170947225776405,y:0.7762130191462554},{x:0.21930299190993624,y:0.775450859278766},{x:0.2168409392495313,y:0.7748937847545917},{x:0.21510801459933976,y:0.7741222619544408},{x:0.21329963156393744,y:0.7735495263508126},{x:0.14329963156393744,y:0.7435495263508126},{x:0.1396745119432796,y:0.741554655854006},{x:0.13602533951411788,y:0.7396041325536146},{x:0.13581237417673678,y:0.7394293564180442},{x:0.1355710052680468,y:0.7392965332935194},{x:0.13240472123200803,y:0.7366327679198006},{x:0.12920619484660534,y:0.7340078051533947},{x:0.07920619484660535,y:0.6840078051533947},{x:0.07757279404935197,y:0.6820175005232432},{x:0.0757819518014975,y:0.6801675830308751},{x:0.07478119941633177,y:0.6786159326208956},{x:0.07360986744638545,y:0.6771886604858821},{x:0.07239614115864686,y:0.6749179383135936},{x:0.07100061044171635,y:0.6727541904763045},{x:0.07032179921115676,y:0.6710371174887846},{x:0.06945142103699209,y:0.669408754456429},{x:0.06870401207934061,y:0.666944877321649},{x:0.06775742235616294,y:0.664550450755382},{x:0.04775742235616295,y:0.5945504507553819},{x:0.0470974043554446,y:0.590925940955322},{x:0.04632014162646953,y:0.5873247525817227},{x:0.046308257010348054,y:0.5865923132620157},{x:0.04617702144416433,y:0.5858716289848723},{x:0.0462367922883029,y:0.5821879999999999},{x:0.04617702144416433,y:0.5785043710151274}],[{x:0.13782670643108905,y:0.5821879999999999},{x:0.15109114488080894,y:0.6286135345740196},{x:0.18671787059591238,y:0.6642402602891231},{x:0.24291204200407931,y:0.688323476606909},{x:0.311026,y:0.696836869931924},{x:0.377796042530131,y:0.6884914492411893},{x:0.4220611757635009,y:0.6663588826245044},{x:0.4493630453483168,y:0.6322315456434845},{x:0.46363172164975686,y:0.5680225022870041},{x:0.4540425513192988,y:0.5488441616260881},{x:0.42235697647551157,y:0.5171585867823008},{x:0.37255000597497323,y:0.48395393978194207},{x:0.30826669745594837,y:0.4678831126521858},{x:0.24291230161158606,y:0.4760524121327311},{x:0.1867178705959123,y:0.500135739710877},{x:0.15109114488080894,y:0.5357624654259804},{x:0.13782670643108905,y:0.5821879999999999}]],"!":[[{x:0.20646600000000004,y:0.05103000000000002},{x:0.20733066238185466,y:0.04225093550927423},{x:0.20989142103699213,y:0.03380924554357098},{x:0.2140498674463855,y:0.026029339514117927},{x:0.21964619484660539,y:0.019210194846605383},{x:0.22646533951411793,y:0.013613867446385479},{x:0.23424524554357098,y:0.009455421036992116},{x:0.24268693550927425,y:0.006894662381854655},{x:0.251466,y:0.0060300000000000215},{x:0.350587,y:0.0060300000000000215},{x:0.3593660644907258,y:0.006894662381854655},{x:0.36780775445642905,y:0.009455421036992116},{x:0.3755876604858821,y:0.013613867446385479},{x:0.38240680515339465,y:0.019210194846605383},{x:0.3880031325536145,y:0.026029339514117927},{x:0.3921615789630079,y:0.03380924554357098},{x:0.39472233761814535,y:0.04225093550927425},{x:0.39558699999999997,y:0.05103000000000002},{x:0.39472233761814535,y:0.05980906449072579},{x:0.3921615789630079,y:0.06825075445642906},{x:0.3880031325536145,y:0.07603066048588211},{x:0.38240680515339465,y:0.08284980515339466},{x:0.3755876604858821,y:0.08844613255361455},{x:0.36780775445642905,y:0.09260457896300792},{x:0.3593660644907258,y:0.09516533761814538},{x:0.350587,y:0.09603000000000002},{x:0.251466,y:0.09603000000000002},{x:0.24268693550927425,y:0.09516533761814538},{x:0.23424524554357098,y:0.09260457896300792},{x:0.22646533951411793,y:0.08844613255361455},{x:0.21964619484660539,y:0.08284980515339466},{x:0.2140498674463855,y:0.07603066048588211},{x:0.20989142103699213,y:0.06825075445642906},{x:0.20733066238185466,y:0.05980906449072579},{x:0.20646600000000004,y:0.05103000000000002}],[{x:0.25602600000000003,y:0.25043400000000005},{x:0.25689066238185465,y:0.24165493550927428},{x:0.2594514210369921,y:0.233213245543571},{x:0.2636098674463855,y:0.22543333951411795},{x:0.26920619484660535,y:0.2186141948466054},{x:0.27602533951411795,y:0.2130178674463855},{x:0.283805245543571,y:0.20885942103699215},{x:0.2922469355092743,y:0.20629866238185468},{x:0.301026,y:0.20543400000000006},{x:0.3098050644907258,y:0.20629866238185468},{x:0.3182467544564291,y:0.20885942103699215},{x:0.32602666048588214,y:0.2130178674463855},{x:0.3328458051533947,y:0.2186141948466054},{x:0.33844213255361455,y:0.22543333951411795},{x:0.34260057896300794,y:0.233213245543571},{x:0.3451613376181454,y:0.24165493550927428},{x:0.346026,y:0.25043400000000005},{x:0.346026,y:0.729004},{x:0.3451613376181454,y:0.7377830644907257},{x:0.34260057896300794,y:0.746224754456429},{x:0.33844213255361455,y:0.7540046604858821},{x:0.3328458051533947,y:0.7608238051533946},{x:0.32602666048588214,y:0.7664201325536145},{x:0.3182467544564291,y:0.7705785789630079},{x:0.3098050644907258,y:0.7731393376181454},{x:0.301026,y:0.774004},{x:0.2922469355092743,y:0.7731393376181454},{x:0.283805245543571,y:0.7705785789630079},{x:0.27602533951411795,y:0.7664201325536145},{x:0.26920619484660535,y:0.7608238051533946},{x:0.2636098674463855,y:0.7540046604858821},{x:0.2594514210369921,y:0.746224754456429},{x:0.25689066238185465,y:0.7377830644907257},{x:0.25602600000000003,y:0.729004},{x:0.25602600000000003,y:0.25043400000000005}]],'"':[[{x:0.12004,y:0.476978},{x:0.12090466238185463,y:0.4681989355092742},{x:0.1234654210369921,y:0.459757245543571},{x:0.12762386744638546,y:0.4519773395141179},{x:0.13322019484660536,y:0.44515819484660535},{x:0.1400393395141179,y:0.4395618674463855},{x:0.14781924554357095,y:0.4354034210369921},{x:0.15626093550927422,y:0.43284266238185465},{x:0.16504,y:0.43197800000000003},{x:0.17381906449072576,y:0.43284266238185465},{x:0.18226075445642903,y:0.4354034210369921},{x:0.19004066048588208,y:0.4395618674463855},{x:0.19685980515339463,y:0.44515819484660535},{x:0.20245613255361453,y:0.4519773395141179},{x:0.2066145789630079,y:0.459757245543571},{x:0.20917533761814536,y:0.4681989355092742},{x:0.21004,y:0.476978},{x:0.21004,y:0.729004},{x:0.20917533761814536,y:0.7377830644907257},{x:0.2066145789630079,y:0.746224754456429},{x:0.20245613255361453,y:0.7540046604858821},{x:0.19685980515339463,y:0.7608238051533946},{x:0.19004066048588208,y:0.7664201325536145},{x:0.18226075445642903,y:0.7705785789630079},{x:0.17381906449072576,y:0.7731393376181454},{x:0.16504,y:0.774004},{x:0.15626093550927422,y:0.7731393376181454},{x:0.14781924554357095,y:0.7705785789630079},{x:0.1400393395141179,y:0.7664201325536145},{x:0.13322019484660536,y:0.7608238051533946},{x:0.12762386744638546,y:0.7540046604858821},{x:0.1234654210369921,y:0.746224754456429},{x:0.12090466238185463,y:0.7377830644907257},{x:0.12004,y:0.729004},{x:0.12004,y:0.476978}],[{x:0.392013,y:0.476978},{x:0.3928776623818546,y:0.4681989355092742},{x:0.39543842103699206,y:0.459757245543571},{x:0.39959686744638545,y:0.4519773395141179},{x:0.4051931948466053,y:0.44515819484660535},{x:0.4120123395141179,y:0.4395618674463855},{x:0.419792245543571,y:0.4354034210369921},{x:0.42823393550927424,y:0.43284266238185465},{x:0.437013,y:0.43197800000000003},{x:0.4457920644907258,y:0.43284266238185465},{x:0.45423375445642905,y:0.4354034210369921},{x:0.4620136604858821,y:0.4395618674463855},{x:0.46883280515339465,y:0.44515819484660535},{x:0.4744291325536145,y:0.4519773395141179},{x:0.4785875789630079,y:0.459757245543571},{x:0.48114833761814535,y:0.4681989355092742},{x:0.48201299999999997,y:0.476978},{x:0.48201299999999997,y:0.729004},{x:0.48114833761814535,y:0.7377830644907257},{x:0.4785875789630079,y:0.746224754456429},{x:0.4744291325536145,y:0.7540046604858821},{x:0.46883280515339465,y:0.7608238051533946},{x:0.4620136604858821,y:0.7664201325536145},{x:0.45423375445642905,y:0.7705785789630079},{x:0.4457920644907258,y:0.7731393376181454},{x:0.437013,y:0.774004},{x:0.42823393550927424,y:0.7731393376181454},{x:0.419792245543571,y:0.7705785789630079},{x:0.4120123395141179,y:0.7664201325536145},{x:0.4051931948466053,y:0.7608238051533946},{x:0.39959686744638545,y:0.7540046604858821},{x:0.39543842103699206,y:0.746224754456429},{x:0.3928776623818546,y:0.7377830644907257},{x:0.392013,y:0.729004},{x:0.392013,y:0.476978}]],"#":[[{x:-0.04343582416242281,y:0.17932596542766122},{x:-0.043155600373289436,y:0.1705088746946064},{x:-0.04116063193533153,y:0.16191587083690517},{x:-0.037527584366828626,y:0.15387717817379684},{x:-0.03239607364840174,y:0.1467017191561739},{x:-0.025963300859175642,y:0.14066524265003977},{x:-0.01847647384989975,y:0.13599972706223024},{x:-0.010223307183879607,y:0.1328844655403335},{x:-0.0015209654276611437,y:0.13143917583757725},{x:0.007296125305393629,y:0.13171939962671061},{x:0.11028337660265361,y:0.14517801654688708},{x:0.10171449233133083,y:0.05447855391336175},{x:0.10174959121806887,y:0.04565708110917159},{x:0.10350499965956604,y:0.03701195788446062},{x:0.10691325829386003,y:0.02887541147651351},{x:0.11184338965300836,y:0.02156012480075985},{x:0.11810593155372849,y:0.015347220221688843},{x:0.1254602180228497,y:0.01047545617803717},{x:0.13362362795569505,y:0.007132051829885598},{x:0.14228244608663826,y:0.005445492331330834},{x:0.15110391889082841,y:0.0054805912180688685},{x:0.1597490421155394,y:0.0072359996595660475},{x:0.1678855885234865,y:0.010644258293860037},{x:0.17520087519924016,y:0.015574389653008364},{x:0.18141377977831116,y:0.02183693155372849},{x:0.18628554382196283,y:0.029191218022849703},{x:0.18962894817011441,y:0.03735462795569504},{x:0.19131550766866917,y:0.04601344608663827},{x:0.2018142041879224,y:0.1571394809935999},{x:0.36570083500909,y:0.17855657247605955},{x:0.35397849233133083,y:0.05447855391336175},{x:0.35401359121806886,y:0.04565708110917159},{x:0.35576899965956604,y:0.03701195788446062},{x:0.35917725829386,y:0.02887541147651351},{x:0.3641073896530084,y:0.02156012480075985},{x:0.3703699315537285,y:0.015347220221688843},{x:0.37772421802284967,y:0.01047545617803717},{x:0.38588762795569503,y:0.007132051829885598},{x:0.39454644608663825,y:0.005445492331330834},{x:0.4033679188908284,y:0.0054805912180688685},{x:0.4120130421155394,y:0.0072359996595660475},{x:0.4201495885234865,y:0.010644258293860037},{x:0.42746487519924015,y:0.015574389653008364},{x:0.4336777797783111,y:0.02183693155372849},{x:0.4385495438219628,y:0.029191218022849703},{x:0.44189294817011443,y:0.03735462795569504},{x:0.44357950766866916,y:0.04601344608663827},{x:0.45723166259435877,y:0.19051803692277236},{x:0.5748861253053936,y:0.20589339962671058},{x:0.5834791291630949,y:0.20788836806466848},{x:0.5915178218262032,y:0.2115214156331714},{x:0.5986932808438261,y:0.21665292635159827},{x:0.6047297573499603,y:0.22308569914082438},{x:0.6093952729377698,y:0.23057252615010027},{x:0.6125105344596665,y:0.2388256928161204},{x:0.6139558241624228,y:0.24752803457233888},{x:0.6136756003732894,y:0.25634512530539366},{x:0.6116806319353315,y:0.2649381291630949},{x:0.6080475843668286,y:0.2729768218262032},{x:0.6029160736484017,y:0.2801522808438262},{x:0.5964833008591757,y:0.2861887573499603},{x:0.5889964738498997,y:0.29085427293776983},{x:0.5807433071838796,y:0.29396953445966656},{x:0.5720409654276611,y:0.2954148241624228},{x:0.5632238746946063,y:0.2951346003732895},{x:0.4659139564059225,y:0.28241791072205386},{x:0.48521785958998953,y:0.48674482074743597},{x:0.6064180682130128,y:0.5025833921657807},{x:0.6150110746232834,y:0.5045783496089273},{x:0.6230497719348954,y:0.5082113868918628},{x:0.6302252375183169,y:0.5133428884292346},{x:0.6362617222552247,y:0.5197756534947408},{x:0.640927247422479,y:0.5272624745344501},{x:0.6440425195043586,y:0.5355156372144642},{x:0.645487820341822,y:0.544217977121417},{x:0.6452076078342193,y:0.5530350682130128},{x:0.6432126503910727,y:0.5616280746232835},{x:0.6395796131081373,y:0.5696667719348955},{x:0.6344481115707654,y:0.576842237518317},{x:0.6280153465052593,y:0.5828787222552247},{x:0.6205285254655499,y:0.587544247422479},{x:0.6122753627855358,y:0.5906595195043587},{x:0.603573022878583,y:0.592104820341822},{x:0.5947559317869872,y:0.5918246078342193},{x:0.493900150869001,y:0.5786446677402959},{x:0.5066445076686692,y:0.7135404460866382},{x:0.5066094087819312,y:0.7223619188908285},{x:0.5048540003404339,y:0.7310070421155394},{x:0.50144574170614,y:0.7391435885234865},{x:0.4965156103469916,y:0.7464588751992401},{x:0.4902530684462715,y:0.7526717797783111},{x:0.4828987819771503,y:0.7575435438219629},{x:0.47473537204430494,y:0.7608869481701144},{x:0.4660765539133617,y:0.7625735076686692},{x:0.45725508110917157,y:0.7625384087819311},{x:0.44860995788446056,y:0.760783000340434},{x:0.4404734114765135,y:0.7573747417061399},{x:0.43315812480075977,y:0.7524446103469916},{x:0.4269452202216888,y:0.7461820684462716},{x:0.42207345617803715,y:0.7388277819771503},{x:0.41873005182988554,y:0.730664372044305},{x:0.4170434923313308,y:0.7220055539133617},{x:0.40236933467780645,y:0.5666833238969633},{x:0.23848272425781383,y:0.5452664483557571},{x:0.25438050766866915,y:0.7135404460866382},{x:0.2543454087819311,y:0.7223619188908285},{x:0.25259000034043394,y:0.7310070421155394},{x:0.24918174170614,y:0.7391435885234865},{x:0.2442516103469916,y:0.7464588751992401},{x:0.23798906844627152,y:0.7526717797783111},{x:0.2306347819771503,y:0.7575435438219629},{x:0.22247137204430495,y:0.7608869481701144},{x:0.21381255391336174,y:0.7625735076686692},{x:0.20499108110917158,y:0.7625384087819311},{x:0.1963459578844606,y:0.760783000340434},{x:0.18820941147651346,y:0.7573747417061399},{x:0.1808941248007598,y:0.7524446103469916},{x:0.17468122022168883,y:0.7461820684462716},{x:0.16980945617803714,y:0.7388277819771503},{x:0.16646605182988555,y:0.730664372044305},{x:0.16477949233133082,y:0.7220055539133617},{x:0.14695190806661926,y:0.5333051045124245},{x:0.02716793178698713,y:0.5176516078342193},{x:0.01857492537671658,y:0.5156566503910727},{x:0.01053622806510461,y:0.5120236131081373},{x:0.0033607624816830023,y:0.5068921115707654},{x:-0.0026757222552247634,y:0.5004593465052593},{x:-0.0073412474224789775,y:0.4929725254655499},{x:-0.010456519504358698,y:0.48471936278553585},{x:-0.011901820341822023,y:0.476017022878583},{x:-0.011621607834219276,y:0.4671999317869871},{x:-0.00962665039107264,y:0.45860692537671655},{x:-0.005993613108137223,y:0.45056822806510455},{x:-0.0008621115707654614,y:0.44339276248168297},{x:0.005570653494740684,y:0.4373562777447752},{x:0.013057474534450029,y:0.432690752577521},{x:0.02131063721446411,y:0.42957548049564126},{x:0.03001297712141698,y:0.42813017965817796},{x:0.03883006821301287,y:0.4284103921657807},{x:0.13826961678760774,y:0.4414052575195645},{x:0.1189656704142173,y:0.23707789034616855},{x:-0.004366125305393629,y:0.2209606003732895},{x:-0.012959129163094893,y:0.21896563193533158},{x:-0.0209978218262032,y:0.2153325843668287},{x:-0.028173280843826164,y:0.2102010736484018},{x:-0.034209757349960276,y:0.2037683008591757},{x:-0.03887527293776982,y:0.1962814738498998},{x:-0.041990534459666565,y:0.18802830718387967},{x:-0.04343582416242281,y:0.17932596542766122}],[{x:0.2104964979994861,y:0.24903935479288136},{x:0.22980043297880234,y:0.4533666013628972},{x:0.39368704339879496,y:0.4747834769041034},{x:0.3743831288206537,y:0.27045644627534104},{x:0.2104964979994861,y:0.24903935479288136}]],$:[[{x:0.030517420733400163,y:0.165091535964518},{x:0.03086584266660257,y:0.1562768767808978},{x:0.032927224468652025,y:0.14769956254897784},{x:0.06950822446865203,y:0.04228956254897785},{x:0.0704003940010533,y:0.04035550336969822},{x:0.07109145007989037,y:0.03834080913001754},{x:0.07224350295250744,y:0.03635998272422403},{x:0.073203348392932,y:0.034279214644477654},{x:0.0744556913660193,y:0.03255637151138059},{x:0.07552651634405921,y:0.03071520740954014},{x:0.07704287290513265,y:0.02899719639360223},{x:0.07839021289928177,y:0.02714366624511229},{x:0.07995460247492134,y:0.0256982470536212},{x:0.08136404514878363,y:0.02410136799351792},{x:0.08318643266605391,y:0.022712194567306505},{x:0.08486948969354943,y:0.02115713247420773},{x:0.0866858072576693,y:0.0200446838732511},{x:0.08837970353582197,y:0.01875345702162473},{x:0.17373770353582196,y:-0.03394954297837521},{x:0.17475219432147746,y:-0.03444582628601368},{x:0.17568351020275566,y:-0.03508468417701866},{x:0.17870701554383397,y:-0.03638050305696308},{x:0.18166188368778688,y:-0.037826008286632525},{x:0.18275370138776084,y:-0.03811483831561822},{x:0.18379175728720304,y:-0.038559730016208084},{x:0.18700996854351615,y:-0.03924079346911771},{x:0.19019006380536974,y:-0.04008205754340442},{x:0.19131725047775072,y:-0.0401523347177012},{x:0.19242215448928965,y:-0.04038616328932037},{x:0.262121,y:-0.048110644533924524},{x:0.262121,y:-0.08350199999999997},{x:0.2629856623818546,y:-0.09228106449072573},{x:0.26554642103699205,y:-0.100722754456429},{x:0.26970486744638544,y:-0.10850266048588206},{x:0.2753011948466053,y:-0.1153218051533946},{x:0.2821203395141179,y:-0.1209181325536145},{x:0.28990024554357097,y:-0.12507657896300786},{x:0.29834193550927424,y:-0.12763733761814533},{x:0.307121,y:-0.12850199999999995},{x:0.3159000644907258,y:-0.12763733761814533},{x:0.32434175445642904,y:-0.12507657896300786},{x:0.3321216604858821,y:-0.1209181325536145},{x:0.33894080515339464,y:-0.1153218051533946},{x:0.3445371325536145,y:-0.10850266048588206},{x:0.3486955789630079,y:-0.100722754456429},{x:0.35125633761814534,y:-0.09228106449072573},{x:0.35212099999999996,y:-0.08350199999999997},{x:0.35212099999999996,y:-0.05796857189257534},{x:0.3537665284657676,y:-0.05798865052825875},{x:0.3565834008023822,y:-0.05822276473922817},{x:0.35816715833059226,y:-0.05804234673933715},{x:0.35976104048452195,y:-0.05806179518994546},{x:0.3625398346041163,y:-0.05754422155704884},{x:0.36534825494544937,y:-0.05722429279787242},{x:0.3668663832111493,y:-0.05673836571308556},{x:0.3684334335709129,y:-0.056446489484502926},{x:0.37105786033397337,y:-0.05539674504422484},{x:0.37374990266128777,y:-0.05453506799769968},{x:0.49568890266128773,y:-0.0018330679976996528},{x:0.4995437197067623,y:0.0003036028478311586},{x:0.5033988605511543,y:0.0024396894158641644},{x:0.5034014762743246,y:0.0024419030290919073},{x:0.503404473339876,y:0.00244356426035406},{x:0.5067683773534712,y:0.005291217073469004},{x:0.510132712931077,y:0.008138360005776092},{x:0.5101348465393426,y:0.008141041387321917},{x:0.510137461926978,y:0.00814325539697476},{x:0.5128811799638975,y:0.011592456477016289},{x:0.5156254207452635,y:0.015041241667436683},{x:0.5156269902452553,y:0.015044287773311453},{x:0.5156291234470946,y:0.015046969478205698},{x:0.5176472159618929,y:0.018965167962033513},{x:0.519665902312761,y:0.02288306052976895},{x:0.5684429023127611,y:0.1458620605297689},{x:0.5688122064775901,y:0.14714915498994666},{x:0.5693537919217377,y:0.14837377040805427},{x:0.5700262192706007,y:0.15138021786244946},{x:0.5708758841928585,y:0.15434145989163614},{x:0.5709869926090132,y:0.15567587086110493},{x:0.5712792610244494,y:0.1569826137160382},{x:0.5713522390683521,y:0.16006247719363653},{x:0.5716078682563359,y:0.16313258119086366},{x:0.5714565110896938,y:0.16446302800441426},{x:0.5714882307651191,y:0.1658016809010868},{x:0.5709589549987614,y:0.16883660297565092},{x:0.5706107247661352,y:0.1718975865660398},{x:0.570202718587728,y:0.17317294089875004},{x:0.5699726705538047,y:0.1744920601570685},{x:0.5455836705538047,y:0.26233106015706853},{x:0.5448796820390573,y:0.26415145628779163},{x:0.5443792359109676,y:0.2660379863232085},{x:0.5432925447356423,y:0.2682555269445408},{x:0.5424018225194911,y:0.2705587850827968},{x:0.5413562192793141,y:0.27220686146627543},{x:0.5404973453311464,y:0.27395951015977},{x:0.5389989139081434,y:0.2759224384285429},{x:0.5376759632977357,y:0.2780076688235372},{x:0.5363289272782685,y:0.2794200908086057},{x:0.5351446315541886,y:0.28097150485378414},{x:0.5332920437627642,y:0.28260438653745124},{x:0.5315877050081386,y:0.28439145495451523},{x:0.529991002048182,y:0.2855139439563835},{x:0.528526796368706,y:0.2868045033815319},{x:0.4553637963687061,y:0.3395095033815319},{x:0.4552094954443409,y:0.33959910378534747},{x:0.4550747122553104,y:0.3397160246969866},{x:0.45139660000367776,y:0.341813199213456},{x:0.44773515946955245,y:0.3439393468807752},{x:0.44756634322254935,y:0.3439971230209339},{x:0.4474113397164003,y:0.34408550243429054},{x:0.4433947629085852,y:0.34542481622689836},{x:0.43938888509457313,y:0.34679579895012297},{x:0.43921204103863115,y:0.34681953052195974},{x:0.439042773913178,y:0.34687597206574233},{x:0.35212099999999996,y:0.3666493043587998},{x:0.35212099999999996,y:0.6320956693586206},{x:0.3838005126074005,y:0.6288356018928482},{x:0.4577579663937751,y:0.5527249728659002},{x:0.46449612147708186,y:0.5470313904751531},{x:0.47221556762189953,y:0.5427617575185425},{x:0.48061965084199804,y:0.5400801535961528},{x:0.48938540693229315,y:0.5390896312428609},{x:0.49817597280212744,y:0.5398282556772123},{x:0.5066535319349293,y:0.5422676419764202},{x:0.5144922964874953,y:0.5463140458930298},{x:0.5213910271340998,y:0.551811966393775},{x:0.5270846095248467,y:0.5585501214770818},{x:0.5313542424814575,y:0.5662695676218995},{x:0.534035846403847,y:0.5746736508419981},{x:0.535026368757139,y:0.5834394069322931},{x:0.5342877443227877,y:0.5922299728021274},{x:0.5318483580235798,y:0.6007075319349293},{x:0.5278019541069703,y:0.6085462964874953},{x:0.5223040336062249,y:0.6154450271340998},{x:0.4369490336062249,y:0.7032850271340998},{x:0.435089451582588,y:0.7048563301588934},{x:0.43337550685970433,y:0.706585327551969},{x:0.43172842132509603,y:0.7076963215886295},{x:0.4302108785229181,y:0.7089786095248467},{x:0.4280804818333404,y:0.7101569339468108},{x:0.4260621594195314,y:0.7115183351118896},{x:0.4242299779872524,y:0.7122866512623272},{x:0.42249143237810044,y:0.7132482424814575},{x:0.4201720909726226,y:0.7139883059538676},{x:0.4179269538663623,y:0.7149297930076584},{x:0.4159800862413552,y:0.7153259053130885},{x:0.41408734915800194,y:0.715929846403847},{x:0.4116681940261354,y:0.716203208702491},{x:0.4092825215873294,y:0.7166886008255086},{x:0.35212099999999996,y:0.7225709645831306},{x:0.35212099999999996,y:0.7597659999999999},{x:0.35125633761814534,y:0.7685450644907257},{x:0.3486955789630079,y:0.776986754456429},{x:0.3445371325536145,y:0.7847666604858821},{x:0.33894080515339464,y:0.7915858051533946},{x:0.3321216604858821,y:0.7971821325536145},{x:0.32434175445642904,y:0.8013405789630078},{x:0.3159000644907258,y:0.8039013376181453},{x:0.307121,y:0.804766},{x:0.29834193550927424,y:0.8039013376181453},{x:0.28990024554357097,y:0.8013405789630078},{x:0.2821203395141179,y:0.7971821325536145},{x:0.2753011948466053,y:0.7915858051533946},{x:0.26970486744638544,y:0.7847666604858821},{x:0.26554642103699205,y:0.776986754456429},{x:0.2629856623818546,y:0.7685450644907257},{x:0.262121,y:0.7597659999999999},{x:0.262121,y:0.7318326623736131},{x:0.23856652158732947,y:0.7342566008255086},{x:0.23743405616423266,y:0.7342615520061975},{x:0.23631438427367413,y:0.7344313675125375},{x:0.2330314335362298,y:0.7342808004350606},{x:0.22974506326706257,y:0.734295168567351},{x:0.22863339192208898,y:0.7340790915684273},{x:0.22750210485113245,y:0.7340272069677483},{x:0.2243116092711877,y:0.7332390610779145},{x:0.22108558260167874,y:0.7326120140964958},{x:0.22003742624118275,y:0.7321832126358507},{x:0.21893799871753236,y:0.7319116218242595},{x:0.21596256725097532,y:0.7305161851266182},{x:0.21292085857685591,y:0.729271820095334},{x:0.21197649726195836,y:0.7286467727726252},{x:0.21095117966878213,y:0.7281659128327016},{x:0.2083051564782311,y:0.7262168111769735},{x:0.20556465695803808,y:0.7244029483461277},{x:0.204760381964467,y:0.7236056753794367},{x:0.20384857668186554,y:0.7229340254890024},{x:0.10629557668186554,y:0.6350940254890024},{x:0.10393291169686979,y:0.6325042238563513},{x:0.10146752815288923,y:0.6300120075116347},{x:0.10096488682836192,y:0.6292508655939548},{x:0.10035013880638408,y:0.6285770182897039},{x:0.09853811700104832,y:0.6255760458964971},{x:0.09660631239978806,y:0.6226507443205297},{x:0.09626182060918942,y:0.6218061670735107},{x:0.09579034588565258,y:0.6210253361666956},{x:0.09459860224176168,y:0.6177285186990383},{x:0.0932746147506803,y:0.6144825495908574},{x:0.056695614750680294,y:0.49150554959085735},{x:0.05654965816703397,y:0.490750439567249},{x:0.05628361804350595,y:0.49002883224693095},{x:0.05571374572525952,y:0.48642582571377374},{x:0.055021470477783566,y:0.4828443224653027},{x:0.055025633066628665,y:0.4820752469521588},{x:0.05490548343396577,y:0.4813156032607913},{x:0.055049472757300266,y:0.47767065091379934},{x:0.05506921600663437,y:0.4740229090450286},{x:0.05522333780201598,y:0.4732694231830167},{x:0.05525369594322076,y:0.472500935801646},{x:0.05610601347919053,y:0.46895411111540136},{x:0.056837016503334954,y:0.46538031130067065},{x:0.05713517469108906,y:0.46467137112890816},{x:0.05731487395982006,y:0.46392357259662753},{x:0.08169987395982006,y:0.39365157259662753},{x:0.08192222202041206,y:0.3931695328553223},{x:0.08205835369770847,y:0.3926564352635495},{x:0.08376780756696771,y:0.3891683934837906},{x:0.08539480756850773,y:0.3856411369034641},{x:0.08570692456181836,y:0.38521173737536313},{x:0.08594054088151196,y:0.3847350567827023},{x:0.08829763126802886,y:0.38164753465350854},{x:0.09058150254284453,y:0.37850546527353984},{x:0.0909713939878581,y:0.378145207541698},{x:0.09129351720579659,y:0.37772326251599964},{x:0.09420766244788897,y:0.3751549117812935},{x:0.09706063710369874,y:0.372518777565862},{x:0.09751331969083687,y:0.37224150613287915},{x:0.09791157079240381,y:0.3718905117848512},{x:0.17107757079240382,y:0.3191875117848513},{x:0.17123114354048857,y:0.3190983419119289},{x:0.17136528774468962,y:0.3189819753030134},{x:0.17504412834709762,y:0.3168843854977816},{x:0.17870637355344754,y:0.314757953928811},{x:0.1788743916234626,y:0.3147004579868701},{x:0.17902866028359976,y:0.31461249756570947},{x:0.183046032465951,y:0.31327291855818423},{x:0.1870527548771027,y:0.3119018143721617},{x:0.18722876142884332,y:0.31187820189800686},{x:0.18739722608682208,y:0.3118220279342577},{x:0.262121,y:0.2948235482063542},{x:0.262121,y:0.04244038202745839},{x:0.212402420161311,y:0.04795051974434915},{x:0.14928483997433578,y:0.08692151049617265},{x:0.11795277553134796,y:0.17720643745102208},{x:0.114257651607068,y:0.18521678535552225},{x:0.10907078710071823,y:0.1923523337548876},{x:0.10259151030645056,y:0.1983388675257922},{x:0.09506881619784838,y:0.20294632753270694},{x:0.08679179769072982,y:0.20599765167145945},{x:0.07807853596451803,y:0.20737557926659977},{x:0.06926387678089782,y:0.20702715733339738},{x:0.0606865625489779,y:0.20496577553134793},{x:0.052676214644477706,y:0.20127065160706795},{x:0.04554066624511235,y:0.1960837871007182},{x:0.039554132474207776,y:0.18960451030645054},{x:0.034946672467293015,y:0.18208181619784836},{x:0.03189534832854049,y:0.1738047976907298},{x:0.030517420733400163,y:0.165091535964518}],[{x:0.14709211773983194,y:0.4797371545422716},{x:0.17592903295677773,y:0.5766856037244347},{x:0.24922570721126042,y:0.6426843927572041},{x:0.262121,y:0.6413573671491031},{x:0.262121,y:0.3871228845247169},{x:0.21626819752335621,y:0.3975536737173561},{x:0.16206100150816494,y:0.4366002507010456},{x:0.14709211773983194,y:0.4797371545422716}],[{x:0.35212099999999996,y:0.034163101195078524},{x:0.35212099999999996,y:0.2743499680404371},{x:0.4101709471377665,y:0.26114452085874473},{x:0.4630938273127818,y:0.2230200535785049},{x:0.47920731446793274,y:0.1649859973145621},{x:0.44287681685863156,y:0.07338773859643172},{x:0.35212099999999996,y:0.034163101195078524}]],"'":[[{x:0.25602600000000003,y:0.476978},{x:0.25689066238185465,y:0.4681989355092742},{x:0.2594514210369921,y:0.459757245543571},{x:0.2636098674463855,y:0.4519773395141179},{x:0.26920619484660535,y:0.44515819484660535},{x:0.27602533951411795,y:0.4395618674463855},{x:0.283805245543571,y:0.4354034210369921},{x:0.2922469355092743,y:0.43284266238185465},{x:0.301026,y:0.43197800000000003},{x:0.3098050644907258,y:0.43284266238185465},{x:0.3182467544564291,y:0.4354034210369921},{x:0.32602666048588214,y:0.4395618674463855},{x:0.3328458051533947,y:0.44515819484660535},{x:0.33844213255361455,y:0.4519773395141179},{x:0.34260057896300794,y:0.459757245543571},{x:0.3451613376181454,y:0.4681989355092742},{x:0.346026,y:0.476978},{x:0.346026,y:0.729004},{x:0.3451613376181454,y:0.7377830644907257},{x:0.34260057896300794,y:0.746224754456429},{x:0.33844213255361455,y:0.7540046604858821},{x:0.3328458051533947,y:0.7608238051533946},{x:0.32602666048588214,y:0.7664201325536145},{x:0.3182467544564291,y:0.7705785789630079},{x:0.3098050644907258,y:0.7731393376181454},{x:0.301026,y:0.774004},{x:0.2922469355092743,y:0.7731393376181454},{x:0.283805245543571,y:0.7705785789630079},{x:0.27602533951411795,y:0.7664201325536145},{x:0.26920619484660535,y:0.7608238051533946},{x:0.2636098674463855,y:0.7540046604858821},{x:0.2594514210369921,y:0.746224754456429},{x:0.25689066238185465,y:0.7377830644907257},{x:0.25602600000000003,y:0.729004},{x:0.25602600000000003,y:0.476978}]],"(":[[{x:0.14398102142772873,y:0.343473372436119},{x:0.14438344127795402,y:0.34024506484177663},{x:0.14461855620935057,y:0.33700027938992067},{x:0.15480555620935058,y:0.27783527938992064},{x:0.15553530200183258,y:0.27518493680242373},{x:0.1560666158259812,y:0.2724877993619115},{x:0.1764416158259812,y:0.20487079936191147},{x:0.17757136816824137,y:0.2021290142392397},{x:0.17852197521392682,y:0.19932008699588913},{x:0.2090839752139268,y:0.13170208699588917},{x:0.21040800505224358,y:0.12940389577393302},{x:0.21154775445201235,y:0.12700896170152925},{x:0.25229575445201236,y:0.05939296170152925},{x:0.2531150427152032,y:0.05829379345186112},{x:0.2537782786760274,y:0.05709399256856861},{x:0.29452927867602746,y:-0.0020700074314313824},{x:0.29560111146026063,y:-0.0033391000809501682},{x:0.29650963843516415,y:-0.004729783512322571},{x:0.3372576384351641,y:-0.05544378351232261},{x:0.3386866074193021,y:-0.05690267270426387},{x:0.3399537097957662,y:-0.05850416001284604},{x:0.38070370979576623,y:-0.10073716001284601},{x:0.38742176905533504,y:-0.10645444032360908},{x:0.3951261287468799,y:-0.11075123635207199},{x:0.40352071464810957,y:-0.11346242463653189},{x:0.41228292753057777,y:-0.11448381573166892},{x:0.42107604046711683,y:-0.11377615815049966},{x:0.4295621390588101,y:-0.11136664677700951},{x:0.4374151072958377,y:-0.10734787778201216},{x:0.444333160012846,y:-0.10187429020423372},{x:0.4500504403236091,y:-0.09515623094466494},{x:0.45434723635207197,y:-0.08745187125312004},{x:0.4570584246365319,y:-0.07905728535189037},{x:0.45807981573166895,y:-0.07029507246942218},{x:0.4573721581504997,y:-0.06150195953288313},{x:0.45496264677700954,y:-0.053015860941189874},{x:0.45094387778201217,y:-0.04516289270416226},{x:0.44547029020423373,y:-0.03824483998715393},{x:0.4061377413616867,y:0.0025191240684850026},{x:0.3677075745656829,y:0.050348403515145926},{x:0.3286739379437331,y:0.10701906379590062},{x:0.2900025757951927,y:0.1711891536907596},{x:0.2617573982317254,y:0.23368121626802973},{x:0.24303344075060918,y:0.2958190240226623},{x:0.23462816944303005,y:0.34463593546989096},{x:0.24303340667749923,y:0.39345182392970596},{x:0.26175739639474455,y:0.45558881969516635},{x:0.2900026404789191,y:0.5180819536434618},{x:0.328674029726828,y:0.5822520885061939},{x:0.36770768599197223,y:0.6389237351633864},{x:0.4061420841180472,y:0.6867582808236831},{x:0.4454798975405431,y:0.7275528000242046},{x:0.45095135740921277,y:0.7344725356602282},{x:0.45496771125722263,y:0.7423267393839987},{x:0.45737461285859093,y:0.7508135785511003},{x:0.458079566334583,y:0.759606908691815},{x:0.4570554807184589,y:0.768368807060192},{x:0.4543417110461325,y:0.7767625588156633},{x:0.4500425459642118,y:0.7844655967855365},{x:0.4443231999757953,y:0.791181897540543},{x:0.4374034643397718,y:0.7966533574092127},{x:0.4295492606160011,y:0.8006697112572226},{x:0.42106242144889966,y:0.8030766128585909},{x:0.41226909130818484,y:0.803781566334583},{x:0.403507192939808,y:0.8027574807184589},{x:0.39511344118433667,y:0.8000437110461325},{x:0.3874104032144634,y:0.7957445459642117},{x:0.38069410245945684,y:0.7900251999757952},{x:0.33994410245945683,y:0.7477661999757953},{x:0.338681775527778,y:0.7461697396410558},{x:0.3372576384351641,y:0.7447157835123226},{x:0.29650963843516415,y:0.6940017835123226},{x:0.2956010143988682,y:0.6926109515089496},{x:0.29452907712829884,y:0.6913417148135671},{x:0.2537780771282988,y:0.6321767148135672},{x:0.25311493656839296,y:0.6309770641401381},{x:0.25229575445201236,y:0.6298780382984708},{x:0.21154775445201235,y:0.5622620382984707},{x:0.21040795156345282,y:0.5598669918310725},{x:0.2090838723444427,y:0.5575686854051248},{x:0.17852187234444272,y:0.48994968540512485},{x:0.17757135012625538,y:0.48714095747585867},{x:0.17644166886939822,y:0.4843993766680373},{x:0.1560666688693982,y:0.4167833766680374},{x:0.15553533856931018,y:0.4140862136984408},{x:0.15480557779123924,y:0.4114358459543075},{x:0.14461857779123924,y:0.3522718459543075},{x:0.14438345368873493,y:0.3490270611669966},{x:0.14398102471397584,y:0.3457987547100726},{x:0.14406527252602844,y:0.3446360634540339},{x:0.14398102142772873,y:0.343473372436119}]],")":[[{x:0.14397318426833106,y:-0.07029507246942218},{x:0.14499457536346808,y:-0.07905728535189037},{x:0.14770576364792798,y:-0.08745187125312004},{x:0.1520025596763909,y:-0.09515623094466495},{x:0.15771983998715397,y:-0.10187429020423372},{x:0.16463789270416226,y:-0.10734787778201214},{x:0.1724908609411899,y:-0.11136664677700951},{x:0.18097695953288315,y:-0.11377615815049966},{x:0.1897700724694222,y:-0.11448381573166892},{x:0.19853228535189038,y:-0.11346242463653189},{x:0.20692687125312006,y:-0.11075123635207199},{x:0.21463123094466496,y:-0.10645444032360907},{x:0.22134929020423375,y:-0.10073716001284601},{x:0.2620992902042337,y:-0.05850416001284604},{x:0.2633660586938147,y:-0.05690309470300352},{x:0.26479468609075496,y:-0.05544462417080616},{x:0.30554468609075497,y:-0.004730624170806122},{x:0.3064541047100432,y:-0.003338648753719708},{x:0.307526891803669,y:-0.002068307996824087},{x:0.348273891803669,y:0.05709569200317591},{x:0.3489362195699084,y:0.058293979727073175},{x:0.3497544895549002,y:0.059391707275619196},{x:0.39050548955490016,y:0.12700770727561922},{x:0.39164563057902163,y:0.12940326331913213},{x:0.3929700247860732,y:0.13170208699588917},{x:0.42353202478607316,y:0.19932008699588913},{x:0.4244827292530259,y:0.20212930210713742},{x:0.4256125601984483,y:0.2048713835354543},{x:0.4459865601984483,y:0.27248838353545435},{x:0.4465177787005257,y:0.27518522990297933},{x:0.4472474437906494,y:0.27783527938992064},{x:0.4574344437906494,y:0.33700027938992067},{x:0.45766955872204595,y:0.3402450648417768},{x:0.4580719785722712,y:0.34347337243611903},{x:0.45798772747397154,y:0.3446360634540339},{x:0.4580719752860241,y:0.3457987547100726},{x:0.45766954631126505,y:0.34902706116699656},{x:0.45743442220876074,y:0.3522718459543075},{x:0.44724742220876074,y:0.4114358459543075},{x:0.4465177421348676,y:0.414085920594514},{x:0.44598650715958776,y:0.4167827924880124},{x:0.42561250715958776,y:0.4843987924880123},{x:0.42448274729464536,y:0.48714066960378194},{x:0.42353212765555726,y:0.48994968540512485},{x:0.3929701276555573,y:0.5575686854051248},{x:0.39164568407140216,y:0.5598676242877579},{x:0.39050548955490016,y:0.5622632927243807},{x:0.3497544895549002,y:0.6298792927243808},{x:0.3489363257182038,y:0.6309768778726063},{x:0.34827409333092635,y:0.6321750153799588},{x:0.3075270933309263,y:0.6913400153799587},{x:0.3064542017711834,y:0.692610500189881},{x:0.30554468609075497,y:0.6940026241708062},{x:0.26479468609075496,y:0.7447166241708062},{x:0.26337089070969094,y:0.7461701617493295},{x:0.2621088975405431,y:0.7477661999757953},{x:0.2213588975405431,y:0.7900251999757952},{x:0.21464259678553657,y:0.7957445459642117},{x:0.20693955881566328,y:0.8000437110461325},{x:0.19854580706019195,y:0.8027574807184589},{x:0.1897839086918151,y:0.803781566334583},{x:0.1809905785511003,y:0.8030766128585909},{x:0.17250373938399882,y:0.8006697112572226},{x:0.16464953566022822,y:0.7966533574092127},{x:0.15772980002420467,y:0.791181897540543},{x:0.15201045403578817,y:0.7844655967855365},{x:0.14771128895386743,y:0.7767625588156633},{x:0.14499751928154103,y:0.7683688070601918},{x:0.14397343366541698,y:0.759606908691815},{x:0.14467838714140904,y:0.7508135785511002},{x:0.14708528874277732,y:0.7423267393839987},{x:0.1511016425907872,y:0.7344725356602282},{x:0.15657310245945688,y:0.7275528000242046},{x:0.19591129092993145,y:0.6867578918874246},{x:0.23434697314436972,y:0.6389240958672278},{x:0.27337685298529213,y:0.5822523693404118},{x:0.3120516621801016,y:0.518081284004684},{x:0.34029647741491703,y:0.4555890988936643},{x:0.35901954136421654,y:0.39345212569273014},{x:0.36742483055696995,y:0.344635935469891},{x:0.359019507292604,y:0.29581872226323463},{x:0.3402964755778617,y:0.23368093707349602},{x:0.3120517268674457,y:0.17118982332763816},{x:0.27337694476991303,y:0.10701878295300266},{x:0.23434708457036935,y:0.05034804280413771},{x:0.1959156338111051,y:0.0025195128948044543},{x:0.15658270979576625,y:-0.03824483998715393},{x:0.1511091222179878,y:-0.045162892704162266},{x:0.14709035322299047,y:-0.053015860941189874},{x:0.1446808418495003,y:-0.06150195953288312},{x:0.14397318426833106,y:-0.07029507246942218}]],"*":[[{x:0.03611444520266741,y:0.4654782574484574},{x:0.03652686631141767,y:0.45666636076295464},{x:0.038650478626155074,y:0.4481042415682919},{x:0.04240367291655979,y:0.4401209373034283},{x:0.04764221603086716,y:0.4330232418741738},{x:0.05416479369500318,y:0.42708391573544136},{x:0.06172074690723879,y:0.42253120385992987},{x:0.07001970462305517,y:0.4195400644118251},{x:0.0787427425515426,y:0.41822544520266736},{x:0.08755463923704532,y:0.41863786631141764},{x:0.09611675843170807,y:0.42076147862615504},{x:0.25602600000000003,y:0.47756000598755177},{x:0.25602600000000003,y:0.31805799999999995},{x:0.25689066238185465,y:0.30927893550927416},{x:0.2594514210369921,y:0.30083724554357094},{x:0.2636098674463855,y:0.29305733951411783},{x:0.26920619484660535,y:0.2862381948466053},{x:0.27602533951411795,y:0.2806418674463854},{x:0.283805245543571,y:0.276483421036992},{x:0.2922469355092743,y:0.2739226623818546},{x:0.301026,y:0.27305799999999997},{x:0.3098050644907258,y:0.2739226623818546},{x:0.3182467544564291,y:0.276483421036992},{x:0.32602666048588214,y:0.2806418674463854},{x:0.3328458051533947,y:0.2862381948466053},{x:0.33844213255361455,y:0.29305733951411783},{x:0.34260057896300794,y:0.30083724554357094},{x:0.3451613376181454,y:0.30927893550927416},{x:0.346026,y:0.31805799999999995},{x:0.346026,y:0.47756000598755177},{x:0.505935241568292,y:0.42076147862615504},{x:0.5144973607629547,y:0.41863786631141764},{x:0.5233092574484575,y:0.41822544520266736},{x:0.5320322953769449,y:0.4195400644118251},{x:0.5403312530927612,y:0.42253120385992987},{x:0.5478872063049969,y:0.42708391573544136},{x:0.5544097839691329,y:0.4330232418741738},{x:0.5596483270834403,y:0.4401209373034283},{x:0.5634015213738449,y:0.4481042415682919},{x:0.5655251336885824,y:0.45666636076295464},{x:0.5659375547973327,y:0.4654782574484574},{x:0.5646229355881749,y:0.4742012953769448},{x:0.5616317961400701,y:0.4825002530927612},{x:0.5570790842645587,y:0.4900562063049968},{x:0.5511397581258262,y:0.4965787839691328},{x:0.5440420626965717,y:0.5018173270834402},{x:0.5360587584317081,y:0.5055705213738448},{x:0.37146215609131306,y:0.5640339630732496},{x:0.47696549129035026,y:0.7165911114148321},{x:0.48124783600971727,y:0.7243035129909579},{x:0.48394328176908086,y:0.732703166943666},{x:0.4849482440995321,y:0.7414672792821342},{x:0.48422410286230105,y:0.7502590500841659},{x:0.48179868639903156,y:0.758740616528321},{x:0.47776520210421775,y:0.7665860367726678},{x:0.4722786545173053,y:0.7734938157169785},{x:0.4655498885851679,y:0.7791984912903502},{x:0.45783748700904214,y:0.7834808360097172},{x:0.449437833056334,y:0.7861762817690807},{x:0.4406737207178658,y:0.7871812440995319},{x:0.431881949915834,y:0.786457102862301},{x:0.4234003834716789,y:0.7840316863990314},{x:0.4155549632273321,y:0.7799982021042177},{x:0.40864718428302144,y:0.7745116545173052},{x:0.40294250870964976,y:0.7677828885851677},{x:0.301026,y:0.6204122684209616},{x:0.19910949129035027,y:0.7677828885851677},{x:0.19340481571697854,y:0.7745116545173052},{x:0.18649703677266788,y:0.7799982021042177},{x:0.17865161652832107,y:0.7840316863990314},{x:0.17017005008416597,y:0.786457102862301},{x:0.1613782792821342,y:0.7871812440995319},{x:0.15261416694366597,y:0.7861762817690807},{x:0.14421451299095783,y:0.7834808360097172},{x:0.13650211141483212,y:0.7791984912903502},{x:0.12977334548269473,y:0.7734938157169785},{x:0.12428679789578226,y:0.7665860367726678},{x:0.12025331360096844,y:0.758740616528321},{x:0.11782789713769894,y:0.7502590500841659},{x:0.11710375590046794,y:0.7414672792821342},{x:0.11810871823091917,y:0.732703166943666},{x:0.12080416399028275,y:0.7243035129909579},{x:0.1250865087096497,y:0.7165911114148321},{x:0.23058984390868703,y:0.5640339630732496},{x:0.06599324156829194,y:0.5055705213738448},{x:0.058009937303428294,y:0.5018173270834402},{x:0.05091224187417384,y:0.4965787839691328},{x:0.04497291573544139,y:0.4900562063049968},{x:0.04042020385992993,y:0.4825002530927612},{x:0.03742906441182516,y:0.4742012953769448},{x:0.03611444520266741,y:0.4654782574484574}]],"+":[[{x:-0.002030999999999998,y:0.33155},{x:-0.0011663376181453647,y:0.3227709355092742},{x:0.0013944210369920967,y:0.314329245543571},{x:0.005552867446385459,y:0.3065493395141179},{x:0.011149194846605363,y:0.29973019484660535},{x:0.017968339514117915,y:0.2941338674463855},{x:0.025748245543570962,y:0.2899754210369921},{x:0.03418993550927423,y:0.28741466238185465},{x:0.042969,y:0.28655},{x:0.256023,y:0.28655},{x:0.256023,y:0.09133899999999995},{x:0.2568876623818546,y:0.08255993550927418},{x:0.25944842103699206,y:0.07411824554357091},{x:0.26360686744638545,y:0.06633833951411786},{x:0.2692031948466054,y:0.05951919484660531},{x:0.2760223395141179,y:0.053922867446385414},{x:0.2838022455435709,y:0.049764421036992045},{x:0.2922439355092742,y:0.04720366238185458},{x:0.301023,y:0.04633899999999995},{x:0.3098020644907258,y:0.04720366238185458},{x:0.31824375445642905,y:0.049764421036992045},{x:0.3260236604858821,y:0.053922867446385414},{x:0.3328428051533946,y:0.05951919484660531},{x:0.3384391325536145,y:0.06633833951411786},{x:0.3425975789630079,y:0.07411824554357091},{x:0.34515833761814535,y:0.08255993550927418},{x:0.34602299999999997,y:0.09133899999999995},{x:0.34602299999999997,y:0.28655},{x:0.559083,y:0.28655},{x:0.5678620644907257,y:0.28741466238185465},{x:0.576303754456429,y:0.2899754210369921},{x:0.5840836604858821,y:0.2941338674463855},{x:0.5909028051533947,y:0.29973019484660535},{x:0.5964991325536145,y:0.3065493395141179},{x:0.6006575789630079,y:0.314329245543571},{x:0.6032183376181454,y:0.3227709355092742},{x:0.604083,y:0.33155},{x:0.6032183376181454,y:0.3403290644907258},{x:0.6006575789630079,y:0.348770754456429},{x:0.5964991325536145,y:0.35655066048588213},{x:0.5909028051533947,y:0.3633698051533947},{x:0.5840836604858821,y:0.36896613255361455},{x:0.576303754456429,y:0.37312457896300794},{x:0.5678620644907257,y:0.3756853376181454},{x:0.559083,y:0.37655},{x:0.34602299999999997,y:0.37655},{x:0.34602299999999997,y:0.571777},{x:0.34515833761814535,y:0.5805560644907257},{x:0.3425975789630079,y:0.588997754456429},{x:0.3384391325536145,y:0.5967776604858821},{x:0.3328428051533946,y:0.6035968051533946},{x:0.3260236604858821,y:0.6091931325536145},{x:0.31824375445642905,y:0.6133515789630078},{x:0.3098020644907258,y:0.6159123376181453},{x:0.301023,y:0.616777},{x:0.2922439355092742,y:0.6159123376181453},{x:0.2838022455435709,y:0.6133515789630078},{x:0.2760223395141179,y:0.6091931325536145},{x:0.2692031948466054,y:0.6035968051533946},{x:0.26360686744638545,y:0.5967776604858821},{x:0.25944842103699206,y:0.588997754456429},{x:0.2568876623818546,y:0.5805560644907257},{x:0.256023,y:0.571777},{x:0.256023,y:0.37655},{x:0.042969,y:0.37655},{x:0.03418993550927421,y:0.3756853376181454},{x:0.025748245543570934,y:0.37312457896300794},{x:0.017968339514117904,y:0.36896613255361455},{x:0.011149194846605356,y:0.3633698051533947},{x:0.005552867446385459,y:0.35655066048588213},{x:0.0013944210369920967,y:0.348770754456429},{x:-0.0011663376181453647,y:0.3403290644907258},{x:-0.002030999999999998,y:0.33155}]],",":[[{x:0.1703425796668749,y:-0.03158948169003215},{x:0.1707557440557006,y:-0.035050650253961146},{x:0.17102563140319493,y:-0.03852592771911176},{x:0.17127771326913271,y:-0.039423300660751795},{x:0.17138819577001116,y:-0.0403488367651378},{x:0.1724686618106471,y:-0.0436628955719719},{x:0.1734113563482083,y:-0.04701874414557815},{x:0.1738336633079298,y:-0.04784969558537063},{x:0.17412258605517572,y:-0.048735893706360625},{x:0.1758288320436127,y:-0.05177548533469908},{x:0.17740810654883146,y:-0.054882941638058576},{x:0.177984409582707,y:-0.05561553857817519},{x:0.17844066943717352,y:-0.05642834261896521},{x:0.18070712529694977,y:-0.05907665726715373},{x:0.18286228913625774,y:-0.06181630349720979},{x:0.26855428913625773,y:-0.1511263034972098},{x:0.27525630293239317,y:-0.15686238451505874},{x:0.2829485933055849,y:-0.16118075031492074},{x:0.2913355498506774,y:-0.16391544852087458},{x:0.3000948665311021,y:-0.16496138621450188},{x:0.3088899277191117,y:-0.1642783685968051},{x:0.3173827441455781,y:-0.16189264365179173},{x:0.3252469416380585,y:-0.15789589345116858},{x:0.33218030349720973,y:-0.1524417108637423},{x:0.3379163845150587,y:-0.14573969706760687},{x:0.3422347503149207,y:-0.13804740669441512},{x:0.3449694485208745,y:-0.12966045014932262},{x:0.3460153862145018,y:-0.12090113346889794},{x:0.34533236859680505,y:-0.11210607228088836},{x:0.34294664365179167,y:-0.10361325585442197},{x:0.33894989345116855,y:-0.09574905836194152},{x:0.33349571086374225,y:-0.08881569650279031},{x:0.277697993368333,y:-0.03066214483501502},{x:0.41918956700521515,y:0.11679250439324337},{x:0.42464400414059766,y:0.12372566600271688},{x:0.42864104306488354,y:0.1315897167531037},{x:0.43102707981377775,y:0.14008244558427704},{x:0.4317104203331251,y:0.14887748169003212},{x:0.4306648042299889,y:0.15763683676513773},{x:0.4279304139448243,y:0.1660238937063606},{x:0.4236123305628265,y:0.17371634261896518},{x:0.41787649560675666,y:0.1804185670052151},{x:0.41094333399728317,y:0.18587300414059763},{x:0.4030792832468963,y:0.18987004306488353},{x:0.39458655441572293,y:0.19225607981377774},{x:0.3857915183099679,y:0.19293942033312508},{x:0.37703216323486227,y:0.19189380422998883},{x:0.36864510629363945,y:0.18915941394482427},{x:0.3609526573810348,y:0.18484133056282648},{x:0.35425043299478487,y:0.17910549560675662},{x:0.18286343299478489,y:0.000495495606756581},{x:0.18070816857348473,y:-0.0022440714967103576},{x:0.1784416154849413,y:-0.004892302932393237},{x:0.17798532578947307,y:-0.005705090221499034},{x:0.17740899585940237,y:-0.006437666002716908},{x:0.1758296072680145,y:-0.009545064322455634},{x:0.1741232496850793,y:-0.012584593305585},{x:0.17383429440212667,y:-0.013470780818460306},{x:0.1734119569351165,y:-0.014301716753103766},{x:0.1724691391914766,y:-0.01765753071433596},{x:0.17138855147912546,y:-0.02097154985067746},{x:0.17127803499816427,y:-0.02189708189818214},{x:0.17102592018622226,y:-0.022794445584277102},{x:0.17075590524748027,y:-0.02626971313843455},{x:0.17034261378549817,y:-0.029730866531102167},{x:0.17041478319291342,y:-0.03066017543569507},{x:0.1703425796668749,y:-0.03158948169003215}]],"-":[[{x:0.12882900000000003,y:0.31396500000000005},{x:0.12969366238185465,y:0.30518593550927425},{x:0.13225442103699211,y:0.29674424554357104},{x:0.13641286744638548,y:0.28896433951411793},{x:0.14200919484660537,y:0.2821451948466054},{x:0.14882833951411792,y:0.2765488674463855},{x:0.15660824554357097,y:0.2723904210369921},{x:0.16504993550927424,y:0.2698296623818547},{x:0.173829,y:0.26896500000000007},{x:0.428224,y:0.26896500000000007},{x:0.4370030644907258,y:0.2698296623818547},{x:0.44544475445642906,y:0.2723904210369921},{x:0.4532246604858821,y:0.2765488674463855},{x:0.4600438051533946,y:0.2821451948466054},{x:0.4656401325536145,y:0.28896433951411793},{x:0.4697985789630079,y:0.29674424554357104},{x:0.47235933761814536,y:0.30518593550927425},{x:0.473224,y:0.31396500000000005},{x:0.47235933761814536,y:0.32274406449072585},{x:0.4697985789630079,y:0.33118575445642906},{x:0.4656401325536145,y:0.33896566048588217},{x:0.4600438051533946,y:0.3457848051533947},{x:0.4532246604858821,y:0.3513811325536146},{x:0.44544475445642906,y:0.355539578963008},{x:0.4370030644907258,y:0.3581003376181454},{x:0.428224,y:0.35896500000000003},{x:0.173829,y:0.35896500000000003},{x:0.16504993550927424,y:0.3581003376181454},{x:0.15660824554357097,y:0.355539578963008},{x:0.14882833951411792,y:0.3513811325536146},{x:0.14200919484660537,y:0.3457848051533947},{x:0.13641286744638548,y:0.33896566048588217},{x:0.13225442103699211,y:0.33118575445642906},{x:0.12969366238185465,y:0.32274406449072585},{x:0.12882900000000003,y:0.31396500000000005}]],".":[[{x:0.19450299999999998,y:0.148926},{x:0.19536766238185463,y:0.14014693550927423},{x:0.1979284210369921,y:0.13170524554357096},{x:0.20208686744638546,y:0.12392533951411791},{x:0.20768319484660536,y:0.11710619484660537},{x:0.2145023395141179,y:0.11150986744638547},{x:0.22228224554357093,y:0.1073514210369921},{x:0.2307239355092742,y:0.10479066238185464},{x:0.239503,y:0.103926},{x:0.362549,y:0.103926},{x:0.3713280644907258,y:0.10479066238185464},{x:0.3797697544564291,y:0.1073514210369921},{x:0.38754966048588213,y:0.11150986744638547},{x:0.3943688051533947,y:0.11710619484660537},{x:0.39996513255361454,y:0.12392533951411791},{x:0.40412357896300793,y:0.13170524554357096},{x:0.4066843376181454,y:0.14014693550927423},{x:0.407549,y:0.148926},{x:0.4066843376181454,y:0.1577050644907258},{x:0.40412357896300793,y:0.16614675445642904},{x:0.39996513255361454,y:0.1739266604858821},{x:0.3943688051533947,y:0.18074580515339464},{x:0.38754966048588213,y:0.18634213255361454},{x:0.3797697544564291,y:0.1905005789630079},{x:0.3713280644907258,y:0.19306133761814537},{x:0.362549,y:0.193926},{x:0.239503,y:0.193926},{x:0.2307239355092742,y:0.19306133761814537},{x:0.22228224554357093,y:0.1905005789630079},{x:0.2145023395141179,y:0.18634213255361454},{x:0.20768319484660536,y:0.18074580515339464},{x:0.20208686744638546,y:0.1739266604858821},{x:0.1979284210369921,y:0.16614675445642904},{x:0.19536766238185463,y:0.1577050644907258},{x:0.19450299999999998,y:0.148926}]],"/":[[{x:0.017522651058219416,y:-0.036644753012328966},{x:0.01865919532569161,y:-0.04539277458837648},{x:0.02148055556003016,y:-0.053750976595687026},{x:0.02587830846966649,y:-0.06139815801845333},{x:0.031683450876571484,y:-0.06804044196318723},{x:0.038672894413609195,y:-0.07342256918292836},{x:0.04657803868537635,y:-0.0773377075469538},{x:0.0550950934307649,y:-0.07963540048356893},{x:0.0638967530123289,y:-0.08022734894178067},{x:0.07264477458837641,y:-0.07909080467430848},{x:0.08100297659568695,y:-0.07626944443996993},{x:0.08865015801845323,y:-0.0718716915303336},{x:0.09529244196318715,y:-0.0660665491234286},{x:0.10067456918292828,y:-0.059077105586390885},{x:0.5777245691829282,y:0.7051758944136092},{x:0.5816397075469537,y:0.7130810386853763},{x:0.5839374004835688,y:0.7215980934307649},{x:0.5845293489417805,y:0.7303997530123288},{x:0.5833928046743084,y:0.7391477745883763},{x:0.5805714444399699,y:0.747505976595687},{x:0.5761736915303335,y:0.7551531580184532},{x:0.5703685491234285,y:0.7617954419631872},{x:0.5633791055863908,y:0.7671775691829282},{x:0.5554739613146237,y:0.7710927075469537},{x:0.5469569065692351,y:0.7733904004835688},{x:0.5381552469876711,y:0.7739823489417805},{x:0.5294072254116237,y:0.7728458046743084},{x:0.521049023404313,y:0.7700244444399699},{x:0.5134018419815468,y:0.7656266915303335},{x:0.5067595580368128,y:0.7598215491234285},{x:0.5013774308170718,y:0.7528321055863908},{x:0.024327430817071727,y:-0.011420894413609283},{x:0.020412292453046287,y:-0.019326038685376436},{x:0.018114599516431164,y:-0.027843093430764996},{x:0.017522651058219416,y:-0.036644753012328966}]],"<":[[{x:-0.002019645490236678,y:0.32959917016575135},{x:-0.0016099914284145765,y:0.3262199732716625},{x:-0.0013526191024594778,y:0.3228257800560043},{x:-0.001080072865731869,y:0.3218487260950263},{x:-0.0009579981642362373,y:0.3208417436418168},{x:0.00010303311987996846,y:0.3176073966113462},{x:0.0010176343561875828,y:0.3143286327165328},{x:0.0014755574652736251,y:0.31342352370653337},{x:0.001791739066671412,y:0.3124597057316259},{x:0.003463372735866293,y:0.309494502707312},{x:0.00500005526992945,y:0.3064571691910689},{x:0.005625757523098081,y:0.30565878796371126},{x:0.0061238953427729045,y:0.3047751734513664},{x:0.008341891452602095,y:0.3021930655225286},{x:0.010441601436418424,y:0.2995138854085287},{x:0.011211037446978121,y:0.298852913306643},{x:0.011871988327878901,y:0.29808345906703315},{x:0.014551110531708777,y:0.29598367519331337},{x:0.017133157288130564,y:0.2937656078708368},{x:0.01801675806170013,y:0.2932674456816211},{x:0.018815122032139454,y:0.29264172140965955},{x:0.021852413166145952,y:0.29110495510775264},{x:0.024817570086352318,y:0.28943323966009543},{x:0.5409315700863523,y:0.06192123966009548},{x:0.5493135321567164,y:0.059171271257023414},{x:0.5580709293975171,y:0.05810938240515066},{x:0.5668672199439956,y:0.058776380897540545},{x:0.5753643672834672,y:0.061146634356187606},{x:0.583235830808931,y:0.06512905526992949},{x:0.5901791145914712,y:0.07057060143641844},{x:0.5959273921291632,y:0.07726215728813057},{x:0.6002597603399046,y:0.08494657008635234},{x:0.6030097287429766,y:0.09332853215671641},{x:0.6040716175948494,y:0.10208592939751719},{x:0.6034046191024595,y:0.11088221994399564},{x:0.6010343656438124,y:0.11937936728346718},{x:0.5970519447300705,y:0.12725083080893104},{x:0.5916103985635816,y:0.13419411459147126},{x:0.5849188427118694,y:0.1399423921291632},{x:0.5772344299136477,y:0.14427476033990455},{x:0.15453394878652635,y:0.33060846154195217},{x:0.577233294268374,y:0.5169277390666714},{x:0.5849178265486336,y:0.521259895342773},{x:0.5916095409329668,y:0.527007988327879},{x:0.5970512785903404,y:0.5339511220321395},{x:0.6010339165943431,y:0.5418224757210541},{x:0.6034044043999703,y:0.5503195576866639},{x:0.6040716454902366,y:0.5591158298342486},{x:0.6030099981642363,y:0.5678732563581832},{x:0.6002602609333286,y:0.5762552942683741},{x:0.5959281046572271,y:0.5839398265486336},{x:0.5901800116721211,y:0.5906315409329669},{x:0.5832368779678606,y:0.5960732785903404},{x:0.5753655242789459,y:0.6000559165943432},{x:0.5668684423133362,y:0.6024264043999704},{x:0.5580721701657515,y:0.6030936454902367},{x:0.5493147436418169,y:0.6020319981642364},{x:0.540932705731626,y:0.5992822609333287},{x:0.024818705731625975,y:0.37178726093332853},{x:0.02185350270731245,y:0.3701156272641339},{x:0.018816169191068974,y:0.3685789447300705},{x:0.01801778796371134,y:0.36795324247690187},{x:0.01713417345136639,y:0.367455104657227},{x:0.01455206552252819,y:0.3652371085473975},{x:0.011872885408528756,y:0.3631373985635815},{x:0.011211913306643135,y:0.3623679625530219},{x:0.010442459067033207,y:0.36170701167212105},{x:0.008342675193313383,y:0.3590278894682912},{x:0.006124607870836803,y:0.3564458427118694},{x:0.005626445681621026,y:0.3555622419382997},{x:0.005000721409659611,y:0.3547638779678605},{x:0.0034639551077528313,y:0.3517265868338544},{x:0.0017922396600954515,y:0.3487614299136476},{x:0.0014760314771086122,y:0.3477976206592673},{x:0.0010180834056568513,y:0.3468925242789459},{x:0.00010339174271701993,y:0.34361378560971106},{x:-0.0009577287429766018,y:0.3403794678432836},{x:-0.0010798312165939596,y:0.33937248875722786},{x:-0.0013524043999703778,y:0.33839544231333624},{x:-0.001609870336301571,y:0.33500125619719334},{x:-0.0020196175948493655,y:0.3316220706024828},{x:-0.001942922029511974,y:0.3306106193263084},{x:-0.002019645490236678,y:0.32959917016575135}]],"=":[[{x:-0.002030999999999998,y:0.19162999999999997},{x:-0.0011663376181453647,y:0.1828509355092742},{x:0.0013944210369920967,y:0.17440924554357093},{x:0.005552867446385459,y:0.16662933951411787},{x:0.011149194846605363,y:0.15981019484660533},{x:0.017968339514117915,y:0.15421386744638543},{x:0.025748245543570962,y:0.15005542103699207},{x:0.03418993550927423,y:0.1474946623818546},{x:0.042969,y:0.14662999999999998},{x:0.559083,y:0.14662999999999998},{x:0.5678620644907257,y:0.1474946623818546},{x:0.576303754456429,y:0.15005542103699207},{x:0.5840836604858821,y:0.15421386744638543},{x:0.5909028051533947,y:0.15981019484660533},{x:0.5964991325536145,y:0.16662933951411787},{x:0.6006575789630079,y:0.17440924554357093},{x:0.6032183376181454,y:0.1828509355092742},{x:0.604083,y:0.19162999999999997},{x:0.6032183376181454,y:0.20040906449072574},{x:0.6006575789630079,y:0.208850754456429},{x:0.5964991325536145,y:0.21663066048588206},{x:0.5909028051533947,y:0.2234498051533946},{x:0.5840836604858821,y:0.2290461325536145},{x:0.576303754456429,y:0.23320457896300786},{x:0.5678620644907257,y:0.23576533761814533},{x:0.559083,y:0.23662999999999995},{x:0.042969,y:0.23662999999999995},{x:0.03418993550927421,y:0.23576533761814533},{x:0.025748245543570934,y:0.23320457896300786},{x:0.017968339514117904,y:0.2290461325536145},{x:0.011149194846605356,y:0.2234498051533946},{x:0.005552867446385459,y:0.21663066048588206},{x:0.0013944210369920967,y:0.208850754456429},{x:-0.0011663376181453647,y:0.20040906449072574},{x:-0.002030999999999998,y:0.19162999999999997}],[{x:-0.002030999999999998,y:0.454102},{x:-0.0011663376181453647,y:0.4453229355092742},{x:0.0013944210369920967,y:0.436881245543571},{x:0.005552867446385459,y:0.4291013395141179},{x:0.011149194846605363,y:0.42228219484660534},{x:0.017968339514117915,y:0.41668586744638547},{x:0.025748245543570962,y:0.4125274210369921},{x:0.03418993550927423,y:0.40996666238185464},{x:0.042969,y:0.409102},{x:0.559083,y:0.409102},{x:0.5678620644907257,y:0.40996666238185464},{x:0.576303754456429,y:0.4125274210369921},{x:0.5840836604858821,y:0.41668586744638547},{x:0.5909028051533947,y:0.42228219484660534},{x:0.5964991325536145,y:0.4291013395141179},{x:0.6006575789630079,y:0.436881245543571},{x:0.6032183376181454,y:0.4453229355092742},{x:0.604083,y:0.454102},{x:0.6032183376181454,y:0.4628810644907258},{x:0.6006575789630079,y:0.471322754456429},{x:0.5964991325536145,y:0.4791026604858821},{x:0.5909028051533947,y:0.48592180515339467},{x:0.5840836604858821,y:0.49151813255361454},{x:0.576303754456429,y:0.49567657896300793},{x:0.5678620644907257,y:0.49823733761814537},{x:0.559083,y:0.499102},{x:0.042969,y:0.499102},{x:0.03418993550927421,y:0.49823733761814537},{x:0.025748245543570934,y:0.49567657896300793},{x:0.017968339514117904,y:0.49151813255361454},{x:0.011149194846605356,y:0.48592180515339467},{x:0.005552867446385459,y:0.4791026604858821},{x:0.0013944210369920967,y:0.471322754456429},{x:-0.0011663376181453647,y:0.4628810644907258},{x:-0.002030999999999998,y:0.454102}]],">":[[{x:-0.002019645490236678,y:0.5591158298342487},{x:-0.0013524043999703708,y:0.5503195576866637},{x:0.0010180834056568513,y:0.5418224757210541},{x:0.005000721409659611,y:0.5339511220321396},{x:0.01044245906703322,y:0.527007988327879},{x:0.01713417345136643,y:0.521259895342773},{x:0.024818705731625975,y:0.5169277390666714},{x:0.44751805121347366,y:0.33060846154195217},{x:0.024817570086352318,y:0.14427476033990455},{x:0.017133157288130554,y:0.1399423921291632},{x:0.01044160143641841,y:0.13419411459147126},{x:0.00500005526992945,y:0.12725083080893107},{x:0.0010176343561875828,y:0.11937936728346718},{x:-0.0013526191024594778,y:0.11088221994399562},{x:-0.0020196175948493655,y:0.10208592939751718},{x:-0.0009577287429766018,y:0.0933285321567164},{x:0.0017922396600954585,y:0.08494657008635234},{x:0.00612460787083681,y:0.07726215728813059},{x:0.011872885408528759,y:0.07057060143641844},{x:0.018816169191068984,y:0.06512905526992947},{x:0.02668763271653284,y:0.061146634356187606},{x:0.03518478005600438,y:0.058776380897540545},{x:0.04398107060248284,y:0.05810938240515066},{x:0.052738467843283614,y:0.05917127125702342},{x:0.06112042991364768,y:0.06192123966009548},{x:0.5772344299136477,y:0.28943323966009543},{x:0.5801995868338548,y:0.29110495510775297},{x:0.5832368779678606,y:0.2926417214096596},{x:0.5840352419382998,y:0.29326744568162105},{x:0.5849188427118694,y:0.2937656078708368},{x:0.5875008894682915,y:0.29598367519331353},{x:0.5901800116721211,y:0.29808345906703315},{x:0.5908409625530218,y:0.2988529133066429},{x:0.5916103985635817,y:0.29951388540852875},{x:0.5937101085473976,y:0.3021930655225282},{x:0.5959281046572271,y:0.3047751734513664},{x:0.5964262424769022,y:0.30565878796371176},{x:0.5970519447300705,y:0.30645716919106897},{x:0.5985886272641329,y:0.3094945027073105},{x:0.6002602609333286,y:0.31245970573162596},{x:0.6005764425347265,y:0.31342352370653376},{x:0.6010343656438124,y:0.31432863271653283},{x:0.6019489668801197,y:0.31760739661134507},{x:0.6030099981642363,y:0.32084174364181683},{x:0.6031320728657319,y:0.3218487260950267},{x:0.6034046191024595,y:0.3228257800560044},{x:0.6036619914284146,y:0.3262199732716634},{x:0.6040716454902366,y:0.32959917016575135},{x:0.603994922029512,y:0.330610619326308},{x:0.6040716175948494,y:0.33162207060248283},{x:0.6036618703363014,y:0.3350012561971954},{x:0.6034044043999703,y:0.33839544231333624},{x:0.6031318312165941,y:0.33937248875722736},{x:0.6030097287429766,y:0.3403794678432836},{x:0.6019486082572825,y:0.3436137856097129},{x:0.6010339165943431,y:0.3468925242789459},{x:0.6005759685228916,y:0.3477976206592668},{x:0.6002597603399046,y:0.34876142991364767},{x:0.5985880448922466,y:0.3517265868338553},{x:0.5970512785903404,y:0.3547638779678605},{x:0.596425554318379,y:0.35556224193829966},{x:0.5959273921291631,y:0.35644584271186947},{x:0.5937093248066866,y:0.3590278894682911},{x:0.5916095409329668,y:0.36170701167212105},{x:0.5908400866933569,y:0.3623679625530219},{x:0.5901791145914712,y:0.36313739856358157},{x:0.5874999344774714,y:0.3652371085473978},{x:0.5849178265486336,y:0.367455104657227},{x:0.5840342120362888,y:0.36795324247690175},{x:0.583235830808931,y:0.3685789447300705},{x:0.5801984972926872,y:0.37011562726413405},{x:0.577233294268374,y:0.37178726093332853},{x:0.06111929426837402,y:0.5992822609333287},{x:0.05273725635818315,y:0.6020319981642364},{x:0.04397982983424857,y:0.6030936454902367},{x:0.035183557686663716,y:0.6024264043999704},{x:0.02668647572105406,y:0.6000559165943432},{x:0.018815122032139416,y:0.5960732785903404},{x:0.011871988327878898,y:0.5906315409329669},{x:0.006123895342772898,y:0.5839398265486336},{x:0.001791739066671405,y:0.5762552942683741},{x:-0.0009579981642362442,y:0.5678732563581832},{x:-0.002019645490236678,y:0.5591158298342487}]],A:[[{x:-0.026930267425517032,y:0.05053409251215203},{x:-0.025968910797820398,y:0.041765089843587025},{x:-0.02331527881378681,y:0.03335213247651147},{x:-0.019071349062388714,y:0.025618525644501258},{x:-0.013400213383949137,y:0.018861467521053887},{x:-0.006519810342180955,y:0.013340628060451547},{x:0.0013054500325951415,y:0.009268170027042777},{x:0.009774847372633092,y:0.006800595699190677},{x:0.018562907487847988,y:0.006032732574482988},{x:0.02733191015641301,y:0.006994089202179622},{x:0.035744867523488544,y:0.00964772118621321},{x:0.043478474355498745,y:0.013891650937611293},{x:0.05023553247894613,y:0.019562786616050876},{x:0.055756371939548466,y:0.02644318965781906},{x:0.05982882997295724,y:0.03426845003259516},{x:0.15465984441872488,y:0.2705423452957767},{x:0.155303,y:0.27047899999999997},{x:0.433548,y:0.27047899999999997},{x:0.439584057854266,y:0.2710734998088117},{x:0.5426964027293978,y:0.03313672871631684},{x:0.5469805748198717,y:0.025425342079263714},{x:0.5526868446471364,y:0.018697928086846893},{x:0.559595923461843,y:0.013213017486017727},{x:0.5674422992397985,y:0.009181392315192764},{x:0.5759244401601543,y:0.006757985668725375},{x:0.5847163823041805,y:0.006035927704977205},{x:0.5934802562658602,y:0.007042966706560308},{x:0.6018792712836831,y:0.009740402729397836},{x:0.6095906579207363,y:0.01402457481987169},{x:0.6163180719131531,y:0.019730844647136342},{x:0.6218029825139822,y:0.026639923461843008},{x:0.6258346076848073,y:0.03448629923979854},{x:0.6282580143312746,y:0.042968440160154345},{x:0.6289800722950228,y:0.05176038230418057},{x:0.6279730332934397,y:0.060524256265860256},{x:0.6252755972706022,y:0.0689232712836832},{x:0.3314685972706022,y:0.7468972712836831},{x:0.3293831787279993,y:0.7506509647260751},{x:0.32731734906238874,y:0.7544154743554987},{x:0.32724162770964893,y:0.7545056950115825},{x:0.32718442518012836,y:0.7546086579207363},{x:0.324406768107635,y:0.7578833802211685},{x:0.32164621338394916,y:0.7611725324789461},{x:0.3215543458189217,y:0.761246247067332},{x:0.32147815535286367,y:0.7613360719131531},{x:0.3181150035540548,y:0.764005977330098},{x:0.314765810342181,y:0.7666933719395485},{x:0.31466132698386995,y:0.7667477476499444},{x:0.314569076538157,y:0.7668209825139822},{x:0.31074967405057474,y:0.7687834680795742},{x:0.3069405499674049,y:0.7707658299729572},{x:0.30682746605267575,y:0.7707987771773066},{x:0.30672270076020147,y:0.7708526076848072},{x:0.3025938250794972,y:0.7720322561793334},{x:0.29847115262736695,y:0.7732334043008093},{x:0.2983538139076442,y:0.7732436568565263},{x:0.29824055983984565,y:0.7732760143312747},{x:0.29396088134293,y:0.7736274925246428},{x:0.289683092512152,y:0.774001267425517},{x:0.28956600824863027,y:0.7739884313326351},{x:0.2894486176958195,y:0.7739980722950228},{x:0.2851826020272766,y:0.773507873077374},{x:0.280914089843587,y:0.7730399107978204},{x:0.2808017595188513,y:0.7730044793401902},{x:0.28068474373413976,y:0.7729910332934397},{x:0.2765963314836881,y:0.7716779947458032},{x:0.2725011324765115,y:0.7703862788137869},{x:0.27239787288194656,y:0.7703296136024552},{x:0.27228572871631684,y:0.7702935972706022},{x:0.26853203527393116,y:0.7682081787280027},{x:0.2647675256445013,y:0.7661423490623888},{x:0.26467730498841713,y:0.7660666277096486},{x:0.2645743420792637,y:0.7660094251801283},{x:0.2612996197788366,y:0.7632317681076393},{x:0.2580104675210539,y:0.7604712133839491},{x:0.2579367529326681,y:0.7603793458189217},{x:0.2578469280868469,y:0.7603031553528636},{x:0.25517702266989234,y:0.7569400035540427},{x:0.25248962806045155,y:0.7535908103421809},{x:0.2524352523500559,y:0.7534863269838704},{x:0.2523620174860177,y:0.753394076538157},{x:0.2503995319204231,y:0.7495746740505695},{x:0.24841717002704278,y:0.7457655499674049},{x:-0.023694829972957243,y:0.06779154996740488},{x:-0.026162404300809343,y:0.05932215262736691},{x:-0.026930267425517032,y:0.05053409251215203}],[{x:0.19075686729109992,y:0.36047899999999994},{x:0.2917712201653896,y:0.6121588409316518},{x:0.4008392655839541,y:0.36047899999999994},{x:0.19075686729109992,y:0.36047899999999994}]],B:[[{x:0.018964999999999996,y:0.05103000000000002},{x:0.018993157630992935,y:0.05074411077481729},{x:0.01896863696544404,y:0.050457886669927884},{x:0.019425235762019696,y:0.046357147889743},{x:0.01982966238185463,y:0.04225093550927423},{x:0.019913053192865363,y:0.04197603284668677},{x:0.019944843237820968,y:0.04169052471317667},{x:0.02119268306568244,y:0.037757658485048945},{x:0.02239042103699209,y:0.03380924554357098},{x:0.0225258403659196,y:0.03355589379873479},{x:0.022612719447780122,y:0.03328207355405998},{x:0.02460384652213923,y:0.029668217721559587},{x:0.026548867446385453,y:0.026029339514117924},{x:0.02673111120436309,y:0.02580727485250577},{x:0.026869740608734982,y:0.025555665255108946},{x:0.029527637032761178,y:0.022399698271204867},{x:0.03214519484660536,y:0.019210194846605383},{x:0.03236725950821749,y:0.019027951088627763},{x:0.03255231178483501,y:0.01880822135423258},{x:0.03577483608951879,y:0.016231425260229353},{x:0.03896433951411791,y:0.013613867446385479},{x:0.03921769125895406,y:0.013478448117457993},{x:0.03944205495260531,y:0.013299042336531411},{x:0.04310536733612953,y:0.011400441961238211},{x:0.046744245543570956,y:0.009455421036992116},{x:0.04701914820615845,y:0.009372030225981372},{x:0.047274201145921,y:0.009239842862072495},{x:0.051237522567796415,y:0.008092400353164256},{x:0.055185935509274225,y:0.006894662381854655},{x:0.05547182473445692,y:0.006866504750861718},{x:0.05574776537889109,y:0.006786615690234012},{x:0.05985878761953148,y:0.006434426619834929},{x:0.063965,y:0.0060300000000000215},{x:0.06425088922518268,y:0.006058157630992957},{x:0.06453711333007213,y:0.00603363696544406},{x:0.4241221133300721,y:0.01060563696544408},{x:0.4260098351414485,y:0.010815826288282449},{x:0.4279092214657345,y:0.010813640036582327},{x:0.43038314701987823,y:0.011302774871886453},{x:0.43288947528682337,y:0.011581843237821021},{x:0.43469991915024053,y:0.012156270087817089},{x:0.43656323581544765,y:0.012524677733968342},{x:0.4388942001112364,y:0.013487052913568918},{x:0.44129792644594007,y:0.014249719447780182},{x:0.4429615180190356,y:0.01516630892323094},{x:0.4447171588106798,y:0.015891152767997317},{x:0.5224141588106799,y:0.0573061527679973},{x:0.525028554951968,y:0.05904868699814221},{x:0.5277374225537912,y:0.06064039332865708},{x:0.5286915199232336,y:0.06149010807639827},{x:0.529754639763497,y:0.06219869339105244},{x:0.5319788494519322,y:0.06441778869965879},{x:0.5343251404217865,y:0.06650738469209135},{x:0.5350951339540482,y:0.06752690757225652},{x:0.5359995881074716,y:0.06842928201075814},{x:0.5377481362120787,y:0.07103965980959966},{x:0.5396416839038074,y:0.07354684346181917},{x:0.5707946839038074,y:0.12450984346181915},{x:0.5718407730360667,y:0.12667263757185424},{x:0.573076251912317,y:0.12873311634664666},{x:0.5737567016649755,y:0.13063382885667474},{x:0.5746357412153917,y:0.13245124718509382},{x:0.57523978983892,y:0.1347765656784282},{x:0.576049549867314,y:0.13703848290314058},{x:0.576346114353134,y:0.13903542291661675},{x:0.5768537026781452,y:0.1409894121704204},{x:0.5769924975430949,y:0.14338789436140983},{x:0.5773454200998597,y:0.14576432582559334},{x:0.5830324200998597,y:0.2611263258255933},{x:0.5829003037879823,y:0.26382496142481277},{x:0.5829742287592172,y:0.2665258175697889},{x:0.5826851199428378,y:0.2682203519457296},{x:0.5826010630436497,y:0.26993731586400416},{x:0.5819450076216034,y:0.2725583233230625},{x:0.5814906012502021,y:0.27522170532098544},{x:0.5808764603215925,y:0.2768272773619606},{x:0.5804590555084463,y:0.278494851612457},{x:0.5793042728181804,y:0.28093750708458076},{x:0.5783389976861617,y:0.283461062658912},{x:0.5774234257367941,y:0.284915971131802},{x:0.5766887136425759,y:0.2864700717712602},{x:0.575079581335268,y:0.2886405053765124},{x:0.5736405324246225,y:0.2909272557017569},{x:0.5044305324246225,y:0.38012925570175693},{x:0.5017223718437749,y:0.38298983800955333},{x:0.499075053174031,y:0.3859068173944946},{x:0.49869279401231464,y:0.38618992769627897},{x:0.4983657648506557,y:0.38653536283797296},{x:0.49515156889241035,y:0.38881264393905274},{x:0.49198604326106643,y:0.39115710813128307},{x:0.4915558970220145,y:0.39136020348505085},{x:0.4911677605809681,y:0.39163520096290155},{x:0.48757104899345777,y:0.3932416662216644},{x:0.4840089657752798,y:0.3949235187770668},{x:0.3737297002329455,y:0.43429966367120415},{x:0.4408630401939032,y:0.4733794631163462},{x:0.44336631106573315,y:0.475186847643908},{x:0.4459719275146733,y:0.476843279595192},{x:0.4469351296354233,y:0.4777635673817196},{x:0.4480152047486495,y:0.4785433915190981},{x:0.45011777274311354,y:0.48080441158023823},{x:0.45235016915983667,y:0.4829373462081214},{x:0.4531153243813002,y:0.4840278623347861},{x:0.4540225100120052,y:0.48500341457167107},{x:0.4556435746202097,y:0.4876311804334344},{x:0.4574169612623637,y:0.4901586502563309},{x:0.45795466509848404,y:0.4913774867999537},{x:0.45865409861163536,y:0.4925112772109775},{x:0.4597313632297904,y:0.4954048053049642},{x:0.460977589843244,y:0.49822968107500176},{x:0.46126717863714684,y:0.4995299988307428},{x:0.46173198119508085,y:0.5007784564862466},{x:0.46222404714804793,y:0.5038265501505143},{x:0.4628952219429378,y:0.5068402734760588},{x:0.4768502219429378,y:0.6216502734760588},{x:0.47694604753136066,y:0.6258560133977795},{x:0.4770801736029929,y:0.6300607061367898},{x:0.47704647561686464,y:0.6302637547476413},{x:0.47705116403527437,y:0.6304695272224051},{x:0.47632464920624185,y:0.6346131496757303},{x:0.47563590322258376,y:0.6387632171212809},{x:0.475563239914934,y:0.6389557900590453},{x:0.4755276940283349,y:0.6391585233384632},{x:0.47400675833929046,y:0.6430807912362932},{x:0.4725216084222428,y:0.647016748623825},{x:0.4724127722032346,y:0.6471914454185},{x:0.4723383580201142,y:0.6473833485763381},{x:0.4700814501766401,y:0.6509335313629835},{x:0.46785696980463054,y:0.6545041220574128},{x:0.46771614318912413,y:0.6546542292091504},{x:0.46760572040480797,y:0.6548279275146733},{x:0.4646995721096373,y:0.6578695936566139},{x:0.4618212468158623,y:0.6609376018599591},{x:0.3721282468158623,y:0.739463601859959},{x:0.3693406873548985,y:0.7414576112446344},{x:0.36664335021940475,y:0.7435720694617842},{x:0.36575927454484214,y:0.7440194833243711},{x:0.36495338890552403,y:0.7445959530105889},{x:0.3618303796850022,y:0.746007822191186},{x:0.35877236079175173,y:0.7475554273162446},{x:0.35781798626885214,y:0.7478217696388809},{x:0.3569151218394033,y:0.7482299421328396},{x:0.35357667835226414,y:0.7490054137685334},{x:0.3502754956523681,y:0.7499266922044516},{x:0.21714549565236804,y:0.7733246922044517},{x:0.2164184100494338,y:0.7733799121498203},{x:0.21571010443589486,y:0.773553134187072},{x:0.21202614434596675,y:0.7737134914026773},{x:0.20834928456346336,y:0.7739927377465721},{x:0.20762539682958886,y:0.7739050492917646},{x:0.20689690716677497,y:0.7739367593459113},{x:0.061505907166774995,y:0.7659797593459113},{x:0.05835682356136361,y:0.7654946428322841},{x:0.055185935509274225,y:0.7651823376181454},{x:0.05400593378019863,y:0.7648243880069794},{x:0.05278721145616079,y:0.7646366437616691},{x:0.0497932781460736,y:0.7635464928911877},{x:0.046744245543570956,y:0.7626215789630079},{x:0.045656749721751114,y:0.7620403003359452},{x:0.0444980718907103,y:0.7616184026130197},{x:0.04177434405403643,y:0.7599651112722733},{x:0.03896433951411791,y:0.7584631325536145},{x:0.03801114145411163,y:0.7576808631223083},{x:0.03695703545532078,y:0.7570410252146568},{x:0.03460818442533898,y:0.7548881284626934},{x:0.03214519484660536,y:0.7528668051533947},{x:0.03136292541529926,y:0.7519136070933885},{x:0.03045389995114224,y:0.7510804176129765},{x:0.02857019075568381,y:0.7485106500646154},{x:0.026548867446385453,y:0.7460476604858821},{x:0.025967588819322866,y:0.7449601646640625},{x:0.025238577228599887,y:0.7439656426153641},{x:0.023892399755650346,y:0.7410777589963466},{x:0.02239042103699209,y:0.738267754456429},{x:0.022032471425826126,y:0.7370877527273536},{x:0.021511489215134356,y:0.7359701170349662},{x:0.02075457631003429,y:0.7328750970932278},{x:0.01982966238185463,y:0.7298260644907257},{x:0.019708797589401895,y:0.7285989036590902},{x:0.01941586581292807,y:0.7274011044358949},{x:0.019277305214138767,y:0.7242178880520896},{x:0.018964999999999996,y:0.721047},{x:0.018964999999999996,y:0.05103000000000002}],[{x:0.10896499999999999,y:0.09660579683225357},{x:0.10896499999999999,y:0.37786028838708235},{x:0.29722384626437015,y:0.36605169579422814},{x:0.44137514989764515,y:0.3145812530901673},{x:0.49232133133007555,y:0.24891875813083103},{x:0.48801965008125897,y:0.1616582425292873},{x:0.46925190911582665,y:0.130956211173677},{x:0.41203782454012283,y:0.1004592638951106},{x:0.10896499999999999,y:0.09660579683225357}],[{x:0.10896499999999999,y:0.47257215902605326},{x:0.10896499999999999,y:0.6784424315209651},{x:0.20665565807681563,y:0.6837888736412973},{x:0.32230778354311135,y:0.6634626629325134},{x:0.3846372425734713,y:0.608893375476212},{x:0.3762519660226853,y:0.5399063743443061},{x:0.2981741908903496,y:0.4944555775409729},{x:0.10896499999999999,y:0.47257215902605326}]],C:[[{x:0.028007484408327545,y:0.4010798543150725},{x:0.028340096336253087,y:0.39680461654123217},{x:0.028649292669517497,y:0.39252762152779447},{x:0.06572429266951751,y:0.1769866215277945},{x:0.0657499934516808,y:0.17689321918606288},{x:0.06575739253020782,y:0.1767966283931179},{x:0.06691993730130205,y:0.17264138379230456},{x:0.0680646634579554,y:0.1684811950870131},{x:0.0681080922997215,y:0.16839460141895576},{x:0.06813419313592875,y:0.16830131007962543},{x:0.07008504794245551,y:0.16445270857242494},{x:0.07201939106115751,y:0.16059578172109576},{x:0.07207887901649253,y:0.16051932447281397},{x:0.0721226785698821,y:0.1604329177209502},{x:0.1274306785698821,y:0.07363491772095027},{x:0.13009575906138268,y:0.07023973030268985},{x:0.13274648275581225,y:0.06683332229320074},{x:0.13281865262016482,y:0.06677089175108791},{x:0.13287757357360944,y:0.06669582922279092},{x:0.1361538134974972,y:0.06388581079003605},{x:0.13941816151489866,y:0.0610619864944041},{x:0.19692016151489866,y:0.020443986494404057},{x:0.19808425112310213,y:0.019782383965415776},{x:0.19914710087537263,y:0.01896802966513257},{x:0.20191114759162085,y:0.01760739299916557},{x:0.20458957759683996,y:0.01608512525217841},{x:0.2058603718000633,y:0.015663337846789194},{x:0.20706167183504787,y:0.015071982836463577},{x:0.21003805521400143,y:0.014276729186446702},{x:0.2129619996426652,y:0.013306247159584957},{x:0.21429066253234816,y:0.013140483931242813},{x:0.21558424756339917,y:0.01279485365228588},{x:0.32760524756339915,y:-0.005618146347714133},{x:0.32775803960473765,y:-0.005628051859015257},{x:0.32790622767465843,y:-0.005666572281957827},{x:0.3321581535063009,y:-0.005913311337168391},{x:0.3364083102547015,y:-0.006188849089881349},{x:0.3365600989091985,y:-0.006168756021014132},{x:0.33671295454862427,y:-0.006177626226551311},{x:0.34093131721939995,y:-0.005590114680318674},{x:0.3451535631465426,y:-0.005031193603710363},{x:0.34529851526132993,y:-0.004981874120043047},{x:0.3454501643137599,y:-0.004960753231150514},{x:0.44307616431375996,y:0.01857424676884946},{x:0.4458503498549469,y:0.019539172468847843},{x:0.4486819664572553,y:0.020319643122350156},{x:0.45000735163266253,y:0.02098507354168687},{x:0.45140809089867484,y:0.021472282957461515},{x:0.45394072357704407,y:0.022959884631265325},{x:0.4565656691892177,y:0.024277779754777677},{x:0.4577357684253341,y:0.0251889939358613},{x:0.459014543037309,y:0.025940112433793877},{x:0.4612082951993476,y:0.027893222383335445},{x:0.4635256946335971,y:0.029697896006345384},{x:0.5358116946335971,y:0.09837789600634546},{x:0.5383578959705028,y:0.10132350300922108},{x:0.5409714489909738,y:0.10420951799057969},{x:0.5412394420583803,y:0.10465705806338507},{x:0.5415805729157932,y:0.10505169984914184},{x:0.5435031902892489,y:0.10843744707814906},{x:0.545503491029224,y:0.11177788699125937},{x:0.5456790239480676,y:0.11226911056087577},{x:0.5459366092786453,y:0.11272272074420048},{x:0.5471617575812067,y:0.11641849583208026},{x:0.548471935605029,y:0.12008498944441898},{x:0.572709935605029,y:0.21701898944441894},{x:0.5740007070580636,y:0.2257455880614603},{x:0.5735642017652605,y:0.23455632455146336},{x:0.571417194380227,y:0.24311260725223527},{x:0.5676421931927146,y:0.25108562301800397},{x:0.5623842693813143,y:0.2581689733242098},{x:0.5558454820094204,y:0.2640904489909738},{x:0.5482771130087407,y:0.26862249102922403},{x:0.539970010555581,y:0.27159093560502906},{x:0.5312434119385397,y:0.2728817070580635},{x:0.5224326754485367,y:0.2724452017652604},{x:0.5138763927477648,y:0.270298194380227},{x:0.5059033769819961,y:0.26652319319271456},{x:0.49882002667579023,y:0.2612652693813142},{x:0.49289855100902624,y:0.25472648200942033},{x:0.488366508970776,y:0.24715811300874066},{x:0.48539806439497096,y:0.23885101055558106},{x:0.46433420621000654,y:0.15461122058523102},{x:0.4102697826671089,y:0.10324381045150927},{x:0.3332137540403124,y:0.08466767669890593},{x:0.24039332695070226,y:0.09992465997883551},{x:0.1985742470214596,y:0.12946463056361485},{x:0.15288732813236672,y:0.2011637190451272},{x:0.11884238546013813,y:0.39908903228895243},{x:0.16184523767713488,y:0.5942488915238071},{x:0.2166399992296726,y:0.6603981208316636},{x:0.2708106585112101,y:0.6880654725502051},{x:0.33167151101531583,y:0.6962265900331734},{x:0.41875307675349,y:0.6679697644015699},{x:0.4604926982936834,y:0.628705384802963},{x:0.487421989657252,y:0.5630715564186946},{x:0.49155436139101494,y:0.5552777692634718},{x:0.49712782320648147,y:0.5484399232752638},{x:0.5039281900917167,y:0.5428207930406891},{x:0.5116941277610109,y:0.5386363185834178},{x:0.5201271955849208,y:0.5360473069101626},{x:0.5289033154962927,y:0.5351532522875923},{x:0.5376852261286371,y:0.5359885127334604},{x:0.5461354435813054,y:0.5385209896572519},{x:0.5539292307365281,y:0.5426533613910148},{x:0.5607670767247361,y:0.5482268232064814},{x:0.5663862069593109,y:0.5550271900917166},{x:0.5705706814165822,y:0.5627931277610108},{x:0.5731596930898373,y:0.5712261955849207},{x:0.5740537477124077,y:0.5800023154962926},{x:0.5732184872665396,y:0.588784226128637},{x:0.570686010342748,y:0.5972344435813053},{x:0.540057010342748,y:0.6718854435813053},{x:0.5396985836895672,y:0.6725614478775368},{x:0.539454213118803,y:0.6732865233897278},{x:0.5376352487491008,y:0.6764529645154376},{x:0.5359246386089851,y:0.679679230736528},{x:0.5354412171276051,y:0.6802723202285732},{x:0.5350600868536766,y:0.680935789284769},{x:0.5326583313554347,y:0.6836865257875079},{x:0.5303511767935185,y:0.686517076724736},{x:0.5297613381003629,y:0.6870044593160238},{x:0.5292580947459566,y:0.687580825172473},{x:0.47307109474595666,y:0.7404358251724731},{x:0.4722065860115991,y:0.7411021817697292},{x:0.4714497622811152,y:0.7418887085063782},{x:0.4687194058651613,y:0.7437900730587934},{x:0.46608420409854834,y:0.7458212660502541},{x:0.46510630693397415,y:0.746306161504971},{x:0.46421058160492856,y:0.7469299263656303},{x:0.4611617503991064,y:0.748262090618912},{x:0.45818091720073817,y:0.7497401524453693},{x:0.45712721164557074,y:0.7500249524971546},{x:0.4561270069400303,y:0.7504619845480405},{x:0.3497190069400303,y:0.7849899845480404},{x:0.34852117258500637,y:0.7852523061157466},{x:0.34737251112679673,y:0.7856814874310271},{x:0.34422084285321763,y:0.7861940634064482},{x:0.3411016855274714,y:0.7868771480384597},{x:0.33987569082458696,y:0.7869007432807547},{x:0.3386653714532072,y:0.7870975852636362},{x:0.3354742629896646,y:0.786985452257037},{x:0.33228177619648713,y:0.7870468942022847},{x:0.3310747354346284,y:0.7868308563672394},{x:0.32984927004476555,y:0.7867877944907101},{x:0.25121827004476555,y:0.7762437944907102},{x:0.24809780050166644,y:0.7755083028870222},{x:0.24494229970605153,y:0.7749416523797719},{x:0.24381291428322105,y:0.7744983594176508},{x:0.24263200473447152,y:0.7742200201979198},{x:0.2397149814324578,y:0.772889887451158},{x:0.2367306607297473,y:0.771718517308175},{x:0.16743766072974728,y:0.7363275173081749},{x:0.16716950847174827,y:0.7361554960544541},{x:0.16687461978467572,y:0.7360349240533984},{x:0.16345937419922074,y:0.733775423054901},{x:0.16001260855282193,y:0.7315643025810339},{x:0.15978316844705134,y:0.7313432727571054},{x:0.15951746839392553,y:0.7311674875843215},{x:0.15660865257214304,y:0.7282851209029094},{x:0.15365948376641753,y:0.7254440558690711},{x:0.15347757306746915,y:0.725182511527114},{x:0.15325127235232486,y:0.7249582685082102},{x:0.08558827235232488,y:0.6432742685082102},{x:0.0845522070982367,y:0.6417389136031936},{x:0.0833480194008015,y:0.6403315480201149},{x:0.08209078724421986,y:0.6380913122274521},{x:0.0806538380596292,y:0.6359618836319892},{x:0.07993721339171088,y:0.6342539038369039},{x:0.07903072722802115,y:0.632638655023214},{x:0.07823470075697891,y:0.6301961909068614},{x:0.07724079305844417,y:0.627827343805619},{x:0.07687114846079628,y:0.6260123758261444},{x:0.07629719958575912,y:0.6242513168879111},{x:0.02905219958575911,y:0.40983931688791114},{x:0.028544362954760993,y:0.4055813372409792},{x:0.028013217832748447,y:0.4013262022752188},{x:0.028022142274708197,y:0.401202753871557},{x:0.028007484408327545,y:0.4010798543150725}]],D:[[{x:0.019456783112310236,y:0.0515304721392918},{x:0.019516560837245702,y:0.0508455251733057},{x:0.019462408649259272,y:0.05016011050819538},{x:0.01989956114396584,y:0.04645701928180655},{x:0.020223754746627687,y:0.042742334175020345},{x:0.02041601038349858,y:0.04208221032853139},{x:0.020496616482350807,y:0.04139940114622653},{x:0.021647806474261868,y:0.03785274800035644},{x:0.022690469901424933,y:0.03427268656062632},{x:0.023007815173924504,y:0.033662754022853354},{x:0.023220081912440925,y:0.03300879029730612},{x:0.025041069815762075,y:0.029754871123364675},{x:0.026762134096652887,y:0.026447013104097812},{x:0.027192373603928278,y:0.025910711240413317},{x:0.027528143690388265,y:0.025310724430849408},{x:0.029948949961216734,y:0.02247458551787214},{x:0.03228227556070457,y:0.019566050047680916},{x:0.03280887543977226,y:0.01912398863794477},{x:0.03325524541805519,y:0.01860103590097925},{x:0.03618283982900684,y:0.01629166847686688},{x:0.03903875835284746,y:0.013894228942745224},{x:0.03964148166567549,y:0.013563396159022682},{x:0.0401812977878431,y:0.013137574275061882},{x:0.04350317452751879,y:0.011443726034814963},{x:0.04677193462845869,y:0.0096495146935595},{x:0.04742761905614622,y:0.009442624254195854},{x:0.048040136491355995,y:0.009130297319436702},{x:0.05162863769958001,y:0.008117061901006828},{x:0.05518462276008175,y:0.0069950292882567724},{x:0.05586807071778482,y:0.006920031876811272},{x:0.05652975076450537,y:0.006733202440201605},{x:0.060246972352300414,y:0.0064395179124900545},{x:0.06395352786070822,y:0.006032783112310258},{x:0.06463847482669428,y:0.006092560837245719},{x:0.06532388949180462,y:0.006038408649259287},{x:0.22607288949180462,y:0.009146408649259287},{x:0.22716730592225892,y:0.009275605270020776},{x:0.2282688262216939,y:0.009242558031150067},{x:0.23153975417198444,y:0.00979177582685766},{x:0.23483359885377353,y:0.010180616482350843},{x:0.23588178136904675,y:0.010520840680108605},{x:0.23696858346127098,y:0.010703324384590318},{x:0.374121583461271,y:0.04785532438459028},{x:0.3763172878682137,y:0.048688585594252994},{x:0.37858028056243914,y:0.049316523610364836},{x:0.3804311803743379,y:0.05024979166335608},{x:0.3823691959266467,y:0.050985260963484026},{x:0.38436014929137596,y:0.0522308719724549},{x:0.38645715458576285,y:0.05328823230909956},{x:0.47004915458576285,y:0.1063032323090996},{x:0.47296331256678825,y:0.10858070495130694},{x:0.47594842000778254,y:0.11076435600861785},{x:0.476434095048061,y:0.11129319075325024},{x:0.4769998347544389,y:0.11173532762855881},{x:0.47941368513584726,y:0.11453756329148114},{x:0.48191542538645477,y:0.11726162167794474},{x:0.5445294253864548,y:0.20053762167794476},{x:0.5457907389554543,y:0.20261097926106453},{x:0.5472304508598836,y:0.2045646816997861},{x:0.5480776582474705,y:0.2063702359380903},{x:0.54911422277829,y:0.20807414921008693},{x:0.5499468085621922,y:0.21035373787896267},{x:0.5509777083681839,y:0.21255077433219424},{x:0.570480708368184,y:0.26758877433219413},{x:0.5715324066676154,y:0.27184261440989077},{x:0.5725895850614416,y:0.2760950958693092},{x:0.5821235850614417,y:0.3411630958693092},{x:0.5823063349967632,y:0.3450227385412275},{x:0.5825832689280143,y:0.34887676846995497},{x:0.5805752689280143,y:0.424797768469955},{x:0.5800798101377765,y:0.42875301375722},{x:0.5796594372976747,y:0.43271694253692033},{x:0.5588164372976746,y:0.5335539425369203},{x:0.5581925601051908,y:0.535556542700639},{x:0.5577783377379867,y:0.5376127649642906},{x:0.5568838034059929,y:0.5397575559956548},{x:0.5561926080991778,y:0.5419762423834013},{x:0.555190030621201,y:0.5438186507441294},{x:0.5543826183570809,y:0.5457545524985521},{x:0.5020956183570809,y:0.6430055524985521},{x:0.5018901867095668,y:0.6433113858234256},{x:0.5017428412228655,y:0.6436490624319612},{x:0.4994325691935421,y:0.6469701275279692},{x:0.4971767628200625,y:0.6503284258808291},{x:0.4969156133622187,y:0.650588304977856},{x:0.4967052216394318,y:0.6508907475465959},{x:0.49379143318032753,y:0.6536972875938759},{x:0.49092379998669317,y:0.6565509711937552},{x:0.49061696854573045,y:0.6567549090549786},{x:0.49035161582277553,y:0.657010494885618},{x:0.39890061582277553,y:0.7292364948856179},{x:0.3986791836579038,y:0.7293785203585265},{x:0.39848760231040037,y:0.7295587979940886},{x:0.39496847203231433,y:0.7317585520660096},{x:0.39147518928128755,y:0.7339991259907827},{x:0.39123030407812903,y:0.7340952232117042},{x:0.391007233490524,y:0.7342346611962726},{x:0.3871265715837099,y:0.7357055993513507},{x:0.38326329699273004,y:0.7372216156196327},{x:0.3830043695523095,y:0.737268091626259},{x:0.38275838220218455,y:0.7373613314362847},{x:0.25909638220218456,y:0.7708063314362847},{x:0.2580664240588666,y:0.7709788511982676},{x:0.2570738325025125,y:0.7713034106651087},{x:0.2537238261308602,y:0.7717062438265866},{x:0.2503960471743838,y:0.7722636525302581},{x:0.2493522224520667,y:0.7722319225075465},{x:0.24831538485324267,y:0.7723566006488801},{x:0.17218438485324267,y:0.7739936006488801},{x:0.16854768223369815,y:0.7737142062783378},{x:0.16490357022768087,y:0.7735589167265521},{x:0.06552457022768086,y:0.7594769167265522},{x:0.06454980411013514,y:0.759239472501363},{x:0.06355033417502035,y:0.7591522452533723},{x:0.06027159361314519,y:0.7581973390517399},{x:0.056953647958865025,y:0.7573891174476861},{x:0.056043934769293216,y:0.7569660682109414},{x:0.05508068656062633,y:0.7566855300985751},{x:0.05205123903764884,y:0.7551093215998242},{x:0.04895472299174925,y:0.7536693306611393},{x:0.04814502249785432,y:0.7530769339577588},{x:0.0472550131040978,y:0.7526138659033472},{x:0.04459127858939255,y:0.7504769279161366},{x:0.04183518952697092,y:0.7484605056870383},{x:0.041156618064647085,y:0.7477215269901124},{x:0.040374050047680896,y:0.7470937244392954},{x:0.03817839436480973,y:0.744478178292066},{x:0.035868647242901154,y:0.7419628147479951},{x:0.03534728193289863,y:0.7411056525944231},{x:0.03470222894274521,y:0.7403372416471526},{x:0.03305902990826266,y:0.7373436013115269},{x:0.03128438701344127,y:0.73442596046285},{x:0.030940263632238257,y:0.7334835551134912},{x:0.030457514693559486,y:0.7326040653715413},{x:0.029429919524844063,y:0.7293473747667649},{x:0.028258579388326675,y:0.7261395799150647},{x:0.028104922404476318,y:0.7251481474789881},{x:0.02780302928825676,y:0.7241913772399183},{x:0.02743052789135989,y:0.7207967891595589},{x:0.026907504457698045,y:0.7174221140620348},{x:0.02695021882291786,y:0.7164197547317572},{x:0.026840783112310238,y:0.7154224721392919},{x:0.019456783112310236,y:0.0515304721392918}],[{x:0.1099671672449683,y:0.09691838411671685},{x:0.1164055200593884,y:0.675787686211921},{x:0.17390769441284104,y:0.6839357418297609},{x:0.2408956143230629,y:0.6824953400894312},{x:0.35035782392371695,y:0.652890743688808},{x:0.42724604872976657,y:0.5921661050862587},{x:0.4720072878873445,y:0.5089126143655517},{x:0.4907125333997566,y:0.41841792349882906},{x:0.4925121994894803,y:0.35037387509349616},{x:0.4841787199640398,y:0.2934992321564965},{x:0.4684498534661817,y:0.24911194023683725},{x:0.41491413338319044,y:0.1779099626338861},{x:0.34401115658372555,y:0.1329424859013802},{x:0.21878934362335548,y:0.0990224054430332},{x:0.1099671672449683,y:0.09691838411671685}]],E:[[{x:0.035078,y:0.05103000000000002},{x:0.03594266238185463,y:0.04225093550927423},{x:0.03850342103699209,y:0.03380924554357098},{x:0.042661867446385456,y:0.026029339514117924},{x:0.04825819484660536,y:0.019210194846605383},{x:0.05507733951411791,y:0.013613867446385479},{x:0.06285724554357096,y:0.009455421036992116},{x:0.07129893550927423,y:0.006894662381854655},{x:0.080078,y:0.0060300000000000215},{x:0.521974,y:0.0060300000000000215},{x:0.5307530644907258,y:0.006894662381854655},{x:0.5391947544564291,y:0.009455421036992116},{x:0.5469746604858822,y:0.013613867446385479},{x:0.5537938051533947,y:0.019210194846605383},{x:0.5593901325536146,y:0.026029339514117924},{x:0.5635485789630079,y:0.03380924554357098},{x:0.5661093376181454,y:0.04225093550927425},{x:0.5669740000000001,y:0.05103000000000002},{x:0.5661093376181454,y:0.05980906449072579},{x:0.5635485789630079,y:0.06825075445642906},{x:0.5593901325536146,y:0.07603066048588211},{x:0.5537938051533947,y:0.08284980515339466},{x:0.5469746604858822,y:0.08844613255361455},{x:0.5391947544564291,y:0.09260457896300792},{x:0.5307530644907258,y:0.09516533761814538},{x:0.521974,y:0.09603000000000002},{x:0.125078,y:0.09603000000000002},{x:0.125078,y:0.345019},{x:0.389405,y:0.345019},{x:0.3981840644907258,y:0.34588366238185464},{x:0.40662575445642907,y:0.3484444210369921},{x:0.4144056604858821,y:0.35260286744638547},{x:0.42122480515339467,y:0.35819919484660534},{x:0.42682113255361454,y:0.3650183395141179},{x:0.4309795789630079,y:0.372798245543571},{x:0.43354033761814537,y:0.3812399355092742},{x:0.434405,y:0.390019},{x:0.43354033761814537,y:0.3987980644907258},{x:0.4309795789630079,y:0.407239754456429},{x:0.42682113255361454,y:0.4150196604858821},{x:0.42122480515339467,y:0.42183880515339467},{x:0.4144056604858821,y:0.42743513255361454},{x:0.40662575445642907,y:0.43159357896300793},{x:0.3981840644907258,y:0.43415433761814537},{x:0.389405,y:0.435019},{x:0.125078,y:0.435019},{x:0.125078,y:0.684004},{x:0.521974,y:0.684004},{x:0.5307530644907258,y:0.6848686623818546},{x:0.5391947544564291,y:0.6874294210369921},{x:0.5469746604858822,y:0.6915878674463855},{x:0.5537938051533947,y:0.6971841948466053},{x:0.5593901325536146,y:0.7040033395141179},{x:0.5635485789630079,y:0.711783245543571},{x:0.5661093376181454,y:0.7202249355092742},{x:0.5669740000000001,y:0.729004},{x:0.5661093376181454,y:0.7377830644907257},{x:0.5635485789630079,y:0.746224754456429},{x:0.5593901325536146,y:0.7540046604858821},{x:0.5537938051533947,y:0.7608238051533946},{x:0.5469746604858822,y:0.7664201325536145},{x:0.5391947544564291,y:0.7705785789630079},{x:0.5307530644907258,y:0.7731393376181454},{x:0.521974,y:0.774004},{x:0.080078,y:0.774004},{x:0.07129893550927423,y:0.7731393376181454},{x:0.06285724554357093,y:0.7705785789630079},{x:0.05507733951411791,y:0.7664201325536145},{x:0.04825819484660536,y:0.7608238051533946},{x:0.042661867446385456,y:0.7540046604858821},{x:0.03850342103699209,y:0.746224754456429},{x:0.03594266238185463,y:0.7377830644907257},{x:0.035078,y:0.729004},{x:0.035078,y:0.05103000000000002}]],F:[[{x:0.041426000000000004,y:0.05103000000000002},{x:0.04229066238185464,y:0.04225093550927423},{x:0.0448514210369921,y:0.03380924554357098},{x:0.04900986744638546,y:0.026029339514117924},{x:0.054606194846605366,y:0.019210194846605383},{x:0.06142533951411792,y:0.013613867446385479},{x:0.06920524554357096,y:0.009455421036992116},{x:0.07764693550927423,y:0.006894662381854655},{x:0.086426,y:0.0060300000000000215},{x:0.09520506449072577,y:0.006894662381854655},{x:0.10364675445642904,y:0.009455421036992116},{x:0.11142666048588211,y:0.013613867446385486},{x:0.11824580515339464,y:0.019210194846605383},{x:0.12384213255361454,y:0.026029339514117924},{x:0.1280005789630079,y:0.03380924554357098},{x:0.13056133761814537,y:0.04225093550927425},{x:0.131426,y:0.05103000000000002},{x:0.131426,y:0.347323},{x:0.447344,y:0.347323},{x:0.4561230644907258,y:0.3481876623818546},{x:0.4645647544564291,y:0.35074842103699205},{x:0.47234466048588214,y:0.35490686744638544},{x:0.47916380515339463,y:0.3605031948466053},{x:0.48476013255361455,y:0.36732233951411786},{x:0.48891857896300794,y:0.37510224554357097},{x:0.4914793376181454,y:0.3835439355092742},{x:0.492344,y:0.392323},{x:0.4914793376181454,y:0.4011020644907258},{x:0.48891857896300794,y:0.409543754456429},{x:0.48476013255361455,y:0.4173236604858821},{x:0.47916380515339463,y:0.42414280515339464},{x:0.47234466048588214,y:0.4297391325536145},{x:0.4645647544564291,y:0.4338975789630079},{x:0.4561230644907258,y:0.43645833761814534},{x:0.447344,y:0.43732299999999996},{x:0.131426,y:0.43732299999999996},{x:0.131426,y:0.679393},{x:0.515626,y:0.679393},{x:0.5244050644907258,y:0.6802576623818547},{x:0.532846754456429,y:0.6828184210369922},{x:0.5406266604858821,y:0.6869768674463855},{x:0.5474458051533947,y:0.6925731948466054},{x:0.5530421325536146,y:0.6993923395141179},{x:0.5572005789630079,y:0.707172245543571},{x:0.5597613376181454,y:0.7156139355092743},{x:0.5606260000000001,y:0.7243930000000001},{x:0.5597613376181454,y:0.7331720644907258},{x:0.5572005789630079,y:0.7416137544564291},{x:0.5530421325536146,y:0.7493936604858822},{x:0.5474458051533947,y:0.7562128051533947},{x:0.5406266604858821,y:0.7618091325536146},{x:0.532846754456429,y:0.7659675789630079},{x:0.5244050644907258,y:0.7685283376181454},{x:0.515626,y:0.7693930000000001},{x:0.10586481668800227,y:0.7693930000000001},{x:0.10364675445642904,y:0.7705785789630079},{x:0.09520506449072577,y:0.7731393376181454},{x:0.086426,y:0.774004},{x:0.0776469355092742,y:0.7731393376181454},{x:0.06920524554357094,y:0.7705785789630079},{x:0.06142533951411792,y:0.7664201325536145},{x:0.054606194846605366,y:0.7608238051533946},{x:0.04900986744638546,y:0.7540046604858821},{x:0.0448514210369921,y:0.746224754456429},{x:0.04229066238185464,y:0.7377830644907257},{x:0.041426000000000004,y:0.729004},{x:0.041426000000000004,y:0.05103000000000002}]],G:[[{x:0.011397831509003739,y:0.41623356008285023},{x:0.011618856500496228,y:0.4138403978921803},{x:0.011624876992355357,y:0.4114370583257866},{x:0.031979876992355355,y:0.20994505832578658},{x:0.0322125865037964,y:0.20879027461506633},{x:0.03227702681480045,y:0.2076140405475535},{x:0.033082276634523504,y:0.2044745765152392},{x:0.033722542929381774,y:0.20129735748690203},{x:0.034176068118796386,y:0.2002101619949014},{x:0.03446874211029117,y:0.19906910061620064},{x:0.03587099832954512,y:0.19614705695158466},{x:0.03711880677043453,y:0.1931557970536144},{x:0.03777571891913337,y:0.19217797009338475},{x:0.03828537929375919,y:0.19111593175236494},{x:0.08239837929375919,y:0.11845093175236496},{x:0.08400149586436068,y:0.11631468084865614},{x:0.08543403702225794,y:0.1140604899753128},{x:0.08664282877724949,y:0.11279494315419919},{x:0.08769326713863865,y:0.11139516977529508},{x:0.08968234215056696,y:0.10961271886167734},{x:0.09152712825517066,y:0.10768131654967852},{x:0.15960912825517065,y:0.049144316549678456},{x:0.16129904644183068,y:0.0479582081853546},{x:0.16285577619764602,y:0.04660201166682107},{x:0.1649006360722032,y:0.045430348778213794},{x:0.16682965744636918,y:0.04407642028337947},{x:0.16871850259167306,y:0.043242789341903884},{x:0.17050990103726027,y:0.04221635466854622},{x:0.25257090103726026,y:0.005359354668546305},{x:0.2555014876285109,y:0.004375276469579791},{x:0.2583690572759664,y:0.003220377345201267},{x:0.25967433471463813,y:0.0029740526131209386},{x:0.2609335532503684,y:0.0025512125194529015},{x:0.2639998135747395,y:0.0021577721889240492},{x:0.26703759331756605,y:0.0015844992133087973},{x:0.35309859331756605,y:-0.006038500786691249},{x:0.3541123404679588,y:-0.006028536718703998},{x:0.3551159915981175,y:-0.006171599559831674},{x:0.3585153812714738,y:-0.005985259459774228},{x:0.361919709861342,y:-0.005951798491220829},{x:0.36291203425126567,y:-0.00574425362199294},{x:0.3639243106821295,y:-0.005688764928569123},{x:0.3672220288859873,y:-0.004842817275250554},{x:0.37055441634545594,y:-0.004145847688979236},{x:0.3714871835051078,y:-0.003748697851442632},{x:0.37246918402112983,y:-0.003496790022837183},{x:0.4525501840211298,y:0.02567020997716287},{x:0.4548144879103283,y:0.026756908839544704},{x:0.45716266717941917,y:0.02764799841997529},{x:0.45878159595452606,y:0.02866082810547922},{x:0.4605032369247208,y:0.02948708879101062},{x:0.4625120284186098,y:0.03099465081435172},{x:0.46464124512829075,y:0.032326725408117304},{x:0.4660314733714444,y:0.03363593119127184},{x:0.46755883802994086,y:0.034782191000688294},{x:0.46923492039795345,y:0.03665268142188218},{x:0.47106334994415,y:0.038374550149380404},{x:0.53517534994415,y:0.11188255014938031},{x:0.5366918789074028,y:0.11401106513419482},{x:0.5383741006891446,y:0.11601120663268963},{x:0.5392453250303639,y:0.11759493887966013},{x:0.5402941837404813,y:0.11906705813061697},{x:0.5413663203511413,y:0.12145053442062861},{x:0.5426260104640281,y:0.12374042895017842},{x:0.5431715236397763,y:0.1254636976633839},{x:0.5439130326051668,y:0.12711215273922669},{x:0.5444995752545472,y:0.12965899467727895},{x:0.5452883245139833,y:0.13215064287530112},{x:0.5896823245139834,y:0.3420786428753011},{x:0.5897067631627176,y:0.34229945557802055},{x:0.5897717252277992,y:0.3425119065778641},{x:0.5901917436343531,y:0.346681442891342},{x:0.5906527316031134,y:0.3508466486034176},{x:0.590633622248786,y:0.3510679861958218},{x:0.5906558889520306,y:0.35128902847947113},{x:0.590254400640623,y:0.3554603898480228},{x:0.5898939395311937,y:0.3596354965915505},{x:0.5898320165355749,y:0.3598488531940917},{x:0.589810732180064,y:0.3600699922305474},{x:0.5886031661213459,y:0.3640828755761044},{x:0.5874351082520124,y:0.3681074363403587},{x:0.5873327512810971,y:0.3683046127784522},{x:0.5872687338126765,y:0.3685173503185603},{x:0.5853014960930706,y:0.3722175427846122},{x:0.5833707292727002,y:0.37593689595641405},{x:0.5832318718474782,y:0.3761103148501221},{x:0.583127581421558,y:0.3763064755095204},{x:0.5804762718833937,y:0.37955178077467916},{x:0.577856994398102,y:0.38282299369748307},{x:0.5776869727315521,y:0.38296599065597503},{x:0.5775464171707139,y:0.38313803609053093},{x:0.5743129241526703,y:0.3858037388934479},{x:0.5711057933673104,y:0.38850110068914456},{x:0.5709111412967293,y:0.38860818041949885},{x:0.5707397220723512,y:0.3887494990196469},{x:0.5670483068977423,y:0.3907331578965531},{x:0.5633765710498215,y:0.39275301046402805},{x:0.5631647689451196,y:0.3928200579522583},{x:0.5629690736018615,y:0.39292521892344706},{x:0.5589615952856832,y:0.39415060297614785},{x:0.5549663571246989,y:0.39541532451398326},{x:0.5547455444219794,y:0.39543976316271745},{x:0.5545330934221359,y:0.39550472522779906},{x:0.5503635571086607,y:0.3959247436343527},{x:0.5461983513965825,y:0.39638573160311336},{x:0.5459770138041778,y:0.396366622248786},{x:0.5457559715205288,y:0.3963888889520305},{x:0.32969497152052885,y:0.39686888895203054},{x:0.32091400776945256,y:0.3960237321800639},{x:0.31246664968143967,y:0.39348173381267654},{x:0.3046775244904796,y:0.389340581421558},{x:0.29784596390946905,y:0.3837594171707138},{x:0.2922345009803531,y:0.3769527220723512},{x:0.2880587810765529,y:0.3691820736018615},{x:0.2854792747722009,y:0.3607460934221358},{x:0.2845951110479695,y:0.3519689715205288},{x:0.2854402678199361,y:0.3431880077694525},{x:0.2879822661873235,y:0.33474064968143963},{x:0.29212341857844204,y:0.32695152449047954},{x:0.29770458282928614,y:0.320119963909469},{x:0.3045112779276488,y:0.31450850098035305},{x:0.31228192639813845,y:0.3103327810765529},{x:0.3207179065778642,y:0.3077532747722009},{x:0.3294950284794712,y:0.30686911104796943},{x:0.49017057214072013,y:0.30651215509128404},{x:0.45965681956734333,y:0.16222033524572274},{x:0.4108567628008364,y:0.10626833604444391},{x:0.35107150330533127,y:0.0844934248457151},{x:0.2825297162303303,y:0.09056463065174497},{x:0.21333680545064249,y:0.12164203785622632},{x:0.15562253329738823,y:0.17126485077351794},{x:0.1205010051965362,y:0.2291186770707186},{x:0.10185989085514695,y:0.41364510354456796},{x:0.13655871914038514,y:0.5827099362211221},{x:0.190187982415082,y:0.6526649281775241},{x:0.2569251189377254,y:0.6872526727450867},{x:0.3715857772516941,y:0.6967797369989467},{x:0.4883723057362636,y:0.6711064406866752},{x:0.49713228125159653,y:0.6700660353148682},{x:0.5059269093127409,y:0.6707546074846872},{x:0.5144182172953911,y:0.6731456957538017},{x:0.5222798889957544,y:0.6771474119409674},{x:0.529209804779262,y:0.6826059723372997},{x:0.5349416518686954,y:0.6893116075279637},{x:0.5392551585948644,y:0.6970066237131456},{x:0.5419845593133248,y:0.7053953057362636},{x:0.5430249646851317,y:0.7141552812515966},{x:0.5423363925153128,y:0.722949909312741},{x:0.5399453042461984,y:0.7314412172953911},{x:0.5359435880590326,y:0.7393028889957545},{x:0.5304850276627003,y:0.7462328047792621},{x:0.5237793924720363,y:0.7519646518686954},{x:0.5160843762868544,y:0.7562781585948645},{x:0.5076956942637364,y:0.7590075593133249},{x:0.38428269426373635,y:0.7861375593133247},{x:0.3819812519937546,y:0.7864108971664274},{x:0.3797153389243004,y:0.7868977113667894},{x:0.37761181025895013,y:0.7869298473215656},{x:0.37552271874840343,y:0.7871779646851318},{x:0.3732121724765259,y:0.7869970613144796},{x:0.370894825552222,y:0.7870324638061055},{x:0.24049282555222196,y:0.7761974638061055},{x:0.24043595887820252,y:0.7761870527203061},{x:0.24037815170992255,y:0.776187787986971},{x:0.2360978388350013,y:0.7753928346522221},{x:0.2318155069745089,y:0.7746088302209789},{x:0.231761764079766,y:0.7745875250435272},{x:0.2317049242166051,y:0.7745769685631748},{x:0.227661944055434,y:0.7729622424167508},{x:0.22361484767780643,y:0.7713578609091699},{x:0.22356629387164592,y:0.7713264803860874},{x:0.22351260563766895,y:0.7713050378383375},{x:0.13987060563766895,y:0.7279560378383374},{x:0.13900257424615298,y:0.727391873258006},{x:0.13805978359276902,y:0.7269641982011581},{x:0.13531067905832161,y:0.7249923788161832},{x:0.13247402218179744,y:0.7231487342752945},{x:0.13173273281971745,y:0.7224260654354895},{x:0.1308914928889356,y:0.7218226787027751},{x:0.128579894506033,y:0.7193524235854973},{x:0.12615742040314795,y:0.7169907998540069},{x:0.12557136040496888,y:0.7161373985129647},{x:0.12486399957555622,y:0.7153814879181388},{x:0.05884299957555622,y:0.6292624879181389},{x:0.05814177883495547,y:0.6281337214080167},{x:0.057292540659828396,y:0.62711165542026},{x:0.05581896837632758,y:0.6243946553718145},{x:0.05418793684040681,y:0.6217691571968414},{x:0.05372040128165289,y:0.6205252782386133},{x:0.05308687616260495,y:0.6193571728131668},{x:0.052171678571706244,y:0.6164048994674943},{x:0.051084196133809955,y:0.613511651036194},{x:0.05086831288622884,y:0.6122004612006492},{x:0.05047484683830003,y:0.6109312059739318},{x:0.012315846838300032,y:0.4250072059739319},{x:0.012065742114142504,y:0.42261690788694145},{x:0.011602778634016861,y:0.4202585732767163},{x:0.011607833784388823,y:0.41824059149262255},{x:0.011397831509003739,y:0.41623356008285023}]],H:[[{x:0.021894999999999998,y:0.05103000000000002},{x:0.02275966238185463,y:0.04225093550927423},{x:0.025320421036992093,y:0.03380924554357098},{x:0.029478867446385455,y:0.026029339514117924},{x:0.03507519484660536,y:0.019210194846605383},{x:0.04189433951411791,y:0.013613867446385479},{x:0.04967424554357096,y:0.009455421036992116},{x:0.05811593550927423,y:0.006894662381854655},{x:0.066895,y:0.0060300000000000215},{x:0.07567406449072576,y:0.006894662381854655},{x:0.08411575445642903,y:0.009455421036992116},{x:0.0918956604858821,y:0.013613867446385486},{x:0.09871480515339463,y:0.019210194846605383},{x:0.10431113255361453,y:0.026029339514117924},{x:0.1084695789630079,y:0.03380924554357098},{x:0.11103033761814536,y:0.04225093550927425},{x:0.111895,y:0.05103000000000002},{x:0.111895,y:0.359342},{x:0.490157,y:0.359342},{x:0.490157,y:0.05103000000000002},{x:0.49102166238185463,y:0.04225093550927423},{x:0.49358242103699207,y:0.03380924554357098},{x:0.49774086744638546,y:0.026029339514117924},{x:0.5033371948466053,y:0.019210194846605383},{x:0.5101563395141179,y:0.013613867446385479},{x:0.517936245543571,y:0.009455421036992116},{x:0.5263779355092743,y:0.006894662381854655},{x:0.535157,y:0.0060300000000000215},{x:0.5439360644907257,y:0.006894662381854655},{x:0.552377754456429,y:0.009455421036992116},{x:0.5601576604858821,y:0.013613867446385486},{x:0.5669768051533947,y:0.019210194846605383},{x:0.5725731325536145,y:0.026029339514117924},{x:0.5767315789630079,y:0.03380924554357098},{x:0.5792923376181454,y:0.04225093550927425},{x:0.580157,y:0.05103000000000002},{x:0.580157,y:0.729004},{x:0.5792923376181454,y:0.7377830644907257},{x:0.5767315789630079,y:0.746224754456429},{x:0.5725731325536145,y:0.7540046604858821},{x:0.5669768051533947,y:0.7608238051533946},{x:0.5601576604858821,y:0.7664201325536145},{x:0.552377754456429,y:0.7705785789630079},{x:0.5439360644907257,y:0.7731393376181454},{x:0.535157,y:0.774004},{x:0.5263779355092743,y:0.7731393376181454},{x:0.517936245543571,y:0.7705785789630079},{x:0.5101563395141179,y:0.7664201325536145},{x:0.5033371948466053,y:0.7608238051533946},{x:0.49774086744638546,y:0.7540046604858821},{x:0.49358242103699207,y:0.746224754456429},{x:0.49102166238185463,y:0.7377830644907257},{x:0.490157,y:0.729004},{x:0.490157,y:0.44934199999999996},{x:0.111895,y:0.44934199999999996},{x:0.111895,y:0.729004},{x:0.11103033761814536,y:0.7377830644907257},{x:0.10846957896300788,y:0.746224754456429},{x:0.10431113255361453,y:0.7540046604858821},{x:0.09871480515339463,y:0.7608238051533946},{x:0.09189566048588207,y:0.7664201325536145},{x:0.08411575445642903,y:0.7705785789630079},{x:0.07567406449072576,y:0.7731393376181454},{x:0.066895,y:0.774004},{x:0.05811593550927421,y:0.7731393376181454},{x:0.04967424554357093,y:0.7705785789630079},{x:0.04189433951411791,y:0.7664201325536145},{x:0.03507519484660536,y:0.7608238051533946},{x:0.029478867446385455,y:0.7540046604858821},{x:0.025320421036992093,y:0.746224754456429},{x:0.02275966238185463,y:0.7377830644907257},{x:0.021894999999999998,y:0.729004},{x:0.021894999999999998,y:0.05103000000000002}]],I:[[{x:0.25602600000000003,y:0.05103000000000002},{x:0.25689066238185465,y:0.04225093550927423},{x:0.2594514210369921,y:0.03380924554357098},{x:0.2636098674463855,y:0.026029339514117924},{x:0.26920619484660535,y:0.019210194846605383},{x:0.27602533951411795,y:0.013613867446385479},{x:0.283805245543571,y:0.009455421036992116},{x:0.2922469355092743,y:0.006894662381854655},{x:0.301026,y:0.0060300000000000215},{x:0.3098050644907258,y:0.006894662381854655},{x:0.3182467544564291,y:0.009455421036992116},{x:0.32602666048588214,y:0.013613867446385486},{x:0.3328458051533947,y:0.019210194846605383},{x:0.33844213255361455,y:0.026029339514117924},{x:0.34260057896300794,y:0.03380924554357098},{x:0.3451613376181454,y:0.04225093550927425},{x:0.346026,y:0.05103000000000002},{x:0.346026,y:0.729004},{x:0.3451613376181454,y:0.7377830644907257},{x:0.34260057896300794,y:0.746224754456429},{x:0.33844213255361455,y:0.7540046604858821},{x:0.3328458051533947,y:0.7608238051533946},{x:0.32602666048588214,y:0.7664201325536145},{x:0.3182467544564291,y:0.7705785789630079},{x:0.3098050644907258,y:0.7731393376181454},{x:0.301026,y:0.774004},{x:0.2922469355092743,y:0.7731393376181454},{x:0.283805245543571,y:0.7705785789630079},{x:0.27602533951411795,y:0.7664201325536145},{x:0.26920619484660535,y:0.7608238051533946},{x:0.2636098674463855,y:0.7540046604858821},{x:0.2594514210369921,y:0.746224754456429},{x:0.25689066238185465,y:0.7377830644907257},{x:0.25602600000000003,y:0.729004},{x:0.25602600000000003,y:0.05103000000000002}]],J:[[{x:0.0492700034030052,y:0.22191686675397743},{x:0.05066400340300519,y:0.18438286675397747},{x:0.05116783173382979,y:0.18068175768771486},{x:0.05155979864248331,y:0.17696713613904605},{x:0.05874879864248331,y:0.14209513613904604},{x:0.05880353678004782,y:0.1419191061579158},{x:0.05882437610196882,y:0.14173594355086241},{x:0.060112741823836933,y:0.13770889095133898},{x:0.06136821695472819,y:0.13367146342030908},{x:0.0614562450600313,y:0.133509494686791},{x:0.06151241721221637,y:0.13333391704789688},{x:0.07511841721221638,y:0.10184091704789687},{x:0.07557207470549994,y:0.10102219111224012},{x:0.07589401217340325,y:0.10014328637013822},{x:0.07770640675364808,y:0.09717031380613761},{x:0.07939396242231754,y:0.09412474393402119},{x:0.07999862852050488,y:0.09341025377409445},{x:0.08048584585939292,y:0.09261104382444658},{x:0.10112984585939291,y:0.06520804382444652},{x:0.10197173470408774,y:0.06429305686105671},{x:0.10267645797068833,y:0.06326868237508665},{x:0.10495244591663212,y:0.06105354143298789},{x:0.10710291637241387,y:0.058716353519649434},{x:0.10810713366035453,y:0.05798319214000915},{x:0.10899816141532707,y:0.05711598541156246},{x:0.1373061614153271,y:0.03451898541156248},{x:0.13912164740426522,y:0.03334117545586675},{x:0.1408101373903697,y:0.03198757757075004},{x:0.14281300361792376,y:0.03094638082514127},{x:0.14470672673278473,y:0.029717813955661344},{x:0.1467171079910441,y:0.028916819034200267},{x:0.14863722796281134,y:0.027918638208003034},{x:0.20683022796281134,y:0.004592638208003076},{x:0.20850921914024034,y:0.004104279923540699},{x:0.2101185278310492,y:0.0034204446176558795},{x:0.21273469892125257,y:0.0028752394826936905},{x:0.21530073387518742,y:0.0021288719943945503},{x:0.21704273768291169,y:0.0019774523068977427},{x:0.21875453360851305,y:0.0016207172553791283},{x:0.2976895336085131,y:-0.0068802827446208525},{x:0.29850402526559744,y:-0.006887701289741747},{x:0.2993068957135494,y:-0.007024999279811796},{x:0.30290822222422875,y:-0.006927815554356645},{x:0.3065107103471747,y:-0.0069606277022222565},{x:0.30731099906181086,y:-0.006809004262418785},{x:0.30812522808832776,y:-0.0067870318558802545},{x:0.3663632280883278,y:0.0005399681441197179},{x:0.367446910459264,y:0.0007860908462292888},{x:0.3685549625674647,y:0.000870733572342984},{x:0.37174033606180384,y:0.0017612008405818037},{x:0.37496569353784953,y:0.0024937343933679954},{x:0.37598053709868623,y:0.002946543859479297},{x:0.3770507853196353,y:0.0032457304419443098},{x:0.4423997853196353,y:0.028649730441944292},{x:0.44339023767510893,y:0.0291515261148112},{x:0.4444435524779453,y:0.029502699422305954},{x:0.4473177196266577,y:0.03114131738307233},{x:0.45026902431580135,y:0.03263654520916596},{x:0.4511425499275847,y:0.03332192668785485},{x:0.4521071150681948,y:0.03387184382278591},{x:0.4818761150681948,y:0.0549598438227859},{x:0.482276572000261,y:0.05530719927286456},{x:0.48273081061614365,y:0.05558049186877649},{x:0.48560514894853896,y:0.05819439949693127},{x:0.48854004666413575,y:0.060740123232255375},{x:0.48886504324193186,y:0.061158929616590856},{x:0.48925723704963914,y:0.06151558852974905},{x:0.5141262370496392,y:0.08904658852974903},{x:0.5149956342421861,y:0.09022293690705172},{x:0.5160117353213701,y:0.09127516577002369},{x:0.5176116053111659,y:0.0937625081737249},{x:0.5193693801104602,y:0.0961408866071265},{x:0.519992577896003,y:0.09746424275846524},{x:0.5207838752101566,y:0.09869448482562238},{x:0.5385188752101566,y:0.1333154848256224},{x:0.5396070973995049,y:0.13607819549886616},{x:0.5408707323766272,y:0.1387652058155645},{x:0.5412201620380835,y:0.14017334347255597},{x:0.5417518824254063,y:0.14152324205357814},{x:0.5422802166156467,y:0.1444451696332536},{x:0.5429953614930656,y:0.1473270727547606},{x:0.5523413614930656,y:0.2113020727547606},{x:0.5524962602601196,y:0.21460328519222147},{x:0.5528139181508881,y:0.2178928278123641},{x:0.5518389181508881,y:0.7290898278123641},{x:0.5509575131661891,y:0.7378672271777721},{x:0.5483806584624608,y:0.7463040176932935},{x:0.5442073811208505,y:0.7540759782308231},{x:0.5385980578491955,y:0.7608844367054697},{x:0.5317682517950807,y:0.7664677478762799},{x:0.5239804285749665,y:0.7706113482261165},{x:0.5155338698677402,y:0.7731560015172932},{x:0.5067531721876358,y:0.7740039181508881},{x:0.4979757728222279,y:0.7731225131661891},{x:0.4895389823067066,y:0.7705456584624607},{x:0.48176702176917696,y:0.7663723811208505},{x:0.4749585632945304,y:0.7607630578491954},{x:0.46937525212372017,y:0.7539332517950806},{x:0.4652316517738835,y:0.7461454285749665},{x:0.46268699848270683,y:0.7376988698677401},{x:0.461839081849112,y:0.7289181721876359},{x:0.462807763438783,y:0.22103394388498027},{x:0.45501827222953295,y:0.16771351802238937},{x:0.44337725180090903,y:0.14498874958374325},{x:0.42579959063650114,y:0.12552955984883984},{x:0.4046143325842134,y:0.11052217895574154},{x:0.34961801160788414,y:0.08914271579513207},{x:0.3021031758959219,y:0.08316481131246532},{x:0.2345584384824393,y:0.09043912324952764},{x:0.18827433696976265,y:0.10899157718530504},{x:0.16959144206995366,y:0.1239052897771866},{x:0.155605251275173,y:0.14247066404328695},{x:0.14596289111822178,y:0.16478926233983734},{x:0.14046290234137151,y:0.19146830095804884},{x:0.13920799659699482,y:0.22525713324602253},{x:0.1380181031040591,y:0.23399805813086086},{x:0.13514580323043823,y:0.24233889189031887},{x:0.13070147784947123,y:0.24995910096061402},{x:0.12485591989314217,y:0.25656584498063745},{x:0.11783377087548613,y:0.26190523048280423},{x:0.10990488804518514,y:0.26577206787662816},{x:0.10137397392283892,y:0.2680177567696118},{x:0.09256886675397746,y:0.2685559965969948},{x:0.08382794186913914,y:0.26736610310405906},{x:0.07548710810968112,y:0.26449380323043825},{x:0.06786689903938595,y:0.2600494778494712},{x:0.06126015501936256,y:0.2542039198931421},{x:0.055920769517195726,y:0.24718177087548612},{x:0.052053932123371845,y:0.23925288804518513},{x:0.04980824323038816,y:0.2307219739228389},{x:0.0492700034030052,y:0.22191686675397743}]],K:[[{x:-0.009598999999999996,y:0.05103000000000002},{x:-0.008734337618145363,y:0.04225093550927423},{x:-0.006173578963007902,y:0.03380924554357098},{x:-0.002015132553614539,y:0.026029339514117924},{x:0.003581194846605365,y:0.019210194846605383},{x:0.010400339514117916,y:0.013613867446385479},{x:0.018180245543570964,y:0.009455421036992116},{x:0.026621935509274233,y:0.006894662381854655},{x:0.035401,y:0.0060300000000000215},{x:0.04418006449072578,y:0.006894662381854655},{x:0.05262175445642904,y:0.009455421036992116},{x:0.06040166048588211,y:0.013613867446385486},{x:0.06722080515339464,y:0.019210194846605383},{x:0.07281713255361454,y:0.026029339514117924},{x:0.07697557896300791,y:0.03380924554357098},{x:0.07953633761814537,y:0.04225093550927425},{x:0.080401,y:0.05103000000000002},{x:0.080401,y:0.29048154892126793},{x:0.18934433769134518,y:0.3772029724897202},{x:0.5349508182082354,y:0.03415901207017739},{x:0.5417907398770268,y:0.02858809778868676},{x:0.5495860658299886,y:0.024458629583942203},{x:0.5580372260624178,y:0.02192930060321959},{x:0.5668194472260474,y:0.021097311540784057},{x:0.5755952334866855,y:0.021994635269720175},{x:0.5840273362998535,y:0.024586788142349852},{x:0.5917917146832189,y:0.028774155177474024},{x:0.5985899879298227,y:0.03439581820823536},{x:0.6041609022113132,y:0.04123573987702663},{x:0.6082903704160578,y:0.04903106582998847},{x:0.6108196993967804,y:0.05748222606241771},{x:0.6116516884592159,y:0.06626444722604735},{x:0.6107543647302798,y:0.07504023348668547},{x:0.6081622118576502,y:0.08347233629985339},{x:0.603974844822526,y:0.0912367146832188},{x:0.5983531817917647,y:0.09803498792982254},{x:0.26024203797571366,y:0.43363918627462555},{x:0.5302838206406747,y:0.648598708462355},{x:0.5366139141989896,y:0.654742773070568},{x:0.5416237292416561,y:0.6620037211908337},{x:0.545120741386121,y:0.6701025186588768},{x:0.5469705624168195,y:0.6787279332298585},{x:0.5471021047489336,y:0.6875484950590041},{x:0.5455103132844098,y:0.6962252349018474},{x:0.542256359676543,y:0.7044247105121999},{x:0.537465291537645,y:0.7118318206406747},{x:0.531321226929432,y:0.7181619141989897},{x:0.5240602788091663,y:0.7231717292416562},{x:0.5159614813411232,y:0.726668741386121},{x:0.5073360667701415,y:0.7285185624168196},{x:0.498515504940996,y:0.7286501047489337},{x:0.48983876509815266,y:0.7270583132844098},{x:0.48163928948780005,y:0.723804359676543},{x:0.47423217935932527,y:0.719013291537645},{x:0.080401,y:0.4055145384845117},{x:0.080401,y:0.729004},{x:0.07953633761814537,y:0.7377830644907257},{x:0.07697557896300788,y:0.746224754456429},{x:0.07281713255361454,y:0.7540046604858821},{x:0.06722080515339464,y:0.7608238051533946},{x:0.06040166048588208,y:0.7664201325536145},{x:0.052621754456429054,y:0.7705785789630079},{x:0.04418006449072578,y:0.7731393376181454},{x:0.035401,y:0.774004},{x:0.026621935509274212,y:0.7731393376181454},{x:0.018180245543570936,y:0.7705785789630079},{x:0.010400339514117906,y:0.7664201325536145},{x:0.003581194846605358,y:0.7608238051533946},{x:-0.002015132553614539,y:0.7540046604858821},{x:-0.006173578963007902,y:0.746224754456429},{x:-0.008734337618145363,y:0.7377830644907257},{x:-0.009598999999999996,y:0.729004},{x:-0.009598999999999996,y:0.05103000000000002}]],L:[[{x:0.030439999999999995,y:0.05103000000000002},{x:0.03130466238185463,y:0.04225093550927423},{x:0.03386542103699209,y:0.03380924554357098},{x:0.03802386744638545,y:0.026029339514117924},{x:0.043620194846605356,y:0.019210194846605383},{x:0.05043933951411791,y:0.013613867446385479},{x:0.058219245543570955,y:0.009455421036992116},{x:0.06666093550927422,y:0.006894662381854655},{x:0.07544,y:0.0060300000000000215},{x:0.526613,y:0.0060300000000000215},{x:0.5353920644907257,y:0.006894662381854655},{x:0.543833754456429,y:0.009455421036992116},{x:0.5516136604858821,y:0.013613867446385479},{x:0.5584328051533947,y:0.019210194846605383},{x:0.5640291325536145,y:0.026029339514117924},{x:0.5681875789630079,y:0.03380924554357098},{x:0.5707483376181454,y:0.04225093550927425},{x:0.571613,y:0.05103000000000002},{x:0.5707483376181454,y:0.05980906449072579},{x:0.5681875789630079,y:0.06825075445642906},{x:0.5640291325536145,y:0.07603066048588211},{x:0.5584328051533947,y:0.08284980515339466},{x:0.5516136604858821,y:0.08844613255361455},{x:0.543833754456429,y:0.09260457896300792},{x:0.5353920644907257,y:0.09516533761814538},{x:0.526613,y:0.09603000000000002},{x:0.12043999999999999,y:0.09603000000000002},{x:0.12043999999999999,y:0.729004},{x:0.11957533761814536,y:0.7377830644907257},{x:0.11701457896300788,y:0.746224754456429},{x:0.11285613255361453,y:0.7540046604858821},{x:0.10725980515339463,y:0.7608238051533946},{x:0.10044066048588207,y:0.7664201325536145},{x:0.09266075445642903,y:0.7705785789630079},{x:0.08421906449072576,y:0.7731393376181454},{x:0.07544,y:0.774004},{x:0.06666093550927422,y:0.7731393376181454},{x:0.05821924554357093,y:0.7705785789630079},{x:0.05043933951411791,y:0.7664201325536145},{x:0.043620194846605356,y:0.7608238051533946},{x:0.03802386744638545,y:0.7540046604858821},{x:0.03386542103699209,y:0.746224754456429},{x:0.03130466238185463,y:0.7377830644907257},{x:0.030439999999999995,y:0.729004},{x:0.030439999999999995,y:0.05103000000000002}]],M:[[{x:-0.0025190000000000004,y:0.05103000000000002},{x:-0.001654337618145367,y:0.04225093550927423},{x:0.0009064210369920944,y:0.03380924554357098},{x:0.005064867446385457,y:0.026029339514117924},{x:0.010661194846605361,y:0.019210194846605383},{x:0.017480339514117912,y:0.013613867446385479},{x:0.02526024554357096,y:0.009455421036992116},{x:0.03370193550927423,y:0.006894662381854655},{x:0.042481,y:0.0060300000000000215},{x:0.051260064490725774,y:0.006894662381854655},{x:0.05970175445642904,y:0.009455421036992116},{x:0.06748166048588208,y:0.013613867446385486},{x:0.07430080515339463,y:0.019210194846605383},{x:0.07989713255361454,y:0.026029339514117924},{x:0.0840555789630079,y:0.03380924554357098},{x:0.08661633761814536,y:0.04225093550927425},{x:0.087481,y:0.05103000000000002},{x:0.087481,y:0.5631122522964573},{x:0.26219554141599577,y:0.26476777519375044},{x:0.26376288989624813,y:0.2626088267569117},{x:0.2651577075441738,y:0.2603345964826191},{x:0.26634817172230724,y:0.2590477232579252},{x:0.26737807478439135,y:0.2576290804774607},{x:0.2693364970488442,y:0.25581739014918375},{x:0.271148193983327,y:0.2538589739959976},{x:0.27256684023788735,y:0.25282907571933333},{x:0.27385371747828813,y:0.25163861588213104},{x:0.27612795245761435,y:0.25024380590572387},{x:0.27828690618147356,y:0.24867646470811877},{x:0.2798792167324836,y:0.24794311979268302},{x:0.28137361418054185,y:0.2470265916026687},{x:0.2838762642998919,y:0.24610226374330602},{x:0.28629950743227456,y:0.24498622954453103},{x:0.28800429067823724,y:0.24457762002415934},{x:0.28964877947809164,y:0.24397024514568044},{x:0.29228366929688115,y:0.24355192080462856},{x:0.2948780779631802,y:0.2429300821730634},{x:0.29662982004000654,y:0.24286191068247276},{x:0.29836120340931876,y:0.24258703019148947},{x:0.3010270755894747,y:0.24269078533857608},{x:0.3036929481196057,y:0.24258703918410057},{x:0.30542433056167173,y:0.24286192551544342},{x:0.30717607240852984,y:0.24293010291506947},{x:0.3097704789772072,y:0.24355195029817853},{x:0.3124053673848756,y:0.24397028352732772},{x:0.31404985413590314,y:0.24457766395304856},{x:0.3157546360035206,y:0.24498627922405064},{x:0.3181778753712451,y:0.24610232159698525},{x:0.32068052237260675,y:0.24702665789836697},{x:0.32217491672899246,y:0.24794319112932822},{x:0.32376722480624953,y:0.2486765414159958},{x:0.3259261732430879,y:0.2502438898962479},{x:0.3282004035173809,y:0.2516387075441738},{x:0.329487276742075,y:0.2528291717223074},{x:0.3309059195225393,y:0.2538590747843914},{x:0.3327176098508159,y:0.2558174970488439},{x:0.33467602600400237,y:0.257629193983327},{x:0.3357059242806667,y:0.2590478402378874},{x:0.33689638411786893,y:0.2603347174782881},{x:0.3382911940942761,y:0.2626089524576143},{x:0.3398585352918812,y:0.26476790618147356},{x:0.514571,y:0.5631111449291359},{x:0.514571,y:0.05103000000000002},{x:0.5154356623818547,y:0.04225093550927423},{x:0.5179964210369922,y:0.03380924554357098},{x:0.5221548674463855,y:0.026029339514117924},{x:0.5277511948466054,y:0.019210194846605383},{x:0.5345703395141179,y:0.013613867446385479},{x:0.542350245543571,y:0.009455421036992116},{x:0.5507919355092743,y:0.006894662381854655},{x:0.559571,y:0.0060300000000000215},{x:0.5683500644907258,y:0.006894662381854655},{x:0.576791754456429,y:0.009455421036992116},{x:0.5845716604858822,y:0.013613867446385486},{x:0.5913908051533947,y:0.019210194846605383},{x:0.5969871325536146,y:0.026029339514117924},{x:0.6011455789630079,y:0.03380924554357098},{x:0.6037063376181454,y:0.04225093550927425},{x:0.6045710000000001,y:0.05103000000000002},{x:0.6045710000000001,y:0.729004},{x:0.6044399806971988,y:0.7303342613054065},{x:0.6044919608158994,y:0.7316699481196056},{x:0.6040085293496043,y:0.7347148603514975},{x:0.6037063376181454,y:0.7377830644907257},{x:0.6033183147080721,y:0.7390622046001841},{x:0.6031087164726723,y:0.7403823673848756},{x:0.6020405410986152,y:0.7432744596816038},{x:0.6011455789630079,y:0.746224754456429},{x:0.6005154639484909,y:0.7474036167328832},{x:0.600052342101633,y:0.7486575223726067},{x:0.5984404722003996,y:0.7512856532491108},{x:0.5969871325536146,y:0.7540046604858821},{x:0.596139140401289,y:0.7550379419131618},{x:0.5954402924558263,y:0.7561774035173808},{x:0.5933466712837743,y:0.758440575377949},{x:0.5913908051533947,y:0.7608238051533946},{x:0.5903575237261146,y:0.7616717973057207},{x:0.589449806016673,y:0.7626530260040023},{x:0.5869548902613284,y:0.7644642664232344},{x:0.5845716604858822,y:0.7664201325536145},{x:0.5833927982094276,y:0.7670502475681318},{x:0.5823110938185264,y:0.7678355352918812},{x:0.579510761693201,y:0.7691252393162225},{x:0.576791754456429,y:0.7705785789630079},{x:0.5755126143469705,y:0.7709666018730812},{x:0.5742984925677255,y:0.7715257704554689},{x:0.5713003592655512,y:0.772244375482538},{x:0.5683500644907258,y:0.7731393376181454},{x:0.5670198031853202,y:0.7732703569209465},{x:0.5657199220368199,y:0.7735819178269366},{x:0.5626392041392276,y:0.7737018082685412},{x:0.559571,y:0.774004},{x:0.5582407386945936,y:0.7738729806971988},{x:0.5569050518803944,y:0.7739249608158993},{x:0.5538601396485026,y:0.7734415293496042},{x:0.5507919355092743,y:0.7731393376181454},{x:0.5495127953998159,y:0.772751314708072},{x:0.5481926326151244,y:0.7725417164726722},{x:0.5453005403183963,y:0.7714735410986151},{x:0.542350245543571,y:0.7705785789630079},{x:0.5411713832671168,y:0.7699484639484908},{x:0.5399174776273933,y:0.769485342101633},{x:0.5372893467508892,y:0.7678734722003996},{x:0.5345703395141179,y:0.7664201325536145},{x:0.5335370580868383,y:0.765572140401289},{x:0.5323975964826192,y:0.7648732924558262},{x:0.5301344246220511,y:0.7627796712837742},{x:0.5277511948466054,y:0.7608238051533946},{x:0.5269032026942794,y:0.7597905237261146},{x:0.5259219739959977,y:0.7588828060166729},{x:0.5241107335767656,y:0.7563878902613284},{x:0.5221548674463855,y:0.7540046604858821},{x:0.5215247524318682,y:0.7528257982094275},{x:0.5207394647081188,y:0.7517440938185264},{x:0.30102684980758887,y:0.3765575080608823},{x:0.08131245858400418,y:0.7517442248062496},{x:0.0805272117946797,y:0.752825865136849},{x:0.07989713255361454,y:0.7540046604858821},{x:0.07794121846393844,y:0.7563879486998997},{x:0.0761299252156086,y:0.7588829195225393},{x:0.07514874916275306,y:0.7597905823884902},{x:0.07430080515339463,y:0.7608238051533946},{x:0.0719175169393771,y:0.7627797192430708},{x:0.06965428252171184,y:0.764873384117869},{x:0.06851488325078628,y:0.7655721885442563},{x:0.06748166048588208,y:0.7664201325536145},{x:0.06476258657702469,y:0.7678735078373721},{x:0.06213438581945812,y:0.7694854083973313},{x:0.06088054980546198,y:0.7699484997219428},{x:0.05970175445642904,y:0.7705785789630079},{x:0.056751387338174995,y:0.7714735630437544},{x:0.05385922052190834,y:0.7725417548543195},{x:0.05253913197970031,y:0.7727513367372549},{x:0.051260064490725774,y:0.7731393376181454},{x:0.04819178511684276,y:0.773441536759571},{x:0.0451467965906812,y:0.7739249698085104},{x:0.04381118578262464,y:0.7738729881355436},{x:0.042481,y:0.774004},{x:0.039412720626117295,y:0.7737018008585744},{x:0.03633192759147018,y:0.7735818970849305},{x:0.035032121291898165,y:0.7732703494826018},{x:0.03370193550927423,y:0.7731393376181454},{x:0.030751568391020223,y:0.7722443535373988},{x:0.02775336399647938,y:0.7715257207759494},{x:0.026539313032545114,y:0.7709665798438982},{x:0.02526024554357096,y:0.7705785789630079},{x:0.02254117163471342,y:0.7691252036792503},{x:0.01974077519375046,y:0.7678354585840041},{x:0.01865913486315115,y:0.7670502117946798},{x:0.017480339514117912,y:0.7664201325536145},{x:0.015097051300099952,y:0.7644642184639381},{x:0.012602080477460715,y:0.7626529252156086},{x:0.011694417611510011,y:0.7616717491627533},{x:0.010661194846605361,y:0.7608238051533946},{x:0.008705280756928618,y:0.7584405169393763},{x:0.006611615882131057,y:0.7561772825217118},{x:0.005912811455744052,y:0.7550378832507868},{x:0.005064867446385457,y:0.7540046604858821},{x:0.0036114921626275165,y:0.7512855865770239},{x:0.0019995916026687363,y:0.7486573858194581},{x:0.0015365002780573323,y:0.7474035498054622},{x:0.0009064210369920944,y:0.746224754456429},{x:0.000011436956245516774,y:0.7432743873381747},{x:-0.0010567548543195318,y:0.7403822205219084},{x:-0.0012663367372549837,y:0.7390621319797002},{x:-0.001654337618145367,y:0.7377830644907257},{x:-0.0019565367595708303,y:0.7347147851168438},{x:-0.0024399698085105087,y:0.7316697965906812},{x:-0.0023879881355436095,y:0.730334185782624},{x:-0.0025190000000000004,y:0.729004},{x:-0.0025190000000000004,y:0.05103000000000002}]],N:[[{x:0.022871000000000002,y:0.05103000000000002},{x:0.023735662381854636,y:0.04225093550927423},{x:0.026296421036992097,y:0.03380924554357098},{x:0.03045486744638546,y:0.026029339514117924},{x:0.036051194846605364,y:0.019210194846605383},{x:0.042870339514117915,y:0.013613867446385479},{x:0.05065024554357096,y:0.009455421036992116},{x:0.05909193550927423,y:0.006894662381854655},{x:0.067871,y:0.0060300000000000215},{x:0.07665006449072577,y:0.006894662381854655},{x:0.08509175445642904,y:0.009455421036992116},{x:0.0928716604858821,y:0.013613867446385486},{x:0.09969080515339464,y:0.019210194846605383},{x:0.10528713255361455,y:0.026029339514117924},{x:0.10944557896300791,y:0.03380924554357098},{x:0.11200633761814537,y:0.04225093550927425},{x:0.112871,y:0.05103000000000002},{x:0.112871,y:0.5841703094604355},{x:0.49710429367778214,y:0.025528669675955993},{x:0.4971050718109503,y:0.02552774709009411},{x:0.49710565506134197,y:0.025526690456344234},{x:0.49994880496714983,y:0.022156103119426583},{x:0.5027917749380927,y:0.01878536401177818},{x:0.5027927181072235,y:0.018784610959395015},{x:0.5027934962896407,y:0.018783688415073364},{x:0.5062395848358414,y:0.016032536999645196},{x:0.5096855265142521,y:0.01328120162562755},{x:0.5096865984738844,y:0.013280647046104224},{x:0.5096875416832135,y:0.013279894044071351},{x:0.5136041376200112,y:0.011253903755746949},{x:0.5175206253992491,y:0.009227704391234041},{x:0.5175217849545753,y:0.009227369596750634},{x:0.5175228569438108,y:0.00922681507445236},{x:0.5217594476858983,y:0.008003843583871996},{x:0.5259959731369073,y:0.006780645934087934},{x:0.5259971757268666,y:0.006780543790608634},{x:0.5259983353000632,y:0.006780209058025982},{x:0.5303921110410749,y:0.006407254473822295},{x:0.5347858668666982,y:0.00603406533837119},{x:0.5347870662764328,y:0.00603419977121261},{x:0.5347882688718429,y:0.006034097691931008},{x:0.5391703792739257,y:0.006525492449663053},{x:0.5435525159020149,y:0.007016653277689966},{x:0.5435536660388816,y:0.007017019120673398},{x:0.543554865441438,y:0.007017153617542397},{x:0.547756908459233,y:0.008354013692199154},{x:0.5519590228368241,y:0.009690649448577907},{x:0.5519600795017079,y:0.0096912326425627},{x:0.551961229619043,y:0.009691598546943021},{x:0.555821723096155,y:0.01182254915564361},{x:0.559682330324044,y:0.013953293677782128},{x:0.5596832529099061,y:0.01395407181095043},{x:0.5596843095436558,y:0.013954655061341997},{x:0.5630548968806759,y:0.016797804967236304},{x:0.5664256359882218,y:0.01964077493809272},{x:0.5664263890406048,y:0.019641718107223288},{x:0.5664273115849267,y:0.019642496289640633},{x:0.5691784630004857,y:0.02308858483600535},{x:0.5719297983743725,y:0.026534526514252196},{x:0.5719303529538958,y:0.0265355984738845},{x:0.5719311059559287,y:0.0265365416832135},{x:0.5739570962443242,y:0.03045313762014873},{x:0.575983295608766,y:0.03436962539924916},{x:0.5759836304032494,y:0.03437078495457533},{x:0.5759841849255477,y:0.0343718569438108},{x:0.5772071564160691,y:0.03860844768569421},{x:0.5784303540659121,y:0.04284497313690728},{x:0.5784304562093915,y:0.04284617572686688},{x:0.578430790941974,y:0.042847335300063204},{x:0.5788037455260991,y:0.04724111104014873},{x:0.5791769346616289,y:0.05163486686669809},{x:0.5791768002287875,y:0.05163606627643281},{x:0.5791769023080691,y:0.05163726887184294},{x:0.5700269023080691,y:0.7296112688718429},{x:0.5690438463824576,y:0.738377865441438},{x:0.566369401453057,y:0.746784229619043},{x:0.5621063449386581,y:0.7545073095436557},{x:0.5564185037103594,y:0.7612503115849266},{x:0.5495244583167865,y:0.7667541059559286},{x:0.5416891430561892,y:0.7708071849255477},{x:0.5332136646999368,y:0.773253790941974},{x:0.5244237311281571,y:0.773999902308069},{x:0.515657134558562,y:0.7730168463824576},{x:0.507250770380957,y:0.770342401453057},{x:0.49952769045634426,y:0.766079344938658},{x:0.4927846884150734,y:0.7603915037103594},{x:0.4872808940440714,y:0.7534974583167865},{x:0.4832278150744524,y:0.7456621430561892},{x:0.480781209058026,y:0.7371866646999369},{x:0.48003509769193103,y:0.7283967311281571},{x:0.48718300813543913,y:0.19876859615253395},{x:0.10494770632221789,y:0.754505330324044},{x:0.1022980223560627,y:0.75764690179997},{x:0.09969080515339464,y:0.7608238051533946},{x:0.09945603456444842,y:0.7610164763964532},{x:0.09926022506190729,y:0.7612486359882218},{x:0.09604856383930557,y:0.7638129153509474},{x:0.0928716604858821,y:0.7664201325536145},{x:0.09260381265312083,y:0.7665633002029657},{x:0.09236647348574781,y:0.7667527983743725},{x:0.08871625734636118,y:0.7686412418060533},{x:0.08509175445642904,y:0.7705785789630079},{x:0.08480112262185491,y:0.7706667411661766},{x:0.08453137460075086,y:0.770806295608766},{x:0.08058287930375276,y:0.7719463312873718},{x:0.07665006449072577,y:0.7731393376181454},{x:0.07634781747275289,y:0.773169106351106},{x:0.07605602686309273,y:0.7732533540659121},{x:0.07196099086840901,y:0.7736011710596524},{x:0.067871,y:0.774004},{x:0.06756875298202693,y:0.7739742312670393},{x:0.06726613313330192,y:0.7739999346616289},{x:0.06318192637768459,y:0.7735421665584931},{x:0.05909193550927423,y:0.7731393376181454},{x:0.05880130367469977,y:0.7730511754149765},{x:0.05849948409798508,y:0.77301734672231},{x:0.054583060356599135,y:0.7717715852937818},{x:0.05065024554357096,y:0.7705785789630079},{x:0.0503823977108098,y:0.7704354113136568},{x:0.050092977163175983,y:0.7703433505514221},{x:0.04649484240404986,y:0.768357469710569},{x:0.042870339514117915,y:0.7664201325536145},{x:0.04263556892517204,y:0.7662274613105563},{x:0.04236966967595597,y:0.7660807063222179},{x:0.03922809820002561,y:0.7634310223560591},{x:0.036051194846605364,y:0.7608238051533946},{x:0.03585852360354703,y:0.7605890345644487},{x:0.035626364011778155,y:0.7603932250619073},{x:0.033062084649052234,y:0.7571815638393052},{x:0.03045486744638546,y:0.7540046604858821},{x:0.030311699797034096,y:0.7537368126531205},{x:0.03012220162562753,y:0.7534994734857478},{x:0.028233758193948882,y:0.7498492573463653},{x:0.026296421036992097,y:0.746224754456429},{x:0.026208258833823234,y:0.7459341226218545},{x:0.026068704391234022,y:0.7456643746007509},{x:0.02492866871262922,y:0.741715879303756},{x:0.023735662381854636,y:0.7377830644907257},{x:0.023705893648893955,y:0.7374808174727527},{x:0.023621645934087915,y:0.7371890268630927},{x:0.023273828940347806,y:0.7330939908684111},{x:0.022871000000000002,y:0.729004},{x:0.022871000000000002,y:0.05103000000000002}]],O:[[{x:0.012131736117046842,y:0.4355587711738732},{x:0.012426138979982786,y:0.43287355609157196},{x:0.012514983726773468,y:0.43017371170811375},{x:0.012905745911416293,y:0.42849911573111366},{x:0.01309315536666239,y:0.42678977537085305},{x:0.07316415536666239,y:0.1412837753708531},{x:0.07429915106219231,y:0.13768552483470178},{x:0.07533122192175289,y:0.13405641311271962},{x:0.07562440736087628,y:0.1334840955199844},{x:0.07581784742995093,y:0.1328708369543332},{x:0.07763301835724021,y:0.12956315246900071},{x:0.0793532628391043,y:0.12620512014747703},{x:0.07975246842568721,y:0.12570099711853563},{x:0.0800618324091279,y:0.12513726042963025},{x:0.08248742256740031,y:0.1222472544549173},{x:0.0848297326408542,y:0.1192893488327618},{x:0.1660597326408542,y:0.03517334883276172},{x:0.16792084009780786,y:0.033590824390739155},{x:0.16963596886504836,y:0.031851158363102774},{x:0.17127304088861567,y:0.03074040344046043},{x:0.172780173663761,y:0.0294588683817891},{x:0.1749142556657825,y:0.0282698357562587},{x:0.17693582072022015,y:0.026898201947035502},{x:0.17875813439943417,y:0.026128166777013812},{x:0.18048632312818114,y:0.025165283073572443},{x:0.1828113681007397,y:0.02441543612151622},{x:0.18506168183103927,y:0.023464545648773483},{x:0.2739246818310393,y:-0.0041824543512264944},{x:0.2748960678404206,y:-0.004382857312604547},{x:0.27582577451608603,y:-0.004728396924478621},{x:0.2792086173377598,y:-0.005272563034129881},{x:0.28256427991205235,y:-0.0059648570457577},{x:0.28355609768991147,y:-0.005971901311054349},{x:0.2845353517466465,y:-0.006129424701440567},{x:0.287959355733624,y:-0.0060031749164705245},{x:0.2913856000541485,y:-0.006027509400590186},{x:0.29235973459950004,y:-0.005840924262640544},{x:0.29335090385307644,y:-0.005804377895986514},{x:0.3811419038530764,y:0.006122622104013507},{x:0.38318930529213563,y:0.00660893405691686},{x:0.3852758334501729,y:0.006882342567970358},{x:0.387470347489584,y:0.0076257947232155985},{x:0.38972465411174423,y:0.008161252125438313},{x:0.3916378405507577,y:0.009037647936572414},{x:0.39363093730084414,y:0.009712864429997858},{x:0.3956382440479665,y:0.010870159811164118},{x:0.3977447722434711,y:0.011835121954387393},{x:0.39945022100051475,y:0.01306792222421872},{x:0.4012732927522862,y:0.01411899850883961},{x:0.4916652927522862,y:0.07880999850883955},{x:0.49276799959381884,y:0.07977586317754862},{x:0.49398769122063274,y:0.08058901093294302},{x:0.4960788615418114,y:0.08267585840574071},{x:0.4983012083703825,y:0.08462241954283417},{x:0.4991942961599152,y:0.08578485282556958},{x:0.5002319144966787,y:0.08682032620708877},{x:0.5018757798210403,y:0.08927504258220473},{x:0.5036756696393939,y:0.09161775945128844},{x:0.5043248175140242,y:0.09293208968889465},{x:0.5051404874699588,y:0.09415009603518716},{x:0.5560304874699588,y:0.18912209603518723},{x:0.5570965448702581,y:0.19168827319789875},{x:0.5583465570022521,y:0.1941700494329812},{x:0.5587848767756364,y:0.19575236841213633},{x:0.559414776433869,y:0.19726864147332673},{x:0.5599597135111237,y:0.1999934877429328},{x:0.5607015364856348,y:0.20267144261291137},{x:0.5892585364856349,y:0.36700144261291134},{x:0.5895780755292599,y:0.371318367211785},{x:0.589913428370686,y:0.37563409214099147},{x:0.5899036127276142,y:0.3757163259822715},{x:0.58990972616553,y:0.3757989176124618},{x:0.5893809351459178,y:0.38009523269056544},{x:0.5888678881103582,y:0.38439345626922305},{x:0.5314878881103581,y:0.6446844562692231},{x:0.5303800126922803,y:0.6480826863142071},{x:0.5293998170293023,y:0.651519919480997},{x:0.5290148883003433,y:0.6522699863013032},{x:0.5287535704445262,y:0.6530715368858165},{x:0.5270040207481954,y:0.6561883351212919},{x:0.5253720883446767,y:0.6593682961290664},{x:0.5248482251358019,y:0.6600288547560561},{x:0.5244355536676654,y:0.6607640231862051},{x:0.522111563906752,y:0.6634796128039058},{x:0.5198906090097624,y:0.6662800975344761},{x:0.4528876090097624,y:0.7355630975344761},{x:0.4513498405668143,y:0.7368687638478525},{x:0.44995999895015265,y:0.7383308981052339},{x:0.44799560298794544,y:0.7397167316507253},{x:0.4461630292013509,y:0.741272707045399},{x:0.44440008568631667,y:0.7422532816059559},{x:0.4427517012434998,y:0.743416176715023},{x:0.4405546878862334,y:0.7443921472166956},{x:0.43845377075029196,y:0.7455607075703166},{x:0.43653340109378364,y:0.7461785074476045},{x:0.43468982031452474,y:0.7469974740014746},{x:0.32025082031452473,y:0.7849044740014746},{x:0.3162756641960007,y:0.785800462676764},{x:0.3123143949565378,y:0.7867559771378485},{x:0.3119757732525013,y:0.7867696456410259},{x:0.3116451697261732,y:0.786844162718285},{x:0.30757159639863574,y:0.7869474207351895},{x:0.30350003021295163,y:0.7871117699623142},{x:0.30316524843732107,y:0.7870591140117537},{x:0.302826459804451,y:0.7870677017158569},{x:0.29881101440639224,y:0.7863742609266953},{x:0.29478561927964103,y:0.7857411290712295},{x:0.173234619279641,y:0.7541621290712296},{x:0.17180894449846637,y:0.7536379076298808},{x:0.17032768986057922,y:0.753301394035824},{x:0.16767817066393412,y:0.7521190197025511},{x:0.16495505208167519,y:0.7511177274253745},{x:0.16365904177145735,y:0.7503254433998781},{x:0.16227189957151614,y:0.7497064173758784},{x:0.15990395993272244,y:0.7480298664806163},{x:0.1574285077432372,y:0.7465165596726792},{x:0.15631196685338702,y:0.745486660093817},{x:0.15507224418821702,y:0.7446089104628228},{x:0.08487024418821705,y:0.6837459104628228},{x:0.08477922863788438,y:0.6836498346778195},{x:0.08467166808724909,y:0.6835727301071804},{x:0.08174665618590948,y:0.6804486588585436},{x:0.07880340242944883,y:0.6773417676286113},{x:0.07873287917322891,y:0.6772297816598538},{x:0.07864242772392874,y:0.6771331746094597},{x:0.07638309517198695,y:0.6734984900001298},{x:0.07410251962167697,y:0.6698770964908778},{x:0.07405519882875666,y:0.6697535038963435},{x:0.0739853324792622,y:0.6696411069209627},{x:0.07247850415964274,y:0.6656354878421232},{x:0.07094824805491862,y:0.6616387601752097},{x:0.07092594823683183,y:0.6615083105489945},{x:0.0708793519117729,y:0.6613844430013583},{x:0.013660351911772894,y:0.4476944430013583},{x:0.013380528959940628,y:0.4459977798389246},{x:0.012899536483696877,y:0.44434683677239306},{x:0.012664423003084308,y:0.4416557821956227},{x:0.012224847112815455,y:0.43899048181468664},{x:0.012281403443251489,y:0.4372718288093888},{x:0.012131736117046842,y:0.4355587711738732}],[{x:0.10337829031332789,y:0.4348001396911351},{x:0.15424861715004387,y:0.6247803934833692},{x:0.2060651876410252,y:0.6697037849792326},{x:0.3045603004668897,y:0.6952928559694175},{x:0.3958853477721772,y:0.6650421672339206},{x:0.4463402797077116,y:0.6128703383711886},{x:0.499069598507425,y:0.373676069990286},{x:0.47327322171072966,y:0.22523195474705573},{x:0.4307624349909165,y:0.1458974207255564},{x:0.35796896612556683,y:0.09380119213930618},{x:0.2911281310221294,y:0.08472041346861442},{x:0.22279798440939425,y:0.10597924519162948},{x:0.15856873728877424,y:0.17249047688925445},{x:0.10337829031332789,y:0.4348001396911351}]],P:[[{x:0.025556999999999996,y:0.05103000000000002},{x:0.02642166238185463,y:0.04225093550927423},{x:0.02898242103699209,y:0.03380924554357098},{x:0.033140867446385454,y:0.026029339514117924},{x:0.03873719484660536,y:0.019210194846605383},{x:0.04555633951411791,y:0.013613867446385479},{x:0.053336245543570956,y:0.009455421036992116},{x:0.061777935509274226,y:0.006894662381854655},{x:0.070557,y:0.0060300000000000215},{x:0.07933606449072576,y:0.006894662381854655},{x:0.08777775445642903,y:0.009455421036992116},{x:0.09555766048588209,y:0.013613867446385486},{x:0.10237680515339463,y:0.019210194846605383},{x:0.10797313255361454,y:0.026029339514117924},{x:0.1121315789630079,y:0.03380924554357098},{x:0.11469233761814536,y:0.04225093550927425},{x:0.11555699999999999,y:0.05103000000000002},{x:0.11555699999999999,y:0.3249696679740436},{x:0.22632413005583354,y:0.32573306868659574},{x:0.22797244585475993,y:0.3259068917113995},{x:0.2296296407459454,y:0.32587748916779646},{x:0.3399906407459454,y:0.3347734891677965},{x:0.3425199358315593,y:0.3352301100895628},{x:0.3450781711944775,y:0.33547763407671893},{x:0.4262801711944775,y:0.3514846340767189},{x:0.43023360415359113,y:0.35267647626036297},{x:0.4342017122431381,y:0.35381850872164355},{x:0.49034871224313803,y:0.3761405087216436},{x:0.49223471805815816,y:0.37711419756221787},{x:0.49421014578428074,y:0.3778905822551455},{x:0.4961445509948513,y:0.379132728294546},{x:0.49818726580808836,y:0.3801873213410173},{x:0.49984707528076383,y:0.38151024250532195},{x:0.5016330805772936,y:0.3826570960152846},{x:0.5368430805772937,y:0.4104950960152846},{x:0.538268982488492,y:0.41186995272090265},{x:0.539835277869678,y:0.41308244849417974},{x:0.5414366048100854,y:0.41492417879038607},{x:0.5431934850553138,y:0.4166181652891421},{x:0.5443237674236908,y:0.41824478417169497},{x:0.5456234206874699,y:0.41973955124896434},{x:0.546834674823181,y:0.4218582966024136},{x:0.5482273167355989,y:0.4238624839583804},{x:0.5490185434436073,y:0.4256783549664296},{x:0.5500016096439067,y:0.4273979502871872},{x:0.5725636096439066,y:0.4777629502871872},{x:0.5732747072201834,y:0.47988746499756846},{x:0.5741879174558705,y:0.48193325814034926},{x:0.5746713208988057,y:0.4840600657825243},{x:0.5753635933927087,y:0.4861283376286891},{x:0.5756465551694752,y:0.4883507586397718},{x:0.5761431038835471,y:0.49053540091990977},{x:0.5762022992770958,y:0.49271564988294925},{x:0.5764777701286589,y:0.49487923612929946},{x:0.5763217220435205,y:0.4971141570479765},{x:0.5763825271473633,y:0.4993536938878067},{x:0.5706825271473633,y:0.5794656938878067},{x:0.5700654182420953,y:0.5830779192715516},{x:0.5695689975224034,y:0.5867086990904052},{x:0.5693236589408173,y:0.5874197813867033},{x:0.5691969863455608,y:0.5881612549906394},{x:0.5678870248015591,y:0.5915836805014664},{x:0.5666918126627678,y:0.5950478490261242},{x:0.5415328126627678,y:0.6498468490261241},{x:0.5413708296623262,y:0.6501242105110185},{x:0.5412617638147841,y:0.650426323944409},{x:0.5391478795722351,y:0.653930540410781},{x:0.5370840246571379,y:0.6574644536133865},{x:0.536871043573226,y:0.6577048843594048},{x:0.5367051339883567,y:0.6579799150765678},{x:0.5339482287199508,y:0.661004400648547},{x:0.5312345979336611,y:0.6640677725799057},{x:0.5309788035098929,y:0.664262032968313},{x:0.5307624259999995,y:0.6644994116930277},{x:0.47414742599999943,y:0.7155204116930277},{x:0.47266946719886654,y:0.7166100541651699},{x:0.4713261182021025,y:0.7178618913781634},{x:0.46912758296129603,y:0.7192213498885075},{x:0.46704701478499566,y:0.7207552731949938},{x:0.4653848758470294,y:0.7215356430341334},{x:0.4638231175995642,y:0.7225013521577397},{x:0.4283261175995643,y:0.7398953521577398},{x:0.4243082080780145,y:0.7413960258251278},{x:0.4202985181688539,y:0.7429185254841078},{x:0.34090751816885384,y:0.7644395254841077},{x:0.3408415384597873,y:0.7644506164558663},{x:0.3407789202555512,y:0.7644741810938074},{x:0.33649241770984384,y:0.7651816893280429},{x:0.33220802793590354,y:0.7659018811363755},{x:0.33214115226719376,y:0.7658998869955335},{x:0.33207514002138977,y:0.7659107826399355},{x:0.2099811400213898,y:0.7739077826399355},{x:0.20641155146718015,y:0.773790767187745},{x:0.20284008504333162,y:0.7738075792583221},{x:0.0663570850433316,y:0.7610135792583221},{x:0.06408313636872824,y:0.7605723800858132},{x:0.061777935509274226,y:0.7603453376181454},{x:0.05976354040438703,y:0.759734277543603},{x:0.05769704052657306,y:0.7593333282846051},{x:0.05555285882676713,y:0.7584569812513055},{x:0.053336245543570956,y:0.7577845789630079},{x:0.05147976838249502,y:0.7567922712467745},{x:0.04953119704042999,y:0.7559958719887517},{x:0.04759918201567506,y:0.7547180546196904},{x:0.04555633951411791,y:0.7536261325536145},{x:0.043929123673028744,y:0.7522907110247322},{x:0.04217336337061703,y:0.7511294669445447},{x:0.04052776127482757,y:0.7494992850446065},{x:0.03873719484660536,y:0.7480298051533947},{x:0.037401773317722896,y:0.7464025893123053},{x:0.03590629693874444,y:0.7449211263687215},{x:0.034610347337597366,y:0.7430012269141045},{x:0.033140867446385454,y:0.7412106604858821},{x:0.032148559730151835,y:0.7393541833248057},{x:0.030970837593177758,y:0.7376094333079335},{x:0.030074343103068113,y:0.7354735969579864},{x:0.02898242103699209,y:0.733430754456429},{x:0.028371360962449563,y:0.7314163593515414},{x:0.027556652268729623,y:0.729475372026062},{x:0.027094064670152376,y:0.7272056777739226},{x:0.02642166238185463,y:0.7249890644907258},{x:0.02621533264498147,y:0.722894163516222},{x:0.025794946192721373,y:0.7208315299365354},{x:0.02578404246766777,y:0.7185152008594541},{x:0.025556999999999996,y:0.71621},{x:0.025556999999999996,y:0.05103000000000002}],[{x:0.11555699999999999,y:0.414971805397996},{x:0.11555699999999999,y:0.6752310456989574},{x:0.20767337575712835,y:0.6838660911730216},{x:0.3217031184787672,y:0.6763972896549704},{x:0.3925929523867085,y:0.6571807523203506},{x:0.4185706758911827,y:0.6444513238436673},{x:0.46361487793542,y:0.6038578374443203},{x:0.4814895996448674,y:0.5649247767123354},{x:0.48580725170954087,y:0.5042413131675768},{x:0.4723746184159119,y:0.474255736718963},{x:0.45098032059796866,y:0.45734081304228297},{x:0.40480552914494095,y:0.4389833995595593},{x:0.3301954695220376,y:0.42427584033215343},{x:0.22404845814303564,y:0.41571952231013837},{x:0.11555699999999999,y:0.414971805397996}]],Q:[[{x:0.012134510452571898,y:0.39776120903599943},{x:0.012467756958298536,y:0.3937322544040442},{x:0.012734737801221134,y:0.38969836671479857},{x:0.012831073490929856,y:0.38933975275179394},{x:0.012861682585025715,y:0.38896968840207613},{x:0.0716656825850257,y:0.06709568840207614},{x:0.07243605319674906,y:0.06440524795975149},{x:0.07301096718930201,y:0.06166637692330789},{x:0.07364750148994079,y:0.06017438890024393},{x:0.07409402290033937,y:0.05861495861744442},{x:0.07537446994903126,y:0.05612650608452361},{x:0.07647266436288541,y:0.053552421842995857},{x:0.07738804025928744,y:0.05221328363312273},{x:0.0781302116420243,y:0.05077092937167972},{x:0.07987152826568633,y:0.04858009458346291},{x:0.08145080010539194,y:0.04626971775068952},{x:0.16096480010539196,y:-0.04855928224931053},{x:0.16315500529851779,y:-0.05070373085173594},{x:0.16521251383898505,y:-0.052975804178533654},{x:0.1663001767861927,y:-0.05378319510572523},{x:0.1672680674520078,y:-0.05473086511953138},{x:0.1698345496348827,y:-0.056406820906963286},{x:0.172295783242646,y:-0.058233836978172464},{x:0.17352006120728586,y:-0.058813521600477286},{x:0.17465423537351554,y:-0.059554156299027654},{x:0.17749836607515132,y:-0.06069721323044178},{x:0.18026874092294012,y:-0.06200896084304842},{x:0.2672567409229401,y:-0.09317596084304836},{x:0.2695830047845554,y:-0.09375972267138269},{x:0.2718475349769373,y:-0.09454977610873284},{x:0.2738508793967248,y:-0.09483071995927067},{x:0.27581299058749986,y:-0.09532309988014809},{x:0.2782084422243766,y:-0.09544181332278269},{x:0.28058359188359605,y:-0.09577489818042065},{x:0.2826032520283714,y:-0.0956596106656824},{x:0.28462372036011635,y:-0.09575974074040533},{x:0.28699630390923414,y:-0.09540884370631499},{x:0.2893907973658866,y:-0.09527215971995788},{x:0.3753267973658866,y:-0.08182715971995795},{x:0.37840631600914065,y:-0.08102976437129623},{x:0.38152495221950905,y:-0.08040256216817918},{x:0.38266795913198753,y:-0.07992627554804835},{x:0.3838666954562622,y:-0.07961588068444121},{x:0.38673147789694834,y:-0.07823302278004476},{x:0.38966782930723504,y:-0.07700945634885908},{x:0.3906959547522998,y:-0.07631933185595965},{x:0.3918111026603398,y:-0.07578103928710583},{x:0.3943510569158511,y:-0.07386586128072498},{x:0.3969922811880835,y:-0.07209295159323717},{x:0.45217017177581864,y:-0.026613783173476364},{x:0.5097585536672307,y:-0.09873256043298734},{x:0.5159122791302333,y:-0.10505326271144577},{x:0.5231808703268614,y:-0.11005198218579294},{x:0.5312849993737013,y:-0.11353662086994384},{x:0.5399132291363312,y:-0.11537326605347448},{x:0.5487339815837399,y:-0.1154913364919842},{x:0.5574082801461085,y:-0.11388629480473579},{x:0.5656027763942881,y:-0.11061982184365243},{x:0.5730025604329874,y:-0.10581744633276943},{x:0.5793232627114457,y:-0.0996637208697668},{x:0.5843219821857929,y:-0.09239512967313873},{x:0.5878066208699438,y:-0.08429100062629874},{x:0.5896432660534744,y:-0.07566277086366895},{x:0.5897613364919841,y:-0.06684201841626024},{x:0.5881562948047357,y:-0.058167719853891554},{x:0.5848898218436525,y:-0.04997322360571205},{x:0.5800874463327694,y:-0.042573439567012816},{x:0.5106129498444961,y:0.04443049374200151},{x:0.5474711182959175,y:0.12365010382899572},{x:0.5481373073434039,y:0.1255496832776173},{x:0.5490025186311253,y:0.12736726941208848},{x:0.5495935209593992,y:0.1297019482663393},{x:0.5503905347901464,y:0.13197456307270286},{x:0.5506733336355601,y:0.13396760967066554},{x:0.5511673266667299,y:0.13591906574595297},{x:0.5791213266667299,y:0.32118306574595296},{x:0.5792865967797204,y:0.3243841932678159},{x:0.5796238248970751,y:0.32757179562983435},{x:0.579513579388425,y:0.3287806341158348},{x:0.5795761658223595,y:0.3299928748079828},{x:0.5791137513174164,y:0.3331647361616822},{x:0.5788226293197903,y:0.33635687958013644},{x:0.5226546293197903,y:0.6297998795801365},{x:0.5219105438778229,y:0.6323181740447382},{x:0.521369234544533,y:0.6348876981954499},{x:0.5206636104444891,y:0.6365383151545928},{x:0.5201549436340621,y:0.6382598551025291},{x:0.5189338607071872,y:0.6405845973766512},{x:0.5179016631869613,y:0.6429991446291672},{x:0.5168875780620563,y:0.6444803850133782},{x:0.5160528293589531,y:0.6460696100820955},{x:0.5144016744792594,y:0.6481114616238732},{x:0.5129182555439367,y:0.6502782422813739},{x:0.4473292555439367,y:0.7283852422813738},{x:0.4454767413796947,y:0.7301964293264013},{x:0.4437773055972873,y:0.732151966404103},{x:0.44233025961343425,y:0.7332727172827731},{x:0.4410215211764534,y:0.7345522595114605},{x:0.4388512574885805,y:0.735967237520439},{x:0.4368029695300015,y:0.737553656027496},{x:0.4351650804791521,y:0.7383705673253327},{x:0.43363186277883553,y:0.7393702013057781},{x:0.431227251583759,y:0.7403345934673514},{x:0.4289088260065632,y:0.7414909282302113},{x:0.3168848260065632,y:0.7842309282302113},{x:0.31544522398579106,y:0.7846236280557255},{x:0.31406876767085296,y:0.7851998529634103},{x:0.3111991137964475,y:0.7857818972901452},{x:0.30837424253549156,y:0.7865524758495462},{x:0.30688569012846406,y:0.7866567776362199},{x:0.305423266132861,y:0.7869533972381565},{x:0.30249520063786056,y:0.7869644160479279},{x:0.2995742760667897,y:0.7871690831124285},{x:0.29809397750772,y:0.7869809786010931},{x:0.2966017859654652,y:0.7869865939723252},{x:0.2937278327647654,y:0.7864261638184524},{x:0.2908231043767717,y:0.786057054147543},{x:0.2894079467091229,y:0.7855837720890787},{x:0.28794333170435554,y:0.785298167434039},{x:0.16895933170435556,y:0.7496931674340391},{x:0.16685145995859063,y:0.7488293371508981},{x:0.16467103610787698,y:0.748169732810473},{x:0.1627799564873854,y:0.7471607878174731},{x:0.16079664289106937,y:0.7463480029082842},{x:0.1588977982379503,y:0.7450895455041626},{x:0.15688795304330724,y:0.7440172356850165},{x:0.15523004539103946,y:0.7426587459550258},{x:0.15344340707901263,y:0.7414746531917952},{x:0.15182656105367498,y:0.739869930478983},{x:0.1500645317387979,y:0.7384261234461069},{x:0.08134353173879794,y:0.6698101234461069},{x:0.07898814712174665,y:0.6669445493412297},{x:0.07654417665723892,y:0.6641541443502993},{x:0.0761910053095167,y:0.6635415309608049},{x:0.07574199244846258,y:0.6629952594015535},{x:0.07399091166125166,y:0.6597252337561722},{x:0.07213828241215867,y:0.6565116506297859},{x:0.07191141209628055,y:0.6558419081228384},{x:0.07157759918584938,y:0.6552185349547689},{x:0.07049811528111428,y:0.6516697230205841},{x:0.06930802275051184,y:0.6481564579560907},{x:0.013298022750511833,y:0.4072474579560906},{x:0.013249789700227431,y:0.40687927578320093},{x:0.013136451320225305,y:0.40652566731159423},{x:0.012677284531251238,y:0.4025091147450468},{x:0.012152162963867598,y:0.3985006516980174},{x:0.01217668547678935,y:0.39813013424102855},{x:0.012134510452571898,y:0.39776120903599943}],[{x:0.1030741934540208,y:0.3959601630333355},{x:0.15405220468618464,y:0.6152256818322884},{x:0.20562817178182732,y:0.6667228451191239},{x:0.2990925609035841,y:0.6946913078929434},{x:0.38591644511804135,y:0.6615657918309754},{x:0.4364618489221904,y:0.6013735361946543},{x:0.4889800495366121,y:0.3269984766785998},{x:0.4631403994395801,y:0.1557472448128009},{x:0.4478929247459949,y:0.12297570323093639},{x:0.3763894463327694,y:0.21252056043298723},{x:0.3702357208697667,y:0.2188412627114457},{x:0.36296712967313866,y:0.22383998218579282},{x:0.35486300062629866,y:0.22732462086994373},{x:0.34623477086366883,y:0.22916126605347437},{x:0.3374140184162602,y:0.2292793364919841},{x:0.3287397198538915,y:0.22767429480473567},{x:0.32054522360571197,y:0.22440782184365232},{x:0.31314543956701274,y:0.21960544633276935},{x:0.3068247372885543,y:0.2134517208697667},{x:0.30182601781420715,y:0.20618312967313862},{x:0.2983413791300562,y:0.19807900062629863},{x:0.2965047339465256,y:0.18945077086366885},{x:0.29638666350801585,y:0.18063001841626014},{x:0.2979917051952643,y:0.17195571985389144},{x:0.30125817815634764,y:0.16376122360571194},{x:0.3060605536672306,y:0.1563614395670127},{x:0.3960043024488616,y:0.04372356068896105},{x:0.3492507773512258,y:0.005187991106938553},{x:0.28681342879982186,y:-0.004580559340762309},{x:0.22209853619564562,y:0.018606191220169738},{x:0.15806156000107346,y:0.09497717514193305},{x:0.1030741934540208,y:0.3959601630333355}]],R:[[{x:-0.010088,y:0.05588800000000005},{x:-0.009223337618145366,y:0.04710893550927426},{x:-0.006662578963007905,y:0.03866724554357101},{x:-0.0025041325536145423,y:0.030887339514117953},{x:0.0030921948466053617,y:0.024068194846605412},{x:0.009911339514117913,y:0.018471867446385508},{x:0.01769124554357096,y:0.014313421036992145},{x:0.02613293550927423,y:0.011752662381854684},{x:0.034912,y:0.01088800000000005},{x:0.043691064490725774,y:0.011752662381854684},{x:0.05213275445642904,y:0.014313421036992145},{x:0.059912660485882105,y:0.018471867446385515},{x:0.06673180515339464,y:0.024068194846605412},{x:0.07232813255361453,y:0.030887339514117953},{x:0.0764865789630079,y:0.03866724554357101},{x:0.07904733761814536,y:0.04710893550927428},{x:0.079912,y:0.05588800000000005},{x:0.079912,y:0.36648688236049143},{x:0.25933152798675563,y:0.3728389247505383},{x:0.2598033776805002,y:0.3702688775066002},{x:0.2630584474090824,y:0.36206984491555727},{x:0.26785052379396923,y:0.35466338703825},{x:0.5319365237939692,y:0.022999387038250052},{x:0.5380814500271169,y:0.016670129897313986},{x:0.5453430800394999,y:0.011661303295187019},{x:0.5534423534621115,y:0.008165393629206541},{x:0.5620680197594453,y:0.00631674674730745},{x:0.5708885994130244,y:0.006186405112428031},{x:0.5795651224933998,y:0.00777937768050025},{x:0.5877641550844427,y:0.011034447409082423},{x:0.59517061296175,y:0.015826523793969254},{x:0.601499870102686,y:0.021971450027116944},{x:0.606508696704813,y:0.02923308003949996},{x:0.6100046063707935,y:0.03733235346211146},{x:0.6118532532526926,y:0.04595801975944533},{x:0.6119835948875719,y:0.05477859941302443},{x:0.6103906223194997,y:0.06345512249339977},{x:0.6071355525909176,y:0.07165415508444274},{x:0.6023434762060308,y:0.07906061296174999},{x:0.36492288462028066,y:0.3772356888373974},{x:0.45122307475864126,y:0.3907421966461853},{x:0.4517263325772421,y:0.3908725352482557},{x:0.4522445282141884,y:0.3909141268943158},{x:0.4559919550269364,y:0.3919772876167318},{x:0.459762859565968,y:0.3929539131315124},{x:0.46023101962685037,y:0.3931799280437793},{x:0.4607311441523136,y:0.39332181547170203},{x:0.5072261441523136,y:0.41160281547170213},{x:0.5099186672764574,y:0.4129799887569096},{x:0.5126912264123276,y:0.4141879634543456},{x:0.5138373975854011,y:0.41498434320238026},{x:0.5150799754049854,y:0.4156198976243936},{x:0.5174520892726079,y:0.41749589411441484},{x:0.5199357102894067,y:0.4192215573713852},{x:0.5536387102894067,y:0.4479225573713852},{x:0.5544422891842978,y:0.4487559165260936},{x:0.5553578681885658,y:0.44946439490120116},{x:0.5574982196806069,y:0.4519250983842071},{x:0.5597619879819907,y:0.4542727608851649},{x:0.5603875460278954,y:0.4552468777427617},{x:0.5611473151639865,y:0.4561203635073251},{x:0.5627664809673836,y:0.45895134712470415},{x:0.5645287453623273,y:0.46169553923588524},{x:0.5649522427143585,y:0.46277297903182424},{x:0.5655270044804562,y:0.4637779046177677},{x:0.5843050044804562,y:0.5056739046177676},{x:0.5856980535944053,y:0.5098331481877504},{x:0.5870956418010017,y:0.5139908687307394},{x:0.5870987900445207,y:0.5140153439302019},{x:0.587106627133701,y:0.514038743222053},{x:0.5876614810321307,y:0.5183898384933372},{x:0.5882210839336397,y:0.522740325535193},{x:0.5899430839336397,y:0.580600325535193},{x:0.589777587866933,y:0.5830153029012521},{x:0.5898269599494498,y:0.5854354407122341},{x:0.5894767504310368,y:0.5874052295805413},{x:0.5893399666658296,y:0.589401226848592},{x:0.5887065118476329,y:0.5917375144207835},{x:0.5882827897945603,y:0.5941207819778186},{x:0.5699357897945603,y:0.6593647819778187},{x:0.5695566600666073,y:0.6603356321127045},{x:0.5693270257483343,y:0.6613522723710545},{x:0.5679549854437747,y:0.6644370937206254},{x:0.5667268644118839,y:0.6675819841936177},{x:0.5661656160899001,y:0.668460215174679},{x:0.5657420574552864,y:0.6694125215424361},{x:0.5637945617300048,y:0.6721703971299327},{x:0.5619765010042908,y:0.6750152648867381},{x:0.5612547025465381,y:0.6757671267898905},{x:0.5606534967163777,y:0.6766185026674012},{x:0.5398464967163776,y:0.7006785026674012},{x:0.5387925287989109,y:0.70167944573824},{x:0.5378793324857355,y:0.7028102896247742},{x:0.535601038014175,y:0.7047103734673366},{x:0.5334498940671065,y:0.7067532939324781},{x:0.5322209035416287,y:0.707529385222465},{x:0.5311046373415733,y:0.7084603444980107},{x:0.5029396373415734,y:0.7276033444980106},{x:0.49917038563569516,y:0.7296565217962586},{x:0.49541206095977475,y:0.7317296332429761},{x:0.4611910609597748,y:0.7464366332429762},{x:0.457170688924302,y:0.7477143925092122},{x:0.45316143447737084,y:0.7490266191763204},{x:0.37177643447737085,y:0.7670666191763205},{x:0.36787988134157384,y:0.7675363076101905},{x:0.36399443936523473,y:0.7680904503837813},{x:0.2290834393652347,y:0.7739614503837813},{x:0.2260604581328276,y:0.7737959747883908},{x:0.2230330269857825,y:0.7738173839936113},{x:0.030818026985782503,y:0.7562573839936113},{x:0.028490934977474184,y:0.7558115802948838},{x:0.02613293550927423,y:0.7555793376181453},{x:0.024169339379190496,y:0.7549836872441402},{x:0.022154034015341384,y:0.7545976128723226},{x:0.01995862841458906,y:0.7537063820373993},{x:0.01769124554357096,y:0.7530185789630078},{x:0.01588158498580211,y:0.7520512952425895},{x:0.013980322522940947,y:0.7512794726091756},{x:0.012000971535783972,y:0.7499770641392344},{x:0.009911339514117913,y:0.7488601325536145},{x:0.008325158769029223,y:0.7475583876576994},{x:0.006611003657363959,y:0.7464304774736483},{x:0.004923772632206568,y:0.7447669421957904},{x:0.0030921948466053617,y:0.7432638051533946},{x:0.0017904499506900475,y:0.7416776244083056},{x:0.0003292762098528329,y:0.7402369716294513},{x:-0.001000995511218774,y:0.7382762382714833},{x:-0.0025041325536145423,y:0.7364446604858821},{x:-0.0034714162740331275,y:0.7346349999281129},{x:-0.004623456556617868,y:0.732936968032819},{x:-0.005545647377387794,y:0.7307543864780955},{x:-0.006662578963007905,y:0.728664754456429},{x:-0.007258229337013042,y:0.7267011583263452},{x:-0.008056863899357211,y:0.7248110017280808},{x:-0.008535534543753812,y:0.7224904473617442},{x:-0.009223337618145366,y:0.7202230644907257},{x:-0.009424464135908606,y:0.7181809926864091},{x:-0.009839001899660749,y:0.7161713490432334},{x:-0.009855757323261527,y:0.7138019994682},{x:-0.010088,y:0.711444},{x:-0.010088,y:0.05588800000000005}],[{x:0.079912,y:0.45654326739466394},{x:0.079912,y:0.6703676283824797},{x:0.22820062174801237,y:0.6839146886946046},{x:0.3561457472749752,y:0.6783468266821017},{x:0.42954781695254723,y:0.662076342723345},{x:0.4559144639404158,y:0.6507448714849071},{x:0.47563211893454127,y:0.6373433067928232},{x:0.48601322722124407,y:0.6253391992627579},{x:0.4997779385388953,y:0.5763903343143285},{x:0.4985264355495565,y:0.5343392524542002},{x:0.48755361344964526,y:0.5098575528750181},{x:0.467303195590932,y:0.4926125823096997},{x:0.43241084881177044,y:0.4788935374345549},{x:0.3509044963348569,y:0.4661372945522357},{x:0.079912,y:0.45654326739466394}]],S:[[{x:0.021897597226735628,y:0.20918252956592975},{x:0.022856530106274857,y:0.20041326151782815},{x:0.025507836686771486,y:0.19199957102060095},{x:0.07532383668677148,y:0.0752955710206009},{x:0.07606476437254353,y:0.07394451179196875},{x:0.07662717764446286,y:0.07250992955787258},{x:0.07818101321859919,y:0.07008559601860773},{x:0.07956562874320691,y:0.06756079148160443},{x:0.08055589829123208,y:0.06638024029801701},{x:0.0813873780598424,y:0.06508294454561242},{x:0.08338432112997196,y:0.06300833217803187},{x:0.0852348965856767,y:0.0608021661408081},{x:0.08643645249257384,y:0.05983749092219001},{x:0.08750504545666679,y:0.05872733599970995},{x:0.08986835462050304,y:0.05708217099364391},{x:0.09211377343035676,y:0.05527942517977789},{x:0.09348044057646428,y:0.05456769785378441},{x:0.09474508130770348,y:0.05368734639231786},{x:0.18347008130770348,y:0.00406434639231789},{x:0.18531117162778632,y:0.0032602675504258996},{x:0.18705570252460849,y:0.0022638899609980986},{x:0.18934358471290644,y:0.0014991491478438968},{x:0.19155425509545604,y:0.0005336596975895336},{x:0.19351683738147718,y:0.0001042099085839361},{x:0.19542223123106015,y:-0.0005326814704223887},{x:0.1978153459361366,y:-0.0008363843304376121},{x:0.20017189655491793,y:-0.0013520417748285815},{x:0.2021805498702545,y:-0.0013903589963945293},{x:0.20417358345551592,y:-0.0016432887864569548},{x:0.36640558345551594,y:-0.006196288786456984},{x:0.3683537351453612,y:-0.006059465175549666},{x:0.37030515940756886,y:-0.006136660097762148},{x:0.3727431942064551,y:-0.005751182385354602},{x:0.3752054496398049,y:-0.005578251970786187},{x:0.37708947517888647,y:-0.005063991846688501},{x:0.37901846335331396,y:-0.004758999502412188},{x:0.3813344490261288,y:-0.00390529164215812},{x:0.3837156558614866,y:-0.003255321831637216},{x:0.38546315320491126,y:-0.002383387922517842},{x:0.38729557535780434,y:-0.001707928996501587},{x:0.5134735753578044,y:0.059451071003498376},{x:0.5144073364238021,y:0.06002293670994077},{x:0.5154151369003129,y:0.060451046875811966},{x:0.5181619939873726,y:0.06232241135953579},{x:0.5209964106485654,y:0.06405830049148753},{x:0.5218006642926897,y:0.06480134570578519},{x:0.5227055800155168,y:0.06541784197435321},{x:0.5250345719141375,y:0.06778913394790613},{x:0.5274758708842278,y:0.07004463571609586},{x:0.5281197100899656,y:0.07093030562736781},{x:0.5288869656553633,y:0.07171149639276676},{x:0.5307085905129939,y:0.07449158843544039},{x:0.5326629540416582,y:0.07718002517181716},{x:0.5331216364294024,y:0.07817428398206286},{x:0.5337217466362741,y:0.07909014852127505},{x:0.5349660004312154,y:0.08217220325496363},{x:0.5363583234240663,y:0.08519025984344057},{x:0.5366142220868877,y:0.08625489874416871},{x:0.5370241250365293,y:0.08727024089657527},{x:0.5783351250365293,y:0.22800124089657534},{x:0.5784689928995229,y:0.22870739358153944},{x:0.5787167010683089,y:0.22938208824013706},{x:0.5792894483007394,y:0.23303529403132756},{x:0.5799781923062021,y:0.23666841715613338},{x:0.579971724381043,y:0.23738711763976203},{x:0.5800830465086156,y:0.23809717369609615},{x:0.5799320834693805,y:0.24179192160438975},{x:0.5798988062915618,y:0.2454896025769029},{x:0.5797522511369868,y:0.24619323160266243},{x:0.5797229091764134,y:0.2469113620006918},{x:0.5788540372904492,y:0.2505056649360105},{x:0.5781000177526308,y:0.2541258039501414},{x:0.5778190074010411,y:0.2547873214491718},{x:0.5776501289474114,y:0.2554859288404322},{x:0.5462891289474114,y:0.3454679288404322},{x:0.5453940585085517,y:0.34740151578805634},{x:0.5446999978282894,y:0.3494160105998292},{x:0.5435456407901493,y:0.3513945829466735},{x:0.5425833616033817,y:0.3534733584203385},{x:0.5413282655917657,y:0.35519517245680393},{x:0.5402545326513293,y:0.3570355547940282},{x:0.5387363559437135,y:0.3587509055417339},{x:0.537387017705137,y:0.36060200657115166},{x:0.5358201287566253,y:0.36204587934864135},{x:0.5344079865107593,y:0.36364142435019586},{x:0.5325843328131388,y:0.3650276335315076},{x:0.5308997898345437,y:0.36657992334222783},{x:0.5290813226127058,y:0.36769036763963614},{x:0.5273850388959807,y:0.368979759405903},{x:0.44286903889598056,y:0.42100375940590296},{x:0.4391930936098881,y:0.42279580082266366},{x:0.4355432374645799,y:0.42464039733796655},{x:0.4352309585303121,y:0.42472736117212373},{x:0.4349395777453148,y:0.4248694107387315},{x:0.430984654780085,y:0.42590987723258605},{x:0.42704506666901776,y:0.42700697873237736},{x:0.18802361397643091,y:0.46887992641475673},{x:0.1445277950559712,y:0.506325930968192},{x:0.1345999941059918,y:0.5433489412625321},{x:0.1668438673565076,y:0.6442112383308392},{x:0.2418447705661005,y:0.6964178007533797},{x:0.3847076342900009,y:0.6886954406015322},{x:0.4475324208368403,y:0.608018765726417},{x:0.4536085342974724,y:0.6016234190133417},{x:0.4608155671913789,y:0.5965363480257236},{x:0.46887655728619765,y:0.5929530460487544},{x:0.47748172525324006,y:0.5910112173678703},{x:0.48630037931336645,y:0.5907854853702875},{x:0.49499362353660437,y:0.5922845248100812},{x:0.5032273814226823,y:0.5954507284422511},{x:0.5106852342735829,y:0.6001624208368403},{x:0.5170805809866582,y:0.6062385342974724},{x:0.5221676519742764,y:0.6134455671913789},{x:0.5257509539512455,y:0.6215065572861976},{x:0.5276927826321296,y:0.63011172525324},{x:0.5279185146297124,y:0.6389303793133664},{x:0.5264194751899187,y:0.6476236235366044},{x:0.5232532715577489,y:0.6558573814226824},{x:0.5185415791631597,y:0.663315234273583},{x:0.4431175791631597,y:0.760171234273583},{x:0.4420344490669973,y:0.7613112710002186},{x:0.44110391182703096,y:0.7625789282836855},{x:0.4390031114098716,y:0.7645018722698176},{x:0.4370414657025276,y:0.7665665809866583},{x:0.43575673751534005,y:0.767473404028016},{x:0.4345967726198766,y:0.768535164822443},{x:0.4321611907321885,y:0.7700113141492059},{x:0.4298344328086211,y:0.7716536519742764},{x:0.42839747791415833,y:0.7722924126294288},{x:0.42705266216361437,y:0.7731074740629288},{x:0.4243758968514515,y:0.7740801011395291},{x:0.42177344271380235,y:0.7752369539512456},{x:0.4202394824828045,y:0.7755831050064366},{x:0.4187614963922926,y:0.7761201447252115},{x:0.4159464142454535,y:0.7765518720385514},{x:0.41316827474676,y:0.7771787826321297},{x:0.4115962584106506,y:0.7772190216964318},{x:0.4100419001567639,y:0.7774574015652649},{x:0.23125890015676387,y:0.7871214015652648},{x:0.22961427991333744,y:0.7870487065186679},{x:0.22797320559841586,y:0.7871788426312305},{x:0.22521775007366066,y:0.7868543723294609},{x:0.22244596265035355,y:0.7867318545526676},{x:0.22084712542379714,y:0.7863397068281228},{x:0.21921219559556868,y:0.7861471846952227},{x:0.21657298639174055,y:0.7852913862936938},{x:0.21387836011908076,y:0.7846304737606538},{x:0.21238674832737245,y:0.7839339433752962},{x:0.2108207924222569,y:0.7834261615145331},{x:0.2083992528689725,y:0.782071922865878},{x:0.2058853407234555,y:0.7808980140745921},{x:0.20455827617124617,y:0.7799238683005129},{x:0.20312147299647784,y:0.7791203404840283},{x:0.10291447299647782,y:0.7093683404840284},{x:0.10181255131472464,y:0.7084283417469311},{x:0.10059641238964509,y:0.7076416809983432},{x:0.09846400643554813,y:0.7055718520256913},{x:0.09620311784593605,y:0.7036431918911783},{x:0.09530575393663021,y:0.7025062807105057},{x:0.09426645267874648,y:0.7014974784931097},{x:0.09257882390791694,y:0.6990514089395268},{x:0.09073764058529563,y:0.6967187299857058},{x:0.09007931964022471,y:0.6954285972205445},{x:0.08925679581402991,y:0.6942364212378118},{x:0.08807879885369768,y:0.6915081121844703},{x:0.08672807644060793,y:0.6888610579553555},{x:0.08633409736450004,y:0.6874672826843552},{x:0.08575996009935855,y:0.6861375475907227},{x:0.04484896009935855,y:0.5581635475907226},{x:0.04400698871411546,y:0.5542371548008082},{x:0.04309586967447821,y:0.5503262293029391},{x:0.04308290316808571,y:0.5499278363503387},{x:0.04299932697019912,y:0.5495380927241992},{x:0.04293953506277818,y:0.5455228840020936},{x:0.042808906634767226,y:0.5415093553341928},{x:0.04287391188557095,y:0.5411160877505585},{x:0.04286797679041901,y:0.5407175280315513},{x:0.04359266213029085,y:0.5367678055966908},{x:0.04424754429113727,y:0.532805911414652},{x:0.06119154429113727,y:0.4696179114146519},{x:0.06126294463056804,y:0.4694283141856516},{x:0.06129777501412092,y:0.46922873472253734},{x:0.06281676603792068,y:0.46530228011432895},{x:0.0643004966052513,y:0.46136236601319713},{x:0.0644075135916399,y:0.46119034135699993},{x:0.06448061074086608,y:0.46100139182805006},{x:0.06673642807197144,y:0.45744672339211917},{x:0.06896028828319853,y:0.453871975109843},{x:0.06909880931377366,y:0.45372413383751425},{x:0.06920736414622189,y:0.4535530754671619},{x:0.07211331798967527,y:0.4505067971180214},{x:0.07499184614403663,y:0.4474345902263458},{x:0.07515654793327702,y:0.4473166137950705},{x:0.07529638874761438,y:0.44717002026055797},{x:0.1386943887476144,y:0.392590020260558},{x:0.14135607757337018,y:0.39071931904916735},{x:0.1439175788350931,y:0.3887136217356019},{x:0.14495796828078528,y:0.38818782053421796},{x:0.14591168674437638,y:0.38751752344016943},{x:0.1488871876674173,y:0.38620203695812855},{x:0.15179076253542007,y:0.38473460266203335},{x:0.15291373991533655,y:0.3844218744952798},{x:0.15397990142199966,y:0.3839505182141148},{x:0.15715486761053352,y:0.383240799869195},{x:0.1602889333309822,y:0.3823680212676226},{x:0.4030282434963717,y:0.3398437611206276},{x:0.46657219784598525,y:0.30072914754350266},{x:0.487912612564808,y:0.23949853636308405},{x:0.45628203537627,y:0.13174508671722343},{x:0.35793695341674575,y:0.08407681754539842},{x:0.21775140382412592,y:0.0880110894972649},{x:0.15207256592030022,y:0.12474460286217379},{x:0.10828216331322851,y:0.2273324289793991},{x:0.10404037125679308,y:0.23506720851839558},{x:0.09837110341432329,y:0.2418258338591919},{x:0.09149222656964323,y:0.24734857482022213},{x:0.08366809210217534,y:0.25142319556354265},{x:0.07519937711167927,y:0.2538931106990613},{x:0.06641152956592972,y:0.2546634027732644},{x:0.05764226151782814,y:0.2537044698937252},{x:0.04922857102060091,y:0.2510531633132285},{x:0.04149379148160447,y:0.24681137125679312},{x:0.034735166140808106,y:0.24114210341432332},{x:0.029212425179777887,y:0.23426322656964324},{x:0.025137804436457384,y:0.22643909210217536},{x:0.022667889300938757,y:0.21797037711167933},{x:0.021897597226735628,y:0.20918252956592975}]],T:[[{x:-0.022050999999999998,y:0.729004},{x:-0.021186337618145364,y:0.7202249355092742},{x:-0.018625578963007903,y:0.711783245543571},{x:-0.01446713255361454,y:0.7040033395141179},{x:-0.008870805153394636,y:0.6971841948466053},{x:-0.002051660485882085,y:0.6915878674463855},{x:0.005728245543570962,y:0.6874294210369921},{x:0.014169935509274232,y:0.6848686623818546},{x:0.022949,y:0.684004},{x:0.264284,y:0.684004},{x:0.264284,y:0.05103000000000002},{x:0.26514866238185464,y:0.04225093550927423},{x:0.2677094210369921,y:0.03380924554357098},{x:0.27186786744638547,y:0.026029339514117924},{x:0.27746419484660534,y:0.019210194846605383},{x:0.28428333951411794,y:0.013613867446385479},{x:0.292063245543571,y:0.009455421036992116},{x:0.30050493550927426,y:0.006894662381854655},{x:0.309284,y:0.0060300000000000215},{x:0.3180630644907258,y:0.006894662381854655},{x:0.32650475445642907,y:0.009455421036992116},{x:0.3342846604858821,y:0.013613867446385486},{x:0.34110380515339467,y:0.019210194846605383},{x:0.34670013255361454,y:0.026029339514117924},{x:0.3508585789630079,y:0.03380924554357098},{x:0.35341933761814537,y:0.04225093550927425},{x:0.354284,y:0.05103000000000002},{x:0.354284,y:0.684004},{x:0.579103,y:0.684004},{x:0.5878820644907258,y:0.6848686623818546},{x:0.596323754456429,y:0.6874294210369921},{x:0.6041036604858822,y:0.6915878674463855},{x:0.6109228051533947,y:0.6971841948466053},{x:0.6165191325536146,y:0.7040033395141179},{x:0.6206775789630079,y:0.711783245543571},{x:0.6232383376181454,y:0.7202249355092742},{x:0.6241030000000001,y:0.729004},{x:0.6232383376181454,y:0.7377830644907257},{x:0.6206775789630079,y:0.746224754456429},{x:0.6165191325536146,y:0.7540046604858821},{x:0.6109228051533947,y:0.7608238051533946},{x:0.6041036604858822,y:0.7664201325536145},{x:0.596323754456429,y:0.7705785789630079},{x:0.5878820644907258,y:0.7731393376181454},{x:0.579103,y:0.774004},{x:0.022949,y:0.774004},{x:0.014169935509274211,y:0.7731393376181454},{x:0.005728245543570935,y:0.7705785789630079},{x:-0.0020516604858820953,y:0.7664201325536145},{x:-0.008870805153394643,y:0.7608238051533946},{x:-0.01446713255361454,y:0.7540046604858821},{x:-0.018625578963007903,y:0.746224754456429},{x:-0.021186337618145364,y:0.7377830644907257},{x:-0.022050999999999998,y:0.729004}]],U:[[{x:0.027022176378557076,y:0.7288780077818786},{x:0.02808017637855708,y:0.35099900778187865},{x:0.02823473618726791,y:0.3494735334648019},{x:0.028192796744230073,y:0.34794082288884604},{x:0.035484796744230065,y:0.24514582288884607},{x:0.03612518708694976,y:0.24139252668431194},{x:0.03666424897987138,y:0.2376233431565944},{x:0.055316248979871384,y:0.16148034315659432},{x:0.05618736340037885,y:0.15900518320818077},{x:0.05685851158014249,y:0.15646848905542057},{x:0.057648252259250334,y:0.15485425480263812},{x:0.058244846291224776,y:0.15315910934454152},{x:0.0595821022437829,y:0.15090145489330362},{x:0.06073523897858293,y:0.14854443712190207},{x:0.09649723897858292,y:0.0906284371219021},{x:0.09834293286415725,y:0.08820732921922435},{x:0.10003759110096133,y:0.08567820232322114},{x:0.10101147458130413,y:0.08470684222595504},{x:0.10184538199049184,y:0.08361295562088691},{x:0.10412794610596264,y:0.08159844564215248},{x:0.10628345014049506,y:0.07944852663140606},{x:0.15306845014049508,y:0.041154526631406},{x:0.15518086878702558,y:0.03974701384514513},{x:0.15716842451696925,y:0.03816808161035298},{x:0.15884280372557036,y:0.03730705230772802},{x:0.16040964618671547,y:0.03626305906247794},{x:0.1627560674239954,y:0.03529470367371844},{x:0.16501346722603244,y:0.034133863066459845},{x:0.23490646722603245,y:0.006476863066459913},{x:0.23625924682734178,y:0.006089880823813601},{x:0.23754823013535448,y:0.005525708919597472},{x:0.24049103862888763,y:0.004879315347967098},{x:0.24338780663402787,y:0.004050652809021178},{x:0.24479008944495417,y:0.003935020529692536},{x:0.24616436977860445,y:0.0036331571990539033},{x:0.3343553697786044,y:-0.006825842800946093},{x:0.3363658265006992,y:-0.006865793301669296},{x:0.3383604992721398,y:-0.007120376900508131},{x:0.34076517153289726,y:-0.0069532142518240045},{x:0.3431751712391958,y:-0.00700110421331946},{x:0.3451547915551648,y:-0.0066480664270605625},{x:0.3471608040448924,y:-0.0065086169201366215},{x:0.4090588040448924,y:0.003962383079863387},{x:0.4119620232343868,y:0.004752615784895447},{x:0.4149089852784979,y:0.005359710588792872},{x:0.4162090298953196,y:0.005908616535408058},{x:0.4175706649775032,y:0.0062792425557079215},{x:0.42026393287145114,y:0.0076206811274584655},{x:0.4230358315454356,y:0.008791034549085273},{x:0.4738028315454356,y:0.03637303454908527},{x:0.4760785863358737,y:0.0379161826666043},{x:0.4784624107710392,y:0.03928649177082543},{x:0.47972093897980134,y:0.04038599604431689},{x:0.48110410464379305,y:0.04132389563682743},{x:0.48303507818089647,y:0.043281370330868374},{x:0.4851057640535682,y:0.045090410406577325},{x:0.5154867640535682,y:0.07740541040657731},{x:0.5155903820373309,y:0.07753992155387555},{x:0.5157174079857786,y:0.07765259073212467},{x:0.5182811318880063,y:0.08103290449336144},{x:0.5208701788099869,y:0.08439386230433626},{x:0.5209455639802052,y:0.08454600372347547},{x:0.521048168494406,y:0.08468128952824439},{x:0.5340921684944061,y:0.10592328952824437},{x:0.5341054861393935,y:0.10595068243490303},{x:0.5341238592672674,y:0.10597497562685786},{x:0.5360339092314592,y:0.10991723311331511},{x:0.5379492688231333,y:0.11385691363208547},{x:0.5379569864823256,y:0.11388637833537296},{x:0.5379702672090579,y:0.11391378915988949},{x:0.557924267209058,y:0.16807278915988946},{x:0.5580810067186996,y:0.16867450001810444},{x:0.5583366124011981,y:0.1692413235937006},{x:0.5591915686944892,y:0.17293786157308777},{x:0.5601479818122073,y:0.1766094575809222},{x:0.5601843216510317,y:0.17723018509512725},{x:0.5603244341481242,y:0.17783598350956487},{x:0.5696394341481241,y:0.2495799835095649},{x:0.569721927352796,y:0.25224539988339456},{x:0.5700114646960025,y:0.2548963275892337},{x:0.5750284646960026,y:0.7275053275892338},{x:0.5742570402937379,y:0.7362930758081182},{x:0.5717860339652341,y:0.7447614724740409},{x:0.5677104050979391,y:0.752585081852262},{x:0.5621867778235843,y:0.7594632470219072},{x:0.5554274220406369,y:0.7651316439528263},{x:0.5476920960011455,y:0.7693724393298378},{x:0.5392780639467868,y:0.7720226617648687},{x:0.5305086724107663,y:0.7729804646960026},{x:0.5217209241918819,y:0.7722090402937379},{x:0.5132525275259592,y:0.7697380339652341},{x:0.505428918147738,y:0.7656624050979391},{x:0.4985507529780929,y:0.7601387778235843},{x:0.49288235604717384,y:0.753379422040637},{x:0.48864156067016223,y:0.7456440960011456},{x:0.48599133823513135,y:0.7372300639467868},{x:0.4850335353039975,y:0.7284606724107663},{x:0.48004487037154997,y:0.258520878697574},{x:0.4717248917269394,y:0.19444051929027983},{x:0.4550625667192203,y:0.14921575933773623},{x:0.4467624246683876,y:0.135699076001046},{x:0.42448554918380393,y:0.11200409455592171},{x:0.3866565267646711,y:0.09145137140181527},{x:0.33852910612300163,y:0.08330987698295},{x:0.2625775703514966,y:0.09231733933890664},{x:0.20464797458906397,y:0.11524036210229632},{x:0.16911733402594603,y:0.14432255403825953},{x:0.14104265103985364,y:0.1897890642955865},{x:0.12498883901236212,y:0.25532548983758135},{x:0.11807553704626646,y:0.35278200048003916},{x:0.11702182362144292,y:0.7291299922181214},{x:0.11613258476624799,y:0.737906601393955},{x:0.11354820087598706,y:0.7463410885908555},{x:0.10936798837422372,y:0.7541093211959605},{x:0.10375259048311052,y:0.7609127703867312},{x:0.09691780379445152,y:0.7664899834261845},{x:0.0891262853276994,y:0.770626631144951},{x:0.08067745876799748,y:0.7731637444910576},{x:0.07189600778187862,y:0.7740038236214429},{x:0.06311939860604492,y:0.773114584766248},{x:0.05468491140914452,y:0.770530200875987},{x:0.04691667880403945,y:0.7663499883742237},{x:0.04011322961326877,y:0.7607345904831105},{x:0.03453601657381558,y:0.7538998037944515},{x:0.030399368855048972,y:0.7461082853276993},{x:0.027862255508942363,y:0.7376594587679974},{x:0.027022176378557076,y:0.7288780077818786}]],V:[[{x:-0.017163400590915968,y:0.72836062945125},{x:-0.016173311217885875,y:0.7195948244454146},{x:-0.01349212241321528,y:0.7111906087794154},{x:0.27875887758678475,y:0.033216608779415485},{x:0.2789749302503264,y:0.03282594254600198},{x:0.27911899522766415,y:0.032403397706182537},{x:0.2811076886540147,y:0.028969490703698003},{x:0.2830281292409603,y:0.025496951748158487},{x:0.28331624571443165,y:0.0251559418405784},{x:0.28353997693249255,y:0.024769621764193565},{x:0.2861603801951793,y:0.021789671162821947},{x:0.2887213787977949,y:0.018758515442121357},{x:0.2890704869266977,y:0.018480266679882864},{x:0.2893652865202418,y:0.018145017430816868},{x:0.2925166989914198,y:0.015733541060992128},{x:0.2956198378696305,y:0.013260254189586457},{x:0.29601652162435305,y:0.013055459516578674},{x:0.296371060610326,y:0.012784164535463174},{x:0.29993237527606087,y:0.011033834081706148},{x:0.30345840254303674,y:0.009213463087028258},{x:0.303887417589348,y:0.00908999264768462},{x:0.3042880712333465,y:0.00889307764850001},{x:0.3081224287682413,y:0.00787115732855266},{x:0.3119358411735324,y:0.006773658047051503},{x:0.31238070070379703,y:0.0067362567411129665},{x:0.3128120721109714,y:0.0066212890568466964},{x:0.3167721203052928,y:0.006367050695504971},{x:0.32072637054875,y:0.006034599409084053},{x:0.3211699788607,y:0.006084704547762943},{x:0.3216154906697884,y:0.006056102322046737},{x:0.325549047092249,y:0.006579316156958459},{x:0.3294921755545854,y:0.0070246887821141385},{x:0.32991748502957097,y:0.007160374853030322},{x:0.330360016471596,y:0.007219237253358143},{x:0.3341159167548444,y:0.008499796470269213},{x:0.33789639122058457,y:0.00970587758678474},{x:0.33828705745399834,y:0.009921930250326543},{x:0.33870960229381747,y:0.01006599522766418},{x:0.3421435092963017,y:0.012054688654014527},{x:0.34561604825184156,y:0.013975129240960359},{x:0.3459570581594215,y:0.014263245714431577},{x:0.34634337823580646,y:0.014486976932492547},{x:0.34932332883717915,y:0.01710738019518028},{x:0.35235448455787866,y:0.01966837879779494},{x:0.3526327333201171,y:0.020017486926697612},{x:0.35296798256918316,y:0.020312286520241793},{x:0.3553794589390082,y:0.023463698991420194},{x:0.3578527458104136,y:0.026566837869630475},{x:0.3580575404834214,y:0.026963521624353053},{x:0.35832883546453687,y:0.02731806061032596},{x:0.3600791659182934,y:0.03087937527605991},{x:0.3618995369129718,y:0.03440540254303673},{x:0.3620230073523154,y:0.034834417589348},{x:0.3622199223515,y:0.0352350712333465},{x:0.6163569223515,y:0.7132090712333464},{x:0.6186287109431533,y:0.7217330721109714},{x:0.6191938976779532,y:0.7305364906697883},{x:0.6180307627466418,y:0.7392810164715959},{x:0.6151840047723358,y:0.7476306022938175},{x:0.6107630230675074,y:0.7552643782358064},{x:0.6049377134797582,y:0.7618889825691831},{x:0.597931939389674,y:0.7672498354645368},{x:0.5900149287666535,y:0.7711409223515},{x:0.5814909278890286,y:0.7734127109431533},{x:0.5726875093302116,y:0.7739778976779532},{x:0.5639429835284039,y:0.7728147627466418},{x:0.5555933977061824,y:0.7699680047723358},{x:0.5479596217641935,y:0.7655470230675074},{x:0.5413350174308168,y:0.7597217134797583},{x:0.5359741645354631,y:0.7527159393896741},{x:0.5320830776484999,y:0.7447989287666535},{x:0.3171703309688009,y:0.17146543337864517},{x:0.06915612241321528,y:0.7468173912205845},{x:0.06488687075903964,y:0.7545370482518415},{x:0.059193621202205074,y:0.7612754845578786},{x:0.05229516213036956,y:0.7667737458104136},{x:0.04445659745696326,y:0.7708205369129717},{x:0.0359791588264676,y:0.7732603419529485},{x:0.027188629451250054,y:0.773999400590916},{x:0.01842282444541461,y:0.7730093112178859},{x:0.010018608779415478,y:0.7703281224132152},{x:0.0022989517481584835,y:0.7660588707590397},{x:-0.004439484557878664,y:0.7603656212022051},{x:-0.009937745810413578,y:0.7534671621303695},{x:-0.013984536912971763,y:0.7456285974569633},{x:-0.016424341952948517,y:0.7371511588264675},{x:-0.017163400590915968,y:0.72836062945125}]],W:[[{x:-0.04486424190193638,y:0.7324968210037928},{x:-0.04468360364824366,y:0.7236771280279449},{x:0.03511539635175633,y:0.05429612802794491},{x:0.03538914303981033,y:0.053053468981350556},{x:0.035486899606724354,y:0.05178477579191172},{x:0.03633616861564037,y:0.04875449496443272},{x:0.037013200434797444,y:0.04568114375463893},{x:0.03752411791055629,y:0.04451576738270255},{x:0.03786750587531561,y:0.043290523137271594},{x:0.039291634880795206,y:0.040484152470619886},{x:0.040555238800576446,y:0.03760193719815913},{x:0.041283692791972554,y:0.036558628261303676},{x:0.041859515947665654,y:0.035423918409107566},{x:0.04380377647068911,y:0.032949305154171604},{x:0.045605392901094464,y:0.030368987735599786},{x:0.046523389329760155,y:0.02948784001117424},{x:0.047309519115439125,y:0.028487270815480248},{x:0.049699194314460494,y:0.02643951297186818},{x:0.05196958814642765,y:0.024260253558522238},{x:0.05304184892442764,y:0.02357512905942291},{x:0.054008074813295476,y:0.022747151833295932},{x:0.056751330810561565,y:0.021204943586542027},{x:0.059403252082379655,y:0.019510489895534},{x:0.060588570829346225,y:0.019047717572039012},{x:0.06169776130235942,y:0.01842415101594414},{x:0.06468917630833097,y:0.01744675856409077},{x:0.06762071317273859,y:0.01630222750050557},{x:0.06887353875396018,y:0.016079591433481148},{x:0.07008306824328207,y:0.01568439886046892},{x:0.07320768385688461,y:0.015309382847312772},{x:0.07630617899620724,y:0.014758758098063603},{x:0.07757836602719018,y:0.014784814066709744},{x:0.07884175299285809,y:0.014633182505734484},{x:0.08197949198836539,y:0.014874954586349768},{x:0.08512587197205507,y:0.014939396351756326},{x:0.08636853101864941,y:0.015213143039810315},{x:0.08763722420808827,y:0.015310899606724347},{x:0.09066750503556728,y:0.016160168615640357},{x:0.09374085624536103,y:0.01683720043479743},{x:0.09490623261729739,y:0.017348117910556266},{x:0.09613147686272838,y:0.017691505875315594},{x:0.09893784752938008,y:0.01911563488079519},{x:0.10182006280184085,y:0.020379238800576432},{x:0.10286337173869634,y:0.02110769279197256},{x:0.1039980815908924,y:0.02168351594766564},{x:0.10647269484582828,y:0.023627776470689026},{x:0.1090530122644002,y:0.025429392901094458},{x:0.10993415998882576,y:0.026347389329760156},{x:0.11093472918451973,y:0.02713351911543911},{x:0.11298248702813177,y:0.02952319431446044},{x:0.11516174644147774,y:0.03179358814642764},{x:0.11584687094057705,y:0.032865848924427614},{x:0.11667484816670405,y:0.03383207481329547},{x:0.118217056413458,y:0.03657533081056164},{x:0.11991151010446596,y:0.039227252082379635},{x:0.12037428242796094,y:0.040412570829346184},{x:0.12099784898405583,y:0.041521761302359406},{x:0.2862381791186236,y:0.4176126753554925},{x:0.4644074439049092,y:0.03214939722735514},{x:0.46457066699968924,y:0.031871550040082325},{x:0.46468087848244366,y:0.03156873942729889},{x:0.4668033610072479,y:0.028070937443703255},{x:0.4688757411162635,y:0.024543219843286366},{x:0.46909003322228215,y:0.024302554657928657},{x:0.4692572024422568,y:0.02402706365982141},{x:0.47202128937582516,y:0.021010546759784428},{x:0.47474207284479647,y:0.017954914566682648},{x:0.47499919883659564,y:0.017760680011347015},{x:0.4752169015744166,y:0.01752309559247584},{x:0.47851637060601154,y:0.015103786828781735},{x:0.4817809992520572,y:0.012637666274559728},{x:0.4820710779219699,y:0.012497326674279732},{x:0.48233094798351184,y:0.012306779070622963},{x:0.4860390023686124,y:0.010577651122297159},{x:0.4897220183436901,y:0.008795813836836655},{x:0.4900339021311097,y:0.008714762363747632},{x:0.4903259528556443,y:0.008578574212853553},{x:0.49430009414373083,y:0.007606076497244536},{x:0.4982599612093785,y:0.006576997488159493},{x:0.4985816645952609,y:0.006558348904918078},{x:0.4988946726372282,y:0.006481753841050326},{x:0.5029821768073245,y:0.006303258899985619},{x:0.5070667194929276,y:0.00606648509648134},{x:0.5073858795965667,y:0.006110956057683261},{x:0.5077078162324508,y:0.006096897586191266},{x:0.5117516027915979,y:0.006719264880154805},{x:0.5158038544123874,y:0.0072838953667157535},{x:0.5161082060899873,y:0.007389776878261636},{x:0.5164266994754154,y:0.007438795258320738},{x:0.5202713679739276,y:0.008838107561233023},{x:0.5241356027726449,y:0.01018244390490916},{x:0.524413449959918,y:0.010345666999689355},{x:0.5247162605727012,y:0.010455878482443691},{x:0.5282140625562944,y:0.012578361007246536},{x:0.5317417801567137,y:0.014650741116263542},{x:0.5319824453420714,y:0.01486503322228222},{x:0.5322579363401786,y:0.01503220244225683},{x:0.535274453240215,y:0.01779628937582467},{x:0.5383300854333174,y:0.020517072844796484},{x:0.5385243199886531,y:0.020774198836595797},{x:0.5387619044075241,y:0.0209919015744166},{x:0.5411812131712181,y:0.024291370606011366},{x:0.5436473337254403,y:0.027555999252057217},{x:0.5437876733257202,y:0.027846077921969747},{x:0.5439782209293771,y:0.028105947983511865},{x:0.5457073488777034,y:0.03181400236861376},{x:0.5474891861631633,y:0.0354970183436901},{x:0.5475702376362523,y:0.03580890213110964},{x:0.5477064257871465,y:0.03610095285564429},{x:0.548678923502756,y:0.040075094143733274},{x:0.5497080025118405,y:0.04403496120937851},{x:0.5497266510950819,y:0.04435666459526063},{x:0.5498032461589497,y:0.04466967263722821},{x:0.6466002461589497,y:0.7226436726372282},{x:0.6469851024138088,y:0.7314568162324507},{x:0.6456432047416794,y:0.7401756994754154},{x:0.6426261215175564,y:0.7484652605727011},{x:0.6380497975577433,y:0.7560069363401786},{x:0.6320900984255835,y:0.7625109044075241},{x:0.6249760520164882,y:0.7677272209293771},{x:0.6169810471443558,y:0.7714554257871464},{x:0.6084123273627718,y:0.7735522461589497},{x:0.5995991837675493,y:0.7739371024138088},{x:0.5908803005245846,y:0.7725952047416793},{x:0.5825907394272989,y:0.7695781215175563},{x:0.5750490636598214,y:0.7650017975577432},{x:0.5685450955924759,y:0.7590420984255835},{x:0.563328779070623,y:0.7519280520164882},{x:0.5596005742128536,y:0.7439330471443557},{x:0.5575037538410503,y:0.7353643273627718},{x:0.4822251865940539,y:0.2081071670095049},{x:0.3260455560950909,y:0.5459966027726448},{x:0.3245096626856286,y:0.5486110836728201},{x:0.32313748405233433,y:0.5513150815908924},{x:0.32228015650766817,y:0.5524062697730983},{x:0.32157725888373645,y:0.5536027801567136},{x:0.3195608173147473,y:0.5558673865996665},{x:0.3176874808845609,y:0.5582517291845196},{x:0.31663374639442166,y:0.5591546941850146},{x:0.31571092715520355,y:0.5601910854333173},{x:0.3132914281453504,y:0.5620187898634509},{x:0.3109889251867045,y:0.563991848166704},{x:0.30977927817660644,y:0.5646718895469083},{x:0.3086720007479428,y:0.5655083337254402},{x:0.3059424242873038,y:0.566828898486493},{x:0.3032992386976406,y:0.5683148489840557},{x:0.30198016522380455,y:0.5687458331350992},{x:0.3007309816563099,y:0.5693501861631632},{x:0.29779622383750376,y:0.570112862691949},{x:0.29491393175671793,y:0.571054601139531},{x:0.29353612307299787,y:0.5712199655821879},{x:0.29219303879062153,y:0.5715690025118404},{x:0.28916588071079274,y:0.5717444815770724},{x:0.2861552470071419,y:0.5721058174942654},{x:0.2847716515285703,y:0.5719992073657418},{x:0.2833862805070725,y:0.5720795149035186},{x:0.28038305415357795,y:0.5716610529431293},{x:0.27735977579191173,y:0.5714281003932755},{x:0.27602356431680025,y:0.5710536126610233},{x:0.27464914558761266,y:0.5708621046332842},{x:0.27178526326499086,y:0.5698657829057354},{x:0.26886552313727163,y:0.5690474941246844},{x:0.26762804552325165,y:0.5684195201422382},{x:0.26631739722735515,y:0.5679635560950907},{x:0.26370291632718046,y:0.5664276626856288},{x:0.2609989184091076,y:0.5650554840523343},{x:0.25990773022690183,y:0.5641981565076682},{x:0.2587112198432863,y:0.5634952588837364},{x:0.25644661340033337,y:0.5614788173147471},{x:0.2540622708154803,y:0.5596054808845607},{x:0.2531593058149851,y:0.5585517463944213},{x:0.2521229145666826,y:0.5576289271552034},{x:0.2502952101365493,y:0.5552094281453507},{x:0.24832215183329598,y:0.5529069251867045},{x:0.2476421104530918,y:0.5516972781766065},{x:0.24680566627455972,y:0.5505900007479427},{x:0.245485101513507,y:0.5478604242873037},{x:0.24399915101594416,y:0.5452172386976405},{x:0.10495542809967917,y:0.22875042455884986},{x:0.04468360364824366,y:0.734330871972055},{x:0.04278579956520255,y:0.742945856245361},{x:0.03924376119942353,y:0.7510250628018409},{x:0.034193607098905524,y:0.7582580122644001},{x:0.02782941185357234,y:0.7643667464414777},{x:0.020395747917620333,y:0.7691165101044659},{x:0.012178286827261426,y:0.7723247724994944},{x:0.003492821003792758,y:0.7738682419019364},{x:-0.00532687197205508,y:0.7736876036482436},{x:-0.013941856245361059,y:0.7717897995652026},{x:-0.022021062801840872,y:0.7682477611994235},{x:-0.029254012264400202,y:0.7631976070989055},{x:-0.035362746441477744,y:0.7568334118535723},{x:-0.04011251010446598,y:0.7493997479176203},{x:-0.04332077249949441,y:0.7411822868272614},{x:-0.04486424190193638,y:0.7324968210037928}]],X:[[{x:-0.03582341524240513,y:0.7325834270170574},{x:-0.035659804156077404,y:0.7237634017461555},{x:-0.03377863524060577,y:0.7151447697271875},{x:-0.030252200762440104,y:0.7070587401552579},{x:-0.02521601962092907,y:0.6998160546121182},{x:0.24190189785100796,y:0.3863717955888736},{x:-0.0190039697420246,y:0.08021800391719859},{x:-0.024040163260448045,y:0.07297532698032597},{x:-0.027566611556706647,y:0.06488930343468059},{x:-0.029447795200430175,y:0.056270674630427356},{x:-0.029611421359170286,y:0.047450649639130975},{x:-0.028051201971409197,y:0.03876817707487998},{x:-0.024827095393237467,y:0.030556919489131844},{x:-0.02006300223235442,y:0.02313243090598055},{x:-0.013942003917198569,y:0.016780030257975413},{x:-0.006699326980325947,y:0.011743836739551976},{x:0.0013866965653194212,y:0.00821738844329338},{x:0.010005325369572668,y:0.006336204799569846},{x:0.018825350360869044,y:0.0061725786408297345},{x:0.02750782292512003,y:0.007732798028590823},{x:0.03571908051086817,y:0.010956904606762553},{x:0.04314356909401947,y:0.0157209977676456},{x:0.049495969742024595,y:0.021841996082801452},{x:0.3010259353438819,y:0.31699385831754345},{x:0.5525549803790709,y:0.021842054612118165},{x:0.558907370566982,y:0.01572104544144637},{x:0.5663318510088331,y:0.010956939592969957},{x:0.5745431030849405,y:0.007732818982704524},{x:0.5832255729829426,y:0.006172584757594898},{x:0.5920455982538445,y:0.006336195843922615},{x:0.6006642302728125,y:0.008217364759394247},{x:0.6087502598447422,y:0.011743799237559922},{x:0.6159929453878819,y:0.016779980379070948},{x:0.6221139545585537,y:0.023132370566981995},{x:0.6268780604070301,y:0.03055685100883309},{x:0.6301021810172955,y:0.0387681030849405},{x:0.6316624152424052,y:0.04745057298294264},{x:0.6314988041560774,y:0.05627059825384449},{x:0.6296176352406058,y:0.06488923027281246},{x:0.6260912007624402,y:0.07297525984474214},{x:0.6210550196209291,y:0.08021794538788188},{x:0.36015009139561527,y:0.3863716945525663},{x:0.6272689697420246,y:0.6998159960828014},{x:0.632305163260448,y:0.7070586730196741},{x:0.6358316115567066,y:0.7151446965653194},{x:0.6377127952004301,y:0.7237633253695727},{x:0.6378764213591702,y:0.7325833503608691},{x:0.6363162019714091,y:0.74126582292512},{x:0.6330920953932374,y:0.7494770805108681},{x:0.6283280022323544,y:0.7569015690940195},{x:0.6222070039171985,y:0.7632539697420246},{x:0.6149643269803259,y:0.7682901632604481},{x:0.6068783034346805,y:0.7718166115567067},{x:0.5982596746304273,y:0.7736977952004301},{x:0.5894396496391309,y:0.7738614213591702},{x:0.58075717707488,y:0.7723012019714092},{x:0.5725459194891318,y:0.7690770953932374},{x:0.5651214309059804,y:0.7643130022323544},{x:0.5587690302579753,y:0.7581920039171985},{x:0.30102605390274134,y:0.4557496318238965},{x:0.04328401962092907,y:0.7581919453878818},{x:0.03693162943301802,y:0.7643129545585536},{x:0.029507148991166913,y:0.76907706040703},{x:0.021295896915059523,y:0.7723011810172955},{x:0.012613427017057378,y:0.7738614152424051},{x:0.003793401746155514,y:0.7736978041560774},{x:-0.004825230272812429,y:0.7718166352406057},{x:-0.012911259844742107,y:0.7682902007624401},{x:-0.02015394538788185,y:0.7632540196209291},{x:-0.02627495455855365,y:0.756901629433018},{x:-0.031039060407030063,y:0.7494771489911669},{x:-0.034263181017295495,y:0.7412658969150595},{x:-0.03582341524240513,y:0.7325834270170574}]],Y:[[{x:-0.02688005049839745,y:0.731186349993587},{x:-0.02644216088936969,y:0.7223756821949907},{x:-0.024293809188388457,y:0.7138197369324374},{x:-0.020517555346512936,y:0.7058473143841377},{x:-0.015258518681138845,y:0.6987647902776368},{x:0.25043465103960333,y:0.4059541390643743},{x:0.26029423204414154,y:0.04978477430584237},{x:0.26140149479875585,y:0.04103299828270508},{x:0.26419486861258723,y:0.03266540142918031},{x:0.26856700569651215,y:0.025003545799746604},{x:0.27434988727431814,y:0.01834187220942495},{x:0.28132128045004745,y:0.012936385038381841},{x:0.28921327849355916,y:0.008994814127168342},{x:0.2977225963459245,y:0.006668631835443931},{x:0.30652222569415766,y:0.00604723204414153},{x:0.3152740017172949,y:0.007154494798755871},{x:0.32364159857081976,y:0.009947868612587236},{x:0.3313034542002534,y:0.014320005696512164},{x:0.3379651277905751,y:0.020102887274318144},{x:0.3433706149616182,y:0.027074280450047443},{x:0.3473121858728317,y:0.03496627849355913},{x:0.3496383681645561,y:0.04347559634592452},{x:0.3502597679558585,y:0.05227522569415767},{x:0.34045421751128274,y:0.4064927803087797},{x:0.6166036868780955,y:0.6970396048261934},{x:0.6220250193382449,y:0.7039986829780357},{x:0.6259845336177533,y:0.7118816938899454},{x:0.6283300678033804,y:0.7203856978734211},{x:0.6289714843317633,y:0.7291838908244783},{x:0.6278841339254269,y:0.7379381631220915},{x:0.6251098028506934,y:0.7463120929913156},{x:0.620755107094902,y:0.7539838750034306},{x:0.6149873951738065,y:0.7606586868780956},{x:0.6080283170219642,y:0.7660800193382449},{x:0.6001453061100546,y:0.7700395336177532},{x:0.5916413021265788,y:0.7723850678033803},{x:0.5828431091755216,y:0.7730264843317632},{x:0.5740888368779085,y:0.7719391339254268},{x:0.5657149070086843,y:0.7691648028506933},{x:0.5580431249965694,y:0.7648101070949019},{x:0.5513683131219045,y:0.7590423951738065},{x:0.29567976193894085,y:0.4900232412279098},{x:0.051392518681138845,y:0.7592432097223631},{x:0.04485280102201476,y:0.765163657957578},{x:0.03728372005126494,y:0.7696945108160528},{x:0.028976151305805796,y:0.7726616501633681},{x:0.02024934999358704,y:0.7739510504983974},{x:0.011438682194990706,y:0.7735131608893697},{x:0.002882736932437466,y:0.7713648091883885},{x:-0.0050896856158622154,y:0.7675885553465129},{x:-0.012172209722363214,y:0.7623295186811389},{x:-0.01809265795757798,y:0.7557898010220148},{x:-0.022623510816052815,y:0.7482207200512649},{x:-0.025590650163368103,y:0.7399131513058058},{x:-0.02688005049839745,y:0.731186349993587}]],Z:[[{x:0.008711000000000003,y:0.05103000000000002},{x:0.00905278632815029,y:0.04755978517413498},{x:0.009251179439517476,y:0.04407842782316871},{x:0.009484424544736794,y:0.043177288815328604},{x:0.009575662381854637,y:0.04225093550927423},{x:0.01058788670939069,y:0.038914079093048184},{x:0.01146164687940622,y:0.0355383196233794},{x:0.011866213744552238,y:0.0346999996115786},{x:0.012136421036992098,y:0.03380924554357098},{x:0.013780184150668652,y:0.030733981057728944},{x:0.015295733266009179,y:0.0275935480126292},{x:0.015856074613338045,y:0.026850263164785913},{x:0.01629486744638546,y:0.026029339514117927},{x:0.01850700045157689,y:0.023333847648222647},{x:0.020606096809669634,y:0.02054942610843994},{x:0.02130067903544657,y:0.01992974044441782},{x:0.021891194846605365,y:0.019210194846605383},{x:0.024586686712500538,y:0.016998061841414044},{x:0.027188663217490867,y:0.014676655565200585},{x:0.02799079391630549,y:0.014204383257544266},{x:0.028710339514117916,y:0.013613867446385479},{x:0.03178560399995988,y:0.01197010433270896},{x:0.03479046815396611,y:0.010200923661400137},{x:0.035669321892902964,y:0.00989421387003954},{x:0.036490245543570964,y:0.009455421036992116},{x:0.03982710195979704,y:0.008443196709456058},{x:0.04311937851852794,y:0.007294230264082269},{x:0.04404118144126662,y:0.007164869674294513},{x:0.04493193550927423,y:0.006894662381854655},{x:0.048402150335139275,y:0.006552876053704368},{x:0.05185531895677298,y:0.006068277970413476},{x:0.052784646693945655,y:0.006121237837117864},{x:0.053711,y:0.0060300000000000215},{x:0.548341,y:0.0060300000000000215},{x:0.5571200644907257,y:0.006894662381854655},{x:0.565561754456429,y:0.009455421036992116},{x:0.5733416604858821,y:0.013613867446385479},{x:0.5801608051533946,y:0.019210194846605383},{x:0.5857571325536145,y:0.026029339514117927},{x:0.5899155789630078,y:0.03380924554357098},{x:0.5924763376181453,y:0.04225093550927425},{x:0.593341,y:0.05103000000000002},{x:0.5924763376181453,y:0.05980906449072579},{x:0.5899155789630078,y:0.06825075445642906},{x:0.5857571325536145,y:0.07603066048588211},{x:0.5801608051533946,y:0.08284980515339466},{x:0.5733416604858821,y:0.08844613255361455},{x:0.565561754456429,y:0.09260457896300792},{x:0.5571200644907257,y:0.09516533761814538},{x:0.548341,y:0.09603000000000002},{x:0.14224494935878249,y:0.09603000000000002},{x:0.5846943444347994,y:0.7024816632174908},{x:0.5851666167424556,y:0.7032837939163054},{x:0.5857571325536145,y:0.7040033395141179},{x:0.5874008956672913,y:0.7070786039999603},{x:0.5891700763385999,y:0.7100834681539662},{x:0.5894767861299605,y:0.7109623218929031},{x:0.5899155789630078,y:0.711783245543571},{x:0.5909278032905438,y:0.7151201019597967},{x:0.5920767697359177,y:0.7184123785185279},{x:0.5922061303257055,y:0.7193341814412667},{x:0.5924763376181453,y:0.7202249355092742},{x:0.5928181239462956,y:0.7236951503351391},{x:0.5933027220295866,y:0.7271483189567729},{x:0.5932497621628822,y:0.7280776466939456},{x:0.593341,y:0.729004},{x:0.5929992136718496,y:0.7324742148258655},{x:0.5928008205604824,y:0.7359555721768313},{x:0.5925675754552632,y:0.7368567111846711},{x:0.5924763376181453,y:0.7377830644907257},{x:0.5914641132906093,y:0.7411199209069517},{x:0.5905903531205937,y:0.7444956803766206},{x:0.5901857862554476,y:0.7453340003884216},{x:0.5899155789630078,y:0.746224754456429},{x:0.5882718158493319,y:0.74930001894227},{x:0.5867562667339908,y:0.7524404519873709},{x:0.5861959253866618,y:0.7531837368352144},{x:0.5857571325536145,y:0.7540046604858821},{x:0.5835449995484229,y:0.7567001523517777},{x:0.5814459031903303,y:0.7594845738915601},{x:0.5807513209645536,y:0.760104259555582},{x:0.5801608051533946,y:0.7608238051533946},{x:0.5774653132874991,y:0.7630359381585863},{x:0.5748633367825091,y:0.7653573444347994},{x:0.5740612060836946,y:0.7658296167424556},{x:0.5733416604858821,y:0.7664201325536145},{x:0.5702663960000408,y:0.7680638956672906},{x:0.5672615318460339,y:0.7698330763385999},{x:0.5663826781070966,y:0.7701397861299606},{x:0.565561754456429,y:0.7705785789630079},{x:0.5622248980402041,y:0.7715908032905435},{x:0.558932621481472,y:0.7727397697359177},{x:0.5580108185587332,y:0.7728691303257055},{x:0.5571200644907257,y:0.7731393376181454},{x:0.553649849664861,y:0.7734811239462956},{x:0.5501966810432269,y:0.7739657220295866},{x:0.5492673533060543,y:0.7739127621628822},{x:0.548341,y:0.774004},{x:0.053711,y:0.774004},{x:0.04493193550927421,y:0.7731393376181454},{x:0.036490245543570936,y:0.7705785789630079},{x:0.028710339514117906,y:0.7664201325536145},{x:0.021891194846605358,y:0.7608238051533946},{x:0.01629486744638546,y:0.7540046604858821},{x:0.012136421036992098,y:0.746224754456429},{x:0.009575662381854637,y:0.7377830644907257},{x:0.008711000000000003,y:0.729004},{x:0.009575662381854637,y:0.7202249355092742},{x:0.012136421036992098,y:0.711783245543571},{x:0.01629486744638546,y:0.7040033395141179},{x:0.021891194846605365,y:0.6971841948466053},{x:0.028710339514117916,y:0.6915878674463855},{x:0.036490245543570964,y:0.6874294210369921},{x:0.04493193550927423,y:0.6848686623818546},{x:0.053711,y:0.684004},{x:0.4598070506412174,y:0.684004},{x:0.017357655565200567,y:0.07755233678250915},{x:0.016885383257544267,y:0.07675020608369457},{x:0.01629486744638546,y:0.07603066048588211},{x:0.014651104332708876,y:0.07295539600004002},{x:0.012881923661400112,y:0.06995053184603389},{x:0.012575213870039523,y:0.06907167810709706},{x:0.012136421036992098,y:0.06825075445642906},{x:0.011124196709456038,y:0.06491389804020298},{x:0.00997523026408225,y:0.06162162148147208},{x:0.009845869674294495,y:0.0606998185587334},{x:0.009575662381854637,y:0.05980906449072579},{x:0.009233876053704348,y:0.056338849664860746},{x:0.008749277970413458,y:0.05288568104322705},{x:0.008802237837117845,y:0.05195635330605437},{x:0.008711000000000003,y:0.05103000000000002}]],"[":[[{x:0.152511,y:-0.06942399999999993},{x:0.15337566238185463,y:-0.0782030644907257},{x:0.1559364210369921,y:-0.08664475445642897},{x:0.16009486744638546,y:-0.09442466048588202},{x:0.16569119484660536,y:-0.10124380515339457},{x:0.1725103395141179,y:-0.10684013255361446},{x:0.18029024554357093,y:-0.11099857896300783},{x:0.1887319355092742,y:-0.1135593376181453},{x:0.197511,y:-0.11442399999999993},{x:0.404542,y:-0.11442399999999993},{x:0.4133210644907258,y:-0.1135593376181453},{x:0.4217627544564291,y:-0.11099857896300783},{x:0.42954266048588213,y:-0.10684013255361446},{x:0.4363618051533946,y:-0.10124380515339457},{x:0.44195813255361455,y:-0.09442466048588202},{x:0.44611657896300794,y:-0.08664475445642897},{x:0.4486773376181454,y:-0.0782030644907257},{x:0.449542,y:-0.06942399999999993},{x:0.4486773376181454,y:-0.06064493550927416},{x:0.44611657896300794,y:-0.05220324554357089},{x:0.44195813255361455,y:-0.04442333951411784},{x:0.4363618051533946,y:-0.03760419484660529},{x:0.42954266048588213,y:-0.032007867446385396},{x:0.4217627544564291,y:-0.027849421036992027},{x:0.4133210644907258,y:-0.025288662381854565},{x:0.404542,y:-0.024423999999999932},{x:0.24251099999999998,y:-0.024423999999999932},{x:0.24251099999999998,y:0.7147659999999999},{x:0.404542,y:0.7147659999999999},{x:0.4133210644907258,y:0.7156306623818546},{x:0.4217627544564291,y:0.7181914210369921},{x:0.42954266048588213,y:0.7223498674463854},{x:0.4363618051533946,y:0.7279461948466053},{x:0.44195813255361455,y:0.7347653395141178},{x:0.44611657896300794,y:0.7425452455435709},{x:0.4486773376181454,y:0.7509869355092742},{x:0.449542,y:0.7597659999999999},{x:0.4486773376181454,y:0.7685450644907257},{x:0.44611657896300794,y:0.776986754456429},{x:0.44195813255361455,y:0.7847666604858821},{x:0.4363618051533946,y:0.7915858051533946},{x:0.42954266048588213,y:0.7971821325536145},{x:0.4217627544564291,y:0.8013405789630078},{x:0.4133210644907258,y:0.8039013376181453},{x:0.404542,y:0.804766},{x:0.197511,y:0.804766},{x:0.1887319355092742,y:0.8039013376181453},{x:0.18029024554357093,y:0.8013405789630078},{x:0.1725103395141179,y:0.7971821325536145},{x:0.16569119484660536,y:0.7915858051533946},{x:0.16009486744638546,y:0.7847666604858821},{x:0.1559364210369921,y:0.776986754456429},{x:0.15337566238185463,y:0.7685450644907257},{x:0.152511,y:0.7597659999999999},{x:0.152511,y:-0.06942399999999993}]],"\\":[[{x:0.017522651058219416,y:0.7303997530123288},{x:0.018114599516431164,y:0.7215980934307649},{x:0.020412292453046287,y:0.7130810386853763},{x:0.024327430817071727,y:0.7051758944136092},{x:0.5013774308170718,y:-0.059077105586390885},{x:0.5067595580368128,y:-0.06606654912342862},{x:0.5134018419815468,y:-0.0718716915303336},{x:0.521049023404313,y:-0.07626944443996993},{x:0.5294072254116235,y:-0.07909080467430848},{x:0.5381552469876711,y:-0.08022734894178067},{x:0.5469569065692351,y:-0.07963540048356893},{x:0.5554739613146237,y:-0.0773377075469538},{x:0.5633791055863908,y:-0.07342256918292836},{x:0.5703685491234285,y:-0.06804044196318723},{x:0.5761736915303335,y:-0.06139815801845332},{x:0.5805714444399699,y:-0.05375097659568702},{x:0.5833928046743084,y:-0.04539277458837649},{x:0.5845293489417805,y:-0.03664475301232898},{x:0.5839374004835688,y:-0.02784309343076498},{x:0.5816397075469537,y:-0.01932603868537643},{x:0.5777245691829282,y:-0.011420894413609283},{x:0.10067456918292828,y:0.7528321055863908},{x:0.09529244196318712,y:0.7598215491234285},{x:0.0886501580184532,y:0.7656266915303336},{x:0.08100297659568693,y:0.7700244444399699},{x:0.07264477458837638,y:0.7728458046743084},{x:0.06389675301232887,y:0.7739823489417805},{x:0.055095093430764894,y:0.7733904004835688},{x:0.04657803868537634,y:0.7710927075469537},{x:0.03867289441360919,y:0.7671775691829282},{x:0.03168345087657147,y:0.7617954419631872},{x:0.025878308469666468,y:0.7551531580184532},{x:0.021480555560030153,y:0.747505976595687},{x:0.01865919532569161,y:0.7391477745883763},{x:0.017522651058219416,y:0.7303997530123288}]],"]":[[{x:0.15250999999999998,y:-0.06942399999999993},{x:0.15337466238185463,y:-0.0782030644907257},{x:0.1559354210369921,y:-0.08664475445642897},{x:0.16009386744638546,y:-0.09442466048588202},{x:0.16569019484660535,y:-0.10124380515339457},{x:0.1725093395141179,y:-0.10684013255361446},{x:0.18028924554357095,y:-0.11099857896300783},{x:0.18873093550927422,y:-0.1135593376181453},{x:0.19751,y:-0.11442399999999993},{x:0.404542,y:-0.11442399999999993},{x:0.4133210644907258,y:-0.1135593376181453},{x:0.4217627544564291,y:-0.11099857896300783},{x:0.42954266048588213,y:-0.10684013255361446},{x:0.4363618051533946,y:-0.10124380515339457},{x:0.44195813255361455,y:-0.09442466048588202},{x:0.44611657896300794,y:-0.08664475445642897},{x:0.4486773376181454,y:-0.0782030644907257},{x:0.449542,y:-0.06942399999999993},{x:0.449542,y:0.7597659999999999},{x:0.4486773376181454,y:0.7685450644907257},{x:0.44611657896300794,y:0.776986754456429},{x:0.44195813255361455,y:0.7847666604858821},{x:0.4363618051533946,y:0.7915858051533946},{x:0.42954266048588213,y:0.7971821325536145},{x:0.4217627544564291,y:0.8013405789630078},{x:0.4133210644907258,y:0.8039013376181453},{x:0.404542,y:0.804766},{x:0.19751,y:0.804766},{x:0.18873093550927422,y:0.8039013376181453},{x:0.18028924554357095,y:0.8013405789630078},{x:0.1725093395141179,y:0.7971821325536145},{x:0.16569019484660535,y:0.7915858051533946},{x:0.16009386744638546,y:0.7847666604858821},{x:0.1559354210369921,y:0.776986754456429},{x:0.15337466238185463,y:0.7685450644907257},{x:0.15250999999999998,y:0.7597659999999999},{x:0.15337466238185463,y:0.7509869355092742},{x:0.1559354210369921,y:0.7425452455435709},{x:0.16009386744638546,y:0.7347653395141178},{x:0.16569019484660535,y:0.7279461948466053},{x:0.1725093395141179,y:0.7223498674463854},{x:0.18028924554357095,y:0.7181914210369921},{x:0.18873093550927422,y:0.7156306623818546},{x:0.19751,y:0.7147659999999999},{x:0.35954200000000003,y:0.7147659999999999},{x:0.35954200000000003,y:-0.024423999999999932},{x:0.19751,y:-0.024423999999999932},{x:0.18873093550927422,y:-0.025288662381854565},{x:0.18028924554357095,y:-0.027849421036992027},{x:0.1725093395141179,y:-0.03200786744638539},{x:0.16569019484660535,y:-0.03760419484660529},{x:0.16009386744638546,y:-0.04442333951411784},{x:0.1559354210369921,y:-0.052203245543570885},{x:0.15337466238185463,y:-0.06064493550927414},{x:0.15250999999999998,y:-0.06942399999999993}]],"^":[[{x:-0.009830024293871129,y:0.4771904357900641},{x:-0.009184411720694952,y:0.46839254975009553},{x:-0.006834821991481832,y:0.4598896653882279},{x:-0.002871548521860348,y:0.4520085437820153},{x:0.002553102311361327,y:0.44505205201500053},{x:0.009230664218841726,y:0.43928752416454453},{x:0.016904522241296224,y:0.4349364878031557},{x:0.02527977431847106,y:0.43216615081811305},{x:0.034034564209935884,y:0.43108297570612886},{x:0.04283245024990444,y:0.431728588279305},{x:0.05133533461177206,y:0.4340781780085181},{x:0.05921645621798466,y:0.4380414514781396},{x:0.06617294798499941,y:0.4434661023113613},{x:0.30102423332324457,y:0.6668931783680099},{x:0.5358792969655858,y:0.44346586927801307},{x:0.5428358294884947,y:0.4380412707099504},{x:0.5507169808710617,y:0.43407805645230807},{x:0.5592198828854552,y:0.4317285306064111},{x:0.5680177737757447,y:0.431082984132888},{x:0.5767725555289304,y:0.4321662250206897},{x:0.5851477867919753,y:0.43493662492998636},{x:0.5928216121243246,y:0.439287718945922},{x:0.5994991307219868,y:0.44505229696558585},{x:0.6049237292900496,y:0.45200882948849475},{x:0.6088869435476919,y:0.4598899808710617},{x:0.6112364693935889,y:0.4683928828854553},{x:0.6118820158671119,y:0.47719077377574476},{x:0.6107987749793102,y:0.4859455555289303},{x:0.6080283750700135,y:0.4943207867919753},{x:0.6036772810540779,y:0.5019946121243246},{x:0.5979127030344141,y:0.5086721307219868},{x:0.33204070303441413,y:0.7616071307219868},{x:0.3294429315385385,y:0.7636328335402047},{x:0.3269493357811583,y:0.7657854758354554},{x:0.3259710287822201,y:0.7663401706594313},{x:0.32508417051150523,y:0.7670317292900496},{x:0.3221411194513825,y:0.7685117087189752},{x:0.3192754777587038,y:0.7701365121968442},{x:0.31820775306259985,y:0.7704896904878621},{x:0.3172030191289383,y:0.7709949435476919},{x:0.31402778830632944,y:0.7718723248078522},{x:0.310900225681529,y:0.7729068491818869},{x:0.30978411534954325,y:0.7730449384962876},{x:0.3087001171145447,y:0.7733444693935889},{x:0.30541472886927135,y:0.7735855352151975},{x:0.30214543579006414,y:0.7739900242938711},{x:0.3010238313163334,y:0.7739077179367437},{x:0.2999022262242552,y:0.773990015867112},{x:0.29663293618411596,y:0.7735855022258356},{x:0.2933475497500956,y:0.7733444117206949},{x:0.29226355376554153,y:0.7730448726791859},{x:0.29114744447106966,y:0.7729067749793103},{x:0.2880198896188706,y:0.7718722271075298},{x:0.28484466538822795,y:0.7709948219914818},{x:0.28383993525062523,y:0.7704895613829726},{x:0.2827722132080247,y:0.7701363750700135},{x:0.27990658372278143,y:0.7685115500622604},{x:0.2769635437820154,y:0.7670315485218604},{x:0.2760766907070934,y:0.7663399832281829},{x:0.2750983878756754,y:0.765785281054078},{x:0.27260480829144085,y:0.7636326200241867},{x:0.2700070520150006,y:0.7616068976886387},{x:0.004139052015000585,y:0.5086718976886386},{x:-0.001625475835455463,y:0.5019943357811583},{x:-0.0059765121968442594,y:0.49432047775870375},{x:-0.00874684918188691,y:0.4859452256815289},{x:-0.009830024293871129,y:0.4771904357900641}]],_:[[{x:-0.045,y:-0.160601},{x:-0.044135337618145365,y:-0.16938006449072576},{x:-0.041574578963007904,y:-0.17782175445642903},{x:-0.03741613255361454,y:-0.1856016604858821},{x:-0.03181980515339464,y:-0.19242080515339463},{x:-0.025000660485882086,y:-0.19801713255361453},{x:-0.017220754456429038,y:-0.2021755789630079},{x:-0.008779064490725769,y:-0.20473633761814536},{x:0,y:-0.20560099999999998},{x:0.602052,y:-0.20560099999999998},{x:0.6108310644907258,y:-0.20473633761814536},{x:0.619272754456429,y:-0.2021755789630079},{x:0.6270526604858822,y:-0.19801713255361453},{x:0.6338718051533947,y:-0.19242080515339463},{x:0.6394681325536146,y:-0.1856016604858821},{x:0.6436265789630079,y:-0.17782175445642903},{x:0.6461873376181454,y:-0.16938006449072576},{x:0.6470520000000001,y:-0.160601},{x:0.6461873376181454,y:-0.15182193550927423},{x:0.6436265789630079,y:-0.14338024554357096},{x:0.6394681325536146,y:-0.1356003395141179},{x:0.6338718051533947,y:-0.12878119484660536},{x:0.6270526604858822,y:-0.12318486744638546},{x:0.619272754456429,y:-0.1190264210369921},{x:0.6108310644907258,y:-0.11646566238185463},{x:0.602052,y:-0.115601},{x:0,y:-0.115601},{x:-0.00877906449072579,y:-0.11646566238185463},{x:-0.017220754456429066,y:-0.1190264210369921},{x:-0.025000660485882096,y:-0.12318486744638546},{x:-0.03181980515339464,y:-0.12878119484660536},{x:-0.03741613255361454,y:-0.1356003395141179},{x:-0.041574578963007904,y:-0.14338024554357096},{x:-0.044135337618145365,y:-0.15182193550927423},{x:-0.045,y:-0.160601}]],a:[[{x:0.029951000000000005,y:0.25490100000000004},{x:0.030216131121475042,y:0.2522090785486062},{x:0.03027571711850824,y:0.2495047884160563},{x:0.03064747136410999,y:0.24782960757010103},{x:0.03081566238185464,y:0.24612193550927428},{x:0.0316008669059687,y:0.24353346308961055},{x:0.0321868888075612,y:0.2408927597850148},{x:0.06949088880756119,y:0.12701175978501478},{x:0.07014919013856018,y:0.12551652306247207},{x:0.07061771774296957,y:0.1239514111231075},{x:0.07192248021942128,y:0.12148874987750752},{x:0.07304546130734973,y:0.1189380599695235},{x:0.0739828197765546,y:0.11759998201998349},{x:0.07474768294666384,y:0.11615634846888903},{x:0.07650781615341086,y:0.11399555310027064},{x:0.07810683439013419,y:0.11171295672570881},{x:0.07928722783725009,y:0.11058345913436952},{x:0.08031903331037206,y:0.10931678199931477},{x:0.15605303331037207,y:0.033026781999314685},{x:0.1581401110567553,y:0.03130114899494214},{x:0.16009013354595797,y:0.02942202284781055},{x:0.16153164054777758,y:0.028496972085311937},{x:0.16285166496406625,y:0.027405552418137233},{x:0.16523529439528092,y:0.026120245637685162},{x:0.16751444707429886,y:0.024657656887915},{x:0.24324744707429888,y:-0.014037343112084925},{x:0.24491821916217926,y:-0.014693433733650136},{x:0.24650124554357095,y:-0.015539578963007873},{x:0.24901423193062222,y:-0.016301885049470277},{x:0.2514585861893129,y:-0.017261751399011975},{x:0.25322525179064753,y:-0.017579283958613606},{x:0.2549429355092742,y:-0.018100337618145335},{x:0.2575563541074305,y:-0.01835773688343746},{x:0.2601410014196699,y:-0.018822289810772906},{x:0.26193566856615697,y:-0.018789061710219754},{x:0.263722,y:-0.018964999999999968},{x:0.376759,y:-0.018964999999999968},{x:0.3786816094876915,y:-0.018775639493449434},{x:0.3806133727303473,y:-0.01879962736385296},{x:0.3830607170270406,y:-0.018344335046447002},{x:0.3855380644907258,y:-0.018100337618145335},{x:0.3873867891740171,y:-0.01753953311656589},{x:0.3892861139289994,y:-0.017186191753697247},{x:0.3915976100664607,y:-0.016262194563578608},{x:0.3939797544564291,y:-0.015539578963007873},{x:0.3956835488825182,y:-0.014628881868892333},{x:0.3974774451646465,y:-0.013911789983170525},{x:0.4720844451646465,y:0.0247832100168294},{x:0.4742399118062311,y:0.026185049737888398},{x:0.4765030886255536,y:0.02740538646642049},{x:0.47792879308654873,y:0.028584168427667152},{x:0.47947957817165415,y:0.02959274452399146},{x:0.48132014276352414,y:0.0313881589690925},{x:0.48210100000000006,y:0.032033776942416534},{x:0.48210100000000006,y:0.02603500000000003},{x:0.4829656623818547,y:0.01725593550927424},{x:0.4855264210369921,y:0.008814245543570985},{x:0.4896848674463855,y:0.0010343395141179344},{x:0.4952811948466054,y:-0.0057848051533946065},{x:0.5021003395141179,y:-0.01138113255361451},{x:0.509880245543571,y:-0.015539578963007873},{x:0.5183219355092743,y:-0.018100337618145335},{x:0.527101,y:-0.018964999999999968},{x:0.5358800644907258,y:-0.018100337618145335},{x:0.544321754456429,y:-0.015539578963007873},{x:0.5521016604858822,y:-0.011381132553614504},{x:0.5589208051533947,y:-0.0057848051533946065},{x:0.5645171325536146,y:0.0010343395141179344},{x:0.5686755789630079,y:0.008814245543570992},{x:0.5712363376181454,y:0.01725593550927426},{x:0.5721010000000001,y:0.02603500000000003},{x:0.5721010000000001,y:0.560059},{x:0.5712363376181454,y:0.5688380644907257},{x:0.5686755789630079,y:0.577279754456429},{x:0.5645171325536146,y:0.5850596604858821},{x:0.5589208051533947,y:0.5918788051533946},{x:0.5521016604858822,y:0.5974751325536145},{x:0.544321754456429,y:0.6016335789630078},{x:0.5358800644907258,y:0.6041943376181453},{x:0.527101,y:0.605059},{x:0.5183219355092743,y:0.6041943376181453},{x:0.509880245543571,y:0.6016335789630078},{x:0.5021003395141179,y:0.5974751325536145},{x:0.4952811948466054,y:0.5918788051533946},{x:0.4896848674463855,y:0.5850596604858821},{x:0.4855264210369921,y:0.577279754456429},{x:0.4829656623818547,y:0.5688380644907257},{x:0.48210100000000006,y:0.560059},{x:0.48210100000000006,y:0.5551612473179106},{x:0.48111784979070266,y:0.5559741116228759},{x:0.47906658786156825,y:0.5579287481398052},{x:0.4777260461549398,y:0.558778440075324},{x:0.476502844006682,y:0.5597897782764175},{x:0.474008872962507,y:0.5611345413953497},{x:0.47161569478864906,y:0.5626514387693977},{x:0.3970086947886491,y:0.6002454387693977},{x:0.39545173243232984,y:0.6008467903430146},{x:0.3939797544564291,y:0.6016335789630078},{x:0.39134652561635536,y:0.6024323601988234},{x:0.3887796173011618,y:0.6034237870938969},{x:0.38713525366780027,y:0.6037098355781862},{x:0.3855380644907258,y:0.6041943376181453},{x:0.3827995979159321,y:0.6044640530341434},{x:0.3800885942320307,y:0.6049356509696303},{x:0.37842002129388747,y:0.6048954036817589},{x:0.376759,y:0.605059},{x:0.263722,y:0.605059},{x:0.26219504701733515,y:0.604908608257877},{x:0.26066140118579323,y:0.6049547986330399},{x:0.25781511370268967,y:0.6044772224791067},{x:0.2549429355092742,y:0.6041943376181453},{x:0.2534746624734083,y:0.6037489418620853},{x:0.2519614739213154,y:0.6034950452430072},{x:0.24926304753974865,y:0.6024713624393285},{x:0.24650124554357095,y:0.6016335789630078},{x:0.24514807736385555,y:0.6009102955021357},{x:0.24371349707866236,y:0.6003660689935006},{x:0.16798049707866233,y:0.5627720689935006},{x:0.1654642487594581,y:0.5611982224645521},{x:0.16285190958182658,y:0.5597896123262998},{x:0.16173267757498783,y:0.5588642237445607},{x:0.16050143578237863,y:0.5580941146870384},{x:0.15834057869520102,y:0.5560596134829665},{x:0.15605324108782545,y:0.5541684273021619},{x:0.08031924108782545,y:0.47787942730216193},{x:0.07924694249287094,y:0.47656305714472025},{x:0.07802357952480113,y:0.4753857561141845},{x:0.07646760484406812,y:0.47315109973327435},{x:0.07474784589903924,y:0.4710398973462887},{x:0.07395296229881854,y:0.46953962579412084},{x:0.07298278594430238,y:0.4681462799973844},{x:0.07189266871370663,y:0.46565100631071576},{x:0.07061782960809859,y:0.46324486175923196},{x:0.0701309079335922,y:0.4616183434067253},{x:0.06945120152585271,y:0.46006249834135976},{x:0.032147201525852716,y:0.3450764983413597},{x:0.031582343425880205,y:0.34249647318004567},{x:0.03081566238185464,y:0.3399690644907258},{x:0.030641204072877935,y:0.33819775955415116},{x:0.03026054307811779,y:0.33645906634171463},{x:0.03020987650767869,y:0.3338184172918108},{x:0.029951000000000005,y:0.33119},{x:0.029951000000000005,y:0.25490100000000004}],[{x:0.119951,y:0.2620835578942187},{x:0.119951,y:0.3240730820964405},{x:0.15174843963453788,y:0.42208563822492473},{x:0.21467365091165175,y:0.4854719831046318},{x:0.2742766075147511,y:0.5150589999999999},{x:0.3660620360389177,y:0.5150589999999999},{x:0.4245839309326211,y:0.4855701837142105},{x:0.48210100000000006,y:0.4276323784447675},{x:0.48210100000000006,y:0.15956344905445352},{x:0.4243936225653894,y:0.10143318135145685},{x:0.36578354074375496,y:0.07103500000000003},{x:0.2745522516182332,y:0.07103500000000003},{x:0.21486246778999646,y:0.10153288315838035},{x:0.15170083487400915,y:0.1651582162341545},{x:0.119951,y:0.2620835578942187}]],b:[[{x:0.03166000000000001,y:0.04001500000000002},{x:0.03252466238185464,y:0.031235935509274233},{x:0.0350854210369921,y:0.022794245543570978},{x:0.039243867446385465,y:0.015014339514117927},{x:0.04484019484660537,y:0.008195194846605386},{x:0.05165933951411792,y:0.002598867446385482},{x:0.05943924554357097,y:-0.0015595789630078807},{x:0.06788093550927424,y:-0.004120337618145342},{x:0.07666,y:-0.0049849999999999756},{x:0.08543906449072577,y:-0.004120337618145342},{x:0.09388075445642904,y:-0.0015595789630078807},{x:0.10166066048588211,y:0.002598867446385489},{x:0.10847980515339464,y:0.008195194846605386},{x:0.11407613255361454,y:0.015014339514117927},{x:0.1182345789630079,y:0.022794245543570985},{x:0.12079533761814537,y:0.031235935509274254},{x:0.12166,y:0.04001500000000002},{x:0.12166,y:0.041388769861289504},{x:0.12338630711141785,y:0.04010106584896898},{x:0.12512540667363178,y:0.03853443023544684},{x:0.12691331624345048,y:0.03747016444054036},{x:0.12858112311649333,y:0.036226097502515},{x:0.13069431360107225,y:0.035219499067818724},{x:0.13270563229917137,y:0.034022247411931134},{x:0.20674863229917137,y:-0.0007227525880688923},{x:0.20772794171481185,y:-0.0010698043626217635},{x:0.20864424554357097,y:-0.0015595789630078669},{x:0.21187816153300185,y:-0.0025405766534664824},{x:0.21506348921487128,y:-0.003669406425619949},{x:0.21609168791714548,y:-0.0038187359083884913},{x:0.21708593550927424,y:-0.004120337618145342},{x:0.22044909586509742,y:-0.004451580001305548},{x:0.22379344213248661,y:-0.004937293022731791},{x:0.22483101702188665,y:-0.00488316156543817},{x:0.225865,y:-0.0049849999999999756},{x:0.338045,y:-0.0049849999999999756},{x:0.33894984805462636,y:-0.004895880245274822},{x:0.33985755144997865,y:-0.004948481373678995},{x:0.343332465401001,y:-0.004464230112452937},{x:0.3468240644907258,y:-0.004120337618145342},{x:0.3476941397420575,y:-0.003856403176165039},{x:0.34859466384226984,y:-0.0037309094409420443},{x:0.351908335561611,y:-0.0025780408502315546},{x:0.35526575445642905,y:-0.0015595789630078807},{x:0.35606762040050133,y:-0.0011309726863615623},{x:0.35692635856942223,y:-0.0008322067413783357},{x:0.43209235856942224,y:0.03391279325862169},{x:0.4342218624454842,y:0.03516383683568551},{x:0.43645162164562873,y:0.03622594356254809},{x:0.4380158580934015,y:0.037392738102356306},{x:0.4396984532755396,y:0.03838123120587913},{x:0.4415429728374372,y:0.04002368192832182},{x:0.4435226810964235,y:0.04150038501262054},{x:0.5186856810964235,y:0.11000138501262047},{x:0.5200684051728882,y:0.11153543836568303},{x:0.5216038163727121,y:0.1129166544997947},{x:0.5230144082918019,y:0.11480386048953693},{x:0.5245918796416693,y:0.11655397481445093},{x:0.5256487561000858,y:0.11832830784782436},{x:0.5268852029038621,y:0.11998252816661786},{x:0.5279005150705119,y:0.12210866485417524},{x:0.5291062453835067,y:0.12413290061668979},{x:0.5297966590542814,y:0.12607932670695898},{x:0.530686625504748,y:0.12794298045128052},{x:0.567704625504748,y:0.2301969804512806},{x:0.5685418230641662,y:0.23348712941632632},{x:0.5695273376181453,y:0.23673593550927427},{x:0.5696276430094915,y:0.2377543532384077},{x:0.5698799976366801,y:0.23874609563675617},{x:0.5700592324586751,y:0.24213635445346285},{x:0.570392,y:0.24551500000000004},{x:0.570392,y:0.314017},{x:0.570065993218988,y:0.3173270023951309},{x:0.5699006262411136,y:0.32064890697528625},{x:0.569634437926433,y:0.3217086568121163},{x:0.5695273376181453,y:0.3227960644907258},{x:0.5685618455328773,y:0.32597886535008125},{x:0.5677515846008636,y:0.32920467896823863},{x:0.5307335846008636,y:0.4324506789682387},{x:0.5298196963817511,y:0.43437967657309706},{x:0.5291061063615623,y:0.4363913954201699},{x:0.5279358002551,y:0.43835612690926706},{x:0.5269566878799311,y:0.4404227969757902},{x:0.5256840310027916,y:0.4421364386856148},{x:0.5245916855370664,y:0.44397028841230757},{x:0.523060566435399,y:0.4456689527415915},{x:0.5216970801011935,y:0.44750489697372575},{x:0.5201145620561008,y:0.4489373284986299},{x:0.5186854393684929,y:0.45052283528838016},{x:0.44352243936849295,y:0.5190228352883801},{x:0.44134657552661755,y:0.5206458300432604},{x:0.43929971954126384,y:0.5224287703137037},{x:0.4378191137317927,y:0.523276992839783},{x:0.43645134158383936,y:0.5242972253466508},{x:0.43400065578620683,y:0.5254645447348341},{x:0.43164529517316985,y:0.52681390451462},{x:0.35647929517316984,y:0.56056790451462},{x:0.3558506134628383,y:0.560778965311121},{x:0.35526575445642905,y:0.5610915789630079},{x:0.351674330744245,y:0.5621810254355277},{x:0.34811645117964274,y:0.5633754754766519},{x:0.34745867349333664,y:0.563459831081816},{x:0.3468240644907258,y:0.5636523376181454},{x:0.3430891085149791,y:0.5640201986736739},{x:0.3393665669654169,y:0.5644975898222324},{x:0.3387049713307353,y:0.5644519984974604},{x:0.338045,y:0.564517},{x:0.225865,y:0.564517},{x:0.22507819619617456,y:0.5644395065891945},{x:0.22428916125732748,y:0.5644893996719887},{x:0.22069487882474298,y:0.5640077875099223},{x:0.21708593550927424,y:0.5636523376181454},{x:0.21632936813438544,y:0.5634228354140474},{x:0.21554576062305134,y:0.5633178367349442},{x:0.2121144991913443,y:0.5621442688983362},{x:0.20864424554357097,y:0.5610915789630079},{x:0.20794698905754733,y:0.5607188876066144},{x:0.20719892257093525,y:0.5604630322059678},{x:0.13315592257093525,y:0.5267090322059678},{x:0.13091775246116674,y:0.5254099486077729},{x:0.12858140317750869,y:0.5242970714087468},{x:0.1271119341080524,y:0.5232009671819817},{x:0.12552641140636125,y:0.5222806946221156},{x:0.12358468574515913,y:0.5205699272235509},{x:0.12166,y:0.5191342684374534},{x:0.12166,y:0.7597659999999999},{x:0.12079533761814537,y:0.7685450644907257},{x:0.1182345789630079,y:0.776986754456429},{x:0.11407613255361454,y:0.7847666604858821},{x:0.10847980515339464,y:0.7915858051533946},{x:0.10166066048588208,y:0.7971821325536145},{x:0.09388075445642904,y:0.8013405789630078},{x:0.08543906449072577,y:0.8039013376181453},{x:0.07666,y:0.804766},{x:0.06788093550927421,y:0.8039013376181453},{x:0.05943924554357094,y:0.8013405789630078},{x:0.05165933951411792,y:0.7971821325536145},{x:0.04484019484660537,y:0.7915858051533946},{x:0.039243867446385465,y:0.7847666604858821},{x:0.0350854210369921,y:0.776986754456429},{x:0.03252466238185464,y:0.7685450644907257},{x:0.03166000000000001,y:0.7597659999999999},{x:0.03166000000000001,y:0.04001500000000002}],[{x:0.12166,y:0.16313400296117606},{x:0.12166,y:0.39738980161800674},{x:0.17691400696537596,y:0.447746357818324},{x:0.23563826658076475,y:0.474517},{x:0.3284048540018634,y:0.474517},{x:0.3882155063572531,y:0.44765846343288423},{x:0.44979135555302596,y:0.39154114946310603},{x:0.480392,y:0.30619363915535625},{x:0.480392,y:0.2534097446111891},{x:0.44984564070758065,y:0.16903221413717517},{x:0.38802932067077023,y:0.11269492399652684},{x:0.3281476350434013,y:0.08501500000000002},{x:0.2358983461114888,y:0.08501500000000002},{x:0.1771018588393058,y:0.11260550754658781},{x:0.12166,y:0.16313400296117606}]],c:[[{x:0.0446,y:0.25490100000000004},{x:0.044822712444716174,y:0.2526397626013558},{x:0.04482893549381362,y:0.2503675925637664},{x:0.045254001037800355,y:0.24826081602954003},{x:0.045464662381854634,y:0.24612193550927428},{x:0.04612424100165128,y:0.2439475961957434},{x:0.04657362286091401,y:0.24172029932495478},{x:0.08145962286091402,y:0.1278402993249547},{x:0.08196610920465827,y:0.1266269431042867},{x:0.08230081253195312,y:0.125355433994083},{x:0.08366176737769918,y:0.12256476567779218},{x:0.08485778977199918,y:0.11969953302126297},{x:0.0855912581784792,y:0.11860830168404396},{x:0.08616758939694805,y:0.11742652164475936},{x:0.08804682625741464,y:0.11495498435675963},{x:0.08977884657839008,y:0.1123781387363477},{x:0.09071111026807865,y:0.11145096769089737},{x:0.09150692129220603,y:0.11040433186669174},{x:0.16233292129220603,y:0.03411333186669174},{x:0.16445877247754231,y:0.03223237849112975},{x:0.1664474797904295,y:0.03020697184383589},{x:0.16775479669311927,y:0.029316055882572942},{x:0.16893962068732413,y:0.02826772347496185},{x:0.17139158003796548,y:0.02683764508339147},{x:0.17373721213250964,y:0.02523913360696181},{x:0.24456521213250962,y:-0.013455866393038113},{x:0.2467886390083486,y:-0.014400746043602006},{x:0.24891924554357092,y:-0.015539578963007873},{x:0.25083834630720225,y:-0.016121731815163746},{x:0.25268405147305695,y:-0.01690609278116076},{x:0.2550490927002279,y:-0.01739904776899966},{x:0.2573609355092742,y:-0.018100337618145335},{x:0.259356733677244,y:-0.018296906580526337},{x:0.26131999536931183,y:-0.018706117055345653},{x:0.26373576373978486,y:-0.0187282033967292},{x:0.26614,y:-0.018964999999999968},{x:0.371854,y:-0.018964999999999968},{x:0.3744001776009888,y:-0.018714223394882004},{x:0.3769583677219744,y:-0.018674567546095353},{x:0.3787793796063011,y:-0.01828290964379429},{x:0.3806330644907258,y:-0.018100337618145335},{x:0.3830813939144215,y:-0.01735764500708899},{x:0.3855826926572475,y:-0.01681967299983559},{x:0.38729230564255435,y:-0.01608027889939661},{x:0.3890747544564291,y:-0.015539578963007873},{x:0.391331147776118,y:-0.014333511606549179},{x:0.393679431632842,y:-0.013317897403369645},{x:0.463449431632842,y:0.02537710259663028},{x:0.46566730315778443,y:0.026909287408228903},{x:0.46799586592077425,y:0.028267352155161442},{x:0.4692879686356918,y:0.029410572352257962},{x:0.47070743151062955,y:0.03039118797094862},{x:0.4725837728278355,y:0.03232661755101331},{x:0.4746026476214732,y:0.03411286752390576},{x:0.5454306476214732,y:0.11040386752390575},{x:0.5507700783887176,y:0.11742598212342069},{x:0.5546369668925095,y:0.12535484002769406},{x:0.5568827107762242,y:0.13388573967401945},{x:0.5574210073618384,y:0.14269084337317217},{x:0.5562311702134469,y:0.15143177592795284},{x:0.5533589241053942,y:0.15977262820225266},{x:0.5489146478448386,y:0.16739286592077418},{x:0.5430691324760942,y:0.17399964762147313},{x:0.5360470178765793,y:0.17933907838871752},{x:0.5281181599723059,y:0.18320596689250943},{x:0.5195872603259806,y:0.1854517107762242},{x:0.5107821566268278,y:0.1859900073618383},{x:0.5020412240720471,y:0.18480017021344686},{x:0.4937003717977473,y:0.18192792410539416},{x:0.4860801340792258,y:0.17748364784483847},{x:0.47947335237852684,y:0.17163813247609414},{x:0.41352572033101553,y:0.10060392571412592},{x:0.36021071976053953,y:0.07103500000000003},{x:0.27763077403847125,y:0.07103500000000003},{x:0.2233107097601157,y:0.10071132697875086},{x:0.16448866962379677,y:0.16407213041308155},{x:0.1346,y:0.2616391113440561},{x:0.1346,y:0.3245158400933278},{x:0.1645319520417492,y:0.4231721923699009},{x:0.2231207776861973,y:0.4862793045993598},{x:0.27734241586879393,y:0.5150589999999999},{x:0.3605019191882548,y:0.5150589999999999},{x:0.41371701660545657,y:0.4863852380349392},{x:0.47947395272027693,y:0.4155592208902026},{x:0.48608084903755494,y:0.4097138350672089},{x:0.4937011738972078,y:0.40526970822380387},{x:0.5020420824884065,y:0.4023976256622846},{x:0.5107830383716269,y:0.4012079599048077},{x:0.5195881315142611,y:0.40174642913926084},{x:0.5281189871247909,y:0.40399234029494097},{x:0.5360477692062626,y:0.4078593842656568},{x:0.5430697791097975,y:0.41319895272027696},{x:0.5489151649327911,y:0.41980584903755497},{x:0.5533592917761961,y:0.42742617389720783},{x:0.5562313743377155,y:0.4357670824884066},{x:0.5574210400951923,y:0.4445080383716269},{x:0.5568825708607392,y:0.4533131315142611},{x:0.5546366597050592,y:0.4618439871247909},{x:0.5507696157343432,y:0.46977276920626265},{x:0.5454300472797231,y:0.4767947791097975},{x:0.4746020472797231,y:0.5530827791097974},{x:0.47237947035514305,y:0.5550491819442839},{x:0.4702881116089302,y:0.5571546051529963},{x:0.469083054274185,y:0.5579656532949738},{x:0.4679951509624451,y:0.5589281649327911},{x:0.46543165406806053,y:0.5604231806402761},{x:0.46296973250196366,y:0.5620801448811513},{x:0.39319973250196366,y:0.5996741448811513},{x:0.39109075852725916,y:0.6005560023370271},{x:0.3890747544564291,y:0.6016335789630078},{x:0.38703122642603144,y:0.6022534764138876},{x:0.38506104886577136,y:0.6030772968079529},{x:0.3828205563795885,y:0.6035307692082409},{x:0.3806330644907258,y:0.6041943376181453},{x:0.3785078662851109,y:0.6044036513718285},{x:0.37641482574826585,y:0.6048272797133635},{x:0.3741289156203665,y:0.604834940368031},{x:0.371854,y:0.605059},{x:0.26614,y:0.605059},{x:0.26400488750824663,y:0.6048487097743618},{x:0.26185945318827825,y:0.6048549475733314},{x:0.2596259398913868,y:0.6044174210783497},{x:0.2573609355092742,y:0.6041943376181453},{x:0.2553078741931944,y:0.60357154827667},{x:0.25320244685788745,y:0.6031591127457343},{x:0.2510972070775077,y:0.6022942563713519},{x:0.24891924554357092,y:0.6016335789630078},{x:0.24702713339817148,y:0.6006222239508241},{x:0.24504262343928468,y:0.5998069647561404},{x:0.1742146234392847,y:0.5622129647561404},{x:0.17162525666515238,y:0.5604936738034747},{x:0.16894033563687538,y:0.5589277936219744},{x:0.16795812189104978,y:0.5580587651214349},{x:0.16686556037036515,y:0.5573333247718834},{x:0.16466136457832586,y:0.5551419091149951},{x:0.16233352162359432,y:0.5530823147741101},{x:0.09150752162359431,y:0.47679431477411016},{x:0.09067474586023959,y:0.4756991081857825},{x:0.08970182133886938,y:0.4747262717047309},{x:0.08801053269383365,y:0.4721953272870651},{x:0.08616805203977476,y:0.4697722296898647},{x:0.08556494203519081,y:0.46853560069719197},{x:0.08480050296804506,y:0.467391648838166},{x:0.08363547472152838,y:0.4645793817614187},{x:0.08230111970711389,y:0.461843393160995},{x:0.08195085264054901,y:0.4605128647226562},{x:0.08142427599227564,y:0.4592417589140625},{x:0.046538275992275634,y:0.3442567589140625},{x:0.04610669192420131,y:0.34208755224892967},{x:0.045464662381854634,y:0.33997106449072584},{x:0.04524807462900009,y:0.3377720121321243},{x:0.04481688692083,y:0.3356047976316928},{x:0.044816786846426454,y:0.33339307378956023},{x:0.0446,y:0.33119200000000004},{x:0.0446,y:0.25490100000000004}]],d:[[{x:0.03166100000000001,y:0.24551500000000004},{x:0.03199378652782141,y:0.24213616168032864},{x:0.032173060891358886,y:0.2387457109778176},{x:0.032425376075824915,y:0.237754159461938},{x:0.03252566238185464,y:0.23673593550927427},{x:0.03351123316568353,y:0.23348694405135337},{x:0.034348506941927405,y:0.23019661460170962},{x:0.0713675069419274,y:0.12794261460170955},{x:0.07225746993456125,y:0.1260790095358921},{x:0.0729478813145148,y:0.12413263082247869},{x:0.07415364826248581,y:0.12210836405190925},{x:0.07516899837159816,y:0.11998219518580837},{x:0.07640543228727825,y:0.1183280219355851},{x:0.07746229725612473,y:0.11655373492181778},{x:0.07903981058640837,y:0.11480359733178996},{x:0.08045044599662987,y:0.11291636718401242},{x:0.08198583537337678,y:0.11153519469971836},{x:0.08336853920306012,y:0.1100011842405046},{x:0.15853253920306012,y:0.04150018424050468},{x:0.16051177365736521,y:0.04002385498013544},{x:0.16235580937568672,y:0.038381768082408986},{x:0.16403890527939927,y:0.03739293492543645},{x:0.16560363358955885,y:0.03622578962650935},{x:0.16783285515961555,y:0.03516395710594637},{x:0.16996181351033893,y:0.03391317596960988},{x:0.24512381351033893,y:-0.0008318240303901436},{x:0.24598297689097734,y:-0.0011307574341723537},{x:0.24678524554357095,y:-0.0015595789630078807},{x:0.25014222995258023,y:-0.0025779090504023904},{x:0.2534554494825366,y:-0.0037306956028641883},{x:0.25435642329373365,y:-0.003856270624521421},{x:0.2552269355092742,y:-0.004120337618145342},{x:0.2587180827488419,y:-0.0044641856090968535},{x:0.2621925371943035,y:-0.004948444626188875},{x:0.2631006975177666,y:-0.004895835488062085},{x:0.264006,y:-0.0049849999999999756},{x:0.376189,y:-0.0049849999999999756},{x:0.37722298297811335,y:-0.004883161565438171},{x:0.3782605578675134,y:-0.004937293022731791},{x:0.3816049041349026,y:-0.004451580001305548},{x:0.3849680644907258,y:-0.004120337618145342},{x:0.3859623120828546,y:-0.003818735908388489},{x:0.38699051078512875,y:-0.003669406425619949},{x:0.39017583846699794,y:-0.0025405766534665605},{x:0.39340975445642906,y:-0.0015595789630078807},{x:0.39432605828518835,y:-0.0010698043626217065},{x:0.39530536770082864,y:-0.0007227525880688923},{x:0.46934836770082866,y:0.034022247411931134},{x:0.4713599418403825,y:0.035219651121148166},{x:0.4734733873673339,y:0.03622640539423388},{x:0.4751409393435705,y:0.037470316580519136},{x:0.4769285933263682,y:0.03853443023544684},{x:0.47866791375766776,y:0.04010126481479184},{x:0.480392,y:0.041387347763641016},{x:0.480392,y:0.04001500000000002},{x:0.4812566623818546,y:0.031235935509274233},{x:0.48381742103699205,y:0.022794245543570978},{x:0.48797586744638544,y:0.015014339514117927},{x:0.4935721948466053,y:0.008195194846605386},{x:0.5003913395141178,y:0.002598867446385482},{x:0.508171245543571,y:-0.0015595789630078807},{x:0.5166129355092742,y:-0.004120337618145342},{x:0.525392,y:-0.0049849999999999756},{x:0.5341710644907257,y:-0.004120337618145342},{x:0.542612754456429,y:-0.0015595789630078807},{x:0.5503926604858821,y:0.002598867446385489},{x:0.5572118051533946,y:0.008195194846605386},{x:0.5628081325536145,y:0.015014339514117927},{x:0.5669665789630078,y:0.022794245543570985},{x:0.5695273376181453,y:0.031235935509274254},{x:0.570392,y:0.04001500000000002},{x:0.570392,y:0.7597659999999999},{x:0.5695273376181453,y:0.7685450644907257},{x:0.5669665789630078,y:0.776986754456429},{x:0.5628081325536145,y:0.7847666604858821},{x:0.5572118051533946,y:0.7915858051533946},{x:0.5503926604858821,y:0.7971821325536145},{x:0.542612754456429,y:0.8013405789630078},{x:0.5341710644907257,y:0.8039013376181453},{x:0.525392,y:0.804766},{x:0.5166129355092742,y:0.8039013376181453},{x:0.508171245543571,y:0.8013405789630078},{x:0.5003913395141178,y:0.7971821325536145},{x:0.4935721948466053,y:0.7915858051533946},{x:0.48797586744638544,y:0.7847666604858821},{x:0.48381742103699205,y:0.776986754456429},{x:0.4812566623818546,y:0.7685450644907257},{x:0.480392,y:0.7597659999999999},{x:0.480392,y:0.5191356905079497},{x:0.47846953719699326,y:0.5205697307992189},{x:0.47652758859363875,y:0.5222806946221157},{x:0.47494232329576636,y:0.5232008177790934},{x:0.47347310730786674,y:0.524296763521154},{x:0.4711365045177018,y:0.5254097994515352},{x:0.46889807742906475,y:0.5267090322059679},{x:0.3948550774290648,y:0.5604630322059679},{x:0.3941070109424522,y:0.5607188876066146},{x:0.39340975445642906,y:0.5610915789630079},{x:0.389939500808656,y:0.5621442688983361},{x:0.38650823937694867,y:0.5633178367349442},{x:0.38572463186561456,y:0.5634228354140474},{x:0.3849680644907258,y:0.5636523376181454},{x:0.38135912117525683,y:0.5640077875099224},{x:0.3777648387426725,y:0.5644893996719887},{x:0.3769758038038255,y:0.5644395065891945},{x:0.376189,y:0.564517},{x:0.264006,y:0.564517},{x:0.26334558239453953,y:0.5644519545432365},{x:0.2626835384795895,y:0.5644975635305632},{x:0.2589614482177297,y:0.5640201550156564},{x:0.2552269355092742,y:0.5636523376181454},{x:0.25459189738202526,y:0.5634597009082802},{x:0.2539336765832372,y:0.5633752751711479},{x:0.2503762430229788,y:0.5621808961392286},{x:0.24678524554357095,y:0.5610915789630079},{x:0.24619999105363047,y:0.5607787539207695},{x:0.24557088842716707,y:0.5605675378929096},{x:0.17040888842716706,y:0.5268135378929095},{x:0.16805407047382528,y:0.5254644267942322},{x:0.16560391365212207,y:0.5242973792806265},{x:0.16423565717286473,y:0.5232767996121171},{x:0.1627545512703112,y:0.5224282514648534},{x:0.16070817900232118,y:0.5206456609648356},{x:0.15853278093215223,y:0.5190230360586235},{x:0.08336878093215222,y:0.45052303605862365},{x:0.08193967718325436,y:0.44893757139643337},{x:0.08035717944512263,y:0.44750518296134467},{x:0.07899365114577664,y:0.44566921514174185},{x:0.07746249136223225,y:0.4439705283033309},{x:0.07637015625263606,y:0.44213672358948825},{x:0.0750975108858587,y:0.44042312810321155},{x:0.07411836195358443,y:0.43835642671545355},{x:0.07294802033824888,y:0.4363916652130956},{x:0.07223443169362759,y:0.4343799925343442},{x:0.07132054574594202,y:0.4324510425104215},{x:0.034301545745942026,y:0.32920504251042143},{x:0.033491210284420626,y:0.32597904935505284},{x:0.03252566238185464,y:0.3227960644907258},{x:0.03241858101312289,y:0.3217088491086539},{x:0.03215243067755317,y:0.32064928896150824},{x:0.031987025628206905,y:0.31732719375391183},{x:0.03166100000000001,y:0.314017},{x:0.03166100000000001,y:0.24551500000000004}],[{x:0.121661,y:0.25340994514221},{x:0.121661,y:0.3061934402169761},{x:0.15226243948714763,y:0.39154086238640384},{x:0.21383969339611897,y:0.4476587099299689},{x:0.27364661400534074,y:0.474517},{x:0.3664157334192352,y:0.474517},{x:0.42513971513426946,y:0.4477464845048247},{x:0.480392,y:0.3973901578243758},{x:0.480392,y:0.1631336467554691},{x:0.4249518651426514,y:0.1126053780239199},{x:0.3661556538885112,y:0.08501500000000002},{x:0.2739038430667855,y:0.08501500000000002},{x:0.21402588591940364,y:0.11269467351967463},{x:0.15220815290195538,y:0.1690325018607451},{x:0.121661,y:0.25340994514221}]],e:[[{x:0.014571,y:0.25490100000000004},{x:0.014880046743786594,y:0.2517631957525991},{x:0.01501248842711947,y:0.2486129918567585},{x:0.015311525398480692,y:0.24738231945287367},{x:0.015435662381854634,y:0.24612193550927428},{x:0.016350926120166094,y:0.24310471531940006},{x:0.01709539726614681,y:0.24004087979874045},{x:0.05693639726614681,y:0.12616087979874036},{x:0.057746546207777846,y:0.12441615547982068},{x:0.05835851556287996,y:0.12259245107255745},{x:0.05959975008908581,y:0.12042512406141898},{x:0.06065161969764369,y:0.11815983382640528},{x:0.06178658068373706,y:0.11660668611395116},{x:0.06274257829935428,y:0.11493741297405176},{x:0.06438278737670251,y:0.11305388338712186},{x:0.06585638180708843,y:0.11103732964943176},{x:0.06727253892344205,y:0.10973544513901749},{x:0.06853582634733585,y:0.1082847524971091},{x:0.14942282634733584,y:0.031993752497109104},{x:0.15144602889400902,y:0.03043003785468449},{x:0.15333307828862142,y:0.02870446646813117},{x:0.1549277151407192,y:0.027739074573098352},{x:0.15640262843323158,y:0.02659912765300345},{x:0.15869202130341495,y:0.025460166585296706},{x:0.1608794538505091,y:0.024135896643135493},{x:0.2417664538505091,y:-0.01455910335686443},{x:0.24290092295632487,y:-0.014970686687880902},{x:0.2439652455435709,y:-0.015539578963007873},{x:0.24703931387581265,y:-0.016472087396775758},{x:0.2500591116803148,y:-0.017567664555291233},{x:0.2512520782049556,y:-0.01775001548484057},{x:0.2524069355092742,y:-0.018100337618145335},{x:0.25560385985111694,y:-0.01841520718300011},{x:0.2587793695882151,y:-0.01890059980751419},{x:0.2599849884971624,y:-0.018846710691637396},{x:0.261186,y:-0.018964999999999968},{x:0.381914,y:-0.018964999999999968},{x:0.3832466926412995,y:-0.01883374123151461},{x:0.3845848263549422,y:-0.018885671038862982},{x:0.3876272824249201,y:-0.01840229079619376},{x:0.39069306449072577,y:-0.018100337618145335},{x:0.3919745425012029,y:-0.017711605513551366},{x:0.39329709535359264,y:-0.017501480567117658},{x:0.39618678867610163,y:-0.016433834605858122},{x:0.39913475445642904,y:-0.015539578963007873},{x:0.4003157713548023,y:-0.014908312279081314},{x:0.40157191838151796,y:-0.014444207562717595},{x:0.48125191838151804,y:0.02425079243728233},{x:0.4833189661071789,y:0.02551885102394819},{x:0.4854901362659954,y:0.026598980192539007},{x:0.48706966813422276,y:0.027819770278194},{x:0.48877129863032925,y:0.028863658687316496},{x:0.4905512426555404,y:0.030510612890229178},{x:0.492469971641239,y:0.03199356196515255},{x:0.573357971641239,y:0.10828456196515254},{x:0.5791512607417543,y:0.11493718669263933},{x:0.5835353707163221,y:0.12259219773755695},{x:0.5863418226772573,y:0.13095541731842886},{x:0.5874627662495775,y:0.13970545159690978},{x:0.5868551242004307,y:0.1485060416627534},{x:0.584542247872996,y:0.15701898577515713},{x:0.5806130198074609,y:0.16491713626599536},{x:0.5752184380348474,y:0.17189697164123896},{x:0.5685658133073607,y:0.17769026074175415},{x:0.560910802262443,y:0.1820743707163221},{x:0.5525475826815711,y:0.18488082267725728},{x:0.5437975484030901,y:0.18600176624957743},{x:0.5349969583372466,y:0.1853941242004306},{x:0.5264840142248428,y:0.183081247872996},{x:0.5185858637340046,y:0.17915201980746093},{x:0.511606028358761,y:0.17375743803484736},{x:0.43573388395098006,y:0.1021972341849065},{x:0.3715652104827451,y:0.07103500000000003},{x:0.2713955768569904,y:0.07103500000000003},{x:0.2060606884620834,y:0.10229012760321096},{x:0.13826613078700495,y:0.16623259795801962},{x:0.104571,y:0.2625454790108076},{x:0.104571,y:0.28619200000000006},{x:0.542482,y:0.28619200000000006},{x:0.5512610644907258,y:0.2870566623818547},{x:0.559702754456429,y:0.2896174210369921},{x:0.5674826604858821,y:0.2937758674463855},{x:0.5743018051533947,y:0.2993721948466054},{x:0.5798981325536146,y:0.3061913395141179},{x:0.5840565789630079,y:0.31397124554357103},{x:0.5866173376181454,y:0.32241293550927425},{x:0.5874820000000001,y:0.33119200000000004},{x:0.5866173376181454,y:0.33997106449072584},{x:0.5840565789630079,y:0.34841275445642905},{x:0.5798981325536146,y:0.35619266048588216},{x:0.5743018051533947,y:0.3630118051533947},{x:0.5674826604858821,y:0.3686081325536146},{x:0.5660433240263831,y:0.3693774739195968},{x:0.5706944449992851,y:0.3724210772554575},{x:0.5769918122169339,y:0.3785986803904119},{x:0.5819629867044116,y:0.38588613801169297},{x:0.5854169290140312,y:0.3940033972097681},{x:0.5872209060798271,y:0.40263851626586683},{x:0.5873055920748429,y:0.4114596523972937},{x:0.5856677325637826,y:0.4201278142894682},{x:0.5823702695691338,y:0.4283098893420352},{x:0.5425292695691338,y:0.5045998893420351},{x:0.54083893518448,y:0.5071829952333479},{x:0.5393041274419548,y:0.5098614335042745},{x:0.5384286685906833,y:0.5108662746451583},{x:0.5376989227445426,y:0.5119814449992851},{x:0.5355371287009763,y:0.5141851493557908},{x:0.5335092744740836,y:0.5165126960496618},{x:0.49246227447408364,y:0.5552086960496617},{x:0.4903478252727746,y:0.5568421196453192},{x:0.48836639942178184,y:0.5586345815458318},{x:0.486865329057947,y:0.5595323670561179},{x:0.4854811710293013,y:0.5606016367187369},{x:0.48308868524123094,y:0.5617911659624512},{x:0.4807956399629947,y:0.5631626292028359},{x:0.40111563996299465,y:0.6007566292028359},{x:0.40009264564938235,y:0.6011215754533451},{x:0.39913475445642904,y:0.6016335789630078},{x:0.3959457374462889,y:0.6026009566970012},{x:0.3928069722488333,y:0.6037206897930685},{x:0.3917324370025758,y:0.603879047413643},{x:0.39069306449072577,y:0.6041943376181453},{x:0.38737659751458814,y:0.6045209811048129},{x:0.38407969371999856,y:0.6050068561303112},{x:0.38299491132800306,y:0.6049525395264004},{x:0.381914,y:0.605059},{x:0.261186,y:0.605059},{x:0.26023449599616577,y:0.6049652850353624},{x:0.2592798763752433,y:0.6050186117946668},{x:0.25585213857488087,y:0.6045336605029273},{x:0.2524069355092742,y:0.6041943376181453},{x:0.2514919972706982,y:0.6039167941377678},{x:0.2505453168634681,y:0.6037828591890964},{x:0.24727805138745723,y:0.6026385076291858},{x:0.2439652455435709,y:0.6016335789630078},{x:0.24312203363365809,y:0.6011828728071931},{x:0.24221967283726598,y:0.6008668231955117},{x:0.161332672837266,y:0.5632728231955116},{x:0.15891596978001063,y:0.5618462817840929},{x:0.15640337688314435,y:0.5605963413854953},{x:0.1551260781006526,y:0.5596091689500753},{x:0.15373589412748892,y:0.5587885654418143},{x:0.1516439317651508,y:0.5569179592459522},{x:0.1494234689111216,y:0.555201853544281},{x:0.06853646891112161,y:0.47891385354428107},{x:0.06722863655802509,y:0.4774120673763562},{x:0.06576662511800205,y:0.47605991734502884},{x:0.06433886916992998,y:0.4740937424536807},{x:0.06274309028364713,y:0.4722613067803989},{x:0.06175337150959475,y:0.4705332315776763},{x:0.06058324359446483,y:0.4689218384474283},{x:0.05956650326928079,y:0.4667149016876259},{x:0.05835887729241062,y:0.4646063547351938},{x:0.05772530643484857,y:0.4627183994585984},{x:0.05689202940417486,y:0.4609096881637455},{x:0.017051029404174856,y:0.3459246881637455},{x:0.016331419439147486,y:0.342923979771159},{x:0.015435662381854634,y:0.33997106449072584},{x:0.015304912520774374,y:0.33864353887302173},{x:0.014993833838408223,y:0.33734636893611664},{x:0.014873460143664087,y:0.33426292937408214},{x:0.014571,y:0.33119200000000004},{x:0.014571,y:0.25490100000000004}],[{x:0.12278767041868709,y:0.376192},{x:0.13831799224413532,y:0.421014018902617},{x:0.20587340146207272,y:0.4847284236699839},{x:0.27113246747276615,y:0.5150589999999999},{x:0.37183117966561724,y:0.5150589999999999},{x:0.4359272756482788,y:0.48481767680255794},{x:0.4662598881310508,y:0.45622238914125884},{x:0.5025937304308662,y:0.3866481106579649},{x:0.5074240772554575,y:0.379266555000715},{x:0.5104401600015575,y:0.376192},{x:0.12278767041868709,y:0.376192}]],f:[[{x:0.044112,y:0.5239119999999999},{x:0.04497666238185463,y:0.5151329355092742},{x:0.04753742103699209,y:0.5066912455435709},{x:0.051695867446385456,y:0.4989113395141178},{x:0.05729219484660536,y:0.49209219484660527},{x:0.0641113395141179,y:0.4864958674463854},{x:0.07189124554357096,y:0.482337421036992},{x:0.08033293550927423,y:0.47977666238185457},{x:0.089112,y:0.47891199999999995},{x:0.20304699999999998,y:0.47891199999999995},{x:0.20304699999999998,y:0.05318299999999998},{x:0.20391166238185462,y:0.04440393550927419},{x:0.2064724210369921,y:0.03596224554357094},{x:0.21063086744638546,y:0.028182339514117884},{x:0.21622719484660535,y:0.021363194846605343},{x:0.2230463395141179,y:0.01576686744638544},{x:0.23082624554357095,y:0.011608421036992077},{x:0.23926793550927422,y:0.009047662381854615},{x:0.248047,y:0.008182999999999982},{x:0.25682606449072576,y:0.009047662381854615},{x:0.26526775445642903,y:0.011608421036992077},{x:0.2730476604858821,y:0.015766867446385446},{x:0.2798668051533946,y:0.021363194846605343},{x:0.28546313255361455,y:0.028182339514117884},{x:0.2896215789630079,y:0.03596224554357094},{x:0.2921823376181454,y:0.04440393550927421},{x:0.293047,y:0.05318299999999998},{x:0.293047,y:0.47891199999999995},{x:0.459965,y:0.47891199999999995},{x:0.4687440644907258,y:0.47977666238185457},{x:0.4771857544564291,y:0.482337421036992},{x:0.48496566048588213,y:0.4864958674463854},{x:0.4917848051533946,y:0.49209219484660527},{x:0.49738113255361455,y:0.4989113395141178},{x:0.5015395789630079,y:0.5066912455435709},{x:0.5041003376181454,y:0.5151329355092742},{x:0.504965,y:0.5239119999999999},{x:0.5041003376181454,y:0.5326910644907257},{x:0.5015395789630079,y:0.5411327544564289},{x:0.49738113255361455,y:0.548912660485882},{x:0.4917848051533946,y:0.5557318051533946},{x:0.48496566048588213,y:0.5613281325536145},{x:0.4771857544564291,y:0.5654865789630078},{x:0.4687440644907258,y:0.5680473376181453},{x:0.459965,y:0.568912},{x:0.293047,y:0.568912},{x:0.293047,y:0.6141229501499061},{x:0.3322669208002554,y:0.6884371453882767},{x:0.4140490730325775,y:0.7147659999999999},{x:0.512941,y:0.7147659999999999},{x:0.5217200644907257,y:0.7156306623818546},{x:0.530161754456429,y:0.7181914210369921},{x:0.5379416604858821,y:0.7223498674463854},{x:0.5447608051533946,y:0.7279461948466053},{x:0.5503571325536145,y:0.7347653395141178},{x:0.5545155789630078,y:0.7425452455435709},{x:0.5570763376181453,y:0.7509869355092742},{x:0.557941,y:0.7597659999999999},{x:0.5570763376181453,y:0.7685450644907257},{x:0.5545155789630078,y:0.776986754456429},{x:0.5503571325536145,y:0.7847666604858821},{x:0.5447608051533946,y:0.7915858051533946},{x:0.5379416604858821,y:0.7971821325536145},{x:0.530161754456429,y:0.8013405789630078},{x:0.5217200644907257,y:0.8039013376181453},{x:0.512941,y:0.804766},{x:0.406984,y:0.804766},{x:0.40440576588043703,y:0.8045120661033809},{x:0.40181542834229744,y:0.8044681908525655},{x:0.400026512750784,y:0.8040807473169851},{x:0.3982049355092742,y:0.8039013376181453},{x:0.39572578148103565,y:0.8031492944655273},{x:0.39319377618916257,y:0.8026009124809075},{x:0.2872357761891626,y:0.7684889124809076},{x:0.28342960508890525,y:0.7668362808879404},{x:0.2796044085190959,y:0.7652281761559891},{x:0.27938594032962494,y:0.7650805300410848},{x:0.27914407460343155,y:0.764975512444704},{x:0.2757334504432472,y:0.7626120885587936},{x:0.27229547962292316,y:0.7602886242777711},{x:0.2721100135665551,y:0.7601011941121303},{x:0.27189328313916555,y:0.7599510087370087},{x:0.2690092742928275,y:0.7569676176126634},{x:0.26609064851257996,y:0.7540180832118794},{x:0.26594531194585036,y:0.7537980718316557},{x:0.26576204564604555,y:0.7536084902175343},{x:0.26351548295615396,y:0.7501197819025626},{x:0.26122836336792754,y:0.7466575263349163},{x:0.2082493633679275,y:0.6462725263349164},{x:0.20745880379789322,y:0.6443351468057326},{x:0.2064724210369921,y:0.6424897544564291},{x:0.20579637196662365,y:0.6402611193438609},{x:0.20491647908027386,y:0.6381048157198157},{x:0.20451907388691828,y:0.636050431873947},{x:0.20391166238185462,y:0.6340480644907258},{x:0.20368338854657433,y:0.6317303613460921},{x:0.20324107652369047,y:0.6294438319050109},{x:0.20325209776572678,y:0.6273513925615422},{x:0.20304699999999998,y:0.6252690000000001},{x:0.20304699999999998,y:0.568912},{x:0.089112,y:0.568912},{x:0.0803329355092742,y:0.5680473376181453},{x:0.07189124554357093,y:0.5654865789630078},{x:0.0641113395141179,y:0.5613281325536145},{x:0.05729219484660536,y:0.5557318051533946},{x:0.051695867446385456,y:0.548912660485882},{x:0.04753742103699209,y:0.5411327544564289},{x:0.04497666238185463,y:0.5326910644907257},{x:0.044112,y:0.5239119999999999}]],g:[[{x:0.03166100000000001,y:0.285331},{x:0.03199195389402992,y:0.28197076872347165},{x:0.03216742697517915,y:0.27859884139484714},{x:0.032423533978450624,y:0.2775888625904497},{x:0.03252566238185464,y:0.2765519355092742},{x:0.03350580569139788,y:0.2733208360362635},{x:0.034335737494852386,y:0.2700479324456657},{x:0.07135573749485238,y:0.1675239324456658},{x:0.07223945098422414,y:0.16566943556296815},{x:0.07292365731738822,y:0.16373243532732273},{x:0.07413231799188957,y:0.16169720247238553},{x:0.07515058411631778,y:0.15956034321175439},{x:0.07637911169281072,y:0.15791388391586245},{x:0.07742806119285411,y:0.15614758463046624},{x:0.07901055202445481,y:0.15438725620434748},{x:0.0804261330120869,y:0.15249010996133996},{x:0.08195226304990277,y:0.15111496075964967},{x:0.08332564517579637,y:0.14958724031548856},{x:0.1584886451757964,y:0.08090524031548854},{x:0.16047116284778873,y:0.07942238349974136},{x:0.16231838489394151,y:0.07777404756068641},{x:0.16399482319868336,y:0.07678680357956279},{x:0.16555276842115366,y:0.07562151273533077},{x:0.16778648358567103,y:0.07455391860853194},{x:0.1699197861673149,y:0.07329763012616651},{x:0.2450797861673149,y:0.038459630126166475},{x:0.2459605302529857,y:0.0381521715215269},{x:0.24678324554357095,y:0.03771242103699209},{x:0.2501181687545519,y:0.03670078314085588},{x:0.253408434365457,y:0.03555218561964517},{x:0.254332237398671,y:0.03542245939316866},{x:0.2552249355092742,y:0.03515166238185463},{x:0.2586931398688001,y:0.03481007406735549},{x:0.26214426420887293,y:0.034325445502994434},{x:0.2630756249571383,y:0.03437843696081321},{x:0.264004,y:0.034287},{x:0.376189,y:0.034287},{x:0.37724627227682206,y:0.03439113223027483},{x:0.37830727432005307,y:0.03433688416138392},{x:0.3816280756224084,y:0.03482270219101675},{x:0.3849680644907258,y:0.03515166238185463},{x:0.38598470638687477,y:0.035460057329467706},{x:0.38703590484658207,y:0.03561384285228289},{x:0.39019811948723343,y:0.036738182220129235},{x:0.39340975445642906,y:0.03771242103699209},{x:0.39434669699397534,y:0.038213227257056566},{x:0.39534769490287125,y:0.03856913648017993},{x:0.4693886949028713,y:0.07340713648017996},{x:0.47140406041677185,y:0.07460963544760885},{x:0.47352148667564636,y:0.07562166704766733},{x:0.4751827197672129,y:0.0768642309221422},{x:0.47696422705836306,y:0.07792719476830276},{x:0.47870627197824944,y:0.0794997663623443},{x:0.480392,y:0.08076065187723735},{x:0.480392,y:0.018480463023952315},{x:0.44982106300216956,y:-0.06618482166306154},{x:0.42509763890365326,y:-0.0887666681923909},{x:0.3663917896728536,y:-0.115601},{x:0.27366828971008494,y:-0.115601},{x:0.21388478385740822,y:-0.08868092320279419},{x:0.15228882603575622,y:-0.032396134475538775},{x:0.11903308523020223,y:0.0605977685009861},{x:0.11526275900748023,y:0.06857299605517989},{x:0.11000898883421664,y:0.07565942769130271},{x:0.1034736741518217,y:0.08158473581569503},{x:0.09590796343849313,y:0.08612121416008753},{x:0.08760260271404471,y:0.08909452840579157},{x:0.07887676233341709,y:0.09039041575379858},{x:0.07006577144893004,y:0.08995907598006667},{x:0.061508231499013855,y:0.08781708523020218},{x:0.05353300394482007,y:0.08404675900748018},{x:0.046446572308697254,y:0.07879298883421659},{x:0.04052126418430494,y:0.07225767415182165},{x:0.035984785839912437,y:0.06469196343849308},{x:0.03301147159420839,y:0.05638660271404467},{x:0.03171558424620138,y:0.04766076233341703},{x:0.0321469240199333,y:0.038849771448930016},{x:0.03428891476979778,y:0.030292231499013812},{x:0.07130891476979778,y:-0.07322776850098624},{x:0.07221644299685706,y:-0.07514742841768875},{x:0.07292365731738822,y:-0.07714956467267746},{x:0.07409706350042253,y:-0.07912543338941479},{x:0.07507924099251978,y:-0.08120299605518004},{x:0.07634383839048098,y:-0.08290872027080634},{x:0.07742806119285414,y:-0.08473441536953392},{x:0.07896439356931816,y:-0.08644339813281518},{x:0.08033301116578337,y:-0.08828942769130284},{x:0.0819060799658371,y:-0.08971566618082738},{x:0.08332564517579637,y:-0.09129475968451163},{x:0.1584886451757964,y:-0.15997675968451153},{x:0.16066766565506738,y:-0.1616065940183929},{x:0.16271768036753925,y:-0.16339598773796155},{x:0.16419165994754753,y:-0.1642424237156923},{x:0.16555276842115366,y:-0.1652604872646693},{x:0.16800788453794988,y:-0.16643389898185532},{x:0.17036760218951646,y:-0.1677889719724602},{x:0.24552760218951647,y:-0.2016329719724602},{x:0.24617798725770038,y:-0.20185206166908357},{x:0.24678324554357095,y:-0.2021755789630079},{x:0.2503526828238078,y:-0.20325835592431216},{x:0.25388756161766735,y:-0.20444912053505218},{x:0.25456819199860076,y:-0.20453711665220192},{x:0.2552249355092742,y:-0.20473633761814536},{x:0.25893702635910487,y:-0.20510194665533446},{x:0.2626362900994872,y:-0.20558021041579141},{x:0.263321009549333,y:-0.20553373131203426},{x:0.264004,y:-0.20560099999999998},{x:0.376189,y:-0.20560099999999998},{x:0.3769985938815523,y:-0.20552126196245651},{x:0.37781053527049396,y:-0.2055717752142049},{x:0.38138177137190815,y:-0.20508955666026785},{x:0.3849680644907258,y:-0.20473633761814536},{x:0.3857465461334356,y:-0.20450018779358015},{x:0.38655274094280934,y:-0.2043913285403334},{x:0.3899612805709507,y:-0.2032216620796743},{x:0.39340975445642906,y:-0.2021755789630079},{x:0.39412720724734457,y:-0.20179209245674457},{x:0.39489667386274535,y:-0.20152804409855607},{x:0.4689376738627454,y:-0.16768404409855608},{x:0.471176129388074,y:-0.16638175223486265},{x:0.4735129313995788,y:-0.16526550692304898},{x:0.47497970384913024,y:-0.16416890323360386},{x:0.4765626813675205,y:-0.163247956304222},{x:0.47850406105855325,y:-0.16153398660426738},{x:0.480578193417323,y:-0.15998330217620907},{x:0.5187211934173229,y:-0.125144302176209},{x:0.5200982241105119,y:-0.12361318710120846},{x:0.5216280341275545,y:-0.12223470670068204},{x:0.5230406381933351,y:-0.12034152832018923},{x:0.5246201913815024,y:-0.1185852292702623},{x:0.52567205708302,y:-0.11681488878073784},{x:0.5269035440443172,y:-0.11516444436572898},{x:0.5279196645391884,y:-0.1130320574948894},{x:0.5291262301085498,y:-0.11100134969861394},{x:0.5298125082093796,y:-0.10905981698676002},{x:0.5306983467616347,y:-0.10720083421055714},{x:0.5677173467616347,y:-0.0046778342105572215},{x:0.5685472301626403,y:-0.001405045768812418},{x:0.5695273376181453,y:0.0018259355092742052},{x:0.5696294781899907,y:0.002862986138707272},{x:0.5698856101392306,y:0.003873086692614168},{x:0.5700610582123972,y:0.007244891642088324},{x:0.570392,y:0.010604999999999976},{x:0.570392,y:0.560059},{x:0.5695273376181453,y:0.5688380644907257},{x:0.5669665789630078,y:0.577279754456429},{x:0.5628081325536145,y:0.5850596604858821},{x:0.5572118051533946,y:0.5918788051533946},{x:0.5503926604858821,y:0.5974751325536145},{x:0.542612754456429,y:0.6016335789630078},{x:0.5341710644907257,y:0.6041943376181453},{x:0.525392,y:0.605059},{x:0.5166129355092742,y:0.6041943376181453},{x:0.508171245543571,y:0.6016335789630078},{x:0.5003913395141178,y:0.5974751325536145},{x:0.4935721948466053,y:0.5918788051533946},{x:0.48797586744638544,y:0.5850596604858821},{x:0.48381742103699205,y:0.577279754456429},{x:0.4812566623818546,y:0.5688380644907257},{x:0.480392,y:0.560059},{x:0.480392,y:0.5595783858718113},{x:0.47850787544975776,y:0.5609876460911735},{x:0.47656308903374583,y:0.5627046621197919},{x:0.47498407852937236,y:0.5636233247252487},{x:0.47352120750708176,y:0.5647175018259646},{x:0.47118052218859596,y:0.5658362200595997},{x:0.46893813108831367,y:0.5671408350985324},{x:0.39489713108831365,y:0.6009858350985324},{x:0.39412742928685096,y:0.6012499737741558},{x:0.39340975445642906,y:0.6016335789630078},{x:0.38996152003118717,y:0.6026795894402057},{x:0.3865532301567984,y:0.60384921275647},{x:0.38574678706033977,y:0.6039581147092028},{x:0.3849680644907258,y:0.6041943376181453},{x:0.38138202040224084,y:0.6045475321329209},{x:0.37781103767268465,y:0.6050297570960106},{x:0.3769988444371686,y:0.6049792372848822},{x:0.376189,y:0.605059},{x:0.264004,y:0.605059},{x:0.2633207613423033,y:0.6049917068657756},{x:0.2626357925427961,y:0.6050381952835313},{x:0.25893677979996554,y:0.6045599223713788},{x:0.2552249355092742,y:0.6041943376181453},{x:0.25456795333002863,y:0.6039950442528821},{x:0.2538870765735461,y:0.6039070086250592},{x:0.2503524457397967,y:0.6027162840056636},{x:0.24678324554357095,y:0.6016335789630078},{x:0.24617776729948443,y:0.6013099440989677},{x:0.24552714829793862,y:0.6010907675853725},{x:0.17036714829793861,y:0.5672457675853725},{x:0.16800780172583518,y:0.5658908729822889},{x:0.16555304759050302,y:0.5647176561362495},{x:0.1641916021742222,y:0.563699355958929},{x:0.16271727507130354,y:0.5628526987282604},{x:0.16066758950642807,y:0.5610635523625588},{x:0.15848888603577402,y:0.5594339797745099},{x:0.08332588603577401,y:0.49075297977450993},{x:0.08190615458499984,y:0.48917372437901785},{x:0.08033291862515302,y:0.48774732555289924},{x:0.07896444452212992,y:0.48590147772545017},{x:0.07742825448734617,y:0.4841926782200152},{x:0.07634390022195357,y:0.48236679190821125},{x:0.07507917015624571,y:0.48066087782555583},{x:0.0740970979464375,y:0.4785835213931001},{x:0.07292379561819572,y:0.47660786018244516},{x:0.07221648966449083,y:0.47460551074132296},{x:0.0713088683600783,y:0.4726856387236396},{x:0.034288868360078294,y:0.36916463872363964},{x:0.03348577523186824,y:0.3659561323879453},{x:0.03252566238185464,y:0.3627910644907258},{x:0.0324167369020588,y:0.3616851255348066},{x:0.032146903820267865,y:0.36060709221327164},{x:0.03198519043554786,y:0.35730356073015046},{x:0.03166100000000001,y:0.354012},{x:0.03166100000000001,y:0.285331}],[{x:0.121661,y:0.29320659086815803},{x:0.121661,y:0.34620780969623244},{x:0.15228882172599023,y:0.4318540207415116},{x:0.21388481974037543,y:0.48813802669691503},{x:0.2736685500834057,y:0.5150589999999999},{x:0.3663915263934284,y:0.5150589999999999},{x:0.4250929420729598,y:0.48822590193711934},{x:0.480392,y:0.4376951204586189},{x:0.480392,y:0.20264468470162808},{x:0.4249051037436742,y:0.15194152341431572},{x:0.3661311050032371,y:0.124287},{x:0.2739261218560311,y:0.124287},{x:0.21407100266628776,y:0.15203091487935444},{x:0.15223458736534265,y:0.208535427414771},{x:0.121661,y:0.29320659086815803}]],h:[[{x:0.047041,y:0.05318299999999998},{x:0.04790566238185463,y:0.04440393550927419},{x:0.050466421036992094,y:0.03596224554357094},{x:0.05462486744638546,y:0.028182339514117884},{x:0.06022119484660536,y:0.021363194846605343},{x:0.06704033951411792,y:0.01576686744638544},{x:0.07482024554357096,y:0.011608421036992077},{x:0.08326193550927423,y:0.009047662381854615},{x:0.092041,y:0.008182999999999982},{x:0.10082006449072577,y:0.009047662381854615},{x:0.10926175445642904,y:0.011608421036992077},{x:0.1170416604858821,y:0.015766867446385446},{x:0.12386080515339463,y:0.021363194846605343},{x:0.12945713255361452,y:0.028182339514117884},{x:0.1336155789630079,y:0.03596224554357094},{x:0.13617633761814535,y:0.04440393550927421},{x:0.137041,y:0.05318299999999998},{x:0.137041,y:0.3692271498339558},{x:0.23047284680205596,y:0.45237128863270537},{x:0.2915669774325256,y:0.478914},{x:0.38669764440631527,y:0.478914},{x:0.43644054132690624,y:0.4571557093088599},{x:0.465011,y:0.38123324165433015},{x:0.465011,y:0.05318299999999998},{x:0.4658756623818546,y:0.04440393550927419},{x:0.46843642103699207,y:0.03596224554357094},{x:0.47259486744638546,y:0.028182339514117884},{x:0.4781911948466053,y:0.021363194846605343},{x:0.4850103395141179,y:0.01576686744638544},{x:0.492790245543571,y:0.011608421036992077},{x:0.5012319355092743,y:0.009047662381854615},{x:0.510011,y:0.008182999999999982},{x:0.5187900644907257,y:0.009047662381854615},{x:0.527231754456429,y:0.011608421036992077},{x:0.5350116604858821,y:0.015766867446385446},{x:0.5418308051533947,y:0.021363194846605343},{x:0.5474271325536145,y:0.028182339514117884},{x:0.5515855789630079,y:0.03596224554357094},{x:0.5541463376181454,y:0.04440393550927421},{x:0.555011,y:0.05318299999999998},{x:0.555011,y:0.38942},{x:0.5546506186962206,y:0.39307901278178137},{x:0.554410350301749,y:0.3967478709583736},{x:0.5542188683658584,y:0.3974626474508545},{x:0.5541463376181454,y:0.3981990644907258},{x:0.5530790429582076,y:0.40171746346329923},{x:0.5521276325304605,y:0.40526895152034226},{x:0.5139866325304605,y:0.5066239515203422},{x:0.5138553396770835,y:0.5068902237569821},{x:0.5137747554395128,y:0.50717595947055},{x:0.511905898744729,y:0.5108438433478746},{x:0.5100853961903059,y:0.5145359657635786},{x:0.5099046789559015,y:0.5147715076888114},{x:0.5097698988494882,y:0.5150360318659072},{x:0.5072213830653152,y:0.5182688425286295},{x:0.504715563605999,y:0.5215348594178236},{x:0.5044923668525381,y:0.521730619287556},{x:0.5043085704011859,y:0.5219637664124008},{x:0.5011783335599848,y:0.5246372687597332},{x:0.4980834944323178,y:0.5273516689249697},{x:0.497826395485866,y:0.5275001237971909},{x:0.49760064588412606,y:0.5276929341565276},{x:0.49400898123224624,y:0.5297043869925788},{x:0.49044405536829966,y:0.5317628575577613},{x:0.490162934397186,y:0.5318583023949868},{x:0.48990390707565157,y:0.532003366394835},{x:0.41414290707565155,y:0.5651423663948351},{x:0.41372099607879415,y:0.5652794559590063},{x:0.41332975445642905,y:0.5654885789630079},{x:0.40952975949805703,y:0.5666412948313546},{x:0.4057531353317914,y:0.5678684156337233},{x:0.40531258638921414,y:0.5679205603081202},{x:0.4048880644907258,y:0.5680493376181454},{x:0.4009362016599996,y:0.5684385621342186},{x:0.39699274487562397,y:0.5689053213297277},{x:0.39655048803612764,y:0.5688705172237564},{x:0.396109,y:0.568914},{x:0.282214,y:0.568914},{x:0.28182836168040026,y:0.5688760179407144},{x:0.2814421286004882,y:0.5689073796745989},{x:0.27744221175957573,y:0.5684440198796774},{x:0.2734349355092742,y:0.5680493376181454},{x:0.2730641170540284,y:0.5679368510695262},{x:0.2726791869636831,y:0.5678922598605547},{x:0.26884652441488044,y:0.5666574583296339},{x:0.26499324554357095,y:0.5654885789630079},{x:0.2646514972979566,y:0.5653059107200353},{x:0.264282662844679,y:0.5651870801833616},{x:0.18800566284467896,y:0.5320480801833616},{x:0.1856267698486466,y:0.5307235797343987},{x:0.1831549202301779,y:0.529581917442145},{x:0.18178185218619736,y:0.5285828381463435},{x:0.18029822995654404,y:0.527756799180932},{x:0.17822344394147954,y:0.5259936496360635},{x:0.17602181748454487,y:0.5243916901265875},{x:0.137041,y:0.4897030201456747},{x:0.137041,y:0.7597659999999999},{x:0.13617633761814535,y:0.7685450644907257},{x:0.1336155789630079,y:0.776986754456429},{x:0.12945713255361452,y:0.7847666604858821},{x:0.12386080515339463,y:0.7915858051533946},{x:0.11704166048588208,y:0.7971821325536145},{x:0.10926175445642904,y:0.8013405789630078},{x:0.10082006449072577,y:0.8039013376181453},{x:0.092041,y:0.804766},{x:0.08326193550927423,y:0.8039013376181453},{x:0.07482024554357093,y:0.8013405789630078},{x:0.06704033951411792,y:0.7971821325536145},{x:0.06022119484660536,y:0.7915858051533946},{x:0.05462486744638546,y:0.7847666604858821},{x:0.050466421036992094,y:0.776986754456429},{x:0.04790566238185463,y:0.7685450644907257},{x:0.047041,y:0.7597659999999999},{x:0.047041,y:0.05318299999999998}]],i:[[{x:0.216026,y:0.7597659999999999},{x:0.21689066238185462,y:0.7509869355092742},{x:0.21945142103699208,y:0.7425452455435709},{x:0.22360986744638545,y:0.7347653395141178},{x:0.22920619484660534,y:0.7279461948466053},{x:0.2360253395141179,y:0.7223498674463854},{x:0.24380524554357094,y:0.7181914210369921},{x:0.25224693550927424,y:0.7156306623818546},{x:0.261026,y:0.7147659999999999},{x:0.341026,y:0.7147659999999999},{x:0.3498050644907258,y:0.7156306623818546},{x:0.35824675445642906,y:0.7181914210369921},{x:0.3660266604858821,y:0.7223498674463854},{x:0.3728458051533946,y:0.7279461948466053},{x:0.37844213255361453,y:0.7347653395141178},{x:0.3826005789630079,y:0.7425452455435709},{x:0.38516133761814536,y:0.7509869355092742},{x:0.386026,y:0.7597659999999999},{x:0.38516133761814536,y:0.7685450644907257},{x:0.3826005789630079,y:0.776986754456429},{x:0.37844213255361453,y:0.7847666604858821},{x:0.3728458051533946,y:0.7915858051533946},{x:0.3660266604858821,y:0.7971821325536145},{x:0.35824675445642906,y:0.8013405789630078},{x:0.3498050644907258,y:0.8039013376181453},{x:0.341026,y:0.804766},{x:0.261026,y:0.804766},{x:0.25224693550927424,y:0.8039013376181453},{x:0.24380524554357094,y:0.8013405789630078},{x:0.2360253395141179,y:0.7971821325536145},{x:0.22920619484660534,y:0.7915858051533946},{x:0.22360986744638545,y:0.7847666604858821},{x:0.21945142103699208,y:0.776986754456429},{x:0.21689066238185462,y:0.7685450644907257},{x:0.216026,y:0.7597659999999999}],[{x:0.25597800000000004,y:0.05318299999999998},{x:0.25684266238185466,y:0.04440393550927419},{x:0.2594034210369921,y:0.03596224554357094},{x:0.2635618674463855,y:0.028182339514117884},{x:0.2691581948466054,y:0.021363194846605343},{x:0.27597733951411796,y:0.01576686744638544},{x:0.28375724554357096,y:0.011608421036992077},{x:0.2921989355092742,y:0.009047662381854615},{x:0.300978,y:0.008182999999999982},{x:0.3097570644907258,y:0.009047662381854615},{x:0.3181987544564291,y:0.011608421036992077},{x:0.32597866048588214,y:0.015766867446385446},{x:0.33279780515339463,y:0.021363194846605343},{x:0.33839413255361456,y:0.028182339514117884},{x:0.34255257896300795,y:0.03596224554357094},{x:0.3451133376181454,y:0.04440393550927421},{x:0.345978,y:0.05318299999999998},{x:0.345978,y:0.523911},{x:0.3451133376181454,y:0.5326900644907258},{x:0.34255257896300795,y:0.541131754456429},{x:0.33839413255361456,y:0.5489116604858821},{x:0.33279780515339463,y:0.5557308051533947},{x:0.32597866048588214,y:0.5613271325536145},{x:0.3181987544564291,y:0.5654855789630079},{x:0.3097570644907258,y:0.5680463376181454},{x:0.300978,y:0.5689110000000001},{x:0.2921989355092742,y:0.5680463376181454},{x:0.28375724554357096,y:0.5654855789630079},{x:0.27597733951411796,y:0.5613271325536145},{x:0.2691581948466054,y:0.5557308051533947},{x:0.2635618674463855,y:0.5489116604858821},{x:0.2594034210369921,y:0.541131754456429},{x:0.25684266238185466,y:0.5326900644907258},{x:0.25597800000000004,y:0.523911},{x:0.25597800000000004,y:0.05318299999999998}]],j:[[{x:0.11017199870220953,y:-0.1121580749666587},{x:0.11173080987432929,y:-0.12084080046598154},{x:0.114953584640513,y:-0.12905258085596802},{x:0.11971647357384912,y:-0.1364778420214504},{x:0.12583644152368842,y:-0.14283123533997366},{x:0.1330783015538362,y:-0.147868603469331},{x:0.14116375304461573,y:-0.15139636317729976},{x:0.23896575304461573,y:-0.18307436317729964},{x:0.2424293887998465,y:-0.18383095770413346},{x:0.24586120600074532,y:-0.1847208108507566},{x:0.24673197042105502,y:-0.1847708110651418},{x:0.2475840766296098,y:-0.18495694463669302},{x:0.2511287638648936,y:-0.18502327959701073},{x:0.25466824139749206,y:-0.18522652014211538},{x:0.25553202888155596,y:-0.18510568190524296},{x:0.2564040749666586,y:-0.1851220012977904},{x:0.25989359333942796,y:-0.1844955274762681},{x:0.2634047110671092,y:-0.18400434499968443},{x:0.3944597110671092,y:-0.15232634499968456},{x:0.39510744613291976,y:-0.15210060706564532},{x:0.39578357398914765,y:-0.1519849807175323},{x:0.3992672661785621,y:-0.15065089524264363},{x:0.4027898773796621,y:-0.14942325292878383},{x:0.40338112711156726,y:-0.1490754856432793},{x:0.40402170577913904,y:-0.1488301750218278},{x:0.4071781926350792,y:-0.14684208899421944},{x:0.4103936167153703,y:-0.14495080812962524},{x:0.41090565971774945,y:-0.14449437599440731},{x:0.41148607211771127,y:-0.14412880824922783},{x:0.41419405162048195,y:-0.14156312270000898},{x:0.41697872163578864,y:-0.1390808841476645},{x:0.4173918803832174,y:-0.13853332759371953},{x:0.41788982159253774,y:-0.13806155128824654},{x:0.42004522760849955,y:-0.13501686407422092},{x:0.422292130251795,y:-0.13203905886963707},{x:0.4225905272853119,y:-0.13142142018825975},{x:0.42298686170256505,y:-0.13086156542133753},{x:0.4245068631872901,y:-0.12745488216466036},{x:0.4261296512500701,y:-0.1240959456918764},{x:0.4263018193390199,y:-0.1234319603912164},{x:0.42658131605481786,y:-0.12280554206756752},{x:0.4588533160548179,y:-0.025908542067567514},{x:0.4594769463166796,y:-0.023162642495487502},{x:0.46029433761814537,y:-0.02046806449072583},{x:0.46045163429328767,y:-0.01887100454660151},{x:0.46080705178433234,y:-0.017306069686551954},{x:0.4608830007338393,y:-0.01449126757618431},{x:0.461159,y:-0.01168900000000006},{x:0.461159,y:0.534292},{x:0.46029433761814537,y:0.5430710644907257},{x:0.4577335789630079,y:0.551512754456429},{x:0.45357513255361454,y:0.5592926604858821},{x:0.4479788051533946,y:0.5661118051533947},{x:0.4411596604858821,y:0.5717081325536145},{x:0.43337975445642907,y:0.5758665789630079},{x:0.4249380644907258,y:0.5784273376181454},{x:0.416159,y:0.579292},{x:0.4073799355092742,y:0.5784273376181454},{x:0.39893824554357094,y:0.5758665789630079},{x:0.39115833951411794,y:0.5717081325536145},{x:0.3843391948466054,y:0.5661118051533947},{x:0.37874286744638547,y:0.5592926604858821},{x:0.3745844210369921,y:0.551512754456429},{x:0.37202366238185464,y:0.5430710644907257},{x:0.371159,y:0.534292},{x:0.371159,y:-0.004392296840350002},{x:0.3490732119536395,y:-0.07070509444595838},{x:0.254610065464387,y:-0.09353828321774525},{x:0.16889624695538427,y:-0.06577563682270039},{x:0.16027792337039018,y:-0.063893055363307},{x:0.15145792503334138,y:-0.0637279987022096},{x:0.14277519953401854,y:-0.06528680987432936},{x:0.13456341914403205,y:-0.06850958464051307},{x:0.12713815797854966,y:-0.0732724735738492},{x:0.12078476466002638,y:-0.07939244152368852},{x:0.11574739653066908,y:-0.08663430155383627},{x:0.11221963682270032,y:-0.0947197530446158},{x:0.11033705536330693,y:-0.10333807662960988},{x:0.11017199870220953,y:-0.1121580749666587}],[{x:0.3403,y:0.7597659999999999},{x:0.3411646623818546,y:0.7509869355092742},{x:0.34372542103699205,y:0.7425452455435709},{x:0.34788386744638544,y:0.7347653395141178},{x:0.3534801948466053,y:0.7279461948466053},{x:0.3602993395141179,y:0.7223498674463854},{x:0.36807924554357097,y:0.7181914210369921},{x:0.37652093550927423,y:0.7156306623818546},{x:0.3853,y:0.7147659999999999},{x:0.447023,y:0.7147659999999999},{x:0.4558020644907258,y:0.7156306623818546},{x:0.46424375445642907,y:0.7181914210369921},{x:0.4720236604858821,y:0.7223498674463854},{x:0.4788428051533946,y:0.7279461948466053},{x:0.48443913255361454,y:0.7347653395141178},{x:0.48859757896300793,y:0.7425452455435709},{x:0.49115833761814537,y:0.7509869355092742},{x:0.492023,y:0.7597659999999999},{x:0.49115833761814537,y:0.7685450644907257},{x:0.48859757896300793,y:0.776986754456429},{x:0.48443913255361454,y:0.7847666604858821},{x:0.4788428051533946,y:0.7915858051533946},{x:0.4720236604858821,y:0.7971821325536145},{x:0.46424375445642907,y:0.8013405789630078},{x:0.4558020644907258,y:0.8039013376181453},{x:0.447023,y:0.804766},{x:0.3853,y:0.804766},{x:0.37652093550927423,y:0.8039013376181453},{x:0.36807924554357097,y:0.8013405789630078},{x:0.3602993395141179,y:0.7971821325536145},{x:0.3534801948466053,y:0.7915858051533946},{x:0.34788386744638544,y:0.7847666604858821},{x:0.34372542103699205,y:0.776986754456429},{x:0.3411646623818546,y:0.7685450644907257},{x:0.3403,y:0.7597659999999999}]],k:[[{x:0.020185999999999996,y:0.05318299999999998},{x:0.02105066238185463,y:0.04440393550927419},{x:0.02361142103699209,y:0.03596224554357094},{x:0.027769867446385453,y:0.028182339514117884},{x:0.03336619484660536,y:0.021363194846605343},{x:0.04018533951411791,y:0.01576686744638544},{x:0.047965245543570956,y:0.011608421036992077},{x:0.056406935509274225,y:0.009047662381854615},{x:0.065186,y:0.008182999999999982},{x:0.07396506449072576,y:0.009047662381854615},{x:0.08240675445642903,y:0.011608421036992077},{x:0.0901866604858821,y:0.015766867446385446},{x:0.09700580515339463,y:0.021363194846605343},{x:0.10260213255361453,y:0.028182339514117884},{x:0.10676057896300789,y:0.03596224554357094},{x:0.10932133761814536,y:0.04440393550927421},{x:0.11018599999999999,y:0.05318299999999998},{x:0.11018599999999999,y:0.16578332733911408},{x:0.23477705990096162,y:0.26351643594805596},{x:0.5068321321577423,y:0.019673199736523116},{x:0.5139466814455551,y:0.014457569113271652},{x:0.5219420457215526,y:0.010730135081525344},{x:0.5305109676204599,y:0.008634140840755075},{x:0.539324148279209,y:0.008250134274186548},{x:0.5480429021075728,y:0.009592872538819623},{x:0.5563321722854605,y:0.012610754956160736},{x:0.5638734068086124,y:0.017187805997359452},{x:0.5703768002634768,y:0.02314813215774228},{x:0.5755924308867283,y:0.030262681445555134},{x:0.5793198649184746,y:0.03825804572155257},{x:0.5814158591592449,y:0.04682696762045996},{x:0.5817998657258134,y:0.05564014827920904},{x:0.5804571274611804,y:0.06435890210757275},{x:0.5774392450438393,y:0.07264817228546054},{x:0.5728621940026405,y:0.08018940680861247},{x:0.5669018678422577,y:0.08669280026347684},{x:0.3066862956724008,y:0.3199242805817128},{x:0.5215978711622948,y:0.4885076152557163},{x:0.5279716470169837,y:0.49460635247919954},{x:0.533033147947031,y:0.5018313661609891},{x:0.5365878633102175,y:0.5099050030771282},{x:0.5384991873886431,y:0.5185169978886772},{x:0.5386936690698568,y:0.5273363964646907},{x:0.5371638345319164,y:0.5360242742638681},{x:0.5339684744581735,y:0.5442467610146052},{x:0.5292303847442837,y:0.5516878711622948},{x:0.5231316475208004,y:0.5580616470169838},{x:0.5159066338390108,y:0.5631231479470311},{x:0.5078329969228718,y:0.5666778633102175},{x:0.4992210021113228,y:0.5685891873886431},{x:0.49040160353530926,y:0.5687836690698569},{x:0.4817137257361318,y:0.5672538345319164},{x:0.47349123898539475,y:0.5640584744581736},{x:0.46605012883770514,y:0.5593203847442837},{x:0.11018599999999999,y:0.28016947631338524},{x:0.11018599999999999,y:0.7597659999999999},{x:0.10932133761814536,y:0.7685450644907257},{x:0.10676057896300789,y:0.776986754456429},{x:0.10260213255361453,y:0.7847666604858821},{x:0.09700580515339463,y:0.7915858051533946},{x:0.09018666048588207,y:0.7971821325536145},{x:0.08240675445642903,y:0.8013405789630078},{x:0.07396506449072576,y:0.8039013376181453},{x:0.065186,y:0.804766},{x:0.056406935509274204,y:0.8039013376181453},{x:0.04796524554357093,y:0.8013405789630078},{x:0.04018533951411791,y:0.7971821325536145},{x:0.03336619484660536,y:0.7915858051533946},{x:0.027769867446385453,y:0.7847666604858821},{x:0.02361142103699209,y:0.776986754456429},{x:0.02105066238185463,y:0.7685450644907257},{x:0.020185999999999996,y:0.7597659999999999},{x:0.020185999999999996,y:0.05318299999999998}]],l:[[{x:0.25602600000000003,y:0.05355900000000002},{x:0.25689066238185465,y:0.044779935509274234},{x:0.2594514210369921,y:0.036338245543570985},{x:0.2636098674463855,y:0.028558339514117927},{x:0.26920619484660535,y:0.021739194846605386},{x:0.27602533951411795,y:0.016142867446385482},{x:0.283805245543571,y:0.01198442103699212},{x:0.2922469355092743,y:0.009423662381854658},{x:0.301026,y:0.008559000000000025},{x:0.3098050644907258,y:0.009423662381854658},{x:0.3182467544564291,y:0.01198442103699212},{x:0.32602666048588214,y:0.01614286744638549},{x:0.3328458051533947,y:0.021739194846605386},{x:0.33844213255361455,y:0.028558339514117927},{x:0.34260057896300794,y:0.036338245543570985},{x:0.3451613376181454,y:0.044779935509274255},{x:0.346026,y:0.05355900000000002},{x:0.346026,y:0.765137},{x:0.3451613376181454,y:0.7739160644907257},{x:0.34260057896300794,y:0.782357754456429},{x:0.33844213255361455,y:0.7901376604858821},{x:0.3328458051533947,y:0.7969568051533946},{x:0.32602666048588214,y:0.8025531325536145},{x:0.3182467544564291,y:0.8067115789630078},{x:0.3098050644907258,y:0.8092723376181453},{x:0.301026,y:0.810137},{x:0.2922469355092743,y:0.8092723376181453},{x:0.283805245543571,y:0.8067115789630078},{x:0.27602533951411795,y:0.8025531325536145},{x:0.26920619484660535,y:0.7969568051533946},{x:0.2636098674463855,y:0.7901376604858821},{x:0.2594514210369921,y:0.782357754456429},{x:0.25689066238185465,y:0.7739160644907257},{x:0.25602600000000003,y:0.765137},{x:0.25602600000000003,y:0.05355900000000002}]],m:[[{x:0.005538000000000001,y:0.03920400000000002},{x:0.006402662381854635,y:0.030424935509274227},{x:0.008963421036992096,y:0.02198324554357097},{x:0.013121867446385459,y:0.01420333951411792},{x:0.018718194846605363,y:0.00738419484660538},{x:0.025537339514117914,y:0.0017878674463854757},{x:0.03331724554357096,y:-0.002370578963007887},{x:0.04175893550927423,y:-0.004931337618145348},{x:0.050538,y:-0.005795999999999982},{x:0.059317064490725775,y:-0.004931337618145348},{x:0.06775875445642904,y:-0.002370578963007887},{x:0.0755386604858821,y:0.0017878674463854827},{x:0.08235780515339464,y:0.00738419484660538},{x:0.08795413255361453,y:0.01420333951411792},{x:0.0921125789630079,y:0.02198324554357098},{x:0.09467333761814536,y:0.030424935509274248},{x:0.095538,y:0.03920400000000002},{x:0.095538,y:0.3993271266071161},{x:0.14963521853994496,y:0.4943223065353007},{x:0.1738257653562211,y:0.5150589999999999},{x:0.22021623464377893,y:0.5150589999999999},{x:0.2416666625786254,y:0.49667119950297894},{x:0.27741,y:0.4029520066676719},{x:0.27741,y:0.03920400000000002},{x:0.2782746623818546,y:0.030424935509274227},{x:0.28083542103699205,y:0.02198324554357097},{x:0.28499386744638544,y:0.01420333951411792},{x:0.2905901948466053,y:0.00738419484660538},{x:0.2974093395141179,y:0.0017878674463854757},{x:0.30518924554357096,y:-0.002370578963007887},{x:0.31363093550927423,y:-0.004931337618145348},{x:0.32241,y:-0.005795999999999982},{x:0.33118906449072577,y:-0.004931337618145348},{x:0.33963075445642904,y:-0.002370578963007887},{x:0.3474106604858821,y:0.0017878674463854827},{x:0.35422980515339464,y:0.00738419484660538},{x:0.3598261325536145,y:0.01420333951411792},{x:0.3639845789630079,y:0.02198324554357098},{x:0.36654533761814534,y:0.030424935509274248},{x:0.36740999999999996,y:0.03920400000000002},{x:0.36740999999999996,y:0.3993264781598986},{x:0.4215891088917321,y:0.494459500052724},{x:0.445289826307752,y:0.5150589999999999},{x:0.4920928256254945,y:0.5150589999999999},{x:0.5065149999999999,y:0.5026965582556255},{x:0.5065149999999999,y:0.03920400000000002},{x:0.5073796623818546,y:0.030424935509274227},{x:0.5099404210369921,y:0.02198324554357097},{x:0.5140988674463854,y:0.01420333951411792},{x:0.5196951948466053,y:0.00738419484660538},{x:0.5265143395141179,y:0.0017878674463854757},{x:0.534294245543571,y:-0.002370578963007887},{x:0.5427359355092742,y:-0.004931337618145348},{x:0.551515,y:-0.005795999999999982},{x:0.5602940644907257,y:-0.004931337618145348},{x:0.568735754456429,y:-0.002370578963007887},{x:0.5765156604858821,y:0.0017878674463854827},{x:0.5833348051533946,y:0.00738419484660538},{x:0.5889311325536145,y:0.01420333951411792},{x:0.5930895789630078,y:0.02198324554357098},{x:0.5956503376181453,y:0.030424935509274248},{x:0.596515,y:0.03920400000000002},{x:0.596515,y:0.523393},{x:0.5963454778388272,y:0.5251141873868636},{x:0.5963825315707437,y:0.5268433058919912},{x:0.5959141404350922,y:0.5294936295415332},{x:0.5956503376181453,y:0.5321720644907257},{x:0.5951482857762117,y:0.5338271076115645},{x:0.59484729324509,y:0.5355302304139588},{x:0.5938708496195351,y:0.5380382502602514},{x:0.5930895789630078,y:0.540613754456429},{x:0.592274291011045,y:0.5421390509322689},{x:0.5916468191910574,y:0.543750727977755},{x:0.5901998472565338,y:0.5460200622246176},{x:0.5889311325536145,y:0.5483936604858821},{x:0.5878339395503975,y:0.5497305940285525},{x:0.5869041018316961,y:0.5511888894721116},{x:0.5850422079081763,y:0.5531323288770946},{x:0.5833348051533946,y:0.5552128051533947},{x:0.581997871610724,y:0.5563099981566119},{x:0.5808014011353795,y:0.5575588705221693},{x:0.5380264011353795,y:0.5942248705221693},{x:0.5358211367621821,y:0.5957677297988329},{x:0.5337406604858821,y:0.5974751325536145},{x:0.5322153640100423,y:0.5982904205055773},{x:0.5307982404674333,y:0.599281876328501},{x:0.5283343527176928,y:0.600364864260089},{x:0.525960754456429,y:0.6016335789630078},{x:0.5243057113355902,y:0.6021356308049415},{x:0.5227223939887274,y:0.6028315689939708},{x:0.5200945686869033,y:0.6034130669616181},{x:0.5175190644907257,y:0.6041943376181453},{x:0.5157978771038628,y:0.6043638597793182},{x:0.5141092119504517,y:0.6047375358201355},{x:0.5114184349491921,y:0.6047951971830532},{x:0.50874,y:0.605059},{x:0.428467,y:0.605059},{x:0.42563553135621585,y:0.6047801246797119},{x:0.42279150043448566,y:0.6046996620098968},{x:0.4212557149999115,y:0.6043487504203328},{x:0.4196879355092742,y:0.6041943376181453},{x:0.41696527861756566,y:0.6033684286794448},{x:0.4141915924406847,y:0.6027346691689239},{x:0.4127537761476033,y:0.6020908833721776},{x:0.4112462455435709,y:0.6016335789630078},{x:0.40873703058140176,y:0.6002923756232341},{x:0.4061402803536474,y:0.5991296742945802},{x:0.40485568767586616,y:0.5982177546177817},{x:0.4034663395141179,y:0.5974751325536145},{x:0.4012669942053008,y:0.5956701765049598},{x:0.3989469715816508,y:0.5940232153181825},{x:0.3567609715816508,y:0.5573572153181825},{x:0.3545792701559384,y:0.5550484712393128},{x:0.3522737143614353,y:0.552863400803129},{x:0.35155574109793963,y:0.5518488790642903},{x:0.35070210094674875,y:0.5509455305944583},{x:0.3490127339279754,y:0.5482555195520005},{x:0.34717776483660073,y:0.5456626430091704},{x:0.33048446785976626,y:0.5163509060824124},{x:0.3216828574856715,y:0.5394287684036221},{x:0.32062739498214626,y:0.5415455848316745},{x:0.31976928952310246,y:0.5437498007710907},{x:0.3186639603788477,y:0.5454834136126945},{x:0.31774653490223986,y:0.5473233854865517},{x:0.3162983824161672,y:0.5491936173608123},{x:0.31502674401548947,y:0.5511880718386934},{x:0.3136044423732838,y:0.5526727347769701},{x:0.3123456842645886,y:0.5542983712755478},{x:0.3105604934838748,y:0.5558501466339272},{x:0.30892419049215825,y:0.5575581938831911},{x:0.2661511904921582,y:0.594224193883191},{x:0.26394553725639397,y:0.5957674011217274},{x:0.2618646604858821,y:0.5974751325536145},{x:0.26033982189406285,y:0.5982901757614695},{x:0.258923146662659,y:0.5992813666868191},{x:0.25645880963824363,y:0.6003646200309664},{x:0.25408475445642903,y:0.6016335789630078},{x:0.25243020816870526,y:0.6021354800922637},{x:0.25084738219782576,y:0.6028312459348294},{x:0.24821906447459133,y:0.6034129165660671},{x:0.24564306449072576,y:0.6041943376181453},{x:0.24392239379305308,y:0.6043638088898747},{x:0.2422342441971012,y:0.6047374117585159},{x:0.2395429505511757,y:0.6047951464006902},{x:0.236864,y:0.605059},{x:0.157178,y:0.605059},{x:0.1544990494488241,y:0.6047951464006902},{x:0.1518077558028988,y:0.6047374117585159},{x:0.15011960620694695,y:0.6043638088898747},{x:0.14839893550927424,y:0.6041943376181453},{x:0.14582293552540848,y:0.6034129165660671},{x:0.1431946178021742,y:0.6028312459348294},{x:0.1416117918312948,y:0.6021354800922637},{x:0.13995724554357097,y:0.6016335789630078},{x:0.13758319036175665,y:0.6003646200309664},{x:0.135118853337341,y:0.5992813666868191},{x:0.13370217810593676,y:0.5982901757614691},{x:0.13217733951411792,y:0.5974751325536145},{x:0.13009646274360603,y:0.5957674011217274},{x:0.1278908095078418,y:0.594224193883191},{x:0.09495385911112918,y:0.5659898819750746},{x:0.09467333761814536,y:0.5688380644907257},{x:0.0921125789630079,y:0.577279754456429},{x:0.08795413255361453,y:0.5850596604858821},{x:0.08235780515339464,y:0.5918788051533946},{x:0.07553866048588208,y:0.5974751325536145},{x:0.06775875445642904,y:0.6016335789630078},{x:0.059317064490725775,y:0.6041943376181453},{x:0.050538,y:0.605059},{x:0.04175893550927421,y:0.6041943376181453},{x:0.033317245543570934,y:0.6016335789630078},{x:0.025537339514117904,y:0.5974751325536145},{x:0.018718194846605356,y:0.5918788051533946},{x:0.013121867446385459,y:0.5850596604858821},{x:0.008963421036992096,y:0.577279754456429},{x:0.006402662381854635,y:0.5688380644907257},{x:0.005538000000000001,y:0.560059},{x:0.005538000000000001,y:0.03920400000000002}]],n:[[{x:0.047041,y:0.03920400000000002},{x:0.04790566238185463,y:0.030424935509274227},{x:0.050466421036992094,y:0.02198324554357097},{x:0.05462486744638546,y:0.01420333951411792},{x:0.06022119484660536,y:0.00738419484660538},{x:0.06704033951411792,y:0.0017878674463854757},{x:0.07482024554357096,y:-0.002370578963007887},{x:0.08326193550927423,y:-0.004931337618145348},{x:0.092041,y:-0.005795999999999982},{x:0.10082006449072577,y:-0.004931337618145348},{x:0.10926175445642904,y:-0.002370578963007887},{x:0.1170416604858821,y:0.0017878674463854827},{x:0.12386080515339463,y:0.00738419484660538},{x:0.12945713255361452,y:0.01420333951411792},{x:0.1336155789630079,y:0.02198324554357098},{x:0.13617633761814535,y:0.030424935509274248},{x:0.137041,y:0.03920400000000002},{x:0.137041,y:0.3923986904044417},{x:0.23217657812189968,y:0.4860775193429304},{x:0.29246969284729285,y:0.5150589999999999},{x:0.3857956927587408,y:0.5150589999999999},{x:0.4353266752666751,y:0.4910865745843881},{x:0.465011,y:0.4037995608673687},{x:0.465011,y:0.03920400000000002},{x:0.4658756623818546,y:0.030424935509274227},{x:0.46843642103699207,y:0.02198324554357097},{x:0.47259486744638546,y:0.01420333951411792},{x:0.4781911948466053,y:0.00738419484660538},{x:0.4850103395141179,y:0.0017878674463854757},{x:0.492790245543571,y:-0.002370578963007887},{x:0.5012319355092743,y:-0.004931337618145348},{x:0.510011,y:-0.005795999999999982},{x:0.5187900644907257,y:-0.004931337618145348},{x:0.527231754456429,y:-0.002370578963007887},{x:0.5350116604858821,y:0.0017878674463854827},{x:0.5418308051533947,y:0.00738419484660538},{x:0.5474271325536145,y:0.01420333951411792},{x:0.5515855789630079,y:0.02198324554357098},{x:0.5541463376181454,y:0.030424935509274248},{x:0.555011,y:0.03920400000000002},{x:0.555011,y:0.411242},{x:0.5547211401667089,y:0.41418499627592825},{x:0.5546227314347089,y:0.4171405946120584},{x:0.5542897326303223,y:0.4185651504993601},{x:0.5541463376181454,y:0.4200210644907258},{x:0.5532878972691104,y:0.42285096307022063},{x:0.5526147708021555,y:0.4257305718218671},{x:0.5144747708021555,y:0.537881571821867},{x:0.5144109474804813,y:0.5380222238814931},{x:0.5143747633675698,y:0.5381723808934484},{x:0.5125889395552703,y:0.5420375142269895},{x:0.5108295711501452,y:0.5459147613418461},{x:0.5107395343200961,y:0.546040259499208},{x:0.5106747512949527,y:0.5461804721160435},{x:0.5081691914797779,y:0.5496229410537735},{x:0.5056872154570532,y:0.5530824522038071},{x:0.5055744251835149,y:0.5531879736350976},{x:0.505483532821465,y:0.5533128535645805},{x:0.5023545242619802,y:0.5562003659557777},{x:0.4992453215682988,y:0.5591091940676126},{x:0.49911411231822944,y:0.5591906836434047},{x:0.49900060356177384,y:0.559295431819878},{x:0.49536839230215873,y:0.5615170221826804},{x:0.49175144785337105,y:0.5637633826232722},{x:0.4916068619246677,y:0.563817708744868},{x:0.49147509885166074,y:0.5638982997546532},{x:0.41571709885166075,y:0.6005642997546532},{x:0.4144883994140345,y:0.6010164083750983},{x:0.41333375445642906,y:0.6016335789630078},{x:0.41035728417594536,y:0.6025364813514484},{x:0.4074382196167836,y:0.6036105717354909},{x:0.4061449272779714,y:0.6038142858466193},{x:0.4048920644907258,y:0.6041943376181453},{x:0.4017966387343604,y:0.6044992104448776},{x:0.3987241185432898,y:0.6049831812385367},{x:0.3974159338025849,y:0.6049306722213019},{x:0.396113,y:0.605059},{x:0.282216,y:0.605059},{x:0.28097323419788345,y:0.6049365982521052},{x:0.2797255990169867,y:0.6049900349640848},{x:0.2765922846246742,y:0.6045051123806029},{x:0.2734369355092743,y:0.6041943376181453},{x:0.2722419284999821,y:0.603831836204989},{x:0.27100784129389754,y:0.6036408445963318},{x:0.26802933636200627,y:0.6025539603505436},{x:0.264995245543571,y:0.6016335789630078},{x:0.2638939207763026,y:0.6010449086106044},{x:0.2627208068242762,y:0.6006168283817219},{x:0.18644080682427616,y:0.563950828381722},{x:0.18387931815291048,y:0.5623935720684188},{x:0.18122474955630472,y:0.5610008994562176},{x:0.18011833133270075,y:0.5601070811947741},{x:0.17890296169536754,y:0.5593681975674947},{x:0.17669449694619624,y:0.5573411418478543},{x:0.17436263208920222,y:0.5554573484070612},{x:0.137041,y:0.5187071981771466},{x:0.137041,y:0.560059},{x:0.13617633761814535,y:0.5688380644907257},{x:0.1336155789630079,y:0.577279754456429},{x:0.12945713255361452,y:0.5850596604858821},{x:0.12386080515339463,y:0.5918788051533946},{x:0.11704166048588208,y:0.5974751325536145},{x:0.10926175445642904,y:0.6016335789630078},{x:0.10082006449072577,y:0.6041943376181453},{x:0.092041,y:0.605059},{x:0.08326193550927423,y:0.6041943376181453},{x:0.07482024554357093,y:0.6016335789630078},{x:0.06704033951411792,y:0.5974751325536145},{x:0.06022119484660536,y:0.5918788051533946},{x:0.05462486744638546,y:0.5850596604858821},{x:0.050466421036992094,y:0.577279754456429},{x:0.04790566238185463,y:0.5688380644907257},{x:0.047041,y:0.560059},{x:0.047041,y:0.03920400000000002}]],o:[[{x:0.021894999999999998,y:0.25490100000000004},{x:0.022142430975592695,y:0.2523887911456351},{x:0.02217771682540861,y:0.24986467341374632},{x:0.02257373987793045,y:0.24800963837050735},{x:0.02275966238185463,y:0.24612193550927428},{x:0.023492446675001572,y:0.24370626943231966},{x:0.02401948545822835,y:0.2412375358426815},{x:0.060310485458228355,y:0.12735753584268142},{x:0.06080304558444478,y:0.12621387418764726},{x:0.061129830312657105,y:0.12501229639135567},{x:0.06254436541764224,y:0.12217075210694647},{x:0.06379993607002282,y:0.11925547753662338},{x:0.06450614911208748,y:0.11822988473324028},{x:0.0650610709625847,y:0.11711514745523491},{x:0.06700278396163635,y:0.114604164756607},{x:0.06880297103068717,y:0.11198985605258731},{x:0.06969569761744246,y:0.11112174505713},{x:0.07045743125471368,y:0.1101366870258529},{x:0.14244943125471368,y:0.0338456870258529},{x:0.144568728324263,y:0.03200109409682955},{x:0.1465508815997487,y:0.0300098604251366},{x:0.14788834203377002,y:0.029111770054614114},{x:0.1491035320893312,y:0.02805409342394511},{x:0.1515419696884587,y:0.026658398178569347},{x:0.15387450686277807,y:0.025092124424329433},{x:0.22587150686277807,y:-0.01360287557567049},{x:0.22795933917571506,y:-0.014473279294209745},{x:0.22995424554357097,y:-0.015539578963007873},{x:0.23202067225559728,y:-0.016166422653018674},{x:0.2340138134199343,y:-0.01699735024728135},{x:0.23623133596214702,y:-0.01744371352418634},{x:0.23839593550927424,y:-0.018100337618145335},{x:0.2405449475487996,y:-0.01831199682974963},{x:0.24266189699648397,y:-0.01873811583170923},{x:0.2449238916202761,y:-0.018743285176571887},{x:0.247175,y:-0.018964999999999968},{x:0.354874,y:-0.018964999999999968},{x:0.35712497901801044,y:-0.018743297917588594},{x:0.3593868436844028,y:-0.018738141970160445},{x:0.36150392306047363,y:-0.018312009573623896},{x:0.3636530644907258,y:-0.018100337618145335},{x:0.36581753964743763,y:-0.017443751257606326},{x:0.36803493734305537,y:-0.016997426474138877},{x:0.370028203326089,y:-0.016166460394901543},{x:0.3720947544564291,y:-0.015539578963007873},{x:0.3740895461854217,y:-0.014473340569958804},{x:0.376177263560353,y:-0.01360299896157894},{x:0.448175263560353,y:0.025092001038420984},{x:0.4505076595021602,y:0.026658160356610353},{x:0.4529459593263057,y:0.028053731854915283},{x:0.45416130097157975,y:0.029111510806286087},{x:0.45549891730603415,y:0.030009694621828502},{x:0.4574809543881169,y:0.03200078850323144},{x:0.4596001404718476,y:0.03384523318438343},{x:0.5315941404718476,y:0.11013623318438343},{x:0.5323560786638525,y:0.11112152750713142},{x:0.5332490289693128,y:0.11198985605258731},{x:0.5350490398057314,y:0.11460390882403626},{x:0.5369905975332091,y:0.11711461878219896},{x:0.5375456739097991,y:0.11822962771804991},{x:0.5382520639299772,y:0.11925547753662338},{x:0.5395075116659538,y:0.12217046671076734},{x:0.5409219476918898,y:0.12501171320336152},{x:0.5412488309792026,y:0.126213587584214},{x:0.5417415145417717,y:0.12735753584268142},{x:0.5780325145417716,y:0.2412375358426815},{x:0.5785595533249983,y:0.2437062694323195},{x:0.5792923376181454,y:0.24612193550927428},{x:0.5794782601220696,y:0.2480096383705079},{x:0.5798742831745913,y:0.24986467341374632},{x:0.5799095690244073,y:0.25238879114563434},{x:0.580157,y:0.25490100000000004},{x:0.580157,y:0.33119200000000004},{x:0.5799156873690254,y:0.3336420882589673},{x:0.5798881240960263,y:0.3361038771468651},{x:0.5794843860383102,y:0.3380211641581212},{x:0.5792923376181454,y:0.33997106449072584},{x:0.5785776732343003,y:0.3423269972319261},{x:0.5780703683949873,y:0.3447361062088315},{x:0.5417793683949873,y:0.4597211062088315},{x:0.5412650895934552,y:0.4609244011905288},{x:0.540921633437906,y:0.46218711230867804},{x:0.5395351283421765,y:0.46497211555478546},{x:0.5383124760126231,y:0.46783284286481475},{x:0.5375733277285976,y:0.46891268605384906},{x:0.5369901282681178,y:0.47008412955994733},{x:0.5350869372989228,y:0.47254512602400234},{x:0.5333296776789325,y:0.47511235762423976},{x:0.5323940649664491,y:0.4760272512524403},{x:0.5315935342292432,y:0.47706240922950055},{x:0.45959953422924316,y:0.5533504092295005},{x:0.4572787448447235,y:0.5553702403350376},{x:0.45508230823461715,y:0.5575246421731296},{x:0.45395838697349994,y:0.5582600166131206},{x:0.4529452394037514,y:0.5591417799431011},{x:0.45027499383570063,y:0.5606700370119551},{x:0.44770045819082444,y:0.5623545390972755},{x:0.3757024581908245,y:0.5999485390972755},{x:0.37385313535723513,y:0.6006937047902838},{x:0.3720947544564291,y:0.6016335789630078},{x:0.36977177563531344,y:0.6023382468844833},{x:0.3675201821794923,y:0.6032455034042244},{x:0.36556101895058973,y:0.6036155659602718},{x:0.3636530644907258,y:0.6041943376181453},{x:0.36123724716457173,y:0.6044322748568528},{x:0.35885192047906295,y:0.6048828346046191},{x:0.35685820639902277,y:0.60486357272721},{x:0.354874,y:0.605059},{x:0.247175,y:0.605059},{x:0.24519066624232813,y:0.6048635601834779},{x:0.24319682408363533,y:0.6048828119349353},{x:0.24081162559758007,y:0.6044322623250186},{x:0.23839593550927424,y:0.6041943376181453},{x:0.23648785858508298,y:0.6036155288111242},{x:0.234528571713998,y:0.6032454313367869},{x:0.23227710201651716,y:0.602338209770572},{x:0.22995424554357097,y:0.6016335789630078},{x:0.2281957517789948,y:0.6006936444633418},{x:0.22634631449119302,y:0.5999484204015954},{x:0.15434931449119302,y:0.5623544204015953},{x:0.15177463525955168,y:0.5606698034147719},{x:0.14910425200363037,y:0.5591414183832311},{x:0.14809125527340347,y:0.55825976164439},{x:0.1469674919716301,y:0.5575244814106152},{x:0.14477093694990967,y:0.5553699388664325},{x:0.14245003748743465,y:0.5533499553954043},{x:0.07045803748743465,y:0.4770619553954044},{x:0.06965771196430402,y:0.47602703312304784},{x:0.06872232232106745,y:0.47511235762423976},{x:0.06696488716695402,y:0.4725448695811053},{x:0.06506154021654398,y:0.4700836008922148},{x:0.0644784960433022,y:0.46891242859710086},{x:0.06373952398737684,y:0.46783284286481475},{x:0.06251674952606694,y:0.46497182979435886},{x:0.06113014455468816,y:0.46218652912371366},{x:0.06078678779193787,y:0.46092411430034236},{x:0.06027263160501272,y:0.4597211062088315},{x:0.023981631605012717,y:0.3447361062088315},{x:0.0234743267656997,y:0.3423269972319261},{x:0.02275966238185463,y:0.33997106449072584},{x:0.0225676139616898,y:0.3380211641581212},{x:0.022163875903973694,y:0.3361038771468651},{x:0.022136312630974576,y:0.33364208825896713},{x:0.021894999999999998,y:0.33119200000000004},{x:0.021894999999999998,y:0.25490100000000004}],[{x:0.111895,y:0.2618978965790472},{x:0.111895,y:0.324259211613835},{x:0.14299436878278687,y:0.42279496206129447},{x:0.20271328316555492,y:0.48607750096051383},{x:0.25821631520114247,y:0.5150589999999999},{x:0.3438328207386419,y:0.5150589999999999},{x:0.3993370917152178,y:0.4860772565752743},{x:0.4590577300605173,y:0.42279464888454726},{x:0.490157,y:0.324259211613835},{x:0.490157,y:0.2618978965790472},{x:0.4591028039244665,y:0.16445082019422033},{x:0.39914727445977055,y:0.10091681321598435},{x:0.3435475642149213,y:0.07103500000000003},{x:0.2585015743575747,y:0.07103500000000003},{x:0.20290309936793577,y:0.10091656436690524},{x:0.14294929572583875,y:0.164450507494742},{x:0.111895,y:0.2618978965790472}]],p:[[{x:0.031904,y:-0.15424400000000005},{x:0.032768662381854635,y:-0.16302306449072582},{x:0.0353294210369921,y:-0.17146475445642909},{x:0.03948786744638546,y:-0.17924466048588214},{x:0.04508419484660536,y:-0.18606380515339468},{x:0.051903339514117915,y:-0.19166013255361458},{x:0.05968324554357096,y:-0.19581857896300794},{x:0.06812493550927423,y:-0.1983793376181454},{x:0.076904,y:-0.19924400000000003},{x:0.08568306449072577,y:-0.1983793376181454},{x:0.09412475445642904,y:-0.19581857896300794},{x:0.1019046604858821,y:-0.19166013255361458},{x:0.10872380515339464,y:-0.18606380515339468},{x:0.11432013255361453,y:-0.17924466048588214},{x:0.1184785789630079,y:-0.17146475445642909},{x:0.12103933761814537,y:-0.16302306449072582},{x:0.121904,y:-0.15424400000000005},{x:0.121904,y:0.08461372659928788},{x:0.12362832174470662,y:0.08333438131496537},{x:0.12536021772829115,y:0.08178035235824195},{x:0.1271620685101291,y:0.08071254912256186},{x:0.12884414120453105,y:0.07946455014784792},{x:0.13094744853162613,y:0.07846927732892851},{x:0.13294924262910485,y:0.07728298474798974},{x:0.20690724262910487,y:0.04275398474798971},{x:0.20784573679964677,y:0.04242345923251374},{x:0.20872324554357097,y:0.041954421036992075},{x:0.21199903754957586,y:0.040960720395783044},{x:0.21522783943974558,y:0.03982357810698025},{x:0.21621278303720604,y:0.03968249467654502},{x:0.21716493550927424,y:0.0393936623818546},{x:0.22057164546850772,y:0.03905813073713887},{x:0.2239602522910248,y:0.038572746319036566},{x:0.22495379448531613,y:0.03862652673075318},{x:0.225944,y:0.038528999999999966},{x:0.338005,y:0.038528999999999966},{x:0.33886621477794643,y:0.03861382225207184},{x:0.3397300481447032,y:0.038562076501738984},{x:0.34324908380057223,y:0.0390454971728409},{x:0.3467840644907258,y:0.0393936623818546},{x:0.3476121832677305,y:0.039644869466491955},{x:0.3484695134136621,y:0.03976264352593092},{x:0.35182662109175783,y:0.04092330520367998},{x:0.35522575445642907,y:0.04195442103699206},{x:0.3559889530923063,y:0.042362359206810904},{x:0.35680683330070073,y:0.04264512708496585},{x:0.4318888333007007,y:0.07717412708496588},{x:0.43400924312431544,y:0.07841428389434572},{x:0.43622962614931016,y:0.07946501028796468},{x:0.4378075563324746,y:0.08063579029221077},{x:0.43950360927818305,y:0.0816277549521855},{x:0.44134133343031445,y:0.08325775393151234},{x:0.4433140658676044,y:0.08472146615145025},{x:0.5183930658676044,y:0.1527974661514503},{x:0.519792625068414,y:0.15434228537837358},{x:0.5213447099268285,y:0.1557337827706549},{x:0.522746916505161,y:0.1576032022519019},{x:0.5243158963961404,y:0.15933502631539204},{x:0.52538718417891,y:0.1611232027292085},{x:0.5266379784876352,y:0.1627907596241023},{x:0.5276485364111687,y:0.16489781566710873},{x:0.5288495066792682,y:0.16690245600899573},{x:0.5295513540552914,y:0.16886527099294393},{x:0.530452790490496,y:0.17074480411415546},{x:0.5674347904904959,y:0.2723648041141554},{x:0.5682868803844835,y:0.2756900562357905},{x:0.5692833376181453,y:0.27897493550927416},{x:0.5693799285821196,y:0.2799556400244087},{x:0.5696245448495124,y:0.2809102467717411},{x:0.5698115375679212,y:0.2843378395980749},{x:0.570148,y:0.28775399999999995},{x:0.570148,y:0.355831},{x:0.5698183264321395,y:0.3591782319067787},{x:0.5696454905753794,y:0.362537215959393},{x:0.5693867528695432,y:0.3635600718226051},{x:0.5692833376181453,y:0.3646100644907258},{x:0.5683069860848939,y:0.3678286641524751},{x:0.567482165940186,y:0.37108938766543825},{x:0.530500165940186,y:0.47369538766543823},{x:0.5295747233109523,y:0.4756403735939819},{x:0.5288495066792682,y:0.4776685439910043},{x:0.5276841925618525,y:0.47961366765708685},{x:0.5267099630491849,y:0.4816611880905031},{x:0.5254228546094585,y:0.48338825675926556},{x:0.5243158963961404,y:0.48523597368460797},{x:0.5227934986603558,y:0.48691638083844907},{x:0.5214385372739072,y:0.48873449599152474},{x:0.5198392258792078,y:0.49017727712011666},{x:0.5183930658676044,y:0.4917735338485497},{x:0.4433140658676044,y:0.5598495338485497},{x:0.44114571117720175,y:0.5614583923016819},{x:0.43910641435493325,y:0.5632279843609703},{x:0.43761161896162687,y:0.5640805897495177},{x:0.43622962614931016,y:0.5651059897120353},{x:0.43378906307257026,y:0.5662609093863238},{x:0.43144372048223223,y:0.5675986521566495},{x:0.35636172048223225,y:0.6011446521566495},{x:0.355773047491519,y:0.6013410447411239},{x:0.35522575445642907,y:0.6016335789630078},{x:0.3515938477815883,y:0.6027353058079922},{x:0.3479935881359665,y:0.6039364213810477},{x:0.34737791203915763,y:0.6040141959337602},{x:0.3467840644907258,y:0.6041943376181453},{x:0.34300700763927916,y:0.6045663452480041},{x:0.3392415999493003,y:0.6050420059085138},{x:0.33862258083352115,y:0.60499817359702},{x:0.338005,y:0.605059},{x:0.225944,y:0.605059},{x:0.2251997336627212,y:0.6049856961639699},{x:0.22445344765540867,y:0.6050343071552383},{x:0.22081614914993766,y:0.6045539507735711},{x:0.21716493550927424,y:0.6041943376181453},{x:0.21644927090994795,y:0.6039772431353645},{x:0.21570784104506457,y:0.6038793269025836},{x:0.2122341450916469,y:0.6026985986973952},{x:0.20872324554357097,y:0.6016335789630078},{x:0.20806368527139987,y:0.6012810366527016},{x:0.20735560428285457,y:0.6010403560617851},{x:0.13339760428285458,y:0.5674943560617851},{x:0.13116986982932302,y:0.566206971138138},{x:0.12884414120453105,y:0.5651064498521521},{x:0.1273598902040749,y:0.5640052229355318},{x:0.12575970914356202,y:0.5630804946901414},{x:0.12382593632220404,y:0.5613832370749092},{x:0.121904,y:0.5599572734007121},{x:0.121904,y:0.560059},{x:0.12103933761814537,y:0.5688380644907257},{x:0.1184785789630079,y:0.577279754456429},{x:0.11432013255361453,y:0.5850596604858821},{x:0.10872380515339464,y:0.5918788051533946},{x:0.10190466048588208,y:0.5974751325536145},{x:0.09412475445642904,y:0.6016335789630078},{x:0.08568306449072577,y:0.6041943376181453},{x:0.076904,y:0.605059},{x:0.0681249355092742,y:0.6041943376181453},{x:0.059683245543570934,y:0.6016335789630078},{x:0.051903339514117915,y:0.5974751325536145},{x:0.04508419484660536,y:0.5918788051533946},{x:0.03948786744638546,y:0.5850596604858821},{x:0.0353294210369921,y:0.577279754456429},{x:0.032768662381854635,y:0.5688380644907257},{x:0.031904,y:0.560059},{x:0.031904,y:-0.15424400000000005}],[{x:0.121904,y:0.20607608160839302},{x:0.121904,y:0.438494918391607},{x:0.17699192809119763,y:0.48844251958412144},{x:0.23567259519301437,y:0.5150589999999999},{x:0.3284092961747297,y:0.5150589999999999},{x:0.38817711429028284,y:0.4883552464171925},{x:0.4496333594179428,y:0.43263133769024387},{x:0.48014799999999996,y:0.3479689286382035},{x:0.48014799999999996,y:0.29568777567179994},{x:0.44968806913177495,y:0.21198926897045803},{x:0.3879916447872207,y:0.1560475837631447},{x:0.32815352882369925,y:0.12852899999999995},{x:0.2359312215606538,y:0.12852899999999995},{x:0.17717907548697515,y:0.15595879598931894},{x:0.121904,y:0.20607608160839302}]],q:[[{x:0.031905,y:0.285813},{x:0.03224141038262204,y:0.2823973680650777},{x:0.0324282929389951,y:0.2789703010434802},{x:0.03267301908894614,y:0.2780151713289937},{x:0.032769662381854636,y:0.2770339355092742},{x:0.03376596546737772,y:0.2737495643941025},{x:0.03461784473664685,y:0.27042480648246636},{x:0.07159784473664685,y:0.1688028064824664},{x:0.0724995244823713,y:0.166922651750872},{x:0.0732016076706368,y:0.1649592141085361},{x:0.07440224792307432,y:0.1629551516523985},{x:0.07541246819615938,y:0.16084867156853302},{x:0.07666362241043057,y:0.15918055247485355},{x:0.0777352629490018,y:0.15739181137154173},{x:0.07930380642556048,y:0.15566048970702676},{x:0.08070556947724908,y:0.15379156924569237},{x:0.08225811700526783,y:0.15239959067120604},{x:0.08365813234923056,y:0.15085428642438087},{x:0.15873913234923054,y:0.08277728642438094},{x:0.16071062555900373,y:0.0813145118522212},{x:0.16254708404197357,y:0.07968542770293169},{x:0.16424441690754124,y:0.07869257021816739},{x:0.16582360332185575,y:0.07752087268448676},{x:0.16804258800473576,y:0.07647082416071167},{x:0.17016157800418052,y:0.07523131768336211},{x:0.24523757800418056,y:0.0406993176833621},{x:0.24605678866737324,y:0.04041603175027397},{x:0.24682124554357093,y:0.04000742103699214},{x:0.2502190216384501,y:0.03897671692697023},{x:0.2535747153580455,y:0.03781630621794852},{x:0.25443345146196317,y:0.037698283616711674},{x:0.2552629355092742,y:0.03744666238185468},{x:0.25879650468596477,y:0.037098636194782805},{x:0.2623141045905799,y:0.03661518582049534},{x:0.2631793653883337,y:0.03666696209348752},{x:0.264042,y:0.036582000000000045},{x:0.376106,y:0.036582000000000045},{x:0.3770966034546813,y:0.036679565924422064},{x:0.37809054588497415,y:0.03662578154659327},{x:0.38147875036256007,y:0.037111169723096304},{x:0.3848850644907258,y:0.03744666238185468},{x:0.3858375996101805,y:0.03773561075136079},{x:0.38682293652697,y:0.03787676837406198},{x:0.39005134306992567,y:0.03901383585544661},{x:0.39332675445642906,y:0.04000742103699214},{x:0.39420461585020444,y:0.04047664772778637},{x:0.3951434813083616,y:0.04080732274273922},{x:0.4691044813083616,y:0.07533932274273922},{x:0.47110618065167786,y:0.07652560719175487},{x:0.47320939667814427,y:0.07752087268448679},{x:0.4748915208069018,y:0.0787689461703934},{x:0.4766934263594154,y:0.07983682509171056},{x:0.47842523099597173,y:0.08139082758714347},{x:0.48014799999999996,y:0.08266905805748193},{x:0.48014799999999996,y:-0.15619500000000008},{x:0.4810126623818546,y:-0.16497406449072585},{x:0.483573421036992,y:-0.17341575445642912},{x:0.4877318674463854,y:-0.18119566048588218},{x:0.4933281948466053,y:-0.18801480515339472},{x:0.5001473395141178,y:-0.19361113255361462},{x:0.5079272455435709,y:-0.19776957896300798},{x:0.5163689355092742,y:-0.20033033761814545},{x:0.525148,y:-0.20119500000000007},{x:0.5339270644907257,y:-0.20033033761814545},{x:0.542368754456429,y:-0.19776957896300798},{x:0.5501486604858821,y:-0.19361113255361462},{x:0.5569678051533946,y:-0.18801480515339472},{x:0.5625641325536145,y:-0.18119566048588218},{x:0.5667225789630078,y:-0.17341575445642912},{x:0.5692833376181453,y:-0.16497406449072585},{x:0.570148,y:-0.15619500000000008},{x:0.570148,y:0.5581050000000001},{x:0.5692833376181453,y:0.5668840644907258},{x:0.5667225789630078,y:0.5753257544564291},{x:0.5625641325536145,y:0.5831056604858822},{x:0.5569678051533946,y:0.5899248051533947},{x:0.5501486604858821,y:0.5955211325536146},{x:0.542368754456429,y:0.5996795789630079},{x:0.5339270644907257,y:0.6022403376181454},{x:0.525148,y:0.6031050000000001},{x:0.5163689355092742,y:0.6022403376181454},{x:0.5079272455435709,y:0.5996795789630079},{x:0.5001473395141178,y:0.5955211325536146},{x:0.4933281948466053,y:0.5899248051533947},{x:0.4877318674463854,y:0.5831056604858822},{x:0.483573421036992,y:0.5753257544564291},{x:0.4810126623818546,y:0.5668840644907258},{x:0.48014799999999996,y:0.5581050000000001},{x:0.48014799999999996,y:0.558005596763998},{x:0.4782247267606458,y:0.559432223348863},{x:0.47629232280480055,y:0.5611281889595863},{x:0.4746904859851039,y:0.5620538174856352},{x:0.4732046002880372,y:0.5631560030691136},{x:0.4708804506539088,y:0.5642554633364756},{x:0.4686543108210992,y:0.5655418481335316},{x:0.3946933108210992,y:0.5990868481335316},{x:0.3939857884552202,y:0.5993273179516839},{x:0.39332675445642906,y:0.5996795789630079},{x:0.3898152875083263,y:0.6007447708163117},{x:0.38634099890642704,y:0.6019255978665906},{x:0.3856001580501581,y:0.6020234163584227},{x:0.3848850644907258,y:0.6022403376181454},{x:0.38123326077373504,y:0.6026000088910167},{x:0.3775953617236344,y:0.6030803465985108},{x:0.3768496724756141,y:0.6030317546542387},{x:0.376106,y:0.6031050000000001},{x:0.264042,y:0.6031050000000001},{x:0.26342400033164626,y:0.6030441323453897},{x:0.26280456058717394,y:0.6030879828235033},{x:0.25903957642572706,y:0.602612304281983},{x:0.2552629355092742,y:0.6022403376181454},{x:0.254668685221597,y:0.6020600737641458},{x:0.25405259303422617,y:0.6019822349683996},{x:0.25045275226756825,y:0.6007811844842303},{x:0.24682124554357093,y:0.5996795789630079},{x:0.24627358134186672,y:0.5993868463484354},{x:0.24568451278884912,y:0.5991903095800973},{x:0.17060851278884911,y:0.5656453095800973},{x:0.16826609518471405,y:0.5643091772352096},{x:0.16582839971196278,y:0.5631560030691136},{x:0.1644435861855132,y:0.5621287897998347},{x:0.16294590048199914,y:0.5612744987855388},{x:0.1609091582647261,y:0.559507056844315},{x:0.15874327554635076,y:0.5579004698017108},{x:0.08366227554635075,y:0.4898404698017108},{x:0.0822135909199537,y:0.48824184486316324},{x:0.08061175169940471,y:0.4867967151276658},{x:0.07925889408089541,y:0.48498133393711457},{x:0.07773859373239328,y:0.48330368097737925},{x:0.0766296214289207,y:0.4814531488185024},{x:0.0753404919252871,y:0.4797232835162987},{x:0.07436779238761855,y:0.4776788549378484},{x:0.07320399804016177,y:0.47573684172476444},{x:0.07247735524331753,y:0.47370551725863386},{x:0.07155047598047157,y:0.4717573941431678},{x:0.034570475980471575,y:0.3691493941431678},{x:0.03374586128764337,y:0.36588916100716024},{x:0.032769662381854636,y:0.3626710644907258},{x:0.032666195333495754,y:0.36162054591923504},{x:0.032407352052251925,y:0.36059717166956007},{x:0.03223462203187315,y:0.35723870865311785},{x:0.031905,y:0.353892},{x:0.031905,y:0.285813}],[{x:0.121905,y:0.2937462257558374},{x:0.121905,y:0.3460304727958324},{x:0.1524170009298456,y:0.4306917867874386},{x:0.21387346155335435,y:0.48640130996954867},{x:0.2736381428091649,y:0.513105},{x:0.36637802828147564,y:0.513105},{x:0.4250638403772601,y:0.4864880590885319},{x:0.48014799999999996,y:0.4365549481293854},{x:0.48014799999999996,y:0.20413270643748072},{x:0.4248733312055972,y:0.15401438585682045},{x:0.36611835928516706,y:0.12658200000000003},{x:0.27389496414813935,y:0.12658200000000003},{x:0.2140623112166411,y:0.15410266134357853},{x:0.15236330162501277,y:0.21004602219345103},{x:0.121905,y:0.2937462257558374}]],r:[[{x:0.062422000000000005,y:0.03920400000000002},{x:0.06328666238185464,y:0.030424935509274227},{x:0.0658474210369921,y:0.02198324554357097},{x:0.07000586744638546,y:0.01420333951411792},{x:0.07560219484660537,y:0.00738419484660538},{x:0.08242133951411793,y:0.0017878674463854757},{x:0.09020124554357097,y:-0.002370578963007887},{x:0.09864293550927423,y:-0.004931337618145348},{x:0.107422,y:-0.005795999999999982},{x:0.11620106449072577,y:-0.004931337618145348},{x:0.12464275445642904,y:-0.002370578963007887},{x:0.1324226604858821,y:0.0017878674463854827},{x:0.13924180515339463,y:0.00738419484660538},{x:0.14483813255361455,y:0.01420333951411792},{x:0.14899657896300791,y:0.02198324554357098},{x:0.15155733761814538,y:0.030424935509274248},{x:0.152422,y:0.03920400000000002},{x:0.152422,y:0.3275398012121413},{x:0.1925108808296549,y:0.4204278633799401},{x:0.27478075869941443,y:0.4836647262821032},{x:0.3576648607132649,y:0.5150589999999999},{x:0.49463,y:0.5150589999999999},{x:0.5034090644907258,y:0.5159236623818546},{x:0.511850754456429,y:0.5184844210369921},{x:0.5196306604858821,y:0.5226428674463854},{x:0.5264498051533947,y:0.5282391948466053},{x:0.5320461325536145,y:0.5350583395141179},{x:0.5362045789630079,y:0.542838245543571},{x:0.5387653376181454,y:0.5512799355092742},{x:0.53963,y:0.560059},{x:0.5387653376181454,y:0.5688380644907257},{x:0.5362045789630079,y:0.577279754456429},{x:0.5320461325536145,y:0.5850596604858821},{x:0.5264498051533947,y:0.5918788051533946},{x:0.5196306604858821,y:0.5974751325536145},{x:0.511850754456429,y:0.6016335789630078},{x:0.5034090644907258,y:0.6041943376181453},{x:0.49463,y:0.605059},{x:0.349428,y:0.605059},{x:0.34572095329292224,y:0.6046938877675093},{x:0.3420044651532413,y:0.6044424555930356},{x:0.34133700376168824,y:0.6042621064259311},{x:0.3406489355092742,y:0.6041943376181453},{x:0.33708434852821606,y:0.6031130319790114},{x:0.33348832364990477,y:0.6021413801353276},{x:0.23668632364990477,y:0.5654753801353276},{x:0.2347311434313091,y:0.5645060813254815},{x:0.23268939209293205,y:0.5637356779621759},{x:0.23078888495220712,y:0.562551669954317},{x:0.22878273496962892,y:0.5615571024090896},{x:0.2270542238076375,y:0.5602249916656349},{x:0.22520200238894322,y:0.5590710654608507},{x:0.152422,y:0.5031286093364514},{x:0.152422,y:0.560059},{x:0.15155733761814538,y:0.5688380644907257},{x:0.14899657896300791,y:0.577279754456429},{x:0.14483813255361455,y:0.5850596604858821},{x:0.13924180515339463,y:0.5918788051533946},{x:0.1324226604858821,y:0.5974751325536145},{x:0.12464275445642904,y:0.6016335789630078},{x:0.11620106449072577,y:0.6041943376181453},{x:0.107422,y:0.605059},{x:0.09864293550927423,y:0.6041943376181453},{x:0.09020124554357094,y:0.6016335789630078},{x:0.08242133951411793,y:0.5974751325536145},{x:0.07560219484660537,y:0.5918788051533946},{x:0.07000586744638546,y:0.5850596604858821},{x:0.0658474210369921,y:0.577279754456429},{x:0.06328666238185464,y:0.5688380644907257},{x:0.062422000000000005,y:0.560059},{x:0.062422000000000005,y:0.03920400000000002}]],s:[[{x:0.056563,y:0.369888},{x:0.056809270227573656,y:0.3673875764180495},{x:0.05684306423764694,y:0.36487528163458033},{x:0.05724057756471223,y:0.36300843953465567},{x:0.057427662381854636,y:0.3611089355092742},{x:0.05815700903783985,y:0.3587046018033244},{x:0.05868027810379197,y:0.35624717294397146},{x:0.05943435615016931,y:0.3544937526945111},{x:0.0599884210369921,y:0.352667245543571},{x:0.06117281573842168,y:0.3504513989095756},{x:0.06216545092350078,y:0.34814327358726177},{x:0.06324711489275962,y:0.3465706581451233},{x:0.06414686744638545,y:0.3448873395141179},{x:0.06574079456909979,y:0.3429451336955602},{x:0.0671646494598194,y:0.3408750118720105},{x:0.06853233161222538,y:0.3395436359667022},{x:0.06974319484660536,y:0.33806819484660533},{x:0.07168540066516299,y:0.33647426772389105},{x:0.07348575731657993,y:0.3347217030198468},{x:0.07508689839402109,y:0.33368273068076537},{x:0.07656233951411792,y:0.33247186744638546},{x:0.07877818614811302,y:0.331287472744956},{x:0.08088585786376518,y:0.3299198152391437},{x:0.15568385786376518,y:0.29122381523914376},{x:0.1574569269125657,y:0.29051717359061785},{x:0.15914024554357095,y:0.2896174210369921},{x:0.16154457924952065,y:0.28888807438100694},{x:0.16387856938737105,y:0.2879578823843842},{x:0.16575542835833412,y:0.2876107272686775},{x:0.16758193550927422,y:0.2870566623818547},{x:0.17008235909122482,y:0.286810392154281},{x:0.17255297371919248,y:0.2863534124236203},{x:0.17446149597461844,y:0.28637908481714247},{x:0.176361,y:0.28619200000000006},{x:0.288347309340128,y:0.28619200000000006},{x:0.3974525128623667,y:0.21942256309828728},{x:0.45549,y:0.1602321160680505},{x:0.45549,y:0.13007078589845048},{x:0.407404042616179,y:0.10590438131127383},{x:0.31753214348357883,y:0.07103500000000003},{x:0.21224543978224936,y:0.07103500000000003},{x:0.16354378174687056,y:0.09622932957230687},{x:0.14433666195924297,y:0.15500005013212306},{x:0.1407876006468136,y:0.16307617408904287},{x:0.13573115992893667,y:0.17030473007440486},{x:0.12936165598671553,y:0.1764079287355125},{x:0.12192386528459082,y:0.18115122757053267},{x:0.11370361794808405,y:0.18435234426530817},{x:0.10501681347236942,y:0.18588826170046568},{x:0.09619728088183255,y:0.18569995543032455},{x:0.08758394986787689,y:0.1837946619592429},{x:0.07950782591095708,y:0.18024560064681355},{x:0.07227926992559508,y:0.1751891599289366},{x:0.06617607126448745,y:0.1688196559867155},{x:0.06143277242946728,y:0.16138186528459075},{x:0.05823165573469179,y:0.153161617948084},{x:0.05669573829953427,y:0.14447481347236937},{x:0.0568840445696754,y:0.1356552808818325},{x:0.05878933804075704,y:0.12704194986787684},{x:0.08372233804075704,y:0.050750949867876836},{x:0.08542587043333498,y:0.04687444913825993},{x:0.08709879890390285,y:0.042984643121031924},{x:0.08719974017890864,y:0.04283789110571456},{x:0.0872713993531864,y:0.04267482591095703},{x:0.0896984666241539,y:0.03920515373890898},{x:0.0920981137517354,y:0.03571646140762123},{x:0.09222574536637099,y:0.03559222185697407},{x:0.09232784007106334,y:0.035446269925595034},{x:0.09538517138631239,y:0.032516763866873036},{x:0.0984193200775319,y:0.02956325371133576},{x:0.09856873722042347,y:0.029466301081615798},{x:0.09869734401328446,y:0.029343071264487396},{x:0.10226744784494098,y:0.027066310594042624},{x:0.10581949746716537,y:0.024761484353185106},{x:0.18061849746716538,y:-0.013933515646814817},{x:0.1823912439162618,y:-0.014639995851387814},{x:0.18407424554357094,y:-0.01553957896300786},{x:0.18647892276401756,y:-0.016269029822976466},{x:0.18881326125361947,y:-0.017199317363260178},{x:0.19068977232738848,y:-0.017546377073194466},{x:0.1925159355092742,y:-0.018100337618145335},{x:0.19501671633437545,y:-0.018346643031098245},{x:0.19748769126025723,y:-0.018803648509519946},{x:0.19939585369049342,y:-0.018777950414796084},{x:0.201295,y:-0.018964999999999968},{x:0.325956,y:-0.018964999999999968},{x:0.3298421413721484,y:-0.018582248482612737},{x:0.33373593654739714,y:-0.01828737118339306},{x:0.334227355251249,y:-0.018150342613638803},{x:0.3347350644907258,y:-0.018100337618145335},{x:0.33847186362931597,y:-0.016966791992147238},{x:0.34223331291484477,y:-0.015917938922943478},{x:0.44196531291484475,y:0.022777061077056446},{x:0.44388622686678575,y:0.02374867869889352},{x:0.4458951331158935,y:0.02452214291663178},{x:0.5206971331158935,y:0.06211514291663188},{x:0.5230429253028388,y:0.06359852573319036},{x:0.5254906604858821,y:0.06490686744638552},{x:0.526762463529903,y:0.06595060923072474},{x:0.5281530225051898,y:0.06682994172267823},{x:0.5301643473216751,y:0.06874246310749585},{x:0.5323098051533947,y:0.07050319484660542},{x:0.5333535469377338,y:0.07177499789062616},{x:0.5345458374532134,y:0.07290871885358566},{x:0.536145400814505,y:0.07517688168239829},{x:0.5379061325536145,y:0.07732233951411796},{x:0.538681702666837,y:0.0787733291400739},{x:0.5396299056666436,y:0.08011787031323085},{x:0.5407562372498129,y:0.08265451036052812},{x:0.5420645789630079,y:0.08510224554357101},{x:0.5425421726806072,y:0.08667666103386074},{x:0.5432098492552168,y:0.08818035245395842},{x:0.5438196647691762,y:0.09088798806528645},{x:0.5446253376181454,y:0.09354393550927428},{x:0.5447866012813922,y:0.09518127295954937},{x:0.5451480929944793,y:0.09678632860859225},{x:0.545217957571016,y:0.09956090686586556},{x:0.54549,y:0.10232300000000005},{x:0.54549,y:0.17861300000000002},{x:0.5450792542455133,y:0.1827833716312913},{x:0.5447095428008049,y:0.18695758114513777},{x:0.5446471218945653,y:0.18717088502046353},{x:0.5446253376181454,y:0.1873920644907258},{x:0.5434088850836819,y:0.19140217107899518},{x:0.5422319296624953,y:0.19542404720269643},{x:0.5421290946347417,y:0.1956210747891699},{x:0.5420645789630079,y:0.19583375445642906},{x:0.5400891672372728,y:0.199529489854385},{x:0.5381501975764,y:0.20324447414399938},{x:0.5380109003195782,y:0.20341765378196683},{x:0.5379061325536145,y:0.20361366048588211},{x:0.5352476756014034,y:0.20685299965477524},{x:0.5326212052175259,y:0.21011832734743824},{x:0.45781920521752584,y:0.28640632734743826},{x:0.45695946559173245,y:0.28712616331644525},{x:0.45621413415776596,y:0.2879638966272176},{x:0.45358375241990234,y:0.28995255364350675},{x:0.45105542866152953,y:0.29206944848930627},{x:0.4500717756605794,y:0.29260772613156716},{x:0.4491773318997613,y:0.2932839556822147},{x:0.3245133318997613,y:0.3695749556822147},{x:0.3213472249094816,y:0.3711082739568931},{x:0.3182447544564291,y:0.37276657896300797},{x:0.31738368821196916,y:0.37302778055263114},{x:0.3165738477898179,y:0.3734199792757539},{x:0.31316944110160955,y:0.3743061584374605},{x:0.3098030644907258,y:0.3753273376181454},{x:0.3089075854904768,y:0.3754155346015568},{x:0.3080367917497669,y:0.3756422053074494},{x:0.30452491480344407,y:0.37584718998797495},{x:0.301024,y:0.376192},{x:0.18731182116617404,y:0.376192},{x:0.146563,y:0.397272996602132},{x:0.146563,y:0.42779681790574337},{x:0.20153437253410483,y:0.48386323770148376},{x:0.2842918489876165,y:0.5150589999999999},{x:0.39008456648169626,y:0.5150589999999999},{x:0.4553477907191711,y:0.4822576837794137},{x:0.4635801440629335,y:0.47908783003036465},{x:0.47227272283422006,y:0.4775849365970516},{x:0.4810914761057044,y:0.47780675883128426},{x:0.48969750413477736,y:0.47974477222900047},{x:0.4977600820905977,y:0.48332450002217653},{x:0.5049693696238691,y:0.488408375279255},{x:0.5110483178577028,y:0.4948010275251766},{x:0.5157633162205862,y:0.5022567907191711},{x:0.5189331699696352,y:0.5104891440629334},{x:0.5204360634029483,y:0.51918172283422},{x:0.5202142411687157,y:0.5280004761057044},{x:0.5182762277709995,y:0.5366065041347774},{x:0.5146964999778234,y:0.5446690820905977},{x:0.509612624720745,y:0.551878369623869},{x:0.5032199724748234,y:0.5579573178577029},{x:0.49576420928082887,y:0.5626723162205862},{x:0.42096520928082887,y:0.6002663162205862},{x:0.41942927464851043,y:0.6008577252562829},{x:0.41797775445642904,y:0.6016335789630078},{x:0.4153223812886681,y:0.6024390776071881},{x:0.41273285593706643,y:0.6034361699696352},{x:0.41111105567880996,y:0.6037165692645292},{x:0.40953606449072577,y:0.6041943376181453},{x:0.40677456858393113,y:0.6044663212253706},{x:0.4040402771657799,y:0.6049390634029483},{x:0.4023949361559939,y:0.6048976773693867},{x:0.400757,y:0.605059},{x:0.276092,y:0.605059},{x:0.2724204350331364,y:0.6046973824138966},{x:0.26873912724910987,y:0.6044542166602351},{x:0.2680367190736708,y:0.6042656240771296},{x:0.2673129355092742,y:0.6041943376181453},{x:0.2637824667250502,y:0.6031233816208718},{x:0.26021933352302795,y:0.6021667007079561},{x:0.1604883335230279,y:0.5645727007079561},{x:0.15963695838633216,y:0.5641523105976027},{x:0.15873109713512196,y:0.563867735718488},{x:0.15568848233041307,y:0.5622026409240001},{x:0.1525785174681621,y:0.5606670094317409},{x:0.15182551530799093,y:0.5600886019499048},{x:0.15099257773152036,y:0.559632770334096},{x:0.14833326979676884,y:0.5574060851671644},{x:0.1455826488796249,y:0.5552932363569977},{x:0.14495695714670492,y:0.554579039378831},{x:0.14422895256892138,y:0.5539694683796904},{x:0.06943095256892137,y:0.47768146837969044},{x:0.06680494464711424,y:0.4744165369262552},{x:0.06414686744638545,y:0.4711776604858821},{x:0.0640418150384659,y:0.470981121254323},{x:0.0639021439692389,y:0.47080746737336276},{x:0.06196355058191934,y:0.4670929619312254},{x:0.0599884210369921,y:0.46339775445642906},{x:0.05992373008360734,y:0.46318449696300446},{x:0.05982062094636722,y:0.462986931318802},{x:0.05864394115023422,y:0.4589655982489849},{x:0.057427662381854636,y:0.45495606449072584},{x:0.05740581892006417,y:0.454734284101312},{x:0.05734323414113077,y:0.4545203990307778},{x:0.05697368708086039,y:0.4503467759079653},{x:0.056563,y:0.44617700000000005},{x:0.056563,y:0.369888}]],t:[[{x:0.036055000000000004,y:0.484201},{x:0.03691966238185464,y:0.4754219355092742},{x:0.0394804210369921,y:0.466980245543571},{x:0.04363886744638546,y:0.4592003395141179},{x:0.049235194846605365,y:0.45238119484660533},{x:0.05605433951411792,y:0.44678486744638546},{x:0.06383424554357096,y:0.44262642103699207},{x:0.07227593550927423,y:0.4400656623818546},{x:0.081055,y:0.439201},{x:0.201032,y:0.439201},{x:0.201032,y:0.17345100000000002},{x:0.2013458215844704,y:0.17026471598156256},{x:0.20148726326025637,y:0.1670661406603643},{x:0.20177732050748418,y:0.165883633894134},{x:0.20189666238185464,y:0.16467193550927425},{x:0.20282606714776777,y:0.16160809859877695},{x:0.20358880215081968,y:0.15849857690755997},{x:0.20410398165518515,y:0.15739537903902878},{x:0.2044574210369921,y:0.15623024554357098},{x:0.20596669248041014,y:0.15340659727526443},{x:0.20732140933230742,y:0.15050562638878262},{x:0.2623124093323074,y:0.05773162638878261},{x:0.2645408071528226,y:0.05469603003381387},{x:0.2666808493837164,y:0.051597510818645845},{x:0.2671477670132535,y:0.051144744093296994},{x:0.26753264280400524,y:0.05062045370997057},{x:0.2703104380556505,y:0.04807792433615628},{x:0.27301385108661325,y:0.04545644382682572},{x:0.2735601274310704,y:0.04510346799784869},{x:0.2740398919211364,y:0.04466433724917905},{x:0.27726033549019774,y:0.04271258283448707},{x:0.28042322867453984,y:0.040668883056825214},{x:0.28102787064035484,y:0.04042926278737637},{x:0.28158408674943697,y:0.04009216722176761},{x:0.28512341879560005,y:0.038806192593798694},{x:0.288624243922019,y:0.03741881178414046},{x:0.39861224392201905,y:0.005893811784140432},{x:0.4004470188387682,y:0.005558110934368086},{x:0.4022319355092743,y:0.0050166623818546086},{x:0.4047755505163489,y:0.004766138170207483},{x:0.4072897364122725,y:0.0043061284251197166},{x:0.4091547486303562,y:0.0043348248023798485},{x:0.411011,y:0.004151999999999975},{x:0.520997,y:0.004151999999999975},{x:0.5297760644907258,y:0.0050166623818546086},{x:0.538217754456429,y:0.00757742103699207},{x:0.5459976604858822,y:0.011735867446385433},{x:0.5528168051533947,y:0.017332194846605337},{x:0.5584131325536146,y:0.02415133951411788},{x:0.5625715789630079,y:0.031931245543570935},{x:0.5651323376181454,y:0.040372935509274205},{x:0.5659970000000001,y:0.049151999999999973},{x:0.5651323376181454,y:0.05793106449072574},{x:0.5625715789630079,y:0.06637275445642901},{x:0.5584131325536146,y:0.07415266048588207},{x:0.5528168051533947,y:0.08097180515339461},{x:0.5459976604858822,y:0.08656813255361451},{x:0.538217754456429,y:0.09072657896300787},{x:0.5297760644907258,y:0.09328733761814534},{x:0.520997,y:0.09415199999999997},{x:0.41733272532416527,y:0.09415199999999997},{x:0.33061421916568134,y:0.11900744701827656},{x:0.291032,y:0.1857856616511605},{x:0.291032,y:0.439201},{x:0.466004,y:0.439201},{x:0.47478306449072577,y:0.4400656623818546},{x:0.48322475445642904,y:0.44262642103699207},{x:0.4910046604858821,y:0.44678486744638546},{x:0.49782380515339464,y:0.45238119484660533},{x:0.5034201325536145,y:0.4592003395141179},{x:0.5075785789630078,y:0.466980245543571},{x:0.5101393376181453,y:0.4754219355092742},{x:0.511004,y:0.484201},{x:0.5101393376181453,y:0.4929800644907258},{x:0.5075785789630078,y:0.501421754456429},{x:0.5034201325536145,y:0.5092016604858821},{x:0.49782380515339464,y:0.5160208051533947},{x:0.4910046604858821,y:0.5216171325536145},{x:0.48322475445642904,y:0.5257755789630079},{x:0.47478306449072577,y:0.5283363376181454},{x:0.466004,y:0.529201},{x:0.291032,y:0.529201},{x:0.291032,y:0.702148},{x:0.2901673376181454,y:0.7109270644907257},{x:0.2876065789630079,y:0.719368754456429},{x:0.28344813255361456,y:0.7271486604858821},{x:0.27785180515339464,y:0.7339678051533947},{x:0.2710326604858821,y:0.7395641325536145},{x:0.26325275445642904,y:0.7437225789630079},{x:0.25481106449072577,y:0.7462833376181454},{x:0.246032,y:0.747148},{x:0.23725293550927423,y:0.7462833376181454},{x:0.22881124554357096,y:0.7437225789630079},{x:0.2210313395141179,y:0.7395641325536145},{x:0.21421219484660536,y:0.7339678051533947},{x:0.20861586744638547,y:0.7271486604858821},{x:0.2044574210369921,y:0.719368754456429},{x:0.20189666238185464,y:0.7109270644907257},{x:0.201032,y:0.702148},{x:0.201032,y:0.529201},{x:0.081055,y:0.529201},{x:0.07227593550927423,y:0.5283363376181454},{x:0.06383424554357094,y:0.5257755789630079},{x:0.05605433951411792,y:0.5216171325536145},{x:0.049235194846605365,y:0.5160208051533947},{x:0.04363886744638546,y:0.5092016604858821},{x:0.0394804210369921,y:0.501421754456429},{x:0.03691966238185464,y:0.4929800644907258},{x:0.036055000000000004,y:0.484201}]],u:[[{x:0.047041,y:0.17386599999999997},{x:0.04733731084809023,y:0.17085750547164297},{x:0.04744678100255899,y:0.1678364368310572},{x:0.0477687404511641,y:0.16647712720137547},{x:0.04790566238185463,y:0.1650869355092742},{x:0.048783207866406234,y:0.16219405573845885},{x:0.04947995583647738,y:0.15925239265237093},{x:0.08761895583647737,y:0.04817539265237096},{x:0.08938287590080696,y:0.04431825367483454},{x:0.09111755940033861,y:0.04044787795123246},{x:0.0912166047918106,y:0.04030846472648272},{x:0.0912877277290914,y:0.04015294120864865},{x:0.09377024504918263,y:0.03671403980837168},{x:0.09622666993792225,y:0.03325645223155292},{x:0.09635101037087945,y:0.03313904059014135},{x:0.09645110783403886,y:0.03300038080982997},{x:0.09955682066149267,y:0.030111872039067004},{x:0.10264058790854466,y:0.027199945760571206},{x:0.10278544504987946,y:0.027109047766032002},{x:0.10291067034954356,y:0.026992580340839414},{x:0.10652022788210418,y:0.024765467971757132},{x:0.11011283004156149,y:0.02251110668543916},{x:0.1858688300415615,y:-0.015231893314560811},{x:0.1873332068933575,y:-0.0157898639141544},{x:0.18871524554357097,y:-0.01652857896300789},{x:0.19144581156206075,y:-0.017356887109087667},{x:0.19411224226228255,y:-0.018372875537717062},{x:0.1956573361874375,y:-0.018634439137126358},{x:0.19715693550927424,y:-0.019089337618145352},{x:0.1999966293703256,y:-0.019369023051625026},{x:0.20281003486202434,y:-0.01984529472354478},{x:0.2043764687674932,y:-0.01980039958033106},{x:0.205936,y:-0.019953999999999986},{x:0.319832,y:-0.019953999999999986},{x:0.32132997950952447,y:-0.01980646189590665},{x:0.3228344649392302,y:-0.019853723877644197},{x:0.3257100002545037,y:-0.019375067506000147},{x:0.3286110644907258,y:-0.019089337618145352},{x:0.3300514774877758,y:-0.018652393112465325},{x:0.33153627500704863,y:-0.018405236421526333},{x:0.3342631764918695,y:-0.017374788187221168},{x:0.33705275445642907,y:-0.01652857896300789},{x:0.3383802466773209,y:-0.015819019588053155},{x:0.3397882963501792,y:-0.015286942317463331},{x:0.4160692963501792,y:0.02245605768253664},{x:0.4183042276197719,y:0.02384992521458428},{x:0.42064256487504254,y:0.025062345668598177},{x:0.4220380841989542,y:0.02617863282445781},{x:0.4235544084161923,y:0.027124324140885128},{x:0.42547446604244665,y:0.028927422360218155},{x:0.42753134130624215,y:0.03057273346328787},{x:0.465011,y:0.06712410441560081},{x:0.465011,y:0.025046000000000013},{x:0.4658756623818546,y:0.016266935509274223},{x:0.46843642103699207,y:0.007825245543570968},{x:0.47259486744638546,y:0.000045339514117916785},{x:0.4781911948466053,y:-0.006773805153394624},{x:0.4850103395141179,y:-0.012370132553614528},{x:0.492790245543571,y:-0.01652857896300789},{x:0.5012319355092743,y:-0.019089337618145352},{x:0.510011,y:-0.019953999999999986},{x:0.5187900644907257,y:-0.019089337618145352},{x:0.527231754456429,y:-0.01652857896300789},{x:0.5350116604858821,y:-0.012370132553614521},{x:0.5418308051533947,y:-0.006773805153394624},{x:0.5474271325536145,y:0.000045339514117916785},{x:0.5515855789630079,y:0.007825245543570974},{x:0.5541463376181454,y:0.016266935509274244},{x:0.555011,y:0.025046000000000013},{x:0.555011,y:0.545898},{x:0.5541463376181454,y:0.5546770644907257},{x:0.5515855789630079,y:0.563118754456429},{x:0.5474271325536145,y:0.5708986604858821},{x:0.5418308051533947,y:0.5777178051533947},{x:0.5350116604858821,y:0.5833141325536145},{x:0.527231754456429,y:0.5874725789630079},{x:0.5187900644907257,y:0.5900333376181454},{x:0.510011,y:0.590898},{x:0.5012319355092743,y:0.5900333376181454},{x:0.492790245543571,y:0.5874725789630079},{x:0.4850103395141179,y:0.5833141325536145},{x:0.4781911948466053,y:0.5777178051533947},{x:0.47259486744638546,y:0.5708986604858821},{x:0.46843642103699207,y:0.563118754456429},{x:0.4658756623818546,y:0.5546770644907257},{x:0.465011,y:0.545898},{x:0.465011,y:0.19283699530520199},{x:0.36978450462305706,y:0.099969048308901},{x:0.30930812362389754,y:0.07004600000000001},{x:0.2165251763155874,y:0.07004600000000001},{x:0.16675256431883717,y:0.09484360935890679},{x:0.137041,y:0.18137632992954258},{x:0.137041,y:0.545898},{x:0.13617633761814535,y:0.5546770644907257},{x:0.1336155789630079,y:0.563118754456429},{x:0.12945713255361452,y:0.5708986604858821},{x:0.12386080515339463,y:0.5777178051533947},{x:0.11704166048588208,y:0.5833141325536145},{x:0.10926175445642904,y:0.5874725789630079},{x:0.10082006449072577,y:0.5900333376181454},{x:0.092041,y:0.590898},{x:0.08326193550927423,y:0.5900333376181454},{x:0.07482024554357093,y:0.5874725789630079},{x:0.06704033951411792,y:0.5833141325536145},{x:0.06022119484660536,y:0.5777178051533947},{x:0.05462486744638546,y:0.5708986604858821},{x:0.050466421036992094,y:0.563118754456429},{x:0.04790566238185463,y:0.5546770644907257},{x:0.047041,y:0.545898},{x:0.047041,y:0.17386599999999997}]],v:[[{x:0.003930906419490336,y:0.5438334563092145},{x:0.005386967221411215,y:0.5351329102741644},{x:0.00851244255100142,y:0.5268836061622384},{x:0.26071044255100145,y:0.018289606162238365},{x:0.26144011887972296,y:0.017121905714788027},{x:0.2620056398700735,y:0.01586646241095203},{x:0.26377267234206975,y:0.013389122267562115},{x:0.26538522214413157,y:0.010808560104194675},{x:0.26632868500311185,y:0.009805649483352854},{x:0.267128264504625,y:0.008684656842684199},{x:0.2693446490294707,y:0.006599649029470163},{x:0.2714296568426842,y:0.00438326450462502},{x:0.27255064948335267,y:0.0035836850031119977},{x:0.2735535601041947,y:0.0026402221441315446},{x:0.27613412226756273,y:0.0010276723420693272},{x:0.278611462410952,y:-0.0007393601299264599},{x:0.2798669057147878,y:-0.0013048811202769175},{x:0.28103460616223835,y:-0.0020345574489985807},{x:0.28388017640738666,y:-0.0031126798553442526},{x:0.2866546460885495,y:-0.00436245420755494},{x:0.28799629407344673,y:-0.00467218403223142},{x:0.2892839102741644,y:-0.005160032778588779},{x:0.2922851349323858,y:-0.00566229614975999},{x:0.29525011283741587,y:-0.006346784254711718},{x:0.2966264067237199,y:-0.006388820170250395},{x:0.2979844563092145,y:-0.006616093580509658},{x:0.301026,y:-0.00652319621682493},{x:0.30406754369078554,y:-0.006616093580509658},{x:0.3054255932762801,y:-0.006388820170250395},{x:0.30680188716258416,y:-0.006346784254711718},{x:0.30976686506761425,y:-0.005662296149759988},{x:0.31276808972583564,y:-0.005160032778588779},{x:0.3140557059265533,y:-0.00467218403223142},{x:0.3153973539114505,y:-0.00436245420755494},{x:0.3181718235926135,y:-0.0031126798553442175},{x:0.3210173938377617,y:-0.0020345574489985807},{x:0.32218509428521225,y:-0.0013048811202769192},{x:0.323440537589048,y:-0.0007393601299264599},{x:0.32591787773243747,y:0.0010276723420694187},{x:0.32849843989580535,y:0.0026402221441315446},{x:0.32950135051664736,y:0.0035836850031119635},{x:0.3306223431573158,y:0.00438326450462502},{x:0.3327073509705293,y:0.006599649029470129},{x:0.334923735495375,y:0.008684656842684203},{x:0.33572331499688823,y:0.009805649483352899},{x:0.33666677785586846,y:0.01080856010419469},{x:0.3382793276579303,y:0.013389122267562135},{x:0.3400463601299265,y:0.01586646241095204},{x:0.34061188112027707,y:0.017121905714788034},{x:0.3413415574489986,y:0.018289606162238365},{x:0.5935395574489987,y:0.5268836061622384},{x:0.5966650327785888,y:0.5351329102741644},{x:0.5981210935805097,y:0.5438334563092145},{x:0.5978517842547117,y:0.5526508871625841},{x:0.595867454207555,y:0.5612463539114505},{x:0.5922443601299265,y:0.569289537589048},{x:0.587121735495375,y:0.5764713431573159},{x:0.5806964398958053,y:0.5825157778558685},{x:0.5732153938377617,y:0.5871905574489986},{x:0.5649660897258356,y:0.5903160327785888},{x:0.5562655436907855,y:0.5917720935805096},{x:0.5474481128374159,y:0.5915027842547117},{x:0.5388526460885495,y:0.589518454207555},{x:0.5308094624109521,y:0.5858953601299265},{x:0.5236276568426842,y:0.580772735495375},{x:0.5175832221441315,y:0.5743474398958054},{x:0.5129084425510014,y:0.5668663938377616},{x:0.301026,y:0.13957458745236595},{x:0.08914355744899859,y:0.5668663938377616},{x:0.08446877785586845,y:0.5743474398958054},{x:0.07842434315731579,y:0.580772735495375},{x:0.07124253758904797,y:0.5858953601299265},{x:0.06319935391145051,y:0.589518454207555},{x:0.054603887162584124,y:0.5915027842547117},{x:0.04578645630921451,y:0.5917720935805096},{x:0.037085910274164385,y:0.5903160327785888},{x:0.028836606162238352,y:0.5871905574489986},{x:0.02135556010419467,y:0.5825157778558685},{x:0.014930264504625007,y:0.5764713431573159},{x:0.009807639870073534,y:0.569289537589048},{x:0.006184545792445054,y:0.5612463539114505},{x:0.004200215745288276,y:0.5526508871625841},{x:0.003930906419490336,y:0.5438334563092145}]],w:[[{x:-0.04481226541001698,y:0.5427688011711321},{x:-0.0431501306438814,y:0.534105261341125},{x:0.1073618693561186,y:0.025511261341124997},{x:0.10747750697825527,y:0.02522662926113043},{x:0.10753949092041715,y:0.02492572151525217},{x:0.1091366577408943,y:0.021142772088450095},{x:0.11068223944402648,y:0.01733845540642648},{x:0.11085118408582124,y:0.017081852232977028},{x:0.1109706812129555,y:0.01679881881229654},{x:0.11327517574267339,y:0.0134001494872997},{x:0.11553324489331337,y:0.009970459715744673},{x:0.11574900410692728,y:0.009751746564891355},{x:0.11592142221145292,y:0.009497464285038355},{x:0.11884468401801046,y:0.006613684018010047},{x:0.12172846428503836,y:0.0036904222114529234},{x:0.12198274656489135,y:0.0035180041069272803},{x:0.12220145971574467,y:0.0033022448933133844},{x:0.1256311494872997,y:0.001044175742673395},{x:0.12902981881229655,y:-0.0012603187870445023},{x:0.12931285223297703,y:-0.0013798159141787526},{x:0.12956945540642648,y:-0.0015487605559735135},{x:0.1333737720884501,y:-0.0030943422591057004},{x:0.13715672151525218,y:-0.004691509079582858},{x:0.13745762926113045,y:-0.004753493021744735},{x:0.137742261341125,y:-0.004869130643881392},{x:0.14177500717701197,y:-0.005642829061426576},{x:0.14579686008065018,y:-0.006471289947453558},{x:0.1461040784358031,y:-0.006473378696506754},{x:0.14640580117113214,y:-0.006531265410016966},{x:0.150512,y:-0.006503347745684165},{x:0.15461819882886788,y:-0.006531265410016966},{x:0.15491992156419693,y:-0.006473378696506754},{x:0.15522713991934983,y:-0.006471289947453558},{x:0.159248992822988,y:-0.005642829061426585},{x:0.16328173865887502,y:-0.004869130643881392},{x:0.16356637073886957,y:-0.004753493021744732},{x:0.16386727848474786,y:-0.004691509079582851},{x:0.1676502279115502,y:-0.0030943422591055763},{x:0.17145454459357354,y:-0.0015487605559735135},{x:0.17171114776702298,y:-0.0013798159141787517},{x:0.17199418118770346,y:-0.0012603187870445023},{x:0.17539285051270065,y:0.001044175742673613},{x:0.17882254028425534,y:0.0033022448933133844},{x:0.17904125343510863,y:0.0035180041069272374},{x:0.17929553571496165,y:0.0036904222114529095},{x:0.18217931598198978,y:0.006613684018010279},{x:0.1851025777885471,y:0.009497464285038375},{x:0.18527499589307275,y:0.009751746564891386},{x:0.18549075510668664,y:0.009970459715744683},{x:0.1877488242573266,y:0.013400149487299715},{x:0.1900533187870445,y:0.016798818812296553},{x:0.19017281591417878,y:0.01708185223297707},{x:0.19034176055597352,y:0.01733845540642648},{x:0.19188734225910553,y:0.02114277208844964},{x:0.19348450907958287,y:0.02492572151525217},{x:0.19354649302174473,y:0.02522662926113043},{x:0.1936621306438814,y:0.025511261341124997},{x:0.30102443002882817,y:0.38829842311817664},{x:0.4083889386148475,y:0.025511027311792445},{x:0.40850451632069196,y:0.025226547135196155},{x:0.40856646677585007,y:0.0249257992040805},{x:0.410163689741502,y:0.021142697708463984},{x:0.41170935302882616,y:0.01733823938560964},{x:0.41187820927072055,y:0.017081773507688556},{x:0.41199764237598097,y:0.016798890297984457},{x:0.41430222163921304,y:0.013400082779514221},{x:0.4165603984391837,y:0.009970270005002412},{x:0.41677604416644776,y:0.009751674265617277},{x:0.4169483701745541,y:0.009497526820430955},{x:0.41987174204670485,y:0.006613627545966159},{x:0.42275565189129766,y:0.0036902661012626486},{x:0.42300979995956794,y:0.0035179410120882958},{x:0.4232283964786704,y:0.003302296075210584},{x:0.4266582174181369,y:0.0010441316765615349},{x:0.4300570332693414,y:-0.001260435297455717},{x:0.43033991691088264,y:-0.001379867379883588},{x:0.4305963833993421,y:-0.0015487226944633017},{x:0.43440084731088763,y:-0.0030943722258508074},{x:0.43818395458161874,y:-0.004691581512785238},{x:0.43848470273672896,y:-0.004753530880516994},{x:0.4387691833312223,y:-0.0048691075577547704},{x:0.44280208680029426,y:-0.005642843777199688},{x:0.4468241027997286,y:-0.0064713155198797695},{x:0.44713115788546864,y:-0.006473401493455157},{x:0.44743272015628793,y:-0.006531257986460835},{x:0.45153908096424766,y:-0.006503346644966049},{x:0.45564544187310013,y:-0.00653124313893301},{x:0.4559470039347234,y:-0.006473385555557348},{x:0.4562540590129192,y:-0.0064712984717510205},{x:0.4602760720167908,y:-0.005642812186517322},{x:0.4643089726882076,y:-0.004869061385152536},{x:0.46459345286480397,y:-0.004753483679308031},{x:0.46489420079591953,y:-0.0046915332241499325},{x:0.46867730229153426,y:-0.003094310258498727},{x:0.4724817606143904,y:-0.0015486469711738574},{x:0.4727382264923116,y:-0.0013797907292793573},{x:0.47302110970201555,y:-0.0012603576240190345},{x:0.4764199172204845,y:0.0010442216392121837},{x:0.47984972999499764,y:0.0033023984391836667},{x:0.4800683257343829,y:0.003518044166447842},{x:0.48032247317956905,y:0.003690370174554085},{x:0.483206372454032,y:0.0066137420467029156},{x:0.48612973389873737,y:0.009497651891297622},{x:0.4863020589879118,y:0.009751799959568049},{x:0.48651770392478944,y:0.009970396478670394},{x:0.4887758683234383,y:0.01340021741813658},{x:0.49108043529745576,y:0.016799033269341422},{x:0.49119986737988364,y:0.017081916910882677},{x:0.4913687226944633,y:0.017338383399342037},{x:0.4929143722258502,y:0.021142847310886045},{x:0.4945115815127853,y:0.024925954581618698},{x:0.4945735308805171,y:0.025226702736729056},{x:0.4946891075577548,y:0.025511183331222268},{x:0.6452021075577549,y:0.5341051833312223},{x:0.6468642579864609,y:0.542768720156288},{x:0.646804298471751,y:0.5515900590129192},{x:0.64502453322415,y:0.5602302007959196},{x:0.641593357624019,y:0.5683571097020156},{x:0.636642629825446,y:0.5756584731795691},{x:0.6303626035213297,y:0.5818537039247894},{x:0.622994616600658,y:0.5867047226944633},{x:0.6148218166687778,y:0.5900251075577548},{x:0.6061582798437121,y:0.5916872579864608},{x:0.5973369409870808,y:0.591627298471751},{x:0.5886967992040805,y:0.58984753322415},{x:0.5805698902979844,y:0.5864163576240191},{x:0.573268526820431,y:0.5814656298254459},{x:0.5670732960752106,y:0.5751856035213296},{x:0.5622222773055368,y:0.567817616600658},{x:0.5589018924422452,y:0.5596448166687777},{x:0.4515387133151436,y:0.1968570925189096},{x:0.34417406138515255,y:0.5596449726882076},{x:0.3440584683142858,y:0.559929490683899},{x:0.34399650907958285,y:0.5602302784847478},{x:0.3423992950207163,y:0.5640133397974443},{x:0.3408536469711739,y:0.5678177606143904},{x:0.3406847682813525,y:0.5680742605871558},{x:0.34056531878704455,y:0.5683571811877035},{x:0.33826075609875456,y:0.5717559510329858},{x:0.33600260156081635,y:0.5751857299949976},{x:0.33578692716538155,y:0.5754043547947312},{x:0.3356145777885471,y:0.5756585357149616},{x:0.33269122952253233,y:0.5785424012737268},{x:0.32980734810870244,y:0.5814657338987373},{x:0.3295531662537196,y:0.581638081896991},{x:0.3293345402842553,y:0.5818537551066867},{x:0.3259047490749403,y:0.5841118910428063},{x:0.32250596673065857,y:0.5864164352974557},{x:0.322223045482268,y:0.5865358832573104},{x:0.32196654459357354,y:0.5867047605559735},{x:0.318162115393689,y:0.5882503879717952},{x:0.31437904541838135,y:0.5898475815127853},{x:0.31407825728149374,y:0.5899095391161314},{x:0.313793738658875,y:0.5900251306438814},{x:0.30976087354902626,y:0.5907988519446131},{x:0.3057388972002714,y:0.5916273155198798},{x:0.3054318012943039,y:0.5916294017707667},{x:0.3051301988288679,y:0.5916872654100169},{x:0.30102387855356455,y:0.5916593469199811},{x:0.29691755812689985,y:0.5916872431389331},{x:0.2966159559752979,y:0.5916293778639092},{x:0.2963088600806502,y:0.5916272899474536},{x:0.29228688822522214,y:0.5907988045585649},{x:0.28825402731179245,y:0.5900250613851525},{x:0.2879695093161011,y:0.5899094683142858},{x:0.2876687215152522,y:0.5898475090795828},{x:0.2838856602025565,y:0.5882502950207166},{x:0.28008123938560964,y:0.5867046469711739},{x:0.27982473941284386,y:0.5865357682813523},{x:0.27954181881229656,y:0.5864163187870445},{x:0.276143048967013,y:0.5841117560987538},{x:0.2727132700050024,y:0.5818536015608163},{x:0.2724946452052691,y:0.5816379271653819},{x:0.27224046428503834,y:0.5814655777885471},{x:0.2693565987262721,y:0.5785422295225312},{x:0.2664332661012626,y:0.5756583481087024},{x:0.2662609181030087,y:0.5754041662537193},{x:0.2660452448933134,y:0.5751855402842553},{x:0.26378710895719626,y:0.5717557490749442},{x:0.2614825647025443,y:0.5683569667306586},{x:0.2613631167426894,y:0.5680740454822678},{x:0.2611942394440265,y:0.5678175445935736},{x:0.2596486120282045,y:0.5640131153936881},{x:0.2580514184872148,y:0.5602300454183813},{x:0.25798946088386876,y:0.5599292572814941},{x:0.2578738693561186,y:0.559644738658875},{x:0.150512,y:0.196859029989096},{x:0.0431501306438814,y:0.559644738658875},{x:0.039829760555973516,y:0.5678175445935736},{x:0.034978755106686646,y:0.5751855402842553},{x:0.028783535714961644,y:0.5814655777885471},{x:0.021482181187703456,y:0.5864163187870445},{x:0.01335527848474783,y:0.5898475090795828},{x:0.0047151399193498065,y:0.5916272899474536},{x:-0.004106198828867862,y:0.5916872654100169},{x:-0.01276973865887501,y:0.5900251306438814},{x:-0.020942544593573535,y:0.5867047605559735},{x:-0.028310540284255312,y:0.5818537551066867},{x:-0.034590577788547086,y:0.5756585357149616},{x:-0.03954131878704451,y:0.5683571811877035},{x:-0.04297250907958286,y:0.5602302784847478},{x:-0.04475228994745356,y:0.5515901399193498},{x:-0.04481226541001698,y:0.5427688011711321}]],x:[[{x:-0.007882248997940308,y:0.03911618267902263},{x:-0.007180671607209664,y:0.030322582532795114},{x:-0.0047770285451087455,y:0.021834819906700376},{x:-0.0007636904665355299,y:0.013979074758467071},{x:0.004705112296856322,y:0.007057238968589209},{x:0.011419216721809594,y:0.001335314804661543},{x:0.019120603540586492,y:-0.0029668073965882433},{x:0.02751331277672888,y:-0.0056837994916240225},{x:0.036274817320977384,y:-0.006711248997940296},{x:0.04506841746720488,y:-0.006009671607209652},{x:0.05355618009329963,y:-0.003606028545108733},{x:0.061411925241532925,y:0.0004073095334644686},{x:0.0683337610314108,y:0.005876112296856327},{x:0.3010265,y:0.23008742701759316},{x:0.5337192389685892,y:0.005876112296856327},{x:0.540641074758467,y:0.0004073095334644686},{x:0.5484968199067003,y:-0.003606028545108733},{x:0.556984582532795,y:-0.006009671607209652},{x:0.5657781826790226,y:-0.006711248997940296},{x:0.5745396872232711,y:-0.0056837994916240225},{x:0.5829323964594135,y:-0.0029668073965882433},{x:0.5906337832781904,y:0.001335314804661536},{x:0.5973478877031436,y:0.007057238968589213},{x:0.6028166904665355,y:0.013979074758467089},{x:0.6068300285451087,y:0.021834819906700383},{x:0.6092336716072096,y:0.030322582532795128},{x:0.6099352489979403,y:0.03911618267902263},{x:0.608907799491624,y:0.047877687223271126},{x:0.6061908073965883,y:0.05627039645941352},{x:0.6018886851953384,y:0.0639717832781904},{x:0.5961667610314108,y:0.07068588770314368},{x:0.36588095484811606,y:0.292578},{x:0.5961667610314108,y:0.5144701122968564},{x:0.6018886851953384,y:0.5211842167218096},{x:0.6061908073965883,y:0.5288856035405864},{x:0.608907799491624,y:0.5372783127767289},{x:0.6099352489979403,y:0.5460398173209774},{x:0.6092336716072096,y:0.5548334174672048},{x:0.6068300285451087,y:0.5633211800932996},{x:0.6028166904665355,y:0.571176925241533},{x:0.5973478877031436,y:0.5780987610314108},{x:0.5906337832781904,y:0.5838206851953385},{x:0.5829323964594135,y:0.5881228073965883},{x:0.5745396872232711,y:0.590839799491624},{x:0.5657781826790226,y:0.5918672489979403},{x:0.556984582532795,y:0.5911656716072097},{x:0.5484968199067003,y:0.5887620285451087},{x:0.540641074758467,y:0.5847486904665355},{x:0.5337192389685892,y:0.5792798877031436},{x:0.3010265,y:0.35506857298240685},{x:0.0683337610314108,y:0.5792798877031436},{x:0.06141192524153289,y:0.5847486904665355},{x:0.05355618009329961,y:0.5887620285451087},{x:0.0450684174672049,y:0.5911656716072097},{x:0.03627481732097735,y:0.5918672489979403},{x:0.02751331277672888,y:0.590839799491624},{x:0.01912060354058648,y:0.5881228073965883},{x:0.011419216721809584,y:0.5838206851953385},{x:0.004705112296856315,y:0.5780987610314108},{x:-0.0007636904665355368,y:0.571176925241533},{x:-0.004777028545108752,y:0.5633211800932996},{x:-0.007180671607209664,y:0.5548334174672048},{x:-0.007882248997940308,y:0.5460398173209774},{x:-0.006854799491624035,y:0.5372783127767289},{x:-0.004137807396588256,y:0.5288856035405864},{x:0.0001643148046615306,y:0.5211842167218096},{x:0.005886238968589197,y:0.5144701122968564},{x:0.23617204515188386,y:0.292578},{x:0.005886238968589197,y:0.07068588770314368},{x:0.00016431480466150977,y:0.0639717832781904},{x:-0.004137807396588256,y:0.05627039645941351},{x:-0.006854799491624035,y:0.047877687223271126},{x:-0.007882248997940308,y:0.03911618267902263}]],y:[[{x:-0.00007800000000000168,y:-0.15516599999999992},{x:0.0007866623818546317,y:-0.16394506449072568},{x:0.003347421036992093,y:-0.17238675445642895},{x:0.007505867446385456,y:-0.180166660485882},{x:0.013102194846605353,y:-0.18698580515339455},{x:0.0199213395141179,y:-0.19258213255361445},{x:0.02770124554357093,y:-0.1967405789630078},{x:0.03614293550927421,y:-0.19930133761814528},{x:0.044922,y:-0.2001659999999999},{x:0.084618,y:-0.2001659999999999},{x:0.08470326921416556,y:-0.20015760171543356},{x:0.08478856964894584,y:-0.200165676732115},{x:0.08909199801123496,y:-0.19972534965725622},{x:0.09339706449072577,y:-0.19930133761814528},{x:0.0934790568568106,y:-0.19927646550581232},{x:0.09356429362525961,y:-0.1992677440740231},{x:0.09769912926743524,y:-0.1979963205354665},{x:0.10183875445642904,y:-0.1967405789630078},{x:0.1019143190537861,y:-0.19670018884423682},{x:0.10199621655469396,y:-0.19667500612370953},{x:0.18074721655469395,y:-0.16370500612370958},{x:0.18295470197399702,y:-0.16251430076809983},{x:0.18525522528778574,y:-0.16151511930158513},{x:0.18682754729843723,y:-0.16042530954354395},{x:0.18851130436774752,y:-0.15951710034658062},{x:0.19044407848245243,y:-0.15791861501920362},{x:0.19250546725178602,y:-0.1564898227103016},{x:0.27125546725178606,y:-0.08958282271030155},{x:0.27347158712358693,y:-0.0872898341236823},{x:0.27580944257935097,y:-0.08512109812948883},{x:0.27653091968085064,y:-0.08412438503144627},{x:0.2773860111192193,y:-0.08323963374445845},{x:0.2791122089873479,y:-0.0805583607511536},{x:0.2809820438025964,y:-0.07797520343727593},{x:0.35909504380259644,y:0.055837796562724036},{x:0.35921507445013207,y:0.05609937330868571},{x:0.35938084670619436,y:0.05633463764830328},{x:0.359814044874128,y:0.05731131476590327},{x:0.3603874218559792,y:0.0582128676935936},{x:0.5972854218559792,y:0.5265638676935935},{x:0.6004763520268956,y:0.5347880745861305},{x:0.6020015061983327,y:0.5434767752438966},{x:0.6018022735507984,y:0.5522960677732933},{x:0.5998863104832066,y:0.5609070317083322},{x:0.5963272463817603,y:0.568978752534074},{x:0.591261854083932,y:0.5762010385458585},{x:0.5848847937750224,y:0.5822963413425576},{x:0.5774411323064065,y:0.5870304218559792},{x:0.5692169254138695,y:0.5902213520268956},{x:0.5605282247561034,y:0.5917465061983327},{x:0.5517089322267067,y:0.5915472735507984},{x:0.5430979682916678,y:0.5896313104832066},{x:0.5350262474659261,y:0.5860722463817603},{x:0.5278039614541415,y:0.5810068540839319},{x:0.5217086586574424,y:0.5746297937750224},{x:0.5169745781440208,y:0.5671861323064065},{x:0.3203411783046204,y:0.17843886787959407},{x:0.12481771439881506,y:0.5670983271806026},{x:0.12009991274687032,y:0.5745523168465348},{x:0.11401856108654926,y:0.5809426827476728},{x:0.10680736235169674,y:0.5860238467061943},{x:0.09874343886560628,y:0.5896005424407229},{x:0.09013668268554793,y:0.5915353195400148},{x:0.08131784662479694,y:0.5917538256051798},{x:0.0726258336075076,y:0.5902476635706729},{x:0.06439467281939737,y:0.5870747143988151},{x:0.05694068315346515,y:0.5823569127468703},{x:0.05055031725232718,y:0.5762755610865493},{x:0.04546915329380567,y:0.5690643623516968},{x:0.041892457559277035,y:0.5610004388656062},{x:0.039957680459985136,y:0.5523936826855479},{x:0.039739174394820276,y:0.5435748466247969},{x:0.0412453364293271,y:0.5348828336075077},{x:0.04441828560118493,y:0.5266516728193974},{x:0.26905653043412125,y:0.0801181620528446},{x:0.20712852539925722,y:-0.025968816269973185},{x:0.1395520619925953,y:-0.08338263769409424},{x:0.07557825049874085,y:-0.11016599999999992},{x:0.044922,y:-0.11016599999999992},{x:0.03614293550927422,y:-0.11103066238185455},{x:0.02770124554357096,y:-0.11359142103699202},{x:0.01992133951411791,y:-0.11774986744638538},{x:0.01310219484660536,y:-0.12334619484660528},{x:0.007505867446385456,y:-0.13016533951411782},{x:0.003347421036992093,y:-0.13794524554357088},{x:0.0007866623818546317,y:-0.14638693550927412},{x:-0.00007800000000000168,y:-0.15516599999999992}]],z:[[{x:0.051680000000000004,y:0.038348999999999966},{x:0.05192127447228559,y:0.035899299172703986},{x:0.05194879067317478,y:0.033437899088824954},{x:0.05235257576103353,y:0.03152022369965088},{x:0.05254466238185464,y:0.029569935509274177},{x:0.053259213756049764,y:0.02721437531096308},{x:0.05376639657582897,y:0.024805638484003446},{x:0.054536542955643516,y:0.023003585252525667},{x:0.0551054210369921,y:0.02112824554357092},{x:0.05626578950451143,y:0.018957348831652537},{x:0.05723314819184797,y:0.01669384166703705},{x:0.05834005957014514,y:0.015076662488338128},{x:0.05926386744638546,y:0.01334833951411787},{x:0.060825460697764414,y:0.011445532631778232},{x:0.062215820200804926,y:0.009414240440453706},{x:0.0636169585940798,y:0.00804408260344652},{x:0.06486019484660537,y:0.0065291948466053296},{x:0.06676300172894496,y:0.004967601595226417},{x:0.06852293131171022,y:0.0032465857969436324},{x:0.07016445175727676,y:0.0021761036989109733},{x:0.07167933951411792,y:0.0009328674463854256},{x:0.07385023622603624,y:-0.00022750102113387976},{x:0.07591210278164046,y:-0.0015721027544036703},{x:0.07773092256935071,y:-0.0023017710867676167},{x:0.07945924554357096,y:-0.003225578963007937},{x:0.08181480574188199,y:-0.003940130337203038},{x:0.08409937289490133,y:-0.004856645714911602},{x:0.08602559580031956,y:-0.00521745953679684},{x:0.08790093550927423,y:-0.0057863376181453985},{x:0.09035063633657014,y:-0.00602761209043098},{x:0.09277010945251417,y:-0.006480819940600742},{x:0.09472971180962335,y:-0.006458913379178931},{x:0.09668,y:-0.006651000000000032},{x:0.505373,y:-0.006651000000000032},{x:0.5141520644907257,y:-0.0057863376181453985},{x:0.522593754456429,y:-0.003225578963007937},{x:0.5303736604858821,y:0.0009328674463854256},{x:0.5371928051533946,y:0.0065291948466053296},{x:0.5427891325536145,y:0.013348339514117874},{x:0.5469475789630078,y:0.021128245543570928},{x:0.5495083376181453,y:0.029569935509274198},{x:0.550373,y:0.038348999999999966},{x:0.5495083376181453,y:0.047128064490725735},{x:0.5469475789630078,y:0.055569754456429005},{x:0.5427891325536145,y:0.06334966048588206},{x:0.5371928051533946,y:0.0701688051533946},{x:0.5303736604858821,y:0.0757651325536145},{x:0.522593754456429,y:0.07992357896300786},{x:0.5141520644907257,y:0.08248433761814533},{x:0.505373,y:0.08334899999999996},{x:0.190464663126857,y:0.08334899999999996},{x:0.5404754142030563,y:0.5196949313117102},{x:0.5415458963010891,y:0.5213364517572769},{x:0.5427891325536145,y:0.5228513395141179},{x:0.5439495010211337,y:0.525022236226036},{x:0.5452941027544036,y:0.5270841027816404},{x:0.5460237710867677,y:0.5289029225693511},{x:0.5469475789630078,y:0.530631245543571},{x:0.5476621303372028,y:0.5329868057418816},{x:0.5485786457149116,y:0.5352713728949013},{x:0.5489394595367969,y:0.53719759580032},{x:0.5495083376181453,y:0.5390729355092743},{x:0.5497496120904308,y:0.5415226363365697},{x:0.5502028199406007,y:0.5439421094525142},{x:0.5501809133791788,y:0.5459017118096235},{x:0.550373,y:0.547852},{x:0.5501317255277144,y:0.5503017008272966},{x:0.5501042093268251,y:0.552763100911175},{x:0.5497004242389665,y:0.5546807763003486},{x:0.5495083376181453,y:0.5566310644907257},{x:0.5487937862439503,y:0.5589866246890365},{x:0.548286603424171,y:0.5613953615159966},{x:0.5475164570443563,y:0.5631974147474748},{x:0.5469475789630078,y:0.565072754456429},{x:0.5457872104954887,y:0.567243651168347},{x:0.544819851808152,y:0.569507158332963},{x:0.5437129404298549,y:0.5711243375116617},{x:0.5427891325536145,y:0.5728526604858821},{x:0.5412275393022352,y:0.5747554673682221},{x:0.539837179799195,y:0.5767867595595463},{x:0.5384360414059206,y:0.578156917396553},{x:0.5371928051533946,y:0.5796718051533947},{x:0.5352899982710546,y:0.5812333984047738},{x:0.5335300686882897,y:0.5829544142030564},{x:0.5318885482427235,y:0.5840248963010888},{x:0.5303736604858821,y:0.5852681325536145},{x:0.5282027637739638,y:0.5864285010211338},{x:0.5261408972183595,y:0.5877731027544036},{x:0.5243220774306487,y:0.5885027710867679},{x:0.522593754456429,y:0.5894265789630079},{x:0.5202381942581186,y:0.5901411303372028},{x:0.5179536271050986,y:0.5910576457149116},{x:0.5160274041996802,y:0.5914184595367968},{x:0.5141520644907257,y:0.5919873376181454},{x:0.5117023636634302,y:0.5922286120904309},{x:0.5092828905474858,y:0.5926818199406008},{x:0.5073232881903766,y:0.5926599133791789},{x:0.505373,y:0.592852},{x:0.09668,y:0.592852},{x:0.08790093550927423,y:0.5919873376181454},{x:0.07945924554357094,y:0.5894265789630079},{x:0.07167933951411792,y:0.5852681325536145},{x:0.06486019484660537,y:0.5796718051533947},{x:0.05926386744638546,y:0.5728526604858821},{x:0.0551054210369921,y:0.565072754456429},{x:0.05254466238185464,y:0.5566310644907257},{x:0.051680000000000004,y:0.547852},{x:0.05254466238185464,y:0.5390729355092743},{x:0.0551054210369921,y:0.530631245543571},{x:0.05926386744638546,y:0.5228513395141179},{x:0.06486019484660537,y:0.5160321948466053},{x:0.07167933951411792,y:0.5104358674463855},{x:0.07945924554357096,y:0.5062774210369921},{x:0.08790093550927423,y:0.5037166623818546},{x:0.09668,y:0.502852},{x:0.41158833687314295,y:0.502852},{x:0.06157758579694366,y:0.06650606868828973},{x:0.06050710369891106,y:0.06486454824272328},{x:0.05926386744638546,y:0.06334966048588206},{x:0.05810349897886612,y:0.06117876377396365},{x:0.05675889724559635,y:0.059116897218359485},{x:0.05602922891323242,y:0.05729807743064926},{x:0.0551054210369921,y:0.055569754456429005},{x:0.054390869662797,y:0.05321419425811798},{x:0.053474354285088434,y:0.050929627105098636},{x:0.0531135404632032,y:0.04900340419968042},{x:0.05254466238185464,y:0.047128064490725735},{x:0.05230338790956906,y:0.04467836366342984},{x:0.051850180059399294,y:0.04225889054748581},{x:0.05187208662082111,y:0.04029928819037662},{x:0.051680000000000004,y:0.038348999999999966}]]};var _Gn=EPi;Ko();function SPe(e){let{ctx:t,points:n,fill:o,stroke:r,strokeWidth:i=1,minStrokePx:s,realToCanvasMat:a,closePath:c=!1}=e;if(n.length<2)return;t.beginPath();let l=n.map((_)=>Jn(a,[_.x,_.y])),h=l[0];if(!h)return;let[d,u]=h;t.moveTo(d,u);for(let _=1;_<l.length;_++){let p=l[_];if(!p)continue;let[m,A]=p;t.lineTo(m,A)}if(c)t.closePath();if(o)t.fillStyle=o,t.fill();if(r){let _=i*Math.abs(a.a),p=s===void 0?_:Math.max(_,s);t.strokeStyle=r,t.lineWidth=p,t.stroke()}}function ep(e){let{ctx:t,center:n,width:o,height:r,fill:i,realToCanvasMat:s,borderRadius:a=0,ccwRotationDegrees:c=0,stroke:l,strokeWidth:h,isStrokeDashed:d=!1,lineJoin:u}=e,[_,p]=Jn(s,[n.x,n.y]),m=o*Math.abs(s.a),A=r*Math.abs(s.a),g=a*Math.abs(s.a),f=h?h*Math.abs(s.a):void 0;if(t.save(),t.translate(_,p),c!==0)t.rotate(-c*(Math.PI/180));if(t.beginPath(),g>0){let y=-m/2,x=-A/2,C=Math.min(g,m/2,A/2);t.moveTo(y+C,x),t.lineTo(y+m-C,x),t.arcTo(y+m,x,y+m,x+C,C),t.lineTo(y+m,x+A-C),t.arcTo(y+m,x+A,y+m-C,x+A,C),t.lineTo(y+C,x+A),t.arcTo(y,x+A,y,x+A-C,C),t.lineTo(y,x+C),t.arcTo(y,x,y+C,x,C)}else t.rect(-m/2,-A/2,m,A);if(i)t.fillStyle=i,t.fill();if(l&&f){if(d)t.setLineDash([f*3,f*2]);else t.setLineDash([]);if(u)t.lineJoin=u;t.strokeStyle=l,t.lineWidth=f,t.stroke()}t.restore()}function MPi(e){let{ctx:t,board:n,realToCanvasMat:o,colorMap:r,drawBoardMaterial:i,minBoardOutlineStrokePx:s}=e,{width:a,height:c,center:l,outline:h}=n;if(h&&Array.isArray(h)&&h.length>=3){if(i)SPe({ctx:t,points:h.map((d)=>({x:d.x,y:d.y})),fill:r.substrate,realToCanvasMat:o,closePath:!0});SPe({ctx:t,points:h.map((d)=>({x:d.x,y:d.y})),stroke:r.boardOutline,strokeWidth:0.1,realToCanvasMat:o,closePath:!0,minStrokePx:s});return}if(a!==void 0&&c!==void 0&&l){if(i)ep({ctx:t,center:l,width:a,height:c,fill:r.substrate,realToCanvasMat:o});let d=a/2,u=c/2,_=[{x:l.x-d,y:l.y-u},{x:l.x+d,y:l.y-u},{x:l.x+d,y:l.y+u},{x:l.x-d,y:l.y+u}];SPe({ctx:t,points:_,stroke:r.boardOutline,strokeWidth:0.1,realToCanvasMat:o,closePath:!0,minStrokePx:s})}}function wPi({startX:e,startY:t,endX:n,endY:o,bulge:r}){if(Math.abs(r)<0.0000000001)return null;let i=n-e,s=o-t,a=Math.hypot(i,s);if(a<0.0000000001)return null;let c=Math.abs(r)*(a/2),l=a/2,h=(c*c+l*l)/(2*c),d=h-c,u=(e+n)/2,_=(t+o)/2,p=-s/a,m=i/a,A=r>0?-1:1;return{centerX:u+A*p*d,centerY:_+A*m*d,radius:h}}function rdt({ctx:e,realStartX:t,realStartY:n,realEndX:o,realEndY:r,bulge:i,realToCanvasMat:s}){if(Math.abs(i)<0.0000000001){let[x,C]=Jn(s,[o,r]);e.lineTo(x,C);return}let a=wPi({startX:t,startY:n,endX:o,endY:r,bulge:i});if(!a){let[x,C]=Jn(s,[o,r]);e.lineTo(x,C);return}let[c,l]=Jn(s,[t,n]),[h,d]=Jn(s,[o,r]),[u,_]=Jn(s,[a.centerX,a.centerY]),p=Math.hypot(c-u,l-_),m=Math.atan2(l-_,c-u),A=Math.atan2(d-_,h-u),f=s.a*s.d-s.b*s.c<0,y=i>0?!f:f;e.arc(u,_,p,m,A,y)}function gGn({ctx:e,ring:t,realToCanvasMat:n}){if(t.vertices.length<2)return;if(t.vertices.length===2){let[s,a]=t.vertices;if(s&&a&&Math.abs((s.bulge??0)-1)<0.0000000001&&Math.abs((a.bulge??0)-1)<0.0000000001){let[c,l]=Jn(n,[s.x,s.y]);e.moveTo(c,l),rdt({ctx:e,realStartX:s.x,realStartY:s.y,realEndX:a.x,realEndY:a.y,bulge:1,realToCanvasMat:n}),rdt({ctx:e,realStartX:a.x,realStartY:a.y,realEndX:s.x,realEndY:s.y,bulge:1,realToCanvasMat:n});return}}let o=t.vertices[0];if(!o)return;let[r,i]=Jn(n,[o.x,o.y]);e.moveTo(r,i);for(let s=0;s<t.vertices.length;s++){let a=t.vertices[s],c=t.vertices[(s+1)%t.vertices.length];if(!a||!c)continue;rdt({ctx:e,realStartX:a.x,realStartY:a.y,realEndX:c.x,realEndY:c.y,bulge:a.bulge??0,realToCanvasMat:n})}}function QGn({ctx:e,shape:t,realToCanvasMat:n}){gGn({ctx:e,ring:t.outer_ring,realToCanvasMat:n});for(let o of t.inner_rings??[])gGn({ctx:e,ring:o,realToCanvasMat:n})}function BPi(e,t){return t.copper[e]??t.copper.top}function hdt(e){let{ctx:t,pour:n,realToCanvasMat:o}=e;if(n.shape==="rect"){let r=n.width/2,i=n.height/2,s=(n.rotation??0)*Math.PI/180,a=Math.cos(s),c=Math.sin(s),l=[{x:-r,y:-i},{x:r,y:-i},{x:r,y:i},{x:-r,y:i}].map((d)=>Jn(o,[n.center.x+d.x*a-d.y*c,n.center.y+d.x*c+d.y*a])),h=l[0];if(!h)return;t.moveTo(h[0],h[1]);for(let d=1;d<l.length;d++){let u=l[d];if(u)t.lineTo(u[0],u[1])}t.closePath();return}if(n.shape==="polygon"){let r=n.points[0];if(!r)return;let[i,s]=Jn(o,[r.x,r.y]);t.moveTo(i,s);for(let a=1;a<n.points.length;a++){let c=n.points[a];if(!c)continue;let[l,h]=Jn(o,[c.x,c.y]);t.lineTo(l,h)}t.closePath();return}if(n.shape!=="brep")return;QGn({ctx:t,shape:n.brep_shape,realToCanvasMat:o})}function ddt(e){let{ctx:t,pour:n,realToCanvasMat:o,colorMap:r}=e,i=BPi(n.layer,r),s=0.5;t.save(),t.globalAlpha=0.5,t.beginPath(),hdt({ctx:t,pour:n,realToCanvasMat:o}),t.fillStyle=i,t.fill(n.shape==="brep"?"evenodd":"nonzero"),t.restore()}function TPi(e,t){if(t.length<3)return;let n=t[0];if(!n)return;e.moveTo(n.x,n.y);for(let o=1;o<t.length;o++){let r=t[o];if(!r)continue;e.lineTo(r.x,r.y)}e.closePath()}var DPi=(e)=>fre[e]??(e===" "?LC.spaceWidthRatio:LC.glyphWidthRatio);function udt(e,t,n){let o=DPi(e),r=t?LC.letterSpacingRatio:0,i=t?yRe[e]?.[t]??0:0;return n*(o+r+i)}function NPi(e,t){let n=t*LC.glyphWidthRatio,o=t*LC.letterSpacingRatio,r=t*LC.spaceWidthRatio,i=t*LC.strokeWidthRatio,s=t*LC.lineHeightRatio,a=e.replace(/\\n/g,`
`).split(`
`),c=a.map((d)=>{let u=Array.from(d);return u.reduce((_,p,m)=>_+udt(p,u[m+1],t),0)}),l=c.reduce((d,u)=>Math.max(d,u),0),h=a.length>1?t+(a.length-1)*s:t;return{width:l,height:h,glyphWidth:n,letterSpacing:o,spaceWidth:r,strokeWidth:i,lineHeight:s,lines:a,lineWidths:c}}function RPi(e){let{line:t,fontSize:n,startX:o,startY:r}=e,i=n,s=n,a=Array.from(t),c=[],l=o+e.layout.strokeWidth/2;return a.forEach((h,d)=>{let u=_Gn[h];if(u?.length){let _=[];for(let p of u){let m=p.map((A)=>({x:l+A.x*s,y:r+(1-A.y)*i}));if(m.length>=3)_.push(m)}if(_.length>0)c.push(_)}l+=udt(h,a[d+1],n)}),c}function QPi(e){let{POSITIVE_INFINITY:t,POSITIVE_INFINITY:n,NEGATIVE_INFINITY:o,NEGATIVE_INFINITY:r}=Number;for(let i of e)for(let s of i)t=Math.min(t,s.x),n=Math.min(n,s.y),o=Math.max(o,s.x),r=Math.max(r,s.y);if(t===Number.POSITIVE_INFINITY||n===Number.POSITIVE_INFINITY||o===Number.NEGATIVE_INFINITY||r===Number.NEGATIVE_INFINITY)return null;return{minX:t,minY:n,maxX:o,maxY:r}}function kPi(e,t,n){let o=HPi(e,t),r=FPi(o,t,n),i=QPi(r.flat()),s=zPi(e,t,i);return{bounds:i?GPi(i,s):null,glyphGroups:YPi(r,s),linePlacements:o.map(({line:a,startX:c,startY:l})=>({line:a,startX:c+s.x,startY:l+s.y})),startOffset:s}}function LPi(e,t){let n=t.width+t.strokeWidth,o=t.height+t.strokeWidth,r=0,i=0;if(e==="center"||e==="top_center"||e==="bottom_center")r=-n/2;else if(e==="top_left"||e==="bottom_left"||e==="center_left")r=0;else if(e==="top_right"||e==="bottom_right"||e==="center_right")r=-n;else if(e==="top_center"||e==="bottom_center")r=-n/2;if(e==="center"||e==="center_left"||e==="center_right")i=-o/2;else if(e==="top_left"||e==="top_right"||e==="top_center")i=0;else if(e==="bottom_left"||e==="bottom_right"||e==="bottom_center")i=-o;return{x:r,y:i}}function HPi(e,t){return t.lines.map((n,o)=>({line:n,startX:UPi({alignment:e,lineWidth:t.lineWidths[o],maxWidth:t.width,strokeWidth:t.strokeWidth}),startY:o*t.lineHeight}))}function FPi(e,t,n){return e.flatMap(({line:o,startX:r,startY:i})=>RPi({line:o,fontSize:n,startX:r,startY:i,layout:t}))}function zPi(e,t,n){if(!n)return LPi(e,t);return{x:-OPi(e,n),y:-VPi(e,n)}}function OPi(e,t){if(e==="top_left"||e==="bottom_left"||e==="center_left")return t.minX;if(e==="top_right"||e==="bottom_right"||e==="center_right")return t.maxX;return(t.minX+t.maxX)/2}function VPi(e,t){if(e==="top_left"||e==="top_right"||e==="top_center")return t.minY;if(e==="bottom_left"||e==="bottom_right"||e==="bottom_center")return t.maxY;return(t.minY+t.maxY)/2}function YPi(e,t){if(t.x===0&&t.y===0)return e;return e.map((n)=>n.map((o)=>o.map((r)=>({x:r.x+t.x,y:r.y+t.y}))))}function GPi(e,t){return{minX:e.minX+t.x,minY:e.minY+t.y,maxX:e.maxX+t.x,maxY:e.maxY+t.y}}function UPi(e){let{alignment:t,lineWidth:n,maxWidth:o,strokeWidth:r}=e,i=n+r,s=o+r;if(t==="top_left"||t==="bottom_left"||t==="center_left")return 0;if(t==="top_right"||t==="bottom_right"||t==="center_right")return s-i;return(s-i)/2}var WPi=(e)=>fRe[e];function XPi(e){let{ctx:t,line:n,fontSize:o,startX:r,startY:i,layout:s}=e,{strokeWidth:a}=s,c=o,l=o,h=i,d=Array.from(n),u=r+a/2;d.forEach((_,p)=>{let m=WPi(_);if(m?.length){t.beginPath();for(let A of m){let g=u+A.x1*l,f=h+(1-A.y1)*c,y=u+A.x2*l,x=h+(1-A.y2)*c;t.moveTo(g,f),t.lineTo(y,x)}t.stroke()}u+=udt(_,d[p+1],o)})}var jPi={left:0.2,right:0.2,top:0.2,bottom:0.2};function Dee(e){let{ctx:t,text:n,x:o,y:r,fontSize:i,color:s,realToCanvasMat:a,anchorAlignment:c,rotation:l=0,mirrorX:h=!1,knockout:d=!1,knockoutPadding:u={}}=e;if(!n)return;let[_,p]=Jn(a,[o,r]),m=Math.abs(a.a),A=i*m,g=NPi(n,A),f=kPi(c,g,A);if(t.save(),t.translate(_,p),l!==0)t.rotate(-l*(Math.PI/180));if(h)t.scale(-1,1);if(d){let y={...jPi,...u},x=y.left*m,C=y.right*m,b=y.top*m,I=y.bottom*m,v=f.bounds;if(!v){t.restore();return}let P=v.minX-x,M=v.minY-b,B=v.maxX-v.minX+x+C,T=v.maxY-v.minY+b+I;t.fillStyle=s,t.beginPath(),t.rect(P,M,B,T);for(let N of f.glyphGroups)for(let D of N)TPi(t,D);t.fill("evenodd")}else t.strokeStyle=s;if(t.lineWidth=g.strokeWidth,t.lineCap="round",t.lineJoin="round",!d)f.linePlacements.forEach(({line:y,startX:x,startY:C})=>{XPi({ctx:t,line:y,fontSize:A,startX:x,startY:C,layout:g})});t.restore()}function KPi(e){if(!e)return"center";return e}function $Pi(e){let{ctx:t,text:n,realToCanvasMat:o,colorMap:r}=e,i=n.text??"";if(!i)return;Dee({ctx:t,text:i,x:n.anchor_position.x,y:n.anchor_position.y,fontSize:n.font_size??1,color:r.copper[n.layer]??r.copper.top,realToCanvasMat:o,anchorAlignment:KPi(n.anchor_alignment),rotation:n.ccw_rotation??0,mirrorX:n.is_mirrored??n.layer==="bottom",knockout:n.is_knockout,knockoutPadding:n.is_knockout?n.knockout_padding:void 0})}function Em(e){let{ctx:t,center:n,radius:o,fill:r,realToCanvasMat:i,stroke:s,strokeWidth:a,isStrokeDashed:c=!1}=e,[l,h]=Jn(i,[n.x,n.y]),d=o*Math.abs(i.a),u=a?a*Math.abs(i.a):void 0;if(t.beginPath(),t.arc(l,h,d,0,Math.PI*2),r)t.fillStyle=r,t.fill();if(s&&u){if(c)t.setLineDash([u*3,u*2]);else t.setLineDash([]);t.strokeStyle=s,t.lineWidth=u,t.stroke()}}function qPi(e,t){return e==="bottom"?t.courtyard.bottom:t.courtyard.top}function JPi(e){let{ctx:t,circle:n,realToCanvasMat:o,colorMap:r}=e;Em({ctx:t,center:n.center,radius:n.radius,stroke:qPi(n.layer,r),strokeWidth:0.05,realToCanvasMat:o})}function ZPi(e,t){return e==="bottom"?t.courtyard.bottom:t.courtyard.top}function eEi(e){let{ctx:t,outline:n,realToCanvasMat:o,colorMap:r}=e;if(!n.outline||n.outline.length<2)return;t.beginPath();let i=Jn(o,n.outline[0]);t.moveTo(i.x,i.y);for(let s=1;s<n.outline.length;s++){let a=Jn(o,n.outline[s]);t.lineTo(a.x,a.y)}t.closePath(),t.lineWidth=0.05*Math.abs(o.a),t.strokeStyle=ZPi(n.layer,r),t.lineJoin="round",t.stroke()}function tEi(e,t){return e==="bottom"?t.courtyard.bottom:t.courtyard.top}function nEi(e){let{ctx:t,rect:n,realToCanvasMat:o,colorMap:r}=e;ep({ctx:t,center:n.center,width:n.width,height:n.height,stroke:tEi(n.layer,r),strokeWidth:0.05,realToCanvasMat:o,ccwRotationDegrees:n.ccw_rotation??0,lineJoin:"round"})}function _P(e){let{ctx:t,points:n,fill:o,realToCanvasMat:r}=e;if(n.length<3)return;t.beginPath();let i=n.map((l)=>Jn(r,[l.x,l.y])),s=i[0];if(!s)return;let[a,c]=s;t.moveTo(a,c);for(let l=1;l<i.length;l++){let h=i[l];if(!h)continue;let[d,u]=h;t.lineTo(d,u)}t.closePath(),t.fillStyle=o,t.fill()}function oEi(e){let{ctx:t,cutout:n,realToCanvasMat:o,colorMap:r}=e;if(n.shape==="rect"){ep({ctx:t,center:n.center,width:n.width,height:n.height,fill:r.drill,realToCanvasMat:o,ccwRotationDegrees:n.rotation??0,borderRadius:n.corner_radius??0});return}if(n.shape==="circle"){Em({ctx:t,center:n.center,radius:n.radius,fill:r.drill,realToCanvasMat:o});return}if(n.shape==="polygon"){if(n.points&&n.points.length>=3)_P({ctx:t,points:n.points,fill:r.drill,realToCanvasMat:o});return}}var kGn="#ff4d4d",rEi={a:1,b:0,c:0,d:1,e:0,f:0};function iEi(e){let t=Math.min(e.canvas.width,e.canvas.height),n=Math.max(1,Math.min(2,t*0.002)),o=Math.max(10,Math.min(18,t*0.02));return{fontSize:o,strokeWidth:n,dashLength:n*4,labelGap:o*0.35,pointRadius:n*3}}function idt({ctx:e,label:t,x:n,y:o,style:r,align:i="left"}){if(!t)return;e.setLineDash([]),Dee({ctx:e,text:t,x:n,y:o,fontSize:r.fontSize,color:kGn,realToCanvasMat:rEi,anchorAlignment:i==="center"?"bottom_center":"bottom_left"})}function sEi({ctx:e,debugObject:t,realToCanvasMat:n,labelStackIndex:o=0}){let r=iEi(e);if(e.save(),e.strokeStyle=kGn,e.lineWidth=r.strokeWidth,e.setLineDash([r.dashLength,r.dashLength]),t.shape==="rect"){let a=Jn(n,[t.center.x-t.size.width/2,t.center.y-t.size.height/2]),c=Jn(n,[t.center.x+t.size.width/2,t.center.y+t.size.height/2]),l=Math.min(a[0],c[0]),h=Math.min(a[1],c[1]),d=Math.abs(c[0]-a[0]),u=Math.abs(c[1]-a[1]);e.beginPath(),e.rect(l,h,d,u),e.stroke(),idt({ctx:e,label:t.label,x:l,y:h-r.labelGap-o*(r.fontSize+r.labelGap),style:r}),e.restore();return}if(t.shape==="line"){let[a,c]=Jn(n,[t.start.x,t.start.y]),[l,h]=Jn(n,[t.end.x,t.end.y]);e.beginPath(),e.moveTo(a,c),e.lineTo(l,h),e.stroke(),idt({ctx:e,label:t.label,x:(a+l)/2,y:(c+h)/2-r.labelGap,style:r,align:"center"}),e.restore();return}let[i,s]=Jn(n,[t.center.x,t.center.y]);e.beginPath(),e.arc(i,s,r.pointRadius,0,Math.PI*2),e.stroke(),idt({ctx:e,label:t.label,x:i+r.pointRadius+r.labelGap,y:s-r.pointRadius,style:r}),e.restore()}var aEi=1.5,cEi=0.6,lEi=0.3;function sdt(e){let t=Math.hypot(e.x,e.y)||1;return{x:e.x/t,y:e.y/t}}function LGn(e){let{ctx:t,from:n,to:o,realToCanvasMat:r,color:i,fontSize:s,arrowSize:a=1,strokeWidth:c,text:l,textRotation:h,offset:d}=e,u=sdt({x:o.x-n.x,y:o.y-n.y}),_={x:-u.y,y:u.x},p=d?.direction&&typeof d.direction.x==="number"&&typeof d.direction.y==="number",m=p?sdt(d.direction):{x:0,y:0},A=d?.distance??0,g={x:m.x*A,y:m.y*A},f={x:n.x+g.x,y:n.y+g.y},y={x:o.x+g.x,y:o.y+g.y},x={x:f.x+u.x*a,y:f.y+u.y*a},C={x:y.x-u.x*a,y:y.y-u.y*a},b=Math.abs(r.a),I=c??a/5,v=i||"rgba(255,255,255,0.5)",P=p&&(Math.abs(m.x)>Number.EPSILON||Math.abs(m.y)>Number.EPSILON)?m:_,M=A+0.5,B=[],T=(L)=>{let H={x:L.x+P.x*M,y:L.y+P.y*M},V=I/2,O={x:-P.y,y:P.x};return[{x:L.x+O.x*V,y:L.y+O.y*V},{x:L.x-O.x*V,y:L.y-O.y*V},{x:H.x-O.x*V,y:H.y-O.y*V},{x:H.x+O.x*V,y:H.y+O.y*V}]};B.push(f),B.push({x:x.x+_.x*(a/2),y:x.y+_.y*(a/2)}),B.push({x:x.x+_.x*(I/2),y:x.y+_.y*(I/2)}),B.push({x:C.x+_.x*(I/2),y:C.y+_.y*(I/2)}),B.push({x:C.x+_.x*(a/2),y:C.y+_.y*(a/2)}),B.push(y),B.push({x:C.x-_.x*(a/2),y:C.y-_.y*(a/2)}),B.push({x:C.x-_.x*(I/2),y:C.y-_.y*(I/2)}),B.push({x:x.x-_.x*(I/2),y:x.y-_.y*(I/2)}),B.push({x:x.x-_.x*(a/2),y:x.y-_.y*(a/2)}),B.push(f);let N=B[0],D=(L)=>{let H=T(L);B.push(N),B.push(H[0]),B.push(...H),B.push(H[0]),B.push(N)};if(D(n),D(o),_P({ctx:t,points:B,fill:v,realToCanvasMat:r}),l){let L={x:(n.x+o.x)/2+g.x,y:(n.y+o.y)/2+g.y},[H,V]=Jn(r,[f.x,f.y]),[O,U]=Jn(r,[y.x,y.y]),j=sdt({x:O-H,y:U-V}),Y=Math.atan2(j.y,j.x)*180/Math.PI;if(Y>90||Y<-90)Y+=180;let X=typeof h==="number"&&Number.isFinite(h)?Y-h:Y,K=0;if(l&&typeof h==="number"&&Number.isFinite(h)){let se=l.length*s*cEi,ne=s,re=h*Math.PI/180,Z=Math.abs(Math.sin(re)),te=Math.abs(Math.cos(re)),ie=se/2,ce=ne/2;K=ie*Z+ce*te+s*lEi}let J=a*aEi+K,ee={x:L.x+_.x*J,y:L.y+_.y*J};Dee({ctx:t,text:l,x:ee.x,y:ee.y,fontSize:s,color:v,realToCanvasMat:r,anchorAlignment:"center",rotation:-X})}}function hEi(e){let{ctx:t,pcbFabricationNoteDimension:n,realToCanvasMat:o,colorMap:r}=e,i=n.color??r.fabricationNote;LGn({ctx:t,from:n.from,to:n.to,realToCanvasMat:o,color:i,fontSize:n.font_size??1,arrowSize:n.arrow_size??1,text:n.text,textRotation:n.text_ccw_rotation,offset:n.offset_distance&&n.offset_direction?{distance:n.offset_distance,direction:n.offset_direction}:void 0})}function dEi(e){let{ctx:t,path:n,realToCanvasMat:o,colorMap:r}=e;if(!n.route||n.route.length<2)return;let i=n.route.map((a)=>Jn(o,a)),s=n.stroke_width*Math.abs(o.a)/2;if(t.beginPath(),n.is_filled){let c=i.reduce((l,h,d)=>{let u=i[(d+1)%i.length];return l+h.x*u.y-u.x*h.y},0)<0?[...i].reverse():i;t.moveTo(c[0].x,c[0].y);for(let l of c.slice(1))t.lineTo(l.x,l.y);t.closePath()}if(n.has_stroke!==!1&&s>0){let a=n.is_filled?[...i,i[0]]:i;for(let c=1;c<a.length;c++){let l=a[c-1],h=a[c],d=Math.atan2(h.y-l.y,h.x-l.x);t.moveTo(l.x+s*Math.cos(d+Math.PI/2),l.y+s*Math.sin(d+Math.PI/2)),t.arc(l.x,l.y,s,d+Math.PI/2,d+3*Math.PI/2),t.lineTo(h.x+s*Math.cos(d-Math.PI/2),h.y+s*Math.sin(d-Math.PI/2)),t.arc(h.x,h.y,s,d-Math.PI/2,d+Math.PI/2),t.closePath()}}t.fillStyle=n.color??r.fabricationNote,t.fill()}function uEi(e){let{ctx:t,rect:n,realToCanvasMat:o,colorMap:r}=e,i=r.fabricationNote,s=n.color??i,a=n.is_filled??!1,c=n.has_stroke??!0,l=n.is_stroke_dashed??!1;ep({ctx:t,center:n.center,width:n.width,height:n.height,fill:a?s:void 0,stroke:c?s:void 0,strokeWidth:c?n.stroke_width:void 0,borderRadius:n.corner_radius,realToCanvasMat:o,isStrokeDashed:l})}function pEi(e,t){return t.fabricationNote}function mEi(e){let{ctx:t,text:n,realToCanvasMat:o,colorMap:r}=e,i=pEi(n.layer,r),s=n.color??i,a=n.font_size;Dee({ctx:t,text:n.text,x:n.anchor_position.x,y:n.anchor_position.y,fontSize:a,color:s,realToCanvasMat:o,anchorAlignment:n.anchor_alignment})}function G9(e){let{ctx:t,center:n,radius_x:o,radius_y:r,fill:i,stroke:s,strokeWidth:a=0.1,realToCanvasMat:c,rotation:l=0}=e,[h,d]=Jn(c,[n.x,n.y]),u=o*Math.abs(c.a),_=r*Math.abs(c.a),p=a*Math.abs(c.a);if(t.save(),t.translate(h,d),l!==0)t.rotate(-l*(Math.PI/180));if(t.beginPath(),t.ellipse(0,0,u,_,0,0,Math.PI*2),i)t.fillStyle=i,t.fill();if(s)t.strokeStyle=s,t.lineWidth=p,t.stroke();t.restore()}function A_(e){let{ctx:t,center:n,width:o,height:r,fill:i,realToCanvasMat:s,rotation:a=0,stroke:c,strokeWidth:l}=e,[h,d]=Jn(s,[n.x,n.y]),u=o*Math.abs(s.a),_=r*Math.abs(s.a),p=l?l*Math.abs(s.a):void 0;if(t.save(),t.translate(h,d),a!==0)t.rotate(-a*(Math.PI/180));if(t.beginPath(),u>_){let m=_/2,A=u-_;t.moveTo(-A/2,-m),t.lineTo(A/2,-m),t.arc(A/2,0,m,-Math.PI/2,Math.PI/2),t.lineTo(-A/2,m),t.arc(-A/2,0,m,Math.PI/2,-Math.PI/2)}else if(_>u){let m=u/2,A=_-u;t.moveTo(m,-A/2),t.lineTo(m,A/2),t.arc(0,A/2,m,0,Math.PI),t.lineTo(-m,-A/2),t.arc(0,-A/2,m,Math.PI,0)}else t.arc(0,0,u/2,0,Math.PI*2);if(t.closePath(),i)t.fillStyle=i,t.fill();if(c&&p)t.strokeStyle=c,t.lineWidth=p,t.stroke();t.restore()}function xPe(e){if("ccw_rotation"in e&&typeof e.ccw_rotation==="number")return e.ccw_rotation;return 0}function AGn(e){let{ctx:t,hole:n,realToCanvasMat:o,colorMap:r,soldermaskMargin:i=0,drawSoldermask:s=!1}=e;if(s&&n.is_covered_with_solder_mask===!0)return;let a=i<0?Math.abs(i):0;if(n.hole_shape==="circle"){Em({ctx:t,center:{x:n.x,y:n.y},radius:n.hole_diameter/2-a,fill:r.drill,realToCanvasMat:o});return}if(n.hole_shape==="square"){let c=xPe(n);ep({ctx:t,center:{x:n.x,y:n.y},width:n.hole_diameter-a*2,height:n.hole_diameter-a*2,fill:r.drill,realToCanvasMat:o,ccwRotationDegrees:c});return}if(n.hole_shape==="oval"){let c=xPe(n);G9({ctx:t,center:{x:n.x,y:n.y},radius_x:n.hole_width/2-a,radius_y:n.hole_height/2-a,fill:r.drill,realToCanvasMat:o,rotation:c});return}if(n.hole_shape==="rect"){let c=xPe(n);ep({ctx:t,center:{x:n.x,y:n.y},width:n.hole_width-a*2,height:n.hole_height-a*2,fill:r.drill,realToCanvasMat:o,ccwRotationDegrees:c});return}if(n.hole_shape==="pill"||n.hole_shape==="rotated_pill"){let c=xPe(n);A_({ctx:t,center:{x:n.x,y:n.y},width:n.hole_width-a*2,height:n.hole_height-a*2,fill:r.drill,realToCanvasMat:o,rotation:c});return}}function _Ei(e){let{ctx:t,cx:n,cy:o,radius:r}=e;t.beginPath(),t.arc(n,o,r,0,Math.PI*2)}function gEi(e){let{ctx:t,cx:n,cy:o,width:r,height:i}=e;t.beginPath(),t.rect(n-r/2,o-i/2,r,i)}function RB(e){let{ctx:t,cx:n,cy:o,width:r,height:i,ccwRotationDegrees:s=0}=e,a=s*Math.PI/180,c=sL(Ny(n,o),z0e(-a));if(r>i){let l=i/2,h=(r-i)/2,d=Jn(c,{x:-h,y:0}),u=Jn(c,{x:h,y:0}),_=Jn(c,{x:h,y:-l});t.moveTo(_.x,_.y),t.arc(u.x,u.y,l,-a-Math.PI/2,-a+Math.PI/2),t.arc(d.x,d.y,l,-a+Math.PI/2,-a-Math.PI/2)}else if(i>r){let l=r/2,h=(i-r)/2,d=Jn(c,{x:0,y:-h}),u=Jn(c,{x:0,y:h}),_=Jn(c,{x:l,y:h});t.moveTo(_.x,_.y),t.arc(u.x,u.y,l,-a,-a+Math.PI),t.arc(d.x,d.y,l,-a+Math.PI,-a)}else{let l=r/2;t.moveTo(n+l,o),t.arc(n,o,l,0,Math.PI*2)}t.closePath()}function cL(e){let{ctx:t,points:n}=e;if(n.length<3)return;let o=n[0];if(o){t.moveTo(o.x,o.y);for(let r=1;r<n.length;r++){let i=n[r];if(i)t.lineTo(i.x,i.y)}t.closePath()}}function h3(e){let{ctx:t,cx:n,cy:o,width:r,height:i,radius:s,ccwRotationDegrees:a=0}=e,c=a*Math.PI/180,l=sL(Ny(n,o),z0e(-c)),h=r/2,d=i/2,u=Math.min(s,h,d);if(u>0){let _=Jn(l,{x:-h,y:-d}),p=Jn(l,{x:h,y:-d}),m=Jn(l,{x:h,y:d}),A=Jn(l,{x:-h,y:d}),g=Jn(l,{x:-h,y:0});t.moveTo(g.x,g.y),t.arcTo(_.x,_.y,p.x,p.y,u),t.arcTo(p.x,p.y,m.x,m.y,u),t.arcTo(m.x,m.y,A.x,A.y,u),t.arcTo(A.x,A.y,_.x,_.y,u)}else{let _=Jn(l,{x:-h,y:-d}),p=Jn(l,{x:h,y:-d}),m=Jn(l,{x:h,y:d}),A=Jn(l,{x:-h,y:d});t.moveTo(_.x,_.y),t.lineTo(p.x,p.y),t.lineTo(m.x,m.y),t.lineTo(A.x,A.y)}t.closePath()}function AEi(e){let{ctx:t,pad:n,realToCanvasMat:o,color:r,drillCutouts:i}=e;if(t.save(),t.beginPath(),!fGn(t,n,o)){t.restore();return}t.clip(),t.beginPath(),fGn(t,n,o);for(let s of i)yEi(t,s,o);t.fillStyle=r,t.fill("evenodd"),t.restore()}function fEi(e){let{pad:t,holes:n=[],platedHoles:o=[],vias:r=[],cutouts:i=[]}=e,s=CEi(t);if(!s)return[];let a=[],c=(l)=>{if(l&&vEi(s,bEi(l)))a.push(l)};for(let l of i)c(IEi(l));for(let l of n)c(SEi(l));for(let l of o){if(!yGn(l.layers,t.layer))continue;c(PEi(l))}for(let l of r){if(!yGn(l.layers,t.layer))continue;let h=l.hole_diameter/2;if(h<=0)continue;let d={shape:"circle",x:l.x,y:l.y,radius:h};c(d)}return a}function fGn(e,t,n){if(t.shape==="rect"||t.shape==="rotated_rect")return FGn(e,{x:t.x,y:t.y,width:t.width,height:t.height,radius:EEi(t),rotation:t.shape==="rotated_rect"?t.ccw_rotation??0:0,realToCanvasMat:n}),!0;if(t.shape==="circle")return HGn(e,{x:t.x,y:t.y,radius:t.radius,realToCanvasMat:n}),!0;if(t.shape==="pill"||t.shape==="rotated_pill")return zGn(e,{x:t.x,y:t.y,width:t.width,height:t.height,rotation:t.shape==="rotated_pill"?t.ccw_rotation??0:0,realToCanvasMat:n}),!0;if(t.shape==="polygon"&&t.points&&t.points.length>=3)return OGn(e,t.points,n),!0;return!1}function yEi(e,t,n){if(t.shape==="circle"){HGn(e,{x:t.x,y:t.y,radius:t.radius,realToCanvasMat:n});return}if(t.shape==="oval"){xEi(e,{x:t.x,y:t.y,radiusX:t.radiusX,radiusY:t.radiusY,rotation:t.rotation,realToCanvasMat:n});return}if(t.shape==="pill"){zGn(e,{x:t.x,y:t.y,width:t.width,height:t.height,rotation:t.rotation,realToCanvasMat:n});return}if(t.shape==="polygon"){OGn(e,t.points,n);return}FGn(e,{x:t.x,y:t.y,width:t.width,height:t.height,radius:t.radius,rotation:t.rotation,realToCanvasMat:n})}function HGn(e,t){let{x:n,y:o,radius:r,realToCanvasMat:i}=t,[s,a]=Jn(i,[n,o]),c=r*Math.abs(i.a);e.moveTo(s+c,a),e.arc(s,a,c,0,Math.PI*2),e.closePath()}function xEi(e,t){let{x:n,y:o,radiusX:r,radiusY:i,rotation:s=0,realToCanvasMat:a}=t,[c,l]=Jn(a,[n,o]),h=r*Math.abs(a.a),d=i*Math.abs(a.a);if(e.save(),e.translate(c,l),s!==0)e.rotate(-s*(Math.PI/180));e.moveTo(h,0),e.ellipse(0,0,h,d,0,0,Math.PI*2),e.closePath(),e.restore()}function FGn(e,t){let{x:n,y:o,width:r,height:i,radius:s=0,rotation:a=0,realToCanvasMat:c}=t,[l,h]=Jn(c,[n,o]),d=r*Math.abs(c.a),u=i*Math.abs(c.a),_=s*Math.abs(c.a);if(e.save(),e.translate(l,h),a!==0)e.rotate(-a*(Math.PI/180));if(_>0){let p=-d/2,m=-u/2,A=Math.min(_,d/2,u/2);e.moveTo(p+A,m),e.lineTo(p+d-A,m),e.arcTo(p+d,m,p+d,m+A,A),e.lineTo(p+d,m+u-A),e.arcTo(p+d,m+u,p+d-A,m+u,A),e.lineTo(p+A,m+u),e.arcTo(p,m+u,p,m+u-A,A),e.lineTo(p,m+A),e.arcTo(p,m,p+A,m,A),e.closePath()}else e.rect(-d/2,-u/2,d,u);e.restore()}function zGn(e,t){let{x:n,y:o,width:r,height:i,rotation:s=0,realToCanvasMat:a}=t,[c,l]=Jn(a,[n,o]),h=r*Math.abs(a.a),d=i*Math.abs(a.a);if(e.save(),e.translate(c,l),s!==0)e.rotate(-s*(Math.PI/180));if(h>d){let u=d/2,_=h-d;e.moveTo(-_/2,-u),e.lineTo(_/2,-u),e.arc(_/2,0,u,-Math.PI/2,Math.PI/2),e.lineTo(-_/2,u),e.arc(-_/2,0,u,Math.PI/2,-Math.PI/2)}else if(d>h){let u=h/2,_=d-h;e.moveTo(u,-_/2),e.lineTo(u,_/2),e.arc(0,_/2,u,0,Math.PI),e.lineTo(-u,-_/2),e.arc(0,-_/2,u,Math.PI,0)}else e.moveTo(h/2,0),e.arc(0,0,h/2,0,Math.PI*2);e.closePath(),e.restore()}function OGn(e,t,n){let o=t[0];if(!o)return;let[r,i]=Jn(n,[o.x,o.y]);e.moveTo(r,i);for(let s=1;s<t.length;s++){let a=t[s];if(!a)continue;let[c,l]=Jn(n,[a.x,a.y]);e.lineTo(c,l)}e.closePath()}function CEi(e){if(e.shape==="circle")return aL(e.x,e.y,e.radius,e.radius);if(e.shape==="rect"||e.shape==="rotated_rect"||e.shape==="pill"||e.shape==="rotated_pill"){let t=Math.hypot(e.width/2,e.height/2);if((e.shape==="rotated_rect"||e.shape==="rotated_pill")&&(e.ccw_rotation??0)!==0)return aL(e.x,e.y,t,t);return aL(e.x,e.y,e.width/2,e.height/2)}if(e.shape==="polygon"&&e.points&&e.points.length>=3)return VGn(e.points)}function bEi(e){if(e.shape==="polygon")return VGn(e.points);if(e.shape==="circle")return aL(e.x,e.y,e.radius,e.radius);if(e.shape==="oval"){if((e.rotation??0)!==0){let o=Math.hypot(e.radiusX,e.radiusY);return aL(e.x,e.y,o,o)}return aL(e.x,e.y,e.radiusX,e.radiusY)}let t=e.width/2,n=e.height/2;if((e.rotation??0)!==0){let o=Math.hypot(t,n);return aL(e.x,e.y,o,o)}return aL(e.x,e.y,t,n)}function IEi(e){if(e.shape==="circle"){if(e.radius<=0)return;return{shape:"circle",x:e.center.x,y:e.center.y,radius:e.radius}}if(e.shape==="rect"){if(e.width<=0||e.height<=0)return;return{shape:"rect",x:e.center.x,y:e.center.y,width:e.width,height:e.height,radius:e.corner_radius,rotation:e.rotation}}if(e.shape==="polygon"&&e.points.length>=3)return{shape:"polygon",points:e.points}}function VGn(e){let t=1/0,n=-1/0,o=1/0,r=-1/0;for(let i of e)t=Math.min(t,i.x),n=Math.max(n,i.x),o=Math.min(o,i.y),r=Math.max(r,i.y);return{minX:t,maxX:n,minY:o,maxY:r}}function aL(e,t,n,o){return{minX:e-n,maxX:e+n,minY:t-o,maxY:t+o}}function vEi(e,t){return e.minX<=t.maxX&&e.maxX>=t.minX&&e.minY<=t.maxY&&e.maxY>=t.minY}function SEi(e){if(e.hole_shape==="circle"){let t=e.hole_diameter/2;if(t<=0)return;return{shape:"circle",x:e.x,y:e.y,radius:t}}if(e.hole_shape==="square"){if(e.hole_diameter<=0)return;return{shape:"rect",x:e.x,y:e.y,width:e.hole_diameter,height:e.hole_diameter,rotation:CPe(e)}}if(e.hole_shape==="oval"){if(e.hole_width<=0||e.hole_height<=0)return;return{shape:"oval",x:e.x,y:e.y,radiusX:e.hole_width/2,radiusY:e.hole_height/2,rotation:CPe(e)}}if(e.hole_shape==="rect"){if(e.hole_width<=0||e.hole_height<=0)return;return{shape:"rect",x:e.x,y:e.y,width:e.hole_width,height:e.hole_height,rotation:CPe(e)}}if(e.hole_shape==="pill"||e.hole_shape==="rotated_pill"){if(e.hole_width<=0||e.hole_height<=0)return;return{shape:"pill",x:e.x,y:e.y,width:e.hole_width,height:e.hole_height,rotation:CPe(e)}}}function PEi(e){if(e.shape==="circle"){let r=e.hole_diameter/2;if(r<=0)return;return{shape:"circle",x:e.x,y:e.y,radius:r}}if(e.shape==="oval"){let r=e.hole_width/2,i=e.hole_height/2;if(r<=0||i<=0)return;return{shape:"oval",x:e.x,y:e.y,radiusX:r,radiusY:i,rotation:e.ccw_rotation}}if(e.shape==="pill"){if(e.hole_width<=0||e.hole_height<=0)return;return{shape:"pill",x:e.x,y:e.y,width:e.hole_width,height:e.hole_height,rotation:e.ccw_rotation}}if(e.shape==="circular_hole_with_rect_pad"){let r=e.hole_diameter/2;if(r<=0)return;return{shape:"circle",x:e.x+(e.hole_offset_x??0),y:e.y+(e.hole_offset_y??0),radius:r}}if(e.shape==="pill_hole_with_rect_pad"){if(e.hole_width<=0||e.hole_height<=0)return;return{shape:"pill",x:e.x+(e.hole_offset_x??0),y:e.y+(e.hole_offset_y??0),width:e.hole_width,height:e.hole_height}}if(e.shape==="rotated_pill_hole_with_rect_pad"){if(e.hole_width<=0||e.hole_height<=0)return;return{shape:"pill",x:e.x+(e.hole_offset_x??0),y:e.y+(e.hole_offset_y??0),width:e.hole_width,height:e.hole_height,rotation:e.hole_ccw_rotation}}if(e.shape!=="hole_with_polygon_pad")return;let t=e.x+(e.hole_offset_x??0),n=e.y+(e.hole_offset_y??0),o=e.hole_shape;if(o==="circle"){let r=(e.hole_diameter??0)/2;if(r<=0)return;return{shape:"circle",x:t,y:n,radius:r}}if(o==="oval"){let r=(e.hole_width??0)/2,i=(e.hole_height??0)/2;if(r<=0||i<=0)return;return{shape:"oval",x:t,y:n,radiusX:r,radiusY:i}}if(o==="pill"||o==="rotated_pill"){let r=e.hole_width??0,i=e.hole_height??0;if(r<=0||i<=0)return;return{shape:"pill",x:t,y:n,width:r,height:i,rotation:o==="rotated_pill"?e.ccw_rotation:0}}}function CPe(e){return"ccw_rotation"in e&&typeof e.ccw_rotation==="number"?e.ccw_rotation:0}function EEi(e){if(e.shape==="rect"||e.shape==="rotated_rect")return e.corner_radius??e.rect_border_radius??0;return 0}function yGn(e,t){if(!e||e.length===0)return!0;let n=xGn(t);return e.some((o)=>xGn(o)===n)}function xGn(e){if(typeof e==="string")return e;if(e&&typeof e==="object"&&"name"in e&&typeof e.name==="string")return e.name}function MEi(e,t){let n=parseInt(e.slice(1,3),16),o=parseInt(e.slice(3,5),16),r=parseInt(e.slice(5,7),16);return`rgba(${n}, ${o}, ${r}, ${t})`}function wEi(e,t){return e.layers.includes("bottom")&&!e.layers.includes("top")?t.keepout.bottom:t.keepout.top}function CGn(e){let{ctx:t,strokeColor:n,hatchWidth:o,hatchSpacing:r,diagonal:i,getLineEndpoints:s}=e;t.strokeStyle=n,t.lineWidth=o,t.setLineDash([]);for(let a=-i;a<i*2;a+=r){let{startX:c,startY:l,endX:h,endY:d}=s(a);t.beginPath(),t.moveTo(c,l),t.lineTo(h,d),t.stroke()}}function bGn(e){let{ctx:t,fillColor:n,drawPath:o,drawHatch:r}=e;o(),t.fillStyle=n,t.fill(),o(),t.clip(),r()}function BEi(e){let{ctx:t,keepout:n,realToCanvasMat:o,colorMap:r}=e,i=Math.abs(o.a),s=wEi(n,r),a=MEi(s,0.2),c=1*i,l=0.15*i;if(n.shape==="rect"){let[h,d]=Jn(o,[n.center.x,n.center.y]),u=n.width*i,_=n.height*i,p=n.rotation??0,m=Math.sqrt(u*u+_*_),A=u/2,g=_/2;if(t.save(),t.translate(h,d),p!==0)t.rotate(-p*(Math.PI/180));bGn({ctx:t,strokeColor:s,fillColor:a,drawPath:()=>gEi({ctx:t,cx:0,cy:0,width:u,height:_}),drawHatch:()=>CGn({ctx:t,strokeColor:s,hatchWidth:l,hatchSpacing:c,diagonal:m,getLineEndpoints:(f)=>({startX:-A+f,startY:-g,endX:-A+f+m,endY:-g+m})})}),t.restore();return}if(n.shape==="circle"){let[h,d]=Jn(o,[n.center.x,n.center.y]),u=n.radius*i,_=u*2;t.save(),t.translate(h,d),bGn({ctx:t,strokeColor:s,fillColor:a,drawPath:()=>_Ei({ctx:t,cx:0,cy:0,radius:u}),drawHatch:()=>CGn({ctx:t,strokeColor:s,hatchWidth:l,hatchSpacing:c,diagonal:_,getLineEndpoints:(p)=>({startX:p-_,startY:-_,endX:p+_,endY:_})})}),t.restore()}}var TEi="rgba(255,255,255,0.5)";function DEi(e){let{ctx:t,pcbNoteDimension:n,realToCanvasMat:o}=e,r=n.color??TEi;LGn({ctx:t,from:n.from,to:n.to,realToCanvasMat:o,color:r,fontSize:n.font_size,arrowSize:n.arrow_size,text:n.text,textRotation:n.text_ccw_rotation,offset:n.offset_distance&&n.offset_direction?{distance:n.offset_distance,direction:n.offset_direction}:void 0})}function NEi(e){let{ctx:t,line:n,realToCanvasMat:o,colorMap:r}=e,i="rgb(89, 148, 220)",s=n.color??"rgb(89, 148, 220)",a=n.stroke_width??0.1,c=n.is_dashed??!1,[l,h]=Jn(o,[n.x1,n.y1]),[d,u]=Jn(o,[n.x2,n.y2]),_=a*Math.abs(o.a);if(t.save(),c)t.setLineDash([_*2,_*2]);else t.setLineDash([]);t.beginPath(),t.moveTo(l,h),t.lineTo(d,u),t.lineWidth=_,t.strokeStyle=s,t.lineCap="round",t.stroke(),t.restore()}function Y0e(e){let{ctx:t,start:n,end:o,strokeWidth:r,stroke:i,realToCanvasMat:s,lineCap:a="round"}=e,[c,l]=Jn(s,[n.x,n.y]),[h,d]=Jn(s,[o.x,o.y]),u=r*Math.abs(s.a);t.beginPath(),t.moveTo(c,l),t.lineTo(h,d),t.lineWidth=u,t.strokeStyle=i,t.lineCap=a,t.stroke()}function REi(e){let{ctx:t,path:n,realToCanvasMat:o,colorMap:r}=e,i="rgb(89, 148, 220)",s=n.color??"rgb(89, 148, 220)";if(!n.route||n.route.length<2)return;for(let a=0;a<n.route.length-1;a++){let c=n.route[a],l=n.route[a+1];if(!c||!l)continue;Y0e({ctx:t,start:{x:c.x,y:c.y},end:{x:l.x,y:l.y},strokeWidth:n.stroke_width??0.1,stroke:s,realToCanvasMat:o})}}function QEi(e){let{ctx:t,rect:n,realToCanvasMat:o,colorMap:r}=e,i="rgb(89, 148, 220)",s=n.color??"rgb(89, 148, 220)",a=n.is_filled??!1,c=n.has_stroke??!0,l=n.is_stroke_dashed??!1;ep({ctx:t,center:n.center,width:n.width,height:n.height,fill:a?s:void 0,stroke:c?s:void 0,strokeWidth:c?n.stroke_width:void 0,borderRadius:n.corner_radius,realToCanvasMat:o,isStrokeDashed:l})}var kEi="rgb(89, 148, 220)";function LEi(e){let{ctx:t,text:n,realToCanvasMat:o,colorMap:r}=e,i=kEi,s=n.color??i,a=n.font_size??1;Dee({ctx:t,text:n.text??"",x:n.anchor_position.x,y:n.anchor_position.y,fontSize:a,color:s,realToCanvasMat:o,anchorAlignment:n.anchor_alignment??"center",mirrorX:n.is_mirrored_from_top_view??n.layer==="bottom"})}function HEi(e){let{ctx:t,panel:n,realToCanvasMat:o,colorMap:r,drawBoardMaterial:i}=e,{width:s,height:a,center:c}=n;if(s!==void 0&&a!==void 0&&c){if(i)ep({ctx:t,center:c,width:s,height:a,fill:r.substrate,realToCanvasMat:o});let l=s/2,h=a/2,d=[{x:c.x-l,y:c.y-h},{x:c.x+l,y:c.y-h},{x:c.x+l,y:c.y+h},{x:c.x-l,y:c.y+h}];SPe({ctx:t,points:d,stroke:r.boardOutline,strokeWidth:0.5,realToCanvasMat:o,closePath:!0})}}function G0e(e,t){if(e.length<3||t===0)return e;let n=0,o=0;for(let i of e)n+=i.x,o+=i.y;n/=e.length,o/=e.length;let r=[];for(let i of e){let s=i.x-n,a=i.y-o,c=Math.sqrt(s*s+a*a);if(c>0){let l=s/c,h=a/c;r.push({x:i.x+l*t,y:i.y+h*t})}else r.push({x:i.x+t,y:i.y})}return r}function IGn(e){let{ctx:t,hole:n,realToCanvasMat:o,colorMap:r,soldermaskMargin:i=0,drawSoldermask:s}=e;if(n.is_covered_with_solder_mask===!0&&s)return;let a=r.copper[e.layer??"top"],c=i<0?Math.abs(i):0;if(n.shape==="circle"){Em({ctx:t,center:{x:n.x,y:n.y},radius:n.outer_diameter/2-c,fill:a,realToCanvasMat:o}),mP(t,()=>{Em({ctx:t,center:{x:n.x,y:n.y},radius:n.hole_diameter/2,fill:"#000",realToCanvasMat:o})}),Em({ctx:t,center:{x:n.x,y:n.y},radius:n.hole_diameter/2,fill:r.drill,realToCanvasMat:o});return}if(n.shape==="oval"){G9({ctx:t,center:{x:n.x,y:n.y},radius_x:n.outer_width/2-c,radius_y:n.outer_height/2-c,fill:a,realToCanvasMat:o,rotation:n.ccw_rotation}),mP(t,()=>{G9({ctx:t,center:{x:n.x,y:n.y},radius_x:n.hole_width/2,radius_y:n.hole_height/2,fill:"#000",realToCanvasMat:o,rotation:n.ccw_rotation})}),G9({ctx:t,center:{x:n.x,y:n.y},radius_x:n.hole_width/2,radius_y:n.hole_height/2,fill:r.drill,realToCanvasMat:o,rotation:n.ccw_rotation});return}if(n.shape==="pill"){A_({ctx:t,center:{x:n.x,y:n.y},width:n.outer_width-c*2,height:n.outer_height-c*2,fill:a,realToCanvasMat:o,rotation:n.ccw_rotation}),mP(t,()=>{A_({ctx:t,center:{x:n.x,y:n.y},width:n.hole_width,height:n.hole_height,fill:"#000",realToCanvasMat:o,rotation:n.ccw_rotation})}),A_({ctx:t,center:{x:n.x,y:n.y},width:n.hole_width,height:n.hole_height,fill:r.drill,realToCanvasMat:o,rotation:n.ccw_rotation});return}if(n.shape==="circular_hole_with_rect_pad"){ep({ctx:t,center:{x:n.x,y:n.y},width:n.rect_pad_width-c*2,height:n.rect_pad_height-c*2,fill:a,realToCanvasMat:o,borderRadius:n.rect_border_radius?Math.max(0,n.rect_border_radius-c):0,ccwRotationDegrees:n.rect_ccw_rotation});let l=n.x+(n.hole_offset_x??0),h=n.y+(n.hole_offset_y??0);mP(t,()=>{Em({ctx:t,center:{x:l,y:h},radius:n.hole_diameter/2,fill:"#000",realToCanvasMat:o})}),Em({ctx:t,center:{x:l,y:h},radius:n.hole_diameter/2,fill:r.drill,realToCanvasMat:o});return}if(n.shape==="pill_hole_with_rect_pad"){ep({ctx:t,center:{x:n.x,y:n.y},width:n.rect_pad_width-c*2,height:n.rect_pad_height-c*2,fill:a,realToCanvasMat:o,borderRadius:n.rect_border_radius?Math.max(0,n.rect_border_radius-c):0});let l=n.x+(n.hole_offset_x??0),h=n.y+(n.hole_offset_y??0);mP(t,()=>{A_({ctx:t,center:{x:l,y:h},width:n.hole_width,height:n.hole_height,fill:"#000",realToCanvasMat:o})}),A_({ctx:t,center:{x:l,y:h},width:n.hole_width,height:n.hole_height,fill:r.drill,realToCanvasMat:o});return}if(n.shape==="rotated_pill_hole_with_rect_pad"){ep({ctx:t,center:{x:n.x,y:n.y},width:n.rect_pad_width-c*2,height:n.rect_pad_height-c*2,fill:a,realToCanvasMat:o,borderRadius:n.rect_border_radius?Math.max(0,n.rect_border_radius-c):0,ccwRotationDegrees:n.rect_ccw_rotation});let l=n.x+(n.hole_offset_x??0),h=n.y+(n.hole_offset_y??0);mP(t,()=>{A_({ctx:t,center:{x:l,y:h},width:n.hole_width,height:n.hole_height,fill:"#000",realToCanvasMat:o,rotation:n.hole_ccw_rotation})}),A_({ctx:t,center:{x:l,y:h},width:n.hole_width,height:n.hole_height,fill:r.drill,realToCanvasMat:o,rotation:n.hole_ccw_rotation});return}if(n.shape==="hole_with_polygon_pad"){let l=n.pad_outline;if(l&&l.length>=3){let _=l.map((m)=>({x:n.x+m.x,y:n.y+m.y})),p=c>0?G0e(_,-c):_;if(p.length>=3)_P({ctx:t,points:p,fill:a,realToCanvasMat:o})}let h=n.x+(n.hole_offset_x??0),d=n.y+(n.hole_offset_y??0),u=n.hole_shape;if(u==="circle")mP(t,()=>{Em({ctx:t,center:{x:h,y:d},radius:(n.hole_diameter??0)/2,fill:"#000",realToCanvasMat:o})}),Em({ctx:t,center:{x:h,y:d},radius:(n.hole_diameter??0)/2,fill:r.drill,realToCanvasMat:o});else if(u==="oval")mP(t,()=>{G9({ctx:t,center:{x:h,y:d},radius_x:(n.hole_width??0)/2,radius_y:(n.hole_height??0)/2,fill:"#000",realToCanvasMat:o})}),G9({ctx:t,center:{x:h,y:d},radius_x:(n.hole_width??0)/2,radius_y:(n.hole_height??0)/2,fill:r.drill,realToCanvasMat:o});else if(u==="pill")mP(t,()=>{A_({ctx:t,center:{x:h,y:d},width:n.hole_width??0,height:n.hole_height??0,fill:"#000",realToCanvasMat:o})}),A_({ctx:t,center:{x:h,y:d},width:n.hole_width??0,height:n.hole_height??0,fill:r.drill,realToCanvasMat:o});else if(u==="rotated_pill")mP(t,()=>{A_({ctx:t,center:{x:h,y:d},width:n.hole_width??0,height:n.hole_height??0,fill:"#000",realToCanvasMat:o})}),A_({ctx:t,center:{x:h,y:d},width:n.hole_width??0,height:n.hole_height??0,fill:r.drill,realToCanvasMat:o});return}}function mP(e,t){e.save(),e.globalCompositeOperation="destination-out",t(),e.restore()}function FEi(e,t){return e==="bottom"?t.silkscreen.bottom:t.silkscreen.top}function zEi(e){let{ctx:t,circle:n,realToCanvasMat:o,colorMap:r}=e,i=FEi(n.layer,r);Em({ctx:t,center:n.center,radius:n.radius,stroke:i,strokeWidth:n.stroke_width,realToCanvasMat:o})}function OEi(e){let{ctx:t,graphic:n,realToCanvasMat:o,colorMap:r}=e,i=n.layer==="bottom"?r.silkscreen.bottom:r.silkscreen.top;t.beginPath(),QGn({ctx:t,shape:n.brep_shape,realToCanvasMat:o}),t.fillStyle=i,t.fill("evenodd")}function VEi(e,t){return e==="bottom"?t.silkscreen.bottom:t.silkscreen.top}function YEi(e){let{ctx:t,line:n,realToCanvasMat:o,colorMap:r}=e,i=VEi(n.layer,r);Y0e({ctx:t,start:{x:n.x1,y:n.y1},end:{x:n.x2,y:n.y2},strokeWidth:n.stroke_width??0.1,stroke:i,realToCanvasMat:o})}function GEi(e,t){return e==="bottom"?t.silkscreen.bottom:t.silkscreen.top}function UEi(e){let{ctx:t,oval:n,realToCanvasMat:o,colorMap:r}=e,i=GEi(n.layer,r);G9({ctx:t,center:n.center,radius_x:n.radius_x,radius_y:n.radius_y,stroke:i,strokeWidth:0.1,realToCanvasMat:o,rotation:n.ccw_rotation??0})}function WEi(e,t){return e==="bottom"?t.silkscreen.bottom:t.silkscreen.top}function XEi(e){let{ctx:t,path:n,realToCanvasMat:o,colorMap:r}=e,i=WEi(n.layer,r);if(!n.route||n.route.length<2)return;for(let s=0;s<n.route.length-1;s++){let a=n.route[s],c=n.route[s+1];if(!a||!c)continue;Y0e({ctx:t,start:{x:a.x,y:a.y},end:{x:c.x,y:c.y},strokeWidth:n.stroke_width??0.1,stroke:i,realToCanvasMat:o})}}function jEi(e,t){return e==="bottom"?t.silkscreen.bottom:t.silkscreen.top}function KEi(e){let{ctx:t,pill:n,realToCanvasMat:o,colorMap:r}=e,i=jEi(n.layer,r),s=0.2;A_({ctx:t,center:n.center,width:n.width,height:n.height,stroke:i,strokeWidth:0.2,realToCanvasMat:o})}function $Ei(e,t){return e==="bottom"?t.silkscreen.bottom:t.silkscreen.top}function qEi(e){let{ctx:t,rect:n,realToCanvasMat:o,colorMap:r}=e,i=$Ei(n.layer,r);ep({ctx:t,center:n.center,width:n.width,height:n.height,borderRadius:n.corner_radius,fill:n.is_filled?i:"transparent",stroke:i,strokeWidth:n.stroke_width,realToCanvasMat:o})}function JEi(e,t){return e==="bottom"?t.silkscreen.bottom:t.silkscreen.top}function ZEi(e){if(!e)return"center";return e}function eMi(e){let{ctx:t,text:n,realToCanvasMat:o,colorMap:r}=e,i=n.text??"";if(!i)return;let s=JEi(n.layer,r),a=ZEi(n.anchor_alignment),c=n.font_size??1;Dee({ctx:t,text:i,x:n.anchor_position.x,y:n.anchor_position.y,fontSize:c,color:s,realToCanvasMat:o,anchorAlignment:a,rotation:n.ccw_rotation??0,mirrorX:n.layer==="bottom",knockout:n.is_knockout,knockoutPadding:n.is_knockout?n.knockout_padding:void 0})}function tMi(e,t){return t.copper[e]??t.copper.top}function vGn(e){if(e.shape==="rect"||e.shape==="rotated_rect")return e.corner_radius??e.rect_border_radius??0;return 0}function nMi(e){let{ctx:t,pad:n,realToCanvasMat:o,colorMap:r}=e,i=tMi(n.layer,r),s=fEi(e);if(s.length>0){AEi({ctx:t,pad:n,realToCanvasMat:o,color:i,drillCutouts:s});return}if(n.shape==="rect"){ep({ctx:t,center:{x:n.x,y:n.y},width:n.width,height:n.height,fill:i,realToCanvasMat:o,borderRadius:vGn(n)});return}if(n.shape==="rotated_rect"){ep({ctx:t,center:{x:n.x,y:n.y},width:n.width,height:n.height,fill:i,realToCanvasMat:o,borderRadius:vGn(n),ccwRotationDegrees:n.ccw_rotation??0});return}if(n.shape==="circle"){Em({ctx:t,center:{x:n.x,y:n.y},radius:n.radius,fill:i,realToCanvasMat:o});return}if(n.shape==="pill"){A_({ctx:t,center:{x:n.x,y:n.y},width:n.width,height:n.height,fill:i,realToCanvasMat:o});return}if(n.shape==="rotated_pill"){A_({ctx:t,center:{x:n.x,y:n.y},width:n.width,height:n.height,fill:i,realToCanvasMat:o,rotation:n.ccw_rotation??0});return}if(n.shape==="polygon"){if(n.points&&n.points.length>=3)_P({ctx:t,points:n.points,fill:i,realToCanvasMat:o});return}}var V0e="rgb(105, 105, 105)";function SGn(e){let{ctx:t,solderPaste:n,realToCanvasMat:o}=e;if(n.shape==="polygon")return;let r={x:n.x,y:n.y};if(n.shape==="rect"){ep({ctx:t,center:r,width:n.width,height:n.height,fill:V0e,realToCanvasMat:o});return}if(n.shape==="rotated_rect"){ep({ctx:t,center:r,width:n.width,height:n.height,fill:V0e,realToCanvasMat:o,ccwRotationDegrees:n.ccw_rotation});return}if(n.shape==="pill"){A_({ctx:t,center:r,width:n.width,height:n.height,fill:V0e,realToCanvasMat:o});return}if(n.shape==="oval"){G9({ctx:t,center:r,radius_x:n.width/2,radius_y:n.height/2,fill:V0e,realToCanvasMat:o});return}if(n.shape==="circle")Em({ctx:t,center:r,radius:n.radius,fill:V0e,realToCanvasMat:o})}function oMi(e){return typeof e==="function"}function YGn(e,t,n){if(t<=0||n<=0)return null;let o=globalThis,r=null;if("OffscreenCanvas"in o&&typeof o.OffscreenCanvas==="function")r=new o.OffscreenCanvas(t,n);else if("document"in o&&o.document&&typeof o.document.createElement==="function"){let s=o.document.createElement("canvas");s.width=t,s.height=n,r=s}else{let s=e.canvas.constructor;if(oMi(s))try{r=new s(t,n)}catch{return null}}if(!r)return null;let i=r.getContext("2d");if(i)i.boardOwnerMap=e.boardOwnerMap;return i}function rMi(e){return"createPattern"in e&&typeof Reflect.get(e,"createPattern")==="function"}function GGn(e,t){if(e===t)return!1;if(t.canvas.width<=0||t.canvas.height<=0)return!1;if(!rMi(e))return!1;let n=null;try{n=e.createPattern(t.canvas,"no-repeat")}catch{return!1}if(!n)return!1;return e.save(),e.globalCompositeOperation="source-over",e.fillStyle=n,e.fillRect(0,0,t.canvas.width,t.canvas.height),e.restore(),!0}function PGn(e){let{ctx:t,board:n,realToCanvasMat:o,soldermaskColor:r}=e,{width:i,height:s,center:a,outline:c}=n;if(c&&Array.isArray(c)&&c.length>=3){let l=c.map((h)=>{let[d,u]=Jn(o,[h.x,h.y]);return{x:d,y:u}});t.beginPath(),cL({ctx:t,points:l}),t.fillStyle=r,t.fill()}else if(i!==void 0&&s!==void 0&&a){let[l,h]=Jn(o,[a.x,a.y]),d=i*Math.abs(o.a),u=s*Math.abs(o.a);t.fillStyle=r,t.fillRect(l-d/2,h-u/2,d,u)}}function iMi(e){let{ctx:t,panel:n,realToCanvasMat:o,soldermaskColor:r}=e,{width:i,height:s,center:a}=n;if(i===void 0||s===void 0||!a)return;let[c,l]=Jn(o,[a.x,a.y]),h=i*Math.abs(o.a),d=s*Math.abs(o.a);t.fillStyle=r,t.fillRect(c-h/2,l-d/2,h,d)}function d3(e){e.save(),e.globalCompositeOperation="destination-out",e.fill(),e.restore()}function sMi(e){let{ctx:t,cutout:n,realToCanvasMat:o}=e;if(n.shape==="rect"){let[r,i]=Jn(o,[n.center?.x??0,n.center?.y??0]),s=n.width*Math.abs(o.a),a=n.height*Math.abs(o.a),c=(n.corner_radius??0)*Math.abs(o.a);if(t.save(),t.translate(r,i),n.rotation)t.rotate(-n.rotation*Math.PI/180);t.beginPath(),h3({ctx:t,cx:0,cy:0,width:s,height:a,radius:c}),t.restore(),d3(t)}else if(n.shape==="circle"){let[r,i]=Jn(o,[n.center?.x??0,n.center?.y??0]),s=n.radius*Math.abs(o.a);t.beginPath(),t.arc(r,i,s,0,Math.PI*2),t.closePath(),d3(t)}else if(n.shape==="polygon"&&n.points&&n.points.length>=3){let r=n.points.map((i)=>{let[s,a]=Jn(o,[i.x,i.y]);return{x:s,y:a}});t.beginPath(),cL({ctx:t,points:r}),d3(t)}}var DA="rgba(255, 255, 255, 1)";function adt(e){let{ctx:t,elements:n,layer:o,realToCanvasMat:r}=e;t.save(),t.globalCompositeOperation="destination-out";for(let i of n){if(i.type==="pcb_smtpad"){if(i.layer!==o)continue;if(i.is_covered_with_solder_mask===!0)continue;aMi({ctx:t,pad:i,realToCanvasMat:r});continue}if(i.type==="pcb_plated_hole"){if(i.layers&&!i.layers.includes(o))continue;if(i.is_covered_with_solder_mask===!0)continue;cMi({ctx:t,hole:i,realToCanvasMat:r});continue}if(i.type==="pcb_via"){if(i.layers&&!i.layers.includes(o))continue;Em({ctx:t,center:{x:i.x,y:i.y},radius:i.outer_diameter/2,fill:DA,realToCanvasMat:r});continue}if(i.type==="pcb_hole"){if(i.is_covered_with_solder_mask===!0)continue;lMi({ctx:t,hole:i,realToCanvasMat:r})}}t.restore()}function aMi(e){let{ctx:t,pad:n,realToCanvasMat:o}=e;if(n.shape==="rect"){ep({ctx:t,center:{x:n.x,y:n.y},width:n.width,height:n.height,borderRadius:n.corner_radius??n.rect_border_radius??0,fill:DA,realToCanvasMat:o});return}if(n.shape==="rotated_rect"){ep({ctx:t,center:{x:n.x,y:n.y},width:n.width,height:n.height,borderRadius:n.corner_radius??n.rect_border_radius??0,ccwRotationDegrees:n.ccw_rotation??0,fill:DA,realToCanvasMat:o});return}if(n.shape==="circle"){Em({ctx:t,center:{x:n.x,y:n.y},radius:n.radius,fill:DA,realToCanvasMat:o});return}if(n.shape==="pill"||n.shape==="rotated_pill"){A_({ctx:t,center:{x:n.x,y:n.y},width:n.width,height:n.height,rotation:n.shape==="rotated_pill"?n.ccw_rotation??0:0,fill:DA,realToCanvasMat:o});return}if(n.shape==="polygon"&&n.points&&n.points.length>=3)_P({ctx:t,points:n.points,fill:DA,realToCanvasMat:o})}function cMi(e){let{ctx:t,hole:n,realToCanvasMat:o}=e;if(n.shape==="circle"){Em({ctx:t,center:{x:n.x,y:n.y},radius:n.outer_diameter/2,fill:DA,realToCanvasMat:o});return}if(n.shape==="oval"){G9({ctx:t,center:{x:n.x,y:n.y},radius_x:n.outer_width/2,radius_y:n.outer_height/2,rotation:n.ccw_rotation,fill:DA,realToCanvasMat:o});return}if(n.shape==="pill"){A_({ctx:t,center:{x:n.x,y:n.y},width:n.outer_width,height:n.outer_height,rotation:n.ccw_rotation,fill:DA,realToCanvasMat:o});return}if(n.shape==="circular_hole_with_rect_pad"){ep({ctx:t,center:{x:n.x,y:n.y},width:n.rect_pad_width,height:n.rect_pad_height,borderRadius:n.rect_border_radius??0,ccwRotationDegrees:n.rect_ccw_rotation,fill:DA,realToCanvasMat:o});return}if(n.shape==="pill_hole_with_rect_pad"){ep({ctx:t,center:{x:n.x,y:n.y},width:n.rect_pad_width,height:n.rect_pad_height,borderRadius:n.rect_border_radius??0,fill:DA,realToCanvasMat:o});return}if(n.shape==="rotated_pill_hole_with_rect_pad"){ep({ctx:t,center:{x:n.x,y:n.y},width:n.rect_pad_width,height:n.rect_pad_height,borderRadius:n.rect_border_radius??0,ccwRotationDegrees:n.rect_ccw_rotation,fill:DA,realToCanvasMat:o});return}if(n.shape==="hole_with_polygon_pad"&&n.pad_outline&&n.pad_outline.length>=3)_P({ctx:t,points:n.pad_outline.map((r)=>({x:n.x+r.x,y:n.y+r.y})),fill:DA,realToCanvasMat:o})}function lMi(e){let{ctx:t,hole:n,realToCanvasMat:o}=e,r="ccw_rotation"in n&&typeof n.ccw_rotation==="number"?n.ccw_rotation:0;if(n.hole_shape==="circle"){Em({ctx:t,center:{x:n.x,y:n.y},radius:n.hole_diameter/2,fill:DA,realToCanvasMat:o});return}if(n.hole_shape==="square"){ep({ctx:t,center:{x:n.x,y:n.y},width:n.hole_diameter,height:n.hole_diameter,ccwRotationDegrees:r,fill:DA,realToCanvasMat:o});return}if(n.hole_shape==="oval"){G9({ctx:t,center:{x:n.x,y:n.y},radius_x:n.hole_width/2,radius_y:n.hole_height/2,rotation:r,fill:DA,realToCanvasMat:o});return}if(n.hole_shape==="rect"){ep({ctx:t,center:{x:n.x,y:n.y},width:n.hole_width,height:n.hole_height,ccwRotationDegrees:r,fill:DA,realToCanvasMat:o});return}if(n.hole_shape==="pill"||n.hole_shape==="rotated_pill")A_({ctx:t,center:{x:n.x,y:n.y},width:n.hole_width,height:n.hole_height,rotation:r,fill:DA,realToCanvasMat:o})}function hMi(e,t,n,o,r){if(Math.abs(r)<0.0000000001)return null;let i=n-e,s=o-t,a=Math.hypot(i,s);if(a<0.0000000001)return null;let c=Math.abs(r)*(a/2),l=a/2,h=(c*c+l*l)/(2*c),d=h-c,u=(e+n)/2,_=(t+o)/2,p=-s/a,m=i/a,A=r>0?-1:1;return{centerX:u+A*p*d,centerY:_+A*m*d,radius:h}}function cdt(e,t,n,o,r,i,s){if(Math.abs(i)<0.0000000001){let[x,C]=Jn(s,[o,r]);e.lineTo(x,C);return}let a=hMi(t,n,o,r,i);if(!a){let[x,C]=Jn(s,[o,r]);e.lineTo(x,C);return}let[c,l]=Jn(s,[t,n]),[h,d]=Jn(s,[o,r]),[u,_]=Jn(s,[a.centerX,a.centerY]),p=Math.hypot(c-u,l-_),m=Math.atan2(l-_,c-u),A=Math.atan2(d-_,h-u),f=s.a*s.d-s.b*s.c<0,y=i>0?!f:f;e.arc(u,_,p,m,A,y)}function EGn(e,t,n){if(t.vertices.length<2)return;if(t.vertices.length===2){let s=t.vertices[0],a=t.vertices[1];if(s&&a&&Math.abs((s.bulge??0)-1)<0.0000000001&&Math.abs((a.bulge??0)-1)<0.0000000001){let[c,l]=Jn(n,[s.x,s.y]);e.moveTo(c,l),cdt(e,s.x,s.y,a.x,a.y,1,n),cdt(e,a.x,a.y,s.x,s.y,1,n);return}}let o=t.vertices[0];if(!o)return;let[r,i]=Jn(n,[o.x,o.y]);e.moveTo(r,i);for(let s=0;s<t.vertices.length;s++){let a=t.vertices[s],c=t.vertices[(s+1)%t.vertices.length];if(!a||!c)continue;let l=a.bulge??0;if(Math.abs(l)<0.0000000001){let[h,d]=Jn(n,[c.x,c.y]);e.lineTo(h,d)}else cdt(e,a.x,a.y,c.x,c.y,l,n)}}function dMi(e){let{ctx:t,pour:n,realToCanvasMat:o,soldermaskOverCopperColor:r,layer:i,elements:s}=e;if(n.layer!==i)return;if(n.covered_with_solder_mask!==!0)return;if(t.save(),t.fillStyle=r,n.shape==="rect"){let[a,c]=Jn(o,[n.center.x,n.center.y]),l=n.width*Math.abs(o.a),h=n.height*Math.abs(o.a);if(t.translate(a,c),n.rotation)t.rotate(-n.rotation*(Math.PI/180));t.beginPath(),t.rect(-l/2,-h/2,l,h),t.fill(),t.restore(),adt({ctx:t,elements:s,layer:i,realToCanvasMat:o});return}if(n.shape==="polygon"){if(n.points&&n.points.length>=3){let a=n.points.map((l)=>Jn(o,[l.x,l.y])),c=a[0];if(c){t.beginPath();let[l,h]=c;t.moveTo(l,h);for(let d=1;d<a.length;d++){let u=a[d];if(!u)continue;let[_,p]=u;t.lineTo(_,p)}t.closePath(),t.fill(),adt({ctx:t,elements:s,layer:i,realToCanvasMat:o})}}t.restore();return}if(n.shape==="brep"){if(t.beginPath(),EGn(t,n.brep_shape.outer_ring,o),n.brep_shape.inner_rings)for(let a of n.brep_shape.inner_rings)EGn(t,a,o);t.fill("evenodd"),adt({ctx:t,elements:s,layer:i,realToCanvasMat:o}),t.restore();return}t.restore()}function uMi(e){let{ctx:t,hole:n,realToCanvasMat:o,soldermaskOverCopperColor:r}=e,i=n.is_covered_with_solder_mask===!0,s=n.soldermask_margin??0;if(i)t.fillStyle=r,bPe({ctx:t,hole:n,realToCanvasMat:o,margin:0}),t.fill();else if(s<0)bPe({ctx:t,hole:n,realToCanvasMat:o,margin:s}),d3(t),pMi({ctx:t,hole:n,realToCanvasMat:o,soldermaskOverCopperColor:r,margin:s});else if(s>0)bPe({ctx:t,hole:n,realToCanvasMat:o,margin:s}),d3(t);else bPe({ctx:t,hole:n,realToCanvasMat:o,margin:0}),d3(t)}function UGn(e){if("ccw_rotation"in e&&typeof e.ccw_rotation==="number")return e.ccw_rotation;return 0}function bPe(e){let{ctx:t,hole:n,realToCanvasMat:o,margin:r}=e,i=UGn(n);if(n.hole_shape==="circle"){let[s,a]=Jn(o,[n.x,n.y]),c=(n.hole_diameter/2+r)*Math.abs(o.a);t.beginPath(),t.arc(s,a,c,0,Math.PI*2),t.closePath()}else if(n.hole_shape==="square"){let[s,a]=Jn(o,[n.x,n.y]),c=(n.hole_diameter+r*2)*Math.abs(o.a);if(t.save(),t.translate(s,a),i!==0)t.rotate(-i*Math.PI/180);t.beginPath(),t.rect(-c/2,-c/2,c,c),t.closePath(),t.restore()}else if(n.hole_shape==="oval"){let[s,a]=Jn(o,[n.x,n.y]),c=(n.hole_width/2+r)*Math.abs(o.a),l=(n.hole_height/2+r)*Math.abs(o.a);if(t.save(),t.translate(s,a),i!==0)t.rotate(-i*Math.PI/180);t.beginPath(),t.ellipse(0,0,c,l,0,0,Math.PI*2),t.closePath(),t.restore()}else if(n.hole_shape==="rect"){let[s,a]=Jn(o,[n.x,n.y]),c=(n.hole_width+r*2)*Math.abs(o.a),l=(n.hole_height+r*2)*Math.abs(o.a);if(t.save(),t.translate(s,a),i!==0)t.rotate(-i*Math.PI/180);t.beginPath(),t.rect(-c/2,-l/2,c,l),t.closePath(),t.restore()}else if(n.hole_shape==="pill"||n.hole_shape==="rotated_pill"){let[s,a]=Jn(o,[n.x,n.y]),c=(n.hole_width+r*2)*Math.abs(o.a),l=(n.hole_height+r*2)*Math.abs(o.a);if(t.save(),t.translate(s,a),i!==0)t.rotate(-i*Math.PI/180);t.beginPath(),RB({ctx:t,cx:0,cy:0,width:c,height:l}),t.restore()}}function pMi(e){let{ctx:t,hole:n,realToCanvasMat:o,soldermaskOverCopperColor:r,margin:i}=e,s=Math.abs(i),a=UGn(n);if(t.fillStyle=r,n.hole_shape==="circle"){let[c,l]=Jn(o,[n.x,n.y]),h=n.hole_diameter/2*Math.abs(o.a),d=s*Math.abs(o.a),u=Math.max(0,h-d);if(t.save(),t.beginPath(),t.arc(c,l,h,0,Math.PI*2),u>0)t.arc(c,l,u,0,Math.PI*2,!0);t.fill("evenodd"),t.restore()}else if(n.hole_shape==="square"){let[c,l]=Jn(o,[n.x,n.y]),h=n.hole_diameter*Math.abs(o.a),d=s*Math.abs(o.a),u=Math.max(0,h-d*2);if(t.save(),t.translate(c,l),a!==0)t.rotate(-a*Math.PI/180);if(t.beginPath(),t.rect(-h/2,-h/2,h,h),u>0)t.rect(-u/2,-u/2,u,u);t.fill("evenodd"),t.restore()}else if(n.hole_shape==="oval"){let[c,l]=Jn(o,[n.x,n.y]),h=n.hole_width/2*Math.abs(o.a),d=n.hole_height/2*Math.abs(o.a),u=s*Math.abs(o.a),_=Math.max(0,h-u),p=Math.max(0,d-u);if(t.save(),t.translate(c,l),a!==0)t.rotate(-a*Math.PI/180);if(t.beginPath(),t.ellipse(0,0,h,d,0,0,Math.PI*2),_>0&&p>0)t.moveTo(_,0),t.ellipse(0,0,_,p,0,0,Math.PI*2);t.fill("evenodd"),t.restore()}else if(n.hole_shape==="rect"){let[c,l]=Jn(o,[n.x,n.y]),h=n.hole_width*Math.abs(o.a),d=n.hole_height*Math.abs(o.a),u=s*Math.abs(o.a),_=Math.max(0,h-u*2),p=Math.max(0,d-u*2);if(t.save(),t.translate(c,l),a!==0)t.rotate(-a*Math.PI/180);if(t.beginPath(),t.rect(-h/2,-d/2,h,d),_>0&&p>0)t.rect(-_/2,-p/2,_,p);t.fill("evenodd"),t.restore()}else if(n.hole_shape==="pill"||n.hole_shape==="rotated_pill"){let[c,l]=Jn(o,[n.x,n.y]),h=n.hole_width*Math.abs(o.a),d=n.hole_height*Math.abs(o.a),u=s*Math.abs(o.a);if(t.save(),t.translate(c,l),a!==0)t.rotate(-a*Math.PI/180);t.beginPath(),RB({ctx:t,cx:0,cy:0,width:h,height:d});let _=h-u*2,p=d-u*2;if(_>0&&p>0)RB({ctx:t,cx:0,cy:0,width:_,height:p});t.fill("evenodd"),t.restore()}}function mMi(e){let{ctx:t,hole:n,realToCanvasMat:o,soldermaskOverCopperColor:r,layer:i}=e;if(n.layers&&!n.layers.includes(i))return;let s=n.is_covered_with_solder_mask===!0,a=n.soldermask_margin??0;if(s)t.fillStyle=r,IPe({ctx:t,hole:n,realToCanvasMat:o,margin:0}),t.fill();else if(a<0)IPe({ctx:t,hole:n,realToCanvasMat:o,margin:a}),d3(t),_Mi({ctx:t,hole:n,realToCanvasMat:o,soldermaskOverCopperColor:r,margin:a});else if(a>0)IPe({ctx:t,hole:n,realToCanvasMat:o,margin:a}),d3(t);else IPe({ctx:t,hole:n,realToCanvasMat:o,margin:0}),d3(t)}function IPe(e){let{ctx:t,hole:n,realToCanvasMat:o,margin:r}=e;if(n.shape==="circle"){let[i,s]=Jn(o,[n.x,n.y]),a=(n.outer_diameter/2+r)*Math.abs(o.a);t.beginPath(),t.arc(i,s,a,0,Math.PI*2),t.closePath()}else if(n.shape==="oval"){let[i,s]=Jn(o,[n.x,n.y]),a=(n.outer_width/2+r)*Math.abs(o.a),c=(n.outer_height/2+r)*Math.abs(o.a);t.beginPath(),t.ellipse(i,s,a,c,-((n.ccw_rotation??0)*Math.PI)/180,0,Math.PI*2),t.closePath()}else if(n.shape==="pill"){let[i,s]=Jn(o,[n.x,n.y]),a=(n.outer_width+r*2)*Math.abs(o.a),c=(n.outer_height+r*2)*Math.abs(o.a);t.beginPath(),RB({ctx:t,cx:i,cy:s,width:a,height:c,ccwRotationDegrees:n.ccw_rotation})}else if(n.shape==="circular_hole_with_rect_pad"){let[i,s]=Jn(o,[n.x,n.y]),a=(n.rect_pad_width+r*2)*Math.abs(o.a),c=(n.rect_pad_height+r*2)*Math.abs(o.a),l=(n.rect_border_radius??0)*Math.abs(o.a);t.beginPath(),h3({ctx:t,cx:i,cy:s,width:a,height:c,radius:l,ccwRotationDegrees:n.rect_ccw_rotation})}else if(n.shape==="pill_hole_with_rect_pad"){let[i,s]=Jn(o,[n.x,n.y]),a=(n.rect_pad_width+r*2)*Math.abs(o.a),c=(n.rect_pad_height+r*2)*Math.abs(o.a),l=(n.rect_border_radius??0)*Math.abs(o.a);t.beginPath(),h3({ctx:t,cx:i,cy:s,width:a,height:c,radius:l})}else if(n.shape==="rotated_pill_hole_with_rect_pad"){let[i,s]=Jn(o,[n.x,n.y]),a=(n.rect_pad_width+r*2)*Math.abs(o.a),c=(n.rect_pad_height+r*2)*Math.abs(o.a),l=(n.rect_border_radius??0)*Math.abs(o.a);t.beginPath(),h3({ctx:t,cx:i,cy:s,width:a,height:c,radius:l,ccwRotationDegrees:n.rect_ccw_rotation})}else if(n.shape==="hole_with_polygon_pad"&&n.pad_outline&&n.pad_outline.length>=3){let i=n.pad_outline.map((c)=>({x:n.x+c.x,y:n.y+c.y})),a=(r!==0?G0e(i,r):i).map((c)=>{let[l,h]=Jn(o,[c.x,c.y]);return{x:l,y:h}});t.beginPath(),cL({ctx:t,points:a})}}function _Mi(e){let{ctx:t,hole:n,realToCanvasMat:o,soldermaskOverCopperColor:r,margin:i}=e,s=Math.abs(i);if(t.fillStyle=r,n.shape==="circle"){let[a,c]=Jn(o,[n.x,n.y]),l=n.outer_diameter/2*Math.abs(o.a),h=s*Math.abs(o.a),d=Math.max(0,l-h);if(t.beginPath(),t.arc(a,c,l,0,Math.PI*2),d>0)t.arc(a,c,d,0,Math.PI*2,!0);t.fill("evenodd")}else if(n.shape==="oval"){let[a,c]=Jn(o,[n.x,n.y]),l=n.outer_width/2*Math.abs(o.a),h=n.outer_height/2*Math.abs(o.a),d=s*Math.abs(o.a),u=Math.max(0,l-d),_=Math.max(0,h-d),p=-((n.ccw_rotation??0)*Math.PI)/180;if(t.beginPath(),t.ellipse(a,c,l,h,p,0,Math.PI*2),u>0&&_>0){let m=a+u*Math.cos(p),A=c+u*Math.sin(p);t.moveTo(m,A),t.ellipse(a,c,u,_,p,0,Math.PI*2)}t.fill("evenodd")}else if(n.shape==="pill"){let[a,c]=Jn(o,[n.x,n.y]),l=n.outer_width*Math.abs(o.a),h=n.outer_height*Math.abs(o.a),d=s*Math.abs(o.a);t.beginPath(),RB({ctx:t,cx:a,cy:c,width:l,height:h,ccwRotationDegrees:n.ccw_rotation});let u=l-d*2,_=h-d*2;if(u>0&&_>0)RB({ctx:t,cx:a,cy:c,width:u,height:_,ccwRotationDegrees:n.ccw_rotation});t.fill("evenodd")}else if(n.shape==="circular_hole_with_rect_pad"){let[a,c]=Jn(o,[n.x,n.y]),l=n.rect_pad_width*Math.abs(o.a),h=n.rect_pad_height*Math.abs(o.a),d=s*Math.abs(o.a),u=n.rect_border_radius?n.rect_border_radius*Math.abs(o.a):0;t.beginPath(),h3({ctx:t,cx:a,cy:c,width:l,height:h,radius:u,ccwRotationDegrees:n.rect_ccw_rotation});let _=l-d*2,p=h-d*2;if(_>0&&p>0){let m=Math.max(0,u-d);h3({ctx:t,cx:a,cy:c,width:_,height:p,radius:m,ccwRotationDegrees:n.rect_ccw_rotation})}t.fill("evenodd")}else if(n.shape==="pill_hole_with_rect_pad"){let[a,c]=Jn(o,[n.x,n.y]),l=n.rect_pad_width*Math.abs(o.a),h=n.rect_pad_height*Math.abs(o.a),d=s*Math.abs(o.a),u=n.rect_border_radius?n.rect_border_radius*Math.abs(o.a):0;t.beginPath(),h3({ctx:t,cx:a,cy:c,width:l,height:h,radius:u});let _=l-d*2,p=h-d*2;if(_>0&&p>0){let m=Math.max(0,u-d);h3({ctx:t,cx:a,cy:c,width:_,height:p,radius:m})}t.fill("evenodd")}else if(n.shape==="rotated_pill_hole_with_rect_pad"){let[a,c]=Jn(o,[n.x,n.y]),l=n.rect_pad_width*Math.abs(o.a),h=n.rect_pad_height*Math.abs(o.a),d=s*Math.abs(o.a),u=n.rect_border_radius?n.rect_border_radius*Math.abs(o.a):0;t.beginPath(),h3({ctx:t,cx:a,cy:c,width:l,height:h,radius:u,ccwRotationDegrees:n.rect_ccw_rotation});let _=l-d*2,p=h-d*2;if(_>0&&p>0){let m=Math.max(0,u-d);h3({ctx:t,cx:a,cy:c,width:_,height:p,radius:m,ccwRotationDegrees:n.rect_ccw_rotation})}t.fill("evenodd")}else if(n.shape==="hole_with_polygon_pad"&&n.pad_outline&&n.pad_outline.length>=3){let a=n.pad_outline.map((h)=>({x:n.x+h.x,y:n.y+h.y}));t.beginPath();let c=a.map((h)=>{let[d,u]=Jn(o,[h.x,h.y]);return{x:d,y:u}});cL({ctx:t,points:c});let l=G0e(a,-s);if(l.length>=3){let h=l.map((d)=>{let[u,_]=Jn(o,[d.x,d.y]);return{x:u,y:_}});cL({ctx:t,points:h})}t.fill("evenodd")}}function gMi(e){let{ctx:t,pad:n,realToCanvasMat:o,soldermaskOverCopperColor:r,layer:i}=e;if(n.layer!==i)return;let s=n.is_covered_with_solder_mask===!0,a=n.soldermask_margin??0,c=a,l=a,h=a,d=a;if(n.shape==="rect"||n.shape==="rotated_rect")c=n.soldermask_margin_left??a,l=n.soldermask_margin_right??a,h=n.soldermask_margin_top??a,d=n.soldermask_margin_bottom??a;if(s)t.fillStyle=r,vPe({ctx:t,pad:n,realToCanvasMat:o,ml:0,mr:0,mt:0,mb:0}),t.fill();else if(c<0||l<0||h<0||d<0)vPe({ctx:t,pad:n,realToCanvasMat:o,ml:c,mr:l,mt:h,mb:d}),d3(t),AMi({ctx:t,pad:n,realToCanvasMat:o,soldermaskOverCopperColor:r,ml:c,mr:l,mt:h,mb:d});else if(c>0||l>0||h>0||d>0)vPe({ctx:t,pad:n,realToCanvasMat:o,ml:c,mr:l,mt:h,mb:d}),d3(t);else vPe({ctx:t,pad:n,realToCanvasMat:o,ml:0,mr:0,mt:0,mb:0}),d3(t)}function vPe(e){let{ctx:t,pad:n,realToCanvasMat:o,ml:r,mr:i,mt:s,mb:a}=e,c=n.shape==="rotated_rect"||n.shape==="rotated_pill"?n.ccw_rotation??0:0;if(n.shape==="rect"||n.shape==="rotated_rect"){let l=n.corner_radius??n.rect_border_radius??0,h=c*Math.PI/180,d=(i-r)/2,u=(s-a)/2,_=d*Math.cos(h)-u*Math.sin(h),p=d*Math.sin(h)+u*Math.cos(h),[m,A]=Jn(o,[n.x+_,n.y+p]),g=(n.width+r+i)*Math.abs(o.a),f=(n.height+s+a)*Math.abs(o.a),y=l*Math.abs(o.a);if(t.save(),t.translate(m,A),c!==0)t.rotate(-c*Math.PI/180);t.beginPath(),h3({ctx:t,cx:0,cy:0,width:g,height:f,radius:y}),t.restore()}else if(n.shape==="circle"){let l=(r+i+s+a)/4,[h,d]=Jn(o,[n.x,n.y]),u=(n.radius+l)*Math.abs(o.a);t.beginPath(),t.arc(h,d,u,0,Math.PI*2),t.closePath()}else if(n.shape==="pill"||n.shape==="rotated_pill"){let l=(r+i)/2,[h,d]=Jn(o,[n.x,n.y]),u=(n.width+l*2)*Math.abs(o.a),_=(n.height+l*2)*Math.abs(o.a);if(t.save(),t.translate(h,d),c!==0)t.rotate(-c*Math.PI/180);t.beginPath(),RB({ctx:t,cx:0,cy:0,width:u,height:_}),t.restore()}else if(n.shape==="polygon"&&n.points&&n.points.length>=3){let l=(r+i+s+a)/4,d=(l!==0?G0e(n.points,l):n.points).map((u)=>{let[_,p]=Jn(o,[u.x,u.y]);return{x:_,y:p}});t.beginPath(),cL({ctx:t,points:d})}}function AMi(e){let{ctx:t,pad:n,realToCanvasMat:o,soldermaskOverCopperColor:r,ml:i,mr:s,mt:a,mb:c}=e,l=n.shape==="rotated_rect"||n.shape==="rotated_pill"?n.ccw_rotation??0:0,h=Math.max(0,-i),d=Math.max(0,-s),u=Math.max(0,-a),_=Math.max(0,-c);if(t.fillStyle=r,n.shape==="rect"||n.shape==="rotated_rect"){let p=n.corner_radius??n.rect_border_radius??0,[m,A]=Jn(o,[n.x,n.y]),g=n.width*Math.abs(o.a),f=n.height*Math.abs(o.a),y=p*Math.abs(o.a),x=h*Math.abs(o.a),C=d*Math.abs(o.a),b=u*Math.abs(o.a),I=_*Math.abs(o.a);if(t.save(),t.translate(m,A),l!==0)t.rotate(-l*Math.PI/180);t.beginPath(),h3({ctx:t,cx:0,cy:0,width:g,height:f,radius:y});let v=g-x-C,P=f-b-I,M=(x-C)/2,B=(b-I)/2,T=Math.max(0,y-(x+C+b+I)/4);if(v>0&&P>0)h3({ctx:t,cx:M,cy:B,width:v,height:P,radius:T});t.fill("evenodd"),t.restore()}else if(n.shape==="circle"){let p=Math.max(h,d,u,_),[m,A]=Jn(o,[n.x,n.y]),g=n.radius*Math.abs(o.a),f=p*Math.abs(o.a),y=Math.max(0,g-f);if(t.save(),t.beginPath(),t.arc(m,A,g,0,Math.PI*2),y>0)t.arc(m,A,y,0,Math.PI*2,!0);t.fill("evenodd"),t.restore()}else if(n.shape==="pill"||n.shape==="rotated_pill"){let p=Math.max(h,d,u,_),[m,A]=Jn(o,[n.x,n.y]),g=n.width*Math.abs(o.a),f=n.height*Math.abs(o.a),y=p*Math.abs(o.a);if(t.save(),t.translate(m,A),l!==0)t.rotate(-l*Math.PI/180);t.beginPath(),RB({ctx:t,cx:0,cy:0,width:g,height:f});let x=g-y*2,C=f-y*2;if(x>0&&C>0)RB({ctx:t,cx:0,cy:0,width:x,height:C});t.fill("evenodd"),t.restore()}else if(n.shape==="polygon"&&n.points&&n.points.length>=3){let p=Math.max(h,d,u,_);t.save(),t.beginPath();let m=n.points.map((g)=>{let[f,y]=Jn(o,[g.x,g.y]);return{x:f,y}});cL({ctx:t,points:m});let A=G0e(n.points,-p);if(A.length>=3){let g=A.map((f)=>{let[y,x]=Jn(o,[f.x,f.y]);return{x:y,y:x}});cL({ctx:t,points:g})}t.fill("evenodd"),t.restore()}}function WGn(e){if(!e||typeof e!=="object")return!1;return"route_type"in e&&e.route_type==="wire"&&(("start_width"in e)||("end_width"in e)||("width_interpolation_mode"in e))}function pdt(e){let t=[];for(let n=0;n<e.length-1;n++){let o=e[n];if(!WGn(o))continue;let r=e[n+1];if(!r)continue;let i=r.route_type==="through_pad"?r.start:{x:r.x,y:r.y},s=r.route_type==="via"?r.from_layer:r.route_type==="through_pad"?r.start_layer:r.layer;if(!i||s!==o.layer||o.width!==o.start_width)continue;let a={start:{x:o.x,y:o.y},end:i,start_width:o.start_width,end_width:o.end_width,width_interpolation_mode:o.width_interpolation_mode,layer:o.layer,is_inside_copper_pour:Boolean(o.is_inside_copper_pour&&r.is_inside_copper_pour)};if(jGn(a))t.push(a)}return t}function XGn(e){let{start:t,end:n,start_width:o,end_width:r}=e,i=n.x-t.x,s=n.y-t.y,a=Math.hypot(i,s);if(!jGn(e))return[];let c=Math.abs(r-o),l=e.width_interpolation_mode==="linear"?1:Math.max(1,Math.ceil(Math.sqrt(c/(0.001+c*0.000001)*0.375))),h=-s/a,d=i/a,u=[],_=[];for(let p=0;p<=l;p++){let m=p/l,A=o<=r?m:1-m,f=(e.width_interpolation_mode==="quadratic"?Math.min(o,r)+c*A*A:o+(r-o)*m)/2,y=t.x+i*m,x=t.y+s*m;u.push({x:y+h*f,y:x+d*f}),_.push({x:y-h*f,y:x-d*f})}return[...u,..._.reverse()]}function jGn(e){let{start:t,end:n,start_width:o,end_width:r}=e,i=Math.hypot(n.x-t.x,n.y-t.y);if(![t.x,t.y,n.x,n.y,i,o,r].every(Number.isFinite)||i<=0||o<=0||r<=0)return!1;if(e.width_interpolation_mode!=="linear"&&e.width_interpolation_mode!=="quadratic")return!1;return!0}function Tee(e,t){let n=Math.hypot(e,t);if(n<=Number.EPSILON)return{x:0,y:0};return{x:e/n,y:t/n}}function fMi(e,t){let n=e.length;if(n<2)return{x:1,y:0};if(t<=0){let l=e[1],h=e[0];if(!l||!h)return{x:1,y:0};let d=Tee(l.x-h.x,l.y-h.y);return d.x===0&&d.y===0?{x:1,y:0}:d}if(t>=n-1){let l=e[n-2],h=e[n-1];if(!l||!h)return{x:1,y:0};let d=Tee(h.x-l.x,h.y-l.y);return d.x===0&&d.y===0?{x:1,y:0}:d}let o=e[t-1],r=e[t],i=e[t+1];if(!o||!r||!i)return{x:1,y:0};let s=Tee(r.x-o.x,r.y-o.y),a=Tee(i.x-r.x,i.y-r.y),c=Tee(s.x+a.x,s.y+a.y);if(c.x===0&&c.y===0){if(s.x!==0||s.y!==0)return s;if(a.x!==0||a.y!==0)return a;return{x:1,y:0}}return c}function KGn(e){let t=[],n=[];for(let o=0;o<e.length;o++){let r=e[o];if(!r)continue;let i=fMi(e,o),s=Tee(-i.y,i.x),a=r.width/2;t.push({x:r.x+s.x*a,y:r.y+s.y*a}),n.push({x:r.x-s.x*a,y:r.y-s.y*a})}return t.concat(n.reverse())}function mdt(e){let t=[],n=[],o=null;for(let r of e??[]){if(!r||r.route_type!=="wire"){if(n.length>=2)t.push(n);n=[],o=null;continue}let i=r.layer??o;if(!i)continue;let{x:s,y:a}=r;if(typeof s!=="number"||typeof a!=="number")continue;if(typeof r.width!=="number")continue;let c=r.width;if(o&&i!==o){if(n.length>=2)t.push(n);n=[]}if(o=i,n.push(r),WGn(r)){if(n.length>=2)t.push(n);n=[],o=null}}if(n.length>=2)t.push(n);return t}var MGn=0.000001;function $Gn(e){let{ctx:t,trace:n,realToCanvasMat:o,vias:r,platedHoles:i,layer:s}=e;if(!n.route||n.route.length===0)return;let a=mdt(n.route);for(let l of pdt(n.route))for(let h of[l.start,l.end])a.push([{route_type:"wire",...h,layer:l.layer,width:l.end_width}]);if(a.length===0)return;let c=new Map;for(let l of a){let h=l[0]?.layer,d=l[l.length-1];if(!h||!d)continue;if(s&&h!==s)continue;for(let u of r){if(u.layers&&Array.isArray(u.layers)&&!u.layers.includes(h))continue;if(!wGn(d.x,d.y,u.x,u.y))continue;let _=u.hole_diameter/2;if(_<=0)continue;let p={shape:"circle",x:u.x,y:u.y,radius:_};c.set(BGn(p),p)}for(let u of i){if(u.layers&&Array.isArray(u.layers)&&!u.layers.includes(h))continue;let _=yMi(u);if(!_)continue;if(!wGn(d.x,d.y,_.x,_.y))continue;c.set(BGn(_),_)}}if(c.size===0)return;t.save(),t.globalCompositeOperation="destination-out";for(let l of c.values()){if(l.shape==="circle"){Em({ctx:t,center:{x:l.x,y:l.y},radius:l.radius,fill:"#000",realToCanvasMat:o});continue}if(l.shape==="oval"){G9({ctx:t,center:{x:l.x,y:l.y},radius_x:l.radiusX,radius_y:l.radiusY,fill:"#000",realToCanvasMat:o,rotation:l.rotation});continue}A_({ctx:t,center:{x:l.x,y:l.y},width:l.width,height:l.height,fill:"#000",realToCanvasMat:o,rotation:l.rotation})}t.restore()}function yMi(e){if(e.shape==="circle"){let r=e.hole_diameter/2;if(r<=0)return;return{shape:"circle",x:e.x,y:e.y,radius:r}}if(e.shape==="oval"){let r=e.hole_width/2,i=e.hole_height/2;if(r<=0||i<=0)return;return{shape:"oval",x:e.x,y:e.y,radiusX:r,radiusY:i,rotation:e.ccw_rotation}}if(e.shape==="pill"){if(e.hole_width<=0||e.hole_height<=0)return;return{shape:"pill",x:e.x,y:e.y,width:e.hole_width,height:e.hole_height,rotation:e.ccw_rotation}}if(e.shape==="circular_hole_with_rect_pad"){let r=e.hole_diameter/2;if(r<=0)return;return{shape:"circle",x:e.x+(e.hole_offset_x??0),y:e.y+(e.hole_offset_y??0),radius:r}}if(e.shape==="pill_hole_with_rect_pad"){if(e.hole_width<=0||e.hole_height<=0)return;return{shape:"pill",x:e.x+(e.hole_offset_x??0),y:e.y+(e.hole_offset_y??0),width:e.hole_width,height:e.hole_height}}if(e.shape==="rotated_pill_hole_with_rect_pad"){if(e.hole_width<=0||e.hole_height<=0)return;return{shape:"pill",x:e.x+(e.hole_offset_x??0),y:e.y+(e.hole_offset_y??0),width:e.hole_width,height:e.hole_height,rotation:e.hole_ccw_rotation}}if(e.shape!=="hole_with_polygon_pad")return;let t=e.x+(e.hole_offset_x??0),n=e.y+(e.hole_offset_y??0),o=e.hole_shape;if(o==="circle"){let r=(e.hole_diameter??0)/2;if(r<=0)return;return{shape:"circle",x:t,y:n,radius:r}}if(o==="oval"){let r=(e.hole_width??0)/2,i=(e.hole_height??0)/2;if(r<=0||i<=0)return;return{shape:"oval",x:t,y:n,radiusX:r,radiusY:i}}if(o==="pill"||o==="rotated_pill"){let r=e.hole_width??0,i=e.hole_height??0;if(r<=0||i<=0)return;return{shape:"pill",x:t,y:n,width:r,height:i,rotation:o==="rotated_pill"?e.ccw_rotation:0}}}function wGn(e,t,n,o){return Math.abs(e-n)<=MGn&&Math.abs(t-o)<=MGn}function BGn(e){if(e.shape==="circle")return`circle:${e.x}:${e.y}:${e.radius}`;if(e.shape==="oval")return`oval:${e.x}:${e.y}:${e.radiusX}:${e.radiusY}:${e.rotation??0}`;return`pill:${e.x}:${e.y}:${e.width}:${e.height}:${e.rotation??0}`}function xMi(e){let{ctx:t,trace:n,realToCanvasMat:o,soldermaskOverCopperColor:r,layer:i}=e;if(!n.route||!Array.isArray(n.route)||n.route.length===0)return;for(let a of pdt(n.route)){if(i&&a.layer!==i)continue;if(a.is_inside_copper_pour)continue;_P({ctx:t,points:XGn(a),fill:r,realToCanvasMat:o})}let s=mdt(n.route);for(let a of s){if(a[0]?.layer!==i)continue;if(n.route_thickness_mode==="interpolated"){_P({ctx:t,points:KGn(a),fill:r,realToCanvasMat:o});continue}for(let l=0;l<a.length-1;l++){let h=a[l],d=a[l+1];if(!h||!d)continue;Y0e({ctx:t,start:{x:h.x,y:h.y},end:{x:d.x,y:d.y},strokeWidth:h.width,stroke:r,realToCanvasMat:o,lineCap:"round"})}}$Gn({ctx:t,trace:n,realToCanvasMat:o,layer:i,vias:e.vias,platedHoles:e.platedHoles})}function qGn(e){let{ctx:t,via:n,realToCanvasMat:o,layer:r,soldermaskOverCopperColor:i,soldermaskOverHoleColor:s}=e;if(!n.layers.includes(r))return;let a=_dt(n,r,t),[c,l]=Jn(o,[n.x,n.y]),h=n.outer_diameter/2*Math.abs(o.a);if(t.beginPath(),t.arc(c,l,h,0,Math.PI*2),t.closePath(),a){let d=n.hole_diameter/2*Math.abs(o.a);t.moveTo(c+d,l),t.arc(c,l,d,0,Math.PI*2),t.closePath(),t.fillStyle=i,t.fill("evenodd"),t.fillStyle=s,t.beginPath(),t.arc(c,l,d,0,Math.PI*2),t.fill()}else d3(t)}function _dt(e,t,n){let o=n.boardOwnerMap?.get(e.pcb_via_id);if(!n.boardOwnerMap?.has(e.pcb_via_id)&&e.pcb_trace_id)o=n.boardOwnerMap?.get(e.pcb_trace_id);let r=e,i=t==="top"?r.tented_on_top:r.tented_on_bottom,s=t==="top"?o?.default_via_tented_on_top:o?.default_via_tented_on_bottom;return i??r.is_tented??s??!1}function TGn(e){let{ctx:t,realToCanvasMat:n,colorMap:o,layer:r,drawSoldermask:i}=e,{elements:s}=e;if(!i)return;if(t.canvas.width<=0||t.canvas.height<=0)return;let a=s.filter((m)=>m.type==="pcb_board"),c=s.find((m)=>m.type==="pcb_panel");if(a.length===0&&!c)s=s.filter((m)=>m.type==="pcb_via");let l=o.soldermask[r]??o.soldermask.top,h=o.soldermaskOverCopper[r]??o.soldermaskOverCopper.top,d=o.soldermaskOverHole[r]??o.soldermaskOverHole.top,u=s.filter((m)=>m.type==="pcb_via"),_=s.filter((m)=>m.type==="pcb_plated_hole"),p=YGn(t,t.canvas.width,t.canvas.height)??t;if(c)iMi({ctx:p,panel:c,realToCanvasMat:n,soldermaskColor:l});if(c&&a.length>0){p.save(),p.globalCompositeOperation="destination-out";for(let m of a)PGn({ctx:p,board:m,realToCanvasMat:n,soldermaskColor:"#000"});p.restore()}for(let m of a)PGn({ctx:p,board:m,realToCanvasMat:n,soldermaskColor:l});for(let m of s)if(m.type==="pcb_trace")xMi({ctx:p,trace:m,realToCanvasMat:n,soldermaskOverCopperColor:h,layer:r,vias:u,platedHoles:_});else if(m.type==="pcb_copper_pour")dMi({ctx:p,pour:m,realToCanvasMat:n,soldermaskOverCopperColor:h,layer:r,elements:s});for(let m of u){if(!_dt(m,r,p))continue;qGn({ctx:p,via:m,realToCanvasMat:n,layer:r,soldermaskOverCopperColor:h,soldermaskOverHoleColor:d})}for(let m of s)CMi({ctx:p,element:m,realToCanvasMat:n,soldermaskOverCopperColor:h,soldermaskOverHoleColor:d,layer:r});GGn(t,p)}function CMi(e){let{ctx:t,element:n,realToCanvasMat:o,soldermaskOverCopperColor:r,soldermaskOverHoleColor:i,layer:s}=e;if(n.type==="pcb_smtpad")gMi({ctx:t,pad:n,realToCanvasMat:o,soldermaskOverCopperColor:r,layer:s});else if(n.type==="pcb_plated_hole")mMi({ctx:t,hole:n,realToCanvasMat:o,soldermaskOverCopperColor:r,layer:s});else if(n.type==="pcb_hole")uMi({ctx:t,hole:n,realToCanvasMat:o,soldermaskOverCopperColor:r});else if(n.type==="pcb_via"){if(_dt(n,s,t))return;qGn({ctx:t,via:n,realToCanvasMat:o,layer:s,soldermaskOverCopperColor:r,soldermaskOverHoleColor:i})}else if(n.type==="pcb_cutout")sMi({ctx:t,cutout:n,realToCanvasMat:o});else if(n.type==="pcb_copper_pour")return;else if(n.type==="pcb_trace")return}function DGn(e,t){return t.copper[e]??t.copper.top}function bMi(e){let{ctx:t,trace:n,realToCanvasMat:o,colorMap:r,layer:i}=e;if(!n.route||!Array.isArray(n.route)||n.route.length===0)return;for(let a of pdt(n.route)){if(i&&a.layer!==i)continue;if(a.is_inside_copper_pour)continue;_P({ctx:t,points:XGn(a),fill:DGn(a.layer,r),realToCanvasMat:o})}let s=mdt(n.route);for(let a of s){let c=a[0]?.layer;if(!c)continue;if(i&&c!==i)continue;let l=DGn(c,r);if(n.route_thickness_mode==="interpolated"){_P({ctx:t,points:KGn(a),fill:l,realToCanvasMat:o});continue}for(let h=0;h<a.length-1;h++){let d=a[h],u=a[h+1];if(!d||!u)continue;if(d.is_inside_copper_pour&&u.is_inside_copper_pour)continue;Y0e({ctx:t,start:{x:d.x,y:d.y},end:{x:u.x,y:u.y},strokeWidth:d.width,stroke:l,realToCanvasMat:o,lineCap:"round"})}}$Gn({ctx:t,trace:n,realToCanvasMat:o,vias:e.vias??[],platedHoles:e.platedHoles??[],layer:i})}function NGn(e){let{ctx:t,traces:n,copperPours:o,realToCanvasMat:r,colorMap:i,vias:s,platedHoles:a,renderLayers:c}=e;for(let l of vMi(n,c)){let h=o.filter((u)=>u.layer===l);if(h.length===0){ldt({ctx:t,traces:n,layer:l,realToCanvasMat:r,colorMap:i,vias:s,platedHoles:a});continue}let d=YGn(t,t.canvas.width,t.canvas.height);if(d){if(ldt({ctx:d,traces:n,layer:l,realToCanvasMat:r,colorMap:i,vias:s,platedHoles:a}),IMi({ctx:d,copperPours:h,realToCanvasMat:r}),GGn(t,d))continue}t.save(),SMi({ctx:t,copperPours:h,realToCanvasMat:r}),ldt({ctx:t,traces:n,layer:l,realToCanvasMat:r,colorMap:i,vias:s,platedHoles:a}),t.restore()}}function ldt(e){let{ctx:t,traces:n,layer:o,realToCanvasMat:r,colorMap:i,vias:s,platedHoles:a}=e;for(let c of n)bMi({ctx:t,trace:c,realToCanvasMat:r,colorMap:i,vias:s,platedHoles:a,layer:o})}function IMi(e){let{ctx:t,copperPours:n,realToCanvasMat:o}=e;if(n.length===0)return;t.save(),t.globalCompositeOperation="destination-out",t.fillStyle="#000";for(let r of n)t.beginPath(),hdt({ctx:t,pour:r,realToCanvasMat:o}),t.fill(r.shape==="brep"?"evenodd":"nonzero");t.restore()}function vMi(e,t){let n=new Set;for(let o of e)for(let r of o.route??[]){if(r.route_type!=="wire"||!r.layer)continue;if(t?.length&&!t.includes(`${r.layer}_copper`))continue;n.add(r.layer)}return[...n]}function SMi(e){let{ctx:t,copperPours:n,realToCanvasMat:o}=e;if(n.length===0)return;t.beginPath(),t.rect(0,0,t.canvas.width,t.canvas.height);for(let r of n)hdt({ctx:t,pour:r,realToCanvasMat:o});t.clip("evenodd")}function PMi(e,t,n=[]){let o=[...e,...n].filter((a)=>a.type==="pcb_via"),r=new Map;for(let a of o){let l=`${t.boardOwnerMap?.get(a.pcb_via_id)?.pcb_board_id??""}:${a.x}:${a.y}`,h=r.get(l)??[];h.push(a),r.set(l,h)}let i=e.filter((a)=>a.type==="pcb_trace"),s=[];for(let a of i){let c=t.boardOwnerMap?.get(a.pcb_trace_id);for(let[l,h]of a.route.entries()){if(h.route_type!=="via")continue;let d=`${c?.pcb_board_id??""}:${h.x}:${h.y}`,u=r.get(d)??[];if(u.some((m)=>m.layers.includes(h.from_layer)&&m.layers.includes(h.to_layer)))continue;let p={type:"pcb_via",pcb_via_id:`${a.pcb_trace_id}_route_via_${l}`,pcb_trace_id:a.pcb_trace_id,subcircuit_id:a.subcircuit_id,pcb_group_id:a.pcb_group_id,x:h.x,y:h.y,layers:[h.from_layer,h.to_layer],hole_diameter:h.hole_diameter??c?.min_via_hole_diameter??0.25,outer_diameter:h.outer_diameter??c?.min_via_pad_diameter??0.6,tented_on_top:h.tented_on_top,tented_on_bottom:h.tented_on_bottom};s.push(p),u.push(p),r.set(d,u)}}return s}function RGn(e){let{ctx:t,via:n,realToCanvasMat:o,colorMap:r,layer:i}=e;Em({ctx:t,center:{x:n.x,y:n.y},radius:n.outer_diameter/2,fill:r.copper[i??"top"],realToCanvasMat:o}),t.save(),t.globalCompositeOperation="destination-out",Em({ctx:t,center:{x:n.x,y:n.y},radius:n.hole_diameter/2,fill:"#000",realToCanvasMat:o}),t.restore(),Em({ctx:t,center:{x:n.x,y:n.y},radius:n.hole_diameter/2,fill:r.drill,realToCanvasMat:o})}function l5(e,t){if(!t.layers||t.layers.length===0)return!0;if(e.type==="pcb_silkscreen_graphic")return t.layers.some((o)=>o===`${e.layer}_silkscreen`);let n=GAe(e);if(n.length===0)return!0;return n.some((o)=>t.layers.includes(o))}var Au={copper:{top:"rgb(200, 52, 52)",inner1:"rgb(127, 200, 127)",inner2:"rgb(206, 125, 44)",inner3:"rgb(79, 203, 203)",inner4:"rgb(219, 98, 139)",inner5:"rgb(167, 165, 198)",inner6:"rgb(40, 204, 217)",inner7:"rgb(232, 178, 167)",inner8:"rgb(242, 237, 161)",bottom:"rgb(77, 127, 196)"},copperPour:{top:"rgb(230, 95, 95)",bottom:"rgb(122, 162, 222)"},soldermaskWithCopperUnderneath:{top:"rgb(18, 82, 50)",bottom:"rgb(77, 127, 196)"},soldermask:{top:"rgb(12, 55, 33)",bottom:"rgb(12, 55, 33)"},soldermaskOverCopper:{top:"rgb(52, 135, 73)",bottom:"rgb(52, 135, 73)"},soldermaskOverHole:{top:"rgb(26, 68, 37)",bottom:"rgb(26, 68, 37)"},substrate:"rgb(201, 162, 110)",drill:"#FF26E2",silkscreen:{top:"#f2eda1",bottom:"#5da9e9"},boardOutline:"rgba(255, 255, 255, 0.5)",courtyard:{top:"#FF00FF",bottom:"rgb(38, 233, 255)"},keepout:{top:"#FF6B6B",bottom:"#5da9e9"},fabricationNote:"rgba(255, 255, 255, 0.5)"};function EMi(e){if(!e||e.length===0)return"top";return(e.find((n)=>n.endsWith("_copper"))??e[0]??"top_copper").split("_")[0]}var Bee=(e,t)=>e.layers?.includes(t)??!0,ai=class e{ctx;colorMap;realToCanvasMat;constructor(t){if("getContext"in t&&typeof t.getContext==="function"){let n=t.getContext("2d");if(!n)throw Error("Failed to get 2D rendering context from canvas");this.ctx=n}else this.ctx=t;this.colorMap={...Au},this.realToCanvasMat=mGn()}configure(t){if(t.colorOverrides)this.colorMap={...this.colorMap,...t.colorOverrides,copper:{...this.colorMap.copper,...t.colorOverrides.copper},copperPour:{...this.colorMap.copperPour,...t.colorOverrides.copperPour},silkscreen:{...this.colorMap.silkscreen,...t.colorOverrides.silkscreen},soldermask:{...this.colorMap.soldermask,...t.colorOverrides.soldermask},soldermaskWithCopperUnderneath:{...this.colorMap.soldermaskWithCopperUnderneath,...t.colorOverrides.soldermaskWithCopperUnderneath},soldermaskOverCopper:{...this.colorMap.soldermaskOverCopper,...t.colorOverrides.soldermaskOverCopper},soldermaskOverHole:{...this.colorMap.soldermaskOverHole,...t.colorOverrides.soldermaskOverHole}}}setCameraBounds(t){let n=this.ctx.canvas,{width:o,height:r}=n,i=t.maxX-t.minX,s=t.maxY-t.minY,a=o/i,c=r/s,l=Math.min(a,c),h=(o-i*l)/2,d=(r-s*l)/2;this.realToCanvasMat=sL(Ny(h,d),O0e(l,-l),Ny(-t.minX,-t.maxY))}drawElements(t,n={}){this.ctx.boardOwnerMap=FAe([...n.clipContextElements??[],...t]),t=[...t,...PMi(t,this.ctx,n.clipContextElements)];let o=EMi(n.layers),r=t.find((b)=>b.type==="pcb_board"),i=t.find((b)=>b.type==="pcb_panel");if(i)HEi({ctx:this.ctx,panel:i,realToCanvasMat:this.realToCanvasMat,colorMap:this.colorMap,drawBoardMaterial:!1});let s=n.drawBoardMaterial??!1,a=n.drawSoldermask??!1,c=n.drawSolderPaste??!1,l=n.drawSoldermaskTop!==void 0||n.drawSoldermaskBottom!==void 0,h=n.drawSolderPasteTop!==void 0||n.drawSolderPasteBottom!==void 0,d=a&&(n.drawSoldermaskTop??!l),u=a&&(n.drawSoldermaskBottom??!1),_=c&&(n.drawSolderPasteTop??!h)&&t.some((b)=>b.type==="pcb_solder_paste"&&b.layer==="top"),p=c&&(n.drawSolderPasteBottom??!1)&&t.some((b)=>b.type==="pcb_solder_paste"&&b.layer==="bottom"),m=d||_,A=t.filter((b)=>l5(b,n)&&b.type==="pcb_via"&&Bee(b,o)),g=t.filter((b)=>l5(b,n)&&b.type==="pcb_hole"),f=t.filter((b)=>l5(b,n)&&b.type==="pcb_plated_hole"&&Bee(b,o)),y=t.filter((b)=>l5(b,n)&&b.type==="pcb_cutout"),x=(n.clipContextElements??t).filter((b)=>l5(b,n)&&b.type==="pcb_copper_pour"),C=t.filter((b)=>l5(b,n)&&b.type==="pcb_trace");if(r)MPi({ctx:this.ctx,board:r,realToCanvasMat:this.realToCanvasMat,colorMap:this.colorMap,drawBoardMaterial:s,minBoardOutlineStrokePx:n.minBoardOutlineStrokePx});for(let b of t){if(!l5(b,n))continue;if(b.type==="pcb_copper_pour")ddt({ctx:this.ctx,pour:b,realToCanvasMat:this.realToCanvasMat,colorMap:this.colorMap})}for(let b of t){if(!l5(b,n))continue;if(b.type==="pcb_smtpad")nMi({ctx:this.ctx,pad:b,realToCanvasMat:this.realToCanvasMat,colorMap:this.colorMap,holes:g,platedHoles:f,vias:A,cutouts:y});if(b.type==="pcb_copper_text")$Pi({ctx:this.ctx,text:b,realToCanvasMat:this.realToCanvasMat,colorMap:this.colorMap})}if(m){NGn({ctx:this.ctx,traces:C,copperPours:x,realToCanvasMat:this.realToCanvasMat,colorMap:this.colorMap,vias:A,platedHoles:f,renderLayers:n.layers});for(let b of t){if(!l5(b,n))continue;if(b.type==="pcb_hole")AGn({ctx:this.ctx,hole:b,realToCanvasMat:this.realToCanvasMat,colorMap:this.colorMap,soldermaskMargin:d?b.soldermask_margin:void 0,drawSoldermask:d});if(b.type==="pcb_plated_hole"&&Bee(b,o))IGn({ctx:this.ctx,hole:b,realToCanvasMat:this.realToCanvasMat,colorMap:this.colorMap,soldermaskMargin:d?b.soldermask_margin:void 0,drawSoldermask:d,layer:o});if(b.type==="pcb_via"&&Bee(b,o))RGn({ctx:this.ctx,via:b,realToCanvasMat:this.realToCanvasMat,colorMap:this.colorMap,layer:o})}}if(d)TGn({ctx:this.ctx,elements:t,realToCanvasMat:this.realToCanvasMat,colorMap:this.colorMap,layer:"top",drawSoldermask:!0});if(_)for(let b of t){if(b.type!=="pcb_solder_paste"||b.layer!=="top")continue;SGn({ctx:this.ctx,solderPaste:b,realToCanvasMat:this.realToCanvasMat})}for(let b of t){if(!l5(b,n))continue;if(b.type==="pcb_silkscreen_text")eMi({ctx:this.ctx,text:b,realToCanvasMat:this.realToCanvasMat,colorMap:this.colorMap});if(b.type==="pcb_silkscreen_rect")qEi({ctx:this.ctx,rect:b,realToCanvasMat:this.realToCanvasMat,colorMap:this.colorMap});if(b.type==="pcb_silkscreen_circle")zEi({ctx:this.ctx,circle:b,realToCanvasMat:this.realToCanvasMat,colorMap:this.colorMap});if(b.type==="pcb_silkscreen_line")YEi({ctx:this.ctx,line:b,realToCanvasMat:this.realToCanvasMat,colorMap:this.colorMap});if(b.type==="pcb_silkscreen_path")XEi({ctx:this.ctx,path:b,realToCanvasMat:this.realToCanvasMat,colorMap:this.colorMap});if(b.type==="pcb_silkscreen_pill")KEi({ctx:this.ctx,pill:b,realToCanvasMat:this.realToCanvasMat,colorMap:this.colorMap});if(b.type==="pcb_silkscreen_oval")UEi({ctx:this.ctx,oval:b,realToCanvasMat:this.realToCanvasMat,colorMap:this.colorMap});if(b.type==="pcb_silkscreen_graphic")OEi({ctx:this.ctx,graphic:b,realToCanvasMat:this.realToCanvasMat,colorMap:this.colorMap})}if(!m)NGn({ctx:this.ctx,traces:C,copperPours:x,realToCanvasMat:this.realToCanvasMat,colorMap:this.colorMap,vias:A,platedHoles:f,renderLayers:n.layers});for(let b of t){if(!l5(b,n))continue;if(b.type==="pcb_hole"&&!m)AGn({ctx:this.ctx,hole:b,realToCanvasMat:this.realToCanvasMat,colorMap:this.colorMap,soldermaskMargin:d?b.soldermask_margin:void 0,drawSoldermask:d})}for(let b of t){if(!l5(b,n))continue;if(b.type==="pcb_plated_hole"&&!m&&Bee(b,o))IGn({ctx:this.ctx,hole:b,realToCanvasMat:this.realToCanvasMat,colorMap:this.colorMap,soldermaskMargin:d?b.soldermask_margin:void 0,drawSoldermask:d,layer:o});if(b.type==="pcb_via"&&!m&&Bee(b,o))RGn({ctx:this.ctx,via:b,realToCanvasMat:this.realToCanvasMat,colorMap:this.colorMap,layer:o})}if(u)TGn({ctx:this.ctx,elements:t,realToCanvasMat:this.realToCanvasMat,colorMap:this.colorMap,layer:"bottom",drawSoldermask:!0});if(p)for(let b of t){if(b.type!=="pcb_solder_paste"||b.layer!=="bottom")continue;SGn({ctx:this.ctx,solderPaste:b,realToCanvasMat:this.realToCanvasMat})}for(let b of t){if(!l5(b,n))continue;if(b.type==="pcb_cutout")oEi({ctx:this.ctx,cutout:b,realToCanvasMat:this.realToCanvasMat,colorMap:this.colorMap})}for(let b of t){if(!l5(b,n))continue;if(b.type==="pcb_keepout")BEi({ctx:this.ctx,keepout:b,realToCanvasMat:this.realToCanvasMat,colorMap:this.colorMap});if(b.type==="pcb_fabrication_note_text")mEi({ctx:this.ctx,text:b,realToCanvasMat:this.realToCanvasMat,colorMap:this.colorMap});if(b.type==="pcb_fabrication_note_rect")uEi({ctx:this.ctx,rect:b,realToCanvasMat:this.realToCanvasMat,colorMap:this.colorMap});let I=n.showPcbNotes??!0;if(I&&b.type==="pcb_note_rect")QEi({realToCanvasMat:this.realToCanvasMat,colorMap:this.colorMap,ctx:this.ctx,rect:b});if(b.type==="pcb_fabrication_note_path")dEi({ctx:this.ctx,path:b,realToCanvasMat:this.realToCanvasMat,colorMap:this.colorMap});if(I&&b.type==="pcb_note_path")REi({ctx:this.ctx,path:b,realToCanvasMat:this.realToCanvasMat,colorMap:this.colorMap});if(I&&b.type==="pcb_note_text")LEi({ctx:this.ctx,text:b,realToCanvasMat:this.realToCanvasMat,colorMap:this.colorMap});if(I&&b.type==="pcb_note_line")NEi({ctx:this.ctx,line:b,realToCanvasMat:this.realToCanvasMat,colorMap:this.colorMap});if(I&&b.type==="pcb_note_dimension")DEi({ctx:this.ctx,pcbNoteDimension:b,realToCanvasMat:this.realToCanvasMat,colorMap:this.colorMap});if(b.type==="pcb_fabrication_note_dimension")hEi({ctx:this.ctx,pcbFabricationNoteDimension:b,realToCanvasMat:this.realToCanvasMat,colorMap:this.colorMap});if(b.type==="pcb_courtyard_circle")JPi({ctx:this.ctx,circle:b,realToCanvasMat:this.realToCanvasMat,colorMap:this.colorMap});if(b.type==="pcb_courtyard_rect")nEi({ctx:this.ctx,rect:b,realToCanvasMat:this.realToCanvasMat,colorMap:this.colorMap});if(b.type==="pcb_courtyard_outline")eEi({ctx:this.ctx,outline:b,realToCanvasMat:this.realToCanvasMat,colorMap:this.colorMap})}if(n.clearDrillHoles)this.clearDrillHoles(t,o);if(n.showDebugObjects){let b=new Map;for(let I of t){if(I.type!=="pcb_debug_object")continue;let v=I.shape==="rect"?`${I.center.x}:${I.center.y}:${I.size.width}:${I.size.height}`:void 0,P=v?b.get(v)??0:0;if(sEi({ctx:this.ctx,debugObject:I,realToCanvasMat:this.realToCanvasMat,labelStackIndex:P}),v)b.set(v,P+1)}}}clearDrillHoles(t,n){let o=t.filter((a)=>a.type==="pcb_hole"||a.type==="pcb_plated_hole"||a.type==="pcb_via"||a.type==="pcb_cutout");if(o.length===0)return;let r="rgba(0,0,0,0)",i=new e(this.ctx);i.realToCanvasMat=this.realToCanvasMat,i.configure({colorOverrides:{copper:{top:r,bottom:r,inner1:r,inner2:r,inner3:r,inner4:r,inner5:r,inner6:r,inner7:r,inner8:r},drill:"#000"}}),this.ctx.save(),this.ctx.globalCompositeOperation="destination-out";let s=this.ctx.boardOwnerMap;i.drawElements(o,{layers:[`${n}_copper`],showPcbNotes:!1}),this.ctx.boardOwnerMap=s,this.ctx.restore()}};Ko();Ko();Ko();var uqn=Qe(rn(),1),vG=Qe(rn(),1);var _qn=Qe(so(),1);Ie();Ie();Ie();Ie();var W0e=un([he(2),he(3),he(3.5),he(4),he(5),he(5.5),he(6),he(8)]),JGn=Pt(["male","female"]);function ZGn({diameter:e,gender:t,pinCount:n=1,pitch:o=e+2}){let r=e*2,i=e+(t==="female"?1:0.6);return{kind:t==="male"?"bullet_male":"bullet_female",diameter:e,contactDepth:r,pinCount:n,pitch:o,bodyWidth:i+(n-1)*o,bodyHeight:i,bodyDepth:r+e*1.5}}var MMi=Pt(["usb_c","jst_sh","jst_ph","us_mains","bullet","adaptercable"]),u3=Ae().finite().positive(),eUn=k().regex(/^#[0-9a-fA-F]{6}$/),mG={bodyWidth:u3,bodyHeight:u3,bodyDepth:u3},EPe=ss("kind",[we({kind:he("bullet_male"),...mG,diameter:W0e,pinCount:Ae().int().min(1).max(16).default(1),pitch:u3,contactDepth:u3}).strict(),we({kind:he("bullet_female"),...mG,diameter:W0e,pinCount:Ae().int().min(1).max(16).default(1),pitch:u3,contactDepth:u3}).strict(),we({kind:he("usb_c_plug"),...mG,shellWidth:u3,shellHeight:u3,shellDepth:u3}).strict(),we({kind:he("jst_sh_housing"),...mG,pinCount:Ae().int().min(2).max(15),pitch:he(1)}).strict(),we({kind:he("jst_ph_housing"),...mG,pinCount:Ae().int().min(2).max(16),pitch:he(2)}).strict(),we({kind:he("nema_5_15p"),...mG}).strict(),we({kind:he("iec_c13"),...mG}).strict()]),oUn=ss("kind",[we({kind:he("round_jacket"),diameter:u3,color:eUn}).strict(),we({kind:he("wire_bundle"),wires:it(we({diameter:u3,color:eUn}).strict()).min(2),wirePitch:u3}).strict()]),U0e=we({standard:MMi,connectorA:EPe,connectorB:EPe,crossSection:oUn}).strict().superRefine((e,t)=>{let{connectorA:n,connectorB:o,crossSection:r}=e,i={usb_c:["usb_c_plug","usb_c_plug"],jst_sh:["jst_sh_housing","jst_sh_housing"],jst_ph:["jst_ph_housing","jst_ph_housing"],us_mains:["nema_5_15p","iec_c13"],bullet:[n.kind,o.kind],adaptercable:[n.kind,o.kind]}[e.standard];if(n.kind!==i[0]||o.kind!==i[1])t.addIssue({code:Vt.custom,message:"Connector kinds must match the cable standard"});if(e.standard==="bullet"){if(!("diameter"in n)||!("diameter"in o)||n.diameter!==o.diameter||"pinCount"in n&&"pinCount"in o&&n.pinCount!==o.pinCount)t.addIssue({code:Vt.custom,message:"Bullet connectors require supported nominal diameters and matching contact counts"});if("pinCount"in n&&(n.pinCount===1&&r.kind!=="round_jacket"||n.pinCount>1&&r.kind!=="wire_bundle"))t.addIssue({code:Vt.custom,message:"Bullet cables require one insulated wire per contact"});for(let s of[n,o])if("diameter"in s&&(s.bodyHeight<=s.diameter||s.pitch<s.bodyHeight||Math.abs(s.bodyWidth-(s.bodyHeight+(s.pinCount-1)*s.pitch))>0.000001||r.kind==="wire_bundle"&&(r.wirePitch!==s.pitch||r.wires.some((a)=>a.diameter>s.bodyHeight))||s.contactDepth>=s.bodyDepth||r.kind==="round_jacket"&&r.diameter>s.bodyHeight))t.addIssue({code:Vt.custom,message:"Bullet contact, body, and wire dimensions must fit"})}else if(e.standard!=="adaptercable"&&(("diameter"in n)||("diameter"in o)))t.addIssue({code:Vt.custom,message:"Bullet connectors require the bullet cable standard"});if(e.standard==="adaptercable"){if("pinCount"in n&&"pinCount"in o&&n.pinCount!==o.pinCount)t.addIssue({code:Vt.custom,message:"Adapter connector pin counts must match"});if("pinCount"in n&&"pinCount"in o&&n.pinCount>1&&r.kind!=="wire_bundle")t.addIssue({code:Vt.custom,message:"Adapter cables require one wire per explicit contact"});for(let s of[n,o])if("diameter"in s&&(s.bodyHeight<=s.diameter||s.pitch<s.bodyHeight||Math.abs(s.bodyWidth-(s.bodyHeight+(s.pinCount-1)*s.pitch))>0.000001||s.contactDepth>=s.bodyDepth||s.pinCount===1&&(r.kind!=="round_jacket"||r.diameter>s.bodyHeight)||s.pinCount>1&&(r.kind!=="wire_bundle"||r.wires.some((a)=>a.diameter>s.bodyHeight))))t.addIssue({code:Vt.custom,message:"Bullet contact, body, and wire dimensions must fit"})}if(r.kind==="wire_bundle"){for(let s of[n,o]){if(!("pinCount"in s)||s.pinCount!==r.wires.length)t.addIssue({code:Vt.custom,message:"Bundle wire count must match each connector pin count"});if("pitch"in s&&r.wires.some((a)=>a.diameter>s.pitch))t.addIssue({code:Vt.custom,message:"Insulated wires must fit each connector pitch"})}if(r.wires.some((s)=>s.diameter>r.wirePitch))t.addIssue({code:Vt.custom,message:"Bundle wires must not overlap in the cross section"})}else if(e.standard==="jst_sh"||e.standard==="jst_ph")t.addIssue({code:Vt.custom,message:"JST cables require a wire bundle"})}),rUn=we({standard:he("adaptercable"),connectorA:EPe,connectorB:EPe,crossSection:oUn.optional()}).strict(),iUn=k().regex(/^#[0-9a-fA-F]{6}$/),gdt={jacketDiameter:Ae().finite().positive().default(4),color:iUn.default("#263449")},wMi=ss("standard",[we({standard:he("bullet"),diameter:W0e,pinCount:Ae().int().min(1).max(16).default(1),genderA:JGn.default("male"),genderB:JGn.default("female"),wireDiameter:Ae().finite().positive().default(2),color:iUn.default("#263449")}).strict(),we({standard:he("usb_c"),...gdt}).strict(),we({standard:he("jst_sh"),pinCount:Ae().int().min(2).max(15).default(4),wireDiameter:Ae().finite().min(0.4).max(0.8).default(0.6)}).strict(),we({standard:he("jst_ph"),pinCount:Ae().int().min(2).max(16).default(2),wireDiameter:Ae().finite().min(0.8).max(1.5).default(1.2)}).strict(),we({standard:he("us_mains"),...gdt,jacketDiameter:gdt.jacketDiameter.default(6.2)}).strict(),rUn]),tUn=["#df4049","#263449","#e1b13c","#347dc9","#27a782","#af62bd"];function sUn(e){let t=rUn.parse({standard:"adaptercable",...e}),{connectorA:n,connectorB:o}=t,r="pinCount"in n&&"pinCount"in o&&n.pinCount>1,i=[n,o].flatMap((a)=>("pitch"in a)?[a.pitch]:[]),s=Math.min(2,...i.map((a)=>a*0.6));return U0e.parse({...t,crossSection:t.crossSection??(r?{kind:"wire_bundle",wirePitch:Math.max(...i),wires:Array.from({length:n.pinCount},(a,c)=>({diameter:s,color:tUn[c%tUn.length]}))}:{kind:"round_jacket",diameter:Math.min(4,n.bodyHeight,o.bodyHeight,...i.map((a)=>Math.min(2,a*0.6))),color:"#263449"})})}var PPe=["#df4049","#263449","#e1b13c","#347dc9","#27a782","#af62bd"];function lL(e){let t=wMi.parse(e);if(t.standard==="adaptercable")return sUn(t);if(t.standard==="bullet"){let r=t.diameter+2;return U0e.parse({standard:"bullet",connectorA:ZGn({diameter:t.diameter,gender:t.genderA,pinCount:t.pinCount,pitch:r}),connectorB:ZGn({diameter:t.diameter,gender:t.genderB,pinCount:t.pinCount,pitch:r}),crossSection:t.pinCount===1?{kind:"round_jacket",diameter:t.wireDiameter,color:t.color}:{kind:"wire_bundle",wirePitch:r,wires:Array.from({length:t.pinCount},(i,s)=>({diameter:t.wireDiameter,color:PPe[s%PPe.length]}))}})}if(t.standard==="usb_c"){let r={kind:"usb_c_plug",bodyWidth:12,bodyHeight:6,bodyDepth:18,shellWidth:8.25,shellHeight:2.4,shellDepth:6.5};return U0e.parse({standard:t.standard,connectorA:r,connectorB:{...r},crossSection:{kind:"round_jacket",diameter:t.jacketDiameter,color:t.color}})}if(t.standard==="us_mains")return U0e.parse({standard:t.standard,connectorA:{kind:"nema_5_15p",bodyWidth:32,bodyHeight:28,bodyDepth:35},connectorB:{kind:"iec_c13",bodyWidth:24,bodyHeight:18,bodyDepth:30},crossSection:{kind:"round_jacket",diameter:t.jacketDiameter,color:t.color}});let n=t.standard==="jst_sh",o={kind:n?"jst_sh_housing":"jst_ph_housing",pinCount:t.pinCount,pitch:n?1:2,bodyWidth:n?t.pinCount+1:(t.pinCount-1)*2+3.8,bodyHeight:n?2.8:4.5,bodyDepth:n?5:6.85};return U0e.parse({standard:t.standard,connectorA:o,connectorB:{...o},crossSection:{kind:"wire_bundle",wirePitch:o.pitch,wires:Array.from({length:t.pinCount},(r,i)=>({diameter:t.wireDiameter,color:PPe[i%PPe.length]}))}})}function nUn(e){let t=e.trim().toLowerCase(),n=/^bullet([1-9][0-9]*)?_(.+)$/.exec(t);if(n){let r,i,s=new Set;for(let a of n[2].split("_")){let c=/^d([0-9]+(?:\.[0-9]+)?)mm$/.exec(a)??/^g(male|female)$/.exec(a),l=a[0];if(!c||s.has(l))throw Error(`Invalid or duplicate connector parameter: "${a}"`);if(s.add(l),l==="d")r=Number(c[1]);else i=c[1]}if(r===void 0||i===void 0)throw Error("Bullet connector strings require dNmm and gmale or gfemale");return lL({standard:"bullet",diameter:W0e.parse(r),pinCount:n[1]?Number(n[1]):1,genderA:i}).connectorA}let o=/^(jst_sh|jst_ph)(?:_pins([0-9]+))?$/.exec(t);if(o)return lL({standard:o[1],...o[2]?{pinCount:Number(o[2])}:{}}).connectorA;if(t==="usb_c")return lL({standard:"usb_c"}).connectorA;if(t==="nema_5_15p")return lL({standard:"us_mains"}).connectorA;if(t==="iec_c13")return lL({standard:"us_mains"}).connectorB;throw Error(`Unsupported connector string: "${e}"`)}function aUn(e){let t=e.trim().toLowerCase();if(t.startsWith("adaptercable")){let r=/^adaptercable_(a|b)\(([^()]+)\)_(a|b)\(([^()]+)\)$/.exec(t);if(!r||r[1]===r[3])throw Error("Adapter cables require exactly one named a(CONNECTOR) and b(CONNECTOR)");let i=nUn(r[2]),s=nUn(r[4]);return sUn({connectorA:r[1]==="a"?i:s,connectorB:r[1]==="b"?i:s})}if(t==="usb_c"||t==="us_mains")return lL({standard:t});let n=/^bullet([1-9][0-9]*)?_(.+)$/.exec(t);if(n){let r,i,s,a=new Set;for(let c of n[2].split("_")){let l=/^d([0-9]+(?:\.[0-9]+)?)mm$/.exec(c)??/^(a|b)(male|female)$/.exec(c),h=c[0];if(!l||a.has(h))throw Error(`Invalid or duplicate bullet parameter: "${c}"`);if(a.add(h),h==="d")r=Number(l[1]);else if(h==="a")i=l[2];else s=l[2]}if(r===void 0)throw Error("Bullet cables require dNmm");return lL({standard:"bullet",diameter:W0e.parse(r),pinCount:n[1]?Number(n[1]):1,genderA:i??"male",genderB:s??"female"})}let o=/^(jst_sh|jst_ph)(?:_pins([0-9]+))?$/.exec(t);if(o)return lL({standard:o[1],...o[2]?{pinCount:Number(o[2])}:{}});throw Error(`Unsupported cable string: "${e}". Expected usb_c, jst_sh[_pinsN], jst_ph[_pinsN], us_mains, bullet[CONTACTS]_dNmm[_amale][_bfemale], or adaptercable_a(CONNECTOR)_b(CONNECTOR).`)}var fdt=Qe(c5(),1),hUn=Qe(c5(),1),$0e=Qe(c5(),1),hL={moldedPlastic:{metalness:0,roughness:0.7},rubber:{metalness:0,roughness:0.9},sleeve:{metalness:0,roughness:0.45},tinnedLead:{metalness:0.8,roughness:0.55},goldContact:{metalness:1,roughness:0.25},copper:{metalness:1,roughness:0.35},brushedMetal:{metalness:1,roughness:0.4},steel:{metalness:1,roughness:0.25}},Ry=(e,t)=>[e[0]+t[0],e[1]+t[1],e[2]+t[2]],j0e=(e,t)=>[e[0]-t[0],e[1]-t[1],e[2]-t[2]],Np=(e,t)=>[e[0]*t,e[1]*t,e[2]*t],Nee=(e,t)=>e[0]*t[0]+e[1]*t[1]+e[2]*t[2],Ree=(e,t)=>[e[1]*t[2]-e[2]*t[1],e[2]*t[0]-e[0]*t[2],e[0]*t[1]-e[1]*t[0]];function QB(e){let t=Math.hypot(...e);if(t<0.0000000001)throw Error("Cable path must not contain coincident points or a reversing tangent");return Np(e,1/t)}function Adt(e,{startPin1Side:t,endPin1Side:n}={}){if(e.length<2||e.some((_)=>_.length!==3||!_.every(Number.isFinite)))throw Error("Cable path needs at least two finite 3D points");let o=e.slice(1).map((_,p)=>QB(j0e(_,e[p]))),r=e.map((_,p)=>p===0?o[0]:p===e.length-1?o.at(-1):QB(Ry(o[p-1],o[p]))),i=Math.abs(r[0][2])>0.95?[0,1,0]:[0,0,1],s=(_,p)=>{if(_.length!==3||!_.every(Number.isFinite)||Math.hypot(..._)<0.0000000001)throw Error("Connector pin 1 side must be a finite nonzero vector");let m=Np(QB(_),-1);if(Math.abs(Nee(m,p))>0.00001)throw Error("Connector pin 1 side must be perpendicular to its path tangent");return QB(j0e(m,Np(p,Nee(m,p))))},a=t?s(t,r[0]):QB(Ree(i,r[0])),c=r.map((_,p)=>{if(p>0){let m=r[p-1],A=Ree(m,_),g=Math.hypot(...A),f=Math.max(-1,Math.min(1,Nee(m,_)));if(g>0.0000000001){let y=Np(A,1/g);a=QB(Ry(Ry(Np(a,f),Np(Ree(y,a),g)),Np(y,Nee(y,a)*(1-f))))}}return{point:e[p],tangent:_,normal:a,binormal:QB(Ree(_,a))}});if(!n)return c;let l=c.at(-1),h=s(n,l.tangent),d=Math.atan2(Nee(l.tangent,Ree(l.normal,h)),Nee(l.normal,h)),u=[0];for(let _=1;_<e.length;_++)u.push(u[_-1]+Math.hypot(...j0e(e[_],e[_-1])));return c.map((_,p)=>{let m=d*(t?u[p]/u.at(-1):1),A=QB(Ry(Np(_.normal,Math.cos(m)),Np(_.binormal,Math.sin(m))));return{..._,normal:A,binormal:QB(Ree(_.tangent,A))}})}function h5({geometry:e,color:t,name:n,material:o}){let r=hUn.default.geometries.geom3.toPolygons(e),i=[],s=[],a=new Map;for(let c of r){let l=[];for(let h of c.vertices){let d=h.map((_)=>_.toFixed(8)).join(","),u=a.get(d);if(u===void 0)u=i.length/3,i.push(...h),a.set(d,u);l.push(u)}for(let h=1;h<l.length-1;h++)s.push(l[0],l[h],l[h+1])}return{name:n,positions:i,indices:s,color:t,material:o,smooth:!1}}function BMi({mesh:e,frame:t,wireExitDepth:n,isEnd:o}){let r=Np(t.tangent,o?-1:1),i=o?Np(t.binormal,-1):t.binormal,s=Ry(t.point,Np(r,-n)),a=[];for(let c=0;c<e.positions.length;c+=3)a.push(...Ry(s,Ry(Ry(Np(t.normal,e.positions[c]),Np(i,e.positions[c+1])),Np(r,e.positions[c+2]))));return{...e,positions:a}}function TMi(e){let{cylinder:t,sphere:n,cuboid:o}=fdt.default.primitives,{subtract:r,union:i}=fdt.default.booleans,{diameter:s,contactDepth:a,bodyDepth:c,kind:l}=e,h=e.bodyHeight,d=s/2,u=l==="bullet_male"?i(n({radius:d,center:[0,0,d],segments:32}),t({radius:d,height:a-d,center:[0,0,(a+d)/2],segments:32})):r(t({radius:h/2,height:a,center:[0,0,a/2],segments:32}),t({radius:d,height:a-s/4+0.1,center:[0,0,(a-s/4-0.1)/2],segments:32}));if(l==="bullet_male")u=r(u,o({size:[s+0.2,s*0.08,a*0.65],center:[0,0,a*0.45]}),o({size:[s*0.08,s+0.2,a*0.65],center:[0,0,a*0.45]}));let _=c-a,p=r(t({radius:h/2,height:_,center:[0,0,a+_/2],segments:32}),t({radius:d*0.75,height:_*0.8+0.1,center:[0,0,c-_*0.4+0.05],segments:32})),m=[h5({geometry:u,material:hL.goldContact,color:[0.83,0.64,0.22,1],name:l==="bullet_male"?"bullet-pin":"bullet-socket"}),h5({geometry:p,material:hL.goldContact,color:[0.83,0.64,0.22,1],name:"solder-cup"})],A=e.pinCount??1;return Array.from({length:A},(g,f)=>{let y=(f-(A-1)/2)*(e.pitch??h);return m.map((x)=>({...x,name:A===1?x.name:`${x.name}-${f+1}`,positions:x.positions.map((C,b)=>b%3===0?C+y:C)}))}).flat()}var{cuboid:kB,roundedCuboid:ydt,cylinder:K0e,roundedRectangle:MPe,polygon:DMi,sphere:NMi}=$0e.default.primitives,{extrudeLinear:X0e}=$0e.default.extrusions,{translate:BPe,rotateY:RMi}=$0e.default.transforms,{subtract:Qee,union:dUn}=$0e.default.booleans,TPe=[0.055,0.07,0.09,1],QMi=[0.86,0.84,0.75,1],uUn=[0.6,0.64,0.7,1],wPe=[0.66,0.46,0.18,1];function pUn(e){if(e.kind==="usb_c_plug")return e.shellDepth+e.bodyDepth;if(e.kind==="nema_5_15p")return 19.05+e.bodyDepth;return e.bodyDepth}function kMi(e){let{bodyWidth:t,bodyHeight:n,bodyDepth:o,pinCount:r,pitch:i}=e,s=i===1?0.55:1.05,a=Array.from({length:r},(u,_)=>{let p=(_-(r-1)/2)*i;return kB({size:[s,s*1.35,o-0.6],center:[p,0,(o-0.6)/2-0.02]})}),c=Array.from({length:r},(u,_)=>K0e({radius:i*0.34,height:1.3,segments:16,center:[(_-(r-1)/2)*i,0,o-0.5]})),l=kB({size:[t*0.45,0.5,o*0.5],center:[0,n/2,o*0.65]}),h=Qee(ydt({size:[t,n,o],center:[0,0,o/2],roundRadius:0.1,segments:8}),...a,...c,l,...Array.from({length:r},(u,_)=>kB({size:[s*0.8,n*0.7,o*0.24],center:[(_-(r-1)/2)*i,n/2,o*0.7]}))),d=Array.from({length:r},(u,_)=>{let p=(_-(r-1)/2)*i;return h5({material:hL.goldContact,name:`contact-${_+1}`,color:uUn,geometry:Qee(kB({size:[s*0.92,s*1.25,o*0.65],center:[p,0,o*0.45]}),kB({size:[s*0.92-0.12,s*1.25-0.12,o*0.65+0.2],center:[p,0,o*0.45]}))})});return[h5({geometry:h,color:QMi,name:"housing"}),...d]}function LMi(e){let{shellWidth:t,shellHeight:n,shellDepth:o,bodyWidth:r,bodyHeight:i,bodyDepth:s}=e,a=Qee(X0e({height:o},MPe({size:[t,n],roundRadius:n/2-0.02,segments:32})),BPe([0,0,-0.1],X0e({height:o+0.2},MPe({size:[t-0.4,n-0.4],roundRadius:(n-0.4)/2-0.02,segments:32})))),c=Qee(X0e({height:o},MPe({size:[t-0.41,n-0.41],roundRadius:0.85,segments:32})),BPe([0,0,-0.1],X0e({height:o-0.3},MPe({size:[t-0.8,n-0.8],roundRadius:0.65,segments:32})))),l=ydt({size:[r,i,s],center:[0,0,o+s/2],roundRadius:Math.min(1.3,i/4),segments:16}),h=Array.from({length:24},(d,u)=>kB({size:[0.22,0.08,3.5],center:[(u%12-5.5)*0.5,u<12?0.77:-0.77,2.6]}));return[h5({geometry:l,color:TPe,name:"overmold"}),h5({geometry:a,color:uUn,material:hL.brushedMetal,name:"shell"}),h5({geometry:c,color:[0.025,0.026,0.03,1],name:"liner"}),...h.map((d,u)=>h5({geometry:d,color:wPe,material:hL.goldContact,name:`contact-${u+1}`}))]}function HMi(e){let{bodyWidth:t,bodyHeight:n,bodyDepth:o,kind:r}=e,s=ydt({size:[t,n,o],center:[0,0,(r==="nema_5_15p"?19.05:0)+o/2],roundRadius:2,segments:16});if(r==="nema_5_15p"){let l=[-6.35,6.35].map((d)=>{let u=kB({size:[1.524,6.35,15.875],center:[d,2.7,11.1125]}),_=BPe([d,2.7,7.3],RMi(Math.PI/2,K0e({radius:1.1,height:3,segments:20})));return Qee(u,_)}),h=dUn(K0e({radius:2.38125,height:16.66875,center:[0,-9.20625,10.715625000000001],segments:32}),NMi({radius:2.38125,center:[0,-9.20625,2.38125],segments:32}));return[h5({geometry:s,color:TPe,name:"plug-body"}),...l.map((d,u)=>h5({geometry:d,color:wPe,material:hL.goldContact,name:`blade-${u+1}`})),h5({geometry:h,color:wPe,material:hL.goldContact,name:"ground-pin"})]}let a=BPe([0,0,-0.1],X0e({height:3.2},DMi({points:[[-9,-6],[9,-6],[9,2],[5,6],[-5,6],[-9,2]]}))),c=[[-4.4,-1.8,8],[4.4,-1.8,8],[0,3.1,8]];return s=Qee(s,a,...c.map((l)=>kB({size:[2.3,3.4,16.2],center:l}))),[h5({geometry:s,color:TPe,name:"appliance-body"}),...c.map(([l,h],d)=>h5({geometry:kB({size:[0.15,2.8,6],center:[l-1.05,h,7.8]}),color:wPe,material:hL.goldContact,name:`socket-contact-${d+1}`}))]}function FMi({connector:e,jacketDiameter:t}){let n=e.kind==="usb_c_plug"?LMi(e):e.kind==="bullet_male"||e.kind==="bullet_female"?TMi(e):e.kind==="jst_sh_housing"||e.kind==="jst_ph_housing"?kMi(e):HMi(e);if(t!==void 0&&e.kind!=="bullet_male"&&e.kind!=="bullet_female"){let o=pUn(e),r=dUn(K0e({radius:t/2+0.15,height:5,center:[0,0,o+2.5],segments:32}),...Array.from({length:7},(i,s)=>K0e({radius:t/2+0.8-s*0.06,height:0.28,center:[0,0,o+0.4+s*0.7],segments:32})));n.push(h5({geometry:r,color:TPe,name:"strain-relief"}))}return n}function zMi(e){let t=[0];for(let c=1;c<e.length;c++)t.push(t[c-1]+Math.hypot(...j0e(e[c],e[c-1])));let n=t.at(-1),o=Math.min(20,n/3),r=[...t,n/2];for(let c=0;c<=10;c++){let l=o*c/10;r.push(l,n-l)}let i=r.sort((c,l)=>c-l).filter((c,l,h)=>l===0||c-h[l-1]>0.000000001),s=0;return{path:i.map((c)=>{while(s<e.length-2&&c>t[s+1])s++;let l=(c-t[s])/(t[s+1]-t[s]);return Ry(e[s],Np(j0e(e[s+1],e[s]),l))}),distances:i,length:n,endLength:o}}function cUn({frames:e,diameter:t,offset:n=0,radialSegments:o,color:r,name:i}){let s=[],a=[];for(let d of e){let u=Ry(d.point,Np(d.normal,n));for(let _=0;_<o;_++){let p=_*Math.PI*2/o;s.push(...Ry(u,Ry(Np(d.normal,t*Math.cos(p)/2),Np(d.binormal,t*Math.sin(p)/2))))}}for(let d=0;d<e.length-1;d++)for(let u=0;u<o;u++){let _=d*o+u,p=d*o+(u+1)%o,m=_+o,A=p+o;a.push(_,p,m,p,A,m)}let c=s.length/3;s.push(...Ry(e[0].point,Np(e[0].normal,n)));let l=s.length/3;s.push(...Ry(e.at(-1).point,Np(e.at(-1).normal,n)));let h=(e.length-1)*o;for(let d=0;d<o;d++){let u=(d+1)%o;a.push(c,u,d,l,h+d,h+u)}return{name:i,positions:s,indices:a,color:r,smooth:!0}}function lUn(e){if(!/^#[a-f\d]{6}$/i.test(e))throw Error("Cable colors must be six-digit hex strings");return[parseInt(e.slice(1,3),16)/255,parseInt(e.slice(3,5),16)/255,parseInt(e.slice(5,7),16)/255,1]}function OMi(e){for(let o of[e.connectorA,e.connectorB]){let r=[o.bodyWidth,o.bodyHeight,o.bodyDepth];if(o.kind==="usb_c_plug")r.push(o.shellWidth,o.shellHeight,o.shellDepth);if(o.kind==="bullet_male"||o.kind==="bullet_female"){let i=o.pinCount??1,s=o.pitch??o.bodyHeight;if(r.push(o.diameter,o.contactDepth,s),!Number.isInteger(i)||i<1||i>16||o.bodyHeight<=o.diameter||s<o.bodyHeight||Math.abs(o.bodyWidth-(o.bodyHeight+(i-1)*s))>0.000001||o.contactDepth>=o.bodyDepth||o.contactDepth<=o.diameter/2)throw Error("Bullet contact must fit inside its cylindrical body");if(i===1&&(e.crossSection.kind!=="round_jacket"||e.crossSection.diameter>o.bodyHeight)||i>1&&(e.crossSection.kind!=="wire_bundle"||e.crossSection.wires.length!==i||e.crossSection.wires.some((a)=>a.diameter>o.bodyHeight)))throw Error("Bullet cables require one insulated wire per contact that fits its solder cup")}if(r.some((i)=>!Number.isFinite(i)||i<=0))throw Error("Connector dimensions must be finite and positive");if((o.kind==="jst_sh_housing"||o.kind==="jst_ph_housing")&&(!Number.isInteger(o.pinCount)||o.pinCount<2||!Number.isFinite(o.pitch)||o.pitch<=0))throw Error("JST connectors need a positive pitch and at least two contacts")}let t=e.crossSection,n=t.kind==="round_jacket"?[t.diameter]:t.wires.map((o)=>o.diameter);if(n.length===0||n.some((o)=>!Number.isFinite(o)||o<=0))throw Error("Cable diameters must be finite and positive");if(t.kind==="wire_bundle"){if(!Number.isFinite(t.wirePitch)||t.wires.some((o)=>o.diameter>t.wirePitch))throw Error("Insulated bundle wires must not overlap");for(let o of[e.connectorA,e.connectorB]){if(!("pinCount"in o)||(o.pinCount??1)!==t.wires.length)throw Error("Bundle wire count must match connector contact count");if("pitch"in o&&t.wires.some((r)=>r.diameter>o.pitch))throw Error("Insulated wires must fit each connector pitch")}}}function mUn({definition:e,path:t,radialSegments:n=24,startPin1Side:o,endPin1Side:r}){if(OMi(e),!Number.isInteger(n)||n<8||n>128)throw Error("radialSegments must be an integer from 8 to 128");let i=Adt(t,{startPin1Side:o,endPin1Side:r}),s=e.crossSection,a=s.kind==="round_jacket"?s.diameter:void 0,c="pitch"in e.connectorA?e.connectorA.pitch:void 0,l="pitch"in e.connectorB?e.connectorB.pitch:void 0,h=c!==l&&s.kind==="wire_bundle"?zMi(t):void 0,d=h?Adt(h.path,{startPin1Side:o,endPin1Side:r}):i,u=s.kind==="round_jacket"?[cUn({frames:i,diameter:s.diameter,radialSegments:n,color:lUn(s.color),name:"jacket"})]:s.wires.map((_,p)=>{let m=p-(s.wires.length-1)/2,A=Math.min(s.wirePitch,c??s.wirePitch,l??s.wirePitch,1.2*Math.max(...s.wires.map((y)=>y.diameter))),g=(y)=>y*y*(3-2*y),f=h?Adt(d.map((y,x)=>{let C=h.distances[x],b=1-g(Math.min(1,C/h.endLength)),I=1-g(Math.min(1,(h.length-C)/h.endLength)),v=A+((c??s.wirePitch)-A)*b+((l??s.wirePitch)-A)*I;return Ry(y.point,Np(y.normal,m*v))})):i;return cUn({frames:f,diameter:_.diameter,offset:(h?0:m)*s.wirePitch,radialSegments:n,color:lUn(_.color),name:`wire-${p+1}`})});for(let[_,p]of[e.connectorA,e.connectorB].entries()){let m=_===0?i[0]:i.at(-1),A=FMi({connector:p,jacketDiameter:a});u.push(...A.map((g)=>BMi({mesh:{...g,name:`${_===0?"A":"B"}-${g.name}`},frame:m,isEnd:_===1,wireExitDepth:pUn(p)})))}return u}var iMe=Qe(rn(),1);Ko();Ko();Ko();var zB=Qe(so(),1),q2=Qe(rn(),1);Ko();var y5=Qe(rn(),1);Ko();Ko();Ko();var _3=Qe(so(),1),C3=Qe(rn(),1),Dqn=Qe(rn(),1),$b=Qe(rn(),1),I0t=Qe(so(),1),qb=Qe(rn(),1),kqn=Qe(rn(),1),j9=Qe(rn(),1),ate=Qe(rn(),1),zqn=Qe(rn(),1),Oqn=Qe(Y8(),1),Yf=Qe(rn(),1),Kqn=Qe(so(),1),ki=Qe(rn(),1),K9=Qe(rn(),1),lEe=Qe(so(),1),Ig=Qe(rn(),1),_L=Qe(so(),1),aMe=Qe(rn(),1),SYi=Qe(so(),1),cd=Qe(rn(),1),zpe=Qe(rn(),1),tJn=Qe(so(),1),iJn=Qe(rn(),1),tp=Qe(rn(),1),D0t=Qe(so(),1),R0t=Qe(rn(),1),Z2=Qe(rn(),1);var b_=Qe(rn(),1),PJn=Qe(rn(),1),EJn=Qe(Y8(),1),wJn=Qe(rn(),1),Kee=Qe(so(),1),mMe=Qe(rn(),1),HJn=Qe(Y8(),1),FJn=Qe(so(),1),Of=Qe(rn(),1),zJn=Qe(rn(),1),LA=Qe(rn(),1),hUi=Qe(rn(),1),_Me=Qe(rn(),1),xL=Qe(so(),1),AMe=Qe(rn(),1),e1=Qe(rn(),1),nZn=Qe(rn(),1),fMe=Qe(rn(),1),oZn=Qe(rn(),1),Ju=Qe(rn(),1),hte=Qe(rn(),1),sZn=Qe(rn(),1),Ac=Qe(so(),1),x3=Qe(so(),1),Ipe=Qe(rn(),1),BZn=Qe(so(),1),gEe=Qe(rn(),1),Put=Qe(rn(),1),KB=Qe(so(),1),Nr=Qe(so(),1);var Fr=Qe(so(),1),$B=Qe(rn(),1),ZB=Qe(rn(),1),Rp=Qe(so(),1);var kee=Qe(rn(),1),Ub=Qe(rn(),1),LB=Qe(rn(),1);var VMi={data:""},YMi=(e)=>{if(typeof window=="object"){let t=(e?e.querySelector("#_goober"):window._goober)||Object.assign(document.createElement("style"),{innerHTML:" ",id:"_goober"});return t.nonce=window.__nonce__,t.parentNode||(e||document.head).appendChild(t),t.firstChild}return e||VMi};var GMi=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,UMi=/\/\*[^]*?\*\/|  +/g,_Un=/\n+/g,uL=(e,t)=>{let n="",o="",r="";for(let i in e){let s=e[i];i[0]=="@"?i[1]=="i"?n=i+" "+s+";":o+=i[1]=="f"?uL(s,i):i+"{"+uL(s,i[1]=="k"?"":t)+"}":typeof s=="object"?o+=uL(s,t?t.replace(/([^,])+/g,(a)=>i.replace(/([^,]*:\S+\([^)]*\))|([^,])+/g,(c)=>/&/.test(c)?c.replace(/&/g,a):a?a+" "+c:c)):i):s!=null&&(i=i[1]=="-"?i:i.replace(/[A-Z]/g,"-$&").toLowerCase(),r+=uL.p?uL.p(i,s):i+":"+s+";")}return n+(t&&r?t+"{"+r+"}":r)+o},dL={},gUn=(e)=>{if(typeof e=="object"){let t="";for(let n in e)t+=n+gUn(e[n]);return t}return e},WMi=(e,t,n,o,r)=>{let i=gUn(e),s=dL[i]||(dL[i]=((c)=>{let l=0,h=11;for(;l<c.length;)h=101*h+c.charCodeAt(l++)>>>0;return"go"+h})(i));if(!dL[s]){let c=i!==e?e:((l)=>{let h,d,u=[{}];for(;h=GMi.exec(l.replace(UMi,""));)h[4]?u.shift():h[3]?(d=h[3].replace(_Un," ").trim(),u.unshift(u[0][d]=u[0][d]||{})):u[0][h[1]]=h[2].replace(_Un," ").trim();return u[0]})(e);dL[s]=uL(r?{["@keyframes "+s]:c}:c,n?"":"."+s)}let a=n&&dL.g;return n&&(dL.g=dL[s]),((c,l,h,d)=>{d?l.data=l.data.replace(d,c):l.data.indexOf(c)===-1&&(l.data=h?c+l.data:l.data+c)})(dL[s],t,o,a),s},XMi=(e,t,n)=>e.reduce((o,r,i)=>{let s=t[i];if(s&&s.call){let a=s(n),c=a&&a.props&&a.props.className||/^go/.test(a)&&a;s=c?"."+c:a&&typeof a=="object"?a.props?"":uL(a,""):a===!1?"":a}return o+r+(s==null?"":s)},"");function q0e(e){let t=this||{},n=e.call?e(t.p):e;return WMi(n.unshift?n.raw?XMi(n,[].slice.call(arguments,1),t.p):n.reduce((o,r)=>Object.assign(o,r&&r.call?r(t.p):r),{}):n,YMi(t.target),t.g,t.o,t.k)}var AUn,xdt,Cdt,V3a=q0e.bind({g:1}),d5=q0e.bind({k:1});function fUn(e,t,n,o){uL.p=t,AUn=e,xdt=n,Cdt=o}function p3(e,t){let n=this||{};return function(){let o=arguments;function r(i,s){let a=Object.assign({},i),c=a.className||r.className;n.p=Object.assign({theme:xdt&&xdt()},a),n.o=/go\d/.test(c),a.className=q0e.apply(n,o)+(c?" "+c:""),t&&(a.ref=s);let l=e;return e[0]&&(l=a.as||e,delete a.as),Cdt&&l[0]&&Cdt(a),AUn(l,a)}return t?t(r):r}}var _G=Qe(rn(),1);var pL=Qe(rn(),1),jMi=(e)=>typeof e=="function",RPe=(e,t)=>jMi(e)?e(t):e,KMi=(()=>{let e=0;return()=>(++e).toString()})(),yUn=(()=>{let e;return()=>{if(e===void 0&&typeof window<"u"){let t=matchMedia("(prefers-reduced-motion: reduce)");e=!t||t.matches}return e}})(),$Mi=20,bdt="default",xUn=(e,t)=>{let{toastLimit:n}=e.settings;switch(t.type){case 0:return{...e,toasts:[t.toast,...e.toasts].slice(0,n)};case 1:return{...e,toasts:e.toasts.map((s)=>s.id===t.toast.id?{...s,...t.toast}:s)};case 2:let{toast:o}=t;return xUn(e,{type:e.toasts.find((s)=>s.id===o.id)?1:0,toast:o});case 3:let{toastId:r}=t;return{...e,toasts:e.toasts.map((s)=>s.id===r||r===void 0?{...s,dismissed:!0,visible:!1}:s)};case 4:return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter((s)=>s.id!==t.toastId)};case 5:return{...e,pausedAt:t.time};case 6:let i=t.time-(e.pausedAt||0);return{...e,pausedAt:void 0,toasts:e.toasts.map((s)=>({...s,pauseDuration:s.pauseDuration+i}))}}},NPe=[],CUn={toasts:[],pausedAt:void 0,settings:{toastLimit:$Mi}},gP={},bUn=(e,t=bdt)=>{gP[t]=xUn(gP[t]||CUn,e),NPe.forEach(([n,o])=>{n===t&&o(gP[t])})},IUn=(e)=>Object.keys(gP).forEach((t)=>bUn(e,t)),qMi=(e)=>Object.keys(gP).find((t)=>gP[t].toasts.some((n)=>n.id===e)),QPe=(e=bdt)=>(t)=>{bUn(t,e)},JMi={blank:4000,error:4000,success:2000,loading:1/0,custom:4000},ZMi=(e={},t=bdt)=>{let[n,o]=kee.useState(gP[t]||CUn),r=kee.useRef(gP[t]);kee.useEffect(()=>(r.current!==gP[t]&&o(gP[t]),NPe.push([t,o]),()=>{let s=NPe.findIndex(([a])=>a===t);s>-1&&NPe.splice(s,1)}),[t]);let i=n.toasts.map((s)=>{var a,c,l;return{...e,...e[s.type],...s,removeDelay:s.removeDelay||((a=e[s.type])==null?void 0:a.removeDelay)||(e==null?void 0:e.removeDelay),duration:s.duration||((c=e[s.type])==null?void 0:c.duration)||(e==null?void 0:e.duration)||JMi[s.type],style:{...e.style,...(l=e[s.type])==null?void 0:l.style,...s.style}}});return{...n,toasts:i}},ewi=(e,t="blank",n)=>({createdAt:Date.now(),visible:!0,dismissed:!1,type:t,ariaProps:{role:"status","aria-live":"polite"},message:e,pauseDuration:0,...n,id:(n==null?void 0:n.id)||KMi()}),J0e=(e)=>(t,n)=>{let o=ewi(t,e,n);return QPe(o.toasterId||qMi(o.id))({type:2,toast:o}),o.id},f_=(e,t)=>J0e("blank")(e,t);f_.error=J0e("error");f_.success=J0e("success");f_.loading=J0e("loading");f_.custom=J0e("custom");f_.dismiss=(e,t)=>{let n={type:3,toastId:e};t?QPe(t)(n):IUn(n)};f_.dismissAll=(e)=>f_.dismiss(void 0,e);f_.remove=(e,t)=>{let n={type:4,toastId:e};t?QPe(t)(n):IUn(n)};f_.removeAll=(e)=>f_.remove(void 0,e);f_.promise=(e,t,n)=>{let o=f_.loading(t.loading,{...n,...n==null?void 0:n.loading});return typeof e=="function"&&(e=e()),e.then((r)=>{let i=t.success?RPe(t.success,r):void 0;return i?f_.success(i,{id:o,...n,...n==null?void 0:n.success}):f_.dismiss(o),r}).catch((r)=>{let i=t.error?RPe(t.error,r):void 0;i?f_.error(i,{id:o,...n,...n==null?void 0:n.error}):f_.dismiss(o)}),e};var twi=1000,nwi=(e,t="default")=>{let{toasts:n,pausedAt:o}=ZMi(e,t),r=Ub.useRef(new Map).current,i=Ub.useCallback((d,u=twi)=>{if(r.has(d))return;let _=setTimeout(()=>{r.delete(d),s({type:4,toastId:d})},u);r.set(d,_)},[]);Ub.useEffect(()=>{if(o)return;let d=Date.now(),u=n.map((_)=>{if(_.duration===1/0)return;let p=(_.duration||0)+_.pauseDuration-(d-_.createdAt);if(p<0){_.visible&&f_.dismiss(_.id);return}return setTimeout(()=>f_.dismiss(_.id,t),p)});return()=>{u.forEach((_)=>_&&clearTimeout(_))}},[n,o,t]);let s=Ub.useCallback(QPe(t),[t]),a=Ub.useCallback(()=>{s({type:5,time:Date.now()})},[s]),c=Ub.useCallback((d,u)=>{s({type:1,toast:{id:d,height:u}})},[s]),l=Ub.useCallback(()=>{o&&s({type:6,time:Date.now()})},[o,s]),h=Ub.useCallback((d,u)=>{let{reverseOrder:_=!1,gutter:p=8,defaultPosition:m}=u||{},A=n.filter((y)=>(y.position||m)===(d.position||m)&&y.height),g=A.findIndex((y)=>y.id===d.id),f=A.filter((y,x)=>x<g&&y.visible).length;return A.filter((y)=>y.visible).slice(..._?[f+1]:[0,f]).reduce((y,x)=>y+(x.height||0)+p,0)},[n]);return Ub.useEffect(()=>{n.forEach((d)=>{if(d.dismissed)i(d.id,d.removeDelay);else{let u=r.get(d.id);u&&(clearTimeout(u),r.delete(d.id))}})},[n,i]),{toasts:n,handlers:{updateHeight:c,startPause:a,endPause:l,calculateOffset:h}}},owi=d5` from { transform: scale(0) rotate(45deg); opacity: 0; } to { transform: scale(1) rotate(45deg); opacity: 1; }`,rwi=d5` from { transform: scale(0); opacity: 0; } to { transform: scale(1); opacity: 1; }`,iwi=d5` from { transform: scale(0) rotate(90deg); opacity: 0; } to { transform: scale(1) rotate(90deg); opacity: 1; }`,swi=p3("div")` width: 20px; opacity: 0; height: 20px; border-radius: 10px; background: ${(e)=>e.primary||"#ff4b4b"}; position: relative; transform: rotate(45deg); animation: ${owi} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards; animation-delay: 100ms; &:after, &:before { content: ''; animation: ${rwi} 0.15s ease-out forwards; animation-delay: 150ms; position: absolute; border-radius: 3px; opacity: 0; background: ${(e)=>e.secondary||"#fff"}; bottom: 9px; left: 4px; height: 2px; width: 12px; } &:before { animation: ${iwi} 0.15s ease-out forwards; animation-delay: 180ms; transform: rotate(90deg); } `,awi=d5` from { transform: rotate(0deg); } to { transform: rotate(360deg); } `,cwi=p3("div")` width: 12px; height: 12px; box-sizing: border-box; border: 2px solid; border-radius: 100%; border-color: ${(e)=>e.secondary||"#e0e0e0"}; border-right-color: ${(e)=>e.primary||"#616161"}; animation: ${awi} 1s linear infinite; `,lwi=d5` from { transform: scale(0) rotate(45deg); opacity: 0; } to { transform: scale(1) rotate(45deg); opacity: 1; }`,hwi=d5` 0% { height: 0; width: 0; opacity: 0; } 40% { height: 0; width: 6px; opacity: 1; } 100% { opacity: 1; height: 10px; }`,dwi=p3("div")` width: 20px; opacity: 0; height: 20px; border-radius: 10px; background: ${(e)=>e.primary||"#61d345"}; position: relative; transform: rotate(45deg); animation: ${lwi} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards; animation-delay: 100ms; &:after { content: ''; box-sizing: border-box; animation: ${hwi} 0.2s ease-out forwards; opacity: 0; animation-delay: 200ms; position: absolute; border-right: 2px solid; border-bottom: 2px solid; border-color: ${(e)=>e.secondary||"#fff"}; bottom: 6px; left: 6px; height: 10px; width: 6px; } `,uwi=p3("div")` position: absolute; `,pwi=p3("div")` position: relative; display: flex; justify-content: center; align-items: center; min-width: 20px; min-height: 20px; `,mwi=d5` from { transform: scale(0.6); opacity: 0.4; } to { transform: scale(1); opacity: 1; }`,_wi=p3("div")` position: relative; transform: scale(0.6); opacity: 0.4; min-width: 20px; animation: ${mwi} 0.3s 0.12s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards; `,gwi=({toast:e})=>{let{icon:t,type:n,iconTheme:o}=e;return t!==void 0?typeof t=="string"?_G.createElement(_wi,null,t):t:n==="blank"?null:_G.createElement(pwi,null,_G.createElement(cwi,{...o}),n!=="loading"&&_G.createElement(uwi,null,n==="error"?_G.createElement(swi,{...o}):_G.createElement(dwi,{...o})))},Awi=(e)=>` 0% {transform: translate3d(0,${e*-200}%,0) scale(.6); opacity:.5;} 100% {transform: translate3d(0,0,0) scale(1); opacity:1;} `,fwi=(e)=>` 0% {transform: translate3d(0,0,-1px) scale(1); opacity:1;} 100% {transform: translate3d(0,${e*-150}%,-1px) scale(.6); opacity:0;} `,ywi="0%{opacity:0;} 100%{opacity:1;}",xwi="0%{opacity:1;} 100%{opacity:0;}",Cwi=p3("div")` :where(&) { display: flex; align-items: center; background: #fff; color: #363636; line-height: 1.3; will-change: transform; box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1), 0 3px 3px rgba(0, 0, 0, 0.05); max-width: 350px; pointer-events: auto; padding: 8px 10px; border-radius: 8px; } `,bwi=p3("div")` display: flex; justify-content: center; margin: 4px 10px; color: inherit; flex: 1 1 auto; white-space: pre-line; `,Iwi=(e,t)=>{let n=e.includes("top")?1:-1,[o,r]=yUn()?[ywi,xwi]:[Awi(n),fwi(n)];return{animation:t?`${d5(o)} 0.35s cubic-bezier(.21,1.02,.73,1) forwards`:`${d5(r)} 0.4s forwards cubic-bezier(.06,.71,.55,1)`}},vwi=LB.memo(({toast:e,position:t,style:n,children:o})=>{let r=e.height?Iwi(e.position||t||"top-center",e.visible):{opacity:0},i=LB.createElement(gwi,{toast:e}),s=LB.createElement(bwi,{...e.ariaProps},RPe(e.message,e));return LB.createElement(Cwi,{className:e.className,style:{...r,...n,...e.style}},typeof o=="function"?o({icon:i,message:s}):LB.createElement(LB.Fragment,null,i,s))});fUn(pL.createElement);var Swi=({id:e,className:t,style:n,onHeightUpdate:o,children:r})=>{let i=pL.useCallback((s)=>{if(s){let a=()=>{let c=s.getBoundingClientRect().height;o(e,c)};a(),new MutationObserver(a).observe(s,{subtree:!0,childList:!0,characterData:!0})}},[e,o]);return pL.createElement("div",{ref:i,className:t,style:n},r)},Pwi=(e,t)=>{let n=e.includes("top"),o=n?{top:0}:{bottom:0},r=e.includes("center")?{justifyContent:"center"}:e.includes("right")?{justifyContent:"flex-end"}:{};return{left:0,right:0,display:"flex",position:"absolute",transition:yUn()?void 0:"all 230ms cubic-bezier(.21,1.02,.73,1)",transform:`translateY(${t*(n?1:-1)}px)`,...o,...r}},Ewi=q0e` z-index: 9999; > * { pointer-events: auto; } `,DPe=16,vUn=({reverseOrder:e,position:t="top-center",toastOptions:n,gutter:o,children:r,toasterId:i,containerStyle:s,containerClassName:a})=>{let{toasts:c,handlers:l}=nwi(n,i);return pL.createElement("div",{"data-rht-toaster":i||"",style:{position:"fixed",zIndex:9999,top:DPe,left:DPe,right:DPe,bottom:DPe,pointerEvents:"none",...s},className:a,onMouseEnter:l.startPause,onMouseLeave:l.endPause},c.map((h)=>{let d=h.position||t,u=l.calculateOffset(h,{reverseOrder:e,gutter:o,defaultPosition:t}),_=Pwi(d,u);return pL.createElement(Swi,{id:h.id,key:h.id,onHeightUpdate:l.updateHeight,className:h.visible?Ewi:"",style:_},h.type==="custom"?RPe(h.message,h):r?r(h):pL.createElement(vwi,{toast:h,position:d}))}))};var ute=Qe(so(),1),NZn=Qe(rn(),1),J2=Qe(rn(),1),RZn=Qe(rn(),1);Ko();var f5=Qe(so(),1);var bMe=Qe(rn(),1),{create:Mwi,defineProperty:QEe,getOwnPropertyDescriptor:wwi,getOwnPropertyNames:Tut,getPrototypeOf:Bwi}=Object,Twi=Object.prototype.hasOwnProperty,J9=(e,t)=>function(){return e&&(t=(0,e[Tut(e)[0]])(e=0)),t},At=(e,t)=>function(){return t||(0,e[Tut(e)[0]])((t={exports:{}}).exports,t),t.exports},Z9=(e,t)=>{for(var n in t)QEe(e,n,{get:t[n],enumerable:!0})},BWn=(e,t,n,o)=>{if(t&&typeof t==="object"||typeof t==="function"){for(let r of Tut(t))if(!Twi.call(e,r)&&r!==n)QEe(e,r,{get:()=>t[r],enumerable:!(o=wwi(t,r))||o.enumerable})}return e},Ll=(e,t,n)=>(n=e!=null?Mwi(Bwi(e)):{},BWn(t||!e||!e.__esModule?QEe(n,"default",{value:e,enumerable:!0}):n,e)),Dwi=(e)=>BWn(QEe({},"__esModule",{value:!0}),e),Is=At({"node_modules/@jscad/modeling/src/utils/flatten.js"(e,t){var n=(o)=>o.flat(1/0);t.exports=n}}),Nwi=At({"node_modules/@jscad/modeling/src/geometries/geom2/clone.js"(e,t){var n=(o)=>Object.assign({},o);t.exports=n}}),Rwi=At({"node_modules/@jscad/modeling/src/maths/mat4/add.js"(e,t){var n=(o,r,i)=>(o[0]=r[0]+i[0],o[1]=r[1]+i[1],o[2]=r[2]+i[2],o[3]=r[3]+i[3],o[4]=r[4]+i[4],o[5]=r[5]+i[5],o[6]=r[6]+i[6],o[7]=r[7]+i[7],o[8]=r[8]+i[8],o[9]=r[9]+i[9],o[10]=r[10]+i[10],o[11]=r[11]+i[11],o[12]=r[12]+i[12],o[13]=r[13]+i[13],o[14]=r[14]+i[14],o[15]=r[15]+i[15],o);t.exports=n}}),Dut=At({"node_modules/@jscad/modeling/src/maths/mat4/create.js"(e,t){var n=()=>[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];t.exports=n}}),Qwi=At({"node_modules/@jscad/modeling/src/maths/mat4/clone.js"(e,t){var n=Dut(),o=(r)=>{let i=n();return i[0]=r[0],i[1]=r[1],i[2]=r[2],i[3]=r[3],i[4]=r[4],i[5]=r[5],i[6]=r[6],i[7]=r[7],i[8]=r[8],i[9]=r[9],i[10]=r[10],i[11]=r[11],i[12]=r[12],i[13]=r[13],i[14]=r[14],i[15]=r[15],i};t.exports=o}}),TWn=At({"node_modules/@jscad/modeling/src/maths/mat4/copy.js"(e,t){var n=(o,r)=>(o[0]=r[0],o[1]=r[1],o[2]=r[2],o[3]=r[3],o[4]=r[4],o[5]=r[5],o[6]=r[6],o[7]=r[7],o[8]=r[8],o[9]=r[9],o[10]=r[10],o[11]=r[11],o[12]=r[12],o[13]=r[13],o[14]=r[14],o[15]=r[15],o);t.exports=n}}),kwi=At({"node_modules/@jscad/modeling/src/maths/mat4/invert.js"(e,t){var n=(o,r)=>{let i=r[0],s=r[1],a=r[2],c=r[3],l=r[4],h=r[5],d=r[6],u=r[7],_=r[8],p=r[9],m=r[10],A=r[11],g=r[12],f=r[13],y=r[14],x=r[15],C=i*h-s*l,b=i*d-a*l,I=i*u-c*l,v=s*d-a*h,P=s*u-c*h,M=a*u-c*d,B=_*f-p*g,T=_*y-m*g,N=_*x-A*g,D=p*y-m*f,L=p*x-A*f,H=m*x-A*y,V=C*H-b*L+I*D+v*N-P*T+M*B;if(!V)return null;return V=1/V,o[0]=(h*H-d*L+u*D)*V,o[1]=(a*L-s*H-c*D)*V,o[2]=(f*M-y*P+x*v)*V,o[3]=(m*P-p*M-A*v)*V,o[4]=(d*N-l*H-u*T)*V,o[5]=(i*H-a*N+c*T)*V,o[6]=(y*I-g*M-x*b)*V,o[7]=(_*M-m*I+A*b)*V,o[8]=(l*L-h*N+u*B)*V,o[9]=(s*N-i*L-c*B)*V,o[10]=(g*P-f*I+x*C)*V,o[11]=(p*I-_*P-A*C)*V,o[12]=(h*T-l*D-d*B)*V,o[13]=(i*D-s*T+a*B)*V,o[14]=(f*b-g*v-y*C)*V,o[15]=(_*v-p*b+m*C)*V,o};t.exports=n}}),Lwi=At({"node_modules/@jscad/modeling/src/maths/mat4/equals.js"(e,t){var n=(o,r)=>o[0]===r[0]&&o[1]===r[1]&&o[2]===r[2]&&o[3]===r[3]&&o[4]===r[4]&&o[5]===r[5]&&o[6]===r[6]&&o[7]===r[7]&&o[8]===r[8]&&o[9]===r[9]&&o[10]===r[10]&&o[11]===r[11]&&o[12]===r[12]&&o[13]===r[13]&&o[14]===r[14]&&o[15]===r[15];t.exports=n}}),fc=At({"node_modules/@jscad/modeling/src/maths/constants.js"(e,t){var n=1e5,o=0.00001,r=0.0000000000001,i=Math.PI*2;t.exports={EPS:o,NEPS:r,TAU:i,spatialResolution:n}}}),Vf=At({"node_modules/@jscad/modeling/src/maths/utils/trigonometry.js"(e,t){var{NEPS:n}=fc(),o=(s)=>Math.abs(s)<n?0:s,r=(s)=>o(Math.sin(s)),i=(s)=>o(Math.cos(s));t.exports={sin:r,cos:i}}}),DWn=At({"node_modules/@jscad/modeling/src/maths/mat4/identity.js"(e,t){var n=(o)=>(o[0]=1,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=1,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=1,o[11]=0,o[12]=0,o[13]=0,o[14]=0,o[15]=1,o);t.exports=n}}),NWn=At({"node_modules/@jscad/modeling/src/maths/mat4/fromRotation.js"(e,t){var{EPS:n}=fc(),{sin:o,cos:r}=Vf(),i=DWn(),s=(a,c,l)=>{let[h,d,u]=l,_=h*h+d*d+u*u;if(Math.abs(_)<n)return i(a);let p=1/Math.sqrt(_);h*=p,d*=p,u*=p;let m=o(c),A=r(c),g=1-A;return a[0]=h*h*g+A,a[1]=d*h*g+u*m,a[2]=u*h*g-d*m,a[3]=0,a[4]=h*d*g-u*m,a[5]=d*d*g+A,a[6]=u*d*g+h*m,a[7]=0,a[8]=h*u*g+d*m,a[9]=d*u*g-h*m,a[10]=u*u*g+A,a[11]=0,a[12]=0,a[13]=0,a[14]=0,a[15]=1,a};t.exports=s}}),Hwi=At({"node_modules/@jscad/modeling/src/maths/mat4/fromScaling.js"(e,t){var n=(o,r)=>(o[0]=r[0],o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=r[1],o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=r[2],o[11]=0,o[12]=0,o[13]=0,o[14]=0,o[15]=1,o);t.exports=n}}),Fwi=At({"node_modules/@jscad/modeling/src/maths/mat4/fromTaitBryanRotation.js"(e,t){var{sin:n,cos:o}=Vf(),r=(i,s,a,c)=>{let l=n(s),h=o(s),d=n(a),u=o(a),_=n(c),p=o(c);return i[0]=u*h,i[1]=u*l,i[2]=-d,i[3]=0,i[4]=_*d*h-p*l,i[5]=p*h+_*d*l,i[6]=_*u,i[7]=0,i[8]=_*l+p*d*h,i[9]=p*d*l-_*h,i[10]=p*u,i[11]=0,i[12]=0,i[13]=0,i[14]=0,i[15]=1,i};t.exports=r}}),zwi=At({"node_modules/@jscad/modeling/src/maths/mat4/fromTranslation.js"(e,t){var n=(o,r)=>(o[0]=1,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=1,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=1,o[11]=0,o[12]=r[0],o[13]=r[1],o[14]=r[2],o[15]=1,o);t.exports=n}}),Owi=At({"node_modules/@jscad/modeling/src/maths/mat4/fromValues.js"(e,t){var n=Dut(),o=(r,i,s,a,c,l,h,d,u,_,p,m,A,g,f,y)=>{let x=n();return x[0]=r,x[1]=i,x[2]=s,x[3]=a,x[4]=c,x[5]=l,x[6]=h,x[7]=d,x[8]=u,x[9]=_,x[10]=p,x[11]=m,x[12]=A,x[13]=g,x[14]=f,x[15]=y,x};t.exports=o}}),RWn=At({"node_modules/@jscad/modeling/src/maths/vec3/abs.js"(e,t){var n=(o,r)=>(o[0]=Math.abs(r[0]),o[1]=Math.abs(r[1]),o[2]=Math.abs(r[2]),o);t.exports=n}}),QWn=At({"node_modules/@jscad/modeling/src/maths/vec3/add.js"(e,t){var n=(o,r,i)=>(o[0]=r[0]+i[0],o[1]=r[1]+i[1],o[2]=r[2]+i[2],o);t.exports=n}}),kEe=At({"node_modules/@jscad/modeling/src/maths/vec3/dot.js"(e,t){var n=(o,r)=>o[0]*r[0]+o[1]*r[1]+o[2]*r[2];t.exports=n}}),Vwi=At({"node_modules/@jscad/modeling/src/maths/vec3/angle.js"(e,t){var n=kEe(),o=(r,i)=>{let s=r[0],a=r[1],c=r[2],l=i[0],h=i[1],d=i[2],u=Math.sqrt(s*s+a*a+c*c),_=Math.sqrt(l*l+h*h+d*d),p=u*_,m=p&&n(r,i)/p;return Math.acos(Math.min(Math.max(m,-1),1))};t.exports=o}}),LEe=At({"node_modules/@jscad/modeling/src/maths/vec3/create.js"(e,t){var n=()=>[0,0,0];t.exports=n}}),Ywi=At({"node_modules/@jscad/modeling/src/maths/vec3/clone.js"(e,t){var n=LEe(),o=(r)=>{let i=n();return i[0]=r[0],i[1]=r[1],i[2]=r[2],i};t.exports=o}}),kWn=At({"node_modules/@jscad/modeling/src/maths/vec3/copy.js"(e,t){var n=(o,r)=>(o[0]=r[0],o[1]=r[1],o[2]=r[2],o);t.exports=n}}),vpe=At({"node_modules/@jscad/modeling/src/maths/vec3/cross.js"(e,t){var n=(o,r,i)=>{let s=r[0],a=r[1],c=r[2],l=i[0],h=i[1],d=i[2];return o[0]=a*d-c*h,o[1]=c*l-s*d,o[2]=s*h-a*l,o};t.exports=n}}),LWn=At({"node_modules/@jscad/modeling/src/maths/vec3/distance.js"(e,t){var n=(o,r)=>{let i=r[0]-o[0],s=r[1]-o[1],a=r[2]-o[2];return Math.sqrt(i*i+s*s+a*a)};t.exports=n}}),Gwi=At({"node_modules/@jscad/modeling/src/maths/vec3/divide.js"(e,t){var n=(o,r,i)=>(o[0]=r[0]/i[0],o[1]=r[1]/i[1],o[2]=r[2]/i[2],o);t.exports=n}}),Uwi=At({"node_modules/@jscad/modeling/src/maths/vec3/equals.js"(e,t){var n=(o,r)=>o[0]===r[0]&&o[1]===r[1]&&o[2]===r[2];t.exports=n}}),Wwi=At({"node_modules/@jscad/modeling/src/maths/vec3/fromScalar.js"(e,t){var n=(o,r)=>(o[0]=r,o[1]=r,o[2]=r,o);t.exports=n}}),Xwi=At({"node_modules/@jscad/modeling/src/maths/vec3/fromValues.js"(e,t){var n=LEe(),o=(r,i,s)=>{let a=n();return a[0]=r,a[1]=i,a[2]=s,a};t.exports=o}}),jwi=At({"node_modules/@jscad/modeling/src/maths/vec3/fromVec2.js"(e,t){var n=(o,r,i=0)=>(o[0]=r[0],o[1]=r[1],o[2]=i,o);t.exports=n}}),HWn=At({"node_modules/@jscad/modeling/src/maths/vec3/length.js"(e,t){var n=(o)=>{let r=o[0],i=o[1],s=o[2];return Math.sqrt(r*r+i*i+s*s)};t.exports=n}}),Kwi=At({"node_modules/@jscad/modeling/src/maths/vec3/lerp.js"(e,t){var n=(o,r,i,s)=>(o[0]=r[0]+s*(i[0]-r[0]),o[1]=r[1]+s*(i[1]-r[1]),o[2]=r[2]+s*(i[2]-r[2]),o);t.exports=n}}),FWn=At({"node_modules/@jscad/modeling/src/maths/vec3/max.js"(e,t){var n=(o,r,i)=>(o[0]=Math.max(r[0],i[0]),o[1]=Math.max(r[1],i[1]),o[2]=Math.max(r[2],i[2]),o);t.exports=n}}),zWn=At({"node_modules/@jscad/modeling/src/maths/vec3/min.js"(e,t){var n=(o,r,i)=>(o[0]=Math.min(r[0],i[0]),o[1]=Math.min(r[1],i[1]),o[2]=Math.min(r[2],i[2]),o);t.exports=n}}),$wi=At({"node_modules/@jscad/modeling/src/maths/vec3/multiply.js"(e,t){var n=(o,r,i)=>(o[0]=r[0]*i[0],o[1]=r[1]*i[1],o[2]=r[2]*i[2],o);t.exports=n}}),qwi=At({"node_modules/@jscad/modeling/src/maths/vec3/negate.js"(e,t){var n=(o,r)=>(o[0]=-r[0],o[1]=-r[1],o[2]=-r[2],o);t.exports=n}}),Nut=At({"node_modules/@jscad/modeling/src/maths/vec3/normalize.js"(e,t){var n=(o,r)=>{let i=r[0],s=r[1],a=r[2],c=i*i+s*s+a*a;if(c>0)c=1/Math.sqrt(c);return o[0]=i*c,o[1]=s*c,o[2]=a*c,o};t.exports=n}}),Jwi=At({"node_modules/@jscad/modeling/src/maths/vec3/orthogonal.js"(e,t){var n=RWn(),o=LEe(),r=vpe(),i=(s,a)=>{let c=n(o(),a),l=0+(c[0]<c[1]&&c[0]<c[2]),h=0+(c[1]<=c[0]&&c[1]<c[2]),d=0+(c[2]<=c[0]&&c[2]<=c[1]);return r(s,a,[l,h,d])};t.exports=i}}),Zwi=At({"node_modules/@jscad/modeling/src/maths/vec3/rotateX.js"(e,t){var n=(o,r,i,s)=>{let a=[],c=[];return a[0]=r[0]-i[0],a[1]=r[1]-i[1],a[2]=r[2]-i[2],c[0]=a[0],c[1]=a[1]*Math.cos(s)-a[2]*Math.sin(s),c[2]=a[1]*Math.sin(s)+a[2]*Math.cos(s),o[0]=c[0]+i[0],o[1]=c[1]+i[1],o[2]=c[2]+i[2],o};t.exports=n}}),eBi=At({"node_modules/@jscad/modeling/src/maths/vec3/rotateY.js"(e,t){var n=(o,r,i,s)=>{let a=[],c=[];return a[0]=r[0]-i[0],a[1]=r[1]-i[1],a[2]=r[2]-i[2],c[0]=a[2]*Math.sin(s)+a[0]*Math.cos(s),c[1]=a[1],c[2]=a[2]*Math.cos(s)-a[0]*Math.sin(s),o[0]=c[0]+i[0],o[1]=c[1]+i[1],o[2]=c[2]+i[2],o};t.exports=n}}),tBi=At({"node_modules/@jscad/modeling/src/maths/vec3/rotateZ.js"(e,t){var n=(o,r,i,s)=>{let a=[],c=[];return a[0]=r[0]-i[0],a[1]=r[1]-i[1],c[0]=a[0]*Math.cos(s)-a[1]*Math.sin(s),c[1]=a[0]*Math.sin(s)+a[1]*Math.cos(s),o[0]=c[0]+i[0],o[1]=c[1]+i[1],o[2]=r[2],o};t.exports=n}}),OWn=At({"node_modules/@jscad/modeling/src/maths/vec3/scale.js"(e,t){var n=(o,r,i)=>(o[0]=r[0]*i,o[1]=r[1]*i,o[2]=r[2]*i,o);t.exports=n}}),nBi=At({"node_modules/@jscad/modeling/src/maths/vec3/snap.js"(e,t){var n=(o,r,i)=>(o[0]=Math.round(r[0]/i)*i+0,o[1]=Math.round(r[1]/i)*i+0,o[2]=Math.round(r[2]/i)*i+0,o);t.exports=n}}),VWn=At({"node_modules/@jscad/modeling/src/maths/vec3/squaredDistance.js"(e,t){var n=(o,r)=>{let i=r[0]-o[0],s=r[1]-o[1],a=r[2]-o[2];return i*i+s*s+a*a};t.exports=n}}),YWn=At({"node_modules/@jscad/modeling/src/maths/vec3/squaredLength.js"(e,t){var n=(o)=>{let r=o[0],i=o[1],s=o[2];return r*r+i*i+s*s};t.exports=n}}),HEe=At({"node_modules/@jscad/modeling/src/maths/vec3/subtract.js"(e,t){var n=(o,r,i)=>(o[0]=r[0]-i[0],o[1]=r[1]-i[1],o[2]=r[2]-i[2],o);t.exports=n}}),oBi=At({"node_modules/@jscad/modeling/src/maths/vec3/toString.js"(e,t){var n=(o)=>`[${o[0].toFixed(7)}, ${o[1].toFixed(7)}, ${o[2].toFixed(7)}]`;t.exports=n}}),rBi=At({"node_modules/@jscad/modeling/src/maths/vec3/transform.js"(e,t){var n=(o,r,i)=>{let s=r[0],a=r[1],c=r[2],l=i[3]*s+i[7]*a+i[11]*c+i[15];return l=l||1,o[0]=(i[0]*s+i[4]*a+i[8]*c+i[12])/l,o[1]=(i[1]*s+i[5]*a+i[9]*c+i[13])/l,o[2]=(i[2]*s+i[6]*a+i[10]*c+i[14])/l,o};t.exports=n}}),ui=At({"node_modules/@jscad/modeling/src/maths/vec3/index.js"(e,t){t.exports={abs:RWn(),add:QWn(),angle:Vwi(),clone:Ywi(),copy:kWn(),create:LEe(),cross:vpe(),distance:LWn(),divide:Gwi(),dot:kEe(),equals:Uwi(),fromScalar:Wwi(),fromValues:Xwi(),fromVec2:jwi(),length:HWn(),lerp:Kwi(),max:FWn(),min:zWn(),multiply:$wi(),negate:qwi(),normalize:Nut(),orthogonal:Jwi(),rotateX:Zwi(),rotateY:eBi(),rotateZ:tBi(),scale:OWn(),snap:nBi(),squaredDistance:VWn(),squaredLength:YWn(),subtract:HEe(),toString:oBi(),transform:rBi()}}}),iBi=At({"node_modules/@jscad/modeling/src/maths/mat4/fromVectorRotation.js"(e,t){var n=ui(),o=NWn(),r=(i,s,a)=>{let c=n.normalize(n.create(),s),l=n.normalize(n.create(),a),h=n.cross(n.create(),l,c),d=n.dot(l,c);if(d===-1)return o(i,Math.PI,n.orthogonal(h,c));let u=1/(1+d);return i[0]=h[0]*h[0]*u+d,i[1]=h[1]*h[0]*u-h[2],i[2]=h[2]*h[0]*u+h[1],i[3]=0,i[4]=h[0]*h[1]*u+h[2],i[5]=h[1]*h[1]*u+d,i[6]=h[2]*h[1]*u-h[0],i[7]=0,i[8]=h[0]*h[2]*u-h[1],i[9]=h[1]*h[2]*u+h[0],i[10]=h[2]*h[2]*u+d,i[11]=0,i[12]=0,i[13]=0,i[14]=0,i[15]=1,i};t.exports=r}}),sBi=At({"node_modules/@jscad/modeling/src/maths/mat4/fromXRotation.js"(e,t){var{sin:n,cos:o}=Vf(),r=(i,s)=>{let a=n(s),c=o(s);return i[0]=1,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=c,i[6]=a,i[7]=0,i[8]=0,i[9]=-a,i[10]=c,i[11]=0,i[12]=0,i[13]=0,i[14]=0,i[15]=1,i};t.exports=r}}),aBi=At({"node_modules/@jscad/modeling/src/maths/mat4/fromYRotation.js"(e,t){var{sin:n,cos:o}=Vf(),r=(i,s)=>{let a=n(s),c=o(s);return i[0]=c,i[1]=0,i[2]=-a,i[3]=0,i[4]=0,i[5]=1,i[6]=0,i[7]=0,i[8]=a,i[9]=0,i[10]=c,i[11]=0,i[12]=0,i[13]=0,i[14]=0,i[15]=1,i};t.exports=r}}),cBi=At({"node_modules/@jscad/modeling/src/maths/mat4/fromZRotation.js"(e,t){var{sin:n,cos:o}=Vf(),r=(i,s)=>{let a=n(s),c=o(s);return i[0]=c,i[1]=a,i[2]=0,i[3]=0,i[4]=-a,i[5]=c,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=1,i[11]=0,i[12]=0,i[13]=0,i[14]=0,i[15]=1,i};t.exports=r}}),lBi=At({"node_modules/@jscad/modeling/src/maths/mat4/isIdentity.js"(e,t){var n=(o)=>o[0]===1&&o[1]===0&&o[2]===0&&o[3]===0&&o[4]===0&&o[5]===1&&o[6]===0&&o[7]===0&&o[8]===0&&o[9]===0&&o[10]===1&&o[11]===0&&o[12]===0&&o[13]===0&&o[14]===0&&o[15]===1;t.exports=n}}),hBi=At({"node_modules/@jscad/modeling/src/maths/mat4/isOnlyTransformScale.js"(e,t){var n=(r)=>o(r[1])&&o(r[2])&&o(r[3])&&o(r[4])&&o(r[6])&&o(r[7])&&o(r[8])&&o(r[9])&&o(r[11])&&r[15]===1,o=(r)=>Math.abs(r)<Number.EPSILON;t.exports=n}}),dBi=At({"node_modules/@jscad/modeling/src/maths/mat4/isMirroring.js"(e,t){var n=(o)=>{let r=o[4]*o[9]-o[8]*o[5],i=o[8]*o[1]-o[0]*o[9],s=o[0]*o[5]-o[4]*o[1];return r*o[2]+i*o[6]+s*o[10]<0};t.exports=n}}),uBi=At({"node_modules/@jscad/modeling/src/maths/mat4/mirrorByPlane.js"(e,t){var n=(o,r)=>{let[i,s,a,c]=r;return o[0]=1-2*i*i,o[1]=-2*s*i,o[2]=-2*a*i,o[3]=0,o[4]=-2*i*s,o[5]=1-2*s*s,o[6]=-2*a*s,o[7]=0,o[8]=-2*i*a,o[9]=-2*s*a,o[10]=1-2*a*a,o[11]=0,o[12]=2*i*c,o[13]=2*s*c,o[14]=2*a*c,o[15]=1,o};t.exports=n}}),pBi=At({"node_modules/@jscad/modeling/src/maths/mat4/multiply.js"(e,t){var n=(o,r,i)=>{let s=r[0],a=r[1],c=r[2],l=r[3],h=r[4],d=r[5],u=r[6],_=r[7],p=r[8],m=r[9],A=r[10],g=r[11],f=r[12],y=r[13],x=r[14],C=r[15],b=i[0],I=i[1],v=i[2],P=i[3];return o[0]=b*s+I*h+v*p+P*f,o[1]=b*a+I*d+v*m+P*y,o[2]=b*c+I*u+v*A+P*x,o[3]=b*l+I*_+v*g+P*C,b=i[4],I=i[5],v=i[6],P=i[7],o[4]=b*s+I*h+v*p+P*f,o[5]=b*a+I*d+v*m+P*y,o[6]=b*c+I*u+v*A+P*x,o[7]=b*l+I*_+v*g+P*C,b=i[8],I=i[9],v=i[10],P=i[11],o[8]=b*s+I*h+v*p+P*f,o[9]=b*a+I*d+v*m+P*y,o[10]=b*c+I*u+v*A+P*x,o[11]=b*l+I*_+v*g+P*C,b=i[12],I=i[13],v=i[14],P=i[15],o[12]=b*s+I*h+v*p+P*f,o[13]=b*a+I*d+v*m+P*y,o[14]=b*c+I*u+v*A+P*x,o[15]=b*l+I*_+v*g+P*C,o};t.exports=n}}),mBi=At({"node_modules/@jscad/modeling/src/maths/mat4/rotate.js"(e,t){var{EPS:n}=fc(),{sin:o,cos:r}=Vf(),i=TWn(),s=(a,c,l,h)=>{let[d,u,_]=h,p=d*d+u*u+_*_;if(Math.abs(p)<n)return i(a,c);let m=1/Math.sqrt(p);d*=m,u*=m,_*=m;let A=o(l),g=r(l),f=1-g,y=c[0],x=c[1],C=c[2],b=c[3],I=c[4],v=c[5],P=c[6],M=c[7],B=c[8],T=c[9],N=c[10],D=c[11],L=d*d*f+g,H=u*d*f+_*A,V=_*d*f-u*A,O=d*u*f-_*A,U=u*u*f+g,j=_*u*f+d*A,Y=d*_*f+u*A,X=u*_*f-d*A,K=_*_*f+g;if(a[0]=y*L+I*H+B*V,a[1]=x*L+v*H+T*V,a[2]=C*L+P*H+N*V,a[3]=b*L+M*H+D*V,a[4]=y*O+I*U+B*j,a[5]=x*O+v*U+T*j,a[6]=C*O+P*U+N*j,a[7]=b*O+M*U+D*j,a[8]=y*Y+I*X+B*K,a[9]=x*Y+v*X+T*K,a[10]=C*Y+P*X+N*K,a[11]=b*Y+M*X+D*K,c!==a)a[12]=c[12],a[13]=c[13],a[14]=c[14],a[15]=c[15];return a};t.exports=s}}),_Bi=At({"node_modules/@jscad/modeling/src/maths/mat4/rotateX.js"(e,t){var{sin:n,cos:o}=Vf(),r=(i,s,a)=>{let c=n(a),l=o(a),h=s[4],d=s[5],u=s[6],_=s[7],p=s[8],m=s[9],A=s[10],g=s[11];if(s!==i)i[0]=s[0],i[1]=s[1],i[2]=s[2],i[3]=s[3],i[12]=s[12],i[13]=s[13],i[14]=s[14],i[15]=s[15];return i[4]=h*l+p*c,i[5]=d*l+m*c,i[6]=u*l+A*c,i[7]=_*l+g*c,i[8]=p*l-h*c,i[9]=m*l-d*c,i[10]=A*l-u*c,i[11]=g*l-_*c,i};t.exports=r}}),gBi=At({"node_modules/@jscad/modeling/src/maths/mat4/rotateY.js"(e,t){var{sin:n,cos:o}=Vf(),r=(i,s,a)=>{let c=n(a),l=o(a),h=s[0],d=s[1],u=s[2],_=s[3],p=s[8],m=s[9],A=s[10],g=s[11];if(s!==i)i[4]=s[4],i[5]=s[5],i[6]=s[6],i[7]=s[7],i[12]=s[12],i[13]=s[13],i[14]=s[14],i[15]=s[15];return i[0]=h*l-p*c,i[1]=d*l-m*c,i[2]=u*l-A*c,i[3]=_*l-g*c,i[8]=h*c+p*l,i[9]=d*c+m*l,i[10]=u*c+A*l,i[11]=_*c+g*l,i};t.exports=r}}),ABi=At({"node_modules/@jscad/modeling/src/maths/mat4/rotateZ.js"(e,t){var{sin:n,cos:o}=Vf(),r=(i,s,a)=>{let c=n(a),l=o(a),h=s[0],d=s[1],u=s[2],_=s[3],p=s[4],m=s[5],A=s[6],g=s[7];if(s!==i)i[8]=s[8],i[9]=s[9],i[10]=s[10],i[11]=s[11],i[12]=s[12],i[13]=s[13],i[14]=s[14],i[15]=s[15];return i[0]=h*l+p*c,i[1]=d*l+m*c,i[2]=u*l+A*c,i[3]=_*l+g*c,i[4]=p*l-h*c,i[5]=m*l-d*c,i[6]=A*l-u*c,i[7]=g*l-_*c,i};t.exports=r}}),fBi=At({"node_modules/@jscad/modeling/src/maths/mat4/scale.js"(e,t){var n=(o,r,i)=>{let s=i[0],a=i[1],c=i[2];return o[0]=r[0]*s,o[1]=r[1]*s,o[2]=r[2]*s,o[3]=r[3]*s,o[4]=r[4]*a,o[5]=r[5]*a,o[6]=r[6]*a,o[7]=r[7]*a,o[8]=r[8]*c,o[9]=r[9]*c,o[10]=r[10]*c,o[11]=r[11]*c,o[12]=r[12],o[13]=r[13],o[14]=r[14],o[15]=r[15],o};t.exports=n}}),yBi=At({"node_modules/@jscad/modeling/src/maths/mat4/subtract.js"(e,t){var n=(o,r,i)=>(o[0]=r[0]-i[0],o[1]=r[1]-i[1],o[2]=r[2]-i[2],o[3]=r[3]-i[3],o[4]=r[4]-i[4],o[5]=r[5]-i[5],o[6]=r[6]-i[6],o[7]=r[7]-i[7],o[8]=r[8]-i[8],o[9]=r[9]-i[9],o[10]=r[10]-i[10],o[11]=r[11]-i[11],o[12]=r[12]-i[12],o[13]=r[13]-i[13],o[14]=r[14]-i[14],o[15]=r[15]-i[15],o);t.exports=n}}),xBi=At({"node_modules/@jscad/modeling/src/maths/mat4/toString.js"(e,t){var n=(o)=>o.map((r)=>r.toFixed(7)).toString();t.exports=n}}),CBi=At({"node_modules/@jscad/modeling/src/maths/mat4/translate.js"(e,t){var n=(o,r,i)=>{let s=i[0],a=i[1],c=i[2],l,h,d,u,_,p,m,A,g,f,y,x;if(r===o)o[12]=r[0]*s+r[4]*a+r[8]*c+r[12],o[13]=r[1]*s+r[5]*a+r[9]*c+r[13],o[14]=r[2]*s+r[6]*a+r[10]*c+r[14],o[15]=r[3]*s+r[7]*a+r[11]*c+r[15];else l=r[0],h=r[1],d=r[2],u=r[3],_=r[4],p=r[5],m=r[6],A=r[7],g=r[8],f=r[9],y=r[10],x=r[11],o[0]=l,o[1]=h,o[2]=d,o[3]=u,o[4]=_,o[5]=p,o[6]=m,o[7]=A,o[8]=g,o[9]=f,o[10]=y,o[11]=x,o[12]=l*s+_*a+g*c+r[12],o[13]=h*s+p*a+f*c+r[13],o[14]=d*s+m*a+y*c+r[14],o[15]=u*s+A*a+x*c+r[15];return o};t.exports=n}}),ld=At({"node_modules/@jscad/modeling/src/maths/mat4/index.js"(e,t){t.exports={add:Rwi(),clone:Qwi(),copy:TWn(),create:Dut(),invert:kwi(),equals:Lwi(),fromRotation:NWn(),fromScaling:Hwi(),fromTaitBryanRotation:Fwi(),fromTranslation:zwi(),fromValues:Owi(),fromVectorRotation:iBi(),fromXRotation:sBi(),fromYRotation:aBi(),fromZRotation:cBi(),identity:DWn(),isIdentity:lBi(),isOnlyTransformScale:hBi(),isMirroring:dBi(),mirrorByPlane:uBi(),multiply:pBi(),rotate:mBi(),rotateX:_Bi(),rotateY:gBi(),rotateZ:ABi(),scale:fBi(),subtract:yBi(),toString:xBi(),translate:CBi()}}}),FEe=At({"node_modules/@jscad/modeling/src/geometries/geom2/create.js"(e,t){var n=ld(),o=(r)=>{if(r===void 0)r=[];return{sides:r,transforms:n.create()}};t.exports=o}}),bBi=At({"node_modules/@jscad/modeling/src/maths/vec2/abs.js"(e,t){var n=(o,r)=>(o[0]=Math.abs(r[0]),o[1]=Math.abs(r[1]),o);t.exports=n}}),IBi=At({"node_modules/@jscad/modeling/src/maths/vec2/add.js"(e,t){var n=(o,r,i)=>(o[0]=r[0]+i[0],o[1]=r[1]+i[1],o);t.exports=n}}),Rut=At({"node_modules/@jscad/modeling/src/maths/vec2/angleRadians.js"(e,t){var n=(o)=>Math.atan2(o[1],o[0]);t.exports=n}}),vBi=At({"node_modules/@jscad/modeling/src/maths/vec2/angle.js"(e,t){t.exports=Rut()}}),SBi=At({"node_modules/@jscad/modeling/src/maths/vec2/angleDegrees.js"(e,t){var n=Rut(),o=(r)=>n(r)*57.29577951308232;t.exports=o}}),zEe=At({"node_modules/@jscad/modeling/src/maths/vec2/create.js"(e,t){var n=()=>[0,0];t.exports=n}}),PBi=At({"node_modules/@jscad/modeling/src/maths/vec2/clone.js"(e,t){var n=zEe(),o=(r)=>{let i=n();return i[0]=r[0],i[1]=r[1],i};t.exports=o}}),EBi=At({"node_modules/@jscad/modeling/src/maths/vec2/copy.js"(e,t){var n=(o,r)=>(o[0]=r[0],o[1]=r[1],o);t.exports=n}}),MBi=At({"node_modules/@jscad/modeling/src/maths/vec2/cross.js"(e,t){var n=(o,r,i)=>(o[0]=0,o[1]=0,o[2]=r[0]*i[1]-r[1]*i[0],o);t.exports=n}}),wBi=At({"node_modules/@jscad/modeling/src/maths/vec2/distance.js"(e,t){var n=(o,r)=>{let i=r[0]-o[0],s=r[1]-o[1];return Math.sqrt(i*i+s*s)};t.exports=n}}),BBi=At({"node_modules/@jscad/modeling/src/maths/vec2/divide.js"(e,t){var n=(o,r,i)=>(o[0]=r[0]/i[0],o[1]=r[1]/i[1],o);t.exports=n}}),TBi=At({"node_modules/@jscad/modeling/src/maths/vec2/dot.js"(e,t){var n=(o,r)=>o[0]*r[0]+o[1]*r[1];t.exports=n}}),DBi=At({"node_modules/@jscad/modeling/src/maths/vec2/equals.js"(e,t){var n=(o,r)=>o[0]===r[0]&&o[1]===r[1];t.exports=n}}),GWn=At({"node_modules/@jscad/modeling/src/maths/vec2/fromAngleRadians.js"(e,t){var{sin:n,cos:o}=Vf(),r=(i,s)=>(i[0]=o(s),i[1]=n(s),i);t.exports=r}}),NBi=At({"node_modules/@jscad/modeling/src/maths/vec2/fromAngleDegrees.js"(e,t){var n=GWn(),o=(r,i)=>n(r,i*0.017453292519943295);t.exports=o}}),RBi=At({"node_modules/@jscad/modeling/src/maths/vec2/fromScalar.js"(e,t){var n=(o,r)=>(o[0]=r,o[1]=r,o);t.exports=n}}),QBi=At({"node_modules/@jscad/modeling/src/maths/vec2/fromValues.js"(e,t){var n=zEe(),o=(r,i)=>{let s=n();return s[0]=r,s[1]=i,s};t.exports=o}}),kBi=At({"node_modules/@jscad/modeling/src/maths/vec2/length.js"(e,t){var n=(o)=>Math.sqrt(o[0]*o[0]+o[1]*o[1]);t.exports=n}}),LBi=At({"node_modules/@jscad/modeling/src/maths/vec2/lerp.js"(e,t){var n=(o,r,i,s)=>{let a=r[0],c=r[1];return o[0]=a+s*(i[0]-a),o[1]=c+s*(i[1]-c),o};t.exports=n}}),HBi=At({"node_modules/@jscad/modeling/src/maths/vec2/max.js"(e,t){var n=(o,r,i)=>(o[0]=Math.max(r[0],i[0]),o[1]=Math.max(r[1],i[1]),o);t.exports=n}}),FBi=At({"node_modules/@jscad/modeling/src/maths/vec2/min.js"(e,t){var n=(o,r,i)=>(o[0]=Math.min(r[0],i[0]),o[1]=Math.min(r[1],i[1]),o);t.exports=n}}),zBi=At({"node_modules/@jscad/modeling/src/maths/vec2/multiply.js"(e,t){var n=(o,r,i)=>(o[0]=r[0]*i[0],o[1]=r[1]*i[1],o);t.exports=n}}),OBi=At({"node_modules/@jscad/modeling/src/maths/vec2/negate.js"(e,t){var n=(o,r)=>(o[0]=-r[0],o[1]=-r[1],o);t.exports=n}}),UWn=At({"node_modules/@jscad/modeling/src/maths/vec2/rotate.js"(e,t){var n=(o,r,i,s)=>{let a=r[0]-i[0],c=r[1]-i[1],l=Math.cos(s),h=Math.sin(s);return o[0]=a*l-c*h+i[0],o[1]=a*h+c*l+i[1],o};t.exports=n}}),VBi=At({"node_modules/@jscad/modeling/src/maths/vec2/normal.js"(e,t){var{TAU:n}=fc(),o=zEe(),r=UWn(),i=(s,a)=>r(s,a,o(),n/4);t.exports=i}}),YBi=At({"node_modules/@jscad/modeling/src/maths/vec2/normalize.js"(e,t){var n=(o,r)=>{let i=r[0],s=r[1],a=i*i+s*s;if(a>0)a=1/Math.sqrt(a);return o[0]=i*a,o[1]=s*a,o};t.exports=n}}),GBi=At({"node_modules/@jscad/modeling/src/maths/vec2/scale.js"(e,t){var n=(o,r,i)=>(o[0]=r[0]*i,o[1]=r[1]*i,o);t.exports=n}}),UBi=At({"node_modules/@jscad/modeling/src/maths/vec2/snap.js"(e,t){var n=(o,r,i)=>(o[0]=Math.round(r[0]/i)*i+0,o[1]=Math.round(r[1]/i)*i+0,o);t.exports=n}}),WBi=At({"node_modules/@jscad/modeling/src/maths/vec2/squaredDistance.js"(e,t){var n=(o,r)=>{let i=r[0]-o[0],s=r[1]-o[1];return i*i+s*s};t.exports=n}}),XBi=At({"node_modules/@jscad/modeling/src/maths/vec2/squaredLength.js"(e,t){var n=(o)=>{let r=o[0],i=o[1];return r*r+i*i};t.exports=n}}),jBi=At({"node_modules/@jscad/modeling/src/maths/vec2/subtract.js"(e,t){var n=(o,r,i)=>(o[0]=r[0]-i[0],o[1]=r[1]-i[1],o);t.exports=n}}),KBi=At({"node_modules/@jscad/modeling/src/maths/vec2/toString.js"(e,t){var n=(o)=>`[${o[0].toFixed(7)}, ${o[1].toFixed(7)}]`;t.exports=n}}),$Bi=At({"node_modules/@jscad/modeling/src/maths/vec2/transform.js"(e,t){var n=(o,r,i)=>{let s=r[0],a=r[1];return o[0]=i[0]*s+i[4]*a+i[12],o[1]=i[1]*s+i[5]*a+i[13],o};t.exports=n}}),ya=At({"node_modules/@jscad/modeling/src/maths/vec2/index.js"(e,t){t.exports={abs:bBi(),add:IBi(),angle:vBi(),angleDegrees:SBi(),angleRadians:Rut(),clone:PBi(),copy:EBi(),create:zEe(),cross:MBi(),distance:wBi(),divide:BBi(),dot:TBi(),equals:DBi(),fromAngleDegrees:NBi(),fromAngleRadians:GWn(),fromScalar:RBi(),fromValues:QBi(),length:kBi(),lerp:LBi(),max:HBi(),min:FBi(),multiply:zBi(),negate:OBi(),normal:VBi(),normalize:YBi(),rotate:UWn(),scale:GBi(),snap:UBi(),squaredDistance:WBi(),squaredLength:XBi(),subtract:jBi(),toString:KBi(),transform:$Bi()}}}),qBi=At({"node_modules/@jscad/modeling/src/geometries/geom2/fromPoints.js"(e,t){var n=ya(),o=FEe(),r=(i)=>{if(!Array.isArray(i))throw Error("the given points must be an array");let s=i.length;if(s<3)throw Error("the given points must define a closed geometry with three or more points");if(n.equals(i[0],i[s-1]))--s;let a=[],c=i[s-1];for(let l=0;l<s;l++){let h=i[l];a.push([n.clone(c),n.clone(h)]),c=h}return o(a)};t.exports=r}}),JBi=At({"node_modules/@jscad/modeling/src/geometries/geom2/fromCompactBinary.js"(e,t){var n=ld(),o=ya(),r=FEe(),i=(s)=>{if(s[0]!==0)throw Error("invalid compact binary data");let a=r();a.transforms=n.clone(s.slice(1,17));for(let c=21;c<s.length;c+=4){let l=o.fromValues(s[c+0],s[c+1]),h=o.fromValues(s[c+2],s[c+3]);a.sides.push([l,h])}if(s[17]>=0)a.color=[s[17],s[18],s[19],s[20]];return a};t.exports=i}}),WWn=At({"node_modules/@jscad/modeling/src/geometries/geom2/isA.js"(e,t){var n=(o)=>{if(o&&typeof o==="object"){if("sides"in o&&"transforms"in o){if(Array.isArray(o.sides)&&"length"in o.transforms)return!0}}return!1};t.exports=n}}),ZBi=At({"node_modules/@jscad/modeling/src/geometries/geom2/applyTransforms.js"(e,t){var n=ld(),o=ya(),r=(i)=>{if(n.isIdentity(i.transforms))return i;return i.sides=i.sides.map((s)=>{let a=o.transform(o.create(),s[0],i.transforms),c=o.transform(o.create(),s[1],i.transforms);return[a,c]}),i.transforms=n.create(),i};t.exports=r}}),Spe=At({"node_modules/@jscad/modeling/src/geometries/geom2/toSides.js"(e,t){var n=ZBi(),o=(r)=>n(r).sides;t.exports=o}}),XWn=At({"node_modules/@jscad/modeling/src/geometries/geom2/reverse.js"(e,t){var n=FEe(),o=Spe(),r=(i)=>{let a=o(i).map((c)=>[c[1],c[0]]);return a.reverse(),n(a)};t.exports=r}}),jWn=At({"node_modules/@jscad/modeling/src/geometries/geom2/toOutlines.js"(e,t){var n=ya(),o=Spe(),r=(c)=>{let l=new Map,h=(d)=>{let u=d.toString();if(l.has(u))return l.get(u);else return l.set(u,d),d};return c.map((d)=>d.map(h))},i=(c)=>{let l=new Map;return r(c).forEach((d)=>{if(l.has(d[0]))l.get(d[0]).push(d);else l.set(d[0],[d])}),l},s=(c)=>{let l=i(o(c)),h=[];while(!0){let d;for(let[p,m]of l){if(d=m.shift(),!d){l.delete(p);continue}break}if(d===void 0)break;let u=[],_=d[0];while(!0){u.push(d[0]);let p=d[1];if(p===_)break;let m=l.get(p);if(!m)throw Error(`geometry is not closed at vertex ${p}`);let A=a(d,m);if(m.length===0)l.delete(p);d=A}if(u.length>0)u.push(u.shift());h.push(u)}return l.clear(),h},a=(c,l)=>{if(l.length===1)return l.pop();let h=n.create(),d=n.angleDegrees(n.subtract(h,c[1],c[0])),u,_;l.forEach((m,A)=>{let f=n.angleDegrees(n.subtract(h,m[1],m[0]))-d;if(f<-180)f+=360;if(f>=180)f-=360;if(_===void 0||f>u)_=A,u=f});let p=l[_];return l.splice(_,1),p};t.exports=s}}),eTi=At({"node_modules/@jscad/modeling/src/geometries/geom2/toPoints.js"(e,t){var n=Spe(),o=(r)=>{let s=n(r).map((a)=>a[0]);if(s.length>0)s.push(s.shift());return s};t.exports=o}}),tTi=At({"node_modules/@jscad/modeling/src/geometries/geom2/toString.js"(e,t){var n=ya(),o=Spe(),r=(i)=>{let s=o(i),a="geom2 ("+s.length+` sides):
[
`;return s.forEach((c)=>{a+="  ["+n.toString(c[0])+", "+n.toString(c[1])+`]
`}),a+=`]
`,a};t.exports=r}}),nTi=At({"node_modules/@jscad/modeling/src/geometries/geom2/toCompactBinary.js"(e,t){var n=(o)=>{let{sides:r,transforms:i}=o,s=[-1,-1,-1,-1];if(o.color)s=o.color;let a=new Float32Array(21+r.length*4);a[0]=0,a[1]=i[0],a[2]=i[1],a[3]=i[2],a[4]=i[3],a[5]=i[4],a[6]=i[5],a[7]=i[6],a[8]=i[7],a[9]=i[8],a[10]=i[9],a[11]=i[10],a[12]=i[11],a[13]=i[12],a[14]=i[13],a[15]=i[14],a[16]=i[15],a[17]=s[0],a[18]=s[1],a[19]=s[2],a[20]=s[3];for(let c=0;c<r.length;c++){let l=c*4+21,h=r[c][0],d=r[c][1];a[l+0]=h[0],a[l+1]=h[1],a[l+2]=d[0],a[l+3]=d[1]}return a};t.exports=n}}),oTi=At({"node_modules/@jscad/modeling/src/geometries/geom2/transform.js"(e,t){var n=ld(),o=XWn(),r=(i,s)=>{let a=n.multiply(n.create(),i,s.transforms),c=Object.assign({},s,{transforms:a});if(i[0]*i[5]-i[4]*i[1]<0)return o(c);return c};t.exports=r}}),rTi=At({"node_modules/@jscad/modeling/src/geometries/geom2/validate.js"(e,t){var n=ya(),o=WWn(),r=jWn(),i=(s)=>{if(!o(s))throw Error("invalid geom2 structure");if(r(s),s.sides.forEach((a)=>{if(n.equals(a[0],a[1]))throw Error(`geom2 self-edge ${a[0]}`)}),!s.transforms.every(Number.isFinite))throw Error(`geom2 invalid transforms ${s.transforms}`)};t.exports=i}}),qs=At({"node_modules/@jscad/modeling/src/geometries/geom2/index.js"(e,t){t.exports={clone:Nwi(),create:FEe(),fromPoints:qBi(),fromCompactBinary:JBi(),isA:WWn(),reverse:XWn(),toOutlines:jWn(),toPoints:eTi(),toSides:Spe(),toString:tTi(),toCompactBinary:nTi(),transform:oTi(),validate:rTi()}}}),iTi=At({"node_modules/@jscad/modeling/src/geometries/geom3/clone.js"(e,t){var n=(o)=>Object.assign({},o);t.exports=n}}),Ppe=At({"node_modules/@jscad/modeling/src/geometries/geom3/create.js"(e,t){var n=ld(),o=(r)=>{if(r===void 0)r=[];return{polygons:r,transforms:n.create()}};t.exports=o}}),sTi=At({"node_modules/@jscad/modeling/src/operations/hulls/quickhull/point-line-distance.js"(e,t){var n=vpe(),o=HEe(),r=YWn(),i=(a,c,l)=>{let h=[],d=[],u=[];o(h,l,c),o(d,a,c);let _=r(n(u,d,h)),p=r(h);if(p===0)throw Error("a and b are the same point");return _/p},s=(a,c,l)=>Math.sqrt(i(a,c,l));t.exports=s}}),aTi=At({"node_modules/@jscad/modeling/src/operations/hulls/quickhull/get-plane-normal.js"(e,t){var n=vpe(),o=Nut(),r=HEe(),i=(s,a,c,l)=>{let h=[0,0,0];return r(s,a,c),r(h,c,l),n(s,s,h),o(s,s)};t.exports=i}}),cTi=At({"node_modules/@jscad/modeling/src/operations/hulls/quickhull/VertexList.js"(e,t){var n=class{constructor(){this.head=null,this.tail=null}clear(){this.head=this.tail=null}insertBefore(o,r){if(r.prev=o.prev,r.next=o,!r.prev)this.head=r;else r.prev.next=r;o.prev=r}insertAfter(o,r){if(r.prev=o,r.next=o.next,!r.next)this.tail=r;else r.next.prev=r;o.next=r}add(o){if(!this.head)this.head=o;else this.tail.next=o;o.prev=this.tail,o.next=null,this.tail=o}addAll(o){if(!this.head)this.head=o;else this.tail.next=o;o.prev=this.tail;while(o.next)o=o.next;this.tail=o}remove(o){if(!o.prev)this.head=o.next;else o.prev.next=o.next;if(!o.next)this.tail=o.prev;else o.next.prev=o.prev}removeChain(o,r){if(!o.prev)this.head=r.next;else o.prev.next=r.next;if(!r.next)this.tail=o.prev;else r.next.prev=o.prev}first(){return this.head}isEmpty(){return!this.head}};t.exports=n}}),lTi=At({"node_modules/@jscad/modeling/src/operations/hulls/quickhull/Vertex.js"(e,t){var n=class{constructor(o,r){this.point=o,this.index=r,this.next=null,this.prev=null,this.face=null}};t.exports=n}}),hTi=At({"node_modules/@jscad/modeling/src/operations/hulls/quickhull/HalfEdge.js"(e,t){var n=LWn(),o=VWn(),r=class{constructor(i,s){this.vertex=i,this.face=s,this.next=null,this.prev=null,this.opposite=null}head(){return this.vertex}tail(){return this.prev?this.prev.vertex:null}length(){if(this.tail())return n(this.tail().point,this.head().point);return-1}lengthSquared(){if(this.tail())return o(this.tail().point,this.head().point);return-1}setOpposite(i){this.opposite=i,i.opposite=this}};t.exports=r}}),dTi=At({"node_modules/@jscad/modeling/src/operations/hulls/quickhull/Face.js"(e,t){var n=QWn(),o=kWn(),r=vpe(),i=kEe(),s=HWn(),a=Nut(),c=OWn(),l=HEe(),h=hTi(),d=0,u=1,_=2,p=class m{constructor(){this.normal=[],this.centroid=[],this.offset=0,this.outside=null,this.mark=d,this.edge=null,this.nVertices=0}getEdge(A){if(typeof A!=="number")throw Error("requires a number");let g=this.edge;while(A>0)g=g.next,A-=1;while(A<0)g=g.prev,A+=1;return g}computeNormal(){let A=this.edge,g=A.next,f=g.next,y=l([],g.head().point,A.head().point),x=[],C=[];this.nVertices=2,this.normal=[0,0,0];while(f!==A)o(C,y),l(y,f.head().point,A.head().point),n(this.normal,this.normal,r(x,C,y)),f=f.next,this.nVertices+=1;this.area=s(this.normal),this.normal=c(this.normal,this.normal,1/this.area)}computeNormalMinArea(A){if(this.computeNormal(),this.area<A){let g,f=0,y=this.edge;do{let P=y.lengthSquared();if(P>f)g=y,f=P;y=y.next}while(y!==this.edge);let x=g.tail().point,C=g.head().point,b=l([],C,x),I=Math.sqrt(f);c(b,b,1/I);let v=i(this.normal,b);c(b,b,-v),n(this.normal,this.normal,b),a(this.normal,this.normal)}}computeCentroid(){this.centroid=[0,0,0];let A=this.edge;do n(this.centroid,this.centroid,A.head().point),A=A.next;while(A!==this.edge);c(this.centroid,this.centroid,1/this.nVertices)}computeNormalAndCentroid(A){if(typeof A<"u")this.computeNormalMinArea(A);else this.computeNormal();this.computeCentroid(),this.offset=i(this.normal,this.centroid)}distanceToPlane(A){return i(this.normal,A)-this.offset}connectHalfEdges(A,g){let f;if(A.opposite.face===g.opposite.face){let y=g.opposite.face,x;if(A===this.edge)this.edge=g;if(y.nVertices===3)x=g.opposite.prev.opposite,y.mark=_,f=y;else{if(x=g.opposite.next,y.edge===x.prev)y.edge=x;x.prev=x.prev.prev,x.prev.next=x}g.prev=A.prev,g.prev.next=g,g.setOpposite(x),y.computeNormalAndCentroid()}else A.next=g,g.prev=A;return f}mergeAdjacentFaces(A,g){let f=A.opposite,y=f.face;g.push(y),y.mark=_;let{prev:x,next:C}=A,{prev:b,next:I}=f;while(x.opposite.face===y)x=x.prev,I=I.next;while(C.opposite.face===y)C=C.next,b=b.prev;let v;for(v=I;v!==b.next;v=v.next)v.face=this;this.edge=C;let P;if(P=this.connectHalfEdges(b,C),P)g.push(P);if(P=this.connectHalfEdges(x,I),P)g.push(P);return this.computeNormalAndCentroid(),g}collectIndices(){let A=[],g=this.edge;do A.push(g.head().index),g=g.next;while(g!==this.edge);return A}static createTriangle(A,g,f,y=0){let x=new m,C=new h(A,x),b=new h(g,x),I=new h(f,x);return C.next=I.prev=b,b.next=C.prev=I,I.next=b.prev=C,x.edge=C,x.computeNormalAndCentroid(y),x}};t.exports={VISIBLE:d,NON_CONVEX:u,DELETED:_,Face:p}}}),uTi=At({"node_modules/@jscad/modeling/src/operations/hulls/quickhull/QuickHull.js"(e,t){var n=kEe(),o=sTi(),r=aTi(),i=cTi(),s=lTi(),{Face:a,VISIBLE:c,NON_CONVEX:l,DELETED:h}=dTi(),d=1,u=2,_=class{constructor(p){if(!Array.isArray(p))throw TypeError("input is not a valid array");if(p.length<4)throw Error("cannot build a simplex out of <4 points");this.tolerance=-1,this.nFaces=0,this.nPoints=p.length,this.faces=[],this.newFaces=[],this.claimed=new i,this.unclaimed=new i,this.vertices=[];for(let m=0;m<p.length;m+=1)this.vertices.push(new s(p[m],m));this.discardedFaces=[],this.vertexPointIndices=[]}addVertexToFace(p,m){if(p.face=m,!m.outside)this.claimed.add(p);else this.claimed.insertBefore(m.outside,p);m.outside=p}removeVertexFromFace(p,m){if(p===m.outside)if(p.next&&p.next.face===m)m.outside=p.next;else m.outside=null;this.claimed.remove(p)}removeAllVerticesFromFace(p){if(p.outside){let m=p.outside;while(m.next&&m.next.face===p)m=m.next;return this.claimed.removeChain(p.outside,m),m.next=null,p.outside}}deleteFaceVertices(p,m){let A=this.removeAllVerticesFromFace(p);if(A)if(!m)this.unclaimed.addAll(A);else{let g;for(let f=A;f;f=g)if(g=f.next,m.distanceToPlane(f.point)>this.tolerance)this.addVertexToFace(f,m);else this.unclaimed.add(f)}}resolveUnclaimedPoints(p){let m=this.unclaimed.first();for(let A=m;A;A=m){m=A.next;let g=this.tolerance,f;for(let y=0;y<p.length;y+=1){let x=p[y];if(x.mark===c){let C=x.distanceToPlane(A.point);if(C>g)g=C,f=x;if(g>1000*this.tolerance)break}}if(f)this.addVertexToFace(A,f)}}computeExtremes(){let p=[],m=[],A=[],g=[],f,y;for(f=0;f<3;f+=1)A[f]=g[f]=this.vertices[0];for(f=0;f<3;f+=1)p[f]=m[f]=this.vertices[0].point[f];for(f=1;f<this.vertices.length;f+=1){let x=this.vertices[f],C=x.point;for(y=0;y<3;y+=1)if(C[y]<p[y])p[y]=C[y],A[y]=x;for(y=0;y<3;y+=1)if(C[y]>m[y])m[y]=C[y],g[y]=x}return this.tolerance=3*Number.EPSILON*(Math.max(Math.abs(p[0]),Math.abs(m[0]))+Math.max(Math.abs(p[1]),Math.abs(m[1]))+Math.max(Math.abs(p[2]),Math.abs(m[2]))),[A,g]}createInitialSimplex(){let p=this.vertices,[m,A]=this.computeExtremes(),g,f,y,x,C=0,b=0;for(y=0;y<3;y+=1){let T=A[y].point[y]-m[y].point[y];if(T>C)C=T,b=y}let I=m[b],v=A[b];C=0;for(y=0;y<this.vertices.length;y+=1){let T=this.vertices[y];if(T!==I&&T!==v){let N=o(T.point,I.point,v.point);if(N>C)C=N,g=T}}let P=r([],I.point,v.point,g.point),M=n(I.point,P);C=-1;for(y=0;y<this.vertices.length;y+=1){let T=this.vertices[y];if(T!==I&&T!==v&&T!==g){let N=Math.abs(n(P,T.point)-M);if(N>C)C=N,f=T}}let B=[];if(n(f.point,P)-M<0){B.push(a.createTriangle(I,v,g),a.createTriangle(f,v,I),a.createTriangle(f,g,v),a.createTriangle(f,I,g));for(y=0;y<3;y+=1){let T=(y+1)%3;B[y+1].getEdge(2).setOpposite(B[0].getEdge(T)),B[y+1].getEdge(1).setOpposite(B[T+1].getEdge(0))}}else{B.push(a.createTriangle(I,g,v),a.createTriangle(f,I,v),a.createTriangle(f,v,g),a.createTriangle(f,g,I));for(y=0;y<3;y+=1){let T=(y+1)%3;B[y+1].getEdge(2).setOpposite(B[0].getEdge((3-y)%3)),B[y+1].getEdge(0).setOpposite(B[T+1].getEdge(1))}}for(y=0;y<4;y+=1)this.faces.push(B[y]);for(y=0;y<p.length;y+=1){let T=p[y];if(T!==I&&T!==v&&T!==g&&T!==f){C=this.tolerance;let N;for(x=0;x<4;x+=1){let D=B[x].distanceToPlane(T.point);if(D>C)C=D,N=B[x]}if(N)this.addVertexToFace(T,N)}}}reindexFaceAndVertices(){let p=[];for(let m=0;m<this.faces.length;m+=1){let A=this.faces[m];if(A.mark===c)p.push(A)}this.faces=p}collectFaces(p){let m=[];for(let A=0;A<this.faces.length;A+=1){if(this.faces[A].mark!==c)throw Error("attempt to include a destroyed face in the hull");let g=this.faces[A].collectIndices();if(p)m.push(g);else for(let f=0;f<g.length-2;f+=1)m.push([g[0],g[f+1],g[f+2]])}return m}nextVertexToAdd(){if(!this.claimed.isEmpty()){let p,m,A=0,g=this.claimed.first().face;for(m=g.outside;m&&m.face===g;m=m.next){let f=g.distanceToPlane(m.point);if(f>A)A=f,p=m}return p}}computeHorizon(p,m,A,g){this.deleteFaceVertices(A),A.mark=h;let f;if(!m)f=m=A.getEdge(0);else f=m.next;do{let y=f.opposite,x=y.face;if(x.mark===c)if(x.distanceToPlane(p)>this.tolerance)this.computeHorizon(p,y,x,g);else g.push(f);f=f.next}while(f!==m)}addAdjoiningFace(p,m){let A=a.createTriangle(p,m.tail(),m.head());return this.faces.push(A),A.getEdge(-1).setOpposite(m.opposite),A.getEdge(0)}addNewFaces(p,m){this.newFaces=[];let A,g;for(let f=0;f<m.length;f+=1){let y=m[f],x=this.addAdjoiningFace(p,y);if(!A)A=x;else x.next.setOpposite(g);this.newFaces.push(x.face),g=x}A.next.setOpposite(g)}oppositeFaceDistance(p){return p.face.distanceToPlane(p.opposite.face.centroid)}doAdjacentMerge(p,m){let A=p.edge,g=!0,f=0;do{if(f>=p.nVertices)throw Error("merge recursion limit exceeded");let y=A.opposite.face,x=!1;if(m===u){if(this.oppositeFaceDistance(A)>-this.tolerance||this.oppositeFaceDistance(A.opposite)>-this.tolerance)x=!0}else if(p.area>y.area){if(this.oppositeFaceDistance(A)>-this.tolerance)x=!0;else if(this.oppositeFaceDistance(A.opposite)>-this.tolerance)g=!1}else if(this.oppositeFaceDistance(A.opposite)>-this.tolerance)x=!0;else if(this.oppositeFaceDistance(A)>-this.tolerance)g=!1;if(x){let C=p.mergeAdjacentFaces(A,[]);for(let b=0;b<C.length;b+=1)this.deleteFaceVertices(C[b],p);return!0}A=A.next,f+=1}while(A!==p.edge);if(!g)p.mark=l;return!1}addVertexToHull(p){let m=[];this.unclaimed.clear(),this.removeVertexFromFace(p,p.face),this.computeHorizon(p.point,null,p.face,m),this.addNewFaces(p,m);for(let A=0;A<this.newFaces.length;A+=1){let g=this.newFaces[A];if(g.mark===c)while(this.doAdjacentMerge(g,d));}for(let A=0;A<this.newFaces.length;A+=1){let g=this.newFaces[A];if(g.mark===l){g.mark=c;while(this.doAdjacentMerge(g,u));}}this.resolveUnclaimedPoints(this.newFaces)}build(){let p;this.createInitialSimplex();while(p=this.nextVertexToAdd())this.addVertexToHull(p);this.reindexFaceAndVertices()}};t.exports=_}}),KWn=At({"node_modules/@jscad/modeling/src/operations/hulls/quickhull/index.js"(e,t){var n=uTi(),o=(r,i={})=>{let s=new n(r);return s.build(),s.collectFaces(i.skipTriangulation)};t.exports=o}}),Zee=At({"node_modules/@jscad/modeling/src/geometries/poly3/create.js"(e,t){var n=(o)=>{if(o===void 0||o.length<3)o=[];return{vertices:o}};t.exports=n}}),pTi=At({"node_modules/@jscad/modeling/src/geometries/poly3/clone.js"(e,t){var n=Zee(),o=ui(),r=(...i)=>{let s,a;if(i.length===1)s=n(),a=i[0];else s=i[0],a=i[1];return s.vertices=a.vertices.map((c)=>o.clone(c)),s};t.exports=r}}),mTi=At({"node_modules/@jscad/modeling/src/geometries/poly3/fromPoints.js"(e,t){var n=ui(),o=Zee(),r=(i)=>{let s=i.map((a)=>n.clone(a));return o(s)};t.exports=r}}),_Ti=At({"node_modules/@jscad/modeling/src/geometries/poly3/fromPointsAndPlane.js"(e,t){var n=Zee(),o=(r,i)=>{let s=n(r);return s.plane=i,s};t.exports=o}}),OEe=At({"node_modules/@jscad/modeling/src/maths/vec4/create.js"(e,t){var n=()=>[0,0,0,0];t.exports=n}}),$Wn=At({"node_modules/@jscad/modeling/src/maths/vec4/clone.js"(e,t){var n=OEe(),o=(r)=>{let i=n();return i[0]=r[0],i[1]=r[1],i[2]=r[2],i[3]=r[3],i};t.exports=o}}),qWn=At({"node_modules/@jscad/modeling/src/maths/vec4/copy.js"(e,t){var n=(o,r)=>(o[0]=r[0],o[1]=r[1],o[2]=r[2],o[3]=r[3],o);t.exports=n}}),JWn=At({"node_modules/@jscad/modeling/src/maths/vec4/equals.js"(e,t){var n=(o,r)=>o[0]===r[0]&&o[1]===r[1]&&o[2]===r[2]&&o[3]===r[3];t.exports=n}}),ZWn=At({"node_modules/@jscad/modeling/src/maths/plane/flip.js"(e,t){var n=(o,r)=>(o[0]=-r[0],o[1]=-r[1],o[2]=-r[2],o[3]=-r[3],o);t.exports=n}}),eXn=At({"node_modules/@jscad/modeling/src/maths/plane/fromNormalAndPoint.js"(e,t){var n=ui(),o=(r,i,s)=>{let a=n.normalize(n.create(),i),c=n.dot(s,a);return r[0]=a[0],r[1]=a[1],r[2]=a[2],r[3]=c,r};t.exports=o}}),tXn=At({"node_modules/@jscad/modeling/src/maths/vec4/fromValues.js"(e,t){var n=OEe(),o=(r,i,s,a)=>{let c=n();return c[0]=r,c[1]=i,c[2]=s,c[3]=a,c};t.exports=o}}),gTi=At({"node_modules/@jscad/modeling/src/maths/plane/fromNoisyPoints.js"(e,t){var n=ui(),o=eXn(),r=(i,...s)=>{i[0]=0,i[1]=0,i[2]=0,i[3]=0;let a=s.length;s.forEach((f)=>{n.add(i,i,f)}),n.scale(i,i,1/a);let c=0,l=0,h=0,d=0,u=0,_=0,p=n.create();s.forEach((f)=>{n.subtract(p,f,i),c+=p[0]*p[0],l+=p[0]*p[1],h+=p[0]*p[2],d+=p[1]*p[1],u+=p[1]*p[2],_+=p[2]*p[2]}),c/=a,l/=a,h/=a,d/=a,u/=a,_/=a,p[0]=0,p[1]=0,p[2]=0;let m=n.create(),A=d*_-u*u;m[0]=A,m[1]=h*u-l*_,m[2]=l*u-h*d;let g=A*A;if(n.add(p,p,n.scale(m,m,g)),A=c*_-h*h,m[0]=h*u-l*_,m[1]=A,m[2]=l*h-u*c,g=A*A,n.dot(p,m)<0)g=-g;if(n.add(p,p,n.scale(m,m,g)),A=c*d-l*l,m[0]=l*u-h*d,m[1]=l*h-u*c,m[2]=A,g=A*A,n.dot(p,m)<0)g=-g;return n.add(p,p,n.scale(m,m,g)),o(i,p,i)};t.exports=r}}),nXn=At({"node_modules/@jscad/modeling/src/maths/plane/fromPoints.js"(e,t){var n=ui(),o=(r,...i)=>{let s=i.length,a=n.create(),c=n.create(),l=(h)=>{let d=i[h],u=i[(h+1)%s],_=i[(h+2)%s];return n.subtract(a,u,d),n.subtract(c,_,d),n.cross(a,a,c),n.normalize(a,a),a};if(r[0]=0,r[1]=0,r[2]=0,s===3)n.copy(r,l(0));else i.forEach((h,d)=>{n.add(r,r,l(d))}),n.normalize(r,r);return r[3]=n.dot(r,i[0]),r};t.exports=o}}),ATi=At({"node_modules/@jscad/modeling/src/maths/plane/fromPointsRandom.js"(e,t){var{EPS:n}=fc(),o=ui(),r=(i,s,a,c)=>{let l=o.subtract(o.create(),a,s),h=o.subtract(o.create(),c,s);if(o.length(l)<n)l=o.orthogonal(l,h);if(o.length(h)<n)h=o.orthogonal(h,l);let d=o.cross(o.create(),l,h);if(o.length(d)<n)h=o.orthogonal(h,l),d=o.cross(d,l,h);d=o.normalize(d,d);let u=o.dot(d,s);return i[0]=d[0],i[1]=d[1],i[2]=d[2],i[3]=u,i};t.exports=r}}),fTi=At({"node_modules/@jscad/modeling/src/maths/plane/projectionOfPoint.js"(e,t){var n=ui(),o=(r,i)=>{let s=i[0]*r[0]+i[1]*r[1]+i[2]*r[2]-r[3],a=i[0]-s*r[0],c=i[1]-s*r[1],l=i[2]-s*r[2];return n.fromValues(a,c,l)};t.exports=o}}),oXn=At({"node_modules/@jscad/modeling/src/maths/plane/signedDistanceToPoint.js"(e,t){var n=ui(),o=(r,i)=>n.dot(r,i)-r[3];t.exports=o}}),rXn=At({"node_modules/@jscad/modeling/src/maths/vec4/toString.js"(e,t){var n=(o)=>`(${o[0].toFixed(9)}, ${o[1].toFixed(9)}, ${o[2].toFixed(9)}, ${o[3].toFixed(9)})`;t.exports=n}}),yTi=At({"node_modules/@jscad/modeling/src/maths/plane/transform.js"(e,t){var n=ld(),o=ui(),r=nXn(),i=ZWn(),s=(a,c,l)=>{let h=n.isMirroring(l),d=o.orthogonal(o.create(),c),u=o.cross(d,c,d),_=o.cross(o.create(),c,u),p=o.fromScalar(o.create(),c[3]);o.multiply(p,p,c);let m=o.add(o.create(),p,u),A=o.add(o.create(),p,_);if(p=o.transform(p,p,l),m=o.transform(m,m,l),A=o.transform(A,A,l),r(a,p,m,A),h)i(a,a);return a};t.exports=s}}),EP=At({"node_modules/@jscad/modeling/src/maths/plane/index.js"(e,t){t.exports={clone:$Wn(),copy:qWn(),create:OEe(),equals:JWn(),flip:ZWn(),fromNormalAndPoint:eXn(),fromValues:tXn(),fromNoisyPoints:gTi(),fromPoints:nXn(),fromPointsRandom:ATi(),projectionOfPoint:fTi(),signedDistanceToPoint:oXn(),toString:rXn(),transform:yTi()}}}),xTi=At({"node_modules/@jscad/modeling/src/geometries/poly3/invert.js"(e,t){var n=EP(),o=Zee(),r=(i)=>{let s=i.vertices.slice().reverse(),a=o(s);if(i.plane)a.plane=n.flip(n.create(),i.plane);return a};t.exports=r}}),iXn=At({"node_modules/@jscad/modeling/src/geometries/poly3/isA.js"(e,t){var n=(o)=>{if(o&&typeof o==="object"){if("vertices"in o){if(Array.isArray(o.vertices))return!0}}return!1};t.exports=n}}),sXn=At({"node_modules/@jscad/modeling/src/geometries/poly3/isConvex.js"(e,t){var n=EP(),o=ui(),r=(a)=>i(a.vertices),i=(a)=>{let c=a.length;if(c>2){let l=n.fromPoints(n.create(),...a),h=a[c-2],d=a[c-1];for(let u=0;u<c;u++){let _=a[u];if(!s(h,d,_,l))return!1;h=d,d=_}}return!0},s=(a,c,l,h)=>{let d=o.cross(o.create(),o.subtract(o.create(),c,a),o.subtract(o.create(),l,c));return o.dot(d,h)>=0};t.exports=r}}),Qut=At({"node_modules/@jscad/modeling/src/geometries/poly3/plane.js"(e,t){var n=EP(),o=(r)=>{if(!r.plane)r.plane=n.fromPoints(n.create(),...r.vertices);return r.plane};t.exports=o}}),aXn=At({"node_modules/@jscad/modeling/src/geometries/poly3/measureArea.js"(e,t){var n=Qut(),o=(r)=>{let i=r.vertices.length;if(i<3)return 0;let s=r.vertices,a=n(r),c=Math.abs(a[0]),l=Math.abs(a[1]),h=Math.abs(a[2]);if(c+l+h===0)return 0;let d=3;if(c>l&&c>h)d=1;else if(l>h)d=2;let u=0,_=0,p=1,m=2;switch(d){case 1:for(p=1;p<i;p++)_=p-1,m=(p+1)%i,u+=s[p][1]*(s[m][2]-s[_][2]);u+=s[0][1]*(s[1][2]-s[i-1][2]),u/=2*a[0];break;case 2:for(p=1;p<i;p++)_=p-1,m=(p+1)%i,u+=s[p][2]*(s[m][0]-s[_][0]);u+=s[0][2]*(s[1][0]-s[i-1][0]),u/=2*a[1];break;case 3:default:for(p=1;p<i;p++)_=p-1,m=(p+1)%i,u+=s[p][0]*(s[m][1]-s[_][1]);u+=s[0][0]*(s[1][1]-s[i-1][1]),u/=2*a[2];break}return u};t.exports=o}}),CTi=At({"node_modules/@jscad/modeling/src/geometries/poly3/measureBoundingBox.js"(e,t){var n=ui(),o=(r)=>{let i=r.vertices,s=i.length,a=s===0?n.create():n.clone(i[0]),c=n.clone(a);for(let l=1;l<s;l++)n.min(a,a,i[l]),n.max(c,c,i[l]);return[a,c]};t.exports=o}}),bTi=At({"node_modules/@jscad/modeling/src/maths/vec4/dot.js"(e,t){var n=(o,r)=>o[0]*r[0]+o[1]*r[1]+o[2]*r[2]+o[3]*r[3];t.exports=n}}),ITi=At({"node_modules/@jscad/modeling/src/maths/vec4/fromScalar.js"(e,t){var n=(o,r)=>(o[0]=r,o[1]=r,o[2]=r,o[3]=r,o);t.exports=n}}),vTi=At({"node_modules/@jscad/modeling/src/maths/vec4/transform.js"(e,t){var n=(o,r,i)=>{let[s,a,c,l]=r;return o[0]=i[0]*s+i[4]*a+i[8]*c+i[12]*l,o[1]=i[1]*s+i[5]*a+i[9]*c+i[13]*l,o[2]=i[2]*s+i[6]*a+i[10]*c+i[14]*l,o[3]=i[3]*s+i[7]*a+i[11]*c+i[15]*l,o};t.exports=n}}),cXn=At({"node_modules/@jscad/modeling/src/maths/vec4/index.js"(e,t){t.exports={clone:$Wn(),copy:qWn(),create:OEe(),dot:bTi(),equals:JWn(),fromScalar:ITi(),fromValues:tXn(),toString:rXn(),transform:vTi()}}}),STi=At({"node_modules/@jscad/modeling/src/geometries/poly3/measureBoundingSphere.js"(e,t){var n=cXn(),o=new WeakMap,r=(i)=>{let s=o.get(i);if(s)return s;let a=i.vertices,c=n.create();if(a.length===0)return c[0]=0,c[1]=0,c[2]=0,c[3]=0,c;let l=a[0],h=l,d=l,u=l,_=l,p=l;a.forEach((f)=>{if(l[0]>f[0])l=f;if(h[1]>f[1])h=f;if(d[2]>f[2])d=f;if(u[0]<f[0])u=f;if(_[1]<f[1])_=f;if(p[2]<f[2])p=f}),c[0]=(l[0]+u[0])*0.5,c[1]=(h[1]+_[1])*0.5,c[2]=(d[2]+p[2])*0.5;let m=c[0]-u[0],A=c[1]-_[1],g=c[2]-p[2];return c[3]=Math.sqrt(m*m+A*A+g*g),o.set(i,c),c};t.exports=r}}),PTi=At({"node_modules/@jscad/modeling/src/geometries/poly3/measureSignedVolume.js"(e,t){var n=ui(),o=(r)=>{let i=0,s=r.vertices,a=n.create();for(let c=0;c<s.length-2;c++)n.cross(a,s[c+1],s[c+2]),i+=n.dot(s[0],a);return i/=6,i};t.exports=o}}),ETi=At({"node_modules/@jscad/modeling/src/geometries/poly3/toPoints.js"(e,t){var n=(o)=>o.vertices;t.exports=n}}),MTi=At({"node_modules/@jscad/modeling/src/geometries/poly3/toString.js"(e,t){var n=ui(),o=(r)=>{let i="poly3: vertices: [";return r.vertices.forEach((s)=>{i+=`${n.toString(s)}, `}),i+="]",i};t.exports=o}}),wTi=At({"node_modules/@jscad/modeling/src/geometries/poly3/transform.js"(e,t){var n=ld(),o=ui(),r=Zee(),i=(s,a)=>{let c=a.vertices.map((l)=>o.transform(o.create(),l,s));if(n.isMirroring(s))c.reverse();return r(c)};t.exports=i}}),BTi=At({"node_modules/@jscad/modeling/src/geometries/poly3/validate.js"(e,t){var n=oXn(),{NEPS:o}=fc(),r=ui(),i=iXn(),s=sXn(),a=aXn(),c=Qut(),l=(h)=>{if(!i(h))throw Error("invalid poly3 structure");if(h.vertices.length<3)throw Error(`poly3 not enough vertices ${h.vertices.length}`);if(a(h)<=0)throw Error("poly3 area must be greater than zero");for(let d=0;d<h.vertices.length;d++)if(r.equals(h.vertices[d],h.vertices[(d+1)%h.vertices.length]))throw Error(`poly3 duplicate vertex ${h.vertices[d]}`);if(!s(h))throw Error("poly3 must be convex");if(h.vertices.forEach((d)=>{if(!d.every(Number.isFinite))throw Error(`poly3 invalid vertex ${d}`)}),h.vertices.length>3){let d=c(h);h.vertices.forEach((u)=>{let _=Math.abs(n(d,u));if(_>o)throw Error(`poly3 must be coplanar: vertex ${u} distance ${_}`)})}};t.exports=l}}),qa=At({"node_modules/@jscad/modeling/src/geometries/poly3/index.js"(e,t){t.exports={clone:pTi(),create:Zee(),fromPoints:mTi(),fromPointsAndPlane:_Ti(),invert:xTi(),isA:iXn(),isConvex:sXn(),measureArea:aXn(),measureBoundingBox:CTi(),measureBoundingSphere:STi(),measureSignedVolume:PTi(),plane:Qut(),toPoints:ETi(),toString:MTi(),transform:wTi(),validate:BTi()}}}),TTi=At({"node_modules/@jscad/modeling/src/geometries/geom3/fromPointsConvex.js"(e,t){var n=KWn(),o=Ppe(),r=qa(),i=(s)=>{if(!Array.isArray(s))throw Error("the given points must be an array");let c=n(s,{skipTriangulation:!0}).map((l)=>{let h=l.map((d)=>s[d]);return r.create(h)});return o(c)};t.exports=i}}),DTi=At({"node_modules/@jscad/modeling/src/geometries/geom3/fromPoints.js"(e,t){var n=qa(),o=Ppe(),r=(i)=>{if(!Array.isArray(i))throw Error("the given points must be an array");let s=i.map((c,l)=>n.create(c));return o(s)};t.exports=r}}),NTi=At({"node_modules/@jscad/modeling/src/geometries/geom3/fromCompactBinary.js"(e,t){var n=ui(),o=ld(),r=qa(),i=Ppe(),s=(a)=>{if(a[0]!==1)throw Error("invalid compact binary data");let c=i();c.transforms=o.clone(a.slice(1,17));let l=a[21],h=22,d=a.length-l*3;while(d<a.length){let u=a[h];h++;let _=[];for(let p=0;p<u;p++)_.push(n.fromValues(a[d],a[d+1],a[d+2])),d+=3;c.polygons.push(r.create(_))}if(a[17]>=0)c.color=[a[17],a[18],a[19],a[20]];return c};t.exports=s}}),RTi=At({"node_modules/@jscad/modeling/src/geometries/geom3/applyTransforms.js"(e,t){var n=ld(),o=qa(),r=(i)=>{if(n.isIdentity(i.transforms))return i;return i.polygons=i.polygons.map((s)=>o.transform(i.transforms,s)),i.transforms=n.create(),i};t.exports=r}}),Epe=At({"node_modules/@jscad/modeling/src/geometries/geom3/toPolygons.js"(e,t){var n=RTi(),o=(r)=>n(r).polygons;t.exports=o}}),QTi=At({"node_modules/@jscad/modeling/src/geometries/geom3/invert.js"(e,t){var n=qa(),o=Ppe(),r=Epe(),i=(s)=>{let c=r(s).map((l)=>n.invert(l));return o(c)};t.exports=i}}),kut=At({"node_modules/@jscad/modeling/src/geometries/geom3/isA.js"(e,t){var n=(o)=>{if(o&&typeof o==="object"){if("polygons"in o&&"transforms"in o){if(Array.isArray(o.polygons)&&"length"in o.transforms)return!0}}return!1};t.exports=n}}),kTi=At({"node_modules/@jscad/modeling/src/geometries/geom3/isConvex.js"(e,t){var{EPS:n}=fc(),o=ui(),r=kut(),i=Epe(),s=qa(),a=(c)=>{if(!r(c))throw Error("isConvex requires a geom3 geometry");let l=i(c);if(l.length===0)return!0;let h=[],d=new Set;for(let u=0;u<l.length;u++){let _=l[u].vertices;for(let p=0;p<_.length;p++){let m=_[p],A=`${m[0]},${m[1]},${m[2]}`;if(!d.has(A))d.add(A),h.push(m)}}for(let u=0;u<l.length;u++){let _=s.plane(l[u]);for(let p=0;p<h.length;p++){let m=h[p];if(o.dot(_,m)-_[3]>n)return!1}}return!0};t.exports=a}}),LTi=At({"node_modules/@jscad/modeling/src/geometries/geom3/toPoints.js"(e,t){var n=qa(),o=Epe(),r=(i)=>o(i).map((c)=>n.toPoints(c));t.exports=r}}),HTi=At({"node_modules/@jscad/modeling/src/geometries/geom3/toString.js"(e,t){var n=qa(),o=Epe(),r=(i)=>{let s=o(i),a="geom3 ("+s.length+` polygons):
`;return s.forEach((c)=>{a+="  "+n.toString(c)+`
`}),a};t.exports=r}}),FTi=At({"node_modules/@jscad/modeling/src/geometries/geom3/toCompactBinary.js"(e,t){var n=qa(),o=(r)=>{let{polygons:i,transforms:s}=r,a=i.length,c=i.reduce((_,p)=>_+p.vertices.length,0),l=[-1,-1,-1,-1];if(r.color)l=r.color;let h=new Float32Array(22+a+c*3);h[0]=1,h[1]=s[0],h[2]=s[1],h[3]=s[2],h[4]=s[3],h[5]=s[4],h[6]=s[5],h[7]=s[6],h[8]=s[7],h[9]=s[8],h[10]=s[9],h[11]=s[10],h[12]=s[11],h[13]=s[12],h[14]=s[13],h[15]=s[14],h[16]=s[15],h[17]=l[0],h[18]=l[1],h[19]=l[2],h[20]=l[3],h[21]=c;let d=22,u=d+a;return i.forEach((_)=>{let p=n.toPoints(_);h[d]=p.length,d++;for(let m=0;m<p.length;m++){let A=p[m];h[u+0]=A[0],h[u+1]=A[1],h[u+2]=A[2],u+=3}}),h};t.exports=o}}),zTi=At({"node_modules/@jscad/modeling/src/geometries/geom3/transform.js"(e,t){var n=ld(),o=(r,i)=>{let s=n.multiply(n.create(),r,i.transforms);return Object.assign({},i,{transforms:s})};t.exports=o}}),OTi=At({"node_modules/@jscad/modeling/src/geometries/geom3/validate.js"(e,t){var n=qa(),o=kut(),r=(s)=>{if(!o(s))throw Error("invalid geom3 structure");if(s.polygons.forEach(n.validate),i(s),!s.transforms.every(Number.isFinite))throw Error(`geom3 invalid transforms ${s.transforms}`)},i=(s)=>{let a=new Map;s.polygons.forEach(({vertices:l})=>{l.forEach((h,d)=>{let u=`${h}`,_=`${l[(d+1)%l.length]}`,p=`${u}/${_}`,m=a.has(p)?a.get(p):0;a.set(p,m+1)})});let c=[];if(a.forEach((l,h)=>{let d=h.split("/").reverse().join("/"),u=a.get(d);if(l!==u)c.push(h.replace("/"," -> "))}),c.length>0)throw Error(`non-manifold edges ${c.length}
${c.join(`
`)}`)};t.exports=r}}),Os=At({"node_modules/@jscad/modeling/src/geometries/geom3/index.js"(e,t){t.exports={clone:iTi(),create:Ppe(),fromPointsConvex:TTi(),fromPoints:DTi(),fromCompactBinary:NTi(),invert:QTi(),isA:kut(),isConvex:kTi(),toPoints:LTi(),toPolygons:Epe(),toString:HTi(),toCompactBinary:FTi(),transform:zTi(),validate:OTi()}}}),Lut=At({"node_modules/@jscad/modeling/src/geometries/path2/clone.js"(e,t){var n=(o)=>Object.assign({},o);t.exports=n}}),lXn=At({"node_modules/@jscad/modeling/src/geometries/path2/close.js"(e,t){var{EPS:n}=fc(),o=ya(),r=Lut(),i=(s)=>{if(s.isClosed)return s;let a=r(s);if(a.isClosed=!0,a.points.length>1){let c=a.points,l=c[0],h=c[c.length-1];while(o.distance(l,h)<n*n){if(c.pop(),c.length===1)break;h=c[c.length-1]}}return a};t.exports=i}}),VEe=At({"node_modules/@jscad/modeling/src/geometries/path2/create.js"(e,t){var n=ld(),o=(r)=>{if(r===void 0)r=[];return{points:r,isClosed:!1,transforms:n.create()}};t.exports=o}}),Hut=At({"node_modules/@jscad/modeling/src/geometries/path2/fromPoints.js"(e,t){var{EPS:n}=fc(),o=ya(),r=lXn(),i=VEe(),s=(a,c)=>{let l={closed:!1},{closed:h}=Object.assign({},l,a),d=i();if(d.points=c.map((u)=>o.clone(u)),d.points.length>1){let u=d.points[0],_=d.points[d.points.length-1];if(o.distance(u,_)<n*n)h=!0}if(h===!0)d=r(d);return d};t.exports=s}}),VTi=At({"node_modules/@jscad/modeling/src/geometries/path2/applyTransforms.js"(e,t){var n=ld(),o=ya(),r=(i)=>{if(n.isIdentity(i.transforms))return i;return i.points=i.points.map((s)=>o.transform(o.create(),s,i.transforms)),i.transforms=n.create(),i};t.exports=r}}),ete=At({"node_modules/@jscad/modeling/src/geometries/path2/toPoints.js"(e,t){var n=VTi(),o=(r)=>n(r).points;t.exports=o}}),YTi=At({"node_modules/@jscad/modeling/src/geometries/path2/appendArc.js"(e,t){var{TAU:n}=fc(),o=ya(),r=Hut(),i=ete(),s=(a,c)=>{let l={radius:[0,0],xaxisrotation:0,clockwise:!1,large:!1,segments:16},{endpoint:h,radius:d,xaxisrotation:u,clockwise:_,large:p,segments:m}=Object.assign({},l,a);if(!Array.isArray(h))throw Error("endpoint must be an array of X and Y values");if(h.length<2)throw Error("endpoint must contain X and Y values");if(h=o.clone(h),!Array.isArray(d))throw Error("radius must be an array of X and Y values");if(d.length<2)throw Error("radius must contain X and Y values");if(m<4)throw Error("segments must be four or more");let A=1e5;if(c.isClosed)throw Error("the given path cannot be closed");let g=i(c);if(g.length<1)throw Error("the given path must contain one or more points (as the starting point for the arc)");let f=d[0],y=d[1],x=g[g.length-1];f=Math.round(f*A)/A,y=Math.round(y*A)/A,h=o.fromValues(Math.round(h[0]*A)/A,Math.round(h[1]*A)/A);let C=!_,b=[];if(f===0||y===0)b.push(h);else{f=Math.abs(f),y=Math.abs(y);let v=u,P=Math.cos(v),M=Math.sin(v),B=o.subtract(o.create(),x,h);o.scale(B,B,0.5);let T=Math.round((P*B[0]+M*B[1])*A)/A,N=Math.round((-M*B[0]+P*B[1])*A)/A,D=o.fromValues(T,N),L=D[0]*D[0]/(f*f)+D[1]*D[1]/(y*y);if(L>1){let ee=Math.sqrt(L);f*=ee,y*=ee,f=Math.round(f*A)/A,y=Math.round(y*A)/A}let H=Math.sqrt((f*f*y*y-f*f*D[1]*D[1]-y*y*D[0]*D[0])/(f*f*D[1]*D[1]+y*y*D[0]*D[0]));if(C===p)H=-H;let V=o.fromValues(f*D[1]/y,-y*D[0]/f);o.scale(V,V,H);let O=o.fromValues(P*V[0]-M*V[1],M*V[0]+P*V[1]);O=o.add(O,O,o.scale(o.create(),o.add(o.create(),x,h),0.5));let U=o.fromValues((D[0]-V[0])/f,(D[1]-V[1])/y),j=o.fromValues((-D[0]-V[0])/f,(-D[1]-V[1])/y),Y=o.angleRadians(U),K=o.angleRadians(j)-Y;if(K=K%n,!C&&K>0)K-=n;else if(C&&K<0)K+=n;let J=Math.floor(m*(Math.abs(K)/n));if(J<1)J=1;for(let ee=1;ee<J;ee++){let se=Y+ee/J*K,ne=Math.cos(se),re=Math.sin(se),Z=o.fromValues(P*f*ne-M*y*re,M*f*ne+P*y*re);o.add(Z,Z,O),b.push(Z)}if(J)b.push(a.endpoint)}return b=g.concat(b),r({},b)};t.exports=s}}),hXn=At({"node_modules/@jscad/modeling/src/geometries/path2/concat.js"(e,t){var n=Hut(),o=ete(),{equals:r}=ya(),i=(...s)=>{let a=!1,c=[];return s.forEach((l,h)=>{let d=o(l).slice();if(c.length>0&&d.length>0&&r(d[0],c[c.length-1]))d.shift();if(d.length>0&&a)throw Error(`Cannot concatenate to a closed path; check the ${h}th path`);a=l.isClosed,c=c.concat(d)}),n({closed:a},c)};t.exports=i}}),dXn=At({"node_modules/@jscad/modeling/src/geometries/path2/appendPoints.js"(e,t){var n=hXn(),o=VEe(),r=(i,s)=>n(s,o(i));t.exports=r}}),GTi=At({"node_modules/@jscad/modeling/src/geometries/path2/appendBezier.js"(e,t){var{TAU:n}=fc(),o=ya(),r=ya(),i=dXn(),s=ete(),a=(c,l)=>{let h={segments:16},{controlPoints:d,segments:u}=Object.assign({},h,c);if(!Array.isArray(d))throw Error("controlPoints must be an array of one or more points");if(d.length<1)throw Error("controlPoints must be an array of one or more points");if(u<4)throw Error("segments must be four or more");if(l.isClosed)throw Error("the given geometry cannot be closed");let _=s(l);if(_.length<1)throw Error("the given path must contain one or more points (as the starting point for the bezier curve)");if(d=d.slice(),d[0]===null){if(d.length<2)throw Error("a null control point must be passed with one more control points");let D=_[_.length-2];if("lastBezierControlPoint"in l)D=l.lastBezierControlPoint;if(!Array.isArray(D))throw Error("the given path must contain TWO or more points if given a null control point");let L=o.scale(o.create(),_[_.length-1],2);o.subtract(L,L,D),d[0]=L}d.unshift(_[_.length-1]);let m=d.length-1,A=[],g=1;for(let D=0;D<=m;++D){if(D>0)g*=D;A.push(g)}let f=[];for(let D=0;D<=m;++D){let L=A[m]/(A[D]*A[m-D]);f.push(L)}let y=o.create(),x=o.create(),C=r.create(),b=(D)=>{let L=1,H=Math.pow(1-D,m),V=D!==1?1/(1-D):1,O=o.create();for(let U=0;U<=m;++U){if(U===m)H=1;let j=f[U]*L*H,Y=o.scale(y,d[U],j);o.add(O,O,Y),L*=D,H*=V}return O},I=[],v=[],P=m+1;for(let D=0;D<P;++D){let L=D/(P-1),H=b(L);I.push(H),v.push(L)}let M=1,B=n/u,T=Math.sin(B);while(M<I.length-1){let D=o.subtract(y,I[M],I[M-1]);o.normalize(D,D);let L=o.subtract(x,I[M+1],I[M]);o.normalize(L,L);let H=o.cross(C,D,L);if(Math.abs(H[2])>T){let V=v[M-1],O=v[M+1],U=V+(O-V)*1/3,j=V+(O-V)*2/3,Y=b(U),X=b(j);if(I.splice(M,1,Y,X),v.splice(M,1,U,j),M--,M<1)M=1}else++M}I.shift();let N=i(I,l);return N.lastBezierControlPoint=d[d.length-2],N};t.exports=a}}),UTi=At({"node_modules/@jscad/modeling/src/geometries/path2/equals.js"(e,t){var n=ya(),o=ete(),r=(i,s)=>{if(i.isClosed!==s.isClosed)return!1;if(i.points.length!==s.points.length)return!1;let a=o(i),c=o(s),l=a.length,h=0;do{let d=!1;for(let u=0;u<l;u++)if(!n.equals(a[u],c[(u+h)%l])){d=!0;break}if(d===!1)return!0;if(!i.isClosed)return!1}while(++h<l);return!1};t.exports=r}}),WTi=At({"node_modules/@jscad/modeling/src/geometries/path2/fromCompactBinary.js"(e,t){var n=ld(),o=ya(),r=VEe(),i=(s)=>{if(s[0]!==2)throw Error("invalid compact binary data");let a=r();a.transforms=n.clone(s.slice(1,17)),a.isClosed=!!s[17];for(let c=22;c<s.length;c+=2){let l=o.fromValues(s[c],s[c+1]);a.points.push(l)}if(s[18]>=0)a.color=[s[18],s[19],s[20],s[21]];return a};t.exports=i}}),uXn=At({"node_modules/@jscad/modeling/src/geometries/path2/isA.js"(e,t){var n=(o)=>{if(o&&typeof o==="object"){if("points"in o&&"transforms"in o&&"isClosed"in o){if(Array.isArray(o.points)&&"length"in o.transforms)return!0}}return!1};t.exports=n}}),XTi=At({"node_modules/@jscad/modeling/src/geometries/path2/reverse.js"(e,t){var n=Lut(),o=(r)=>{let i=n(r);return i.points=r.points.slice().reverse(),i};t.exports=o}}),jTi=At({"node_modules/@jscad/modeling/src/geometries/path2/toString.js"(e,t){var n=ya(),o=ete(),r=(i)=>{let s=o(i),a="path ("+s.length+" points, "+i.isClosed+`):
[
`;return s.forEach((c)=>{a+="  "+n.toString(c)+`,
`}),a+=`]
`,a};t.exports=r}}),KTi=At({"node_modules/@jscad/modeling/src/geometries/path2/toCompactBinary.js"(e,t){var n=(o)=>{let{points:r,transforms:i}=o,s=[-1,-1,-1,-1];if(o.color)s=o.color;let a=new Float32Array(22+r.length*2);a[0]=2,a[1]=i[0],a[2]=i[1],a[3]=i[2],a[4]=i[3],a[5]=i[4],a[6]=i[5],a[7]=i[6],a[8]=i[7],a[9]=i[8],a[10]=i[9],a[11]=i[10],a[12]=i[11],a[13]=i[12],a[14]=i[13],a[15]=i[14],a[16]=i[15],a[17]=o.isClosed?1:0,a[18]=s[0],a[19]=s[1],a[20]=s[2],a[21]=s[3];for(let c=0;c<r.length;c++){let l=c*2+22,h=r[c];a[l]=h[0],a[l+1]=h[1]}return a};t.exports=n}}),$Ti=At({"node_modules/@jscad/modeling/src/geometries/path2/transform.js"(e,t){var n=ld(),o=(r,i)=>{let s=n.multiply(n.create(),r,i.transforms);return Object.assign({},i,{transforms:s})};t.exports=o}}),qTi=At({"node_modules/@jscad/modeling/src/geometries/path2/validate.js"(e,t){var n=ya(),o=uXn(),r=(i)=>{if(!o(i))throw Error("invalid path2 structure");if(i.points.length>1){for(let s=0;s<i.points.length;s++)if(n.equals(i.points[s],i.points[(s+1)%i.points.length]))throw Error(`path2 duplicate points ${i.points[s]}`)}if(i.points.forEach((s)=>{if(!s.every(Number.isFinite))throw Error(`path2 invalid point ${s}`)}),!i.transforms.every(Number.isFinite))throw Error(`path2 invalid transforms ${i.transforms}`)};t.exports=r}}),zh=At({"node_modules/@jscad/modeling/src/geometries/path2/index.js"(e,t){t.exports={appendArc:YTi(),appendBezier:GTi(),appendPoints:dXn(),clone:Lut(),close:lXn(),concat:hXn(),create:VEe(),equals:UTi(),fromPoints:Hut(),fromCompactBinary:WTi(),isA:uXn(),reverse:XTi(),toPoints:ete(),toString:jTi(),toCompactBinary:KTi(),transform:$Ti(),validate:qTi()}}}),JTi=At({"node_modules/@jscad/modeling/src/colors/colorize.js"(e,t){var n=Is(),o=qs(),r=Os(),i=zh(),s=qa(),a=(u,_)=>{let p=o.clone(_);return p.color=u,p},c=(u,_)=>{let p=r.clone(_);return p.color=u,p},l=(u,_)=>{let p=i.clone(_);return p.color=u,p},h=(u,_)=>{let p=s.clone(_);return p.color=u,p},d=(u,..._)=>{if(!Array.isArray(u))throw Error("color must be an array");if(u.length<3)throw Error("color must contain R, G and B values");if(u.length===3)u=[u[0],u[1],u[2],1];if(_=n(_),_.length===0)throw Error("wrong number of arguments");let p=_.map((m)=>{if(o.isA(m))return a(u,m);if(r.isA(m))return c(u,m);if(i.isA(m))return l(u,m);if(s.isA(m))return h(u,m);return m.color=u,m});return p.length===1?p[0]:p};t.exports=d}}),pXn=At({"node_modules/@jscad/modeling/src/colors/cssColors.js"(e,t){var n={black:[0,0,0],silver:[0.7529411764705882,0.7529411764705882,0.7529411764705882],gray:[0.5019607843137255,0.5019607843137255,0.5019607843137255],white:[1,1,1],maroon:[0.5019607843137255,0,0],red:[1,0,0],purple:[0.5019607843137255,0,0.5019607843137255],fuchsia:[1,0,1],green:[0,0.5019607843137255,0],lime:[0,1,0],olive:[0.5019607843137255,0.5019607843137255,0],yellow:[1,1,0],navy:[0,0,0.5019607843137255],blue:[0,0,1],teal:[0,0.5019607843137255,0.5019607843137255],aqua:[0,1,1],aliceblue:[0.9411764705882353,0.9725490196078431,1],antiquewhite:[0.9803921568627451,0.9215686274509803,0.8431372549019608],aquamarine:[0.4980392156862745,1,0.8313725490196079],azure:[0.9411764705882353,1,1],beige:[0.9607843137254902,0.9607843137254902,0.8627450980392157],bisque:[1,0.8941176470588236,0.7686274509803922],blanchedalmond:[1,0.9215686274509803,0.803921568627451],blueviolet:[0.5411764705882353,0.16862745098039217,0.8862745098039215],brown:[0.6470588235294118,0.16470588235294117,0.16470588235294117],burlywood:[0.8705882352941177,0.7215686274509804,0.5294117647058824],cadetblue:[0.37254901960784315,0.6196078431372549,0.6274509803921569],chartreuse:[0.4980392156862745,1,0],chocolate:[0.8235294117647058,0.4117647058823529,0.11764705882352941],coral:[1,0.4980392156862745,0.3137254901960784],cornflowerblue:[0.39215686274509803,0.5843137254901961,0.9294117647058824],cornsilk:[1,0.9725490196078431,0.8627450980392157],crimson:[0.8627450980392157,0.0784313725490196,0.23529411764705882],cyan:[0,1,1],darkblue:[0,0,0.5450980392156862],darkcyan:[0,0.5450980392156862,0.5450980392156862],darkgoldenrod:[0.7215686274509804,0.5254901960784314,0.043137254901960784],darkgray:[0.6627450980392157,0.6627450980392157,0.6627450980392157],darkgreen:[0,0.39215686274509803,0],darkgrey:[0.6627450980392157,0.6627450980392157,0.6627450980392157],darkkhaki:[0.7411764705882353,0.7176470588235294,0.4196078431372549],darkmagenta:[0.5450980392156862,0,0.5450980392156862],darkolivegreen:[0.3333333333333333,0.4196078431372549,0.1843137254901961],darkorange:[1,0.5490196078431373,0],darkorchid:[0.6,0.19607843137254902,0.8],darkred:[0.5450980392156862,0,0],darksalmon:[0.9137254901960784,0.5882352941176471,0.47843137254901963],darkseagreen:[0.5607843137254902,0.7372549019607844,0.5607843137254902],darkslateblue:[0.2823529411764706,0.23921568627450981,0.5450980392156862],darkslategray:[0.1843137254901961,0.30980392156862746,0.30980392156862746],darkslategrey:[0.1843137254901961,0.30980392156862746,0.30980392156862746],darkturquoise:[0,0.807843137254902,0.8196078431372549],darkviolet:[0.5803921568627451,0,0.8274509803921568],deeppink:[1,0.0784313725490196,0.5764705882352941],deepskyblue:[0,0.7490196078431373,1],dimgray:[0.4117647058823529,0.4117647058823529,0.4117647058823529],dimgrey:[0.4117647058823529,0.4117647058823529,0.4117647058823529],dodgerblue:[0.11764705882352941,0.5647058823529412,1],firebrick:[0.6980392156862745,0.13333333333333333,0.13333333333333333],floralwhite:[1,0.9803921568627451,0.9411764705882353],forestgreen:[0.13333333333333333,0.5450980392156862,0.13333333333333333],gainsboro:[0.8627450980392157,0.8627450980392157,0.8627450980392157],ghostwhite:[0.9725490196078431,0.9725490196078431,1],gold:[1,0.8431372549019608,0],goldenrod:[0.8549019607843137,0.6470588235294118,0.12549019607843137],greenyellow:[0.6784313725490196,1,0.1843137254901961],grey:[0.5019607843137255,0.5019607843137255,0.5019607843137255],honeydew:[0.9411764705882353,1,0.9411764705882353],hotpink:[1,0.4117647058823529,0.7058823529411765],indianred:[0.803921568627451,0.3607843137254902,0.3607843137254902],indigo:[0.29411764705882354,0,0.5098039215686274],ivory:[1,1,0.9411764705882353],khaki:[0.9411764705882353,0.9019607843137255,0.5490196078431373],lavender:[0.9019607843137255,0.9019607843137255,0.9803921568627451],lavenderblush:[1,0.9411764705882353,0.9607843137254902],lawngreen:[0.48627450980392156,0.9882352941176471,0],lemonchiffon:[1,0.9803921568627451,0.803921568627451],lightblue:[0.6784313725490196,0.8470588235294118,0.9019607843137255],lightcoral:[0.9411764705882353,0.5019607843137255,0.5019607843137255],lightcyan:[0.8784313725490196,1,1],lightgoldenrodyellow:[0.9803921568627451,0.9803921568627451,0.8235294117647058],lightgray:[0.8274509803921568,0.8274509803921568,0.8274509803921568],lightgreen:[0.5647058823529412,0.9333333333333333,0.5647058823529412],lightgrey:[0.8274509803921568,0.8274509803921568,0.8274509803921568],lightpink:[1,0.7137254901960784,0.7568627450980392],lightsalmon:[1,0.6274509803921569,0.47843137254901963],lightseagreen:[0.12549019607843137,0.6980392156862745,0.6666666666666666],lightskyblue:[0.5294117647058824,0.807843137254902,0.9803921568627451],lightslategray:[0.4666666666666667,0.5333333333333333,0.6],lightslategrey:[0.4666666666666667,0.5333333333333333,0.6],lightsteelblue:[0.6901960784313725,0.7686274509803922,0.8705882352941177],lightyellow:[1,1,0.8784313725490196],limegreen:[0.19607843137254902,0.803921568627451,0.19607843137254902],linen:[0.9803921568627451,0.9411764705882353,0.9019607843137255],magenta:[1,0,1],mediumaquamarine:[0.4,0.803921568627451,0.6666666666666666],mediumblue:[0,0,0.803921568627451],mediumorchid:[0.7294117647058823,0.3333333333333333,0.8274509803921568],mediumpurple:[0.5764705882352941,0.4392156862745098,0.8588235294117647],mediumseagreen:[0.23529411764705882,0.7019607843137254,0.44313725490196076],mediumslateblue:[0.4823529411764706,0.40784313725490196,0.9333333333333333],mediumspringgreen:[0,0.9803921568627451,0.6039215686274509],mediumturquoise:[0.2823529411764706,0.8196078431372549,0.8],mediumvioletred:[0.7803921568627451,0.08235294117647059,0.5215686274509804],midnightblue:[0.09803921568627451,0.09803921568627451,0.4392156862745098],mintcream:[0.9607843137254902,1,0.9803921568627451],mistyrose:[1,0.8941176470588236,0.8823529411764706],moccasin:[1,0.8941176470588236,0.7098039215686275],navajowhite:[1,0.8705882352941177,0.6784313725490196],oldlace:[0.9921568627450981,0.9607843137254902,0.9019607843137255],olivedrab:[0.4196078431372549,0.5568627450980392,0.13725490196078433],orange:[1,0.6470588235294118,0],orangered:[1,0.27058823529411763,0],orchid:[0.8549019607843137,0.4392156862745098,0.8392156862745098],palegoldenrod:[0.9333333333333333,0.9098039215686274,0.6666666666666666],palegreen:[0.596078431372549,0.984313725490196,0.596078431372549],paleturquoise:[0.6862745098039216,0.9333333333333333,0.9333333333333333],palevioletred:[0.8588235294117647,0.4392156862745098,0.5764705882352941],papayawhip:[1,0.9372549019607843,0.8352941176470589],peachpuff:[1,0.8549019607843137,0.7254901960784313],peru:[0.803921568627451,0.5215686274509804,0.24705882352941178],pink:[1,0.7529411764705882,0.796078431372549],plum:[0.8666666666666667,0.6274509803921569,0.8666666666666667],powderblue:[0.6901960784313725,0.8784313725490196,0.9019607843137255],rosybrown:[0.7372549019607844,0.5607843137254902,0.5607843137254902],royalblue:[0.2549019607843137,0.4117647058823529,0.8823529411764706],saddlebrown:[0.5450980392156862,0.27058823529411763,0.07450980392156863],salmon:[0.9803921568627451,0.5019607843137255,0.4470588235294118],sandybrown:[0.9568627450980393,0.6431372549019608,0.3764705882352941],seagreen:[0.1803921568627451,0.5450980392156862,0.3411764705882353],seashell:[1,0.9607843137254902,0.9333333333333333],sienna:[0.6274509803921569,0.3215686274509804,0.17647058823529413],skyblue:[0.5294117647058824,0.807843137254902,0.9215686274509803],slateblue:[0.41568627450980394,0.35294117647058826,0.803921568627451],slategray:[0.4392156862745098,0.5019607843137255,0.5647058823529412],slategrey:[0.4392156862745098,0.5019607843137255,0.5647058823529412],snow:[1,0.9803921568627451,0.9803921568627451],springgreen:[0,1,0.4980392156862745],steelblue:[0.27450980392156865,0.5098039215686274,0.7058823529411765],tan:[0.8235294117647058,0.7058823529411765,0.5490196078431373],thistle:[0.8470588235294118,0.7490196078431373,0.8470588235294118],tomato:[1,0.38823529411764707,0.2784313725490196],turquoise:[0.25098039215686274,0.8784313725490196,0.8156862745098039],violet:[0.9333333333333333,0.5098039215686274,0.9333333333333333],wheat:[0.9607843137254902,0.8705882352941177,0.7019607843137254],whitesmoke:[0.9607843137254902,0.9607843137254902,0.9607843137254902],yellowgreen:[0.6039215686274509,0.803921568627451,0.19607843137254902]};t.exports=n}}),ZTi=At({"node_modules/@jscad/modeling/src/colors/colorNameToRgb.js"(e,t){var n=pXn(),o=(r)=>n[r.toLowerCase()];t.exports=o}}),eDi=At({"node_modules/@jscad/modeling/src/colors/hexToRgb.js"(e,t){var n=(o)=>{if(o=o.replace("#",""),o.length<6)throw Error("the given notation must contain 3 or more hex values");let r=parseInt(o.substring(0,2),16)/255,i=parseInt(o.substring(2,4),16)/255,s=parseInt(o.substring(4,6),16)/255;if(o.length>=8){let a=parseInt(o.substring(6,8),16)/255;return[r,i,s,a]}return[r,i,s]};t.exports=n}}),mXn=At({"node_modules/@jscad/modeling/src/colors/hueToColorComponent.js"(e,t){var n=(o,r,i)=>{if(i<0)i+=1;if(i>1)i-=1;if(i<0.16666666666666666)return o+(r-o)*6*i;if(i<0.5)return r;if(i<0.6666666666666666)return o+(r-o)*(0.6666666666666666-i)*6;return o};t.exports=n}}),tDi=At({"node_modules/@jscad/modeling/src/colors/hslToRgb.js"(e,t){var n=Is(),o=mXn(),r=(...i)=>{if(i=n(i),i.length<3)throw Error("values must contain H, S and L values");let s=i[0],a=i[1],c=i[2],l=c,h=c,d=c;if(a!==0){let u=c<0.5?c*(1+a):c+a-c*a,_=2*c-u;l=o(_,u,s+0.3333333333333333),h=o(_,u,s),d=o(_,u,s-0.3333333333333333)}if(i.length>3){let u=i[3];return[l,h,d,u]}return[l,h,d]};t.exports=r}}),nDi=At({"node_modules/@jscad/modeling/src/colors/hsvToRgb.js"(e,t){var n=Is(),o=(...r)=>{if(r=n(r),r.length<3)throw Error("values must contain H, S and V values");let i=r[0],s=r[1],a=r[2],c=0,l=0,h=0,d=Math.floor(i*6),u=i*6-d,_=a*(1-s),p=a*(1-u*s),m=a*(1-(1-u)*s);switch(d%6){case 0:c=a,l=m,h=_;break;case 1:c=p,l=a,h=_;break;case 2:c=_,l=a,h=m;break;case 3:c=_,l=p,h=a;break;case 4:c=m,l=_,h=a;break;case 5:c=a,l=_,h=p;break}if(r.length>3){let A=r[3];return[c,l,h,A]}return[c,l,h]};t.exports=o}}),oDi=At({"node_modules/@jscad/modeling/src/colors/rgbToHex.js"(e,t){var n=Is(),o=(...r)=>{if(r=n(r),r.length<3)throw Error("values must contain R, G and B values");let i=r[0]*255,s=r[1]*255,a=r[2]*255,c=`#${Number(16777216+i*65536+s*256+a).toString(16).substring(1,7)}`;if(r.length>3)c=c+Number(r[3]*255).toString(16);return c};t.exports=o}}),rDi=At({"node_modules/@jscad/modeling/src/colors/rgbToHsl.js"(e,t){var n=Is(),o=(...r)=>{if(r=n(r),r.length<3)throw Error("values must contain R, G and B values");let i=r[0],s=r[1],a=r[2],c=Math.max(i,s,a),l=Math.min(i,s,a),h,d,u=(c+l)/2;if(c===l)h=d=0;else{let _=c-l;switch(d=u>0.5?_/(2-c-l):_/(c+l),c){case i:h=(s-a)/_+(s<a?6:0);break;case s:h=(a-i)/_+2;break;case a:h=(i-s)/_+4;break}h/=6}if(r.length>3){let _=r[3];return[h,d,u,_]}return[h,d,u]};t.exports=o}}),iDi=At({"node_modules/@jscad/modeling/src/colors/rgbToHsv.js"(e,t){var n=Is(),o=(...r)=>{if(r=n(r),r.length<3)throw Error("values must contain R, G and B values");let i=r[0],s=r[1],a=r[2],c=Math.max(i,s,a),l=Math.min(i,s,a),h,d=c,u=c-l,_=c===0?0:u/c;if(c===l)h=0;else{switch(c){case i:h=(s-a)/u+(s<a?6:0);break;case s:h=(a-i)/u+2;break;case a:h=(i-s)/u+4;break}h/=6}if(r.length>3){let p=r[3];return[h,_,d,p]}return[h,_,d]};t.exports=o}}),YEe=At({"node_modules/@jscad/modeling/src/colors/index.js"(e,t){t.exports={colorize:JTi(),colorNameToRgb:ZTi(),cssColors:pXn(),hexToRgb:eDi(),hslToRgb:tDi(),hsvToRgb:nDi(),hueToColorComponent:mXn(),rgbToHex:oDi(),rgbToHsl:rDi(),rgbToHsv:iDi()}}}),sDi=At({"node_modules/@jscad/modeling/src/curves/bezier/create.js"(e,t){var n=(s)=>{if(!Array.isArray(s))throw Error("Bezier points must be a valid array/");if(s.length<2)throw Error("Bezier points must contain at least 2 values.");let a=o(s);return{points:s,pointType:a,dimensions:a==="float_single"?0:s[0].length,permutations:r(s.length-1),tangentPermutations:r(s.length-2)}},o=function(s){let a=null;return s.forEach((c)=>{let l="";if(Number.isFinite(c))l="float_single";else if(Array.isArray(c))c.forEach((h)=>{if(!Number.isFinite(h))throw Error("Bezier point values must all be numbers.")}),l="float_"+c.length;else throw Error("Bezier points must all be numbers or arrays of number.");if(a==null)a=l;else if(a!==l)throw Error("Bezier points must be either all numbers or all arrays of numbers of the same size.")}),a},r=function(s){let a=[];for(let c=0;c<=s;c++)a.push(i(s)/(i(c)*i(s-c)));return a},i=function(s){let a=1;for(let c=2;c<=s;c++)a*=c;return a};t.exports=n}}),_Xn=At({"node_modules/@jscad/modeling/src/curves/bezier/valueAt.js"(e,t){var n=(r,i)=>{if(r<0||r>1)throw Error("Bezier valueAt() input must be between 0 and 1");if(i.pointType==="float_single")return o(i,i.points,r);else{let s=[];for(let a=0;a<i.dimensions;a++){let c=[];for(let l=0;l<i.points.length;l++)c.push(i.points[l][a]);s.push(o(i,c,r))}return s}},o=function(r,i,s){let a=i.length-1,c=0;for(let l=0;l<=a;l++)c+=r.permutations[l]*Math.pow(1-s,a-l)*Math.pow(s,l)*i[l];return c};t.exports=n}}),aDi=At({"node_modules/@jscad/modeling/src/curves/bezier/tangentAt.js"(e,t){var n=(r,i)=>{if(r<0||r>1)throw Error("Bezier tangentAt() input must be between 0 and 1");if(i.pointType==="float_single")return o(i,i.points,r);else{let s=[];for(let a=0;a<i.dimensions;a++){let c=[];for(let l=0;l<i.points.length;l++)c.push(i.points[l][a]);s.push(o(i,c,r))}return s}},o=function(r,i,s){let a=i.length-1,c=0;for(let l=0;l<a;l++){let h=a*(i[l+1]-i[l]);c+=r.tangentPermutations[l]*Math.pow(1-s,a-1-l)*Math.pow(s,l)*h}return c};t.exports=n}}),Fut=At({"node_modules/@jscad/modeling/src/curves/bezier/lengths.js"(e,t){var n=_Xn(),o=(i,s)=>{let a=0,c=[0],l=n(0,s);for(let h=1;h<=i;h++){let d=n(h/i,s);a+=r(d,l),c.push(a),l=d}return c},r=(i,s)=>{if(Number.isFinite(i)&&Number.isFinite(s))return Math.abs(i-s);else if(Array.isArray(i)&&Array.isArray(s)){if(i.length!==s.length)throw Error("The operands must have the same number of dimensions.");let a=0;for(let c=0;c<i.length;c++)a+=(s[c]-i[c])*(s[c]-i[c]);return Math.sqrt(a)}else throw Error("The operands must be of the same type, either number or array.")};t.exports=o}}),cDi=At({"node_modules/@jscad/modeling/src/curves/bezier/length.js"(e,t){var n=Fut(),o=(r,i)=>n(r,i)[r];t.exports=o}}),lDi=At({"node_modules/@jscad/modeling/src/curves/bezier/arcLengthToT.js"(e,t){var n=Fut(),o=(r,i)=>{let s={distance:0,segments:100},{distance:a,segments:c}=Object.assign({},s,r),l=n(c,i),h=0,d=c;while(h<=d){let g=Math.floor(h+(d-h)/2),f=l[g]-a;if(f<0)h=g+1;else if(f>0)d=g-1;else{d=g;break}}let u=d;if(l[u]===a)return u/c;let _=l[u],m=l[u+1]-_,A=(a-_)/m;return(u+A)/c};t.exports=o}}),hDi=At({"node_modules/@jscad/modeling/src/curves/bezier/index.js"(e,t){t.exports={create:sDi(),valueAt:_Xn(),tangentAt:aDi(),lengths:Fut(),length:cDi(),arcLengthToT:lDi()}}}),dDi=At({"node_modules/@jscad/modeling/src/curves/index.js"(e,t){t.exports={bezier:hDi()}}}),GEe=At({"node_modules/@jscad/modeling/src/maths/utils/area.js"(e,t){var n=(o)=>{let r=0;for(let i=0;i<o.length;i++){let s=(i+1)%o.length;r+=o[i][0]*o[s][1],r-=o[s][0]*o[i][1]}return r/2};t.exports=n}}),gXn=At({"node_modules/@jscad/modeling/src/geometries/poly2/measureArea.js"(e,t){var n=GEe(),o=(r)=>n(r.vertices);t.exports=o}}),AXn=At({"node_modules/@jscad/modeling/src/geometries/poly2/create.js"(e,t){var n=(o)=>{if(o===void 0||o.length<3)o=[];return{vertices:o}};t.exports=n}}),fXn=At({"node_modules/@jscad/modeling/src/geometries/poly2/flip.js"(e,t){var n=AXn(),o=(r)=>{let i=r.vertices.slice().reverse();return n(i)};t.exports=o}}),uDi=At({"node_modules/@jscad/modeling/src/geometries/poly2/arePointsInside.js"(e,t){var n=gXn(),o=fXn(),r=(s,a)=>{if(s.length===0)return 0;let c=a.vertices;if(c.length<3)return 0;if(n(a)<0)a=o(a);return s.reduce((h,d)=>h+i(d,c),0)===s.length?1:0},i=(s,a)=>{let c=a.length,l=s[0],h=s[1],d=a[c-1],u=a[0],_=d[1]>h,p=0,m=0;for(let A=c+1;--A;){let g=u[1]>h;if(_!==g){let f=d[0]>l,y=u[0]>l;if(f&&y)p=!p;else if(u[0]-(u[1]-h)*(d[0]-u[0])/(d[1]-u[1])>=l)p=!p}_=g,d=u,u=a[++m]}return p};t.exports=r}}),zut=At({"node_modules/@jscad/modeling/src/geometries/poly2/index.js"(e,t){t.exports={arePointsInside:uDi(),create:AXn(),flip:fXn(),measureArea:gXn()}}}),Out=At({"node_modules/@jscad/modeling/src/geometries/index.js"(e,t){t.exports={geom2:qs(),geom3:Os(),path2:zh(),poly2:zut(),poly3:qa()}}}),Vut=At({"node_modules/@jscad/modeling/src/maths/line2/create.js"(e,t){var n=()=>[0,1,0];t.exports=n}}),pDi=At({"node_modules/@jscad/modeling/src/maths/line2/clone.js"(e,t){var n=Vut(),o=(r)=>{let i=n();return i[0]=r[0],i[1]=r[1],i[2]=r[2],i};t.exports=o}}),Yut=At({"node_modules/@jscad/modeling/src/maths/line2/direction.js"(e,t){var n=ya(),o=(r)=>{let i=n.normal(n.create(),r);return n.negate(i,i),i};t.exports=o}}),UEe=At({"node_modules/@jscad/modeling/src/maths/line2/origin.js"(e,t){var n=ya(),o=(r)=>n.scale(n.create(),r,r[2]);t.exports=o}}),mDi=At({"node_modules/@jscad/modeling/src/maths/line2/closestPoint.js"(e,t){var n=ya(),o=Yut(),r=UEe(),i=(s,a)=>{let c=r(s),l=o(s),h=n.subtract(n.create(),a,c),d=n.dot(h,l);return n.scale(h,l,d),n.add(h,h,c),h};t.exports=i}}),yXn=At({"node_modules/@jscad/modeling/src/maths/line2/copy.js"(e,t){var n=(o,r)=>(o[0]=r[0],o[1]=r[1],o[2]=r[2],o);t.exports=n}}),_Di=At({"node_modules/@jscad/modeling/src/maths/line2/distanceToPoint.js"(e,t){var n=ya(),o=(r,i)=>{let s=n.dot(i,r);return s=Math.abs(s-r[2]),s};t.exports=o}}),gDi=At({"node_modules/@jscad/modeling/src/maths/line2/equals.js"(e,t){var n=(o,r)=>o[0]===r[0]&&(o[1]===r[1]&&o[2]===r[2]);t.exports=n}}),xXn=At({"node_modules/@jscad/modeling/src/maths/line2/fromPoints.js"(e,t){var n=ya(),o=(r,i,s)=>{let a=n.subtract(n.create(),s,i);n.normal(a,a),n.normalize(a,a);let c=n.dot(i,a);return r[0]=a[0],r[1]=a[1],r[2]=c,r};t.exports=o}}),CXn=At({"node_modules/@jscad/modeling/src/maths/line2/fromValues.js"(e,t){var n=Vut(),o=(r,i,s)=>{let a=n();return a[0]=r,a[1]=i,a[2]=s,a};t.exports=o}}),Gut=At({"node_modules/@jscad/modeling/src/maths/utils/aboutEqualNormals.js"(e,t){var{NEPS:n}=fc(),o=(r,i)=>Math.abs(r[0]-i[0])<=n&&Math.abs(r[1]-i[1])<=n&&Math.abs(r[2]-i[2])<=n;t.exports=o}}),bXn=At({"node_modules/@jscad/modeling/src/maths/utils/interpolateBetween2DPointsForY.js"(e,t){var n=(o,r,i)=>{let s=i-o[1],a=r[1]-o[1];if(a<0)s=-s,a=-a;let c;if(s<=0)c=0;else if(s>=a)c=1;else if(a<0.0000000001)c=0.5;else c=s/a;return o[0]+c*(r[0]-o[0])};t.exports=n}}),IXn=At({"node_modules/@jscad/modeling/src/maths/utils/intersect.js"(e,t){var n=(o,r,i,s)=>{if(o[0]===r[0]&&o[1]===r[1]||i[0]===s[0]&&i[1]===s[1])return;let a=(s[1]-i[1])*(r[0]-o[0])-(s[0]-i[0])*(r[1]-o[1]);if(Math.abs(a)<Number.MIN_VALUE)return;let c=((s[0]-i[0])*(o[1]-i[1])-(s[1]-i[1])*(o[0]-i[0]))/a,l=((r[0]-o[0])*(o[1]-i[1])-(r[1]-o[1])*(o[0]-i[0]))/a;if(c<0||c>1||l<0||l>1)return;let h=o[0]+c*(r[0]-o[0]),d=o[1]+c*(r[1]-o[1]);return[h,d]};t.exports=n}}),ADi=At({"node_modules/@jscad/modeling/src/maths/utils/solve2Linear.js"(e,t){var n=(o,r,i,s,a,c)=>{let h=1/(o*s-r*i),d=a*s-r*c,u=-a*i+o*c;return d*=h,u*=h,[d,u]};t.exports=n}}),Mpe=At({"node_modules/@jscad/modeling/src/maths/utils/index.js"(e,t){t.exports={aboutEqualNormals:Gut(),area:GEe(),cos:Vf().cos,interpolateBetween2DPointsForY:bXn(),intersect:IXn(),sin:Vf().sin,solve2Linear:ADi()}}}),fDi=At({"node_modules/@jscad/modeling/src/maths/line2/intersectPointOfLines.js"(e,t){var n=ya(),{solve2Linear:o}=Mpe(),r=(i,s)=>{let a=o(i[0],i[1],s[0],s[1],i[2],s[2]);return n.clone(a)};t.exports=r}}),yDi=At({"node_modules/@jscad/modeling/src/maths/line2/reverse.js"(e,t){var n=ya(),o=yXn(),r=CXn(),i=(s,a)=>{let c=n.negate(n.create(),a),l=-a[2];return o(s,r(c[0],c[1],l))};t.exports=i}}),xDi=At({"node_modules/@jscad/modeling/src/maths/line2/toString.js"(e,t){var n=(o)=>`line2: (${o[0].toFixed(7)}, ${o[1].toFixed(7)}, ${o[2].toFixed(7)})`;t.exports=n}}),CDi=At({"node_modules/@jscad/modeling/src/maths/line2/transform.js"(e,t){var n=ya(),o=xXn(),r=UEe(),i=Yut(),s=(a,c,l)=>{let h=r(c),d=i(c);return n.transform(h,h,l),n.transform(d,d,l),o(a,h,d)};t.exports=s}}),bDi=At({"node_modules/@jscad/modeling/src/maths/line2/xAtY.js"(e,t){var n=UEe(),o=(r,i)=>{let s=(r[2]-r[1]*i)/r[0];if(Number.isNaN(s))s=n(r)[0];return s};t.exports=o}}),Uut=At({"node_modules/@jscad/modeling/src/maths/line2/index.js"(e,t){t.exports={clone:pDi(),closestPoint:mDi(),copy:yXn(),create:Vut(),direction:Yut(),distanceToPoint:_Di(),equals:gDi(),fromPoints:xXn(),fromValues:CXn(),intersectPointOfLines:fDi(),origin:UEe(),reverse:yDi(),toString:xDi(),transform:CDi(),xAtY:bDi()}}}),vXn=At({"node_modules/@jscad/modeling/src/maths/line3/create.js"(e,t){var n=ui(),o=()=>[n.fromValues(0,0,0),n.fromValues(0,0,1)];t.exports=o}}),IDi=At({"node_modules/@jscad/modeling/src/maths/line3/clone.js"(e,t){var n=ui(),o=vXn(),r=(i)=>{let s=o();return n.copy(s[0],i[0]),n.copy(s[1],i[1]),s};t.exports=r}}),SXn=At({"node_modules/@jscad/modeling/src/maths/line3/closestPoint.js"(e,t){var n=ui(),o=(r,i)=>{let s=r[0],a=r[1],c=n.dot(n.subtract(n.create(),i,s),a),l=n.dot(a,a),h=c/l,d=n.scale(n.create(),a,h);return n.add(d,d,s),d};t.exports=o}}),vDi=At({"node_modules/@jscad/modeling/src/maths/line3/copy.js"(e,t){var n=ui(),o=(r,i)=>(n.copy(r[0],i[0]),n.copy(r[1],i[1]),r);t.exports=o}}),SDi=At({"node_modules/@jscad/modeling/src/maths/line3/direction.js"(e,t){var n=(o)=>o[1];t.exports=n}}),PDi=At({"node_modules/@jscad/modeling/src/maths/line3/distanceToPoint.js"(e,t){var n=ui(),o=SXn(),r=(i,s)=>{let a=o(i,s),c=n.subtract(n.create(),s,a);return n.length(c)};t.exports=r}}),EDi=At({"node_modules/@jscad/modeling/src/maths/line3/equals.js"(e,t){var n=ui(),o=(r,i)=>{if(!n.equals(r[1],i[1]))return!1;if(!n.equals(r[0],i[0]))return!1;return!0};t.exports=o}}),wpe=At({"node_modules/@jscad/modeling/src/maths/line3/fromPointAndDirection.js"(e,t){var n=ui(),o=(r,i,s)=>{let a=n.normalize(n.create(),s);return n.copy(r[0],i),n.copy(r[1],a),r};t.exports=o}}),MDi=At({"node_modules/@jscad/modeling/src/maths/line3/fromPlanes.js"(e,t){var n=ui(),{solve2Linear:o}=Mpe(),{EPS:r}=fc(),i=wpe(),s=(a,c,l)=>{let h=n.cross(n.create(),c,l),d=n.length(h);if(d<r)throw Error("parallel planes do not intersect");d=1/d,h=n.scale(h,h,d);let u=Math.abs(h[0]),_=Math.abs(h[1]),p=Math.abs(h[2]),m,A;if(u>=_&&u>=p)A=o(c[1],c[2],l[1],l[2],c[3],l[3]),m=n.fromValues(0,A[0],A[1]);else if(_>=u&&_>=p)A=o(c[0],c[2],l[0],l[2],c[3],l[3]),m=n.fromValues(A[0],0,A[1]);else A=o(c[0],c[1],l[0],l[1],c[3],l[3]),m=n.fromValues(A[0],A[1],0);return i(a,m,h)};t.exports=s}}),wDi=At({"node_modules/@jscad/modeling/src/maths/line3/fromPoints.js"(e,t){var n=ui(),o=wpe(),r=(i,s,a)=>{let c=n.subtract(n.create(),a,s);return o(i,s,c)};t.exports=r}}),BDi=At({"node_modules/@jscad/modeling/src/maths/line3/intersectPointOfLineAndPlane.js"(e,t){var n=ui(),o=(r,i)=>{let s=i,a=i[3],c=r[0],l=r[1],h=(a-n.dot(s,c))/n.dot(s,l);return n.add(n.create(),c,n.scale(n.create(),l,h))};t.exports=o}}),TDi=At({"node_modules/@jscad/modeling/src/maths/line3/origin.js"(e,t){var n=(o)=>o[0];t.exports=n}}),DDi=At({"node_modules/@jscad/modeling/src/maths/line3/reverse.js"(e,t){var n=ui(),o=wpe(),r=(i,s)=>{let a=n.clone(s[0]),c=n.negate(n.create(),s[1]);return o(i,a,c)};t.exports=r}}),NDi=At({"node_modules/@jscad/modeling/src/maths/line3/toString.js"(e,t){var n=(o)=>{let r=o[0],i=o[1];return`line3: point: (${r[0].toFixed(7)}, ${r[1].toFixed(7)}, ${r[2].toFixed(7)}) direction: (${i[0].toFixed(7)}, ${i[1].toFixed(7)}, ${i[2].toFixed(7)})`};t.exports=n}}),RDi=At({"node_modules/@jscad/modeling/src/maths/line3/transform.js"(e,t){var n=ui(),o=wpe(),r=(i,s,a)=>{let c=s[0],l=s[1],h=n.add(n.create(),c,l),d=n.transform(n.create(),c,a),u=n.transform(h,h,a),_=n.subtract(u,u,d);return o(i,d,_)};t.exports=r}}),QDi=At({"node_modules/@jscad/modeling/src/maths/line3/index.js"(e,t){t.exports={clone:IDi(),closestPoint:SXn(),copy:vDi(),create:vXn(),direction:SDi(),distanceToPoint:PDi(),equals:EDi(),fromPlanes:MDi(),fromPointAndDirection:wpe(),fromPoints:wDi(),intersectPointOfLineAndPlane:BDi(),origin:TDi(),reverse:DDi(),toString:NDi(),transform:RDi()}}}),kDi=At({"node_modules/@jscad/modeling/src/maths/index.js"(e,t){t.exports={constants:fc(),line2:Uut(),line3:QDi(),mat4:ld(),plane:EP(),utils:Mpe(),vec2:ya(),vec3:ui(),vec4:cXn()}}}),PXn=At({"node_modules/@jscad/modeling/src/measurements/measureArea.js"(e,t){var n=Is(),o=qs(),r=Os(),i=zh(),s=qa(),a=new WeakMap,c=()=>0,l=(u)=>{let _=a.get(u);if(_)return _;return _=o.toSides(u).reduce((m,A)=>m+(A[0][0]*A[1][1]-A[0][1]*A[1][0]),0),_*=0.5,a.set(u,_),_},h=(u)=>{let _=a.get(u);if(_)return _;return _=r.toPolygons(u).reduce((m,A)=>m+s.measureArea(A),0),a.set(u,_),_},d=(...u)=>{if(u=n(u),u.length===0)throw Error("wrong number of arguments");let _=u.map((p)=>{if(i.isA(p))return c(p);if(o.isA(p))return l(p);if(r.isA(p))return h(p);return 0});return _.length===1?_[0]:_};t.exports=d}}),LDi=At({"node_modules/@jscad/modeling/src/measurements/measureAggregateArea.js"(e,t){var n=Is(),o=PXn(),r=(...i)=>{if(i=n(i),i.length===0)throw Error("measureAggregateArea: no geometries supplied");let s=o(i);if(i.length===1)return s;let a=0;return s.reduce((c,l)=>c+l,a)};t.exports=r}}),wG=At({"node_modules/@jscad/modeling/src/measurements/measureBoundingBox.js"(e,t){var n=Is(),o=ya(),r=ui(),i=qs(),s=Os(),a=zh(),c=qa(),l=new WeakMap,h=(p)=>{let m=l.get(p);if(m)return m;let A=a.toPoints(p),g;if(A.length===0)g=o.create();else g=o.clone(A[0]);let f=o.clone(g);return A.forEach((y)=>{o.min(g,g,y),o.max(f,f,y)}),g=[g[0],g[1],0],f=[f[0],f[1],0],m=[g,f],l.set(p,m),m},d=(p)=>{let m=l.get(p);if(m)return m;let A=i.toPoints(p),g;if(A.length===0)g=o.create();else g=o.clone(A[0]);let f=o.clone(g);return A.forEach((y)=>{o.min(g,g,y),o.max(f,f,y)}),g=[g[0],g[1],0],f=[f[0],f[1],0],m=[g,f],l.set(p,m),m},u=(p)=>{let m=l.get(p);if(m)return m;let A=s.toPolygons(p),g=r.create();if(A.length>0){let y=c.toPoints(A[0]);r.copy(g,y[0])}let f=r.clone(g);return A.forEach((y)=>{c.toPoints(y).forEach((x)=>{r.min(g,g,x),r.max(f,f,x)})}),g=[g[0],g[1],g[2]],f=[f[0],f[1],f[2]],m=[g,f],l.set(p,m),m},_=(...p)=>{if(p=n(p),p.length===0)throw Error("wrong number of arguments");let m=p.map((A)=>{if(a.isA(A))return h(A);if(i.isA(A))return d(A);if(s.isA(A))return u(A);return[[0,0,0],[0,0,0]]});return m.length===1?m[0]:m};t.exports=_}}),Wut=At({"node_modules/@jscad/modeling/src/measurements/measureAggregateBoundingBox.js"(e,t){var n=Is(),o=zWn(),r=FWn(),i=wG(),s=(...a)=>{if(a=n(a),a.length===0)throw Error("measureAggregateBoundingBox: no geometries supplied");let c=i(a);if(a.length===1)return c;let l=[[Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE],[-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE]];return c.reduce((h,d)=>(h=[o(h[0],h[0],d[0]),r(h[1],h[1],d[1])],h),l)};t.exports=s}}),EXn=At({"node_modules/@jscad/modeling/src/measurements/calculateEpsilonFromBounds.js"(e,t){var{EPS:n}=fc(),o=(r,i)=>{let s=0;for(let a=0;a<i;a++)s+=r[1][a]-r[0][a];return n*s/i};t.exports=o}}),HDi=At({"node_modules/@jscad/modeling/src/measurements/measureAggregateEpsilon.js"(e,t){var n=Is(),o=Wut(),r=EXn(),{geom2:i,geom3:s,path2:a}=Out(),c=(...l)=>{if(l=n(l),l.length===0)throw Error("measureAggregateEpsilon: no geometries supplied");let h=o(l),d=0;return d=l.reduce((u,_)=>{if(a.isA(_)||i.isA(_))return Math.max(u,2);if(s.isA(_))return Math.max(u,3);return 0},d),r(h,d)};t.exports=c}}),MXn=At({"node_modules/@jscad/modeling/src/measurements/measureVolume.js"(e,t){var n=Is(),o=qs(),r=Os(),i=zh(),s=qa(),a=new WeakMap,c=()=>0,l=()=>0,h=(u)=>{let _=a.get(u);if(_)return _;return _=r.toPolygons(u).reduce((m,A)=>m+s.measureSignedVolume(A),0),a.set(u,_),_},d=(...u)=>{if(u=n(u),u.length===0)throw Error("wrong number of arguments");let _=u.map((p)=>{if(i.isA(p))return c(p);if(o.isA(p))return l(p);if(r.isA(p))return h(p);return 0});return _.length===1?_[0]:_};t.exports=d}}),FDi=At({"node_modules/@jscad/modeling/src/measurements/measureAggregateVolume.js"(e,t){var n=Is(),o=MXn(),r=(...i)=>{if(i=n(i),i.length===0)throw Error("measureAggregateVolume: no geometries supplied");let s=o(i);if(i.length===1)return s;let a=0;return s.reduce((c,l)=>c+l,a)};t.exports=r}}),zDi=At({"node_modules/@jscad/modeling/src/measurements/measureBoundingSphere.js"(e,t){var n=Is(),o=ya(),r=ui(),i=qs(),s=Os(),a=zh(),c=qa(),l=new WeakMap,h=(p)=>{let m=l.get(p);if(m!==void 0)return m;let A=r.create(),g=0,f=a.toPoints(p);if(f.length>0){let y=0,x=r.create();f.forEach((C)=>{r.add(A,A,r.fromVec2(x,C,0)),y++}),r.scale(A,A,1/y),f.forEach((C)=>{g=Math.max(g,o.squaredDistance(A,C))}),g=Math.sqrt(g)}return m=[A,g],l.set(p,m),m},d=(p)=>{let m=l.get(p);if(m!==void 0)return m;let A=r.create(),g=0,f=i.toSides(p);if(f.length>0){let y=0,x=r.create();f.forEach((C)=>{r.add(A,A,r.fromVec2(x,C[0],0)),y++}),r.scale(A,A,1/y),f.forEach((C)=>{g=Math.max(g,o.squaredDistance(A,C[0]))}),g=Math.sqrt(g)}return m=[A,g],l.set(p,m),m},u=(p)=>{let m=l.get(p);if(m!==void 0)return m;let A=r.create(),g=0,f=s.toPolygons(p);if(f.length>0){let y=0;f.forEach((x)=>{c.toPoints(x).forEach((C)=>{r.add(A,A,C),y++})}),r.scale(A,A,1/y),f.forEach((x)=>{c.toPoints(x).forEach((C)=>{g=Math.max(g,r.squaredDistance(A,C))})}),g=Math.sqrt(g)}return m=[A,g],l.set(p,m),m},_=(...p)=>{p=n(p);let m=p.map((A)=>{if(a.isA(A))return h(A);if(i.isA(A))return d(A);if(s.isA(A))return u(A);return[[0,0,0],0]});return m.length===1?m[0]:m};t.exports=_}}),ODi=At({"node_modules/@jscad/modeling/src/measurements/measureCenter.js"(e,t){var n=Is(),o=wG(),r=(...i)=>{i=n(i);let s=i.map((a)=>{let c=o(a);return[c[0][0]+(c[1][0]-c[0][0])/2,c[0][1]+(c[1][1]-c[0][1])/2,c[0][2]+(c[1][2]-c[0][2])/2]});return s.length===1?s[0]:s};t.exports=r}}),VDi=At({"node_modules/@jscad/modeling/src/measurements/measureCenterOfMass.js"(e,t){var n=Is(),o=ui(),r=qs(),i=Os(),s=new WeakMap,a=(h)=>{let d=s.get(h);if(d!==void 0)return d;let u=r.toSides(h),_=0,p=0,m=0;if(u.length>0){for(let g=0;g<u.length;g++){let f=u[g][0],y=u[g][1],x=f[0]*y[1]-f[1]*y[0];_+=x,p+=(f[0]+y[0])*x,m+=(f[1]+y[1])*x}_/=2;let A=1/(_*6);p*=A,m*=A}return d=o.fromValues(p,m,0),s.set(h,d),d},c=(h)=>{let d=s.get(h);if(d!==void 0)return d;d=o.create();let u=i.toPolygons(h);if(u.length===0)return d;let _=0,p=o.create();return u.forEach((m)=>{let A=m.vertices;for(let g=0;g<A.length-2;g++){o.cross(p,A[g+1],A[g+2]);let f=o.dot(A[0],p)/6;_+=f,o.add(p,A[0],A[g+1]),o.add(p,p,A[g+2]);let y=o.scale(p,p,0.25*f);o.add(d,d,y)}}),o.scale(d,d,1/_),s.set(h,d),d},l=(...h)=>{h=n(h);let d=h.map((u)=>{if(r.isA(u))return a(u);if(i.isA(u))return c(u);return[0,0,0]});return d.length===1?d[0]:d};t.exports=l}}),YDi=At({"node_modules/@jscad/modeling/src/measurements/measureDimensions.js"(e,t){var n=Is(),o=wG(),r=(...i)=>{i=n(i);let s=i.map((a)=>{let c=o(a);return[c[1][0]-c[0][0],c[1][1]-c[0][1],c[1][2]-c[0][2]]});return s.length===1?s[0]:s};t.exports=r}}),IL=At({"node_modules/@jscad/modeling/src/measurements/measureEpsilon.js"(e,t){var n=Is(),{geom2:o,geom3:r,path2:i}=Out(),s=EXn(),a=wG(),c=(u)=>s(a(u),2),l=(u)=>s(a(u),2),h=(u)=>s(a(u),3),d=(...u)=>{if(u=n(u),u.length===0)throw Error("wrong number of arguments");let _=u.map((p)=>{if(i.isA(p))return c(p);if(o.isA(p))return l(p);if(r.isA(p))return h(p);return 0});return _.length===1?_[0]:_};t.exports=d}}),wXn=At({"node_modules/@jscad/modeling/src/measurements/index.js"(e,t){t.exports={measureAggregateArea:LDi(),measureAggregateBoundingBox:Wut(),measureAggregateEpsilon:HDi(),measureAggregateVolume:FDi(),measureArea:PXn(),measureBoundingBox:wG(),measureBoundingSphere:zDi(),measureCenter:ODi(),measureCenterOfMass:VDi(),measureDimensions:YDi(),measureEpsilon:IL(),measureVolume:MXn()}}}),Sg=At({"node_modules/@jscad/modeling/src/primitives/commonChecks.js"(e,t){var n=(i,s)=>{if(Array.isArray(i)&&i.length>=s)return i.every((a)=>Number.isFinite(a));return!1},o=(i,s)=>Number.isFinite(i)&&i>s,r=(i,s)=>Number.isFinite(i)&&i>=s;t.exports={isNumberArray:n,isGT:o,isGTE:r}}}),GDi=At({"node_modules/@jscad/modeling/src/primitives/arc.js"(e,t){var{EPS:n,TAU:o}=fc(),r=ya(),i=zh(),{isGT:s,isGTE:a,isNumberArray:c}=Sg(),l=(h)=>{let d={center:[0,0],radius:1,startAngle:0,endAngle:o,makeTangent:!1,segments:32},{center:u,radius:_,startAngle:p,endAngle:m,makeTangent:A,segments:g}=Object.assign({},d,h);if(!c(u,2))throw Error("center must be an array of X and Y values");if(!s(_,0))throw Error("radius must be greater than zero");if(!a(p,0))throw Error("startAngle must be positive");if(!a(m,0))throw Error("endAngle must be positive");if(!a(g,4))throw Error("segments must be four or more");p=p%o,m=m%o;let f=o;if(p<m)f=m-p;if(p>m)f=m+(o-p);let y=Math.acos((_*_+_*_-n*n)/(2*_*_)),x=r.clone(u),C,b=[];if(f<y)C=r.fromAngleRadians(r.create(),p),r.scale(C,C,_),r.add(C,C,x),b.push(C);else{let I=Math.floor(g*(Math.abs(f)/o)),v=I*0.5/f;if(v>0.25)v=0.25;let P=A?I+2:I;for(let M=0;M<=P;M++){let B=M;if(A){if(B=(M-1)*(I-2*v)/I+v,B<0)B=0;if(B>I)B=I}let T=p+B*(f/I);C=r.fromAngleRadians(r.create(),T),r.scale(C,C,_),r.add(C,C,x),b.push(C)}}return i.fromPoints({closed:!1},b)};t.exports=l}}),BXn=At({"node_modules/@jscad/modeling/src/primitives/ellipse.js"(e,t){var{EPS:n,TAU:o}=fc(),r=ya(),i=qs(),{sin:s,cos:a}=Vf(),{isGTE:c,isNumberArray:l}=Sg(),h=(d)=>{let u={center:[0,0],radius:[1,1],startAngle:0,endAngle:o,segments:32},{center:_,radius:p,startAngle:m,endAngle:A,segments:g}=Object.assign({},u,d);if(!l(_,2))throw Error("center must be an array of X and Y values");if(!l(p,2))throw Error("radius must be an array of X and Y values");if(!p.every((v)=>v>=0))throw Error("radius values must be positive");if(!c(m,0))throw Error("startAngle must be positive");if(!c(A,0))throw Error("endAngle must be positive");if(!c(g,3))throw Error("segments must be three or more");if(p[0]===0||p[1]===0)return i.create();m=m%o,A=A%o;let f=o;if(m<A)f=A-m;if(m>A)f=A+(o-m);let y=Math.min(p[0],p[1]),x=Math.acos((y*y+y*y-n*n)/(2*y*y));if(f<x)throw Error("startAngle and endAngle do not define a significant rotation");g=Math.floor(g*(f/o));let C=r.clone(_),b=f/g,I=[];g=f<o?g+1:g;for(let v=0;v<g;v++){let P=b*v+m,M=r.fromValues(p[0]*a(P),p[1]*s(P));r.add(M,C,M),I.push(M)}if(f<o)I.push(C);return i.fromPoints(I)};t.exports=h}}),TXn=At({"node_modules/@jscad/modeling/src/primitives/circle.js"(e,t){var{TAU:n}=fc(),o=BXn(),{isGTE:r}=Sg(),i=(s)=>{let a={center:[0,0],radius:1,startAngle:0,endAngle:n,segments:32},{center:c,radius:l,startAngle:h,endAngle:d,segments:u}=Object.assign({},a,s);if(!r(l,0))throw Error("radius must be positive");return l=[l,l],o({center:c,radius:l,startAngle:h,endAngle:d,segments:u})};t.exports=i}}),Xut=At({"node_modules/@jscad/modeling/src/primitives/cuboid.js"(e,t){var n=Os(),o=qa(),{isNumberArray:r}=Sg(),i=(s)=>{let a={center:[0,0,0],size:[2,2,2]},{center:c,size:l}=Object.assign({},a,s);if(!r(c,3))throw Error("center must be an array of X, Y and Z values");if(!r(l,3))throw Error("size must be an array of width, depth and height values");if(!l.every((d)=>d>=0))throw Error("size values must be positive");if(l[0]===0||l[1]===0||l[2]===0)return n.create();return n.create([[[0,4,6,2],[-1,0,0]],[[1,3,7,5],[1,0,0]],[[0,1,5,4],[0,-1,0]],[[2,6,7,3],[0,1,0]],[[0,2,3,1],[0,0,-1]],[[4,5,7,6],[0,0,1]]].map((d)=>{let u=d[0].map((_)=>[c[0]+l[0]/2*(2*!!(_&1)-1),c[1]+l[1]/2*(2*!!(_&2)-1),c[2]+l[2]/2*(2*!!(_&4)-1)]);return o.create(u)}))};t.exports=i}}),UDi=At({"node_modules/@jscad/modeling/src/primitives/cube.js"(e,t){var n=Xut(),{isGTE:o}=Sg(),r=(i)=>{let s={center:[0,0,0],size:2},{center:a,size:c}=Object.assign({},s,i);if(!o(c,0))throw Error("size must be positive");return c=[c,c,c],n({center:a,size:c})};t.exports=r}}),DXn=At({"node_modules/@jscad/modeling/src/primitives/cylinderElliptic.js"(e,t){var{EPS:n,TAU:o}=fc(),r=ui(),i=Os(),s=qa(),{sin:a,cos:c}=Vf(),{isGT:l,isGTE:h,isNumberArray:d}=Sg(),u=(_)=>{let p={center:[0,0,0],height:2,startRadius:[1,1],startAngle:0,endRadius:[1,1],endAngle:o,segments:32},{center:m,height:A,startRadius:g,startAngle:f,endRadius:y,endAngle:x,segments:C}=Object.assign({},p,_);if(!d(m,3))throw Error("center must be an array of X, Y and Z values");if(!l(A,0))throw Error("height must be greater then zero");if(!d(g,2))throw Error("startRadius must be an array of X and Y values");if(!g.every((X)=>X>=0))throw Error("startRadius values must be positive");if(!d(y,2))throw Error("endRadius must be an array of X and Y values");if(!y.every((X)=>X>=0))throw Error("endRadius values must be positive");if(y.every((X)=>X===0)&&g.every((X)=>X===0))throw Error("at least one radius must be positive");if(!h(f,0))throw Error("startAngle must be positive");if(!h(x,0))throw Error("endAngle must be positive");if(!h(C,4))throw Error("segments must be four or more");f=f%o,x=x%o;let b=o;if(f<x)b=x-f;if(f>x)b=x+(o-f);let I=Math.min(g[0],g[1],y[0],y[1]),v=Math.acos((I*I+I*I-n*n)/(2*I*I));if(b<v)throw Error("startAngle and endAngle do not define a significant rotation");let P=Math.floor(C*(b/o)),M=r.fromValues(0,0,-(A/2)),B=r.fromValues(0,0,A/2),T=r.subtract(r.create(),B,M),N=r.fromValues(1,0,0),D=r.fromValues(0,1,0),L=r.create(),H=r.create(),V=r.create(),O=(X,K,J)=>{let ee=K*b+f;return r.scale(L,N,J[0]*c(ee)),r.scale(H,D,J[1]*a(ee)),r.add(L,L,H),r.scale(V,T,X),r.add(V,V,M),r.add(r.create(),L,V)},U=(...X)=>{let K=X.map((J)=>r.add(r.create(),J,m));return s.create(K)},j=[];for(let X=0;X<P;X++){let K=X/P,J=(X+1)/P;if(b===o&&X===P-1)J=0;if(y[0]===g[0]&&y[1]===g[1])j.push(U(M,O(0,J,y),O(0,K,y))),j.push(U(O(0,J,y),O(1,J,y),O(1,K,y),O(0,K,y))),j.push(U(B,O(1,K,y),O(1,J,y)));else{if(g[0]>0&&g[1]>0)j.push(U(M,O(0,J,g),O(0,K,g)));if(g[0]>0||g[1]>0)j.push(U(O(0,K,g),O(0,J,g),O(1,K,y)));if(y[0]>0&&y[1]>0)j.push(U(B,O(1,K,y),O(1,J,y)));if(y[0]>0||y[1]>0)j.push(U(O(1,K,y),O(0,J,g),O(1,J,y)))}}if(b<o)j.push(U(M,O(0,0,g),B)),j.push(U(O(0,0,g),O(1,0,y),B)),j.push(U(M,B,O(0,1,g))),j.push(U(O(0,1,g),B,O(1,1,y)));return i.create(j)};t.exports=u}}),NXn=At({"node_modules/@jscad/modeling/src/primitives/cylinder.js"(e,t){var n=Os(),o=DXn(),{isGTE:r}=Sg(),i=(s)=>{let a={center:[0,0,0],height:2,radius:1,segments:32},{center:c,height:l,radius:h,segments:d}=Object.assign({},a,s);if(!r(h,0))throw Error("radius must be positive");if(l===0||h===0)return n.create();return o({center:c,height:l,startRadius:[h,h],endRadius:[h,h],segments:d})};t.exports=i}}),RXn=At({"node_modules/@jscad/modeling/src/primitives/ellipsoid.js"(e,t){var{TAU:n}=fc(),o=ui(),r=Os(),i=qa(),{sin:s,cos:a}=Vf(),{isGTE:c,isNumberArray:l}=Sg(),h=(d)=>{let u={center:[0,0,0],radius:[1,1,1],segments:32,axes:[[1,0,0],[0,-1,0],[0,0,1]]},{center:_,radius:p,segments:m,axes:A}=Object.assign({},u,d);if(!l(_,3))throw Error("center must be an array of X, Y and Z values");if(!l(p,3))throw Error("radius must be an array of X, Y and Z values");if(!p.every((P)=>P>=0))throw Error("radius values must be positive");if(!c(m,4))throw Error("segments must be four or more");if(p[0]===0||p[1]===0||p[2]===0)return r.create();let g=o.scale(o.create(),o.normalize(o.create(),A[0]),p[0]),f=o.scale(o.create(),o.normalize(o.create(),A[1]),p[1]),y=o.scale(o.create(),o.normalize(o.create(),A[2]),p[2]),x=Math.round(m/4),C,b=[],I=o.create(),v=o.create();for(let P=0;P<=m;P++){let M=n*P/m,B=o.add(o.create(),o.scale(I,g,a(M)),o.scale(v,f,s(M)));if(P>0){let T,N;for(let D=0;D<=x;D++){let L=n/4*D/x,H=a(L),V=s(L);if(D>0){let O=[],U;if(U=o.subtract(o.create(),o.scale(I,C,T),o.scale(v,y,N)),O.push(o.add(U,U,_)),U=o.subtract(o.create(),o.scale(I,B,T),o.scale(v,y,N)),O.push(o.add(U,U,_)),D<x)U=o.subtract(o.create(),o.scale(I,B,H),o.scale(v,y,V)),O.push(o.add(U,U,_));if(U=o.subtract(o.create(),o.scale(I,C,H),o.scale(v,y,V)),O.push(o.add(U,U,_)),b.push(i.create(O)),O=[],U=o.add(o.create(),o.scale(I,C,T),o.scale(v,y,N)),O.push(o.add(o.create(),_,U)),U=o.add(U,o.scale(I,B,T),o.scale(v,y,N)),O.push(o.add(o.create(),_,U)),D<x)U=o.add(U,o.scale(I,B,H),o.scale(v,y,V)),O.push(o.add(o.create(),_,U));U=o.add(U,o.scale(I,C,H),o.scale(v,y,V)),O.push(o.add(o.create(),_,U)),O.reverse(),b.push(i.create(O))}T=H,N=V}}C=B}return r.create(b)};t.exports=h}}),QXn=At({"node_modules/@jscad/modeling/src/primitives/polyhedron.js"(e,t){var n=Os(),o=qa(),{isNumberArray:r}=Sg(),i=(s)=>{let a={points:[],faces:[],colors:void 0,orientation:"outward"},{points:c,faces:l,colors:h,orientation:d}=Object.assign({},a,s);if(!(Array.isArray(c)&&Array.isArray(l)))throw Error("points and faces must be arrays");if(c.length<3)throw Error("three or more points are required");if(l.length<1)throw Error("one or more faces are required");if(h){if(!Array.isArray(h))throw Error("colors must be an array");if(h.length!==l.length)throw Error("faces and colors must have the same length")}if(c.forEach((_,p)=>{if(!r(_,3))throw Error(`point ${p} must be an array of X, Y, Z values`)}),l.forEach((_,p)=>{if(_.length<3)throw Error(`face ${p} must contain 3 or more indexes`);if(!r(_,_.length))throw Error(`face ${p} must be an array of numbers`)}),d!=="outward")l.forEach((_)=>_.reverse());let u=l.map((_,p)=>{let m=o.create(_.map((A)=>c[A]));if(h&&h[p])m.color=h[p];return m});return n.create(u)};t.exports=i}}),WDi=At({"node_modules/@jscad/modeling/src/primitives/geodesicSphere.js"(e,t){var n=ld(),o=ui(),r=Os(),i=QXn(),{isGTE:s}=Sg(),a=(c)=>{let l={radius:1,frequency:6},{radius:h,frequency:d}=Object.assign({},l,c);if(!s(h,0))throw Error("radius must be positive");if(!s(d,6))throw Error("frequency must be six or more");if(h===0)return r.create();d=Math.floor(d/6);let u=[[0.850651,0,-0.525731],[0.850651,-0,0.525731],[-0.850651,-0,0.525731],[-0.850651,0,-0.525731],[0,-0.525731,0.850651],[0,0.525731,0.850651],[0,0.525731,-0.850651],[0,-0.525731,-0.850651],[-0.525731,-0.850651,-0],[0.525731,-0.850651,-0],[0.525731,0.850651,0],[-0.525731,0.850651,0]],_=[[0,9,1],[1,10,0],[6,7,0],[10,6,0],[7,9,0],[5,1,4],[4,1,9],[5,10,1],[2,8,3],[3,11,2],[2,5,4],[4,8,2],[2,11,5],[3,7,6],[6,11,3],[8,7,3],[9,8,4],[11,10,5],[10,11,6],[8,9,7]],p=(x,C,b)=>{let I=x[0],v=x[1],P=x[2],M=b,B=[],T=[];for(let N=0;N<C;N++)for(let D=0;D<C-N;D++){let L=N/C,H=(N+1)/C,V=D/(C-N),O=(D+1)/(C-N),U=C-N-1?D/(C-N-1):1,j=[];j[0]=m(m(I,v,V),P,L),j[1]=m(m(I,v,O),P,L),j[2]=m(m(I,v,U),P,H);for(let Y=0;Y<3;Y++){let X=o.length(j[Y]);for(let K=0;K<3;K++)j[Y][K]/=X}if(B.push(j[0],j[1],j[2]),T.push([M,M+1,M+2]),M+=3,D<C-N-1){let Y=C-N-1?(D+1)/(C-N-1):1;j[0]=m(m(I,v,O),P,L),j[1]=m(m(I,v,Y),P,H),j[2]=m(m(I,v,U),P,H);for(let X=0;X<3;X++){let K=o.length(j[X]);for(let J=0;J<3;J++)j[X][J]/=K}B.push(j[0],j[1],j[2]),T.push([M,M+1,M+2]),M+=3}}return{points:B,triangles:T,offset:M}},m=(x,C,b)=>{let I=1-b,v=[];for(let P=0;P<3;P++)v[P]=x[P]*I+C[P]*b;return v},A=[],g=[],f=0;for(let x=0;x<_.length;x++){let C=p([u[_[x][0]],u[_[x][1]],u[_[x][2]]],d,f);A=A.concat(C.points),g=g.concat(C.triangles),f=C.offset}let y=i({points:A,faces:g,orientation:"inward"});if(h!==1)y=r.transform(n.fromScaling(n.create(),[h,h,h]),y);return y};t.exports=a}}),XDi=At({"node_modules/@jscad/modeling/src/primitives/line.js"(e,t){var n=zh(),o=(r)=>{if(!Array.isArray(r))throw Error("points must be an array");return n.fromPoints({},r)};t.exports=o}}),jDi=At({"node_modules/@jscad/modeling/src/primitives/polygon.js"(e,t){var n=qs(),o=(r)=>{let i={points:[],paths:[],orientation:"counterclockwise"},{points:s,paths:a,orientation:c}=Object.assign({},i,r);if(!(Array.isArray(s)&&Array.isArray(a)))throw Error("points and paths must be arrays");let l=s;if(Array.isArray(s[0])){if(!Array.isArray(s[0][0]))l=[s]}l.forEach((p,m)=>{if(!Array.isArray(p))throw Error("list of points "+m+" must be an array");if(p.length<3)throw Error("list of points "+m+" must contain three or more points");p.forEach((A,g)=>{if(!Array.isArray(A))throw Error("list of points "+m+", point "+g+" must be an array");if(A.length<2)throw Error("list of points "+m+", point "+g+" must contain by X and Y values")})});let h=a;if(a.length===0){let p=0;h=l.map((m)=>m.map((A)=>p++))}let d=[];l.forEach((p)=>p.forEach((m)=>d.push(m)));let u=[];h.forEach((p)=>{let m=p.map((g)=>d[g]),A=n.fromPoints(m);u=u.concat(n.toSides(A))});let _=n.create(u);if(c==="clockwise")_=n.reverse(_);return _};t.exports=o}}),jut=At({"node_modules/@jscad/modeling/src/primitives/rectangle.js"(e,t){var n=ya(),o=qs(),{isNumberArray:r}=Sg(),i=(s)=>{let a={center:[0,0],size:[2,2]},{center:c,size:l}=Object.assign({},a,s);if(!r(c,2))throw Error("center must be an array of X and Y values");if(!r(l,2))throw Error("size must be an array of X and Y values");if(!l.every((_)=>_>=0))throw Error("size values must be positive");if(l[0]===0||l[1]===0)return o.create();let h=[l[0]/2,l[1]/2],d=[h[0],-h[1]],u=[n.subtract(n.create(),c,h),n.add(n.create(),c,d),n.add(n.create(),c,h),n.subtract(n.create(),c,d)];return o.fromPoints(u)};t.exports=i}}),KDi=At({"node_modules/@jscad/modeling/src/primitives/roundedCuboid.js"(e,t){var{EPS:n,TAU:o}=fc(),r=ya(),i=ui(),s=Os(),a=qa(),{sin:c,cos:l}=Vf(),{isGTE:h,isNumberArray:d}=Sg(),u=Xut(),_=(f,y,x,C,b,I)=>{let v=o/4*b/C,P=l(v),M=c(v),B=C-b,T=x*P,N=y[2]-(x-x*M);if(!I)N=x-x*M-y[2];T=T>n?T:0;let D=i.add(i.create(),f,[y[0]-x,y[1]-x,N]),L=i.add(i.create(),f,[x-y[0],y[1]-x,N]),H=i.add(i.create(),f,[x-y[0],x-y[1],N]),V=i.add(i.create(),f,[y[0]-x,x-y[1],N]),O=[],U=[],j=[],Y=[];for(let X=0;X<=B;X++){let K=B>0?o/4*X/B:0,J=r.fromAngleRadians(r.create(),K);r.scale(J,J,T);let ee=i.fromVec2(i.create(),J);O.push(i.add(i.create(),D,ee)),i.rotateZ(ee,ee,[0,0,0],o/4),U.push(i.add(i.create(),L,ee)),i.rotateZ(ee,ee,[0,0,0],o/4),j.push(i.add(i.create(),H,ee)),i.rotateZ(ee,ee,[0,0,0],o/4),Y.push(i.add(i.create(),V,ee))}if(!I)return O.reverse(),U.reverse(),j.reverse(),Y.reverse(),[Y,j,U,O];return[O,U,j,Y]},p=(f,y)=>{let x=[];for(let C=0;C<f.length;C++){let b=f[C],I=y[C];for(let v=0;v<b.length-1;v++)if(x.push(a.create([b[v],b[v+1],I[v]])),v<I.length-1)x.push(a.create([I[v],b[v+1],I[v+1]]))}return x},m=(f,y)=>{let x=[];for(let C=0;C<f.length;C++){let b=f[C],I=y[C],v=b[b.length-1],P=I[I.length-1],M=(C+1)%f.length;b=f[M],I=y[M];let B=b[0],T=I[0];x.push(a.create([v,B,T,P]))}return x},A=(f,y)=>{f=[f[3],f[2],f[1],f[0]],f=f.map((I)=>I.slice().reverse());let x=[];f.forEach((I)=>{I.forEach((v)=>x.push(v))});let C=[];y.forEach((I)=>{I.forEach((v)=>C.push(v))});let b=[];for(let I=0;I<C.length;I++){let v=(I+1)%C.length;b.push(a.create([x[I],x[v],C[v],C[I]]))}return b},g=(f)=>{let y={center:[0,0,0],size:[2,2,2],roundRadius:0.2,segments:32},{center:x,size:C,roundRadius:b,segments:I}=Object.assign({},y,f);if(!d(x,3))throw Error("center must be an array of X, Y and Z values");if(!d(C,3))throw Error("size must be an array of X, Y and Z values");if(!C.every((B)=>B>=0))throw Error("size values must be positive");if(!h(b,0))throw Error("roundRadius must be positive");if(!h(I,4))throw Error("segments must be four or more");if(C[0]===0||C[1]===0||C[2]===0)return s.create();if(b===0)return u({center:x,size:C});if(C=C.map((B)=>B/2),b>C[0]-n||b>C[1]-n||b>C[2]-n)throw Error("roundRadius must be smaller than the radius of all dimensions");I=Math.floor(I/4);let v=null,P=null,M=[];for(let B=0;B<=I;B++){let T=_(x,C,b,I,B,!0),N=_(x,C,b,I,B,!1);if(B===0)M=M.concat(A(N,T));if(v)M=M.concat(p(v,T),m(v,T));if(P)M=M.concat(p(P,N),m(P,N));if(B===I){let D=T.map((L)=>L[0]);M.push(a.create(D)),D=N.map((L)=>L[0]),M.push(a.create(D))}v=T,P=N}return s.create(M)};t.exports=g}}),$Di=At({"node_modules/@jscad/modeling/src/primitives/roundedCylinder.js"(e,t){var{EPS:n,TAU:o}=fc(),r=ui(),i=Os(),s=qa(),{sin:a,cos:c}=Vf(),{isGTE:l,isNumberArray:h}=Sg(),d=NXn(),u=(_)=>{let p={center:[0,0,0],height:2,radius:1,roundRadius:0.2,segments:32},{center:m,height:A,radius:g,roundRadius:f,segments:y}=Object.assign({},p,_);if(!h(m,3))throw Error("center must be an array of X, Y and Z values");if(!l(A,0))throw Error("height must be positive");if(!l(g,0))throw Error("radius must be positive");if(!l(f,0))throw Error("roundRadius must be positive");if(f>g)throw Error("roundRadius must be smaller than the radius");if(!l(y,4))throw Error("segments must be four or more");if(A===0||g===0)return i.create();if(f===0)return d({center:m,height:A,radius:g});let x=[0,0,-(A/2)],C=[0,0,A/2],b=r.subtract(r.create(),C,x),I=r.length(b);if(2*f>I-n)throw Error("height must be larger than twice roundRadius");let v;if(Math.abs(b[0])>Math.abs(b[1]))v=r.fromValues(0,1,0);else v=r.fromValues(1,0,0);let P=r.scale(r.create(),r.normalize(r.create(),b),f),M=r.scale(r.create(),r.normalize(r.create(),r.cross(r.create(),P,v)),g),B=r.scale(r.create(),r.normalize(r.create(),r.cross(r.create(),M,P)),g);r.add(x,x,P),r.subtract(C,C,P);let T=Math.floor(0.25*y),N=(U)=>{let j=U.map((Y)=>r.add(Y,Y,m));return s.create(j)},D=[],L=r.create(),H=r.create(),V;for(let U=0;U<=y;U++){let j=o*U/y,Y=r.add(r.create(),r.scale(L,M,c(j)),r.scale(H,B,a(j)));if(U>0){let X=[];X.push(r.add(r.create(),x,Y)),X.push(r.add(r.create(),x,V)),X.push(r.add(r.create(),C,V)),X.push(r.add(r.create(),C,Y)),D.push(N(X));let K,J;for(let ee=0;ee<=T;ee++){let se=o/4*ee/T,ne=c(se),re=a(se);if(ee>0){X=[];let Z;if(Z=r.add(r.create(),x,r.subtract(L,r.scale(L,V,K),r.scale(H,P,J))),X.push(Z),Z=r.add(r.create(),x,r.subtract(L,r.scale(L,Y,K),r.scale(H,P,J))),X.push(Z),ee<T)Z=r.add(r.create(),x,r.subtract(L,r.scale(L,Y,ne),r.scale(H,P,re))),X.push(Z);if(Z=r.add(r.create(),x,r.subtract(L,r.scale(L,V,ne),r.scale(H,P,re))),X.push(Z),D.push(N(X)),X=[],Z=r.add(r.create(),r.scale(L,V,K),r.scale(H,P,J)),r.add(Z,Z,C),X.push(Z),Z=r.add(r.create(),r.scale(L,Y,K),r.scale(H,P,J)),r.add(Z,Z,C),X.push(Z),ee<T)Z=r.add(r.create(),r.scale(L,Y,ne),r.scale(H,P,re)),r.add(Z,Z,C),X.push(Z);Z=r.add(r.create(),r.scale(L,V,ne),r.scale(H,P,re)),r.add(Z,Z,C),X.push(Z),X.reverse(),D.push(N(X))}K=ne,J=re}}V=Y}return i.create(D)};t.exports=u}}),qDi=At({"node_modules/@jscad/modeling/src/primitives/roundedRectangle.js"(e,t){var{EPS:n,TAU:o}=fc(),r=ya(),i=qs(),{isGTE:s,isNumberArray:a}=Sg(),c=jut(),l=(h)=>{let d={center:[0,0],size:[2,2],roundRadius:0.2,segments:32},{center:u,size:_,roundRadius:p,segments:m}=Object.assign({},d,h);if(!a(u,2))throw Error("center must be an array of X and Y values");if(!a(_,2))throw Error("size must be an array of X and Y values");if(!_.every((P)=>P>=0))throw Error("size values must be positive");if(!s(p,0))throw Error("roundRadius must be positive");if(!s(m,4))throw Error("segments must be four or more");if(_[0]===0||_[1]===0)return i.create();if(p===0)return c({center:u,size:_});if(_=_.map((P)=>P/2),p>_[0]-n||p>_[1]-n)throw Error("roundRadius must be smaller than the radius of all dimensions");let A=Math.floor(m/4),g=r.add(r.create(),u,[_[0]-p,_[1]-p]),f=r.add(r.create(),u,[p-_[0],_[1]-p]),y=r.add(r.create(),u,[p-_[0],p-_[1]]),x=r.add(r.create(),u,[_[0]-p,p-_[1]]),C=[],b=[],I=[],v=[];for(let P=0;P<=A;P++){let M=o/4*P/A,B=r.fromAngleRadians(r.create(),M);r.scale(B,B,p),C.push(r.add(r.create(),g,B)),r.rotate(B,B,r.create(),o/4),b.push(r.add(r.create(),f,B)),r.rotate(B,B,r.create(),o/4),I.push(r.add(r.create(),y,B)),r.rotate(B,B,r.create(),o/4),v.push(r.add(r.create(),x,B))}return i.fromPoints(C.concat(b,I,v))};t.exports=l}}),kXn=At({"node_modules/@jscad/modeling/src/primitives/sphere.js"(e,t){var n=RXn(),{isGTE:o}=Sg(),r=(i)=>{let s={center:[0,0,0],radius:1,segments:32,axes:[[1,0,0],[0,-1,0],[0,0,1]]},{center:a,radius:c,segments:l,axes:h}=Object.assign({},s,i);if(!o(c,0))throw Error("radius must be positive");return c=[c,c,c],n({center:a,radius:c,segments:l,axes:h})};t.exports=r}}),JDi=At({"node_modules/@jscad/modeling/src/primitives/square.js"(e,t){var n=jut(),{isGTE:o}=Sg(),r=(i)=>{let s={center:[0,0],size:2},{center:a,size:c}=Object.assign({},s,i);if(!o(c,0))throw Error("size must be positive");return c=[c,c],n({center:a,size:c})};t.exports=r}}),ZDi=At({"node_modules/@jscad/modeling/src/primitives/star.js"(e,t){var{TAU:n}=fc(),o=ya(),r=qs(),{isGT:i,isGTE:s,isNumberArray:a}=Sg(),c=(d,u)=>{if(d>0&&u>1&&u<d/2)return Math.cos(Math.PI*u/d)/Math.cos(Math.PI*(u-1)/d);return 0},l=(d,u,_,p)=>{let m=n/d,A=[];for(let g=0;g<d;g++){let f=o.fromAngleRadians(o.create(),m*g+_);o.scale(f,f,u),o.add(f,p,f),A.push(f)}return A},h=(d)=>{let u={center:[0,0],vertices:5,outerRadius:1,innerRadius:0,density:2,startAngle:0},{center:_,vertices:p,outerRadius:m,innerRadius:A,density:g,startAngle:f}=Object.assign({},u,d);if(!a(_,2))throw Error("center must be an array of X and Y values");if(!s(p,2))throw Error("vertices must be two or more");if(!i(m,0))throw Error("outerRadius must be greater than zero");if(!s(A,0))throw Error("innerRadius must be greater than zero");if(!s(f,0))throw Error("startAngle must be greater than zero");if(p=Math.floor(p),g=Math.floor(g),f=f%n,A===0){if(!s(g,2))throw Error("density must be two or more");A=m*c(p,g)}let y=o.clone(_),x=l(p,m,f,y),C=l(p,A,f+Math.PI/p,y),b=[];for(let I=0;I<p;I++)b.push(x[I]),b.push(C[I]);return r.fromPoints(b)};t.exports=h}}),cpe=At({"node_modules/@jscad/modeling/src/operations/transforms/mirror.js"(e,t){var n=Is(),o=ld(),r=EP(),i=qs(),s=Os(),a=zh(),c=(u,..._)=>{let p={origin:[0,0,0],normal:[0,0,1]},{origin:m,normal:A}=Object.assign({},p,u);if(_=n(_),_.length===0)throw Error("wrong number of arguments");let g=r.fromNormalAndPoint(r.create(),A,m);if(Number.isNaN(g[0]))throw Error("the given origin and normal do not define a proper plane");let f=o.mirrorByPlane(o.create(),g),y=_.map((x)=>{if(a.isA(x))return a.transform(f,x);if(i.isA(x))return i.transform(f,x);if(s.isA(x))return s.transform(f,x);return x});return y.length===1?y[0]:y},l=(...u)=>c({normal:[1,0,0]},u),h=(...u)=>c({normal:[0,1,0]},u),d=(...u)=>c({normal:[0,0,1]},u);t.exports={mirror:c,mirrorX:l,mirrorY:h,mirrorZ:d}}}),LXn=At({"node_modules/@jscad/modeling/src/operations/extrusions/slice/calculatePlane.js"(e,t){var n=EP(),o=ui(),r=(i)=>{let s=i.edges;if(s.length<3)throw Error("slices must have 3 or more edges to calculate a plane");let a=s.reduce((d,u)=>o.add(o.create(),d,u[0]),o.create());o.scale(a,a,1/s.length);let c,l=0;s.forEach((d)=>{if(!o.equals(d[0],d[1])){let u=o.squaredDistance(a,d[0]);if(u>l)c=d,l=u}});let h=s.find((d)=>o.equals(d[1],c[0]));return n.fromPoints(n.create(),h[0],c[0],c[1])};t.exports=r}}),BG=At({"node_modules/@jscad/modeling/src/operations/extrusions/slice/create.js"(e,t){var n=(o)=>{if(!o)o=[];return{edges:o}};t.exports=n}}),eNi=At({"node_modules/@jscad/modeling/src/operations/extrusions/slice/clone.js"(e,t){var n=BG(),o=ui(),r=(...i)=>{let s,a;if(i.length===1)s=n(),a=i[0];else s=i[0],a=i[1];return s.edges=a.edges.map((c)=>[o.clone(c[0]),o.clone(c[1])]),s};t.exports=r}}),tNi=At({"node_modules/@jscad/modeling/src/operations/extrusions/slice/equals.js"(e,t){var n=ui(),o=(r,i)=>{let s=r.edges,a=i.edges;if(s.length!==a.length)return!1;return s.reduce((l,h,d)=>{let u=a[d],_=n.squaredDistance(h[0],u[0]);return l&&_<Number.EPSILON},!0)};t.exports=o}}),nNi=At({"node_modules/@jscad/modeling/src/operations/extrusions/slice/fromPoints.js"(e,t){var n=ui(),o=BG(),r=(i)=>{if(!Array.isArray(i))throw Error("the given points must be an array");if(i.length<3)throw Error("the given points must contain THREE or more points");let s=[],a=i[i.length-1];return i.forEach((c)=>{if(c.length===2)s.push([n.fromVec2(n.create(),a),n.fromVec2(n.create(),c)]);if(c.length===3)s.push([a,c]);a=c}),o(s)};t.exports=r}}),oNi=At({"node_modules/@jscad/modeling/src/operations/extrusions/slice/fromSides.js"(e,t){var n=ui(),o=BG(),r=(i)=>{if(!Array.isArray(i))throw Error("the given sides must be an array");let s=[];return i.forEach((a)=>{s.push([n.fromVec2(n.create(),a[0]),n.fromVec2(n.create(),a[1])])}),o(s)};t.exports=r}}),rNi=At({"node_modules/@jscad/modeling/src/operations/extrusions/slice/isA.js"(e,t){var n=(o)=>{if(o&&typeof o==="object"){if("edges"in o){if(Array.isArray(o.edges))return!0}}return!1};t.exports=n}}),iNi=At({"node_modules/@jscad/modeling/src/operations/extrusions/slice/reverse.js"(e,t){var n=BG(),o=(...r)=>{let i,s;if(r.length===1)i=n(),s=r[0];else i=r[0],s=r[1];return i.edges=s.edges.map((a)=>[a[1],a[0]]),i};t.exports=o}}),sNi=At({"node_modules/@jscad/modeling/src/operations/extrusions/slice/toEdges.js"(e,t){var n=(o)=>o.edges;t.exports=n}}),aNi=At({"node_modules/@jscad/modeling/src/operations/extrusions/earcut/linkedListSort.js"(e,t){var n=(o,r)=>{let i,s,a,c,l,h=1;do{s=o,o=null;let d=null;l=0;while(s){l++,a=s;let u=0;for(i=0;i<h;i++)if(u++,a=a.nextZ,!a)break;let _=h;while(u>0||_>0&&a){if(u!==0&&(_===0||!a||r(s)<=r(a)))c=s,s=s.nextZ,u--;else c=a,a=a.nextZ,_--;if(d)d.nextZ=c;else o=c;c.prevZ=d,d=c}s=a}d.nextZ=null,h*=2}while(l>1);return o};t.exports=n}}),HXn=At({"node_modules/@jscad/modeling/src/operations/extrusions/earcut/linkedList.js"(e,t){var n=aNi(),o=class{constructor(s,a,c){this.i=s,this.x=a,this.y=c,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}},r=(s,a,c,l)=>{let h=new o(s,a,c);if(!l)h.prev=h,h.next=h;else h.next=l.next,h.prev=l,l.next.prev=h,l.next=h;return h},i=(s)=>{if(s.next.prev=s.prev,s.prev.next=s.next,s.prevZ)s.prevZ.nextZ=s.nextZ;if(s.nextZ)s.nextZ.prevZ=s.prevZ};t.exports={Node:o,insertNode:r,removeNode:i,sortLinked:n}}}),Kut=At({"node_modules/@jscad/modeling/src/operations/extrusions/earcut/triangle.js"(e,t){var n=(r,i,s,a,c,l,h,d)=>(c-h)*(i-d)-(r-h)*(l-d)>=0&&(r-h)*(a-d)-(s-h)*(i-d)>=0&&(s-h)*(l-d)-(c-h)*(a-d)>=0,o=(r,i,s)=>(i.y-r.y)*(s.x-i.x)-(i.x-r.x)*(s.y-i.y);t.exports={area:o,pointInTriangle:n}}}),FXn=At({"node_modules/@jscad/modeling/src/operations/extrusions/earcut/linkedPolygon.js"(e,t){var{Node:n,insertNode:o,removeNode:r}=HXn(),{area:i}=Kut(),s=(f,y,x,C,b)=>{let I;if(b===A(f,y,x,C)>0)for(let v=y;v<x;v+=C)I=o(v,f[v],f[v+1],I);else for(let v=x-C;v>=y;v-=C)I=o(v,f[v],f[v+1],I);if(I&&g(I,I.next))r(I),I=I.next;return I},a=(f,y)=>{if(!f)return f;if(!y)y=f;let x=f,C;do if(C=!1,!x.steiner&&(g(x,x.next)||i(x.prev,x,x.next)===0)){if(r(x),x=y=x.prev,x===x.next)break;C=!0}else x=x.next;while(C||x!==y);return y},c=(f,y,x)=>{let C=f;do{let b=C.prev,I=C.next.next;if(!g(b,I)&&p(b,C,C.next,I)&&h(b,I)&&h(I,b))y.push(b.i/x),y.push(C.i/x),y.push(I.i/x),r(C),r(C.next),C=f=I;C=C.next}while(C!==f);return a(C)},l=(f,y)=>{let x=f;do{if(x.i!==f.i&&x.next.i!==f.i&&x.i!==y.i&&x.next.i!==y.i&&p(x,x.next,f,y))return!0;x=x.next}while(x!==f);return!1},h=(f,y)=>i(f.prev,f,f.next)<0?i(f,y,f.next)>=0&&i(f,f.prev,y)>=0:i(f,y,f.prev)<0||i(f,f.next,y)<0,d=(f,y)=>{let x=f,C=!1,b=(f.x+y.x)/2,I=(f.y+y.y)/2;do{if(x.y>I!==x.next.y>I&&x.next.y!==x.y&&b<(x.next.x-x.x)*(I-x.y)/(x.next.y-x.y)+x.x)C=!C;x=x.next}while(x!==f);return C},u=(f,y)=>{let x=new n(f.i,f.x,f.y),C=new n(y.i,y.x,y.y),b=f.next,I=y.prev;return f.next=y,y.prev=f,x.next=b,b.prev=x,C.next=x,x.prev=C,I.next=C,C.prev=I,C},_=(f,y)=>f.next.i!==y.i&&f.prev.i!==y.i&&!l(f,y)&&(h(f,y)&&h(y,f)&&d(f,y)&&(i(f.prev,f,y.prev)||i(f,y.prev,y))||g(f,y)&&i(f.prev,f,f.next)>0&&i(y.prev,y,y.next)>0),p=(f,y,x,C)=>{let b=Math.sign(i(f,y,x)),I=Math.sign(i(f,y,C)),v=Math.sign(i(x,C,f)),P=Math.sign(i(x,C,y));if(b!==I&&v!==P)return!0;if(b===0&&m(f,x,y))return!0;if(I===0&&m(f,C,y))return!0;if(v===0&&m(x,f,C))return!0;if(P===0&&m(x,y,C))return!0;return!1},m=(f,y,x)=>y.x<=Math.max(f.x,x.x)&&y.x>=Math.min(f.x,x.x)&&y.y<=Math.max(f.y,x.y)&&y.y>=Math.min(f.y,x.y),A=(f,y,x,C)=>{let b=0;for(let I=y,v=x-C;I<x;I+=C)b+=(f[v]-f[I])*(f[I+1]+f[v+1]),v=I;return b},g=(f,y)=>f.x===y.x&&f.y===y.y;t.exports={cureLocalIntersections:c,filterPoints:a,isValidDiagonal:_,linkedPolygon:s,locallyInside:h,splitPolygon:u}}}),cNi=At({"node_modules/@jscad/modeling/src/operations/extrusions/earcut/eliminateHoles.js"(e,t){var{filterPoints:n,linkedPolygon:o,locallyInside:r,splitPolygon:i}=FXn(),{area:s,pointInTriangle:a}=Kut(),c=(_,p,m,A)=>{let g=[];for(let f=0,y=p.length;f<y;f++){let x=p[f]*A,C=f<y-1?p[f+1]*A:_.length,b=o(_,x,C,A,!1);if(b===b.next)b.steiner=!0;g.push(u(b))}g.sort((f,y)=>f.x-y.x);for(let f=0;f<g.length;f++)m=l(g[f],m),m=n(m,m.next);return m},l=(_,p)=>{let m=h(_,p);if(!m)return p;let A=i(m,_),g=n(m,m.next);return n(A,A.next),p===m?g:p},h=(_,p)=>{let m=p,{x:A,y:g}=_,f=-1/0,y;do{if(g<=m.y&&g>=m.next.y&&m.next.y!==m.y){let v=m.x+(g-m.y)*(m.next.x-m.x)/(m.next.y-m.y);if(v<=A&&v>f){if(f=v,v===A){if(g===m.y)return m;if(g===m.next.y)return m.next}y=m.x<m.next.x?m:m.next}}m=m.next}while(m!==p);if(!y)return null;if(A===f)return y;let x=y,C=y.x,b=y.y,I=1/0;m=y;do{if(A>=m.x&&m.x>=C&&A!==m.x&&a(g<b?A:f,g,C,b,g<b?f:A,g,m.x,m.y)){let v=Math.abs(g-m.y)/(A-m.x);if(r(m,_)&&(v<I||v===I&&(m.x>y.x||m.x===y.x&&d(y,m))))y=m,I=v}m=m.next}while(m!==x);return y},d=(_,p)=>s(_.prev,_,p.prev)<0&&s(p.next,_,_.next)<0,u=(_)=>{let p=_,m=_;do{if(p.x<m.x||p.x===m.x&&p.y<m.y)m=p;p=p.next}while(p!==_);return m};t.exports=c}}),lNi=At({"node_modules/@jscad/modeling/src/operations/extrusions/earcut/index.js"(e,t){var n=cNi(),{removeNode:o,sortLinked:r}=HXn(),{cureLocalIntersections:i,filterPoints:s,isValidDiagonal:a,linkedPolygon:c,splitPolygon:l}=FXn(),{area:h,pointInTriangle:d}=Kut(),u=(y,x,C=2)=>{let b=x&&x.length,I=b?x[0]*C:y.length,v=c(y,0,I,C,!0),P=[];if(!v||v.next===v.prev)return P;let M,B,T,N,D;if(b)v=n(y,x,v,C);if(y.length>80*C){M=T=y[0],B=N=y[1];for(let L=C;L<I;L+=C){let H=y[L],V=y[L+1];if(H<M)M=H;if(V<B)B=V;if(H>T)T=H;if(V>N)N=V}D=Math.max(T-M,N-B),D=D!==0?1/D:0}return _(v,P,C,M,B,D),P},_=(y,x,C,b,I,v,P)=>{if(!y)return;if(!P&&v)g(y,b,I,v);let M=y,B,T;while(y.prev!==y.next){if(B=y.prev,T=y.next,v?m(y,b,I,v):p(y)){x.push(B.i/C),x.push(y.i/C),x.push(T.i/C),o(y),y=T.next,M=T.next;continue}if(y=T,y===M){if(!P)_(s(y),x,C,b,I,v,1);else if(P===1)y=i(s(y),x,C),_(y,x,C,b,I,v,2);else if(P===2)A(y,x,C,b,I,v);break}}},p=(y)=>{let x=y.prev,C=y,b=y.next;if(h(x,C,b)>=0)return!1;let I=y.next.next;while(I!==y.prev){if(d(x.x,x.y,C.x,C.y,b.x,b.y,I.x,I.y)&&h(I.prev,I,I.next)>=0)return!1;I=I.next}return!0},m=(y,x,C,b)=>{let I=y.prev,v=y,P=y.next;if(h(I,v,P)>=0)return!1;let M=I.x<v.x?I.x<P.x?I.x:P.x:v.x<P.x?v.x:P.x,B=I.y<v.y?I.y<P.y?I.y:P.y:v.y<P.y?v.y:P.y,T=I.x>v.x?I.x>P.x?I.x:P.x:v.x>P.x?v.x:P.x,N=I.y>v.y?I.y>P.y?I.y:P.y:v.y>P.y?v.y:P.y,D=f(M,B,x,C,b),L=f(T,N,x,C,b),{prevZ:H,nextZ:V}=y;while(H&&H.z>=D&&V&&V.z<=L){if(H!==y.prev&&H!==y.next&&d(I.x,I.y,v.x,v.y,P.x,P.y,H.x,H.y)&&h(H.prev,H,H.next)>=0)return!1;if(H=H.prevZ,V!==y.prev&&V!==y.next&&d(I.x,I.y,v.x,v.y,P.x,P.y,V.x,V.y)&&h(V.prev,V,V.next)>=0)return!1;V=V.nextZ}while(H&&H.z>=D){if(H!==y.prev&&H!==y.next&&d(I.x,I.y,v.x,v.y,P.x,P.y,H.x,H.y)&&h(H.prev,H,H.next)>=0)return!1;H=H.prevZ}while(V&&V.z<=L){if(V!==y.prev&&V!==y.next&&d(I.x,I.y,v.x,v.y,P.x,P.y,V.x,V.y)&&h(V.prev,V,V.next)>=0)return!1;V=V.nextZ}return!0},A=(y,x,C,b,I,v)=>{let P=y;do{let M=P.next.next;while(M!==P.prev){if(P.i!==M.i&&a(P,M)){let B=l(P,M);P=s(P,P.next),B=s(B,B.next),_(P,x,C,b,I,v),_(B,x,C,b,I,v);return}M=M.next}P=P.next}while(P!==y)},g=(y,x,C,b)=>{let I=y;do{if(I.z===null)I.z=f(I.x,I.y,x,C,b);I.prevZ=I.prev,I.nextZ=I.next,I=I.next}while(I!==y);I.prevZ.nextZ=null,I.prevZ=null,r(I,(v)=>v.z)},f=(y,x,C,b,I)=>(y=32767*(y-C)*I,x=32767*(x-b)*I,y=(y|y<<8)&16711935,y=(y|y<<4)&252645135,y=(y|y<<2)&858993459,y=(y|y<<1)&1431655765,x=(x|x<<8)&16711935,x=(x|x<<4)&252645135,x=(x|x<<2)&858993459,x=(x|x<<1)&1431655765,y|x<<1);t.exports=u}}),hNi=At({"node_modules/@jscad/modeling/src/operations/extrusions/earcut/assignHoles.js"(e,t){var{area:n}=Mpe(),{toOutlines:o}=qs(),{arePointsInside:r}=zut(),i=(a)=>{let c=o(a),l=[],h=[];c.forEach((_,p)=>{let m=n(_);if(m<0)h.push(p);else if(m>0)l.push(p)});let d=[],u=[];return l.forEach((_,p)=>{let m=c[_];d[p]=[],h.forEach((A,g)=>{let f=c[A];if(r([f[0]],{vertices:m})){if(d[p].push(A),!u[g])u[g]=[];u[g].push(p)}})}),h.forEach((_,p)=>{if(u[p]&&u[p].length>1){let m=s(u[p],(A)=>d[A].length);u[p].forEach((A,g)=>{if(g!==m)d[A]=d[A].filter((f)=>f!==_)})}}),d.map((_,p)=>({solid:c[l[p]],holes:_.map((m)=>c[m])}))},s=(a,c)=>{let l,h;return a.forEach((d,u)=>{let _=c(d);if(h===void 0||_<h)l=u,h=_}),l};t.exports=i}}),dNi=At({"node_modules/@jscad/modeling/src/operations/extrusions/earcut/polygonHierarchy.js"(e,t){var n=qs(),o=EP(),r=ya(),i=ui(),s=LXn(),a=hNi(),c=class{constructor(l){this.plane=s(l);let h=i.orthogonal(i.create(),this.plane),d=i.cross(i.create(),this.plane,h);this.v=i.normalize(d,d),this.u=i.cross(i.create(),this.v,this.plane),this.basisMap=new Map;let u=l.edges.map((p)=>p.map((m)=>this.to2D(m))),_=n.create(u);this.roots=a(_)}to2D(l){let h=r.fromValues(i.dot(l,this.u),i.dot(l,this.v));return this.basisMap.set(h,l),h}to3D(l){let h=this.basisMap.get(l);if(h)return h;else{console.log("Warning: point not in original slice");let d=i.scale(i.create(),this.u,l[0]),u=i.scale(i.create(),this.v,l[1]),_=i.scale(i.create(),o,o[3]),p=i.add(d,d,_);return i.add(u,u,p)}}};t.exports=c}}),uNi=At({"node_modules/@jscad/modeling/src/operations/extrusions/slice/toPolygons.js"(e,t){var n=qa(),o=lNi(),r=dNi(),i=(s)=>{let a=new r(s),c=[];return a.roots.forEach(({solid:l,holes:h})=>{let d=l.length,u=[];h.forEach((g,f)=>{u.push(d),d+=g.length});let _=[l,...h].flat(),p=_.flat(),m=(g)=>a.to3D(_[g]),A=o(p,u);for(let g=0;g<A.length;g+=3){let f=A.slice(g,g+3).map(m);c.push(n.fromPointsAndPlane(f,a.plane))}}),c};t.exports=i}}),pNi=At({"node_modules/@jscad/modeling/src/operations/extrusions/slice/toString.js"(e,t){var n=ui(),o=(i)=>i.reduce((s,a)=>s+=`[${n.toString(a[0])}, ${n.toString(a[1])}], `,""),r=(i)=>`[${o(i.edges)}]`;t.exports=r}}),mNi=At({"node_modules/@jscad/modeling/src/operations/extrusions/slice/transform.js"(e,t){var n=ui(),o=BG(),r=(i,s)=>{let a=s.edges.map((c)=>[n.transform(n.create(),c[0],i),n.transform(n.create(),c[1],i)]);return o(a)};t.exports=r}}),tte=At({"node_modules/@jscad/modeling/src/operations/extrusions/slice/index.js"(e,t){t.exports={calculatePlane:LXn(),clone:eNi(),create:BG(),equals:tNi(),fromPoints:nNi(),fromSides:oNi(),isA:rNi(),reverse:iNi(),toEdges:sNi(),toPolygons:uNi(),toString:pNi(),transform:mNi()}}}),_Ni=At({"node_modules/@jscad/modeling/src/operations/extrusions/slice/repair.js"(e,t){var n=ui(),o=BG(),r=(i)=>{if(!i.edges)return i;let s=i.edges,a=new Map,c=new Map;s=s.filter((d)=>!n.equals(d[0],d[1])),s.forEach((d)=>{let u=d[0].toString(),_=d[1].toString();a.set(u,d[0]),a.set(_,d[1]),c.set(u,(c.get(u)||0)+1),c.set(_,(c.get(_)||0)-1)});let l=[],h=[];return c.forEach((d,u)=>{if(d<0)l.push(u);if(d>0)h.push(u)}),l.forEach((d)=>{let u=a.get(d),_=1/0,p;h.forEach((m)=>{let A=a.get(m),g=n.distance(u,A);if(g<_)_=g,p=A}),console.warn(`slice.repair: repairing vertex gap ${u} to ${p} distance ${_}`),s=s.map((m)=>{if(m[0].toString()===d)return[p,m[1]];if(m[1].toString()===d)return[m[0],p];return m})}),o(s)};t.exports=r}}),gNi=At({"node_modules/@jscad/modeling/src/operations/extrusions/extrudeWalls.js"(e,t){var{EPS:n}=fc(),o=ui(),r=qa(),i=tte(),s=(d,u)=>{if(d===u)return d;if(d<u)return s(u,d);if(u===1)return 1;if(u===0)return d;return s(u,d%u)},a=(d,u)=>d*u/s(d,u),c=(d,u)=>{let _=d/u.length;if(_===1)return u;let p=o.fromValues(_,_,_),m=o.create(),A=[];return u.forEach((g)=>{o.subtract(m,g[1],g[0]),o.divide(m,m,p);let f=g[0];for(let y=1;y<=_;++y){let x=o.add(o.create(),f,m);A.push([f,x]),f=x}}),A},l=n*n/2*Math.sin(Math.PI/3),h=(d,u)=>{let _=i.toEdges(d),p=i.toEdges(u);if(_.length!==p.length){let A=a(_.length,p.length);if(A!==_.length)_=c(A,_);if(A!==p.length)p=c(A,p)}let m=[];return _.forEach((A,g)=>{let f=p[g],y=r.create([A[0],A[1],f[1]]),x=r.measureArea(y);if(Number.isFinite(x)&&x>l)m.push(y);let C=r.create([A[0],f[1],f[0]]),b=r.measureArea(C);if(Number.isFinite(b)&&b>l)m.push(C)}),m};t.exports=h}}),WEe=At({"node_modules/@jscad/modeling/src/operations/extrusions/extrudeFromSlices.js"(e,t){var n=ld(),o=qs(),r=Os(),i=qa(),s=tte(),a=_Ni(),c=gNi(),l=(d,u,_)=>{let p=null;if(o.isA(_))p=s.fromSides(o.toSides(_));if(i.isA(_))p=s.fromPoints(i.toPoints(_));return d===0||d===1?s.transform(n.fromTranslation(n.create(),[0,0,d]),p):null},h=(d,u)=>{let _={numberOfSlices:2,capStart:!0,capEnd:!0,close:!1,repair:!0,callback:l},{numberOfSlices:p,capStart:m,capEnd:A,close:g,repair:f,callback:y}=Object.assign({},_,d);if(p<2)throw Error("numberOfSlices must be 2 or more");if(f)u=a(u);let x=p-1,C=null,b=null,I=null,v=[];for(let P=0;P<p;P++){let M=y(P/x,P,u);if(M){if(!s.isA(M))throw Error("the callback function must return slice objects");if(s.toEdges(M).length===0)throw Error("the callback function must return slices with one or more edges");if(I){let T=c(I,M);for(let N=0;N<T.length;N++)v.push(T[N])}if(P===0)C=M;if(P===p-1)b=M;I=M}}if(A){let P=s.toPolygons(b);for(let M=0;M<P.length;M++)v.push(P[M])}if(m){let P=s.toPolygons(C).map(i.invert);for(let M=0;M<P.length;M++)v.push(P[M])}if(!m&&!A){if(g&&!s.equals(b,C)){let P=c(b,C);for(let M=0;M<P.length;M++)v.push(P[M])}}return r.create(v)};t.exports=h}}),zXn=At({"node_modules/@jscad/modeling/src/operations/extrusions/extrudeRotate.js"(e,t){var{TAU:n}=fc(),o=ld(),{mirrorX:r}=cpe(),i=qs(),s=tte(),a=WEe(),c=(l,h)=>{let d={segments:12,startAngle:0,angle:n,overflow:"cap"},{segments:u,startAngle:_,angle:p,overflow:m}=Object.assign({},d,l);if(u<3)throw Error("segments must be greater then 3");_=Math.abs(_)>n?_%n:_,p=Math.abs(p)>n?p%n:p;let A=_+p;if(A=Math.abs(A)>n?A%n:A,A<_){let N=_;_=A,A=N}let g=A-_;if(g<=0)g=n;if(Math.abs(g)<n){let N=n/u;if(u=Math.floor(Math.abs(g)/N),Math.abs(g)>u*N)u++}let f=i.toSides(h);if(f.length===0)throw Error("the given geometry cannot be empty");let y=f.filter((N)=>N[0][0]<0),x=f.filter((N)=>N[0][0]>=0);if(y.length>0&&x.length>0&&m==="cap"){if(y.length>x.length)f=f.map((N)=>{let D=N[0],L=N[1];return D=[Math.min(D[0],0),D[1]],L=[Math.min(L[0],0),L[1]],[D,L]}),h=i.create(f),h=r(h);else if(x.length>=y.length)f=f.map((N)=>{let D=N[0],L=N[1];return D=[Math.max(D[0],0),D[1]],L=[Math.max(L[0],0),L[1]],[D,L]}),h=i.create(f)}let b=g/u,I=Math.abs(g)<n,v=s.fromSides(i.toSides(h));s.reverse(v,v);let P=o.create(),M=o.fromXRotation(o.create(),n/4),B=o.create(),T=(N,D,L)=>{let H=b*D+_;if(g===n&&D===u)H=_;return o.fromZRotation(B,H),o.multiply(P,B,M),s.transform(P,L)};return l={numberOfSlices:u+1,capStart:I,capEnd:I,close:!I,callback:T},a(l,v)};t.exports=c}}),lpe=At({"node_modules/@jscad/modeling/src/operations/transforms/rotate.js"(e,t){var n=Is(),o=ld(),r=qs(),i=Os(),s=zh(),a=(d,...u)=>{if(!Array.isArray(d))throw Error("angles must be an array");if(u=n(u),u.length===0)throw Error("wrong number of arguments");d=d.slice();while(d.length<3)d.push(0);let _=d[2],p=d[1],m=d[0],A=o.fromTaitBryanRotation(o.create(),_,p,m),g=u.map((f)=>{if(s.isA(f))return s.transform(A,f);if(r.isA(f))return r.transform(A,f);if(i.isA(f))return i.transform(A,f);return f});return g.length===1?g[0]:g},c=(d,...u)=>a([d,0,0],u),l=(d,...u)=>a([0,d,0],u),h=(d,...u)=>a([0,0,d],u);t.exports={rotate:a,rotateX:c,rotateY:l,rotateZ:h}}}),bG=At({"node_modules/@jscad/modeling/src/operations/transforms/translate.js"(e,t){var n=Is(),o=ld(),r=qs(),i=Os(),s=zh(),a=(d,...u)=>{if(!Array.isArray(d))throw Error("offset must be an array");if(u=n(u),u.length===0)throw Error("wrong number of arguments");d=d.slice();while(d.length<3)d.push(0);let _=o.fromTranslation(o.create(),d),p=u.map((m)=>{if(s.isA(m))return s.transform(_,m);if(r.isA(m))return r.transform(_,m);if(i.isA(m))return i.transform(_,m);return m});return p.length===1?p[0]:p},c=(d,...u)=>a([d,0,0],u),l=(d,...u)=>a([0,d,0],u),h=(d,...u)=>a([0,0,d],u);t.exports={translate:a,translateX:c,translateY:l,translateZ:h}}}),ANi=At({"node_modules/@jscad/modeling/src/primitives/torus.js"(e,t){var{TAU:n}=fc(),o=zXn(),{rotate:r}=lpe(),{translate:i}=bG(),s=TXn(),{isGT:a,isGTE:c}=Sg(),l=(h)=>{let d={innerRadius:1,innerSegments:32,outerRadius:4,outerSegments:32,innerRotation:0,startAngle:0,outerRotation:n},{innerRadius:u,innerSegments:_,outerRadius:p,outerSegments:m,innerRotation:A,startAngle:g,outerRotation:f}=Object.assign({},d,h);if(!a(u,0))throw Error("innerRadius must be greater than zero");if(!c(_,3))throw Error("innerSegments must be three or more");if(!a(p,0))throw Error("outerRadius must be greater than zero");if(!c(m,3))throw Error("outerSegments must be three or more");if(!c(g,0))throw Error("startAngle must be positive");if(!a(f,0))throw Error("outerRotation must be greater than zero");if(u>=p)throw Error("inner circle is too large to rotate about the outer circle");let y=s({radius:u,segments:_});if(A!==0)y=r([0,0,A],y);return y=i([p,0],y),o({startAngle:g,angle:f,segments:m},y)};t.exports=l}}),fNi=At({"node_modules/@jscad/modeling/src/primitives/triangle.js"(e,t){var{NEPS:n}=fc(),o=ya(),r=qs(),{isNumberArray:i}=Sg(),s=(A,g,f)=>Math.acos((A*A+g*g-f*f)/(2*A*g)),a=(A,g,f)=>{if(g>n)return Math.sqrt(A*A+f*f-2*A*f*Math.cos(g));return Math.sqrt((A-f)*(A-f)+A*f*g*g*(1-g*g/12))},c=(A)=>{if(Math.abs(A[0]+A[1]+A[2]-Math.PI)>n)throw Error("AAA triangles require angles that sum to PI");let f=A[0],y=A[1],x=Math.PI-f-y,C=1,b=C/Math.sin(x)*Math.sin(f),I=C/Math.sin(x)*Math.sin(y);return p(f,y,x,b,I,C)},l=(A)=>{let g=A[0],f=A[1],y=Math.PI+n-g-f;if(y<n)throw Error("AAS triangles require angles that sum to PI");let x=A[2],C=x/Math.sin(g)*Math.sin(f),b=x/Math.sin(g)*Math.sin(y);return p(g,f,y,x,C,b)},h=(A)=>{let g=A[0],f=A[2],y=Math.PI+n-g-f;if(y<n)throw Error("ASA triangles require angles that sum to PI");let x=A[1],C=x/Math.sin(y)*Math.sin(g),b=x/Math.sin(y)*Math.sin(f);return p(g,f,y,C,b,x)},d=(A)=>{let g=A[0],f=A[1],y=A[2],x=a(g,f,y),C=s(x,g,y),b=Math.PI-C-f;return p(C,f,b,y,x,g)},u=(A)=>{let g=A[0],f=A[1],y=A[2],x=Math.asin(f*Math.sin(y)/g),C=Math.PI-x-y,b=g/Math.sin(y)*Math.sin(C);return p(x,C,y,f,b,g)},_=(A)=>{let g=A[1],f=A[2],y=A[0];if(g+f<=y||f+y<=g||y+g<=f)throw Error("SSS triangle is incorrect, as the longest side is longer than the sum of the other sides");let x=s(f,y,g),C=s(y,g,f),b=Math.PI-x-C;return p(x,C,b,g,f,y)},p=(A,g,f,y,x,C)=>{let b=o.fromValues(0,0),I=o.fromValues(C,0),v=o.fromValues(y,0);return o.add(v,o.rotate(v,v,[0,0],Math.PI-g),I),r.fromPoints([b,I,v])},m=(A)=>{let g={type:"SSS",values:[1,1,1]},{type:f,values:y}=Object.assign({},g,A);if(typeof f!=="string")throw Error("triangle type must be a string");if(f=f.toUpperCase(),!((f[0]==="A"||f[0]==="S")&&(f[1]==="A"||f[1]==="S")&&(f[2]==="A"||f[2]==="S")))throw Error("triangle type must contain three letters; A or S");if(!i(y,3))throw Error("triangle values must contain three values");if(!y.every((x)=>x>0))throw Error("triangle values must be greater than zero");switch(f){case"AAA":return c(y);case"AAS":return l(y);case"ASA":return h(y);case"SAS":return d(y);case"SSA":return u(y);case"SSS":return _(y);default:throw Error("invalid triangle type, try again")}};t.exports=m}}),TG=At({"node_modules/@jscad/modeling/src/primitives/index.js"(e,t){t.exports={arc:GDi(),circle:TXn(),cube:UDi(),cuboid:Xut(),cylinder:NXn(),cylinderElliptic:DXn(),ellipse:BXn(),ellipsoid:RXn(),geodesicSphere:WDi(),line:XDi(),polygon:jDi(),polyhedron:QXn(),rectangle:jut(),roundedCuboid:KDi(),roundedCylinder:$Di(),roundedRectangle:qDi(),sphere:kXn(),square:JDi(),star:ZDi(),torus:ANi(),triangle:fNi()}}}),yNi=At({"node_modules/@jscad/modeling/src/text/fonts/single-line/hershey/simplex.js"(e,t){t.exports={height:14,32:[16],33:[10,5,21,5,7,void 0,5,2,4,1,5,0,6,1,5,2],34:[16,4,21,4,14,void 0,12,21,12,14],35:[21,11,25,4,-7,void 0,17,25,10,-7,void 0,4,12,18,12,void 0,3,6,17,6],36:[20,8,25,8,-4,void 0,12,25,12,-4,void 0,17,18,15,20,12,21,8,21,5,20,3,18,3,16,4,14,5,13,7,12,13,10,15,9,16,8,17,6,17,3,15,1,12,0,8,0,5,1,3,3],37:[24,21,21,3,0,void 0,8,21,10,19,10,17,9,15,7,14,5,14,3,16,3,18,4,20,6,21,8,21,10,20,13,19,16,19,19,20,21,21,void 0,17,7,15,6,14,4,14,2,16,0,18,0,20,1,21,3,21,5,19,7,17,7],38:[26,23,12,23,13,22,14,21,14,20,13,19,11,17,6,15,3,13,1,11,0,7,0,5,1,4,2,3,4,3,6,4,8,5,9,12,13,13,14,14,16,14,18,13,20,11,21,9,20,8,18,8,16,9,13,11,10,16,3,18,1,20,0,22,0,23,1,23,2],39:[10,5,19,4,20,5,21,6,20,6,18,5,16,4,15],40:[14,11,25,9,23,7,20,5,16,4,11,4,7,5,2,7,-2,9,-5,11,-7],41:[14,3,25,5,23,7,20,9,16,10,11,10,7,9,2,7,-2,5,-5,3,-7],42:[16,8,21,8,9,void 0,3,18,13,12,void 0,13,18,3,12],43:[26,13,18,13,0,void 0,4,9,22,9],44:[10,6,1,5,0,4,1,5,2,6,1,6,-1,5,-3,4,-4],45:[26,4,9,22,9],46:[10,5,2,4,1,5,0,6,1,5,2],47:[22,20,25,2,-7],48:[20,9,21,6,20,4,17,3,12,3,9,4,4,6,1,9,0,11,0,14,1,16,4,17,9,17,12,16,17,14,20,11,21,9,21],49:[20,6,17,8,18,11,21,11,0],50:[20,4,16,4,17,5,19,6,20,8,21,12,21,14,20,15,19,16,17,16,15,15,13,13,10,3,0,17,0],51:[20,5,21,16,21,10,13,13,13,15,12,16,11,17,8,17,6,16,3,14,1,11,0,8,0,5,1,4,2,3,4],52:[20,13,21,3,7,18,7,void 0,13,21,13,0],53:[20,15,21,5,21,4,12,5,13,8,14,11,14,14,13,16,11,17,8,17,6,16,3,14,1,11,0,8,0,5,1,4,2,3,4],54:[20,16,18,15,20,12,21,10,21,7,20,5,17,4,12,4,7,5,3,7,1,10,0,11,0,14,1,16,3,17,6,17,7,16,10,14,12,11,13,10,13,7,12,5,10,4,7],55:[20,17,21,7,0,void 0,3,21,17,21],56:[20,8,21,5,20,4,18,4,16,5,14,7,13,11,12,14,11,16,9,17,7,17,4,16,2,15,1,12,0,8,0,5,1,4,2,3,4,3,7,4,9,6,11,9,12,13,13,15,14,16,16,16,18,15,20,12,21,8,21],57:[20,16,14,15,11,13,9,10,8,9,8,6,9,4,11,3,14,3,15,4,18,6,20,9,21,10,21,13,20,15,18,16,14,16,9,15,4,13,1,10,0,8,0,5,1,4,3],58:[10,5,14,4,13,5,12,6,13,5,14,void 0,5,2,4,1,5,0,6,1,5,2],59:[10,5,14,4,13,5,12,6,13,5,14,void 0,6,1,5,0,4,1,5,2,6,1,6,-1,5,-3,4,-4],60:[24,20,18,4,9,20,0],61:[26,4,12,22,12,void 0,4,6,22,6],62:[24,4,18,20,9,4,0],63:[18,3,16,3,17,4,19,5,20,7,21,11,21,13,20,14,19,15,17,15,15,14,13,13,12,9,10,9,7,void 0,9,2,8,1,9,0,10,1,9,2],64:[27,18,13,17,15,15,16,12,16,10,15,9,14,8,11,8,8,9,6,11,5,14,5,16,6,17,8,void 0,12,16,10,14,9,11,9,8,10,6,11,5,void 0,18,16,17,8,17,6,19,5,21,5,23,7,24,10,24,12,23,15,22,17,20,19,18,20,15,21,12,21,9,20,7,19,5,17,4,15,3,12,3,9,4,6,5,4,7,2,9,1,12,0,15,0,18,1,20,2,21,3,void 0,19,16,18,8,18,6,19,5],65:[18,9,21,1,0,void 0,9,21,17,0,void 0,4,7,14,7],66:[21,4,21,4,0,void 0,4,21,13,21,16,20,17,19,18,17,18,15,17,13,16,12,13,11,void 0,4,11,13,11,16,10,17,9,18,7,18,4,17,2,16,1,13,0,4,0],67:[21,18,16,17,18,15,20,13,21,9,21,7,20,5,18,4,16,3,13,3,8,4,5,5,3,7,1,9,0,13,0,15,1,17,3,18,5],68:[21,4,21,4,0,void 0,4,21,11,21,14,20,16,18,17,16,18,13,18,8,17,5,16,3,14,1,11,0,4,0],69:[19,4,21,4,0,void 0,4,21,17,21,void 0,4,11,12,11,void 0,4,0,17,0],70:[18,4,21,4,0,void 0,4,21,17,21,void 0,4,11,12,11],71:[21,18,16,17,18,15,20,13,21,9,21,7,20,5,18,4,16,3,13,3,8,4,5,5,3,7,1,9,0,13,0,15,1,17,3,18,5,18,8,void 0,13,8,18,8],72:[22,4,21,4,0,void 0,18,21,18,0,void 0,4,11,18,11],73:[8,4,21,4,0],74:[16,12,21,12,5,11,2,10,1,8,0,6,0,4,1,3,2,2,5,2,7],75:[21,4,21,4,0,void 0,18,21,4,7,void 0,9,12,18,0],76:[17,4,21,4,0,void 0,4,0,16,0],77:[24,4,21,4,0,void 0,4,21,12,0,void 0,20,21,12,0,void 0,20,21,20,0],78:[22,4,21,4,0,void 0,4,21,18,0,void 0,18,21,18,0],79:[22,9,21,7,20,5,18,4,16,3,13,3,8,4,5,5,3,7,1,9,0,13,0,15,1,17,3,18,5,19,8,19,13,18,16,17,18,15,20,13,21,9,21],80:[21,4,21,4,0,void 0,4,21,13,21,16,20,17,19,18,17,18,14,17,12,16,11,13,10,4,10],81:[22,9,21,7,20,5,18,4,16,3,13,3,8,4,5,5,3,7,1,9,0,13,0,15,1,17,3,18,5,19,8,19,13,18,16,17,18,15,20,13,21,9,21,void 0,12,4,18,-2],82:[21,4,21,4,0,void 0,4,21,13,21,16,20,17,19,18,17,18,15,17,13,16,12,13,11,4,11,void 0,11,11,18,0],83:[20,17,18,15,20,12,21,8,21,5,20,3,18,3,16,4,14,5,13,7,12,13,10,15,9,16,8,17,6,17,3,15,1,12,0,8,0,5,1,3,3],84:[16,8,21,8,0,void 0,1,21,15,21],85:[22,4,21,4,6,5,3,7,1,10,0,12,0,15,1,17,3,18,6,18,21],86:[18,1,21,9,0,void 0,17,21,9,0],87:[24,2,21,7,0,void 0,12,21,7,0,void 0,12,21,17,0,void 0,22,21,17,0],88:[20,3,21,17,0,void 0,17,21,3,0],89:[18,1,21,9,11,9,0,void 0,17,21,9,11],90:[20,17,21,3,0,void 0,3,21,17,21,void 0,3,0,17,0],91:[14,4,25,4,-7,void 0,5,25,5,-7,void 0,4,25,11,25,void 0,4,-7,11,-7],92:[14,0,21,14,-3],93:[14,9,25,9,-7,void 0,10,25,10,-7,void 0,3,25,10,25,void 0,3,-7,10,-7],94:[16,6,15,8,18,10,15,void 0,3,12,8,17,13,12,void 0,8,17,8,0],95:[16,0,-2,16,-2],96:[10,6,21,5,20,4,18,4,16,5,15,6,16,5,17],97:[19,15,14,15,0,void 0,15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3],98:[19,4,21,4,0,void 0,4,11,6,13,8,14,11,14,13,13,15,11,16,8,16,6,15,3,13,1,11,0,8,0,6,1,4,3],99:[18,15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3],100:[19,15,21,15,0,void 0,15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3],101:[18,3,8,15,8,15,10,14,12,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3],102:[12,10,21,8,21,6,20,5,17,5,0,void 0,2,14,9,14],103:[19,15,14,15,-2,14,-5,13,-6,11,-7,8,-7,6,-6,void 0,15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3],104:[19,4,21,4,0,void 0,4,10,7,13,9,14,12,14,14,13,15,10,15,0],105:[8,3,21,4,20,5,21,4,22,3,21,void 0,4,14,4,0],106:[10,5,21,6,20,7,21,6,22,5,21,void 0,6,14,6,-3,5,-6,3,-7,1,-7],107:[17,4,21,4,0,void 0,14,14,4,4,void 0,8,8,15,0],108:[8,4,21,4,0],109:[30,4,14,4,0,void 0,4,10,7,13,9,14,12,14,14,13,15,10,15,0,void 0,15,10,18,13,20,14,23,14,25,13,26,10,26,0],110:[19,4,14,4,0,void 0,4,10,7,13,9,14,12,14,14,13,15,10,15,0],111:[19,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3,16,6,16,8,15,11,13,13,11,14,8,14],112:[19,4,14,4,-7,void 0,4,11,6,13,8,14,11,14,13,13,15,11,16,8,16,6,15,3,13,1,11,0,8,0,6,1,4,3],113:[19,15,14,15,-7,void 0,15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3],114:[13,4,14,4,0,void 0,4,8,5,11,7,13,9,14,12,14],115:[17,14,11,13,13,10,14,7,14,4,13,3,11,4,9,6,8,11,7,13,6,14,4,14,3,13,1,10,0,7,0,4,1,3,3],116:[12,5,21,5,4,6,1,8,0,10,0,void 0,2,14,9,14],117:[19,4,14,4,4,5,1,7,0,10,0,12,1,15,4,void 0,15,14,15,0],118:[16,2,14,8,0,void 0,14,14,8,0],119:[22,3,14,7,0,void 0,11,14,7,0,void 0,11,14,15,0,void 0,19,14,15,0],120:[17,3,14,14,0,void 0,14,14,3,0],121:[16,2,14,8,0,void 0,14,14,8,0,6,-4,4,-6,2,-7,1,-7],122:[17,14,14,3,0,void 0,3,14,14,14,void 0,3,0,14,0],123:[14,9,25,7,24,6,23,5,21,5,19,6,17,7,16,8,14,8,12,6,10,void 0,7,24,6,22,6,20,7,18,8,17,9,15,9,13,8,11,4,9,8,7,9,5,9,3,8,1,7,0,6,-2,6,-4,7,-6,void 0,6,8,8,6,8,4,7,2,6,1,5,-1,5,-3,6,-5,7,-6,9,-7],124:[8,4,25,4,-7],125:[14,5,25,7,24,8,23,9,21,9,19,8,17,7,16,6,14,6,12,8,10,void 0,7,24,8,22,8,20,7,18,6,17,5,15,5,13,6,11,10,9,6,7,5,5,5,3,6,1,7,0,8,-2,8,-4,7,-6,void 0,8,8,6,6,6,4,7,2,8,1,9,-1,9,-3,8,-5,7,-6,5,-7],126:[24,3,6,3,8,4,11,6,12,8,12,10,11,14,8,16,7,18,7,20,8,21,10,void 0,3,8,4,10,6,11,8,11,10,10,14,7,16,6,18,6,20,7,21,10,21,12]}}}),OXn=At({"node_modules/@jscad/modeling/src/text/vectorParams.js"(e,t){var n=yNi(),o={xOffset:0,yOffset:0,input:"?",align:"left",font:n,height:14,lineSpacing:2.142857142857143,letterSpacing:1,extrudeOffset:0},r=(i,s)=>{if(!s&&typeof i==="string")i={input:i};i=i||{};let a=Object.assign({},o,i);return a.input=s||a.input,a};t.exports=r}}),VXn=At({"node_modules/@jscad/modeling/src/text/vectorChar.js"(e,t){var n=OXn(),o=(r,i)=>{let{xOffset:s,yOffset:a,input:c,font:l,height:h,extrudeOffset:d}=n(r,i),u=c.charCodeAt(0);if(!u||!l[u])u=63;let _=[].concat(l[u]),p=(h-d)/l.height,m=d/2,A=_.shift()*p,g=[],f=[];for(let y=0,x=_.length;y<x;y+=2){let C=p*_[y]+s,b=p*_[y+1]+a+m;if(_[y]!==void 0){f.push([C,b]);continue}g.push(f),f=[],y--}if(f.length)g.push(f);return{width:A,height:h,segments:g}};t.exports=o}}),xNi=At({"node_modules/@jscad/modeling/src/text/vectorText.js"(e,t){var n=VXn(),o=OXn(),r=(s,a)=>{let{x:c,y:l}=Object.assign({x:0,y:0},s||{}),h=a.segments,d=null,u=null;for(let _=0,p=h.length;_<p;_++){d=h[_];for(let m=0,A=d.length;m<A;m++)u=d[m],d[m]=[u[0]+c,u[1]+l]}return a},i=(s,a)=>{let{xOffset:c,yOffset:l,input:h,font:d,height:u,align:_,extrudeOffset:p,lineSpacing:m,letterSpacing:A}=o(s,a),[g,f]=[c,l],y,x,C,b,I,v,P={width:0,segments:[]},M=[],B=[],T=0,N=g,D=()=>{M.push(P),T=Math.max(T,P.width),P={width:0,segments:[]}};for(y=0,x=h.length;y<x;y++){if(C=h[y],b=n({xOffset:g,yOffset:f,font:d,height:u,extrudeOffset:p},C),C===`
`){g=N,f-=b.height*m,D();continue}if(I=b.width*A,P.width+=I,g+=I,C!==" ")P.segments=P.segments.concat(b.segments)}if(P.segments.length)D();for(y=0,x=M.length;y<x;y++){if(P=M[y],T>P.width){if(v=T-P.width,_==="right")P=r({x:v},P);else if(_==="center")P=r({x:v/2},P)}B=B.concat(P.segments)}return B};t.exports=i}}),CNi=At({"node_modules/@jscad/modeling/src/text/index.js"(e,t){t.exports={vectorChar:VXn(),vectorText:xNi()}}}),Bpe=At({"node_modules/@jscad/modeling/src/utils/areAllShapesTheSameType.js"(e,t){var n=qs(),o=Os(),r=zh(),i=(s)=>{let a;for(let c of s){let l=0;if(n.isA(c))l=1;if(o.isA(c))l=2;if(r.isA(c))l=3;if(a&&l!==a)return!1;a=l}return!0};t.exports=i}}),bNi=At({"node_modules/@jscad/modeling/src/utils/degToRad.js"(e,t){var n=(o)=>o*0.017453292519943295;t.exports=n}}),YXn=At({"node_modules/@jscad/modeling/src/utils/fnNumberSort.js"(e,t){var n=(o,r)=>o-r;t.exports=n}}),INi=At({"node_modules/@jscad/modeling/src/utils/insertSorted.js"(e,t){var n=(o,r,i)=>{let s=0,a=o.length;while(a>s){let c=Math.floor((s+a)/2),l=o[c];if(i(r,l)>0)s=c+1;else a=c}o.splice(s,0,r)};t.exports=n}}),vNi=At({"node_modules/@jscad/modeling/src/utils/radiusToSegments.js"(e,t){var{TAU:n}=fc(),o=(r,i,s)=>{let a=i>0?r*n/i:0,c=s>0?n/s:0;return Math.ceil(Math.max(a,c,4))};t.exports=o}}),SNi=At({"node_modules/@jscad/modeling/src/utils/radToDeg.js"(e,t){var n=(o)=>o*57.29577951308232;t.exports=n}}),GXn=At({"node_modules/@jscad/modeling/src/utils/index.js"(e,t){t.exports={areAllShapesTheSameType:Bpe(),degToRad:bNi(),flatten:Is(),fnNumberSort:YXn(),insertSorted:INi(),radiusToSegments:vNi(),radToDeg:SNi()}}}),$ut=At({"node_modules/@jscad/modeling/src/operations/booleans/fromFakePolygons.js"(e,t){var n=ya(),o=qs(),r=(s,a)=>{if(a.vertices.length<4)return null;let c=[],l=a.vertices.filter((u,_)=>{if(u[2]>0)return c.push(_),!0;return!1});if(l.length!==2)throw Error("Assertion failed: fromFakePolygon: not enough points found");let h=l.map((u)=>{let _=Math.round(u[0]/s)*s+0,p=Math.round(u[1]/s)*s+0;return n.fromValues(_,p)});if(n.equals(h[0],h[1]))return null;let d=c[1]-c[0];if(d===1||d===3){if(d===1)h.reverse()}else throw Error("Assertion failed: fromFakePolygon: unknown index ordering");return h},i=(s,a)=>{let c=a.map((l)=>r(s,l)).filter((l)=>l!==null);return o.create(c)};t.exports=i}}),qut=At({"node_modules/@jscad/modeling/src/operations/booleans/to3DWalls.js"(e,t){var n=ui(),o=qs(),r=Os(),i=qa(),s=(c,l,h)=>{let d=[n.fromVec2(n.create(),h[0],c),n.fromVec2(n.create(),h[1],c),n.fromVec2(n.create(),h[1],l),n.fromVec2(n.create(),h[0],l)];return i.create(d)},a=(c,l)=>{let d=o.toSides(l).map((_)=>s(c.z0,c.z1,_));return r.create(d)};t.exports=a}}),PNi=At({"node_modules/@jscad/modeling/src/maths/OrthoNormalBasis.js"(e,t){var n=ld(),o=ya(),r=ui(),i=function(s,a){if(arguments.length<2)a=r.orthogonal(r.create(),s);this.v=r.normalize(r.create(),r.cross(r.create(),s,a)),this.u=r.cross(r.create(),this.v,s),this.plane=s,this.planeorigin=r.scale(r.create(),s,s[3])};i.prototype={getProjectionMatrix:function(){return n.fromValues(this.u[0],this.v[0],this.plane[0],0,this.u[1],this.v[1],this.plane[1],0,this.u[2],this.v[2],this.plane[2],0,0,0,-this.plane[3],1)},getInverseProjectionMatrix:function(){let s=r.scale(r.create(),this.plane,this.plane[3]);return n.fromValues(this.u[0],this.u[1],this.u[2],0,this.v[0],this.v[1],this.v[2],0,this.plane[0],this.plane[1],this.plane[2],0,s[0],s[1],s[2],1)},to2D:function(s){return o.fromValues(r.dot(s,this.u),r.dot(s,this.v))},to3D:function(s){let a=r.scale(r.create(),this.u,s[0]),c=r.scale(r.create(),this.v,s[1]),l=r.add(a,a,this.planeorigin);return r.add(c,c,l)}},t.exports=i}}),ENi=At({"node_modules/@jscad/modeling/src/operations/modifiers/reTesselateCoplanarPolygons.js"(e,t){var{EPS:n}=fc(),o=Uut(),r=ya(),i=PNi(),s=bXn(),{insertSorted:a,fnNumberSort:c}=GXn(),l=qa(),h=(d)=>{if(d.length<2)return d;let u=[],_=d.length,p=l.plane(d[0]),m=new i(p),A=[],g=[],f=new Map,y=new Map,x=new Map,C=10/n;for(let P=0;P<_;P++){let M=d[P],B=[],T=M.vertices.length,N=-1;if(T>0){let D,L;for(let H=0;H<T;H++){let V=m.to2D(M.vertices[H]),O=Math.floor(V[1]*C),U;if(x.has(O))U=x.get(O);else if(x.has(O+1))U=x.get(O+1);else if(x.has(O-1))U=x.get(O-1);else U=V[1],x.set(O,V[1]);V=r.fromValues(V[0],U),B.push(V);let j=V[1];if(H===0||j<D)D=j,N=H;if(H===0||j>L)L=j;let Y=y.get(j);if(!Y)Y={},y.set(j,Y);Y[P]=!0}if(D>=L)B=[],T=0,N=-1;else{let H=f.get(D);if(!H)H=[],f.set(D,H);H.push(P)}}B.reverse(),N=T-N-1,A.push(B),g.push(N)}let b=[];y.forEach((P,M)=>b.push(M)),b.sort(c);let I=[],v=[];for(let P=0;P<b.length;P++){let M=[],B=b[P],T=y.get(B),N=0;for(let L=0;L<I.length;++L){let H=I[L],V=H.polygonindex;if(T[V]){let O=A[V],U=O.length,{leftvertexindex:j,rightvertexindex:Y}=H;while(!0){let K=j+1;if(K>=U)K=0;if(O[K][1]!==B)break;j=K}let X=Y-1;if(X<0)X=U-1;if(O[X][1]===B)Y=X;if(j!==H.leftvertexindex&&j===Y)H._remove=!0,N++;else{H.leftvertexindex=j,H.rightvertexindex=Y,H.topleft=O[j],H.topright=O[Y];let K=j+1;if(K>=U)K=0;H.bottomleft=O[K];let J=Y-1;if(J<0)J=U-1;H.bottomright=O[J]}}}if(N>0)I=I.filter((L)=>!L._remove);let D;if(P>=b.length-1)I=[],D=null;else{D=Number(b[P+1]);let L=0.5*(B+D),H=f.get(B);for(let V in H){let O=H[V],U=A[O],j=U.length,Y=g[O],X=Y;while(!0){let ne=X+1;if(ne>=j)ne=0;if(U[ne][1]!==B)break;if(ne===Y)break;X=ne}let K=Y;while(!0){let ne=K-1;if(ne<0)ne=j-1;if(U[ne][1]!==B)break;if(ne===X)break;K=ne}let J=X+1;if(J>=j)J=0;let ee=K-1;if(ee<0)ee=j-1;let se={polygonindex:O,leftvertexindex:X,rightvertexindex:K,topleft:U[X],topright:U[K],bottomleft:U[J],bottomright:U[ee]};a(I,se,(ne,re)=>{let Z=s(ne.topleft,ne.bottomleft,L),te=s(re.topleft,re.bottomleft,L);if(Z>te)return 1;if(Z<te)return-1;return 0})}}for(let L in I){let H=I[L],V=s(H.topleft,H.bottomleft,B),O=r.fromValues(V,B);V=s(H.topright,H.bottomright,B);let U=r.fromValues(V,B);V=s(H.topleft,H.bottomleft,D);let j=r.fromValues(V,D);V=s(H.topright,H.bottomright,D);let Y=r.fromValues(V,D),X={topleft:O,topright:U,bottomleft:j,bottomright:Y,leftline:o.fromPoints(o.create(),O,j),rightline:o.fromPoints(o.create(),Y,U)};if(M.length>0){let K=M[M.length-1],J=r.distance(X.topleft,K.topright),ee=r.distance(X.bottomleft,K.bottomright);if(J<n&&ee<n)X.topleft=K.topleft,X.leftline=K.leftline,X.bottomleft=K.bottomleft,M.splice(M.length-1,1)}M.push(X)}if(P>0){let L=new Set,H=new Set;for(let V=0;V<M.length;V++){let O=M[V];for(let U=0;U<v.length;U++)if(!H.has(U)){let j=v[U];if(r.distance(j.bottomleft,O.topleft)<n){if(r.distance(j.bottomright,O.topright)<n){H.add(U);let Y=o.direction(O.leftline),X=o.direction(j.leftline),K=Y[0]-X[0],J=o.direction(O.rightline),ee=o.direction(j.rightline),se=J[0]-ee[0],ne=Math.abs(K)<n,re=Math.abs(se)<n,Z=ne||K>=0,te=re||se>=0;if(Z&&te)O.outpolygon=j.outpolygon,O.leftlinecontinues=ne,O.rightlinecontinues=re,L.add(U);break}}}}for(let V=0;V<v.length;V++)if(!L.has(V)){let O=v[V];if(O.outpolygon.rightpoints.push(O.bottomright),r.distance(O.bottomright,O.bottomleft)>n)O.outpolygon.leftpoints.push(O.bottomleft);O.outpolygon.leftpoints.reverse();let j=O.outpolygon.rightpoints.concat(O.outpolygon.leftpoints).map((X)=>m.to3D(X)),Y=l.fromPointsAndPlane(j,p);if(Y.vertices.length)u.push(Y)}}for(let L=0;L<M.length;L++){let H=M[L];if(!H.outpolygon){if(H.outpolygon={leftpoints:[],rightpoints:[]},H.outpolygon.leftpoints.push(H.topleft),r.distance(H.topleft,H.topright)>n)H.outpolygon.rightpoints.push(H.topright)}else{if(!H.leftlinecontinues)H.outpolygon.leftpoints.push(H.topleft);if(!H.rightlinecontinues)H.outpolygon.rightpoints.push(H.topright)}}v=M}return u};t.exports=h}}),Tpe=At({"node_modules/@jscad/modeling/src/operations/modifiers/retessellate.js"(e,t){var n=Os(),o=qa(),{NEPS:r}=fc(),i=ENi(),s=(l)=>{if(l.isRetesselated)return l;let h=n.toPolygons(l).map((p,m)=>({vertices:p.vertices,plane:o.plane(p),index:m})),d=a(h),u=[];d.forEach((p)=>{if(Array.isArray(p)){let m=i(p);for(let A=0;A<m.length;A++)u.push(m[A])}else u.push(p)});let _=n.create(u);return _.isRetesselated=!0,_},a=(l)=>{let h=[l],d=[];for(let _=3;_>=0;_--){let p=[],m=_===3?0.000000015:r;h.forEach((A)=>{A.sort(c(_,m));let g=0;for(let f=1;f<A.length;f++)if(A[f].plane[_]-A[g].plane[_]>m){if(f-g===1)d.push(A[g]);else p.push(A.slice(g,f));g=f}if(A.length-g===1)d.push(A[g]);else p.push(A.slice(g))}),h=p}let u=[];return h.forEach((_)=>{if(_[0])u[_[0].index]=_}),d.forEach((_)=>{u[_.index]=_}),u},c=(l,h)=>(d,u)=>{if(d.plane[l]-u.plane[l]>h)return 1;else if(u.plane[l]-d.plane[l]>h)return-1;return 0};t.exports=s}}),Jut=At({"node_modules/@jscad/modeling/src/operations/booleans/mayOverlap.js"(e,t){var{EPS:n}=fc(),o=wG(),r=(i,s)=>{if(i.polygons.length===0||s.polygons.length===0)return!1;let a=o(i),c=a[0],l=a[1],h=o(s),d=h[0],u=h[1];if(d[0]-l[0]>n)return!1;if(c[0]-u[0]>n)return!1;if(d[1]-l[1]>n)return!1;if(c[1]-u[1]>n)return!1;if(d[2]-l[2]>n)return!1;if(c[2]-u[2]>n)return!1;return!0};t.exports=r}}),MNi=At({"node_modules/@jscad/modeling/src/operations/booleans/trees/Node.js"(e,t){var n=EP(),o=qa(),r=class i{constructor(s){this.plane=null,this.front=null,this.back=null,this.polygontreenodes=[],this.parent=s}invert(){let s=[this],a;for(let c=0;c<s.length;c++){if(a=s[c],a.plane)a.plane=n.flip(n.create(),a.plane);if(a.front)s.push(a.front);if(a.back)s.push(a.back);let l=a.front;a.front=a.back,a.back=l}}clipPolygons(s,a){let c={node:this,polygontreenodes:s},l,h=[];do{if(l=c.node,s=c.polygontreenodes,l.plane){let d=l.plane,u=[],_=[],p=a?u:_,m=s.length;for(let g=0;g<m;g++){let f=s[g];if(!f.isRemoved())f.splitByPlane(d,p,u,_,u)}if(l.front&&_.length>0)h.push({node:l.front,polygontreenodes:_});let A=u.length;if(l.back&&A>0)h.push({node:l.back,polygontreenodes:u});else for(let g=0;g<A;g++)u[g].remove()}c=h.pop()}while(c!==void 0)}clipTo(s,a){let c=this,l=[];do{if(c.polygontreenodes.length>0)s.rootnode.clipPolygons(c.polygontreenodes,a);if(c.front)l.push(c.front);if(c.back)l.push(c.back);c=l.pop()}while(c!==void 0)}addPolygonTreeNodes(s){let a={node:this,polygontreenodes:s},c=[];do{let l=a.node,h=a.polygontreenodes;if(h.length===0){a=c.pop();continue}if(!l.plane){let p=0;p=Math.floor(h.length/2);let m=h[p].getPolygon();l.plane=o.plane(m)}let d=[],u=[],_=h.length;for(let p=0;p<_;++p)h[p].splitByPlane(l.plane,l.polygontreenodes,u,d,u);if(d.length>0){if(!l.front)l.front=new i(l);if(_===d.length&&u.length===0)l.front.polygontreenodes=d;else c.push({node:l.front,polygontreenodes:d})}if(u.length>0){if(!l.back)l.back=new i(l);if(_===u.length&&d.length===0)l.back.polygontreenodes=u;else c.push({node:l.back,polygontreenodes:u})}a=c.pop()}while(a!==void 0)}};t.exports=r}}),wNi=At({"node_modules/@jscad/modeling/src/operations/booleans/trees/splitLineSegmentByPlane.js"(e,t){var n=ui(),o=(r,i,s)=>{let a=n.subtract(n.create(),s,i),c=(r[3]-n.dot(r,i))/n.dot(r,a);if(Number.isNaN(c))c=0;if(c>1)c=1;if(c<0)c=0;return n.scale(a,a,c),n.add(a,i,a),a};t.exports=o}}),BNi=At({"node_modules/@jscad/modeling/src/operations/booleans/trees/splitPolygonByPlane.js"(e,t){var{EPS:n}=fc(),o=EP(),r=ui(),i=qa(),s=wNi(),a=n*n,c=(h)=>{let d=[],u=h[h.length-1];for(let _=0;_<h.length;_++){let p=h[_];if(r.squaredDistance(p,u)>=a)d.push(p);u=p}return d},l=(h,d)=>{let u={type:null,front:null,back:null},_=d.vertices,p=_.length,m=i.plane(d);if(o.equals(m,h))u.type=0;else{let A=!1,g=!1,f=[],y=-n;for(let x=0;x<p;x++){let C=r.dot(h,_[x])-h[3],b=C<y;if(f.push(b),C>n)A=!0;if(C<y)g=!0}if(!A&&!g){let x=r.dot(h,m);u.type=x>=0?0:1}else if(!g)u.type=2;else if(!A)u.type=3;else{u.type=4;let x=[],C=[],b=f[0];for(let I=0;I<p;I++){let v=_[I],P=I+1;if(P>=p)P=0;let M=f[P];if(b===M)if(b)C.push(v);else x.push(v);else{let B=_[P],T=s(h,v,B);if(b)C.push(v),C.push(T),x.push(T);else x.push(v),x.push(T),C.push(T)}b=M}if(x.length>=3){let I=c(x);if(I.length>=3)u.front=i.fromPointsAndPlane(I,m)}if(C.length>=3){let I=c(C);if(I.length>=3)u.back=i.fromPointsAndPlane(I,m)}}}return u};t.exports=l}}),TNi=At({"node_modules/@jscad/modeling/src/operations/booleans/trees/PolygonTreeNode.js"(e,t){var{EPS:n}=fc(),o=ui(),r=qa(),i=BNi(),s=class a{constructor(c,l){this.parent=c,this.children=[],this.polygon=l,this.removed=!1}addPolygons(c){if(!this.isRootNode())throw Error("Assertion failed");let l=this;c.forEach((h)=>{l.addChild(h)})}remove(){if(!this.removed)this.removed=!0,this.polygon=null,this.parent.recursivelyInvalidatePolygon()}isRemoved(){return this.removed}isRootNode(){return!this.parent}invert(){if(!this.isRootNode())throw Error("Assertion failed");this.invertSub()}getPolygon(){if(!this.polygon)throw Error("Assertion failed");return this.polygon}getPolygons(c){if(this.isRootNode()&&this.children.length>0){let m=[];for(let A=0;A<this.children.length;A++)if(!this.children[A].removed)m.push(this.children[A]);this.children=m}let l=[this],h=[l],d,u,_,p;for(d=0;d<h.length;++d){l=h[d];for(u=0,_=l.length;u<_;u++)if(p=l[u],p.polygon)c.push(p.polygon);else if(p.children.length>0)h.push(p.children)}}splitByPlane(c,l,h,d,u){if(this.children.length){let _=[this.children],p,m,A,g,f;for(p=0;p<_.length;p++){f=_[p];for(m=0,A=f.length;m<A;m++)if(g=f[m],g.children.length>0)_.push(g.children);else g._splitByPlane(c,l,h,d,u)}}else this._splitByPlane(c,l,h,d,u)}_splitByPlane(c,l,h,d,u){let _=this.polygon;if(_){let p=r.measureBoundingSphere(_),m=p[3]+n,A=p,g=o.dot(c,A)-c[3];if(g>m)d.push(this);else if(g<-m)u.push(this);else{let f=i(c,_);switch(f.type){case 0:l.push(this);break;case 1:h.push(this);break;case 2:d.push(this);break;case 3:u.push(this);break;case 4:if(f.front){let y=this.addChild(f.front);d.push(y)}if(f.back){let y=this.addChild(f.back);u.push(y)}break}}}}addChild(c){let l=new a(this,c);return this.children.push(l),l}invertSub(){let c=[this],l=[c],h,d,u,_;for(h=0;h<l.length;h++){c=l[h];for(d=0,u=c.length;d<u;d++){if(_=c[d],_.polygon)_.polygon=r.invert(_.polygon);if(_.children.length>0)l.push(_.children)}}}recursivelyInvalidatePolygon(){if(this.polygon=null,this.parent)this.parent.recursivelyInvalidatePolygon()}clear(){let c=[this],l=[c];for(let h=0;h<l.length;++h){c=l[h];let d=c.length;for(let u=0;u<d;u++){let _=c[u];if(_.polygon)_.polygon=null;if(_.parent)_.parent=null;if(_.children.length>0)l.push(_.children);_.children=[]}}}toString(){let c="",l=[this],h=[l],d,u,_,p;for(d=0;d<h.length;++d){l=h[d];let m=" ".repeat(d);for(u=0,_=l.length;u<_;u++){if(p=l[u],c+=`${m}PolygonTreeNode (${p.isRootNode()}): ${p.children.length}`,p.polygon)c+=`
 ${m}polygon: ${p.polygon.vertices}
`;else c+=`
`;if(p.children.length>0)h.push(p.children)}}return c}};t.exports=s}}),DNi=At({"node_modules/@jscad/modeling/src/operations/booleans/trees/Tree.js"(e,t){var n=MNi(),o=TNi(),r=class{constructor(i){if(this.polygonTree=new o,this.rootnode=new n(null),i)this.addPolygons(i)}invert(){this.polygonTree.invert(),this.rootnode.invert()}clipTo(i,s=!1){this.rootnode.clipTo(i,s)}allPolygons(){let i=[];return this.polygonTree.getPolygons(i),i}addPolygons(i){let s=Array(i.length);for(let a=0;a<i.length;a++)s[a]=this.polygonTree.addChild(i[a]);this.rootnode.addPolygonTreeNodes(s)}clear(){this.polygonTree.clear()}toString(){return"Tree: "+this.polygonTree.toString("")}};t.exports=r}}),Zut=At({"node_modules/@jscad/modeling/src/operations/booleans/trees/index.js"(e,t){t.exports={Tree:DNi()}}}),NNi=At({"node_modules/@jscad/modeling/src/operations/booleans/intersectGeom3Sub.js"(e,t){var n=Os(),o=Jut(),{Tree:r}=Zut(),i=(s,a)=>{if(!o(s,a))return n.create();let c=new r(n.toPolygons(s)),l=new r(n.toPolygons(a));c.invert(),l.clipTo(c),l.invert(),c.clipTo(l),l.clipTo(c),c.addPolygons(l.allPolygons()),c.invert();let h=c.allPolygons();return n.create(h)};t.exports=i}}),UXn=At({"node_modules/@jscad/modeling/src/operations/booleans/intersectGeom3.js"(e,t){var n=Is(),o=Tpe(),r=NNi(),i=(...s)=>{s=n(s);let a=s.shift();return s.forEach((c)=>{a=r(a,c)}),a=o(a),a};t.exports=i}}),RNi=At({"node_modules/@jscad/modeling/src/operations/booleans/intersectGeom2.js"(e,t){var n=Is(),o=Os(),r=IL(),i=$ut(),s=qut(),a=UXn(),c=(...l)=>{l=n(l);let h=l.map((_)=>s({z0:-1,z1:1},_)),d=a(h),u=r(d);return i(u,o.toPolygons(d))};t.exports=c}}),QNi=At({"node_modules/@jscad/modeling/src/operations/booleans/intersect.js"(e,t){var n=Is(),o=Bpe(),r=qs(),i=Os(),s=RNi(),a=UXn(),c=(...l)=>{if(l=n(l),l.length===0)throw Error("wrong number of arguments");if(!o(l))throw Error("only intersect of the types are supported");let h=l[0];if(r.isA(h))return s(l);if(i.isA(h))return a(l);return h};t.exports=c}}),e0t=At({"node_modules/@jscad/modeling/src/operations/hulls/hullPoints3.js"(e,t){var n=qa(),o=KWn(),r=(i)=>o(i,{skipTriangulation:!0}).map((c)=>{let l=c.map((h)=>i[h]);return n.create(l)});t.exports=r}}),WXn=At({"node_modules/@jscad/modeling/src/operations/booleans/unionGeom3Sub.js"(e,t){var n=Os(),o=Jut(),{Tree:r}=Zut(),i=(a,c)=>{if(!o(a,c))return s(a,c);let l=new r(n.toPolygons(a)),h=new r(n.toPolygons(c));l.clipTo(h,!1),h.clipTo(l),h.invert(),h.clipTo(l),h.invert();let d=l.allPolygons().concat(h.allPolygons());return n.create(d)},s=(a,c)=>{let l=n.toPolygons(a);return l=l.concat(n.toPolygons(c)),n.create(l)};t.exports=i}}),t0t=At({"node_modules/@jscad/modeling/src/operations/booleans/unionGeom3.js"(e,t){var n=Is(),o=Tpe(),r=WXn(),i=(...s)=>{s=n(s);let a;for(a=1;a<s.length;a+=2)s.push(r(s[a-1],s[a]));let c=s[a-1];return c=o(c),c};t.exports=i}}),XXn=At({"node_modules/@jscad/modeling/src/operations/minkowski/minkowskiSum.js"(e,t){var n=Is(),o=Os(),r=qa(),i=e0t(),s=t0t(),a=(..._)=>{if(_=n(_),_.length!==2)throw Error("minkowskiSum requires exactly two geometries");let[p,m]=_;if(!o.isA(p)||!o.isA(m))throw Error("minkowskiSum requires geom3 geometries");let A=o.isConvex(p),g=o.isConvex(m);if(A&&g)return d(p,m);if(!A&&g)return c(p,m);if(A&&!g)return c(m,p);throw Error("minkowskiSum of two non-convex geometries is not yet supported")},c=(_,p)=>{let m=l(_);if(m.length===0)return o.create();let A=m.map((g)=>d(g,p));if(A.length===1)return A[0];return s(A)},l=(_)=>{let p=o.toPolygons(_);if(p.length===0)return[];let m=[];for(let A=0;A<p.length;A++){let g=p[A],f=g.vertices,y=0,x=0,C=0;for(let T=0;T<f.length;T++)y+=f[T][0],x+=f[T][1],C+=f[T][2];y/=f.length,x/=f.length,C/=f.length;let b=r.plane(g),I=b[0],v=b[1],P=b[2],M=0.1,B=[y-I*M,x-v*M,C-P*M];for(let T=1;T<f.length-1;T++){let N=f[0],D=f[T],L=f[T+1],H=h(B,N,D,L);m.push(o.create(H))}}return m},h=(_,p,m,A)=>[r.create([_,m,p]),r.create([_,p,A]),r.create([p,m,A]),r.create([m,_,A])],d=(_,p)=>{let m=u(_),A=u(p);if(m.length===0||A.length===0)return o.create();let g=[];for(let y=0;y<m.length;y++){let x=m[y];for(let C=0;C<A.length;C++){let b=A[C];g.push([x[0]+b[0],x[1]+b[1],x[2]+b[2]])}}let f=i(g);return o.create(f)},u=(_)=>{let p=new Set,m=[],A=o.toPolygons(_);for(let g=0;g<A.length;g++){let f=A[g].vertices;for(let y=0;y<f.length;y++){let x=f[y],C=`${x[0]},${x[1]},${x[2]}`;if(!p.has(C))p.add(C),m.push(x)}}return m};t.exports=a}}),kNi=At({"node_modules/@jscad/modeling/src/operations/booleans/scissionGeom3.js"(e,t){var n=ui(),o=IL(),r=Os(),i=(l)=>l.sort((h,d)=>h-d).filter((h,d,u)=>!d||h!==u[d-1]),s=(l,h,d)=>{let u=`${h}`,_=l.get(u);if(_===void 0)l.set(u,[d]);else _.push(d)},a=(l,h)=>{let d=`${h}`;return l.get(d)},c=(l)=>{let h=o(l),d=r.toPolygons(l),u=d.length,_=new Map,p=n.create();d.forEach((y,x)=>{y.vertices.forEach((C)=>{s(_,n.snap(p,C,h),x)})});let m=d.map((y)=>{let x=[];return y.vertices.forEach((C)=>{x=x.concat(a(_,n.snap(p,C,h)))}),{e:1,d:i(x)}});_.clear();let A=0,g=m.length;for(let y=0;y<g;y++){let x=m[y];if(x.e>0){let C=Array(u);C[y]=!0;do A=0,C.forEach((b,I)=>{let v=m[I];if(v.e>0){v.e=-1;for(let P=0;P<v.d.length;P++)C[v.d[P]]=!0;A++}});while(A>0);x.indexes=C}}let f=[];for(let y=0;y<g;y++)if(m[y].indexes){let x=[];m[y].indexes.forEach((C,b)=>x.push(d[b])),f.push(r.create(x))}return f};t.exports=c}}),LNi=At({"node_modules/@jscad/modeling/src/operations/booleans/scission.js"(e,t){var n=Is(),o=Os(),r=kNi(),i=(...s)=>{if(s=n(s),s.length===0)throw Error("wrong number of arguments");let a=s.map((c)=>{if(o.isA(c))return r(c);return c});return a.length===1?a[0]:a};t.exports=i}}),HNi=At({"node_modules/@jscad/modeling/src/operations/booleans/subtractGeom3Sub.js"(e,t){var n=Os(),o=Jut(),{Tree:r}=Zut(),i=(s,a)=>{if(!o(s,a))return n.clone(s);let c=new r(n.toPolygons(s)),l=new r(n.toPolygons(a));c.invert(),c.clipTo(l),l.clipTo(c,!0),c.addPolygons(l.allPolygons()),c.invert();let h=c.allPolygons();return n.create(h)};t.exports=i}}),jXn=At({"node_modules/@jscad/modeling/src/operations/booleans/subtractGeom3.js"(e,t){var n=Is(),o=Tpe(),r=HNi(),i=(...s)=>{s=n(s);let a=s.shift();return s.forEach((c)=>{a=r(a,c)}),a=o(a),a};t.exports=i}}),FNi=At({"node_modules/@jscad/modeling/src/operations/booleans/subtractGeom2.js"(e,t){var n=Is(),o=Os(),r=IL(),i=$ut(),s=qut(),a=jXn(),c=(...l)=>{l=n(l);let h=l.map((_)=>s({z0:-1,z1:1},_)),d=a(h),u=r(d);return i(u,o.toPolygons(d))};t.exports=c}}),zNi=At({"node_modules/@jscad/modeling/src/operations/booleans/subtract.js"(e,t){var n=Is(),o=Bpe(),r=qs(),i=Os(),s=FNi(),a=jXn(),c=(...l)=>{if(l=n(l),l.length===0)throw Error("wrong number of arguments");if(!o(l))throw Error("only subtract of the types are supported");let h=l[0];if(r.isA(h))return s(l);if(i.isA(h))return a(l);return h};t.exports=c}}),KXn=At({"node_modules/@jscad/modeling/src/operations/booleans/unionGeom2.js"(e,t){var n=Is(),o=Os(),r=IL(),i=$ut(),s=qut(),a=t0t(),c=(...l)=>{l=n(l);let h=l.map((_)=>s({z0:-1,z1:1},_)),d=a(h),u=r(d);return i(u,o.toPolygons(d))};t.exports=c}}),n0t=At({"node_modules/@jscad/modeling/src/operations/booleans/union.js"(e,t){var n=Is(),o=Bpe(),r=qs(),i=Os(),s=KXn(),a=t0t(),c=(...l)=>{if(l=n(l),l.length===0)throw Error("wrong number of arguments");if(!o(l))throw Error("only unions of the same type are supported");let h=l[0];if(r.isA(h))return s(l);if(i.isA(h))return a(l);return h};t.exports=c}}),Dpe=At({"node_modules/@jscad/modeling/src/operations/booleans/index.js"(e,t){t.exports={intersect:QNi(),minkowski:XXn(),scission:LNi(),subtract:zNi(),union:n0t()}}}),XEe=At({"node_modules/@jscad/modeling/src/operations/expansions/offsetFromPoints.js"(e,t){var{EPS:n,TAU:o}=fc(),r=IXn(),i=Uut(),s=ya(),a=GEe(),c=(l,h)=>{let d={delta:1,corners:"edge",closed:!1,segments:16},{delta:u,corners:_,closed:p,segments:m}=Object.assign({},d,l);if(Math.abs(u)<n)return h;let A=l.closed?a(h):1;if(A===0)A=1;let g=A>0&&u>=0||A<0&&u<0;u=Math.abs(u);let f=null,y=[],x=[],C=s.create(),b=h.length;for(let I=0;I<b;I++){let v=(I+1)%b,P=h[I],M=h[v];g?s.subtract(C,P,M):s.subtract(C,M,P),s.normal(C,C),s.normalize(C,C),s.scale(C,C,u);let B=s.add(s.create(),P,C),T=s.add(s.create(),M,C),N=[B,T];if(f!=null){if(p||!p&&v!==0){let D=r(f[0],f[1],N[0],N[1]);if(D)y.pop(),N[0]=D;else x.push({c:P,s0:f,s1:N})}}if(f=[B,T],v===0&&!p)continue;y.push(N[0]),y.push(N[1])}if(p&&f!=null){let I=y[0],v=y[1],P=r(f[0],f[1],I,v);if(P)y[0]=P,y.pop();else{let M=h[0],B=[I,v];x.push({c:M,s0:f,s1:B})}}if(_==="edge"){let I=new Map;y.forEach((M,B)=>I.set(M,B));let v=i.create(),P=i.create();x.forEach((M)=>{i.fromPoints(v,M.s0[0],M.s0[1]),i.fromPoints(P,M.s1[0],M.s1[1]);let B=i.intersectPointOfLines(v,P);if(Number.isFinite(B[0])&&Number.isFinite(B[1])){let T=M.s0[1],N=I.get(T);y[N]=B,y[(N+1)%y.length]=void 0}else{let T=M.s1[0],N=I.get(T);y[N]=void 0}}),y=y.filter((M)=>M!==void 0)}if(_==="round"){let I=Math.floor(m/4),v=s.create();x.forEach((P)=>{let M=s.angle(s.subtract(v,P.s1[0],P.c));if(M-=s.angle(s.subtract(v,P.s0[1],P.c)),g&&M<0){if(M=M+Math.PI,M<0)M=M+Math.PI}if(!g&&M>0){if(M=M-Math.PI,M>0)M=M-Math.PI}if(M!==0){I=Math.floor(m*(Math.abs(M)/o));let B=M/I,T=s.angle(s.subtract(v,P.s0[1],P.c)),N=[];for(let D=1;D<I;D++){let L=T+B*D,H=s.fromAngleRadians(s.create(),L);s.scale(H,H,u),s.add(H,H,P.c),N.push(H)}if(N.length>0){let D=P.s0[1],L=y.findIndex((H)=>s.equals(D,H));L=(L+1)%y.length,y.splice(L,0,...N)}}else{let B=P.s1[0],T=y.findIndex((N)=>s.equals(B,N));y.splice(T,1)}})}return y};t.exports=c}}),ONi=At({"node_modules/@jscad/modeling/src/operations/expansions/expandGeom2.js"(e,t){var n=qs(),o=XEe(),r=(i,s)=>{let a={delta:1,corners:"edge",segments:16},{delta:c,corners:l,segments:h}=Object.assign({},a,i);if(!(l==="edge"||l==="chamfer"||l==="round"))throw Error('corners must be "edge", "chamfer", or "round"');let _=n.toOutlines(s).map((p)=>(i={delta:c,corners:l,closed:!0,segments:h},o(i,p))).reduce((p,m)=>p.concat(n.toSides(n.fromPoints(m))),[]);return n.create(_)};t.exports=r}}),VNi=At({"node_modules/@jscad/modeling/src/operations/expansions/extrudePolygon.js"(e,t){var n=ld(),o=ui(),r=Os(),i=qa(),s=(a,c)=>{if(o.dot(i.plane(c),a)>0)c=i.invert(c);let h=[c],d=i.transform(n.fromTranslation(n.create(),a),c),u=c.vertices.length;for(let _=0;_<u;_++){let p=_<u-1?_+1:0,m=i.create([c.vertices[_],d.vertices[_],d.vertices[p],c.vertices[p]]);h.push(m)}return h.push(i.invert(d)),r.create(h)};t.exports=s}}),YNi=At({"node_modules/@jscad/modeling/src/operations/expansions/expandShell.js"(e,t){var{EPS:n,TAU:o}=fc(),r=ld(),i=ui(),s=YXn(),a=Os(),c=qa(),l=kXn(),h=Tpe(),d=WXn(),u=VNi(),_=(g,f,y)=>{let x=f.toString();if(!g.has(x)){let C=[f,[y]];g.set(x,C)}else g.get(x)[1].push(y)},p=(g,f,y)=>{let x=f[0].toString(),C=f[1].toString(),b=x<C?`${x},${C}`:`${C},${x}`;if(!g.has(b)){let I=[f,[y]];g.set(b,I)}else g.get(b)[1].push(y)},m=(g,f)=>{if(g.findIndex((x)=>x===f)<0)g.push(f)},A=(g,f)=>{let y={delta:1,segments:12},{delta:x,segments:C}=Object.assign({},y,g),b=a.create(),I=new Map,v=new Map,P=i.create(),M=i.create();return a.toPolygons(f).forEach((T,N)=>{let D=i.scale(i.create(),c.plane(T),2*x),L=c.transform(r.fromTranslation(r.create(),i.scale(i.create(),D,-0.5)),T),H=u(D,L);b=d(b,H);let V=T.vertices;for(let O=0;O<V.length;O++){_(I,V[O],c.plane(T));let U=(O+1)%V.length,j=[V[O],V[U]];p(v,j,c.plane(T))}}),v.forEach((T)=>{let N=T[0],D=T[1],L=N[0],H=N[1],V=i.subtract(i.create(),H,L);i.normalize(V,V);let O=D[0],U=i.cross(i.create(),O,V),j=[];for(let re=0;re<C;re++)m(j,re*o/C);for(let re=0,Z=D.length;re<Z;re++){let te=D[re],ie=i.dot(U,te),ce=i.dot(O,te),ue=Math.atan2(ie,ce);if(ue<0)ue+=o;if(m(j,ue),ue=Math.atan2(-ie,-ce),ue<0)ue+=o;m(j,ue)}j=j.sort(s);let Y=j.length,X,K,J=[],ee=[],se=[];for(let re=-1;re<Y;re++){let Z=j[re<0?re+Y:re],te=Math.sin(Z),ie=Math.cos(Z);i.scale(P,O,ie*x),i.scale(M,U,te*x),i.add(P,P,M);let ce=i.add(i.create(),L,P),ue=i.add(i.create(),H,P),de=!1;if(re>=0){if(i.distance(ce,X)<n)de=!0}if(!de){if(re>=0){J.push(ce),ee.push(ue);let me=[K,ue,ce,X],ge=c.create(me);se.push(ge)}X=ce,K=ue}}ee.reverse(),se.push(c.create(J)),se.push(c.create(ee));let ne=a.create(se);b=d(b,ne)}),I.forEach((T)=>{let N=T[0],D=T[1],L=D[0],H=null,V=0;for(let Y=1;Y<D.length;Y++){let X=D[Y],K=i.cross(P,L,X),J=i.length(K);if(J>0.05){if(J>V)V=J,H=X}}if(!H)H=i.orthogonal(P,L);let O=i.cross(P,L,H);i.normalize(O,O);let U=i.cross(M,O,L),j=l({center:[N[0],N[1],N[2]],radius:x,segments:C,axes:[L,O,U]});b=d(b,j)}),h(b)};t.exports=A}}),GNi=At({"node_modules/@jscad/modeling/src/operations/expansions/expandGeom3.js"(e,t){var n=Os(),o=n0t(),r=YNi(),i=(s,a)=>{let c={delta:1,corners:"round",segments:12},{delta:l,corners:h,segments:d}=Object.assign({},c,s);if(h!=="round")throw Error('corners must be "round" for 3D geometries');if(n.toPolygons(a).length===0)throw Error("the given geometry cannot be empty");s={delta:l,corners:h,segments:d};let _=r(s,a);return o(a,_)};t.exports=i}}),UNi=At({"node_modules/@jscad/modeling/src/operations/expansions/expandPath2.js"(e,t){var n=GEe(),o=ya(),r=qs(),i=zh(),s=XEe(),a=(h)=>{let{external:d,internal:u}=h;if(n(d)<0)d=d.reverse();else u=u.reverse();let _=i.fromPoints({closed:!0},d),p=i.fromPoints({closed:!0},u),m=r.toSides(r.fromPoints(i.toPoints(_))),A=r.toSides(r.fromPoints(i.toPoints(p)));return m.push(...A),r.create(m)},c=(h,d,u,_)=>{let{points:p,external:m,internal:A}=h,g=Math.floor(d/2),f=[],y=[];if(u==="round"&&g>0){let C=Math.PI/g,b=p[p.length-1],I=o.angle(o.subtract(o.create(),m[m.length-1],b)),v=p[0],P=o.angle(o.subtract(o.create(),A[0],v));for(let M=1;M<g;M++){let B=I+C*M,T=o.fromAngleRadians(o.create(),B);o.scale(T,T,_),o.add(T,T,b),f.push(T),B=P+C*M,T=o.fromAngleRadians(o.create(),B),o.scale(T,T,_),o.add(T,T,v),y.push(T)}}let x=[];return x.push(...m,...f,...A.reverse(),...y),r.fromPoints(x)},l=(h,d)=>{h=Object.assign({},{delta:1,corners:"edge",segments:16},h);let{delta:_,corners:p,segments:m}=h;if(_<=0)throw Error("the given delta must be positive for paths");if(!(p==="edge"||p==="chamfer"||p==="round"))throw Error('corners must be "edge", "chamfer", or "round"');let A=d.isClosed,g=i.toPoints(d);if(g.length===0)throw Error("the given geometry cannot be empty");let f={points:g,external:s({delta:_,corners:p,segments:m,closed:A},g),internal:s({delta:-_,corners:p,segments:m,closed:A},g)};if(d.isClosed)return a(f);else return c(f,m,p,_)};t.exports=l}}),o0t=At({"node_modules/@jscad/modeling/src/operations/expansions/expand.js"(e,t){var n=Is(),o=qs(),r=Os(),i=zh(),s=ONi(),a=GNi(),c=UNi(),l=(h,...d)=>{if(d=n(d),d.length===0)throw Error("wrong number of arguments");let u=d.map((_)=>{if(i.isA(_))return c(h,_);if(o.isA(_))return s(h,_);if(r.isA(_))return a(h,_);return _});return u.length===1?u[0]:u};t.exports=l}}),WNi=At({"node_modules/@jscad/modeling/src/operations/expansions/offsetGeom2.js"(e,t){var n=qs(),o=zut(),r=XEe(),i=(s,a)=>{let c={delta:1,corners:"edge",segments:0},{delta:l,corners:h,segments:d}=Object.assign({},c,s);if(!(h==="edge"||h==="chamfer"||h==="round"))throw Error('corners must be "edge", "chamfer", or "round"');let u=n.toOutlines(a),p=u.map((m)=>(s={delta:u.reduce((f,y)=>f+o.arePointsInside(m,o.create(y)),0)%2===0?l:-l,corners:h,closed:!0,segments:d},r(s,m))).reduce((m,A)=>m.concat(n.toSides(n.fromPoints(A))),[]);return n.create(p)};t.exports=i}}),XNi=At({"node_modules/@jscad/modeling/src/operations/expansions/offsetPath2.js"(e,t){var n=zh(),o=XEe(),r=(i,s)=>{let a={delta:1,corners:"edge",closed:s.isClosed,segments:16},{delta:c,corners:l,closed:h,segments:d}=Object.assign({},a,i);if(!(l==="edge"||l==="chamfer"||l==="round"))throw Error('corners must be "edge", "chamfer", or "round"');i={delta:c,corners:l,closed:h,segments:d};let u=o(i,n.toPoints(s));return n.fromPoints({closed:h},u)};t.exports=r}}),jNi=At({"node_modules/@jscad/modeling/src/operations/expansions/offset.js"(e,t){var n=Is(),o=qs(),r=zh(),i=WNi(),s=XNi(),a=(c,...l)=>{if(l=n(l),l.length===0)throw Error("wrong number of arguments");let h=l.map((d)=>{if(r.isA(d))return s(c,d);if(o.isA(d))return i(c,d);return d});return h.length===1?h[0]:h};t.exports=a}}),$Xn=At({"node_modules/@jscad/modeling/src/operations/expansions/index.js"(e,t){t.exports={expand:o0t(),offset:jNi()}}}),jEe=At({"node_modules/@jscad/modeling/src/operations/extrusions/extrudeLinearGeom2.js"(e,t){var n=ld(),o=ui(),r=qs(),i=tte(),s=WEe(),a=(c,l)=>{let h={offset:[0,0,1],twistAngle:0,twistSteps:12,repair:!0},{offset:d,twistAngle:u,twistSteps:_,repair:p}=Object.assign({},h,c);if(_<1)throw Error("twistSteps must be 1 or more");if(u===0)_=1;let m=o.clone(d),A=r.toSides(l);if(A.length===0)throw Error("the given geometry cannot be empty");let g=i.fromSides(A);if(m[2]<0)i.reverse(g,g);let f=n.create(),y=(x,C,b)=>{let I=C/_*u,v=o.scale(o.create(),m,C/_);return n.multiply(f,n.fromZRotation(f,I),n.fromTranslation(n.create(),v)),i.transform(f,b)};return c={numberOfSlices:_+1,capStart:!0,capEnd:!0,repair:p,callback:y},s(c,g)};t.exports=a}}),KNi=At({"node_modules/@jscad/modeling/src/operations/extrusions/extrudeLinearPath2.js"(e,t){var n=qs(),o=zh(),r=jEe(),i=(s,a)=>{if(!a.isClosed)throw Error("extruded path must be closed");let c=o.toPoints(a),l=n.fromPoints(c);return r(s,l)};t.exports=i}}),$Ni=At({"node_modules/@jscad/modeling/src/operations/extrusions/extrudeLinear.js"(e,t){var n=Is(),o=qs(),r=zh(),i=jEe(),s=KNi(),a=(c,...l)=>{let h={height:1,twistAngle:0,twistSteps:1,repair:!0},{height:d,twistAngle:u,twistSteps:_,repair:p}=Object.assign({},h,c);if(l=n(l),l.length===0)throw Error("wrong number of arguments");c={offset:[0,0,d],twistAngle:u,twistSteps:_,repair:p};let m=l.map((A)=>{if(r.isA(A))return s(c,A);if(o.isA(A))return i(c,A);return A});return m.length===1?m[0]:m};t.exports=a}}),qNi=At({"node_modules/@jscad/modeling/src/operations/extrusions/extrudeRectangularPath2.js"(e,t){var n=zh(),o=o0t(),r=jEe(),i=(s,a)=>{let c={size:1,height:1},{size:l,height:h}=Object.assign({},c,s);if(s.delta=l,s.offset=[0,0,h],n.toPoints(a).length===0)throw Error("the given geometry cannot be empty");let u=o(s,a);return r(s,u)};t.exports=i}}),JNi=At({"node_modules/@jscad/modeling/src/operations/extrusions/extrudeRectangularGeom2.js"(e,t){var{area:n}=Mpe(),o=qs(),r=zh(),i=o0t(),s=jEe(),a=(c,l)=>{let h={size:1,height:1},{size:d,height:u}=Object.assign({},h,c);c.delta=d,c.offset=[0,0,u];let _=o.toOutlines(l);if(_.length===0)throw Error("the given geometry cannot be empty");let m=_.map((g)=>{if(n(g)<0)g.reverse();return i(c,r.fromPoints({closed:!0},g))}).reduce((g,f)=>g.concat(o.toSides(f)),[]),A=o.create(m);return s(c,A)};t.exports=a}}),ZNi=At({"node_modules/@jscad/modeling/src/operations/extrusions/extrudeRectangular.js"(e,t){var n=Is(),o=qs(),r=zh(),i=qNi(),s=JNi(),a=(c,...l)=>{let h={size:1,height:1},{size:d,height:u}=Object.assign({},h,c);if(l=n(l),l.length===0)throw Error("wrong number of arguments");if(d<=0)throw Error("size must be positive");if(u<=0)throw Error("height must be positive");let _=l.map((p)=>{if(r.isA(p))return i(c,p);if(o.isA(p))return s(c,p);return p});return _.length===1?_[0]:_};t.exports=a}}),eRi=At({"node_modules/@jscad/modeling/src/operations/extrusions/extrudeHelical.js"(e,t){var{TAU:n}=fc(),o=ld(),r=qs(),i=WEe(),s=tte(),a=(c,l)=>{let h={angle:n,startAngle:0,pitch:10,height:0,endOffset:0,segmentsPerRotation:32},{angle:d,startAngle:u,pitch:_,height:p,endOffset:m,segmentsPerRotation:A}=Object.assign({},h,c);if(p!=0)_=p/(d/n);if(A<3)throw Error("The number of segments per rotation needs to be at least 3.");let f=r.toSides(l);if(f.length===0)throw Error("The given geometry cannot be empty");let y=f.filter((M)=>M[0][0]>=0),x=s.fromSides(f);if(y.length===0)x=s.reverse(x);let C=Math.round(A/n*Math.abs(d)),b=C>=2?C:2,I=o.create(),v=o.create(),P=(M,B,T)=>{let N=u+d/b*B,D=m/b*B,L=(N-u)/n*_;return o.multiply(I,o.fromTranslation(o.create(),[D,0,L*Math.sign(d)]),o.fromXRotation(o.create(),-n/4*Math.sign(d))),o.multiply(v,o.fromZRotation(o.create(),N),I),s.transform(v,T)};return i({numberOfSlices:b+1,callback:P},x)};t.exports=a}}),tRi=At({"node_modules/@jscad/modeling/src/operations/extrusions/project.js"(e,t){var n=Is(),o=Gut(),r=EP(),i=ld(),s=qs(),a=Os(),c=qa(),l=IL(),h=KXn(),d=(_,p)=>{let m=r.fromNormalAndPoint(r.create(),_.axis,_.origin);if(Number.isNaN(m[0])||Number.isNaN(m[1])||Number.isNaN(m[2])||Number.isNaN(m[3]))throw Error("project: invalid axis or origin");let A=l(p),g=A*A*Math.sqrt(3)/4;if(A===0)return s.create();let f=a.toPolygons(p),y=[];for(let C=0;C<f.length;C++){let b=f[C].vertices.map((P)=>r.projectionOfPoint(m,P)),I=c.create(b),v=c.plane(I);if(!o(m,v))continue;if(c.measureArea(I)<g)continue;y.push(I)}if(!o(m,[0,0,1])){let C=i.fromVectorRotation(i.create(),m,[0,0,1]);y=y.map((b)=>c.transform(C,b))}y=y.sort((C,b)=>c.measureArea(b)-c.measureArea(C));let x=y.map((C)=>s.fromPoints(C.vertices));return h(x)},u=(_,...p)=>{let m={axis:[0,0,1],origin:[0,0,0]},{axis:A,origin:g}=Object.assign({},m,_);if(p=n(p),p.length===0)throw Error("wrong number of arguments");_={axis:A,origin:g};let f=p.map((y)=>{if(a.isA(y))return d(_,y);return y});return f.length===1?f[0]:f};t.exports=u}}),Npe=At({"node_modules/@jscad/modeling/src/operations/extrusions/index.js"(e,t){t.exports={extrudeFromSlices:WEe(),extrudeLinear:$Ni(),extrudeRectangular:ZNi(),extrudeRotate:zXn(),extrudeHelical:eRi(),project:tRi(),slice:tte()}}}),r0t=At({"node_modules/@jscad/modeling/src/operations/hulls/hullPoints2.js"(e,t){var n=ya(),o=(s)=>{let a=n.fromValues(1/0,1/0);s.forEach((h)=>{if(h[1]<a[1]||h[1]===a[1]&&h[0]<a[0])a=h});let c=[];s.forEach((h)=>{let d=i(h[1]-a[1],h[0]-a[0]),u=n.squaredDistance(h,a);c.push({point:h,angle:d,distSq:u})}),c.sort((h,d)=>h.angle!==d.angle?h.angle-d.angle:h.distSq-d.distSq);let l=[];return c.forEach((h)=>{let d=l.length;while(d>1&&r(l[d-2],l[d-1],h.point)<=Number.EPSILON)l.pop(),d=l.length;l.push(h.point)}),l},r=(s,a,c)=>(a[0]-s[0])*(c[1]-s[1])-(a[1]-s[1])*(c[0]-s[0]),i=(s,a)=>{if(s===0&&a===0)return-1/0;else return-a/s};t.exports=o}}),i0t=At({"node_modules/@jscad/modeling/src/operations/hulls/toUniquePoints.js"(e,t){var n=qs(),o=Os(),r=zh(),i=(s)=>{let a=new Set,c=[],l=(h)=>{let d=h.toString();if(!a.has(d))c.push(h),a.add(d)};return s.forEach((h)=>{if(n.isA(h))n.toPoints(h).forEach(l);else if(o.isA(h))o.toPoints(h).forEach((d)=>d.forEach(l));else if(r.isA(h))r.toPoints(h).forEach(l)}),c};t.exports=i}}),nRi=At({"node_modules/@jscad/modeling/src/operations/hulls/hullPath2.js"(e,t){var n=Is(),o=zh(),r=r0t(),i=i0t(),s=(...a)=>{a=n(a);let c=i(a),l=r(c);return o.fromPoints({closed:!0},l)};t.exports=s}}),oRi=At({"node_modules/@jscad/modeling/src/operations/hulls/hullGeom2.js"(e,t){var n=Is(),o=qs(),r=r0t(),i=i0t(),s=(...a)=>{a=n(a);let c=i(a),l=r(c);if(l.length<3)return o.create();return o.fromPoints(l)};t.exports=s}}),rRi=At({"node_modules/@jscad/modeling/src/operations/hulls/hullGeom3.js"(e,t){var n=Is(),o=Os(),r=i0t(),i=e0t(),s=(...a)=>{a=n(a);let c=r(a);if(c.length===0)return o.create();return o.create(i(c))};t.exports=s}}),qXn=At({"node_modules/@jscad/modeling/src/operations/hulls/hull.js"(e,t){var n=Is(),o=Bpe(),r=qs(),i=Os(),s=zh(),a=nRi(),c=oRi(),l=rRi(),h=(...d)=>{if(d=n(d),d.length===0)throw Error("wrong number of arguments");if(!o(d))throw Error("only hulls of the same type are supported");let u=d[0];if(s.isA(u))return a(d);if(r.isA(u))return c(d);if(i.isA(u))return l(d);return u};t.exports=h}}),iRi=At({"node_modules/@jscad/modeling/src/operations/hulls/hullChain.js"(e,t){var n=Is(),o=n0t(),r=qXn(),i=(...s)=>{if(s=n(s),s.length<2)throw Error("wrong number of arguments");let a=[];for(let c=1;c<s.length;c++)a.push(r(s[c-1],s[c]));return o(a)};t.exports=i}}),sRi=At({"node_modules/@jscad/modeling/src/operations/hulls/index.js"(e,t){t.exports={hull:qXn(),hullChain:iRi(),hullPoints2:r0t(),hullPoints3:e0t()}}}),aRi=At({"node_modules/@jscad/modeling/src/operations/minkowski/index.js"(e,t){t.exports={minkowskiSum:XXn()}}}),JXn=At({"node_modules/@jscad/modeling/src/operations/modifiers/snapPolygons.js"(e,t){var n=ui(),o=qa(),r=(s,a)=>{let c=Math.abs(o.measureArea(a));return Number.isFinite(c)&&c>s},i=(s,a)=>{let c=a.map((h)=>{let d=h.vertices.map((p)=>n.snap(n.create(),p,s)),u=[];for(let p=0;p<d.length;p++){let m=(p+1)%d.length;if(!n.equals(d[p],d[m]))u.push(d[p])}let _=o.create(u);if(h.color)_.color=h.color;return _}),l=s*s*Math.sqrt(3)/4;return c=c.filter((h)=>r(l,h)),c};t.exports=i}}),cRi=At({"node_modules/@jscad/modeling/src/operations/modifiers/mergePolygons.js"(e,t){var n=Gut(),o=ui(),r=qa(),i=(g)=>{let f=r.toPoints(g),y=[];for(let x=0;x<f.length;x++){let C=(x+1)%f.length,b={v1:f[x],v2:f[C]};y.push(b)}for(let x=0;x<y.length;x++){let C=(x+1)%f.length;y[x].next=y[C],y[C].prev=y[x]}return y},s=(g,f)=>{let y=`${f.v1}:${f.v2}`;g.set(y,f)},a=(g,f)=>{let y=`${f.v1}:${f.v2}`;g.delete(y)},c=(g,f)=>{let y=`${f.v2}:${f.v1}`;return g.get(y)},l=(g,f,y)=>{let x=g.prev.v1,C=g.prev.v2,b=f.next.v2,I=u(x,C,b,y);x=f.prev.v1,C=f.prev.v2,b=g.next.v2;let v=u(x,C,b,y);return[I,v]},h=o.create(),d=o.create(),u=(g,f,y,x)=>{let C=o.subtract(h,f,g),b=o.subtract(d,y,f);return o.cross(C,C,b),o.dot(C,x)},_=(g)=>{let f,y=[];while(g.next){let x=g.next;y.push(g.v1),g.v1=null,g.v2=null,g.next=null,g.prev=null,g=x}if(y.length>0)f=r.create(y);return f},p=(g)=>{if(g.length<2)return g;let f=g[0].plane,y=g.slice(),x=new Map;while(y.length>0){let b=y.shift(),I=i(b);for(let v=0;v<I.length;v++){let P=I[v],M=c(x,P);if(M){let B=l(P,M,f);if(B[0]>=0&&B[1]>=0){let T=M.next,N=P.next;P.prev.next=M.next,P.next.prev=M.prev,M.prev.next=P.next,M.next.prev=P.prev,P.v1=null,P.v2=null,P.next=null,P.prev=null,a(x,M),M.v1=null,M.v2=null,M.next=null,M.prev=null;let D=(L,H,V)=>{let O={v1:V.v1,v2:H.v2,next:H.next,prev:V.prev};V.prev.next=O,H.next.prev=O,a(L,H),H.v1=null,H.v2=null,H.next=null,H.prev=null,a(L,V),V.v1=null,V.v2=null,V.next=null,V.prev=null};if(B[0]===0)D(x,T,T.prev);if(B[1]===0)D(x,N,N.prev)}}else if(P.next)s(x,P)}}let C=[];return x.forEach((b)=>{let I=_(b);if(I)C.push(I)}),x.clear(),C},m=(g,f)=>{if(Math.abs(g[3]-f[3])<0.00000015)return n(g,f);return!1},A=(g,f)=>{let y=[];f.forEach((C)=>{let b=y.find((I)=>m(I[0],r.plane(C)));if(b)b[1].push(C);else y.push([r.plane(C),[C]])});let x=[];return y.forEach((C)=>{let b=C[1],I=p(b);x=x.concat(I)}),x};t.exports=A}}),lRi=At({"node_modules/@jscad/modeling/src/operations/modifiers/insertTjunctions.js"(e,t){var n=fc(),o=ui(),r=qa(),i=!1,s=(h)=>`${h}`,a=(h,d,u,_,p,m)=>{let A=s(_),g=s(p);if(i&&A===g)throw Error("assert failed");let f=`${A}/${g}`,y=`${g}/${A}`;if(h.has(y))return c(h,d,u,p,_,null),null;let x={vertex0:_,vertex1:p,polygonindex:m};if(!h.has(f))h.set(f,[x]);else h.get(f).push(x);if(d.has(A))d.get(A).push(f);else d.set(A,[f]);if(u.has(g))u.get(g).push(f);else u.set(g,[f]);return f},c=(h,d,u,_,p,m)=>{let A=s(_),g=s(p),f=`${A}/${g}`;if(i&&!h.has(f))throw Error("assert failed");let y=-1,x=h.get(f);for(let C=0;C<x.length;C++){let b=x[C],I=s(b.vertex0);if(I!==A)continue;if(I=s(b.vertex1),I!==g)continue;if(m!==null){if(b.polygonindex!==m)continue}y=C;break}if(i&&y<0)throw Error("assert failed");if(x.splice(y,1),x.length===0)h.delete(f);if(y=d.get(A).indexOf(f),i&&y<0)throw Error("assert failed");if(d.get(A).splice(y,1),d.get(A).length===0)d.delete(A);if(y=u.get(g).indexOf(f),i&&y<0)throw Error("assert failed");if(u.get(g).splice(y,1),u.get(g).length===0)u.delete(g)},l=(h)=>{let d=new Map;for(let u=0;u<h.length;u++){let _=h[u],p=_.vertices.length;if(p>=3){let m=_.vertices[0],A=s(m);for(let g=0;g<p;g++){let f=g+1;if(f===p)f=0;let y=_.vertices[f],x=s(y),C=`${A}/${x}`,b=`${x}/${A}`;if(d.has(b)){let I=d.get(b);if(I.splice(-1,1),I.length===0)d.delete(b)}else{let I={vertex0:m,vertex1:y,polygonindex:u};if(!d.has(C))d.set(C,[I]);else d.get(C).push(I)}m=y,A=x}}else console.warn("warning: invalid polygon found during insertTjunctions")}if(d.size>0){let u=new Map,_=new Map,p=new Map;for(let[A,g]of d)p.set(A,!0),g.forEach((f)=>{let y=s(f.vertex0),x=s(f.vertex1);if(u.has(y))u.get(y).push(A);else u.set(y,[A]);if(_.has(x))_.get(x).push(A);else _.set(x,[A])});let m=h.slice(0);while(!0){if(d.size===0)break;for(let g of d.keys())p.set(g,!0);let A=!1;while(!0){let g=Array.from(p.keys());if(g.length===0)break;let f=g[0],y=!0;if(d.has(f)){let x=d.get(f);if(i&&x.length===0)throw Error("assert failed");let C=x[0];for(let b=0;b<2;b++){let I=b===0?C.vertex0:C.vertex1,v=b===0?C.vertex1:C.vertex0,P=s(I),M=s(v),B=[];if(b===0){if(_.has(P))B=_.get(P)}else if(u.has(P))B=u.get(P);for(let T=0;T<B.length;T++){let N=B[T],D=d.get(N)[0],L=b===0?D.vertex0:D.vertex1,H=b===0?D.vertex1:D.vertex0,V=s(L),O=s(H);if(i&&O!==P)throw Error("assert failed");if(V===M){c(d,u,_,I,v,null),c(d,u,_,v,I,null),y=!1,b=2,A=!0;break}else{let U=I,j=v,Y=L,X=o.subtract(o.create(),Y,U),K=o.dot(o.subtract(o.create(),j,U),X)/o.dot(X,X);if(K>0&&K<1){let J=o.scale(o.create(),X,K);if(o.add(J,J,U),o.squaredDistance(J,j)<n.EPS*n.EPS){let se=D.polygonindex,ne=m[se],re=s(D.vertex1),Z=-1;for(let de=0;de<ne.vertices.length;de++)if(s(ne.vertices[de])===re){Z=de;break}if(i&&Z<0)throw Error("assert failed");let te=ne.vertices.slice(0);te.splice(Z,0,v);let ie=r.create(te);m[se]=ie,c(d,u,_,D.vertex0,D.vertex1,se);let ce=a(d,u,_,D.vertex0,v,se),ue=a(d,u,_,v,D.vertex1,se);if(ce!==null)p.set(ce,!0);if(ue!==null)p.set(ue,!0);y=!1,b=2,A=!0;break}}}}}}if(y)p.delete(f)}if(!A)break}h=m}return d.clear(),h};t.exports=l}}),hRi=At({"node_modules/@jscad/modeling/src/operations/modifiers/triangulatePolygons.js"(e,t){var n=ui(),o=qa(),r=(s,a,c)=>{let l=a.vertices.length;if(l>3){if(l>4){let u=[0,0,0];a.vertices.forEach((_)=>n.add(u,u,_)),n.snap(u,n.divide(u,u,[l,l,l]),s);for(let _=0;_<l;_++){let p=o.create([u,a.vertices[_],a.vertices[(_+1)%l]]);if(a.color)p.color=a.color;c.push(p)}return}let h=o.create([a.vertices[0],a.vertices[1],a.vertices[2]]),d=o.create([a.vertices[0],a.vertices[2],a.vertices[3]]);if(a.color)h.color=a.color,d.color=a.color;c.push(h,d);return}c.push(a)},i=(s,a)=>{let c=[];return a.forEach((l)=>{r(s,l,c)}),c};t.exports=i}}),dRi=At({"node_modules/@jscad/modeling/src/operations/modifiers/generalize.js"(e,t){var n=Is(),o=IL(),r=qs(),i=Os(),s=zh(),a=JXn(),c=cRi(),l=lRi(),h=hRi(),d=(m,A)=>A,u=(m,A)=>A,_=(m,A)=>{let g={snap:!1,simplify:!1,triangulate:!1},{snap:f,simplify:y,triangulate:x}=Object.assign({},g,m),C=o(A),b=i.toPolygons(A);if(f)b=a(C,b);if(y)b=c(C,b);if(x)b=l(b),b=h(C,b);let I=Object.assign({},A);return I.polygons=b,I},p=(m,...A)=>{if(A=n(A),A.length===0)throw Error("wrong number of arguments");let g=A.map((f)=>{if(s.isA(f))return d(m,f);if(r.isA(f))return u(m,f);if(i.isA(f))return _(m,f);throw Error("invalid geometry")});return g.length===1?g[0]:g};t.exports=p}}),uRi=At({"node_modules/@jscad/modeling/src/operations/modifiers/snap.js"(e,t){var n=Is(),o=ya(),r=qs(),i=Os(),s=zh(),a=IL(),c=JXn(),l=(_)=>{let p=a(_),A=s.toPoints(_).map((g)=>o.snap(o.create(),g,p));return s.create(A)},h=(_)=>{let p=a(_),A=r.toSides(_).map((g)=>[o.snap(o.create(),g[0],p),o.snap(o.create(),g[1],p)]);return A=A.filter((g)=>!o.equals(g[0],g[1])),r.create(A)},d=(_)=>{let p=a(_),m=i.toPolygons(_),A=c(p,m);return i.create(A)},u=(..._)=>{if(_=n(_),_.length===0)throw Error("wrong number of arguments");let p=_.map((m)=>{if(s.isA(m))return l(m);if(r.isA(m))return h(m);if(i.isA(m))return d(m);return m});return p.length===1?p[0]:p};t.exports=u}}),pRi=At({"node_modules/@jscad/modeling/src/operations/modifiers/index.js"(e,t){t.exports={generalize:dRi(),snap:uRi(),retessellate:Tpe()}}}),mRi=At({"node_modules/@jscad/modeling/src/utils/padArrayToLength.js"(e,t){var n=(o,r,i)=>{o=o.slice();while(o.length<i)o.push(r);return o};t.exports=n}}),_Ri=At({"node_modules/@jscad/modeling/src/operations/transforms/align.js"(e,t){var n=Is(),o=mRi(),r=Wut(),{translate:i}=bG(),s=(h)=>{if(!Array.isArray(h.modes)||h.modes.length>3)throw Error("align(): modes must be an array of length <= 3");if(h.modes=o(h.modes,"none",3),h.modes.filter((d)=>["center","max","min","none"].includes(d)).length!==3)throw Error('align(): all modes must be one of "center", "max" or "min"');if(!Array.isArray(h.relativeTo)||h.relativeTo.length>3)throw Error("align(): relativeTo must be an array of length <= 3");if(h.relativeTo=o(h.relativeTo,0,3),h.relativeTo.filter((d)=>Number.isFinite(d)||d==null).length!==3)throw Error("align(): all relativeTo values must be a number, or null.");if(typeof h.grouped!=="boolean")throw Error("align(): grouped must be a boolean value.");return h},a=(h,d,u)=>{for(let _=0;_<3;_++)if(h[_]==null){if(d[_]==="center")h[_]=(u[0][_]+u[1][_])/2;else if(d[_]==="max")h[_]=u[1][_];else if(d[_]==="min")h[_]=u[0][_]}return h},c=(h,d,u)=>{let _=r(h),p=[0,0,0];for(let m=0;m<3;m++)if(d[m]==="center")p[m]=u[m]-(_[0][m]+_[1][m])/2;else if(d[m]==="max")p[m]=u[m]-_[1][m];else if(d[m]==="min")p[m]=u[m]-_[0][m];return i(p,h)},l=(h,...d)=>{h=Object.assign({},{modes:["center","center","min"],relativeTo:[0,0,0],grouped:!1},h),h=s(h);let{modes:_,relativeTo:p,grouped:m}=h;if(d=n(d),d.length===0)throw Error("align(): No geometries were provided to act upon");if(p.filter((A)=>A==null).length){let A=r(d);p=a(p,_,A)}if(m)d=c(d,_,p);else d=d.map((A)=>c(A,_,p));return d.length===1?d[0]:d};t.exports=l}}),kPe=At({"node_modules/@jscad/modeling/src/operations/transforms/center.js"(e,t){var n=Is(),o=qs(),r=Os(),i=zh(),s=wG(),{translate:a}=bG(),c=(_,p)=>{let m={axes:[!0,!0,!0],relativeTo:[0,0,0]},{axes:A,relativeTo:g}=Object.assign({},m,_),f=s(p),y=[0,0,0];if(A[0])y[0]=g[0]-(f[0][0]+(f[1][0]-f[0][0])/2);if(A[1])y[1]=g[1]-(f[0][1]+(f[1][1]-f[0][1])/2);if(A[2])y[2]=g[2]-(f[0][2]+(f[1][2]-f[0][2])/2);return a(y,p)},l=(_,...p)=>{let m={axes:[!0,!0,!0],relativeTo:[0,0,0]},{axes:A,relativeTo:g}=Object.assign({},m,_);if(p=n(p),p.length===0)throw Error("wrong number of arguments");if(g.length!==3)throw Error("relativeTo must be an array of length 3");_={axes:A,relativeTo:g};let f=p.map((y)=>{if(i.isA(y))return c(_,y);if(o.isA(y))return c(_,y);if(r.isA(y))return c(_,y);return y});return f.length===1?f[0]:f},h=(..._)=>l({axes:[!0,!1,!1]},_),d=(..._)=>l({axes:[!1,!0,!1]},_),u=(..._)=>l({axes:[!1,!1,!0]},_);t.exports={center:l,centerX:h,centerY:d,centerZ:u}}}),LPe=At({"node_modules/@jscad/modeling/src/operations/transforms/scale.js"(e,t){var n=Is(),o=ld(),r=qs(),i=Os(),s=zh(),a=(d,...u)=>{if(!Array.isArray(d))throw Error("factors must be an array");if(u=n(u),u.length===0)throw Error("wrong number of arguments");d=d.slice();while(d.length<3)d.push(1);if(d[0]<=0||d[1]<=0||d[2]<=0)throw Error("factors must be positive");let _=o.fromScaling(o.create(),d),p=u.map((m)=>{if(s.isA(m))return s.transform(_,m);if(r.isA(m))return r.transform(_,m);if(i.isA(m))return i.transform(_,m);return m});return p.length===1?p[0]:p},c=(d,...u)=>a([d,1,1],u),l=(d,...u)=>a([1,d,1],u),h=(d,...u)=>a([1,1,d],u);t.exports={scale:a,scaleX:c,scaleY:l,scaleZ:h}}}),gRi=At({"node_modules/@jscad/modeling/src/operations/transforms/transform.js"(e,t){var n=Is(),o=qs(),r=Os(),i=zh(),s=(a,...c)=>{if(c=n(c),c.length===0)throw Error("wrong number of arguments");let l=c.map((h)=>{if(i.isA(h))return i.transform(a,h);if(o.isA(h))return o.transform(a,h);if(r.isA(h))return r.transform(a,h);return h});return l.length===1?l[0]:l};t.exports=s}}),DG=At({"node_modules/@jscad/modeling/src/operations/transforms/index.js"(e,t){t.exports={align:_Ri(),center:kPe().center,centerX:kPe().centerX,centerY:kPe().centerY,centerZ:kPe().centerZ,mirror:cpe().mirror,mirrorX:cpe().mirrorX,mirrorY:cpe().mirrorY,mirrorZ:cpe().mirrorZ,rotate:lpe().rotate,rotateX:lpe().rotateX,rotateY:lpe().rotateY,rotateZ:lpe().rotateZ,scale:LPe().scale,scaleX:LPe().scaleX,scaleY:LPe().scaleY,scaleZ:LPe().scaleZ,transform:gRi(),translate:bG().translate,translateX:bG().translateX,translateY:bG().translateY,translateZ:bG().translateZ}}}),KEe=At({"node_modules/@jscad/modeling/src/index.js"(e,t){t.exports={colors:YEe(),curves:dDi(),geometries:Out(),maths:kDi(),measurements:wXn(),primitives:TG(),text:CNi(),utils:GXn(),booleans:Dpe(),expansions:$Xn(),extrusions:Npe(),hulls:sRi(),minkowski:aRi(),modifiers:pRi(),transforms:DG()}}}),ZXn={};Z9(ZXn,{ANGLE_ORDER:()=>s0t,ARRAY_TYPE:()=>Va,EPSILON:()=>oi,RANDOM:()=>Xb,equals:()=>xRi,round:()=>xP,setMatrixArrayType:()=>ARi,toDegree:()=>yRi,toRadian:()=>fRi});function xP(e){if(e>=0)return Math.round(e);return e%0.5===0?Math.floor(e):Math.round(e)}function ARi(e){Va=e}function fRi(e){return e*ejn}function yRi(e){return e*tjn}function xRi(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:oi;return Math.abs(e-t)<=n*Math.max(1,Math.abs(e),Math.abs(t))}var oi,Va,Xb,s0t,ejn,tjn,MP=J9({"node_modules/gl-matrix/esm/common.js"(){oi=0.000001,Va=typeof Float32Array<"u"?Float32Array:Array,Xb=Math.random,s0t="zyx",ejn=Math.PI/180,tjn=180/Math.PI}}),njn={};Z9(njn,{LDU:()=>LRi,add:()=>HRi,adjoint:()=>wRi,clone:()=>bRi,copy:()=>IRi,create:()=>CRi,determinant:()=>BRi,equals:()=>zRi,exactEquals:()=>FRi,frob:()=>kRi,fromRotation:()=>NRi,fromScaling:()=>RRi,fromValues:()=>SRi,identity:()=>vRi,invert:()=>MRi,mul:()=>ijn,multiply:()=>ojn,multiplyScalar:()=>ORi,multiplyScalarAndAdd:()=>VRi,rotate:()=>TRi,scale:()=>DRi,set:()=>PRi,str:()=>QRi,sub:()=>sjn,subtract:()=>rjn,transpose:()=>ERi});function CRi(){var e=new Va(4);if(Va!=Float32Array)e[1]=0,e[2]=0;return e[0]=1,e[3]=1,e}function bRi(e){var t=new Va(4);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}function IRi(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}function vRi(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e}function SRi(e,t,n,o){var r=new Va(4);return r[0]=e,r[1]=t,r[2]=n,r[3]=o,r}function PRi(e,t,n,o,r){return e[0]=t,e[1]=n,e[2]=o,e[3]=r,e}function ERi(e,t){if(e===t){var n=t[1];e[1]=t[2],e[2]=n}else e[0]=t[0],e[1]=t[2],e[2]=t[1],e[3]=t[3];return e}function MRi(e,t){var n=t[0],o=t[1],r=t[2],i=t[3],s=n*i-r*o;if(!s)return null;return s=1/s,e[0]=i*s,e[1]=-o*s,e[2]=-r*s,e[3]=n*s,e}function wRi(e,t){var n=t[0];return e[0]=t[3],e[1]=-t[1],e[2]=-t[2],e[3]=n,e}function BRi(e){return e[0]*e[3]-e[2]*e[1]}function ojn(e,t,n){var o=t[0],r=t[1],i=t[2],s=t[3],a=n[0],c=n[1],l=n[2],h=n[3];return e[0]=o*a+i*c,e[1]=r*a+s*c,e[2]=o*l+i*h,e[3]=r*l+s*h,e}function TRi(e,t,n){var o=t[0],r=t[1],i=t[2],s=t[3],a=Math.sin(n),c=Math.cos(n);return e[0]=o*c+i*a,e[1]=r*c+s*a,e[2]=o*-a+i*c,e[3]=r*-a+s*c,e}function DRi(e,t,n){var o=t[0],r=t[1],i=t[2],s=t[3],a=n[0],c=n[1];return e[0]=o*a,e[1]=r*a,e[2]=i*c,e[3]=s*c,e}function NRi(e,t){var n=Math.sin(t),o=Math.cos(t);return e[0]=o,e[1]=n,e[2]=-n,e[3]=o,e}function RRi(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=t[1],e}function QRi(e){return"mat2("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+")"}function kRi(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]+e[3]*e[3])}function LRi(e,t,n,o){return e[2]=o[2]/o[0],n[0]=o[0],n[1]=o[1],n[3]=o[3]-e[2]*n[1],[e,t,n]}function HRi(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e}function rjn(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e}function FRi(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]}function zRi(e,t){var n=e[0],o=e[1],r=e[2],i=e[3],s=t[0],a=t[1],c=t[2],l=t[3];return Math.abs(n-s)<=oi*Math.max(1,Math.abs(n),Math.abs(s))&&Math.abs(o-a)<=oi*Math.max(1,Math.abs(o),Math.abs(a))&&Math.abs(r-c)<=oi*Math.max(1,Math.abs(r),Math.abs(c))&&Math.abs(i-l)<=oi*Math.max(1,Math.abs(i),Math.abs(l))}function ORi(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e}function VRi(e,t,n,o){return e[0]=t[0]+n[0]*o,e[1]=t[1]+n[1]*o,e[2]=t[2]+n[2]*o,e[3]=t[3]+n[3]*o,e}var ijn,sjn,YRi=J9({"node_modules/gl-matrix/esm/mat2.js"(){MP(),ijn=ojn,sjn=rjn}}),ajn={};Z9(ajn,{add:()=>sQi,clone:()=>URi,copy:()=>WRi,create:()=>GRi,determinant:()=>qRi,equals:()=>hQi,exactEquals:()=>lQi,frob:()=>iQi,fromRotation:()=>tQi,fromScaling:()=>nQi,fromTranslation:()=>oQi,fromValues:()=>jRi,identity:()=>XRi,invert:()=>$Ri,mul:()=>hjn,multiply:()=>cjn,multiplyScalar:()=>aQi,multiplyScalarAndAdd:()=>cQi,rotate:()=>JRi,scale:()=>ZRi,set:()=>KRi,str:()=>rQi,sub:()=>djn,subtract:()=>ljn,translate:()=>eQi});function GRi(){var e=new Va(6);if(Va!=Float32Array)e[1]=0,e[2]=0,e[4]=0,e[5]=0;return e[0]=1,e[3]=1,e}function URi(e){var t=new Va(6);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t}function WRi(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e}function XRi(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e[4]=0,e[5]=0,e}function jRi(e,t,n,o,r,i){var s=new Va(6);return s[0]=e,s[1]=t,s[2]=n,s[3]=o,s[4]=r,s[5]=i,s}function KRi(e,t,n,o,r,i,s){return e[0]=t,e[1]=n,e[2]=o,e[3]=r,e[4]=i,e[5]=s,e}function $Ri(e,t){var n=t[0],o=t[1],r=t[2],i=t[3],s=t[4],a=t[5],c=n*i-o*r;if(!c)return null;return c=1/c,e[0]=i*c,e[1]=-o*c,e[2]=-r*c,e[3]=n*c,e[4]=(r*a-i*s)*c,e[5]=(o*s-n*a)*c,e}function qRi(e){return e[0]*e[3]-e[1]*e[2]}function cjn(e,t,n){var o=t[0],r=t[1],i=t[2],s=t[3],a=t[4],c=t[5],l=n[0],h=n[1],d=n[2],u=n[3],_=n[4],p=n[5];return e[0]=o*l+i*h,e[1]=r*l+s*h,e[2]=o*d+i*u,e[3]=r*d+s*u,e[4]=o*_+i*p+a,e[5]=r*_+s*p+c,e}function JRi(e,t,n){var o=t[0],r=t[1],i=t[2],s=t[3],a=t[4],c=t[5],l=Math.sin(n),h=Math.cos(n);return e[0]=o*h+i*l,e[1]=r*h+s*l,e[2]=o*-l+i*h,e[3]=r*-l+s*h,e[4]=a,e[5]=c,e}function ZRi(e,t,n){var o=t[0],r=t[1],i=t[2],s=t[3],a=t[4],c=t[5],l=n[0],h=n[1];return e[0]=o*l,e[1]=r*l,e[2]=i*h,e[3]=s*h,e[4]=a,e[5]=c,e}function eQi(e,t,n){var o=t[0],r=t[1],i=t[2],s=t[3],a=t[4],c=t[5],l=n[0],h=n[1];return e[0]=o,e[1]=r,e[2]=i,e[3]=s,e[4]=o*l+i*h+a,e[5]=r*l+s*h+c,e}function tQi(e,t){var n=Math.sin(t),o=Math.cos(t);return e[0]=o,e[1]=n,e[2]=-n,e[3]=o,e[4]=0,e[5]=0,e}function nQi(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=t[1],e[4]=0,e[5]=0,e}function oQi(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e[4]=t[0],e[5]=t[1],e}function rQi(e){return"mat2d("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+", "+e[4]+", "+e[5]+")"}function iQi(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]+e[3]*e[3]+e[4]*e[4]+e[5]*e[5]+1)}function sQi(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e[4]=t[4]+n[4],e[5]=t[5]+n[5],e}function ljn(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e[4]=t[4]-n[4],e[5]=t[5]-n[5],e}function aQi(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*n,e[5]=t[5]*n,e}function cQi(e,t,n,o){return e[0]=t[0]+n[0]*o,e[1]=t[1]+n[1]*o,e[2]=t[2]+n[2]*o,e[3]=t[3]+n[3]*o,e[4]=t[4]+n[4]*o,e[5]=t[5]+n[5]*o,e}function lQi(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]}function hQi(e,t){var n=e[0],o=e[1],r=e[2],i=e[3],s=e[4],a=e[5],c=t[0],l=t[1],h=t[2],d=t[3],u=t[4],_=t[5];return Math.abs(n-c)<=oi*Math.max(1,Math.abs(n),Math.abs(c))&&Math.abs(o-l)<=oi*Math.max(1,Math.abs(o),Math.abs(l))&&Math.abs(r-h)<=oi*Math.max(1,Math.abs(r),Math.abs(h))&&Math.abs(i-d)<=oi*Math.max(1,Math.abs(i),Math.abs(d))&&Math.abs(s-u)<=oi*Math.max(1,Math.abs(s),Math.abs(u))&&Math.abs(a-_)<=oi*Math.max(1,Math.abs(a),Math.abs(_))}var hjn,djn,dQi=J9({"node_modules/gl-matrix/esm/mat2d.js"(){MP(),hjn=cjn,djn=ljn}}),ujn={};Z9(ujn,{add:()=>RQi,adjoint:()=>xQi,clone:()=>pQi,copy:()=>mQi,create:()=>pjn,determinant:()=>CQi,equals:()=>HQi,exactEquals:()=>LQi,frob:()=>NQi,fromMat2d:()=>MQi,fromMat4:()=>uQi,fromQuat:()=>wQi,fromRotation:()=>PQi,fromScaling:()=>EQi,fromTranslation:()=>SQi,fromValues:()=>_Qi,identity:()=>AQi,invert:()=>yQi,mul:()=>gjn,multiply:()=>mjn,multiplyScalar:()=>QQi,multiplyScalarAndAdd:()=>kQi,normalFromMat4:()=>BQi,projection:()=>TQi,rotate:()=>IQi,scale:()=>vQi,set:()=>gQi,str:()=>DQi,sub:()=>Ajn,subtract:()=>_jn,translate:()=>bQi,transpose:()=>fQi});function pjn(){var e=new Va(9);if(Va!=Float32Array)e[1]=0,e[2]=0,e[3]=0,e[5]=0,e[6]=0,e[7]=0;return e[0]=1,e[4]=1,e[8]=1,e}function uQi(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[4],e[4]=t[5],e[5]=t[6],e[6]=t[8],e[7]=t[9],e[8]=t[10],e}function pQi(e){var t=new Va(9);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t}function mQi(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}function _Qi(e,t,n,o,r,i,s,a,c){var l=new Va(9);return l[0]=e,l[1]=t,l[2]=n,l[3]=o,l[4]=r,l[5]=i,l[6]=s,l[7]=a,l[8]=c,l}function gQi(e,t,n,o,r,i,s,a,c,l){return e[0]=t,e[1]=n,e[2]=o,e[3]=r,e[4]=i,e[5]=s,e[6]=a,e[7]=c,e[8]=l,e}function AQi(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}function fQi(e,t){if(e===t){var n=t[1],o=t[2],r=t[5];e[1]=t[3],e[2]=t[6],e[3]=n,e[5]=t[7],e[6]=o,e[7]=r}else e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8];return e}function yQi(e,t){var n=t[0],o=t[1],r=t[2],i=t[3],s=t[4],a=t[5],c=t[6],l=t[7],h=t[8],d=h*s-a*l,u=-h*i+a*c,_=l*i-s*c,p=n*d+o*u+r*_;if(!p)return null;return p=1/p,e[0]=d*p,e[1]=(-h*o+r*l)*p,e[2]=(a*o-r*s)*p,e[3]=u*p,e[4]=(h*n-r*c)*p,e[5]=(-a*n+r*i)*p,e[6]=_*p,e[7]=(-l*n+o*c)*p,e[8]=(s*n-o*i)*p,e}function xQi(e,t){var n=t[0],o=t[1],r=t[2],i=t[3],s=t[4],a=t[5],c=t[6],l=t[7],h=t[8];return e[0]=s*h-a*l,e[1]=r*l-o*h,e[2]=o*a-r*s,e[3]=a*c-i*h,e[4]=n*h-r*c,e[5]=r*i-n*a,e[6]=i*l-s*c,e[7]=o*c-n*l,e[8]=n*s-o*i,e}function CQi(e){var t=e[0],n=e[1],o=e[2],r=e[3],i=e[4],s=e[5],a=e[6],c=e[7],l=e[8];return t*(l*i-s*c)+n*(-l*r+s*a)+o*(c*r-i*a)}function mjn(e,t,n){var o=t[0],r=t[1],i=t[2],s=t[3],a=t[4],c=t[5],l=t[6],h=t[7],d=t[8],u=n[0],_=n[1],p=n[2],m=n[3],A=n[4],g=n[5],f=n[6],y=n[7],x=n[8];return e[0]=u*o+_*s+p*l,e[1]=u*r+_*a+p*h,e[2]=u*i+_*c+p*d,e[3]=m*o+A*s+g*l,e[4]=m*r+A*a+g*h,e[5]=m*i+A*c+g*d,e[6]=f*o+y*s+x*l,e[7]=f*r+y*a+x*h,e[8]=f*i+y*c+x*d,e}function bQi(e,t,n){var o=t[0],r=t[1],i=t[2],s=t[3],a=t[4],c=t[5],l=t[6],h=t[7],d=t[8],u=n[0],_=n[1];return e[0]=o,e[1]=r,e[2]=i,e[3]=s,e[4]=a,e[5]=c,e[6]=u*o+_*s+l,e[7]=u*r+_*a+h,e[8]=u*i+_*c+d,e}function IQi(e,t,n){var o=t[0],r=t[1],i=t[2],s=t[3],a=t[4],c=t[5],l=t[6],h=t[7],d=t[8],u=Math.sin(n),_=Math.cos(n);return e[0]=_*o+u*s,e[1]=_*r+u*a,e[2]=_*i+u*c,e[3]=_*s-u*o,e[4]=_*a-u*r,e[5]=_*c-u*i,e[6]=l,e[7]=h,e[8]=d,e}function vQi(e,t,n){var o=n[0],r=n[1];return e[0]=o*t[0],e[1]=o*t[1],e[2]=o*t[2],e[3]=r*t[3],e[4]=r*t[4],e[5]=r*t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}function SQi(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=t[0],e[7]=t[1],e[8]=1,e}function PQi(e,t){var n=Math.sin(t),o=Math.cos(t);return e[0]=o,e[1]=n,e[2]=0,e[3]=-n,e[4]=o,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}function EQi(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=0,e[4]=t[1],e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}function MQi(e,t){return e[0]=t[0],e[1]=t[1],e[2]=0,e[3]=t[2],e[4]=t[3],e[5]=0,e[6]=t[4],e[7]=t[5],e[8]=1,e}function wQi(e,t){var n=t[0],o=t[1],r=t[2],i=t[3],s=n+n,a=o+o,c=r+r,l=n*s,h=o*s,d=o*a,u=r*s,_=r*a,p=r*c,m=i*s,A=i*a,g=i*c;return e[0]=1-d-p,e[3]=h-g,e[6]=u+A,e[1]=h+g,e[4]=1-l-p,e[7]=_-m,e[2]=u-A,e[5]=_+m,e[8]=1-l-d,e}function BQi(e,t){var n=t[0],o=t[1],r=t[2],i=t[3],s=t[4],a=t[5],c=t[6],l=t[7],h=t[8],d=t[9],u=t[10],_=t[11],p=t[12],m=t[13],A=t[14],g=t[15],f=n*a-o*s,y=n*c-r*s,x=n*l-i*s,C=o*c-r*a,b=o*l-i*a,I=r*l-i*c,v=h*m-d*p,P=h*A-u*p,M=h*g-_*p,B=d*A-u*m,T=d*g-_*m,N=u*g-_*A,D=f*N-y*T+x*B+C*M-b*P+I*v;if(!D)return null;return D=1/D,e[0]=(a*N-c*T+l*B)*D,e[1]=(c*M-s*N-l*P)*D,e[2]=(s*T-a*M+l*v)*D,e[3]=(r*T-o*N-i*B)*D,e[4]=(n*N-r*M+i*P)*D,e[5]=(o*M-n*T-i*v)*D,e[6]=(m*I-A*b+g*C)*D,e[7]=(A*x-p*I-g*y)*D,e[8]=(p*b-m*x+g*f)*D,e}function TQi(e,t,n){return e[0]=2/t,e[1]=0,e[2]=0,e[3]=0,e[4]=-2/n,e[5]=0,e[6]=-1,e[7]=1,e[8]=1,e}function DQi(e){return"mat3("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+", "+e[4]+", "+e[5]+", "+e[6]+", "+e[7]+", "+e[8]+")"}function NQi(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]+e[3]*e[3]+e[4]*e[4]+e[5]*e[5]+e[6]*e[6]+e[7]*e[7]+e[8]*e[8])}function RQi(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e[4]=t[4]+n[4],e[5]=t[5]+n[5],e[6]=t[6]+n[6],e[7]=t[7]+n[7],e[8]=t[8]+n[8],e}function _jn(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e[4]=t[4]-n[4],e[5]=t[5]-n[5],e[6]=t[6]-n[6],e[7]=t[7]-n[7],e[8]=t[8]-n[8],e}function QQi(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*n,e[5]=t[5]*n,e[6]=t[6]*n,e[7]=t[7]*n,e[8]=t[8]*n,e}function kQi(e,t,n,o){return e[0]=t[0]+n[0]*o,e[1]=t[1]+n[1]*o,e[2]=t[2]+n[2]*o,e[3]=t[3]+n[3]*o,e[4]=t[4]+n[4]*o,e[5]=t[5]+n[5]*o,e[6]=t[6]+n[6]*o,e[7]=t[7]+n[7]*o,e[8]=t[8]+n[8]*o,e}function LQi(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]}function HQi(e,t){var n=e[0],o=e[1],r=e[2],i=e[3],s=e[4],a=e[5],c=e[6],l=e[7],h=e[8],d=t[0],u=t[1],_=t[2],p=t[3],m=t[4],A=t[5],g=t[6],f=t[7],y=t[8];return Math.abs(n-d)<=oi*Math.max(1,Math.abs(n),Math.abs(d))&&Math.abs(o-u)<=oi*Math.max(1,Math.abs(o),Math.abs(u))&&Math.abs(r-_)<=oi*Math.max(1,Math.abs(r),Math.abs(_))&&Math.abs(i-p)<=oi*Math.max(1,Math.abs(i),Math.abs(p))&&Math.abs(s-m)<=oi*Math.max(1,Math.abs(s),Math.abs(m))&&Math.abs(a-A)<=oi*Math.max(1,Math.abs(a),Math.abs(A))&&Math.abs(c-g)<=oi*Math.max(1,Math.abs(c),Math.abs(g))&&Math.abs(l-f)<=oi*Math.max(1,Math.abs(l),Math.abs(f))&&Math.abs(h-y)<=oi*Math.max(1,Math.abs(h),Math.abs(y))}var gjn,Ajn,fjn=J9({"node_modules/gl-matrix/esm/mat3.js"(){MP(),gjn=mjn,Ajn=_jn}}),yjn={};Z9(yjn,{add:()=>yki,adjoint:()=>WQi,clone:()=>zQi,copy:()=>OQi,create:()=>FQi,decompose:()=>aki,determinant:()=>XQi,equals:()=>Iki,exactEquals:()=>bki,frob:()=>fki,fromQuat:()=>hki,fromQuat2:()=>ski,fromRotation:()=>nki,fromRotationTranslation:()=>bjn,fromRotationTranslationScale:()=>cki,fromRotationTranslationScaleOrigin:()=>lki,fromScaling:()=>tki,fromTranslation:()=>eki,fromValues:()=>VQi,fromXRotation:()=>oki,fromYRotation:()=>rki,fromZRotation:()=>iki,frustum:()=>dki,getRotation:()=>Sjn,getScaling:()=>vjn,getTranslation:()=>Ijn,identity:()=>xjn,invert:()=>UQi,lookAt:()=>_ki,mul:()=>Tjn,multiply:()=>Cjn,multiplyScalar:()=>xki,multiplyScalarAndAdd:()=>Cki,ortho:()=>Bjn,orthoNO:()=>Ejn,orthoZO:()=>mki,perspective:()=>wjn,perspectiveFromFieldOfView:()=>pki,perspectiveNO:()=>Pjn,perspectiveZO:()=>uki,rotate:()=>$Qi,rotateX:()=>qQi,rotateY:()=>JQi,rotateZ:()=>ZQi,scale:()=>KQi,set:()=>YQi,str:()=>Aki,sub:()=>Djn,subtract:()=>Mjn,targetTo:()=>gki,translate:()=>jQi,transpose:()=>GQi});function FQi(){var e=new Va(16);if(Va!=Float32Array)e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0;return e[0]=1,e[5]=1,e[10]=1,e[15]=1,e}function zQi(e){var t=new Va(16);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function OQi(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function VQi(e,t,n,o,r,i,s,a,c,l,h,d,u,_,p,m){var A=new Va(16);return A[0]=e,A[1]=t,A[2]=n,A[3]=o,A[4]=r,A[5]=i,A[6]=s,A[7]=a,A[8]=c,A[9]=l,A[10]=h,A[11]=d,A[12]=u,A[13]=_,A[14]=p,A[15]=m,A}function YQi(e,t,n,o,r,i,s,a,c,l,h,d,u,_,p,m,A){return e[0]=t,e[1]=n,e[2]=o,e[3]=r,e[4]=i,e[5]=s,e[6]=a,e[7]=c,e[8]=l,e[9]=h,e[10]=d,e[11]=u,e[12]=_,e[13]=p,e[14]=m,e[15]=A,e}function xjn(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function GQi(e,t){if(e===t){var n=t[1],o=t[2],r=t[3],i=t[6],s=t[7],a=t[11];e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=n,e[6]=t[9],e[7]=t[13],e[8]=o,e[9]=i,e[11]=t[14],e[12]=r,e[13]=s,e[14]=a}else e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=t[1],e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=t[2],e[9]=t[6],e[10]=t[10],e[11]=t[14],e[12]=t[3],e[13]=t[7],e[14]=t[11],e[15]=t[15];return e}function UQi(e,t){var n=t[0],o=t[1],r=t[2],i=t[3],s=t[4],a=t[5],c=t[6],l=t[7],h=t[8],d=t[9],u=t[10],_=t[11],p=t[12],m=t[13],A=t[14],g=t[15],f=n*a-o*s,y=n*c-r*s,x=n*l-i*s,C=o*c-r*a,b=o*l-i*a,I=r*l-i*c,v=h*m-d*p,P=h*A-u*p,M=h*g-_*p,B=d*A-u*m,T=d*g-_*m,N=u*g-_*A,D=f*N-y*T+x*B+C*M-b*P+I*v;if(!D)return null;return D=1/D,e[0]=(a*N-c*T+l*B)*D,e[1]=(r*T-o*N-i*B)*D,e[2]=(m*I-A*b+g*C)*D,e[3]=(u*b-d*I-_*C)*D,e[4]=(c*M-s*N-l*P)*D,e[5]=(n*N-r*M+i*P)*D,e[6]=(A*x-p*I-g*y)*D,e[7]=(h*I-u*x+_*y)*D,e[8]=(s*T-a*M+l*v)*D,e[9]=(o*M-n*T-i*v)*D,e[10]=(p*b-m*x+g*f)*D,e[11]=(d*x-h*b-_*f)*D,e[12]=(a*P-s*B-c*v)*D,e[13]=(n*B-o*P+r*v)*D,e[14]=(m*y-p*C-A*f)*D,e[15]=(h*C-d*y+u*f)*D,e}function WQi(e,t){var n=t[0],o=t[1],r=t[2],i=t[3],s=t[4],a=t[5],c=t[6],l=t[7],h=t[8],d=t[9],u=t[10],_=t[11],p=t[12],m=t[13],A=t[14],g=t[15],f=n*a-o*s,y=n*c-r*s,x=n*l-i*s,C=o*c-r*a,b=o*l-i*a,I=r*l-i*c,v=h*m-d*p,P=h*A-u*p,M=h*g-_*p,B=d*A-u*m,T=d*g-_*m,N=u*g-_*A;return e[0]=a*N-c*T+l*B,e[1]=r*T-o*N-i*B,e[2]=m*I-A*b+g*C,e[3]=u*b-d*I-_*C,e[4]=c*M-s*N-l*P,e[5]=n*N-r*M+i*P,e[6]=A*x-p*I-g*y,e[7]=h*I-u*x+_*y,e[8]=s*T-a*M+l*v,e[9]=o*M-n*T-i*v,e[10]=p*b-m*x+g*f,e[11]=d*x-h*b-_*f,e[12]=a*P-s*B-c*v,e[13]=n*B-o*P+r*v,e[14]=m*y-p*C-A*f,e[15]=h*C-d*y+u*f,e}function XQi(e){var t=e[0],n=e[1],o=e[2],r=e[3],i=e[4],s=e[5],a=e[6],c=e[7],l=e[8],h=e[9],d=e[10],u=e[11],_=e[12],p=e[13],m=e[14],A=e[15],g=t*s-n*i,f=t*a-o*i,y=n*a-o*s,x=l*p-h*_,C=l*m-d*_,b=h*m-d*p,I=t*b-n*C+o*x,v=i*b-s*C+a*x,P=l*y-h*f+d*g,M=_*y-p*f+m*g;return c*I-r*v+A*P-u*M}function Cjn(e,t,n){var o=t[0],r=t[1],i=t[2],s=t[3],a=t[4],c=t[5],l=t[6],h=t[7],d=t[8],u=t[9],_=t[10],p=t[11],m=t[12],A=t[13],g=t[14],f=t[15],y=n[0],x=n[1],C=n[2],b=n[3];return e[0]=y*o+x*a+C*d+b*m,e[1]=y*r+x*c+C*u+b*A,e[2]=y*i+x*l+C*_+b*g,e[3]=y*s+x*h+C*p+b*f,y=n[4],x=n[5],C=n[6],b=n[7],e[4]=y*o+x*a+C*d+b*m,e[5]=y*r+x*c+C*u+b*A,e[6]=y*i+x*l+C*_+b*g,e[7]=y*s+x*h+C*p+b*f,y=n[8],x=n[9],C=n[10],b=n[11],e[8]=y*o+x*a+C*d+b*m,e[9]=y*r+x*c+C*u+b*A,e[10]=y*i+x*l+C*_+b*g,e[11]=y*s+x*h+C*p+b*f,y=n[12],x=n[13],C=n[14],b=n[15],e[12]=y*o+x*a+C*d+b*m,e[13]=y*r+x*c+C*u+b*A,e[14]=y*i+x*l+C*_+b*g,e[15]=y*s+x*h+C*p+b*f,e}function jQi(e,t,n){var o=n[0],r=n[1],i=n[2],s,a,c,l,h,d,u,_,p,m,A,g;if(t===e)e[12]=t[0]*o+t[4]*r+t[8]*i+t[12],e[13]=t[1]*o+t[5]*r+t[9]*i+t[13],e[14]=t[2]*o+t[6]*r+t[10]*i+t[14],e[15]=t[3]*o+t[7]*r+t[11]*i+t[15];else s=t[0],a=t[1],c=t[2],l=t[3],h=t[4],d=t[5],u=t[6],_=t[7],p=t[8],m=t[9],A=t[10],g=t[11],e[0]=s,e[1]=a,e[2]=c,e[3]=l,e[4]=h,e[5]=d,e[6]=u,e[7]=_,e[8]=p,e[9]=m,e[10]=A,e[11]=g,e[12]=s*o+h*r+p*i+t[12],e[13]=a*o+d*r+m*i+t[13],e[14]=c*o+u*r+A*i+t[14],e[15]=l*o+_*r+g*i+t[15];return e}function KQi(e,t,n){var o=n[0],r=n[1],i=n[2];return e[0]=t[0]*o,e[1]=t[1]*o,e[2]=t[2]*o,e[3]=t[3]*o,e[4]=t[4]*r,e[5]=t[5]*r,e[6]=t[6]*r,e[7]=t[7]*r,e[8]=t[8]*i,e[9]=t[9]*i,e[10]=t[10]*i,e[11]=t[11]*i,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function $Qi(e,t,n,o){var r=o[0],i=o[1],s=o[2],a=Math.sqrt(r*r+i*i+s*s),c,l,h,d,u,_,p,m,A,g,f,y,x,C,b,I,v,P,M,B,T,N,D,L;if(a<oi)return null;if(a=1/a,r*=a,i*=a,s*=a,c=Math.sin(n),l=Math.cos(n),h=1-l,d=t[0],u=t[1],_=t[2],p=t[3],m=t[4],A=t[5],g=t[6],f=t[7],y=t[8],x=t[9],C=t[10],b=t[11],I=r*r*h+l,v=i*r*h+s*c,P=s*r*h-i*c,M=r*i*h-s*c,B=i*i*h+l,T=s*i*h+r*c,N=r*s*h+i*c,D=i*s*h-r*c,L=s*s*h+l,e[0]=d*I+m*v+y*P,e[1]=u*I+A*v+x*P,e[2]=_*I+g*v+C*P,e[3]=p*I+f*v+b*P,e[4]=d*M+m*B+y*T,e[5]=u*M+A*B+x*T,e[6]=_*M+g*B+C*T,e[7]=p*M+f*B+b*T,e[8]=d*N+m*D+y*L,e[9]=u*N+A*D+x*L,e[10]=_*N+g*D+C*L,e[11]=p*N+f*D+b*L,t!==e)e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15];return e}function qQi(e,t,n){var o=Math.sin(n),r=Math.cos(n),i=t[4],s=t[5],a=t[6],c=t[7],l=t[8],h=t[9],d=t[10],u=t[11];if(t!==e)e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15];return e[4]=i*r+l*o,e[5]=s*r+h*o,e[6]=a*r+d*o,e[7]=c*r+u*o,e[8]=l*r-i*o,e[9]=h*r-s*o,e[10]=d*r-a*o,e[11]=u*r-c*o,e}function JQi(e,t,n){var o=Math.sin(n),r=Math.cos(n),i=t[0],s=t[1],a=t[2],c=t[3],l=t[8],h=t[9],d=t[10],u=t[11];if(t!==e)e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15];return e[0]=i*r-l*o,e[1]=s*r-h*o,e[2]=a*r-d*o,e[3]=c*r-u*o,e[8]=i*o+l*r,e[9]=s*o+h*r,e[10]=a*o+d*r,e[11]=c*o+u*r,e}function ZQi(e,t,n){var o=Math.sin(n),r=Math.cos(n),i=t[0],s=t[1],a=t[2],c=t[3],l=t[4],h=t[5],d=t[6],u=t[7];if(t!==e)e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15];return e[0]=i*r+l*o,e[1]=s*r+h*o,e[2]=a*r+d*o,e[3]=c*r+u*o,e[4]=l*r-i*o,e[5]=h*r-s*o,e[6]=d*r-a*o,e[7]=u*r-c*o,e}function eki(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=t[0],e[13]=t[1],e[14]=t[2],e[15]=1,e}function tki(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=t[1],e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=t[2],e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function nki(e,t,n){var o=n[0],r=n[1],i=n[2],s=Math.sqrt(o*o+r*r+i*i),a,c,l;if(s<oi)return null;return s=1/s,o*=s,r*=s,i*=s,a=Math.sin(t),c=Math.cos(t),l=1-c,e[0]=o*o*l+c,e[1]=r*o*l+i*a,e[2]=i*o*l-r*a,e[3]=0,e[4]=o*r*l-i*a,e[5]=r*r*l+c,e[6]=i*r*l+o*a,e[7]=0,e[8]=o*i*l+r*a,e[9]=r*i*l-o*a,e[10]=i*i*l+c,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function oki(e,t){var n=Math.sin(t),o=Math.cos(t);return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=o,e[6]=n,e[7]=0,e[8]=0,e[9]=-n,e[10]=o,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function rki(e,t){var n=Math.sin(t),o=Math.cos(t);return e[0]=o,e[1]=0,e[2]=-n,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=n,e[9]=0,e[10]=o,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function iki(e,t){var n=Math.sin(t),o=Math.cos(t);return e[0]=o,e[1]=n,e[2]=0,e[3]=0,e[4]=-n,e[5]=o,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function bjn(e,t,n){var o=t[0],r=t[1],i=t[2],s=t[3],a=o+o,c=r+r,l=i+i,h=o*a,d=o*c,u=o*l,_=r*c,p=r*l,m=i*l,A=s*a,g=s*c,f=s*l;return e[0]=1-(_+m),e[1]=d+f,e[2]=u-g,e[3]=0,e[4]=d-f,e[5]=1-(h+m),e[6]=p+A,e[7]=0,e[8]=u+g,e[9]=p-A,e[10]=1-(h+_),e[11]=0,e[12]=n[0],e[13]=n[1],e[14]=n[2],e[15]=1,e}function ski(e,t){var n=new Va(3),o=-t[0],r=-t[1],i=-t[2],s=t[3],a=t[4],c=t[5],l=t[6],h=t[7],d=o*o+r*r+i*i+s*s;if(d>0)n[0]=(a*s+h*o+c*i-l*r)*2/d,n[1]=(c*s+h*r+l*o-a*i)*2/d,n[2]=(l*s+h*i+a*r-c*o)*2/d;else n[0]=(a*s+h*o+c*i-l*r)*2,n[1]=(c*s+h*r+l*o-a*i)*2,n[2]=(l*s+h*i+a*r-c*o)*2;return bjn(e,t,n),e}function Ijn(e,t){return e[0]=t[12],e[1]=t[13],e[2]=t[14],e}function vjn(e,t){var n=t[0],o=t[1],r=t[2],i=t[4],s=t[5],a=t[6],c=t[8],l=t[9],h=t[10];return e[0]=Math.sqrt(n*n+o*o+r*r),e[1]=Math.sqrt(i*i+s*s+a*a),e[2]=Math.sqrt(c*c+l*l+h*h),e}function Sjn(e,t){var n=new Va(3);vjn(n,t);var o=1/n[0],r=1/n[1],i=1/n[2],s=t[0]*o,a=t[1]*r,c=t[2]*i,l=t[4]*o,h=t[5]*r,d=t[6]*i,u=t[8]*o,_=t[9]*r,p=t[10]*i,m=s+h+p,A=0;if(m>0)A=Math.sqrt(m+1)*2,e[3]=0.25*A,e[0]=(d-_)/A,e[1]=(u-c)/A,e[2]=(a-l)/A;else if(s>h&&s>p)A=Math.sqrt(1+s-h-p)*2,e[3]=(d-_)/A,e[0]=0.25*A,e[1]=(a+l)/A,e[2]=(u+c)/A;else if(h>p)A=Math.sqrt(1+h-s-p)*2,e[3]=(u-c)/A,e[0]=(a+l)/A,e[1]=0.25*A,e[2]=(d+_)/A;else A=Math.sqrt(1+p-s-h)*2,e[3]=(a-l)/A,e[0]=(u+c)/A,e[1]=(d+_)/A,e[2]=0.25*A;return e}function aki(e,t,n,o){t[0]=o[12],t[1]=o[13],t[2]=o[14];var r=o[0],i=o[1],s=o[2],a=o[4],c=o[5],l=o[6],h=o[8],d=o[9],u=o[10];n[0]=Math.sqrt(r*r+i*i+s*s),n[1]=Math.sqrt(a*a+c*c+l*l),n[2]=Math.sqrt(h*h+d*d+u*u);var _=1/n[0],p=1/n[1],m=1/n[2],A=r*_,g=i*p,f=s*m,y=a*_,x=c*p,C=l*m,b=h*_,I=d*p,v=u*m,P=A+x+v,M=0;if(P>0)M=Math.sqrt(P+1)*2,e[3]=0.25*M,e[0]=(C-I)/M,e[1]=(b-f)/M,e[2]=(g-y)/M;else if(A>x&&A>v)M=Math.sqrt(1+A-x-v)*2,e[3]=(C-I)/M,e[0]=0.25*M,e[1]=(g+y)/M,e[2]=(b+f)/M;else if(x>v)M=Math.sqrt(1+x-A-v)*2,e[3]=(b-f)/M,e[0]=(g+y)/M,e[1]=0.25*M,e[2]=(C+I)/M;else M=Math.sqrt(1+v-A-x)*2,e[3]=(g-y)/M,e[0]=(b+f)/M,e[1]=(C+I)/M,e[2]=0.25*M;return e}function cki(e,t,n,o){var r=t[0],i=t[1],s=t[2],a=t[3],c=r+r,l=i+i,h=s+s,d=r*c,u=r*l,_=r*h,p=i*l,m=i*h,A=s*h,g=a*c,f=a*l,y=a*h,x=o[0],C=o[1],b=o[2];return e[0]=(1-(p+A))*x,e[1]=(u+y)*x,e[2]=(_-f)*x,e[3]=0,e[4]=(u-y)*C,e[5]=(1-(d+A))*C,e[6]=(m+g)*C,e[7]=0,e[8]=(_+f)*b,e[9]=(m-g)*b,e[10]=(1-(d+p))*b,e[11]=0,e[12]=n[0],e[13]=n[1],e[14]=n[2],e[15]=1,e}function lki(e,t,n,o,r){var i=t[0],s=t[1],a=t[2],c=t[3],l=i+i,h=s+s,d=a+a,u=i*l,_=i*h,p=i*d,m=s*h,A=s*d,g=a*d,f=c*l,y=c*h,x=c*d,C=o[0],b=o[1],I=o[2],v=r[0],P=r[1],M=r[2],B=(1-(m+g))*C,T=(_+x)*C,N=(p-y)*C,D=(_-x)*b,L=(1-(u+g))*b,H=(A+f)*b,V=(p+y)*I,O=(A-f)*I,U=(1-(u+m))*I;return e[0]=B,e[1]=T,e[2]=N,e[3]=0,e[4]=D,e[5]=L,e[6]=H,e[7]=0,e[8]=V,e[9]=O,e[10]=U,e[11]=0,e[12]=n[0]+v-(B*v+D*P+V*M),e[13]=n[1]+P-(T*v+L*P+O*M),e[14]=n[2]+M-(N*v+H*P+U*M),e[15]=1,e}function hki(e,t){var n=t[0],o=t[1],r=t[2],i=t[3],s=n+n,a=o+o,c=r+r,l=n*s,h=o*s,d=o*a,u=r*s,_=r*a,p=r*c,m=i*s,A=i*a,g=i*c;return e[0]=1-d-p,e[1]=h+g,e[2]=u-A,e[3]=0,e[4]=h-g,e[5]=1-l-p,e[6]=_+m,e[7]=0,e[8]=u+A,e[9]=_-m,e[10]=1-l-d,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function dki(e,t,n,o,r,i,s){var a=1/(n-t),c=1/(r-o),l=1/(i-s);return e[0]=i*2*a,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=i*2*c,e[6]=0,e[7]=0,e[8]=(n+t)*a,e[9]=(r+o)*c,e[10]=(s+i)*l,e[11]=-1,e[12]=0,e[13]=0,e[14]=s*i*2*l,e[15]=0,e}function Pjn(e,t,n,o,r){var i=1/Math.tan(t/2);if(e[0]=i/n,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=i,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,r!=null&&r!==1/0){var s=1/(o-r);e[10]=(r+o)*s,e[14]=2*r*o*s}else e[10]=-1,e[14]=-2*o;return e}function uki(e,t,n,o,r){var i=1/Math.tan(t/2);if(e[0]=i/n,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=i,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,r!=null&&r!==1/0){var s=1/(o-r);e[10]=r*s,e[14]=r*o*s}else e[10]=-1,e[14]=-o;return e}function pki(e,t,n,o){var r=Math.tan(t.upDegrees*Math.PI/180),i=Math.tan(t.downDegrees*Math.PI/180),s=Math.tan(t.leftDegrees*Math.PI/180),a=Math.tan(t.rightDegrees*Math.PI/180),c=2/(s+a),l=2/(r+i);return e[0]=c,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=l,e[6]=0,e[7]=0,e[8]=-((s-a)*c*0.5),e[9]=(r-i)*l*0.5,e[10]=o/(n-o),e[11]=-1,e[12]=0,e[13]=0,e[14]=o*n/(n-o),e[15]=0,e}function Ejn(e,t,n,o,r,i,s){var a=1/(t-n),c=1/(o-r),l=1/(i-s);return e[0]=-2*a,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*c,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*l,e[11]=0,e[12]=(t+n)*a,e[13]=(r+o)*c,e[14]=(s+i)*l,e[15]=1,e}function mki(e,t,n,o,r,i,s){var a=1/(t-n),c=1/(o-r),l=1/(i-s);return e[0]=-2*a,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*c,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=l,e[11]=0,e[12]=(t+n)*a,e[13]=(r+o)*c,e[14]=i*l,e[15]=1,e}function _ki(e,t,n,o){var r,i,s,a,c,l,h,d,u,_,p=t[0],m=t[1],A=t[2],g=o[0],f=o[1],y=o[2],x=n[0],C=n[1],b=n[2];if(Math.abs(p-x)<oi&&Math.abs(m-C)<oi&&Math.abs(A-b)<oi)return xjn(e);if(h=p-x,d=m-C,u=A-b,_=1/Math.sqrt(h*h+d*d+u*u),h*=_,d*=_,u*=_,r=f*u-y*d,i=y*h-g*u,s=g*d-f*h,_=Math.sqrt(r*r+i*i+s*s),!_)r=0,i=0,s=0;else _=1/_,r*=_,i*=_,s*=_;if(a=d*s-u*i,c=u*r-h*s,l=h*i-d*r,_=Math.sqrt(a*a+c*c+l*l),!_)a=0,c=0,l=0;else _=1/_,a*=_,c*=_,l*=_;return e[0]=r,e[1]=a,e[2]=h,e[3]=0,e[4]=i,e[5]=c,e[6]=d,e[7]=0,e[8]=s,e[9]=l,e[10]=u,e[11]=0,e[12]=-(r*p+i*m+s*A),e[13]=-(a*p+c*m+l*A),e[14]=-(h*p+d*m+u*A),e[15]=1,e}function gki(e,t,n,o){var r=t[0],i=t[1],s=t[2],a=o[0],c=o[1],l=o[2],h=r-n[0],d=i-n[1],u=s-n[2],_=h*h+d*d+u*u;if(_>0)_=1/Math.sqrt(_),h*=_,d*=_,u*=_;var p=c*u-l*d,m=l*h-a*u,A=a*d-c*h;if(_=p*p+m*m+A*A,_>0)_=1/Math.sqrt(_),p*=_,m*=_,A*=_;return e[0]=p,e[1]=m,e[2]=A,e[3]=0,e[4]=d*A-u*m,e[5]=u*p-h*A,e[6]=h*m-d*p,e[7]=0,e[8]=h,e[9]=d,e[10]=u,e[11]=0,e[12]=r,e[13]=i,e[14]=s,e[15]=1,e}function Aki(e){return"mat4("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+", "+e[4]+", "+e[5]+", "+e[6]+", "+e[7]+", "+e[8]+", "+e[9]+", "+e[10]+", "+e[11]+", "+e[12]+", "+e[13]+", "+e[14]+", "+e[15]+")"}function fki(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]+e[3]*e[3]+e[4]*e[4]+e[5]*e[5]+e[6]*e[6]+e[7]*e[7]+e[8]*e[8]+e[9]*e[9]+e[10]*e[10]+e[11]*e[11]+e[12]*e[12]+e[13]*e[13]+e[14]*e[14]+e[15]*e[15])}function yki(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e[4]=t[4]+n[4],e[5]=t[5]+n[5],e[6]=t[6]+n[6],e[7]=t[7]+n[7],e[8]=t[8]+n[8],e[9]=t[9]+n[9],e[10]=t[10]+n[10],e[11]=t[11]+n[11],e[12]=t[12]+n[12],e[13]=t[13]+n[13],e[14]=t[14]+n[14],e[15]=t[15]+n[15],e}function Mjn(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e[4]=t[4]-n[4],e[5]=t[5]-n[5],e[6]=t[6]-n[6],e[7]=t[7]-n[7],e[8]=t[8]-n[8],e[9]=t[9]-n[9],e[10]=t[10]-n[10],e[11]=t[11]-n[11],e[12]=t[12]-n[12],e[13]=t[13]-n[13],e[14]=t[14]-n[14],e[15]=t[15]-n[15],e}function xki(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*n,e[5]=t[5]*n,e[6]=t[6]*n,e[7]=t[7]*n,e[8]=t[8]*n,e[9]=t[9]*n,e[10]=t[10]*n,e[11]=t[11]*n,e[12]=t[12]*n,e[13]=t[13]*n,e[14]=t[14]*n,e[15]=t[15]*n,e}function Cki(e,t,n,o){return e[0]=t[0]+n[0]*o,e[1]=t[1]+n[1]*o,e[2]=t[2]+n[2]*o,e[3]=t[3]+n[3]*o,e[4]=t[4]+n[4]*o,e[5]=t[5]+n[5]*o,e[6]=t[6]+n[6]*o,e[7]=t[7]+n[7]*o,e[8]=t[8]+n[8]*o,e[9]=t[9]+n[9]*o,e[10]=t[10]+n[10]*o,e[11]=t[11]+n[11]*o,e[12]=t[12]+n[12]*o,e[13]=t[13]+n[13]*o,e[14]=t[14]+n[14]*o,e[15]=t[15]+n[15]*o,e}function bki(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[11]===t[11]&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[15]===t[15]}function Iki(e,t){var n=e[0],o=e[1],r=e[2],i=e[3],s=e[4],a=e[5],c=e[6],l=e[7],h=e[8],d=e[9],u=e[10],_=e[11],p=e[12],m=e[13],A=e[14],g=e[15],f=t[0],y=t[1],x=t[2],C=t[3],b=t[4],I=t[5],v=t[6],P=t[7],M=t[8],B=t[9],T=t[10],N=t[11],D=t[12],L=t[13],H=t[14],V=t[15];return Math.abs(n-f)<=oi*Math.max(1,Math.abs(n),Math.abs(f))&&Math.abs(o-y)<=oi*Math.max(1,Math.abs(o),Math.abs(y))&&Math.abs(r-x)<=oi*Math.max(1,Math.abs(r),Math.abs(x))&&Math.abs(i-C)<=oi*Math.max(1,Math.abs(i),Math.abs(C))&&Math.abs(s-b)<=oi*Math.max(1,Math.abs(s),Math.abs(b))&&Math.abs(a-I)<=oi*Math.max(1,Math.abs(a),Math.abs(I))&&Math.abs(c-v)<=oi*Math.max(1,Math.abs(c),Math.abs(v))&&Math.abs(l-P)<=oi*Math.max(1,Math.abs(l),Math.abs(P))&&Math.abs(h-M)<=oi*Math.max(1,Math.abs(h),Math.abs(M))&&Math.abs(d-B)<=oi*Math.max(1,Math.abs(d),Math.abs(B))&&Math.abs(u-T)<=oi*Math.max(1,Math.abs(u),Math.abs(T))&&Math.abs(_-N)<=oi*Math.max(1,Math.abs(_),Math.abs(N))&&Math.abs(p-D)<=oi*Math.max(1,Math.abs(p),Math.abs(D))&&Math.abs(m-L)<=oi*Math.max(1,Math.abs(m),Math.abs(L))&&Math.abs(A-H)<=oi*Math.max(1,Math.abs(A),Math.abs(H))&&Math.abs(g-V)<=oi*Math.max(1,Math.abs(g),Math.abs(V))}var wjn,Bjn,Tjn,Djn,Njn=J9({"node_modules/gl-matrix/esm/mat4.js"(){MP(),wjn=Pjn,Bjn=Ejn,Tjn=Cjn,Djn=Mjn}}),Rjn={};Z9(Rjn,{add:()=>Eki,angle:()=>jki,bezier:()=>zki,ceil:()=>Mki,clone:()=>vki,copy:()=>Ski,create:()=>a0t,cross:()=>nEe,dist:()=>Wjn,distance:()=>Fjn,div:()=>Ujn,divide:()=>Hjn,dot:()=>$Ee,equals:()=>Jki,exactEquals:()=>qki,floor:()=>wki,forEach:()=>Kjn,fromValues:()=>jdt,hermite:()=>Fki,inverse:()=>kki,len:()=>c0t,length:()=>Qjn,lerp:()=>Lki,max:()=>Tki,min:()=>Bki,mul:()=>Gjn,multiply:()=>Ljn,negate:()=>Qki,normalize:()=>Vjn,random:()=>Oki,rotateX:()=>Uki,rotateY:()=>Wki,rotateZ:()=>Xki,round:()=>Dki,scale:()=>Nki,scaleAndAdd:()=>Rki,set:()=>Pki,slerp:()=>Hki,sqrDist:()=>Xjn,sqrLen:()=>jjn,squaredDistance:()=>zjn,squaredLength:()=>Ojn,str:()=>$ki,sub:()=>Yjn,subtract:()=>kjn,transformMat3:()=>Yki,transformMat4:()=>Vki,transformQuat:()=>Gki,zero:()=>Kki});function a0t(){var e=new Va(3);if(Va!=Float32Array)e[0]=0,e[1]=0,e[2]=0;return e}function vki(e){var t=new Va(3);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function Qjn(e){var t=e[0],n=e[1],o=e[2];return Math.sqrt(t*t+n*n+o*o)}function jdt(e,t,n){var o=new Va(3);return o[0]=e,o[1]=t,o[2]=n,o}function Ski(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function Pki(e,t,n,o){return e[0]=t,e[1]=n,e[2]=o,e}function Eki(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e}function kjn(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e}function Ljn(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e[2]=t[2]*n[2],e}function Hjn(e,t,n){return e[0]=t[0]/n[0],e[1]=t[1]/n[1],e[2]=t[2]/n[2],e}function Mki(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e[2]=Math.ceil(t[2]),e}function wki(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e[2]=Math.floor(t[2]),e}function Bki(e,t,n){return e[0]=Math.min(t[0],n[0]),e[1]=Math.min(t[1],n[1]),e[2]=Math.min(t[2],n[2]),e}function Tki(e,t,n){return e[0]=Math.max(t[0],n[0]),e[1]=Math.max(t[1],n[1]),e[2]=Math.max(t[2],n[2]),e}function Dki(e,t){return e[0]=xP(t[0]),e[1]=xP(t[1]),e[2]=xP(t[2]),e}function Nki(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e}function Rki(e,t,n,o){return e[0]=t[0]+n[0]*o,e[1]=t[1]+n[1]*o,e[2]=t[2]+n[2]*o,e}function Fjn(e,t){var n=t[0]-e[0],o=t[1]-e[1],r=t[2]-e[2];return Math.sqrt(n*n+o*o+r*r)}function zjn(e,t){var n=t[0]-e[0],o=t[1]-e[1],r=t[2]-e[2];return n*n+o*o+r*r}function Ojn(e){var t=e[0],n=e[1],o=e[2];return t*t+n*n+o*o}function Qki(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e}function kki(e,t){return e[0]=1/t[0],e[1]=1/t[1],e[2]=1/t[2],e}function Vjn(e,t){var n=t[0],o=t[1],r=t[2],i=n*n+o*o+r*r;if(i>0)i=1/Math.sqrt(i);return e[0]=t[0]*i,e[1]=t[1]*i,e[2]=t[2]*i,e}function $Ee(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function nEe(e,t,n){var o=t[0],r=t[1],i=t[2],s=n[0],a=n[1],c=n[2];return e[0]=r*c-i*a,e[1]=i*s-o*c,e[2]=o*a-r*s,e}function Lki(e,t,n,o){var r=t[0],i=t[1],s=t[2];return e[0]=r+o*(n[0]-r),e[1]=i+o*(n[1]-i),e[2]=s+o*(n[2]-s),e}function Hki(e,t,n,o){var r=Math.acos(Math.min(Math.max($Ee(t,n),-1),1)),i=Math.sin(r),s=Math.sin((1-o)*r)/i,a=Math.sin(o*r)/i;return e[0]=s*t[0]+a*n[0],e[1]=s*t[1]+a*n[1],e[2]=s*t[2]+a*n[2],e}function Fki(e,t,n,o,r,i){var s=i*i,a=s*(2*i-3)+1,c=s*(i-2)+i,l=s*(i-1),h=s*(3-2*i);return e[0]=t[0]*a+n[0]*c+o[0]*l+r[0]*h,e[1]=t[1]*a+n[1]*c+o[1]*l+r[1]*h,e[2]=t[2]*a+n[2]*c+o[2]*l+r[2]*h,e}function zki(e,t,n,o,r,i){var s=1-i,a=s*s,c=i*i,l=a*s,h=3*i*a,d=3*c*s,u=c*i;return e[0]=t[0]*l+n[0]*h+o[0]*d+r[0]*u,e[1]=t[1]*l+n[1]*h+o[1]*d+r[1]*u,e[2]=t[2]*l+n[2]*h+o[2]*d+r[2]*u,e}function Oki(e,t){t=t===void 0?1:t;var n=Xb()*2*Math.PI,o=Xb()*2-1,r=Math.sqrt(1-o*o)*t;return e[0]=Math.cos(n)*r,e[1]=Math.sin(n)*r,e[2]=o*t,e}function Vki(e,t,n){var o=t[0],r=t[1],i=t[2],s=n[3]*o+n[7]*r+n[11]*i+n[15];return s=s||1,e[0]=(n[0]*o+n[4]*r+n[8]*i+n[12])/s,e[1]=(n[1]*o+n[5]*r+n[9]*i+n[13])/s,e[2]=(n[2]*o+n[6]*r+n[10]*i+n[14])/s,e}function Yki(e,t,n){var o=t[0],r=t[1],i=t[2];return e[0]=o*n[0]+r*n[3]+i*n[6],e[1]=o*n[1]+r*n[4]+i*n[7],e[2]=o*n[2]+r*n[5]+i*n[8],e}function Gki(e,t,n){var o=n[0],r=n[1],i=n[2],s=n[3],a=t[0],c=t[1],l=t[2],h=r*l-i*c,d=i*a-o*l,u=o*c-r*a;return h=h+h,d=d+d,u=u+u,e[0]=a+s*h+r*u-i*d,e[1]=c+s*d+i*h-o*u,e[2]=l+s*u+o*d-r*h,e}function Uki(e,t,n,o){var r=[],i=[];return r[0]=t[0]-n[0],r[1]=t[1]-n[1],r[2]=t[2]-n[2],i[0]=r[0],i[1]=r[1]*Math.cos(o)-r[2]*Math.sin(o),i[2]=r[1]*Math.sin(o)+r[2]*Math.cos(o),e[0]=i[0]+n[0],e[1]=i[1]+n[1],e[2]=i[2]+n[2],e}function Wki(e,t,n,o){var r=[],i=[];return r[0]=t[0]-n[0],r[1]=t[1]-n[1],r[2]=t[2]-n[2],i[0]=r[2]*Math.sin(o)+r[0]*Math.cos(o),i[1]=r[1],i[2]=r[2]*Math.cos(o)-r[0]*Math.sin(o),e[0]=i[0]+n[0],e[1]=i[1]+n[1],e[2]=i[2]+n[2],e}function Xki(e,t,n,o){var r=[],i=[];return r[0]=t[0]-n[0],r[1]=t[1]-n[1],r[2]=t[2]-n[2],i[0]=r[0]*Math.cos(o)-r[1]*Math.sin(o),i[1]=r[0]*Math.sin(o)+r[1]*Math.cos(o),i[2]=r[2],e[0]=i[0]+n[0],e[1]=i[1]+n[1],e[2]=i[2]+n[2],e}function jki(e,t){var n=e[0],o=e[1],r=e[2],i=t[0],s=t[1],a=t[2],c=Math.sqrt((n*n+o*o+r*r)*(i*i+s*s+a*a)),l=c&&$Ee(e,t)/c;return Math.acos(Math.min(Math.max(l,-1),1))}function Kki(e){return e[0]=0,e[1]=0,e[2]=0,e}function $ki(e){return"vec3("+e[0]+", "+e[1]+", "+e[2]+")"}function qki(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]}function Jki(e,t){var n=e[0],o=e[1],r=e[2],i=t[0],s=t[1],a=t[2];return Math.abs(n-i)<=oi*Math.max(1,Math.abs(n),Math.abs(i))&&Math.abs(o-s)<=oi*Math.max(1,Math.abs(o),Math.abs(s))&&Math.abs(r-a)<=oi*Math.max(1,Math.abs(r),Math.abs(a))}var Yjn,Gjn,Ujn,Wjn,Xjn,c0t,jjn,Kjn,$jn=J9({"node_modules/gl-matrix/esm/vec3.js"(){MP(),Yjn=kjn,Gjn=Ljn,Ujn=Hjn,Wjn=Fjn,Xjn=zjn,c0t=Qjn,jjn=Ojn,Kjn=function(){var e=a0t();return function(t,n,o,r,i,s){var a,c;if(!n)n=3;if(!o)o=0;if(r)c=Math.min(r*n+o,t.length);else c=t.length;for(a=o;a<c;a+=n)e[0]=t[a],e[1]=t[a+1],e[2]=t[a+2],i(e,e,s),t[a]=e[0],t[a+1]=e[1],t[a+2]=e[2];return t}}()}}),qjn={};Z9(qjn,{add:()=>oKn,ceil:()=>Zki,clone:()=>Zjn,copy:()=>tKn,create:()=>Jjn,cross:()=>aLi,dist:()=>gKn,distance:()=>cKn,div:()=>_Kn,divide:()=>sKn,dot:()=>d0t,equals:()=>pLi,exactEquals:()=>uKn,floor:()=>eLi,forEach:()=>xKn,fromValues:()=>eKn,inverse:()=>sLi,len:()=>fKn,length:()=>l0t,lerp:()=>dKn,max:()=>nLi,min:()=>tLi,mul:()=>mKn,multiply:()=>iKn,negate:()=>iLi,normalize:()=>hKn,random:()=>cLi,round:()=>oLi,scale:()=>aKn,scaleAndAdd:()=>rLi,set:()=>nKn,sqrDist:()=>AKn,sqrLen:()=>yKn,squaredDistance:()=>lKn,squaredLength:()=>h0t,str:()=>uLi,sub:()=>pKn,subtract:()=>rKn,transformMat4:()=>lLi,transformQuat:()=>hLi,zero:()=>dLi});function Jjn(){var e=new Va(4);if(Va!=Float32Array)e[0]=0,e[1]=0,e[2]=0,e[3]=0;return e}function Zjn(e){var t=new Va(4);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}function eKn(e,t,n,o){var r=new Va(4);return r[0]=e,r[1]=t,r[2]=n,r[3]=o,r}function tKn(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}function nKn(e,t,n,o,r){return e[0]=t,e[1]=n,e[2]=o,e[3]=r,e}function oKn(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e}function rKn(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e}function iKn(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e[2]=t[2]*n[2],e[3]=t[3]*n[3],e}function sKn(e,t,n){return e[0]=t[0]/n[0],e[1]=t[1]/n[1],e[2]=t[2]/n[2],e[3]=t[3]/n[3],e}function Zki(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e[2]=Math.ceil(t[2]),e[3]=Math.ceil(t[3]),e}function eLi(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e[2]=Math.floor(t[2]),e[3]=Math.floor(t[3]),e}function tLi(e,t,n){return e[0]=Math.min(t[0],n[0]),e[1]=Math.min(t[1],n[1]),e[2]=Math.min(t[2],n[2]),e[3]=Math.min(t[3],n[3]),e}function nLi(e,t,n){return e[0]=Math.max(t[0],n[0]),e[1]=Math.max(t[1],n[1]),e[2]=Math.max(t[2],n[2]),e[3]=Math.max(t[3],n[3]),e}function oLi(e,t){return e[0]=xP(t[0]),e[1]=xP(t[1]),e[2]=xP(t[2]),e[3]=xP(t[3]),e}function aKn(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e}function rLi(e,t,n,o){return e[0]=t[0]+n[0]*o,e[1]=t[1]+n[1]*o,e[2]=t[2]+n[2]*o,e[3]=t[3]+n[3]*o,e}function cKn(e,t){var n=t[0]-e[0],o=t[1]-e[1],r=t[2]-e[2],i=t[3]-e[3];return Math.sqrt(n*n+o*o+r*r+i*i)}function lKn(e,t){var n=t[0]-e[0],o=t[1]-e[1],r=t[2]-e[2],i=t[3]-e[3];return n*n+o*o+r*r+i*i}function l0t(e){var t=e[0],n=e[1],o=e[2],r=e[3];return Math.sqrt(t*t+n*n+o*o+r*r)}function h0t(e){var t=e[0],n=e[1],o=e[2],r=e[3];return t*t+n*n+o*o+r*r}function iLi(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=-t[3],e}function sLi(e,t){return e[0]=1/t[0],e[1]=1/t[1],e[2]=1/t[2],e[3]=1/t[3],e}function hKn(e,t){var n=t[0],o=t[1],r=t[2],i=t[3],s=n*n+o*o+r*r+i*i;if(s>0)s=1/Math.sqrt(s);return e[0]=n*s,e[1]=o*s,e[2]=r*s,e[3]=i*s,e}function d0t(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]}function aLi(e,t,n,o){var r=n[0]*o[1]-n[1]*o[0],i=n[0]*o[2]-n[2]*o[0],s=n[0]*o[3]-n[3]*o[0],a=n[1]*o[2]-n[2]*o[1],c=n[1]*o[3]-n[3]*o[1],l=n[2]*o[3]-n[3]*o[2],h=t[0],d=t[1],u=t[2],_=t[3];return e[0]=d*l-u*c+_*a,e[1]=-(h*l)+u*s-_*i,e[2]=h*c-d*s+_*r,e[3]=-(h*a)+d*i-u*r,e}function dKn(e,t,n,o){var r=t[0],i=t[1],s=t[2],a=t[3];return e[0]=r+o*(n[0]-r),e[1]=i+o*(n[1]-i),e[2]=s+o*(n[2]-s),e[3]=a+o*(n[3]-a),e}function cLi(e,t){t=t===void 0?1:t;var n,o,r,i,s,a,c;c=Xb(),n=c*2-1,o=(4*Xb()-2)*Math.sqrt(c*-c+c),s=n*n+o*o,c=Xb(),r=c*2-1,i=(4*Xb()-2)*Math.sqrt(c*-c+c),a=r*r+i*i;var l=Math.sqrt((1-s)/a);return e[0]=t*n,e[1]=t*o,e[2]=t*r*l,e[3]=t*i*l,e}function lLi(e,t,n){var o=t[0],r=t[1],i=t[2],s=t[3];return e[0]=n[0]*o+n[4]*r+n[8]*i+n[12]*s,e[1]=n[1]*o+n[5]*r+n[9]*i+n[13]*s,e[2]=n[2]*o+n[6]*r+n[10]*i+n[14]*s,e[3]=n[3]*o+n[7]*r+n[11]*i+n[15]*s,e}function hLi(e,t,n){var o=n[0],r=n[1],i=n[2],s=n[3],a=t[0],c=t[1],l=t[2],h=r*l-i*c,d=i*a-o*l,u=o*c-r*a;return h=h+h,d=d+d,u=u+u,e[0]=a+s*h+r*u-i*d,e[1]=c+s*d+i*h-o*u,e[2]=l+s*u+o*d-r*h,e[3]=t[3],e}function dLi(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=0,e}function uLi(e){return"vec4("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+")"}function uKn(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]}function pLi(e,t){var n=e[0],o=e[1],r=e[2],i=e[3],s=t[0],a=t[1],c=t[2],l=t[3];return Math.abs(n-s)<=oi*Math.max(1,Math.abs(n),Math.abs(s))&&Math.abs(o-a)<=oi*Math.max(1,Math.abs(o),Math.abs(a))&&Math.abs(r-c)<=oi*Math.max(1,Math.abs(r),Math.abs(c))&&Math.abs(i-l)<=oi*Math.max(1,Math.abs(i),Math.abs(l))}var pKn,mKn,_Kn,gKn,AKn,fKn,yKn,xKn,CKn=J9({"node_modules/gl-matrix/esm/vec4.js"(){MP(),pKn=rKn,mKn=iKn,_Kn=sKn,gKn=cKn,AKn=lKn,fKn=l0t,yKn=h0t,xKn=function(){var e=Jjn();return function(t,n,o,r,i,s){var a,c;if(!n)n=4;if(!o)o=0;if(r)c=Math.min(r*n+o,t.length);else c=t.length;for(a=o;a<c;a+=n)e[0]=t[a],e[1]=t[a+1],e[2]=t[a+2],e[3]=t[a+3],i(e,e,s),t[a]=e[0],t[a+1]=e[1],t[a+2]=e[2],t[a+3]=e[3];return t}}()}}),bKn={};Z9(bKn,{add:()=>RKn,calculateW:()=>ALi,clone:()=>TKn,conjugate:()=>CLi,copy:()=>fEe,create:()=>AEe,dot:()=>qEe,equals:()=>vLi,exactEquals:()=>FKn,exp:()=>MKn,fromEuler:()=>bLi,fromMat3:()=>BKn,fromValues:()=>DKn,getAngle:()=>gLi,getAxisAngle:()=>_Li,identity:()=>mLi,invert:()=>xLi,len:()=>LKn,length:()=>yEe,lerp:()=>kKn,ln:()=>wKn,mul:()=>QKn,multiply:()=>vKn,normalize:()=>rEe,pow:()=>fLi,random:()=>yLi,rotateX:()=>SKn,rotateY:()=>PKn,rotateZ:()=>EKn,rotationTo:()=>zKn,scale:()=>u0t,set:()=>NKn,setAxes:()=>VKn,setAxisAngle:()=>IKn,slerp:()=>oEe,sqlerp:()=>OKn,sqrLen:()=>HKn,squaredLength:()=>xEe,str:()=>ILi});function AEe(){var e=new Va(4);if(Va!=Float32Array)e[0]=0,e[1]=0,e[2]=0;return e[3]=1,e}function mLi(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e}function IKn(e,t,n){n=n*0.5;var o=Math.sin(n);return e[0]=o*t[0],e[1]=o*t[1],e[2]=o*t[2],e[3]=Math.cos(n),e}function _Li(e,t){var n=Math.acos(t[3])*2,o=Math.sin(n/2);if(o>oi)e[0]=t[0]/o,e[1]=t[1]/o,e[2]=t[2]/o;else e[0]=1,e[1]=0,e[2]=0;return n}function gLi(e,t){var n=qEe(e,t);return Math.acos(2*n*n-1)}function vKn(e,t,n){var o=t[0],r=t[1],i=t[2],s=t[3],a=n[0],c=n[1],l=n[2],h=n[3];return e[0]=o*h+s*a+r*l-i*c,e[1]=r*h+s*c+i*a-o*l,e[2]=i*h+s*l+o*c-r*a,e[3]=s*h-o*a-r*c-i*l,e}function SKn(e,t,n){n*=0.5;var o=t[0],r=t[1],i=t[2],s=t[3],a=Math.sin(n),c=Math.cos(n);return e[0]=o*c+s*a,e[1]=r*c+i*a,e[2]=i*c-r*a,e[3]=s*c-o*a,e}function PKn(e,t,n){n*=0.5;var o=t[0],r=t[1],i=t[2],s=t[3],a=Math.sin(n),c=Math.cos(n);return e[0]=o*c-i*a,e[1]=r*c+s*a,e[2]=i*c+o*a,e[3]=s*c-r*a,e}function EKn(e,t,n){n*=0.5;var o=t[0],r=t[1],i=t[2],s=t[3],a=Math.sin(n),c=Math.cos(n);return e[0]=o*c+r*a,e[1]=r*c-o*a,e[2]=i*c+s*a,e[3]=s*c-i*a,e}function ALi(e,t){var n=t[0],o=t[1],r=t[2];return e[0]=n,e[1]=o,e[2]=r,e[3]=Math.sqrt(Math.abs(1-n*n-o*o-r*r)),e}function MKn(e,t){var n=t[0],o=t[1],r=t[2],i=t[3],s=Math.sqrt(n*n+o*o+r*r),a=Math.exp(i),c=s>0?a*Math.sin(s)/s:0;return e[0]=n*c,e[1]=o*c,e[2]=r*c,e[3]=a*Math.cos(s),e}function wKn(e,t){var n=t[0],o=t[1],r=t[2],i=t[3],s=Math.sqrt(n*n+o*o+r*r),a=s>0?Math.atan2(s,i)/s:0;return e[0]=n*a,e[1]=o*a,e[2]=r*a,e[3]=0.5*Math.log(n*n+o*o+r*r+i*i),e}function fLi(e,t,n){return wKn(e,t),u0t(e,e,n),MKn(e,e),e}function oEe(e,t,n,o){var r=t[0],i=t[1],s=t[2],a=t[3],c=n[0],l=n[1],h=n[2],d=n[3],u,_,p,m,A;if(_=r*c+i*l+s*h+a*d,_<0)_=-_,c=-c,l=-l,h=-h,d=-d;if(1-_>oi)u=Math.acos(_),p=Math.sin(u),m=Math.sin((1-o)*u)/p,A=Math.sin(o*u)/p;else m=1-o,A=o;return e[0]=m*r+A*c,e[1]=m*i+A*l,e[2]=m*s+A*h,e[3]=m*a+A*d,e}function yLi(e){var t=Xb(),n=Xb(),o=Xb(),r=Math.sqrt(1-t),i=Math.sqrt(t);return e[0]=r*Math.sin(2*Math.PI*n),e[1]=r*Math.cos(2*Math.PI*n),e[2]=i*Math.sin(2*Math.PI*o),e[3]=i*Math.cos(2*Math.PI*o),e}function xLi(e,t){var n=t[0],o=t[1],r=t[2],i=t[3],s=n*n+o*o+r*r+i*i,a=s?1/s:0;return e[0]=-n*a,e[1]=-o*a,e[2]=-r*a,e[3]=i*a,e}function CLi(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],e}function BKn(e,t){var n=t[0]+t[4]+t[8],o;if(n>0)o=Math.sqrt(n+1),e[3]=0.5*o,o=0.5/o,e[0]=(t[5]-t[7])*o,e[1]=(t[6]-t[2])*o,e[2]=(t[1]-t[3])*o;else{var r=0;if(t[4]>t[0])r=1;if(t[8]>t[r*3+r])r=2;var i=(r+1)%3,s=(r+2)%3;o=Math.sqrt(t[r*3+r]-t[i*3+i]-t[s*3+s]+1),e[r]=0.5*o,o=0.5/o,e[3]=(t[i*3+s]-t[s*3+i])*o,e[i]=(t[i*3+r]+t[r*3+i])*o,e[s]=(t[s*3+r]+t[r*3+s])*o}return e}function bLi(e,t,n,o){var r=arguments.length>4&&arguments[4]!==void 0?arguments[4]:s0t,i=Math.PI/360;t*=i,o*=i,n*=i;var s=Math.sin(t),a=Math.cos(t),c=Math.sin(n),l=Math.cos(n),h=Math.sin(o),d=Math.cos(o);switch(r){case"xyz":e[0]=s*l*d+a*c*h,e[1]=a*c*d-s*l*h,e[2]=a*l*h+s*c*d,e[3]=a*l*d-s*c*h;break;case"xzy":e[0]=s*l*d-a*c*h,e[1]=a*c*d-s*l*h,e[2]=a*l*h+s*c*d,e[3]=a*l*d+s*c*h;break;case"yxz":e[0]=s*l*d+a*c*h,e[1]=a*c*d-s*l*h,e[2]=a*l*h-s*c*d,e[3]=a*l*d+s*c*h;break;case"yzx":e[0]=s*l*d+a*c*h,e[1]=a*c*d+s*l*h,e[2]=a*l*h-s*c*d,e[3]=a*l*d-s*c*h;break;case"zxy":e[0]=s*l*d-a*c*h,e[1]=a*c*d+s*l*h,e[2]=a*l*h+s*c*d,e[3]=a*l*d-s*c*h;break;case"zyx":e[0]=s*l*d-a*c*h,e[1]=a*c*d+s*l*h,e[2]=a*l*h-s*c*d,e[3]=a*l*d+s*c*h;break;default:throw Error("Unknown angle order "+r)}return e}function ILi(e){return"quat("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+")"}function vLi(e,t){return Math.abs(d0t(e,t))>=1-oi}var TKn,DKn,fEe,NKn,RKn,QKn,u0t,qEe,kKn,yEe,LKn,xEe,HKn,rEe,FKn,zKn,OKn,VKn,YKn=J9({"node_modules/gl-matrix/esm/quat.js"(){MP(),fjn(),$jn(),CKn(),TKn=Zjn,DKn=eKn,fEe=tKn,NKn=nKn,RKn=oKn,QKn=vKn,u0t=aKn,qEe=d0t,kKn=dKn,yEe=l0t,LKn=yEe,xEe=h0t,HKn=xEe,rEe=hKn,FKn=uKn,zKn=function(){var e=a0t(),t=jdt(1,0,0),n=jdt(0,1,0);return function(o,r,i){var s=$Ee(r,i);if(s<-0.999999){if(nEe(e,t,r),c0t(e)<0.000001)nEe(e,n,r);return Vjn(e,e),IKn(o,e,Math.PI),o}else if(s>0.999999)return o[0]=0,o[1]=0,o[2]=0,o[3]=1,o;else return nEe(e,r,i),o[0]=e[0],o[1]=e[1],o[2]=e[2],o[3]=1+s,rEe(o,o)}}(),OKn=function(){var e=AEe(),t=AEe();return function(n,o,r,i,s,a){return oEe(e,o,s,a),oEe(t,r,i,a),oEe(n,e,t,2*a*(1-a)),n}}(),VKn=function(){var e=pjn();return function(t,n,o,r){return e[0]=o[0],e[3]=o[1],e[6]=o[2],e[1]=r[0],e[4]=r[1],e[7]=r[2],e[2]=-n[0],e[5]=-n[1],e[8]=-n[2],rEe(t,BKn(t,e))}}()}}),GKn={};Z9(GKn,{add:()=>GLi,clone:()=>PLi,conjugate:()=>jLi,copy:()=>WKn,create:()=>SLi,dot:()=>p0t,equals:()=>JLi,exactEquals:()=>qLi,fromMat4:()=>TLi,fromRotation:()=>BLi,fromRotationTranslation:()=>UKn,fromRotationTranslationValues:()=>MLi,fromTranslation:()=>wLi,fromValues:()=>ELi,getDual:()=>RLi,getReal:()=>jKn,getTranslation:()=>kLi,identity:()=>DLi,invert:()=>XLi,len:()=>qKn,length:()=>Kdt,lerp:()=>WLi,mul:()=>$Kn,multiply:()=>XKn,normalize:()=>KLi,rotateAroundAxis:()=>YLi,rotateByQuatAppend:()=>OLi,rotateByQuatPrepend:()=>VLi,rotateX:()=>HLi,rotateY:()=>FLi,rotateZ:()=>zLi,scale:()=>ULi,set:()=>NLi,setDual:()=>QLi,setReal:()=>KKn,sqrLen:()=>JKn,squaredLength:()=>upe,str:()=>$Li,translate:()=>LLi});function SLi(){var e=new Va(8);if(Va!=Float32Array)e[0]=0,e[1]=0,e[2]=0,e[4]=0,e[5]=0,e[6]=0,e[7]=0;return e[3]=1,e}function PLi(e){var t=new Va(8);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t}function ELi(e,t,n,o,r,i,s,a){var c=new Va(8);return c[0]=e,c[1]=t,c[2]=n,c[3]=o,c[4]=r,c[5]=i,c[6]=s,c[7]=a,c}function MLi(e,t,n,o,r,i,s){var a=new Va(8);a[0]=e,a[1]=t,a[2]=n,a[3]=o;var c=r*0.5,l=i*0.5,h=s*0.5;return a[4]=c*o+l*n-h*t,a[5]=l*o+h*e-c*n,a[6]=h*o+c*t-l*e,a[7]=-c*e-l*t-h*n,a}function UKn(e,t,n){var o=n[0]*0.5,r=n[1]*0.5,i=n[2]*0.5,s=t[0],a=t[1],c=t[2],l=t[3];return e[0]=s,e[1]=a,e[2]=c,e[3]=l,e[4]=o*l+r*c-i*a,e[5]=r*l+i*s-o*c,e[6]=i*l+o*a-r*s,e[7]=-o*s-r*a-i*c,e}function wLi(e,t){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e[4]=t[0]*0.5,e[5]=t[1]*0.5,e[6]=t[2]*0.5,e[7]=0,e}function BLi(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=0,e[5]=0,e[6]=0,e[7]=0,e}function TLi(e,t){var n=AEe();Sjn(n,t);var o=new Va(3);return Ijn(o,t),UKn(e,n,o),e}function WKn(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e}function DLi(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e[4]=0,e[5]=0,e[6]=0,e[7]=0,e}function NLi(e,t,n,o,r,i,s,a,c){return e[0]=t,e[1]=n,e[2]=o,e[3]=r,e[4]=i,e[5]=s,e[6]=a,e[7]=c,e}function RLi(e,t){return e[0]=t[4],e[1]=t[5],e[2]=t[6],e[3]=t[7],e}function QLi(e,t){return e[4]=t[0],e[5]=t[1],e[6]=t[2],e[7]=t[3],e}function kLi(e,t){var n=t[4],o=t[5],r=t[6],i=t[7],s=-t[0],a=-t[1],c=-t[2],l=t[3];return e[0]=(n*l+i*s+o*c-r*a)*2,e[1]=(o*l+i*a+r*s-n*c)*2,e[2]=(r*l+i*c+n*a-o*s)*2,e}function LLi(e,t,n){var o=t[0],r=t[1],i=t[2],s=t[3],a=n[0]*0.5,c=n[1]*0.5,l=n[2]*0.5,h=t[4],d=t[5],u=t[6],_=t[7];return e[0]=o,e[1]=r,e[2]=i,e[3]=s,e[4]=s*a+r*l-i*c+h,e[5]=s*c+i*a-o*l+d,e[6]=s*l+o*c-r*a+u,e[7]=-o*a-r*c-i*l+_,e}function HLi(e,t,n){var o=-t[0],r=-t[1],i=-t[2],s=t[3],a=t[4],c=t[5],l=t[6],h=t[7],d=a*s+h*o+c*i-l*r,u=c*s+h*r+l*o-a*i,_=l*s+h*i+a*r-c*o,p=h*s-a*o-c*r-l*i;return SKn(e,t,n),o=e[0],r=e[1],i=e[2],s=e[3],e[4]=d*s+p*o+u*i-_*r,e[5]=u*s+p*r+_*o-d*i,e[6]=_*s+p*i+d*r-u*o,e[7]=p*s-d*o-u*r-_*i,e}function FLi(e,t,n){var o=-t[0],r=-t[1],i=-t[2],s=t[3],a=t[4],c=t[5],l=t[6],h=t[7],d=a*s+h*o+c*i-l*r,u=c*s+h*r+l*o-a*i,_=l*s+h*i+a*r-c*o,p=h*s-a*o-c*r-l*i;return PKn(e,t,n),o=e[0],r=e[1],i=e[2],s=e[3],e[4]=d*s+p*o+u*i-_*r,e[5]=u*s+p*r+_*o-d*i,e[6]=_*s+p*i+d*r-u*o,e[7]=p*s-d*o-u*r-_*i,e}function zLi(e,t,n){var o=-t[0],r=-t[1],i=-t[2],s=t[3],a=t[4],c=t[5],l=t[6],h=t[7],d=a*s+h*o+c*i-l*r,u=c*s+h*r+l*o-a*i,_=l*s+h*i+a*r-c*o,p=h*s-a*o-c*r-l*i;return EKn(e,t,n),o=e[0],r=e[1],i=e[2],s=e[3],e[4]=d*s+p*o+u*i-_*r,e[5]=u*s+p*r+_*o-d*i,e[6]=_*s+p*i+d*r-u*o,e[7]=p*s-d*o-u*r-_*i,e}function OLi(e,t,n){var o=n[0],r=n[1],i=n[2],s=n[3],a=t[0],c=t[1],l=t[2],h=t[3];return e[0]=a*s+h*o+c*i-l*r,e[1]=c*s+h*r+l*o-a*i,e[2]=l*s+h*i+a*r-c*o,e[3]=h*s-a*o-c*r-l*i,a=t[4],c=t[5],l=t[6],h=t[7],e[4]=a*s+h*o+c*i-l*r,e[5]=c*s+h*r+l*o-a*i,e[6]=l*s+h*i+a*r-c*o,e[7]=h*s-a*o-c*r-l*i,e}function VLi(e,t,n){var o=t[0],r=t[1],i=t[2],s=t[3],a=n[0],c=n[1],l=n[2],h=n[3];return e[0]=o*h+s*a+r*l-i*c,e[1]=r*h+s*c+i*a-o*l,e[2]=i*h+s*l+o*c-r*a,e[3]=s*h-o*a-r*c-i*l,a=n[4],c=n[5],l=n[6],h=n[7],e[4]=o*h+s*a+r*l-i*c,e[5]=r*h+s*c+i*a-o*l,e[6]=i*h+s*l+o*c-r*a,e[7]=s*h-o*a-r*c-i*l,e}function YLi(e,t,n,o){if(Math.abs(o)<oi)return WKn(e,t);var r=Math.sqrt(n[0]*n[0]+n[1]*n[1]+n[2]*n[2]);o=o*0.5;var i=Math.sin(o),s=i*n[0]/r,a=i*n[1]/r,c=i*n[2]/r,l=Math.cos(o),h=t[0],d=t[1],u=t[2],_=t[3];e[0]=h*l+_*s+d*c-u*a,e[1]=d*l+_*a+u*s-h*c,e[2]=u*l+_*c+h*a-d*s,e[3]=_*l-h*s-d*a-u*c;var p=t[4],m=t[5],A=t[6],g=t[7];return e[4]=p*l+g*s+m*c-A*a,e[5]=m*l+g*a+A*s-p*c,e[6]=A*l+g*c+p*a-m*s,e[7]=g*l-p*s-m*a-A*c,e}function GLi(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e[4]=t[4]+n[4],e[5]=t[5]+n[5],e[6]=t[6]+n[6],e[7]=t[7]+n[7],e}function XKn(e,t,n){var o=t[0],r=t[1],i=t[2],s=t[3],a=n[4],c=n[5],l=n[6],h=n[7],d=t[4],u=t[5],_=t[6],p=t[7],m=n[0],A=n[1],g=n[2],f=n[3];return e[0]=o*f+s*m+r*g-i*A,e[1]=r*f+s*A+i*m-o*g,e[2]=i*f+s*g+o*A-r*m,e[3]=s*f-o*m-r*A-i*g,e[4]=o*h+s*a+r*l-i*c+d*f+p*m+u*g-_*A,e[5]=r*h+s*c+i*a-o*l+u*f+p*A+_*m-d*g,e[6]=i*h+s*l+o*c-r*a+_*f+p*g+d*A-u*m,e[7]=s*h-o*a-r*c-i*l+p*f-d*m-u*A-_*g,e}function ULi(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*n,e[5]=t[5]*n,e[6]=t[6]*n,e[7]=t[7]*n,e}function WLi(e,t,n,o){var r=1-o;if(p0t(t,n)<0)o=-o;return e[0]=t[0]*r+n[0]*o,e[1]=t[1]*r+n[1]*o,e[2]=t[2]*r+n[2]*o,e[3]=t[3]*r+n[3]*o,e[4]=t[4]*r+n[4]*o,e[5]=t[5]*r+n[5]*o,e[6]=t[6]*r+n[6]*o,e[7]=t[7]*r+n[7]*o,e}function XLi(e,t){var n=upe(t);return e[0]=-t[0]/n,e[1]=-t[1]/n,e[2]=-t[2]/n,e[3]=t[3]/n,e[4]=-t[4]/n,e[5]=-t[5]/n,e[6]=-t[6]/n,e[7]=t[7]/n,e}function jLi(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],e[4]=-t[4],e[5]=-t[5],e[6]=-t[6],e[7]=t[7],e}function KLi(e,t){var n=upe(t);if(n>0){n=Math.sqrt(n);var o=t[0]/n,r=t[1]/n,i=t[2]/n,s=t[3]/n,a=t[4],c=t[5],l=t[6],h=t[7],d=o*a+r*c+i*l+s*h;e[0]=o,e[1]=r,e[2]=i,e[3]=s,e[4]=(a-o*d)/n,e[5]=(c-r*d)/n,e[6]=(l-i*d)/n,e[7]=(h-s*d)/n}return e}function $Li(e){return"quat2("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+", "+e[4]+", "+e[5]+", "+e[6]+", "+e[7]+")"}function qLi(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]}function JLi(e,t){var n=e[0],o=e[1],r=e[2],i=e[3],s=e[4],a=e[5],c=e[6],l=e[7],h=t[0],d=t[1],u=t[2],_=t[3],p=t[4],m=t[5],A=t[6],g=t[7];return Math.abs(n-h)<=oi*Math.max(1,Math.abs(n),Math.abs(h))&&Math.abs(o-d)<=oi*Math.max(1,Math.abs(o),Math.abs(d))&&Math.abs(r-u)<=oi*Math.max(1,Math.abs(r),Math.abs(u))&&Math.abs(i-_)<=oi*Math.max(1,Math.abs(i),Math.abs(_))&&Math.abs(s-p)<=oi*Math.max(1,Math.abs(s),Math.abs(p))&&Math.abs(a-m)<=oi*Math.max(1,Math.abs(a),Math.abs(m))&&Math.abs(c-A)<=oi*Math.max(1,Math.abs(c),Math.abs(A))&&Math.abs(l-g)<=oi*Math.max(1,Math.abs(l),Math.abs(g))}var jKn,KKn,$Kn,p0t,Kdt,qKn,upe,JKn,ZLi=J9({"node_modules/gl-matrix/esm/quat2.js"(){MP(),YKn(),Njn(),jKn=fEe,KKn=fEe,$Kn=XKn,p0t=qEe,Kdt=yEe,qKn=Kdt,upe=xEe,JKn=upe}}),ZKn={};Z9(ZKn,{add:()=>rHi,angle:()=>vHi,ceil:()=>iHi,clone:()=>eHi,copy:()=>nHi,create:()=>e$n,cross:()=>gHi,dist:()=>u$n,distance:()=>r$n,div:()=>d$n,divide:()=>o$n,dot:()=>_Hi,equals:()=>wHi,exactEquals:()=>MHi,floor:()=>sHi,forEach:()=>_$n,fromValues:()=>tHi,inverse:()=>pHi,len:()=>c$n,length:()=>s$n,lerp:()=>AHi,max:()=>cHi,min:()=>aHi,mul:()=>h$n,multiply:()=>n$n,negate:()=>uHi,normalize:()=>mHi,random:()=>fHi,rotate:()=>IHi,round:()=>lHi,scale:()=>hHi,scaleAndAdd:()=>dHi,set:()=>oHi,signedAngle:()=>SHi,sqrDist:()=>p$n,sqrLen:()=>m$n,squaredDistance:()=>i$n,squaredLength:()=>a$n,str:()=>EHi,sub:()=>l$n,subtract:()=>t$n,transformMat2:()=>yHi,transformMat2d:()=>xHi,transformMat3:()=>CHi,transformMat4:()=>bHi,zero:()=>PHi});function e$n(){var e=new Va(2);if(Va!=Float32Array)e[0]=0,e[1]=0;return e}function eHi(e){var t=new Va(2);return t[0]=e[0],t[1]=e[1],t}function tHi(e,t){var n=new Va(2);return n[0]=e,n[1]=t,n}function nHi(e,t){return e[0]=t[0],e[1]=t[1],e}function oHi(e,t,n){return e[0]=t,e[1]=n,e}function rHi(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e}function t$n(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e}function n$n(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e}function o$n(e,t,n){return e[0]=t[0]/n[0],e[1]=t[1]/n[1],e}function iHi(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e}function sHi(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e}function aHi(e,t,n){return e[0]=Math.min(t[0],n[0]),e[1]=Math.min(t[1],n[1]),e}function cHi(e,t,n){return e[0]=Math.max(t[0],n[0]),e[1]=Math.max(t[1],n[1]),e}function lHi(e,t){return e[0]=xP(t[0]),e[1]=xP(t[1]),e}function hHi(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e}function dHi(e,t,n,o){return e[0]=t[0]+n[0]*o,e[1]=t[1]+n[1]*o,e}function r$n(e,t){var n=t[0]-e[0],o=t[1]-e[1];return Math.sqrt(n*n+o*o)}function i$n(e,t){var n=t[0]-e[0],o=t[1]-e[1];return n*n+o*o}function s$n(e){var t=e[0],n=e[1];return Math.sqrt(t*t+n*n)}function a$n(e){var t=e[0],n=e[1];return t*t+n*n}function uHi(e,t){return e[0]=-t[0],e[1]=-t[1],e}function pHi(e,t){return e[0]=1/t[0],e[1]=1/t[1],e}function mHi(e,t){var n=t[0],o=t[1],r=n*n+o*o;if(r>0)r=1/Math.sqrt(r);return e[0]=t[0]*r,e[1]=t[1]*r,e}function _Hi(e,t){return e[0]*t[0]+e[1]*t[1]}function gHi(e,t,n){var o=t[0]*n[1]-t[1]*n[0];return e[0]=e[1]=0,e[2]=o,e}function AHi(e,t,n,o){var r=t[0],i=t[1];return e[0]=r+o*(n[0]-r),e[1]=i+o*(n[1]-i),e}function fHi(e,t){t=t===void 0?1:t;var n=Xb()*2*Math.PI;return e[0]=Math.cos(n)*t,e[1]=Math.sin(n)*t,e}function yHi(e,t,n){var o=t[0],r=t[1];return e[0]=n[0]*o+n[2]*r,e[1]=n[1]*o+n[3]*r,e}function xHi(e,t,n){var o=t[0],r=t[1];return e[0]=n[0]*o+n[2]*r+n[4],e[1]=n[1]*o+n[3]*r+n[5],e}function CHi(e,t,n){var o=t[0],r=t[1];return e[0]=n[0]*o+n[3]*r+n[6],e[1]=n[1]*o+n[4]*r+n[7],e}function bHi(e,t,n){var o=t[0],r=t[1];return e[0]=n[0]*o+n[4]*r+n[12],e[1]=n[1]*o+n[5]*r+n[13],e}function IHi(e,t,n,o){var r=t[0]-n[0],i=t[1]-n[1],s=Math.sin(o),a=Math.cos(o);return e[0]=r*a-i*s+n[0],e[1]=r*s+i*a+n[1],e}function vHi(e,t){var n=e[0],o=e[1],r=t[0],i=t[1];return Math.abs(Math.atan2(o*r-n*i,n*r+o*i))}function SHi(e,t){var n=e[0],o=e[1],r=t[0],i=t[1];return Math.atan2(n*i-o*r,n*r+o*i)}function PHi(e){return e[0]=0,e[1]=0,e}function EHi(e){return"vec2("+e[0]+", "+e[1]+")"}function MHi(e,t){return e[0]===t[0]&&e[1]===t[1]}function wHi(e,t){var n=e[0],o=e[1],r=t[0],i=t[1];return Math.abs(n-r)<=oi*Math.max(1,Math.abs(n),Math.abs(r))&&Math.abs(o-i)<=oi*Math.max(1,Math.abs(o),Math.abs(i))}var c$n,l$n,h$n,d$n,u$n,p$n,m$n,_$n,BHi=J9({"node_modules/gl-matrix/esm/vec2.js"(){MP(),c$n=s$n,l$n=t$n,h$n=n$n,d$n=o$n,u$n=r$n,p$n=i$n,m$n=a$n,_$n=function(){var e=e$n();return function(t,n,o,r,i,s){var a,c;if(!n)n=2;if(!o)o=0;if(r)c=Math.min(r*n+o,t.length);else c=t.length;for(a=o;a<c;a+=n)e[0]=t[a],e[1]=t[a+1],i(e,e,s),t[a]=e[0],t[a+1]=e[1];return t}}()}}),g$n={};Z9(g$n,{glMatrix:()=>ZXn,mat2:()=>njn,mat2d:()=>ajn,mat3:()=>ujn,mat4:()=>yjn,quat:()=>bKn,quat2:()=>GKn,vec2:()=>ZKn,vec3:()=>Rjn,vec4:()=>qjn});var THi=J9({"node_modules/gl-matrix/esm/index.js"(){MP(),YRi(),dQi(),fjn(),Njn(),YKn(),ZLi(),BHi(),$jn(),CKn()}}),A$n=At({"node_modules/jscad-planner/dist/index.cjs"(e,t){var{defineProperty:n,getOwnPropertyDescriptor:o,getOwnPropertyNames:r}=Object,i=Object.prototype.hasOwnProperty,s=(C,b)=>{for(var I in b)n(C,I,{get:b[I],enumerable:!0})},a=(C,b,I,v)=>{if(b&&typeof b==="object"||typeof b==="function"){for(let P of r(b))if(!i.call(C,P)&&P!==I)n(C,P,{get:()=>b[P],enumerable:!(v=o(b,P))||v.enumerable})}return C},c=(C)=>a(n({},"__esModule",{value:!0}),C),l={};s(l,{assertTransformMatrix:()=>d,executeJscadOperations:()=>y,jscadPlanner:()=>_,resolveReferencePlanes:()=>f,toTransformMatrix:()=>u}),t.exports=c(l);var h="Transform matrix must be a column-major array of exactly 16 finite numbers";function d(C){if(!Array.isArray(C)||C.length!==16||!Array.from(C).every(Number.isFinite))throw Error(h)}function u(C){if(C==null||C.length!==16)throw Error(h);let b=Array.from(C);return d(b),b}var _={booleans:{intersect:(...C)=>({type:"intersect",shapes:C}),subtract:(...C)=>({type:"subtract",shapes:C}),union:(...C)=>({type:"union",shapes:C})},hulls:{hull:(...C)=>({type:"hull",shapes:C.flat()}),hullChain:(...C)=>({type:"hullChain",shapes:C.flat()})},colors:{colorize:(C,b)=>({type:"colorize",color:C,shape:b})},primitives:{rectangle:(C)=>({...C,type:"rectangle"}),cube:(C)=>({type:"cube",...C}),sphere:(C)=>({type:"sphere",...C}),cylinder:(C)=>({type:"cylinder",...C}),polygon:(C)=>({type:"polygon",...C}),cuboid:(C)=>({type:"cuboid",...C}),roundedCuboid:(C)=>({type:"roundedCuboid",...C})},transforms:{transform:(C,b)=>(d(C),{type:"transform",matrix:C,shape:b}),rotate:(C,b)=>({type:"rotate",angles:C,shape:b}),rotateX:(C,b)=>({type:"rotateX",angle:C,shape:b}),rotateY:(C,b)=>({type:"rotateY",angle:C,shape:b}),rotateZ:(C,b)=>({type:"rotateZ",angle:C,shape:b}),scale:(C,b)=>({type:"scale",factors:C,shape:b}),translate:(C,b)=>({type:"translate",vector:C,shape:b})},extrusions:{extrudeLinear:(C,b)=>({type:"extrudeLinear",options:C,shape:b}),extrudeRotate:(C,b)=>({type:"extrudeRotate",options:C,shape:b})},maths:{vec2:{create:(C,b)=>[C,b],fromValues:(C,b)=>[C,b]},vec3:{create:(C,b,I)=>[C,b,I],fromValues:(C,b,I)=>[C,b,I]}},geometries:{geom2:{create:(C)=>({type:"createGeom2",points:C}),fromPoints:(C)=>({type:"fromPointsGeom2",points:C})},geom3:{create:(C)=>({type:"createGeom3",polygons:C})},path2:{create:(C)=>({type:"createPath2",points:C})}},measurements:{measureBoundingBox:(C)=>({type:"measureBoundingBox",shape:C}),measureArea:(C)=>({type:"measureArea",shape:C}),measureVolume:(C)=>({type:"measureVolume",shape:C})},utils:{degToRad:(C)=>C*Math.PI/180,radToDeg:(C)=>C*180/Math.PI}},p=(THi(),Dwi(g$n)),m=()=>u(p.mat4.create());function A(C){let b=m();switch(C.type){case"transform":return d(C.matrix),[...C.matrix];case"translate":return u(p.mat4.fromTranslation(b,C.vector));case"scale":return u(p.mat4.fromScaling(b,C.factors));case"rotate":return p.mat4.rotateZ(b,b,C.angles[2]),p.mat4.rotateY(b,b,C.angles[1]),p.mat4.rotateX(b,b,C.angles[0]),b;case"rotateX":return u(p.mat4.fromXRotation(b,C.angle));case"rotateY":return u(p.mat4.fromYRotation(b,C.angle));case"rotateZ":return u(p.mat4.fromZRotation(b,C.angle));default:throw Error(`Cannot use ${C.type} as a reference transform`)}}function g(C,b){let I=C.name;if(!I?.trim())throw Error("Reference rectangles require a nonblank name");let v;if(C.type==="rectangle"){if(C.size.length!==2||!C.size.every((D)=>Number.isFinite(D)&&D>0))throw Error(`Reference rectangle "${I}" requires two positive finite dimensions`);v=C.center??[0,0]}else{let D=C.points;if(C.paths||D.length!==4||!D.every((O)=>O.length===2&&O.every((U)=>typeof U==="number"&&Number.isFinite(U))))throw Error(`Reference polygon "${I}" must be an axis-aligned rectangle`);let L=D,H=[...new Set(L.map((O)=>O[0]))],V=[...new Set(L.map((O)=>O[1]))];if(H.length!==2||V.length!==2||new Set(L.map((O)=>JSON.stringify(O))).size!==4)throw Error(`Reference polygon "${I}" must be an axis-aligned rectangle`);v=[(H[0]+H[1])/2,(V[0]+V[1])/2]}if(v.length!==2||!v.every(Number.isFinite))throw Error(`Reference rectangle "${I}" has an invalid center`);let P=m();for(let D of b)p.mat4.multiply(P,P,A(D));if(d(P),P[3]!==0||P[7]!==0||P[11]!==0||P[15]!==1)throw Error(`Reference rectangle "${I}" requires affine transforms`);let M=p.mat4.invert(m(),P);if(!M)throw Error(`Reference rectangle "${I}" has a singular transform`);let B=[0,0,0];p.vec3.transformMat4(B,[v[0],v[1],0],P);let T=[M[2],M[6],M[10]],N=[P[0],P[1],P[2]];if(![...B,...T,...N].every(Number.isFinite)||!p.vec3.length(T)||!p.vec3.length(N))throw Error(`Reference rectangle "${I}" has an invalid frame`);return p.vec3.normalize(T,T),p.vec3.normalize(N,N),{name:I,origin:B,normal:T,xAxis:N}}function f(C){let b=[],I=new Set;function v(B,T,N=!1){if(B.reference){if(B.type!=="rectangle"&&B.type!=="polygon")throw Error("Only rectangles can be reference geometry");if(N)throw Error("Reference rectangles must be outside extrusion and measurement inputs");let D=g(B,T);if(I.has(D.name))throw Error(`Duplicate reference plane "${D.name}"`);I.add(D.name),b.push(D);return}switch(B.type){case"translate":case"rotate":case"rotateX":case"rotateY":case"rotateZ":case"scale":case"transform":{let D=v(B.shape,[...T,B],N);return D?{...B,shape:D}:void 0}case"colorize":{let D=v(B.shape,T,N);return D?{...B,shape:D}:void 0}case"extrudeLinear":case"extrudeRotate":case"measureArea":case"measureVolume":case"measureBoundingBox":{let D=v(B.shape,T,!0);return D?{...B,shape:D}:void 0}case"union":case"subtract":case"intersect":case"hull":case"hullChain":{let D=B.shapes.map((H)=>v(H,T,N));if(B.type==="subtract"&&B.shapes.length&&!D[0])throw Error("A subtraction base cannot be reference geometry");let L=D.filter((H)=>H!==void 0);if(!L.length)return;if(L.length===1)return L[0];return{...B,shapes:L}}default:return{...B}}}let P=(Array.isArray(C)?C:[C]).map((B)=>v(B,[])).filter((B)=>B!==void 0);return{geometry:P.length>1?{type:"union",shapes:P}:P[0],referencePlanes:b}}var y=(C,b)=>{if(Array.isArray(b)&&b.length===1)return y(C,b[0]);if(Array.isArray(b))throw Error("executeJscadOperations currently doesn't support Array<JscadOperation>, try adding a root union or or executing each element individually");let{geometry:I}=f(b);if(!I)throw Error("JSCAD plan contains only reference geometry");return x(C,I)},x=(C,b)=>{let I=(M)=>x(C,M),{type:v,...P}=b;switch(v){case"rectangle":if(!C.primitives.rectangle)throw Error("JSCAD adapter does not support primitives.rectangle");return C.primitives.rectangle({size:b.size,center:b.center??[0,0]});case"intersect":return C.booleans.intersect(...b.shapes.map(I));case"subtract":return C.booleans.subtract(...b.shapes.map(I));case"union":return C.booleans.union(...b.shapes.map(I));case"hull":return C.hulls.hull(...b.shapes.map(I));case"hullChain":return C.hulls.hullChain(...b.shapes.map(I));case"colorize":return C.colors.colorize(b.color,I(b.shape));case"cube":return C.primitives.cube(P);case"sphere":return C.primitives.sphere(P);case"cylinder":return C.primitives.cylinder(P);case"polygon":return C.primitives.polygon(P);case"cuboid":return C.primitives.cuboid(P);case"roundedCuboid":return C.primitives.roundedCuboid(P);case"transform":if(d(b.matrix),!C.transforms.transform)throw Error('Cannot execute "transform" operation: this JSCAD adapter does not support transforms.transform');return C.transforms.transform(b.matrix,I(b.shape));case"rotate":return C.transforms.rotate(b.angles,I(b.shape));case"rotateX":return C.transforms.rotateX(b.angle,I(b.shape));case"rotateY":return C.transforms.rotateY(b.angle,I(b.shape));case"rotateZ":return C.transforms.rotateZ(b.angle,I(b.shape));case"scale":return C.transforms.scale(b.factors,I(b.shape));case"translate":return C.transforms.translate(b.vector,I(b.shape));case"extrudeLinear":return C.extrusions.extrudeLinear(b.options,I(b.shape));case"extrudeRotate":return C.extrusions.extrudeRotate(b.options,I(b.shape));case"createGeom2":return C.geometries.geom2.create(b.points);case"fromPointsGeom2":return C.geometries.geom2.fromPoints(b.points);case"createGeom3":return C.geometries.geom3.create(b.polygons);case"createPath2":return C.geometries.path2.create(b.points);case"measureBoundingBox":return C.measurements.measureBoundingBox(I(b.shape));case"measureArea":return C.measurements.measureArea(I(b.shape));case"measureVolume":return C.measurements.measureVolume(I(b.shape));case"degToRad":return C.utils.degToRad(b.degrees);case"radToDeg":return C.utils.radToDeg(b.radians);default:if(b.type===void 0)throw Error(`Operation type is undefined. This usually means the operation object is malformed or not properly initialized. Operation: ${JSON.stringify(b,null,2).slice(0,200)}...`);throw Error(`Unsupported operation type: ${b.type}. Operation: ${JSON.stringify(b,null,2)}`)}}}}),DHi=At({"node_modules/ms/index.js"(e,t){var n=1000,o=n*60,r=o*60,i=r*24,s=i*7,a=i*365.25;t.exports=function(u,_){_=_||{};var p=typeof u;if(p==="string"&&u.length>0)return c(u);else if(p==="number"&&isFinite(u))return _.long?h(u):l(u);throw Error("val is not a non-empty string or a valid number. val="+JSON.stringify(u))};function c(u){if(u=String(u),u.length>100)return;var _=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(u);if(!_)return;var p=parseFloat(_[1]),m=(_[2]||"ms").toLowerCase();switch(m){case"years":case"year":case"yrs":case"yr":case"y":return p*a;case"weeks":case"week":case"w":return p*s;case"days":case"day":case"d":return p*i;case"hours":case"hour":case"hrs":case"hr":case"h":return p*r;case"minutes":case"minute":case"mins":case"min":case"m":return p*o;case"seconds":case"second":case"secs":case"sec":case"s":return p*n;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return p;default:return}}function l(u){var _=Math.abs(u);if(_>=i)return Math.round(u/i)+"d";if(_>=r)return Math.round(u/r)+"h";if(_>=o)return Math.round(u/o)+"m";if(_>=n)return Math.round(u/n)+"s";return u+"ms"}function h(u){var _=Math.abs(u);if(_>=i)return d(u,_,i,"day");if(_>=r)return d(u,_,r,"hour");if(_>=o)return d(u,_,o,"minute");if(_>=n)return d(u,_,n,"second");return u+" ms"}function d(u,_,p,m){var A=_>=p*1.5;return Math.round(u/p)+" "+m+(A?"s":"")}}}),NHi=At({"node_modules/debug/src/common.js"(e,t){function n(o){i.debug=i,i.default=i,i.coerce=d,i.disable=l,i.enable=a,i.enabled=h,i.humanize=DHi(),i.destroy=u,Object.keys(o).forEach((_)=>{i[_]=o[_]}),i.names=[],i.skips=[],i.formatters={};function r(_){let p=0;for(let m=0;m<_.length;m++)p=(p<<5)-p+_.charCodeAt(m),p|=0;return i.colors[Math.abs(p)%i.colors.length]}i.selectColor=r;function i(_){let p,m=null,A,g;function f(...y){if(!f.enabled)return;let x=f,C=Number(new Date),b=C-(p||C);if(x.diff=b,x.prev=p,x.curr=C,p=C,y[0]=i.coerce(y[0]),typeof y[0]!=="string")y.unshift("%O");let I=0;y[0]=y[0].replace(/%([a-zA-Z%])/g,(P,M)=>{if(P==="%%")return"%";I++;let B=i.formatters[M];if(typeof B==="function"){let T=y[I];P=B.call(x,T),y.splice(I,1),I--}return P}),i.formatArgs.call(x,y),(x.log||i.log).apply(x,y)}if(f.namespace=_,f.useColors=i.useColors(),f.color=i.selectColor(_),f.extend=s,f.destroy=i.destroy,Object.defineProperty(f,"enabled",{enumerable:!0,configurable:!1,get:()=>{if(m!==null)return m;if(A!==i.namespaces)A=i.namespaces,g=i.enabled(_);return g},set:(y)=>{m=y}}),typeof i.init==="function")i.init(f);return f}function s(_,p){let m=i(this.namespace+(typeof p>"u"?":":p)+_);return m.log=this.log,m}function a(_){i.save(_),i.namespaces=_,i.names=[],i.skips=[];let p=(typeof _==="string"?_:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(let m of p)if(m[0]==="-")i.skips.push(m.slice(1));else i.names.push(m)}function c(_,p){let m=0,A=0,g=-1,f=0;while(m<_.length)if(A<p.length&&(p[A]===_[m]||p[A]==="*"))if(p[A]==="*")g=A,f=m,A++;else m++,A++;else if(g!==-1)A=g+1,f++,m=f;else return!1;while(A<p.length&&p[A]==="*")A++;return A===p.length}function l(){let _=[...i.names,...i.skips.map((p)=>"-"+p)].join(",");return i.enable(""),_}function h(_){for(let p of i.skips)if(c(_,p))return!1;for(let p of i.names)if(c(_,p))return!0;return!1}function d(_){if(_ instanceof Error)return _.stack||_.message;return _}function u(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return i.enable(i.load()),i}t.exports=n}}),RHi=At({"node_modules/debug/src/browser.js"(e,t){e.formatArgs=o,e.save=r,e.load=i,e.useColors=n,e.storage=s(),e.destroy=(()=>{let c=!1;return()=>{if(!c)c=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}})(),e.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function n(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let c;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(c=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(c[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function o(c){if(c[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+c[0]+(this.useColors?"%c ":" ")+"+"+t.exports.humanize(this.diff),!this.useColors)return;let l="color: "+this.color;c.splice(1,0,l,"color: inherit");let h=0,d=0;c[0].replace(/%[a-zA-Z%]/g,(u)=>{if(u==="%%")return;if(h++,u==="%c")d=h}),c.splice(d,0,l)}e.log=console.debug||console.log||(()=>{});function r(c){try{if(c)e.storage.setItem("debug",c);else e.storage.removeItem("debug")}catch(l){}}function i(){let c;try{c=e.storage.getItem("debug")||e.storage.getItem("DEBUG")}catch(l){}if(!c&&typeof process<"u"&&"env"in process)c=process.env.DEBUG;return c}function s(){try{return localStorage}catch(c){}}t.exports=NHi()(e);var{formatters:a}=t.exports;a.j=function(c){try{return JSON.stringify(c)}catch(l){return"[UnexpectedJSONParseError]: "+l.message}}}}),m0t=nte.createContext(null),I_=()=>{let e=nte.useContext(m0t);if(!e)throw Error("useThree must be used within a ThreeProvider");return e},Rpe=(e,t=[])=>{let{addFrameListener:n,removeFrameListener:o}=I_();nte.default.useEffect(()=>(n(e),()=>o(e)),[n,o,...t])},_0t=IP.createContext(null),QHi=()=>{let e=IP.useContext(_0t),t=I_();return IP.useEffect(()=>{if(!e)return;return e.current=t,()=>{e.current=null}},[e,t]),null},kHi=({cadComponent:e,children:t})=>{let n=I_(),o=IP.useMemo(()=>new dc,[]);o.userData.cad_component_id=e.cad_component_id,o.userData.pcb_component_id=e.pcb_component_id,IP.useEffect(()=>(n.rootObject.add(o),()=>{n.rootObject.remove(o)}),[n.rootObject,o]);let r=IP.useMemo(()=>({...n,rootObject:o}),[n,o]);return f$n.jsx(m0t.Provider,{value:r,children:t})},y$n=(e,t)=>{if(!e)return;let{camera:n,rootObject:o,renderer:r}=e,i=r.domElement.getBoundingClientRect();if(!i.width||!i.height)return;if(t.x<i.left||t.x>i.right||t.y<i.top||t.y>i.bottom)return;let s=new Kie;n.updateWorldMatrix(!0,!1),o.updateWorldMatrix(!0,!0),s.setFromCamera(new go((t.x-i.left)/i.width*2-1,-((t.y-i.top)/i.height)*2+1),n);for(let a of s.intersectObject(o,!0)){if(!(a.object instanceof Qo))continue;let c=a.object,l=!0;while(c){if(!c.visible)l=!1;c=c.parent}if(l)return a.object}},LHi=(e,t,n)=>{let o=y$n(e,t)??null,r;while(o)r??=o.userData.pcb_component_id,o=o.parent;if(!r)return;let i=n.find((a)=>a.type==="pcb_component"&&a.pcb_component_id===r);if(i?.type!=="pcb_component")return;let s=n.find((a)=>a.type==="source_component"&&a.source_component_id===i.source_component_id);if(s?.type!=="source_component")return;return{source_component_id:s.source_component_id,pcb_component_id:i.pcb_component_id,refdes:s.name}};function x$n(e,t){return t??e.some((n)=>n.type==="cad_component"&&n.is_on_folded_board===!0)}var HHi=(e,t,n)=>{let o=y$n(e,t)??null;while(o){let r=o.userData.cad_component_id;if(r){let i=n.find((a)=>a.type==="cad_component"&&a.cad_component_id===r);if(i?.type!=="cad_component")return;let s=n.find((a)=>a.type==="source_component"&&a.source_component_id===i.source_component_id);return{cad_component_id:i.cad_component_id,componentName:s?.type==="source_component"?s.name:i.cad_component_id}}o=o.parent}},HPe=new Set,FHi=(e)=>{let[t,n]=C$n.useState({circuitKey:e,ids:HPe}),o=t.circuitKey===e?t.ids:HPe;if(t.circuitKey!==e)n({circuitKey:e,ids:HPe});return{hiddenCadComponentIds:o,hideComponent:(r)=>{n((i)=>({circuitKey:e,ids:new Set([...i.circuitKey===e?i.ids:[],r])}))},unhideAllComponents:()=>{n({circuitKey:e,ids:HPe})}}};function ppe(e,t,n){let o=typeof window<"u"?window.TSCIRCUIT_JSCDN_BASE_URL:void 0;if(!o)return`https://cdn.jsdelivr.net/npm/${e}@${t}/${n}`;return new URL(`${o.replace(/\/+$/,"")}/${e}/${t}/${n}`,window.location.href).href}var SUn=!1;function zHi(){if(SUn||typeof window>"u"||!window.TSCIRCUIT_JSCDN_BASE_URL)return;mMt({defaultFontURL:ppe("three","0.165.0","examples/fonts/ttf/kenpixel.ttf"),unicodeFontsURL:ppe("troika-three-text","0.52.5","unicode-fonts/")}),SUn=!0}var g0t=(e)=>b$n.useMemo(()=>{if(!e)return[];let t=new aPn;return t.add(e),t.render(),t.getCircuitJson()},[e]),OHi=(e,t)=>{let n=e.pcb_component_id?t.find((o)=>o.type==="pcb_component"&&o.pcb_component_id===e.pcb_component_id):void 0;return{pcbComponent:n,layer:e.layer??n?.layer??"top",isThroughHole:Boolean(n&&t.some((o)=>o.type==="pcb_plated_hole"&&o.pcb_component_id===n.pcb_component_id))}},Idt=["translucent","opaque","hidden"],VHi=(e)=>Idt[(Idt.indexOf(e)+1)%Idt.length],PUn={boardBody:!0,topCopper:!0,bottomCopper:!0,keepout:!0,adhesive:!1,solderPaste:!1,topSilkscreen:!0,bottomSilkscreen:!0,topMask:!0,bottomMask:!0,throughHoleModels:!0,smtModels:!0,translucentModels:!0,modelsNotInPosFile:!1,modelsMarkedDNP:!1,modelBoundingBoxes:!1,threedAxis:!1,pcbNotes:!1,backgroundStart:!0,backgroundEnd:!0,enclosure:"translucent"},v$n=q9.createContext(void 0),YHi=({children:e})=>{let[t,n]=q9.useState(PUn),o=q9.useCallback((s,a)=>{n((c)=>({...c,[s]:a}))},[]),r=q9.useCallback(()=>{n(PUn)},[]),i=q9.useMemo(()=>({visibility:t,setLayerVisibility:o,resetToDefaults:r}),[t,o,r]);return I$n.jsx(v$n.Provider,{value:i,children:e})},NG=()=>{let e=q9.useContext(v$n);if(!e)throw Error("useLayerVisibility must be used within a LayerVisibilityProvider");return e},vdt=1.2;function P$n(e){return S$n.useMemo(()=>{if(!e)return vdt;try{return Ho(e).pcb_board.list()[0]?.thickness??vdt}catch(t){return vdt}},[e])}var Qpe={clickToInteractOverlay:100,htmlElements:95,orientationCube:95,contextMenu:110,appearanceMenu:111},M$n=({children:e,position:t,style:n})=>{let{camera:o,renderer:r}=I_(),i=ote.useRef(document.createElement("div")),[s,a]=ote.useState(null);return ote.useEffect(()=>{let c=r?.domElement.parentNode;if(!c)return;if(c.style.position!=="relative"&&c.style.position!=="absolute")c.style.position="relative";return c.appendChild(i.current),a(E$n.default.createPortal(e,i.current)),()=>{if(c.contains(i.current))c.removeChild(i.current)}},[r,e]),Rpe(()=>{if(!o||!i.current||!r)return;let c=new Dt(...t);c.project(o);let l=r.domElement.getBoundingClientRect(),h=Math.round((c.x+1)/2*l.width),d=Math.round((-c.y+1)/2*l.height);if(i.current.style.position="absolute",i.current.style.left=`${h}px`,i.current.style.top=`${d}px`,i.current.style.pointerEvents="none",i.current.style.zIndex=Qpe.htmlElements.toString(),n)Object.assign(i.current.style,n)},[o,r,t,n]),s},GHi=Ll(KEe(),1),T$n=x_.createContext(null),UHi=()=>{let e=x_.useContext(T$n);if(!e)throw Error("useHover must be used within a HoverProvider");return e},WHi=({children:e})=>{let{camera:t,renderer:n}=I_(),[o,r]=x_.useState([]),i=x_.useMemo(()=>new Kie,[]),s=x_.useMemo(()=>new go,[]),a=x_.useRef(o);a.current=o;let c=x_.useRef(null),l=x_.useCallback((p)=>{r((m)=>[...m,p])},[]),h=x_.useCallback((p)=>{if(c.current){let m=!1,A=c.current.object;while(A){if(A===p){m=!0;break}A=A.parent}if(m)c.current.onUnhover(),c.current=null}r((m)=>m.filter((A)=>A.object!==p))},[]),d=x_.useCallback((p)=>{let m=p;while(m){let A=a.current.find((g)=>g.object===m);if(A)return A;m=m.parent}return},[]),u=x_.useCallback((p)=>{if(!n.domElement)return;let m=n.domElement.getBoundingClientRect();s.x=(p.clientX-m.left)/m.width*2-1,s.y=-((p.clientY-m.top)/m.height)*2+1,i.setFromCamera(s,t);let A=a.current.map((f)=>f.object);if(A.length===0){if(c.current)c.current.onUnhover(),c.current=null;return}let g=i.intersectObjects(A,!0);if(g.length>0){let f=g[0],y=d(f.object);if(y){let x={mousePosition:[f.point.x,f.point.y,f.point.z]};if(c.current!==y)c.current?.onUnhover(),y.onHover(x),c.current=y;else y.onHover(x)}else if(c.current)c.current.onUnhover(),c.current=null}else if(c.current)c.current.onUnhover(),c.current=null},[t,n,i,s,d]);x_.useEffect(()=>{let p=n.domElement;return p.addEventListener("mousemove",u),()=>{p.removeEventListener("mousemove",u)}},[n,u]);let _=x_.useMemo(()=>({addHoverable:l,removeHoverable:h}),[l,h]);return B$n.jsx(T$n.Provider,{value:_,children:e})},XHi=({children:e,object:t,onHover:n,onUnhover:o,isHovered:r})=>{let{addHoverable:i,removeHoverable:s}=UHi();return w$n.useEffect(()=>{if(!t)return;return i({object:t,onHover:n,onUnhover:o}),()=>{s(t)}},[t,n,o,i,s]),JEe.jsx(JEe.Fragment,{children:e})},kpe=XHi,f3=(e,{castShadow:t=!0,receiveShadow:n=!0}={})=>{e.traverse((o)=>{if(!(o instanceof Qo))return;o.castShadow=t,o.receiveShadow=n})},jHi=({positionOffset:e,footprint:t,rotationOffset:n,onHover:o,onUnhover:r,isHovered:i,scale:s,isTranslucent:a=!1})=>{let{rootObject:c}=I_(),l=Uee.useMemo(()=>{if(!t)return null;let{geometries:h}=Fht(t,GHi),d=new dc;for(let u of h.flat(1/0)){let _=u.geom;if(!_||!_.polygons&&!_.sides)continue;let p=new Do(u.color);p.convertLinearToSRGB();let m={..._,color:[p.r,p.g,p.b]},A=k0e(m),g=new Ls({vertexColors:!0,side:A0,transparent:a,opacity:a?0.5:1,depthWrite:!a}),f=new Qo(A,g);f.renderOrder=a?2:1,f3(f,{castShadow:!a,receiveShadow:!0}),d.add(f)}return d},[t,a]);if(Uee.useEffect(()=>{if(!l||!c)return;return c.add(l),()=>{c.remove(l)}},[c,l]),Uee.useEffect(()=>{if(!l)return;if(e)l.position.fromArray(e);if(n)l.rotation.fromArray(n);if(s!==void 0)l.scale.setScalar(s)},[l,e?.[0],e?.[1],e?.[2],n?.[0],n?.[1],n?.[2],s]),Uee.useEffect(()=>{if(!l)return;l.traverse((h)=>{if(h instanceof Qo&&h.material instanceof Ls)if(i)h.material.emissive.setHex(255),h.material.emissiveIntensity=0.2;else h.material.emissiveIntensity=0})},[i,l]),!l)return null;return D$n.jsx(kpe,{isHovered:i,onHover:o,onUnhover:r,object:l})},EUn=new WeakMap,KHi=()=>{let e=new Bl;return e.name="fallback-environment-map",e.mapping=oEt,e},$Hi=(e)=>{if(!e)return null;let t=e,n=EUn.get(t);if(n)return n;let o;if(e instanceof zM){let r=new Rie(e);o=r.fromScene(Ght(),0.04).texture,r.dispose()}else o=KHi();return EUn.set(t,o),o};function qHi(e){let t=new dm,n=!1;e.updateWorldMatrix(!0,!1);let o=e.parent?e.parent.matrixWorld.clone().invert():new Fi;return e.traverse((r)=>{if(r.updateWorldMatrix(!0,!1),r instanceof Qo&&r.geometry){if(!r.geometry.boundingBox)r.geometry.computeBoundingBox();if(r.geometry.boundingBox){let i=o.clone().multiply(r.matrixWorld),s=r.geometry.boundingBox.clone();if(s.applyMatrix4(i),!n)t.copy(s),n=!0;else t.union(s)}}}),n?t:null}function JHi(e){let t=qHi(e);if(!t)return new Dt;return t.getSize(new Dt)}function ZHi(e,t,n="contain_within_bounds"){if(!t)return[1,1,1];let o=JHi(e),r=[o.x>0?t[0]/o.x:1,o.y>0?t[1]/o.y:1,o.z>0?t[2]/o.z:1];if(n==="fill_bounds")return r;let i=Math.min(...r);return[i,i,i]}var A0t=({model:e,position:t,rotation:n,modelOffset:o=[0,0,0],modelRotation:r=[0,0,0],sourceCoordinateTransform:i,modelSize:s,modelFitMode:a="contain_within_bounds",scale:c})=>{let{rootObject:l}=I_(),h=g3.useMemo(()=>new dc,[]),d=g3.useMemo(()=>new dc,[]),u=g3.useMemo(()=>new dc,[]),_=g3.useMemo(()=>new dc,[]);return g3.useEffect(()=>(h.add(d),()=>{h.remove(d)}),[h,d]),g3.useEffect(()=>(d.add(u),()=>{d.remove(u)}),[d,u]),g3.useEffect(()=>(u.add(_),()=>{u.remove(_)}),[u,_]),g3.useEffect(()=>{while(_.children.length>0){let p=_.children[0];if(!p)break;_.remove(p)}if(e)_.add(e)},[_,e]),g3.useEffect(()=>{if(!i){_.matrixAutoUpdate=!0,_.position.set(0,0,0),_.rotation.set(0,0,0),_.scale.set(1,1,1),_.updateMatrix();return}_.matrixAutoUpdate=!1,_.matrix.copy(i),_.matrixWorldNeedsUpdate=!0},[_,i]),g3.useEffect(()=>{if(!l)return;return l.add(h),()=>{l.remove(h)}},[l,h]),g3.useEffect(()=>{if(t)h.position.fromArray(t);else h.position.set(0,0,0);if(n)h.rotation.fromArray(n);else h.rotation.set(0,0,0);if(u.position.fromArray(o),u.rotation.fromArray(r),u.scale.setScalar(c??1),!e){d.scale.set(1,1,1);return}d.scale.set(1,1,1),d.updateWorldMatrix(!0,!0);let p=ZHi(u,s,a);d.scale.set(p[0],p[1],p[2])},[h,d,e,a,o,_,u,r,s,t,n,c]),{boardTransformGroup:h}},MUn=1.25;function R$n({gltfUrl:e,position:t,rotation:n,modelOffset:o=[0,0,0],modelRotation:r=[0,0,0],sourceCoordinateTransform:i,modelSize:s,modelFitMode:a="contain_within_bounds",onHover:c,onUnhover:l,isHovered:h,scale:d,isTranslucent:u=!1}){let{renderer:_}=I_(),[p,m]=IG.useState(null),[A,g]=IG.useState(null),{boardTransformGroup:f}=A0t({model:p,position:t,rotation:n,modelOffset:o,modelRotation:r,sourceCoordinateTransform:i,modelSize:s,modelFitMode:a,scale:d});if(IG.useEffect(()=>{if(!e)return;let y=new APe,x=!0;return y.load(e,(C)=>{if(!x)return;let b=C.scene;b.traverse((I)=>{if(I instanceof Qo&&I.material){let v=(P)=>{P.transparent=u,P.opacity=u?0.5:1,P.depthWrite=!u,P.needsUpdate=!0};if(Array.isArray(I.material))I.material.forEach(v);else v(I.material);I.renderOrder=u?2:1}}),f3(b,{castShadow:!u,receiveShadow:!0}),m(b)},void 0,(C)=>{if(!x)return;console.error(`An error happened loading ${e}`,C);let b=C instanceof Error?C:Error(`Failed to load glTF model from ${e}`);g(b)}),()=>{x=!1}},[e,u]),IG.useEffect(()=>{if(!p||!_)return;let y=$Hi(_);if(!y)return;let x=[],C=(b)=>{if(!(b instanceof Ls))return;if(x.push({material:b,envMap:b.envMap??null,envMapIntensity:b.envMapIntensity??1}),b.envMap=y,typeof b.envMapIntensity!=="number"||b.envMapIntensity<MUn)b.envMapIntensity=MUn;b.needsUpdate=!0};return p.traverse((b)=>{if(!(b instanceof Qo))return;let I=b.material;if(Array.isArray(I))I.forEach(C);else if(I)C(I)}),()=>{x.forEach(({material:b,envMap:I,envMapIntensity:v})=>{b.envMap=I,b.envMapIntensity=v,b.needsUpdate=!0})}},[p,_]),IG.useEffect(()=>{if(!p)return;p.traverse((y)=>{if(!(y instanceof Qo))return;let x=Array.isArray(y.material)?y.material:[y.material];for(let C of x){if(!(C instanceof Ls))continue;if(h)C.emissive.setHex(255),C.emissiveIntensity=0.2;else C.emissiveIntensity=0}})},[h,p]),A)throw A;if(!p)return null;return N$n.jsx(kpe,{isHovered:h,onHover:c,onUnhover:l,object:f})}var eFi=Ll(A$n(),1),tFi=Ll(KEe(),1),nFi=({jscadPlan:e,positionOffset:t,rotationOffset:n,modelOffset:o=[0,0,0],modelRotation:r=[0,0,0],sourceCoordinateTransform:i,modelSize:s,modelFitMode:a="contain_within_bounds",onHover:c,onUnhover:l,isHovered:h,scale:d,isTranslucent:u=!1})=>{let[_,p]=Wee.useState(null);Wee.useEffect(()=>{let g=(0,eFi.executeJscadOperations)(tFi.default,e);if(!g||!g.polygons&&!g.sides){p(null);return}let f=k0e(g),y=new Ls({vertexColors:!0,side:A0}),x=new Qo(f,y);return p(x),()=>{f.dispose(),y.dispose()}},[e]),Wee.useEffect(()=>{if(!_)return;let g=_.material;g.transparent=u,g.opacity=u?0.5:1,g.depthWrite=!u,g.needsUpdate=!0,_.renderOrder=u?2:1,f3(_,{castShadow:!u,receiveShadow:!0})},[_,u]);let m=_?.material,{boardTransformGroup:A}=A0t({model:_,position:t,rotation:n,modelOffset:o,modelRotation:r,sourceCoordinateTransform:i,modelSize:s,modelFitMode:a,scale:d});if(Wee.useEffect(()=>{if(!m)return;if(h){let g=new Do(m.color.getHex());m.emissive.copy(g),m.emissive.setRGB(0,0,1),m.emissiveIntensity=0.2}else m.emissiveIntensity=0},[h,m]),!_)return null;return Q$n.jsx(kpe,{isHovered:h,onHover:c,onUnhover:l,object:A})};function oFi(e){return e.replace(/(DEF|USE)\s+([^\s]+)/g,(t,n,o)=>`${n} ${o.replace(/-/g,"_")}`)}async function rFi(e){let t=await fetch(e);if(!t.ok)throw Error(`Failed to fetch "${e}": ${t.status} ${t.statusText}`);let n=await t.text();return new gPe().parse(oFi(n),e)}if(typeof window<"u"&&!window.TSCIRCUIT_OBJ_LOADER_CACHE)window.TSCIRCUIT_OBJ_LOADER_CACHE=new Map;function iFi(e){let[t,n]=ZEe.useState(null);return ZEe.useEffect(()=>{if(!e)return;let o=e.replace(/&cachebust_origin=$/,""),r=window.TSCIRCUIT_OBJ_LOADER_CACHE,i=!1;async function s(){try{if(o.endsWith(".wrl"))return await rFi(o);let c=await fetch(o);if(!c.ok)throw Error(`Failed to fetch "${o}": ${c.status} ${c.statusText}`);let l=await c.text(),h=l.match(/newmtl[\s\S]*?endmtl/g),d=new fPe;if(h?.length){let u=h.join(`
`).replace(/^d\s+0\./gm,"d 1."),_=l.replace(/newmtl[\s\S]*?endmtl/g,"").replace(/^mtllib.*/gm,""),p=new _Pe;p.setMaterialOptions({invertTrProperty:!0});let m=p.parse(u,"embedded.mtl");return d.setMaterials(m),d.parse(_)}return d.parse(l.replace(/^mtllib.*/gm,""))}catch(c){return c}}function a(){if(r.has(o)){let l=r.get(o);if(l.result)return Promise.resolve(l.result.clone());return l.promise.then((h)=>{if(h instanceof Error)return h;return h.clone()})}let c=s().then((l)=>{if(l instanceof Error)return l;return r.set(o,{...r.get(o),result:l}),l});return r.set(o,{promise:c,result:null}),c}return a().then((c)=>{if(i)return;n(c)}).catch((c)=>{console.error(c)}),()=>{i=!0}},[e]),t}function sFi({url:e,position:t,rotation:n,modelOffset:o=[0,0,0],modelRotation:r=[0,0,0],sourceCoordinateTransform:i,modelSize:s,modelFitMode:a="contain_within_bounds",onHover:c,onUnhover:l,isHovered:h,scale:d,isTranslucent:u=!1}){let _=iFi(e),p=k$n.useMemo(()=>{if(_&&!(_ instanceof Error))return _.traverse((g)=>{if(g instanceof Qo&&g.material){let f=(y)=>{y.transparent=u,y.opacity=u?0.5:1,y.depthWrite=!u,y.needsUpdate=!0};if(Array.isArray(g.material))g.material.forEach(f);else f(g.material);g.renderOrder=u?2:1}}),f3(_,{castShadow:!u,receiveShadow:!0}),_;let A=new Qo(new qm(0.5,0.5,0.5),new Ls({transparent:!0,color:"red",opacity:0.25}));return f3(A,{castShadow:!1,receiveShadow:!0}),A},[_,u]),{boardTransformGroup:m}=A0t({model:p,position:Array.isArray(t)?t:t?[t.x,t.y,t.z]:void 0,rotation:Array.isArray(n)?n:n?[n.x,n.y,n.z]:void 0,modelOffset:o,modelRotation:r,sourceCoordinateTransform:i,modelSize:s,modelFitMode:a,scale:d});if(_ instanceof Error)throw _;return L$n.jsx(kpe,{isHovered:h,onHover:c,onUnhover:l,object:m})}var aFi=new Do(0.82,0.82,0.82),wUn=(e)=>new Ls({color:e?new Do(e[0],e[1],e[2]):aFi});function cFi(e,t){let n=wUn(t.color),o=t.brep_faces??[];if(o.length===0)return[n];let r=o.length>1?[...o].sort((d,u)=>d.first-u.first):o,i=[n],s=new Map,a=t.index.array.length/3,c=0,l=0,h=(d)=>{if(!d)return 0;let u=d.join(","),_=s.get(u);if(_!==void 0)return _;let p=i.length;return i.push(wUn(d)),s.set(u,p),p};while(c<a){let d=r[l],u=a,_=0;if(d)if(c<d.first)u=d.first;else u=d.last+1,_=h(d.color),l+=1;if(u>c)e.addGroup(c*3,(u-c)*3,_);c=u}return i}function lFi(e){let t=new dc;for(let n of e){let o=n.attributes.position?.array??[],r=n.index?.array??[];if(!o.length||!r.length)continue;let i=new ha;i.setAttribute("position",new jr(o,3));let s=n.attributes.normal?.array??[];if(s.length)i.setAttribute("normal",new jr(s,3));else i.computeVertexNormals();i.setIndex(r),i.clearGroups();let a=cFi(i,n),c=new Qo(i,a.length>1?a:a[0]);c.name=n.name,t.add(c)}return t}var FPe;function hFi(e){if(typeof e==="function")return e;if(e&&typeof e==="object"&&"default"in e&&typeof e.default==="function")return e.default;throw Error("Unable to resolve occt-import-js factory export")}async function dFi(){if(!FPe)FPe=(async()=>{let e=await import(ppe("occt-import-js","0.0.23","+esm"));return hFi(e)({locateFile:(n)=>ppe("occt-import-js","0.0.23",`dist/${n}`)})})().catch((e)=>{throw FPe=void 0,e});return FPe}async function uFi(e){let t=await fetch(e);if(!t.ok)throw Error(`Failed to fetch STEP file: ${t.statusText}`);let n=await t.arrayBuffer(),r=(await dFi()).ReadStepFile(new Uint8Array(n),null);if(!r.success||!r.meshes.length)throw Error("occt-import-js failed to convert STEP file");let i=lFi(r.meshes),s=new Mee;return await new Promise((c,l)=>{s.parse(i,(h)=>{if(h instanceof ArrayBuffer)c(h);else l(Error("GLTFExporter did not return binary output"))},(h)=>{l(h)},{binary:!0})})}var F$n="step-glb-cache:v2:";function pFi(e){let t=new Uint8Array(e),n=32768,o="";for(let r=0;r<t.length;r+=32768){let i=t.subarray(r,r+32768);o+=String.fromCharCode(...i)}return btoa(o)}function mFi(e){let t=atob(e),n=new Uint8Array(t.length);for(let o=0;o<t.length;o+=1)n[o]=t.charCodeAt(o);return n.buffer}function _Fi(e){try{let t=localStorage.getItem(`${F$n}${e}`);if(!t)return null;return mFi(t)}catch(t){return console.warn("Failed to read STEP GLB cache",t),null}}function BUn(e,t){try{let n=pFi(t);localStorage.setItem(`${F$n}${e}`,n)}catch(n){console.warn("Failed to write STEP GLB cache",n)}}function gFi(){let e=globalThis;if(!e.stepUrlToGltfModelConversions)e.stepUrlToGltfModelConversions={inProgress:new Map,completed:new Map};return e.stepUrlToGltfModelConversions}var AFi=({stepUrl:e,position:t,rotation:n,modelOffset:o,modelRotation:r,sourceCoordinateTransform:i,modelSize:s,modelFitMode:a,scale:c,onHover:l,onUnhover:h,isHovered:d,isTranslucent:u})=>{let[_,p]=eMe.useState(null);if(eMe.useEffect(()=>{let m=!0,A=null,g=!0,f=gFi(),y=_Fi(e);if(y){let b={arrayBuffer:y,blobUrl:URL.createObjectURL(new Blob([y],{type:"model/gltf-binary"}))};return f.completed.set(e,b),A=b.blobUrl,g=!1,p(b.blobUrl),()=>{if(m=!1,A&&g)URL.revokeObjectURL(A)}}let x=f.completed.get(e);if(x)return A=x.blobUrl,g=!1,p(x.blobUrl),BUn(e,x.arrayBuffer),()=>{if(m=!1,A&&g)URL.revokeObjectURL(A)};let C=f.inProgress.get(e);if(!C)C=uFi(e).then((b)=>{let I={arrayBuffer:b,blobUrl:URL.createObjectURL(new Blob([b],{type:"model/gltf-binary"}))};return f.completed.set(e,I),f.inProgress.delete(e),I}).catch((b)=>{throw f.inProgress.delete(e),b}),f.inProgress.set(e,C);return C.then((b)=>{if(!m)return;A=b.blobUrl,g=!1,p(b.blobUrl),BUn(e,b.arrayBuffer)}).catch((b)=>{if(console.error("Failed to convert STEP file to GLB",b),m)p(null)}),()=>{if(m=!1,A&&g)URL.revokeObjectURL(A)}},[e]),!_)return null;return H$n.jsx(R$n,{gltfUrl:_,position:t,rotation:n,modelOffset:o,modelRotation:r,sourceCoordinateTransform:i,modelSize:s,modelFitMode:a,scale:c,onHover:l,onUnhover:h,isHovered:d,isTranslucent:u})};function iEe(e,t){let{x:n,y:o,z:r}=e;if(t.axisMapping){let i={x:n,y:o,z:r};if(t.axisMapping.x)n=Sdt(i,t.axisMapping.x);if(t.axisMapping.y)o=Sdt(i,t.axisMapping.y);if(t.axisMapping.z)r=Sdt(i,t.axisMapping.z)}if(n*=t.flipX??1,o*=t.flipY??1,r*=t.flipZ??1,t.rotation){if(t.rotation.x){let i=t.rotation.x*Math.PI/180,s=Math.cos(i),a=Math.sin(i),c=o*s-r*a,l=o*a+r*s;o=c,r=l}if(t.rotation.y){let i=t.rotation.y*Math.PI/180,s=Math.cos(i),a=Math.sin(i),c=n*s+r*a,l=-n*a+r*s;n=c,r=l}if(t.rotation.z){let i=t.rotation.z*Math.PI/180,s=Math.cos(i),a=Math.sin(i),c=n*s-o*a,l=n*a+o*s;n=c,o=l}}return{x:n,y:o,z:r}}function Sdt(e,t){switch(t){case"x":return e.x;case"y":return e.y;case"z":return e.z;case"-x":return-e.x;case"-y":return-e.y;case"-z":return-e.z;default:return 0}}var Pdt={Z_UP_TO_Y_UP:{axisMapping:{x:"x",y:"-z",z:"y"}},Z_OUT_OF_TOP:{axisMapping:{x:"x",y:"z",z:"-y"}},STEP_INVERTED:{axisMapping:{x:"-x",y:"z",z:"-y"}},USB_PORT_FIX:{flipY:-1},Z_UP_TO_Y_UP_USB_FIX:{axisMapping:{x:"x",y:"-z",z:"y"},flipZ:-1},FOOTPRINTER_MODEL_TRANSFORM:{axisMapping:{x:"x",y:"-z",z:"y"},flipX:-1,rotation:{x:180,y:180}},IDENTITY:{},TEST_ROTATE_X_90:{axisMapping:{x:"x",y:"-z",z:"y"},rotation:{x:90}},TEST_ROTATE_X_270:{axisMapping:{x:"x",y:"-z",z:"y"},rotation:{x:270}},TEST_ROTATE_Y_90:{axisMapping:{x:"x",y:"-z",z:"y"},rotation:{y:90}},TEST_ROTATE_Y_270:{axisMapping:{x:"x",y:"-z",z:"y"},rotation:{y:270}},TEST_ROTATE_Z_90:{axisMapping:{x:"x",y:"-z",z:"y"},rotation:{z:90}},TEST_ROTATE_Z_270:{axisMapping:{x:"x",y:"-z",z:"y"},rotation:{z:270}},TEST_FLIP_X:{axisMapping:{x:"x",y:"-z",z:"y"},flipX:-1},TEST_FLIP_Z:{axisMapping:{x:"x",y:"-z",z:"y"},flipZ:-1},OBJ_Z_UP_TO_Y_UP:{axisMapping:{x:"x",y:"z",z:"y"}}};function fFi(e,t){if(t.coordinateTransform)return t.coordinateTransform;if(t.usingGlbCoordinates)return;if(t.hasFootprinterModel)return Pdt.FOOTPRINTER_MODEL_TRANSFORM;if(t.usingObjFormat)return;if(t.usingStepFormat)return Pdt.STEP_INVERTED;return Pdt.Z_UP_TO_Y_UP_USB_FIX}function hpe(e,t){return fFi(e,{usingGlbCoordinates:t==="gltf"||t==="glb"||t==="jscad",usingObjFormat:t==="obj"||t==="wrl",usingStepFormat:t==="step",hasFootprinterModel:t==="footprinter"})}function zPe(e){if(!e)return;let t=iEe({x:1,y:0,z:0},e),n=iEe({x:0,y:1,z:0},e),o=iEe({x:0,y:0,z:1},e);return new Fi().makeBasis(new Dt(t.x,t.y,t.z),new Dt(n.x,n.y,n.z),new Dt(o.x,o.y,o.z))}function gL(e){return e*Math.PI/180}function yFi(e){if(e==="z+")return[0,0,0];switch(e){case"x+":return[0,gL(-90),0];case"x-":return[0,gL(90),0];case"y+":return[gL(90),0,0];case"y-":return[gL(-90),0,0];case"z-":return[gL(180),0,0];default:return[0,0,0]}}function xFi(e,t,n){if(!e.position)return;let o=e.position.z;if(!e.is_on_folded_board&&e.pcb_component_id&&t==="bottom"&&e.position.z>=0)o=-(e.position.z+n);return[e.position.x,e.position.y,o]}function CFi(e,t){if(!e.rotation)return t==="bottom"?[Math.PI,0,0]:[0,0,0];return[gL(e.rotation.x),gL(e.rotation.y),gL(e.rotation.z)]}function bFi(e,t){let n=new Dt(e.x,e.y,e.z),o=new aA(t[0],t[1],t[2],"XYZ");return n.applyEuler(o),[n.x,n.y,n.z]}function IFi(e,t,n){if(!e.model_origin_position)return[0,0,0];let o=t?iEe(e.model_origin_position,t):e.model_origin_position;return bFi(o,n)}function vFi(e,t){let n=xFi(e,t.layer,t.pcbThickness),o=CFi(e,t.layer),r=hpe(e,t.modelType),i=yFi(e.model_board_normal_direction??"z+"),s=IFi(e,r,i);return{position:n,rotation:o,modelPosition:[-s[0],-s[1],-s[2]],modelRotation:i,scale:e.model_unit_to_mm_scale_factor??void 0,fitMode:e.model_object_fit??"contain_within_bounds",size:e.size?[e.size.x,e.size.y,e.size.z]:void 0}}var SFi=(e)=>{if(e.model_glb_url||e.model_gltf_url)return e.model_glb_url?"glb":"gltf";if(e.model_obj_url||e.model_wrl_url||e.model_stl_url){if(e.model_wrl_url)return"wrl";if(e.model_stl_url)return"stl";return"obj"}if(e.model_jscad)return"jscad";if(e.footprinter_string)return"footprinter";if(e.model_step_url)return"step";return"unknown"},PFi=(e)=>e==="step"?"glb":e,EFi=(e,t)=>{if(!e.pcb_component_id||!e.model_jscad||e.model_origin_alignment!=="bottom_center_of_component")return!1;let n=t.find((o)=>o.type==="pcb_component"&&o.pcb_component_id===e.pcb_component_id);return Boolean(n&&n.do_not_place&&n.is_allowed_to_be_off_board&&n.obstructs_within_bounds===!1)},MFi=(e,t)=>{if(!e)return;return t?t(e):e},wFi=(...e)=>e,f0t=class extends z$n.default.Component{constructor(e){super(e);this.state={hasError:!1,error:null}}static getDerivedStateFromError(e){return{hasError:!0,error:e}}render(){if(this.state.hasError&&this.state.error)return this.props.fallback({error:this.state.error});return this.props.children}},BFi=({error:e,onError:t})=>(QA.useEffect(()=>{t(e)},[e,t]),null),O$n=({cad_component:e,circuitJson:t,resolveStaticAsset:n})=>{let o=P$n(t),[r,i]=QA.useState(!1),{visibility:s}=NG(),[a,c]=QA.useState(null),l=QA.useCallback((O)=>{if(O?.mousePosition)i(!0),c(O.mousePosition);else i(!1),c(null)},[]),h=QA.useCallback(()=>{i(!1),c(null)},[]),d=QA.useMemo(()=>Ho(t).source_component.getUsing({source_component_id:e.source_component_id})?.name,[t,e.source_component_id]),{pcbComponent:u,layer:_,isThroughHole:p}=QA.useMemo(()=>OHi(e,t),[e,t]),m=QA.useCallback((O)=>MFi(O,n),[n]),A=m(e.model_wrl_url??e.model_stl_url??e.model_obj_url),g=m(e.model_glb_url??e.model_gltf_url),f=m(e.model_step_url),[y,x]=QA.useState(0),[C,b]=QA.useState(null);QA.useEffect(()=>{x(0),b(null)},[e.cad_component_id,A,g,f]);let I=QA.useMemo(()=>EFi(e,t),[e,t]),v=I?s.enclosure==="translucent":Boolean(e.show_as_translucent_model),P=SFi(e),M=PFi(P),B=e.model_glb_url?"glb":"gltf",T=e.model_wrl_url?"wrl":e.model_stl_url?"stl":"obj",N=QA.useMemo(()=>vFi(e,{layer:_,pcbThickness:o,modelType:M}),[e,_,o,M]),D=wFi(...N.rotation),L=N.position,H=QA.useMemo(()=>{let O=[];if(g)O.push(g5.jsx(R$n,{gltfUrl:g,position:L,rotation:D,modelOffset:N.modelPosition,modelRotation:N.modelRotation,sourceCoordinateTransform:zPe(hpe(e,B)),scale:N.scale,modelSize:N.size,modelFitMode:N.fitMode,onHover:l,onUnhover:h,isHovered:r,isTranslucent:v},`${e.cad_component_id}-gltf-${g}`));if(A)O.push(g5.jsx(sFi,{url:A,position:L,rotation:D,modelOffset:N.modelPosition,modelRotation:N.modelRotation,sourceCoordinateTransform:zPe(hpe(e,T)),scale:N.scale,modelSize:N.size,modelFitMode:N.fitMode,onHover:l,onUnhover:h,isHovered:r,isTranslucent:v},`${e.cad_component_id}-mixed-${A}`));if(f&&!e.model_jscad&&!e.footprinter_string)O.push(g5.jsx(AFi,{stepUrl:f,position:L,rotation:D,modelOffset:N.modelPosition,modelRotation:N.modelRotation,sourceCoordinateTransform:zPe(hpe(e,M)),scale:N.scale,modelSize:N.size,modelFitMode:N.fitMode,onHover:l,onUnhover:h,isHovered:r,isTranslucent:v},`${e.cad_component_id}-step-${f}`));return O},[L,e.cad_component_id,e.footprinter_string,e.model_jscad,v,g,B,l,h,r,T,N.modelPosition,N.modelRotation,N.scale,N.fitMode,N.size,M,D,f,A]),V=null;if(H.length>0){if(y>=H.length){if(C)throw C;return null}V=g5.jsx(f0t,{fallback:({error:O})=>g5.jsx(BFi,{error:O,onError:(U)=>{b(U),x((j)=>Math.max(j,y+1))}}),children:H[y]},`${e.cad_component_id}-fallback-${y}`)}else if(e.model_jscad)V=g5.jsx(nFi,{jscadPlan:e.model_jscad,positionOffset:L,rotationOffset:D,modelOffset:N.modelPosition,modelRotation:N.modelRotation,sourceCoordinateTransform:zPe(hpe(e,"jscad")),scale:N.scale,modelSize:N.size,modelFitMode:N.fitMode,onHover:l,onUnhover:h,isHovered:r,isTranslucent:v},e.cad_component_id);else if(e.footprinter_string)V=g5.jsx(jHi,{positionOffset:L,rotationOffset:D,footprint:e.footprinter_string,scale:N.scale,onHover:l,onUnhover:h,isHovered:r,isTranslucent:v});if(I){if(s.enclosure==="hidden")return null}else if(e.show_as_translucent_model){if(!s.translucentModels)return null}else if(u){if(p&&!s.throughHoleModels)return null;if(!p&&!s.smtModels)return null}return g5.jsxs(g5.Fragment,{children:[g5.jsx(kHi,{cadComponent:e,children:V}),r&&a?g5.jsx(M$n,{position:a,style:{fontFamily:"sans-serif",transform:"translate3d(1rem, 1rem, 0)",backgroundColor:"white",padding:"5px",borderRadius:"3px",pointerEvents:"none",userSelect:"none",WebkitUserSelect:"none",MozUserSelect:"none",msUserSelect:"none"},children:d??"<unknown>"}):null]})},V$n={name:"@tscircuit/3d-viewer",version:"0.0.626",repository:{type:"git",url:"https://github.com/tscircuit/3d-viewer"},main:"./dist/index.js",module:"./dist/index.js",type:"module",exports:{".":{types:"./dist/index.d.ts",import:"./dist/index.js"}},files:["dist"],scripts:{start:"bun run storybook","dev:old":"bunx --bun vite",build:"tsup",prepublish:"npm run build",preview:"vite preview",storybook:"storybook dev -p 6006","build-storybook":"bun run prepare:renderer-comparisons && storybook build","vercel-build":"bun run build-storybook",format:"biome format . --write","format:check":"biome format .","test:node-bundle":"node ./scripts/load-bundle-in-node.js","prepare:renderer-comparisons":"bun scripts/prepare-renderer-comparisons.ts","storybook:comparisons":"bun run prepare:renderer-comparisons && bun run storybook --initial-path '/story/diagnostics-renderer-parity--x-rotation'","test:renderer-comparisons:serve":"bun run prepare:renderer-comparisons && vite --config playwright/vite.config.ts","test:renderer-calibration":"playwright test --project=calibration","test:renderer-comparisons":"bun scripts/run-renderer-comparisons.ts"},dependencies:{"@jscad/regl-renderer":"^2.6.12","@jscad/stl-serializer":"^2.1.20","@tscircuit/cableprinter":"^0.0.6","circuit-json":"^0.0.525","circuit-to-canvas":"^0.0.135","jscad-electronics":"^0.0.213","react-hot-toast":"^2.6.0",three:"^0.165.0","three-stdlib":"^2.36.0","troika-three-text":"^0.52.4"},peerDependencies:{zod:"*",react:"19.1.0","react-dom":"19.1.0","@tscircuit/core":"*","@tscircuit/circuit-json-util":"*"},devDependencies:{"@tscircuit/flex-utils":"https://jscdn.tscircuit.com/@tscircuit/flex-utils/0.0.5.tgz","@biomejs/biome":"^2.1.4","@chromatic-com/storybook":"^1.9.0","@jscad/modeling":"^2.12.5","@napi-rs/canvas":"^1.0.9","@playwright/test":"1.58.2","@radix-ui/react-dropdown-menu":"^2.1.16","@storybook/blocks":"9.0.0-alpha.17","@storybook/react-vite":"^9.1.5","@tscircuit/alphabet":"^0.0.25","@tscircuit/circuit-json-util":"^0.0.119","@tscircuit/copper-pour-solver":"^0.0.29","@tscircuit/core":"^0.0.2152","@tscircuit/props":"^0.0.701","@tscircuit/solver-utils":"^0.0.4","@types/debug":"^4.1.13","@types/jsdom":"^21.1.7","@types/react":"19","@types/react-dom":"19","@types/three":"^0.165.0","@vitejs/plugin-react":"^4.3.4","bun-match-svg":"^0.0.9","bun-types":"1.2.1",debug:"^4.4.0","jscad-planner":"^0.0.18",jsdom:"^26.0.0","manifold-3d":"3.5.1","react-use-gesture":"^9.1.3",semver:"^7.7.0","strip-ansi":"^7.1.0",tscircuit:"^0.0.2611",tsup:"^8.3.6",typescript:"^5.7.3",vite:"^7.1.5","vite-tsconfig-paths":"^4.3.2","circuit-json-to-gltf":"0.0.143",zod:"^3.25.67","@tscircuit/modelprinter":"^0.0.18"},engines:{node:"24.x"}},G$n="cadViewerLightingEnabled",TFi=()=>{if(typeof window>"u")return!0;return window.localStorage.getItem(G$n)!=="false"},U$n=jb.createContext(void 0),DFi=({children:e})=>{let[t,n]=jb.useState(!1),[o,r]=jb.useState(!1),[i,s]=jb.useState(TFi);jb.useEffect(()=>{window.localStorage.setItem(G$n,i?"true":"false")},[i]);let a=jb.useMemo(()=>({darkBackgroundEnabled:t,setDarkBackgroundEnabled:n,gridEnabled:o,setGridEnabled:r,lightingEnabled:i,setLightingEnabled:s}),[t,o,i]);return Y$n.jsx(U$n.Provider,{value:a,children:e})},y0t=()=>{let e=jb.useContext(U$n);if(!e)throw Error("useAppearance must be used within an AppearanceProvider");return e},TUn="cadViewerCameraStateSession";function W$n(e){if(!e)return TUn;return`${TUn}:${e}`}function NFi({camera:e,controls:t,cameraSessionScope:n}){try{let o={position:e.position.toArray(),quaternion:e.quaternion.toArray(),up:e.up.toArray(),fov:e instanceof wl?e.fov:50,target:t.target.toArray()};sessionStorage.setItem(W$n(n),JSON.stringify(o))}catch(o){console.warn("Failed to save camera:",o)}}function RFi({camera:e,controls:t,cameraSessionScope:n}){try{let o=sessionStorage.getItem(W$n(n));if(!o)return!1;let r=JSON.parse(o);if(e.position.fromArray(r.position),e.quaternion.fromArray(r.quaternion),e.up.fromArray(r.up),e instanceof wl)e.fov=r.fov,e.updateProjectionMatrix();return t.target.fromArray(r.target),t.update(),e.updateMatrixWorld(),!0}catch(o){return console.warn("Failed to restore camera:",o),!1}}function j$n(e){if("controls"in e)return e;return{controls:e}}var K$n=(e,t)=>{let{controls:n,cameraSessionScope:o}=j$n(t);NFi({camera:e,controls:n,cameraSessionScope:o})},$dt=(e,t)=>{let{controls:n,cameraSessionScope:o}=j$n(t);return RFi({camera:e,controls:n,cameraSessionScope:o})},$$n=kA.createContext(void 0),QFi=({children:e,defaultTarget:t,initialCameraPosition:n,initialCameraType:o})=>{let r=kA.useRef(null),i=kA.useRef(null),[s,a]=kA.useState(null),[c,l]=kA.useState(o??"perspective"),[h,d]=kA.useState(n??null),[u,_]=kA.useState(new aA(0,0,0)),p=kA.useMemo(()=>{let[f,y,x]=n??[5,-5,5],C=Math.hypot(f-t.x,y-t.y,x-t.z);return C>0?C:5},[n,t]),m=kA.useCallback((f)=>{let y=[t.x,t.y,t.z],x=i.current,C=r.current,b=p;if(x&&C)b=x.position.distanceTo(C.target);switch(f){case"Top Center Angled":{let I=b/Math.sqrt(2);return{position:[t.x,t.y-I,t.z+I],target:y,up:[0,0,1]}}case"Top Down":return{position:[t.x,t.y,t.z+b],target:y,up:[0,0,1]};case"Top Left Corner":return{position:[t.x-b*0.6,t.y-b*0.6,t.z+b*0.6],target:y,up:[0,0,1]};case"Top Right Corner":return{position:[t.x+b*0.6,t.y-b*0.6,t.z+b*0.6],target:y,up:[0,0,1]};case"Left Sideview":return{position:[t.x-b,t.y,t.z],target:y,up:[0,0,1]};case"Right Sideview":return{position:[t.x+b,t.y,t.z],target:y,up:[0,0,1]};case"Front":return{position:[t.x,t.y-b,t.z],target:y,up:[0,0,1]};case"Custom":default:return null}},[p,t,i,r]),A=kA.useCallback((f)=>{r.current=f},[]),g=kA.useMemo(()=>({controlsRef:r,mainCameraRef:i,defaultTarget:t,baseDistance:p,controller:s,setController:a,getPresetConfig:m,handleControlsChange:A,cameraType:c,setCameraType:l,cameraPosition:h,setCameraPosition:d,cameraRotation:u,setCameraRotation:_,saveCameraToSession:K$n,loadCameraFromSession:$dt}),[t,p,s,m,A,c,h,u]);return X$n.jsx($$n.Provider,{value:g,children:e})},qB=()=>{let e=kA.useContext($$n);if(!e)throw Error("useCameraController must be used within a CameraControllerProvider");return e},kFi=(e)=>e<0.5?4*e*e*e:1-Math.pow(-2*e+2,3)/2,LFi=()=>{let{controlsRef:e,mainCameraRef:t,defaultTarget:n,setController:o,getPresetConfig:r}=qB(),i=A5.useRef(null),s=A5.useRef(new hm),a=A5.useRef(new Dt),c=A5.useRef(new Dt),l=A5.useRef(new hm),h=A5.useRef(new hm),d=A5.useRef(new nl),u=A5.useRef(new nl),_=A5.useCallback(({position:m,target:A,up:g,durationMs:f=600})=>{if(!t.current)return;let y=e.current?.target??n,x=new Dt(m[0],m[1],m[2]),C=A?new Dt(A[0],A[1],A[2]):n.clone(),b=new Dt(...g??[0,0,1]).normalize(),I=u.current;I.position.copy(x),I.up.copy(b),I.lookAt(C);let v=I.quaternion.clone(),P=t.current.quaternion.clone(),M=t.current.position.clone(),B=y.clone(),T=d.current;T.up.set(0,0,1),T.position.copy(M),T.lookAt(B);let N=T.quaternion.clone();T.up.set(0,0,1),T.position.copy(x),T.lookAt(C);let D=T.quaternion.clone(),L=N.clone().invert().multiply(P).normalize(),H=D.clone().invert().multiply(v).normalize();i.current={fromPosition:M,toPosition:x,fromTarget:B,toTarget:C,toQuaternion:v,rollFrom:L,rollTo:H,startTime:performance.now(),duration:f}},[t,e,n]),p=A5.useCallback((m)=>{if(m==="Custom")return;let A=r(m);if(!A)return;_(A)},[_,r]);return A5.useEffect(()=>{if(!t.current)return;return o({animateTo:_,animateToPreset:p}),()=>{o(null)}},[_,p,t,o]),Rpe(()=>{if(!t.current||!i.current)return;let{fromPosition:m,toPosition:A,fromTarget:g,toTarget:f,toQuaternion:y,rollFrom:x,rollTo:C,startTime:b,duration:I}=i.current,v=performance.now()-b,P=I<=0?1:Math.min(v/I,1),M=kFi(P);t.current.position.lerpVectors(m,A,M);let B=a.current;B.copy(g).lerp(f,M);let T=d.current;T.up.set(0,0,1),T.position.copy(t.current.position),T.lookAt(B);let N=s.current;N.copy(T.quaternion);let D=l.current;D.copy(x);let L=h.current;if(L.copy(C),x.dot(C)<0)L.x*=-1,L.y*=-1,L.z*=-1,L.w*=-1;L.normalize(),D.slerp(L,M),t.current.quaternion.copy(N).multiply(D).normalize();let H=c.current;if(H.set(0,1,0).applyQuaternion(t.current.quaternion).normalize(),t.current.up.copy(H),e.current?.target.copy(B),t.current.updateMatrixWorld(),e.current?.update(),P>=1)t.current.position.copy(A),t.current.quaternion.copy(y),t.current.up.set(0,0,1),t.current.updateMatrixWorld(),e.current?.target.copy(f),e.current?.update(),i.current=null}),null},HFi=Symbol("camera-session-not-restored"),FFi=({cameraSessionScope:e}={})=>{let{controlsRef:t}=qB(),n=YB.useRef(null),o=YB.useRef(HFi),r=YB.useRef(null);YB.useEffect(()=>()=>{if(r.current!==null)clearTimeout(r.current),r.current=null},[e]);let i=YB.useCallback((a)=>{if(n.current=a,o.current!==e&&t.current){let c=$dt(a,{controls:t.current,cameraSessionScope:e});if(o.current=e,c)return}},[e,t]),s=YB.useCallback(()=>{if(!n.current||!t.current)return;if(o.current!==e){let a=$dt(n.current,{controls:t.current,cameraSessionScope:e});if(o.current=e,a)return}if(r.current!==null)clearTimeout(r.current);r.current=setTimeout(()=>{if(n.current&&t.current)K$n(n.current,{controls:t.current,cameraSessionScope:e})},150)},[e,t]);return{handleCameraCreated:i,handleControlsChange:s}};function zFi(e){e.querySelectorAll("canvas").forEach((t)=>t.remove())}var OFi=(e)=>{e.outputColorSpace=tR,e.toneMapping=nEt,e.toneMappingExposure=1,e.shadowMap.enabled=!0,e.shadowMap.type=tEt},VFi=bg.forwardRef(({children:e,scene:t,camera:n,style:o,onCreated:r},i)=>{let{cameraType:s}=qB(),a=bg.useRef(null),[c,l]=bg.useState(null),h=bg.useRef([]),d=bg.useRef(void 0);d.current=r;let u=bg.useRef(null),_=bg.useCallback((g)=>{h.current.push(g)},[]),p=bg.useCallback((g)=>{h.current=h.current.filter((f)=>f!==g)},[]),m=bg.useMemo(()=>new C4,[]);if(t?.up)m.up.set(t.up.x,t.up.y,t.up.z);let A=bg.useRef(new nl);return bg.useImperativeHandle(i,()=>A.current),bg.useEffect(()=>{if(!a.current)return;zFi(a.current);let g=new zM({antialias:!0,alpha:!0});OFi(g),g.setSize(a.current.clientWidth,a.current.clientHeight),g.setPixelRatio(window.devicePixelRatio),a.current.appendChild(g.domElement);let f=a.current.clientWidth/a.current.clientHeight,y=s==="perspective"?new wl(75,f,0.1,1000):new u7(-10*f,10*f,10,-10,-1000,1000);if(u.current)y.position.copy(u.current.position),y.quaternion.copy(u.current.quaternion),y.up.copy(u.current.up);else{if(n?.up)y.up.set(n.up[0],n.up[1],n.up[2]);if(n?.position)y.position.set(n.position[0],n.position[1],n.position[2]);y.lookAt(0,0,0)}m.add(A.current),window.__TSCIRCUIT_THREE_OBJECT=A.current,l({scene:m,camera:y,renderer:g,rootObject:A.current,addFrameListener:_,removeFrameListener:p}),d.current?.({camera:y,renderer:g});let x,C=new QOe,b=!0,I=new IntersectionObserver(([M])=>{if(b=M?.isIntersecting??!1,b)P()});I.observe(a.current);let v=()=>{if(x=requestAnimationFrame(v),!b)return;let M=C.getElapsedTime(),B=C.getDelta();h.current.forEach((T)=>T(M,B)),g.render(m,y)};v();let P=()=>{if(a.current?.clientWidth&&a.current.clientHeight){let M=a.current.clientWidth/a.current.clientHeight;if(y instanceof wl)y.aspect=M;else if(y instanceof u7)y.left=-10*M,y.right=10*M,y.top=10,y.bottom=-10;y.updateProjectionMatrix(),g.setSize(a.current.clientWidth,a.current.clientHeight)}};return window.addEventListener("resize",P),()=>{if(u.current={position:y.position.clone(),quaternion:y.quaternion.clone(),up:y.up.clone()},window.removeEventListener("resize",P),cancelAnimationFrame(x),I.disconnect(),a.current&&g.domElement)a.current.removeChild(g.domElement);if(g.dispose(),m.remove(A.current),window.__TSCIRCUIT_THREE_OBJECT===A.current)window.__TSCIRCUIT_THREE_OBJECT=void 0}},[m,_,p,s]),sEe.jsx("div",{ref:a,style:{width:"100%",height:"100%",...o},children:c&&sEe.jsx(m0t.Provider,{value:c,children:sEe.jsx(WHi,{children:e})})})}),YFi=`
  varying vec3 worldPosition;
  void main() {
    worldPosition = (modelMatrix * vec4(position, 1.0)).xyz;
    gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
  }
`,GFi=`
  varying vec3 worldPosition;
  uniform float cellSize;
  uniform float sectionSize;
  uniform vec3 gridColor;
  uniform vec3 sectionColor;
  uniform float fadeDistance;
  uniform float fadeStrength;

  float getGrid(float size) {
    vec2 r = worldPosition.xy / size;
    vec2 grid = abs(fract(r - 0.5) - 0.5) / fwidth(r);
    float line = min(grid.x, grid.y);
    return 1.0 - min(line * 1.5, 1.0);
  }

  void main() {
    float g1 = getGrid(cellSize);
    float g2 = getGrid(sectionSize);

    float d = distance(worldPosition.xy, cameraPosition.xy);
    float a = 1.0 - smoothstep(fadeDistance, fadeDistance * fadeStrength, d);

    vec3 color = mix(gridColor, sectionColor, g2);

    gl_FragColor = vec4(color, max(g1, g2) * a);
    if (gl_FragColor.a <= 0.0) discard;
  }
`,UFi=({rotation:e,infiniteGrid:t,cellSize:n=1,sectionSize:o=10})=>{let{scene:r,camera:i}=I_(),s=1000,a=tMe.useMemo(()=>{let c=new v2(1000,1000);c.rotateX(-Math.PI/2);let l=new y4({vertexShader:YFi,fragmentShader:GFi,uniforms:{cellSize:{value:n},sectionSize:{value:o},gridColor:{value:new Do(15658734)},sectionColor:{value:new Do(13421823)},fadeDistance:{value:100},fadeStrength:{value:1.5}},transparent:!0,side:A0}),h=new Qo(c,l);if(e)h.rotation.fromArray(e);return h},[1000,n,o,e]);return Rpe(()=>{if(t)a.position.set(i.position.x,i.position.y,0)}),tMe.useEffect(()=>{if(!r||!a)return;return r.add(a),()=>{if(r.remove(a),a.geometry.dispose(),Array.isArray(a.material))a.material.forEach((c)=>c.dispose());else a.material.dispose()}},[r,a]),null},Edt=0.75,WFi=({boardDimensions:e,boardCenter:t,darkBackgroundEnabled:n=!1,shadowsEnabled:o=!1})=>{let{scene:r}=I_(),i=mpe.useMemo(()=>{let s=new dc;s.name="cad-viewer-light-rig";let a=t?.x??0,c=t?.y??0,l=Math.max(e?.width??0,e?.height??0,20),h=l*0.8,d=l,u=l*1.7,_=new jie(16186360,0.22);_.name="cad-viewer-soft-ambient",s.add(_);let p=new TOe(15004141,1581597,0.2);p.name="cad-viewer-hemisphere",s.add(p);let m=(A,g,f,y,x=!1)=>{let C=new Xie(g,f);if(C.name=A,C.position.set(a+y[0],c+y[1],y[2]),C.target.position.set(a,c,0),C.castShadow=x,x){C.shadow.mapSize.set(2048,2048),C.shadow.bias=-0.0002,C.shadow.normalBias=0.03,C.shadow.radius=5;let b=C.shadow.camera;b.left=-h,b.right=h,b.top=h,b.bottom=-h,b.near=0.5,b.far=Math.max(l*4,Math.hypot(...y)+l*2),b.updateProjectionMatrix()}s.add(C),s.add(C.target)};return m("cad-viewer-key-light",16775406,1.35,[u*0.68,-u*0.8,u*1.08],o),m("cad-viewer-fill-light",14477554,0.25,[-d*0.85,d*0.55,d*0.75]),m("cad-viewer-rim-light",12184275,0.5,[-d*0.35,d*0.85,d*0.95]),m("cad-viewer-underside-key-light",16775406,1.35*Edt,[u*0.68,-u*0.8,-u*1.08]),m("cad-viewer-underside-fill-light",14477554,0.25*Edt,[-d*0.85,d*0.55,-d*0.75]),m("cad-viewer-underside-rim-light",12184275,0.5*Edt,[-d*0.35,d*0.85,-d*0.95]),s},[t,e,o]);return mpe.useEffect(()=>{let{background:s,environment:a}=r;return r.background=n?new Do(1053456):null,r.environment=null,()=>{r.background=s,r.environment=a}},[n,r]),mpe.useEffect(()=>{if(!r)return;return r.add(i),()=>{r.remove(i)}},[r,i]),null},XFi=0.05,jFi=({camera:e,initialOrbitDistance:t})=>{let n=Number.isFinite(t)?t*XFi:0;return Math.max(n,e.near,Number.EPSILON)},KFi=({camera:e,controls:t,minimumDollyDistance:n})=>{if(!(e instanceof wl))return!1;let o=t.getDistance();if(Number.isFinite(o)&&o>=n)return!1;let r=new Dt;return e.getWorldDirection(r),t.target.copy(e.position).addScaledVector(r,n),!0},$Fi=({autoRotate:e,autoRotateSpeed:t,onStart:n,panSpeed:o,rotateSpeed:r,zoomSpeed:i,enableDamping:s,dampingFactor:a,target:c,onControlsChange:l})=>{let{camera:h,renderer:d}=I_(),u=VB.useMemo(()=>{if(!h||!d)return null;return new tdt(h,d.domElement)},[h,d]),_=VB.useMemo(()=>{if(!u||!(h instanceof wl))return Number.EPSILON;let p=c?Math.hypot(h.position.x-c[0],h.position.y-c[1],h.position.z-c[2]):u.getDistance();return jFi({camera:h,initialOrbitDistance:p})},[h,u,c]);return VB.useEffect(()=>(l?.(u??null),()=>l?.(null)),[u,l]),VB.useEffect(()=>{if(!u)return;let p=()=>{l?.(u)};return u.addEventListener("change",p),()=>{u.removeEventListener("change",p)}},[u,l]),VB.useEffect(()=>{if(!u)return;if(u.autoRotate=e||!1,u.autoRotateSpeed=t||1,o!==void 0)u.panSpeed=o;if(r!==void 0)u.rotateSpeed=r;if(i!==void 0)u.zoomSpeed=i;if(s!==void 0)u.enableDamping=s;if(a!==void 0)u.dampingFactor=a;if(u.zoomToCursor=!0,u.mouseButtons={LEFT:l7.ROTATE,MIDDLE:l7.PAN,RIGHT:null},c)u.target.set(c[0],c[1],c[2]),u.update()},[u,e,t,o,r,i,s,a,c]),VB.useEffect(()=>{if(!u||!n)return;return u.addEventListener("start",n),()=>{u.removeEventListener("start",n)}},[u,n]),VB.useEffect(()=>{if(!u)return;return()=>{u.dispose()}},[u]),Rpe(()=>{if(!u)return;KFi({camera:h,controls:u,minimumDollyDistance:_}),u.update()},[h,u,_]),null},qFi=10,rte={banana:{type:"banana",label:"Show Banana",width:190,height:60,depth:34,zCenter:17},"credit-card":{type:"credit-card",label:"Show Credit Card",width:85.6,height:53.98,depth:0.76,zCenter:0},"14in-macbook":{type:"14in-macbook",label:"Show 14in Macbook",width:312.6,height:221.2,depth:15.5,zCenter:0}},JFi=Object.values(rte),ZFi=[{type:null,label:"None"},...JFi],ezi=(e,t)=>e===t?null:t,qdt=(e)=>Number.isFinite(e)?Math.max(e??0,0):0,CEe=(e)=>Number.isFinite(e)?e??0:0,q$n=(e,t,n)=>{let o=rte[e],r=qdt(t?.width),i=CEe(n?.x),s=CEe(n?.y);return{x:i+r/2+qFi+o.width/2,y:s,z:0}},tzi=(e,t,n)=>{let o=rte[e],r=qdt(t?.width),i=qdt(t?.height),s=CEe(n?.x),a=CEe(n?.y),c=q$n(e,t,n);return{minX:Math.min(s-r/2,c.x-o.width/2),maxX:Math.max(s+r/2,c.x+o.width/2),minY:Math.min(a-i/2,c.y-o.height/2),maxY:Math.max(a+i/2,c.y+o.height/2),minZ:Math.min(0,c.z+o.zCenter-o.depth/2),maxZ:Math.max(0,c.z+o.zCenter+o.depth/2)}};function nzi(e,t){let n=new hm().setFromEuler(new aA(e.x,e.y,e.z)),o=new Dt(0,0,1);return o.applyQuaternion(n),o.multiplyScalar(t)}var ozi=()=>{let{mainCameraRef:e}=qB(),t=nMe.useRef(null);return nMe.useEffect(()=>{if(!t.current)return;let n=t.current,o=document.createElement("canvas");n.appendChild(o);let r=new zM({canvas:o,antialias:!0,alpha:!0});r.setSize(120,120),r.setPixelRatio(window.devicePixelRatio);let i=new C4,s=new wl(75,1,0.1,1000);s.up.set(0,0,1);let a=new jie(16777215,Math.PI/2);i.add(a);let c=new dc;c.rotation.fromArray([Math.PI/2,0,0]);let l=1,h=new Qo(new qm(l,l,l),new Ls({color:"white"}));c.add(h);let d=new p7(new EOe(new qm(l,l,l)),new YC({color:0,linewidth:2}));c.add(d),i.add(c);let u=0.51,_=(v,P,M)=>{let B=new $j;if(B.text=v,B.position.fromArray(P),M)B.rotation.fromArray(M);return B.color="black",B.fontSize=0.25,B.anchorX="center",B.anchorY="middle",B.depthOffset=0,B.font=null,B.sync(),B},p=_("Front",[0,0,u]),m=_("Back",[0,0,-u],[0,Math.PI,0]),A=_("Right",[u,0,0],[0,Math.PI/2,0]),g=_("Left",[-u,0,0],[0,-Math.PI/2,0]),f=_("Top",[0,u,0],[-Math.PI/2,0,0]),y=_("Bottom",[0,-u,0],[Math.PI/2,0,0]);c.add(p),c.add(m),c.add(A),c.add(g),c.add(f),c.add(y);let x=null,C=!0,b=new IntersectionObserver(([v])=>{C=v?.isIntersecting??!1});b.observe(o);let I=()=>{if(x=requestAnimationFrame(I),!C)return;if(e.current){let v=nzi(e.current.rotation??new aA(0,0,0),2);if(!v.equals(s.position))s.position.copy(v),s.lookAt(0,0,0)}r.render(i,s)};return I(),()=>{if(b.disconnect(),o.remove(),x!==null)cancelAnimationFrame(x);p.dispose(),m.dispose(),A.dispose(),g.dispose(),f.dispose(),y.dispose(),h.geometry.dispose(),h.material.dispose(),d.geometry.dispose(),d.material.dispose(),i.clear(),r.dispose(),r.forceContextLoss()}},[e]),J$n.jsx("div",{ref:t,style:{position:"absolute",top:0,left:0,width:120,height:120,zIndex:Qpe.orientationCube}})},Z$n=(e,t,n)=>{let o=e/2,r=t/2,i=Math.min(n,o,r),s=new nxe;return s.moveTo(-o+i,-r),s.lineTo(o-i,-r),s.quadraticCurveTo(o,-r,o,-r+i),s.lineTo(o,r-i),s.quadraticCurveTo(o,r,o-i,r),s.lineTo(-o+i,r),s.quadraticCurveTo(-o,r,-o,r-i),s.lineTo(-o,-r+i),s.quadraticCurveTo(-o,-r,-o+i,-r),s},Jdt=(e,t,n,o)=>eqn(Z$n(e,t,o),n),eqn=(e,t)=>{let n=new rxe(e,{depth:t,bevelEnabled:!1,curveSegments:24});return n.translate(0,0,-t/2),n.computeVertexNormals(),n},rzi=(e,t)=>{let n=rte[t];e.updateMatrixWorld(!0);let r=new dm().setFromObject(e).getSize(new Dt);e.scale.set(n.width/r.x,n.height/r.y,n.depth/r.z),e.updateMatrixWorld(!0);let s=new dm().setFromObject(e).getCenter(new Dt);e.position.set(-s.x,-s.y,n.zCenter-s.z),e.updateMatrixWorld(!0)},izi=()=>{let e=new exe([new Dt(-82,18,16),new Dt(-67,7,15),new Dt(-43,-9,14),new Dt(-15,-18,14),new Dt(16,-18,14),new Dt(47,-8,14.5),new Dt(72,8,16),new Dt(84,19,17)]),t=84,n=30,o=e.computeFrenetFrames(84,!1),r=[],i=[],s=[],a=[],c=[],l=new Do(16766023),h=new Do(12038965);for(let u=0;u<=84;u++){let _=u/84,p=e.getPointAt(_),m=o.normals[u],A=o.binormals[u],f=3.4+12.4*Math.sin(Math.PI*_)**0.48,y=Math.max(0,(_-0.82)/0.18)*0.38,x=l.clone().lerp(h,y);for(let C=0;C<=30;C++){let b=C/30*Math.PI*2,I=Math.sin(b),v=Math.cos(b),P=1+Math.cos(b*5+0.35)*0.035,M=new Dt().addScaledVector(m,v).addScaledVector(A,I*0.9).normalize(),B=p.clone().addScaledVector(m,v*f*P).addScaledVector(A,I*f*0.9*P);r.push(B.x,B.y,B.z),i.push(M.x,M.y,M.z),s.push(x.r,x.g,x.b),a.push(_,C/30)}}for(let u=1;u<=84;u++)for(let _=1;_<=30;_++){let m=31*(u-1)+(_-1),A=31*u+(_-1),g=31*u+_,f=31*(u-1)+_;c.push(m,f,A,A,f,g)}let d=new ha;return d.setIndex(c),d.setAttribute("position",new jr(r,3)),d.setAttribute("normal",new jr(i,3)),d.setAttribute("color",new jr(s,3)),d.setAttribute("uv",new jr(a,2)),d.computeBoundingBox(),d.computeBoundingSphere(),{geometry:d,curve:e}},szi=()=>{let e=new dc,t=new dc,{geometry:n,curve:o}=izi(),r=new Qo(n,new Ls({color:16777215,roughness:0.72,metalness:0,vertexColors:!0}));r.name="banana-peel",t.add(r);let i=new Qo(new YM(3.4,20,12),new Ls({color:6242844,roughness:0.92}));i.position.copy(o.getPointAt(0)),i.scale.set(1.15,0.78,0.78),i.name="banana-blossom-tip",t.add(i);let s=11,a=o.getTangentAt(1).normalize(),c=new Qo(new VM(2.5,4.1,s,18),new Ls({color:8483625,roughness:0.82}));c.quaternion.setFromUnitVectors(new Dt(0,1,0),a),c.position.copy(o.getPointAt(1)).addScaledVector(a,s/2),c.name="banana-stem",t.add(c);let l=new Qo(new YM(2.55,18,10),new Ls({color:5981470,roughness:0.9}));return l.position.copy(o.getPointAt(1)).addScaledVector(a,s),l.name="banana-stem-tip",t.add(l),rzi(t,"banana"),e.add(t),e},azi=(e,t,n,o,r)=>{let i=Z$n(e,t,o),s=new Qie;return s.absarc(0,0,r,0,Math.PI*2,!0),i.holes.push(s),eqn(i,n)},czi=(e,t)=>{let r=new Qo(new VM(t-0.15,t-0.15,0.25,48),new Ls({color:10199202,roughness:0.48,metalness:0.28}));return r.rotation.x=Math.PI/2,r.position.z=e-0.35-0.125,r.name="macbook-lid-indent",r},lzi=()=>{let e=rte["credit-card"],t=new dc,n=new Qo(Jdt(e.width,e.height,e.depth,3.18),new Ls({color:2383272,roughness:0.38,metalness:0.08}));n.name="credit-card-body",t.add(n);let o=e.depth/2+0.08,r=new Qo(Jdt(12,9,0.14,1.2),new Ls({color:14003525,roughness:0.3,metalness:0.62}));r.position.set(-21,3,o),r.name="credit-card-chip",t.add(r);let i=new Ls({color:15331061,roughness:0.45,metalness:0.05});for(let s=0;s<4;s++){let a=new Qo(new qm(s===3?8:12,0.8,0.1),i);a.position.set(-20+s*14,-14,o+0.08),a.name="credit-card-detail",t.add(a)}return t},hzi=()=>{let e=rte["14in-macbook"],t=new dc,n=new Ls({color:12896201,roughness:0.3,metalness:0.38}),o=new Qo(Jdt(e.width,e.height,13.5,9),n);o.position.z=-1,o.name="macbook-body",t.add(o);let r=2,i=6.75,s=i+r/2,a=12,c=new Qo(azi(e.width-1.8,e.height-1.8,r,8.2,a),n.clone());c.position.z=i,c.name="macbook-lid",t.add(c);let l=new Qo(new qm(e.width-42,3.2,1.2),new Ls({color:3158838,roughness:0.55,metalness:0.45}));l.position.set(0,e.height/2-2.4,6.15),l.name="macbook-hinge",t.add(l),t.add(czi(s,a));let h=new Qo(new qm(54,1.2,0.8),new Ls({color:6712174,roughness:0.45,metalness:0.5}));return h.position.set(0,-e.height/2+0.5,2.5),h.name="macbook-front-notch",t.add(h),t},dzi=(e)=>{let t=e==="banana"?szi():e==="credit-card"?lzi():hzi();return t.name=`reference-object-${e}`,t.userData.isReferenceObject=!0,t.userData.referenceObjectType=e,f3(t),t},uzi=(e)=>{let t=new Set,n=new Set;e.traverse((o)=>{if(!(o instanceof Qo))return;t.add(o.geometry);let r=Array.isArray(o.material)?o.material:[o.material];for(let i of r)n.add(i)});for(let o of t)o.dispose();for(let o of n)o.dispose()},pzi=(e,t,n,o=1.18)=>{let r=Math.max(n.maxX-n.minX,0),i=Math.max(n.maxY-n.minY,0),s=Math.max(n.maxZ-n.minZ,0),a=new Dt((n.minX+n.maxX)/2,(n.minY+n.maxY)/2,(n.minZ+n.maxZ)/2),c=Math.max(Math.hypot(r,i,s)/2,1),l=t?.target??new Dt,h=new Dt(0,-0.75,0.9).normalize(),d=Math.max(e.position.distanceTo(l),5);if(e instanceof wl){let u=d7.degToRad(e.fov),_=2*Math.atan(Math.tan(u/2)*e.aspect),p=Math.min(u,_);d=c*o/Math.sin(p/2),e.far=Math.max(e.far,d+c*o*3),e.updateProjectionMatrix()}else if(e instanceof u7){let u=Math.abs(e.right-e.left)/2,_=Math.abs(e.top-e.bottom)/2;e.zoom=Math.min(u/(c*o),_/(c*o)),d=Math.max(d,c*o*2),e.updateProjectionMatrix()}if(e.position.copy(a).addScaledVector(h,d),e.lookAt(a),e.updateMatrixWorld(),t)t.target.copy(a),t.update();return{center:a,radius:c,distance:d}},mzi=({type:e,boardDimensions:t,boardCenter:n})=>{let{scene:o}=I_(),r=Lpe.useMemo(()=>{let i=dzi(e),s=q$n(e,t,n);return i.position.set(s.x,s.y,s.z),i},[e,t,n]);return Lpe.useEffect(()=>(o.add(r),()=>{o.remove(r),uzi(r)}),[o,r]),null},tqn=({bounds:e})=>{let{camera:t}=I_(),{controlsRef:n}=qB();return Lpe.useEffect(()=>{pzi(t,n.current,e)},[e,t,n]),null},_zi=()=>{let{camera:e}=I_(),{setCameraRotation:t}=qB();return Rpe(()=>{if(e)t(e.rotation)}),null},nqn=bP.forwardRef(({children:e,initialCameraPosition:t=[5,-5,5],autoRotateDisabled:n,clickToInteractEnabled:o=!1,boardDimensions:r,boardCenter:i,cameraSessionScope:s,referenceObject:a,onUserInteraction:c,onCameraControllerReady:l},h)=>{let[d,u]=bP.useState(!o),{mainCameraRef:_,handleControlsChange:p,controller:m}=qB(),{darkBackgroundEnabled:A,gridEnabled:g,lightingEnabled:f}=y0t(),{handleCameraCreated:y,handleControlsChange:x}=FFi({cameraSessionScope:s});bP.useEffect(()=>{if(l)l(m)},[m,l]);let C=bP.useMemo(()=>{if(!a)return;return tzi(a,r,i)},[a,r,i]),b=bP.useMemo(()=>{if(!r)return 10;let v=r.width??0,P=r.height??0;return Math.max(Math.max(v,P)*1.5,10)},[r]),I=bP.useMemo(()=>{if(C)return[(C.minX+C.maxX)/2,(C.minY+C.maxY)/2,(C.minZ+C.maxZ)/2];if(!i)return;return[i.x,i.y,0]},[i,C]);return $2.jsxs("div",{style:{position:"relative",width:"100%",height:"100%"},children:[$2.jsx(ozi,{}),$2.jsxs(VFi,{ref:h,scene:{up:new Dt(0,0,1)},camera:{up:[0,0,1],position:t},onCreated:({camera:v})=>{_.current=v,y(v)},children:[$2.jsx(QHi,{}),$2.jsx(LFi,{}),$2.jsx(_zi,{}),d&&$2.jsx($Fi,{autoRotate:!n,autoRotateSpeed:1,onStart:c,rotateSpeed:0.5,panSpeed:0.75,zoomSpeed:0.5,enableDamping:!0,dampingFactor:0.1,target:I,onControlsChange:(v)=>{p(v),x()}}),$2.jsx(WFi,{boardDimensions:r,boardCenter:i,darkBackgroundEnabled:A,shadowsEnabled:f}),a&&$2.jsx(mzi,{type:a,boardDimensions:r,boardCenter:i}),C&&$2.jsx(tqn,{bounds:C}),g&&$2.jsx(UFi,{rotation:[Math.PI/2,0,0],infiniteGrid:!0,cellSize:3,sectionSize:b}),e]},s),$2.jsxs("div",{style:{position:"absolute",right:24,bottom:24,fontFamily:"sans-serif",color:"white",WebkitTextStroke:"0.5px rgba(0, 0, 0, 0.5)",fontSize:11},children:["@",V$n.version]}),o&&!d&&$2.jsx("button",{type:"button",onClick:()=>u(!0),onKeyDown:(v)=>{if(v.key==="Enter"||v.key===" ")u(!0)},style:{position:"absolute",inset:0,cursor:"pointer",zIndex:Qpe.clickToInteractOverlay,display:"flex",alignItems:"center",justifyContent:"center"},children:$2.jsx("div",{style:{backgroundColor:"rgba(0, 0, 0, 0.8)",color:"white",padding:"12px 24px",borderRadius:"8px",fontSize:"16px",fontFamily:"sans-serif",pointerEvents:"none"},children:"Click to Interact"})})]})}),gzi=(e)=>{let[t,n]=_pe.useState([]),[o,r]=_pe.useState(!0);return _pe.useEffect(()=>{if(!e)return;(async()=>{r(!0);let a=(Array.isArray(e)?e:[e]).map(async(c,l)=>{let h=oqn.default.serialize({binary:!0},[c]),u=await new Blob(h).arrayBuffer(),p=c.layerType||(l===0?"board":void 0);return{stlData:u,color:c.color,layerType:p}});try{let c=await Promise.all(a);n(c)}catch(c){console.error("Error generating STLs:",c),n([])}finally{r(!1)}})()},[e]),{stls:t,loading:o}},Azi=Ll(YEe(),1),fzi=Ll(TG(),1),yzi=Ll(Npe(),1),xzi=Ll(TG(),1),Czi=Ll(DG(),1),bzi=Ll($Xn(),1),rqn=(e)=>{let t=0;for(let o=0;o<e.length;o++){let r=(o+1)%e.length;t+=e[o][0]*e[r][1],t-=e[r][0]*e[o][1]}return t/2<=0},Zdt=(e,t=1.2,n={})=>{let{xyOutset:o=0}=n,{outline:r}=e,i=r.map((c)=>[c.x,c.y]);if(rqn(i))i=i.reverse();let s=(0,xzi.polygon)({points:i});if(o!==0)s=(0,bzi.expand)({delta:o,corners:"edge"},s);let a=(0,yzi.extrudeLinear)({height:t},s);return a=(0,Czi.translate)([0,0,-t/2],a),a},wi=0.01,jc={copper:[0.78,0.63,0.39],fr4Tan:[0.6,0.43,0.28],fr4SolderMaskGreen:[0.06,0.31,0.19],fr4TracesWithMaskGreen:[0.09,0.38,0.23],fr4TracesWithoutMaskTan:[0.6,0.43,0.28],flexAmber:[0.8,0.61,0.2],fr1Tan:[0.8,0.4,0.2],fr1TracesWithMaskCopper:[0.9,0.6,0.2],fr1SolderMaskGreen:[0.02,0.1,0.04]},W9=0.001,xg=32,Kb=150,bEe=0.6,Izi={fr1:jc.fr1Tan,fr4:jc.fr4Tan,flex:jc.flexAmber},vzi={fr1:jc.fr1SolderMaskGreen,fr4:jc.fr4SolderMaskGreen,flex:jc.flexAmber},Szi={red:"#650202",blue:"#003f7d",purple:"#4c1d69",black:"#071014",white:"#dddddd",yellow:"#dcc84a"},Pzi=0.875,Ezi=/^#(?:[\da-f]{3}|[\da-f]{6})$/i,Mzi=/^rgb\(\s*\d+\s*,\s*\d+\s*,\s*\d+\s*\)$/i,wzi=/^rgb\(\s*\d+%\s*,\s*\d+%\s*,\s*\d+%\s*\)$/i,Bzi=/^hsl\(\s*\d*\.?\d+\s*,\s*\d*\.?\d+%\s*,\s*\d*\.?\d+%\s*\)$/i,Tzi={blue:0.96,purple:0.96,black:0.99,yellow:0.92},iqn=(e)=>{let t=e?.trim();if(!t)return null;let n=t.toLowerCase();if(n==="green"||n==="not_specified")return null;let r=Szi[n];if(r)return new Do(r);return Object.hasOwn(Do.NAMES,n)||Ezi.test(t)||Mzi.test(t)||wzi.test(t)||Bzi.test(t)?new Do(n):null},Dzi=(e)=>{let t=e?.trim().toLowerCase();return Tzi[t]??Pzi},Nzi=({red:e,green:t,blue:n})=>Math.hypot(e-220,t-200,n-74)<4||Math.hypot(e-218,t-197,n-76)<4,Rzi=({soldermaskColor:e,copperColor:t,soldermaskOpacity:n})=>e.clone().multiplyScalar(n).add(t.clone().multiplyScalar(1-n)),DUn=(e)=>{let t=e.clone().convertLinearToSRGB();return`rgb(${[Math.round(t.r*255),Math.round(t.g*255),Math.round(t.b*255)].join(",")})`},Qzi=new Do(1063462),x0t=({material:e,solder_mask_color:t})=>{let n=iqn(t);if(n)return n;if(e==="fr4")return Qzi.clone();let o=Izi[e]??jc.fr4Tan;return new Do(o[0],o[1],o[2])},kzi=(e)=>{let t=e.filter((c)=>c.type==="pcb_panel"),n=Ho(e).pcb_board.list(),o,r,i=1.2;if(t.length>0)o=t[0],r=n.find((c)=>c.pcb_panel_id===o.pcb_panel_id),i=r?.thickness??1.2;else{if(o=n.filter((l)=>!l.pcb_panel_id)[0],!o)return console.warn("No pcb_board or pcb_panel found for simplified geometry"),[];r=o,i=o.thickness??1.2}let s;if("outline"in o&&o.outline&&o.outline.length>0)s=Zdt({outline:o.outline},i);else s=(0,fzi.cuboid)({size:[o.width??10,o.height??10,i],center:[o.center.x,o.center.y,0]});let a=x0t({material:r?.material??"fr4",solder_mask_color:r?.solder_mask_color});return[(0,Azi.colorize)([a.r,a.g,a.b],s)]},Mdt=Ll(YEe(),1),zf=Ll(Dpe(),1),NUn=Ll(wXn(),1),wdt=Ll(Npe(),1),u5=Ll(DG(),1),Fd=Ll(TG(),1),AL=Ll(TG(),1),Lzi=Ll(Npe(),1),aEe=Ll(DG(),1),Hzi=Ll(Dpe(),1),Fzi=64,zzi=(e,t,n)=>{let o=(0,AL.ellipse)({center:[0,0],radius:[Math.max(e/2,wi/2),Math.max(t/2,wi/2)],segments:Fzi}),r=(0,Lzi.extrudeLinear)({height:n},o);return(0,aEe.translate)([0,0,-n/2],r)},Ozi=(e,t,n)=>{let o=Math.max(e,wi),r=Math.max(t,wi);if(Math.abs(o-r)<0.000001)return(0,AL.cylinder)({center:[0,0,0],radius:o/2,height:n});let i=o>=r,s=i?o:r,a=i?r:o,c=Math.max(s-a,0),l=(0,AL.cuboid)({center:[0,0,0],size:i?[c,a,n]:[a,c,n]});if(c<=0.000001)return(0,AL.cylinder)({center:[0,0,0],radius:a/2,height:n});let h=c/2,d=(0,AL.cylinder)({center:i?[-h,0,0]:[0,-h,0],radius:a/2,height:n}),u=(0,AL.cylinder)({center:i?[h,0,0]:[0,h,0],radius:a/2,height:n});return(0,Hzi.union)(l,d,u)},IEe=(e,t,n={})=>{let o=e.hole_shape||"circle",r=n.sizeDelta??0,i=e.hole_offset_x||0,s=e.hole_offset_y||0,a=[e.x+i,e.y+s,0];if(o==="circle"){let _=Math.max((e.hole_diameter??0)+r,wi),p=Math.max(_/2,wi/2);return(0,AL.cylinder)({center:a,radius:p,height:t})}let c=e.hole_width??e.hole_diameter,l=e.hole_height??e.hole_diameter;if(!c||!l)return null;let h=Math.max(c+r,wi),d=Math.max(l+r,wi);if(o==="oval"){let _=zzi(h,d,t);return(0,aEe.translate)([a[0],a[1],0],_)}if(o==="pill"||o==="rotated_pill"){let _=Ozi(h,d,t);if(!_)return null;let p=e.ccw_rotation||0;if(p)_=(0,aEe.rotateZ)(p*Math.PI/180,_);return(0,aEe.translate)(a,_)}let u=Math.max((e.hole_diameter??c??l??wi)+r,wi);return(0,AL.cylinder)({center:a,radius:u/2,height:t})},Xc=Ll(TG(),1),AP=Ll(YEe(),1),fu=Ll(Dpe(),1),RUn=Ll(DG(),1),OPe=Ll(Npe(),1),p5=Ll(DG(),1),Vzi=0.00001;function sqn(e,t,n){if(typeof n!=="number"||!Number.isFinite(n))return 0;if(n<=0)return 0;let o=e/2,r=t/2,i=Math.min(o,r)-2*Vzi;return Math.max(0,Math.min(n,i))}function fL(e){if(!e||typeof e!=="object")return;return e.corner_radius??e.cornerRadius??e.rect_pad_border_radius??e.rectPadBorderRadius??e.rect_border_radius??e.rectBorderRadius??void 0}var Yzi=0.05,Bdt=64,gG=(e,t)=>t?(0,fu.intersect)(t,e):e,Z0e=(e,t,n={})=>{let{clipGeom:o}=n;if(!e.shape)e.shape="circle";let r=Math.max(t.pcbThickness*0.002,wi/5),i=Math.max(t.pcbThickness*0.0003,wi/20),s=Math.max(t.pcbThickness*0.0025,wi/4),a=t.pcbThickness+2*Yzi+4*wi,c=Math.max(t.pcbThickness-2*(r+i+s),wi),l=Math.max(c,wi);if(e.shape==="circle"){let h=e.outer_diameter??Math.max(e.hole_diameter,0),d=c,u=(0,Xc.cylinder)({center:[e.x,e.y,0],radius:h/2,height:d}),_=gG(u,o),p=(0,Xc.cylinder)({center:[e.x,e.y,0],radius:Math.max(e.hole_diameter/2,0.01),height:a});return(0,AP.colorize)(jc.copper,(0,fu.subtract)(_,p))}if(e.shape==="oval"){let h=e.outer_width||e.hole_width||0,d=e.outer_height||e.hole_height||0,u=e.hole_width||0,_=e.hole_height||0,p=(()=>{let g=(0,Xc.cylinder)({center:[0,0,0],radius:1,height:c,segments:64}),f=(0,RUn.scale)([h/2,d/2,1],g);return(0,p5.translate)([e.x,e.y,0],f)})(),m=gG(p,o),A=(()=>{let g=(0,Xc.cylinder)({center:[0,0,0],radius:1,height:a,segments:64}),f=(0,RUn.scale)([Math.max(u/2,0.01),Math.max(_/2,0.01),1],g);return(0,p5.translate)([e.x,e.y,0],f)})();return(0,AP.colorize)(jc.copper,(0,fu.subtract)(m,A))}if(e.shape==="circular_hole_with_rect_pad"){let h=e.hole_offset_x||0,d=e.hole_offset_y||0,u=e.rect_pad_width||e.hole_diameter,_=e.rect_pad_height||e.hole_diameter,p=fL(e),m=gG((0,fu.union)((()=>{let f=(0,Xc.roundedRectangle)({size:[u,_],roundRadius:p||0,segments:Bdt}),y=(0,OPe.extrudeLinear)({height:c},f);return(0,p5.translate)([e.x,e.y,-c/2],y)})(),(0,Xc.cylinder)({center:[e.x+(h||0),e.y+(d||0),0],radius:e.hole_diameter/2,height:l})),o),A=(0,Xc.cylinder)({center:[e.x+(h||0),e.y+(d||0),0],radius:Math.max(e.hole_diameter/2-wi,0.01),height:a}),g=(0,fu.subtract)(m,A);if(n.clipGeom)return(0,AP.colorize)(jc.copper,(0,fu.intersect)(g,n.clipGeom));return(0,AP.colorize)(jc.copper,g)}if(e.shape==="pill"){let h=(e.ccw_rotation||0)*Math.PI/180,d=(D)=>{if(!h)return D;let L=(0,p5.translate)([-e.x,-e.y,0],D),H=(0,p5.rotate)([0,0,h],L);return(0,p5.translate)([e.x,e.y,0],H)},u=e.hole_height>e.hole_width,_=u?e.hole_height:e.hole_width,p=u?e.hole_width:e.hole_height,m=u?e.outer_height||p+0.2:e.outer_width||_+0.2,A=u?e.outer_width||_+0.2:e.outer_height||p+0.2,g=p/2,f=A/2,y=Math.abs(_-p),x=Math.abs(m-A),I=((D,L,H)=>{let V=L/2,O=Math.abs(D-L);if(O<=0.000001)return(0,Xc.cylinder)({center:[e.x,e.y,0],radius:V,height:H});let U=(0,Xc.cuboid)({center:[e.x,e.y,0],size:u?[L,O,H]:[O,L,H]}),j=(0,Xc.cylinder)({center:u?[e.x,e.y-O/2,0]:[e.x-O/2,e.y,0],radius:V,height:H}),Y=(0,Xc.cylinder)({center:u?[e.x,e.y+O/2,0]:[e.x+O/2,e.y,0],radius:V,height:H});return(0,fu.union)(U,j,Y)})(m,A,c),v=(0,Xc.cuboid)({center:[e.x,e.y,0],size:u?[p-2*wi,y,a]:[y,p-2*wi,a]}),P=(0,Xc.cylinder)({center:u?[e.x,e.y-y/2,0]:[e.x-y/2,e.y,0],radius:g-wi,height:a}),M=(0,Xc.cylinder)({center:u?[e.x,e.y+y/2,0]:[e.x+y/2,e.y,0],radius:g-wi,height:a}),B=(0,fu.union)(v,P,M),T=gG(d(I),o),N=d(B);return(0,AP.colorize)(jc.copper,(0,fu.subtract)(T,N))}if(e.shape==="pill_hole_with_rect_pad"){if(e.hole_shape&&e.hole_shape!=="pill"||e.pad_shape&&e.pad_shape!=="rect")throw Error("Invalid hole_shape or pad_shape for pill_hole_with_rect_pad");let h=e.hole_offset_x||0,d=e.hole_offset_y||0,u=e.hole_height>e.hole_width,_=u?e.hole_height:e.hole_width,p=u?e.hole_width:e.hole_height,m=p/2,A=Math.abs(_-p),g=e.rect_pad_width||_+0.2,f=e.rect_pad_height||p+0.2,y=fL(e),x=0.03,C=(0,fu.union)((0,Xc.cuboid)({center:[e.x+h,e.y+d,0],size:u?[p+2*x,A+2*x,l]:[A+2*x,p+2*x,l]}),(0,Xc.cylinder)({center:u?[e.x+h,e.y+d-A/2,0]:[e.x+h-A/2,e.y+d,0],radius:m+x,height:l}),(0,Xc.cylinder)({center:u?[e.x+h,e.y+d+A/2,0]:[e.x+h+A/2,e.y+d,0],radius:m+x,height:l})),b=(0,fu.union)((0,Xc.cuboid)({center:[e.x+h,e.y+d,0],size:u?[p,A,a]:[A,p,a]}),(0,Xc.cylinder)({center:u?[e.x+h,e.y+d-A/2,0]:[e.x+h-A/2,e.y+d,0],radius:m,height:a}),(0,Xc.cylinder)({center:u?[e.x+h,e.y+d+A/2,0]:[e.x+h+A/2,e.y+d,0],radius:m,height:a})),I=(()=>{let T=(0,Xc.roundedRectangle)({size:[g,f],roundRadius:y||0,segments:Bdt}),N=(0,OPe.extrudeLinear)({height:c},T);return(0,p5.translate)([e.x,e.y,-c/2],N)})(),v=(0,fu.subtract)(I,b),P=(0,fu.union)((0,Xc.cuboid)({center:[e.x+h,e.y+d,0],size:u?[p-2*wi,A-2*wi,a]:[A-2*wi,p-2*wi,a]}),(0,Xc.cylinder)({center:u?[e.x+h,e.y+d-A/2,0]:[e.x+h-A/2,e.y+d,0],radius:m-wi,height:a}),(0,Xc.cylinder)({center:u?[e.x+h,e.y+d+A/2,0]:[e.x+h+A/2,e.y+d,0],radius:m-wi,height:a})),M=(0,fu.subtract)(C,P),B=gG((0,fu.union)(v,M),o);return(0,AP.colorize)(jc.copper,B)}else if(e.shape==="rotated_pill_hole_with_rect_pad"){if(e.hole_shape&&e.hole_shape!=="rotated_pill"||e.pad_shape&&e.pad_shape!=="rect")throw Error("Invalid hole_shape or pad_shape for rotated_pill_hole_with_rect_pad");let h=e.hole_offset_x||0,d=e.hole_offset_y||0,{hole_width:u,hole_height:_}=e,p=u>=_,m=p?u:_,A=p?_:u,g=A/2,f=Math.abs(m-A),y=e.rect_pad_width||u+0.2,x=e.rect_pad_height||_+0.2,C=fL(e),b=0.03,I=(e.hole_ccw_rotation||0)*Math.PI/180,v=(e.rect_ccw_rotation||0)*Math.PI/180,P=(O)=>{let U=h*Math.cos(I)-d*Math.sin(I),j=h*Math.sin(I)+d*Math.cos(I),Y=(0,p5.rotate)([0,0,I],O);return(0,p5.translate)([e.x+U,e.y+j,0],Y)},M=(O)=>{if(!v)return O;let U=(0,p5.translate)([-e.x,-e.y,0],O),j=(0,p5.rotate)([0,0,v],U);return(0,p5.translate)([e.x,e.y,0],j)},B=P((0,fu.union)((0,Xc.cuboid)({center:[0,0,0],size:p?[f+2*b,A+2*b,l]:[A+2*b,f+2*b,l]}),(0,Xc.cylinder)({center:p?[-f/2,0,0]:[0,-f/2,0],radius:g+b,height:l}),(0,Xc.cylinder)({center:p?[f/2,0,0]:[0,f/2,0],radius:g+b,height:l}))),T=P((0,fu.union)((0,Xc.cuboid)({center:[0,0,0],size:p?[f,A,a]:[A,f,a]}),(0,Xc.cylinder)({center:p?[-f/2,0,0]:[0,-f/2,0],radius:g,height:a}),(0,Xc.cylinder)({center:p?[f/2,0,0]:[0,f/2,0],radius:g,height:a}))),N=M((()=>{let O=(0,Xc.roundedRectangle)({size:[y,x],roundRadius:C||0,segments:Bdt}),U=(0,OPe.extrudeLinear)({height:c},O);return(0,p5.translate)([e.x,e.y,-c/2],U)})()),D=(0,fu.subtract)(N,T),L=P((0,fu.union)((0,Xc.cuboid)({center:[0,0,0],size:p?[f-2*wi,A-2*wi,a]:[A-2*wi,f-2*wi,a]}),(0,Xc.cylinder)({center:p?[-f/2,0,0]:[0,-f/2,0],radius:g-wi,height:a}),(0,Xc.cylinder)({center:p?[f/2,0,0]:[0,f/2,0],radius:g-wi,height:a}))),H=(0,fu.subtract)(B,L),V=gG((0,fu.union)(D,H),o);return(0,AP.colorize)(jc.copper,V)}else if(e.shape==="hole_with_polygon_pad"){let h=e.pad_outline;if(!Array.isArray(h)||h.length<3)throw Error(`Invalid pad_outline for plated hole at (${e.x}, ${e.y})`);let d=h.map((x)=>[x.x,x.y]),u=(0,Xc.polygon)({points:d}),m=((x,C)=>{let b=Math.max(x,wi),I=(0,OPe.extrudeLinear)({height:b},u);return(0,p5.translate)([e.x,e.y,C-b/2],I)})(c,0),A=gG(m,o),g=IEe(e,l);if(!g)return(0,AP.colorize)(jc.copper,A);let f=IEe(e,a,{sizeDelta:-2*wi})||g,y=(0,fu.union)((0,fu.subtract)(A,g),g);if(n.clipGeom)return y=(0,fu.subtract)(y,f),y=(0,fu.intersect)(y,n.clipGeom),(0,AP.colorize)(jc.copper,y);return(0,AP.colorize)(jc.copper,(0,fu.subtract)(y,f))}else throw Error(`Unsupported plated hole shape: ${e.shape}`)},Gzi=Ll(Dpe(),1),Uzi=Ll(DG(),1),eut=Ll(TG(),1);function Wzi({x:e,y:t,outerDiameter:n,holeDiameter:o,thickness:r}){if(n<=o)throw Error(`Invalid via geometry: outerDiameter (${n}) must be > holeDiameter (${o})`);let i=wi,s=Math.min(n/2,o/2+i),c=(0,eut.cylinder)({center:[0,0,0],radius:s,height:r,segments:xg}),l=r+2*wi,h=(0,eut.cylinder)({center:[0,0,0],radius:o/2,height:l,segments:xg}),d=(0,Gzi.subtract)(c,h);return(0,Uzi.translate)([e,t,0],d)}function Xzi({x:e,y:t,holeDiameter:n,thickness:o}){let r=o*1.5,i=n/2+wi;return(0,eut.cylinder)({center:[e,t,0],radius:i,height:r,segments:xg})}function C0t(e){let t=FAe(e),n=[...Ho(e).pcb_via.list()],o=new Map;for(let r of n){let s=`${t.get(r.pcb_via_id)?.pcb_board_id??""}:${r.x}:${r.y}`,a=o.get(s)??[];a.push(r),o.set(s,a)}for(let r of Ho(e).pcb_trace.list()){let i=t.get(r.pcb_trace_id);for(let[s,a]of r.route.entries()){if(a.route_type!=="via")continue;let c=`${i?.pcb_board_id??""}:${a.x}:${a.y}`,l=o.get(c)??[];if(l.some((u)=>u.layers.includes(a.from_layer)&&u.layers.includes(a.to_layer)))continue;let d={type:"pcb_via",pcb_via_id:`${r.pcb_trace_id}_route_via_${s}`,pcb_trace_id:r.pcb_trace_id,subcircuit_id:r.subcircuit_id,pcb_group_id:r.pcb_group_id,x:a.x,y:a.y,layers:[a.from_layer,a.to_layer],hole_diameter:a.hole_diameter??i?.min_via_hole_diameter??0.25,outer_diameter:a.outer_diameter??i?.min_via_pad_diameter??0.6,tented_on_top:a.tented_on_top,tented_on_bottom:a.tented_on_bottom};n.push(d),l.push(d),o.set(c,l)}}return n}var jzi=64,Kzi=1,Tdt=0.05,QUn=["initializing","processing_plated_holes","processing_holes","processing_cutouts","processing_vias","finalizing","done"],$zi=class{board;plated_holes;holes;pcb_vias;pcb_cutouts;boardGeom=null;platedHoleGeoms=[];viaGeoms=[];copperDrills=[];boardClipGeom=null;state="initializing";currentIndex=0;ctx;onCompleteCallback;finalGeoms=[];constructor(e,t){this.onCompleteCallback=t;let n=e.filter((r)=>r.type==="pcb_panel"),o=Ho(e).pcb_board.list();if(n.length>0){let r=n[0],i=o.find((s)=>s.pcb_panel_id===r.pcb_panel_id);this.board={type:"pcb_board",pcb_board_id:r.pcb_panel_id,center:r.center,width:r.width,height:r.height,thickness:i?.thickness??1.4,material:i?.material??"fr4",num_layers:i?.num_layers??2,solder_mask_color:i?.solder_mask_color}}else{let r=o.filter((i)=>!i.pcb_panel_id);this.board=r[0]}this.plated_holes=Ho(e).pcb_plated_hole.list(),this.holes=Ho(e).pcb_hole.list(),this.pcb_vias=C0t(e),this.pcb_cutouts=Ho(e).pcb_cutout.list(),this.ctx={pcbThickness:this.board.thickness??1.2},this.initializeBoard()}initializeBoard(){let e=this.ctx.pcbThickness+2*Kzi;if(this.board.outline&&this.board.outline.length>0)this.boardGeom=Zdt({outline:this.board.outline},this.ctx.pcbThickness),this.boardClipGeom=Zdt({outline:this.board.outline},e,{xyOutset:Tdt});else this.boardGeom=(0,Fd.cuboid)({size:[this.board.width,this.board.height,this.ctx.pcbThickness],center:[this.board.center.x,this.board.center.y,0]}),this.boardClipGeom=(0,Fd.cuboid)({size:[this.board.width+2*Tdt,this.board.height+2*Tdt,e],center:[this.board.center.x,this.board.center.y,0]});this.state="processing_plated_holes",this.currentIndex=0}goToNextState(){let e=QUn.indexOf(this.state);if(e===-1)return;this.state=QUn[e+1],this.currentIndex=0}step(e=1){if(this.state==="done"||!this.boardGeom)return!0;for(let t=0;t<e;t++){if(this.state==="done")break;switch(this.state){case"processing_plated_holes":if(this.currentIndex<this.plated_holes.length)this.processPlatedHole(this.plated_holes[this.currentIndex]),this.currentIndex++;else this.goToNextState();break;case"processing_holes":if(this.currentIndex<this.holes.length)this.processHole(this.holes[this.currentIndex]),this.currentIndex++;else this.goToNextState();break;case"processing_vias":if(this.currentIndex<this.pcb_vias.length)this.processVia(this.pcb_vias[this.currentIndex]),this.currentIndex++;else this.goToNextState();break;case"processing_cutouts":if(this.currentIndex<this.pcb_cutouts.length)this.processCutout(this.pcb_cutouts[this.currentIndex]),this.currentIndex++;else this.goToNextState();break;case"finalizing":this.finalize(),this.state="done";break}}return this.state==="done"}processCutout(e){if(!this.boardGeom)return;let t=null,n=this.ctx.pcbThickness*1.5;switch(e.shape){case"rect":{let o=sqn(e.width,e.height,fL(e));if(o>0){let r=(0,Fd.roundedRectangle)({size:[e.width,e.height],roundRadius:o,segments:jzi});t=(0,wdt.extrudeLinear)({height:n},r),t=(0,u5.translate)([0,0,-n/2],t)}else t=(0,Fd.cuboid)({center:[0,0,0],size:[e.width,e.height,n]});if(e.rotation){let r=e.rotation*Math.PI/180;t=(0,u5.rotateZ)(r,t)}t=(0,u5.translate)([e.center.x,e.center.y,0],t);break}case"circle":t=(0,Fd.cylinder)({center:[e.center.x,e.center.y,0],radius:e.radius,height:n});break;case"polygon":{let o=e.points.map((i)=>[i.x,i.y]);if(o.length<3){console.warn(`PCB Cutout [${e.pcb_cutout_id}] polygon has fewer than 3 points, skipping.`);break}if(rqn(o))o=o.reverse();let r=(0,Fd.polygon)({points:o});t=(0,wdt.extrudeLinear)({height:n},r),t=(0,u5.translate)([0,0,-n/2],t);break}}if(t)this.boardGeom=(0,zf.subtract)(this.boardGeom,t)}processPlatedHole(e,t={}){if(!this.boardGeom)return;if(e.shape==="circle"||e.shape==="circular_hole_with_rect_pad"){let n=null;if(e.shape==="circular_hole_with_rect_pad"){if(e.hole_shape&&e.hole_shape!=="circle"||e.pad_shape&&e.pad_shape!=="rect")return;n=(0,Fd.cylinder)({center:[e.x+(e.hole_offset_x||0),e.y+(e.hole_offset_y||0),0],radius:e.hole_diameter/2+wi,height:this.ctx.pcbThickness*1.5})}else n=(0,Fd.cylinder)({center:[e.x,e.y,0],radius:e.hole_diameter/2+wi,height:this.ctx.pcbThickness*1.5});if(!t.dontCutBoard)this.boardGeom=(0,zf.subtract)(this.boardGeom,n),this.copperDrills.push({geom:n,platedHoleIndex:this.platedHoleGeoms.length});let o=Z0e(e,this.ctx,{clipGeom:this.boardClipGeom});this.platedHoleGeoms.push(o)}else if(e.shape==="pill"||e.shape==="oval"){let n=e.hole_height>e.hole_width,o=n?e.hole_height:e.hole_width,r=n?e.hole_width:e.hole_height,i=r/2,s=Math.abs(o-r),a;if(a=(0,zf.union)((0,Fd.cuboid)({center:[e.x,e.y,0],size:n?[r,s,this.ctx.pcbThickness*1.5]:[s,r,this.ctx.pcbThickness*1.5]}),(0,Fd.cylinder)({center:n?[e.x,e.y-s/2,0]:[e.x-s/2,e.y,0],radius:i,height:this.ctx.pcbThickness*1.5}),(0,Fd.cylinder)({center:n?[e.x,e.y+s/2,0]:[e.x+s/2,e.y,0],radius:i,height:this.ctx.pcbThickness*1.5})),e.ccw_rotation){let l=e.ccw_rotation*Math.PI/180;a=(0,u5.translate)([e.x,e.y,0],(0,u5.rotateZ)(l,(0,u5.translate)([-e.x,-e.y,0],a)))}if(!t.dontCutBoard)this.boardGeom=(0,zf.subtract)(this.boardGeom,a),this.copperDrills.push({geom:a,platedHoleIndex:this.platedHoleGeoms.length});let c=Z0e(e,this.ctx,{clipGeom:this.boardClipGeom});this.platedHoleGeoms.push(c)}else if(e.shape==="pill_hole_with_rect_pad"){if(e.hole_shape&&e.hole_shape!=="pill"||e.pad_shape&&e.pad_shape!=="rect")return;let n=e.hole_height>e.hole_width,o=n?e.hole_height:e.hole_width,r=n?e.hole_width:e.hole_height,i=r/2,s=Math.abs(o-r),a;if(a=(0,zf.union)((0,Fd.cuboid)({center:[e.x+(e.hole_offset_x||0),e.y+(e.hole_offset_y||0),0],size:n?[r,s,this.ctx.pcbThickness*1.5]:[s,r,this.ctx.pcbThickness*1.5]}),(0,Fd.cylinder)({center:n?[e.x+(e.hole_offset_x||0),e.y+(e.hole_offset_y||0)-s/2,0]:[e.x+(e.hole_offset_x||0)-s/2,e.y+(e.hole_offset_y||0),0],radius:i,height:this.ctx.pcbThickness*1.5}),(0,Fd.cylinder)({center:n?[e.x+(e.hole_offset_x||0),e.y+(e.hole_offset_y||0)+s/2,0]:[e.x+(e.hole_offset_x||0)+s/2,e.y+(e.hole_offset_y||0),0],radius:i,height:this.ctx.pcbThickness*1.5})),!t.dontCutBoard)this.boardGeom=(0,zf.subtract)(this.boardGeom,a),this.copperDrills.push({geom:a,platedHoleIndex:this.platedHoleGeoms.length});let c=Z0e(e,this.ctx,{clipGeom:this.boardClipGeom});this.platedHoleGeoms.push(c)}else if(e.shape==="rotated_pill_hole_with_rect_pad"){if(e.hole_shape&&e.hole_shape!=="rotated_pill"||e.pad_shape&&e.pad_shape!=="rect")return;let{hole_width:n,hole_height:o}=e,r=n>=o,i=r?n:o,s=r?o:n,a=s/2,c=Math.abs(i-s),l=e.hole_offset_x||0,h=e.hole_offset_y||0,d=(0,zf.union)((0,Fd.cuboid)({center:[0,0,0],size:r?[c,s,this.ctx.pcbThickness*1.5]:[s,c,this.ctx.pcbThickness*1.5]}),(0,Fd.cylinder)({center:r?[-c/2,0,0]:[0,-c/2,0],radius:a,height:this.ctx.pcbThickness*1.5}),(0,Fd.cylinder)({center:r?[c/2,0,0]:[0,c/2,0],radius:a,height:this.ctx.pcbThickness*1.5})),u=(e.hole_ccw_rotation||0)*Math.PI/180,_=l*Math.cos(u)-h*Math.sin(u),p=l*Math.sin(u)+h*Math.cos(u);d=(0,u5.rotateZ)(u,d);let m=(0,u5.translate)([e.x+_,e.y+p,0],d);if(!t.dontCutBoard)this.boardGeom=(0,zf.subtract)(this.boardGeom,m),this.copperDrills.push({geom:m,platedHoleIndex:this.platedHoleGeoms.length});let A=Z0e(e,this.ctx,{clipGeom:this.boardClipGeom});this.platedHoleGeoms.push(A)}else if(e.shape==="hole_with_polygon_pad"){let n=e.pad_outline;if(!Array.isArray(n)||n.length<3)return;let o=this.ctx.pcbThickness*1.5,r=IEe(e,o,{sizeDelta:2*wi}),i=IEe(e,o,{sizeDelta:-2*wi});if(!r||!i)return;if(!t.dontCutBoard)this.boardGeom=(0,zf.subtract)(this.boardGeom,r),this.copperDrills.push({geom:r,platedHoleIndex:this.platedHoleGeoms.length});let s=Z0e(e,this.ctx,{clipGeom:this.boardClipGeom});this.platedHoleGeoms.push(s)}}processHole(e){if(!this.boardGeom)return;let t=this.ctx.pcbThickness*1.5;if(e.hole_shape==="circle"){let n=(0,Fd.cylinder)({center:[e.x,e.y,0],radius:e.hole_diameter/2+wi,height:t});this.boardGeom=(0,zf.subtract)(this.boardGeom,n);let o=(0,Fd.cylinder)({center:[e.x,e.y,0],radius:e.hole_diameter/2+wi/2,height:t});this.copperDrills.push({geom:o})}else if(e.hole_shape==="pill"||e.hole_shape==="rotated_pill"||e.hole_shape==="rect"||e.hole_shape==="oval"){let n=e.hole_width??e.hole_diameter,o=e.hole_height??e.hole_diameter,r=e.ccw_rotation??e.rotation??0,i=0.02,s=(l,h,d,u)=>{if(l<=0||h<=0)return null;if(e.hole_shape==="rect")return(0,Fd.cuboid)({center:[0,0,0],size:[l,h,d]});if(u)return(0,u5.translate)([0,0,-d/2],(0,wdt.extrudeLinear)({height:d},(0,Fd.ellipse)({radius:[l/2,h/2]})));let _=Math.min(l,h)/2,p=Math.abs(l-h);if(l>h)return(0,zf.union)((0,Fd.cuboid)({center:[0,0,0],size:[p,h,d]}),(0,Fd.cylinder)({center:[-p/2,0,0],radius:_,height:d}),(0,Fd.cylinder)({center:[p/2,0,0],radius:_,height:d}));return(0,zf.union)((0,Fd.cuboid)({center:[0,0,0],size:[l,p,d]}),(0,Fd.cylinder)({center:[0,-p/2,0],radius:_,height:d}),(0,Fd.cylinder)({center:[0,p/2,0],radius:_,height:d}))},a=s(n,o,t,e.hole_shape==="oval"),c=s(n-0.04,o-0.04,t,e.hole_shape==="oval");if(a&&r!==0)a=(0,u5.rotateZ)(r*Math.PI/180,a);if(c&&r!==0)c=(0,u5.rotateZ)(r*Math.PI/180,c);if(a){let l=(0,u5.translate)([e.x,e.y,0],a);this.boardGeom=(0,zf.subtract)(this.boardGeom,l)}if(c){let l=(0,u5.translate)([e.x,e.y,0],c);this.copperDrills.push({geom:l})}}}processVia(e){if(!this.boardGeom)return;let t;if(typeof e.outer_diameter==="number"&&typeof e.hole_diameter==="number"){let n=Wzi({x:e.x,y:e.y,outerDiameter:e.outer_diameter,holeDiameter:e.hole_diameter,thickness:this.ctx.pcbThickness}),o=n;if(this.boardClipGeom)o=(0,zf.intersect)(this.boardClipGeom,n),o=(0,Mdt.colorize)(jc.copper,o);t=this.viaGeoms.length,this.viaGeoms.push(o)}if(typeof e.hole_diameter==="number"){let n=Xzi({x:e.x,y:e.y,holeDiameter:e.hole_diameter,thickness:this.ctx.pcbThickness});this.boardGeom=(0,zf.subtract)(this.boardGeom,n),this.copperDrills.push({geom:n,viaIndex:t})}}finalize(){if(!this.boardGeom)return;let e=this.copperDrills.map((o)=>({...o,bounds:(0,NUn.measureBoundingBox)(o.geom)})),t=(o,r,i)=>{let s=(0,NUn.measureBoundingBox)(o),a=e.filter((c)=>c[i]!==r&&[0,1,2].every((l)=>c.bounds[0][l]<=s[1][l]&&c.bounds[1][l]>=s[0][l])).map((c)=>c.geom);return(0,Mdt.colorize)(jc.copper,a.length?(0,zf.subtract)(o,(0,zf.union)(...a)):o)};this.platedHoleGeoms=this.platedHoleGeoms.map((o,r)=>t(o,r,"platedHoleIndex")),this.viaGeoms=this.viaGeoms.map((o,r)=>t(o,r,"viaIndex"));let n=x0t(this.board);if(this.boardGeom=(0,Mdt.colorize)([n.r,n.g,n.b],this.boardGeom),this.finalGeoms=[this.boardGeom,...this.platedHoleGeoms,...this.viaGeoms],this.onCompleteCallback)this.onCompleteCallback(this.finalGeoms)}getGeoms(){return this.finalGeoms}},qzi=(e)=>{let[t,n]=ite.useState(null),o=ite.useRef(!1);return ite.useEffect(()=>{let r=!1;if(!e){n(null);return}if(!e.some((l)=>l.type==="pcb_board"||l.type==="pcb_panel")){n(null);return}let s=kzi(e);n(s);let a=new $zi(e,(l)=>{});return(async()=>{if(o.current)return;o.current=!0;try{let l=!1;while(!l&&!r)if(l=a.step(1),!l)await new Promise((h)=>setTimeout(h,0));if(!r)n(a.getGeoms())}catch(l){console.error("Error during board geometry building:",l)}finally{o.current=!1}})(),()=>{r=!0}},[e]),t},Jzi=({children:e,parent:t,position:n,rotation:o,scale:r,color:i,fontSize:s,anchorX:a,anchorY:c,depthOffset:l})=>{let{rootObject:h}=I_(),d=oMe.useMemo(()=>{let u=new $j;if(u.text=e,n)u.position.fromArray(n);if(o)u.rotation.fromArray(o);if(r)u.scale.fromArray(r);return u.color=i||"white",u.fontSize=s||1,u.anchorX=a||"center",u.anchorY=c||"middle",u.depthOffset=l||0,u.font=null,u.sync(),u},[e,n,o,r,i,s,a,c,l]);return oMe.useEffect(()=>{let u=t||h;if(!u||!d)return;return u.add(d),()=>{u.remove(d),d.dispose()}},[h,t,d]),null},aqn=({error:e,cad_component:t})=>{let{rootObject:n}=I_(),[o,r]=y3.useState(!1),[i,s]=y3.useState(null),a=y3.useCallback((d)=>{if(d?.mousePosition)r(!0),s(d.mousePosition);else r(!1),s(null)},[]),c=y3.useCallback(()=>{r(!1),s(null)},[]),l=y3.useMemo(()=>{if(t?.position)return[t.position.x,t.position.y,t.position.z].map((u)=>Number.isNaN(u)?0:u);return[0,0,0]},[t]),h=y3.useMemo(()=>{let d=new dc;return d.position.fromArray(l),d},[l]);return h.userData.cad_component_id=t?.cad_component_id,h.userData.pcb_component_id=t?.pcb_component_id,y3.useEffect(()=>{if(!n)return;return n.add(h),()=>{n.remove(h)}},[n,h]),GB.jsxs(GB.Fragment,{children:[GB.jsxs(kpe,{isHovered:o,onHover:a,onUnhover:c,object:h,children:[GB.jsx(Zzi,{parent:h}),GB.jsx(Jzi,{parent:h,scale:[0.1,0.1,0.1],color:"red",anchorX:"center",anchorY:"middle",depthOffset:-99999,children:`${e.toString().slice(0,50)}...`})]}),o&&i?GB.jsx(M$n,{position:i,style:{fontFamily:"sans-serif",transform:"translate3d(-1rem, 0rem, 0)",backgroundColor:"white",padding:"6px",borderRadius:"4px",color:"red",pointerEvents:"none",userSelect:"none",WebkitUserSelect:"none",MozUserSelect:"none",msUserSelect:"none"},children:e.toString()}):null]})},Zzi=({parent:e})=>{let t=y3.useMemo(()=>{let n=new Qo(new qm(0.5,0.5,0.5),new Ls({depthTest:!1,transparent:!0,color:"red",opacity:0.5}));return n.renderOrder=999999,n.rotation.fromArray([Math.PI/4,Math.PI/4,0]),n},[]);return y3.useEffect(()=>(e.add(t),()=>{e.remove(t)}),[e,t]),null},eOi=(e)=>{if(e.length===0)return null;let t=e[0].x,n=e[0].y,o=e[0].x,r=e[0].y;for(let i=1;i<e.length;i++){let s=e[i];if(s.x<t)t=s.x;if(s.y<n)n=s.y;if(s.x>o)o=s.x;if(s.y>r)r=s.y}return{minX:t,minY:n,maxX:o,maxY:r}};function HA(e){if(e.outline&&e.outline.length>=3){let s=eOi(e.outline);return{...s,width:s.maxX-s.minX,height:s.maxY-s.minY,centerX:(s.minX+s.maxX)/2,centerY:(s.minY+s.maxY)/2}}let t=e.width??0,n=e.height??0,o=e.center?.x??0,r=e.center?.y??0;return{...{minX:o-t/2,maxX:o+t/2,minY:r-n/2,maxY:r+n/2},width:t,height:n,centerX:o,centerY:r}}function tOi(e,t,n){let o=C0t(e);if(!o.length)return[];let r=HA(t),i=Math.floor(r.width*n),s=Math.floor(r.height*n);if(i<=0||s<=0)return[];let a=new Set;for(let c of["top","bottom"]){let l=e.filter((p)=>(p.type==="pcb_smtpad"&&p.layer===c||p.type==="pcb_plated_hole"&&(!Array.isArray(p.layers)||p.layers.includes(c)))&&p.is_covered_with_solder_mask!==!0);if(!l.length)continue;let h=document.createElement("canvas");h.width=i,h.height=s;let d=h.getContext("2d");if(!d)continue;let u=new ai(d);u.configure({colorOverrides:{copper:{top:"white",bottom:"white",inner1:"white",inner2:"white",inner3:"white",inner4:"white",inner5:"white",inner6:"white",inner7:"white",inner8:"white"},drill:"rgba(0,0,0,0)"}}),u.setCameraBounds(r),u.drawElements(l,{layers:[c==="top"?"top_copper":"bottom_copper"],drawSoldermask:!1});let _=d.getImageData(0,0,i,s).data;for(let p of o){if(a.has(p)||!p.layers.includes(c))continue;let m=p.outer_diameter/2,A=(p.x-r.minX)*i/r.width,g=(r.maxY-p.y)*s/r.height,f=m*i/r.width,y=m*s/r.height;if(f<=0||y<=0)continue;let x=Math.max(0,Math.floor(A-f)),C=Math.min(i-1,Math.ceil(A+f)),b=Math.max(0,Math.floor(g-y)),I=Math.min(s-1,Math.ceil(g+y)),v=!1;for(let P=b;P<=I&&!v;P++)for(let M=x;M<=C;M++)if(_[(P*i+M)*4+3]>=128&&((M+0.5-A)/f)**2+((P+0.5-g)/y)**2<=1){v=!0;break}if(v)a.add(p)}}return[...a]}function nOi({ctx:e,vias:t,boardData:n,layer:o,width:r,height:i}){if(!t.length)return;let s=HA(n);e.save(),e.globalCompositeOperation="destination-out",e.fillStyle="black";for(let a of t){if(!a.layers.includes(o))continue;let c=(a.x-s.minX)*r/s.width,l=(o==="top"?s.maxY-a.y:a.y-s.minY)*i/s.height;e.beginPath(),e.ellipse(c,l,a.hole_diameter/2*r/s.width,a.hole_diameter/2*i/s.height,0,0,Math.PI*2),e.fill()}e.restore()}function oOi({layer:e,circuitJson:t,boardData:n,copperColor:o,traceTextureResolution:r}){let s=Ho(t).pcb_smtpad.list().filter((C)=>C.layer===e);if(s.length===0)return null;let a=Ho(t).pcb_hole.list(),c=Ho(t).pcb_plated_hole.list().filter((C)=>!Array.isArray(C.layers)||C.layers.includes(e)),l=Ho(t).pcb_via.list().filter((C)=>!Array.isArray(C.layers)||C.layers.includes(e)),h=Ho(t).pcb_cutout.list(),d=[...a,...c,...l],u=e==="top"?"top_copper":"bottom_copper",_=HA(n),p=document.createElement("canvas"),m=Math.floor(_.width*r),A=Math.floor(_.height*r);p.width=m,p.height=A;let g=p.getContext("2d");if(!g)return null;if(e==="bottom")g.translate(0,A),g.scale(1,-1);let f="rgba(0,0,0,0)",y=new ai(g);y.configure({colorOverrides:{copper:{top:o,bottom:o,inner1:o,inner2:o,inner3:o,inner4:o,inner5:o,inner6:o,inner7:o,inner8:o},copperPour:{top:f,bottom:f},drill:f,boardOutline:f,substrate:f,keepout:{top:f,bottom:f},fabricationNote:f,courtyard:{top:f,bottom:f},silkscreen:{top:f,bottom:f},soldermask:{top:f,bottom:f},soldermaskWithCopperUnderneath:{top:f,bottom:f},soldermaskOverCopper:{top:f,bottom:f}}}),y.setCameraBounds({minX:_.minX,maxX:_.maxX,minY:_.minY,maxY:_.maxY}),y.drawElements([...s,...d,...h],{layers:[u],drawSoldermask:!1,drawSoldermaskTop:!1,drawSoldermaskBottom:!1});let x=new ed(p);return x.generateMipmaps=!0,x.minFilter=Pd,x.magFilter=uc,x.anisotropy=16,x.needsUpdate=!0,x}var rOi=(e)=>{let t=e.filter((n)=>n.type==="pcb_panel");if(t.length===0)return null;if(t.length===1)return t[0].pcb_panel_id;return null};function iOi({layer:e,circuitJson:t,panelData:n,outlineColor:o="black",traceTextureResolution:r}){let i=rOi(t);if(!i)return null;let a=Ho(t).pcb_board.list().filter((m)=>m.pcb_panel_id===i||m.position_mode==="relative_to_panel_anchor"&&!m.pcb_panel_id);if(a.length===0)return null;let c=document.createElement("canvas"),l=Math.floor(n.width*r),h=Math.floor(n.height*r);c.width=l,c.height=h;let d=c.getContext("2d");if(!d)return null;if(e==="bottom")d.translate(0,h),d.scale(1,-1);d.strokeStyle=o,d.lineWidth=0.05*r;let u=(m)=>(m-n.center.x+n.width/2)*r,_=(m)=>(-(m-n.center.y)+n.height/2)*r;a.forEach((m)=>{if(m.outline&&m.outline.length>=2)d.beginPath(),m.outline.forEach((A,g)=>{let f=u(A.x),y=_(A.y);if(g===0)d.moveTo(f,y);else d.lineTo(f,y)}),d.closePath(),d.stroke();else{let{width:A,height:g}=m,{x:f,y}=m.center,x=u(f-A/2),C=_(y+g/2);d.strokeRect(x,C,A*r,g*r)}});let p=new ed(c);return p.generateMipmaps=!0,p.minFilter=Pd,p.magFilter=uc,p.anisotropy=16,p.needsUpdate=!0,p}function sOi({layer:e,circuitJson:t,boardData:n,traceColor:o,traceTextureResolution:r}){let i=Ho(t).pcb_trace.list(),s=Ho(t).pcb_via.list(),a=Ho(t).pcb_plated_hole.list(),c=e==="top"?"top_copper":"bottom_copper",l=i.filter((x)=>GAe(x).includes(c));if(l.length===0)return null;let h=a.filter((x)=>x.layers.includes(e)),d=[...l,...s,...h],u=HA(n),_=document.createElement("canvas"),p=Math.floor(u.width*r),m=Math.floor(u.height*r);_.width=p,_.height=m;let A=_.getContext("2d");if(!A)return null;if(e==="bottom")A.translate(0,m),A.scale(1,-1);let g="rgba(0,0,0,0)",f=new ai(A);f.configure({colorOverrides:{copper:{top:o,bottom:o,inner1:o,inner2:o,inner3:o,inner4:o,inner5:o,inner6:o,inner7:o,inner8:o},copperPour:{top:g,bottom:g},drill:g,boardOutline:g,substrate:g,keepout:{top:g,bottom:g},fabricationNote:g,courtyard:{top:g,bottom:g},silkscreen:{top:g,bottom:g},soldermask:{top:g,bottom:g},soldermaskWithCopperUnderneath:{top:g,bottom:g},soldermaskOverCopper:{top:g,bottom:g}}}),f.setCameraBounds({minX:u.minX,maxX:u.maxX,minY:u.minY,maxY:u.maxY}),f.drawElements(d,{layers:[c],clipContextElements:t,drawSoldermask:!1,drawSoldermaskTop:!1,drawSoldermaskBottom:!1});let y=new ed(_);return y.generateMipmaps=!0,y.minFilter=Pd,y.magFilter=uc,y.anisotropy=16,y.needsUpdate=!0,y}var aOi=(e)=>{let[t=0,n=0,o=0]=e;return`rgb(${Math.round(t*255)}, ${Math.round(n*255)}, ${Math.round(o*255)})`},cOi=8;function kUn({layer:e,circuitJson:t,boardData:n,traceTextureResolution:o=Kb,copperColor:r=aOi(jc.copper),onlyCoveredBySoldermask:i=!1}){let s=t.filter((P)=>P.type==="pcb_copper_pour"),a=e==="top"?"top_copper":"bottom_copper",c=s.filter((P)=>P.layer===e&&(!i||P.covered_with_solder_mask!==!1));if(c.length===0)return null;let l=t.filter((P)=>P.type==="pcb_hole"),h=t.filter((P)=>{if(P.type!=="pcb_plated_hole")return!1;return!Array.isArray(P.layers)||P.layers.includes(e)}),d=t.filter((P)=>{if(P.type!=="pcb_via")return!1;return!Array.isArray(P.layers)||P.layers.includes(e)}),u=[...l,...h,...d],_=HA(n),p=document.createElement("canvas"),m=Math.floor(_.width*o),A=Math.floor(_.height*o);p.width=m,p.height=A;let g=p.getContext("2d");if(!g)return null;if(e==="bottom")g.translate(0,A),g.scale(1,-1);let f="rgba(0,0,0,0)",y=r,x=r,C=(P,M)=>{if(P.length===0)return;let B=[...P,...u],T=new ai(g);T.configure({colorOverrides:{copper:{top:M,bottom:M,inner1:M,inner2:M,inner3:M,inner4:M,inner5:M,inner6:M,inner7:M,inner8:M},copperPour:{top:f,bottom:f},drill:f,boardOutline:f,substrate:f,keepout:{top:f,bottom:f},fabricationNote:f,courtyard:{top:f,bottom:f},silkscreen:{top:f,bottom:f},soldermask:{top:f,bottom:f},soldermaskWithCopperUnderneath:{top:f,bottom:f},soldermaskOverCopper:{top:f,bottom:f}}}),T.setCameraBounds({minX:_.minX,maxX:_.maxX,minY:_.minY,maxY:_.maxY}),T.drawElements(B,{layers:[a],drawSoldermask:!1,drawSoldermaskTop:!1,drawSoldermaskBottom:!1});for(let N=1;N<cOi;N+=1)T.drawElements(B,{layers:[a],drawSoldermask:!1,drawSoldermaskTop:!1,drawSoldermaskBottom:!1})},b=c.filter((P)=>P.covered_with_solder_mask!==!1),I=c.filter((P)=>P.covered_with_solder_mask===!1);if(C(b,y),!i)C(I,x);let v=new ed(p);return v.generateMipmaps=!0,v.minFilter=Pd,v.magFilter=uc,v.anisotropy=16,v.needsUpdate=!0,v}var LUn=(e,t)=>{e.setCameraBounds({minX:t.minX,maxX:t.maxX,minY:t.minY,maxY:t.maxY})},lOi=({ctx:e,layer:t,bounds:n,elements:o,copperColor:r})=>{let i=t==="top"?"top_copper":"bottom_copper",s=new ai(e);s.configure({colorOverrides:{copper:{top:r,bottom:r,inner1:r,inner2:r,inner3:r,inner4:r,inner5:r,inner6:r,inner7:r,inner8:r}}}),LUn(s,n),s.drawElements(o,{layers:[i]});let a=o.filter((d)=>d.type==="pcb_copper_text"&&d.is_knockout===!0);if(a.length===0)return;let c=document.createElement("canvas");c.width=e.canvas.width,c.height=e.canvas.height;let l=c.getContext("2d");if(!l)return;let h=new ai(l);h.configure({colorOverrides:{copper:{top:"rgb(255,255,255)",bottom:"rgb(255,255,255)",inner1:"rgb(255,255,255)",inner2:"rgb(255,255,255)",inner3:"rgb(255,255,255)",inner4:"rgb(255,255,255)",inner5:"rgb(255,255,255)",inner6:"rgb(255,255,255)",inner7:"rgb(255,255,255)",inner8:"rgb(255,255,255)"}}}),LUn(h,n),h.drawElements(a.map((d)=>({...d,is_knockout:!1})),{layers:[i]}),e.save(),e.globalCompositeOperation="destination-out",e.drawImage(c,0,0),e.restore()};function hOi({layer:e,circuitJson:t,boardData:n,copperColor:o="rgb(230, 153, 51)",traceTextureResolution:r=Kb}){let i=t.filter((u)=>u.type==="pcb_copper_text"&&("layer"in u)&&u.layer===e);if(i.length===0)return null;let s=HA(n),a=Math.floor(s.width*r),c=Math.floor(s.height*r);if(a<=0||c<=0)return null;let l=document.createElement("canvas");l.width=a,l.height=c;let h=l.getContext("2d");if(!h)return null;if(e==="bottom")h.translate(0,c),h.scale(1,-1);lOi({ctx:h,layer:e,bounds:s,elements:i,copperColor:o});let d=new ed(l);return d.generateMipmaps=!0,d.minFilter=Pd,d.magFilter=uc,d.anisotropy=16,d.needsUpdate=!0,d}var cqn=25.4,dOi=cqn/1000,uOi=/^\s*(-?\d*(?:\.\d+)?)(?:\s*(mm|mil|inch|in|"))?\s*$/i;function pOi(e){if(!e)return;let t=e.trim().toLowerCase();if(t==='"')return"in";if(t==="inch")return"in";return t}function cEe(e){if(e===null||e===void 0)return;if(typeof e==="number")return Number.isFinite(e)?e:void 0;if(typeof e!=="string")return;let t=e.trim();if(t.length===0)return;let n=t.match(uOi);if(!n){let a=Number.parseFloat(t);return Number.isFinite(a)?a:void 0}let[,o,r]=n,i=Number.parseFloat(o||"0");if(!Number.isFinite(i))return;switch(pOi(r)){case"mil":return i*dOi;case"in":return i*cqn;case"mm":case void 0:return i;default:return i}}function Ih(e,t){let n=cEe(e);return n===void 0?t:n}var mOi="rgb(255,243,204)",zd="rgba(0,0,0,0)",_Oi=(e,t)=>{e.setCameraBounds({minX:t.minX,maxX:t.maxX,minY:t.minY,maxY:t.maxY})},gOi=(e)=>{if(e.type==="pcb_fabrication_note_rect")return{...e,width:cEe(e.width)??0,height:cEe(e.height)??0,stroke_width:Ih(e.stroke_width,0.1),corner_radius:cEe(e.corner_radius)};if(e.type==="pcb_fabrication_note_path")return{...e,stroke_width:Ih(e.stroke_width,0.1)};if(e.type==="pcb_fabrication_note_text")return{...e,font_size:Ih(e.font_size,1)};if(e.type==="pcb_fabrication_note_dimension")return{...e,font_size:Ih(e.font_size,1),arrow_size:Ih(e.arrow_size,1),offset_distance:Ih(e.offset_distance,0)};return e},AOi=({ctx:e,layer:t,bounds:n,elements:o})=>{let r=`${t}_fabrication_note`,i=o.map(gOi),s=new ai(e);s.configure({colorOverrides:{copper:{top:zd,bottom:zd,inner1:zd,inner2:zd,inner3:zd,inner4:zd,inner5:zd,inner6:zd,inner7:zd,inner8:zd},copperPour:{top:zd,bottom:zd},drill:zd,boardOutline:zd,substrate:zd,keepout:{top:zd,bottom:zd},courtyard:{top:zd,bottom:zd},soldermask:{top:zd,bottom:zd},soldermaskWithCopperUnderneath:{top:zd,bottom:zd},soldermaskOverCopper:{top:zd,bottom:zd},silkscreen:{top:zd,bottom:zd},fabricationNote:mOi}}),_Oi(s,n),s.drawElements(i,{layers:[r]})},fOi=(e)=>({minX:e.center.x-e.width/2,maxX:e.center.x+e.width/2,minY:e.center.y-e.height/2,maxY:e.center.y+e.height/2,width:e.width,height:e.height,centerX:e.center.x,centerY:e.center.y}),yOi=(e,t)=>{let n=Math.min(e.minX,t.minX),o=Math.max(e.maxX,t.maxX),r=Math.min(e.minY,t.minY),i=Math.max(e.maxY,t.maxY);return{minX:n,maxX:o,minY:r,maxY:i,width:o-n,height:i-r,centerX:(n+o)/2,centerY:(r+i)/2}},rMe=(e,t)=>{let n=e.filter((s)=>s.type==="pcb_panel"),o=e.filter((s)=>s.type==="pcb_board"),r=n.find((s)=>s.pcb_panel_id===t.pcb_board_id)??n[0];if(r&&r.width>0&&r.height>0)return fOi(r);return(o.length>1?o:[t]).map((s)=>HA(s)).reduce((s,a)=>yOi(s,a))},xOi=(e,t)=>{if(!("layer"in e)||e.layer!==t)return!1;let n=e.type;return n.startsWith("pcb_fabrication_note_")&&n!=="pcb_fabrication_note_text"&&n!=="pcb_fabrication_note_dimension"};function COi({layer:e,circuitJson:t,boardData:n,traceTextureResolution:o=Kb}){let r=t.filter((d)=>xOi(d,e));if(r.length===0)return null;let i=rMe(t,n),s=Math.floor(i.width*o),a=Math.floor(i.height*o);if(s<=0||a<=0)return null;let c=document.createElement("canvas");c.width=s,c.height=a;let l=c.getContext("2d");if(!l)return null;if(e==="bottom")l.translate(0,a),l.scale(1,-1);AOi({ctx:l,layer:e,bounds:i,elements:r});let h=new ed(c);return h.generateMipmaps=!0,h.minFilter=Pd,h.magFilter=uc,h.anisotropy=16,h.needsUpdate=!0,h}var bOi=(e,t)=>{e.setCameraBounds({minX:t.minX,maxX:t.maxX,minY:t.minY,maxY:t.maxY})},IOi=({ctx:e,layer:t,bounds:n,elements:o,keepoutColor:r})=>{let i=t==="top"?"top_copper":"bottom_copper",s=new ai(e);s.configure({colorOverrides:{keepout:{top:r,bottom:r}}}),bOi(s,n),s.drawElements(o,{layers:[i],drawSoldermask:!1,drawSoldermaskTop:!1,drawSoldermaskBottom:!1})},vOi=(e,t)=>{if(e.type!=="pcb_keepout")return!1;if(!("layers"in e)||!Array.isArray(e.layers))return!0;return e.layers.includes(t)};function SOi({layer:e,circuitJson:t,boardData:n,traceTextureResolution:o=Kb,keepoutColor:r=e==="bottom"?"#4b72d2":"#d24b4b"}){let i=t.filter((u)=>vOi(u,e));if(i.length===0)return null;let s=HA(n),a=Math.floor(s.width*o),c=Math.floor(s.height*o);if(a<=0||c<=0)return null;let l=document.createElement("canvas");l.width=a,l.height=c;let h=l.getContext("2d");if(!h)return null;if(e==="bottom")h.translate(0,c),h.scale(1,-1);IOi({ctx:h,layer:e,bounds:s,elements:i,keepoutColor:r});let d=new ed(l);return d.generateMipmaps=!0,d.minFilter=Pd,d.magFilter=uc,d.anisotropy=16,d.needsUpdate=!0,d}var ad="rgba(0,0,0,0)",POi=(e,t)=>{e.setCameraBounds({minX:t.minX,maxX:t.maxX,minY:t.minY,maxY:t.maxY})},EOi=(e)=>{if(e.type==="pcb_note_line")return{...e,x1:Ih(e.x1,0),y1:Ih(e.y1,0),x2:Ih(e.x2,0),y2:Ih(e.y2,0),stroke_width:Ih(e.stroke_width,0.1)};if(e.type==="pcb_note_rect")return{...e,center:{x:Ih(e.center.x,0),y:Ih(e.center.y,0)},width:Ih(e.width,0),height:Ih(e.height,0),stroke_width:Ih(e.stroke_width,0.1),corner_radius:Ih(e.corner_radius,0)};if(e.type==="pcb_note_text")return{...e,anchor_position:{x:Ih(e.anchor_position.x,0),y:Ih(e.anchor_position.y,0)},font_size:Ih(e.font_size,1)};if(e.type==="pcb_note_path")return{...e,route:e.route.map((t)=>({...t,x:Ih(t.x,0),y:Ih(t.y,0)})),stroke_width:Ih(e.stroke_width,0.1)};if(e.type==="pcb_note_dimension")return{...e,from:{x:Ih(e.from.x,0),y:Ih(e.from.y,0)},to:{x:Ih(e.to.x,0),y:Ih(e.to.y,0)},font_size:Ih(e.font_size,1),arrow_size:Ih(e.arrow_size,1),offset_distance:Ih(e.offset_distance,0)};return e},MOi=({ctx:e,bounds:t,elements:n})=>{let o=n.map(EOi),r=new ai(e);r.configure({colorOverrides:{copper:{top:ad,bottom:ad,inner1:ad,inner2:ad,inner3:ad,inner4:ad,inner5:ad,inner6:ad,inner7:ad,inner8:ad},copperPour:{top:ad,bottom:ad},drill:ad,boardOutline:ad,substrate:ad,keepout:{top:ad,bottom:ad},courtyard:{top:ad,bottom:ad},soldermask:{top:ad,bottom:ad},soldermaskWithCopperUnderneath:{top:ad,bottom:ad},soldermaskOverCopper:{top:ad,bottom:ad},silkscreen:{top:ad,bottom:ad},fabricationNote:ad}}),POi(r,t),r.drawElements(o)},wOi=(e,t)=>{if(!("layer"in e)||e.layer!==t)return!1;let n=e.type;return n.startsWith("pcb_note_")&&n!=="pcb_note_dimension"};function BOi({layer:e,circuitJson:t,boardData:n,traceTextureResolution:o=Kb}){let r=t.filter((d)=>wOi(d,e));if(r.length===0)return null;let i=rMe(t,n),s=Math.floor(i.width*o),a=Math.floor(i.height*o);if(s<=0||a<=0)return null;let c=document.createElement("canvas");c.width=s,c.height=a;let l=c.getContext("2d");if(!l)return null;if(e==="bottom")l.translate(0,a),l.scale(1,-1);MOi({ctx:l,bounds:i,elements:r});let h=new ed(c);return h.generateMipmaps=!0,h.minFilter=Pd,h.magFilter=uc,h.anisotropy=16,h.needsUpdate=!0,h}var TOi="rgb(255,243,204)",$u="rgba(0,0,0,0)",lqn=(e,t,n)=>{let o=t==="top"?e.tented_on_top:e.tented_on_bottom,r="is_tented"in e?e.is_tented:void 0,i=t==="top"?n?.default_via_tented_on_top:n?.default_via_tented_on_bottom;return o??r??i??!1},DOi=(e,t,n,o)=>{if(e.type==="pcb_cutout")return!0;if(e.type==="pcb_via")return!o||!lqn(e,t,n);if(e.type==="pcb_hole"||e.type==="pcb_plated_hole")return!o||e.is_covered_with_solder_mask!==!0;return!1},NOi=(e,t)=>{e.setCameraBounds({minX:t.minX,maxX:t.maxX,minY:t.minY,maxY:t.maxY})},ROi=({ctx:e,layer:t,bounds:n,elements:o,circuitJson:r,silkscreenColor:i,soldermaskVisible:s})=>{let a=t==="top"?"top_silkscreen":"bottom_silkscreen",c=new ai(e);c.configure({colorOverrides:{copper:{top:$u,bottom:$u,inner1:$u,inner2:$u,inner3:$u,inner4:$u,inner5:$u,inner6:$u,inner7:$u,inner8:$u},copperPour:{top:$u,bottom:$u},drill:$u,boardOutline:$u,substrate:$u,keepout:{top:$u,bottom:$u},courtyard:{top:$u,bottom:$u},soldermask:{top:$u,bottom:$u},soldermaskWithCopperUnderneath:{top:$u,bottom:$u},soldermaskOverCopper:{top:$u,bottom:$u},silkscreen:{top:i,bottom:i},fabricationNote:TOi}}),NOi(c,n),c.drawElements(o,{layers:[a],clipContextElements:r});let l=r.flatMap((h)=>{if(h.type==="pcb_trace"){let u=e.boardOwnerMap?.get(h.pcb_trace_id),_=h.route.filter((p)=>p.route_type==="via"&&(!s||!lqn(p,t,u)));return _.length?[{...h,route:_}]:[]}let d=h.type==="pcb_via"?e.boardOwnerMap?.get(h.pcb_via_id):void 0;return DOi(h,t,d,s)?[h]:[]});c.drawElements(l,{layers:[a],clipContextElements:r,clearDrillHoles:!0})},QOi=(e,t)=>{if(!("layer"in e)||e.layer!==t)return!1;return e.type.startsWith("pcb_silkscreen_")};function kOi({layer:e,circuitJson:t,boardData:n,traceTextureResolution:o=Kb,silkscreenColor:r="rgb(255,255,255)",soldermaskVisible:i=!0}){let s=t.filter((_)=>QOi(_,e));if(s.length===0)return null;let a=rMe(t,n),c=Math.floor(a.width*o),l=Math.floor(a.height*o);if(c<=0||l<=0)return null;let h=document.createElement("canvas");h.width=c,h.height=l;let d=h.getContext("2d");if(!d)return null;if(e==="bottom")d.translate(0,l),d.scale(1,-1);ROi({ctx:d,layer:e,bounds:a,elements:s,circuitJson:t,silkscreenColor:r,soldermaskVisible:i});let u=new ed(h);return u.generateMipmaps=!0,u.minFilter=Pd,u.magFilter=uc,u.anisotropy=16,u.needsUpdate=!0,u}var epe=(e)=>{let[t=0,n=0,o=0]=e;return`rgb(${Math.round(t*255)}, ${Math.round(n*255)}, ${Math.round(o*255)})`},LOi=(e)=>{let t=epe(vzi[e.material]??jc.fr4SolderMaskGreen),n=e.material==="fr1"?epe(jc.fr1TracesWithMaskCopper):epe(jc.fr4TracesWithMaskGreen),o=iqn(e.solder_mask_color);if(!o)return{soldermask:t,soldermaskOverCopper:n,copper:epe(jc.copper),transparent:"rgba(0,0,0,0)"};let r=new Do().setRGB(jc.copper[0],jc.copper[1],jc.copper[2],tR);return{soldermask:DUn(o),soldermaskOverCopper:DUn(Rzi({soldermaskColor:o,copperColor:r,soldermaskOpacity:Dzi(e.solder_mask_color)})),copper:epe(jc.copper),transparent:"rgba(0,0,0,0)"}},HUn=(e,t)=>{e.setCameraBounds({minX:t.minX,maxX:t.maxX,minY:t.minY,maxY:t.maxY})},HOi=(e)=>e.type.startsWith("pcb_note_")||e.type.startsWith("pcb_fabrication_note_"),FOi=({ctx:e,layer:t,bounds:n,elements:o,boardData:r})=>{let i=LOi(r),s=t==="top"?"top_copper":"bottom_copper",a=new ai(e);a.configure({colorOverrides:{copper:{top:i.transparent,bottom:i.transparent,inner1:i.transparent,inner2:i.transparent,inner3:i.transparent,inner4:i.transparent,inner5:i.transparent,inner6:i.transparent,inner7:i.transparent,inner8:i.transparent},drill:i.transparent,boardOutline:i.transparent,substrate:i.transparent,keepout:{top:i.transparent,bottom:i.transparent},fabricationNote:i.transparent,silkscreen:{top:i.transparent,bottom:i.transparent},courtyard:{top:i.transparent,bottom:i.transparent},soldermask:{top:i.soldermask,bottom:i.soldermask},soldermaskWithCopperUnderneath:{top:i.soldermaskOverCopper,bottom:i.soldermaskOverCopper},soldermaskOverCopper:{top:i.soldermaskOverCopper,bottom:i.soldermaskOverCopper}}}),HUn(a,n);let c=o.filter((h)=>h.type!=="pcb_keepout"&&!HOi(h));a.drawElements(c,{layers:[s],drawSoldermask:!0,drawSoldermaskTop:t==="top",drawSoldermaskBottom:t==="bottom"});let l=c.filter((h)=>h.type==="pcb_copper_pour"&&h.layer===t&&h.covered_with_solder_mask===!1);if(l.length>0){e.save(),e.globalCompositeOperation="destination-out";let h=new ai(e);h.configure({colorOverrides:{copper:{top:i.copper,bottom:i.copper,inner1:i.copper,inner2:i.copper,inner3:i.copper,inner4:i.copper,inner5:i.copper,inner6:i.copper,inner7:i.copper,inner8:i.copper}}}),HUn(h,n),h.drawElements(l,{layers:[s]}),e.restore()}};function zOi({layer:e,circuitJson:t,boardData:n,traceTextureResolution:o=Kb}){let r=rMe(t,n),i=Math.floor(r.width*o),s=Math.floor(r.height*o);if(i<=0||s<=0)return null;let a=document.createElement("canvas");a.width=i,a.height=s;let c=a.getContext("2d");if(!c)return null;if(e==="bottom")c.translate(0,s),c.scale(1,-1);let l=t.some((d)=>d.type==="pcb_board")?t:[n,...t];FOi({ctx:c,layer:e,bounds:r,elements:l,boardData:n});let h=new ed(a);return h.generateMipmaps=!0,h.minFilter=Pd,h.magFilter=uc,h.anisotropy=16,h.needsUpdate=!0,h}var OOi=(e,t)=>{e.setCameraBounds({minX:t.minX,maxX:t.maxX,minY:t.minY,maxY:t.maxY})},VOi=({ctx:e,layer:t,bounds:n,elements:o,copperColor:r})=>{let i=t==="top"?"top_copper":"bottom_copper",s="rgba(0,0,0,0)",a=new ai(e);a.configure({colorOverrides:{copper:{top:r,bottom:r,inner1:r,inner2:r,inner3:r,inner4:r,inner5:r,inner6:r,inner7:r,inner8:r},drill:"rgba(0,0,0,0)",boardOutline:"rgba(0,0,0,0)",substrate:"rgba(0,0,0,0)",keepout:{top:"rgba(0,0,0,0)",bottom:"rgba(0,0,0,0)"},fabricationNote:"rgba(0,0,0,0)",silkscreen:{top:"rgba(0,0,0,0)",bottom:"rgba(0,0,0,0)"},courtyard:{top:"rgba(0,0,0,0)",bottom:"rgba(0,0,0,0)"},soldermask:{top:"rgba(0,0,0,0)",bottom:"rgba(0,0,0,0)"},soldermaskWithCopperUnderneath:{top:"rgba(0,0,0,0)",bottom:"rgba(0,0,0,0)"},soldermaskOverCopper:{top:"rgba(0,0,0,0)",bottom:"rgba(0,0,0,0)"}}}),OOi(a,n),a.drawElements(o,{layers:[i]})};function YOi({layer:e,circuitJson:t,boardData:n,copperColor:o="rgb(230, 153, 51)",traceTextureResolution:r=Kb}){let i=t.filter((u)=>{if(u.type==="pcb_via")return!0;if(u.type!=="pcb_plated_hole")return!1;let _=u;return!Array.isArray(_.layers)||_.layers.includes(e)});if(i.length===0)return null;let s=HA(n),a=Math.floor(s.width*r),c=Math.floor(s.height*r);if(a<=0||c<=0)return null;let l=document.createElement("canvas");l.width=a,l.height=c;let h=l.getContext("2d");if(!h)return null;if(e==="bottom")h.translate(0,c),h.scale(1,-1);VOi({ctx:h,layer:e,bounds:s,elements:i,copperColor:o});let d=new ed(l);return d.generateMipmaps=!0,d.minFilter=Pd,d.magFilter=uc,d.anisotropy=16,d.needsUpdate=!0,d}var FUn=(e)=>{let[t=0,n=0,o=0]=e;return`rgb(${Math.round(t*255)}, ${Math.round(n*255)}, ${Math.round(o*255)})`},Ddt=(e)=>Math.max(0,Math.min(255,e)),GOi=(e,t,n,o={})=>{let r=e.getImageData(0,0,t,n),i=r.data,s=Math.max(t-1,1),a=Math.max(n-1,1);for(let c=0;c<i.length;c+=4){if((i[c+3]??0)<16)continue;let h=i[c]??0,d=i[c+1]??0,u=i[c+2]??0,_=0.2126*h+0.7152*d+0.0722*u;if(!(d>h*1.35&&d>u*1.15&&_<90&&h<80&&u<80))continue;let m=c/4,A=m%t,g=Math.floor(m/t),f=A/s,y=g/a,x=f*0.62+(1-y)*0.38,C=Math.sin((f*1.15+y*0.35)*Math.PI)*0.04,b=0.74+x*0.18+C,I=o.includeReflection?(()=>{let N=f-0.36,D=y-0.22,L=Math.max(0,1-Math.hypot(N,D)/0.38);return L*L*0.07})():0,v=(h*0.9+3)*b,P=(d*1.08+15)*b,M=(u*1.28+13)*b;i[c]=Ddt(v*(1-I)+255*I),i[c+1]=Ddt(P*(1-I)+255*I),i[c+2]=Ddt(M*(1-I)+255*I)}e.putImageData(r,0,0)},UOi=({textures:e,boardData:t,traceTextureResolution:n,layer:o,openViaHoles:r})=>{if(!e.some((u)=>u?.image))return null;let s=HA(t),a=Math.floor(s.width*n),c=Math.floor(s.height*n);if(a<=0||c<=0)return null;let l=document.createElement("canvas");l.width=a,l.height=c+1;let h=l.getContext("2d");if(!h)return null;for(let u of e){if(!u?.image)continue;let _=u.image;h.drawImage(_,0,0,a,c)}nOi({ctx:h,vias:r,boardData:t,layer:o,width:a,height:c}),GOi(h,a,c,{includeReflection:o==="top"});let d=new ed(l);return d.generateMipmaps=!1,d.minFilter=uc,d.magFilter=uc,d.premultiplyAlpha=!0,d.anisotropy=16,d.needsUpdate=!0,d},WOi=({textures:e,soldermaskTexture:t,boardData:n,traceTextureResolution:o})=>{if(!t?.image||!e.some((h)=>h?.image))return null;let r=HA(n),i=Math.floor(r.width*o),s=Math.floor(r.height*o);if(i<=0||s<=0)return null;let a=document.createElement("canvas");a.width=i,a.height=s+1;let c=a.getContext("2d");if(!c)return null;for(let h of e){if(!h?.image)continue;c.drawImage(h.image,0,0,i,s)}c.globalCompositeOperation="destination-in",c.drawImage(t.image,0,0,i,s),c.globalCompositeOperation="source-over";let l=new ed(a);return l.colorSpace=Gye,l.generateMipmaps=!1,l.minFilter=uc,l.magFilter=uc,l.premultiplyAlpha=!1,l.needsUpdate=!0,l};function hqn({circuitJson:e,boardData:t,traceTextureResolution:n,visibility:o}){let r=FUn(jc.copper),i="rgb(255,255,255)",s=FUn(jc.copper),a=o?.boardBody??!0,c=tOi(e,t,n),l=(_)=>{let p=(_==="top"?o?.topMask:o?.bottomMask)??!0,m=(_==="top"?o?.topCopper:o?.bottomCopper)??!0,A=(_==="top"?o?.topSilkscreen:o?.bottomSilkscreen)??!0,g=o?.keepout??!0,f=p?zOi({layer:_,circuitJson:e,boardData:t,traceTextureResolution:n}):null,y=m?sOi({layer:_,circuitJson:e,boardData:t,traceColor:r,traceTextureResolution:n}):null,x=m?kUn({layer:_,circuitJson:e,boardData:t,traceTextureResolution:n,copperColor:s}):null,C=p&&m?kUn({layer:_,circuitJson:e,boardData:t,traceTextureResolution:n,copperColor:s,onlyCoveredBySoldermask:!0}):null,b=m?hOi({layer:_,circuitJson:e,boardData:t,copperColor:s,traceTextureResolution:n}):null,I=m?oOi({layer:_,circuitJson:e,boardData:t,copperColor:s,traceTextureResolution:n}):null,v=m?YOi({layer:_,circuitJson:e,boardData:t,copperColor:s,traceTextureResolution:n}):null,P=A?kOi({layer:_,circuitJson:e,boardData:t,silkscreenColor:"rgb(255,255,255)",traceTextureResolution:n,soldermaskVisible:p}):null,M=A?COi({layer:_,circuitJson:e,boardData:t,traceTextureResolution:n}):null,T=o?.pcbNotes??!1?BOi({layer:_,circuitJson:e,boardData:t,traceTextureResolution:n}):null,N=a?iOi({layer:_,circuitJson:e,panelData:t,traceTextureResolution:n}):null,D=g?SOi({layer:_,circuitJson:e,boardData:t,traceTextureResolution:n}):null,L=UOi({openViaHoles:c,textures:[x,y,I,v,f,b,P,M,T,N,D],boardData:t,traceTextureResolution:n,layer:_}),H=p&&m?WOi({textures:[y,C],soldermaskTexture:f,boardData:t,traceTextureResolution:n}):null;return{boardTexture:L,maskedCopperTexture:H}},h=t.num_layers??2,d=l("top"),u=h<2?null:l("bottom");return{topBoard:d.boardTexture,bottomBoard:u?.boardTexture??null,topMaskedCopper:d.maskedCopperTexture,bottomMaskedCopper:u?.maskedCopperTexture??null}}var X9={bumpScale:0.12,normalScale:0.08,roughness:0.7,roughnessBias:0.015,roughnessVariance:0.025,clearcoat:0.08,clearcoatRoughness:0.55,detailStrength:0.035},vEe={roughness:0.42,metalness:0.5,roughnessVariance:0.035,detailStrength:0.028},SEe=0.22,XOi=0.7,jOi=0.86,zUn={height:SEe,microSurfaceWeight:1,roughness:0.7,metalness:0.015,isExposedCopper:!1,isMaskedCopper:!1},KOi={height:XOi,microSurfaceWeight:0.9,roughness:0.54,metalness:0.025,isExposedCopper:!1,isMaskedCopper:!0},Ndt=(e)=>Math.max(0,Math.min(1,e)),OUn=(e)=>1-e,dpe=(e,t,n)=>{let o=Math.imul(e,374761393)^Math.imul(t,668265263)^n;return o=Math.imul(o^o>>>13,1274126177),((o^o>>>16)>>>0)/4294967295},VUn=(e)=>e*e*(3-2*e),Rdt=(e,t,n)=>e+(t-e)*n,tut=(e,t,n,o)=>{let r=e/n,i=t/n,s=Math.floor(r),a=Math.floor(i),c=VUn(r-s),l=VUn(i-a),h=Rdt(dpe(s,a,o),dpe(s+1,a,o),c),d=Rdt(dpe(s,a+1,o),dpe(s+1,a+1,o),c);return Rdt(h,d,l)},$Oi=(e,t,n)=>{let o=(tut(e,t,7,n+31)-0.5)*0.55,r=Math.sin(e*0.12+tut(e,t,44,n+37)*2)*0.22;return(o+r)*vEe.detailStrength},qOi=(e,t,n)=>{let o=(dpe(e,t,n+53)-0.5)*0.42,r=Math.sin(e*0.26+t*0.06)*0.2+Math.sin(t*0.31-e*0.04)*0.12;return(o+r)*0.045},JOi=(e,t,n,o)=>{if(o)return KOi;if(Nzi({red:e,green:t,blue:n}))return zUn;if(e>120&&t>70&&n<150&&e>t*1.05&&t>n*1.15)return{height:jOi,microSurfaceWeight:0.9,roughness:vEe.roughness,metalness:vEe.metalness,isExposedCopper:!0,isMaskedCopper:!1};if(e>170&&t>170&&n>160)return{height:SEe,microSurfaceWeight:0.4,roughness:0.76,metalness:0,isExposedCopper:!1,isMaskedCopper:!1};if(!(t>e*1.25&&t>n*1.05&&e<110&&t<180&&n<130))return{height:SEe,microSurfaceWeight:0.7,roughness:0.58,metalness:0.015,isExposedCopper:!1,isMaskedCopper:!1};return zUn},VPe=(e)=>{let t=new ed(e);return t.colorSpace=Gye,t.generateMipmaps=!1,t.minFilter=uc,t.magFilter=uc,t.wrapS=VC,t.wrapT=VC,t.needsUpdate=!0,t},dqn=(e,t)=>{let n=e.image;if(!n?.width||!n.height)return null;let{width:o,height:r}=n,i=n.getContext("2d");if(!i)return null;let s=t?.image,a=s?.getContext("2d"),c=s?.width??0,l=s?.height??0,h=a&&c&&l?a.getImageData(0,0,c,l):null,d=i.getImageData(0,0,o,r),u=d.data,_=new Float32Array(o*r),p=document.createElement("canvas"),m=document.createElement("canvas");p.width=m.width=o,p.height=m.height=r;let A=p.getContext("2d"),g=m.getContext("2d");if(!A||!g)return null;let f=A.createImageData(o,r),y=g.createImageData(o,r),x=f.data,C=y.data;for(let N=0;N<u.length;N+=4){let D=N/4,L=D%o,H=Math.floor(D/o);if((u[N+3]??0)<16){_[D]=OUn(SEe);continue}let O=h?Math.min(c-1,Math.floor(L/o*c)):0,U=h?Math.min(l-1,Math.floor(H/r*l)):0,j=h?h.data[(U*c+O)*4+3]??0:0,Y=JOi(u[N]??0,u[N+1]??0,u[N+2]??0,j>=16),X=o+r,K=Y.isExposedCopper?$Oi(L,H,X):Y.isMaskedCopper?qOi(L,H,X):0,J=Ndt(OUn(Y.height)+K*Y.microSurfaceWeight);_[D]=J;let ee=J*255;u[N]=u[N+1]=u[N+2]=ee,u[N+3]=255;let ne=(Y.isExposedCopper?Ndt(Y.roughness+K*0.7+(tut(L,H,36,X+17)-0.5)*vEe.roughnessVariance):Y.isMaskedCopper?Ndt(Y.roughness+K+X9.roughnessBias):Y.roughness)*255;x[N]=x[N+1]=x[N+2]=ne,x[N+3]=255;let re=Y.metalness*255;C[N]=C[N+1]=C[N+2]=re,C[N+3]=255}A.putImageData(f,0,0),g.putImageData(y,0,0);let b=document.createElement("canvas");b.width=o,b.height=r;let I=b.getContext("2d");if(!I)return null;I.putImageData(d,0,0);let v=document.createElement("canvas");v.width=o,v.height=r;let P=v.getContext("2d");if(!P)return null;let M=P.createImageData(o,r),B=M.data,T=(N,D)=>_[Math.max(0,Math.min(r-1,D))*o+Math.max(0,Math.min(o-1,N))]??0;for(let N=0;N<r;N++)for(let D=0;D<o;D++){let L=(T(D+1,N)-T(D-1,N))*4,H=(T(D,N+1)-T(D,N-1))*4,V=1/Math.sqrt(L*L+H*H+1),O=(N*o+D)*4;B[O]=(-L*V*0.5+0.5)*255,B[O+1]=(-H*V*0.5+0.5)*255,B[O+2]=(V*0.5+0.5)*255,B[O+3]=255}return P.putImageData(M,0,0),{bumpMap:VPe(b),normalMap:VPe(v),roughnessMap:VPe(p),metalnessMap:VPe(m)}};function YUn(e,t){let{texture:n,maskedCopperMask:o,yOffset:r,isBottomLayer:i,usePolygonOffset:s=!1,renderOrder:a=0,isFaux:c=!1}=e;if(!n)return null;let l=HA(t),h=new v2(l.width,l.height);n.colorSpace=tR;let d={map:n,transparent:!0,alphaTest:0.08,side:h7,depthWrite:!0,polygonOffset:s,polygonOffsetFactor:s?-4:0,polygonOffsetUnits:s?-4:0,opacity:c?bEe:1},u=dqn(n,o),_=new hA({...d,bumpMap:u?.bumpMap??null,bumpScale:X9.bumpScale,normalMap:u?.normalMap??null,normalScale:new go(X9.normalScale,X9.normalScale),roughnessMap:u?.roughnessMap??null,roughness:1,metalnessMap:u?.metalnessMap??null,metalness:1,clearcoat:X9.clearcoat,clearcoatRoughness:X9.clearcoatRoughness,envMapIntensity:0.18}),p=new Qo(h,_);if(p.position.set(l.centerX,l.centerY,r),i)p.rotation.set(Math.PI,0,0);return p.name=`${i?"bottom":"top"}-board-texture-plane`,p.renderOrder=a,f3(p,{castShadow:!1,receiveShadow:!0}),p}function ZOi(e,t,n,o=!1){let r=[];if(!e||!t||n===null)return r;let i=0.005,s=YUn({texture:e.topBoard,maskedCopperMask:e.topMaskedCopper,yOffset:n/2+i,isBottomLayer:!1,usePolygonOffset:!0,renderOrder:1,isFaux:o},t);if(s)r.push(s);let a=YUn({texture:e.bottomBoard,maskedCopperMask:e.bottomMaskedCopper,yOffset:-n/2-i,isBottomLayer:!0,usePolygonOffset:!0,renderOrder:1,isFaux:o},t);if(a)r.push(a);return r}var pqn=(e)=>{let{boardBody:t,topCopper:n,bottomCopper:o,topSilkscreen:r,bottomSilkscreen:i,topMask:s,bottomMask:a,keepout:c,pcbNotes:l}=e;return uqn.useMemo(()=>({boardBody:t,topCopper:n,bottomCopper:o,topSilkscreen:r,bottomSilkscreen:i,topMask:s,bottomMask:a,keepout:c,pcbNotes:l}),[t,n,o,r,i,s,a,c,l])},eVi=4000000,tVi=4096,nVi=1;function mqn(e,t,n={}){let{maxTexturePixels:o=eVi,maxTextureDimension:r=tVi,minTextureResolution:i=nVi}=n,s=HA(e);if(!Number.isFinite(s.width)||!Number.isFinite(s.height)||s.width<=0||s.height<=0)return t;let a=Math.max(s.width,s.height),c=r/a,l=Math.sqrt(o/(s.width*s.height)),h=Math.min(t,c,l);return Math.max(i,h)}function oVi({circuitJson:e,pcbThickness:t,isFaux:n=!1}){let{rootObject:o}=I_(),{visibility:r}=NG(),i=pqn(r),s=Xee.useMemo(()=>{let l=e.filter((u)=>u.type==="pcb_panel"),h=Ho(e).pcb_board.list();if(l.length>0){let u=l[0],_=h.find((p)=>p.pcb_panel_id===u.pcb_panel_id);return{type:"pcb_board",pcb_board_id:u.pcb_panel_id,center:u.center,width:u.width,height:u.height,thickness:_?.thickness??1.4,material:_?.material??"fr4",num_layers:_?.num_layers??2,solder_mask_color:_?.solder_mask_color}}let d=h.filter((u)=>!u.pcb_panel_id);return d.length>0?d[0]:null},[e]),a=Xee.useMemo(()=>{if(!s)return Kb;return mqn(s,Kb)},[s]),c=Xee.useMemo(()=>{if(!s?.width||!s.height)return null;return hqn({circuitJson:e,boardData:s,traceTextureResolution:a,visibility:i})},[e,s,a,i]);return Xee.useEffect(()=>{if(!o||!s||!c)return;let l=[],h=(m)=>{let A=["map","alphaMap","aoMap","bumpMap","displacementMap","emissiveMap","lightMap","metalnessMap","normalMap","roughnessMap","specularMap"],g=m;for(let f of A){let y=g[f];if(y&&y instanceof Bl)y.dispose(),g[f]=null}m.dispose()},d=({texture:m,maskedCopperMask:A,zOffset:g,isBottomLayer:f,name:y,usePolygonOffset:x=!1,depthWrite:C=!0,renderOrder:b=1})=>{if(!m)return null;let I=HA(s),v=new v2(I.width,I.height);m.colorSpace=tR;let P={map:m,transparent:!0,alphaTest:0.08,side:h7,depthWrite:C,polygonOffset:x,polygonOffsetFactor:x?-4:0,polygonOffsetUnits:x?-4:0,opacity:n?bEe:1},M=dqn(m,A),B=new hA({...P,bumpMap:M?.bumpMap??null,bumpScale:X9.bumpScale,normalMap:M?.normalMap??null,normalScale:new go(X9.normalScale,X9.normalScale),roughnessMap:M?.roughnessMap??null,roughness:1,metalnessMap:M?.metalnessMap??null,metalness:1,clearcoat:X9.clearcoat,clearcoatRoughness:X9.clearcoatRoughness,envMapIntensity:0.18}),T=new Qo(v,B);if(T.position.set(I.centerX,I.centerY,g),f)T.rotation.set(Math.PI,0,0);return T.name=y,T.renderOrder=b,T.frustumCulled=!1,f3(T,{castShadow:!1,receiveShadow:!0}),T},u=0.005,_=d({texture:c.topBoard,maskedCopperMask:c.topMaskedCopper,zOffset:t/2+u,isBottomLayer:!1,name:"jscad-top-board-texture",usePolygonOffset:!0});if(_)l.push(_),o.add(_);let p=d({texture:c.bottomBoard,maskedCopperMask:c.bottomMaskedCopper,zOffset:-t/2-u,isBottomLayer:!0,name:"jscad-bottom-board-texture",usePolygonOffset:!0});if(p)l.push(p),o.add(p);return()=>{for(let m of l){if(m.parent===o)o.remove(m);if(m.geometry.dispose(),Array.isArray(m.material))for(let A of m.material)h(A);else if(m.material instanceof cA)h(m.material)}c.topBoard?.dispose(),c.bottomBoard?.dispose()}},[o,s,c,t]),null}function rVi({stlUrl:e,stlData:t,mtlUrl:n,color:o,opacity:r=1,layerType:i}){let{rootObject:s}=I_(),[a,c]=vG.useState(null);vG.useEffect(()=>{let h=new mPe;if(t){try{let d=h.parse(t);c(d)}catch(d){console.error("Failed to parse STL data",d),c(null)}return}if(e)h.load(e,(d)=>{c(d)})},[e,t]);let l=vG.useMemo(()=>{if(!a)return null;let h=i==="board",d=new Ls({color:Array.isArray(o)?new Do(o[0],o[1],o[2]):o,transparent:r!==1,opacity:r,polygonOffset:h,polygonOffsetFactor:h?6:0,polygonOffsetUnits:h?6:0}),u=new Qo(a,d);return u.renderOrder=h?-1:1,f3(u,{castShadow:!h&&r===1,receiveShadow:!0}),u},[a,o,r,i]);return vG.useEffect(()=>{if(!s||!l)return;return s.add(l),()=>{if(s.remove(l),l.geometry.dispose(),Array.isArray(l.material))l.material.forEach((h)=>h.dispose());else l.material.dispose()}},[s,l]),null}function iVi({stlData:e,color:t,opacity:n=1,layerType:o}){let{visibility:r}=NG(),i=!0;if(o==="board")i=r.boardBody;else if(o==="top-copper")i=r.topCopper;else if(o==="bottom-copper")i=r.bottomCopper;else if(o==="top-silkscreen")i=r.topSilkscreen;else if(o==="bottom-silkscreen")i=r.bottomSilkscreen;if(!i)return null;return _qn.jsx(rVi,{stlData:e,color:t,opacity:n,layerType:o})}var sVi=(e)=>{if(!e||typeof e!=="object")return!1;let t=e;return t.type==="cad_cable"&&typeof t.cad_cable_id==="string"&&typeof t.cableprinter_string==="string"&&Array.isArray(t.path)},gqn=(e)=>e.filter(sVi),aVi=({x:e,y:t,z:n})=>[e,t,n],GUn=({path:e,pin1Position:t,end:n})=>{if(!t||e.length<2)return;let o=n==="start"?e[0]:e[e.length-1],r=n==="start"?e[1]:e[e.length-2];if(!o||!r)return;let i=new Dt(r.x-o.x,r.y-o.y,r.z-o.z);if(i.lengthSq()<0.000000000001)return;i.normalize();let s=new Dt(t.x-o.x,t.y-o.y,t.z-o.z);if(s.addScaledVector(i,-s.dot(i)),s.lengthSq()<0.000000000001)return;return s.normalize(),[s.x,s.y,s.z]},cVi=(e)=>{let t=aUn(e.cableprinter_string),n=mUn({definition:t,path:e.path.map(aVi),startPin1Side:GUn({path:e.path,pin1Position:e.from_connector_pin1_position,end:"start"}),endPin1Side:GUn({path:e.path,pin1Position:e.to_connector_pin1_position,end:"end"})}),o=new dc;o.name=`cad-cable-${e.cad_cable_id}`,o.userData={cadCableId:e.cad_cable_id,name:e.name};for(let r of n){let i=new ha;if(i.setAttribute("position",new jr(r.positions,3)),i.setIndex(r.indices),!r.smooth)i=i.toNonIndexed();i.computeVertexNormals();let[s,a,c,l]=r.color,h=new Ls({color:new Do(s,a,c),metalness:r.material?.metalness??0,roughness:r.material?.roughness??0.7,opacity:l,transparent:l<1,side:A0}),d=new Qo(i,h);d.name=`${o.name}:${r.name}`,f3(d,{castShadow:!0,receiveShadow:!0}),o.add(d)}return o},lVi=(e)=>{e.traverse((t)=>{if(!(t instanceof Qo))return;t.geometry.dispose();let n=Array.isArray(t.material)?t.material:[t.material];for(let o of n)o.dispose()})},Aqn=({cable:e})=>{let{rootObject:t}=I_(),n=iMe.useMemo(()=>{try{return cVi(e)}catch(o){return console.error(`Failed to render CAD cable ${e.cad_cable_id}`,o),null}},[e]);return iMe.useEffect(()=>{if(!n)return;return t.add(n),()=>{t.remove(n),lVi(n)}},[n,t]),null};function fqn({boardDimensions:e,boardCenter:t}){if(!e||!t)return[5,-5,5];let n=Math.max(e.width??0,1),o=Math.max(e.height??0,1),r=Math.max(n,o,5);return[t.x+r*0.4,t.y-r*0.7,r*0.9]}function hVi(e){let t=Ho(e).cad_component.list().filter((f)=>f.pcb_component_id),n=Ho(e).pcb_smtpad.list(),o=Ho(e).pcb_hole.list(),r=Ho(e).pcb_plated_hole.list(),i=Ho(e).pcb_via.list();if(t.length===0&&n.length===0&&o.length===0&&r.length===0&&i.length===0)return null;let s=[...o,...r,...i,...n],a=V1(s),{minX:c,maxX:l,minY:h,maxY:d}=a;for(let f of t)if(f.position){let y=f.position.x,x=f.position.y;c=Math.min(c,y),l=Math.max(l,y),h=Math.min(h,x),d=Math.max(d,x)}if(c===1/0)c=-10,l=10,h=-10,d=10;let u=2,_=Math.max(Math.abs(c),Math.abs(l))+u,p=Math.max(Math.abs(h),Math.abs(d))+u,m=Math.max(2*_,10),A=Math.max(2*p,10);return{type:"pcb_board",pcb_board_id:"faux-board",center:{x:0,y:0},width:m,height:A,thickness:1.4,material:"fr4",num_layers:2}}function yqn(e){if(Ho(e).pcb_board.list().length>0)return e;let n=hVi(e);if(!n)return e;let r=n.thickness/2;return[...e.map((s)=>{if(s.type==="cad_component"&&s.pcb_component_id){let a=s;if(a.position){let c=a.position.z??0;return{...a,position:{...a.position,z:c+r}}}}return s}),n]}var dVi=FB.forwardRef(({circuitJson:e,children:t,autoRotateDisabled:n,clickToInteractEnabled:o,onUserInteraction:r,onCameraControllerReady:i,resolveStaticAsset:s,referenceObject:a,hiddenCadComponentIds:c},l)=>{let h=g0t(t),d=FB.useMemo(()=>yqn(e??h),[e,h]),u=qzi(d),_=FB.useMemo(()=>{if(!d)return!1;try{let I=Ho(d).pcb_board.list()[0];return!!I&&I.pcb_board_id==="faux-board"}catch(I){return!1}},[d]),p=FB.useMemo(()=>{if(!d)return;try{let I=Ho(d).pcb_board.list()[0];if(!I)return;let v=HA(I);return{width:v.width,height:v.height}}catch(I){console.error(I);return}},[d]),m=FB.useMemo(()=>{if(!d)return;try{let I=Ho(d).pcb_board.list()[0];if(!I)return;let v=HA(I);return{x:v.centerX,y:v.centerY}}catch(I){console.error(I);return}},[d]),A=FB.useMemo(()=>{if(!d)return;let I=Ho(d).pcb_board.list()[0];if(!I)return;return JSON.stringify({pcbBoardId:I.pcb_board_id,center:m,dimensions:p})},[d,m,p]),g=FB.useMemo(()=>fqn({boardDimensions:p,boardCenter:m}),[p,m]),f=P$n(d),{stls:y,loading:x}=gzi(u),C=Ho(d).cad_component.list().filter((I)=>!c?.has(I.cad_component_id)),b=gqn(d);return zB.jsxs(nqn,{ref:l,autoRotateDisabled:n,initialCameraPosition:g,clickToInteractEnabled:o,boardDimensions:p,boardCenter:m,cameraSessionScope:A,referenceObject:a,onUserInteraction:r,onCameraControllerReady:i,children:[y.map(({stlData:I,color:v,layerType:P},M)=>zB.jsx(iVi,{stlData:I,color:v,opacity:M===0?_?0.8:0.95:1,layerType:P},`board-${M}`)),zB.jsx(oVi,{circuitJson:d,pcbThickness:f,isFaux:_}),C.map((I)=>zB.jsx(f0t,{fallback:({error:v})=>zB.jsx(aqn,{cad_component:I,error:v}),children:zB.jsx(O$n,{cad_component:I,circuitJson:d,resolveStaticAsset:s},I.cad_component_id)},I.cad_component_id)),b.map((I)=>zB.jsx(Aqn,{cable:I},I.cad_cable_id))]})}),gpe=new Set,nut=!1;function uVi(e,t,n=2){let o=t&&t.length,r=o?t[0]*n:e.length;if(gpe.size)gpe.clear();let i=xqn(e,0,r,n,!0),s=[];if(!i||i.next===i.prev)return s;let a=0,c=0,l=0;if(o)i=AVi(e,t,i,n);if(e.length>80*n){a=e[0],c=e[1];let h=a,d=c;for(let u=n;u<r;u+=n){let _=e[u],p=e[u+1];if(_<a)a=_;if(p<c)c=p;if(_>h)h=_;if(p>d)d=p}l=Math.max(h-a,d-c),l=l!==0?32767/l:0}return out(i,s,a,c,l),s}function xqn(e,t,n,o,r){let i=null;if(r===BVi(e,t,n,o)>0)for(let s=t;s<n;s+=o)i=XUn(s/o|0,e[s],e[s+1],i);else for(let s=n-o;s>=t;s-=o)i=XUn(s/o|0,e[s],e[s+1],i);if(i&&Ape(i,i.next))ype(i),i=i.next;return i}function SG(e,t=e){let n=t===e,o=e,r;do if(r=!1,o!==o.next&&(gpe.size===0||!gpe.has(o))&&(Ape(o,o.next)||y_(o.prev,o,o.next)===0)){if(n||o===t)t=o.prev;nut=!0,ype(o),o=o.prev,r=!0}else if(n||o!==t)o=o.next,r=!n;while(r||o!==t);return t}function out(e,t,n,o,r){if(r)vVi(e,n,o,r);let i=e,s=!1;while(e.prev!==e.next){let a=e.prev,c=e.next;if(y_(a,e,c)<0&&(r?mVi(e,n,o,r):pVi(e))){t.push(a.i,e.i,c.i),ype(e),e=c,i=c;continue}if(e=c,e===i){if(nut=!1,e=SG(e),nut){i=e;continue}if(!s){e=_Vi(e,t),i=e,s=!0;continue}gVi(e,t,n,o,r);break}}}function pVi(e){let t=e.prev,n=e,o=e.next,r=t.x,i=n.x,s=o.x,a=t.y,c=n.y,l=o.y,h=Math.min(r,i,s),d=Math.min(a,c,l),u=Math.max(r,i,s),_=Math.max(a,c,l),p=o.next;while(p!==t){if(p.x>=h&&p.x<=u&&p.y>=d&&p.y<=_&&!(r===p.x&&a===p.y)&&EEe(r,a,i,c,s,l,p.x,p.y)&&y_(p.prev,p,p.next)>=0)return!1;p=p.next}return!0}function mVi(e,t,n,o){let r=e.prev,i=e,s=e.next,a=r.x,c=i.x,l=s.x,h=r.y,d=i.y,u=s.y,_=Math.min(a,c,l),p=Math.min(h,d,u),m=Math.max(a,c,l),A=Math.max(h,d,u),g=aut(_,p,t,n,o),f=aut(m,A,t,n,o),y=e.prevZ;while(y&&y.z>=g){if(y.x>=_&&y.x<=m&&y.y>=p&&y.y<=A&&y!==s&&!(a===y.x&&h===y.y)&&EEe(a,h,c,d,l,u,y.x,y.y)&&y_(y.prev,y,y.next)>=0)return!1;y=y.prevZ}let x=e.nextZ;while(x&&x.z<=f){if(x.x>=_&&x.x<=m&&x.y>=p&&x.y<=A&&x!==s&&!(a===x.x&&h===x.y)&&EEe(a,h,c,d,l,u,x.x,x.y)&&y_(x.prev,x,x.next)>=0)return!1;x=x.nextZ}return!0}function _Vi(e,t){let n=e,o=!1;do{let r=n.prev,i=n.next.next;if(Iqn(r,n,n.next,i,!1)&&fpe(r,i)&&fpe(i,r))t.push(r.i,n.i,i.i),ype(n),ype(n.next),n=e=i,o=!0;n=n.next}while(n!==e);return o?SG(n):n}function gVi(e,t,n,o,r){let i=e;do{let s=i.next.next;while(s!==i.prev){if(i.i!==s.i&&EVi(i,s)){let a=vqn(i,s);i=SG(i,i.next),a=SG(a,a.next),out(i,t,n,o,r),out(a,t,n,o,r);return}s=s.next}i=i.next}while(i!==e)}var rut=!1;function AVi(e,t,n,o){let r=[];for(let i=0,s=t.length;i<s;i++){let a=t[i]*o,c=i<s-1?t[i+1]*o:e.length,l=xqn(e,a,c,o,!1);if(l===l.next)gpe.add(l);r.push(PVi(l))}r.sort(fVi),xVi(e.length/o,t.length),bqn(n,n),rut=!0;for(let i=0;i<r.length;i++)n=yVi(r[i],n);return rut=!1,SG(n)}function fVi(e,t){return e.x-t.x||e.y-t.y||(e.next.y-e.y)/(e.next.x-e.x)-(t.next.y-t.y)/(t.next.x-t.x)}function yVi(e,t){let n=bVi(e,t);if(!n)return t;let o=vqn(n,e),r=o.next;return bqn(n,r.next),SG(o,o.next),SG(n,n.next)}var Cqn=16,Qp=new Float64Array(0),PEe=0,iut=[],sut=[];function xVi(e,t){let n=Math.ceil((e+2*t)/Cqn)+t+2;if(Qp.length<n*4)Qp=new Float64Array(n*4);PEe=0}function bqn(e,t){let n=e;do{let o=PEe++;iut[o]=n;let r=n.x,i=n.y,s=n.x,a=n.y,c=0;do{let h=n.next;if(n.z=o,h.x<r)r=h.x;if(h.x>s)s=h.x;if(h.y<i)i=h.y;if(h.y>a)a=h.y;n=h}while(++c<Cqn&&n!==t);sut[o]=n;let l=o*4;Qp[l]=r,Qp[l+1]=i,Qp[l+2]=s,Qp[l+3]=a}while(n!==t)}function CVi(e,t){let n=e.z*4;if(t.x<Qp[n])Qp[n]=t.x;if(t.y<Qp[n+1])Qp[n+1]=t.y;if(t.x>Qp[n+2])Qp[n+2]=t.x;if(t.y>Qp[n+3])Qp[n+3]=t.y}function UUn(e){let t=sut[e];while(t.prev.next!==t)t=t.next;return sut[e]=t,t}function WUn(e){let t=iut[e];while(t.prev.next!==t)t=t.next;return iut[e]=t,t}function bVi(e,t){let n=t,{x:o,y:r}=e,i=-1/0,s;if(Ape(e,n))return n;for(let u=0,_=0;u<PEe;u++,_+=4){if(r<Qp[_+1]||r>Qp[_+3]||Qp[_]>o||Qp[_+2]<=i)continue;let p=UUn(u);n=WUn(u);do{if(n.prev.next===n){if(Ape(e,n.next))return n.next;else if(r<=n.y&&r>=n.next.y&&n.next.y!==n.y){let m=n.x+(r-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(m<=o&&m>i){if(i=m,s=n.x<n.next.x?n:n.next,m===o)return s}}}n=n.next}while(n!==p)}if(!s)return null;let a=s.x,c=s.y,l=Math.min(r,c),h=Math.max(r,c),d=1/0;for(let u=0,_=0;u<PEe;u++,_+=4){if(Qp[_+2]<a||Qp[_]>o||Qp[_+3]<l||Qp[_+1]>h)continue;let p=UUn(u);n=WUn(u);do{if(n.prev.next===n&&o>=n.x&&n.x>=a&&o!==n.x&&EEe(r<c?o:i,r,a,c,r<c?i:o,r,n.x,n.y)){let m=Math.abs(r-n.y)/(o-n.x);if((fpe(n,e)||n.y===r&&n.next.y===r&&n.next.x>o)&&(m<d||m===d&&(n.x>s.x||n.x===s.x&&IVi(s,n))))s=n,d=m}n=n.next}while(n!==p)}return s}function IVi(e,t){return y_(e.prev,e,t.prev)<0&&y_(t.next,e,e.next)<0}var m3=[],Yee=[],AG=new Uint32Array(0),tpe=new Uint32Array(0),npe=new Uint32Array(256);function vVi(e,t,n,o){let r=e,i=0;do r.z=aut(r.x,r.y,t,n,o),m3[i++]=r,r=r.next;while(r!==e);SVi(i);let s=null;for(let a=0;a<i;a++){let c=m3[a];if(c.prevZ=s,s)s.nextZ=c;s=c}s.nextZ=null,m3.fill(null,0,i),Yee.fill(null,0,i)}function SVi(e){if(e<=32){for(let t=1;t<e;t++){let n=m3[t],o=n.z,r=t-1;while(r>=0&&m3[r].z>o)m3[r+1]=m3[r],r--;m3[r+1]=n}return}if(AG.length<e)AG=new Uint32Array(e),tpe=new Uint32Array(e),Yee=Array(e);for(let t=0;t<e;t++)AG[t]=m3[t].z;YPe(e,m3,AG,Yee,tpe,0),YPe(e,Yee,tpe,m3,AG,8),YPe(e,m3,AG,Yee,tpe,16),YPe(e,Yee,tpe,m3,AG,24)}function YPe(e,t,n,o,r,i){npe.fill(0);for(let a=0;a<e;a++)npe[n[a]>>>i&255]++;let s=0;for(let a=0;a<256;a++){let c=npe[a];npe[a]=s,s+=c}for(let a=0;a<e;a++){let c=n[a],l=npe[c>>>i&255]++;o[l]=t[a],r[l]=c}}function aut(e,t,n,o,r){return e=(e-n)*r|0,t=(t-o)*r|0,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,e|t<<1}function PVi(e){let t=e,n=e;do{if(t.x<n.x||t.x===n.x&&t.y<n.y)n=t;t=t.next}while(t!==e);return n}function EEe(e,t,n,o,r,i,s,a){return(r-s)*(t-a)>=(e-s)*(i-a)&&(e-s)*(o-a)>=(n-s)*(t-a)&&(n-s)*(i-a)>=(r-s)*(o-a)}function EVi(e,t){let n=Ape(e,t)&&y_(e.prev,e,e.next)>0&&y_(t.prev,t,t.next)>0;return e.next.i!==t.i&&(n||fpe(e,t)&&fpe(t,e)&&(y_(e.prev,e,t.prev)!==0||y_(e,t.prev,t)!==0))&&!MVi(e,t)&&(n||wVi(e,t))}function y_(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function Ape(e,t){return e.x===t.x&&e.y===t.y}function Iqn(e,t,n,o,r=!0){let i=y_(e,t,n),s=y_(e,t,o),a=y_(n,o,e),c=y_(n,o,t);if((i>0&&s<0||i<0&&s>0)&&(a>0&&c<0||a<0&&c>0))return!0;if(!r)return!1;if(i===0&&GPe(e,n,t))return!0;if(s===0&&GPe(e,o,t))return!0;if(a===0&&GPe(n,e,o))return!0;if(c===0&&GPe(n,t,o))return!0;return!1}function GPe(e,t,n){return t.x<=Math.max(e.x,n.x)&&t.x>=Math.min(e.x,n.x)&&t.y<=Math.max(e.y,n.y)&&t.y>=Math.min(e.y,n.y)}function MVi(e,t){let n=Math.min(e.x,t.x),o=Math.max(e.x,t.x),r=Math.min(e.y,t.y),i=Math.max(e.y,t.y),s=e;do{let a=s.next;if(s.x>o&&a.x>o||s.x<n&&a.x<n||s.y>i&&a.y>i||s.y<r&&a.y<r){s=a;continue}if(s.i!==e.i&&a.i!==e.i&&s.i!==t.i&&a.i!==t.i&&Iqn(s,a,e,t))return!0;s=a}while(s!==e);return!1}function fpe(e,t){return y_(e.prev,e,e.next)<0?y_(e,t,e.next)>=0&&y_(e,e.prev,t)>=0:y_(e,t,e.prev)<0||y_(e,e.next,t)<0}function wVi(e,t){let n=e,o=!1,r=(e.x+t.x)/2,i=(e.y+t.y)/2;do{let s=n.next;if(n.y>i!==s.y>i&&r<(s.x-n.x)*(i-n.y)/(s.y-n.y)+n.x)o=!o;n=s}while(n!==e);return o}function vqn(e,t){let n=cut(e.i,e.x,e.y),o=cut(t.i,t.x,t.y),r=e.next,i=t.prev;return e.next=t,t.prev=e,n.next=r,r.prev=n,o.next=n,n.prev=o,i.next=o,o.prev=i,o}function XUn(e,t,n,o){let r=cut(e,t,n);if(!o)r.prev=r,r.next=r;else r.next=o.next,r.prev=o,o.next.prev=r,o.next=r;return r}function ype(e){if(e.next.prev=e.prev,e.prev.next=e.next,e.prevZ)e.prevZ.nextZ=e.nextZ;if(e.nextZ)e.nextZ.prevZ=e.prevZ;if(rut)CVi(e.prev,e.next)}function cut(e,t,n){return{i:e,x:t,y:n,prev:null,next:null,z:0,prevZ:null,nextZ:null}}function BVi(e,t,n,o){let r=0;for(let i=t,s=n-o;i<n;i+=o)r+=(e[s]-e[i])*(e[i+1]+e[s+1]),s=i;return r}var fG=0.0000001;function Sqn(e,t){if(!Number.isFinite(t)||t<0)throw Error("Board thickness must be finite and nonnegative");let n=e.map((a)=>{let{start:c,end:l,bend_angle:h,bend_radius:d}=a;if([c?.x,c?.y,l?.x,l?.y,h,d].some((x)=>!Number.isFinite(x))||d<=t/2||!["left","right"].includes(a.bend_side))throw Error(`Invalid PCB bend ${a.pcb_bend_id}: finite geometry and radius greater than half the board thickness are required`);let _=Math.hypot(l.x-c.x,l.y-c.y);if(_<fG||Math.abs(h)>180)throw Error(`Unsupported PCB bend ${a.pcb_bend_id}: distinct endpoints and angles within ±180 degrees are required`);let p=a.bend_side==="right"?1:-1,m=p*(l.y-c.y)/_,A=-p*(l.x-c.x)/_,g=h*Math.PI/180,f=d*Math.abs(g),y=c.x*m+c.y*A;return{id:a.pcb_bend_id,nx:m,ny:A,start:y-f/2,end:y+f/2,angle:g,radius:d,axisMin:Math.min(-A*c.x+m*c.y,-A*l.x+m*l.y),axisMax:Math.max(-A*c.x+m*c.y,-A*l.x+m*l.y)}}).filter((a)=>Math.abs(a.angle)>fG),o=n[0];if(o&&n.some((a)=>Math.abs(a.nx-o.nx)>fG||Math.abs(a.ny-o.ny)>fG))throw Error("Folded PCB rendering currently requires parallel bends with the same moving direction");n.sort((a,c)=>a.start-c.start);for(let a=1;a<n.length;a++)if(n[a].start<n[a-1].end-fG)throw Error("Overlapping PCB bend zones are not supported");let r=[...n].reverse(),i=({p:a,anchor:c,direction:l})=>{let h={...a};for(let d of r){let u=d.end-d.start,_=c.x*d.nx+c.y*d.ny-d.start,p=Math.max(0,Math.min(u,_)),m=d.angle*p/u,A=Math.cos(m),g=Math.sin(m),f=h.x*d.nx+h.y*d.ny-(l?0:d.start),y=h.x-(f+(l?0:d.start))*d.nx,x=h.y-(f+(l?0:d.start))*d.ny,C=Math.sign(d.angle)*d.radius,b=l?0:C*g-p*A,I=l?0:C*(1-A)-p*g,v=f*A-h.z*g+b;h={x:y+(v+(l?0:d.start))*d.nx,y:x+(v+(l?0:d.start))*d.ny,z:f*g+h.z*A+I}}return h},s=({p:a,anchor:c,direction:l})=>{let h=l?{x:0,y:0,z:0}:i({p:{x:0,y:0,z:0},anchor:c,direction:!1}),d={x:a.x-h.x,y:a.y-h.y,z:a.z-h.z},u=[{x:1,y:0,z:0},{x:0,y:1,z:0},{x:0,y:0,z:1}].map((p)=>i({p,anchor:c,direction:!0})),_=(p)=>p.x*d.x+p.y*d.y+p.z*d.z;return{x:_(u[0]),y:_(u[1]),z:_(u[2])}};return{bends:n,inversePoint:(a,c)=>s({p:a,anchor:c,direction:!1}),inverseDirection:(a,c)=>s({p:a,anchor:c,direction:!0}),point:(a,c=a)=>i({p:a,anchor:c,direction:!1}),direction:(a,c)=>i({p:a,anchor:c,direction:!0}),assertRigid(a,c){for(let l of n){let h=a.map((d)=>d.x*l.nx+d.y*l.ny);if(Math.max(...h)>l.start+fG&&Math.min(...h)<l.end-fG)throw Error(`${c} intersects PCB bend zone ${l.id}`)}}}}var U9=0.0000001;function Hpe(e){let t=e.flatMap((r)=>r.vertices);if(!t.length)return{min:{x:0,y:0,z:0},max:{x:0,y:0,z:0}};let n={x:1/0,y:1/0,z:1/0},o={x:-1/0,y:-1/0,z:-1/0};for(let r of t)for(let i of["x","y","z"])n[i]=Math.min(n[i],r[i]),o[i]=Math.max(o[i],r[i]);return{min:n,max:o}}function jUn(e,t){let n=t.bends.flatMap((a)=>{let c=Math.ceil(Math.abs(a.angle)/(Math.PI/36));return Array.from({length:c+1},(l,h)=>({b:a,d:a.start+(a.end-a.start)*h/c}))}),{min:o,max:r}=e.boundingBox,i=({polygon:a,nx:c,ny:l,d:h})=>{let d=a.map(({p:_})=>c*_.x+l*_.y-h);if(Math.min(...d)>=-U9||Math.max(...d)<=U9)return[a];let u=[[],[]];for(let _=0;_<2;_++){let p=_===0?1:-1;for(let m=0;m<a.length;m++){let A=a[m],g=(m+1)%a.length,f=a[g],y=d[m]*p,x=d[g]*p;if(y>=-U9)u[_].push(A);if(y>U9&&x<-U9||y<-U9&&x>U9){let C=y/(y-x);u[_].push({p:{x:A.p.x+(f.p.x-A.p.x)*C,y:A.p.y+(f.p.y-A.p.y)*C,z:A.p.z+(f.p.z-A.p.z)*C},uv:{u:A.uv.u+(f.uv.u-A.uv.u)*C,v:A.uv.v+(f.uv.v-A.uv.v)*C}})}}}return u.filter((_)=>_.length>=3)},s=[];for(let a of e.triangles){let c=a.pcbFace??(a.normal.z>0.8?"top":a.normal.z<-0.8?"bottom":"side"),l=[a.vertices.map((h,d)=>({p:h,uv:a.uvs?.[d]??{u:(h.x-o.x)/(r.x-o.x),v:1-(h.y-o.y)/(r.y-o.y)}}))];for(let{b:h,d}of n)l=l.flatMap((u)=>i({polygon:u,nx:h.nx,ny:h.ny,d}));for(let h of l){for(let d of t.bends){let u=h.reduce((_,{p})=>_+p.x*d.nx+p.y*d.ny,0)/h.length;if(u>d.start+U9&&u<d.end-U9&&h.some(({p:_})=>{let p=-d.ny*_.x+d.nx*_.y;return p<d.axisMin-U9||p>d.axisMax+U9}))throw Error(`PCB bend ${d.id} must span the full board cross-section through its bend zone`)}for(let d=1;d+1<h.length;d++){let u=[h[0],h[d],h[d+1]],_=u.map(({p:C})=>t.point(C)),[p,m,A]=_,g={x:m.x-p.x,y:m.y-p.y,z:m.z-p.z},f={x:A.x-p.x,y:A.y-p.y,z:A.z-p.z},y={x:g.y*f.z-g.z*f.y,y:g.z*f.x-g.x*f.z,z:g.x*f.y-g.y*f.x},x=Math.hypot(y.x,y.y,y.z);if(x<0.000000000001)continue;s.push({...a,vertices:_,normal:{x:y.x/x,y:y.y/x,z:y.z/x},pcbFace:c,uvs:u.map(({uv:C})=>C)})}}}return{...e,triangles:s,boundingBox:Hpe(s)}}var TVi=[{x:1,y:0,z:0},{x:0,y:1,z:0},{x:0,y:0,z:1}];function DVi(e,t){let[n,o,r]=[t.x,t.y,t.z].map((a)=>a*Math.PI/180),i={x:Math.cos(r)*e.x-Math.sin(r)*e.y,y:Math.sin(r)*e.x+Math.cos(r)*e.y,z:e.z},s={x:Math.cos(o)*i.x+Math.sin(o)*i.z,y:i.y,z:-Math.sin(o)*i.x+Math.cos(o)*i.z};return{x:s.x,y:Math.cos(n)*s.y-Math.sin(n)*s.z,z:Math.sin(n)*s.y+Math.cos(n)*s.z}}function NVi([e,t,n]){let o=Math.asin(Math.max(-1,Math.min(1,n.x))),r=Math.abs(n.x)<0.999999999999;return{x:(r?Math.atan2(-n.y,n.z):Math.atan2(t.z,t.y))*180/Math.PI,y:o*180/Math.PI,z:(r?Math.atan2(-t.x,e.x):0)*180/Math.PI}}function RVi({cadComponent:e,foldPcbs:t},n){return QVi({cadComponentPlacement:e,foldPcbs:t},n)}function QVi({cadComponentPlacement:e,foldPcbs:t},n){if(e.is_on_folded_board===!0===t)return e;let{fold:o,boardCenter:r,flatMount:i}=n,s={x:i.x-r.x,y:i.y-r.y,z:0};o.assertRigid([s],"CAD mount");let a={x:e.position.x-r.x,y:e.position.y-r.y,z:e.position.z},c=t?o.direction:o.inverseDirection,l=t?o.point(a,s):o.inversePoint(a,s),h=e.rotation??n.defaultRotation??{x:0,y:0,z:0},d=TVi.map((u)=>c(DVi(u,h),s));return{...e,position:{x:l.x+r.x,y:l.y+r.y,z:l.z},rotation:NVi(d),is_on_folded_board:t}}function kVi(e,t){let n=t.find((c)=>c.type==="pcb_component"&&c.pcb_component_id===e.pcb_component_id);if(n?.type!=="pcb_component"){if(e.is_on_folded_board)throw Error(`Folded CAD ${e.cad_component_id} requires its flat pcb_component reference`);return}let o=t.filter((c)=>c.type==="pcb_board"),r=n.positioned_relative_to_pcb_board_id,i=r?o.filter((c)=>c.pcb_board_id===r):o.filter((c)=>c.subcircuit_id&&c.subcircuit_id===n.subcircuit_id),s=i.length===1?i[0]:!r&&!i.length&&o.length===1?o[0]:void 0;if(!s)throw Error(`Cannot unambiguously resolve board for CAD ${e.cad_component_id}`);let a=t.filter((c)=>c.type==="pcb_bend"&&c.pcb_board_id===s.pcb_board_id);return{fold:Sqn(a,s.thickness??1.6),boardCenter:s.center,flatMount:n.center,defaultRotation:{x:(e.layer??n.layer)==="bottom"?180:0,y:0,z:0}}}function LVi(e,t){let n=e.some((o)=>o.type==="pcb_bend");return e.map((o)=>{if(o.type!=="cad_component")return o;let r=o;if(!n&&!r.is_on_folded_board)return o;if(r.is_on_folded_board===!0===t.foldPcbs)return o;let i=kVi(r,e);if(!i||!i.fold.bends.length&&!r.is_on_folded_board)return o;return RVi({cadComponent:r,foldPcbs:t.foldPcbs},i)})}function HVi({outline:e,bottom:t,top:n}){if(e.length<3||!Number.isFinite(t)||!Number.isFinite(n)||n<=t||e.some((c)=>!Number.isFinite(c.x)||!Number.isFinite(c.y)))throw Error("A finite polygon and positive extrusion thickness are required");let o=0;for(let[c,l]of e.entries()){let h=e[(c+1)%e.length];o+=l.x*h.y-h.x*l.y}if(Math.abs(o)<0.000000000001)throw Error("Degenerate polygon");let r=o>0?e:[...e].reverse(),i=[],s=({a:c,b:l,c:h,pcbFace:d})=>{let u={x:l.x-c.x,y:l.y-c.y,z:l.z-c.z},_={x:h.x-c.x,y:h.y-c.y,z:h.z-c.z},p={x:u.y*_.z-u.z*_.y,y:u.z*_.x-u.x*_.z,z:u.x*_.y-u.y*_.x},m=Math.hypot(p.x,p.y,p.z);if(m>0.000000000001)i.push({vertices:[c,l,h],normal:{x:p.x/m,y:p.y/m,z:p.z/m},pcbFace:d})},a=uVi(r.flatMap((c)=>[c.x,c.y]));for(let c=0;c<a.length;c+=3){let[l,h,d]=a.slice(c,c+3).map((u)=>r[u]);s({a:{...l,z:n},b:{...h,z:n},c:{...d,z:n},pcbFace:"top"}),s({a:{...d,z:t},b:{...h,z:t},c:{...l,z:t},pcbFace:"bottom"})}for(let c=0;c<r.length;c++){let l=r[c],h=r[(c+1)%r.length];s({a:{...l,z:t},b:{...h,z:t},c:{...h,z:n},pcbFace:"side"}),s({a:{...l,z:t},b:{...h,z:n},c:{...l,z:n},pcbFace:"side"})}return{triangles:i,boundingBox:Hpe(i)}}function FVi({stiffener:e,boardThickness:t,fold:n}){let o=e.adhesive_thickness??0;if(!Number.isFinite(o)||o<0||!Number.isFinite(e.thickness)||e.thickness<=0||!["top","bottom"].includes(e.layer))throw Error(`Invalid PCB stiffener ${e.pcb_stiffener_id}`);let r=e.shape==="polygon"?e.outline:(()=>{if(!(e.width>0&&e.height>0))throw Error("Invalid stiffener dimensions");let h=(e.rotation??0)*Math.PI/180;return[[-1,-1],[1,-1],[1,1],[-1,1]].map(([d,u])=>({x:e.center.x+d*e.width/2*Math.cos(h)-u*e.height/2*Math.sin(h),y:e.center.y+d*e.width/2*Math.sin(h)+u*e.height/2*Math.cos(h)}))})(),i=t/2+o,s=i+e.thickness,a=HVi({outline:r,bottom:e.layer==="top"?i:-s,top:e.layer==="top"?s:-i});if(!n)return a;n.assertRigid(a.triangles.flatMap((h)=>h.vertices),e.pcb_stiffener_id);let c={x:r.reduce((h,d)=>h+d.x,0)/r.length,y:r.reduce((h,d)=>h+d.y,0)/r.length,z:0},l=a.triangles.map((h)=>({...h,vertices:h.vertices.map((d)=>n.point(d,c)),normal:n.direction(h.normal,c)}));return{...a,triangles:l,boundingBox:Hpe(l)}}var zVi=(e)=>{let t=0;for(let o=0;o<e.length;o++){let r=(o+1)%e.length;if(e[o]&&e[r])t+=e[o][0]*e[r][1],t-=e[r][0]*e[o][1]}return t/2<=0};function OVi(e,t,n,o,r){let i,s=null;if(n.outline&&n.outline.length>=3){let a=n.outline.map((l)=>[l.x,l.y]);if(zVi(a))a=a.reverse();let c=t.ofPolygons([a]);r.push(c),s=c,i=e.extrude(c,o,void 0,void 0,void 0,!0),r.push(i)}else{if(n.outline&&n.outline.length>0)console.warn("Board outline has fewer than 3 points, falling back to rectangular board.");i=e.cube([n.width,n.height,o],!0),r.push(i),i=i.translate([n.center.x,n.center.y,0]),r.push(i)}return{boardOp:i,outlineCrossSection:s}}var VVi=64;function CG({Manifold:e,width:t,height:n,thickness:o,borderRadius:r}){let i=sqn(t,n,r);if(i<=0)return e.cube([t,n,o],!0);let s=[],a=t-2*i,c=n-2*i;if(a>0)s.push(e.cube([a,n,o],!0));if(c>0)s.push(e.cube([t,c,o],!0));return[[t/2-i,n/2-i],[-t/2+i,n/2-i],[-t/2+i,-n/2+i],[t/2-i,-n/2+i]].forEach(([h,d])=>{s.push(e.cylinder(o,i,i,VVi,!0).translate([h,d,0]))}),e.union(s)}var YVi=(e)=>{let t=0;for(let o=0;o<e.length;o++){let r=(o+1)%e.length;if(e[o]&&e[r])t+=e[o][0]*e[r][1],t-=e[r][0]*e[o][1]}return t/2<=0};function GVi(e,t,n,o,r){let i=[],s=Ho(n).pcb_cutout.list();for(let a of s){let c,l=o*1.5;switch(a.shape){case"rect":{let u=fL(a);if(typeof u==="number"&&u>0)c=CG({Manifold:e,width:a.width,height:a.height,thickness:l,borderRadius:u});else c=e.cube([a.width,a.height,l],!0);if(r.push(c),a.rotation){let _=c.rotate([0,0,a.rotation]);r.push(_),c=_}c=c.translate([a.center.x,a.center.y,0]),r.push(c);break}case"circle":c=e.cylinder(l,a.radius,-1,xg,!0),r.push(c),c=c.translate([a.center.x,a.center.y,0]),r.push(c);break;case"polygon":if(a.points.length<3){console.warn(`PCB Cutout [${a.pcb_cutout_id}] polygon has fewer than 3 points, skipping.`);continue}let h=a.points.map((u)=>[u.x,u.y]);if(YVi(h))h=h.reverse();let d=t.ofPolygons([h]);r.push(d),c=e.extrude(d,l,0,0,[1,1],!0),r.push(c);break;default:console.warn(`Unsupported cutout shape: ${a.shape} for cutout ${a.pcb_cutout_id}`);continue}if(c)i.push(c)}return{cutoutOps:i}}function Pqn({Manifold:e,x:t,y:n,diameter:o,thickness:r,segments:i=32}){return e.cylinder(r*1.2,o/2,o/2,i,!0).translate([t,n,0])}function Eqn({Manifold:e,x:t,y:n,holeDiameter:o,thickness:r,zOffset:i=0.001,segments:s=32}){let a=o/2+i;return e.cylinder(r*1.2,a,a,s,!0).translate([t,n,0])}function UVi(e,t,n,o,r){let i=[],s=Ho(n).pcb_hole.list(),a=(h,d,u)=>{let _=CG({Manifold:e,width:h,height:d,thickness:u,borderRadius:Math.min(h,d)/2});return r.push(_),_},c=(h,d,u)=>{let _=e.cube([h,d,u],!0);return r.push(_),_},l=(h,d,u)=>{let _=[];for(let p=0;p<u;p++){let m=2*Math.PI*p/u;_.push([h/2*Math.cos(m),d/2*Math.sin(m)])}return _};for(let h of s){let{hole_shape:d,x:u,y:_}=h,p=o*1.2,m=h.ccw_rotation??h.rotation??0,A=h.hole_width??h.hole_diameter,g=h.hole_height??h.hole_diameter,f=null;if(d==="circle"){f=Pqn({Manifold:e,x:u,y:_,diameter:h.hole_diameter,thickness:o,segments:xg}),i.push(f),r.push(f);continue}if(d==="pill"||d==="rotated_pill")f=a(A,g,p);else if(d==="rect")f=c(A,g,p);else if(d==="oval"){let y=l(A,g,xg),x=0;for(let b=0;b<y.length;b++){let I=(b+1)%y.length;x+=y[b][0]*y[I][1],x-=y[I][0]*y[b][1]}if(x<=0)y=y.reverse();let C=t.ofPolygons([y]);r.push(C),f=e.extrude(C,p,0,0,[1,1],!0),r.push(f)}if(f){if(m!==0){let x=f.rotate([0,0,m]);r.push(x),f=x}let y=f.translate([u,_,0]);r.push(y),i.push(y)}}return{nonPlatedHoleBoardDrills:i}}function fP(e){let t=new ha;if(t.setAttribute("position",new jr(e.vertProperties,3)),t.setIndex(new Vie(e.triVerts,1)),e.runIndex&&e.runIndex.length>1&&e.runOriginalID)for(let n=0;n<e.runIndex.length-1;n++){let o=e.runIndex[n],r=e.runIndex[n+1]-o;t.addGroup(o,r,0)}else t.addGroup(0,e.triVerts.length,0);return t}var ope=(e)=>{let t=0;for(let o=0;o<e.length;o++){let r=(o+1)%e.length;if(e[o]&&e[r])t+=e[o][0]*e[r][1],t-=e[r][0]*e[o][1]}return t/2<=0},UPe=(e,t,n)=>{let o=[];for(let r=0;r<n;r++){let i=2*Math.PI*r/n;o.push([e/2*Math.cos(i),t/2*Math.sin(i)])}return o},yG=new Do(...jc.copper),WPe=0.05,rpe=0.003,ipe=0.0005,spe=0.004;function WVi(e,t,n,o,r,i){let s=[],a=Ho(n).pcb_plated_hole.list(),c=[],l=[],h=(p,m,A)=>{let g=CG({Manifold:e,width:p,height:m,thickness:A,borderRadius:Math.min(p,m)/2});return r.push(g),g},d=({padOutline:p,thickness:m})=>{if(!Array.isArray(p)||p.length<3)return null;let A=p.map((y)=>[y.x,y.y]);if(ope(A))A=A.reverse();let g=t.ofPolygons([A]);r.push(g);let f=e.extrude(g,m,0,0,[1,1],!0);return r.push(f),f},u=({ph:p,depth:m,sizeDelta:A=0})=>{if(p.shape!=="hole_with_polygon_pad")return null;let f=p.pad_outline;if(!Array.isArray(f)||f.length<3)return null;let y=p.hole_shape||"circle",x=p.hole_offset_x||0,C=p.hole_offset_y||0,b=null;if(y==="circle"){let I=Math.max((p.hole_diameter??0)+A,wi),v=Math.max(I/2,wi/2);b=e.cylinder(m,v,v,xg,!0),r.push(b)}else{let I=p.hole_width??p.hole_diameter,v=p.hole_height??p.hole_diameter;if(!I||!v)return null;let P=Math.max(I+A,wi),M=Math.max(v+A,wi);if(y==="oval"){let B=UPe(P,M,xg);if(ope(B))B=B.reverse();let T=t.ofPolygons([B]);r.push(T),b=e.extrude(T,m,0,0,[1,1],!0),r.push(b)}else if(y==="pill"||y==="rotated_pill")b=CG({Manifold:e,width:P,height:M,thickness:m,borderRadius:Math.min(P,M)/2}),r.push(b)}if(!b)return null;if(x||C){let I=b.translate([x,C,0]);r.push(I),b=I}return b};a.forEach((p,m)=>{let A=Math.max(o-2*(rpe+ipe+spe),wi);if(p.shape==="circle"){let g=Eqn({Manifold:e,x:p.x,y:p.y,holeDiameter:p.hole_diameter*1.02,thickness:o,zOffset:W9,segments:xg});r.push(g),s.push(g);let f=A,y=e.cylinder(f,p.outer_diameter/2,p.outer_diameter/2,xg,!0);r.push(y);let x=e.cylinder(f*1.05,p.hole_diameter/2,p.hole_diameter/2,xg,!0);r.push(x);let C=y.subtract(x);r.push(C);let b=C.translate([p.x,p.y,0]);r.push(b);let I=b;if(i){let P=e.intersection([b,i]);r.push(P),I=P}l.push(I);let v=fP(I.getMesh());c.push({key:`ph-${p.pcb_plated_hole_id||m}`,geometry:v,color:yG})}else if(p.shape==="pill"){let{hole_width:g,hole_height:f}=p,y=0.4,x=p.outer_width??g+0.4,C=p.outer_height??f+0.4,b=g+2*W9,I=f+2*W9,v=o*1.2,P=h(b,I,v);if(p.ccw_rotation){let O=P.rotate([0,0,p.ccw_rotation]);r.push(O),P=O}let M=P.translate([p.x,p.y,0]);r.push(M),s.push(M);let B=A,T=h(x,C,B),N=h(g,f,B*1.05),D=T.subtract(N);if(r.push(D),p.ccw_rotation){let O=D.rotate([0,0,p.ccw_rotation]);r.push(O),D=O}let L=D.translate([p.x,p.y,0]);r.push(L);let H=L;if(i){let O=e.intersection([L,i]);r.push(O),H=O}l.push(H);let V=fP(H.getMesh());c.push({key:`ph-${p.pcb_plated_hole_id||m}`,geometry:V,color:yG})}else if(p.shape==="pill_hole_with_rect_pad"){if(p.hole_shape&&p.hole_shape!=="pill"||p.pad_shape&&p.pad_shape!=="rect")return;let{hole_width:g,hole_height:f}=p,y=p.hole_offset_x||0,x=p.hole_offset_y||0,{rect_pad_width:C,rect_pad_height:b}=p,I=fL(p),v=rpe,P=g+2*W9,M=f+2*W9,B=o*1.2,N=h(P,M,B).translate([y,x,0]).translate([p.x,p.y,0]);r.push(N),s.push(N);let D=CG({Manifold:e,width:C,height:b,thickness:Math.max(o-2*(v+ipe+spe),wi),borderRadius:I});r.push(D);let L=h(g,f,o*0.8).translate([y,x,0]);r.push(L);let H=e.union([D,L]);r.push(H);let V=h(Math.max(g-2*WPe,0.01),Math.max(f-2*WPe,0.01),o*1.2).translate([y,x,0]);r.push(V);let O=H.subtract(V);r.push(O);let U=O.translate([p.x,p.y,0]);r.push(U);let j=U;if(i){let X=e.intersection([U,i]);r.push(X),j=X}l.push(j);let Y=fP(j.getMesh());c.push({key:`ph-${p.pcb_plated_hole_id||m}`,geometry:Y,color:yG})}else if(p.shape==="rotated_pill_hole_with_rect_pad"){if(p.hole_shape&&p.hole_shape!=="rotated_pill"||p.pad_shape&&p.pad_shape!=="rect")return;let{hole_width:g,hole_height:f}=p,y=p.hole_offset_x||0,x=p.hole_offset_y||0,{rect_pad_width:C,rect_pad_height:b}=p,I=fL(p),v=rpe,P=g+2*W9,M=f+2*W9,B=o*1.2,T=h(P,M,B).translate([y,x,0]);if(p.hole_ccw_rotation){let X=T.rotate([0,0,p.hole_ccw_rotation]);r.push(X),T=X}let N=T.translate([p.x,p.y,0]);r.push(N),s.push(N);let D=CG({Manifold:e,width:C,height:b,thickness:Math.max(o-2*(v+ipe+spe),wi),borderRadius:I});if(r.push(D),p.rect_ccw_rotation){let X=D.rotate([0,0,p.rect_ccw_rotation]);r.push(X),D=X}let L=h(g,f,o*0.8).translate([y,x,0]);if(p.hole_ccw_rotation){let X=L.rotate([0,0,p.hole_ccw_rotation]);r.push(X),L=X}r.push(L);let H=e.union([D,L]);r.push(H);let V=h(Math.max(g-2*WPe,0.01),Math.max(f-2*WPe,0.01),o*1.2).translate([y,x,0]);if(p.hole_ccw_rotation){let X=V.rotate([0,0,p.hole_ccw_rotation]);r.push(X),V=X}r.push(V);let O=H.subtract(V);r.push(O);let U=O.translate([p.x,p.y,0]);r.push(U);let j=U;if(i){let X=e.intersection([U,i]);r.push(X),j=X}l.push(j);let Y=fP(j.getMesh());c.push({key:`ph-${p.pcb_plated_hole_id||m}`,geometry:Y,color:yG})}else if(p.shape==="hole_with_polygon_pad"){let g=p.pad_outline;if(!Array.isArray(g)||g.length<3)return;let f=u({ph:p,depth:o*1.2,sizeDelta:2*wi});if(!f)return;let y=f.translate([p.x,p.y,0]);r.push(y),s.push(y);let C=Math.max(o-2*(rpe+ipe+spe),wi),b=d({padOutline:g,thickness:C});if(!b)return;let I=u({ph:p,depth:o*1.02});if(!I)return;let v=u({ph:p,depth:o*0.8,sizeDelta:-2*wi})||I,P=e.union([b,I]);r.push(P);let M=P.subtract(v);r.push(M);let B=M.translate([p.x,p.y,0]);r.push(B);let T=B;if(i){let D=e.intersection([B,i]);r.push(D),T=D}l.push(T);let N=fP(T.getMesh());c.push({key:`ph-${p.pcb_plated_hole_id||m}`,geometry:N,color:yG})}else if(p.shape==="oval"){let{hole_width:g,hole_height:f}=p,y=p.outer_width??g+0.4,x=p.outer_height??f+0.4,C=g+2*W9,b=f+2*W9,I=o*1.2,v=UPe(C,b,xg);if(ope(v))v=v.reverse();let P=t.ofPolygons([v]);r.push(P);let M=e.extrude(P,I,0,0,[1,1],!0);if(r.push(M),p.ccw_rotation){let K=M.rotate([0,0,p.ccw_rotation]);r.push(K),M=K}let B=M.translate([p.x,p.y,0]);r.push(B),s.push(B);let T=A,N=UPe(y,x,xg);if(ope(N))N=N.reverse();let D=t.ofPolygons([N]);r.push(D);let L=e.extrude(D,T,0,0,[1,1],!0);r.push(L);let H=UPe(g,f,xg);if(ope(H))H=H.reverse();let V=t.ofPolygons([H]);r.push(V);let O=e.extrude(V,T*1.05,0,0,[1,1],!0);r.push(O);let U=L.subtract(O);if(r.push(U),p.ccw_rotation){let K=U.rotate([0,0,p.ccw_rotation]);r.push(K),U=K}let j=U.translate([p.x,p.y,0]);r.push(j);let Y=j;if(i){let K=e.intersection([j,i]);r.push(K),Y=K}l.push(Y);let X=fP(Y.getMesh());c.push({key:`ph-${p.pcb_plated_hole_id||m}`,geometry:X,color:yG})}else if(p.shape==="circular_hole_with_rect_pad"){if(p.hole_shape&&p.hole_shape!=="circle"||p.pad_shape&&p.pad_shape!=="rect")return;let g=p.hole_offset_x||0,f=p.hole_offset_y||0,y=Pqn({Manifold:e,x:p.x+g,y:p.y+f,diameter:p.hole_diameter,thickness:o,segments:xg});r.push(y),s.push(y);let x=p.rect_pad_width??p.hole_diameter,C=p.rect_pad_height??p.hole_diameter,b=fL(p),I=rpe,v=p.hole_diameter/2,P=CG({Manifold:e,width:x,height:C,thickness:Math.max(o-2*(I+ipe+spe),wi),borderRadius:b});r.push(P);let M=e.cylinder(o*0.8,v,v,xg,!0).translate([g,f,0]);r.push(M);let B=e.union([P,M]);r.push(B);let T=e.cylinder(o*1.2,Math.max(v-wi,0.01),Math.max(v-wi,0.01),xg,!0).translate([g,f,0]);r.push(T);let N=B.subtract(T);r.push(N);let D=N.translate([p.x,p.y,0]);r.push(D);let L=D;if(i){let V=e.intersection([D,i]);r.push(V),L=V}l.push(L);let H=fP(L.getMesh());c.push({key:`ph-${p.pcb_plated_hole_id||m}`,geometry:H,color:yG})}});let _;if(l.length>0)_=e.union(l),r.push(_);return{platedHoleBoardDrills:s,platedHoleCopperGeoms:c,platedHoleSubtractOp:_}}function XVi({Manifold:e,x:t,y:n,outerDiameter:o,holeDiameter:r,thickness:i,zOffset:s=0.001,segments:a=32}){let c=s;if(o<r)throw Error(`Invalid via geometry: outerDiameter (${o}) must be >= holeDiameter (${r})`);let l=Math.min(o/2,r/2+c),d=e.cylinder(i,l,-1,a,!0),u=i+2*s,_=e.cylinder(u,r/2,-1,a,!0);return d.subtract(_).translate([t,n,0])}var jVi=new Do(...jc.copper);function KVi(e,t,n,o,r,i=[]){let s=[],a=C0t(t),c=[],l=[];a.forEach((d,u)=>{let _;if(typeof d.hole_diameter==="number"){let p=Eqn({Manifold:e,x:d.x,y:d.y,holeDiameter:d.hole_diameter,thickness:n,zOffset:W9,segments:xg});o.push(p),s.push(p),_=p}if(typeof d.outer_diameter==="number"&&typeof d.hole_diameter==="number"){let p=XVi({Manifold:e,x:d.x,y:d.y,outerDiameter:d.outer_diameter,holeDiameter:d.hole_diameter,thickness:n,zOffset:W9,segments:xg});o.push(p);let m=p;if(r){let A=e.intersection([p,r]);o.push(A),m=A}l.push({key:`via-${d.pcb_via_id||u}`,copper:m,ownDrill:_})}});let h=[...i,...s].map((d)=>({drill:d,bounds:d.boundingBox()}));for(let{key:d,copper:u,ownDrill:_}of l){let p=u.boundingBox(),m=h.filter(({drill:g,bounds:f})=>g!==_&&[0,1,2].every((y)=>f.min[y]<=p.max[y]&&f.max[y]>=p.min[y])).map(({drill:g})=>g),A=u;if(m.length){let g=e.union(m);A=u.subtract(g),o.push(g,A)}c.push({key:d,geometry:fP(A.getMesh()),color:jVi})}return{viaBoardDrills:s,viaCopperGeoms:c}}var $Vi=(e,t,n)=>{let o=pqn(n),[r,i]=y5.useState(null),[s,a]=y5.useState(null),[c,l]=y5.useState(null),[h,d]=y5.useState(!0),u=y5.useRef([]),_=y5.useMemo(()=>{let g=t.filter((x)=>x.type==="pcb_panel"),f=Ho(t).pcb_board.list();if(g.length>0){let x=g[0],C=f.find((b)=>b.pcb_panel_id===x.pcb_panel_id);return{type:"pcb_board",pcb_board_id:x.pcb_panel_id,center:x.center,width:x.width,height:x.height,thickness:C?.thickness??1.4,material:C?.material??"fr4",num_layers:C?.num_layers??2,solder_mask_color:C?.solder_mask_color}}let y=f.filter((x)=>!x.pcb_panel_id);return y.length>0?y[0]:null},[t]),p=y5.useMemo(()=>{let g=Ho(t).pcb_board.list();return g.length>0&&g[0].pcb_board_id==="faux-board"},[t]),m=y5.useMemo(()=>{if(!_)return Kb;return mqn(_,Kb)},[_]);y5.useEffect(()=>{if(!e||!_){i(null),a(null),d(!1);return}if((_.width===0||!_.width)&&(_.height===0||!_.height)&&(!_.outline||_.outline.length<3)){i({platedHoles:[],vias:[]}),a(_.thickness??0),d(!1);return}d(!0),l(null);let{Manifold:g,CrossSection:f}=e,y=(b)=>{if(!b||typeof b.delete!=="function")return;try{b.delete()}catch(I){if(!(I instanceof Error)||!I.message?.includes("Manifold instance already deleted"))console.warn("Failed to delete Manifold instance",I)}};u.current.forEach(y),u.current=[];let x=null,C={};try{let b=_.thickness||1.4;a(b);let{boardOp:I,outlineCrossSection:v}=OVi(g,f,_,b,u.current),P=I,B=b+2,T=null,N=0.01;if(v){let K=v;if(N>0){let ee=v.offset(N);u.current.push(ee),K=ee}let J=g.extrude(K,B,void 0,void 0,void 0,!0);u.current.push(J),T=J}else{let K=(_.width||0)+2*N,J=(_.height||0)+2*N,ee=g.cube([K,J,B],!0);u.current.push(ee);let se=ee.translate([_.center.x,_.center.y,0]);u.current.push(se),T=se}let D=[],L=null,{nonPlatedHoleBoardDrills:H}=UVi(g,f,t,b,u.current);D.push(...H);let{platedHoleBoardDrills:V,platedHoleCopperGeoms:O,platedHoleSubtractOp:U}=WVi(g,f,t,b,u.current,T);D.push(...V),C.platedHoles=O;let{viaBoardDrills:j,viaCopperGeoms:Y}=KVi(g,t,b,u.current,T,D);if(D.push(...j),C.vias=Y,D.length>0){L=g.union(D),u.current.push(L);let K=U?g.union([L,U]):L;u.current.push(K);let J=P.subtract(K);if(u.current.push(J),P=J,U){let ee=U.subtract(L);u.current.push(ee);let se=ee.getMesh(),ne=fP(se);C.platedHoles=[{key:"plated-holes-union",geometry:ne,color:new Do(jc.copper[0],jc.copper[1],jc.copper[2])}]}}let{cutoutOps:X}=GVi(g,f,t,b,u.current);if(X.length>0){let K=g.union(X);u.current.push(K);let J=P.subtract(K);u.current.push(J),P=J}if(x=P,x){let K=x.getMesh(),J=fP(K);C.board={geometry:J,color:x0t(_),material:_.material,isFaux:p}}i(C)}catch(b){console.error("Error processing geometry with Manifold in hook:",b),l(b.message||"An unknown error occurred while processing geometry in hook."),i(null)}finally{d(!1)}return()=>{u.current.forEach(y),u.current=[]}},[e,t,_]);let A=y5.useMemo(()=>{if(!_||!m)return null;return hqn({circuitJson:t,boardData:_,traceTextureResolution:m,visibility:o})},[t,_,m,o]);return{geoms:r,textures:A,pcbThickness:s,error:c,isLoading:h,boardData:_,isFauxBoard:p}};function KUn(e,t){e.updateMatrix();let n=e.geometry.index?e.geometry.toNonIndexed():e.geometry,o=n.getAttribute("position"),r=n.getAttribute("uv"),i=[];for(let s=0;s<o.count;s+=3){let a=[0,1,2].map((u)=>{let _=new Dt().fromBufferAttribute(o,s+u).applyMatrix4(e.matrix);return{x:_.x-t.x,y:_.y-t.y,z:_.z}}),[c,l,h]=a,d=new Dt(l.x-c.x,l.y-c.y,l.z-c.z).cross(new Dt(h.x-c.x,h.y-c.y,h.z-c.z)).normalize();i.push({vertices:a,normal:{x:d.x,y:d.y,z:d.z},...r?{uvs:[0,1,2].map((u)=>({u:r.getX(s+u),v:r.getY(s+u)}))}:{}})}if(n!==e.geometry)n.dispose();return{triangles:i,boundingBox:Hpe(i)}}function Mqn(e,t){let n=[],o=[],r=[];for(let s of e.triangles)s.vertices.forEach((a,c)=>{n.push(a.x+t.x,a.y+t.y,a.z),o.push(s.normal.x,s.normal.y,s.normal.z),r.push(s.uvs?.[c]?.u??0,s.uvs?.[c]?.v??0)});let i=new ha;return i.setAttribute("position",new jr(n,3)),i.setAttribute("normal",new jr(o,3)),i.setAttribute("uv",new jr(r,2)),i.computeBoundingBox(),i.computeBoundingSphere(),i}function $Un(e,t,n){let o=e.clone();return o.geometry=Mqn(t,n.center),o.position.set(0,0,0),o.rotation.set(0,0,0),o.scale.set(1,1,1),o.updateMatrix(),o}function qVi(e,t,n,o){let r=n.filter((p)=>p.type==="pcb_board"),i=n.filter((p)=>p.type==="pcb_bend"),s=n.filter((p)=>p.type==="pcb_stiffener");if(!i.length&&!s.length)return{geometryMeshes:e,textureMeshes:t};let a=r[0];if(!a||r.length!==1||n.some((p)=>p.type==="pcb_panel")||[...i,...s].some((p)=>p.pcb_board_id!==a.pcb_board_id))throw Error("Flex rendering requires one board, matching board references, and no panel");let c=o?Sqn(i,a.thickness??1.6):void 0,l=e.find((p)=>p.name==="board-geom"),h=l?KUn(l,a.center):void 0,d=c?e.map((p)=>$Un(p,jUn(KUn(p,a.center),c),a)):[...e],u=c&&h?t.map((p)=>{p.updateMatrix();let m=p.matrix.clone().invert(),A=p.name.startsWith("bottom"),g=p.geometry.parameters,f=h.triangles.filter((x)=>A?x.normal.z<-0.9:x.normal.z>0.9).map((x)=>{let C=x.vertices.map((I)=>({...I,z:p.position.z})),b=C.map((I)=>{let v=new Dt(I.x+a.center.x,I.y+a.center.y,I.z).applyMatrix4(m);return{u:v.x/g.width+0.5,v:v.y/g.height+0.5}});return{...x,vertices:C,uvs:b}}),y=$Un(p,jUn({triangles:f,boundingBox:Hpe(f)},c),a);return p.geometry.dispose(),y}):t;for(let p of s){let m=new Qo(Mqn(FVi({stiffener:p,boardThickness:a.thickness??1.6,fold:c}),a.center),new Ls({color:p.material==="fr4"?"#879568":p.material==="polyimide"?"#bd7f27":"#b8bdc4",side:A0}));m.name="board-stiffener",f3(m),d.push(m)}let _=new dm;for(let p of[...d,...u])_.expandByObject(p);return{geometryMeshes:d,textureMeshes:u,bounds:{minX:_.min.x,maxX:_.max.x,minY:_.min.y,maxY:_.max.y,minZ:_.min.z,maxZ:_.max.z}}}var JVi=A0,ZVi=({material:e,color:t,side:n=JVi,isFaux:o=!1})=>{if(e==="fr4")return new hA({color:t,side:n,metalness:0,roughness:0.48,specularIntensity:0.3,ior:1.45,sheen:0,clearcoat:0.16,clearcoatRoughness:0.3,transparent:o,opacity:o?bEe:1,flatShading:!0,polygonOffset:!0,polygonOffsetFactor:1,polygonOffsetUnits:1});return new Ls({color:t,side:n,flatShading:!0,metalness:0.1,roughness:0.8,transparent:!0,opacity:o?bEe:0.9,polygonOffset:!0,polygonOffsetFactor:1,polygonOffsetUnits:1})};function eYi(e){let t=[];if(!e)return t;if(e.board?.geometry){let o=new Qo(e.board.geometry,ZVi({material:e.board.material,color:e.board.color,side:A0,isFaux:e.board.isFaux}));o.name="board-geom",f3(o,{castShadow:!1,receiveShadow:!0}),t.push(o)}let n=(o)=>{if(o)for(let r of o){let i=new Qo(r.geometry,new Ls({color:r.color,side:A0,flatShading:!0}));i.name=r.key,f3(i),t.push(i)}};return n(e.platedHoles),n(e.vias),t}var XPe;function tYi(){if(!XPe)XPe=(async()=>{let e=window.ManifoldModule??window.MANIFOLD??window.MANIFOLD_MODULE;if(e&&typeof e==="object"&&e.setup)return window.ManifoldModule=e,e;let n=await(e??(await import(ppe("manifold-3d","3.5.1","manifold.js"))).default)();return n.setup(),window.ManifoldModule=n,n})().catch((e)=>{throw XPe=void 0,e});return XPe}var nYi=({geometryMeshes:e,textureMeshes:t})=>{let{rootObject:n}=I_(),{visibility:o}=NG(),r=(i)=>{i.geometry.dispose();let s=Array.isArray(i.material)?i.material:[i.material];for(let a of s){if(!a)continue;let c=["map","alphaMap","aoMap","bumpMap","displacementMap","emissiveMap","lightMap","metalnessMap","normalMap","roughnessMap","specularMap"],l=a;for(let h of c){let d=l[h];if(d&&d instanceof Bl)d.dispose()}a.dispose()}};return q2.useEffect(()=>{if(!n)return;for(let i of e){let s=!0;if(i.name==="board-geom"||i.name==="board-stiffener")s=o.boardBody;else if(i.name.includes("plated_hole")||i.name.includes("via"))s=o.topCopper||o.bottomCopper;if(s)n.add(i)}return()=>{for(let i of e){if(i.parent===n)n.remove(i);r(i)}}},[n,e,o]),q2.useEffect(()=>{if(!n)return;for(let i of t)n.add(i);return()=>{for(let i of t){if(i.parent===n)n.remove(i);r(i)}}},[n,t]),null},oYi=({circuitJson:e,foldPcbs:t,autoRotateDisabled:n,clickToInteractEnabled:o,onUserInteraction:r,children:i,onCameraControllerReady:s,resolveStaticAsset:a,referenceObject:c,hiddenCadComponentIds:l})=>{let h=g0t(i),d=q2.useMemo(()=>yqn(e??h),[e,h]),[u,_]=q2.useState(null),[p,m]=q2.useState(null),{visibility:A}=NG();q2.useEffect(()=>{let L=!0;return tYi().then((H)=>{if(L)_(H)}).catch((H)=>{if(!L)return;console.error("Failed to initialize Manifold:",H),m(`Failed to initialize Manifold: ${H instanceof Error?H.message:"Unknown error"}`)}),()=>{L=!1}},[]);let{geoms:g,textures:f,pcbThickness:y,error:x,isLoading:C,boardData:b,isFauxBoard:I}=$Vi(u,d,A),v=q2.useMemo(()=>{try{let L=x$n(d,t),H=LVi(d,{foldPcbs:L});return{...qVi(eYi(g),ZOi(f,b,y,I),d,L),posedJson:H,error:void 0}}catch(L){return{error:L instanceof Error?L.message:String(L),geometryMeshes:[],textureMeshes:[],posedJson:d,bounds:void 0}}},[g,f,b,y,I,d,t]),P=q2.useMemo(()=>Ho(v.posedJson).cad_component.list().filter((L)=>!l?.has(L.cad_component_id)),[v.posedJson,l]),M=q2.useMemo(()=>gqn(v.posedJson),[v.posedJson]),B=q2.useMemo(()=>{if(!b)return;let L=HA(b);return{width:L.width,height:L.height}},[b]),T=q2.useMemo(()=>{if(!b)return;let L=HA(b);return{x:L.centerX,y:L.centerY}},[b]),N=q2.useMemo(()=>fqn({boardDimensions:B,boardCenter:T}),[B,T]),D=q2.useMemo(()=>{if(!b)return;return JSON.stringify({pcbBoardId:b.pcb_board_id,center:T,dimensions:B})},[b,T,B]);if(p)return _3.jsxs("div",{style:{color:"red",padding:"1em",border:"1px solid red",margin:"1em"},children:["Error: ",p]});if(!u)return _3.jsx("div",{style:{padding:"1em"},children:"Loading Manifold module..."});if(x||v.error)return _3.jsxs("div",{role:"alert",style:{color:"red",padding:"1em",border:"1px solid red",margin:"1em"},children:["Error: ",x??v.error]});if(C)return _3.jsx("div",{style:{padding:"1em"},children:"Processing board geometry..."});return _3.jsxs(nqn,{initialCameraPosition:N,autoRotateDisabled:n,clickToInteractEnabled:o,boardDimensions:B,boardCenter:T,cameraSessionScope:D,referenceObject:c,onUserInteraction:r,onCameraControllerReady:s,children:[_3.jsx(nYi,{geometryMeshes:v.geometryMeshes,textureMeshes:v.textureMeshes}),v.bounds&&_3.jsx(tqn,{bounds:v.bounds}),P.map((L)=>_3.jsx(f0t,{fallback:({error:H})=>_3.jsx(aqn,{cad_component:L,error:H}),children:_3.jsx(O$n,{cad_component:L,circuitJson:v.posedJson,resolveStaticAsset:a})},L.cad_component_id)),M.map((L)=>_3.jsx(Aqn,{cable:L},L.cad_cable_id))]})},qUn=oYi,rYi=Object.defineProperty,ste=(e,t)=>rYi(e,"name",{value:t,configurable:!0}),wqn=!!(typeof window<"u"&&window.document&&window.document.createElement);function ll(e,t,{checkForDefaultPrevented:n=!0}={}){return ste(function(r){if(e?.(r),n===!1||!r||!r.defaultPrevented)return t?.(r)},"handleEvent")}ste(ll,"composeEventHandlers");function iYi(e){if(!wqn)throw Error("Cannot access window outside of the DOM");return e?.ownerDocument?.defaultView??window}ste(iYi,"getOwnerWindow");function lut(e){if(!wqn)throw Error("Cannot access document outside of the DOM");return e?.ownerDocument??document}ste(lut,"getOwnerDocument");function Bqn(e,t=!1){let{activeElement:n}=lut(e);if(!n?.nodeName)return null;if(Tqn(n)&&n.contentDocument)return Bqn(n.contentDocument.body,t);if(t){let o=n.getAttribute("aria-activedescendant");if(o){let r=lut(n).getElementById(o);if(r)return r}}return n}ste(Bqn,"getActiveElement");function Tqn(e){return e.tagName==="IFRAME"}ste(Tqn,"isFrame");var sYi=Object.defineProperty,b0t=(e,t)=>sYi(e,"name",{value:t,configurable:!0});function hut(e,t){if(typeof e==="function")return e(t);else if(e!==null&&e!==void 0)e.current=t}b0t(hut,"setRef");function Nqn(...e){return(t)=>{let n=!1,o=e.map((r)=>{let i=hut(r,t);if(!n&&typeof i=="function")n=!0;return i});if(n)return()=>{for(let r=0;r<o.length;r++){let i=o[r];if(typeof i=="function")i();else hut(e[r],null)}}}}b0t(Nqn,"composeRefs");function vg(...e){return Dqn.useCallback(Nqn(...e),e)}b0t(vg,"useComposedRefs");var aYi=Object.defineProperty,Wb=(e,t)=>aYi(e,"name",{value:t,configurable:!0});function cYi(e,t){let n=$b.createContext(t);n.displayName=e+"Context";let o=Wb((i)=>{let{children:s,...a}=i,c=$b.useMemo(()=>a,Object.values(a));return I0t.jsx(n.Provider,{value:c,children:s})},"Provider");o.displayName=e+"Provider";function r(i,s={}){let{optional:a=!1}=s,c=$b.useContext(n);if(c)return c;if(t!==void 0)return t;if(a)return;throw Error(`\`${i}\` must be used within \`${e}\``)}return Wb(r,"useContext"),[o,r]}Wb(cYi,"createContext");function RG(e,t=[]){let n=[];function o(i,s){let a=$b.createContext(s);a.displayName=i+"Context";let c=n.length;n=[...n,s];let l=Wb((d)=>{let{scope:u,children:_,...p}=d,m=u?.[e]?.[c]||a,A=$b.useMemo(()=>p,Object.values(p));return I0t.jsx(m.Provider,{value:A,children:_})},"Provider");l.displayName=i+"Provider";function h(d,u,_={}){let{optional:p=!1}=_,m=u?.[e]?.[c]||a,A=$b.useContext(m);if(A)return A;if(s!==void 0)return s;if(p)return;throw Error(`\`${d}\` must be used within \`${i}\``)}return Wb(h,"useContext"),[l,h]}Wb(o,"createContext");let r=Wb(()=>{let i=n.map((s)=>$b.createContext(s));return Wb(function(a){let c=a?.[e]||i;return $b.useMemo(()=>({[`__scope${e}`]:{...a,[e]:c}}),[a,c])},"useScope")},"createScope");return r.scopeName=e,[o,Rqn(r,...t)]}Wb(RG,"createContextScope");function Rqn(...e){let t=e[0];if(e.length===1)return t;let n=Wb(()=>{let o=e.map((r)=>({useScope:r(),scopeName:r.scopeName}));return Wb(function(i){let s=o.reduce((a,{useScope:c,scopeName:l})=>{let d=c(i)[`__scope${l}`];return{...a,...d}},{});return $b.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])},"useComposedScopes")},"createScope");return n.scopeName=t.scopeName,n}Wb(Rqn,"composeContextScopes");var Qqn=!1,A3=globalThis?.document?kqn.useLayoutEffect:()=>{},lYi=Object.defineProperty,hYi=(e,t)=>lYi(e,"name",{value:t,configurable:!0}),JUn=ate[" useEffectEvent ".trim().toString()],ZUn=ate[" useInsertionEffect ".trim().toString()];function Lqn(e){if(typeof JUn==="function")return JUn(e);let t=ate.useRef(()=>{throw Error("Cannot call an event handler while rendering.")});if(typeof ZUn==="function")ZUn(()=>{t.current=e});else A3(()=>{t.current=e});return ate.useMemo(()=>(...n)=>t.current?.(...n),[])}hYi(Lqn,"useEffectEvent");var dYi=Object.defineProperty,Fpe=(e,t)=>dYi(e,"name",{value:t,configurable:!0}),uYi=qb[" useInsertionEffect ".trim().toString()]||A3;function sMe({prop:e,defaultProp:t,onChange:n=Fpe(()=>{},"onChange"),caller:o}){let[r,i,s]=Hqn({defaultProp:t,onChange:n}),a=e!==void 0,c=a?e:r;if(Qqn){let h=qb.useRef(e!==void 0);qb.useEffect(()=>{let d=h.current;if(d!==a)console.warn(`${o} is changing from ${d?"controlled":"uncontrolled"} to ${a?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`);h.current=a},[a,o])}let l=qb.useCallback((h)=>{if(a){let d=Fqn(h)?h(e):h;if(d!==e)s.current?.(d)}else i(h)},[a,e,i,s]);return[c,l]}Fpe(sMe,"useControllableState");function Hqn({defaultProp:e,onChange:t}){let[n,o]=qb.useState(e),r=qb.useRef(n),i=qb.useRef(t);return uYi(()=>{i.current=t},[t]),qb.useEffect(()=>{if(r.current!==n)i.current?.(n),r.current=n},[n,r]),[n,o,i]}Fpe(Hqn,"useUncontrolledState");function Fqn(e){return typeof e==="function"}Fpe(Fqn,"isFunction");var eWn=Symbol("RADIX:SYNC_STATE");function pYi(e,t,n,o){let{prop:r,defaultProp:i,onChange:s,caller:a}=t,c=r!==void 0,l=Lqn(s);if(Qqn){let A=j9.useRef(r!==void 0);j9.useEffect(()=>{let g=A.current;if(g!==c)console.warn(`${a} is changing from ${g?"controlled":"uncontrolled"} to ${c?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`);A.current=c},[c,a])}let h=[{...n,state:i}];if(o)h.push(o);let[d,u]=j9.useReducer((A,g)=>{if(g.type===eWn)return{...A,state:g.state};let f=e(A,g);if(c&&!Object.is(f.state,A.state))l(f.state);return f},...h),_=d.state,p=j9.useRef(_);j9.useEffect(()=>{if(p.current!==_){if(p.current=_,!c)l(_)}},[_,p,c]);let m=j9.useMemo(()=>{if(r!==void 0)return{...d,state:r};return d},[d,r]);return j9.useEffect(()=>{if(c&&!Object.is(r,d.state))u({type:eWn,state:r})},[r,d.state,c]),[m,u]}Fpe(pYi,"useControllableStateReducer");var mYi=Object.defineProperty,b3=(e,t)=>mYi(e,"name",{value:t,configurable:!0});function PG(e){let t=Yf.forwardRef((n,o)=>{let{children:r,...i}=n,s=null,a=!1,c=[];if(r=Xqn(r),Yf.Children.forEach(r,(u)=>{if(Uqn(u)){a=!0;let _=u,p="child"in _.props?_.props.child:_.props.children;while(v0t(p)&&typeof MEe==="function")p=MEe(p._payload);s=gYi(_,p),c.push(s?.props?.children)}else c.push(u)}),s)s=Yf.cloneElement(s,void 0,c);else if(!a&&Yf.Children.count(r)===1&&Yf.isValidElement(r))s=r;let l=s?Gqn(s):void 0,h=vg(o,l);if(!s){if(r||r===0)throw Error(a?yYi(e):fYi(e));return r}let d=Yqn(i,s.props??{});if(s.type!==Yf.Fragment)d.ref=o?h:l;return Yf.cloneElement(s,d)});return t.displayName=`${e}.Slot`,t}b3(PG,"createSlot");var Vqn=Symbol.for("radix.slottable");function _Yi(e){let t=b3((n)=>("child"in n)?n.children(n.child):n.children,"Slottable");return t.displayName=`${e}.Slottable`,t.__radixId=Vqn,t}b3(_Yi,"createSlottable");var gYi=b3((e,t)=>{if("child"in e.props){if(!Yf.isValidElement(t))return null;return Yf.cloneElement(t,void 0,e.props.children(t.props.children))}return Yf.isValidElement(t)?t:null},"getSlottableElementFromSlottable");function Yqn(e,t){let n={...t};for(let o in t){let r=e[o],i=t[o];if(/^on[A-Z]/.test(o)){if(r&&i)n[o]=(...a)=>{let c=i(...a);return r(...a),c};else if(r)n[o]=r}else if(o==="style")n[o]={...r,...i};else if(o==="className")n[o]=[r,i].filter(Boolean).join(" ");else if(o==="aria-describedby")n[o]=jqn(i,r)}return{...e,...n}}b3(Yqn,"mergeProps");function Gqn(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;if(n)return e.ref;if(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n)return e.props.ref;return e.props.ref||e.ref}b3(Gqn,"getElementRef");function Uqn(e){return Yf.isValidElement(e)&&typeof e.type==="function"&&"__radixId"in e.type&&e.type.__radixId===Vqn}b3(Uqn,"isSlottable");var AYi=Symbol.for("react.lazy");function v0t(e){return e!=null&&typeof e==="object"&&"$$typeof"in e&&e.$$typeof===AYi&&"_payload"in e&&Wqn(e._payload)}b3(v0t,"isLazyComponent");function Wqn(e){return typeof e==="object"&&e!==null&&"then"in e}b3(Wqn,"isPromiseLike");function Xqn(e){let t=e;while(v0t(t)&&typeof MEe==="function")t=MEe(t._payload);return t}b3(Xqn,"useUnwrappedLazy");function jqn(...e){let t=new Set;for(let n of e){if(typeof n!=="string")continue;for(let o of String(n).trim().split(/\s+/))if(o)t.add(o)}return t.size>0?Array.from(t).join(" "):void 0}b3(jqn,"concatAriaDescribedby");var fYi=b3((e)=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),yYi=b3((e)=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),MEe=Yf[" use ".trim().toString()],xYi=Object.defineProperty,CYi=(e,t)=>xYi(e,"name",{value:t,configurable:!0}),bYi=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],wP=bYi.reduce((e,t)=>{let n=PG(`Primitive.${t}`),o=zqn.forwardRef((r,i)=>{let{asChild:s,...a}=r,c=s?n:t;if(typeof window<"u")window[Symbol.for("radix-ui")]=!0;return Kqn.jsx(c,{...a,ref:i})});return o.displayName=`Primitive.${t}`,{...e,[t]:o}},{});function S0t(e,t){if(e)Oqn.flushSync(()=>e.dispatchEvent(t))}CYi(S0t,"dispatchDiscreteCustomEvent");var IYi=Object.defineProperty,Cg=(e,t)=>IYi(e,"name",{value:t,configurable:!0});function P0t(e){let t=e+"CollectionProvider",[n,o]=RG(t),[r,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),s=Cg((m)=>{let{scope:A,children:g}=m,f=K9.useRef(null),y=K9.useRef(new Map).current;return lEe.jsx(r,{scope:A,itemMap:y,collectionRef:f,children:g})},"CollectionProvider");s.displayName=t;let a=e+"CollectionSlot",c=PG(a),l=K9.forwardRef((m,A)=>{let{scope:g,children:f}=m,y=i(a,g),x=vg(A,y.collectionRef);return lEe.jsx(c,{ref:x,children:f})});l.displayName=a;let h=e+"CollectionItemSlot",d="data-radix-collection-item",u=PG(h),_=K9.forwardRef((m,A)=>{let{scope:g,children:f,...y}=m,x=K9.useRef(null),C=vg(A,x),b=i(h,g);return K9.useEffect(()=>(b.itemMap.set(x,{ref:x,...y}),()=>void b.itemMap.delete(x))),lEe.jsx(u,{...{[d]:""},ref:C,children:f})});_.displayName=h;function p(m){let A=i(e+"CollectionConsumer",m);return K9.useCallback(()=>{let f=A.collectionRef.current;if(!f)return[];let y=Array.from(f.querySelectorAll(`[${d}]`));return Array.from(A.itemMap.values()).sort((b,I)=>y.indexOf(b.ref.current)-y.indexOf(I.ref.current))},[A.collectionRef,A.itemMap])}return Cg(p,"useCollection"),[{Provider:s,Slot:l,ItemSlot:_},p,o]}Cg(P0t,"createCollection");var tWn=new WeakMap,jPe=class e extends Map{static{Cg(this,"OrderedDict")}#e;constructor(t){super(t);this.#e=[...super.keys()],tWn.set(this,!0)}set(t,n){if(tWn.get(this)&&!this.has(t))this.#e.push(t);return super.set(t,n),this}insert(t,n,o){let r=this.has(n),i=r?this.size:this.size+1,s=E0t(t),a=s>=0?Math.min(s,i-1):Math.max(i+s,0);if(r?this.#e.indexOf(n)===a:a===this.size)return this.set(n,o),this;let c=this.#e.filter((h)=>h!==n);c.splice(a,0,n);let l=c.map((h)=>[h,h===n?o:this.get(h)]);this.clear();for(let[h,d]of l)this.set(h,d);return this}with(t,n,o){let r=new e(this);return r.insert(t,n,o),r}before(t){let n=this.#e.indexOf(t)-1;if(n<0)return;return this.entryAt(n)}setBefore(t,n,o){let r=this.#e.indexOf(t);if(r===-1)return this;let i=this.#e.indexOf(n),s=i!==-1&&i<r?r-1:r;return this.insert(s,n,o)}after(t){let n=this.#e.indexOf(t);if(n=n===-1||n===this.size-1?-1:n+1,n===-1)return;return this.entryAt(n)}setAfter(t,n,o){let r=this.#e.indexOf(t);if(r===-1)return this;let i=this.#e.indexOf(n),s=i!==-1&&i<=r?r:r+1;return this.insert(s,n,o)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return this.#e=[],super.clear()}delete(t){let n=super.delete(t);if(n)this.#e.splice(this.#e.indexOf(t),1);return n}deleteAt(t){let n=this.keyAt(t);if(n!==void 0)return this.delete(n);return!1}at(t){let n=hEe(this.#e,t);if(n!==void 0)return this.get(n)}entryAt(t){let n=hEe(this.#e,t);if(n!==void 0)return[n,this.get(n)]}indexOf(t){return this.#e.indexOf(t)}keyAt(t){return hEe(this.#e,t)}from(t,n){let o=this.indexOf(t);if(o===-1)return;let r=o+n;if(r<0)r=0;if(r>=this.size)r=this.size-1;return this.at(r)}keyFrom(t,n){let o=this.indexOf(t);if(o===-1)return;let r=o+n;if(r<0)r=0;if(r>=this.size)r=this.size-1;return this.keyAt(r)}find(t,n){let o=0;for(let r of this){if(Reflect.apply(t,n,[r,o,this]))return r;o++}return}findIndex(t,n){let o=0;for(let r of this){if(Reflect.apply(t,n,[r,o,this]))return o;o++}return-1}filter(t,n){let o=[],r=0;for(let i of this){if(Reflect.apply(t,n,[i,r,this]))o.push(i);r++}return new e(o)}map(t,n){let o=[],r=0;for(let i of this)o.push([i[0],Reflect.apply(t,n,[i,r,this])]),r++;return new e(o)}reduce(...t){let[n,o]=t,r=t.length>1;if(!r&&this.size===0)throw TypeError("Reduce of empty OrderedDict with no initial value");let i=0,s=o;for(let a of this){if(i===0&&!r)s=a;else s=Reflect.apply(n,this,[s,a,i,this]);i++}return s}reduceRight(...t){let[n,o]=t,r=t.length>1;if(!r&&this.size===0)throw TypeError("Reduce of empty OrderedDict with no initial value");let i=o;for(let s=this.size-1;s>=0;s--){let a=this.entryAt(s);if(s===this.size-1&&!r)i=a;else i=Reflect.apply(n,this,[i,a,s,this])}return i}sort(t){if(typeof t!=="function")throw TypeError("OrderedDict.sort requires a compare function");let n=[...this.entries()].sort(t);this.clear();for(let[o,r]of n)this.set(o,r);return this}toSorted(t){if(typeof t!=="function")throw TypeError("OrderedDict.toSorted requires a compare function");let n=[...this.entries()].sort(t);return new e(n)}toReversed(){let t=new e;for(let n=this.size-1;n>=0;n--){let o=this.keyAt(n),r=this.get(o);t.set(o,r)}return t}toSpliced(...t){let n=[...this.entries()];return n.splice(...t),new e(n)}slice(t,n){let o=new e;for(let r of this.#e.slice(t,n))o.set(r,this.get(r));return o}every(t,n){let o=0;for(let r of this){if(!Reflect.apply(t,n,[r,o,this]))return!1;o++}return!0}some(t,n){let o=0;for(let r of this){if(Reflect.apply(t,n,[r,o,this]))return!0;o++}return!1}};function hEe(e,t){if("at"in Array.prototype)return Array.prototype.at.call(e,t);let n=$qn(e,t);return n===-1?void 0:e[n]}Cg(hEe,"at");function $qn(e,t){let n=e.length,o=E0t(t),r=o>=0?o:n+o;return r<0||r>=n?-1:r}Cg($qn,"toSafeIndex");function E0t(e){return e!==e||e===0?0:Math.trunc(e)}Cg(E0t,"toSafeInteger");function vYi(e){let t=e+"CollectionProvider",[n,o]=RG(t),[r,i]=n(t);r.displayName=e+"CollectionStableContextProvider";let[s,a]=n(t);s.displayName=e+"CollectionStatefulContextProvider";let c=Cg(({state:b,...I})=>b?_L.jsx(h,{...I,state:b}):_L.jsx(l,{...I}),"CollectionProvider");c.displayName=t;let l=Cg((b)=>{let I=f();return _L.jsx(h,{...b,state:I})},"CollectionInit");l.displayName=e+"CollectionInit";let h=Cg((b)=>{let{scope:I,children:v,state:P}=b,M=Ig.useRef(null),[B,T]=Ig.useState(null),N=vg(M,T),[D,L]=P,H=Ig.useRef(new jPe),V=Ig.useCallback(()=>{let O=H.current;if(!Zqn(O))O.sort(dEe);return O},[]);return Ig.useEffect(()=>{if(!B)return;let O=eJn(()=>{L((U)=>{let j=U.toSorted(dEe);return j.some(([X],K)=>U.keyAt(K)!==X)?j:U})});return O.observe(B,{childList:!0,subtree:!0}),()=>{O.disconnect()}},[B,L]),_L.jsx(r,{scope:I,collectionElementRef:N,collectionElementRefObject:M,getCollection:V,setCollection:L,registryRef:H,children:_L.jsx(s,{scope:I,collectionElement:B,collection:D,children:v})})},"CollectionProviderImpl");h.displayName=e+"CollectionProviderImpl";let d=e+"CollectionSlot",u=PG(d),_=Ig.forwardRef((b,I)=>{let{scope:v,children:P}=b,M=i(d,v),B=vg(I,M.collectionElementRef);return _L.jsx(u,{ref:B,children:P})});_.displayName=d;let p=e+"CollectionItemSlot",m="data-radix-collection-item",A=PG(p),g=Ig.forwardRef((b,I)=>{let{scope:v,children:P,...M}=b,B=Ig.useRef(null),T=i(p,v),{setCollection:N,registryRef:D}=T,L=Ig.useRef(M);if(!qqn(L.current,M))L.current=M;let H=L.current,V=Ig.useCallback((j)=>{let Y=D.current;if(j)Y.set(j,{...L.current,element:j});else if(B.current)Y.delete(B.current)},[D]),O=vg(I,V,B);A3(()=>{let j=B.current,Y=D.current;if(j&&Y.has(j))Y.set(j,{...H,element:j})},[H,D]);let U=Ig.useRef(null);return Ig.useEffect(()=>{let j=B.current,Y=U.current;if((Y?.element??null)===j&&(!j||Y?.itemData===H))return;U.current=j?{element:j,itemData:H}:null,N((X)=>{let K=new jPe(X);if(Y&&Y.element!==j)K.delete(Y.element);if(j)K.set(j,{...H,element:j});return K.sort(dEe)})}),Ig.useEffect(()=>()=>{let j=U.current;if(U.current=null,!j)return;N((Y)=>{if(!Y.has(j.element))return Y;let X=new jPe(Y);return X.delete(j.element),X})},[N]),_L.jsx(A,{...{[m]:""},ref:O,children:P})});g.displayName=p;function f(){return Ig.useState(new jPe)}Cg(f,"useInitCollection");function y(b){let{collection:I}=a(e+"CollectionConsumer",b);return I}Cg(y,"useCollection");function x(b){let{getCollection:I}=i(e+"CollectionConsumer",b);return I}return Cg(x,"useGetCollection"),[{Provider:c,Slot:_,ItemSlot:g},{createCollectionScope:o,useCollection:y,useGetCollection:x,useInitCollection:f}]}Cg(vYi,"createCollection");function qqn(e,t){if(e===t)return!0;if(typeof e!=="object"||typeof t!=="object")return!1;if(e==null||t==null)return!1;let n=Object.keys(e),o=Object.keys(t);if(n.length!==o.length)return!1;for(let r of n){if(!Object.prototype.hasOwnProperty.call(t,r))return!1;if(e[r]!==t[r])return!1}return!0}Cg(qqn,"shallowEqual");function Jqn(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}Cg(Jqn,"isElementPreceding");function Zqn(e){let t;for(let n of e.keys()){if(t){let o=t.compareDocumentPosition(n);if(!(o&Node.DOCUMENT_POSITION_DISCONNECTED)&&o&Node.DOCUMENT_POSITION_PRECEDING)return!1}t=n}return!0}Cg(Zqn,"isInDocumentOrder");function dEe(e,t){return!e[1].element||!t[1].element?0:Jqn(e[1].element,t[1].element)?-1:1}Cg(dEe,"sortByDocumentPosition");function eJn(e){return new MutationObserver((n)=>{for(let o of n)if(o.type==="childList"){e();return}})}Cg(eJn,"getChildListObserver");var PYi=Object.defineProperty,EYi=(e,t)=>PYi(e,"name",{value:t,configurable:!0}),MYi={LTR:"ltr",RTL:"rtl"},wYi=aMe.createContext(void 0);function M0t(e){let t=aMe.useContext(wYi);return e||t||MYi.LTR}EYi(M0t,"useDirection");var BYi=Object.defineProperty,TYi=(e,t)=>BYi(e,"name",{value:t,configurable:!0}),nWn=zpe[" useInsertionEffect ".trim().toString()];function vP(e){let t=zpe.useRef(e);if(typeof nWn==="function")nWn(()=>{t.current=e});else A3(()=>{t.current=e});return zpe.useMemo(()=>(...n)=>t.current?.(...n),[])}TYi(vP,"useCallbackRef");var DYi=Object.defineProperty,RA=(e,t)=>DYi(e,"name",{value:t,configurable:!0}),dut="dismissableLayer.update",NYi="dismissableLayer.pointerDownOutside",RYi="dismissableLayer.focusOutside",oWn,nJn=cd.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),QYi=cd.forwardRef(RA(function(t,n){let{disableOutsidePointerEvents:o=!1,deferPointerDownOutside:r=!1,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:a,onInteractOutside:c,onDismiss:l,...h}=t,d=cd.useContext(nJn),[u,_]=cd.useState(null),p=u?.ownerDocument??globalThis?.document,[,m]=cd.useState({}),A=vg(n,_),g=Array.from(d.layers),[f]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),y=f?g.indexOf(f):-1,x=u?g.indexOf(u):-1,C=d.layersWithOutsidePointerEventsDisabled.size>0,b=x>=y,I=cd.useRef(!1),v=oJn((T)=>{if(s?.(T),c?.(T),!T.defaultPrevented)l?.()},{ownerDocument:p,deferPointerDownOutside:r,isDeferredPointerDownOutsideRef:I,dismissableSurfaces:d.dismissableSurfaces,shouldHandlePointerDownOutside:cd.useCallback((T)=>{if(!(T instanceof Node))return!1;let N=[...d.branches].some((D)=>D.contains(T));return b&&!N},[d.branches,b])}),P=rJn((T)=>{if(r&&I.current)return;let N=T.target;if([...d.branches].some((L)=>L.contains(N)))return;if(a?.(T),c?.(T),!T.defaultPrevented)l?.()},p),M=u?x===g.length-1:!1,B=vP((T)=>{if(T.key!=="Escape")return;if(i?.(T),!T.defaultPrevented&&l)T.preventDefault(),l()});return cd.useEffect(()=>{if(!M)return;return p.addEventListener("keydown",B,{capture:!0}),()=>p.removeEventListener("keydown",B,{capture:!0})},[p,M,B]),cd.useEffect(()=>{if(!u)return;if(o){if(d.layersWithOutsidePointerEventsDisabled.size===0)oWn=p.body.style.pointerEvents,p.body.style.pointerEvents="none";d.layersWithOutsidePointerEventsDisabled.add(u)}return d.layers.add(u),uut(),()=>{if(o){if(d.layersWithOutsidePointerEventsDisabled.delete(u),d.layersWithOutsidePointerEventsDisabled.size===0)p.body.style.pointerEvents=oWn}}},[u,p,o,d]),cd.useEffect(()=>()=>{if(!u)return;d.layers.delete(u),d.layersWithOutsidePointerEventsDisabled.delete(u),uut()},[u,d]),cd.useEffect(()=>{let T=RA(()=>m({}),"handleUpdate");return document.addEventListener(dut,T),()=>document.removeEventListener(dut,T)},[]),tJn.jsx(wP.div,{...h,ref:A,style:{pointerEvents:C?b?"auto":"none":void 0,...t.style},onFocusCapture:ll(t.onFocusCapture,P.onFocusCapture),onBlurCapture:ll(t.onBlurCapture,P.onBlurCapture),onPointerDownCapture:ll(t.onPointerDownCapture,v.onPointerDownCapture)})},"DismissableLayer"));function kYi(){let e=cd.useContext(nJn),[t,n]=cd.useState(null);return cd.useEffect(()=>{if(!t)return;return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}RA(kYi,"useDismissableLayerSurface");var LYi=RA(()=>!0,"IS_TRUE");function oJn(e,t){let{ownerDocument:n=globalThis?.document,deferPointerDownOutside:o=!1,isDeferredPointerDownOutsideRef:r,dismissableSurfaces:i,shouldHandlePointerDownOutside:s=LYi}=t,a=vP(e),c=cd.useRef(!1),l=cd.useRef(!1),h=cd.useRef(new Map),d=cd.useRef(()=>{});return cd.useEffect(()=>{function u(){l.current=!1,r.current=!1,h.current.clear()}RA(u,"resetOutsideInteraction");function _(){return Array.from(h.current.values()).some(Boolean)}RA(_,"isOutsideInteractionIntercepted");function p(y){if(!l.current)return;let x=y.target;if(!(x instanceof Node&&[...i].some((b)=>b.contains(x))))h.current.set(y.type,!0);if(y.type==="click")window.setTimeout(()=>{if(l.current)d.current()},0)}RA(p,"handleInteractionCapture");function m(y){if(l.current)h.current.set(y.type,!1)}RA(m,"handleInteractionBubble");let A=RA((y)=>{if(y.target&&!c.current){let C=function(){n.removeEventListener("click",d.current);let I=_();if(u(),!I)w0t(NYi,a,b,{discrete:!0})};var x=C;if(RA(C,"handleAndDispatchPointerDownOutsideEvent"),!s(y.target)){n.removeEventListener("click",d.current),u(),c.current=!1;return}let b={originalEvent:y};if(l.current=!0,r.current=o&&y.button===0,h.current.clear(),!o||y.button!==0)C();else n.removeEventListener("click",d.current),d.current=C,n.addEventListener("click",d.current,{once:!0})}else n.removeEventListener("click",d.current),u();c.current=!1},"handlePointerDown"),g=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(let y of g)n.addEventListener(y,p,!0),n.addEventListener(y,m);let f=window.setTimeout(()=>{n.addEventListener("pointerdown",A)},0);return()=>{window.clearTimeout(f),n.removeEventListener("pointerdown",A),n.removeEventListener("click",d.current);for(let y of g)n.removeEventListener(y,p,!0),n.removeEventListener(y,m)}},[n,a,o,r,i,s]),{onPointerDownCapture:RA(()=>c.current=!0,"onPointerDownCapture")}}RA(oJn,"usePointerDownOutside");function rJn(e,t=globalThis?.document){let n=vP(e),o=cd.useRef(!1);return cd.useEffect(()=>{let r=RA((i)=>{if(i.target&&!o.current)w0t(RYi,n,{originalEvent:i},{discrete:!1})},"handleFocus");return t.addEventListener("focusin",r),()=>t.removeEventListener("focusin",r)},[t,n]),{onFocusCapture:RA(()=>o.current=!0,"onFocusCapture"),onBlurCapture:RA(()=>o.current=!1,"onBlurCapture")}}RA(rJn,"useFocusOutside");function uut(){let e=new CustomEvent(dut);document.dispatchEvent(e)}RA(uut,"dispatchUpdate");function w0t(e,t,n,{discrete:o}){let r=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});if(t)r.addEventListener(e,t,{once:!0});if(o)S0t(r,i);else r.dispatchEvent(i)}RA(w0t,"handleAndDispatchCustomEvent");var HYi=Object.defineProperty,B0t=(e,t)=>HYi(e,"name",{value:t,configurable:!0}),KPe=0,Lee=null;function FYi(e){return T0t(),e.children}B0t(FYi,"FocusGuards");function T0t(){iJn.useEffect(()=>{if(!Lee)Lee={start:put(),end:put()};let{start:e,end:t}=Lee;if(document.body.firstElementChild!==e)document.body.insertAdjacentElement("afterbegin",e);if(document.body.lastElementChild!==t)document.body.insertAdjacentElement("beforeend",t);return KPe++,()=>{if(KPe===1)Lee?.start.remove(),Lee?.end.remove(),Lee=null;KPe=Math.max(0,KPe-1)}},[])}B0t(T0t,"useFocusGuards");function put(){let e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}B0t(put,"createFocusGuard");var zYi=Object.defineProperty,C_=(e,t)=>zYi(e,"name",{value:t,configurable:!0}),Qdt="focusScope.autoFocusOnMount",kdt="focusScope.autoFocusOnUnmount",rWn={bubbles:!1,cancelable:!0},OYi=tp.forwardRef(C_(function(t,n){let{loop:o=!1,trapped:r=!1,branches:i,onMountAutoFocus:s,onUnmountAutoFocus:a,...c}=t,[l,h]=tp.useState(null),d=vP(s),u=vP(a),_=tp.useRef(null),p=vg(n,h),m=tp.useRef(i);tp.useEffect(()=>{m.current=i});let A=tp.useCallback((y)=>{if(!y)return!1;if(l?.contains(y))return!0;return Boolean(m.current?.some((x)=>x.contains(y)))},[l]),g=tp.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;tp.useEffect(()=>{if(r){let b=function(M){if(g.paused||!l)return;let B=M.target;if(A(B))_.current=B;else HB(_.current,{select:!0})},I=function(M){if(g.paused||!l)return;let B=M.relatedTarget;if(B===null)return;if(!A(B))HB(_.current,{select:!0})},v=function(M){if(document.activeElement!==document.body)return;for(let T of M)if(T.removedNodes.length>0)HB(l)};var y=b,x=I,C=v;C_(b,"handleFocusIn"),C_(I,"handleFocusOut"),C_(v,"handleMutations"),document.addEventListener("focusin",b),document.addEventListener("focusout",I);let P=new MutationObserver(v);if(l)P.observe(l,{childList:!0,subtree:!0});return()=>{document.removeEventListener("focusin",b),document.removeEventListener("focusout",I),P.disconnect()}}},[r,l,g.paused,A]),tp.useEffect(()=>{if(l){iWn.add(g);let y=document.activeElement;if(!l.contains(y)){let C=new CustomEvent(Qdt,rWn);if(l.addEventListener(Qdt,d),l.dispatchEvent(C),!C.defaultPrevented){if(hJn(_Jn(N0t(l)),{select:!0}),document.activeElement===y)HB(l)}}return()=>{l.removeEventListener(Qdt,d);let C=l.ownerDocument,b=CustomEvent;setTimeout(()=>{let I=new b(kdt,rWn);if(l.addEventListener(kdt,u),l.dispatchEvent(I),!I.defaultPrevented)HB(y??C.body,{select:!0});l.removeEventListener(kdt,u),iWn.remove(g)},0)}}},[l,d,u,g]);let f=tp.useCallback((y)=>{if(!o&&!r)return;if(g.paused)return;let x=y.key==="Tab"&&!y.altKey&&!y.ctrlKey&&!y.metaKey,C=document.activeElement;if(x&&C){let b=y.currentTarget,[I,v]=dJn(b);if(!(I&&v)){if(C===b)y.preventDefault()}else if(!y.shiftKey&&C===v){if(y.preventDefault(),o)HB(I,{select:!0})}else if(y.shiftKey&&C===I){if(y.preventDefault(),o)HB(v,{select:!0})}}},[o,r,g.paused]);return D0t.jsx(wP.div,{tabIndex:-1,...c,ref:p,onKeyDown:f})},"FocusScope")),sJn=tp.createContext(null);function aJn({registry:e,children:t}){if(!e)return t;return D0t.jsx(sJn.Provider,{value:e,children:t})}C_(aJn,"FocusScopeBranchProvider");function cJn(){let[e,t]=tp.useState([]),n=tp.useMemo(()=>({add:C_((o)=>t((r)=>r.includes(o)?r:[...r,o]),"add"),remove:C_((o)=>t((r)=>r.filter((i)=>i!==o)),"remove")}),[]);return{nodes:e,registry:n}}C_(cJn,"useFocusScopeBranchRegistry");function lJn(e){let t=tp.useContext(sJn);tp.useEffect(()=>{if(!e||!t)return;return t.add(e),()=>t.remove(e)},[e,t])}C_(lJn,"useFocusScopeBranch");function hJn(e,{select:t=!1}={}){let n=document.activeElement;for(let o of e)if(HB(o,{select:t}),document.activeElement!==n)return}C_(hJn,"focusFirst");function dJn(e){let t=N0t(e),n=mut(t,e),o=mut(t.reverse(),e);return[n,o]}C_(dJn,"getTabbableEdges");function N0t(e){let t=[],o=e.ownerDocument.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:C_((r)=>{let i=r.tagName==="INPUT"&&r.type==="hidden";if(r.disabled||r.hidden||i)return NodeFilter.FILTER_SKIP;return r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},"acceptNode")});while(o.nextNode())t.push(o.currentNode);return t}C_(N0t,"getTabbableCandidates");function mut(e,t){let n=typeof t.checkVisibility==="function"&&t.checkVisibility({checkVisibilityCSS:!0});for(let o of e)if(!(n?!o.checkVisibility({checkVisibilityCSS:!0}):uJn(o,{upTo:t})))return o}C_(mut,"findVisible");function uJn(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;while(e){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}C_(uJn,"isHidden");function pJn(e){return e.tagName==="INPUT"&&typeof e.select==="function"}C_(pJn,"isSelectableInput");function HB(e,{select:t=!1}={}){if(e&&e.focus){let o=(e.ownerDocument??document).activeElement;if(e.focus({preventScroll:!0}),e!==o&&pJn(e)&&t)e.select()}}C_(HB,"focus");var iWn=mJn();function mJn(){let e=[];return{add(t){let n=e[0];if(t!==n)n?.pause();e=_ut(e,t),e.unshift(t)},remove(t){e=_ut(e,t),e[0]?.resume()}}}C_(mJn,"createFocusScopesStack");function _ut(e,t){let n=[...e],o=n.indexOf(t);if(o!==-1)n.splice(o,1);return n}C_(_ut,"arrayRemove");function _Jn(e){return e.filter((t)=>t.tagName!=="A")}C_(_Jn,"removeLinks");var VYi=Object.defineProperty,YYi=(e,t)=>VYi(e,"name",{value:t,configurable:!0}),GYi=R0t[" useId ".trim().toString()]||(()=>{return}),UYi=0;function qee(e){let[t,n]=R0t.useState(GYi());return A3(()=>{if(!e)n((o)=>o??String(UYi++))},[e]),e||(t?`radix-${t}`:"")}YYi(qee,"useId");var WYi=["top","right","bottom","left"],{min:CL,max:UB,round:wEe,floor:$Pe}=Math,WB=(e)=>({x:e,y:e}),XYi={left:"right",right:"left",bottom:"top",top:"bottom"};function gJn(e,t,n){return UB(e,CL(t,n))}function XB(e,t){return typeof e==="function"?e(t):e}function bL(e){return e.split("-")[0]}function cte(e){return e.split("-")[1]}function Q0t(e){return e==="x"?"y":"x"}function k0t(e){return e==="y"?"height":"width"}function CP(e){let t=e[0];return t==="t"||t==="b"?"y":"x"}function L0t(e){return Q0t(CP(e))}function jYi(e,t,n){if(n===void 0)n=!1;let o=cte(e),r=L0t(e),i=k0t(r),s=r==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";if(t.reference[i]>t.floating[i])s=BEe(s);return[s,BEe(s)]}function KYi(e){let t=BEe(e);return[gut(e),t,gut(t)]}function gut(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}var sWn=["left","right"],aWn=["right","left"],$Yi=["top","bottom"],qYi=["bottom","top"];function JYi(e,t,n){switch(e){case"top":case"bottom":if(n)return t?aWn:sWn;return t?sWn:aWn;case"left":case"right":return t?$Yi:qYi;default:return[]}}function ZYi(e,t,n,o){let r=cte(e),i=JYi(bL(e),n==="start",o);if(r){if(i=i.map((s)=>s+"-"+r),t)i=i.concat(i.map(gut))}return i}function BEe(e){let t=bL(e);return XYi[t]+e.slice(t.length)}function eGi(e){var t,n,o,r;return{top:(t=e.top)!=null?t:0,right:(n=e.right)!=null?n:0,bottom:(o=e.bottom)!=null?o:0,left:(r=e.left)!=null?r:0}}function AJn(e){return typeof e!=="number"?eGi(e):{top:e,right:e,bottom:e,left:e}}function TEe(e){let{x:t,y:n,width:o,height:r}=e;return{width:o,height:r,top:n,left:t,right:t+o,bottom:n+r,x:t,y:n}}function cWn(e,t,n){let{reference:o,floating:r}=e,i=CP(t),s=L0t(t),a=k0t(s),c=bL(t),l=i==="y",h=o.x+o.width/2-r.width/2,d=o.y+o.height/2-r.height/2,u=o[a]/2-r[a]/2,_;switch(c){case"top":_={x:h,y:o.y-r.height};break;case"bottom":_={x:h,y:o.y+o.height};break;case"right":_={x:o.x+o.width,y:d};break;case"left":_={x:o.x-r.width,y:d};break;default:_={x:o.x,y:o.y}}let p=cte(t);if(p)_[s]+=u*(p==="end"?1:-1)*(n&&l?-1:1);return _}async function tGi(e,t){var n;if(t===void 0)t={};let{x:o,y:r,platform:i,rects:s,elements:a,strategy:c}=e,{boundary:l="clippingAncestors",rootBoundary:h="viewport",elementContext:d="floating",altBoundary:u=!1,padding:_=0}=XB(t,e),p=AJn(_),A=a[u?d==="floating"?"reference":"floating":d],g=TEe(await i.getClippingRect({element:((n=await(i.isElement==null?void 0:i.isElement(A)))!=null?n:!0)?A:A.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(a.floating)),boundary:l,rootBoundary:h,strategy:c})),f=d==="floating"?{x:o,y:r,width:s.floating.width,height:s.floating.height}:s.reference,y=await(i.getOffsetParent==null?void 0:i.getOffsetParent(a.floating)),x=await(i.isElement==null?void 0:i.isElement(y))&&await(i.getScale==null?void 0:i.getScale(y))||{x:1,y:1},C=TEe(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:f,offsetParent:y,strategy:c}):f);return{top:(g.top-C.top+p.top)/x.y,bottom:(C.bottom-g.bottom+p.bottom)/x.y,left:(g.left-C.left+p.left)/x.x,right:(C.right-g.right+p.right)/x.x}}var nGi=50,oGi=async(e,t,n)=>{let{placement:o="bottom",strategy:r="absolute",middleware:i=[],platform:s}=n,a=s.detectOverflow?s:{...s,detectOverflow:tGi},c=await(s.isRTL==null?void 0:s.isRTL(t)),l=await s.getElementRects({reference:e,floating:t,strategy:r}),{x:h,y:d}=cWn(l,o,c),u=o,_=0,p={};for(let m=0;m<i.length;m++){let A=i[m];if(!A)continue;let{name:g,fn:f}=A,{x:y,y:x,data:C,reset:b}=await f({x:h,y:d,initialPlacement:o,placement:u,strategy:r,middlewareData:p,rects:l,platform:a,elements:{reference:e,floating:t}});if(h=y!=null?y:h,d=x!=null?x:d,p[g]={...p[g],...C},b&&_<nGi){if(_++,typeof b==="object"){if(b.placement)u=b.placement;if(b.rects)l=b.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:r}):b.rects;({x:h,y:d}=cWn(l,u,c))}m=-1}}return{x:h,y:d,placement:u,strategy:r,middlewareData:p}},rGi=(e)=>({name:"arrow",options:e,async fn(t){let{x:n,y:o,placement:r,rects:i,platform:s,elements:a,middlewareData:c}=t,{element:l,padding:h=0}=XB(e,t)||{};if(l==null)return{};let d=AJn(h),u={x:n,y:o},_=L0t(r),p=k0t(_),m=await s.getDimensions(l),A=_==="y",g=A?"top":"left",f=A?"bottom":"right",y=A?"clientHeight":"clientWidth",x=i.reference[p]+i.reference[_]-u[_]-i.floating[p],C=u[_]-i.reference[_],b=await(s.getOffsetParent==null?void 0:s.getOffsetParent(l)),I=b?b[y]:0;if(!I||!await(s.isElement==null?void 0:s.isElement(b)))I=a.floating[y]||i.floating[p];let v=x/2-C/2,P=I/2-m[p]/2-1,M=CL(d[g],P),B=CL(d[f],P),T=I-m[p]-B,N=I/2-m[p]/2+v,D=gJn(M,N,T),L=!c.arrow&&cte(r)!=null&&N!==D&&i.reference[p]/2-(N<M?M:B)-m[p]/2<0,H=L?N<M?N-M:N-T:0;return{[_]:u[_]+H,data:{[_]:D,centerOffset:N-D-H,...L&&{alignmentOffset:H}},reset:L}}}),iGi=function(e){if(e===void 0)e={};return{name:"flip",options:e,async fn(t){var n,o;let{placement:r,middlewareData:i,rects:s,initialPlacement:a,platform:c,elements:l}=t,{mainAxis:h=!0,crossAxis:d=!0,fallbackPlacements:u,fallbackStrategy:_="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:m=!0,...A}=XB(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=bL(r),f=CP(a),y=bL(a)===a,x=await(c.isRTL==null?void 0:c.isRTL(l.floating)),C=u||(y||!m?[BEe(a)]:KYi(a)),b=p!=="none";if(!u&&b)C.push(...ZYi(a,m,p,x));let I=[a,...C],v=await c.detectOverflow(t,A),P=[],M=((o=i.flip)==null?void 0:o.overflows)||[];if(h)P.push(v[g]);if(d){let D=jYi(r,s,x);P.push(v[D[0]],v[D[1]])}if(M=[...M,{placement:r,overflows:P}],!P.every((D)=>D<=0)){var B,T;let D=(((B=i.flip)==null?void 0:B.index)||0)+1,L=I[D];if(L){if(!(d==="alignment"?f!==CP(L):!1)||M.every((O)=>CP(O.placement)===f?O.overflows[0]>0:!0))return{data:{index:D,overflows:M},reset:{placement:L}}}let H=(T=M.filter((V)=>V.overflows[0]<=0).sort((V,O)=>V.overflows[1]-O.overflows[1])[0])==null?void 0:T.placement;if(!H)switch(_){case"bestFit":{var N;let V=(N=M.filter((O)=>{if(b){let U=CP(O.placement);return U===f||U==="y"}return!0}).map((O)=>[O.placement,O.overflows.filter((U)=>U>0).reduce((U,j)=>U+j,0)]).sort((O,U)=>O[1]-U[1])[0])==null?void 0:N[0];if(V)H=V;break}case"initialPlacement":H=a;break}if(r!==H)return{reset:{placement:H}}}return{}}}};function lWn(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function hWn(e){return WYi.some((t)=>e[t]>=0)}var sGi=function(e){if(e===void 0)e={};return{name:"hide",options:e,async fn(t){let{rects:n,platform:o}=t,{strategy:r="referenceHidden",...i}=XB(e,t);switch(r){case"referenceHidden":{let s=await o.detectOverflow(t,{...i,elementContext:"reference"}),a=lWn(s,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:hWn(a)}}}case"escaped":{let s=await o.detectOverflow(t,{...i,altBoundary:!0}),a=lWn(s,n.floating);return{data:{escapedOffsets:a,escaped:hWn(a)}}}default:return{}}}}},fJn=new Set(["left","top"]);async function aGi(e,t){let{placement:n,platform:o,elements:r}=e,i=await(o.isRTL==null?void 0:o.isRTL(r.floating)),s=bL(n),a=cte(n),c=CP(n)==="y",l=fJn.has(s)?-1:1,h=i&&c?-1:1,d=XB(t,e),{mainAxis:u,crossAxis:_,alignmentAxis:p}=typeof d==="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};if(a&&typeof p==="number")_=a==="end"?p*-1:p;return c?{x:_*h,y:u*l}:{x:u*l,y:_*h}}var cGi=function(e){if(e===void 0)e=0;return{name:"offset",options:e,async fn(t){var n,o;let{x:r,y:i,placement:s,middlewareData:a}=t,c=await aGi(t,e);if(s===((n=a.offset)==null?void 0:n.placement)&&(o=a.arrow)!=null&&o.alignmentOffset)return{};return{x:r+c.x,y:i+c.y,data:{...c,placement:s}}}}},lGi=function(e){if(e===void 0)e={};return{name:"shift",options:e,async fn(t){let{x:n,y:o,placement:r,platform:i}=t,{mainAxis:s=!0,crossAxis:a=!1,limiter:c={fn:(f)=>{let{x:y,y:x}=f;return{x:y,y:x}}},...l}=XB(e,t),h={x:n,y:o},d=await i.detectOverflow(t,l),u=CP(r),_=Q0t(u),p=h[_],m=h[u],A=(f,y)=>gJn(y+d[f==="y"?"top":"left"],y,y-d[f==="y"?"bottom":"right"]);if(s)p=A(_,p);if(a)m=A(u,m);let g=c.fn({...t,[_]:p,[u]:m});return{...g,data:{x:g.x-n,y:g.y-o,enabled:{[_]:s,[u]:a}}}}}},hGi=function(e){if(e===void 0)e={};return{options:e,fn(t){var n,o;let{x:r,y:i,placement:s,rects:a,middlewareData:c}=t,{offset:l=0,mainAxis:h=!0,crossAxis:d=!0}=XB(e,t),u={x:r,y:i},_=CP(s),p=Q0t(_),m=u[p],A=u[_],g=XB(l,t),f=typeof g==="number"?{mainAxis:g,crossAxis:0}:{mainAxis:(n=g.mainAxis)!=null?n:0,crossAxis:(o=g.crossAxis)!=null?o:0};if(h){let C=p==="y"?"height":"width",b=a.reference[p]-a.floating[C]+f.mainAxis,I=a.reference[p]+a.reference[C]-f.mainAxis;if(m<b)m=b;else if(m>I)m=I}if(d){var y,x;let C=p==="y"?"width":"height",b=fJn.has(bL(s)),I=a.reference[_]-a.floating[C]+(b?((y=c.offset)==null?void 0:y[_])||0:0)+(b?0:f.crossAxis),v=a.reference[_]+a.reference[C]+(b?0:((x=c.offset)==null?void 0:x[_])||0)-(b?f.crossAxis:0);if(A<I)A=I;else if(A>v)A=v}return{[p]:m,[_]:A}}}},dGi=function(e){if(e===void 0)e={};return{name:"size",options:e,async fn(t){let{placement:n,rects:o,platform:r,elements:i}=t,{apply:s=()=>{},...a}=XB(e,t),c=await r.detectOverflow(t,a),l=bL(n),h=cte(n),d=CP(n)==="y",{width:u,height:_}=o.floating,p,m;if(l==="top"||l==="bottom")p=l,m=h===(await(r.isRTL==null?void 0:r.isRTL(i.floating))?"start":"end")?"left":"right";else m=l,p=h==="end"?"top":"bottom";let A=_-c.top-c.bottom,g=u-c.left-c.right,f=CL(_-c[p],A),y=CL(u-c[m],g),x=t.middlewareData.shift,C=!x,b=f,I=y;if(x!=null&&x.enabled.x)I=g;if(x!=null&&x.enabled.y)b=A;if(C&&!h)if(d)I=u-2*UB(c.left,c.right);else b=_-2*UB(c.top,c.bottom);await s({...t,availableWidth:I,availableHeight:b});let v=await r.getDimensions(i.floating);if(u!==v.width||_!==v.height)return{reset:{rects:!0}};return{}}}};function cMe(){return typeof window<"u"}function lte(e){if(yJn(e))return(e.nodeName||"").toLowerCase();return"#document"}function x5(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function JB(e){var t;return(t=(yJn(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function yJn(e){if(!cMe())return!1;return e instanceof Node||e instanceof x5(e).Node}function SP(e){if(!cMe())return!1;return e instanceof Element||e instanceof x5(e).Element}function vL(e){if(!cMe())return!1;return e instanceof HTMLElement||e instanceof x5(e).HTMLElement}function dWn(e){if(!cMe()||typeof ShadowRoot>"u")return!1;return e instanceof ShadowRoot||e instanceof x5(e).ShadowRoot}function lMe(e){let{overflow:t,overflowX:n,overflowY:o,display:r}=PP(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+n)&&r!=="inline"&&r!=="contents"}function uGi(e){return/^(table|td|th)$/.test(lte(e))}function hMe(e){try{if(e.matches(":popover-open"))return!0}catch(t){}try{return e.matches(":modal")}catch(t){return!1}}var pGi=/transform|translate|scale|rotate|perspective|filter/,mGi=/paint|layout|strict|content/,xG=(e)=>!!e&&e!=="none",Ldt;function H0t(e){let t=SP(e)?PP(e):e;return xG(t.transform)||xG(t.translate)||xG(t.scale)||xG(t.rotate)||xG(t.perspective)||!F0t()&&(xG(t.backdropFilter)||xG(t.filter))||pGi.test(t.willChange||"")||mGi.test(t.contain||"")}function _Gi(e){let t=EG(e);while(vL(t)&&!xpe(t)){if(H0t(t))return t;else if(hMe(t))return null;t=EG(t)}return null}function F0t(){if(Ldt==null)Ldt=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none");return Ldt}function xpe(e){return/^(html|body|#document)$/.test(lte(e))}function PP(e){return x5(e).getComputedStyle(e)}function dMe(e){if(SP(e))return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop};return{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function EG(e){if(lte(e)==="html")return e;let t=e.assignedSlot||e.parentNode||dWn(e)&&e.host||JB(e);return dWn(t)?t.host:t}function xJn(e){let t=EG(e);if(xpe(t))return(e.ownerDocument||e).body;if(vL(t)&&lMe(t))return t;return xJn(t)}function Cpe(e,t,n){var o;if(t===void 0)t=[];if(n===void 0)n=!0;let r=xJn(e),i=r===((o=e.ownerDocument)==null?void 0:o.body),s=x5(r);if(i){let a=Aut(s);return t.concat(s,s.visualViewport||[],lMe(r)?r:[],a&&n?Cpe(a):[])}else return t.concat(r,Cpe(r,[],n))}function Aut(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function CJn(e){let t=PP(e),n=parseFloat(t.width)||0,o=parseFloat(t.height)||0,r=vL(e),i=r?e.offsetWidth:n,s=r?e.offsetHeight:o,a=wEe(n)!==i||wEe(o)!==s;if(a)n=i,o=s;return{width:n,height:o,$:a}}function z0t(e){return!SP(e)?e.contextElement:e}function jee(e){let t=z0t(e);if(!vL(t))return WB(1);let n=t.getBoundingClientRect(),{width:o,height:r,$:i}=CJn(t),s=(i?wEe(n.width):n.width)/o,a=(i?wEe(n.height):n.height)/r;if(!s||!Number.isFinite(s))s=1;if(!a||!Number.isFinite(a))a=1;return{x:s,y:a}}var gGi=WB(0);function bJn(e){let t=x5(e);if(!F0t()||!t.visualViewport)return gGi;return{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function AGi(e,t,n){if(t===void 0)t=!1;return!!n&&t&&n===x5(e)}function MG(e,t,n,o){if(t===void 0)t=!1;if(n===void 0)n=!1;let r=e.getBoundingClientRect(),i=z0t(e),s=WB(1);if(t)if(o){if(SP(o))s=jee(o)}else s=jee(e);let a=AGi(i,n,o)?bJn(i):WB(0),c=(r.left+a.x)/s.x,l=(r.top+a.y)/s.y,h=r.width/s.x,d=r.height/s.y;if(i&&o){let u=x5(i),_=SP(o)?x5(o):o,p=u,m=Aut(p);while(m&&_!==p){let A=jee(m),g=m.getBoundingClientRect(),f=PP(m),y=g.left+(m.clientLeft+parseFloat(f.paddingLeft))*A.x,x=g.top+(m.clientTop+parseFloat(f.paddingTop))*A.y;c*=A.x,l*=A.y,h*=A.x,d*=A.y,c+=y,l+=x,p=x5(m),m=Aut(p)}}return TEe({width:h,height:d,x:c,y:l})}function uMe(e,t){let n=dMe(e).scrollLeft;if(!t)return MG(JB(e)).left+n;return t.left+n}function IJn(e,t){let n=e.getBoundingClientRect(),o=n.left+t.scrollLeft-uMe(e,n),r=n.top+t.scrollTop;return{x:o,y:r}}function fGi(e){let{elements:t,rect:n,offsetParent:o,strategy:r}=e,i=r==="fixed",s=JB(o),a=t?hMe(t.floating):!1;if(o===s||a&&i)return n;let c={scrollLeft:0,scrollTop:0},l=WB(1),h=WB(0),d=vL(o);if(d||!i){if(lte(o)!=="body"||lMe(s))c=dMe(o);if(d){let _=MG(o);l=jee(o),h.x=_.x+o.clientLeft,h.y=_.y+o.clientTop}}let u=s&&!d&&!i?IJn(s,c):WB(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+h.x+u.x,y:n.y*l.y-c.scrollTop*l.y+h.y+u.y}}function yGi(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function xGi(e){let t=dMe(e),n=e.ownerDocument.body,o=UB(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),r=UB(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),i=-t.scrollLeft+uMe(e),s=-t.scrollTop;if(PP(n).direction==="rtl")i+=UB(e.clientWidth,n.clientWidth)-o;return{width:o,height:r,x:i,y:s}}var CGi=25;function bGi(e,t,n){if(n===void 0)n="viewport";let o=n==="layoutViewport",r=x5(e),i=JB(e),s=r.visualViewport,{clientWidth:a,clientHeight:c}=i,l=0,h=0;if(s){let u=!F0t()||t==="fixed";if(o){if(!u)l=-s.offsetLeft,h=-s.offsetTop}else if(a=s.width,c=s.height,u)l=s.offsetLeft,h=s.offsetTop}if(uMe(i)<=0){let u=i.ownerDocument,_=u.body,p=getComputedStyle(_),m=u.compatMode==="CSS1Compat"?parseFloat(p.marginLeft)+parseFloat(p.marginRight)||0:0,A=Math.abs(i.clientWidth-_.clientWidth-m),g=getComputedStyle(i).scrollbarGutter==="stable both-edges"?A/2:A;if(g<=CGi)a-=g}return{width:a,height:c,x:l,y:h}}function IGi(e,t){let n=MG(e,!0,t==="fixed"),o=n.top+e.clientTop,r=n.left+e.clientLeft,i=jee(e),s=e.clientWidth*i.x,a=e.clientHeight*i.y,c=r*i.x,l=o*i.y;return{width:s,height:a,x:c,y:l}}function uWn(e,t,n){let o;if(t==="viewport"||t==="layoutViewport")o=bGi(e,n,t);else if(t==="document")o=xGi(JB(e));else if(SP(t))o=IGi(t,n);else{let r=bJn(e);o={x:t.x-r.x,y:t.y-r.y,width:t.width,height:t.height}}return TEe(o)}function vGi(e,t){let n=t.get(e);if(n)return n;let o=Cpe(e,[],!1).filter((a)=>SP(a)&&lte(a)!=="body"),r=null,i=PP(e).position==="fixed",s=i?EG(e):e;while(SP(s)&&!xpe(s)){let a=PP(s),c=H0t(s),l=r?r.position:i?"fixed":"";if(!c&&(l==="fixed"||l==="absolute"&&a.position==="static"))o=o.filter((d)=>d!==s);else r=a;s=EG(s)}return t.set(e,o),o}function SGi(e){let{element:t,boundary:n,rootBoundary:o,strategy:r}=e,s=[...n==="clippingAncestors"?hMe(t)?[]:vGi(t,this._c):[].concat(n),o],a=uWn(t,s[0],r),{top:c,right:l,bottom:h,left:d}=a;for(let u=1;u<s.length;u++){let _=uWn(t,s[u],r);c=UB(_.top,c),l=CL(_.right,l),h=CL(_.bottom,h),d=UB(_.left,d)}return{width:l-d,height:h-c,x:d,y:c}}function PGi(e){let{width:t,height:n}=CJn(e);return{width:t,height:n}}function EGi(e,t,n){let o=vL(t),r=JB(t),i=n==="fixed",s=MG(e,!0,i,t),a={scrollLeft:0,scrollTop:0},c=WB(0);if(o||!i){if(lte(t)!=="body"||lMe(r))a=dMe(t);if(o){let u=MG(t,!0,i,t);c.x=u.x+t.clientLeft,c.y=u.y+t.clientTop}}if(!o&&r)c.x=uMe(r);let l=r&&!o&&!i?IJn(r,a):WB(0),h=s.left+a.scrollLeft-c.x-l.x,d=s.top+a.scrollTop-c.y-l.y;return{x:h,y:d,width:s.width,height:s.height}}function Hdt(e){return PP(e).position==="static"}function pWn(e,t){if(!vL(e)||PP(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;if(JB(e)===n)n=n.ownerDocument.body;return n}function vJn(e,t){let n=x5(e);if(hMe(e))return n;if(!vL(e)){let r=EG(e);while(r&&!xpe(r)){if(SP(r)&&!Hdt(r))return r;r=EG(r)}return n}let o=pWn(e,t);while(o&&uGi(o)&&Hdt(o))o=pWn(o,t);if(o&&xpe(o)&&Hdt(o)&&!H0t(o))return n;return o||_Gi(e)||n}var MGi=async function(e){let t=this.getOffsetParent||vJn,n=this.getDimensions,o=await n(e.floating);return{reference:EGi(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function wGi(e){return PP(e).direction==="rtl"}var BGi={convertOffsetParentRelativeRectToViewportRelativeRect:fGi,getDocumentElement:JB,getClippingRect:SGi,getOffsetParent:vJn,getElementRects:MGi,getClientRects:yGi,getDimensions:PGi,getScale:jee,isElement:SP,isRTL:wGi};function SJn(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function TGi(e,t,n){let o=null,r,i=JB(e);function s(){var h;clearTimeout(r),(h=o)==null||h.disconnect(),o=null}function a(h,d){if(h===void 0)h=!1;if(d===void 0)d=1;s();let u=e.getBoundingClientRect(),{left:_,top:p,width:m,height:A}=u;if(!h)t();if(!m||!A)return;let g=$Pe(p),f=$Pe(i.clientWidth-(_+m)),y=$Pe(i.clientHeight-(p+A)),x=$Pe(_),b={rootMargin:-g+"px "+-f+"px "+-y+"px "+-x+"px",threshold:UB(0,CL(1,d))||1},I=!0;function v(P){let M=P[0].intersectionRatio;if(!SJn(u,e.getBoundingClientRect()))return a();if(M!==d){if(!I)return a();if(!M)r=setTimeout(()=>{a(!1,0.0000001)},1000);else a(!1,M)}I=!1}try{o=new IntersectionObserver(v,{...b,root:i.ownerDocument})}catch(P){o=new IntersectionObserver(v,b)}o.observe(e)}let c=x5(e),l=()=>a(n);return c.addEventListener("resize",l),a(!0),()=>{c.removeEventListener("resize",l),s()}}function DGi(e,t,n,o){if(o===void 0)o={};let{ancestorScroll:r=!0,ancestorResize:i=!0,elementResize:s=typeof ResizeObserver==="function",layoutShift:a=typeof IntersectionObserver==="function",animationFrame:c=!1}=o,l=z0t(e),h=r||i?[...l?Cpe(l):[],...t?Cpe(t):[]]:[];h.forEach((g)=>{r&&g.addEventListener("scroll",n),i&&g.addEventListener("resize",n)});let d=l&&a?TGi(l,n,i):null,u=-1,_=null;if(s){if(_=new ResizeObserver((g)=>{let[f]=g;if(f&&f.target===l&&_&&t)_.unobserve(t),cancelAnimationFrame(u),u=requestAnimationFrame(()=>{var y;(y=_)==null||y.observe(t)});n()}),l&&!c)_.observe(l);if(t)_.observe(t)}let p,m=c?MG(e):null;if(c)A();function A(){let g=MG(e);if(m&&!SJn(m,g))n();m=g,p=requestAnimationFrame(A)}return n(),()=>{var g;if(h.forEach((f)=>{r&&f.removeEventListener("scroll",n),i&&f.removeEventListener("resize",n)}),d==null||d(),(g=_)==null||g.disconnect(),_=null,c)cancelAnimationFrame(p)}}var NGi=cGi,RGi=lGi,QGi=iGi,kGi=dGi,LGi=sGi,mWn=rGi,HGi=hGi,FGi=(e,t,n)=>{let o=new Map,r=n!=null?n:{},i={...BGi,...r.platform,_c:o};return oGi(e,t,{...r,platform:i})},zGi=typeof document<"u",OGi=function(){},uEe=zGi?PJn.useLayoutEffect:OGi;function DEe(e,t){if(e===t)return!0;if(typeof e!==typeof t)return!1;if(typeof e==="function"&&e.toString()===t.toString())return!0;let n,o,r;if(e&&t&&typeof e==="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(o=n;o--!==0;)if(!DEe(e[o],t[o]))return!1;return!0}if(r=Object.keys(e),n=r.length,n!==Object.keys(t).length)return!1;for(o=n;o--!==0;)if(!{}.hasOwnProperty.call(t,r[o]))return!1;for(o=n;o--!==0;){let i=r[o];if(i==="_owner"&&e.$$typeof)continue;if(!DEe(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function MJn(e){if(typeof window>"u")return 1;return(e.ownerDocument.defaultView||window).devicePixelRatio||1}function _Wn(e,t){let n=MJn(e);return Math.round(t*n)/n}function Fdt(e){let t=b_.useRef(e);return uEe(()=>{t.current=e}),t}function VGi(e){if(e===void 0)e={};let{placement:t="bottom",strategy:n="absolute",middleware:o=[],platform:r,elements:{reference:i,floating:s}={},transform:a=!0,whileElementsMounted:c,open:l}=e,[h,d]=b_.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[u,_]=b_.useState(o);if(!DEe(u,o))_(o);let[p,m]=b_.useState(null),[A,g]=b_.useState(null),f=b_.useCallback((O)=>{if(O!==b.current)b.current=O,m(O)},[]),y=b_.useCallback((O)=>{if(O!==I.current)I.current=O,g(O)},[]),x=i||p,C=s||A,b=b_.useRef(null),I=b_.useRef(null),v=b_.useRef(h),P=c!=null,M=Fdt(c),B=Fdt(r),T=Fdt(l),N=b_.useCallback(()=>{if(!b.current||!I.current)return;let O={placement:t,strategy:n,middleware:u};if(B.current)O.platform=B.current;FGi(b.current,I.current,O).then((U)=>{let j={...U,isPositioned:T.current!==!1};if(D.current&&!DEe(v.current,j))v.current=j,EJn.flushSync(()=>{d(j)})})},[u,t,n,B,T]);uEe(()=>{if(l===!1&&v.current.isPositioned)v.current.isPositioned=!1,d((O)=>({...O,isPositioned:!1}))},[l]);let D=b_.useRef(!1);uEe(()=>(D.current=!0,()=>{D.current=!1}),[]),uEe(()=>{if(x)b.current=x;if(C)I.current=C;if(x&&C){if(M.current)return M.current(x,C,N);N()}},[x,C,N,M,P]);let L=b_.useMemo(()=>({reference:b,floating:I,setReference:f,setFloating:y}),[f,y]),H=b_.useMemo(()=>({reference:x,floating:C}),[x,C]),V=b_.useMemo(()=>{let O={position:n,left:0,top:0};if(!H.floating)return O;let U=_Wn(H.floating,h.x),j=_Wn(H.floating,h.y);if(a)return{...O,transform:"translate("+U+"px, "+j+"px)",...MJn(H.floating)>=1.5&&{willChange:"transform"}};return{position:n,left:U,top:j}},[n,a,H.floating,h.x,h.y]);return b_.useMemo(()=>({...h,update:N,refs:L,elements:H,floatingStyles:V}),[h,N,L,H,V])}var YGi=(e)=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){let{element:o,padding:r}=typeof e==="function"?e(n):e;if(o&&t(o)){if(o.current!=null)return mWn({element:o.current,padding:r}).fn(n);return{}}if(o)return mWn({element:o,padding:r}).fn(n);return{}}}},GGi=(e,t)=>{let n=NGi(e);return{name:n.name,fn:n.fn,options:[e,t]}},UGi=(e,t)=>{let n=RGi(e);return{name:n.name,fn:n.fn,options:[e,t]}},WGi=(e,t)=>({fn:HGi(e).fn,options:[e,t]}),XGi=(e,t)=>{let n=QGi(e);return{name:n.name,fn:n.fn,options:[e,t]}},jGi=(e,t)=>{let n=kGi(e);return{name:n.name,fn:n.fn,options:[e,t]}},KGi=(e,t)=>{let n=LGi(e);return{name:n.name,fn:n.fn,options:[e,t]}},$Gi=(e,t)=>{let n=YGi(e);return{name:n.name,fn:n.fn,options:[e,t]}},qGi=Object.defineProperty,JGi=(e,t)=>qGi(e,"name",{value:t,configurable:!0});function BJn(e){let[t,n]=wJn.useState(void 0);return A3(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let o=0,r=new ResizeObserver((i)=>{if(!Array.isArray(i))return;if(!i.length)return;let s=i[0];window.cancelAnimationFrame(o),o=window.requestAnimationFrame(()=>{let a,c;if("borderBoxSize"in s){let l=s.borderBoxSize,h=Array.isArray(l)?l[0]:l;a=h.inlineSize,c=h.blockSize}else a=e.offsetWidth,c=e.offsetHeight;n({width:a,height:c})})});return r.observe(e,{box:"border-box"}),()=>{window.cancelAnimationFrame(o),r.unobserve(e)}}else n(void 0)},[e]),t}JGi(BJn,"useSize");var ZGi=Object.defineProperty,yL=(e,t)=>ZGi(e,"name",{value:t,configurable:!0}),gWn={Partial:"partial",Always:"always"},AWn={Optimized:"optimized",Always:"always"},TJn="Popper",[DJn,NJn]=RG(TJn),[eUi,RJn]=DJn(TJn),QJn=yL((e)=>{let{__scopePopper:t,children:n}=e,[o,r]=Z2.useState(null),[i,s]=Z2.useState(void 0);return Kee.jsx(eUi,{scope:t,anchor:o,onAnchorChange:r,placementState:i,setPlacementState:s,children:n})},"Popper"),tUi="PopperAnchor",nUi=Z2.forwardRef(yL(function(t,n){let{__scopePopper:o,virtualRef:r,...i}=t,s=RJn(tUi,o),a=Z2.useRef(null),c=s.onAnchorChange,l=Z2.useCallback((m)=>{if(a.current=m,m)c(m)},[c]),h=vg(n,l),d=Z2.useRef(null);Z2.useEffect(()=>{if(!r)return;let m=d.current;if(d.current=r.current,m!==d.current)c(d.current)});let u=s.placementState&&pMe(s.placementState),_=u?.[0],p=u?.[1];return r?null:Kee.jsx(wP.div,{"data-radix-popper-side":_,"data-radix-popper-align":p,...i,ref:h})},"PopperAnchor")),kJn="PopperContent",[oUi,OCa]=DJn(kJn),rUi=Z2.forwardRef(yL(function(t,n){let{__scopePopper:o,side:r="bottom",sideOffset:i=0,align:s="center",alignOffset:a=0,arrowPadding:c=0,avoidCollisions:l=!0,collisionBoundary:h=[],collisionPadding:d=0,sticky:u=gWn.Partial,hideWhenDetached:_=!1,updatePositionStrategy:p=AWn.Optimized,onPlaced:m,...A}=t,g=RJn(kJn,o),[f,y]=Z2.useState(null),x=vg(n,y),[C,b]=Z2.useState(null),I=BJn(C),v=I?.width??0,P=I?.height??0,M=r+(s!=="center"?"-"+s:""),B=typeof d==="number"?d:{top:0,right:0,bottom:0,left:0,...d},T=Array.isArray(h)?h:[h],N=T.length>0,D={padding:B,boundary:T.filter(LJn),altBoundary:N},{refs:L,floatingStyles:H,placement:V,isPositioned:O,middlewareData:U}=VGi({strategy:"fixed",placement:M,whileElementsMounted:yL((...Z)=>DGi(...Z,{animationFrame:p===AWn.Always}),"whileElementsMounted"),elements:{reference:g.anchor},middleware:[GGi({mainAxis:i+P,alignmentAxis:a}),l&&UGi({mainAxis:!0,crossAxis:!1,...u===gWn.Partial?{limiter:WGi()}:{},...D}),l&&XGi({...D}),jGi({...D,apply:yL(({elements:Z,rects:te,availableWidth:ie,availableHeight:ce})=>{let{width:ue,height:de}=te.reference,me=Z.floating.style;me.setProperty("--radix-popper-available-width",`${ie}px`),me.setProperty("--radix-popper-available-height",`${ce}px`),me.setProperty("--radix-popper-anchor-width",`${ue}px`),me.setProperty("--radix-popper-anchor-height",`${de}px`)},"apply")}),C&&$Gi({element:C,padding:c}),iUi({arrowWidth:v,arrowHeight:P}),_&&KGi(N?{strategy:"referenceHidden",...D}:{strategy:"referenceHidden",padding:D.padding,altBoundary:D.altBoundary})]}),j=g.setPlacementState;A3(()=>(j(V),()=>{j(void 0)}),[V,j]);let[Y,X]=pMe(V),K=vP(m);A3(()=>{if(O)K?.()},[O,K]);let J=U.arrow?.x,ee=U.arrow?.y,se=U.arrow?.centerOffset!==0,[ne,re]=Z2.useState();return A3(()=>{if(f)re(window.getComputedStyle(f).zIndex)},[f]),Kee.jsx("div",{ref:L.setFloating,"data-radix-popper-content-wrapper":"",style:{...H,transform:O?H.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ne,"--radix-popper-transform-origin":[U.transformOrigin?.x,U.transformOrigin?.y].join(" "),...U.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:Kee.jsx(oUi,{scope:o,placedSide:Y,placedAlign:X,onArrowChange:b,arrowX:J,arrowY:ee,shouldHideArrow:se,children:Kee.jsx(wP.div,{"data-side":Y,"data-align":X,...A,ref:x,style:{...A.style,animation:!O?"none":A.style?.animation}})})})},"PopperContent"));function LJn(e){return e!==null}yL(LJn,"isNotNull");var iUi=yL((e)=>({name:"transformOrigin",options:e,fn(t){let{placement:n,rects:o,middlewareData:r}=t,s=r.arrow?.centerOffset!==0,a=s?0:e.arrowWidth,c=s?0:e.arrowHeight,[l,h]=pMe(n),d={start:"0%",center:"50%",end:"100%"}[h],u=(r.arrow?.x??0)+a/2,_=(r.arrow?.y??0)+c/2,p="",m="";if(l==="bottom")p=s?d:`${u}px`,m=`${-c}px`;else if(l==="top")p=s?d:`${u}px`,m=`${o.floating.height+c}px`;else if(l==="right")p=`${-c}px`,m=s?d:`${_}px`;else if(l==="left")p=`${o.floating.width+c}px`,m=s?d:`${_}px`;return{data:{x:p,y:m}}}}),"transformOrigin");function pMe(e){let[t,n="center"]=e.split("-");return[t,n]}yL(pMe,"getSideAndAlignFromPlacement");var sUi=Object.defineProperty,aUi=(e,t)=>sUi(e,"name",{value:t,configurable:!0}),cUi=mMe.forwardRef(aUi(function(t,n){let{container:o,...r}=t,[i,s]=mMe.useState(!1);A3(()=>s(!0),[]);let a=o||i&&globalThis?.document?.body;return a?HJn.createPortal(FJn.jsx(wP.div,{...r,ref:n}),a):null},"Portal")),lUi=Object.defineProperty,jB=(e,t)=>lUi(e,"name",{value:t,configurable:!0});function OJn(e,t){return zJn.useReducer((n,o)=>t[n][o]??n,e)}jB(OJn,"useStateMachine");var O0t=jB((e)=>{let{present:t,children:n}=e,o=VJn(t),r=typeof n==="function"?n({present:o.isPresent}):Of.Children.only(n),i=YJn(o.ref,GJn(r));return typeof n==="function"||o.isPresent?Of.cloneElement(r,{ref:i}):null},"Presence");function VJn(e){let[t,n]=Of.useState(),o=Of.useRef(null),r=Of.useRef(e),i=Of.useRef("none"),s=Of.useRef(void 0),a=e?"mounted":"unmounted",[c,l]=OJn(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return Of.useEffect(()=>{if(c==="mounted")i.current=s.current??Gee(o.current),s.current=void 0;else i.current="none"},[c]),A3(()=>{let h=o.current,d=r.current;if(d!==e){let _=i.current,p=Gee(h);if(e)s.current=p,l("MOUNT");else if(p==="none"||h?.display==="none")l("UNMOUNT");else if(d&&_!==p)l("ANIMATION_OUT");else l("UNMOUNT");r.current=e}},[e,l]),A3(()=>{if(t){let h,d=t.ownerDocument.defaultView??window,u=jB((p)=>{let A=Gee(o.current).includes(CSS.escape(p.animationName));if(p.target===t&&A){if(l("ANIMATION_END"),!r.current){let g=t.style.animationFillMode;t.style.animationFillMode="forwards",h=d.setTimeout(()=>{if(t.style.animationFillMode==="forwards")t.style.animationFillMode=g})}}},"handleAnimationEnd"),_=jB((p)=>{if(p.target===t)i.current=Gee(o.current)},"handleAnimationStart");return t.addEventListener("animationstart",_),t.addEventListener("animationcancel",u),t.addEventListener("animationend",u),()=>{d.clearTimeout(h),t.removeEventListener("animationstart",_),t.removeEventListener("animationcancel",u),t.removeEventListener("animationend",u)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:Of.useCallback((h)=>{if(h){let d=getComputedStyle(h);o.current=d,s.current=Gee(d)}else o.current=null;n(h)},[])}}jB(VJn,"usePresence");function fut(e,t){if(typeof e==="function")return e(t);else if(e!==null&&e!==void 0)e.current=t}jB(fut,"setRef");function YJn(...e){let t=Of.useRef(e);return t.current=e,Of.useCallback((n)=>{let o=t.current,r=!1,i=o.map((s)=>{let a=fut(s,n);if(!r&&typeof a==="function")r=!0;return a});if(r)return()=>{for(let s=0;s<i.length;s++){let a=i[s];if(typeof a==="function")a();else fut(o[s],null)}}},[])}jB(YJn,"useStableComposedRefs");function Gee(e){return e?.animationName||"none"}jB(Gee,"getAnimationName");function GJn(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;if(n)return e.ref;if(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n)return e.props.ref;return e.props.ref||e.ref}jB(GJn,"getElementRef");var dUi=Object.defineProperty,V0t=(e,t)=>dUi(e,"name",{value:t,configurable:!0}),zdt=!1;function UJn(){let[e,t]=_Me.useState(zdt);return _Me.useEffect(()=>{if(!zdt)zdt=!0,t(!0)},[]),e}V0t(UJn,"useIsHydrated");var WJn=hUi[" useSyncExternalStore ".trim().toString()];function XJn(){return()=>{}}V0t(XJn,"subscribe");function jJn(){return WJn(XJn,()=>!0,()=>!1)}V0t(jJn,"useIsHydratedModern");var uUi=typeof WJn==="function"?jJn:UJn,pUi=Object.defineProperty,QG=(e,t)=>pUi(e,"name",{value:t,configurable:!0}),Odt="rovingFocusGroup.onEntryFocus",mUi={bubbles:!1,cancelable:!0},gMe="RovingFocusGroup",[yut,KJn,_Ui]=P0t(gMe),[gUi,$Jn]=RG(gMe,[_Ui]),fWn={Vertical:"vertical",Horizontal:"horizontal"},AUi={LTR:"ltr",RTL:"rtl"},[fUi,yUi]=gUi(gMe),xUi=LA.forwardRef(QG(function(t,n){return xL.jsx(yut.Provider,{scope:t.__scopeRovingFocusGroup,children:xL.jsx(yut.Slot,{scope:t.__scopeRovingFocusGroup,children:xL.jsx(CUi,{...t,ref:n})})})},"RovingFocusGroup")),CUi=LA.forwardRef(QG(function(t,n){let{__scopeRovingFocusGroup:o,orientation:r,loop:i=!1,dir:s,currentTabStopId:a,defaultCurrentTabStopId:c,onCurrentTabStopIdChange:l,onEntryFocus:h,preventScrollOnEntryFocus:d=!1,...u}=t,_=LA.useRef(null),p=vg(n,_),m=M0t(s),[A,g]=sMe({prop:a,defaultProp:c??null,onChange:l,caller:gMe}),[f,y]=LA.useState(!1),x=vP(h),C=KJn(o),b=LA.useRef(!1),[I,v]=LA.useState(0);return LA.useEffect(()=>{let P=_.current;if(P)return P.addEventListener(Odt,x),()=>P.removeEventListener(Odt,x)},[x]),xL.jsx(fUi,{scope:o,orientation:r,dir:m,loop:i,currentTabStopId:A,onItemFocus:LA.useCallback((P)=>g(P),[g]),onItemShiftTab:LA.useCallback(()=>y(!0),[]),onFocusableItemAdd:LA.useCallback(()=>v((P)=>P+1),[]),onFocusableItemRemove:LA.useCallback(()=>v((P)=>P-1),[]),children:xL.jsx(wP.div,{tabIndex:f||I===0?-1:0,"data-orientation":r,...u,ref:p,style:{outline:"none",...t.style},onMouseDown:ll(t.onMouseDown,()=>{b.current=!0}),onFocus:ll(t.onFocus,(P)=>{let M=!b.current;if(P.target===P.currentTarget&&M&&!f){let B=new CustomEvent(Odt,mUi);if(P.currentTarget.dispatchEvent(B),!B.defaultPrevented){let T=C().filter((V)=>V.focusable),N=T.find((V)=>V.active),D=T.find((V)=>V.id===A),H=[N,D,...T].filter(Boolean).map((V)=>V.ref.current);Y0t(H,d)}}b.current=!1}),onBlur:ll(t.onBlur,()=>y(!1))})})},"RovingFocusGroupImpl")),bUi="RovingFocusGroupItem",IUi=LA.forwardRef(QG(function(t,n){let{__scopeRovingFocusGroup:o,focusable:r=!0,active:i=!1,tabStopId:s,children:a,...c}=t,l=qee(),h=s||l,d=yUi(bUi,o),u=d.currentTabStopId===h,_=KJn(o),{onFocusableItemAdd:p,onFocusableItemRemove:m,currentTabStopId:A}=d,g=uUi();return A3(()=>{if(!g||!r)return;return p(),()=>m()},[g,r,p,m]),LA.useEffect(()=>{if(g||!r)return;return p(),()=>m()},[g,r,p,m]),xL.jsx(yut.ItemSlot,{scope:o,id:h,focusable:r,active:i,children:xL.jsx(wP.span,{tabIndex:u?0:-1,"data-orientation":d.orientation,...c,ref:n,onMouseDown:ll(t.onMouseDown,(f)=>{if(!r)f.preventDefault();else d.onItemFocus(h)}),onFocus:ll(t.onFocus,()=>d.onItemFocus(h)),onKeyDown:ll(t.onKeyDown,(f)=>{if(f.key==="Tab"&&f.shiftKey){d.onItemShiftTab();return}if(f.target!==f.currentTarget)return;let y=JJn(f,d.orientation,d.dir);if(y!==void 0){if(f.metaKey||f.ctrlKey||f.altKey||f.shiftKey)return;f.preventDefault();let C=_().filter((b)=>b.focusable).map((b)=>b.ref.current);if(y==="last")C.reverse();else if(y==="prev"||y==="next"){if(y==="prev")C.reverse();let b=C.indexOf(f.currentTarget);C=d.loop?ZJn(C,b+1):C.slice(b+1)}setTimeout(()=>Y0t(C))}}),children:typeof a==="function"?a({isCurrentTabStop:u,hasTabStop:A!=null}):a})})},"RovingFocusGroupItem")),vUi={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function qJn(e,t){if(t!==AUi.RTL)return e;return e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}QG(qJn,"getDirectionAwareKey");function JJn(e,t,n){let o=qJn(e.key,n);if(t===fWn.Vertical&&["ArrowLeft","ArrowRight"].includes(o))return;if(t===fWn.Horizontal&&["ArrowUp","ArrowDown"].includes(o))return;return vUi[o]}QG(JJn,"getFocusIntent");function Y0t(e,t=!1){let n=document.activeElement;for(let o of e){if(o===n)return;if(o.focus({preventScroll:t}),document.activeElement!==n)return}}QG(Y0t,"focusFirst");function ZJn(e,t){return e.map((n,o)=>e[(t+o)%e.length])}QG(ZJn,"wrapArray");var SUi=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Hee=new WeakMap,qPe=new WeakMap,JPe={},Vdt=0,eZn=function(e){return e&&(e.host||eZn(e.parentNode))},PUi=function(e,t){return t.map(function(n){if(e.contains(n))return n;var o=eZn(n);if(o&&e.contains(o))return o;return console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null}).filter(function(n){return Boolean(n)})},EUi=function(e,t,n,o){var r=PUi(t,Array.isArray(e)?e:[e]);if(!JPe[n])JPe[n]=new WeakMap;var i=JPe[n],s=[],a=new Set,c=new Set(r),l=function(d){if(!d||a.has(d))return;a.add(d),l(d.parentNode)};r.forEach(l);var h=function(d){if(!d||c.has(d))return;Array.prototype.forEach.call(d.children,function(u){if(a.has(u))h(u);else try{var _=u.getAttribute(o),p=_!==null&&_!=="false",m=(Hee.get(u)||0)+1,A=(i.get(u)||0)+1;if(Hee.set(u,m),i.set(u,A),s.push(u),m===1&&p)qPe.set(u,!0);if(A===1)u.setAttribute(n,"true");if(!p)u.setAttribute(o,"true")}catch(g){console.error("aria-hidden: cannot operate on ",u,g)}})};return h(t),a.clear(),Vdt++,function(){if(s.forEach(function(d){var u=Hee.get(d)-1,_=i.get(d)-1;if(Hee.set(d,u),i.set(d,_),!u){if(!qPe.has(d))d.removeAttribute(o);qPe.delete(d)}if(!_)d.removeAttribute(n)}),Vdt--,!Vdt)Hee=new WeakMap,Hee=new WeakMap,qPe=new WeakMap,JPe={}}},MUi=function(e,t,n){if(n===void 0)n="data-aria-hidden";var o=Array.from(Array.isArray(e)?e:[e]),r=t||SUi(e);if(!r)return function(){return null};return o.push.apply(o,Array.from(r.querySelectorAll("[aria-live], script"))),EUi(o,r,n,"aria-hidden")},yP=function(){return yP=Object.assign||function(t){for(var n,o=1,r=arguments.length;o<r;o++){n=arguments[o];for(var i in n)if(Object.prototype.hasOwnProperty.call(n,i))t[i]=n[i]}return t},yP.apply(this,arguments)};function tZn(e,t){var n={};for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0)n[o]=e[o];if(e!=null&&typeof Object.getOwnPropertySymbols==="function"){for(var r=0,o=Object.getOwnPropertySymbols(e);r<o.length;r++)if(t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r]))n[o[r]]=e[o[r]]}return n}function wUi(e,t,n){if(n||arguments.length===2){for(var o=0,r=t.length,i;o<r;o++)if(i||!(o in t)){if(!i)i=Array.prototype.slice.call(t,0,o);i[o]=t[o]}}return e.concat(i||Array.prototype.slice.call(t))}var pEe="right-scroll-bar-position",mEe="width-before-scroll-bar",BUi="with-scroll-bars-hidden",TUi="--removed-body-scroll-bar-size";function Ydt(e,t){if(typeof e==="function")e(t);else if(e)e.current=t;return e}function DUi(e,t){var n=nZn.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(o){var r=n.value;if(r!==o)n.value=o,n.callback(o,r)}}}})[0];return n.callback=t,n.facade}var NUi=typeof window<"u"?fMe.useLayoutEffect:fMe.useEffect,yWn=new WeakMap;function RUi(e,t){var n=DUi(t||null,function(o){return e.forEach(function(r){return Ydt(r,o)})});return NUi(function(){var o=yWn.get(n);if(o){var r=new Set(o),i=new Set(e),s=n.current;r.forEach(function(a){if(!i.has(a))Ydt(a,null)}),i.forEach(function(a){if(!r.has(a))Ydt(a,s)})}yWn.set(n,e)},[e]),n}function QUi(e){return e}function kUi(e,t){if(t===void 0)t=QUi;var n=[],o=!1,r={read:function(){if(o)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");if(n.length)return n[n.length-1];return e},useMedium:function(i){var s=t(i,o);return n.push(s),function(){n=n.filter(function(a){return a!==s})}},assignSyncMedium:function(i){o=!0;while(n.length){var s=n;n=[],s.forEach(i)}n={push:function(a){return i(a)},filter:function(){return n}}},assignMedium:function(i){o=!0;var s=[];if(n.length){var a=n;n=[],a.forEach(i),s=n}var c=function(){var h=s;s=[],h.forEach(i)},l=function(){return Promise.resolve().then(c)};l(),n={push:function(h){s.push(h),l()},filter:function(h){return s=s.filter(h),n}}}};return r}function LUi(e){if(e===void 0)e={};var t=kUi(null);return t.options=yP({async:!0,ssr:!1},e),t}var rZn=function(e){var t=e.sideCar,n=tZn(e,["sideCar"]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var o=t.read();if(!o)throw Error("Sidecar medium not found");return oZn.createElement(o,yP({},n))};rZn.isSideCarExport=!0;function HUi(e,t){return e.useMedium(t),rZn}var iZn=LUi(),Gdt=function(){return},yMe=e1.forwardRef(function(e,t){var n=e1.useRef(null),o=e1.useState({onScrollCapture:Gdt,onWheelCapture:Gdt,onTouchMoveCapture:Gdt}),r=o[0],i=o[1],{forwardProps:s,children:a,className:c,removeScrollBar:l,enabled:h,shards:d,sideCar:u,noRelative:_,noIsolation:p,inert:m,allowPinchZoom:A,as:g}=e,f=g===void 0?"div":g,y=e.gapMode,x=tZn(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),C=u,b=RUi([n,t]),I=yP(yP({},x),r);return e1.createElement(e1.Fragment,null,h&&e1.createElement(C,{sideCar:iZn,removeScrollBar:l,shards:d,noRelative:_,noIsolation:p,inert:m,setCallbacks:i,allowPinchZoom:!!A,lockRef:n,gapMode:y}),s?e1.cloneElement(e1.Children.only(a),yP(yP({},I),{ref:b})):e1.createElement(f,yP({},I,{className:c,ref:b}),a))});yMe.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};yMe.classNames={fullWidth:mEe,zeroRight:pEe};var xWn,FUi=function(){if(xWn)return xWn;if(typeof __webpack_nonce__<"u")return __webpack_nonce__;return};function zUi(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=FUi();if(t)e.setAttribute("nonce",t);return e}function OUi(e,t){if(e.styleSheet)e.styleSheet.cssText=t;else e.appendChild(document.createTextNode(t))}function VUi(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var YUi=function(){var e=0,t=null;return{add:function(n){if(e==0){if(t=zUi())OUi(t,n),VUi(t)}e++},remove:function(){if(e--,!e&&t)t.parentNode&&t.parentNode.removeChild(t),t=null}}},GUi=function(){var e=YUi();return function(t,n){sZn.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},aZn=function(){var e=GUi(),t=function(n){var{styles:o,dynamic:r}=n;return e(o,r),null};return t},UUi={left:0,top:0,right:0,gap:0},Udt=function(e){return parseInt(e||"",10)||0},WUi=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],o=t[e==="padding"?"paddingTop":"marginTop"],r=t[e==="padding"?"paddingRight":"marginRight"];return[Udt(n),Udt(o),Udt(r)]},XUi=function(e){if(e===void 0)e="margin";if(typeof window>"u")return UUi;var t=WUi(e),n=document.documentElement.clientWidth,o=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,o-n+t[2]-t[0])}},jUi=aZn(),$ee="data-scroll-locked",KUi=function(e,t,n,o){var{left:r,top:i,right:s,gap:a}=e;if(n===void 0)n="margin";return`
  .`.concat(BUi,` {
   overflow: hidden `).concat(o,`;
   padding-right: `).concat(a,"px ").concat(o,`;
  }
  body[`).concat($ee,`] {
    overflow: hidden `).concat(o,`;
    overscroll-behavior: contain;
    `).concat([t&&"position: relative ".concat(o,";"),n==="margin"&&`
    padding-left: `.concat(r,`px;
    padding-top: `).concat(i,`px;
    padding-right: `).concat(s,`px;
    margin-left:0;
    margin-top:0;
    margin-right: `).concat(a,"px ").concat(o,`;
    `),n==="padding"&&"padding-right: ".concat(a,"px ").concat(o,";")].filter(Boolean).join(""),`
  }
  
  .`).concat(pEe,` {
    right: `).concat(a,"px ").concat(o,`;
  }
  
  .`).concat(mEe,` {
    margin-right: `).concat(a,"px ").concat(o,`;
  }
  
  .`).concat(pEe," .").concat(pEe,` {
    right: 0 `).concat(o,`;
  }
  
  .`).concat(mEe," .").concat(mEe,` {
    margin-right: 0 `).concat(o,`;
  }
  
  body[`).concat($ee,`] {
    `).concat(TUi,": ").concat(a,`px;
  }
`)},CWn=function(){var e=parseInt(document.body.getAttribute($ee)||"0",10);return isFinite(e)?e:0},$Ui=function(){hte.useEffect(function(){return document.body.setAttribute($ee,(CWn()+1).toString()),function(){var e=CWn()-1;if(e<=0)document.body.removeAttribute($ee);else document.body.setAttribute($ee,e.toString())}},[])},qUi=function(e){var{noRelative:t,noImportant:n,gapMode:o}=e,r=o===void 0?"margin":o;$Ui();var i=hte.useMemo(function(){return XUi(r)},[r]);return hte.createElement(jUi,{styles:KUi(i,!t,r,!n?"!important":"")})},xut=!1;if(typeof window<"u")try{ape=Object.defineProperty({},"passive",{get:function(){return xut=!0,!0}}),window.addEventListener("test",ape,ape),window.removeEventListener("test",ape,ape)}catch(e){xut=!1}var ape,Fee=xut?{passive:!1}:!1,JUi=function(e){return e.tagName==="TEXTAREA"},cZn=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!JUi(e)&&n[t]==="visible")},ZUi=function(e){return cZn(e,"overflowY")},eWi=function(e){return cZn(e,"overflowX")},bWn=function(e,t){var n=t.ownerDocument,o=t;do{if(typeof ShadowRoot<"u"&&o instanceof ShadowRoot)o=o.host;var r=lZn(e,o);if(r){var i=hZn(e,o),s=i[1],a=i[2];if(s>a)return!0}o=o.parentNode}while(o&&o!==n.body);return!1},tWi=function(e){var{scrollTop:t,scrollHeight:n,clientHeight:o}=e;return[t,n,o]},nWi=function(e){var{scrollLeft:t,scrollWidth:n,clientWidth:o}=e;return[t,n,o]},lZn=function(e,t){return e==="v"?ZUi(t):eWi(t)},hZn=function(e,t){return e==="v"?tWi(t):nWi(t)},oWi=function(e,t){return e==="h"&&t==="rtl"?-1:1},rWi=function(e,t,n,o,r){var i=oWi(e,window.getComputedStyle(t).direction),s=i*o,a=n.target,c=t.contains(a),l=!1,h=s>0,d=0,u=0;do{if(!a)break;var _=hZn(e,a),p=_[0],m=_[1],A=_[2],g=m-A-i*p;if(p||g){if(lZn(e,a))d+=g,u+=p}var f=a.parentNode;a=f&&f.nodeType===Node.DOCUMENT_FRAGMENT_NODE?f.host:f}while(!c&&a!==document.body||c&&(t.contains(a)||t===a));if(h&&(r&&Math.abs(d)<1||!r&&s>d))l=!0;else if(!h&&(r&&Math.abs(u)<1||!r&&-s>u))l=!0;return l},ZPe=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},IWn=function(e){return[e.deltaX,e.deltaY]},vWn=function(e){return e&&"current"in e?e.current:e},iWi=function(e,t){return e[0]===t[0]&&e[1]===t[1]},sWi=function(e){return`
  .block-interactivity-`.concat(e,` {pointer-events: none;}
  .allow-interactivity-`).concat(e,` {pointer-events: all;}
`)},aWi=0,zee=[];function cWi(e){var t=Ju.useRef([]),n=Ju.useRef([0,0]),o=Ju.useRef(),r=Ju.useState(aWi++)[0],i=Ju.useState(aZn)[0],s=Ju.useRef(e);Ju.useEffect(function(){s.current=e},[e]),Ju.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(r));var m=wUi([e.lockRef.current],(e.shards||[]).map(vWn),!0).filter(Boolean);return m.forEach(function(A){return A.classList.add("allow-interactivity-".concat(r))}),function(){document.body.classList.remove("block-interactivity-".concat(r)),m.forEach(function(A){return A.classList.remove("allow-interactivity-".concat(r))})}}return},[e.inert,e.lockRef.current,e.shards]);var a=Ju.useCallback(function(m,A){if("touches"in m&&m.touches.length===2||m.type==="wheel"&&m.ctrlKey)return!s.current.allowPinchZoom;var g=ZPe(m),f=n.current,y="deltaX"in m?m.deltaX:f[0]-g[0],x="deltaY"in m?m.deltaY:f[1]-g[1],C,b=m.target,I=Math.abs(y)>Math.abs(x)?"h":"v";if("touches"in m&&I==="h"&&b.type==="range")return!1;var v=window.getSelection(),P=v&&v.anchorNode,M=P?P===b||P.contains(b):!1;if(M)return!1;var B=bWn(I,b);if(!B)return!0;if(B)C=I;else C=I==="v"?"h":"v",B=bWn(I,b);if(!B)return!1;if(!o.current&&"changedTouches"in m&&(y||x))o.current=C;if(!C)return!0;var T=o.current||C;return rWi(T,A,m,T==="h"?y:x,!0)},[]),c=Ju.useCallback(function(m){var A=m;if(!zee.length||zee[zee.length-1]!==i)return;var g="deltaY"in A?IWn(A):ZPe(A),f=t.current.filter(function(C){return C.name===A.type&&(C.target===A.target||A.target===C.shadowParent)&&iWi(C.delta,g)})[0];if(f&&f.should){if(A.cancelable)A.preventDefault();return}if(!f){var y=(s.current.shards||[]).map(vWn).filter(Boolean).filter(function(C){return C.contains(A.target)}),x=y.length>0?a(A,y[0]):!s.current.noIsolation;if(x){if(A.cancelable)A.preventDefault()}}},[]),l=Ju.useCallback(function(m,A,g,f){var y={name:m,delta:A,target:g,should:f,shadowParent:lWi(g)};t.current.push(y),setTimeout(function(){t.current=t.current.filter(function(x){return x!==y})},1)},[]),h=Ju.useCallback(function(m){n.current=ZPe(m),o.current=void 0},[]),d=Ju.useCallback(function(m){l(m.type,IWn(m),m.target,a(m,e.lockRef.current))},[]),u=Ju.useCallback(function(m){l(m.type,ZPe(m),m.target,a(m,e.lockRef.current))},[]);Ju.useEffect(function(){return zee.push(i),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:u}),document.addEventListener("wheel",c,Fee),document.addEventListener("touchmove",c,Fee),document.addEventListener("touchstart",h,Fee),function(){zee=zee.filter(function(m){return m!==i}),document.removeEventListener("wheel",c,Fee),document.removeEventListener("touchmove",c,Fee),document.removeEventListener("touchstart",h,Fee)}},[]);var{removeScrollBar:_,inert:p}=e;return Ju.createElement(Ju.Fragment,null,p?Ju.createElement(i,{styles:sWi(r)}):null,_?Ju.createElement(qUi,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function lWi(e){var t=null;while(e!==null){if(e instanceof ShadowRoot)t=e.host,e=e.host;e=e.parentNode}return t}var hWi=HUi(iZn,cWi),dZn=AMe.forwardRef(function(e,t){return AMe.createElement(yMe,yP({},e,{ref:t,sideCar:hWi}))});dZn.classNames=yMe.classNames;var dWi=dZn,uWi=Object.defineProperty,vh=(e,t)=>uWi(e,"name",{value:t,configurable:!0}),pWi={LTR:"ltr",RTL:"rtl"},Cut=["Enter"," "],mWi=["ArrowDown","PageUp","Home"],uZn=["ArrowUp","PageDown","End"],_Wi=[...mWi,...uZn],gWi={ltr:[...Cut,"ArrowRight"],rtl:[...Cut,"ArrowLeft"]},AWi={ltr:["ArrowLeft"],rtl:["ArrowRight"]},xMe="Menu",[bpe,fWi,yWi]=P0t(xMe),[kG,pZn]=RG(xMe,[yWi,NJn,$Jn]),CMe=NJn(),mZn=$Jn(),[_Zn,SL]=kG(xMe),[xWi,Ope]=kG(xMe),CWi=vh((e)=>{let{__scopeMenu:t,open:n=!1,children:o,dir:r,onOpenChange:i,modal:s=!0}=e,a=CMe(t),[c,l]=ki.useState(null),h=ki.useRef(!1),d=vP(i),u=M0t(r);return ki.useEffect(()=>{let _=vh(()=>{h.current=!0,document.addEventListener("pointerdown",p,{capture:!0,once:!0}),document.addEventListener("pointermove",p,{capture:!0,once:!0})},"handleKeyDown"),p=vh(()=>h.current=!1,"handlePointer");return document.addEventListener("keydown",_,{capture:!0}),()=>{document.removeEventListener("keydown",_,{capture:!0}),document.removeEventListener("pointerdown",p,{capture:!0}),document.removeEventListener("pointermove",p,{capture:!0})}},[]),ki.useEffect(()=>{if(!n)return;let _=vh(()=>d(!1),"handleBlur");return window.addEventListener("blur",_),()=>window.removeEventListener("blur",_)},[n,d]),Ac.jsx(QJn,{...a,children:Ac.jsx(_Zn,{scope:t,open:n,onOpenChange:d,content:c,onContentChange:l,children:Ac.jsx(xWi,{scope:t,onClose:ki.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:h,dir:u,modal:s,children:o})})})},"Menu"),gZn=ki.forwardRef(vh(function(t,n){let{__scopeMenu:o,...r}=t,i=CMe(o);return Ac.jsx(nUi,{...i,...r,ref:n})},"MenuAnchor")),AZn="MenuPortal",[bWi,fZn]=kG(AZn,{forceMount:void 0}),IWi=vh((e)=>{let{__scopeMenu:t,forceMount:n,children:o,container:r}=e,i=SL(AZn,t);return Ac.jsx(bWi,{scope:t,forceMount:n,children:Ac.jsx(O0t,{present:n||i.open,children:Ac.jsx(cUi,{asChild:!0,container:r,children:o})})})},"MenuPortal"),$9="MenuContent",[vWi,G0t]=kG($9),SWi=ki.forwardRef(vh(function(t,n){let o=fZn($9,t.__scopeMenu),{forceMount:r=o.forceMount,...i}=t,s=SL($9,t.__scopeMenu),a=Ope($9,t.__scopeMenu);return Ac.jsx(bpe.Provider,{scope:t.__scopeMenu,children:Ac.jsx(O0t,{present:r||s.open,children:Ac.jsx(bpe.Slot,{scope:t.__scopeMenu,children:a.modal?Ac.jsx(PWi,{...i,ref:n}):Ac.jsx(EWi,{...i,ref:n})})})})},"MenuContent")),PWi=ki.forwardRef(vh(function(t,n){let o=SL($9,t.__scopeMenu),r=ki.useRef(null),i=vg(n,r);return ki.useEffect(()=>{let s=r.current;if(s)return MUi(s)},[]),Ac.jsx(U0t,{...t,ref:i,trapFocus:o.open,disableOutsidePointerEvents:o.open,disableOutsideScroll:!0,onFocusOutside:ll(t.onFocusOutside,(s)=>s.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>o.onOpenChange(!1)})},"MenuRootContentModal")),EWi=ki.forwardRef(vh(function(t,n){let o=SL($9,t.__scopeMenu);return Ac.jsx(U0t,{...t,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>o.onOpenChange(!1)})},"MenuRootContentNonModal")),MWi=PG("MenuContent.ScrollLock"),U0t=ki.forwardRef(vh(function(t,n){let{__scopeMenu:o,loop:r=!1,trapFocus:i,onOpenAutoFocus:s,onCloseAutoFocus:a,disableOutsidePointerEvents:c,onEntryFocus:l,onEscapeKeyDown:h,onPointerDownOutside:d,onFocusOutside:u,onInteractOutside:_,onDismiss:p,disableOutsideScroll:m,...A}=t,g=SL($9,o),f=Ope($9,o),y=CMe(o),x=mZn(o),C=fWi(o),[b,I]=ki.useState(null),v=ki.useRef(null),[P,M]=ki.useState(null);lJn(P);let{nodes:B,registry:T}=cJn(),N=Boolean(i||m),D=vg(n,v,g.onContentChange,M),L=ki.useRef(0),H=ki.useRef(""),V=ki.useRef(0),O=ki.useRef(null),U=ki.useRef("right"),j=ki.useRef(0),Y=ki.useMemo(()=>m?[v,...B.map((se)=>({current:se}))]:[],[v,B,m]),X=m?dWi:ki.Fragment,K=m?{as:MWi,allowPinchZoom:!0,shards:Y}:void 0,J=vh((se)=>{let ne=H.current+se,re=C().filter((me)=>!me.disabled),Z=document.activeElement,te=re.find((me)=>me.ref.current===Z)?.textValue,ie=re.map((me)=>me.textValue),ce=PZn(ie,ne,te),ue=re.find((me)=>me.textValue===ce)?.ref.current;function de(me){if(H.current=me,window.clearTimeout(L.current),me!=="")L.current=window.setTimeout(()=>de(""),1000)}if(vh(de,"updateSearch"),de(ne),ue)setTimeout(()=>ue.focus())},"handleTypeaheadSearch");ki.useEffect(()=>()=>window.clearTimeout(L.current),[]),T0t();let ee=ki.useCallback((se)=>U.current===O.current?.side&&MZn(se,O.current?.area),[]);return Ac.jsx(vWi,{scope:o,searchRef:H,onItemEnter:ki.useCallback((se)=>{if(ee(se))se.preventDefault()},[ee]),onItemLeave:ki.useCallback((se)=>{if(ee(se))return;v.current?.focus(),I(null)},[ee]),onTriggerLeave:ki.useCallback((se)=>{if(ee(se))se.preventDefault()},[ee]),pointerGraceTimerRef:V,onPointerGraceIntentChange:ki.useCallback((se)=>{O.current=se},[]),children:Ac.jsx(aJn,{registry:N?T:null,children:Ac.jsx(X,{...K,children:Ac.jsx(OYi,{asChild:!0,trapped:i,branches:B,onMountAutoFocus:ll(s,(se)=>{se.preventDefault(),v.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:a,children:Ac.jsx(QYi,{asChild:!0,disableOutsidePointerEvents:c,onEscapeKeyDown:h,onPointerDownOutside:d,onFocusOutside:u,onInteractOutside:_,onDismiss:p,children:Ac.jsx(xUi,{asChild:!0,...x,dir:f.dir,orientation:"vertical",loop:r,currentTabStopId:b,onCurrentTabStopIdChange:I,onEntryFocus:ll(l,(se)=>{if(!f.isUsingKeyboardRef.current)se.preventDefault()}),preventScrollOnEntryFocus:!0,children:Ac.jsx(rUi,{role:"menu","aria-orientation":"vertical","data-state":W0t(g.open),"data-radix-menu-content":"",dir:f.dir,...y,...A,ref:D,style:{outline:"none",...A.style},onKeyDown:ll(A.onKeyDown,(se)=>{let re=se.target.closest("[data-radix-menu-content]")===se.currentTarget,Z=se.ctrlKey||se.altKey||se.metaKey,te=se.key.length===1;if(re){if(se.key==="Tab")se.preventDefault();if(!Z&&te)J(se.key)}let ie=v.current;if(se.target!==ie)return;if(!_Wi.includes(se.key))return;se.preventDefault();let ue=C().filter((de)=>!de.disabled).map((de)=>de.ref.current);if(uZn.includes(se.key))ue.reverse();vZn(ue)}),onBlur:ll(t.onBlur,(se)=>{if(!se.currentTarget.contains(se.target))window.clearTimeout(L.current),H.current=""}),onPointerMove:ll(t.onPointerMove,Jee((se)=>{let ne=se.target,re=j.current!==se.clientX;if(se.currentTarget.contains(ne)&&re){let Z=se.clientX>j.current?"right":"left";U.current=Z,j.current=se.clientX}}))})})})})})})})},"MenuContentImpl")),but="MenuItem",SWn="menu.itemSelect",yZn=ki.forwardRef(vh(function(t,n){let{disabled:o=!1,onSelect:r,...i}=t,s=ki.useRef(null),a=Ope(but,t.__scopeMenu),c=G0t(but,t.__scopeMenu),l=vg(n,s),h=ki.useRef(!1),d=vh(()=>{let u=s.current;if(!o&&u){let _=new CustomEvent(SWn,{bubbles:!0,cancelable:!0});if(u.addEventListener(SWn,(p)=>r?.(p),{once:!0}),S0t(u,_),_.defaultPrevented)h.current=!1;else a.onClose()}},"handleSelect");return Ac.jsx(xZn,{...i,ref:l,disabled:o,onClick:ll(t.onClick,d),onPointerDown:(u)=>{t.onPointerDown?.(u),h.current=!0},onPointerUp:ll(t.onPointerUp,(u)=>{if(!h.current)u.currentTarget?.click()}),onKeyDown:ll(t.onKeyDown,(u)=>{if(o||u.target!==u.currentTarget)return;if(c.searchRef.current!==""&&u.key===" ")return;if(Cut.includes(u.key))u.currentTarget.click(),u.preventDefault()})})},"MenuItem")),xZn=ki.forwardRef(vh(function(t,n){let{__scopeMenu:o,disabled:r=!1,textValue:i,...s}=t,a=G0t(but,o),c=mZn(o),l=ki.useRef(null),h=vg(n,l),[d,u]=ki.useState(!1),[_,p]=ki.useState("");return ki.useEffect(()=>{let m=l.current;if(m)p((m.textContent??"").trim())},[s.children]),Ac.jsx(bpe.ItemSlot,{scope:o,disabled:r,textValue:i??_,children:Ac.jsx(IUi,{asChild:!0,...c,focusable:!r,children:Ac.jsx(wP.div,{role:"menuitem","data-highlighted":d?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...s,ref:h,onPointerMove:ll(t.onPointerMove,Jee((m)=>{if(r)a.onItemLeave(m);else if(a.onItemEnter(m),!m.defaultPrevented)m.currentTarget.focus({preventScroll:!0})})),onPointerLeave:ll(t.onPointerLeave,Jee((m)=>a.onItemLeave(m))),onFocus:ll(t.onFocus,()=>u(!0)),onBlur:ll(t.onBlur,()=>u(!1))})})})},"MenuItemImpl")),wWi=ki.forwardRef(vh(function(t,n){let{checked:o=!1,onCheckedChange:r,...i}=t;return Ac.jsx(DWi,{scope:t.__scopeMenu,checked:o,children:Ac.jsx(yZn,{role:"menuitemcheckbox","aria-checked":NEe(o)?"mixed":o,...i,ref:n,"data-state":IZn(o),onSelect:ll(i.onSelect,()=>r?.(NEe(o)?!0:!o),{checkForDefaultPrevented:!1})})})},"MenuCheckboxItem")),BWi="MenuRadioGroup",[VCa,YCa]=kG(BWi,{value:void 0,onValueChange:vh(()=>{},"onValueChange")}),TWi="MenuItemIndicator",[DWi,GCa]=kG(TWi,{checked:!1}),NWi=ki.forwardRef(vh(function(t,n){let{__scopeMenu:o,...r}=t;return Ac.jsx(wP.div,{role:"separator","aria-orientation":"horizontal",...r,ref:n})},"MenuSeparator")),CZn="MenuSub",[RWi,bZn]=kG(CZn),QWi=vh((e)=>{let{__scopeMenu:t,children:n,open:o=!1,onOpenChange:r}=e,i=SL(CZn,t),s=CMe(t),[a,c]=ki.useState(null),[l,h]=ki.useState(null),d=vP(r);return ki.useEffect(()=>{if(i.open===!1)d(!1);return()=>d(!1)},[i.open,d]),Ac.jsx(QJn,{...s,children:Ac.jsx(_Zn,{scope:t,open:o,onOpenChange:d,content:l,onContentChange:h,children:Ac.jsx(RWi,{scope:t,contentId:qee(),triggerId:qee(),trigger:a,onTriggerChange:c,children:n})})})},"MenuSub"),eEe="MenuSubTrigger",kWi=ki.forwardRef(vh(function(t,n){let o=SL(eEe,t.__scopeMenu),r=Ope(eEe,t.__scopeMenu),i=bZn(eEe,t.__scopeMenu),s=G0t(eEe,t.__scopeMenu),a=ki.useRef(null),{pointerGraceTimerRef:c,onPointerGraceIntentChange:l}=s,h={__scopeMenu:t.__scopeMenu},d=ki.useCallback(()=>{if(a.current)window.clearTimeout(a.current);a.current=null},[]);ki.useEffect(()=>d,[d]),ki.useEffect(()=>{let _=c.current;return()=>{window.clearTimeout(_),l(null)}},[c,l]);let u=vg(n,i.onTriggerChange);return Ac.jsx(gZn,{asChild:!0,...h,children:Ac.jsx(xZn,{id:i.triggerId,"aria-haspopup":"menu","aria-expanded":o.open,"aria-controls":o.open?i.contentId:void 0,"data-state":W0t(o.open),...t,ref:u,onClick:(_)=>{if(t.onClick?.(_),t.disabled||_.defaultPrevented)return;if(_.currentTarget.focus(),!o.open)o.onOpenChange(!0)},onPointerMove:ll(t.onPointerMove,Jee((_)=>{if(s.onItemEnter(_),_.defaultPrevented)return;if(!t.disabled&&!o.open&&!a.current)s.onPointerGraceIntentChange(null),a.current=window.setTimeout(()=>{o.onOpenChange(!0),d()},100)})),onPointerLeave:ll(t.onPointerLeave,Jee((_)=>{d();let p=o.content?.getBoundingClientRect();if(p){let m=o.content?.dataset.side,A=m==="right",g=A?-5:5,f=p[A?"left":"right"],y=p[A?"right":"left"];s.onPointerGraceIntentChange({area:[{x:_.clientX+g,y:_.clientY},{x:f,y:p.top},{x:y,y:p.top},{x:y,y:p.bottom},{x:f,y:p.bottom}],side:m}),window.clearTimeout(c.current),c.current=window.setTimeout(()=>s.onPointerGraceIntentChange(null),300)}else{if(s.onTriggerLeave(_),_.defaultPrevented)return;s.onPointerGraceIntentChange(null)}})),onKeyDown:ll(t.onKeyDown,(_)=>{if(t.disabled||_.target!==_.currentTarget)return;if(s.searchRef.current!==""&&_.key===" ")return;if(gWi[r.dir].includes(_.key))o.onOpenChange(!0),o.content?.focus(),_.preventDefault()})})})},"MenuSubTrigger")),LWi="MenuSubContent",HWi=ki.forwardRef(vh(function(t,n){let o=fZn($9,t.__scopeMenu),{forceMount:r=o.forceMount,align:i="start",...s}=t,a=SL($9,t.__scopeMenu),c=Ope($9,t.__scopeMenu),l=bZn(LWi,t.__scopeMenu),h=ki.useRef(null),d=vg(n,h);return Ac.jsx(bpe.Provider,{scope:t.__scopeMenu,children:Ac.jsx(O0t,{present:r||a.open,children:Ac.jsx(bpe.Slot,{scope:t.__scopeMenu,children:Ac.jsx(U0t,{id:l.contentId,"aria-labelledby":l.triggerId,...s,ref:d,align:i,side:c.dir===pWi.RTL?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:(u)=>{if(c.isUsingKeyboardRef.current)h.current?.focus();u.preventDefault()},onCloseAutoFocus:(u)=>u.preventDefault(),onFocusOutside:ll(t.onFocusOutside,(u)=>{if(u.target!==l.trigger)a.onOpenChange(!1)}),onEscapeKeyDown:ll(t.onEscapeKeyDown,(u)=>{c.onClose(),u.preventDefault()}),onKeyDown:ll(t.onKeyDown,(u)=>{let _=u.currentTarget.contains(u.target),p=AWi[c.dir].includes(u.key);if(_&&p)a.onOpenChange(!1),l.trigger?.focus(),u.preventDefault()})})})})})},"MenuSubContent"));function W0t(e){return e?"open":"closed"}vh(W0t,"getOpenState");function NEe(e){return e==="indeterminate"}vh(NEe,"isIndeterminate");function IZn(e){return NEe(e)?"indeterminate":e?"checked":"unchecked"}vh(IZn,"getCheckedState");function vZn(e){let t=document.activeElement;for(let n of e){if(n===t)return;if(n.focus(),document.activeElement!==t)return}}vh(vZn,"focusFirst");function SZn(e,t){return e.map((n,o)=>e[(t+o)%e.length])}vh(SZn,"wrapArray");function PZn(e,t,n){let r=t.length>1&&Array.from(t).every((l)=>l===t[0])?t[0]:t,i=n?e.indexOf(n):-1,s=SZn(e,Math.max(i,0));if(r.length===1)s=s.filter((l)=>l!==n);let c=s.find((l)=>l.toLowerCase().startsWith(r.toLowerCase()));return c!==n?c:void 0}vh(PZn,"getNextMatch");function EZn(e,t){let{x:n,y:o}=e,r=!1;for(let i=0,s=t.length-1;i<t.length;s=i++){let a=t[i],c=t[s],{x:l,y:h}=a,{x:d,y:u}=c;if(h>o!==u>o&&n<(d-l)*(o-h)/(u-h)+l)r=!r}return r}vh(EZn,"isPointInPolygon");function MZn(e,t){if(!t)return!1;let n={x:e.clientX,y:e.clientY};return EZn(n,t)}vh(MZn,"isPointerInGraceArea");function Jee(e){return(t)=>t.pointerType==="mouse"?e(t):void 0}vh(Jee,"whenMouse");var FWi=Object.defineProperty,BP=(e,t)=>FWi(e,"name",{value:t,configurable:!0}),X0t="DropdownMenu",[zWi,UCa]=RG(X0t,[pZn]),TP=pZn(),[OWi,wZn]=zWi(X0t),VWi=BP((e)=>{let{__scopeDropdownMenu:t,children:n,dir:o,open:r,defaultOpen:i,onOpenChange:s,modal:a=!0}=e,c=TP(t),l=C3.useRef(null),[h,d]=sMe({prop:r,defaultProp:i??!1,onChange:s,caller:X0t});return x3.jsx(OWi,{scope:t,triggerId:qee(),triggerRef:l,contentId:qee(),open:h,onOpenChange:d,onOpenToggle:C3.useCallback(()=>d((u)=>!u),[d]),modal:a,children:x3.jsx(CWi,{...c,open:h,onOpenChange:d,dir:o,modal:a,children:n})})},"DropdownMenu"),YWi="DropdownMenuTrigger",GWi=C3.forwardRef(BP(function(t,n){let{__scopeDropdownMenu:o,disabled:r=!1,...i}=t,s=wZn(YWi,o),a=TP(o),c=vg(n,s.triggerRef);return x3.jsx(gZn,{asChild:!0,...a,children:x3.jsx(wP.button,{type:"button",id:s.triggerId,"aria-haspopup":"menu","aria-expanded":s.open,"aria-controls":s.open?s.contentId:void 0,"data-state":s.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...i,ref:c,onPointerDown:ll(t.onPointerDown,(l)=>{if(!r&&l.button===0&&l.ctrlKey===!1){if(s.onOpenToggle(),!s.open)l.preventDefault()}}),onKeyDown:ll(t.onKeyDown,(l)=>{if(r)return;if(["Enter"," "].includes(l.key))s.onOpenToggle();if(l.key==="ArrowDown")s.onOpenChange(!0);if(["Enter"," ","ArrowDown"].includes(l.key))l.preventDefault()})})})},"DropdownMenuTrigger")),_Ee=BP((e)=>{let{__scopeDropdownMenu:t,...n}=e,o=TP(t);return x3.jsx(IWi,{...o,...n})},"DropdownMenuPortal"),UWi="DropdownMenuContent",WWi=C3.forwardRef(BP(function(t,n){let{__scopeDropdownMenu:o,...r}=t,i=wZn(UWi,o),s=TP(o),a=C3.useRef(!1);return x3.jsx(SWi,{id:i.contentId,"aria-labelledby":i.triggerId,...s,...r,ref:n,onCloseAutoFocus:ll(t.onCloseAutoFocus,(c)=>{if(!a.current)i.triggerRef.current?.focus();a.current=!1,c.preventDefault()}),onInteractOutside:ll(t.onInteractOutside,(c)=>{let l=c.detail.originalEvent,h=l.button===0&&l.ctrlKey===!0,d=l.button===2||h;if(!i.modal||d)a.current=!0}),style:{...t.style,...{"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}}})},"DropdownMenuContent")),qu=C3.forwardRef(BP(function(t,n){let{__scopeDropdownMenu:o,...r}=t,i=TP(o);return x3.jsx(yZn,{...i,...r,ref:n})},"DropdownMenuItem")),XWi=C3.forwardRef(BP(function(t,n){let{__scopeDropdownMenu:o,...r}=t,i=TP(o);return x3.jsx(wWi,{...i,...r,ref:n})},"DropdownMenuCheckboxItem")),OB=C3.forwardRef(BP(function(t,n){let{__scopeDropdownMenu:o,...r}=t,i=TP(o);return x3.jsx(NWi,{...i,...r,ref:n})},"DropdownMenuSeparator")),Iut=BP((e)=>{let{__scopeDropdownMenu:t,children:n,open:o,onOpenChange:r,defaultOpen:i}=e,s=TP(t),[a,c]=sMe({prop:o,defaultProp:i??!1,onChange:r,caller:"DropdownMenuSub"});return x3.jsx(QWi,{...s,open:a,onOpenChange:c,children:n})},"DropdownMenuSub"),vut=C3.forwardRef(BP(function(t,n){let{__scopeDropdownMenu:o,...r}=t,i=TP(o);return x3.jsx(kWi,{...i,...r,ref:n})},"DropdownMenuSubTrigger")),jWi=C3.forwardRef(BP(function(t,n){let{__scopeDropdownMenu:o,...r}=t,i=TP(o);return x3.jsx(HWi,{...i,...r,ref:n,style:{...t.style,...{"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}}})},"DropdownMenuSubContent")),Sut=(e)=>{let[t,n]=Ipe.useState(null),[o,r]=Ipe.useState();return Ipe.useLayoutEffect(()=>{if(!t)return;let i=document.getElementById(t.getAttribute("aria-labelledby")??"");if(!i)return;let s=0,a=()=>{if(s=Math.max(s,t.offsetWidth),!s)return;let l=i.getBoundingClientRect(),h=Math.max(l.left-10,document.documentElement.clientWidth-l.right-10);r(h<s?l.width:void 0)},c=new ResizeObserver(a);return c.observe(t),c.observe(i),a(),window.addEventListener("resize",a),()=>{c.disconnect(),window.removeEventListener("resize",a)}},[t]),BZn.jsx(jWi,{...e,ref:n,sideOffset:o===void 0?e.sideOffset:-o,style:{...e.style,...o===void 0?{}:{minWidth:Math.min(160,o),maxWidth:o}}})},TZn={boxSizing:"border-box",minWidth:"min(160px, calc(100vw - 20px))",maxWidth:"calc(100vw - 20px)",maxHeight:"var(--radix-dropdown-menu-content-available-height, calc(100dvh - 20px))",overflowY:"auto",overflowX:"hidden",overscrollBehavior:"contain",overflowWrap:"anywhere"},NA=()=>KB.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:KB.jsx("path",{d:"M20 6 9 17l-5-5"})}),Eut=({isOpen:e})=>KB.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",style:{transition:"transform 0.2s ease",transform:e?"rotate(90deg)":"rotate(0deg)",opacity:0.6},children:KB.jsx("path",{d:"m9 18 6-6-6-6"})}),KWi=()=>KB.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:KB.jsx("path",{d:"M5 12h14"})}),PWn=()=>KB.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"lucide lucide-dot-icon lucide-dot",children:KB.jsx("circle",{cx:"12.1",cy:"12.1",r:"4.5",fill:"white"})}),Qy={padding:"6px 8px",borderRadius:6,cursor:"default",outline:"none",userSelect:"none",display:"flex",alignItems:"center",gap:8,color:"#fafafa",fontWeight:400,fontSize:14,transition:"background-color 0.15s ease, color 0.15s ease",fontFamily:'system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif'},$Wi={paddingLeft:32,paddingTop:6,paddingBottom:6,paddingRight:8},Wdt={height:1,backgroundColor:"#ffffff1a",margin:"4px 0"},qWi={...TZn,backgroundColor:"#262626",color:"#fafafa",borderRadius:8,boxShadow:"0px 12px 48px -12px rgba(0, 0, 0, 0.5), 0px 8px 24px -8px rgba(0, 0, 0, 0.3)",border:"1px solid #333333",padding:"4px",zIndex:Qpe.appearanceMenu,fontSize:14,fontFamily:'system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif'},m5={width:16,height:16,display:"flex",alignItems:"flex-end",justifyContent:"center",flexShrink:0},JWi=()=>{let{visibility:e,setLayerVisibility:t}=NG(),{darkBackgroundEnabled:n,setDarkBackgroundEnabled:o,lightingEnabled:r,setLightingEnabled:i}=y0t(),[s,a]=Put.useState(!1),[c,l]=Put.useState(null);return Nr.jsxs(Nr.Fragment,{children:[Nr.jsx(OB,{style:Wdt}),Nr.jsxs(Iut,{onOpenChange:a,children:[Nr.jsxs(vut,{style:{...Qy,...$Wi,backgroundColor:s||c==="appearance"?"#404040":"transparent"},onMouseEnter:()=>l("appearance"),onMouseLeave:()=>l(null),onTouchStart:()=>l("appearance"),children:[Nr.jsx("span",{style:{flex:1,display:"flex",alignItems:"center"},children:"Appearance"}),Nr.jsx("div",{style:{marginLeft:"auto",display:"flex",alignItems:"flex-end",marginBottom:"-5px"},children:Nr.jsx(Eut,{isOpen:s})})]}),Nr.jsx(_Ee,{children:Nr.jsxs(Sut,{style:{...qWi,marginLeft:-2},collisionPadding:10,avoidCollisions:!0,children:[Nr.jsxs(qu,{style:{...Qy,backgroundColor:c==="darkBackground"?"#404040":"transparent"},onSelect:(h)=>h.preventDefault(),onPointerDown:(h)=>{h.preventDefault(),o(!n)},onMouseEnter:()=>l("darkBackground"),onMouseLeave:()=>l(null),onTouchStart:()=>l("darkBackground"),children:[Nr.jsx("span",{style:m5,children:n&&Nr.jsx(NA,{})}),Nr.jsx("span",{style:{display:"flex",alignItems:"center"},children:"Dark Background"})]}),Nr.jsxs(qu,{style:{...Qy,backgroundColor:c==="lighting"?"#404040":"transparent"},onSelect:(h)=>h.preventDefault(),onPointerDown:(h)=>{h.preventDefault(),i(!r)},onMouseEnter:()=>l("lighting"),onMouseLeave:()=>l(null),onTouchStart:()=>l("lighting"),children:[Nr.jsx("span",{style:m5,children:r&&Nr.jsx(NA,{})}),Nr.jsx("span",{style:{display:"flex",alignItems:"center"},children:"Lighting"})]}),Nr.jsx(OB,{style:Wdt}),Nr.jsxs(qu,{style:{...Qy,backgroundColor:c==="boardBody"?"#404040":"transparent"},onSelect:(h)=>h.preventDefault(),onPointerDown:(h)=>{h.preventDefault(),t("boardBody",!e.boardBody)},onMouseEnter:()=>l("boardBody"),onMouseLeave:()=>l(null),onTouchStart:()=>l("boardBody"),children:[Nr.jsx("span",{style:m5,children:e.boardBody&&Nr.jsx(NA,{})}),Nr.jsx("span",{style:{display:"flex",alignItems:"center"},children:"Board Body"})]}),Nr.jsxs(qu,{style:{...Qy,backgroundColor:c==="topCopper"?"#404040":"transparent"},onSelect:(h)=>h.preventDefault(),onPointerDown:(h)=>{h.preventDefault(),t("topCopper",!e.topCopper)},onMouseEnter:()=>l("topCopper"),onMouseLeave:()=>l(null),onTouchStart:()=>l("topCopper"),children:[Nr.jsx("span",{style:m5,children:e.topCopper&&Nr.jsx(NA,{})}),Nr.jsx("span",{style:{display:"flex",alignItems:"center"},children:"Top Copper"})]}),Nr.jsxs(qu,{style:{...Qy,backgroundColor:c==="bottomCopper"?"#404040":"transparent"},onSelect:(h)=>h.preventDefault(),onPointerDown:(h)=>{h.preventDefault(),t("bottomCopper",!e.bottomCopper)},onMouseEnter:()=>l("bottomCopper"),onMouseLeave:()=>l(null),onTouchStart:()=>l("bottomCopper"),children:[Nr.jsx("span",{style:m5,children:e.bottomCopper&&Nr.jsx(NA,{})}),Nr.jsx("span",{style:{display:"flex",alignItems:"center"},children:"Bottom Copper"})]}),Nr.jsxs(qu,{style:{...Qy,backgroundColor:c==="keepout"?"#404040":"transparent"},onSelect:(h)=>h.preventDefault(),onPointerDown:(h)=>{h.preventDefault(),t("keepout",!e.keepout)},onMouseEnter:()=>l("keepout"),onMouseLeave:()=>l(null),onTouchStart:()=>l("keepout"),children:[Nr.jsx("span",{style:m5,children:e.keepout&&Nr.jsx(NA,{})}),Nr.jsx("span",{style:{display:"flex",alignItems:"center"},children:"Keepout"})]}),Nr.jsxs(qu,{style:{...Qy,backgroundColor:c==="topSilkscreen"?"#404040":"transparent"},onSelect:(h)=>h.preventDefault(),onPointerDown:(h)=>{h.preventDefault(),t("topSilkscreen",!e.topSilkscreen)},onMouseEnter:()=>l("topSilkscreen"),onMouseLeave:()=>l(null),onTouchStart:()=>l("topSilkscreen"),children:[Nr.jsx("span",{style:m5,children:e.topSilkscreen&&Nr.jsx(NA,{})}),Nr.jsx("span",{style:{display:"flex",alignItems:"center"},children:"Top Silkscreen"})]}),Nr.jsxs(qu,{style:{...Qy,backgroundColor:c==="bottomSilkscreen"?"#404040":"transparent"},onSelect:(h)=>h.preventDefault(),onPointerDown:(h)=>{h.preventDefault(),t("bottomSilkscreen",!e.bottomSilkscreen)},onMouseEnter:()=>l("bottomSilkscreen"),onMouseLeave:()=>l(null),onTouchStart:()=>l("bottomSilkscreen"),children:[Nr.jsx("span",{style:m5,children:e.bottomSilkscreen&&Nr.jsx(NA,{})}),Nr.jsx("span",{style:{display:"flex",alignItems:"center"},children:"Bottom Silkscreen"})]}),Nr.jsxs(qu,{style:{...Qy,backgroundColor:c==="topMask"?"#404040":"transparent"},onSelect:(h)=>h.preventDefault(),onPointerDown:(h)=>{h.preventDefault(),t("topMask",!e.topMask)},onMouseEnter:()=>l("topMask"),onMouseLeave:()=>l(null),onTouchStart:()=>l("topMask"),children:[Nr.jsx("span",{style:m5,children:e.topMask&&Nr.jsx(NA,{})}),Nr.jsx("span",{style:{display:"flex",alignItems:"center"},children:"Top Soldermask"})]}),Nr.jsxs(qu,{style:{...Qy,backgroundColor:c==="bottomMask"?"#404040":"transparent"},onSelect:(h)=>h.preventDefault(),onPointerDown:(h)=>{h.preventDefault(),t("bottomMask",!e.bottomMask)},onMouseEnter:()=>l("bottomMask"),onMouseLeave:()=>l(null),onTouchStart:()=>l("bottomMask"),children:[Nr.jsx("span",{style:m5,children:e.bottomMask&&Nr.jsx(NA,{})}),Nr.jsx("span",{style:{display:"flex",alignItems:"center"},children:"Bottom Soldermask"})]}),Nr.jsxs(qu,{style:{...Qy,backgroundColor:c==="pcbNotes"?"#404040":"transparent"},onSelect:(h)=>h.preventDefault(),onPointerDown:(h)=>{h.preventDefault(),t("pcbNotes",!e.pcbNotes)},onMouseEnter:()=>l("pcbNotes"),onMouseLeave:()=>l(null),onTouchStart:()=>l("pcbNotes"),children:[Nr.jsx("span",{style:m5,children:e.pcbNotes&&Nr.jsx(NA,{})}),Nr.jsx("span",{style:{display:"flex",alignItems:"center"},children:"PCB Notes"})]}),Nr.jsxs(qu,{style:{...Qy,backgroundColor:c==="smtModels"?"#404040":"transparent"},onSelect:(h)=>h.preventDefault(),onPointerDown:(h)=>{h.preventDefault(),t("smtModels",!e.smtModels)},onMouseEnter:()=>l("smtModels"),onMouseLeave:()=>l(null),onTouchStart:()=>l("smtModels"),children:[Nr.jsx("span",{style:m5,children:e.smtModels&&Nr.jsx(NA,{})}),Nr.jsx("span",{style:{display:"flex",alignItems:"center"},children:"Surface Mount Components"})]}),Nr.jsxs(qu,{style:{...Qy,backgroundColor:c==="throughHoleModels"?"#404040":"transparent"},onSelect:(h)=>h.preventDefault(),onPointerDown:(h)=>{h.preventDefault(),t("throughHoleModels",!e.throughHoleModels)},onMouseEnter:()=>l("throughHoleModels"),onMouseLeave:()=>l(null),onTouchStart:()=>l("throughHoleModels"),children:[Nr.jsx("span",{style:m5,children:e.throughHoleModels&&Nr.jsx(NA,{})}),Nr.jsx("span",{style:{display:"flex",alignItems:"center"},children:"Through-Hole Components"})]}),Nr.jsx(OB,{style:Wdt}),Nr.jsxs(qu,{style:{...Qy,backgroundColor:c==="enclosure"?"#404040":"transparent"},onSelect:(h)=>h.preventDefault(),onPointerDown:(h)=>{h.preventDefault(),t("enclosure",VHi(e.enclosure))},onMouseEnter:()=>l("enclosure"),onMouseLeave:()=>l(null),onTouchStart:()=>l("enclosure"),title:`Enclosure: ${e.enclosure}`,children:[Nr.jsxs("span",{style:m5,children:[e.enclosure==="opaque"&&Nr.jsx(NA,{}),e.enclosure==="translucent"&&Nr.jsx(KWi,{})]}),Nr.jsx("span",{style:{display:"flex",alignItems:"center"},children:"Enclosure"})]})]})})]})]})},ZWi=["Custom","Top Center Angled","Top Down","Top Left Corner","Top Right Corner","Left Sideview","Right Sideview","Front"],Xdt={...TZn,backgroundColor:"#262626",color:"#fafafa",borderRadius:6,boxShadow:"0px 12px 48px -12px rgba(0, 0, 0, 0.5), 0px 8px 24px -8px rgba(0, 0, 0, 0.3)",border:"1px solid #333333",padding:"4px",zIndex:Qpe.contextMenu,fontSize:14,fontWeight:400,fontFamily:'system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif'},_5={padding:"6px 8px",borderRadius:6,cursor:"default",outline:"none",userSelect:"none",display:"flex",alignItems:"center",gap:8,color:"#fafafa",fontWeight:400,fontSize:14,transition:"background-color 0.15s ease, color 0.15s ease",fontFamily:'system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif'},mL={paddingLeft:32,paddingTop:6,paddingBottom:6,paddingRight:8},Oee={width:16,height:16,display:"flex",alignItems:"flex-end",justifyContent:"center",flexShrink:0},Vee={height:1,backgroundColor:"#ffffff1a",margin:"4px 0"},EWn={fontSize:11,opacity:0.65,fontWeight:500,color:"#b5b5bcff",backgroundColor:"rgba(161, 161, 170, 0.1)",padding:"2px 6px",borderRadius:4,border:"1px solid rgba(161, 161, 170, 0.2)",letterSpacing:"0.3px"},eXi=({menuRef:e,menuPos:t,engine:n,cameraPreset:o,autoRotate:r,foldPcbs:i=!1,onFoldPcbsToggle:s,flexScene:a=!1,referenceObject:c=null,onEngineSwitch:l,onCameraPresetSelect:h,onAutoRotateToggle:d,onReferenceObjectSelect:u=()=>{},onViewSchematicComponent:_,componentName:p,onHideComponent:m,onUnhideAllComponents:A,onDownloadGltf:g,onOpenKeyboardShortcuts:f})=>{let{cameraType:y,setCameraType:x}=qB(),{gridEnabled:C,setGridEnabled:b}=y0t(),[I,v]=gEe.useState(!1),[P,M]=gEe.useState(!1),[B,T]=gEe.useState(null);return Fr.jsx("div",{ref:e,style:{position:"fixed",left:t.x,top:t.y,width:0,height:0},children:Fr.jsxs(VWi,{open:!0,modal:!1,children:[Fr.jsx(GWi,{asChild:!0,children:Fr.jsx("div",{style:{position:"absolute",width:1,height:1}})}),Fr.jsx(_Ee,{children:Fr.jsxs(WWi,{style:Xdt,collisionPadding:10,avoidCollisions:!0,sideOffset:0,align:"start",children:[m&&Fr.jsx(qu,{style:{..._5,...mL,backgroundColor:B==="hide"?"#404040":"transparent"},onSelect:m,onMouseEnter:()=>T("hide"),onMouseLeave:()=>T(null),children:`Hide "${p}"`}),_&&Fr.jsx(Fr.Fragment,{children:Fr.jsx(qu,{style:{..._5,...mL,backgroundColor:B==="schematic"?"#404040":"transparent"},onSelect:_,onMouseEnter:()=>T("schematic"),onMouseLeave:()=>T(null),children:"Show on schematic"})}),A&&Fr.jsx(qu,{style:{..._5,...mL,backgroundColor:B==="unhide"?"#404040":"transparent"},onSelect:A,onMouseEnter:()=>T("unhide"),onMouseLeave:()=>T(null),children:"Unhide All Components"}),(_||m||A)&&Fr.jsx(OB,{style:Vee}),Fr.jsxs(Iut,{onOpenChange:v,children:[Fr.jsxs(vut,{style:{..._5,...mL,backgroundColor:I||B==="camera"?"#404040":"transparent"},onMouseEnter:()=>T("camera"),onMouseLeave:()=>T(null),onTouchStart:()=>T("camera"),children:[Fr.jsx("span",{style:{flex:1,display:"flex",alignItems:"center"},children:"Camera"}),Fr.jsxs("div",{style:{display:"flex",alignItems:"flex-end",gap:6,marginLeft:"auto"},children:[Fr.jsx("span",{style:{opacity:0.55,fontSize:13},children:o}),Fr.jsx(Eut,{isOpen:I})]})]}),Fr.jsx(_Ee,{children:Fr.jsxs(Sut,{style:{...Xdt,marginLeft:-2},collisionPadding:10,avoidCollisions:!0,children:[ZWi.map((N)=>Fr.jsxs(qu,{style:{..._5,backgroundColor:B===N?"#404040":"transparent"},onSelect:()=>h(N),onMouseEnter:()=>T(N),onMouseLeave:()=>T(null),onTouchStart:()=>T(N),children:[Fr.jsx("span",{style:Oee,children:o===N&&Fr.jsx(PWn,{})}),Fr.jsx("span",{style:{display:"flex",alignItems:"center"},children:N})]},N)),Fr.jsx(OB,{style:Vee}),Fr.jsxs(qu,{style:{..._5,backgroundColor:B==="autorotate"?"#404040":"transparent"},onSelect:d,onMouseEnter:()=>T("autorotate"),onMouseLeave:()=>T(null),onTouchStart:()=>T("autorotate"),children:[Fr.jsx("span",{style:Oee,children:r&&Fr.jsx(NA,{})}),Fr.jsx("span",{style:{display:"flex",alignItems:"center"},children:"Auto rotate"})]}),Fr.jsxs(qu,{style:{..._5,backgroundColor:B==="cameratype"?"#404040":"transparent"},onSelect:(N)=>{N.preventDefault(),x(y==="perspective"?"orthographic":"perspective")},onMouseEnter:()=>T("cameratype"),onMouseLeave:()=>T(null),onTouchStart:()=>T("cameratype"),children:[Fr.jsx("span",{style:Oee,children:y==="orthographic"&&Fr.jsx(NA,{})}),Fr.jsx("span",{style:{display:"flex",alignItems:"center"},children:"Orthographic Camera"})]})]})})]}),Fr.jsxs(Iut,{onOpenChange:M,children:[Fr.jsxs(vut,{style:{..._5,...mL,backgroundColor:P||B==="reference-object"?"#404040":"transparent"},onMouseEnter:()=>T("reference-object"),onMouseLeave:()=>T(null),onTouchStart:()=>T("reference-object"),children:[Fr.jsx("span",{style:{flex:1,display:"flex",alignItems:"center"},children:"Show Reference Object"}),Fr.jsx("div",{style:{display:"flex",alignItems:"flex-end",gap:6,marginLeft:"auto"},children:Fr.jsx(Eut,{isOpen:P})})]}),Fr.jsx(_Ee,{children:Fr.jsx(Sut,{style:{...Xdt,marginLeft:-2},collisionPadding:10,avoidCollisions:!0,children:ZFi.map((N)=>{let D=N.type??"none";return Fr.jsxs(qu,{style:{..._5,backgroundColor:B===D?"#404040":"transparent"},onSelect:(L)=>L.preventDefault(),onPointerDown:(L)=>{L.preventDefault(),u(N.type)},onMouseEnter:()=>T(D),onMouseLeave:()=>T(null),onTouchStart:()=>T(D),children:[Fr.jsx("span",{style:Oee,children:c===N.type&&Fr.jsx(PWn,{})}),Fr.jsx("span",{style:{display:"flex",alignItems:"center"},children:N.label})]},D)})})})]}),s&&Fr.jsxs(XWi,{checked:i,onCheckedChange:s,style:{..._5,backgroundColor:B==="fold"?"#404040":"transparent"},onMouseEnter:()=>T("fold"),onMouseLeave:()=>T(null),children:[Fr.jsx("span",{style:Oee,children:i&&Fr.jsx(NA,{})}),Fr.jsx("span",{children:"Fold PCBs"})]}),Fr.jsxs(qu,{style:{..._5,backgroundColor:B==="grid"?"#404040":"transparent"},onSelect:(N)=>N.preventDefault(),onPointerDown:(N)=>{N.preventDefault(),b(!C)},onMouseEnter:()=>T("grid"),onMouseLeave:()=>T(null),onTouchStart:()=>T("grid"),children:[Fr.jsx("span",{style:Oee,children:C&&Fr.jsx(NA,{})}),Fr.jsx("span",{style:{display:"flex",alignItems:"center"},children:"Show Grid"})]}),Fr.jsx(JWi,{}),Fr.jsx(OB,{style:Vee}),Fr.jsx(qu,{style:{..._5,...mL,backgroundColor:B==="download"?"#404040":"transparent"},onSelect:g,onMouseEnter:()=>T("download"),onMouseLeave:()=>T(null),onTouchStart:()=>T("download"),children:Fr.jsx("span",{style:{display:"flex",alignItems:"center"},children:"Download GLTF"})}),Fr.jsx(OB,{style:Vee}),!a&&Fr.jsxs(qu,{style:{..._5,...mL,backgroundColor:B==="engine"?"#404040":"transparent"},onSelect:(N)=>N.preventDefault(),onPointerDown:(N)=>{N.preventDefault(),l(n==="jscad"?"manifold":"jscad")},onMouseEnter:()=>T("engine"),onMouseLeave:()=>T(null),onTouchStart:()=>T("engine"),children:[Fr.jsxs("span",{style:{flex:1,display:"flex",alignItems:"center"},children:["Switch to ",n==="jscad"?"Manifold":"JSCAD"," Engine"]}),Fr.jsx("div",{style:{...EWn,display:"flex",alignItems:"center"},children:n==="jscad"?"experimental":"default"})]}),Fr.jsx(OB,{style:Vee}),Fr.jsxs(qu,{style:{..._5,...mL,backgroundColor:B==="shortcuts"?"#404040":"transparent"},onSelect:f,onMouseEnter:()=>T("shortcuts"),onMouseLeave:()=>T(null),onTouchStart:()=>T("shortcuts"),children:[Fr.jsx("span",{style:{flex:1,display:"flex",alignItems:"center"},children:"Keyboard Shortcuts"}),Fr.jsx("div",{style:{...EWn,display:"flex",alignItems:"center"},children:"Shift+?"})]}),Fr.jsx(OB,{style:Vee}),Fr.jsx("div",{style:{display:"flex",alignItems:"center",marginTop:0,paddingLeft:32,paddingTop:4,paddingBottom:4},children:Fr.jsxs("span",{style:{fontSize:11,opacity:0.35,fontWeight:400,color:"#a1a1aa",letterSpacing:"0.2px"},children:["@tscircuit/3d-viewer@",V$n.version]})})]})})]})})},dte=new Map,Mut=new Set,MWn=!1,wut=0,But=0,REe=null,wWn=!1,tXi=20,nXi=(e)=>{let t=e.toLowerCase().split("+"),n=t[t.length-1],o=t.slice(0,-1);return{key:n,ctrl:o.includes("ctrl"),cmd:o.includes("cmd"),shift:o.includes("shift"),alt:o.includes("alt")}},oXi=(e,t)=>{let n=nXi(t),o=e.key.toLowerCase()===n.key,r=n.ctrl===e.ctrlKey,i=n.cmd===e.metaKey,s=n.shift===e.shiftKey,a=n.alt===e.altKey;return o&&r&&i&&s&&a},rXi=(e)=>{if(!e||typeof e!=="object")return!1;let t=e,n=t.tagName,o=["INPUT","TEXTAREA","SELECT"];if(o.includes(n))return!0;let r=t.getAttribute?.("contenteditable");if(r==="true"||r==="")return!0;let i=t.parentElement;for(let s=0;s<tXi&&i;s++){let a=i.tagName;if(o.includes(a))return!0;let c=i.getAttribute?.("contenteditable");if(c==="true"||c==="")return!0;i=i.parentElement}return!1},iXi=()=>{if(typeof document>"u")return!1;let e=document.activeElement;if(!e)return!1;let t=e.tagName;if(t==="INPUT"||t==="TEXTAREA"||t==="SELECT")return!0;let n=e.getAttribute("contenteditable");return n==="true"||n===""},sXi=()=>{if(!REe)return!0;let e=REe.getBoundingClientRect();return wut>=e.left&&wut<=e.right&&But>=e.top&&But<=e.bottom},aXi=()=>{if(wWn||typeof window>"u")return;window.addEventListener("mousemove",(e)=>{wut=e.clientX,But=e.clientY}),wWn=!0},cXi=(e)=>{if(rXi(e.target)||iXi())return;if(REe&&!sXi())return;dte.forEach((t)=>{if(oXi(e,t.shortcut))e.preventDefault(),t.invoke()})},DZn=()=>{let e=Array.from(dte.values());Mut.forEach((t)=>t(e))},lXi=()=>{if(MWn)return;if(typeof window>"u")return;window.addEventListener("keydown",cXi),MWn=!0},hXi=(e)=>{dte.set(e.id,e),DZn(),lXi()},dXi=(e)=>{if(dte.delete(e))DZn()},uXi=(e)=>(Mut.add(e),e(Array.from(dte.values())),()=>{Mut.delete(e)}),tEe=(e,t,n)=>{let o=ZB.useRef(t);o.current=t;let r=ZB.useMemo(()=>({shortcut:n.shortcut,description:n.description}),[n.shortcut,n.description]);ZB.useEffect(()=>{let i={id:e,...r,invoke:()=>o.current()};return hXi(i),()=>{dXi(e)}},[e,r])},pXi=()=>{let[e,t]=ZB.useState(()=>Array.from(dte.values()));return ZB.useEffect(()=>uXi(t),[]),e},mXi=(e)=>{REe=e,aXi()},_Xi=({open:e,onClose:t})=>{let[n,o]=$B.useState(""),r=$B.useRef(null),i=pXi();$B.useEffect(()=>{if(!e)return;let a=(c)=>{if(c.key==="Escape")c.preventDefault(),t()};return window.addEventListener("keydown",a),()=>window.removeEventListener("keydown",a)},[e,t]),$B.useEffect(()=>{if(e)setTimeout(()=>{r.current?.focus()},0)},[e]);let s=$B.useMemo(()=>{let a=n.trim().toLowerCase();if(!a)return i;return i.filter((c)=>`${c.shortcut} ${c.description}`.toLowerCase().includes(a))},[i,n]);if(!e)return null;return Rp.jsx("div",{role:"dialog","aria-modal":"true",style:{position:"fixed",inset:0,backgroundColor:"rgba(0, 0, 0, 0.5)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:9999},onClick:t,children:Rp.jsxs("div",{style:{backgroundColor:"#1f1f23",color:"#f8f8ff",borderRadius:12,width:"min(640px, 90vw)",maxHeight:"80vh",boxShadow:"0 20px 60px rgba(0, 0, 0, 0.45), 0 8px 20px rgba(0, 0, 0, 0.35)",display:"flex",flexDirection:"column",overflow:"hidden"},onClick:(a)=>a.stopPropagation(),children:[Rp.jsxs("header",{style:{padding:"20px 24px 12px",borderBottom:"1px solid rgba(255, 255, 255, 0.08)"},children:[Rp.jsxs("div",{style:{display:"flex",justifyContent:"space-between"},children:[Rp.jsx("h2",{style:{margin:0,fontSize:"1.1rem",fontWeight:600,letterSpacing:"0.02em"},children:"Keyboard Shortcuts"}),Rp.jsx("button",{type:"button",onClick:t,style:{background:"transparent",border:"none",color:"rgba(255, 255, 255, 0.8)",fontSize:"1rem",cursor:"pointer"},children:"✕"})]}),Rp.jsx("input",{ref:r,type:"text",placeholder:"Search shortcuts...",value:n,onChange:(a)=>o(a.target.value),style:{marginTop:12,width:"calc(100% - 24px)",padding:"10px 12px",borderRadius:8,border:"1px solid rgba(255, 255, 255, 0.1)",backgroundColor:"rgba(255, 255, 255, 0.05)",color:"white",fontSize:"0.95rem"}})]}),Rp.jsx("div",{style:{overflowY:"auto"},children:Rp.jsxs("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:"0.95rem"},children:[Rp.jsx("thead",{children:Rp.jsxs("tr",{style:{textAlign:"left",color:"#a1a1b5"},children:[Rp.jsx("th",{style:{padding:"12px 24px",width:"25%"},children:"Key"}),Rp.jsx("th",{style:{padding:"12px 24px"},children:"Description"})]})}),Rp.jsx("tbody",{children:s.length===0?Rp.jsx("tr",{children:Rp.jsx("td",{colSpan:2,style:{padding:"24px",textAlign:"center"},children:"No shortcuts found"})}):s.map((a)=>Rp.jsxs("tr",{style:{borderTop:"1px solid rgba(255, 255, 255, 0.05)"},children:[Rp.jsx("td",{style:{padding:"12px 24px"},children:Rp.jsx("span",{style:{display:"inline-flex",alignItems:"center",justifyContent:"center",border:"1px solid rgba(255, 255, 255, 0.3)",borderRadius:6,minWidth:36,padding:"4px 8px",fontFamily:"monospace",fontSize:"0.95rem",textTransform:"capitalize"},children:a.shortcut})}),Rp.jsx("td",{style:{padding:"12px 24px"},children:a.description})]},a.id))})]})})]})})},gXi=()=>({showToast:(e,t=2000)=>{f_(e,{duration:t})}}),AXi=({children:e})=>ute.jsxs(ute.Fragment,{children:[e,ute.jsx(vUn,{position:"bottom-right"})]});function fXi({setAutoRotate:e,setAutoRotateUserToggled:t,setCameraPreset:n,closeMenu:o,cameraControllerRef:r,isAnimatingRef:i,lastPresetSelectTime:s}){return{handleCameraPresetSelect:NZn.useCallback((c)=>{if(e(!1),t(!0),n(c),o(),s.current=Date.now(),c==="Custom")return;i.current=!0,r.current?.animateToPreset(c),setTimeout(()=>{i.current=!1},600)},[e,t,n,o,r,i,s])}}var yXi=({containerRef:e,onOpen:t})=>{let[n,o]=J2.useState(!1),[r,i]=J2.useState({x:0,y:0}),s=J2.useRef(null),a=J2.useRef(null),c=J2.useRef(null),l=J2.useRef(!1),h=()=>{if(c.current!==null)clearTimeout(c.current),c.current=null},d=J2.useCallback((g)=>{g.preventDefault();let f=typeof g.clientX==="number"?g.clientX:0,y=typeof g.clientY==="number"?g.clientY:0;if(l.current){l.current=!1;return}if(!a.current)return;let{x,y:C}=a.current,b=Math.abs(f-x),I=Math.abs(y-C),v=10;if(b>v||I>v){a.current=null;return}t?.({x:f,y}),i({x:f,y}),o(!0),a.current=null},[i,o,t]),u=J2.useCallback((g)=>{if(g.touches.length===1){let f=g.touches[0];if(f)a.current={x:f.clientX,y:f.clientY},h(),c.current=window.setTimeout(()=>{if(!a.current)return;if(e.current){t?.(a.current);let y=e.current.getBoundingClientRect();i({x:y.left+y.width/2,y:y.top+y.height/2}),o(!0),l.current=!0}a.current=null},600);else a.current=null}else a.current=null,h()},[e,t]),_=J2.useCallback((g)=>{if(!a.current||g.touches.length!==1)return;let f=g.touches[0];if(f){let y=Math.abs(f.clientX-a.current.x),x=Math.abs(f.clientY-a.current.y),C=10;if(y>10||x>10)a.current=null,h()}else a.current=null,h()},[]),p=J2.useCallback(()=>{h(),setTimeout(()=>{if(a.current)a.current=null},0)},[]),m=J2.useCallback((g)=>{let f=g.target;if(s.current&&s.current.contains(f))return;if(f.closest?.("[data-radix-popper-content-wrapper], [data-radix-dropdown-menu-content], [data-radix-dropdown-menu-sub-content]"))return;o(!1)},[]);return J2.useEffect(()=>{if(n)return document.addEventListener("mousedown",m),document.addEventListener("touchstart",m),()=>{document.removeEventListener("mousedown",m),document.removeEventListener("touchstart",m)}},[n,m]),{menuVisible:n,menuPos:r,menuRef:s,contextMenuEventHandlers:{onMouseDown:(g)=>{if(g.button===2)a.current={x:g.clientX,y:g.clientY};else a.current=null},onContextMenu:d,onTouchStart:u,onTouchMove:_,onTouchEnd:p},setMenuVisible:o}},xXi=()=>RZn.useCallback(()=>{let e=window.__TSCIRCUIT_THREE_OBJECT;if(!e)return;new Mee().parse(e,(n)=>{let o=new Blob([n instanceof ArrayBuffer?n:JSON.stringify(n)],{type:"model/gltf+json"}),r=URL.createObjectURL(o),i=document.createElement("a");i.href=r,i.download="scene.gltf",i.click(),URL.revokeObjectURL(r)},(n)=>{console.error("Failed to export GLTF",n)})},[]),CXi=new Dt(0,0,0),bXi=[5,-5,5],IXi=()=>{if(typeof window>"u")return;let e=window.localStorage.getItem("cadViewerCameraType");return e==="orthographic"||e==="perspective"?e:void 0},vXi=(e)=>{let t=g0t(e.circuitJson?void 0:e.children),n=e.circuitJson??t,o=n.some((Re)=>Re.type==="pcb_bend"),r=o||n.some((Re)=>Re.type==="pcb_stiffener"),[i,s]=nh.useState(void 0),a=i??e.foldPcbs,c=x$n(n,a),l=JSON.stringify(n),{hiddenCadComponentIds:h,hideComponent:d,unhideAllComponents:u}=FHi(l),_={...e,circuitJson:n,children:void 0,hiddenCadComponentIds:h},[p,m]=nh.useState(()=>{let Re=window.localStorage.getItem("cadViewerEngine");return Re==="jscad"||Re==="manifold"?Re:"manifold"}),A=nh.useRef(null),[g,f]=nh.useState(!1),[y,x]=nh.useState(()=>window.localStorage.getItem("cadViewerAutoRotate")!=="false"),[C,b]=nh.useState(()=>window.localStorage.getItem("cadViewerAutoRotateUserToggled")==="true"),[I,v]=nh.useState("Custom"),[P,M]=nh.useState(null),{cameraType:B}=qB(),{visibility:T,setLayerVisibility:N}=NG(),{showToast:D}=gXi(),L=nh.useRef(null),H=e.onCameraControllerReady,V=nh.useContext(_0t),[O,U]=nh.useState(),[j,Y]=nh.useState(),X=nh.useCallback((Re)=>{Y(HHi(V.current,Re,n)),U(e.onViewSchematicComponent?LHi(V.current,Re,n):void 0)},[V,n,e.onViewSchematicComponent]),{menuVisible:K,menuPos:J,menuRef:ee,contextMenuEventHandlers:se,setMenuVisible:ne}=yXi({containerRef:A,onOpen:X}),re=nh.useRef(C);re.current=C;let Z=nh.useRef(!1),te=nh.useRef(0),ie=1000,ce=nh.useCallback(()=>{if(Z.current||Date.now()-te.current<ie)return;if(!re.current)x(!1);if(!K)v("Custom")},[K]),ue=nh.useCallback(()=>{x((Re)=>!Re),b(!0)},[]),de=xXi(),me=nh.useCallback(()=>{ne(!1)},[ne]),ge=nh.useCallback((Re)=>{if(L.current=Re,H?.(Re),Re&&I!=="Custom")Re.animateToPreset(I)},[I,H]),{handleCameraPresetSelect:xe}=fXi({setAutoRotate:x,setAutoRotateUserToggled:b,setCameraPreset:v,closeMenu:me,cameraControllerRef:L,isAnimatingRef:Z,lastPresetSelectTime:te});tEe("open_keyboard_shortcuts_dialog",()=>{f(!0)},{shortcut:"shift+?",description:"Open keyboard shortcuts"}),tEe("toggle_smt_models",()=>{let Re=!T.smtModels;N("smtModels",Re),D(Re?"SMT components visible":"SMT components hidden",1500)},{shortcut:"shift+s",description:"Toggle surface mount components"}),tEe("toggle_through_hole_models",()=>{let Re=!T.throughHoleModels;N("throughHoleModels",Re),D(Re?"Through-hole components visible":"Through-hole components hidden",1500)},{shortcut:"shift+t",description:"Toggle through-hole components"}),tEe("toggle_translucent_models",()=>{let Re=!T.translucentModels;N("translucentModels",Re),D(Re?"Translucent components visible":"Translucent components hidden",1500)},{shortcut:"shift+v",description:"Toggle translucent components"}),nh.useEffect(()=>{if(A.current)mXi(A.current)},[]),nh.useEffect(()=>{window.localStorage.setItem("cadViewerEngine",p)},[p]),nh.useEffect(()=>{window.localStorage.setItem("cadViewerAutoRotate",String(y))},[y]),nh.useEffect(()=>{window.localStorage.setItem("cadViewerAutoRotateUserToggled",String(C))},[C]),nh.useEffect(()=>{window.localStorage.setItem("cadViewerCameraType",B)},[B]);let Ee=e.circuitJson?l:void 0;return f5.jsxs("div",{ref:A,style:{width:"100%",height:"100%",position:"relative",userSelect:"none",MozUserSelect:"none",msUserSelect:"none",WebkitUserSelect:"none",WebkitTouchCallout:"none"},...se,children:[r?f5.jsx(qUn,{..._,foldPcbs:a,autoRotateDisabled:e.autoRotateDisabled||!y,onUserInteraction:ce,onCameraControllerReady:ge,referenceObject:P}):p==="jscad"?f5.jsx(dVi,{..._,autoRotateDisabled:e.autoRotateDisabled||!y,cameraType:B,onUserInteraction:ce,onCameraControllerReady:ge,referenceObject:P}):f5.jsx(qUn,{..._,autoRotateDisabled:e.autoRotateDisabled||!y,cameraType:B,onUserInteraction:ce,onCameraControllerReady:ge,referenceObject:P}),K&&f5.jsx(eXi,{componentName:j?.componentName,onHideComponent:j?()=>{d(j.cad_component_id),me()}:void 0,onUnhideAllComponents:h.size>0?()=>{u(),me()}:void 0,onViewSchematicComponent:O&&e.onViewSchematicComponent?()=>{e.onViewSchematicComponent?.(O),me()}:void 0,menuRef:ee,menuPos:J,engine:p,flexScene:r,foldPcbs:c,onFoldPcbsToggle:o?()=>{s(!c),v("Custom"),me()}:void 0,cameraPreset:I,autoRotate:y,referenceObject:P,onEngineSwitch:(Re)=>{m(Re),me()},onCameraPresetSelect:xe,onAutoRotateToggle:()=>{ue(),me()},onReferenceObjectSelect:(Re)=>{M((Me)=>ezi(Me,Re)),x(!1),b(!0),v("Custom"),me()},onDownloadGltf:()=>{de(),me()},onOpenKeyboardShortcuts:()=>{f(!0),me()}}),f5.jsx(_Xi,{open:g,onClose:()=>f(!1)})]},Ee)},j0t=(e)=>{zHi();let t=nh.useRef(null);return f5.jsx(_0t.Provider,{value:t,children:f5.jsx(QFi,{defaultTarget:CXi,initialCameraPosition:bXi,initialCameraType:IXi(),children:f5.jsx(YHi,{children:f5.jsx(DFi,{children:f5.jsx(AXi,{children:f5.jsx(vXi,{...e})})})})})})},SXi=Ll(RHi(),1);var KCa=Ll(KEe(),1),$Ca=Ll(A$n(),1),qCa=Ll(KEe(),1);var ZCa=(0,SXi.default)("tscircuit:3d-viewer:convert-circuit-json-to-3d-svg");var dwe=Qe(rn(),1);Y0();Ie();Y0();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();var gte={};jW(gte,{all_layers:()=>weo,any_circuit_element:()=>oro,any_soup_element:()=>_te,any_source_component:()=>xeo,asset:()=>EMe,base_circuit_json_error:()=>yc,battery_capacity:()=>GZn,brep_shape:()=>Tpt,cadModelDefaultDirectionMap:()=>hji,cad_cable:()=>Too,cad_collision_error:()=>Boo,cad_component:()=>woo,cad_model_axis_directions:()=>Moo,cad_model_formats:()=>lji,capacitance:()=>tpt,circle_shape:()=>npt,circuit_json_footprint_load_error:()=>Zno,current:()=>EL,distance:()=>Sn,duration_ms:()=>mte,experiment_type:()=>Hoo,external_footprint_load_error:()=>Jno,frequency:()=>HG,getRotationBetweenPcbPin1Locations:()=>kXi,getZodPrefixedIdWithDefault:()=>Mn,inductance:()=>VZn,insertionDirectionToCanonical:()=>bto,insertionDirectionToVector:()=>RXi,insertion_direction:()=>Ito,kicadAt:()=>MMe,kicadEffects:()=>UZn,kicadFont:()=>rpt,kicadFootprintAttributes:()=>XZn,kicadFootprintMetadata:()=>$Zn,kicadFootprintModel:()=>KZn,kicadFootprintPad:()=>jZn,kicadFootprintProperties:()=>WZn,kicadProperty:()=>Gpe,kicadSymbolEffects:()=>ZZn,kicadSymbolMetadata:()=>teo,kicadSymbolPinNames:()=>JZn,kicadSymbolPinNumbers:()=>qZn,kicadSymbolProperties:()=>eeo,kicadSymbolProperty:()=>PL,layer_ref:()=>Js,layer_string:()=>q0t,length:()=>Wo,manufacturing_drc_properties:()=>Pto,ms:()=>Pg,ninePointAnchor:()=>eT,parseAndConvertSiUnit:()=>Aa,pcbRenderLayer:()=>TXi,pcb_autorouting_error:()=>too,pcb_bend:()=>dno,pcb_board:()=>hno,pcb_breakout_point:()=>coo,pcb_bus_length_skew_error:()=>Zto,pcb_bus_routing_constraint_error:()=>nno,pcb_bus_routing_constraint_warning:()=>ono,pcb_component:()=>Eto,pcb_component_invalid_layer_error:()=>foo,pcb_component_missing_courtyard_warning:()=>ioo,pcb_component_not_on_board_edge_error:()=>Aoo,pcb_component_outside_board_error:()=>goo,pcb_connector_not_in_accessible_orientation_warning:()=>roo,pcb_copper_pour:()=>_oo,pcb_copper_pour_brep:()=>poo,pcb_copper_pour_polygon:()=>moo,pcb_copper_pour_rect:()=>uoo,pcb_copper_text:()=>Sno,pcb_courtyard_circle:()=>Poo,pcb_courtyard_outline:()=>voo,pcb_courtyard_overlap_error:()=>Vno,pcb_courtyard_pill:()=>Eoo,pcb_courtyard_polygon:()=>Soo,pcb_courtyard_rect:()=>Ioo,pcb_cutout:()=>$no,pcb_cutout_circle:()=>Xno,pcb_cutout_path:()=>Kno,pcb_cutout_polygon:()=>jno,pcb_cutout_rect:()=>Wno,pcb_debug_line:()=>wto,pcb_debug_object:()=>Tto,pcb_debug_object_base:()=>TMe,pcb_debug_point:()=>Bto,pcb_debug_rect:()=>Mto,pcb_fabrication_note_dimension:()=>Qno,pcb_fabrication_note_path:()=>Nno,pcb_fabrication_note_rect:()=>Rno,pcb_fabrication_note_text:()=>Dno,pcb_fabricator_extra_charge_warning:()=>aoo,pcb_footprint_overlap_error:()=>Ono,pcb_ground_plane:()=>loo,pcb_ground_plane_region:()=>hoo,pcb_group:()=>eoo,pcb_hole:()=>Hto,pcb_hole_circle_or_square_shape:()=>zXi,pcb_hole_circle_shape:()=>HXi,pcb_hole_oval_shape:()=>OXi,pcb_hole_pill_shape:()=>VXi,pcb_hole_rect_shape:()=>FXi,pcb_hole_rotated_pill_shape:()=>YXi,pcb_keepout:()=>Gno,pcb_keepout_outline:()=>Yno,pcb_keepout_overlap_warning:()=>Uno,pcb_manual_edit_conflict_warning:()=>ooo,pcb_missing_footprint_error:()=>qno,pcb_net:()=>cno,pcb_note_dimension:()=>zno,pcb_note_line:()=>Fno,pcb_note_path:()=>Hno,pcb_note_rect:()=>Lno,pcb_note_text:()=>kno,pcb_packing_error:()=>yno,pcb_pad_pad_clearance_error:()=>Coo,pcb_pad_trace_clearance_error:()=>boo,pcb_panel:()=>Ano,pcb_panelization_placement_error:()=>xno,pcb_pin1_location:()=>Z0t,pcb_placement_error:()=>fno,pcb_plated_hole:()=>Fto,pcb_port:()=>zto,pcb_port_not_connected_error:()=>ano,pcb_port_not_matched_error:()=>sno,pcb_preflight_routing_error:()=>noo,pcb_route_hint:()=>vto,pcb_route_hints:()=>LXi,pcb_silkscreen_circle:()=>Eno,pcb_silkscreen_graphic:()=>Bno,pcb_silkscreen_graphic_brep:()=>wno,pcb_silkscreen_line:()=>bno,pcb_silkscreen_oval:()=>Mno,pcb_silkscreen_path:()=>Ino,pcb_silkscreen_pill:()=>Tno,pcb_silkscreen_rect:()=>Pno,pcb_silkscreen_text:()=>vno,pcb_smtpad:()=>Vto,pcb_smtpad_pill:()=>Oto,pcb_solder_paste:()=>Yto,pcb_soldermask_opening:()=>Gto,pcb_stiffener:()=>gno,pcb_stiffener_polygon:()=>_no,pcb_stiffener_rect:()=>mno,pcb_text:()=>Uto,pcb_thermal_spoke:()=>doo,pcb_trace:()=>$to,pcb_trace_error:()=>rno,pcb_trace_hint:()=>Cno,pcb_trace_missing_error:()=>ino,pcb_trace_route_point:()=>Kto,pcb_trace_route_point_through_pad:()=>jto,pcb_trace_route_point_via:()=>Xto,pcb_trace_route_point_wire:()=>Wto,pcb_trace_too_long_error:()=>Jto,pcb_trace_too_long_warning:()=>eno,pcb_trace_too_many_vias_warning:()=>tno,pcb_trace_warning:()=>qto,pcb_via:()=>lno,pcb_via_clearance_error:()=>yoo,pcb_via_trace_clearance_error:()=>xoo,point:()=>lr,point3:()=>DP,point_with_bulge:()=>Cto,polygon_shape:()=>Upe,port_arrangement:()=>Weo,position:()=>EXi,position3:()=>MXi,rect_shape:()=>PMe,resistance:()=>vMe,ring:()=>J0t,rotated_rect_shape:()=>opt,rotation:()=>Oh,route_hint_point:()=>Sto,schematic_arc:()=>Jeo,schematic_box:()=>Oeo,schematic_circle:()=>qeo,schematic_component:()=>Xeo,schematic_component_overlap_warning:()=>dto,schematic_component_port_arrangement_by_sides:()=>Ueo,schematic_component_port_arrangement_by_size:()=>Geo,schematic_component_styling_warning:()=>uto,schematic_debug_line:()=>sto,schematic_debug_object:()=>cto,schematic_debug_object_base:()=>BMe,schematic_debug_point:()=>ato,schematic_debug_rect:()=>ito,schematic_element_outside_sheet_warning:()=>pto,schematic_error:()=>oto,schematic_graphic:()=>mto,schematic_group:()=>_to,schematic_layout_error:()=>rto,schematic_line:()=>Keo,schematic_manual_edit_conflict_warning:()=>hto,schematic_missing_sheet_warning:()=>xto,schematic_net_label:()=>nto,schematic_path:()=>Veo,schematic_pin_styles:()=>Yeo,schematic_port:()=>tto,schematic_rect:()=>$eo,schematic_sheet:()=>yto,schematic_sheet_size:()=>fto,schematic_symbol:()=>jeo,schematic_table:()=>gto,schematic_table_cell:()=>Ato,schematic_text:()=>eto,schematic_text_part:()=>Bpt,schematic_trace:()=>Zeo,schematic_voltage_probe:()=>lto,simulation_ac_current_source:()=>koo,simulation_ac_sweep_current_graph:()=>Zoo,simulation_ac_sweep_voltage_graph:()=>Joo,simulation_ac_voltage_source:()=>Noo,simulation_complex_sample:()=>Qpt,simulation_current_probe:()=>Uoo,simulation_current_source:()=>Loo,simulation_dc_current_source:()=>Qoo,simulation_dc_operating_point_current:()=>Koo,simulation_dc_operating_point_voltage:()=>joo,simulation_dc_sweep_current_graph:()=>qoo,simulation_dc_sweep_unit:()=>NMe,simulation_dc_sweep_voltage_graph:()=>$oo,simulation_dc_voltage_source:()=>Doo,simulation_experiment:()=>zoo,simulation_op_amp:()=>ero,simulation_oscilloscope_trace:()=>nro,simulation_parameter_sweep:()=>Xoo,simulation_parameter_sweep_coordinate:()=>tT,simulation_parameter_type:()=>pji,simulation_parameter_unit:()=>Rpt,simulation_spice_subcircuit:()=>tro,simulation_switch:()=>Yoo,simulation_transient_current_graph:()=>Voo,simulation_transient_voltage_graph:()=>Ooo,simulation_unknown_experiment_error:()=>Woo,simulation_voltage_probe:()=>Goo,simulation_voltage_source:()=>Roo,size:()=>SMe,source_ambiguous_port_reference:()=>Eeo,source_board:()=>Peo,source_bus:()=>Feo,source_component_base:()=>oh,source_component_internal_connection:()=>beo,source_component_misconfigured_error:()=>wpt,source_component_pins_underspecified_warning:()=>Reo,source_confusing_net_name_warning:()=>Heo,source_failed_to_create_component_error:()=>_eo,source_group:()=>veo,source_i2c_misconfigured_error:()=>Mpt,source_interconnect:()=>feo,source_invalid_component_property_error:()=>Ipt,source_manually_placed_via:()=>Beo,source_missing_manufacturer_part_number_warning:()=>Ppt,source_missing_property_error:()=>meo,source_motor:()=>seo,source_net:()=>Seo,source_no_ground_pin_defined_warning:()=>Neo,source_no_power_pin_defined_warning:()=>Deo,source_part_not_found_warning:()=>Leo,source_pcb_ground_plane:()=>Meo,source_pin_attributes:()=>heo,source_pin_missing_trace_warning:()=>Spt,source_pin_must_be_connected_error:()=>Qeo,source_port:()=>Ceo,source_printed_part:()=>reo,source_project_metadata:()=>bpt,source_property_ignored_warning:()=>geo,source_refdes_convention_warning:()=>Ept,source_runtime_error:()=>zeo,source_simple_ammeter:()=>leo,source_simple_battery:()=>hpt,source_simple_capacitor:()=>ipt,source_simple_chip:()=>cpt,source_simple_connector:()=>peo,source_simple_connector_standards:()=>ueo,source_simple_crystal:()=>deo,source_simple_current_source:()=>aeo,source_simple_diode:()=>wMe,source_simple_fiducial:()=>neo,source_simple_fuse:()=>ceo,source_simple_ground:()=>oeo,source_simple_inductor:()=>dpt,source_simple_led:()=>apt,source_simple_mosfet:()=>ypt,source_simple_op_amp:()=>xpt,source_simple_pin_header:()=>mpt,source_simple_pinout:()=>_pt,source_simple_potentiometer:()=>ppt,source_simple_power_source:()=>lpt,source_simple_push_button:()=>upt,source_simple_resistor:()=>spt,source_simple_resonator:()=>gpt,source_simple_switch:()=>Cpt,source_simple_test_point:()=>fpt,source_simple_transistor:()=>Apt,source_simple_voltage_probe:()=>Aeo,source_simple_voltage_source:()=>yeo,source_subassembly:()=>ieo,source_trace:()=>Ieo,source_trace_not_connected_error:()=>vpt,source_unnamed_trace_warning:()=>Teo,spice_simulation_options:()=>Foo,standard_shape:()=>wXi,supplier_footprint_mismatch_warning:()=>soo,supplier_name:()=>Wpe,time:()=>PXi,timestamp:()=>YZn,unknown_error_finding_part:()=>keo,visible_layer:()=>v_,voltage:()=>Jb,wave_shape:()=>Npt});Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();var vMe=k().or(Ae()).transform((e)=>Aa(e,"Ω").value),tpt=k().or(Ae()).transform((e)=>Aa(e,"F").value).transform((e)=>Number.parseFloat(e.toPrecision(12))),VZn=k().or(Ae()).transform((e)=>Aa(e,"H").value),Jb=k().or(Ae()).transform((e)=>Aa(e,"V").value),Wo=k().or(Ae()).transform((e)=>Aa(e).value),HG=k().or(Ae()).transform((e)=>Aa(e,"Hz").value),Sn=Wo,EL=k().or(Ae()).transform((e)=>Aa(e,"A").value),mte=k().or(Ae()).transform((e)=>Aa(e).value),PXi=mte,Pg=mte,YZn=k().datetime(),Oh=k().or(Ae()).transform((e)=>{if(typeof e==="number")return e;if(e.endsWith("deg"))return Number.parseFloat(e.split("deg")[0]);if(e.endsWith("rad"))return Number.parseFloat(e.split("rad")[0])*180/Math.PI;return Number.parseFloat(e)}),GZn=Ae().or(k().endsWith("mAh")).transform((e)=>{if(typeof e==="string"){let t=e.replace("mAh",""),n=Number.parseFloat(t);if(Number.isNaN(n))throw Error("Invalid capacity");return n}return e}).describe("Battery capacity in mAh"),Ft=(e)=>{};Ft("extra props b");Ft("missing props b");Ft(!0);Ft("mismatched prop types: a");var FG=(e)=>{};FG(!0);FG('T1 has extra: "c", T2 has extra: "d"');FG('T1 has extra: "c"');FG('T2 has extra: "c"');FG('T1 has extra: "d", T2 has extra: "c"');FG(!0);var lr=we({x:Sn,y:Sn}),EXi=lr;Ft(!0);Ft(!0);var DP=we({x:Sn,y:Sn,z:Sn}),MXi=DP;Ft(!0);var SMe=we({width:Ae(),height:Ae()});Ft(!0);var pte=Sn.pipe(Ae().finite()),$0t=Sn.pipe(Ae().finite().positive()),npt=we({shape:he("circle"),x:pte,y:pte,radius:$0t}).strict(),PMe=we({shape:he("rect"),x:pte,y:pte,width:$0t,height:$0t}).strict(),opt=PMe.extend({shape:he("rotated_rect"),ccw_rotation:Oh.pipe(Ae().finite())}),Upe=we({shape:he("polygon"),points:it(lr.extend({x:pte,y:pte})).min(3).refine((e)=>{let t=e.reduce((n,o,r)=>{let i=e[(r+1)%e.length];return n+o.x*i.y-i.x*o.y},0);return Number.isFinite(t)&&t!==0},"Polygon boundary must enclose a nonzero area")}).strict();Ft(!0);Ft(!0);Ft(!0);Ft(!0);var wXi=ss("shape",[npt,PMe,opt,Upe]);Ft(!0);var BXi=(e)=>Array.from({length:e},()=>"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"[Math.floor(Math.random()*62)]).join(""),Mn=(e)=>k().optional().default(()=>`${e}_${BXi(10)}`),eT=Pt(["top_left","top_center","top_right","center_left","center","center_right","bottom_left","bottom_center","bottom_right"]);Ft(!0);var TXi=Pt(["top_silkscreen","bottom_silkscreen","top_copper","bottom_copper","top_soldermask","bottom_soldermask","top_fabrication_note","bottom_fabrication_note","top_user_note","bottom_user_note","top_courtyard","bottom_courtyard","inner1_copper","inner2_copper","inner3_copper","inner4_copper","inner5_copper","inner6_copper","inner7_copper","inner8_copper","edge_cuts","drill"]);Ft(!0);var EMe=we({project_relative_path:k(),url:k(),mimetype:k()});Ft(!0);var MMe=lr.extend({rotation:Oh.optional()});Ft(!0);var rpt=we({size:lr.optional(),thickness:Sn.optional()});Ft(!0);var UZn=we({font:rpt.optional()});Ft(!0);var Gpe=we({value:k(),at:MMe.optional(),layer:k().optional(),uuid:k().optional(),hide:Be().optional(),effects:UZn.optional()});Ft(!0);var WZn=we({Reference:Gpe.optional(),Value:Gpe.optional(),Datasheet:Gpe.optional(),Description:Gpe.optional()});Ft(!0);var XZn=we({through_hole:Be().optional(),smd:Be().optional(),exclude_from_pos_files:Be().optional(),exclude_from_bom:Be().optional()});Ft(!0);var jZn=we({name:k(),type:k(),shape:k().optional(),at:MMe.optional(),size:lr.optional(),drill:Sn.optional(),layers:it(k()).optional(),removeUnusedLayers:Be().optional(),uuid:k().optional()});Ft(!0);var KZn=we({path:k(),offset:DP.optional(),scale:DP.optional(),rotate:DP.optional()});Ft(!0);var $Zn=we({footprintName:k().optional(),version:un([Ae(),k()]).optional(),generator:k().optional(),generatorVersion:un([Ae(),k()]).optional(),layer:k().optional(),properties:WZn.optional(),attributes:XZn.optional(),pads:it(jZn).optional(),embeddedFonts:Be().optional(),model:KZn.optional()});Ft(!0);var qZn=we({hide:Be().optional()});Ft(!0);var JZn=we({offset:Sn.optional(),hide:Be().optional()});Ft(!0);var ZZn=we({font:rpt.optional(),justify:un([k(),it(k())]).optional(),hide:Be().optional()});Ft(!0);var PL=we({value:k(),id:un([Ae(),k()]).optional(),at:MMe.optional(),effects:ZZn.optional()});Ft(!0);var eeo=we({Reference:PL.optional(),Value:PL.optional(),Footprint:PL.optional(),Datasheet:PL.optional(),Description:PL.optional(),ki_keywords:PL.optional(),ki_fp_filters:PL.optional()});Ft(!0);var teo=we({symbolName:k().optional(),extends:k().optional(),pinNumbers:qZn.optional(),pinNames:JZn.optional(),excludeFromSim:Be().optional(),inBom:Be().optional(),onBoard:Be().optional(),properties:eeo.optional(),embeddedFonts:Be().optional()});Ft(!0);var yc=we({error_type:k(),message:k(),is_fatal:Be().optional()});Ft(!0);var Wpe=Pt(["jlcpcb","macrofab","pcbway","digikey","mouser","lcsc"]);Ft(!0);var oh=we({type:he("source_component"),ftype:k().optional(),source_component_id:k(),name:k(),manufacturer_part_number:k().optional(),supplier_part_numbers:gs(Wpe,it(k())).optional(),display_value:k().optional(),display_name:k().optional(),are_pins_interchangeable:Be().optional(),internally_connected_source_port_ids:it(it(k())).optional(),source_group_id:k().optional(),subcircuit_id:k().optional()});Ft(!0);var ipt=oh.extend({ftype:he("simple_capacitor"),capacitance:tpt,max_voltage_rating:Jb.optional(),display_capacitance:k().optional(),max_decoupling_trace_length:Sn.optional()});Ft(!0);var spt=oh.extend({ftype:he("simple_resistor"),resistance:vMe,display_resistance:k().optional()});Ft(!0);var wMe=oh.extend({ftype:he("simple_diode")});Ft(!0);var neo=oh.extend({ftype:he("simple_fiducial")});Ft(!0);var apt=wMe.extend({ftype:he("simple_led"),color:k().optional(),wavelength:k().optional()});Ft(!0);var oeo=oh.extend({ftype:he("simple_ground")});Ft(!0);var cpt=oh.extend({ftype:he("simple_chip")});Ft(!0);var reo=oh.extend({ftype:he("printedpart")});Ft(!0);var ieo=oh.extend({ftype:he("subassembly")});Ft(!0);var seo=oh.extend({ftype:he("motor")});Ft(!0);var lpt=oh.extend({ftype:he("simple_power_source"),voltage:Jb});Ft(!0);var aeo=oh.extend({ftype:he("simple_current_source"),current:EL,frequency:HG.optional(),peak_to_peak_current:EL.optional(),wave_shape:Pt(["sine","square","triangle","sawtooth","dc"]).optional().default("dc"),phase:Ae().optional(),duty_cycle:Ae().min(0).max(1).optional()});Ft(!0);var ceo=oh.extend({ftype:he("simple_fuse"),current_rating_amps:Ae().describe("Nominal current in amps the fuse is rated for"),voltage_rating_volts:Ae().describe("Voltage rating in volts, e.g. ±5V would be 5")});Ft(!0);var leo=oh.extend({ftype:he("simple_ammeter")});Ft(!0);var QZn=un([Ae(),k().trim().regex(/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?\s*(?:[fpnumkKMGTµμ]?V?|V)?$/,"Expected a scalar voltage, optionally with SI units")]).pipe(Jb).pipe(Ae().finite()),heo=we({is_input:Be().optional(),is_output:Be().optional(),is_bidirectional:Be().optional(),is_passive:Be().optional(),can_use_tri_state:Be().optional(),is_using_tri_state:Be().optional(),can_use_open_collector:Be().optional(),is_using_open_collector:Be().optional(),can_use_open_emitter:Be().optional(),is_using_open_emitter:Be().optional(),is_gpio:Be().optional(),highlight_color:k().optional(),must_be_connected:Be().optional(),provides_power:Be().optional(),requires_power:Be().optional(),provides_ground:Be().optional(),requires_ground:Be().optional(),provides_voltage:QZn.optional(),requires_voltage:QZn.optional(),required_voltage_tolerance:Ae().finite().min(0).max(1).optional(),do_not_connect:Be().optional(),include_in_board_pinout:Be().optional(),can_use_internal_pullup:Be().optional(),is_using_internal_pullup:Be().optional(),needs_external_pullup:Be().optional(),can_use_internal_pulldown:Be().optional(),is_using_internal_pulldown:Be().optional(),needs_external_pulldown:Be().optional(),can_use_open_drain:Be().optional(),is_using_open_drain:Be().optional(),can_use_push_pull:Be().optional(),is_using_push_pull:Be().optional(),should_have_decoupling_capacitor:Be().optional(),recommended_decoupling_capacitor_capacitance:un([k(),Ae()]).optional(),is_configured_for_i2c_sda:Be().optional(),is_configured_for_i2c_scl:Be().optional(),is_configured_for_spi_mosi:Be().optional(),is_configured_for_spi_miso:Be().optional(),is_configured_for_spi_sck:Be().optional(),is_configured_for_spi_cs:Be().optional(),is_configured_for_uart_tx:Be().optional(),is_configured_for_uart_rx:Be().optional(),supports_i2c_sda:Be().optional(),supports_i2c_scl:Be().optional(),supports_spi_mosi:Be().optional(),supports_spi_miso:Be().optional(),supports_spi_sck:Be().optional(),supports_spi_cs:Be().optional(),supports_uart_tx:Be().optional(),supports_uart_rx:Be().optional()});Ft(!0);var hpt=oh.extend({ftype:he("simple_battery"),capacity:GZn});Ft(!0);var dpt=oh.extend({ftype:he("simple_inductor"),inductance:VZn,display_inductance:k().optional(),max_current_rating:Ae().optional()});Ft(!0);var upt=oh.extend({ftype:he("simple_push_button")});Ft(!0);var ppt=oh.extend({ftype:he("simple_potentiometer"),max_resistance:vMe,display_max_resistance:k().optional()});Ft(!0);var deo=oh.extend({ftype:he("simple_crystal"),frequency:Ae().describe("Frequency in Hz"),load_capacitance:Ae().optional().describe("Load capacitance in pF"),pin_variant:Pt(["two_pin","four_pin"]).optional()});Ft(!0);var mpt=oh.extend({ftype:he("simple_pin_header"),pin_count:Ae(),gender:Pt(["male","female"]).optional().default("male")});Ft(!0);var ueo=["usb_c","m2","jst_sh","jst_gh","jst_zh","jst_ph","jst_xh","jst_vh"],peo=oh.extend({ftype:he("simple_connector"),standard:Pt(ueo).optional(),pin_count:Ae().int().positive().optional()});Ft(!0);var _pt=oh.extend({ftype:he("simple_pinout")});Ft(!0);var gpt=oh.extend({ftype:he("simple_resonator"),load_capacitance:tpt,equivalent_series_resistance:vMe.optional(),frequency:HG});Ft(!0);var Apt=oh.extend({ftype:he("simple_transistor"),transistor_type:Pt(["npn","pnp"])});Ft(!0);var fpt=oh.extend({ftype:he("simple_test_point"),footprint_variant:Pt(["pad","through_hole"]).optional(),pad_shape:Pt(["rect","circle"]).optional(),pad_diameter:un([Ae(),k()]).optional(),hole_diameter:un([Ae(),k()]).optional(),width:un([Ae(),k()]).optional(),height:un([Ae(),k()]).optional()});Ft(!0);var ypt=oh.extend({ftype:he("simple_mosfet"),channel_type:Pt(["n","p"]),mosfet_mode:Pt(["enhancement","depletion"])});Ft(!0);var xpt=oh.extend({ftype:he("simple_op_amp")});Ft(!0);var Cpt=oh.extend({ftype:he("simple_switch")});Ft(!0);var bpt=we({type:he("source_project_metadata"),name:k().optional(),software_used_string:k().optional(),project_url:k().optional(),source_filesystem_md5_hash:k().optional(),created_at:YZn.optional()});Ft(!0);var meo=yc.extend({type:he("source_missing_property_error"),source_missing_property_error_id:Mn("source_missing_property_error"),source_component_id:k(),property_name:k(),subcircuit_id:k().optional(),error_type:he("source_missing_property_error").default("source_missing_property_error")}).describe("The source code is missing a property");Ft(!0);var _eo=yc.extend({type:he("source_failed_to_create_component_error"),source_failed_to_create_component_error_id:Mn("source_failed_to_create_component_error"),error_type:he("source_failed_to_create_component_error").default("source_failed_to_create_component_error"),component_name:k().optional(),subcircuit_id:k().optional(),parent_source_component_id:k().optional(),pcb_center:we({x:Ae().optional(),y:Ae().optional()}).optional(),schematic_center:we({x:Ae().optional(),y:Ae().optional()}).optional()}).describe("Error emitted when a component fails to be constructed");Ft(!0);var Ipt=yc.extend({type:he("source_invalid_component_property_error"),source_invalid_component_property_error_id:Mn("source_invalid_component_property_error"),source_component_id:k(),property_name:k(),property_value:LF().optional(),expected_format:k().optional(),subcircuit_id:k().optional(),error_type:he("source_invalid_component_property_error").default("source_invalid_component_property_error")}).describe("The source component property is invalid");Ft(!0);var vpt=yc.extend({type:he("source_trace_not_connected_error"),source_trace_not_connected_error_id:Mn("source_trace_not_connected_error"),error_type:he("source_trace_not_connected_error").default("source_trace_not_connected_error"),subcircuit_id:k().optional(),source_group_id:k().optional(),source_trace_id:k().optional(),connected_source_port_ids:it(k()).optional(),selectors_not_found:it(k()).optional()}).describe("Occurs when a source trace selector does not match any ports");Ft(!0);var geo=we({type:he("source_property_ignored_warning"),source_property_ignored_warning_id:Mn("source_property_ignored_warning"),source_component_id:k(),property_name:k(),subcircuit_id:k().optional(),error_type:he("source_property_ignored_warning").default("source_property_ignored_warning"),message:k()}).describe("The source property was ignored");Ft(!0);var Spt=we({type:he("source_pin_missing_trace_warning"),source_pin_missing_trace_warning_id:Mn("source_pin_missing_trace_warning"),warning_type:he("source_pin_missing_trace_warning").default("source_pin_missing_trace_warning"),message:k(),source_component_id:k(),source_port_id:k(),subcircuit_id:k().optional()}).describe("Warning emitted when a source component pin is missing a trace connection");Ft(!0);var Ppt=we({type:he("source_missing_manufacturer_part_number_warning"),source_missing_manufacturer_part_number_warning_id:Mn("source_missing_manufacturer_part_number_warning"),warning_type:he("source_missing_manufacturer_part_number_warning").default("source_missing_manufacturer_part_number_warning"),message:k(),source_component_id:k(),standard:k().optional(),subcircuit_id:k().optional()}).describe("Warning emitted when a source component is missing its manufacturer part number");Ft(!0);var Ept=we({type:he("source_refdes_convention_warning"),source_refdes_convention_warning_id:Mn("source_refdes_convention_warning"),warning_type:he("source_refdes_convention_warning").default("source_refdes_convention_warning"),message:k(),source_component_id:k(),refdes:k(),source_component_ftype:k(),expected_prefixes:it(k()),actual_prefix:k().optional(),subcircuit_id:k().optional()}).describe("Warning emitted when a source component reference designator does not match the component type convention");Ft(!0);var Aeo=oh.extend({ftype:he("simple_voltage_probe")});Ft(!0);var feo=oh.extend({ftype:he("interconnect")});Ft(!0);var Mpt=yc.extend({type:he("source_i2c_misconfigured_error"),source_i2c_misconfigured_error_id:Mn("source_i2c_misconfigured_error"),error_type:he("source_i2c_misconfigured_error").default("source_i2c_misconfigured_error"),source_port_ids:it(k())}).describe("Error emitted when incompatible I2C pins (e.g. SDA and SCL) are connected to the same net");Ft(!0);var wpt=yc.extend({type:he("source_component_misconfigured_error"),source_component_misconfigured_error_id:Mn("source_component_misconfigured_error"),error_type:he("source_component_misconfigured_error").default("source_component_misconfigured_error"),source_component_ids:it(k()),source_port_ids:it(k()).optional()}).describe("Error emitted when one or more source components have an invalid or conflicting configuration");Ft(!0);var yeo=oh.extend({ftype:he("simple_voltage_source"),voltage:Jb,frequency:HG.optional(),peak_to_peak_voltage:Jb.optional(),wave_shape:Pt(["sinewave","square","triangle","sawtooth"]).optional(),phase:Oh.optional(),duty_cycle:Ae().optional().describe("Duty cycle as a fraction (0 to 1)"),pulse_delay:Pg.optional(),rise_time:Pg.optional(),fall_time:Pg.optional(),pulse_width:Pg.optional(),period:Pg.optional()});Ft(!0);var xeo=un([spt,ipt,wMe,neo,apt,oeo,cpt,reo,ieo,seo,lpt,aeo,leo,hpt,dpt,upt,ppt,deo,mpt,peo,_pt,gpt,Cpt,Apt,fpt,ypt,xpt,ceo,Aeo,feo,yeo,bpt,meo,Ipt,_eo,vpt,geo,Spt,Ppt,Ept,Mpt,wpt]);Ft(!0);var Ceo=we({type:he("source_port"),pin_number:Ae().optional(),port_hints:it(k()).optional(),name:k(),source_port_id:k(),source_component_id:k().optional(),source_group_id:k().optional(),most_frequently_referenced_by_name:k().optional(),subcircuit_id:k().optional(),subcircuit_connectivity_map_key:k().optional()}).merge(heo);Ft(!0);var beo=we({type:he("source_component_internal_connection"),source_component_internal_connection_id:k(),source_component_id:k(),source_port_ids:it(k()),subcircuit_id:k().optional()});Ft(!0);var Ieo=we({type:he("source_trace"),source_trace_id:k(),connected_source_port_ids:it(k()),connected_source_net_ids:it(k()),subcircuit_id:k().optional(),subcircuit_connectivity_map_key:k().optional(),max_length:Ae().optional(),max_via_count:Ae().int().nonnegative().optional(),name:k().optional(),min_trace_thickness:Ae().optional(),display_name:k().optional()});Ft(!0);var veo=we({type:he("source_group"),source_group_id:k(),subcircuit_id:k().optional(),parent_subcircuit_id:k().optional(),parent_source_group_id:k().optional(),is_subcircuit:Be().optional(),show_as_schematic_box:Be().optional(),name:k().optional(),was_automatically_named:Be().optional()});Ft(!0);var Seo=we({type:he("source_net"),source_net_id:k(),name:k(),member_source_group_ids:it(k()),is_power:Be().optional(),is_ground:Be().optional(),is_digital_signal:Be().optional(),is_analog_signal:Be().optional(),is_positive_voltage_source:Be().optional(),trace_width:Ae().optional(),subcircuit_id:k().optional(),subcircuit_connectivity_map_key:k().optional()});Ft(!0);var Peo=we({type:he("source_board"),source_board_id:k(),source_group_id:k(),title:k().optional()}).describe("Defines a board in the source domain");Ft(!0);var Eeo=yc.extend({type:he("source_ambiguous_port_reference"),source_ambiguous_port_reference_id:Mn("source_ambiguous_port_reference"),error_type:he("source_ambiguous_port_reference").default("source_ambiguous_port_reference"),source_port_id:k().optional(),source_component_id:k().optional()}).describe("Error emitted when a port hint matches multiple non-overlapping pads, making the port reference ambiguous");Ft(!0);var Meo=we({type:he("source_pcb_ground_plane"),source_pcb_ground_plane_id:k(),source_group_id:k(),source_net_id:k(),subcircuit_id:k().optional()}).describe("Defines a ground plane in the source domain");Ft(!0);var weo=["top","bottom","inner1","inner2","inner3","inner4","inner5","inner6","inner7","inner8"],q0t=Pt(weo),Js=q0t.or(we({name:q0t})).transform((e)=>{if(typeof e==="string")return e;return e.name});Ft(!0);var v_=Pt(["top","bottom"]),Beo=we({type:he("source_manually_placed_via"),source_manually_placed_via_id:k(),source_group_id:k(),source_net_id:k().min(1).optional(),subcircuit_id:k().optional(),source_trace_id:k().optional()}).describe("Defines a via that is manually placed in the source domain");Ft(!0);var Teo=we({type:he("source_unnamed_trace_warning"),source_unnamed_trace_warning_id:Mn("source_unnamed_trace_warning"),warning_type:he("source_unnamed_trace_warning").default("source_unnamed_trace_warning"),message:k(),source_trace_id:k(),subcircuit_id:k().optional()}).describe("Warning emitted when a source trace is missing a name");Ft(!0);var Deo=we({type:he("source_no_power_pin_defined_warning"),source_no_power_pin_defined_warning_id:Mn("source_no_power_pin_defined_warning"),warning_type:he("source_no_power_pin_defined_warning").default("source_no_power_pin_defined_warning"),message:k(),source_component_id:k(),source_port_ids:it(k()),subcircuit_id:k().optional()}).describe("Warning emitted when a chip has no source ports with requires_power=true");Ft(!0);var Neo=we({type:he("source_no_ground_pin_defined_warning"),source_no_ground_pin_defined_warning_id:Mn("source_no_ground_pin_defined_warning"),warning_type:he("source_no_ground_pin_defined_warning").default("source_no_ground_pin_defined_warning"),message:k(),source_component_id:k(),source_port_ids:it(k()),subcircuit_id:k().optional()}).describe("Warning emitted when a chip has no source ports marked as ground pins");Ft(!0);var Reo=we({type:he("source_component_pins_underspecified_warning"),source_component_pins_underspecified_warning_id:Mn("source_component_pins_underspecified_warning"),warning_type:he("source_component_pins_underspecified_warning").default("source_component_pins_underspecified_warning"),message:k(),source_component_id:k(),source_port_ids:it(k()),subcircuit_id:k().optional()}).describe("Warning emitted when all ports on a source component are underspecified");Ft(!0);var Qeo=yc.extend({type:he("source_pin_must_be_connected_error"),source_pin_must_be_connected_error_id:Mn("source_pin_must_be_connected_error"),error_type:he("source_pin_must_be_connected_error").default("source_pin_must_be_connected_error"),source_component_id:k(),source_port_id:k(),subcircuit_id:k().optional()}).describe("Error emitted when a pin with mustBeConnected attribute is not connected to any trace");Ft(!0);var keo=yc.extend({type:he("unknown_error_finding_part"),unknown_error_finding_part_id:Mn("unknown_error_finding_part"),error_type:he("unknown_error_finding_part").default("unknown_error_finding_part"),source_component_id:k().optional(),subcircuit_id:k().optional()}).describe("Error emitted when an unexpected error occurs while finding a part");Ft(!0);var Leo=we({type:he("source_part_not_found_warning"),source_part_not_found_warning_id:Mn("source_part_not_found_warning"),warning_type:he("source_part_not_found_warning").default("source_part_not_found_warning"),message:k(),source_component_id:k().optional(),subcircuit_id:k().optional(),supplier_name:Wpe.optional(),manufacturer_part_number:k().optional(),supplier_part_number:k().optional(),part_name:k().optional()}).describe("Warning emitted when a requested part can not be found");Ft(!0);var Heo=we({type:he("source_confusing_net_name_warning"),source_confusing_net_name_warning_id:Mn("source_confusing_net_name_warning"),warning_type:he("source_confusing_net_name_warning").default("source_confusing_net_name_warning"),message:k(),source_net_ids:it(k()).min(2),net_name:k(),subcircuit_id:k().optional()}).describe("Warning emitted when electrically disconnected source nets share a name");Ft(!0);var K0t=un([Ae().nonnegative().finite(),we({reference:he("longest_manhattan"),source_trace_ids:it(k()).min(1).optional(),offset:Ae().finite().optional()})]),kZn=un([Ae().positive().finite(),we({width_multiplier:Ae().positive().finite()})]),Feo=we({type:he("source_bus"),source_bus_id:k(),name:k().optional(),source_trace_ids:it(k()).min(1),max_length_skew:Ae().nonnegative().finite().optional(),target_impedance:Ae().positive().finite().optional(),target_differential_impedance:Ae().positive().finite().optional(),differential_pair:we({positive_source_trace_id:k(),negative_source_trace_id:k(),trace_gap:Ae().positive().finite().optional(),max_uncoupled_length:Ae().nonnegative().finite().optional()}).optional(),length_match_source_trace_ids:it(k()).min(1).optional(),min_length:K0t.optional(),max_length:K0t.optional(),target_length:K0t.optional(),length_tolerance:Ae().nonnegative().finite().optional(),pcb_trace_spacing:kZn.optional(),pcb_spacing_to_other_signals:kZn.optional(),target_impedance_min:Ae().positive().finite().optional(),target_impedance_max:Ae().positive().finite().optional(),target_differential_impedance_min:Ae().positive().finite().optional(),target_differential_impedance_max:Ae().positive().finite().optional(),subcircuit_id:k().optional()});Ft(!0);var zeo=yc.pick({message:!0,error_type:!0}).extend({type:he("source_runtime_error"),source_runtime_error_id:Mn("source_runtime_error"),error_type:he("source_runtime_error").default("source_runtime_error"),phase_name:k().optional()}).describe("An unexpected runtime failure while generating or validating a circuit");Ft(!0);var Oeo=we({type:he("schematic_box"),schematic_sheet_id:k().optional(),schematic_component_id:k().optional(),schematic_symbol_id:k().optional(),width:Sn,height:Sn,is_dashed:Be().default(!1),x:Sn,y:Sn,subcircuit_id:k().optional()}).describe("Draws a box on the schematic");Ft(!0);var Veo=we({type:he("schematic_path"),schematic_path_id:Mn("schematic_path"),schematic_sheet_id:k().optional(),schematic_component_id:k().optional(),schematic_symbol_id:k().optional(),fill_color:k().optional(),is_filled:Be().optional(),is_dashed:Be().default(!1),stroke_width:Sn.nullable().optional(),stroke_color:k().optional(),dash_length:Sn.optional(),dash_gap:Sn.optional(),points:it(lr),subcircuit_id:k().optional()});Ft(!0);var Yeo=gs(we({left_margin:Wo.optional(),right_margin:Wo.optional(),top_margin:Wo.optional(),bottom_margin:Wo.optional()})),Geo=we({left_size:Ae(),right_size:Ae(),top_size:Ae().optional(),bottom_size:Ae().optional()});Ft(!0);var Ueo=we({left_side:we({pins:it(Ae()),direction:Pt(["top-to-bottom","bottom-to-top"]).optional()}).optional(),right_side:we({pins:it(Ae()),direction:Pt(["top-to-bottom","bottom-to-top"]).optional()}).optional(),top_side:we({pins:it(Ae()),direction:Pt(["left-to-right","right-to-left"]).optional()}).optional(),bottom_side:we({pins:it(Ae()),direction:Pt(["left-to-right","right-to-left"]).optional()}).optional()});Ft(!0);var Weo=un([Geo,Ueo]),Xeo=we({type:he("schematic_component"),size:SMe,center:lr,source_component_id:k().optional(),schematic_component_id:k(),schematic_sheet_id:k().optional(),schematic_symbol_id:k().optional(),pin_spacing:Wo.optional(),pin_styles:Yeo.optional(),box_width:Wo.optional(),symbol_name:k().optional(),port_arrangement:Weo.optional(),port_labels:gs(k()).optional(),symbol_display_value:k().optional(),subcircuit_id:k().optional(),schematic_group_id:k().optional(),is_schematic_group:Be().optional(),source_group_id:k().optional(),is_box_with_pins:Be().optional().default(!0)});Ft(!0);var DXi=we({kicad_symbol:teo.optional()}).catchall(LF()),jeo=we({type:he("schematic_symbol"),schematic_symbol_id:k(),name:k().optional(),metadata:DXi.optional()}).describe("Defines a named schematic symbol that can be referenced by components.");Ft(!0);var Keo=we({type:he("schematic_line"),schematic_line_id:Mn("schematic_line"),schematic_sheet_id:k().optional(),schematic_component_id:k().optional(),schematic_symbol_id:k().optional(),x1:Sn,y1:Sn,x2:Sn,y2:Sn,stroke_width:Sn.nullable().optional(),color:k().default("#000000"),is_dashed:Be().default(!1),dash_length:Sn.optional(),dash_gap:Sn.optional(),subcircuit_id:k().optional()}).describe("Draws a styled line on the schematic");Ft(!0);var $eo=we({type:he("schematic_rect"),schematic_rect_id:Mn("schematic_rect"),schematic_sheet_id:k().optional(),schematic_component_id:k().optional(),schematic_symbol_id:k().optional(),center:lr,width:Sn,height:Sn,rotation:Oh.default(0),stroke_width:Sn.nullable().optional(),color:k().default("#000000"),is_filled:Be().default(!1),fill_color:k().optional(),is_dashed:Be().default(!1),subcircuit_id:k().optional()}).describe("Draws a styled rectangle on the schematic");Ft(!0);var qeo=we({type:he("schematic_circle"),schematic_circle_id:Mn("schematic_circle"),schematic_sheet_id:k().optional(),schematic_component_id:k().optional(),schematic_symbol_id:k().optional(),center:lr,radius:Sn,stroke_width:Sn.nullable().optional(),color:k().default("#000000"),is_filled:Be().default(!1),fill_color:k().optional(),is_dashed:Be().default(!1),subcircuit_id:k().optional()}).describe("Draws a styled circle on the schematic");Ft(!0);var Jeo=we({type:he("schematic_arc"),schematic_arc_id:Mn("schematic_arc"),schematic_sheet_id:k().optional(),schematic_component_id:k().optional(),schematic_symbol_id:k().optional(),center:lr,radius:Sn,start_angle_degrees:Oh,end_angle_degrees:Oh,direction:Pt(["clockwise","counterclockwise"]).default("counterclockwise"),stroke_width:Sn.nullable().optional(),color:k().default("#000000"),is_dashed:Be().default(!1),subcircuit_id:k().optional()}).describe("Draws a styled arc on the schematic");Ft(!0);var Zeo=we({type:he("schematic_trace"),schematic_trace_id:k(),schematic_sheet_id:k().optional(),source_trace_id:k().optional(),junctions:it(we({x:Ae(),y:Ae()})),edges:it(we({from:we({x:Ae(),y:Ae()}),to:we({x:Ae(),y:Ae()}),is_crossing:Be().optional(),from_schematic_port_id:k().optional(),to_schematic_port_id:k().optional()})),subcircuit_id:k().optional(),subcircuit_connectivity_map_key:k().optional()});Ft(!0);var NXi=Pt(["center","left","right","top","bottom"]);Ft(!0);var Bpt=we({text:k(),is_overlined:Be().optional()}),eto=we({type:he("schematic_text"),schematic_sheet_id:k().optional(),schematic_component_id:k().optional(),schematic_symbol_id:k().optional(),schematic_text_id:k(),source_trace_id:k().optional(),text:k(),text_parts:it(Bpt).min(1).optional(),display_superscript:k().optional(),font_size:Ae().default(0.18),position:we({x:Sn,y:Sn}),rotation:Ae().default(0),anchor:un([NXi.describe("legacy"),eT]).default("center"),color:k().default("#000000"),subcircuit_id:k().optional()});Ft(!0);var tto=we({type:he("schematic_port"),schematic_port_id:k(),source_port_id:k(),schematic_sheet_id:k().optional(),schematic_component_id:k().optional(),center:lr,facing_direction:Pt(["up","down","left","right"]).optional(),distance_from_component_edge:Ae().optional(),side_of_component:Pt(["top","bottom","left","right"]).optional(),true_ccw_index:Ae().optional(),pin_number:Ae().optional(),display_pin_label:k().optional(),display_pin_label_text_parts:it(Bpt).min(1).optional(),display_pin_label_font_size:Ae().positive().finite().optional(),subcircuit_id:k().optional(),is_connected:Be().optional(),is_internal_circuit_port:Be().optional(),is_overlapping_internal_circuit_port:Be().optional(),has_input_arrow:Be().optional(),has_output_arrow:Be().optional(),is_drawn_with_inversion_circle:Be().optional()}).describe("Defines a port on a schematic component");Ft(!0);var nto=we({type:he("schematic_net_label"),schematic_net_label_id:Mn("schematic_net_label"),schematic_sheet_id:k().optional(),schematic_trace_id:k().optional(),source_trace_id:k().optional(),source_net_id:k(),center:lr,anchor_position:lr.optional(),anchor_side:Pt(["top","bottom","left","right"]),text:k(),display_superscript:k().optional(),symbol_name:k().optional(),is_movable:Be().optional(),subcircuit_id:k().optional()});Ft(!0);var oto=yc.extend({type:he("schematic_error"),schematic_error_id:k(),error_type:he("schematic_port_not_found").default("schematic_port_not_found"),subcircuit_id:k().optional()}).describe("Defines a schematic error on the schematic");Ft(!0);var rto=yc.extend({type:he("schematic_layout_error"),schematic_layout_error_id:Mn("schematic_layout_error"),error_type:he("schematic_layout_error").default("schematic_layout_error"),source_group_id:k(),schematic_group_id:k(),subcircuit_id:k().optional()}).describe("Error emitted when schematic layout fails for a group");Ft(!0);var BMe=we({type:he("schematic_debug_object"),label:k().optional(),subcircuit_id:k().optional()}),ito=BMe.extend({shape:he("rect"),center:lr,size:SMe}),sto=BMe.extend({shape:he("line"),start:lr,end:lr}),ato=BMe.extend({shape:he("point"),center:lr}),cto=ss("shape",[ito,sto,ato]);Ft(!0);var lto=we({type:he("schematic_voltage_probe"),schematic_voltage_probe_id:k(),schematic_sheet_id:k().optional(),source_component_id:k().optional(),name:k().optional(),position:lr,schematic_trace_id:k(),voltage:Jb.optional(),subcircuit_id:k().optional(),color:k().optional(),label_alignment:eT.optional()}).describe("Defines a voltage probe measurement point on a schematic trace");Ft(!0);var hto=we({type:he("schematic_manual_edit_conflict_warning"),schematic_manual_edit_conflict_warning_id:Mn("schematic_manual_edit_conflict_warning"),warning_type:he("schematic_manual_edit_conflict_warning").default("schematic_manual_edit_conflict_warning"),message:k(),schematic_component_id:k(),schematic_group_id:k().optional(),subcircuit_id:k().optional(),source_component_id:k()}).describe("Warning emitted when a component has both manual placement and explicit schX/schY coordinates");Ft(!0);var dto=we({type:he("schematic_component_overlap_warning"),schematic_component_overlap_warning_id:Mn("schematic_component_overlap_warning"),warning_type:he("schematic_component_overlap_warning").default("schematic_component_overlap_warning"),message:k(),schematic_component_ids:kC([k(),k()]),schematic_sheet_id:k().optional()}).describe("Warning emitted when the rendered bounds of two schematic components overlap");Ft(!0);var uto=we({type:he("schematic_component_styling_warning"),schematic_component_styling_warning_id:Mn("schematic_component_styling_warning"),warning_type:he("schematic_component_styling_warning").default("schematic_component_styling_warning"),message:k(),schematic_component_id:k(),styling_issue_type:k(),schematic_port_ids:it(k()).optional(),source_component_id:k().optional(),schematic_sheet_id:k().optional(),subcircuit_id:k().optional()}).describe("Warning emitted when a schematic component has a visual styling issue");Ft(!0);var pto=we({type:he("schematic_element_outside_sheet_warning"),schematic_element_outside_sheet_warning_id:Mn("schematic_element_outside_sheet_warning"),warning_type:he("schematic_element_outside_sheet_warning").default("schematic_element_outside_sheet_warning"),message:k(),schematic_sheet_id:k(),schematic_element_type:Pt(["schematic_component","schematic_net_label","schematic_trace"]),schematic_element_id:k()}).describe("Warning emitted when a schematic component, net label, or trace extends outside its schematic sheet");Ft(!0);var LZn=Sn.pipe(Ae().positive().finite()),mto=we({type:he("schematic_graphic"),schematic_graphic_id:Mn("schematic_graphic"),schematic_sheet_id:k().optional(),asset:EMe.optional(),svg_content:k().optional(),width:LZn.optional(),height:LZn.optional()}).describe("References a graphic asset or inline SVG content with optional centered layout bounds on a schematic sheet").superRefine(({asset:e,svg_content:t},n)=>{if(e===void 0&&t===void 0)n.addIssue({code:Vt.custom,message:"At least one of asset or svg_content is required"})});Ft(!0);var _to=we({type:he("schematic_group"),schematic_group_id:Mn("schematic_group"),schematic_sheet_id:k().optional(),source_group_id:k(),is_subcircuit:Be().optional(),subcircuit_id:k().optional(),width:Wo,height:Wo,center:lr,schematic_component_ids:it(k()),show_as_schematic_box:Be().optional(),name:k().optional(),description:k().optional()}).describe("Defines a group of components on the schematic");Ft(!0);var gto=we({type:he("schematic_table"),schematic_table_id:Mn("schematic_table"),schematic_sheet_id:k().optional(),anchor_position:lr,column_widths:it(Sn),row_heights:it(Sn),cell_padding:Sn.optional(),border_width:Sn.optional(),subcircuit_id:k().optional(),schematic_component_id:k().optional(),anchor:eT.optional()}).describe("Defines a table on the schematic");Ft(!0);var Ato=we({type:he("schematic_table_cell"),schematic_table_cell_id:Mn("schematic_table_cell"),schematic_sheet_id:k().optional(),schematic_table_id:k(),start_row_index:Ae(),end_row_index:Ae(),start_column_index:Ae(),end_column_index:Ae(),text:k().optional(),center:lr,width:Sn,height:Sn,horizontal_align:Pt(["left","center","right"]).optional(),vertical_align:Pt(["top","middle","bottom"]).optional(),font_size:Sn.optional(),subcircuit_id:k().optional()}).describe("Defines a cell within a schematic_table");Ft(!0);var fto=Pt(["a4","ansi_b"]),yto=we({type:he("schematic_sheet"),schematic_sheet_id:Mn("schematic_sheet"),name:k().optional(),sheet_index:Ae().optional(),sheet_size:fto.optional(),sheet_width:Ae().positive().optional(),sheet_height:Ae().positive().optional(),subcircuit_id:k().optional(),outline_color:k().optional()}).describe("Defines a schematic sheet or page that components can be placed on");Ft(!0);var xto=we({type:he("schematic_missing_sheet_warning"),schematic_missing_sheet_warning_id:Mn("schematic_missing_sheet_warning"),warning_type:he("schematic_missing_sheet_warning").default("schematic_missing_sheet_warning"),message:k()}).describe("Circuit-wide warning emitted when a schematic has no schematic sheet. Display as a banner without attaching it to a component or drawing a target outline or leader line.");Ft(!0);var Cto=we({x:Sn,y:Sn,bulge:Ae().optional()});Ft(!0);var J0t=we({vertices:it(Cto)});Ft(!0);var Tpt=we({outer_ring:J0t,inner_rings:it(J0t).default([])});Ft(!0);var bto={from_left:"from_left",from_right:"from_right",from_top:"from_top",from_bottom:"from_bottom",from_above:"from_above",from_below:"from_below",from_x_neg:"from_left",from_x_pos:"from_right",from_y_pos:"from_top",from_y_neg:"from_bottom",from_z_pos:"from_above",from_z_neg:"from_below",from_front:"from_top",from_back:"from_bottom"},RXi={from_left:{x:-1,y:0,z:0},from_right:{x:1,y:0,z:0},from_top:{x:0,y:1,z:0},from_bottom:{x:0,y:-1,z:0},from_above:{x:0,y:0,z:1},from_below:{x:0,y:0,z:-1}},Ito=Pt(["from_left","from_right","from_top","from_bottom","from_above","from_below","from_x_neg","from_x_pos","from_y_pos","from_y_neg","from_z_pos","from_z_neg","from_front","from_back"]).transform((e)=>bto[e]).describe('The side exposing the receptacle where the cable or mating part is attached, following the 2D PCB diagram convention, not a 3D viewport frame. In project coordinate space, "from_top" is +Y, "from_bottom" -Y, "from_left" -X, "from_right" +X, "from_above" +Z and "from_below" -Z. A receptacle on the +Y edge is "from_top" even though the plug moves in -Y as it seats. Cartesian spellings such as "from_y_pos" are accepted and normalized to the named values, as are the deprecated "from_front" (now "from_top") and "from_back" (now "from_bottom").');Ft(!0);Ft(!0);var Z0t=Pt(["leftside_top","leftside_bottom","rightside_top","rightside_bottom","topside_left","topside_right","bottomside_left","bottomside_right"]);Ft(!0);var QXi=[["leftside_top","bottomside_left","rightside_bottom","topside_right"],["leftside_bottom","bottomside_right","rightside_top","topside_left"]],kXi=(e,t)=>{for(let n of QXi){let o=n.indexOf(e),r=n.indexOf(t);if(o!==-1&&r!==-1)return(r-o+n.length)%n.length*90}return null},vto=we({x:Sn,y:Sn,via:Be().optional(),via_to_layer:Js.optional()}),LXi=it(vto);Ft(!0);Ft(!0);var Sto=we({x:Sn,y:Sn,via:Be().optional(),to_layer:Js.optional(),trace_width:Sn.optional()});Ft(!0);var Pto=we({min_trace_width:Wo.optional(),min_board_edge_clearance:Wo.optional(),min_via_hole_edge_to_via_hole_edge_clearance:Wo.optional(),min_plated_hole_drill_edge_to_drill_edge_clearance:Wo.optional(),min_trace_to_pad_edge_clearance:Wo.optional(),min_trace_to_hole_edge_clearance:Wo.optional().describe("Minimum distance from a trace copper edge to a non-plated hole edge, in mm. No default is applied when omitted."),min_pad_edge_to_pad_edge_clearance:Wo.optional(),min_same_net_trace_edge_to_trace_edge_clearance:Wo.optional(),min_different_net_trace_edge_to_trace_edge_clearance:Wo.optional(),min_via_edge_to_pad_edge_clearance:Wo.optional(),min_via_hole_diameter:Wo.optional(),min_via_pad_diameter:Wo.optional()}),Eto=we({type:he("pcb_component"),pcb_component_id:Mn("pcb_component"),source_component_id:k(),center:lr,layer:Js,rotation:Oh,display_offset_x:k().optional().describe("How to display the x offset for this part, usually corresponding with how the user specified it"),display_offset_y:k().optional().describe("How to display the y offset for this part, usually corresponding with how the user specified it"),width:Wo,height:Wo,do_not_place:Be().optional(),is_allowed_to_be_off_board:Be().optional(),subcircuit_id:k().optional(),pcb_group_id:k().optional(),position_mode:Pt(["packed","relative_to_group_anchor","relative_to_another_component","none"]).optional(),anchor_position:lr.optional(),anchor_alignment:eT.optional(),positioned_relative_to_pcb_group_id:k().optional(),positioned_relative_to_pcb_board_id:k().optional(),cable_insertion_center:lr.optional(),insertion_direction:Ito.optional(),pin1_location:Z0t.optional().describe("Location of pin 1 on the unrotated, top-view component footprint"),supplier_pin1_location_map:gs(Wpe,Z0t).optional().describe("Pin 1 location for each supplier's unrotated, top-view footprint"),metadata:we({kicad_footprint:$Zn.optional()}).optional(),obstructs_within_bounds:Be().default(!0).describe("Does this component take up all the space within its bounds on a layer. This is generally true except for when separated pin headers are being represented by a single component (in which case, chips can be placed between the pin headers) or for tall modules where chips fit underneath")}).describe("Defines a component on the PCB");Ft(!0);var TMe=we({type:he("pcb_debug_object"),pcb_debug_object_id:Mn("pcb_debug_object"),label:k().optional(),subcircuit_id:k().optional()}),Mto=TMe.extend({shape:he("rect"),center:lr,size:SMe}),wto=TMe.extend({shape:he("line"),start:lr,end:lr}),Bto=TMe.extend({shape:he("point"),center:lr}),Tto=ss("shape",[Mto,wto,Bto]);Ft(!0);var Dto=we({type:he("pcb_hole"),pcb_hole_id:Mn("pcb_hole"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),pcb_component_id:k().optional(),hole_shape:he("circle"),hole_diameter:Ae(),x:Sn,y:Sn,is_covered_with_solder_mask:Be().optional(),soldermask_margin:Ae().optional()}),HXi=Dto.describe("Defines a circular hole on the PCB");Ft(!0);var Nto=we({type:he("pcb_hole"),pcb_hole_id:Mn("pcb_hole"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),pcb_component_id:k().optional(),hole_shape:he("rect"),hole_width:Ae(),hole_height:Ae(),x:Sn,y:Sn,is_covered_with_solder_mask:Be().optional(),soldermask_margin:Ae().optional()}),FXi=Nto.describe("Defines a rectangular (square-capable) hole on the PCB. Use equal width/height for square.");Ft(!0);var Rto=we({type:he("pcb_hole"),pcb_hole_id:Mn("pcb_hole"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),pcb_component_id:k().optional(),hole_shape:Pt(["circle","square"]),hole_diameter:Ae(),x:Sn,y:Sn,is_covered_with_solder_mask:Be().optional(),soldermask_margin:Ae().optional()}),zXi=Rto.describe("Defines a circular or square hole on the PCB");Ft(!0);var Qto=we({type:he("pcb_hole"),pcb_hole_id:Mn("pcb_hole"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),pcb_component_id:k().optional(),hole_shape:he("oval"),hole_width:Ae(),hole_height:Ae(),x:Sn,y:Sn,is_covered_with_solder_mask:Be().optional(),soldermask_margin:Ae().optional()}),OXi=Qto.describe("Defines an oval hole on the PCB");Ft(!0);var kto=we({type:he("pcb_hole"),pcb_hole_id:Mn("pcb_hole"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),pcb_component_id:k().optional(),hole_shape:he("pill"),hole_width:Ae(),hole_height:Ae(),x:Sn,y:Sn,is_covered_with_solder_mask:Be().optional(),soldermask_margin:Ae().optional()}),VXi=kto.describe("Defines a pill-shaped hole on the PCB");Ft(!0);var Lto=we({type:he("pcb_hole"),pcb_hole_id:Mn("pcb_hole"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),pcb_component_id:k().optional(),hole_shape:he("rotated_pill"),hole_width:Ae(),hole_height:Ae(),x:Sn,y:Sn,ccw_rotation:Oh,is_covered_with_solder_mask:Be().optional(),soldermask_margin:Ae().optional()}),YXi=Lto.describe("Defines a rotated pill-shaped hole on the PCB");Ft(!0);var Hto=Rto.or(Qto).or(kto).or(Lto).or(Dto).or(Nto),GXi=we({type:he("pcb_plated_hole"),shape:he("circle"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),outer_diameter:Ae(),hole_diameter:Ae(),is_covered_with_solder_mask:Be().optional(),x:Sn,y:Sn,layers:it(Js),port_hints:it(k()).optional(),pcb_component_id:k().optional(),pcb_port_id:k().optional(),pcb_plated_hole_id:Mn("pcb_plated_hole"),soldermask_margin:Ae().optional()}),UXi=we({type:he("pcb_plated_hole"),shape:Pt(["oval","pill"]),pcb_group_id:k().optional(),subcircuit_id:k().optional(),outer_width:Ae(),outer_height:Ae(),hole_width:Ae(),hole_height:Ae(),is_covered_with_solder_mask:Be().optional(),x:Sn,y:Sn,ccw_rotation:Oh,layers:it(Js),port_hints:it(k()).optional(),pcb_component_id:k().optional(),pcb_port_id:k().optional(),pcb_plated_hole_id:Mn("pcb_plated_hole"),soldermask_margin:Ae().optional()}),WXi=we({type:he("pcb_plated_hole"),shape:he("circular_hole_with_rect_pad"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),hole_shape:he("circle"),pad_shape:he("rect"),hole_diameter:Ae(),rect_pad_width:Ae(),rect_pad_height:Ae(),rect_border_radius:Ae().optional(),hole_offset_x:Sn.default(0),hole_offset_y:Sn.default(0),is_covered_with_solder_mask:Be().optional(),x:Sn,y:Sn,layers:it(Js),port_hints:it(k()).optional(),pcb_component_id:k().optional(),pcb_port_id:k().optional(),pcb_plated_hole_id:Mn("pcb_plated_hole"),soldermask_margin:Ae().optional(),rect_ccw_rotation:Oh.optional()}),XXi=we({type:he("pcb_plated_hole"),shape:he("pill_hole_with_rect_pad"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),hole_shape:he("pill"),pad_shape:he("rect"),hole_width:Ae(),hole_height:Ae(),rect_pad_width:Ae(),rect_pad_height:Ae(),rect_border_radius:Ae().optional(),hole_offset_x:Sn.default(0),hole_offset_y:Sn.default(0),is_covered_with_solder_mask:Be().optional(),x:Sn,y:Sn,layers:it(Js),port_hints:it(k()).optional(),pcb_component_id:k().optional(),pcb_port_id:k().optional(),pcb_plated_hole_id:Mn("pcb_plated_hole"),soldermask_margin:Ae().optional()}),jXi=we({type:he("pcb_plated_hole"),shape:he("rotated_pill_hole_with_rect_pad"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),hole_shape:he("rotated_pill"),pad_shape:he("rect"),hole_width:Ae(),hole_height:Ae(),hole_ccw_rotation:Oh,rect_pad_width:Ae(),rect_pad_height:Ae(),rect_border_radius:Ae().optional(),rect_ccw_rotation:Oh,hole_offset_x:Sn.default(0),hole_offset_y:Sn.default(0),is_covered_with_solder_mask:Be().optional(),x:Sn,y:Sn,layers:it(Js),port_hints:it(k()).optional(),pcb_component_id:k().optional(),pcb_port_id:k().optional(),pcb_plated_hole_id:Mn("pcb_plated_hole"),soldermask_margin:Ae().optional()}),KXi=we({type:he("pcb_plated_hole"),shape:he("hole_with_polygon_pad"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),hole_shape:Pt(["circle","oval","pill","rotated_pill"]),hole_diameter:Ae().optional(),hole_width:Ae().optional(),hole_height:Ae().optional(),pad_outline:it(we({x:Sn,y:Sn})).min(3),hole_offset_x:Sn.default(0),hole_offset_y:Sn.default(0),is_covered_with_solder_mask:Be().optional(),x:Sn,y:Sn,layers:it(Js),port_hints:it(k()).optional(),pcb_component_id:k().optional(),pcb_port_id:k().optional(),pcb_plated_hole_id:Mn("pcb_plated_hole"),soldermask_margin:Ae().optional(),ccw_rotation:Oh.optional()}),Fto=un([GXi,UXi,WXi,XXi,jXi,KXi]);Ft(!0);Ft(!0);Ft(!0);Ft(!0);Ft(!0);Ft(!0);var zto=we({type:he("pcb_port"),pcb_port_id:Mn("pcb_port"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),source_port_id:k(),pcb_component_id:k().optional(),x:Sn,y:Sn,layers:it(Js),is_board_pinout:Be().optional()}).describe("Defines a port on the PCB");Ft(!0);var $Xi=we({type:he("pcb_smtpad"),shape:he("circle"),pcb_smtpad_id:Mn("pcb_smtpad"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),x:Sn,y:Sn,radius:Ae(),layer:Js,port_hints:it(k()).optional(),pcb_component_id:k().optional(),pcb_port_id:k().optional(),is_covered_with_solder_mask:Be().optional(),soldermask_margin:Ae().optional(),solderpaste_margin:Ae().optional()}),qXi=we({type:he("pcb_smtpad"),shape:he("rect"),pcb_smtpad_id:Mn("pcb_smtpad"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),x:Sn,y:Sn,width:Ae(),height:Ae(),rect_border_radius:Ae().optional(),corner_radius:Ae().optional(),layer:Js,port_hints:it(k()).optional(),pcb_component_id:k().optional(),pcb_port_id:k().optional(),is_covered_with_solder_mask:Be().optional(),soldermask_margin:Ae().optional(),soldermask_margin_left:Ae().optional(),soldermask_margin_top:Ae().optional(),soldermask_margin_right:Ae().optional(),soldermask_margin_bottom:Ae().optional(),solderpaste_margin:Ae().optional()}),JXi=we({type:he("pcb_smtpad"),shape:he("rotated_rect"),pcb_smtpad_id:Mn("pcb_smtpad"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),x:Sn,y:Sn,width:Ae(),height:Ae(),rect_border_radius:Ae().optional(),corner_radius:Ae().optional(),ccw_rotation:Oh,layer:Js,port_hints:it(k()).optional(),pcb_component_id:k().optional(),pcb_port_id:k().optional(),is_covered_with_solder_mask:Be().optional(),soldermask_margin:Ae().optional(),soldermask_margin_left:Ae().optional(),soldermask_margin_top:Ae().optional(),soldermask_margin_right:Ae().optional(),soldermask_margin_bottom:Ae().optional(),solderpaste_margin:Ae().optional()}),Oto=we({type:he("pcb_smtpad"),shape:he("pill"),pcb_smtpad_id:Mn("pcb_smtpad"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),x:Sn,y:Sn,width:Ae(),height:Ae(),radius:Ae(),layer:Js,port_hints:it(k()).optional(),pcb_component_id:k().optional(),pcb_port_id:k().optional(),is_covered_with_solder_mask:Be().optional(),soldermask_margin:Ae().optional(),solderpaste_margin:Ae().optional()}),ZXi=we({type:he("pcb_smtpad"),shape:he("rotated_pill"),pcb_smtpad_id:Mn("pcb_smtpad"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),x:Sn,y:Sn,width:Ae(),height:Ae(),radius:Ae(),ccw_rotation:Oh,layer:Js,port_hints:it(k()).optional(),pcb_component_id:k().optional(),pcb_port_id:k().optional(),is_covered_with_solder_mask:Be().optional(),soldermask_margin:Ae().optional(),solderpaste_margin:Ae().optional()}),eji=we({type:he("pcb_smtpad"),shape:he("polygon"),pcb_smtpad_id:Mn("pcb_smtpad"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),points:it(lr),layer:Js,port_hints:it(k()).optional(),pcb_component_id:k().optional(),pcb_port_id:k().optional(),is_covered_with_solder_mask:Be().optional(),soldermask_margin:Ae().optional(),solderpaste_margin:Ae().optional()}),Vto=ss("shape",[$Xi,qXi,JXi,ZXi,Oto,eji]).describe("Defines an SMT pad on the PCB");Ft(!0);Ft(!0);Ft(!0);Ft(!0);Ft(!0);Ft(!0);var tji=we({type:he("pcb_solder_paste"),shape:he("circle"),pcb_solder_paste_id:Mn("pcb_solder_paste"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),x:Sn,y:Sn,radius:Ae(),layer:Js,pcb_component_id:k().optional(),pcb_smtpad_id:k().optional()}),nji=we({type:he("pcb_solder_paste"),shape:he("rect"),pcb_solder_paste_id:Mn("pcb_solder_paste"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),x:Sn,y:Sn,width:Ae(),height:Ae(),layer:Js,pcb_component_id:k().optional(),pcb_smtpad_id:k().optional()}),oji=we({type:he("pcb_solder_paste"),shape:he("pill"),pcb_solder_paste_id:Mn("pcb_solder_paste"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),x:Sn,y:Sn,width:Ae(),height:Ae(),radius:Ae(),layer:Js,pcb_component_id:k().optional(),pcb_smtpad_id:k().optional()}),rji=we({type:he("pcb_solder_paste"),shape:he("rotated_rect"),pcb_solder_paste_id:Mn("pcb_solder_paste"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),x:Sn,y:Sn,width:Ae(),height:Ae(),ccw_rotation:Sn,layer:Js,pcb_component_id:k().optional(),pcb_smtpad_id:k().optional()}),iji=we({type:he("pcb_solder_paste"),shape:he("rotated_pill"),pcb_solder_paste_id:Mn("pcb_solder_paste"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),x:Sn,y:Sn,width:Ae(),height:Ae(),radius:Ae(),ccw_rotation:Oh,layer:Js,pcb_component_id:k().optional(),pcb_smtpad_id:k().optional()}),sji=we({type:he("pcb_solder_paste"),shape:he("oval"),pcb_solder_paste_id:Mn("pcb_solder_paste"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),x:Sn,y:Sn,width:Ae(),height:Ae(),layer:Js,pcb_component_id:k().optional(),pcb_smtpad_id:k().optional()}),aji=Upe.extend({type:he("pcb_solder_paste"),pcb_solder_paste_id:Mn("pcb_solder_paste"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),holes:it(Upe.shape.points).optional(),layer:Js,pcb_component_id:k().optional(),pcb_smtpad_id:k().optional()}),Yto=un([tji,nji,oji,rji,iji,sji,aji]).describe("Defines solderpaste on the PCB");Ft(!0);Ft(!0);Ft(!0);Ft(!0);Ft(!0);Ft(!0);Ft(!0);var IMe=we({type:he("pcb_soldermask_opening"),pcb_soldermask_opening_id:Mn("pcb_soldermask_opening"),layer:Js.pipe(v_),pcb_component_id:k().optional(),pcb_group_id:k().optional(),subcircuit_id:k().optional()}),Gto=ss("shape",[npt.extend(IMe.shape),PMe.extend(IMe.shape),opt.extend(IMe.shape),Upe.extend(IMe.shape)]).describe("An explicit opening in top or bottom solder mask or flex coverlay, independent of pads. Removes mask without adding copper or solder paste.");Ft(!0);var Uto=we({type:he("pcb_text"),pcb_text_id:Mn("pcb_text"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),text:k(),center:lr,layer:Js,width:Wo,height:Wo,lines:Ae(),align:Pt(["bottom-left"])}).describe("Defines text on the PCB");Ft(!0);var HZn=Sn.pipe(Ae().finite().positive()),Wto=we({route_type:he("wire"),x:Sn,y:Sn,width:Sn,start_width:HZn.optional(),end_width:HZn.optional(),width_interpolation_mode:Pt(["linear","quadratic"]).optional(),copper_pour_id:k().optional(),is_inside_copper_pour:Be().optional(),start_pcb_port_id:k().optional(),end_pcb_port_id:k().optional(),layer:Js}).superRefine((e,t)=>{let n=[e.start_width,e.end_width,e.width_interpolation_mode].filter((o)=>o!==void 0).length;if(n===0)return;if(n!==3)t.addIssue({code:Vt.custom,message:"Wire taper requires start_width, end_width and width_interpolation_mode together"});if(e.width!==e.start_width)t.addIssue({code:Vt.custom,path:["start_width"],message:"start_width must equal width"});if(!Number.isFinite(e.x)||!Number.isFinite(e.y))t.addIssue({code:Vt.custom,message:"Tapered wire coordinates must be finite"})}),Xto=we({route_type:he("via"),x:Sn,y:Sn,copper_pour_id:k().optional(),is_inside_copper_pour:Be().optional(),hole_diameter:Sn.optional(),outer_diameter:Sn.optional(),tented_on_top:Be().optional(),tented_on_bottom:Be().optional(),from_layer:Js,to_layer:Js}),jto=we({route_type:he("through_pad"),start:lr,end:lr,width:Sn,start_layer:Js,end_layer:Js,pcb_smtpad_id:k().optional(),pcb_plated_hole_id:k().optional()}),Kto=un([Wto,Xto,jto]),$to=we({type:he("pcb_trace"),source_trace_id:k().optional(),pcb_component_id:k().optional(),pcb_trace_id:Mn("pcb_trace"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),route_thickness_mode:Pt(["constant","interpolated"]).default("constant").optional(),route_order_index:Ae().optional(),should_round_corners:Be().optional(),trace_length:Ae().optional(),is_antenna_trace:Be().optional(),highlight_color:k().optional(),route:it(Kto).superRefine((e,t)=>{for(let[n,o]of e.entries()){if(o.route_type!=="wire"||o.width_interpolation_mode===void 0)continue;let r=e[n+1],i=r?.route_type==="through_pad"?r.start:r,s=r?.route_type==="wire"?r.layer:r?.route_type==="via"?r.from_layer:r?.start_layer,a=i?Math.hypot(i.x-o.x,i.y-o.y):NaN;if(!Number.isFinite(a)||a<=0||s!==o.layer)t.addIssue({code:Vt.custom,path:[n],message:"Tapered wire must lead to a distinct finite next point on the same layer"})}})}).describe("Defines a trace on the PCB");Ft(!0);Ft(!0);var qto=we({type:he("pcb_trace_warning"),pcb_trace_warning_id:Mn("pcb_trace_warning"),warning_type:he("pcb_trace_warning").default("pcb_trace_warning"),message:k(),center:lr.optional(),pcb_trace_id:k(),source_trace_id:k(),pcb_component_ids:it(k()),pcb_port_ids:it(k()),subcircuit_id:k().optional()}).describe("Defines a trace warning on the PCB");Ft(!0);var Jto=we({type:he("pcb_trace_too_long_error"),pcb_trace_too_long_error_id:Mn("pcb_trace_too_long_error"),error_type:he("pcb_trace_too_long_error").default("pcb_trace_too_long_error"),message:k(),pcb_trace_id:k(),source_net_id:k().optional(),source_trace_id:k().optional(),actual_trace_length:Sn,maximum_trace_length:Sn,subcircuit_id:k().optional()}).describe("Error emitted when a PCB trace is longer than its maximum allowed length");Ft(!0);var Zto=yc.extend({type:he("pcb_bus_length_skew_error"),pcb_bus_length_skew_error_id:Mn("pcb_bus_length_skew_error"),error_type:he("pcb_bus_length_skew_error").default("pcb_bus_length_skew_error"),source_bus_id:k(),source_trace_ids:it(k()),pcb_trace_ids:it(k()),actual_length_skew:Ae().nonnegative().finite(),maximum_length_skew:Ae().nonnegative().finite(),subcircuit_id:k().optional()});Ft(!0);var eno=we({type:he("pcb_trace_too_long_warning"),pcb_trace_too_long_warning_id:Mn("pcb_trace_too_long_warning"),warning_type:he("pcb_trace_too_long_warning").default("pcb_trace_too_long_warning"),message:k(),pcb_trace_id:k(),source_net_id:k().optional(),source_trace_id:k().optional(),actual_trace_length:Sn,maximum_trace_length:Sn,subcircuit_id:k().optional()}).describe("Warning emitted when a PCB trace is longer than its maximum allowed length");Ft(!0);var tno=we({type:he("pcb_trace_too_many_vias_warning"),pcb_trace_too_many_vias_warning_id:Mn("pcb_trace_too_many_vias_warning"),warning_type:he("pcb_trace_too_many_vias_warning").default("pcb_trace_too_many_vias_warning"),message:k(),pcb_trace_id:k(),source_net_id:k().optional(),source_trace_id:k().optional(),actual_via_count:Ae().int().nonnegative(),maximum_via_count:Ae().int().nonnegative(),subcircuit_id:k().optional()}).describe("Warning emitted when a PCB trace has more vias than its maximum allowed count");Ft(!0);var LG=yc.extend({type:he("pcb_bus_routing_constraint_error"),pcb_bus_routing_constraint_error_id:Mn("pcb_bus_routing_constraint_error"),error_type:he("pcb_bus_routing_constraint_error").default("pcb_bus_routing_constraint_error"),source_bus_id:k(),source_trace_ids:it(k()).min(1),pcb_trace_ids:it(k()),subcircuit_id:k().optional()}),nno=ss("routing_rule",[LG.extend({routing_rule:he("length_skew"),actual_length_skew:Ae().nonnegative().finite(),maximum_length_skew:Ae().nonnegative().finite()}),LG.extend({routing_rule:he("min_length"),actual_trace_length:Ae().nonnegative().finite(),minimum_trace_length:Ae().finite()}),LG.extend({routing_rule:he("max_length"),actual_trace_length:Ae().nonnegative().finite(),maximum_trace_length:Ae().finite()}),LG.extend({routing_rule:he("target_length"),actual_trace_length:Ae().nonnegative().finite(),target_trace_length:Ae().finite(),length_tolerance:Ae().nonnegative().finite()}),LG.extend({routing_rule:he("pcb_trace_spacing"),other_pcb_trace_id:k(),other_source_trace_id:k().optional(),actual_centerline_spacing:Ae().nonnegative().finite(),minimum_centerline_spacing:Ae().positive().finite()}),LG.extend({routing_rule:he("pcb_spacing_to_other_signals"),other_pcb_trace_id:k(),other_source_trace_id:k().optional(),actual_centerline_spacing:Ae().nonnegative().finite(),minimum_centerline_spacing:Ae().positive().finite()}),LG.extend({routing_rule:he("impedance_target"),target_impedance:Ae().positive().finite(),minimum_impedance:Ae().positive().finite().optional(),maximum_impedance:Ae().positive().finite().optional()})]).superRefine((e,t)=>{if(e.routing_rule!=="impedance_target")return;if(e.minimum_impedance===void 0&&e.maximum_impedance===void 0)t.addIssue({code:Vt.custom,path:["minimum_impedance"],message:"Provide an impedance bound"});if(e.minimum_impedance!==void 0&&e.maximum_impedance!==void 0&&e.minimum_impedance>e.maximum_impedance)t.addIssue({code:Vt.custom,path:["maximum_impedance"],message:"Impedance bounds must be ordered"})}).describe("A declared bus or differential-pair routing constraint is violated.");Ft(!0);var Vpe=we({type:he("pcb_bus_routing_constraint_warning"),pcb_bus_routing_constraint_warning_id:Mn("pcb_bus_routing_constraint_warning"),warning_type:he("pcb_bus_routing_constraint_warning").default("pcb_bus_routing_constraint_warning"),source_bus_id:k(),source_trace_ids:it(k()).min(1),pcb_trace_ids:it(k()),message:k(),subcircuit_id:k().optional()}).describe("A declared bus or pair constraint could not be verified; this is not a pass."),ono=ss("routing_rule",[Vpe.extend({routing_rule:he("route_geometry")}),Vpe.extend({routing_rule:he("reference_geometry")}),Vpe.extend({routing_rule:he("spacing_geometry")}),Vpe.extend({routing_rule:he("target_length")}),Vpe.extend({routing_rule:he("physical_impedance")})]);Ft(!0);var rno=yc.extend({type:he("pcb_trace_error"),pcb_trace_error_id:Mn("pcb_trace_error"),error_type:he("pcb_trace_error").default("pcb_trace_error"),center:lr.optional(),pcb_trace_id:k(),source_trace_id:k(),pcb_component_ids:it(k()),pcb_port_ids:it(k()),subcircuit_id:k().optional()}).describe("Defines a trace error on the PCB");Ft(!0);var ino=yc.extend({type:he("pcb_trace_missing_error"),pcb_trace_missing_error_id:Mn("pcb_trace_missing_error"),error_type:he("pcb_trace_missing_error").default("pcb_trace_missing_error"),center:lr.optional(),source_trace_id:k(),pcb_component_ids:it(k()),pcb_port_ids:it(k()),subcircuit_id:k().optional()}).describe("Defines an error when a source trace has no corresponding PCB trace");Ft(!0);var sno=yc.extend({type:he("pcb_port_not_matched_error"),pcb_error_id:Mn("pcb_error"),error_type:he("pcb_port_not_matched_error").default("pcb_port_not_matched_error"),pcb_component_ids:it(k()),subcircuit_id:k().optional()}).describe("Defines a trace error on the PCB where a port is not matched");Ft(!0);var ano=yc.extend({type:he("pcb_port_not_connected_error"),pcb_port_not_connected_error_id:Mn("pcb_port_not_connected_error"),error_type:he("pcb_port_not_connected_error").default("pcb_port_not_connected_error"),pcb_port_ids:it(k()),pcb_component_ids:it(k()),subcircuit_id:k().optional()}).describe("Defines an error when a pcb port is not connected to any trace");Ft(!0);var cno=we({type:he("pcb_net"),pcb_net_id:Mn("pcb_net"),source_net_id:k().optional(),highlight_color:k().optional()}).describe("Defines a net on the PCB");Ft(!0);var lno=we({type:he("pcb_via"),pcb_via_id:Mn("pcb_via"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),subcircuit_connectivity_map_key:k().optional(),x:Sn,y:Sn,outer_diameter:Sn.default("0.6mm"),hole_diameter:Sn.default("0.25mm"),topmost_drill_layer:Js.optional(),bottommost_drill_layer:Js.optional(),through_hole:Be().optional(),from_layer:Js.optional(),to_layer:Js.optional(),layers:it(Js),pcb_port_ids:it(k()).optional(),pcb_trace_id:k().optional(),source_trace_id:k().optional(),source_net_id:k().min(1).optional(),net_is_assignable:Be().optional(),net_assigned:Be().optional(),is_tented:Be().optional(),tented_on_top:Be().optional(),tented_on_bottom:Be().optional()}).transform(({is_tented:e,...t})=>{if(e!==void 0)t.tented_on_top??=e,t.tented_on_bottom??=e;return t}).describe("Defines a via on the PCB");Ft(!0);var hno=we({type:he("pcb_board"),pcb_board_id:Mn("pcb_board"),pcb_panel_id:k().optional(),carrier_pcb_board_id:k().optional(),is_subcircuit:Be().optional(),subcircuit_id:k().optional(),is_mounted_to_carrier_board:Be().optional(),is_via_in_pad_allowed:Be().optional(),default_via_tented_on_top:Be().optional(),default_via_tented_on_bottom:Be().optional(),default_via_plugged:Be().optional(),width:Wo.optional(),height:Wo.optional(),center:lr,display_offset_x:k().optional().describe("How to display the x offset for this board, usually corresponding with how the user specified it"),display_offset_y:k().optional().describe("How to display the y offset for this board, usually corresponding with how the user specified it"),thickness:Wo.optional().default(1.4),num_layers:Ae().optional().default(4),allow_blind_and_buried_vias:Be().optional().describe("Whether autorouters may generate blind and buried vias. False restricts newly generated vias to the full board stack."),outline:it(lr).optional(),shape:Pt(["rect","polygon"]).optional(),material:Pt(["fr4","fr1","flex"]).default("fr4"),solder_mask_color:k().optional(),silkscreen_color:k().optional(),anchor_position:lr.optional(),anchor_alignment:eT.optional(),position_mode:Pt(["relative_to_panel_anchor","none"]).optional()}).merge(Pto).describe("Defines the board outline of the PCB");Ft(!0);var FZn=lr.extend({x:Wo.pipe(Ae().finite()),y:Wo.pipe(Ae().finite())}),dno=we({type:he("pcb_bend"),pcb_bend_id:Mn("pcb_bend"),pcb_board_id:k(),pcb_group_id:k().optional(),subcircuit_id:k().optional(),name:k().optional(),start:FZn,end:FZn,bend_angle:Oh.pipe(Ae().finite()),bend_radius:Wo.pipe(Ae().finite().positive()),bend_side:Pt(["left","right"])}).refine(({start:e,end:t})=>e.x!==t.x||e.y!==t.y,{message:"Bend centerline endpoints must be distinct",path:["end"]}).describe("Defines a finite-radius bend on a flat PCB for runtime CAD folding");Ft(!0);var ept=Wo.pipe(Ae().finite().positive()),uno=lr.extend({x:Wo.pipe(Ae().finite()),y:Wo.pipe(Ae().finite())}),pno=we({type:he("pcb_stiffener"),pcb_stiffener_id:Mn("pcb_stiffener"),pcb_board_id:k(),pcb_group_id:k().optional(),subcircuit_id:k().optional(),name:k().optional(),layer:Pt(["top","bottom"]),material:Pt(["fr4","polyimide","stainless_steel","aluminum"]),thickness:ept,adhesive_thickness:Wo.pipe(Ae().finite().nonnegative()).optional()}),mno=pno.extend({shape:he("rect"),center:uno,rotation:Oh.pipe(Ae().finite()).optional(),width:ept,height:ept,outline:sm().optional()});Ft(!0);var _no=pno.extend({shape:he("polygon"),outline:it(uno).min(3).refine((e)=>{let t=e.reduce((n,o,r)=>{let i=e[(r+1)%e.length];return n+o.x*i.y-i.x*o.y},0);return Number.isFinite(t)&&t!==0},"Stiffener outline must enclose a nonzero area"),center:sm().optional(),rotation:sm().optional(),width:sm().optional(),height:sm().optional()});Ft(!0);var gno=ss("shape",[mno,_no]).describe("Defines bonded mechanical PCB reinforcement without adding copper layers");Ft(!0);var Ano=we({type:he("pcb_panel"),pcb_panel_id:Mn("pcb_panel"),width:Wo,height:Wo,center:lr,thickness:Wo.optional().default(1.4),covered_with_solder_mask:Be().optional().default(!0)}).describe("Defines a PCB panel that can contain multiple boards");Ft(!0);var fno=yc.extend({type:he("pcb_placement_error"),pcb_placement_error_id:Mn("pcb_placement_error"),error_type:he("pcb_placement_error").default("pcb_placement_error"),subcircuit_id:k().optional()}).describe("Defines a placement error on the PCB");Ft(!0);var yno=yc.extend({type:he("pcb_packing_error"),pcb_packing_error_id:Mn("pcb_packing_error"),error_type:he("pcb_packing_error").default("pcb_packing_error"),pcb_group_id:k().optional(),subcircuit_id:k().optional()}).describe("Defines a failure to pack PCB components within layout bounds");Ft(!0);var xno=yc.extend({type:he("pcb_panelization_placement_error"),pcb_panelization_placement_error_id:Mn("pcb_panelization_placement_error"),error_type:he("pcb_panelization_placement_error").default("pcb_panelization_placement_error"),pcb_panel_id:k().optional(),pcb_board_id:k().optional(),subcircuit_id:k().optional()}).describe("Defines a panelization placement error on the PCB");Ft(!0);var Cno=we({type:he("pcb_trace_hint"),pcb_trace_hint_id:Mn("pcb_trace_hint"),pcb_port_id:k(),pcb_component_id:k(),route:it(Sto),subcircuit_id:k().optional()}).describe("A hint that can be used during generation of a PCB trace");Ft(!0);var bno=we({type:he("pcb_silkscreen_line"),pcb_silkscreen_line_id:Mn("pcb_silkscreen_line"),pcb_component_id:k(),pcb_group_id:k().optional(),subcircuit_id:k().optional(),stroke_width:Sn.default("0.1mm"),x1:Sn,y1:Sn,x2:Sn,y2:Sn,layer:v_}).describe("Defines a silkscreen line on the PCB");Ft(!0);var Ino=we({type:he("pcb_silkscreen_path"),pcb_silkscreen_path_id:Mn("pcb_silkscreen_path"),pcb_component_id:k(),pcb_group_id:k().optional(),subcircuit_id:k().optional(),layer:v_,route:it(lr),stroke_width:Wo}).describe("Defines a silkscreen path on the PCB");Ft(!0);var vno=we({type:he("pcb_silkscreen_text"),pcb_silkscreen_text_id:Mn("pcb_silkscreen_text"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),font:he("tscircuit2024").default("tscircuit2024"),font_size:Sn.default("0.2mm"),pcb_component_id:k(),text:k(),is_knockout:Be().default(!1).optional(),knockout_padding:we({left:Wo,top:Wo,bottom:Wo,right:Wo}).default({left:"0.2mm",top:"0.2mm",bottom:"0.2mm",right:"0.2mm"}).optional(),ccw_rotation:Ae().optional(),layer:Js,is_mirrored:Be().default(!1).optional(),anchor_position:lr.default({x:0,y:0}),anchor_alignment:eT.default("center")}).describe("Defines silkscreen text on the PCB");Ft(!0);var Sno=we({type:he("pcb_copper_text"),pcb_copper_text_id:Mn("pcb_copper_text"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),font:he("tscircuit2024").default("tscircuit2024"),font_size:Sn.default("0.2mm"),pcb_component_id:k(),text:k(),is_knockout:Be().default(!1).optional(),knockout_padding:we({left:Wo,top:Wo,bottom:Wo,right:Wo}).default({left:"0.2mm",top:"0.2mm",bottom:"0.2mm",right:"0.2mm"}).optional(),ccw_rotation:Ae().optional(),layer:Js,is_mirrored:Be().default(!1).optional(),anchor_position:lr.default({x:0,y:0}),anchor_alignment:eT.default("center")}).describe("Defines copper text on the PCB");Ft(!0);var Pno=we({type:he("pcb_silkscreen_rect"),pcb_silkscreen_rect_id:Mn("pcb_silkscreen_rect"),pcb_component_id:k(),pcb_group_id:k().optional(),subcircuit_id:k().optional(),center:lr,width:Wo,height:Wo,layer:Js,stroke_width:Wo.default("1mm"),corner_radius:Wo.optional(),is_filled:Be().default(!0).optional(),has_stroke:Be().optional(),is_stroke_dashed:Be().optional(),ccw_rotation:Ae().optional()}).describe("Defines a silkscreen rect on the PCB");Ft(!0);var Eno=we({type:he("pcb_silkscreen_circle"),pcb_silkscreen_circle_id:Mn("pcb_silkscreen_circle"),pcb_component_id:k(),pcb_group_id:k().optional(),subcircuit_id:k().optional(),center:lr,radius:Wo,layer:v_,stroke_width:Wo.default("1mm"),is_filled:Be().optional()}).describe("Defines a silkscreen circle on the PCB");Ft(!0);var Mno=we({type:he("pcb_silkscreen_oval"),pcb_silkscreen_oval_id:Mn("pcb_silkscreen_oval"),pcb_component_id:k(),pcb_group_id:k().optional(),subcircuit_id:k().optional(),center:lr,radius_x:Sn,radius_y:Sn,layer:v_,ccw_rotation:Oh.optional()}).describe("Defines a silkscreen oval on the PCB");Ft(!0);var cji=we({type:he("pcb_silkscreen_graphic"),pcb_silkscreen_graphic_id:Mn("pcb_silkscreen_graphic"),pcb_component_id:k(),pcb_group_id:k().optional(),subcircuit_id:k().optional(),layer:v_,image_asset:EMe.optional()}),wno=cji.extend({shape:he("brep"),brep_shape:Tpt}).describe("Defines a BRep silkscreen graphic on the PCB");Ft(!0);var Bno=ss("shape",[wno]).describe("Defines a silkscreen graphic on the PCB");Ft(!0);var Tno=we({type:he("pcb_silkscreen_pill"),pcb_silkscreen_pill_id:Mn("pcb_silkscreen_pill"),pcb_component_id:k(),pcb_group_id:k().optional(),subcircuit_id:k().optional(),center:lr,width:Wo,height:Wo,layer:Js,ccw_rotation:Ae().optional()}).describe("Defines a silkscreen pill on the PCB");Ft(!0);var Dno=we({type:he("pcb_fabrication_note_text"),pcb_fabrication_note_text_id:Mn("pcb_fabrication_note_text"),subcircuit_id:k().optional(),pcb_group_id:k().optional(),font:he("tscircuit2024").default("tscircuit2024"),font_size:Sn.default("1mm"),pcb_component_id:k(),text:k(),ccw_rotation:Ae().optional(),layer:v_,anchor_position:lr.default({x:0,y:0}),anchor_alignment:Pt(["center","top_left","top_right","bottom_left","bottom_right"]).default("center"),color:k().optional()}).describe("Defines a fabrication note in text on the PCB, useful for leaving notes for assemblers or fabricators");Ft(!0);var Nno=we({type:he("pcb_fabrication_note_path"),pcb_fabrication_note_path_id:Mn("pcb_fabrication_note_path"),pcb_component_id:k(),subcircuit_id:k().optional(),layer:Js,route:it(lr),stroke_width:Wo,color:k().optional(),is_filled:Be().optional(),has_stroke:Be().optional()}).describe("Defines a fabrication path on the PCB for fabricators or assemblers");Ft(!0);var Rno=we({type:he("pcb_fabrication_note_rect"),pcb_fabrication_note_rect_id:Mn("pcb_fabrication_note_rect"),pcb_component_id:k(),pcb_group_id:k().optional(),subcircuit_id:k().optional(),center:lr,width:Wo,height:Wo,layer:v_,stroke_width:Wo.default("0.1mm"),corner_radius:Wo.optional(),is_filled:Be().optional(),has_stroke:Be().optional(),is_stroke_dashed:Be().optional(),color:k().optional()}).describe("Defines a fabrication note rectangle on the PCB");Ft(!0);var Qno=we({type:he("pcb_fabrication_note_dimension"),pcb_fabrication_note_dimension_id:Mn("pcb_fabrication_note_dimension"),pcb_component_id:k(),pcb_group_id:k().optional(),subcircuit_id:k().optional(),layer:v_,from:lr,to:lr,text:k().optional(),text_ccw_rotation:Ae().optional(),offset:Wo.optional(),offset_distance:Wo.optional(),offset_direction:we({x:Ae(),y:Ae()}).optional(),font:he("tscircuit2024").default("tscircuit2024"),font_size:Wo.default("1mm"),color:k().optional(),arrow_size:Wo.default("1mm")}).describe("Defines a measurement annotation within PCB fabrication notes");Ft(!0);var kno=we({type:he("pcb_note_text"),pcb_note_text_id:Mn("pcb_note_text"),pcb_component_id:k().optional(),pcb_group_id:k().optional(),subcircuit_id:k().optional(),name:k().optional(),font:he("tscircuit2024").default("tscircuit2024"),font_size:Sn.default("1mm"),text:k().optional(),anchor_position:lr.default({x:0,y:0}),anchor_alignment:Pt(["center","top_left","top_right","bottom_left","bottom_right"]).default("center"),layer:v_.default("top"),is_mirrored_from_top_view:Be().optional(),color:k().optional()}).describe("Defines a documentation note in text on the PCB");Ft(!0);var Lno=we({type:he("pcb_note_rect"),pcb_note_rect_id:Mn("pcb_note_rect"),pcb_component_id:k().optional(),pcb_group_id:k().optional(),subcircuit_id:k().optional(),name:k().optional(),text:k().optional(),center:lr,width:Wo,height:Wo,layer:v_.default("top"),stroke_width:Wo.default("0.1mm"),corner_radius:Wo.optional(),is_filled:Be().optional(),has_stroke:Be().optional(),is_stroke_dashed:Be().optional(),color:k().optional()}).describe("Defines a rectangular documentation note on the PCB");Ft(!0);var Hno=we({type:he("pcb_note_path"),pcb_note_path_id:Mn("pcb_note_path"),pcb_component_id:k().optional(),pcb_group_id:k().optional(),subcircuit_id:k().optional(),name:k().optional(),text:k().optional(),route:it(lr),layer:v_.default("top"),stroke_width:Wo.default("0.1mm"),color:k().optional()}).describe("Defines a polyline documentation note on the PCB");Ft(!0);var Fno=we({type:he("pcb_note_line"),pcb_note_line_id:Mn("pcb_note_line"),pcb_component_id:k().optional(),pcb_group_id:k().optional(),subcircuit_id:k().optional(),name:k().optional(),text:k().optional(),x1:Sn,y1:Sn,x2:Sn,y2:Sn,layer:v_.default("top"),stroke_width:Sn.default("0.1mm"),color:k().optional(),is_dashed:Be().optional()}).describe("Defines a straight documentation note line on the PCB");Ft(!0);var zno=we({type:he("pcb_note_dimension"),pcb_note_dimension_id:Mn("pcb_note_dimension"),pcb_component_id:k().optional(),pcb_group_id:k().optional(),subcircuit_id:k().optional(),name:k().optional(),from:lr,to:lr,text:k().optional(),text_ccw_rotation:Ae().optional(),offset_distance:Wo.optional(),offset_direction:we({x:Ae(),y:Ae()}).optional(),font:he("tscircuit2024").default("tscircuit2024"),font_size:Wo.default("1mm"),layer:v_.default("top"),color:k().optional(),arrow_size:Wo.default("1mm")}).describe("Defines a measurement annotation within PCB documentation notes");Ft(!0);var Ono=yc.extend({type:he("pcb_footprint_overlap_error"),pcb_error_id:Mn("pcb_error"),error_type:he("pcb_footprint_overlap_error").default("pcb_footprint_overlap_error"),pcb_smtpad_ids:it(k()).optional(),pcb_plated_hole_ids:it(k()).optional(),pcb_hole_ids:it(k()).optional(),pcb_keepout_ids:it(k()).optional()}).describe("Error emitted when a pcb footprint overlaps with another element");Ft(!0);var Vno=yc.extend({type:he("pcb_courtyard_overlap_error"),pcb_error_id:Mn("pcb_error"),error_type:he("pcb_courtyard_overlap_error").default("pcb_courtyard_overlap_error"),pcb_component_ids:kC([k(),k()])}).describe("Error emitted when the courtyard (CrtYd) of one PCB component overlaps with the courtyard of another");Ft(!0);var Yno=we({type:he("pcb_keepout"),shape:he("outline"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),outline:it(lr).min(2),stroke_width:Wo,pcb_keepout_id:k(),layers:it(k()),description:k().optional(),excluded_pcb_component_ids:it(k()).optional(),warning_only:Be().optional(),allow_traces:Be().optional(),allow_placements:Be().optional()}),Gno=we({type:he("pcb_keepout"),shape:he("rect"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),center:lr,width:Sn,height:Sn,pcb_keepout_id:k(),layers:it(k()),description:k().optional(),excluded_pcb_component_ids:it(k()).optional(),warning_only:Be().optional(),allow_traces:Be().optional(),allow_placements:Be().optional()}).or(we({type:he("pcb_keepout"),shape:he("circle"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),center:lr,radius:Sn,pcb_keepout_id:k(),layers:it(k()),description:k().optional(),excluded_pcb_component_ids:it(k()).optional(),warning_only:Be().optional(),allow_traces:Be().optional(),allow_placements:Be().optional()})).or(Yno);Ft(!0);Ft(!0);var Uno=we({type:he("pcb_keepout_overlap_warning"),pcb_keepout_overlap_warning_id:Mn("pcb_keepout_overlap_warning"),warning_type:he("pcb_keepout_overlap_warning").default("pcb_keepout_overlap_warning"),message:k(),pcb_keepout_id:k(),pcb_component_ids:it(k()).optional(),pcb_trace_ids:it(k()).optional(),pcb_smtpad_ids:it(k()).optional(),pcb_plated_hole_ids:it(k()).optional(),pcb_via_ids:it(k()).optional(),center:lr.optional(),subcircuit_id:k().optional()}).describe("Warning emitted when copper overlaps a PCB keepout with warning_only enabled");Ft(!0);var DMe=we({type:he("pcb_cutout"),pcb_cutout_id:Mn("pcb_cutout"),pcb_component_id:k().optional(),pcb_group_id:k().optional(),subcircuit_id:k().optional(),pcb_board_id:k().optional(),pcb_panel_id:k().optional()}),Wno=DMe.extend({shape:he("rect"),center:lr,width:Wo,height:Wo,rotation:Oh.optional(),corner_radius:Wo.optional()});Ft(!0);var Xno=DMe.extend({shape:he("circle"),center:lr,radius:Wo});Ft(!0);var jno=DMe.extend({shape:he("polygon"),points:it(lr)});Ft(!0);var Kno=DMe.extend({shape:he("path"),route:it(lr),slot_width:Wo,slot_length:Wo.optional(),space_between_slots:Wo.optional(),slot_corner_radius:Wo.optional()});Ft(!0);var $no=ss("shape",[Wno,Xno,jno,Kno]).describe("Defines a cutout on the PCB, removing board material.");Ft(!0);var qno=yc.extend({type:he("pcb_missing_footprint_error"),pcb_missing_footprint_error_id:Mn("pcb_missing_footprint_error"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),error_type:he("pcb_missing_footprint_error").default("pcb_missing_footprint_error"),source_component_id:k()}).describe("Defines a missing footprint error on the PCB");Ft(!0);var Jno=yc.extend({type:he("external_footprint_load_error"),external_footprint_load_error_id:Mn("external_footprint_load_error"),pcb_component_id:k(),source_component_id:k(),pcb_group_id:k().optional(),subcircuit_id:k().optional(),footprinter_string:k().optional(),error_type:he("external_footprint_load_error").default("external_footprint_load_error")}).describe("Defines an error when an external footprint fails to load");Ft(!0);var Zno=yc.extend({type:he("circuit_json_footprint_load_error"),circuit_json_footprint_load_error_id:Mn("circuit_json_footprint_load_error"),pcb_component_id:k(),source_component_id:k(),pcb_group_id:k().optional(),subcircuit_id:k().optional(),error_type:he("circuit_json_footprint_load_error").default("circuit_json_footprint_load_error"),circuit_json:it(Jh()).optional()}).describe("Defines an error when a circuit JSON footprint fails to load");Ft(!0);var eoo=we({type:he("pcb_group"),pcb_group_id:Mn("pcb_group"),source_group_id:k(),is_subcircuit:Be().optional(),subcircuit_id:k().optional(),width:Wo.optional(),height:Wo.optional(),center:lr,display_offset_x:k().optional().describe("How to display the x offset for this group, usually corresponding with how the user specified it"),display_offset_y:k().optional().describe("How to display the y offset for this group, usually corresponding with how the user specified it"),outline:it(lr).optional(),anchor_position:lr.optional(),anchor_alignment:eT.default("center"),position_mode:Pt(["packed","relative_to_group_anchor","none"]).optional(),positioned_relative_to_pcb_group_id:k().optional(),positioned_relative_to_pcb_board_id:k().optional(),pcb_component_ids:it(k()),child_layout_mode:Pt(["packed","none"]).optional(),name:k().optional(),description:k().optional(),layout_mode:k().optional(),autorouter_configuration:we({trace_clearance:Wo}).optional(),autorouter_used_string:k().optional()}).describe("Defines a group of components on the PCB");Ft(!0);var too=yc.extend({type:he("pcb_autorouting_error"),pcb_error_id:Mn("pcb_autorouting_error"),error_type:he("pcb_autorouting_error").default("pcb_autorouting_error"),subcircuit_id:k().optional()}).describe("The autorouting has failed to route a portion of the board");Ft(!0);var noo=yc.extend({type:he("pcb_preflight_routing_error"),pcb_preflight_routing_error_id:Mn("pcb_preflight_routing_error"),error_type:he("pcb_preflight_routing_error").default("pcb_preflight_routing_error"),error_code:k(),subcircuit_id:k().optional(),pcb_group_id:k().optional(),routing_phase_index:Ae().int().optional(),phase_name:k().optional(),source_trace_ids:it(k()).optional(),pcb_component_ids:it(k()).optional(),pcb_port_ids:it(k()).optional(),related_error_ids:it(k()).optional(),measurements:gs(Ae().finite()).optional()});Ft(!0);var ooo=we({type:he("pcb_manual_edit_conflict_warning"),pcb_manual_edit_conflict_warning_id:Mn("pcb_manual_edit_conflict_warning"),warning_type:he("pcb_manual_edit_conflict_warning").default("pcb_manual_edit_conflict_warning"),message:k(),pcb_component_id:k(),pcb_group_id:k().optional(),subcircuit_id:k().optional(),source_component_id:k()}).describe("Warning emitted when a component has both manual placement and explicit pcbX/pcbY coordinates");Ft(!0);var zZn=Pt(["x-","x+","y+","y-"]),roo=we({type:he("pcb_connector_not_in_accessible_orientation_warning"),pcb_connector_not_in_accessible_orientation_warning_id:Mn("pcb_connector_not_in_accessible_orientation_warning"),warning_type:he("pcb_connector_not_in_accessible_orientation_warning").default("pcb_connector_not_in_accessible_orientation_warning"),message:k(),pcb_component_id:k(),source_component_id:k().optional(),pcb_board_id:k().optional(),facing_direction:zZn,recommended_facing_direction:zZn,subcircuit_id:k().optional()}).describe("Warning emitted when a connector PCB component is facing inward toward the board and should be reoriented to an outward-facing direction");Ft(!0);var ioo=we({type:he("pcb_component_missing_courtyard_warning"),pcb_component_missing_courtyard_warning_id:Mn("pcb_component_missing_courtyard_warning"),warning_type:he("pcb_component_missing_courtyard_warning").default("pcb_component_missing_courtyard_warning"),message:k(),pcb_component_id:k(),source_component_id:k().optional(),subcircuit_id:k().optional()}).describe("Warning emitted when a PCB component has no courtyard geometry");Ft(!0);var soo=we({type:he("supplier_footprint_mismatch_warning"),supplier_footprint_mismatch_warning_id:Mn("supplier_footprint_mismatch_warning"),warning_type:he("supplier_footprint_mismatch_warning").default("supplier_footprint_mismatch_warning"),message:k(),source_component_id:k(),pcb_component_id:k().optional(),pcb_group_id:k().optional(),subcircuit_id:k().optional(),supplier_name:Wpe.optional(),supplier_part_number:k().optional(),supplier_footprint_url:k().optional(),footprint_copper_intersection_over_union:Ae()}).describe("Warning emitted when a supplier part footprint does not match the expected footprint");Ft(!0);var aoo=we({type:he("pcb_fabricator_extra_charge_warning"),pcb_fabricator_extra_charge_warning_id:Mn("pcb_fabricator_extra_charge_warning"),warning_type:he("pcb_fabricator_extra_charge_warning").default("pcb_fabricator_extra_charge_warning"),message:k(),fabricator_preset:k(),pcb_board_id:k().optional(),pcb_via_ids:it(k()).optional(),subcircuit_id:k().optional()}).describe("Warning that a design feature incurs an extra charge for the selected fabricator preset, such as via hole diameters below 0.3 mm with JLCPCB economy or standard presets.");Ft(!0);var coo=we({type:he("pcb_breakout_point"),pcb_breakout_point_id:Mn("pcb_breakout_point"),pcb_group_id:k(),subcircuit_id:k().optional(),source_trace_id:k().optional(),source_port_id:k().optional(),source_net_id:k().optional(),layer:Js.optional(),x:Sn,y:Sn}).describe("Defines a routing target within a pcb_group for a source_trace or source_net");Ft(!0);var loo=we({type:he("pcb_ground_plane"),pcb_ground_plane_id:Mn("pcb_ground_plane"),source_pcb_ground_plane_id:k(),source_net_id:k(),pcb_group_id:k().optional(),subcircuit_id:k().optional()}).describe("Defines a ground plane on the PCB");Ft(!0);var hoo=we({type:he("pcb_ground_plane_region"),pcb_ground_plane_region_id:Mn("pcb_ground_plane_region"),pcb_ground_plane_id:k(),pcb_group_id:k().optional(),subcircuit_id:k().optional(),layer:Js,points:it(lr)}).describe("Defines a polygon region of a ground plane");Ft(!0);var doo=we({type:he("pcb_thermal_spoke"),pcb_thermal_spoke_id:Mn("pcb_thermal_spoke"),pcb_ground_plane_id:k(),shape:k(),spoke_count:Ae(),spoke_thickness:Sn,spoke_inner_diameter:Sn,spoke_outer_diameter:Sn,pcb_plated_hole_id:k().optional(),subcircuit_id:k().optional()}).describe("Pattern for connecting a ground plane to a plated hole");Ft(!0);var Dpt=we({type:he("pcb_copper_pour"),pcb_copper_pour_id:Mn("pcb_copper_pour"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),layer:Js,source_net_id:k().optional(),covered_with_solder_mask:Be().optional().default(!0)}),uoo=Dpt.extend({shape:he("rect"),center:lr,width:Wo,height:Wo,rotation:Oh.optional()});Ft(!0);var poo=Dpt.extend({shape:he("brep"),brep_shape:Tpt});Ft(!0);var moo=Dpt.extend({shape:he("polygon"),points:it(lr)});Ft(!0);var _oo=ss("shape",[uoo,poo,moo]).describe("Defines a copper pour on the PCB.");Ft(!0);var goo=yc.extend({type:he("pcb_component_outside_board_error"),pcb_component_outside_board_error_id:Mn("pcb_component_outside_board_error"),error_type:he("pcb_component_outside_board_error").default("pcb_component_outside_board_error"),pcb_component_id:k(),pcb_board_id:k(),component_center:lr,component_bounds:we({min_x:Ae(),max_x:Ae(),min_y:Ae(),max_y:Ae()}),subcircuit_id:k().optional(),source_component_id:k().optional()}).describe("Error emitted when a PCB component is placed outside the board boundaries");Ft(!0);var Aoo=yc.extend({type:he("pcb_component_not_on_board_edge_error"),pcb_component_not_on_board_edge_error_id:Mn("pcb_component_not_on_board_edge_error"),error_type:he("pcb_component_not_on_board_edge_error").default("pcb_component_not_on_board_edge_error"),pcb_component_id:k(),pcb_board_id:k(),component_center:lr,pad_to_nearest_board_edge_distance:Ae(),source_component_id:k().optional(),subcircuit_id:k().optional()}).describe("Error emitted when a component that must be placed on the board edge is centered away from the edge");Ft(!0);var foo=yc.extend({type:he("pcb_component_invalid_layer_error"),pcb_component_invalid_layer_error_id:Mn("pcb_component_invalid_layer_error"),error_type:he("pcb_component_invalid_layer_error").default("pcb_component_invalid_layer_error"),pcb_component_id:k().optional(),source_component_id:k(),layer:Js,subcircuit_id:k().optional()}).describe("Error emitted when a component is placed on an invalid layer (components can only be on 'top' or 'bottom' layers)");Ft(!0);var yoo=yc.extend({type:he("pcb_via_clearance_error"),pcb_error_id:Mn("pcb_error"),error_type:he("pcb_via_clearance_error").default("pcb_via_clearance_error"),pcb_via_ids:it(k()).min(2),minimum_clearance:Sn.optional(),actual_clearance:Sn.optional(),pcb_center:we({x:Ae().optional(),y:Ae().optional()}).optional(),subcircuit_id:k().optional()}).describe("Error emitted when vias are closer than the allowed clearance");Ft(!0);var xoo=yc.extend({type:he("pcb_via_trace_clearance_error"),pcb_via_trace_clearance_error_id:Mn("pcb_via_trace_clearance_error"),error_type:he("pcb_via_trace_clearance_error").default("pcb_via_trace_clearance_error"),pcb_via_id:k(),pcb_trace_id:k(),minimum_clearance:Sn.optional(),actual_clearance:Sn.optional(),center:we({x:Ae().optional(),y:Ae().optional()}).optional(),subcircuit_id:k().optional()}).describe("Error emitted when a via and trace are closer than the allowed clearance");Ft(!0);var Coo=yc.extend({type:he("pcb_pad_pad_clearance_error"),pcb_pad_pad_clearance_error_id:Mn("pcb_pad_pad_clearance_error"),error_type:he("pcb_pad_pad_clearance_error").default("pcb_pad_pad_clearance_error"),pcb_pad_ids:it(k()).min(2),minimum_clearance:Sn.optional(),actual_clearance:Sn.optional(),center:we({x:Ae().optional(),y:Ae().optional()}).optional(),subcircuit_id:k().optional()}).describe("Error emitted when pads are closer than the allowed clearance");Ft(!0);var boo=yc.extend({type:he("pcb_pad_trace_clearance_error"),pcb_pad_trace_clearance_error_id:Mn("pcb_pad_trace_clearance_error"),error_type:he("pcb_pad_trace_clearance_error").default("pcb_pad_trace_clearance_error"),pcb_pad_id:k(),pcb_trace_id:k(),minimum_clearance:Sn.optional(),actual_clearance:Sn.optional(),center:we({x:Ae().optional(),y:Ae().optional()}).optional(),subcircuit_id:k().optional()}).describe("Error emitted when a pad and trace are closer than allowed clearance");Ft(!0);var Ioo=we({type:he("pcb_courtyard_rect"),pcb_courtyard_rect_id:Mn("pcb_courtyard_rect"),pcb_component_id:k(),pcb_group_id:k().optional(),subcircuit_id:k().optional(),center:lr,width:Wo,height:Wo,layer:v_,ccw_rotation:Oh.optional(),color:k().optional()}).describe("Defines a courtyard rectangle on the PCB");Ft(!0);var voo=we({type:he("pcb_courtyard_outline"),pcb_courtyard_outline_id:Mn("pcb_courtyard_outline"),pcb_component_id:k(),pcb_group_id:k().optional(),subcircuit_id:k().optional(),layer:v_,outline:it(lr).min(2)}).describe("Defines a courtyard outline on the PCB");Ft(!0);var Soo=we({type:he("pcb_courtyard_polygon"),pcb_courtyard_polygon_id:Mn("pcb_courtyard_polygon"),pcb_component_id:k(),pcb_group_id:k().optional(),subcircuit_id:k().optional(),layer:v_,points:it(lr).min(3),color:k().optional()}).describe("Defines a courtyard polygon on the PCB");Ft(!0);var Poo=we({type:he("pcb_courtyard_circle"),pcb_courtyard_circle_id:Mn("pcb_courtyard_circle"),pcb_component_id:k(),pcb_group_id:k().optional(),subcircuit_id:k().optional(),center:lr,radius:Wo,layer:v_,color:k().optional()}).describe("Defines a courtyard circle on the PCB");Ft(!0);var Eoo=we({type:he("pcb_courtyard_pill"),pcb_courtyard_pill_id:Mn("pcb_courtyard_pill"),pcb_component_id:k(),pcb_group_id:k().optional(),subcircuit_id:k().optional(),center:lr,width:Wo,height:Wo,radius:Wo,layer:v_,color:k().optional()}).describe("Defines a courtyard pill on the PCB");Ft(!0);var lji=["obj","stl","3mf","gltf","glb","step","wrl"],Moo=["x+","x-","y+","y-","z+","z-"],hji={obj:"z+",stl:"z+","3mf":"z+",gltf:"y+",glb:"y+",step:"z+",wrl:"y+"},woo=we({type:he("cad_component"),cad_component_id:k(),pcb_component_id:k().optional().describe("Optional PCB component reference; omit for CAD geometry without a PCB component"),source_component_id:k(),position:DP,rotation:DP.optional(),is_on_folded_board:Be().optional().describe("True when position and rotation describe the assembled folded board pose. False or omitted means the flat board pose. PCB records remain flat; pcb_component_id identifies the flat mount and owning board for reversible transforms."),size:DP.optional(),layer:Js.optional(),subcircuit_id:k().optional(),footprinter_string:k().optional(),model_obj_url:k().optional(),model_stl_url:k().optional(),model_3mf_url:k().optional(),model_gltf_url:k().optional(),model_glb_url:k().optional(),model_step_url:k().optional(),model_wrl_url:k().optional(),model_asset:EMe.optional(),model_unit_to_mm_scale_factor:Ae().optional(),model_board_normal_direction:Pt(Moo).optional().describe(`The direction in the model's coordinate space that is considered "up" or "coming out of the board surface"`),model_origin_position:DP.optional(),model_origin_alignment:Pt(["unknown","center","center_of_component_on_board_surface","bottom_center_of_component"]).optional(),model_object_fit:Pt(["contain_within_bounds","fill_bounds"]).optional().default("contain_within_bounds"),model_jscad:Jh().optional(),show_as_translucent_model:Be().optional(),show_as_bounding_box:Be().optional(),show_hidden_edges:Be().optional(),anchor_alignment:Pt(["center","center_of_component_on_board_surface"]).optional().default("center")}).describe("Defines CAD geometry, optionally associated with a PCB component");Ft(!0);var Boo=yc.extend({type:he("cad_collision_error"),cad_collision_error_id:Mn("cad_collision_error"),error_type:he("cad_collision_error").default("cad_collision_error"),cad_component_ids:it(k()).min(1),pcb_component_ids:it(k()).optional(),source_component_ids:it(k()).min(1),intersection_area_mm2:Ae().finite().nonnegative(),threshold_area_mm2:Ae().finite().nonnegative()}).describe("An aperture-bearing part intersects the finished enclosure. The intersection_area_mm2 is the union silhouette area of the solid intersection projected along the aperture face normal, in the right-handed Circuit JSON world frame (+X right, +Y top, +Z above). It is an area in square millimetres, not intersection volume or surface area. This indicates possible aperture misplacement, insufficient size/depth, or body clearance problems; it does not prove which cause applies.");Ft(!0);var Too=we({type:he("cad_cable"),cad_cable_id:k(),name:k().min(1),from_source_component_id:k(),to_source_component_id:k(),cableprinter_string:k().min(1).describe('Physical cable definition, e.g. "usb_c" or "jst_ph_pins6". Independent of the route.'),path:it(DP).min(2).refine((e)=>e.every((t,n)=>[t.x,t.y,t.z].every(Number.isFinite)&&(n===0||Math.hypot(t.x-e[n-1].x,t.y-e[n-1].y,t.z-e[n-1].z)>0.00000001)),"Cable paths require finite, distinct consecutive points").describe("Resolved cable centerline points in right-handed circuit world, millimeters: +X right, +Y top, +Z above. First/last samples are connector wire exits; their tangents point into/out of the cable. Includes routing/slack; renderers must not recompute the path.")}).describe("A physical assembly cable with a resolved 3D route. Several cables are independent cad_cable records, each with its own endpoints, definition and path. Does not imply electrical pin mapping.");Ft(!0);var Npt=Pt(["sinewave","square","triangle","sawtooth"]),dji=un([k(),Ae()]).transform((e)=>{if(typeof e==="string"){if(e.endsWith("%"))return parseFloat(e.slice(0,-1))/100;return parseFloat(e)}return e}).pipe(Ae().min(0,"Duty cycle must be non-negative").max(1,"Duty cycle cannot be greater than 100%")),Doo=we({type:he("simulation_voltage_source"),simulation_voltage_source_id:Mn("simulation_voltage_source"),is_dc_source:he(!0).optional().default(!0),positive_source_port_id:k().optional(),negative_source_port_id:k().optional(),positive_source_net_id:k().optional(),negative_source_net_id:k().optional(),voltage:Jb,ac_magnitude:Jb.optional(),ac_phase:Oh.optional()}).describe("Defines a DC voltage source for simulation"),Noo=we({type:he("simulation_voltage_source"),simulation_voltage_source_id:Mn("simulation_voltage_source"),is_dc_source:he(!1),terminal1_source_port_id:k().optional(),terminal2_source_port_id:k().optional(),terminal1_source_net_id:k().optional(),terminal2_source_net_id:k().optional(),voltage:Jb.optional(),frequency:HG.optional(),peak_to_peak_voltage:Jb.optional(),wave_shape:Npt.optional(),phase:Oh.optional(),duty_cycle:dji.optional(),pulse_delay:Pg.optional(),rise_time:Pg.optional(),fall_time:Pg.optional(),pulse_width:Pg.optional(),period:Pg.optional(),ac_magnitude:Jb.optional(),ac_phase:Oh.optional()}).describe("Defines an AC voltage source for simulation"),Roo=un([Doo,Noo]).describe("Defines a voltage source for simulation");Ft(!0);Ft(!0);Ft(!0);var uji=un([k(),Ae()]).transform((e)=>{if(typeof e==="string"){if(e.endsWith("%"))return parseFloat(e.slice(0,-1))/100;return parseFloat(e)}return e}).pipe(Ae().min(0,"Duty cycle must be non-negative").max(1,"Duty cycle cannot be greater than 100%")),Qoo=we({type:he("simulation_current_source"),simulation_current_source_id:Mn("simulation_current_source"),is_dc_source:he(!0).optional().default(!0),positive_source_port_id:k().optional(),negative_source_port_id:k().optional(),positive_source_net_id:k().optional(),negative_source_net_id:k().optional(),current:EL,ac_magnitude:EL.optional(),ac_phase:Oh.optional()}).describe("Defines a DC current source for simulation"),koo=we({type:he("simulation_current_source"),simulation_current_source_id:Mn("simulation_current_source"),is_dc_source:he(!1),terminal1_source_port_id:k().optional(),terminal2_source_port_id:k().optional(),terminal1_source_net_id:k().optional(),terminal2_source_net_id:k().optional(),current:EL.optional(),frequency:HG.optional(),peak_to_peak_current:EL.optional(),wave_shape:Npt.optional(),phase:Oh.optional(),duty_cycle:uji.optional(),ac_magnitude:EL.optional(),ac_phase:Oh.optional()}).describe("Defines an AC current source for simulation"),Loo=un([Qoo,koo]).describe("Defines a current source for simulation");Ft(!0);Ft(!0);Ft(!0);var NMe=Wa((e)=>e==="V"||e==="A"),Rpt=Wa((e)=>e==="Ω"||e==="F"||e==="H"||e==="V"||e==="A"),Hoo=un([he("spice_dc_sweep"),he("spice_dc_operating_point"),he("spice_transient_analysis"),he("spice_ac_analysis")]),Foo=we({method:Pt(["trap","gear"]).optional(),reltol:un([Ae(),k()]).optional(),abstol:un([Ae(),k()]).optional(),vntol:un([Ae(),k()]).optional()}).describe("SPICE solver options for a simulation experiment"),zoo=we({type:he("simulation_experiment"),simulation_experiment_id:Mn("simulation_experiment"),name:k(),experiment_type:Hoo,time_per_step:mte.optional(),start_time_ms:Pg.optional(),end_time_ms:Pg.optional(),spice_options:Foo.optional(),dc_sweep_voltage_source_id:k().optional(),dc_sweep_current_source_id:k().optional(),dc_sweep_start:Ae().optional(),dc_sweep_stop:Ae().optional(),dc_sweep_step:Ae().refine((e)=>e!==0).optional(),dc_sweep_unit:NMe.optional(),ac_sweep_type:Pt(["linear","decade","octave"]).optional(),ac_samples_per_interval:Ae().int().positive().optional(),ac_sample_count:Ae().int().positive().optional(),ac_start_frequency_hz:Ae().positive().optional(),ac_stop_frequency_hz:Ae().positive().optional()}).superRefine((e,t)=>{if(e.experiment_type==="spice_dc_sweep"){let n=["dc_sweep_start","dc_sweep_stop","dc_sweep_step","dc_sweep_unit"];for(let i of n)if(e[i]===void 0)t.addIssue({code:Vt.custom,path:[i],message:`${i} is required for a DC sweep`});let o=e.dc_sweep_voltage_source_id!==void 0,r=e.dc_sweep_current_source_id!==void 0;if(o===r)t.addIssue({code:Vt.custom,path:["dc_sweep_voltage_source_id"],message:"Exactly one DC sweep voltage or current source ID is required"})}if(e.experiment_type==="spice_ac_analysis"){if(e.ac_sweep_type===void 0)t.addIssue({code:Vt.custom,path:["ac_sweep_type"],message:"ac_sweep_type is required for an AC analysis"});if(e.ac_start_frequency_hz===void 0)t.addIssue({code:Vt.custom,path:["ac_start_frequency_hz"],message:"ac_start_frequency_hz is required for an AC analysis"});if(e.ac_stop_frequency_hz===void 0)t.addIssue({code:Vt.custom,path:["ac_stop_frequency_hz"],message:"ac_stop_frequency_hz is required for an AC analysis"});if(e.ac_sweep_type==="linear"&&e.ac_sample_count===void 0)t.addIssue({code:Vt.custom,path:["ac_sample_count"],message:"ac_sample_count is required for a linear AC analysis"});if((e.ac_sweep_type==="decade"||e.ac_sweep_type==="octave")&&e.ac_samples_per_interval===void 0)t.addIssue({code:Vt.custom,path:["ac_samples_per_interval"],message:"ac_samples_per_interval is required for decade and octave AC analyses"})}}).describe("Defines a simulation experiment configuration");Ft(!0);var tT=we({simulation_parameter_sweep_id:k(),sweep_index:Ae().int().nonnegative(),parameter_value:Ae(),parameter_unit:Rpt});Ft(!0);var Ooo=we({type:he("simulation_transient_voltage_graph"),simulation_transient_voltage_graph_id:Mn("simulation_transient_voltage_graph"),simulation_experiment_id:k(),simulation_parameter_sweep_coordinate:tT.optional(),timestamps_ms:it(Ae()).optional(),voltage_levels:it(Ae()),source_component_id:k().optional(),subcircuit_connectivity_map_key:k().optional(),time_per_step:mte,start_time_ms:Pg,end_time_ms:Pg,name:k().optional(),color:k().optional()}).describe("Stores voltage measurements over time for a simulation");Ft(!0);var Voo=we({type:he("simulation_transient_current_graph"),simulation_transient_current_graph_id:Mn("simulation_transient_current_graph"),simulation_experiment_id:k(),simulation_parameter_sweep_coordinate:tT.optional(),timestamps_ms:it(Ae()).optional(),current_levels:it(Ae()),source_component_id:k().optional(),subcircuit_connectivity_map_key:k().optional(),time_per_step:mte,start_time_ms:Pg,end_time_ms:Pg,name:k().optional(),color:k().optional()}).describe("Stores current measurements over time for a simulation");Ft(!0);var Yoo=we({type:he("simulation_switch"),simulation_switch_id:Mn("simulation_switch"),source_component_id:k().optional(),closes_at:Pg.optional(),opens_at:Pg.optional(),starts_closed:Be().optional(),switching_frequency:HG.optional()}).describe("Defines a switch for simulation timing control");Ft(!0);var Goo=we({type:he("simulation_voltage_probe"),simulation_voltage_probe_id:Mn("simulation_voltage_probe"),source_component_id:k().optional(),name:k().optional(),signal_input_source_port_id:k().optional(),signal_input_source_net_id:k().optional(),reference_input_source_port_id:k().optional(),reference_input_source_net_id:k().optional(),subcircuit_id:k().optional(),color:k().optional()}).describe("Defines a voltage probe for simulation. If a reference input is not provided, it measures against ground. If a reference input is provided, it measures the differential voltage between two points.").superRefine((e,t)=>{if(e.reference_input_source_port_id||e.reference_input_source_net_id){let o=!!e.signal_input_source_port_id||!!e.reference_input_source_port_id,r=!!e.signal_input_source_net_id||!!e.reference_input_source_net_id;if(o&&r)t.addIssue({code:Vt.custom,message:"Cannot mix port and net connections in a differential probe."});else if(o){if(!e.signal_input_source_port_id||!e.reference_input_source_port_id)t.addIssue({code:Vt.custom,message:"Differential port probe requires both signal_input_source_port_id and reference_input_source_port_id."})}else if(r){if(!e.signal_input_source_net_id||!e.reference_input_source_net_id)t.addIssue({code:Vt.custom,message:"Differential net probe requires both signal_input_source_net_id and reference_input_source_net_id."})}}else if(!!e.signal_input_source_port_id===!!e.signal_input_source_net_id)t.addIssue({code:Vt.custom,message:"A voltage probe must have exactly one of signal_input_source_port_id or signal_input_source_net_id."})});Ft(!0);var Uoo=we({type:he("simulation_current_probe"),simulation_current_probe_id:Mn("simulation_current_probe"),source_component_id:k().optional(),name:k().optional(),positive_source_port_id:k().optional(),negative_source_port_id:k().optional(),positive_source_net_id:k().optional(),negative_source_net_id:k().optional(),subcircuit_id:k().optional(),color:k().optional()}).describe("Defines a current probe for simulation. It measures current flowing from the positive endpoint to the negative endpoint.").superRefine((e,t)=>{let n=!!e.positive_source_port_id,o=!!e.negative_source_port_id,r=!!e.positive_source_net_id,i=!!e.negative_source_net_id,s=n||o,a=r||i;if(s&&a){t.addIssue({code:Vt.custom,message:"Cannot mix port and net connections in a current probe."});return}if(s){if(!n||!o)t.addIssue({code:Vt.custom,message:"Current probe using source ports requires both positive_source_port_id and negative_source_port_id."});return}if(a){if(!r||!i)t.addIssue({code:Vt.custom,message:"Current probe using source nets requires both positive_source_net_id and negative_source_net_id."});return}t.addIssue({code:Vt.custom,message:"A current probe must have either positive/negative source port ids or positive/negative source net ids."})});Ft(!0);var Woo=yc.extend({type:he("simulation_unknown_experiment_error"),simulation_unknown_experiment_error_id:Mn("simulation_unknown_experiment_error"),error_type:he("simulation_unknown_experiment_error").default("simulation_unknown_experiment_error"),simulation_experiment_id:k().optional(),subcircuit_id:k().optional()}).describe("An unknown error occurred during the simulation experiment.");Ft(!0);var pji=Pt(["resistance","capacitance","inductance","voltage","current"]),Ype=we({type:he("simulation_parameter_sweep"),simulation_parameter_sweep_id:Mn("simulation_parameter_sweep"),simulation_experiment_id:k(),name:k().optional(),parameter_values:it(Ae()).min(1),parameter_unit:Rpt}),Xoo=ss("parameter_type",[Ype.extend({parameter_type:he("resistance"),resistor_source_component_id:k()}),Ype.extend({parameter_type:he("capacitance"),capacitor_source_component_id:k()}),Ype.extend({parameter_type:he("inductance"),inductor_source_component_id:k()}),Ype.extend({parameter_type:he("voltage"),source_net_id:k()}),Ype.extend({parameter_type:he("current"),current_source_component_id:k()})]).describe("Repeats a simulation experiment over component parameter values");Ft(!0);var joo=we({type:he("simulation_dc_operating_point_voltage"),simulation_dc_operating_point_voltage_id:Mn("simulation_dc_operating_point_voltage"),simulation_experiment_id:k(),simulation_parameter_sweep_coordinate:tT.optional(),simulation_voltage_probe_id:k(),voltage:Ae(),name:k().optional(),color:k().optional()});Ft(!0);var Koo=we({type:he("simulation_dc_operating_point_current"),simulation_dc_operating_point_current_id:Mn("simulation_dc_operating_point_current"),simulation_experiment_id:k(),simulation_parameter_sweep_coordinate:tT.optional(),simulation_current_probe_id:k(),current:Ae(),name:k().optional(),color:k().optional()});Ft(!0);var $oo=we({type:he("simulation_dc_sweep_voltage_graph"),simulation_dc_sweep_voltage_graph_id:Mn("simulation_dc_sweep_voltage_graph"),simulation_experiment_id:k(),simulation_parameter_sweep_coordinate:tT.optional(),simulation_voltage_probe_id:k(),sweep_values:it(Ae()),sweep_unit:NMe,voltage_levels:it(Ae()),name:k().optional(),color:k().optional()}).refine((e)=>e.sweep_values.length===e.voltage_levels.length,{message:"sweep_values and voltage_levels must have the same length"});Ft(!0);var qoo=we({type:he("simulation_dc_sweep_current_graph"),simulation_dc_sweep_current_graph_id:Mn("simulation_dc_sweep_current_graph"),simulation_experiment_id:k(),simulation_parameter_sweep_coordinate:tT.optional(),simulation_current_probe_id:k(),sweep_values:it(Ae()),sweep_unit:NMe,current_levels:it(Ae()),name:k().optional(),color:k().optional()}).refine((e)=>e.sweep_values.length===e.current_levels.length,{message:"sweep_values and current_levels must have the same length"});Ft(!0);var Qpt=we({re:Ae(),im:Ae()});Ft(!0);var Joo=we({type:he("simulation_ac_sweep_voltage_graph"),simulation_ac_sweep_voltage_graph_id:Mn("simulation_ac_sweep_voltage_graph"),simulation_experiment_id:k(),simulation_parameter_sweep_coordinate:tT.optional(),simulation_voltage_probe_id:k(),frequencies_hz:it(Ae()),complex_voltages:it(Qpt),name:k().optional(),color:k().optional()}).refine((e)=>e.frequencies_hz.length===e.complex_voltages.length,{message:"frequencies_hz and complex_voltages must have the same length"});Ft(!0);var Zoo=we({type:he("simulation_ac_sweep_current_graph"),simulation_ac_sweep_current_graph_id:Mn("simulation_ac_sweep_current_graph"),simulation_experiment_id:k(),simulation_parameter_sweep_coordinate:tT.optional(),simulation_current_probe_id:k(),frequencies_hz:it(Ae()),complex_currents:it(Qpt),name:k().optional(),color:k().optional()}).refine((e)=>e.frequencies_hz.length===e.complex_currents.length,{message:"frequencies_hz and complex_currents must have the same length"});Ft(!0);var ero=we({type:he("simulation_op_amp"),simulation_op_amp_id:Mn("simulation_op_amp"),source_component_id:k().optional(),inverting_input_source_port_id:k(),non_inverting_input_source_port_id:k(),output_source_port_id:k(),positive_supply_source_port_id:k(),negative_supply_source_port_id:k()}).describe("Defines a simple ideal operational amplifier for simulation");Ft(!0);var tro=we({type:he("simulation_spice_subcircuit"),simulation_spice_subcircuit_id:Mn("simulation_spice_subcircuit"),source_component_id:k(),spice_pin_to_source_port_map:gs(k(),k()),subcircuit_source:k()}).describe("Defines a custom SPICE subcircuit model for simulation");Ft(!0);var OZn=(e)=>e!==void 0,nro=we({type:he("simulation_oscilloscope_trace"),simulation_oscilloscope_trace_id:Mn("simulation_oscilloscope_trace"),simulation_transient_voltage_graph_id:k().optional(),simulation_transient_current_graph_id:k().optional(),simulation_voltage_probe_id:k().optional(),simulation_current_probe_id:k().optional(),display_name:k().optional(),color:k().optional(),display_center_value:Ae().optional(),display_center_offset_divs:Ae().optional(),volts_per_div:Ae().positive().optional(),amps_per_div:Ae().positive().optional()}).describe("Defines how a simulation measurement is rendered as an oscilloscope-style trace.").superRefine((e,t)=>{let n=[e.simulation_transient_voltage_graph_id,e.simulation_voltage_probe_id].filter(OZn).length,o=[e.simulation_transient_current_graph_id,e.simulation_current_probe_id].filter(OZn).length;if(n+o!==1)t.addIssue({code:Vt.custom,message:"An oscilloscope trace must reference exactly one voltage graph, current graph, voltage probe, or current probe."});if(n>0&&e.amps_per_div!==void 0)t.addIssue({code:Vt.custom,message:"Voltage oscilloscope traces must use volts_per_div, not amps_per_div."});if(o>0&&e.volts_per_div!==void 0)t.addIssue({code:Vt.custom,message:"Current oscilloscope traces must use amps_per_div, not volts_per_div."})});Ft(!0);var oro=un([zeo,Ieo,Feo,Ceo,beo,xeo,Seo,veo,cpt,ipt,wMe,apt,spt,lpt,hpt,dpt,mpt,_pt,gpt,Cpt,Apt,fpt,ypt,xpt,ppt,upt,Meo,Beo,Peo,bpt,Ipt,vpt,Spt,Teo,Heo,Ppt,Ept,Deo,Neo,Reo,Qeo,keo,Leo,Mpt,wpt,Eeo,Eto,Tto,Hto,qno,Jno,Zno,ooo,roo,ioo,soo,aoo,Fto,Gno,Uno,zto,cno,Uto,$to,qto,eno,Jto,Zto,tno,lno,Vto,Yto,Gto,hno,dno,gno,Ano,eoo,Cno,bno,Ino,vno,Tno,Sno,Pno,Eno,Mno,Bno,nno,ono,rno,ino,fno,yno,xno,sno,ano,yoo,xoo,Coo,boo,Nno,Dno,Rno,Qno,kno,Lno,Hno,Fno,zno,too,noo,Ono,Vno,coo,$no,loo,hoo,doo,_oo,goo,Aoo,foo,Ioo,voo,Soo,Poo,Eoo,Oeo,eto,Keo,$eo,qeo,Jeo,Xeo,jeo,tto,Zeo,Veo,oto,rto,nto,cto,lto,hto,dto,uto,xto,pto,mto,_to,yto,gto,Ato,woo,Too,Boo,Roo,Loo,zoo,Ooo,Voo,joo,Koo,$oo,qoo,Joo,Zoo,Xoo,Yoo,Goo,Uoo,nro,Woo,ero,tro]),_te=oro;Ft(!0);FG(!0);var Sh=Qe(wt(),1),RKi=Qe(wt(),1),QKi=Qe(wt(),1),kKi=Qe(wt(),1),LKi=Qe(wt(),1);var Gmt=Qe(wt(),1),Jso=Qe(rn(),1),Zso=Qe(rn(),1);var rro=(e)=>{let t,n=new Set,o=(h,d)=>{let u=typeof h==="function"?h(t):h;if(!Object.is(u,t)){let _=t;t=(d!=null?d:typeof u!=="object"||u===null)?u:Object.assign({},t,u),n.forEach((p)=>p(t,_))}},r=()=>t,c={setState:o,getState:r,getInitialState:()=>l,subscribe:(h)=>(n.add(h),()=>n.delete(h)),destroy:()=>{if((import.meta.env?import.meta.env.MODE:void 0)!=="production")console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected.");n.clear()}},l=t=e(o,r,c);return c},iro=(e)=>e?rro(e):rro;var lro=Qe(rn(),1),hro=Qe(aro(),1),{useDebugValue:gji}=lro.default,{useSyncExternalStoreWithSelector:Aji}=hro.default,cro=!1,fji=(e)=>e;function dro(e,t=fji,n){if((import.meta.env?import.meta.env.MODE:void 0)!=="production"&&n&&!cro)console.warn("[DEPRECATED] Use `createWithEqualityFn` instead of `create` or use `useStoreWithEqualityFn` instead of `useStore`. They can be imported from 'zustand/traditional'. https://github.com/pmndrs/zustand/discussions/1937"),cro=!0;let o=Aji(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return gji(o),o}var eao=Qe(rn(),1),Eqi=Qe(rn(),1),oao=Qe(so(),1),iao=Qe(rn(),1);var Si=Qe(rn(),1);function uro(e){var t,n,o="";if(typeof e=="string"||typeof e=="number")o+=e;else if(typeof e=="object")if(Array.isArray(e)){var r=e.length;for(t=0;t<r;t++)e[t]&&(n=uro(e[t]))&&(o&&(o+=" "),o+=n)}else for(n in e)e[n]&&(o&&(o+=" "),o+=n);return o}function yji(){for(var e,t,n=0,o="",r=arguments.length;n<r;n++)(e=arguments[n])&&(t=uro(e))&&(o&&(o+=" "),o+=t);return o}var oT=yji;var jpe=(e)=>typeof e=="number"&&!isNaN(e),zG=(e)=>typeof e=="string",v3=(e)=>typeof e=="function",kMe=(e)=>zG(e)||v3(e)?e:null,Lpt=(e)=>Si.isValidElement(e)||zG(e)||v3(e)||jpe(e);function xji(e,t,n){n===void 0&&(n=300);let{scrollHeight:o,style:r}=e;requestAnimationFrame(()=>{r.minHeight="initial",r.height=o+"px",r.transition=`all ${n}ms`,requestAnimationFrame(()=>{r.height="0",r.padding="0",r.margin="0",setTimeout(t,n)})})}function HMe(e){let{enter:t,exit:n,appendPosition:o=!1,collapse:r=!0,collapseDuration:i=300}=e;return function(s){let{children:a,position:c,preventExitTransition:l,done:h,nodeRef:d,isIn:u,playToast:_}=s,p=o?`${t}--${c}`:t,m=o?`${n}--${c}`:n,A=Si.useRef(0);return Si.useLayoutEffect(()=>{let g=d.current,f=p.split(" "),y=(x)=>{x.target===d.current&&(_(),g.removeEventListener("animationend",y),g.removeEventListener("animationcancel",y),A.current===0&&x.type!=="animationcancel"&&g.classList.remove(...f))};g.classList.add(...f),g.addEventListener("animationend",y),g.addEventListener("animationcancel",y)},[]),Si.useEffect(()=>{let g=d.current,f=()=>{g.removeEventListener("animationend",f),r?xji(g,h,i):h()};u||(l?f():(A.current=1,g.className+=` ${m}`,g.addEventListener("animationend",f)))},[u]),Si.default.createElement(Si.default.Fragment,null,a)}}function pro(e,t){return e!=null?{content:e.content,containerId:e.props.containerId,id:e.props.toastId,theme:e.props.theme,type:e.props.type,data:e.props.data||{},isLoading:e.props.isLoading,icon:e.props.icon,status:t}:{}}var ky=new Map,Kpe=[],Hpt=new Set,Cji=(e)=>Hpt.forEach((t)=>t(e)),_ro=()=>ky.size>0;function gro(e,t){var n;if(t)return!((n=ky.get(t))==null||!n.isToastActive(e));let o=!1;return ky.forEach((r)=>{r.isToastActive(e)&&(o=!0)}),o}function Aro(e,t){Lpt(e)&&(_ro()||Kpe.push({content:e,options:t}),ky.forEach((n)=>{n.buildToast(e,t)}))}function mro(e,t){ky.forEach((n)=>{t!=null&&t!=null&&t.containerId?(t==null?void 0:t.containerId)===n.id&&n.toggle(e,t==null?void 0:t.id):n.toggle(e,t==null?void 0:t.id)})}function bji(e){let{subscribe:t,getSnapshot:n,setProps:o}=Si.useRef(function(i){let s=i.containerId||1;return{subscribe(a){let c=function(h,d,u){let _=1,p=0,m=[],A=[],g=[],f=d,y=new Map,x=new Set,C=()=>{g=Array.from(y.values()),x.forEach((v)=>v())},b=(v)=>{A=v==null?[]:A.filter((P)=>P!==v),C()},I=(v)=>{let{toastId:P,onOpen:M,updateId:B,children:T}=v.props,N=B==null;v.staleId&&y.delete(v.staleId),y.set(P,v),A=[...A,v.props.toastId].filter((D)=>D!==v.staleId),C(),u(pro(v,N?"added":"updated")),N&&v3(M)&&M(Si.isValidElement(T)&&T.props)};return{id:h,props:f,observe:(v)=>(x.add(v),()=>x.delete(v)),toggle:(v,P)=>{y.forEach((M)=>{P!=null&&P!==M.props.toastId||v3(M.toggle)&&M.toggle(v)})},removeToast:b,toasts:y,clearQueue:()=>{p-=m.length,m=[]},buildToast:(v,P)=>{if(((X)=>{let{containerId:K,toastId:J,updateId:ee}=X,se=K?K!==h:h!==1,ne=y.has(J)&&ee==null;return se||ne})(P))return;let{toastId:M,updateId:B,data:T,staleId:N,delay:D}=P,L=()=>{b(M)},H=B==null;H&&p++;let V={...f,style:f.toastStyle,key:_++,...Object.fromEntries(Object.entries(P).filter((X)=>{let[K,J]=X;return J!=null})),toastId:M,updateId:B,data:T,closeToast:L,isIn:!1,className:kMe(P.className||f.toastClassName),bodyClassName:kMe(P.bodyClassName||f.bodyClassName),progressClassName:kMe(P.progressClassName||f.progressClassName),autoClose:!P.isLoading&&(O=P.autoClose,U=f.autoClose,O===!1||jpe(O)&&O>0?O:U),deleteToast(){let X=y.get(M),{onClose:K,children:J}=X.props;v3(K)&&K(Si.isValidElement(J)&&J.props),u(pro(X,"removed")),y.delete(M),p--,p<0&&(p=0),m.length>0?I(m.shift()):C()}};var O,U;V.closeButton=f.closeButton,P.closeButton===!1||Lpt(P.closeButton)?V.closeButton=P.closeButton:P.closeButton===!0&&(V.closeButton=!Lpt(f.closeButton)||f.closeButton);let j=v;Si.isValidElement(v)&&!zG(v.type)?j=Si.cloneElement(v,{closeToast:L,toastProps:V,data:T}):v3(v)&&(j=v({closeToast:L,toastProps:V,data:T}));let Y={content:j,props:V,staleId:N};f.limit&&f.limit>0&&p>f.limit&&H?m.push(Y):jpe(D)?setTimeout(()=>{I(Y)},D):I(Y)},setProps(v){f=v},setToggle:(v,P)=>{y.get(v).toggle=P},isToastActive:(v)=>A.some((P)=>P===v),getSnapshot:()=>g}}(s,i,Cji);ky.set(s,c);let l=c.observe(a);return Kpe.forEach((h)=>Aro(h.content,h.options)),Kpe=[],()=>{l(),ky.delete(s)}},setProps(a){var c;(c=ky.get(s))==null||c.setProps(a)},getSnapshot(){var a;return(a=ky.get(s))==null?void 0:a.getSnapshot()}}}(e)).current;o(e);let r=Si.useSyncExternalStore(t,n,n);return{getToastToRender:function(i){if(!r)return[];let s=new Map;return e.newestOnTop&&r.reverse(),r.forEach((a)=>{let{position:c}=a.props;s.has(c)||s.set(c,[]),s.get(c).push(a)}),Array.from(s,(a)=>i(a[0],a[1]))},isToastActive:gro,count:r==null?void 0:r.length}}function Iji(e){let[t,n]=Si.useState(!1),[o,r]=Si.useState(!1),i=Si.useRef(null),s=Si.useRef({start:0,delta:0,removalDistance:0,canCloseOnClick:!0,canDrag:!1,didMove:!1}).current,{autoClose:a,pauseOnHover:c,closeToast:l,onClick:h,closeOnClick:d}=e;var u,_;function p(){n(!0)}function m(){n(!1)}function A(y){let x=i.current;s.canDrag&&x&&(s.didMove=!0,t&&m(),s.delta=e.draggableDirection==="x"?y.clientX-s.start:y.clientY-s.start,s.start!==y.clientX&&(s.canCloseOnClick=!1),x.style.transform=`translate3d(${e.draggableDirection==="x"?`${s.delta}px, var(--y)`:`0, calc(${s.delta}px + var(--y))`},0)`,x.style.opacity=""+(1-Math.abs(s.delta/s.removalDistance)))}function g(){document.removeEventListener("pointermove",A),document.removeEventListener("pointerup",g);let y=i.current;if(s.canDrag&&s.didMove&&y){if(s.canDrag=!1,Math.abs(s.delta)>s.removalDistance)return r(!0),e.closeToast(),void e.collapseAll();y.style.transition="transform 0.2s, opacity 0.2s",y.style.removeProperty("transform"),y.style.removeProperty("opacity")}}(_=ky.get((u={id:e.toastId,containerId:e.containerId,fn:n}).containerId||1))==null||_.setToggle(u.id,u.fn),Si.useEffect(()=>{if(e.pauseOnFocusLoss)return document.hasFocus()||m(),window.addEventListener("focus",p),window.addEventListener("blur",m),()=>{window.removeEventListener("focus",p),window.removeEventListener("blur",m)}},[e.pauseOnFocusLoss]);let f={onPointerDown:function(y){if(e.draggable===!0||e.draggable===y.pointerType){s.didMove=!1,document.addEventListener("pointermove",A),document.addEventListener("pointerup",g);let x=i.current;s.canCloseOnClick=!0,s.canDrag=!0,x.style.transition="none",e.draggableDirection==="x"?(s.start=y.clientX,s.removalDistance=x.offsetWidth*(e.draggablePercent/100)):(s.start=y.clientY,s.removalDistance=x.offsetHeight*(e.draggablePercent===80?1.5*e.draggablePercent:e.draggablePercent)/100)}},onPointerUp:function(y){let{top:x,bottom:C,left:b,right:I}=i.current.getBoundingClientRect();y.nativeEvent.type!=="touchend"&&e.pauseOnHover&&y.clientX>=b&&y.clientX<=I&&y.clientY>=x&&y.clientY<=C?m():p()}};return a&&c&&(f.onMouseEnter=m,e.stacked||(f.onMouseLeave=p)),d&&(f.onClick=(y)=>{h&&h(y),s.canCloseOnClick&&l()}),{playToast:p,pauseToast:m,isRunning:t,preventExitTransition:o,toastRef:i,eventHandlers:f}}function vji(e){let{delay:t,isRunning:n,closeToast:o,type:r="default",hide:i,className:s,style:a,controlledProgress:c,progress:l,rtl:h,isIn:d,theme:u}=e,_=i||c&&l===0,p={...a,animationDuration:`${t}ms`,animationPlayState:n?"running":"paused"};c&&(p.transform=`scaleX(${l})`);let m=oT("Toastify__progress-bar",c?"Toastify__progress-bar--controlled":"Toastify__progress-bar--animated",`Toastify__progress-bar-theme--${u}`,`Toastify__progress-bar--${r}`,{"Toastify__progress-bar--rtl":h}),A=v3(s)?s({rtl:h,type:r,defaultClassName:m}):oT(m,s),g={[c&&l>=1?"onTransitionEnd":"onAnimationEnd"]:c&&l<1?null:()=>{d&&o()}};return Si.default.createElement("div",{className:"Toastify__progress-bar--wrp","data-hidden":_},Si.default.createElement("div",{className:`Toastify__progress-bar--bg Toastify__progress-bar-theme--${u} Toastify__progress-bar--${r}`}),Si.default.createElement("div",{role:"progressbar","aria-hidden":_?"true":"false","aria-label":"notification timer",className:A,style:p,...g}))}var Sji=1,fro=()=>""+Sji++;function Pji(e){return e&&(zG(e.toastId)||jpe(e.toastId))?e.toastId:fro()}function Xpe(e,t){return Aro(e,t),t.toastId}function LMe(e,t){return{...t,type:t&&t.type||e,toastId:Pji(t)}}function RMe(e){return(t,n)=>Xpe(t,LMe(e,n))}function yu(e,t){return Xpe(e,LMe("default",t))}yu.loading=(e,t)=>Xpe(e,LMe("default",{isLoading:!0,autoClose:!1,closeOnClick:!1,closeButton:!1,draggable:!1,...t})),yu.promise=function(e,t,n){let o,{pending:r,error:i,success:s}=t;r&&(o=zG(r)?yu.loading(r,n):yu.loading(r.render,{...n,...r}));let a={isLoading:null,autoClose:null,closeOnClick:null,closeButton:null,draggable:null},c=(h,d,u)=>{if(d==null)return void yu.dismiss(o);let _={type:h,...a,...n,data:u},p=zG(d)?{render:d}:d;return o?yu.update(o,{..._,...p}):yu(p.render,{..._,...p}),u},l=v3(e)?e():e;return l.then((h)=>c("success",s,h)).catch((h)=>c("error",i,h)),l},yu.success=RMe("success"),yu.info=RMe("info"),yu.error=RMe("error"),yu.warning=RMe("warning"),yu.warn=yu.warning,yu.dark=(e,t)=>Xpe(e,LMe("default",{theme:"dark",...t})),yu.dismiss=function(e){(function(t){var n;if(_ro()){if(t==null||zG(n=t)||jpe(n))ky.forEach((o)=>{o.removeToast(t)});else if(t&&(("containerId"in t)||("id"in t))){let o=ky.get(t.containerId);o?o.removeToast(t.id):ky.forEach((r)=>{r.removeToast(t.id)})}}else Kpe=Kpe.filter((o)=>t!=null&&o.options.toastId!==t)})(e)},yu.clearWaitingQueue=function(e){e===void 0&&(e={}),ky.forEach((t)=>{!t.props.limit||e.containerId&&t.id!==e.containerId||t.clearQueue()})},yu.isActive=gro,yu.update=function(e,t){t===void 0&&(t={});let n=((o,r)=>{var i;let{containerId:s}=r;return(i=ky.get(s||1))==null?void 0:i.toasts.get(o)})(e,t);if(n){let{props:o,content:r}=n,i={delay:100,...o,...t,toastId:t.toastId||e,updateId:fro()};i.toastId!==e&&(i.staleId=e);let s=i.render||r;delete i.render,Xpe(s,i)}},yu.done=(e)=>{yu.update(e,{progress:1})},yu.onChange=function(e){return Hpt.add(e),()=>{Hpt.delete(e)}},yu.play=(e)=>mro(!0,e),yu.pause=(e)=>mro(!1,e);var Eji=typeof window<"u"?Si.useLayoutEffect:Si.useEffect,QMe=(e)=>{let{theme:t,type:n,isLoading:o,...r}=e;return Si.default.createElement("svg",{viewBox:"0 0 24 24",width:"100%",height:"100%",fill:t==="colored"?"currentColor":`var(--toastify-icon-color-${n})`,...r})},kpt={info:function(e){return Si.default.createElement(QMe,{...e},Si.default.createElement("path",{d:"M12 0a12 12 0 1012 12A12.013 12.013 0 0012 0zm.25 5a1.5 1.5 0 11-1.5 1.5 1.5 1.5 0 011.5-1.5zm2.25 13.5h-4a1 1 0 010-2h.75a.25.25 0 00.25-.25v-4.5a.25.25 0 00-.25-.25h-.75a1 1 0 010-2h1a2 2 0 012 2v4.75a.25.25 0 00.25.25h.75a1 1 0 110 2z"}))},warning:function(e){return Si.default.createElement(QMe,{...e},Si.default.createElement("path",{d:"M23.32 17.191L15.438 2.184C14.728.833 13.416 0 11.996 0c-1.42 0-2.733.833-3.443 2.184L.533 17.448a4.744 4.744 0 000 4.368C1.243 23.167 2.555 24 3.975 24h16.05C22.22 24 24 22.044 24 19.632c0-.904-.251-1.746-.68-2.44zm-9.622 1.46c0 1.033-.724 1.823-1.698 1.823s-1.698-.79-1.698-1.822v-.043c0-1.028.724-1.822 1.698-1.822s1.698.79 1.698 1.822v.043zm.039-12.285l-.84 8.06c-.057.581-.408.943-.897.943-.49 0-.84-.367-.896-.942l-.84-8.065c-.057-.624.25-1.095.779-1.095h1.91c.528.005.84.476.784 1.1z"}))},success:function(e){return Si.default.createElement(QMe,{...e},Si.default.createElement("path",{d:"M12 0a12 12 0 1012 12A12.014 12.014 0 0012 0zm6.927 8.2l-6.845 9.289a1.011 1.011 0 01-1.43.188l-4.888-3.908a1 1 0 111.25-1.562l4.076 3.261 6.227-8.451a1 1 0 111.61 1.183z"}))},error:function(e){return Si.default.createElement(QMe,{...e},Si.default.createElement("path",{d:"M11.983 0a12.206 12.206 0 00-8.51 3.653A11.8 11.8 0 000 12.207 11.779 11.779 0 0011.8 24h.214A12.111 12.111 0 0024 11.791 11.766 11.766 0 0011.983 0zM10.5 16.542a1.476 1.476 0 011.449-1.53h.027a1.527 1.527 0 011.523 1.47 1.475 1.475 0 01-1.449 1.53h-.027a1.529 1.529 0 01-1.523-1.47zM11 12.5v-6a1 1 0 012 0v6a1 1 0 11-2 0z"}))},spinner:function(){return Si.default.createElement("div",{className:"Toastify__spinner"})}},Mji=(e)=>{let{isRunning:t,preventExitTransition:n,toastRef:o,eventHandlers:r,playToast:i}=Iji(e),{closeButton:s,children:a,autoClose:c,onClick:l,type:h,hideProgressBar:d,closeToast:u,transition:_,position:p,className:m,style:A,bodyClassName:g,bodyStyle:f,progressClassName:y,progressStyle:x,updateId:C,role:b,progress:I,rtl:v,toastId:P,deleteToast:M,isIn:B,isLoading:T,closeOnClick:N,theme:D}=e,L=oT("Toastify__toast",`Toastify__toast-theme--${D}`,`Toastify__toast--${h}`,{"Toastify__toast--rtl":v},{"Toastify__toast--close-on-click":N}),H=v3(m)?m({rtl:v,position:p,type:h,defaultClassName:L}):oT(L,m),V=function(Y){let{theme:X,type:K,isLoading:J,icon:ee}=Y,se=null,ne={theme:X,type:K};return ee===!1||(v3(ee)?se=ee({...ne,isLoading:J}):Si.isValidElement(ee)?se=Si.cloneElement(ee,ne):J?se=kpt.spinner():((re)=>(re in kpt))(K)&&(se=kpt[K](ne))),se}(e),O=!!I||!c,U={closeToast:u,type:h,theme:D},j=null;return s===!1||(j=v3(s)?s(U):Si.isValidElement(s)?Si.cloneElement(s,U):function(Y){let{closeToast:X,theme:K,ariaLabel:J="close"}=Y;return Si.default.createElement("button",{className:`Toastify__close-button Toastify__close-button--${K}`,type:"button",onClick:(ee)=>{ee.stopPropagation(),X(ee)},"aria-label":J},Si.default.createElement("svg",{"aria-hidden":"true",viewBox:"0 0 14 16"},Si.default.createElement("path",{fillRule:"evenodd",d:"M7.71 8.23l3.75 3.75-1.48 1.48-3.75-3.75-3.75 3.75L1 11.98l3.75-3.75L1 4.48 2.48 3l3.75 3.75L9.98 3l1.48 1.48-3.75 3.75z"})))}(U)),Si.default.createElement(_,{isIn:B,done:M,position:p,preventExitTransition:n,nodeRef:o,playToast:i},Si.default.createElement("div",{id:P,onClick:l,"data-in":B,className:H,...r,style:A,ref:o},Si.default.createElement("div",{...B&&{role:b},className:v3(g)?g({type:h}):oT("Toastify__toast-body",g),style:f},V!=null&&Si.default.createElement("div",{className:oT("Toastify__toast-icon",{"Toastify--animate-icon Toastify__zoom-enter":!T})},V),Si.default.createElement("div",null,a)),j,Si.default.createElement(vji,{...C&&!O?{key:`pb-${C}`}:{},rtl:v,theme:D,delay:c,isRunning:t,isIn:B,closeToast:u,hide:d,type:h,style:x,className:y,controlledProgress:O,progress:I||0})))},FMe=function(e,t){return t===void 0&&(t=!1),{enter:`Toastify--animate Toastify__${e}-enter`,exit:`Toastify--animate Toastify__${e}-exit`,appendPosition:t}},wji=HMe(FMe("bounce",!0)),Eva=HMe(FMe("slide",!0)),Mva=HMe(FMe("zoom")),wva=HMe(FMe("flip")),Bji={position:"top-right",transition:wji,autoClose:5000,closeButton:!0,pauseOnHover:!0,pauseOnFocusLoss:!0,draggable:"touch",draggablePercent:80,draggableDirection:"x",role:"alert",theme:"light"};function yro(e){let t={...Bji,...e},n=e.stacked,[o,r]=Si.useState(!0),i=Si.useRef(null),{getToastToRender:s,isToastActive:a,count:c}=bji(t),{className:l,style:h,rtl:d,containerId:u}=t;function _(m){let A=oT("Toastify__toast-container",`Toastify__toast-container--${m}`,{"Toastify__toast-container--rtl":d});return v3(l)?l({position:m,rtl:d,defaultClassName:A}):oT(A,kMe(l))}function p(){n&&(r(!0),yu.play())}return Eji(()=>{if(n){var m;let A=i.current.querySelectorAll('[data-in="true"]'),g=12,f=(m=t.position)==null?void 0:m.includes("top"),y=0,x=0;Array.from(A).reverse().forEach((C,b)=>{let I=C;I.classList.add("Toastify__toast--stacked"),b>0&&(I.dataset.collapsed=`${o}`),I.dataset.pos||(I.dataset.pos=f?"top":"bot");let v=y*(o?0.2:1)+(o?0:12*b);I.style.setProperty("--y",`${f?v:-1*v}px`),I.style.setProperty("--g","12"),I.style.setProperty("--s",""+(1-(o?x:0))),y+=I.offsetHeight,x+=0.025})}},[o,c,n]),Si.default.createElement("div",{ref:i,className:"Toastify",id:u,onMouseEnter:()=>{n&&(r(!1),yu.pause())},onMouseLeave:p},s((m,A)=>{let g=A.length?{...h}:{...h,pointerEvents:"none"};return Si.default.createElement("div",{className:_(m),style:g,key:`container-${m}`},A.map((f)=>{let{content:y,props:x}=f;return Si.default.createElement(Mji,{...x,stacked:n,collapseAll:p,isIn:a(x.toastId,x.containerId),style:x.style,key:`toast-${x.key}`},y)}))}))}function xro(){var e=":root{--toastify-color-light:#fff;--toastify-color-dark:#121212;--toastify-color-info:#3498db;--toastify-color-success:#07bc0c;--toastify-color-warning:#f1c40f;--toastify-color-error:#e74c3c;--toastify-color-transparent:hsla(0,0%,100%,.7);--toastify-icon-color-info:var(--toastify-color-info);--toastify-icon-color-success:var(--toastify-color-success);--toastify-icon-color-warning:var(--toastify-color-warning);--toastify-icon-color-error:var(--toastify-color-error);--toastify-toast-width:320px;--toastify-toast-offset:16px;--toastify-toast-top:max(var(--toastify-toast-offset),env(safe-area-inset-top));--toastify-toast-right:max(var(--toastify-toast-offset),env(safe-area-inset-right));--toastify-toast-left:max(var(--toastify-toast-offset),env(safe-area-inset-left));--toastify-toast-bottom:max(var(--toastify-toast-offset),env(safe-area-inset-bottom));--toastify-toast-background:#fff;--toastify-toast-min-height:64px;--toastify-toast-max-height:800px;--toastify-toast-bd-radius:6px;--toastify-font-family:sans-serif;--toastify-z-index:9999;--toastify-text-color-light:#757575;--toastify-text-color-dark:#fff;--toastify-text-color-info:#fff;--toastify-text-color-success:#fff;--toastify-text-color-warning:#fff;--toastify-text-color-error:#fff;--toastify-spinner-color:#616161;--toastify-spinner-color-empty-area:#e0e0e0;--toastify-color-progress-light:linear-gradient(90deg,#4cd964,#5ac8fa,#007aff,#34aadc,#5856d6,#ff2d55);--toastify-color-progress-dark:#bb86fc;--toastify-color-progress-info:var(--toastify-color-info);--toastify-color-progress-success:var(--toastify-color-success);--toastify-color-progress-warning:var(--toastify-color-warning);--toastify-color-progress-error:var(--toastify-color-error);--toastify-color-progress-bgo:0.2}.Toastify__toast-container{z-index:var(--toastify-z-index);-webkit-transform:translateZ(var(--toastify-z-index));position:fixed;padding:4px;width:var(--toastify-toast-width);box-sizing:border-box;color:#fff}.Toastify__toast-container--top-left{top:var(--toastify-toast-top);left:var(--toastify-toast-left)}.Toastify__toast-container--top-center{top:var(--toastify-toast-top);left:50%;transform:translateX(-50%)}.Toastify__toast-container--top-right{top:var(--toastify-toast-top);right:var(--toastify-toast-right)}.Toastify__toast-container--bottom-left{bottom:var(--toastify-toast-bottom);left:var(--toastify-toast-left)}.Toastify__toast-container--bottom-center{bottom:var(--toastify-toast-bottom);left:50%;transform:translateX(-50%)}.Toastify__toast-container--bottom-right{bottom:var(--toastify-toast-bottom);right:var(--toastify-toast-right)}@media only screen and (max-width:480px){.Toastify__toast-container{width:100vw;padding:0;left:env(safe-area-inset-left);margin:0}.Toastify__toast-container--top-center,.Toastify__toast-container--top-left,.Toastify__toast-container--top-right{top:env(safe-area-inset-top);transform:translateX(0)}.Toastify__toast-container--bottom-center,.Toastify__toast-container--bottom-left,.Toastify__toast-container--bottom-right{bottom:env(safe-area-inset-bottom);transform:translateX(0)}.Toastify__toast-container--rtl{right:env(safe-area-inset-right);left:auto}}.Toastify__toast{--y:0;position:relative;-ms-touch-action:none;touch-action:none;min-height:var(--toastify-toast-min-height);box-sizing:border-box;margin-bottom:1rem;padding:8px;border-radius:var(--toastify-toast-bd-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;max-height:var(--toastify-toast-max-height);font-family:var(--toastify-font-family);cursor:default;direction:ltr;z-index:0;overflow:hidden}.Toastify__toast--stacked{position:absolute;width:100%;transform:translate3d(0,var(--y),0) scale(var(--s));transition:transform .3s}.Toastify__toast--stacked[data-collapsed] .Toastify__close-button,.Toastify__toast--stacked[data-collapsed] .Toastify__toast-body{transition:opacity .1s}.Toastify__toast--stacked[data-collapsed=false]{overflow:visible}.Toastify__toast--stacked[data-collapsed=true]:not(:last-child)>*{opacity:0}.Toastify__toast--stacked:after{content:\"\";position:absolute;left:0;right:0;height:calc(var(--g) * 1px);bottom:100%}.Toastify__toast--stacked[data-pos=top]{top:0}.Toastify__toast--stacked[data-pos=bot]{bottom:0}.Toastify__toast--stacked[data-pos=bot].Toastify__toast--stacked:before{transform-origin:top}.Toastify__toast--stacked[data-pos=top].Toastify__toast--stacked:before{transform-origin:bottom}.Toastify__toast--stacked:before{content:\"\";position:absolute;left:0;right:0;bottom:0;height:100%;transform:scaleY(3);z-index:-1}.Toastify__toast--rtl{direction:rtl}.Toastify__toast--close-on-click{cursor:pointer}.Toastify__toast-body{margin:auto 0;-ms-flex:1 1 auto;flex:1 1 auto;padding:6px;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.Toastify__toast-body>div:last-child{word-break:break-word;-ms-flex:1;flex:1}.Toastify__toast-icon{-webkit-margin-end:10px;margin-inline-end:10px;width:20px;-ms-flex-negative:0;flex-shrink:0;display:-ms-flexbox;display:flex}.Toastify--animate{animation-fill-mode:both;animation-duration:.5s}.Toastify--animate-icon{animation-fill-mode:both;animation-duration:.3s}@media only screen and (max-width:480px){.Toastify__toast{margin-bottom:0;border-radius:0}}.Toastify__toast-theme--dark{background:var(--toastify-color-dark);color:var(--toastify-text-color-dark)}.Toastify__toast-theme--colored.Toastify__toast--default,.Toastify__toast-theme--light{background:var(--toastify-color-light);color:var(--toastify-text-color-light)}.Toastify__toast-theme--colored.Toastify__toast--info{color:var(--toastify-text-color-info);background:var(--toastify-color-info)}.Toastify__toast-theme--colored.Toastify__toast--success{color:var(--toastify-text-color-success);background:var(--toastify-color-success)}.Toastify__toast-theme--colored.Toastify__toast--warning{color:var(--toastify-text-color-warning);background:var(--toastify-color-warning)}.Toastify__toast-theme--colored.Toastify__toast--error{color:var(--toastify-text-color-error);background:var(--toastify-color-error)}.Toastify__progress-bar-theme--light{background:var(--toastify-color-progress-light)}.Toastify__progress-bar-theme--dark{background:var(--toastify-color-progress-dark)}.Toastify__progress-bar--info{background:var(--toastify-color-progress-info)}.Toastify__progress-bar--success{background:var(--toastify-color-progress-success)}.Toastify__progress-bar--warning{background:var(--toastify-color-progress-warning)}.Toastify__progress-bar--error{background:var(--toastify-color-progress-error)}.Toastify__progress-bar-theme--colored.Toastify__progress-bar--error,.Toastify__progress-bar-theme--colored.Toastify__progress-bar--info,.Toastify__progress-bar-theme--colored.Toastify__progress-bar--success,.Toastify__progress-bar-theme--colored.Toastify__progress-bar--warning{background:var(--toastify-color-transparent)}.Toastify__close-button{color:#fff;background:transparent;outline:none;border:none;padding:0;cursor:pointer;opacity:.7;transition:.3s ease;-ms-flex-item-align:start;align-self:flex-start;z-index:1}.Toastify__close-button--light{color:#000;opacity:.3}.Toastify__close-button>svg{fill:currentColor;height:16px;width:14px}.Toastify__close-button:focus,.Toastify__close-button:hover{opacity:1}@keyframes Toastify__trackProgress{0%{transform:scaleX(1)}to{transform:scaleX(0)}}.Toastify__progress-bar{position:absolute;bottom:0;left:0;width:100%;height:100%;z-index:var(--toastify-z-index);opacity:.7;transform-origin:left;border-bottom-left-radius:var(--toastify-toast-bd-radius)}.Toastify__progress-bar--animated{animation:Toastify__trackProgress linear 1 forwards}.Toastify__progress-bar--controlled{transition:transform .2s}.Toastify__progress-bar--rtl{right:0;left:auto;transform-origin:right;border-bottom-left-radius:0;border-bottom-right-radius:var(--toastify-toast-bd-radius)}.Toastify__progress-bar--wrp{position:absolute;bottom:0;left:0;width:100%;height:5px;border-bottom-left-radius:var(--toastify-toast-bd-radius)}.Toastify__progress-bar--wrp[data-hidden=true]{opacity:0}.Toastify__progress-bar--bg{opacity:var(--toastify-color-progress-bgo);width:100%;height:100%}.Toastify__spinner{width:20px;height:20px;box-sizing:border-box;border:2px solid;border-radius:100%;border-color:var(--toastify-spinner-color-empty-area);border-right-color:var(--toastify-spinner-color);animation:Toastify__spin .65s linear infinite}@keyframes Toastify__bounceInRight{0%,60%,75%,90%,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:translate3d(3000px,0,0)}60%{opacity:1;transform:translate3d(-25px,0,0)}75%{transform:translate3d(10px,0,0)}90%{transform:translate3d(-5px,0,0)}to{transform:none}}@keyframes Toastify__bounceOutRight{20%{opacity:1;transform:translate3d(-20px,var(--y),0)}to{opacity:0;transform:translate3d(2000px,var(--y),0)}}@keyframes Toastify__bounceInLeft{0%,60%,75%,90%,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:translate3d(-3000px,0,0)}60%{opacity:1;transform:translate3d(25px,0,0)}75%{transform:translate3d(-10px,0,0)}90%{transform:translate3d(5px,0,0)}to{transform:none}}@keyframes Toastify__bounceOutLeft{20%{opacity:1;transform:translate3d(20px,var(--y),0)}to{opacity:0;transform:translate3d(-2000px,var(--y),0)}}@keyframes Toastify__bounceInUp{0%,60%,75%,90%,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:translate3d(0,3000px,0)}60%{opacity:1;transform:translate3d(0,-20px,0)}75%{transform:translate3d(0,10px,0)}90%{transform:translate3d(0,-5px,0)}to{transform:translateZ(0)}}@keyframes Toastify__bounceOutUp{20%{transform:translate3d(0,calc(var(--y) - 10px),0)}40%,45%{opacity:1;transform:translate3d(0,calc(var(--y) + 20px),0)}to{opacity:0;transform:translate3d(0,-2000px,0)}}@keyframes Toastify__bounceInDown{0%,60%,75%,90%,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:translate3d(0,-3000px,0)}60%{opacity:1;transform:translate3d(0,25px,0)}75%{transform:translate3d(0,-10px,0)}90%{transform:translate3d(0,5px,0)}to{transform:none}}@keyframes Toastify__bounceOutDown{20%{transform:translate3d(0,calc(var(--y) - 10px),0)}40%,45%{opacity:1;transform:translate3d(0,calc(var(--y) + 20px),0)}to{opacity:0;transform:translate3d(0,2000px,0)}}.Toastify__bounce-enter--bottom-left,.Toastify__bounce-enter--top-left{animation-name:Toastify__bounceInLeft}.Toastify__bounce-enter--bottom-right,.Toastify__bounce-enter--top-right{animation-name:Toastify__bounceInRight}.Toastify__bounce-enter--top-center{animation-name:Toastify__bounceInDown}.Toastify__bounce-enter--bottom-center{animation-name:Toastify__bounceInUp}.Toastify__bounce-exit--bottom-left,.Toastify__bounce-exit--top-left{animation-name:Toastify__bounceOutLeft}.Toastify__bounce-exit--bottom-right,.Toastify__bounce-exit--top-right{animation-name:Toastify__bounceOutRight}.Toastify__bounce-exit--top-center{animation-name:Toastify__bounceOutUp}.Toastify__bounce-exit--bottom-center{animation-name:Toastify__bounceOutDown}@keyframes Toastify__zoomIn{0%{opacity:0;transform:scale3d(.3,.3,.3)}50%{opacity:1}}@keyframes Toastify__zoomOut{0%{opacity:1}50%{opacity:0;transform:translate3d(0,var(--y),0) scale3d(.3,.3,.3)}to{opacity:0}}.Toastify__zoom-enter{animation-name:Toastify__zoomIn}.Toastify__zoom-exit{animation-name:Toastify__zoomOut}@keyframes Toastify__flipIn{0%{transform:perspective(400px) rotateX(90deg);animation-timing-function:ease-in;opacity:0}40%{transform:perspective(400px) rotateX(-20deg);animation-timing-function:ease-in}60%{transform:perspective(400px) rotateX(10deg);opacity:1}80%{transform:perspective(400px) rotateX(-5deg)}to{transform:perspective(400px)}}@keyframes Toastify__flipOut{0%{transform:translate3d(0,var(--y),0) perspective(400px)}30%{transform:translate3d(0,var(--y),0) perspective(400px) rotateX(-20deg);opacity:1}to{transform:translate3d(0,var(--y),0) perspective(400px) rotateX(90deg);opacity:0}}.Toastify__flip-enter{animation-name:Toastify__flipIn}.Toastify__flip-exit{animation-name:Toastify__flipOut}@keyframes Toastify__slideInRight{0%{transform:translate3d(110%,0,0);visibility:visible}to{transform:translate3d(0,var(--y),0)}}@keyframes Toastify__slideInLeft{0%{transform:translate3d(-110%,0,0);visibility:visible}to{transform:translate3d(0,var(--y),0)}}@keyframes Toastify__slideInUp{0%{transform:translate3d(0,110%,0);visibility:visible}to{transform:translate3d(0,var(--y),0)}}@keyframes Toastify__slideInDown{0%{transform:translate3d(0,-110%,0);visibility:visible}to{transform:translate3d(0,var(--y),0)}}@keyframes Toastify__slideOutRight{0%{transform:translate3d(0,var(--y),0)}to{visibility:hidden;transform:translate3d(110%,var(--y),0)}}@keyframes Toastify__slideOutLeft{0%{transform:translate3d(0,var(--y),0)}to{visibility:hidden;transform:translate3d(-110%,var(--y),0)}}@keyframes Toastify__slideOutDown{0%{transform:translate3d(0,var(--y),0)}to{visibility:hidden;transform:translate3d(0,500px,0)}}@keyframes Toastify__slideOutUp{0%{transform:translate3d(0,var(--y),0)}to{visibility:hidden;transform:translate3d(0,-500px,0)}}.Toastify__slide-enter--bottom-left,.Toastify__slide-enter--top-left{animation-name:Toastify__slideInLeft}.Toastify__slide-enter--bottom-right,.Toastify__slide-enter--top-right{animation-name:Toastify__slideInRight}.Toastify__slide-enter--top-center{animation-name:Toastify__slideInDown}.Toastify__slide-enter--bottom-center{animation-name:Toastify__slideInUp}.Toastify__slide-exit--bottom-left,.Toastify__slide-exit--top-left{animation-name:Toastify__slideOutLeft;animation-timing-function:ease-in;animation-duration:.3s}.Toastify__slide-exit--bottom-right,.Toastify__slide-exit--top-right{animation-name:Toastify__slideOutRight;animation-timing-function:ease-in;animation-duration:.3s}.Toastify__slide-exit--top-center{animation-name:Toastify__slideOutUp;animation-timing-function:ease-in;animation-duration:.3s}.Toastify__slide-exit--bottom-center{animation-name:Toastify__slideOutDown;animation-timing-function:ease-in;animation-duration:.3s}@keyframes Toastify__spin{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}",t=document.createElement("style");t.innerText=e,document.head.appendChild(t)}var sao=Qe(so(),1),Cu=Qe(rn(),1),Xte=Qe(rn(),1),gwe=Qe(rn(),1),cao=Qe(rn(),1),Awe=Qe(rn(),1),_me=Qe(rn(),1),UP=Qe(wt(),1),LL=Qe(wt(),1),Bm=Qe(wt(),1),OA=Qe(rn(),1);var jG=Qe(wt(),1),M0=Qe(rn(),1),HL=Qe(wt(),1);var Aao=Qe(NP(),1),fao=Qe(wt(),1),Lp=Qe(rn(),1),gme=Qe(Upt(),1),rv=Qe(so(),1);var yao=Qe(NP(),1),hd=Qe(wt(),1);var bao=Qe(NP(),1);var ev=Qe(NP(),1);var Iao=Qe(NP(),1);$8();var tv=Qe(NP(),1),w3=Qe(wt(),1),Mao=Qe(NP(),1);var E3=Qe(NP(),1);$8();var nv=Qe(NP(),1),QL=Qe(rn(),1),Ame=Qe(Upt(),1),kte=Qe(so(),1),GG=Qe(wt(),1),Smt=Qe(wt(),1),wm=Qe(wt(),1),YZi=Qe(wt(),1),ywe=Qe(wt(),1),xwe=Qe(rn(),1),Cwe=Qe(so(),1),ud=Qe(rn(),1),t1=Qe(wt(),1),kao=Qe(rn(),1),bwe=Qe(rn(),1),fme=Qe(so(),1),Od=Qe(so(),1),yme=Qe(rn(),1),lT=Qe(wt(),1),Iwe=Qe(so(),1),Lte=Qe(rn(),1);var Jji=!0;function Zji(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t];return}function eKi(e){var t=document.createElement("style");if(t.setAttribute("data-emotion",e.key),e.nonce!==void 0)t.setAttribute("nonce",e.nonce);return t.appendChild(document.createTextNode("")),t.setAttribute("data-s",""),t}var Hro=function(){function e(n){var o=this;this._insertTag=function(r){var i;if(o.tags.length===0)if(o.insertionPoint)i=o.insertionPoint.nextSibling;else if(o.prepend)i=o.container.firstChild;else i=o.before;else i=o.tags[o.tags.length-1].nextSibling;o.container.insertBefore(r,i),o.tags.push(r)},this.isSpeedy=n.speedy===void 0?!Jji:n.speedy,this.tags=[],this.ctr=0,this.nonce=n.nonce,this.key=n.key,this.container=n.container,this.prepend=n.prepend,this.insertionPoint=n.insertionPoint,this.before=null}var t=e.prototype;return t.hydrate=function(o){o.forEach(this._insertTag)},t.insert=function(o){if(this.ctr%(this.isSpeedy?65000:1)===0)this._insertTag(eKi(this));var r=this.tags[this.tags.length-1];{var i=o.charCodeAt(0)===64&&o.charCodeAt(1)===105;if(i&&this._alreadyInsertedOrderInsensitiveRule)console.error(`You're attempting to insert the following rule:
`+o+"\n\n`@import` rules must be before all other types of rules in a stylesheet but other rules have already been inserted. Please ensure that `@import` rules are before all other rules.");this._alreadyInsertedOrderInsensitiveRule=this._alreadyInsertedOrderInsensitiveRule||!i}if(this.isSpeedy){var s=Zji(r);try{s.insertRule(o,s.cssRules.length)}catch(a){if(!/:(-moz-placeholder|-moz-focus-inner|-moz-focusring|-ms-input-placeholder|-moz-read-write|-moz-read-only|-ms-clear|-ms-expand|-ms-reveal){/.test(o))console.error('There was a problem inserting the following rule: "'+o+'"',a)}}else r.appendChild(document.createTextNode(o));this.ctr++},t.flush=function(){this.tags.forEach(function(o){var r;return(r=o.parentNode)==null?void 0:r.removeChild(o)}),this.tags=[],this.ctr=0,this._alreadyInsertedOrderInsensitiveRule=!1},e}();var Gf="-ms-",tme="-moz-",Hl="-webkit-",xte="comm",Cte="rule",bte="decl";var Fro="@import";var YMe="@keyframes";var zro="@layer";var Oro=Math.abs,OG=String.fromCharCode,Vro=Object.assign;function Yro(e,t){return Mm(e,0)^45?(((t<<2^Mm(e,0))<<2^Mm(e,1))<<2^Mm(e,2))<<2^Mm(e,3):0}function GMe(e){return e.trim()}function Wpt(e,t){return(e=t.exec(e))?e[0]:e}function hl(e,t,n){return e.replace(t,n)}function nme(e,t){return e.indexOf(t)}function Mm(e,t){return e.charCodeAt(t)|0}function wL(e,t,n){return e.slice(t,n)}function Ly(e){return e.length}function Ite(e){return e.length}function vte(e,t){return t.push(e),e}function Xpt(e,t){return e.map(t).join("")}var UMe=1,Ste=1,Gro=0,Hy=0,S_=0,Ete="";function ome(e,t,n,o,r,i,s){return{value:e,root:t,parent:n,type:o,props:r,children:i,line:UMe,column:Ste,length:s,return:""}}function Mte(e,t){return Vro(ome("",null,null,"",null,null,0),e,{length:-e.length},t)}function Uro(){return S_}function Wro(){if(S_=Hy>0?Mm(Ete,--Hy):0,Ste--,S_===10)Ste=1,UMe--;return S_}function Fy(){if(S_=Hy<Gro?Mm(Ete,Hy++):0,Ste++,S_===10)Ste=1,UMe++;return S_}function Zb(){return Mm(Ete,Hy)}function rme(){return Hy}function wte(e,t){return wL(Ete,e,t)}function Pte(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function WMe(e){return UMe=Ste=1,Gro=Ly(Ete=e),Hy=0,[]}function XMe(e){return Ete="",e}function Bte(e){return GMe(wte(Hy-1,jpt(e===91?e+2:e===40?e+1:e)))}function Xro(e){while(S_=Zb())if(S_<33)Fy();else break;return Pte(e)>2||Pte(S_)>3?"":" "}function jro(e,t){while(--t&&Fy())if(S_<48||S_>102||S_>57&&S_<65||S_>70&&S_<97)break;return wte(e,rme()+(t<6&&Zb()==32&&Fy()==32))}function jpt(e){while(Fy())switch(S_){case e:return Hy;case 34:case 39:if(e!==34&&e!==39)jpt(S_);break;case 40:if(e===41)jpt(e);break;case 92:Fy();break}return Hy}function Kro(e,t){while(Fy())if(e+S_===57)break;else if(e+S_===84&&Zb()===47)break;return"/*"+wte(t,Hy-1)+"*"+OG(e===47?e:Fy())}function $ro(e){while(!Pte(Zb()))Fy();return wte(e,Hy)}function Zro(e){return XMe(jMe("",null,null,null,[""],e=WMe(e),0,[0],e))}function jMe(e,t,n,o,r,i,s,a,c){var l=0,h=0,d=s,u=0,_=0,p=0,m=1,A=1,g=1,f=0,y="",x=r,C=i,b=o,I=y;while(A)switch(p=f,f=Fy()){case 40:if(p!=108&&Mm(I,d-1)==58){if(nme(I+=hl(Bte(f),"&","&\f"),"&\f")!=-1)g=-1;break}case 34:case 39:case 91:I+=Bte(f);break;case 9:case 10:case 13:case 32:I+=Xro(p);break;case 92:I+=jro(rme()-1,7);continue;case 47:switch(Zb()){case 42:case 47:vte(tKi(Kro(Fy(),rme()),t,n),c);break;default:I+="/"}break;case 123*m:a[l++]=Ly(I)*g;case 125*m:case 59:case 0:switch(f){case 0:case 125:A=0;case 59+h:if(g==-1)I=hl(I,/\f/g,"");if(_>0&&Ly(I)-d)vte(_>32?Jro(I+";",o,n,d-1):Jro(hl(I," ","")+";",o,n,d-2),c);break;case 59:I+=";";default:if(vte(b=qro(I,t,n,l,h,r,a,y,x=[],C=[],d),i),f===123)if(h===0)jMe(I,t,b,b,x,i,d,a,C);else switch(u===99&&Mm(I,3)===110?100:u){case 100:case 108:case 109:case 115:jMe(e,b,b,o&&vte(qro(e,b,b,0,0,r,a,y,r,x=[],d),C),r,C,d,a,o?x:C);break;default:jMe(I,b,b,b,[""],C,0,a,C)}}l=h=_=0,m=g=1,y=I="",d=s;break;case 58:d=1+Ly(I),_=p;default:if(m<1){if(f==123)--m;else if(f==125&&m++==0&&Wro()==125)continue}switch(I+=OG(f),f*m){case 38:g=h>0?1:(I+="\f",-1);break;case 44:a[l++]=(Ly(I)-1)*g,g=1;break;case 64:if(Zb()===45)I+=Bte(Fy());u=Zb(),h=d=Ly(y=I+=$ro(rme())),f++;break;case 45:if(p===45&&Ly(I)==2)m=0}}return i}function qro(e,t,n,o,r,i,s,a,c,l,h){var d=r-1,u=r===0?i:[""],_=Ite(u);for(var p=0,m=0,A=0;p<o;++p)for(var g=0,f=wL(e,d+1,d=Oro(m=s[p])),y=e;g<_;++g)if(y=GMe(m>0?u[g]+" "+f:hl(f,/&\f/g,u[g])))c[A++]=y;return ome(e,t,n,r===0?Cte:a,c,l,h)}function tKi(e,t,n){return ome(e,t,n,xte,OG(Uro()),wL(e,2,-2),0)}function Jro(e,t,n,o){return ome(e,t,n,bte,wL(e,0,o),wL(e,o+1,-1),o)}function VG(e,t){var n="",o=Ite(e);for(var r=0;r<o;r++)n+=t(e[r],r,e,t)||"";return n}function eio(e,t,n,o){switch(e.type){case zro:if(e.children.length)break;case Fro:case bte:return e.return=e.return||e.value;case xte:return"";case YMe:return e.return=e.value+"{"+VG(e.children,o)+"}";case Cte:e.value=e.props.join(",")}return Ly(n=VG(e.children,o))?e.return=e.value+"{"+n+"}":""}function tio(e){var t=Ite(e);return function(n,o,r,i){var s="";for(var a=0;a<t;a++)s+=e[a](n,o,r,i)||"";return s}}function nio(e){var t=Object.create(null);return function(n){if(t[n]===void 0)t[n]=e(n);return t[n]}}var nKi=function(t,n,o){var r=0,i=0;while(!0){if(r=i,i=Zb(),r===38&&i===12)n[o]=1;if(Pte(i))break;Fy()}return wte(t,Hy)},oKi=function(t,n){var o=-1,r=44;do switch(Pte(r)){case 0:if(r===38&&Zb()===12)n[o]=1;t[o]+=nKi(Hy-1,n,o);break;case 2:t[o]+=Bte(r);break;case 4:if(r===44){t[++o]=Zb()===58?"&\f":"",n[o]=t[o].length;break}default:t[o]+=OG(r)}while(r=Fy());return t},rKi=function(t,n){return XMe(oKi(WMe(t),n))},oio=new WeakMap,iKi=function(t){if(t.type!=="rule"||!t.parent||t.length<1)return;var{value:n,parent:o}=t,r=t.column===o.column&&t.line===o.line;while(o.type!=="rule")if(o=o.parent,!o)return;if(t.props.length===1&&n.charCodeAt(0)!==58&&!oio.get(o))return;if(r)return;oio.set(t,!0);var i=[],s=rKi(n,i),a=o.props;for(var c=0,l=0;c<s.length;c++)for(var h=0;h<a.length;h++,l++)t.props[l]=i[c]?s[c].replace(/&\f/g,a[h]):a[h]+" "+s[c]},sKi=function(t){if(t.type==="decl"){var n=t.value;if(n.charCodeAt(0)===108&&n.charCodeAt(2)===98)t.return="",t.value=""}},aKi="emotion-disable-server-rendering-unsafe-selector-warning-please-do-not-use-this-the-warning-exists-for-a-reason",cKi=function(t){return t.type==="comm"&&t.children.indexOf(aKi)>-1},lKi=function(t){return function(n,o,r){if(n.type!=="rule"||t.compat)return;var i=n.value.match(/(:first|:nth|:nth-last)-child/g);if(i){var s=!!n.parent,a=s?n.parent.children:r;for(var c=a.length-1;c>=0;c--){var l=a[c];if(l.line<n.line)break;if(l.column<n.column){if(cKi(l))return;break}}i.forEach(function(h){console.error('The pseudo class "'+h+'" is potentially unsafe when doing server-side rendering. Try changing it to "'+h.split("-child")[0]+'-of-type".')})}}},iio=function(t){return t.type.charCodeAt(1)===105&&t.type.charCodeAt(0)===64},hKi=function(t,n){for(var o=t-1;o>=0;o--)if(!iio(n[o]))return!0;return!1},rio=function(t){t.type="",t.value="",t.return="",t.children="",t.props=""},dKi=function(t,n,o){if(!iio(t))return;if(t.parent)console.error("`@import` rules can't be nested inside other rules. Please move it to the top level and put it before regular rules. Keep in mind that they can only be used within global styles."),rio(t);else if(hKi(n,o))console.error("`@import` rules can't be after other rules. Please put your `@import` rules before your other rules."),rio(t)};function sio(e,t){switch(Yro(e,t)){case 5103:return Hl+"print-"+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return Hl+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return Hl+e+tme+e+Gf+e+e;case 6828:case 4268:return Hl+e+Gf+e+e;case 6165:return Hl+e+Gf+"flex-"+e+e;case 5187:return Hl+e+hl(e,/(\w+).+(:[^]+)/,Hl+"box-$1$2"+Gf+"flex-$1$2")+e;case 5443:return Hl+e+Gf+"flex-item-"+hl(e,/flex-|-self/,"")+e;case 4675:return Hl+e+Gf+"flex-line-pack"+hl(e,/align-content|flex-|-self/,"")+e;case 5548:return Hl+e+Gf+hl(e,"shrink","negative")+e;case 5292:return Hl+e+Gf+hl(e,"basis","preferred-size")+e;case 6060:return Hl+"box-"+hl(e,"-grow","")+Hl+e+Gf+hl(e,"grow","positive")+e;case 4554:return Hl+hl(e,/([^-])(transform)/g,"$1"+Hl+"$2")+e;case 6187:return hl(hl(hl(e,/(zoom-|grab)/,Hl+"$1"),/(image-set)/,Hl+"$1"),e,"")+e;case 5495:case 3959:return hl(e,/(image-set\([^]*)/,Hl+"$1$`$1");case 4968:return hl(hl(e,/(.+:)(flex-)?(.*)/,Hl+"box-pack:$3"+Gf+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+Hl+e+e;case 4095:case 3583:case 4068:case 2532:return hl(e,/(.+)-inline(.+)/,Hl+"$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(Ly(e)-1-t>6)switch(Mm(e,t+1)){case 109:if(Mm(e,t+4)!==45)break;case 102:return hl(e,/(.+:)(.+)-([^]+)/,"$1"+Hl+"$2-$3$1"+tme+(Mm(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~nme(e,"stretch")?sio(hl(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(Mm(e,t+1)!==115)break;case 6444:switch(Mm(e,Ly(e)-3-(~nme(e,"!important")&&10))){case 107:return hl(e,":",":"+Hl)+e;case 101:return hl(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+Hl+(Mm(e,14)===45?"inline-":"")+"box$3$1"+Hl+"$2$3$1"+Gf+"$2box$3")+e}break;case 5936:switch(Mm(e,t+11)){case 114:return Hl+e+Gf+hl(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return Hl+e+Gf+hl(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return Hl+e+Gf+hl(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return Hl+e+Gf+e+e}return e}var uKi=function(t,n,o,r){if(t.length>-1){if(!t.return)switch(t.type){case bte:t.return=sio(t.value,t.length);break;case YMe:return VG([Mte(t,{value:hl(t.value,"@","@"+Hl)})],r);case Cte:if(t.length)return Xpt(t.props,function(i){switch(Wpt(i,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return VG([Mte(t,{props:[hl(i,/:(read-\w+)/,":"+tme+"$1")]})],r);case"::placeholder":return VG([Mte(t,{props:[hl(i,/:(plac\w+)/,":"+Hl+"input-$1")]}),Mte(t,{props:[hl(i,/:(plac\w+)/,":"+tme+"$1")]}),Mte(t,{props:[hl(i,/:(plac\w+)/,Gf+"input-$1")]})],r)}return""})}}},pKi=[uKi],Kpt;$pt=/\/\*#\ssourceMappingURL=data:application\/json;\S+\s+\*\//g,Kpt=function(t){var n=t.match($pt);if(!n)return;return n[n.length-1]};var $pt,aio=function(t){var n=t.key;if(!n)throw Error(`You have to configure \`key\` for your cache. Please make sure it's unique (and not equal to 'css') as it's used for linking styles to your cache.
If multiple caches share the same key they might "fight" for each other's style elements.`);if(n==="css"){var o=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(o,function(m){var A=m.getAttribute("data-emotion");if(A.indexOf(" ")===-1)return;document.head.appendChild(m),m.setAttribute("data-s","")})}var r=t.stylisPlugins||pKi;if(/[^a-z-]/.test(n))throw Error('Emotion key must only contain lower case alphabetical characters and - but "'+n+'" was passed');var i={},s,a=[];s=t.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+n+' "]'),function(m){var A=m.getAttribute("data-emotion").split(" ");for(var g=1;g<A.length;g++)i[A[g]]=!0;a.push(m)});var c,l=[iKi,sKi];l.push(lKi({get compat(){return p.compat}}),dKi);{var h,d=[eio,function(m){if(!m.root){if(m.return)h.insert(m.return);else if(m.value&&m.type!==xte)h.insert(m.value+"{}")}}],u=tio(l.concat(r,d)),_=function(A){return VG(Zro(A),u)};c=function(A,g,f,y){if(h=f,Kpt){var x=Kpt(g.styles);if(x)h={insert:function(b){f.insert(b+x)}}}if(_(A?A+"{"+g.styles+"}":g.styles),y)p.inserted[g.name]=!0}}var p={key:n,sheet:new Hro({key:n,container:s,nonce:t.nonce,speedy:t.speedy,prepend:t.prepend,insertionPoint:t.insertionPoint}),nonce:t.nonce,inserted:i,registered:{},insert:c};return p.sheet.hydrate(a),p};function cio(e){var t=0,n,o=0,r=e.length;for(;r>=4;++o,r-=4)n=e.charCodeAt(o)&255|(e.charCodeAt(++o)&255)<<8|(e.charCodeAt(++o)&255)<<16|(e.charCodeAt(++o)&255)<<24,n=(n&65535)*1540483477+((n>>>16)*59797<<16),n^=n>>>24,t=(n&65535)*1540483477+((n>>>16)*59797<<16)^(t&65535)*1540483477+((t>>>16)*59797<<16);switch(r){case 3:t^=(e.charCodeAt(o+2)&255)<<16;case 2:t^=(e.charCodeAt(o+1)&255)<<8;case 1:t^=e.charCodeAt(o)&255,t=(t&65535)*1540483477+((t>>>16)*59797<<16)}return t^=t>>>13,t=(t&65535)*1540483477+((t>>>16)*59797<<16),((t^t>>>15)>>>0).toString(36)}var lio={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1};var mKi=!0,hio=`You have illegal escape sequence in your template literal, most likely inside content's property value.
Because you write your CSS inside a JavaScript string you actually have to do double escaping, so for example "content: '\\00d7';" should become "content: '\\\\00d7';".
You can read more about this here:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals#ES2018_revision_of_illegal_escape_sequences`,_Ki="You have passed in falsy value as style object's key (can happen when in example you pass unexported component as computed key).",gKi=/[A-Z]|^ms/g,pio=/_EMO_([^_]+?)_([^]*?)_EMO_/g,omt=function(t){return t.charCodeAt(1)===45},dio=function(t){return t!=null&&typeof t!=="boolean"},qpt=nio(function(e){return omt(e)?e:e.replace(gKi,"-$&").toLowerCase()}),$Me=function(t,n){switch(t){case"animation":case"animationName":if(typeof n==="string")return n.replace(pio,function(o,r,i){return QP={name:r,styles:i,next:QP},r})}if(lio[t]!==1&&!omt(t)&&typeof n==="number"&&n!==0)return n+"px";return n};Jpt=/(var|attr|counters?|url|element|(((repeating-)?(linear|radial))|conic)-gradient)\(|(no-)?(open|close)-quote/,Zpt=["normal","none","initial","inherit","unset"],emt=$Me,tmt=/^-ms-/,nmt=/-(.)/g,KMe={},$Me=function(t,n){if(t==="content"){if(typeof n!=="string"||Zpt.indexOf(n)===-1&&!Jpt.test(n)&&(n.charAt(0)!==n.charAt(n.length-1)||n.charAt(0)!=='"'&&n.charAt(0)!=="'"))throw Error("You seem to be using a value for 'content' without quotes, try replacing it with `content: '\""+n+"\"'`")}var o=emt(t,n);if(o!==""&&!omt(t)&&t.indexOf("-")!==-1&&KMe[t]===void 0)KMe[t]=!0,console.error("Using kebab-case for css properties in objects is not supported. Did you mean "+t.replace(tmt,"ms-").replace(nmt,function(r,i){return i.toUpperCase()})+"?");return o};var Jpt,Zpt,emt,tmt,nmt,KMe,mio="Component selectors can only be used in conjunction with @emotion/babel-plugin, the swc Emotion plugin, or another Emotion-aware compiler transform.";function ime(e,t,n){if(n==null)return"";var o=n;if(o.__emotion_styles!==void 0){if(String(o)==="NO_COMPONENT_SELECTOR")throw Error(mio);return o}switch(typeof n){case"boolean":return"";case"object":{var r=n;if(r.anim===1)return QP={name:r.name,styles:r.styles,next:QP},r.name;var i=n;if(i.styles!==void 0){var s=i.next;if(s!==void 0)while(s!==void 0)QP={name:s.name,styles:s.styles,next:QP},s=s.next;var a=i.styles+";";return a}return AKi(e,t,n)}case"function":{if(e!==void 0){var c=QP,l=n(e);return QP=c,ime(e,t,l)}else console.error("Functions that are interpolated in css calls will be stringified.\nIf you want to have a css call based on props, create a function that returns a css call like this\nlet dynamicStyle = (props) => css`color: ${props.color}`\nIt can be called directly with props or interpolated in a styled call like this\nlet SomeComponent = styled('div')`${dynamicStyle}`");break}case"string":{var h=[],d=n.replace(pio,function(p,m,A){var g="animation"+h.length;return h.push("const "+g+" = keyframes`"+A.replace(/^@keyframes animation-\w+/,"")+"`"),"${"+g+"}"});if(h.length)console.error("`keyframes` output got interpolated into plain string, please wrap it with `css`.\n\nInstead of doing this:\n\n"+[].concat(h,["`"+d+"`"]).join(`
`)+`

You should wrap it with \`css\` like this:

css\``+d+"`")}break}var u=n;if(t==null)return u;var _=t[u];return _!==void 0?_:u}function AKi(e,t,n){var o="";if(Array.isArray(n))for(var r=0;r<n.length;r++)o+=ime(e,t,n[r])+";";else for(var i in n){var s=n[i];if(typeof s!=="object"){var a=s;if(t!=null&&t[a]!==void 0)o+=i+"{"+t[a]+"}";else if(dio(a))o+=qpt(i)+":"+$Me(i,a)+";"}else{if(i==="NO_COMPONENT_SELECTOR"&&mKi)throw Error(mio);if(Array.isArray(s)&&typeof s[0]==="string"&&(t==null||t[s[0]]===void 0)){for(var c=0;c<s.length;c++)if(dio(s[c]))o+=qpt(i)+":"+$Me(i,s[c])+";"}else{var l=ime(e,t,s);switch(i){case"animation":case"animationName":{o+=qpt(i)+":"+l+";";break}default:{if(i==="undefined")console.error(_Ki);o+=i+"{"+l+"}"}}}}}return o}var uio=/label:\s*([^\s;{]+)\s*(;|$)/g,QP;function qMe(e,t,n){if(e.length===1&&typeof e[0]==="object"&&e[0]!==null&&e[0].styles!==void 0)return e[0];var o=!0,r="";QP=void 0;var i=e[0];if(i==null||i.raw===void 0)o=!1,r+=ime(n,t,i);else{var s=i;if(s[0]===void 0)console.error(hio);r+=s[0]}for(var a=1;a<e.length;a++)if(r+=ime(n,t,e[a]),o){var c=i;if(c[a]===void 0)console.error(hio);r+=c[a]}uio.lastIndex=0;var l="",h;while((h=uio.exec(r))!==null)l+="-"+h[1];var d=cio(r)+l;{var u={name:d,styles:r,next:QP,toString:function(){return"You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."}};return u}}var fKi=!0;function rmt(e,t,n){var o="";return n.split(" ").forEach(function(r){if(e[r]!==void 0)t.push(e[r]+";");else if(r)o+=r+" "}),o}var yKi=function(t,n,o){var r=t.key+"-"+n.name;if((o===!1||fKi===!1)&&t.registered[r]===void 0)t.registered[r]=n.styles},_io=function(t,n,o){yKi(t,n,o);var r=t.key+"-"+n.name;if(t.inserted[n.name]===void 0){var i=n;do t.insert(n===i?"."+r:"",i,t.sheet,!0),i=i.next;while(i!==void 0)}};function gio(e,t){if(e.inserted[t.name]===void 0)return e.insert("",t,e.sheet,!0)}function Aio(e,t,n){var o=[],r=rmt(e,o,n);if(o.length<2)return n;return r+t(o)}var fio=function(t){var n=aio(t);n.sheet.speedy=function(a){if(this.ctr!==0)throw Error("speedy must be changed before any rules are inserted");this.isSpeedy=a},n.compat=!0;var o=function(){for(var c=arguments.length,l=Array(c),h=0;h<c;h++)l[h]=arguments[h];var d=qMe(l,n.registered,void 0);return _io(n,d,!1),n.key+"-"+d.name},r=function(){for(var c=arguments.length,l=Array(c),h=0;h<c;h++)l[h]=arguments[h];var d=qMe(l,n.registered),u="animation-"+d.name;return gio(n,{name:d.name,styles:"@keyframes "+u+"{"+d.styles+"}"}),u},i=function(){for(var c=arguments.length,l=Array(c),h=0;h<c;h++)l[h]=arguments[h];var d=qMe(l,n.registered);gio(n,d)},s=function(){for(var c=arguments.length,l=Array(c),h=0;h<c;h++)l[h]=arguments[h];return Aio(n.registered,o,xKi(l))};return{css:o,cx:s,injectGlobal:i,keyframes:r,hydrate:function(c){c.forEach(function(l){n.inserted[l]=!0})},flush:function(){n.registered={},n.inserted={},n.sheet.flush()},sheet:n.sheet,cache:n,getRegisteredStyles:rmt.bind(null,n.registered),merge:Aio.bind(null,n.registered,o)}},xKi=function e(t){var n="";for(var o=0;o<t.length;o++){var r=t[o];if(r==null)continue;var i=void 0;switch(typeof r){case"boolean":break;case"object":{if(Array.isArray(r))i=e(r);else{i="";for(var s in r)if(r[s]&&s)i&&(i+=" "),i+=s}break}default:i=r}if(i)n&&(n+=" "),n+=i}return n};var kP=fio({key:"css"}),{flush:C8a,hydrate:b8a,cx:I8a,merge:v8a,getRegisteredStyles:S8a,injectGlobal:P8a,keyframes:E8a,css:rT,sheet:M8a,cache:w8a}=kP;var xme=Qe(wt(),1),iT=Qe(so(),1),E0=Qe(so(),1);var KG=Qe(rn(),1),Cme=Qe(wt(),1),Emt=Qe(wt(),1),P_=Qe(so(),1),Hao=Qe(so(),1),Fao=Qe(so(),1),swe=Qe(wt(),1),sT=Qe(so(),1),zao=Qe(so(),1),vwe=Qe(rn(),1),ov=Qe(so(),1),iv=Qe(so(),1),Tte=Qe(wt(),1),Oao=Qe(wt(),1),Swe=Qe(rn(),1),Pwe=Qe(so(),1),bme=Qe(wt(),1),wmt=Qe(rn(),1),Ime=Qe(so(),1),Fl=Qe(rn(),1);var UG=Qe(rn(),1),Ewe=Qe(rn(),1),vme=Qe(rn(),1);var aT=Qe(rn(),1),Vao=Qe(Y8(),1),dd=Qe(so(),1),Yao=Qe(so(),1),VP=Qe(rn(),1),YP=Qe(rn(),1),np=Qe(so(),1),Vs=Qe(so(),1),Mwe=Qe(rn(),1),wwe=Qe(wt(),1),Sme=Qe(so(),1),Gao=Qe(rn(),1),Bmt=Qe(wt(),1),Wao=Qe(so(),1),b5=Qe(so(),1),Xao=Qe(wt(),1),FP=Qe(so(),1),jmt=Qe(rn(),1),{create:CKi,defineProperty:Tmt,getOwnPropertyDescriptor:bKi,getOwnPropertyNames:Dmt,getPrototypeOf:IKi}=Object,vKi=Object.prototype.hasOwnProperty,SKi=(e,t)=>function(){return e&&(t=(0,e[Dmt(e)[0]])(e=0)),t},Nmt=(e,t)=>function(){return t||(0,e[Dmt(e)[0]])((t={exports:{}}).exports,t),t.exports},PKi=(e,t)=>{for(var n in t)Tmt(e,n,{get:t[n],enumerable:!0})},EKi=(e,t,n,o)=>{if(t&&typeof t==="object"||typeof t==="function"){for(let r of Dmt(t))if(!vKi.call(e,r)&&r!==n)Tmt(e,r,{get:()=>t[r],enumerable:!(o=bKi(t,r))||o.enumerable})}return e},uso=(e,t,n)=>(n=e!=null?CKi(IKi(e)):{},EKi(t||!e||!e.__esModule?Tmt(n,"default",{value:e,enumerable:!0}):n,e)),MKi=Nmt({"node_modules/toggle-selection/index.js"(e,t){t.exports=function(){var n=document.getSelection();if(!n.rangeCount)return function(){};var o=document.activeElement,r=[];for(var i=0;i<n.rangeCount;i++)r.push(n.getRangeAt(i));switch(o.tagName.toUpperCase()){case"INPUT":case"TEXTAREA":o.blur();break;default:o=null;break}return n.removeAllRanges(),function(){if(n.type==="Caret"&&n.removeAllRanges(),!n.rangeCount)r.forEach(function(s){n.addRange(s)});o&&o.focus()}}}}),wKi=Nmt({"node_modules/copy-to-clipboard/index.js"(e,t){var n=MKi(),o={"text/plain":"Text","text/html":"Url",default:"Text"},r="Copy to clipboard: #{key}, Enter";function i(a){var c=(/mac os x/i.test(navigator.userAgent)?"⌘":"Ctrl")+"+C";return a.replace(/#{\s*key\s*}/g,c)}function s(a,c){var l,h,d,u,_,p,m=!1;if(!c)c={};l=c.debug||!1;try{d=n(),u=document.createRange(),_=document.getSelection(),p=document.createElement("span"),p.textContent=a,p.ariaHidden="true",p.style.all="unset",p.style.position="fixed",p.style.top=0,p.style.clip="rect(0, 0, 0, 0)",p.style.whiteSpace="pre",p.style.webkitUserSelect="text",p.style.MozUserSelect="text",p.style.msUserSelect="text",p.style.userSelect="text",p.addEventListener("copy",function(g){if(g.stopPropagation(),c.format)if(g.preventDefault(),typeof g.clipboardData>"u"){l&&console.warn("unable to use e.clipboardData"),l&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var f=o[c.format]||o.default;window.clipboardData.setData(f,a)}else g.clipboardData.clearData(),g.clipboardData.setData(c.format,a);if(c.onCopy)g.preventDefault(),c.onCopy(g.clipboardData)}),document.body.appendChild(p),u.selectNodeContents(p),_.addRange(u);var A=document.execCommand("copy");if(!A)throw Error("copy command was unsuccessful");m=!0}catch(g){l&&console.error("unable to copy using execCommand: ",g),l&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(c.format||"text",a),c.onCopy&&c.onCopy(window.clipboardData),m=!0}catch(f){l&&console.error("unable to copy using clipboardData: ",f),l&&console.error("falling back to prompt"),h=i("message"in c?c.message:r),window.prompt(h,a)}}finally{if(_)if(typeof _.removeRange=="function")_.removeRange(u);else _.removeAllRanges();if(p)document.body.removeChild(p);d()}return m}t.exports=s}}),pso={};PKi(pso,{default:()=>BKi});function BKi(){let e=URL.createObjectURL(new Blob(['"use strict";(()=>{var t4=Object.create;var F0=Object.defineProperty;var e4=Object.getOwnPropertyDescriptor;var n4=Object.getOwnPropertyNames;var r4=Object.getPrototypeOf,i4=Object.prototype.hasOwnProperty;var o4=(y,x,e)=>x in y?F0(y,x,{enumerable:!0,configurable:!0,writable:!0,value:e}):y[x]=e;var s4=(y,x)=>()=>(x||y((x={exports:{}}).exports,x),x.exports);var l4=(y,x,e,r)=>{if(x&&typeof x=="object"||typeof x=="function")for(let o of n4(x))!i4.call(y,o)&&o!==e&&F0(y,o,{get:()=>x[o],enumerable:!(r=e4(x,o))||r.enumerable});return y};var c4=(y,x,e)=>(e=y!=null?t4(r4(y)):{},l4(x||!y||!y.__esModule?F0(e,"default",{value:y,enumerable:!0}):e,y));var U=(y,x,e)=>o4(y,typeof x!="symbol"?x+"":x,e);var g5=s4((Y0,V0)=>{"use strict";(function(y,x){typeof Y0=="object"&&typeof V0<"u"?V0.exports=x():typeof define=="function"&&define.amd?define(x):(y=typeof globalThis<"u"?globalThis:y||self,y.polygonClipping=x())})(Y0,function(){"use strict";function y(u,t){var n={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},i,l,s,L;return L={next:p(0),throw:p(1),return:p(2)},typeof Symbol=="function"&&(L[Symbol.iterator]=function(){return this}),L;function p(d){return function(R){return m([d,R])}}function m(d){if(i)throw new TypeError("Generator is already executing.");for(;n;)try{if(i=1,l&&(s=d[0]&2?l.return:d[0]?l.throw||((s=l.return)&&s.call(l),0):l.next)&&!(s=s.call(l,d[1])).done)return s;switch(l=0,s&&(d=[d[0]&2,s.value]),d[0]){case 0:case 1:s=d;break;case 4:return n.label++,{value:d[1],done:!1};case 5:n.label++,l=d[1],d=[0];continue;case 7:d=n.ops.pop(),n.trys.pop();continue;default:if(s=n.trys,!(s=s.length>0&&s[s.length-1])&&(d[0]===6||d[0]===2)){n=0;continue}if(d[0]===3&&(!s||d[1]>s[0]&&d[1]<s[3])){n.label=d[1];break}if(d[0]===6&&n.label<s[1]){n.label=s[1],s=d;break}if(s&&n.label<s[2]){n.label=s[2],n.ops.push(d);break}s[2]&&n.ops.pop(),n.trys.pop();continue}d=t.call(u,n)}catch(R){d=[6,R],l=0}finally{i=s=0}if(d[0]&5)throw d[1];return{value:d[0]?d[1]:void 0,done:!0}}}var x=function(){function u(t,n){this.next=null,this.key=t,this.data=n,this.left=null,this.right=null}return u}();function e(u,t){return u>t?1:u<t?-1:0}function r(u,t,n){for(var i=new x(null,null),l=i,s=i;;){var L=n(u,t.key);if(L<0){if(t.left===null)break;if(n(u,t.left.key)<0){var p=t.left;if(t.left=p.right,p.right=t,t=p,t.left===null)break}s.left=t,s=t,t=t.left}else if(L>0){if(t.right===null)break;if(n(u,t.right.key)>0){var p=t.right;if(t.right=p.left,p.left=t,t=p,t.right===null)break}l.right=t,l=t,t=t.right}else break}return l.right=t.left,s.left=t.right,t.left=i.right,t.right=i.left,t}function o(u,t,n,i){var l=new x(u,t);if(n===null)return l.left=l.right=null,l;n=r(u,n,i);var s=i(u,n.key);return s<0?(l.left=n.left,l.right=n,n.left=null):s>=0&&(l.right=n.right,l.left=n,n.right=null),l}function c(u,t,n){var i=null,l=null;if(t){t=r(u,t,n);var s=n(t.key,u);s===0?(i=t.left,l=t.right):s<0?(l=t.right,t.right=null,i=t):(i=t.left,t.left=null,l=t)}return{left:i,right:l}}function a(u,t,n){return t===null?u:(u===null||(t=r(u.key,t,n),t.left=u),t)}function f(u,t,n,i,l){if(u){i(""+t+(n?"\\u2514\\u2500\\u2500 ":"\\u251C\\u2500\\u2500 ")+l(u)+`\n`);var s=t+(n?"    ":"\\u2502   ");u.left&&f(u.left,s,!1,i,l),u.right&&f(u.right,s,!0,i,l)}}var v=function(){function u(t){t===void 0&&(t=e),this._root=null,this._size=0,this._comparator=t}return u.prototype.insert=function(t,n){return this._size++,this._root=o(t,n,this._root,this._comparator)},u.prototype.add=function(t,n){var i=new x(t,n);this._root===null&&(i.left=i.right=null,this._size++,this._root=i);var l=this._comparator,s=r(t,this._root,l),L=l(t,s.key);return L===0?this._root=s:(L<0?(i.left=s.left,i.right=s,s.left=null):L>0&&(i.right=s.right,i.left=s,s.right=null),this._size++,this._root=i),this._root},u.prototype.remove=function(t){this._root=this._remove(t,this._root,this._comparator)},u.prototype._remove=function(t,n,i){var l;if(n===null)return null;n=r(t,n,i);var s=i(t,n.key);return s===0?(n.left===null?l=n.right:(l=r(t,n.left,i),l.right=n.right),this._size--,l):n},u.prototype.pop=function(){var t=this._root;if(t){for(;t.left;)t=t.left;return this._root=r(t.key,this._root,this._comparator),this._root=this._remove(t.key,this._root,this._comparator),{key:t.key,data:t.data}}return null},u.prototype.findStatic=function(t){for(var n=this._root,i=this._comparator;n;){var l=i(t,n.key);if(l===0)return n;l<0?n=n.left:n=n.right}return null},u.prototype.find=function(t){return this._root&&(this._root=r(t,this._root,this._comparator),this._comparator(t,this._root.key)!==0)?null:this._root},u.prototype.contains=function(t){for(var n=this._root,i=this._comparator;n;){var l=i(t,n.key);if(l===0)return!0;l<0?n=n.left:n=n.right}return!1},u.prototype.forEach=function(t,n){for(var i=this._root,l=[],s=!1;!s;)i!==null?(l.push(i),i=i.left):l.length!==0?(i=l.pop(),t.call(n,i),i=i.right):s=!0;return this},u.prototype.range=function(t,n,i,l){for(var s=[],L=this._comparator,p=this._root,m;s.length!==0||p;)if(p)s.push(p),p=p.left;else{if(p=s.pop(),m=L(p.key,n),m>0)break;if(L(p.key,t)>=0&&i.call(l,p))return this;p=p.right}return this},u.prototype.keys=function(){var t=[];return this.forEach(function(n){var i=n.key;return t.push(i)}),t},u.prototype.values=function(){var t=[];return this.forEach(function(n){var i=n.data;return t.push(i)}),t},u.prototype.min=function(){return this._root?this.minNode(this._root).key:null},u.prototype.max=function(){return this._root?this.maxNode(this._root).key:null},u.prototype.minNode=function(t){if(t===void 0&&(t=this._root),t)for(;t.left;)t=t.left;return t},u.prototype.maxNode=function(t){if(t===void 0&&(t=this._root),t)for(;t.right;)t=t.right;return t},u.prototype.at=function(t){for(var n=this._root,i=!1,l=0,s=[];!i;)if(n)s.push(n),n=n.left;else if(s.length>0){if(n=s.pop(),l===t)return n;l++,n=n.right}else i=!0;return null},u.prototype.next=function(t){var n=this._root,i=null;if(t.right){for(i=t.right;i.left;)i=i.left;return i}for(var l=this._comparator;n;){var s=l(t.key,n.key);if(s===0)break;s<0?(i=n,n=n.left):n=n.right}return i},u.prototype.prev=function(t){var n=this._root,i=null;if(t.left!==null){for(i=t.left;i.right;)i=i.right;return i}for(var l=this._comparator;n;){var s=l(t.key,n.key);if(s===0)break;s<0?n=n.left:(i=n,n=n.right)}return i},u.prototype.clear=function(){return this._root=null,this._size=0,this},u.prototype.toList=function(){return I(this._root)},u.prototype.load=function(t,n,i){n===void 0&&(n=[]),i===void 0&&(i=!1);var l=t.length,s=this._comparator;if(i&&g(t,n,0,l-1,s),this._root===null)this._root=w(t,n,0,l),this._size=l;else{var L=k(this.toList(),T(t,n),s);l=this._size+l,this._root=b({head:L},0,l)}return this},u.prototype.isEmpty=function(){return this._root===null},Object.defineProperty(u.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),Object.defineProperty(u.prototype,"root",{get:function(){return this._root},enumerable:!0,configurable:!0}),u.prototype.toString=function(t){t===void 0&&(t=function(i){return String(i.key)});var n=[];return f(this._root,"",!0,function(i){return n.push(i)},t),n.join("")},u.prototype.update=function(t,n,i){var l=this._comparator,s=c(t,this._root,l),L=s.left,p=s.right;l(t,n)<0?p=o(n,i,p,l):L=o(n,i,L,l),this._root=a(L,p,l)},u.prototype.split=function(t){return c(t,this._root,this._comparator)},u.prototype[Symbol.iterator]=function(){var t,n,i;return y(this,function(l){switch(l.label){case 0:t=this._root,n=[],i=!1,l.label=1;case 1:return i?[3,6]:t===null?[3,2]:(n.push(t),t=t.left,[3,5]);case 2:return n.length===0?[3,4]:(t=n.pop(),[4,t]);case 3:return l.sent(),t=t.right,[3,5];case 4:i=!0,l.label=5;case 5:return[3,1];case 6:return[2]}})},u}();function w(u,t,n,i){var l=i-n;if(l>0){var s=n+Math.floor(l/2),L=u[s],p=t[s],m=new x(L,p);return m.left=w(u,t,n,s),m.right=w(u,t,s+1,i),m}return null}function T(u,t){for(var n=new x(null,null),i=n,l=0;l<u.length;l++)i=i.next=new x(u[l],t[l]);return i.next=null,n.next}function I(u){for(var t=u,n=[],i=!1,l=new x(null,null),s=l;!i;)t?(n.push(t),t=t.left):n.length>0?(t=s=s.next=n.pop(),t=t.right):i=!0;return s.next=null,l.next}function b(u,t,n){var i=n-t;if(i>0){var l=t+Math.floor(i/2),s=b(u,t,l),L=u.head;return L.left=s,u.head=u.head.next,L.right=b(u,l+1,n),L}return null}function k(u,t,n){for(var i=new x(null,null),l=i,s=u,L=t;s!==null&&L!==null;)n(s.key,L.key)<0?(l.next=s,s=s.next):(l.next=L,L=L.next),l=l.next;return s!==null?l.next=s:L!==null&&(l.next=L),i.next}function g(u,t,n,i,l){if(!(n>=i)){for(var s=u[n+i>>1],L=n-1,p=i+1;;){do L++;while(l(u[L],s)<0);do p--;while(l(u[p],s)>0);if(L>=p)break;var m=u[L];u[L]=u[p],u[p]=m,m=t[L],t[L]=t[p],t[p]=m}g(u,t,n,p,l),g(u,t,p+1,i,l)}}let P=(u,t)=>u.ll.x<=t.x&&t.x<=u.ur.x&&u.ll.y<=t.y&&t.y<=u.ur.y,N=(u,t)=>{if(t.ur.x<u.ll.x||u.ur.x<t.ll.x||t.ur.y<u.ll.y||u.ur.y<t.ll.y)return null;let n=u.ll.x<t.ll.x?t.ll.x:u.ll.x,i=u.ur.x<t.ur.x?u.ur.x:t.ur.x,l=u.ll.y<t.ll.y?t.ll.y:u.ll.y,s=u.ur.y<t.ur.y?u.ur.y:t.ur.y;return{ll:{x:n,y:l},ur:{x:i,y:s}}},A=Number.EPSILON;A===void 0&&(A=Math.pow(2,-52));let E=A*A,S=(u,t)=>{if(-A<u&&u<A&&-A<t&&t<A)return 0;let n=u-t;return n*n<E*u*t?0:u<t?-1:1};class O{constructor(){this.reset()}reset(){this.xRounder=new s0,this.yRounder=new s0}round(t,n){return{x:this.xRounder.round(t),y:this.yRounder.round(n)}}}class s0{constructor(){this.tree=new v,this.round(0)}round(t){let n=this.tree.add(t),i=this.tree.prev(n);if(i!==null&&S(n.key,i.key)===0)return this.tree.remove(t),i.key;let l=this.tree.next(n);return l!==null&&S(n.key,l.key)===0?(this.tree.remove(t),l.key):t}}let J=new O,H=11102230246251565e-32,V=134217729,C5=(3+8*H)*H;function U0(u,t,n,i,l){let s,L,p,m,d=t[0],R=i[0],h=0,_=0;R>d==R>-d?(s=d,d=t[++h]):(s=R,R=i[++_]);let M=0;if(h<u&&_<n)for(R>d==R>-d?(L=d+s,p=s-(L-d),d=t[++h]):(L=R+s,p=s-(L-R),R=i[++_]),s=L,p!==0&&(l[M++]=p);h<u&&_<n;)R>d==R>-d?(L=s+d,m=L-s,p=s-(L-m)+(d-m),d=t[++h]):(L=s+R,m=L-s,p=s-(L-m)+(R-m),R=i[++_]),s=L,p!==0&&(l[M++]=p);for(;h<u;)L=s+d,m=L-s,p=s-(L-m)+(d-m),d=t[++h],s=L,p!==0&&(l[M++]=p);for(;_<n;)L=s+R,m=L-s,p=s-(L-m)+(R-m),R=i[++_],s=L,p!==0&&(l[M++]=p);return(s!==0||M===0)&&(l[M++]=s),M}function B5(u,t){let n=t[0];for(let i=1;i<u;i++)n+=t[i];return n}function v0(u){return new Float64Array(u)}let U5=(3+16*H)*H,F5=(2+12*H)*H,W5=(9+64*H)*H*H,p0=v0(4),x5=v0(8),t5=v0(12),e5=v0(16),q=v0(4);function z5(u,t,n,i,l,s,L){let p,m,d,R,h,_,M,C,G,F,B,W,X,Y,Z,j,y0,D,n0=u-l,r0=n-l,i0=t-s,o0=i-s;Y=n0*o0,_=V*n0,M=_-(_-n0),C=n0-M,_=V*o0,G=_-(_-o0),F=o0-G,Z=C*F-(Y-M*G-C*G-M*F),j=i0*r0,_=V*i0,M=_-(_-i0),C=i0-M,_=V*r0,G=_-(_-r0),F=r0-G,y0=C*F-(j-M*G-C*G-M*F),B=Z-y0,h=Z-B,p0[0]=Z-(B+h)+(h-y0),W=Y+B,h=W-Y,X=Y-(W-h)+(B-h),B=X-j,h=X-B,p0[1]=X-(B+h)+(h-j),D=W+B,h=D-W,p0[2]=W-(D-h)+(B-h),p0[3]=D;let l0=B5(4,p0),w0=F5*L;if(l0>=w0||-l0>=w0||(h=u-n0,p=u-(n0+h)+(h-l),h=n-r0,d=n-(r0+h)+(h-l),h=t-i0,m=t-(i0+h)+(h-s),h=i-o0,R=i-(o0+h)+(h-s),p===0&&m===0&&d===0&&R===0)||(w0=W5*L+C5*Math.abs(l0),l0+=n0*R+o0*p-(i0*d+r0*m),l0>=w0||-l0>=w0))return l0;Y=p*o0,_=V*p,M=_-(_-p),C=p-M,_=V*o0,G=_-(_-o0),F=o0-G,Z=C*F-(Y-M*G-C*G-M*F),j=m*r0,_=V*m,M=_-(_-m),C=m-M,_=V*r0,G=_-(_-r0),F=r0-G,y0=C*F-(j-M*G-C*G-M*F),B=Z-y0,h=Z-B,q[0]=Z-(B+h)+(h-y0),W=Y+B,h=W-Y,X=Y-(W-h)+(B-h),B=X-j,h=X-B,q[1]=X-(B+h)+(h-j),D=W+B,h=D-W,q[2]=W-(D-h)+(B-h),q[3]=D;let K5=U0(4,p0,4,q,x5);Y=n0*R,_=V*n0,M=_-(_-n0),C=n0-M,_=V*R,G=_-(_-R),F=R-G,Z=C*F-(Y-M*G-C*G-M*F),j=i0*d,_=V*i0,M=_-(_-i0),C=i0-M,_=V*d,G=_-(_-d),F=d-G,y0=C*F-(j-M*G-C*G-M*F),B=Z-y0,h=Z-B,q[0]=Z-(B+h)+(h-y0),W=Y+B,h=W-Y,X=Y-(W-h)+(B-h),B=X-j,h=X-B,q[1]=X-(B+h)+(h-j),D=W+B,h=D-W,q[2]=W-(D-h)+(B-h),q[3]=D;let y4=U0(K5,x5,4,q,t5);Y=p*R,_=V*p,M=_-(_-p),C=p-M,_=V*R,G=_-(_-R),F=R-G,Z=C*F-(Y-M*G-C*G-M*F),j=m*d,_=V*m,M=_-(_-m),C=m-M,_=V*d,G=_-(_-d),F=d-G,y0=C*F-(j-M*G-C*G-M*F),B=Z-y0,h=Z-B,q[0]=Z-(B+h)+(h-y0),W=Y+B,h=W-Y,X=Y-(W-h)+(B-h),B=X-j,h=X-B,q[1]=X-(B+h)+(h-j),D=W+B,h=D-W,q[2]=W-(D-h)+(B-h),q[3]=D;let x4=U0(y4,t5,4,q,e5);return e5[x4-1]}function $5(u,t,n,i,l,s){let L=(t-s)*(n-l),p=(u-l)*(i-s),m=L-p,d=Math.abs(L+p);return Math.abs(m)>=U5*d?m:-z5(u,t,n,i,l,s,d)}let R0=(u,t)=>u.x*t.y-u.y*t.x,n5=(u,t)=>u.x*t.x+u.y*t.y,r5=(u,t,n)=>{let i=$5(u.x,u.y,t.x,t.y,n.x,n.y);return i>0?-1:i<0?1:0},k0=u=>Math.sqrt(n5(u,u)),Y5=(u,t,n)=>{let i={x:t.x-u.x,y:t.y-u.y},l={x:n.x-u.x,y:n.y-u.y};return R0(l,i)/k0(l)/k0(i)},V5=(u,t,n)=>{let i={x:t.x-u.x,y:t.y-u.y},l={x:n.x-u.x,y:n.y-u.y};return n5(l,i)/k0(l)/k0(i)},i5=(u,t,n)=>t.y===0?null:{x:u.x+t.x/t.y*(n-u.y),y:n},o5=(u,t,n)=>t.x===0?null:{x:n,y:u.y+t.y/t.x*(n-u.x)},X5=(u,t,n,i)=>{if(t.x===0)return o5(n,i,u.x);if(i.x===0)return o5(u,t,n.x);if(t.y===0)return i5(n,i,u.y);if(i.y===0)return i5(u,t,n.y);let l=R0(t,i);if(l==0)return null;let s={x:n.x-u.x,y:n.y-u.y},L=R0(s,t)/l,p=R0(s,i)/l,m=u.x+p*t.x,d=n.x+L*i.x,R=u.y+p*t.y,h=n.y+L*i.y,_=(m+d)/2,M=(R+h)/2;return{x:_,y:M}};class K{static compare(t,n){let i=K.comparePoints(t.point,n.point);return i!==0?i:(t.point!==n.point&&t.link(n),t.isLeft!==n.isLeft?t.isLeft?1:-1:a0.compare(t.segment,n.segment))}static comparePoints(t,n){return t.x<n.x?-1:t.x>n.x?1:t.y<n.y?-1:t.y>n.y?1:0}constructor(t,n){t.events===void 0?t.events=[this]:t.events.push(this),this.point=t,this.isLeft=n}link(t){if(t.point===this.point)throw new Error("Tried to link already linked events");let n=t.point.events;for(let i=0,l=n.length;i<l;i++){let s=n[i];this.point.events.push(s),s.point=this.point}this.checkForConsuming()}checkForConsuming(){let t=this.point.events.length;for(let n=0;n<t;n++){let i=this.point.events[n];if(i.segment.consumedBy===void 0)for(let l=n+1;l<t;l++){let s=this.point.events[l];s.consumedBy===void 0&&i.otherSE.point.events===s.otherSE.point.events&&i.segment.consume(s.segment)}}}getAvailableLinkedEvents(){let t=[];for(let n=0,i=this.point.events.length;n<i;n++){let l=this.point.events[n];l!==this&&!l.segment.ringOut&&l.segment.isInResult()&&t.push(l)}return t}getLeftmostComparator(t){let n=new Map,i=l=>{let s=l.otherSE;n.set(l,{sine:Y5(this.point,t.point,s.point),cosine:V5(this.point,t.point,s.point)})};return(l,s)=>{n.has(l)||i(l),n.has(s)||i(s);let{sine:L,cosine:p}=n.get(l),{sine:m,cosine:d}=n.get(s);return L>=0&&m>=0?p<d?1:p>d?-1:0:L<0&&m<0?p<d?-1:p>d?1:0:m<L?-1:m>L?1:0}}}let Z5=0;class a0{static compare(t,n){let i=t.leftSE.point.x,l=n.leftSE.point.x,s=t.rightSE.point.x,L=n.rightSE.point.x;if(L<i)return 1;if(s<l)return-1;let p=t.leftSE.point.y,m=n.leftSE.point.y,d=t.rightSE.point.y,R=n.rightSE.point.y;if(i<l){if(m<p&&m<d)return 1;if(m>p&&m>d)return-1;let h=t.comparePoint(n.leftSE.point);if(h<0)return 1;if(h>0)return-1;let _=n.comparePoint(t.rightSE.point);return _!==0?_:-1}if(i>l){if(p<m&&p<R)return-1;if(p>m&&p>R)return 1;let h=n.comparePoint(t.leftSE.point);if(h!==0)return h;let _=t.comparePoint(n.rightSE.point);return _<0?1:_>0?-1:1}if(p<m)return-1;if(p>m)return 1;if(s<L){let h=n.comparePoint(t.rightSE.point);if(h!==0)return h}if(s>L){let h=t.comparePoint(n.rightSE.point);if(h<0)return 1;if(h>0)return-1}if(s!==L){let h=d-p,_=s-i,M=R-m,C=L-l;if(h>_&&M<C)return 1;if(h<_&&M>C)return-1}return s>L?1:s<L||d<R?-1:d>R?1:t.id<n.id?-1:t.id>n.id?1:0}constructor(t,n,i,l){this.id=++Z5,this.leftSE=t,t.segment=this,t.otherSE=n,this.rightSE=n,n.segment=this,n.otherSE=t,this.rings=i,this.windings=l}static fromRing(t,n,i){let l,s,L,p=K.comparePoints(t,n);if(p<0)l=t,s=n,L=1;else if(p>0)l=n,s=t,L=-1;else throw new Error(`Tried to create degenerate segment at [${t.x}, ${t.y}]`);let m=new K(l,!0),d=new K(s,!1);return new a0(m,d,[i],[L])}replaceRightSE(t){this.rightSE=t,this.rightSE.segment=this,this.rightSE.otherSE=this.leftSE,this.leftSE.otherSE=this.rightSE}bbox(){let t=this.leftSE.point.y,n=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:t<n?t:n},ur:{x:this.rightSE.point.x,y:t>n?t:n}}}vector(){return{x:this.rightSE.point.x-this.leftSE.point.x,y:this.rightSE.point.y-this.leftSE.point.y}}isAnEndpoint(t){return t.x===this.leftSE.point.x&&t.y===this.leftSE.point.y||t.x===this.rightSE.point.x&&t.y===this.rightSE.point.y}comparePoint(t){if(this.isAnEndpoint(t))return 0;let n=this.leftSE.point,i=this.rightSE.point,l=this.vector();if(n.x===i.x)return t.x===n.x?0:t.x<n.x?1:-1;let s=(t.y-n.y)/l.y,L=n.x+s*l.x;if(t.x===L)return 0;let p=(t.x-n.x)/l.x,m=n.y+p*l.y;return t.y===m?0:t.y<m?-1:1}getIntersection(t){let n=this.bbox(),i=t.bbox(),l=N(n,i);if(l===null)return null;let s=this.leftSE.point,L=this.rightSE.point,p=t.leftSE.point,m=t.rightSE.point,d=P(n,p)&&this.comparePoint(p)===0,R=P(i,s)&&t.comparePoint(s)===0,h=P(n,m)&&this.comparePoint(m)===0,_=P(i,L)&&t.comparePoint(L)===0;if(R&&d)return _&&!h?L:!_&&h?m:null;if(R)return h&&s.x===m.x&&s.y===m.y?null:s;if(d)return _&&L.x===p.x&&L.y===p.y?null:p;if(_&&h)return null;if(_)return L;if(h)return m;let M=X5(s,this.vector(),p,t.vector());return M===null||!P(l,M)?null:J.round(M.x,M.y)}split(t){let n=[],i=t.events!==void 0,l=new K(t,!0),s=new K(t,!1),L=this.rightSE;this.replaceRightSE(s),n.push(s),n.push(l);let p=new a0(l,L,this.rings.slice(),this.windings.slice());return K.comparePoints(p.leftSE.point,p.rightSE.point)>0&&p.swapEvents(),K.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),i&&(l.checkForConsuming(),s.checkForConsuming()),n}swapEvents(){let t=this.rightSE;this.rightSE=this.leftSE,this.leftSE=t,this.leftSE.isLeft=!0,this.rightSE.isLeft=!1;for(let n=0,i=this.windings.length;n<i;n++)this.windings[n]*=-1}consume(t){let n=this,i=t;for(;n.consumedBy;)n=n.consumedBy;for(;i.consumedBy;)i=i.consumedBy;let l=a0.compare(n,i);if(l!==0){if(l>0){let s=n;n=i,i=s}if(n.prev===i){let s=n;n=i,i=s}for(let s=0,L=i.rings.length;s<L;s++){let p=i.rings[s],m=i.windings[s],d=n.rings.indexOf(p);d===-1?(n.rings.push(p),n.windings.push(m)):n.windings[d]+=m}i.rings=null,i.windings=null,i.consumedBy=n,i.leftSE.consumedBy=n.leftSE,i.rightSE.consumedBy=n.rightSE}}prevInResult(){return this._prevInResult!==void 0?this._prevInResult:(this.prev?this.prev.isInResult()?this._prevInResult=this.prev:this._prevInResult=this.prev.prevInResult():this._prevInResult=null,this._prevInResult)}beforeState(){if(this._beforeState!==void 0)return this._beforeState;if(!this.prev)this._beforeState={rings:[],windings:[],multiPolys:[]};else{let t=this.prev.consumedBy||this.prev;this._beforeState=t.afterState()}return this._beforeState}afterState(){if(this._afterState!==void 0)return this._afterState;let t=this.beforeState();this._afterState={rings:t.rings.slice(0),windings:t.windings.slice(0),multiPolys:[]};let n=this._afterState.rings,i=this._afterState.windings,l=this._afterState.multiPolys;for(let p=0,m=this.rings.length;p<m;p++){let d=this.rings[p],R=this.windings[p],h=n.indexOf(d);h===-1?(n.push(d),i.push(R)):i[h]+=R}let s=[],L=[];for(let p=0,m=n.length;p<m;p++){if(i[p]===0)continue;let d=n[p],R=d.poly;if(L.indexOf(R)===-1)if(d.isExterior)s.push(R);else{L.indexOf(R)===-1&&L.push(R);let h=s.indexOf(d.poly);h!==-1&&s.splice(h,1)}}for(let p=0,m=s.length;p<m;p++){let d=s[p].multiPoly;l.indexOf(d)===-1&&l.push(d)}return this._afterState}isInResult(){if(this.consumedBy)return!1;if(this._isInResult!==void 0)return this._isInResult;let t=this.beforeState().multiPolys,n=this.afterState().multiPolys;switch(e0.type){case"union":{let i=t.length===0,l=n.length===0;this._isInResult=i!==l;break}case"intersection":{let i,l;t.length<n.length?(i=t.length,l=n.length):(i=n.length,l=t.length),this._isInResult=l===e0.numMultiPolys&&i<l;break}case"xor":{let i=Math.abs(t.length-n.length);this._isInResult=i%2===1;break}case"difference":{let i=l=>l.length===1&&l[0].isSubject;this._isInResult=i(t)!==i(n);break}default:throw new Error(`Unrecognized operation type found ${e0.type}`)}return this._isInResult}}class s5{constructor(t,n,i){if(!Array.isArray(t)||t.length===0)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=n,this.isExterior=i,this.segments=[],typeof t[0][0]!="number"||typeof t[0][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");let l=J.round(t[0][0],t[0][1]);this.bbox={ll:{x:l.x,y:l.y},ur:{x:l.x,y:l.y}};let s=l;for(let L=1,p=t.length;L<p;L++){if(typeof t[L][0]!="number"||typeof t[L][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");let m=J.round(t[L][0],t[L][1]);m.x===s.x&&m.y===s.y||(this.segments.push(a0.fromRing(s,m,this)),m.x<this.bbox.ll.x&&(this.bbox.ll.x=m.x),m.y<this.bbox.ll.y&&(this.bbox.ll.y=m.y),m.x>this.bbox.ur.x&&(this.bbox.ur.x=m.x),m.y>this.bbox.ur.y&&(this.bbox.ur.y=m.y),s=m)}(l.x!==s.x||l.y!==s.y)&&this.segments.push(a0.fromRing(s,l,this))}getSweepEvents(){let t=[];for(let n=0,i=this.segments.length;n<i;n++){let l=this.segments[n];t.push(l.leftSE),t.push(l.rightSE)}return t}}class j5{constructor(t,n){if(!Array.isArray(t))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");this.exteriorRing=new s5(t[0],this,!0),this.bbox={ll:{x:this.exteriorRing.bbox.ll.x,y:this.exteriorRing.bbox.ll.y},ur:{x:this.exteriorRing.bbox.ur.x,y:this.exteriorRing.bbox.ur.y}},this.interiorRings=[];for(let i=1,l=t.length;i<l;i++){let s=new s5(t[i],this,!1);s.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=s.bbox.ll.x),s.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=s.bbox.ll.y),s.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=s.bbox.ur.x),s.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=s.bbox.ur.y),this.interiorRings.push(s)}this.multiPoly=n}getSweepEvents(){let t=this.exteriorRing.getSweepEvents();for(let n=0,i=this.interiorRings.length;n<i;n++){let l=this.interiorRings[n].getSweepEvents();for(let s=0,L=l.length;s<L;s++)t.push(l[s])}return t}}class l5{constructor(t,n){if(!Array.isArray(t))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");try{typeof t[0][0][0]=="number"&&(t=[t])}catch{}this.polys=[],this.bbox={ll:{x:Number.POSITIVE_INFINITY,y:Number.POSITIVE_INFINITY},ur:{x:Number.NEGATIVE_INFINITY,y:Number.NEGATIVE_INFINITY}};for(let i=0,l=t.length;i<l;i++){let s=new j5(t[i],this);s.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=s.bbox.ll.x),s.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=s.bbox.ll.y),s.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=s.bbox.ur.x),s.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=s.bbox.ur.y),this.polys.push(s)}this.isSubject=n}getSweepEvents(){let t=[];for(let n=0,i=this.polys.length;n<i;n++){let l=this.polys[n].getSweepEvents();for(let s=0,L=l.length;s<L;s++)t.push(l[s])}return t}}class A0{static factory(t){let n=[];for(let i=0,l=t.length;i<l;i++){let s=t[i];if(!s.isInResult()||s.ringOut)continue;let L=null,p=s.leftSE,m=s.rightSE,d=[p],R=p.point,h=[];for(;L=p,p=m,d.push(p),p.point!==R;)for(;;){let _=p.getAvailableLinkedEvents();if(_.length===0){let G=d[0].point,F=d[d.length-1].point;throw new Error(`Unable to complete output ring starting at [${G.x}, ${G.y}]. Last matching segment found ends at [${F.x}, ${F.y}].`)}if(_.length===1){m=_[0].otherSE;break}let M=null;for(let G=0,F=h.length;G<F;G++)if(h[G].point===p.point){M=G;break}if(M!==null){let G=h.splice(M)[0],F=d.splice(G.index);F.unshift(F[0].otherSE),n.push(new A0(F.reverse()));continue}h.push({index:d.length,point:p.point});let C=p.getLeftmostComparator(L);m=_.sort(C)[0].otherSE;break}n.push(new A0(d))}return n}constructor(t){this.events=t;for(let n=0,i=t.length;n<i;n++)t[n].segment.ringOut=this;this.poly=null}getGeom(){let t=this.events[0].point,n=[t];for(let d=1,R=this.events.length-1;d<R;d++){let h=this.events[d].point,_=this.events[d+1].point;r5(h,t,_)!==0&&(n.push(h),t=h)}if(n.length===1)return null;let i=n[0],l=n[1];r5(i,t,l)===0&&n.shift(),n.push(n[0]);let s=this.isExteriorRing()?1:-1,L=this.isExteriorRing()?0:n.length-1,p=this.isExteriorRing()?n.length:-1,m=[];for(let d=L;d!=p;d+=s)m.push([n[d].x,n[d].y]);return m}isExteriorRing(){if(this._isExteriorRing===void 0){let t=this.enclosingRing();this._isExteriorRing=t?!t.isExteriorRing():!0}return this._isExteriorRing}enclosingRing(){return this._enclosingRing===void 0&&(this._enclosingRing=this._calcEnclosingRing()),this._enclosingRing}_calcEnclosingRing(){let t=this.events[0];for(let l=1,s=this.events.length;l<s;l++){let L=this.events[l];K.compare(t,L)>0&&(t=L)}let n=t.segment.prevInResult(),i=n?n.prevInResult():null;for(;;){if(!n)return null;if(!i)return n.ringOut;if(i.ringOut!==n.ringOut)return i.ringOut.enclosingRing()!==n.ringOut?n.ringOut:n.ringOut.enclosingRing();n=i.prevInResult(),i=n?n.prevInResult():null}}}class c5{constructor(t){this.exteriorRing=t,t.poly=this,this.interiorRings=[]}addInterior(t){this.interiorRings.push(t),t.poly=this}getGeom(){let t=[this.exteriorRing.getGeom()];if(t[0]===null)return null;for(let n=0,i=this.interiorRings.length;n<i;n++){let l=this.interiorRings[n].getGeom();l!==null&&t.push(l)}return t}}class D5{constructor(t){this.rings=t,this.polys=this._composePolys(t)}getGeom(){let t=[];for(let n=0,i=this.polys.length;n<i;n++){let l=this.polys[n].getGeom();l!==null&&t.push(l)}return t}_composePolys(t){let n=[];for(let i=0,l=t.length;i<l;i++){let s=t[i];if(!s.poly)if(s.isExteriorRing())n.push(new c5(s));else{let L=s.enclosingRing();L.poly||n.push(new c5(L)),L.poly.addInterior(s)}}return n}}class q5{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:a0.compare;this.queue=t,this.tree=new v(n),this.segments=[]}process(t){let n=t.segment,i=[];if(t.consumedBy)return t.isLeft?this.queue.remove(t.otherSE):this.tree.remove(n),i;let l=t.isLeft?this.tree.add(n):this.tree.find(n);if(!l)throw new Error(`Unable to find segment #${n.id} [${n.leftSE.point.x}, ${n.leftSE.point.y}] -> [${n.rightSE.point.x}, ${n.rightSE.point.y}] in SweepLine tree.`);let s=l,L=l,p,m;for(;p===void 0;)s=this.tree.prev(s),s===null?p=null:s.key.consumedBy===void 0&&(p=s.key);for(;m===void 0;)L=this.tree.next(L),L===null?m=null:L.key.consumedBy===void 0&&(m=L.key);if(t.isLeft){let d=null;if(p){let h=p.getIntersection(n);if(h!==null&&(n.isAnEndpoint(h)||(d=h),!p.isAnEndpoint(h))){let _=this._splitSafely(p,h);for(let M=0,C=_.length;M<C;M++)i.push(_[M])}}let R=null;if(m){let h=m.getIntersection(n);if(h!==null&&(n.isAnEndpoint(h)||(R=h),!m.isAnEndpoint(h))){let _=this._splitSafely(m,h);for(let M=0,C=_.length;M<C;M++)i.push(_[M])}}if(d!==null||R!==null){let h=null;d===null?h=R:R===null?h=d:h=K.comparePoints(d,R)<=0?d:R,this.queue.remove(n.rightSE),i.push(n.rightSE);let _=n.split(h);for(let M=0,C=_.length;M<C;M++)i.push(_[M])}i.length>0?(this.tree.remove(n),i.push(t)):(this.segments.push(n),n.prev=p)}else{if(p&&m){let d=p.getIntersection(m);if(d!==null){if(!p.isAnEndpoint(d)){let R=this._splitSafely(p,d);for(let h=0,_=R.length;h<_;h++)i.push(R[h])}if(!m.isAnEndpoint(d)){let R=this._splitSafely(m,d);for(let h=0,_=R.length;h<_;h++)i.push(R[h])}}}this.tree.remove(n)}return i}_splitSafely(t,n){this.tree.remove(t);let i=t.rightSE;this.queue.remove(i);let l=t.split(n);return l.push(i),t.consumedBy===void 0&&this.tree.add(t),l}}let a5=typeof process<"u"&&process.env.POLYGON_CLIPPING_MAX_QUEUE_SIZE||1e6,H5=typeof process<"u"&&process.env.POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS||1e6;class Q5{run(t,n,i){e0.type=t,J.reset();let l=[new l5(n,!0)];for(let h=0,_=i.length;h<_;h++)l.push(new l5(i[h],!1));if(e0.numMultiPolys=l.length,e0.type==="difference"){let h=l[0],_=1;for(;_<l.length;)N(l[_].bbox,h.bbox)!==null?_++:l.splice(_,1)}if(e0.type==="intersection")for(let h=0,_=l.length;h<_;h++){let M=l[h];for(let C=h+1,G=l.length;C<G;C++)if(N(M.bbox,l[C].bbox)===null)return[]}let s=new v(K.compare);for(let h=0,_=l.length;h<_;h++){let M=l[h].getSweepEvents();for(let C=0,G=M.length;C<G;C++)if(s.insert(M[C]),s.size>a5)throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big).")}let L=new q5(s),p=s.size,m=s.pop();for(;m;){let h=m.key;if(s.size===p){let M=h.segment;throw new Error(`Unable to pop() ${h.isLeft?"left":"right"} SweepEvent [${h.point.x}, ${h.point.y}] from segment #${M.id} [${M.leftSE.point.x}, ${M.leftSE.point.y}] -> [${M.rightSE.point.x}, ${M.rightSE.point.y}] from queue.`)}if(s.size>a5)throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big).");if(L.segments.length>H5)throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments).");let _=L.process(h);for(let M=0,C=_.length;M<C;M++){let G=_[M];G.consumedBy===void 0&&s.insert(G)}p=s.size,m=s.pop()}J.reset();let d=A0.factory(L.segments);return new D5(d).getGeom()}}let e0=new Q5;var J5={union:function(u){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];return e0.run("union",u,n)},intersection:function(u){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];return e0.run("intersection",u,n)},xor:function(u){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];return e0.run("xor",u,n)},difference:function(u){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];return e0.run("difference",u,n)}};return J5})});function $0(y,x,e=2){let r=x&&x.length,o=r?x[0]*e:y.length,c=f5(y,0,o,e,!0),a=[];if(!c||c.next===c.prev)return a;let f,v,w;if(r&&(c=p4(y,x,c,e)),y.length>80*e){f=y[0],v=y[1];let T=f,I=v;for(let b=e;b<o;b+=e){let k=y[b],g=y[b+1];k<f&&(f=k),g<v&&(v=g),k>T&&(T=k),g>I&&(I=g)}w=Math.max(T-f,I-v),w=w!==0?32767/w:0}return M0(c,a,e,f,v,w,0),a}function f5(y,x,e,r,o){let c;if(o===S4(y,x,e,r)>0)for(let a=x;a<e;a+=r)c=u5(a/r|0,y[a],y[a+1],c);else for(let a=e-r;a>=x;a-=r)c=u5(a/r|0,y[a],y[a+1],c);return c&&L0(c,c.next)&&(S0(c),c=c.next),c}function u0(y,x){if(!y)return y;x||(x=y);let e=y,r;do if(r=!1,!e.steiner&&(L0(e,e.next)||z(e.prev,e,e.next)===0)){if(S0(e),e=x=e.prev,e===e.next)break;r=!0}else e=e.next;while(r||e!==x);return x}function M0(y,x,e,r,o,c,a){if(!y)return;!a&&c&&_4(y,r,o,c);let f=y;for(;y.prev!==y.next;){let v=y.prev,w=y.next;if(c?u4(y,r,o,c):a4(y)){x.push(v.i,y.i,w.i),S0(y),y=w.next,f=w.next;continue}if(y=w,y===f){a?a===1?(y=f4(u0(y),x),M0(y,x,e,r,o,c,2)):a===2&&h4(y,x,e,r,o,c):M0(u0(y),x,e,r,o,c,1);break}}}function a4(y){let x=y.prev,e=y,r=y.next;if(z(x,e,r)>=0)return!1;let o=x.x,c=e.x,a=r.x,f=x.y,v=e.y,w=r.y,T=Math.min(o,c,a),I=Math.min(f,v,w),b=Math.max(o,c,a),k=Math.max(f,v,w),g=r.next;for(;g!==x;){if(g.x>=T&&g.x<=b&&g.y>=I&&g.y<=k&&b0(o,f,c,v,a,w,g.x,g.y)&&z(g.prev,g,g.next)>=0)return!1;g=g.next}return!0}function u4(y,x,e,r){let o=y.prev,c=y,a=y.next;if(z(o,c,a)>=0)return!1;let f=o.x,v=c.x,w=a.x,T=o.y,I=c.y,b=a.y,k=Math.min(f,v,w),g=Math.min(T,I,b),P=Math.max(f,v,w),N=Math.max(T,I,b),A=W0(k,g,x,e,r),E=W0(P,N,x,e,r),S=y.prevZ,O=y.nextZ;for(;S&&S.z>=A&&O&&O.z<=E;){if(S.x>=k&&S.x<=P&&S.y>=g&&S.y<=N&&S!==o&&S!==a&&b0(f,T,v,I,w,b,S.x,S.y)&&z(S.prev,S,S.next)>=0||(S=S.prevZ,O.x>=k&&O.x<=P&&O.y>=g&&O.y<=N&&O!==o&&O!==a&&b0(f,T,v,I,w,b,O.x,O.y)&&z(O.prev,O,O.next)>=0))return!1;O=O.nextZ}for(;S&&S.z>=A;){if(S.x>=k&&S.x<=P&&S.y>=g&&S.y<=N&&S!==o&&S!==a&&b0(f,T,v,I,w,b,S.x,S.y)&&z(S.prev,S,S.next)>=0)return!1;S=S.prevZ}for(;O&&O.z<=E;){if(O.x>=k&&O.x<=P&&O.y>=g&&O.y<=N&&O!==o&&O!==a&&b0(f,T,v,I,w,b,O.x,O.y)&&z(O.prev,O,O.next)>=0)return!1;O=O.nextZ}return!0}function f4(y,x){let e=y;do{let r=e.prev,o=e.next.next;!L0(r,o)&&p5(r,e,e.next,o)&&E0(r,o)&&E0(o,r)&&(x.push(r.i,e.i,o.i),S0(e),S0(e.next),e=y=o),e=e.next}while(e!==y);return u0(e)}function h4(y,x,e,r,o,c){let a=y;do{let f=a.next.next;for(;f!==a.prev;){if(a.i!==f.i&&b4(a,f)){let v=L5(a,f);a=u0(a,a.next),v=u0(v,v.next),M0(a,x,e,r,o,c,0),M0(v,x,e,r,o,c,0);return}f=f.next}a=a.next}while(a!==y)}function p4(y,x,e,r){let o=[];for(let c=0,a=x.length;c<a;c++){let f=x[c]*r,v=c<a-1?x[c+1]*r:y.length,w=f5(y,f,v,r,!1);w===w.next&&(w.steiner=!0),o.push(w4(w))}o.sort(L4);for(let c=0;c<o.length;c++)e=g4(o[c],e);return e}function L4(y,x){let e=y.x-x.x;if(e===0&&(e=y.y-x.y,e===0)){let r=(y.next.y-y.y)/(y.next.x-y.x),o=(x.next.y-x.y)/(x.next.x-x.x);e=r-o}return e}function g4(y,x){let e=d4(y,x);if(!e)return x;let r=L5(e,y);return u0(r,r.next),u0(e,e.next)}function d4(y,x){let e=x,r=y.x,o=y.y,c=-1/0,a;if(L0(y,e))return e;do{if(L0(y,e.next))return e.next;if(o<=e.y&&o>=e.next.y&&e.next.y!==e.y){let I=e.x+(o-e.y)*(e.next.x-e.x)/(e.next.y-e.y);if(I<=r&&I>c&&(c=I,a=e.x<e.next.x?e:e.next,I===r))return a}e=e.next}while(e!==x);if(!a)return null;let f=a,v=a.x,w=a.y,T=1/0;e=a;do{if(r>=e.x&&e.x>=v&&r!==e.x&&h5(o<w?r:c,o,v,w,o<w?c:r,o,e.x,e.y)){let I=Math.abs(o-e.y)/(r-e.x);E0(e,y)&&(I<T||I===T&&(e.x>a.x||e.x===a.x&&m4(a,e)))&&(a=e,T=I)}e=e.next}while(e!==f);return a}function m4(y,x){return z(y.prev,y,x.prev)<0&&z(x.next,y,y.next)<0}function _4(y,x,e,r){let o=y;do o.z===0&&(o.z=W0(o.x,o.y,x,e,r)),o.prevZ=o.prev,o.nextZ=o.next,o=o.next;while(o!==y);o.prevZ.nextZ=null,o.prevZ=null,v4(o)}function v4(y){let x,e=1;do{let r=y,o;y=null;let c=null;for(x=0;r;){x++;let a=r,f=0;for(let w=0;w<e&&(f++,a=a.nextZ,!!a);w++);let v=e;for(;f>0||v>0&&a;)f!==0&&(v===0||!a||r.z<=a.z)?(o=r,r=r.nextZ,f--):(o=a,a=a.nextZ,v--),c?c.nextZ=o:y=o,o.prevZ=c,c=o;r=a}c.nextZ=null,e*=2}while(x>1);return y}function W0(y,x,e,r,o){return y=(y-e)*o|0,x=(x-r)*o|0,y=(y|y<<8)&16711935,y=(y|y<<4)&252645135,y=(y|y<<2)&858993459,y=(y|y<<1)&1431655765,x=(x|x<<8)&16711935,x=(x|x<<4)&252645135,x=(x|x<<2)&858993459,x=(x|x<<1)&1431655765,y|x<<1}function w4(y){let x=y,e=y;do(x.x<e.x||x.x===e.x&&x.y<e.y)&&(e=x),x=x.next;while(x!==y);return e}function h5(y,x,e,r,o,c,a,f){return(o-a)*(x-f)>=(y-a)*(c-f)&&(y-a)*(r-f)>=(e-a)*(x-f)&&(e-a)*(c-f)>=(o-a)*(r-f)}function b0(y,x,e,r,o,c,a,f){return!(y===a&&x===f)&&h5(y,x,e,r,o,c,a,f)}function b4(y,x){return y.next.i!==x.i&&y.prev.i!==x.i&&!M4(y,x)&&(E0(y,x)&&E0(x,y)&&E4(y,x)&&(z(y.prev,y,x.prev)||z(y,x.prev,x))||L0(y,x)&&z(y.prev,y,y.next)>0&&z(x.prev,x,x.next)>0)}function z(y,x,e){return(x.y-y.y)*(e.x-x.x)-(x.x-y.x)*(e.y-x.y)}function L0(y,x){return y.x===x.x&&y.y===x.y}function p5(y,x,e,r){let o=N0(z(y,x,e)),c=N0(z(y,x,r)),a=N0(z(e,r,y)),f=N0(z(e,r,x));return!!(o!==c&&a!==f||o===0&&T0(y,e,x)||c===0&&T0(y,r,x)||a===0&&T0(e,y,r)||f===0&&T0(e,x,r))}function T0(y,x,e){return x.x<=Math.max(y.x,e.x)&&x.x>=Math.min(y.x,e.x)&&x.y<=Math.max(y.y,e.y)&&x.y>=Math.min(y.y,e.y)}function N0(y){return y>0?1:y<0?-1:0}function M4(y,x){let e=y;do{if(e.i!==y.i&&e.next.i!==y.i&&e.i!==x.i&&e.next.i!==x.i&&p5(e,e.next,y,x))return!0;e=e.next}while(e!==y);return!1}function E0(y,x){return z(y.prev,y,y.next)<0?z(y,x,y.next)>=0&&z(y,y.prev,x)>=0:z(y,x,y.prev)<0||z(y,y.next,x)<0}function E4(y,x){let e=y,r=!1,o=(y.x+x.x)/2,c=(y.y+x.y)/2;do e.y>c!=e.next.y>c&&e.next.y!==e.y&&o<(e.next.x-e.x)*(c-e.y)/(e.next.y-e.y)+e.x&&(r=!r),e=e.next;while(e!==y);return r}function L5(y,x){let e=z0(y.i,y.x,y.y),r=z0(x.i,x.x,x.y),o=y.next,c=x.prev;return y.next=x,x.prev=y,e.next=o,o.prev=e,r.next=e,e.prev=r,c.next=r,r.prev=c,r}function u5(y,x,e,r){let o=z0(y,x,e);return r?(o.next=r.next,o.prev=r,r.next.prev=o,r.next=o):(o.prev=o,o.next=o),o}function S0(y){y.next.prev=y.prev,y.prev.next=y.next,y.prevZ&&(y.prevZ.nextZ=y.nextZ),y.nextZ&&(y.nextZ.prevZ=y.prevZ)}function z0(y,x,e){return{i:y,x,y:e,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function S4(y,x,e,r){let o=0;for(let c=x,a=e-r;c<e;c+=r)o+=(y[a]-y[c])*(y[c+1]+y[a+1]),a=c;return o}var R5=c4(g5(),1);var d5={0:"M0.301025 0.257813 L0.206593 0.283385 L0.122042 0.361307 L0.075923 0.474441 L0.064942 0.642221 L0.091296 0.78289 L0.159376 0.899463 L0.257104 0.961214 L0.344948 0.961214 L0.442678 0.899463 L0.510757 0.78289 L0.537111 0.642221 L0.526131 0.474441 L0.480012 0.361307 L0.39546 0.283385 L0.301025 0.257813",1:"M0.220426 0.40845 L0.381626 0.270996 L0.381626 0.948966",2:"M0.110409 0.39212 L0.125621 0.342293 L0.170571 0.295823 L0.244237 0.26431 L0.291518 0.257813 L0.373319 0.263799 L0.434683 0.290705 L0.468239 0.331966 L0.480292 0.379913 L0.479492 0.411806 L0.465088 0.465192 L0.402571 0.568988 L0.245134 0.766438 L0.07959 0.948045 L0.522462 0.948045",3:"M0.081606 0.345073 L0.119154 0.315633 L0.178996 0.284091 L0.255265 0.257813 L0.349133 0.263062 L0.43127 0.289348 L0.48994 0.336662 L0.525141 0.394491 L0.513407 0.457577 L0.466472 0.504892 L0.384334 0.541692 L0.290464 0.56272 L0.20833 0.573235 L0.290464 0.583749 L0.384334 0.610035 L0.466472 0.652092 L0.519274 0.709922 L0.531007 0.773007 L0.50754 0.841351 L0.454738 0.899179 L0.3726 0.946494 L0.310412 0.961214 L0.209503 0.959111 L0.127367 0.946494 L0.071046 0.929671",4:"M0.418494 0.270996 L0.048828 0.724199 L0.553224 0.724199 M0.414181 0.578167 L0.414181 0.94897",5:"M0.074951 0.270996 L0.074951 0.614701 L0.267655 0.5695 L0.405247 0.586502 L0.460002 0.617189 L0.498028 0.660731 L0.527101 0.779401 L0.513352 0.841049 L0.477274 0.889568 L0.406378 0.93463 L0.324445 0.958337 L0.247399 0.962139 L0.182516 0.949767 L0.130068 0.925508 L0.074951 0.875607 M0.074951 0.270996 L0.527101 0.270996",6:"M0.428549 0.257813 L0.341433 0.285053 L0.26073 0.312099 L0.192188 0.360182 L0.138902 0.410969 L0.098219 0.500422 L0.070249 0.584267 L0.067264 0.670716 L0.065164 0.756863 L0.087163 0.820973 L0.108168 0.861042 L0.157916 0.913131 L0.210981 0.948192 L0.29279 0.961214 L0.384548 0.956206 L0.456409 0.924151 L0.507262 0.881077 L0.5349 0.821975 L0.537111 0.771889 L0.521634 0.718798 L0.498418 0.67372 L0.463042 0.636657 L0.414398 0.613617 L0.34696 0.598591 L0.28284 0.595587 L0.215403 0.605604 L0.145756 0.641665 L0.109274 0.678729 L0.064942 0.724006",7:"M0.071534 0.270996 L0.530519 0.270996 L0.495935 0.291702 L0.477752 0.305407 L0.435186 0.346112 L0.412067 0.374136 L0.388565 0.40796 L0.365315 0.448098 L0.342943 0.495062 L0.322081 0.549366 L0.303364 0.611524 L0.287416 0.68205 L0.270077 0.80465 L0.26253 0.94897",8:"M0.286761 0.257813 L0.210684 0.27162 L0.1414 0.305622 L0.092494 0.382125 L0.111513 0.450128 L0.16857 0.502193 L0.228345 0.539382 L0.377781 0.594635 L0.470161 0.645637 L0.52586 0.706203 L0.538087 0.792269 L0.506841 0.87621 L0.438915 0.927212 L0.339743 0.961214 L0.263666 0.959089 L0.174004 0.929337 L0.102003 0.881523 L0.063965 0.811395 L0.066682 0.741266 L0.102003 0.671139 L0.180797 0.608448 L0.259591 0.580822 L0.358762 0.548945 L0.456576 0.49688 L0.486463 0.446941 L0.487822 0.362999 L0.453859 0.302434 L0.384574 0.265245 L0.286761 0.257813",9:"M0.511026 0.437812 L0.491026 0.347812 L0.451026 0.297812 L0.391026 0.267812 L0.311026 0.257813 L0.231026 0.267812 L0.161026 0.297812 L0.111026 0.347812 L0.091026 0.417812 L0.111026 0.487812 L0.161026 0.537812 L0.231026 0.567812 L0.311026 0.577812 L0.391026 0.557812 L0.451026 0.517812 L0.491026 0.477812 L0.511026 0.437812 M0.510026 0.438812 L0.434026 0.636812 L0.381026 0.777812 L0.337026 0.879812 L0.301026 0.957812","!":"M0.301026 0.270996 L0.301026 0.749566 M0.251466 0.94897 L0.350587 0.94897",\'"\':"M0.16504 0.270996 L0.16504 0.523022 M0.437013 0.270996 L0.437013 0.523022","#":"M0.20958 0.282227 L0.146515 0.949754 M0.461844 0.282227 L0.398779 0.949754 M0.032999 0.526969 L0.600587 0.452796 M0.001465 0.82366 L0.569055 0.749486",$:"M0.307121 0.240234 L0.307121 1.083502 M0.490031 0.415915 L0.404676 0.328075 L0.23396 0.310507 L0.136407 0.398347 L0.099828 0.521324 L0.124213 0.591596 L0.197379 0.644299 L0.429061 0.697003 L0.502224 0.749708 L0.526613 0.837547 L0.477836 0.960526 L0.355897 1.013228 L0.197379 0.99566 L0.112021 0.942957 L0.07544 0.837547","\'":"M0.301026 0.270996 L0.301026 0.523022","(":"M0.413087 0.241211 L0.372337 0.28347 L0.331589 0.334184 L0.290838 0.393349 L0.25009 0.460965 L0.219528 0.528584 L0.199153 0.5962 L0.188966 0.655364 L0.199153 0.714529 L0.219528 0.782146 L0.25009 0.849764 L0.290838 0.91738 L0.331589 0.976544 L0.372337 1.027258 L0.413087 1.069491",")":"M0.188966 0.241211 L0.229716 0.28347 L0.270466 0.334184 L0.311213 0.393349 L0.351964 0.460965 L0.382526 0.528584 L0.4029 0.5962 L0.413087 0.655364 L0.4029 0.714529 L0.382526 0.782146 L0.351964 0.849764 L0.311213 0.91738 L0.270466 0.976544 L0.229716 1.027258 L0.188966 1.069491","*":"M0.301026 0.458702 L0.301026 0.681942 M0.301026 0.458702 L0.520997 0.536834 M0.301026 0.458702 L0.439954 0.257813 M0.301026 0.458702 L0.162098 0.257813 M0.301026 0.458702 L0.081055 0.536834","+":"M0.042969 0.66845 L0.559083 0.66845 M0.301023 0.428223 L0.301023 0.908661",",":"M0.38672 0.852051 L0.215333 1.030661 L0.301025 1.119971","-":"M0.173829 0.686035 L0.428224 0.686035",".":"M0.362549 0.851074 L0.239503 0.851074","/":"M0.062501 1.035249 L0.539551 0.270996","<":"M0.559083 0.441895 L0.042969 0.66939 L0.042969 0.66939 L0.559083 0.896902","=":"M0.042969 0.545898 L0.559083 0.545898 M0.042969 0.80837 L0.559083 0.80837",">":"M0.042969 0.441895 L0.559083 0.66939 L0.559083 0.66939 L0.042969 0.896902",A:"M0.018067 0.94897 L0.290179 0.270996 L0.583986 0.94897 M0.155303 0.684521 L0.433548 0.684521",B:"M0.063965 0.94897 L0.063965 0.278953 L0.209356 0.270996 L0.342486 0.294394 L0.432179 0.37292 L0.418224 0.48773 L0.312686 0.549166 L0.084728 0.575531 L0.306377 0.589434 L0.468877 0.647456 L0.538087 0.736658 L0.5324 0.85202 L0.501247 0.902983 L0.42355 0.944398 L0.063965 0.94897",C:"M0.529054 0.419847 L0.498425 0.345196 L0.442238 0.292341 L0.33583 0.257813 L0.257199 0.268357 L0.187906 0.303748 L0.120243 0.385432 L0.072998 0.599844 L0.110073 0.815385 L0.165381 0.902183 L0.222883 0.942801 L0.334904 0.961214 L0.43253 0.937679 L0.504816 0.868999 L0.529054 0.772065",D:"M0.064454 0.94897 L0.071838 0.285078 L0.171217 0.270996 L0.247348 0.272633 L0.37101 0.306078 L0.462461 0.378304 L0.514748 0.475555 L0.535591 0.576392 L0.537599 0.652313 L0.528065 0.717381 L0.508562 0.772419 L0.445948 0.855695 L0.362356 0.90871 L0.225203 0.945862 L0.064454 0.94897",E:"M0.080078 0.270996 L0.080078 0.94897 M0.080078 0.270996 L0.521974 0.270996 M0.080078 0.609981 L0.389405 0.609981 M0.080078 0.94897 L0.521974 0.94897",F:"M0.086426 0.270996 L0.086426 0.94897 M0.091304 0.275607 L0.515626 0.275607 M0.091304 0.607677 L0.447344 0.607677",G:"M0.498034 0.284943 L0.374621 0.257813 L0.244219 0.268648 L0.160577 0.311997 L0.094556 0.398116 L0.056397 0.58404 L0.076752 0.785532 L0.120865 0.858197 L0.188947 0.916734 L0.271008 0.953591 L0.357069 0.961214 L0.43715 0.932047 L0.501262 0.858539 L0.545656 0.648611 L0.329595 0.648131",H:"M0.066895 0.270996 L0.066895 0.94897 M0.066895 0.595658 L0.530009 0.595658 M0.535157 0.270996 L0.535157 0.94897",I:"M0.301026 0.270996 L0.301026 0.94897",J:"M0.506839 0.270996 L0.507814 0.782193 L0.498468 0.846168 L0.480733 0.880789 L0.455864 0.90832 L0.426095 0.929408 L0.360746 0.954812 L0.302508 0.962139 L0.223573 0.953638 L0.16538 0.930312 L0.137072 0.907715 L0.116428 0.880312 L0.102822 0.848819 L0.095633 0.813947 L0.094239 0.776413",K:"M0.035401 0.270996 L0.035401 0.94897 M0.502258 0.316194 L0.035401 0.687823 M0.212484 0.582361 L0.566652 0.933903",L:"M0.07544 0.270996 L0.07544 0.94897 L0.526613 0.94897",M:"M0.042481 0.94897 L0.042481 0.270996 L0.301027 0.712492 L0.559571 0.270996 L0.559571 0.94897",N:"M0.067871 0.94897 L0.067871 0.270996 L0.534181 0.94897 L0.525031 0.270996",O:"M0.287293 0.961214 L0.19843 0.933567 L0.1172 0.849451 L0.057129 0.563945 L0.114348 0.350255 L0.18455 0.289392 L0.306101 0.257813 L0.42054 0.29572 L0.487543 0.365003 L0.544923 0.625294 L0.516366 0.789624 L0.465476 0.884596 L0.375084 0.949287 L0.287293 0.961214",P:"M0.070557 0.94897 L0.070557 0.28379 L0.20704 0.270996 L0.329134 0.278993 L0.408525 0.300514 L0.444022 0.317908 L0.500637 0.368929 L0.525796 0.423728 L0.531496 0.50384 L0.508934 0.554205 L0.473724 0.582043 L0.417577 0.604365 L0.336375 0.620372 L0.226014 0.629268 L0.082368 0.630258",Q:"M0.282435 1.050813 L0.195447 1.019646 L0.115933 0.924817 L0.057129 0.602943 L0.113139 0.362034 L0.18186 0.293418 L0.300844 0.257813 L0.412868 0.300553 L0.478457 0.37866 L0.534625 0.672103 L0.506671 0.857367 L0.456855 0.964437 L0.368371 1.037368 L0.282435 1.050813 M0.341225 0.815559 L0.544923 1.070653",R:"M0.034912 0.944112 L0.034912 0.288556 L0.227127 0.270996 L0.362038 0.276867 L0.443423 0.294907 L0.477644 0.309614 L0.505809 0.328757 L0.526616 0.352817 L0.544963 0.418061 L0.543241 0.475921 L0.524463 0.517817 L0.49076 0.546518 L0.444265 0.564799 L0.355195 0.578739 L0.047653 0.589627 M0.303054 0.617306 L0.56714 0.94897",S:"M0.483037 0.364333 L0.407613 0.267477 L0.22883 0.257813 L0.128623 0.327565 L0.087712 0.455539 L0.104656 0.518727 L0.168054 0.573307 L0.41928 0.617318 L0.503796 0.669342 L0.535157 0.759324 L0.493846 0.900055 L0.367668 0.961214 L0.205436 0.956661 L0.116711 0.907038 L0.066895 0.790334",T:"M0.022949 0.270996 L0.579103 0.270996 M0.309284 0.270996 L0.309284 0.94897",U:"M0.072022 0.270996 L0.07308 0.648875 L0.080372 0.75167 L0.099024 0.827813 L0.134786 0.885729 L0.181571 0.924023 L0.251464 0.95168 L0.339655 0.962139 L0.401553 0.951668 L0.45232 0.924086 L0.482701 0.891771 L0.495745 0.870529 L0.515699 0.81637 L0.525014 0.744626 L0.530031 0.272017",V:"M0.027832 0.270996 L0.320083 0.94897 L0.57422 0.270996",W:"M0 0.270996 L0.079799 0.940377 L0.285198 0.472884 L0.505255 0.94897 L0.602052 0.270996",X:"M0.009034 0.270996 L0.586805 0.94897 M0.593019 0.270996 L0.015246 0.94897",Y:"M0.018067 0.270996 L0.293132 0.574135 M0.583986 0.271959 L0.294954 0.57606 L0.305277 0.94897",Z:"M0.053711 0.270996 L0.548341 0.270996 L0.053711 0.94897 L0.548341 0.94897","[":"M0.404542 0.240234 L0.197511 0.240234 L0.197511 1.069424 L0.404542 1.069424","\\\\":"M0.062501 0.270996 L0.539551 1.035249","]":"M0.19751 0.240234 L0.404542 0.240234 L0.404542 1.069424 L0.19751 1.069424","^":"M0.035156 0.523931 L0.301024 0.270996 L0.566896 0.523931",_:"M0 1.160601 L0.602052 1.160601",a:"M0.527101 0.439941 L0.527101 0.973965 M0.527101 0.553824 L0.451366 0.477535 L0.376759 0.439941 L0.263722 0.439941 L0.187989 0.477535 L0.112255 0.553824 L0.074951 0.66881 L0.074951 0.745099 L0.112255 0.85898 L0.187989 0.93527 L0.263722 0.973965 L0.376759 0.973965 L0.451366 0.93527 L0.527101 0.85898",b:"M0.07666 0.240234 L0.07666 0.959985 M0.07666 0.582737 L0.151822 0.514237 L0.225865 0.480483 L0.338045 0.480483 L0.413211 0.514237 L0.488374 0.582737 L0.525392 0.685983 L0.525392 0.754485 L0.488374 0.856739 L0.413211 0.92524 L0.338045 0.959985 L0.225865 0.959985 L0.151822 0.92524 L0.07666 0.856739",c:"M0.512452 0.553823 L0.441624 0.477535 L0.371854 0.439941 L0.26614 0.439941 L0.195312 0.477535 L0.124486 0.553823 L0.0896 0.668808 L0.0896 0.745099 L0.124486 0.858979 L0.195312 0.93527 L0.26614 0.973965 L0.371854 0.973965 L0.441624 0.93527 L0.512452 0.858979",d:"M0.525392 0.240234 L0.525392 0.959985 M0.525392 0.582737 L0.450232 0.514237 L0.376189 0.480483 L0.264006 0.480483 L0.188844 0.514237 L0.11368 0.582737 L0.076661 0.685983 L0.076661 0.754485 L0.11368 0.856739 L0.188844 0.92524 L0.264006 0.959985 L0.376189 0.959985 L0.450232 0.92524 L0.525392 0.856739",e:"M0.059571 0.668808 L0.542482 0.668808 M0.542482 0.592521 L0.502641 0.516231 L0.461594 0.477535 L0.381914 0.439941 L0.261186 0.439941 L0.180299 0.477535 L0.099412 0.553823 L0.059571 0.668808 L0.059571 0.745099 L0.099412 0.858979 L0.180299 0.93527 L0.261186 0.973965 L0.381914 0.973965 L0.461594 0.93527 L0.542482 0.858979",f:"M0.512941 0.240234 L0.406984 0.240234 L0.301026 0.274346 L0.248047 0.374731 L0.248047 0.946817 M0.089112 0.476088 L0.459965 0.476088",g:"M0.525392 0.439941 L0.525392 0.989395 L0.488373 1.091918 L0.45023 1.126757 L0.376189 1.160601 L0.264004 1.160601 L0.188844 1.126757 L0.113681 1.058075 L0.076661 0.954555 M0.525392 0.542467 L0.45023 0.473786 L0.376189 0.439941 L0.264004 0.439941 L0.188844 0.473786 L0.113681 0.542467 L0.076661 0.645988 L0.076661 0.714669 L0.113681 0.817193 L0.188844 0.885875 L0.264004 0.920713 L0.376189 0.920713 L0.45023 0.885875 L0.525392 0.817193",h:"M0.092041 0.240234 L0.092041 0.946817 M0.092041 0.61058 L0.205937 0.509225 L0.282214 0.476086 L0.396109 0.476086 L0.47187 0.509225 L0.510011 0.61058 L0.510011 0.946817",i:"M0.261026 0.240234 L0.341026 0.240234 M0.300978 0.476089 L0.300978 0.946817",j:"M0.3853 0.240234 L0.447023 0.240234 M0.416159 0.465708 L0.416159 1.011689 L0.383887 1.108586 L0.252832 1.140264 L0.15503 1.108586",k:"M0.065186 0.240234 L0.065186 0.946817 M0.493824 0.476086 L0.065186 0.812323 M0.236758 0.677829 L0.536867 0.946817",l:"M0.301026 0.234863 L0.301026 0.946441",m:"M0.050538 0.439941 L0.050538 0.960796 M0.050538 0.588758 L0.114405 0.476607 L0.157178 0.439941 L0.236864 0.439941 L0.279637 0.476607 L0.32241 0.588758 L0.32241 0.960796 M0.32241 0.588758 L0.386281 0.476607 L0.428467 0.439941 L0.50874 0.439941 L0.551515 0.476607 L0.551515 0.960796",n:"M0.092041 0.439941 L0.092041 0.960796 M0.092041 0.588758 L0.205936 0.476607 L0.282216 0.439941 L0.396113 0.439941 L0.471871 0.476607 L0.510011 0.588758 L0.510011 0.960796",o:"M0.247175 0.439941 L0.175178 0.477535 L0.103186 0.553823 L0.066895 0.668808 L0.066895 0.745099 L0.103186 0.858979 L0.175178 0.93527 L0.247175 0.973965 L0.354874 0.973965 L0.426872 0.93527 L0.498866 0.858979 L0.535157 0.745099 L0.535157 0.668808 L0.498866 0.553823 L0.426872 0.477535 L0.354874 0.439941 L0.247175 0.439941",p:"M0.076904 0.439941 L0.076904 1.154244 M0.076904 0.541563 L0.151986 0.473487 L0.225944 0.439941 L0.338005 0.439941 L0.413087 0.473487 L0.488166 0.541563 L0.525148 0.644169 L0.525148 0.712246 L0.488166 0.813866 L0.413087 0.881942 L0.338005 0.916471 L0.225944 0.916471 L0.151986 0.881942 L0.076904 0.813866",q:"M0.525148 0.441895 L0.525148 1.156195 M0.525148 0.5435 L0.450067 0.47544 L0.376106 0.441895 L0.264042 0.441895 L0.188966 0.47544 L0.113885 0.5435 L0.076905 0.646108 L0.076905 0.714187 L0.113885 0.815809 L0.188966 0.883886 L0.264042 0.918418 L0.376106 0.918418 L0.450067 0.883886 L0.525148 0.815809",r:"M0.107422 0.439941 L0.107422 0.960796 M0.107422 0.663164 L0.155824 0.551014 L0.252626 0.476607 L0.349428 0.439941 L0.49463 0.439941",s:"M0.475556 0.477535 L0.400757 0.439941 L0.276092 0.439941 L0.176361 0.477535 L0.101563 0.553823 L0.101563 0.630112 L0.176361 0.668808 L0.301024 0.668808 L0.425688 0.745099 L0.50049 0.821387 L0.50049 0.897677 L0.425688 0.93527 L0.325956 0.973965 L0.201295 0.973965 L0.126496 0.93527 L0.101563 0.858979",t:"M0.246032 0.297852 L0.246032 0.826549 L0.301023 0.919323 L0.411011 0.950848 L0.520997 0.950848 M0.081055 0.515799 L0.466004 0.515799",u:"M0.092041 0.454102 L0.092041 0.826134 L0.13018 0.937211 L0.205936 0.974954 L0.319832 0.974954 L0.396113 0.937211 L0.510011 0.826134 M0.510011 0.454102 L0.510011 0.974954",v:"M0.048828 0.453125 L0.301026 0.961719 M0.553224 0.453125 L0.301026 0.961719",w:"M0 0.453125 L0.150512 0.961719 M0.301024 0.453125 L0.150512 0.961719 M0.301024 0.453125 L0.451539 0.961719 M0.602052 0.453125 L0.451539 0.961719",x:"M0.03711 0.453125 L0.564943 0.961719 M0.564943 0.453125 L0.03711 0.961719",y:"M0.084618 0.453125 L0.320232 0.921476 M0.55713 0.453125 L0.320232 0.921476 L0.242119 1.055289 L0.163369 1.122196 L0.084618 1.155166 L0.044922 1.155166",z:"M0.505373 0.452148 L0.09668 0.961651 M0.09668 0.452148 L0.505373 0.452148 M0.09668 0.961651 L0.505373 0.961651"},m5={};for(let y in d5){m5[y]=[];let x=d5[y].split("M").slice(1).map(e=>e.split("L").map(r=>r.trim().split(" ").map(parseFloat)));for(let e of x)for(let r=0;r<e.length-1;r++)m5[y].push({x1:e[r][0],y1:1-e[r][1],x2:e[r+1][0],y2:1-e[r+1][1]})}var P4=.09,I4=.692052,R4=.692052,k4=1.152,A4=0;var _5={0:.692052,1:.692052,2:.692052,3:.692052,4:.692052,5:.692052,6:.692052,7:.692052,8:.692052,9:.692052,"!":.692052,\'"\':.692052,"#":.692052,$:.692052,"\'":.692052,"(":.692052,")":.692052,"*":.692052,"+":.692052,",":.692052,"-":.692052,".":.692052,"/":.692052,"<":.692052,"=":.692052,">":.692052,A:.692052,B:.692052,C:.692052,D:.692052,E:.692052,F:.692052,G:.692052,H:.692052,I:.692052,J:.692052,K:.692052,L:.692052,M:.692052,N:.692052,O:.692052,P:.692052,Q:.692052,R:.692052,S:.692052,T:.692052,U:.692052,V:.692052,W:.692052,X:.692052,Y:.692052,Z:.692052,"[":.692052,"\\\\":.692052,"]":.692052,"^":.692052,_:.692052,a:.692052,b:.692052,c:.692052,d:.692052,e:.692052,f:.692052,g:.692052,h:.692052,i:.692052,j:.692052,k:.692052,l:.692052,m:.692052,n:.692052,o:.692052,p:.692052,q:.692052,r:.692052,s:.692052,t:.692052,u:.692052,v:.692052,w:.692052,x:.692052,y:.692052,z:.692052," ":.692052},v5={},c0={glyphWidthRatio:I4,spaceWidthRatio:R4,lineHeightRatio:k4,strokeWidthRatio:P4,letterSpacingRatio:A4};var T4={0:[[{x:.019944796633211075,y:.35828068632415006},{x:.020222641007547733,y:.3550960892473839},{x:.020327535068617307,y:.3519011161217302},{x:.02060526835904108,y:.3507104904820116},{x:.02071153113201321,y:.34949252766745387},{x:.047065531132013214,y:.20882352766745393},{x:.047989939967683706,y:.20564918300405605},{x:.04875673163473768,y:.20243312543665407},{x:.04922094308839032,y:.20142201853303832},{x:.04953201774467938,y:.20035381349539033},{x:.05105794824635218,y:.1974208061920286},{x:.05243742793298141,y:.1944161379022362},{x:.1205174279329814,y:.07784313790223615},{x:.1216536619223176,y:.07627409360623287},{x:.12261018498510404,y:.07458945972562232},{x:.1242345189777056,y:.07271014544101197},{x:.12569143736362237,y:.07069826276137084},{x:.12711194429242206,y:.06938103546641537},{x:.12837874379901673,y:.06791537974577894},{x:.130338502698373,y:.06638906779986004},{x:.132159925645859,y:.06470007355882942},{x:.13381011622947792,y:.06368528357115737},{x:.13533850978527173,y:.062494930337889824},{x:.2330665097852717,y:.000743930337889824},{x:.2364974226485404,y:-.000978818921256936},{x:.23988324554357096,y:-.0027885789630079164},{x:.24043487144166406,y:-.0029559128497863825},{x:.24095002304009888,y:-.0032145836671228292},{x:.2446511035824589,y:-.0042348928870151745},{x:.24832493550927423,y:-.005349337618145378},{x:.24889860729226898,y:-.005405839357118937},{x:.2494543245702404,y:-.005559038796006631},{x:.2532833423420387,y:-.0058376980655201055},{x:.257104,y:-.006214000000000011},{x:.344948,y:-.006214000000000011},{x:.34876845169289644,y:-.005837718351308385},{x:.352597265623821,y:-.005559109487024962},{x:.35315318526669126,y:-.00540585978827806},{x:.3537270644907258,y:-.005349337618145378},{x:.3574006983675983,y:-.004234952964808514},{x:.36110158881940224,y:-.0032147329490055873},{x:.36161692908913895,y:-.0029559733581057666},{x:.36216875445642904,y:-.0027885789630079164},{x:.36555439482758706,y:-.000978916482299381},{x:.3689851386556908,y:.0007437082019616584},{x:.4667151386556908,y:.06249470820196166},{x:.46824382031514195,y:.0636852631221029},{x:.4698943035897058,y:.06470024765114774},{x:.4717154585013725,y:.06638901501054441},{x:.47367495473362387,y:.0679150932923645},{x:.4749419974608878,y:.0693810030307532},{x:.47636275350351887,y:.0706984782301942},{x:.4778194532662604,y:.07271008609647399},{x:.47944357522443626,y:.07458911996296573},{x:.4804002872780698,y:.07627405043044727},{x:.48153671723081914,y:.07784338646721853},{x:.5496157172308191,y:.19441638646721857},{x:.5509951179002539,y:.19742093333312605},{x:.5525209822553206,y:.20035381349539033},{x:.5528320971760705,y:.20142215679791795},{x:.5532963622471587,y:.2024333975455826},{x:.5540631001039363,y:.20564932060673602},{x:.5549874688679868,y:.20882352766745393},{x:.5813414688679868,y:.34949252766745387},{x:.5814477200321959,y:.3507103574246747},{x:.581725430046729,y:.351900851345405},{x:.5818303474337426,y:.35509595676374855},{x:.5821082033667889,y:.35828068632415006},{x:.5819748261451739,y:.3594958443979094},{x:.5820149461972951,y:.36071764184793353},{x:.5710349461972951,y:.5284976418479336},{x:.5705756858728281,y:.5312810757499365},{x:.5703149436633981,y:.5340900680661724},{x:.5698592272920282,y:.5356233082419208},{x:.5695988288779222,y:.5372015019922555},{x:.5686053720955593,y:.5398418557477263},{x:.5678016327590553,y:.5425460057826548},{x:.5216826327590552,y:.6556800057826547},{x:.5211943471023096,y:.656605995281004},{x:.5208498728309648,y:.6575945381025444},{x:.5191405880551111,y:.6605007631972294},{x:.5175679428069421,y:.6634831423933323},{x:.5169083878327574,y:.664296079457111},{x:.5163776774005638,y:.665198424109003},{x:.5141342596628157,y:.6677153419860701},{x:.5120099990343735,y:.6703336077343061},{x:.511204521070525,y:.6710022516480534},{x:.510507969381766,y:.6717837215313657},{x:.425955969381766,y:.7497057215313657},{x:.4243831978740034,y:.750892537075826},{x:.42294870744900304,y:.7522432326643229},{x:.4208707687817478,y:.7535430209032156},{x:.4189143183619635,y:.7550193610827685},{x:.4171402309909699,y:.7558765397994217},{x:.4154697962599445,y:.7569214269519826},{x:.41317820849544135,y:.7577908544006052},{x:.41097133104084405,y:.7588571425751742},{x:.40906410498936707,y:.7593517435666508},{x:.4072219198222394,y:.7600506678559823},{x:.3127869198222394,y:.7856226678559822},{x:.3097655669518694,y:.7861297177594856},{x:.3067801557646532,y:.7868174624905968},{x:.3054245519856559,y:.7868582361795984},{x:.30408703940192616,y:.7870827004032797},{x:.3010248204508113,y:.7869905707806608},{x:.2979626007613803,y:.7870826758597451},{x:.29662508997676323,y:.7868582009159747},{x:.29526948652460844,y:.786817416361878},{x:.2922840808497275,y:.7861296477028675},{x:.28926273204343433,y:.7856225735833884},{x:.19483073204343437,y:.7600505735833885},{x:.19298859701529922,y:.7593516514268194},{x:.1910814199885863,y:.7588570511522524},{x:.1888745059729717,y:.757790729268721},{x:.18658288068670334,y:.7569212665731724},{x:.18491249471518256,y:.7558763912940257},{x:.18313845528709377,y:.7550192228447639},{x:.18118197558509466,y:.7535428424712565},{x:.17910400699337814,y:.7522430123425641},{x:.17766956207459372,y:.7508923379118444},{x:.17609683558545802,y:.7497055417906873},{x:.09154583558545802,y:.6717835417906872},{x:.09084937681091164,y:.6710021668773223},{x:.09004400096562647,y:.6703336077343061},{x:.087919657143162,y:.6677152394449524},{x:.08567616637982708,y:.6651982097729843},{x:.0851455285488078,y:.6642959763928821},{x:.08448605719305789,y:.6634831423933323},{x:.08291335035419628,y:.6605006463960624},{x:.08120401576602496,y:.6575942974079984},{x:.08085959099279398,y:.6566058778839782},{x:.08037136724094471,y:.6556800057826547},{x:.03425236724094472,y:.5425460057826548},{x:.03344866581310472,y:.5398419832899659},{x:.03245524021837327,y:.537201759963462},{x:.0321948107181119,y:.5356234361255728},{x:.03173905633660196,y:.5340900680661724},{x:.03147832642517492,y:.5312812082371015},{x:.031019071243648687,y:.5284979083423142},{x:.020038071243648682,y:.36071790834231426},{x:.020078188427320915,y:.3594959771633442},{x:.019944796633211075,y:.35828068632415006}],[{x:.11021604810185967,y:.3604951889884744},{x:.12035004420691338,y:.5153337161267963},{x:.1599220965290545,y:.612407472440097},{x:.22898846858521874,y:.6760588762479813},{x:.301025186831377,y:.6955662779655215},{x:.373064807645506,y:.6760587099720985},{x:.44213195602343713,y:.6124073435241713},{x:.48170390405887986,y:.5153338430353971},{x:.49183697687726113,y:.3604953223188204},{x:.4679633532090146,y:.23306575687188358},{x:.4093572783633461,y:.13271343144136735},{x:.3319224534250481,y:.08378599999999999},{x:.27012977192577264,y:.08378599999999999},{x:.19269670382412518,y:.13271332265415062},{x:.13408961949133952,y:.23306590258843124},{x:.11021604810185967,y:.3604951889884744}]],1:[[{x:.17556757075794932,y:.5951166967821685},{x:.17573368487361973,y:.586296718297643},{x:.17761729959585784,y:.5776786204828649},{x:.18114602866723137,y:.5695935920037709},{x:.1861842650084615,y:.5623523359706766},{x:.19253839202243023,y:.5562331297919906},{x:.19996422417142623,y:.5514711311294693},{x:.20817639089041826,y:.548249340921154},{x:.21685930321783156,y:.5466915707579493},{x:.225679281702357,y:.5468576848736197},{x:.2342973795171352,y:.5487412995958578},{x:.24238240799622912,y:.5522700286672314},{x:.24962366402932343,y:.5573082650084615},{x:.33662600000000004,y:.6314944876419193},{x:.33662600000000004,y:.051034000000000024},{x:.33749066238185466,y:.042254935509274234},{x:.3400514210369921,y:.033813245543570986},{x:.3442098674463855,y:.026033339514117928},{x:.34980619484660536,y:.019214194846605387},{x:.35662533951411796,y:.013617867446385483},{x:.364405245543571,y:.00945942103699212},{x:.3728469355092743,y:.006898662381854659},{x:.381626,y:.0060340000000000255},{x:.3904050644907258,y:.006898662381854659},{x:.3988467544564291,y:.00945942103699212},{x:.40662666048588214,y:.01361786744638549},{x:.4134458051533947,y:.019214194846605387},{x:.41904213255361455,y:.026033339514117928},{x:.42320057896300795,y:.033813245543570986},{x:.4257613376181454,y:.042254935509274255},{x:.426626,y:.051034000000000024},{x:.426626,y:.729004},{x:.42636789988195944,y:.7316245344755278},{x:.4263183151263803,y:.7342572817023569},{x:.42593657376816557,y:.7360038620015019},{x:.4257613376181454,y:.7377830644907257},{x:.42499695590681574,y:.7403028932959718},{x:.4244347004041422,y:.7428753795171351},{x:.42371955318609683,y:.744513925721078},{x:.42320057896300795,y:.746224754456429},{x:.4219592904188853,y:.7485470419835442},{x:.42090597133276864,y:.7509604079962291},{x:.419884900961423,y:.7524279516932593},{x:.41904213255361455,y:.7540046604858821},{x:.41737163919932724,y:.7560401625275525},{x:.41586773499153856,y:.7582016640293234},{x:.4145799806286405,y:.7594418083381722},{x:.4134458051533947,y:.7608238051533946},{x:.41141030311172405,y:.7624942985076821},{x:.4095136079775698,y:.7643208702080094},{x:.40800865730110464,y:.7652859570783687},{x:.40662666048588214,y:.7664201325536145},{x:.40430437295876726,y:.767661421097737},{x:.4020877758285738,y:.7690828688705307},{x:.4004234632490515,y:.7697358105551997},{x:.3988467544564291,y:.7705785789630079},{x:.39632692565118355,y:.7713429606743374},{x:.3938756091095818,y:.772304659078846},{x:.39211589322607654,y:.7726203633950566},{x:.3904050644907258,y:.7731393376181454},{x:.3877845300151986,y:.7733974377361859},{x:.3851926967821685,y:.7738624292420507},{x:.38340520248922366,y:.7738287638499798},{x:.381626,y:.774004},{x:.37900546552447173,y:.7737458998819594},{x:.376372718297643,y:.7736963151263803},{x:.37462613799849803,y:.7733145737681656},{x:.3728469355092743,y:.7731393376181454},{x:.3703271067040287,y:.7723749559068158},{x:.36775462048286484,y:.7718127004041422},{x:.3661160742789217,y:.7710975531860966},{x:.364405245543571,y:.7705785789630079},{x:.3620829580164563,y:.7693372904188854},{x:.3596695920037709,y:.7682839713327686},{x:.35820204830674063,y:.7672629009614229},{x:.35662533951411796,y:.7664201325536145},{x:.3545898374724472,y:.7647496391993269},{x:.35242833597067663,y:.7632457349915385},{x:.1912283359706766,y:.6257917349915385},{x:.18510912979199054,y:.6194376079775697},{x:.18034713112946932,y:.6120117758285738},{x:.17712534092115398,y:.6037996091095817},{x:.17556757075794932,y:.5951166967821685}]],2:[[{x:.034589999999999996,y:.05195499999999997},{x:.034692251306008066,y:.05091682506774448},{x:.03463809526377374,y:.04987503351343359},{x:.03512383076438082,y:.04653492529109402},{x:.03545466238185463,y:.043175935509274184},{x:.03575748683953214,y:.042177657057450094},{x:.03590761484026801,y:.04114531791601493},{x:.0370356398580977,y:.03796415123181852},{x:.03801542103699209,y:.034734245543570935},{x:.03850718127225641,y:.0338142268532408},{x:.03885582398108696,y:.03283101233894428},{x:.040582789147307716,y:.02993103764454602},{x:.04217386744638545,y:.02695433951411788},{x:.04283566538917773,y:.026147936387598623},{x:.04336942466232366,y:.025251630882832152},{x:.04562896367409083,y:.022744292579413156},{x:.04777019484660536,y:.020135194846605337},{x:.04857659797312457,y:.019473396903813094},{x:.04927496174105457,y:.01869844492647086},{x:.0519802417813102,y:.01668009861889986},{x:.05458933951411791,y:.014538867446385433},{x:.055509358204447995,y:.01404710721112114},{x:.05634548873920743,y:.013423289731094336},{x:.05939254741314285,y:.011971499336069797},{x:.062369245543570956,y:.01038042103699207},{x:.0633675239953951,y:.010077596579314544},{x:.06430928926944049,y:.00962888655251979},{x:.06758102982102647,y:.008799443560749052},{x:.07081093550927423,y:.007819662381854608},{x:.0718491104415297,y:.007717411075846537},{x:.07286031894352762,y:.007461052176974015},{x:.07623101021818018,y:.0072858316174737835},{x:.07959,y:.006954999999999975},{x:.522462,y:.006954999999999975},{x:.5312410644907257,y:.007819662381854608},{x:.539682754456429,y:.01038042103699207},{x:.5474626604858821,y:.014538867446385433},{x:.5542818051533946,y:.020135194846605337},{x:.5598781325536145,y:.02695433951411788},{x:.5640365789630079,y:.034734245543570935},{x:.5665973376181453,y:.043175935509274205},{x:.567462,y:.05195499999999997},{x:.5665973376181453,y:.06073406449072574},{x:.5640365789630079,y:.06917575445642901},{x:.5598781325536145,y:.07695566048588207},{x:.5542818051533946,y:.08377480515339461},{x:.5474626604858821,y:.08937113255361451},{x:.539682754456429,y:.09352957896300787},{x:.5312410644907257,y:.09609033761814534},{x:.522462,y:.09695499999999997},{x:.1815000359059797,y:.09695499999999997},{x:.2783905550735291,y:.2032469617410546},{x:.2792807818102756,y:.20444017254595384},{x:.28031851181367967,y:.20550758629318672},{x:.43775551181367967,y:.4029575862931866},{x:.4393581707982963,y:.4054309283363016},{x:.4411189018513206,y:.4077943501865292},{x:.5036359018513206,y:.5115903501865292},{x:.5044316302389797,y:.5132634494776924},{x:.5054127007337849,y:.5148350555317778},{x:.5063216043693862,y:.5172373109446714},{x:.5074247535047713,y:.5195567934026113},{x:.5078787867151084,y:.5213529834674229},{x:.5085344010842773,y:.5230857889106145},{x:.5229384010842772,y:.5764717889106146},{x:.5230947969602031,y:.5774089507908463},{x:.5233933154704733,y:.5783109589719573},{x:.5238196553887738,y:.5817524776504878},{x:.5243904806061233,y:.5851730002877248},{x:.5243610401661515,y:.586122666187007},{x:.5244778496604383,y:.5870655806061408},{x:.5252778496604383,y:.6189585806061408},{x:.525154398698275,y:.6206444560860672},{x:.5252359209411441,y:.6223328785443973},{x:.5248330095087286,y:.6250334227224941},{x:.5246336028763079,y:.6277565667648055},{x:.5241836259995084,y:.6293859645321488},{x:.5239341869342451,y:.6310578486269935},{x:.5118811869342451,y:.6790048486269935},{x:.5115474759395316,y:.6799350391147754},{x:.5113589931552627,y:.6809051378786065},{x:.5100605296725933,y:.6840797730170447},{x:.5089023081582834,y:.6873082151493771},{x:.5083935381649621,y:.6881554285023456},{x:.5080194201443183,y:.6890701159233712},{x:.5061265656819337,y:.6919304336788418},{x:.5043607612540449,y:.6948708843926746},{x:.5036964840076373,y:.6956025626767983},{x:.5031511078963445,y:.6964266878303904},{x:.4695951078963445,y:.7376876878303904},{x:.46829294792790443,y:.7390014838193654},{x:.46714904955699066,y:.7404551608815331},{x:.46519525859727806,y:.7421268539092958},{x:.4633851429208498,y:.7439531446668906},{x:.4618516947085211,y:.7449876576267703},{x:.4604461776978856,y:.7461902391902692},{x:.4582037971525157,y:.7474486453977692},{x:.45607217068925404,y:.7488867084403534},{x:.4543663637878686,y:.7496021826182516},{x:.45275324136800726,y:.7505074541480116},{x:.3913892413680073,y:.7774134541480116},{x:.3883140702117422,y:.7784156528007931},{x:.3852957573995619,y:.7795779210778271},{x:.3841283231887951,y:.779779788263216},{x:.3830018757962646,y:.7801468976050565},{x:.3797902739335826,y:.7805299031606142},{x:.3766032098633093,y:.781080995160135},{x:.2948022098633093,y:.7870669951601349},{x:.29450281220893076,y:.7870594704966325},{x:.2942070489499988,y:.7871065838776864},{x:.29009611613079095,y:.7869487184427649},{x:.2859834519838158,y:.7868453561974301},{x:.28569127516043946,y:.7867795665334233},{x:.28539200354491423,y:.7867680740946454},{x:.2381110035449142,y:.7802710740946455},{x:.2365476307297285,y:.7798972084805876},{x:.2349498387179436,y:.7797212234138579},{x:.23226739693423346,y:.7788736316211718},{x:.2295313767481002,y:.7782193386355017},{x:.22807098126622102,y:.7775476578384392},{x:.22653822336325463,y:.7770633405173258},{x:.15287222336325462,y:.7455503405173259},{x:.15277120515837472,y:.7454948388638573},{x:.15266147866932564,y:.7454595513468599},{x:.14890641990559073,y:.7433714396994592},{x:.14514076206912752,y:.7413025033471496},{x:.1450525127361761,y:.7412283604682699},{x:.14495177886390068,y:.7411723444149347},{x:.14167624287507044,y:.7383917796239132},{x:.1383865705572421,y:.7356279539035645},{x:.138314481468594,y:.7355380190685297},{x:.13822661135931125,y:.7354634271443719},{x:.09327661135931127,y:.6889934271443718},{x:.09215967204365061,y:.6875853345117547},{x:.09088652507606766,y:.6863167230283468},{x:.0894249598835053,y:.6841377631074377},{x:.0877944205712414,y:.6820821900242812},{x:.08697364817646357,y:.6804832494460014},{x:.08597245819367963,y:.6789906353246448},{x:.0849640705590952,y:.6765684062835642},{x:.08376588401722862,y:.6742342280213215},{x:.08327282036617045,y:.6725058858871059},{x:.08258206253775009,y:.6708466294514168},{x:.06737006253775008,y:.6210196294514168},{x:.06563362911198059,y:.61237067498716},{x:.06561788807912042,y:.6035491464015462},{x:.0673234443582347,y:.5948940500909503},{x:.07068475437800403,y:.5867379965527546},{x:.07557264487941309,y:.5793944183504645},{x:.08179927697165325,y:.5731455250760676},{x:.08912536467535526,y:.5682314581936796},{x:.09726937054858317,y:.56484106253775},{x:.10591832501283995,y:.5631046291119806},{x:.11473985359845373,y:.5630888880791204},{x:.12339494990904962,y:.5647944443582347},{x:.13155100344724535,y:.568155754378004},{x:.13889458164953555,y:.5730436448794131},{x:.14514347492393234,y:.5792702769716532},{x:.15005754180632036,y:.5865963646753553},{x:.1534479374622499,y:.5947403705485832},{x:.16549687462406137,y:.6342067386764809},{x:.19660916323298405,y:.666371100226128},{x:.2563653288901179,y:.6919337213587163},{x:.29295461470925055,y:.696961546277117},{x:.3623268316838737,y:.6918850546595318},{x:.40664087103378327,y:.672454875030618},{x:.4270299373286165,y:.6473841495451277},{x:.4351521014718352,y:.6150740687208592},{x:.4346413299816387,y:.5947115247998124},{x:.4232850296720603,y:.5526213103922067},{x:.3655461500158852,y:.45675834907300783},{x:.21087613207581168,y:.2627785664153893},{x:.04633344492647088,y:.0822700382589454},{x:.04431509861889995,y:.07956475821868986},{x:.04217386744638545,y:.07695566048588207},{x:.04168210721112112,y:.0760356417955519},{x:.04105828973109435,y:.07519951126079251},{x:.03960649933606985,y:.07215245258685718},{x:.03801542103699209,y:.06917575445642901},{x:.037712596579314576,y:.0681774760046049},{x:.037263886552519804,y:.06723571073055948},{x:.036434443560749034,y:.06396397017897336},{x:.03545466238185463,y:.06073406449072574},{x:.03535241107584656,y:.059695889558470286},{x:.035096052176974035,y:.05868468105647236},{x:.03492083161747381,y:.05531398978181981},{x:.034589999999999996,y:.05195499999999997}]],3:[[{x:.02624429558875499,y:.07454886751538828},{x:.02628189246403191,y:.06572740500388341},{x:.028039748887915363,y:.057082779207475086},{x:.03145031142385274,y:.04894719824755728},{x:.036382514066253493,y:.04163330793793327},{x:.042646815033581253,y:.035422176981524986},{x:.05000248075272204,y:.030552495657744837},{x:.05816683711519421,y:.027211403088916904},{x:.11448783711519421,y:.010388403088916982},{x:.11753114712885143,y:.009796523380387901},{x:.12053464064709668,y:.009027703431080128},{x:.20267064064709667,y:-.0035892965689199724},{x:.20562630159751,y:-.003749783589053152},{x:.20856537842676282,y:-.004101230781641964},{x:.30947437842676284,y:-.00620423078164193},{x:.31075400531193675,y:-.006105070212514369},{x:.31203499449415534,y:-.0061847225744922005},{x:.3151428517207607,y:-.005764970678224511},{x:.3182695531731509,y:-.005522677007230838},{x:.31950524711917533,y:-.005175778959545043},{x:.3207771618583987,y:-.005003992231664048},{x:.3829651618583987,y:.009716007768336019},{x:.3849642059743718,y:.010402067561162992},{x:.38702295869345676,y:.010879972006216251},{x:.389126076828856,y:.011830396347599064},{x:.3913090018652735,y:.012579562954916447},{x:.3931357912831918,y:.013642434461507345},{x:.39506175111398195,y:.014512798837572657},{x:.47719975111398194,y:.06182779883757265},{x:.47924722409526294,y:.06329195880211928},{x:.48141099047099317,y:.06457804786673271},{x:.4828265323572166,y:.06585154318044145},{x:.484375351035892,y:.06695911252196202},{x:.4860978389589892,y:.06879458122658251},{x:.48796912564078,y:.07047808832945178},{x:.54077112564078,y:.12830608832945176},{x:.5409949120745448,y:.12860551518367325},{x:.5412686389329152,y:.1288600940829806},{x:.5436334835107667,y:.13213593090859313},{x:.5460522072884215,y:.13537218987116906},{x:.5462132784472015,y:.1357095218897727},{x:.546432079841298,y:.13601261058785885},{x:.5481124005325159,y:.13968686141763526},{x:.5498532864078638,y:.14333280617235186},{x:.5499454524173568,y:.14369507987504085},{x:.5501009199323095,y:.14403503084321223},{x:.5735679199323094,y:.2123790308432122},{x:.5742003382158373,y:.21504899342087444},{x:.5750294951185407,y:.21766455299430504},{x:.5752146521018063,y:.21933125436759},{x:.575601167738761,y:.22096305773765262},{x:.575700550423256,y:.22370509641963415},{x:.5760035049491392,y:.22643215923642232},{x:.5758599468852712,y:.22810295774565637},{x:.5759206866877095,y:.2297788119316045},{x:.5754832145523405,y:.2324875517091097},{x:.575248324328873,y:.23522131827456078},{x:.563515324328873,y:.2983063182745607},{x:.5624930457986839,y:.30183400865706583},{x:.561587550163308,y:.3053934651440046},{x:.5612670272694029,y:.3060647673464004},{x:.5610599744254687,y:.30677926765590185},{x:.5593691204378909,y:.31003973780923805},{x:.5577866081350055,y:.3133541469027738},{x:.5573412794357957,y:.31395001930700017},{x:.5569988129587381,y:.31461039668740554},{x:.5547043620842722,y:.317478348572073},{x:.5525056481741942,y:.32042033938948294},{x:.4997036481741942,y:.378250339389483},{x:.4970091109540712,y:.38067456957783247},{x:.49440132723244246,y:.38319188697894757},{x:.4937347452782226,y:.3836204617554604},{x:.49314561461057166,y:.3841504927896343},{x:.49002990831948917,y:.38600246394071897},{x:.48698112816844114,y:.387962658427834},{x:.4171684643874312,y:.4237087345514058},{x:.48487098803351525,y:.4540412587201935},{x:.4882241875669253,y:.4559584413246188},{x:.4916233115558361,y:.4577929691542233},{x:.4920492459188098,y:.45814540790983926},{x:.4925291804180174,y:.45841980913886743},{x:.49544392539098053,y:.4609543303938907},{x:.49841983754054403,y:.46341674447922576},{x:.545354837540544,y:.5107317444792258},{x:.5454749496657809,y:.5108793107625336},{x:.5456205162109946,y:.5110018387655073},{x:.548258239278959,y:.5142987798858712},{x:.5509236260451226,y:.5175733969812307},{x:.5510126414958236,y:.5177415605329735},{x:.5511315069931322,y:.5178901328189077},{x:.5530753456471339,y:.5216383183828395},{x:.5550506716503533,y:.525370005791429},{x:.5551051696126684,y:.5255523041806199},{x:.555192766127671,y:.525721211199887},{x:.5563680197383496,y:.5297766005381628},{x:.5575773743081012,y:.5338219516056334},{x:.5575952604559016,y:.5340113792074108},{x:.557648221703651,y:.5341941299579837},{x:.569382221703651,y:.5972801299579837},{x:.5696549699390315,y:.6004540423597167},{x:.5701008412017201,y:.6036082951002054},{x:.5700318821169291,y:.6048400880993865},{x:.5701375119403227,y:.6060692795769916},{x:.5697858198023349,y:.6092354166829699},{x:.5696077595908724,y:.6124160465097288},{x:.5692998146426919,y:.6136107177017713},{x:.5691636114574624,y:.614836897966064},{x:.5682009942777376,y:.6178735869028962},{x:.5674058453461934,y:.6209583639953996},{x:.5668707486862845,y:.622070002836373},{x:.5664979467044567,y:.623246050467446},{x:.5649613973213707,y:.6260365929822823},{x:.5635797167972587,y:.6289069710868302},{x:.5283787167972587,y:.6867359710868302},{x:.526364685994031,y:.6894131274243959},{x:.524479650893362,y:.6921826271628648},{x:.5237177195860089,y:.6929316152663909},{x:.5230754099184859,y:.6937854072711274},{x:.5205777908604191,y:.6960182048823972},{x:.5181886735848373,y:.6983667373551676},{x:.4595186735848373,y:.7456807373551677},{x:.45627545779875317,y:.7478078267647688},{x:.4530837115337172,y:.7500113951823929},{x:.4525909707504246,y:.7502243275150239},{x:.4521421155924859,y:.7505187128152536},{x:.44854624273044896,y:.7519722107862162},{x:.4449859301027389,y:.7535107594479447},{x:.362848930102739,y:.7797967594479446},{x:.36158078031831586,y:.7800691142952486},{x:.3603625229719573,y:.7805143446587972},{x:.35727696699365546,y:.7809934249999153},{x:.35422405316989464,y:.781649085623381},{x:.352927136733123,y:.7816688034988555},{x:.3516454277250751,y:.7818678086678129},{x:.2577774277250751,y:.7871168086678129},{x:.2534831925795917,y:.7869349938938289},{x:.24918809681378723,y:.7867747925856998},{x:.2490774333618657,y:.786748457272228},{x:.24896378128970398,y:.7867436453266514},{x:.24478752897123962,y:.7857275603552258},{x:.2406062159909945,y:.7847325056542677},{x:.16433721599099446,y:.7584545056542678},{x:.1612047546311144,y:.7570179671101032},{x:.15801334200327716,y:.7557176430739929},{x:.09817134200327716,y:.7241756430739928},{x:.09479788711775466,y:.721949723610623},{x:.09138819905405325,y:.7197797137879894},{x:.05384019905405325,y:.6903397137879895},{x:.04746503339724546,y:.6842424293748122},{x:.0424018859405069,y:.677018569451043},{x:.0388453306011542,y:.6689457429023652},{x:.036932043806339465,y:.6603341839257509},{x:.036735552094603836,y:.6515148299032538},{x:.03826340653223549,y:.6428266036640077},{x:.041456892530026886,y:.6346033888699733},{x:.046193286212010486,y:.6271611990540533},{x:.05229057062518783,y:.6207860333972455},{x:.05951443054895701,y:.615722885940507},{x:.06758725709763488,y:.6121663306011542},{x:.07619881607424907,y:.6102530438063395},{x:.08501817009674617,y:.6100565520946039},{x:.09370639633599236,y:.6115844065322356},{x:.1019296111300268,y:.6147778925300269},{x:.10937180094594674,y:.6195142862120105},{x:.14372643260130716,y:.6464504840370294},{x:.1969218011618275,y:.6744891243755197},{x:.2615721948597163,y:.6967640072977177},{x:.3408866683163358,y:.6923288252210377},{x:.40955721054777616,y:.6703524458415177},{x:.4555820596629536,y:.6332360369266462},{x:.477752059875079,y:.596814658492312},{x:.4716998550115053,y:.5642759337587675},{x:.44042564505409965,y:.532748518309004},{x:.3700728058889163,y:.5012285825754976},{x:.28267158635688694,y:.4816496665818946},{x:.2026156257994338,y:.47140070238604853},{x:.19958923290487823,y:.4707064281346213},{x:.19652752938874105,y:.4701896668089735},{x:.19529880233776667,y:.46972217540403877},{x:.1940174323454584,y:.4694282207777866},{x:.19118463692903986,y:.4681568668470777},{x:.18828257832087977,y:.4670527262205195},{x:.18716866396437967,y:.46635450477580015},{x:.18596926283986664,y:.4658162155208443},{x:.1834389276407875,y:.4640166393294268},{x:.18080803842542348,y:.46236755090702814},{x:.17985174386742717,y:.4614654316810775},{x:.17878040392329292,y:.4607034939516098},{x:.17664976830422657,y:.45844485220330683},{x:.1743911520787843,y:.45631418952832026},{x:.17362922718285934,y:.45524284045707714},{x:.17272711941234267,y:.45428653509274164},{x:.17107806250525512,y:.45165562612327925},{x:.16927851662463225,y:.44912526936741537},{x:.1687402417372368,y:.44792586179486843},{x:.1680420336360506,y:.4468119390745141},{x:.1669379277730794,y:.44390986724015796},{x:.1656666077762714,y:.4410770565945043},{x:.16537266849946,y:.43979568308103084},{x:.16490519181337332,y:.438566950430106},{x:.16438846716364272,y:.4355052407239498},{x:.16369422916516244,y:.43247883951296023},{x:.16365592142049992,y:.43116474252408066},{x:.16343714101639506,y:.42986841944927895},{x:.1635276550184117,y:.4267647316583033},{x:.16343717819520762,y:.42366104278329114},{x:.1636559741278381,y:.4223647223293339},{x:.1636942976139514,y:.42105062579943375},{x:.1643885718653787,y:.41802423290487795},{x:.16490533319102646,y:.414962529388741},{x:.1653728245959611,y:.41373380233776696},{x:.1656667792222133,y:.41245243234545836},{x:.1669381331529224,y:.40961963692903947},{x:.16804227377948042,y:.40671757832087974},{x:.16874049522419982,y:.4056036639643795},{x:.16927878447915568,y:.4044042628398666},{x:.17107836067057278,y:.40187392764078794},{x:.1727274490929718,y:.3992430384254234},{x:.17362956831892262,y:.3982867438674269},{x:.17439150604839013,y:.3972154039232929},{x:.1766501477966929,y:.39508476830422673},{x:.1787808104716797,y:.39282615207878424},{x:.17985215954292283,y:.39206422718285927},{x:.18080846490725827,y:.39116211941234263},{x:.18343937387672077,y:.38951306250525497},{x:.18596973063258454,y:.3877135166246322},{x:.18716913820513145,y:.3871752417372368},{x:.1882830609254858,y:.38647703363605057},{x:.19118513275984234,y:.3853729277730792},{x:.19401794340549564,y:.3841016077762714},{x:.19529931691896882,y:.38380766849946},{x:.19652804956989395,y:.38334019181337325},{x:.19958975927605035,y:.38282346716364263},{x:.20261616048703973,y:.3821292291651624},{x:.28149235433605535,y:.37203226198800626},{x:.3678476199052635,y:.34785057975990136},{x:.4387239808422848,y:.31155986033736477},{x:.4773813812672204,y:.26922136053481893},{x:.48460036747312013,y:.2304069273293995},{x:.4680118822440525,y:.1820955353962423},{x:.4262197745588727,y:.1363254129914362},{x:.35583608100487274,y:.09578139608686695},{x:.3056218275014876,y:.083895601213743},{x:.2134048551529998,y:.08581745449589688},{x:.13726972612583144,y:.09751265420048184},{x:.0839251628848058,y:.11344659691108305},{x:.0752658675153883,y:.11513070441124498},{x:.06644440500388343,y:.11509310753596806},{x:.05779977920747511,y:.11333525111208462},{x:.0496641982475573,y:.10992468857614723},{x:.04235030793793329,y:.10499248593374648},{x:.036139176981525016,y:.09872818496641873},{x:.03126949565774486,y:.09137251924727793},{x:.027928403088916927,y:.08320816288480577},{x:.02624429558875499,y:.07454886751538828}]],4:[[{x:.003828000000000005,y:.27580099999999996},{x:.0040512821902059844,y:.2735339778783202},{x:.004058111165048277,y:.2712559968420181},{x:.004482570943879651,y:.26915502967601196},{x:.004692662381854638,y:.26702193550927417},{x:.005353928343121064,y:.26484203377636983},{x:.005805038155045426,y:.26260915577382815},{x:.0066312204192078995,y:.26063136609773396},{x:.0072534210369921,y:.25858024554357095},{x:.008327258689269697,y:.2565712366005347},{x:.009205313441189196,y:.2544692698811785},{x:.010401468469599332,y:.25269066304309135},{x:.011411867446385462,y:.25080033951411784},{x:.01285700981091242,y:.2490394284479652},{x:.014128266351129452,y:.24714915041402313},{x:.01564842657685691,y:.24563807727727646},{x:.017008194846605366,y:.24398119484660533},{x:.018769105912757822,y:.24253605248207852},{x:.020384710565360974,y:.24093010545831445},{x:.022170457083446928,y:.23974463571613375},{x:.023827339514117918,y:.23838486744638543},{x:.025836348457154004,y:.2373110297941079},{x:.027734214441385185,y:.2360511294240198},{x:.029716922014597604,y:.23523682001377813},{x:.031607245543570965,y:.23422642103699207},{x:.03378714727647517,y:.23356515507572567},{x:.03589434066689576,y:.23269971862397582},{x:.03799781495511128,y:.23228786299963877},{x:.040048935509274235,y:.2316656623818546},{x:.04231595763095386,y:.23144238019164864},{x:.0445515001672978,y:.23100466589573537},{x:.046694905833262405,y:.23101109143797494},{x:.048828,y:.23080099999999998},{x:.36918100000000004,y:.23080099999999998},{x:.36918100000000004,y:.05103000000000002},{x:.37004566238185466,y:.04225093550927423},{x:.3726064210369921,y:.03380924554357098},{x:.3767648674463855,y:.026029339514117924},{x:.38236119484660536,y:.019210194846605383},{x:.38918033951411796,y:.013613867446385479},{x:.396960245543571,y:.009455421036992116},{x:.4054019355092743,y:.006894662381854655},{x:.414181,y:.0060300000000000215},{x:.4229600644907258,y:.006894662381854655},{x:.4314017544564291,y:.009455421036992116},{x:.43918166048588214,y:.013613867446385486},{x:.4460008051533947,y:.019210194846605383},{x:.45159713255361456,y:.026029339514117924},{x:.45575557896300795,y:.03380924554357098},{x:.4583163376181454,y:.04225093550927425},{x:.459181,y:.05103000000000002},{x:.459181,y:.23080099999999998},{x:.553224,y:.23080099999999998},{x:.5620030644907258,y:.2316656623818546},{x:.5704447544564291,y:.23422642103699207},{x:.5782246604858822,y:.23838486744638543},{x:.5850438051533947,y:.24398119484660533},{x:.5906401325536146,y:.25080033951411784},{x:.5947985789630079,y:.25858024554357095},{x:.5973593376181454,y:.26702193550927417},{x:.5982240000000001,y:.27580099999999996},{x:.5973593376181454,y:.28458006449072576},{x:.5947985789630079,y:.293021754456429},{x:.5906401325536146,y:.3008016604858821},{x:.5850438051533947,y:.3076208051533946},{x:.5782246604858822,y:.3132171325536145},{x:.5704447544564291,y:.3173755789630079},{x:.5620030644907258,y:.31993633761814533},{x:.553224,y:.32080099999999995},{x:.459181,y:.32080099999999995},{x:.459181,y:.421833},{x:.4583163376181454,y:.4306120644907258},{x:.45575557896300795,y:.439053754456429},{x:.45159713255361456,y:.4468336604858821},{x:.4460008051533947,y:.4536528051533947},{x:.43918166048588214,y:.45924913255361455},{x:.4314017544564291,y:.4634075789630079},{x:.4229600644907258,y:.4659683376181454},{x:.414181,y:.466833},{x:.4054019355092743,y:.4659683376181454},{x:.396960245543571,y:.4634075789630079},{x:.38918033951411796,y:.45924913255361455},{x:.38236119484660536,y:.4536528051533947},{x:.3767648674463855,y:.4468336604858821},{x:.3726064210369921,y:.439053754456429},{x:.37004566238185466,y:.4306120644907258},{x:.36918100000000004,y:.421833},{x:.36918100000000004,y:.32080099999999995},{x:.1436046917940101,y:.32080099999999995},{x:.4533648945416855,y:.700560710565361},{x:.45824387057598015,y:.7079102144413851},{x:.4615952813760241,y:.7160703406668958},{x:.46329033410426457,y:.7247275001672978},{x:.46326388883495173,y:.7335490031579818},{x:.46151696184495455,y:.7421958442261718},{x:.45811668655881077,y:.7503357301188214},{x:.4531937336488705,y:.7576558495859769},{x:.446937289434639,y:.7638748945416856},{x:.4395877855586148,y:.7687538705759801},{x:.43142765933310423,y:.7721052813760241},{x:.42277049983270215,y:.7738003341042645},{x:.41394899684201814,y:.7737738888349517},{x:.40530215577382817,y:.7720269618449546},{x:.39716226988117853,y:.7686266865588108},{x:.38984215041402315,y:.7637037336488706},{x:.38362310545831446,y:.757447289434639},{x:.013957105458314502,y:.304244289434639},{x:.012771635716133971,y:.30245854291655333},{x:.011411867446385462,y:.3008016604858821},{x:.010338029794107799,y:.29879265154284573},{x:.009078129424019837,y:.29689478555861476},{x:.008263820013778204,y:.2949120779854024},{x:.0072534210369921,y:.293021754456429},{x:.006592155075725704,y:.29084185272352475},{x:.005726718623975863,y:.2887346593331042},{x:.0053148629996388475,y:.28663118504488877},{x:.004692662381854638,y:.28458006449072576},{x:.00446938019164866,y:.282313042369046},{x:.00403166589573542,y:.2800774998327022},{x:.00403809143797499,y:.27793409416673776},{x:.003828000000000005,y:.27580099999999996}]],5:[[{x:.029951000000000005,y:.38529899999999995},{x:.030026331329377584,y:.3845341481773043},{x:.029977079633894697,y:.38376717530271315},{x:.030458063889865227,y:.38015069392879464},{x:.03081566238185464,y:.37651993550927415},{x:.03103876142924568,y:.3757844765131909},{x:.03114008507636279,y:.3750226322781917},{x:.0323173678705276,y:.3715694759531816},{x:.0333764210369921,y:.36807824554357094},{x:.033738714231120716,y:.3674004426508694},{x:.033986719409902104,y:.366673004302166},{x:.03581505842470893,y:.3635158758870829},{x:.03753486744638546,y:.3602983395141178},{x:.03802243206297786,y:.35970424030984804},{x:.03840758807348568,y:.3590391628952293},{x:.04081672126593952,y:.35629938906452685},{x:.04313119484660537,y:.3534791948466053},{x:.04372529405087513,y:.3529916302300129},{x:.04423279956362368,y:.3524144723015426},{x:.04713014529619686,y:.3501973410270508},{x:.04995033951411792,y:.3478828674463854},{x:.05062814240681941,y:.3475205742522568},{x:.05123849426956635,y:.347053515665452},{x:.054512709170605814,y:.34544423005866864},{x:.057730245543570965,y:.343724421036992},{x:.05846570453965444,y:.3435013219896009},{x:.05915544727260316,y:.34316231154402344},{x:.06268070509966306,y:.34222271554831923},{x:.06617193550927424,y:.3411636623818546},{x:.0669367873319697,y:.34108833105247705},{x:.06767941450870582,y:.34089039672943083},{x:.07132024158048059,y:.34065659849198926},{x:.074951,y:.34029899999999996},{x:.0757158518226955,y:.3403743313293775},{x:.07648282469728679,y:.34032507963389463},{x:.08009930607120508,y:.3408060638898651},{x:.08373006449072577,y:.3411636623818546},{x:.0844655234868091,y:.3413867614292456},{x:.08522736772180821,y:.34148808507636275},{x:.2701097088502776,y:.3848544225750548},{x:.39095673206080095,y:.3699215697302287},{x:.4312208460684155,y:.34735587040502247},{x:.4569274445394237,y:.3179203076157562},{x:.4808881134259603,y:.2201177906149206},{x:.47151862074291284,y:.1781066999956386},{x:.4461217481742335,y:.14395206669668215},{x:.3876788357927069,y:.10680533743499816},{x:.3169820044514503,y:.08634947983662909},{x:.2505487358362677,y:.08307118781270932},{x:.19638270317906092,y:.09339965838335124},{x:.15518503458472022,y:.11245499400015477},{x:.1051531598037562,y:.15775209985578706},{x:.09806479623887651,y:.16300326318775482},{x:.09008818244690309,y:.16677065575830224},{x:.0815298552225249,y:.16890949878372125},{x:.07271870628140957,y:.16933759772602197},{x:.06399334313601493,y:.16803850098293246},{x:.05568907659877849,y:.16506213211374782},{x:.04812503497563989,y:.16052287130494386},{x:.041591900144212934,y:.15459515980375618},{x:.03634073681224515,y:.1475067962388765},{x:.03257334424169774,y:.13953018244690307},{x:.03043450121627874,y:.13097185522252489},{x:.03000640227397801,y:.12216070628140954},{x:.031305499017067515,y:.1134353431360149},{x:.034281867886252176,y:.10513107659877846},{x:.03882112869505611,y:.09756703497563987},{x:.044748840196243804,y:.09103390014421289},{x:.09986584019624378,y:.041132900144212926},{x:.10178680031290575,y:.03970982481314967},{x:.10357183338498165,y:.03811957700249835},{x:.10532248536915285,y:.037090537646117014},{x:.10695420376112348,y:.035881736812245144},{x:.10911588139237749,y:.0348607662023731},{x:.11117685751196796,y:.03364931723433351},{x:.16362485751196798,y:.009390317234333478},{x:.1646572774363771,y:.009030847933342759},{x:.16562545909873666,y:.008523173483185618},{x:.16881529925253239,y:.0075831025339957205},{x:.1719558576504946,y:.006489618860012841},{x:.17303856889723523,y:.006338471796353147},{x:.17408718959239433,y:.0060294350406820685},{x:.23897018959239436,y:-.00634256495931787},{x:.2399001168767359,y:-.006426714843400178},{x:.24080591100583193,y:-.006653392925378379},{x:.24428588214420577,y:-.0068235863462415185},{x:.247755834543085,y:-.007137585190079683},{x:.24868431036339586,y:-.007038698344381461},{x:.24961692261229596,y:-.007084309202250054},{x:.32666292261229596,y:-.003282309202250082},{x:.32746661284147915,y:-.0031629125067284265},{x:.32827905619988357,y:-.00317336931171093},{x:.3318231917274382,y:-.002515696572186591},{x:.33538870069659477,y:-.001986002452099067},{x:.33615365510360457,y:-.0017121077449900682},{x:.3369525276121403,y:-.0015638637889859724},{x:.4188855276121403,y:.02214313621101406},{x:.4207304127428032,y:.02287964098341223},{x:.42264402370761556,y:.023412682727046455},{x:.4248170355152836,y:.024511079778651145},{x:.4270783417525648,y:.02541382586724525},{x:.42874409297954025,y:.02649609814118395},{x:.43051694316083267,y:.027392224616519634},{x:.5014129431608326,y:.07245422461651957},{x:.5044011686844615,y:.0747943741105689},{x:.5074525565132345,y:.07705154573740032},{x:.5078697672823866,y:.07751071502587484},{x:.5083582165656543,y:.07789323111579813},{x:.5108324836553944,y:.0807713891731658},{x:.5133848875831327,y:.08358048611421783},{x:.5494628875831328,y:.1320994861142178},{x:.5497798823390716,y:.1326268676033582},{x:.5501811109693575,y:.13309337858567127},{x:.5520495631508493,y:.13640291633591076},{x:.5540074974944301,y:.13966031511116345},{x:.5542155142604781,y:.14023940572188273},{x:.5545180216173755,y:.1407752286491667},{x:.5557049132287019,y:.14438569149730107},{x:.5569897394368822,y:.14796247431004633},{x:.5570807842453774,y:.1485710199149322},{x:.5572729451408087,y:.14915556341258465},{x:.5710219451408087,y:.2108035634125847},{x:.5712046210163666,y:.21230267395853206},{x:.5715791512667351,y:.2137656948046034},{x:.571736996194895,y:.21667155541097086},{x:.5720890113736304,y:.2195603313107129},{x:.5719757152243157,y:.2210662751632623},{x:.5720576277729665,y:.2225742517011615},{x:.5716455344736617,y:.2254550710286549},{x:.5714272135589309,y:.2283570146640783},{x:.5710222992922247,y:.22981191924551903},{x:.5708084462858501,y:.23130690078257787},{x:.5417354462858501,y:.3499769007825779},{x:.5411002871662289,y:.3517814599872898},{x:.540669734049328,y:.3536454570484658},{x:.5396393400617131,y:.355932176655931},{x:.5388066121493867,y:.3582980512419798},{x:.5378316053978042,y:.3599440229503987},{x:.537045677451414,y:.361688207084494},{x:.5355889653307644,y:.36372996812105773},{x:.5343106788169316,y:.36588792593376723},{x:.5330332933960605,y:.36731205637621067},{x:.5319221933904076,y:.36886939956510134},{x:.49389619339040763,y:.4124113995651013},{x:.49150876583293945,y:.41465677330496736},{x:.4892379705562563,y:.41702003426923534},{x:.48830169237996507,y:.41767302336482964},{x:.48747017448549057,y:.4184550652905171},{x:.4846905699931398,y:.420191530792605},{x:.4820023580684325,y:.4220663721783498},{x:.4272473580684325,y:.4527533721783498},{x:.42330567688981036,y:.45447898255061825},{x:.4193723578126433,y:.45622356923745777},{x:.4192660752068488,y:.4562474610875831},{x:.4191662841579818,y:.4562911481493166},{x:.41496369139475175,y:.45721461755172516},{x:.4107655979622113,y:.4581583300092093},{x:.27317359796221125,y:.47516033000920926},{x:.26964530070808584,y:.4752477446385603},{x:.2661231753027132,y:.4754739203661053},{x:.26524270860794985,y:.4753568201865933},{x:.26435476148695686,y:.47537881934450843},{x:.2608772057270339,y:.4747762176787918},{x:.2573786322781918,y:.4743109149236372},{x:.119951,y:.44207564006371447},{x:.119951,y:.684004},{x:.527101,y:.684004},{x:.5358800644907258,y:.6848686623818546},{x:.544321754456429,y:.6874294210369921},{x:.5521016604858822,y:.6915878674463855},{x:.5589208051533947,y:.6971841948466053},{x:.5645171325536146,y:.7040033395141179},{x:.5686755789630079,y:.711783245543571},{x:.5712363376181454,y:.7202249355092742},{x:.5721010000000001,y:.729004},{x:.5712363376181454,y:.7377830644907257},{x:.5686755789630079,y:.746224754456429},{x:.5645171325536146,y:.7540046604858821},{x:.5589208051533947,y:.7608238051533946},{x:.5521016604858822,y:.7664201325536145},{x:.544321754456429,y:.7705785789630079},{x:.5358800644907258,y:.7731393376181454},{x:.527101,y:.774004},{x:.074951,y:.774004},{x:.06617193550927424,y:.7731393376181454},{x:.05773024554357094,y:.7705785789630079},{x:.04995033951411792,y:.7664201325536145},{x:.04313119484660537,y:.7608238051533946},{x:.03753486744638546,y:.7540046604858821},{x:.0333764210369921,y:.746224754456429},{x:.03081566238185464,y:.7377830644907257},{x:.029951000000000005,y:.729004},{x:.029951000000000005,y:.38529899999999995}]],6:[[{x:.01994450211145162,y:.2755194646798348},{x:.020758274672659796,y:.26806396163938684},{x:.0201773643330274,y:.24423363638780976},{x:.020440223451033163,y:.2406784570189078},{x:.020568639264984916,y:.237115887070161},{x:.02076496657089406,y:.23628629421823594},{x:.02082782677693791,y:.23543610758842642},{x:.021779216218601925,y:.23200052126419074},{x:.022600187477202785,y:.22853145778054884},{x:.04459918747720279,y:.16442145778054884},{x:.04602253566469808,y:.16130748249724527},{x:.047307319174730654,y:.15813382633120915},{x:.06831231917473066,y:.11806482633120913},{x:.06934150993632018,y:.11649740482650416},{x:.07018719324152095,y:.11482382676006757},{x:.07175673818837072,y:.11281909673987861},{x:.07315419088510985,y:.11069082519836773},{x:.0744693948008918,y:.10935430641546007},{x:.07562532742241568,y:.1078778703106287},{x:.1253733274224157,y:.055788870310628645},{x:.12585541612958862,y:.055374327647901005},{x:.12626130847256478,y:.0548849335871293},{x:.1291958120945167,y:.0525019586891126},{x:.1320620582603259,y:.05003730581521479},{x:.13261575702973094,y:.04972477931463493},{x:.1331093263100589,y:.049323974491408525},{x:.1861743263100589,y:.014262974491408516},{x:.18683955107784095,y:.013911818906951787},{x:.187438960697758,y:.013457349607970202},{x:.1907349034619545,y:.011855559414887177},{x:.19397565070571454,y:.010144849670490022},{x:.19469660042216425,y:.009930220356283175},{x:.19537315511619574,y:.009601422573216056},{x:.19891826102894206,y:.008673416864759805},{x:.2024304811380398,y:.007627816351770726},{x:.20317945010986724,y:.007557961391993223},{x:.20390715026053782,y:.0073674706392518954},{x:.2857161502605378,y:-.005654529360748083},{x:.2860775594607644,y:-.005676122674759226},{x:.28642923596273784,y:-.0057621838110407525},{x:.2904772893795591,y:-.005938995755027237},{x:.2945219894833068,y:-.006180656673914681},{x:.2948806669536751,y:-.006131327641200151},{x:.2952423757850646,y:-.006147126454864343},{x:.38700037578506463,y:-.001139126454864331},{x:.39074801870473747,y:-.000562375362895672},{x:.3945101708776463,y:-8942684208443352e-20},{x:.395102371884912,y:.00010774663253235539},{x:.3957192721812796,y:.00020268575218489876},{x:.39928238663684656,y:.0014994835976446027},{x:.4028799824314506,y:.002697304024131271},{x:.47474098243145063,y:.03475230402413133},{x:.4764407459001163,y:.03572046389197228},{x:.4782361407270164,y:.03649705052245801},{x:.48026428101539703,y:.03789829234877595},{x:.4824063061811086,y:.03911835786940705},{x:.4838845305509628,y:.04039952221931584},{x:.48549392283388365,y:.041511451110380196},{x:.5363469228338836,y:.08458545111038014},{x:.5369424578291695,y:.08519979361043255},{x:.5376274627831791,y:.08571247952886965},{x:.5400078699953618,y:.08836201411598918},{x:.5424869876672573,y:.09091942444541115},{x:.5429512273484354,y:.09163814564059086},{x:.5435230500634102,y:.09227461827992436},{x:.5453408198626901,y:.09533763721244376},{x:.5472733759789791,y:.0983295594844189},{x:.5475884798754501,y:.09912503932225875},{x:.5480251455251356,y:.09986083939589693},{x:.5756631455251356,y:.15896283939589692},{x:.5756676990332947,y:.1589757429605767},{x:.575674675284325,y:.15898751446598428},{x:.5771354507402345,y:.1631350040011944},{x:.5785987361645655,y:.16728160865370237},{x:.5786006848177536,y:.16729515262537814},{x:.5786052305152959,y:.16730805894366996},{x:.5792288025114348,y:.17166083878445604},{x:.5798550088797246,y:.1760132404159827},{x:.5798542777922926,y:.17602690430741857},{x:.5798562182477396,y:.17604044945602063},{x:.5820672182477395,y:.2261264494560206},{x:.5819074721227447,y:.22907858468741052},{x:.5819395990078049,y:.232034864293962},{x:.5816696541741431,y:.23347350033714379},{x:.5815905637246603,y:.23493510513282764},{x:.580857954063737,y:.2377993509905685},{x:.5803127220992973,y:.2407050941577823},{x:.5648357220992973,y:.2937960941577823},{x:.5632290277642941,y:.2977974374258546},{x:.5616400226499054,y:.30180583827676916},{x:.5384240226499054,y:.3468838382767692},{x:.5373215489467563,y:.3485896803397862},{x:.5364060617863755,y:.35040275195151915},{x:.5349331318310961,y:.3522852445680167},{x:.5336357086983223,y:.35429272914301846},{x:.5322216254408594,y:.35575071197935654},{x:.5309700163849885,y:.3573503432435408},{x:.49559401638498846,y:.39441334324354077},{x:.4926979475395651,y:.39690515537305066},{x:.48986855873600776,y:.3994724304741097},{x:.48935820160472765,y:.3997787125549045},{x:.48890701524930746,y:.4001669186691625},{x:.48558046512393155,y:.4020458563236817},{x:.4823045917066957,y:.404011815580751},{x:.4336605917066957,y:.42705181558075106},{x:.43309173356321873,y:.4272557130907893},{x:.4325654489917744,y:.42755269513041455},{x:.42894434743018467,y:.4287422729922158},{x:.4253563740806812,y:.43002832091195864},{x:.42475866795602985,y:.4301173218701226},{x:.42418455747331046,y:.430305924456616},{x:.35674655747331047,y:.44533192445661596},{x:.3529000911149492,y:.4457998510145922},{x:.3490659246900917,y:.4463596961147396},{x:.28494592469009167,y:.4493636961147396},{x:.2805873413475358,y:.449139645094856},{x:.27622830276644406,y:.44892463285807194},{x:.20879130276644411,y:.4389076328580719},{x:.2058686377582091,y:.4381749274884603},{x:.2029059705898912,y:.4376259000221244},{x:.2015992206546876,y:.4371045944779896},{x:.20023455588710068,y:.4367624761715421},{x:.19751099279397463,y:.4354736658725529},{x:.19471236238975773,y:.4343572001231398},{x:.1250653623897577,y:.39829620012313977},{x:.12281565387932818,y:.3968352958512946},{x:.12046004217050754,y:.3955521266688945},{x:.11912493361112,y:.39443863469229795},{x:.1176668837895426,y:.39349181371392206},{x:.11574541108214431,y:.3916200839502759},{x:.11440461043594556,y:.3905018447245139},{x:.11499744675527566,y:.4076710597897629},{x:.14015918883207887,y:.48309781218266834},{x:.17625691985197756,y:.5624688107059582},{x:.22079283681825793,y:.6049160879451294},{x:.2812243215554422,y:.6473094683632384},{x:.35529887985725983,y:.6721340784004237},{x:.44197867319461825,y:.699237682451455},{x:.450099621980826,y:.7026829408131323},{x:.45739239245003865,y:.7076463180152294},{x:.4635767275229571,y:.7139370742553635},{x:.4684149666709443,y:.7213134592991232},{x:.47172117907685873,y:.729492002806001},{x:.4733683088520865,y:.7381584079356077},{x:.4732930577230865,y:.7469796295989887},{x:.471498317548545,y:.7556166731946181},{x:.4680530591868676,y:.7637376219808258},{x:.4630896819847706,y:.7710303924500386},{x:.4567989257446365,y:.7772147275229571},{x:.4494225407008768,y:.7820529666709441},{x:.4412439971939989,y:.7853591790768587},{x:.43257759206439217,y:.7870063088520864},{x:.4237563704010112,y:.7869310577230865},{x:.41511932680538177,y:.7851363175485448},{x:.32800332680538175,y:.7578963175485449},{x:.32758097645219697,y:.7577171382279785},{x:.32713377373466446,y:.7576146941984534},{x:.2464307737346645,y:.7305686941984535},{x:.24453959681011464,y:.7297206474805041},{x:.2425703892464572,y:.7290741531131611},{x:.24052462272791658,y:.727920241844807},{x:.2383814751569417,y:.7269592057619036},{x:.2366920823739949,y:.725758503708645},{x:.23488683737580707,y:.7247402582115807},{x:.16634483737580705,y:.6766572582115807},{x:.16379281785599412,y:.6744641039532857},{x:.16114120086592887,y:.6723924725748345},{x:.10785520086592887,y:.6216054725748346},{x:.10512406158167997,y:.61843588774195},{x:.10236095541706475,y:.6152941312068447},{x:.10224621895073822,y:.6150960484276141},{x:.1020967920615373,y:.6149226331776604},{x:.10003648617852028,y:.6112811321861437},{x:.09793939861820375,y:.6076606883504815},{x:.057256398618203745,y:.5182076883504814},{x:.05649445644348035,y:.515973451082899},{x:.055531562043165734,y:.5138181769891187},{x:.02756156204316574,y:.4299731769891187},{x:.02710606704062858,y:.4279720709807987},{x:.026442901166776424,y:.42602987841114226},{x:.0261294707087366,y:.42368163359604843},{x:.025603668479436986,y:.4213716499642221},{x:.02554732210120287,y:.4193201319800137},{x:.025275801747494525,y:.4172858808521062},{x:.022290801747494524,y:.3308368808521062},{x:.022305383523873214,y:.330608131273329},{x:.022277364333027405,y:.33038063638780973},{x:.021194122115214913,y:.2859434614650037},{x:.02071653916751727,y:.2843071590959475},{x:.01994450211145162,y:.2755194646798348}],[{x:.11034731747482908,y:.25010871966048204},{x:.11054573733688708,y:.2582483748303443},{x:.14138614929871246,y:.28974619429248377},{x:.17280436841728808,y:.32166563054627706},{x:.2294333737827033,y:.3509863272379111},{x:.2851142784460479,y:.35925709287120927},{x:.3409693478959939,y:.3566403020317264},{x:.39969116147327427,y:.34355637352239615},{x:.43624565447916347,y:.3262425111990739},{x:.46138408324665353,y:.29990528863548604},{x:.47964461062187336,y:.2644492215688011},{x:.49182659739178797,y:.22266115801633354},{x:.4903391577658353,y:.18896604218391924},{x:.47066764412974615,y:.14689983627465894},{x:.4322187986209955,y:.11433252320671945},{x:.3738017517723872,y:.08827446060346957},{x:.29512698962943984,y:.08398052210424463},{x:.22766698305582697,y:.09471851188045},{x:.18695506157646963,y:.1216176107024183},{x:.1450838647757246,y:.1654591474507099},{x:.12861258258928074,y:.1968796571354811},{x:.11034731747482908,y:.25010871966048204}]],7:[[{x:.026534000000000002,y:.729004},{x:.027398662381854635,y:.7202249355092742},{x:.029959421036992097,y:.711783245543571},{x:.03411786744638546,y:.7040033395141179},{x:.039714194846605363,y:.6971841948466053},{x:.046533339514117915,y:.6915878674463855},{x:.05431324554357096,y:.6874294210369921},{x:.06275493550927423,y:.6848686623818546},{x:.071534,y:.684004},{x:.4019606654607806,y:.684004},{x:.4004737160341744,y:.6825246433416329},{x:.3773547160341744,y:.6545006433416328},{x:.37631768094411194,y:.6529571778549935},{x:.37511206403824765,y:.6515414747212956},{x:.3516100640382476,y:.6177174747212957},{x:.35070717908442606,y:.6160998190359583},{x:.34962595461558005,y:.6145955036421288},{x:.32637595461558006,y:.5744575036421288},{x:.32562538351875275,y:.5728072168885044},{x:.3246890272988689,y:.5712547864166106},{x:.3023170272988689,y:.5242907864166106},{x:.3017220252289498,y:.5226423026482856},{x:.3009361907094137,y:.5210757809262708},{x:.2800741907094137,y:.4667717809262708},{x:.2796297795277362,y:.4651572895546526},{x:.27899211910181604,y:.46360891205912846},{x:.26027511910181605,y:.40145091205912853},{x:.2599700482242006,y:.399900691568321},{x:.2594722021762355,y:.3984012246220316},{x:.2435242021762355,y:.3278752246220315},{x:.24329560198997774,y:.32604433113097486},{x:.24285939794168837,y:.32425152465814894},{x:.22552039794168838,y:.201651524658149},{x:.22543629437721757,y:.19966542745190077},{x:.2251384028560513,y:.1976999971774209},{x:.21759140285605127,y:.0533799971774209},{x:.2179964236931644,y:.04456775725283754},{x:.22011284489303193,y:.03600385769296016},{x:.22385933357584556,y:.028017404355184638},{x:.22909191428257988,y:.020915312162427036},{x:.23560950187114016,y:.014970510534755857},{x:.24316162910560324,y:.010411454864839347},{x:.25145807197163045,y:.007413347105324521},{x:.2601800028225791,y:.006091402856051323},{x:.26899224274716244,y:.0064964236931644576},{x:.27755614230703984,y:.008612844893031955},{x:.2855425956448154,y:.0123593335758456},{x:.29264468783757297,y:.017591914282579925},{x:.29858948946524416,y:.02410950187114019},{x:.30314854513516065,y:.03166162910560326},{x:.30614665289467546,y:.03995807197163046},{x:.3074685971439487,y:.04868000282257914},{x:.3149118365119932,y:.19101580586964154},{x:.33171443080019297,y:.3098230069615897},{x:.3469078029209317,y:.3770118558572018},{x:.3646876244488305,y:.43605754408347375},{x:.3843219343355222,y:.48716585412502805},{x:.40516196826036527,y:.5309139031705462},{x:.42657620329737017,y:.5678827017045378},{x:.4479617026009278,y:.5986606409626235},{x:.4682073320853445,y:.6232016470905397},{x:.5069453480603512,y:.6602460238293135},{x:.5211069187127709,y:.670919967941474},{x:.553634852004927,y:.6903949675582732},{x:.5545334052571363,y:.6910607030437311},{x:.5555196604858821,y:.6915878674463855},{x:.5580709875097788,y:.6936816874233654},{x:.5607229359621996,y:.6956465083018619},{x:.5614743452153894,y:.6964747509099635},{x:.5623388051533946,y:.6971841948466053},{x:.5644326251303754,y:.699735521870503},{x:.5666502995990071,y:.7021799587443133},{x:.5672256886169725,y:.7031388795761127},{x:.5679351325536145,y:.7040033395141179},{x:.5694909811561905,y:.7069141275182039},{x:.5711891576548912,y:.709744242049125},{x:.5715664145603537,y:.7107969903148255},{x:.5720935789630078,y:.711783245543571},{x:.5730516658019124,y:.7149416345772374},{x:.5741650843601849,y:.7180486670509921},{x:.5743297113818354,y:.7191547862251302},{x:.5746543376181453,y:.7202249355092742},{x:.574977843953461,y:.7235095504532041},{x:.5754637165205229,y:.7267740993542682},{x:.5754093871342436,y:.7278910818973009},{x:.575519,y:.729004},{x:.5751954936646845,y:.7322886149439295},{x:.5750351484302645,y:.735585225488817},{x:.5747639504839017,y:.7366701463880269},{x:.5746543376181453,y:.7377830644907257},{x:.5736962507792408,y:.7409414535243923},{x:.5728958497207748,y:.7441434388186243},{x:.5724182051993175,y:.7451546051722857},{x:.5720935789630078,y:.746224754456429},{x:.570537730360432,y:.749135542460515},{x:.5691280324417267,y:.752119852004927},{x:.5684622969562688,y:.7530184052571364},{x:.5679351325536145,y:.7540046604858821},{x:.5658413125766343,y:.756555987509779},{x:.563876491698138,y:.7592079359621996},{x:.5630482490900365,y:.7599593452153895},{x:.5623388051533946,y:.7608238051533946},{x:.5597874781294971,y:.7629176251303754},{x:.5573430412556867,y:.7651352995990072},{x:.5563841204238874,y:.7657106886169726},{x:.5555196604858821,y:.7664201325536145},{x:.5526088724817957,y:.7679759811561907},{x:.5497787579508749,y:.7696741576548912},{x:.5487260096851745,y:.7700514145603538},{x:.547739754456429,y:.7705785789630079},{x:.5445813654227618,y:.7715366658019126},{x:.5414743329490078,y:.7726500843601849},{x:.5403682137748697,y:.7728147113818356},{x:.5392980644907257,y:.7731393376181454},{x:.5360134495467959,y:.773462843953461},{x:.5327489006457318,y:.7739487165205229},{x:.531631918102699,y:.7738943871342436},{x:.530519,y:.774004},{x:.071534,y:.774004},{x:.06275493550927423,y:.7731393376181454},{x:.054313245543570934,y:.7705785789630079},{x:.046533339514117915,y:.7664201325536145},{x:.039714194846605363,y:.7608238051533946},{x:.03411786744638546,y:.7540046604858821},{x:.029959421036992097,y:.746224754456429},{x:.027398662381854635,y:.7377830644907257},{x:.026534000000000002,y:.729004}]],8:[[{x:.018998734783549534,y:.19034712298183487},{x:.01918983868826437,y:.187136446932327},{x:.01920952916989005,y:.18392014879903562},{x:.019451409422642358,y:.18274188004279768},{x:.019522877627479743,y:.18154116541629586},{x:.0203366813486396,y:.1784294641291047},{x:.020983462121705806,y:.17527880768498513},{x:.021450563544301488,y:.17417036752890672},{x:.021754906310756543,y:.17300666705236456},{x:.02316013582774355,y:.17011352146289485},{x:.024409151469860245,y:.16714958466818597},{x:.06244715146986025,y:.097021584668186},{x:.06364531823888224,y:.0952519506947441},{x:.06465809579443724,y:.09337006609963419},{x:.0661122558858275,y:.09160840391706095},{x:.06739294989385258,y:.08971688123025286},{x:.06891333268610705,y:.08821500101819715},{x:.07027378747657535,y:.08656685940733966},{x:.07204368953204261,y:.0851227396301211},{x:.07366879313388441,y:.08351741302778071},{x:.0754529644913056,y:.08234100299139627},{x:.07710881500204132,y:.08098994152260804},{x:.14910981500204132,y:.03317594152260801},{x:.1504928100364302,y:.03244176283843531},{x:.15177178054792087,y:.031538475488709236},{x:.15438005907773164,y:.030378172358910993},{x:.15690151209615905,y:.029039630272177964},{x:.1584011644246711,y:.028589367572161194},{x:.15983178249634203,y:.027952951404511282},{x:.24949378249634205,y:-.0017990485954887184},{x:.251605077566582,y:-.002276091838878668},{x:.25365804064979064,y:-.002962007073194259},{x:.2558970148670134,y:-.0032458471890824472},{x:.2580984148155577,y:-.003743249464233246},{x:.2602622084630055,y:-.003799233220341744},{x:.26240953986016613,y:-.0040714555567724145},{x:.33848653986016614,y:-.006196455556772458},{x:.34211630259529946,y:-.0059410451417675775},{x:.3457527120689106,y:-.005810898556388326},{x:.34651004211407876,y:-.005631877045722989},{x:.3472863241290845,y:-.005577253499755554},{x:.35079651389094996,y:-.004618619143417753},{x:.3543376604369356,y:-.0037815449929937683},{x:.4535096604369356,y:.03022045500700621},{x:.45591274590665615,y:.03131812424947078},{x:.4583949217344816,y:.03222283453480715},{x:.45991547545056405,y:.03314647083206772},{x:.461533744189149,y:.033885655452327273},{x:.46367651039942226,y:.035431052006208004},{x:.4659344916938285,y:.03680262701864639},{x:.5338604916938285,y:.08780462701864639},{x:.5368034713408607,y:.09050382186837246},{x:.5397962541268131,y:.09314768896709699},{x:.5400513850489728,y:.09348269124727963},{x:.5403617177400871,y:.09376731720532937},{x:.5427215620660051,y:.09698879462990716},{x:.5451410464862535,y:.10016572352111452},{x:.5453259194365666,y:.1005440624001799},{x:.5455747614022292,y:.10088376225489704},{x:.547260782913003,y:.10450372268352329},{x:.5490139895381407,y:.10809162577156875},{x:.5802599895381407,y:.1920326257715688},{x:.5808621946470703,y:.19431314395649216},{x:.5816704362178704,y:.19652903198349428},{x:.5819856183913868,y:.19856748893015458},{x:.5825122482529622,y:.20056180773987195},{x:.5826579751325236,y:.20291599079595712},{x:.5830183882594349,y:.20524698126417715},{x:.5829298310737253,y:.20730775882392333},{x:.5830572695913885,y:.20936649774620245},{x:.5827409180393249,y:.21170387573884492},{x:.582639652248002,y:.21406038999182395},{x:.570412652248002,y:.30012638999182395},{x:.5703409363500996,y:.30042034316527866},{x:.5703238989157716,y:.30072243812390526},{x:.5692961437829783,y:.3047027979582916},{x:.5683217827960937,y:.30869656381164773},{x:.5681940974797931,y:.30897087767968473},{x:.5681184516122305,y:.3092638441298401},{x:.5663339148242972,y:.3129672173863048},{x:.5645991308441736,y:.31669415574996157},{x:.5644203829845738,y:.31693828858446854},{x:.5642890357120441,y:.31721086798977133},{x:.5618162960169492,y:.32049493611094637},{x:.5593877558190667,y:.3238118228336772},{x:.5591648145961691,y:.32401639274673566},{x:.5589828135206953,y:.3242581100335041},{x:.5032838135206953,y:.3848241100335041},{x:.5011622073766187,y:.38671918495638496},{x:.4991781602202921,y:.38875783119234486},{x:.4978799327840818,y:.3896509997457094},{x:.496704700181234,y:.39070074870143656},{x:.4942541493273608,y:.39214550546522026},{x:.4919105049301597,y:.39375791128677606},{x:.42072451102124153,y:.4330589294870645},{x:.4777200661568854,y:.4633968522602595},{x:.4805213378044988,y:.46526159042857346},{x:.48340658539474834,y:.46699355971902134},{x:.4841865730327025,y:.4677014480666941},{x:.48506339053858555,y:.46828512408085676},{x:.487447044167244,y:.4706605328159332},{x:.4899389620874836,y:.4729221066835925},{x:.4905658603159866,y:.4737685611946159},{x:.49131196047780046,y:.47451208064740324},{x:.493186393615322,y:.4773068743236967},{x:.4951892188573616,y:.48001114175313947},{x:.5250762188573616,y:.5299501417531395},{x:.5263287500632193,y:.5326029758232522},{x:.5277533683388757,y:.5351675080991},{x:.5282078804872482,y:.5365829335183069},{x:.5288425912810938,y:.5379272372855163},{x:.5295535131980511,y:.5407734546091212},{x:.5304504424054924,y:.5435666393545394},{x:.5306200854295579,y:.5450435386925929},{x:.5309803397786421,y:.5464858379730204},{x:.5311223320761199,y:.5494160600145488},{x:.5314571037289079,y:.5523305567062068},{x:.5328161037289079,y:.6362725567062067},{x:.5325682225912138,y:.6392892202473488},{x:.5325070847315841,y:.6423154334158161},{x:.5322077563487247,y:.6436760218476847},{x:.5320936668790056,y:.6450644677251389},{x:.5312620268462096,y:.647974807711247},{x:.530611678831884,y:.6509309456375182},{x:.530052664324664,y:.6522069946735811},{x:.5296698946987799,y:.6535465042014387},{x:.5282864552309536,y:.656238677898982},{x:.5270718895714029,y:.659011137860374},{x:.493108889571403,y:.7195761378603741},{x:.49086599866607616,y:.7227903647520136},{x:.4886941713149356,y:.7260530293196586},{x:.4883443495413535,y:.7264040725827037},{x:.48806074906628455,y:.7268104928286833},{x:.4852338901214668,y:.7295253929429124},{x:.4824672795427586,y:.7323016638284542},{x:.4820556943532359,y:.7325777150511769},{x:.48169825452511067,y:.7329209983380867},{x:.4783960621447291,y:.7350322395860499},{x:.4751409876314614,y:.737215426256307},{x:.4058559876314614,y:.774404426256307},{x:.40535390944732597,y:.7746134197603937},{x:.4048950878292554,y:.7749053846735706},{x:.40128606998249994,y:.7763066859700772},{x:.39771184087056327,y:.7777944834687843},{x:.3971786373679402,y:.7779015106266721},{x:.3966716723496766,y:.778098353858693},{x:.39285862044769176,y:.7787686450898307},{x:.3890628142527955,y:.7795305574683767},{x:.38851897614326597,y:.7795315052864096},{x:.3879833501061526,y:.7796256622622586},{x:.29017035010615255,y:.7870576622622585},{x:.28883979914978264,y:.7870279344512828},{x:.28751770557027906,y:.7871806372910648},{x:.2844390802539456,y:.7869296114679608},{x:.28135100845003463,y:.7868606162788429},{x:.2800518232654171,y:.7865718820648824},{x:.2787253424971381,y:.7864637231002555},{x:.20264834249713812,y:.7726567231002556},{x:.20090732012312768,y:.7721604024311715},{x:.19912055356042774,y:.7718689262507037},{x:.1966754417776232,y:.7709540028332816},{x:.19416478523538352,y:.7702382792713757},{x:.19255404347725652,y:.7694118386491953},{x:.19085847331495095,y:.7687773822377194},{x:.12157447331495094,y:.7347753822377193},{x:.11864840230662128,y:.7329636093328938},{x:.1156466869822177,y:.7312801255296781},{x:.11490452792065226,y:.7306454666247165},{x:.11407427694169714,y:.7301313894804525},{x:.11155788892673538,y:.7277835811487093},{x:.10894228211787771,y:.7255468394054793},{x:.1083381992447159,y:.7247795872431081},{x:.10762419278113186,y:.7241134140161837},{x:.10561419113974596,y:.7213197952150451},{x:.1034852091492498,y:.7186157522626143},{x:.05457920914924981,y:.6421127522626143},{x:.05400544809690788,y:.6409849569633866},{x:.05327967340990527,y:.639948436299892},{x:.05200937551205521,y:.6370614399018406},{x:.05057918033015655,y:.6342502218929852},{x:.050236465883645505,y:.633032161635733},{x:.04972685190376166,y:.6318739658087451},{x:.04904418748077848,y:.6287946194110116},{x:.04818991452487371,y:.6257584009293389},{x:.04809141700817653,y:.6244968850866522},{x:.047817547914863534,y:.6232615229122788},{x:.04774875137767971,y:.6201081640700103},{x:.04750322987838258,y:.6169636252890404},{x:.04765273449582791,y:.6157071332072875},{x:.04762513492475421,y:.6144420789610904},{x:.04817285008571219,y:.6113358894861711},{x:.048545515296550656,y:.608203873267779},{x:.04893727666953319,y:.607000691233013},{x:.04915700725673716,y:.6057545602402229},{x:.06817600725673716,y:.537751560240223},{x:.0695259178796919,y:.5342803033966695},{x:.07076883034011841,y:.5307693133112962},{x:.07112252784165454,y:.530174666206544},{x:.07137329591617819,y:.5295298232221028},{x:.07337447700044117,y:.5263886201035727},{x:.07527846743280868,y:.5231875729003385},{x:.0757413786311829,y:.522673354732434},{x:.07611313089295507,y:.5220898246495332},{x:.07868867817173447,y:.5193993899302627},{x:.08118057729149615,y:.5166313000580217},{x:.13823757729149616,y:.46456630005802163},{x:.1415344063491032,y:.46210392848613274},{x:.14479841194755694,y:.45959821041612353},{x:.17870395742216458,y:.4385038845164132},{x:.16590813892329467,y:.43401753680148847},{x:.1630836262780146,y:.43270367241359486},{x:.16018787852971583,y:.4315553012665589},{x:.15909238677042803,y:.43084708753997614},{x:.15790960896480868,y:.43029690071741367},{x:.15539569076452509,y:.4284572467838155},{x:.15277962009410193,y:.4267660089056696},{x:.07398562009410191,y:.3640750089056696},{x:.07334669706368892,y:.36345515994886657},{x:.07261876409580822,y:.3629427646304707},{x:.07018582297292754,y:.3603886489381779},{x:.067654053855944,y:.3579324619307791},{x:.06714833408498834,y:.3571998754981266},{x:.06653435151263618,y:.35655531303498644},{x:.06464644192410274,y:.3535756306924294},{x:.06264249835499126,y:.3506727149773525},{x:.06228941637067996,y:.3498555439546183},{x:.061812979199786275,y:.3491035845207174},{x:.026491979199786284,y:.27897658452071744},{x:.026206182636496978,y:.2782362375154344},{x:.02580526951533789,y:.27755135647970497},{x:.024619992088609113,y:.2741272608068926},{x:.023315086847465263,y:.27074694483548933},{x:.02317921632066564,y:.26996506724675395},{x:.022919620294515476,y:.2692151317381758},{x:.022425125568608657,y:.2656255929487299},{x:.02180476064715109,y:.2620556544171705},{x:.02182403758498896,y:.26126229336223583},{x:.021715734783549545,y:.26047612298183487},{x:.018998734783549534,y:.19034712298183487}],[{x:.10940940002433477,y:.19920410482166873},{x:.1112697837122767,y:.2472228194523932},{x:.137749803196691,y:.2997967648781603},{x:.20286290613296581,y:.3516028102138205},{x:.27392321813344717,y:.3765172983642545},{x:.30180455045059645,y:.38547932587505673},{x:.3589974388819276,y:.364332623176267},{x:.44199758150171664,y:.31850914110336725},{x:.48327372240847105,y:.27362627516037924},{x:.4919267227459848,y:.21271770175329152},{x:.46927072007314496,y:.15185335046477932},{x:.41758736799183827,y:.11304708595854013},{x:.33285528741119674,y:.08399594043457195},{x:.2715476841223936,y:.0857083982994813},{x:.19388634557978268,y:.1114782912788902},{x:.13622191473335832,y:.14977174687660325},{x:.10940940002433477,y:.19920410482166873}],[{x:.1412545940070051,y:.610603192179028},{x:.17253143522148345,y:.6595291354872365},{x:.22488466829434647,y:.6852221473073319},{x:.28911227954018853,y:.6968786351876549},{x:.37167628924266627,y:.6906052797020977},{x:.4210229734590171,y:.664118250196117},{x:.4426312796779887,y:.6255849325813003},{x:.4416638895166663,y:.5658316839266069},{x:.4243877259953326,y:.5369644730960824},{x:.3411654121752423,y:.49266641996418925},{x:.3038587353431559,y:.48067475972705925},{x:.2482367446999157,y:.5012406330709052},{x:.1958501022844071,y:.5338329684082593},{x:.1513751879049268,y:.5744167077770947},{x:.1412545940070051,y:.610603192179028}]],9:[[{x:.04617702144416433,y:.5785043710151274},{x:.046308257010348054,y:.5777836867379841},{x:.04632014162646953,y:.5770512474182771},{x:.047097404355444614,y:.5734500590446777},{x:.04775742235616295,y:.5698255492446179},{x:.06775742235616294,y:.499825549244618},{x:.06870401207934061,y:.497431122678351},{x:.06945142103699212,y:.4949672455435709},{x:.07032179921115676,y:.4933388825112154},{x:.07100061044171635,y:.4916218095236955},{x:.07239614115864691,y:.4894580616864063},{x:.07360986744638548,y:.48718733951411786},{x:.07478119941633177,y:.4857600673791044},{x:.07578195180149752,y:.48420841696912487},{x:.07757279404935197,y:.4823584994767568},{x:.07920619484660538,y:.4803681948466053},{x:.1292061948466054,y:.43036819484660543},{x:.1324047212320044,y:.4277432320802026},{x:.1355710052680468,y:.42507946670648067},{x:.13581237417673697,y:.4249466435819557},{x:.13602533951411794,y:.4247718674463855},{x:.13967451194327588,y:.422821344145996},{x:.14329963156393744,y:.42082647364918746},{x:.21329963156393744,y:.39082647364918743},{x:.21510775104315333,y:.39025382151681987},{x:.2168404136401385,y:.3894823898342746},{x:.21930272871556003,y:.3889252240779052},{x:.22170947225776405,y:.3881629808537447},{x:.22359456811709633,y:.38795407868297094},{x:.22544443694348562,y:.38753549554788497},{x:.30544443694348566,y:.37753549554788496},{x:.30933066171136914,y:.37743373006124875},{x:.3132134481214367,y:.3772411973248817},{x:.31373545479679327,y:.3773183852372503},{x:.314262956584918,y:.37730457196617717},{x:.3180943620951528,y:.37796292671622445},{x:.321940103126635,y:.37853158749346005},{x:.39912055139763536,y:.39782669956121014},{x:.3920145202755848,y:.3793136184800785},{x:.3919728818872528,y:.3791621799808353},{x:.39190347676812315,y:.3790212888743934},{x:.33928123709710245,y:.23902627390054626},{x:.29593066247424293,y:.13853176000209894},{x:.2601678276974797,y:.06104561798577861},{x:.25727396725620644,y:.05271224015242973},{x:.25606147289685455,y:.04397442167208486},{x:.2565769400976792,y:.035167952008718584},{x:.2588005597432301,y:.02663125885276897},{x:.2626468793775489,y:.018692402534786497},{x:.2679680870941297,y:.011656468850909336},{x:.274559691864592,y:.005793844786811796},{x:.2821683820142214,y:.0013298276974796769},{x:.29050175984757026,y:-.0015640327437935753},{x:.29923957832791515,y:-.002776527103145486},{x:.30804604799128144,y:-.002261059902320825},{x:.31658274114723106,y:-3744025676995222e-20},{x:.32452159746521353,y:.003808879377548882},{x:.3315575311490907,y:.009130087094129706},{x:.33742015521318824,y:.015721691864591977},{x:.34188417230252033,y:.023330382014221395},{x:.3778841723025203,y:.10133038201422136},{x:.3780704961344211,y:.10186693411204945},{x:.37834550457920557,y:.10236389998544072},{x:.42234550457920556,y:.2043638999854408},{x:.4226728981736059,y:.20538920106595157},{x:.42314852323187685,y:.20635471112560658},{x:.47609350933819694,y:.3472083534084579},{x:.5496013805841499,y:.5387157021808093},{x:.5512752235949963,y:.542063388202502},{x:.5520259437659378,y:.5440252139743784},{x:.5529745491659372,y:.5458993775022888},{x:.553598518494472,y:.5481347580495968},{x:.5544279630456541,y:.5503023109672317},{x:.5547815251174404,y:.5523728990468965},{x:.5553462721645,y:.554396114781092},{x:.555522150986547,y:.5567102734952235},{x:.5559127893965689,y:.5589979940959194},{x:.5558556061770612,y:.5610977729446709},{x:.5560147919588762,y:.5631922898391183},{x:.5557358213499382,y:.5654962948984841},{x:.5556726416037749,y:.5678162673625252},{x:.5552069106120301,y:.5698645436567753},{x:.5549544177082778,y:.5719498706018395},{x:.5349544177082779,y:.6619498706018395},{x:.5345092452033302,y:.663307558548854},{x:.5342480120020212,y:.6647122835522489},{x:.5331378863550271,y:.6674899313564284},{x:.5322058990004909,y:.6703323081518522},{x:.5315044085816177,y:.6715770596583215},{x:.5309741466497647,y:.6729038291953012},{x:.5293434595512297,y:.6754115305058349},{x:.5278748598680685,y:.6780174701150343},{x:.5269440094186665,y:.6791014500786302},{x:.5261650964249364,y:.6802992771399491},{x:.4861650964249363,y:.7302992771399491},{x:.4855393928217795,y:.7309407996522789},{x:.48502142797480674,y:.7316720783612058},{x:.48246447922773295,y:.7340934525762789},{x:.48000567043073006,y:.7366144244690945},{x:.4792668347133476,y:.7371215515888083},{x:.4786161570168623,y:.7377377290536072},{x:.47563595264764597,y:.7396137412876539},{x:.4727325719538572,y:.7416065836124539},{x:.4719089971645242,y:.7419598267287414},{x:.4711506117974981,y:.7424372235949962},{x:.4111506117974981,y:.7724372235949962},{x:.40814803697660645,y:.7735862009991664},{x:.4052110607504687,y:.7748937847545917},{x:.4040364518244048,y:.77515955677446},{x:.40291168903276836,y:.7755899630456542},{x:.39974265347336024,y:.7761310898824948},{x:.39660701348596056,y:.7768405731449995},{x:.3166070134859606,y:.7868395731449994},{x:.31542693671630134,y:.7868704603456931},{x:.31426350899694466,y:.7870703881908964},{x:.3110259999999998,y:.7869856499834279},{x:.3077884910030554,y:.7870703881908964},{x:.3066250632836987,y:.7868704603456931},{x:.30544498651403945,y:.7868395731449994},{x:.22544498651403946,y:.7768405731449995},{x:.22359484289355938,y:.7764219517671516},{x:.22170947225776405,y:.7762130191462554},{x:.21930299190993624,y:.775450859278766},{x:.2168409392495313,y:.7748937847545917},{x:.21510801459933976,y:.7741222619544408},{x:.21329963156393744,y:.7735495263508126},{x:.14329963156393744,y:.7435495263508126},{x:.1396745119432796,y:.741554655854006},{x:.13602533951411788,y:.7396041325536146},{x:.13581237417673678,y:.7394293564180442},{x:.1355710052680468,y:.7392965332935194},{x:.13240472123200803,y:.7366327679198006},{x:.12920619484660534,y:.7340078051533947},{x:.07920619484660535,y:.6840078051533947},{x:.07757279404935197,y:.6820175005232432},{x:.0757819518014975,y:.6801675830308751},{x:.07478119941633177,y:.6786159326208956},{x:.07360986744638545,y:.6771886604858821},{x:.07239614115864686,y:.6749179383135936},{x:.07100061044171635,y:.6727541904763045},{x:.07032179921115676,y:.6710371174887846},{x:.06945142103699209,y:.669408754456429},{x:.06870401207934061,y:.666944877321649},{x:.06775742235616294,y:.664550450755382},{x:.04775742235616295,y:.5945504507553819},{x:.0470974043554446,y:.590925940955322},{x:.04632014162646953,y:.5873247525817227},{x:.046308257010348054,y:.5865923132620157},{x:.04617702144416433,y:.5858716289848723},{x:.0462367922883029,y:.5821879999999999},{x:.04617702144416433,y:.5785043710151274}],[{x:.13782670643108905,y:.5821879999999999},{x:.15109114488080894,y:.6286135345740196},{x:.18671787059591238,y:.6642402602891231},{x:.24291204200407931,y:.688323476606909},{x:.311026,y:.696836869931924},{x:.377796042530131,y:.6884914492411893},{x:.4220611757635009,y:.6663588826245044},{x:.4493630453483168,y:.6322315456434845},{x:.46363172164975686,y:.5680225022870041},{x:.4540425513192988,y:.5488441616260881},{x:.42235697647551157,y:.5171585867823008},{x:.37255000597497323,y:.48395393978194207},{x:.30826669745594837,y:.4678831126521858},{x:.24291230161158606,y:.4760524121327311},{x:.1867178705959123,y:.500135739710877},{x:.15109114488080894,y:.5357624654259804},{x:.13782670643108905,y:.5821879999999999}]],"!":[[{x:.20646600000000004,y:.05103000000000002},{x:.20733066238185466,y:.04225093550927423},{x:.20989142103699213,y:.03380924554357098},{x:.2140498674463855,y:.026029339514117927},{x:.21964619484660539,y:.019210194846605383},{x:.22646533951411793,y:.013613867446385479},{x:.23424524554357098,y:.009455421036992116},{x:.24268693550927425,y:.006894662381854655},{x:.251466,y:.0060300000000000215},{x:.350587,y:.0060300000000000215},{x:.3593660644907258,y:.006894662381854655},{x:.36780775445642905,y:.009455421036992116},{x:.3755876604858821,y:.013613867446385479},{x:.38240680515339465,y:.019210194846605383},{x:.3880031325536145,y:.026029339514117927},{x:.3921615789630079,y:.03380924554357098},{x:.39472233761814535,y:.04225093550927425},{x:.39558699999999997,y:.05103000000000002},{x:.39472233761814535,y:.05980906449072579},{x:.3921615789630079,y:.06825075445642906},{x:.3880031325536145,y:.07603066048588211},{x:.38240680515339465,y:.08284980515339466},{x:.3755876604858821,y:.08844613255361455},{x:.36780775445642905,y:.09260457896300792},{x:.3593660644907258,y:.09516533761814538},{x:.350587,y:.09603000000000002},{x:.251466,y:.09603000000000002},{x:.24268693550927425,y:.09516533761814538},{x:.23424524554357098,y:.09260457896300792},{x:.22646533951411793,y:.08844613255361455},{x:.21964619484660539,y:.08284980515339466},{x:.2140498674463855,y:.07603066048588211},{x:.20989142103699213,y:.06825075445642906},{x:.20733066238185466,y:.05980906449072579},{x:.20646600000000004,y:.05103000000000002}],[{x:.25602600000000003,y:.25043400000000005},{x:.25689066238185465,y:.24165493550927428},{x:.2594514210369921,y:.233213245543571},{x:.2636098674463855,y:.22543333951411795},{x:.26920619484660535,y:.2186141948466054},{x:.27602533951411795,y:.2130178674463855},{x:.283805245543571,y:.20885942103699215},{x:.2922469355092743,y:.20629866238185468},{x:.301026,y:.20543400000000006},{x:.3098050644907258,y:.20629866238185468},{x:.3182467544564291,y:.20885942103699215},{x:.32602666048588214,y:.2130178674463855},{x:.3328458051533947,y:.2186141948466054},{x:.33844213255361455,y:.22543333951411795},{x:.34260057896300794,y:.233213245543571},{x:.3451613376181454,y:.24165493550927428},{x:.346026,y:.25043400000000005},{x:.346026,y:.729004},{x:.3451613376181454,y:.7377830644907257},{x:.34260057896300794,y:.746224754456429},{x:.33844213255361455,y:.7540046604858821},{x:.3328458051533947,y:.7608238051533946},{x:.32602666048588214,y:.7664201325536145},{x:.3182467544564291,y:.7705785789630079},{x:.3098050644907258,y:.7731393376181454},{x:.301026,y:.774004},{x:.2922469355092743,y:.7731393376181454},{x:.283805245543571,y:.7705785789630079},{x:.27602533951411795,y:.7664201325536145},{x:.26920619484660535,y:.7608238051533946},{x:.2636098674463855,y:.7540046604858821},{x:.2594514210369921,y:.746224754456429},{x:.25689066238185465,y:.7377830644907257},{x:.25602600000000003,y:.729004},{x:.25602600000000003,y:.25043400000000005}]],\'"\':[[{x:.12004,y:.476978},{x:.12090466238185463,y:.4681989355092742},{x:.1234654210369921,y:.459757245543571},{x:.12762386744638546,y:.4519773395141179},{x:.13322019484660536,y:.44515819484660535},{x:.1400393395141179,y:.4395618674463855},{x:.14781924554357095,y:.4354034210369921},{x:.15626093550927422,y:.43284266238185465},{x:.16504,y:.43197800000000003},{x:.17381906449072576,y:.43284266238185465},{x:.18226075445642903,y:.4354034210369921},{x:.19004066048588208,y:.4395618674463855},{x:.19685980515339463,y:.44515819484660535},{x:.20245613255361453,y:.4519773395141179},{x:.2066145789630079,y:.459757245543571},{x:.20917533761814536,y:.4681989355092742},{x:.21004,y:.476978},{x:.21004,y:.729004},{x:.20917533761814536,y:.7377830644907257},{x:.2066145789630079,y:.746224754456429},{x:.20245613255361453,y:.7540046604858821},{x:.19685980515339463,y:.7608238051533946},{x:.19004066048588208,y:.7664201325536145},{x:.18226075445642903,y:.7705785789630079},{x:.17381906449072576,y:.7731393376181454},{x:.16504,y:.774004},{x:.15626093550927422,y:.7731393376181454},{x:.14781924554357095,y:.7705785789630079},{x:.1400393395141179,y:.7664201325536145},{x:.13322019484660536,y:.7608238051533946},{x:.12762386744638546,y:.7540046604858821},{x:.1234654210369921,y:.746224754456429},{x:.12090466238185463,y:.7377830644907257},{x:.12004,y:.729004},{x:.12004,y:.476978}],[{x:.392013,y:.476978},{x:.3928776623818546,y:.4681989355092742},{x:.39543842103699206,y:.459757245543571},{x:.39959686744638545,y:.4519773395141179},{x:.4051931948466053,y:.44515819484660535},{x:.4120123395141179,y:.4395618674463855},{x:.419792245543571,y:.4354034210369921},{x:.42823393550927424,y:.43284266238185465},{x:.437013,y:.43197800000000003},{x:.4457920644907258,y:.43284266238185465},{x:.45423375445642905,y:.4354034210369921},{x:.4620136604858821,y:.4395618674463855},{x:.46883280515339465,y:.44515819484660535},{x:.4744291325536145,y:.4519773395141179},{x:.4785875789630079,y:.459757245543571},{x:.48114833761814535,y:.4681989355092742},{x:.48201299999999997,y:.476978},{x:.48201299999999997,y:.729004},{x:.48114833761814535,y:.7377830644907257},{x:.4785875789630079,y:.746224754456429},{x:.4744291325536145,y:.7540046604858821},{x:.46883280515339465,y:.7608238051533946},{x:.4620136604858821,y:.7664201325536145},{x:.45423375445642905,y:.7705785789630079},{x:.4457920644907258,y:.7731393376181454},{x:.437013,y:.774004},{x:.42823393550927424,y:.7731393376181454},{x:.419792245543571,y:.7705785789630079},{x:.4120123395141179,y:.7664201325536145},{x:.4051931948466053,y:.7608238051533946},{x:.39959686744638545,y:.7540046604858821},{x:.39543842103699206,y:.746224754456429},{x:.3928776623818546,y:.7377830644907257},{x:.392013,y:.729004},{x:.392013,y:.476978}]],"#":[[{x:-.04343582416242281,y:.17932596542766122},{x:-.043155600373289436,y:.1705088746946064},{x:-.04116063193533153,y:.16191587083690517},{x:-.037527584366828626,y:.15387717817379684},{x:-.03239607364840174,y:.1467017191561739},{x:-.025963300859175642,y:.14066524265003977},{x:-.01847647384989975,y:.13599972706223024},{x:-.010223307183879607,y:.1328844655403335},{x:-.0015209654276611437,y:.13143917583757725},{x:.007296125305393629,y:.13171939962671061},{x:.11028337660265361,y:.14517801654688708},{x:.10171449233133083,y:.05447855391336175},{x:.10174959121806887,y:.04565708110917159},{x:.10350499965956604,y:.03701195788446062},{x:.10691325829386003,y:.02887541147651351},{x:.11184338965300836,y:.02156012480075985},{x:.11810593155372849,y:.015347220221688843},{x:.1254602180228497,y:.01047545617803717},{x:.13362362795569505,y:.007132051829885598},{x:.14228244608663826,y:.005445492331330834},{x:.15110391889082841,y:.0054805912180688685},{x:.1597490421155394,y:.0072359996595660475},{x:.1678855885234865,y:.010644258293860037},{x:.17520087519924016,y:.015574389653008364},{x:.18141377977831116,y:.02183693155372849},{x:.18628554382196283,y:.029191218022849703},{x:.18962894817011441,y:.03735462795569504},{x:.19131550766866917,y:.04601344608663827},{x:.2018142041879224,y:.1571394809935999},{x:.36570083500909,y:.17855657247605955},{x:.35397849233133083,y:.05447855391336175},{x:.35401359121806886,y:.04565708110917159},{x:.35576899965956604,y:.03701195788446062},{x:.35917725829386,y:.02887541147651351},{x:.3641073896530084,y:.02156012480075985},{x:.3703699315537285,y:.015347220221688843},{x:.37772421802284967,y:.01047545617803717},{x:.38588762795569503,y:.007132051829885598},{x:.39454644608663825,y:.005445492331330834},{x:.4033679188908284,y:.0054805912180688685},{x:.4120130421155394,y:.0072359996595660475},{x:.4201495885234865,y:.010644258293860037},{x:.42746487519924015,y:.015574389653008364},{x:.4336777797783111,y:.02183693155372849},{x:.4385495438219628,y:.029191218022849703},{x:.44189294817011443,y:.03735462795569504},{x:.44357950766866916,y:.04601344608663827},{x:.45723166259435877,y:.19051803692277236},{x:.5748861253053936,y:.20589339962671058},{x:.5834791291630949,y:.20788836806466848},{x:.5915178218262032,y:.2115214156331714},{x:.5986932808438261,y:.21665292635159827},{x:.6047297573499603,y:.22308569914082438},{x:.6093952729377698,y:.23057252615010027},{x:.6125105344596665,y:.2388256928161204},{x:.6139558241624228,y:.24752803457233888},{x:.6136756003732894,y:.25634512530539366},{x:.6116806319353315,y:.2649381291630949},{x:.6080475843668286,y:.2729768218262032},{x:.6029160736484017,y:.2801522808438262},{x:.5964833008591757,y:.2861887573499603},{x:.5889964738498997,y:.29085427293776983},{x:.5807433071838796,y:.29396953445966656},{x:.5720409654276611,y:.2954148241624228},{x:.5632238746946063,y:.2951346003732895},{x:.4659139564059225,y:.28241791072205386},{x:.48521785958998953,y:.48674482074743597},{x:.6064180682130128,y:.5025833921657807},{x:.6150110746232834,y:.5045783496089273},{x:.6230497719348954,y:.5082113868918628},{x:.6302252375183169,y:.5133428884292346},{x:.6362617222552247,y:.5197756534947408},{x:.640927247422479,y:.5272624745344501},{x:.6440425195043586,y:.5355156372144642},{x:.645487820341822,y:.544217977121417},{x:.6452076078342193,y:.5530350682130128},{x:.6432126503910727,y:.5616280746232835},{x:.6395796131081373,y:.5696667719348955},{x:.6344481115707654,y:.576842237518317},{x:.6280153465052593,y:.5828787222552247},{x:.6205285254655499,y:.587544247422479},{x:.6122753627855358,y:.5906595195043587},{x:.603573022878583,y:.592104820341822},{x:.5947559317869872,y:.5918246078342193},{x:.493900150869001,y:.5786446677402959},{x:.5066445076686692,y:.7135404460866382},{x:.5066094087819312,y:.7223619188908285},{x:.5048540003404339,y:.7310070421155394},{x:.50144574170614,y:.7391435885234865},{x:.4965156103469916,y:.7464588751992401},{x:.4902530684462715,y:.7526717797783111},{x:.4828987819771503,y:.7575435438219629},{x:.47473537204430494,y:.7608869481701144},{x:.4660765539133617,y:.7625735076686692},{x:.45725508110917157,y:.7625384087819311},{x:.44860995788446056,y:.760783000340434},{x:.4404734114765135,y:.7573747417061399},{x:.43315812480075977,y:.7524446103469916},{x:.4269452202216888,y:.7461820684462716},{x:.42207345617803715,y:.7388277819771503},{x:.41873005182988554,y:.730664372044305},{x:.4170434923313308,y:.7220055539133617},{x:.40236933467780645,y:.5666833238969633},{x:.23848272425781383,y:.5452664483557571},{x:.25438050766866915,y:.7135404460866382},{x:.2543454087819311,y:.7223619188908285},{x:.25259000034043394,y:.7310070421155394},{x:.24918174170614,y:.7391435885234865},{x:.2442516103469916,y:.7464588751992401},{x:.23798906844627152,y:.7526717797783111},{x:.2306347819771503,y:.7575435438219629},{x:.22247137204430495,y:.7608869481701144},{x:.21381255391336174,y:.7625735076686692},{x:.20499108110917158,y:.7625384087819311},{x:.1963459578844606,y:.760783000340434},{x:.18820941147651346,y:.7573747417061399},{x:.1808941248007598,y:.7524446103469916},{x:.17468122022168883,y:.7461820684462716},{x:.16980945617803714,y:.7388277819771503},{x:.16646605182988555,y:.730664372044305},{x:.16477949233133082,y:.7220055539133617},{x:.14695190806661926,y:.5333051045124245},{x:.02716793178698713,y:.5176516078342193},{x:.01857492537671658,y:.5156566503910727},{x:.01053622806510461,y:.5120236131081373},{x:.0033607624816830023,y:.5068921115707654},{x:-.0026757222552247634,y:.5004593465052593},{x:-.0073412474224789775,y:.4929725254655499},{x:-.010456519504358698,y:.48471936278553585},{x:-.011901820341822023,y:.476017022878583},{x:-.011621607834219276,y:.4671999317869871},{x:-.00962665039107264,y:.45860692537671655},{x:-.005993613108137223,y:.45056822806510455},{x:-.0008621115707654614,y:.44339276248168297},{x:.005570653494740684,y:.4373562777447752},{x:.013057474534450029,y:.432690752577521},{x:.02131063721446411,y:.42957548049564126},{x:.03001297712141698,y:.42813017965817796},{x:.03883006821301287,y:.4284103921657807},{x:.13826961678760774,y:.4414052575195645},{x:.1189656704142173,y:.23707789034616855},{x:-.004366125305393629,y:.2209606003732895},{x:-.012959129163094893,y:.21896563193533158},{x:-.0209978218262032,y:.2153325843668287},{x:-.028173280843826164,y:.2102010736484018},{x:-.034209757349960276,y:.2037683008591757},{x:-.03887527293776982,y:.1962814738498998},{x:-.041990534459666565,y:.18802830718387967},{x:-.04343582416242281,y:.17932596542766122}],[{x:.2104964979994861,y:.24903935479288136},{x:.22980043297880234,y:.4533666013628972},{x:.39368704339879496,y:.4747834769041034},{x:.3743831288206537,y:.27045644627534104},{x:.2104964979994861,y:.24903935479288136}]],$:[[{x:.030517420733400163,y:.165091535964518},{x:.03086584266660257,y:.1562768767808978},{x:.032927224468652025,y:.14769956254897784},{x:.06950822446865203,y:.04228956254897785},{x:.0704003940010533,y:.04035550336969822},{x:.07109145007989037,y:.03834080913001754},{x:.07224350295250744,y:.03635998272422403},{x:.073203348392932,y:.034279214644477654},{x:.0744556913660193,y:.03255637151138059},{x:.07552651634405921,y:.03071520740954014},{x:.07704287290513265,y:.02899719639360223},{x:.07839021289928177,y:.02714366624511229},{x:.07995460247492134,y:.0256982470536212},{x:.08136404514878363,y:.02410136799351792},{x:.08318643266605391,y:.022712194567306505},{x:.08486948969354943,y:.02115713247420773},{x:.0866858072576693,y:.0200446838732511},{x:.08837970353582197,y:.01875345702162473},{x:.17373770353582196,y:-.03394954297837521},{x:.17475219432147746,y:-.03444582628601368},{x:.17568351020275566,y:-.03508468417701866},{x:.17870701554383397,y:-.03638050305696308},{x:.18166188368778688,y:-.037826008286632525},{x:.18275370138776084,y:-.03811483831561822},{x:.18379175728720304,y:-.038559730016208084},{x:.18700996854351615,y:-.03924079346911771},{x:.19019006380536974,y:-.04008205754340442},{x:.19131725047775072,y:-.0401523347177012},{x:.19242215448928965,y:-.04038616328932037},{x:.262121,y:-.048110644533924524},{x:.262121,y:-.08350199999999997},{x:.2629856623818546,y:-.09228106449072573},{x:.26554642103699205,y:-.100722754456429},{x:.26970486744638544,y:-.10850266048588206},{x:.2753011948466053,y:-.1153218051533946},{x:.2821203395141179,y:-.1209181325536145},{x:.28990024554357097,y:-.12507657896300786},{x:.29834193550927424,y:-.12763733761814533},{x:.307121,y:-.12850199999999995},{x:.3159000644907258,y:-.12763733761814533},{x:.32434175445642904,y:-.12507657896300786},{x:.3321216604858821,y:-.1209181325536145},{x:.33894080515339464,y:-.1153218051533946},{x:.3445371325536145,y:-.10850266048588206},{x:.3486955789630079,y:-.100722754456429},{x:.35125633761814534,y:-.09228106449072573},{x:.35212099999999996,y:-.08350199999999997},{x:.35212099999999996,y:-.05796857189257534},{x:.3537665284657676,y:-.05798865052825875},{x:.3565834008023822,y:-.05822276473922817},{x:.35816715833059226,y:-.05804234673933715},{x:.35976104048452195,y:-.05806179518994546},{x:.3625398346041163,y:-.05754422155704884},{x:.36534825494544937,y:-.05722429279787242},{x:.3668663832111493,y:-.05673836571308556},{x:.3684334335709129,y:-.056446489484502926},{x:.37105786033397337,y:-.05539674504422484},{x:.37374990266128777,y:-.05453506799769968},{x:.49568890266128773,y:-.0018330679976996528},{x:.4995437197067623,y:.0003036028478311586},{x:.5033988605511543,y:.0024396894158641644},{x:.5034014762743246,y:.0024419030290919073},{x:.503404473339876,y:.00244356426035406},{x:.5067683773534712,y:.005291217073469004},{x:.510132712931077,y:.008138360005776092},{x:.5101348465393426,y:.008141041387321917},{x:.510137461926978,y:.00814325539697476},{x:.5128811799638975,y:.011592456477016289},{x:.5156254207452635,y:.015041241667436683},{x:.5156269902452553,y:.015044287773311453},{x:.5156291234470946,y:.015046969478205698},{x:.5176472159618929,y:.018965167962033513},{x:.519665902312761,y:.02288306052976895},{x:.5684429023127611,y:.1458620605297689},{x:.5688122064775901,y:.14714915498994666},{x:.5693537919217377,y:.14837377040805427},{x:.5700262192706007,y:.15138021786244946},{x:.5708758841928585,y:.15434145989163614},{x:.5709869926090132,y:.15567587086110493},{x:.5712792610244494,y:.1569826137160382},{x:.5713522390683521,y:.16006247719363653},{x:.5716078682563359,y:.16313258119086366},{x:.5714565110896938,y:.16446302800441426},{x:.5714882307651191,y:.1658016809010868},{x:.5709589549987614,y:.16883660297565092},{x:.5706107247661352,y:.1718975865660398},{x:.570202718587728,y:.17317294089875004},{x:.5699726705538047,y:.1744920601570685},{x:.5455836705538047,y:.26233106015706853},{x:.5448796820390573,y:.26415145628779163},{x:.5443792359109676,y:.2660379863232085},{x:.5432925447356423,y:.2682555269445408},{x:.5424018225194911,y:.2705587850827968},{x:.5413562192793141,y:.27220686146627543},{x:.5404973453311464,y:.27395951015977},{x:.5389989139081434,y:.2759224384285429},{x:.5376759632977357,y:.2780076688235372},{x:.5363289272782685,y:.2794200908086057},{x:.5351446315541886,y:.28097150485378414},{x:.5332920437627642,y:.28260438653745124},{x:.5315877050081386,y:.28439145495451523},{x:.529991002048182,y:.2855139439563835},{x:.528526796368706,y:.2868045033815319},{x:.4553637963687061,y:.3395095033815319},{x:.4552094954443409,y:.33959910378534747},{x:.4550747122553104,y:.3397160246969866},{x:.45139660000367776,y:.341813199213456},{x:.44773515946955245,y:.3439393468807752},{x:.44756634322254935,y:.3439971230209339},{x:.4474113397164003,y:.34408550243429054},{x:.4433947629085852,y:.34542481622689836},{x:.43938888509457313,y:.34679579895012297},{x:.43921204103863115,y:.34681953052195974},{x:.439042773913178,y:.34687597206574233},{x:.35212099999999996,y:.3666493043587998},{x:.35212099999999996,y:.6320956693586206},{x:.3838005126074005,y:.6288356018928482},{x:.4577579663937751,y:.5527249728659002},{x:.46449612147708186,y:.5470313904751531},{x:.47221556762189953,y:.5427617575185425},{x:.48061965084199804,y:.5400801535961528},{x:.48938540693229315,y:.5390896312428609},{x:.49817597280212744,y:.5398282556772123},{x:.5066535319349293,y:.5422676419764202},{x:.5144922964874953,y:.5463140458930298},{x:.5213910271340998,y:.551811966393775},{x:.5270846095248467,y:.5585501214770818},{x:.5313542424814575,y:.5662695676218995},{x:.534035846403847,y:.5746736508419981},{x:.535026368757139,y:.5834394069322931},{x:.5342877443227877,y:.5922299728021274},{x:.5318483580235798,y:.6007075319349293},{x:.5278019541069703,y:.6085462964874953},{x:.5223040336062249,y:.6154450271340998},{x:.4369490336062249,y:.7032850271340998},{x:.435089451582588,y:.7048563301588934},{x:.43337550685970433,y:.706585327551969},{x:.43172842132509603,y:.7076963215886295},{x:.4302108785229181,y:.7089786095248467},{x:.4280804818333404,y:.7101569339468108},{x:.4260621594195314,y:.7115183351118896},{x:.4242299779872524,y:.7122866512623272},{x:.42249143237810044,y:.7132482424814575},{x:.4201720909726226,y:.7139883059538676},{x:.4179269538663623,y:.7149297930076584},{x:.4159800862413552,y:.7153259053130885},{x:.41408734915800194,y:.715929846403847},{x:.4116681940261354,y:.716203208702491},{x:.4092825215873294,y:.7166886008255086},{x:.35212099999999996,y:.7225709645831306},{x:.35212099999999996,y:.7597659999999999},{x:.35125633761814534,y:.7685450644907257},{x:.3486955789630079,y:.776986754456429},{x:.3445371325536145,y:.7847666604858821},{x:.33894080515339464,y:.7915858051533946},{x:.3321216604858821,y:.7971821325536145},{x:.32434175445642904,y:.8013405789630078},{x:.3159000644907258,y:.8039013376181453},{x:.307121,y:.804766},{x:.29834193550927424,y:.8039013376181453},{x:.28990024554357097,y:.8013405789630078},{x:.2821203395141179,y:.7971821325536145},{x:.2753011948466053,y:.7915858051533946},{x:.26970486744638544,y:.7847666604858821},{x:.26554642103699205,y:.776986754456429},{x:.2629856623818546,y:.7685450644907257},{x:.262121,y:.7597659999999999},{x:.262121,y:.7318326623736131},{x:.23856652158732947,y:.7342566008255086},{x:.23743405616423266,y:.7342615520061975},{x:.23631438427367413,y:.7344313675125375},{x:.2330314335362298,y:.7342808004350606},{x:.22974506326706257,y:.734295168567351},{x:.22863339192208898,y:.7340790915684273},{x:.22750210485113245,y:.7340272069677483},{x:.2243116092711877,y:.7332390610779145},{x:.22108558260167874,y:.7326120140964958},{x:.22003742624118275,y:.7321832126358507},{x:.21893799871753236,y:.7319116218242595},{x:.21596256725097532,y:.7305161851266182},{x:.21292085857685591,y:.729271820095334},{x:.21197649726195836,y:.7286467727726252},{x:.21095117966878213,y:.7281659128327016},{x:.2083051564782311,y:.7262168111769735},{x:.20556465695803808,y:.7244029483461277},{x:.204760381964467,y:.7236056753794367},{x:.20384857668186554,y:.7229340254890024},{x:.10629557668186554,y:.6350940254890024},{x:.10393291169686979,y:.6325042238563513},{x:.10146752815288923,y:.6300120075116347},{x:.10096488682836192,y:.6292508655939548},{x:.10035013880638408,y:.6285770182897039},{x:.09853811700104832,y:.6255760458964971},{x:.09660631239978806,y:.6226507443205297},{x:.09626182060918942,y:.6218061670735107},{x:.09579034588565258,y:.6210253361666956},{x:.09459860224176168,y:.6177285186990383},{x:.0932746147506803,y:.6144825495908574},{x:.056695614750680294,y:.49150554959085735},{x:.05654965816703397,y:.490750439567249},{x:.05628361804350595,y:.49002883224693095},{x:.05571374572525952,y:.48642582571377374},{x:.055021470477783566,y:.4828443224653027},{x:.055025633066628665,y:.4820752469521588},{x:.05490548343396577,y:.4813156032607913},{x:.055049472757300266,y:.47767065091379934},{x:.05506921600663437,y:.4740229090450286},{x:.05522333780201598,y:.4732694231830167},{x:.05525369594322076,y:.472500935801646},{x:.05610601347919053,y:.46895411111540136},{x:.056837016503334954,y:.46538031130067065},{x:.05713517469108906,y:.46467137112890816},{x:.05731487395982006,y:.46392357259662753},{x:.08169987395982006,y:.39365157259662753},{x:.08192222202041206,y:.3931695328553223},{x:.08205835369770847,y:.3926564352635495},{x:.08376780756696771,y:.3891683934837906},{x:.08539480756850773,y:.3856411369034641},{x:.08570692456181836,y:.38521173737536313},{x:.08594054088151196,y:.3847350567827023},{x:.08829763126802886,y:.38164753465350854},{x:.09058150254284453,y:.37850546527353984},{x:.0909713939878581,y:.378145207541698},{x:.09129351720579659,y:.37772326251599964},{x:.09420766244788897,y:.3751549117812935},{x:.09706063710369874,y:.372518777565862},{x:.09751331969083687,y:.37224150613287915},{x:.09791157079240381,y:.3718905117848512},{x:.17107757079240382,y:.3191875117848513},{x:.17123114354048857,y:.3190983419119289},{x:.17136528774468962,y:.3189819753030134},{x:.17504412834709762,y:.3168843854977816},{x:.17870637355344754,y:.314757953928811},{x:.1788743916234626,y:.3147004579868701},{x:.17902866028359976,y:.31461249756570947},{x:.183046032465951,y:.31327291855818423},{x:.1870527548771027,y:.3119018143721617},{x:.18722876142884332,y:.31187820189800686},{x:.18739722608682208,y:.3118220279342577},{x:.262121,y:.2948235482063542},{x:.262121,y:.04244038202745839},{x:.212402420161311,y:.04795051974434915},{x:.14928483997433578,y:.08692151049617265},{x:.11795277553134796,y:.17720643745102208},{x:.114257651607068,y:.18521678535552225},{x:.10907078710071823,y:.1923523337548876},{x:.10259151030645056,y:.1983388675257922},{x:.09506881619784838,y:.20294632753270694},{x:.08679179769072982,y:.20599765167145945},{x:.07807853596451803,y:.20737557926659977},{x:.06926387678089782,y:.20702715733339738},{x:.0606865625489779,y:.20496577553134793},{x:.052676214644477706,y:.20127065160706795},{x:.04554066624511235,y:.1960837871007182},{x:.039554132474207776,y:.18960451030645054},{x:.034946672467293015,y:.18208181619784836},{x:.03189534832854049,y:.1738047976907298},{x:.030517420733400163,y:.165091535964518}],[{x:.14709211773983194,y:.4797371545422716},{x:.17592903295677773,y:.5766856037244347},{x:.24922570721126042,y:.6426843927572041},{x:.262121,y:.6413573671491031},{x:.262121,y:.3871228845247169},{x:.21626819752335621,y:.3975536737173561},{x:.16206100150816494,y:.4366002507010456},{x:.14709211773983194,y:.4797371545422716}],[{x:.35212099999999996,y:.034163101195078524},{x:.35212099999999996,y:.2743499680404371},{x:.4101709471377665,y:.26114452085874473},{x:.4630938273127818,y:.2230200535785049},{x:.47920731446793274,y:.1649859973145621},{x:.44287681685863156,y:.07338773859643172},{x:.35212099999999996,y:.034163101195078524}]],"\'":[[{x:.25602600000000003,y:.476978},{x:.25689066238185465,y:.4681989355092742},{x:.2594514210369921,y:.459757245543571},{x:.2636098674463855,y:.4519773395141179},{x:.26920619484660535,y:.44515819484660535},{x:.27602533951411795,y:.4395618674463855},{x:.283805245543571,y:.4354034210369921},{x:.2922469355092743,y:.43284266238185465},{x:.301026,y:.43197800000000003},{x:.3098050644907258,y:.43284266238185465},{x:.3182467544564291,y:.4354034210369921},{x:.32602666048588214,y:.4395618674463855},{x:.3328458051533947,y:.44515819484660535},{x:.33844213255361455,y:.4519773395141179},{x:.34260057896300794,y:.459757245543571},{x:.3451613376181454,y:.4681989355092742},{x:.346026,y:.476978},{x:.346026,y:.729004},{x:.3451613376181454,y:.7377830644907257},{x:.34260057896300794,y:.746224754456429},{x:.33844213255361455,y:.7540046604858821},{x:.3328458051533947,y:.7608238051533946},{x:.32602666048588214,y:.7664201325536145},{x:.3182467544564291,y:.7705785789630079},{x:.3098050644907258,y:.7731393376181454},{x:.301026,y:.774004},{x:.2922469355092743,y:.7731393376181454},{x:.283805245543571,y:.7705785789630079},{x:.27602533951411795,y:.7664201325536145},{x:.26920619484660535,y:.7608238051533946},{x:.2636098674463855,y:.7540046604858821},{x:.2594514210369921,y:.746224754456429},{x:.25689066238185465,y:.7377830644907257},{x:.25602600000000003,y:.729004},{x:.25602600000000003,y:.476978}]],"(":[[{x:.14398102142772873,y:.343473372436119},{x:.14438344127795402,y:.34024506484177663},{x:.14461855620935057,y:.33700027938992067},{x:.15480555620935058,y:.27783527938992064},{x:.15553530200183258,y:.27518493680242373},{x:.1560666158259812,y:.2724877993619115},{x:.1764416158259812,y:.20487079936191147},{x:.17757136816824137,y:.2021290142392397},{x:.17852197521392682,y:.19932008699588913},{x:.2090839752139268,y:.13170208699588917},{x:.21040800505224358,y:.12940389577393302},{x:.21154775445201235,y:.12700896170152925},{x:.25229575445201236,y:.05939296170152925},{x:.2531150427152032,y:.05829379345186112},{x:.2537782786760274,y:.05709399256856861},{x:.29452927867602746,y:-.0020700074314313824},{x:.29560111146026063,y:-.0033391000809501682},{x:.29650963843516415,y:-.004729783512322571},{x:.3372576384351641,y:-.05544378351232261},{x:.3386866074193021,y:-.05690267270426387},{x:.3399537097957662,y:-.05850416001284604},{x:.38070370979576623,y:-.10073716001284601},{x:.38742176905533504,y:-.10645444032360908},{x:.3951261287468799,y:-.11075123635207199},{x:.40352071464810957,y:-.11346242463653189},{x:.41228292753057777,y:-.11448381573166892},{x:.42107604046711683,y:-.11377615815049966},{x:.4295621390588101,y:-.11136664677700951},{x:.4374151072958377,y:-.10734787778201216},{x:.444333160012846,y:-.10187429020423372},{x:.4500504403236091,y:-.09515623094466494},{x:.45434723635207197,y:-.08745187125312004},{x:.4570584246365319,y:-.07905728535189037},{x:.45807981573166895,y:-.07029507246942218},{x:.4573721581504997,y:-.06150195953288313},{x:.45496264677700954,y:-.053015860941189874},{x:.45094387778201217,y:-.04516289270416226},{x:.44547029020423373,y:-.03824483998715393},{x:.4061377413616867,y:.0025191240684850026},{x:.3677075745656829,y:.050348403515145926},{x:.3286739379437331,y:.10701906379590062},{x:.2900025757951927,y:.1711891536907596},{x:.2617573982317254,y:.23368121626802973},{x:.24303344075060918,y:.2958190240226623},{x:.23462816944303005,y:.34463593546989096},{x:.24303340667749923,y:.39345182392970596},{x:.26175739639474455,y:.45558881969516635},{x:.2900026404789191,y:.5180819536434618},{x:.328674029726828,y:.5822520885061939},{x:.36770768599197223,y:.6389237351633864},{x:.4061420841180472,y:.6867582808236831},{x:.4454798975405431,y:.7275528000242046},{x:.45095135740921277,y:.7344725356602282},{x:.45496771125722263,y:.7423267393839987},{x:.45737461285859093,y:.7508135785511003},{x:.458079566334583,y:.759606908691815},{x:.4570554807184589,y:.768368807060192},{x:.4543417110461325,y:.7767625588156633},{x:.4500425459642118,y:.7844655967855365},{x:.4443231999757953,y:.791181897540543},{x:.4374034643397718,y:.7966533574092127},{x:.4295492606160011,y:.8006697112572226},{x:.42106242144889966,y:.8030766128585909},{x:.41226909130818484,y:.803781566334583},{x:.403507192939808,y:.8027574807184589},{x:.39511344118433667,y:.8000437110461325},{x:.3874104032144634,y:.7957445459642117},{x:.38069410245945684,y:.7900251999757952},{x:.33994410245945683,y:.7477661999757953},{x:.338681775527778,y:.7461697396410558},{x:.3372576384351641,y:.7447157835123226},{x:.29650963843516415,y:.6940017835123226},{x:.2956010143988682,y:.6926109515089496},{x:.29452907712829884,y:.6913417148135671},{x:.2537780771282988,y:.6321767148135672},{x:.25311493656839296,y:.6309770641401381},{x:.25229575445201236,y:.6298780382984708},{x:.21154775445201235,y:.5622620382984707},{x:.21040795156345282,y:.5598669918310725},{x:.2090838723444427,y:.5575686854051248},{x:.17852187234444272,y:.48994968540512485},{x:.17757135012625538,y:.48714095747585867},{x:.17644166886939822,y:.4843993766680373},{x:.1560666688693982,y:.4167833766680374},{x:.15553533856931018,y:.4140862136984408},{x:.15480557779123924,y:.4114358459543075},{x:.14461857779123924,y:.3522718459543075},{x:.14438345368873493,y:.3490270611669966},{x:.14398102471397584,y:.3457987547100726},{x:.14406527252602844,y:.3446360634540339},{x:.14398102142772873,y:.343473372436119}]],")":[[{x:.14397318426833106,y:-.07029507246942218},{x:.14499457536346808,y:-.07905728535189037},{x:.14770576364792798,y:-.08745187125312004},{x:.1520025596763909,y:-.09515623094466495},{x:.15771983998715397,y:-.10187429020423372},{x:.16463789270416226,y:-.10734787778201214},{x:.1724908609411899,y:-.11136664677700951},{x:.18097695953288315,y:-.11377615815049966},{x:.1897700724694222,y:-.11448381573166892},{x:.19853228535189038,y:-.11346242463653189},{x:.20692687125312006,y:-.11075123635207199},{x:.21463123094466496,y:-.10645444032360907},{x:.22134929020423375,y:-.10073716001284601},{x:.2620992902042337,y:-.05850416001284604},{x:.2633660586938147,y:-.05690309470300352},{x:.26479468609075496,y:-.05544462417080616},{x:.30554468609075497,y:-.004730624170806122},{x:.3064541047100432,y:-.003338648753719708},{x:.307526891803669,y:-.002068307996824087},{x:.348273891803669,y:.05709569200317591},{x:.3489362195699084,y:.058293979727073175},{x:.3497544895549002,y:.059391707275619196},{x:.39050548955490016,y:.12700770727561922},{x:.39164563057902163,y:.12940326331913213},{x:.3929700247860732,y:.13170208699588917},{x:.42353202478607316,y:.19932008699588913},{x:.4244827292530259,y:.20212930210713742},{x:.4256125601984483,y:.2048713835354543},{x:.4459865601984483,y:.27248838353545435},{x:.4465177787005257,y:.27518522990297933},{x:.4472474437906494,y:.27783527938992064},{x:.4574344437906494,y:.33700027938992067},{x:.45766955872204595,y:.3402450648417768},{x:.4580719785722712,y:.34347337243611903},{x:.45798772747397154,y:.3446360634540339},{x:.4580719752860241,y:.3457987547100726},{x:.45766954631126505,y:.34902706116699656},{x:.45743442220876074,y:.3522718459543075},{x:.44724742220876074,y:.4114358459543075},{x:.4465177421348676,y:.414085920594514},{x:.44598650715958776,y:.4167827924880124},{x:.42561250715958776,y:.4843987924880123},{x:.42448274729464536,y:.48714066960378194},{x:.42353212765555726,y:.48994968540512485},{x:.3929701276555573,y:.5575686854051248},{x:.39164568407140216,y:.5598676242877579},{x:.39050548955490016,y:.5622632927243807},{x:.3497544895549002,y:.6298792927243808},{x:.3489363257182038,y:.6309768778726063},{x:.34827409333092635,y:.6321750153799588},{x:.3075270933309263,y:.6913400153799587},{x:.3064542017711834,y:.692610500189881},{x:.30554468609075497,y:.6940026241708062},{x:.26479468609075496,y:.7447166241708062},{x:.26337089070969094,y:.7461701617493295},{x:.2621088975405431,y:.7477661999757953},{x:.2213588975405431,y:.7900251999757952},{x:.21464259678553657,y:.7957445459642117},{x:.20693955881566328,y:.8000437110461325},{x:.19854580706019195,y:.8027574807184589},{x:.1897839086918151,y:.803781566334583},{x:.1809905785511003,y:.8030766128585909},{x:.17250373938399882,y:.8006697112572226},{x:.16464953566022822,y:.7966533574092127},{x:.15772980002420467,y:.791181897540543},{x:.15201045403578817,y:.7844655967855365},{x:.14771128895386743,y:.7767625588156633},{x:.14499751928154103,y:.7683688070601918},{x:.14397343366541698,y:.759606908691815},{x:.14467838714140904,y:.7508135785511002},{x:.14708528874277732,y:.7423267393839987},{x:.1511016425907872,y:.7344725356602282},{x:.15657310245945688,y:.7275528000242046},{x:.19591129092993145,y:.6867578918874246},{x:.23434697314436972,y:.6389240958672278},{x:.27337685298529213,y:.5822523693404118},{x:.3120516621801016,y:.518081284004684},{x:.34029647741491703,y:.4555890988936643},{x:.35901954136421654,y:.39345212569273014},{x:.36742483055696995,y:.344635935469891},{x:.359019507292604,y:.29581872226323463},{x:.3402964755778617,y:.23368093707349602},{x:.3120517268674457,y:.17118982332763816},{x:.27337694476991303,y:.10701878295300266},{x:.23434708457036935,y:.05034804280413771},{x:.1959156338111051,y:.0025195128948044543},{x:.15658270979576625,y:-.03824483998715393},{x:.1511091222179878,y:-.045162892704162266},{x:.14709035322299047,y:-.053015860941189874},{x:.1446808418495003,y:-.06150195953288312},{x:.14397318426833106,y:-.07029507246942218}]],"*":[[{x:.03611444520266741,y:.4654782574484574},{x:.03652686631141767,y:.45666636076295464},{x:.038650478626155074,y:.4481042415682919},{x:.04240367291655979,y:.4401209373034283},{x:.04764221603086716,y:.4330232418741738},{x:.05416479369500318,y:.42708391573544136},{x:.06172074690723879,y:.42253120385992987},{x:.07001970462305517,y:.4195400644118251},{x:.0787427425515426,y:.41822544520266736},{x:.08755463923704532,y:.41863786631141764},{x:.09611675843170807,y:.42076147862615504},{x:.25602600000000003,y:.47756000598755177},{x:.25602600000000003,y:.31805799999999995},{x:.25689066238185465,y:.30927893550927416},{x:.2594514210369921,y:.30083724554357094},{x:.2636098674463855,y:.29305733951411783},{x:.26920619484660535,y:.2862381948466053},{x:.27602533951411795,y:.2806418674463854},{x:.283805245543571,y:.276483421036992},{x:.2922469355092743,y:.2739226623818546},{x:.301026,y:.27305799999999997},{x:.3098050644907258,y:.2739226623818546},{x:.3182467544564291,y:.276483421036992},{x:.32602666048588214,y:.2806418674463854},{x:.3328458051533947,y:.2862381948466053},{x:.33844213255361455,y:.29305733951411783},{x:.34260057896300794,y:.30083724554357094},{x:.3451613376181454,y:.30927893550927416},{x:.346026,y:.31805799999999995},{x:.346026,y:.47756000598755177},{x:.505935241568292,y:.42076147862615504},{x:.5144973607629547,y:.41863786631141764},{x:.5233092574484575,y:.41822544520266736},{x:.5320322953769449,y:.4195400644118251},{x:.5403312530927612,y:.42253120385992987},{x:.5478872063049969,y:.42708391573544136},{x:.5544097839691329,y:.4330232418741738},{x:.5596483270834403,y:.4401209373034283},{x:.5634015213738449,y:.4481042415682919},{x:.5655251336885824,y:.45666636076295464},{x:.5659375547973327,y:.4654782574484574},{x:.5646229355881749,y:.4742012953769448},{x:.5616317961400701,y:.4825002530927612},{x:.5570790842645587,y:.4900562063049968},{x:.5511397581258262,y:.4965787839691328},{x:.5440420626965717,y:.5018173270834402},{x:.5360587584317081,y:.5055705213738448},{x:.37146215609131306,y:.5640339630732496},{x:.47696549129035026,y:.7165911114148321},{x:.48124783600971727,y:.7243035129909579},{x:.48394328176908086,y:.732703166943666},{x:.4849482440995321,y:.7414672792821342},{x:.48422410286230105,y:.7502590500841659},{x:.48179868639903156,y:.758740616528321},{x:.47776520210421775,y:.7665860367726678},{x:.4722786545173053,y:.7734938157169785},{x:.4655498885851679,y:.7791984912903502},{x:.45783748700904214,y:.7834808360097172},{x:.449437833056334,y:.7861762817690807},{x:.4406737207178658,y:.7871812440995319},{x:.431881949915834,y:.786457102862301},{x:.4234003834716789,y:.7840316863990314},{x:.4155549632273321,y:.7799982021042177},{x:.40864718428302144,y:.7745116545173052},{x:.40294250870964976,y:.7677828885851677},{x:.301026,y:.6204122684209616},{x:.19910949129035027,y:.7677828885851677},{x:.19340481571697854,y:.7745116545173052},{x:.18649703677266788,y:.7799982021042177},{x:.17865161652832107,y:.7840316863990314},{x:.17017005008416597,y:.786457102862301},{x:.1613782792821342,y:.7871812440995319},{x:.15261416694366597,y:.7861762817690807},{x:.14421451299095783,y:.7834808360097172},{x:.13650211141483212,y:.7791984912903502},{x:.12977334548269473,y:.7734938157169785},{x:.12428679789578226,y:.7665860367726678},{x:.12025331360096844,y:.758740616528321},{x:.11782789713769894,y:.7502590500841659},{x:.11710375590046794,y:.7414672792821342},{x:.11810871823091917,y:.732703166943666},{x:.12080416399028275,y:.7243035129909579},{x:.1250865087096497,y:.7165911114148321},{x:.23058984390868703,y:.5640339630732496},{x:.06599324156829194,y:.5055705213738448},{x:.058009937303428294,y:.5018173270834402},{x:.05091224187417384,y:.4965787839691328},{x:.04497291573544139,y:.4900562063049968},{x:.04042020385992993,y:.4825002530927612},{x:.03742906441182516,y:.4742012953769448},{x:.03611444520266741,y:.4654782574484574}]],"+":[[{x:-.002030999999999998,y:.33155},{x:-.0011663376181453647,y:.3227709355092742},{x:.0013944210369920967,y:.314329245543571},{x:.005552867446385459,y:.3065493395141179},{x:.011149194846605363,y:.29973019484660535},{x:.017968339514117915,y:.2941338674463855},{x:.025748245543570962,y:.2899754210369921},{x:.03418993550927423,y:.28741466238185465},{x:.042969,y:.28655},{x:.256023,y:.28655},{x:.256023,y:.09133899999999995},{x:.2568876623818546,y:.08255993550927418},{x:.25944842103699206,y:.07411824554357091},{x:.26360686744638545,y:.06633833951411786},{x:.2692031948466054,y:.05951919484660531},{x:.2760223395141179,y:.053922867446385414},{x:.2838022455435709,y:.049764421036992045},{x:.2922439355092742,y:.04720366238185458},{x:.301023,y:.04633899999999995},{x:.3098020644907258,y:.04720366238185458},{x:.31824375445642905,y:.049764421036992045},{x:.3260236604858821,y:.053922867446385414},{x:.3328428051533946,y:.05951919484660531},{x:.3384391325536145,y:.06633833951411786},{x:.3425975789630079,y:.07411824554357091},{x:.34515833761814535,y:.08255993550927418},{x:.34602299999999997,y:.09133899999999995},{x:.34602299999999997,y:.28655},{x:.559083,y:.28655},{x:.5678620644907257,y:.28741466238185465},{x:.576303754456429,y:.2899754210369921},{x:.5840836604858821,y:.2941338674463855},{x:.5909028051533947,y:.29973019484660535},{x:.5964991325536145,y:.3065493395141179},{x:.6006575789630079,y:.314329245543571},{x:.6032183376181454,y:.3227709355092742},{x:.604083,y:.33155},{x:.6032183376181454,y:.3403290644907258},{x:.6006575789630079,y:.348770754456429},{x:.5964991325536145,y:.35655066048588213},{x:.5909028051533947,y:.3633698051533947},{x:.5840836604858821,y:.36896613255361455},{x:.576303754456429,y:.37312457896300794},{x:.5678620644907257,y:.3756853376181454},{x:.559083,y:.37655},{x:.34602299999999997,y:.37655},{x:.34602299999999997,y:.571777},{x:.34515833761814535,y:.5805560644907257},{x:.3425975789630079,y:.588997754456429},{x:.3384391325536145,y:.5967776604858821},{x:.3328428051533946,y:.6035968051533946},{x:.3260236604858821,y:.6091931325536145},{x:.31824375445642905,y:.6133515789630078},{x:.3098020644907258,y:.6159123376181453},{x:.301023,y:.616777},{x:.2922439355092742,y:.6159123376181453},{x:.2838022455435709,y:.6133515789630078},{x:.2760223395141179,y:.6091931325536145},{x:.2692031948466054,y:.6035968051533946},{x:.26360686744638545,y:.5967776604858821},{x:.25944842103699206,y:.588997754456429},{x:.2568876623818546,y:.5805560644907257},{x:.256023,y:.571777},{x:.256023,y:.37655},{x:.042969,y:.37655},{x:.03418993550927421,y:.3756853376181454},{x:.025748245543570934,y:.37312457896300794},{x:.017968339514117904,y:.36896613255361455},{x:.011149194846605356,y:.3633698051533947},{x:.005552867446385459,y:.35655066048588213},{x:.0013944210369920967,y:.348770754456429},{x:-.0011663376181453647,y:.3403290644907258},{x:-.002030999999999998,y:.33155}]],",":[[{x:.1703425796668749,y:-.03158948169003215},{x:.1707557440557006,y:-.035050650253961146},{x:.17102563140319493,y:-.03852592771911176},{x:.17127771326913271,y:-.039423300660751795},{x:.17138819577001116,y:-.0403488367651378},{x:.1724686618106471,y:-.0436628955719719},{x:.1734113563482083,y:-.04701874414557815},{x:.1738336633079298,y:-.04784969558537063},{x:.17412258605517572,y:-.048735893706360625},{x:.1758288320436127,y:-.05177548533469908},{x:.17740810654883146,y:-.054882941638058576},{x:.177984409582707,y:-.05561553857817519},{x:.17844066943717352,y:-.05642834261896521},{x:.18070712529694977,y:-.05907665726715373},{x:.18286228913625774,y:-.06181630349720979},{x:.26855428913625773,y:-.1511263034972098},{x:.27525630293239317,y:-.15686238451505874},{x:.2829485933055849,y:-.16118075031492074},{x:.2913355498506774,y:-.16391544852087458},{x:.3000948665311021,y:-.16496138621450188},{x:.3088899277191117,y:-.1642783685968051},{x:.3173827441455781,y:-.16189264365179173},{x:.3252469416380585,y:-.15789589345116858},{x:.33218030349720973,y:-.1524417108637423},{x:.3379163845150587,y:-.14573969706760687},{x:.3422347503149207,y:-.13804740669441512},{x:.3449694485208745,y:-.12966045014932262},{x:.3460153862145018,y:-.12090113346889794},{x:.34533236859680505,y:-.11210607228088836},{x:.34294664365179167,y:-.10361325585442197},{x:.33894989345116855,y:-.09574905836194152},{x:.33349571086374225,y:-.08881569650279031},{x:.277697993368333,y:-.03066214483501502},{x:.41918956700521515,y:.11679250439324337},{x:.42464400414059766,y:.12372566600271688},{x:.42864104306488354,y:.1315897167531037},{x:.43102707981377775,y:.14008244558427704},{x:.4317104203331251,y:.14887748169003212},{x:.4306648042299889,y:.15763683676513773},{x:.4279304139448243,y:.1660238937063606},{x:.4236123305628265,y:.17371634261896518},{x:.41787649560675666,y:.1804185670052151},{x:.41094333399728317,y:.18587300414059763},{x:.4030792832468963,y:.18987004306488353},{x:.39458655441572293,y:.19225607981377774},{x:.3857915183099679,y:.19293942033312508},{x:.37703216323486227,y:.19189380422998883},{x:.36864510629363945,y:.18915941394482427},{x:.3609526573810348,y:.18484133056282648},{x:.35425043299478487,y:.17910549560675662},{x:.18286343299478489,y:.000495495606756581},{x:.18070816857348473,y:-.0022440714967103576},{x:.1784416154849413,y:-.004892302932393237},{x:.17798532578947307,y:-.005705090221499034},{x:.17740899585940237,y:-.006437666002716908},{x:.1758296072680145,y:-.009545064322455634},{x:.1741232496850793,y:-.012584593305585},{x:.17383429440212667,y:-.013470780818460306},{x:.1734119569351165,y:-.014301716753103766},{x:.1724691391914766,y:-.01765753071433596},{x:.17138855147912546,y:-.02097154985067746},{x:.17127803499816427,y:-.02189708189818214},{x:.17102592018622226,y:-.022794445584277102},{x:.17075590524748027,y:-.02626971313843455},{x:.17034261378549817,y:-.029730866531102167},{x:.17041478319291342,y:-.03066017543569507},{x:.1703425796668749,y:-.03158948169003215}]],"-":[[{x:.12882900000000003,y:.31396500000000005},{x:.12969366238185465,y:.30518593550927425},{x:.13225442103699211,y:.29674424554357104},{x:.13641286744638548,y:.28896433951411793},{x:.14200919484660537,y:.2821451948466054},{x:.14882833951411792,y:.2765488674463855},{x:.15660824554357097,y:.2723904210369921},{x:.16504993550927424,y:.2698296623818547},{x:.173829,y:.26896500000000007},{x:.428224,y:.26896500000000007},{x:.4370030644907258,y:.2698296623818547},{x:.44544475445642906,y:.2723904210369921},{x:.4532246604858821,y:.2765488674463855},{x:.4600438051533946,y:.2821451948466054},{x:.4656401325536145,y:.28896433951411793},{x:.4697985789630079,y:.29674424554357104},{x:.47235933761814536,y:.30518593550927425},{x:.473224,y:.31396500000000005},{x:.47235933761814536,y:.32274406449072585},{x:.4697985789630079,y:.33118575445642906},{x:.4656401325536145,y:.33896566048588217},{x:.4600438051533946,y:.3457848051533947},{x:.4532246604858821,y:.3513811325536146},{x:.44544475445642906,y:.355539578963008},{x:.4370030644907258,y:.3581003376181454},{x:.428224,y:.35896500000000003},{x:.173829,y:.35896500000000003},{x:.16504993550927424,y:.3581003376181454},{x:.15660824554357097,y:.355539578963008},{x:.14882833951411792,y:.3513811325536146},{x:.14200919484660537,y:.3457848051533947},{x:.13641286744638548,y:.33896566048588217},{x:.13225442103699211,y:.33118575445642906},{x:.12969366238185465,y:.32274406449072585},{x:.12882900000000003,y:.31396500000000005}]],".":[[{x:.19450299999999998,y:.148926},{x:.19536766238185463,y:.14014693550927423},{x:.1979284210369921,y:.13170524554357096},{x:.20208686744638546,y:.12392533951411791},{x:.20768319484660536,y:.11710619484660537},{x:.2145023395141179,y:.11150986744638547},{x:.22228224554357093,y:.1073514210369921},{x:.2307239355092742,y:.10479066238185464},{x:.239503,y:.103926},{x:.362549,y:.103926},{x:.3713280644907258,y:.10479066238185464},{x:.3797697544564291,y:.1073514210369921},{x:.38754966048588213,y:.11150986744638547},{x:.3943688051533947,y:.11710619484660537},{x:.39996513255361454,y:.12392533951411791},{x:.40412357896300793,y:.13170524554357096},{x:.4066843376181454,y:.14014693550927423},{x:.407549,y:.148926},{x:.4066843376181454,y:.1577050644907258},{x:.40412357896300793,y:.16614675445642904},{x:.39996513255361454,y:.1739266604858821},{x:.3943688051533947,y:.18074580515339464},{x:.38754966048588213,y:.18634213255361454},{x:.3797697544564291,y:.1905005789630079},{x:.3713280644907258,y:.19306133761814537},{x:.362549,y:.193926},{x:.239503,y:.193926},{x:.2307239355092742,y:.19306133761814537},{x:.22228224554357093,y:.1905005789630079},{x:.2145023395141179,y:.18634213255361454},{x:.20768319484660536,y:.18074580515339464},{x:.20208686744638546,y:.1739266604858821},{x:.1979284210369921,y:.16614675445642904},{x:.19536766238185463,y:.1577050644907258},{x:.19450299999999998,y:.148926}]],"/":[[{x:.017522651058219416,y:-.036644753012328966},{x:.01865919532569161,y:-.04539277458837648},{x:.02148055556003016,y:-.053750976595687026},{x:.02587830846966649,y:-.06139815801845333},{x:.031683450876571484,y:-.06804044196318723},{x:.038672894413609195,y:-.07342256918292836},{x:.04657803868537635,y:-.0773377075469538},{x:.0550950934307649,y:-.07963540048356893},{x:.0638967530123289,y:-.08022734894178067},{x:.07264477458837641,y:-.07909080467430848},{x:.08100297659568695,y:-.07626944443996993},{x:.08865015801845323,y:-.0718716915303336},{x:.09529244196318715,y:-.0660665491234286},{x:.10067456918292828,y:-.059077105586390885},{x:.5777245691829282,y:.7051758944136092},{x:.5816397075469537,y:.7130810386853763},{x:.5839374004835688,y:.7215980934307649},{x:.5845293489417805,y:.7303997530123288},{x:.5833928046743084,y:.7391477745883763},{x:.5805714444399699,y:.747505976595687},{x:.5761736915303335,y:.7551531580184532},{x:.5703685491234285,y:.7617954419631872},{x:.5633791055863908,y:.7671775691829282},{x:.5554739613146237,y:.7710927075469537},{x:.5469569065692351,y:.7733904004835688},{x:.5381552469876711,y:.7739823489417805},{x:.5294072254116237,y:.7728458046743084},{x:.521049023404313,y:.7700244444399699},{x:.5134018419815468,y:.7656266915303335},{x:.5067595580368128,y:.7598215491234285},{x:.5013774308170718,y:.7528321055863908},{x:.024327430817071727,y:-.011420894413609283},{x:.020412292453046287,y:-.019326038685376436},{x:.018114599516431164,y:-.027843093430764996},{x:.017522651058219416,y:-.036644753012328966}]],"<":[[{x:-.002019645490236678,y:.32959917016575135},{x:-.0016099914284145765,y:.3262199732716625},{x:-.0013526191024594778,y:.3228257800560043},{x:-.001080072865731869,y:.3218487260950263},{x:-.0009579981642362373,y:.3208417436418168},{x:.00010303311987996846,y:.3176073966113462},{x:.0010176343561875828,y:.3143286327165328},{x:.0014755574652736251,y:.31342352370653337},{x:.001791739066671412,y:.3124597057316259},{x:.003463372735866293,y:.309494502707312},{x:.00500005526992945,y:.3064571691910689},{x:.005625757523098081,y:.30565878796371126},{x:.0061238953427729045,y:.3047751734513664},{x:.008341891452602095,y:.3021930655225286},{x:.010441601436418424,y:.2995138854085287},{x:.011211037446978121,y:.298852913306643},{x:.011871988327878901,y:.29808345906703315},{x:.014551110531708777,y:.29598367519331337},{x:.017133157288130564,y:.2937656078708368},{x:.01801675806170013,y:.2932674456816211},{x:.018815122032139454,y:.29264172140965955},{x:.021852413166145952,y:.29110495510775264},{x:.024817570086352318,y:.28943323966009543},{x:.5409315700863523,y:.06192123966009548},{x:.5493135321567164,y:.059171271257023414},{x:.5580709293975171,y:.05810938240515066},{x:.5668672199439956,y:.058776380897540545},{x:.5753643672834672,y:.061146634356187606},{x:.583235830808931,y:.06512905526992949},{x:.5901791145914712,y:.07057060143641844},{x:.5959273921291632,y:.07726215728813057},{x:.6002597603399046,y:.08494657008635234},{x:.6030097287429766,y:.09332853215671641},{x:.6040716175948494,y:.10208592939751719},{x:.6034046191024595,y:.11088221994399564},{x:.6010343656438124,y:.11937936728346718},{x:.5970519447300705,y:.12725083080893104},{x:.5916103985635816,y:.13419411459147126},{x:.5849188427118694,y:.1399423921291632},{x:.5772344299136477,y:.14427476033990455},{x:.15453394878652635,y:.33060846154195217},{x:.577233294268374,y:.5169277390666714},{x:.5849178265486336,y:.521259895342773},{x:.5916095409329668,y:.527007988327879},{x:.5970512785903404,y:.5339511220321395},{x:.6010339165943431,y:.5418224757210541},{x:.6034044043999703,y:.5503195576866639},{x:.6040716454902366,y:.5591158298342486},{x:.6030099981642363,y:.5678732563581832},{x:.6002602609333286,y:.5762552942683741},{x:.5959281046572271,y:.5839398265486336},{x:.5901800116721211,y:.5906315409329669},{x:.5832368779678606,y:.5960732785903404},{x:.5753655242789459,y:.6000559165943432},{x:.5668684423133362,y:.6024264043999704},{x:.5580721701657515,y:.6030936454902367},{x:.5493147436418169,y:.6020319981642364},{x:.540932705731626,y:.5992822609333287},{x:.024818705731625975,y:.37178726093332853},{x:.02185350270731245,y:.3701156272641339},{x:.018816169191068974,y:.3685789447300705},{x:.01801778796371134,y:.36795324247690187},{x:.01713417345136639,y:.367455104657227},{x:.01455206552252819,y:.3652371085473975},{x:.011872885408528756,y:.3631373985635815},{x:.011211913306643135,y:.3623679625530219},{x:.010442459067033207,y:.36170701167212105},{x:.008342675193313383,y:.3590278894682912},{x:.006124607870836803,y:.3564458427118694},{x:.005626445681621026,y:.3555622419382997},{x:.005000721409659611,y:.3547638779678605},{x:.0034639551077528313,y:.3517265868338544},{x:.0017922396600954515,y:.3487614299136476},{x:.0014760314771086122,y:.3477976206592673},{x:.0010180834056568513,y:.3468925242789459},{x:.00010339174271701993,y:.34361378560971106},{x:-.0009577287429766018,y:.3403794678432836},{x:-.0010798312165939596,y:.33937248875722786},{x:-.0013524043999703778,y:.33839544231333624},{x:-.001609870336301571,y:.33500125619719334},{x:-.0020196175948493655,y:.3316220706024828},{x:-.001942922029511974,y:.3306106193263084},{x:-.002019645490236678,y:.32959917016575135}]],"=":[[{x:-.002030999999999998,y:.19162999999999997},{x:-.0011663376181453647,y:.1828509355092742},{x:.0013944210369920967,y:.17440924554357093},{x:.005552867446385459,y:.16662933951411787},{x:.011149194846605363,y:.15981019484660533},{x:.017968339514117915,y:.15421386744638543},{x:.025748245543570962,y:.15005542103699207},{x:.03418993550927423,y:.1474946623818546},{x:.042969,y:.14662999999999998},{x:.559083,y:.14662999999999998},{x:.5678620644907257,y:.1474946623818546},{x:.576303754456429,y:.15005542103699207},{x:.5840836604858821,y:.15421386744638543},{x:.5909028051533947,y:.15981019484660533},{x:.5964991325536145,y:.16662933951411787},{x:.6006575789630079,y:.17440924554357093},{x:.6032183376181454,y:.1828509355092742},{x:.604083,y:.19162999999999997},{x:.6032183376181454,y:.20040906449072574},{x:.6006575789630079,y:.208850754456429},{x:.5964991325536145,y:.21663066048588206},{x:.5909028051533947,y:.2234498051533946},{x:.5840836604858821,y:.2290461325536145},{x:.576303754456429,y:.23320457896300786},{x:.5678620644907257,y:.23576533761814533},{x:.559083,y:.23662999999999995},{x:.042969,y:.23662999999999995},{x:.03418993550927421,y:.23576533761814533},{x:.025748245543570934,y:.23320457896300786},{x:.017968339514117904,y:.2290461325536145},{x:.011149194846605356,y:.2234498051533946},{x:.005552867446385459,y:.21663066048588206},{x:.0013944210369920967,y:.208850754456429},{x:-.0011663376181453647,y:.20040906449072574},{x:-.002030999999999998,y:.19162999999999997}],[{x:-.002030999999999998,y:.454102},{x:-.0011663376181453647,y:.4453229355092742},{x:.0013944210369920967,y:.436881245543571},{x:.005552867446385459,y:.4291013395141179},{x:.011149194846605363,y:.42228219484660534},{x:.017968339514117915,y:.41668586744638547},{x:.025748245543570962,y:.4125274210369921},{x:.03418993550927423,y:.40996666238185464},{x:.042969,y:.409102},{x:.559083,y:.409102},{x:.5678620644907257,y:.40996666238185464},{x:.576303754456429,y:.4125274210369921},{x:.5840836604858821,y:.41668586744638547},{x:.5909028051533947,y:.42228219484660534},{x:.5964991325536145,y:.4291013395141179},{x:.6006575789630079,y:.436881245543571},{x:.6032183376181454,y:.4453229355092742},{x:.604083,y:.454102},{x:.6032183376181454,y:.4628810644907258},{x:.6006575789630079,y:.471322754456429},{x:.5964991325536145,y:.4791026604858821},{x:.5909028051533947,y:.48592180515339467},{x:.5840836604858821,y:.49151813255361454},{x:.576303754456429,y:.49567657896300793},{x:.5678620644907257,y:.49823733761814537},{x:.559083,y:.499102},{x:.042969,y:.499102},{x:.03418993550927421,y:.49823733761814537},{x:.025748245543570934,y:.49567657896300793},{x:.017968339514117904,y:.49151813255361454},{x:.011149194846605356,y:.48592180515339467},{x:.005552867446385459,y:.4791026604858821},{x:.0013944210369920967,y:.471322754456429},{x:-.0011663376181453647,y:.4628810644907258},{x:-.002030999999999998,y:.454102}]],">":[[{x:-.002019645490236678,y:.5591158298342487},{x:-.0013524043999703708,y:.5503195576866637},{x:.0010180834056568513,y:.5418224757210541},{x:.005000721409659611,y:.5339511220321396},{x:.01044245906703322,y:.527007988327879},{x:.01713417345136643,y:.521259895342773},{x:.024818705731625975,y:.5169277390666714},{x:.44751805121347366,y:.33060846154195217},{x:.024817570086352318,y:.14427476033990455},{x:.017133157288130554,y:.1399423921291632},{x:.01044160143641841,y:.13419411459147126},{x:.00500005526992945,y:.12725083080893107},{x:.0010176343561875828,y:.11937936728346718},{x:-.0013526191024594778,y:.11088221994399562},{x:-.0020196175948493655,y:.10208592939751718},{x:-.0009577287429766018,y:.0933285321567164},{x:.0017922396600954585,y:.08494657008635234},{x:.00612460787083681,y:.07726215728813059},{x:.011872885408528759,y:.07057060143641844},{x:.018816169191068984,y:.06512905526992947},{x:.02668763271653284,y:.061146634356187606},{x:.03518478005600438,y:.058776380897540545},{x:.04398107060248284,y:.05810938240515066},{x:.052738467843283614,y:.05917127125702342},{x:.06112042991364768,y:.06192123966009548},{x:.5772344299136477,y:.28943323966009543},{x:.5801995868338548,y:.29110495510775297},{x:.5832368779678606,y:.2926417214096596},{x:.5840352419382998,y:.29326744568162105},{x:.5849188427118694,y:.2937656078708368},{x:.5875008894682915,y:.29598367519331353},{x:.5901800116721211,y:.29808345906703315},{x:.5908409625530218,y:.2988529133066429},{x:.5916103985635817,y:.29951388540852875},{x:.5937101085473976,y:.3021930655225282},{x:.5959281046572271,y:.3047751734513664},{x:.5964262424769022,y:.30565878796371176},{x:.5970519447300705,y:.30645716919106897},{x:.5985886272641329,y:.3094945027073105},{x:.6002602609333286,y:.31245970573162596},{x:.6005764425347265,y:.31342352370653376},{x:.6010343656438124,y:.31432863271653283},{x:.6019489668801197,y:.31760739661134507},{x:.6030099981642363,y:.32084174364181683},{x:.6031320728657319,y:.3218487260950267},{x:.6034046191024595,y:.3228257800560044},{x:.6036619914284146,y:.3262199732716634},{x:.6040716454902366,y:.32959917016575135},{x:.603994922029512,y:.330610619326308},{x:.6040716175948494,y:.33162207060248283},{x:.6036618703363014,y:.3350012561971954},{x:.6034044043999703,y:.33839544231333624},{x:.6031318312165941,y:.33937248875722736},{x:.6030097287429766,y:.3403794678432836},{x:.6019486082572825,y:.3436137856097129},{x:.6010339165943431,y:.3468925242789459},{x:.6005759685228916,y:.3477976206592668},{x:.6002597603399046,y:.34876142991364767},{x:.5985880448922466,y:.3517265868338553},{x:.5970512785903404,y:.3547638779678605},{x:.596425554318379,y:.35556224193829966},{x:.5959273921291631,y:.35644584271186947},{x:.5937093248066866,y:.3590278894682911},{x:.5916095409329668,y:.36170701167212105},{x:.5908400866933569,y:.3623679625530219},{x:.5901791145914712,y:.36313739856358157},{x:.5874999344774714,y:.3652371085473978},{x:.5849178265486336,y:.367455104657227},{x:.5840342120362888,y:.36795324247690175},{x:.583235830808931,y:.3685789447300705},{x:.5801984972926872,y:.37011562726413405},{x:.577233294268374,y:.37178726093332853},{x:.06111929426837402,y:.5992822609333287},{x:.05273725635818315,y:.6020319981642364},{x:.04397982983424857,y:.6030936454902367},{x:.035183557686663716,y:.6024264043999704},{x:.02668647572105406,y:.6000559165943432},{x:.018815122032139416,y:.5960732785903404},{x:.011871988327878898,y:.5906315409329669},{x:.006123895342772898,y:.5839398265486336},{x:.001791739066671405,y:.5762552942683741},{x:-.0009579981642362442,y:.5678732563581832},{x:-.002019645490236678,y:.5591158298342487}]],A:[[{x:-.026930267425517032,y:.05053409251215203},{x:-.025968910797820398,y:.041765089843587025},{x:-.02331527881378681,y:.03335213247651147},{x:-.019071349062388714,y:.025618525644501258},{x:-.013400213383949137,y:.018861467521053887},{x:-.006519810342180955,y:.013340628060451547},{x:.0013054500325951415,y:.009268170027042777},{x:.009774847372633092,y:.006800595699190677},{x:.018562907487847988,y:.006032732574482988},{x:.02733191015641301,y:.006994089202179622},{x:.035744867523488544,y:.00964772118621321},{x:.043478474355498745,y:.013891650937611293},{x:.05023553247894613,y:.019562786616050876},{x:.055756371939548466,y:.02644318965781906},{x:.05982882997295724,y:.03426845003259516},{x:.15465984441872488,y:.2705423452957767},{x:.155303,y:.27047899999999997},{x:.433548,y:.27047899999999997},{x:.439584057854266,y:.2710734998088117},{x:.5426964027293978,y:.03313672871631684},{x:.5469805748198717,y:.025425342079263714},{x:.5526868446471364,y:.018697928086846893},{x:.559595923461843,y:.013213017486017727},{x:.5674422992397985,y:.009181392315192764},{x:.5759244401601543,y:.006757985668725375},{x:.5847163823041805,y:.006035927704977205},{x:.5934802562658602,y:.007042966706560308},{x:.6018792712836831,y:.009740402729397836},{x:.6095906579207363,y:.01402457481987169},{x:.6163180719131531,y:.019730844647136342},{x:.6218029825139822,y:.026639923461843008},{x:.6258346076848073,y:.03448629923979854},{x:.6282580143312746,y:.042968440160154345},{x:.6289800722950228,y:.05176038230418057},{x:.6279730332934397,y:.060524256265860256},{x:.6252755972706022,y:.0689232712836832},{x:.3314685972706022,y:.7468972712836831},{x:.3293831787279993,y:.7506509647260751},{x:.32731734906238874,y:.7544154743554987},{x:.32724162770964893,y:.7545056950115825},{x:.32718442518012836,y:.7546086579207363},{x:.324406768107635,y:.7578833802211685},{x:.32164621338394916,y:.7611725324789461},{x:.3215543458189217,y:.761246247067332},{x:.32147815535286367,y:.7613360719131531},{x:.3181150035540548,y:.764005977330098},{x:.314765810342181,y:.7666933719395485},{x:.31466132698386995,y:.7667477476499444},{x:.314569076538157,y:.7668209825139822},{x:.31074967405057474,y:.7687834680795742},{x:.3069405499674049,y:.7707658299729572},{x:.30682746605267575,y:.7707987771773066},{x:.30672270076020147,y:.7708526076848072},{x:.3025938250794972,y:.7720322561793334},{x:.29847115262736695,y:.7732334043008093},{x:.2983538139076442,y:.7732436568565263},{x:.29824055983984565,y:.7732760143312747},{x:.29396088134293,y:.7736274925246428},{x:.289683092512152,y:.774001267425517},{x:.28956600824863027,y:.7739884313326351},{x:.2894486176958195,y:.7739980722950228},{x:.2851826020272766,y:.773507873077374},{x:.280914089843587,y:.7730399107978204},{x:.2808017595188513,y:.7730044793401902},{x:.28068474373413976,y:.7729910332934397},{x:.2765963314836881,y:.7716779947458032},{x:.2725011324765115,y:.7703862788137869},{x:.27239787288194656,y:.7703296136024552},{x:.27228572871631684,y:.7702935972706022},{x:.26853203527393116,y:.7682081787280027},{x:.2647675256445013,y:.7661423490623888},{x:.26467730498841713,y:.7660666277096486},{x:.2645743420792637,y:.7660094251801283},{x:.2612996197788366,y:.7632317681076393},{x:.2580104675210539,y:.7604712133839491},{x:.2579367529326681,y:.7603793458189217},{x:.2578469280868469,y:.7603031553528636},{x:.25517702266989234,y:.7569400035540427},{x:.25248962806045155,y:.7535908103421809},{x:.2524352523500559,y:.7534863269838704},{x:.2523620174860177,y:.753394076538157},{x:.2503995319204231,y:.7495746740505695},{x:.24841717002704278,y:.7457655499674049},{x:-.023694829972957243,y:.06779154996740488},{x:-.026162404300809343,y:.05932215262736691},{x:-.026930267425517032,y:.05053409251215203}],[{x:.19075686729109992,y:.36047899999999994},{x:.2917712201653896,y:.6121588409316518},{x:.4008392655839541,y:.36047899999999994},{x:.19075686729109992,y:.36047899999999994}]],B:[[{x:.018964999999999996,y:.05103000000000002},{x:.018993157630992935,y:.05074411077481729},{x:.01896863696544404,y:.050457886669927884},{x:.019425235762019696,y:.046357147889743},{x:.01982966238185463,y:.04225093550927423},{x:.019913053192865363,y:.04197603284668677},{x:.019944843237820968,y:.04169052471317667},{x:.02119268306568244,y:.037757658485048945},{x:.02239042103699209,y:.03380924554357098},{x:.0225258403659196,y:.03355589379873479},{x:.022612719447780122,y:.03328207355405998},{x:.02460384652213923,y:.029668217721559587},{x:.026548867446385453,y:.026029339514117924},{x:.02673111120436309,y:.02580727485250577},{x:.026869740608734982,y:.025555665255108946},{x:.029527637032761178,y:.022399698271204867},{x:.03214519484660536,y:.019210194846605383},{x:.03236725950821749,y:.019027951088627763},{x:.03255231178483501,y:.01880822135423258},{x:.03577483608951879,y:.016231425260229353},{x:.03896433951411791,y:.013613867446385479},{x:.03921769125895406,y:.013478448117457993},{x:.03944205495260531,y:.013299042336531411},{x:.04310536733612953,y:.011400441961238211},{x:.046744245543570956,y:.009455421036992116},{x:.04701914820615845,y:.009372030225981372},{x:.047274201145921,y:.009239842862072495},{x:.051237522567796415,y:.008092400353164256},{x:.055185935509274225,y:.006894662381854655},{x:.05547182473445692,y:.006866504750861718},{x:.05574776537889109,y:.006786615690234012},{x:.05985878761953148,y:.006434426619834929},{x:.063965,y:.0060300000000000215},{x:.06425088922518268,y:.006058157630992957},{x:.06453711333007213,y:.00603363696544406},{x:.4241221133300721,y:.01060563696544408},{x:.4260098351414485,y:.010815826288282449},{x:.4279092214657345,y:.010813640036582327},{x:.43038314701987823,y:.011302774871886453},{x:.43288947528682337,y:.011581843237821021},{x:.43469991915024053,y:.012156270087817089},{x:.43656323581544765,y:.012524677733968342},{x:.4388942001112364,y:.013487052913568918},{x:.44129792644594007,y:.014249719447780182},{x:.4429615180190356,y:.01516630892323094},{x:.4447171588106798,y:.015891152767997317},{x:.5224141588106799,y:.0573061527679973},{x:.525028554951968,y:.05904868699814221},{x:.5277374225537912,y:.06064039332865708},{x:.5286915199232336,y:.06149010807639827},{x:.529754639763497,y:.06219869339105244},{x:.5319788494519322,y:.06441778869965879},{x:.5343251404217865,y:.06650738469209135},{x:.5350951339540482,y:.06752690757225652},{x:.5359995881074716,y:.06842928201075814},{x:.5377481362120787,y:.07103965980959966},{x:.5396416839038074,y:.07354684346181917},{x:.5707946839038074,y:.12450984346181915},{x:.5718407730360667,y:.12667263757185424},{x:.573076251912317,y:.12873311634664666},{x:.5737567016649755,y:.13063382885667474},{x:.5746357412153917,y:.13245124718509382},{x:.57523978983892,y:.1347765656784282},{x:.576049549867314,y:.13703848290314058},{x:.576346114353134,y:.13903542291661675},{x:.5768537026781452,y:.1409894121704204},{x:.5769924975430949,y:.14338789436140983},{x:.5773454200998597,y:.14576432582559334},{x:.5830324200998597,y:.2611263258255933},{x:.5829003037879823,y:.26382496142481277},{x:.5829742287592172,y:.2665258175697889},{x:.5826851199428378,y:.2682203519457296},{x:.5826010630436497,y:.26993731586400416},{x:.5819450076216034,y:.2725583233230625},{x:.5814906012502021,y:.27522170532098544},{x:.5808764603215925,y:.2768272773619606},{x:.5804590555084463,y:.278494851612457},{x:.5793042728181804,y:.28093750708458076},{x:.5783389976861617,y:.283461062658912},{x:.5774234257367941,y:.284915971131802},{x:.5766887136425759,y:.2864700717712602},{x:.575079581335268,y:.2886405053765124},{x:.5736405324246225,y:.2909272557017569},{x:.5044305324246225,y:.38012925570175693},{x:.5017223718437749,y:.38298983800955333},{x:.499075053174031,y:.3859068173944946},{x:.49869279401231464,y:.38618992769627897},{x:.4983657648506557,y:.38653536283797296},{x:.49515156889241035,y:.38881264393905274},{x:.49198604326106643,y:.39115710813128307},{x:.4915558970220145,y:.39136020348505085},{x:.4911677605809681,y:.39163520096290155},{x:.48757104899345777,y:.3932416662216644},{x:.4840089657752798,y:.3949235187770668},{x:.3737297002329455,y:.43429966367120415},{x:.4408630401939032,y:.4733794631163462},{x:.44336631106573315,y:.475186847643908},{x:.4459719275146733,y:.476843279595192},{x:.4469351296354233,y:.4777635673817196},{x:.4480152047486495,y:.4785433915190981},{x:.45011777274311354,y:.48080441158023823},{x:.45235016915983667,y:.4829373462081214},{x:.4531153243813002,y:.4840278623347861},{x:.4540225100120052,y:.48500341457167107},{x:.4556435746202097,y:.4876311804334344},{x:.4574169612623637,y:.4901586502563309},{x:.45795466509848404,y:.4913774867999537},{x:.45865409861163536,y:.4925112772109775},{x:.4597313632297904,y:.4954048053049642},{x:.460977589843244,y:.49822968107500176},{x:.46126717863714684,y:.4995299988307428},{x:.46173198119508085,y:.5007784564862466},{x:.46222404714804793,y:.5038265501505143},{x:.4628952219429378,y:.5068402734760588},{x:.4768502219429378,y:.6216502734760588},{x:.47694604753136066,y:.6258560133977795},{x:.4770801736029929,y:.6300607061367898},{x:.47704647561686464,y:.6302637547476413},{x:.47705116403527437,y:.6304695272224051},{x:.47632464920624185,y:.6346131496757303},{x:.47563590322258376,y:.6387632171212809},{x:.475563239914934,y:.6389557900590453},{x:.4755276940283349,y:.6391585233384632},{x:.47400675833929046,y:.6430807912362932},{x:.4725216084222428,y:.647016748623825},{x:.4724127722032346,y:.6471914454185},{x:.4723383580201142,y:.6473833485763381},{x:.4700814501766401,y:.6509335313629835},{x:.46785696980463054,y:.6545041220574128},{x:.46771614318912413,y:.6546542292091504},{x:.46760572040480797,y:.6548279275146733},{x:.4646995721096373,y:.6578695936566139},{x:.4618212468158623,y:.6609376018599591},{x:.3721282468158623,y:.739463601859959},{x:.3693406873548985,y:.7414576112446344},{x:.36664335021940475,y:.7435720694617842},{x:.36575927454484214,y:.7440194833243711},{x:.36495338890552403,y:.7445959530105889},{x:.3618303796850022,y:.746007822191186},{x:.35877236079175173,y:.7475554273162446},{x:.35781798626885214,y:.7478217696388809},{x:.3569151218394033,y:.7482299421328396},{x:.35357667835226414,y:.7490054137685334},{x:.3502754956523681,y:.7499266922044516},{x:.21714549565236804,y:.7733246922044517},{x:.2164184100494338,y:.7733799121498203},{x:.21571010443589486,y:.773553134187072},{x:.21202614434596675,y:.7737134914026773},{x:.20834928456346336,y:.7739927377465721},{x:.20762539682958886,y:.7739050492917646},{x:.20689690716677497,y:.7739367593459113},{x:.061505907166774995,y:.7659797593459113},{x:.05835682356136361,y:.7654946428322841},{x:.055185935509274225,y:.7651823376181454},{x:.05400593378019863,y:.7648243880069794},{x:.05278721145616079,y:.7646366437616691},{x:.0497932781460736,y:.7635464928911877},{x:.046744245543570956,y:.7626215789630079},{x:.045656749721751114,y:.7620403003359452},{x:.0444980718907103,y:.7616184026130197},{x:.04177434405403643,y:.7599651112722733},{x:.03896433951411791,y:.7584631325536145},{x:.03801114145411163,y:.7576808631223083},{x:.03695703545532078,y:.7570410252146568},{x:.03460818442533898,y:.7548881284626934},{x:.03214519484660536,y:.7528668051533947},{x:.03136292541529926,y:.7519136070933885},{x:.03045389995114224,y:.7510804176129765},{x:.02857019075568381,y:.7485106500646154},{x:.026548867446385453,y:.7460476604858821},{x:.025967588819322866,y:.7449601646640625},{x:.025238577228599887,y:.7439656426153641},{x:.023892399755650346,y:.7410777589963466},{x:.02239042103699209,y:.738267754456429},{x:.022032471425826126,y:.7370877527273536},{x:.021511489215134356,y:.7359701170349662},{x:.02075457631003429,y:.7328750970932278},{x:.01982966238185463,y:.7298260644907257},{x:.019708797589401895,y:.7285989036590902},{x:.01941586581292807,y:.7274011044358949},{x:.019277305214138767,y:.7242178880520896},{x:.018964999999999996,y:.721047},{x:.018964999999999996,y:.05103000000000002}],[{x:.10896499999999999,y:.09660579683225357},{x:.10896499999999999,y:.37786028838708235},{x:.29722384626437015,y:.36605169579422814},{x:.44137514989764515,y:.3145812530901673},{x:.49232133133007555,y:.24891875813083103},{x:.48801965008125897,y:.1616582425292873},{x:.46925190911582665,y:.130956211173677},{x:.41203782454012283,y:.1004592638951106},{x:.10896499999999999,y:.09660579683225357}],[{x:.10896499999999999,y:.47257215902605326},{x:.10896499999999999,y:.6784424315209651},{x:.20665565807681563,y:.6837888736412973},{x:.32230778354311135,y:.6634626629325134},{x:.3846372425734713,y:.608893375476212},{x:.3762519660226853,y:.5399063743443061},{x:.2981741908903496,y:.4944555775409729},{x:.10896499999999999,y:.47257215902605326}]],C:[[{x:.028007484408327545,y:.4010798543150725},{x:.028340096336253087,y:.39680461654123217},{x:.028649292669517497,y:.39252762152779447},{x:.06572429266951751,y:.1769866215277945},{x:.0657499934516808,y:.17689321918606288},{x:.06575739253020782,y:.1767966283931179},{x:.06691993730130205,y:.17264138379230456},{x:.0680646634579554,y:.1684811950870131},{x:.0681080922997215,y:.16839460141895576},{x:.06813419313592875,y:.16830131007962543},{x:.07008504794245551,y:.16445270857242494},{x:.07201939106115751,y:.16059578172109576},{x:.07207887901649253,y:.16051932447281397},{x:.0721226785698821,y:.1604329177209502},{x:.1274306785698821,y:.07363491772095027},{x:.13009575906138268,y:.07023973030268985},{x:.13274648275581225,y:.06683332229320074},{x:.13281865262016482,y:.06677089175108791},{x:.13287757357360944,y:.06669582922279092},{x:.1361538134974972,y:.06388581079003605},{x:.13941816151489866,y:.0610619864944041},{x:.19692016151489866,y:.020443986494404057},{x:.19808425112310213,y:.019782383965415776},{x:.19914710087537263,y:.01896802966513257},{x:.20191114759162085,y:.01760739299916557},{x:.20458957759683996,y:.01608512525217841},{x:.2058603718000633,y:.015663337846789194},{x:.20706167183504787,y:.015071982836463577},{x:.21003805521400143,y:.014276729186446702},{x:.2129619996426652,y:.013306247159584957},{x:.21429066253234816,y:.013140483931242813},{x:.21558424756339917,y:.01279485365228588},{x:.32760524756339915,y:-.005618146347714133},{x:.32775803960473765,y:-.005628051859015257},{x:.32790622767465843,y:-.005666572281957827},{x:.3321581535063009,y:-.005913311337168391},{x:.3364083102547015,y:-.006188849089881349},{x:.3365600989091985,y:-.006168756021014132},{x:.33671295454862427,y:-.006177626226551311},{x:.34093131721939995,y:-.005590114680318674},{x:.3451535631465426,y:-.005031193603710363},{x:.34529851526132993,y:-.004981874120043047},{x:.3454501643137599,y:-.004960753231150514},{x:.44307616431375996,y:.01857424676884946},{x:.4458503498549469,y:.019539172468847843},{x:.4486819664572553,y:.020319643122350156},{x:.45000735163266253,y:.02098507354168687},{x:.45140809089867484,y:.021472282957461515},{x:.45394072357704407,y:.022959884631265325},{x:.4565656691892177,y:.024277779754777677},{x:.4577357684253341,y:.0251889939358613},{x:.459014543037309,y:.025940112433793877},{x:.4612082951993476,y:.027893222383335445},{x:.4635256946335971,y:.029697896006345384},{x:.5358116946335971,y:.09837789600634546},{x:.5383578959705028,y:.10132350300922108},{x:.5409714489909738,y:.10420951799057969},{x:.5412394420583803,y:.10465705806338507},{x:.5415805729157932,y:.10505169984914184},{x:.5435031902892489,y:.10843744707814906},{x:.545503491029224,y:.11177788699125937},{x:.5456790239480676,y:.11226911056087577},{x:.5459366092786453,y:.11272272074420048},{x:.5471617575812067,y:.11641849583208026},{x:.548471935605029,y:.12008498944441898},{x:.572709935605029,y:.21701898944441894},{x:.5740007070580636,y:.2257455880614603},{x:.5735642017652605,y:.23455632455146336},{x:.571417194380227,y:.24311260725223527},{x:.5676421931927146,y:.25108562301800397},{x:.5623842693813143,y:.2581689733242098},{x:.5558454820094204,y:.2640904489909738},{x:.5482771130087407,y:.26862249102922403},{x:.539970010555581,y:.27159093560502906},{x:.5312434119385397,y:.2728817070580635},{x:.5224326754485367,y:.2724452017652604},{x:.5138763927477648,y:.270298194380227},{x:.5059033769819961,y:.26652319319271456},{x:.49882002667579023,y:.2612652693813142},{x:.49289855100902624,y:.25472648200942033},{x:.488366508970776,y:.24715811300874066},{x:.48539806439497096,y:.23885101055558106},{x:.46433420621000654,y:.15461122058523102},{x:.4102697826671089,y:.10324381045150927},{x:.3332137540403124,y:.08466767669890593},{x:.24039332695070226,y:.09992465997883551},{x:.1985742470214596,y:.12946463056361485},{x:.15288732813236672,y:.2011637190451272},{x:.11884238546013813,y:.39908903228895243},{x:.16184523767713488,y:.5942488915238071},{x:.2166399992296726,y:.6603981208316636},{x:.2708106585112101,y:.6880654725502051},{x:.33167151101531583,y:.6962265900331734},{x:.41875307675349,y:.6679697644015699},{x:.4604926982936834,y:.628705384802963},{x:.487421989657252,y:.5630715564186946},{x:.49155436139101494,y:.5552777692634718},{x:.49712782320648147,y:.5484399232752638},{x:.5039281900917167,y:.5428207930406891},{x:.5116941277610109,y:.5386363185834178},{x:.5201271955849208,y:.5360473069101626},{x:.5289033154962927,y:.5351532522875923},{x:.5376852261286371,y:.5359885127334604},{x:.5461354435813054,y:.5385209896572519},{x:.5539292307365281,y:.5426533613910148},{x:.5607670767247361,y:.5482268232064814},{x:.5663862069593109,y:.5550271900917166},{x:.5705706814165822,y:.5627931277610108},{x:.5731596930898373,y:.5712261955849207},{x:.5740537477124077,y:.5800023154962926},{x:.5732184872665396,y:.588784226128637},{x:.570686010342748,y:.5972344435813053},{x:.540057010342748,y:.6718854435813053},{x:.5396985836895672,y:.6725614478775368},{x:.539454213118803,y:.6732865233897278},{x:.5376352487491008,y:.6764529645154376},{x:.5359246386089851,y:.679679230736528},{x:.5354412171276051,y:.6802723202285732},{x:.5350600868536766,y:.680935789284769},{x:.5326583313554347,y:.6836865257875079},{x:.5303511767935185,y:.686517076724736},{x:.5297613381003629,y:.6870044593160238},{x:.5292580947459566,y:.687580825172473},{x:.47307109474595666,y:.7404358251724731},{x:.4722065860115991,y:.7411021817697292},{x:.4714497622811152,y:.7418887085063782},{x:.4687194058651613,y:.7437900730587934},{x:.46608420409854834,y:.7458212660502541},{x:.46510630693397415,y:.746306161504971},{x:.46421058160492856,y:.7469299263656303},{x:.4611617503991064,y:.748262090618912},{x:.45818091720073817,y:.7497401524453693},{x:.45712721164557074,y:.7500249524971546},{x:.4561270069400303,y:.7504619845480405},{x:.3497190069400303,y:.7849899845480404},{x:.34852117258500637,y:.7852523061157466},{x:.34737251112679673,y:.7856814874310271},{x:.34422084285321763,y:.7861940634064482},{x:.3411016855274714,y:.7868771480384597},{x:.33987569082458696,y:.7869007432807547},{x:.3386653714532072,y:.7870975852636362},{x:.3354742629896646,y:.786985452257037},{x:.33228177619648713,y:.7870468942022847},{x:.3310747354346284,y:.7868308563672394},{x:.32984927004476555,y:.7867877944907101},{x:.25121827004476555,y:.7762437944907102},{x:.24809780050166644,y:.7755083028870222},{x:.24494229970605153,y:.7749416523797719},{x:.24381291428322105,y:.7744983594176508},{x:.24263200473447152,y:.7742200201979198},{x:.2397149814324578,y:.772889887451158},{x:.2367306607297473,y:.771718517308175},{x:.16743766072974728,y:.7363275173081749},{x:.16716950847174827,y:.7361554960544541},{x:.16687461978467572,y:.7360349240533984},{x:.16345937419922074,y:.733775423054901},{x:.16001260855282193,y:.7315643025810339},{x:.15978316844705134,y:.7313432727571054},{x:.15951746839392553,y:.7311674875843215},{x:.15660865257214304,y:.7282851209029094},{x:.15365948376641753,y:.7254440558690711},{x:.15347757306746915,y:.725182511527114},{x:.15325127235232486,y:.7249582685082102},{x:.08558827235232488,y:.6432742685082102},{x:.0845522070982367,y:.6417389136031936},{x:.0833480194008015,y:.6403315480201149},{x:.08209078724421986,y:.6380913122274521},{x:.0806538380596292,y:.6359618836319892},{x:.07993721339171088,y:.6342539038369039},{x:.07903072722802115,y:.632638655023214},{x:.07823470075697891,y:.6301961909068614},{x:.07724079305844417,y:.627827343805619},{x:.07687114846079628,y:.6260123758261444},{x:.07629719958575912,y:.6242513168879111},{x:.02905219958575911,y:.40983931688791114},{x:.028544362954760993,y:.4055813372409792},{x:.028013217832748447,y:.4013262022752188},{x:.028022142274708197,y:.401202753871557},{x:.028007484408327545,y:.4010798543150725}]],D:[[{x:.019456783112310236,y:.0515304721392918},{x:.019516560837245702,y:.0508455251733057},{x:.019462408649259272,y:.05016011050819538},{x:.01989956114396584,y:.04645701928180655},{x:.020223754746627687,y:.042742334175020345},{x:.02041601038349858,y:.04208221032853139},{x:.020496616482350807,y:.04139940114622653},{x:.021647806474261868,y:.03785274800035644},{x:.022690469901424933,y:.03427268656062632},{x:.023007815173924504,y:.033662754022853354},{x:.023220081912440925,y:.03300879029730612},{x:.025041069815762075,y:.029754871123364675},{x:.026762134096652887,y:.026447013104097812},{x:.027192373603928278,y:.025910711240413317},{x:.027528143690388265,y:.025310724430849408},{x:.029948949961216734,y:.02247458551787214},{x:.03228227556070457,y:.019566050047680916},{x:.03280887543977226,y:.01912398863794477},{x:.03325524541805519,y:.01860103590097925},{x:.03618283982900684,y:.01629166847686688},{x:.03903875835284746,y:.013894228942745224},{x:.03964148166567549,y:.013563396159022682},{x:.0401812977878431,y:.013137574275061882},{x:.04350317452751879,y:.011443726034814963},{x:.04677193462845869,y:.0096495146935595},{x:.04742761905614622,y:.009442624254195854},{x:.048040136491355995,y:.009130297319436702},{x:.05162863769958001,y:.008117061901006828},{x:.05518462276008175,y:.0069950292882567724},{x:.05586807071778482,y:.006920031876811272},{x:.05652975076450537,y:.006733202440201605},{x:.060246972352300414,y:.0064395179124900545},{x:.06395352786070822,y:.006032783112310258},{x:.06463847482669428,y:.006092560837245719},{x:.06532388949180462,y:.006038408649259287},{x:.22607288949180462,y:.009146408649259287},{x:.22716730592225892,y:.009275605270020776},{x:.2282688262216939,y:.009242558031150067},{x:.23153975417198444,y:.00979177582685766},{x:.23483359885377353,y:.010180616482350843},{x:.23588178136904675,y:.010520840680108605},{x:.23696858346127098,y:.010703324384590318},{x:.374121583461271,y:.04785532438459028},{x:.3763172878682137,y:.048688585594252994},{x:.37858028056243914,y:.049316523610364836},{x:.3804311803743379,y:.05024979166335608},{x:.3823691959266467,y:.050985260963484026},{x:.38436014929137596,y:.0522308719724549},{x:.38645715458576285,y:.05328823230909956},{x:.47004915458576285,y:.1063032323090996},{x:.47296331256678825,y:.10858070495130694},{x:.47594842000778254,y:.11076435600861785},{x:.476434095048061,y:.11129319075325024},{x:.4769998347544389,y:.11173532762855881},{x:.47941368513584726,y:.11453756329148114},{x:.48191542538645477,y:.11726162167794474},{x:.5445294253864548,y:.20053762167794476},{x:.5457907389554543,y:.20261097926106453},{x:.5472304508598836,y:.2045646816997861},{x:.5480776582474705,y:.2063702359380903},{x:.54911422277829,y:.20807414921008693},{x:.5499468085621922,y:.21035373787896267},{x:.5509777083681839,y:.21255077433219424},{x:.570480708368184,y:.26758877433219413},{x:.5715324066676154,y:.27184261440989077},{x:.5725895850614416,y:.2760950958693092},{x:.5821235850614417,y:.3411630958693092},{x:.5823063349967632,y:.3450227385412275},{x:.5825832689280143,y:.34887676846995497},{x:.5805752689280143,y:.424797768469955},{x:.5800798101377765,y:.42875301375722},{x:.5796594372976747,y:.43271694253692033},{x:.5588164372976746,y:.5335539425369203},{x:.5581925601051908,y:.535556542700639},{x:.5577783377379867,y:.5376127649642906},{x:.5568838034059929,y:.5397575559956548},{x:.5561926080991778,y:.5419762423834013},{x:.555190030621201,y:.5438186507441294},{x:.5543826183570809,y:.5457545524985521},{x:.5020956183570809,y:.6430055524985521},{x:.5018901867095668,y:.6433113858234256},{x:.5017428412228655,y:.6436490624319612},{x:.4994325691935421,y:.6469701275279692},{x:.4971767628200625,y:.6503284258808291},{x:.4969156133622187,y:.650588304977856},{x:.4967052216394318,y:.6508907475465959},{x:.49379143318032753,y:.6536972875938759},{x:.49092379998669317,y:.6565509711937552},{x:.49061696854573045,y:.6567549090549786},{x:.49035161582277553,y:.657010494885618},{x:.39890061582277553,y:.7292364948856179},{x:.3986791836579038,y:.7293785203585265},{x:.39848760231040037,y:.7295587979940886},{x:.39496847203231433,y:.7317585520660096},{x:.39147518928128755,y:.7339991259907827},{x:.39123030407812903,y:.7340952232117042},{x:.391007233490524,y:.7342346611962726},{x:.3871265715837099,y:.7357055993513507},{x:.38326329699273004,y:.7372216156196327},{x:.3830043695523095,y:.737268091626259},{x:.38275838220218455,y:.7373613314362847},{x:.25909638220218456,y:.7708063314362847},{x:.2580664240588666,y:.7709788511982676},{x:.2570738325025125,y:.7713034106651087},{x:.2537238261308602,y:.7717062438265866},{x:.2503960471743838,y:.7722636525302581},{x:.2493522224520667,y:.7722319225075465},{x:.24831538485324267,y:.7723566006488801},{x:.17218438485324267,y:.7739936006488801},{x:.16854768223369815,y:.7737142062783378},{x:.16490357022768087,y:.7735589167265521},{x:.06552457022768086,y:.7594769167265522},{x:.06454980411013514,y:.759239472501363},{x:.06355033417502035,y:.7591522452533723},{x:.06027159361314519,y:.7581973390517399},{x:.056953647958865025,y:.7573891174476861},{x:.056043934769293216,y:.7569660682109414},{x:.05508068656062633,y:.7566855300985751},{x:.05205123903764884,y:.7551093215998242},{x:.04895472299174925,y:.7536693306611393},{x:.04814502249785432,y:.7530769339577588},{x:.0472550131040978,y:.7526138659033472},{x:.04459127858939255,y:.7504769279161366},{x:.04183518952697092,y:.7484605056870383},{x:.041156618064647085,y:.7477215269901124},{x:.040374050047680896,y:.7470937244392954},{x:.03817839436480973,y:.744478178292066},{x:.035868647242901154,y:.7419628147479951},{x:.03534728193289863,y:.7411056525944231},{x:.03470222894274521,y:.7403372416471526},{x:.03305902990826266,y:.7373436013115269},{x:.03128438701344127,y:.73442596046285},{x:.030940263632238257,y:.7334835551134912},{x:.030457514693559486,y:.7326040653715413},{x:.029429919524844063,y:.7293473747667649},{x:.028258579388326675,y:.7261395799150647},{x:.028104922404476318,y:.7251481474789881},{x:.02780302928825676,y:.7241913772399183},{x:.02743052789135989,y:.7207967891595589},{x:.026907504457698045,y:.7174221140620348},{x:.02695021882291786,y:.7164197547317572},{x:.026840783112310238,y:.7154224721392919},{x:.019456783112310236,y:.0515304721392918}],[{x:.1099671672449683,y:.09691838411671685},{x:.1164055200593884,y:.675787686211921},{x:.17390769441284104,y:.6839357418297609},{x:.2408956143230629,y:.6824953400894312},{x:.35035782392371695,y:.652890743688808},{x:.42724604872976657,y:.5921661050862587},{x:.4720072878873445,y:.5089126143655517},{x:.4907125333997566,y:.41841792349882906},{x:.4925121994894803,y:.35037387509349616},{x:.4841787199640398,y:.2934992321564965},{x:.4684498534661817,y:.24911194023683725},{x:.41491413338319044,y:.1779099626338861},{x:.34401115658372555,y:.1329424859013802},{x:.21878934362335548,y:.0990224054430332},{x:.1099671672449683,y:.09691838411671685}]],E:[[{x:.035078,y:.05103000000000002},{x:.03594266238185463,y:.04225093550927423},{x:.03850342103699209,y:.03380924554357098},{x:.042661867446385456,y:.026029339514117924},{x:.04825819484660536,y:.019210194846605383},{x:.05507733951411791,y:.013613867446385479},{x:.06285724554357096,y:.009455421036992116},{x:.07129893550927423,y:.006894662381854655},{x:.080078,y:.0060300000000000215},{x:.521974,y:.0060300000000000215},{x:.5307530644907258,y:.006894662381854655},{x:.5391947544564291,y:.009455421036992116},{x:.5469746604858822,y:.013613867446385479},{x:.5537938051533947,y:.019210194846605383},{x:.5593901325536146,y:.026029339514117924},{x:.5635485789630079,y:.03380924554357098},{x:.5661093376181454,y:.04225093550927425},{x:.5669740000000001,y:.05103000000000002},{x:.5661093376181454,y:.05980906449072579},{x:.5635485789630079,y:.06825075445642906},{x:.5593901325536146,y:.07603066048588211},{x:.5537938051533947,y:.08284980515339466},{x:.5469746604858822,y:.08844613255361455},{x:.5391947544564291,y:.09260457896300792},{x:.5307530644907258,y:.09516533761814538},{x:.521974,y:.09603000000000002},{x:.125078,y:.09603000000000002},{x:.125078,y:.345019},{x:.389405,y:.345019},{x:.3981840644907258,y:.34588366238185464},{x:.40662575445642907,y:.3484444210369921},{x:.4144056604858821,y:.35260286744638547},{x:.42122480515339467,y:.35819919484660534},{x:.42682113255361454,y:.3650183395141179},{x:.4309795789630079,y:.372798245543571},{x:.43354033761814537,y:.3812399355092742},{x:.434405,y:.390019},{x:.43354033761814537,y:.3987980644907258},{x:.4309795789630079,y:.407239754456429},{x:.42682113255361454,y:.4150196604858821},{x:.42122480515339467,y:.42183880515339467},{x:.4144056604858821,y:.42743513255361454},{x:.40662575445642907,y:.43159357896300793},{x:.3981840644907258,y:.43415433761814537},{x:.389405,y:.435019},{x:.125078,y:.435019},{x:.125078,y:.684004},{x:.521974,y:.684004},{x:.5307530644907258,y:.6848686623818546},{x:.5391947544564291,y:.6874294210369921},{x:.5469746604858822,y:.6915878674463855},{x:.5537938051533947,y:.6971841948466053},{x:.5593901325536146,y:.7040033395141179},{x:.5635485789630079,y:.711783245543571},{x:.5661093376181454,y:.7202249355092742},{x:.5669740000000001,y:.729004},{x:.5661093376181454,y:.7377830644907257},{x:.5635485789630079,y:.746224754456429},{x:.5593901325536146,y:.7540046604858821},{x:.5537938051533947,y:.7608238051533946},{x:.5469746604858822,y:.7664201325536145},{x:.5391947544564291,y:.7705785789630079},{x:.5307530644907258,y:.7731393376181454},{x:.521974,y:.774004},{x:.080078,y:.774004},{x:.07129893550927423,y:.7731393376181454},{x:.06285724554357093,y:.7705785789630079},{x:.05507733951411791,y:.7664201325536145},{x:.04825819484660536,y:.7608238051533946},{x:.042661867446385456,y:.7540046604858821},{x:.03850342103699209,y:.746224754456429},{x:.03594266238185463,y:.7377830644907257},{x:.035078,y:.729004},{x:.035078,y:.05103000000000002}]],F:[[{x:.041426000000000004,y:.05103000000000002},{x:.04229066238185464,y:.04225093550927423},{x:.0448514210369921,y:.03380924554357098},{x:.04900986744638546,y:.026029339514117924},{x:.054606194846605366,y:.019210194846605383},{x:.06142533951411792,y:.013613867446385479},{x:.06920524554357096,y:.009455421036992116},{x:.07764693550927423,y:.006894662381854655},{x:.086426,y:.0060300000000000215},{x:.09520506449072577,y:.006894662381854655},{x:.10364675445642904,y:.009455421036992116},{x:.11142666048588211,y:.013613867446385486},{x:.11824580515339464,y:.019210194846605383},{x:.12384213255361454,y:.026029339514117924},{x:.1280005789630079,y:.03380924554357098},{x:.13056133761814537,y:.04225093550927425},{x:.131426,y:.05103000000000002},{x:.131426,y:.347323},{x:.447344,y:.347323},{x:.4561230644907258,y:.3481876623818546},{x:.4645647544564291,y:.35074842103699205},{x:.47234466048588214,y:.35490686744638544},{x:.47916380515339463,y:.3605031948466053},{x:.48476013255361455,y:.36732233951411786},{x:.48891857896300794,y:.37510224554357097},{x:.4914793376181454,y:.3835439355092742},{x:.492344,y:.392323},{x:.4914793376181454,y:.4011020644907258},{x:.48891857896300794,y:.409543754456429},{x:.48476013255361455,y:.4173236604858821},{x:.47916380515339463,y:.42414280515339464},{x:.47234466048588214,y:.4297391325536145},{x:.4645647544564291,y:.4338975789630079},{x:.4561230644907258,y:.43645833761814534},{x:.447344,y:.43732299999999996},{x:.131426,y:.43732299999999996},{x:.131426,y:.679393},{x:.515626,y:.679393},{x:.5244050644907258,y:.6802576623818547},{x:.532846754456429,y:.6828184210369922},{x:.5406266604858821,y:.6869768674463855},{x:.5474458051533947,y:.6925731948466054},{x:.5530421325536146,y:.6993923395141179},{x:.5572005789630079,y:.707172245543571},{x:.5597613376181454,y:.7156139355092743},{x:.5606260000000001,y:.7243930000000001},{x:.5597613376181454,y:.7331720644907258},{x:.5572005789630079,y:.7416137544564291},{x:.5530421325536146,y:.7493936604858822},{x:.5474458051533947,y:.7562128051533947},{x:.5406266604858821,y:.7618091325536146},{x:.532846754456429,y:.7659675789630079},{x:.5244050644907258,y:.7685283376181454},{x:.515626,y:.7693930000000001},{x:.10586481668800227,y:.7693930000000001},{x:.10364675445642904,y:.7705785789630079},{x:.09520506449072577,y:.7731393376181454},{x:.086426,y:.774004},{x:.0776469355092742,y:.7731393376181454},{x:.06920524554357094,y:.7705785789630079},{x:.06142533951411792,y:.7664201325536145},{x:.054606194846605366,y:.7608238051533946},{x:.04900986744638546,y:.7540046604858821},{x:.0448514210369921,y:.746224754456429},{x:.04229066238185464,y:.7377830644907257},{x:.041426000000000004,y:.729004},{x:.041426000000000004,y:.05103000000000002}]],G:[[{x:.011397831509003739,y:.41623356008285023},{x:.011618856500496228,y:.4138403978921803},{x:.011624876992355357,y:.4114370583257866},{x:.031979876992355355,y:.20994505832578658},{x:.0322125865037964,y:.20879027461506633},{x:.03227702681480045,y:.2076140405475535},{x:.033082276634523504,y:.2044745765152392},{x:.033722542929381774,y:.20129735748690203},{x:.034176068118796386,y:.2002101619949014},{x:.03446874211029117,y:.19906910061620064},{x:.03587099832954512,y:.19614705695158466},{x:.03711880677043453,y:.1931557970536144},{x:.03777571891913337,y:.19217797009338475},{x:.03828537929375919,y:.19111593175236494},{x:.08239837929375919,y:.11845093175236496},{x:.08400149586436068,y:.11631468084865614},{x:.08543403702225794,y:.1140604899753128},{x:.08664282877724949,y:.11279494315419919},{x:.08769326713863865,y:.11139516977529508},{x:.08968234215056696,y:.10961271886167734},{x:.09152712825517066,y:.10768131654967852},{x:.15960912825517065,y:.049144316549678456},{x:.16129904644183068,y:.0479582081853546},{x:.16285577619764602,y:.04660201166682107},{x:.1649006360722032,y:.045430348778213794},{x:.16682965744636918,y:.04407642028337947},{x:.16871850259167306,y:.043242789341903884},{x:.17050990103726027,y:.04221635466854622},{x:.25257090103726026,y:.005359354668546305},{x:.2555014876285109,y:.004375276469579791},{x:.2583690572759664,y:.003220377345201267},{x:.25967433471463813,y:.0029740526131209386},{x:.2609335532503684,y:.0025512125194529015},{x:.2639998135747395,y:.0021577721889240492},{x:.26703759331756605,y:.0015844992133087973},{x:.35309859331756605,y:-.006038500786691249},{x:.3541123404679588,y:-.006028536718703998},{x:.3551159915981175,y:-.006171599559831674},{x:.3585153812714738,y:-.005985259459774228},{x:.361919709861342,y:-.005951798491220829},{x:.36291203425126567,y:-.00574425362199294},{x:.3639243106821295,y:-.005688764928569123},{x:.3672220288859873,y:-.004842817275250554},{x:.37055441634545594,y:-.004145847688979236},{x:.3714871835051078,y:-.003748697851442632},{x:.37246918402112983,y:-.003496790022837183},{x:.4525501840211298,y:.02567020997716287},{x:.4548144879103283,y:.026756908839544704},{x:.45716266717941917,y:.02764799841997529},{x:.45878159595452606,y:.02866082810547922},{x:.4605032369247208,y:.02948708879101062},{x:.4625120284186098,y:.03099465081435172},{x:.46464124512829075,y:.032326725408117304},{x:.4660314733714444,y:.03363593119127184},{x:.46755883802994086,y:.034782191000688294},{x:.46923492039795345,y:.03665268142188218},{x:.47106334994415,y:.038374550149380404},{x:.53517534994415,y:.11188255014938031},{x:.5366918789074028,y:.11401106513419482},{x:.5383741006891446,y:.11601120663268963},{x:.5392453250303639,y:.11759493887966013},{x:.5402941837404813,y:.11906705813061697},{x:.5413663203511413,y:.12145053442062861},{x:.5426260104640281,y:.12374042895017842},{x:.5431715236397763,y:.1254636976633839},{x:.5439130326051668,y:.12711215273922669},{x:.5444995752545472,y:.12965899467727895},{x:.5452883245139833,y:.13215064287530112},{x:.5896823245139834,y:.3420786428753011},{x:.5897067631627176,y:.34229945557802055},{x:.5897717252277992,y:.3425119065778641},{x:.5901917436343531,y:.346681442891342},{x:.5906527316031134,y:.3508466486034176},{x:.590633622248786,y:.3510679861958218},{x:.5906558889520306,y:.35128902847947113},{x:.590254400640623,y:.3554603898480228},{x:.5898939395311937,y:.3596354965915505},{x:.5898320165355749,y:.3598488531940917},{x:.589810732180064,y:.3600699922305474},{x:.5886031661213459,y:.3640828755761044},{x:.5874351082520124,y:.3681074363403587},{x:.5873327512810971,y:.3683046127784522},{x:.5872687338126765,y:.3685173503185603},{x:.5853014960930706,y:.3722175427846122},{x:.5833707292727002,y:.37593689595641405},{x:.5832318718474782,y:.3761103148501221},{x:.583127581421558,y:.3763064755095204},{x:.5804762718833937,y:.37955178077467916},{x:.577856994398102,y:.38282299369748307},{x:.5776869727315521,y:.38296599065597503},{x:.5775464171707139,y:.38313803609053093},{x:.5743129241526703,y:.3858037388934479},{x:.5711057933673104,y:.38850110068914456},{x:.5709111412967293,y:.38860818041949885},{x:.5707397220723512,y:.3887494990196469},{x:.5670483068977423,y:.3907331578965531},{x:.5633765710498215,y:.39275301046402805},{x:.5631647689451196,y:.3928200579522583},{x:.5629690736018615,y:.39292521892344706},{x:.5589615952856832,y:.39415060297614785},{x:.5549663571246989,y:.39541532451398326},{x:.5547455444219794,y:.39543976316271745},{x:.5545330934221359,y:.39550472522779906},{x:.5503635571086607,y:.3959247436343527},{x:.5461983513965825,y:.39638573160311336},{x:.5459770138041778,y:.396366622248786},{x:.5457559715205288,y:.3963888889520305},{x:.32969497152052885,y:.39686888895203054},{x:.32091400776945256,y:.3960237321800639},{x:.31246664968143967,y:.39348173381267654},{x:.3046775244904796,y:.389340581421558},{x:.29784596390946905,y:.3837594171707138},{x:.2922345009803531,y:.3769527220723512},{x:.2880587810765529,y:.3691820736018615},{x:.2854792747722009,y:.3607460934221358},{x:.2845951110479695,y:.3519689715205288},{x:.2854402678199361,y:.3431880077694525},{x:.2879822661873235,y:.33474064968143963},{x:.29212341857844204,y:.32695152449047954},{x:.29770458282928614,y:.320119963909469},{x:.3045112779276488,y:.31450850098035305},{x:.31228192639813845,y:.3103327810765529},{x:.3207179065778642,y:.3077532747722009},{x:.3294950284794712,y:.30686911104796943},{x:.49017057214072013,y:.30651215509128404},{x:.45965681956734333,y:.16222033524572274},{x:.4108567628008364,y:.10626833604444391},{x:.35107150330533127,y:.0844934248457151},{x:.2825297162303303,y:.09056463065174497},{x:.21333680545064249,y:.12164203785622632},{x:.15562253329738823,y:.17126485077351794},{x:.1205010051965362,y:.2291186770707186},{x:.10185989085514695,y:.41364510354456796},{x:.13655871914038514,y:.5827099362211221},{x:.190187982415082,y:.6526649281775241},{x:.2569251189377254,y:.6872526727450867},{x:.3715857772516941,y:.6967797369989467},{x:.4883723057362636,y:.6711064406866752},{x:.49713228125159653,y:.6700660353148682},{x:.5059269093127409,y:.6707546074846872},{x:.5144182172953911,y:.6731456957538017},{x:.5222798889957544,y:.6771474119409674},{x:.529209804779262,y:.6826059723372997},{x:.5349416518686954,y:.6893116075279637},{x:.5392551585948644,y:.6970066237131456},{x:.5419845593133248,y:.7053953057362636},{x:.5430249646851317,y:.7141552812515966},{x:.5423363925153128,y:.722949909312741},{x:.5399453042461984,y:.7314412172953911},{x:.5359435880590326,y:.7393028889957545},{x:.5304850276627003,y:.7462328047792621},{x:.5237793924720363,y:.7519646518686954},{x:.5160843762868544,y:.7562781585948645},{x:.5076956942637364,y:.7590075593133249},{x:.38428269426373635,y:.7861375593133247},{x:.3819812519937546,y:.7864108971664274},{x:.3797153389243004,y:.7868977113667894},{x:.37761181025895013,y:.7869298473215656},{x:.37552271874840343,y:.7871779646851318},{x:.3732121724765259,y:.7869970613144796},{x:.370894825552222,y:.7870324638061055},{x:.24049282555222196,y:.7761974638061055},{x:.24043595887820252,y:.7761870527203061},{x:.24037815170992255,y:.776187787986971},{x:.2360978388350013,y:.7753928346522221},{x:.2318155069745089,y:.7746088302209789},{x:.231761764079766,y:.7745875250435272},{x:.2317049242166051,y:.7745769685631748},{x:.227661944055434,y:.7729622424167508},{x:.22361484767780643,y:.7713578609091699},{x:.22356629387164592,y:.7713264803860874},{x:.22351260563766895,y:.7713050378383375},{x:.13987060563766895,y:.7279560378383374},{x:.13900257424615298,y:.727391873258006},{x:.13805978359276902,y:.7269641982011581},{x:.13531067905832161,y:.7249923788161832},{x:.13247402218179744,y:.7231487342752945},{x:.13173273281971745,y:.7224260654354895},{x:.1308914928889356,y:.7218226787027751},{x:.128579894506033,y:.7193524235854973},{x:.12615742040314795,y:.7169907998540069},{x:.12557136040496888,y:.7161373985129647},{x:.12486399957555622,y:.7153814879181388},{x:.05884299957555622,y:.6292624879181389},{x:.05814177883495547,y:.6281337214080167},{x:.057292540659828396,y:.62711165542026},{x:.05581896837632758,y:.6243946553718145},{x:.05418793684040681,y:.6217691571968414},{x:.05372040128165289,y:.6205252782386133},{x:.05308687616260495,y:.6193571728131668},{x:.052171678571706244,y:.6164048994674943},{x:.051084196133809955,y:.613511651036194},{x:.05086831288622884,y:.6122004612006492},{x:.05047484683830003,y:.6109312059739318},{x:.012315846838300032,y:.4250072059739319},{x:.012065742114142504,y:.42261690788694145},{x:.011602778634016861,y:.4202585732767163},{x:.011607833784388823,y:.41824059149262255},{x:.011397831509003739,y:.41623356008285023}]],H:[[{x:.021894999999999998,y:.05103000000000002},{x:.02275966238185463,y:.04225093550927423},{x:.025320421036992093,y:.03380924554357098},{x:.029478867446385455,y:.026029339514117924},{x:.03507519484660536,y:.019210194846605383},{x:.04189433951411791,y:.013613867446385479},{x:.04967424554357096,y:.009455421036992116},{x:.05811593550927423,y:.006894662381854655},{x:.066895,y:.0060300000000000215},{x:.07567406449072576,y:.006894662381854655},{x:.08411575445642903,y:.009455421036992116},{x:.0918956604858821,y:.013613867446385486},{x:.09871480515339463,y:.019210194846605383},{x:.10431113255361453,y:.026029339514117924},{x:.1084695789630079,y:.03380924554357098},{x:.11103033761814536,y:.04225093550927425},{x:.111895,y:.05103000000000002},{x:.111895,y:.359342},{x:.490157,y:.359342},{x:.490157,y:.05103000000000002},{x:.49102166238185463,y:.04225093550927423},{x:.49358242103699207,y:.03380924554357098},{x:.49774086744638546,y:.026029339514117924},{x:.5033371948466053,y:.019210194846605383},{x:.5101563395141179,y:.013613867446385479},{x:.517936245543571,y:.009455421036992116},{x:.5263779355092743,y:.006894662381854655},{x:.535157,y:.0060300000000000215},{x:.5439360644907257,y:.006894662381854655},{x:.552377754456429,y:.009455421036992116},{x:.5601576604858821,y:.013613867446385486},{x:.5669768051533947,y:.019210194846605383},{x:.5725731325536145,y:.026029339514117924},{x:.5767315789630079,y:.03380924554357098},{x:.5792923376181454,y:.04225093550927425},{x:.580157,y:.05103000000000002},{x:.580157,y:.729004},{x:.5792923376181454,y:.7377830644907257},{x:.5767315789630079,y:.746224754456429},{x:.5725731325536145,y:.7540046604858821},{x:.5669768051533947,y:.7608238051533946},{x:.5601576604858821,y:.7664201325536145},{x:.552377754456429,y:.7705785789630079},{x:.5439360644907257,y:.7731393376181454},{x:.535157,y:.774004},{x:.5263779355092743,y:.7731393376181454},{x:.517936245543571,y:.7705785789630079},{x:.5101563395141179,y:.7664201325536145},{x:.5033371948466053,y:.7608238051533946},{x:.49774086744638546,y:.7540046604858821},{x:.49358242103699207,y:.746224754456429},{x:.49102166238185463,y:.7377830644907257},{x:.490157,y:.729004},{x:.490157,y:.44934199999999996},{x:.111895,y:.44934199999999996},{x:.111895,y:.729004},{x:.11103033761814536,y:.7377830644907257},{x:.10846957896300788,y:.746224754456429},{x:.10431113255361453,y:.7540046604858821},{x:.09871480515339463,y:.7608238051533946},{x:.09189566048588207,y:.7664201325536145},{x:.08411575445642903,y:.7705785789630079},{x:.07567406449072576,y:.7731393376181454},{x:.066895,y:.774004},{x:.05811593550927421,y:.7731393376181454},{x:.04967424554357093,y:.7705785789630079},{x:.04189433951411791,y:.7664201325536145},{x:.03507519484660536,y:.7608238051533946},{x:.029478867446385455,y:.7540046604858821},{x:.025320421036992093,y:.746224754456429},{x:.02275966238185463,y:.7377830644907257},{x:.021894999999999998,y:.729004},{x:.021894999999999998,y:.05103000000000002}]],I:[[{x:.25602600000000003,y:.05103000000000002},{x:.25689066238185465,y:.04225093550927423},{x:.2594514210369921,y:.03380924554357098},{x:.2636098674463855,y:.026029339514117924},{x:.26920619484660535,y:.019210194846605383},{x:.27602533951411795,y:.013613867446385479},{x:.283805245543571,y:.009455421036992116},{x:.2922469355092743,y:.006894662381854655},{x:.301026,y:.0060300000000000215},{x:.3098050644907258,y:.006894662381854655},{x:.3182467544564291,y:.009455421036992116},{x:.32602666048588214,y:.013613867446385486},{x:.3328458051533947,y:.019210194846605383},{x:.33844213255361455,y:.026029339514117924},{x:.34260057896300794,y:.03380924554357098},{x:.3451613376181454,y:.04225093550927425},{x:.346026,y:.05103000000000002},{x:.346026,y:.729004},{x:.3451613376181454,y:.7377830644907257},{x:.34260057896300794,y:.746224754456429},{x:.33844213255361455,y:.7540046604858821},{x:.3328458051533947,y:.7608238051533946},{x:.32602666048588214,y:.7664201325536145},{x:.3182467544564291,y:.7705785789630079},{x:.3098050644907258,y:.7731393376181454},{x:.301026,y:.774004},{x:.2922469355092743,y:.7731393376181454},{x:.283805245543571,y:.7705785789630079},{x:.27602533951411795,y:.7664201325536145},{x:.26920619484660535,y:.7608238051533946},{x:.2636098674463855,y:.7540046604858821},{x:.2594514210369921,y:.746224754456429},{x:.25689066238185465,y:.7377830644907257},{x:.25602600000000003,y:.729004},{x:.25602600000000003,y:.05103000000000002}]],J:[[{x:.0492700034030052,y:.22191686675397743},{x:.05066400340300519,y:.18438286675397747},{x:.05116783173382979,y:.18068175768771486},{x:.05155979864248331,y:.17696713613904605},{x:.05874879864248331,y:.14209513613904604},{x:.05880353678004782,y:.1419191061579158},{x:.05882437610196882,y:.14173594355086241},{x:.060112741823836933,y:.13770889095133898},{x:.06136821695472819,y:.13367146342030908},{x:.0614562450600313,y:.133509494686791},{x:.06151241721221637,y:.13333391704789688},{x:.07511841721221638,y:.10184091704789687},{x:.07557207470549994,y:.10102219111224012},{x:.07589401217340325,y:.10014328637013822},{x:.07770640675364808,y:.09717031380613761},{x:.07939396242231754,y:.09412474393402119},{x:.07999862852050488,y:.09341025377409445},{x:.08048584585939292,y:.09261104382444658},{x:.10112984585939291,y:.06520804382444652},{x:.10197173470408774,y:.06429305686105671},{x:.10267645797068833,y:.06326868237508665},{x:.10495244591663212,y:.06105354143298789},{x:.10710291637241387,y:.058716353519649434},{x:.10810713366035453,y:.05798319214000915},{x:.10899816141532707,y:.05711598541156246},{x:.1373061614153271,y:.03451898541156248},{x:.13912164740426522,y:.03334117545586675},{x:.1408101373903697,y:.03198757757075004},{x:.14281300361792376,y:.03094638082514127},{x:.14470672673278473,y:.029717813955661344},{x:.1467171079910441,y:.028916819034200267},{x:.14863722796281134,y:.027918638208003034},{x:.20683022796281134,y:.004592638208003076},{x:.20850921914024034,y:.004104279923540699},{x:.2101185278310492,y:.0034204446176558795},{x:.21273469892125257,y:.0028752394826936905},{x:.21530073387518742,y:.0021288719943945503},{x:.21704273768291169,y:.0019774523068977427},{x:.21875453360851305,y:.0016207172553791283},{x:.2976895336085131,y:-.0068802827446208525},{x:.29850402526559744,y:-.006887701289741747},{x:.2993068957135494,y:-.007024999279811796},{x:.30290822222422875,y:-.006927815554356645},{x:.3065107103471747,y:-.0069606277022222565},{x:.30731099906181086,y:-.006809004262418785},{x:.30812522808832776,y:-.0067870318558802545},{x:.3663632280883278,y:.0005399681441197179},{x:.367446910459264,y:.0007860908462292888},{x:.3685549625674647,y:.000870733572342984},{x:.37174033606180384,y:.0017612008405818037},{x:.37496569353784953,y:.0024937343933679954},{x:.37598053709868623,y:.002946543859479297},{x:.3770507853196353,y:.0032457304419443098},{x:.4423997853196353,y:.028649730441944292},{x:.44339023767510893,y:.0291515261148112},{x:.4444435524779453,y:.029502699422305954},{x:.4473177196266577,y:.03114131738307233},{x:.45026902431580135,y:.03263654520916596},{x:.4511425499275847,y:.03332192668785485},{x:.4521071150681948,y:.03387184382278591},{x:.4818761150681948,y:.0549598438227859},{x:.482276572000261,y:.05530719927286456},{x:.48273081061614365,y:.05558049186877649},{x:.48560514894853896,y:.05819439949693127},{x:.48854004666413575,y:.060740123232255375},{x:.48886504324193186,y:.061158929616590856},{x:.48925723704963914,y:.06151558852974905},{x:.5141262370496392,y:.08904658852974903},{x:.5149956342421861,y:.09022293690705172},{x:.5160117353213701,y:.09127516577002369},{x:.5176116053111659,y:.0937625081737249},{x:.5193693801104602,y:.0961408866071265},{x:.519992577896003,y:.09746424275846524},{x:.5207838752101566,y:.09869448482562238},{x:.5385188752101566,y:.1333154848256224},{x:.5396070973995049,y:.13607819549886616},{x:.5408707323766272,y:.1387652058155645},{x:.5412201620380835,y:.14017334347255597},{x:.5417518824254063,y:.14152324205357814},{x:.5422802166156467,y:.1444451696332536},{x:.5429953614930656,y:.1473270727547606},{x:.5523413614930656,y:.2113020727547606},{x:.5524962602601196,y:.21460328519222147},{x:.5528139181508881,y:.2178928278123641},{x:.5518389181508881,y:.7290898278123641},{x:.5509575131661891,y:.7378672271777721},{x:.5483806584624608,y:.7463040176932935},{x:.5442073811208505,y:.7540759782308231},{x:.5385980578491955,y:.7608844367054697},{x:.5317682517950807,y:.7664677478762799},{x:.5239804285749665,y:.7706113482261165},{x:.5155338698677402,y:.7731560015172932},{x:.5067531721876358,y:.7740039181508881},{x:.4979757728222279,y:.7731225131661891},{x:.4895389823067066,y:.7705456584624607},{x:.48176702176917696,y:.7663723811208505},{x:.4749585632945304,y:.7607630578491954},{x:.46937525212372017,y:.7539332517950806},{x:.4652316517738835,y:.7461454285749665},{x:.46268699848270683,y:.7376988698677401},{x:.461839081849112,y:.7289181721876359},{x:.462807763438783,y:.22103394388498027},{x:.45501827222953295,y:.16771351802238937},{x:.44337725180090903,y:.14498874958374325},{x:.42579959063650114,y:.12552955984883984},{x:.4046143325842134,y:.11052217895574154},{x:.34961801160788414,y:.08914271579513207},{x:.3021031758959219,y:.08316481131246532},{x:.2345584384824393,y:.09043912324952764},{x:.18827433696976265,y:.10899157718530504},{x:.16959144206995366,y:.1239052897771866},{x:.155605251275173,y:.14247066404328695},{x:.14596289111822178,y:.16478926233983734},{x:.14046290234137151,y:.19146830095804884},{x:.13920799659699482,y:.22525713324602253},{x:.1380181031040591,y:.23399805813086086},{x:.13514580323043823,y:.24233889189031887},{x:.13070147784947123,y:.24995910096061402},{x:.12485591989314217,y:.25656584498063745},{x:.11783377087548613,y:.26190523048280423},{x:.10990488804518514,y:.26577206787662816},{x:.10137397392283892,y:.2680177567696118},{x:.09256886675397746,y:.2685559965969948},{x:.08382794186913914,y:.26736610310405906},{x:.07548710810968112,y:.26449380323043825},{x:.06786689903938595,y:.2600494778494712},{x:.06126015501936256,y:.2542039198931421},{x:.055920769517195726,y:.24718177087548612},{x:.052053932123371845,y:.23925288804518513},{x:.04980824323038816,y:.2307219739228389},{x:.0492700034030052,y:.22191686675397743}]],K:[[{x:-.009598999999999996,y:.05103000000000002},{x:-.008734337618145363,y:.04225093550927423},{x:-.006173578963007902,y:.03380924554357098},{x:-.002015132553614539,y:.026029339514117924},{x:.003581194846605365,y:.019210194846605383},{x:.010400339514117916,y:.013613867446385479},{x:.018180245543570964,y:.009455421036992116},{x:.026621935509274233,y:.006894662381854655},{x:.035401,y:.0060300000000000215},{x:.04418006449072578,y:.006894662381854655},{x:.05262175445642904,y:.009455421036992116},{x:.06040166048588211,y:.013613867446385486},{x:.06722080515339464,y:.019210194846605383},{x:.07281713255361454,y:.026029339514117924},{x:.07697557896300791,y:.03380924554357098},{x:.07953633761814537,y:.04225093550927425},{x:.080401,y:.05103000000000002},{x:.080401,y:.29048154892126793},{x:.18934433769134518,y:.3772029724897202},{x:.5349508182082354,y:.03415901207017739},{x:.5417907398770268,y:.02858809778868676},{x:.5495860658299886,y:.024458629583942203},{x:.5580372260624178,y:.02192930060321959},{x:.5668194472260474,y:.021097311540784057},{x:.5755952334866855,y:.021994635269720175},{x:.5840273362998535,y:.024586788142349852},{x:.5917917146832189,y:.028774155177474024},{x:.5985899879298227,y:.03439581820823536},{x:.6041609022113132,y:.04123573987702663},{x:.6082903704160578,y:.04903106582998847},{x:.6108196993967804,y:.05748222606241771},{x:.6116516884592159,y:.06626444722604735},{x:.6107543647302798,y:.07504023348668547},{x:.6081622118576502,y:.08347233629985339},{x:.603974844822526,y:.0912367146832188},{x:.5983531817917647,y:.09803498792982254},{x:.26024203797571366,y:.43363918627462555},{x:.5302838206406747,y:.648598708462355},{x:.5366139141989896,y:.654742773070568},{x:.5416237292416561,y:.6620037211908337},{x:.545120741386121,y:.6701025186588768},{x:.5469705624168195,y:.6787279332298585},{x:.5471021047489336,y:.6875484950590041},{x:.5455103132844098,y:.6962252349018474},{x:.542256359676543,y:.7044247105121999},{x:.537465291537645,y:.7118318206406747},{x:.531321226929432,y:.7181619141989897},{x:.5240602788091663,y:.7231717292416562},{x:.5159614813411232,y:.726668741386121},{x:.5073360667701415,y:.7285185624168196},{x:.498515504940996,y:.7286501047489337},{x:.48983876509815266,y:.7270583132844098},{x:.48163928948780005,y:.723804359676543},{x:.47423217935932527,y:.719013291537645},{x:.080401,y:.4055145384845117},{x:.080401,y:.729004},{x:.07953633761814537,y:.7377830644907257},{x:.07697557896300788,y:.746224754456429},{x:.07281713255361454,y:.7540046604858821},{x:.06722080515339464,y:.7608238051533946},{x:.06040166048588208,y:.7664201325536145},{x:.052621754456429054,y:.7705785789630079},{x:.04418006449072578,y:.7731393376181454},{x:.035401,y:.774004},{x:.026621935509274212,y:.7731393376181454},{x:.018180245543570936,y:.7705785789630079},{x:.010400339514117906,y:.7664201325536145},{x:.003581194846605358,y:.7608238051533946},{x:-.002015132553614539,y:.7540046604858821},{x:-.006173578963007902,y:.746224754456429},{x:-.008734337618145363,y:.7377830644907257},{x:-.009598999999999996,y:.729004},{x:-.009598999999999996,y:.05103000000000002}]],L:[[{x:.030439999999999995,y:.05103000000000002},{x:.03130466238185463,y:.04225093550927423},{x:.03386542103699209,y:.03380924554357098},{x:.03802386744638545,y:.026029339514117924},{x:.043620194846605356,y:.019210194846605383},{x:.05043933951411791,y:.013613867446385479},{x:.058219245543570955,y:.009455421036992116},{x:.06666093550927422,y:.006894662381854655},{x:.07544,y:.0060300000000000215},{x:.526613,y:.0060300000000000215},{x:.5353920644907257,y:.006894662381854655},{x:.543833754456429,y:.009455421036992116},{x:.5516136604858821,y:.013613867446385479},{x:.5584328051533947,y:.019210194846605383},{x:.5640291325536145,y:.026029339514117924},{x:.5681875789630079,y:.03380924554357098},{x:.5707483376181454,y:.04225093550927425},{x:.571613,y:.05103000000000002},{x:.5707483376181454,y:.05980906449072579},{x:.5681875789630079,y:.06825075445642906},{x:.5640291325536145,y:.07603066048588211},{x:.5584328051533947,y:.08284980515339466},{x:.5516136604858821,y:.08844613255361455},{x:.543833754456429,y:.09260457896300792},{x:.5353920644907257,y:.09516533761814538},{x:.526613,y:.09603000000000002},{x:.12043999999999999,y:.09603000000000002},{x:.12043999999999999,y:.729004},{x:.11957533761814536,y:.7377830644907257},{x:.11701457896300788,y:.746224754456429},{x:.11285613255361453,y:.7540046604858821},{x:.10725980515339463,y:.7608238051533946},{x:.10044066048588207,y:.7664201325536145},{x:.09266075445642903,y:.7705785789630079},{x:.08421906449072576,y:.7731393376181454},{x:.07544,y:.774004},{x:.06666093550927422,y:.7731393376181454},{x:.05821924554357093,y:.7705785789630079},{x:.05043933951411791,y:.7664201325536145},{x:.043620194846605356,y:.7608238051533946},{x:.03802386744638545,y:.7540046604858821},{x:.03386542103699209,y:.746224754456429},{x:.03130466238185463,y:.7377830644907257},{x:.030439999999999995,y:.729004},{x:.030439999999999995,y:.05103000000000002}]],M:[[{x:-.0025190000000000004,y:.05103000000000002},{x:-.001654337618145367,y:.04225093550927423},{x:.0009064210369920944,y:.03380924554357098},{x:.005064867446385457,y:.026029339514117924},{x:.010661194846605361,y:.019210194846605383},{x:.017480339514117912,y:.013613867446385479},{x:.02526024554357096,y:.009455421036992116},{x:.03370193550927423,y:.006894662381854655},{x:.042481,y:.0060300000000000215},{x:.051260064490725774,y:.006894662381854655},{x:.05970175445642904,y:.009455421036992116},{x:.06748166048588208,y:.013613867446385486},{x:.07430080515339463,y:.019210194846605383},{x:.07989713255361454,y:.026029339514117924},{x:.0840555789630079,y:.03380924554357098},{x:.08661633761814536,y:.04225093550927425},{x:.087481,y:.05103000000000002},{x:.087481,y:.5631122522964573},{x:.26219554141599577,y:.26476777519375044},{x:.26376288989624813,y:.2626088267569117},{x:.2651577075441738,y:.2603345964826191},{x:.26634817172230724,y:.2590477232579252},{x:.26737807478439135,y:.2576290804774607},{x:.2693364970488442,y:.25581739014918375},{x:.271148193983327,y:.2538589739959976},{x:.27256684023788735,y:.25282907571933333},{x:.27385371747828813,y:.25163861588213104},{x:.27612795245761435,y:.25024380590572387},{x:.27828690618147356,y:.24867646470811877},{x:.2798792167324836,y:.24794311979268302},{x:.28137361418054185,y:.2470265916026687},{x:.2838762642998919,y:.24610226374330602},{x:.28629950743227456,y:.24498622954453103},{x:.28800429067823724,y:.24457762002415934},{x:.28964877947809164,y:.24397024514568044},{x:.29228366929688115,y:.24355192080462856},{x:.2948780779631802,y:.2429300821730634},{x:.29662982004000654,y:.24286191068247276},{x:.29836120340931876,y:.24258703019148947},{x:.3010270755894747,y:.24269078533857608},{x:.3036929481196057,y:.24258703918410057},{x:.30542433056167173,y:.24286192551544342},{x:.30717607240852984,y:.24293010291506947},{x:.3097704789772072,y:.24355195029817853},{x:.3124053673848756,y:.24397028352732772},{x:.31404985413590314,y:.24457766395304856},{x:.3157546360035206,y:.24498627922405064},{x:.3181778753712451,y:.24610232159698525},{x:.32068052237260675,y:.24702665789836697},{x:.32217491672899246,y:.24794319112932822},{x:.32376722480624953,y:.2486765414159958},{x:.3259261732430879,y:.2502438898962479},{x:.3282004035173809,y:.2516387075441738},{x:.329487276742075,y:.2528291717223074},{x:.3309059195225393,y:.2538590747843914},{x:.3327176098508159,y:.2558174970488439},{x:.33467602600400237,y:.257629193983327},{x:.3357059242806667,y:.2590478402378874},{x:.33689638411786893,y:.2603347174782881},{x:.3382911940942761,y:.2626089524576143},{x:.3398585352918812,y:.26476790618147356},{x:.514571,y:.5631111449291359},{x:.514571,y:.05103000000000002},{x:.5154356623818547,y:.04225093550927423},{x:.5179964210369922,y:.03380924554357098},{x:.5221548674463855,y:.026029339514117924},{x:.5277511948466054,y:.019210194846605383},{x:.5345703395141179,y:.013613867446385479},{x:.542350245543571,y:.009455421036992116},{x:.5507919355092743,y:.006894662381854655},{x:.559571,y:.0060300000000000215},{x:.5683500644907258,y:.006894662381854655},{x:.576791754456429,y:.009455421036992116},{x:.5845716604858822,y:.013613867446385486},{x:.5913908051533947,y:.019210194846605383},{x:.5969871325536146,y:.026029339514117924},{x:.6011455789630079,y:.03380924554357098},{x:.6037063376181454,y:.04225093550927425},{x:.6045710000000001,y:.05103000000000002},{x:.6045710000000001,y:.729004},{x:.6044399806971988,y:.7303342613054065},{x:.6044919608158994,y:.7316699481196056},{x:.6040085293496043,y:.7347148603514975},{x:.6037063376181454,y:.7377830644907257},{x:.6033183147080721,y:.7390622046001841},{x:.6031087164726723,y:.7403823673848756},{x:.6020405410986152,y:.7432744596816038},{x:.6011455789630079,y:.746224754456429},{x:.6005154639484909,y:.7474036167328832},{x:.600052342101633,y:.7486575223726067},{x:.5984404722003996,y:.7512856532491108},{x:.5969871325536146,y:.7540046604858821},{x:.596139140401289,y:.7550379419131618},{x:.5954402924558263,y:.7561774035173808},{x:.5933466712837743,y:.758440575377949},{x:.5913908051533947,y:.7608238051533946},{x:.5903575237261146,y:.7616717973057207},{x:.589449806016673,y:.7626530260040023},{x:.5869548902613284,y:.7644642664232344},{x:.5845716604858822,y:.7664201325536145},{x:.5833927982094276,y:.7670502475681318},{x:.5823110938185264,y:.7678355352918812},{x:.579510761693201,y:.7691252393162225},{x:.576791754456429,y:.7705785789630079},{x:.5755126143469705,y:.7709666018730812},{x:.5742984925677255,y:.7715257704554689},{x:.5713003592655512,y:.772244375482538},{x:.5683500644907258,y:.7731393376181454},{x:.5670198031853202,y:.7732703569209465},{x:.5657199220368199,y:.7735819178269366},{x:.5626392041392276,y:.7737018082685412},{x:.559571,y:.774004},{x:.5582407386945936,y:.7738729806971988},{x:.5569050518803944,y:.7739249608158993},{x:.5538601396485026,y:.7734415293496042},{x:.5507919355092743,y:.7731393376181454},{x:.5495127953998159,y:.772751314708072},{x:.5481926326151244,y:.7725417164726722},{x:.5453005403183963,y:.7714735410986151},{x:.542350245543571,y:.7705785789630079},{x:.5411713832671168,y:.7699484639484908},{x:.5399174776273933,y:.769485342101633},{x:.5372893467508892,y:.7678734722003996},{x:.5345703395141179,y:.7664201325536145},{x:.5335370580868383,y:.765572140401289},{x:.5323975964826192,y:.7648732924558262},{x:.5301344246220511,y:.7627796712837742},{x:.5277511948466054,y:.7608238051533946},{x:.5269032026942794,y:.7597905237261146},{x:.5259219739959977,y:.7588828060166729},{x:.5241107335767656,y:.7563878902613284},{x:.5221548674463855,y:.7540046604858821},{x:.5215247524318682,y:.7528257982094275},{x:.5207394647081188,y:.7517440938185264},{x:.30102684980758887,y:.3765575080608823},{x:.08131245858400418,y:.7517442248062496},{x:.0805272117946797,y:.752825865136849},{x:.07989713255361454,y:.7540046604858821},{x:.07794121846393844,y:.7563879486998997},{x:.0761299252156086,y:.7588829195225393},{x:.07514874916275306,y:.7597905823884902},{x:.07430080515339463,y:.7608238051533946},{x:.0719175169393771,y:.7627797192430708},{x:.06965428252171184,y:.764873384117869},{x:.06851488325078628,y:.7655721885442563},{x:.06748166048588208,y:.7664201325536145},{x:.06476258657702469,y:.7678735078373721},{x:.06213438581945812,y:.7694854083973313},{x:.06088054980546198,y:.7699484997219428},{x:.05970175445642904,y:.7705785789630079},{x:.056751387338174995,y:.7714735630437544},{x:.05385922052190834,y:.7725417548543195},{x:.05253913197970031,y:.7727513367372549},{x:.051260064490725774,y:.7731393376181454},{x:.04819178511684276,y:.773441536759571},{x:.0451467965906812,y:.7739249698085104},{x:.04381118578262464,y:.7738729881355436},{x:.042481,y:.774004},{x:.039412720626117295,y:.7737018008585744},{x:.03633192759147018,y:.7735818970849305},{x:.035032121291898165,y:.7732703494826018},{x:.03370193550927423,y:.7731393376181454},{x:.030751568391020223,y:.7722443535373988},{x:.02775336399647938,y:.7715257207759494},{x:.026539313032545114,y:.7709665798438982},{x:.02526024554357096,y:.7705785789630079},{x:.02254117163471342,y:.7691252036792503},{x:.01974077519375046,y:.7678354585840041},{x:.01865913486315115,y:.7670502117946798},{x:.017480339514117912,y:.7664201325536145},{x:.015097051300099952,y:.7644642184639381},{x:.012602080477460715,y:.7626529252156086},{x:.011694417611510011,y:.7616717491627533},{x:.010661194846605361,y:.7608238051533946},{x:.008705280756928618,y:.7584405169393763},{x:.006611615882131057,y:.7561772825217118},{x:.005912811455744052,y:.7550378832507868},{x:.005064867446385457,y:.7540046604858821},{x:.0036114921626275165,y:.7512855865770239},{x:.0019995916026687363,y:.7486573858194581},{x:.0015365002780573323,y:.7474035498054622},{x:.0009064210369920944,y:.746224754456429},{x:11436956245516774e-21,y:.7432743873381747},{x:-.0010567548543195318,y:.7403822205219084},{x:-.0012663367372549837,y:.7390621319797002},{x:-.001654337618145367,y:.7377830644907257},{x:-.0019565367595708303,y:.7347147851168438},{x:-.0024399698085105087,y:.7316697965906812},{x:-.0023879881355436095,y:.730334185782624},{x:-.0025190000000000004,y:.729004},{x:-.0025190000000000004,y:.05103000000000002}]],N:[[{x:.022871000000000002,y:.05103000000000002},{x:.023735662381854636,y:.04225093550927423},{x:.026296421036992097,y:.03380924554357098},{x:.03045486744638546,y:.026029339514117924},{x:.036051194846605364,y:.019210194846605383},{x:.042870339514117915,y:.013613867446385479},{x:.05065024554357096,y:.009455421036992116},{x:.05909193550927423,y:.006894662381854655},{x:.067871,y:.0060300000000000215},{x:.07665006449072577,y:.006894662381854655},{x:.08509175445642904,y:.009455421036992116},{x:.0928716604858821,y:.013613867446385486},{x:.09969080515339464,y:.019210194846605383},{x:.10528713255361455,y:.026029339514117924},{x:.10944557896300791,y:.03380924554357098},{x:.11200633761814537,y:.04225093550927425},{x:.112871,y:.05103000000000002},{x:.112871,y:.5841703094604355},{x:.49710429367778214,y:.025528669675955993},{x:.4971050718109503,y:.02552774709009411},{x:.49710565506134197,y:.025526690456344234},{x:.49994880496714983,y:.022156103119426583},{x:.5027917749380927,y:.01878536401177818},{x:.5027927181072235,y:.018784610959395015},{x:.5027934962896407,y:.018783688415073364},{x:.5062395848358414,y:.016032536999645196},{x:.5096855265142521,y:.01328120162562755},{x:.5096865984738844,y:.013280647046104224},{x:.5096875416832135,y:.013279894044071351},{x:.5136041376200112,y:.011253903755746949},{x:.5175206253992491,y:.009227704391234041},{x:.5175217849545753,y:.009227369596750634},{x:.5175228569438108,y:.00922681507445236},{x:.5217594476858983,y:.008003843583871996},{x:.5259959731369073,y:.006780645934087934},{x:.5259971757268666,y:.006780543790608634},{x:.5259983353000632,y:.006780209058025982},{x:.5303921110410749,y:.006407254473822295},{x:.5347858668666982,y:.00603406533837119},{x:.5347870662764328,y:.00603419977121261},{x:.5347882688718429,y:.006034097691931008},{x:.5391703792739257,y:.006525492449663053},{x:.5435525159020149,y:.007016653277689966},{x:.5435536660388816,y:.007017019120673398},{x:.543554865441438,y:.007017153617542397},{x:.547756908459233,y:.008354013692199154},{x:.5519590228368241,y:.009690649448577907},{x:.5519600795017079,y:.0096912326425627},{x:.551961229619043,y:.009691598546943021},{x:.555821723096155,y:.01182254915564361},{x:.559682330324044,y:.013953293677782128},{x:.5596832529099061,y:.01395407181095043},{x:.5596843095436558,y:.013954655061341997},{x:.5630548968806759,y:.016797804967236304},{x:.5664256359882218,y:.01964077493809272},{x:.5664263890406048,y:.019641718107223288},{x:.5664273115849267,y:.019642496289640633},{x:.5691784630004857,y:.02308858483600535},{x:.5719297983743725,y:.026534526514252196},{x:.5719303529538958,y:.0265355984738845},{x:.5719311059559287,y:.0265365416832135},{x:.5739570962443242,y:.03045313762014873},{x:.575983295608766,y:.03436962539924916},{x:.5759836304032494,y:.03437078495457533},{x:.5759841849255477,y:.0343718569438108},{x:.5772071564160691,y:.03860844768569421},{x:.5784303540659121,y:.04284497313690728},{x:.5784304562093915,y:.04284617572686688},{x:.578430790941974,y:.042847335300063204},{x:.5788037455260991,y:.04724111104014873},{x:.5791769346616289,y:.05163486686669809},{x:.5791768002287875,y:.05163606627643281},{x:.5791769023080691,y:.05163726887184294},{x:.5700269023080691,y:.7296112688718429},{x:.5690438463824576,y:.738377865441438},{x:.566369401453057,y:.746784229619043},{x:.5621063449386581,y:.7545073095436557},{x:.5564185037103594,y:.7612503115849266},{x:.5495244583167865,y:.7667541059559286},{x:.5416891430561892,y:.7708071849255477},{x:.5332136646999368,y:.773253790941974},{x:.5244237311281571,y:.773999902308069},{x:.515657134558562,y:.7730168463824576},{x:.507250770380957,y:.770342401453057},{x:.49952769045634426,y:.766079344938658},{x:.4927846884150734,y:.7603915037103594},{x:.4872808940440714,y:.7534974583167865},{x:.4832278150744524,y:.7456621430561892},{x:.480781209058026,y:.7371866646999369},{x:.48003509769193103,y:.7283967311281571},{x:.48718300813543913,y:.19876859615253395},{x:.10494770632221789,y:.754505330324044},{x:.1022980223560627,y:.75764690179997},{x:.09969080515339464,y:.7608238051533946},{x:.09945603456444842,y:.7610164763964532},{x:.09926022506190729,y:.7612486359882218},{x:.09604856383930557,y:.7638129153509474},{x:.0928716604858821,y:.7664201325536145},{x:.09260381265312083,y:.7665633002029657},{x:.09236647348574781,y:.7667527983743725},{x:.08871625734636118,y:.7686412418060533},{x:.08509175445642904,y:.7705785789630079},{x:.08480112262185491,y:.7706667411661766},{x:.08453137460075086,y:.770806295608766},{x:.08058287930375276,y:.7719463312873718},{x:.07665006449072577,y:.7731393376181454},{x:.07634781747275289,y:.773169106351106},{x:.07605602686309273,y:.7732533540659121},{x:.07196099086840901,y:.7736011710596524},{x:.067871,y:.774004},{x:.06756875298202693,y:.7739742312670393},{x:.06726613313330192,y:.7739999346616289},{x:.06318192637768459,y:.7735421665584931},{x:.05909193550927423,y:.7731393376181454},{x:.05880130367469977,y:.7730511754149765},{x:.05849948409798508,y:.77301734672231},{x:.054583060356599135,y:.7717715852937818},{x:.05065024554357096,y:.7705785789630079},{x:.0503823977108098,y:.7704354113136568},{x:.050092977163175983,y:.7703433505514221},{x:.04649484240404986,y:.768357469710569},{x:.042870339514117915,y:.7664201325536145},{x:.04263556892517204,y:.7662274613105563},{x:.04236966967595597,y:.7660807063222179},{x:.03922809820002561,y:.7634310223560591},{x:.036051194846605364,y:.7608238051533946},{x:.03585852360354703,y:.7605890345644487},{x:.035626364011778155,y:.7603932250619073},{x:.033062084649052234,y:.7571815638393052},{x:.03045486744638546,y:.7540046604858821},{x:.030311699797034096,y:.7537368126531205},{x:.03012220162562753,y:.7534994734857478},{x:.028233758193948882,y:.7498492573463653},{x:.026296421036992097,y:.746224754456429},{x:.026208258833823234,y:.7459341226218545},{x:.026068704391234022,y:.7456643746007509},{x:.02492866871262922,y:.741715879303756},{x:.023735662381854636,y:.7377830644907257},{x:.023705893648893955,y:.7374808174727527},{x:.023621645934087915,y:.7371890268630927},{x:.023273828940347806,y:.7330939908684111},{x:.022871000000000002,y:.729004},{x:.022871000000000002,y:.05103000000000002}]],O:[[{x:.012131736117046842,y:.4355587711738732},{x:.012426138979982786,y:.43287355609157196},{x:.012514983726773468,y:.43017371170811375},{x:.012905745911416293,y:.42849911573111366},{x:.01309315536666239,y:.42678977537085305},{x:.07316415536666239,y:.1412837753708531},{x:.07429915106219231,y:.13768552483470178},{x:.07533122192175289,y:.13405641311271962},{x:.07562440736087628,y:.1334840955199844},{x:.07581784742995093,y:.1328708369543332},{x:.07763301835724021,y:.12956315246900071},{x:.0793532628391043,y:.12620512014747703},{x:.07975246842568721,y:.12570099711853563},{x:.0800618324091279,y:.12513726042963025},{x:.08248742256740031,y:.1222472544549173},{x:.0848297326408542,y:.1192893488327618},{x:.1660597326408542,y:.03517334883276172},{x:.16792084009780786,y:.033590824390739155},{x:.16963596886504836,y:.031851158363102774},{x:.17127304088861567,y:.03074040344046043},{x:.172780173663761,y:.0294588683817891},{x:.1749142556657825,y:.0282698357562587},{x:.17693582072022015,y:.026898201947035502},{x:.17875813439943417,y:.026128166777013812},{x:.18048632312818114,y:.025165283073572443},{x:.1828113681007397,y:.02441543612151622},{x:.18506168183103927,y:.023464545648773483},{x:.2739246818310393,y:-.0041824543512264944},{x:.2748960678404206,y:-.004382857312604547},{x:.27582577451608603,y:-.004728396924478621},{x:.2792086173377598,y:-.005272563034129881},{x:.28256427991205235,y:-.0059648570457577},{x:.28355609768991147,y:-.005971901311054349},{x:.2845353517466465,y:-.006129424701440567},{x:.287959355733624,y:-.0060031749164705245},{x:.2913856000541485,y:-.006027509400590186},{x:.29235973459950004,y:-.005840924262640544},{x:.29335090385307644,y:-.005804377895986514},{x:.3811419038530764,y:.006122622104013507},{x:.38318930529213563,y:.00660893405691686},{x:.3852758334501729,y:.006882342567970358},{x:.387470347489584,y:.0076257947232155985},{x:.38972465411174423,y:.008161252125438313},{x:.3916378405507577,y:.009037647936572414},{x:.39363093730084414,y:.009712864429997858},{x:.3956382440479665,y:.010870159811164118},{x:.3977447722434711,y:.011835121954387393},{x:.39945022100051475,y:.01306792222421872},{x:.4012732927522862,y:.01411899850883961},{x:.4916652927522862,y:.07880999850883955},{x:.49276799959381884,y:.07977586317754862},{x:.49398769122063274,y:.08058901093294302},{x:.4960788615418114,y:.08267585840574071},{x:.4983012083703825,y:.08462241954283417},{x:.4991942961599152,y:.08578485282556958},{x:.5002319144966787,y:.08682032620708877},{x:.5018757798210403,y:.08927504258220473},{x:.5036756696393939,y:.09161775945128844},{x:.5043248175140242,y:.09293208968889465},{x:.5051404874699588,y:.09415009603518716},{x:.5560304874699588,y:.18912209603518723},{x:.5570965448702581,y:.19168827319789875},{x:.5583465570022521,y:.1941700494329812},{x:.5587848767756364,y:.19575236841213633},{x:.559414776433869,y:.19726864147332673},{x:.5599597135111237,y:.1999934877429328},{x:.5607015364856348,y:.20267144261291137},{x:.5892585364856349,y:.36700144261291134},{x:.5895780755292599,y:.371318367211785},{x:.589913428370686,y:.37563409214099147},{x:.5899036127276142,y:.3757163259822715},{x:.58990972616553,y:.3757989176124618},{x:.5893809351459178,y:.38009523269056544},{x:.5888678881103582,y:.38439345626922305},{x:.5314878881103581,y:.6446844562692231},{x:.5303800126922803,y:.6480826863142071},{x:.5293998170293023,y:.651519919480997},{x:.5290148883003433,y:.6522699863013032},{x:.5287535704445262,y:.6530715368858165},{x:.5270040207481954,y:.6561883351212919},{x:.5253720883446767,y:.6593682961290664},{x:.5248482251358019,y:.6600288547560561},{x:.5244355536676654,y:.6607640231862051},{x:.522111563906752,y:.6634796128039058},{x:.5198906090097624,y:.6662800975344761},{x:.4528876090097624,y:.7355630975344761},{x:.4513498405668143,y:.7368687638478525},{x:.44995999895015265,y:.7383308981052339},{x:.44799560298794544,y:.7397167316507253},{x:.4461630292013509,y:.741272707045399},{x:.44440008568631667,y:.7422532816059559},{x:.4427517012434998,y:.743416176715023},{x:.4405546878862334,y:.7443921472166956},{x:.43845377075029196,y:.7455607075703166},{x:.43653340109378364,y:.7461785074476045},{x:.43468982031452474,y:.7469974740014746},{x:.32025082031452473,y:.7849044740014746},{x:.3162756641960007,y:.785800462676764},{x:.3123143949565378,y:.7867559771378485},{x:.3119757732525013,y:.7867696456410259},{x:.3116451697261732,y:.786844162718285},{x:.30757159639863574,y:.7869474207351895},{x:.30350003021295163,y:.7871117699623142},{x:.30316524843732107,y:.7870591140117537},{x:.302826459804451,y:.7870677017158569},{x:.29881101440639224,y:.7863742609266953},{x:.29478561927964103,y:.7857411290712295},{x:.173234619279641,y:.7541621290712296},{x:.17180894449846637,y:.7536379076298808},{x:.17032768986057922,y:.753301394035824},{x:.16767817066393412,y:.7521190197025511},{x:.16495505208167519,y:.7511177274253745},{x:.16365904177145735,y:.7503254433998781},{x:.16227189957151614,y:.7497064173758784},{x:.15990395993272244,y:.7480298664806163},{x:.1574285077432372,y:.7465165596726792},{x:.15631196685338702,y:.745486660093817},{x:.15507224418821702,y:.7446089104628228},{x:.08487024418821705,y:.6837459104628228},{x:.08477922863788438,y:.6836498346778195},{x:.08467166808724909,y:.6835727301071804},{x:.08174665618590948,y:.6804486588585436},{x:.07880340242944883,y:.6773417676286113},{x:.07873287917322891,y:.6772297816598538},{x:.07864242772392874,y:.6771331746094597},{x:.07638309517198695,y:.6734984900001298},{x:.07410251962167697,y:.6698770964908778},{x:.07405519882875666,y:.6697535038963435},{x:.0739853324792622,y:.6696411069209627},{x:.07247850415964274,y:.6656354878421232},{x:.07094824805491862,y:.6616387601752097},{x:.07092594823683183,y:.6615083105489945},{x:.0708793519117729,y:.6613844430013583},{x:.013660351911772894,y:.4476944430013583},{x:.013380528959940628,y:.4459977798389246},{x:.012899536483696877,y:.44434683677239306},{x:.012664423003084308,y:.4416557821956227},{x:.012224847112815455,y:.43899048181468664},{x:.012281403443251489,y:.4372718288093888},{x:.012131736117046842,y:.4355587711738732}],[{x:.10337829031332789,y:.4348001396911351},{x:.15424861715004387,y:.6247803934833692},{x:.2060651876410252,y:.6697037849792326},{x:.3045603004668897,y:.6952928559694175},{x:.3958853477721772,y:.6650421672339206},{x:.4463402797077116,y:.6128703383711886},{x:.499069598507425,y:.373676069990286},{x:.47327322171072966,y:.22523195474705573},{x:.4307624349909165,y:.1458974207255564},{x:.35796896612556683,y:.09380119213930618},{x:.2911281310221294,y:.08472041346861442},{x:.22279798440939425,y:.10597924519162948},{x:.15856873728877424,y:.17249047688925445},{x:.10337829031332789,y:.4348001396911351}]],P:[[{x:.025556999999999996,y:.05103000000000002},{x:.02642166238185463,y:.04225093550927423},{x:.02898242103699209,y:.03380924554357098},{x:.033140867446385454,y:.026029339514117924},{x:.03873719484660536,y:.019210194846605383},{x:.04555633951411791,y:.013613867446385479},{x:.053336245543570956,y:.009455421036992116},{x:.061777935509274226,y:.006894662381854655},{x:.070557,y:.0060300000000000215},{x:.07933606449072576,y:.006894662381854655},{x:.08777775445642903,y:.009455421036992116},{x:.09555766048588209,y:.013613867446385486},{x:.10237680515339463,y:.019210194846605383},{x:.10797313255361454,y:.026029339514117924},{x:.1121315789630079,y:.03380924554357098},{x:.11469233761814536,y:.04225093550927425},{x:.11555699999999999,y:.05103000000000002},{x:.11555699999999999,y:.3249696679740436},{x:.22632413005583354,y:.32573306868659574},{x:.22797244585475993,y:.3259068917113995},{x:.2296296407459454,y:.32587748916779646},{x:.3399906407459454,y:.3347734891677965},{x:.3425199358315593,y:.3352301100895628},{x:.3450781711944775,y:.33547763407671893},{x:.4262801711944775,y:.3514846340767189},{x:.43023360415359113,y:.35267647626036297},{x:.4342017122431381,y:.35381850872164355},{x:.49034871224313803,y:.3761405087216436},{x:.49223471805815816,y:.37711419756221787},{x:.49421014578428074,y:.3778905822551455},{x:.4961445509948513,y:.379132728294546},{x:.49818726580808836,y:.3801873213410173},{x:.49984707528076383,y:.38151024250532195},{x:.5016330805772936,y:.3826570960152846},{x:.5368430805772937,y:.4104950960152846},{x:.538268982488492,y:.41186995272090265},{x:.539835277869678,y:.41308244849417974},{x:.5414366048100854,y:.41492417879038607},{x:.5431934850553138,y:.4166181652891421},{x:.5443237674236908,y:.41824478417169497},{x:.5456234206874699,y:.41973955124896434},{x:.546834674823181,y:.4218582966024136},{x:.5482273167355989,y:.4238624839583804},{x:.5490185434436073,y:.4256783549664296},{x:.5500016096439067,y:.4273979502871872},{x:.5725636096439066,y:.4777629502871872},{x:.5732747072201834,y:.47988746499756846},{x:.5741879174558705,y:.48193325814034926},{x:.5746713208988057,y:.4840600657825243},{x:.5753635933927087,y:.4861283376286891},{x:.5756465551694752,y:.4883507586397718},{x:.5761431038835471,y:.49053540091990977},{x:.5762022992770958,y:.49271564988294925},{x:.5764777701286589,y:.49487923612929946},{x:.5763217220435205,y:.4971141570479765},{x:.5763825271473633,y:.4993536938878067},{x:.5706825271473633,y:.5794656938878067},{x:.5700654182420953,y:.5830779192715516},{x:.5695689975224034,y:.5867086990904052},{x:.5693236589408173,y:.5874197813867033},{x:.5691969863455608,y:.5881612549906394},{x:.5678870248015591,y:.5915836805014664},{x:.5666918126627678,y:.5950478490261242},{x:.5415328126627678,y:.6498468490261241},{x:.5413708296623262,y:.6501242105110185},{x:.5412617638147841,y:.650426323944409},{x:.5391478795722351,y:.653930540410781},{x:.5370840246571379,y:.6574644536133865},{x:.536871043573226,y:.6577048843594048},{x:.5367051339883567,y:.6579799150765678},{x:.5339482287199508,y:.661004400648547},{x:.5312345979336611,y:.6640677725799057},{x:.5309788035098929,y:.664262032968313},{x:.5307624259999995,y:.6644994116930277},{x:.47414742599999943,y:.7155204116930277},{x:.47266946719886654,y:.7166100541651699},{x:.4713261182021025,y:.7178618913781634},{x:.46912758296129603,y:.7192213498885075},{x:.46704701478499566,y:.7207552731949938},{x:.4653848758470294,y:.7215356430341334},{x:.4638231175995642,y:.7225013521577397},{x:.4283261175995643,y:.7398953521577398},{x:.4243082080780145,y:.7413960258251278},{x:.4202985181688539,y:.7429185254841078},{x:.34090751816885384,y:.7644395254841077},{x:.3408415384597873,y:.7644506164558663},{x:.3407789202555512,y:.7644741810938074},{x:.33649241770984384,y:.7651816893280429},{x:.33220802793590354,y:.7659018811363755},{x:.33214115226719376,y:.7658998869955335},{x:.33207514002138977,y:.7659107826399355},{x:.2099811400213898,y:.7739077826399355},{x:.20641155146718015,y:.773790767187745},{x:.20284008504333162,y:.7738075792583221},{x:.0663570850433316,y:.7610135792583221},{x:.06408313636872824,y:.7605723800858132},{x:.061777935509274226,y:.7603453376181454},{x:.05976354040438703,y:.759734277543603},{x:.05769704052657306,y:.7593333282846051},{x:.05555285882676713,y:.7584569812513055},{x:.053336245543570956,y:.7577845789630079},{x:.05147976838249502,y:.7567922712467745},{x:.04953119704042999,y:.7559958719887517},{x:.04759918201567506,y:.7547180546196904},{x:.04555633951411791,y:.7536261325536145},{x:.043929123673028744,y:.7522907110247322},{x:.04217336337061703,y:.7511294669445447},{x:.04052776127482757,y:.7494992850446065},{x:.03873719484660536,y:.7480298051533947},{x:.037401773317722896,y:.7464025893123053},{x:.03590629693874444,y:.7449211263687215},{x:.034610347337597366,y:.7430012269141045},{x:.033140867446385454,y:.7412106604858821},{x:.032148559730151835,y:.7393541833248057},{x:.030970837593177758,y:.7376094333079335},{x:.030074343103068113,y:.7354735969579864},{x:.02898242103699209,y:.733430754456429},{x:.028371360962449563,y:.7314163593515414},{x:.027556652268729623,y:.729475372026062},{x:.027094064670152376,y:.7272056777739226},{x:.02642166238185463,y:.7249890644907258},{x:.02621533264498147,y:.722894163516222},{x:.025794946192721373,y:.7208315299365354},{x:.02578404246766777,y:.7185152008594541},{x:.025556999999999996,y:.71621},{x:.025556999999999996,y:.05103000000000002}],[{x:.11555699999999999,y:.414971805397996},{x:.11555699999999999,y:.6752310456989574},{x:.20767337575712835,y:.6838660911730216},{x:.3217031184787672,y:.6763972896549704},{x:.3925929523867085,y:.6571807523203506},{x:.4185706758911827,y:.6444513238436673},{x:.46361487793542,y:.6038578374443203},{x:.4814895996448674,y:.5649247767123354},{x:.48580725170954087,y:.5042413131675768},{x:.4723746184159119,y:.474255736718963},{x:.45098032059796866,y:.45734081304228297},{x:.40480552914494095,y:.4389833995595593},{x:.3301954695220376,y:.42427584033215343},{x:.22404845814303564,y:.41571952231013837},{x:.11555699999999999,y:.414971805397996}]],Q:[[{x:.012134510452571898,y:.39776120903599943},{x:.012467756958298536,y:.3937322544040442},{x:.012734737801221134,y:.38969836671479857},{x:.012831073490929856,y:.38933975275179394},{x:.012861682585025715,y:.38896968840207613},{x:.0716656825850257,y:.06709568840207614},{x:.07243605319674906,y:.06440524795975149},{x:.07301096718930201,y:.06166637692330789},{x:.07364750148994079,y:.06017438890024393},{x:.07409402290033937,y:.05861495861744442},{x:.07537446994903126,y:.05612650608452361},{x:.07647266436288541,y:.053552421842995857},{x:.07738804025928744,y:.05221328363312273},{x:.0781302116420243,y:.05077092937167972},{x:.07987152826568633,y:.04858009458346291},{x:.08145080010539194,y:.04626971775068952},{x:.16096480010539196,y:-.04855928224931053},{x:.16315500529851779,y:-.05070373085173594},{x:.16521251383898505,y:-.052975804178533654},{x:.1663001767861927,y:-.05378319510572523},{x:.1672680674520078,y:-.05473086511953138},{x:.1698345496348827,y:-.056406820906963286},{x:.172295783242646,y:-.058233836978172464},{x:.17352006120728586,y:-.058813521600477286},{x:.17465423537351554,y:-.059554156299027654},{x:.17749836607515132,y:-.06069721323044178},{x:.18026874092294012,y:-.06200896084304842},{x:.2672567409229401,y:-.09317596084304836},{x:.2695830047845554,y:-.09375972267138269},{x:.2718475349769373,y:-.09454977610873284},{x:.2738508793967248,y:-.09483071995927067},{x:.27581299058749986,y:-.09532309988014809},{x:.2782084422243766,y:-.09544181332278269},{x:.28058359188359605,y:-.09577489818042065},{x:.2826032520283714,y:-.0956596106656824},{x:.28462372036011635,y:-.09575974074040533},{x:.28699630390923414,y:-.09540884370631499},{x:.2893907973658866,y:-.09527215971995788},{x:.3753267973658866,y:-.08182715971995795},{x:.37840631600914065,y:-.08102976437129623},{x:.38152495221950905,y:-.08040256216817918},{x:.38266795913198753,y:-.07992627554804835},{x:.3838666954562622,y:-.07961588068444121},{x:.38673147789694834,y:-.07823302278004476},{x:.38966782930723504,y:-.07700945634885908},{x:.3906959547522998,y:-.07631933185595965},{x:.3918111026603398,y:-.07578103928710583},{x:.3943510569158511,y:-.07386586128072498},{x:.3969922811880835,y:-.07209295159323717},{x:.45217017177581864,y:-.026613783173476364},{x:.5097585536672307,y:-.09873256043298734},{x:.5159122791302333,y:-.10505326271144577},{x:.5231808703268614,y:-.11005198218579294},{x:.5312849993737013,y:-.11353662086994384},{x:.5399132291363312,y:-.11537326605347448},{x:.5487339815837399,y:-.1154913364919842},{x:.5574082801461085,y:-.11388629480473579},{x:.5656027763942881,y:-.11061982184365243},{x:.5730025604329874,y:-.10581744633276943},{x:.5793232627114457,y:-.0996637208697668},{x:.5843219821857929,y:-.09239512967313873},{x:.5878066208699438,y:-.08429100062629874},{x:.5896432660534744,y:-.07566277086366895},{x:.5897613364919841,y:-.06684201841626024},{x:.5881562948047357,y:-.058167719853891554},{x:.5848898218436525,y:-.04997322360571205},{x:.5800874463327694,y:-.042573439567012816},{x:.5106129498444961,y:.04443049374200151},{x:.5474711182959175,y:.12365010382899572},{x:.5481373073434039,y:.1255496832776173},{x:.5490025186311253,y:.12736726941208848},{x:.5495935209593992,y:.1297019482663393},{x:.5503905347901464,y:.13197456307270286},{x:.5506733336355601,y:.13396760967066554},{x:.5511673266667299,y:.13591906574595297},{x:.5791213266667299,y:.32118306574595296},{x:.5792865967797204,y:.3243841932678159},{x:.5796238248970751,y:.32757179562983435},{x:.579513579388425,y:.3287806341158348},{x:.5795761658223595,y:.3299928748079828},{x:.5791137513174164,y:.3331647361616822},{x:.5788226293197903,y:.33635687958013644},{x:.5226546293197903,y:.6297998795801365},{x:.5219105438778229,y:.6323181740447382},{x:.521369234544533,y:.6348876981954499},{x:.5206636104444891,y:.6365383151545928},{x:.5201549436340621,y:.6382598551025291},{x:.5189338607071872,y:.6405845973766512},{x:.5179016631869613,y:.6429991446291672},{x:.5168875780620563,y:.6444803850133782},{x:.5160528293589531,y:.6460696100820955},{x:.5144016744792594,y:.6481114616238732},{x:.5129182555439367,y:.6502782422813739},{x:.4473292555439367,y:.7283852422813738},{x:.4454767413796947,y:.7301964293264013},{x:.4437773055972873,y:.732151966404103},{x:.44233025961343425,y:.7332727172827731},{x:.4410215211764534,y:.7345522595114605},{x:.4388512574885805,y:.735967237520439},{x:.4368029695300015,y:.737553656027496},{x:.4351650804791521,y:.7383705673253327},{x:.43363186277883553,y:.7393702013057781},{x:.431227251583759,y:.7403345934673514},{x:.4289088260065632,y:.7414909282302113},{x:.3168848260065632,y:.7842309282302113},{x:.31544522398579106,y:.7846236280557255},{x:.31406876767085296,y:.7851998529634103},{x:.3111991137964475,y:.7857818972901452},{x:.30837424253549156,y:.7865524758495462},{x:.30688569012846406,y:.7866567776362199},{x:.305423266132861,y:.7869533972381565},{x:.30249520063786056,y:.7869644160479279},{x:.2995742760667897,y:.7871690831124285},{x:.29809397750772,y:.7869809786010931},{x:.2966017859654652,y:.7869865939723252},{x:.2937278327647654,y:.7864261638184524},{x:.2908231043767717,y:.786057054147543},{x:.2894079467091229,y:.7855837720890787},{x:.28794333170435554,y:.785298167434039},{x:.16895933170435556,y:.7496931674340391},{x:.16685145995859063,y:.7488293371508981},{x:.16467103610787698,y:.748169732810473},{x:.1627799564873854,y:.7471607878174731},{x:.16079664289106937,y:.7463480029082842},{x:.1588977982379503,y:.7450895455041626},{x:.15688795304330724,y:.7440172356850165},{x:.15523004539103946,y:.7426587459550258},{x:.15344340707901263,y:.7414746531917952},{x:.15182656105367498,y:.739869930478983},{x:.1500645317387979,y:.7384261234461069},{x:.08134353173879794,y:.6698101234461069},{x:.07898814712174665,y:.6669445493412297},{x:.07654417665723892,y:.6641541443502993},{x:.0761910053095167,y:.6635415309608049},{x:.07574199244846258,y:.6629952594015535},{x:.07399091166125166,y:.6597252337561722},{x:.07213828241215867,y:.6565116506297859},{x:.07191141209628055,y:.6558419081228384},{x:.07157759918584938,y:.6552185349547689},{x:.07049811528111428,y:.6516697230205841},{x:.06930802275051184,y:.6481564579560907},{x:.013298022750511833,y:.4072474579560906},{x:.013249789700227431,y:.40687927578320093},{x:.013136451320225305,y:.40652566731159423},{x:.012677284531251238,y:.4025091147450468},{x:.012152162963867598,y:.3985006516980174},{x:.01217668547678935,y:.39813013424102855},{x:.012134510452571898,y:.39776120903599943}],[{x:.1030741934540208,y:.3959601630333355},{x:.15405220468618464,y:.6152256818322884},{x:.20562817178182732,y:.6667228451191239},{x:.2990925609035841,y:.6946913078929434},{x:.38591644511804135,y:.6615657918309754},{x:.4364618489221904,y:.6013735361946543},{x:.4889800495366121,y:.3269984766785998},{x:.4631403994395801,y:.1557472448128009},{x:.4478929247459949,y:.12297570323093639},{x:.3763894463327694,y:.21252056043298723},{x:.3702357208697667,y:.2188412627114457},{x:.36296712967313866,y:.22383998218579282},{x:.35486300062629866,y:.22732462086994373},{x:.34623477086366883,y:.22916126605347437},{x:.3374140184162602,y:.2292793364919841},{x:.3287397198538915,y:.22767429480473567},{x:.32054522360571197,y:.22440782184365232},{x:.31314543956701274,y:.21960544633276935},{x:.3068247372885543,y:.2134517208697667},{x:.30182601781420715,y:.20618312967313862},{x:.2983413791300562,y:.19807900062629863},{x:.2965047339465256,y:.18945077086366885},{x:.29638666350801585,y:.18063001841626014},{x:.2979917051952643,y:.17195571985389144},{x:.30125817815634764,y:.16376122360571194},{x:.3060605536672306,y:.1563614395670127},{x:.3960043024488616,y:.04372356068896105},{x:.3492507773512258,y:.005187991106938553},{x:.28681342879982186,y:-.004580559340762309},{x:.22209853619564562,y:.018606191220169738},{x:.15806156000107346,y:.09497717514193305},{x:.1030741934540208,y:.3959601630333355}]],R:[[{x:-.010088,y:.05588800000000005},{x:-.009223337618145366,y:.04710893550927426},{x:-.006662578963007905,y:.03866724554357101},{x:-.0025041325536145423,y:.030887339514117953},{x:.0030921948466053617,y:.024068194846605412},{x:.009911339514117913,y:.018471867446385508},{x:.01769124554357096,y:.014313421036992145},{x:.02613293550927423,y:.011752662381854684},{x:.034912,y:.01088800000000005},{x:.043691064490725774,y:.011752662381854684},{x:.05213275445642904,y:.014313421036992145},{x:.059912660485882105,y:.018471867446385515},{x:.06673180515339464,y:.024068194846605412},{x:.07232813255361453,y:.030887339514117953},{x:.0764865789630079,y:.03866724554357101},{x:.07904733761814536,y:.04710893550927428},{x:.079912,y:.05588800000000005},{x:.079912,y:.36648688236049143},{x:.25933152798675563,y:.3728389247505383},{x:.2598033776805002,y:.3702688775066002},{x:.2630584474090824,y:.36206984491555727},{x:.26785052379396923,y:.35466338703825},{x:.5319365237939692,y:.022999387038250052},{x:.5380814500271169,y:.016670129897313986},{x:.5453430800394999,y:.011661303295187019},{x:.5534423534621115,y:.008165393629206541},{x:.5620680197594453,y:.00631674674730745},{x:.5708885994130244,y:.006186405112428031},{x:.5795651224933998,y:.00777937768050025},{x:.5877641550844427,y:.011034447409082423},{x:.59517061296175,y:.015826523793969254},{x:.601499870102686,y:.021971450027116944},{x:.606508696704813,y:.02923308003949996},{x:.6100046063707935,y:.03733235346211146},{x:.6118532532526926,y:.04595801975944533},{x:.6119835948875719,y:.05477859941302443},{x:.6103906223194997,y:.06345512249339977},{x:.6071355525909176,y:.07165415508444274},{x:.6023434762060308,y:.07906061296174999},{x:.36492288462028066,y:.3772356888373974},{x:.45122307475864126,y:.3907421966461853},{x:.4517263325772421,y:.3908725352482557},{x:.4522445282141884,y:.3909141268943158},{x:.4559919550269364,y:.3919772876167318},{x:.459762859565968,y:.3929539131315124},{x:.46023101962685037,y:.3931799280437793},{x:.4607311441523136,y:.39332181547170203},{x:.5072261441523136,y:.41160281547170213},{x:.5099186672764574,y:.4129799887569096},{x:.5126912264123276,y:.4141879634543456},{x:.5138373975854011,y:.41498434320238026},{x:.5150799754049854,y:.4156198976243936},{x:.5174520892726079,y:.41749589411441484},{x:.5199357102894067,y:.4192215573713852},{x:.5536387102894067,y:.4479225573713852},{x:.5544422891842978,y:.4487559165260936},{x:.5553578681885658,y:.44946439490120116},{x:.5574982196806069,y:.4519250983842071},{x:.5597619879819907,y:.4542727608851649},{x:.5603875460278954,y:.4552468777427617},{x:.5611473151639865,y:.4561203635073251},{x:.5627664809673836,y:.45895134712470415},{x:.5645287453623273,y:.46169553923588524},{x:.5649522427143585,y:.46277297903182424},{x:.5655270044804562,y:.4637779046177677},{x:.5843050044804562,y:.5056739046177676},{x:.5856980535944053,y:.5098331481877504},{x:.5870956418010017,y:.5139908687307394},{x:.5870987900445207,y:.5140153439302019},{x:.587106627133701,y:.514038743222053},{x:.5876614810321307,y:.5183898384933372},{x:.5882210839336397,y:.522740325535193},{x:.5899430839336397,y:.580600325535193},{x:.589777587866933,y:.5830153029012521},{x:.5898269599494498,y:.5854354407122341},{x:.5894767504310368,y:.5874052295805413},{x:.5893399666658296,y:.589401226848592},{x:.5887065118476329,y:.5917375144207835},{x:.5882827897945603,y:.5941207819778186},{x:.5699357897945603,y:.6593647819778187},{x:.5695566600666073,y:.6603356321127045},{x:.5693270257483343,y:.6613522723710545},{x:.5679549854437747,y:.6644370937206254},{x:.5667268644118839,y:.6675819841936177},{x:.5661656160899001,y:.668460215174679},{x:.5657420574552864,y:.6694125215424361},{x:.5637945617300048,y:.6721703971299327},{x:.5619765010042908,y:.6750152648867381},{x:.5612547025465381,y:.6757671267898905},{x:.5606534967163777,y:.6766185026674012},{x:.5398464967163776,y:.7006785026674012},{x:.5387925287989109,y:.70167944573824},{x:.5378793324857355,y:.7028102896247742},{x:.535601038014175,y:.7047103734673366},{x:.5334498940671065,y:.7067532939324781},{x:.5322209035416287,y:.707529385222465},{x:.5311046373415733,y:.7084603444980107},{x:.5029396373415734,y:.7276033444980106},{x:.49917038563569516,y:.7296565217962586},{x:.49541206095977475,y:.7317296332429761},{x:.4611910609597748,y:.7464366332429762},{x:.457170688924302,y:.7477143925092122},{x:.45316143447737084,y:.7490266191763204},{x:.37177643447737085,y:.7670666191763205},{x:.36787988134157384,y:.7675363076101905},{x:.36399443936523473,y:.7680904503837813},{x:.2290834393652347,y:.7739614503837813},{x:.2260604581328276,y:.7737959747883908},{x:.2230330269857825,y:.7738173839936113},{x:.030818026985782503,y:.7562573839936113},{x:.028490934977474184,y:.7558115802948838},{x:.02613293550927423,y:.7555793376181453},{x:.024169339379190496,y:.7549836872441402},{x:.022154034015341384,y:.7545976128723226},{x:.01995862841458906,y:.7537063820373993},{x:.01769124554357096,y:.7530185789630078},{x:.01588158498580211,y:.7520512952425895},{x:.013980322522940947,y:.7512794726091756},{x:.012000971535783972,y:.7499770641392344},{x:.009911339514117913,y:.7488601325536145},{x:.008325158769029223,y:.7475583876576994},{x:.006611003657363959,y:.7464304774736483},{x:.004923772632206568,y:.7447669421957904},{x:.0030921948466053617,y:.7432638051533946},{x:.0017904499506900475,y:.7416776244083056},{x:.0003292762098528329,y:.7402369716294513},{x:-.001000995511218774,y:.7382762382714833},{x:-.0025041325536145423,y:.7364446604858821},{x:-.0034714162740331275,y:.7346349999281129},{x:-.004623456556617868,y:.732936968032819},{x:-.005545647377387794,y:.7307543864780955},{x:-.006662578963007905,y:.728664754456429},{x:-.007258229337013042,y:.7267011583263452},{x:-.008056863899357211,y:.7248110017280808},{x:-.008535534543753812,y:.7224904473617442},{x:-.009223337618145366,y:.7202230644907257},{x:-.009424464135908606,y:.7181809926864091},{x:-.009839001899660749,y:.7161713490432334},{x:-.009855757323261527,y:.7138019994682},{x:-.010088,y:.711444},{x:-.010088,y:.05588800000000005}],[{x:.079912,y:.45654326739466394},{x:.079912,y:.6703676283824797},{x:.22820062174801237,y:.6839146886946046},{x:.3561457472749752,y:.6783468266821017},{x:.42954781695254723,y:.662076342723345},{x:.4559144639404158,y:.6507448714849071},{x:.47563211893454127,y:.6373433067928232},{x:.48601322722124407,y:.6253391992627579},{x:.4997779385388953,y:.5763903343143285},{x:.4985264355495565,y:.5343392524542002},{x:.48755361344964526,y:.5098575528750181},{x:.467303195590932,y:.4926125823096997},{x:.43241084881177044,y:.4788935374345549},{x:.3509044963348569,y:.4661372945522357},{x:.079912,y:.45654326739466394}]],S:[[{x:.021897597226735628,y:.20918252956592975},{x:.022856530106274857,y:.20041326151782815},{x:.025507836686771486,y:.19199957102060095},{x:.07532383668677148,y:.0752955710206009},{x:.07606476437254353,y:.07394451179196875},{x:.07662717764446286,y:.07250992955787258},{x:.07818101321859919,y:.07008559601860773},{x:.07956562874320691,y:.06756079148160443},{x:.08055589829123208,y:.06638024029801701},{x:.0813873780598424,y:.06508294454561242},{x:.08338432112997196,y:.06300833217803187},{x:.0852348965856767,y:.0608021661408081},{x:.08643645249257384,y:.05983749092219001},{x:.08750504545666679,y:.05872733599970995},{x:.08986835462050304,y:.05708217099364391},{x:.09211377343035676,y:.05527942517977789},{x:.09348044057646428,y:.05456769785378441},{x:.09474508130770348,y:.05368734639231786},{x:.18347008130770348,y:.00406434639231789},{x:.18531117162778632,y:.0032602675504258996},{x:.18705570252460849,y:.0022638899609980986},{x:.18934358471290644,y:.0014991491478438968},{x:.19155425509545604,y:.0005336596975895336},{x:.19351683738147718,y:.0001042099085839361},{x:.19542223123106015,y:-.0005326814704223887},{x:.1978153459361366,y:-.0008363843304376121},{x:.20017189655491793,y:-.0013520417748285815},{x:.2021805498702545,y:-.0013903589963945293},{x:.20417358345551592,y:-.0016432887864569548},{x:.36640558345551594,y:-.006196288786456984},{x:.3683537351453612,y:-.006059465175549666},{x:.37030515940756886,y:-.006136660097762148},{x:.3727431942064551,y:-.005751182385354602},{x:.3752054496398049,y:-.005578251970786187},{x:.37708947517888647,y:-.005063991846688501},{x:.37901846335331396,y:-.004758999502412188},{x:.3813344490261288,y:-.00390529164215812},{x:.3837156558614866,y:-.003255321831637216},{x:.38546315320491126,y:-.002383387922517842},{x:.38729557535780434,y:-.001707928996501587},{x:.5134735753578044,y:.059451071003498376},{x:.5144073364238021,y:.06002293670994077},{x:.5154151369003129,y:.060451046875811966},{x:.5181619939873726,y:.06232241135953579},{x:.5209964106485654,y:.06405830049148753},{x:.5218006642926897,y:.06480134570578519},{x:.5227055800155168,y:.06541784197435321},{x:.5250345719141375,y:.06778913394790613},{x:.5274758708842278,y:.07004463571609586},{x:.5281197100899656,y:.07093030562736781},{x:.5288869656553633,y:.07171149639276676},{x:.5307085905129939,y:.07449158843544039},{x:.5326629540416582,y:.07718002517181716},{x:.5331216364294024,y:.07817428398206286},{x:.5337217466362741,y:.07909014852127505},{x:.5349660004312154,y:.08217220325496363},{x:.5363583234240663,y:.08519025984344057},{x:.5366142220868877,y:.08625489874416871},{x:.5370241250365293,y:.08727024089657527},{x:.5783351250365293,y:.22800124089657534},{x:.5784689928995229,y:.22870739358153944},{x:.5787167010683089,y:.22938208824013706},{x:.5792894483007394,y:.23303529403132756},{x:.5799781923062021,y:.23666841715613338},{x:.579971724381043,y:.23738711763976203},{x:.5800830465086156,y:.23809717369609615},{x:.5799320834693805,y:.24179192160438975},{x:.5798988062915618,y:.2454896025769029},{x:.5797522511369868,y:.24619323160266243},{x:.5797229091764134,y:.2469113620006918},{x:.5788540372904492,y:.2505056649360105},{x:.5781000177526308,y:.2541258039501414},{x:.5778190074010411,y:.2547873214491718},{x:.5776501289474114,y:.2554859288404322},{x:.5462891289474114,y:.3454679288404322},{x:.5453940585085517,y:.34740151578805634},{x:.5446999978282894,y:.3494160105998292},{x:.5435456407901493,y:.3513945829466735},{x:.5425833616033817,y:.3534733584203385},{x:.5413282655917657,y:.35519517245680393},{x:.5402545326513293,y:.3570355547940282},{x:.5387363559437135,y:.3587509055417339},{x:.537387017705137,y:.36060200657115166},{x:.5358201287566253,y:.36204587934864135},{x:.5344079865107593,y:.36364142435019586},{x:.5325843328131388,y:.3650276335315076},{x:.5308997898345437,y:.36657992334222783},{x:.5290813226127058,y:.36769036763963614},{x:.5273850388959807,y:.368979759405903},{x:.44286903889598056,y:.42100375940590296},{x:.4391930936098881,y:.42279580082266366},{x:.4355432374645799,y:.42464039733796655},{x:.4352309585303121,y:.42472736117212373},{x:.4349395777453148,y:.4248694107387315},{x:.430984654780085,y:.42590987723258605},{x:.42704506666901776,y:.42700697873237736},{x:.18802361397643091,y:.46887992641475673},{x:.1445277950559712,y:.506325930968192},{x:.1345999941059918,y:.5433489412625321},{x:.1668438673565076,y:.6442112383308392},{x:.2418447705661005,y:.6964178007533797},{x:.3847076342900009,y:.6886954406015322},{x:.4475324208368403,y:.608018765726417},{x:.4536085342974724,y:.6016234190133417},{x:.4608155671913789,y:.5965363480257236},{x:.46887655728619765,y:.5929530460487544},{x:.47748172525324006,y:.5910112173678703},{x:.48630037931336645,y:.5907854853702875},{x:.49499362353660437,y:.5922845248100812},{x:.5032273814226823,y:.5954507284422511},{x:.5106852342735829,y:.6001624208368403},{x:.5170805809866582,y:.6062385342974724},{x:.5221676519742764,y:.6134455671913789},{x:.5257509539512455,y:.6215065572861976},{x:.5276927826321296,y:.63011172525324},{x:.5279185146297124,y:.6389303793133664},{x:.5264194751899187,y:.6476236235366044},{x:.5232532715577489,y:.6558573814226824},{x:.5185415791631597,y:.663315234273583},{x:.4431175791631597,y:.760171234273583},{x:.4420344490669973,y:.7613112710002186},{x:.44110391182703096,y:.7625789282836855},{x:.4390031114098716,y:.7645018722698176},{x:.4370414657025276,y:.7665665809866583},{x:.43575673751534005,y:.767473404028016},{x:.4345967726198766,y:.768535164822443},{x:.4321611907321885,y:.7700113141492059},{x:.4298344328086211,y:.7716536519742764},{x:.42839747791415833,y:.7722924126294288},{x:.42705266216361437,y:.7731074740629288},{x:.4243758968514515,y:.7740801011395291},{x:.42177344271380235,y:.7752369539512456},{x:.4202394824828045,y:.7755831050064366},{x:.4187614963922926,y:.7761201447252115},{x:.4159464142454535,y:.7765518720385514},{x:.41316827474676,y:.7771787826321297},{x:.4115962584106506,y:.7772190216964318},{x:.4100419001567639,y:.7774574015652649},{x:.23125890015676387,y:.7871214015652648},{x:.22961427991333744,y:.7870487065186679},{x:.22797320559841586,y:.7871788426312305},{x:.22521775007366066,y:.7868543723294609},{x:.22244596265035355,y:.7867318545526676},{x:.22084712542379714,y:.7863397068281228},{x:.21921219559556868,y:.7861471846952227},{x:.21657298639174055,y:.7852913862936938},{x:.21387836011908076,y:.7846304737606538},{x:.21238674832737245,y:.7839339433752962},{x:.2108207924222569,y:.7834261615145331},{x:.2083992528689725,y:.782071922865878},{x:.2058853407234555,y:.7808980140745921},{x:.20455827617124617,y:.7799238683005129},{x:.20312147299647784,y:.7791203404840283},{x:.10291447299647782,y:.7093683404840284},{x:.10181255131472464,y:.7084283417469311},{x:.10059641238964509,y:.7076416809983432},{x:.09846400643554813,y:.7055718520256913},{x:.09620311784593605,y:.7036431918911783},{x:.09530575393663021,y:.7025062807105057},{x:.09426645267874648,y:.7014974784931097},{x:.09257882390791694,y:.6990514089395268},{x:.09073764058529563,y:.6967187299857058},{x:.09007931964022471,y:.6954285972205445},{x:.08925679581402991,y:.6942364212378118},{x:.08807879885369768,y:.6915081121844703},{x:.08672807644060793,y:.6888610579553555},{x:.08633409736450004,y:.6874672826843552},{x:.08575996009935855,y:.6861375475907227},{x:.04484896009935855,y:.5581635475907226},{x:.04400698871411546,y:.5542371548008082},{x:.04309586967447821,y:.5503262293029391},{x:.04308290316808571,y:.5499278363503387},{x:.04299932697019912,y:.5495380927241992},{x:.04293953506277818,y:.5455228840020936},{x:.042808906634767226,y:.5415093553341928},{x:.04287391188557095,y:.5411160877505585},{x:.04286797679041901,y:.5407175280315513},{x:.04359266213029085,y:.5367678055966908},{x:.04424754429113727,y:.532805911414652},{x:.06119154429113727,y:.4696179114146519},{x:.06126294463056804,y:.4694283141856516},{x:.06129777501412092,y:.46922873472253734},{x:.06281676603792068,y:.46530228011432895},{x:.0643004966052513,y:.46136236601319713},{x:.0644075135916399,y:.46119034135699993},{x:.06448061074086608,y:.46100139182805006},{x:.06673642807197144,y:.45744672339211917},{x:.06896028828319853,y:.453871975109843},{x:.06909880931377366,y:.45372413383751425},{x:.06920736414622189,y:.4535530754671619},{x:.07211331798967527,y:.4505067971180214},{x:.07499184614403663,y:.4474345902263458},{x:.07515654793327702,y:.4473166137950705},{x:.07529638874761438,y:.44717002026055797},{x:.1386943887476144,y:.392590020260558},{x:.14135607757337018,y:.39071931904916735},{x:.1439175788350931,y:.3887136217356019},{x:.14495796828078528,y:.38818782053421796},{x:.14591168674437638,y:.38751752344016943},{x:.1488871876674173,y:.38620203695812855},{x:.15179076253542007,y:.38473460266203335},{x:.15291373991533655,y:.3844218744952798},{x:.15397990142199966,y:.3839505182141148},{x:.15715486761053352,y:.383240799869195},{x:.1602889333309822,y:.3823680212676226},{x:.4030282434963717,y:.3398437611206276},{x:.46657219784598525,y:.30072914754350266},{x:.487912612564808,y:.23949853636308405},{x:.45628203537627,y:.13174508671722343},{x:.35793695341674575,y:.08407681754539842},{x:.21775140382412592,y:.0880110894972649},{x:.15207256592030022,y:.12474460286217379},{x:.10828216331322851,y:.2273324289793991},{x:.10404037125679308,y:.23506720851839558},{x:.09837110341432329,y:.2418258338591919},{x:.09149222656964323,y:.24734857482022213},{x:.08366809210217534,y:.25142319556354265},{x:.07519937711167927,y:.2538931106990613},{x:.06641152956592972,y:.2546634027732644},{x:.05764226151782814,y:.2537044698937252},{x:.04922857102060091,y:.2510531633132285},{x:.04149379148160447,y:.24681137125679312},{x:.034735166140808106,y:.24114210341432332},{x:.029212425179777887,y:.23426322656964324},{x:.025137804436457384,y:.22643909210217536},{x:.022667889300938757,y:.21797037711167933},{x:.021897597226735628,y:.20918252956592975}]],T:[[{x:-.022050999999999998,y:.729004},{x:-.021186337618145364,y:.7202249355092742},{x:-.018625578963007903,y:.711783245543571},{x:-.01446713255361454,y:.7040033395141179},{x:-.008870805153394636,y:.6971841948466053},{x:-.002051660485882085,y:.6915878674463855},{x:.005728245543570962,y:.6874294210369921},{x:.014169935509274232,y:.6848686623818546},{x:.022949,y:.684004},{x:.264284,y:.684004},{x:.264284,y:.05103000000000002},{x:.26514866238185464,y:.04225093550927423},{x:.2677094210369921,y:.03380924554357098},{x:.27186786744638547,y:.026029339514117924},{x:.27746419484660534,y:.019210194846605383},{x:.28428333951411794,y:.013613867446385479},{x:.292063245543571,y:.009455421036992116},{x:.30050493550927426,y:.006894662381854655},{x:.309284,y:.0060300000000000215},{x:.3180630644907258,y:.006894662381854655},{x:.32650475445642907,y:.009455421036992116},{x:.3342846604858821,y:.013613867446385486},{x:.34110380515339467,y:.019210194846605383},{x:.34670013255361454,y:.026029339514117924},{x:.3508585789630079,y:.03380924554357098},{x:.35341933761814537,y:.04225093550927425},{x:.354284,y:.05103000000000002},{x:.354284,y:.684004},{x:.579103,y:.684004},{x:.5878820644907258,y:.6848686623818546},{x:.596323754456429,y:.6874294210369921},{x:.6041036604858822,y:.6915878674463855},{x:.6109228051533947,y:.6971841948466053},{x:.6165191325536146,y:.7040033395141179},{x:.6206775789630079,y:.711783245543571},{x:.6232383376181454,y:.7202249355092742},{x:.6241030000000001,y:.729004},{x:.6232383376181454,y:.7377830644907257},{x:.6206775789630079,y:.746224754456429},{x:.6165191325536146,y:.7540046604858821},{x:.6109228051533947,y:.7608238051533946},{x:.6041036604858822,y:.7664201325536145},{x:.596323754456429,y:.7705785789630079},{x:.5878820644907258,y:.7731393376181454},{x:.579103,y:.774004},{x:.022949,y:.774004},{x:.014169935509274211,y:.7731393376181454},{x:.005728245543570935,y:.7705785789630079},{x:-.0020516604858820953,y:.7664201325536145},{x:-.008870805153394643,y:.7608238051533946},{x:-.01446713255361454,y:.7540046604858821},{x:-.018625578963007903,y:.746224754456429},{x:-.021186337618145364,y:.7377830644907257},{x:-.022050999999999998,y:.729004}]],U:[[{x:.027022176378557076,y:.7288780077818786},{x:.02808017637855708,y:.35099900778187865},{x:.02823473618726791,y:.3494735334648019},{x:.028192796744230073,y:.34794082288884604},{x:.035484796744230065,y:.24514582288884607},{x:.03612518708694976,y:.24139252668431194},{x:.03666424897987138,y:.2376233431565944},{x:.055316248979871384,y:.16148034315659432},{x:.05618736340037885,y:.15900518320818077},{x:.05685851158014249,y:.15646848905542057},{x:.057648252259250334,y:.15485425480263812},{x:.058244846291224776,y:.15315910934454152},{x:.0595821022437829,y:.15090145489330362},{x:.06073523897858293,y:.14854443712190207},{x:.09649723897858292,y:.0906284371219021},{x:.09834293286415725,y:.08820732921922435},{x:.10003759110096133,y:.08567820232322114},{x:.10101147458130413,y:.08470684222595504},{x:.10184538199049184,y:.08361295562088691},{x:.10412794610596264,y:.08159844564215248},{x:.10628345014049506,y:.07944852663140606},{x:.15306845014049508,y:.041154526631406},{x:.15518086878702558,y:.03974701384514513},{x:.15716842451696925,y:.03816808161035298},{x:.15884280372557036,y:.03730705230772802},{x:.16040964618671547,y:.03626305906247794},{x:.1627560674239954,y:.03529470367371844},{x:.16501346722603244,y:.034133863066459845},{x:.23490646722603245,y:.006476863066459913},{x:.23625924682734178,y:.006089880823813601},{x:.23754823013535448,y:.005525708919597472},{x:.24049103862888763,y:.004879315347967098},{x:.24338780663402787,y:.004050652809021178},{x:.24479008944495417,y:.003935020529692536},{x:.24616436977860445,y:.0036331571990539033},{x:.3343553697786044,y:-.006825842800946093},{x:.3363658265006992,y:-.006865793301669296},{x:.3383604992721398,y:-.007120376900508131},{x:.34076517153289726,y:-.0069532142518240045},{x:.3431751712391958,y:-.00700110421331946},{x:.3451547915551648,y:-.0066480664270605625},{x:.3471608040448924,y:-.0065086169201366215},{x:.4090588040448924,y:.003962383079863387},{x:.4119620232343868,y:.004752615784895447},{x:.4149089852784979,y:.005359710588792872},{x:.4162090298953196,y:.005908616535408058},{x:.4175706649775032,y:.0062792425557079215},{x:.42026393287145114,y:.0076206811274584655},{x:.4230358315454356,y:.008791034549085273},{x:.4738028315454356,y:.03637303454908527},{x:.4760785863358737,y:.0379161826666043},{x:.4784624107710392,y:.03928649177082543},{x:.47972093897980134,y:.04038599604431689},{x:.48110410464379305,y:.04132389563682743},{x:.48303507818089647,y:.043281370330868374},{x:.4851057640535682,y:.045090410406577325},{x:.5154867640535682,y:.07740541040657731},{x:.5155903820373309,y:.07753992155387555},{x:.5157174079857786,y:.07765259073212467},{x:.5182811318880063,y:.08103290449336144},{x:.5208701788099869,y:.08439386230433626},{x:.5209455639802052,y:.08454600372347547},{x:.521048168494406,y:.08468128952824439},{x:.5340921684944061,y:.10592328952824437},{x:.5341054861393935,y:.10595068243490303},{x:.5341238592672674,y:.10597497562685786},{x:.5360339092314592,y:.10991723311331511},{x:.5379492688231333,y:.11385691363208547},{x:.5379569864823256,y:.11388637833537296},{x:.5379702672090579,y:.11391378915988949},{x:.557924267209058,y:.16807278915988946},{x:.5580810067186996,y:.16867450001810444},{x:.5583366124011981,y:.1692413235937006},{x:.5591915686944892,y:.17293786157308777},{x:.5601479818122073,y:.1766094575809222},{x:.5601843216510317,y:.17723018509512725},{x:.5603244341481242,y:.17783598350956487},{x:.5696394341481241,y:.2495799835095649},{x:.569721927352796,y:.25224539988339456},{x:.5700114646960025,y:.2548963275892337},{x:.5750284646960026,y:.7275053275892338},{x:.5742570402937379,y:.7362930758081182},{x:.5717860339652341,y:.7447614724740409},{x:.5677104050979391,y:.752585081852262},{x:.5621867778235843,y:.7594632470219072},{x:.5554274220406369,y:.7651316439528263},{x:.5476920960011455,y:.7693724393298378},{x:.5392780639467868,y:.7720226617648687},{x:.5305086724107663,y:.7729804646960026},{x:.5217209241918819,y:.7722090402937379},{x:.5132525275259592,y:.7697380339652341},{x:.505428918147738,y:.7656624050979391},{x:.4985507529780929,y:.7601387778235843},{x:.49288235604717384,y:.753379422040637},{x:.48864156067016223,y:.7456440960011456},{x:.48599133823513135,y:.7372300639467868},{x:.4850335353039975,y:.7284606724107663},{x:.48004487037154997,y:.258520878697574},{x:.4717248917269394,y:.19444051929027983},{x:.4550625667192203,y:.14921575933773623},{x:.4467624246683876,y:.135699076001046},{x:.42448554918380393,y:.11200409455592171},{x:.3866565267646711,y:.09145137140181527},{x:.33852910612300163,y:.08330987698295},{x:.2625775703514966,y:.09231733933890664},{x:.20464797458906397,y:.11524036210229632},{x:.16911733402594603,y:.14432255403825953},{x:.14104265103985364,y:.1897890642955865},{x:.12498883901236212,y:.25532548983758135},{x:.11807553704626646,y:.35278200048003916},{x:.11702182362144292,y:.7291299922181214},{x:.11613258476624799,y:.737906601393955},{x:.11354820087598706,y:.7463410885908555},{x:.10936798837422372,y:.7541093211959605},{x:.10375259048311052,y:.7609127703867312},{x:.09691780379445152,y:.7664899834261845},{x:.0891262853276994,y:.770626631144951},{x:.08067745876799748,y:.7731637444910576},{x:.07189600778187862,y:.7740038236214429},{x:.06311939860604492,y:.773114584766248},{x:.05468491140914452,y:.770530200875987},{x:.04691667880403945,y:.7663499883742237},{x:.04011322961326877,y:.7607345904831105},{x:.03453601657381558,y:.7538998037944515},{x:.030399368855048972,y:.7461082853276993},{x:.027862255508942363,y:.7376594587679974},{x:.027022176378557076,y:.7288780077818786}]],V:[[{x:-.017163400590915968,y:.72836062945125},{x:-.016173311217885875,y:.7195948244454146},{x:-.01349212241321528,y:.7111906087794154},{x:.27875887758678475,y:.033216608779415485},{x:.2789749302503264,y:.03282594254600198},{x:.27911899522766415,y:.032403397706182537},{x:.2811076886540147,y:.028969490703698003},{x:.2830281292409603,y:.025496951748158487},{x:.28331624571443165,y:.0251559418405784},{x:.28353997693249255,y:.024769621764193565},{x:.2861603801951793,y:.021789671162821947},{x:.2887213787977949,y:.018758515442121357},{x:.2890704869266977,y:.018480266679882864},{x:.2893652865202418,y:.018145017430816868},{x:.2925166989914198,y:.015733541060992128},{x:.2956198378696305,y:.013260254189586457},{x:.29601652162435305,y:.013055459516578674},{x:.296371060610326,y:.012784164535463174},{x:.29993237527606087,y:.011033834081706148},{x:.30345840254303674,y:.009213463087028258},{x:.303887417589348,y:.00908999264768462},{x:.3042880712333465,y:.00889307764850001},{x:.3081224287682413,y:.00787115732855266},{x:.3119358411735324,y:.006773658047051503},{x:.31238070070379703,y:.0067362567411129665},{x:.3128120721109714,y:.0066212890568466964},{x:.3167721203052928,y:.006367050695504971},{x:.32072637054875,y:.006034599409084053},{x:.3211699788607,y:.006084704547762943},{x:.3216154906697884,y:.006056102322046737},{x:.325549047092249,y:.006579316156958459},{x:.3294921755545854,y:.0070246887821141385},{x:.32991748502957097,y:.007160374853030322},{x:.330360016471596,y:.007219237253358143},{x:.3341159167548444,y:.008499796470269213},{x:.33789639122058457,y:.00970587758678474},{x:.33828705745399834,y:.009921930250326543},{x:.33870960229381747,y:.01006599522766418},{x:.3421435092963017,y:.012054688654014527},{x:.34561604825184156,y:.013975129240960359},{x:.3459570581594215,y:.014263245714431577},{x:.34634337823580646,y:.014486976932492547},{x:.34932332883717915,y:.01710738019518028},{x:.35235448455787866,y:.01966837879779494},{x:.3526327333201171,y:.020017486926697612},{x:.35296798256918316,y:.020312286520241793},{x:.3553794589390082,y:.023463698991420194},{x:.3578527458104136,y:.026566837869630475},{x:.3580575404834214,y:.026963521624353053},{x:.35832883546453687,y:.02731806061032596},{x:.3600791659182934,y:.03087937527605991},{x:.3618995369129718,y:.03440540254303673},{x:.3620230073523154,y:.034834417589348},{x:.3622199223515,y:.0352350712333465},{x:.6163569223515,y:.7132090712333464},{x:.6186287109431533,y:.7217330721109714},{x:.6191938976779532,y:.7305364906697883},{x:.6180307627466418,y:.7392810164715959},{x:.6151840047723358,y:.7476306022938175},{x:.6107630230675074,y:.7552643782358064},{x:.6049377134797582,y:.7618889825691831},{x:.597931939389674,y:.7672498354645368},{x:.5900149287666535,y:.7711409223515},{x:.5814909278890286,y:.7734127109431533},{x:.5726875093302116,y:.7739778976779532},{x:.5639429835284039,y:.7728147627466418},{x:.5555933977061824,y:.7699680047723358},{x:.5479596217641935,y:.7655470230675074},{x:.5413350174308168,y:.7597217134797583},{x:.5359741645354631,y:.7527159393896741},{x:.5320830776484999,y:.7447989287666535},{x:.3171703309688009,y:.17146543337864517},{x:.06915612241321528,y:.7468173912205845},{x:.06488687075903964,y:.7545370482518415},{x:.059193621202205074,y:.7612754845578786},{x:.05229516213036956,y:.7667737458104136},{x:.04445659745696326,y:.7708205369129717},{x:.0359791588264676,y:.7732603419529485},{x:.027188629451250054,y:.773999400590916},{x:.01842282444541461,y:.7730093112178859},{x:.010018608779415478,y:.7703281224132152},{x:.0022989517481584835,y:.7660588707590397},{x:-.004439484557878664,y:.7603656212022051},{x:-.009937745810413578,y:.7534671621303695},{x:-.013984536912971763,y:.7456285974569633},{x:-.016424341952948517,y:.7371511588264675},{x:-.017163400590915968,y:.72836062945125}]],W:[[{x:-.04486424190193638,y:.7324968210037928},{x:-.04468360364824366,y:.7236771280279449},{x:.03511539635175633,y:.05429612802794491},{x:.03538914303981033,y:.053053468981350556},{x:.035486899606724354,y:.05178477579191172},{x:.03633616861564037,y:.04875449496443272},{x:.037013200434797444,y:.04568114375463893},{x:.03752411791055629,y:.04451576738270255},{x:.03786750587531561,y:.043290523137271594},{x:.039291634880795206,y:.040484152470619886},{x:.040555238800576446,y:.03760193719815913},{x:.041283692791972554,y:.036558628261303676},{x:.041859515947665654,y:.035423918409107566},{x:.04380377647068911,y:.032949305154171604},{x:.045605392901094464,y:.030368987735599786},{x:.046523389329760155,y:.02948784001117424},{x:.047309519115439125,y:.028487270815480248},{x:.049699194314460494,y:.02643951297186818},{x:.05196958814642765,y:.024260253558522238},{x:.05304184892442764,y:.02357512905942291},{x:.054008074813295476,y:.022747151833295932},{x:.056751330810561565,y:.021204943586542027},{x:.059403252082379655,y:.019510489895534},{x:.060588570829346225,y:.019047717572039012},{x:.06169776130235942,y:.01842415101594414},{x:.06468917630833097,y:.01744675856409077},{x:.06762071317273859,y:.01630222750050557},{x:.06887353875396018,y:.016079591433481148},{x:.07008306824328207,y:.01568439886046892},{x:.07320768385688461,y:.015309382847312772},{x:.07630617899620724,y:.014758758098063603},{x:.07757836602719018,y:.014784814066709744},{x:.07884175299285809,y:.014633182505734484},{x:.08197949198836539,y:.014874954586349768},{x:.08512587197205507,y:.014939396351756326},{x:.08636853101864941,y:.015213143039810315},{x:.08763722420808827,y:.015310899606724347},{x:.09066750503556728,y:.016160168615640357},{x:.09374085624536103,y:.01683720043479743},{x:.09490623261729739,y:.017348117910556266},{x:.09613147686272838,y:.017691505875315594},{x:.09893784752938008,y:.01911563488079519},{x:.10182006280184085,y:.020379238800576432},{x:.10286337173869634,y:.02110769279197256},{x:.1039980815908924,y:.02168351594766564},{x:.10647269484582828,y:.023627776470689026},{x:.1090530122644002,y:.025429392901094458},{x:.10993415998882576,y:.026347389329760156},{x:.11093472918451973,y:.02713351911543911},{x:.11298248702813177,y:.02952319431446044},{x:.11516174644147774,y:.03179358814642764},{x:.11584687094057705,y:.032865848924427614},{x:.11667484816670405,y:.03383207481329547},{x:.118217056413458,y:.03657533081056164},{x:.11991151010446596,y:.039227252082379635},{x:.12037428242796094,y:.040412570829346184},{x:.12099784898405583,y:.041521761302359406},{x:.2862381791186236,y:.4176126753554925},{x:.4644074439049092,y:.03214939722735514},{x:.46457066699968924,y:.031871550040082325},{x:.46468087848244366,y:.03156873942729889},{x:.4668033610072479,y:.028070937443703255},{x:.4688757411162635,y:.024543219843286366},{x:.46909003322228215,y:.024302554657928657},{x:.4692572024422568,y:.02402706365982141},{x:.47202128937582516,y:.021010546759784428},{x:.47474207284479647,y:.017954914566682648},{x:.47499919883659564,y:.017760680011347015},{x:.4752169015744166,y:.01752309559247584},{x:.47851637060601154,y:.015103786828781735},{x:.4817809992520572,y:.012637666274559728},{x:.4820710779219699,y:.012497326674279732},{x:.48233094798351184,y:.012306779070622963},{x:.4860390023686124,y:.010577651122297159},{x:.4897220183436901,y:.008795813836836655},{x:.4900339021311097,y:.008714762363747632},{x:.4903259528556443,y:.008578574212853553},{x:.49430009414373083,y:.007606076497244536},{x:.4982599612093785,y:.006576997488159493},{x:.4985816645952609,y:.006558348904918078},{x:.4988946726372282,y:.006481753841050326},{x:.5029821768073245,y:.006303258899985619},{x:.5070667194929276,y:.00606648509648134},{x:.5073858795965667,y:.006110956057683261},{x:.5077078162324508,y:.006096897586191266},{x:.5117516027915979,y:.006719264880154805},{x:.5158038544123874,y:.0072838953667157535},{x:.5161082060899873,y:.007389776878261636},{x:.5164266994754154,y:.007438795258320738},{x:.5202713679739276,y:.008838107561233023},{x:.5241356027726449,y:.01018244390490916},{x:.524413449959918,y:.010345666999689355},{x:.5247162605727012,y:.010455878482443691},{x:.5282140625562944,y:.012578361007246536},{x:.5317417801567137,y:.014650741116263542},{x:.5319824453420714,y:.01486503322228222},{x:.5322579363401786,y:.01503220244225683},{x:.535274453240215,y:.01779628937582467},{x:.5383300854333174,y:.020517072844796484},{x:.5385243199886531,y:.020774198836595797},{x:.5387619044075241,y:.0209919015744166},{x:.5411812131712181,y:.024291370606011366},{x:.5436473337254403,y:.027555999252057217},{x:.5437876733257202,y:.027846077921969747},{x:.5439782209293771,y:.028105947983511865},{x:.5457073488777034,y:.03181400236861376},{x:.5474891861631633,y:.0354970183436901},{x:.5475702376362523,y:.03580890213110964},{x:.5477064257871465,y:.03610095285564429},{x:.548678923502756,y:.040075094143733274},{x:.5497080025118405,y:.04403496120937851},{x:.5497266510950819,y:.04435666459526063},{x:.5498032461589497,y:.04466967263722821},{x:.6466002461589497,y:.7226436726372282},{x:.6469851024138088,y:.7314568162324507},{x:.6456432047416794,y:.7401756994754154},{x:.6426261215175564,y:.7484652605727011},{x:.6380497975577433,y:.7560069363401786},{x:.6320900984255835,y:.7625109044075241},{x:.6249760520164882,y:.7677272209293771},{x:.6169810471443558,y:.7714554257871464},{x:.6084123273627718,y:.7735522461589497},{x:.5995991837675493,y:.7739371024138088},{x:.5908803005245846,y:.7725952047416793},{x:.5825907394272989,y:.7695781215175563},{x:.5750490636598214,y:.7650017975577432},{x:.5685450955924759,y:.7590420984255835},{x:.563328779070623,y:.7519280520164882},{x:.5596005742128536,y:.7439330471443557},{x:.5575037538410503,y:.7353643273627718},{x:.4822251865940539,y:.2081071670095049},{x:.3260455560950909,y:.5459966027726448},{x:.3245096626856286,y:.5486110836728201},{x:.32313748405233433,y:.5513150815908924},{x:.32228015650766817,y:.5524062697730983},{x:.32157725888373645,y:.5536027801567136},{x:.3195608173147473,y:.5558673865996665},{x:.3176874808845609,y:.5582517291845196},{x:.31663374639442166,y:.5591546941850146},{x:.31571092715520355,y:.5601910854333173},{x:.3132914281453504,y:.5620187898634509},{x:.3109889251867045,y:.563991848166704},{x:.30977927817660644,y:.5646718895469083},{x:.3086720007479428,y:.5655083337254402},{x:.3059424242873038,y:.566828898486493},{x:.3032992386976406,y:.5683148489840557},{x:.30198016522380455,y:.5687458331350992},{x:.3007309816563099,y:.5693501861631632},{x:.29779622383750376,y:.570112862691949},{x:.29491393175671793,y:.571054601139531},{x:.29353612307299787,y:.5712199655821879},{x:.29219303879062153,y:.5715690025118404},{x:.28916588071079274,y:.5717444815770724},{x:.2861552470071419,y:.5721058174942654},{x:.2847716515285703,y:.5719992073657418},{x:.2833862805070725,y:.5720795149035186},{x:.28038305415357795,y:.5716610529431293},{x:.27735977579191173,y:.5714281003932755},{x:.27602356431680025,y:.5710536126610233},{x:.27464914558761266,y:.5708621046332842},{x:.27178526326499086,y:.5698657829057354},{x:.26886552313727163,y:.5690474941246844},{x:.26762804552325165,y:.5684195201422382},{x:.26631739722735515,y:.5679635560950907},{x:.26370291632718046,y:.5664276626856288},{x:.2609989184091076,y:.5650554840523343},{x:.25990773022690183,y:.5641981565076682},{x:.2587112198432863,y:.5634952588837364},{x:.25644661340033337,y:.5614788173147471},{x:.2540622708154803,y:.5596054808845607},{x:.2531593058149851,y:.5585517463944213},{x:.2521229145666826,y:.5576289271552034},{x:.2502952101365493,y:.5552094281453507},{x:.24832215183329598,y:.5529069251867045},{x:.2476421104530918,y:.5516972781766065},{x:.24680566627455972,y:.5505900007479427},{x:.245485101513507,y:.5478604242873037},{x:.24399915101594416,y:.5452172386976405},{x:.10495542809967917,y:.22875042455884986},{x:.04468360364824366,y:.734330871972055},{x:.04278579956520255,y:.742945856245361},{x:.03924376119942353,y:.7510250628018409},{x:.034193607098905524,y:.7582580122644001},{x:.02782941185357234,y:.7643667464414777},{x:.020395747917620333,y:.7691165101044659},{x:.012178286827261426,y:.7723247724994944},{x:.003492821003792758,y:.7738682419019364},{x:-.00532687197205508,y:.7736876036482436},{x:-.013941856245361059,y:.7717897995652026},{x:-.022021062801840872,y:.7682477611994235},{x:-.029254012264400202,y:.7631976070989055},{x:-.035362746441477744,y:.7568334118535723},{x:-.04011251010446598,y:.7493997479176203},{x:-.04332077249949441,y:.7411822868272614},{x:-.04486424190193638,y:.7324968210037928}]],X:[[{x:-.03582341524240513,y:.7325834270170574},{x:-.035659804156077404,y:.7237634017461555},{x:-.03377863524060577,y:.7151447697271875},{x:-.030252200762440104,y:.7070587401552579},{x:-.02521601962092907,y:.6998160546121182},{x:.24190189785100796,y:.3863717955888736},{x:-.0190039697420246,y:.08021800391719859},{x:-.024040163260448045,y:.07297532698032597},{x:-.027566611556706647,y:.06488930343468059},{x:-.029447795200430175,y:.056270674630427356},{x:-.029611421359170286,y:.047450649639130975},{x:-.028051201971409197,y:.03876817707487998},{x:-.024827095393237467,y:.030556919489131844},{x:-.02006300223235442,y:.02313243090598055},{x:-.013942003917198569,y:.016780030257975413},{x:-.006699326980325947,y:.011743836739551976},{x:.0013866965653194212,y:.00821738844329338},{x:.010005325369572668,y:.006336204799569846},{x:.018825350360869044,y:.0061725786408297345},{x:.02750782292512003,y:.007732798028590823},{x:.03571908051086817,y:.010956904606762553},{x:.04314356909401947,y:.0157209977676456},{x:.049495969742024595,y:.021841996082801452},{x:.3010259353438819,y:.31699385831754345},{x:.5525549803790709,y:.021842054612118165},{x:.558907370566982,y:.01572104544144637},{x:.5663318510088331,y:.010956939592969957},{x:.5745431030849405,y:.007732818982704524},{x:.5832255729829426,y:.006172584757594898},{x:.5920455982538445,y:.006336195843922615},{x:.6006642302728125,y:.008217364759394247},{x:.6087502598447422,y:.011743799237559922},{x:.6159929453878819,y:.016779980379070948},{x:.6221139545585537,y:.023132370566981995},{x:.6268780604070301,y:.03055685100883309},{x:.6301021810172955,y:.0387681030849405},{x:.6316624152424052,y:.04745057298294264},{x:.6314988041560774,y:.05627059825384449},{x:.6296176352406058,y:.06488923027281246},{x:.6260912007624402,y:.07297525984474214},{x:.6210550196209291,y:.08021794538788188},{x:.36015009139561527,y:.3863716945525663},{x:.6272689697420246,y:.6998159960828014},{x:.632305163260448,y:.7070586730196741},{x:.6358316115567066,y:.7151446965653194},{x:.6377127952004301,y:.7237633253695727},{x:.6378764213591702,y:.7325833503608691},{x:.6363162019714091,y:.74126582292512},{x:.6330920953932374,y:.7494770805108681},{x:.6283280022323544,y:.7569015690940195},{x:.6222070039171985,y:.7632539697420246},{x:.6149643269803259,y:.7682901632604481},{x:.6068783034346805,y:.7718166115567067},{x:.5982596746304273,y:.7736977952004301},{x:.5894396496391309,y:.7738614213591702},{x:.58075717707488,y:.7723012019714092},{x:.5725459194891318,y:.7690770953932374},{x:.5651214309059804,y:.7643130022323544},{x:.5587690302579753,y:.7581920039171985},{x:.30102605390274134,y:.4557496318238965},{x:.04328401962092907,y:.7581919453878818},{x:.03693162943301802,y:.7643129545585536},{x:.029507148991166913,y:.76907706040703},{x:.021295896915059523,y:.7723011810172955},{x:.012613427017057378,y:.7738614152424051},{x:.003793401746155514,y:.7736978041560774},{x:-.004825230272812429,y:.7718166352406057},{x:-.012911259844742107,y:.7682902007624401},{x:-.02015394538788185,y:.7632540196209291},{x:-.02627495455855365,y:.756901629433018},{x:-.031039060407030063,y:.7494771489911669},{x:-.034263181017295495,y:.7412658969150595},{x:-.03582341524240513,y:.7325834270170574}]],Y:[[{x:-.02688005049839745,y:.731186349993587},{x:-.02644216088936969,y:.7223756821949907},{x:-.024293809188388457,y:.7138197369324374},{x:-.020517555346512936,y:.7058473143841377},{x:-.015258518681138845,y:.6987647902776368},{x:.25043465103960333,y:.4059541390643743},{x:.26029423204414154,y:.04978477430584237},{x:.26140149479875585,y:.04103299828270508},{x:.26419486861258723,y:.03266540142918031},{x:.26856700569651215,y:.025003545799746604},{x:.27434988727431814,y:.01834187220942495},{x:.28132128045004745,y:.012936385038381841},{x:.28921327849355916,y:.008994814127168342},{x:.2977225963459245,y:.006668631835443931},{x:.30652222569415766,y:.00604723204414153},{x:.3152740017172949,y:.007154494798755871},{x:.32364159857081976,y:.009947868612587236},{x:.3313034542002534,y:.014320005696512164},{x:.3379651277905751,y:.020102887274318144},{x:.3433706149616182,y:.027074280450047443},{x:.3473121858728317,y:.03496627849355913},{x:.3496383681645561,y:.04347559634592452},{x:.3502597679558585,y:.05227522569415767},{x:.34045421751128274,y:.4064927803087797},{x:.6166036868780955,y:.6970396048261934},{x:.6220250193382449,y:.7039986829780357},{x:.6259845336177533,y:.7118816938899454},{x:.6283300678033804,y:.7203856978734211},{x:.6289714843317633,y:.7291838908244783},{x:.6278841339254269,y:.7379381631220915},{x:.6251098028506934,y:.7463120929913156},{x:.620755107094902,y:.7539838750034306},{x:.6149873951738065,y:.7606586868780956},{x:.6080283170219642,y:.7660800193382449},{x:.6001453061100546,y:.7700395336177532},{x:.5916413021265788,y:.7723850678033803},{x:.5828431091755216,y:.7730264843317632},{x:.5740888368779085,y:.7719391339254268},{x:.5657149070086843,y:.7691648028506933},{x:.5580431249965694,y:.7648101070949019},{x:.5513683131219045,y:.7590423951738065},{x:.29567976193894085,y:.4900232412279098},{x:.051392518681138845,y:.7592432097223631},{x:.04485280102201476,y:.765163657957578},{x:.03728372005126494,y:.7696945108160528},{x:.028976151305805796,y:.7726616501633681},{x:.02024934999358704,y:.7739510504983974},{x:.011438682194990706,y:.7735131608893697},{x:.002882736932437466,y:.7713648091883885},{x:-.0050896856158622154,y:.7675885553465129},{x:-.012172209722363214,y:.7623295186811389},{x:-.01809265795757798,y:.7557898010220148},{x:-.022623510816052815,y:.7482207200512649},{x:-.025590650163368103,y:.7399131513058058},{x:-.02688005049839745,y:.731186349993587}]],Z:[[{x:.008711000000000003,y:.05103000000000002},{x:.00905278632815029,y:.04755978517413498},{x:.009251179439517476,y:.04407842782316871},{x:.009484424544736794,y:.043177288815328604},{x:.009575662381854637,y:.04225093550927423},{x:.01058788670939069,y:.038914079093048184},{x:.01146164687940622,y:.0355383196233794},{x:.011866213744552238,y:.0346999996115786},{x:.012136421036992098,y:.03380924554357098},{x:.013780184150668652,y:.030733981057728944},{x:.015295733266009179,y:.0275935480126292},{x:.015856074613338045,y:.026850263164785913},{x:.01629486744638546,y:.026029339514117927},{x:.01850700045157689,y:.023333847648222647},{x:.020606096809669634,y:.02054942610843994},{x:.02130067903544657,y:.01992974044441782},{x:.021891194846605365,y:.019210194846605383},{x:.024586686712500538,y:.016998061841414044},{x:.027188663217490867,y:.014676655565200585},{x:.02799079391630549,y:.014204383257544266},{x:.028710339514117916,y:.013613867446385479},{x:.03178560399995988,y:.01197010433270896},{x:.03479046815396611,y:.010200923661400137},{x:.035669321892902964,y:.00989421387003954},{x:.036490245543570964,y:.009455421036992116},{x:.03982710195979704,y:.008443196709456058},{x:.04311937851852794,y:.007294230264082269},{x:.04404118144126662,y:.007164869674294513},{x:.04493193550927423,y:.006894662381854655},{x:.048402150335139275,y:.006552876053704368},{x:.05185531895677298,y:.006068277970413476},{x:.052784646693945655,y:.006121237837117864},{x:.053711,y:.0060300000000000215},{x:.548341,y:.0060300000000000215},{x:.5571200644907257,y:.006894662381854655},{x:.565561754456429,y:.009455421036992116},{x:.5733416604858821,y:.013613867446385479},{x:.5801608051533946,y:.019210194846605383},{x:.5857571325536145,y:.026029339514117927},{x:.5899155789630078,y:.03380924554357098},{x:.5924763376181453,y:.04225093550927425},{x:.593341,y:.05103000000000002},{x:.5924763376181453,y:.05980906449072579},{x:.5899155789630078,y:.06825075445642906},{x:.5857571325536145,y:.07603066048588211},{x:.5801608051533946,y:.08284980515339466},{x:.5733416604858821,y:.08844613255361455},{x:.565561754456429,y:.09260457896300792},{x:.5571200644907257,y:.09516533761814538},{x:.548341,y:.09603000000000002},{x:.14224494935878249,y:.09603000000000002},{x:.5846943444347994,y:.7024816632174908},{x:.5851666167424556,y:.7032837939163054},{x:.5857571325536145,y:.7040033395141179},{x:.5874008956672913,y:.7070786039999603},{x:.5891700763385999,y:.7100834681539662},{x:.5894767861299605,y:.7109623218929031},{x:.5899155789630078,y:.711783245543571},{x:.5909278032905438,y:.7151201019597967},{x:.5920767697359177,y:.7184123785185279},{x:.5922061303257055,y:.7193341814412667},{x:.5924763376181453,y:.7202249355092742},{x:.5928181239462956,y:.7236951503351391},{x:.5933027220295866,y:.7271483189567729},{x:.5932497621628822,y:.7280776466939456},{x:.593341,y:.729004},{x:.5929992136718496,y:.7324742148258655},{x:.5928008205604824,y:.7359555721768313},{x:.5925675754552632,y:.7368567111846711},{x:.5924763376181453,y:.7377830644907257},{x:.5914641132906093,y:.7411199209069517},{x:.5905903531205937,y:.7444956803766206},{x:.5901857862554476,y:.7453340003884216},{x:.5899155789630078,y:.746224754456429},{x:.5882718158493319,y:.74930001894227},{x:.5867562667339908,y:.7524404519873709},{x:.5861959253866618,y:.7531837368352144},{x:.5857571325536145,y:.7540046604858821},{x:.5835449995484229,y:.7567001523517777},{x:.5814459031903303,y:.7594845738915601},{x:.5807513209645536,y:.760104259555582},{x:.5801608051533946,y:.7608238051533946},{x:.5774653132874991,y:.7630359381585863},{x:.5748633367825091,y:.7653573444347994},{x:.5740612060836946,y:.7658296167424556},{x:.5733416604858821,y:.7664201325536145},{x:.5702663960000408,y:.7680638956672906},{x:.5672615318460339,y:.7698330763385999},{x:.5663826781070966,y:.7701397861299606},{x:.565561754456429,y:.7705785789630079},{x:.5622248980402041,y:.7715908032905435},{x:.558932621481472,y:.7727397697359177},{x:.5580108185587332,y:.7728691303257055},{x:.5571200644907257,y:.7731393376181454},{x:.553649849664861,y:.7734811239462956},{x:.5501966810432269,y:.7739657220295866},{x:.5492673533060543,y:.7739127621628822},{x:.548341,y:.774004},{x:.053711,y:.774004},{x:.04493193550927421,y:.7731393376181454},{x:.036490245543570936,y:.7705785789630079},{x:.028710339514117906,y:.7664201325536145},{x:.021891194846605358,y:.7608238051533946},{x:.01629486744638546,y:.7540046604858821},{x:.012136421036992098,y:.746224754456429},{x:.009575662381854637,y:.7377830644907257},{x:.008711000000000003,y:.729004},{x:.009575662381854637,y:.7202249355092742},{x:.012136421036992098,y:.711783245543571},{x:.01629486744638546,y:.7040033395141179},{x:.021891194846605365,y:.6971841948466053},{x:.028710339514117916,y:.6915878674463855},{x:.036490245543570964,y:.6874294210369921},{x:.04493193550927423,y:.6848686623818546},{x:.053711,y:.684004},{x:.4598070506412174,y:.684004},{x:.017357655565200567,y:.07755233678250915},{x:.016885383257544267,y:.07675020608369457},{x:.01629486744638546,y:.07603066048588211},{x:.014651104332708876,y:.07295539600004002},{x:.012881923661400112,y:.06995053184603389},{x:.012575213870039523,y:.06907167810709706},{x:.012136421036992098,y:.06825075445642906},{x:.011124196709456038,y:.06491389804020298},{x:.00997523026408225,y:.06162162148147208},{x:.009845869674294495,y:.0606998185587334},{x:.009575662381854637,y:.05980906449072579},{x:.009233876053704348,y:.056338849664860746},{x:.008749277970413458,y:.05288568104322705},{x:.008802237837117845,y:.05195635330605437},{x:.008711000000000003,y:.05103000000000002}]],"[":[[{x:.152511,y:-.06942399999999993},{x:.15337566238185463,y:-.0782030644907257},{x:.1559364210369921,y:-.08664475445642897},{x:.16009486744638546,y:-.09442466048588202},{x:.16569119484660536,y:-.10124380515339457},{x:.1725103395141179,y:-.10684013255361446},{x:.18029024554357093,y:-.11099857896300783},{x:.1887319355092742,y:-.1135593376181453},{x:.197511,y:-.11442399999999993},{x:.404542,y:-.11442399999999993},{x:.4133210644907258,y:-.1135593376181453},{x:.4217627544564291,y:-.11099857896300783},{x:.42954266048588213,y:-.10684013255361446},{x:.4363618051533946,y:-.10124380515339457},{x:.44195813255361455,y:-.09442466048588202},{x:.44611657896300794,y:-.08664475445642897},{x:.4486773376181454,y:-.0782030644907257},{x:.449542,y:-.06942399999999993},{x:.4486773376181454,y:-.06064493550927416},{x:.44611657896300794,y:-.05220324554357089},{x:.44195813255361455,y:-.04442333951411784},{x:.4363618051533946,y:-.03760419484660529},{x:.42954266048588213,y:-.032007867446385396},{x:.4217627544564291,y:-.027849421036992027},{x:.4133210644907258,y:-.025288662381854565},{x:.404542,y:-.024423999999999932},{x:.24251099999999998,y:-.024423999999999932},{x:.24251099999999998,y:.7147659999999999},{x:.404542,y:.7147659999999999},{x:.4133210644907258,y:.7156306623818546},{x:.4217627544564291,y:.7181914210369921},{x:.42954266048588213,y:.7223498674463854},{x:.4363618051533946,y:.7279461948466053},{x:.44195813255361455,y:.7347653395141178},{x:.44611657896300794,y:.7425452455435709},{x:.4486773376181454,y:.7509869355092742},{x:.449542,y:.7597659999999999},{x:.4486773376181454,y:.7685450644907257},{x:.44611657896300794,y:.776986754456429},{x:.44195813255361455,y:.7847666604858821},{x:.4363618051533946,y:.7915858051533946},{x:.42954266048588213,y:.7971821325536145},{x:.4217627544564291,y:.8013405789630078},{x:.4133210644907258,y:.8039013376181453},{x:.404542,y:.804766},{x:.197511,y:.804766},{x:.1887319355092742,y:.8039013376181453},{x:.18029024554357093,y:.8013405789630078},{x:.1725103395141179,y:.7971821325536145},{x:.16569119484660536,y:.7915858051533946},{x:.16009486744638546,y:.7847666604858821},{x:.1559364210369921,y:.776986754456429},{x:.15337566238185463,y:.7685450644907257},{x:.152511,y:.7597659999999999},{x:.152511,y:-.06942399999999993}]],"\\\\":[[{x:.017522651058219416,y:.7303997530123288},{x:.018114599516431164,y:.7215980934307649},{x:.020412292453046287,y:.7130810386853763},{x:.024327430817071727,y:.7051758944136092},{x:.5013774308170718,y:-.059077105586390885},{x:.5067595580368128,y:-.06606654912342862},{x:.5134018419815468,y:-.0718716915303336},{x:.521049023404313,y:-.07626944443996993},{x:.5294072254116235,y:-.07909080467430848},{x:.5381552469876711,y:-.08022734894178067},{x:.5469569065692351,y:-.07963540048356893},{x:.5554739613146237,y:-.0773377075469538},{x:.5633791055863908,y:-.07342256918292836},{x:.5703685491234285,y:-.06804044196318723},{x:.5761736915303335,y:-.06139815801845332},{x:.5805714444399699,y:-.05375097659568702},{x:.5833928046743084,y:-.04539277458837649},{x:.5845293489417805,y:-.03664475301232898},{x:.5839374004835688,y:-.02784309343076498},{x:.5816397075469537,y:-.01932603868537643},{x:.5777245691829282,y:-.011420894413609283},{x:.10067456918292828,y:.7528321055863908},{x:.09529244196318712,y:.7598215491234285},{x:.0886501580184532,y:.7656266915303336},{x:.08100297659568693,y:.7700244444399699},{x:.07264477458837638,y:.7728458046743084},{x:.06389675301232887,y:.7739823489417805},{x:.055095093430764894,y:.7733904004835688},{x:.04657803868537634,y:.7710927075469537},{x:.03867289441360919,y:.7671775691829282},{x:.03168345087657147,y:.7617954419631872},{x:.025878308469666468,y:.7551531580184532},{x:.021480555560030153,y:.747505976595687},{x:.01865919532569161,y:.7391477745883763},{x:.017522651058219416,y:.7303997530123288}]],"]":[[{x:.15250999999999998,y:-.06942399999999993},{x:.15337466238185463,y:-.0782030644907257},{x:.1559354210369921,y:-.08664475445642897},{x:.16009386744638546,y:-.09442466048588202},{x:.16569019484660535,y:-.10124380515339457},{x:.1725093395141179,y:-.10684013255361446},{x:.18028924554357095,y:-.11099857896300783},{x:.18873093550927422,y:-.1135593376181453},{x:.19751,y:-.11442399999999993},{x:.404542,y:-.11442399999999993},{x:.4133210644907258,y:-.1135593376181453},{x:.4217627544564291,y:-.11099857896300783},{x:.42954266048588213,y:-.10684013255361446},{x:.4363618051533946,y:-.10124380515339457},{x:.44195813255361455,y:-.09442466048588202},{x:.44611657896300794,y:-.08664475445642897},{x:.4486773376181454,y:-.0782030644907257},{x:.449542,y:-.06942399999999993},{x:.449542,y:.7597659999999999},{x:.4486773376181454,y:.7685450644907257},{x:.44611657896300794,y:.776986754456429},{x:.44195813255361455,y:.7847666604858821},{x:.4363618051533946,y:.7915858051533946},{x:.42954266048588213,y:.7971821325536145},{x:.4217627544564291,y:.8013405789630078},{x:.4133210644907258,y:.8039013376181453},{x:.404542,y:.804766},{x:.19751,y:.804766},{x:.18873093550927422,y:.8039013376181453},{x:.18028924554357095,y:.8013405789630078},{x:.1725093395141179,y:.7971821325536145},{x:.16569019484660535,y:.7915858051533946},{x:.16009386744638546,y:.7847666604858821},{x:.1559354210369921,y:.776986754456429},{x:.15337466238185463,y:.7685450644907257},{x:.15250999999999998,y:.7597659999999999},{x:.15337466238185463,y:.7509869355092742},{x:.1559354210369921,y:.7425452455435709},{x:.16009386744638546,y:.7347653395141178},{x:.16569019484660535,y:.7279461948466053},{x:.1725093395141179,y:.7223498674463854},{x:.18028924554357095,y:.7181914210369921},{x:.18873093550927422,y:.7156306623818546},{x:.19751,y:.7147659999999999},{x:.35954200000000003,y:.7147659999999999},{x:.35954200000000003,y:-.024423999999999932},{x:.19751,y:-.024423999999999932},{x:.18873093550927422,y:-.025288662381854565},{x:.18028924554357095,y:-.027849421036992027},{x:.1725093395141179,y:-.03200786744638539},{x:.16569019484660535,y:-.03760419484660529},{x:.16009386744638546,y:-.04442333951411784},{x:.1559354210369921,y:-.052203245543570885},{x:.15337466238185463,y:-.06064493550927414},{x:.15250999999999998,y:-.06942399999999993}]],"^":[[{x:-.009830024293871129,y:.4771904357900641},{x:-.009184411720694952,y:.46839254975009553},{x:-.006834821991481832,y:.4598896653882279},{x:-.002871548521860348,y:.4520085437820153},{x:.002553102311361327,y:.44505205201500053},{x:.009230664218841726,y:.43928752416454453},{x:.016904522241296224,y:.4349364878031557},{x:.02527977431847106,y:.43216615081811305},{x:.034034564209935884,y:.43108297570612886},{x:.04283245024990444,y:.431728588279305},{x:.05133533461177206,y:.4340781780085181},{x:.05921645621798466,y:.4380414514781396},{x:.06617294798499941,y:.4434661023113613},{x:.30102423332324457,y:.6668931783680099},{x:.5358792969655858,y:.44346586927801307},{x:.5428358294884947,y:.4380412707099504},{x:.5507169808710617,y:.43407805645230807},{x:.5592198828854552,y:.4317285306064111},{x:.5680177737757447,y:.431082984132888},{x:.5767725555289304,y:.4321662250206897},{x:.5851477867919753,y:.43493662492998636},{x:.5928216121243246,y:.439287718945922},{x:.5994991307219868,y:.44505229696558585},{x:.6049237292900496,y:.45200882948849475},{x:.6088869435476919,y:.4598899808710617},{x:.6112364693935889,y:.4683928828854553},{x:.6118820158671119,y:.47719077377574476},{x:.6107987749793102,y:.4859455555289303},{x:.6080283750700135,y:.4943207867919753},{x:.6036772810540779,y:.5019946121243246},{x:.5979127030344141,y:.5086721307219868},{x:.33204070303441413,y:.7616071307219868},{x:.3294429315385385,y:.7636328335402047},{x:.3269493357811583,y:.7657854758354554},{x:.3259710287822201,y:.7663401706594313},{x:.32508417051150523,y:.7670317292900496},{x:.3221411194513825,y:.7685117087189752},{x:.3192754777587038,y:.7701365121968442},{x:.31820775306259985,y:.7704896904878621},{x:.3172030191289383,y:.7709949435476919},{x:.31402778830632944,y:.7718723248078522},{x:.310900225681529,y:.7729068491818869},{x:.30978411534954325,y:.7730449384962876},{x:.3087001171145447,y:.7733444693935889},{x:.30541472886927135,y:.7735855352151975},{x:.30214543579006414,y:.7739900242938711},{x:.3010238313163334,y:.7739077179367437},{x:.2999022262242552,y:.773990015867112},{x:.29663293618411596,y:.7735855022258356},{x:.2933475497500956,y:.7733444117206949},{x:.29226355376554153,y:.7730448726791859},{x:.29114744447106966,y:.7729067749793103},{x:.2880198896188706,y:.7718722271075298},{x:.28484466538822795,y:.7709948219914818},{x:.28383993525062523,y:.7704895613829726},{x:.2827722132080247,y:.7701363750700135},{x:.27990658372278143,y:.7685115500622604},{x:.2769635437820154,y:.7670315485218604},{x:.2760766907070934,y:.7663399832281829},{x:.2750983878756754,y:.765785281054078},{x:.27260480829144085,y:.7636326200241867},{x:.2700070520150006,y:.7616068976886387},{x:.004139052015000585,y:.5086718976886386},{x:-.001625475835455463,y:.5019943357811583},{x:-.0059765121968442594,y:.49432047775870375},{x:-.00874684918188691,y:.4859452256815289},{x:-.009830024293871129,y:.4771904357900641}]],_:[[{x:-.045,y:-.160601},{x:-.044135337618145365,y:-.16938006449072576},{x:-.041574578963007904,y:-.17782175445642903},{x:-.03741613255361454,y:-.1856016604858821},{x:-.03181980515339464,y:-.19242080515339463},{x:-.025000660485882086,y:-.19801713255361453},{x:-.017220754456429038,y:-.2021755789630079},{x:-.008779064490725769,y:-.20473633761814536},{x:0,y:-.20560099999999998},{x:.602052,y:-.20560099999999998},{x:.6108310644907258,y:-.20473633761814536},{x:.619272754456429,y:-.2021755789630079},{x:.6270526604858822,y:-.19801713255361453},{x:.6338718051533947,y:-.19242080515339463},{x:.6394681325536146,y:-.1856016604858821},{x:.6436265789630079,y:-.17782175445642903},{x:.6461873376181454,y:-.16938006449072576},{x:.6470520000000001,y:-.160601},{x:.6461873376181454,y:-.15182193550927423},{x:.6436265789630079,y:-.14338024554357096},{x:.6394681325536146,y:-.1356003395141179},{x:.6338718051533947,y:-.12878119484660536},{x:.6270526604858822,y:-.12318486744638546},{x:.619272754456429,y:-.1190264210369921},{x:.6108310644907258,y:-.11646566238185463},{x:.602052,y:-.115601},{x:0,y:-.115601},{x:-.00877906449072579,y:-.11646566238185463},{x:-.017220754456429066,y:-.1190264210369921},{x:-.025000660485882096,y:-.12318486744638546},{x:-.03181980515339464,y:-.12878119484660536},{x:-.03741613255361454,y:-.1356003395141179},{x:-.041574578963007904,y:-.14338024554357096},{x:-.044135337618145365,y:-.15182193550927423},{x:-.045,y:-.160601}]],a:[[{x:.029951000000000005,y:.25490100000000004},{x:.030216131121475042,y:.2522090785486062},{x:.03027571711850824,y:.2495047884160563},{x:.03064747136410999,y:.24782960757010103},{x:.03081566238185464,y:.24612193550927428},{x:.0316008669059687,y:.24353346308961055},{x:.0321868888075612,y:.2408927597850148},{x:.06949088880756119,y:.12701175978501478},{x:.07014919013856018,y:.12551652306247207},{x:.07061771774296957,y:.1239514111231075},{x:.07192248021942128,y:.12148874987750752},{x:.07304546130734973,y:.1189380599695235},{x:.0739828197765546,y:.11759998201998349},{x:.07474768294666384,y:.11615634846888903},{x:.07650781615341086,y:.11399555310027064},{x:.07810683439013419,y:.11171295672570881},{x:.07928722783725009,y:.11058345913436952},{x:.08031903331037206,y:.10931678199931477},{x:.15605303331037207,y:.033026781999314685},{x:.1581401110567553,y:.03130114899494214},{x:.16009013354595797,y:.02942202284781055},{x:.16153164054777758,y:.028496972085311937},{x:.16285166496406625,y:.027405552418137233},{x:.16523529439528092,y:.026120245637685162},{x:.16751444707429886,y:.024657656887915},{x:.24324744707429888,y:-.014037343112084925},{x:.24491821916217926,y:-.014693433733650136},{x:.24650124554357095,y:-.015539578963007873},{x:.24901423193062222,y:-.016301885049470277},{x:.2514585861893129,y:-.017261751399011975},{x:.25322525179064753,y:-.017579283958613606},{x:.2549429355092742,y:-.018100337618145335},{x:.2575563541074305,y:-.01835773688343746},{x:.2601410014196699,y:-.018822289810772906},{x:.26193566856615697,y:-.018789061710219754},{x:.263722,y:-.018964999999999968},{x:.376759,y:-.018964999999999968},{x:.3786816094876915,y:-.018775639493449434},{x:.3806133727303473,y:-.01879962736385296},{x:.3830607170270406,y:-.018344335046447002},{x:.3855380644907258,y:-.018100337618145335},{x:.3873867891740171,y:-.01753953311656589},{x:.3892861139289994,y:-.017186191753697247},{x:.3915976100664607,y:-.016262194563578608},{x:.3939797544564291,y:-.015539578963007873},{x:.3956835488825182,y:-.014628881868892333},{x:.3974774451646465,y:-.013911789983170525},{x:.4720844451646465,y:.0247832100168294},{x:.4742399118062311,y:.026185049737888398},{x:.4765030886255536,y:.02740538646642049},{x:.47792879308654873,y:.028584168427667152},{x:.47947957817165415,y:.02959274452399146},{x:.48132014276352414,y:.0313881589690925},{x:.48210100000000006,y:.032033776942416534},{x:.48210100000000006,y:.02603500000000003},{x:.4829656623818547,y:.01725593550927424},{x:.4855264210369921,y:.008814245543570985},{x:.4896848674463855,y:.0010343395141179344},{x:.4952811948466054,y:-.0057848051533946065},{x:.5021003395141179,y:-.01138113255361451},{x:.509880245543571,y:-.015539578963007873},{x:.5183219355092743,y:-.018100337618145335},{x:.527101,y:-.018964999999999968},{x:.5358800644907258,y:-.018100337618145335},{x:.544321754456429,y:-.015539578963007873},{x:.5521016604858822,y:-.011381132553614504},{x:.5589208051533947,y:-.0057848051533946065},{x:.5645171325536146,y:.0010343395141179344},{x:.5686755789630079,y:.008814245543570992},{x:.5712363376181454,y:.01725593550927426},{x:.5721010000000001,y:.02603500000000003},{x:.5721010000000001,y:.560059},{x:.5712363376181454,y:.5688380644907257},{x:.5686755789630079,y:.577279754456429},{x:.5645171325536146,y:.5850596604858821},{x:.5589208051533947,y:.5918788051533946},{x:.5521016604858822,y:.5974751325536145},{x:.544321754456429,y:.6016335789630078},{x:.5358800644907258,y:.6041943376181453},{x:.527101,y:.605059},{x:.5183219355092743,y:.6041943376181453},{x:.509880245543571,y:.6016335789630078},{x:.5021003395141179,y:.5974751325536145},{x:.4952811948466054,y:.5918788051533946},{x:.4896848674463855,y:.5850596604858821},{x:.4855264210369921,y:.577279754456429},{x:.4829656623818547,y:.5688380644907257},{x:.48210100000000006,y:.560059},{x:.48210100000000006,y:.5551612473179106},{x:.48111784979070266,y:.5559741116228759},{x:.47906658786156825,y:.5579287481398052},{x:.4777260461549398,y:.558778440075324},{x:.476502844006682,y:.5597897782764175},{x:.474008872962507,y:.5611345413953497},{x:.47161569478864906,y:.5626514387693977},{x:.3970086947886491,y:.6002454387693977},{x:.39545173243232984,y:.6008467903430146},{x:.3939797544564291,y:.6016335789630078},{x:.39134652561635536,y:.6024323601988234},{x:.3887796173011618,y:.6034237870938969},{x:.38713525366780027,y:.6037098355781862},{x:.3855380644907258,y:.6041943376181453},{x:.3827995979159321,y:.6044640530341434},{x:.3800885942320307,y:.6049356509696303},{x:.37842002129388747,y:.6048954036817589},{x:.376759,y:.605059},{x:.263722,y:.605059},{x:.26219504701733515,y:.604908608257877},{x:.26066140118579323,y:.6049547986330399},{x:.25781511370268967,y:.6044772224791067},{x:.2549429355092742,y:.6041943376181453},{x:.2534746624734083,y:.6037489418620853},{x:.2519614739213154,y:.6034950452430072},{x:.24926304753974865,y:.6024713624393285},{x:.24650124554357095,y:.6016335789630078},{x:.24514807736385555,y:.6009102955021357},{x:.24371349707866236,y:.6003660689935006},{x:.16798049707866233,y:.5627720689935006},{x:.1654642487594581,y:.5611982224645521},{x:.16285190958182658,y:.5597896123262998},{x:.16173267757498783,y:.5588642237445607},{x:.16050143578237863,y:.5580941146870384},{x:.15834057869520102,y:.5560596134829665},{x:.15605324108782545,y:.5541684273021619},{x:.08031924108782545,y:.47787942730216193},{x:.07924694249287094,y:.47656305714472025},{x:.07802357952480113,y:.4753857561141845},{x:.07646760484406812,y:.47315109973327435},{x:.07474784589903924,y:.4710398973462887},{x:.07395296229881854,y:.46953962579412084},{x:.07298278594430238,y:.4681462799973844},{x:.07189266871370663,y:.46565100631071576},{x:.07061782960809859,y:.46324486175923196},{x:.0701309079335922,y:.4616183434067253},{x:.06945120152585271,y:.46006249834135976},{x:.032147201525852716,y:.3450764983413597},{x:.031582343425880205,y:.34249647318004567},{x:.03081566238185464,y:.3399690644907258},{x:.030641204072877935,y:.33819775955415116},{x:.03026054307811779,y:.33645906634171463},{x:.03020987650767869,y:.3338184172918108},{x:.029951000000000005,y:.33119},{x:.029951000000000005,y:.25490100000000004}],[{x:.119951,y:.2620835578942187},{x:.119951,y:.3240730820964405},{x:.15174843963453788,y:.42208563822492473},{x:.21467365091165175,y:.4854719831046318},{x:.2742766075147511,y:.5150589999999999},{x:.3660620360389177,y:.5150589999999999},{x:.4245839309326211,y:.4855701837142105},{x:.48210100000000006,y:.4276323784447675},{x:.48210100000000006,y:.15956344905445352},{x:.4243936225653894,y:.10143318135145685},{x:.36578354074375496,y:.07103500000000003},{x:.2745522516182332,y:.07103500000000003},{x:.21486246778999646,y:.10153288315838035},{x:.15170083487400915,y:.1651582162341545},{x:.119951,y:.2620835578942187}]],b:[[{x:.03166000000000001,y:.04001500000000002},{x:.03252466238185464,y:.031235935509274233},{x:.0350854210369921,y:.022794245543570978},{x:.039243867446385465,y:.015014339514117927},{x:.04484019484660537,y:.008195194846605386},{x:.05165933951411792,y:.002598867446385482},{x:.05943924554357097,y:-.0015595789630078807},{x:.06788093550927424,y:-.004120337618145342},{x:.07666,y:-.0049849999999999756},{x:.08543906449072577,y:-.004120337618145342},{x:.09388075445642904,y:-.0015595789630078807},{x:.10166066048588211,y:.002598867446385489},{x:.10847980515339464,y:.008195194846605386},{x:.11407613255361454,y:.015014339514117927},{x:.1182345789630079,y:.022794245543570985},{x:.12079533761814537,y:.031235935509274254},{x:.12166,y:.04001500000000002},{x:.12166,y:.041388769861289504},{x:.12338630711141785,y:.04010106584896898},{x:.12512540667363178,y:.03853443023544684},{x:.12691331624345048,y:.03747016444054036},{x:.12858112311649333,y:.036226097502515},{x:.13069431360107225,y:.035219499067818724},{x:.13270563229917137,y:.034022247411931134},{x:.20674863229917137,y:-.0007227525880688923},{x:.20772794171481185,y:-.0010698043626217635},{x:.20864424554357097,y:-.0015595789630078669},{x:.21187816153300185,y:-.0025405766534664824},{x:.21506348921487128,y:-.003669406425619949},{x:.21609168791714548,y:-.0038187359083884913},{x:.21708593550927424,y:-.004120337618145342},{x:.22044909586509742,y:-.004451580001305548},{x:.22379344213248661,y:-.004937293022731791},{x:.22483101702188665,y:-.00488316156543817},{x:.225865,y:-.0049849999999999756},{x:.338045,y:-.0049849999999999756},{x:.33894984805462636,y:-.004895880245274822},{x:.33985755144997865,y:-.004948481373678995},{x:.343332465401001,y:-.004464230112452937},{x:.3468240644907258,y:-.004120337618145342},{x:.3476941397420575,y:-.003856403176165039},{x:.34859466384226984,y:-.0037309094409420443},{x:.351908335561611,y:-.0025780408502315546},{x:.35526575445642905,y:-.0015595789630078807},{x:.35606762040050133,y:-.0011309726863615623},{x:.35692635856942223,y:-.0008322067413783357},{x:.43209235856942224,y:.03391279325862169},{x:.4342218624454842,y:.03516383683568551},{x:.43645162164562873,y:.03622594356254809},{x:.4380158580934015,y:.037392738102356306},{x:.4396984532755396,y:.03838123120587913},{x:.4415429728374372,y:.04002368192832182},{x:.4435226810964235,y:.04150038501262054},{x:.5186856810964235,y:.11000138501262047},{x:.5200684051728882,y:.11153543836568303},{x:.5216038163727121,y:.1129166544997947},{x:.5230144082918019,y:.11480386048953693},{x:.5245918796416693,y:.11655397481445093},{x:.5256487561000858,y:.11832830784782436},{x:.5268852029038621,y:.11998252816661786},{x:.5279005150705119,y:.12210866485417524},{x:.5291062453835067,y:.12413290061668979},{x:.5297966590542814,y:.12607932670695898},{x:.530686625504748,y:.12794298045128052},{x:.567704625504748,y:.2301969804512806},{x:.5685418230641662,y:.23348712941632632},{x:.5695273376181453,y:.23673593550927427},{x:.5696276430094915,y:.2377543532384077},{x:.5698799976366801,y:.23874609563675617},{x:.5700592324586751,y:.24213635445346285},{x:.570392,y:.24551500000000004},{x:.570392,y:.314017},{x:.570065993218988,y:.3173270023951309},{x:.5699006262411136,y:.32064890697528625},{x:.569634437926433,y:.3217086568121163},{x:.5695273376181453,y:.3227960644907258},{x:.5685618455328773,y:.32597886535008125},{x:.5677515846008636,y:.32920467896823863},{x:.5307335846008636,y:.4324506789682387},{x:.5298196963817511,y:.43437967657309706},{x:.5291061063615623,y:.4363913954201699},{x:.5279358002551,y:.43835612690926706},{x:.5269566878799311,y:.4404227969757902},{x:.5256840310027916,y:.4421364386856148},{x:.5245916855370664,y:.44397028841230757},{x:.523060566435399,y:.4456689527415915},{x:.5216970801011935,y:.44750489697372575},{x:.5201145620561008,y:.4489373284986299},{x:.5186854393684929,y:.45052283528838016},{x:.44352243936849295,y:.5190228352883801},{x:.44134657552661755,y:.5206458300432604},{x:.43929971954126384,y:.5224287703137037},{x:.4378191137317927,y:.523276992839783},{x:.43645134158383936,y:.5242972253466508},{x:.43400065578620683,y:.5254645447348341},{x:.43164529517316985,y:.52681390451462},{x:.35647929517316984,y:.56056790451462},{x:.3558506134628383,y:.560778965311121},{x:.35526575445642905,y:.5610915789630079},{x:.351674330744245,y:.5621810254355277},{x:.34811645117964274,y:.5633754754766519},{x:.34745867349333664,y:.563459831081816},{x:.3468240644907258,y:.5636523376181454},{x:.3430891085149791,y:.5640201986736739},{x:.3393665669654169,y:.5644975898222324},{x:.3387049713307353,y:.5644519984974604},{x:.338045,y:.564517},{x:.225865,y:.564517},{x:.22507819619617456,y:.5644395065891945},{x:.22428916125732748,y:.5644893996719887},{x:.22069487882474298,y:.5640077875099223},{x:.21708593550927424,y:.5636523376181454},{x:.21632936813438544,y:.5634228354140474},{x:.21554576062305134,y:.5633178367349442},{x:.2121144991913443,y:.5621442688983362},{x:.20864424554357097,y:.5610915789630079},{x:.20794698905754733,y:.5607188876066144},{x:.20719892257093525,y:.5604630322059678},{x:.13315592257093525,y:.5267090322059678},{x:.13091775246116674,y:.5254099486077729},{x:.12858140317750869,y:.5242970714087468},{x:.1271119341080524,y:.5232009671819817},{x:.12552641140636125,y:.5222806946221156},{x:.12358468574515913,y:.5205699272235509},{x:.12166,y:.5191342684374534},{x:.12166,y:.7597659999999999},{x:.12079533761814537,y:.7685450644907257},{x:.1182345789630079,y:.776986754456429},{x:.11407613255361454,y:.7847666604858821},{x:.10847980515339464,y:.7915858051533946},{x:.10166066048588208,y:.7971821325536145},{x:.09388075445642904,y:.8013405789630078},{x:.08543906449072577,y:.8039013376181453},{x:.07666,y:.804766},{x:.06788093550927421,y:.8039013376181453},{x:.05943924554357094,y:.8013405789630078},{x:.05165933951411792,y:.7971821325536145},{x:.04484019484660537,y:.7915858051533946},{x:.039243867446385465,y:.7847666604858821},{x:.0350854210369921,y:.776986754456429},{x:.03252466238185464,y:.7685450644907257},{x:.03166000000000001,y:.7597659999999999},{x:.03166000000000001,y:.04001500000000002}],[{x:.12166,y:.16313400296117606},{x:.12166,y:.39738980161800674},{x:.17691400696537596,y:.447746357818324},{x:.23563826658076475,y:.474517},{x:.3284048540018634,y:.474517},{x:.3882155063572531,y:.44765846343288423},{x:.44979135555302596,y:.39154114946310603},{x:.480392,y:.30619363915535625},{x:.480392,y:.2534097446111891},{x:.44984564070758065,y:.16903221413717517},{x:.38802932067077023,y:.11269492399652684},{x:.3281476350434013,y:.08501500000000002},{x:.2358983461114888,y:.08501500000000002},{x:.1771018588393058,y:.11260550754658781},{x:.12166,y:.16313400296117606}]],c:[[{x:.0446,y:.25490100000000004},{x:.044822712444716174,y:.2526397626013558},{x:.04482893549381362,y:.2503675925637664},{x:.045254001037800355,y:.24826081602954003},{x:.045464662381854634,y:.24612193550927428},{x:.04612424100165128,y:.2439475961957434},{x:.04657362286091401,y:.24172029932495478},{x:.08145962286091402,y:.1278402993249547},{x:.08196610920465827,y:.1266269431042867},{x:.08230081253195312,y:.125355433994083},{x:.08366176737769918,y:.12256476567779218},{x:.08485778977199918,y:.11969953302126297},{x:.0855912581784792,y:.11860830168404396},{x:.08616758939694805,y:.11742652164475936},{x:.08804682625741464,y:.11495498435675963},{x:.08977884657839008,y:.1123781387363477},{x:.09071111026807865,y:.11145096769089737},{x:.09150692129220603,y:.11040433186669174},{x:.16233292129220603,y:.03411333186669174},{x:.16445877247754231,y:.03223237849112975},{x:.1664474797904295,y:.03020697184383589},{x:.16775479669311927,y:.029316055882572942},{x:.16893962068732413,y:.02826772347496185},{x:.17139158003796548,y:.02683764508339147},{x:.17373721213250964,y:.02523913360696181},{x:.24456521213250962,y:-.013455866393038113},{x:.2467886390083486,y:-.014400746043602006},{x:.24891924554357092,y:-.015539578963007873},{x:.25083834630720225,y:-.016121731815163746},{x:.25268405147305695,y:-.01690609278116076},{x:.2550490927002279,y:-.01739904776899966},{x:.2573609355092742,y:-.018100337618145335},{x:.259356733677244,y:-.018296906580526337},{x:.26131999536931183,y:-.018706117055345653},{x:.26373576373978486,y:-.0187282033967292},{x:.26614,y:-.018964999999999968},{x:.371854,y:-.018964999999999968},{x:.3744001776009888,y:-.018714223394882004},{x:.3769583677219744,y:-.018674567546095353},{x:.3787793796063011,y:-.01828290964379429},{x:.3806330644907258,y:-.018100337618145335},{x:.3830813939144215,y:-.01735764500708899},{x:.3855826926572475,y:-.01681967299983559},{x:.38729230564255435,y:-.01608027889939661},{x:.3890747544564291,y:-.015539578963007873},{x:.391331147776118,y:-.014333511606549179},{x:.393679431632842,y:-.013317897403369645},{x:.463449431632842,y:.02537710259663028},{x:.46566730315778443,y:.026909287408228903},{x:.46799586592077425,y:.028267352155161442},{x:.4692879686356918,y:.029410572352257962},{x:.47070743151062955,y:.03039118797094862},{x:.4725837728278355,y:.03232661755101331},{x:.4746026476214732,y:.03411286752390576},{x:.5454306476214732,y:.11040386752390575},{x:.5507700783887176,y:.11742598212342069},{x:.5546369668925095,y:.12535484002769406},{x:.5568827107762242,y:.13388573967401945},{x:.5574210073618384,y:.14269084337317217},{x:.5562311702134469,y:.15143177592795284},{x:.5533589241053942,y:.15977262820225266},{x:.5489146478448386,y:.16739286592077418},{x:.5430691324760942,y:.17399964762147313},{x:.5360470178765793,y:.17933907838871752},{x:.5281181599723059,y:.18320596689250943},{x:.5195872603259806,y:.1854517107762242},{x:.5107821566268278,y:.1859900073618383},{x:.5020412240720471,y:.18480017021344686},{x:.4937003717977473,y:.18192792410539416},{x:.4860801340792258,y:.17748364784483847},{x:.47947335237852684,y:.17163813247609414},{x:.41352572033101553,y:.10060392571412592},{x:.36021071976053953,y:.07103500000000003},{x:.27763077403847125,y:.07103500000000003},{x:.2233107097601157,y:.10071132697875086},{x:.16448866962379677,y:.16407213041308155},{x:.1346,y:.2616391113440561},{x:.1346,y:.3245158400933278},{x:.1645319520417492,y:.4231721923699009},{x:.2231207776861973,y:.4862793045993598},{x:.27734241586879393,y:.5150589999999999},{x:.3605019191882548,y:.5150589999999999},{x:.41371701660545657,y:.4863852380349392},{x:.47947395272027693,y:.4155592208902026},{x:.48608084903755494,y:.4097138350672089},{x:.4937011738972078,y:.40526970822380387},{x:.5020420824884065,y:.4023976256622846},{x:.5107830383716269,y:.4012079599048077},{x:.5195881315142611,y:.40174642913926084},{x:.5281189871247909,y:.40399234029494097},{x:.5360477692062626,y:.4078593842656568},{x:.5430697791097975,y:.41319895272027696},{x:.5489151649327911,y:.41980584903755497},{x:.5533592917761961,y:.42742617389720783},{x:.5562313743377155,y:.4357670824884066},{x:.5574210400951923,y:.4445080383716269},{x:.5568825708607392,y:.4533131315142611},{x:.5546366597050592,y:.4618439871247909},{x:.5507696157343432,y:.46977276920626265},{x:.5454300472797231,y:.4767947791097975},{x:.4746020472797231,y:.5530827791097974},{x:.47237947035514305,y:.5550491819442839},{x:.4702881116089302,y:.5571546051529963},{x:.469083054274185,y:.5579656532949738},{x:.4679951509624451,y:.5589281649327911},{x:.46543165406806053,y:.5604231806402761},{x:.46296973250196366,y:.5620801448811513},{x:.39319973250196366,y:.5996741448811513},{x:.39109075852725916,y:.6005560023370271},{x:.3890747544564291,y:.6016335789630078},{x:.38703122642603144,y:.6022534764138876},{x:.38506104886577136,y:.6030772968079529},{x:.3828205563795885,y:.6035307692082409},{x:.3806330644907258,y:.6041943376181453},{x:.3785078662851109,y:.6044036513718285},{x:.37641482574826585,y:.6048272797133635},{x:.3741289156203665,y:.604834940368031},{x:.371854,y:.605059},{x:.26614,y:.605059},{x:.26400488750824663,y:.6048487097743618},{x:.26185945318827825,y:.6048549475733314},{x:.2596259398913868,y:.6044174210783497},{x:.2573609355092742,y:.6041943376181453},{x:.2553078741931944,y:.60357154827667},{x:.25320244685788745,y:.6031591127457343},{x:.2510972070775077,y:.6022942563713519},{x:.24891924554357092,y:.6016335789630078},{x:.24702713339817148,y:.6006222239508241},{x:.24504262343928468,y:.5998069647561404},{x:.1742146234392847,y:.5622129647561404},{x:.17162525666515238,y:.5604936738034747},{x:.16894033563687538,y:.5589277936219744},{x:.16795812189104978,y:.5580587651214349},{x:.16686556037036515,y:.5573333247718834},{x:.16466136457832586,y:.5551419091149951},{x:.16233352162359432,y:.5530823147741101},{x:.09150752162359431,y:.47679431477411016},{x:.09067474586023959,y:.4756991081857825},{x:.08970182133886938,y:.4747262717047309},{x:.08801053269383365,y:.4721953272870651},{x:.08616805203977476,y:.4697722296898647},{x:.08556494203519081,y:.46853560069719197},{x:.08480050296804506,y:.467391648838166},{x:.08363547472152838,y:.4645793817614187},{x:.08230111970711389,y:.461843393160995},{x:.08195085264054901,y:.4605128647226562},{x:.08142427599227564,y:.4592417589140625},{x:.046538275992275634,y:.3442567589140625},{x:.04610669192420131,y:.34208755224892967},{x:.045464662381854634,y:.33997106449072584},{x:.04524807462900009,y:.3377720121321243},{x:.04481688692083,y:.3356047976316928},{x:.044816786846426454,y:.33339307378956023},{x:.0446,y:.33119200000000004},{x:.0446,y:.25490100000000004}]],d:[[{x:.03166100000000001,y:.24551500000000004},{x:.03199378652782141,y:.24213616168032864},{x:.032173060891358886,y:.2387457109778176},{x:.032425376075824915,y:.237754159461938},{x:.03252566238185464,y:.23673593550927427},{x:.03351123316568353,y:.23348694405135337},{x:.034348506941927405,y:.23019661460170962},{x:.0713675069419274,y:.12794261460170955},{x:.07225746993456125,y:.1260790095358921},{x:.0729478813145148,y:.12413263082247869},{x:.07415364826248581,y:.12210836405190925},{x:.07516899837159816,y:.11998219518580837},{x:.07640543228727825,y:.1183280219355851},{x:.07746229725612473,y:.11655373492181778},{x:.07903981058640837,y:.11480359733178996},{x:.08045044599662987,y:.11291636718401242},{x:.08198583537337678,y:.11153519469971836},{x:.08336853920306012,y:.1100011842405046},{x:.15853253920306012,y:.04150018424050468},{x:.16051177365736521,y:.04002385498013544},{x:.16235580937568672,y:.038381768082408986},{x:.16403890527939927,y:.03739293492543645},{x:.16560363358955885,y:.03622578962650935},{x:.16783285515961555,y:.03516395710594637},{x:.16996181351033893,y:.03391317596960988},{x:.24512381351033893,y:-.0008318240303901436},{x:.24598297689097734,y:-.0011307574341723537},{x:.24678524554357095,y:-.0015595789630078807},{x:.25014222995258023,y:-.0025779090504023904},{x:.2534554494825366,y:-.0037306956028641883},{x:.25435642329373365,y:-.003856270624521421},{x:.2552269355092742,y:-.004120337618145342},{x:.2587180827488419,y:-.0044641856090968535},{x:.2621925371943035,y:-.004948444626188875},{x:.2631006975177666,y:-.004895835488062085},{x:.264006,y:-.0049849999999999756},{x:.376189,y:-.0049849999999999756},{x:.37722298297811335,y:-.004883161565438171},{x:.3782605578675134,y:-.004937293022731791},{x:.3816049041349026,y:-.004451580001305548},{x:.3849680644907258,y:-.004120337618145342},{x:.3859623120828546,y:-.003818735908388489},{x:.38699051078512875,y:-.003669406425619949},{x:.39017583846699794,y:-.0025405766534665605},{x:.39340975445642906,y:-.0015595789630078807},{x:.39432605828518835,y:-.0010698043626217065},{x:.39530536770082864,y:-.0007227525880688923},{x:.46934836770082866,y:.034022247411931134},{x:.4713599418403825,y:.035219651121148166},{x:.4734733873673339,y:.03622640539423388},{x:.4751409393435705,y:.037470316580519136},{x:.4769285933263682,y:.03853443023544684},{x:.47866791375766776,y:.04010126481479184},{x:.480392,y:.041387347763641016},{x:.480392,y:.04001500000000002},{x:.4812566623818546,y:.031235935509274233},{x:.48381742103699205,y:.022794245543570978},{x:.48797586744638544,y:.015014339514117927},{x:.4935721948466053,y:.008195194846605386},{x:.5003913395141178,y:.002598867446385482},{x:.508171245543571,y:-.0015595789630078807},{x:.5166129355092742,y:-.004120337618145342},{x:.525392,y:-.0049849999999999756},{x:.5341710644907257,y:-.004120337618145342},{x:.542612754456429,y:-.0015595789630078807},{x:.5503926604858821,y:.002598867446385489},{x:.5572118051533946,y:.008195194846605386},{x:.5628081325536145,y:.015014339514117927},{x:.5669665789630078,y:.022794245543570985},{x:.5695273376181453,y:.031235935509274254},{x:.570392,y:.04001500000000002},{x:.570392,y:.7597659999999999},{x:.5695273376181453,y:.7685450644907257},{x:.5669665789630078,y:.776986754456429},{x:.5628081325536145,y:.7847666604858821},{x:.5572118051533946,y:.7915858051533946},{x:.5503926604858821,y:.7971821325536145},{x:.542612754456429,y:.8013405789630078},{x:.5341710644907257,y:.8039013376181453},{x:.525392,y:.804766},{x:.5166129355092742,y:.8039013376181453},{x:.508171245543571,y:.8013405789630078},{x:.5003913395141178,y:.7971821325536145},{x:.4935721948466053,y:.7915858051533946},{x:.48797586744638544,y:.7847666604858821},{x:.48381742103699205,y:.776986754456429},{x:.4812566623818546,y:.7685450644907257},{x:.480392,y:.7597659999999999},{x:.480392,y:.5191356905079497},{x:.47846953719699326,y:.5205697307992189},{x:.47652758859363875,y:.5222806946221157},{x:.47494232329576636,y:.5232008177790934},{x:.47347310730786674,y:.524296763521154},{x:.4711365045177018,y:.5254097994515352},{x:.46889807742906475,y:.5267090322059679},{x:.3948550774290648,y:.5604630322059679},{x:.3941070109424522,y:.5607188876066146},{x:.39340975445642906,y:.5610915789630079},{x:.389939500808656,y:.5621442688983361},{x:.38650823937694867,y:.5633178367349442},{x:.38572463186561456,y:.5634228354140474},{x:.3849680644907258,y:.5636523376181454},{x:.38135912117525683,y:.5640077875099224},{x:.3777648387426725,y:.5644893996719887},{x:.3769758038038255,y:.5644395065891945},{x:.376189,y:.564517},{x:.264006,y:.564517},{x:.26334558239453953,y:.5644519545432365},{x:.2626835384795895,y:.5644975635305632},{x:.2589614482177297,y:.5640201550156564},{x:.2552269355092742,y:.5636523376181454},{x:.25459189738202526,y:.5634597009082802},{x:.2539336765832372,y:.5633752751711479},{x:.2503762430229788,y:.5621808961392286},{x:.24678524554357095,y:.5610915789630079},{x:.24619999105363047,y:.5607787539207695},{x:.24557088842716707,y:.5605675378929096},{x:.17040888842716706,y:.5268135378929095},{x:.16805407047382528,y:.5254644267942322},{x:.16560391365212207,y:.5242973792806265},{x:.16423565717286473,y:.5232767996121171},{x:.1627545512703112,y:.5224282514648534},{x:.16070817900232118,y:.5206456609648356},{x:.15853278093215223,y:.5190230360586235},{x:.08336878093215222,y:.45052303605862365},{x:.08193967718325436,y:.44893757139643337},{x:.08035717944512263,y:.44750518296134467},{x:.07899365114577664,y:.44566921514174185},{x:.07746249136223225,y:.4439705283033309},{x:.07637015625263606,y:.44213672358948825},{x:.0750975108858587,y:.44042312810321155},{x:.07411836195358443,y:.43835642671545355},{x:.07294802033824888,y:.4363916652130956},{x:.07223443169362759,y:.4343799925343442},{x:.07132054574594202,y:.4324510425104215},{x:.034301545745942026,y:.32920504251042143},{x:.033491210284420626,y:.32597904935505284},{x:.03252566238185464,y:.3227960644907258},{x:.03241858101312289,y:.3217088491086539},{x:.03215243067755317,y:.32064928896150824},{x:.031987025628206905,y:.31732719375391183},{x:.03166100000000001,y:.314017},{x:.03166100000000001,y:.24551500000000004}],[{x:.121661,y:.25340994514221},{x:.121661,y:.3061934402169761},{x:.15226243948714763,y:.39154086238640384},{x:.21383969339611897,y:.4476587099299689},{x:.27364661400534074,y:.474517},{x:.3664157334192352,y:.474517},{x:.42513971513426946,y:.4477464845048247},{x:.480392,y:.3973901578243758},{x:.480392,y:.1631336467554691},{x:.4249518651426514,y:.1126053780239199},{x:.3661556538885112,y:.08501500000000002},{x:.2739038430667855,y:.08501500000000002},{x:.21402588591940364,y:.11269467351967463},{x:.15220815290195538,y:.1690325018607451},{x:.121661,y:.25340994514221}]],e:[[{x:.014571,y:.25490100000000004},{x:.014880046743786594,y:.2517631957525991},{x:.01501248842711947,y:.2486129918567585},{x:.015311525398480692,y:.24738231945287367},{x:.015435662381854634,y:.24612193550927428},{x:.016350926120166094,y:.24310471531940006},{x:.01709539726614681,y:.24004087979874045},{x:.05693639726614681,y:.12616087979874036},{x:.057746546207777846,y:.12441615547982068},{x:.05835851556287996,y:.12259245107255745},{x:.05959975008908581,y:.12042512406141898},{x:.06065161969764369,y:.11815983382640528},{x:.06178658068373706,y:.11660668611395116},{x:.06274257829935428,y:.11493741297405176},{x:.06438278737670251,y:.11305388338712186},{x:.06585638180708843,y:.11103732964943176},{x:.06727253892344205,y:.10973544513901749},{x:.06853582634733585,y:.1082847524971091},{x:.14942282634733584,y:.031993752497109104},{x:.15144602889400902,y:.03043003785468449},{x:.15333307828862142,y:.02870446646813117},{x:.1549277151407192,y:.027739074573098352},{x:.15640262843323158,y:.02659912765300345},{x:.15869202130341495,y:.025460166585296706},{x:.1608794538505091,y:.024135896643135493},{x:.2417664538505091,y:-.01455910335686443},{x:.24290092295632487,y:-.014970686687880902},{x:.2439652455435709,y:-.015539578963007873},{x:.24703931387581265,y:-.016472087396775758},{x:.2500591116803148,y:-.017567664555291233},{x:.2512520782049556,y:-.01775001548484057},{x:.2524069355092742,y:-.018100337618145335},{x:.25560385985111694,y:-.01841520718300011},{x:.2587793695882151,y:-.01890059980751419},{x:.2599849884971624,y:-.018846710691637396},{x:.261186,y:-.018964999999999968},{x:.381914,y:-.018964999999999968},{x:.3832466926412995,y:-.01883374123151461},{x:.3845848263549422,y:-.018885671038862982},{x:.3876272824249201,y:-.01840229079619376},{x:.39069306449072577,y:-.018100337618145335},{x:.3919745425012029,y:-.017711605513551366},{x:.39329709535359264,y:-.017501480567117658},{x:.39618678867610163,y:-.016433834605858122},{x:.39913475445642904,y:-.015539578963007873},{x:.4003157713548023,y:-.014908312279081314},{x:.40157191838151796,y:-.014444207562717595},{x:.48125191838151804,y:.02425079243728233},{x:.4833189661071789,y:.02551885102394819},{x:.4854901362659954,y:.026598980192539007},{x:.48706966813422276,y:.027819770278194},{x:.48877129863032925,y:.028863658687316496},{x:.4905512426555404,y:.030510612890229178},{x:.492469971641239,y:.03199356196515255},{x:.573357971641239,y:.10828456196515254},{x:.5791512607417543,y:.11493718669263933},{x:.5835353707163221,y:.12259219773755695},{x:.5863418226772573,y:.13095541731842886},{x:.5874627662495775,y:.13970545159690978},{x:.5868551242004307,y:.1485060416627534},{x:.584542247872996,y:.15701898577515713},{x:.5806130198074609,y:.16491713626599536},{x:.5752184380348474,y:.17189697164123896},{x:.5685658133073607,y:.17769026074175415},{x:.560910802262443,y:.1820743707163221},{x:.5525475826815711,y:.18488082267725728},{x:.5437975484030901,y:.18600176624957743},{x:.5349969583372466,y:.1853941242004306},{x:.5264840142248428,y:.183081247872996},{x:.5185858637340046,y:.17915201980746093},{x:.511606028358761,y:.17375743803484736},{x:.43573388395098006,y:.1021972341849065},{x:.3715652104827451,y:.07103500000000003},{x:.2713955768569904,y:.07103500000000003},{x:.2060606884620834,y:.10229012760321096},{x:.13826613078700495,y:.16623259795801962},{x:.104571,y:.2625454790108076},{x:.104571,y:.28619200000000006},{x:.542482,y:.28619200000000006},{x:.5512610644907258,y:.2870566623818547},{x:.559702754456429,y:.2896174210369921},{x:.5674826604858821,y:.2937758674463855},{x:.5743018051533947,y:.2993721948466054},{x:.5798981325536146,y:.3061913395141179},{x:.5840565789630079,y:.31397124554357103},{x:.5866173376181454,y:.32241293550927425},{x:.5874820000000001,y:.33119200000000004},{x:.5866173376181454,y:.33997106449072584},{x:.5840565789630079,y:.34841275445642905},{x:.5798981325536146,y:.35619266048588216},{x:.5743018051533947,y:.3630118051533947},{x:.5674826604858821,y:.3686081325536146},{x:.5660433240263831,y:.3693774739195968},{x:.5706944449992851,y:.3724210772554575},{x:.5769918122169339,y:.3785986803904119},{x:.5819629867044116,y:.38588613801169297},{x:.5854169290140312,y:.3940033972097681},{x:.5872209060798271,y:.40263851626586683},{x:.5873055920748429,y:.4114596523972937},{x:.5856677325637826,y:.4201278142894682},{x:.5823702695691338,y:.4283098893420352},{x:.5425292695691338,y:.5045998893420351},{x:.54083893518448,y:.5071829952333479},{x:.5393041274419548,y:.5098614335042745},{x:.5384286685906833,y:.5108662746451583},{x:.5376989227445426,y:.5119814449992851},{x:.5355371287009763,y:.5141851493557908},{x:.5335092744740836,y:.5165126960496618},{x:.49246227447408364,y:.5552086960496617},{x:.4903478252727746,y:.5568421196453192},{x:.48836639942178184,y:.5586345815458318},{x:.486865329057947,y:.5595323670561179},{x:.4854811710293013,y:.5606016367187369},{x:.48308868524123094,y:.5617911659624512},{x:.4807956399629947,y:.5631626292028359},{x:.40111563996299465,y:.6007566292028359},{x:.40009264564938235,y:.6011215754533451},{x:.39913475445642904,y:.6016335789630078},{x:.3959457374462889,y:.6026009566970012},{x:.3928069722488333,y:.6037206897930685},{x:.3917324370025758,y:.603879047413643},{x:.39069306449072577,y:.6041943376181453},{x:.38737659751458814,y:.6045209811048129},{x:.38407969371999856,y:.6050068561303112},{x:.38299491132800306,y:.6049525395264004},{x:.381914,y:.605059},{x:.261186,y:.605059},{x:.26023449599616577,y:.6049652850353624},{x:.2592798763752433,y:.6050186117946668},{x:.25585213857488087,y:.6045336605029273},{x:.2524069355092742,y:.6041943376181453},{x:.2514919972706982,y:.6039167941377678},{x:.2505453168634681,y:.6037828591890964},{x:.24727805138745723,y:.6026385076291858},{x:.2439652455435709,y:.6016335789630078},{x:.24312203363365809,y:.6011828728071931},{x:.24221967283726598,y:.6008668231955117},{x:.161332672837266,y:.5632728231955116},{x:.15891596978001063,y:.5618462817840929},{x:.15640337688314435,y:.5605963413854953},{x:.1551260781006526,y:.5596091689500753},{x:.15373589412748892,y:.5587885654418143},{x:.1516439317651508,y:.5569179592459522},{x:.1494234689111216,y:.555201853544281},{x:.06853646891112161,y:.47891385354428107},{x:.06722863655802509,y:.4774120673763562},{x:.06576662511800205,y:.47605991734502884},{x:.06433886916992998,y:.4740937424536807},{x:.06274309028364713,y:.4722613067803989},{x:.06175337150959475,y:.4705332315776763},{x:.06058324359446483,y:.4689218384474283},{x:.05956650326928079,y:.4667149016876259},{x:.05835887729241062,y:.4646063547351938},{x:.05772530643484857,y:.4627183994585984},{x:.05689202940417486,y:.4609096881637455},{x:.017051029404174856,y:.3459246881637455},{x:.016331419439147486,y:.342923979771159},{x:.015435662381854634,y:.33997106449072584},{x:.015304912520774374,y:.33864353887302173},{x:.014993833838408223,y:.33734636893611664},{x:.014873460143664087,y:.33426292937408214},{x:.014571,y:.33119200000000004},{x:.014571,y:.25490100000000004}],[{x:.12278767041868709,y:.376192},{x:.13831799224413532,y:.421014018902617},{x:.20587340146207272,y:.4847284236699839},{x:.27113246747276615,y:.5150589999999999},{x:.37183117966561724,y:.5150589999999999},{x:.4359272756482788,y:.48481767680255794},{x:.4662598881310508,y:.45622238914125884},{x:.5025937304308662,y:.3866481106579649},{x:.5074240772554575,y:.379266555000715},{x:.5104401600015575,y:.376192},{x:.12278767041868709,y:.376192}]],f:[[{x:.044112,y:.5239119999999999},{x:.04497666238185463,y:.5151329355092742},{x:.04753742103699209,y:.5066912455435709},{x:.051695867446385456,y:.4989113395141178},{x:.05729219484660536,y:.49209219484660527},{x:.0641113395141179,y:.4864958674463854},{x:.07189124554357096,y:.482337421036992},{x:.08033293550927423,y:.47977666238185457},{x:.089112,y:.47891199999999995},{x:.20304699999999998,y:.47891199999999995},{x:.20304699999999998,y:.05318299999999998},{x:.20391166238185462,y:.04440393550927419},{x:.2064724210369921,y:.03596224554357094},{x:.21063086744638546,y:.028182339514117884},{x:.21622719484660535,y:.021363194846605343},{x:.2230463395141179,y:.01576686744638544},{x:.23082624554357095,y:.011608421036992077},{x:.23926793550927422,y:.009047662381854615},{x:.248047,y:.008182999999999982},{x:.25682606449072576,y:.009047662381854615},{x:.26526775445642903,y:.011608421036992077},{x:.2730476604858821,y:.015766867446385446},{x:.2798668051533946,y:.021363194846605343},{x:.28546313255361455,y:.028182339514117884},{x:.2896215789630079,y:.03596224554357094},{x:.2921823376181454,y:.04440393550927421},{x:.293047,y:.05318299999999998},{x:.293047,y:.47891199999999995},{x:.459965,y:.47891199999999995},{x:.4687440644907258,y:.47977666238185457},{x:.4771857544564291,y:.482337421036992},{x:.48496566048588213,y:.4864958674463854},{x:.4917848051533946,y:.49209219484660527},{x:.49738113255361455,y:.4989113395141178},{x:.5015395789630079,y:.5066912455435709},{x:.5041003376181454,y:.5151329355092742},{x:.504965,y:.5239119999999999},{x:.5041003376181454,y:.5326910644907257},{x:.5015395789630079,y:.5411327544564289},{x:.49738113255361455,y:.548912660485882},{x:.4917848051533946,y:.5557318051533946},{x:.48496566048588213,y:.5613281325536145},{x:.4771857544564291,y:.5654865789630078},{x:.4687440644907258,y:.5680473376181453},{x:.459965,y:.568912},{x:.293047,y:.568912},{x:.293047,y:.6141229501499061},{x:.3322669208002554,y:.6884371453882767},{x:.4140490730325775,y:.7147659999999999},{x:.512941,y:.7147659999999999},{x:.5217200644907257,y:.7156306623818546},{x:.530161754456429,y:.7181914210369921},{x:.5379416604858821,y:.7223498674463854},{x:.5447608051533946,y:.7279461948466053},{x:.5503571325536145,y:.7347653395141178},{x:.5545155789630078,y:.7425452455435709},{x:.5570763376181453,y:.7509869355092742},{x:.557941,y:.7597659999999999},{x:.5570763376181453,y:.7685450644907257},{x:.5545155789630078,y:.776986754456429},{x:.5503571325536145,y:.7847666604858821},{x:.5447608051533946,y:.7915858051533946},{x:.5379416604858821,y:.7971821325536145},{x:.530161754456429,y:.8013405789630078},{x:.5217200644907257,y:.8039013376181453},{x:.512941,y:.804766},{x:.406984,y:.804766},{x:.40440576588043703,y:.8045120661033809},{x:.40181542834229744,y:.8044681908525655},{x:.400026512750784,y:.8040807473169851},{x:.3982049355092742,y:.8039013376181453},{x:.39572578148103565,y:.8031492944655273},{x:.39319377618916257,y:.8026009124809075},{x:.2872357761891626,y:.7684889124809076},{x:.28342960508890525,y:.7668362808879404},{x:.2796044085190959,y:.7652281761559891},{x:.27938594032962494,y:.7650805300410848},{x:.27914407460343155,y:.764975512444704},{x:.2757334504432472,y:.7626120885587936},{x:.27229547962292316,y:.7602886242777711},{x:.2721100135665551,y:.7601011941121303},{x:.27189328313916555,y:.7599510087370087},{x:.2690092742928275,y:.7569676176126634},{x:.26609064851257996,y:.7540180832118794},{x:.26594531194585036,y:.7537980718316557},{x:.26576204564604555,y:.7536084902175343},{x:.26351548295615396,y:.7501197819025626},{x:.26122836336792754,y:.7466575263349163},{x:.2082493633679275,y:.6462725263349164},{x:.20745880379789322,y:.6443351468057326},{x:.2064724210369921,y:.6424897544564291},{x:.20579637196662365,y:.6402611193438609},{x:.20491647908027386,y:.6381048157198157},{x:.20451907388691828,y:.636050431873947},{x:.20391166238185462,y:.6340480644907258},{x:.20368338854657433,y:.6317303613460921},{x:.20324107652369047,y:.6294438319050109},{x:.20325209776572678,y:.6273513925615422},{x:.20304699999999998,y:.6252690000000001},{x:.20304699999999998,y:.568912},{x:.089112,y:.568912},{x:.0803329355092742,y:.5680473376181453},{x:.07189124554357093,y:.5654865789630078},{x:.0641113395141179,y:.5613281325536145},{x:.05729219484660536,y:.5557318051533946},{x:.051695867446385456,y:.548912660485882},{x:.04753742103699209,y:.5411327544564289},{x:.04497666238185463,y:.5326910644907257},{x:.044112,y:.5239119999999999}]],g:[[{x:.03166100000000001,y:.285331},{x:.03199195389402992,y:.28197076872347165},{x:.03216742697517915,y:.27859884139484714},{x:.032423533978450624,y:.2775888625904497},{x:.03252566238185464,y:.2765519355092742},{x:.03350580569139788,y:.2733208360362635},{x:.034335737494852386,y:.2700479324456657},{x:.07135573749485238,y:.1675239324456658},{x:.07223945098422414,y:.16566943556296815},{x:.07292365731738822,y:.16373243532732273},{x:.07413231799188957,y:.16169720247238553},{x:.07515058411631778,y:.15956034321175439},{x:.07637911169281072,y:.15791388391586245},{x:.07742806119285411,y:.15614758463046624},{x:.07901055202445481,y:.15438725620434748},{x:.0804261330120869,y:.15249010996133996},{x:.08195226304990277,y:.15111496075964967},{x:.08332564517579637,y:.14958724031548856},{x:.1584886451757964,y:.08090524031548854},{x:.16047116284778873,y:.07942238349974136},{x:.16231838489394151,y:.07777404756068641},{x:.16399482319868336,y:.07678680357956279},{x:.16555276842115366,y:.07562151273533077},{x:.16778648358567103,y:.07455391860853194},{x:.1699197861673149,y:.07329763012616651},{x:.2450797861673149,y:.038459630126166475},{x:.2459605302529857,y:.0381521715215269},{x:.24678324554357095,y:.03771242103699209},{x:.2501181687545519,y:.03670078314085588},{x:.253408434365457,y:.03555218561964517},{x:.254332237398671,y:.03542245939316866},{x:.2552249355092742,y:.03515166238185463},{x:.2586931398688001,y:.03481007406735549},{x:.26214426420887293,y:.034325445502994434},{x:.2630756249571383,y:.03437843696081321},{x:.264004,y:.034287},{x:.376189,y:.034287},{x:.37724627227682206,y:.03439113223027483},{x:.37830727432005307,y:.03433688416138392},{x:.3816280756224084,y:.03482270219101675},{x:.3849680644907258,y:.03515166238185463},{x:.38598470638687477,y:.035460057329467706},{x:.38703590484658207,y:.03561384285228289},{x:.39019811948723343,y:.036738182220129235},{x:.39340975445642906,y:.03771242103699209},{x:.39434669699397534,y:.038213227257056566},{x:.39534769490287125,y:.03856913648017993},{x:.4693886949028713,y:.07340713648017996},{x:.47140406041677185,y:.07460963544760885},{x:.47352148667564636,y:.07562166704766733},{x:.4751827197672129,y:.0768642309221422},{x:.47696422705836306,y:.07792719476830276},{x:.47870627197824944,y:.0794997663623443},{x:.480392,y:.08076065187723735},{x:.480392,y:.018480463023952315},{x:.44982106300216956,y:-.06618482166306154},{x:.42509763890365326,y:-.0887666681923909},{x:.3663917896728536,y:-.115601},{x:.27366828971008494,y:-.115601},{x:.21388478385740822,y:-.08868092320279419},{x:.15228882603575622,y:-.032396134475538775},{x:.11903308523020223,y:.0605977685009861},{x:.11526275900748023,y:.06857299605517989},{x:.11000898883421664,y:.07565942769130271},{x:.1034736741518217,y:.08158473581569503},{x:.09590796343849313,y:.08612121416008753},{x:.08760260271404471,y:.08909452840579157},{x:.07887676233341709,y:.09039041575379858},{x:.07006577144893004,y:.08995907598006667},{x:.061508231499013855,y:.08781708523020218},{x:.05353300394482007,y:.08404675900748018},{x:.046446572308697254,y:.07879298883421659},{x:.04052126418430494,y:.07225767415182165},{x:.035984785839912437,y:.06469196343849308},{x:.03301147159420839,y:.05638660271404467},{x:.03171558424620138,y:.04766076233341703},{x:.0321469240199333,y:.038849771448930016},{x:.03428891476979778,y:.030292231499013812},{x:.07130891476979778,y:-.07322776850098624},{x:.07221644299685706,y:-.07514742841768875},{x:.07292365731738822,y:-.07714956467267746},{x:.07409706350042253,y:-.07912543338941479},{x:.07507924099251978,y:-.08120299605518004},{x:.07634383839048098,y:-.08290872027080634},{x:.07742806119285414,y:-.08473441536953392},{x:.07896439356931816,y:-.08644339813281518},{x:.08033301116578337,y:-.08828942769130284},{x:.0819060799658371,y:-.08971566618082738},{x:.08332564517579637,y:-.09129475968451163},{x:.1584886451757964,y:-.15997675968451153},{x:.16066766565506738,y:-.1616065940183929},{x:.16271768036753925,y:-.16339598773796155},{x:.16419165994754753,y:-.1642424237156923},{x:.16555276842115366,y:-.1652604872646693},{x:.16800788453794988,y:-.16643389898185532},{x:.17036760218951646,y:-.1677889719724602},{x:.24552760218951647,y:-.2016329719724602},{x:.24617798725770038,y:-.20185206166908357},{x:.24678324554357095,y:-.2021755789630079},{x:.2503526828238078,y:-.20325835592431216},{x:.25388756161766735,y:-.20444912053505218},{x:.25456819199860076,y:-.20453711665220192},{x:.2552249355092742,y:-.20473633761814536},{x:.25893702635910487,y:-.20510194665533446},{x:.2626362900994872,y:-.20558021041579141},{x:.263321009549333,y:-.20553373131203426},{x:.264004,y:-.20560099999999998},{x:.376189,y:-.20560099999999998},{x:.3769985938815523,y:-.20552126196245651},{x:.37781053527049396,y:-.2055717752142049},{x:.38138177137190815,y:-.20508955666026785},{x:.3849680644907258,y:-.20473633761814536},{x:.3857465461334356,y:-.20450018779358015},{x:.38655274094280934,y:-.2043913285403334},{x:.3899612805709507,y:-.2032216620796743},{x:.39340975445642906,y:-.2021755789630079},{x:.39412720724734457,y:-.20179209245674457},{x:.39489667386274535,y:-.20152804409855607},{x:.4689376738627454,y:-.16768404409855608},{x:.471176129388074,y:-.16638175223486265},{x:.4735129313995788,y:-.16526550692304898},{x:.47497970384913024,y:-.16416890323360386},{x:.4765626813675205,y:-.163247956304222},{x:.47850406105855325,y:-.16153398660426738},{x:.480578193417323,y:-.15998330217620907},{x:.5187211934173229,y:-.125144302176209},{x:.5200982241105119,y:-.12361318710120846},{x:.5216280341275545,y:-.12223470670068204},{x:.5230406381933351,y:-.12034152832018923},{x:.5246201913815024,y:-.1185852292702623},{x:.52567205708302,y:-.11681488878073784},{x:.5269035440443172,y:-.11516444436572898},{x:.5279196645391884,y:-.1130320574948894},{x:.5291262301085498,y:-.11100134969861394},{x:.5298125082093796,y:-.10905981698676002},{x:.5306983467616347,y:-.10720083421055714},{x:.5677173467616347,y:-.0046778342105572215},{x:.5685472301626403,y:-.001405045768812418},{x:.5695273376181453,y:.0018259355092742052},{x:.5696294781899907,y:.002862986138707272},{x:.5698856101392306,y:.003873086692614168},{x:.5700610582123972,y:.007244891642088324},{x:.570392,y:.010604999999999976},{x:.570392,y:.560059},{x:.5695273376181453,y:.5688380644907257},{x:.5669665789630078,y:.577279754456429},{x:.5628081325536145,y:.5850596604858821},{x:.5572118051533946,y:.5918788051533946},{x:.5503926604858821,y:.5974751325536145},{x:.542612754456429,y:.6016335789630078},{x:.5341710644907257,y:.6041943376181453},{x:.525392,y:.605059},{x:.5166129355092742,y:.6041943376181453},{x:.508171245543571,y:.6016335789630078},{x:.5003913395141178,y:.5974751325536145},{x:.4935721948466053,y:.5918788051533946},{x:.48797586744638544,y:.5850596604858821},{x:.48381742103699205,y:.577279754456429},{x:.4812566623818546,y:.5688380644907257},{x:.480392,y:.560059},{x:.480392,y:.5595783858718113},{x:.47850787544975776,y:.5609876460911735},{x:.47656308903374583,y:.5627046621197919},{x:.47498407852937236,y:.5636233247252487},{x:.47352120750708176,y:.5647175018259646},{x:.47118052218859596,y:.5658362200595997},{x:.46893813108831367,y:.5671408350985324},{x:.39489713108831365,y:.6009858350985324},{x:.39412742928685096,y:.6012499737741558},{x:.39340975445642906,y:.6016335789630078},{x:.38996152003118717,y:.6026795894402057},{x:.3865532301567984,y:.60384921275647},{x:.38574678706033977,y:.6039581147092028},{x:.3849680644907258,y:.6041943376181453},{x:.38138202040224084,y:.6045475321329209},{x:.37781103767268465,y:.6050297570960106},{x:.3769988444371686,y:.6049792372848822},{x:.376189,y:.605059},{x:.264004,y:.605059},{x:.2633207613423033,y:.6049917068657756},{x:.2626357925427961,y:.6050381952835313},{x:.25893677979996554,y:.6045599223713788},{x:.2552249355092742,y:.6041943376181453},{x:.25456795333002863,y:.6039950442528821},{x:.2538870765735461,y:.6039070086250592},{x:.2503524457397967,y:.6027162840056636},{x:.24678324554357095,y:.6016335789630078},{x:.24617776729948443,y:.6013099440989677},{x:.24552714829793862,y:.6010907675853725},{x:.17036714829793861,y:.5672457675853725},{x:.16800780172583518,y:.5658908729822889},{x:.16555304759050302,y:.5647176561362495},{x:.1641916021742222,y:.563699355958929},{x:.16271727507130354,y:.5628526987282604},{x:.16066758950642807,y:.5610635523625588},{x:.15848888603577402,y:.5594339797745099},{x:.08332588603577401,y:.49075297977450993},{x:.08190615458499984,y:.48917372437901785},{x:.08033291862515302,y:.48774732555289924},{x:.07896444452212992,y:.48590147772545017},{x:.07742825448734617,y:.4841926782200152},{x:.07634390022195357,y:.48236679190821125},{x:.07507917015624571,y:.48066087782555583},{x:.0740970979464375,y:.4785835213931001},{x:.07292379561819572,y:.47660786018244516},{x:.07221648966449083,y:.47460551074132296},{x:.0713088683600783,y:.4726856387236396},{x:.034288868360078294,y:.36916463872363964},{x:.03348577523186824,y:.3659561323879453},{x:.03252566238185464,y:.3627910644907258},{x:.0324167369020588,y:.3616851255348066},{x:.032146903820267865,y:.36060709221327164},{x:.03198519043554786,y:.35730356073015046},{x:.03166100000000001,y:.354012},{x:.03166100000000001,y:.285331}],[{x:.121661,y:.29320659086815803},{x:.121661,y:.34620780969623244},{x:.15228882172599023,y:.4318540207415116},{x:.21388481974037543,y:.48813802669691503},{x:.2736685500834057,y:.5150589999999999},{x:.3663915263934284,y:.5150589999999999},{x:.4250929420729598,y:.48822590193711934},{x:.480392,y:.4376951204586189},{x:.480392,y:.20264468470162808},{x:.4249051037436742,y:.15194152341431572},{x:.3661311050032371,y:.124287},{x:.2739261218560311,y:.124287},{x:.21407100266628776,y:.15203091487935444},{x:.15223458736534265,y:.208535427414771},{x:.121661,y:.29320659086815803}]],h:[[{x:.047041,y:.05318299999999998},{x:.04790566238185463,y:.04440393550927419},{x:.050466421036992094,y:.03596224554357094},{x:.05462486744638546,y:.028182339514117884},{x:.06022119484660536,y:.021363194846605343},{x:.06704033951411792,y:.01576686744638544},{x:.07482024554357096,y:.011608421036992077},{x:.08326193550927423,y:.009047662381854615},{x:.092041,y:.008182999999999982},{x:.10082006449072577,y:.009047662381854615},{x:.10926175445642904,y:.011608421036992077},{x:.1170416604858821,y:.015766867446385446},{x:.12386080515339463,y:.021363194846605343},{x:.12945713255361452,y:.028182339514117884},{x:.1336155789630079,y:.03596224554357094},{x:.13617633761814535,y:.04440393550927421},{x:.137041,y:.05318299999999998},{x:.137041,y:.3692271498339558},{x:.23047284680205596,y:.45237128863270537},{x:.2915669774325256,y:.478914},{x:.38669764440631527,y:.478914},{x:.43644054132690624,y:.4571557093088599},{x:.465011,y:.38123324165433015},{x:.465011,y:.05318299999999998},{x:.4658756623818546,y:.04440393550927419},{x:.46843642103699207,y:.03596224554357094},{x:.47259486744638546,y:.028182339514117884},{x:.4781911948466053,y:.021363194846605343},{x:.4850103395141179,y:.01576686744638544},{x:.492790245543571,y:.011608421036992077},{x:.5012319355092743,y:.009047662381854615},{x:.510011,y:.008182999999999982},{x:.5187900644907257,y:.009047662381854615},{x:.527231754456429,y:.011608421036992077},{x:.5350116604858821,y:.015766867446385446},{x:.5418308051533947,y:.021363194846605343},{x:.5474271325536145,y:.028182339514117884},{x:.5515855789630079,y:.03596224554357094},{x:.5541463376181454,y:.04440393550927421},{x:.555011,y:.05318299999999998},{x:.555011,y:.38942},{x:.5546506186962206,y:.39307901278178137},{x:.554410350301749,y:.3967478709583736},{x:.5542188683658584,y:.3974626474508545},{x:.5541463376181454,y:.3981990644907258},{x:.5530790429582076,y:.40171746346329923},{x:.5521276325304605,y:.40526895152034226},{x:.5139866325304605,y:.5066239515203422},{x:.5138553396770835,y:.5068902237569821},{x:.5137747554395128,y:.50717595947055},{x:.511905898744729,y:.5108438433478746},{x:.5100853961903059,y:.5145359657635786},{x:.5099046789559015,y:.5147715076888114},{x:.5097698988494882,y:.5150360318659072},{x:.5072213830653152,y:.5182688425286295},{x:.504715563605999,y:.5215348594178236},{x:.5044923668525381,y:.521730619287556},{x:.5043085704011859,y:.5219637664124008},{x:.5011783335599848,y:.5246372687597332},{x:.4980834944323178,y:.5273516689249697},{x:.497826395485866,y:.5275001237971909},{x:.49760064588412606,y:.5276929341565276},{x:.49400898123224624,y:.5297043869925788},{x:.49044405536829966,y:.5317628575577613},{x:.490162934397186,y:.5318583023949868},{x:.48990390707565157,y:.532003366394835},{x:.41414290707565155,y:.5651423663948351},{x:.41372099607879415,y:.5652794559590063},{x:.41332975445642905,y:.5654885789630079},{x:.40952975949805703,y:.5666412948313546},{x:.4057531353317914,y:.5678684156337233},{x:.40531258638921414,y:.5679205603081202},{x:.4048880644907258,y:.5680493376181454},{x:.4009362016599996,y:.5684385621342186},{x:.39699274487562397,y:.5689053213297277},{x:.39655048803612764,y:.5688705172237564},{x:.396109,y:.568914},{x:.282214,y:.568914},{x:.28182836168040026,y:.5688760179407144},{x:.2814421286004882,y:.5689073796745989},{x:.27744221175957573,y:.5684440198796774},{x:.2734349355092742,y:.5680493376181454},{x:.2730641170540284,y:.5679368510695262},{x:.2726791869636831,y:.5678922598605547},{x:.26884652441488044,y:.5666574583296339},{x:.26499324554357095,y:.5654885789630079},{x:.2646514972979566,y:.5653059107200353},{x:.264282662844679,y:.5651870801833616},{x:.18800566284467896,y:.5320480801833616},{x:.1856267698486466,y:.5307235797343987},{x:.1831549202301779,y:.529581917442145},{x:.18178185218619736,y:.5285828381463435},{x:.18029822995654404,y:.527756799180932},{x:.17822344394147954,y:.5259936496360635},{x:.17602181748454487,y:.5243916901265875},{x:.137041,y:.4897030201456747},{x:.137041,y:.7597659999999999},{x:.13617633761814535,y:.7685450644907257},{x:.1336155789630079,y:.776986754456429},{x:.12945713255361452,y:.7847666604858821},{x:.12386080515339463,y:.7915858051533946},{x:.11704166048588208,y:.7971821325536145},{x:.10926175445642904,y:.8013405789630078},{x:.10082006449072577,y:.8039013376181453},{x:.092041,y:.804766},{x:.08326193550927423,y:.8039013376181453},{x:.07482024554357093,y:.8013405789630078},{x:.06704033951411792,y:.7971821325536145},{x:.06022119484660536,y:.7915858051533946},{x:.05462486744638546,y:.7847666604858821},{x:.050466421036992094,y:.776986754456429},{x:.04790566238185463,y:.7685450644907257},{x:.047041,y:.7597659999999999},{x:.047041,y:.05318299999999998}]],i:[[{x:.216026,y:.7597659999999999},{x:.21689066238185462,y:.7509869355092742},{x:.21945142103699208,y:.7425452455435709},{x:.22360986744638545,y:.7347653395141178},{x:.22920619484660534,y:.7279461948466053},{x:.2360253395141179,y:.7223498674463854},{x:.24380524554357094,y:.7181914210369921},{x:.25224693550927424,y:.7156306623818546},{x:.261026,y:.7147659999999999},{x:.341026,y:.7147659999999999},{x:.3498050644907258,y:.7156306623818546},{x:.35824675445642906,y:.7181914210369921},{x:.3660266604858821,y:.7223498674463854},{x:.3728458051533946,y:.7279461948466053},{x:.37844213255361453,y:.7347653395141178},{x:.3826005789630079,y:.7425452455435709},{x:.38516133761814536,y:.7509869355092742},{x:.386026,y:.7597659999999999},{x:.38516133761814536,y:.7685450644907257},{x:.3826005789630079,y:.776986754456429},{x:.37844213255361453,y:.7847666604858821},{x:.3728458051533946,y:.7915858051533946},{x:.3660266604858821,y:.7971821325536145},{x:.35824675445642906,y:.8013405789630078},{x:.3498050644907258,y:.8039013376181453},{x:.341026,y:.804766},{x:.261026,y:.804766},{x:.25224693550927424,y:.8039013376181453},{x:.24380524554357094,y:.8013405789630078},{x:.2360253395141179,y:.7971821325536145},{x:.22920619484660534,y:.7915858051533946},{x:.22360986744638545,y:.7847666604858821},{x:.21945142103699208,y:.776986754456429},{x:.21689066238185462,y:.7685450644907257},{x:.216026,y:.7597659999999999}],[{x:.25597800000000004,y:.05318299999999998},{x:.25684266238185466,y:.04440393550927419},{x:.2594034210369921,y:.03596224554357094},{x:.2635618674463855,y:.028182339514117884},{x:.2691581948466054,y:.021363194846605343},{x:.27597733951411796,y:.01576686744638544},{x:.28375724554357096,y:.011608421036992077},{x:.2921989355092742,y:.009047662381854615},{x:.300978,y:.008182999999999982},{x:.3097570644907258,y:.009047662381854615},{x:.3181987544564291,y:.011608421036992077},{x:.32597866048588214,y:.015766867446385446},{x:.33279780515339463,y:.021363194846605343},{x:.33839413255361456,y:.028182339514117884},{x:.34255257896300795,y:.03596224554357094},{x:.3451133376181454,y:.04440393550927421},{x:.345978,y:.05318299999999998},{x:.345978,y:.523911},{x:.3451133376181454,y:.5326900644907258},{x:.34255257896300795,y:.541131754456429},{x:.33839413255361456,y:.5489116604858821},{x:.33279780515339463,y:.5557308051533947},{x:.32597866048588214,y:.5613271325536145},{x:.3181987544564291,y:.5654855789630079},{x:.3097570644907258,y:.5680463376181454},{x:.300978,y:.5689110000000001},{x:.2921989355092742,y:.5680463376181454},{x:.28375724554357096,y:.5654855789630079},{x:.27597733951411796,y:.5613271325536145},{x:.2691581948466054,y:.5557308051533947},{x:.2635618674463855,y:.5489116604858821},{x:.2594034210369921,y:.541131754456429},{x:.25684266238185466,y:.5326900644907258},{x:.25597800000000004,y:.523911},{x:.25597800000000004,y:.05318299999999998}]],j:[[{x:.11017199870220953,y:-.1121580749666587},{x:.11173080987432929,y:-.12084080046598154},{x:.114953584640513,y:-.12905258085596802},{x:.11971647357384912,y:-.1364778420214504},{x:.12583644152368842,y:-.14283123533997366},{x:.1330783015538362,y:-.147868603469331},{x:.14116375304461573,y:-.15139636317729976},{x:.23896575304461573,y:-.18307436317729964},{x:.2424293887998465,y:-.18383095770413346},{x:.24586120600074532,y:-.1847208108507566},{x:.24673197042105502,y:-.1847708110651418},{x:.2475840766296098,y:-.18495694463669302},{x:.2511287638648936,y:-.18502327959701073},{x:.25466824139749206,y:-.18522652014211538},{x:.25553202888155596,y:-.18510568190524296},{x:.2564040749666586,y:-.1851220012977904},{x:.25989359333942796,y:-.1844955274762681},{x:.2634047110671092,y:-.18400434499968443},{x:.3944597110671092,y:-.15232634499968456},{x:.39510744613291976,y:-.15210060706564532},{x:.39578357398914765,y:-.1519849807175323},{x:.3992672661785621,y:-.15065089524264363},{x:.4027898773796621,y:-.14942325292878383},{x:.40338112711156726,y:-.1490754856432793},{x:.40402170577913904,y:-.1488301750218278},{x:.4071781926350792,y:-.14684208899421944},{x:.4103936167153703,y:-.14495080812962524},{x:.41090565971774945,y:-.14449437599440731},{x:.41148607211771127,y:-.14412880824922783},{x:.41419405162048195,y:-.14156312270000898},{x:.41697872163578864,y:-.1390808841476645},{x:.4173918803832174,y:-.13853332759371953},{x:.41788982159253774,y:-.13806155128824654},{x:.42004522760849955,y:-.13501686407422092},{x:.422292130251795,y:-.13203905886963707},{x:.4225905272853119,y:-.13142142018825975},{x:.42298686170256505,y:-.13086156542133753},{x:.4245068631872901,y:-.12745488216466036},{x:.4261296512500701,y:-.1240959456918764},{x:.4263018193390199,y:-.1234319603912164},{x:.42658131605481786,y:-.12280554206756752},{x:.4588533160548179,y:-.025908542067567514},{x:.4594769463166796,y:-.023162642495487502},{x:.46029433761814537,y:-.02046806449072583},{x:.46045163429328767,y:-.01887100454660151},{x:.46080705178433234,y:-.017306069686551954},{x:.4608830007338393,y:-.01449126757618431},{x:.461159,y:-.01168900000000006},{x:.461159,y:.534292},{x:.46029433761814537,y:.5430710644907257},{x:.4577335789630079,y:.551512754456429},{x:.45357513255361454,y:.5592926604858821},{x:.4479788051533946,y:.5661118051533947},{x:.4411596604858821,y:.5717081325536145},{x:.43337975445642907,y:.5758665789630079},{x:.4249380644907258,y:.5784273376181454},{x:.416159,y:.579292},{x:.4073799355092742,y:.5784273376181454},{x:.39893824554357094,y:.5758665789630079},{x:.39115833951411794,y:.5717081325536145},{x:.3843391948466054,y:.5661118051533947},{x:.37874286744638547,y:.5592926604858821},{x:.3745844210369921,y:.551512754456429},{x:.37202366238185464,y:.5430710644907257},{x:.371159,y:.534292},{x:.371159,y:-.004392296840350002},{x:.3490732119536395,y:-.07070509444595838},{x:.254610065464387,y:-.09353828321774525},{x:.16889624695538427,y:-.06577563682270039},{x:.16027792337039018,y:-.063893055363307},{x:.15145792503334138,y:-.0637279987022096},{x:.14277519953401854,y:-.06528680987432936},{x:.13456341914403205,y:-.06850958464051307},{x:.12713815797854966,y:-.0732724735738492},{x:.12078476466002638,y:-.07939244152368852},{x:.11574739653066908,y:-.08663430155383627},{x:.11221963682270032,y:-.0947197530446158},{x:.11033705536330693,y:-.10333807662960988},{x:.11017199870220953,y:-.1121580749666587}],[{x:.3403,y:.7597659999999999},{x:.3411646623818546,y:.7509869355092742},{x:.34372542103699205,y:.7425452455435709},{x:.34788386744638544,y:.7347653395141178},{x:.3534801948466053,y:.7279461948466053},{x:.3602993395141179,y:.7223498674463854},{x:.36807924554357097,y:.7181914210369921},{x:.37652093550927423,y:.7156306623818546},{x:.3853,y:.7147659999999999},{x:.447023,y:.7147659999999999},{x:.4558020644907258,y:.7156306623818546},{x:.46424375445642907,y:.7181914210369921},{x:.4720236604858821,y:.7223498674463854},{x:.4788428051533946,y:.7279461948466053},{x:.48443913255361454,y:.7347653395141178},{x:.48859757896300793,y:.7425452455435709},{x:.49115833761814537,y:.7509869355092742},{x:.492023,y:.7597659999999999},{x:.49115833761814537,y:.7685450644907257},{x:.48859757896300793,y:.776986754456429},{x:.48443913255361454,y:.7847666604858821},{x:.4788428051533946,y:.7915858051533946},{x:.4720236604858821,y:.7971821325536145},{x:.46424375445642907,y:.8013405789630078},{x:.4558020644907258,y:.8039013376181453},{x:.447023,y:.804766},{x:.3853,y:.804766},{x:.37652093550927423,y:.8039013376181453},{x:.36807924554357097,y:.8013405789630078},{x:.3602993395141179,y:.7971821325536145},{x:.3534801948466053,y:.7915858051533946},{x:.34788386744638544,y:.7847666604858821},{x:.34372542103699205,y:.776986754456429},{x:.3411646623818546,y:.7685450644907257},{x:.3403,y:.7597659999999999}]],k:[[{x:.020185999999999996,y:.05318299999999998},{x:.02105066238185463,y:.04440393550927419},{x:.02361142103699209,y:.03596224554357094},{x:.027769867446385453,y:.028182339514117884},{x:.03336619484660536,y:.021363194846605343},{x:.04018533951411791,y:.01576686744638544},{x:.047965245543570956,y:.011608421036992077},{x:.056406935509274225,y:.009047662381854615},{x:.065186,y:.008182999999999982},{x:.07396506449072576,y:.009047662381854615},{x:.08240675445642903,y:.011608421036992077},{x:.0901866604858821,y:.015766867446385446},{x:.09700580515339463,y:.021363194846605343},{x:.10260213255361453,y:.028182339514117884},{x:.10676057896300789,y:.03596224554357094},{x:.10932133761814536,y:.04440393550927421},{x:.11018599999999999,y:.05318299999999998},{x:.11018599999999999,y:.16578332733911408},{x:.23477705990096162,y:.26351643594805596},{x:.5068321321577423,y:.019673199736523116},{x:.5139466814455551,y:.014457569113271652},{x:.5219420457215526,y:.010730135081525344},{x:.5305109676204599,y:.008634140840755075},{x:.539324148279209,y:.008250134274186548},{x:.5480429021075728,y:.009592872538819623},{x:.5563321722854605,y:.012610754956160736},{x:.5638734068086124,y:.017187805997359452},{x:.5703768002634768,y:.02314813215774228},{x:.5755924308867283,y:.030262681445555134},{x:.5793198649184746,y:.03825804572155257},{x:.5814158591592449,y:.04682696762045996},{x:.5817998657258134,y:.05564014827920904},{x:.5804571274611804,y:.06435890210757275},{x:.5774392450438393,y:.07264817228546054},{x:.5728621940026405,y:.08018940680861247},{x:.5669018678422577,y:.08669280026347684},{x:.3066862956724008,y:.3199242805817128},{x:.5215978711622948,y:.4885076152557163},{x:.5279716470169837,y:.49460635247919954},{x:.533033147947031,y:.5018313661609891},{x:.5365878633102175,y:.5099050030771282},{x:.5384991873886431,y:.5185169978886772},{x:.5386936690698568,y:.5273363964646907},{x:.5371638345319164,y:.5360242742638681},{x:.5339684744581735,y:.5442467610146052},{x:.5292303847442837,y:.5516878711622948},{x:.5231316475208004,y:.5580616470169838},{x:.5159066338390108,y:.5631231479470311},{x:.5078329969228718,y:.5666778633102175},{x:.4992210021113228,y:.5685891873886431},{x:.49040160353530926,y:.5687836690698569},{x:.4817137257361318,y:.5672538345319164},{x:.47349123898539475,y:.5640584744581736},{x:.46605012883770514,y:.5593203847442837},{x:.11018599999999999,y:.28016947631338524},{x:.11018599999999999,y:.7597659999999999},{x:.10932133761814536,y:.7685450644907257},{x:.10676057896300789,y:.776986754456429},{x:.10260213255361453,y:.7847666604858821},{x:.09700580515339463,y:.7915858051533946},{x:.09018666048588207,y:.7971821325536145},{x:.08240675445642903,y:.8013405789630078},{x:.07396506449072576,y:.8039013376181453},{x:.065186,y:.804766},{x:.056406935509274204,y:.8039013376181453},{x:.04796524554357093,y:.8013405789630078},{x:.04018533951411791,y:.7971821325536145},{x:.03336619484660536,y:.7915858051533946},{x:.027769867446385453,y:.7847666604858821},{x:.02361142103699209,y:.776986754456429},{x:.02105066238185463,y:.7685450644907257},{x:.020185999999999996,y:.7597659999999999},{x:.020185999999999996,y:.05318299999999998}]],l:[[{x:.25602600000000003,y:.05355900000000002},{x:.25689066238185465,y:.044779935509274234},{x:.2594514210369921,y:.036338245543570985},{x:.2636098674463855,y:.028558339514117927},{x:.26920619484660535,y:.021739194846605386},{x:.27602533951411795,y:.016142867446385482},{x:.283805245543571,y:.01198442103699212},{x:.2922469355092743,y:.009423662381854658},{x:.301026,y:.008559000000000025},{x:.3098050644907258,y:.009423662381854658},{x:.3182467544564291,y:.01198442103699212},{x:.32602666048588214,y:.01614286744638549},{x:.3328458051533947,y:.021739194846605386},{x:.33844213255361455,y:.028558339514117927},{x:.34260057896300794,y:.036338245543570985},{x:.3451613376181454,y:.044779935509274255},{x:.346026,y:.05355900000000002},{x:.346026,y:.765137},{x:.3451613376181454,y:.7739160644907257},{x:.34260057896300794,y:.782357754456429},{x:.33844213255361455,y:.7901376604858821},{x:.3328458051533947,y:.7969568051533946},{x:.32602666048588214,y:.8025531325536145},{x:.3182467544564291,y:.8067115789630078},{x:.3098050644907258,y:.8092723376181453},{x:.301026,y:.810137},{x:.2922469355092743,y:.8092723376181453},{x:.283805245543571,y:.8067115789630078},{x:.27602533951411795,y:.8025531325536145},{x:.26920619484660535,y:.7969568051533946},{x:.2636098674463855,y:.7901376604858821},{x:.2594514210369921,y:.782357754456429},{x:.25689066238185465,y:.7739160644907257},{x:.25602600000000003,y:.765137},{x:.25602600000000003,y:.05355900000000002}]],m:[[{x:.005538000000000001,y:.03920400000000002},{x:.006402662381854635,y:.030424935509274227},{x:.008963421036992096,y:.02198324554357097},{x:.013121867446385459,y:.01420333951411792},{x:.018718194846605363,y:.00738419484660538},{x:.025537339514117914,y:.0017878674463854757},{x:.03331724554357096,y:-.002370578963007887},{x:.04175893550927423,y:-.004931337618145348},{x:.050538,y:-.005795999999999982},{x:.059317064490725775,y:-.004931337618145348},{x:.06775875445642904,y:-.002370578963007887},{x:.0755386604858821,y:.0017878674463854827},{x:.08235780515339464,y:.00738419484660538},{x:.08795413255361453,y:.01420333951411792},{x:.0921125789630079,y:.02198324554357098},{x:.09467333761814536,y:.030424935509274248},{x:.095538,y:.03920400000000002},{x:.095538,y:.3993271266071161},{x:.14963521853994496,y:.4943223065353007},{x:.1738257653562211,y:.5150589999999999},{x:.22021623464377893,y:.5150589999999999},{x:.2416666625786254,y:.49667119950297894},{x:.27741,y:.4029520066676719},{x:.27741,y:.03920400000000002},{x:.2782746623818546,y:.030424935509274227},{x:.28083542103699205,y:.02198324554357097},{x:.28499386744638544,y:.01420333951411792},{x:.2905901948466053,y:.00738419484660538},{x:.2974093395141179,y:.0017878674463854757},{x:.30518924554357096,y:-.002370578963007887},{x:.31363093550927423,y:-.004931337618145348},{x:.32241,y:-.005795999999999982},{x:.33118906449072577,y:-.004931337618145348},{x:.33963075445642904,y:-.002370578963007887},{x:.3474106604858821,y:.0017878674463854827},{x:.35422980515339464,y:.00738419484660538},{x:.3598261325536145,y:.01420333951411792},{x:.3639845789630079,y:.02198324554357098},{x:.36654533761814534,y:.030424935509274248},{x:.36740999999999996,y:.03920400000000002},{x:.36740999999999996,y:.3993264781598986},{x:.4215891088917321,y:.494459500052724},{x:.445289826307752,y:.5150589999999999},{x:.4920928256254945,y:.5150589999999999},{x:.5065149999999999,y:.5026965582556255},{x:.5065149999999999,y:.03920400000000002},{x:.5073796623818546,y:.030424935509274227},{x:.5099404210369921,y:.02198324554357097},{x:.5140988674463854,y:.01420333951411792},{x:.5196951948466053,y:.00738419484660538},{x:.5265143395141179,y:.0017878674463854757},{x:.534294245543571,y:-.002370578963007887},{x:.5427359355092742,y:-.004931337618145348},{x:.551515,y:-.005795999999999982},{x:.5602940644907257,y:-.004931337618145348},{x:.568735754456429,y:-.002370578963007887},{x:.5765156604858821,y:.0017878674463854827},{x:.5833348051533946,y:.00738419484660538},{x:.5889311325536145,y:.01420333951411792},{x:.5930895789630078,y:.02198324554357098},{x:.5956503376181453,y:.030424935509274248},{x:.596515,y:.03920400000000002},{x:.596515,y:.523393},{x:.5963454778388272,y:.5251141873868636},{x:.5963825315707437,y:.5268433058919912},{x:.5959141404350922,y:.5294936295415332},{x:.5956503376181453,y:.5321720644907257},{x:.5951482857762117,y:.5338271076115645},{x:.59484729324509,y:.5355302304139588},{x:.5938708496195351,y:.5380382502602514},{x:.5930895789630078,y:.540613754456429},{x:.592274291011045,y:.5421390509322689},{x:.5916468191910574,y:.543750727977755},{x:.5901998472565338,y:.5460200622246176},{x:.5889311325536145,y:.5483936604858821},{x:.5878339395503975,y:.5497305940285525},{x:.5869041018316961,y:.5511888894721116},{x:.5850422079081763,y:.5531323288770946},{x:.5833348051533946,y:.5552128051533947},{x:.581997871610724,y:.5563099981566119},{x:.5808014011353795,y:.5575588705221693},{x:.5380264011353795,y:.5942248705221693},{x:.5358211367621821,y:.5957677297988329},{x:.5337406604858821,y:.5974751325536145},{x:.5322153640100423,y:.5982904205055773},{x:.5307982404674333,y:.599281876328501},{x:.5283343527176928,y:.600364864260089},{x:.525960754456429,y:.6016335789630078},{x:.5243057113355902,y:.6021356308049415},{x:.5227223939887274,y:.6028315689939708},{x:.5200945686869033,y:.6034130669616181},{x:.5175190644907257,y:.6041943376181453},{x:.5157978771038628,y:.6043638597793182},{x:.5141092119504517,y:.6047375358201355},{x:.5114184349491921,y:.6047951971830532},{x:.50874,y:.605059},{x:.428467,y:.605059},{x:.42563553135621585,y:.6047801246797119},{x:.42279150043448566,y:.6046996620098968},{x:.4212557149999115,y:.6043487504203328},{x:.4196879355092742,y:.6041943376181453},{x:.41696527861756566,y:.6033684286794448},{x:.4141915924406847,y:.6027346691689239},{x:.4127537761476033,y:.6020908833721776},{x:.4112462455435709,y:.6016335789630078},{x:.40873703058140176,y:.6002923756232341},{x:.4061402803536474,y:.5991296742945802},{x:.40485568767586616,y:.5982177546177817},{x:.4034663395141179,y:.5974751325536145},{x:.4012669942053008,y:.5956701765049598},{x:.3989469715816508,y:.5940232153181825},{x:.3567609715816508,y:.5573572153181825},{x:.3545792701559384,y:.5550484712393128},{x:.3522737143614353,y:.552863400803129},{x:.35155574109793963,y:.5518488790642903},{x:.35070210094674875,y:.5509455305944583},{x:.3490127339279754,y:.5482555195520005},{x:.34717776483660073,y:.5456626430091704},{x:.33048446785976626,y:.5163509060824124},{x:.3216828574856715,y:.5394287684036221},{x:.32062739498214626,y:.5415455848316745},{x:.31976928952310246,y:.5437498007710907},{x:.3186639603788477,y:.5454834136126945},{x:.31774653490223986,y:.5473233854865517},{x:.3162983824161672,y:.5491936173608123},{x:.31502674401548947,y:.5511880718386934},{x:.3136044423732838,y:.5526727347769701},{x:.3123456842645886,y:.5542983712755478},{x:.3105604934838748,y:.5558501466339272},{x:.30892419049215825,y:.5575581938831911},{x:.2661511904921582,y:.594224193883191},{x:.26394553725639397,y:.5957674011217274},{x:.2618646604858821,y:.5974751325536145},{x:.26033982189406285,y:.5982901757614695},{x:.258923146662659,y:.5992813666868191},{x:.25645880963824363,y:.6003646200309664},{x:.25408475445642903,y:.6016335789630078},{x:.25243020816870526,y:.6021354800922637},{x:.25084738219782576,y:.6028312459348294},{x:.24821906447459133,y:.6034129165660671},{x:.24564306449072576,y:.6041943376181453},{x:.24392239379305308,y:.6043638088898747},{x:.2422342441971012,y:.6047374117585159},{x:.2395429505511757,y:.6047951464006902},{x:.236864,y:.605059},{x:.157178,y:.605059},{x:.1544990494488241,y:.6047951464006902},{x:.1518077558028988,y:.6047374117585159},{x:.15011960620694695,y:.6043638088898747},{x:.14839893550927424,y:.6041943376181453},{x:.14582293552540848,y:.6034129165660671},{x:.1431946178021742,y:.6028312459348294},{x:.1416117918312948,y:.6021354800922637},{x:.13995724554357097,y:.6016335789630078},{x:.13758319036175665,y:.6003646200309664},{x:.135118853337341,y:.5992813666868191},{x:.13370217810593676,y:.5982901757614691},{x:.13217733951411792,y:.5974751325536145},{x:.13009646274360603,y:.5957674011217274},{x:.1278908095078418,y:.594224193883191},{x:.09495385911112918,y:.5659898819750746},{x:.09467333761814536,y:.5688380644907257},{x:.0921125789630079,y:.577279754456429},{x:.08795413255361453,y:.5850596604858821},{x:.08235780515339464,y:.5918788051533946},{x:.07553866048588208,y:.5974751325536145},{x:.06775875445642904,y:.6016335789630078},{x:.059317064490725775,y:.6041943376181453},{x:.050538,y:.605059},{x:.04175893550927421,y:.6041943376181453},{x:.033317245543570934,y:.6016335789630078},{x:.025537339514117904,y:.5974751325536145},{x:.018718194846605356,y:.5918788051533946},{x:.013121867446385459,y:.5850596604858821},{x:.008963421036992096,y:.577279754456429},{x:.006402662381854635,y:.5688380644907257},{x:.005538000000000001,y:.560059},{x:.005538000000000001,y:.03920400000000002}]],n:[[{x:.047041,y:.03920400000000002},{x:.04790566238185463,y:.030424935509274227},{x:.050466421036992094,y:.02198324554357097},{x:.05462486744638546,y:.01420333951411792},{x:.06022119484660536,y:.00738419484660538},{x:.06704033951411792,y:.0017878674463854757},{x:.07482024554357096,y:-.002370578963007887},{x:.08326193550927423,y:-.004931337618145348},{x:.092041,y:-.005795999999999982},{x:.10082006449072577,y:-.004931337618145348},{x:.10926175445642904,y:-.002370578963007887},{x:.1170416604858821,y:.0017878674463854827},{x:.12386080515339463,y:.00738419484660538},{x:.12945713255361452,y:.01420333951411792},{x:.1336155789630079,y:.02198324554357098},{x:.13617633761814535,y:.030424935509274248},{x:.137041,y:.03920400000000002},{x:.137041,y:.3923986904044417},{x:.23217657812189968,y:.4860775193429304},{x:.29246969284729285,y:.5150589999999999},{x:.3857956927587408,y:.5150589999999999},{x:.4353266752666751,y:.4910865745843881},{x:.465011,y:.4037995608673687},{x:.465011,y:.03920400000000002},{x:.4658756623818546,y:.030424935509274227},{x:.46843642103699207,y:.02198324554357097},{x:.47259486744638546,y:.01420333951411792},{x:.4781911948466053,y:.00738419484660538},{x:.4850103395141179,y:.0017878674463854757},{x:.492790245543571,y:-.002370578963007887},{x:.5012319355092743,y:-.004931337618145348},{x:.510011,y:-.005795999999999982},{x:.5187900644907257,y:-.004931337618145348},{x:.527231754456429,y:-.002370578963007887},{x:.5350116604858821,y:.0017878674463854827},{x:.5418308051533947,y:.00738419484660538},{x:.5474271325536145,y:.01420333951411792},{x:.5515855789630079,y:.02198324554357098},{x:.5541463376181454,y:.030424935509274248},{x:.555011,y:.03920400000000002},{x:.555011,y:.411242},{x:.5547211401667089,y:.41418499627592825},{x:.5546227314347089,y:.4171405946120584},{x:.5542897326303223,y:.4185651504993601},{x:.5541463376181454,y:.4200210644907258},{x:.5532878972691104,y:.42285096307022063},{x:.5526147708021555,y:.4257305718218671},{x:.5144747708021555,y:.537881571821867},{x:.5144109474804813,y:.5380222238814931},{x:.5143747633675698,y:.5381723808934484},{x:.5125889395552703,y:.5420375142269895},{x:.5108295711501452,y:.5459147613418461},{x:.5107395343200961,y:.546040259499208},{x:.5106747512949527,y:.5461804721160435},{x:.5081691914797779,y:.5496229410537735},{x:.5056872154570532,y:.5530824522038071},{x:.5055744251835149,y:.5531879736350976},{x:.505483532821465,y:.5533128535645805},{x:.5023545242619802,y:.5562003659557777},{x:.4992453215682988,y:.5591091940676126},{x:.49911411231822944,y:.5591906836434047},{x:.49900060356177384,y:.559295431819878},{x:.49536839230215873,y:.5615170221826804},{x:.49175144785337105,y:.5637633826232722},{x:.4916068619246677,y:.563817708744868},{x:.49147509885166074,y:.5638982997546532},{x:.41571709885166075,y:.6005642997546532},{x:.4144883994140345,y:.6010164083750983},{x:.41333375445642906,y:.6016335789630078},{x:.41035728417594536,y:.6025364813514484},{x:.4074382196167836,y:.6036105717354909},{x:.4061449272779714,y:.6038142858466193},{x:.4048920644907258,y:.6041943376181453},{x:.4017966387343604,y:.6044992104448776},{x:.3987241185432898,y:.6049831812385367},{x:.3974159338025849,y:.6049306722213019},{x:.396113,y:.605059},{x:.282216,y:.605059},{x:.28097323419788345,y:.6049365982521052},{x:.2797255990169867,y:.6049900349640848},{x:.2765922846246742,y:.6045051123806029},{x:.2734369355092743,y:.6041943376181453},{x:.2722419284999821,y:.603831836204989},{x:.27100784129389754,y:.6036408445963318},{x:.26802933636200627,y:.6025539603505436},{x:.264995245543571,y:.6016335789630078},{x:.2638939207763026,y:.6010449086106044},{x:.2627208068242762,y:.6006168283817219},{x:.18644080682427616,y:.563950828381722},{x:.18387931815291048,y:.5623935720684188},{x:.18122474955630472,y:.5610008994562176},{x:.18011833133270075,y:.5601070811947741},{x:.17890296169536754,y:.5593681975674947},{x:.17669449694619624,y:.5573411418478543},{x:.17436263208920222,y:.5554573484070612},{x:.137041,y:.5187071981771466},{x:.137041,y:.560059},{x:.13617633761814535,y:.5688380644907257},{x:.1336155789630079,y:.577279754456429},{x:.12945713255361452,y:.5850596604858821},{x:.12386080515339463,y:.5918788051533946},{x:.11704166048588208,y:.5974751325536145},{x:.10926175445642904,y:.6016335789630078},{x:.10082006449072577,y:.6041943376181453},{x:.092041,y:.605059},{x:.08326193550927423,y:.6041943376181453},{x:.07482024554357093,y:.6016335789630078},{x:.06704033951411792,y:.5974751325536145},{x:.06022119484660536,y:.5918788051533946},{x:.05462486744638546,y:.5850596604858821},{x:.050466421036992094,y:.577279754456429},{x:.04790566238185463,y:.5688380644907257},{x:.047041,y:.560059},{x:.047041,y:.03920400000000002}]],o:[[{x:.021894999999999998,y:.25490100000000004},{x:.022142430975592695,y:.2523887911456351},{x:.02217771682540861,y:.24986467341374632},{x:.02257373987793045,y:.24800963837050735},{x:.02275966238185463,y:.24612193550927428},{x:.023492446675001572,y:.24370626943231966},{x:.02401948545822835,y:.2412375358426815},{x:.060310485458228355,y:.12735753584268142},{x:.06080304558444478,y:.12621387418764726},{x:.061129830312657105,y:.12501229639135567},{x:.06254436541764224,y:.12217075210694647},{x:.06379993607002282,y:.11925547753662338},{x:.06450614911208748,y:.11822988473324028},{x:.0650610709625847,y:.11711514745523491},{x:.06700278396163635,y:.114604164756607},{x:.06880297103068717,y:.11198985605258731},{x:.06969569761744246,y:.11112174505713},{x:.07045743125471368,y:.1101366870258529},{x:.14244943125471368,y:.0338456870258529},{x:.144568728324263,y:.03200109409682955},{x:.1465508815997487,y:.0300098604251366},{x:.14788834203377002,y:.029111770054614114},{x:.1491035320893312,y:.02805409342394511},{x:.1515419696884587,y:.026658398178569347},{x:.15387450686277807,y:.025092124424329433},{x:.22587150686277807,y:-.01360287557567049},{x:.22795933917571506,y:-.014473279294209745},{x:.22995424554357097,y:-.015539578963007873},{x:.23202067225559728,y:-.016166422653018674},{x:.2340138134199343,y:-.01699735024728135},{x:.23623133596214702,y:-.01744371352418634},{x:.23839593550927424,y:-.018100337618145335},{x:.2405449475487996,y:-.01831199682974963},{x:.24266189699648397,y:-.01873811583170923},{x:.2449238916202761,y:-.018743285176571887},{x:.247175,y:-.018964999999999968},{x:.354874,y:-.018964999999999968},{x:.35712497901801044,y:-.018743297917588594},{x:.3593868436844028,y:-.018738141970160445},{x:.36150392306047363,y:-.018312009573623896},{x:.3636530644907258,y:-.018100337618145335},{x:.36581753964743763,y:-.017443751257606326},{x:.36803493734305537,y:-.016997426474138877},{x:.370028203326089,y:-.016166460394901543},{x:.3720947544564291,y:-.015539578963007873},{x:.3740895461854217,y:-.014473340569958804},{x:.376177263560353,y:-.01360299896157894},{x:.448175263560353,y:.025092001038420984},{x:.4505076595021602,y:.026658160356610353},{x:.4529459593263057,y:.028053731854915283},{x:.45416130097157975,y:.029111510806286087},{x:.45549891730603415,y:.030009694621828502},{x:.4574809543881169,y:.03200078850323144},{x:.4596001404718476,y:.03384523318438343},{x:.5315941404718476,y:.11013623318438343},{x:.5323560786638525,y:.11112152750713142},{x:.5332490289693128,y:.11198985605258731},{x:.5350490398057314,y:.11460390882403626},{x:.5369905975332091,y:.11711461878219896},{x:.5375456739097991,y:.11822962771804991},{x:.5382520639299772,y:.11925547753662338},{x:.5395075116659538,y:.12217046671076734},{x:.5409219476918898,y:.12501171320336152},{x:.5412488309792026,y:.126213587584214},{x:.5417415145417717,y:.12735753584268142},{x:.5780325145417716,y:.2412375358426815},{x:.5785595533249983,y:.2437062694323195},{x:.5792923376181454,y:.24612193550927428},{x:.5794782601220696,y:.2480096383705079},{x:.5798742831745913,y:.24986467341374632},{x:.5799095690244073,y:.25238879114563434},{x:.580157,y:.25490100000000004},{x:.580157,y:.33119200000000004},{x:.5799156873690254,y:.3336420882589673},{x:.5798881240960263,y:.3361038771468651},{x:.5794843860383102,y:.3380211641581212},{x:.5792923376181454,y:.33997106449072584},{x:.5785776732343003,y:.3423269972319261},{x:.5780703683949873,y:.3447361062088315},{x:.5417793683949873,y:.4597211062088315},{x:.5412650895934552,y:.4609244011905288},{x:.540921633437906,y:.46218711230867804},{x:.5395351283421765,y:.46497211555478546},{x:.5383124760126231,y:.46783284286481475},{x:.5375733277285976,y:.46891268605384906},{x:.5369901282681178,y:.47008412955994733},{x:.5350869372989228,y:.47254512602400234},{x:.5333296776789325,y:.47511235762423976},{x:.5323940649664491,y:.4760272512524403},{x:.5315935342292432,y:.47706240922950055},{x:.45959953422924316,y:.5533504092295005},{x:.4572787448447235,y:.5553702403350376},{x:.45508230823461715,y:.5575246421731296},{x:.45395838697349994,y:.5582600166131206},{x:.4529452394037514,y:.5591417799431011},{x:.45027499383570063,y:.5606700370119551},{x:.44770045819082444,y:.5623545390972755},{x:.3757024581908245,y:.5999485390972755},{x:.37385313535723513,y:.6006937047902838},{x:.3720947544564291,y:.6016335789630078},{x:.36977177563531344,y:.6023382468844833},{x:.3675201821794923,y:.6032455034042244},{x:.36556101895058973,y:.6036155659602718},{x:.3636530644907258,y:.6041943376181453},{x:.36123724716457173,y:.6044322748568528},{x:.35885192047906295,y:.6048828346046191},{x:.35685820639902277,y:.60486357272721},{x:.354874,y:.605059},{x:.247175,y:.605059},{x:.24519066624232813,y:.6048635601834779},{x:.24319682408363533,y:.6048828119349353},{x:.24081162559758007,y:.6044322623250186},{x:.23839593550927424,y:.6041943376181453},{x:.23648785858508298,y:.6036155288111242},{x:.234528571713998,y:.6032454313367869},{x:.23227710201651716,y:.602338209770572},{x:.22995424554357097,y:.6016335789630078},{x:.2281957517789948,y:.6006936444633418},{x:.22634631449119302,y:.5999484204015954},{x:.15434931449119302,y:.5623544204015953},{x:.15177463525955168,y:.5606698034147719},{x:.14910425200363037,y:.5591414183832311},{x:.14809125527340347,y:.55825976164439},{x:.1469674919716301,y:.5575244814106152},{x:.14477093694990967,y:.5553699388664325},{x:.14245003748743465,y:.5533499553954043},{x:.07045803748743465,y:.4770619553954044},{x:.06965771196430402,y:.47602703312304784},{x:.06872232232106745,y:.47511235762423976},{x:.06696488716695402,y:.4725448695811053},{x:.06506154021654398,y:.4700836008922148},{x:.0644784960433022,y:.46891242859710086},{x:.06373952398737684,y:.46783284286481475},{x:.06251674952606694,y:.46497182979435886},{x:.06113014455468816,y:.46218652912371366},{x:.06078678779193787,y:.46092411430034236},{x:.06027263160501272,y:.4597211062088315},{x:.023981631605012717,y:.3447361062088315},{x:.0234743267656997,y:.3423269972319261},{x:.02275966238185463,y:.33997106449072584},{x:.0225676139616898,y:.3380211641581212},{x:.022163875903973694,y:.3361038771468651},{x:.022136312630974576,y:.33364208825896713},{x:.021894999999999998,y:.33119200000000004},{x:.021894999999999998,y:.25490100000000004}],[{x:.111895,y:.2618978965790472},{x:.111895,y:.324259211613835},{x:.14299436878278687,y:.42279496206129447},{x:.20271328316555492,y:.48607750096051383},{x:.25821631520114247,y:.5150589999999999},{x:.3438328207386419,y:.5150589999999999},{x:.3993370917152178,y:.4860772565752743},{x:.4590577300605173,y:.42279464888454726},{x:.490157,y:.324259211613835},{x:.490157,y:.2618978965790472},{x:.4591028039244665,y:.16445082019422033},{x:.39914727445977055,y:.10091681321598435},{x:.3435475642149213,y:.07103500000000003},{x:.2585015743575747,y:.07103500000000003},{x:.20290309936793577,y:.10091656436690524},{x:.14294929572583875,y:.164450507494742},{x:.111895,y:.2618978965790472}]],p:[[{x:.031904,y:-.15424400000000005},{x:.032768662381854635,y:-.16302306449072582},{x:.0353294210369921,y:-.17146475445642909},{x:.03948786744638546,y:-.17924466048588214},{x:.04508419484660536,y:-.18606380515339468},{x:.051903339514117915,y:-.19166013255361458},{x:.05968324554357096,y:-.19581857896300794},{x:.06812493550927423,y:-.1983793376181454},{x:.076904,y:-.19924400000000003},{x:.08568306449072577,y:-.1983793376181454},{x:.09412475445642904,y:-.19581857896300794},{x:.1019046604858821,y:-.19166013255361458},{x:.10872380515339464,y:-.18606380515339468},{x:.11432013255361453,y:-.17924466048588214},{x:.1184785789630079,y:-.17146475445642909},{x:.12103933761814537,y:-.16302306449072582},{x:.121904,y:-.15424400000000005},{x:.121904,y:.08461372659928788},{x:.12362832174470662,y:.08333438131496537},{x:.12536021772829115,y:.08178035235824195},{x:.1271620685101291,y:.08071254912256186},{x:.12884414120453105,y:.07946455014784792},{x:.13094744853162613,y:.07846927732892851},{x:.13294924262910485,y:.07728298474798974},{x:.20690724262910487,y:.04275398474798971},{x:.20784573679964677,y:.04242345923251374},{x:.20872324554357097,y:.041954421036992075},{x:.21199903754957586,y:.040960720395783044},{x:.21522783943974558,y:.03982357810698025},{x:.21621278303720604,y:.03968249467654502},{x:.21716493550927424,y:.0393936623818546},{x:.22057164546850772,y:.03905813073713887},{x:.2239602522910248,y:.038572746319036566},{x:.22495379448531613,y:.03862652673075318},{x:.225944,y:.038528999999999966},{x:.338005,y:.038528999999999966},{x:.33886621477794643,y:.03861382225207184},{x:.3397300481447032,y:.038562076501738984},{x:.34324908380057223,y:.0390454971728409},{x:.3467840644907258,y:.0393936623818546},{x:.3476121832677305,y:.039644869466491955},{x:.3484695134136621,y:.03976264352593092},{x:.35182662109175783,y:.04092330520367998},{x:.35522575445642907,y:.04195442103699206},{x:.3559889530923063,y:.042362359206810904},{x:.35680683330070073,y:.04264512708496585},{x:.4318888333007007,y:.07717412708496588},{x:.43400924312431544,y:.07841428389434572},{x:.43622962614931016,y:.07946501028796468},{x:.4378075563324746,y:.08063579029221077},{x:.43950360927818305,y:.0816277549521855},{x:.44134133343031445,y:.08325775393151234},{x:.4433140658676044,y:.08472146615145025},{x:.5183930658676044,y:.1527974661514503},{x:.519792625068414,y:.15434228537837358},{x:.5213447099268285,y:.1557337827706549},{x:.522746916505161,y:.1576032022519019},{x:.5243158963961404,y:.15933502631539204},{x:.52538718417891,y:.1611232027292085},{x:.5266379784876352,y:.1627907596241023},{x:.5276485364111687,y:.16489781566710873},{x:.5288495066792682,y:.16690245600899573},{x:.5295513540552914,y:.16886527099294393},{x:.530452790490496,y:.17074480411415546},{x:.5674347904904959,y:.2723648041141554},{x:.5682868803844835,y:.2756900562357905},{x:.5692833376181453,y:.27897493550927416},{x:.5693799285821196,y:.2799556400244087},{x:.5696245448495124,y:.2809102467717411},{x:.5698115375679212,y:.2843378395980749},{x:.570148,y:.28775399999999995},{x:.570148,y:.355831},{x:.5698183264321395,y:.3591782319067787},{x:.5696454905753794,y:.362537215959393},{x:.5693867528695432,y:.3635600718226051},{x:.5692833376181453,y:.3646100644907258},{x:.5683069860848939,y:.3678286641524751},{x:.567482165940186,y:.37108938766543825},{x:.530500165940186,y:.47369538766543823},{x:.5295747233109523,y:.4756403735939819},{x:.5288495066792682,y:.4776685439910043},{x:.5276841925618525,y:.47961366765708685},{x:.5267099630491849,y:.4816611880905031},{x:.5254228546094585,y:.48338825675926556},{x:.5243158963961404,y:.48523597368460797},{x:.5227934986603558,y:.48691638083844907},{x:.5214385372739072,y:.48873449599152474},{x:.5198392258792078,y:.49017727712011666},{x:.5183930658676044,y:.4917735338485497},{x:.4433140658676044,y:.5598495338485497},{x:.44114571117720175,y:.5614583923016819},{x:.43910641435493325,y:.5632279843609703},{x:.43761161896162687,y:.5640805897495177},{x:.43622962614931016,y:.5651059897120353},{x:.43378906307257026,y:.5662609093863238},{x:.43144372048223223,y:.5675986521566495},{x:.35636172048223225,y:.6011446521566495},{x:.355773047491519,y:.6013410447411239},{x:.35522575445642907,y:.6016335789630078},{x:.3515938477815883,y:.6027353058079922},{x:.3479935881359665,y:.6039364213810477},{x:.34737791203915763,y:.6040141959337602},{x:.3467840644907258,y:.6041943376181453},{x:.34300700763927916,y:.6045663452480041},{x:.3392415999493003,y:.6050420059085138},{x:.33862258083352115,y:.60499817359702},{x:.338005,y:.605059},{x:.225944,y:.605059},{x:.2251997336627212,y:.6049856961639699},{x:.22445344765540867,y:.6050343071552383},{x:.22081614914993766,y:.6045539507735711},{x:.21716493550927424,y:.6041943376181453},{x:.21644927090994795,y:.6039772431353645},{x:.21570784104506457,y:.6038793269025836},{x:.2122341450916469,y:.6026985986973952},{x:.20872324554357097,y:.6016335789630078},{x:.20806368527139987,y:.6012810366527016},{x:.20735560428285457,y:.6010403560617851},{x:.13339760428285458,y:.5674943560617851},{x:.13116986982932302,y:.566206971138138},{x:.12884414120453105,y:.5651064498521521},{x:.1273598902040749,y:.5640052229355318},{x:.12575970914356202,y:.5630804946901414},{x:.12382593632220404,y:.5613832370749092},{x:.121904,y:.5599572734007121},{x:.121904,y:.560059},{x:.12103933761814537,y:.5688380644907257},{x:.1184785789630079,y:.577279754456429},{x:.11432013255361453,y:.5850596604858821},{x:.10872380515339464,y:.5918788051533946},{x:.10190466048588208,y:.5974751325536145},{x:.09412475445642904,y:.6016335789630078},{x:.08568306449072577,y:.6041943376181453},{x:.076904,y:.605059},{x:.0681249355092742,y:.6041943376181453},{x:.059683245543570934,y:.6016335789630078},{x:.051903339514117915,y:.5974751325536145},{x:.04508419484660536,y:.5918788051533946},{x:.03948786744638546,y:.5850596604858821},{x:.0353294210369921,y:.577279754456429},{x:.032768662381854635,y:.5688380644907257},{x:.031904,y:.560059},{x:.031904,y:-.15424400000000005}],[{x:.121904,y:.20607608160839302},{x:.121904,y:.438494918391607},{x:.17699192809119763,y:.48844251958412144},{x:.23567259519301437,y:.5150589999999999},{x:.3284092961747297,y:.5150589999999999},{x:.38817711429028284,y:.4883552464171925},{x:.4496333594179428,y:.43263133769024387},{x:.48014799999999996,y:.3479689286382035},{x:.48014799999999996,y:.29568777567179994},{x:.44968806913177495,y:.21198926897045803},{x:.3879916447872207,y:.1560475837631447},{x:.32815352882369925,y:.12852899999999995},{x:.2359312215606538,y:.12852899999999995},{x:.17717907548697515,y:.15595879598931894},{x:.121904,y:.20607608160839302}]],q:[[{x:.031905,y:.285813},{x:.03224141038262204,y:.2823973680650777},{x:.0324282929389951,y:.2789703010434802},{x:.03267301908894614,y:.2780151713289937},{x:.032769662381854636,y:.2770339355092742},{x:.03376596546737772,y:.2737495643941025},{x:.03461784473664685,y:.27042480648246636},{x:.07159784473664685,y:.1688028064824664},{x:.0724995244823713,y:.166922651750872},{x:.0732016076706368,y:.1649592141085361},{x:.07440224792307432,y:.1629551516523985},{x:.07541246819615938,y:.16084867156853302},{x:.07666362241043057,y:.15918055247485355},{x:.0777352629490018,y:.15739181137154173},{x:.07930380642556048,y:.15566048970702676},{x:.08070556947724908,y:.15379156924569237},{x:.08225811700526783,y:.15239959067120604},{x:.08365813234923056,y:.15085428642438087},{x:.15873913234923054,y:.08277728642438094},{x:.16071062555900373,y:.0813145118522212},{x:.16254708404197357,y:.07968542770293169},{x:.16424441690754124,y:.07869257021816739},{x:.16582360332185575,y:.07752087268448676},{x:.16804258800473576,y:.07647082416071167},{x:.17016157800418052,y:.07523131768336211},{x:.24523757800418056,y:.0406993176833621},{x:.24605678866737324,y:.04041603175027397},{x:.24682124554357093,y:.04000742103699214},{x:.2502190216384501,y:.03897671692697023},{x:.2535747153580455,y:.03781630621794852},{x:.25443345146196317,y:.037698283616711674},{x:.2552629355092742,y:.03744666238185468},{x:.25879650468596477,y:.037098636194782805},{x:.2623141045905799,y:.03661518582049534},{x:.2631793653883337,y:.03666696209348752},{x:.264042,y:.036582000000000045},{x:.376106,y:.036582000000000045},{x:.3770966034546813,y:.036679565924422064},{x:.37809054588497415,y:.03662578154659327},{x:.38147875036256007,y:.037111169723096304},{x:.3848850644907258,y:.03744666238185468},{x:.3858375996101805,y:.03773561075136079},{x:.38682293652697,y:.03787676837406198},{x:.39005134306992567,y:.03901383585544661},{x:.39332675445642906,y:.04000742103699214},{x:.39420461585020444,y:.04047664772778637},{x:.3951434813083616,y:.04080732274273922},{x:.4691044813083616,y:.07533932274273922},{x:.47110618065167786,y:.07652560719175487},{x:.47320939667814427,y:.07752087268448679},{x:.4748915208069018,y:.0787689461703934},{x:.4766934263594154,y:.07983682509171056},{x:.47842523099597173,y:.08139082758714347},{x:.48014799999999996,y:.08266905805748193},{x:.48014799999999996,y:-.15619500000000008},{x:.4810126623818546,y:-.16497406449072585},{x:.483573421036992,y:-.17341575445642912},{x:.4877318674463854,y:-.18119566048588218},{x:.4933281948466053,y:-.18801480515339472},{x:.5001473395141178,y:-.19361113255361462},{x:.5079272455435709,y:-.19776957896300798},{x:.5163689355092742,y:-.20033033761814545},{x:.525148,y:-.20119500000000007},{x:.5339270644907257,y:-.20033033761814545},{x:.542368754456429,y:-.19776957896300798},{x:.5501486604858821,y:-.19361113255361462},{x:.5569678051533946,y:-.18801480515339472},{x:.5625641325536145,y:-.18119566048588218},{x:.5667225789630078,y:-.17341575445642912},{x:.5692833376181453,y:-.16497406449072585},{x:.570148,y:-.15619500000000008},{x:.570148,y:.5581050000000001},{x:.5692833376181453,y:.5668840644907258},{x:.5667225789630078,y:.5753257544564291},{x:.5625641325536145,y:.5831056604858822},{x:.5569678051533946,y:.5899248051533947},{x:.5501486604858821,y:.5955211325536146},{x:.542368754456429,y:.5996795789630079},{x:.5339270644907257,y:.6022403376181454},{x:.525148,y:.6031050000000001},{x:.5163689355092742,y:.6022403376181454},{x:.5079272455435709,y:.5996795789630079},{x:.5001473395141178,y:.5955211325536146},{x:.4933281948466053,y:.5899248051533947},{x:.4877318674463854,y:.5831056604858822},{x:.483573421036992,y:.5753257544564291},{x:.4810126623818546,y:.5668840644907258},{x:.48014799999999996,y:.5581050000000001},{x:.48014799999999996,y:.558005596763998},{x:.4782247267606458,y:.559432223348863},{x:.47629232280480055,y:.5611281889595863},{x:.4746904859851039,y:.5620538174856352},{x:.4732046002880372,y:.5631560030691136},{x:.4708804506539088,y:.5642554633364756},{x:.4686543108210992,y:.5655418481335316},{x:.3946933108210992,y:.5990868481335316},{x:.3939857884552202,y:.5993273179516839},{x:.39332675445642906,y:.5996795789630079},{x:.3898152875083263,y:.6007447708163117},{x:.38634099890642704,y:.6019255978665906},{x:.3856001580501581,y:.6020234163584227},{x:.3848850644907258,y:.6022403376181454},{x:.38123326077373504,y:.6026000088910167},{x:.3775953617236344,y:.6030803465985108},{x:.3768496724756141,y:.6030317546542387},{x:.376106,y:.6031050000000001},{x:.264042,y:.6031050000000001},{x:.26342400033164626,y:.6030441323453897},{x:.26280456058717394,y:.6030879828235033},{x:.25903957642572706,y:.602612304281983},{x:.2552629355092742,y:.6022403376181454},{x:.254668685221597,y:.6020600737641458},{x:.25405259303422617,y:.6019822349683996},{x:.25045275226756825,y:.6007811844842303},{x:.24682124554357093,y:.5996795789630079},{x:.24627358134186672,y:.5993868463484354},{x:.24568451278884912,y:.5991903095800973},{x:.17060851278884911,y:.5656453095800973},{x:.16826609518471405,y:.5643091772352096},{x:.16582839971196278,y:.5631560030691136},{x:.1644435861855132,y:.5621287897998347},{x:.16294590048199914,y:.5612744987855388},{x:.1609091582647261,y:.559507056844315},{x:.15874327554635076,y:.5579004698017108},{x:.08366227554635075,y:.4898404698017108},{x:.0822135909199537,y:.48824184486316324},{x:.08061175169940471,y:.4867967151276658},{x:.07925889408089541,y:.48498133393711457},{x:.07773859373239328,y:.48330368097737925},{x:.0766296214289207,y:.4814531488185024},{x:.0753404919252871,y:.4797232835162987},{x:.07436779238761855,y:.4776788549378484},{x:.07320399804016177,y:.47573684172476444},{x:.07247735524331753,y:.47370551725863386},{x:.07155047598047157,y:.4717573941431678},{x:.034570475980471575,y:.3691493941431678},{x:.03374586128764337,y:.36588916100716024},{x:.032769662381854636,y:.3626710644907258},{x:.032666195333495754,y:.36162054591923504},{x:.032407352052251925,y:.36059717166956007},{x:.03223462203187315,y:.35723870865311785},{x:.031905,y:.353892},{x:.031905,y:.285813}],[{x:.121905,y:.2937462257558374},{x:.121905,y:.3460304727958324},{x:.1524170009298456,y:.4306917867874386},{x:.21387346155335435,y:.48640130996954867},{x:.2736381428091649,y:.513105},{x:.36637802828147564,y:.513105},{x:.4250638403772601,y:.4864880590885319},{x:.48014799999999996,y:.4365549481293854},{x:.48014799999999996,y:.20413270643748072},{x:.4248733312055972,y:.15401438585682045},{x:.36611835928516706,y:.12658200000000003},{x:.27389496414813935,y:.12658200000000003},{x:.2140623112166411,y:.15410266134357853},{x:.15236330162501277,y:.21004602219345103},{x:.121905,y:.2937462257558374}]],r:[[{x:.062422000000000005,y:.03920400000000002},{x:.06328666238185464,y:.030424935509274227},{x:.0658474210369921,y:.02198324554357097},{x:.07000586744638546,y:.01420333951411792},{x:.07560219484660537,y:.00738419484660538},{x:.08242133951411793,y:.0017878674463854757},{x:.09020124554357097,y:-.002370578963007887},{x:.09864293550927423,y:-.004931337618145348},{x:.107422,y:-.005795999999999982},{x:.11620106449072577,y:-.004931337618145348},{x:.12464275445642904,y:-.002370578963007887},{x:.1324226604858821,y:.0017878674463854827},{x:.13924180515339463,y:.00738419484660538},{x:.14483813255361455,y:.01420333951411792},{x:.14899657896300791,y:.02198324554357098},{x:.15155733761814538,y:.030424935509274248},{x:.152422,y:.03920400000000002},{x:.152422,y:.3275398012121413},{x:.1925108808296549,y:.4204278633799401},{x:.27478075869941443,y:.4836647262821032},{x:.3576648607132649,y:.5150589999999999},{x:.49463,y:.5150589999999999},{x:.5034090644907258,y:.5159236623818546},{x:.511850754456429,y:.5184844210369921},{x:.5196306604858821,y:.5226428674463854},{x:.5264498051533947,y:.5282391948466053},{x:.5320461325536145,y:.5350583395141179},{x:.5362045789630079,y:.542838245543571},{x:.5387653376181454,y:.5512799355092742},{x:.53963,y:.560059},{x:.5387653376181454,y:.5688380644907257},{x:.5362045789630079,y:.577279754456429},{x:.5320461325536145,y:.5850596604858821},{x:.5264498051533947,y:.5918788051533946},{x:.5196306604858821,y:.5974751325536145},{x:.511850754456429,y:.6016335789630078},{x:.5034090644907258,y:.6041943376181453},{x:.49463,y:.605059},{x:.349428,y:.605059},{x:.34572095329292224,y:.6046938877675093},{x:.3420044651532413,y:.6044424555930356},{x:.34133700376168824,y:.6042621064259311},{x:.3406489355092742,y:.6041943376181453},{x:.33708434852821606,y:.6031130319790114},{x:.33348832364990477,y:.6021413801353276},{x:.23668632364990477,y:.5654753801353276},{x:.2347311434313091,y:.5645060813254815},{x:.23268939209293205,y:.5637356779621759},{x:.23078888495220712,y:.562551669954317},{x:.22878273496962892,y:.5615571024090896},{x:.2270542238076375,y:.5602249916656349},{x:.22520200238894322,y:.5590710654608507},{x:.152422,y:.5031286093364514},{x:.152422,y:.560059},{x:.15155733761814538,y:.5688380644907257},{x:.14899657896300791,y:.577279754456429},{x:.14483813255361455,y:.5850596604858821},{x:.13924180515339463,y:.5918788051533946},{x:.1324226604858821,y:.5974751325536145},{x:.12464275445642904,y:.6016335789630078},{x:.11620106449072577,y:.6041943376181453},{x:.107422,y:.605059},{x:.09864293550927423,y:.6041943376181453},{x:.09020124554357094,y:.6016335789630078},{x:.08242133951411793,y:.5974751325536145},{x:.07560219484660537,y:.5918788051533946},{x:.07000586744638546,y:.5850596604858821},{x:.0658474210369921,y:.577279754456429},{x:.06328666238185464,y:.5688380644907257},{x:.062422000000000005,y:.560059},{x:.062422000000000005,y:.03920400000000002}]],s:[[{x:.056563,y:.369888},{x:.056809270227573656,y:.3673875764180495},{x:.05684306423764694,y:.36487528163458033},{x:.05724057756471223,y:.36300843953465567},{x:.057427662381854636,y:.3611089355092742},{x:.05815700903783985,y:.3587046018033244},{x:.05868027810379197,y:.35624717294397146},{x:.05943435615016931,y:.3544937526945111},{x:.0599884210369921,y:.352667245543571},{x:.06117281573842168,y:.3504513989095756},{x:.06216545092350078,y:.34814327358726177},{x:.06324711489275962,y:.3465706581451233},{x:.06414686744638545,y:.3448873395141179},{x:.06574079456909979,y:.3429451336955602},{x:.0671646494598194,y:.3408750118720105},{x:.06853233161222538,y:.3395436359667022},{x:.06974319484660536,y:.33806819484660533},{x:.07168540066516299,y:.33647426772389105},{x:.07348575731657993,y:.3347217030198468},{x:.07508689839402109,y:.33368273068076537},{x:.07656233951411792,y:.33247186744638546},{x:.07877818614811302,y:.331287472744956},{x:.08088585786376518,y:.3299198152391437},{x:.15568385786376518,y:.29122381523914376},{x:.1574569269125657,y:.29051717359061785},{x:.15914024554357095,y:.2896174210369921},{x:.16154457924952065,y:.28888807438100694},{x:.16387856938737105,y:.2879578823843842},{x:.16575542835833412,y:.2876107272686775},{x:.16758193550927422,y:.2870566623818547},{x:.17008235909122482,y:.286810392154281},{x:.17255297371919248,y:.2863534124236203},{x:.17446149597461844,y:.28637908481714247},{x:.176361,y:.28619200000000006},{x:.288347309340128,y:.28619200000000006},{x:.3974525128623667,y:.21942256309828728},{x:.45549,y:.1602321160680505},{x:.45549,y:.13007078589845048},{x:.407404042616179,y:.10590438131127383},{x:.31753214348357883,y:.07103500000000003},{x:.21224543978224936,y:.07103500000000003},{x:.16354378174687056,y:.09622932957230687},{x:.14433666195924297,y:.15500005013212306},{x:.1407876006468136,y:.16307617408904287},{x:.13573115992893667,y:.17030473007440486},{x:.12936165598671553,y:.1764079287355125},{x:.12192386528459082,y:.18115122757053267},{x:.11370361794808405,y:.18435234426530817},{x:.10501681347236942,y:.18588826170046568},{x:.09619728088183255,y:.18569995543032455},{x:.08758394986787689,y:.1837946619592429},{x:.07950782591095708,y:.18024560064681355},{x:.07227926992559508,y:.1751891599289366},{x:.06617607126448745,y:.1688196559867155},{x:.06143277242946728,y:.16138186528459075},{x:.05823165573469179,y:.153161617948084},{x:.05669573829953427,y:.14447481347236937},{x:.0568840445696754,y:.1356552808818325},{x:.05878933804075704,y:.12704194986787684},{x:.08372233804075704,y:.050750949867876836},{x:.08542587043333498,y:.04687444913825993},{x:.08709879890390285,y:.042984643121031924},{x:.08719974017890864,y:.04283789110571456},{x:.0872713993531864,y:.04267482591095703},{x:.0896984666241539,y:.03920515373890898},{x:.0920981137517354,y:.03571646140762123},{x:.09222574536637099,y:.03559222185697407},{x:.09232784007106334,y:.035446269925595034},{x:.09538517138631239,y:.032516763866873036},{x:.0984193200775319,y:.02956325371133576},{x:.09856873722042347,y:.029466301081615798},{x:.09869734401328446,y:.029343071264487396},{x:.10226744784494098,y:.027066310594042624},{x:.10581949746716537,y:.024761484353185106},{x:.18061849746716538,y:-.013933515646814817},{x:.1823912439162618,y:-.014639995851387814},{x:.18407424554357094,y:-.01553957896300786},{x:.18647892276401756,y:-.016269029822976466},{x:.18881326125361947,y:-.017199317363260178},{x:.19068977232738848,y:-.017546377073194466},{x:.1925159355092742,y:-.018100337618145335},{x:.19501671633437545,y:-.018346643031098245},{x:.19748769126025723,y:-.018803648509519946},{x:.19939585369049342,y:-.018777950414796084},{x:.201295,y:-.018964999999999968},{x:.325956,y:-.018964999999999968},{x:.3298421413721484,y:-.018582248482612737},{x:.33373593654739714,y:-.01828737118339306},{x:.334227355251249,y:-.018150342613638803},{x:.3347350644907258,y:-.018100337618145335},{x:.33847186362931597,y:-.016966791992147238},{x:.34223331291484477,y:-.015917938922943478},{x:.44196531291484475,y:.022777061077056446},{x:.44388622686678575,y:.02374867869889352},{x:.4458951331158935,y:.02452214291663178},{x:.5206971331158935,y:.06211514291663188},{x:.5230429253028388,y:.06359852573319036},{x:.5254906604858821,y:.06490686744638552},{x:.526762463529903,y:.06595060923072474},{x:.5281530225051898,y:.06682994172267823},{x:.5301643473216751,y:.06874246310749585},{x:.5323098051533947,y:.07050319484660542},{x:.5333535469377338,y:.07177499789062616},{x:.5345458374532134,y:.07290871885358566},{x:.536145400814505,y:.07517688168239829},{x:.5379061325536145,y:.07732233951411796},{x:.538681702666837,y:.0787733291400739},{x:.5396299056666436,y:.08011787031323085},{x:.5407562372498129,y:.08265451036052812},{x:.5420645789630079,y:.08510224554357101},{x:.5425421726806072,y:.08667666103386074},{x:.5432098492552168,y:.08818035245395842},{x:.5438196647691762,y:.09088798806528645},{x:.5446253376181454,y:.09354393550927428},{x:.5447866012813922,y:.09518127295954937},{x:.5451480929944793,y:.09678632860859225},{x:.545217957571016,y:.09956090686586556},{x:.54549,y:.10232300000000005},{x:.54549,y:.17861300000000002},{x:.5450792542455133,y:.1827833716312913},{x:.5447095428008049,y:.18695758114513777},{x:.5446471218945653,y:.18717088502046353},{x:.5446253376181454,y:.1873920644907258},{x:.5434088850836819,y:.19140217107899518},{x:.5422319296624953,y:.19542404720269643},{x:.5421290946347417,y:.1956210747891699},{x:.5420645789630079,y:.19583375445642906},{x:.5400891672372728,y:.199529489854385},{x:.5381501975764,y:.20324447414399938},{x:.5380109003195782,y:.20341765378196683},{x:.5379061325536145,y:.20361366048588211},{x:.5352476756014034,y:.20685299965477524},{x:.5326212052175259,y:.21011832734743824},{x:.45781920521752584,y:.28640632734743826},{x:.45695946559173245,y:.28712616331644525},{x:.45621413415776596,y:.2879638966272176},{x:.45358375241990234,y:.28995255364350675},{x:.45105542866152953,y:.29206944848930627},{x:.4500717756605794,y:.29260772613156716},{x:.4491773318997613,y:.2932839556822147},{x:.3245133318997613,y:.3695749556822147},{x:.3213472249094816,y:.3711082739568931},{x:.3182447544564291,y:.37276657896300797},{x:.31738368821196916,y:.37302778055263114},{x:.3165738477898179,y:.3734199792757539},{x:.31316944110160955,y:.3743061584374605},{x:.3098030644907258,y:.3753273376181454},{x:.3089075854904768,y:.3754155346015568},{x:.3080367917497669,y:.3756422053074494},{x:.30452491480344407,y:.37584718998797495},{x:.301024,y:.376192},{x:.18731182116617404,y:.376192},{x:.146563,y:.397272996602132},{x:.146563,y:.42779681790574337},{x:.20153437253410483,y:.48386323770148376},{x:.2842918489876165,y:.5150589999999999},{x:.39008456648169626,y:.5150589999999999},{x:.4553477907191711,y:.4822576837794137},{x:.4635801440629335,y:.47908783003036465},{x:.47227272283422006,y:.4775849365970516},{x:.4810914761057044,y:.47780675883128426},{x:.48969750413477736,y:.47974477222900047},{x:.4977600820905977,y:.48332450002217653},{x:.5049693696238691,y:.488408375279255},{x:.5110483178577028,y:.4948010275251766},{x:.5157633162205862,y:.5022567907191711},{x:.5189331699696352,y:.5104891440629334},{x:.5204360634029483,y:.51918172283422},{x:.5202142411687157,y:.5280004761057044},{x:.5182762277709995,y:.5366065041347774},{x:.5146964999778234,y:.5446690820905977},{x:.509612624720745,y:.551878369623869},{x:.5032199724748234,y:.5579573178577029},{x:.49576420928082887,y:.5626723162205862},{x:.42096520928082887,y:.6002663162205862},{x:.41942927464851043,y:.6008577252562829},{x:.41797775445642904,y:.6016335789630078},{x:.4153223812886681,y:.6024390776071881},{x:.41273285593706643,y:.6034361699696352},{x:.41111105567880996,y:.6037165692645292},{x:.40953606449072577,y:.6041943376181453},{x:.40677456858393113,y:.6044663212253706},{x:.4040402771657799,y:.6049390634029483},{x:.4023949361559939,y:.6048976773693867},{x:.400757,y:.605059},{x:.276092,y:.605059},{x:.2724204350331364,y:.6046973824138966},{x:.26873912724910987,y:.6044542166602351},{x:.2680367190736708,y:.6042656240771296},{x:.2673129355092742,y:.6041943376181453},{x:.2637824667250502,y:.6031233816208718},{x:.26021933352302795,y:.6021667007079561},{x:.1604883335230279,y:.5645727007079561},{x:.15963695838633216,y:.5641523105976027},{x:.15873109713512196,y:.563867735718488},{x:.15568848233041307,y:.5622026409240001},{x:.1525785174681621,y:.5606670094317409},{x:.15182551530799093,y:.5600886019499048},{x:.15099257773152036,y:.559632770334096},{x:.14833326979676884,y:.5574060851671644},{x:.1455826488796249,y:.5552932363569977},{x:.14495695714670492,y:.554579039378831},{x:.14422895256892138,y:.5539694683796904},{x:.06943095256892137,y:.47768146837969044},{x:.06680494464711424,y:.4744165369262552},{x:.06414686744638545,y:.4711776604858821},{x:.0640418150384659,y:.470981121254323},{x:.0639021439692389,y:.47080746737336276},{x:.06196355058191934,y:.4670929619312254},{x:.0599884210369921,y:.46339775445642906},{x:.05992373008360734,y:.46318449696300446},{x:.05982062094636722,y:.462986931318802},{x:.05864394115023422,y:.4589655982489849},{x:.057427662381854636,y:.45495606449072584},{x:.05740581892006417,y:.454734284101312},{x:.05734323414113077,y:.4545203990307778},{x:.05697368708086039,y:.4503467759079653},{x:.056563,y:.44617700000000005},{x:.056563,y:.369888}]],t:[[{x:.036055000000000004,y:.484201},{x:.03691966238185464,y:.4754219355092742},{x:.0394804210369921,y:.466980245543571},{x:.04363886744638546,y:.4592003395141179},{x:.049235194846605365,y:.45238119484660533},{x:.05605433951411792,y:.44678486744638546},{x:.06383424554357096,y:.44262642103699207},{x:.07227593550927423,y:.4400656623818546},{x:.081055,y:.439201},{x:.201032,y:.439201},{x:.201032,y:.17345100000000002},{x:.2013458215844704,y:.17026471598156256},{x:.20148726326025637,y:.1670661406603643},{x:.20177732050748418,y:.165883633894134},{x:.20189666238185464,y:.16467193550927425},{x:.20282606714776777,y:.16160809859877695},{x:.20358880215081968,y:.15849857690755997},{x:.20410398165518515,y:.15739537903902878},{x:.2044574210369921,y:.15623024554357098},{x:.20596669248041014,y:.15340659727526443},{x:.20732140933230742,y:.15050562638878262},{x:.2623124093323074,y:.05773162638878261},{x:.2645408071528226,y:.05469603003381387},{x:.2666808493837164,y:.051597510818645845},{x:.2671477670132535,y:.051144744093296994},{x:.26753264280400524,y:.05062045370997057},{x:.2703104380556505,y:.04807792433615628},{x:.27301385108661325,y:.04545644382682572},{x:.2735601274310704,y:.04510346799784869},{x:.2740398919211364,y:.04466433724917905},{x:.27726033549019774,y:.04271258283448707},{x:.28042322867453984,y:.040668883056825214},{x:.28102787064035484,y:.04042926278737637},{x:.28158408674943697,y:.04009216722176761},{x:.28512341879560005,y:.038806192593798694},{x:.288624243922019,y:.03741881178414046},{x:.39861224392201905,y:.005893811784140432},{x:.4004470188387682,y:.005558110934368086},{x:.4022319355092743,y:.0050166623818546086},{x:.4047755505163489,y:.004766138170207483},{x:.4072897364122725,y:.0043061284251197166},{x:.4091547486303562,y:.0043348248023798485},{x:.411011,y:.004151999999999975},{x:.520997,y:.004151999999999975},{x:.5297760644907258,y:.0050166623818546086},{x:.538217754456429,y:.00757742103699207},{x:.5459976604858822,y:.011735867446385433},{x:.5528168051533947,y:.017332194846605337},{x:.5584131325536146,y:.02415133951411788},{x:.5625715789630079,y:.031931245543570935},{x:.5651323376181454,y:.040372935509274205},{x:.5659970000000001,y:.049151999999999973},{x:.5651323376181454,y:.05793106449072574},{x:.5625715789630079,y:.06637275445642901},{x:.5584131325536146,y:.07415266048588207},{x:.5528168051533947,y:.08097180515339461},{x:.5459976604858822,y:.08656813255361451},{x:.538217754456429,y:.09072657896300787},{x:.5297760644907258,y:.09328733761814534},{x:.520997,y:.09415199999999997},{x:.41733272532416527,y:.09415199999999997},{x:.33061421916568134,y:.11900744701827656},{x:.291032,y:.1857856616511605},{x:.291032,y:.439201},{x:.466004,y:.439201},{x:.47478306449072577,y:.4400656623818546},{x:.48322475445642904,y:.44262642103699207},{x:.4910046604858821,y:.44678486744638546},{x:.49782380515339464,y:.45238119484660533},{x:.5034201325536145,y:.4592003395141179},{x:.5075785789630078,y:.466980245543571},{x:.5101393376181453,y:.4754219355092742},{x:.511004,y:.484201},{x:.5101393376181453,y:.4929800644907258},{x:.5075785789630078,y:.501421754456429},{x:.5034201325536145,y:.5092016604858821},{x:.49782380515339464,y:.5160208051533947},{x:.4910046604858821,y:.5216171325536145},{x:.48322475445642904,y:.5257755789630079},{x:.47478306449072577,y:.5283363376181454},{x:.466004,y:.529201},{x:.291032,y:.529201},{x:.291032,y:.702148},{x:.2901673376181454,y:.7109270644907257},{x:.2876065789630079,y:.719368754456429},{x:.28344813255361456,y:.7271486604858821},{x:.27785180515339464,y:.7339678051533947},{x:.2710326604858821,y:.7395641325536145},{x:.26325275445642904,y:.7437225789630079},{x:.25481106449072577,y:.7462833376181454},{x:.246032,y:.747148},{x:.23725293550927423,y:.7462833376181454},{x:.22881124554357096,y:.7437225789630079},{x:.2210313395141179,y:.7395641325536145},{x:.21421219484660536,y:.7339678051533947},{x:.20861586744638547,y:.7271486604858821},{x:.2044574210369921,y:.719368754456429},{x:.20189666238185464,y:.7109270644907257},{x:.201032,y:.702148},{x:.201032,y:.529201},{x:.081055,y:.529201},{x:.07227593550927423,y:.5283363376181454},{x:.06383424554357094,y:.5257755789630079},{x:.05605433951411792,y:.5216171325536145},{x:.049235194846605365,y:.5160208051533947},{x:.04363886744638546,y:.5092016604858821},{x:.0394804210369921,y:.501421754456429},{x:.03691966238185464,y:.4929800644907258},{x:.036055000000000004,y:.484201}]],u:[[{x:.047041,y:.17386599999999997},{x:.04733731084809023,y:.17085750547164297},{x:.04744678100255899,y:.1678364368310572},{x:.0477687404511641,y:.16647712720137547},{x:.04790566238185463,y:.1650869355092742},{x:.048783207866406234,y:.16219405573845885},{x:.04947995583647738,y:.15925239265237093},{x:.08761895583647737,y:.04817539265237096},{x:.08938287590080696,y:.04431825367483454},{x:.09111755940033861,y:.04044787795123246},{x:.0912166047918106,y:.04030846472648272},{x:.0912877277290914,y:.04015294120864865},{x:.09377024504918263,y:.03671403980837168},{x:.09622666993792225,y:.03325645223155292},{x:.09635101037087945,y:.03313904059014135},{x:.09645110783403886,y:.03300038080982997},{x:.09955682066149267,y:.030111872039067004},{x:.10264058790854466,y:.027199945760571206},{x:.10278544504987946,y:.027109047766032002},{x:.10291067034954356,y:.026992580340839414},{x:.10652022788210418,y:.024765467971757132},{x:.11011283004156149,y:.02251110668543916},{x:.1858688300415615,y:-.015231893314560811},{x:.1873332068933575,y:-.0157898639141544},{x:.18871524554357097,y:-.01652857896300789},{x:.19144581156206075,y:-.017356887109087667},{x:.19411224226228255,y:-.018372875537717062},{x:.1956573361874375,y:-.018634439137126358},{x:.19715693550927424,y:-.019089337618145352},{x:.1999966293703256,y:-.019369023051625026},{x:.20281003486202434,y:-.01984529472354478},{x:.2043764687674932,y:-.01980039958033106},{x:.205936,y:-.019953999999999986},{x:.319832,y:-.019953999999999986},{x:.32132997950952447,y:-.01980646189590665},{x:.3228344649392302,y:-.019853723877644197},{x:.3257100002545037,y:-.019375067506000147},{x:.3286110644907258,y:-.019089337618145352},{x:.3300514774877758,y:-.018652393112465325},{x:.33153627500704863,y:-.018405236421526333},{x:.3342631764918695,y:-.017374788187221168},{x:.33705275445642907,y:-.01652857896300789},{x:.3383802466773209,y:-.015819019588053155},{x:.3397882963501792,y:-.015286942317463331},{x:.4160692963501792,y:.02245605768253664},{x:.4183042276197719,y:.02384992521458428},{x:.42064256487504254,y:.025062345668598177},{x:.4220380841989542,y:.02617863282445781},{x:.4235544084161923,y:.027124324140885128},{x:.42547446604244665,y:.028927422360218155},{x:.42753134130624215,y:.03057273346328787},{x:.465011,y:.06712410441560081},{x:.465011,y:.025046000000000013},{x:.4658756623818546,y:.016266935509274223},{x:.46843642103699207,y:.007825245543570968},{x:.47259486744638546,y:45339514117916785e-21},{x:.4781911948466053,y:-.006773805153394624},{x:.4850103395141179,y:-.012370132553614528},{x:.492790245543571,y:-.01652857896300789},{x:.5012319355092743,y:-.019089337618145352},{x:.510011,y:-.019953999999999986},{x:.5187900644907257,y:-.019089337618145352},{x:.527231754456429,y:-.01652857896300789},{x:.5350116604858821,y:-.012370132553614521},{x:.5418308051533947,y:-.006773805153394624},{x:.5474271325536145,y:45339514117916785e-21},{x:.5515855789630079,y:.007825245543570974},{x:.5541463376181454,y:.016266935509274244},{x:.555011,y:.025046000000000013},{x:.555011,y:.545898},{x:.5541463376181454,y:.5546770644907257},{x:.5515855789630079,y:.563118754456429},{x:.5474271325536145,y:.5708986604858821},{x:.5418308051533947,y:.5777178051533947},{x:.5350116604858821,y:.5833141325536145},{x:.527231754456429,y:.5874725789630079},{x:.5187900644907257,y:.5900333376181454},{x:.510011,y:.590898},{x:.5012319355092743,y:.5900333376181454},{x:.492790245543571,y:.5874725789630079},{x:.4850103395141179,y:.5833141325536145},{x:.4781911948466053,y:.5777178051533947},{x:.47259486744638546,y:.5708986604858821},{x:.46843642103699207,y:.563118754456429},{x:.4658756623818546,y:.5546770644907257},{x:.465011,y:.545898},{x:.465011,y:.19283699530520199},{x:.36978450462305706,y:.099969048308901},{x:.30930812362389754,y:.07004600000000001},{x:.2165251763155874,y:.07004600000000001},{x:.16675256431883717,y:.09484360935890679},{x:.137041,y:.18137632992954258},{x:.137041,y:.545898},{x:.13617633761814535,y:.5546770644907257},{x:.1336155789630079,y:.563118754456429},{x:.12945713255361452,y:.5708986604858821},{x:.12386080515339463,y:.5777178051533947},{x:.11704166048588208,y:.5833141325536145},{x:.10926175445642904,y:.5874725789630079},{x:.10082006449072577,y:.5900333376181454},{x:.092041,y:.590898},{x:.08326193550927423,y:.5900333376181454},{x:.07482024554357093,y:.5874725789630079},{x:.06704033951411792,y:.5833141325536145},{x:.06022119484660536,y:.5777178051533947},{x:.05462486744638546,y:.5708986604858821},{x:.050466421036992094,y:.563118754456429},{x:.04790566238185463,y:.5546770644907257},{x:.047041,y:.545898},{x:.047041,y:.17386599999999997}]],v:[[{x:.003930906419490336,y:.5438334563092145},{x:.005386967221411215,y:.5351329102741644},{x:.00851244255100142,y:.5268836061622384},{x:.26071044255100145,y:.018289606162238365},{x:.26144011887972296,y:.017121905714788027},{x:.2620056398700735,y:.01586646241095203},{x:.26377267234206975,y:.013389122267562115},{x:.26538522214413157,y:.010808560104194675},{x:.26632868500311185,y:.009805649483352854},{x:.267128264504625,y:.008684656842684199},{x:.2693446490294707,y:.006599649029470163},{x:.2714296568426842,y:.00438326450462502},{x:.27255064948335267,y:.0035836850031119977},{x:.2735535601041947,y:.0026402221441315446},{x:.27613412226756273,y:.0010276723420693272},{x:.278611462410952,y:-.0007393601299264599},{x:.2798669057147878,y:-.0013048811202769175},{x:.28103460616223835,y:-.0020345574489985807},{x:.28388017640738666,y:-.0031126798553442526},{x:.2866546460885495,y:-.00436245420755494},{x:.28799629407344673,y:-.00467218403223142},{x:.2892839102741644,y:-.005160032778588779},{x:.2922851349323858,y:-.00566229614975999},{x:.29525011283741587,y:-.006346784254711718},{x:.2966264067237199,y:-.006388820170250395},{x:.2979844563092145,y:-.006616093580509658},{x:.301026,y:-.00652319621682493},{x:.30406754369078554,y:-.006616093580509658},{x:.3054255932762801,y:-.006388820170250395},{x:.30680188716258416,y:-.006346784254711718},{x:.30976686506761425,y:-.005662296149759988},{x:.31276808972583564,y:-.005160032778588779},{x:.3140557059265533,y:-.00467218403223142},{x:.3153973539114505,y:-.00436245420755494},{x:.3181718235926135,y:-.0031126798553442175},{x:.3210173938377617,y:-.0020345574489985807},{x:.32218509428521225,y:-.0013048811202769192},{x:.323440537589048,y:-.0007393601299264599},{x:.32591787773243747,y:.0010276723420694187},{x:.32849843989580535,y:.0026402221441315446},{x:.32950135051664736,y:.0035836850031119635},{x:.3306223431573158,y:.00438326450462502},{x:.3327073509705293,y:.006599649029470129},{x:.334923735495375,y:.008684656842684203},{x:.33572331499688823,y:.009805649483352899},{x:.33666677785586846,y:.01080856010419469},{x:.3382793276579303,y:.013389122267562135},{x:.3400463601299265,y:.01586646241095204},{x:.34061188112027707,y:.017121905714788034},{x:.3413415574489986,y:.018289606162238365},{x:.5935395574489987,y:.5268836061622384},{x:.5966650327785888,y:.5351329102741644},{x:.5981210935805097,y:.5438334563092145},{x:.5978517842547117,y:.5526508871625841},{x:.595867454207555,y:.5612463539114505},{x:.5922443601299265,y:.569289537589048},{x:.587121735495375,y:.5764713431573159},{x:.5806964398958053,y:.5825157778558685},{x:.5732153938377617,y:.5871905574489986},{x:.5649660897258356,y:.5903160327785888},{x:.5562655436907855,y:.5917720935805096},{x:.5474481128374159,y:.5915027842547117},{x:.5388526460885495,y:.589518454207555},{x:.5308094624109521,y:.5858953601299265},{x:.5236276568426842,y:.580772735495375},{x:.5175832221441315,y:.5743474398958054},{x:.5129084425510014,y:.5668663938377616},{x:.301026,y:.13957458745236595},{x:.08914355744899859,y:.5668663938377616},{x:.08446877785586845,y:.5743474398958054},{x:.07842434315731579,y:.580772735495375},{x:.07124253758904797,y:.5858953601299265},{x:.06319935391145051,y:.589518454207555},{x:.054603887162584124,y:.5915027842547117},{x:.04578645630921451,y:.5917720935805096},{x:.037085910274164385,y:.5903160327785888},{x:.028836606162238352,y:.5871905574489986},{x:.02135556010419467,y:.5825157778558685},{x:.014930264504625007,y:.5764713431573159},{x:.009807639870073534,y:.569289537589048},{x:.006184545792445054,y:.5612463539114505},{x:.004200215745288276,y:.5526508871625841},{x:.003930906419490336,y:.5438334563092145}]],w:[[{x:-.04481226541001698,y:.5427688011711321},{x:-.0431501306438814,y:.534105261341125},{x:.1073618693561186,y:.025511261341124997},{x:.10747750697825527,y:.02522662926113043},{x:.10753949092041715,y:.02492572151525217},{x:.1091366577408943,y:.021142772088450095},{x:.11068223944402648,y:.01733845540642648},{x:.11085118408582124,y:.017081852232977028},{x:.1109706812129555,y:.01679881881229654},{x:.11327517574267339,y:.0134001494872997},{x:.11553324489331337,y:.009970459715744673},{x:.11574900410692728,y:.009751746564891355},{x:.11592142221145292,y:.009497464285038355},{x:.11884468401801046,y:.006613684018010047},{x:.12172846428503836,y:.0036904222114529234},{x:.12198274656489135,y:.0035180041069272803},{x:.12220145971574467,y:.0033022448933133844},{x:.1256311494872997,y:.001044175742673395},{x:.12902981881229655,y:-.0012603187870445023},{x:.12931285223297703,y:-.0013798159141787526},{x:.12956945540642648,y:-.0015487605559735135},{x:.1333737720884501,y:-.0030943422591057004},{x:.13715672151525218,y:-.004691509079582858},{x:.13745762926113045,y:-.004753493021744735},{x:.137742261341125,y:-.004869130643881392},{x:.14177500717701197,y:-.005642829061426576},{x:.14579686008065018,y:-.006471289947453558},{x:.1461040784358031,y:-.006473378696506754},{x:.14640580117113214,y:-.006531265410016966},{x:.150512,y:-.006503347745684165},{x:.15461819882886788,y:-.006531265410016966},{x:.15491992156419693,y:-.006473378696506754},{x:.15522713991934983,y:-.006471289947453558},{x:.159248992822988,y:-.005642829061426585},{x:.16328173865887502,y:-.004869130643881392},{x:.16356637073886957,y:-.004753493021744732},{x:.16386727848474786,y:-.004691509079582851},{x:.1676502279115502,y:-.0030943422591055763},{x:.17145454459357354,y:-.0015487605559735135},{x:.17171114776702298,y:-.0013798159141787517},{x:.17199418118770346,y:-.0012603187870445023},{x:.17539285051270065,y:.001044175742673613},{x:.17882254028425534,y:.0033022448933133844},{x:.17904125343510863,y:.0035180041069272374},{x:.17929553571496165,y:.0036904222114529095},{x:.18217931598198978,y:.006613684018010279},{x:.1851025777885471,y:.009497464285038375},{x:.18527499589307275,y:.009751746564891386},{x:.18549075510668664,y:.009970459715744683},{x:.1877488242573266,y:.013400149487299715},{x:.1900533187870445,y:.016798818812296553},{x:.19017281591417878,y:.01708185223297707},{x:.19034176055597352,y:.01733845540642648},{x:.19188734225910553,y:.02114277208844964},{x:.19348450907958287,y:.02492572151525217},{x:.19354649302174473,y:.02522662926113043},{x:.1936621306438814,y:.025511261341124997},{x:.30102443002882817,y:.38829842311817664},{x:.4083889386148475,y:.025511027311792445},{x:.40850451632069196,y:.025226547135196155},{x:.40856646677585007,y:.0249257992040805},{x:.410163689741502,y:.021142697708463984},{x:.41170935302882616,y:.01733823938560964},{x:.41187820927072055,y:.017081773507688556},{x:.41199764237598097,y:.016798890297984457},{x:.41430222163921304,y:.013400082779514221},{x:.4165603984391837,y:.009970270005002412},{x:.41677604416644776,y:.009751674265617277},{x:.4169483701745541,y:.009497526820430955},{x:.41987174204670485,y:.006613627545966159},{x:.42275565189129766,y:.0036902661012626486},{x:.42300979995956794,y:.0035179410120882958},{x:.4232283964786704,y:.003302296075210584},{x:.4266582174181369,y:.0010441316765615349},{x:.4300570332693414,y:-.001260435297455717},{x:.43033991691088264,y:-.001379867379883588},{x:.4305963833993421,y:-.0015487226944633017},{x:.43440084731088763,y:-.0030943722258508074},{x:.43818395458161874,y:-.004691581512785238},{x:.43848470273672896,y:-.004753530880516994},{x:.4387691833312223,y:-.0048691075577547704},{x:.44280208680029426,y:-.005642843777199688},{x:.4468241027997286,y:-.0064713155198797695},{x:.44713115788546864,y:-.006473401493455157},{x:.44743272015628793,y:-.006531257986460835},{x:.45153908096424766,y:-.006503346644966049},{x:.45564544187310013,y:-.00653124313893301},{x:.4559470039347234,y:-.006473385555557348},{x:.4562540590129192,y:-.0064712984717510205},{x:.4602760720167908,y:-.005642812186517322},{x:.4643089726882076,y:-.004869061385152536},{x:.46459345286480397,y:-.004753483679308031},{x:.46489420079591953,y:-.0046915332241499325},{x:.46867730229153426,y:-.003094310258498727},{x:.4724817606143904,y:-.0015486469711738574},{x:.4727382264923116,y:-.0013797907292793573},{x:.47302110970201555,y:-.0012603576240190345},{x:.4764199172204845,y:.0010442216392121837},{x:.47984972999499764,y:.0033023984391836667},{x:.4800683257343829,y:.003518044166447842},{x:.48032247317956905,y:.003690370174554085},{x:.483206372454032,y:.0066137420467029156},{x:.48612973389873737,y:.009497651891297622},{x:.4863020589879118,y:.009751799959568049},{x:.48651770392478944,y:.009970396478670394},{x:.4887758683234383,y:.01340021741813658},{x:.49108043529745576,y:.016799033269341422},{x:.49119986737988364,y:.017081916910882677},{x:.4913687226944633,y:.017338383399342037},{x:.4929143722258502,y:.021142847310886045},{x:.4945115815127853,y:.024925954581618698},{x:.4945735308805171,y:.025226702736729056},{x:.4946891075577548,y:.025511183331222268},{x:.6452021075577549,y:.5341051833312223},{x:.6468642579864609,y:.542768720156288},{x:.646804298471751,y:.5515900590129192},{x:.64502453322415,y:.5602302007959196},{x:.641593357624019,y:.5683571097020156},{x:.636642629825446,y:.5756584731795691},{x:.6303626035213297,y:.5818537039247894},{x:.622994616600658,y:.5867047226944633},{x:.6148218166687778,y:.5900251075577548},{x:.6061582798437121,y:.5916872579864608},{x:.5973369409870808,y:.591627298471751},{x:.5886967992040805,y:.58984753322415},{x:.5805698902979844,y:.5864163576240191},{x:.573268526820431,y:.5814656298254459},{x:.5670732960752106,y:.5751856035213296},{x:.5622222773055368,y:.567817616600658},{x:.5589018924422452,y:.5596448166687777},{x:.4515387133151436,y:.1968570925189096},{x:.34417406138515255,y:.5596449726882076},{x:.3440584683142858,y:.559929490683899},{x:.34399650907958285,y:.5602302784847478},{x:.3423992950207163,y:.5640133397974443},{x:.3408536469711739,y:.5678177606143904},{x:.3406847682813525,y:.5680742605871558},{x:.34056531878704455,y:.5683571811877035},{x:.33826075609875456,y:.5717559510329858},{x:.33600260156081635,y:.5751857299949976},{x:.33578692716538155,y:.5754043547947312},{x:.3356145777885471,y:.5756585357149616},{x:.33269122952253233,y:.5785424012737268},{x:.32980734810870244,y:.5814657338987373},{x:.3295531662537196,y:.581638081896991},{x:.3293345402842553,y:.5818537551066867},{x:.3259047490749403,y:.5841118910428063},{x:.32250596673065857,y:.5864164352974557},{x:.322223045482268,y:.5865358832573104},{x:.32196654459357354,y:.5867047605559735},{x:.318162115393689,y:.5882503879717952},{x:.31437904541838135,y:.5898475815127853},{x:.31407825728149374,y:.5899095391161314},{x:.313793738658875,y:.5900251306438814},{x:.30976087354902626,y:.5907988519446131},{x:.3057388972002714,y:.5916273155198798},{x:.3054318012943039,y:.5916294017707667},{x:.3051301988288679,y:.5916872654100169},{x:.30102387855356455,y:.5916593469199811},{x:.29691755812689985,y:.5916872431389331},{x:.2966159559752979,y:.5916293778639092},{x:.2963088600806502,y:.5916272899474536},{x:.29228688822522214,y:.5907988045585649},{x:.28825402731179245,y:.5900250613851525},{x:.2879695093161011,y:.5899094683142858},{x:.2876687215152522,y:.5898475090795828},{x:.2838856602025565,y:.5882502950207166},{x:.28008123938560964,y:.5867046469711739},{x:.27982473941284386,y:.5865357682813523},{x:.27954181881229656,y:.5864163187870445},{x:.276143048967013,y:.5841117560987538},{x:.2727132700050024,y:.5818536015608163},{x:.2724946452052691,y:.5816379271653819},{x:.27224046428503834,y:.5814655777885471},{x:.2693565987262721,y:.5785422295225312},{x:.2664332661012626,y:.5756583481087024},{x:.2662609181030087,y:.5754041662537193},{x:.2660452448933134,y:.5751855402842553},{x:.26378710895719626,y:.5717557490749442},{x:.2614825647025443,y:.5683569667306586},{x:.2613631167426894,y:.5680740454822678},{x:.2611942394440265,y:.5678175445935736},{x:.2596486120282045,y:.5640131153936881},{x:.2580514184872148,y:.5602300454183813},{x:.25798946088386876,y:.5599292572814941},{x:.2578738693561186,y:.559644738658875},{x:.150512,y:.196859029989096},{x:.0431501306438814,y:.559644738658875},{x:.039829760555973516,y:.5678175445935736},{x:.034978755106686646,y:.5751855402842553},{x:.028783535714961644,y:.5814655777885471},{x:.021482181187703456,y:.5864163187870445},{x:.01335527848474783,y:.5898475090795828},{x:.0047151399193498065,y:.5916272899474536},{x:-.004106198828867862,y:.5916872654100169},{x:-.01276973865887501,y:.5900251306438814},{x:-.020942544593573535,y:.5867047605559735},{x:-.028310540284255312,y:.5818537551066867},{x:-.034590577788547086,y:.5756585357149616},{x:-.03954131878704451,y:.5683571811877035},{x:-.04297250907958286,y:.5602302784847478},{x:-.04475228994745356,y:.5515901399193498},{x:-.04481226541001698,y:.5427688011711321}]],x:[[{x:-.007882248997940308,y:.03911618267902263},{x:-.007180671607209664,y:.030322582532795114},{x:-.0047770285451087455,y:.021834819906700376},{x:-.0007636904665355299,y:.013979074758467071},{x:.004705112296856322,y:.007057238968589209},{x:.011419216721809594,y:.001335314804661543},{x:.019120603540586492,y:-.0029668073965882433},{x:.02751331277672888,y:-.0056837994916240225},{x:.036274817320977384,y:-.006711248997940296},{x:.04506841746720488,y:-.006009671607209652},{x:.05355618009329963,y:-.003606028545108733},{x:.061411925241532925,y:.0004073095334644686},{x:.0683337610314108,y:.005876112296856327},{x:.3010265,y:.23008742701759316},{x:.5337192389685892,y:.005876112296856327},{x:.540641074758467,y:.0004073095334644686},{x:.5484968199067003,y:-.003606028545108733},{x:.556984582532795,y:-.006009671607209652},{x:.5657781826790226,y:-.006711248997940296},{x:.5745396872232711,y:-.0056837994916240225},{x:.5829323964594135,y:-.0029668073965882433},{x:.5906337832781904,y:.001335314804661536},{x:.5973478877031436,y:.007057238968589213},{x:.6028166904665355,y:.013979074758467089},{x:.6068300285451087,y:.021834819906700383},{x:.6092336716072096,y:.030322582532795128},{x:.6099352489979403,y:.03911618267902263},{x:.608907799491624,y:.047877687223271126},{x:.6061908073965883,y:.05627039645941352},{x:.6018886851953384,y:.0639717832781904},{x:.5961667610314108,y:.07068588770314368},{x:.36588095484811606,y:.292578},{x:.5961667610314108,y:.5144701122968564},{x:.6018886851953384,y:.5211842167218096},{x:.6061908073965883,y:.5288856035405864},{x:.608907799491624,y:.5372783127767289},{x:.6099352489979403,y:.5460398173209774},{x:.6092336716072096,y:.5548334174672048},{x:.6068300285451087,y:.5633211800932996},{x:.6028166904665355,y:.571176925241533},{x:.5973478877031436,y:.5780987610314108},{x:.5906337832781904,y:.5838206851953385},{x:.5829323964594135,y:.5881228073965883},{x:.5745396872232711,y:.590839799491624},{x:.5657781826790226,y:.5918672489979403},{x:.556984582532795,y:.5911656716072097},{x:.5484968199067003,y:.5887620285451087},{x:.540641074758467,y:.5847486904665355},{x:.5337192389685892,y:.5792798877031436},{x:.3010265,y:.35506857298240685},{x:.0683337610314108,y:.5792798877031436},{x:.06141192524153289,y:.5847486904665355},{x:.05355618009329961,y:.5887620285451087},{x:.0450684174672049,y:.5911656716072097},{x:.03627481732097735,y:.5918672489979403},{x:.02751331277672888,y:.590839799491624},{x:.01912060354058648,y:.5881228073965883},{x:.011419216721809584,y:.5838206851953385},{x:.004705112296856315,y:.5780987610314108},{x:-.0007636904665355368,y:.571176925241533},{x:-.004777028545108752,y:.5633211800932996},{x:-.007180671607209664,y:.5548334174672048},{x:-.007882248997940308,y:.5460398173209774},{x:-.006854799491624035,y:.5372783127767289},{x:-.004137807396588256,y:.5288856035405864},{x:.0001643148046615306,y:.5211842167218096},{x:.005886238968589197,y:.5144701122968564},{x:.23617204515188386,y:.292578},{x:.005886238968589197,y:.07068588770314368},{x:.00016431480466150977,y:.0639717832781904},{x:-.004137807396588256,y:.05627039645941351},{x:-.006854799491624035,y:.047877687223271126},{x:-.007882248997940308,y:.03911618267902263}]],y:[[{x:-7800000000000168e-20,y:-.15516599999999992},{x:.0007866623818546317,y:-.16394506449072568},{x:.003347421036992093,y:-.17238675445642895},{x:.007505867446385456,y:-.180166660485882},{x:.013102194846605353,y:-.18698580515339455},{x:.0199213395141179,y:-.19258213255361445},{x:.02770124554357093,y:-.1967405789630078},{x:.03614293550927421,y:-.19930133761814528},{x:.044922,y:-.2001659999999999},{x:.084618,y:-.2001659999999999},{x:.08470326921416556,y:-.20015760171543356},{x:.08478856964894584,y:-.200165676732115},{x:.08909199801123496,y:-.19972534965725622},{x:.09339706449072577,y:-.19930133761814528},{x:.0934790568568106,y:-.19927646550581232},{x:.09356429362525961,y:-.1992677440740231},{x:.09769912926743524,y:-.1979963205354665},{x:.10183875445642904,y:-.1967405789630078},{x:.1019143190537861,y:-.19670018884423682},{x:.10199621655469396,y:-.19667500612370953},{x:.18074721655469395,y:-.16370500612370958},{x:.18295470197399702,y:-.16251430076809983},{x:.18525522528778574,y:-.16151511930158513},{x:.18682754729843723,y:-.16042530954354395},{x:.18851130436774752,y:-.15951710034658062},{x:.19044407848245243,y:-.15791861501920362},{x:.19250546725178602,y:-.1564898227103016},{x:.27125546725178606,y:-.08958282271030155},{x:.27347158712358693,y:-.0872898341236823},{x:.27580944257935097,y:-.08512109812948883},{x:.27653091968085064,y:-.08412438503144627},{x:.2773860111192193,y:-.08323963374445845},{x:.2791122089873479,y:-.0805583607511536},{x:.2809820438025964,y:-.07797520343727593},{x:.35909504380259644,y:.055837796562724036},{x:.35921507445013207,y:.05609937330868571},{x:.35938084670619436,y:.05633463764830328},{x:.359814044874128,y:.05731131476590327},{x:.3603874218559792,y:.0582128676935936},{x:.5972854218559792,y:.5265638676935935},{x:.6004763520268956,y:.5347880745861305},{x:.6020015061983327,y:.5434767752438966},{x:.6018022735507984,y:.5522960677732933},{x:.5998863104832066,y:.5609070317083322},{x:.5963272463817603,y:.568978752534074},{x:.591261854083932,y:.5762010385458585},{x:.5848847937750224,y:.5822963413425576},{x:.5774411323064065,y:.5870304218559792},{x:.5692169254138695,y:.5902213520268956},{x:.5605282247561034,y:.5917465061983327},{x:.5517089322267067,y:.5915472735507984},{x:.5430979682916678,y:.5896313104832066},{x:.5350262474659261,y:.5860722463817603},{x:.5278039614541415,y:.5810068540839319},{x:.5217086586574424,y:.5746297937750224},{x:.5169745781440208,y:.5671861323064065},{x:.3203411783046204,y:.17843886787959407},{x:.12481771439881506,y:.5670983271806026},{x:.12009991274687032,y:.5745523168465348},{x:.11401856108654926,y:.5809426827476728},{x:.10680736235169674,y:.5860238467061943},{x:.09874343886560628,y:.5896005424407229},{x:.09013668268554793,y:.5915353195400148},{x:.08131784662479694,y:.5917538256051798},{x:.0726258336075076,y:.5902476635706729},{x:.06439467281939737,y:.5870747143988151},{x:.05694068315346515,y:.5823569127468703},{x:.05055031725232718,y:.5762755610865493},{x:.04546915329380567,y:.5690643623516968},{x:.041892457559277035,y:.5610004388656062},{x:.039957680459985136,y:.5523936826855479},{x:.039739174394820276,y:.5435748466247969},{x:.0412453364293271,y:.5348828336075077},{x:.04441828560118493,y:.5266516728193974},{x:.26905653043412125,y:.0801181620528446},{x:.20712852539925722,y:-.025968816269973185},{x:.1395520619925953,y:-.08338263769409424},{x:.07557825049874085,y:-.11016599999999992},{x:.044922,y:-.11016599999999992},{x:.03614293550927422,y:-.11103066238185455},{x:.02770124554357096,y:-.11359142103699202},{x:.01992133951411791,y:-.11774986744638538},{x:.01310219484660536,y:-.12334619484660528},{x:.007505867446385456,y:-.13016533951411782},{x:.003347421036992093,y:-.13794524554357088},{x:.0007866623818546317,y:-.14638693550927412},{x:-7800000000000168e-20,y:-.15516599999999992}]],z:[[{x:.051680000000000004,y:.038348999999999966},{x:.05192127447228559,y:.035899299172703986},{x:.05194879067317478,y:.033437899088824954},{x:.05235257576103353,y:.03152022369965088},{x:.05254466238185464,y:.029569935509274177},{x:.053259213756049764,y:.02721437531096308},{x:.05376639657582897,y:.024805638484003446},{x:.054536542955643516,y:.023003585252525667},{x:.0551054210369921,y:.02112824554357092},{x:.05626578950451143,y:.018957348831652537},{x:.05723314819184797,y:.01669384166703705},{x:.05834005957014514,y:.015076662488338128},{x:.05926386744638546,y:.01334833951411787},{x:.060825460697764414,y:.011445532631778232},{x:.062215820200804926,y:.009414240440453706},{x:.0636169585940798,y:.00804408260344652},{x:.06486019484660537,y:.0065291948466053296},{x:.06676300172894496,y:.004967601595226417},{x:.06852293131171022,y:.0032465857969436324},{x:.07016445175727676,y:.0021761036989109733},{x:.07167933951411792,y:.0009328674463854256},{x:.07385023622603624,y:-.00022750102113387976},{x:.07591210278164046,y:-.0015721027544036703},{x:.07773092256935071,y:-.0023017710867676167},{x:.07945924554357096,y:-.003225578963007937},{x:.08181480574188199,y:-.003940130337203038},{x:.08409937289490133,y:-.004856645714911602},{x:.08602559580031956,y:-.00521745953679684},{x:.08790093550927423,y:-.0057863376181453985},{x:.09035063633657014,y:-.00602761209043098},{x:.09277010945251417,y:-.006480819940600742},{x:.09472971180962335,y:-.006458913379178931},{x:.09668,y:-.006651000000000032},{x:.505373,y:-.006651000000000032},{x:.5141520644907257,y:-.0057863376181453985},{x:.522593754456429,y:-.003225578963007937},{x:.5303736604858821,y:.0009328674463854256},{x:.5371928051533946,y:.0065291948466053296},{x:.5427891325536145,y:.013348339514117874},{x:.5469475789630078,y:.021128245543570928},{x:.5495083376181453,y:.029569935509274198},{x:.550373,y:.038348999999999966},{x:.5495083376181453,y:.047128064490725735},{x:.5469475789630078,y:.055569754456429005},{x:.5427891325536145,y:.06334966048588206},{x:.5371928051533946,y:.0701688051533946},{x:.5303736604858821,y:.0757651325536145},{x:.522593754456429,y:.07992357896300786},{x:.5141520644907257,y:.08248433761814533},{x:.505373,y:.08334899999999996},{x:.190464663126857,y:.08334899999999996},{x:.5404754142030563,y:.5196949313117102},{x:.5415458963010891,y:.5213364517572769},{x:.5427891325536145,y:.5228513395141179},{x:.5439495010211337,y:.525022236226036},{x:.5452941027544036,y:.5270841027816404},{x:.5460237710867677,y:.5289029225693511},{x:.5469475789630078,y:.530631245543571},{x:.5476621303372028,y:.5329868057418816},{x:.5485786457149116,y:.5352713728949013},{x:.5489394595367969,y:.53719759580032},{x:.5495083376181453,y:.5390729355092743},{x:.5497496120904308,y:.5415226363365697},{x:.5502028199406007,y:.5439421094525142},{x:.5501809133791788,y:.5459017118096235},{x:.550373,y:.547852},{x:.5501317255277144,y:.5503017008272966},{x:.5501042093268251,y:.552763100911175},{x:.5497004242389665,y:.5546807763003486},{x:.5495083376181453,y:.5566310644907257},{x:.5487937862439503,y:.5589866246890365},{x:.548286603424171,y:.5613953615159966},{x:.5475164570443563,y:.5631974147474748},{x:.5469475789630078,y:.565072754456429},{x:.5457872104954887,y:.567243651168347},{x:.544819851808152,y:.569507158332963},{x:.5437129404298549,y:.5711243375116617},{x:.5427891325536145,y:.5728526604858821},{x:.5412275393022352,y:.5747554673682221},{x:.539837179799195,y:.5767867595595463},{x:.5384360414059206,y:.578156917396553},{x:.5371928051533946,y:.5796718051533947},{x:.5352899982710546,y:.5812333984047738},{x:.5335300686882897,y:.5829544142030564},{x:.5318885482427235,y:.5840248963010888},{x:.5303736604858821,y:.5852681325536145},{x:.5282027637739638,y:.5864285010211338},{x:.5261408972183595,y:.5877731027544036},{x:.5243220774306487,y:.5885027710867679},{x:.522593754456429,y:.5894265789630079},{x:.5202381942581186,y:.5901411303372028},{x:.5179536271050986,y:.5910576457149116},{x:.5160274041996802,y:.5914184595367968},{x:.5141520644907257,y:.5919873376181454},{x:.5117023636634302,y:.5922286120904309},{x:.5092828905474858,y:.5926818199406008},{x:.5073232881903766,y:.5926599133791789},{x:.505373,y:.592852},{x:.09668,y:.592852},{x:.08790093550927423,y:.5919873376181454},{x:.07945924554357094,y:.5894265789630079},{x:.07167933951411792,y:.5852681325536145},{x:.06486019484660537,y:.5796718051533947},{x:.05926386744638546,y:.5728526604858821},{x:.0551054210369921,y:.565072754456429},{x:.05254466238185464,y:.5566310644907257},{x:.051680000000000004,y:.547852},{x:.05254466238185464,y:.5390729355092743},{x:.0551054210369921,y:.530631245543571},{x:.05926386744638546,y:.5228513395141179},{x:.06486019484660537,y:.5160321948466053},{x:.07167933951411792,y:.5104358674463855},{x:.07945924554357096,y:.5062774210369921},{x:.08790093550927423,y:.5037166623818546},{x:.09668,y:.502852},{x:.41158833687314295,y:.502852},{x:.06157758579694366,y:.06650606868828973},{x:.06050710369891106,y:.06486454824272328},{x:.05926386744638546,y:.06334966048588206},{x:.05810349897886612,y:.06117876377396365},{x:.05675889724559635,y:.059116897218359485},{x:.05602922891323242,y:.05729807743064926},{x:.0551054210369921,y:.055569754456429005},{x:.054390869662797,y:.05321419425811798},{x:.053474354285088434,y:.050929627105098636},{x:.0531135404632032,y:.04900340419968042},{x:.05254466238185464,y:.047128064490725735},{x:.05230338790956906,y:.04467836366342984},{x:.051850180059399294,y:.04225889054748581},{x:.05187208662082111,y:.04029928819037662},{x:.051680000000000004,y:.038348999999999966}]]},w5=T4;function X0(y){return!y||typeof y!="object"?!1:"route_type"in y&&y.route_type==="wire"&&("start_width"in y||"end_width"in y||"width_interpolation_mode"in y)}function N4(y){let x=[];for(let e=0;e<y.length-1;e++){let r=y[e];if(!X0(r))continue;let o=y[e+1];if(!o)continue;let c=o.route_type==="through_pad"?o.start:{x:o.x,y:o.y},a=o.route_type==="via"?o.from_layer:o.route_type==="through_pad"?o.start_layer:o.layer;if(!c||a!==r.layer||r.width!==r.start_width)continue;let f={start:{x:r.x,y:r.y},end:c,start_width:r.start_width,end_width:r.end_width,width_interpolation_mode:r.width_interpolation_mode,layer:r.layer,is_inside_copper_pour:!!(r.is_inside_copper_pour&&o.is_inside_copper_pour)};I5(f)&&x.push(f)}return x}function O4(y){let{start:x,end:e,start_width:r,end_width:o}=y,c=e.x-x.x,a=e.y-x.y,f=Math.hypot(c,a);if(!I5(y))return[];let v=Math.abs(o-r),w=y.width_interpolation_mode==="linear"?1:Math.max(1,Math.ceil(Math.sqrt(v/(.001+v*1e-6)*(3/8)))),T=-a/f,I=c/f,b=[],k=[];for(let g=0;g<=w;g++){let P=g/w,N=r<=o?P:1-P,E=(y.width_interpolation_mode==="quadratic"?Math.min(r,o)+v*N*N:r+(o-r)*P)/2,S=x.x+c*P,O=x.y+a*P;b.push({x:S+T*E,y:O+I*E}),k.push({x:S-T*E,y:O-I*E})}return[...b,...k.reverse()]}function I5(y){let{start:x,end:e,start_width:r,end_width:o}=y,c=Math.hypot(e.x-x.x,e.y-x.y);return!(![x.x,x.y,e.x,e.y,c,r,o].every(Number.isFinite)||c<=0||r<=0||o<=0||y.width_interpolation_mode!=="linear"&&y.width_interpolation_mode!=="quadratic")}var Z0=class{constructor(y=[1,1,1,1],x=0,e=0){U(this,"color");U(this,"element");U(this,"category");U(this,"vertices",[]);U(this,"indices",[]);this.color=y,this.element=x,this.category=e}polygon(y){if(!y[0]||y[0].length<3)return;let x=[],e=[];for(let[c,a]of y.entries()){c&&e.push(x.length/2);for(let f of a){if(!Number.isFinite(f.x)||!Number.isFinite(f.y))throw new Error("Non-finite polygon vertex");x.push(f.x,f.y)}}let r=$0(x,e,2),o=this.vertices.length/8;for(let c=0;c<x.length;c+=2)this.vertices.push(x[c],x[c+1],...this.color,this.element,this.category);for(let c of r)this.indices.push(o+c)}line(y,x,e){if(!(e>0))return;let r=b5(y,x,e);this.polygon([r])}path(y,x,e=!1){for(let r=1;r<y.length;r++)this.line(y[r-1],y[r],x);e&&y.length>2&&this.line(y.at(-1),y[0],x)}fabricationPath(y,x,e){if(y.length<2)return;let r=[];if(e&&y.length>=3&&r.push([y.map(c=>[c.x,c.y])]),x>0){let c=e?[...y,y[0]]:y;for(let a=1;a<c.length;a++)r.push([b5(c[a-1],c[a],x).map(f=>[f.x,f.y])])}if(!r.length)return;let o=r.map(c=>c.map(a=>a.map(([f,v])=>[Math.round(f*1e9)/1e9,Math.round(v*1e9)/1e9])));for(let c of R5.default.union(o[0],...o.slice(1)))this.polygon(c.map(a=>a.map(([f,v])=>({x:f,y:v}))))}build(){return{vertices:new Float32Array(this.vertices),indices:new Uint32Array(this.indices)}}};function b5(y,x,e){let r=Math.atan2(x.y-y.y,x.x-y.x),o=e/2,c=[];for(let a=0;a<=12;a++){let f=r+Math.PI/2+a*Math.PI/12;c.push({x:y.x+o*Math.cos(f),y:y.y+o*Math.sin(f)})}for(let a=0;a<=12;a++){let f=r-Math.PI/2+a*Math.PI/12;c.push({x:x.x+o*Math.cos(f),y:x.y+o*Math.sin(f)})}return c}function G0(y,x,e=0){let r=e*Math.PI/180,o=y.x-x.x,c=y.y-x.y;return{x:x.x+o*Math.cos(r)-c*Math.sin(r),y:x.y+o*Math.sin(r)+c*Math.cos(r)}}function j0(y,x,e=x,r=0){return x>0&&e>0?Array.from({length:96},(o,c)=>{let a=c*2*Math.PI/96;return G0({x:y.x+Math.cos(a)*x/2,y:y.y+Math.sin(a)*e/2},y,r)}):[]}function D0(y,x,e,r=0,o=0){if(!(x>0&&e>0))return[];r=Math.max(0,Math.min(r,x/2,e/2));let c=[];for(let a=0;a<4;a++){let f=a===0||a===3?1:-1,v=a<2?1:-1,w=r?24:1;for(let T=0;T<w;T++){let I=(a+T/(w-1||1))*Math.PI/2;c.push(G0({x:y.x+f*(x/2-r)+r*Math.cos(I),y:y.y+v*(e/2-r)+r*Math.sin(I)},y,o))}}return c}function G4(y){let x=[];for(let e=0;e<y.length;e++){let r=y[e],o=y[(e+1)%y.length];x.push({x:r.x,y:r.y});let c=r.bulge??0,a=o.x-r.x,f=o.y-r.y;if(!c||!a&&!f)continue;let v=4*Math.atan(c),w={x:(r.x+o.x)/2-f*(1-c*c)/(4*c),y:(r.y+o.y)/2+a*(1-c*c)/(4*c)},T=Math.atan2(r.y-w.y,r.x-w.x),I=Math.hypot(r.x-w.x,r.y-w.y),b=Math.max(2,Math.ceil(Math.abs(v)/(Math.PI/48)));for(let k=1;k<b;k++)x.push({x:w.x+I*Math.cos(T+v*k/b),y:w.y+I*Math.sin(T+v*k/b)})}return x}function M5(y,x,e){let r=[];for(let o=0;o<y.length;o++){let c=y[o],a=y[(o+1)%y.length],f=c.x+c.y-x,v=a.x+a.y-x,w=e?f>=0:f<=0,T=e?v>=0:v<=0;if(w&&r.push(c),w!==T){let I=f/(f-v);r.push({x:c.x+I*(a.x-c.x),y:c.y+I*(a.y-c.y)})}}return r}function C4(y,x){let e=y.color,r=[e[0]+(1-e[0])*.4,e[1]+(1-e[1])*.4,e[2]+(1-e[2])*.4,e[3]];y.color=[r[0],r[1],r[2],r[3]*.2],y.polygon(x),y.color=r;let o=new Z0;o.polygon(x);let c=.15*Math.SQRT2/2;for(let a=0;a<o.indices.length;a+=3){let f=o.indices.slice(a,a+3).map(I=>({x:o.vertices[I*8],y:o.vertices[I*8+1]})),v=f.map(I=>I.x+I.y),w=Math.ceil(Math.min(...v)-c),T=Math.floor(Math.max(...v)+c);for(let I=w;I<=T;I++)y.polygon([M5(M5(f,I-c,!0),I+c,!1)])}y.color=e}var $=(y,x,e)=>[y/255,x/255,e/255,1],B4={board:$(70,72,72),top:$(200,52,52),bottom:$(77,127,196),inner1:$(127,200,127),inner2:$(206,125,44),inner3:$(79,203,203),inner4:$(219,98,139),inner5:$(167,165,198),inner6:$(40,204,217),inner7:$(232,178,167),inner8:$(242,237,161),drill:$(255,38,226),top_silkscreen:$(242,237,161),bottom_silkscreen:$(242,237,161),soldermask_top:$(12,55,33),soldermask_bottom:$(12,55,33),top_fabrication:[1,1,1,.5],bottom_fabrication:[1,1,1,.5],top_notes:$(89,148,220),bottom_notes:$(89,148,220),top_courtyard:$(255,0,245),bottom_courtyard:$(38,233,255),edge_cuts:$(208,210,205)},q0=y=>y.replace(/_copper$/,"");function H0(y){let x=y.match(/^#([0-9a-f]{3,8})$/i)?.[1];if(x){let r=x.length<=4?[...x].map(o=>o+o).join(""):x;if(r.length!==6&&r.length!==8)throw new Error(`Unsupported color: ${y}`);return[parseInt(r.slice(0,2),16)/255,parseInt(r.slice(2,4),16)/255,parseInt(r.slice(4,6),16)/255,r.length===8?parseInt(r.slice(6),16)/255:1]}let e=y.match(/^rgba?\\(([^)]+)\\)$/);if(e){let r=e[1].split(",").map(o=>Number(o.trim()));if((r.length===3||r.length===4)&&r.every(Number.isFinite))return[r[0]/255,r[1]/255,r[2]/255,r[3]??1]}throw new Error(`Unsupported color: ${y}`)}function U4(y,x){let e=!1;for(let r=0,o=y.length-1;r<y.length;o=r++){let c=y[r],a=y[o];c.y>x.y!=a.y>x.y&&x.x<(a.x-c.x)*(x.y-c.y)/(a.y-c.y)+c.x&&(e=!e)}return e}function E5(y,x){let e=x.filter(r=>r.length>=3).map(r=>({ring:r,parents:[]}));for(let[r,o]of e.entries())o.parents=e.flatMap((c,a)=>r!==a&&U4(c.ring,o.ring[0])?[a]:[]);for(let[r,o]of e.entries())if(o.parents.length%2===0){let c=e.filter(a=>a.parents.length===o.parents.length+1&&a.parents.includes(r));y.polygon([o.ring,...c.map(a=>a.ring)])}}var F4=y=>_5[y]??(y===" "?c0.spaceWidthRatio:c0.glyphWidthRatio);function k5(y,x,e){let r=F4(y),o=x?c0.letterSpacingRatio:0,c=x?v5[y]?.[x]??0:0;return e*(r+o+c)}function W4(y,x){let e=x*c0.glyphWidthRatio,r=x*c0.letterSpacingRatio,o=x*c0.spaceWidthRatio,c=x*c0.strokeWidthRatio,a=x*c0.lineHeightRatio,f=y.replace(/\\\\n/g,`\n`).split(`\n`),v=f.map(I=>{let b=Array.from(I);return b.reduce((k,g,P)=>k+k5(g,b[P+1],x),0)}),w=v.reduce((I,b)=>Math.max(I,b),0),T=f.length>1?x+(f.length-1)*a:x;return{width:w,height:T,glyphWidth:e,letterSpacing:r,spaceWidth:o,strokeWidth:c,lineHeight:a,lines:f,lineWidths:v}}function z4(y){let{line:x,fontSize:e,startX:r,startY:o}=y,c=e,a=e,f=Array.from(x),v=[],w=r+y.layout.strokeWidth/2;return f.forEach((T,I)=>{let b=w5[T];if(b?.length){let k=[];for(let g of b){let P=g.map(N=>({x:w+N.x*a,y:o+(1-N.y)*c}));P.length>=3&&k.push(P)}k.length>0&&v.push(k)}w+=k5(T,f[I+1],e)}),v}function $4(y){let x=Number.POSITIVE_INFINITY,e=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY,o=Number.NEGATIVE_INFINITY;for(let c of y)for(let a of c)x=Math.min(x,a.x),e=Math.min(e,a.y),r=Math.max(r,a.x),o=Math.max(o,a.y);return x===Number.POSITIVE_INFINITY||e===Number.POSITIVE_INFINITY||r===Number.NEGATIVE_INFINITY||o===Number.NEGATIVE_INFINITY?null:{minX:x,minY:e,maxX:r,maxY:o}}function Y4(y,x,e){let r=X4(y,x),o=Z4(r,x,e),c=$4(o.flat()),a=j4(y,x,c);return{bounds:c?Q4(c,a):null,glyphGroups:H4(o,a),linePlacements:r.map(({line:f,startX:v,startY:w})=>({line:f,startX:v+a.x,startY:w+a.y})),startOffset:a}}function V4(y,x){let e=x.width+x.strokeWidth,r=x.height+x.strokeWidth,o=0,c=0;return y==="center"||y==="top_center"||y==="bottom_center"?o=-e/2:y==="top_left"||y==="bottom_left"||y==="center_left"?o=0:y==="top_right"||y==="bottom_right"||y==="center_right"?o=-e:(y==="top_center"||y==="bottom_center")&&(o=-e/2),y==="center"||y==="center_left"||y==="center_right"?c=-r/2:y==="top_left"||y==="top_right"||y==="top_center"?c=0:(y==="bottom_left"||y==="bottom_right"||y==="bottom_center")&&(c=-r),{x:o,y:c}}function X4(y,x){return x.lines.map((e,r)=>({line:e,startX:J4({alignment:y,lineWidth:x.lineWidths[r],maxWidth:x.width,strokeWidth:x.strokeWidth}),startY:r*x.lineHeight}))}function Z4(y,x,e){return y.flatMap(({line:r,startX:o,startY:c})=>z4({line:r,fontSize:e,startX:o,startY:c,layout:x}))}function j4(y,x,e){return e?{x:-D4(y,e),y:-q4(y,e)}:V4(y,x)}function D4(y,x){return y==="top_left"||y==="bottom_left"||y==="center_left"?x.minX:y==="top_right"||y==="bottom_right"||y==="center_right"?x.maxX:(x.minX+x.maxX)/2}function q4(y,x){return y==="top_left"||y==="top_right"||y==="top_center"?x.minY:y==="bottom_left"||y==="bottom_right"||y==="bottom_center"?x.maxY:(x.minY+x.maxY)/2}function H4(y,x){return x.x===0&&x.y===0?y:y.map(e=>e.map(r=>r.map(o=>({x:o.x+x.x,y:o.y+x.y}))))}function Q4(y,x){return{minX:y.minX+x.x,minY:y.minY+x.y,maxX:y.maxX+x.x,maxY:y.maxY+x.y}}function J4(y){let{alignment:x,lineWidth:e,maxWidth:r,strokeWidth:o}=y,c=e+o,a=r+o;return x==="top_left"||x==="bottom_left"||x==="center_left"?0:x==="top_right"||x==="bottom_right"||x==="center_right"?a-c:(a-c)/2}function Q0(y,x,e="up"){let r=String(x.text??"");if(!r)return;let o=x.anchor_position??x.center??{x:x.x??0,y:x.y??0},c=x.font_size??1,a=W4(r,c),f=Y4(x.anchor_alignment??"center",a,c),v=x.type==="pcb_note_text",w=x.type==="pcb_fabrication_note_text",T=w?!1:v?x.is_mirrored_from_top_view??x.layer==="bottom":x.type==="pcb_silkscreen_text"?x.layer==="bottom":x.is_mirrored??x.layer==="bottom",I=v||w?0:x.ccw_rotation??0,b=e==="up"?-1:1,k=g=>G0({x:o.x+(T?-g.x:g.x),y:o.y+b*g.y},o,-b*I);if(x.is_knockout&&!v&&!w){let g=f.bounds;if(!g)return;let P={left:.2,right:.2,top:.2,bottom:.2,...x.knockout_padding},N=[{x:g.minX-P.left,y:g.minY-P.top},{x:g.maxX+P.right,y:g.minY-P.top},{x:g.maxX+P.right,y:g.maxY+P.bottom},{x:g.minX-P.left,y:g.maxY+P.bottom}];E5(y,[N.map(k),...f.glyphGroups.flatMap(A=>A.map(E=>E.map(k)))]);return}for(let g of f.glyphGroups)E5(y,g.map(P=>P.map(k)))}function K4(y,x){return{x:(y.x+x.x)/2,y:(y.y+x.y)/2}}function g0(y,x){return Array.isArray(x)?[y.a*x[0]+y.c*x[1]+y.e,y.b*x[0]+y.d*x[1]+y.f]:{x:y.a*x.x+y.c*x.y+y.e,y:y.b*x.x+y.d*x.y+y.f}}function P0(y){return typeof y>"u"}function I0(y,x=0){return{a:1,c:0,e:y,b:0,d:1,f:x}}function J0(...y){y=Array.isArray(y[0])?y[0]:y;let x=(e,r)=>({a:e.a*r.a+e.c*r.b,c:e.a*r.c+e.c*r.d,e:e.a*r.e+e.c*r.f+e.e,b:e.b*r.a+e.d*r.b,d:e.b*r.c+e.d*r.d,f:e.b*r.e+e.d*r.f+e.f});switch(y.length){case 0:throw new Error("no matrices provided");case 1:return y[0];case 2:return x(y[0],y[1]);default:{let[e,r,...o]=y,c=x(e,r);return J0(c,...o)}}}var{cos:y3,sin:x3,PI:t3}=Math;function e3(y,x,e){let r=y3(y),o=x3(y),c={a:r,c:-o,e:0,b:o,d:r,f:0};return P0(x)||P0(e)?c:J0([I0(x,e),c,I0(-x,-e)])}function A5(y,x=void 0,e=void 0){return e3(y*t3/180,x,e)}function T5(y,x=void 0,e=void 0,r=void 0){P0(x)&&(x=y);let o={a:y,c:0,e:0,b:0,d:x,f:0};return P0(e)||P0(r)?o:J0([I0(e,r),o,I0(-e,-r)])}var{tan:P3}=Math,n3=1.5,r3=.6,i3=.3;function o3({pcbDimension:y}){let x=S5({x:y.to.x-y.from.x,y:y.to.y-y.from.y}),e=g0(A5(90),x),r=S5(y.offset_direction??{x:0,y:0}),o=y.offset_distance??0,c=f0(r,o),a=x0(y.from,c),f=x0(y.to,c),v=y.arrow_size??1,w=x0(a,f0(x,v)),T=x0(f,f0(x,-v)),I=f0(e,v/2),b=f0(e,-v/2),k=c3(r)?r:e,g=f0(k,o+v),P=x0(K4(y.from,y.to),c),N=y.font_size??1,A=v*n3+l3({fontSize:N,text:y.text??"",textCcwRotationDegrees:y.text_ccw_rotation});return{arrowPolygons:[[a,x0(w,I),x0(w,b)],[f,x0(T,I),x0(T,b)]],dimensionLine:{start:w,end:T,width:v/5},extensionLines:[{start:y.from,end:x0(y.from,g)},{start:y.to,end:x0(y.to,g)}],label:y.text?{anchorPosition:x0(P,f0(e,A)),ccwRotationDegrees:s3({dimensionDirection:x,requestedCcwRotationDegrees:y.text_ccw_rotation}),fontSize:N,text:y.text}:void 0}}function s3({dimensionDirection:y,requestedCcwRotationDegrees:x}){let e=Math.atan2(y.y,y.x)*180/Math.PI;return(e>90||e<-90)&&(e+=180),e+(x??0)}function l3({fontSize:y,text:x,textCcwRotationDegrees:e}){if(e===void 0||!Number.isFinite(e))return 0;let r=x.length*y*r3/2,o=y/2,c=A5(e),a=g0(c,{x:r,y:0}),f=g0(c,{x:0,y:o});return Math.abs(a.y)+Math.abs(f.y)+y*i3}function S5(y){let x=Math.hypot(y.x,y.y)||1;return g0(T5(1/x),y)}function f0(y,x){return g0(T5(x),y)}function x0(y,x){return g0(I0(x.x,x.y),y)}function c3(y){return Math.abs(y.x)>Number.EPSILON||Math.abs(y.y)>Number.EPSILON}function a3({mesh:y,pcbDimension:x,textYAxis:e}){x.color&&(y.color=H0(x.color));let{arrowPolygons:r,dimensionLine:o,extensionLines:c,label:a}=o3({pcbDimension:x});for(let f of r)y.polygon([f]);y.line(o.start,o.end,o.width);for(let f of c)y.line(f.start,f.end,o.width);a&&Q0(y,{anchor_alignment:"center",anchor_position:a.anchorPosition,ccw_rotation:a.ccwRotationDegrees,font_size:a.fontSize,text:a.text,type:"pcb_dimension_text"},e)}function u3(y,x=0){return y[`${y.type}_id`]??`${y.type}:${x}`}function O0(y){return y.center??y.anchor_position??{x:y.x??0,y:y.y??0}}function t0(y,x=!1){if(y.brep_shape)return[y.brep_shape.outer_ring,...y.brep_shape.inner_rings??[]].map(v=>G4(v.vertices));if(y.outline?.length)return[y.outline];if(y.shape==="rotated_pill_hole_with_rect_pad"){let v=O0(y),w=x?{x:v.x+(y.hole_offset_x??0),y:v.y+(y.hole_offset_y??0)}:v,T=x?y.hole_width:y.rect_pad_width,I=x?y.hole_height:y.rect_pad_height;return[D0(w,T,I,x?Math.min(T,I)/2:y.rect_border_radius??0,(x?y.hole_ccw_rotation:y.rect_ccw_rotation)??0)]}let e=x?y.hole_shape??y.shape:y.shape;if(e==="polygon")return[y.points??y.vertices??[]];let r=O0(y),o=y.rect_ccw_rotation??y.ccw_rotation??y.rotation??0,c=x?G0({x:r.x+(y.hole_offset_x??0),y:r.y+(y.hole_offset_y??0)},r,o):r;if(e==="circle"||e==="circular_hole_with_rect_pad"&&x||y.type==="pcb_via"){let v=x?y.hole_diameter:y.outer_diameter??(y.radius!=null?y.radius*2:y.diameter);return[j0(c,v||y.diameter||y.hole_diameter||y.radius*2)]}let a=x?y.hole_width??y.hole_diameter:y.rect_pad_width??y.outer_width??y.width??y.hole_diameter,f=x?y.hole_height??y.hole_diameter:y.rect_pad_height??y.outer_height??y.height??y.hole_diameter;if(e==="oval")return[j0(c,a,f,o)];if(["rect","square","rotated_rect","roundrect","rounded_rect","pill","rotated_pill","circular_hole_with_rect_pad","pill_hole_with_rect_pad",void 0].includes(e)){let w=e?.includes("pill")&&!(e==="pill_hole_with_rect_pad"&&!x)?Math.min(a,f)/2:y.corner_radius??y.rect_border_radius??0;return[D0(c,a,f,w,o)]}throw new Error(`Unsupported shape: ${e}`)}function f3(y,x={}){let e=new Map,r=[],o=y.map(u3),c=y.find(b=>b.type==="pcb_board"),a=["top",...Array.from({length:Math.max(0,Math.min(8,(c?.num_layers??2)-2))},(b,k)=>`inner${k+1}`),"bottom"],f=(b,k,g=!1,P=0)=>{b=q0(b),e.has(b)||e.set(b,{paint:new Z0,erase:new Z0});let N=e.get(b)[g?"erase":"paint"];return N.color=x.layerColors?.[b]??B4[b]??[.75,.75,.75,1],N.element=k,N.category=P,N},v=[],w=[],T=[];for(let[b,k]of y.entries()){let g=k,P=g.type;try{if(P==="pcb_board"||P==="pcb_panel"){let N=t0(g);f("board",b).polygon(N);for(let A of N)f("edge_cuts",b).path(A,.1,!0);for(let A of["top","bottom"])f(`soldermask_${A}`,b).polygon(N)}else if(P==="pcb_cutout")T.push({rings:t0(g),index:b}),f("edge_cuts",b).path(t0(g)[0],.05,!0);else if(k.type==="pcb_soldermask_opening")f(`soldermask_${k.layer}`,b,!0).polygon(t0(k));else if(P==="pcb_smtpad")f(g.layer,b).polygon(t0(g)),g.is_covered_with_solder_mask||f(`soldermask_${g.layer}`,b,!0).polygon(t0(g));else if(P==="pcb_via"||P==="pcb_plated_hole"){let N=g.layers??a;if(P==="pcb_via"&&!g.layers&&g.from_layer&&g.to_layer){let A=a.indexOf(g.from_layer),E=a.indexOf(g.to_layer);N=a.slice(Math.min(A,E),Math.max(A,E)+1)}for(let A of N)f(A,b).polygon(t0(g));v.push({element:g,index:b,layers:N});for(let A of["top","bottom"])N.includes(A)&&!g.is_covered_with_solder_mask&&f(`soldermask_${A}`,b,!0).polygon(t0(g))}else if(P==="pcb_hole")v.push({element:{...g,shape:g.hole_shape},index:b,layers:a});else if(k.type==="pcb_trace"){let N=k.route;if(k.route_thickness_mode==="interpolated"&&N.some((A,E)=>A.route_type==="wire"&&!X0(A)&&N[E+1]?.route_type==="wire"))throw new Error("Interpolated/through-pad traces are not supported yet");for(let A of N4(N)){let E=O4(A);if(!E.length)throw new Error("Invalid teardrop geometry or interpolation mode");f(A.layer,b).polygon([E])}for(let A of N)if(A.route_type==="through_pad")for(let E of new Set([A.start_layer,A.end_layer]))f(E,b).line(A.start,A.end,A.width);for(let A=1;A<N.length;A++){let E=N[A-1],S=N[A];X0(E)||(E.route_type==="through_pad"&&(E={route_type:"wire",...E.end,layer:E.end_layer,width:E.width}),S.route_type==="through_pad"&&(S={route_type:"wire",...S.start,layer:S.start_layer,width:S.width}),E.route_type==="wire"&&S.route_type==="wire"&&E.layer===S.layer||E.route_type==="wire"&&S.route_type==="via"&&[S.from_layer,S.to_layer].includes(E.layer)?f(E.layer,b).line(E,S,E.width):E.route_type==="via"&&S.route_type==="wire"&&[E.from_layer,E.to_layer].includes(S.layer)&&f(S.layer,b).line(E,S,S.width))}}else if(P==="pcb_copper_pour")f(g.layer,b,!1,1).polygon(t0(g));else if(P==="pcb_copper_text")Q0(f(g.layer,b),g,x.textYAxis);else if(/^pcb_(silkscreen|fabrication_note|courtyard|note|user_note)_/.test(P)){let N=P.match(/^pcb_(silkscreen|fabrication_note|courtyard|note|user_note)_/)[1],A={silkscreen:"silkscreen",fabrication_note:"fabrication",courtyard:"courtyard",note:"notes",user_note:"notes"}[N],E=`${g.layer??"top"}_${A}`,S=f(E,b);if(k.type==="pcb_note_dimension"||k.type==="pcb_fabrication_note_dimension")a3({mesh:S,pcbDimension:k,textYAxis:x.textYAxis});else if(P.endsWith("_text"))g.color&&(N==="note"||N==="fabrication_note")&&(S.color=H0(g.color)),Q0(S,g,x.textYAxis);else if(P.endsWith("_path")||P.endsWith("_line")||P.endsWith("_outline")){let O=g.route??g.points??g.outline??[g.start,g.end].filter(Boolean),s0=P==="pcb_fabrication_note_path";s0&&g.color&&(S.color=H0(g.color)),s0?S.fabricationPath(O,g.has_stroke===!1?0:g.stroke_width??.05,!!g.is_filled):S.path(O,g.stroke_width??g.width??.05,P.endsWith("_outline"))}else if(P==="pcb_silkscreen_graphic"&&g.shape==="brep")S.polygon(t0(g));else if(P.endsWith("_rect")){let O=D0(O0(g),g.width,g.height,g.corner_radius??0,g.ccw_rotation??0);g.is_filled?S.polygon([O]):S.path(O,g.stroke_width??.05,!0)}else if(P.endsWith("_circle")){let O=j0(O0(g),(g.radius??0)*2);g.is_filled?S.polygon([O]):S.path(O,g.stroke_width??.05,!0)}else throw new Error("Unsupported annotation geometry")}else if(P==="pcb_keepout")w.push({rings:t0(g),index:b,layers:g.layers??[g.layer??"top"]});else if(P.startsWith("pcb_")&&!["pcb_component","pcb_port","pcb_group","pcb_solder_paste","pcb_debug_object","pcb_trace_hint","pcb_anchor","pcb_breakout_point"].includes(P)&&!/_(error|warning)$/.test(P))throw new Error("Unsupported PCB element")}catch(N){r.push({elementId:o[b],type:P,message:String(N)})}}for(let{rings:b,index:k,layers:g}of w)try{for(let P of g)C4(f(P,k),b)}catch(P){r.push({elementId:o[k],type:"pcb_keepout",message:String(P)})}for(let{element:b,index:k,layers:g}of v){let P=t0(b,!0);for(let A of g)f(A,k,!0).polygon(P);g.includes("top")&&g.includes("bottom")&&(f("board",k,!0).polygon(P),f("drill",k).polygon(P));for(let A of["top","bottom"])g.includes(A)&&f(`soldermask_${A}`,k,!0).polygon(P)}for(let{rings:b,index:k}of T){f("drill",k).polygon(b);for(let g of e.keys())g!=="edge_cuts"&&g!=="drill"&&f(g,k,!0).polygon(b)}let I=[...e].map(([b,k])=>({name:b,paint:k.paint.build(),erase:k.erase.build()}));return{layers:I,elementIds:o,diagnostics:r,triangleCount:I.reduce((b,k)=>b+(k.paint.indices.length+k.erase.indices.length)/3,0)}}var h3=`\nstruct Camera { rowX: vec4f, rowY: vec4f, viewport: vec4f }\n@group(0) @binding(0) var<uniform> camera: Camera;\n@group(0) @binding(1) var<storage, read> highlights: array<u32>;\nstruct VertexOut {\n  @builtin(position) position: vec4f,\n  @location(0) color: vec4f,\n  @location(1) @interpolate(flat) category: u32,\n  @location(2) @interpolate(flat) selected: u32,\n}\n@vertex fn vertexMain(@location(0) p: vec2f, @location(1) color: vec4f,\n  @location(2) element: f32, @location(3) category: f32) -> VertexOut {\n  let pixel = vec2f(dot(camera.rowX.xyz, vec3f(p, 1)), dot(camera.rowY.xyz, vec3f(p, 1)));\n  var out: VertexOut;\n  out.position = vec4f(pixel.x / camera.viewport.x * 2 - 1, 1 - pixel.y / camera.viewport.y * 2, 0, 1);\n  let highlight = select(0.0, 1.0, (highlights[u32(element)] & 1u) != 0u);\n  out.color = vec4f(mix(color.rgb, min(vec3f(1), color.rgb * 1.5), highlight), color.a);\n  out.category = u32(category);\n  out.selected = highlights[u32(element)] & 2u;\n  return out;\n}\n@fragment fn fragmentMain(in: VertexOut) -> @location(0) vec4f {\n  if (in.category == 1u && camera.viewport.z == 0) { discard; }\n  if (camera.viewport.w == 1) {\n    if (in.selected == 0u) { discard; }\n    return vec4f(in.color.rgb, 1);\n  }\n  let alpha = in.color.a * select(1.0, camera.viewport.z, in.category == 1u);\n  return vec4f(in.color.rgb * alpha, alpha);\n}\n`,p3=`\n@group(0) @binding(0) var image: texture_2d<f32>;\n@group(0) @binding(1) var imageSampler: sampler;\n@group(0) @binding(2) var<uniform> fade: vec4f;\nstruct Out { @builtin(position) position: vec4f, @location(0) uv: vec2f }\n@vertex fn vertexMain(@builtin(vertex_index) index: u32) -> Out {\n  let points = array<vec2f, 6>(vec2f(0,0),vec2f(1,0),vec2f(0,1),vec2f(0,1),vec2f(1,0),vec2f(1,1));\n  var out: Out;\n  out.uv = points[index];\n  out.position = vec4f(out.uv.x * 2 - 1, 1 - out.uv.y * 2, 0, 1);\n  return out;\n}\n@fragment fn fragmentMain(in: Out) -> @location(0) vec4f {\n  return textureSample(image, imageSampler, in.uv) * fade.x;\n}\n`,P5={color:{srcFactor:"one",dstFactor:"one-minus-src-alpha"},alpha:{srcFactor:"one",dstFactor:"one-minus-src-alpha"}},h0,C0=(h0=class{constructor(x,e,r,o,c){U(this,"canvas");U(this,"device");U(this,"context");U(this,"config");U(this,"realToCanvasMat",{a:1,b:0,c:0,d:-1,e:0,f:0});U(this,"stats",{geometryUploads:0,frames:0,triangleCount:0,compileMs:0,vertexBytes:0});U(this,"circuit");U(this,"scene");U(this,"layers",[]);U(this,"xRayLayers",[]);U(this,"xRayUniform");U(this,"xRayCameraGroup");U(this,"uniform");U(this,"highlights");U(this,"cameraGroup");U(this,"highlightKey","");U(this,"highlightIndices",new Map);U(this,"sample");U(this,"size","");U(this,"disposed",!1);U(this,"adapterInfo");U(this,"lost",!1);U(this,"paintPipeline");U(this,"erasePipeline");U(this,"compositePipeline");U(this,"sampler");U(this,"options",{});this.canvas=x,this.device=e,this.context=r,this.config=c,this.uniform=e.createBuffer({size:48,usage:GPUBufferUsage.UNIFORM|GPUBufferUsage.COPY_DST}),this.xRayUniform=e.createBuffer({size:48,usage:GPUBufferUsage.UNIFORM|GPUBufferUsage.COPY_DST}),this.highlights=e.createBuffer({size:4,usage:GPUBufferUsage.STORAGE|GPUBufferUsage.COPY_DST});let a=e.createShaderModule({code:h3}),f=e.createPipelineLayout({bindGroupLayouts:[e.createBindGroupLayout({entries:[{binding:0,visibility:GPUShaderStage.VERTEX|GPUShaderStage.FRAGMENT,buffer:{type:"uniform"}},{binding:1,visibility:GPUShaderStage.VERTEX,buffer:{type:"read-only-storage"}}]})]}),v=T=>({layout:f,vertex:{module:a,entryPoint:"vertexMain",buffers:[{arrayStride:32,attributes:[{shaderLocation:0,offset:0,format:"float32x2"},{shaderLocation:1,offset:8,format:"float32x4"},{shaderLocation:2,offset:24,format:"float32"},{shaderLocation:3,offset:28,format:"float32"}]}]},fragment:{module:a,entryPoint:"fragmentMain",targets:[{format:"rgba8unorm",blend:T}]},primitive:{topology:"triangle-list"},multisample:{count:c.sampleCount??4}});this.paintPipeline=e.createRenderPipeline(v(P5)),this.erasePipeline=e.createRenderPipeline(v({color:{srcFactor:"zero",dstFactor:"one-minus-src-alpha"},alpha:{srcFactor:"zero",dstFactor:"one-minus-src-alpha"}}));let w=e.createShaderModule({code:p3});this.compositePipeline=e.createRenderPipeline({layout:"auto",vertex:{module:w,entryPoint:"vertexMain"},fragment:{module:w,entryPoint:"fragmentMain",targets:[{format:o,blend:P5}]},primitive:{topology:"triangle-list"}}),this.sampler=e.createSampler({minFilter:"linear",magFilter:"linear"}),e.lost.then(T=>{this.lost=!0,this.disposed||c.onDeviceLost?.(T.message||T.reason)})}static async create(x,e={}){if(!globalThis.navigator?.gpu)throw new Error("WebGPU is unavailable");let r=await navigator.gpu.requestAdapter({powerPreference:"high-performance"});if(!r)throw new Error("No WebGPU adapter available");let o=await r.requestDevice(),c=x.getContext("webgpu");if(!c)throw o.destroy(),new Error("WebGPU canvas context is unavailable");let a=navigator.gpu.getPreferredCanvasFormat();c.configure({device:o,format:a,alphaMode:"premultiplied"}),o.pushErrorScope("validation");try{let f=new h0(x,o,c,a,e),v=await o.popErrorScope();if(v)throw f.dispose(),new Error(v.message);return o.addEventListener("uncapturederror",w=>e.onDeviceLost?.(w.error.message)),f.adapterInfo=r.info,f}catch(f){throw c.unconfigure(),o.destroy(),f}}get diagnostics(){return this.scene?.diagnostics??[]}setCircuitJson(x){if(this.assertLive(),this.circuit===x)return;let e=performance.now(),r=f3(x,this.config);this.releaseLayers(),this.highlights.destroy(),this.highlights=this.device.createBuffer({size:Math.max(4,r.elementIds.length*4),usage:GPUBufferUsage.STORAGE|GPUBufferUsage.COPY_DST}),this.highlightIndices=new Map(r.elementIds.map((c,a)=>[c,a])),this.highlightKey="!",this.cameraGroup=this.device.createBindGroup({layout:this.paintPipeline.getBindGroupLayout(0),entries:[{binding:0,resource:{buffer:this.uniform}},{binding:1,resource:{buffer:this.highlights}}]}),this.xRayCameraGroup=this.device.createBindGroup({layout:this.paintPipeline.getBindGroupLayout(0),entries:[{binding:0,resource:{buffer:this.xRayUniform}},{binding:1,resource:{buffer:this.highlights}}]}),this.stats.vertexBytes=0;let o=c=>{let a=(f,v)=>{let w=this.device.createBuffer({size:Math.max(4,f.byteLength),usage:v|GPUBufferUsage.COPY_DST});return f.byteLength&&this.device.queue.writeBuffer(w,0,f.buffer,f.byteOffset,f.byteLength),this.stats.vertexBytes+=f.byteLength,w};return{vertices:a(c.vertices,GPUBufferUsage.VERTEX),indices:a(c.indices,GPUBufferUsage.INDEX),count:c.indices.length}};this.layers=r.layers.map(c=>({name:c.name,paint:o(c.paint),erase:o(c.erase),opacity:this.device.createBuffer({size:16,usage:GPUBufferUsage.UNIFORM|GPUBufferUsage.COPY_DST})})),this.xRayLayers=this.layers.filter(c=>this.isCopper(c.name)||c.name==="drill").map(c=>({...c,opacity:this.device.createBuffer({size:16,usage:GPUBufferUsage.UNIFORM|GPUBufferUsage.COPY_DST})})),this.scene=r,this.circuit=x,this.size="",this.stats.geometryUploads++,this.stats.triangleCount=r.triangleCount,this.stats.compileMs=performance.now()-e}drawElements(x,e={}){this.setCircuitJson(x),this.options={},this.render(e)}render(x={}){this.assertLive(),this.options={...this.options,...x};let e=this.options;e.transform&&(this.realToCanvasMat=e.transform);let r=this.realToCanvasMat,o=this.canvas.width,c=this.canvas.height;if(!o||!c)return;if(![...Object.values(r),o,c].every(Number.isFinite))throw new Error("Invalid camera or canvas dimensions");if(o>this.device.limits.maxTextureDimension2D||c>this.device.limits.maxTextureDimension2D)throw new Error("Canvas exceeds GPU texture limits");let a=e.showCopperPours===!1?0:Number.isFinite(e.copperPourOpacity)?Math.max(0,Math.min(1,e.copperPourOpacity)):1;this.resize(o,c),this.device.queue.writeBuffer(this.uniform,0,new Float32Array([r.a,r.c,r.e,0,r.b,r.d,r.f,0,o,c,a,0]));let f=e.xRayElementIds??[],v=f.length>0;v&&this.device.queue.writeBuffer(this.xRayUniform,0,new Float32Array([r.a,r.c,r.e,0,r.b,r.d,r.f,0,o,c,a,1]));let w=v?[]:e.highlightedElementIds??[],T=JSON.stringify([w,f]);if(T!==this.highlightKey){let E=new Uint32Array(Math.max(1,this.scene?.elementIds.length??0));for(let S of w){let O=this.highlightIndices.get(S);O!==void 0&&(E[O]=1)}for(let S of f){let O=this.highlightIndices.get(S);O!==void 0&&(E[O]|=2)}this.device.queue.writeBuffer(this.highlights,0,E),this.highlightKey=T}let I=q0(e.selectedLayer??"top"),b=e.layers?new Set(e.layers.map(q0)):void 0,k=this.layers.filter(E=>b&&!b.has(E.name)||v&&!this.isCopper(E.name)||E.name==="board"&&!e.showBoardMaterial||E.name.startsWith("soldermask_")&&(!e.showSolderMask||E.name!==`soldermask_${I}`)||E.name.includes("silkscreen")&&e.showSilkscreen===!1||E.name.includes("fabrication")&&!e.showFabricationNotes||E.name.includes("notes")&&e.showPcbNotes===!1||E.name.includes("courtyard")&&!e.showCourtyards?!1:v&&this.isCopper(E.name)||this.opacity(E.name,I,e.hiddenLayerOpacity??.4)>0).sort((E,S)=>this.order(E.name,I)-this.order(S.name,I)),g=v?this.xRayLayers.filter(E=>!b||b.has(E.name)).sort((E,S)=>this.xRayOrder(E.name,I)-this.xRayOrder(S.name,I)):[],P=[...k.map(E=>({layer:E,xRay:!1})),...g.map(E=>({layer:E,xRay:!0}))],N=this.device.createCommandEncoder();for(let{layer:E,xRay:S}of P){this.ensureTexture(E,o,c);let O=E.texture.createView(),s0=(this.config.sampleCount??4)>1,J=N.beginRenderPass({colorAttachments:[{view:s0?this.sample.createView():O,...s0?{resolveTarget:O}:{},clearValue:[0,0,0,0],loadOp:"clear",storeOp:s0?"discard":"store"}]});for(let[H,V]of[[E.paint,this.paintPipeline],[E.erase,this.erasePipeline]])H.count&&(J.setBindGroup(0,S&&V===this.paintPipeline?this.xRayCameraGroup:this.cameraGroup),J.setPipeline(V),J.setVertexBuffer(0,H.vertices),J.setIndexBuffer(H.indices,"uint32"),J.drawIndexed(H.count));J.end(),this.device.queue.writeBuffer(E.opacity,0,new Float32Array([S?1:v&&this.isCopper(E.name)?Math.max(0,Math.min(1,e.hiddenLayerOpacity??.4)):this.opacity(E.name,I,e.hiddenLayerOpacity??.4),0,0,0]))}let A=N.beginRenderPass({colorAttachments:[{view:this.context.getCurrentTexture().createView(),clearValue:e.background??[0,0,0,0],loadOp:"clear",storeOp:"store"}]});A.setPipeline(this.compositePipeline);for(let{layer:E}of P)A.setBindGroup(0,E.composite),A.draw(6);A.end(),this.device.queue.submit([N.finish()]),this.stats.frames++}async flush(){this.assertLive(),await this.device.queue.onSubmittedWorkDone()}isCopper(x){return/^(top|bottom|inner\\d+)$/.test(x)}opacity(x,e,r){return["board","drill","edge_cuts"].includes(x)||x===e||x.startsWith(`${e}_`)||x.endsWith(`_${e}`)?1:Math.max(0,Math.min(1,r))}xRayOrder(x,e){return x==="drill"?200:x===e?100:x==="bottom"?0:x.startsWith("inner")?20-Number(x.slice(5)):40}order(x,e){if(x==="board")return-100;if(x==="drill")return 200;if(x==="edge_cuts")return 150;let r=x===e?100:x.startsWith("inner")?20-Number(x.slice(5)):x==="bottom"?30:40;return x.includes("soldermask")?110:x.startsWith(`${e}_`)?120:r}resize(x,e){let r=`${x}:${e}`;if(r!==this.size){this.sample?.destroy(),this.sample=(this.config.sampleCount??4)>1?this.device.createTexture({size:[x,e],format:"rgba8unorm",sampleCount:this.config.sampleCount??4,usage:GPUTextureUsage.RENDER_ATTACHMENT}):void 0;for(let o of[...this.layers,...this.xRayLayers])o.texture?.destroy(),o.texture=void 0,o.composite=void 0;this.size=r}}ensureTexture(x,e,r){x.texture||(x.texture=this.device.createTexture({size:[e,r],format:"rgba8unorm",usage:GPUTextureUsage.RENDER_ATTACHMENT|GPUTextureUsage.TEXTURE_BINDING}),x.composite=this.device.createBindGroup({layout:this.compositePipeline.getBindGroupLayout(0),entries:[{binding:0,resource:x.texture.createView()},{binding:1,resource:this.sampler},{binding:2,resource:{buffer:x.opacity}}]}))}assertLive(){if(this.disposed||this.lost)throw new Error(this.lost?"WebGPU device lost":"Renderer disposed")}releaseLayers(){for(let x of this.xRayLayers)x.opacity.destroy(),x.texture?.destroy();this.xRayLayers=[];for(let x of this.layers){for(let e of[x.paint,x.erase])e.vertices.destroy(),e.indices.destroy();x.opacity.destroy(),x.texture?.destroy()}this.layers=[]}dispose(){if(this.disposed)return;this.disposed=!0,this.releaseLayers(),this.sample?.destroy(),this.uniform.destroy(),this.xRayUniform.destroy(),this.highlights.destroy(),this.context.unconfigure();let x=()=>this.device.destroy();this.device.queue.onSubmittedWorkDone().then(x,x),this.circuit=void 0,this.scene=void 0}},U(h0,"supportsXRayNet",!0),h0);var m0=self,O5="supportsXRayNet"in C0&&C0.supportsXRayNet===!0,Q,d0,B0,G5=0,K0=!1,_0=!1,y5=y=>{_0||(_0=!0,Q?.dispose(),m0.postMessage({type:"error",message:y instanceof Error?y.message:String(y)}))};function N5(){if(K0||_0||!Q||!B0)return;K0=!0;let y=()=>{if(K0=!1,!(_0||!Q||!B0))try{let x=B0,e=G5;d0.width!==x.width&&(d0.width=x.width),d0.height!==x.height&&(d0.height=x.height),Q.render({...x.options,transform:x.transform}),m0.postMessage({type:"rendered",xRayActive:O5&&!!x.options.xRayElementIds?.length,geometryUploads:Q.stats.geometryUploads,frames:Q.stats.frames,compileMs:Q.stats.compileMs,sceneGeneration:e})}catch(x){y5(x)}};m0.requestAnimationFrame?m0.requestAnimationFrame(y):setTimeout(y,16)}m0.onmessage=async y=>{let x=y.data;try{if(x.type==="init"){if(d0=x.canvas,Q=await C0.create(d0,{onDeviceLost:y5}),_0){Q.dispose();return}m0.postMessage({type:"ready",supportsXRayNet:O5})}else if(x.type==="scene"){if(Q.setCircuitJson(x.elements),Q.diagnostics.length)throw new Error(`Unsupported WebGPU geometry: ${Q.diagnostics.map(e=>`${e.type}: ${e.message}`).join("; ")}`);G5=x.sceneGeneration,N5()}else x.type==="view"?(B0=x,N5()):(_0=!0,Q?.dispose())}catch(e){y5(e)}};})();\n/*! Bundled license information:\n\npolygon-clipping/dist/polygon-clipping.umd.js:\n  (**\n   * splaytree v3.1.2\n   * Fast Splay tree for Node and browser\n   *\n   * @author Alexander Milevski <info@w8r.name>\n   * @license MIT\n   * @preserve\n   *)\n  (*! *****************************************************************************\n      Copyright (c) Microsoft Corporation. All rights reserved.\n      Licensed under the Apache License, Version 2.0 (the "License"); you may not use\n      this file except in compliance with the License. You may obtain a copy of the\n      License at http://www.apache.org/licenses/LICENSE-2.0\n  \n      THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n      KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\n      WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\n      MERCHANTABLITY OR NON-INFRINGEMENT.\n  \n      See the Apache Version 2.0 License for specific language governing permissions\n      and limitations under the License.\n      ***************************************************************************** *)\n*/\n'],{type:"text/javascript"}));try{return new Worker(e)}finally{URL.revokeObjectURL(e)}}var TKi=SKi({"inline-worker:/home/runner/work/pcb-viewer/pcb-viewer/src/lib/webgpu/pcb-webgpu.worker.ts"(){}}),DKi=Nmt({"node_modules/svgson/dist/svgson.umd.js"(e,t){(function(n,o){typeof e==="object"&&typeof t<"u"?t.exports=o():typeof define==="function"&&define.amd?define(o):(n=typeof globalThis<"u"?globalThis:n||self,n.svgson=o())})(e,function(){var n=function(Y){return Y!=null&&(o(Y)||r(Y)||!!Y._isBuffer)};function o(Y){return!!Y.constructor&&typeof Y.constructor.isBuffer==="function"&&Y.constructor.isBuffer(Y)}function r(Y){return typeof Y.readFloatLE==="function"&&typeof Y.slice==="function"&&o(Y.slice(0,0))}var i=Object.prototype.toString,s=function(X){if(typeof X>"u")return"undefined";if(X===null)return"null";if(X===!0||X===!1||X instanceof Boolean)return"boolean";if(typeof X==="string"||X instanceof String)return"string";if(typeof X==="number"||X instanceof Number)return"number";if(typeof X==="function"||X instanceof Function)return"function";if(typeof Array.isArray<"u"&&Array.isArray(X))return"array";if(X instanceof RegExp)return"regexp";if(X instanceof Date)return"date";var K=i.call(X);if(K==="[object RegExp]")return"regexp";if(K==="[object Date]")return"date";if(K==="[object Arguments]")return"arguments";if(K==="[object Error]")return"error";if(n(X))return"buffer";if(K==="[object Set]")return"set";if(K==="[object WeakSet]")return"weakset";if(K==="[object Map]")return"map";if(K==="[object WeakMap]")return"weakmap";if(K==="[object Symbol]")return"symbol";if(K==="[object Int8Array]")return"int8array";if(K==="[object Uint8Array]")return"uint8array";if(K==="[object Uint8ClampedArray]")return"uint8clampedarray";if(K==="[object Int16Array]")return"int16array";if(K==="[object Uint16Array]")return"uint16array";if(K==="[object Int32Array]")return"int32array";if(K==="[object Uint32Array]")return"uint32array";if(K==="[object Float32Array]")return"float32array";if(K==="[object Float64Array]")return"float64array";return"object"};function a(Y,X){return X={exports:{}},Y(X,X.exports),X.exports}var c=a(function(Y){(function(){function X(K,J){if(typeof J!=="function")return K;var ee={};for(var se in K)if(Object.prototype.hasOwnProperty.call(K,se))ee[J(se,K[se])||se]=K[se];return ee}if(Y.exports)Y.exports=X;else window.rename=X})()}),l=function Y(X,K){var J=s(X);if(J!=="object"&&J!=="array")throw Error("expected an object");var ee=[];if(J==="object")X=c(X,K),ee={};for(var se in X)if(X.hasOwnProperty(se)){var ne=X[se];if(s(ne)==="object"||s(ne)==="array")ee[se]=Y(ne,K);else ee[se]=ne}return ee},h=a(function(Y){var X=Object.prototype.hasOwnProperty,K="~";function J(){}if(Object.create){if(J.prototype=Object.create(null),!new J().__proto__)K=!1}function ee(ne,re,Z){this.fn=ne,this.context=re,this.once=Z||!1}function se(){this._events=new J,this._eventsCount=0}se.prototype.eventNames=function(){var re=[],Z,te;if(this._eventsCount===0)return re;for(te in Z=this._events)if(X.call(Z,te))re.push(K?te.slice(1):te);if(Object.getOwnPropertySymbols)return re.concat(Object.getOwnPropertySymbols(Z));return re},se.prototype.listeners=function(re,Z){var te=K?K+re:re,ie=this._events[te];if(Z)return!!ie;if(!ie)return[];if(ie.fn)return[ie.fn];for(var ce=0,ue=ie.length,de=Array(ue);ce<ue;ce++)de[ce]=ie[ce].fn;return de},se.prototype.emit=function(re,Z,te,ie,ce,ue){var de=K?K+re:re;if(!this._events[de])return!1;var me=this._events[de],ge=arguments.length,xe,Ee;if(me.fn){if(me.once)this.removeListener(re,me.fn,void 0,!0);switch(ge){case 1:return me.fn.call(me.context),!0;case 2:return me.fn.call(me.context,Z),!0;case 3:return me.fn.call(me.context,Z,te),!0;case 4:return me.fn.call(me.context,Z,te,ie),!0;case 5:return me.fn.call(me.context,Z,te,ie,ce),!0;case 6:return me.fn.call(me.context,Z,te,ie,ce,ue),!0}for(Ee=1,xe=Array(ge-1);Ee<ge;Ee++)xe[Ee-1]=arguments[Ee];me.fn.apply(me.context,xe)}else{var Re=me.length,Me;for(Ee=0;Ee<Re;Ee++){if(me[Ee].once)this.removeListener(re,me[Ee].fn,void 0,!0);switch(ge){case 1:me[Ee].fn.call(me[Ee].context);break;case 2:me[Ee].fn.call(me[Ee].context,Z);break;case 3:me[Ee].fn.call(me[Ee].context,Z,te);break;case 4:me[Ee].fn.call(me[Ee].context,Z,te,ie);break;default:if(!xe)for(Me=1,xe=Array(ge-1);Me<ge;Me++)xe[Me-1]=arguments[Me];me[Ee].fn.apply(me[Ee].context,xe)}}}return!0},se.prototype.on=function(re,Z,te){var ie=new ee(Z,te||this),ce=K?K+re:re;if(!this._events[ce])this._events[ce]=ie,this._eventsCount++;else if(!this._events[ce].fn)this._events[ce].push(ie);else this._events[ce]=[this._events[ce],ie];return this},se.prototype.once=function(re,Z,te){var ie=new ee(Z,te||this,!0),ce=K?K+re:re;if(!this._events[ce])this._events[ce]=ie,this._eventsCount++;else if(!this._events[ce].fn)this._events[ce].push(ie);else this._events[ce]=[this._events[ce],ie];return this},se.prototype.removeListener=function(re,Z,te,ie){var ce=K?K+re:re;if(!this._events[ce])return this;if(!Z){if(--this._eventsCount===0)this._events=new J;else delete this._events[ce];return this}var ue=this._events[ce];if(ue.fn){if(ue.fn===Z&&(!ie||ue.once)&&(!te||ue.context===te))if(--this._eventsCount===0)this._events=new J;else delete this._events[ce]}else{for(var de=0,me=[],ge=ue.length;de<ge;de++)if(ue[de].fn!==Z||ie&&!ue[de].once||te&&ue[de].context!==te)me.push(ue[de]);if(me.length)this._events[ce]=me.length===1?me[0]:me;else if(--this._eventsCount===0)this._events=new J;else delete this._events[ce]}return this},se.prototype.removeAllListeners=function(re){var Z;if(re){if(Z=K?K+re:re,this._events[Z])if(--this._eventsCount===0)this._events=new J;else delete this._events[Z]}else this._events=new J,this._eventsCount=0;return this},se.prototype.off=se.prototype.removeListener,se.prototype.addListener=se.prototype.on,se.prototype.setMaxListeners=function(){return this},se.prefixed=K,se.EventEmitter=se,Y.exports=se});function d(Y,X,K){if(X in Y)Object.defineProperty(Y,X,{value:K,enumerable:!0,configurable:!0,writable:!0});else Y[X]=K;return Y}var u=function(){},_={data:"state-data",cdata:"state-cdata",tagBegin:"state-tag-begin",tagName:"state-tag-name",tagEnd:"state-tag-end",attributeNameStart:"state-attribute-name-start",attributeName:"state-attribute-name",attributeNameEnd:"state-attribute-name-end",attributeValueBegin:"state-attribute-value-begin",attributeValue:"state-attribute-value"},p={lt:"action-lt",gt:"action-gt",space:"action-space",equal:"action-equal",quote:"action-quote",slash:"action-slash",char:"action-char",error:"action-error"},m={text:"text",openTag:"open-tag",closeTag:"close-tag",attributeName:"attribute-name",attributeValue:"attribute-value"},A={" ":p.space,"\t":p.space,"\n":p.space,"\r":p.space,"<":p.lt,">":p.gt,'"':p.quote,"'":p.quote,"=":p.equal,"/":p.slash},g=function(X){return A[X]||p.char},f=function(X){var K,J,ee,se,ne,re,Z,te,ie,ce;X=Object.assign({debug:!1},X);var ue=new h,de=_.data,me="",ge="",xe="",Ee="",Re="",Me="",_e=function(Ne,Le){if(ge[0]==="?"||ge[0]==="!")return;var nt={type:Ne,value:Le};if(X.debug)console.log("emit:",nt);ue.emit("data",nt)};ue.stateMachine=(ce={},d(ce,_.data,(K={},d(K,p.lt,function(){if(me.trim())_e(m.text,me);ge="",Re=!1,de=_.tagBegin}),d(K,p.char,function(Se){me+=Se}),K)),d(ce,_.cdata,d({},p.char,function(Se){if(me+=Se,me.substr(-3)==="]]>")_e(m.text,me.slice(0,-3)),me="",de=_.data})),d(ce,_.tagBegin,(J={},d(J,p.space,u),d(J,p.char,function(Se){ge=Se,de=_.tagName}),d(J,p.slash,function(){ge="",Re=!0}),J)),d(ce,_.tagName,(ee={},d(ee,p.space,function(){if(Re)de=_.tagEnd;else de=_.attributeNameStart,_e(m.openTag,ge)}),d(ee,p.gt,function(){if(Re)_e(m.closeTag,ge);else _e(m.openTag,ge);me="",de=_.data}),d(ee,p.slash,function(){de=_.tagEnd,_e(m.openTag,ge)}),d(ee,p.char,function(Se){if(ge+=Se,ge==="![CDATA[")de=_.cdata,me="",ge=""}),ee)),d(ce,_.tagEnd,(se={},d(se,p.gt,function(){_e(m.closeTag,ge),me="",de=_.data}),d(se,p.char,u),se)),d(ce,_.attributeNameStart,(ne={},d(ne,p.char,function(Se){xe=Se,de=_.attributeName}),d(ne,p.gt,function(){me="",de=_.data}),d(ne,p.space,u),d(ne,p.slash,function(){Re=!0,de=_.tagEnd}),ne)),d(ce,_.attributeName,(re={},d(re,p.space,function(){de=_.attributeNameEnd}),d(re,p.equal,function(){_e(m.attributeName,xe),de=_.attributeValueBegin}),d(re,p.gt,function(){Ee="",_e(m.attributeName,xe),_e(m.attributeValue,Ee),me="",de=_.data}),d(re,p.slash,function(){Re=!0,Ee="",_e(m.attributeName,xe),_e(m.attributeValue,Ee),de=_.tagEnd}),d(re,p.char,function(Se){xe+=Se}),re)),d(ce,_.attributeNameEnd,(Z={},d(Z,p.space,u),d(Z,p.equal,function(){_e(m.attributeName,xe),de=_.attributeValueBegin}),d(Z,p.gt,function(){Ee="",_e(m.attributeName,xe),_e(m.attributeValue,Ee),me="",de=_.data}),d(Z,p.char,function(Se){Ee="",_e(m.attributeName,xe),_e(m.attributeValue,Ee),xe=Se,de=_.attributeName}),Z)),d(ce,_.attributeValueBegin,(te={},d(te,p.space,u),d(te,p.quote,function(Se){Me=Se,Ee="",de=_.attributeValue}),d(te,p.gt,function(){Ee="",_e(m.attributeValue,Ee),me="",de=_.data}),d(te,p.char,function(Se){Me="",Ee=Se,de=_.attributeValue}),te)),d(ce,_.attributeValue,(ie={},d(ie,p.space,function(Se){if(Me)Ee+=Se;else _e(m.attributeValue,Ee),de=_.attributeNameStart}),d(ie,p.quote,function(Se){if(Me===Se)_e(m.attributeValue,Ee),de=_.attributeNameStart;else Ee+=Se}),d(ie,p.gt,function(Se){if(Me)Ee+=Se;else _e(m.attributeValue,Ee),me="",de=_.data}),d(ie,p.slash,function(Se){if(Me)Ee+=Se;else _e(m.attributeValue,Ee),Re=!0,de=_.tagEnd}),d(ie,p.char,function(Se){Ee+=Se}),ie)),ce);var ye=function(Ne){if(X.debug)console.log(de,Ne);var Le=ue.stateMachine[de],nt=Le[g(Ne)]||Le[p.error]||Le[p.char];nt(Ne)};return ue.write=function(Se){var Ne=Se.length;for(var Le=0;Le<Ne;Le++)ye(Se[Le])},ue},y={State:_,Action:p,Type:m,create:f},x=y.Type,C={element:"element",text:"text"},b=function(X){return Object.assign({name:"",type:C.element,value:"",parent:null,attributes:{},children:[]},X)},I=function(X){X=Object.assign({stream:!1,parentNodes:!0,doneEvent:"done",tagPrefix:"tag:",emitTopLevelOnly:!1,debug:!1},X);var K=void 0,J=void 0,ee=void 0,se=void 0,ne=new h,re=function(te){switch(te.type){case x.openTag:if(ee===null)ee=J,ee.name=te.value;else{var ie=b({name:te.value,parent:ee});ee.children.push(ie),ee=ie}break;case x.closeTag:var ce=ee.parent;if(!X.parentNodes)ee.parent=null;if(ee.name!==te.value)break;if(X.stream&&ce===J)J.children=[],ee.parent=null;if(!X.emitTopLevelOnly||ce===J)ne.emit(X.tagPrefix+ee.name,ee),ne.emit("tag",ee.name,ee);if(ee===J)K.removeAllListeners("data"),ne.emit(X.doneEvent,ee),J=null;ee=ce;break;case x.text:if(ee)ee.children.push(b({type:C.text,value:te.value,parent:X.parentNodes?ee:null}));break;case x.attributeName:se=te.value,ee.attributes[se]="";break;case x.attributeValue:ee.attributes[se]=te.value;break}};return ne.reset=function(){K=y.create({debug:X.debug}),K.on("data",re),J=b(),ee=null,se="",ne.parse=K.write},ne.reset(),ne},v=function(X,K){K=Object.assign({},K,{stream:!1,tagPrefix:":"});var J=I(K),ee=void 0;return J.on("done",function(se){ee=se}),J.parse(X),ee},P={parseSync:v,create:I,NodeType:C},M=P.parseSync,B=function(X){var K=M("<root>".concat(X,"</root>"),{parentNodes:!1}),J=K.children&&K.children.length>0&&K.children.every(function(ee){return ee.name==="svg"});if(J)return K.children.length===1?K.children[0]:K.children;else throw Error("nothing to parse")},T=function(X){return l(X,function(K){if(!D(K))return N(K);return K})},N=function(X){return X.replace(/[-|:]([a-z])/gi,function(K,J){return J.toUpperCase()})},D=function(X){return/^(data|aria)(-\w+)/.test(X)},L=function(X){if(X){var K=String(X);return/[&<>]/.test(K)?"<![CDATA[".concat(K.replace(/]]>/,"]]]]><![CDATA[>"),"]]>"):K}return""},H=function(X){return String(X).replace(/&/g,"&amp;").replace(/'/g,"&apos;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")},V=function(X){var K=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},J=K.transformNode,ee=J===void 0?function(Z){return Z}:J,se=K.camelcase,ne=se===void 0?!1:se,re=function(te){var ie=ee(te);if(ne)ie=T(ie);return ie};return re(B(X))};function O(){for(var Y=arguments.length,X=Array(Y),K=0;K<Y;K++)X[K]=arguments[K];return new Promise(function(J,ee){try{var se=V.apply(void 0,X);J(se)}catch(ne){ee(ne)}})}var U=function Y(X){var K=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},J=K.transformAttr,ee=J===void 0?function(de,me,ge){return"".concat(de,'="').concat(ge(me),'"')}:J,se=K.transformNode,ne=se===void 0?function(de){return de}:se,re=K.selfClose,Z=re===void 0?!0:re;if(Array.isArray(X))return X.map(function(de){return Y(de,{transformAttr:ee,selfClose:Z,transformNode:ne})}).join("");var te=ne(X);if(te.type==="text")return L(te.value);var ie="";for(var ce in te.attributes){var ue=ee(ce,te.attributes[ce],H,te.name);ie+=ue?" ".concat(ue):""}return te.children&&te.children.length>0||!Z?"<".concat(te.name).concat(ie,">").concat(Y(te.children,{transformAttr:ee,transformNode:ne,selfClose:Z}),"</").concat(te.name,">"):"<".concat(te.name).concat(ie,"/>")},j=Object.assign({},{parse:O,parseSync:V,stringify:U});return j})}}),mso=dwe.createContext(null),NKi=()=>dwe.useContext(mso),_so=!0,HKi=!1,hme={CCW:-1,CW:1,NOT_ORIENTABLE:0},FKi=2*Math.PI,awe=1,gso=0,HP=2,zKi=3,OKi=4,VKi=1,YKi=2,Rmt=0,dme=1,Rte=2,cwe=Object.freeze({__proto__:null,BOUNDARY:HP,CCW:_so,CONTAINS:zKi,CW:HKi,END_VERTEX:Rte,INSIDE:awe,INTERLACE:OKi,NOT_VERTEX:Rmt,ORIENTATION:hme,OUTSIDE:gso,OVERLAP_OPPOSITE:YKi,OVERLAP_SAME:VKi,PIx2:FKi,START_VERTEX:dme}),GP=0.000001;function Aso(e){GP=e}function fso(){return GP}var GKi=3;function dmt(e){return e<GP&&e>-GP}function WG(e,t){return e-t<GP&&e-t>-GP}function yso(e,t){return e-t>GP}function UKi(e,t){return e-t>-GP}function xso(e,t){return e-t<-GP}function WKi(e,t){return e-t<GP}var XKi=Object.freeze({__proto__:null,DECIMALS:GKi,EQ:WG,EQ_0:dmt,GE:UKi,GT:yso,LE:WKi,LT:xso,getTolerance:fso,setTolerance:Aso}),Ve={Utils:XKi,Errors:void 0,Matrix:void 0,Planar_set:void 0,Point:void 0,Vector:void 0,Line:void 0,Circle:void 0,Segment:void 0,Arc:void 0,Box:void 0,Edge:void 0,Face:void 0,Ray:void 0,Ray_shooting:void 0,Multiline:void 0,Polygon:void 0,Distance:void 0,Inversion:void 0};for(let e in cwe)Ve[e]=cwe[e];Object.defineProperty(Ve,"DP_TOL",{get:function(){return fso()},set:function(e){Aso(e)}});var e0=class{static get ILLEGAL_PARAMETERS(){return ReferenceError("Illegal Parameters")}static get ZERO_DIVISION(){return Error("Zero division")}static get UNRESOLVED_BOUNDARY_CONFLICT(){return Error("Unresolved boundary conflict in boolean operation")}static get INFINITE_LOOP(){return Error("Infinite loop")}static get CANNOT_COMPLETE_BOOLEAN_OPERATION(){return Error("Cannot complete boolean operation")}static get CANNOT_INVOKE_ABSTRACT_METHOD(){return Error("Abstract method cannot be invoked")}static get OPERATION_IS_NOT_SUPPORTED(){return Error("Operation is not supported")}static get UNSUPPORTED_SHAPE_TYPE(){return Error("Unsupported shape type")}};Ve.Errors=e0;var Qmt=class{constructor(e,t){this.first=e,this.last=t||this.first}[Symbol.iterator](){let e=void 0;return{next:()=>(e=e?e.next:this.first,{value:e,done:e===void 0})}}get size(){let e=0;for(let t of this)e++;return e}toArray(e=void 0,t=void 0){let n=[],o=e||this.first,r=t||this.last,i=o;if(i===void 0)return n;do n.push(i),i=i.next;while(i!==r.next);return n}append(e){if(this.isEmpty())this.first=e;else e.prev=this.last,this.last.next=e;return this.last=e,this.last.next=void 0,this.first.prev=void 0,this}insert(e,t){if(this.isEmpty())this.first=e,this.last=e;else if(t===null||t===void 0)e.next=this.first,this.first.prev=e,this.first=e;else{let n=t.next;if(t.next=e,n)n.prev=e;if(e.prev=t,e.next=n,this.last===t)this.last=e}return this.last.next=void 0,this.first.prev=void 0,this}remove(e){if(e===this.first&&e===this.last)this.first=void 0,this.last=void 0;else{if(e.prev)e.prev.next=e.next;if(e.next)e.next.prev=e.prev;if(e===this.first)this.first=e.next;if(e===this.last)this.last=e.prev}return this}isEmpty(){return this.first===void 0}static testInfiniteLoop(e){let t=e,n=e;do{if(t!=e&&t===n)throw e0.INFINITE_LOOP;t=t.next,n=n.next.next}while(t!=e)}},yio={stroke:"black"},jKi=class{constructor(e=yio){for(let t in e)this[t]=e[t];this.stroke=e.stroke??yio.stroke}toAttributesString(){return Object.keys(this).reduce((e,t)=>e+(this[t]!==void 0?this.toAttrString(t,this[t]):""),"")}toAttrString(e,t){let n=e==="className"?"class":this.convertCamelToKebabCase(e);return t===null?`${n} `:`${n}="${t.toString()}" `}convertCamelToKebabCase(e){return e.match(/[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[0-9]+/g).join("-").toLowerCase()}};function $G(e){return new jKi(e).toAttributesString()}function Vte(e,t){let n=[],[o,r,i]=e.standard,[s,a,c]=t.standard,l=o*a-r*s,h=i*a-r*c,d=o*c-i*s;if(!Ve.Utils.EQ_0(l)){let u,_;if(r===0)u=i/o,_=d/l;else if(a===0)u=c/s,_=d/l;else if(o===0)u=h/l,_=i/r;else if(s===0)u=h/l,_=c/a;else u=h/l,_=d/l;n.push(new Ve.Point(u,_))}return n}function qG(e,t){let n=[],o=t.pc.projectionOn(e),r=t.pc.distanceTo(o)[0];if(Ve.Utils.EQ(r,t.r))n.push(o);else if(Ve.Utils.LT(r,t.r)){let i=Math.sqrt(t.r*t.r-r*r),s,a;s=e.norm.rotate90CCW().multiply(i),a=o.translate(s),n.push(a),s=e.norm.rotate90CW().multiply(i),a=o.translate(s),n.push(a)}return n}function Hte(e,t){let n=[];for(let o of t.toSegments()){let r=Pme(o,e);for(let i of r)if(!wso(i,n))n.push(i)}return n}function uwe(e,t){let n=[];if(Hte(e,t.box).length===0)return n;let o=new Ve.Circle(t.pc,t.r),r=qG(e,o);for(let i of r)if(i.on(t))n.push(i);return n}function Pme(e,t){let n=[];if(e.ps.on(t))n.push(e.ps);if(e.pe.on(t)&&!e.isZeroLength())n.push(e.pe);if(n.length>0)return n;if(e.isZeroLength())return n;if(e.ps.leftTo(t)&&e.pe.leftTo(t)||!e.ps.leftTo(t)&&!e.pe.leftTo(t))return n;let o=new Ve.Line(e.ps,e.pe);return Vte(o,t)}function pwe(e,t){let n=[];if(e.isZeroLength()){if(e.ps.on(t))n.push(e.ps);return n}if(t.isZeroLength()){if(t.ps.on(e))n.push(t.ps);return n}let o=new Ve.Line(e.ps,e.pe),r=new Ve.Line(t.ps,t.pe);if(o.incidentTo(r)){if(e.ps.on(t))n.push(e.ps);if(e.pe.on(t))n.push(e.pe);if(t.ps.on(e)&&!t.ps.equalTo(e.ps)&&!t.ps.equalTo(e.pe))n.push(t.ps);if(t.pe.on(e)&&!t.pe.equalTo(e.ps)&&!t.pe.equalTo(e.pe))n.push(t.pe)}else if(o.parallelTo(r)){let i=new Ve.Vector(e.ps,e.pe),s=new Ve.Vector(t.ps,t.pe),a=new Ve.Vector(e.ps,t.ps),c=i.cross(s);if(!Ve.Utils.EQ_0(c)){let l=a.cross(s)/c,h=a.cross(i)/c;if(Ve.Utils.GE(l,0)&&Ve.Utils.LE(l,1)&&Ve.Utils.GE(h,0)&&Ve.Utils.LE(h,1))n.push(xio(e.ps.translate(i.multiply(l)),e,t))}}else{let i=Vte(o,r);if(i.length>0){if(Cio(i[0],e)&&Cio(i[0],t))n.push(xio(i[0],e,t))}}return n}function xio(e,t,n){for(let o of[t.ps,t.pe,n.ps,n.pe])if(e.equalTo(o))return o;return e}function Cio(e,t){let n=t.box;return Ve.Utils.LE(e.x,n.xmax)&&Ve.Utils.GE(e.x,n.xmin)&&Ve.Utils.LE(e.y,n.ymax)&&Ve.Utils.GE(e.y,n.ymin)}function mwe(e,t){let n=[];if(e.isZeroLength()){let[i,s]=e.ps.distanceTo(t.pc);if(Ve.Utils.EQ(i,t.r))n.push(e.ps);return n}let o=new Ve.Line(e.ps,e.pe),r=qG(o,t);for(let i of r)if(i.on(e))n.push(i);return n}function Yte(e,t){let n=[];if(e.isZeroLength()){if(e.ps.on(t))n.push(e.ps);return n}let o=new Ve.Line(e.ps,e.pe),r=new Ve.Circle(t.pc,t.r),i=qG(o,r);for(let s of i)if(s.on(e)&&s.on(t))n.push(s);return n}function KKi(e,t){let n=[];for(let o of t.toSegments()){let r=pwe(o,e);for(let i of r)n.push(i)}return n}function Cso(e,t){let n=[],o=new Ve.Vector(e.pc,t.pc),r=e.r,i=t.r;if(Ve.Utils.EQ_0(r)||Ve.Utils.EQ_0(i))return n;if(Ve.Utils.EQ_0(o.x)&&Ve.Utils.EQ_0(o.y)&&Ve.Utils.EQ(r,i))return n.push(e.pc.translate(-r,0)),n;let s=e.pc.distanceTo(t.pc)[0];if(Ve.Utils.GT(s,r+i))return n;if(Ve.Utils.LT(s,Math.abs(r-i)))return n;o.x/=s,o.y/=s;let a;if(Ve.Utils.EQ(s,r+i)||Ve.Utils.EQ(s,Math.abs(r-i)))return a=e.pc.translate(r*o.x,r*o.y),n.push(a),n;let c=r*r/(2*s)-i*i/(2*s)+s/2,l=e.pc.translate(c*o.x,c*o.y),h=Math.sqrt(r*r-c*c);return a=l.translate(o.rotate90CCW().multiply(h)),n.push(a),a=l.translate(o.rotate90CW().multiply(h)),n.push(a),n}function $Ki(e,t){let n=[];for(let o of t.toSegments()){let r=mwe(o,e);for(let i of r)n.push(i)}return n}function bso(e,t){let n=[];if(e.pc.equalTo(t.pc)&&Ve.Utils.EQ(e.r,t.r)){let s;if(s=e.start,s.on(t))n.push(s);if(s=e.end,s.on(t))n.push(s);if(s=t.start,s.on(e))n.push(s);if(s=t.end,s.on(e))n.push(s);return n}let o=new Ve.Circle(e.pc,e.r),r=new Ve.Circle(t.pc,t.r),i=o.intersect(r);for(let s of i)if(s.on(e)&&s.on(t))n.push(s);return n}function kmt(e,t){let n=[];if(t.pc.equalTo(e.pc)&&Ve.Utils.EQ(t.r,e.r))return n.push(e.start),n.push(e.end),n;let o=t,r=new Ve.Circle(e.pc,e.r),i=Cso(o,r);for(let s of i)if(s.on(e))n.push(s);return n}function qKi(e,t){let n=[];for(let o of t.toSegments()){let r=Yte(o,e);for(let i of r)n.push(i)}return n}function Iso(e,t){return e.isSegment?pwe(e.shape,t):Yte(t,e.shape)}function vso(e,t){return e.isSegment?Yte(e.shape,t):bso(e.shape,t)}function Sso(e,t){return e.isSegment?Pme(e.shape,t):uwe(t,e.shape)}function JKi(e,t){return e.isSegment?Fmt(t,e.shape):zmt(t,e.shape)}function ZKi(e,t){return e.isSegment?mwe(e.shape,t):kmt(e.shape,t)}function Lmt(e,t){let n=[];for(let o of t.edges)for(let r of Iso(o,e))n.push(r);return n}function Hmt(e,t){let n=[];for(let o of t.edges)for(let r of vso(o,e))n.push(r);return n}function Eme(e,t){let n=[];if(t.isEmpty())return n;for(let o of t.edges)for(let r of Sso(o,e))if(!wso(r,n))n.push(r);return e.sortPoints(n)}function Pso(e,t){let n=[];if(t.isEmpty())return n;for(let o of t.edges)for(let r of ZKi(o,e))n.push(r);return n}function Eso(e,t){if(e.isSegment)return Iso(t,e.shape);else if(e.isArc)return vso(t,e.shape);else if(e.isLine)return Sso(t,e.shape);else if(e.isRay)return JKi(t,e.shape);return[]}function Mso(e,t){let n=[];if(t.isEmpty()||e.shape.box.not_intersect(t.box))return n;let o=t.edges.search(e.shape.box);for(let r of o)n=[...n,...Eso(e,r)];return n}function e$i(e,t){let n=[];if(t.isEmpty()||e.size===0)return n;for(let o of e)n=[...n,...Mso(o,t)];return n}function t$i(e,t){let n=[];if(e.isEmpty()||t.isEmpty())return n;if(e.box.not_intersect(t.box))return n;for(let o of e.edges)n=[...n,...Mso(o,t)];return n}function n$i(e,t){if(e instanceof Ve.Line)return Eme(e,t);else if(e instanceof Ve.Segment)return Lmt(e,t);else if(e instanceof Ve.Arc)return Hmt(e,t);else return[]}function wso(e,t){return t.some((n)=>n.equalTo(e))}function zL(e){return new Ve.Line(e.start,e.norm)}function Fmt(e,t){return Pme(t,zL(e)).filter((n)=>e.contains(n))}function zmt(e,t){return uwe(zL(e),t).filter((n)=>e.contains(n))}function Bso(e,t){return qG(zL(e),t).filter((n)=>e.contains(n))}function o$i(e,t){return Hte(zL(e),t).filter((n)=>e.contains(n))}function Tso(e,t){return Vte(zL(e),t).filter((n)=>e.contains(n))}function r$i(e,t){return Vte(zL(e),zL(t)).filter((n)=>e.contains(n)).filter((n)=>t.contains(n))}function Dso(e,t){return Eme(zL(e),t).filter((n)=>e.contains(n))}function Nso(e,t){if(e.intersect&&e.intersect instanceof Function)return e.intersect(t);throw e0.UNSUPPORTED_SHAPE_TYPE}function Gte(e,t){let n=[];for(let o of t)n=[...n,...Nso(e,o.shape)];return n}function i$i(e,t){let n=[];for(let o of e)for(let r of t)n=[...n,...Nso(o.shape,r.shape)];return n}var JG=class e extends Qmt{constructor(...t){super();if(this.isInfinite=!1,t.length===1&&t[0]instanceof Array&&t[0].length>0){let n=t[0],o=n.length,r=(c)=>c instanceof Ve.Segment||c instanceof Ve.Arc||c instanceof Ve.Ray||c instanceof Ve.Line,i=(c)=>c instanceof Ve.Segment||c instanceof Ve.Arc||c instanceof Ve.Ray,s=(c)=>c instanceof Ve.Segment||c instanceof Ve.Arc;if(o===1&&r(n[0])||o>1&&i(n[0])&&i(n[o-1])&&n.slice(1,o-1).every(s)){this.isInfinite=n.some((c)=>c instanceof Ve.Ray||c instanceof Ve.Line);for(let c of n){let l=new Ve.Edge(c);this.append(l)}this.setArcLength()}else throw Ve.Errors.ILLEGAL_PARAMETERS}}get edges(){return[...this]}get box(){return this.edges.reduce((t,n)=>t.merge(n.box),new Ve.Box)}get vertices(){let t=this.edges.map((n)=>n.start);return t.push(this.last.end),t}get length(){if(this.isEmpty())return 0;if(this.isInfinite)return Number.POSITIVE_INFINITY;let t=0;for(let n of this)t+=n.length;return t}clone(){return new e(this.toShapes())}setArcLength(){for(let t of this)this.setOneEdgeArcLength(t)}setOneEdgeArcLength(t){if(t===this.first)t.arc_length=0;else t.arc_length=t.prev.arc_length+t.prev.length}pointAtLength(t){if(t>this.length||t<0)return null;if(this.isInfinite)return null;let n=null;for(let o of this)if(t>=o.arc_length&&(o===this.last||t<o.next.arc_length)){n=o.pointAtLength(t-o.arc_length);break}return n}addVertex(t,n){let o=n.shape.split(t);if(o[0]===null)return n.prev;if(o[1]===null)return n;let r=new Ve.Edge(o[0]),i=n.prev;return this.insert(r,i),n.shape=o[1],r}getChain(t,n){let o=[];for(let r=t;r!==n.next;r=r.next)o.push(r);return o}split(t){for(let n of t){let o=this.findEdgeByPoint(n);this.addVertex(n,o)}return this}findEdgeByPoint(t){let n;for(let o of this)if(o.shape.contains(t)){n=o;break}return n}distanceTo(t){if(t instanceof Ve.Point){let[n,o]=Ve.Distance.shape2multiline(t,this);return[n,o.reverse()]}if(t instanceof Ve.Line){let[n,o]=Ve.Distance.shape2multiline(t,this);return[n,o.reverse()]}if(t instanceof Ve.Circle){let[n,o]=Ve.Distance.shape2multiline(t,this);return[n,o.reverse()]}if(t instanceof Ve.Segment){let[n,o]=Ve.Distance.shape2multiline(t,this);return[n,o.reverse()]}if(t instanceof Ve.Arc){let[n,o]=Ve.Distance.shape2multiline(t,this);return[n,o.reverse()]}if(t instanceof Ve.Box){let[n,o]=Ve.Distance.shape2multiline(new Ve.Polygon(t),this);return[n,o.reverse()]}if(t instanceof Ve.Multiline)return Ve.Distance.multiline2multiline(this,t);throw Ve.Errors.UNSUPPORTED_SHAPE_TYPE}intersect(t){if(t instanceof Ve.Multiline)return i$i(this,t);else return Gte(t,this)}contains(t){if(t instanceof Ve.Point)return this.edges.some((n)=>n.shape.contains(t));throw Ve.Errors.UNSUPPORTED_SHAPE_TYPE}translate(t){return new e(this.edges.map((n)=>n.shape.translate(t)))}rotate(t=0,n=new Ve.Point){return new e(this.edges.map((o)=>o.shape.rotate(t,n)))}transform(t=new Ve.Matrix){return new e(this.edges.map((n)=>n.shape.transform(t)))}toShapes(){return this.edges.map((t)=>t.shape.clone())}toJSON(){return this.edges.map((t)=>t.toJSON())}svgPoints(){return this.vertices.map((t)=>`${t.x},${t.y}`).join(" ")}dpath(){let t=`M${this.first.start.x},${this.first.start.y}`;for(let n of this)t+=n.svg();return t}svg(t={}){let n=`
<path ${$G({fill:"none",...t})} d="`;n+=`
M${this.first.start.x},${this.first.start.y}`;for(let o of this)n+=o.svg();return n+=`" >
</path>`,n}};Ve.Multiline=JG;var s$i=(...e)=>new Ve.Multiline(...e);Ve.multiline=s$i;function Fte(e,t,n){let o=n.length,r=e.shape.split(t);if(r.length===0)return;let i=0;if(r[0]===null)i=0;else if(r[1]===null)i=e.shape.length;else i=r[0].length;let s=Rmt;if(WG(i,0))s|=dme;if(WG(i,e.shape.length))s|=Rte;let a;if(i===1/0)a=r[0].coord(t);else a=s&Rte&&e.next&&e.next.arc_length===0?0:e.arc_length+i;n.push({id:o,pt:t,arc_length:a,edge_before:e,edge_after:void 0,face:e.face,is_vertex:s})}function mme(e){e.int_points1_sorted=RL(e.int_points1),e.int_points2_sorted=RL(e.int_points2)}function RL(e){let t=new Map,n=0;for(let r of e)if(!t.has(r.face))t.set(r.face,n),n++;for(let r of e)r.faceId=t.get(r.face);return e.slice().sort(a$i)}function a$i(e,t){if(e.faceId<t.faceId)return-1;if(e.faceId>t.faceId)return 1;if(e.arc_length<t.arc_length)return-1;if(e.arc_length>t.arc_length)return 1;return 0}function Omt(e){if(e.int_points1.length<2)return;let t=!1,n,o,r,i;for(let s=0;s<e.int_points1_sorted.length;s++){if(e.int_points1_sorted[s].id===-1)continue;n=e.int_points1_sorted[s],o=e.int_points2[n.id];for(let a=s+1;a<e.int_points1_sorted.length;a++){if(r=e.int_points1_sorted[a],!WG(r.arc_length,n.arc_length))break;if(r.id===-1)continue;if(i=e.int_points2[r.id],i.id===-1)continue;if(r.edge_before===n.edge_before&&r.edge_after===n.edge_after&&i.edge_before===o.edge_before&&i.edge_after===o.edge_after)r.id=-1,i.id=-1,t=!0}}o=e.int_points2_sorted[0],n=e.int_points1[o.id];for(let s=1;s<e.int_points2_sorted.length;s++){let a=e.int_points2_sorted[s];if(a.id===-1)continue;if(o.id===-1||!WG(a.arc_length,o.arc_length)){o=a,n=e.int_points1[o.id];continue}let c=e.int_points1[a.id];if(c.edge_before===n.edge_before&&c.edge_after===n.edge_after&&a.edge_before===o.edge_before&&a.edge_after===o.edge_after)c.id=-1,a.id=-1,t=!0}if(t)e.int_points1=e.int_points1.filter((s)=>s.id>=0),e.int_points2=e.int_points2.filter((s)=>s.id>=0),e.int_points1.forEach((s,a)=>s.id=a),e.int_points2.forEach((s,a)=>s.id=a)}function umt(e){for(let t of e){if(t.edge_before)t.edge_before.bvStart=void 0,t.edge_before.bvEnd=void 0,t.edge_before.bv=void 0,t.edge_before.overlap=void 0;if(t.edge_after)t.edge_after.bvStart=void 0,t.edge_after.bvEnd=void 0,t.edge_after.bv=void 0,t.edge_after.overlap=void 0}for(let t of e){if(t.edge_before)t.edge_before.bvEnd=HP;if(t.edge_after)t.edge_after.bvStart=HP}}function pmt(e,t){for(let n of e){if(n.edge_before)n.edge_before.setInclusion(t);if(n.edge_after)n.edge_after.setInclusion(t)}}function c$i(e){let t=void 0,n=void 0,o=void 0,r=e.int_points1.length;for(let i=0;i<r;i++){let s=e.int_points1_sorted[i];if(s.face!==t)n=i,t=s.face;let a=i,c=zte(e.int_points1_sorted,i,t),l;if(a+c<r&&e.int_points1_sorted[a+c].face===t)l=a+c;else l=n;let h=zte(e.int_points1_sorted,l,t);o=null;for(let g=l;g<l+h;g++){let f=e.int_points1_sorted[g];if(f.face===t&&e.int_points2[f.id].face===e.int_points2[s.id].face){o=f;break}}if(o===null)continue;let d=s.edge_after,u=o.edge_before;if(!(d.bv===HP&&u.bv===HP))continue;if(d!==u)continue;let _=e.int_points2[s.id],p=e.int_points2[o.id],m=_.edge_after,A=p.edge_before;if(!(m.bv===HP&&A.bv===HP&&m===A))_=e.int_points2[o.id],p=e.int_points2[s.id],m=_.edge_after,A=p.edge_before;if(!(m.bv===HP&&A.bv===HP&&m===A))continue;d.setOverlap(m)}}function zte(e,t,n){let o,r,i=1;if(e.length===1)return 1;o=e[t];for(let s=t+1;s<e.length;s++){if(o.face!==n)break;if(r=e[s],!(r.pt.equalTo(o.pt)&&r.edge_before===o.edge_before&&r.edge_after===o.edge_after))break;i++}return i}function Ote(e,t){if(!t)return;for(let n of t){let o=n.edge_before;if(n.is_vertex=Rmt,o.shape.start&&o.shape.start.equalTo(n.pt))n.is_vertex|=dme;if(o.shape.end&&o.shape.end.equalTo(n.pt))n.is_vertex|=Rte;if(n.is_vertex&dme){if(n.edge_before=o.prev,o.prev)n.is_vertex=Rte;continue}if(n.is_vertex&Rte)continue;let r=e.addVertex(n.pt,o);n.edge_before=r}for(let n of t)if(n.edge_before)n.edge_after=n.edge_before.next;else if(e instanceof JG&&n.is_vertex&dme)n.edge_after=e.first}function bio(e,t,n){let o=e.edge_before,r=t.edge_after,i=n.length;o.next=n[0],n[0].prev=o,n[i-1].next=r,r.prev=n[i-1]}var{INSIDE:zP,OUTSIDE:OP,BOUNDARY:zA,OVERLAP_SAME:l$i,OVERLAP_OPPOSITE:h$i}=cwe,{NOT_VERTEX:T8a,START_VERTEX:Iio,END_VERTEX:vio}=cwe,_we=1,Mme=2,XG=3;function d$i(e,t){let[n,o]=wme(e,t,_we,!0);return n}function mmt(e,t){let o=t.clone().reverse(),[r,i]=wme(e,o,XG,!0);return r}function Rso(e,t){let[n,o]=wme(e,t,Mme,!0);return n}function Qso(e,t){let[n,o]=wme(e,t,Mme,!1),r=[];for(let s of n.faces)r=[...r,...[...s.edges].map((a)=>a.shape)];let i=[];for(let s of o.faces)i=[...i,...[...s.edges].map((a)=>a.shape)];return[r,i]}function _mt(e,t){let[n,o]=wme(e,t,XG,!1),r=[];for(let i of n.faces)r=[...r,...[...i.edges].map((s)=>s.shape)];return r}function kso(e,t){let n=e.clone(),o=t.clone(),r=Lso(n,o);mme(r),Ote(n,r.int_points1_sorted),Ote(o,r.int_points2_sorted),Omt(r),mme(r);let i=r.int_points1_sorted.map((a)=>a.pt),s=r.int_points2_sorted.map((a)=>a.pt);return[i,s]}function u$i(e,t,n,o){let r=Sio(e,n.int_points1),i=Sio(t,n.int_points2);Pio(r,t),Pio(i,e),umt(n.int_points1),umt(n.int_points2),pmt(n.int_points1,t),pmt(n.int_points2,e);while(m$i(e,t,n.int_points1,n.int_points1_sorted,n.int_points2,n));c$i(n),gmt(e,o,n.int_points1_sorted,!0),gmt(t,o,n.int_points2_sorted,!1),Eio(e,r,o,!0),Eio(t,i,o,!1)}function p$i(e,t,n,o){_$i(e,t,o,n.int_points2),g$i(e,t,n),Amt(e,n.int_points1),Amt(t,n.int_points2),fmt(e,n.int_points1,n.int_points2),fmt(e,n.int_points2,n.int_points1),Mio(e),Mio(t)}function wme(e,t,n,o){let r=e.clone(),i=t.clone(),s=Lso(r,i);if(mme(s),Ote(r,s.int_points1_sorted),Ote(i,s.int_points2_sorted),Omt(s),mme(s),u$i(r,i,s,n),o)p$i(r,i,s,n);return[r,i]}function Lso(e,t){let n={int_points1:[],int_points2:[]};for(let o of e.edges){let r=t.edges.search(o.box);for(let i of r){let s=o.shape.intersect(i.shape);for(let a of s)Fte(o,a,n.int_points1),Fte(i,a,n.int_points2)}}return n}function Sio(e,t){let n=[];for(let o of e.faces)if(!t.find((r)=>r.face===o))n.push(o);return n}function Pio(e,t){for(let n of e)n.first.bv=n.first.bvStart=n.first.bvEnd=void 0,n.first.setInclusion(t)}function m$i(e,t,n,o,r,i){let s,a,c,l=o.length,h=!1;for(let d=0;d<l;d++){let u=o[d];if(u.face!==s)a=d,s=u.face;let _=d,p=zte(o,d,s),m;if(_+p<l&&o[_+p].face===s)m=_+p;else m=a;let A=zte(o,m,s);c=null;for(let y=m;y<m+A;y++){let x=o[y];if(x.face===s&&r[x.id].face===r[u.id].face){c=x;break}}if(c===null)continue;let g=u.edge_after,f=c.edge_before;if(g.bv===zA&&f.bv!=zA){g.bv=f.bv;continue}if(g.bv!=zA&&f.bv===zA){f.bv=g.bv;continue}if(g.bv===zA&&f.bv===zA&&g!=f||(g.bv===zP&&f.bv===OP||g.bv===OP&&f.bv===zP)){let y=g.next;while(y!=f)y.bvStart=void 0,y.bvEnd=void 0,y.bv=void 0,y.setInclusion(t),y=y.next}if(g.bv===zA&&f.bv===zA&&g!=f){let y=g.next,x;while(y!=f){if(y.bv!=zA){if(x===void 0)x=y.bv;else if(y.bv!=x)throw e0.UNRESOLVED_BOUNDARY_CONFLICT}y=y.next}if(x!=null)g.bv=x,f.bv=x;continue}if(g.bv===zP&&f.bv===OP||g.bv===OP&&f.bv===zP){let y=g;while(y!=f){if(y.bvStart===g.bv&&y.bvEnd===f.bv){let[x,C]=y.shape.distanceTo(t);if(x<10*Ve.DP_TOL){Fte(y,C.ps,n);let b=n[n.length-1];if(b.is_vertex&Iio)b.edge_after=y,b.edge_before=y.prev,y.bvStart=zA,y.bv=void 0,y.setInclusion(t);else if(b.is_vertex&vio)b.edge_after=y.next,y.bvEnd=zA,y.bv=void 0,y.setInclusion(t);else{let P=t.addVertex(b.pt,y);b.edge_before=P,b.edge_after=P.next,P.setInclusion(t),P.next.bvStart=zA,P.next.bvEnd=void 0,P.next.bv=void 0,P.next.setInclusion(t)}let I=t.findEdgeByPoint(C.pe);Fte(I,C.pe,r);let v=r[r.length-1];if(v.is_vertex&Iio)v.edge_after=I,v.edge_before=I.prev;else if(v.is_vertex&vio)v.edge_after=I.next;else{let P=r.find((B)=>B.edge_after===I),M=t.addVertex(v.pt,I);if(v.edge_before=M,v.edge_after=M.next,P)P.edge_after=M;M.bvStart=void 0,M.bvEnd=zA,M.bv=void 0,M.setInclusion(e),M.next.bvStart=zA,M.next.bvEnd=void 0,M.next.bv=void 0,M.next.setInclusion(e)}mme(i),h=!0;break}}y=y.next}if(h)break;throw e0.UNRESOLVED_BOUNDARY_CONFLICT}}return h}function gmt(e,t,n,o){if(!n)return;let r=void 0,i=void 0,s,a;for(let c=0;c<n.length;c++){if(s=n[c],s.face!==r)i=c,r=s.face;if(r.isEmpty())continue;let l=c,h=zte(n,c,r),d;if(l+h<n.length&&n[l+h].face===s.face)d=l+h;else d=i;a=n[d];let u=d,_=zte(n,u,r),p=s.edge_after,m=a.edge_before;if(p.bv===zP&&m.bv===zP&&t===_we||p.bv===OP&&m.bv===OP&&t===Mme||(p.bv===OP||m.bv===OP)&&t===XG&&!o||(p.bv===zP||m.bv===zP)&&t===XG&&o||p.bv===zA&&m.bv===zA&&p.overlap&l$i&&o||p.bv===zA&&m.bv===zA&&p.overlap&h$i){e.removeChain(r,p,m);for(let A=l;A<l+h;A++)n[A].edge_after=void 0;for(let A=u;A<u+_;A++)n[A].edge_before=void 0}c+=h-1}}function _$i(e,t,n,o){for(let r of t.faces){for(let i of r)e.edges.add(i);if(o.find((i)=>i.face===r)===void 0)e.addFace(r.first,r.last)}}function g$i(e,t,n){if(n.int_points1.length===0)return;for(let o=0;o<n.int_points1.length;o++){let r=n.int_points1[o],i=n.int_points2[o];if(r.edge_before!==void 0&&r.edge_after===void 0){if(i.edge_before===void 0&&i.edge_after!==void 0)r.edge_before.next=i.edge_after,i.edge_after.prev=r.edge_before,r.edge_after=i.edge_after,i.edge_before=r.edge_before}if(i.edge_before!==void 0&&i.edge_after===void 0){if(r.edge_before===void 0&&r.edge_after!==void 0)i.edge_before.next=r.edge_after,r.edge_after.prev=i.edge_before,i.edge_after=r.edge_after,r.edge_before=i.edge_before}if(r.edge_before!==void 0&&r.edge_after===void 0)for(let s of n.int_points1_sorted){if(s===r)continue;if(s.edge_before===void 0&&s.edge_after!==void 0){if(s.pt.equalTo(r.pt))r.edge_before.next=s.edge_after,s.edge_after.prev=r.edge_before,r.edge_after=s.edge_after,s.edge_before=r.edge_before}}if(i.edge_before!==void 0&&i.edge_after===void 0)for(let s of n.int_points2_sorted){if(s===i)continue;if(s.edge_before===void 0&&s.edge_after!==void 0){if(s.pt.equalTo(i.pt))i.edge_before.next=s.edge_after,s.edge_after.prev=i.edge_before,i.edge_after=s.edge_after,s.edge_before=i.edge_before}}}}function Amt(e,t){for(let n of t){if(e.faces.delete(n.face),n.face=void 0,n.edge_before)n.edge_before.face=void 0;if(n.edge_after)n.edge_after.face=void 0}}function fmt(e,t,n){for(let o of t){if(o.edge_before===void 0||o.edge_after===void 0)continue;if(o.face)continue;if(o.edge_after.face||o.edge_before.face)continue;let{edge_after:r,edge_before:i}=o;try{Qmt.testInfiniteLoop(r)}catch(a){throw e0.CANNOT_COMPLETE_BOOLEAN_OPERATION}let s=e.addFace(r,i);for(let a of t)if(a.edge_before&&a.edge_after&&a.edge_before.face===s&&a.edge_after.face===s)a.face=s;for(let a of n)if(a.edge_before&&a.edge_after&&a.edge_before.face===s&&a.edge_after.face===s)a.face=s}}function Eio(e,t,n,o){for(let r of t){let i=r.first.bv;if(n===_we&&i===zP||n===XG&&i===zP&&o||n===XG&&i===OP&&!o||n===Mme&&i===OP)e.deleteFace(r)}}function Mio(e){let t=[];for(let n of e.edges)if(!n.face||!e.faces.has(n.face))t.push(n);for(let n of t)e.edges.delete(n)}var A$i=Object.freeze({__proto__:null,BOOLEAN_INTERSECT:Mme,BOOLEAN_SUBTRACT:XG,BOOLEAN_UNION:_we,calculateIntersections:kso,innerClip:Qso,intersect:Rso,outerClip:_mt,removeNotRelevantChains:gmt,removeOldFaces:Amt,restoreFaces:fmt,subtract:mmt,unify:d$i}),f$i=RegExp("T.F..FFF.|T.F...F.."),y$i=RegExp("T........|.T.......|...T.....|....T...."),x$i=RegExp("FT.......|F..T.....|F...T...."),C$i=RegExp("T.F..F..."),b$i=RegExp("T.F..F...|.TF..F...|..FT.F...|..F.TF..."),Ute=class{constructor(){this.m=[,,,,,,,,,].fill(void 0)}get I2I(){return this.m[0]}set I2I(e){this.m[0]=e}get I2B(){return this.m[1]}set I2B(e){this.m[1]=e}get I2E(){return this.m[2]}set I2E(e){this.m[2]=e}get B2I(){return this.m[3]}set B2I(e){this.m[3]=e}get B2B(){return this.m[4]}set B2B(e){this.m[4]=e}get B2E(){return this.m[5]}set B2E(e){this.m[5]=e}get E2I(){return this.m[6]}set E2I(e){this.m[6]=e}get E2B(){return this.m[7]}set E2B(e){this.m[7]=e}get E2E(){return this.m[8]}set E2E(e){this.m[8]=e}toString(){return this.m.map((e)=>{if(e instanceof Array&&e.length>0)return"T";else if(e instanceof Array&&e.length===0)return"F";else return"*"}).join("")}equal(){return f$i.test(this.toString())}intersect(){return y$i.test(this.toString())}touch(){return x$i.test(this.toString())}inside(){return C$i.test(this.toString())}covered(){return b$i.test(this.toString())}};function ume(e,t){let n=void 0,o=new Ve.Ray(t),r=new Ve.Line(o.pt,o.norm),i=new Ve.Box(o.box.xmin-Ve.DP_TOL,o.box.ymin-Ve.DP_TOL,o.box.xmax+Ve.DP_TOL,o.box.ymax+Ve.DP_TOL);if(e.box.not_intersect(i))return Ve.OUTSIDE;let s=e.edges.search(i);if(s.length===0)return Ve.OUTSIDE;for(let h of s)if(h.shape.contains(t))return Ve.BOUNDARY;let a=[...e.faces],c=[];for(let h of s)for(let d of o.intersect(h.shape)){if(d.equalTo(t))return Ve.BOUNDARY;c.push({pt:d,edge:h,face_index:a.indexOf(h.face)})}c.sort((h,d)=>{if(xso(h.pt.x,d.pt.x))return-1;if(yso(h.pt.x,d.pt.x))return 1;if(h.face_index<d.face_index)return-1;if(h.face_index>d.face_index)return 1;if(h.edge.arc_length<d.edge.arc_length)return-1;if(h.edge.arc_length>d.edge.arc_length)return 1;return 0});let l=0;for(let h=0;h<c.length;h++){let d=c[h];if(d.pt.equalTo(d.edge.shape.start)){if(h>0&&d.pt.equalTo(c[h-1].pt)&&d.face_index===c[h-1].face_index&&d.edge.prev===c[h-1].edge)continue;let u=d.edge.prev;while(dmt(u.length))u=u.prev;let _=u.shape.tangentInEnd(),p=d.pt.translate(_),m=d.edge.shape.tangentInStart(),A=d.pt.translate(m),g=p.leftTo(r),f=A.leftTo(r);if(g&&!f||!g&&f)l++}else if(d.pt.equalTo(d.edge.shape.end)){if(h>0&&d.pt.equalTo(c[h-1].pt)&&d.face_index===c[h-1].face_index&&d.edge.next===c[h-1].edge)continue;let u=d.edge.next;while(dmt(u.length))u=u.next;let _=u.shape.tangentInStart(),p=d.pt.translate(_),m=d.edge.shape.tangentInEnd(),A=d.pt.translate(m),g=p.leftTo(r),f=A.leftTo(r);if(g&&!f||!g&&f)l++}else if(d.edge.shape instanceof Ve.Segment)l++;else{let u=d.edge.shape.box;if(!(WG(d.pt.y,u.ymin)||WG(d.pt.y,u.ymax)))l++}}return n=l%2===1?awe:gso,n}function I$i(e,t){return Wte(e,t).equal()}function Hso(e,t){return Wte(e,t).intersect()}function v$i(e,t){return Wte(e,t).touch()}function S$i(e,t){return!Hso(e,t)}function Fso(e,t){return Wte(e,t).inside()}function zso(e,t){return Wte(e,t).covered()}function P$i(e,t){return Fso(t,e)}function Oso(e,t){return zso(t,e)}function Wte(e,t){if(e instanceof Ve.Line&&t instanceof Ve.Line)return E$i(e,t);else if(e instanceof Ve.Line&&t instanceof Ve.Circle)return M$i(e,t);else if(e instanceof Ve.Line&&t instanceof Ve.Box)return w$i(e,t);else if(e instanceof Ve.Line&&t instanceof Ve.Polygon)return B$i(e,t);else if((e instanceof Ve.Segment||e instanceof Ve.Arc)&&t instanceof Ve.Polygon)return wio(e,t);else if((e instanceof Ve.Segment||e instanceof Ve.Arc)&&(t instanceof Ve.Circle||t instanceof Ve.Box))return wio(e,new Ve.Polygon(t));else if(e instanceof Ve.Polygon&&t instanceof Ve.Polygon)return JMe(e,t);else if((e instanceof Ve.Circle||e instanceof Ve.Box)&&(t instanceof Ve.Circle||t instanceof Ve.Box))return JMe(new Ve.Polygon(e),new Ve.Polygon(t));else if((e instanceof Ve.Circle||e instanceof Ve.Box)&&t instanceof Ve.Polygon)return JMe(new Ve.Polygon(e),t);else if(e instanceof Ve.Polygon&&(t instanceof Ve.Circle||t instanceof Ve.Box))return JMe(e,new Ve.Polygon(t))}function E$i(e,t){let n=new Ute,o=Vte(e,t);if(o.length===0)if(e.contains(t.pt)&&t.contains(e.pt))n.I2I=[e],n.I2E=[],n.E2I=[];else n.I2I=[],n.I2E=[e],n.E2I=[t];else n.I2I=o,n.I2E=e.split(o),n.E2I=t.split(o);return n}function M$i(e,t){let n=new Ute,o=qG(e,t);if(o.length===0)n.I2I=[],n.I2B=[],n.I2E=[e],n.E2I=[t];else if(o.length===1)n.I2I=[],n.I2B=o,n.I2E=e.split(o),n.E2I=[t];else{let r=new JG([e]),i=e.sortPoints(o);r.split(i);let s=r.toShapes();n.I2I=[s[1]],n.I2B=i,n.I2E=[s[0],s[2]],n.E2I=new Ve.Polygon([t.toArc()]).cutWithLine(e)}return n}function w$i(e,t){let n=new Ute,o=Hte(e,t);if(o.length===0)n.I2I=[],n.I2B=[],n.I2E=[e],n.E2I=[t];else if(o.length===1)n.I2I=[],n.I2B=o,n.I2E=e.split(o),n.E2I=[t];else{let r=new JG([e]),i=e.sortPoints(o);r.split(i);let s=r.toShapes();if(t.toSegments().some((a)=>a.contains(o[0])&&a.contains(o[1])))n.I2I=[],n.I2B=[s[1]],n.I2E=[s[0],s[2]],n.E2I=[t];else n.I2I=[s[1]],n.I2B=i,n.I2E=[s[0],s[2]],n.E2I=new Ve.Polygon(t.toSegments()).cutWithLine(e)}return n}function B$i(e,t){let n=new Ute,o=Eme(e,t),r=new JG([e]),i=o.length>0?o.slice():e.sortPoints(o);return r.split(i),[...r].forEach((s)=>s.setInclusion(t)),n.I2I=[...r].filter((s)=>s.bv===Ve.INSIDE).map((s)=>s.shape),n.I2B=[...r].slice(1).map((s)=>s.bv===Ve.BOUNDARY?s.shape:s.shape.start),n.I2E=[...r].filter((s)=>s.bv===Ve.OUTSIDE).map((s)=>s.shape),n.E2I=t.cutWithLine(e),n}function wio(e,t){let n=new Ute,o=n$i(e,t),r=o.length>0?o.slice():e.sortPoints(o),i=new JG([e]);i.split(r),[...i].forEach((s)=>s.setInclusion(t)),n.I2I=[...i].filter((s)=>s.bv===Ve.INSIDE).map((s)=>s.shape),n.I2B=[...i].slice(1).map((s)=>s.bv===Ve.BOUNDARY?s.shape:s.shape.start),n.I2E=[...i].filter((s)=>s.bv===Ve.OUTSIDE).map((s)=>s.shape),n.B2I=[],n.B2B=[],n.B2E=[];for(let s of[e.start,e.end])switch(ume(t,s)){case Ve.INSIDE:n.B2I.push(s);break;case Ve.BOUNDARY:n.B2B.push(s);break;case Ve.OUTSIDE:n.B2E.push(s);break}return n}function JMe(e,t){let n=new Ute,[o,r]=kso(e,t),i=Rso(e,t),s=mmt(e,t),a=mmt(t,e),[c,l]=Qso(e,t),h=_mt(e,t),d=_mt(t,e);return n.I2I=i.isEmpty()?[]:[i],n.I2B=l,n.I2E=s.isEmpty()?[]:[s],n.B2I=c,n.B2B=o,n.B2E=h,n.E2I=a.isEmpty()?[]:[a],n.E2B=d,n}var T$i=Object.freeze({__proto__:null,contain:P$i,cover:Oso,covered:zso,disjoint:S$i,equal:I$i,inside:Fso,intersect:Hso,relate:Wte,touch:v$i}),pme=class e{constructor(t=1,n=0,o=0,r=1,i=0,s=0){this.a=t,this.b=n,this.c=o,this.d=r,this.tx=i,this.ty=s}fromMatrix3x3(t){let[n,o,r]=t[0],[i,s,a]=t[1];return new e(n,i,o,s,r,a)}toMatrix3x3(){return[[this.a,this.c,this.tx],[this.b,this.d,this.ty],[0,0,1]]}clone(){return new e(this.a,this.b,this.c,this.d,this.tx,this.ty)}transform(t){return[t[0]*this.a+t[1]*this.c+this.tx,t[0]*this.b+t[1]*this.d+this.ty]}multiply(t){return new e(this.a*t.a+this.c*t.b,this.b*t.a+this.d*t.b,this.a*t.c+this.c*t.d,this.b*t.c+this.d*t.d,this.a*t.tx+this.c*t.ty+this.tx,this.b*t.tx+this.d*t.ty+this.ty)}translate(...t){let n,o;if(t.length==1&&!isNaN(t[0].x)&&!isNaN(t[0].y))n=t[0].x,o=t[0].y;else if(t.length===2&&typeof t[0]=="number"&&typeof t[1]=="number")n=t[0],o=t[1];else throw e0.ILLEGAL_PARAMETERS;return this.multiply(new e(1,0,0,1,n,o))}rotate(t,n=0,o=0){let r=Math.cos(t),i=Math.sin(t);return this.translate(n,o).multiply(new e(r,i,-i,r,0,0)).translate(-n,-o)}scale(t,n){return this.multiply(new e(t,0,0,n,0,0))}equalTo(t){if(!Ve.Utils.EQ(this.tx,t.tx))return!1;if(!Ve.Utils.EQ(this.ty,t.ty))return!1;if(!Ve.Utils.EQ(this.a,t.a))return!1;if(!Ve.Utils.EQ(this.b,t.b))return!1;if(!Ve.Utils.EQ(this.c,t.c))return!1;if(!Ve.Utils.EQ(this.d,t.d))return!1;return!0}};Ve.Matrix=pme;var D$i=(...e)=>new Ve.Matrix(...e);Ve.matrix=D$i;var N$i=class{constructor(e,t){this.low=e,this.high=t}get max(){return this.clone()}less_than(e){return this.low<e.low||this.low===e.low&&this.high<e.high}equal_to(e){return this.low===e.low&&this.high===e.high}intersect(e){return!this.not_intersect(e)}not_intersect(e){return this.high<e.low||e.high<this.low}merge(e){let t=this.low===void 0?e.low:this.low<e.low?this.low:e.low,n=this.high===void 0?e.high:this.high>e.high?this.high:e.high,o=this.clone();return o.low=t,o.high=n,o}output(){return[this.low,this.high]}comparable_less_than(e,t){return e<t}},R$i=class e extends N$i{clone(){return new e(this.low,this.high)}},Uf=1,Vh=0,BL=class{constructor(e,t,n=null,o=null,r=null,i=Vh){if(this.left=n,this.right=o,this.parent=r,this.color=i,this.item={key:void 0,values:[]},t!==void 0)this.item.values.push(t);if(e!==void 0)if(Array.isArray(e)){let[s,a]=e;if(!Number.isNaN(s)&&!Number.isNaN(a)){let c=s,l=a;if(c>l)[c,l]=[l,c];this.item.key=new R$i(c,l)}}else this.item.key=e;this.max=this.item.key?this.item.key.max:void 0}isNil(){return this.item.key===void 0&&this.item.values.length===0&&this.left===null&&this.right===null&&this.color===Vh}requireKey(){if(!this.item.key)throw Error("Node key is undefined (nil/sentinel). Operation is not applicable.");return this.item.key}less_than(e){let t=this.requireKey(),n=e.requireKey();return t.less_than(n)}_value_equal(e){let t=this.item.values[0],n=e.item.values[0];return t&&n&&t.equal_to?t.equal_to(n):t===n}equal_to(e){let t=this.requireKey(),n=e.requireKey();return t.equal_to(n)}intersect(e){let t=this.requireKey(),n=e.requireKey();return t.intersect(n)}copy_data(e){this.item.key=e.item.key,this.item.values=e.item.values.slice()}update_max(){if(this.max=this.item.key?this.item.key.max:void 0,this.right&&this.right.max)this.max=this.max?this.max.merge(this.right.max):this.right.max;if(this.left&&this.left.max)this.max=this.max?this.max.merge(this.left.max):this.left.max}not_intersect_left_subtree(e){if(!this.left)return!0;let t=this.left.max?this.left.max.high:this.left.item.key.high,n=this.requireKey(),o=e.requireKey();return n.comparable_less_than(t,o.low)}not_intersect_right_subtree(e){if(!this.right)return!0;let t=this.right.max?this.right.max.low:this.right.item.key.low,n=this.requireKey(),o=e.requireKey();return n.comparable_less_than(o.high,t)}},ymt=class e{constructor(){this.root=null,this.nil_node=new BL}get size(){let t=0;return this.tree_walk(this.root,(n)=>t+=n.item.values.length),t}get keys(){let t=[];return this.tree_walk(this.root,(n)=>t.push(n.item.key.output())),t}get values(){let t=[];return this.tree_walk(this.root,(n)=>{for(let o of n.item.values)t.push(o)}),t}get items(){let t=[];return this.tree_walk(this.root,(n)=>{let o=n.item.key.output();for(let r of n.item.values)t.push({key:o,value:r})}),t}isEmpty(){return this.root==null||this.root===this.nil_node}clear(){this.root=null}insert(t,n=t){if(t===void 0)return;let o=this.tree_search(this.root,new BL(t));if(o)return o.item.values.push(n),o;let r=new BL(t,n,this.nil_node,this.nil_node,null,Uf);return this.tree_insert(r),this.recalc_max(r),r}exist(t,n=t){let o=this.tree_search(this.root,new BL(t));if(!o)return!1;if(arguments.length<2||n===t)return!0;return o.item.values.some((r)=>r&&r.equal_to?r.equal_to(n):r===n)}remove(t,n=t){let o=this.tree_search(this.root,new BL(t));if(!o)return;if(arguments.length<2)return this.tree_delete(o),o;let r=o.item.values.findIndex((i)=>i&&i.equal_to?i.equal_to(n):i===n);if(r>=0){if(o.item.values.splice(r,1),o.item.values.length===0)this.tree_delete(o);return o}return}search(t,n=(o,r)=>o===r?r.output():o){let o=new BL(t),r=[];this.tree_search_interval(this.root,o,r);let i=[];for(let s of r)for(let a of s.item.values)i.push(n(a,s.item.key));return i}intersect_any(t){let n=new BL(t);return this.tree_find_any_interval(this.root,n)}forEach(t){this.tree_walk(this.root,(n)=>{for(let o of n.item.values)t(n.item.key,o)})}map(t){let n=new e;return this.tree_walk(this.root,(o)=>{for(let r of o.item.values)n.insert(o.item.key,t(r,o.item.key))}),n}*iterate(t,n=(o,r)=>o===r?r.output():o){let o=null;if(t)o=this.tree_search_nearest_forward(this.root,new BL(t));else if(this.root)o=this.local_minimum(this.root);while(o){for(let r of o.item.values)yield n(r,o.item.key);o=this.tree_successor(o)}}recalc_max(t){let n=t;while(n.parent!=null)n.parent.update_max(),n=n.parent}tree_insert(t){let n=this.root,o=null;if(this.root==null||this.root===this.nil_node)this.root=t;else{while(n!==this.nil_node)if(o=n,t.less_than(n))n=n.left;else n=n.right;if(t.parent=o,t.less_than(o))o.left=t;else o.right=t}this.insert_fixup(t)}insert_fixup(t){let n,o;n=t;while(n!==this.root&&n.parent.color===Uf)if(n.parent===n.parent.parent.left)if(o=n.parent.parent.right,o.color===Uf)n.parent.color=Vh,o.color=Vh,n.parent.parent.color=Uf,n=n.parent.parent;else{if(n===n.parent.right)n=n.parent,this.rotate_left(n);n.parent.color=Vh,n.parent.parent.color=Uf,this.rotate_right(n.parent.parent)}else if(o=n.parent.parent.left,o.color===Uf)n.parent.color=Vh,o.color=Vh,n.parent.parent.color=Uf,n=n.parent.parent;else{if(n===n.parent.left)n=n.parent,this.rotate_right(n);n.parent.color=Vh,n.parent.parent.color=Uf,this.rotate_left(n.parent.parent)}this.root.color=Vh}tree_delete(t){let n,o;if(t.left===this.nil_node||t.right===this.nil_node)n=t;else n=this.tree_successor(t);if(n.left!==this.nil_node)o=n.left;else o=n.right;if(o.parent=n.parent,n===this.root)this.root=o;else{if(n===n.parent.left)n.parent.left=o;else n.parent.right=o;n.parent.update_max()}if(this.recalc_max(o),n!==t)t.copy_data(n),t.update_max(),this.recalc_max(t);if(n.color===Vh)this.delete_fixup(o)}delete_fixup(t){let n=t,o;while(n!==this.root&&n.parent!=null&&n.color===Vh)if(n===n.parent.left){if(o=n.parent.right,o.color===Uf)o.color=Vh,n.parent.color=Uf,this.rotate_left(n.parent),o=n.parent.right;if(o.left.color===Vh&&o.right.color===Vh)o.color=Uf,n=n.parent;else{if(o.right.color===Vh)o.color=Uf,o.left.color=Vh,this.rotate_right(o),o=n.parent.right;o.color=n.parent.color,n.parent.color=Vh,o.right.color=Vh,this.rotate_left(n.parent),n=this.root}}else{if(o=n.parent.left,o.color===Uf)o.color=Vh,n.parent.color=Uf,this.rotate_right(n.parent),o=n.parent.left;if(o.left.color===Vh&&o.right.color===Vh)o.color=Uf,n=n.parent;else{if(o.left.color===Vh)o.color=Uf,o.right.color=Vh,this.rotate_left(o),o=n.parent.left;o.color=n.parent.color,n.parent.color=Vh,o.left.color=Vh,this.rotate_right(n.parent),n=this.root}}n.color=Vh}tree_search(t,n){if(t==null||t===this.nil_node)return;if(n.equal_to(t))return t;if(n.less_than(t))return this.tree_search(t.left,n);else return this.tree_search(t.right,n)}tree_search_nearest_forward(t,n){let o=null,r=t;while(r&&r!==this.nil_node)if(r.less_than(n))if(r.intersect(n))o=r,r=r.left;else r=r.right;else{if(!o||r.less_than(o))o=r;r=r.left}return o||null}tree_search_interval(t,n,o){if(t!=null&&t!==this.nil_node){if(t.left!==this.nil_node&&!t.not_intersect_left_subtree(n))this.tree_search_interval(t.left,n,o);if(t.intersect(n))o.push(t);if(t.right!==this.nil_node&&!t.not_intersect_right_subtree(n))this.tree_search_interval(t.right,n,o)}}tree_find_any_interval(t,n){let o=!1;if(t!=null&&t!==this.nil_node){if(t.left!==this.nil_node&&!t.not_intersect_left_subtree(n))o=this.tree_find_any_interval(t.left,n);if(!o)o=t.intersect(n);if(!o&&t.right!==this.nil_node&&!t.not_intersect_right_subtree(n))o=this.tree_find_any_interval(t.right,n)}return o}local_minimum(t){let n=t;while(n.left!=null&&n.left!==this.nil_node)n=n.left;return n}local_maximum(t){let n=t;while(n.right!=null&&n.right!==this.nil_node)n=n.right;return n}tree_successor(t){let n,o,r;if(t.right!==this.nil_node)n=this.local_minimum(t.right);else{o=t,r=t.parent;while(r!=null&&r.right===o)o=r,r=r.parent;n=r}return n}rotate_left(t){let n=t.right;if(t.right=n.left,n.left!==this.nil_node)n.left.parent=t;if(n.parent=t.parent,t===this.root)this.root=n;else if(t===t.parent.left)t.parent.left=n;else t.parent.right=n;if(n.left=t,t.parent=n,t!==null&&t!==this.nil_node)t.update_max();if(n!=null&&n!==this.nil_node)n.update_max()}rotate_right(t){let n=t.left;if(t.left=n.right,n.right!==this.nil_node)n.right.parent=t;if(n.parent=t.parent,t===this.root)this.root=n;else if(t===t.parent.left)t.parent.left=n;else t.parent.right=n;if(n.right=t,t.parent=n,t!==null&&t!==this.nil_node)t.update_max();if(n!=null&&n!==this.nil_node)n.update_max()}tree_walk(t,n){if(t!=null&&t!==this.nil_node)this.tree_walk(t.left,n),n(t),this.tree_walk(t.right,n)}testRedBlackProperty(){let t=!0;return this.tree_walk(this.root,function(n){if(n.color===Uf){if(!(n.left.color===Vh&&n.right.color===Vh))t=!1}}),t}testBlackHeightProperty(t){let n=0,o=0,r=0;if(t.color===Vh)n++;if(t.left!==this.nil_node)o=this.testBlackHeightProperty(t.left);else o=1;if(t.right!==this.nil_node)r=this.testBlackHeightProperty(t.right);else r=1;if(o!==r)throw Error("Red-black height property violated");return n+=o,n}},Q$i=class extends Set{constructor(e){super(e);this.index=new ymt,this.forEach((t)=>this.index.insert(t))}add(e){let t=this.size,{key:n,value:o}=e,r=n||e.box,i=o||e;if(super.add(i),this.size>t)this.index.insert(r,i);return this}delete(e){let{key:t,value:n}=e,o=t||e.box,r=n||e,i=super.delete(r);if(i)this.index.remove(o,r);return i}clear(){super.clear(),this.index=new ymt}search(e){return this.index.search(e)}hit(e){let t=new Ve.Box(e.x-1,e.y-1,e.x+1,e.y+1);return this.index.search(t).filter((o)=>e.on(o))}svg(){return[...this].reduce((t,n)=>t+n.svg(),"")}};Ve.PlanarSet=Q$i;var OL=class{get name(){throw e0.CANNOT_INVOKE_ABSTRACT_METHOD}get box(){throw e0.CANNOT_INVOKE_ABSTRACT_METHOD}clone(){throw e0.CANNOT_INVOKE_ABSTRACT_METHOD}translate(...e){return this.transform(new pme().translate(...e))}rotate(e,t=new Ve.Point){return this.transform(new pme().rotate(e,t.x,t.y))}scale(e,t){return this.transform(new pme().scale(e,t))}transform(...e){throw e0.CANNOT_INVOKE_ABSTRACT_METHOD}toJSON(){return Object.assign({},this,{name:this.name})}svg(e={}){throw e0.CANNOT_INVOKE_ABSTRACT_METHOD}},k$i=class e extends OL{constructor(...t){super();if(this.x=0,this.y=0,t.length===0)return;if(t.length===1&&t[0]instanceof Array&&t[0].length===2){let n=t[0];if(typeof n[0]=="number"&&typeof n[1]=="number"){this.x=n[0],this.y=n[1];return}}if(t.length===1&&t[0]instanceof Object&&t[0].name==="point"){let{x:n,y:o}=t[0];this.x=n,this.y=o;return}if(t.length===2){if(typeof t[0]=="number"&&typeof t[1]=="number"){this.x=t[0],this.y=t[1];return}}throw e0.ILLEGAL_PARAMETERS}get box(){return new Ve.Box(this.x,this.y,this.x,this.y)}clone(){return new Ve.Point(this.x,this.y)}get vertices(){return[this.clone()]}equalTo(t){return Ve.Utils.EQ(this.x,t.x)&&Ve.Utils.EQ(this.y,t.y)}lessThan(t){if(Ve.Utils.LT(this.y,t.y))return!0;if(Ve.Utils.EQ(this.y,t.y)&&Ve.Utils.LT(this.x,t.x))return!0;return!1}transform(t){return new Ve.Point(t.transform([this.x,this.y]))}projectionOn(t){if(this.equalTo(t.pt))return this.clone();let n=new Ve.Vector(this,t.pt);if(Ve.Utils.EQ_0(n.cross(t.norm)))return t.pt.clone();let o=n.dot(t.norm),r=t.norm.multiply(o);return this.translate(r)}leftTo(t){let n=new Ve.Vector(t.pt,this);return Ve.Utils.GT(n.dot(t.norm),0)}distanceTo(t){if(t instanceof e){let n=t.x-this.x,o=t.y-this.y;return[Math.sqrt(n*n+o*o),new Ve.Segment(this,t)]}if(t instanceof Ve.Line)return Ve.Distance.point2line(this,t);if(t instanceof Ve.Circle)return Ve.Distance.point2circle(this,t);if(t instanceof Ve.Segment)return Ve.Distance.point2segment(this,t);if(t instanceof Ve.Arc)return Ve.Distance.point2arc(this,t);if(t instanceof Ve.Box)return Ve.Distance.point2polygon(this,new Ve.Polygon(t));if(t instanceof Ve.Polygon)return Ve.Distance.point2polygon(this,t);if(t instanceof Ve.PlanarSet)return Ve.Distance.shape2planarSet(this,t);if(t instanceof Ve.Multiline)return Ve.Distance.shape2multiline(this,t)}on(t){if(t instanceof Ve.Point)return this.equalTo(t);if(t.contains&&t.contains instanceof Function)return t.contains(this);throw Ve.Errors.UNSUPPORTED_SHAPE_TYPE}get name(){return"point"}svg(t={}){let n=t.r??3;return`
<circle cx="${this.x}" cy="${this.y}" r="${n}"
            ${$G({fill:"red",...t})} />`}};Ve.Point=k$i;var L$i=(...e)=>new Ve.Point(...e);Ve.point=L$i;var H$i=class extends OL{constructor(...t){super();if(this.x=0,this.y=0,t.length===0)return;if(t.length===1&&t[0]instanceof Array&&t[0].length===2){let n=t[0];if(typeof n[0]=="number"&&typeof n[1]=="number"){this.x=n[0],this.y=n[1];return}}if(t.length===1&&t[0]instanceof Object&&t[0].name==="vector"){let{x:n,y:o}=t[0];this.x=n,this.y=o;return}if(t.length===1&&t[0]instanceof Object&&t[0].name==="segment"){let{start:n,end:o}=t[0];this.x=o.x-n.x,this.y=o.y-n.y;return}if(t.length===2){let n=t[0],o=t[1];if(typeof n=="number"&&typeof o=="number"){this.x=n,this.y=o;return}if(n instanceof Ve.Point&&o instanceof Ve.Point){this.x=o.x-n.x,this.y=o.y-n.y;return}}throw e0.ILLEGAL_PARAMETERS}clone(){return new Ve.Vector(this.x,this.y)}get slope(){let t=Math.atan2(this.y,this.x);if(t<0)t=2*Math.PI+t;return t}get length(){return Math.sqrt(this.dot(this))}isZeroLength(){return Ve.Utils.EQ_0(this.length)}equalTo(t){return Ve.Utils.EQ(this.x,t.x)&&Ve.Utils.EQ(this.y,t.y)}multiply(t){return new Ve.Vector(t*this.x,t*this.y)}dot(t){return this.x*t.x+this.y*t.y}cross(t){return this.x*t.y-this.y*t.x}normalize(){if(this.isZeroLength())throw e0.ZERO_DIVISION;return new Ve.Vector(this.x/this.length,this.y/this.length)}rotate(t,n=new Ve.Point){if(n.x===0&&n.y===0)return this.transform(new pme().rotate(t));throw e0.OPERATION_IS_NOT_SUPPORTED}transform(t){return new Ve.Vector(t.transform([this.x,this.y]))}rotate90CCW(){return new Ve.Vector(-this.y,this.x)}rotate90CW(){return new Ve.Vector(this.y,-this.x)}invert(){return new Ve.Vector(-this.x,-this.y)}add(t){return new Ve.Vector(this.x+t.x,this.y+t.y)}subtract(t){return new Ve.Vector(this.x-t.x,this.y-t.y)}angleTo(t){let n=this.normalize(),o=t.normalize(),r=Math.atan2(n.cross(o),n.dot(o));if(r<0)r+=2*Math.PI;return r}projectionOn(t){let n=t.normalize(),o=this.dot(n);return n.multiply(o)}get name(){return"vector"}};Ve.Vector=H$i;var Vso=(...e)=>new Ve.Vector(...e);Ve.vector=Vso;var F$i=class e extends OL{constructor(...t){super();if(this.ps=new Ve.Point,this.pe=new Ve.Point,t.length===0)return;if(t.length===1&&t[0]instanceof Array&&t[0].length===4){let n=t[0];this.ps=new Ve.Point(n[0],n[1]),this.pe=new Ve.Point(n[2],n[3]);return}if(t.length===1&&t[0]instanceof Object&&t[0].name==="segment"){let{ps:n,pe:o}=t[0];this.ps=new Ve.Point(n.x,n.y),this.pe=new Ve.Point(o.x,o.y);return}if(t.length===1&&t[0]instanceof Ve.Point){this.ps=t[0].clone();return}if(t.length===2&&t[0]instanceof Ve.Point&&t[1]instanceof Ve.Point){this.ps=t[0].clone(),this.pe=t[1].clone();return}if(t.length===4){this.ps=new Ve.Point(t[0],t[1]),this.pe=new Ve.Point(t[2],t[3]);return}throw e0.ILLEGAL_PARAMETERS}clone(){return new Ve.Segment(this.start,this.end)}get start(){return this.ps}get end(){return this.pe}get vertices(){return[this.ps.clone(),this.pe.clone()]}get length(){return this.start.distanceTo(this.end)[0]}get slope(){return new Ve.Vector(this.start,this.end).slope}get box(){return new Ve.Box(Math.min(this.start.x,this.end.x),Math.min(this.start.y,this.end.y),Math.max(this.start.x,this.end.x),Math.max(this.start.y,this.end.y))}equalTo(t){return this.ps.equalTo(t.ps)&&this.pe.equalTo(t.pe)}contains(t){return Ve.Utils.EQ_0(this.distanceToPoint(t))}intersect(t){if(t instanceof Ve.Point)return this.contains(t)?[t]:[];if(t instanceof Ve.Line)return Pme(this,t);if(t instanceof Ve.Ray)return Fmt(t,this);if(t instanceof Ve.Segment)return pwe(this,t);if(t instanceof Ve.Circle)return mwe(this,t);if(t instanceof Ve.Box)return KKi(this,t);if(t instanceof Ve.Arc)return Yte(this,t);if(t instanceof Ve.Polygon)return Lmt(this,t);if(t instanceof Ve.Multiline)return Gte(this,t)}distanceTo(t){if(t instanceof Ve.Point){let[n,o]=Ve.Distance.point2segment(t,this);return o=o.reverse(),[n,o]}if(t instanceof Ve.Circle){let[n,o]=Ve.Distance.segment2circle(this,t);return[n,o]}if(t instanceof Ve.Line){let[n,o]=Ve.Distance.segment2line(this,t);return[n,o]}if(t instanceof Ve.Segment){let[n,o]=Ve.Distance.segment2segment(this,t);return[n,o]}if(t instanceof Ve.Arc){let[n,o]=Ve.Distance.segment2arc(this,t);return[n,o]}if(t instanceof Ve.Box){let[n,o]=Ve.Distance.shape2polygon(this,new Ve.Polygon(t));return[n,o]}if(t instanceof Ve.Polygon){let[n,o]=Ve.Distance.shape2polygon(this,t);return[n,o]}if(t instanceof Ve.PlanarSet){let[n,o]=Ve.Distance.shape2planarSet(this,t);return[n,o]}if(t instanceof Ve.Multiline)return Ve.Distance.shape2multiline(this,t)}tangentInStart(){return new Ve.Vector(this.start,this.end).normalize()}tangentInEnd(){return new Ve.Vector(this.end,this.start).normalize()}reverse(){return new e(this.end,this.start)}split(t){if(this.start.equalTo(t))return[null,this.clone()];if(this.end.equalTo(t))return[this.clone(),null];return[new Ve.Segment(this.start,t),new Ve.Segment(t,this.end)]}middle(){return new Ve.Point((this.start.x+this.end.x)/2,(this.start.y+this.end.y)/2)}pointAtLength(t){if(t>this.length||t<0)return null;if(t==0)return this.start;if(t==this.length)return this.end;let n=t/this.length;return new Ve.Point((this.end.x-this.start.x)*n+this.start.x,(this.end.y-this.start.y)*n+this.start.y)}distanceToPoint(t){let[n,...o]=Ve.Distance.point2segment(t,this);return n}definiteIntegral(t=0){let n=this.end.x-this.start.x,o=this.start.y-t,r=this.end.y-t;return n*(o+r)/2}transform(t=new Ve.Matrix){return new e(this.ps.transform(t),this.pe.transform(t))}isZeroLength(){return this.ps.equalTo(this.pe)}sortPoints(t){return new Ve.Line(this.start,this.end).sortPoints(t)}get name(){return"segment"}svg(t={}){return`
<line x1="${this.start.x}" y1="${this.start.y}" x2="${this.end.x}" y2="${this.end.y}" ${$G(t)} />`}};Ve.Segment=F$i;var z$i=(...e)=>new Ve.Segment(...e);Ve.segment=z$i;var{vector:sme}=Ve,O$i=class e extends OL{constructor(...t){super();if(this.pt=new Ve.Point,this.norm=new Ve.Vector(0,1),t.length===0)return;if(t.length===1&&t[0]instanceof Object&&t[0].name==="line"){let{pt:n,norm:o}=t[0];this.pt=new Ve.Point(n),this.norm=new Ve.Vector(o);return}if(t.length===2){let n=t[0],o=t[1];if(n instanceof Ve.Point&&o instanceof Ve.Point){if(this.pt=n,this.norm=e.points2norm(n,o),this.norm.dot(sme(this.pt.x,this.pt.y))>=0)this.norm.invert();return}if(n instanceof Ve.Point&&o instanceof Ve.Vector){if(Ve.Utils.EQ_0(o.x)&&Ve.Utils.EQ_0(o.y))throw e0.ILLEGAL_PARAMETERS;if(this.pt=n.clone(),this.norm=o.clone(),this.norm=this.norm.normalize(),this.norm.dot(sme(this.pt.x,this.pt.y))>=0)this.norm.invert();return}if(n instanceof Ve.Vector&&o instanceof Ve.Point){if(Ve.Utils.EQ_0(n.x)&&Ve.Utils.EQ_0(n.y))throw e0.ILLEGAL_PARAMETERS;if(this.pt=o.clone(),this.norm=n.clone(),this.norm=this.norm.normalize(),this.norm.dot(sme(this.pt.x,this.pt.y))>=0)this.norm.invert();return}}throw e0.ILLEGAL_PARAMETERS}clone(){return new Ve.Line(this.pt,this.norm)}get start(){return}get end(){return}get length(){return Number.POSITIVE_INFINITY}get box(){return new Ve.Box(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY)}get middle(){return}get slope(){return new Ve.Vector(this.norm.y,-this.norm.x).slope}get standard(){let t=this.norm.x,n=this.norm.y,o=this.norm.dot(sme(this.pt.x,this.pt.y));return[t,n,o]}parallelTo(t){return Ve.Utils.EQ_0(this.norm.cross(t.norm))}incidentTo(t){return this.parallelTo(t)&&this.pt.on(t)}contains(t){if(this.pt.equalTo(t))return!0;let n=new Ve.Vector(this.pt,t);return Ve.Utils.EQ_0(this.norm.dot(n))}coord(t){return sme(t.x,t.y).cross(this.norm)}intersect(t){if(t instanceof Ve.Point)return this.contains(t)?[t]:[];if(t instanceof Ve.Line)return Vte(this,t);if(t instanceof Ve.Ray)return Tso(t,this);if(t instanceof Ve.Circle)return qG(this,t);if(t instanceof Ve.Box)return Hte(this,t);if(t instanceof Ve.Segment)return Pme(t,this);if(t instanceof Ve.Arc)return uwe(this,t);if(t instanceof Ve.Polygon)return Eme(this,t);if(t instanceof Ve.Multiline)return Gte(this,t)}distanceTo(t){if(t instanceof Ve.Point){let[n,o]=Ve.Distance.point2line(t,this);return o=o.reverse(),[n,o]}if(t instanceof Ve.Circle){let[n,o]=Ve.Distance.circle2line(t,this);return o=o.reverse(),[n,o]}if(t instanceof Ve.Segment){let[n,o]=Ve.Distance.segment2line(t,this);return[n,o.reverse()]}if(t instanceof Ve.Arc){let[n,o]=Ve.Distance.arc2line(t,this);return[n,o.reverse()]}if(t instanceof Ve.Box){let[n,o]=Ve.Distance.shape2polygon(this,new Ve.Polygon(t));return[n,o]}if(t instanceof Ve.Polygon){let[n,o]=Ve.Distance.shape2polygon(this,t);return[n,o]}}split(t){if(t instanceof Ve.Point)return[new Ve.Ray(t,this.norm),new Ve.Ray(t,this.norm)];else{let n=new Ve.Multiline([this]),o=this.sortPoints(t);return n.split(o),n.toShapes()}}rotate(t,n=new Ve.Point){return new Ve.Line(this.pt.rotate(t,n),this.norm.rotate(t))}transform(t){return new Ve.Line(this.pt.transform(t),this.norm.clone())}sortPoints(t){return t.slice().sort((n,o)=>{if(this.coord(n)<this.coord(o))return-1;if(this.coord(n)>this.coord(o))return 1;return 0})}get name(){return"line"}svg(t,n={}){let o=Hte(this,t);if(o.length===0)return"";let r=o[0],i=o.length===2?o[1]:o.find((a)=>!a.equalTo(r));if(i===void 0)i=r;return new Ve.Segment(r,i).svg(n)}static points2norm(t,n){if(t.equalTo(n))throw e0.ILLEGAL_PARAMETERS;return new Ve.Vector(t,n).normalize().rotate90CCW()}};Ve.Line=O$i;var V$i=(...e)=>new Ve.Line(...e);Ve.line=V$i;var Y$i=class extends OL{constructor(...t){super();if(this.pc=new Ve.Point,this.r=1,t.length===1&&t[0]instanceof Object&&t[0].name==="circle"){let{pc:n,r:o}=t[0];this.pc=new Ve.Point(n),this.r=o}else{let[n,o]=[...t];if(n&&n instanceof Ve.Point)this.pc=n.clone();if(o!==void 0)this.r=o}}clone(){return new Ve.Circle(this.pc.clone(),this.r)}get center(){return this.pc}get box(){return new Ve.Box(this.pc.x-this.r,this.pc.y-this.r,this.pc.x+this.r,this.pc.y+this.r)}contains(t){if(t instanceof Ve.Point)return Ve.Utils.LE(t.distanceTo(this.center)[0],this.r);if(t instanceof Ve.Segment)return Ve.Utils.LE(t.start.distanceTo(this.center)[0],this.r)&&Ve.Utils.LE(t.end.distanceTo(this.center)[0],this.r);if(t instanceof Ve.Arc)return this.intersect(t).length===0&&Ve.Utils.LE(t.start.distanceTo(this.center)[0],this.r)&&Ve.Utils.LE(t.end.distanceTo(this.center)[0],this.r);if(t instanceof Ve.Circle)return this.intersect(t).length===0&&Ve.Utils.LE(t.r,this.r)&&Ve.Utils.LE(t.center.distanceTo(this.center)[0],this.r)}toArc(t=!0){return new Ve.Arc(this.center,this.r,Math.PI,-Math.PI,t)}scale(t,n){if(t!==n)throw e0.OPERATION_IS_NOT_SUPPORTED;if(!(this.pc.x===0&&this.pc.y===0))throw e0.OPERATION_IS_NOT_SUPPORTED;return new Ve.Circle(this.pc,this.r*t)}transform(t=new Ve.Matrix){return new Ve.Circle(this.pc.transform(t),this.r)}intersect(t){if(t instanceof Ve.Point)return this.contains(t)?[t]:[];if(t instanceof Ve.Line)return qG(t,this);if(t instanceof Ve.Ray)return Bso(t,this);if(t instanceof Ve.Segment)return mwe(t,this);if(t instanceof Ve.Circle)return Cso(t,this);if(t instanceof Ve.Box)return $Ki(this,t);if(t instanceof Ve.Arc)return kmt(t,this);if(t instanceof Ve.Polygon)return Pso(this,t);if(t instanceof Ve.Multiline)return Gte(this,t)}distanceTo(t){if(t instanceof Ve.Point){let[n,o]=Ve.Distance.point2circle(t,this);return o=o.reverse(),[n,o]}if(t instanceof Ve.Circle){let[n,o]=Ve.Distance.circle2circle(this,t);return[n,o]}if(t instanceof Ve.Line){let[n,o]=Ve.Distance.circle2line(this,t);return[n,o]}if(t instanceof Ve.Segment){let[n,o]=Ve.Distance.segment2circle(t,this);return o=o.reverse(),[n,o]}if(t instanceof Ve.Arc){let[n,o]=Ve.Distance.arc2circle(t,this);return o=o.reverse(),[n,o]}if(t instanceof Ve.Box){let[n,o]=Ve.Distance.shape2polygon(this,new Ve.Polygon(t));return[n,o]}if(t instanceof Ve.Polygon){let[n,o]=Ve.Distance.shape2polygon(this,t);return[n,o]}if(t instanceof Ve.PlanarSet){let[n,o]=Ve.Distance.shape2planarSet(this,t);return[n,o]}if(t instanceof Ve.Multiline){let[n,o]=Ve.Distance.shape2multiline(this,t);return[n,o]}}get name(){return"circle"}svg(t={}){return`
<circle cx="${this.pc.x}" cy="${this.pc.y}" r="${this.r}"
                ${$G({fill:"none",...t})} />`}};Ve.Circle=Y$i;var G$i=(...e)=>new Ve.Circle(...e);Ve.circle=G$i;var U$i=class extends OL{constructor(...e){super();if(this.pc=new Ve.Point,this.r=1,this.startAngle=0,this.endAngle=2*Math.PI,this.counterClockwise=!0,e.length===0)return;if(e.length===1&&e[0]instanceof Object&&e[0].name==="arc"){let{pc:t,r:n,startAngle:o,endAngle:r,counterClockwise:i}=e[0];this.pc=new Ve.Point(t.x,t.y),this.r=n,this.startAngle=o,this.endAngle=r,this.counterClockwise=i}else{let[t,n,o,r,i]=[...e];if(t&&t instanceof Ve.Point)this.pc=t.clone();if(n!==void 0)this.r=n;if(o!==void 0)this.startAngle=o;if(r!==void 0)this.endAngle=r;if(i!==void 0)this.counterClockwise=i}}clone(){return new Ve.Arc(this.pc.clone(),this.r,this.startAngle,this.endAngle,this.counterClockwise)}get sweep(){let e=this.startAngle,t=this.endAngle;if(Ve.Utils.EQ(Math.abs(e-t),Ve.PIx2))return Ve.PIx2;if(Math.abs(e)>Ve.PIx2)e-=Math.trunc(e/Ve.PIx2)*Ve.PIx2;if(e<0)e+=Ve.PIx2;if(Math.abs(t)>Ve.PIx2)t-=Math.trunc(t/Ve.PIx2)*Ve.PIx2;if(t<0)t+=Ve.PIx2;let n=this.counterClockwise?t-e:e-t;if(n<0)n+=Ve.PIx2;return n}get start(){return new Ve.Point(this.pc.x+this.r,this.pc.y).rotate(this.startAngle,this.pc)}get end(){return new Ve.Point(this.pc.x+this.r,this.pc.y).rotate(this.endAngle,this.pc)}get center(){return this.pc.clone()}get vertices(){return[this.start.clone(),this.end.clone()]}get length(){return Math.abs(this.sweep*this.r)}get box(){let t=this.breakToFunctional().reduce((n,o)=>n.merge(o.start.box),new Ve.Box);return t=t.merge(this.end.box),t}contains(e){if(!Ve.Utils.EQ(this.pc.distanceTo(e)[0],this.r))return!1;if(e.equalTo(this.start))return!0;let t=new Ve.Vector(this.pc,e).slope,n=new Ve.Arc(this.pc,this.r,this.startAngle,t,this.counterClockwise);return Ve.Utils.LE(n.length,this.length)}split(e){if(this.start.equalTo(e))return[null,this.clone()];if(this.end.equalTo(e))return[this.clone(),null];let t=new Ve.Vector(this.pc,e).slope;return[new Ve.Arc(this.pc,this.r,this.startAngle,t,this.counterClockwise),new Ve.Arc(this.pc,this.r,t,this.endAngle,this.counterClockwise)]}middle(){let e=this.counterClockwise?this.startAngle+this.sweep/2:this.startAngle-this.sweep/2;return new Ve.Arc(this.pc,this.r,this.startAngle,e,this.counterClockwise).end}pointAtLength(e){if(e>this.length||e<0)return null;if(e===0)return this.start;if(e===this.length)return this.end;let t=e/this.length,n=this.counterClockwise?this.startAngle+this.sweep*t:this.startAngle-this.sweep*t;return new Ve.Arc(this.pc,this.r,this.startAngle,n,this.counterClockwise).end}chordHeight(){return(1-Math.cos(Math.abs(this.sweep/2)))*this.r}intersect(e){if(e instanceof Ve.Point)return this.contains(e)?[e]:[];if(e instanceof Ve.Line)return uwe(e,this);if(e instanceof Ve.Ray)return zmt(e,this);if(e instanceof Ve.Circle)return kmt(this,e);if(e instanceof Ve.Segment)return Yte(e,this);if(e instanceof Ve.Box)return qKi(this,e);if(e instanceof Ve.Arc)return bso(this,e);if(e instanceof Ve.Polygon)return Hmt(this,e);if(e instanceof Ve.Multiline)return Gte(this,e)}distanceTo(e){if(e instanceof Ve.Point){let[t,n]=Ve.Distance.point2arc(e,this);return n=n.reverse(),[t,n]}if(e instanceof Ve.Circle){let[t,n]=Ve.Distance.arc2circle(this,e);return[t,n]}if(e instanceof Ve.Line){let[t,n]=Ve.Distance.arc2line(this,e);return[t,n]}if(e instanceof Ve.Segment){let[t,n]=Ve.Distance.segment2arc(e,this);return n=n.reverse(),[t,n]}if(e instanceof Ve.Arc){let[t,n]=Ve.Distance.arc2arc(this,e);return[t,n]}if(e instanceof Ve.Box){let[t,n]=Ve.Distance.shape2polygon(this,new Ve.Polygon(e));return[t,n]}if(e instanceof Ve.Polygon){let[t,n]=Ve.Distance.shape2polygon(this,e);return[t,n]}if(e instanceof Ve.PlanarSet){let[t,n]=Ve.Distance.shape2planarSet(this,e);return[t,n]}if(e instanceof Ve.Multiline)return Ve.Distance.shape2multiline(this,e)}breakToFunctional(){let e=[],t=[0,Math.PI/2,Math.PI,3*Math.PI/2],n=this.startAngle,o=this.endAngle;if(Ve.Utils.EQ(Math.abs(n-o),Ve.PIx2))o=n;if(Math.abs(n)>Ve.PIx2)n-=Math.trunc(n/Ve.PIx2)*Ve.PIx2;if(n<0)n+=Ve.PIx2;if(Math.abs(o)>Ve.PIx2)o-=Math.trunc(o/Ve.PIx2)*Ve.PIx2;if(o<0)o+=Ve.PIx2;let r=n,i,s,a;if(this.counterClockwise)s=Math.ceil(n/(Math.PI/2))%4,a=1;else s=Math.floor(n/(Math.PI/2))%4,a=-1;for(let c=0,l=s;c<4;c++,l=(l+a+4)%4){if(i=t[l],i===r)continue;let h=this.counterClockwise?i-n:n-i;if(h<0)h+=Ve.PIx2;if(h>this.sweep)break;e.push(new Ve.Arc(this.pc,this.r,r,i,this.counterClockwise)),r=i}if(e.length===0)return e.push(this),e;if(i=o,r!==i)e.push(new Ve.Arc(this.pc,this.r,r,i,this.counterClockwise));return e}tangentInStart(){let e=new Ve.Vector(this.pc,this.start),t=this.counterClockwise?Math.PI/2:-Math.PI/2;return e.rotate(t).normalize()}tangentInEnd(){let e=new Ve.Vector(this.pc,this.end),t=this.counterClockwise?-Math.PI/2:Math.PI/2;return e.rotate(t).normalize()}reverse(){return new Ve.Arc(this.pc,this.r,this.endAngle,this.startAngle,!this.counterClockwise)}transform(e=new Ve.Matrix){let t=this.start.transform(e),n=this.end.transform(e),o=this.pc.transform(e),r=this.counterClockwise;if(e.a*e.d<0)r=!r;return Ve.Arc.arcSE(o,t,n,r)}static arcSE(e,t,n,o){let{vector:r}=Ve,i=r(e,t).slope,s=r(e,n).slope;if(Ve.Utils.EQ(i,s))s+=2*Math.PI,o=!0;let a=r(e,t).length;return new Ve.Arc(e,a,i,s,o)}definiteIntegral(e=0){return this.breakToFunctional().reduce((o,r)=>o+r.circularSegmentDefiniteIntegral(e),0)}circularSegmentDefiniteIntegral(e){let n=new Ve.Segment(this.start,this.end).definiteIntegral(e),o=Ve.Utils.EQ(this.sweep,Ve.PIx2)?0:this.circularSegmentArea();return this.counterClockwise?n-o:n+o}circularSegmentArea(){return 0.5*this.r*this.r*(this.sweep-Math.sin(this.sweep))}sortPoints(e){let{vector:t}=Ve;return e.slice().sort((n,o)=>{let r=t(this.pc,n).slope,i=t(this.pc,o).slope;if(r<i)return-1;if(r>i)return 1;return 0})}get name(){return"arc"}svg(e={}){let t=this.sweep<=Math.PI?"0":"1",n=this.counterClockwise?"1":"0";if(Ve.Utils.EQ(this.sweep,2*Math.PI))return new Ve.Circle(this.pc,this.r).svg(e);else return`
<path d="M${this.start.x},${this.start.y}
                             A${this.r},${this.r} 0 ${t},${n} ${this.end.x},${this.end.y}"
                    ${$G({fill:"none",...e})} />`}};Ve.Arc=U$i;var W$i=(...e)=>new Ve.Arc(...e);Ve.arc=W$i;var X$i=class e extends OL{constructor(t=void 0,n=void 0,o=void 0,r=void 0){super();this.xmin=t,this.ymin=n,this.xmax=o,this.ymax=r}clone(){return new e(this.xmin,this.ymin,this.xmax,this.ymax)}get low(){return new Ve.Point(this.xmin,this.ymin)}get high(){return new Ve.Point(this.xmax,this.ymax)}get max(){return this.clone()}get center(){return new Ve.Point((this.xmin+this.xmax)/2,(this.ymin+this.ymax)/2)}get width(){return Math.abs(this.xmax-this.xmin)}get height(){return Math.abs(this.ymax-this.ymin)}get box(){return this.clone()}not_intersect(t){return this.xmax<t.xmin||this.xmin>t.xmax||this.ymax<t.ymin||this.ymin>t.ymax}intersect(t){return!this.not_intersect(t)}merge(t){return new e(this.xmin===void 0?t.xmin:Math.min(this.xmin,t.xmin),this.ymin===void 0?t.ymin:Math.min(this.ymin,t.ymin),this.xmax===void 0?t.xmax:Math.max(this.xmax,t.xmax),this.ymax===void 0?t.ymax:Math.max(this.ymax,t.ymax))}less_than(t){if(this.low.lessThan(t.low))return!0;if(this.low.equalTo(t.low)&&this.high.lessThan(t.high))return!0;return!1}equal_to(t){return this.low.equalTo(t.low)&&this.high.equalTo(t.high)}output(){return this.clone()}comparable_less_than(t,n){return t.lessThan(n)}set(t,n,o,r){this.xmin=t,this.ymin=n,this.xmax=o,this.ymax=r}extend(t){if(t<=0)return this.clone();return new e(this.xmin-t,this.ymin-t,this.xmax+t,this.ymax+t)}toPoints(){return[new Ve.Point(this.xmin,this.ymin),new Ve.Point(this.xmax,this.ymin),new Ve.Point(this.xmax,this.ymax),new Ve.Point(this.xmin,this.ymax)]}toSegments(){let t=this.toPoints();return[new Ve.Segment(t[0],t[1]),new Ve.Segment(t[1],t[2]),new Ve.Segment(t[2],t[3]),new Ve.Segment(t[3],t[0])]}rotate(t,n=new Ve.Point){throw e0.OPERATION_IS_NOT_SUPPORTED}transform(t=new Ve.Matrix){return this.toPoints().map((o)=>o.transform(t)).reduce((o,r)=>o.merge(r.box),new e)}contains(t){if(t instanceof Ve.Point)return t.x>=this.xmin&&t.x<=this.xmax&&t.y>=this.ymin&&t.y<=this.ymax;if(t instanceof Ve.Segment)return t.vertices.every((n)=>this.contains(n));if(t instanceof Ve.Box)return t.toSegments().every((n)=>this.contains(n));if(t instanceof Ve.Circle)return this.contains(t.box);if(t instanceof Ve.Arc)return t.vertices.every((n)=>this.contains(n))&&this.toSegments().every((n)=>Yte(n,t).length===0);if(t instanceof Ve.Line||t instanceof Ve.Ray)return!1;if(t instanceof Ve.Multiline)return t.toShapes().every((n)=>this.contains(n));if(t instanceof Ve.Polygon)return this.contains(t.box)}distanceTo(t){let n=this.toSegments().map((r)=>r.distanceTo(t)),o=[Number.MAX_SAFE_INTEGER,null];return n.forEach((r)=>{if(r[0]<o[0])o=r}),o}get name(){return"box"}svg(t={}){let n=this.xmax-this.xmin,o=this.ymax-this.ymin;return`
<rect x="${this.xmin}" y="${this.ymin}" width="${n}" height="${o}"
                ${$G({fill:"none",...t})} />`}};Ve.Box=X$i;var j$i=(...e)=>new Ve.Box(...e);Ve.box=j$i;var K$i=class{constructor(e){this.shape=e,this.next=void 0,this.prev=void 0,this.face=void 0,this.arc_length=0,this.bvStart=void 0,this.bvEnd=void 0,this.bv=void 0,this.overlap=void 0}get start(){return this.shape.start}get end(){return this.shape.end}get length(){return this.shape.length}get box(){return this.shape.box}get isSegment(){return this.shape instanceof Ve.Segment}get isArc(){return this.shape instanceof Ve.Arc}get isLine(){return this.shape instanceof Ve.Line}get isRay(){return this.shape instanceof Ve.Ray}middle(){return this.shape.middle()}pointAtLength(e){return this.shape.pointAtLength(e)}contains(e){return this.shape.contains(e)}setInclusion(e){if(this.bv!==void 0)return this.bv;if(this.shape instanceof Ve.Line||this.shape instanceof Ve.Ray)return this.bv=Ve.OUTSIDE,this.bv;if(this.bvStart===void 0)this.bvStart=ume(e,this.start);if(this.bvEnd===void 0)this.bvEnd=ume(e,this.end);if(this.bvStart===Ve.OUTSIDE||this.bvEnd==Ve.OUTSIDE)this.bv=Ve.OUTSIDE;else if(this.bvStart===Ve.INSIDE||this.bvEnd==Ve.INSIDE)this.bv=Ve.INSIDE;else{let t=ume(e,this.middle());this.bv=t}return this.bv}setOverlap(e){let t=void 0,n=this.shape,o=e.shape;if(n instanceof Ve.Segment&&o instanceof Ve.Segment){if(n.start.equalTo(o.start)&&n.end.equalTo(o.end))t=Ve.OVERLAP_SAME;else if(n.start.equalTo(o.end)&&n.end.equalTo(o.start))t=Ve.OVERLAP_OPPOSITE}else if(n instanceof Ve.Arc&&o instanceof Ve.Arc){if(n.start.equalTo(o.start)&&n.end.equalTo(o.end)&&n.middle().equalTo(o.middle()))t=Ve.OVERLAP_SAME;else if(n.start.equalTo(o.end)&&n.end.equalTo(o.start)&&n.middle().equalTo(o.middle()))t=Ve.OVERLAP_OPPOSITE}else if(n instanceof Ve.Segment&&o instanceof Ve.Arc||n instanceof Ve.Arc&&o instanceof Ve.Segment){if(n.start.equalTo(o.start)&&n.end.equalTo(o.end)&&n.middle().equalTo(o.middle()))t=Ve.OVERLAP_SAME;else if(n.start.equalTo(o.end)&&n.end.equalTo(o.start)&&n.middle().equalTo(o.middle()))t=Ve.OVERLAP_OPPOSITE}if(this.overlap===void 0)this.overlap=t;if(e.overlap===void 0)e.overlap=t}svg(){if(this.shape instanceof Ve.Segment)return` L${this.shape.end.x},${this.shape.end.y}`;else if(this.shape instanceof Ve.Arc){let e=this.shape,t,n=e.counterClockwise?"1":"0";if(Ve.Utils.EQ(e.sweep,2*Math.PI)){let o=e.counterClockwise?1:-1,r=new Ve.Arc(e.pc,e.r,e.startAngle,e.startAngle+o*Math.PI,e.counterClockwise),i=new Ve.Arc(e.pc,e.r,e.startAngle+o*Math.PI,e.endAngle,e.counterClockwise);return t="0",` A${r.r},${r.r} 0 ${t},${n} ${r.end.x},${r.end.y}
                    A${i.r},${i.r} 0 ${t},${n} ${i.end.x},${i.end.y}`}else return t=e.sweep<=Math.PI?"0":"1",` A${e.r},${e.r} 0 ${t},${n} ${e.end.x},${e.end.y}`}}toJSON(){return this.shape.toJSON()}};Ve.Edge=K$i;var $$i=class extends Qmt{constructor(e,t){super(e,t);this.setCircularLinks()}setCircularLinks(){if(this.isEmpty())return;this.last.next=this.first,this.first.prev=this.last}[Symbol.iterator](){let e=void 0;return{next:()=>{let t=e?e:this.first,n=this.first?e?e===this.first:!1:!0;return e=t?t.next:void 0,{value:t,done:n}}}}append(e){return super.append(e),this.setCircularLinks(),this}insert(e,t){return super.insert(e,t),this.setCircularLinks(),this}remove(e){return super.remove(e),this}},q$i=class e extends $$i{constructor(t,...n){super();if(this._box=void 0,this._orientation=void 0,n.length===0)return;if(n.length===1){if(n[0]instanceof Array){let o=n[0];if(o.length===0)return;if(o.every((r)=>r instanceof Ve.Point)){let r=e.points2segments(o);this.shapes2face(t.edges,r)}else if(o.every((r)=>r instanceof Array&&r.length===2)){let r=o.map((s)=>new Ve.Point(s[0],s[1])),i=e.points2segments(r);this.shapes2face(t.edges,i)}else if(o.every((r)=>r instanceof Ve.Segment||r instanceof Ve.Arc))this.shapes2face(t.edges,o);else if(o.every((r)=>r.name==="segment"||r.name==="arc")){let r=[];for(let i of o){let s;if(i.name==="segment")s=new Ve.Segment(i);else s=new Ve.Arc(i);r.push(s)}this.shapes2face(t.edges,r)}}else if(n[0]instanceof e){let o=n[0];this.first=o.first,this.last=o.last;for(let r of o)t.edges.add(r)}else if(n[0]instanceof Ve.Circle)this.shapes2face(t.edges,[n[0].toArc(_so)]);else if(n[0]instanceof Ve.Box){let o=n[0];this.shapes2face(t.edges,[new Ve.Segment(new Ve.Point(o.xmin,o.ymin),new Ve.Point(o.xmax,o.ymin)),new Ve.Segment(new Ve.Point(o.xmax,o.ymin),new Ve.Point(o.xmax,o.ymax)),new Ve.Segment(new Ve.Point(o.xmax,o.ymax),new Ve.Point(o.xmin,o.ymax)),new Ve.Segment(new Ve.Point(o.xmin,o.ymax),new Ve.Point(o.xmin,o.ymin))])}}if(n.length===2&&n[0]instanceof Ve.Edge&&n[1]instanceof Ve.Edge)this.first=n[0],this.last=n[1],this.last.next=this.first,this.first.prev=this.last,this.setArcLength()}get edges(){return this.toArray()}get vertices(){return this.edges.map((t)=>t.shape.start.clone())}get shapes(){return this.edges.map((t)=>t.shape.clone())}get box(){if(this._box===void 0){let t=new Ve.Box;for(let n of this)t=t.merge(n.box);this._box=t}return this._box}get perimeter(){return this.last.arc_length+this.last.length}pointAtLength(t){if(t>this.perimeter||t<0)return null;let n=null;for(let o of this)if(t>=o.arc_length&&(o===this.last||t<o.next.arc_length)){n=o.pointAtLength(t-o.arc_length);break}return n}static points2segments(t){let n=[];for(let o=0;o<t.length;o++){if(t[o].equalTo(t[(o+1)%t.length]))continue;n.push(new Ve.Segment(t[o],t[(o+1)%t.length]))}return n}shapes2face(t,n){for(let o of n){let r=new Ve.Edge(o);this.append(r),t.add(r)}}append(t){return super.append(t),this.setOneEdgeArcLength(t),t.face=this,this}insert(t,n){return super.insert(t,n),this.setOneEdgeArcLength(t),t.face=this,this}remove(t){return super.remove(t),this.setArcLength(),this}merge_with_next_edge(t){return t.shape.end.x=t.next.shape.end.x,t.shape.end.y=t.next.shape.end.y,this.remove(t.next),this}reverse(){let t=[],n=this.last;do n.shape=n.shape.reverse(),t.push(n),n=n.prev;while(n!==this.last);this.first=void 0,this.last=void 0;for(let o of t){if(this.first===void 0)o.prev=o,o.next=o,this.first=o,this.last=o;else o.prev=this.last,this.last.next=o,this.last=o,this.last.next=this.first,this.first.prev=this.last;this.setOneEdgeArcLength(o)}if(this._orientation!==void 0)this._orientation=void 0,this._orientation=this.orientation()}setArcLength(){for(let t of this)this.setOneEdgeArcLength(t),t.face=this}setOneEdgeArcLength(t){if(t===this.first)t.arc_length=0;else t.arc_length=t.prev.arc_length+t.prev.length}area(){return Math.abs(this.signedArea())}signedArea(){let t=0,n=this.box.ymin;for(let o of this)t+=o.shape.definiteIntegral(n);return t}orientation(){if(this._orientation===void 0){let t=this.signedArea();if(Ve.Utils.EQ_0(t))this._orientation=hme.NOT_ORIENTABLE;else if(Ve.Utils.LT(t,0))this._orientation=hme.CCW;else this._orientation=hme.CW}return this._orientation}isSimple(t){return e.getSelfIntersections(this,t,!0).length===0}static getSelfIntersections(t,n,o=!1){let r=[];for(let i of t){let s=n.search(i.box);for(let a of s){if(i===a)continue;if(a.face!==t)continue;if(i.shape instanceof Ve.Segment&&a.shape instanceof Ve.Segment&&(i.next===a||i.prev===a))continue;let c=i.shape.intersect(a.shape);for(let l of c){if(l.equalTo(i.start)&&l.equalTo(a.end)&&a===i.prev)continue;if(l.equalTo(i.end)&&l.equalTo(a.start)&&a===i.next)continue;if(r.push(l),o)break}if(r.length>0&&o)break}if(r.length>0&&o)break}return r}findEdgeByPoint(t){let n;for(let o of this){if(t.equalTo(o.shape.start))continue;if(t.equalTo(o.shape.end)||o.shape.contains(t)){n=o;break}}return n}toPolygon(){return new Ve.Polygon(this.shapes)}toJSON(){return this.edges.map((t)=>t.toJSON())}svg(){let t=`M${this.first.start.x},${this.first.start.y}`;for(let n of this)t+=n.svg();return t+=" z",t}};Ve.Face=q$i;var J$i=class e extends OL{constructor(...t){super();if(this.pt=new Ve.Point,this.norm=new Ve.Vector(0,1),t.length===0)return;if(t.length>=1&&t[0]instanceof Ve.Point)this.pt=t[0].clone();if(t.length===1)return;if(t.length===2&&t[1]instanceof Ve.Vector){this.norm=t[1].clone();return}throw e0.ILLEGAL_PARAMETERS}clone(){return new e(this.pt,this.norm)}get slope(){return new Ve.Vector(this.norm.y,-this.norm.x).slope}get box(){let t=this.slope;return new Ve.Box(t>Math.PI/2&&t<3*Math.PI/2?Number.NEGATIVE_INFINITY:this.pt.x,t>=0&&t<=Math.PI?this.pt.y:Number.NEGATIVE_INFINITY,t>=Math.PI/2&&t<=3*Math.PI/2?this.pt.x:Number.POSITIVE_INFINITY,t>=Math.PI&&t<=2*Math.PI||t===0?this.pt.y:Number.POSITIVE_INFINITY)}get start(){return this.pt}get end(){return}get length(){return Number.POSITIVE_INFINITY}contains(t){if(this.pt.equalTo(t))return!0;let n=new Ve.Vector(this.pt,t);return Ve.Utils.EQ_0(this.norm.dot(n))&&Ve.Utils.GE(n.cross(this.norm),0)}coord(t){return Vso(t.x,t.y).cross(this.norm)}split(t){if(!this.contains(t))return[];if(this.pt.equalTo(t))return[this];return[new Ve.Segment(this.pt,t),new Ve.Ray(t,this.norm)]}intersect(t){if(t instanceof Ve.Point)return this.contains(t)?[t]:[];if(t instanceof Ve.Segment)return Fmt(this,t);if(t instanceof Ve.Arc)return zmt(this,t);if(t instanceof Ve.Line)return Tso(this,t);if(t instanceof Ve.Ray)return r$i(this,t);if(t instanceof Ve.Circle)return Bso(this,t);if(t instanceof Ve.Box)return o$i(this,t);if(t instanceof Ve.Polygon)return Dso(this,t);if(t instanceof Ve.Multiline)return Gte(this,t)}rotate(t,n=new Ve.Point){return new Ve.Ray(this.pt.rotate(t,n),this.norm.rotate(t))}transform(t){return new Ve.Ray(this.pt.transform(t),this.norm.clone())}get name(){return"ray"}svg(t,n={}){let o=new Ve.Line(this.pt,this.norm),r=Hte(o,t);if(r=r.filter((s)=>this.contains(s)),r.length===0||r.length===2)return"";return new Ve.Segment(this.pt,r[0]).svg(n)}};Ve.Ray=J$i;var Z$i=(...e)=>new Ve.Ray(...e);Ve.ray=Z$i;var eqi=class e{constructor(){this.faces=new Ve.PlanarSet,this.edges=new Ve.PlanarSet;let t=[...arguments];if(t.length===1&&(t[0]instanceof Array&&t[0].length>0||t[0]instanceof Ve.Circle||t[0]instanceof Ve.Box)){let n=t[0];if(t[0]instanceof Array&&t[0].every((o)=>o instanceof Array))if(n.every((o)=>o instanceof Array&&o.length===2&&typeof o[0]==="number"&&typeof o[1]==="number"))this.faces.add(new Ve.Face(this,n));else for(let o of n)if(o instanceof Array&&o[0]instanceof Array&&o[0].every((r)=>r instanceof Array&&r.length===2&&typeof r[0]==="number"&&typeof r[1]==="number"))for(let r of o)this.faces.add(new Ve.Face(this,r));else this.faces.add(new Ve.Face(this,o));else this.faces.add(new Ve.Face(this,n))}}get box(){return[...this.faces].reduce((t,n)=>t.merge(n.box),new Ve.Box)}get vertices(){return[...this.faces].flatMap((t)=>t.vertices)}clone(){let t=new e;for(let n of this.faces)t.addFace(n.shapes);return t}createFromArray(t){let n=new e;return t.forEach((o)=>[...o.faces].forEach((r)=>n.addFace(r.shapes))),n}isEmpty(){return this.edges.size===0||this.faces.size===0}isValid(){let t=!0;for(let n of this.faces)if(!n.isSimple(this.edges)){t=!1;break}return t}area(){let t=[...this.faces].reduce((n,o)=>n+o.signedArea(),0);return Math.abs(t)}addFace(...t){let n=new Ve.Face(this,...t);return this.faces.add(n),n}deleteFace(t){for(let n of t)this.edges.delete(n);return this.faces.delete(t)}recreateFaces(){this.faces.clear();for(let o of this.edges)o.face=null;let t,n=!0;while(n){n=!1;for(let o of this.edges)if(o.face===null){t=o,n=!0;break}if(n){let o=t;do o=o.next;while(o.next!==t);this.addFace(t,o)}}}removeChain(t,n,o){if(o.next===n){this.deleteFace(t);return}for(let r=n;r!==o.next;r=r.next)if(t.remove(r),this.edges.delete(r),t.isEmpty()){this.deleteFace(t);break}}addVertex(t,n){let o=n.shape.split(t);if(o[0]===null)return n.prev;if(o[1]===null)return n;let r=new Ve.Edge(o[0]),i=n.prev;return n.face.insert(r,i),this.edges.delete(n),this.edges.add(r),n.shape=o[1],this.edges.add(n),r}removeEndVertex(t){let n=t.next;if(n===t)return;t.face.merge_with_next_edge(t),this.edges.delete(n)}cut(t){let o=this.splitToIslands().flatMap((r)=>r._cutSingleIsland(t)).filter((r)=>r.isValid()&&r.isEmpty()===!1);return this.createFromArray(o)}_cutSingleIsland(t){let n=this.clone(),o=t.clone(),r={int_points1:[],int_points2:[],int_points1_sorted:[],int_points2_sorted:[]};for(let a of o.edges)for(let c of n.edges){let l=Eso(a,c);for(let h of l)Fte(a,h,r.int_points1),Fte(c,h,r.int_points2)}if(r.int_points1.length===0)return n;r.int_points1_sorted=RL(r.int_points1),r.int_points2_sorted=RL(r.int_points2),Ote(o,r.int_points1_sorted),Ote(n,r.int_points2_sorted),Omt(r),r.int_points1_sorted=RL(r.int_points1),r.int_points2_sorted=RL(r.int_points2),umt(r.int_points1),pmt(r.int_points1,n);for(let a of r.int_points1_sorted)if(a.edge_before&&a.edge_after&&a.edge_before.bv===a.edge_after.bv)r.int_points2[a.id]=-1,a.id=-1;if(r.int_points1=r.int_points1.filter((a)=>a.id>=0),r.int_points2=r.int_points2.filter((a)=>a.id>=0),r.int_points1.forEach((a,c)=>{a.id=c}),r.int_points2.forEach((a,c)=>{a.id=c}),r.int_points1.length===0)return n;r.int_points1_sorted=RL(r.int_points1),r.int_points2_sorted=RL(r.int_points2);let i,s;for(let a=1;a<r.int_points1_sorted.length;a++)if(s=r.int_points1_sorted[a],i=r.int_points1_sorted[a-1],s.edge_before&&s.edge_before.bv===awe){let c=i.edge_after,l=s.edge_before,h=o.getChain(c,l);bio(r.int_points2[i.id],r.int_points2[s.id],h),h.forEach((d)=>n.edges.add(d)),h=h.reverse().map((d)=>new Ve.Edge(d.shape.reverse()));for(let d=0;d<h.length-1;d++)h[d].next=h[d+1],h[d+1].prev=h[d];bio(r.int_points2[s.id],r.int_points2[i.id],h),h.forEach((d)=>n.edges.add(d))}return n.recreateFaces(),n}cutWithLine(t){let n=new JG([t]);return this.cut(n)}findEdgeByPoint(t){let n;for(let o of this.faces)if(n=o.findEdgeByPoint(t),n!==void 0)break;return n}splitToIslands(){if(this.isEmpty())return[];let t=this.toArray();t.sort((r,i)=>i.area()-r.area());let n=[...t[0].faces][0].orientation(),o=t.filter((r)=>[...r.faces][0].orientation()===n);for(let r of t){let i=[...r.faces][0];if(i.orientation()===n)continue;for(let s of o)if(i.shapes.every((a)=>s.contains(a))){s.addFace(i.shapes);break}}return o}rearrange(){if(this.faces.size<=1)return this.clone();let t=this.splitToIslands(),n=new e;return t.forEach((o)=>{o.faces.forEach((r)=>n.addFace(r.shapes))}),n}orientation(){if(this.isEmpty())return hme.NOT_ORIENTABLE;return[...this.faces][0].orientation()}isOuter(t){return t.orientation()===this.orientation()}isMultiPolygon(){let t=0;return this.faces.forEach((n)=>{if(this.isOuter(n))t++}),t>1}reverse(){for(let t of this.faces)t.reverse();return this}contains(t){if(t instanceof Ve.Point){let n=ume(this,t);return n===awe||n===HP}else return Oso(this,t)}distanceTo(t){if(t instanceof Ve.Point){let[n,o]=Ve.Distance.point2polygon(t,this);return o=o.reverse(),[n,o]}if(t instanceof Ve.Circle||t instanceof Ve.Line||t instanceof Ve.Segment||t instanceof Ve.Arc){let[n,o]=Ve.Distance.shape2polygon(t,this);return o=o.reverse(),[n,o]}if(t instanceof Ve.Box)return this.distanceTo(new Ve.Polygon(t));if(t instanceof Ve.Polygon){let n=[Number.POSITIVE_INFINITY,new Ve.Segment],o,r;for(let i of this.edges){let s=n[0];if([o,r]=Ve.Distance.shape2planarSet(i.shape,t.edges,s),Ve.Utils.LT(o,s))n=[o,r]}return n}}intersect(t){if(t instanceof Ve.Point)return this.contains(t)?[t]:[];if(t instanceof Ve.Line)return Eme(t,this);if(t instanceof Ve.Ray)return Dso(t,this);if(t instanceof Ve.Circle)return Pso(t,this);if(t instanceof Ve.Segment)return Lmt(t,this);if(t instanceof Ve.Arc)return Hmt(t,this);if(t instanceof Ve.Polygon)return t$i(t,this);if(t instanceof Ve.Multiline)return e$i(t,this)}translate(t){let n=new e;for(let o of this.faces)n.addFace(o.shapes.map((r)=>r.translate(t)));return n}rotate(t=0,n=new Ve.Point){let o=new e;for(let r of this.faces)o.addFace(r.shapes.map((i)=>i.rotate(t,n)));return o}scale(t,n){let o=new e;for(let r of this.faces)o.addFace(r.shapes.map((i)=>i.scale(t,n)));return o}transform(t=new Ve.Matrix){let n=new e;for(let o of this.faces)n.addFace(o.shapes.map((r)=>r.transform(t)));return n}toJSON(){return[...this.faces].map((t)=>t.toJSON())}toArray(){return[...this.faces].map((t)=>t.toPolygon())}dpath(){return[...this.faces].reduce((t,n)=>t+n.svg(),"")}svg(t={}){let n=`
<path ${$G({fillRule:"evenodd",fill:"lightcyan",...t})} d="`;for(let o of this.faces)n+=`
${o.svg()}`;return n+=`" >
</path>`,n}};Ve.Polygon=eqi;var tqi=(...e)=>new Ve.Polygon(...e);Ve.polygon=tqi;var{Circle:imt,Line:Bio,Point:Tio,Vector:ZMe,Utils:smt}=Ve,nqi=class e{constructor(t){this.circle=t}get inversion_circle(){return this.circle}static inversePoint(t,n){let o=new ZMe(t.pc,n),r=t.r*t.r,i=o.dot(o);return smt.EQ_0(i)?new Tio(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY):t.pc.translate(o.multiply(r/i))}static inverseCircle(t,n){let o=t.pc.distanceTo(n.pc)[0];if(smt.EQ(o,n.r)){let r=t.r*t.r/(2*n.r),i=new ZMe(t.pc,n.pc);i=i.normalize();let s=t.pc.translate(i.multiply(r));return new Bio(s,i)}else{let r=new ZMe(t.pc,n.pc),i=t.r*t.r/(r.dot(r)-n.r*n.r),s=t.pc.translate(r.multiply(i)),a=Math.abs(i)*n.r;return new imt(s,a)}}static inverseLine(t,n){let[o,r]=t.pc.distanceTo(n);if(smt.EQ_0(o))return n.clone();else{let i=t.r*t.r/(2*o),s=new ZMe(t.pc,r.end);return s=s.multiply(i/o),new imt(t.pc.translate(s),i)}}inverse(t){if(t instanceof Tio)return e.inversePoint(this.circle,t);else if(t instanceof imt)return e.inverseCircle(this.circle,t);else if(t instanceof Bio)return e.inverseLine(this.circle,t)}};Ve.Inversion=nqi;var oqi=(e)=>new Ve.Inversion(e);Ve.inversion=oqi;var rqi=class e{static point2point(t,n){return t.distanceTo(n)}static point2line(t,n){let o=t.projectionOn(n);return[new Ve.Vector(t,o).length,new Ve.Segment(t,o)]}static point2circle(t,n){let[o,r]=t.distanceTo(n.center);if(Ve.Utils.EQ_0(o))return[n.r,new Ve.Segment(t,n.toArc().start)];else{let i=Math.abs(o-n.r),s=new Ve.Vector(n.pc,t).normalize().multiply(n.r),a=n.pc.translate(s);return[i,new Ve.Segment(t,a)]}}static point2segment(t,n){if(n.start.equalTo(n.end))return e.point2point(t,n.start);let o=new Ve.Vector(n.start,n.end),r=new Ve.Vector(n.start,t),i=new Ve.Vector(n.end,t),s=o.dot(r),a=-o.dot(i),c,l;if(Ve.Utils.GE(s,0)&&Ve.Utils.GE(a,0)){let h=n.tangentInStart();return c=Math.abs(h.cross(r)),l=n.start.translate(h.multiply(h.dot(r))),[c,new Ve.Segment(t,l)]}else if(s<0)return t.distanceTo(n.start);else return t.distanceTo(n.end)}static point2arc(t,n){let o=new Ve.Circle(n.pc,n.r),r=[],i,s;if([i,s]=e.point2circle(t,o),s.end.on(n))r.push(e.point2circle(t,o));return r.push(e.point2point(t,n.start)),r.push(e.point2point(t,n.end)),e.sort(r),r[0]}static point2edge(t,n){return n.shape instanceof Ve.Segment?e.point2segment(t,n.shape):e.point2arc(t,n.shape)}static segment2line(t,n){let o=t.intersect(n);if(o.length>0)return[0,new Ve.Segment(o[0],o[0])];let r=[];return r.push(e.point2line(t.start,n)),r.push(e.point2line(t.end,n)),e.sort(r),r[0]}static segment2segment(t,n){let o=pwe(t,n);if(o.length>0)return[0,new Ve.Segment(o[0],o[0])];let r=[],i,s;return[i,s]=e.point2segment(n.start,t),r.push([i,s.reverse()]),[i,s]=e.point2segment(n.end,t),r.push([i,s.reverse()]),r.push(e.point2segment(t.start,n)),r.push(e.point2segment(t.end,n)),e.sort(r),r[0]}static segment2circle(t,n){let o=t.intersect(n);if(o.length>0)return[0,new Ve.Segment(o[0],o[0])];let r=new Ve.Line(t.ps,t.pe),[i,s]=e.point2line(n.center,r);if(Ve.Utils.GE(i,n.r)&&s.end.on(t))return e.point2circle(s.end,n);else{let[a,c]=e.point2circle(t.start,n),[l,h]=e.point2circle(t.end,n);return Ve.Utils.LT(a,l)?[a,c]:[l,h]}}static segment2arc(t,n){let o=t.intersect(n);if(o.length>0)return[0,new Ve.Segment(o[0],o[0])];let r=new Ve.Line(t.ps,t.pe),i=new Ve.Circle(n.pc,n.r),[s,a]=e.point2line(i.center,r);if(Ve.Utils.GE(s,i.r)&&a.end.on(t)){let[d,u]=e.point2circle(a.end,i);if(u.end.on(n))return[d,u]}let c=[];c.push(e.point2arc(t.start,n)),c.push(e.point2arc(t.end,n));let l,h;return[l,h]=e.point2segment(n.start,t),c.push([l,h.reverse()]),[l,h]=e.point2segment(n.end,t),c.push([l,h.reverse()]),e.sort(c),c[0]}static circle2circle(t,n){let o=t.intersect(n);if(o.length>0)return[0,new Ve.Segment(o[0],o[0])];if(t.center.equalTo(n.center)){let r=t.toArc(),i=n.toArc();return e.point2point(r.start,i.start)}else{let r=new Ve.Line(t.center,n.center),i=r.intersect(t),s=r.intersect(n),a=[];return a.push(e.point2point(i[0],s[0])),a.push(e.point2point(i[0],s[1])),a.push(e.point2point(i[1],s[0])),a.push(e.point2point(i[1],s[1])),e.sort(a),a[0]}}static circle2line(t,n){let o=t.intersect(n);if(o.length>0)return[0,new Ve.Segment(o[0],o[0])];let[r,i]=e.point2line(t.center,n),[s,a]=e.point2circle(i.end,t);return a=a.reverse(),[s,a]}static arc2line(t,n){let o=n.intersect(t);if(o.length>0)return[0,new Ve.Segment(o[0],o[0])];let r=new Ve.Circle(t.center,t.r),[i,s]=e.point2line(r.center,n);if(Ve.Utils.GE(i,r.r)){let[a,c]=e.point2circle(s.end,r);if(c.end.on(t))return[a,c]}else{let a=[];return a.push(e.point2line(t.start,n)),a.push(e.point2line(t.end,n)),e.sort(a),a[0]}}static arc2circle(t,n){let o=t.intersect(n);if(o.length>0)return[0,new Ve.Segment(o[0],o[0])];let r=new Ve.Circle(t.center,t.r),[i,s]=e.circle2circle(r,n);if(s.start.on(t))return[i,s];else{let a=[];return a.push(e.point2circle(t.start,n)),a.push(e.point2circle(t.end,n)),e.sort(a),a[0]}}static arc2arc(t,n){let o=t.intersect(n);if(o.length>0)return[0,new Ve.Segment(o[0],o[0])];let r=new Ve.Circle(t.center,t.r),i=new Ve.Circle(n.center,n.r),[s,a]=e.circle2circle(r,i);if(a.start.on(t)&&a.end.on(n))return[s,a];else{let c=[],l,h;if([l,h]=e.point2arc(t.start,n),h.end.on(n))c.push([l,h]);if([l,h]=e.point2arc(t.end,n),h.end.on(n))c.push([l,h]);if([l,h]=e.point2arc(n.start,t),h.end.on(t))c.push([l,h.reverse()]);if([l,h]=e.point2arc(n.end,t),h.end.on(t))c.push([l,h.reverse()]);return[l,h]=e.point2point(t.start,n.start),c.push([l,h]),[l,h]=e.point2point(t.start,n.end),c.push([l,h]),[l,h]=e.point2point(t.end,n.start),c.push([l,h]),[l,h]=e.point2point(t.end,n.end),c.push([l,h]),e.sort(c),c[0]}}static point2polygon(t,n){let o=[Number.POSITIVE_INFINITY,new Ve.Segment];for(let r of n.edges){let[i,s]=e.point2edge(t,r);if(Ve.Utils.LT(i,o[0]))o=[i,s]}return o}static shape2polygon(t,n){let o=[Number.POSITIVE_INFINITY,new Ve.Segment];for(let r of n.edges){let[i,s]=t.distanceTo(r.shape);if(Ve.Utils.LT(i,o[0]))o=[i,s]}return o}static polygon2polygon(t,n){let o=[Number.POSITIVE_INFINITY,new Ve.Segment];for(let r of t.edges)for(let i of n.edges){let[s,a]=r.shape.distanceTo(i.shape);if(Ve.Utils.LT(s,o[0]))o=[s,a]}return o}static box2box_minmax(t,n){let o=Math.max(Math.max(t.xmin-n.xmax,0),Math.max(n.xmin-t.xmax,0)),r=Math.max(Math.max(t.ymin-n.ymax,0),Math.max(n.ymin-t.ymax,0)),i=o*o+r*r,s=t.merge(n),a=s.xmax-s.xmin,c=s.ymax-s.ymin,l=a*a+c*c;return[i,l]}static minmax_tree_process_level(t,n,o,r){let i,s;for(let h of n){[i,s]=e.box2box_minmax(t.box,h.item.key);for(let d of h.item.values)if(d instanceof Ve.Edge)r.insert([i,s],d.shape);else r.insert([i,s],d);if(Ve.Utils.LT(s,o))o=s}if(n.length===0)return o;let a=n.map((h)=>h.left.isNil()?void 0:h.left).filter((h)=>h!==void 0),c=n.map((h)=>h.right.isNil()?void 0:h.right).filter((h)=>h!==void 0),l=[...a,...c].filter((h)=>{let[d,u]=e.box2box_minmax(t.box,h.max);return Ve.Utils.LE(d,o)});return o=e.minmax_tree_process_level(t,l,o,r),o}static minmax_tree(t,n,o){let r=new ymt,i=[n.index.root],s=o<Number.POSITIVE_INFINITY?o*o:Number.POSITIVE_INFINITY;return s=e.minmax_tree_process_level(t,i,s,r),r}static minmax_tree_calc_distance(t,n,o){let r,i;if(n!=null&&!n.isNil()){if([r,i]=e.minmax_tree_calc_distance(t,n.left,o),i)return[r,i];if(Ve.Utils.LT(r[0],Math.sqrt(n.item.key.low)))return[r,!0];let[s,a]=e.distanceToArray(t,n.item.values);if(Ve.Utils.LT(s,r[0]))r=[s,a];return[r,i]=e.minmax_tree_calc_distance(t,n.right,r),[r,i]}return[o,!1]}static shape2planarSet(t,n,o=Number.POSITIVE_INFINITY){let r=[o,new Ve.Segment],i=!1;if(n instanceof Ve.PlanarSet){let s=e.minmax_tree(t,n,o);[r,i]=e.minmax_tree_calc_distance(t,s.root,r)}return r}static sort(t){t.sort((n,o)=>{if(Ve.Utils.LT(n[0],o[0]))return-1;if(Ve.Utils.GT(n[0],o[0]))return 1;return 0})}static distance(t,n){return t.distanceTo(n)}static distanceToArray(t,n){let o=[Number.POSITIVE_INFINITY,new Ve.Segment];for(let r of n){let[i,s]=t.distanceTo(r);if(Ve.Utils.LT(i,o[0]))o=[i,s]}return o}static shape2multiline(t,n){let o=[Number.POSITIVE_INFINITY,new Ve.Segment];for(let r of n){let[i,s]=e.distance(t,r.shape);if(Ve.Utils.LT(i,o[0]))o=[i,s]}return o}static multiline2multiline(t,n){let o=[Number.POSITIVE_INFINITY,new Ve.Segment];for(let r of t)for(let i of n){let[s,a]=e.distance(r.shape,i.shape);if(Ve.Utils.LT(s,o[0]))o=[s,a]}return o}};Ve.Distance=rqi;var{Multiline:iqi,Point:Yso,Segment:sqi,Polygon:Gso}=Ve;function Vmt(e){return new Yso(e.split(" ").map(Number))}function Uso(e){return e.split(", ").map(Vmt)}function Ymt(e){let t=Uso(e),n=[];for(let o=0;o<t.length-1;o++)n.push(new sqi(t[o],t[o+1]));return new iqi(n)}function aqi(e){return e.replace(/\(\(/,"").replace(/\)\)$/,"").split("), (").map(Ymt)}function Wso(e){let t=e.replace(/\(\(/,"").replace(/\)\)$/,"").split("), ("),n=new Gso,o;return t.forEach((r,i)=>{let s=r.split(", ").map((c)=>new Yso(c.split(" ").map(Number))),a=n.addFace(s);if(i===0)o=a.orientation();else if(a.orientation()===o)a.reverse()}),n}function cqi(e){let n=e.split(/\)\), \(\(/).map((i)=>"(("+i+"))").map(Wso),o=new Gso;return n.reduce((i,s)=>[...i,...s?.faces],[]).forEach((i)=>o.addFace([...i?.shapes])),o}function lqi(e){if(e.startsWith("POLYGON")){let t=e.replace(/^POLYGON /,"");return Wso(t)}else{let t=e.replace(/^MULTIPOLYGON \(\(\((.*)\)\)\)$/,"$1");return cqi(t)}}function hqi(e){return e.split(`
`).map((n)=>n.match(/\(([^)]+)\)/)[1]).map(Vmt)}function dqi(e){return e.split(`
`).map((n)=>n.match(/\(([^)]+)\)/)[1]).map(Ymt).reduce((n,o)=>[...n,...o],[])}function Xso(e){if(e.startsWith("POINT")){let t=e.replace(/^POINT \(/,"").replace(/\)$/,"");return Vmt(t)}else if(e.startsWith("MULTIPOINT")){let t=e.replace(/^MULTIPOINT \(/,"").replace(/\)$/,"");return Uso(t)}else if(e.startsWith("LINESTRING")){let t=e.replace(/^LINESTRING \(/,"").replace(/\)$/,"");return Ymt(t)}else if(e.startsWith("MULTILINESTRING")){let t=e.replace(/^MULTILINESTRING /,"");return aqi(t)}else if(e.startsWith("POLYGON")||e.startsWith("MULTIPOLYGON"))return lqi(e);else if(e.startsWith("GEOMETRYCOLLECTION")){let t=/(?<type>POINT|LINESTRING|POLYGON|MULTIPOINT|MULTILINESTRING|MULTIPOLYGON) \((?:[^\(\)]|\([^\)]*\))*\)/g,n=e.match(t);if(n[0].startsWith("GEOMETRYCOLLECTION"))n[0]=n[0].replace("GEOMETRYCOLLECTION (","");return n.map(Xso).map((r)=>r instanceof Array?r:[r]).reduce((r,i)=>[...r,...i],[])}else if(jso(e))return hqi(e);else if(Kso(e))return dqi(e);return[]}function jso(e){return e.split(`
`)?.every((t)=>t.includes("POINT"))}function Kso(e){return e.split(`
`)?.every((t)=>t.includes("LINESTRING"))}function uqi(e){return e.startsWith("POINT")||jso(e)||e.startsWith("LINESTRING")||Kso(e)||e.startsWith("MULTILINESTRING")||e.startsWith("POLYGON")||e.startsWith("MULTIPOINT")||e.startsWith("MULTIPOLYGON")||e.startsWith("GEOMETRYCOLLECTION")}Ve.isWktString=uqi;Ve.parseWKT=Xso;Ve.BooleanOperations=A$i;Ve.Relations=T$i;function Dio(e,t,n){if(!t||!n)return;let o=e.get(t);if(!o)o=new Set,e.set(t,o);o.add(n);let r=e.get(n);if(!r)r=new Set,e.set(n,r);r.add(t)}function $so(e,t){if(!t.subcircuit_id&&!t.source_group_id)return[...e];let n=t;if(t.subcircuit_id){let a=new Set([t.subcircuit_id]),c=new Map,l=new Map;for(let d of e)if(d.type==="source_group"){let{source_group_id:u,subcircuit_id:_}=d;if(_)l.set(u,_);let p=d.parent_source_group_id;if(p){if(!c.has(p))c.set(p,[]);c.get(p).push(u)}}let h;for(let[d,u]of l)if(u===t.subcircuit_id){h=d;break}if(h){let d=(u)=>{let _=c.get(u)||[];for(let p of _){let m=l.get(p);if(m)a.add(m);d(p)}};d(h),n={...t,subcircuit_ids:Array.from(a)}}}let o=new Map;for(let a of e){let c=`${a.type}_id`,l=a[c];if(typeof l==="string")o.set(l,a)}let r=new Map;for(let a of e){let c=Object.entries(a);for(let[l,h]of c){if(l==="parent_source_group_id")continue;if(l.endsWith("_id")&&typeof h==="string"){let d=o.get(h);Dio(r,a,d)}else if(l.endsWith("_ids")&&Array.isArray(h)){for(let d of h)if(typeof d==="string"){let u=o.get(d);Dio(r,a,u)}}}}let i=[],s=new Set;for(let a of e){let c=!1;if(n.subcircuit_id&&"subcircuit_id"in a&&a.subcircuit_id===n.subcircuit_id)c=!0;else if(n.subcircuit_ids&&"subcircuit_id"in a&&a.subcircuit_id&&n.subcircuit_ids.includes(a.subcircuit_id))c=!0;else if(n.source_group_id&&"source_group_id"in a&&a.source_group_id===n.source_group_id)c=!0;else if(n.source_group_id&&"member_source_group_ids"in a&&Array.isArray(a.member_source_group_ids)&&a.member_source_group_ids.includes(n.source_group_id))c=!0;if(c)i.push(a),s.add(a)}while(i.length>0){let a=i.shift(),c=r.get(a);if(!c)continue;for(let l of c)if(!s.has(l))s.add(l),i.push(l)}return e.filter((a)=>s.has(a))}var lwe=(e,t={})=>{let n=e,o=n._internal_store;if(!o){o={counts:{},editCount:0},n._internal_store=o;for(let i of n){let s=i.type,a=i[`${s}_id`];if(!a)continue;let c=Number.parseInt(a.split("_").pop());if(!Number.isNaN(c))o.counts[s]=Math.max(o.counts[s]??0,c)}}let r=new Proxy({},{get:(i,s)=>{if(s==="toArray")return()=>(n.editCount=o.editCount,n);if(s==="editCount")return o.editCount;if(s==="subtree")return(c)=>lwe($so(n,c),t);if(s==="insert")return(c)=>{let l=c.type;if(!l)throw Error("insert requires an element with a type");o.counts[l]??=-1,o.counts[l]++;let h=o.counts[l],d={...c,type:l,[`${l}_id`]:`${l}_${h}`};if(t.validateInserts)(gte[l]??_te).parse(d);return n.push(d),o.editCount++,d};if(s==="insertAll")return(c)=>c.map((l)=>r.insert(l));let a=s;return{get:(c)=>n.find((l)=>l.type===a&&l[`${a}_id`]===c),getUsing:(c)=>{let l=Object.keys(c);if(l.length!==1)throw Error("getUsing requires exactly one key, e.g. { pcb_component_id }");let h=l[0],d=h.replace("_id",""),u=n.find((_)=>_.type===d&&_[h]===c[h]);if(!u)return null;return n.find((_)=>_.type===a&&_[`${a}_id`]===u[`${a}_id`])},getWhere:(c)=>{let l=Object.keys(c);return n.find((h)=>h.type===a&&l.every((d)=>h[d]===c[d]))},list:(c)=>{let l=!c?[]:Object.keys(c);return n.filter((h)=>h.type===a&&l.every((d)=>h[d]===c[d]))},insert:(c)=>{o.counts[a]??=-1,o.counts[a]++;let l=o.counts[a],h={type:a,[`${a}_id`]:`${a}_${l}`,...c};if(t.validateInserts)(gte[a]??_te).parse(h);return n.push(h),o.editCount++,h},delete:(c)=>{let l=n.find((h)=>h[`${a}_id`]===c);if(!l)return;n.splice(n.indexOf(l),1),o.editCount++},update:(c,l)=>{let h=n.find((d)=>d.type===a&&d[`${a}_id`]===c);if(!h)return null;return Object.assign(h,l),o.editCount++,h},select:(c)=>{if(a==="source_component")return n.find((l)=>l.type==="source_component"&&l.name===c.replace(/\./g,""));else if(a==="pcb_port"||a==="source_port"||a==="schematic_port"){let[l,h]=c.replace(/\./g,"").split(/[\s\>]+/),d=n.find((_)=>_.type==="source_component"&&_.name===l);if(!d)return null;let u=n.find((_)=>_.type==="source_port"&&_.source_component_id===d.source_component_id&&(_.name===h||(_.port_hints??[]).includes(h)));if(!u)return null;if(a==="source_port")return u;if(a==="pcb_port")return n.find((_)=>_.type==="pcb_port"&&_.source_port_id===u.source_port_id);else if(a==="schematic_port")return n.find((_)=>_.type==="schematic_port"&&_.source_port_id===u.source_port_id)}}}}});return r};lwe.unparsed=lwe;var cT=lwe;function amt(e){let t=e.type;return`${t}:${e[`${t}_id`]}`}var xmt=(e,t={})=>{let n=e._internal_store_indexed;if(!n){n={counts:{},editCount:0,indexes:{}};for(let s of e){let a=s.type,c=s[`${a}_id`];if(!c)continue;let l=Number.parseInt(c.split("_").pop()||"");if(!Number.isNaN(l))n.counts[a]=Math.max(n.counts[a]??0,l)}let r=t.indexConfig||{},i=n.indexes;if(r.byId)i.byId=new Map;if(r.byType)i.byType=new Map;if(r.byRelation)i.byRelation=new Map;if(r.bySubcircuit)i.bySubcircuit=new Map;if(r.byCustomField&&r.byCustomField.length>0){i.byCustomField=new Map;for(let s of r.byCustomField)i.byCustomField.set(s,new Map)}for(let s of e){if(r.byId){let a=amt(s);i.byId.set(a,s)}if(r.byType){let a=i.byType.get(s.type)||[];a.push(s),i.byType.set(s.type,a)}if(r.byRelation){let a=Object.entries(s);for(let[c,l]of a)if(c.endsWith("_id")&&c!==`${s.type}_id`&&typeof l==="string"){let h=i.byRelation.get(c)||new Map,d=h.get(l)||[];d.push(s),h.set(l,d),i.byRelation.set(c,h)}}if(r.bySubcircuit&&"subcircuit_id"in s){let a=s.subcircuit_id;if(a&&typeof a==="string"){let c=i.bySubcircuit.get(a)||[];c.push(s),i.bySubcircuit.set(a,c)}}if(r.byCustomField&&i.byCustomField){for(let a of r.byCustomField)if(a in s){let c=s[a];if(c!==void 0&&(typeof c==="string"||typeof c==="number")){let l=String(c),h=i.byCustomField.get(a),d=h.get(l)||[];d.push(s),h.set(l,d)}}}}e._internal_store_indexed=n}let o=new Proxy({},{get:(r,i)=>{if(i==="toArray")return()=>(e.editCount=n.editCount,e);if(i==="editCount")return n.editCount;if(i==="insert")return(a)=>{let{type:c,...l}=a;if(!c)throw Error("insert requires an element with a type");return delete l[`${c}_id`],o[c].insert(l)};if(i==="insertAll")return(a)=>a.map((c)=>o.insert(c));if(i==="subtree")return(a)=>xmt($so(e,a),t);let s=i;return{get:(a)=>{let c=t.indexConfig||{};if(c.byId&&n.indexes.byId)return n.indexes.byId.get(`${s}:${a}`)||null;if(c.byType&&n.indexes.byType)return(n.indexes.byType.get(s)||[]).find((h)=>h[`${s}_id`]===a)||null;return e.find((l)=>l.type===s&&l[`${s}_id`]===a)||null},getUsing:(a)=>{let c=t.indexConfig||{},l=Object.keys(a);if(l.length!==1)throw Error("getUsing requires exactly one key, e.g. { pcb_component_id }");let h=l[0],d=h.replace("_id","");if(c.byRelation&&n.indexes.byRelation){let _=n.indexes.byRelation.get(h);if(_){let m=(_.get(a[h])||[]).find((g)=>g.type===d);if(!m)return null;let A=m[`${s}_id`];if(c.byId&&n.indexes.byId)return n.indexes.byId.get(`${s}:${A}`)||null;if(c.byType&&n.indexes.byType)return(n.indexes.byType.get(s)||[]).find((f)=>f[`${s}_id`]===A)||null;return e.find((g)=>g.type===s&&g[`${s}_id`]===A)||null}}let u=e.find((_)=>_.type===d&&_[h]===a[h]);if(!u)return null;return e.find((_)=>_.type===s&&_[`${s}_id`]===u[`${s}_id`])||null},getWhere:(a)=>{let c=t.indexConfig||{},l=Object.keys(a);if(l.length===1&&c.byCustomField&&n.indexes.byCustomField){let h=l[0],d=n.indexes.byCustomField.get(h);if(d){let u=String(a[h]);return(d.get(u)||[]).find((p)=>p.type===s)||null}}if("subcircuit_id"in a&&c.bySubcircuit&&n.indexes.bySubcircuit){let h=a.subcircuit_id;return(n.indexes.bySubcircuit.get(h)||[]).find((u)=>u.type===s&&l.every((_)=>u[_]===a[_]))||null}if(c.byType&&n.indexes.byType)return(n.indexes.byType.get(s)||[]).find((d)=>l.every((u)=>d[u]===a[u]))||null;return e.find((h)=>h.type===s&&l.every((d)=>h[d]===a[d]))||null},list:(a)=>{let c=t.indexConfig||{},l=!a?[]:Object.keys(a);if(l.length===0&&c.byType&&n.indexes.byType)return(n.indexes.byType.get(s)||[]).slice();if(l.length===1&&l[0]==="subcircuit_id"&&c.bySubcircuit&&n.indexes.bySubcircuit){let d=a.subcircuit_id;return(n.indexes.bySubcircuit.get(d)||[]).filter((_)=>_.type===s)}let h;if(c.byType&&n.indexes.byType)h=n.indexes.byType.get(s)||[];else h=e.filter((d)=>d.type===s);if(l.length>0)return h.filter((d)=>l.every((u)=>d[u]===a[u]));return h.slice()},insert:(a)=>{n.counts[s]??=-1,n.counts[s]++;let c=n.counts[s],l={type:s,[`${s}_id`]:`${s}_${c}`,...a};if(t.validateInserts)(gte[s]??_te).parse(l);e.push(l),n.editCount++;let h=t.indexConfig||{};if(h.byId&&n.indexes.byId){let d=amt(l);n.indexes.byId.set(d,l)}if(h.byType&&n.indexes.byType){let d=n.indexes.byType.get(s)||[];d.push(l),n.indexes.byType.set(s,d)}if(h.byRelation&&n.indexes.byRelation){let d=Object.entries(l);for(let[u,_]of d)if(u.endsWith("_id")&&u!==`${l.type}_id`&&typeof _==="string"){let p=n.indexes.byRelation.get(u)||new Map,m=p.get(_)||[];m.push(l),p.set(_,m),n.indexes.byRelation.set(u,p)}}if(h.bySubcircuit&&n.indexes.bySubcircuit&&"subcircuit_id"in l){let d=l.subcircuit_id;if(d&&typeof d==="string"){let u=n.indexes.bySubcircuit.get(d)||[];u.push(l),n.indexes.bySubcircuit.set(d,u)}}if(h.byCustomField&&n.indexes.byCustomField){for(let d of h.byCustomField)if(d in l){let u=l[d];if(u!==void 0&&(typeof u==="string"||typeof u==="number")){let _=String(u),p=n.indexes.byCustomField.get(d),m=p.get(_)||[];m.push(l),p.set(_,m)}}}return l},delete:(a)=>{let c=t.indexConfig||{},l;if(c.byId&&n.indexes.byId)l=n.indexes.byId.get(`${s}:${a}`);else if(c.byType&&n.indexes.byType)l=(n.indexes.byType.get(s)||[]).find((u)=>u[`${s}_id`]===a);else l=e.find((d)=>d[`${s}_id`]===a);if(!l)return;let h=e.indexOf(l);if(h>=0)e.splice(h,1),n.editCount++;if(c.byId&&n.indexes.byId){let d=amt(l);n.indexes.byId.delete(d)}if(c.byType&&n.indexes.byType){let u=(n.indexes.byType.get(s)||[]).filter((_)=>_[`${s}_id`]!==a);n.indexes.byType.set(s,u)}if(c.byRelation&&n.indexes.byRelation)for(let[d,u]of n.indexes.byRelation.entries())for(let[_,p]of u.entries()){let m=p.filter((A)=>A!==l);if(m.length===0)u.delete(_);else u.set(_,m)}if(c.bySubcircuit&&n.indexes.bySubcircuit&&"subcircuit_id"in l){let d=l.subcircuit_id;if(d){let _=(n.indexes.bySubcircuit.get(d)||[]).filter((p)=>p!==l);if(_.length===0)n.indexes.bySubcircuit.delete(d);else n.indexes.bySubcircuit.set(d,_)}}if(c.byCustomField&&n.indexes.byCustomField)for(let d of n.indexes.byCustomField.values())for(let[u,_]of d.entries()){let p=_.filter((m)=>m!==l);if(p.length===0)d.delete(u);else d.set(u,p)}},update:(a,c)=>{let l=t.indexConfig||{},h;if(l.byId&&n.indexes.byId)h=n.indexes.byId.get(`${s}:${a}`);else if(l.byType&&n.indexes.byType)h=(n.indexes.byType.get(s)||[]).find((u)=>u[`${s}_id`]===a);else h=e.find((d)=>d.type===s&&d[`${s}_id`]===a);if(!h)return null;if(l.byRelation&&n.indexes.byRelation){let d=Object.entries(h);for(let[u,_]of d)if(u.endsWith("_id")&&u!==`${h.type}_id`&&typeof _==="string"){if(u in c&&c[u]!==_){let p=n.indexes.byRelation.get(u);if(p){let A=(p.get(_)||[]).filter((g)=>g!==h);if(A.length===0)p.delete(_);else p.set(_,A)}}}}if(l.bySubcircuit&&n.indexes.bySubcircuit&&"subcircuit_id"in h&&"subcircuit_id"in c){let d=h.subcircuit_id,u=c.subcircuit_id;if(d!==u){let p=(n.indexes.bySubcircuit.get(d)||[]).filter((m)=>m!==h);if(p.length===0)n.indexes.bySubcircuit.delete(d);else n.indexes.bySubcircuit.set(d,p)}}if(l.byCustomField&&n.indexes.byCustomField){for(let d of l.byCustomField)if(d in h&&d in c&&h[d]!==c[d]){let u=n.indexes.byCustomField.get(d);if(u){let _=String(h[d]),m=(u.get(_)||[]).filter((A)=>A!==h);if(m.length===0)u.delete(_);else u.set(_,m)}}}if(Object.assign(h,c),n.editCount++,l.byRelation&&n.indexes.byRelation){let d=Object.entries(h);for(let[u,_]of d)if(u.endsWith("_id")&&u!==`${h.type}_id`&&typeof _==="string"){if(u in c){let p=n.indexes.byRelation.get(u)||new Map,m=p.get(_)||[];if(!m.includes(h))m.push(h),p.set(_,m),n.indexes.byRelation.set(u,p)}}}if(l.bySubcircuit&&n.indexes.bySubcircuit&&"subcircuit_id"in h&&"subcircuit_id"in c){let d=h.subcircuit_id;if(d&&typeof d==="string"){let u=n.indexes.bySubcircuit.get(d)||[];if(!u.includes(h))u.push(h),n.indexes.bySubcircuit.set(d,u)}}if(l.byCustomField&&n.indexes.byCustomField){for(let d of l.byCustomField)if(d in h&&d in c){let u=h[d];if(u!==void 0&&(typeof u==="string"||typeof u==="number")){let _=String(u),p=n.indexes.byCustomField.get(d),m=p.get(_)||[];if(!m.includes(h))m.push(h),p.set(_,m)}}}return h},select:(a)=>{if(s==="source_component")return e.find((c)=>c.type==="source_component"&&c.name===a.replace(/\./g,""))||null;else if(s==="pcb_port"||s==="source_port"||s==="schematic_port"){let[c,l]=a.replace(/\./g,"").split(/[\s\>]+/),h=e.find((u)=>u.type==="source_component"&&u.name===c);if(!h)return null;let d=e.find((u)=>u.type==="source_port"&&u.source_component_id===h.source_component_id&&(u.name===l||(u.port_hints??[]).includes(l)));if(!d)return null;if(s==="source_port")return d;if(s==="pcb_port")return e.find((u)=>u.type==="pcb_port"&&u.source_port_id===d.source_port_id)||null;else if(s==="schematic_port")return e.find((u)=>u.type==="schematic_port"&&u.source_port_id===d.source_port_id)||null}return null}}}});return o};xmt.unparsed=xmt;var pqi=(e)=>Math.round(e/(Math.PI/2)),mqi=(e)=>{switch(e){case"from_left":return{x:-1,y:0};case"from_right":return{x:1,y:0};case"from_top":return{x:0,y:1};case"from_bottom":return{x:0,y:-1}}},_qi=({x:e,y:t})=>{if(e>0)return"from_right";if(e<0)return"from_left";if(t>0)return"from_top";return"from_bottom"},gqi=(e,t)=>{if(!e)return e;if(e==="from_above"||e==="from_below"){if(!t.isFlipped)return e;return e==="from_above"?"from_below":"from_above"}let{x:n,y:o}=mqi(e),r=Math.round(t.rotationDegrees/90);while(r>0)[n,o]=[-o,n],r--;while(r<0)[n,o]=[o,-n],r++;if(t.isFlipped)o=-o;return _qi({x:n,y:o})},Aqi=(e,t)=>{if(e.shape==="polygon")return e.points=e.points.map((s)=>Sh.applyToPoint(t,s)),e;let n=Sh.applyToPoint(t,{x:e.x,y:e.y});if(e.x=n.x,e.y=n.y,e.shape==="circle")return e;let o=e.shape==="rotated_rect"?e.ccw_rotation:0,r=t.a*t.d-t.b*t.c<0,i=Sh.decomposeTSR(Sh.compose(t,Sh.rotateDEG(o)),!1,r).rotation.angle*180/Math.PI;if(Math.abs(i)<0.00000001)Object.assign(e,{shape:"rect"}),Reflect.deleteProperty(e,"ccw_rotation");else Object.assign(e,{shape:"rotated_rect",ccw_rotation:i});return e},fqi=(e,t)=>{if(e.type==="pcb_soldermask_opening")return Aqi(e,t);if((e.type==="pcb_smtpad"||e.type==="pcb_solder_paste")&&e.shape==="polygon"){if(e.points=e.points.map((s)=>Sh.applyToPoint(t,s)),e.type==="pcb_solder_paste"&&e.holes)e.holes=e.holes.map((s)=>s.map((a)=>Sh.applyToPoint(t,a)));return e}let n=Sh.decomposeTSR(t),o=Math.abs(pqi(n.rotation.angle))%2===1,r=n.rotation.angle/Math.PI*180,i=n.scale.sy<0;if(e.type==="pcb_plated_hole"||e.type==="pcb_hole"||e.type==="pcb_via"||e.type==="pcb_smtpad"||e.type==="pcb_solder_paste"||e.type==="pcb_port"){let{x:s,y:a}=Sh.applyToPoint(t,{x:e.x,y:e.y});e.x=s,e.y=a}else if(e.type==="pcb_keepout"&&e.shape==="outline")e.outline=e.outline.map((s)=>Sh.applyToPoint(t,s));else if(e.type==="pcb_keepout"||e.type==="pcb_board")e.center=Sh.applyToPoint(t,e.center);else if(e.type==="pcb_silkscreen_text"||e.type==="pcb_fabrication_note_text"||e.type==="pcb_note_text")e.anchor_position=Sh.applyToPoint(t,e.anchor_position);else if(e.type==="pcb_copper_text"){if(e.anchor_position)e.anchor_position=Sh.applyToPoint(t,e.anchor_position)}else if(e.type==="pcb_courtyard_rect")e.center=Sh.applyToPoint(t,e.center),e.ccw_rotation=((e.ccw_rotation??0)+r)%360;else if(e.type==="pcb_silkscreen_circle"||e.type==="pcb_silkscreen_rect"||e.type==="pcb_silkscreen_pill"||e.type==="pcb_silkscreen_oval"||e.type==="pcb_note_rect"||e.type==="pcb_courtyard_circle")e.center=Sh.applyToPoint(t,e.center);else if(e.type==="pcb_component"){if(e.center=Sh.applyToPoint(t,e.center),e.rotation=e.rotation+r,e.rotation=e.rotation%360,e.cable_insertion_center)e.cable_insertion_center=Sh.applyToPoint(t,e.cable_insertion_center);if(e.insertion_direction=gqi(e.insertion_direction,{rotationDegrees:r,isFlipped:i}),o)[e.width,e.height]=[e.height,e.width]}else if(e.type==="pcb_courtyard_outline")e.outline=e.outline.map((s)=>{let a=Sh.applyToPoint(t,s);return s.x=a.x,s.y=a.y,s});else if(e.type==="pcb_courtyard_polygon")e.points=e.points.map((s)=>{let a=Sh.applyToPoint(t,s);return s.x=a.x,s.y=a.y,s});else if(e.type==="pcb_trace")e.route=e.route.map((s)=>{if(!("x"in s))return s.start=Sh.applyToPoint(t,s.start),s.end=Sh.applyToPoint(t,s.end),s;let a=Sh.applyToPoint(t,s);return s.x=a.x,s.y=a.y,s});else if(e.type==="pcb_silkscreen_path"||e.type==="pcb_trace_hint"||e.type==="pcb_fabrication_note_path"||e.type==="pcb_note_path")e.route=e.route.map((s)=>{let a=Sh.applyToPoint(t,s);return s.x=a.x,s.y=a.y,s});else if(e.type==="pcb_silkscreen_line"||e.type==="pcb_note_line"){let s={x:e.x1,y:e.y1},a={x:e.x2,y:e.y2},c=Sh.applyToPoint(t,s),l=Sh.applyToPoint(t,a);e.x1=c.x,e.y1=c.y,e.x2=l.x,e.y2=l.y}else if(e.type==="cad_component"){let s=Sh.applyToPoint(t,{x:e.position.x,y:e.position.y});e.position.x=s.x,e.position.y=s.y}return e},yqi=(e)=>{let t=e.type;return e[`${t}_id`]},Cmt=(e,t)=>({minX:Math.min(e.minX,t.minX),minY:Math.min(e.minY,t.minY),maxX:Math.max(e.maxX,t.maxX),maxY:Math.max(e.maxY,t.maxY)}),ame=(e,t,n)=>{let o=n/2;return{minX:e-o,minY:t-o,maxX:e+o,maxY:t+o}},Nio=(e,t,n,o,r)=>{let i=n/2,s=o/2,a=r*Math.PI/180,c=Math.cos(a),l=Math.sin(a),h=[{x:-i,y:-s},{x:i,y:-s},{x:i,y:s},{x:-i,y:s}].map((d)=>({x:e+d.x*c-d.y*l,y:t+d.x*l+d.y*c}));return{minX:Math.min(...h.map((d)=>d.x)),minY:Math.min(...h.map((d)=>d.y)),maxX:Math.max(...h.map((d)=>d.x)),maxY:Math.max(...h.map((d)=>d.y))}},xqi=(e,t,n,o,r)=>{let i=n/2,s=o/2,a=r*Math.PI/180,c=Math.cos(a),l=Math.sin(a),h=Math.hypot(i*c,s*l),d=Math.hypot(i*l,s*c);return{minX:e-h,minY:t-d,maxX:e+h,maxY:t+d}},Cqi=(e,t,n,o,r)=>{let i=Math.min(n,o)/2,s=Math.max(n,o)/2-i,a=r*Math.PI/180,c=n>=o?{x:s,y:0}:{x:0,y:s},l={x:c.x*Math.cos(a)-c.y*Math.sin(a),y:c.x*Math.sin(a)+c.y*Math.cos(a)},h=Math.abs(l.x)+i,d=Math.abs(l.y)+i;return{minX:e-h,minY:t-d,maxX:e+h,maxY:t+d}},ewe=(e)=>{if(e.length===0)return null;return{minX:Math.min(...e.map((t)=>t.x)),minY:Math.min(...e.map((t)=>t.y)),maxX:Math.max(...e.map((t)=>t.x)),maxY:Math.max(...e.map((t)=>t.y))}},cmt=(e)=>{if(!Array.isArray(e))return[];return e.flatMap((t)=>{if(!t||typeof t!=="object")return[];if("x"in t&&"y"in t&&typeof t.x==="number"&&typeof t.y==="number")return[{x:t.x,y:t.y}];if("start"in t&&"end"in t)return[t.start,t.end].filter((o)=>Boolean(o&&typeof o==="object"&&"x"in o&&"y"in o&&typeof o.x==="number"&&typeof o.y==="number"));return[]})},qso=(e)=>{if(!e.type.startsWith("pcb_"))return null;if(e.type==="pcb_smtpad"&&e.shape==="polygon"&&Array.isArray(e.points))return ewe(e.points);if(e.type==="pcb_hole"&&e.hole_shape==="circle")return ame(e.x,e.y,e.hole_diameter);if(e.type==="pcb_plated_hole"){let d;if("outer_diameter"in e&&typeof e.outer_diameter==="number")d=ame(e.x,e.y,e.outer_diameter);else if("hole_diameter"in e&&typeof e.hole_diameter==="number")d=ame(e.x,e.y,e.hole_diameter);if((e.shape==="oval"||e.shape==="pill")&&typeof e.outer_width==="number"&&typeof e.outer_height==="number")d=(e.shape==="pill"?Cqi:xqi)(e.x,e.y,e.outer_width,e.outer_height,e.ccw_rotation??0);if("rect_pad_width"in e&&typeof e.rect_pad_width==="number"&&"rect_pad_height"in e&&typeof e.rect_pad_height==="number"){let u=Nio(e.x,e.y,e.rect_pad_width,e.rect_pad_height,"rect_ccw_rotation"in e?e.rect_ccw_rotation??0:0);d=d?Cmt(d,u):u}if("hole_diameter"in e&&typeof e.hole_diameter==="number"){let u=ame(e.x+("hole_offset_x"in e?e.hole_offset_x??0:0),e.y+("hole_offset_y"in e?e.hole_offset_y??0:0),e.hole_diameter);d=d?Cmt(d,u):u}if(d)return d}let t=e,n=ewe(cmt(t.route));if(n)return n;let o=ewe(cmt(t.outline));if(o)return o;let r=ewe(cmt(t.points));if(r)return r;let i,s,a,c;if("x"in e&&"y"in e)i=Number(e.x),s=Number(e.y);if("outer_diameter"in e)a=Number(e.outer_diameter),c=Number(e.outer_diameter);if("width"in e)a=Number(e.width);if("height"in e)c=Number(e.height);if("center"in e&&e.center&&typeof e.center==="object"&&"x"in e.center&&"y"in e.center)i=Number(e.center.x),s=Number(e.center.y);let l=0;if("rotation"in e&&typeof e.rotation==="number")l=e.rotation;if("ccw_rotation"in e&&typeof e.ccw_rotation==="number")l=e.ccw_rotation;if(i!==void 0&&s!==void 0){if(a!==void 0&&c!==void 0)return l?Nio(i,s,a,c,l):{minX:i-a/2,minY:s-c/2,maxX:i+a/2,maxY:s+c/2};if("radius"in e&&typeof e.radius==="number")return ame(i,s,e.radius*2);return{minX:i,minY:s,maxX:i,maxY:s}}let h=[t.anchor_position,t.position].filter((d)=>Boolean(d&&typeof d==="object"&&"x"in d&&"y"in d&&typeof d.x==="number"&&typeof d.y==="number")).at(0);return h?{minX:h.x,minY:h.y,maxX:h.x,maxY:h.y}:null},bmt=(e)=>{let t={minX:Number.POSITIVE_INFINITY,minY:Number.POSITIVE_INFINITY,maxX:Number.NEGATIVE_INFINITY,maxY:Number.NEGATIVE_INFINITY};for(let n of e){let o=qso(n);if(o)t=Cmt(t,o)}return t};function bqi(e){let t=0;if(e.length==0)return t;for(var n=0;n<e.length;n++){var o=e.charCodeAt(n);t=(t<<5)-t+o,t=t&t}return Math.abs(t)}var Rio=[["#69d2e7","#a7dbd8","#e0e4cc","#f38630","#fa6900"],["#fe4365","#fc9d9a","#f9cdad","#c8c8a9","#83af9b"],["#ecd078","#d95b43","#c02942","#542437","#53777a"],["#556270","#4ecdc4","#c7f464","#ff6b6b","#c44d58"],["#774f38","#e08e79","#f1d4af","#ece5ce","#c5e0dc"],["#e8ddcb","#cdb380","#036564","#033649","#031634"],["#490a3d","#bd1550","#e97f02","#f8ca00","#8a9b0f"],["#594f4f","#547980","#45ada8","#9de0ad","#e5fcc2"],["#00a0b0","#6a4a3c","#cc333f","#eb6841","#edc951"],["#e94e77","#d68189","#c6a49a","#c6e5d9","#f4ead5"],["#3fb8af","#7fc7af","#dad8a7","#ff9e9d","#ff3d7f"],["#d9ceb2","#948c75","#d5ded9","#7a6a53","#99b2b7"],["#ffffff","#cbe86b","#f2e9e1","#1c140d","#cbe86b"],["#efffcd","#dce9be","#555152","#2e2633","#99173c"],["#343838","#005f6b","#008c9e","#00b4cc","#00dffc"],["#413e4a","#73626e","#b38184","#f0b49e","#f7e4be"],["#ff4e50","#fc913a","#f9d423","#ede574","#e1f5c4"],["#99b898","#fecea8","#ff847c","#e84a5f","#2a363b"],["#655643","#80bca3","#f6f7bd","#e6ac27","#bf4d28"],["#00a8c6","#40c0cb","#f9f2e7","#aee239","#8fbe00"],["#351330","#424254","#64908a","#e8caa4","#cc2a41"],["#554236","#f77825","#d3ce3d","#f1efa5","#60b99a"],["#5d4157","#838689","#a8caba","#cad7b2","#ebe3aa"],["#8c2318","#5e8c6a","#88a65e","#bfb35a","#f2c45a"],["#fad089","#ff9c5b","#f5634a","#ed303c","#3b8183"],["#ff4242","#f4fad2","#d4ee5e","#e1edb9","#f0f2eb"],["#f8b195","#f67280","#c06c84","#6c5b7b","#355c7d"],["#d1e751","#ffffff","#000000","#4dbce9","#26ade4"],["#1b676b","#519548","#88c425","#bef202","#eafde6"],["#5e412f","#fcebb6","#78c0a8","#f07818","#f0a830"],["#bcbdac","#cfbe27","#f27435","#f02475","#3b2d38"],["#452632","#91204d","#e4844a","#e8bf56","#e2f7ce"],["#eee6ab","#c5bc8e","#696758","#45484b","#36393b"],["#f0d8a8","#3d1c00","#86b8b1","#f2d694","#fa2a00"],["#2a044a","#0b2e59","#0d6759","#7ab317","#a0c55f"],["#f04155","#ff823a","#f2f26f","#fff7bd","#95cfb7"],["#b9d7d9","#668284","#2a2829","#493736","#7b3b3b"],["#bbbb88","#ccc68d","#eedd99","#eec290","#eeaa88"],["#b3cc57","#ecf081","#ffbe40","#ef746f","#ab3e5b"],["#a3a948","#edb92e","#f85931","#ce1836","#009989"],["#300030","#480048","#601848","#c04848","#f07241"],["#67917a","#170409","#b8af03","#ccbf82","#e33258"],["#aab3ab","#c4cbb7","#ebefc9","#eee0b7","#e8caaf"],["#e8d5b7","#0e2430","#fc3a51","#f5b349","#e8d5b9"],["#ab526b","#bca297","#c5ceae","#f0e2a4","#f4ebc3"],["#607848","#789048","#c0d860","#f0f0d8","#604848"],["#b6d8c0","#c8d9bf","#dadabd","#ecdbbc","#fedcba"],["#a8e6ce","#dcedc2","#ffd3b5","#ffaaa6","#ff8c94"],["#3e4147","#fffedf","#dfba69","#5a2e2e","#2a2c31"],["#fc354c","#29221f","#13747d","#0abfbc","#fcf7c5"],["#cc0c39","#e6781e","#c8cf02","#f8fcc1","#1693a7"],["#1c2130","#028f76","#b3e099","#ffeaad","#d14334"],["#a7c5bd","#e5ddcb","#eb7b59","#cf4647","#524656"],["#dad6ca","#1bb0ce","#4f8699","#6a5e72","#563444"],["#5c323e","#a82743","#e15e32","#c0d23e","#e5f04c"],["#edebe6","#d6e1c7","#94c7b6","#403b33","#d3643b"],["#fdf1cc","#c6d6b8","#987f69","#e3ad40","#fcd036"],["#230f2b","#f21d41","#ebebbc","#bce3c5","#82b3ae"],["#b9d3b0","#81bda4","#b28774","#f88f79","#f6aa93"],["#3a111c","#574951","#83988e","#bcdea5","#e6f9bc"],["#5e3929","#cd8c52","#b7d1a3","#dee8be","#fcf7d3"],["#1c0113","#6b0103","#a30006","#c21a01","#f03c02"],["#000000","#9f111b","#b11623","#292c37","#cccccc"],["#382f32","#ffeaf2","#fcd9e5","#fbc5d8","#f1396d"],["#e3dfba","#c8d6bf","#93ccc6","#6cbdb5","#1a1f1e"],["#f6f6f6","#e8e8e8","#333333","#990100","#b90504"],["#1b325f","#9cc4e4","#e9f2f9","#3a89c9","#f26c4f"],["#a1dbb2","#fee5ad","#faca66","#f7a541","#f45d4c"],["#c1b398","#605951","#fbeec2","#61a6ab","#accec0"],["#5e9fa3","#dcd1b4","#fab87f","#f87e7b","#b05574"],["#951f2b","#f5f4d7","#e0dfb1","#a5a36c","#535233"],["#8dccad","#988864","#fea6a2","#f9d6ac","#ffe9af"],["#2d2d29","#215a6d","#3ca2a2","#92c7a3","#dfece6"],["#413d3d","#040004","#c8ff00","#fa023c","#4b000f"],["#eff3cd","#b2d5ba","#61ada0","#248f8d","#605063"],["#ffefd3","#fffee4","#d0ecea","#9fd6d2","#8b7a5e"],["#cfffdd","#b4dec1","#5c5863","#a85163","#ff1f4c"],["#9dc9ac","#fffec7","#f56218","#ff9d2e","#919167"],["#4e395d","#827085","#8ebe94","#ccfc8e","#dc5b3e"],["#a8a7a7","#cc527a","#e8175d","#474747","#363636"],["#f8edd1","#d88a8a","#474843","#9d9d93","#c5cfc6"],["#046d8b","#309292","#2fb8ac","#93a42a","#ecbe13"],["#f38a8a","#55443d","#a0cab5","#cde9ca","#f1edd0"],["#a70267","#f10c49","#fb6b41","#f6d86b","#339194"],["#ff003c","#ff8a00","#fabe28","#88c100","#00c176"],["#ffedbf","#f7803c","#f54828","#2e0d23","#f8e4c1"],["#4e4d4a","#353432","#94ba65","#2790b0","#2b4e72"],["#0ca5b0","#4e3f30","#fefeeb","#f8f4e4","#a5b3aa"],["#4d3b3b","#de6262","#ffb88c","#ffd0b3","#f5e0d3"],["#fffbb7","#a6f6af","#66b6ab","#5b7c8d","#4f2958"],["#edf6ee","#d1c089","#b3204d","#412e28","#151101"],["#9d7e79","#ccac95","#9a947c","#748b83","#5b756c"],["#fcfef5","#e9ffe1","#cdcfb7","#d6e6c3","#fafbe3"],["#9cddc8","#bfd8ad","#ddd9ab","#f7af63","#633d2e"],["#30261c","#403831","#36544f","#1f5f61","#0b8185"],["#aaff00","#ffaa00","#ff00aa","#aa00ff","#00aaff"],["#d1313d","#e5625c","#f9bf76","#8eb2c5","#615375"],["#ffe181","#eee9e5","#fad3b2","#ffba7f","#ff9c97"],["#73c8a9","#dee1b6","#e1b866","#bd5532","#373b44"],["#805841","#dcf7f3","#fffcdd","#ffd8d8","#f5a2a2"]],Iqi=(e)=>{let{x:t,y:n,width:o,height:r}={...e,...e.size,...e.center,...e.position};if(e.x1!==void 0&&e.x2!==void 0&&e.y1!==void 0&&e.y2!==void 0)t=(e.x1+e.x2)/2,n=(e.y1+e.y2)/2,o=Math.abs(e.x1-e.x2),r=Math.abs(e.y1-e.y2);if(e.points&&Array.isArray(e.points)&&e.points.length>0){let a=e.points.map((_)=>_.x),c=e.points.map((_)=>_.y),l=Math.min(...a),h=Math.max(...a),d=Math.min(...c),u=Math.max(...c);t=(l+h)/2,n=(d+u)/2,o=h-l,r=u-d}let i=e.text||e.name||e.source?.text||e.source?.name||"?",s=e;if(t===void 0||n===void 0)return null;if(o===void 0){if("radius"in e)o=e.radius*2,r=e.radius*2;else if("outer_diameter"in e)o=e.outer_diameter,r=e.outer_diameter;else if("rect_pad_width"in e&&"rect_pad_height"in e){if(o=e.rect_pad_width,r=e.rect_pad_height,"hole_diameter"in e)o=Math.max(o,e.hole_diameter),r=Math.max(r,e.hole_diameter)}else if("hole_diameter"in e)o=e.hole_diameter,r=e.hole_diameter}if(o===void 0||r===void 0)o=0.1,r=0.1;return{x:t,y:n,width:o,height:r,title:i,content:s,bg_color:Rio[bqi(e.type||i)%Rio.length]?.[4]??"#f00"}},vqi=(e)=>Boolean(e),Sqi=(e)=>{let t=e.filter((l)=>l.type.startsWith("pcb_")||l.type.startsWith("schematic_")).concat(e.filter((l)=>l.type==="pcb_trace"||l.type==="schematic_trace").flatMap((l)=>l.route)).map((l)=>Iqi(l)).filter(vqi);if(t.length===0)return{center:{x:0,y:0},width:0,height:0};let n=t[0].x-t[0].width/2,o=t[0].x+t[0].width/2,r=t[0].y-t[0].height/2,i=t[0].y+t[0].height/2;for(let l of t.slice(1))n=Math.min(n,l.x-l.width/2),o=Math.max(o,l.x+l.width/2),r=Math.min(r,l.y-l.height/2),i=Math.max(i,l.y+l.height/2);let s=o-n,a=i-r;return{center:{x:n+s/2,y:r+a/2},width:s,height:a}},Pqi={leftside_top:{side:"leftside",alignment:"top"},leftside_bottom:{side:"leftside",alignment:"bottom"},rightside_top:{side:"rightside",alignment:"top"},rightside_bottom:{side:"rightside",alignment:"bottom"},topside_left:{side:"topside",alignment:"left"},topside_right:{side:"topside",alignment:"right"},bottomside_left:{side:"bottomside",alignment:"left"},bottomside_right:{side:"bottomside",alignment:"right"}},D8a=Object.keys(Pqi),P0={RENDERING_ENGINE:"pcb_viewer_rendering_engine",COPPER_POUR_OPACITY:"pcb_viewer_copper_pour_opacity",HIDDEN_LAYER_OPACITY:"pcb_viewer_hidden_layer_opacity",IS_SHOWING_PCB_GROUPS:"pcb_viewer_is_showing_pcb_groups",PCB_GROUP_VIEW_MODE:"pcb_viewer_group_view_mode",IS_SHOWING_COPPER_POURS:"pcb_viewer_is_showing_copper_pours",IS_SHOWING_COURTYARDS:"pcb_viewer_is_showing_courtyards",IS_SHOWING_GROUP_ANCHOR_OFFSETS:"pcb_viewer_is_showing_group_anchor_offsets",IS_SHOWING_SOLDER_MASK:"pcb_viewer_is_showing_solder_mask",IS_SHOWING_FABRICATION_NOTES:"pcb_viewer_is_showing_fabrication_notes",IS_SHOWING_PCB_NOTES:"pcb_viewer_is_showing_pcb_notes",IS_SHOWING_SILKSCREEN:"pcb_viewer_is_showing_silkscreen"},TL=(e,t)=>{if(typeof window>"u")return t;try{let n=localStorage.getItem(e);return n!==null?JSON.parse(n):t}catch{return t}},DL=(e,t)=>{if(typeof window>"u")return;try{localStorage.setItem(e,JSON.stringify(t))}catch{}},tao=(e,t)=>{if(typeof window>"u")return t;try{let n=localStorage.getItem(e);return n!==null?JSON.parse(n):t}catch{return t}},nao=(e,t)=>{if(typeof window>"u")return;try{localStorage.setItem(e,JSON.stringify(t))}catch{}},Qio=(e,t)=>{if(typeof window>"u")return t;try{let n=localStorage.getItem(e),o=n!==null?JSON.parse(n):null;return typeof o==="number"&&Number.isFinite(o)?o:t}catch{return t}},kio=(e,t)=>{if(typeof window>"u")return;try{localStorage.setItem(e,JSON.stringify(t))}catch{}},Mqi="named_only",wqi=(e={},t=!1)=>iro((n)=>({copper_pour_opacity:Math.max(0,Math.min(1,Qio(P0.COPPER_POUR_OPACITY,1))),setCopperPourOpacity:(o)=>{if(!Number.isFinite(o))return;let r=Math.max(0,Math.min(1,o));kio(P0.COPPER_POUR_OPACITY,r),n({copper_pour_opacity:r})},hidden_layer_opacity:Math.max(0,Math.min(1,Qio(P0.HIDDEN_LAYER_OPACITY,0.2))),setHiddenLayerOpacity:(o)=>{if(!Number.isFinite(o))return;let r=Math.max(0,Math.min(1,o));kio(P0.HIDDEN_LAYER_OPACITY,r),n({hidden_layer_opacity:r})},selected_layer:"top",pcb_viewer_id:`pcb_viewer_${Math.random().toString().slice(2,10)}`,in_edit_mode:!1,in_move_footprint_mode:!1,is_moving_component:!1,is_mouse_over_container:!1,is_showing_multiple_traces_length:!1,is_showing_rats_nest:!1,is_showing_autorouting:!0,is_showing_drc_errors:!0,is_showing_drc_warnings:!0,is_showing_copper_pours:TL(P0.IS_SHOWING_COPPER_POURS,!0),is_showing_courtyards:TL(P0.IS_SHOWING_COURTYARDS,!0),is_showing_pcb_groups:t?!1:TL(P0.IS_SHOWING_PCB_GROUPS,!0),is_showing_group_anchor_offsets:TL(P0.IS_SHOWING_GROUP_ANCHOR_OFFSETS,!1),is_showing_solder_mask:TL(P0.IS_SHOWING_SOLDER_MASK,!1),is_showing_silkscreen:TL(P0.IS_SHOWING_SILKSCREEN,!0),is_showing_fabrication_notes:TL(P0.IS_SHOWING_FABRICATION_NOTES,!1),is_showing_pcb_notes:TL(P0.IS_SHOWING_PCB_NOTES,!0),pcb_group_view_mode:t?"all":tao(P0.PCB_GROUP_VIEW_MODE,Mqi),hovered_error_id:null,focused_error_id:null,...e,selectLayer:(o)=>n({selected_layer:o}),setEditMode:(o)=>n({in_edit_mode:o!=="off",in_move_footprint_mode:o==="move_footprint",is_moving_component:!1}),setIsShowingRatsNest:(o)=>n({is_showing_rats_nest:o}),setIsMovingComponent:(o)=>n({is_moving_component:o}),setIsMouseOverContainer:(o)=>n({is_mouse_over_container:o}),setIsShowingMultipleTracesLength:(o)=>n({is_showing_multiple_traces_length:o}),setIsShowingAutorouting:(o)=>n({is_showing_autorouting:o}),setIsShowingDrcErrors:(o)=>n({is_showing_drc_errors:o}),setIsShowingDrcWarnings:(o)=>n({is_showing_drc_warnings:o}),setIsShowingCopperPours:(o)=>{DL(P0.IS_SHOWING_COPPER_POURS,o),n({is_showing_copper_pours:o})},setIsShowingCourtyards:(o)=>{DL(P0.IS_SHOWING_COURTYARDS,o),n({is_showing_courtyards:o})},setIsShowingPcbGroups:(o)=>{if(t)return;DL(P0.IS_SHOWING_PCB_GROUPS,o),n({is_showing_pcb_groups:o})},setIsShowingGroupAnchorOffsets:(o)=>{DL(P0.IS_SHOWING_GROUP_ANCHOR_OFFSETS,o),n({is_showing_group_anchor_offsets:o})},setIsShowingSolderMask:(o)=>{DL(P0.IS_SHOWING_SOLDER_MASK,o),n({is_showing_solder_mask:o})},setIsShowingSilkscreen:(o)=>{DL(P0.IS_SHOWING_SILKSCREEN,o),n({is_showing_silkscreen:o})},setIsShowingFabricationNotes:(o)=>{DL(P0.IS_SHOWING_FABRICATION_NOTES,o),n({is_showing_fabrication_notes:o})},setIsShowingPcbNotes:(o)=>{DL(P0.IS_SHOWING_PCB_NOTES,o),n({is_showing_pcb_notes:o})},setPcbGroupViewMode:(o)=>{if(t)return;nao(P0.PCB_GROUP_VIEW_MODE,o),n({pcb_group_view_mode:o})},setHoveredErrorId:(o)=>n({hovered_error_id:o}),setFocusedErrorId:(o)=>n({focused_error_id:o})})),xa=(e)=>{let t=eao.useContext(rao);return dro(t,e)},rao=Zso.createContext(null),Bqi=({children:e,initialState:t,disablePcbGroups:n})=>{let o=Jso.useMemo(()=>wqi(t,n),[n]);return oao.jsx(rao.Provider,{value:o,children:e})},Tqi=()=>{iao.useEffect(()=>{xro()},[]);let e=xa((t)=>t.pcb_viewer_id);return sao.jsx(yro,{position:"top-center",containerId:e})};function Dqi(){var e=Xte.useRef(!1),t=Xte.useCallback(function(){return e.current},[]);return Xte.useEffect(function(){return e.current=!0,function(){e.current=!1}},[]),t}var Nqi=function(e){if(e===void 0)e={};var t=gwe.useState(e),n=t[0],o=t[1],r=gwe.useCallback(function(i){o(function(s){return Object.assign({},s,i instanceof Function?i(s):i)})},[]);return[n,r]},Rqi=Nqi,Qqi=function(){},aao=typeof window<"u",kqi=uso(wKi()),Lqi=function(){var e=Dqi(),t=Rqi({value:void 0,error:void 0,noUserInteraction:!0}),n=t[0],o=t[1],r=cao.useCallback(function(i){if(!e())return;var s,a;try{if(typeof i!=="string"&&typeof i!=="number"){var c=Error("Cannot copy typeof "+typeof i+" to clipboard, must be a string");console.error(c),o({value:i,error:c,noUserInteraction:!0});return}else if(i===""){var c=Error("Cannot copy empty string to clipboard.");console.error(c),o({value:i,error:c,noUserInteraction:!0});return}a=i.toString(),s=(0,kqi.default)(a),o({value:a,error:void 0,noUserInteraction:s})}catch(l){o({value:a,error:l,noUserInteraction:s})}},[]);return[n,r]},Hqi=Lqi,Fqi=aao?Awe.useLayoutEffect:Awe.useEffect,zqi=Fqi,lao={x:0,y:0,width:0,height:0,top:0,left:0,bottom:0,right:0};function Oqi(){var e=_me.useState(null),t=e[0],n=e[1],o=_me.useState(lao),r=o[0],i=o[1],s=_me.useMemo(function(){return new window.ResizeObserver(function(a){if(a[0]){var c=a[0].contentRect,{x:l,y:h,width:d,height:u,top:_,left:p,bottom:m,right:A}=c;i({x:l,y:h,width:d,height:u,top:_,left:p,bottom:m,right:A})}})},[]);return zqi(function(){if(!t)return;return s.observe(t),function(){s.disconnect()}},[t]),[n,r]}var Bme=aao&&typeof window.ResizeObserver<"u"?Oqi:function(){return[Qqi,lao]},Lio=({initialTransform:e,initialTouch1:t,initialTouch2:n,finalTouch1:o,finalTouch2:r})=>{if(!o||!r)return e;let i={x:(t.x+n.x)/2,y:(t.y+n.y)/2},s={x:(o.x+r.x)/2,y:(o.y+r.y)/2},a=Math.hypot(n.x-t.x,n.y-t.y),c=Math.hypot(r.x-o.x,r.y-o.y),l=a===0?1:c/a,h=s.x-i.x,d=s.y-i.y;return LL.compose(LL.translate(h,d),LL.translate(i.x,i.y),LL.scale(l,l),LL.translate(-i.x,-i.y),e)},Vqi=(e={})=>{let t=OA.useRef(null),[n,o]=OA.useState(0),r=e.canvasElm??t.current,[i,s]=OA.useState(e.initialTransform??Bm.identity()),[a,c]=OA.useState(0),[l,h]=OA.useReducer((y)=>y+1,0),d=OA.useCallback((y)=>{if(e.onSetTransform)e.onSetTransform(y);if(!e.transform)s(y)},[e.onSetTransform,s]),u=OA.useCallback((y)=>{d(y),h()},[d]),_=e.transform??i,p=OA.useCallback(()=>{o(Date.now())},[]),m=OA.useRef("none"),A=OA.useRef(null),g=OA.useRef(null);OA.useEffect(()=>{let y=e.canvasElm??t.current;if(y&&!r){c(a+1);return}if(!y){let O=setTimeout(()=>{c(a+1)},100);return()=>clearTimeout(O)}let x=e.transform??i,C={x:0,y:0},b={x:0,y:0},I=!1,v={x:0,y:0},P=(O)=>({x:O.pageX-y.getBoundingClientRect().left-window.scrollX,y:O.pageY-y.getBoundingClientRect().top-window.scrollY});function M(O){if(e.enabled===!1)return;if(e.shouldDrag&&!e.shouldDrag(O))return;if(C=P(O),Date.now()-n<100)return;I=!0,O.preventDefault()}function B(O){if(!I||e.enabled===!1)return;if(e.shouldDrag&&!e.shouldDrag(O))return;b=P(O);let U=Bm.compose(Bm.translate(b.x-C.x,b.y-C.y),x);d(U),x=U,I=!1}function T(O){if(v=P(O),!I||e.enabled===!1)return;if(e.shouldDrag&&!e.shouldDrag(O))return;b=P(O);let U=Bm.compose(Bm.translate(b.x-C.x,b.y-C.y),x);d(U)}function N(O){if(e.enabled===!1)return;if(e.shouldDrag&&!e.shouldDrag(O))return;let U=P(O),j=Bm.compose(Bm.translate(U.x,U.y),Bm.scale(1-O.deltaY/1000,1-O.deltaY/1000),Bm.translate(-U.x,-U.y),x);d(j),x=j,O.preventDefault()}function D(O){if(!I)return;if(e.shouldDrag&&!e.shouldDrag(O))return;if(y){let j=y.getBoundingClientRect();if(O.clientX>=j.left+10&&O.clientX<=j.right-10&&O.clientY>=j.top+10&&O.clientY<=j.bottom-10)return}I=!1,b=P(O);let U=Bm.compose(Bm.translate(b.x-C.x,b.y-C.y),x);d(U),x=U}function L(O){if(O.preventDefault(),e.enabled===!1)return;if(O.touches.length===1){m.current="drag";let U=O.touches[0];A.current={initialTransform:x,initialTouch:{x:U.clientX,y:U.clientY}}}else if(O.touches.length===2){m.current="pinch";let U=O.touches[0],j=O.touches[1];g.current={initialTransform:x,initialTouch1:{x:U.clientX,y:U.clientY},initialTouch2:{x:j.clientX,y:j.clientY},finalTouch1:null,finalTouch2:null}}}function H(O){if(O.preventDefault(),e.enabled===!1)return;if(m.current==="drag"&&O.touches.length===1&&A.current){let U=O.touches[0],j={x:U.clientX,y:U.clientY},Y=j.x-A.current.initialTouch.x,X=j.y-A.current.initialTouch.y,K=Bm.compose(Bm.translate(Y,X),A.current.initialTransform);d(K)}else if(m.current==="pinch"&&O.touches.length===2&&g.current){let U=O.touches[0],j=O.touches[1];g.current.finalTouch1={x:U.clientX,y:U.clientY},g.current.finalTouch2={x:j.clientX,y:j.clientY};let Y=Lio(g.current);d(Y)}}function V(O){O.preventDefault();let U=O.changedTouches[0];if(m.current==="drag"&&A.current&&U){let j={x:U.clientX,y:U.clientY},Y=j.x-A.current.initialTouch.x,X=j.y-A.current.initialTouch.y,K=Bm.compose(Bm.translate(Y,X),A.current.initialTransform);d(K),x=K}else if(m.current==="pinch"&&g.current){let j=Lio(g.current);d(j),x=j}m.current="none",A.current=null,g.current=null}return y.addEventListener("mousedown",M),y.addEventListener("mouseup",B),window.addEventListener("mousemove",T),y.addEventListener("mouseout",D),y.addEventListener("wheel",N),y.addEventListener("touchstart",L,{passive:!1}),y.addEventListener("touchmove",H,{passive:!1}),y.addEventListener("touchend",V,{passive:!1}),y.addEventListener("touchcancel",V,{passive:!1}),()=>{y.removeEventListener("mousedown",M),y.removeEventListener("mouseup",B),window.removeEventListener("mousemove",T),y.removeEventListener("mouseout",D),y.removeEventListener("wheel",N),y.removeEventListener("touchstart",L),y.removeEventListener("touchmove",H),y.removeEventListener("touchend",V),y.removeEventListener("touchcancel",V)}},[r,a,l,n,e.enabled,e.shouldDrag]);let f=OA.useCallback((y)=>Bm.applyToPoint(_,y),[_]);return{ref:t,transform:_,applyTransformToPoint:f,setTransform:u,cancelDrag:p}},Yqi=Vqi,Gqi=(e,t)=>{if(e?.type!=="pcb_smtpad"&&e?.type!=="pcb_plated_hole")return;let n=t.find((r)=>r.type==="pcb_component"&&r.pcb_component_id===e.pcb_component_id);if(n?.type!=="pcb_component")return;let o=t.find((r)=>r.type==="source_component"&&r.source_component_id===n.source_component_id);if(o?.type!=="source_component")return;return{source_component_id:o.source_component_id,pcb_component_id:n.pcb_component_id,refdes:o.name,manufacturer_part_number:o.manufacturer_part_number}};function hao(e){let t=e;while(t.parent!==null)t=t.parent;let n=e;while(n.parent!==null&&n.parent!==t){let o=n.parent;n.parent=t,n=o}return t}function Uqi(e,t){let n={nodeId:e,nextMember:null},o={parent:null,networkId:`connectivity_net${t.nextNetworkNumber++}`,firstMember:n,lastMember:n};return t.rootByNodeId.set(e,o),o}function Wqi(e,t){let n=t.rootByNodeId.get(e);return n===void 0?Uqi(e,t):hao(n)}function Xqi({targetRoot:e,sourceRoot:t}){e.lastMember.nextMember=t.firstMember,e.lastMember=t.lastMember,t.parent=e}function jqi(e){let t=[],n=e.firstMember;while(n!==null)t.push(n.nodeId),n=n.nextMember;return t}function Kqi(e){let t={rootByNodeId:new Map,nextNetworkNumber:0};for(let o of e){let r=null;for(let i of o){let s=Wqi(i,t);if(r===null){r=s;continue}if(r=hao(r),s!==r)Xqi({targetRoot:r,sourceRoot:s})}}let n={};for(let o of t.rootByNodeId.values()){if(o.parent!==null)continue;n[o.networkId]=jqi(o)}return n}var $qi=class{netMap;idToNetMap;constructor(e){this.netMap=e,this.idToNetMap={};for(let[t,n]of Object.entries(e))for(let o of n)this.idToNetMap[o]=t}addConnections(e){for(let t of e){let n=new Set;for(let r of t){let i=this.idToNetMap[r];if(i)n.add(i)}let o;if(n.size===0)o=`connectivity_net${Object.keys(this.netMap).length}`,this.netMap[o]=[];else if(n.size===1)o=n.values().next().value??`connectivity_net${Object.keys(this.netMap).length}`;else{o=n.values().next().value??`connectivity_net${Object.keys(this.netMap).length}`;for(let r of n)if(r!==o){this.netMap[o].push(...this.netMap[r]),this.netMap[r]=this.netMap[o];for(let i of this.netMap[o])this.idToNetMap[i]=o}}for(let r of t){if(!this.netMap[o].includes(r))this.netMap[o].push(r);this.idToNetMap[r]=o}}}getIdsConnectedToNet(e){return this.netMap[e]||[]}getNetConnectedToId(e){return this.idToNetMap[e]}areIdsConnected(e,t){if(e===t)return!0;let n=this.getNetConnectedToId(e);if(!n)return!1;let o=this.getNetConnectedToId(t);if(!o)return!1;return n===o||o===e||o===e}areAllIdsConnected(e){let t=this.getNetConnectedToId(e[0]);for(let n of e){let o=this.getNetConnectedToId(n);if(o===void 0)return!1;if(o!==t)return!1}return!0}},dao=(e)=>{let t=[];for(let o of e)if(o.type==="source_trace")t.push([o.source_trace_id,...o.connected_source_port_ids??[],...o.connected_source_net_ids??[]].filter(Boolean));else if(o.type==="pcb_port"){let{pcb_port_id:r,source_port_id:i}=o;if(i&&r)t.push([i,r])}else if(o.type==="pcb_smtpad"){let{pcb_smtpad_id:r,pcb_port_id:i}=o;if(i&&r)t.push([r,i])}else if(o.type==="pcb_plated_hole"){let{pcb_plated_hole_id:r,pcb_port_id:i}=o;if(i&&r)t.push([r,i])}else if(o.type==="pcb_trace"){let{pcb_trace_id:r,source_trace_id:i}=o,s=Array.isArray(o.route)?o.route.filter((a)=>a&&a.route_type==="wire"):[];if(i&&r)t.push([r,i]);if(Array.isArray(s)){let a=s.find((l)=>l?.start_pcb_port_id)?.start_pcb_port_id,c=s.find((l)=>l?.end_pcb_port_id)?.end_pcb_port_id;if(a&&r)t.push([a,r]);if(r&&c)t.push([r,c])}}else if(o.type==="pcb_via"){let{pcb_via_id:r,pcb_trace_id:i,source_trace_id:s,source_net_id:a}=o,c=[...o.pcb_port_ids??[],i,s,a].filter((l)=>Boolean(l));if(r&&c.length>0)t.push([r,...c])}else if(o.type==="source_component"){if(o.internally_connected_source_port_ids)for(let r of o.internally_connected_source_port_ids)t.push(r)}let n=Kqi(t);return new $qi(n)};function qqi(e,t){if(e.length<2)throw Error("Stroke must have at least two points");let n=e.map((d)=>{if(Array.isArray(d))return{x:d[0],y:d[1]};return d}),o=[],r=[];function i(d,u){let _=u.x-d.x,p=u.y-d.y,m=Math.sqrt(_*_+p*p);return{x:-p/m,y:_/m}}function s(d,u,_,p){let m=p/2,A={x:d.x+u.x*m*_,y:d.y+u.y*m*_};if(_>0)o.push(A);else r.unshift(A)}let a=i(n[0],n[1]),c=n[0].trace_width??t;s(n[0],a,1,c),s(n[0],a,-1,c);for(let d=1;d<n.length-1;d++){let u=n[d-1],_=n[d],p=n[d+1],m=i(u,_),A=i(_,p),g=m.x+A.x,f=m.y+A.y,y=Math.sqrt(g*g+f*f),x=_.trace_width??t,C=2;if(y/2>2*(x/2))s(_,m,1,x),s(_,A,1,x),s(_,m,-1,x),s(_,A,-1,x);else{let b=1/y;s(_,{x:g*b,y:f*b},1,x),s(_,{x:g*b,y:f*b},-1,x)}}let l=i(n[n.length-2],n[n.length-1]),h=n[n.length-1].trace_width??t;return s(n[n.length-1],l,1,h),s(n[n.length-1],l,-1,h),[...o,...r]}var Jqi=(e,t)=>{let{x:n,y:o,width:r,height:i,layer:s,rect_border_radius:a}=e,c=e.corner_radius??a??0,l=[{_pcb_drawing_object_id:sv("rect"),pcb_drawing_type:"rect",x:n,y:o,w:r,h:i,layer:s||"top",_element:e,_parent_pcb_component:t._parent_pcb_component,_parent_source_component:t._parent_source_component,_source_port:t._source_port,roundness:c,...e.shape==="rotated_rect"&&e.ccw_rotation!==void 0?{ccw_rotation:e.ccw_rotation}:{}}];if(e.is_covered_with_solder_mask){let h=s==="bottom"?"soldermask_with_copper_bottom":"soldermask_with_copper_top",u={...{_pcb_drawing_object_id:sv("rect"),pcb_drawing_type:"rect",x:n,y:o,w:r,h:i,layer:h,_element:e,_parent_pcb_component:t._parent_pcb_component,_parent_source_component:t._parent_source_component,_source_port:t._source_port,roundness:c,...e.shape==="rotated_rect"&&e.ccw_rotation!==void 0?{ccw_rotation:e.ccw_rotation}:{}},..."solder_mask_color"in e&&e.solder_mask_color?{color:e.solder_mask_color}:{}};l.push(u)}return l},Zqi=(e,t)=>{let{x:n,y:o,radius:r,layer:i}=e,s=[{_pcb_drawing_object_id:sv("circle"),pcb_drawing_type:"circle",x:n,y:o,r,layer:i||"top",_element:e,_parent_pcb_component:t._parent_pcb_component,_parent_source_component:t._parent_source_component,_source_port:t._source_port}];if(e.is_covered_with_solder_mask){let a=i==="bottom"?"soldermask_with_copper_bottom":"soldermask_with_copper_top",c={_pcb_drawing_object_id:sv("circle"),pcb_drawing_type:"circle",x:n,y:o,r,layer:a,_element:e,_parent_pcb_component:t._parent_pcb_component,_parent_source_component:t._parent_source_component,_source_port:t._source_port,..."solder_mask_color"in e&&e.solder_mask_color?{color:e.solder_mask_color}:{}};s.push(c)}return s},eJi=(e,t)=>{let{layer:n,points:o}=e,r=[{_pcb_drawing_object_id:sv("polygon"),pcb_drawing_type:"polygon",points:Imt(o),layer:n||"top",_element:e,_parent_pcb_component:t._parent_pcb_component,_parent_source_component:t._parent_source_component,_source_port:t._source_port}];if(e.is_covered_with_solder_mask){let i=n==="bottom"?"soldermask_with_copper_bottom":"soldermask_with_copper_top",s={_pcb_drawing_object_id:sv("polygon"),pcb_drawing_type:"polygon",points:Imt(o),layer:i,_element:e,_parent_pcb_component:t._parent_pcb_component,_parent_source_component:t._parent_source_component,_source_port:t._source_port,..."solder_mask_color"in e&&e.solder_mask_color?{color:e.solder_mask_color}:{}};r.push(s)}return r},tJi=(e,t)=>{let{x:n,y:o,width:r,height:i,layer:s}=e,a=[{_pcb_drawing_object_id:sv("pill"),pcb_drawing_type:"pill",x:n,y:o,w:r,h:i,layer:s||"top",_element:e,_parent_pcb_component:t._parent_pcb_component,_parent_source_component:t._parent_source_component,_source_port:t._source_port}];if(e.is_covered_with_solder_mask){let c=s==="bottom"?"soldermask_with_copper_bottom":"soldermask_with_copper_top",l={_pcb_drawing_object_id:sv("pill"),pcb_drawing_type:"pill",x:n,y:o,w:r,h:i,layer:c,_element:e,_parent_pcb_component:t._parent_pcb_component,_parent_source_component:t._parent_source_component,_source_port:t._source_port,..."solder_mask_color"in e&&e.solder_mask_color?{color:e.solder_mask_color}:{}};a.push(l)}return a},nJi=(e,t)=>{let{x:n,y:o,width:r,height:i,layer:s,ccw_rotation:a}=e,c=[{_pcb_drawing_object_id:sv("pill"),pcb_drawing_type:"pill",x:n,y:o,w:r,h:i,layer:s||"top",_element:e,_parent_pcb_component:t._parent_pcb_component,_parent_source_component:t._parent_source_component,_source_port:t._source_port,ccw_rotation:a}];if(e.is_covered_with_solder_mask){let l=s==="bottom"?"soldermask_with_copper_bottom":"soldermask_with_copper_top",h={_pcb_drawing_object_id:sv("pill"),pcb_drawing_type:"pill",x:n,y:o,w:r,h:i,layer:l,_element:e,_parent_pcb_component:t._parent_pcb_component,_parent_source_component:t._parent_source_component,_source_port:t._source_port,ccw_rotation:a,..."solder_mask_color"in e&&e.solder_mask_color?{color:e.solder_mask_color}:{}};c.push(h)}return c},Zu=0,sv=(e)=>`${e}_${Zu++}`,Imt=(e)=>(e??[]).map((t)=>({x:Sn.parse(t.x),y:Sn.parse(t.y)}));function oJi(e){let t=new Map;for(let n of e){let o=n[`${n.type}_id`];if(o!==void 0&&!t.has(`${n.type}:${o}`))t.set(`${n.type}:${o}`,n)}return t}var rJi=(e,t,n)=>{let o=(c,l)=>{if(l===void 0)return;return n?n.get(`${c}:${l}`):t.find((h)=>h.type===c&&h[`${c}_id`]===l)},r=o("pcb_component","pcb_component_id"in e?e.pcb_component_id:void 0),i=o("source_component",r?.source_component_id),s="source_port_id"in e?e.source_port_id:("pcb_port_id"in e)?o("pcb_port",e.pcb_port_id)?.source_port_id:void 0,a=o("source_port",s);switch(e.type){case"pcb_smtpad":{let c={_parent_pcb_component:r,_parent_source_component:i,_source_port:a};if(e.shape==="rect"||e.shape==="rotated_rect")return Jqi(e,c);else if(e.shape==="circle")return Zqi(e,c);else if(e.shape==="polygon")return eJi(e,c);else if(e.shape==="pill")return tJi(e,c);else if(e.shape==="rotated_pill")return nJi(e,c);return[]}case"pcb_trace":{let c=[];if(e.route_thickness_mode==="interpolated"){let d=e.route.flatMap((p)=>{if(p.route_type==="through_pad")return[{...p.start,trace_width:p.width},{...p.end,trace_width:p.width}];return[{x:p.x,y:p.y,trace_width:p.route_type==="wire"?p.width:0.5}]}),u=qqi(d,0.5),_=e.route[0].layer;return c.push({_pcb_drawing_object_id:`polygon_${Zu++}`,_element:e,pcb_drawing_type:"polygon",points:u,layer:_}),e.route.forEach((p)=>{if(p.route_type==="via")c.push({_pcb_drawing_object_id:`circle_${Zu++}`,_element:e,pcb_drawing_type:"circle",x:p.x,y:p.y,r:p.outer_diameter/2,layer:p.from_layer})}),c}let l=null,h=null;for(let d of e.route)if(d.route_type==="wire"){if(l!==null&&h!==null)c.push({_pcb_drawing_object_id:`line_${Zu++}`,_element:e,pcb_drawing_type:"line",x1:l,y1:h,x2:d.x,y2:d.y,width:d.width,squareCap:!1,layer:d.layer});l=d.x,h=d.y}return c}case"pcb_via":{let{x:c,y:l,outer_diameter:h,hole_diameter:d}=e,{from_layer:u,to_layer:_,layers:p}=e,m=[];if(u&&_)m.push(u,_);else if(p&&Array.isArray(p))m.push(...p);else m.push("top","bottom");let A=[];for(let g of m)A.push({_pcb_drawing_object_id:`circle_${Zu++}`,pcb_drawing_type:"circle",x:c,y:l,r:h/2,layer:g,_element:e,_parent_pcb_component:r,_parent_source_component:i});return A.push({_pcb_drawing_object_id:`circle_${Zu++}`,pcb_drawing_type:"circle",x:c,y:l,r:d/2,layer:"drill",_element:e}),A}case"pcb_plated_hole":if(e.shape==="circle"){let{x:c,y:l,hole_diameter:h,outer_diameter:d}=e;return[{_pcb_drawing_object_id:`circle_${Zu++}`,pcb_drawing_type:"circle",x:c,y:l,r:d/2,layer:"top",_element:e,_parent_pcb_component:r,_parent_source_component:i,_source_port:a},{_pcb_drawing_object_id:`circle_${Zu++}`,pcb_drawing_type:"circle",x:c,y:l,r:h/2,layer:"drill",_element:e}]}else if(e.shape==="oval"){let{x:c,y:l,outer_height:h,outer_width:d,hole_height:u,hole_width:_}=e;return[{_pcb_drawing_object_id:`oval_${Zu++}`,pcb_drawing_type:"oval",x:c,y:l,rX:d/2,rY:h/2,layer:"top",_element:e,_parent_pcb_component:r,_parent_source_component:i,_source_port:a},{_pcb_drawing_object_id:`oval_${Zu++}`,_element:e,pcb_drawing_type:"oval",x:c,y:l,rX:_/2,rY:u/2,layer:"drill"}]}else if(e.shape==="pill"){let{x:c,y:l,outer_height:h,outer_width:d,hole_height:u,hole_width:_}=e;return[{_pcb_drawing_object_id:`pill_${Zu++}`,pcb_drawing_type:"pill",x:c,y:l,w:d,h,layer:"top",_element:e,_parent_pcb_component:r,_parent_source_component:i,_source_port:a,ccw_rotation:e.ccw_rotation},{_pcb_drawing_object_id:`pill_${Zu++}`,_element:e,pcb_drawing_type:"pill",x:c,y:l,w:_,h:u,layer:"drill",ccw_rotation:e.ccw_rotation}]}else if(e.shape==="circular_hole_with_rect_pad"){let{x:c,y:l,hole_diameter:h,rect_pad_width:d,rect_pad_height:u,rect_border_radius:_,hole_offset_x:p,hole_offset_y:m}=e,A=Sn.parse(p??0),g=Sn.parse(m??0);return[{_pcb_drawing_object_id:`rect_${Zu++}`,pcb_drawing_type:"rect",x:c,y:l,w:d,h:u,layer:"top",_element:e,_parent_pcb_component:r,_parent_source_component:i,_source_port:a,roundness:_},{_pcb_drawing_object_id:`rect_${Zu++}`,pcb_drawing_type:"rect",x:c,y:l,w:d,h:u,layer:"bottom",_element:e,_parent_pcb_component:r,_parent_source_component:i,_source_port:a,roundness:_,is_hoverable:!1},{_pcb_drawing_object_id:`circle_${Zu++}`,_element:e,pcb_drawing_type:"circle",x:c+A,y:l+g,r:h/2,layer:"drill",is_hoverable:!1}]}else if(e.shape==="pill_hole_with_rect_pad"){let{x:c,y:l,hole_width:h,hole_height:d,rect_pad_width:u,rect_pad_height:_,rect_border_radius:p}=e;return[{_pcb_drawing_object_id:`rect_${Zu++}`,pcb_drawing_type:"rect",x:c,y:l,w:u,h:_,layer:"top",_element:e,_parent_pcb_component:r,_parent_source_component:i,_source_port:a,roundness:p},{_pcb_drawing_object_id:`rect_${Zu++}`,pcb_drawing_type:"rect",x:c,y:l,w:u,h:_,layer:"bottom",_element:e,_parent_pcb_component:r,_parent_source_component:i,_source_port:a,roundness:p,is_hoverable:!1},{_pcb_drawing_object_id:`pill_${Zu++}`,_element:e,pcb_drawing_type:"pill",x:c,y:l,w:h,h:d,layer:"drill",is_hoverable:!1}]}else if(e.shape==="rotated_pill_hole_with_rect_pad"){let{x:c,y:l,hole_width:h,hole_height:d,hole_ccw_rotation:u,rect_pad_width:_,rect_pad_height:p,rect_ccw_rotation:m,rect_border_radius:A}=e;return[{_pcb_drawing_object_id:`rect_${Zu++}`,pcb_drawing_type:"rect",x:c,y:l,w:_,h:p,layer:"top",_element:e,_parent_pcb_component:r,_parent_source_component:i,_source_port:a,ccw_rotation:m,roundness:A},{_pcb_drawing_object_id:`rect_${Zu++}`,pcb_drawing_type:"rect",x:c,y:l,w:_,h:p,layer:"bottom",_element:e,_parent_pcb_component:r,_parent_source_component:i,_source_port:a,ccw_rotation:m,roundness:A,is_hoverable:!1},{_pcb_drawing_object_id:`pill_${Zu++}`,_element:e,pcb_drawing_type:"pill",x:c,y:l,w:h,h:d,layer:"drill",ccw_rotation:u,is_hoverable:!1}]}else if(e.shape==="hole_with_polygon_pad"){let{x:c,y:l,pad_outline:h,hole_shape:d,hole_diameter:u,hole_width:_,hole_height:p,layers:m,hole_offset_x:A,hole_offset_y:g}=e,f=Sn.parse(A??0),y=Sn.parse(g??0),x=h,C=[];if(x&&Array.isArray(x)){let v=Imt(x).map((P)=>({x:P.x+c,y:P.y+l}));for(let P of m||["top","bottom"])C.push({_pcb_drawing_object_id:`polygon_${Zu++}`,pcb_drawing_type:"polygon",points:v,layer:P,_element:e,_parent_pcb_component:r,_parent_source_component:i,_source_port:a})}let b={x:c+f,y:l+y},I=[];if(d==="circle")I.push({_pcb_drawing_object_id:`circle_${Zu++}`,pcb_drawing_type:"circle",x:b.x,y:b.y,r:(u??0)/2,layer:"drill",_element:e,_parent_pcb_component:r,_parent_source_component:i});else if(d==="oval")I.push({_pcb_drawing_object_id:`oval_${Zu++}`,pcb_drawing_type:"oval",x:b.x,y:b.y,rX:(_??0)/2,rY:(p??0)/2,layer:"drill",_element:e,_parent_pcb_component:r,_parent_source_component:i});else if(d==="pill"||d==="rotated_pill")I.push({_pcb_drawing_object_id:`pill_${Zu++}`,pcb_drawing_type:"pill",x:b.x,y:b.y,w:_??0,h:p??0,layer:"drill",_element:e,_parent_pcb_component:r,_parent_source_component:i,ccw_rotation:e.ccw_rotation});return[...C,...I]}else return[]}return[]};function iJi({primitivesWithoutInteractionMetadata:e,drawingObjectIdsWithMouseOver:t,primitiveIdsInMousedOverNet:n}){let o=[];for(let r of e){let i={...r},{_element:s,_parent_pcb_component:a}=r;if(r?.layer==="drill")i.is_in_highlighted_net=!1,i.is_mouse_over=!1;else if(t.has(r._pcb_drawing_object_id))i.is_mouse_over=!0;else if(s&&(("pcb_trace_id"in s)&&n.includes(s.pcb_trace_id)||("pcb_port_id"in s)&&n.includes(s.pcb_port_id)||("pcb_via_id"in s)&&n.includes(s.pcb_via_id)||("pcb_component_id"in s)&&n.includes(s.pcb_component_id)||a&&("pcb_component_id"in a)&&n.includes(a.pcb_component_id)))i.is_in_highlighted_net=!0;else i.is_in_highlighted_net=!1,i.is_mouse_over=!1;o.push(i)}return o}var uao=(e)=>{let t=new Map,n=new Map,o=new Map,r=new Map,i=new Map;for(let s of e)if(s.type==="pcb_trace"&&s.pcb_trace_id)t.set(s.pcb_trace_id,s);else if(s.type==="pcb_port"&&s.pcb_port_id)n.set(s.pcb_port_id,s);else if(s.type==="pcb_via"&&s.pcb_via_id)o.set(s.pcb_via_id,s);else if(s.type==="pcb_component"&&s.pcb_component_id)r.set(s.pcb_component_id,s);else if(s.type==="pcb_board"&&s.pcb_board_id)i.set(s.pcb_board_id,s);return{tracesById:t,portsById:n,viasById:o,componentsById:r,boardsById:i}},n6=(e,t)=>{if(!t)return e;if(!e)return t;return{minX:Math.min(e.minX,t.minX),maxX:Math.max(e.maxX,t.maxX),minY:Math.min(e.minY,t.minY),maxY:Math.max(e.maxY,t.maxY)}},YG=(e,t=0.45)=>({minX:e.x-t,maxX:e.x+t,minY:e.y-t,maxY:e.y+t}),sJi=(e)=>{if(e.length===0)return null;let t=null;for(let n of e){let o=Math.max((n.width??0.2)/2,0.3);t=n6(t,YG(n,o))}return t},Hio=(e)=>{if(!e?.center)return null;let t=Math.max(e.width??0,1.2),n=Math.max(e.height??0,1.2);return{minX:e.center.x-t/2,maxX:e.center.x+t/2,minY:e.center.y-n/2,maxY:e.center.y+n/2}},aJi=(e)=>{if(!e?.center||typeof e.width!=="number"||typeof e.height!=="number")return null;return{minX:e.center.x-e.width/2,maxX:e.center.x+e.width/2,minY:e.center.y-e.height/2,maxY:e.center.y+e.height/2}},cJi=(e,t)=>({minX:e.minX-t,maxX:e.maxX+t,minY:e.minY-t,maxY:e.maxY+t}),lJi=(e,t=0.35)=>{let n=Ms(e);if(!n)return null;return cJi(n,t)},pao=({error:e,tracesById:t,portsById:n,viasById:o,componentsById:r})=>{if(e.center)return e.center;if(e.pcb_center)return e.pcb_center;if(e.component_center)return e.component_center;if(e.pcb_via_ids?.length){let i=e.pcb_via_ids.map((s)=>o.get(s)).filter(Boolean);if(i.length>0)return{x:i.reduce((s,a)=>s+a.x,0)/i.length,y:i.reduce((s,a)=>s+a.y,0)/i.length}}if(e.pcb_port_ids?.length){let i=e.pcb_port_ids.map((s)=>n.get(s)).filter(Boolean);if(i.length>0)return{x:i.reduce((s,a)=>s+a.x,0)/i.length,y:i.reduce((s,a)=>s+a.y,0)/i.length}}if(e.pcb_trace_id){let i=t.get(e.pcb_trace_id);if(i?.route?.length){let s=Math.floor(i.route.length/2);return{x:i.route[s].x,y:i.route[s].y}}}if(e.pcb_component_id)return r.get(e.pcb_component_id)?.center??null;return null},hJi=({error:e,indexes:t})=>pao({error:e,...t}),dJi=({error:e,boardsById:t})=>{if(!e.component_bounds||!e.pcb_board_id)return null;let n=aJi(t.get(e.pcb_board_id));if(!n)return null;let o=e.component_bounds,r=[];if(o.min_x<n.minX)r.push({x:n.minX,y:Math.max(o.min_y,n.minY)}),r.push({x:n.minX,y:Math.min(o.max_y,n.maxY)});if(o.max_x>n.maxX)r.push({x:n.maxX,y:Math.max(o.min_y,n.minY)}),r.push({x:n.maxX,y:Math.min(o.max_y,n.maxY)});if(o.min_y<n.minY)r.push({x:Math.max(o.min_x,n.minX),y:n.minY}),r.push({x:Math.min(o.max_x,n.maxX),y:n.minY});if(o.max_y>n.maxY)r.push({x:Math.max(o.min_x,n.minX),y:n.maxY}),r.push({x:Math.min(o.max_x,n.maxX),y:n.maxY});return lJi(r,0.3)},Fio=new Set(["source_failed_to_create_component_error"]),uJi=({error:e,indexes:t})=>{if(Fio.has(e.error_type)||Fio.has(e.type))return null;let n=null,o=pao({error:e,...t});if(o)n=n6(n,YG(o,0.35));if(e.error_type==="pcb_component_outside_board_error")n=n6(n,dJi({error:e,boardsById:t.boardsById}));else if(e.component_bounds&&!o)n=n6(n,{minX:e.component_bounds.min_x,maxX:e.component_bounds.max_x,minY:e.component_bounds.min_y,maxY:e.component_bounds.max_y});if(e.center&&!o)n=n6(n,YG(e.center));if(e.pcb_center&&!o)n=n6(n,YG(e.pcb_center));if(e.component_center&&!o)n=n6(n,YG(e.component_center));if(e.pcb_port_ids&&!o)for(let r of e.pcb_port_ids){let i=t.portsById.get(r);if(i)n=n6(n,YG({x:i.x,y:i.y},0.4))}if(e.pcb_trace_id&&!o){let r=t.tracesById.get(e.pcb_trace_id);if(r?.route)n=n6(n,sJi(r.route))}if(e.pcb_via_ids)for(let r of e.pcb_via_ids){let i=t.viasById.get(r);if(i)n=n6(n,YG({x:i.x,y:i.y},Math.max((i.outer_diameter??0.5)/2,0.28)))}if(e.pcb_component_id&&!o)n=n6(n,Hio(t.componentsById.get(e.pcb_component_id)));if(e.pcb_component_ids&&!o)for(let r of e.pcb_component_ids)n=n6(n,Hio(t.componentsById.get(r)));return n},mao=({bounds:e,width:t,height:n})=>{let o={x:(e.minX+e.maxX)/2,y:(e.minY+e.maxY)/2},r=Math.max(e.maxX-e.minX,0.8)+1.4,i=Math.max(e.maxY-e.minY,0.8)+1.4,s=Math.min(t/r,n/i,240)*0.92;return jG.compose(jG.translate(t/2,n/2),jG.scale(s,-s,0,0),jG.translate(-o.x,-o.y))},pJi=(e)=>{let t=new Set;if(e.pcb_trace_id)t.add(e.pcb_trace_id);for(let n of e.pcb_port_ids??[])t.add(n);for(let n of e.pcb_via_ids??[])t.add(n);if(e.pcb_component_id)t.add(e.pcb_component_id);for(let n of e.pcb_component_ids??[])t.add(n);return[...t]},Qte=(e,t)=>{let n=["pcb_trace_error_id","pcb_via_clearance_error_id","pcb_component_outside_board_error_id","source_failed_to_create_component_error_id","pcb_error_id"];for(let o of n)if(typeof e?.[o]==="string"&&e[o].length>0)return e[o];for(let[o,r]of Object.entries(e??{}))if(o.endsWith("_error_id")&&typeof r==="string"&&r.length>0)return r;return`error_${t}_${e?.error_type}_${e?.message?.slice(0,20)}`},_ao=(e,t)=>{if(!t)return null;return e.find((n,o)=>{if(!n.type?.includes("error"))return!1;return Qte(n,o)===t})??null},mJi=(e)=>1-(1-e)**3,_Ji=(e,t,n)=>({a:e.a+(t.a-e.a)*n,b:e.b+(t.b-e.b)*n,c:e.c+(t.c-e.c)*n,d:e.d+(t.d-e.d)*n,e:e.e+(t.e-e.e)*n,f:e.f+(t.f-e.f)*n}),zio=(e)=>{if(e!==null)window.cancelAnimationFrame(e)},gJi=({startTransform:e,endTransform:t,durationMs:n,onUpdate:o,setAnimationFrameId:r,onComplete:i})=>{let s=performance.now(),a=(l)=>{let h=l-s,d=Math.min(1,h/n),u=mJi(d);if(o(_Ji(e,t,u)),d<1){r(window.requestAnimationFrame(a));return}r(null),i?.()},c=window.requestAnimationFrame(a);return r(c),c},rwe=(e)=>e?.trim()||null;function Umt({primitiveElement:e,elements:t}){let n=e.source_trace_id;if(!n)return null;let o=cT(t),r=o.source_trace.get(n),i=rwe(r?.name);if(i)return i;let s=o.source_net.get(n),a=rwe(s?.name);if(a)return a;for(let c of r?.connected_source_net_ids??[]){let l=rwe(o.source_net.get(c)?.name);if(l)return l}return null}function gao({primitiveElement:e,elements:t}){let n=cT(t).source_trace.get(e?.source_trace_id),o=e.trace_length,r=typeof o==="number",i=n?.max_length,s=r?`${o.toFixed(3)}${typeof i==="number"?` / ${i}`:""} mm`:"",a=Umt({primitiveElement:e,elements:t})??rwe(n?.display_name);if(!s&&!a)return null;let c=Boolean(r&&typeof i==="number"&&o>i);return{text:s,name:a,isOverLength:c}}function Nte(e,t){if(!e)return;let n=[];for(let o of[`${e.type}_id`,"pcb_port_id","pcb_trace_id","source_trace_id","source_net_id"]){let r=e[o];if(typeof r==="string")n.push(r)}for(let o of n){let r=t.getNetConnectedToId(o);if(r)return r}if("source_net_id"in e)return e.source_net_id}function Oio(e){return e&&["pcb_trace","pcb_smtpad","pcb_plated_hole","pcb_via","pcb_copper_pour"].includes(e.type)}function AJi(e,t,n){let o=e.type==="pcb_trace"?Umt({primitiveElement:e,elements:t}):null;if(o)return o;let r=Nte(e,n),i=r?t.filter((s)=>Nte(s,n)===r):[];for(let s of["source_net","source_trace"])for(let a of i)if(a.type===s&&"name"in a&&typeof a.name==="string"&&a.name.trim())return a.name.trim();if(e.type==="pcb_trace"){let s=gao({primitiveElement:e,elements:t})?.name;if(s)return s}for(let s of i)if(s.type==="source_trace"&&s.display_name?.trim())return s.display_name.trim();return"Net"}function fJi(e,t,n){return t.flatMap((o)=>{if(o.type!=="source_bus")return[];let r=[...new Set(o.source_trace_ids.flatMap((i)=>{let s=n.getNetConnectedToId(i);return s?[s]:[]}))];if(!r.includes(e))return[];return[{id:o.source_bus_id,name:o.name?.trim()||"Bus",netIds:r}]})}function yJi(e,t,n){let o=document.createElement("canvas");o.width=o.height=1;let r=o.getContext("2d");return e.filter((i)=>{if(i.type!=="pcb_copper_pour"||i.layer!==n)return!1;return ddt({ctx:r,pour:i,realToCanvasMat:fao.identity(),colorMap:Au}),r.isPointInPath(t.x,t.y,i.shape==="brep"?"evenodd":"nonzero")})}function xJi(e){return e.type==="pcb_copper_pour"}function Vio({canvas:e,elements:t,layers:n,realToCanvasMat:o,opacity:r=1}){let i=t.filter(xJi);if(i.length===0||r<=0)return;let s=new ai(e);s.configure({colorOverrides:{copper:Object.fromEntries(Object.entries(Au.copper).map(([a,c])=>[a,Aao.default(c).alpha(r).rgb().string()]))}}),s.realToCanvasMat=o,s.drawElements(i,{layers:n})}var CJi=async()=>{let{default:e}=await Promise.resolve().then(()=>(TKi(),pso));return new e};function bJi(e){let{elements:t,primitives:n,transform:o,width:r=500,height:i=500}=e,s=Lp.useRef(null),a=Lp.useRef(void 0),c=Lp.useRef(e.onRenderComplete),l=Lp.useRef({elements:t,sceneGeneration:0}),h=Lp.useRef(0),d=Lp.useRef(0),u=Lp.useRef(!1),[_,p]=Lp.useState(null),[m,A]=Lp.useState(),g=xa((L)=>L.selected_layer),f=xa((L)=>L.hidden_layer_opacity),y=xa((L)=>L.copper_pour_opacity),x=xa((L)=>L.is_showing_copper_pours),C=xa((L)=>L.is_showing_solder_mask),b=xa((L)=>L.is_showing_silkscreen),I=xa((L)=>L.is_showing_fabrication_notes),v=xa((L)=>L.is_showing_pcb_notes),P=xa((L)=>L.is_showing_courtyards),M=Lp.useMemo(()=>[...new Set(n.flatMap((L)=>{if(!L.is_mouse_over&&!L.is_in_highlighted_net)return[];let H=L._element,V=H?.[`${H.type}_id`];return V?[V]:[]}))],[n]),B=Lp.useMemo(()=>(e.xRayElements??[]).map((L)=>L[`${L.type}_id`]),[e.xRayElements]),T=Lp.useMemo(()=>({selectedLayer:g,hiddenLayerOpacity:f,copperPourOpacity:y,showCopperPours:x,showSolderMask:C,showSilkscreen:b,showFabricationNotes:I,showPcbNotes:v,showCourtyards:P,highlightedElementIds:M,xRayElementIds:B}),[g,f,y,x,C,b,I,v,P,M,B]),N=Lp.useRef(void 0);if(o){let L=typeof window>"u"?1:window.devicePixelRatio||1;N.current={type:"view",width:Math.max(1,Math.round(r*L)),height:Math.max(1,Math.round(i*L)),transform:{a:o.a*L,b:o.b*L,c:o.c*L,d:o.d*L,e:o.e*L,f:o.f*L},options:T}}Lp.useLayoutEffect(()=>{c.current=e.onRenderComplete},[e.onRenderComplete]),Lp.useLayoutEffect(()=>{let L=l.current.sceneGeneration+1;if(l.current={elements:t,sceneGeneration:L},!u.current||!a.current)return;h.current=L,a.current.postMessage({type:"scene",elements:t,sceneGeneration:L})},[t]),Lp.useEffect(()=>{let L=!1,H=!1,V,O=document.createElement("canvas");O.className="pcb-webgpu-canvas",O.style.cssText="position:absolute;inset:0;width:100%;height:100%;pointer-events:none",s.current?.append(O);let U=(Y)=>{if(L||H)return;if(H=!0,clearTimeout(j),O.remove(),u.current=!1,V?.terminate(),V=void 0,a.current=void 0,s.current)s.current.dataset.xRayNetActive="false";A(Y)},j=setTimeout(()=>U("WebGPU worker startup timed out"),15000);return(async()=>{try{if(!navigator.gpu||typeof Worker>"u"||!O.transferControlToOffscreen)throw Error("WebGPU workers are unavailable");if(V=await CJi(),L||H){V.terminate();return}a.current=V,V.onmessage=(X)=>{if(L||H)return;let K=X.data;if(K.type==="rendered"){if(K.sceneGeneration!==h.current)return;if(s.current)s.current.dataset.xRayNetActive=String(K.xRayActive);if(K.sceneGeneration===d.current)return;d.current=K.sceneGeneration,c.current?.()}else if(K.type==="error")U(K.message);else if(K.type==="ready"){clearTimeout(j),p(K.supportsXRayNet),u.current=!0;let J=l.current;if(h.current=J.sceneGeneration,V.postMessage({type:"scene",elements:J.elements,sceneGeneration:J.sceneGeneration}),N.current)V.postMessage(N.current)}},V.onerror=(X)=>{X.preventDefault(),U(X.message||"WebGPU worker failed")},V.addEventListener("messageerror",()=>{U("WebGPU worker communication failed")});let Y=O.transferControlToOffscreen();V.postMessage({type:"init",canvas:Y},[Y])}catch(Y){U(String(Y))}})(),()=>{L=!0,clearTimeout(j),u.current=!1,a.current=void 0,V?.terminate(),O.remove()}},[]),Lp.useEffect(()=>{if(u.current&&N.current)a.current?.postMessage(N.current)},[o,r,i,T]);let D=Boolean(e.xRayElements&&_===!1);return rv.jsx("div",{ref:s,"data-pcb-renderer":"webgpu","data-webgpu-error":m,style:{width:r,height:i,background:"black",position:"relative",overflow:"hidden"},children:m?rv.jsxs("div",{role:"alert",style:{padding:16,color:"white",position:"relative"},children:[rv.jsx("strong",{children:"WebGPU rendering failed"}),rv.jsx("div",{children:m})]}):rv.jsxs(rv.Fragment,{children:[rv.jsx(gme.SuperGrid,{textColor:"rgba(0,255,0,0.8)",majorColor:"rgba(0,255,0,0.4)",minorColor:"rgba(0,255,0,0.2)",screenSpaceCellSize:200,width:r,height:i,transform:o,stringifyCoord:(L,H,V)=>`${gme.toMMSI(L,V)}, ${gme.toMMSI(H,V)}`}),D&&rv.jsx("div",{role:"status",style:{padding:16,color:"white",position:"relative"},children:"X-Ray is unavailable in this WebGPU renderer."})]})})}var fr={"3d_viewer":{background_bottom:"rgb(102, 102, 128)",background_top:"rgb(204, 204, 230)",board:"rgb(51, 43, 23)",copper:"rgb(179, 156, 0)",silkscreen_bottom:"rgb(230, 230, 230)",silkscreen_top:"rgb(230, 230, 230)",soldermask:"rgb(20, 51, 36)",solderpaste:"rgb(128, 128, 128)"},board:{anchor:"rgb(255, 38, 226)",aux_items:"rgb(255, 255, 255)",b_adhes:"rgb(0, 0, 132)",b_crtyd:"rgb(38, 233, 255)",b_fab:"rgb(88, 93, 132)",b_mask:"rgba(2, 255, 238, 0.400)",b_paste:"rgb(0, 194, 194)",b_silks:"rgb(242, 237, 161)",background:"rgb(0, 16, 35)",cmts_user:"rgb(89, 148, 220)",copper:{b:"rgb(77, 127, 196)",f:"rgb(200, 52, 52)",in1:"rgb(127, 200, 127)",in10:"rgb(237, 124, 51)",in11:"rgb(91, 195, 235)",in12:"rgb(247, 111, 142)",in13:"rgb(167, 165, 198)",in14:"rgb(40, 204, 217)",in15:"rgb(232, 178, 167)",in16:"rgb(242, 237, 161)",in17:"rgb(237, 124, 51)",in18:"rgb(91, 195, 235)",in19:"rgb(247, 111, 142)",in2:"rgb(206, 125, 44)",in20:"rgb(167, 165, 198)",in21:"rgb(40, 204, 217)",in22:"rgb(232, 178, 167)",in23:"rgb(242, 237, 161)",in24:"rgb(237, 124, 51)",in25:"rgb(91, 195, 235)",in26:"rgb(247, 111, 142)",in27:"rgb(167, 165, 198)",in28:"rgb(40, 204, 217)",in29:"rgb(232, 178, 167)",in3:"rgb(79, 203, 203)",in30:"rgb(242, 237, 161)",in4:"rgb(219, 98, 139)",in5:"rgb(167, 165, 198)",in6:"rgb(40, 204, 217)",in7:"rgb(232, 178, 167)",in8:"rgb(242, 237, 161)",in9:"rgb(141, 203, 129)"},cursor:"rgb(255, 255, 255)",drc:"rgb(194, 194, 194)",drc_error:"rgba(215, 91, 107, 0.800)",drc_exclusion:"rgb(255, 255, 255)",drc_warning:"rgba(255, 208, 66, 0.902)",dwgs_user:"rgb(194, 194, 194)",eco1_user:"rgb(180, 219, 210)",eco2_user:"rgb(216, 200, 82)",edge_cuts:"rgb(208, 210, 205)",f_adhes:"rgb(132, 0, 132)",f_crtyd:"rgb(255, 0, 245)",f_fab:"rgb(175, 175, 175)",f_mask:"rgba(216, 100, 255, 0.400)",f_paste:"rgba(180, 160, 154, 0.902)",f_silks:"rgb(242, 237, 161)",footprint_text_back:"rgb(0, 0, 132)",footprint_text_front:"rgb(194, 194, 194)",footprint_text_invisible:"rgb(132, 132, 132)",grid:"rgb(132, 132, 132)",grid_axes:"rgb(194, 194, 194)",margin:"rgb(255, 38, 226)",microvia:"rgb(0, 132, 132)",no_connect:"rgb(0, 0, 132)",pad_back:"rgb(77, 127, 196)",pad_front:"rgb(200, 52, 52)",pad_plated_hole:"rgb(194, 194, 0)",pad_through_hole:"rgb(227, 183, 46)",plated_hole:"rgb(26, 196, 210)",ratsnest:"rgba(245, 255, 213, 0.702)",select_overlay:"rgb(4, 255, 67)",soldermaskWithCopper:{top:"rgb(18, 82, 50)",bottom:"rgb(77, 127, 196)"},soldermask:{top:"rgb(12, 55, 33)",bottom:"rgb(12, 55, 33)"},through_via:"rgb(236, 236, 236)",user_1:"rgb(194, 194, 194)",user_2:"rgb(89, 148, 220)",user_3:"rgb(180, 219, 210)",user_4:"rgb(216, 200, 82)",user_5:"rgb(194, 194, 194)",user_6:"rgb(89, 148, 220)",user_7:"rgb(180, 219, 210)",user_8:"rgb(216, 200, 82)",user_9:"rgb(232, 178, 167)",via_blind_buried:"rgb(187, 151, 38)",via_hole:"rgb(227, 183, 46)",via_micro:"rgb(0, 132, 132)",via_through:"rgb(236, 236, 236)",worksheet:"rgb(200, 114, 171)"},gerbview:{axes:"rgb(0, 0, 132)",background:"rgb(0, 0, 0)",dcodes:"rgb(255, 255, 255)",grid:"rgb(132, 132, 132)",layers:["rgb(132, 0, 0)","rgb(194, 194, 0)","rgb(194, 0, 194)","rgb(194, 0, 0)","rgb(0, 132, 132)","rgb(0, 132, 0)","rgb(0, 0, 132)","rgb(132, 132, 132)","rgb(132, 0, 132)","rgb(194, 194, 194)","rgb(132, 0, 132)","rgb(132, 0, 0)","rgb(132, 132, 0)","rgb(194, 194, 194)","rgb(0, 0, 132)","rgb(0, 132, 0)","rgb(132, 0, 0)","rgb(194, 194, 0)","rgb(194, 0, 194)","rgb(194, 0, 0)","rgb(0, 132, 132)","rgb(0, 132, 0)","rgb(0, 0, 132)","rgb(132, 132, 132)","rgb(132, 0, 132)","rgb(194, 194, 194)","rgb(132, 0, 132)","rgb(132, 0, 0)","rgb(132, 132, 0)","rgb(194, 194, 194)","rgb(0, 0, 132)","rgb(0, 132, 0)","rgb(132, 0, 0)","rgb(194, 194, 0)","rgb(194, 0, 194)","rgb(194, 0, 0)","rgb(0, 132, 132)","rgb(0, 132, 0)","rgb(0, 0, 132)","rgb(132, 132, 132)","rgb(132, 0, 132)","rgb(194, 194, 194)","rgb(132, 0, 132)","rgb(132, 0, 0)","rgb(132, 132, 0)","rgb(194, 194, 194)","rgb(0, 0, 132)","rgb(0, 132, 0)","rgb(132, 0, 0)","rgb(194, 194, 0)","rgb(194, 0, 194)","rgb(194, 0, 0)","rgb(0, 132, 132)","rgb(0, 132, 0)","rgb(0, 0, 132)","rgb(132, 132, 132)","rgb(132, 0, 132)","rgb(194, 194, 194)","rgb(132, 0, 132)","rgb(132, 0, 0)"],negative_objects:"rgb(132, 132, 132)",worksheet:"rgb(0, 0, 132)"},palette:["rgb(132, 0, 0)","rgb(194, 194, 0)","rgb(194, 0, 194)","rgb(194, 0, 0)","rgb(0, 132, 132)","rgb(0, 132, 0)","rgb(0, 0, 132)","rgb(132, 132, 132)","rgb(132, 0, 132)","rgb(194, 194, 194)","rgb(132, 0, 132)","rgb(132, 0, 0)","rgb(132, 132, 0)","rgb(194, 194, 194)","rgb(0, 0, 132)","rgb(0, 132, 0)"],schematic:{anchor:"rgb(0, 0, 255)",aux_items:"rgb(0, 0, 0)",background:"rgb(33, 33, 33)",brightened:"rgb(204, 204, 204)",bus:"rgb(0, 96, 192)",bus_junction:"rgb(0, 96, 192)",component_body:"rgb(44, 44, 44)",component_outline:"rgb(192, 0, 0)",cursor:"rgb(224, 224, 224)",erc_error:"rgba(192, 48, 48, 0.800)",erc_warning:"rgba(192, 140, 0, 0.800)",fields:"rgb(128, 0, 160)",grid:"rgb(60, 60, 60)",grid_axes:"rgb(60, 60, 60)",hidden:"rgb(194, 194, 194)",junction:"rgb(0, 160, 0)",label_global:"rgb(0, 160, 224)",label_hier:"rgb(160, 160, 0)",label_local:"rgb(192, 192, 192)",net_name:"rgb(224, 224, 224)",no_connect:"rgb(97, 43, 224)",note:"rgb(192, 192, 0)",override_item_colors:!1,pin:"rgb(192, 0, 0)",pin_name:"rgb(192, 192, 192)",pin_number:"rgb(192, 0, 0)",reference:"rgb(192, 192, 192)",shadow:"rgba(102, 179, 255, 0.800)",sheet:"rgb(128, 0, 160)",sheet_background:"rgba(255, 255, 255, 0.000)",sheet_fields:"rgb(160, 160, 0)",sheet_filename:"rgb(160, 160, 0)",sheet_label:"rgb(160, 160, 0)",sheet_name:"rgb(0, 160, 204)",value:"rgb(192, 192, 192)",wire:"rgb(0, 160, 0)",worksheet:"rgb(192, 0, 0)"}},C5=(e,t=1)=>{if(Math.abs(e.a)!==Math.abs(e.d))throw Error("Cannot scale non-uniformly");return t*Math.abs(e.a)},Yh={elementOverlay:40,dimensionOverlay:40,errorOverlay:40,pcbGroupOverlay:35,ratsNestOverlay:30,toolbarOverlay:70,warnings:30,topLayer:30,clickToInteractOverlay:100},Tme={red:"red",black:"black",green:"green",board:"rgb(255, 255, 255)",other:"#eee",top:fr.board.copper.f,inner1:fr.board.copper.in1,inner2:fr.board.copper.in2,inner3:fr.board.copper.in3,inner4:fr.board.copper.in4,inner5:fr.board.copper.in5,inner6:fr.board.copper.in6,inner7:fr.board.copper.in7,inner8:fr.board.copper.in8,bottom:fr.board.copper.b,drill:fr.board.anchor,keepout:fr.board.background,tkeepout:fr.board.b_crtyd,tplace:fr.board.b_silks,top_courtyard:fr.board.f_crtyd,bottom_courtyard:fr.board.b_crtyd,top_silkscreen:fr.board.f_silks,bottom_silkscreen:fr.board.b_silks,top_fabrication:fr.board.f_fab,bottom_fabrication:fr.board.b_fab,soldermask_top:fr.board.soldermask.top,soldermask_bottom:fr.board.soldermask.bottom,soldermask_with_copper_top:fr.board.soldermaskWithCopper.top,soldermask_with_copper_bottom:fr.board.soldermaskWithCopper.bottom,bottom_notes:fr.board.user_2,top_notes:fr.board.user_2,...fr.board},IJi=["board","bottom","soldermask_bottom","bottom_silkscreen","top","soldermask_top","bottom_courtyard","bottom_fabrication","top_courtyard","top_fabrication","edge_cuts","top_silkscreen"],vJi=class{canvasLayerMap;ctxLayerMap;aperture;transform;foregroundLayer="top";hiddenLayerOpacity=0.2;xRayNetActive=!1;lastPoint;constructor(e){this.canvasLayerMap=e,this.ctxLayerMap=Object.fromEntries(Object.entries(e).map(([t,n])=>[t,n.getContext("2d")])),this.transform=hd.identity(),this.transform.d*=-1,this.transform=hd.compose(this.transform,hd.translate(0,-500)),this.lastPoint={x:0,y:0},this.equip({})}clear(){for(let e of Object.values(this.ctxLayerMap))e.clearRect(0,0,e.canvas.width,e.canvas.height)}equip(e){this.aperture={fontSize:0,shape:"circle",mode:"add",size:0,color:"red",layer:"top",opacity:this.foregroundLayer===e.color?1:0.5,...e}}drawMeshPattern(e,t,n,o,r,i=45){let s=this.getLayerCtx(),[a,c]=hd.applyToPoint(this.transform,[e,t]),[l,h]=hd.applyToPoint(this.transform,[e+n,t+o]),d=C5(this.transform,r);s.lineWidth=1,s.strokeStyle=this.aperture.color;let u=(_)=>{let p=Math.sin(_),m=Math.cos(_),A=Math.sqrt((l-a)**2+(h-c)**2);for(let g=-A;g<=A;g+=d)s.beginPath(),s.moveTo(a+g*m-A*p,c+g*p+A*m),s.lineTo(a+g*m+A*p,c+g*p-A*m),s.stroke()};u(i*Math.PI/180),u((i+90)*Math.PI/180)}rect({x:e,y:t,w:n,h:o,mesh_fill:r,is_filled:i=!0,has_stroke:s,is_stroke_dashed:a,stroke_width:c,roundness:l}){let[h,d]=hd.applyToPoint(this.transform,[e-n/2,t-o/2]),[u,_]=hd.applyToPoint(this.transform,[e+n/2,t+o/2]);this.applyAperture();let p=this.getLayerCtx(),m=l?C5(this.transform,l):0,A=s===void 0?i===!1:s;if(r){if(p.save(),p.beginPath(),m>0&&p.roundRect)p.roundRect(h,d,u-h,_-d,m);else p.rect(h,d,u-h,_-d);if(p.clip(),this.drawMeshPattern(e-n/2,t-o/2,n,o,0.15),p.restore(),m>0&&p.roundRect)p.beginPath(),p.roundRect(h,d,u-h,_-d,m),p.stroke();else p.strokeRect(h,d,u-h,_-d)}else{if(i!==!1)if(m>0&&p.roundRect)p.beginPath(),p.roundRect(h,d,u-h,_-d,m),p.fill();else p.fillRect(h,d,u-h,_-d);if(A){let g=p.lineWidth;if(c!==void 0)p.lineWidth=C5(this.transform,c);if(a){let f=[],y=Math.abs(this.transform.a);if(y>0){let C=0.1*y,b=C*1.3;if(C>0.5)f=[C,b]}p.setLineDash(f)}if(m>0&&p.roundRect)p.beginPath(),p.roundRect(h,d,u-h,_-d,m),p.stroke();else p.strokeRect(h,d,u-h,_-d);if(a)p.setLineDash([]);if(c!==void 0)p.lineWidth=g}}}rotatedRect(e,t,n,o,r,i,s){let a=this.getLayerCtx();this.applyAperture();let[c,l]=hd.applyToPoint(this.transform,[e-n/2,t-o/2]),[h,d]=hd.applyToPoint(this.transform,[e+n/2,t+o/2]),u=i?C5(this.transform,i):0;a.save();let[_,p]=hd.applyToPoint(this.transform,[e,t]);a.translate(_,p);let m=360-r;if(r)a.rotate(m*Math.PI/180);if(a.translate(-_,-p),s){if(a.beginPath(),u>0&&a.roundRect)a.roundRect(c,l,h-c,d-l,u);else a.rect(c,l,h-c,d-l);if(a.clip(),this.drawMeshPattern(e-n/2,t-o/2,n,o,0.15),u>0&&a.roundRect)a.beginPath(),a.roundRect(c,l,h-c,d-l,u),a.stroke();else a.strokeRect(c,l,h-c,d-l)}else if(u>0&&a.roundRect)a.beginPath(),a.roundRect(c,l,h-c,d-l,u),a.fill();else a.fillRect(c,l,h-c,d-l);a.restore()}rotatedPill(e,t,n,o,r){let i=this.getLayerCtx();this.applyAperture(),i.save();let[s,a]=hd.applyToPoint(this.transform,[e,t]);i.translate(s,a);let c=360-r;if(r)i.rotate(c*Math.PI/180);i.translate(-s,-a),this.pill(e,t,n,o),i.restore()}circle(e,t,n,o,r=!0){let i=C5(this.transform,n),[s,a]=hd.applyToPoint(this.transform,[e,t]);this.applyAperture();let c=this.getLayerCtx();if(o)c.save(),c.beginPath(),c.arc(s,a,i,0,2*Math.PI),c.clip(),this.drawMeshPattern(e-n,t-n,n*2,n*2,0.15),c.restore(),c.beginPath(),c.arc(s,a,i,0,2*Math.PI),c.stroke();else c.beginPath(),c.arc(s,a,i,0,2*Math.PI),c.fill()}oval(e,t,n,o){let r=C5(this.transform,n),i=C5(this.transform,o),[s,a]=hd.applyToPoint(this.transform,[e,t]);this.applyAperture();let c=this.getLayerCtx();c.beginPath(),c.ellipse(s,a,r,i,0,0,2*Math.PI),c.fill(),c.closePath()}pill(e,t,n,o){let[r,i]=hd.applyToPoint(this.transform,[e-n/2,t+o/2]),s=C5(this.transform,n),a=C5(this.transform,o),c=Math.min(s,a)/2;this.applyAperture();let l=this.getLayerCtx();l.beginPath(),l.arc(r+c,i+c,c,Math.PI,Math.PI*1.5),l.arc(r+s-c,i+c,c,Math.PI*1.5,0),l.arc(r+s-c,i+a-c,c,0,Math.PI*0.5),l.arc(r+c,i+a-c,c,Math.PI*0.5,Math.PI),l.fill(),l.closePath()}polygon(e){if(e.length<3)return;this.applyAperture();let t=this.getLayerCtx(),n=e.map((r)=>hd.applyToPoint(this.transform,[r.x,r.y]));t.beginPath(),t.moveTo(n[0][0],n[0][1]);for(let r=1;r<n.length;r++)t.lineTo(n[r][0],n[r][1]);t.closePath(),t.fill("evenodd");let o=C5(this.transform,this.aperture.size);if(o>0)t.lineWidth=o,t.stroke()}debugText(e,t,n){let[o,r]=hd.applyToPoint(this.transform,[t,n]);this.applyAperture();let i=this.getLayerCtx();i.font="10px sans-serif",i.fillText(e,o,r)}getLayerCtx(){let e=this.ctxLayerMap[this.aperture.layer];if(!e)throw Error(`No context for layer "${this.aperture.layer}"`);return e}getLayerOpacity(e){if(this.xRayNetActive)return/^(top|bottom|inner\d+)$/.test(e)?this.hiddenLayerOpacity:0;let t=this.foregroundLayer,n=(t==="top"||t==="bottom")&&(e.startsWith(`${t}_`)||e.endsWith(`_${t}`)),o=["board","drill","edge_cuts","other"].includes(e);return e===t||n||o?1:this.hiddenLayerOpacity}orderAndFadeLayers(){let{canvasLayerMap:e,foregroundLayer:t}=this,o=["board",...Object.keys(e).filter((d)=>/^inner\d+$/.test(d)).sort((d,u)=>Number(u.slice(5))-Number(d.slice(5))),...IJi.filter((d)=>d!=="board")],r=t==="top"?"soldermask_top":t==="bottom"?"soldermask_bottom":void 0,i=t==="top"?"top_silkscreen":t==="bottom"?"bottom_silkscreen":void 0,s=t==="top"?"top_notes":t==="bottom"?"bottom_notes":void 0,a=t==="top"?"top_fabrication":t==="bottom"?"bottom_fabrication":void 0,c=t==="top"?"top_courtyard":t==="bottom"?"bottom_courtyard":void 0,l=[t,"edge_cuts",...r?[r]:[],...i?[i]:[],...s?[s]:[],...a?[a]:[],...c?[c]:[]],h=[...o.filter((d)=>!l.includes(d)),...t==="drill"?[]:[t],...r?[r]:[],"edge_cuts",...i?[i]:[],...s?[s]:[],...a?[a]:[],...c?[c]:[],"drill"];h.forEach((d,u)=>{let _=e[d];if(!_)return;_.style.zIndex=`${Yh.topLayer-(h.length-u)}`});for(let[d,u]of Object.entries(e)){let _=this.getLayerOpacity(d);u.style.opacity=String(_),u.style.display=_===0?"none":""}}applyAperture(){let{transform:e,aperture:t}=this,{size:n,mode:o,color:r,fontSize:i,layer:s}=t;if(!(s in this.ctxLayerMap))this.aperture.layer="other";let a=this.getLayerCtx();if(!a)throw Error(`No context for layer "${this.foregroundLayer}"`);if(!r)r="undefined";if(a.lineWidth=C5(e,n),a.lineCap="round",o==="add"){a.globalCompositeOperation="source-over";let c=Tme[r.toLowerCase()];if(!c)try{c=yao.default(r).rgb().toString()}catch(l){console.warn(`Invalid color format: '${r}'`),c="white"}a.fillStyle=c,a.strokeStyle=c}else a.globalCompositeOperation="destination-out",a.fillStyle="rgba(0,0,0,1)",a.strokeStyle="rgba(0,0,0,1)";a.font=`${C5(hd.inverse(e),i)}px sans-serif`}moveTo(e,t){this.lastPoint={x:e,y:t}}lineTo(e,t){let[n,o]=hd.applyToPoint(this.transform,[e,t]),{size:r,shape:i,mode:s}=this.aperture,a=C5(this.transform,r),{lastPoint:c}=this,l=hd.applyToPoint(this.transform,c);this.applyAperture();let h=this.getLayerCtx();if(i==="square")h.fillRect(l.x-a/2,l.y-a/2,a,a);if(h.beginPath(),h.moveTo(l.x,l.y),h.lineTo(n,o),h.stroke(),h.closePath(),i==="square")h.fillRect(n-a/2,o-a/2,a,a);this.lastPoint={x:e,y:t}}polygonWithArcs(e){let t=this.getLayerCtx(),n=(o)=>{if(o.vertices.length===0)return;let r=o.vertices[0],i=hd.applyToPoint(this.transform,[r.x,r.y]);t.moveTo(i[0],i[1]);for(let s=0;s<o.vertices.length;s++){let a=o.vertices[s],c=o.vertices[(s+1)%o.vertices.length];if(a.bulge&&a.bulge!==0){let l=a.bulge,h=c.x-a.x,d=c.y-a.y,u=Math.sqrt(h*h+d*d);if(u<0.000000001){let T=hd.applyToPoint(this.transform,[c.x,c.y]);t.lineTo(T[0],T[1]);continue}let _=4*Math.atan(l),p=Math.abs(u/(2*Math.sin(_/2))),m=(a.x+c.x)/2,A=(a.y+c.y)/2,g=h/u,y=-(d/u),x=g,C=Math.sqrt(Math.max(0,p*p-(u/2)**2)),b=m+C*y*Math.sign(l),I=A+C*x*Math.sign(l),v=Math.atan2(a.y-I,a.x-b),P=Math.atan2(c.y-I,c.x-b);if(l>0&&P<v)P+=2*Math.PI;else if(l<0&&P>v)P-=2*Math.PI;let M=hd.applyToPoint(this.transform,[b,I]),B=C5(this.transform,p);t.arc(M[0],M[1],B,-v,-P,l>0)}else{let l=hd.applyToPoint(this.transform,[c.x,c.y]);t.lineTo(l[0],l[1])}}t.closePath()};if(t.beginPath(),n(e.outer_ring),e.inner_rings)for(let o of e.inner_rings)n(o);t.fill("evenodd")}},SJi=(e=2)=>{let t=Math.max(2,Math.min(10,Math.floor(e)));return["top",...Array.from({length:t-2},(n,o)=>`inner${o+1}`),"bottom"]},fwe=(e)=>{let t=e.find((n)=>n.type==="pcb_board");return SJi(t?.num_layers??2)},vmt=(e)=>`${e}_copper`,xao=(e)=>e.map((t)=>t.endsWith("_copper")?t.slice(0,-7):t),PJi=(e)=>["board","bottom","soldermask_bottom","bottom_silkscreen","top","soldermask_top","soldermask_with_copper_bottom","soldermask_with_copper_top","top_fabrication","bottom_fabrication",...fwe(e).filter((n)=>n.startsWith("inner")),"drill","edge_cuts","bottom_notes","top_notes","top_silkscreen","top_courtyard","bottom_courtyard","other"],EJi=(e,t)=>{let n=fwe(e).reverse();return[...n.filter((o)=>o!==t),...n.filter((o)=>o===t)]},MJi={...Au,courtyard:{top:fr.board.f_crtyd,bottom:fr.board.b_crtyd}};function wJi(e){return e.type==="pcb_courtyard_circle"||e.type==="pcb_courtyard_rect"||e.type==="pcb_courtyard_outline"}function Yio({canvas:e,elements:t,layers:n,realToCanvasMat:o}){let r=new ai(e);r.configure({colorOverrides:MJi}),r.realToCanvasMat=o;let i=t.filter(wJi);r.drawElements(i,{layers:n})}var BJi={...Au,silkscreen:{top:fr.board.f_fab,bottom:fr.board.b_fab}};function TJi(e){return e.type.includes("pcb_fabrication_note")}function Gio({canvas:e,elements:t,layers:n,realToCanvasMat:o}){let r=new ai(e);r.configure({colorOverrides:BJi}),r.realToCanvasMat=o;let i=t.filter(TJi);r.drawElements(i,{layers:n})}function DJi(e){return e.type==="pcb_hole"}function NJi({canvas:e,elements:t,layers:n,realToCanvasMat:o,drawSoldermask:r}){let i=new ai(e);i.realToCanvasMat=o;let s=t.filter(DJi);i.drawElements(s,{layers:n,drawSoldermask:r})}function RJi(e){return e.type==="pcb_board"}function Cao({canvas:e,elements:t,layers:n,realToCanvasMat:o,drawSoldermask:r}){let i=new ai(e);i.realToCanvasMat=o;let s=t.filter(RJi);for(let a of s)i.drawElements([a],{layers:n,drawSoldermask:!1,drawBoardMaterial:r??!1,minBoardOutlineStrokePx:2})}function QJi(e){return e.type==="pcb_copper_text"}function kJi({canvas:e,elements:t,layers:n,realToCanvasMat:o}){let r=t.filter(QJi);if(r.length===0)return;let i=new ai(e);i.realToCanvasMat=o,i.drawElements(r,{layers:n})}function LJi(e){return e.type==="pcb_cutout"}function HJi({canvas:e,elements:t,layers:n,realToCanvasMat:o}){let r=new ai(e);r.realToCanvasMat=o;let i=t.filter(LJi);r.drawElements(i,{layers:n})}function FJi(e){return e.type==="pcb_keepout"}function zJi({elements:e,layer:t}){return e.filter(FJi).filter((n)=>n.layers.includes(t))}function OJi(e){return bao.default(Tme[e]).lighten(0.4).hex()}function VJi({canvas:e,elements:t,layer:n,realToCanvasMat:o}){let r=zJi({elements:t,layer:n});if(r.length===0)return;let i=new ai(e),s=OJi(n);i.configure({colorOverrides:{keepout:{top:s,bottom:s}}}),i.realToCanvasMat=o,i.drawElements(r,{layers:[vmt(n)]})}function YJi(e){return e.type.startsWith("pcb_note_")}function Uio({canvas:e,elements:t,layers:n,realToCanvasMat:o}){let r=new ai(e);r.realToCanvasMat=o;let i=t.filter(YJi);r.drawElements(i,{layers:n})}function GJi(e){return e.type==="pcb_panel"}function UJi({canvas:e,elements:t,layers:n,realToCanvasMat:o,drawSoldermask:r}){let i=new ai(e);i.realToCanvasMat=o;let s=t.filter(GJi);for(let a of s)i.drawElements([a],{layers:n})}var WJi={...Au,copper:{...Au.copper,top:ev.default(fr.board.pad_front).lighten(0.5).toString(),bottom:ev.default(fr.board.pad_back).lighten(0.5).toString(),inner1:ev.default(fr.board.copper.in1).lighten(0.5).toString(),inner2:ev.default(fr.board.copper.in2).lighten(0.5).toString(),inner3:ev.default(fr.board.copper.in3).lighten(0.5).toString(),inner4:ev.default(fr.board.copper.in4).lighten(0.5).toString(),inner5:ev.default(fr.board.copper.in5).lighten(0.5).toString(),inner6:ev.default(fr.board.copper.in6).lighten(0.5).toString(),inner7:ev.default(fr.board.copper.in7).lighten(0.5).toString(),inner8:ev.default(fr.board.copper.in8).lighten(0.5).toString()}};function XJi(e){return e.type==="pcb_smtpad"}function Wio({canvas:e,elements:t,layers:n,realToCanvasMat:o,primitives:r,drawSoldermask:i}){let s=new Set(xao(n)),a=t.filter(XJi).filter((d)=>s.has(d.layer));if(a.length===0)return;let c=new Set;if(r){for(let d of r)if((d.is_mouse_over||d.is_in_highlighted_net)&&d._element?.type==="pcb_smtpad")c.add(d._element.pcb_smtpad_id)}let l=a.filter((d)=>c.has(d.pcb_smtpad_id)),h=a.filter((d)=>!c.has(d.pcb_smtpad_id));if(h.length>0){let d=new ai(e);d.realToCanvasMat=o,d.drawElements(h,{layers:n,drawSoldermask:i})}if(l.length>0){let d=new ai(e);d.configure({colorOverrides:WJi}),d.realToCanvasMat=o,d.drawElements(l,{layers:n,drawSoldermask:i})}}var jJi={...Au,copper:Object.fromEntries(Object.entries(Au.copper).map(([e,t])=>[e,Iao.default(t).lighten(0.5).toString()]))};function KJi(e){return e.type==="pcb_trace"}var $Ji=(e,t)=>{let n=e.route.filter((i)=>{if(i.route_type==="wire"&&"layer"in i&&t.has(i.layer))return!0;if(i.route_type==="via")return t.has(i.from_layer)||t.has(i.to_layer);return!1}),o=n.filter((i)=>i.route_type==="wire").length,r=n.some((i)=>i.route_type==="via");if(o<2&&!r)return null;return{...e,route:n}},qJi=(e)=>({...e,route:e.route.map((t)=>{if(!("is_inside_copper_pour"in t)||t.is_inside_copper_pour!==!0)return t;return{...t,is_inside_copper_pour:!1}})}),JJi=(e,t)=>t?e:e.filter((n)=>n.type!=="pcb_copper_pour"),ZJi=({primitives:e})=>{let t=new Set;for(let n of e)if((n.is_mouse_over||n.is_in_highlighted_net)&&n._element?.type==="pcb_trace")t.add(n._element.pcb_trace_id);return t};function Xio({canvas:e,elements:t,layers:n,realToCanvasMat:o,primitives:r,showCopperPours:i}){let s=new Set(xao(n)),a=t.filter(KJi).map((u)=>$Ji(u,s)).filter((u)=>u!==null).map((u)=>i?u:qJi(u));if(a.length===0)return;let c=ZJi({primitives:r??[]}),l=[],h=[];for(let u of a)if(c.has(u.pcb_trace_id))l.push(u);else h.push(u);let d=JJi(t,i);if(h.length>0){let u=new ai(e);u.realToCanvasMat=o,u.drawElements(h,{layers:n,clipContextElements:d})}if(l.length>0){let u=new ai(e);u.configure({colorOverrides:jJi}),u.realToCanvasMat=o,u.drawElements(l,{layers:n,clipContextElements:d})}}var eZi={...Au,copper:{...Au.copper,top:tv.default(fr.board.pad_front).lighten(0.5).toString(),bottom:tv.default(fr.board.pad_back).lighten(0.5).toString(),inner1:tv.default(fr.board.copper.in1).lighten(0.5).toString(),inner2:tv.default(fr.board.copper.in2).lighten(0.5).toString(),inner3:tv.default(fr.board.copper.in3).lighten(0.5).toString(),inner4:tv.default(fr.board.copper.in4).lighten(0.5).toString(),inner5:tv.default(fr.board.copper.in5).lighten(0.5).toString(),inner6:tv.default(fr.board.copper.in6).lighten(0.5).toString(),inner7:tv.default(fr.board.copper.in7).lighten(0.5).toString(),inner8:tv.default(fr.board.copper.in8).lighten(0.5).toString()}};function tZi(e){return e.type==="pcb_plated_hole"}function jio({canvas:e,elements:t,layers:n,realToCanvasMat:o,primitives:r,drawSoldermask:i}){let s=t.filter(tZi);if(s.length===0)return;let a=new Set;if(r){for(let h of r)if((h.is_mouse_over||h.is_in_highlighted_net)&&h._element?.type==="pcb_plated_hole")a.add(h._element.pcb_plated_hole_id)}let c=s.filter((h)=>a.has(h.pcb_plated_hole_id)),l=s.filter((h)=>!a.has(h.pcb_plated_hole_id));if(l.length>0){let h=new ai(e);h.realToCanvasMat=o,h.drawElements(l,{layers:n,drawSoldermask:i})}if(c.length>0){let h=new ai(e);h.configure({colorOverrides:eZi}),h.realToCanvasMat=o,h.drawElements(c,{layers:n,drawSoldermask:i})}}function vao(e){let{lines:t,anchorPoint:n,ccwRotation:o}=e;if(!o)return t;let r=o*Math.PI/180,i=w3.rotate(r),s=w3.compose(w3.translate(n.x,n.y),i,w3.translate(-n.x,-n.y));return w3.applyToPoint(s,n),t.map((a)=>({...a,x1:w3.applyToPoint(s,{x:a.x1,y:a.y1}).x,y1:w3.applyToPoint(s,{x:a.x1,y:a.y1}).y,x2:w3.applyToPoint(s,{x:a.x2,y:a.y2}).x,y2:w3.applyToPoint(s,{x:a.x2,y:a.y2}).y}))}var nZi=0.6,Kio=0.2,Sao=(e)=>{let t=e.size*0.7,n=t*nZi,o=t*Kio,r=t*Kio,i=e.text.split(/\r?\n/),s=e.text.length>0&&t>0,a=s?i.length:0,c=s?i.map((d)=>{if(d.length===0)return 0;return d.length*n+(d.length-1)*o}):[],l=c.length>0?Math.max(...c):0,h=a>0?a*t+(a-1)*r:0;return{text_lines:i,line_count:a,line_widths:c,target_height:t,target_width_char:n,space_between_chars:o,space_between_lines:r,width:l,height:h}},Pao=(e)=>{let t=Sao(e);return{width:t.width,height:t.height,lineHeight:t.target_height,lineSpacing:t.space_between_lines,lineCount:t.line_count}},Eao=(e)=>{let{text_lines:t,line_count:n,line_widths:o,target_height:r,target_width_char:i,space_between_chars:s,space_between_lines:a,width:c}=Sao(e);if(r<=0||n===0)return[];let l=r/12,h=[];for(let d=0;d<n;d++){let u=-d*(r+a),_=o[d],p=(c-_)/2,m=e.x+p;for(let A=0;A<t[d].length;A++){let g=t[d][A],f=Ax[g]??Ax[g.toUpperCase()];if(!f){m+=i+s;continue}for(let{x1:y,y1:x,x2:C,y2:b}of f)h.push({_pcb_drawing_object_id:sv("line"),pcb_drawing_type:"line",x1:m+i*y,y1:e.y+u+r*x,x2:m+i*C,y2:e.y+u+r*b,width:l,layer:e.layer,unit:e.unit,color:e.color});m+=i+s}}return h};function WP(e){let n=e.color??Tme[e.layer],o=Mao.default(n);if(e._element?.type==="pcb_copper_pour")o=o.alpha(0.7);if(e.is_mouse_over||e.is_in_highlighted_net)return o.lighten(0.5).rgb().toString();return o.rgb().toString()}var wao=(e,t)=>{e.equip({size:t.zoomIndependent?t.width/e.transform.a:t.width,shape:t.squareCap?"square":"circle",color:WP(t),layer:t.layer}),e.moveTo(t.x1,t.y1),e.lineTo(t.x2,t.y2)},oZi=(e,t,n)=>{switch(n){case"top_left":return{x:0,y:-t};case"top_center":return{x:-e/2,y:-t};case"top_right":return{x:-e,y:-t};case"center_left":return{x:0,y:-t/2};case"center":return{x:-e/2,y:-t/2};case"center_right":return{x:-e,y:-t/2};case"bottom_left":return{x:0,y:0};case"bottom_center":return{x:-e/2,y:0};case"bottom_right":return{x:-e,y:0};default:return{x:0,y:0}}},Bao=(e)=>{if(e.layer==="bottom_silkscreen"||e.layer==="bottom")return e.is_mirrored!==!1;return e.is_mirrored===!0},rZi=(e,t)=>{e.equip({fontSize:t.size,color:WP(t),layer:t.layer});let{width:n,height:o}=Pao(t),r=oZi(n,o,t.align);t.x??=0,t.y??=0;let i={x:t.x,y:t.y},s=Eao({...t,x:t.x+r.x,y:t.y+r.y});if(Bao(t))s=s.map((a)=>({...a,x1:2*t.x-a.x1,x2:2*t.x-a.x2}));if(t.ccw_rotation){let a={lines:s,anchorPoint:i,ccwRotation:t.ccw_rotation};s=vao(a)}for(let a of s)wao(e,a)},iZi=(e,t)=>{let{width:n,height:o,lineHeight:r}=Pao(t);t.x??=0,t.y??=0;let i=t.knockout_padding??{left:t.size*0.5,right:t.size*0.5,top:t.size*0.3,bottom:t.size*0.3},s=n+i.left+i.right,a=o+i.top+i.bottom,c=n/2,l=r-o/2,h=t.x-c,d=t.y-l,u={x:t.x,y:t.y},_={_pcb_drawing_object_id:`knockout_rect_${t._pcb_drawing_object_id}`,pcb_drawing_type:"rect",x:t.x,y:t.y,w:s,h:a,layer:t.layer,ccw_rotation:t.ccw_rotation};if(t.ccw_rotation)Dao(e,_);else Tao(e,_);let p=Eao({...t,x:h,y:d});if(Bao(t))p=p.map((m)=>({...m,x1:2*t.x-m.x1,x2:2*t.x-m.x2}));if(t.ccw_rotation){let m={lines:p,anchorPoint:u,ccwRotation:t.ccw_rotation};p=vao(m)}for(let m of p)e.equip({size:m.width,shape:"circle",color:"black",layer:t.layer,mode:"subtract"}),e.moveTo(m.x1,m.y1),e.lineTo(m.x2,m.y2);e.equip({mode:"add"})},Tao=(e,t)=>{e.equip({color:WP(t),layer:t.layer,size:t.stroke_width}),e.rect({x:t.x,y:t.y,w:t.w,h:t.h,mesh_fill:t.mesh_fill,is_filled:t.is_filled,has_stroke:t.has_stroke,is_stroke_dashed:t.is_stroke_dashed,stroke_width:t.stroke_width,roundness:t.roundness})},Dao=(e,t)=>{e.equip({color:WP(t),layer:t.layer}),e.rotatedRect(t.x,t.y,t.w,t.h,t.ccw_rotation,t.roundness,t.mesh_fill)},sZi=(e,t)=>{e.equip({color:WP(t),layer:t.layer}),e.rotatedPill(t.x,t.y,t.w,t.h,t.ccw_rotation)},aZi=(e,t)=>{e.equip({color:WP(t),layer:t.layer}),e.circle(t.x,t.y,t.r,t.mesh_fill)},cZi=(e,t)=>{e.equip({color:WP(t),layer:t.layer}),e.oval(t.x,t.y,t.rX,t.rY)},lZi=(e,t)=>{e.equip({color:WP(t),layer:t.layer}),e.pill(t.x,t.y,t.w,t.h)},hZi=(e,t)=>{e.equip({color:WP(t),layer:t.layer}),e.polygon(t.points)},dZi=(e,t)=>{e.equip({color:WP(t),layer:t.layer}),e.polygonWithArcs(t.brep_shape)},uZi=(e,t)=>{switch(t.pcb_drawing_type){case"line":return wao(e,t);case"text":if(t.is_knockout)return iZi(e,t);return rZi(e,t);case"rect":{if(t.ccw_rotation)return Dao(e,t);return Tao(e,t)}case"circle":return aZi(e,t);case"oval":return cZi(e,t);case"pill":if(t.ccw_rotation)return sZi(e,t);return lZi(e,t);case"polygon":return hZi(e,t);case"polygon_with_arcs":return dZi(e,t)}},pZi=(e,t)=>{for(let n of t)uZi(e,n)},mZi={...Au,silkscreen:{top:fr.board.f_silks,bottom:fr.board.b_silks}};function _Zi(e){return e.type.includes("pcb_silkscreen")}function $io({canvas:e,elements:t,layers:n,realToCanvasMat:o}){let r=new ai(e);r.configure({colorOverrides:mZi}),r.realToCanvasMat=o;let i=t.filter(_Zi);r.drawElements(i,{layers:n})}var gZi={...Au,copper:{...Au.copper,top:E3.default(fr.board.pad_front).lighten(0.5).toString(),bottom:E3.default(fr.board.pad_back).lighten(0.5).toString(),inner1:E3.default(fr.board.copper.in1).lighten(0.5).toString(),inner2:E3.default(fr.board.copper.in2).lighten(0.5).toString(),inner3:E3.default(fr.board.copper.in3).lighten(0.5).toString(),inner4:E3.default(fr.board.copper.in4).lighten(0.5).toString(),inner5:E3.default(fr.board.copper.in5).lighten(0.5).toString(),inner6:E3.default(fr.board.copper.in6).lighten(0.5).toString(),inner7:E3.default(fr.board.copper.in7).lighten(0.5).toString(),inner8:E3.default(fr.board.copper.in8).lighten(0.5).toString()},soldermask:{...Au.soldermask,top:E3.default(fr.board.soldermask.top).lighten(0.35).toString(),bottom:E3.default(fr.board.soldermask.bottom).lighten(0.35).toString()}};function qio({canvas:e,elements:t,layers:n,realToCanvasMat:o,drawSoldermaskTop:r,drawSoldermaskBottom:i,primitives:s}){let a=new ai(e);a.realToCanvasMat=o;let c=t.filter((u)=>u.type==="pcb_board");if(a.drawElements(t,{layers:n,drawSoldermask:!0,drawSoldermaskTop:r,drawSoldermaskBottom:i,drawBoardMaterial:!1}),c.length>1)Cao({canvas:e,elements:c,layers:[],realToCanvasMat:o,drawSoldermask:!1});if(!s)return;let l=new Set;for(let u of s){if(!(u.is_mouse_over||u.is_in_highlighted_net))continue;let _=u._element;if(_?.type==="pcb_smtpad")l.add(_.pcb_smtpad_id);else if(_?.type==="pcb_plated_hole")l.add(_.pcb_plated_hole_id);else if(_?.type==="pcb_via")l.add(_.pcb_via_id)}if(l.size===0)return;let h=t.filter((u)=>{if(u.type==="pcb_smtpad")return l.has(u.pcb_smtpad_id);if(u.type==="pcb_plated_hole")return l.has(u.pcb_plated_hole_id);if(u.type==="pcb_via")return l.has(u.pcb_via_id);return!1});if(h.length===0)return;let d=new ai(e);d.configure({colorOverrides:gZi}),d.realToCanvasMat=o,d.drawElements(h,{layers:n,clipContextElements:t,drawSoldermask:!0,drawSoldermaskTop:r,drawSoldermaskBottom:i,drawBoardMaterial:!1})}var AZi={...Au,copper:{...Au.copper,top:nv.default(fr.board.pad_front).lighten(0.5).toString(),bottom:nv.default(fr.board.pad_back).lighten(0.5).toString(),inner1:nv.default(fr.board.copper.in1).lighten(0.5).toString(),inner2:nv.default(fr.board.copper.in2).lighten(0.5).toString(),inner3:nv.default(fr.board.copper.in3).lighten(0.5).toString(),inner4:nv.default(fr.board.copper.in4).lighten(0.5).toString(),inner5:nv.default(fr.board.copper.in5).lighten(0.5).toString(),inner6:nv.default(fr.board.copper.in6).lighten(0.5).toString(),inner7:nv.default(fr.board.copper.in7).lighten(0.5).toString(),inner8:nv.default(fr.board.copper.in8).lighten(0.5).toString()}};function fZi(e){return e.type==="pcb_via"}function Jio({canvas:e,elements:t,layers:n,realToCanvasMat:o,primitives:r,drawSoldermask:i}){let s=t.filter(fZi).filter((h)=>n.some((d)=>d.includes("copper")));if(s.length===0)return;let a=new Set;if(r){for(let h of r)if((h.is_mouse_over||h.is_in_highlighted_net)&&h._element?.type==="pcb_via")a.add(h._element.pcb_via_id)}let c=s.filter((h)=>a.has(h.pcb_via_id)),l=s.filter((h)=>!a.has(h.pcb_via_id));if(l.length>0){let h=new ai(e);h.realToCanvasMat=o,h.drawElements(l,{layers:n,drawSoldermask:i,drawSoldermaskTop:n.includes("top_copper"),drawSoldermaskBottom:n.includes("bottom_copper"),clipContextElements:t})}if(c.length>0){let h=new ai(e);h.configure({colorOverrides:AZi}),h.realToCanvasMat=o,h.drawElements(c,{layers:n,drawSoldermask:i,drawSoldermaskTop:n.includes("top_copper"),drawSoldermaskBottom:n.includes("bottom_copper"),clipContextElements:t})}}var yZi=({primitives:e,isShowingSolderMask:t,isShowingSilkscreen:n,isShowingFabricationNotes:o})=>e.filter((r)=>t||!r.layer?.includes("soldermask")).filter((r)=>n||!r.layer?.includes("silkscreen")).filter((r)=>o||!r.layer?.includes("fabrication")).filter((r)=>r.layer!=="board").filter((r)=>r._element?.type!=="pcb_smtpad").filter((r)=>r._element?.type!=="pcb_plated_hole"||r.layer==="drill").filter((r)=>r._element?.type!=="pcb_via").filter((r)=>r._element?.type!=="pcb_trace").filter((r)=>r._element?.type!=="pcb_copper_text"),xZi=({primitives:e,elements:t,circuitJson:n,xRayElements:o,transform:r,grid:i,width:s=500,height:a=500,onRenderComplete:c})=>{let l=QL.useRef(null),h=QL.useRef({}),d=QL.useRef(c),u=QL.useRef(void 0),_=xa((b)=>b.hidden_layer_opacity),p=xa((b)=>b.selected_layer),m=xa((b)=>b.copper_pour_opacity),A=xa((b)=>b.is_showing_copper_pours),g=xa((b)=>b.is_showing_solder_mask),f=xa((b)=>b.is_showing_fabrication_notes),y=xa((b)=>b.is_showing_pcb_notes),x=xa((b)=>b.is_showing_courtyards),C=xa((b)=>b.is_showing_silkscreen);return QL.useEffect(()=>{d.current=c},[c]),QL.useEffect(()=>{if(!h.current)return;if(Object.keys(h.current).length===0)return;let b=Object.fromEntries(Object.entries(h.current).filter(([B,T])=>{if(!T)return!1;return!0}));if(Object.keys(b).length===0)return;let I=new vJi(b);if(r)I.transform=r;I.clear(),I.foregroundLayer=p,I.hiddenLayerOpacity=_,I.xRayNetActive=Boolean(o);let v=Object.fromEntries(Object.entries(b).filter(([B])=>I.getLayerOpacity(B)>0)),P=yZi({primitives:e,isShowingSolderMask:g,isShowingSilkscreen:C,isShowingFabricationNotes:f});if(pZi(I,P.filter((B)=>I.getLayerOpacity(B.layer??"other")>0)),r){let B=fwe(t).map((L)=>({canvas:v[L],layer:L,copperLayer:vmt(L)}));for(let{canvas:L,copperLayer:H}of B){if(!L)continue;Xio({canvas:L,elements:t,layers:[H],realToCanvasMat:r,primitives:e,showCopperPours:A&&m>0})}for(let{canvas:L,copperLayer:H}of B){if(!L)continue;kJi({canvas:L,elements:t,layers:[H],realToCanvasMat:r})}for(let{canvas:L,copperLayer:H,layer:V}of B){if(!L)continue;jio({canvas:L,elements:t,layers:[H],realToCanvasMat:r,primitives:e,drawSoldermask:g&&(V==="top"||V==="bottom")})}for(let{canvas:L,copperLayer:H}of B){if(!L)continue;Vio({canvas:L,elements:t,layers:[H],realToCanvasMat:r,opacity:A?m:0})}for(let{canvas:L,copperLayer:H}of B){if(!L)continue;Wio({canvas:L,elements:t,layers:[H],realToCanvasMat:r,primitives:e,drawSoldermask:g})}for(let{canvas:L,copperLayer:H,layer:V}of B){if(!L)continue;Jio({canvas:L,elements:t,layers:[H],realToCanvasMat:r,primitives:e,drawSoldermask:g&&(V==="top"||V==="bottom")})}if(g){let L=p==="bottom"?"bottom":"top",H=L==="top",V=L==="bottom",O=v.soldermask_top;if(O&&L==="top")qio({canvas:O,elements:t,layers:["top_soldermask"],realToCanvasMat:r,drawSoldermaskTop:H,drawSoldermaskBottom:V,primitives:e});let U=v.soldermask_bottom;if(U&&L==="bottom")qio({canvas:U,elements:t,layers:["bottom_soldermask"],realToCanvasMat:r,drawSoldermaskTop:H,drawSoldermaskBottom:V,primitives:e})}let T=v.drill;if(T)NJi({canvas:T,elements:t,layers:["drill"],realToCanvasMat:r});if(C){let L=v.top_silkscreen;if(L)$io({canvas:L,elements:t,layers:["top_silkscreen"],realToCanvasMat:r});let H=v.bottom_silkscreen;if(H)$io({canvas:H,elements:t,layers:["bottom_silkscreen"],realToCanvasMat:r})}if(f){let L=v.top_fabrication;if(L)Gio({canvas:L,elements:t,layers:["top_fabrication_note"],realToCanvasMat:r});let H=v.bottom_fabrication;if(H)Gio({canvas:H,elements:t,layers:["bottom_fabrication_note"],realToCanvasMat:r})}if(y){let L=v.bottom_notes;if(L)Uio({canvas:L,elements:t,layers:["bottom_user_note"],realToCanvasMat:r});let H=v.top_notes;if(H)Uio({canvas:H,elements:t,layers:["top_user_note"],realToCanvasMat:r})}if(x){let L=v.top_courtyard;if(L)Yio({canvas:L,elements:t,layers:["top_courtyard"],realToCanvasMat:r});let H=v.bottom_courtyard;if(H)Yio({canvas:H,elements:t,layers:["bottom_courtyard"],realToCanvasMat:r})}let N=v.board;if(N)UJi({canvas:N,elements:t,layers:[],realToCanvasMat:r,drawSoldermask:g}),Cao({canvas:N,elements:t,layers:[],realToCanvasMat:r,drawSoldermask:g});let D=v.edge_cuts;if(D)HJi({canvas:D,elements:t,layers:["edge_cuts"],realToCanvasMat:r});for(let{canvas:L,layer:H}of B){if(!L)continue;VJi({canvas:L,elements:t,layer:H,realToCanvasMat:r})}}I.orderAndFadeLayers();let M=l.current;if(M&&r&&o){M.getContext("2d").clearRect(0,0,s,a);for(let T of EJi(t,p)){let N={canvas:M,elements:o,layers:[vmt(T)],realToCanvasMat:r,drawSoldermask:!1};if(A)Vio({...N,opacity:m});Xio({...N,showCopperPours:!1}),Wio(N),jio(N),Jio(N)}let B=new ai(M);B.realToCanvasMat=r,B.drawElements(o.filter((T)=>T.type==="pcb_via"||T.type==="pcb_plated_hole"),{layers:["drill"],drawSoldermask:!1})}if(u.current!==n)u.current=n,d.current?.()},[e,t,n,o,s,a,r,p,_,m,A,g,f,y,x,C]),kte.jsxs("div",{style:{backgroundColor:"black",width:s,height:a,position:"relative"},children:[kte.jsx(Ame.SuperGrid,{textColor:"rgba(0,255,0,0.8)",majorColor:"rgba(0,255,0,0.4)",minorColor:"rgba(0,255,0,0.2)",screenSpaceCellSize:200,width:s,height:a,transform:r,stringifyCoord:(b,I,v)=>`${Ame.toMMSI(b,v)}, ${Ame.toMMSI(I,v)}`}),o&&kte.jsx("canvas",{ref:l,className:"pcb-x-ray-net",width:s,height:a,style:{position:"absolute",left:0,top:0,zIndex:Yh.topLayer,pointerEvents:"none"}}),PJi(t).filter((b)=>{if(!g&&b.includes("soldermask"))return!1;if(!C&&b.includes("silkscreen"))return!1;return!0}).map((b)=>b.replace(/-/g,"")).map((b,I)=>kte.jsx("canvas",{className:`pcb-layer-${b}`,ref:(v)=>{if(h.current??={},v)h.current[b]=v;else delete h.current[b]},style:{position:"absolute",zIndex:I,left:0,top:0,pointerEvents:"none"},width:s,height:a},b))]})};var r7a=(()=>{let e=new Uint8Array(4),t=new Uint32Array(e.buffer);return!((t[0]=1)&e[0])})(),i7a={int8:globalThis.Int8Array,uint8:globalThis.Uint8Array,int16:globalThis.Int16Array,uint16:globalThis.Uint16Array,int32:globalThis.Int32Array,uint32:globalThis.Uint32Array,uint64:globalThis.BigUint64Array,int64:globalThis.BigInt64Array,float32:globalThis.Float32Array,float64:globalThis.Float64Array},CZi=[];for(let e=0;e<256;e++){let t=e;for(let n=0;n<8;n++)if(t&1)t=3988292384^t>>>1;else t=t>>>1;CZi[e]=t}var bZi=new Uint16Array([255]),IZi=new Uint8Array(bZi.buffer),s7a=IZi[0]===255,vZi=new Uint16Array([255]),SZi=new Uint8Array(vZi.buffer),a7a=SZi[0]===255,c7a=new Uint8Array(0),l7a=Uint8Array.of(137,80,78,71,13,10,26,10),h7a=new TextDecoder("latin1"),kL=0.000000001,twe=(e,t,n)=>e>=t-kL&&e<=n+kL,PZi=(e)=>{let t=[];for(let n of e)if(!t.some((o)=>Math.abs(o.x-n.x)<kL&&Math.abs(o.y-n.y)<kL))t.push(n);return t};function EZi(e,t){let{origin:n,directionVector:o}=e;if(Math.abs(o.x)<kL&&Math.abs(o.y)<kL)return null;let r=[];if(Math.abs(o.x)>=kL){let l=(t.minX-n.x)/o.x,h=n.y+l*o.y;if(twe(h,t.minY,t.maxY))r.push({x:t.minX,y:h});let d=(t.maxX-n.x)/o.x,u=n.y+d*o.y;if(twe(u,t.minY,t.maxY))r.push({x:t.maxX,y:u})}if(Math.abs(o.y)>=kL){let l=(t.minY-n.y)/o.y,h=n.x+l*o.x;if(twe(h,t.minX,t.maxX))r.push({x:h,y:t.minY});let d=(t.maxY-n.y)/o.y,u=n.x+d*o.x;if(twe(u,t.minX,t.maxX))r.push({x:u,y:t.maxY})}let i=PZi(r);if(i.length<2)return null;let s=i[0],a=i[1],c=(s.x-a.x)**2+(s.y-a.y)**2;for(let l=0;l<i.length;l++)for(let h=l+1;h<i.length;h++){let d=i[l],u=i[h],_=(d.x-u.x)**2+(d.y-u.y)**2;if(_>c)s=d,a=u,c=_}return[s,a]}function MZi(e,t,n){let o=GG.inverse(e),r=[GG.applyToPoint(o,{x:0,y:0}),GG.applyToPoint(o,{x:t,y:0}),GG.applyToPoint(o,{x:0,y:n}),GG.applyToPoint(o,{x:t,y:n})];return{minX:Math.min(...r.map((i)=>i.x)),maxX:Math.max(...r.map((i)=>i.x)),minY:Math.min(...r.map((i)=>i.y)),maxY:Math.max(...r.map((i)=>i.y))}}var wZi=0.6,BZi=1,Zio=(e,t)=>Math.hypot(e.x-t.x,e.y-t.y),Nao=(e)=>(e.ccwRotationDegrees??0)*Math.PI/180,TZi=(e)=>e.a*e.d-e.b*e.c<0?1:-1,DZi=(e,t)=>Nao(e)*TZi(t),NZi=(e,t)=>{let n=Math.cos(t),o=Math.sin(t);return{x:e.x*n-e.y*o,y:e.x*o+e.y*n}},RZi=(e)=>Rao(e,Nao(e)),QZi=(e,t)=>Rao(e,DZi(e,t)),Rao=(e,t)=>{let n=e.width/2,o=e.height/2;return[{x:-n,y:-o},{x:n,y:-o},{x:n,y:o},{x:-n,y:o}].map((r)=>{let i=NZi(r,t);return{x:e.center.x+i.x,y:e.center.y+i.y}})},kZi=(e,t)=>{let n=QZi(e,t).map((l)=>Smt.applyToPoint(t,l)),o=Smt.applyToPoint(t,e.center),r=Zio(n[0],n[1]),i=Zio(n[1],n[2]),s=n.length>=2?Math.atan2(n[1].y-n[0].y,n[1].x-n[0].x):0,a=s*180/Math.PI,c=n.reduce((l,h)=>({minX:Math.min(l.minX,h.x),maxX:Math.max(l.maxX,h.x),minY:Math.min(l.minY,h.y),maxY:Math.max(l.maxY,h.y)}),{minX:1/0,maxX:-1/0,minY:1/0,maxY:-1/0});return{center:o,corners:n,width:r,height:i,angleRadians:s,angleDegrees:a,bounds:c}},LZi=2,HZi=12,FZi=12,iwe=(e)=>({tip:{...e},base:{...e},leftWing:{...e},rightWing:{...e}}),eso=(e,t,n)=>{let o=e.x-t.x,r=e.y-t.y,i=Math.hypot(o,r);if(i===0)return iwe(e);let s=o/i,c=-(r/i)*(n/2),l=s*(n/2);return{tip:{...e},base:{...t},leftWing:{x:t.x+c,y:t.y+l},rightWing:{x:t.x-c,y:t.y-l}}};function Qao(e){let{start:t,end:n}=e,o=n.x-t.x,r=n.y-t.y,i=Math.hypot(o,r),s=LZi,a=HZi;if(i===0){let f=e.doubleSided?[iwe(t),iwe(t)]:[iwe(t)];return{shaftStart:{...t},shaftEnd:{...t},heads:f,shaftWidth:s,headLength:0,headWidth:a,length:i}}let c=o/i,l=r/i,h=Math.min(FZi,i*0.5),d=Math.max(h,s*2),u=e.doubleSided?i/2:i,_=Math.min(d,u),p={x:n.x-c*_,y:n.y-l*_},m=[eso(n,p,a)],A={...t},g={...p};if(e.doubleSided){let f={x:t.x+c*_,y:t.y+l*_};m.unshift(eso(t,f,a)),A=f}return{shaftStart:A,shaftEnd:g,heads:m,shaftWidth:s,headLength:_,headWidth:a,length:i}}function zZi(e){let t=Qao(e);return[t.shaftStart,t.shaftEnd,...t.heads.flatMap((o)=>[o.tip,o.base,o.leftWing,o.rightWing])].reduce((o,r)=>({minX:Math.min(o.minX,r.x),maxX:Math.max(o.maxX,r.x),minY:Math.min(o.minY,r.y),maxY:Math.max(o.maxY,r.y)}),{minX:1/0,maxX:-1/0,minY:1/0,maxY:-1/0})}function tso(e,t,{fontSize:n=12,strokeWidth:o=2,normalPadding:r=6,alongOffset:i=0}={}){let s={x:(e.x+t.x)/2,y:(e.y+t.y)/2},a=t.x-e.x,c=t.y-e.y,l=Math.hypot(a,c);if(l===0)return{x:s.x+i,y:s.y-(o/2+n*0.65+r),angleRadians:0,angleDegrees:0,direction:{x:1,y:0},normal:{x:0,y:-1}};let h=a/l,d=c/l,u=-d,_=h;if(h<0||h===0&&d<0)h=-h,d=-d,u=-u,_=-_;let m=Math.atan2(d,h),A=o/2+n*0.65+r;return{x:s.x+u*A+h*i,y:s.y+_*A+d*i,angleRadians:m,angleDegrees:m*180/Math.PI,direction:{x:h,y:d},normal:{x:u,y:_}}}var NL=["rgba(239, 68, 68, 0.8)","rgba(249, 115, 22, 0.8)","rgba(245, 158, 11, 0.8)","rgba(234, 179, 8, 0.8)","rgba(132, 204, 22, 0.8)","rgba(34, 197, 94, 0.8)","rgba(16, 185, 129, 0.8)","rgba(20, 184, 166, 0.8)","rgba(6, 182, 212, 0.8)","rgba(14, 165, 233, 0.8)","rgba(59, 130, 246, 0.8)","rgba(99, 102, 241, 0.8)","rgba(139, 92, 246, 0.8)","rgba(168, 85, 247, 0.8)","rgba(217, 70, 239, 0.8)","rgba(236, 72, 153, 0.8)","rgba(249, 168, 212, 0.8)","rgba(161, 161, 170, 0.8)"];function nso(e,t,n,o={}){let r=o.padding??40,i=o.yFlip??!1,s;if("center"in e){let h=e.width/2,d=e.height/2;s={minX:e.center.x-h,maxX:e.center.x+h,minY:e.center.y-d,maxY:e.center.y+d}}else s=e;let a=s.maxX-s.minX||1,c=s.maxY-s.minY||1,l=Math.min((t-2*r)/a,(n-2*r)/c);return wm.compose(wm.translate(t/2,n/2),wm.scale(l,i?-l:l),wm.translate(-(s.minX+a/2),-(s.minY+c/2)))}function OZi(e){let t=[...e.points||[],...(e.lines||[]).flatMap((n)=>n.points),...(e.polygons||[]).flatMap((n)=>n.points),...(e.rects||[]).flatMap((n)=>RZi(n)),...(e.circles||[]).flatMap((n)=>[{x:n.center.x-n.radius,y:n.center.y},{x:n.center.x+n.radius,y:n.center.y},{x:n.center.x,y:n.center.y-n.radius},{x:n.center.x,y:n.center.y+n.radius}]),...(e.arrows||[]).flatMap((n)=>{let o=zZi(n);return[{x:o.minX,y:o.minY},{x:o.maxX,y:o.maxY}]}),...(e.texts||[]).flatMap((n)=>{let o=n.fontSize??12,r=n.text.length*o*wZi,i=o*BZi,s=n.anchorSide??"center",a={top_left:{dx:0,dy:0},top_center:{dx:-r/2,dy:0},top_right:{dx:-r,dy:0},center_left:{dx:0,dy:-i/2},center:{dx:-r/2,dy:-i/2},center_right:{dx:-r,dy:-i/2},bottom_left:{dx:0,dy:-i},bottom_center:{dx:-r/2,dy:-i},bottom_right:{dx:-r,dy:-i}},{dx:c,dy:l}=a[s],h=n.x+c,d=n.y+l;return[{x:h,y:d},{x:h+r,y:d+i}]})];if(t.length===0)return{minX:-1,maxX:1,minY:-1,maxY:1};return t.reduce((n,o)=>({minX:Math.min(n.minX,o.x),maxX:Math.max(n.maxX,o.x),minY:Math.min(n.minY,o.y),maxY:Math.max(n.maxY,o.y)}),{minX:1/0,maxX:-1/0,minY:1/0,maxY:-1/0})}function VZi(e,t,n={}){let o=n.disableLabels!==!1,r=n.hideInlineLabels??o,i=t instanceof HTMLCanvasElement?t.getContext("2d"):t;if(!i)throw Error("Could not get 2D context from canvas");let s=t instanceof HTMLCanvasElement?t.width:t.canvas.width,a=t instanceof HTMLCanvasElement?t.height:t.canvas.height,c;if(n.transform)c=n.transform;else if(n.viewbox)c=nso(n.viewbox,s,a,{padding:n.padding,yFlip:n.yFlip});else{let l=OZi(e),h=e.coordinateSystem==="cartesian";c=nso(l,s,a,{padding:n.padding??40,yFlip:h})}if(i.clearRect(0,0,s,a),i.save(),e.rects&&e.rects.length>0)e.rects.forEach((l)=>{let h=kZi(l,c);if(i.save(),i.translate(h.center.x,h.center.y),Math.abs(h.angleRadians)>0.000001)i.rotate(h.angleRadians);if(i.beginPath(),i.rect(-h.width/2,-h.height/2,h.width,h.height),l.fill)i.fillStyle=l.fill,i.fill();if(l.stroke)i.strokeStyle=l.stroke,i.stroke();i.restore()});if(e.circles&&e.circles.length>0)e.circles.forEach((l)=>{let h=wm.applyToPoint(c,l.center),d=l.radius*Math.abs(c.a);if(i.beginPath(),i.arc(h.x,h.y,d,0,2*Math.PI),l.fill)i.fillStyle=l.fill,i.fill();if(l.stroke)i.strokeStyle=l.stroke??"transparent",i.stroke()});if(e.polygons&&e.polygons.length>0)e.polygons.forEach((l)=>{if(l.points.length===0)return;let h=l.points.map((d)=>wm.applyToPoint(c,d));i.beginPath(),i.moveTo(h[0].x,h[0].y);for(let d=1;d<h.length;d++)i.lineTo(h[d].x,h[d].y);if(i.closePath(),l.fill)i.fillStyle=l.fill,i.fill();if(l.stroke){if(i.strokeStyle=l.stroke,l.strokeWidth!==void 0)i.lineWidth=l.strokeWidth*Math.abs(c.a);i.stroke()}});if(e.arrows&&e.arrows.length>0)e.arrows.forEach((l,h)=>{let d=Qao(l),u=wm.applyToPoint(c,d.shaftStart),_=wm.applyToPoint(c,d.shaftEnd),p=l.color||NL[h%NL.length],m=Math.hypot(c.a,c.b);i.strokeStyle=p,i.fillStyle=p,i.lineWidth=d.shaftWidth*(m||1),i.lineCap="round",i.setLineDash([]),i.beginPath(),i.moveTo(u.x,u.y),i.lineTo(_.x,_.y),i.stroke(),d.heads.forEach((C)=>{let b=wm.applyToPoint(c,C.tip),I=wm.applyToPoint(c,C.leftWing),v=wm.applyToPoint(c,C.rightWing);i.beginPath(),i.moveTo(b.x,b.y),i.lineTo(I.x,I.y),i.lineTo(v.x,v.y),i.closePath(),i.fill()});let A=12,g=d.shaftWidth*(m||1),f=A*0.6,y=tso(u,_,{fontSize:A,strokeWidth:g,normalPadding:6,alongOffset:l.label?f:0}),x=tso(u,_,{fontSize:A,strokeWidth:g,normalPadding:12,alongOffset:l.inlineLabel?-f:0});if(i.fillStyle=p,i.font=`${A}px sans-serif`,!o&&l.label){let{x:C,y:b}=x;i.save(),i.textAlign="center",i.textBaseline="middle",i.fillText(l.label,C,b),i.restore()}if(!r&&l.inlineLabel)i.save(),i.translate(y.x,y.y),i.rotate(y.angleRadians),i.textAlign="center",i.textBaseline="middle",i.fillText(l.inlineLabel,0,0),i.restore()});if(e.lines&&e.lines.length>0)e.lines.map((l,h)=>({line:l,originalIndex:h})).sort((l,h)=>(l.line.zIndex??0)-(h.line.zIndex??0)||l.originalIndex-h.originalIndex).forEach(({line:l,originalIndex:h})=>{if(l.points.length===0)return;i.beginPath();let d=wm.applyToPoint(c,l.points[0]);i.moveTo(d.x,d.y);for(let u=1;u<l.points.length;u++){let _=wm.applyToPoint(c,l.points[u]);i.lineTo(_.x,_.y)}if(i.strokeStyle=l.strokeColor||NL[h%NL.length],l.strokeWidth)i.lineWidth=l.strokeWidth*c.a;else i.lineWidth=2;if(i.lineCap="round",l.strokeDash)if(typeof l.strokeDash==="string"){let u;if(l.strokeDash.includes(","))u=l.strokeDash.split(",").map((_)=>parseFloat(_.trim())).filter((_)=>!Number.isNaN(_));else{let _=parseFloat(l.strokeDash.trim());u=!Number.isNaN(_)?[_]:[]}i.setLineDash(u)}else i.setLineDash(l.strokeDash.map((u)=>u*Math.abs(c.a)));else i.setLineDash([]);i.stroke()});if(e.infiniteLines&&e.infiniteLines.length>0){let l=MZi(c,s,a);e.infiniteLines.forEach((h,d)=>{let u=EZi(h,l);if(!u)return;let[_,p]=u,m=wm.applyToPoint(c,_),A=wm.applyToPoint(c,p);if(i.beginPath(),i.moveTo(m.x,m.y),i.lineTo(A.x,A.y),i.strokeStyle=h.strokeColor||NL[d%NL.length],i.lineWidth=h.strokeWidth?h.strokeWidth*Math.abs(c.a):2,i.lineCap="round",h.strokeDash)if(typeof h.strokeDash==="string"){let g;if(h.strokeDash.includes(","))g=h.strokeDash.split(",").map((f)=>parseFloat(f.trim())).filter((f)=>!Number.isNaN(f));else{let f=parseFloat(h.strokeDash.trim());g=!Number.isNaN(f)?[f]:[]}i.setLineDash(g)}else i.setLineDash(h.strokeDash.map((g)=>g*Math.abs(c.a)));else i.setLineDash([]);i.stroke()})}if(e.texts&&e.texts.length>0)e.texts.forEach((l)=>{let h=wm.applyToPoint(c,{x:l.x,y:l.y});i.fillStyle=l.color||"black",i.font=`${(l.fontSize??12)*Math.abs(c.a)}px sans-serif`;let d=l.anchorSide??"center",u={top_left:"left",center_left:"left",bottom_left:"left",top_center:"center",center:"center",bottom_center:"center",top_right:"right",center_right:"right",bottom_right:"right"},_={top_left:"top",top_center:"top",top_right:"top",center_left:"middle",center:"middle",center_right:"middle",bottom_left:"bottom",bottom_center:"bottom",bottom_right:"bottom"};i.textAlign=u[d],i.textBaseline=_[d],i.fillText(l.text,h.x,h.y)});if(e.points&&e.points.length>0)e.points.forEach((l,h)=>{let d=wm.applyToPoint(c,l);if(i.beginPath(),i.arc(d.x,d.y,3,0,2*Math.PI),i.fillStyle=l.color||NL[h%NL.length],i.fill(),l.label&&!o)i.fillStyle=l.color||"black",i.font="12px sans-serif",i.fillText(l.label,d.x+5,d.y-5)});i.restore()}var d7a=uso(DKi(),1),GZi=({children:e,transform:t,debugGraphics:n})=>{let o=xwe.useRef(null),[r,{width:i,height:s}]=Bme(),a=xa((c)=>c.is_showing_autorouting);if(xwe.useEffect(()=>{if(!a)return;if(o.current&&n&&i&&s)o.current.width=i,o.current.height=s,VZi(n,o.current,{transform:t,disableLabels:!0})},[n,t,i,s,a]),!a)return e;return Cwe.jsxs("div",{ref:r,style:{position:"relative",width:"100%",height:"100%"},children:[e,Cwe.jsx("canvas",{ref:o,style:{position:"absolute",top:0,left:0,opacity:0.5,zIndex:100,width:"100%",height:"100%",pointerEvents:"none"}})]})},nwe=(e,t,n)=>n(e,t),oso=(e,t,n,o,r)=>{let i=r*Math.PI/180,s=Math.cos(i),a=Math.sin(i),c=e-n,l=t-o,h=c*s-l*a,d=c*a+l*s;return{x:h+n,y:d+o}},cme=(e)=>{if(e.length===0)return null;let t=e[0].x,n=e[0].x,o=e[0].y,r=e[0].y;for(let i of e)t=nwe(t,i.x,Math.min),n=nwe(n,i.x,Math.max),o=nwe(o,i.y,Math.min),r=nwe(r,i.y,Math.max);return{minX:t,maxX:n,minY:o,maxY:r}},UZi=(e,t)=>({minX:Math.min(e.minX,t.minX),maxX:Math.max(e.maxX,t.maxX),minY:Math.min(e.minY,t.minY),maxY:Math.max(e.maxY,t.maxY)}),WZi=(e,t)=>{if(!e)return t;return UZi(e,t)},XZi=(e)=>{switch(e.pcb_drawing_type){case"line":{let t=(e.width??0)/2,n=[{x:e.x1,y:e.y1},{x:e.x2,y:e.y2}],o=cme(n);if(!o)return null;return{minX:o.minX-t,maxX:o.maxX+t,minY:o.minY-t,maxY:o.maxY+t}}case"rect":{let t=e.w/2,n=e.h/2,o=[{x:e.x-t,y:e.y-n},{x:e.x+t,y:e.y-n},{x:e.x+t,y:e.y+n},{x:e.x-t,y:e.y+n}],r=e.ccw_rotation??0,i=r===0?o:o.map((s)=>oso(s.x,s.y,e.x,e.y,r));return cme(i)}case"circle":return{minX:e.x-e.r,maxX:e.x+e.r,minY:e.y-e.r,maxY:e.y+e.r};case"oval":return{minX:e.x-e.rX,maxX:e.x+e.rX,minY:e.y-e.rY,maxY:e.y+e.rY};case"pill":{let t=e.w/2,n=e.h/2,o=[{x:e.x-t,y:e.y-n},{x:e.x+t,y:e.y-n},{x:e.x+t,y:e.y+n},{x:e.x-t,y:e.y+n}],r=e.ccw_rotation??0,i=r===0?o:o.map((s)=>oso(s.x,s.y,e.x,e.y,r));return cme(i)}case"polygon":return cme(e.points);case"polygon_with_arcs":{let t=e.brep_shape.outer_ring.vertices.map((n)=>({x:n.x,y:n.y}));return cme(t)}case"text":{let t=e.size??0,n=e.text?e.text.length*t*0.6:0,o=t;if(n===0&&o===0)return{minX:e.x,maxX:e.x,minY:e.y,maxY:e.y};let r=n/2,i=o/2;return{minX:e.x-r,maxX:e.x+r,minY:e.y-i,maxY:e.y+i}}default:return null}};function jZi(e){let{dimensionStart:t,dimensionEnd:n,screenDimensionStart:o,screenDimensionEnd:r,flipX:i,flipY:s}=e,a=n.x-t.x,c=n.y-t.y,l=Math.sqrt(a*a+c*c),h=r.x-o.x,d=r.y-o.y,u=Math.sqrt(h*h+d*d),_=Math.atan2(d,h)*(180/Math.PI),p=Math.abs(_)%90,A=Math.min(p,90-p)>15,g=(o.x+r.x)/2,f=(o.y+r.y)/2,y=15,x=_+90,C=Math.cos(x*Math.PI/180)*15,b=Math.sin(x*Math.PI/180)*15,I=h>0&&d<0,v=h<0&&d<0,P=h>0&&d>0,M=h<0&&d>0;if(i!==s&&!I)C=-C,b=-b;if(I)C+=Math.cos(x*Math.PI/180)*-45,b+=Math.sin(x*Math.PI/180)*-45;if(P)C+=Math.cos(x*Math.PI/180)+-20,b+=Math.sin(x*Math.PI/180)+-10;if(M)C+=Math.cos(x*Math.PI/180)*10,b+=Math.sin(x*Math.PI/180)*10;let B=g+C,T=f+b;return{distance:l,screenDistance:u,x:B,y:T,show:l>0.01&&u>30&&A}}function KZi(e){let{dimensionStart:t,dimensionEnd:n,screenDimensionStart:o,screenDimensionEnd:r,flipX:i,flipY:s}=e;return kao.useMemo(()=>jZi({dimensionStart:t,dimensionEnd:n,screenDimensionStart:o,screenDimensionEnd:r,flipX:i,flipY:s}),[t,n,o,r,i,s])}var $Zi=(e,t,n)=>{let o=n*Math.PI/180,r=Math.cos(o),i=Math.sin(o),s=e.x-t.x,a=e.y-t.y,c=s*r-a*i,l=s*i+a*r;return{x:c+t.x,y:l+t.y}},rso=(e,t,n,o)=>{let r={top_left:{x:e.x-t,y:e.y-n},top_center:{x:e.x,y:e.y-n},top_right:{x:e.x+t,y:e.y-n},center_left:{x:e.x-t,y:e.y},center:{x:e.x,y:e.y},center_right:{x:e.x+t,y:e.y},bottom_left:{x:e.x-t,y:e.y+n},bottom_center:{x:e.x,y:e.y+n},bottom_right:{x:e.x+t,y:e.y+n}};if(o===0)return Object.entries(r).map(([i,s])=>({anchor:i,point:s}));return Object.entries(r).map(([i,s])=>({anchor:i,point:$Zi(s,e,o)}))},qZi=(e)=>{switch(e.pcb_drawing_type){case"rect":{let t=e.ccw_rotation??0;return rso({x:e.x,y:e.y},e.w/2,e.h/2,t)}case"pill":{let t=e.ccw_rotation??0;return rso({x:e.x,y:e.y},e.w/2,e.h/2,t)}case"circle":return[{anchor:"circle_center",point:{x:e.x,y:e.y}},{anchor:"circle_right",point:{x:e.x+e.r,y:e.y}},{anchor:"circle_left",point:{x:e.x-e.r,y:e.y}},{anchor:"circle_top",point:{x:e.x,y:e.y-e.r}},{anchor:"circle_bottom",point:{x:e.x,y:e.y+e.r}}];case"oval":return[{anchor:"oval_center",point:{x:e.x,y:e.y}},{anchor:"oval_right",point:{x:e.x+e.rX,y:e.y}},{anchor:"oval_left",point:{x:e.x-e.rX,y:e.y}},{anchor:"oval_top",point:{x:e.x,y:e.y-e.rY}},{anchor:"oval_bottom",point:{x:e.x,y:e.y+e.rY}}];case"line":{let t={x:(e.x1+e.x2)/2,y:(e.y1+e.y2)/2};return[{anchor:"line_start",point:{x:e.x1,y:e.y1}},{anchor:"line_mid",point:t},{anchor:"line_end",point:{x:e.x2,y:e.y2}}]}case"polygon":return e.points.map((t,n)=>({anchor:`polygon_vertex_${n}`,point:t}));case"polygon_with_arcs":return e.brep_shape.outer_ring.vertices.map((t,n)=>({anchor:`polygon_with_arcs_vertex_${n}`,point:{x:t.x,y:t.y}}));default:return[]}},iso=({screenPoint:{x:e,y:t}})=>`M${e-2.5},${t-2.5}l5,5m0,-5l-5,5`,JZi=bwe.memo(function({points:t,startId:n,endId:o}){let{path:r,pointsById:i}=bwe.useMemo(()=>({path:t.map(iso).join(""),pointsById:new Map(t.map((a)=>[a.id,a]))}),[t]),s=[...new Set([n,o])].flatMap((a)=>{let c=a===null?void 0:i.get(a);return c?[iso(c)]:[]}).join("");return fme.jsxs("svg",{"aria-hidden":"true",width:"100%",height:"100%",style:{position:"absolute",left:0,top:0,overflow:"visible",pointerEvents:"none",zIndex:Yh.dimensionOverlay},fill:"none",strokeWidth:1,children:[fme.jsx("path",{d:r,stroke:"white"}),fme.jsx("path",{d:s,stroke:"#66ccff"})]})}),ZZi=16,ees=[],tes=t1.identity(),sso=(e)=>{if(e.pcb_drawing_type==="text")return!0;let t=e._element;if(!t||typeof t!=="object")return!1;let n=typeof t.type==="string"?t.type:void 0;if(!n)return!1;if(n.startsWith("pcb_silkscreen_"))return!0;if(n.startsWith("pcb_note_"))return!0;if(n==="pcb_text")return!0;if(n.startsWith("pcb_fabrication_note_")&&n!=="pcb_fabrication_note_rect")return!0;return!1},nes=({children:e,transform:t,focusOnHover:n=!1,primitives:o=ees,onBoundsSelected:r,cancelPanDrag:i})=>{if(!t)t=tes;let[s,a]=ud.useState(!1),[c,l]=ud.useState(!1),[h,d]=ud.useState(!1),[u,_]=ud.useState(!1),[p,m]=ud.useState(!1),[A,g]=ud.useState(!1),[f,y]=ud.useState({start:null,end:null}),x=xa((de)=>de.is_mouse_over_container),C=ud.useCallback(()=>{if(h)d(!1),window.dispatchEvent(new Event("disarm-dimension-tool"))},[h]),b=ud.useCallback(()=>{if(u)_(!1),window.dispatchEvent(new Event("disarm-bounds-tool"))},[u]),[I,v]=ud.useState({x:0,y:0}),[P,M]=ud.useState({x:0,y:0}),[B,T]=ud.useState({x:0,y:0}),[N,D]=ud.useState({x:0,y:0}),L=ud.useRef({x:0,y:0}),H=ud.useRef(!1),V=ud.useRef(null),U=V.current?.getBoundingClientRect(),j=ud.useMemo(()=>{let de=new Map;for(let me of o){if(!me._element)continue;if(sso(me))continue;if(me.pcb_drawing_type==="pill")continue;if(me.pcb_drawing_type==="rect"&&me.ccw_rotation&&me.ccw_rotation!==0)continue;let ge=XZi(me);if(!ge)continue;let xe=de.get(me._element);de.set(me._element,WZi(xe??void 0,ge))}return de},[o]),Y=ud.useMemo(()=>{let de=[];for(let me of o){if(!me._element)continue;if(sso(me))continue;let ge=qZi(me);if(ge.length===0)continue;for(let xe of ge)de.push({anchor:xe.anchor,point:xe.point,element:me._element})}return de},[o]),X=ud.useMemo(()=>{let de=[];j.forEach((me,ge)=>{if(!me)return;let xe=(me.minX+me.maxX)/2,Ee=(me.minY+me.maxY)/2,Re={top_left:{x:me.minX,y:me.minY},top_center:{x:xe,y:me.minY},top_right:{x:me.maxX,y:me.minY},center_left:{x:me.minX,y:Ee},center:{x:xe,y:Ee},center_right:{x:me.maxX,y:Ee},bottom_left:{x:me.minX,y:me.maxY},bottom_center:{x:xe,y:me.maxY},bottom_right:{x:me.maxX,y:me.maxY}};for(let[Me,_e]of Object.entries(Re))de.push({anchor:Me,point:_e,element:ge})});for(let me of Y)de.push(me);return de.push({anchor:"origin",point:{x:0,y:0},element:null}),de},[j,Y]),K=ud.useMemo(()=>X.map((de,me)=>({...de,id:`${me}-${de.anchor}`,screenPoint:t1.applyToPoint(t,de.point)})),[X,t]),J=ud.useCallback((de)=>{if(K.length===0)return{point:de,id:null};let me=t1.applyToPoint(t,de),ge=null;for(let xe of K){let Ee=xe.screenPoint.x-me.x,Re=xe.screenPoint.y-me.y,Me=Math.hypot(Ee,Re);if(Me>ZZi)continue;if(!ge||Me<ge.distance)ge={distance:Me,id:xe.id,point:xe.point}}if(!ge)return{point:de,id:null};return{point:ge.point,id:ge.id}},[K,t]);ud.useEffect(()=>{let de=(xe)=>{let Ee=xe.target;if(Ee.tagName==="INPUT"||Ee.tagName==="TEXTAREA"||Ee.isContentEditable)return;let Re=V.current?.contains(document.activeElement)||document.activeElement===V.current;if(!x&&!Re)return;if(xe.key==="d"){let Me=J({x:L.current.x,y:L.current.y});if(v({x:Me.point.x,y:Me.point.y}),M({x:Me.point.x,y:Me.point.y}),y({start:Me.id,end:Me.id}),s)a(!1),l(!1),y({start:null,end:null});else a(!0),l(!0);C()}if(xe.key==="Escape")a(!1),l(!1),y({start:null,end:null}),m(!1),g(!1),C(),b()},me=()=>{d(!0),_(!1),window.dispatchEvent(new Event("disarm-bounds-tool"))},ge=()=>{_(!0),d(!1),a(!1),l(!1),window.dispatchEvent(new Event("disarm-dimension-tool"))};return window.addEventListener("keydown",de),window.addEventListener("arm-dimension-tool",me),window.addEventListener("arm-bounds-tool",ge),()=>{window.removeEventListener("keydown",de),window.removeEventListener("arm-dimension-tool",me),window.removeEventListener("arm-bounds-tool",ge),C(),b()}},[x,s,C,b,J]);let ee=t1.applyToPoint(t,I),se=t1.applyToPoint(t,P),ne=t1.applyToPoint(t,B),re=t1.applyToPoint(t,N),Z={minX:Math.min(B.x,N.x),minY:Math.min(B.y,N.y),maxX:Math.max(B.x,N.x),maxY:Math.max(B.y,N.y)},te={left:Math.min(ne.x,re.x),top:Math.min(ne.y,re.y),width:Math.abs(ne.x-re.x),height:Math.abs(ne.y-re.y)},ie=ud.useCallback((de,me)=>{let ge={minX:Math.min(de.x,me.x),minY:Math.min(de.y,me.y),maxX:Math.max(de.x,me.x),maxY:Math.max(de.y,me.y)};r?.(ge),window.dispatchEvent(new CustomEvent("pcb-viewer:bounds-selected",{detail:ge}))},[r]),ce={left:Math.min(ee.x,se.x),right:Math.max(ee.x,se.x),top:Math.min(ee.y,se.y),bottom:Math.max(ee.y,se.y),flipX:ee.x>se.x,flipY:ee.y>se.y,width:0,height:0};ce.width=ce.right-ce.left,ce.height=ce.bottom-ce.top;let ue=KZi({dimensionStart:I,dimensionEnd:P,screenDimensionStart:ee,screenDimensionEnd:se,flipX:ce.flipX,flipY:ce.flipY});return Od.jsxs("div",{ref:V,"data-pcb-viewer":!0,tabIndex:0,style:{position:"relative",outline:"none"},onMouseDownCapture:()=>{H.current=!1},onClickCapture:(de)=>{if(!H.current)return;H.current=!1,de.stopPropagation(),V.current?.focus()},onContextMenuCapture:(de)=>{if(!h&&!s&&!H.current)return;de.preventDefault(),de.stopPropagation()},onMouseEnter:()=>{if(n&&V.current)V.current.focus()},onMouseLeave:()=>{if(V.current)V.current.blur()},onClick:()=>{if(V.current)V.current.focus()},onMouseMove:(de)=>{let me=de.currentTarget.getBoundingClientRect(),ge=de.clientX-me.left,xe=de.clientY-me.top,Ee=t1.applyToPoint(t1.inverse(t),{x:ge,y:xe});if(L.current.x=Ee.x,L.current.y=Ee.y,c){let Re=J(Ee);M({x:Re.point.x,y:Re.point.y}),y((Me)=>({...Me,end:Re.id}))}if(A)i?.(),D({x:Ee.x,y:Ee.y})},onMouseDown:(de)=>{H.current=h||s;let me=de.currentTarget.getBoundingClientRect(),ge=de.clientX-me.left,xe=de.clientY-me.top,Ee=t1.applyToPoint(t1.inverse(t),{x:ge,y:xe});if(u)de.preventDefault(),de.stopPropagation(),i?.(),T({x:Ee.x,y:Ee.y}),D({x:Ee.x,y:Ee.y}),m(!0),g(!0),b();else if(h&&!s){let Re=J(Ee);v({x:Re.point.x,y:Re.point.y}),M({x:Re.point.x,y:Re.point.y}),y({start:Re.id,end:Re.id}),a(!0),l(!0),C()}else if(c)l(!1),y((Re)=>({...Re,end:null}));else if(s)a(!1),y({start:null,end:null})},onMouseUp:(de)=>{if(!A)return;let me=de.currentTarget.getBoundingClientRect(),ge=de.clientX-me.left,xe=de.clientY-me.top,Ee=t1.applyToPoint(t1.inverse(t),{x:ge,y:xe}),Re={x:Ee.x,y:Ee.y};de.preventDefault(),de.stopPropagation(),i?.(),D(Re),g(!1),ie(B,Re)},children:[e,p&&Od.jsxs(Od.Fragment,{children:[Od.jsx("svg",{style:{position:"absolute",left:0,top:0,pointerEvents:"none",mixBlendMode:"difference",zIndex:Yh.dimensionOverlay},width:U.width,height:U.height,children:Od.jsx("rect",{x:te.left,y:te.top,width:te.width,height:te.height,stroke:"red",strokeWidth:1.5,strokeDasharray:"4,3",fill:"rgba(255, 0, 0, 0.12)"})}),Od.jsxs("div",{style:{left:0,bottom:s?58:0,position:"absolute",color:"red",fontFamily:"sans-serif",fontSize:12,margin:4,pointerEvents:"none",mixBlendMode:"difference",zIndex:Yh.dimensionOverlay},children:["minX: ",Z.minX.toFixed(2),", minY:"," ",Z.minY.toFixed(2),Od.jsx("br",{}),"maxX: ",Z.maxX.toFixed(2),", maxY:"," ",Z.maxY.toFixed(2)]})]}),s&&Od.jsxs(Od.Fragment,{children:[ue.show&&Od.jsx("div",{style:{position:"absolute",left:ue.x,top:ue.y,color:"red",mixBlendMode:"difference",pointerEvents:"none",fontSize:12,fontFamily:"sans-serif",whiteSpace:"nowrap",zIndex:Yh.dimensionOverlay},children:ue.distance.toFixed(2)}),Od.jsx("div",{style:{position:"absolute",left:ce.left,width:ce.width,textAlign:"center",top:ee.y+2,color:"red",mixBlendMode:"difference",pointerEvents:"none",marginTop:ce.flipY?0:-20,fontSize:12,fontFamily:"sans-serif",zIndex:Yh.dimensionOverlay},children:Math.abs(I.x-P.x).toFixed(2)}),Od.jsx("div",{style:{position:"absolute",left:se.x,height:ce.height,display:"flex",flexDirection:"column",justifyContent:"center",top:ce.top,color:"red",pointerEvents:"none",mixBlendMode:"difference",fontSize:12,fontFamily:"sans-serif",zIndex:Yh.dimensionOverlay},children:Od.jsx("div",{style:{marginLeft:ce.flipX?"-100%":4,paddingRight:4},children:Math.abs(I.y-P.y).toFixed(2)})}),Od.jsxs("svg",{style:{position:"absolute",left:0,top:0,pointerEvents:"none",mixBlendMode:"difference",zIndex:Yh.dimensionOverlay},width:U.width,height:U.height,children:[Od.jsx("defs",{children:Od.jsx("marker",{id:"head",orient:"auto",markerWidth:"3",markerHeight:"4",refX:"2",refY:"2",children:Od.jsx("path",{d:"M0,0 V4 L2,2 Z",fill:"red"})})}),Od.jsx("line",{x1:ee.x,y1:ee.y,x2:se.x,y2:se.y,markerEnd:"url(#head)",strokeWidth:1.5,fill:"none",stroke:"red"}),Od.jsx("line",{x1:ee.x,y1:ee.y,x2:se.x,y2:ee.y,strokeWidth:1.5,fill:"none",strokeDasharray:"2,2",stroke:"red"}),Od.jsx("line",{x1:se.x,y1:ee.y,x2:se.x,y2:se.y,strokeWidth:1.5,fill:"none",strokeDasharray:"2,2",stroke:"red"})]}),c&&Od.jsx(JZi,{points:K,startId:f.start,endId:f.end}),Od.jsxs("div",{style:{right:0,bottom:0,position:"absolute",color:"red",fontFamily:"sans-serif",fontSize:12,margin:4},children:["(",I.x.toFixed(2),",",I.y.toFixed(2),")",Od.jsx("br",{}),"(",P.x.toFixed(2),",",P.y.toFixed(2),")",Od.jsx("br",{}),"dist:"," ",Math.sqrt((P.x-I.x)**2+(P.y-I.y)**2).toFixed(2)]})]})]})},oes=(e,t,n=0)=>{let o=e.width/2,r=e.height/2,i=e.center.x-o-n,s=e.center.x+o+n,a=e.center.y-r-n,c=e.center.y+r+n;return t.x>i&&t.x<s&&t.y>a&&t.y<c},res=({children:e,disabled:t,transform:n,soup:o,cancelPanDrag:r,onCreateEditEvent:i,onModifyEditEvent:s})=>{if(!n)n=lT.identity();let a=yme.useRef(null),[c,l]=yme.useState(null),[h,d]=yme.useState(null),u=c!==null,_=xa((g)=>g.in_edit_mode),p=xa((g)=>g.in_move_footprint_mode),m=xa((g)=>g.setIsMovingComponent),A=t||!p;return Iwe.jsxs("div",{ref:a,style:{position:"relative",overflow:"hidden"},onMouseDown:(g)=>{if(A)return;let f=g.currentTarget.getBoundingClientRect(),y=g.clientX-f.left,x=g.clientY-f.top;if(Number.isNaN(y)||Number.isNaN(x))return;let C=lT.applyToPoint(lT.inverse(n),{x:y,y:x}),b=!1;for(let I of o)if(I.type==="pcb_component"&&oes(I,C,10/n.a)){r(),l(I.pcb_component_id),b=!0;let v=Math.random().toString();d({dragStart:C,originalCenter:I.center,dragEnd:C,edit_event_id:v}),i({edit_event_id:v,edit_event_type:"edit_pcb_component_location",pcb_edit_event_type:"edit_component_location",pcb_component_id:I.pcb_component_id,original_center:I.center,new_center:I.center,in_progress:!0,created_at:Date.now()}),m(!0);break}if(!b)l(null);if(b)return g.preventDefault(),!1},onMouseMove:(g)=>{if(!c||!h)return;let f=g.currentTarget.getBoundingClientRect(),y=g.clientX-f.left,x=g.clientY-f.top;if(Number.isNaN(y)||Number.isNaN(x))return;let C=lT.applyToPoint(lT.inverse(n),{x:y,y:x});d({...h,dragEnd:C}),s({edit_event_id:h.edit_event_id,new_center:{x:h.originalCenter.x+C.x-h.dragStart.x,y:h.originalCenter.y+C.y-h.dragStart.y}})},onMouseUp:(g)=>{if(!c)return;if(l(null),m(!1),h)s({edit_event_id:h.edit_event_id,in_progress:!1}),d(null)},children:[e,!A&&o.filter((g)=>g.type==="pcb_component").map((g)=>{if(!g?.center)return null;let f=lT.applyToPoint(n,g.center);return Iwe.jsx("div",{style:{position:"absolute",pointerEvents:"none",left:f.x,top:f.y,width:g.width*n.a+20,height:g.height*n.a+20,transform:"translate(-50%, -50%)",background:u&&c===g.pcb_component_id?"rgba(255, 0, 0, 0.2)":""}},g.pcb_component_id)})]})},lmt=(e,t)=>{let n=t.current;if(!n)return{transform:"translate(-50%, -100%)",left:e.x,top:e.y};let o=n.getBoundingClientRect(),r=200,i=10,s=60,a="-50%",c="-100%",{x:l,y:h}=e;if(e.x+s+r<o.width-i)l=e.x+s,a="0%";else if(e.x-s-r>i)l=e.x-s,a="-100%";else l=e.x,a="-50%";return{transform:`translate(${a}, ${c})`,left:l,top:h}},ies=({center:e})=>iT.jsxs("svg",{style:{position:"absolute",left:0,top:0,pointerEvents:"none",mixBlendMode:"difference",zIndex:Yh.errorOverlay+30},width:"100%",height:"100%",children:[iT.jsx("circle",{cx:e.x,cy:e.y,r:11,fill:"none",stroke:"#ff6b6b",strokeWidth:2.5,opacity:0.95}),iT.jsx("circle",{cx:e.x,cy:e.y,r:4.5,fill:"#ff6b6b",opacity:0.95}),iT.jsx("line",{x1:e.x-18,y1:e.y,x2:e.x-8,y2:e.y,stroke:"#ff6b6b",strokeWidth:2}),iT.jsx("line",{x1:e.x+8,y1:e.y,x2:e.x+18,y2:e.y,stroke:"#ff6b6b",strokeWidth:2}),iT.jsx("line",{x1:e.x,y1:e.y-18,x2:e.x,y2:e.y-8,stroke:"#ff6b6b",strokeWidth:2}),iT.jsx("line",{x1:e.x,y1:e.y+8,x2:e.x,y2:e.y+18,stroke:"#ff6b6b",strokeWidth:2})]}),aso=({errorCenter:e,isHighlighted:t=!1})=>E0.jsx("svg",{style:{position:"absolute",left:0,top:0,pointerEvents:"none",mixBlendMode:"difference",zIndex:Yh.errorOverlay},width:"100%",height:"100%",children:E0.jsx("rect",{x:e.x-7,y:e.y-7,width:14,height:14,transform:`rotate(45 ${e.x} ${e.y})`,fill:t?"#ff4444":"transparent",stroke:t?"#ff4444":"red",strokeWidth:t?2.5:1.5})}),hmt=rT`
  opacity: 0;
  pointer-events: none;
  background-color: rgba(0, 0, 0, 0.8);
  padding: 8px 12px;
  border-radius: 4px;
  width: 200px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  word-wrap: break-word;
  line-height: 1.4;
  transition: opacity 0.2s;
  margin-bottom: 10px;
  color: red;
`,ses=({children:e,transform:t=xme.identity(),elements:n})=>{let o=Lte.useRef(null),{isShowingDRCErrors:r,hoveredErrorId:i,focusedErrorId:s}=xa((m)=>({isShowingDRCErrors:m.is_showing_drc_errors,hoveredErrorId:m.hovered_error_id,focusedErrorId:m.focused_error_id})),a=s??i;if(!n)return E0.jsx("div",{style:{position:"relative"},ref:o,children:e});let c=n.filter((m)=>m.type==="pcb_trace_error"&&!m.message?.includes("Multiple components found with name")),l=n.filter((m)=>m.type==="pcb_via_clearance_error"),h=n.filter((m)=>m.type==="pcb_trace_error"&&m.message?.includes("Multiple components found with name")),d=uao(n),u=_ao(n,a),_=(m)=>{let A=hJi({error:m,indexes:d});if(!A||typeof A.x!=="number"||typeof A.y!=="number")return null;let g=xme.applyToPoint(t,A);if(Number.isNaN(g.x)||Number.isNaN(g.y))return null;return g},p=null;if(u)p=_(u);return E0.jsxs("div",{style:{position:"relative"},ref:o,children:[e,c.map((m,A)=>{let g=Qte(m,A),f=a===g;if(!f&&!r)return null;let y=_(m);if(!y)return null;let x=lmt(y,o);return E0.jsxs(Lte.Fragment,{children:[E0.jsx(aso,{errorCenter:y,isHighlighted:f}),E0.jsx("div",{style:{position:"absolute",left:y.x-15,top:y.y-15,width:30,height:30,zIndex:Yh.errorOverlay+5,cursor:"pointer",borderRadius:"50%"},onMouseEnter:(C)=>{let b=C.currentTarget.nextElementSibling;if(b){let I=b.querySelector(".error-message");if(I)I.style.opacity="1"}},onMouseLeave:(C)=>{if(!f){let b=C.currentTarget.nextElementSibling;if(b){let I=b.querySelector(".error-message");if(I)I.style.opacity="0"}}}}),E0.jsx("div",{style:{position:"absolute",zIndex:f?200:100,left:x.left,top:x.top,color:f?"#ff4444":"red",textAlign:"center",fontFamily:"sans-serif",fontSize:12,display:r||f?"flex":"none",flexDirection:"column",alignItems:"center",pointerEvents:"none",transform:x.transform},children:E0.jsx("div",{className:`error-message ${hmt}`,style:{opacity:f?1:0,border:`1px solid ${f?"#ff4444":"red"}`},children:m.message})})]},g)}),l.map((m,A)=>{let g=Qte(m,A),f=a===g;if(!f&&!r)return null;let y=_(m);if(!y)return null;let x=lmt({x:y.x,y:y.y},o);return E0.jsxs(Lte.Fragment,{children:[E0.jsx(aso,{errorCenter:y,isHighlighted:f}),E0.jsx("div",{style:{position:"absolute",left:y.x-15,top:y.y-15,width:30,height:30,zIndex:Yh.errorOverlay+5,cursor:"pointer",borderRadius:"50%"},onMouseEnter:(C)=>{let b=C.currentTarget.nextElementSibling;if(b){let I=b.querySelector(".error-message");if(I)I.style.opacity="1"}},onMouseLeave:(C)=>{if(!f){let b=C.currentTarget.nextElementSibling;if(b){let I=b.querySelector(".error-message");if(I)I.style.opacity="0"}}}}),E0.jsx("div",{style:{position:"absolute",zIndex:f?Yh.errorOverlay+10:Yh.errorOverlay+1,left:x.left,top:x.top,color:f?"#ff4444":"red",textAlign:"center",fontFamily:"sans-serif",fontSize:12,display:"flex",flexDirection:"column",alignItems:"center",pointerEvents:"none",transform:x.transform},children:E0.jsx("div",{className:`error-message ${hmt}`,style:{opacity:f?1:0,border:`1px solid ${f?"#ff4444":"red"}`},children:m.message})})]},g)}),h.map((m,A)=>{let g=m.component_name||m.message?.match(/name "([^"]+)"/)?.[1];if(!g)return null;let f=n?.filter((C)=>C.type==="source_component"&&C.name===g||C.type==="pcb_component"&&n?.find((b)=>b.type==="source_component"&&b.source_component_id===C.source_component_id&&b.name===g))||[],y=Qte(m,A),x=a===y;if(!x&&!r)return null;return f.map((C,b)=>{let I={x:0,y:0};if(C.type==="pcb_component")I=C.center||{x:0,y:0};else if(C.type==="source_component"){let L=n?.find((H)=>H.type==="pcb_component"&&H.source_component_id===C.source_component_id);if(L&&L.type==="pcb_component")I=L.center||{x:0,y:0}}let v=xme.applyToPoint(t,I);if(Number.isNaN(v.x)||Number.isNaN(v.y))return null;let P=Math.abs(t.a),N=Math.max(8,Math.min(30,0.5*P)),D=lmt(v,o);return E0.jsxs(Lte.Fragment,{children:[E0.jsx("svg",{style:{position:"absolute",left:0,top:0,pointerEvents:"none",mixBlendMode:"difference",zIndex:Yh.errorOverlay},width:"100%",height:"100%",children:x?E0.jsx("polygon",{points:`${v.x},${v.y-N*1.25} ${v.x+N},${v.y} ${v.x},${v.y+N*1.25} ${v.x-N},${v.y}`,fill:"#ff4444"}):E0.jsx("circle",{cx:v.x,cy:v.y,r:N,fill:"none",stroke:x?"#ff4444":"red",strokeWidth:x?Math.max(2,N*0.15):Math.max(1,N*0.1),opacity:1})}),E0.jsx("div",{style:{position:"absolute",left:v.x-(N+10),top:v.y-(N+10),width:(N+10)*2,height:(N+10)*2,zIndex:Yh.errorOverlay+5,cursor:"pointer",borderRadius:"50%"},onMouseEnter:(L)=>{let H=L.currentTarget.nextElementSibling;if(H){let V=H.querySelector(".error-message");if(V)V.style.opacity="1"}},onMouseLeave:(L)=>{if(!x){let H=L.currentTarget.nextElementSibling;if(H){let V=H.querySelector(".error-message");if(V)V.style.opacity="0"}}}}),E0.jsx("div",{style:{position:"absolute",zIndex:x?Yh.errorOverlay+20:Yh.errorOverlay+10,left:D.left,top:D.top,color:x?"#ff4444":"red",textAlign:"center",fontFamily:"sans-serif",fontSize:12,display:r||x?"flex":"none",flexDirection:"column",alignItems:"center",pointerEvents:"none",transform:D.transform},children:E0.jsx("div",{className:`error-message ${hmt}`,style:{opacity:x?1:0,border:`1px solid ${x?"#ff4444":"red"}`},children:m.message})})]},`${y}_${b}`)})}),p&&E0.jsx(ies,{center:p})]})};function aes(e,t){if(e.size!==t.size)return!1;return Array.from(e).every((n)=>t.has(n))}var FL=(e)=>e?.type==="pcb_component",Lao=(e)=>e?.type==="pcb_group",ces=(e)=>e?.type==="pcb_panel",Pmt=(e)=>e?.type==="pcb_board",xu={GROUP_PADDING:1,MIN_LINE_LENGTH_FOR_LABEL:40,LABEL_OFFSET_ABOVE:2,LABEL_OFFSET_BELOW:-18,LABEL_OFFSET_RIGHT:8,LABEL_OFFSET_LEFT:-120,Y_LABEL_MIN_WIDTH:110,LINE_STROKE_WIDTH:1.5,LINE_DASH_PATTERN:"4,4",COMPONENT_MARKER_RADIUS:3,LABEL_FONT_SIZE:11,ANCHOR_MARKER_SIZE:6,ANCHOR_MARKER_STROKE_WIDTH:1.5},M3={OFFSET_LINE:"white",COMPONENT_MARKER_FILL:"#66ccff",COMPONENT_MARKER_STROKE:"white",LABEL_TEXT:"white"},Wmt=({targets:e,transform:t,containerWidth:n,containerHeight:o})=>{if(e.length===0)return null;let r={color:M3.LABEL_TEXT,mixBlendMode:"difference",pointerEvents:"none",fontSize:xu.LABEL_FONT_SIZE,fontFamily:"monospace",fontWeight:"bold"},i=new Map;return e.forEach((s)=>{if(!i.has(s.anchor_id)){let a=Emt.applyToPoint(t,s.anchor);i.set(s.anchor_id,a)}}),P_.jsx("div",{style:{position:"absolute",left:0,top:0,width:n,height:o,overflow:"hidden",pointerEvents:"none",zIndex:Yh.dimensionOverlay},children:P_.jsxs("svg",{style:{position:"absolute",left:0,top:0,pointerEvents:"none"},width:n,height:o,children:[e.map((s)=>{let{anchor:a,anchor_id:c,target:l}=s,h=i.get(c),d=Emt.applyToPoint(t,l),u=l.x-a.x,_=l.y-a.y,p=Math.abs(d.x-h.x),m=Math.abs(d.y-h.y),A=d.y<h.y,g=d.x>h.x,f=A?xu.LABEL_OFFSET_ABOVE:xu.LABEL_OFFSET_BELOW,y=g?xu.LABEL_OFFSET_RIGHT:xu.LABEL_OFFSET_LEFT,x=p>xu.MIN_LINE_LENGTH_FOR_LABEL,C=m>xu.MIN_LINE_LENGTH_FOR_LABEL,b=`${s.display_offset_x??u.toFixed(2)}mm`,I=`${s.display_offset_y??_.toFixed(2)}mm`;return P_.jsxs("g",{children:[P_.jsx("line",{x1:h.x,y1:h.y,x2:d.x,y2:h.y,stroke:M3.OFFSET_LINE,strokeWidth:xu.LINE_STROKE_WIDTH,strokeDasharray:xu.LINE_DASH_PATTERN}),P_.jsx("line",{x1:d.x,y1:h.y,x2:d.x,y2:d.y,stroke:M3.OFFSET_LINE,strokeWidth:xu.LINE_STROKE_WIDTH,strokeDasharray:xu.LINE_DASH_PATTERN}),s.type==="component"||s.type==="board"?P_.jsx("circle",{cx:d.x,cy:d.y,r:xu.COMPONENT_MARKER_RADIUS,fill:M3.COMPONENT_MARKER_FILL,stroke:M3.COMPONENT_MARKER_STROKE,strokeWidth:1}):P_.jsxs(P_.Fragment,{children:[P_.jsx("line",{x1:d.x-xu.ANCHOR_MARKER_SIZE,y1:d.y,x2:d.x+xu.ANCHOR_MARKER_SIZE,y2:d.y,stroke:M3.OFFSET_LINE,strokeWidth:xu.ANCHOR_MARKER_STROKE_WIDTH}),P_.jsx("line",{x1:d.x,y1:d.y-xu.ANCHOR_MARKER_SIZE,x2:d.x,y2:d.y+xu.ANCHOR_MARKER_SIZE,stroke:M3.OFFSET_LINE,strokeWidth:xu.ANCHOR_MARKER_STROKE_WIDTH})]}),x&&P_.jsx("foreignObject",{x:Math.min(h.x,d.x),y:h.y+f,width:Math.abs(d.x-h.x),height:20,style:{overflow:"visible"},children:P_.jsx("div",{style:{...r,textAlign:"center"},children:b})}),C&&P_.jsx("foreignObject",{x:d.x+y,y:Math.min(h.y,d.y),width:xu.Y_LABEL_MIN_WIDTH,height:Math.abs(d.y-h.y),style:{overflow:"visible"},children:P_.jsx("div",{style:{...r,display:"flex",alignItems:"center",justifyContent:g?"flex-start":"flex-end",whiteSpace:"nowrap",padding:"0 4px",height:"100%"},children:I})})]},s.id)}),Array.from(i.entries()).map(([s,a])=>P_.jsxs("g",{children:[P_.jsx("line",{x1:a.x-xu.ANCHOR_MARKER_SIZE,y1:a.y,x2:a.x+xu.ANCHOR_MARKER_SIZE,y2:a.y,stroke:M3.OFFSET_LINE,strokeWidth:xu.ANCHOR_MARKER_STROKE_WIDTH}),P_.jsx("line",{x1:a.x,y1:a.y-xu.ANCHOR_MARKER_SIZE,x2:a.x,y2:a.y+xu.ANCHOR_MARKER_SIZE,stroke:M3.OFFSET_LINE,strokeWidth:xu.ANCHOR_MARKER_STROKE_WIDTH})]},`anchor-${s}`))]})})},les=({elements:e,highlightedPrimitives:t,transform:n,containerWidth:o,containerHeight:r})=>{let i=e.filter((g)=>Pmt(g)),s=e.filter((g)=>FL(g)),a=e.filter((g)=>Lao(g)),c=t.map((g)=>{if(FL(g._parent_pcb_component))return g._parent_pcb_component.pcb_component_id;if(FL(g._element))return g._element.pcb_component_id;return null}).filter((g)=>Boolean(g)),l=new Set;if(c.forEach((g)=>{let f=s.find((y)=>y.pcb_component_id===g);if(f?.pcb_group_id)l.add(f.pcb_group_id)}),!xa((g)=>g.is_showing_group_anchor_offsets)&&c.length===0)return null;let d=s.map((g)=>{let f=g.positioned_relative_to_pcb_board_id;if(!f)return null;let y=i.find((x)=>x.pcb_board_id===f);return y?{component:g,board:y,type:"component"}:null}).filter((g)=>Boolean(g)),u=a.map((g)=>{let f=g.positioned_relative_to_pcb_board_id;if(!f||!g.center)return null;let y=i.find((x)=>x.pcb_board_id===f);return y?{group:g,board:y,type:"group"}:null}).filter((g)=>Boolean(g)),_=[...d,...u];if(_.length===0)return null;let p=c.length===0,m=_.filter((g)=>{if(g.type==="component")return p||c.includes(g.component.pcb_component_id);else return p||l.has(g.group.pcb_group_id)});if(m.length===0)return null;let A=m.map((g)=>{if(g.type==="component")return{id:`${g.board.pcb_board_id}-${g.component.pcb_component_id}-${g.type}`,anchor:g.board.center,anchor_id:g.board.pcb_board_id,target:g.component.center,type:"component",display_offset_x:g.component.display_offset_x,display_offset_y:g.component.display_offset_y};return{id:`${g.board.pcb_board_id}-${g.group.pcb_group_id}-${g.type}`,anchor:g.board.center,anchor_id:g.board.pcb_board_id,target:{x:g.group.anchor_position?.x??g.group.center.x,y:g.group.anchor_position?.y??g.group.center.y},type:"group",display_offset_x:g.group.display_offset_x,display_offset_y:g.group.display_offset_y}}).filter((g)=>Boolean(g));return Hao.jsx(Wmt,{targets:A,transform:n,containerWidth:o,containerHeight:r})},hes=({elements:e,highlightedPrimitives:t,transform:n,containerWidth:o,containerHeight:r})=>{let i=e.filter((g)=>Lao(g)),s=e.filter((g)=>FL(g)),a=t.map((g)=>{if(FL(g._parent_pcb_component))return g._parent_pcb_component.pcb_component_id;if(FL(g._element))return g._element.pcb_component_id;return null}).filter((g)=>Boolean(g)),c=(g,f)=>{if(f.has(g))return;f.add(g);let y=i.find((x)=>x.pcb_group_id===g);if(y?.position_mode==="relative_to_group_anchor"&&y.positioned_relative_to_pcb_group_id)c(y.positioned_relative_to_pcb_group_id,f)},l=new Set;if(a.forEach((g)=>{let f=s.find((y)=>y.pcb_component_id===g);if(!f)return;if(f.position_mode==="relative_to_group_anchor"&&f.positioned_relative_to_pcb_group_id)c(f.positioned_relative_to_pcb_group_id,l);if(f.pcb_group_id)c(f.pcb_group_id,l)}),!xa((g)=>g.is_showing_group_anchor_offsets)&&a.length===0)return null;let d=s.map((g)=>{if(g.position_mode==="relative_to_group_anchor"&&g.positioned_relative_to_pcb_group_id){let f=i.find((y)=>y.pcb_group_id===g.positioned_relative_to_pcb_group_id);return f&&f.anchor_position?{component:g,parentGroup:f,type:"component"}:null}if(g.pcb_group_id){let f=i.find((y)=>y.pcb_group_id===g.pcb_group_id);return f&&f.anchor_position?{component:g,parentGroup:f,type:"component"}:null}return null}).filter((g)=>Boolean(g)),u=i.map((g)=>{if(g.position_mode==="relative_to_group_anchor"&&g.positioned_relative_to_pcb_group_id){let f=i.find((y)=>y.pcb_group_id===g.positioned_relative_to_pcb_group_id);if(f&&f.anchor_position&&g.anchor_position)return{group:g,parentGroup:f,type:"group"}}return null}).filter((g)=>Boolean(g)),_=[...d,...u];if(_.length===0)return null;let p=a.length===0,m=_.filter((g)=>{if(g.type==="component")return p||a.includes(g.component.pcb_component_id);else return p||l.has(g.group.pcb_group_id)||l.has(g.parentGroup.pcb_group_id)});if(m.length===0)return null;let A=m.map((g)=>{let f=g.parentGroup.anchor_position;if(!f)return null;if(g.type==="component"){if(!g.component.center)return null;return{id:`${g.parentGroup.pcb_group_id}-${g.component.pcb_component_id}-${g.type}`,anchor:f,anchor_id:g.parentGroup.pcb_group_id,target:g.component.center,type:"component",display_offset_x:g.component.display_offset_x,display_offset_y:g.component.display_offset_y}}if(!g.group.anchor_position)return null;return{id:`${g.parentGroup.pcb_group_id}-${g.group.pcb_group_id}-${g.type}`,anchor:f,anchor_id:g.parentGroup.pcb_group_id,target:g.group.anchor_position,type:"group",display_offset_x:g.group.display_offset_x,display_offset_y:g.group.display_offset_y}}).filter((g)=>Boolean(g));return Fao.jsx(Wmt,{targets:A,transform:n,containerWidth:o,containerHeight:r})},des=(e,t)=>{let n=e.pcb_component_id,o=t.filter((r)=>(r.type==="pcb_smtpad"||r.type==="pcb_plated_hole")&&r.pcb_component_id===n||r.type==="pcb_hole"&&r.pcb_component_id===n);if(o.length===0)return bmt([e]);return bmt(o)},ues=({elements:e,highlightedPrimitives:t,transform:n,containerWidth:o,containerHeight:r})=>{let i=new Map;for(let a of t){if(FL(a._parent_pcb_component))i.set(a._parent_pcb_component.pcb_component_id,a._parent_pcb_component);if(FL(a._element))i.set(a._element.pcb_component_id,a._element)}if(i.size===0)return null;let s=[];for(let a of i.values()){let c=des(a,e);if(!c)continue;let l=a.positioned_relative_to_pcb_group_id??a.pcb_group_id,h=l?cT(e).pcb_group.get(l):null;s.push({component:a,bbox:c,group:h})}if(s.length===0)return null;return sT.jsx("div",{style:{position:"absolute",left:0,top:0,width:o,height:r,overflow:"hidden",pointerEvents:"none",zIndex:Yh.dimensionOverlay},children:sT.jsx("svg",{style:{position:"absolute",left:0,top:0,pointerEvents:"none"},width:o,height:r,children:s.map(({component:a,bbox:c,group:l})=>{let h=swe.applyToPoint(n,{x:c.minX,y:c.maxY}),d=swe.applyToPoint(n,{x:c.maxX,y:c.minY}),u={x:Math.min(h.x,d.x),y:Math.min(h.y,d.y),width:Math.abs(d.x-h.x),height:Math.abs(d.y-h.y)},_=a.center??{x:(c.minX+c.maxX)/2,y:(c.minY+c.maxY)/2},p=swe.applyToPoint(n,_);return sT.jsxs("g",{children:[sT.jsx("rect",{x:u.x,y:u.y,width:u.width,height:u.height,fill:"none",stroke:"white",strokeWidth:1.5,strokeDasharray:"4,4"}),sT.jsx("line",{x1:p.x-6,y1:p.y,x2:p.x+6,y2:p.y,stroke:M3.COMPONENT_MARKER_STROKE,strokeWidth:1.5}),sT.jsx("line",{x1:p.x,y1:p.y-6,x2:p.x,y2:p.y+6,stroke:M3.COMPONENT_MARKER_STROKE,strokeWidth:1.5}),sT.jsx("circle",{cx:p.x,cy:p.y,r:xu.COMPONENT_MARKER_RADIUS,fill:M3.COMPONENT_MARKER_FILL,stroke:M3.COMPONENT_MARKER_STROKE,strokeWidth:1})]},a.pcb_component_id)})})})},pes=({elements:e,highlightedPrimitives:t,transform:n,containerWidth:o,containerHeight:r})=>{let i=e.filter((_)=>ces(_)),s=e.filter((_)=>Pmt(_)),a=t.map((_)=>{if(Pmt(_._element))return _._element.pcb_board_id;return null}).filter((_)=>Boolean(_));if(!xa((_)=>_.is_showing_group_anchor_offsets)&&a.length===0)return null;let l=s.map((_)=>{let{pcb_panel_id:p,position_mode:m}=_;if(!p||m!=="relative_to_panel_anchor")return null;let A=i.find((g)=>g.pcb_panel_id===p);return A?{board:_,panel:A,type:"board"}:null}).filter((_)=>Boolean(_));if(l.length===0)return null;let h=a.length===0,d=l.filter((_)=>h||a.includes(_.board.pcb_board_id));if(d.length===0)return null;let u=d.map((_)=>{if(!_.board.center)return null;return{id:`${_.panel.pcb_panel_id}-${_.board.pcb_board_id}-${_.type}`,anchor:_.panel.center,anchor_id:_.panel.pcb_panel_id,target:_.board.center,type:"board",display_offset_x:_.board.display_offset_x,display_offset_y:_.board.display_offset_y}}).filter((_)=>Boolean(_));return zao.jsx(Wmt,{targets:u,transform:n,containerWidth:o,containerHeight:r})};function mes(e){let{primitives:t,is_showing_multiple_traces_length:n,elements:o}=e,r=t.filter((c)=>c._element.type==="pcb_trace"),i=o.filter((c)=>c.type==="source_trace"),s=t.filter((c)=>c._element.type!=="pcb_trace"),a=r.filter((c)=>i.some((h)=>c._element.source_trace_id===h.source_trace_id&&h.max_length!==void 0)||Umt({primitiveElement:c._element,elements:o})!==null);if(!n)return[...s,...a];if(r.length>1){let c=r.reduce((l,h)=>{let d=l._element.trace_length;return h._element.trace_length<d?h:l},r[0]);return[...s,c]}return t}var _es={position:"absolute",left:0,top:0,pointerEvents:"none",color:"red",fontFamily:"sans-serif",fontSize:12,textShadow:"0 0 2px black"},ges=(e)=>{let{_element:t,_parent_pcb_component:n,_parent_source_component:o,_source_port:r}=e;switch(t.type){case"pcb_trace":{if(t.trace_length)return`${t.trace_length.toFixed(3)}`;return""}case"pcb_smtpad":case"pcb_plated_hole":{let i=[],s=Array.from(new Set((t.port_hints??[]).concat(r?.port_hints??[]))).filter((c)=>!/^[0-9]+$/.test(c)).filter((c)=>!c.includes("unnamed_")).sort((c,l)=>l.localeCompare(c)),a=o&&"name"in o&&o.name&&!o.name.includes("unnamed_")?o.name:null;if(s.length>0)if(a)i.push(...s.map((c)=>`${a}.${c}`));else i.push(...s);else if(a)i.push(a);return i.join(", ")}default:return""}},Aes={top:"red",bottom:"aqua"},fes=({primitive:e,mousePos:t,elements:n})=>{let[o,r]=vwe.useState(!1),i=e._element;vwe.useEffect(()=>{setTimeout(()=>{r(!0)},100)},[]);let[s,a,c,l]=[e.screen_x,e.screen_y,e.screen_w,e.screen_h],h=e.same_space_index??0,d=26,u=Aes[e?._element?.layer]??"red",_=0;if(i.type==="pcb_smtpad"&&i?.shape==="rotated_rect")_=i?.ccw_rotation??0;else if(i.type==="pcb_smtpad"&&(i?.shape==="pill"||i?.shape==="rotated_pill")&&"ccw_rotation"in e)_=i.ccw_rotation??0;else if(i.type==="pcb_plated_hole"&&(i?.shape==="pill"||i?.shape==="oval")&&"ccw_rotation"in e)_=i.ccw_rotation??0;if(i.type==="pcb_trace"){let A=gao({primitiveElement:i,elements:n});if(!A)return null;return ov.jsx("div",{style:{zIndex:Yh.elementOverlay,position:"absolute",left:t.x+12,top:t.y+12,color:u,pointerEvents:"none"},children:ov.jsxs("div",{style:{backgroundColor:"#f2efcc",color:A.isOverLength?"red":"black",textShadow:"none",WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale",padding:"4px 6px",borderRadius:"4px",fontSize:"11px",lineHeight:1.2,textAlign:"left",whiteSpace:"nowrap"},children:[A.text&&ov.jsx("div",{children:A.text}),A.name&&ov.jsx("div",{style:{marginTop:A.text?"2px":0},children:A.name})]})})}let p=ges(e);if(p.trim().length===0)return null;return ov.jsx("div",{style:{zIndex:Yh.elementOverlay,position:"absolute",left:s-c/2-8,top:a-l/2-8,width:c+16,height:l+16,color:u,transform:`rotate(${-_}deg)`,transformOrigin:"center center"},children:ov.jsx("div",{style:{width:o?`calc(100% + ${d*2*h}px)`:"100%",height:o?`calc(100% + ${d*2*h}px)`:"100%",marginLeft:o?`${-d*h}px`:0,marginTop:o?`${-d*h}px`:0,border:`1px solid ${u}`,opacity:o?1:h===0?1:0,transition:"width 0.2s, height 0.2s, margin-left 0.2s, margin-top 0.2s, opacity 0.2s"},children:ov.jsx("div",{style:{position:"absolute",bottom:l+20+d*h,marginRight:o?`${-d*h}px`:0,marginBottom:o?0:-d*h,transition:"margin-right 0.2s, margin-bottom 0.2s",backgroundColor:"#f2efcc",color:"black",textShadow:"none",WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale",padding:"6px 6px",borderRadius:"6px",fontSize:"14px",transform:`rotate(${_}deg)`,minWidth:"45px",textAlign:"center"},children:p})})})},yes=({highlightedPrimitives:e,mousePos:t,elements:n})=>{let[o,r]=xa((a)=>[a.is_moving_component,a.is_showing_multiple_traces_length]),i=e.some((a)=>a._element.type==="pcb_smtpad")&&e.some((a)=>a._element.type==="pcb_trace"),s=e;if(i)s=s.filter((a)=>a._element.type==="pcb_smtpad");return s=mes({primitives:s,is_showing_multiple_traces_length:r,elements:n}),ov.jsx("div",{style:_es,children:!o&&s.map((a)=>ov.jsx(fes,{primitive:a,mousePos:t,elements:n},a._pcb_drawing_object_id))})},hwe=(e)=>{if(e.length===0)return null;let t=e[0].x,n=e[0].y,o=e[0].x,r=e[0].y;for(let i of e){if(i.x<t)t=i.x;if(i.y<n)n=i.y;if(i.x>o)o=i.x;if(i.y>r)r=i.y}return{center:{x:(t+o)/2,y:(n+r)/2},width:o-t,height:r-n}},cso=(e,t)=>{if(t.length<3)return!1;let n=!1;for(let o=0,r=t.length-1;o<t.length;r=o++){let i=t[o].x,s=t[o].y,a=t[r].x,c=t[r].y;if(s>e.y!==c>e.y&&e.x<(a-i)*(e.y-s)/(c-s||Number.EPSILON)+i)n=!n}return n},Mmt=(e,t,n,o,r=!1)=>{let i=[];for(let s of e){if(!s._element)continue;if(!r&&s._element.type==="pcb_trace"&&s.layer!==o)continue;if("x1"in s&&s._element?.type==="pcb_trace"){let l=ia({x:t.x,y:t.y},{x:s.x1,y:s.y1},{x:s.x2,y:s.y2}),h=s.width||0.5,d=Math.max(h*25,2)/n.a;if(l<d)i.push(s);continue}if(s.pcb_drawing_type==="polygon"){let l=s.points.map((d)=>({x:Sn.parse(d.x),y:Sn.parse(d.y)})),h=hwe(l);if(!h)continue;if(t.x<h.center.x-h.width/2||t.x>h.center.x+h.width/2||t.y<h.center.y-h.height/2||t.y>h.center.y+h.height/2)continue;if(cso(t,l))i.push(s);continue}if(s.pcb_drawing_type==="polygon_with_arcs"){let l=s.brep_shape.outer_ring.vertices.map((d)=>({x:Sn.parse(d.x),y:Sn.parse(d.y)})),h=hwe(l);if(!h)continue;if(t.x<h.center.x-h.width/2||t.x>h.center.x+h.width/2||t.y<h.center.y-h.height/2||t.y>h.center.y+h.height/2)continue;if(cso(t,l))i.push(s);continue}if(!(("x"in s)&&("y"in s)))continue;let a=0,c=0;if("w"in s&&"h"in s)a=s.w,c=s.h;else if("r"in s)a=s.r*2,c=s.r*2;else if("rX"in s&&"rY"in s)a=s.rX*2,c=s.rY*2;else continue;if(Math.abs(s.x-t.x)<a/2&&Math.abs(s.y-t.y)<c/2)i.push(s)}return i},xes=({elements:e,children:t,transform:n,primitives:o,selectedLayer:r,onMouseHoverOverPrimitives:i})=>{let[s,a]=KG.useState([]),[c,l]=KG.useState({x:0,y:0}),[h,{width:d,height:u}]=Bme();KG.useEffect(()=>{a([]),i([])},[r,o,i]);let _=KG.useMemo(()=>{let m=[];for(let A of s){if(A._element?.type==="pcb_via")continue;if(A._element?.type==="pcb_component")continue;if(A?.layer==="drill")continue;if(A?.is_hoverable===!1)continue;let g=null,f=0,y=0;if(A.pcb_drawing_type==="polygon"){let I=hwe(A.points);if(!I)continue;g=I.center,f=I.width,y=I.height}else if(A.pcb_drawing_type==="polygon_with_arcs"){let I=A.brep_shape.outer_ring.vertices.map((P)=>({x:P.x,y:P.y})),v=hwe(I);if(!v)continue;g=v.center,f=v.width,y=v.height}else if(A.pcb_drawing_type==="line")g={x:(A.x1+A.x2)/2,y:(A.y1+A.y2)/2},f=Math.abs(A.x2-A.x1),y=Math.abs(A.y2-A.y1);else if("x"in A&&"y"in A)g={x:A.x,y:A.y},f="w"in A?A.w:("r"in A)?A.r*2:("rX"in A)&&("rY"in A)?A.rX*2:0,y="h"in A?A.h:("r"in A)?A.r*2:("rX"in A)&&("rY"in A)?A.rY*2:0;if(!g)continue;let x=Cme.applyToPoint(n,g),C={w:f*n.a,h:y*n.a},b=m.filter((I)=>x.x===I.screen_x&&x.y===I.screen_y&&C.w===I.screen_w&&C.h===I.screen_h).length;m.push({...A,x:g.x,y:g.y,w:f,h:y,screen_x:x.x,screen_y:x.y,screen_w:C.w,screen_h:C.h,same_space_index:b})}return m},[s,n]),p=(m,A,g,f)=>{l({x:m,y:A});let y=Cme.applyToPoint(Cme.inverse(g),{x:m,y:A}),x=Mmt(f,y,g,r);if(aes(new Set(x.map((C)=>C._pcb_drawing_object_id)),new Set(s.map((C)=>C._pcb_drawing_object_id))))return;a(x),i(x)};return iv.jsxs("div",{ref:h,style:{position:"relative",width:"100%",height:"100%"},onMouseMove:(m)=>{if(n){let A=m.currentTarget.getBoundingClientRect(),g=m.clientX-A.left,f=m.clientY-A.top;p(g,f,n,o)}},onTouchStart:(m)=>{if(n){let A=m.touches[0],g=m.currentTarget.getBoundingClientRect(),f=A.clientX-g.left,y=A.clientY-g.top;p(f,y,n,o)}},children:[t,iv.jsx(yes,{elements:e,mousePos:c,highlightedPrimitives:_}),n&&iv.jsxs(iv.Fragment,{children:[iv.jsx(les,{elements:e,highlightedPrimitives:_,transform:n,containerWidth:d,containerHeight:u}),iv.jsx(hes,{elements:e,highlightedPrimitives:_,transform:n,containerWidth:d,containerHeight:u}),iv.jsx(ues,{elements:e,highlightedPrimitives:_,transform:n,containerWidth:d,containerHeight:u}),iv.jsx(pes,{elements:e,highlightedPrimitives:_,transform:n,containerWidth:d,containerHeight:u})]})]})},lso=["rgb(255, 100, 100)","rgb(100, 255, 100)","rgb(100, 100, 255)","rgb(255, 255, 100)","rgb(255, 100, 255)","rgb(100, 255, 255)","rgb(255, 150, 100)","rgb(150, 100, 255)","rgb(100, 255, 150)","rgb(255, 100, 150)"],Ces=({children:e,transform:t=Oao.identity(),elements:n=[],hoveredComponentIds:o=[]})=>{let[r,{width:i,height:s}]=Bme(),a=Swe.useRef(null),{is_showing_pcb_groups:c,pcb_group_view_mode:l,is_showing_group_anchor_offsets:h}=xa((d)=>({is_showing_pcb_groups:d.is_showing_pcb_groups,pcb_group_view_mode:d.pcb_group_view_mode,is_showing_group_anchor_offsets:d.is_showing_group_anchor_offsets}));return Swe.useEffect(()=>{let d=a.current;if(!d||!i||!s)return;d.width=i,d.height=s;let u=d.getContext("2d");if(!u)return;if(u.clearRect(0,0,i,s),!c)return;let _=n.filter((b)=>b.type==="pcb_group"),p=n.filter((b)=>b.type==="pcb_component"),m=n.filter((b)=>b.type==="source_group"),A=new Map(m.map((b)=>[b.source_group_id,b])),g=_.filter((b)=>{if(b.name?.toLowerCase().includes("subpanel"))return!1;if(l==="all")return!0;if(!b.source_group_id)return!1;let I=A.get(b.source_group_id);if(!I)return!1;return I.was_automatically_named!==!0}),f=new Map;m.forEach((b)=>{let I=b;if(I.parent_source_group_id){let v=f.get(I.parent_source_group_id)||[];v.push(b.source_group_id),f.set(I.parent_source_group_id,v)}});let y=(b)=>{let I=[],v=f.get(b)||[];for(let P of v)I.push(P),I.push(...y(P));return I},x=(b)=>{let I=m.find((v)=>v.source_group_id===b);if(!I?.parent_source_group_id)return 0;return 1+x(I.parent_source_group_id)},C=new Set;if(o.length>0)for(let b of p){if(!o.includes(b.pcb_component_id))continue;let I=b.positioned_relative_to_pcb_group_id??b.pcb_group_id;if(I)C.add(I)}g.forEach((b,I)=>{let v=p.filter((Ee)=>Ee.pcb_group_id===b.pcb_group_id);if(b.source_group_id){let Ee=y(b.source_group_id),Re=_.filter((Me)=>Me.source_group_id&&Ee.includes(Me.source_group_id));for(let Me of Re){let _e=p.filter((ye)=>ye.pcb_group_id===Me.pcb_group_id);v=[...v,..._e]}}let P,M,B,T,N=!1;if(b.center&&b.width&&b.height){N=!0;let Ee=b.width/2,Re=b.height/2;P=b.center.x-Ee,B=b.center.x+Ee,M=b.center.y-Re,T=b.center.y+Re}else{if(v.length===0)return;if(P=1/0,M=1/0,B=-1/0,T=-1/0,v.forEach((Ee)=>{if(Ee.center&&typeof Ee.width==="number"&&typeof Ee.height==="number"){let Re=Ee.center.x-Ee.width/2,Me=Ee.center.x+Ee.width/2,_e=Ee.center.y+Ee.height/2,ye=Ee.center.y-Ee.height/2;P=Math.min(P,Re),B=Math.max(B,Me),M=Math.min(M,ye),T=Math.max(T,_e)}}),P===1/0||B===-1/0)return}let D=b.source_group_id?x(b.source_group_id):0,L=b.source_group_id?y(b.source_group_id).length>0:!1;if(!N){let Me=1+(L?0.5:0);P-=Me,B+=Me,M-=Me,T+=Me}let H=Tte.applyToPoint(t,{x:P,y:T}),V=Tte.applyToPoint(t,{x:B,y:T}),O=Tte.applyToPoint(t,{x:P,y:M}),U=Tte.applyToPoint(t,{x:B,y:M}),j=lso[I%lso.length];u.strokeStyle=j,u.lineWidth=2;let Y=Math.max(4,Math.min(12,8*Math.abs(t.a))),X=Math.max(2,Math.min(6,4*Math.abs(t.a))),J=Y*(L?1.3:1),ee=X;u.setLineDash([J,ee]),u.beginPath(),u.moveTo(H.x,H.y),u.lineTo(V.x,V.y),u.lineTo(U.x,U.y),u.lineTo(O.x,O.y),u.closePath(),u.stroke();let se=Math.max(8,Math.min(12,10*Math.abs(t.a))),ne=D==0||D==1?0:D*0.11,re=se*(1-ne),Z=4,te=b.name||`Group ${I+1}`;u.font=`${re}px sans-serif`,u.setLineDash([]);let ce=u.measureText(te).width+Z*2,ue=re+Z*2,de=H.x-5,me=H.y-5,ge=3;if(u.fillStyle="rgba(0, 0, 0, 0.8)",u.beginPath(),u.roundRect(de,me-ue,ce,ue,ge),u.fill(),u.fillStyle=j,u.textAlign="left",u.textBaseline="middle",u.fillText(te,de+Z,me-ue/2),h&&C.has(b.pcb_group_id)&&Boolean(b.anchor_position)&&b.anchor_position){let Ee=Array.isArray(b.anchor_position)?{x:b.anchor_position[0]??0,y:b.anchor_position[1]??0}:{x:b.anchor_position.x,y:b.anchor_position.y},Re=Tte.applyToPoint(t,Ee);u.strokeStyle="white",u.lineWidth=1.5,u.setLineDash([]);let Me=Math.max(4,Math.min(8,6*Math.abs(t.a)));u.beginPath(),u.moveTo(Re.x-Me,Re.y),u.lineTo(Re.x+Me,Re.y),u.stroke(),u.beginPath(),u.moveTo(Re.x,Re.y-Me),u.lineTo(Re.x,Re.y+Me),u.stroke()}})},[n,t,i,s,c,l,h,o]),Pwe.jsxs("div",{ref:r,style:{position:"relative",width:"100%",height:"100%"},children:[e,Pwe.jsx("canvas",{ref:a,style:{position:"absolute",top:0,left:0,pointerEvents:"none",zIndex:Yh.pcbGroupOverlay,display:c?"block":"none"}})]})};var bes=({transform:e,soup:t,children:n})=>{let o=xa((a)=>a.is_showing_rats_nest),{netMap:r,idToNetMap:i}=wmt.useMemo(()=>dao(t||[]),[t]),s=wmt.useMemo(()=>{if(!t||!o)return[];let a=(u)=>{let _=cT(t)[u.replace(/_\d+$/,"")].get(u);if(_&&"x"in _&&"y"in _)return{x:_.x,y:_.y};return null},c=(u,_)=>{let p=r[_]||[],m=null,A=1/0;return p.forEach((g)=>{let f=a(g);if(f){let y=Math.sqrt((u.x-f.x)**2+(u.y-f.y)**2);if(y<A&&y>0)A=y,m=f}}),m},l=cT(t).pcb_port.list(),h=cT(t).source_trace.list(),d=[];return l.forEach((u,_)=>{let p=i[u.pcb_port_id],m=!1;for(let f of h)if(f.connected_source_port_ids.includes(u.source_port_id)&&f.connected_source_net_ids.length>0)m=!0;if(!p)return;let A={x:u.x,y:u.y},g=c(A,p);if(!g)return;d.push({key:`${u.pcb_port_id}-${_}`,startPoint:A,endPoint:g,isInNet:m})}),d},[t,r,i,o]);if(!t||!o)return n;if(!e)e=bme.identity();return Ime.jsxs("div",{style:{position:"relative"},children:[n,Ime.jsx("svg",{style:{position:"absolute",left:0,top:0,width:"100%",height:"100%",pointerEvents:"none",opacity:0.5,zIndex:Yh.ratsNestOverlay},children:s.map(({key:a,startPoint:c,endPoint:l,isInNet:h})=>{let d=bme.applyToPoint(e,c),u=bme.applyToPoint(e,l);return Ime.jsx("line",{x1:d.x,y1:d.y,x2:u.x,y2:u.y,stroke:"white",strokeWidth:"1",strokeDasharray:h?"6,6":void 0},a)})})]})},Ies={name:"@tscircuit/pcb-viewer",version:"1.11.428",main:"dist/index.js",type:"module",repository:{type:"git",url:"https://github.com/tscircuit/pcb-viewer"},license:"MIT",scripts:{start:"cosmos",build:"tsup ./src/index.tsx --platform browser --dts --sourcemap --format esm --outDir dist",yalc:"npm run build && yalc push",format:"biome format . --write","format:check":"biome format .",cosmos:"cosmos","cosmos-export":"cosmos-export","test:copper-pour-x-ray":"bun run build && bun tests/copper-pour-x-ray/run.ts","test:x-ray-net":"bun run build && bun tests/x-ray-net/run.ts","test:component-focus":"bun run build && bun tests/component-focus/run.ts","test:measurement-context-menu":"bun run build && bun tests/measurement-context-menu/run.ts","test:copper-pour-opacity":"bun run build && bun tests/copper-pour-opacity/run.ts","test:webgpu":"bun run build && bun tests/webgpu/run.ts"},files:["dist"],devDependencies:{"@biomejs/biome":"^1.9.4","@semantic-release/commit-analyzer":"^9.0.2","@semantic-release/git":"^10.0.1","@semantic-release/npm":"^9.0.1","@semantic-release/release-notes-generator":"^10.0.3","@swc/core":"^1.4.12","@tscircuit/circuit-json-util":"^0.0.120","@tscircuit/circuit-json-webgpu":"github:tscircuit/circuit-json-webgpu#08f8a79c88d42ae8816905e33b63a801f25a23cb","@tscircuit/core":"^0.0.1701","@tscircuit/eagle-xml-converter":"^1.0.0","@types/bun":"latest","@types/color":"^3.0.6","@types/node":"18.7.23","@types/react":"19","@types/react-dom":"~19.1.0","@webgpu/types":"^0.1.72","circuit-json-to-connectivity-map":"^0.0.35",esbuild:"^0.25.2","format-si-unit":"^0.0.12",next:"^14.1.4","pixi.js":"^8.6.6",playwright:"1.63.0",react:"19.1.0","react-cosmos":"7.0.0-beta.4","react-cosmos-plugin-vite":"7.0.0-beta.0","react-dom":"19.1.0","react-use":"^17.4.0",tscircuit:"^0.0.2354",tsup:"^8.0.2","type-fest":"^3.0.0",typescript:"^5.4.4","use-mouse-matrix-transform":"^1.3.4",zod:"^3.23.5"},peerDependencies:{react:"*","react-dom":"*"},dependencies:{"@emotion/css":"^11.11.2","@tscircuit/alphabet":"^0.0.25","@tscircuit/math-utils":"^0.0.36","@vitejs/plugin-react":"^5.0.2","circuit-json":"^0.0.518","circuit-to-canvas":"0.0.135",color:"^4.2.3","react-supergrid":"^1.0.10","react-toastify":"^10.0.5","transformation-matrix":"^2.13.0",zustand:"^4.5.2"}},LP=(e,t,n)=>{let o=xa((s)=>s.is_mouse_over_container),r=UG.useRef(o),i=UG.useRef(t);UG.useEffect(()=>{r.current=o},[o]),UG.useEffect(()=>{i.current=t},[t]),UG.useEffect(()=>{if(!e)return;let s=(a)=>{let c=a.target;if(c.tagName==="INPUT"||c.tagName==="TEXTAREA"||c.isContentEditable)return;let l=e.split("+"),h=l.includes("ctrl"),d=l.includes("shift"),u=l.includes("alt"),_=l.includes("meta"),p=l[l.length-1],m=n?.current?n.current.contains(document.activeElement)||document.activeElement===n.current:!1;if((r.current||m)&&(!h||a.ctrlKey)&&(!d||a.shiftKey)&&(!u||a.altKey)&&(!_||a.metaKey)&&a.key.toLowerCase()===p.toLowerCase())a.preventDefault(),i.current()};return window.addEventListener("keydown",s),()=>{window.removeEventListener("keydown",s)}},[e])},ves=()=>{let[e,t]=Ewe.useState(!1);return Ewe.useEffect(()=>{let n=()=>{t(window.innerWidth<=768)};return n(),window.addEventListener("resize",n),()=>window.removeEventListener("resize",n)},[]),e},Dme=(e,t={stopPropagation:!0})=>{let n=vme.useRef(0),o=vme.useCallback((s)=>{if(t.stopPropagation)s.stopPropagation();let a=Date.now();if(a-n.current<300)return;n.current=a,e?.(s)},[e,t.stopPropagation]),r=vme.useCallback((s)=>{s.preventDefault(),o(s)},[o]);return{onClick:o,onTouchEnd:r,style:{touchAction:"manipulation"}}},lme=rT`
  background: #222;
  color: #eee;
  border: 1px solid #555;
  border-radius: 4px;
  padding: 4px;
  font: 12px sans-serif;
  box-shadow: 0 4px 16px #0008;
  outline: none;
`,e6=rT`
  display: block;
  width: 100%;
  padding: 8px;
  border: 0;
  border-radius: 2px;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
  &:hover, &:focus-visible { background: #444; }
`,Ses=({component:e,onViewSchematicComponent:t,position:n,onClose:o,onXRayNet:r,xRayGroups:i=[],onXRayGroup:s,xRayDisplayName:a="Net",onExitXRayNet:c})=>{let l=NKi(),[h,d]=aT.useState(!1),u=xa((N)=>N.hidden_layer_opacity),_=xa((N)=>N.setHiddenLayerOpacity),p=xa((N)=>N.copper_pour_opacity),m=xa((N)=>N.setCopperPourOpacity),A=xa((N)=>N.is_showing_copper_pours),g=xa((N)=>N.setIsShowingCopperPours),[f,y]=aT.useState(!1),x=A?p:0,[C,b]=aT.useState(!1),[I,v]=aT.useState(!1),P=aT.useRef(null),M=window.innerWidth<480,B=!M&&n.x+460>window.innerWidth,T=M?{position:"relative"}:{position:"absolute",top:0,...B?{right:"100%"}:{left:"100%"}};return aT.useEffect(()=>{let N=(L)=>{if(!P.current?.contains(L.target))L.preventDefault(),o()},D=(L)=>{if(L.key==="Escape")L.preventDefault(),o()};return P.current?.focus(),window.addEventListener("pointerdown",N,!0),window.addEventListener("keydown",D),window.addEventListener("resize",o),window.addEventListener("scroll",o,!0),()=>{window.removeEventListener("pointerdown",N,!0),window.removeEventListener("keydown",D),window.removeEventListener("resize",o),window.removeEventListener("scroll",o,!0)}},[o]),Vao.createPortal(dd.jsxs("div",{ref:P,role:"menu",tabIndex:-1,"aria-label":"PCB context menu",className:lme,onContextMenu:(N)=>{N.preventDefault(),N.stopPropagation()},onPointerDown:(N)=>N.stopPropagation(),onMouseDown:(N)=>N.stopPropagation(),onClick:(N)=>N.stopPropagation(),onKeyDown:(N)=>{N.stopPropagation();let D=N.target.closest("button"),L=D?.closest('[role="menu"]')??P.current;if(!L)return;let H=Array.from(L.querySelectorAll("button:not(:disabled)")).filter((V)=>V.closest('[role="menu"]')===L);if(N.key==="ArrowDown"||N.key==="ArrowUp"){N.preventDefault();let V=N.key==="ArrowDown"?1:-1,O=D?H.indexOf(D):V===1?-1:0;H[(O+V+H.length)%H.length]?.focus()}else if(N.key==="ArrowRight"&&D?.hasAttribute("aria-haspopup"))N.preventDefault(),D.click(),requestAnimationFrame(()=>D.parentElement?.querySelector('[role="menu"] button')?.focus());else if(N.key==="ArrowLeft"){if(N.preventDefault(),L.parentElement?.querySelector(":scope > button")?.focus(),L.getAttribute("aria-label")==="Hidden Layer Visibility")v(!1);else if(L.getAttribute("aria-label")==="Copper Pour Visibility")y(!1);else if(L.getAttribute("aria-label")==="Visibility")b(!1);else if(L.getAttribute("aria-label")==="Rendering Engine")d(!1)}else if(N.key==="Escape")N.preventDefault(),o()},style:{position:"fixed",zIndex:1e4,left:Math.max(B?310:4,Math.min(n.x,window.innerWidth-(M?248:168))),top:Math.max(4,Math.min(n.y,window.innerHeight-(M?340:260))),width:M?230:150,maxHeight:window.innerHeight-8,...M?{overflowY:"auto"}:{}},children:[r&&dd.jsxs("button",{type:"button",role:"menuitem",className:e6,style:{whiteSpace:"normal",overflowWrap:"anywhere"},onClick:()=>{r(),o()},children:["X-Ray ",a]}),s&&i.map((N)=>dd.jsxs("button",{type:"button",role:"menuitem",className:e6,style:{whiteSpace:"normal",overflowWrap:"anywhere"},onClick:()=>{s(N),o()},children:["X-Ray ",N.name]},N.id)),c&&dd.jsx("button",{type:"button",role:"menuitem",className:e6,onClick:()=>{c(),o()},children:"Exit X-Ray Net"}),dd.jsxs("div",{style:{position:"relative"},onMouseEnter:()=>{b(!0),d(!1)},children:[dd.jsx("button",{type:"button",role:"menuitem","aria-haspopup":"menu","aria-expanded":C,className:e6,onClick:()=>{b(!0),d(!1)},children:"Visibility ▸"}),C&&dd.jsxs("div",{role:"menu","aria-label":"Visibility",className:lme,style:T,children:[dd.jsxs("div",{style:{position:"relative"},onMouseEnter:()=>{v(!0),y(!1)},children:[dd.jsx("button",{type:"button",role:"menuitem","aria-haspopup":"menu","aria-expanded":I,className:e6,onClick:()=>{v(!0),y(!1)},children:"Hidden Layer Visibility ▸"}),I&&dd.jsx("div",{role:"menu","aria-label":"Hidden Layer Visibility",className:lme,style:{minWidth:80,...T},children:[0,0.05,0.1,0.2,0.4,0.6,0.8,1].map((N)=>dd.jsxs("button",{type:"button",role:"menuitemradio","aria-checked":u===N,className:e6,onClick:()=>{_(N),o()},children:[dd.jsx("span",{"aria-hidden":"true",style:{display:"inline-block",width:16},children:u===N?"✓":""}),N===0?"Hide":`${N*100}%`]},N))})]}),dd.jsxs("div",{style:{position:"relative"},onMouseEnter:()=>{y(!0),v(!1)},children:[dd.jsx("button",{type:"button",role:"menuitem","aria-haspopup":"menu","aria-expanded":f,className:e6,onClick:()=>{y(!0),v(!1)},children:"Copper Pour Visibility ▸"}),f&&dd.jsx("div",{role:"menu","aria-label":"Copper Pour Visibility",className:lme,style:{minWidth:80,...T},children:[0,0.05,0.1,0.2,0.4,0.6,0.8,1].map((N)=>dd.jsxs("button",{type:"button",role:"menuitemradio","aria-checked":x===N,className:e6,onClick:()=>{if(N>0)m(N);g(N>0),o()},children:[dd.jsx("span",{"aria-hidden":"true",style:{display:"inline-block",width:16},children:x===N?"✓":""}),N===0?"Hide":`${N*100}%`]},N))})]})]})]}),l&&dd.jsxs("div",{style:{position:"relative"},onMouseEnter:()=>{d(!0),b(!1)},children:[dd.jsx("button",{type:"button",role:"menuitem","aria-haspopup":"menu","aria-expanded":h,className:e6,onClick:()=>{d(!0),b(!1)},children:"Rendering Engine ▸"}),h&&dd.jsx("div",{role:"menu","aria-label":"Rendering Engine",className:lme,style:T,children:["canvas","webgpu"].map((N)=>dd.jsxs("button",{type:"button",role:"menuitemradio","aria-checked":l.renderer===N,className:e6,onClick:()=>{l.setRenderer(N),o()},children:[dd.jsx("span",{"aria-hidden":"true",style:{display:"inline-block",width:16},children:l.renderer===N?"✓":""}),N==="canvas"?"Canvas":"WebGPU (experimental)"]},N))})]}),e&&t&&dd.jsxs("button",{type:"button",role:"menuitem",className:e6,style:{whiteSpace:"normal",overflowWrap:"anywhere"},onClick:()=>{o(),t({source_component_id:e.source_component_id,pcb_component_id:e.pcb_component_id,refdes:e.refdes})},children:[dd.jsx("svg",{"aria-hidden":"true",width:"12",height:"12",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",style:{verticalAlign:"-1px",marginRight:5},children:dd.jsx("path",{d:"M5 11 11 5M5 5h6v6"})}),e.refdes," on Schematic"]}),e?.manufacturer_part_number&&dd.jsxs("button",{type:"button",role:"menuitem",disabled:!0,"aria-label":`Manufacturer part number: ${e.manufacturer_part_number}`,className:e6,style:{marginTop:4,background:"#292929",color:"#aaa",cursor:"default",whiteSpace:"normal",overflowWrap:"anywhere"},children:["MPN: ",e.manufacturer_part_number]})]}),document.body)},Dte=({children:e,isSmallScreen:t,onClick:n,...o})=>{let{style:r,...i}=Dme(n);return Yao.jsx("div",{...o,...i,style:{backgroundColor:"#1F1F1F",border:"1px solid #666",margin:0,padding:4,paddingLeft:t?8:6,paddingRight:t?8:6,borderRadius:2,color:"#eee",cursor:"pointer",fontSize:12,height:"fit-content",userSelect:"none",whiteSpace:"nowrap",...r,...o.style},children:e})},Pes=(e)=>{let t=new Map;return e.forEach((n,o)=>{let r=n.error_type||"unknown_error",i=t.get(r)||[];i.push({error:n,index:o,errorId:Qte(n,o)}),t.set(r,i)}),Array.from(t.entries()).map(([n,o])=>({errorType:n,errors:o}))},Ees=({onClose:e,setHoveredErrorId:t,setFocusedErrorId:n,highlightDurationMs:o=3000})=>{let r=YP.useRef(null),i=YP.useRef(null),s=YP.useRef(null),a=YP.useCallback(()=>{if(r.current!==null)window.clearTimeout(r.current),r.current=null;if(i.current!==null)window.cancelAnimationFrame(i.current),i.current=null},[]);YP.useEffect(()=>a,[a]);let c=YP.useCallback((h)=>{a(),s.current=h,t(h),n(null),i.current=window.requestAnimationFrame(()=>{n(h),i.current=null}),e(),r.current=window.setTimeout(()=>{s.current=null,t(null),n(null),r.current=null},o)},[a,o,e,n,t]),l=YP.useCallback((h)=>s.current===h,[]);return{handleErrorSelect:c,isSelectedError:l}},Mes=({errorId:e,errorMessage:t,copiedErrorId:n,onCopy:o})=>{let{style:r,...i}=Dme(()=>o(t,e));return np.jsx("button",{type:"button","aria-label":n===e?"Error message copied":"Copy error message",style:{position:"absolute",top:12,right:16,cursor:"pointer",color:"#888",fontSize:16,background:"none",border:"none",padding:0,display:"flex",alignItems:"center",...r},...i,children:n===e?np.jsx("span",{style:{color:"#4caf50",fontSize:12},children:"Copied!"}):np.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"currentColor",children:np.jsx("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"})})})},wes=({elements:e,isOpen:t,isSmallScreen:n,onToggle:o,onClose:r,setHoveredErrorId:i,setFocusedErrorId:s})=>{let[a,c]=VP.useState(null),[l,h]=VP.useState(new Set),[d,u]=VP.useState(new Set),[,_]=Hqi(),{handleErrorSelect:p,isSelectedError:m}=Ees({onClose:r,setHoveredErrorId:i,setFocusedErrorId:s}),A=VP.useMemo(()=>e?.filter((C)=>C.type.includes("error"))??[],[e]),g=A.length,f=VP.useMemo(()=>Pes(A),[A]),y=VP.useCallback((C)=>{h((b)=>{let I=new Set(b);if(I.has(C))I.delete(C);else I.add(C);return I})},[]),x=VP.useCallback((C)=>{u((b)=>{let I=new Set(b);if(I.has(C))I.delete(C);else I.add(C);return I})},[]);return np.jsxs("div",{style:{position:"relative"},children:[np.jsx(Dte,{isSmallScreen:n,style:g>0?{color:"red"}:void 0,onClick:o,children:np.jsxs("div",{children:[g," errors"]})}),t&&g>0&&np.jsx("div",{style:{position:"absolute",top:"100%",left:0,backgroundColor:"#2a2a2a",border:"1px solid #666",borderRadius:4,marginTop:4,zIndex:1000,minWidth:n?"280px":"400px",maxWidth:n?"90vw":"600px",maxHeight:"400px",overflow:"auto",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.3)"},children:f.map(({errorType:C,errors:b},I)=>{let v=l.has(C);return np.jsxs("div",{style:{borderBottom:I<f.length-1?"1px solid #444":"none"},children:[np.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"12px 16px",cursor:"pointer",backgroundColor:"#232323",transition:"background-color 0.2s ease",touchAction:"manipulation",position:"sticky",top:0,zIndex:1},onMouseEnter:(P)=>{P.currentTarget.style.backgroundColor="#303030"},onMouseLeave:(P)=>{P.currentTarget.style.backgroundColor="#232323"},onTouchStart:(P)=>{P.stopPropagation(),P.currentTarget.style.backgroundColor="#303030"},onTouchEnd:(P)=>{P.stopPropagation(),P.preventDefault(),P.currentTarget.style.backgroundColor="#232323",y(C)},onClick:(P)=>{P.stopPropagation(),y(C)},children:[np.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,color:"#ff6b6b"},children:[np.jsx("div",{style:{color:"#888",fontSize:"16px",transform:v?"rotate(90deg)":"rotate(0deg)",transition:"transform 0.2s ease",flexShrink:0},children:"›"}),np.jsx("div",{style:{fontWeight:"bold",fontSize:n?"12px":"13px"},children:C})]}),np.jsx("div",{style:{fontSize:n?"12px":"13px",color:"#aaa",whiteSpace:"nowrap",marginLeft:12},children:b.length})]}),!v&&b.map(({error:P,index:M,errorId:B})=>{let T=d.has(B),N=P.message??"No error message";return np.jsxs("div",{style:{borderTop:"1px solid #3a3a3a"},children:[np.jsxs("div",{style:{display:"flex",alignItems:"center",gap:12,padding:"12px 16px 12px 24px",cursor:"pointer",backgroundColor:"#2a2a2a",transition:"background-color 0.2s ease",touchAction:"manipulation"},onMouseEnter:(D)=>{D.currentTarget.style.backgroundColor="#333",i(B)},onMouseLeave:(D)=>{if(D.currentTarget.style.backgroundColor="#2a2a2a",!m(B))i(null)},onTouchStart:(D)=>{D.stopPropagation(),D.currentTarget.style.backgroundColor="#333",i(B)},onTouchEnd:(D)=>{D.stopPropagation(),D.preventDefault(),D.currentTarget.style.backgroundColor="#2a2a2a",p(B)},onClick:(D)=>{D.stopPropagation(),p(B)},children:[np.jsx("div",{style:{flex:1,fontSize:n?"12px":"13px",color:"#ddd",lineHeight:1.4,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",userSelect:"text"},children:N}),np.jsx("button",{type:"button","aria-label":T?"Collapse error details":"Expand error details",style:{color:"#888",fontSize:"16px",transform:T?"rotate(0deg)":"rotate(90deg)",transition:"transform 0.2s ease",flexShrink:0,background:"none",border:"none",padding:0,cursor:"pointer"},onMouseDown:(D)=>D.stopPropagation(),onClick:(D)=>{D.stopPropagation(),x(B)},onTouchEnd:(D)=>{D.stopPropagation(),D.preventDefault(),x(B)},children:"›"})]}),T&&np.jsxs("div",{"data-error-id":M,style:{display:"block",padding:"12px 16px 12px 24px",backgroundColor:"#1a1a1a",borderTop:"1px solid #444",position:"relative"},children:[np.jsx("div",{style:{fontSize:n?"11px":"12px",color:"#ccc",lineHeight:1.5,wordWrap:"break-word",overflowWrap:"break-word",hyphens:"auto",userSelect:"text",paddingRight:30},onMouseDown:(D)=>D.stopPropagation(),onClick:(D)=>D.stopPropagation(),children:N}),np.jsx(Mes,{errorId:B,errorMessage:N,copiedErrorId:a,onCopy:(D,L)=>{_(D),c(L),setTimeout(()=>c(null),2000)}})]})]},B)})]},C)})})]})},Bes=({name:e,selected:t,onClick:n})=>{let{style:o,...r}=Dme(n);return Vs.jsxs("div",{className:rT`
        margin-top: 2px;
        padding: 4px;
        padding-left: 8px;
        padding-right: 18px;
        cursor: pointer;

        &:hover {
          background-color: rgba(255, 255, 255, 0.1);
        }
      `,...r,style:o,children:[Vs.jsx("span",{style:{marginRight:2,opacity:t?1:0},children:"•"}),Vs.jsx("span",{style:{marginLeft:2,fontWeight:500,color:Tme[e.replace(/-/,"")]},children:e})]})},t6=({label:e,checked:t,onClick:n})=>{let{style:o,...r}=Dme(n);return Vs.jsxs("div",{className:rT`
        margin-top: 2px;
        padding: 4px;
        padding-left: 8px;
        padding-right: 18px;
        cursor: pointer;
        display: flex;
        align-items: center;
        gap: 8px;

        &:hover {
          background-color: rgba(255, 255, 255, 0.1);
        }
      `,...r,style:o,children:[Vs.jsx("input",{type:"checkbox",checked:t,onChange:()=>{},readOnly:!0}),Vs.jsx("span",{style:{color:"#eee"},children:e})]})},hso=({label:e,checked:t,onClick:n})=>{let{style:o,...r}=Dme(n);return Vs.jsxs("div",{className:rT`
        margin-top: 2px;
        padding: 4px;
        padding-left: 8px;
        padding-right: 18px;
        cursor: pointer;
        display: flex;
        align-items: center;
        gap: 8px;

        &:hover {
          background-color: rgba(255, 255, 255, 0.1);
        }
      `,...r,style:o,children:[Vs.jsx("input",{type:"radio",checked:t,onChange:()=>{},readOnly:!0}),Vs.jsx("span",{style:{color:"#eee"},children:e})]})},Tes=({children:e,elements:t,onContextMenuOpenChange:n,getNetAtPoint:o,getComponentAtPoint:r,onViewSchematicComponent:i,xRayNetIds:s=[],onXRayNetsChange:a})=>{let c=ves(),{isMouseOverContainer:l,setIsMouseOverContainer:h,selectedLayer:d,selectLayer:u,viewSettings:_,setIsShowingRatsNest:p,setIsShowingMultipleTracesLength:m,setIsShowingAutorouting:A,setIsShowingDrcErrors:g,setIsShowingDrcWarnings:f,setIsShowingCopperPours:y,setIsShowingCourtyards:x,setIsShowingPcbGroups:C,setIsShowingGroupAnchorOffsets:b,setIsShowingSolderMask:I,setIsShowingSilkscreen:v,setIsShowingFabricationNotes:P,setIsShowingPcbNotes:M,setPcbGroupViewMode:B,setHoveredErrorId:T,setFocusedErrorId:N}=xa((xt)=>({isMouseOverContainer:xt.is_mouse_over_container,setIsMouseOverContainer:xt.setIsMouseOverContainer,selectedLayer:xt.selected_layer,selectLayer:xt.selectLayer,viewSettings:{is_showing_rats_nest:xt.is_showing_rats_nest,is_showing_multiple_traces_length:xt.is_showing_multiple_traces_length,is_showing_autorouting:xt.is_showing_autorouting,is_showing_drc_errors:xt.is_showing_drc_errors,is_showing_drc_warnings:xt.is_showing_drc_warnings,is_showing_copper_pours:xt.is_showing_copper_pours,is_showing_courtyards:xt.is_showing_courtyards,is_showing_pcb_groups:xt.is_showing_pcb_groups,is_showing_group_anchor_offsets:xt.is_showing_group_anchor_offsets,is_showing_solder_mask:xt.is_showing_solder_mask,is_showing_silkscreen:xt.is_showing_silkscreen,is_showing_fabrication_notes:xt.is_showing_fabrication_notes,is_showing_pcb_notes:xt.is_showing_pcb_notes,pcb_group_view_mode:xt.pcb_group_view_mode},setIsShowingRatsNest:xt.setIsShowingRatsNest,setIsShowingMultipleTracesLength:xt.setIsShowingMultipleTracesLength,setIsShowingAutorouting:xt.setIsShowingAutorouting,setIsShowingDrcErrors:xt.setIsShowingDrcErrors,setIsShowingDrcWarnings:xt.setIsShowingDrcWarnings,setIsShowingCopperPours:xt.setIsShowingCopperPours,setIsShowingCourtyards:xt.setIsShowingCourtyards,setIsShowingPcbGroups:xt.setIsShowingPcbGroups,setIsShowingGroupAnchorOffsets:xt.setIsShowingGroupAnchorOffsets,setIsShowingSolderMask:xt.setIsShowingSolderMask,setIsShowingSilkscreen:xt.setIsShowingSilkscreen,setIsShowingFabricationNotes:xt.setIsShowingFabricationNotes,setIsShowingPcbNotes:xt.setIsShowingPcbNotes,setPcbGroupViewMode:xt.setPcbGroupViewMode,setHoveredErrorId:xt.setHoveredErrorId,setFocusedErrorId:xt.setFocusedErrorId})),[D,L]=Fl.useState(null),[H,V]=Fl.useState([]),[O,U]=Fl.useState(),[j,Y]=Fl.useState("Net"),[X,K]=Fl.useState(),J=(xt)=>{let Yt=xt.currentTarget.getBoundingClientRect();return r?.({x:xt.clientX-Yt.left,y:xt.clientY-Yt.top})},ee=Fl.useRef(null),se=xa((xt)=>xt.in_edit_mode),ne=(xt)=>{let Yt=xt.currentTarget.getBoundingClientRect();return o?.({x:xt.clientX-Yt.left,y:xt.clientY-Yt.top})},re=Fl.useCallback(()=>{L(null),n?.(!1)},[n]),[Z,te]=Fl.useState(!1),[ie,ce]=Fl.useState(!1),[ue,de]=Fl.useState(!1),[me,ge]=Fl.useState(!1),[xe,Ee]=Fl.useState(!1);Fl.useEffect(()=>{let xt=()=>ge(!0),Yt=()=>ge(!1),ut=()=>Ee(!0),Ze=()=>Ee(!1);return window.addEventListener("arm-dimension-tool",xt),window.addEventListener("disarm-dimension-tool",Yt),window.addEventListener("arm-bounds-tool",ut),window.addEventListener("disarm-bounds-tool",Ze),()=>{window.removeEventListener("arm-dimension-tool",xt),window.removeEventListener("disarm-dimension-tool",Yt),window.removeEventListener("arm-bounds-tool",ut),window.removeEventListener("disarm-bounds-tool",Ze)}},[]);let Re=fwe(t??[]),Me=Re,_e=Fl.useRef(!1),ye=Fl.useRef(null),Se={"1":Re[0]?()=>u(Re[0]):()=>{},"2":Re[1]?()=>u(Re[1]):()=>{},"3":Re[2]?()=>u(Re[2]):()=>{},"4":Re[3]?()=>u(Re[3]):()=>{},"5":Re[4]?()=>u(Re[4]):()=>{},"6":Re[5]?()=>u(Re[5]):()=>{},"7":Re[6]?()=>u(Re[6]):()=>{},"8":Re[7]?()=>u(Re[7]):()=>{},"9":Re[8]?()=>u(Re[8]):()=>{},"0":Re[9]?()=>u(Re[9]):()=>{}};LP("1",Se["1"],ye),LP("2",Se["2"],ye),LP("3",Se["3"],ye),LP("4",Se["4"],ye),LP("5",Se["5"],ye),LP("6",Se["6"],ye),LP("7",Se["7"],ye),LP("8",Se["8"],ye),LP("9",Se["9"],ye),LP("0",Se["0"],ye),Fl.useLayoutEffect(()=>{if(_e.current)return;_e.current=!0;let xt=(Yt)=>{if(ye.current){let ut=ye.current.getBoundingClientRect();if(Yt.clientX>=ut.left&&Yt.clientX<=ut.right&&Yt.clientY>=ut.top&&Yt.clientY<=ut.bottom)h(!0)}document.removeEventListener("mousemove",xt)};return document.addEventListener("mousemove",xt),()=>{document.removeEventListener("mousemove",xt)}},[h]);let Ne=Fl.useCallback(()=>{h(!0)},[h]),Le=Fl.useCallback(()=>{if(!l)h(!0)},[l,h]),nt=Fl.useCallback(()=>{h(!1),ce(!1),te(!1),de(!1)},[h]),dt=Fl.useCallback(()=>{ce(!ie)},[ie]),rt=Fl.useCallback(()=>{let xt=!ue;if(de(xt),xt)te(!1);if(!xt)T(null)},[ue,T]),pt=Fl.useCallback(()=>{de(!1)},[]),ct=Fl.useCallback(()=>{p(!_.is_showing_rats_nest)},[_.is_showing_rats_nest,p]),Ct=Fl.useCallback(()=>{ge(!0),Ee(!1),window.dispatchEvent(new Event("arm-dimension-tool"))},[]),kt=Fl.useCallback(()=>{Ee(!0),ge(!1),window.dispatchEvent(new Event("arm-bounds-tool"))},[]),Lt=Fl.useCallback(()=>{let xt=!Z;if(te(xt),xt)de(!1)},[Z]),Bt=Fl.useCallback((xt)=>{xt.stopPropagation()},[]);return Vs.jsxs("div",{ref:ye,onPointerDownCapture:(xt)=>{if(!xt.target.closest("[data-view-menu]"))te(!1)},onPointerDown:(xt)=>{ee.current={x:xt.clientX,y:xt.clientY}},onClick:(xt)=>{if(xt.detail>1||se||me||xe||xt.target.closest("button, input, select, [role=menu]"))return;let Yt=ee.current;if(!Yt||Math.hypot(xt.clientX-Yt.x,xt.clientY-Yt.y)>4)return;let ut=ne(xt),Ze=J(xt);if(!ut&&!Ze)return;let Fe=ut?.netId;if(Fe&&s.includes(Fe))a?.(s.filter((tt)=>tt!==Fe)),re();else U(Fe),Y(ut?.displayName??"Net"),V(ut?.groups??[]),K(Ze),n?.(!0),L({x:xt.clientX,y:xt.clientY})},onDoubleClick:()=>{a?.([]),re()},onContextMenu:(xt)=>{xt.preventDefault(),xt.stopPropagation();let Yt=ne(xt);K(J(xt)),U(Yt?.netId),Y(Yt?.displayName??"Net"),V(Yt?.groups??[]),n?.(!0),L({x:xt.clientX,y:xt.clientY})},style:{position:"relative",zIndex:"999 !important"},onMouseEnter:Ne,onMouseLeave:nt,onMouseMove:Le,children:[e,D&&Vs.jsx(Ses,{position:D,component:X,onViewSchematicComponent:i,onClose:re,xRayDisplayName:j,xRayGroups:H.filter((xt)=>xt.netIds.some((Yt)=>!s.includes(Yt))),onXRayGroup:(xt)=>a?.([...new Set([...s,...xt.netIds])]),onXRayNet:O&&!s.includes(O)?()=>a?.([...s,O]):void 0,onExitXRayNet:s.length>0?()=>a?.([]):void 0}),Vs.jsxs("div",{style:{position:"absolute",bottom:4,right:8,pointerEvents:"none",color:"white",fontSize:11,opacity:l?0.5:0,transition:"opacity 1s",transitionDelay:"2s",fontFamily:"sans-serif"},children:["@tscircuit/pcb-viewer@",Ies.version]}),Vs.jsxs("div",{"data-toolbar-overlay":!0,onTouchStart:(xt)=>xt.stopPropagation(),onTouchEnd:(xt)=>xt.stopPropagation(),onTouchMove:(xt)=>xt.stopPropagation(),onMouseDown:Bt,onMouseMove:Bt,onMouseUp:Bt,onPointerDown:Bt,onPointerMove:Bt,onPointerUp:Bt,onWheel:Bt,style:{position:"absolute",opacity:c?1:l?1:0,top:16,left:16,right:c?16:"auto",transition:l?"opacity 100ms linear":"opacity 300ms linear",zIndex:Yh.toolbarOverlay,color:"red",display:"flex",flexWrap:"wrap",maxWidth:"550px",gap:4,fontSize:12,fontFamily:"sans-serif"},children:[Vs.jsxs(Dte,{isSmallScreen:c,onClick:dt,onMouseLeave:()=>{if(ie)ce(!1)},children:[Vs.jsxs("div",{children:["layer:"," ",Vs.jsx("span",{style:{marginLeft:2,fontWeight:500,color:Tme[d]},children:d})]}),ie&&Vs.jsx("div",{style:{marginTop:4,minWidth:120},children:Me.map((xt)=>Vs.jsx(Bes,{name:xt,selected:xt===d,onClick:()=>{u(xt)}},xt))})]}),Vs.jsx(wes,{elements:t,isOpen:ue,isSmallScreen:c,onToggle:rt,onClose:pt,setHoveredErrorId:T,setFocusedErrorId:N}),Vs.jsx(Dte,{isSmallScreen:c,style:{},onClick:ct,children:Vs.jsxs("div",{children:[_.is_showing_rats_nest?"✖ ":"","Rats Nest"]})}),Vs.jsx(Dte,{isSmallScreen:c,style:me?{backgroundColor:"#444"}:{},onClick:Ct,children:Vs.jsx("div",{children:"\uD83D\uDCCF"})}),Vs.jsx(Dte,{isSmallScreen:c,style:xe?{backgroundColor:"#444"}:{},onClick:kt,children:Vs.jsx("div",{children:"Bounds"})}),Vs.jsx(Dte,{"data-view-menu":!0,isSmallScreen:c,onClick:Lt,children:Vs.jsxs("div",{children:[Vs.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"4px"},children:["View",Vs.jsx("span",{style:{fontSize:"8px",transform:Z?"rotate(180deg)":"rotate(0)",transition:"transform 0.1s ease",display:"inline-block"},children:"▼"})]}),Z&&Vs.jsxs("div",{style:{marginTop:4,minWidth:120},children:[Vs.jsx(t6,{label:"Show All Trace Lengths",checked:_.is_showing_multiple_traces_length,onClick:()=>{m(!_.is_showing_multiple_traces_length)}}),Vs.jsx(t6,{label:"Show Autorouting Animation",checked:_.is_showing_autorouting,onClick:()=>{A(!_.is_showing_autorouting)}}),Vs.jsx(t6,{label:"Show DRC Errors",checked:_.is_showing_drc_errors,onClick:()=>{g(!_.is_showing_drc_errors)}}),Vs.jsx(t6,{label:"Show DRC Warnings",checked:_.is_showing_drc_warnings,onClick:()=>{f(!_.is_showing_drc_warnings)}}),Vs.jsx(t6,{label:"Show Copper Pours",checked:_.is_showing_copper_pours,onClick:()=>{y(!_.is_showing_copper_pours)}}),Vs.jsx(t6,{label:"Show Courtyards",checked:_.is_showing_courtyards,onClick:()=>{x(!_.is_showing_courtyards)}}),Vs.jsx(t6,{label:"Show Solder Mask",checked:_.is_showing_solder_mask,onClick:()=>{I(!_.is_showing_solder_mask)}}),Vs.jsx(t6,{label:"Show Silkscreen",checked:_.is_showing_silkscreen,onClick:()=>{v(!_.is_showing_silkscreen)}}),Vs.jsx(t6,{label:"Show Fabrication Notes",checked:_.is_showing_fabrication_notes,onClick:()=>{P(!_.is_showing_fabrication_notes)}}),Vs.jsx(t6,{label:"Show PCB Notes",checked:_.is_showing_pcb_notes,onClick:()=>{M(!_.is_showing_pcb_notes)}}),Vs.jsx(t6,{label:"Show Group Anchor Offsets",checked:_.is_showing_group_anchor_offsets,onClick:()=>{b(!_.is_showing_group_anchor_offsets)}}),Vs.jsx(t6,{label:"Show PCB Groups",checked:_.is_showing_pcb_groups,onClick:()=>{C(!_.is_showing_pcb_groups)}}),_.is_showing_pcb_groups&&Vs.jsxs("div",{style:{marginLeft:16},children:[Vs.jsx(hso,{label:"Show All Groups",checked:_.pcb_group_view_mode==="all",onClick:()=>{B("all")}}),Vs.jsx(hso,{label:"Show Named Groups",checked:_.pcb_group_view_mode==="named_only",onClick:()=>{B("named_only")}})]})]})]})})]})]})},Des=(e)=>e.type==="pcb_manual_edit_conflict_warning"||e.type==="pcb_connector_not_in_accessible_orientation_warning",Nes=(e)=>{if(e.type==="pcb_connector_not_in_accessible_orientation_warning")return`Connector faces ${e.facing_direction}; expected ${e.recommended_facing_direction}`;return"Manual Edit Conflict"},Res=({children:e,transform:t=wwe.identity(),elements:n=[]})=>{let[o,{width:r,height:i}]=Bme(),s=Mwe.useRef(null),a=xa((c)=>c.is_showing_drc_warnings);if(Mwe.useEffect(()=>{let c=s.current;if(!c||!r||!i)return;c.width=r,c.height=i;let l=c.getContext("2d");if(!l)return;l.clearRect(0,0,r,i);let h=n.filter((u)=>u.type==="pcb_component"),d=n.filter(Des);l.strokeStyle=fr.board.drc_warning,l.lineWidth=2,d.forEach((u)=>{let _=h.find((V)=>V.pcb_component_id===u.pcb_component_id);if(!_)return;let{width:p,height:m,center:A}=_,g=wwe.applyToPoint(t,A),f=p*Math.abs(t.a),y=m*Math.abs(t.d),x=0.1*Math.abs(t.a),C=f+x*2,b=y+x*2,I=g.x-C/2,v=g.y-b/2;l.beginPath(),l.rect(I,v,C,b),l.stroke();let P=Nes(u),M=4,B=Math.max(8,Math.min(12,10*Math.abs(t.a)));l.font=`${B}px sans-serif`;let N=l.measureText(P).width+M*2,D=B+M*2,L=I+(C-N)/2,H=v+b+5;l.fillStyle="rgba(0, 0, 0, 0.7)",l.beginPath(),l.roundRect(L,H,N,D,3),l.fill(),l.fillStyle=fr.board.drc_warning,l.textAlign="center",l.textBaseline="middle",l.fillText(P,L+N/2,H+D/2)})},[n,t,r,i,a]),!a)return Sme.jsx("div",{ref:o,style:{position:"relative",width:"100%",height:"100%"},children:e});return Sme.jsxs("div",{ref:o,style:{position:"relative",width:"100%",height:"100%"},children:[e,Sme.jsx("canvas",{ref:s,style:{position:"absolute",top:0,left:0,pointerEvents:"none",zIndex:Yh.warnings}})]})},Uao=(e,t,n,o)=>{if(n<=0||o<=0)return;let r=e.find((s)=>s.type==="pcb_component"&&s.pcb_component_id===t);if(r?.type!=="pcb_component")return;let i=qso(r);if(!i)return;return{component:r,bounds:i,transform:mao({bounds:i,width:n,height:o})}},Qes=({focusRequest:e,elements:t,transform:n})=>{let o=e?.pcbComponentId,r=xa((h)=>h.selectLayer),i=o?Uao(t,o,1,1):void 0,s=i?.component.layer;if(Gao.useEffect(()=>{if(s)r(s)},[e,s,r]),!i||!n)return null;let{bounds:a}=i,c=Bmt.applyToPoint(n,{x:a.minX,y:a.minY}),l=Bmt.applyToPoint(n,{x:a.maxX,y:a.maxY});return Wao.jsx("div",{"data-focused-pcb-component-id":o,style:{position:"absolute",left:Math.min(c.x,l.x)-4,top:Math.min(c.y,l.y)-4,width:Math.abs(l.x-c.x)+8,height:Math.abs(l.y-c.y)+8,border:"2px solid #3399ff",borderRadius:4,boxSizing:"border-box",pointerEvents:"none",zIndex:Yh.elementOverlay}})},kes=(e)=>{let{transform:t,elements:n}=e,{hoveredErrorId:o,focusedErrorId:r,isShowingCopperPours:i,copperPourOpacity:s,selectedLayer:a}=xa((T)=>({hoveredErrorId:T.hovered_error_id,focusedErrorId:T.focused_error_id,isShowingCopperPours:T.is_showing_copper_pours,copperPourOpacity:T.copper_pour_opacity,selectedLayer:T.selected_layer})),c=r??o,l=M0.useMemo(()=>i?n:n.filter((T)=>T.type!=="pcb_copper_pour"),[n,i]),h=M0.useMemo(()=>{let T=oJi(n);return l.flatMap((N)=>rJi(N,n,T))},[l,n]),d=M0.useMemo(()=>dao(n),[n]),[u,_]=M0.useState([]);M0.useEffect(()=>_([]),[d]),M0.useEffect(()=>{if(u.length===0)return;let T=(N)=>{if(N.key==="Escape")_([])};return window.addEventListener("keydown",T,!0),()=>window.removeEventListener("keydown",T,!0)},[u.length]);let p=M0.useMemo(()=>u.length>0?l.filter((T)=>Oio(T)&&(T.type!=="pcb_copper_pour"||s>0)&&u.includes(Nte(T,d)??"")):void 0,[l,d,u,s]),m=M0.useMemo(()=>{if(!p)return h;let T=new Set(p);return h.filter((N)=>(N._element?.type==="pcb_smtpad"||N._element?.type==="pcb_plated_hole")&&T.has(N._element))},[h,p]),A=(T)=>{if(!t)return;let N=Mmt(h,HL.applyToPoint(HL.inverse(t),T),t,a).filter((D)=>D._element?.type==="pcb_smtpad"||D._element?.type==="pcb_plated_hole");return N.sort((D,L)=>Number(L.layer===a)-Number(D.layer===a)),Gqi(N[0]?._element,n)},g=(T)=>{if(!t)return;let N=(H,V)=>({netId:H,displayName:AJi(V,n,d),groups:fJi(H,n,d)});if(i&&s>0)for(let H of yJi(l,HL.applyToPoint(HL.inverse(t),T),a).reverse()){let V=Nte(H,d);if(V)return N(V,H)}let L=Mmt(h,HL.applyToPoint(HL.inverse(t),T),t,a,u.length>0).filter((H)=>Oio(H._element)&&H.layer!=="drill");L.sort((H,V)=>Number(V.layer===a)-Number(H.layer===a));for(let H of L){let V=Nte(H._element,d);if(V&&u.includes(V))return N(V,H._element)}for(let H of L){let V=Nte(H._element,d);if(V)return N(V,H._element)}},[f,y]=M0.useState({drawingObjectIdsWithMouseOver:new Set,primitiveIdsInMousedOverNet:[]}),[x,C]=M0.useState([]),b=M0.useRef(t??null),I=M0.useRef(null),v=M0.useMemo(()=>uao(n),[n]),P=M0.useMemo(()=>{if(!c)return[];let N=n.filter((D)=>D.type.includes("error")).find((D,L)=>Qte(D,L)===c);if(!N)return[];return pJi(N)},[c,n]);M0.useEffect(()=>{if(t)b.current=t},[t]),M0.useEffect(()=>()=>{zio(I.current)},[]),M0.useEffect(()=>{if(!e.width||!e.height||!e.setTransform||!r)return;let T=_ao(n,r);if(!T)return;let N=uJi({error:T,indexes:v});if(!N)return;let D=b.current??t;if(!D)return;let L=mao({bounds:N,width:e.width,height:e.height});zio(I.current),gJi({startTransform:D,endTransform:L,durationMs:420,setAnimationFrameId:(H)=>{I.current=H},onUpdate:(H)=>{b.current=H,e.setTransform?.(H)}})},[r,n,v,e.height,e.setTransform,e.width]);let M=M0.useMemo(()=>{if(u.length>0)return h;let T=[...f.primitiveIdsInMousedOverNet,...P];return iJi({primitivesWithoutInteractionMetadata:h,drawingObjectIdsWithMouseOver:f.drawingObjectIdsWithMouseOver,primitiveIdsInMousedOverNet:T})},[h,f,P,u]),B=M0.useCallback((T)=>{let N=[];for(let H of T)if(H._element){let V=d.getNetConnectedToId("pcb_port_id"in H._element?H._element?.pcb_port_id:("pcb_trace_id"in H._element)?H._element?.pcb_trace_id:"");N.push(...d.getIdsConnectedToNet(V))}let D=new Set(T.map((H)=>H._pcb_drawing_object_id));y({drawingObjectIdsWithMouseOver:D,primitiveIdsInMousedOverNet:N});let L=T.map((H)=>{if(H._parent_pcb_component?.type==="pcb_component"&&H._parent_pcb_component.pcb_component_id)return H._parent_pcb_component.pcb_component_id;if(H._element?.type==="pcb_component"&&H._element.pcb_component_id)return H._element.pcb_component_id;return null}).filter((H)=>Boolean(H));C(Array.from(new Set(L)))},[d]);return b5.jsxs(xes,{elements:l,transform:t,primitives:m,selectedLayer:a,onMouseHoverOverPrimitives:B,children:[b5.jsx(Qes,{focusRequest:e.focusedPcbComponent,elements:n,transform:t}),b5.jsx(res,{disabled:!e.allowEditing,transform:t,soup:n,cancelPanDrag:e.cancelPanDrag,onCreateEditEvent:e.onCreateEditEvent,onModifyEditEvent:e.onModifyEditEvent,children:b5.jsx(nes,{transform:t,focusOnHover:e.focusOnHover,primitives:h,onBoundsSelected:e.onBoundsSelected,cancelPanDrag:e.cancelPanDrag,children:b5.jsx(Tes,{elements:n,getNetAtPoint:g,xRayNetIds:u,onXRayNetsChange:_,onContextMenuOpenChange:e.onContextMenuOpenChange,getComponentAtPoint:A,onViewSchematicComponent:e.onViewSchematicComponent,children:b5.jsx(ses,{transform:t,elements:n,children:b5.jsx(bes,{transform:t,soup:n,children:b5.jsx(Ces,{transform:t,elements:n,hoveredComponentIds:x,children:b5.jsx(GZi,{transform:t,debugGraphics:e.debugGraphics,children:b5.jsx(Res,{transform:t,elements:n,children:e.renderer==="canvas"?b5.jsx(xZi,{transform:t,primitives:M,elements:l,circuitJson:n,xRayElements:p,width:e.width,height:e.height,grid:e.grid,onRenderComplete:e.onRenderComplete}):b5.jsx(bJi,{transform:t,primitives:M,elements:n,xRayElements:p,width:e.width,height:e.height,grid:e.grid,onRenderComplete:e.onRenderComplete})})})})})})})})})]})},owe=(e)=>Number.isFinite(e)?e.toFixed(4):"NaN",Les=(e)=>{let t=5381;for(let n=0;n<e.length;n++)t=(t<<5)+t+e.charCodeAt(n);return Math.abs(t)},Hes=(e)=>{if(!e?.length)return"0";let t=[];for(let r of e){if(!r?.type?.startsWith("pcb_"))continue;let i=yqi(r),s=bmt([r]),a=[owe(s.minX),owe(s.minY),owe(s.maxX),owe(s.maxY)].join(","),c=`${i}:${a}`;if(r.type==="pcb_trace"){let l=(r.route??[]).length;c+=`:${l}`;for(let h of r.route??[]){if(h.route_type!=="via")continue;c+=`:${h.tented_on_top}:${h.tented_on_bottom}`}}if(r.type==="pcb_board")c+=`:${r.default_via_tented_on_top}:${r.default_via_tented_on_bottom}`;if(r.type==="pcb_via")c+=`:${r.tented_on_top}:${r.tented_on_bottom}`;t.push(c)}if(t.length===0)return"0";t.sort();let n=t.join(","),o=Les(n);return`${t.length}_${o.toString(36)}`},Fes=(e)=>{if(!e)return"empty";let t=e.find((o)=>o.type==="pcb_board");if(!t)return"no-board";let n=(o)=>Math.round(o*1000)/1000;if(t.outline)return t.outline.map((o)=>`${n(o.x)}_${n(o.y)}`).join(",");return`${n(t.width)}_${n(t.height)}`};function zes({circuitJson:e,editEvents:t}){let n=structuredClone(e);for(let o of t){if(o.edit_event_type==="edit_pcb_component_location"){let a=cT(n).pcb_component.get(o.pcb_component_id);if(a?.center.x===o.new_center.x&&a.center.y===o.new_center.y)continue;let l=Xao.translate(o.new_center.x-o.original_center.x,o.new_center.y-o.original_center.y);n=n.map((h)=>("pcb_component_id"in h)&&h.pcb_component_id===o.pcb_component_id?fqi(h,l):h);continue}if(o.edit_event_type==="edit_schematic_component_location"){n=n.map((a)=>a.type==="schematic_component"&&a.schematic_component_id===o.schematic_component_id?{...a,center:o.new_center}:a);continue}if(o.edit_event_type!=="edit_pcb_trace_hint")continue;if(!o.pcb_trace_hint_id)continue;if(cT(n).pcb_trace_hint.get(o.pcb_trace_hint_id)){n=n.map((a)=>a.type==="pcb_trace_hint"&&a.pcb_trace_hint_id===o.pcb_trace_hint_id?{...a,route:o.route}:a);continue}let i=cT(n).pcb_port.get(o.pcb_port_id);if(!i?.pcb_component_id)continue;let s={type:"pcb_trace_hint",pcb_trace_hint_id:o.pcb_trace_hint_id,route:o.route,pcb_port_id:o.pcb_port_id,pcb_component_id:i.pcb_component_id};n=n.filter((a)=>a.type!=="pcb_trace_hint"||a.pcb_port_id!==o.pcb_port_id).concat(s)}return n}var Oes=UP.compose(UP.translate(400,300),UP.scale(40,-40)),dso=()=>{let e=tao(P0.RENDERING_ENGINE,"webgpu");return e==="canvas"||e==="webgpu"?e:"webgpu"},Xmt=({circuitJson:e,debugGraphics:t,height:n=600,renderer:o,initialState:r,allowEditing:i=!0,editEvents:s,onEditEventsChanged:a,onRenderComplete:c,onBoundsSelected:l,onViewSchematicComponent:h,focusOnHover:d=!1,clickToInteractEnabled:u=!1,disablePcbGroups:_=!1,controller:p})=>{let[m,A]=Cu.useState(()=>o??dso()),[g,f]=Cu.useState(null);Cu.useEffect(()=>A(o??dso()),[o]);let y=Cu.useCallback((ie)=>{A(ie),nao(P0.RENDERING_ENGINE,ie)},[]),x=Cu.useMemo(()=>({renderer:m,setRenderer:y}),[m,y]),[C,b]=Cu.useState(!u),[I,v]=Cu.useState(!1),P=Cu.useRef(!1),[M,B]=Bme(),[T,N]=Cu.useState(Oes),D=Cu.useCallback((ie)=>{if(P.current)return!1;if(ie instanceof MouseEvent&&(ie.button===2||(ie.buttons&2)!==0))return!1;let ce=ie.target;if(!(ce instanceof Element))return!0;return!ce.closest("[data-toolbar-overlay]")},[]),{ref:L,setTransform:H,cancelDrag:V}=Yqi({transform:T,onSetTransform:N,enabled:C&&!I,shouldDrag:D}),O=Cu.useCallback((ie)=>{if(P.current=ie,ie)V();v(ie)},[V]),[U,j]=Cu.useState([]);U=s??U;let Y=Cu.useRef(!1),X=Cu.useRef(null),K=Cu.useMemo(()=>Hes(e),[e]),J=Fes(e),ee=()=>{let ie=B?.width>0?B:{width:500,height:500},{center:ce,width:ue,height:de}=ne.some((xe)=>xe.type.startsWith("pcb_"))?Sqi(ne.filter((xe)=>xe.type.startsWith("pcb_"))):{center:{x:0,y:0},width:0.001,height:0.001},me=Math.min((ie.width??0)/ue,(ie.height??0)/de,100)*0.75,ge=UP.compose(UP.translate((ie.width??0)/2,(ie.height??0)/2),UP.scale(me,-me,0,0),UP.translate(-ce.x,-ce.y));H(ge);return};Cu.useEffect(()=>{if(!B?.width)return;if(!e)return;if(e.length===0)return;if(!Y.current)ee(),Y.current=!0},[e,B]),Cu.useEffect(()=>{if(Y.current===!0)ee()},[J]);let se=Cu.useMemo(()=>e?.filter((ie)=>ie.type.startsWith("pcb_")||ie.type.startsWith("source_"))??[],[K]),ne=Cu.useMemo(()=>zes({circuitJson:se,editEvents:U}),[se,U]);Cu.useEffect(()=>{let ie=p?.focusRequest;if(!ie||!B.width||!n||!ne.length)return;let ce=Uao(ne,ie.pcbComponentId,B.width,n);if(ce)V(),H(ce.transform),f(ie);p.onFocusRequestHandled(ie)},[p,ne,B.width,n,V,H]);let re=(ie)=>{j([...U,ie]),a?.([...U,ie])},Z=(ie)=>{let ce=U.map((ue)=>ue.edit_event_id===ie.edit_event_id?{...ue,...ie}:ue);j(ce),a?.(ce)},te=Cu.useMemo(()=>({...r,..._&&{is_showing_pcb_groups:!1}}),[r,_]);return FP.jsx(mso.Provider,{value:x,children:FP.jsxs("div",{ref:L,style:{position:"relative"},onContextMenu:(ie)=>ie.preventDefault(),children:[FP.jsx("div",{ref:M,children:FP.jsxs(Bqi,{initialState:te,disablePcbGroups:_,children:[FP.jsx(kes,{renderer:m,transform:T,setTransform:H,height:n,width:B.width,allowEditing:i,focusOnHover:d,onBoundsSelected:l,onViewSchematicComponent:h,focusedPcbComponent:g,cancelPanDrag:V,onContextMenuOpenChange:O,onCreateEditEvent:re,onModifyEditEvent:Z,onRenderComplete:c,grid:{spacing:1,view_window:{left:0,right:B.width||500,top:n,bottom:0}},elements:ne,debugGraphics:t}),FP.jsx(Tqi,{})]})}),u&&!C&&FP.jsx("div",{onClick:()=>{b(!0),ee()},onTouchStart:(ie)=>{let ce=ie.touches[0];X.current={x:ce.clientX,y:ce.clientY}},onTouchEnd:(ie)=>{let ce=ie.changedTouches[0],ue=X.current;if(!ue)return;let de=Math.abs(ce.clientX-ue.x),me=Math.abs(ce.clientY-ue.y);if(de<10&&me<10)ie.preventDefault(),b(!0),ee();X.current=null},style:{position:"absolute",inset:0,cursor:"pointer",zIndex:Yh.clickToInteractOverlay,display:"flex",alignItems:"center",justifyContent:"center",touchAction:"pan-x pan-y pinch-zoom"},children:FP.jsx("div",{style:{backgroundColor:"rgba(0, 0, 0, 0.8)",color:"white",padding:"12px 24px",borderRadius:"8px",fontSize:"16px",pointerEvents:"none"},children:typeof window<"u"&&(("ontouchstart"in window)||navigator.maxTouchPoints>0)?"Touch to Interact":"Click to Interact"})})]})})};/*! Bundled license information:

svgson/dist/svgson.umd.js:
  (*!
   * Determine if an object is a Buffer
   *
   * @author   Feross Aboukhadijeh <https://feross.org>
   * @license  MIT
   *)
*/var Vd=Qe(rn(),1);var Ves=Object.defineProperty,jte=(e,t)=>Ves(e,"name",{value:t,configurable:!0}),jao=!!(typeof window<"u"&&window.document&&window.document.createElement);function Ca(e,t,{checkForDefaultPrevented:n=!0}={}){return jte(function(r){if(e?.(r),n===!1||!r||!r.defaultPrevented)return t?.(r)},"handleEvent")}jte(Ca,"composeEventHandlers");function Yes(e){if(!jao)throw Error("Cannot access window outside of the DOM");return e?.ownerDocument?.defaultView??window}jte(Yes,"getOwnerWindow");function Kmt(e){if(!jao)throw Error("Cannot access document outside of the DOM");return e?.ownerDocument??document}jte(Kmt,"getOwnerDocument");function Kao(e,t=!1){let{activeElement:n}=Kmt(e);if(!n?.nodeName)return null;if($ao(n)&&n.contentDocument)return Kao(n.contentDocument.body,t);if(t){let o=n.getAttribute("aria-activedescendant");if(o){let r=Kmt(n).getElementById(o);if(r)return r}}return n}jte(Kao,"getActiveElement");function $ao(e){return e.tagName==="IFRAME"}jte($ao,"isFrame");var qao=Qe(rn(),1),Ges=Object.defineProperty,qmt=(e,t)=>Ges(e,"name",{value:t,configurable:!0});function $mt(e,t){if(typeof e==="function")return e(t);else if(e!==null&&e!==void 0)e.current=t}qmt($mt,"setRef");function Jao(...e){return(t)=>{let n=!1,o=e.map((r)=>{let i=$mt(r,t);if(!n&&typeof i=="function")n=!0;return i});if(n)return()=>{for(let r=0;r<o.length;r++){let i=o[r];if(typeof i=="function")i();else $mt(e[r],null)}}}}qmt(Jao,"composeRefs");function rh(...e){return qao.useCallback(Jao(...e),e)}qmt(rh,"useComposedRefs");var r6=Qe(rn(),1),Jmt=Qe(so(),1),Ues=Object.defineProperty,o6=(e,t)=>Ues(e,"name",{value:t,configurable:!0});function Wes(e,t){let n=r6.createContext(t);n.displayName=e+"Context";let o=o6((i)=>{let{children:s,...a}=i,c=r6.useMemo(()=>a,Object.values(a));return Jmt.jsx(n.Provider,{value:c,children:s})},"Provider");o.displayName=e+"Provider";function r(i,s={}){let{optional:a=!1}=s,c=r6.useContext(n);if(c)return c;if(t!==void 0)return t;if(a)return;throw Error(`\`${i}\` must be used within \`${e}\``)}return o6(r,"useContext"),[o,r]}o6(Wes,"createContext");function zy(e,t=[]){let n=[];function o(i,s){let a=r6.createContext(s);a.displayName=i+"Context";let c=n.length;n=[...n,s];let l=o6((d)=>{let{scope:u,children:_,...p}=d,m=u?.[e]?.[c]||a,A=r6.useMemo(()=>p,Object.values(p));return Jmt.jsx(m.Provider,{value:A,children:_})},"Provider");l.displayName=i+"Provider";function h(d,u,_={}){let{optional:p=!1}=_,m=u?.[e]?.[c]||a,A=r6.useContext(m);if(A)return A;if(s!==void 0)return s;if(p)return;throw Error(`\`${d}\` must be used within \`${i}\``)}return o6(h,"useContext"),[l,h]}o6(o,"createContext");let r=o6(()=>{let i=n.map((s)=>r6.createContext(s));return o6(function(a){let c=a?.[e]||i;return r6.useMemo(()=>({[`__scope${e}`]:{...a,[e]:c}}),[a,c])},"useScope")},"createScope");return r.scopeName=e,[o,Zao(r,...t)]}o6(zy,"createContextScope");function Zao(...e){let t=e[0];if(e.length===1)return t;let n=o6(()=>{let o=e.map((r)=>({useScope:r(),scopeName:r.scopeName}));return o6(function(i){let s=o.reduce((a,{useScope:c,scopeName:l})=>{let d=c(i)[`__scope${l}`];return{...a,...d}},{});return r6.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])},"useComposedScopes")},"createScope");return n.scopeName=t.scopeName,n}o6(Zao,"composeContextScopes");var Zmt=Qe(rn(),1);var eco=Qe(rn(),1),bu=globalThis?.document?eco.useLayoutEffect:()=>{};var Xes=Object.defineProperty,jes=(e,t)=>Xes(e,"name",{value:t,configurable:!0}),Kes=Zmt[" useId ".trim().toString()]||(()=>{return}),$es=0;function B3(e){let[t,n]=Zmt.useState(Kes());return bu(()=>{if(!e)n((o)=>o??String($es++))},[e]),e||(t?`radix-${t}`:"")}jes(B3,"useId");var i6=Qe(rn(),1);var Bwe=!0;var av=Qe(rn(),1);var Kte=Qe(rn(),1),qes=Object.defineProperty,Jes=(e,t)=>qes(e,"name",{value:t,configurable:!0}),tco=Kte[" useEffectEvent ".trim().toString()],nco=Kte[" useInsertionEffect ".trim().toString()];function e_t(e){if(typeof tco==="function")return tco(e);let t=Kte.useRef(()=>{throw Error("Cannot call an event handler while rendering.")});if(typeof nco==="function")nco(()=>{t.current=e});else bu(()=>{t.current=e});return Kte.useMemo(()=>(...n)=>t.current?.(...n),[])}Jes(e_t,"useEffectEvent");var Zes=Object.defineProperty,Nme=(e,t)=>Zes(e,"name",{value:t,configurable:!0}),ets=i6[" useInsertionEffect ".trim().toString()]||bu;function VL({prop:e,defaultProp:t,onChange:n=Nme(()=>{},"onChange"),caller:o}){let[r,i,s]=rco({defaultProp:t,onChange:n}),a=e!==void 0,c=a?e:r;if(Bwe){let h=i6.useRef(e!==void 0);i6.useEffect(()=>{let d=h.current;if(d!==a)console.warn(`${o} is changing from ${d?"controlled":"uncontrolled"} to ${a?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`);h.current=a},[a,o])}let l=i6.useCallback((h)=>{if(a){let d=ico(h)?h(e):h;if(d!==e)s.current?.(d)}else i(h)},[a,e,i,s]);return[c,l]}Nme(VL,"useControllableState");function rco({defaultProp:e,onChange:t}){let[n,o]=i6.useState(e),r=i6.useRef(n),i=i6.useRef(t);return ets(()=>{i.current=t},[t]),i6.useEffect(()=>{if(r.current!==n)i.current?.(n),r.current=n},[n,r]),[n,o,i]}Nme(rco,"useUncontrolledState");function ico(e){return typeof e==="function"}Nme(ico,"isFunction");var oco=Symbol("RADIX:SYNC_STATE");function tts(e,t,n,o){let{prop:r,defaultProp:i,onChange:s,caller:a}=t,c=r!==void 0,l=e_t(s);if(Bwe){let A=av.useRef(r!==void 0);av.useEffect(()=>{let g=A.current;if(g!==c)console.warn(`${a} is changing from ${g?"controlled":"uncontrolled"} to ${c?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`);A.current=c},[c,a])}let h=[{...n,state:i}];if(o)h.push(o);let[d,u]=av.useReducer((A,g)=>{if(g.type===oco)return{...A,state:g.state};let f=e(A,g);if(c&&!Object.is(f.state,A.state))l(f.state);return f},...h),_=d.state,p=av.useRef(_);av.useEffect(()=>{if(p.current!==_){if(p.current=_,!c)l(_)}},[_,p,c]);let m=av.useMemo(()=>{if(r!==void 0)return{...d,state:r};return d},[d,r]);return av.useEffect(()=>{if(c&&!Object.is(r,d.state))u({type:oco,state:r})},[r,d.state,c]),[m,u]}Nme(tts,"useControllableStateReducer");var pd=Qe(rn(),1);var pco=Qe(rn(),1),mco=Qe(Y8(),1);var Wf=Qe(rn(),1);var nts=Object.defineProperty,T3=(e,t)=>nts(e,"name",{value:t,configurable:!0});function D3(e){let t=Wf.forwardRef((n,o)=>{let{children:r,...i}=n,s=null,a=!1,c=[];if(r=dco(r),Wf.Children.forEach(r,(u)=>{if(lco(u)){a=!0;let _=u,p="child"in _.props?_.props.child:_.props.children;while(t_t(p)&&typeof Twe==="function")p=Twe(p._payload);s=rts(_,p),c.push(s?.props?.children)}else c.push(u)}),s)s=Wf.cloneElement(s,void 0,c);else if(!a&&Wf.Children.count(r)===1&&Wf.isValidElement(r))s=r;let l=s?cco(s):void 0,h=rh(o,l);if(!s){if(r||r===0)throw Error(a?ats(e):sts(e));return r}let d=aco(i,s.props??{});if(s.type!==Wf.Fragment)d.ref=o?h:l;return Wf.cloneElement(s,d)});return t.displayName=`${e}.Slot`,t}T3(D3,"createSlot");var sco=Symbol.for("radix.slottable");function ots(e){let t=T3((n)=>("child"in n)?n.children(n.child):n.children,"Slottable");return t.displayName=`${e}.Slottable`,t.__radixId=sco,t}T3(ots,"createSlottable");var rts=T3((e,t)=>{if("child"in e.props){if(!Wf.isValidElement(t))return null;return Wf.cloneElement(t,void 0,e.props.children(t.props.children))}return Wf.isValidElement(t)?t:null},"getSlottableElementFromSlottable");function aco(e,t){let n={...t};for(let o in t){let r=e[o],i=t[o];if(/^on[A-Z]/.test(o)){if(r&&i)n[o]=(...a)=>{let c=i(...a);return r(...a),c};else if(r)n[o]=r}else if(o==="style")n[o]={...r,...i};else if(o==="className")n[o]=[r,i].filter(Boolean).join(" ");else if(o==="aria-describedby")n[o]=uco(i,r)}return{...e,...n}}T3(aco,"mergeProps");function cco(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;if(n)return e.ref;if(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n)return e.props.ref;return e.props.ref||e.ref}T3(cco,"getElementRef");function lco(e){return Wf.isValidElement(e)&&typeof e.type==="function"&&"__radixId"in e.type&&e.type.__radixId===sco}T3(lco,"isSlottable");var its=Symbol.for("react.lazy");function t_t(e){return e!=null&&typeof e==="object"&&"$$typeof"in e&&e.$$typeof===its&&"_payload"in e&&hco(e._payload)}T3(t_t,"isLazyComponent");function hco(e){return typeof e==="object"&&e!==null&&"then"in e}T3(hco,"isPromiseLike");function dco(e){let t=e;while(t_t(t)&&typeof Twe==="function")t=Twe(t._payload);return t}T3(dco,"useUnwrappedLazy");function uco(...e){let t=new Set;for(let n of e){if(typeof n!=="string")continue;for(let o of String(n).trim().split(/\s+/))if(o)t.add(o)}return t.size>0?Array.from(t).join(" "):void 0}T3(uco,"concatAriaDescribedby");var sts=T3((e)=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),ats=T3((e)=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),Twe=Wf[" use ".trim().toString()];var _co=Qe(so(),1),cts=Object.defineProperty,lts=(e,t)=>cts(e,"name",{value:t,configurable:!0}),hts=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],op=hts.reduce((e,t)=>{let n=D3(`Primitive.${t}`),o=pco.forwardRef((r,i)=>{let{asChild:s,...a}=r,c=s?n:t;if(typeof window<"u")window[Symbol.for("radix-ui")]=!0;return _co.jsx(c,{...a,ref:i})});return o.displayName=`Primitive.${t}`,{...e,[t]:o}},{});function Rme(e,t){if(e)mco.flushSync(()=>e.dispatchEvent(t))}lts(Rme,"dispatchDiscreteCustomEvent");var Qme=Qe(rn(),1),dts=Object.defineProperty,uts=(e,t)=>dts(e,"name",{value:t,configurable:!0}),gco=Qme[" useInsertionEffect ".trim().toString()];function Oy(e){let t=Qme.useRef(e);if(typeof gco==="function")gco(()=>{t.current=e});else bu(()=>{t.current=e});return Qme.useMemo(()=>(...n)=>t.current?.(...n),[])}uts(Oy,"useCallbackRef");var fco=Qe(so(),1),pts=Object.defineProperty,VA=(e,t)=>pts(e,"name",{value:t,configurable:!0}),n_t="dismissableLayer.update",mts="dismissableLayer.pointerDownOutside",_ts="dismissableLayer.focusOutside",Aco,yco=pd.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),Dwe=pd.forwardRef(VA(function(t,n){let{disableOutsidePointerEvents:o=!1,deferPointerDownOutside:r=!1,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:a,onInteractOutside:c,onDismiss:l,...h}=t,d=pd.useContext(yco),[u,_]=pd.useState(null),p=u?.ownerDocument??globalThis?.document,[,m]=pd.useState({}),A=rh(n,_),g=Array.from(d.layers),[f]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),y=f?g.indexOf(f):-1,x=u?g.indexOf(u):-1,C=d.layersWithOutsidePointerEventsDisabled.size>0,b=x>=y,I=pd.useRef(!1),v=xco((T)=>{if(s?.(T),c?.(T),!T.defaultPrevented)l?.()},{ownerDocument:p,deferPointerDownOutside:r,isDeferredPointerDownOutsideRef:I,dismissableSurfaces:d.dismissableSurfaces,shouldHandlePointerDownOutside:pd.useCallback((T)=>{if(!(T instanceof Node))return!1;let N=[...d.branches].some((D)=>D.contains(T));return b&&!N},[d.branches,b])}),P=Cco((T)=>{if(r&&I.current)return;let N=T.target;if([...d.branches].some((L)=>L.contains(N)))return;if(a?.(T),c?.(T),!T.defaultPrevented)l?.()},p),M=u?x===g.length-1:!1,B=Oy((T)=>{if(T.key!=="Escape")return;if(i?.(T),!T.defaultPrevented&&l)T.preventDefault(),l()});return pd.useEffect(()=>{if(!M)return;return p.addEventListener("keydown",B,{capture:!0}),()=>p.removeEventListener("keydown",B,{capture:!0})},[p,M,B]),pd.useEffect(()=>{if(!u)return;if(o){if(d.layersWithOutsidePointerEventsDisabled.size===0)Aco=p.body.style.pointerEvents,p.body.style.pointerEvents="none";d.layersWithOutsidePointerEventsDisabled.add(u)}return d.layers.add(u),o_t(),()=>{if(o){if(d.layersWithOutsidePointerEventsDisabled.delete(u),d.layersWithOutsidePointerEventsDisabled.size===0)p.body.style.pointerEvents=Aco}}},[u,p,o,d]),pd.useEffect(()=>()=>{if(!u)return;d.layers.delete(u),d.layersWithOutsidePointerEventsDisabled.delete(u),o_t()},[u,d]),pd.useEffect(()=>{let T=VA(()=>m({}),"handleUpdate");return document.addEventListener(n_t,T),()=>document.removeEventListener(n_t,T)},[]),fco.jsx(op.div,{...h,ref:A,style:{pointerEvents:C?b?"auto":"none":void 0,...t.style},onFocusCapture:Ca(t.onFocusCapture,P.onFocusCapture),onBlurCapture:Ca(t.onBlurCapture,P.onBlurCapture),onPointerDownCapture:Ca(t.onPointerDownCapture,v.onPointerDownCapture)})},"DismissableLayer"));function r_t(){let e=pd.useContext(yco),[t,n]=pd.useState(null);return pd.useEffect(()=>{if(!t)return;return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}VA(r_t,"useDismissableLayerSurface");var gts=VA(()=>!0,"IS_TRUE");function xco(e,t){let{ownerDocument:n=globalThis?.document,deferPointerDownOutside:o=!1,isDeferredPointerDownOutsideRef:r,dismissableSurfaces:i,shouldHandlePointerDownOutside:s=gts}=t,a=Oy(e),c=pd.useRef(!1),l=pd.useRef(!1),h=pd.useRef(new Map),d=pd.useRef(()=>{});return pd.useEffect(()=>{function u(){l.current=!1,r.current=!1,h.current.clear()}VA(u,"resetOutsideInteraction");function _(){return Array.from(h.current.values()).some(Boolean)}VA(_,"isOutsideInteractionIntercepted");function p(y){if(!l.current)return;let x=y.target;if(!(x instanceof Node&&[...i].some((b)=>b.contains(x))))h.current.set(y.type,!0);if(y.type==="click")window.setTimeout(()=>{if(l.current)d.current()},0)}VA(p,"handleInteractionCapture");function m(y){if(l.current)h.current.set(y.type,!1)}VA(m,"handleInteractionBubble");let A=VA((y)=>{if(y.target&&!c.current){let C=function(){n.removeEventListener("click",d.current);let I=_();if(u(),!I)i_t(mts,a,b,{discrete:!0})};var x=C;if(VA(C,"handleAndDispatchPointerDownOutsideEvent"),!s(y.target)){n.removeEventListener("click",d.current),u(),c.current=!1;return}let b={originalEvent:y};if(l.current=!0,r.current=o&&y.button===0,h.current.clear(),!o||y.button!==0)C();else n.removeEventListener("click",d.current),d.current=C,n.addEventListener("click",d.current,{once:!0})}else n.removeEventListener("click",d.current),u();c.current=!1},"handlePointerDown"),g=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(let y of g)n.addEventListener(y,p,!0),n.addEventListener(y,m);let f=window.setTimeout(()=>{n.addEventListener("pointerdown",A)},0);return()=>{window.clearTimeout(f),n.removeEventListener("pointerdown",A),n.removeEventListener("click",d.current);for(let y of g)n.removeEventListener(y,p,!0),n.removeEventListener(y,m)}},[n,a,o,r,i,s]),{onPointerDownCapture:VA(()=>c.current=!0,"onPointerDownCapture")}}VA(xco,"usePointerDownOutside");function Cco(e,t=globalThis?.document){let n=Oy(e),o=pd.useRef(!1);return pd.useEffect(()=>{let r=VA((i)=>{if(i.target&&!o.current)i_t(_ts,n,{originalEvent:i},{discrete:!1})},"handleFocus");return t.addEventListener("focusin",r),()=>t.removeEventListener("focusin",r)},[t,n]),{onFocusCapture:VA(()=>o.current=!0,"onFocusCapture"),onBlurCapture:VA(()=>o.current=!1,"onBlurCapture")}}VA(Cco,"useFocusOutside");function o_t(){let e=new CustomEvent(n_t);document.dispatchEvent(e)}VA(o_t,"dispatchUpdate");function i_t(e,t,n,{discrete:o}){let r=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});if(t)r.addEventListener(e,t,{once:!0});if(o)Rme(r,i);else r.dispatchEvent(i)}VA(i_t,"handleAndDispatchCustomEvent");var rp=Qe(rn(),1);var h_t=Qe(so(),1),Ats=Object.defineProperty,E_=(e,t)=>Ats(e,"name",{value:t,configurable:!0}),s_t="focusScope.autoFocusOnMount",a_t="focusScope.autoFocusOnUnmount",bco={bubbles:!1,cancelable:!0},Nwe=rp.forwardRef(E_(function(t,n){let{loop:o=!1,trapped:r=!1,branches:i,onMountAutoFocus:s,onUnmountAutoFocus:a,...c}=t,[l,h]=rp.useState(null),d=Oy(s),u=Oy(a),_=rp.useRef(null),p=rh(n,h),m=rp.useRef(i);rp.useEffect(()=>{m.current=i});let A=rp.useCallback((y)=>{if(!y)return!1;if(l?.contains(y))return!0;return Boolean(m.current?.some((x)=>x.contains(y)))},[l]),g=rp.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;rp.useEffect(()=>{if(r){let b=function(M){if(g.paused||!l)return;let B=M.target;if(A(B))_.current=B;else hT(_.current,{select:!0})},I=function(M){if(g.paused||!l)return;let B=M.relatedTarget;if(B===null)return;if(!A(B))hT(_.current,{select:!0})},v=function(M){if(document.activeElement!==document.body)return;for(let T of M)if(T.removedNodes.length>0)hT(l)};var y=b,x=I,C=v;E_(b,"handleFocusIn"),E_(I,"handleFocusOut"),E_(v,"handleMutations"),document.addEventListener("focusin",b),document.addEventListener("focusout",I);let P=new MutationObserver(v);if(l)P.observe(l,{childList:!0,subtree:!0});return()=>{document.removeEventListener("focusin",b),document.removeEventListener("focusout",I),P.disconnect()}}},[r,l,g.paused,A]),rp.useEffect(()=>{if(l){Ico.add(g);let y=document.activeElement;if(!l.contains(y)){let C=new CustomEvent(s_t,bco);if(l.addEventListener(s_t,d),l.dispatchEvent(C),!C.defaultPrevented){if(Sco(Bco(u_t(l)),{select:!0}),document.activeElement===y)hT(l)}}return()=>{l.removeEventListener(s_t,d);let C=l.ownerDocument,b=CustomEvent;setTimeout(()=>{let I=new b(a_t,bco);if(l.addEventListener(a_t,u),l.dispatchEvent(I),!I.defaultPrevented)hT(y??C.body,{select:!0});l.removeEventListener(a_t,u),Ico.remove(g)},0)}}},[l,d,u,g]);let f=rp.useCallback((y)=>{if(!o&&!r)return;if(g.paused)return;let x=y.key==="Tab"&&!y.altKey&&!y.ctrlKey&&!y.metaKey,C=document.activeElement;if(x&&C){let b=y.currentTarget,[I,v]=Pco(b);if(!(I&&v)){if(C===b)y.preventDefault()}else if(!y.shiftKey&&C===v){if(y.preventDefault(),o)hT(I,{select:!0})}else if(y.shiftKey&&C===I){if(y.preventDefault(),o)hT(v,{select:!0})}}},[o,r,g.paused]);return h_t.jsx(op.div,{tabIndex:-1,...c,ref:p,onKeyDown:f})},"FocusScope")),vco=rp.createContext(null);function kme({registry:e,children:t}){if(!e)return t;return h_t.jsx(vco.Provider,{value:e,children:t})}E_(kme,"FocusScopeBranchProvider");function Lme(){let[e,t]=rp.useState([]),n=rp.useMemo(()=>({add:E_((o)=>t((r)=>r.includes(o)?r:[...r,o]),"add"),remove:E_((o)=>t((r)=>r.filter((i)=>i!==o)),"remove")}),[]);return{nodes:e,registry:n}}E_(Lme,"useFocusScopeBranchRegistry");function d_t(e){let t=rp.useContext(vco);rp.useEffect(()=>{if(!e||!t)return;return t.add(e),()=>t.remove(e)},[e,t])}E_(d_t,"useFocusScopeBranch");function Sco(e,{select:t=!1}={}){let n=document.activeElement;for(let o of e)if(hT(o,{select:t}),document.activeElement!==n)return}E_(Sco,"focusFirst");function Pco(e){let t=u_t(e),n=c_t(t,e),o=c_t(t.reverse(),e);return[n,o]}E_(Pco,"getTabbableEdges");function u_t(e){let t=[],o=e.ownerDocument.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:E_((r)=>{let i=r.tagName==="INPUT"&&r.type==="hidden";if(r.disabled||r.hidden||i)return NodeFilter.FILTER_SKIP;return r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},"acceptNode")});while(o.nextNode())t.push(o.currentNode);return t}E_(u_t,"getTabbableCandidates");function c_t(e,t){let n=typeof t.checkVisibility==="function"&&t.checkVisibility({checkVisibilityCSS:!0});for(let o of e)if(!(n?!o.checkVisibility({checkVisibilityCSS:!0}):Eco(o,{upTo:t})))return o}E_(c_t,"findVisible");function Eco(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;while(e){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}E_(Eco,"isHidden");function Mco(e){return e.tagName==="INPUT"&&typeof e.select==="function"}E_(Mco,"isSelectableInput");function hT(e,{select:t=!1}={}){if(e&&e.focus){let o=(e.ownerDocument??document).activeElement;if(e.focus({preventScroll:!0}),e!==o&&Mco(e)&&t)e.select()}}E_(hT,"focus");var Ico=wco();function wco(){let e=[];return{add(t){let n=e[0];if(t!==n)n?.pause();e=l_t(e,t),e.unshift(t)},remove(t){e=l_t(e,t),e[0]?.resume()}}}E_(wco,"createFocusScopesStack");function l_t(e,t){let n=[...e],o=n.indexOf(t);if(o!==-1)n.splice(o,1);return n}E_(l_t,"arrayRemove");function Bco(e){return e.filter((t)=>t.tagName!=="A")}E_(Bco,"removeLinks");var Rwe=Qe(rn(),1),Tco=Qe(Y8(),1);var Dco=Qe(so(),1),fts=Object.defineProperty,yts=(e,t)=>fts(e,"name",{value:t,configurable:!0}),Qwe=Rwe.forwardRef(yts(function(t,n){let{container:o,...r}=t,[i,s]=Rwe.useState(!1);bu(()=>s(!0),[]);let a=o||i&&globalThis?.document?.body;return a?Tco.createPortal(Dco.jsx(op.div,{...r,ref:n}),a):null},"Portal"));var Xf=Qe(rn(),1);var Nco=Qe(rn(),1),xts=Object.defineProperty,dT=(e,t)=>xts(e,"name",{value:t,configurable:!0});function Rco(e,t){return Nco.useReducer((n,o)=>t[n][o]??n,e)}dT(Rco,"useStateMachine");var uT=dT((e)=>{let{present:t,children:n}=e,o=Qco(t),r=typeof n==="function"?n({present:o.isPresent}):Xf.Children.only(n),i=kco(o.ref,Lco(r));return typeof n==="function"||o.isPresent?Xf.cloneElement(r,{ref:i}):null},"Presence");function Qco(e){let[t,n]=Xf.useState(),o=Xf.useRef(null),r=Xf.useRef(e),i=Xf.useRef("none"),s=Xf.useRef(void 0),a=e?"mounted":"unmounted",[c,l]=Rco(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return Xf.useEffect(()=>{if(c==="mounted")i.current=s.current??$te(o.current),s.current=void 0;else i.current="none"},[c]),bu(()=>{let h=o.current,d=r.current;if(d!==e){let _=i.current,p=$te(h);if(e)s.current=p,l("MOUNT");else if(p==="none"||h?.display==="none")l("UNMOUNT");else if(d&&_!==p)l("ANIMATION_OUT");else l("UNMOUNT");r.current=e}},[e,l]),bu(()=>{if(t){let h,d=t.ownerDocument.defaultView??window,u=dT((p)=>{let A=$te(o.current).includes(CSS.escape(p.animationName));if(p.target===t&&A){if(l("ANIMATION_END"),!r.current){let g=t.style.animationFillMode;t.style.animationFillMode="forwards",h=d.setTimeout(()=>{if(t.style.animationFillMode==="forwards")t.style.animationFillMode=g})}}},"handleAnimationEnd"),_=dT((p)=>{if(p.target===t)i.current=$te(o.current)},"handleAnimationStart");return t.addEventListener("animationstart",_),t.addEventListener("animationcancel",u),t.addEventListener("animationend",u),()=>{d.clearTimeout(h),t.removeEventListener("animationstart",_),t.removeEventListener("animationcancel",u),t.removeEventListener("animationend",u)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:Xf.useCallback((h)=>{if(h){let d=getComputedStyle(h);o.current=d,s.current=$te(d)}else o.current=null;n(h)},[])}}dT(Qco,"usePresence");function p_t(e,t){if(typeof e==="function")return e(t);else if(e!==null&&e!==void 0)e.current=t}dT(p_t,"setRef");function kco(...e){let t=Xf.useRef(e);return t.current=e,Xf.useCallback((n)=>{let o=t.current,r=!1,i=o.map((s)=>{let a=p_t(s,n);if(!r&&typeof a==="function")r=!0;return a});if(r)return()=>{for(let s=0;s<i.length;s++){let a=i[s];if(typeof a==="function")a();else p_t(o[s],null)}}},[])}dT(kco,"useStableComposedRefs");function $te(e){return e?.animationName||"none"}dT($te,"getAnimationName");function Lco(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;if(n)return e.ref;if(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n)return e.props.ref;return e.props.ref||e.ref}dT(Lco,"getElementRef");var Hco=Qe(rn(),1),Cts=Object.defineProperty,__t=(e,t)=>Cts(e,"name",{value:t,configurable:!0}),kwe=0,qte=null;function bts(e){return Jte(),e.children}__t(bts,"FocusGuards");function Jte(){Hco.useEffect(()=>{if(!qte)qte={start:m_t(),end:m_t()};let{start:e,end:t}=qte;if(document.body.firstElementChild!==e)document.body.insertAdjacentElement("afterbegin",e);if(document.body.lastElementChild!==t)document.body.insertAdjacentElement("beforeend",t);return kwe++,()=>{if(kwe===1)qte?.start.remove(),qte?.end.remove(),qte=null;kwe=Math.max(0,kwe-1)}},[])}__t(Jte,"useFocusGuards");function m_t(){let e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}__t(m_t,"createFocusGuard");var I5=function(){return I5=Object.assign||function(t){for(var n,o=1,r=arguments.length;o<r;o++){n=arguments[o];for(var i in n)if(Object.prototype.hasOwnProperty.call(n,i))t[i]=n[i]}return t},I5.apply(this,arguments)};function Lwe(e,t){var n={};for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0)n[o]=e[o];if(e!=null&&typeof Object.getOwnPropertySymbols==="function"){for(var r=0,o=Object.getOwnPropertySymbols(e);r<o.length;r++)if(t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r]))n[o[r]]=e[o[r]]}return n}function Fco(e,t,n){if(n||arguments.length===2){for(var o=0,r=t.length,i;o<r;o++)if(i||!(o in t)){if(!i)i=Array.prototype.slice.call(t,0,o);i[o]=t[o]}}return e.concat(i||Array.prototype.slice.call(t))}var Vwe=Qe(rn());var n1=Qe(rn());var ZG="right-scroll-bar-position",eU="width-before-scroll-bar",g_t="with-scroll-bars-hidden",A_t="--removed-body-scroll-bar-size";var Fwe=Qe(rn());function Hwe(e,t){if(typeof e==="function")e(t);else if(e)e.current=t;return e}var zco=Qe(rn());function Oco(e,t){var n=zco.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(o){var r=n.value;if(r!==o)n.value=o,n.callback(o,r)}}}})[0];return n.callback=t,n.facade}var Its=typeof window<"u"?Fwe.useLayoutEffect:Fwe.useEffect,Vco=new WeakMap;function f_t(e,t){var n=Oco(t||null,function(o){return e.forEach(function(r){return Hwe(r,o)})});return Its(function(){var o=Vco.get(n);if(o){var r=new Set(o),i=new Set(e),s=n.current;r.forEach(function(a){if(!i.has(a))Hwe(a,null)}),i.forEach(function(a){if(!r.has(a))Hwe(a,s)})}Vco.set(n,e)},[e]),n}function vts(e){return e}function Sts(e,t){if(t===void 0)t=vts;var n=[],o=!1,r={read:function(){if(o)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");if(n.length)return n[n.length-1];return e},useMedium:function(i){var s=t(i,o);return n.push(s),function(){n=n.filter(function(a){return a!==s})}},assignSyncMedium:function(i){o=!0;while(n.length){var s=n;n=[],s.forEach(i)}n={push:function(a){return i(a)},filter:function(){return n}}},assignMedium:function(i){o=!0;var s=[];if(n.length){var a=n;n=[],a.forEach(i),s=n}var c=function(){var h=s;s=[],h.forEach(i)},l=function(){return Promise.resolve().then(c)};l(),n={push:function(h){s.push(h),l()},filter:function(h){return s=s.filter(h),n}}}};return r}function y_t(e){if(e===void 0)e={};var t=Sts(null);return t.options=I5({async:!0,ssr:!1},e),t}var Yco=Qe(rn()),Gco=function(e){var t=e.sideCar,n=Lwe(e,["sideCar"]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var o=t.read();if(!o)throw Error("Sidecar medium not found");return Yco.createElement(o,I5({},n))};Gco.isSideCarExport=!0;function x_t(e,t){return e.useMedium(t),Gco}var zwe=y_t();var C_t=function(){return},Hme=n1.forwardRef(function(e,t){var n=n1.useRef(null),o=n1.useState({onScrollCapture:C_t,onWheelCapture:C_t,onTouchMoveCapture:C_t}),r=o[0],i=o[1],{forwardProps:s,children:a,className:c,removeScrollBar:l,enabled:h,shards:d,sideCar:u,noRelative:_,noIsolation:p,inert:m,allowPinchZoom:A,as:g}=e,f=g===void 0?"div":g,y=e.gapMode,x=Lwe(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),C=u,b=f_t([n,t]),I=I5(I5({},x),r);return n1.createElement(n1.Fragment,null,h&&n1.createElement(C,{sideCar:zwe,removeScrollBar:l,shards:d,noRelative:_,noIsolation:p,inert:m,setCallbacks:i,allowPinchZoom:!!A,lockRef:n,gapMode:y}),s?n1.cloneElement(n1.Children.only(a),I5(I5({},I),{ref:b})):n1.createElement(f,I5({},I,{className:c,ref:b}),a))});Hme.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Hme.classNames={fullWidth:eU,zeroRight:ZG};var t0=Qe(rn());var ene=Qe(rn());var Xco=Qe(rn());var Uco;var Wco=function(){if(Uco)return Uco;if(typeof __webpack_nonce__<"u")return __webpack_nonce__;return};function Pts(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=Wco();if(t)e.setAttribute("nonce",t);return e}function Ets(e,t){if(e.styleSheet)e.styleSheet.cssText=t;else e.appendChild(document.createTextNode(t))}function Mts(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var b_t=function(){var e=0,t=null;return{add:function(n){if(e==0){if(t=Pts())Ets(t,n),Mts(t)}e++},remove:function(){if(e--,!e&&t)t.parentNode&&t.parentNode.removeChild(t),t=null}}};var I_t=function(){var e=b_t();return function(t,n){Xco.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}};var Fme=function(){var e=I_t(),t=function(n){var{styles:o,dynamic:r}=n;return e(o,r),null};return t};var wts={left:0,top:0,right:0,gap:0},v_t=function(e){return parseInt(e||"",10)||0},Bts=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],o=t[e==="padding"?"paddingTop":"marginTop"],r=t[e==="padding"?"paddingRight":"marginRight"];return[v_t(n),v_t(o),v_t(r)]},S_t=function(e){if(e===void 0)e="margin";if(typeof window>"u")return wts;var t=Bts(e),n=document.documentElement.clientWidth,o=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,o-n+t[2]-t[0])}};var Tts=Fme(),Zte="data-scroll-locked",Dts=function(e,t,n,o){var{left:r,top:i,right:s,gap:a}=e;if(n===void 0)n="margin";return`
  .`.concat(g_t,` {
   overflow: hidden `).concat(o,`;
   padding-right: `).concat(a,"px ").concat(o,`;
  }
  body[`).concat(Zte,`] {
    overflow: hidden `).concat(o,`;
    overscroll-behavior: contain;
    `).concat([t&&"position: relative ".concat(o,";"),n==="margin"&&`
    padding-left: `.concat(r,`px;
    padding-top: `).concat(i,`px;
    padding-right: `).concat(s,`px;
    margin-left:0;
    margin-top:0;
    margin-right: `).concat(a,"px ").concat(o,`;
    `),n==="padding"&&"padding-right: ".concat(a,"px ").concat(o,";")].filter(Boolean).join(""),`
  }
  
  .`).concat(ZG,` {
    right: `).concat(a,"px ").concat(o,`;
  }
  
  .`).concat(eU,` {
    margin-right: `).concat(a,"px ").concat(o,`;
  }
  
  .`).concat(ZG," .").concat(ZG,` {
    right: 0 `).concat(o,`;
  }
  
  .`).concat(eU," .").concat(eU,` {
    margin-right: 0 `).concat(o,`;
  }
  
  body[`).concat(Zte,`] {
    `).concat(A_t,": ").concat(a,`px;
  }
`)},jco=function(){var e=parseInt(document.body.getAttribute(Zte)||"0",10);return isFinite(e)?e:0},Nts=function(){ene.useEffect(function(){return document.body.setAttribute(Zte,(jco()+1).toString()),function(){var e=jco()-1;if(e<=0)document.body.removeAttribute(Zte);else document.body.setAttribute(Zte,e.toString())}},[])},P_t=function(e){var{noRelative:t,noImportant:n,gapMode:o}=e,r=o===void 0?"margin":o;Nts();var i=ene.useMemo(function(){return S_t(r)},[r]);return ene.createElement(Tts,{styles:Dts(i,!t,r,!n?"!important":"")})};var E_t=!1;if(typeof window<"u")try{tne=Object.defineProperty({},"passive",{get:function(){return E_t=!0,!0}}),window.addEventListener("test",tne,tne),window.removeEventListener("test",tne,tne)}catch(e){E_t=!1}var tne,tU=E_t?{passive:!1}:!1;var Rts=function(e){return e.tagName==="TEXTAREA"},Kco=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!Rts(e)&&n[t]==="visible")},Qts=function(e){return Kco(e,"overflowY")},kts=function(e){return Kco(e,"overflowX")},M_t=function(e,t){var n=t.ownerDocument,o=t;do{if(typeof ShadowRoot<"u"&&o instanceof ShadowRoot)o=o.host;var r=$co(e,o);if(r){var i=qco(e,o),s=i[1],a=i[2];if(s>a)return!0}o=o.parentNode}while(o&&o!==n.body);return!1},Lts=function(e){var{scrollTop:t,scrollHeight:n,clientHeight:o}=e;return[t,n,o]},Hts=function(e){var{scrollLeft:t,scrollWidth:n,clientWidth:o}=e;return[t,n,o]},$co=function(e,t){return e==="v"?Qts(t):kts(t)},qco=function(e,t){return e==="v"?Lts(t):Hts(t)},Fts=function(e,t){return e==="h"&&t==="rtl"?-1:1},Jco=function(e,t,n,o,r){var i=Fts(e,window.getComputedStyle(t).direction),s=i*o,a=n.target,c=t.contains(a),l=!1,h=s>0,d=0,u=0;do{if(!a)break;var _=qco(e,a),p=_[0],m=_[1],A=_[2],g=m-A-i*p;if(p||g){if($co(e,a))d+=g,u+=p}var f=a.parentNode;a=f&&f.nodeType===Node.DOCUMENT_FRAGMENT_NODE?f.host:f}while(!c&&a!==document.body||c&&(t.contains(a)||t===a));if(h&&(r&&Math.abs(d)<1||!r&&s>d))l=!0;else if(!h&&(r&&Math.abs(u)<1||!r&&-s>u))l=!0;return l};var Owe=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Zco=function(e){return[e.deltaX,e.deltaY]},elo=function(e){return e&&"current"in e?e.current:e},zts=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Ots=function(e){return`
  .block-interactivity-`.concat(e,` {pointer-events: none;}
  .allow-interactivity-`).concat(e,` {pointer-events: all;}
`)},Vts=0,nne=[];function tlo(e){var t=t0.useRef([]),n=t0.useRef([0,0]),o=t0.useRef(),r=t0.useState(Vts++)[0],i=t0.useState(Fme)[0],s=t0.useRef(e);t0.useEffect(function(){s.current=e},[e]),t0.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(r));var m=Fco([e.lockRef.current],(e.shards||[]).map(elo),!0).filter(Boolean);return m.forEach(function(A){return A.classList.add("allow-interactivity-".concat(r))}),function(){document.body.classList.remove("block-interactivity-".concat(r)),m.forEach(function(A){return A.classList.remove("allow-interactivity-".concat(r))})}}return},[e.inert,e.lockRef.current,e.shards]);var a=t0.useCallback(function(m,A){if("touches"in m&&m.touches.length===2||m.type==="wheel"&&m.ctrlKey)return!s.current.allowPinchZoom;var g=Owe(m),f=n.current,y="deltaX"in m?m.deltaX:f[0]-g[0],x="deltaY"in m?m.deltaY:f[1]-g[1],C,b=m.target,I=Math.abs(y)>Math.abs(x)?"h":"v";if("touches"in m&&I==="h"&&b.type==="range")return!1;var v=window.getSelection(),P=v&&v.anchorNode,M=P?P===b||P.contains(b):!1;if(M)return!1;var B=M_t(I,b);if(!B)return!0;if(B)C=I;else C=I==="v"?"h":"v",B=M_t(I,b);if(!B)return!1;if(!o.current&&"changedTouches"in m&&(y||x))o.current=C;if(!C)return!0;var T=o.current||C;return Jco(T,A,m,T==="h"?y:x,!0)},[]),c=t0.useCallback(function(m){var A=m;if(!nne.length||nne[nne.length-1]!==i)return;var g="deltaY"in A?Zco(A):Owe(A),f=t.current.filter(function(C){return C.name===A.type&&(C.target===A.target||A.target===C.shadowParent)&&zts(C.delta,g)})[0];if(f&&f.should){if(A.cancelable)A.preventDefault();return}if(!f){var y=(s.current.shards||[]).map(elo).filter(Boolean).filter(function(C){return C.contains(A.target)}),x=y.length>0?a(A,y[0]):!s.current.noIsolation;if(x){if(A.cancelable)A.preventDefault()}}},[]),l=t0.useCallback(function(m,A,g,f){var y={name:m,delta:A,target:g,should:f,shadowParent:Yts(g)};t.current.push(y),setTimeout(function(){t.current=t.current.filter(function(x){return x!==y})},1)},[]),h=t0.useCallback(function(m){n.current=Owe(m),o.current=void 0},[]),d=t0.useCallback(function(m){l(m.type,Zco(m),m.target,a(m,e.lockRef.current))},[]),u=t0.useCallback(function(m){l(m.type,Owe(m),m.target,a(m,e.lockRef.current))},[]);t0.useEffect(function(){return nne.push(i),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:u}),document.addEventListener("wheel",c,tU),document.addEventListener("touchmove",c,tU),document.addEventListener("touchstart",h,tU),function(){nne=nne.filter(function(m){return m!==i}),document.removeEventListener("wheel",c,tU),document.removeEventListener("touchmove",c,tU),document.removeEventListener("touchstart",h,tU)}},[]);var{removeScrollBar:_,inert:p}=e;return t0.createElement(t0.Fragment,null,p?t0.createElement(i,{styles:Ots(r)}):null,_?t0.createElement(P_t,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Yts(e){var t=null;while(e!==null){if(e instanceof ShadowRoot)t=e.host,e=e.host;e=e.parentNode}return t}var nlo=x_t(zwe,tlo);var olo=Vwe.forwardRef(function(e,t){return Vwe.createElement(Hme,I5({},e,{ref:t,sideCar:nlo}))});olo.classNames=Hme.classNames;var zme=olo;var Gts=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},one=new WeakMap,Ywe=new WeakMap,Gwe={},w_t=0,rlo=function(e){return e&&(e.host||rlo(e.parentNode))},Uts=function(e,t){return t.map(function(n){if(e.contains(n))return n;var o=rlo(n);if(o&&e.contains(o))return o;return console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null}).filter(function(n){return Boolean(n)})},Wts=function(e,t,n,o){var r=Uts(t,Array.isArray(e)?e:[e]);if(!Gwe[n])Gwe[n]=new WeakMap;var i=Gwe[n],s=[],a=new Set,c=new Set(r),l=function(d){if(!d||a.has(d))return;a.add(d),l(d.parentNode)};r.forEach(l);var h=function(d){if(!d||c.has(d))return;Array.prototype.forEach.call(d.children,function(u){if(a.has(u))h(u);else try{var _=u.getAttribute(o),p=_!==null&&_!=="false",m=(one.get(u)||0)+1,A=(i.get(u)||0)+1;if(one.set(u,m),i.set(u,A),s.push(u),m===1&&p)Ywe.set(u,!0);if(A===1)u.setAttribute(n,"true");if(!p)u.setAttribute(o,"true")}catch(g){console.error("aria-hidden: cannot operate on ",u,g)}})};return h(t),a.clear(),w_t++,function(){if(s.forEach(function(d){var u=one.get(d)-1,_=i.get(d)-1;if(one.set(d,u),i.set(d,_),!u){if(!Ywe.has(d))d.removeAttribute(o);Ywe.delete(d)}if(!_)d.removeAttribute(n)}),w_t--,!w_t)one=new WeakMap,one=new WeakMap,Ywe=new WeakMap,Gwe={}}},Uwe=function(e,t,n){if(n===void 0)n="data-aria-hidden";var o=Array.from(Array.isArray(e)?e:[e]),r=t||Gts(e);if(!r)return function(){return null};return o.push.apply(o,Array.from(r.querySelectorAll("[aria-live], script"))),Wts(o,r,n,"aria-hidden")};var M_=Qe(so(),1),Xts=Object.defineProperty,N3=(e,t)=>Xts(e,"name",{value:t,configurable:!0}),T_t="Dialog",[ilo,qPa]=zy(T_t),[jts,XP]=ilo(T_t),slo=N3((e)=>{let{__scopeDialog:t,children:n,open:o,defaultOpen:r,onOpenChange:i,modal:s=!0}=e,a=Vd.useRef(null),c=Vd.useRef(null),{nodes:l,registry:h}=Lme(),[d,u]=VL({prop:o,defaultProp:r??!1,onChange:i,caller:T_t}),[_,p]=Vd.useState(0),[m,A]=Vd.useState(0);return M_.jsx(jts,{scope:t,triggerRef:a,contentRef:c,contentId:B3(),titleId:B3(),descriptionId:B3(),titlePresent:_>0,descriptionPresent:m>0,setTitleCount:p,setDescriptionCount:A,open:d,onOpenChange:u,onOpenToggle:Vd.useCallback(()=>u((g)=>!g),[u]),modal:s,branchNodes:l,branchRegistry:h,children:n})},"Dialog");var alo="DialogPortal",[Kts,clo]=ilo(alo,{forceMount:void 0}),llo=N3((e)=>{let{__scopeDialog:t,forceMount:n,children:o,container:r}=e,i=XP(alo,t);return M_.jsx(Kts,{scope:t,forceMount:n,children:Vd.Children.map(o,(s)=>M_.jsx(uT,{present:n||i.open,children:M_.jsx(Qwe,{asChild:!0,container:r,children:s})}))})},"DialogPortal"),B_t="DialogOverlay",hlo=Vd.forwardRef(N3(function(t,n){let o=clo(B_t,t.__scopeDialog),{forceMount:r=o.forceMount,...i}=t,s=XP(B_t,t.__scopeDialog);return s.modal?M_.jsx(uT,{present:r||s.open,children:M_.jsx(qts,{...i,ref:n})}):null},"DialogOverlay")),$ts=D3("DialogOverlay.RemoveScroll"),qts=Vd.forwardRef(N3(function(t,n){let{__scopeDialog:o,...r}=t,i=XP(B_t,o),s=r_t(),a=rh(n,s);return M_.jsx(zme,{as:$ts,allowPinchZoom:!0,shards:Vd.useMemo(()=>[i.contentRef,...i.branchNodes.map((c)=>({current:c}))],[i.contentRef,i.branchNodes]),children:M_.jsx(op.div,{"data-state":D_t(i.open),...r,ref:a,style:{pointerEvents:"auto",...r.style}})})},"DialogOverlayImpl")),Ome="DialogContent",dlo=Vd.forwardRef(N3(function(t,n){let o=clo(Ome,t.__scopeDialog),{forceMount:r=o.forceMount,...i}=t,s=XP(Ome,t.__scopeDialog);return M_.jsx(uT,{present:r||s.open,children:s.modal?M_.jsx(Jts,{...i,ref:n}):M_.jsx(Zts,{...i,ref:n})})},"DialogContent")),Jts=Vd.forwardRef(N3(function(t,n){let o=XP(Ome,t.__scopeDialog),r=Vd.useRef(null),i=rh(n,o.contentRef,r);return Vd.useEffect(()=>{let s=r.current;if(s)return Uwe(s)},[]),M_.jsx(ulo,{...t,ref:i,trapFocus:o.open,disableOutsidePointerEvents:o.open,onCloseAutoFocus:Ca(t.onCloseAutoFocus,(s)=>{s.preventDefault(),o.triggerRef.current?.focus()}),onPointerDownOutside:Ca(t.onPointerDownOutside,(s)=>{let a=s.detail.originalEvent,c=a.button===0&&a.ctrlKey===!0;if(a.button===2||c)s.preventDefault()}),onFocusOutside:Ca(t.onFocusOutside,(s)=>s.preventDefault())})},"DialogContentModal")),Zts=Vd.forwardRef(N3(function(t,n){let o=XP(Ome,t.__scopeDialog),r=Vd.useRef(!1),i=Vd.useRef(!1);return M_.jsx(ulo,{...t,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:(s)=>{if(t.onCloseAutoFocus?.(s),!s.defaultPrevented){if(!r.current)o.triggerRef.current?.focus();s.preventDefault()}r.current=!1,i.current=!1},onInteractOutside:(s)=>{if(t.onInteractOutside?.(s),!s.defaultPrevented){if(r.current=!0,s.detail.originalEvent.type==="pointerdown")i.current=!0}let a=s.target;if(o.triggerRef.current?.contains(a))s.preventDefault();if(s.detail.originalEvent.type==="focusin"&&i.current)s.preventDefault()}})},"DialogContentNonModal")),ulo=Vd.forwardRef(N3(function(t,n){let{__scopeDialog:o,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:s,"aria-describedby":a,children:c,...l}=t,h=XP(Ome,o);return Jte(),M_.jsx(kme,{registry:h.branchRegistry,children:M_.jsx(Nwe,{asChild:!0,loop:!0,trapped:r,branches:h.branchNodes,onMountAutoFocus:i,onUnmountAutoFocus:s,children:M_.jsx(Dwe,{role:"dialog",id:h.contentId,"aria-labelledby":h.titlePresent?h.titleId:void 0,"aria-describedby":h.descriptionPresent?glo(a,h.descriptionId):a,"data-state":D_t(h.open),...l,ref:n,deferPointerDownOutside:!0,onDismiss:()=>h.onOpenChange(!1),children:c})})})},"DialogContentImpl")),plo=Vd.forwardRef(N3(function(t,n){let{__scopeDialog:o,...r}=t,i=XP("DialogTitle",o),{setTitleCount:s}=i;return bu(()=>(s((a)=>a+1),()=>s((a)=>a-1)),[s]),M_.jsx(op.h2,{id:i.titleId,...r,ref:n})},"DialogTitle")),mlo=Vd.forwardRef(N3(function(t,n){let{__scopeDialog:o,...r}=t,i=XP("DialogDescription",o),{setDescriptionCount:s}=i;return bu(()=>(s((a)=>a+1),()=>s((a)=>a-1)),[s]),M_.jsx(op.p,{id:i.descriptionId,...r,ref:n})},"DialogDescription")),ens="DialogClose",_lo=Vd.forwardRef(N3(function(t,n){let{__scopeDialog:o,...r}=t,i=XP(ens,o);return M_.jsx(op.button,{type:"button",...r,ref:n,onClick:Ca(t.onClick,()=>i.onOpenChange(!1))})},"DialogClose"));function glo(...e){let t=new Set;for(let n of e){if(typeof n!=="string")continue;for(let o of String(n).trim().split(/\s+/))if(o)t.add(o)}return t.size>0?Array.from(t).join(" "):void 0}N3(glo,"concatAriaDescribedby");function D_t(e){return e?"open":"closed"}N3(D_t,"getState");var nns=()=>{if(globalThis.tscircuitDynamicModules)return globalThis.tscircuitDynamicModules;let e={};return globalThis.tscircuitDynamicModules=e,e};var ons=["circuit-json-to-3d-png","circuit-json-to-bom-csv","circuit-json-to-bpc","circuit-json-to-connectivity-map","circuit-json-to-fdm-component-box","circuit-json-to-gerber","circuit-json-to-gltf","circuit-json-to-kicad","circuit-json-to-lbrn","circuit-json-to-pnp-csv","circuit-json-to-readable-netlist","circuit-json-to-simple-3d","circuit-json-to-spice","circuit-json-to-step","circuit-json-to-tscircuit","circuit-to-canvas","circuit-to-svg","kicad-to-circuit-json","@tscircuit/circuit-json-schematic-placement-analysis"],flo=(e)=>{let t=e.indexOf("@",e.startsWith("@")?1:0);return t===-1?e:e.slice(0,t)},rns=new Set(ons),ins=new Map([["@tscircuit/circuit-json-schematic-placement-analysis","dist/browser.js"]]);function sns(e){if(!rns.has(flo(e)))throw Error(`Unsupported module: ${e}`)}var ans=(e)=>{sns(e);let t=flo(e),n=e.length===t.length?"latest":e.slice(t.length+1),o=ins.get(t)??"+esm";return`https://jscdn.tscircuit.com/${t}/${n}/${o}`},cns=(e)=>[ans(e),`https://esm.run/${e}`];function lns(e=(t)=>import(t)){return async(t)=>{let n=nns();if(Object.hasOwn(n,t))return n[t];let o;for(let r of cns(t))try{let i=await e(r);return n[t]=i,i}catch(i){o=i}throw o}}var hns=()=>globalThis.tscircuitDynamicImportResolver;var Alo=lns();async function dns(e){let t=hns();return t?t(e,Alo):Alo(e)}var ylo=dns;var nTe=Qe(rn(),1),N_=Qe(so(),1);var ipo=Qe(u0(),1);Y0();Ie();Y0();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();var sne={};jW(sne,{all_layers:()=>aho,any_circuit_element:()=>m0o,any_soup_element:()=>ine,any_source_component:()=>Jlo,asset:()=>jwe,base_circuit_json_error:()=>vl,battery_capacity:()=>Slo,brep_shape:()=>lgt,cadModelDefaultDirectionMap:()=>jns,cad_component:()=>Vuo,cad_model_axis_directions:()=>Ouo,cad_model_formats:()=>Xns,capacitance:()=>k_t,circuit_json_footprint_load_error:()=>muo,current:()=>GL,distance:()=>an,duration_ms:()=>rne,experiment_type:()=>Kuo,external_footprint_load_error:()=>puo,frequency:()=>nU,getRotationBetweenPcbPin1Locations:()=>Cns,getZodPrefixedIdWithDefault:()=>On,inductance:()=>Ilo,insertionDirectionToCanonical:()=>$ho,insertionDirectionToVector:()=>yns,insertion_direction:()=>qho,kicadAt:()=>Kwe,kicadEffects:()=>Plo,kicadFont:()=>L_t,kicadFootprintAttributes:()=>Mlo,kicadFootprintMetadata:()=>Tlo,kicadFootprintModel:()=>Blo,kicadFootprintPad:()=>wlo,kicadFootprintProperties:()=>Elo,kicadProperty:()=>Yme,kicadSymbolEffects:()=>Rlo,kicadSymbolMetadata:()=>klo,kicadSymbolPinNames:()=>Nlo,kicadSymbolPinNumbers:()=>Dlo,kicadSymbolProperties:()=>Qlo,kicadSymbolProperty:()=>YL,layer_ref:()=>Na,layer_string:()=>N_t,length:()=>er,manufacturing_drc_properties:()=>edo,ms:()=>Mg,ninePointAnchor:()=>mT,parseAndConvertSiUnit:()=>Aa,pcbRenderLayer:()=>gns,pcb_autorouting_error:()=>guo,pcb_board:()=>Ndo,pcb_breakout_point:()=>Cuo,pcb_component:()=>tdo,pcb_component_invalid_layer_error:()=>Tuo,pcb_component_missing_courtyard_warning:()=>yuo,pcb_component_not_on_board_edge_error:()=>Buo,pcb_component_outside_board_error:()=>wuo,pcb_connector_not_in_accessible_orientation_warning:()=>fuo,pcb_copper_pour:()=>Muo,pcb_copper_pour_brep:()=>Puo,pcb_copper_pour_polygon:()=>Euo,pcb_copper_pour_rect:()=>Suo,pcb_copper_text:()=>Vdo,pcb_courtyard_circle:()=>Fuo,pcb_courtyard_outline:()=>Luo,pcb_courtyard_overlap_error:()=>iuo,pcb_courtyard_pill:()=>zuo,pcb_courtyard_polygon:()=>Huo,pcb_courtyard_rect:()=>kuo,pcb_cutout:()=>duo,pcb_cutout_circle:()=>cuo,pcb_cutout_path:()=>huo,pcb_cutout_polygon:()=>luo,pcb_cutout_rect:()=>auo,pcb_debug_line:()=>odo,pcb_debug_object:()=>ido,pcb_debug_object_base:()=>Jwe,pcb_debug_point:()=>rdo,pcb_debug_rect:()=>ndo,pcb_fabrication_note_dimension:()=>Jdo,pcb_fabrication_note_path:()=>$do,pcb_fabrication_note_rect:()=>qdo,pcb_fabrication_note_text:()=>Kdo,pcb_footprint_overlap_error:()=>ruo,pcb_ground_plane:()=>buo,pcb_ground_plane_region:()=>Iuo,pcb_group:()=>_uo,pcb_hole:()=>udo,pcb_hole_circle_or_square_shape:()=>Sns,pcb_hole_circle_shape:()=>Ins,pcb_hole_oval_shape:()=>Pns,pcb_hole_pill_shape:()=>Ens,pcb_hole_rect_shape:()=>vns,pcb_hole_rotated_pill_shape:()=>Mns,pcb_keepout:()=>suo,pcb_manual_edit_conflict_warning:()=>Auo,pcb_missing_footprint_error:()=>uuo,pcb_net:()=>Tdo,pcb_note_dimension:()=>ouo,pcb_note_line:()=>nuo,pcb_note_path:()=>tuo,pcb_note_rect:()=>euo,pcb_note_text:()=>Zdo,pcb_packing_error:()=>kdo,pcb_pad_pad_clearance_error:()=>Ruo,pcb_pad_trace_clearance_error:()=>Quo,pcb_panel:()=>Rdo,pcb_panelization_placement_error:()=>Ldo,pcb_pin1_location:()=>Q_t,pcb_placement_error:()=>Qdo,pcb_plated_hole:()=>pdo,pcb_port:()=>mdo,pcb_port_not_connected_error:()=>Bdo,pcb_port_not_matched_error:()=>wdo,pcb_route_hint:()=>Jho,pcb_route_hints:()=>bns,pcb_silkscreen_circle:()=>Gdo,pcb_silkscreen_graphic:()=>Xdo,pcb_silkscreen_graphic_brep:()=>Wdo,pcb_silkscreen_line:()=>Fdo,pcb_silkscreen_oval:()=>Udo,pcb_silkscreen_path:()=>zdo,pcb_silkscreen_pill:()=>jdo,pcb_silkscreen_rect:()=>Ydo,pcb_silkscreen_text:()=>Odo,pcb_smtpad:()=>gdo,pcb_smtpad_pill:()=>_do,pcb_solder_paste:()=>Ado,pcb_text:()=>fdo,pcb_thermal_spoke:()=>vuo,pcb_trace:()=>Ido,pcb_trace_error:()=>Edo,pcb_trace_hint:()=>Hdo,pcb_trace_missing_error:()=>Mdo,pcb_trace_route_point:()=>bdo,pcb_trace_route_point_through_pad:()=>Cdo,pcb_trace_route_point_via:()=>xdo,pcb_trace_route_point_wire:()=>ydo,pcb_trace_too_long_warning:()=>Sdo,pcb_trace_too_many_vias_warning:()=>Pdo,pcb_trace_warning:()=>vdo,pcb_via:()=>Ddo,pcb_via_clearance_error:()=>Duo,pcb_via_trace_clearance_error:()=>Nuo,point:()=>Pr,point3:()=>pT,point_with_bulge:()=>Kho,port_arrangement:()=>Cho,position:()=>pns,position3:()=>mns,resistance:()=>Wwe,ring:()=>R_t,rotation:()=>Iu,route_hint_point:()=>Zho,schematic_arc:()=>Eho,schematic_box:()=>gho,schematic_circle:()=>Pho,schematic_component:()=>bho,schematic_component_overlap_warning:()=>zho,schematic_component_port_arrangement_by_sides:()=>xho,schematic_component_port_arrangement_by_size:()=>yho,schematic_component_styling_warning:()=>Oho,schematic_debug_line:()=>Qho,schematic_debug_object:()=>Lho,schematic_debug_object_base:()=>qwe,schematic_debug_point:()=>kho,schematic_debug_rect:()=>Rho,schematic_element_outside_sheet_warning:()=>Vho,schematic_error:()=>Dho,schematic_graphic:()=>Yho,schematic_group:()=>Gho,schematic_layout_error:()=>Nho,schematic_line:()=>vho,schematic_manual_edit_conflict_warning:()=>Fho,schematic_net_label:()=>Tho,schematic_path:()=>Aho,schematic_pin_styles:()=>fho,schematic_port:()=>Bho,schematic_rect:()=>Sho,schematic_sheet:()=>jho,schematic_sheet_size:()=>Xho,schematic_symbol:()=>Iho,schematic_table:()=>Uho,schematic_table_cell:()=>Who,schematic_text:()=>who,schematic_trace:()=>Mho,schematic_voltage_probe:()=>Hho,simulation_ac_current_source:()=>Xuo,simulation_ac_sweep_current_graph:()=>h0o,simulation_ac_sweep_voltage_graph:()=>l0o,simulation_ac_voltage_source:()=>Guo,simulation_complex_sample:()=>pgt,simulation_current_probe:()=>n0o,simulation_current_source:()=>juo,simulation_dc_current_source:()=>Wuo,simulation_dc_operating_point_current:()=>s0o,simulation_dc_operating_point_voltage:()=>i0o,simulation_dc_sweep_current_graph:()=>c0o,simulation_dc_sweep_unit:()=>eBe,simulation_dc_sweep_voltage_graph:()=>a0o,simulation_dc_voltage_source:()=>Yuo,simulation_experiment:()=>quo,simulation_op_amp:()=>d0o,simulation_oscilloscope_trace:()=>p0o,simulation_parameter_sweep:()=>r0o,simulation_parameter_sweep_coordinate:()=>_T,simulation_parameter_type:()=>qns,simulation_parameter_unit:()=>ugt,simulation_spice_subcircuit:()=>u0o,simulation_switch:()=>e0o,simulation_transient_current_graph:()=>Zuo,simulation_transient_voltage_graph:()=>Juo,simulation_unknown_experiment_error:()=>o0o,simulation_voltage_probe:()=>t0o,simulation_voltage_source:()=>Uuo,size:()=>Xwe,source_ambiguous_port_reference:()=>iho,source_board:()=>rho,source_component_base:()=>md,source_component_internal_connection:()=>eho,source_component_misconfigured_error:()=>cgt,source_component_pins_underspecified_warning:()=>uho,source_failed_to_create_component_error:()=>Xlo,source_group:()=>nho,source_i2c_misconfigured_error:()=>agt,source_interconnect:()=>$lo,source_invalid_component_property_error:()=>ngt,source_manually_placed_via:()=>cho,source_missing_manufacturer_part_number_warning:()=>igt,source_missing_property_error:()=>Wlo,source_net:()=>oho,source_no_ground_pin_defined_warning:()=>dho,source_no_power_pin_defined_warning:()=>hho,source_part_not_found_warning:()=>_ho,source_pcb_ground_plane:()=>sho,source_pin_attributes:()=>Vlo,source_pin_missing_trace_warning:()=>rgt,source_pin_must_be_connected_error:()=>pho,source_port:()=>Zlo,source_project_metadata:()=>tgt,source_property_ignored_warning:()=>jlo,source_refdes_convention_warning:()=>sgt,source_simple_ammeter:()=>Olo,source_simple_battery:()=>Y_t,source_simple_capacitor:()=>H_t,source_simple_chip:()=>O_t,source_simple_connector:()=>Ulo,source_simple_connector_standards:()=>Glo,source_simple_crystal:()=>Ylo,source_simple_current_source:()=>Flo,source_simple_diode:()=>$we,source_simple_fiducial:()=>Llo,source_simple_fuse:()=>zlo,source_simple_ground:()=>Hlo,source_simple_inductor:()=>G_t,source_simple_led:()=>z_t,source_simple_mosfet:()=>J_t,source_simple_op_amp:()=>Z_t,source_simple_pin_header:()=>X_t,source_simple_pinout:()=>j_t,source_simple_potentiometer:()=>W_t,source_simple_power_source:()=>V_t,source_simple_push_button:()=>U_t,source_simple_resistor:()=>F_t,source_simple_resonator:()=>K_t,source_simple_switch:()=>egt,source_simple_test_point:()=>q_t,source_simple_transistor:()=>$_t,source_simple_voltage_probe:()=>Klo,source_simple_voltage_source:()=>qlo,source_trace:()=>tho,source_trace_not_connected_error:()=>ogt,source_unnamed_trace_warning:()=>lho,spice_simulation_options:()=>$uo,supplier_footprint_mismatch_warning:()=>xuo,supplier_name:()=>Gme,time:()=>uns,timestamp:()=>vlo,unknown_error_finding_part:()=>mho,visible_layer:()=>wg,voltage:()=>cv,wave_shape:()=>dgt});Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();Ie();var Wwe=k().or(Ae()).transform((e)=>Aa(e,"Ω").value),k_t=k().or(Ae()).transform((e)=>Aa(e,"F").value).transform((e)=>Number.parseFloat(e.toPrecision(12))),Ilo=k().or(Ae()).transform((e)=>Aa(e,"H").value),cv=k().or(Ae()).transform((e)=>Aa(e,"V").value),er=k().or(Ae()).transform((e)=>Aa(e).value),nU=k().or(Ae()).transform((e)=>Aa(e,"Hz").value),an=er,GL=k().or(Ae()).transform((e)=>Aa(e,"A").value),rne=k().or(Ae()).transform((e)=>Aa(e).value),uns=rne,Mg=rne,vlo=k().datetime(),Iu=k().or(Ae()).transform((e)=>{if(typeof e==="number")return e;if(e.endsWith("deg"))return Number.parseFloat(e.split("deg")[0]);if(e.endsWith("rad"))return Number.parseFloat(e.split("rad")[0])*180/Math.PI;return Number.parseFloat(e)}),Slo=Ae().or(k().endsWith("mAh")).transform((e)=>{if(typeof e==="string"){let t=e.replace("mAh",""),n=Number.parseFloat(t);if(Number.isNaN(n))throw Error("Invalid capacity");return n}return e}).describe("Battery capacity in mAh"),jt=(e)=>{};jt("extra props b");jt("missing props b");jt(!0);jt("mismatched prop types: a");var oU=(e)=>{};oU(!0);oU('T1 has extra: "c", T2 has extra: "d"');oU('T1 has extra: "c"');oU('T2 has extra: "c"');oU('T1 has extra: "d", T2 has extra: "c"');oU(!0);var Pr=we({x:an,y:an}),pns=Pr;jt(!0);jt(!0);var pT=we({x:an,y:an,z:an}),mns=pT;jt(!0);var Xwe=we({width:Ae(),height:Ae()});jt(!0);var _ns=(e)=>Array.from({length:e},()=>"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"[Math.floor(Math.random()*62)]).join(""),On=(e)=>k().optional().default(()=>`${e}_${_ns(10)}`),mT=Pt(["top_left","top_center","top_right","center_left","center","center_right","bottom_left","bottom_center","bottom_right"]);jt(!0);var gns=Pt(["top_silkscreen","bottom_silkscreen","top_copper","bottom_copper","top_soldermask","bottom_soldermask","top_fabrication_note","bottom_fabrication_note","top_user_note","bottom_user_note","top_courtyard","bottom_courtyard","inner1_copper","inner2_copper","inner3_copper","inner4_copper","inner5_copper","inner6_copper","inner7_copper","inner8_copper","edge_cuts","drill"]);jt(!0);var jwe=we({project_relative_path:k(),url:k(),mimetype:k()});jt(!0);var Kwe=Pr.extend({rotation:Iu.optional()});jt(!0);var L_t=we({size:Pr.optional(),thickness:an.optional()});jt(!0);var Plo=we({font:L_t.optional()});jt(!0);var Yme=we({value:k(),at:Kwe.optional(),layer:k().optional(),uuid:k().optional(),hide:Be().optional(),effects:Plo.optional()});jt(!0);var Elo=we({Reference:Yme.optional(),Value:Yme.optional(),Datasheet:Yme.optional(),Description:Yme.optional()});jt(!0);var Mlo=we({through_hole:Be().optional(),smd:Be().optional(),exclude_from_pos_files:Be().optional(),exclude_from_bom:Be().optional()});jt(!0);var wlo=we({name:k(),type:k(),shape:k().optional(),at:Kwe.optional(),size:Pr.optional(),drill:an.optional(),layers:it(k()).optional(),removeUnusedLayers:Be().optional(),uuid:k().optional()});jt(!0);var Blo=we({path:k(),offset:pT.optional(),scale:pT.optional(),rotate:pT.optional()});jt(!0);var Tlo=we({footprintName:k().optional(),version:un([Ae(),k()]).optional(),generator:k().optional(),generatorVersion:un([Ae(),k()]).optional(),layer:k().optional(),properties:Elo.optional(),attributes:Mlo.optional(),pads:it(wlo).optional(),embeddedFonts:Be().optional(),model:Blo.optional()});jt(!0);var Dlo=we({hide:Be().optional()});jt(!0);var Nlo=we({offset:an.optional(),hide:Be().optional()});jt(!0);var Rlo=we({font:L_t.optional(),justify:un([k(),it(k())]).optional(),hide:Be().optional()});jt(!0);var YL=we({value:k(),id:un([Ae(),k()]).optional(),at:Kwe.optional(),effects:Rlo.optional()});jt(!0);var Qlo=we({Reference:YL.optional(),Value:YL.optional(),Footprint:YL.optional(),Datasheet:YL.optional(),Description:YL.optional(),ki_keywords:YL.optional(),ki_fp_filters:YL.optional()});jt(!0);var klo=we({symbolName:k().optional(),extends:k().optional(),pinNumbers:Dlo.optional(),pinNames:Nlo.optional(),excludeFromSim:Be().optional(),inBom:Be().optional(),onBoard:Be().optional(),properties:Qlo.optional(),embeddedFonts:Be().optional()});jt(!0);var vl=we({error_type:k(),message:k(),is_fatal:Be().optional()});jt(!0);var Gme=Pt(["jlcpcb","macrofab","pcbway","digikey","mouser","lcsc"]);jt(!0);var md=we({type:he("source_component"),ftype:k().optional(),source_component_id:k(),name:k(),manufacturer_part_number:k().optional(),supplier_part_numbers:gs(Gme,it(k())).optional(),display_value:k().optional(),display_name:k().optional(),are_pins_interchangeable:Be().optional(),internally_connected_source_port_ids:it(it(k())).optional(),source_group_id:k().optional(),subcircuit_id:k().optional()});jt(!0);var H_t=md.extend({ftype:he("simple_capacitor"),capacitance:k_t,max_voltage_rating:cv.optional(),display_capacitance:k().optional(),max_decoupling_trace_length:an.optional()});jt(!0);var F_t=md.extend({ftype:he("simple_resistor"),resistance:Wwe,display_resistance:k().optional()});jt(!0);var $we=md.extend({ftype:he("simple_diode")});jt(!0);var Llo=md.extend({ftype:he("simple_fiducial")});jt(!0);var z_t=$we.extend({ftype:he("simple_led"),color:k().optional(),wavelength:k().optional()});jt(!0);var Hlo=md.extend({ftype:he("simple_ground")});jt(!0);var O_t=md.extend({ftype:he("simple_chip")});jt(!0);var V_t=md.extend({ftype:he("simple_power_source"),voltage:cv});jt(!0);var Flo=md.extend({ftype:he("simple_current_source"),current:GL,frequency:nU.optional(),peak_to_peak_current:GL.optional(),wave_shape:Pt(["sine","square","triangle","sawtooth","dc"]).optional().default("dc"),phase:Ae().optional(),duty_cycle:Ae().min(0).max(1).optional()});jt(!0);var zlo=md.extend({ftype:he("simple_fuse"),current_rating_amps:Ae().describe("Nominal current in amps the fuse is rated for"),voltage_rating_volts:Ae().describe("Voltage rating in volts, e.g. ±5V would be 5")});jt(!0);var Olo=md.extend({ftype:he("simple_ammeter")});jt(!0);var Vlo=we({must_be_connected:Be().optional(),provides_power:Be().optional(),requires_power:Be().optional(),provides_ground:Be().optional(),requires_ground:Be().optional(),provides_voltage:un([k(),Ae()]).optional(),requires_voltage:un([k(),Ae()]).optional(),do_not_connect:Be().optional(),include_in_board_pinout:Be().optional(),can_use_internal_pullup:Be().optional(),is_using_internal_pullup:Be().optional(),needs_external_pullup:Be().optional(),can_use_internal_pulldown:Be().optional(),is_using_internal_pulldown:Be().optional(),needs_external_pulldown:Be().optional(),can_use_open_drain:Be().optional(),is_using_open_drain:Be().optional(),can_use_push_pull:Be().optional(),is_using_push_pull:Be().optional(),should_have_decoupling_capacitor:Be().optional(),recommended_decoupling_capacitor_capacitance:un([k(),Ae()]).optional(),is_configured_for_i2c_sda:Be().optional(),is_configured_for_i2c_scl:Be().optional(),is_configured_for_spi_mosi:Be().optional(),is_configured_for_spi_miso:Be().optional(),is_configured_for_spi_sck:Be().optional(),is_configured_for_spi_cs:Be().optional(),is_configured_for_uart_tx:Be().optional(),is_configured_for_uart_rx:Be().optional(),supports_i2c_sda:Be().optional(),supports_i2c_scl:Be().optional(),supports_spi_mosi:Be().optional(),supports_spi_miso:Be().optional(),supports_spi_sck:Be().optional(),supports_spi_cs:Be().optional(),supports_uart_tx:Be().optional(),supports_uart_rx:Be().optional()});jt(!0);var Y_t=md.extend({ftype:he("simple_battery"),capacity:Slo});jt(!0);var G_t=md.extend({ftype:he("simple_inductor"),inductance:Ilo,display_inductance:k().optional(),max_current_rating:Ae().optional()});jt(!0);var U_t=md.extend({ftype:he("simple_push_button")});jt(!0);var W_t=md.extend({ftype:he("simple_potentiometer"),max_resistance:Wwe,display_max_resistance:k().optional()});jt(!0);var Ylo=md.extend({ftype:he("simple_crystal"),frequency:Ae().describe("Frequency in Hz"),load_capacitance:Ae().optional().describe("Load capacitance in pF"),pin_variant:Pt(["two_pin","four_pin"]).optional()});jt(!0);var X_t=md.extend({ftype:he("simple_pin_header"),pin_count:Ae(),gender:Pt(["male","female"]).optional().default("male")});jt(!0);var Glo=["usb_c","m2","jst_sh","jst_gh","jst_zh","jst_ph","jst_xh","jst_vh"],Ulo=md.extend({ftype:he("simple_connector"),standard:Pt(Glo).optional(),pin_count:Ae().int().positive().optional()});jt(!0);var j_t=md.extend({ftype:he("simple_pinout")});jt(!0);var K_t=md.extend({ftype:he("simple_resonator"),load_capacitance:k_t,equivalent_series_resistance:Wwe.optional(),frequency:nU});jt(!0);var $_t=md.extend({ftype:he("simple_transistor"),transistor_type:Pt(["npn","pnp"])});jt(!0);var q_t=md.extend({ftype:he("simple_test_point"),footprint_variant:Pt(["pad","through_hole"]).optional(),pad_shape:Pt(["rect","circle"]).optional(),pad_diameter:un([Ae(),k()]).optional(),hole_diameter:un([Ae(),k()]).optional(),width:un([Ae(),k()]).optional(),height:un([Ae(),k()]).optional()});jt(!0);var J_t=md.extend({ftype:he("simple_mosfet"),channel_type:Pt(["n","p"]),mosfet_mode:Pt(["enhancement","depletion"])});jt(!0);var Z_t=md.extend({ftype:he("simple_op_amp")});jt(!0);var egt=md.extend({ftype:he("simple_switch")});jt(!0);var tgt=we({type:he("source_project_metadata"),name:k().optional(),software_used_string:k().optional(),project_url:k().optional(),source_filesystem_md5_hash:k().optional(),created_at:vlo.optional()});jt(!0);var Wlo=vl.extend({type:he("source_missing_property_error"),source_missing_property_error_id:On("source_missing_property_error"),source_component_id:k(),property_name:k(),subcircuit_id:k().optional(),error_type:he("source_missing_property_error").default("source_missing_property_error")}).describe("The source code is missing a property");jt(!0);var Xlo=vl.extend({type:he("source_failed_to_create_component_error"),source_failed_to_create_component_error_id:On("source_failed_to_create_component_error"),error_type:he("source_failed_to_create_component_error").default("source_failed_to_create_component_error"),component_name:k().optional(),subcircuit_id:k().optional(),parent_source_component_id:k().optional(),pcb_center:we({x:Ae().optional(),y:Ae().optional()}).optional(),schematic_center:we({x:Ae().optional(),y:Ae().optional()}).optional()}).describe("Error emitted when a component fails to be constructed");jt(!0);var ngt=vl.extend({type:he("source_invalid_component_property_error"),source_invalid_component_property_error_id:On("source_invalid_component_property_error"),source_component_id:k(),property_name:k(),property_value:LF().optional(),expected_format:k().optional(),subcircuit_id:k().optional(),error_type:he("source_invalid_component_property_error").default("source_invalid_component_property_error")}).describe("The source component property is invalid");jt(!0);var ogt=vl.extend({type:he("source_trace_not_connected_error"),source_trace_not_connected_error_id:On("source_trace_not_connected_error"),error_type:he("source_trace_not_connected_error").default("source_trace_not_connected_error"),subcircuit_id:k().optional(),source_group_id:k().optional(),source_trace_id:k().optional(),connected_source_port_ids:it(k()).optional(),selectors_not_found:it(k()).optional()}).describe("Occurs when a source trace selector does not match any ports");jt(!0);var jlo=we({type:he("source_property_ignored_warning"),source_property_ignored_warning_id:On("source_property_ignored_warning"),source_component_id:k(),property_name:k(),subcircuit_id:k().optional(),error_type:he("source_property_ignored_warning").default("source_property_ignored_warning"),message:k()}).describe("The source property was ignored");jt(!0);var rgt=we({type:he("source_pin_missing_trace_warning"),source_pin_missing_trace_warning_id:On("source_pin_missing_trace_warning"),warning_type:he("source_pin_missing_trace_warning").default("source_pin_missing_trace_warning"),message:k(),source_component_id:k(),source_port_id:k(),subcircuit_id:k().optional()}).describe("Warning emitted when a source component pin is missing a trace connection");jt(!0);var igt=we({type:he("source_missing_manufacturer_part_number_warning"),source_missing_manufacturer_part_number_warning_id:On("source_missing_manufacturer_part_number_warning"),warning_type:he("source_missing_manufacturer_part_number_warning").default("source_missing_manufacturer_part_number_warning"),message:k(),source_component_id:k(),standard:k(),subcircuit_id:k().optional()}).describe("Warning emitted when a standard connector is missing manufacturer part number");jt(!0);var sgt=we({type:he("source_refdes_convention_warning"),source_refdes_convention_warning_id:On("source_refdes_convention_warning"),warning_type:he("source_refdes_convention_warning").default("source_refdes_convention_warning"),message:k(),source_component_id:k(),refdes:k(),source_component_ftype:k(),expected_prefixes:it(k()),actual_prefix:k().optional(),subcircuit_id:k().optional()}).describe("Warning emitted when a source component reference designator does not match the component type convention");jt(!0);var Klo=md.extend({ftype:he("simple_voltage_probe")});jt(!0);var $lo=md.extend({ftype:he("interconnect")});jt(!0);var agt=vl.extend({type:he("source_i2c_misconfigured_error"),source_i2c_misconfigured_error_id:On("source_i2c_misconfigured_error"),error_type:he("source_i2c_misconfigured_error").default("source_i2c_misconfigured_error"),source_port_ids:it(k())}).describe("Error emitted when incompatible I2C pins (e.g. SDA and SCL) are connected to the same net");jt(!0);var cgt=vl.extend({type:he("source_component_misconfigured_error"),source_component_misconfigured_error_id:On("source_component_misconfigured_error"),error_type:he("source_component_misconfigured_error").default("source_component_misconfigured_error"),source_component_ids:it(k()),source_port_ids:it(k()).optional()}).describe("Error emitted when one or more source components have an invalid or conflicting configuration");jt(!0);var qlo=md.extend({ftype:he("simple_voltage_source"),voltage:cv,frequency:nU.optional(),peak_to_peak_voltage:cv.optional(),wave_shape:Pt(["sinewave","square","triangle","sawtooth"]).optional(),phase:Iu.optional(),duty_cycle:Ae().optional().describe("Duty cycle as a fraction (0 to 1)"),pulse_delay:Mg.optional(),rise_time:Mg.optional(),fall_time:Mg.optional(),pulse_width:Mg.optional(),period:Mg.optional()});jt(!0);var Jlo=un([F_t,H_t,$we,Llo,z_t,Hlo,O_t,V_t,Flo,Olo,Y_t,G_t,U_t,W_t,Ylo,X_t,Ulo,j_t,K_t,egt,$_t,q_t,J_t,Z_t,zlo,Klo,$lo,qlo,tgt,Wlo,ngt,Xlo,ogt,jlo,rgt,igt,sgt,agt,cgt]);jt(!0);var Zlo=we({type:he("source_port"),pin_number:Ae().optional(),port_hints:it(k()).optional(),name:k(),source_port_id:k(),source_component_id:k().optional(),source_group_id:k().optional(),most_frequently_referenced_by_name:k().optional(),subcircuit_id:k().optional(),subcircuit_connectivity_map_key:k().optional()}).merge(Vlo);jt(!0);var eho=we({type:he("source_component_internal_connection"),source_component_internal_connection_id:k(),source_component_id:k(),source_port_ids:it(k()),subcircuit_id:k().optional()});jt(!0);var tho=we({type:he("source_trace"),source_trace_id:k(),connected_source_port_ids:it(k()),connected_source_net_ids:it(k()),subcircuit_id:k().optional(),subcircuit_connectivity_map_key:k().optional(),max_length:Ae().optional(),max_via_count:Ae().int().nonnegative().optional(),name:k().optional(),min_trace_thickness:Ae().optional(),display_name:k().optional()});jt(!0);var nho=we({type:he("source_group"),source_group_id:k(),subcircuit_id:k().optional(),parent_subcircuit_id:k().optional(),parent_source_group_id:k().optional(),is_subcircuit:Be().optional(),show_as_schematic_box:Be().optional(),name:k().optional(),was_automatically_named:Be().optional()});jt(!0);var oho=we({type:he("source_net"),source_net_id:k(),name:k(),member_source_group_ids:it(k()),is_power:Be().optional(),is_ground:Be().optional(),is_digital_signal:Be().optional(),is_analog_signal:Be().optional(),is_positive_voltage_source:Be().optional(),trace_width:Ae().optional(),subcircuit_id:k().optional(),subcircuit_connectivity_map_key:k().optional()});jt(!0);var rho=we({type:he("source_board"),source_board_id:k(),source_group_id:k(),title:k().optional()}).describe("Defines a board in the source domain");jt(!0);var iho=vl.extend({type:he("source_ambiguous_port_reference"),source_ambiguous_port_reference_id:On("source_ambiguous_port_reference"),error_type:he("source_ambiguous_port_reference").default("source_ambiguous_port_reference"),source_port_id:k().optional(),source_component_id:k().optional()}).describe("Error emitted when a port hint matches multiple non-overlapping pads, making the port reference ambiguous");jt(!0);var sho=we({type:he("source_pcb_ground_plane"),source_pcb_ground_plane_id:k(),source_group_id:k(),source_net_id:k(),subcircuit_id:k().optional()}).describe("Defines a ground plane in the source domain");jt(!0);var aho=["top","bottom","inner1","inner2","inner3","inner4","inner5","inner6","inner7","inner8"],N_t=Pt(aho),Na=N_t.or(we({name:N_t})).transform((e)=>{if(typeof e==="string")return e;return e.name});jt(!0);var wg=Pt(["top","bottom"]),cho=we({type:he("source_manually_placed_via"),source_manually_placed_via_id:k(),source_group_id:k(),source_net_id:k().min(1).optional(),subcircuit_id:k().optional(),source_trace_id:k().optional()}).describe("Defines a via that is manually placed in the source domain");jt(!0);var lho=we({type:he("source_unnamed_trace_warning"),source_unnamed_trace_warning_id:On("source_unnamed_trace_warning"),warning_type:he("source_unnamed_trace_warning").default("source_unnamed_trace_warning"),message:k(),source_trace_id:k(),subcircuit_id:k().optional()}).describe("Warning emitted when a source trace is missing a name");jt(!0);var hho=we({type:he("source_no_power_pin_defined_warning"),source_no_power_pin_defined_warning_id:On("source_no_power_pin_defined_warning"),warning_type:he("source_no_power_pin_defined_warning").default("source_no_power_pin_defined_warning"),message:k(),source_component_id:k(),source_port_ids:it(k()),subcircuit_id:k().optional()}).describe("Warning emitted when a chip has no source ports with requires_power=true");jt(!0);var dho=we({type:he("source_no_ground_pin_defined_warning"),source_no_ground_pin_defined_warning_id:On("source_no_ground_pin_defined_warning"),warning_type:he("source_no_ground_pin_defined_warning").default("source_no_ground_pin_defined_warning"),message:k(),source_component_id:k(),source_port_ids:it(k()),subcircuit_id:k().optional()}).describe("Warning emitted when a chip has no source ports marked as ground pins");jt(!0);var uho=we({type:he("source_component_pins_underspecified_warning"),source_component_pins_underspecified_warning_id:On("source_component_pins_underspecified_warning"),warning_type:he("source_component_pins_underspecified_warning").default("source_component_pins_underspecified_warning"),message:k(),source_component_id:k(),source_port_ids:it(k()),subcircuit_id:k().optional()}).describe("Warning emitted when all ports on a source component are underspecified");jt(!0);var pho=vl.extend({type:he("source_pin_must_be_connected_error"),source_pin_must_be_connected_error_id:On("source_pin_must_be_connected_error"),error_type:he("source_pin_must_be_connected_error").default("source_pin_must_be_connected_error"),source_component_id:k(),source_port_id:k(),subcircuit_id:k().optional()}).describe("Error emitted when a pin with mustBeConnected attribute is not connected to any trace");jt(!0);var mho=vl.extend({type:he("unknown_error_finding_part"),unknown_error_finding_part_id:On("unknown_error_finding_part"),error_type:he("unknown_error_finding_part").default("unknown_error_finding_part"),source_component_id:k().optional(),subcircuit_id:k().optional()}).describe("Error emitted when an unexpected error occurs while finding a part");jt(!0);var _ho=we({type:he("source_part_not_found_warning"),source_part_not_found_warning_id:On("source_part_not_found_warning"),warning_type:he("source_part_not_found_warning").default("source_part_not_found_warning"),message:k(),source_component_id:k().optional(),subcircuit_id:k().optional(),supplier_name:Gme.optional(),manufacturer_part_number:k().optional(),supplier_part_number:k().optional(),part_name:k().optional()}).describe("Warning emitted when a requested part can not be found");jt(!0);var gho=we({type:he("schematic_box"),schematic_sheet_id:k().optional(),schematic_component_id:k().optional(),schematic_symbol_id:k().optional(),width:an,height:an,is_dashed:Be().default(!1),x:an,y:an,subcircuit_id:k().optional()}).describe("Draws a box on the schematic");jt(!0);var Aho=we({type:he("schematic_path"),schematic_path_id:On("schematic_path"),schematic_sheet_id:k().optional(),schematic_component_id:k().optional(),schematic_symbol_id:k().optional(),fill_color:k().optional(),is_filled:Be().optional(),is_dashed:Be().default(!1),stroke_width:an.nullable().optional(),stroke_color:k().optional(),dash_length:an.optional(),dash_gap:an.optional(),points:it(Pr),subcircuit_id:k().optional()});jt(!0);var fho=gs(we({left_margin:er.optional(),right_margin:er.optional(),top_margin:er.optional(),bottom_margin:er.optional()})),yho=we({left_size:Ae(),right_size:Ae(),top_size:Ae().optional(),bottom_size:Ae().optional()});jt(!0);var xho=we({left_side:we({pins:it(Ae()),direction:Pt(["top-to-bottom","bottom-to-top"]).optional()}).optional(),right_side:we({pins:it(Ae()),direction:Pt(["top-to-bottom","bottom-to-top"]).optional()}).optional(),top_side:we({pins:it(Ae()),direction:Pt(["left-to-right","right-to-left"]).optional()}).optional(),bottom_side:we({pins:it(Ae()),direction:Pt(["left-to-right","right-to-left"]).optional()}).optional()});jt(!0);var Cho=un([yho,xho]),bho=we({type:he("schematic_component"),size:Xwe,center:Pr,source_component_id:k().optional(),schematic_component_id:k(),schematic_sheet_id:k().optional(),schematic_symbol_id:k().optional(),pin_spacing:er.optional(),pin_styles:fho.optional(),box_width:er.optional(),symbol_name:k().optional(),port_arrangement:Cho.optional(),port_labels:gs(k()).optional(),symbol_display_value:k().optional(),subcircuit_id:k().optional(),schematic_group_id:k().optional(),is_schematic_group:Be().optional(),source_group_id:k().optional(),is_box_with_pins:Be().optional().default(!0)});jt(!0);var Ans=we({kicad_symbol:klo.optional()}).catchall(LF()),Iho=we({type:he("schematic_symbol"),schematic_symbol_id:k(),name:k().optional(),metadata:Ans.optional()}).describe("Defines a named schematic symbol that can be referenced by components.");jt(!0);var vho=we({type:he("schematic_line"),schematic_line_id:On("schematic_line"),schematic_sheet_id:k().optional(),schematic_component_id:k().optional(),schematic_symbol_id:k().optional(),x1:an,y1:an,x2:an,y2:an,stroke_width:an.nullable().optional(),color:k().default("#000000"),is_dashed:Be().default(!1),dash_length:an.optional(),dash_gap:an.optional(),subcircuit_id:k().optional()}).describe("Draws a styled line on the schematic");jt(!0);var Sho=we({type:he("schematic_rect"),schematic_rect_id:On("schematic_rect"),schematic_sheet_id:k().optional(),schematic_component_id:k().optional(),schematic_symbol_id:k().optional(),center:Pr,width:an,height:an,rotation:Iu.default(0),stroke_width:an.nullable().optional(),color:k().default("#000000"),is_filled:Be().default(!1),fill_color:k().optional(),is_dashed:Be().default(!1),subcircuit_id:k().optional()}).describe("Draws a styled rectangle on the schematic");jt(!0);var Pho=we({type:he("schematic_circle"),schematic_circle_id:On("schematic_circle"),schematic_sheet_id:k().optional(),schematic_component_id:k().optional(),schematic_symbol_id:k().optional(),center:Pr,radius:an,stroke_width:an.nullable().optional(),color:k().default("#000000"),is_filled:Be().default(!1),fill_color:k().optional(),is_dashed:Be().default(!1),subcircuit_id:k().optional()}).describe("Draws a styled circle on the schematic");jt(!0);var Eho=we({type:he("schematic_arc"),schematic_arc_id:On("schematic_arc"),schematic_sheet_id:k().optional(),schematic_component_id:k().optional(),schematic_symbol_id:k().optional(),center:Pr,radius:an,start_angle_degrees:Iu,end_angle_degrees:Iu,direction:Pt(["clockwise","counterclockwise"]).default("counterclockwise"),stroke_width:an.nullable().optional(),color:k().default("#000000"),is_dashed:Be().default(!1),subcircuit_id:k().optional()}).describe("Draws a styled arc on the schematic");jt(!0);var Mho=we({type:he("schematic_trace"),schematic_trace_id:k(),schematic_sheet_id:k().optional(),source_trace_id:k().optional(),junctions:it(we({x:Ae(),y:Ae()})),edges:it(we({from:we({x:Ae(),y:Ae()}),to:we({x:Ae(),y:Ae()}),is_crossing:Be().optional(),from_schematic_port_id:k().optional(),to_schematic_port_id:k().optional()})),subcircuit_id:k().optional(),subcircuit_connectivity_map_key:k().optional()});jt(!0);var fns=Pt(["center","left","right","top","bottom"]);jt(!0);var who=we({type:he("schematic_text"),schematic_sheet_id:k().optional(),schematic_component_id:k().optional(),schematic_symbol_id:k().optional(),schematic_text_id:k(),source_trace_id:k().optional(),text:k(),font_size:Ae().default(0.18),position:we({x:an,y:an}),rotation:Ae().default(0),anchor:un([fns.describe("legacy"),mT]).default("center"),color:k().default("#000000"),subcircuit_id:k().optional()});jt(!0);var Bho=we({type:he("schematic_port"),schematic_port_id:k(),source_port_id:k(),schematic_sheet_id:k().optional(),schematic_component_id:k().optional(),center:Pr,facing_direction:Pt(["up","down","left","right"]).optional(),distance_from_component_edge:Ae().optional(),side_of_component:Pt(["top","bottom","left","right"]).optional(),true_ccw_index:Ae().optional(),pin_number:Ae().optional(),display_pin_label:k().optional(),display_pin_label_font_size:Ae().positive().finite().optional(),subcircuit_id:k().optional(),is_connected:Be().optional(),is_internal_circuit_port:Be().optional(),is_overlapping_internal_circuit_port:Be().optional(),has_input_arrow:Be().optional(),has_output_arrow:Be().optional(),is_drawn_with_inversion_circle:Be().optional()}).describe("Defines a port on a schematic component");jt(!0);var Tho=we({type:he("schematic_net_label"),schematic_net_label_id:On("schematic_net_label"),schematic_sheet_id:k().optional(),schematic_trace_id:k().optional(),source_trace_id:k().optional(),source_net_id:k(),center:Pr,anchor_position:Pr.optional(),anchor_side:Pt(["top","bottom","left","right"]),text:k(),symbol_name:k().optional(),is_movable:Be().optional(),subcircuit_id:k().optional()});jt(!0);var Dho=vl.extend({type:he("schematic_error"),schematic_error_id:k(),error_type:he("schematic_port_not_found").default("schematic_port_not_found"),subcircuit_id:k().optional()}).describe("Defines a schematic error on the schematic");jt(!0);var Nho=vl.extend({type:he("schematic_layout_error"),schematic_layout_error_id:On("schematic_layout_error"),error_type:he("schematic_layout_error").default("schematic_layout_error"),source_group_id:k(),schematic_group_id:k(),subcircuit_id:k().optional()}).describe("Error emitted when schematic layout fails for a group");jt(!0);var qwe=we({type:he("schematic_debug_object"),label:k().optional(),subcircuit_id:k().optional()}),Rho=qwe.extend({shape:he("rect"),center:Pr,size:Xwe}),Qho=qwe.extend({shape:he("line"),start:Pr,end:Pr}),kho=qwe.extend({shape:he("point"),center:Pr}),Lho=ss("shape",[Rho,Qho,kho]);jt(!0);var Hho=we({type:he("schematic_voltage_probe"),schematic_voltage_probe_id:k(),schematic_sheet_id:k().optional(),source_component_id:k().optional(),name:k().optional(),position:Pr,schematic_trace_id:k(),voltage:cv.optional(),subcircuit_id:k().optional(),color:k().optional(),label_alignment:mT.optional()}).describe("Defines a voltage probe measurement point on a schematic trace");jt(!0);var Fho=we({type:he("schematic_manual_edit_conflict_warning"),schematic_manual_edit_conflict_warning_id:On("schematic_manual_edit_conflict_warning"),warning_type:he("schematic_manual_edit_conflict_warning").default("schematic_manual_edit_conflict_warning"),message:k(),schematic_component_id:k(),schematic_group_id:k().optional(),subcircuit_id:k().optional(),source_component_id:k()}).describe("Warning emitted when a component has both manual placement and explicit schX/schY coordinates");jt(!0);var zho=we({type:he("schematic_component_overlap_warning"),schematic_component_overlap_warning_id:On("schematic_component_overlap_warning"),warning_type:he("schematic_component_overlap_warning").default("schematic_component_overlap_warning"),message:k(),schematic_component_ids:kC([k(),k()]),schematic_sheet_id:k().optional()}).describe("Warning emitted when the rendered bounds of two schematic components overlap");jt(!0);var Oho=we({type:he("schematic_component_styling_warning"),schematic_component_styling_warning_id:On("schematic_component_styling_warning"),warning_type:he("schematic_component_styling_warning").default("schematic_component_styling_warning"),message:k(),schematic_component_id:k(),styling_issue_type:k(),schematic_port_ids:it(k()).optional(),source_component_id:k().optional(),schematic_sheet_id:k().optional(),subcircuit_id:k().optional()}).describe("Warning emitted when a schematic component has a visual styling issue");jt(!0);var Vho=we({type:he("schematic_element_outside_sheet_warning"),schematic_element_outside_sheet_warning_id:On("schematic_element_outside_sheet_warning"),warning_type:he("schematic_element_outside_sheet_warning").default("schematic_element_outside_sheet_warning"),message:k(),schematic_sheet_id:k(),schematic_element_type:Pt(["schematic_component","schematic_net_label","schematic_trace"]),schematic_element_id:k()}).describe("Warning emitted when a schematic component, net label, or trace extends outside its schematic sheet");jt(!0);var xlo=an.pipe(Ae().positive().finite()),Yho=we({type:he("schematic_graphic"),schematic_graphic_id:On("schematic_graphic"),schematic_sheet_id:k().optional(),asset:jwe.optional(),svg_content:k().optional(),width:xlo.optional(),height:xlo.optional()}).describe("References a graphic asset or inline SVG content with optional centered layout bounds on a schematic sheet").superRefine(({asset:e,svg_content:t},n)=>{if(e===void 0&&t===void 0)n.addIssue({code:Vt.custom,message:"At least one of asset or svg_content is required"})});jt(!0);var Gho=we({type:he("schematic_group"),schematic_group_id:On("schematic_group"),schematic_sheet_id:k().optional(),source_group_id:k(),is_subcircuit:Be().optional(),subcircuit_id:k().optional(),width:er,height:er,center:Pr,schematic_component_ids:it(k()),show_as_schematic_box:Be().optional(),name:k().optional(),description:k().optional()}).describe("Defines a group of components on the schematic");jt(!0);var Uho=we({type:he("schematic_table"),schematic_table_id:On("schematic_table"),schematic_sheet_id:k().optional(),anchor_position:Pr,column_widths:it(an),row_heights:it(an),cell_padding:an.optional(),border_width:an.optional(),subcircuit_id:k().optional(),schematic_component_id:k().optional(),anchor:mT.optional()}).describe("Defines a table on the schematic");jt(!0);var Who=we({type:he("schematic_table_cell"),schematic_table_cell_id:On("schematic_table_cell"),schematic_sheet_id:k().optional(),schematic_table_id:k(),start_row_index:Ae(),end_row_index:Ae(),start_column_index:Ae(),end_column_index:Ae(),text:k().optional(),center:Pr,width:an,height:an,horizontal_align:Pt(["left","center","right"]).optional(),vertical_align:Pt(["top","middle","bottom"]).optional(),font_size:an.optional(),subcircuit_id:k().optional()}).describe("Defines a cell within a schematic_table");jt(!0);var Xho=Pt(["a4","ansi_b"]),jho=we({type:he("schematic_sheet"),schematic_sheet_id:On("schematic_sheet"),name:k().optional(),sheet_index:Ae().optional(),sheet_size:Xho.optional(),sheet_width:Ae().positive().optional(),sheet_height:Ae().positive().optional(),subcircuit_id:k().optional(),outline_color:k().optional()}).describe("Defines a schematic sheet or page that components can be placed on");jt(!0);var Kho=we({x:an,y:an,bulge:Ae().optional()});jt(!0);var R_t=we({vertices:it(Kho)});jt(!0);var lgt=we({outer_ring:R_t,inner_rings:it(R_t).default([])});jt(!0);var $ho={from_left:"from_left",from_right:"from_right",from_top:"from_top",from_bottom:"from_bottom",from_above:"from_above",from_below:"from_below",from_x_neg:"from_left",from_x_pos:"from_right",from_y_pos:"from_top",from_y_neg:"from_bottom",from_z_pos:"from_above",from_z_neg:"from_below",from_front:"from_top",from_back:"from_bottom"},yns={from_left:{x:-1,y:0,z:0},from_right:{x:1,y:0,z:0},from_top:{x:0,y:1,z:0},from_bottom:{x:0,y:-1,z:0},from_above:{x:0,y:0,z:1},from_below:{x:0,y:0,z:-1}},qho=Pt(["from_left","from_right","from_top","from_bottom","from_above","from_below","from_x_neg","from_x_pos","from_y_pos","from_y_neg","from_z_pos","from_z_neg","from_front","from_back"]).transform((e)=>$ho[e]).describe('The side exposing the receptacle where the cable or mating part is attached, following the 2D PCB diagram convention, not a 3D viewport frame. In project coordinate space, "from_top" is +Y, "from_bottom" -Y, "from_left" -X, "from_right" +X, "from_above" +Z and "from_below" -Z. A receptacle on the +Y edge is "from_top" even though the plug moves in -Y as it seats. Cartesian spellings such as "from_y_pos" are accepted and normalized to the named values, as are the deprecated "from_front" (now "from_top") and "from_back" (now "from_bottom").');jt(!0);jt(!0);var Q_t=Pt(["leftside_top","leftside_bottom","rightside_top","rightside_bottom","topside_left","topside_right","bottomside_left","bottomside_right"]);jt(!0);var xns=[["leftside_top","bottomside_left","rightside_bottom","topside_right"],["leftside_bottom","bottomside_right","rightside_top","topside_left"]],Cns=(e,t)=>{for(let n of xns){let o=n.indexOf(e),r=n.indexOf(t);if(o!==-1&&r!==-1)return(r-o+n.length)%n.length*90}return null},Jho=we({x:an,y:an,via:Be().optional(),via_to_layer:Na.optional()}),bns=it(Jho);jt(!0);jt(!0);var Zho=we({x:an,y:an,via:Be().optional(),to_layer:Na.optional(),trace_width:an.optional()});jt(!0);var edo=we({min_trace_width:er.optional(),min_board_edge_clearance:er.optional(),min_via_hole_edge_to_via_hole_edge_clearance:er.optional(),min_plated_hole_drill_edge_to_drill_edge_clearance:er.optional(),min_trace_to_pad_edge_clearance:er.optional(),min_pad_edge_to_pad_edge_clearance:er.optional(),min_same_net_trace_edge_to_trace_edge_clearance:er.optional(),min_different_net_trace_edge_to_trace_edge_clearance:er.optional(),min_via_edge_to_pad_edge_clearance:er.optional(),min_via_hole_diameter:er.optional(),min_via_pad_diameter:er.optional()}),tdo=we({type:he("pcb_component"),pcb_component_id:On("pcb_component"),source_component_id:k(),center:Pr,layer:Na,rotation:Iu,display_offset_x:k().optional().describe("How to display the x offset for this part, usually corresponding with how the user specified it"),display_offset_y:k().optional().describe("How to display the y offset for this part, usually corresponding with how the user specified it"),width:er,height:er,do_not_place:Be().optional(),is_allowed_to_be_off_board:Be().optional(),subcircuit_id:k().optional(),pcb_group_id:k().optional(),position_mode:Pt(["packed","relative_to_group_anchor","relative_to_another_component","none"]).optional(),anchor_position:Pr.optional(),anchor_alignment:mT.optional(),positioned_relative_to_pcb_group_id:k().optional(),positioned_relative_to_pcb_board_id:k().optional(),cable_insertion_center:Pr.optional(),insertion_direction:qho.optional(),pin1_location:Q_t.optional().describe("Location of pin 1 on the unrotated, top-view component footprint"),supplier_pin1_location_map:gs(Gme,Q_t).optional().describe("Pin 1 location for each supplier's unrotated, top-view footprint"),metadata:we({kicad_footprint:Tlo.optional()}).optional(),obstructs_within_bounds:Be().default(!0).describe("Does this component take up all the space within its bounds on a layer. This is generally true except for when separated pin headers are being represented by a single component (in which case, chips can be placed between the pin headers) or for tall modules where chips fit underneath")}).describe("Defines a component on the PCB");jt(!0);var Jwe=we({type:he("pcb_debug_object"),pcb_debug_object_id:On("pcb_debug_object"),label:k().optional(),subcircuit_id:k().optional()}),ndo=Jwe.extend({shape:he("rect"),center:Pr,size:Xwe}),odo=Jwe.extend({shape:he("line"),start:Pr,end:Pr}),rdo=Jwe.extend({shape:he("point"),center:Pr}),ido=ss("shape",[ndo,odo,rdo]);jt(!0);var sdo=we({type:he("pcb_hole"),pcb_hole_id:On("pcb_hole"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),pcb_component_id:k().optional(),hole_shape:he("circle"),hole_diameter:Ae(),x:an,y:an,is_covered_with_solder_mask:Be().optional(),soldermask_margin:Ae().optional()}),Ins=sdo.describe("Defines a circular hole on the PCB");jt(!0);var ado=we({type:he("pcb_hole"),pcb_hole_id:On("pcb_hole"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),pcb_component_id:k().optional(),hole_shape:he("rect"),hole_width:Ae(),hole_height:Ae(),x:an,y:an,is_covered_with_solder_mask:Be().optional(),soldermask_margin:Ae().optional()}),vns=ado.describe("Defines a rectangular (square-capable) hole on the PCB. Use equal width/height for square.");jt(!0);var cdo=we({type:he("pcb_hole"),pcb_hole_id:On("pcb_hole"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),pcb_component_id:k().optional(),hole_shape:Pt(["circle","square"]),hole_diameter:Ae(),x:an,y:an,is_covered_with_solder_mask:Be().optional(),soldermask_margin:Ae().optional()}),Sns=cdo.describe("Defines a circular or square hole on the PCB");jt(!0);var ldo=we({type:he("pcb_hole"),pcb_hole_id:On("pcb_hole"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),pcb_component_id:k().optional(),hole_shape:he("oval"),hole_width:Ae(),hole_height:Ae(),x:an,y:an,is_covered_with_solder_mask:Be().optional(),soldermask_margin:Ae().optional()}),Pns=ldo.describe("Defines an oval hole on the PCB");jt(!0);var hdo=we({type:he("pcb_hole"),pcb_hole_id:On("pcb_hole"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),pcb_component_id:k().optional(),hole_shape:he("pill"),hole_width:Ae(),hole_height:Ae(),x:an,y:an,is_covered_with_solder_mask:Be().optional(),soldermask_margin:Ae().optional()}),Ens=hdo.describe("Defines a pill-shaped hole on the PCB");jt(!0);var ddo=we({type:he("pcb_hole"),pcb_hole_id:On("pcb_hole"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),pcb_component_id:k().optional(),hole_shape:he("rotated_pill"),hole_width:Ae(),hole_height:Ae(),x:an,y:an,ccw_rotation:Iu,is_covered_with_solder_mask:Be().optional(),soldermask_margin:Ae().optional()}),Mns=ddo.describe("Defines a rotated pill-shaped hole on the PCB");jt(!0);var udo=cdo.or(ldo).or(hdo).or(ddo).or(sdo).or(ado),wns=we({type:he("pcb_plated_hole"),shape:he("circle"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),outer_diameter:Ae(),hole_diameter:Ae(),is_covered_with_solder_mask:Be().optional(),x:an,y:an,layers:it(Na),port_hints:it(k()).optional(),pcb_component_id:k().optional(),pcb_port_id:k().optional(),pcb_plated_hole_id:On("pcb_plated_hole"),soldermask_margin:Ae().optional()}),Bns=we({type:he("pcb_plated_hole"),shape:Pt(["oval","pill"]),pcb_group_id:k().optional(),subcircuit_id:k().optional(),outer_width:Ae(),outer_height:Ae(),hole_width:Ae(),hole_height:Ae(),is_covered_with_solder_mask:Be().optional(),x:an,y:an,ccw_rotation:Iu,layers:it(Na),port_hints:it(k()).optional(),pcb_component_id:k().optional(),pcb_port_id:k().optional(),pcb_plated_hole_id:On("pcb_plated_hole"),soldermask_margin:Ae().optional()}),Tns=we({type:he("pcb_plated_hole"),shape:he("circular_hole_with_rect_pad"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),hole_shape:he("circle"),pad_shape:he("rect"),hole_diameter:Ae(),rect_pad_width:Ae(),rect_pad_height:Ae(),rect_border_radius:Ae().optional(),hole_offset_x:an.default(0),hole_offset_y:an.default(0),is_covered_with_solder_mask:Be().optional(),x:an,y:an,layers:it(Na),port_hints:it(k()).optional(),pcb_component_id:k().optional(),pcb_port_id:k().optional(),pcb_plated_hole_id:On("pcb_plated_hole"),soldermask_margin:Ae().optional(),rect_ccw_rotation:Iu.optional()}),Dns=we({type:he("pcb_plated_hole"),shape:he("pill_hole_with_rect_pad"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),hole_shape:he("pill"),pad_shape:he("rect"),hole_width:Ae(),hole_height:Ae(),rect_pad_width:Ae(),rect_pad_height:Ae(),rect_border_radius:Ae().optional(),hole_offset_x:an.default(0),hole_offset_y:an.default(0),is_covered_with_solder_mask:Be().optional(),x:an,y:an,layers:it(Na),port_hints:it(k()).optional(),pcb_component_id:k().optional(),pcb_port_id:k().optional(),pcb_plated_hole_id:On("pcb_plated_hole"),soldermask_margin:Ae().optional()}),Nns=we({type:he("pcb_plated_hole"),shape:he("rotated_pill_hole_with_rect_pad"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),hole_shape:he("rotated_pill"),pad_shape:he("rect"),hole_width:Ae(),hole_height:Ae(),hole_ccw_rotation:Iu,rect_pad_width:Ae(),rect_pad_height:Ae(),rect_border_radius:Ae().optional(),rect_ccw_rotation:Iu,hole_offset_x:an.default(0),hole_offset_y:an.default(0),is_covered_with_solder_mask:Be().optional(),x:an,y:an,layers:it(Na),port_hints:it(k()).optional(),pcb_component_id:k().optional(),pcb_port_id:k().optional(),pcb_plated_hole_id:On("pcb_plated_hole"),soldermask_margin:Ae().optional()}),Rns=we({type:he("pcb_plated_hole"),shape:he("hole_with_polygon_pad"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),hole_shape:Pt(["circle","oval","pill","rotated_pill"]),hole_diameter:Ae().optional(),hole_width:Ae().optional(),hole_height:Ae().optional(),pad_outline:it(we({x:an,y:an})).min(3),hole_offset_x:an.default(0),hole_offset_y:an.default(0),is_covered_with_solder_mask:Be().optional(),x:an,y:an,layers:it(Na),port_hints:it(k()).optional(),pcb_component_id:k().optional(),pcb_port_id:k().optional(),pcb_plated_hole_id:On("pcb_plated_hole"),soldermask_margin:Ae().optional(),ccw_rotation:Iu.optional()}),pdo=un([wns,Bns,Tns,Dns,Nns,Rns]);jt(!0);jt(!0);jt(!0);jt(!0);jt(!0);jt(!0);var mdo=we({type:he("pcb_port"),pcb_port_id:On("pcb_port"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),source_port_id:k(),pcb_component_id:k().optional(),x:an,y:an,layers:it(Na),is_board_pinout:Be().optional()}).describe("Defines a port on the PCB");jt(!0);var Qns=we({type:he("pcb_smtpad"),shape:he("circle"),pcb_smtpad_id:On("pcb_smtpad"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),x:an,y:an,radius:Ae(),layer:Na,port_hints:it(k()).optional(),pcb_component_id:k().optional(),pcb_port_id:k().optional(),is_covered_with_solder_mask:Be().optional(),soldermask_margin:Ae().optional(),solderpaste_margin:Ae().optional()}),kns=we({type:he("pcb_smtpad"),shape:he("rect"),pcb_smtpad_id:On("pcb_smtpad"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),x:an,y:an,width:Ae(),height:Ae(),rect_border_radius:Ae().optional(),corner_radius:Ae().optional(),layer:Na,port_hints:it(k()).optional(),pcb_component_id:k().optional(),pcb_port_id:k().optional(),is_covered_with_solder_mask:Be().optional(),soldermask_margin:Ae().optional(),soldermask_margin_left:Ae().optional(),soldermask_margin_top:Ae().optional(),soldermask_margin_right:Ae().optional(),soldermask_margin_bottom:Ae().optional(),solderpaste_margin:Ae().optional()}),Lns=we({type:he("pcb_smtpad"),shape:he("rotated_rect"),pcb_smtpad_id:On("pcb_smtpad"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),x:an,y:an,width:Ae(),height:Ae(),rect_border_radius:Ae().optional(),corner_radius:Ae().optional(),ccw_rotation:Iu,layer:Na,port_hints:it(k()).optional(),pcb_component_id:k().optional(),pcb_port_id:k().optional(),is_covered_with_solder_mask:Be().optional(),soldermask_margin:Ae().optional(),soldermask_margin_left:Ae().optional(),soldermask_margin_top:Ae().optional(),soldermask_margin_right:Ae().optional(),soldermask_margin_bottom:Ae().optional(),solderpaste_margin:Ae().optional()}),_do=we({type:he("pcb_smtpad"),shape:he("pill"),pcb_smtpad_id:On("pcb_smtpad"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),x:an,y:an,width:Ae(),height:Ae(),radius:Ae(),layer:Na,port_hints:it(k()).optional(),pcb_component_id:k().optional(),pcb_port_id:k().optional(),is_covered_with_solder_mask:Be().optional(),soldermask_margin:Ae().optional(),solderpaste_margin:Ae().optional()}),Hns=we({type:he("pcb_smtpad"),shape:he("rotated_pill"),pcb_smtpad_id:On("pcb_smtpad"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),x:an,y:an,width:Ae(),height:Ae(),radius:Ae(),ccw_rotation:Iu,layer:Na,port_hints:it(k()).optional(),pcb_component_id:k().optional(),pcb_port_id:k().optional(),is_covered_with_solder_mask:Be().optional(),soldermask_margin:Ae().optional(),solderpaste_margin:Ae().optional()}),Fns=we({type:he("pcb_smtpad"),shape:he("polygon"),pcb_smtpad_id:On("pcb_smtpad"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),points:it(Pr),layer:Na,port_hints:it(k()).optional(),pcb_component_id:k().optional(),pcb_port_id:k().optional(),is_covered_with_solder_mask:Be().optional(),soldermask_margin:Ae().optional(),solderpaste_margin:Ae().optional()}),gdo=ss("shape",[Qns,kns,Lns,Hns,_do,Fns]).describe("Defines an SMT pad on the PCB");jt(!0);jt(!0);jt(!0);jt(!0);jt(!0);jt(!0);var zns=we({type:he("pcb_solder_paste"),shape:he("circle"),pcb_solder_paste_id:On("pcb_solder_paste"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),x:an,y:an,radius:Ae(),layer:Na,pcb_component_id:k().optional(),pcb_smtpad_id:k().optional()}),Ons=we({type:he("pcb_solder_paste"),shape:he("rect"),pcb_solder_paste_id:On("pcb_solder_paste"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),x:an,y:an,width:Ae(),height:Ae(),layer:Na,pcb_component_id:k().optional(),pcb_smtpad_id:k().optional()}),Vns=we({type:he("pcb_solder_paste"),shape:he("pill"),pcb_solder_paste_id:On("pcb_solder_paste"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),x:an,y:an,width:Ae(),height:Ae(),radius:Ae(),layer:Na,pcb_component_id:k().optional(),pcb_smtpad_id:k().optional()}),Yns=we({type:he("pcb_solder_paste"),shape:he("rotated_rect"),pcb_solder_paste_id:On("pcb_solder_paste"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),x:an,y:an,width:Ae(),height:Ae(),ccw_rotation:an,layer:Na,pcb_component_id:k().optional(),pcb_smtpad_id:k().optional()}),Gns=we({type:he("pcb_solder_paste"),shape:he("rotated_pill"),pcb_solder_paste_id:On("pcb_solder_paste"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),x:an,y:an,width:Ae(),height:Ae(),radius:Ae(),ccw_rotation:Iu,layer:Na,pcb_component_id:k().optional(),pcb_smtpad_id:k().optional()}),Uns=we({type:he("pcb_solder_paste"),shape:he("oval"),pcb_solder_paste_id:On("pcb_solder_paste"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),x:an,y:an,width:Ae(),height:Ae(),layer:Na,pcb_component_id:k().optional(),pcb_smtpad_id:k().optional()}),Ado=un([zns,Ons,Vns,Yns,Gns,Uns]).describe("Defines solderpaste on the PCB");jt(!0);jt(!0);jt(!0);jt(!0);jt(!0);jt(!0);var fdo=we({type:he("pcb_text"),pcb_text_id:On("pcb_text"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),text:k(),center:Pr,layer:Na,width:er,height:er,lines:Ae(),align:Pt(["bottom-left"])}).describe("Defines text on the PCB");jt(!0);var ydo=we({route_type:he("wire"),x:an,y:an,width:an,copper_pour_id:k().optional(),is_inside_copper_pour:Be().optional(),start_pcb_port_id:k().optional(),end_pcb_port_id:k().optional(),layer:Na}),xdo=we({route_type:he("via"),x:an,y:an,copper_pour_id:k().optional(),is_inside_copper_pour:Be().optional(),hole_diameter:an.optional(),outer_diameter:an.optional(),from_layer:Na,to_layer:Na}),Cdo=we({route_type:he("through_pad"),start:Pr,end:Pr,width:an,start_layer:Na,end_layer:Na,pcb_smtpad_id:k().optional(),pcb_plated_hole_id:k().optional()}),bdo=un([ydo,xdo,Cdo]),Ido=we({type:he("pcb_trace"),source_trace_id:k().optional(),pcb_component_id:k().optional(),pcb_trace_id:On("pcb_trace"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),route_thickness_mode:Pt(["constant","interpolated"]).default("constant").optional(),route_order_index:Ae().optional(),should_round_corners:Be().optional(),trace_length:Ae().optional(),highlight_color:k().optional(),route:it(bdo)}).describe("Defines a trace on the PCB");jt(!0);jt(!0);var vdo=we({type:he("pcb_trace_warning"),pcb_trace_warning_id:On("pcb_trace_warning"),warning_type:he("pcb_trace_warning").default("pcb_trace_warning"),message:k(),center:Pr.optional(),pcb_trace_id:k(),source_trace_id:k(),pcb_component_ids:it(k()),pcb_port_ids:it(k()),subcircuit_id:k().optional()}).describe("Defines a trace warning on the PCB");jt(!0);var Sdo=we({type:he("pcb_trace_too_long_warning"),pcb_trace_too_long_warning_id:On("pcb_trace_too_long_warning"),warning_type:he("pcb_trace_too_long_warning").default("pcb_trace_too_long_warning"),message:k(),pcb_trace_id:k(),source_net_id:k().optional(),source_trace_id:k().optional(),actual_trace_length:an,maximum_trace_length:an,subcircuit_id:k().optional()}).describe("Warning emitted when a PCB trace is longer than its maximum allowed length");jt(!0);var Pdo=we({type:he("pcb_trace_too_many_vias_warning"),pcb_trace_too_many_vias_warning_id:On("pcb_trace_too_many_vias_warning"),warning_type:he("pcb_trace_too_many_vias_warning").default("pcb_trace_too_many_vias_warning"),message:k(),pcb_trace_id:k(),source_net_id:k().optional(),source_trace_id:k().optional(),actual_via_count:Ae().int().nonnegative(),maximum_via_count:Ae().int().nonnegative(),subcircuit_id:k().optional()}).describe("Warning emitted when a PCB trace has more vias than its maximum allowed count");jt(!0);var Edo=vl.extend({type:he("pcb_trace_error"),pcb_trace_error_id:On("pcb_trace_error"),error_type:he("pcb_trace_error").default("pcb_trace_error"),center:Pr.optional(),pcb_trace_id:k(),source_trace_id:k(),pcb_component_ids:it(k()),pcb_port_ids:it(k()),subcircuit_id:k().optional()}).describe("Defines a trace error on the PCB");jt(!0);var Mdo=vl.extend({type:he("pcb_trace_missing_error"),pcb_trace_missing_error_id:On("pcb_trace_missing_error"),error_type:he("pcb_trace_missing_error").default("pcb_trace_missing_error"),center:Pr.optional(),source_trace_id:k(),pcb_component_ids:it(k()),pcb_port_ids:it(k()),subcircuit_id:k().optional()}).describe("Defines an error when a source trace has no corresponding PCB trace");jt(!0);var wdo=vl.extend({type:he("pcb_port_not_matched_error"),pcb_error_id:On("pcb_error"),error_type:he("pcb_port_not_matched_error").default("pcb_port_not_matched_error"),pcb_component_ids:it(k()),subcircuit_id:k().optional()}).describe("Defines a trace error on the PCB where a port is not matched");jt(!0);var Bdo=vl.extend({type:he("pcb_port_not_connected_error"),pcb_port_not_connected_error_id:On("pcb_port_not_connected_error"),error_type:he("pcb_port_not_connected_error").default("pcb_port_not_connected_error"),pcb_port_ids:it(k()),pcb_component_ids:it(k()),subcircuit_id:k().optional()}).describe("Defines an error when a pcb port is not connected to any trace");jt(!0);var Tdo=we({type:he("pcb_net"),pcb_net_id:On("pcb_net"),source_net_id:k().optional(),highlight_color:k().optional()}).describe("Defines a net on the PCB");jt(!0);var Ddo=we({type:he("pcb_via"),pcb_via_id:On("pcb_via"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),subcircuit_connectivity_map_key:k().optional(),x:an,y:an,outer_diameter:an.default("0.6mm"),hole_diameter:an.default("0.25mm"),from_layer:Na.optional(),to_layer:Na.optional(),layers:it(Na),pcb_trace_id:k().optional(),source_trace_id:k().optional(),source_net_id:k().min(1).optional(),net_is_assignable:Be().optional(),net_assigned:Be().optional(),is_tented:Be().optional()}).describe("Defines a via on the PCB");jt(!0);var Ndo=we({type:he("pcb_board"),pcb_board_id:On("pcb_board"),pcb_panel_id:k().optional(),carrier_pcb_board_id:k().optional(),is_subcircuit:Be().optional(),subcircuit_id:k().optional(),is_mounted_to_carrier_board:Be().optional(),is_via_in_pad_allowed:Be().optional(),width:er.optional(),height:er.optional(),center:Pr,display_offset_x:k().optional().describe("How to display the x offset for this board, usually corresponding with how the user specified it"),display_offset_y:k().optional().describe("How to display the y offset for this board, usually corresponding with how the user specified it"),thickness:er.optional().default(1.4),num_layers:Ae().optional().default(4),allow_blind_and_buried_vias:Be().optional().describe("Whether autorouters may generate blind and buried vias. False restricts newly generated vias to the full board stack."),outline:it(Pr).optional(),shape:Pt(["rect","polygon"]).optional(),material:Pt(["fr4","fr1"]).default("fr4"),solder_mask_color:k().optional(),silkscreen_color:k().optional(),anchor_position:Pr.optional(),anchor_alignment:mT.optional(),position_mode:Pt(["relative_to_panel_anchor","none"]).optional()}).merge(edo).describe("Defines the board outline of the PCB");jt(!0);var Rdo=we({type:he("pcb_panel"),pcb_panel_id:On("pcb_panel"),width:er,height:er,center:Pr,thickness:er.optional().default(1.4),covered_with_solder_mask:Be().optional().default(!0)}).describe("Defines a PCB panel that can contain multiple boards");jt(!0);var Qdo=vl.extend({type:he("pcb_placement_error"),pcb_placement_error_id:On("pcb_placement_error"),error_type:he("pcb_placement_error").default("pcb_placement_error"),subcircuit_id:k().optional()}).describe("Defines a placement error on the PCB");jt(!0);var kdo=vl.extend({type:he("pcb_packing_error"),pcb_packing_error_id:On("pcb_packing_error"),error_type:he("pcb_packing_error").default("pcb_packing_error"),pcb_group_id:k().optional(),subcircuit_id:k().optional()}).describe("Defines a failure to pack PCB components within layout bounds");jt(!0);var Ldo=vl.extend({type:he("pcb_panelization_placement_error"),pcb_panelization_placement_error_id:On("pcb_panelization_placement_error"),error_type:he("pcb_panelization_placement_error").default("pcb_panelization_placement_error"),pcb_panel_id:k().optional(),pcb_board_id:k().optional(),subcircuit_id:k().optional()}).describe("Defines a panelization placement error on the PCB");jt(!0);var Hdo=we({type:he("pcb_trace_hint"),pcb_trace_hint_id:On("pcb_trace_hint"),pcb_port_id:k(),pcb_component_id:k(),route:it(Zho),subcircuit_id:k().optional()}).describe("A hint that can be used during generation of a PCB trace");jt(!0);var Fdo=we({type:he("pcb_silkscreen_line"),pcb_silkscreen_line_id:On("pcb_silkscreen_line"),pcb_component_id:k(),pcb_group_id:k().optional(),subcircuit_id:k().optional(),stroke_width:an.default("0.1mm"),x1:an,y1:an,x2:an,y2:an,layer:wg}).describe("Defines a silkscreen line on the PCB");jt(!0);var zdo=we({type:he("pcb_silkscreen_path"),pcb_silkscreen_path_id:On("pcb_silkscreen_path"),pcb_component_id:k(),pcb_group_id:k().optional(),subcircuit_id:k().optional(),layer:wg,route:it(Pr),stroke_width:er}).describe("Defines a silkscreen path on the PCB");jt(!0);var Odo=we({type:he("pcb_silkscreen_text"),pcb_silkscreen_text_id:On("pcb_silkscreen_text"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),font:he("tscircuit2024").default("tscircuit2024"),font_size:an.default("0.2mm"),pcb_component_id:k(),text:k(),is_knockout:Be().default(!1).optional(),knockout_padding:we({left:er,top:er,bottom:er,right:er}).default({left:"0.2mm",top:"0.2mm",bottom:"0.2mm",right:"0.2mm"}).optional(),ccw_rotation:Ae().optional(),layer:Na,is_mirrored:Be().default(!1).optional(),anchor_position:Pr.default({x:0,y:0}),anchor_alignment:mT.default("center")}).describe("Defines silkscreen text on the PCB");jt(!0);var Vdo=we({type:he("pcb_copper_text"),pcb_copper_text_id:On("pcb_copper_text"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),font:he("tscircuit2024").default("tscircuit2024"),font_size:an.default("0.2mm"),pcb_component_id:k(),text:k(),is_knockout:Be().default(!1).optional(),knockout_padding:we({left:er,top:er,bottom:er,right:er}).default({left:"0.2mm",top:"0.2mm",bottom:"0.2mm",right:"0.2mm"}).optional(),ccw_rotation:Ae().optional(),layer:Na,is_mirrored:Be().default(!1).optional(),anchor_position:Pr.default({x:0,y:0}),anchor_alignment:mT.default("center")}).describe("Defines copper text on the PCB");jt(!0);var Ydo=we({type:he("pcb_silkscreen_rect"),pcb_silkscreen_rect_id:On("pcb_silkscreen_rect"),pcb_component_id:k(),pcb_group_id:k().optional(),subcircuit_id:k().optional(),center:Pr,width:er,height:er,layer:Na,stroke_width:er.default("1mm"),corner_radius:er.optional(),is_filled:Be().default(!0).optional(),has_stroke:Be().optional(),is_stroke_dashed:Be().optional(),ccw_rotation:Ae().optional()}).describe("Defines a silkscreen rect on the PCB");jt(!0);var Gdo=we({type:he("pcb_silkscreen_circle"),pcb_silkscreen_circle_id:On("pcb_silkscreen_circle"),pcb_component_id:k(),pcb_group_id:k().optional(),subcircuit_id:k().optional(),center:Pr,radius:er,layer:wg,stroke_width:er.default("1mm"),is_filled:Be().optional()}).describe("Defines a silkscreen circle on the PCB");jt(!0);var Udo=we({type:he("pcb_silkscreen_oval"),pcb_silkscreen_oval_id:On("pcb_silkscreen_oval"),pcb_component_id:k(),pcb_group_id:k().optional(),subcircuit_id:k().optional(),center:Pr,radius_x:an,radius_y:an,layer:wg,ccw_rotation:Iu.optional()}).describe("Defines a silkscreen oval on the PCB");jt(!0);var Wns=we({type:he("pcb_silkscreen_graphic"),pcb_silkscreen_graphic_id:On("pcb_silkscreen_graphic"),pcb_component_id:k(),pcb_group_id:k().optional(),subcircuit_id:k().optional(),layer:wg,image_asset:jwe.optional()}),Wdo=Wns.extend({shape:he("brep"),brep_shape:lgt}).describe("Defines a BRep silkscreen graphic on the PCB");jt(!0);var Xdo=ss("shape",[Wdo]).describe("Defines a silkscreen graphic on the PCB");jt(!0);var jdo=we({type:he("pcb_silkscreen_pill"),pcb_silkscreen_pill_id:On("pcb_silkscreen_pill"),pcb_component_id:k(),pcb_group_id:k().optional(),subcircuit_id:k().optional(),center:Pr,width:er,height:er,layer:Na,ccw_rotation:Ae().optional()}).describe("Defines a silkscreen pill on the PCB");jt(!0);var Kdo=we({type:he("pcb_fabrication_note_text"),pcb_fabrication_note_text_id:On("pcb_fabrication_note_text"),subcircuit_id:k().optional(),pcb_group_id:k().optional(),font:he("tscircuit2024").default("tscircuit2024"),font_size:an.default("1mm"),pcb_component_id:k(),text:k(),ccw_rotation:Ae().optional(),layer:wg,anchor_position:Pr.default({x:0,y:0}),anchor_alignment:Pt(["center","top_left","top_right","bottom_left","bottom_right"]).default("center"),color:k().optional()}).describe("Defines a fabrication note in text on the PCB, useful for leaving notes for assemblers or fabricators");jt(!0);var $do=we({type:he("pcb_fabrication_note_path"),pcb_fabrication_note_path_id:On("pcb_fabrication_note_path"),pcb_component_id:k(),subcircuit_id:k().optional(),layer:Na,route:it(Pr),stroke_width:er,color:k().optional()}).describe("Defines a fabrication path on the PCB for fabricators or assemblers");jt(!0);var qdo=we({type:he("pcb_fabrication_note_rect"),pcb_fabrication_note_rect_id:On("pcb_fabrication_note_rect"),pcb_component_id:k(),pcb_group_id:k().optional(),subcircuit_id:k().optional(),center:Pr,width:er,height:er,layer:wg,stroke_width:er.default("0.1mm"),corner_radius:er.optional(),is_filled:Be().optional(),has_stroke:Be().optional(),is_stroke_dashed:Be().optional(),color:k().optional()}).describe("Defines a fabrication note rectangle on the PCB");jt(!0);var Jdo=we({type:he("pcb_fabrication_note_dimension"),pcb_fabrication_note_dimension_id:On("pcb_fabrication_note_dimension"),pcb_component_id:k(),pcb_group_id:k().optional(),subcircuit_id:k().optional(),layer:wg,from:Pr,to:Pr,text:k().optional(),text_ccw_rotation:Ae().optional(),offset:er.optional(),offset_distance:er.optional(),offset_direction:we({x:Ae(),y:Ae()}).optional(),font:he("tscircuit2024").default("tscircuit2024"),font_size:er.default("1mm"),color:k().optional(),arrow_size:er.default("1mm")}).describe("Defines a measurement annotation within PCB fabrication notes");jt(!0);var Zdo=we({type:he("pcb_note_text"),pcb_note_text_id:On("pcb_note_text"),pcb_component_id:k().optional(),pcb_group_id:k().optional(),subcircuit_id:k().optional(),name:k().optional(),font:he("tscircuit2024").default("tscircuit2024"),font_size:an.default("1mm"),text:k().optional(),anchor_position:Pr.default({x:0,y:0}),anchor_alignment:Pt(["center","top_left","top_right","bottom_left","bottom_right"]).default("center"),layer:wg.default("top"),is_mirrored_from_top_view:Be().optional(),color:k().optional()}).describe("Defines a documentation note in text on the PCB");jt(!0);var euo=we({type:he("pcb_note_rect"),pcb_note_rect_id:On("pcb_note_rect"),pcb_component_id:k().optional(),pcb_group_id:k().optional(),subcircuit_id:k().optional(),name:k().optional(),text:k().optional(),center:Pr,width:er,height:er,layer:wg.default("top"),stroke_width:er.default("0.1mm"),corner_radius:er.optional(),is_filled:Be().optional(),has_stroke:Be().optional(),is_stroke_dashed:Be().optional(),color:k().optional()}).describe("Defines a rectangular documentation note on the PCB");jt(!0);var tuo=we({type:he("pcb_note_path"),pcb_note_path_id:On("pcb_note_path"),pcb_component_id:k().optional(),pcb_group_id:k().optional(),subcircuit_id:k().optional(),name:k().optional(),text:k().optional(),route:it(Pr),layer:wg.default("top"),stroke_width:er.default("0.1mm"),color:k().optional()}).describe("Defines a polyline documentation note on the PCB");jt(!0);var nuo=we({type:he("pcb_note_line"),pcb_note_line_id:On("pcb_note_line"),pcb_component_id:k().optional(),pcb_group_id:k().optional(),subcircuit_id:k().optional(),name:k().optional(),text:k().optional(),x1:an,y1:an,x2:an,y2:an,layer:wg.default("top"),stroke_width:an.default("0.1mm"),color:k().optional(),is_dashed:Be().optional()}).describe("Defines a straight documentation note line on the PCB");jt(!0);var ouo=we({type:he("pcb_note_dimension"),pcb_note_dimension_id:On("pcb_note_dimension"),pcb_component_id:k().optional(),pcb_group_id:k().optional(),subcircuit_id:k().optional(),name:k().optional(),from:Pr,to:Pr,text:k().optional(),text_ccw_rotation:Ae().optional(),offset_distance:er.optional(),offset_direction:we({x:Ae(),y:Ae()}).optional(),font:he("tscircuit2024").default("tscircuit2024"),font_size:er.default("1mm"),layer:wg.default("top"),color:k().optional(),arrow_size:er.default("1mm")}).describe("Defines a measurement annotation within PCB documentation notes");jt(!0);var ruo=vl.extend({type:he("pcb_footprint_overlap_error"),pcb_error_id:On("pcb_error"),error_type:he("pcb_footprint_overlap_error").default("pcb_footprint_overlap_error"),pcb_smtpad_ids:it(k()).optional(),pcb_plated_hole_ids:it(k()).optional(),pcb_hole_ids:it(k()).optional(),pcb_keepout_ids:it(k()).optional()}).describe("Error emitted when a pcb footprint overlaps with another element");jt(!0);var iuo=vl.extend({type:he("pcb_courtyard_overlap_error"),pcb_error_id:On("pcb_error"),error_type:he("pcb_courtyard_overlap_error").default("pcb_courtyard_overlap_error"),pcb_component_ids:kC([k(),k()])}).describe("Error emitted when the courtyard (CrtYd) of one PCB component overlaps with the courtyard of another");jt(!0);var suo=we({type:he("pcb_keepout"),shape:he("rect"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),center:Pr,width:an,height:an,pcb_keepout_id:k(),layers:it(k()),description:k().optional(),excluded_pcb_component_ids:it(k()).optional()}).or(we({type:he("pcb_keepout"),shape:he("circle"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),center:Pr,radius:an,pcb_keepout_id:k(),layers:it(k()),description:k().optional(),excluded_pcb_component_ids:it(k()).optional()}));jt(!0);var Zwe=we({type:he("pcb_cutout"),pcb_cutout_id:On("pcb_cutout"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),pcb_board_id:k().optional(),pcb_panel_id:k().optional()}),auo=Zwe.extend({shape:he("rect"),center:Pr,width:er,height:er,rotation:Iu.optional(),corner_radius:er.optional()});jt(!0);var cuo=Zwe.extend({shape:he("circle"),center:Pr,radius:er});jt(!0);var luo=Zwe.extend({shape:he("polygon"),points:it(Pr)});jt(!0);var huo=Zwe.extend({shape:he("path"),route:it(Pr),slot_width:er,slot_length:er.optional(),space_between_slots:er.optional(),slot_corner_radius:er.optional()});jt(!0);var duo=ss("shape",[auo,cuo,luo,huo]).describe("Defines a cutout on the PCB, removing board material.");jt(!0);var uuo=vl.extend({type:he("pcb_missing_footprint_error"),pcb_missing_footprint_error_id:On("pcb_missing_footprint_error"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),error_type:he("pcb_missing_footprint_error").default("pcb_missing_footprint_error"),source_component_id:k()}).describe("Defines a missing footprint error on the PCB");jt(!0);var puo=vl.extend({type:he("external_footprint_load_error"),external_footprint_load_error_id:On("external_footprint_load_error"),pcb_component_id:k(),source_component_id:k(),pcb_group_id:k().optional(),subcircuit_id:k().optional(),footprinter_string:k().optional(),error_type:he("external_footprint_load_error").default("external_footprint_load_error")}).describe("Defines an error when an external footprint fails to load");jt(!0);var muo=vl.extend({type:he("circuit_json_footprint_load_error"),circuit_json_footprint_load_error_id:On("circuit_json_footprint_load_error"),pcb_component_id:k(),source_component_id:k(),pcb_group_id:k().optional(),subcircuit_id:k().optional(),error_type:he("circuit_json_footprint_load_error").default("circuit_json_footprint_load_error"),circuit_json:it(Jh()).optional()}).describe("Defines an error when a circuit JSON footprint fails to load");jt(!0);var _uo=we({type:he("pcb_group"),pcb_group_id:On("pcb_group"),source_group_id:k(),is_subcircuit:Be().optional(),subcircuit_id:k().optional(),width:er.optional(),height:er.optional(),center:Pr,display_offset_x:k().optional().describe("How to display the x offset for this group, usually corresponding with how the user specified it"),display_offset_y:k().optional().describe("How to display the y offset for this group, usually corresponding with how the user specified it"),outline:it(Pr).optional(),anchor_position:Pr.optional(),anchor_alignment:mT.default("center"),position_mode:Pt(["packed","relative_to_group_anchor","none"]).optional(),positioned_relative_to_pcb_group_id:k().optional(),positioned_relative_to_pcb_board_id:k().optional(),pcb_component_ids:it(k()),child_layout_mode:Pt(["packed","none"]).optional(),name:k().optional(),description:k().optional(),layout_mode:k().optional(),autorouter_configuration:we({trace_clearance:er}).optional(),autorouter_used_string:k().optional()}).describe("Defines a group of components on the PCB");jt(!0);var guo=vl.extend({type:he("pcb_autorouting_error"),pcb_error_id:On("pcb_autorouting_error"),error_type:he("pcb_autorouting_error").default("pcb_autorouting_error"),subcircuit_id:k().optional()}).describe("The autorouting has failed to route a portion of the board");jt(!0);var Auo=we({type:he("pcb_manual_edit_conflict_warning"),pcb_manual_edit_conflict_warning_id:On("pcb_manual_edit_conflict_warning"),warning_type:he("pcb_manual_edit_conflict_warning").default("pcb_manual_edit_conflict_warning"),message:k(),pcb_component_id:k(),pcb_group_id:k().optional(),subcircuit_id:k().optional(),source_component_id:k()}).describe("Warning emitted when a component has both manual placement and explicit pcbX/pcbY coordinates");jt(!0);var Clo=Pt(["x-","x+","y+","y-"]),fuo=we({type:he("pcb_connector_not_in_accessible_orientation_warning"),pcb_connector_not_in_accessible_orientation_warning_id:On("pcb_connector_not_in_accessible_orientation_warning"),warning_type:he("pcb_connector_not_in_accessible_orientation_warning").default("pcb_connector_not_in_accessible_orientation_warning"),message:k(),pcb_component_id:k(),source_component_id:k().optional(),pcb_board_id:k().optional(),facing_direction:Clo,recommended_facing_direction:Clo,subcircuit_id:k().optional()}).describe("Warning emitted when a connector PCB component is facing inward toward the board and should be reoriented to an outward-facing direction");jt(!0);var yuo=we({type:he("pcb_component_missing_courtyard_warning"),pcb_component_missing_courtyard_warning_id:On("pcb_component_missing_courtyard_warning"),warning_type:he("pcb_component_missing_courtyard_warning").default("pcb_component_missing_courtyard_warning"),message:k(),pcb_component_id:k(),source_component_id:k().optional(),subcircuit_id:k().optional()}).describe("Warning emitted when a PCB component has no courtyard geometry");jt(!0);var xuo=we({type:he("supplier_footprint_mismatch_warning"),supplier_footprint_mismatch_warning_id:On("supplier_footprint_mismatch_warning"),warning_type:he("supplier_footprint_mismatch_warning").default("supplier_footprint_mismatch_warning"),message:k(),source_component_id:k(),pcb_component_id:k().optional(),pcb_group_id:k().optional(),subcircuit_id:k().optional(),supplier_name:Gme.optional(),supplier_part_number:k().optional(),supplier_footprint_url:k().optional(),footprint_copper_intersection_over_union:Ae()}).describe("Warning emitted when a supplier part footprint does not match the expected footprint");jt(!0);var Cuo=we({type:he("pcb_breakout_point"),pcb_breakout_point_id:On("pcb_breakout_point"),pcb_group_id:k(),subcircuit_id:k().optional(),source_trace_id:k().optional(),source_port_id:k().optional(),source_net_id:k().optional(),layer:Na.optional(),x:an,y:an}).describe("Defines a routing target within a pcb_group for a source_trace or source_net");jt(!0);var buo=we({type:he("pcb_ground_plane"),pcb_ground_plane_id:On("pcb_ground_plane"),source_pcb_ground_plane_id:k(),source_net_id:k(),pcb_group_id:k().optional(),subcircuit_id:k().optional()}).describe("Defines a ground plane on the PCB");jt(!0);var Iuo=we({type:he("pcb_ground_plane_region"),pcb_ground_plane_region_id:On("pcb_ground_plane_region"),pcb_ground_plane_id:k(),pcb_group_id:k().optional(),subcircuit_id:k().optional(),layer:Na,points:it(Pr)}).describe("Defines a polygon region of a ground plane");jt(!0);var vuo=we({type:he("pcb_thermal_spoke"),pcb_thermal_spoke_id:On("pcb_thermal_spoke"),pcb_ground_plane_id:k(),shape:k(),spoke_count:Ae(),spoke_thickness:an,spoke_inner_diameter:an,spoke_outer_diameter:an,pcb_plated_hole_id:k().optional(),subcircuit_id:k().optional()}).describe("Pattern for connecting a ground plane to a plated hole");jt(!0);var hgt=we({type:he("pcb_copper_pour"),pcb_copper_pour_id:On("pcb_copper_pour"),pcb_group_id:k().optional(),subcircuit_id:k().optional(),layer:Na,source_net_id:k().optional(),covered_with_solder_mask:Be().optional().default(!0)}),Suo=hgt.extend({shape:he("rect"),center:Pr,width:er,height:er,rotation:Iu.optional()});jt(!0);var Puo=hgt.extend({shape:he("brep"),brep_shape:lgt});jt(!0);var Euo=hgt.extend({shape:he("polygon"),points:it(Pr)});jt(!0);var Muo=ss("shape",[Suo,Puo,Euo]).describe("Defines a copper pour on the PCB.");jt(!0);var wuo=vl.extend({type:he("pcb_component_outside_board_error"),pcb_component_outside_board_error_id:On("pcb_component_outside_board_error"),error_type:he("pcb_component_outside_board_error").default("pcb_component_outside_board_error"),pcb_component_id:k(),pcb_board_id:k(),component_center:Pr,component_bounds:we({min_x:Ae(),max_x:Ae(),min_y:Ae(),max_y:Ae()}),subcircuit_id:k().optional(),source_component_id:k().optional()}).describe("Error emitted when a PCB component is placed outside the board boundaries");jt(!0);var Buo=vl.extend({type:he("pcb_component_not_on_board_edge_error"),pcb_component_not_on_board_edge_error_id:On("pcb_component_not_on_board_edge_error"),error_type:he("pcb_component_not_on_board_edge_error").default("pcb_component_not_on_board_edge_error"),pcb_component_id:k(),pcb_board_id:k(),component_center:Pr,pad_to_nearest_board_edge_distance:Ae(),source_component_id:k().optional(),subcircuit_id:k().optional()}).describe("Error emitted when a component that must be placed on the board edge is centered away from the edge");jt(!0);var Tuo=vl.extend({type:he("pcb_component_invalid_layer_error"),pcb_component_invalid_layer_error_id:On("pcb_component_invalid_layer_error"),error_type:he("pcb_component_invalid_layer_error").default("pcb_component_invalid_layer_error"),pcb_component_id:k().optional(),source_component_id:k(),layer:Na,subcircuit_id:k().optional()}).describe("Error emitted when a component is placed on an invalid layer (components can only be on 'top' or 'bottom' layers)");jt(!0);var Duo=vl.extend({type:he("pcb_via_clearance_error"),pcb_error_id:On("pcb_error"),error_type:he("pcb_via_clearance_error").default("pcb_via_clearance_error"),pcb_via_ids:it(k()).min(2),minimum_clearance:an.optional(),actual_clearance:an.optional(),pcb_center:we({x:Ae().optional(),y:Ae().optional()}).optional(),subcircuit_id:k().optional()}).describe("Error emitted when vias are closer than the allowed clearance");jt(!0);var Nuo=vl.extend({type:he("pcb_via_trace_clearance_error"),pcb_via_trace_clearance_error_id:On("pcb_via_trace_clearance_error"),error_type:he("pcb_via_trace_clearance_error").default("pcb_via_trace_clearance_error"),pcb_via_id:k(),pcb_trace_id:k(),minimum_clearance:an.optional(),actual_clearance:an.optional(),center:we({x:Ae().optional(),y:Ae().optional()}).optional(),subcircuit_id:k().optional()}).describe("Error emitted when a via and trace are closer than the allowed clearance");jt(!0);var Ruo=vl.extend({type:he("pcb_pad_pad_clearance_error"),pcb_pad_pad_clearance_error_id:On("pcb_pad_pad_clearance_error"),error_type:he("pcb_pad_pad_clearance_error").default("pcb_pad_pad_clearance_error"),pcb_pad_ids:it(k()).min(2),minimum_clearance:an.optional(),actual_clearance:an.optional(),center:we({x:Ae().optional(),y:Ae().optional()}).optional(),subcircuit_id:k().optional()}).describe("Error emitted when pads are closer than the allowed clearance");jt(!0);var Quo=vl.extend({type:he("pcb_pad_trace_clearance_error"),pcb_pad_trace_clearance_error_id:On("pcb_pad_trace_clearance_error"),error_type:he("pcb_pad_trace_clearance_error").default("pcb_pad_trace_clearance_error"),pcb_pad_id:k(),pcb_trace_id:k(),minimum_clearance:an.optional(),actual_clearance:an.optional(),center:we({x:Ae().optional(),y:Ae().optional()}).optional(),subcircuit_id:k().optional()}).describe("Error emitted when a pad and trace are closer than allowed clearance");jt(!0);var kuo=we({type:he("pcb_courtyard_rect"),pcb_courtyard_rect_id:On("pcb_courtyard_rect"),pcb_component_id:k(),pcb_group_id:k().optional(),subcircuit_id:k().optional(),center:Pr,width:er,height:er,layer:wg,ccw_rotation:Iu.optional(),color:k().optional()}).describe("Defines a courtyard rectangle on the PCB");jt(!0);var Luo=we({type:he("pcb_courtyard_outline"),pcb_courtyard_outline_id:On("pcb_courtyard_outline"),pcb_component_id:k(),pcb_group_id:k().optional(),subcircuit_id:k().optional(),layer:wg,outline:it(Pr).min(2)}).describe("Defines a courtyard outline on the PCB");jt(!0);var Huo=we({type:he("pcb_courtyard_polygon"),pcb_courtyard_polygon_id:On("pcb_courtyard_polygon"),pcb_component_id:k(),pcb_group_id:k().optional(),subcircuit_id:k().optional(),layer:wg,points:it(Pr).min(3),color:k().optional()}).describe("Defines a courtyard polygon on the PCB");jt(!0);var Fuo=we({type:he("pcb_courtyard_circle"),pcb_courtyard_circle_id:On("pcb_courtyard_circle"),pcb_component_id:k(),pcb_group_id:k().optional(),subcircuit_id:k().optional(),center:Pr,radius:er,layer:wg,color:k().optional()}).describe("Defines a courtyard circle on the PCB");jt(!0);var zuo=we({type:he("pcb_courtyard_pill"),pcb_courtyard_pill_id:On("pcb_courtyard_pill"),pcb_component_id:k(),pcb_group_id:k().optional(),subcircuit_id:k().optional(),center:Pr,width:er,height:er,radius:er,layer:wg,color:k().optional()}).describe("Defines a courtyard pill on the PCB");jt(!0);var Xns=["obj","stl","3mf","gltf","glb","step","wrl"],Ouo=["x+","x-","y+","y-","z+","z-"],jns={obj:"z+",stl:"z+","3mf":"z+",gltf:"y+",glb:"y+",step:"z+",wrl:"y+"},Vuo=we({type:he("cad_component"),cad_component_id:k(),pcb_component_id:k(),source_component_id:k(),position:pT,rotation:pT.optional(),size:pT.optional(),layer:Na.optional(),subcircuit_id:k().optional(),footprinter_string:k().optional(),model_obj_url:k().optional(),model_stl_url:k().optional(),model_3mf_url:k().optional(),model_gltf_url:k().optional(),model_glb_url:k().optional(),model_step_url:k().optional(),model_wrl_url:k().optional(),model_asset:jwe.optional(),model_unit_to_mm_scale_factor:Ae().optional(),model_board_normal_direction:Pt(Ouo).optional().describe(`The direction in the model's coordinate space that is considered "up" or "coming out of the board surface"`),model_origin_position:pT.optional(),model_origin_alignment:Pt(["unknown","center","center_of_component_on_board_surface","bottom_center_of_component"]).optional(),model_object_fit:Pt(["contain_within_bounds","fill_bounds"]).optional().default("contain_within_bounds"),model_jscad:Jh().optional(),show_as_translucent_model:Be().optional(),show_as_bounding_box:Be().optional(),show_hidden_edges:Be().optional(),anchor_alignment:Pt(["center","center_of_component_on_board_surface"]).optional().default("center")}).describe("Defines a component on the PCB");jt(!0);var dgt=Pt(["sinewave","square","triangle","sawtooth"]),Kns=un([k(),Ae()]).transform((e)=>{if(typeof e==="string"){if(e.endsWith("%"))return parseFloat(e.slice(0,-1))/100;return parseFloat(e)}return e}).pipe(Ae().min(0,"Duty cycle must be non-negative").max(1,"Duty cycle cannot be greater than 100%")),Yuo=we({type:he("simulation_voltage_source"),simulation_voltage_source_id:On("simulation_voltage_source"),is_dc_source:he(!0).optional().default(!0),positive_source_port_id:k().optional(),negative_source_port_id:k().optional(),positive_source_net_id:k().optional(),negative_source_net_id:k().optional(),voltage:cv,ac_magnitude:cv.optional(),ac_phase:Iu.optional()}).describe("Defines a DC voltage source for simulation"),Guo=we({type:he("simulation_voltage_source"),simulation_voltage_source_id:On("simulation_voltage_source"),is_dc_source:he(!1),terminal1_source_port_id:k().optional(),terminal2_source_port_id:k().optional(),terminal1_source_net_id:k().optional(),terminal2_source_net_id:k().optional(),voltage:cv.optional(),frequency:nU.optional(),peak_to_peak_voltage:cv.optional(),wave_shape:dgt.optional(),phase:Iu.optional(),duty_cycle:Kns.optional(),pulse_delay:Mg.optional(),rise_time:Mg.optional(),fall_time:Mg.optional(),pulse_width:Mg.optional(),period:Mg.optional(),ac_magnitude:cv.optional(),ac_phase:Iu.optional()}).describe("Defines an AC voltage source for simulation"),Uuo=un([Yuo,Guo]).describe("Defines a voltage source for simulation");jt(!0);jt(!0);jt(!0);var $ns=un([k(),Ae()]).transform((e)=>{if(typeof e==="string"){if(e.endsWith("%"))return parseFloat(e.slice(0,-1))/100;return parseFloat(e)}return e}).pipe(Ae().min(0,"Duty cycle must be non-negative").max(1,"Duty cycle cannot be greater than 100%")),Wuo=we({type:he("simulation_current_source"),simulation_current_source_id:On("simulation_current_source"),is_dc_source:he(!0).optional().default(!0),positive_source_port_id:k().optional(),negative_source_port_id:k().optional(),positive_source_net_id:k().optional(),negative_source_net_id:k().optional(),current:GL,ac_magnitude:GL.optional(),ac_phase:Iu.optional()}).describe("Defines a DC current source for simulation"),Xuo=we({type:he("simulation_current_source"),simulation_current_source_id:On("simulation_current_source"),is_dc_source:he(!1),terminal1_source_port_id:k().optional(),terminal2_source_port_id:k().optional(),terminal1_source_net_id:k().optional(),terminal2_source_net_id:k().optional(),current:GL.optional(),frequency:nU.optional(),peak_to_peak_current:GL.optional(),wave_shape:dgt.optional(),phase:Iu.optional(),duty_cycle:$ns.optional(),ac_magnitude:GL.optional(),ac_phase:Iu.optional()}).describe("Defines an AC current source for simulation"),juo=un([Wuo,Xuo]).describe("Defines a current source for simulation");jt(!0);jt(!0);jt(!0);var eBe=Wa((e)=>e==="V"||e==="A"),ugt=Wa((e)=>e==="Ω"||e==="F"||e==="H"||e==="V"||e==="A"),Kuo=un([he("spice_dc_sweep"),he("spice_dc_operating_point"),he("spice_transient_analysis"),he("spice_ac_analysis")]),$uo=we({method:Pt(["trap","gear"]).optional(),reltol:un([Ae(),k()]).optional(),abstol:un([Ae(),k()]).optional(),vntol:un([Ae(),k()]).optional()}).describe("SPICE solver options for a simulation experiment"),quo=we({type:he("simulation_experiment"),simulation_experiment_id:On("simulation_experiment"),name:k(),experiment_type:Kuo,time_per_step:rne.optional(),start_time_ms:Mg.optional(),end_time_ms:Mg.optional(),spice_options:$uo.optional(),dc_sweep_voltage_source_id:k().optional(),dc_sweep_current_source_id:k().optional(),dc_sweep_start:Ae().optional(),dc_sweep_stop:Ae().optional(),dc_sweep_step:Ae().refine((e)=>e!==0).optional(),dc_sweep_unit:eBe.optional(),ac_sweep_type:Pt(["linear","decade","octave"]).optional(),ac_samples_per_interval:Ae().int().positive().optional(),ac_sample_count:Ae().int().positive().optional(),ac_start_frequency_hz:Ae().positive().optional(),ac_stop_frequency_hz:Ae().positive().optional()}).superRefine((e,t)=>{if(e.experiment_type==="spice_dc_sweep"){let n=["dc_sweep_start","dc_sweep_stop","dc_sweep_step","dc_sweep_unit"];for(let i of n)if(e[i]===void 0)t.addIssue({code:Vt.custom,path:[i],message:`${i} is required for a DC sweep`});let o=e.dc_sweep_voltage_source_id!==void 0,r=e.dc_sweep_current_source_id!==void 0;if(o===r)t.addIssue({code:Vt.custom,path:["dc_sweep_voltage_source_id"],message:"Exactly one DC sweep voltage or current source ID is required"})}if(e.experiment_type==="spice_ac_analysis"){if(e.ac_sweep_type===void 0)t.addIssue({code:Vt.custom,path:["ac_sweep_type"],message:"ac_sweep_type is required for an AC analysis"});if(e.ac_start_frequency_hz===void 0)t.addIssue({code:Vt.custom,path:["ac_start_frequency_hz"],message:"ac_start_frequency_hz is required for an AC analysis"});if(e.ac_stop_frequency_hz===void 0)t.addIssue({code:Vt.custom,path:["ac_stop_frequency_hz"],message:"ac_stop_frequency_hz is required for an AC analysis"});if(e.ac_sweep_type==="linear"&&e.ac_sample_count===void 0)t.addIssue({code:Vt.custom,path:["ac_sample_count"],message:"ac_sample_count is required for a linear AC analysis"});if((e.ac_sweep_type==="decade"||e.ac_sweep_type==="octave")&&e.ac_samples_per_interval===void 0)t.addIssue({code:Vt.custom,path:["ac_samples_per_interval"],message:"ac_samples_per_interval is required for decade and octave AC analyses"})}}).describe("Defines a simulation experiment configuration");jt(!0);var _T=we({simulation_parameter_sweep_id:k(),sweep_index:Ae().int().nonnegative(),parameter_value:Ae(),parameter_unit:ugt});jt(!0);var Juo=we({type:he("simulation_transient_voltage_graph"),simulation_transient_voltage_graph_id:On("simulation_transient_voltage_graph"),simulation_experiment_id:k(),simulation_parameter_sweep_coordinate:_T.optional(),timestamps_ms:it(Ae()).optional(),voltage_levels:it(Ae()),source_component_id:k().optional(),subcircuit_connectivity_map_key:k().optional(),time_per_step:rne,start_time_ms:Mg,end_time_ms:Mg,name:k().optional(),color:k().optional()}).describe("Stores voltage measurements over time for a simulation");jt(!0);var Zuo=we({type:he("simulation_transient_current_graph"),simulation_transient_current_graph_id:On("simulation_transient_current_graph"),simulation_experiment_id:k(),simulation_parameter_sweep_coordinate:_T.optional(),timestamps_ms:it(Ae()).optional(),current_levels:it(Ae()),source_component_id:k().optional(),subcircuit_connectivity_map_key:k().optional(),time_per_step:rne,start_time_ms:Mg,end_time_ms:Mg,name:k().optional(),color:k().optional()}).describe("Stores current measurements over time for a simulation");jt(!0);var e0o=we({type:he("simulation_switch"),simulation_switch_id:On("simulation_switch"),source_component_id:k().optional(),closes_at:Mg.optional(),opens_at:Mg.optional(),starts_closed:Be().optional(),switching_frequency:nU.optional()}).describe("Defines a switch for simulation timing control");jt(!0);var t0o=we({type:he("simulation_voltage_probe"),simulation_voltage_probe_id:On("simulation_voltage_probe"),source_component_id:k().optional(),name:k().optional(),signal_input_source_port_id:k().optional(),signal_input_source_net_id:k().optional(),reference_input_source_port_id:k().optional(),reference_input_source_net_id:k().optional(),subcircuit_id:k().optional(),color:k().optional()}).describe("Defines a voltage probe for simulation. If a reference input is not provided, it measures against ground. If a reference input is provided, it measures the differential voltage between two points.").superRefine((e,t)=>{if(e.reference_input_source_port_id||e.reference_input_source_net_id){let o=!!e.signal_input_source_port_id||!!e.reference_input_source_port_id,r=!!e.signal_input_source_net_id||!!e.reference_input_source_net_id;if(o&&r)t.addIssue({code:Vt.custom,message:"Cannot mix port and net connections in a differential probe."});else if(o){if(!e.signal_input_source_port_id||!e.reference_input_source_port_id)t.addIssue({code:Vt.custom,message:"Differential port probe requires both signal_input_source_port_id and reference_input_source_port_id."})}else if(r){if(!e.signal_input_source_net_id||!e.reference_input_source_net_id)t.addIssue({code:Vt.custom,message:"Differential net probe requires both signal_input_source_net_id and reference_input_source_net_id."})}}else if(!!e.signal_input_source_port_id===!!e.signal_input_source_net_id)t.addIssue({code:Vt.custom,message:"A voltage probe must have exactly one of signal_input_source_port_id or signal_input_source_net_id."})});jt(!0);var n0o=we({type:he("simulation_current_probe"),simulation_current_probe_id:On("simulation_current_probe"),source_component_id:k().optional(),name:k().optional(),positive_source_port_id:k().optional(),negative_source_port_id:k().optional(),positive_source_net_id:k().optional(),negative_source_net_id:k().optional(),subcircuit_id:k().optional(),color:k().optional()}).describe("Defines a current probe for simulation. It measures current flowing from the positive endpoint to the negative endpoint.").superRefine((e,t)=>{let n=!!e.positive_source_port_id,o=!!e.negative_source_port_id,r=!!e.positive_source_net_id,i=!!e.negative_source_net_id,s=n||o,a=r||i;if(s&&a){t.addIssue({code:Vt.custom,message:"Cannot mix port and net connections in a current probe."});return}if(s){if(!n||!o)t.addIssue({code:Vt.custom,message:"Current probe using source ports requires both positive_source_port_id and negative_source_port_id."});return}if(a){if(!r||!i)t.addIssue({code:Vt.custom,message:"Current probe using source nets requires both positive_source_net_id and negative_source_net_id."});return}t.addIssue({code:Vt.custom,message:"A current probe must have either positive/negative source port ids or positive/negative source net ids."})});jt(!0);var o0o=vl.extend({type:he("simulation_unknown_experiment_error"),simulation_unknown_experiment_error_id:On("simulation_unknown_experiment_error"),error_type:he("simulation_unknown_experiment_error").default("simulation_unknown_experiment_error"),simulation_experiment_id:k().optional(),subcircuit_id:k().optional()}).describe("An unknown error occurred during the simulation experiment.");jt(!0);var qns=Pt(["resistance","capacitance","inductance","voltage","current"]),Vme=we({type:he("simulation_parameter_sweep"),simulation_parameter_sweep_id:On("simulation_parameter_sweep"),simulation_experiment_id:k(),name:k().optional(),parameter_values:it(Ae()).min(1),parameter_unit:ugt}),r0o=ss("parameter_type",[Vme.extend({parameter_type:he("resistance"),resistor_source_component_id:k()}),Vme.extend({parameter_type:he("capacitance"),capacitor_source_component_id:k()}),Vme.extend({parameter_type:he("inductance"),inductor_source_component_id:k()}),Vme.extend({parameter_type:he("voltage"),source_net_id:k()}),Vme.extend({parameter_type:he("current"),current_source_component_id:k()})]).describe("Repeats a simulation experiment over component parameter values");jt(!0);var i0o=we({type:he("simulation_dc_operating_point_voltage"),simulation_dc_operating_point_voltage_id:On("simulation_dc_operating_point_voltage"),simulation_experiment_id:k(),simulation_parameter_sweep_coordinate:_T.optional(),simulation_voltage_probe_id:k(),voltage:Ae(),name:k().optional(),color:k().optional()});jt(!0);var s0o=we({type:he("simulation_dc_operating_point_current"),simulation_dc_operating_point_current_id:On("simulation_dc_operating_point_current"),simulation_experiment_id:k(),simulation_parameter_sweep_coordinate:_T.optional(),simulation_current_probe_id:k(),current:Ae(),name:k().optional(),color:k().optional()});jt(!0);var a0o=we({type:he("simulation_dc_sweep_voltage_graph"),simulation_dc_sweep_voltage_graph_id:On("simulation_dc_sweep_voltage_graph"),simulation_experiment_id:k(),simulation_parameter_sweep_coordinate:_T.optional(),simulation_voltage_probe_id:k(),sweep_values:it(Ae()),sweep_unit:eBe,voltage_levels:it(Ae()),name:k().optional(),color:k().optional()}).refine((e)=>e.sweep_values.length===e.voltage_levels.length,{message:"sweep_values and voltage_levels must have the same length"});jt(!0);var c0o=we({type:he("simulation_dc_sweep_current_graph"),simulation_dc_sweep_current_graph_id:On("simulation_dc_sweep_current_graph"),simulation_experiment_id:k(),simulation_parameter_sweep_coordinate:_T.optional(),simulation_current_probe_id:k(),sweep_values:it(Ae()),sweep_unit:eBe,current_levels:it(Ae()),name:k().optional(),color:k().optional()}).refine((e)=>e.sweep_values.length===e.current_levels.length,{message:"sweep_values and current_levels must have the same length"});jt(!0);var pgt=we({re:Ae(),im:Ae()});jt(!0);var l0o=we({type:he("simulation_ac_sweep_voltage_graph"),simulation_ac_sweep_voltage_graph_id:On("simulation_ac_sweep_voltage_graph"),simulation_experiment_id:k(),simulation_parameter_sweep_coordinate:_T.optional(),simulation_voltage_probe_id:k(),frequencies_hz:it(Ae()),complex_voltages:it(pgt),name:k().optional(),color:k().optional()}).refine((e)=>e.frequencies_hz.length===e.complex_voltages.length,{message:"frequencies_hz and complex_voltages must have the same length"});jt(!0);var h0o=we({type:he("simulation_ac_sweep_current_graph"),simulation_ac_sweep_current_graph_id:On("simulation_ac_sweep_current_graph"),simulation_experiment_id:k(),simulation_parameter_sweep_coordinate:_T.optional(),simulation_current_probe_id:k(),frequencies_hz:it(Ae()),complex_currents:it(pgt),name:k().optional(),color:k().optional()}).refine((e)=>e.frequencies_hz.length===e.complex_currents.length,{message:"frequencies_hz and complex_currents must have the same length"});jt(!0);var d0o=we({type:he("simulation_op_amp"),simulation_op_amp_id:On("simulation_op_amp"),source_component_id:k().optional(),inverting_input_source_port_id:k(),non_inverting_input_source_port_id:k(),output_source_port_id:k(),positive_supply_source_port_id:k(),negative_supply_source_port_id:k()}).describe("Defines a simple ideal operational amplifier for simulation");jt(!0);var u0o=we({type:he("simulation_spice_subcircuit"),simulation_spice_subcircuit_id:On("simulation_spice_subcircuit"),source_component_id:k(),spice_pin_to_source_port_map:gs(k(),k()),subcircuit_source:k()}).describe("Defines a custom SPICE subcircuit model for simulation");jt(!0);var blo=(e)=>e!==void 0,p0o=we({type:he("simulation_oscilloscope_trace"),simulation_oscilloscope_trace_id:On("simulation_oscilloscope_trace"),simulation_transient_voltage_graph_id:k().optional(),simulation_transient_current_graph_id:k().optional(),simulation_voltage_probe_id:k().optional(),simulation_current_probe_id:k().optional(),display_name:k().optional(),color:k().optional(),display_center_value:Ae().optional(),display_center_offset_divs:Ae().optional(),volts_per_div:Ae().positive().optional(),amps_per_div:Ae().positive().optional()}).describe("Defines how a simulation measurement is rendered as an oscilloscope-style trace.").superRefine((e,t)=>{let n=[e.simulation_transient_voltage_graph_id,e.simulation_voltage_probe_id].filter(blo).length,o=[e.simulation_transient_current_graph_id,e.simulation_current_probe_id].filter(blo).length;if(n+o!==1)t.addIssue({code:Vt.custom,message:"An oscilloscope trace must reference exactly one voltage graph, current graph, voltage probe, or current probe."});if(n>0&&e.amps_per_div!==void 0)t.addIssue({code:Vt.custom,message:"Voltage oscilloscope traces must use volts_per_div, not amps_per_div."});if(o>0&&e.volts_per_div!==void 0)t.addIssue({code:Vt.custom,message:"Current oscilloscope traces must use amps_per_div, not volts_per_div."})});jt(!0);var m0o=un([tho,Zlo,eho,Jlo,oho,nho,O_t,H_t,$we,z_t,F_t,V_t,Y_t,G_t,X_t,j_t,K_t,egt,$_t,q_t,J_t,Z_t,W_t,U_t,sho,cho,rho,tgt,ngt,ogt,rgt,lho,igt,sgt,hho,dho,uho,pho,mho,_ho,agt,cgt,iho,tdo,ido,udo,uuo,puo,muo,Auo,fuo,yuo,xuo,pdo,suo,mdo,Tdo,fdo,Ido,vdo,Sdo,Pdo,Ddo,gdo,Ado,Ndo,Rdo,_uo,Hdo,Fdo,zdo,Odo,jdo,Vdo,Ydo,Gdo,Udo,Xdo,Edo,Mdo,Qdo,kdo,Ldo,wdo,Bdo,Duo,Nuo,Ruo,Quo,$do,Kdo,qdo,Jdo,Zdo,euo,tuo,nuo,ouo,guo,ruo,iuo,Cuo,duo,buo,Iuo,vuo,Muo,wuo,Buo,Tuo,kuo,Luo,Huo,Fuo,zuo,gho,who,vho,Sho,Pho,Eho,bho,Iho,Bho,Mho,Aho,Dho,Nho,Tho,Lho,Hho,Fho,zho,Oho,Vho,Yho,Gho,jho,Uho,Who,Vuo,Uuo,juo,quo,Juo,Zuo,i0o,s0o,a0o,c0o,l0o,h0o,r0o,e0o,t0o,n0o,p0o,o0o,d0o,u0o]),ine=m0o;jt(!0);oU(!0);$8();$8();var VBa=Qe(u0(),1),fT=Qe(wt(),1),fne=Qe(wt(),1),wgt=Qe(wt(),1),_Be=Qe(wt(),1),Bgt=Qe(wt(),1),$me=Qe(wt(),1),apo=Qe(wt(),1),cpo=Qe(p0(),1),hpo=Qe(wt(),1),KL=Qe(wt(),1),Tgt=Qe(wt(),1),gT=Qe(wt(),1),AT=Qe(wt(),1),upo=Qe(wt(),1),Dgt=Qe(wt(),1),ppo=Qe(wt(),1),Ngt=Qe(wt(),1),rU=Qe(wt(),1),gpo=Qe(wt(),1),Apo=Qe(wt(),1),GA=Qe(wt(),1),ypo=Qe(wt(),1),Bg=Qe(wt(),1);var xpo=Qe(wt(),1),Rgt=Qe(wt(),1),Cpo=Qe(wt(),1),bpo=Qe(wt(),1),Ipo=Qe(wt(),1),vpo=Qe(wt(),1),Spo=Qe(wt(),1),Ppo=Qe(wt(),1);var yBe=Qe(wt(),1);tc();var wpo=Qe(wt(),1),lv=Qe(wt(),1),qme=Qe(wt(),1),dne=Qe(wt(),1),Qgt=Qe(wt(),1),Zme=Qe(wt(),1),Hpo=Qe(wt(),1),tTa=Qe(u0(),1),kgt=Qe(wt(),1);PAe();var y0o=Qe(wt(),1),tos=Qe(wt(),1),nos=Qe(wt(),1),oos=Qe(wt(),1),ros=Qe(wt(),1);function _0o(e,t,n){if(!t||!n)return;let o=e.get(t);if(!o)o=new Set,e.set(t,o);o.add(n);let r=e.get(n);if(!r)r=new Set,e.set(n,r);r.add(t)}function Jns(e,t){if(!t.subcircuit_id&&!t.source_group_id)return[...e];let n=t;if(t.subcircuit_id){let a=new Set([t.subcircuit_id]),c=new Map,l=new Map;for(let d of e)if(d.type==="source_group"){let{source_group_id:u,subcircuit_id:_}=d;if(_)l.set(u,_);let p=d.parent_source_group_id;if(p){if(!c.has(p))c.set(p,[]);c.get(p).push(u)}}let h;for(let[d,u]of l)if(u===t.subcircuit_id){h=d;break}if(h){let d=(u)=>{let _=c.get(u)||[];for(let p of _){let m=l.get(p);if(m)a.add(m);d(p)}};d(h),n={...t,subcircuit_ids:Array.from(a)}}}let o=new Map;for(let a of e){let c=`${a.type}_id`,l=a[c];if(typeof l==="string")o.set(l,a)}let r=new Map;for(let a of e){let c=Object.entries(a);for(let[l,h]of c){if(l==="parent_source_group_id")continue;if(l.endsWith("_id")&&typeof h==="string"){let d=o.get(h);_0o(r,a,d)}else if(l.endsWith("_ids")&&Array.isArray(h)){for(let d of h)if(typeof d==="string"){let u=o.get(d);_0o(r,a,u)}}}}let i=[],s=new Set;for(let a of e){let c=!1;if(n.subcircuit_id&&"subcircuit_id"in a&&a.subcircuit_id===n.subcircuit_id)c=!0;else if(n.subcircuit_ids&&"subcircuit_id"in a&&a.subcircuit_id&&n.subcircuit_ids.includes(a.subcircuit_id))c=!0;else if(n.source_group_id&&"source_group_id"in a&&a.source_group_id===n.source_group_id)c=!0;else if(n.source_group_id&&"member_source_group_ids"in a&&Array.isArray(a.member_source_group_ids)&&a.member_source_group_ids.includes(n.source_group_id))c=!0;if(c)i.push(a),s.add(a)}while(i.length>0){let a=i.shift(),c=r.get(a);if(!c)continue;for(let l of c)if(!s.has(l))s.add(l),i.push(l)}return e.filter((a)=>s.has(a))}var nBe=(e,t={})=>{let n=e,o=n._internal_store;if(!o){o={counts:{},editCount:0},n._internal_store=o;for(let i of n){let s=i.type,a=i[`${s}_id`];if(!a)continue;let c=Number.parseInt(a.split("_").pop());if(!Number.isNaN(c))o.counts[s]=Math.max(o.counts[s]??0,c)}}let r=new Proxy({},{get:(i,s)=>{if(s==="toArray")return()=>(n.editCount=o.editCount,n);if(s==="editCount")return o.editCount;if(s==="subtree")return(c)=>nBe(Jns(n,c),t);if(s==="insert")return(c)=>{let l=c.type;if(!l)throw Error("insert requires an element with a type");o.counts[l]??=-1,o.counts[l]++;let h=o.counts[l],d={...c,type:l,[`${l}_id`]:`${l}_${h}`};if(t.validateInserts)(sne[l]??ine).parse(d);return n.push(d),o.editCount++,d};if(s==="insertAll")return(c)=>c.map((l)=>r.insert(l));let a=s;return{get:(c)=>n.find((l)=>l.type===a&&l[`${a}_id`]===c),getUsing:(c)=>{let l=Object.keys(c);if(l.length!==1)throw Error("getUsing requires exactly one key, e.g. { pcb_component_id }");let h=l[0],d=h.replace("_id",""),u=n.find((_)=>_.type===d&&_[h]===c[h]);if(!u)return null;return n.find((_)=>_.type===a&&_[`${a}_id`]===u[`${a}_id`])},getWhere:(c)=>{let l=Object.keys(c);return n.find((h)=>h.type===a&&l.every((d)=>h[d]===c[d]))},list:(c)=>{let l=!c?[]:Object.keys(c);return n.filter((h)=>h.type===a&&l.every((d)=>h[d]===c[d]))},insert:(c)=>{o.counts[a]??=-1,o.counts[a]++;let l=o.counts[a],h={type:a,[`${a}_id`]:`${a}_${l}`,...c};if(t.validateInserts)(sne[a]??ine).parse(h);return n.push(h),o.editCount++,h},delete:(c)=>{let l=n.find((h)=>h[`${a}_id`]===c);if(!l)return;n.splice(n.indexOf(l),1),o.editCount++},update:(c,l)=>{let h=n.find((d)=>d.type===a&&d[`${a}_id`]===c);if(!h)return null;return Object.assign(h,l),o.editCount++,h},select:(c)=>{if(a==="source_component")return n.find((l)=>l.type==="source_component"&&l.name===c.replace(/\./g,""));else if(a==="pcb_port"||a==="source_port"||a==="schematic_port"){let[l,h]=c.replace(/\./g,"").split(/[\s\>]+/),d=n.find((_)=>_.type==="source_component"&&_.name===l);if(!d)return null;let u=n.find((_)=>_.type==="source_port"&&_.source_component_id===d.source_component_id&&(_.name===h||(_.port_hints??[]).includes(h)));if(!u)return null;if(a==="source_port")return u;if(a==="pcb_port")return n.find((_)=>_.type==="pcb_port"&&_.source_port_id===u.source_port_id);else if(a==="schematic_port")return n.find((_)=>_.type==="schematic_port"&&_.source_port_id===u.source_port_id)}}}}});return r};nBe.unparsed=nBe;var w_=nBe;function mgt(e){let t=e.type;return`${t}:${e[`${t}_id`]}`}var g0o=(e,t={})=>{let n=e._internal_store_indexed;if(!n){n={counts:{},editCount:0,indexes:{}};for(let s of e){let a=s.type,c=s[`${a}_id`];if(!c)continue;let l=Number.parseInt(c.split("_").pop()||"");if(!Number.isNaN(l))n.counts[a]=Math.max(n.counts[a]??0,l)}let r=t.indexConfig||{},i=n.indexes;if(r.byId)i.byId=new Map;if(r.byType)i.byType=new Map;if(r.byRelation)i.byRelation=new Map;if(r.bySubcircuit)i.bySubcircuit=new Map;if(r.byCustomField&&r.byCustomField.length>0){i.byCustomField=new Map;for(let s of r.byCustomField)i.byCustomField.set(s,new Map)}for(let s of e){if(r.byId){let a=mgt(s);i.byId.set(a,s)}if(r.byType){let a=i.byType.get(s.type)||[];a.push(s),i.byType.set(s.type,a)}if(r.byRelation){let a=Object.entries(s);for(let[c,l]of a)if(c.endsWith("_id")&&c!==`${s.type}_id`&&typeof l==="string"){let h=i.byRelation.get(c)||new Map,d=h.get(l)||[];d.push(s),h.set(l,d),i.byRelation.set(c,h)}}if(r.bySubcircuit&&"subcircuit_id"in s){let a=s.subcircuit_id;if(a&&typeof a==="string"){let c=i.bySubcircuit.get(a)||[];c.push(s),i.bySubcircuit.set(a,c)}}if(r.byCustomField&&i.byCustomField){for(let a of r.byCustomField)if(a in s){let c=s[a];if(c!==void 0&&(typeof c==="string"||typeof c==="number")){let l=String(c),h=i.byCustomField.get(a),d=h.get(l)||[];d.push(s),h.set(l,d)}}}}e._internal_store_indexed=n}return new Proxy({},{get:(r,i)=>{if(i==="toArray")return()=>(e.editCount=n.editCount,e);if(i==="editCount")return n.editCount;let s=i;return{get:(a)=>{let c=t.indexConfig||{};if(c.byId&&n.indexes.byId)return n.indexes.byId.get(`${s}:${a}`)||null;if(c.byType&&n.indexes.byType)return(n.indexes.byType.get(s)||[]).find((h)=>h[`${s}_id`]===a)||null;return e.find((l)=>l.type===s&&l[`${s}_id`]===a)||null},getUsing:(a)=>{let c=t.indexConfig||{},l=Object.keys(a);if(l.length!==1)throw Error("getUsing requires exactly one key, e.g. { pcb_component_id }");let h=l[0],d=h.replace("_id","");if(c.byRelation&&n.indexes.byRelation){let _=n.indexes.byRelation.get(h);if(_){let m=(_.get(a[h])||[]).find((g)=>g.type===d);if(!m)return null;let A=m[`${s}_id`];if(c.byId&&n.indexes.byId)return n.indexes.byId.get(`${s}:${A}`)||null;if(c.byType&&n.indexes.byType)return(n.indexes.byType.get(s)||[]).find((f)=>f[`${s}_id`]===A)||null;return e.find((g)=>g.type===s&&g[`${s}_id`]===A)||null}}let u=e.find((_)=>_.type===d&&_[h]===a[h]);if(!u)return null;return e.find((_)=>_.type===s&&_[`${s}_id`]===u[`${s}_id`])||null},getWhere:(a)=>{let c=t.indexConfig||{},l=Object.keys(a);if(l.length===1&&c.byCustomField&&n.indexes.byCustomField){let h=l[0],d=n.indexes.byCustomField.get(h);if(d){let u=String(a[h]);return(d.get(u)||[]).find((p)=>p.type===s)||null}}if("subcircuit_id"in a&&c.bySubcircuit&&n.indexes.bySubcircuit){let h=a.subcircuit_id;return(n.indexes.bySubcircuit.get(h)||[]).find((u)=>u.type===s&&l.every((_)=>u[_]===a[_]))||null}if(c.byType&&n.indexes.byType)return(n.indexes.byType.get(s)||[]).find((d)=>l.every((u)=>d[u]===a[u]))||null;return e.find((h)=>h.type===s&&l.every((d)=>h[d]===a[d]))||null},list:(a)=>{let c=t.indexConfig||{},l=!a?[]:Object.keys(a);if(l.length===0&&c.byType&&n.indexes.byType)return n.indexes.byType.get(s)||[];if(l.length===1&&l[0]==="subcircuit_id"&&c.bySubcircuit&&n.indexes.bySubcircuit){let d=a.subcircuit_id;return(n.indexes.bySubcircuit.get(d)||[]).filter((_)=>_.type===s)}let h;if(c.byType&&n.indexes.byType)h=n.indexes.byType.get(s)||[];else h=e.filter((d)=>d.type===s);if(l.length>0)return h.filter((d)=>l.every((u)=>d[u]===a[u]));return h},insert:(a)=>{n.counts[s]??=-1,n.counts[s]++;let c=n.counts[s],l={type:s,[`${s}_id`]:`${s}_${c}`,...a};if(t.validateInserts)(sne[s]??ine).parse(l);e.push(l),n.editCount++;let h=t.indexConfig||{};if(h.byId&&n.indexes.byId){let d=mgt(l);n.indexes.byId.set(d,l)}if(h.byType&&n.indexes.byType){let d=n.indexes.byType.get(s)||[];d.push(l),n.indexes.byType.set(s,d)}if(h.byRelation&&n.indexes.byRelation){let d=Object.entries(l);for(let[u,_]of d)if(u.endsWith("_id")&&u!==`${l.type}_id`&&typeof _==="string"){let p=n.indexes.byRelation.get(u)||new Map,m=p.get(_)||[];m.push(l),p.set(_,m),n.indexes.byRelation.set(u,p)}}if(h.bySubcircuit&&n.indexes.bySubcircuit&&"subcircuit_id"in l){let d=l.subcircuit_id;if(d&&typeof d==="string"){let u=n.indexes.bySubcircuit.get(d)||[];u.push(l),n.indexes.bySubcircuit.set(d,u)}}if(h.byCustomField&&n.indexes.byCustomField){for(let d of h.byCustomField)if(d in l){let u=l[d];if(u!==void 0&&(typeof u==="string"||typeof u==="number")){let _=String(u),p=n.indexes.byCustomField.get(d),m=p.get(_)||[];m.push(l),p.set(_,m)}}}return l},delete:(a)=>{let c=t.indexConfig||{},l;if(c.byId&&n.indexes.byId)l=n.indexes.byId.get(`${s}:${a}`);else if(c.byType&&n.indexes.byType)l=(n.indexes.byType.get(s)||[]).find((u)=>u[`${s}_id`]===a);else l=e.find((d)=>d[`${s}_id`]===a);if(!l)return;let h=e.indexOf(l);if(h>=0)e.splice(h,1),n.editCount++;if(c.byId&&n.indexes.byId){let d=mgt(l);n.indexes.byId.delete(d)}if(c.byType&&n.indexes.byType){let u=(n.indexes.byType.get(s)||[]).filter((_)=>_[`${s}_id`]!==a);n.indexes.byType.set(s,u)}if(c.byRelation&&n.indexes.byRelation)for(let[d,u]of n.indexes.byRelation.entries())for(let[_,p]of u.entries()){let m=p.filter((A)=>A!==l);if(m.length===0)u.delete(_);else u.set(_,m)}if(c.bySubcircuit&&n.indexes.bySubcircuit&&"subcircuit_id"in l){let d=l.subcircuit_id;if(d){let _=(n.indexes.bySubcircuit.get(d)||[]).filter((p)=>p!==l);if(_.length===0)n.indexes.bySubcircuit.delete(d);else n.indexes.bySubcircuit.set(d,_)}}if(c.byCustomField&&n.indexes.byCustomField)for(let d of n.indexes.byCustomField.values())for(let[u,_]of d.entries()){let p=_.filter((m)=>m!==l);if(p.length===0)d.delete(u);else d.set(u,p)}},update:(a,c)=>{let l=t.indexConfig||{},h;if(l.byId&&n.indexes.byId)h=n.indexes.byId.get(`${s}:${a}`);else if(l.byType&&n.indexes.byType)h=(n.indexes.byType.get(s)||[]).find((u)=>u[`${s}_id`]===a);else h=e.find((d)=>d.type===s&&d[`${s}_id`]===a);if(!h)return null;if(l.byRelation&&n.indexes.byRelation){let d=Object.entries(h);for(let[u,_]of d)if(u.endsWith("_id")&&u!==`${h.type}_id`&&typeof _==="string"){if(u in c&&c[u]!==_){let p=n.indexes.byRelation.get(u);if(p){let A=(p.get(_)||[]).filter((g)=>g!==h);if(A.length===0)p.delete(_);else p.set(_,A)}}}}if(l.bySubcircuit&&n.indexes.bySubcircuit&&"subcircuit_id"in h&&"subcircuit_id"in c){let d=h.subcircuit_id,u=c.subcircuit_id;if(d!==u){let p=(n.indexes.bySubcircuit.get(d)||[]).filter((m)=>m!==h);if(p.length===0)n.indexes.bySubcircuit.delete(d);else n.indexes.bySubcircuit.set(d,p)}}if(l.byCustomField&&n.indexes.byCustomField){for(let d of l.byCustomField)if(d in h&&d in c&&h[d]!==c[d]){let u=n.indexes.byCustomField.get(d);if(u){let _=String(h[d]),m=(u.get(_)||[]).filter((A)=>A!==h);if(m.length===0)u.delete(_);else u.set(_,m)}}}if(Object.assign(h,c),n.editCount++,l.byRelation&&n.indexes.byRelation){let d=Object.entries(h);for(let[u,_]of d)if(u.endsWith("_id")&&u!==`${h.type}_id`&&typeof _==="string"){if(u in c){let p=n.indexes.byRelation.get(u)||new Map,m=p.get(_)||[];if(!m.includes(h))m.push(h),p.set(_,m),n.indexes.byRelation.set(u,p)}}}if(l.bySubcircuit&&n.indexes.bySubcircuit&&"subcircuit_id"in h&&"subcircuit_id"in c){let d=h.subcircuit_id;if(d&&typeof d==="string"){let u=n.indexes.bySubcircuit.get(d)||[];if(!u.includes(h))u.push(h),n.indexes.bySubcircuit.set(d,u)}}if(l.byCustomField&&n.indexes.byCustomField){for(let d of l.byCustomField)if(d in h&&d in c){let u=h[d];if(u!==void 0&&(typeof u==="string"||typeof u==="number")){let _=String(u),p=n.indexes.byCustomField.get(d),m=p.get(_)||[];if(!m.includes(h))m.push(h),p.set(_,m)}}}return h},select:(a)=>{if(s==="source_component")return e.find((c)=>c.type==="source_component"&&c.name===a.replace(/\./g,""))||null;else if(s==="pcb_port"||s==="source_port"||s==="schematic_port"){let[c,l]=a.replace(/\./g,"").split(/[\s\>]+/),h=e.find((u)=>u.type==="source_component"&&u.name===c);if(!h)return null;let d=e.find((u)=>u.type==="source_port"&&u.source_component_id===h.source_component_id&&(u.name===l||(u.port_hints??[]).includes(l)));if(!d)return null;if(s==="source_port")return d;if(s==="pcb_port")return e.find((u)=>u.type==="pcb_port"&&u.source_port_id===d.source_port_id)||null;else if(s==="schematic_port")return e.find((u)=>u.type==="schematic_port"&&u.source_port_id===d.source_port_id)||null}return null}}}})};g0o.unparsed=g0o;var A0o=(e,t)=>({minX:Math.min(e.minX,t.minX),minY:Math.min(e.minY,t.minY),maxX:Math.max(e.maxX,t.maxX),maxY:Math.max(e.maxY,t.maxY)}),Ume=(e,t,n)=>{let o=n/2;return{minX:e-o,minY:t-o,maxX:e+o,maxY:t+o}},f0o=(e,t,n,o,r)=>{let i=n/2,s=o/2,a=r*Math.PI/180,c=Math.cos(a),l=Math.sin(a),h=[{x:-i,y:-s},{x:i,y:-s},{x:i,y:s},{x:-i,y:s}].map((d)=>({x:e+d.x*c-d.y*l,y:t+d.x*l+d.y*c}));return{minX:Math.min(...h.map((d)=>d.x)),minY:Math.min(...h.map((d)=>d.y)),maxX:Math.max(...h.map((d)=>d.x)),maxY:Math.max(...h.map((d)=>d.y))}},Zns=(e,t,n,o,r)=>{let i=n/2,s=o/2,a=r*Math.PI/180,c=Math.cos(a),l=Math.sin(a),h=Math.hypot(i*c,s*l),d=Math.hypot(i*l,s*c);return{minX:e-h,minY:t-d,maxX:e+h,maxY:t+d}},eos=(e,t,n,o,r)=>{let i=Math.min(n,o)/2,s=Math.max(n,o)/2-i,a=r*Math.PI/180,c=n>=o?{x:s,y:0}:{x:0,y:s},l={x:c.x*Math.cos(a)-c.y*Math.sin(a),y:c.x*Math.sin(a)+c.y*Math.cos(a)},h=Math.abs(l.x)+i,d=Math.abs(l.y)+i;return{minX:e-h,minY:t-d,maxX:e+h,maxY:t+d}},tBe=(e)=>{if(e.length===0)return null;return{minX:Math.min(...e.map((t)=>t.x)),minY:Math.min(...e.map((t)=>t.y)),maxX:Math.max(...e.map((t)=>t.x)),maxY:Math.max(...e.map((t)=>t.y))}},_gt=(e)=>{if(!Array.isArray(e))return[];return e.flatMap((t)=>{if(!t||typeof t!=="object")return[];if("x"in t&&"y"in t&&typeof t.x==="number"&&typeof t.y==="number")return[{x:t.x,y:t.y}];if("start"in t&&"end"in t)return[t.start,t.end].filter((o)=>Boolean(o&&typeof o==="object"&&"x"in o&&"y"in o&&typeof o.x==="number"&&typeof o.y==="number"));return[]})},ggt=(e)=>{if(!e.type.startsWith("pcb_"))return null;if(e.type==="pcb_smtpad"&&e.shape==="polygon"&&Array.isArray(e.points))return tBe(e.points);if(e.type==="pcb_hole"&&e.hole_shape==="circle")return Ume(e.x,e.y,e.hole_diameter);if(e.type==="pcb_plated_hole"){let d;if("outer_diameter"in e&&typeof e.outer_diameter==="number")d=Ume(e.x,e.y,e.outer_diameter);else if("hole_diameter"in e&&typeof e.hole_diameter==="number")d=Ume(e.x,e.y,e.hole_diameter);if((e.shape==="oval"||e.shape==="pill")&&typeof e.outer_width==="number"&&typeof e.outer_height==="number")d=(e.shape==="pill"?eos:Zns)(e.x,e.y,e.outer_width,e.outer_height,e.ccw_rotation??0);if("rect_pad_width"in e&&typeof e.rect_pad_width==="number"&&"rect_pad_height"in e&&typeof e.rect_pad_height==="number"){let u=f0o(e.x,e.y,e.rect_pad_width,e.rect_pad_height,"rect_ccw_rotation"in e?e.rect_ccw_rotation??0:0);d=d?A0o(d,u):u}if("hole_diameter"in e&&typeof e.hole_diameter==="number"){let u=Ume(e.x+("hole_offset_x"in e?e.hole_offset_x??0:0),e.y+("hole_offset_y"in e?e.hole_offset_y??0:0),e.hole_diameter);d=d?A0o(d,u):u}if(d)return d}let t=e,n=tBe(_gt(t.route));if(n)return n;let o=tBe(_gt(t.outline));if(o)return o;let r=tBe(_gt(t.points));if(r)return r;let i,s,a,c;if("x"in e&&"y"in e)i=Number(e.x),s=Number(e.y);if("outer_diameter"in e)a=Number(e.outer_diameter),c=Number(e.outer_diameter);if("width"in e)a=Number(e.width);if("height"in e)c=Number(e.height);if("center"in e&&e.center&&typeof e.center==="object"&&"x"in e.center&&"y"in e.center)i=Number(e.center.x),s=Number(e.center.y);let l=0;if("rotation"in e&&typeof e.rotation==="number")l=e.rotation;if("ccw_rotation"in e&&typeof e.ccw_rotation==="number")l=e.ccw_rotation;if(i!==void 0&&s!==void 0){if(a!==void 0&&c!==void 0)return l?f0o(i,s,a,c,l):{minX:i-a/2,minY:s-c/2,maxX:i+a/2,maxY:s+c/2};if("radius"in e&&typeof e.radius==="number")return Ume(i,s,e.radius*2);return{minX:i,minY:s,maxX:i,maxY:s}}let h=[t.anchor_position,t.position].filter((d)=>Boolean(d&&typeof d==="object"&&"x"in d&&"y"in d&&typeof d.x==="number"&&typeof d.y==="number")).at(0);return h?{minX:h.x,minY:h.y,maxX:h.x,maxY:h.y}:null};var x0o=(e,t)=>e.filter((n)=>{let o=ggt(n);if(!o)return!1;return o.minX<=t.maxX&&o.maxX>=t.minX&&o.minY<=t.maxY&&o.maxY>=t.minY});var ios={leftside_top:{side:"leftside",alignment:"top"},leftside_bottom:{side:"leftside",alignment:"bottom"},rightside_top:{side:"rightside",alignment:"top"},rightside_bottom:{side:"rightside",alignment:"bottom"},topside_left:{side:"topside",alignment:"left"},topside_right:{side:"topside",alignment:"right"},bottomside_left:{side:"bottomside",alignment:"left"},bottomside_right:{side:"bottomside",alignment:"right"}},HBa=Object.keys(ios);tc();var s6=Qe(wt(),1),Fpo=Qe(wt(),1),yT=Qe(wt(),1),Opo=Qe(wt(),1),iTa=Qe(u0(),1),Vpo=Qe(wt(),1),gBe=Qe(wt(),1);var Wpo=Qe(wt(),1),Xpo=Qe(wt(),1),une=Qe(wt(),1),cTa=Qe(u0(),1);var IBe=Qe(wt(),1),zis=Qe(wt(),1),Ois=Qe(wt(),1),hTa=Qe(wt(),1),Yis=Qe(wt(),1),Gis=Qe(wt(),1),Uis=Qe(wt(),1),dTa=Qe(u0(),1),Wgt=Qe(wt(),1),Wis=Qe(wt(),1);kre();var Xis=Qe(wt(),1),jis=Qe(wt(),1),Kis=Qe(wt(),1),$is=Qe(wt(),1),qis=Qe(wt(),1),Jis=Qe(wt(),1);m0();m0();m0();var aU=Qe(wt(),1),$po=Qe(wt(),1),pne=Qe(wt(),1),gTa=Qe(wt(),1),Ine=Qe(wt(),1),omo=Qe(wt(),1),a6=Qe(wt(),1),w0=Qe(wt(),1),amo=Qe(wt(),1);var cmo=Qe(wt(),1),Hgt=Qe(wt(),1),Fgt=Qe(wt(),1),hmo=Qe(wt(),1),dmo=Qe(wt(),1),zgt=Qe(wt(),1),pmo=Qe(wt(),1);m0();var vTa=Qe(u0(),1),Ogt=Qe(wt(),1);m0();var ETa=Qe(u0(),1),Kf=Qe(wt(),1),MTa=Qe(wt(),1);var ABe=Qe(wt(),1);var gmo=Qe(wt(),1),Amo=Qe(wt(),1),Vgt=Qe(wt(),1),Cmo=Qe(wt(),1),Imo=Qe(wt(),1),mne=Qe(wt(),1),i_e=Qe(wt(),1),UL=Qe(wt(),1),_ne=Qe(wt(),1),Pmo=Qe(wt(),1),iU=Qe(wt(),1),ras=Qe(u0(),1),wmo=Qe(wt(),1),ias=Qe(u0(),1);var DTa=Qe(u0(),1),vBe=Qe(wt(),1),sos=new Set(["pcb_trace","pcb_smtpad","pcb_via","pcb_plated_hole","pcb_copper_pour","pcb_copper_text"]),Wme=(e,t)=>({name:"g",type:"element",value:"",attributes:e,children:t});function mBe(e,t){return e.flatMap((n)=>{if(n.children.length){let r=mBe(n.children,t);return r.length?[{...n,children:r}]:[]}return n.attributes["data-pcb-layer"]==="drill"===t?[n]:[]})}function rpo(e){let t={...e.attributes};for(let n of["opacity","fill-opacity","stroke-opacity"])if(n in t)t[n]="1";return{...e,attributes:t,children:e.children.map(rpo)}}function Egt(e){return{...e,attributes:{...e.attributes,...e.attributes.fill&&e.attributes.fill!=="none"?{fill:"black"}:{},...e.attributes.stroke&&e.attributes.stroke!=="none"?{stroke:"black"}:{}},children:e.children.map(Egt)}}function aos({circuitJson:e,ctx:t,selectedIds:n,hiddenOpacity:o,width:r,height:i,create:s}){let a=new Set(n),c=(f)=>f[`${f.type}_id`],l=new Set(["top","bottom"]);for(let f of e){if(f.type==="pcb_board")for(let y=1;y<=(f.num_layers??2)-2;y++)l.add(`inner${y}`);if("layer"in f&&typeof f.layer==="string"&&/^(top|bottom|inner\d+)$/.test(f.layer))l.add(f.layer);if("layers"in f&&Array.isArray(f.layers)){for(let y of f.layers)if(/^(top|bottom|inner\d+)$/.test(y))l.add(y)}if(f.type==="pcb_trace"){for(let y of f.route)if(y.route_type==="wire")l.add(y.layer)}}let h=t.layer??"top",d=(f)=>f===h?100:f==="bottom"?0:f==="top"?50:40-Number(f.slice(5)),u=[...l].sort((f,y)=>d(f)-d(y)),_={...t,showSolderMask:!1,showSolderPaste:!1,showPinNumbers:!1,showAnchorOffsets:!1,circuitJson:e.filter((f)=>f.type!=="pcb_copper_pour")},p=[],m=[],A=[],g=[];for(let f of u){let y={..._,layer:f,colorMap:{...t.colorMap,copper:{...t.colorMap.copper,top:t.colorMap.copper[f]}}},x=[],C=[],b=[];for(let P of e){if(P.type==="pcb_hole"||P.type==="pcb_cutout"){b.push(...s(P,y).map(Egt));continue}if(!sos.has(P.type))continue;if("layer"in P&&P.layer!==f)continue;if((P.type==="pcb_via"||P.type==="pcb_plated_hole")&&!P.layers.includes(f))continue;let M=P.type==="pcb_plated_hole"?{...P,layers:[f]}:P,B=M.type==="pcb_trace"?{...M,route:M.route.map((D)=>{let{is_inside_copper_pour:L,copper_pour_id:H,...V}=D;return V})}:M,T=s(B,y).map(rpo),N=mBe(T,!0);if(b.push(...N.map(Egt)),x.push(...mBe(T,!1)),a.has(c(P))){if(C.push(...mBe(T,!1)),f===u.filter((D)=>!("layers"in P)||!Array.isArray(P.layers)||P.layers.includes(D)).at(-1))A.push(...N)}}let I=`xray-holes-${f}`;g.push({name:"mask",type:"element",value:"",attributes:{id:I,maskUnits:"userSpaceOnUse",x:"0",y:"0",width:String(r),height:String(i)},children:[{name:"rect",type:"element",value:"",children:[],attributes:{x:"0",y:"0",width:String(r),height:String(i),fill:"white"}},...b]});let v={"data-pcb-layer":f,mask:`url(#${I})`};p.push(Wme({...v,opacity:String(o)},x)),m.push(Wme(v,C))}return[{name:"defs",type:"element",value:"",attributes:{},children:g},Wme({"data-x-ray":"background"},p),Wme({"data-x-ray":"selected"},m),Wme({"data-x-ray":"drills"},A)]}var s_e="TscircuitAlphabet",C0o="data-tscircuit-alphabet-font";function spo(e){let t=(o)=>({...o,children:(o.children??[]).filter((r)=>!(C0o in(r.attributes??{}))).map(t)}),n=t(e);return n.children.push({name:"style",type:"element",value:"",attributes:{[C0o]:"",type:"text/css"},children:[{name:"",type:"text",value:`@font-face { font-family: '${s_e}'; src: url('data:font/ttf;base64,${IAe}') format('truetype'); font-weight: normal; font-style: normal; }`,attributes:{},children:[]}]}),ipo.stringify(n)}function cos(e,t,n){let{transform:o,shouldDrawErrors:r}=n;if(!r)return[];let{pcb_port_ids:i}=e,s=t.find((u)=>u.type==="pcb_port"&&u.pcb_port_id===i?.[0]),a=t.find((u)=>u.type==="pcb_port"&&u.pcb_port_id===i?.[1]);if(!s||!a){let _=e.message?.match(/pcb_via\[#?(pcb_via_\d+)\]/)?.[1],p=t.find((m)=>m.type==="pcb_via"&&m.pcb_via_id===_);if(p&&p.type==="pcb_via")return los(e,p,n);if(e.center){let m=fne.applyToPoint(o,{x:e.center.x,y:e.center.y});return Mgt([{name:"rect",type:"element",attributes:{x:(m.x-5).toString(),y:(m.y-5).toString(),width:"10",height:"10",fill:"red",transform:`rotate(45 ${m.x} ${m.y})`},children:[],value:""},{name:"text",type:"element",attributes:{x:m.x.toString(),y:(m.y-15).toString(),fill:"red","font-family":"sans-serif","font-size":"12","text-anchor":"middle"},children:[{type:"text",value:e.message||"Pcb Trace Error",name:"",attributes:{},children:[]}],value:""}])}else return[]}let c=fne.applyToPoint(o,{x:s.x,y:s.y}),l=fne.applyToPoint(o,{x:a.x,y:a.y}),h={x:(c.x+l.x)/2,y:(c.y+l.y)/2};if(isNaN(c.x)||isNaN(c.y)||isNaN(l.x)||isNaN(l.y)||isNaN(h.x)||isNaN(h.y))return[];let d=[{name:"line",type:"element",attributes:{x1:c.x.toString(),y1:c.y.toString(),x2:h.x.toString(),y2:h.y.toString(),stroke:"red","stroke-width":"1.5","stroke-dasharray":"2,2"},children:[],value:""},{name:"line",type:"element",attributes:{x1:h.x.toString(),y1:h.y.toString(),x2:l.x.toString(),y2:l.y.toString(),stroke:"red","stroke-width":"1.5","stroke-dasharray":"2,2"},children:[],value:""},{name:"rect",type:"element",attributes:{x:(h.x-5).toString(),y:(h.y-5).toString(),width:"10",height:"10",fill:"red",transform:`rotate(45 ${h.x} ${h.y})`},children:[],value:""},{name:"text",type:"element",attributes:{x:h.x.toString(),y:(h.y-15).toString(),fill:"red","font-family":"sans-serif","font-size":"12","text-anchor":"middle"},children:[{type:"text",value:e.message||"Pcb Trace Error",name:"",attributes:{},children:[]}],value:""}];return Mgt(d)}function los(e,t,n){let{transform:o}=n;if(e.center&&t){let r=fne.applyToPoint(o,{x:e.center.x,y:e.center.y}),i=fne.applyToPoint(o,{x:t.x,y:t.y}),s=i.x-r.x,a=i.y-r.y,c=Math.sqrt(s*s+a*a),l=Math.atan2(a,s)*180/Math.PI,h=10,d=c+20,u=20,_=(r.x+i.x)/2,p=(r.y+i.y)/2;return Mgt([{name:"rect",type:"element",attributes:{x:(_-d/2).toString(),y:(p-10).toString(),width:d.toString(),height:20 .toString(),fill:"none",stroke:"red","stroke-width":"1","stroke-dasharray":"3,2",transform:`rotate(${l} ${_} ${p})`},children:[],value:""},{name:"rect",type:"element",attributes:{x:(_-5).toString(),y:(p-5).toString(),width:"10",height:"10",fill:"red",transform:`rotate(45 ${_} ${p})`},children:[],value:""},{name:"text",type:"element",attributes:{x:_.toString(),y:(p-10-5).toString(),fill:"red","font-family":"sans-serif","font-size":"12","text-anchor":"middle"},children:[{type:"text",value:e.message||"Pcb Trace Error",name:"",attributes:{},children:[]}],value:""}])}return[]}function Mgt(e){return e.map((t)=>({...t,attributes:{...t.attributes??{},"data-type":t.attributes?.["data-type"]??"pcb_trace_error","data-pcb-layer":t.attributes?.["data-pcb-layer"]??"overlay"},children:(t.children??[]).map((n)=>{if(n?.type==="element")return{...n,attributes:{...n.attributes??{},"data-type":n.attributes?.["data-type"]??"pcb_trace_error","data-pcb-layer":n.attributes?.["data-pcb-layer"]??"overlay"}};return n})}))}function hos(e){return e.map((t)=>({...t,attributes:{...t.attributes??{},"data-type":t.attributes?.["data-type"]??"pcb_footprint_overlap_error","data-pcb-layer":t.attributes?.["data-pcb-layer"]??"overlay"},children:(t.children??[]).map((n)=>{if(n?.type==="element")return{...n,attributes:{...n.attributes??{},"data-type":n.attributes?.["data-type"]??"pcb_footprint_overlap_error","data-pcb-layer":n.attributes?.["data-pcb-layer"]??"overlay"}};return n})}))}function dos(e,t,n){let{transform:o,shouldDrawErrors:r}=n;if(!r)return[];let i=[],s=[],a=[];if(e.pcb_smtpad_ids)for(let h of e.pcb_smtpad_ids){let d=t.find((u)=>u.type==="pcb_smtpad"&&u.pcb_smtpad_id===h);if(d){if(s.push({x:d.x,y:d.y,type:"pcb_smtpad",id:h,pcb_port_id:d.pcb_port_id}),d.pcb_port_id)a.push(d.pcb_port_id)}}let c=a.length>1&&a.every((h)=>h===a[0]),l=s;if(c)l=s.filter((h)=>h.type!=="pcb_smtpad");if(e.pcb_plated_hole_ids)for(let h of e.pcb_plated_hole_ids){let d=t.find((u)=>u.type==="pcb_plated_hole"&&u.pcb_plated_hole_id===h);if(d)l.push({x:d.x,y:d.y,type:"pcb_plated_hole",id:h})}if(e.pcb_hole_ids)for(let h of e.pcb_hole_ids){let d=t.find((u)=>u.type==="pcb_hole"&&u.pcb_hole_id===h);if(d)l.push({x:d.x,y:d.y,type:"pcb_hole",id:h})}if(l.length>0){let h=l.reduce((_,p)=>_+p.x,0)/l.length,d=l.reduce((_,p)=>_+p.y,0)/l.length,u=wgt.applyToPoint(o,{x:h,y:d});i.push({name:"rect",type:"element",attributes:{x:(u.x-5).toString(),y:(u.y-5).toString(),width:"10",height:"10",fill:"red",transform:`rotate(45 ${u.x} ${u.y})`},children:[],value:""}),i.push({name:"text",type:"element",attributes:{x:u.x.toString(),y:(u.y-15).toString(),fill:"red","font-family":"sans-serif","font-size":"12","text-anchor":"middle"},children:[{type:"text",value:e.message||"PCB Footprint Overlap Error",name:"",attributes:{},children:[]}],value:""});for(let _ of l){let p=wgt.applyToPoint(o,{x:_.x,y:_.y});if(i.push({name:"rect",type:"element",attributes:{x:(p.x-5).toString(),y:(p.y-5).toString(),width:"10",height:"10",fill:"red",transform:`rotate(45 ${p.x} ${p.y})`},children:[],value:""}),l.length>1)i.push({name:"line",type:"element",attributes:{x1:u.x.toString(),y1:u.y.toString(),x2:p.x.toString(),y2:p.y.toString(),stroke:"red","stroke-width":"1.5","stroke-dasharray":"2,2"},children:[],value:""})}}return hos(i)}function uos(e,t,n){let{transform:o,shouldDrawErrors:r}=n;if(!r)return[];let i=[],s=[];for(let h of e.pcb_component_ids){let d=t.find((u)=>u.type==="pcb_component"&&u.pcb_component_id===h);if(d)s.push(d.center)}if(s.length===0)return[];let a=s.reduce((h,d)=>h+d.x,0)/s.length,c=s.reduce((h,d)=>h+d.y,0)/s.length,l=_Be.applyToPoint(o,{x:a,y:c});i.push({name:"rect",type:"element",attributes:{x:(l.x-5).toString(),y:(l.y-5).toString(),width:"10",height:"10",fill:"red",transform:`rotate(45 ${l.x} ${l.y})`,"data-type":"pcb_courtyard_overlap_error","data-pcb-layer":"overlay"},children:[],value:""}),i.push({name:"text",type:"element",attributes:{x:l.x.toString(),y:(l.y-15).toString(),fill:"red","font-family":"sans-serif","font-size":"12","text-anchor":"middle","data-type":"pcb_courtyard_overlap_error","data-pcb-layer":"overlay"},children:[{type:"text",value:e.message||"PCB Courtyard Overlap",name:"",attributes:{},children:[]}],value:""});for(let h of s){let d=_Be.applyToPoint(o,h);i.push({name:"rect",type:"element",attributes:{x:(d.x-5).toString(),y:(d.y-5).toString(),width:"10",height:"10",fill:"red",transform:`rotate(45 ${d.x} ${d.y})`,"data-type":"pcb_courtyard_overlap_error","data-pcb-layer":"overlay"},children:[],value:""})}if(s.length===2){let h=s.map((_)=>_Be.applyToPoint(o,_)),d=h[0],u=h[1];i.push({name:"line",type:"element",attributes:{x1:d.x.toString(),y1:d.y.toString(),x2:u.x.toString(),y2:u.y.toString(),stroke:"red","stroke-width":"1.5","stroke-dasharray":"4,3","data-type":"pcb_courtyard_overlap_error","data-pcb-layer":"overlay"},children:[],value:""})}return i}function pos(e){return e.map((t)=>({...t,attributes:{...t.attributes??{},"data-type":t.attributes?.["data-type"]??"pcb_component_outside_board_error","data-pcb-layer":t.attributes?.["data-pcb-layer"]??"overlay"}}))}function mos(e,t){let n=e.pcb_component_id;if(!n)return e.component_bounds??null;let o=t.find((r)=>r.type==="pcb_component"&&r.pcb_component_id===n);if(o?.center&&o?.width&&o?.height)return{min_x:o.center.x-o.width/2,max_x:o.center.x+o.width/2,min_y:o.center.y-o.height/2,max_y:o.center.y+o.height/2};return e.component_bounds??null}function _os(e,t,n){let{shouldDrawErrors:o,transform:r}=n;if(!o)return[];let i=mos(e,t);if(!i)return[];let s=Bgt.applyToPoint(r,{x:i.min_x,y:i.min_y}),a=Bgt.applyToPoint(r,{x:i.max_x,y:i.max_y}),c=Math.min(s.x,a.x),l=Math.min(s.y,a.y),h=Math.abs(a.x-s.x),d=Math.abs(a.y-s.y),u=c+h/2,_=l+d/2,p=[{type:"element",name:"rect",value:"",attributes:{x:c.toString(),y:l.toString(),width:h.toString(),height:d.toString(),fill:"none",stroke:"red","stroke-width":"1.5","stroke-dasharray":"4,2"},children:[]},{type:"element",name:"rect",value:"",attributes:{x:(u-5).toString(),y:(_-5).toString(),width:"10",height:"10",fill:"red",transform:`rotate(45 ${u} ${_})`},children:[]},{type:"element",name:"text",value:"",attributes:{x:u.toString(),y:(l-10).toString(),fill:"red","font-family":"sans-serif","font-size":"12","text-anchor":"middle"},children:[{type:"text",name:"",value:e.message??"PCB component extends outside board boundaries",attributes:{},children:[]}]}];return pos(p)}function t_e(e){return e!==void 0&&typeof e.x==="number"&&Number.isFinite(e.x)&&typeof e.y==="number"&&Number.isFinite(e.y)}function gos(e,t){if(e.type==="pcb_via_trace_clearance_error")return t.find((n)=>n.type==="pcb_via"&&n.pcb_via_id===e.pcb_via_id);return t.find((n)=>n.type==="pcb_smtpad"&&n.pcb_smtpad_id===e.pcb_pad_id||n.type==="pcb_plated_hole"&&n.pcb_plated_hole_id===e.pcb_pad_id)}function Aos(e){if(!e)return;if("x"in e&&"y"in e&&t_e(e))return{x:e.x,y:e.y};if(e.type==="pcb_smtpad"&&e.shape==="polygon"&&e.points.length>0){let t=e.points.filter(t_e);if(t.length===0)return;let n=t.map((r)=>r.x),o=t.map((r)=>r.y);return{x:(Math.min(...n)+Math.max(...n))/2,y:(Math.min(...o)+Math.max(...o))/2}}return}function fos(e){if(e.route_type==="through_pad")return[e.start,e.end].filter(t_e);return t_e(e)?[{x:e.x,y:e.y}]:[]}function yos(e){if(!e)return;let t,n;for(let o of e.route){let r=fos(o);if(!t&&r[0])t=r[0];if(r.length>0)n=r[r.length-1]}return t&&n?{start:t,end:n}:void 0}function xos(e,t){return{x:(e.x+t.x)/2,y:(e.y+t.y)/2}}function Agt(e,t,n){let o=e.x-t.x,r=e.y-t.y;if(o*o+r*r<0.25)return;return{type:"element",name:"line",value:"",attributes:{x1:e.x.toString(),y1:e.y.toString(),x2:t.x.toString(),y2:t.y.toString(),stroke:"red","stroke-width":"1.5","stroke-dasharray":"2,2","data-error-reference":n},children:[]}}function Cos(e,t){return e.map((n)=>({...n,attributes:{...n.attributes??{},"data-type":n.attributes?.["data-type"]??t,"data-pcb-layer":n.attributes?.["data-pcb-layer"]??"overlay"}}))}function bos(e,t,n){let{shouldDrawErrors:o,transform:r}=n;if(!o)return[];let i=Aos(gos(e,t)),s=t.find((y)=>y.type==="pcb_trace"&&y.pcb_trace_id===e.pcb_trace_id),a=yos(s),c=t_e(e.center)?e.center:i??(a?xos(a.start,a.end):void 0);if(!c)return[];let l=$me.applyToPoint(r,c),h=i?$me.applyToPoint(r,i):void 0,d=a?{start:$me.applyToPoint(r,a.start),end:$me.applyToPoint(r,a.end)}:void 0,u=[d?Agt(d.start,l,"trace-start"):void 0,d?Agt(d.end,l,"trace-end"):void 0,h?Agt(h,l,"obstacle"):void 0].filter((y)=>y!==void 0),_=e.type==="pcb_pad_trace_clearance_error"?"Pad/trace":"Via/trace",{actual_clearance:p,minimum_clearance:m}=e,A=p!==void 0&&m!==void 0?`${_} clearance ${p} is below minimum ${m}`:e.type==="pcb_pad_trace_clearance_error"?"Pad and trace too close":"Via and trace too close",g=e.message??A,f=[...u,{type:"element",name:"rect",value:"",attributes:{x:(l.x-5).toString(),y:(l.y-5).toString(),width:"10",height:"10",fill:"red",transform:`rotate(45 ${l.x} ${l.y})`},children:[]},{type:"element",name:"text",value:"",attributes:{x:l.x.toString(),y:(l.y-15).toString(),fill:"red","font-family":"sans-serif","font-size":"12","text-anchor":"middle"},children:[{type:"text",name:"",value:g,attributes:{},children:[]}]}];return Cos(f,e.type)}function Ios(e,t){let{transform:n,layer:o}=t;if(!e.route||!Array.isArray(e.route))return[];let r=e.route[0],i=e.route[e.route.length-1],s=r.x===i.x&&r.y===i.y,a=e.route.slice(0,s?-1:void 0).map((c,l)=>{let[h,d]=apo.applyToPoint(n,[c.x,c.y]);return l===0?`M ${h} ${d}`:`L ${h} ${d}`}).join(" ")+(s?" Z":"");return[{name:"path",type:"element",attributes:{class:"pcb-fabrication-note-path",stroke:e.color||"rgba(255,255,255,0.5)",fill:"none",d:a,"stroke-width":(e.stroke_width*Math.abs(n.a)).toString(),"data-pcb-component-id":e.pcb_component_id,"data-pcb-fabrication-note-path-id":e.pcb_fabrication_note_path_id,"data-type":"pcb_fabrication_note_path","data-pcb-layer":"overlay"},value:"",children:[]}]}var lpo=cpo.default("circuit-to-svg"),Tm=lpo.extend("pcb"),YBa=lpo.extend("sch");function dpo(e){switch(e){case"top_left":return{textAnchor:"start",dominantBaseline:"text-before-edge"};case"top_center":return{textAnchor:"middle",dominantBaseline:"text-before-edge"};case"top_right":return{textAnchor:"end",dominantBaseline:"text-before-edge"};case"center_left":return{textAnchor:"start",dominantBaseline:"central"};case"center_right":return{textAnchor:"end",dominantBaseline:"central"};case"bottom_left":return{textAnchor:"start",dominantBaseline:"text-after-edge"};case"bottom_center":return{textAnchor:"middle",dominantBaseline:"text-after-edge"};case"bottom_right":return{textAnchor:"end",dominantBaseline:"text-after-edge"};case"center":default:return{textAnchor:"middle",dominantBaseline:"central"}}}function vos(e,t){let{transform:n,layer:o}=t,{anchor_position:r,anchor_alignment:i="center",text:s,font_size:a=1,layer:c="top",color:l,ccw_rotation:h=0}=e;if(o&&c!==o)return[];if(!r||typeof r.x!=="number"||typeof r.y!=="number")return Tm(`[pcb_fabrication_note_text] Invalid anchor_position for "${e.pcb_fabrication_note_text_id}": expected {x: number, y: number}, got ${JSON.stringify(r)}`),[];let[d,u]=KL.applyToPoint(n,[r.x,r.y]),_=a*Math.abs(n.a),{textAnchor:p,dominantBaseline:m}=dpo(i),A=KL.compose(KL.translate(d,u),KL.rotate(-h*Math.PI/180));return[{name:"text",type:"element",attributes:{x:"0",y:"0","font-family":s_e,"font-size":_.toString(),"text-anchor":p,"dominant-baseline":m,transform:hpo.toString(A),class:"pcb-fabrication-note-text",fill:l||"rgba(255,255,255,0.5)","data-type":"pcb_fabrication_note_text","data-pcb-layer":"overlay"},children:[{type:"text",value:s,name:"",attributes:{},children:[]}],value:""}]}var Sos="rgba(255,255,255,0.5)",Pos="rgba(255,255,255,0.2)";function Eos(e,t){let{transform:n,layer:o}=t,{center:r,width:i,height:s,stroke_width:a,is_filled:c,has_stroke:l,is_stroke_dashed:h,color:d,layer:u="top",pcb_component_id:_,pcb_fabrication_note_rect_id:p,corner_radius:m}=e;if(o&&u!==o)return[];if(!r||typeof r.x!=="number"||typeof r.y!=="number"||typeof i!=="number"||typeof s!=="number")return Tm(`[pcb_fabrication_note_rect] Invalid data for "${p}": expected center {x: number, y: number}, width: number, height: number, got center=${JSON.stringify(r)}, width=${JSON.stringify(i)}, height=${JSON.stringify(s)}`),[];let A=i/2,g=s/2,[f,y]=Tgt.applyToPoint(n,[r.x-A,r.y+g]),[x,C]=Tgt.applyToPoint(n,[r.x+A,r.y-g]),b=Math.min(f,x),I=Math.min(y,C),v=Math.abs(x-f),P=Math.abs(C-y),B=(typeof a==="number"?a:0)*Math.abs(n.a),T=d??Sos,N=typeof m==="number"&&m>0?m:0,D=N*Math.abs(n.a),L=N*Math.abs(n.d),H={x:b.toString(),y:I.toString(),width:v.toString(),height:P.toString(),class:"pcb-fabrication-note-rect","data-type":"pcb_fabrication_note_rect","data-pcb-fabrication-note-rect-id":p,"data-pcb-layer":"overlay"};if(_!==void 0)H["data-pcb-component-id"]=_;if(D>0)H.rx=D.toString();if(L>0)H.ry=L.toString();if(c)H.fill=d??Pos;else H.fill="none";if(l??B>0){if(H.stroke=T,H["stroke-width"]=B.toString(),h){let U=0.2*Math.abs(n.a),j=0.1*Math.abs(n.a);H["stroke-dasharray"]=`${U} ${j}`}}else H.stroke="none";return[{name:"rect",type:"element",value:"",attributes:H,children:[]}]}function fgt(e){let t=Math.hypot(e.x,e.y)||1;return{x:e.x/t,y:e.y/t}}var Mos=1.5,wos=0.6,Bos=0.3;function b0o(e){return e.map((t,n)=>n===0?`M ${t.x} ${t.y}`:`L ${t.x} ${t.y}`).join(" ")}function Tos(e,t){let{transform:n,layer:o}=t,{from:r,to:i,text:s,font_size:a=1,color:c,arrow_size:l,layer:h,pcb_component_id:d,pcb_fabrication_note_dimension_id:u,offset_distance:_,offset_direction:p,text_ccw_rotation:m}=e;if(o&&h&&h!==o)return[];if(!r||!i||typeof r!=="object"||typeof i!=="object")return Tm(`[pcb_fabrication_note_dimension] Invalid endpoints for "${u}": expected {from: {x, y}, to: {x, y}}, got from=${JSON.stringify(r)}, to=${JSON.stringify(i)}`),[];if(typeof r.x!=="number"||typeof r.y!=="number"||typeof i.x!=="number"||typeof i.y!=="number")return Tm(`[pcb_fabrication_note_dimension] Invalid point values for "${u}": x and y must be numbers, got from=${JSON.stringify(r)}, to=${JSON.stringify(i)}`),[];let A=typeof l==="number"?l:void 0;if(A===void 0||!Number.isFinite(A)||A<=0)return Tm(`[pcb_fabrication_note_dimension] Invalid arrow_size for "${u}": expected positive number, got ${JSON.stringify(l)}`),[];let g=A,f=fgt({x:i.x-r.x,y:i.y-r.y});if(Number.isNaN(f.x)||Number.isNaN(f.y))return[];let y={x:-f.y,y:f.x},x=p&&typeof p.x==="number"&&typeof p.y==="number",C=x?fgt({x:p.x,y:p.y}):{x:0,y:0},b=typeof _==="number"?_:0,I={x:C.x*b,y:C.y*b},v=(Se)=>({x:Se.x+I.x,y:Se.y+I.y}),P=v(r),M=v(i),B=g/2,T={x:P.x+f.x*g,y:P.y+f.y*g},N={x:M.x-f.x*g,y:M.y-f.y*g},D=[ye(P),ye({x:T.x+y.x*B,y:T.y+y.y*B}),ye({x:T.x-y.x*B,y:T.y-y.y*B})],L=[ye(M),ye({x:N.x+y.x*B,y:N.y+y.y*B}),ye({x:N.x-y.x*B,y:N.y-y.y*B})],[H,V]=gT.applyToPoint(n,[T.x,T.y]),[O,U]=gT.applyToPoint(n,[N.x,N.y]),j=g/5*Math.abs(n.a),Y=c||"rgba(255,255,255,0.5)",X=x&&(Math.abs(C.x)>Number.EPSILON||Math.abs(C.y)>Number.EPSILON)?C:y,K=b+g,J=(Se)=>{let Ne={x:Se.x+X.x*K,y:Se.y+X.y*K},[Le,nt]=gT.applyToPoint(n,[Se.x,Se.y]),[dt,rt]=gT.applyToPoint(n,[Ne.x,Ne.y]);return{name:"path",type:"element",value:"",attributes:{d:`M ${Le} ${nt} L ${dt} ${rt}`,stroke:Y,fill:"none","stroke-width":j.toString(),"stroke-linecap":"round",class:"pcb-fabrication-note-dimension-extension"},children:[]}},ee=[J(r),J(i)],se={x:(r.x+i.x)/2+I.x,y:(r.y+i.y)/2+I.y},[ne,re]=gT.applyToPoint(n,[P.x,P.y]),[Z,te]=gT.applyToPoint(n,[M.x,M.y]),ie=fgt({x:Z-ne,y:te-re}),ce=Math.atan2(ie.y,ie.x)*180/Math.PI;if(ce>90||ce<-90)ce+=180;let ue=typeof m==="number"&&Number.isFinite(m)?ce-m:ce,de=0;if(s&&typeof m==="number"&&Number.isFinite(m)){let Se=s.length*a*wos,Ne=a,Le=m*Math.PI/180,nt=Math.abs(Math.sin(Le)),dt=Math.abs(Math.cos(Le)),rt=Se/2,pt=Ne/2;de=rt*nt+pt*dt+a*Bos}let me=g*Mos+de,ge={x:se.x+y.x*me,y:se.y+y.y*me},[xe,Ee]=gT.applyToPoint(n,[ge.x,ge.y]),Re=a*Math.abs(n.a),Me=[...ee,{name:"path",type:"element",value:"",attributes:{d:`M ${H} ${V} L ${O} ${U}`,stroke:Y,fill:"none","stroke-width":j.toString(),"stroke-linecap":"round",class:"pcb-fabrication-note-dimension-line"},children:[]},{name:"path",type:"element",value:"",attributes:{d:`${b0o(D)} Z`,fill:Y,class:"pcb-fabrication-note-dimension-arrow"},children:[]},{name:"path",type:"element",value:"",attributes:{d:`${b0o(L)} Z`,fill:Y,class:"pcb-fabrication-note-dimension-arrow"},children:[]}];if(s)Me.push({name:"text",type:"element",value:"",attributes:{x:xe.toString(),y:Ee.toString(),fill:Y,"font-size":Re.toString(),"font-family":s_e,"text-anchor":"middle","dominant-baseline":"central",class:"pcb-fabrication-note-dimension-text",transform:`rotate(${ue} ${xe} ${Ee})`},children:[{type:"text",name:"",value:s,attributes:{},children:[]}]});let _e={class:"pcb-fabrication-note-dimension","data-type":"pcb_fabrication_note_dimension","data-pcb-fabrication-note-dimension-id":u,"data-pcb-layer":h??"overlay"};if(d!==void 0)_e["data-pcb-component-id"]=d;return[{name:"g",type:"element",value:"",attributes:_e,children:Me}];function ye(Se){let[Ne,Le]=gT.applyToPoint(n,[Se.x,Se.y]);return{x:Ne,y:Le}}}var YA={"3d_viewer":{background_bottom:"rgb(102, 102, 128)",background_top:"rgb(204, 204, 230)",board:"rgb(51, 43, 23)",copper:"rgb(179, 156, 0)",silkscreen_bottom:"rgb(230, 230, 230)",silkscreen_top:"rgb(230, 230, 230)",soldermask:"rgb(20, 51, 36)",solderpaste:"rgb(128, 128, 128)"},board:{anchor:"rgb(255, 38, 226)",aux_items:"rgb(255, 255, 255)",b_adhes:"rgb(0, 0, 132)",b_crtyd:"rgb(255, 38, 226)",b_fab:"rgb(88, 93, 132)",b_mask:"rgba(2, 255, 238, 0.400)",b_paste:"rgb(0, 194, 194)",b_silks:"rgb(232, 178, 167)",background:"rgb(0, 16, 35)",cmts_user:"rgb(89, 148, 220)",copper:{b:"rgb(77, 127, 196)",f:"rgb(200, 52, 52)",in1:"rgb(127, 200, 127)",in10:"rgb(237, 124, 51)",in11:"rgb(91, 195, 235)",in12:"rgb(247, 111, 142)",in13:"rgb(167, 165, 198)",in14:"rgb(40, 204, 217)",in15:"rgb(232, 178, 167)",in16:"rgb(242, 237, 161)",in17:"rgb(237, 124, 51)",in18:"rgb(91, 195, 235)",in19:"rgb(247, 111, 142)",in2:"rgb(206, 125, 44)",in20:"rgb(167, 165, 198)",in21:"rgb(40, 204, 217)",in22:"rgb(232, 178, 167)",in23:"rgb(242, 237, 161)",in24:"rgb(237, 124, 51)",in25:"rgb(91, 195, 235)",in26:"rgb(247, 111, 142)",in27:"rgb(167, 165, 198)",in28:"rgb(40, 204, 217)",in29:"rgb(232, 178, 167)",in3:"rgb(79, 203, 203)",in30:"rgb(242, 237, 161)",in4:"rgb(219, 98, 139)",in5:"rgb(167, 165, 198)",in6:"rgb(40, 204, 217)",in7:"rgb(232, 178, 167)",in8:"rgb(242, 237, 161)",in9:"rgb(141, 203, 129)"},cursor:"rgb(255, 255, 255)",drc:"rgb(194, 194, 194)",drc_error:"rgba(215, 91, 107, 0.800)",drc_exclusion:"rgb(255, 255, 255)",drc_warning:"rgba(255, 208, 66, 0.902)",dwgs_user:"rgb(194, 194, 194)",eco1_user:"rgb(180, 219, 210)",eco2_user:"rgb(216, 200, 82)",edge_cuts:"rgb(208, 210, 205)",f_adhes:"rgb(132, 0, 132)",f_crtyd:"rgb(255, 0, 245)",f_fab:"rgb(175, 175, 175)",f_mask:"rgba(216, 100, 255, 0.400)",f_paste:"rgba(180, 160, 154, 0.902)",f_silks:"rgb(242, 237, 161)",footprint_text_back:"rgb(0, 0, 132)",footprint_text_front:"rgb(194, 194, 194)",footprint_text_invisible:"rgb(132, 132, 132)",grid:"rgb(132, 132, 132)",grid_axes:"rgb(194, 194, 194)",margin:"rgb(255, 38, 226)",microvia:"rgb(0, 132, 132)",no_connect:"rgb(0, 0, 132)",pad_back:"rgb(77, 127, 196)",pad_front:"rgb(200, 52, 52)",pad_plated_hole:"rgb(194, 194, 0)",pad_through_hole:"rgb(227, 183, 46)",plated_hole:"rgb(26, 196, 210)",ratsnest:"rgba(245, 255, 213, 0.702)",select_overlay:"rgb(4, 255, 67)",through_via:"rgb(236, 236, 236)",user_1:"rgb(194, 194, 194)",user_2:"rgb(89, 148, 220)",user_3:"rgb(180, 219, 210)",user_4:"rgb(216, 200, 82)",user_5:"rgb(194, 194, 194)",user_6:"rgb(89, 148, 220)",user_7:"rgb(180, 219, 210)",user_8:"rgb(216, 200, 82)",user_9:"rgb(232, 178, 167)",via_blind_buried:"rgb(187, 151, 38)",via_hole:"rgb(227, 183, 46)",via_micro:"rgb(0, 132, 132)",via_through:"rgb(236, 236, 236)",worksheet:"rgb(200, 114, 171)"},gerbview:{axes:"rgb(0, 0, 132)",background:"rgb(0, 0, 0)",dcodes:"rgb(255, 255, 255)",grid:"rgb(132, 132, 132)",layers:["rgb(132, 0, 0)","rgb(194, 194, 0)","rgb(194, 0, 194)","rgb(194, 0, 0)","rgb(0, 132, 132)","rgb(0, 132, 0)","rgb(0, 0, 132)","rgb(132, 132, 132)","rgb(132, 0, 132)","rgb(194, 194, 194)","rgb(132, 0, 132)","rgb(132, 0, 0)","rgb(132, 132, 0)","rgb(194, 194, 194)","rgb(0, 0, 132)","rgb(0, 132, 0)","rgb(132, 0, 0)","rgb(194, 194, 0)","rgb(194, 0, 194)","rgb(194, 0, 0)","rgb(0, 132, 132)","rgb(0, 132, 0)","rgb(0, 0, 132)","rgb(132, 132, 132)","rgb(132, 0, 132)","rgb(194, 194, 194)","rgb(132, 0, 132)","rgb(132, 0, 0)","rgb(132, 132, 0)","rgb(194, 194, 194)","rgb(0, 0, 132)","rgb(0, 132, 0)","rgb(132, 0, 0)","rgb(194, 194, 0)","rgb(194, 0, 194)","rgb(194, 0, 0)","rgb(0, 132, 132)","rgb(0, 132, 0)","rgb(0, 0, 132)","rgb(132, 132, 132)","rgb(132, 0, 132)","rgb(194, 194, 194)","rgb(132, 0, 132)","rgb(132, 0, 0)","rgb(132, 132, 0)","rgb(194, 194, 194)","rgb(0, 0, 132)","rgb(0, 132, 0)","rgb(132, 0, 0)","rgb(194, 194, 0)","rgb(194, 0, 194)","rgb(194, 0, 0)","rgb(0, 132, 132)","rgb(0, 132, 0)","rgb(0, 0, 132)","rgb(132, 132, 132)","rgb(132, 0, 132)","rgb(194, 194, 194)","rgb(132, 0, 132)","rgb(132, 0, 0)"],negative_objects:"rgb(132, 132, 132)",worksheet:"rgb(0, 0, 132)"},meta:{filename:"kicad_2020",name:"KiCad 2020",version:2},simulation_palette:["#1f77b4","#d62728","#2ca02c","#ff7f0e","#9467bd","#17becf","#8c564b","#e377c2","#7f7f7f","#bcbd22"],palette:["rgb(132, 0, 0)","rgb(194, 194, 0)","rgb(194, 0, 194)","rgb(194, 0, 0)","rgb(0, 132, 132)","rgb(0, 132, 0)","rgb(0, 0, 132)","rgb(132, 132, 132)","rgb(132, 0, 132)","rgb(194, 194, 194)","rgb(132, 0, 132)","rgb(132, 0, 0)","rgb(132, 132, 0)","rgb(194, 194, 194)","rgb(0, 0, 132)","rgb(0, 132, 0)"],schematic:{aux_items:"rgb(46, 46, 46)",background:"rgb(245, 241, 237)",brightened:"rgb(255, 0, 255)",bus:"rgb(0, 0, 132)",bus_junction:"rgb(0, 0, 132)",component_body:"rgb(255, 255, 194)",component_outline:"rgb(132, 0, 0)",cursor:"rgb(15, 15, 15)",erc_error:"rgba(230, 9, 13, 0.800)",erc_warning:"rgba(209, 146, 0, 0.800)",fields:"rgb(132, 0, 132)",grid:"rgb(181, 181, 181)",grid_axes:"rgb(0, 0, 132)",hidden:"rgb(194, 194, 194)",junction:"rgb(0, 150, 0)",label_global:"rgb(132, 0, 0)",label_background:"rgba(255, 255, 255, 0.6)",label_hier:"rgb(114, 86, 0)",label_local:"rgb(15, 15, 15)",net_name:"rgb(132, 132, 132)",no_connect:"rgb(132, 0, 0)",note:"rgb(0, 0, 194)",override_item_colors:!1,pin:"rgb(132, 0, 0)",pin_name:"rgb(0, 100, 100)",pin_number:"rgb(169, 0, 0)",reference:"rgb(0, 100, 100)",shadow:"rgba(102, 179, 255, 0.800)",sheet:"rgb(132, 0, 0)",sheet_background:"rgba(253, 255, 231, 0.000)",sheet_fields:"rgb(132, 0, 132)",sheet_filename:"rgb(114, 86, 0)",sheet_label:"rgb(0, 100, 100)",sheet_name:"rgb(0, 100, 100)",table:"rgb(102, 102, 102)",value:"rgb(0, 100, 100)",wire:"rgb(0, 150, 0)",wire_crossing:"rgb(30, 180, 30)",worksheet:"rgb(132, 0, 0)"}};function ygt(e){let t=Math.hypot(e.x,e.y)||1;return{x:e.x/t,y:e.y/t}}function I0o(e){return e.map((t,n)=>n===0?`M ${t.x} ${t.y}`:`L ${t.x} ${t.y}`).join(" ")}function Dos(e,t){let{transform:n}=t,{from:o,to:r,text:i,font_size:s=1,color:a,arrow_size:c,offset_distance:l,offset_direction:h,text_ccw_rotation:d}=e;if(!o||!r)return Tm(`[pcb_note_dimension] Invalid endpoints for "${e.pcb_note_dimension_id}": expected {from: {x, y}, to: {x, y}}, got from=${JSON.stringify(o)}, to=${JSON.stringify(r)}`),[];if(!Number.isFinite(c)||c<=0)return Tm(`[pcb_note_dimension] Invalid arrow_size for "${e.pcb_note_dimension_id}": expected positive number, got ${JSON.stringify(c)}`),[];let u=ygt({x:r.x-o.x,y:r.y-o.y});if(Number.isNaN(u.x)||Number.isNaN(u.y))return[];let _={x:-u.y,y:u.x},p=h&&typeof h.x==="number"&&typeof h.y==="number",m=p?ygt({x:h.x,y:h.y}):{x:0,y:0},A=typeof l==="number"?l:0,g={x:m.x*A,y:m.y*A},f=(ge)=>({x:ge.x+g.x,y:ge.y+g.y}),y=f(o),x=f(r),C=c/2,b={x:y.x+u.x*c,y:y.y+u.y*c},I={x:x.x-u.x*c,y:x.y-u.y*c},v=[me(y),me({x:b.x+_.x*C,y:b.y+_.y*C}),me({x:b.x-_.x*C,y:b.y-_.y*C})],P=[me(x),me({x:I.x+_.x*C,y:I.y+_.y*C}),me({x:I.x-_.x*C,y:I.y-_.y*C})],[M,B]=AT.applyToPoint(n,[b.x,b.y]),[T,N]=AT.applyToPoint(n,[I.x,I.y]),D=c/5*Math.abs(n.a),L=a||YA.board.user_2,H=p&&(Math.abs(m.x)>Number.EPSILON||Math.abs(m.y)>Number.EPSILON)?m:_,V=A+c,O=(ge)=>{let xe={x:ge.x+H.x*V,y:ge.y+H.y*V},[Ee,Re]=AT.applyToPoint(n,[ge.x,ge.y]),[Me,_e]=AT.applyToPoint(n,[xe.x,xe.y]);return{name:"path",type:"element",value:"",attributes:{d:`M ${Ee} ${Re} L ${Me} ${_e}`,stroke:L,fill:"none","stroke-width":D.toString(),"stroke-linecap":"round",class:"pcb-note-dimension-extension"},children:[]}},U=[O(o),O(r)],j={x:(o.x+r.x)/2+g.x,y:(o.y+r.y)/2+g.y},[Y,X]=AT.applyToPoint(n,[y.x,y.y]),[K,J]=AT.applyToPoint(n,[x.x,x.y]),ee=ygt({x:K-Y,y:J-X}),se=Math.atan2(ee.y,ee.x)*180/Math.PI;if(se>90||se<-90)se+=180;let ne=typeof d==="number"&&Number.isFinite(d)?se-d:se,re=0;if(i&&typeof d==="number"&&Number.isFinite(d)){let ge=i.length*s*0.6,xe=s,Ee=d*Math.PI/180,Re=Math.abs(Math.sin(Ee)),Me=Math.abs(Math.cos(Ee)),_e=ge/2,ye=xe/2;re=_e*Re+ye*Me+s*0.3}let Z=c*1.5+re,te={x:j.x+_.x*Z,y:j.y+_.y*Z},[ie,ce]=AT.applyToPoint(n,[te.x,te.y]),ue=s*Math.abs(n.a),de=[...U,{name:"path",type:"element",value:"",attributes:{d:`M ${M} ${B} L ${T} ${N}`,stroke:L,fill:"none","stroke-width":D.toString(),"stroke-linecap":"round",class:"pcb-note-dimension-line"},children:[]},{name:"path",type:"element",value:"",attributes:{d:`${I0o(v)} Z`,fill:L,class:"pcb-note-dimension-arrow"},children:[]},{name:"path",type:"element",value:"",attributes:{d:`${I0o(P)} Z`,fill:L,class:"pcb-note-dimension-arrow"},children:[]}];if(i)de.push({name:"text",type:"element",value:"",attributes:{x:ie.toString(),y:ce.toString(),fill:L,"font-size":ue.toString(),"font-family":"Arial, sans-serif","text-anchor":"middle","dominant-baseline":"central",class:"pcb-note-dimension-text",transform:`rotate(${ne} ${ie} ${ce})`},children:[{type:"text",name:"",value:i,attributes:{},children:[]}]});return[{name:"g",type:"element",value:"",attributes:{class:"pcb-note-dimension","data-type":"pcb_note_dimension","data-pcb-note-dimension-id":e.pcb_note_dimension_id,"data-pcb-layer":"overlay"},children:de}];function me(ge){let[xe,Ee]=AT.applyToPoint(n,[ge.x,ge.y]);return{x:xe,y:Ee}}}var Nos=YA.board.user_2;function Ros(e,t){let{transform:n}=t,{anchor_position:o,text:r,font_size:i=1,anchor_alignment:s="center",color:a}=e;if(!o||typeof o.x!=="number"||typeof o.y!=="number")return Tm(`[pcb_note_text] Invalid anchor_position for "${e.pcb_note_text_id}": expected {x: number, y: number}, got ${JSON.stringify(o)}`),[];if(typeof r!=="string"||r.length===0)return Tm(`[pcb_note_text] Invalid text for "${e.pcb_note_text_id}": expected non-empty string, got ${JSON.stringify(r)}`),[];let[c,l]=upo.applyToPoint(n,[o.x,o.y]),h=i*Math.abs(n.a),{textAnchor:d,dominantBaseline:u}=dpo(s),_=r.split(`
`),p=_.length===1?[{type:"text",name:"",value:r,attributes:{},children:[]}]:_.map((A,g)=>({type:"element",name:"tspan",value:"",attributes:{x:c.toString(),...g>0?{dy:"1em"}:{}},children:[{type:"text",name:"",value:A,attributes:{},children:[]}]}));return[{name:"text",type:"element",value:"",attributes:{x:c.toString(),y:l.toString(),fill:a??Nos,"font-family":"Arial, sans-serif","font-size":h.toString(),"text-anchor":d,"dominant-baseline":u,class:"pcb-note-text","data-type":"pcb_note_text","data-pcb-note-text-id":e.pcb_note_text_id,"data-pcb-layer":"overlay"},children:p}]}var Qos=YA.board.user_2,kos=YA.board.user_2;function Los(e,t){let{transform:n}=t,{center:o,width:r,height:i,stroke_width:s,is_filled:a,has_stroke:c,is_stroke_dashed:l,color:h,corner_radius:d}=e;if(!o||typeof o.x!=="number"||typeof o.y!=="number"||typeof r!=="number"||typeof i!=="number")return Tm(`[pcb_note_rect] Invalid data for "${e.pcb_note_rect_id}": expected center {x: number, y: number}, width: number, height: number, got center=${JSON.stringify(o)}, width=${JSON.stringify(r)}, height=${JSON.stringify(i)}`),[];let u=r/2,_=i/2,[p,m]=Dgt.applyToPoint(n,[o.x-u,o.y+_]),[A,g]=Dgt.applyToPoint(n,[o.x+u,o.y-_]),f=Math.min(p,A),y=Math.min(m,g),x=Math.abs(A-p),C=Math.abs(g-m),I=(typeof s==="number"?s:0)*Math.abs(n.a),v=typeof d==="number"&&d>0?d:0,P=v*Math.abs(n.a),M=v*Math.abs(n.d),B=h??Qos,T={x:f.toString(),y:y.toString(),width:x.toString(),height:C.toString(),class:"pcb-note-rect","data-type":"pcb_note_rect","data-pcb-note-rect-id":e.pcb_note_rect_id,"data-pcb-layer":"overlay"};if(P>0)T.rx=P.toString();if(M>0)T.ry=M.toString();if(a)T.fill=h??kos;else T.fill="none";if(c??I>0){if(T.stroke=B,T["stroke-width"]=I.toString(),l){let L=0.2*Math.abs(n.a),H=0.1*Math.abs(n.a);T["stroke-dasharray"]=`${L} ${H}`}}else T.stroke="none";return[{name:"rect",type:"element",value:"",attributes:T,children:[]}]}var Hos=YA.board.user_2;function Fos(e,t){let{transform:n}=t;if(!Array.isArray(e.route)||e.route.length===0)return Tm(`[pcb_note_path] Invalid route for "${e.pcb_note_path_id}": expected non-empty array of points, got ${JSON.stringify(e.route)}`),[];for(let s of e.route)if(typeof s.x!=="number"||typeof s.y!=="number")return Tm(`[pcb_note_path] Invalid point in route for "${e.pcb_note_path_id}": expected {x: number, y: number}, got ${JSON.stringify(s)}`),[];let o=e.route.map((s,a)=>{let[c,l]=ppo.applyToPoint(n,[s.x,s.y]);return a===0?`M ${c} ${l}`:`L ${c} ${l}`}).join(" "),r=e.stroke_width*Math.abs(n.a);return[{name:"path",type:"element",value:"",attributes:{d:o,stroke:e.color??Hos,fill:"none","stroke-width":r.toString(),class:"pcb-note-path","data-type":"pcb_note_path","data-pcb-note-path-id":e.pcb_note_path_id,"data-pcb-layer":"overlay"},children:[]}]}var zos=YA.board.user_2;function Oos(e,t){let{transform:n}=t,{x1:o,y1:r,x2:i,y2:s,stroke_width:a,color:c,is_dashed:l}=e;if(typeof o!=="number"||typeof r!=="number"||typeof i!=="number"||typeof s!=="number")return Tm(`[pcb_note_line] Invalid coordinates for "${e.pcb_note_line_id}": expected x1, y1, x2, y2 as numbers, got x1=${JSON.stringify(o)}, y1=${JSON.stringify(r)}, x2=${JSON.stringify(i)}, y2=${JSON.stringify(s)}`),[];let[h,d]=Ngt.applyToPoint(n,[o,r]),[u,_]=Ngt.applyToPoint(n,[i,s]),m=(typeof a==="number"?a:0)*Math.abs(n.a),A={x1:h.toString(),y1:d.toString(),x2:u.toString(),y2:_.toString(),stroke:c??zos,"stroke-width":m.toString(),"stroke-linecap":"round",class:"pcb-note-line","data-type":"pcb_note_line","data-pcb-note-line-id":e.pcb_note_line_id,"data-pcb-layer":"overlay"};if(l){let f=0.2*Math.abs(n.a),y=0.1*Math.abs(n.a);A["stroke-dasharray"]=`${f} ${y}`}return[{name:"line",type:"element",value:"",attributes:A,children:[]}]}function mpo(e,t){if(!t)return{};let n=_po(e,t);if(!n)return{};let o=t.find((a)=>a.type==="source_port"&&a.source_port_id===n),r=t.find((a)=>a.type==="source_component"&&a.source_component_id===o?.source_component_id),i={};if(r?.name&&o?.name)i["data-pad-name"]=`${r.name}.${o.name}`;let s=Yos(n,t);if(s)i["data-pad-net-name"]=s;return i}function Vos(e,t){if(t){let r=_po(e,t),i=t.find((s)=>s.type==="source_port"&&s.source_port_id===r);if(i?.type==="source_port"&&i.pin_number!=null)return i.pin_number.toString()}let n=e.port_hints?.find((r)=>r.trim().length>0);if(!n)return;return n.match(/^pin(\d+)$/i)?.[1]??n}function _po(e,t){if(e.source_port_id)return e.source_port_id;if(e.pcb_port_id){let r=t.find((i)=>i.type==="pcb_port"&&i.pcb_port_id===e.pcb_port_id);if(r?.source_port_id)return r.source_port_id}let n=e.pcb_smtpad_id??e.pcb_plated_hole_id;if(!n)return;return t.find((r)=>{if(r.type!=="pcb_port")return!1;let i=r;return i.pcb_smtpad_id===n||i.pcb_plated_hole_id===n})?.source_port_id}function Yos(e,t){let o=t.find((i)=>{if(i.type!=="source_trace")return!1;return i.connected_source_port_ids?.includes(e)})?.connected_source_net_ids?.[0];if(!o)return;return t.find((i)=>i.type==="source_net"&&i.source_net_id===o)?.name}function Gos(e,t){let{transform:n,colorMap:o,showSolderMask:r}=t,[i,s]=rU.applyToPoint(n,[e.x,e.y]),a=mpo(e,t.circuitJson),c=Array.isArray(e.layers)&&e.layers[0]||e.layer||"top",l=c,h=Boolean(e.is_covered_with_solder_mask),d=(e.soldermask_margin??0)*Math.abs(n.a),u=r&&h&&d!==0,_=o.soldermaskWithCopperUnderneath.top;if(e.shape==="pill"){let p=e.outer_width*Math.abs(n.a),m=e.outer_height*Math.abs(n.a),A=e.hole_width*Math.abs(n.a),g=e.hole_height*Math.abs(n.a),f=e.ccw_rotation||0,y=f?`translate(${i} ${s}) rotate(${-f})`:`translate(${i} ${s})`,x=f?`translate(${i} ${s}) rotate(${-f})`:`translate(${i} ${s})`,C=(I,v)=>{if(I>v){let P=v/2,M=I-2*P;return`M${-I/2+P},${-P} h${M} a${P},${P} 0 0 1 0,${v} h${-M} a${P},${P} 0 0 1 0,${-v} z`}else if(v>I){let P=I/2,M=v-2*P;return`M${P},${-v/2+P} v${M} a${P},${P} 0 0 1 ${-I},0 v${-M} a${P},${P} 0 0 1 ${I},0 z`}else{let P=I/2;return`M${-P},0 a${P},${P} 0 0 1 ${I},0 a${P},${P} 0 0 1 ${-I},0 z`}},b=[{name:"path",type:"element",attributes:{class:"pcb-hole-outer",fill:o.copper.top,d:C(p,m),transform:y,"data-type":"pcb_plated_hole","data-pcb-layer":c},value:"",children:[]},{name:"path",type:"element",attributes:{class:"pcb-hole-inner",fill:o.drill,d:C(A,g),transform:x,"data-type":"pcb_plated_hole_drill","data-pcb-layer":"drill"},value:"",children:[]}];if(u){let I=p+2*d,v=m+2*d;if(d<0)b=[{name:"path",type:"element",attributes:{class:"pcb-hole-outer-covered",fill:_,d:C(p,m),transform:y,"data-type":"pcb_plated_hole","data-pcb-layer":c},value:"",children:[]},{name:"path",type:"element",attributes:{class:"pcb-hole-outer-exposed",fill:o.copper.top,d:C(I,v),transform:y,"data-type":"pcb_soldermask","data-pcb-layer":l},value:"",children:[]},b[1]];else b.unshift({name:"path",type:"element",attributes:{class:"pcb-soldermask-cutout",fill:o.substrate,d:C(I,v),transform:y,"data-type":"pcb_soldermask_opening","data-pcb-layer":l},value:"",children:[]})}return[{name:"g",type:"element",attributes:{"data-type":"pcb_plated_hole","data-pcb-layer":"through",...a},children:b,value:""}]}if(e.shape==="oval"){let p=e.outer_width*Math.abs(n.a),m=e.outer_height*Math.abs(n.a),A=e.hole_width*Math.abs(n.a),g=e.hole_height*Math.abs(n.a),f=e.ccw_rotation||0,y=f?`translate(${i} ${s}) rotate(${-f})`:`translate(${i} ${s})`,x=[{name:"ellipse",type:"element",attributes:{class:"pcb-hole-outer",fill:o.copper.top,cx:"0",cy:"0",rx:(p/2).toString(),ry:(m/2).toString(),transform:y,"data-type":"pcb_plated_hole","data-pcb-layer":c},value:"",children:[]},{name:"ellipse",type:"element",attributes:{class:"pcb-hole-inner",fill:o.drill,cx:"0",cy:"0",rx:(A/2).toString(),ry:(g/2).toString(),transform:y,"data-type":"pcb_plated_hole_drill","data-pcb-layer":"drill"},value:"",children:[]}];return[{name:"g",type:"element",attributes:{"data-type":"pcb_plated_hole","data-pcb-layer":"through",...a},children:x,value:""}]}if(e.shape==="circle"){let p=e.outer_diameter*Math.abs(n.a),m=e.outer_diameter*Math.abs(n.a),A=e.hole_diameter*Math.abs(n.a),g=e.hole_diameter*Math.abs(n.a),f=Math.min(p,m)/2,y=Math.min(A,g)/2,x=[{name:"circle",type:"element",attributes:{class:"pcb-hole-outer",fill:o.copper.top,cx:i.toString(),cy:s.toString(),r:f.toString(),"data-type":"pcb_plated_hole","data-pcb-layer":c},value:"",children:[]},{name:"circle",type:"element",attributes:{class:"pcb-hole-inner",fill:o.drill,cx:i.toString(),cy:s.toString(),r:y.toString(),"data-type":"pcb_plated_hole_drill","data-pcb-layer":"drill"},value:"",children:[]}];if(u){let C=f+d;if(d<0)x=[{name:"circle",type:"element",attributes:{class:"pcb-hole-outer-covered",fill:_,cx:i.toString(),cy:s.toString(),r:f.toString(),"data-type":"pcb_plated_hole","data-pcb-layer":c},value:"",children:[]},{name:"circle",type:"element",attributes:{class:"pcb-hole-outer-exposed",fill:o.copper.top,cx:i.toString(),cy:s.toString(),r:C.toString(),"data-type":"pcb_soldermask","data-pcb-layer":l},value:"",children:[]},x[1]];else x.unshift({name:"circle",type:"element",attributes:{class:"pcb-soldermask-cutout",fill:o.substrate,cx:i.toString(),cy:s.toString(),r:C.toString(),"data-type":"pcb_soldermask_opening","data-pcb-layer":l},value:"",children:[]})}return[{name:"g",type:"element",attributes:{"data-type":"pcb_plated_hole","data-pcb-layer":"through",...a},children:x,value:""}]}if(e.shape==="circular_hole_with_rect_pad"){let p=e,m=e.hole_diameter*Math.abs(n.a),A=e.rect_pad_width*Math.abs(n.a),g=e.rect_pad_height*Math.abs(n.a),f=(e.rect_border_radius??0)*Math.abs(n.a),y=e.rect_ccw_rotation??0,x=p.rect_ccw_rotation??0,C=x?`translate(${i} ${s}) rotate(${-x})`:void 0,b=x?(-A/2).toString():(i-A/2).toString(),I=x?(-g/2).toString():(s-g/2).toString(),v=m/2,[P,M]=rU.applyToPoint(n,[p.x+(p.hole_offset_x??0),p.y+(p.hole_offset_y??0)]),B=[{name:"rect",type:"element",attributes:{class:"pcb-hole-outer-pad",fill:o.copper.top,...y?{x:(-A/2).toString(),y:(-g/2).toString(),transform:`translate(${i} ${s}) rotate(${-y})`}:{x:(i-A/2).toString(),y:(s-g/2).toString()},width:A.toString(),height:g.toString(),...C?{transform:C}:{},...f?{rx:f.toString(),ry:f.toString()}:{},"data-type":"pcb_plated_hole","data-pcb-layer":c},value:"",children:[]},{name:"circle",type:"element",attributes:{class:"pcb-hole-inner",fill:o.drill,cx:P.toString(),cy:M.toString(),r:v.toString(),"data-type":"pcb_plated_hole_drill","data-pcb-layer":"drill"},value:"",children:[]}];if(u){let T=A+2*d,N=g+2*d,D=f+d;if(d<0)B=[{name:"rect",type:"element",attributes:{class:"pcb-hole-outer-covered",fill:_,...y?{x:(-A/2).toString(),y:(-g/2).toString(),transform:`translate(${i} ${s}) rotate(${-y})`}:{x:(i-A/2).toString(),y:(s-g/2).toString()},width:A.toString(),height:g.toString(),...C?{transform:C}:{},...f?{rx:f.toString(),ry:f.toString()}:{},"data-type":"pcb_plated_hole","data-pcb-layer":c},value:"",children:[]},{name:"rect",type:"element",attributes:{class:"pcb-hole-outer-exposed",fill:o.copper.top,...y?{x:(-T/2).toString(),y:(-N/2).toString(),transform:`translate(${i} ${s}) rotate(${-y})`}:{x:(i-T/2).toString(),y:(s-N/2).toString()},width:T.toString(),height:N.toString(),...C?{transform:C}:{},...D>0?{rx:D.toString(),ry:D.toString()}:{},"data-type":"pcb_soldermask","data-pcb-layer":l},value:"",children:[]},B[1]];else B.unshift({name:"rect",type:"element",attributes:{class:"pcb-soldermask-cutout",fill:o.substrate,...y?{x:(-T/2).toString(),y:(-N/2).toString(),transform:`translate(${i} ${s}) rotate(${-y})`}:{x:(i-T/2).toString(),y:(s-N/2).toString()},width:T.toString(),height:N.toString(),...C?{transform:C}:{},...f?{rx:D.toString(),ry:D.toString()}:{},"data-type":"pcb_soldermask_opening","data-pcb-layer":l},value:"",children:[]})}return[{name:"g",type:"element",attributes:{"data-type":"pcb_plated_hole","data-pcb-layer":"through",...a},children:B,value:""}]}if(e.shape==="pill_hole_with_rect_pad"){let p=e,m=p.rect_pad_width*Math.abs(n.a),A=p.rect_pad_height*Math.abs(n.a),g=(p.rect_border_radius??0)*Math.abs(n.a),f=p.hole_height*Math.abs(n.a),y=p.hole_width*Math.abs(n.a),x=p,C=x.hole_offset_x??0,b=x.hole_offset_y??0,[I,v]=rU.applyToPoint(n,[p.x+C,p.y+b]),P=Math.min(f,y)/2,M=[{name:"rect",type:"element",attributes:{class:"pcb-hole-outer-pad",fill:o.copper.top,x:(i-m/2).toString(),y:(s-A/2).toString(),width:m.toString(),height:A.toString(),...g?{rx:g.toString(),ry:g.toString()}:{},"data-type":"pcb_plated_hole","data-pcb-layer":c},value:"",children:[]},{name:"rect",type:"element",attributes:{class:"pcb-hole-inner",fill:o.drill,x:(I-y/2).toString(),y:(v-f/2).toString(),width:y.toString(),height:f.toString(),rx:P.toString(),ry:P.toString(),"data-type":"pcb_plated_hole_drill","data-pcb-layer":"drill"},value:"",children:[]}];if(u){let B=m+2*d,T=A+2*d,N=g+d;if(d<0)M=[{name:"rect",type:"element",attributes:{class:"pcb-hole-outer-covered",fill:_,x:(i-m/2).toString(),y:(s-A/2).toString(),width:m.toString(),height:A.toString(),...g?{rx:g.toString(),ry:g.toString()}:{},"data-type":"pcb_plated_hole","data-pcb-layer":c},value:"",children:[]},{name:"rect",type:"element",attributes:{class:"pcb-hole-outer-exposed",fill:o.copper.top,x:(i-B/2).toString(),y:(s-T/2).toString(),width:B.toString(),height:T.toString(),...N>0?{rx:N.toString(),ry:N.toString()}:{},"data-type":"pcb_soldermask","data-pcb-layer":l},value:"",children:[]},M[1]];else M.unshift({name:"rect",type:"element",attributes:{class:"pcb-soldermask-cutout",fill:o.substrate,x:(i-B/2).toString(),y:(s-T/2).toString(),width:B.toString(),height:T.toString(),...g?{rx:N.toString(),ry:N.toString()}:{},"data-type":"pcb_soldermask_opening","data-pcb-layer":l},value:"",children:[]})}return[{name:"g",type:"element",attributes:{"data-type":"pcb_plated_hole","data-pcb-layer":"through",...a},children:M,value:""}]}if(e.shape==="rotated_pill_hole_with_rect_pad"){let p=e,m=p.rect_pad_width*Math.abs(n.a),A=p.rect_pad_height*Math.abs(n.a),g=(p.rect_border_radius??0)*Math.abs(n.a),f=p.hole_height*Math.abs(n.a),y=p.hole_width*Math.abs(n.a),x=p,C=x.hole_offset_x??0,b=x.hole_offset_y??0,[I,v]=rU.applyToPoint(n,[p.x+C,p.y+b]),P=Math.min(f,y)/2,M=[{name:"rect",type:"element",attributes:{class:"pcb-hole-outer-pad",fill:o.copper.top,x:(-m/2).toString(),y:(-A/2).toString(),width:m.toString(),height:A.toString(),transform:`translate(${i} ${s}) rotate(${-p.rect_ccw_rotation})`,...g?{rx:g.toString(),ry:g.toString()}:{},"data-type":"pcb_plated_hole","data-pcb-layer":c},value:"",children:[]},{name:"rect",type:"element",attributes:{class:"pcb-hole-inner",fill:o.drill,x:(-y/2).toString(),y:(-f/2).toString(),width:y.toString(),height:f.toString(),rx:P.toString(),ry:P.toString(),transform:`translate(${I} ${v}) rotate(${-p.hole_ccw_rotation})`,"data-type":"pcb_plated_hole_drill","data-pcb-layer":"drill"},value:"",children:[]}];if(u){let B=m+2*d,T=A+2*d,N=g+d;if(d<0)M=[{name:"rect",type:"element",attributes:{class:"pcb-hole-outer-covered",fill:_,x:(-m/2).toString(),y:(-A/2).toString(),width:m.toString(),height:A.toString(),transform:`translate(${i} ${s}) rotate(${-p.rect_ccw_rotation})`,...g?{rx:g.toString(),ry:g.toString()}:{},"data-type":"pcb_plated_hole","data-pcb-layer":c},value:"",children:[]},{name:"rect",type:"element",attributes:{class:"pcb-hole-outer-exposed",fill:o.copper.top,x:(-B/2).toString(),y:(-T/2).toString(),width:B.toString(),height:T.toString(),transform:`translate(${i} ${s}) rotate(${-p.rect_ccw_rotation})`,...N>0?{rx:N.toString(),ry:N.toString()}:{},"data-type":"pcb_soldermask","data-pcb-layer":l},value:"",children:[]},M[1]];else M.push({name:"rect",type:"element",attributes:{class:"pcb-solder-mask",fill:_,x:(-B/2).toString(),y:(-T/2).toString(),width:B.toString(),height:T.toString(),transform:`translate(${i} ${s}) rotate(${-p.rect_ccw_rotation})`,...g?{rx:N.toString(),ry:N.toString()}:{},"data-type":"pcb_soldermask","data-pcb-layer":l},value:"",children:[]})}return[{name:"g",type:"element",attributes:{"data-type":"pcb_plated_hole","data-pcb-layer":"through",...a},children:M,value:""}]}if(e.shape==="hole_with_polygon_pad"){let p=e,m=p.pad_outline||[],A=p.x??0,g=p.y??0,y=m.map((I)=>rU.applyToPoint(n,[A+I.x,g+I.y])).map((I)=>I.join(",")).join(" "),[x,C]=rU.applyToPoint(n,[A+p.hole_offset_x,g+p.hole_offset_y]),b=()=>{if(p.hole_shape==="circle"){let v=(p.hole_diameter??0)*Math.abs(n.a)/2;return{name:"circle",type:"element",attributes:{class:"pcb-hole-inner",fill:o.drill,cx:x.toString(),cy:C.toString(),r:v.toString(),"data-type":"pcb_plated_hole_drill","data-pcb-layer":"drill"},value:"",children:[]}}if(p.hole_shape==="oval"){let I=(p.hole_width??0)*Math.abs(n.a),v=(p.hole_height??0)*Math.abs(n.a),P=I/2,M=v/2;return{name:"ellipse",type:"element",attributes:{class:"pcb-hole-inner",fill:o.drill,cx:x.toString(),cy:C.toString(),rx:P.toString(),ry:M.toString(),"data-type":"pcb_plated_hole_drill","data-pcb-layer":"drill"},value:"",children:[]}}if(p.hole_shape==="pill"||p.hole_shape==="rotated_pill"){let I=(p.hole_width??0)*Math.abs(n.a),v=(p.hole_height??0)*Math.abs(n.a),P=I>v,M=Math.min(I,v)/2,B=Math.abs(P?I-v:v-I),T=P?`M${-B/2},${-M} h${B} a${M},${M} 0 0 1 0,${v} h-${B} a${M},${M} 0 0 1 0,-${v} z`:`M${-M},${-B/2} v${B} a${M},${M} 0 0 0 ${I},0 v-${B} a${M},${M} 0 0 0 -${I},0 z`;return{name:"path",type:"element",attributes:{class:"pcb-hole-inner",fill:o.drill,d:T,transform:`translate(${x} ${C})`,"data-type":"pcb_plated_hole_drill","data-pcb-layer":"drill"},value:"",children:[]}}return{name:"g",type:"element",attributes:{},value:"",children:[]}};return[{name:"g",type:"element",attributes:{"data-type":"pcb_plated_hole","data-pcb-layer":"through",...a},children:[{name:"polygon",type:"element",attributes:{class:"pcb-hole-outer-pad",fill:o.copper.top,points:y,"data-type":"pcb_plated_hole","data-pcb-layer":c},value:"",children:[]},b()],value:""}]}return[]}function Uos(e,t){let{transform:n,layer:o,colorMap:r}=t;if(!e.route||!Array.isArray(e.route))return[];let i=e.route.map((h,d)=>{let[u,_]=gpo.applyToPoint(n,[h.x,h.y]);return d===0?`M ${u} ${_}`:`L ${u} ${_}`}).join(" "),s=e.route[0],a=e.route[e.route.length-1];if(s&&a&&s.x===a.x&&s.y===a.y)i+=" Z";let c=e.layer||"top";if(o&&c!==o)return[];let l=c==="bottom"?r.silkscreen.bottom:r.silkscreen.top;return[{name:"path",type:"element",attributes:{class:`pcb-silkscreen pcb-silkscreen-${c}`,d:i,fill:"none",stroke:l,"stroke-width":(e.stroke_width*Math.abs(n.a)).toString(),"stroke-linecap":"round","stroke-linejoin":"round","data-pcb-component-id":e.pcb_component_id,"data-pcb-silkscreen-path-id":e.pcb_silkscreen_path_id,"data-type":"pcb_silkscreen_path","data-pcb-layer":c},value:"",children:[]}]}function fBe(e,t){if(e.length===0)return"";let n=e.map((r)=>{let[i,s]=Apo.applyToPoint(t,[r.x,r.y]);return{...r,x:i,y:s}}),o=`M ${n[0].x} ${n[0].y}`;for(let r=0;r<n.length;r++){let i=n[r],s=n[(r+1)%n.length];if(i.bulge){if(Math.hypot(s.x-i.x,s.y-i.y)<0.000000001)continue;let a=i.bulge,c=s.x-i.x,l=s.y-i.y,h=Math.hypot(c,l),d=Math.abs(h/4/a*(a*a+1)),u=a<0?1:0,_=Math.abs(a)>1?1:0;o+=` A ${d} ${d} 0 ${_} ${u} ${s.x} ${s.y}`}else o+=` L ${s.x} ${s.y}`}return o+=" Z",o}function Wos(e,t){let{transform:n,layer:o,colorMap:r}=t,{layer:i="top"}=e;if(o&&i!==o)return[];if(e.shape!=="brep")return[];let s=i==="bottom"?r.silkscreen.bottom:r.silkscreen.top,a=fBe(e.brep_shape.outer_ring.vertices,n);for(let c of e.brep_shape.inner_rings??[])a+=` ${fBe(c.vertices,n)}`;return[{name:"path",type:"element",attributes:{class:`pcb-silkscreen pcb-silkscreen-${i}`,d:a,fill:s,"fill-rule":"evenodd",stroke:"none","data-pcb-component-id":e.pcb_component_id,"data-pcb-silkscreen-graphic-id":e.pcb_silkscreen_graphic_id,"data-type":"pcb_silkscreen_graphic","data-pcb-layer":i},value:"",children:[]}]}function v0o(e){let{text:t,anchorAlignment:n,fontSize:o,charAdvance:r,spaceAdvance:i,trailingSpacing:s,lineHeight:a,mapSegment:c}=e,l=t.split(`
`),h=l.length*a,d=l.map((f)=>Xos(f,r,i,s)),u=[],_=-h/2;for(let f=0;f<l.length;f++){let y=l[f]??"",C=-(d[f]??0)/2;for(let b of y){if(b===" "){C+=i;continue}let I=Ax[b];if(I)for(let v of I)u.push(c(v,C,_,o));C+=r}_+=a}let p=jos(u);if(!p)return{pathData:"",bounds:null};let m=Ygt(n,p),A=qos(u,m),g=Jos(p,m);return{pathData:Zos(A),bounds:g}}function Xos(e,t,n,o){let r=0;for(let i of e)r+=i===" "?n:t;return r>0?r-o:0}function jos(e){if(e.length===0)return null;let{POSITIVE_INFINITY:t,POSITIVE_INFINITY:n,NEGATIVE_INFINITY:o,NEGATIVE_INFINITY:r}=Number;for(let i of e)t=Math.min(t,i.x1,i.x2),n=Math.min(n,i.y1,i.y2),o=Math.max(o,i.x1,i.x2),r=Math.max(r,i.y1,i.y2);return{minX:t,minY:n,maxX:o,maxY:r}}function Ygt(e,t){return{x:-Kos(e,t),y:-$os(e,t)}}function Kos(e,t){if(e==="top_left"||e==="center_left"||e==="bottom_left")return t.minX;if(e==="top_right"||e==="center_right"||e==="bottom_right")return t.maxX;return(t.minX+t.maxX)/2}function $os(e,t){if(e==="top_left"||e==="top_center"||e==="top_right")return t.minY;if(e==="bottom_left"||e==="bottom_center"||e==="bottom_right")return t.maxY;return(t.minY+t.maxY)/2}function qos(e,t){if(t.x===0&&t.y===0)return e;return e.map((n)=>({x1:n.x1+t.x,y1:n.y1+t.y,x2:n.x2+t.x,y2:n.y2+t.y}))}function Jos(e,t){return{minX:e.minX+t.x,minY:e.minY+t.y,maxX:e.maxX+t.x,maxY:e.maxY+t.y}}function Zos(e){return e.map((t)=>`M${t.x1} ${t.y1}L${t.x2} ${t.y2}`).join(" ")}var S0o=0.94,oBe=0.045,fpo=Object.fromEntries(Object.entries(Ax).map(([e,t])=>{let n=t.flatMap((r)=>[r.x1,r.x2]),o=t.flatMap((r)=>[r.y1,r.y2]);return[e,t.length?{minX:Math.min(...n)-oBe,maxX:Math.max(...n)+oBe,minY:-(Math.max(...o)+oBe)*S0o,maxY:-(Math.min(...o)-oBe)*S0o}:null]})),P0o=Math.round(Math.max(...Object.values(fpo).map((e)=>e?e.maxX-e.minX:0))*1000)/1000;function ers(e,t){let n=null,r=e.split(`
`).map((i,s)=>{let a=Array.from(i),c=-(a.length*P0o*t)/2,l=s*t*1.1;return a.forEach((h,d)=>{let u=fpo[h];if(!u)return;let _=c+d*P0o*t,p={minX:_+u.minX*t,maxX:_+u.maxX*t,minY:l+u.minY*t,maxY:l+u.maxY*t};n=n?{minX:Math.min(n.minX,p.minX),maxX:Math.max(n.maxX,p.maxX),minY:Math.min(n.minY,p.minY),maxY:Math.max(n.maxY,p.maxY)}:p}),{name:"tspan",type:"element",value:"",attributes:{x:c.toString(),y:l.toString()},children:[{name:"",type:"text",value:i,attributes:{},children:[]}]}});return{bounds:n,textNode:{name:"text",type:"element",value:"",attributes:{"font-family":s_e,"font-size":t.toString(),"text-anchor":"start","dominant-baseline":"alphabetic","xml:space":"preserve",fill:"black",stroke:"none"},children:r}}}var trs=0;function nrs(e,t){let{transform:n,layer:o,colorMap:r}=t,{anchor_position:i,text:s,font_size:a=1,layer:c="top",ccw_rotation:l=0,anchor_alignment:h="center",is_knockout:d=!1,knockout_padding:u,is_mirrored:_=!1}=e;if(o&&c!==o)return[];if(!i||typeof i.x!=="number"||typeof i.y!=="number")return Tm(`[pcb_silkscreen_text] Invalid anchor_position for "${e.pcb_silkscreen_text_id}": expected {x: number, y: number}, got ${JSON.stringify(i)}`),[];if(!s)return[];let[p,m]=GA.applyToPoint(n,[i.x,i.y]),A=Math.abs(n.a),g=c==="bottom"?r.silkscreen.bottom:r.silkscreen.top,y=c==="bottom"?!0:_===!0;if(d){let M=ers(s,a);if(!M.bounds)return[];let B=u?.left??a*0.5,T=u?.right??a*0.5,N=u?.top??a*0.3,D=u?.bottom??a*0.3,L=M.bounds.minX-B,H=M.bounds.minY-N,V=M.bounds.maxX-M.bounds.minX+B+T,O=M.bounds.maxY-M.bounds.minY+N+D,U={minX:L,minY:H,maxX:L+V,maxY:H+O},j=Ygt(h,U),Y=L+j.x,X=H+j.y,K=[{name:"rect",type:"element",value:"",attributes:{x:L.toString(),y:H.toString(),width:V.toString(),height:O.toString(),fill:"white"},children:[]},M.textNode],ee=j.x!==0||j.y!==0?[{name:"g",type:"element",value:"",attributes:{transform:`translate(${j.x} ${j.y})`},children:K}]:K,se=GA.toString(GA.compose(GA.translate(p,m),GA.rotate(-l*Math.PI/180),...y?[GA.scale(-1,1)]:[],GA.scale(A,A))),ne=`silkscreen-knockout-mask-${e.pcb_silkscreen_text_id}-${trs++}`;return[{name:"defs",type:"element",value:"",children:[{name:"mask",type:"element",value:"",attributes:{id:ne},children:ee}],attributes:{}},{name:"rect",type:"element",value:"",children:[],attributes:{x:Y.toString(),y:X.toString(),width:V.toString(),height:O.toString(),fill:g,mask:`url(#${ne})`,transform:se,class:`pcb-silkscreen-text-knockout pcb-silkscreen-${c}`,"data-type":"pcb_silkscreen_text","data-pcb-silkscreen-text-id":e.pcb_silkscreen_text_id,"data-pcb-layer":c}}]}let x=a*A,C="middle",b="central";switch(h){case"top_left":C="start",b="text-before-edge";break;case"top_center":C="middle",b="text-before-edge";break;case"top_right":C="end",b="text-before-edge";break;case"center_left":C="start",b="central";break;case"center_right":C="end",b="central";break;case"bottom_left":C="start",b="text-after-edge";break;case"bottom_center":C="middle",b="text-after-edge";break;case"bottom_right":C="end",b="text-after-edge";break;case"center":default:C="middle",b="central";break}let I=GA.compose(GA.translate(p,m),GA.rotate(-l*Math.PI/180),...y?[GA.scale(-1,1)]:[]),v=s.split(`
`),P=v.length===1?[{type:"text",value:s,name:"",attributes:{},children:[]}]:v.map((M,B)=>({type:"element",name:"tspan",value:"",attributes:{x:"0",...B>0?{dy:x.toString()}:{}},children:[{type:"text",value:M,name:"",attributes:{},children:[]}]}));return[{name:"text",type:"element",attributes:{x:"0",y:"0",dx:"0",dy:"0",fill:g,"font-family":s_e,"font-size":x.toString(),"text-anchor":C,"dominant-baseline":b,transform:GA.toString(I),class:`pcb-silkscreen-text pcb-silkscreen-${c}`,"data-pcb-silkscreen-text-id":e.pcb_silkscreen_text_id,stroke:"none","data-type":"pcb_silkscreen_text","data-pcb-layer":c},children:P,value:""}]}function ors(e,t){let{transform:n,layer:o,colorMap:r}=t,{center:i,width:s,height:a,layer:c="top",pcb_silkscreen_rect_id:l,stroke_width:h,is_filled:d,has_stroke:u,is_stroke_dashed:_,corner_radius:p,ccw_rotation:m=0}=e;if(o&&c!==o)return[];if(!i||typeof i.x!=="number"||typeof i.y!=="number"||typeof s!=="number"||typeof a!=="number")return Tm(`[pcb_silkscreen_rect] Invalid data for "${l}": expected center {x: number, y: number}, width: number, height: number, got center=${JSON.stringify(i)}, width=${JSON.stringify(s)}, height=${JSON.stringify(a)}`),[];let[A,g]=ypo.applyToPoint(n,[i.x,i.y]),f=typeof p==="number"&&p>0?p:0,y=f*Math.abs(n.a),x=f*Math.abs(n.d),C=s*Math.abs(n.a),b=a*Math.abs(n.d),I=h*Math.abs(n.a),v=c==="bottom"?r.silkscreen.bottom:r.silkscreen.top,P={x:(-C/2).toString(),y:(-b/2).toString(),width:C.toString(),height:b.toString(),class:`pcb-silkscreen-rect pcb-silkscreen-${c}`,"data-pcb-silkscreen-rect-id":l,"data-type":"pcb_silkscreen_rect","data-pcb-layer":c};if(typeof m==="number"&&m!==0)P.transform=`translate(${A} ${g}) rotate(${-m})`;else P.x=(A-C/2).toString(),P.y=(g-b/2).toString();if(y>0)P.rx=y.toString();if(x>0)P.ry=x.toString();P.fill=d?v:"none";let M;if(u===void 0)M=I>0;else M=u;if(M){if(P.stroke=v,P["stroke-width"]=I.toString(),_){let T=0.1*Math.abs(n.a),N=0.05*Math.abs(n.a);P["stroke-dasharray"]=`${T} ${N}`}}else P.stroke="none";return[{name:"rect",type:"element",attributes:P,value:"",children:[]}]}var ip={copper:{top:"rgb(200, 52, 52)",inner1:"rgb(255, 140, 0)",inner2:"rgb(255, 215, 0)",inner3:"rgb(50, 205, 50)",inner4:"rgb(64, 224, 208)",inner5:"rgb(138, 43, 226)",inner6:"rgb(255, 105, 180)",inner7:"rgb(0, 191, 255)",inner8:"rgb(160, 82, 45)",bottom:"rgb(77, 127, 196)"},soldermaskWithCopperUnderneath:{top:"rgb(18, 82, 50)",bottom:"rgb(18, 82, 50)"},soldermask:{top:"rgb(12, 55, 33)",bottom:"rgb(12, 55, 33)"},soldermaskOverCopper:{top:"rgb(52, 135, 73)",bottom:"rgb(52, 135, 73)"},substrate:"rgb(201, 162, 110)",drill:"#FF26E2",silkscreen:{top:"#f2eda1",bottom:"#5da9e9"},boardOutline:"rgba(255, 255, 255, 0.5)",courtyard:{top:"#FF00FF",bottom:"rgb(38, 233, 255)"},keepout:"#FF6B6B",debugComponent:{fill:null,stroke:null}},WBa=ip.drill,XBa=ip.silkscreen.top,jBa=ip.silkscreen.bottom,KBa={...ip.copper};function v5(e,t=ip){return t.copper[e]??"white"}var rrs={bottom:"rgb(105, 105, 105)",top:"rgb(105, 105, 105)"};function ane(e){return rrs[e]??"rgb(105, 105, 105)"}var rBe=1,cne=0.2,E0o=1.4,M0o=0.53,irs=0;function srs(e,t){let{transform:n,layer:o,colorMap:r}=t,{anchor_position:i,text:s,font_size:a="0.2mm",layer:c,ccw_rotation:l=0,anchor_alignment:h="center",is_knockout:d=!1,knockout_padding:u,is_mirrored:_=!1}=e,p=c??"top";if(o&&o!==p)return[];if(!i)return[];if(!s)return[];let[m,A]=Bg.applyToPoint(n,[i.x,i.y]),g=an.parse(a)??0.2,f=Math.abs(n.a),y=v5(p,r),C=p==="bottom"?!0:_===!0;if(d){let M=g*M0o,B=v0o({text:s,anchorAlignment:h,fontSize:M,charAdvance:(rBe+cne)*M,spaceAdvance:(rBe+cne)*M*0.6,trailingSpacing:cne*M,lineHeight:M*E0o,mapSegment:(te,ie,ce,ue)=>({x1:ie+te.x1*ue,y1:ce+(1-te.y1)*ue,x2:ie+te.x2*ue,y2:ce+(1-te.y2)*ue})});if(!B.bounds||!B.pathData)return[];let T=u?.left??M*0.5,N=u?.right??M*0.5,D=u?.top??M*0.3,L=u?.bottom??M*0.3,H=B.bounds.minX-T,V=B.bounds.minY-D,O=B.bounds.maxX-B.bounds.minX+T+N,U=B.bounds.maxY-B.bounds.minY+D+L,j=M*0.15,Y={minX:H,minY:V,maxX:H+O,maxY:V+U},X=Ygt(h,Y),K=H+X.x,J=V+X.y,ee=[{name:"rect",type:"element",value:"",attributes:{x:H.toString(),y:V.toString(),width:O.toString(),height:U.toString(),fill:"white"},children:[]},{name:"path",type:"element",value:"",attributes:{d:B.pathData,fill:"none",stroke:"black","stroke-width":j.toString(),"stroke-linecap":"round","stroke-linejoin":"round"},children:[]}],ne=X.x!==0||X.y!==0?[{name:"g",type:"element",value:"",attributes:{transform:`translate(${X.x} ${X.y})`},children:ee}]:ee,re=Bg.toString(Bg.compose(Bg.translate(m,A),Bg.rotate(-l*Math.PI/180),...C?[Bg.scale(-1,1)]:[],Bg.scale(f,f))),Z=`knockout-mask-${e.pcb_copper_text_id}-${irs++}`;return[{name:"defs",type:"element",value:"",children:[{name:"mask",type:"element",value:"",attributes:{id:Z},children:ne}],attributes:{}},{name:"rect",type:"element",value:"",children:[],attributes:{x:K.toString(),y:J.toString(),width:O.toString(),height:U.toString(),fill:y,mask:`url(#${Z})`,transform:re,class:`pcb-copper-text-knockout pcb-copper-${p}`,"data-type":"pcb_copper_text","data-pcb-copper-text-id":e.pcb_copper_text_id}}]}let b=g*M0o,I=v0o({text:s,anchorAlignment:h,fontSize:b,charAdvance:(rBe+cne)*b,spaceAdvance:(rBe+cne)*b*0.6,trailingSpacing:cne*b,lineHeight:b*E0o,mapSegment:(M,B,T,N)=>({x1:B+M.x1*N,y1:T+(1-M.y1)*N,x2:B+M.x2*N,y2:T+(1-M.y2)*N})});if(!I.pathData)return[];let v=Bg.toString(Bg.compose(Bg.translate(m,A),Bg.rotate(-l*Math.PI/180),...C?[Bg.scale(-1,1)]:[],Bg.scale(f,f))),P=b*0.15;return[{name:"path",type:"element",attributes:{d:I.pathData,fill:"none",stroke:y,"stroke-width":P.toString(),"stroke-linecap":"round","stroke-linejoin":"round",transform:v,class:`pcb-copper-text pcb-copper-${p}`,"data-type":"pcb_copper_text","data-pcb-copper-text-id":e.pcb_copper_text_id},children:[],value:""}]}function ars(e,t){let{transform:n,layer:o,colorMap:r}=t,{center:i,radius:s,layer:a="top",pcb_silkscreen_circle_id:c,stroke_width:l=1,is_filled:h}=e;if(o&&a!==o)return[];if(!i||typeof i.x!=="number"||typeof i.y!=="number"||typeof s!=="number")return console.error("Invalid PCB Silkscreen Circle data:",{center:i,radius:s}),[];let[d,u]=xpo.applyToPoint(n,[i.x,i.y]),_=s*Math.abs(n.a),p=l*Math.abs(n.a),m=a==="bottom"?r.silkscreen.bottom:r.silkscreen.top;return[{name:"circle",type:"element",attributes:{cx:d.toString(),cy:u.toString(),r:_.toString(),class:`pcb-silkscreen-circle pcb-silkscreen-${a}`,fill:h?m:"none",stroke:m,"stroke-width":p.toString(),"data-pcb-silkscreen-circle-id":c,"data-type":"pcb_silkscreen_circle","data-pcb-layer":a},value:"",children:[]}]}function crs(e,t){let{transform:n,layer:o,colorMap:r}=t,{x1:i,y1:s,x2:a,y2:c,stroke_width:l,layer:h="top",pcb_silkscreen_line_id:d}=e;if(o&&h!==o)return[];if(typeof i!=="number"||typeof s!=="number"||typeof a!=="number"||typeof c!=="number")return Tm(`[pcb_silkscreen_line] Invalid coordinates for "${d}": expected x1, y1, x2, y2 as numbers, got x1=${JSON.stringify(i)}, y1=${JSON.stringify(s)}, x2=${JSON.stringify(a)}, y2=${JSON.stringify(c)}`),[];let[u,_]=Rgt.applyToPoint(n,[i,s]),[p,m]=Rgt.applyToPoint(n,[a,c]),A=l*Math.abs(n.a),g=h==="bottom"?r.silkscreen.bottom:r.silkscreen.top;return[{name:"line",type:"element",attributes:{x1:u.toString(),y1:_.toString(),x2:p.toString(),y2:m.toString(),stroke:g,"stroke-width":A.toString(),class:`pcb-silkscreen-line pcb-silkscreen-${h}`,"data-pcb-silkscreen-line-id":d,"data-type":"pcb_silkscreen_line","data-pcb-layer":h},value:"",children:[]}]}function lrs(e,t){let{transform:n,layer:o,colorMap:r}=t,{center:i,width:s,height:a,layer:c="top",pcb_silkscreen_pill_id:l,ccw_rotation:h=0}=e;if(o&&c!==o)return[];let[d,u]=Cpo.applyToPoint(n,[i.x,i.y]),_=s*Math.abs(n.a),p=a*Math.abs(n.d),A=Math.min(s,a)/2,g=A*Math.abs(n.a),f=A*Math.abs(n.d),y=c==="bottom"?r.silkscreen.bottom:r.silkscreen.top;return[{name:"rect",type:"element",attributes:{x:(d-_/2).toString(),y:(u-p/2).toString(),width:_.toString(),height:p.toString(),rx:g.toString(),ry:f.toString(),fill:"none",stroke:y,"stroke-width":(0.1*Math.abs(n.a)).toString(),class:`pcb-silkscreen-pill pcb-silkscreen-${c}`,"data-pcb-silkscreen-pill-id":l,"data-type":"pcb_silkscreen_pill","data-pcb-layer":c,...h!==0&&{transform:`rotate(${-h} ${d} ${u})`}},value:"",children:[]}]}function hrs(e,t){let{transform:n,layer:o,colorMap:r}=t,{center:i,radius_x:s,radius_y:a,layer:c="top",pcb_silkscreen_oval_id:l,ccw_rotation:h=0}=e;if(o&&c!==o)return[];if(!i||typeof i.x!=="number"||typeof i.y!=="number"||typeof s!=="number"||typeof a!=="number")return Tm(`[pcb_silkscreen_oval] Invalid data for "${l}": expected center {x: number, y: number}, radius_x: number, radius_y: number, got center=${JSON.stringify(i)}, radius_x=${JSON.stringify(s)}, radius_y=${JSON.stringify(a)}`),[];let[d,u]=bpo.applyToPoint(n,[i.x,i.y]),_=s*Math.abs(n.a),p=a*Math.abs(n.d),m=c==="bottom"?r.silkscreen.bottom:r.silkscreen.top;return[{name:"ellipse",type:"element",attributes:{cx:d.toString(),cy:u.toString(),rx:_.toString(),ry:p.toString(),fill:"none",stroke:m,"stroke-width":(0.1*Math.abs(n.a)).toString(),class:`pcb-silkscreen-oval pcb-silkscreen-${c}`,"data-pcb-silkscreen-oval-id":l,"data-type":"pcb_silkscreen_oval","data-pcb-layer":c,...h!==0&&{transform:`rotate(${-h} ${d} ${u})`}},value:"",children:[]}]}function drs(e,t){let{transform:n,layer:o,colorMap:r}=t,{center:i,width:s,height:a,layer:c="top",pcb_courtyard_rect_id:l,ccw_rotation:h=0}=e;if(o&&c!==o)return[];if(!i||typeof i.x!=="number"||typeof i.y!=="number"||typeof s!=="number"||typeof a!=="number")return Tm(`[pcb_courtyard_rect] Invalid data for "${l}": expected center {x: number, y: number}, width: number, height: number, got center=${JSON.stringify(i)}, width=${JSON.stringify(s)}, height=${JSON.stringify(a)}`),[];let[d,u]=Ipo.applyToPoint(n,[i.x,i.y]),_=s*Math.abs(n.a),p=a*Math.abs(n.d),m=0.05*Math.abs(n.a),A=c==="bottom"?r.courtyard.bottom:r.courtyard.top,g={x:(-_/2).toString(),y:(-p/2).toString(),width:_.toString(),height:p.toString(),class:`pcb-courtyard-rect pcb-courtyard-${c}`,"data-pcb-courtyard-rect-id":l,"data-type":"pcb_courtyard_rect","data-pcb-layer":c,"stroke-linejoin":"round"};if(typeof h==="number"&&h!==0)g.transform=`translate(${d} ${u}) rotate(${-h})`;else g.x=(d-_/2).toString(),g.y=(u-p/2).toString();return g.fill="none",g.stroke=A,g["stroke-width"]=m.toString(),[{name:"rect",type:"element",attributes:g,value:"",children:[]}]}function urs(e,t){let{transform:n,layer:o,colorMap:r}=t,{layer:i="top",pcb_courtyard_polygon_id:s,points:a,color:c}=e;if(o&&i!==o)return[];if(!a||a.length===0)return Tm(`[pcb_courtyard_polygon] Invalid data for "${s}": expected non-empty array of points, got ${JSON.stringify(a)}`),[];let h=a.map((m)=>vpo.applyToPoint(n,[m.x,m.y])).map((m)=>`${m[0]},${m[1]}`).join(" "),d=0.05*Math.abs(n.a),u=c??(i==="bottom"?r.courtyard.bottom:r.courtyard.top);return[{name:"polygon",type:"element",attributes:{points:h,class:`pcb-courtyard-polygon pcb-courtyard-${i}`,"data-pcb-courtyard-polygon-id":s,"data-type":"pcb_courtyard_polygon","data-pcb-layer":i,fill:"none",stroke:u,"stroke-width":d.toString(),"stroke-linejoin":"round"},value:"",children:[]}]}function prs(e,t){let{transform:n,layer:o,colorMap:r}=t,{layer:i,pcb_courtyard_outline_id:s,outline:a}=e;if(o&&i!==o)return[];if(!a||a.length===0)return Tm(`[pcb_courtyard_outline] Invalid data for "${s}": expected non-empty array of points, got ${JSON.stringify(a)}`),[];let l=a.map((p)=>Spo.applyToPoint(n,[p.x,p.y])).map((p)=>`${p[0]},${p[1]}`).join(" "),h=0.05*Math.abs(n.a),d=i==="bottom"?r.courtyard.bottom:r.courtyard.top;return[{name:"polygon",type:"element",attributes:{points:l,class:`pcb-courtyard-outline pcb-courtyard-${i}`,"data-pcb-courtyard-outline-id":s,"data-type":"pcb_courtyard_outline","data-pcb-layer":i,fill:"none",stroke:d,"stroke-width":h.toString(),"stroke-linejoin":"round"},value:"",children:[]}]}function mrs(e,t){let{transform:n,layer:o,colorMap:r}=t,{center:i,radius:s,layer:a="top",pcb_courtyard_circle_id:c}=e;if(o&&a!==o)return[];if(!i||typeof i.x!=="number"||typeof i.y!=="number"||typeof s!=="number")return console.error(`[pcb_courtyard_circle] Invalid data for "${c}": expected center {x: number, y: number}, radius: number, got center=${JSON.stringify(i)}, radius=${JSON.stringify(s)}`),[];let[l,h]=Ppo.applyToPoint(n,[i.x,i.y]),d=s*Math.abs(n.a),u=0.05*Math.abs(n.a),_=a==="bottom"?r.courtyard.bottom:r.courtyard.top,p={cx:l.toString(),cy:h.toString(),r:d.toString(),class:`pcb-courtyard-circle pcb-courtyard-${a}`,"data-pcb-courtyard-circle-id":c,"data-type":"pcb_courtyard_circle","data-pcb-layer":a};return p.fill="none",p.stroke=_,p["stroke-width"]=u.toString(),[{name:"circle",type:"element",attributes:p,value:"",children:[]}]}var S5=0.000000001;function _rs(e,t){let{startIsInsideCopperPour:n,endIsInsideCopperPour:o,start:r,end:i}=e;if(n===o)return e;let s=sU(r),a=sU(i),c=Ars(t).flatMap((_)=>yrs(_,s,a));if(c.length===0)return e;let l=o?Math.min(...c):Math.max(...c),h=Mpo(s,a,l),d=grs(e.startWidth,e.endWidth,l),u={...e,start:n?h:r,end:o?h:i,startWidth:n?d:e.startWidth,endWidth:o?d:e.endWidth};return Crs(u.start,u.end)?null:u}function grs(e,t,n){return e+(t-e)*n}function Ars(e){switch(e.shape){case"rect":return[frs(e)];case"polygon":return[e.points.map(sU)];case"brep":return[e.brep_shape.outer_ring.vertices.map(B0o),...e.brep_shape.inner_rings.map((t)=>t.vertices.map(B0o))]}}function frs(e){let t=sU(e.center),n=e.width/2,o=e.height/2,r=(e.rotation??0)*Math.PI/180,i=Math.cos(r),s=Math.sin(r);return[{x:-n,y:-o},{x:n,y:-o},{x:n,y:o},{x:-n,y:o}].map((a)=>({x:t.x+a.x*i-a.y*s,y:t.y+a.x*s+a.y*i}))}function yrs(e,t,n){let o=[];for(let r=0;r<e.length;r++){let i=e[r],s=e[(r+1)%e.length];if(!i||!s)continue;if(i.bulge){o.push(...xrs(t,n,i,s,i.bulge));continue}let a=Epo(t,n,i,s);if(a!==null)o.push(a)}return o}function xrs(e,t,n,o,r){let i=o.x-n.x,s=o.y-n.y,a=Math.hypot(i,s);if(a<S5||Math.abs(r)<S5){let x=Epo(e,t,n,o);return x===null?[]:[x]}let c=a*(1-r**2)/(4*r),l={x:(n.x+o.x)/2-s/a*c,y:(n.y+o.y)/2+i/a*c},h=Math.atan2(n.y-l.y,n.x-l.x),d=4*Math.atan(r),u=Math.hypot(n.x-l.x,n.y-l.y),_={x:t.x-e.x,y:t.y-e.y},p={x:e.x-l.x,y:e.y-l.y},m=Cgt(_,_);if(m<S5)return[];let A=2*Cgt(p,_),g=Cgt(p,p)-u**2,f=A**2-4*m*g;if(f<-S5)return[];let y=Math.sqrt(Math.max(0,f));return[(-A-y)/(2*m),(-A+y)/(2*m)].filter((x)=>{if(x<-S5||x>1+S5)return!1;let C=Mpo(e,t,x),b=Math.atan2(C.y-l.y,C.x-l.x);return(d>0?w0o(b-h):w0o(h-b))<=Math.abs(d)+S5})}function Epo(e,t,n,o){let r={x:t.x-e.x,y:t.y-e.y},i={x:o.x-n.x,y:o.y-n.y},s=xgt(r,i);if(Math.abs(s)<S5)return null;let a={x:n.x-e.x,y:n.y-e.y},c=xgt(a,i)/s,l=xgt(a,r)/s;if(c<-S5||c>1+S5||l<-S5||l>1+S5)return null;return Math.min(1,Math.max(0,c))}function xgt(e,t){return e.x*t.y-e.y*t.x}function Cgt(e,t){return e.x*t.x+e.y*t.y}function w0o(e){let t=2*Math.PI,n=e%t;return n<0?n+t:n}function Mpo(e,t,n){return{x:e.x+(t.x-e.x)*n,y:e.y+(t.y-e.y)*n}}function sU(e){return{x:an.parse(e.x),y:an.parse(e.y)}}function B0o(e){return{...sU(e),bulge:e.bulge}}function Crs(e,t){let n=sU(e),o=sU(t);return Math.abs(n.x-o.x)<S5&&Math.abs(n.y-o.y)<S5}function brs(e){switch(e.route_type){case"through_pad":return[e.start,e.end];default:return[e]}}function Irs(e){let t=[];for(let n=0;n<e.length-1;n++){let o=e[n],r=e[n+1];if(!o||!r)continue;let i=o.route_type==="through_pad"?o.end:o,s=r.route_type==="through_pad"?r.start:r,a=o.route_type==="wire"?o.layer:o.route_type==="through_pad"?o.end_layer:r.route_type==="wire"?r.layer:r.route_type==="through_pad"?r.start_layer:null;if(!a)continue;if(vrs(i,s))continue;let c=T0o(o),l=T0o(r),h=bgt(o)??bgt(r)??0,d=bgt(r)??h;t.push({start:i,end:s,layer:a,width:h,startWidth:h,endWidth:d,isInsideCopperPour:c&&l,startIsInsideCopperPour:c,endIsInsideCopperPour:l,copperPourId:c?D0o(o):l?D0o(r):void 0})}for(let n of e){if(!n||n.route_type!=="through_pad")continue;for(let o of new Set([n.start_layer,n.end_layer]))t.push({start:n.start,end:n.end,layer:o,width:n.width,startWidth:n.width,endWidth:n.width,isInsideCopperPour:!1,startIsInsideCopperPour:!1,endIsInsideCopperPour:!1})}return t}function bgt(e){return"width"in e?an.parse(e.width):void 0}function T0o(e){return"is_inside_copper_pour"in e&&e.is_inside_copper_pour===!0}function D0o(e){if(!("copper_pour_id"in e))return;return e.copper_pour_id}function vrs(e,t){let n=an.parse(e.x),o=an.parse(e.y),r=an.parse(t.x),i=an.parse(t.y);return n===r&&o===i}function Srs(e){let t=[],n=[];for(let o=0;o<e.length;o++){let r=e[o];if(!r)continue;let i=Prs(e,o),s=Ggt(-i.y,i.x),a=r.width/2;t.push({x:r.x+s.x*a,y:r.y+s.y*a}),n.push({x:r.x-s.x*a,y:r.y-s.y*a})}return t.concat(n.reverse())}function Prs(e,t){if(e.length<2)return{x:1,y:0};if(t<=0)return iBe(e[0],e[1]);if(t>=e.length-1)return iBe(e[e.length-2],e[e.length-1]);let n=iBe(e[t-1],e[t]),o=iBe(e[t],e[t+1]),r=Ggt(n.x+o.x,n.y+o.y);if(r.x!==0||r.y!==0)return r;if(n.x!==0||n.y!==0)return n;if(o.x!==0||o.y!==0)return o;return{x:1,y:0}}function iBe(e,t){if(!e||!t)return{x:1,y:0};let n=Ggt(t.x-e.x,t.y-e.y);return n.x===0&&n.y===0?{x:1,y:0}:n}function Ggt(e,t){let n=Math.hypot(e,t);if(n<=Number.EPSILON)return{x:0,y:0};return{x:e/n,y:t/n}}function Bpo({elementType:e,shapeAttributes:t,layer:n,fillColor:o,fillOpacity:r,className:i,additionalAttributes:s}){let a={class:i,fill:o,"fill-opacity":r,"data-type":"pcb_soldermask","data-pcb-layer":n,...t,...s};return{name:e,type:"element",value:"",children:[],attributes:a}}function Tpo(e,t){let{transform:n,colorMap:o}=t,r=t.layer??"top",i=t.showSolderMask&&(r==="top"||r==="bottom");if(i&&!e.layers.includes(r))return[];let s=t.boardOwnerMap?.has(e.pcb_via_id)?e.pcb_via_id:e.pcb_trace_id??e.pcb_via_id,a=t.boardOwnerMap?.get(s),c=e,l=(r==="top"?c.tented_on_top:c.tented_on_bottom)??c.is_tented??(r==="top"?a?.default_via_tented_on_top:a?.default_via_tented_on_bottom),[h,d]=wpo.applyToPoint(n,[e.x,e.y]),u=e.outer_diameter*Math.abs(n.a),_=e.outer_diameter*Math.abs(n.a),p=e.hole_diameter*Math.abs(n.a),m=e.hole_diameter*Math.abs(n.a),A=Math.min(u,_)/2,g=Math.min(p,m)/2,f={name:"g",type:"element",value:"",attributes:{"data-type":"pcb_via","data-pcb-layer":i&&l?r:"through"},children:[{name:"circle",type:"element",value:"",children:[],attributes:{class:"pcb-hole-outer",fill:o.copper[i?r:"top"],cx:h.toString(),cy:d.toString(),r:A.toString(),"data-type":"pcb_via","data-pcb-layer":i?r:"top"}},{name:"circle",type:"element",value:"",children:[],attributes:{class:"pcb-hole-inner",fill:o.drill,cx:h.toString(),cy:d.toString(),r:g.toString(),"data-type":"pcb_via","data-pcb-layer":"drill"}}]};if(i&&l)f.children.push(Bpo({elementType:"circle",shapeAttributes:{cx:h.toString(),cy:d.toString(),r:A.toString()},layer:r,fillColor:o.soldermaskWithCopperUnderneath[r],fillOpacity:"1",className:"pcb-via-tenting"}));return[f]}function Dpo(e,t){if(e.shape==="rect"){let[n,o]=lv.applyToPoint(t,[e.center.x,e.center.y]),r=e.width*Math.abs(t.a),i=e.height*Math.abs(t.d),s=-(e.rotation??0);return{elementType:"rect",shapeAttributes:{x:(-r/2).toString(),y:(-i/2).toString(),width:r.toString(),height:i.toString(),transform:lv.toString(lv.compose(lv.translate(n,o),lv.rotate(s*Math.PI/180)))}}}if(e.shape==="polygon"){if(!e.points||e.points.length===0)return null;return{elementType:"polygon",shapeAttributes:{points:e.points.map((o)=>lv.applyToPoint(t,[o.x,o.y])).map((o)=>`${o[0]},${o[1]}`).join(" ")}}}if(e.shape==="brep"){let{brep_shape:n}=e,o=fBe(n.outer_ring.vertices,t);for(let r of n.inner_rings??[])o+=` ${fBe(r.vertices,t)}`;return{elementType:"path",shapeAttributes:{d:o,"fill-rule":"evenodd"}}}return null}function Npo(e){return`copper-pour-trace-mask-${e}`.replace(/[^a-zA-Z0-9_-]/g,"_")}function Ers({layer:e,circuitJson:t}){for(let n of t){if(n.type!=="pcb_copper_pour")continue;if(n.layer!==e)continue;return Npo(e)}return}function Mrs({circuitJson:e,transform:t,svgWidth:n,svgHeight:o,usedMaskIds:r}){if(r.size===0)return null;let i=new Map;for(let a of e){if(a.type!=="pcb_copper_pour")continue;let c=a,l=Npo(c.layer);if(!r.has(l))continue;let h=i.get(l);if(h)h.push(c);else i.set(l,[c])}if(i.size===0)return null;let s=[];for(let[a,c]of i){let l=[{name:"rect",type:"element",value:"",children:[],attributes:{x:"0",y:"0",width:n.toString(),height:o.toString(),fill:"#fff"}}];for(let h of c){let d=Dpo(h,t);if(!d)continue;l.push({name:d.elementType,type:"element",value:"",children:[],attributes:{...d.shapeAttributes,fill:"#000"}})}s.push({name:"mask",type:"element",value:"",children:l,attributes:{id:a,maskUnits:"userSpaceOnUse",x:"0",y:"0",width:n.toString(),height:o.toString()}})}return{name:"defs",type:"element",value:"",children:s,attributes:{class:"copper-pour-trace-mask-defs"}}}function wrs(e){let t=[],n=new Map;for(let o of e){let r=o.attributes?.["data-type"],i=o.attributes?.mask;if(!(r==="pcb_trace"||r==="pcb_trace_soldermask")||!i?.includes("#copper-pour-trace-mask-")){t.push(o);continue}let a=n.get(i);if(!a){let p={name:"g",type:"element",value:"",children:[],attributes:{class:"pcb-trace-mask-group",mask:i}};a={object:p,pathsByAttributes:new Map},n.set(i,a),t.push(p)}let{mask:c,d:l="",...h}=o.attributes,d=JSON.stringify(h),u=a.pathsByAttributes.get(d);if(u){u.attributes.d+=` ${l}`;continue}let _={...o,attributes:{...h,d:l}};a.pathsByAttributes.set(d,_),a.object.children.push(_)}return t}function Brs(e,t){let{transform:n,layer:o,colorMap:r,showSolderMask:i}=t;if(!e.route||!Array.isArray(e.route)||e.route.length<2)return[];let s=[],a=Lrs(t),c=new Map,l=[];for(let d of Irs(e.route)){let u=d;if(u.isInsideCopperPour)continue;if(u.copperPourId&&u.startIsInsideCopperPour!==u.endIsInsideCopperPour){let p=t.circuitJson?.find((m)=>m.type==="pcb_copper_pour"&&m.pcb_copper_pour_id===u.copperPourId);if(p){let m=_rs(u,p);if(!m)continue;u=m}}let _=u.layer;if(!_)continue;if(o&&_!==o)continue;l.push(u)}let h=(d)=>{if(!c.has(d))c.set(d,t.circuitJson?Ers({layer:d,circuitJson:t.circuitJson}):void 0);let u=c.get(d);if(u)return t.usedCopperPourTraceMaskIds?.add(u),{mask:`url(#${u})`};return{}};if(e.route_thickness_mode==="interpolated")for(let d of Trs(l)){let u=d[0]?.layer;if(!u)continue;let _=Drs(d,n);if(!_)continue;let p=v5(u,r),m=r.soldermaskWithCopperUnderneath[u];s.push({name:"path",type:"element",value:"",children:[],attributes:{class:i?"pcb-soldermask":"pcb-trace",fill:i?m:p,stroke:"none",d:_,"shape-rendering":"geometricPrecision","data-type":i?"pcb_trace_soldermask":"pcb_trace","data-pcb-layer":u,...h(u)}})}else for(let d of l){let u=yBe.applyToPoint(n,[d.start.x,d.start.y]),_=yBe.applyToPoint(n,[d.end.x,d.end.y]),p=d.layer,m=v5(p,r),A=r.soldermaskWithCopperUnderneath[p],g=d.width?(d.width*Math.abs(n.a)).toString():"0.3",f=h(p);if(i){let y={name:"path",type:"element",value:"",children:[],attributes:{class:"pcb-soldermask",stroke:A,fill:"none",d:`M ${u[0]} ${u[1]} L ${_[0]} ${_[1]}`,"stroke-width":g,"stroke-linecap":"round","stroke-linejoin":"round","shape-rendering":"crispEdges","data-type":"pcb_trace_soldermask","data-pcb-layer":p,...f}};s.push(y)}else{let y={name:"path",type:"element",value:"",children:[],attributes:{class:"pcb-trace",stroke:m,fill:"none",d:`M ${u[0]} ${u[1]} L ${_[0]} ${_[1]}`,"stroke-width":g,"stroke-linecap":"round","stroke-linejoin":"round","shape-rendering":"crispEdges","data-type":"pcb_trace","data-pcb-layer":p,...f}};s.push(y)}}for(let[d,u]of e.route.entries()){if(!u||u.route_type!=="via")continue;if(a.has(Rpo(u)))continue;s.push(...Tpo(Rrs(e,u,d,t),t))}return s}function Trs(e){let t=[];for(let n of e){let o=t[t.length-1],r=o?.[o.length-1];if(o&&r?.layer===n.layer&&Nrs(r.end,n.start))o.push(n);else t.push([n])}return t}function Drs(e,t){let n=e[0];if(!n)return"";let o=[{x:an.parse(n.start.x),y:an.parse(n.start.y),width:n.startWidth},...e.map((c)=>({x:an.parse(c.end.x),y:an.parse(c.end.y),width:c.endWidth}))],i=Srs(o).map((c)=>yBe.applyToPoint(t,[c.x,c.y])),[s,...a]=i;if(!s)return"";return[`M ${s[0]} ${s[1]}`,...a.map((c)=>`L ${c[0]} ${c[1]}`),"Z"].join(" ")}function Nrs(e,t){return an.parse(e.x)===an.parse(t.x)&&an.parse(e.y)===an.parse(t.y)}function Rrs(e,t,n,o){let r=Qrs(e.route,n),i=o.boardOwnerMap?.get(e.pcb_trace_id),{holeDiameter:s,outerDiameter:a}=krs(i,r);return{type:"pcb_via",pcb_via_id:`${e.pcb_trace_id}_route_via_${n}`,pcb_trace_id:e.pcb_trace_id,subcircuit_id:e.subcircuit_id,pcb_group_id:e.pcb_group_id,x:t.x,y:t.y,outer_diameter:a,hole_diameter:s,layers:[t.from_layer,t.to_layer],tented_on_top:t.tented_on_top,tented_on_bottom:t.tented_on_bottom}}function Qrs(e,t){let n=N0o(e,t,-1),o=N0o(e,t,1);return Math.max(n??0,o??0)}function N0o(e,t,n){for(let o=t+n;o>=0&&o<e.length;o+=n){let r=e[o];if(!r||!("width"in r)||typeof r.width!=="number")continue;return r.width}return}function krs(e,t){let n=xBe(e?.min_via_hole_diameter),o=xBe(e?.min_via_pad_diameter),r=Math.max(t,0.3),i=Math.max(r*2,0.6);return{holeDiameter:n??r,outerDiameter:o??i}}function Lrs(e){return new Set(e.circuitJson?.filter((t)=>t.type==="pcb_via").map((t)=>Rpo(t))??[])}function Rpo(e){let t=xBe(e.x),n=xBe(e.y);if(t!==void 0&&n!==void 0)return`${t}:${n}`;return`${String(e.x)}:${String(e.y)}`}function xBe(e){if(e===null||e===void 0)return;let t=an.safeParse(e);return t.success?t.data:void 0}function Hrs(e,t){let{transform:n,layer:o,colorMap:r,showSolderMask:i}=t;if(o&&e.layer!==o)return[];let s=mpo(e,t.circuitJson),a=Boolean(e?.is_covered_with_solder_mask),c=i&&a,l=r.soldermaskWithCopperUnderneath[e.layer]??r.soldermaskWithCopperUnderneath.top,h=(e.soldermask_margin??0)*Math.abs(n.a);if(e.shape==="rect"||e.shape==="rotated_rect"){let d=e.width*Math.abs(n.a),u=e.height*Math.abs(n.d),[_,p]=qme.applyToPoint(n,[e.x,e.y]),A=(e.corner_radius??e.rect_border_radius??0)*Math.abs(n.a),g={left:(e.soldermask_margin_left??e.soldermask_margin??0)*Math.abs(n.a),right:(e.soldermask_margin_right??e.soldermask_margin??0)*Math.abs(n.a),top:(e.soldermask_margin_top??e.soldermask_margin??0)*Math.abs(n.a),bottom:(e.soldermask_margin_bottom??e.soldermask_margin??0)*Math.abs(n.a)},f=g.left<0||g.right<0||g.top<0||g.bottom<0,y=g.left===0&&g.right===0&&g.top===0&&g.bottom===0;if(e.shape==="rotated_rect"&&e.ccw_rotation){let P={name:"rect",type:"element",value:"",children:[],attributes:{class:"pcb-pad",fill:v5(e.layer,r),x:(-d/2).toString(),y:(-u/2).toString(),width:d.toString(),height:u.toString(),transform:`translate(${_} ${p}) rotate(${-e.ccw_rotation})`,"data-type":"pcb_smtpad","data-pcb-layer":e.layer,...s,...A?{rx:A.toString(),ry:A.toString()}:{}}};if(!c)return[P];let M=d+g.left+g.right,B=u+g.top+g.bottom,T=A?A+h:0;if(f){let D={name:"rect",type:"element",value:"",children:[],attributes:{class:"pcb-pad-covered",fill:l,x:(-d/2).toString(),y:(-u/2).toString(),width:d.toString(),height:u.toString(),transform:`translate(${_} ${p}) rotate(${-e.ccw_rotation})`,"data-type":"pcb_smtpad","data-pcb-layer":e.layer,...A?{rx:A.toString(),ry:A.toString()}:{}}},L={name:"rect",type:"element",value:"",children:[],attributes:{class:"pcb-pad-exposed",fill:v5(e.layer,r),x:(-d/2-g.left).toString(),y:(-u/2-g.top).toString(),width:M.toString(),height:B.toString(),transform:`translate(${_} ${p}) rotate(${-e.ccw_rotation})`,"data-type":"pcb_soldermask","data-pcb-layer":e.layer,...T>0?{rx:T.toString(),ry:T.toString()}:{}}};return[D,L]}if(y)return[{name:"rect",type:"element",value:"",children:[],attributes:{class:"pcb-pad-covered",fill:l,x:(-d/2).toString(),y:(-u/2).toString(),width:d.toString(),height:u.toString(),transform:`translate(${_} ${p}) rotate(${-e.ccw_rotation})`,"data-type":"pcb_smtpad","data-pcb-layer":e.layer,...A?{rx:A.toString(),ry:A.toString()}:{}}}];return[{name:"rect",type:"element",value:"",children:[],attributes:{class:"pcb-soldermask-cutout",fill:r.substrate,x:(-d/2-g.left).toString(),y:(-u/2-g.top).toString(),width:M.toString(),height:B.toString(),transform:`translate(${_} ${p}) rotate(${-e.ccw_rotation})`,...T>0?{rx:T.toString(),ry:T.toString()}:{},"data-type":"pcb_soldermask_opening","data-pcb-layer":e.layer}},P]}let x={name:"rect",type:"element",value:"",children:[],attributes:{class:"pcb-pad",fill:v5(e.layer,r),x:(_-d/2).toString(),y:(p-u/2).toString(),width:d.toString(),height:u.toString(),"data-type":"pcb_smtpad","data-pcb-layer":e.layer,...s,...A?{rx:A.toString(),ry:A.toString()}:{}}};if(!c)return[x];let C=d+g.left+g.right,b=u+g.top+g.bottom,I=A?A+h:0;if(f){let P={name:"rect",type:"element",value:"",children:[],attributes:{class:"pcb-pad-covered",fill:l,x:(_-d/2).toString(),y:(p-u/2).toString(),width:d.toString(),height:u.toString(),"data-type":"pcb_smtpad","data-pcb-layer":e.layer,...A?{rx:A.toString(),ry:A.toString()}:{}}},M={name:"rect",type:"element",value:"",children:[],attributes:{class:"pcb-pad-exposed",fill:v5(e.layer,r),x:(_-d/2-g.left).toString(),y:(p-u/2-g.top).toString(),width:C.toString(),height:b.toString(),"data-type":"pcb_soldermask","data-pcb-layer":e.layer,...I>0?{rx:I.toString(),ry:I.toString()}:{}}};return[P,M]}if(y)return[{name:"rect",type:"element",value:"",children:[],attributes:{class:"pcb-pad-covered",fill:l,x:(_-d/2).toString(),y:(p-u/2).toString(),width:d.toString(),height:u.toString(),...I>0?{rx:A.toString(),ry:A.toString()}:{},"data-type":"pcb_smtpad","data-pcb-layer":e.layer}}];return[{name:"rect",type:"element",value:"",children:[],attributes:{class:"pcb-soldermask-cutout",fill:r.substrate,x:(_-d/2-g.left).toString(),y:(p-u/2-g.top).toString(),width:C.toString(),height:b.toString(),...I>0?{rx:I.toString(),ry:I.toString()}:{},"data-type":"pcb_soldermask_opening","data-pcb-layer":e.layer}},x]}if(e.shape==="pill"||e.shape==="rotated_pill"){let d=e.shape==="rotated_pill",u=e.width*Math.abs(n.a),_=e.height*Math.abs(n.d),p=e.radius*Math.abs(n.a),[m,A]=qme.applyToPoint(n,[e.x,e.y]),g=d?{transform:`translate(${m} ${A}) rotate(${-(e.ccw_rotation??0)})`}:void 0,f={class:"pcb-pad",fill:v5(e.layer,r),x:d?(-u/2).toString():(m-u/2).toString(),y:d?(-_/2).toString():(A-_/2).toString(),width:u.toString(),height:_.toString(),rx:p.toString(),ry:p.toString(),"data-type":"pcb_smtpad","data-pcb-layer":e.layer,...s,...g??{}},y={name:"rect",type:"element",value:"",children:[],attributes:f};if(!c)return[y];let x=u+2*h,C=_+2*h,b=p+h;if(h<0){let P={name:"rect",type:"element",value:"",children:[],attributes:{class:"pcb-pad-covered",fill:l,x:d?(-u/2).toString():(m-u/2).toString(),y:d?(-_/2).toString():(A-_/2).toString(),width:u.toString(),height:_.toString(),rx:p.toString(),ry:p.toString(),"data-type":"pcb_smtpad","data-pcb-layer":e.layer,...g??{}}},M={class:"pcb-pad-exposed",fill:v5(e.layer,r),x:d?(-x/2).toString():(m-x/2).toString(),y:d?(-C/2).toString():(A-C/2).toString(),width:x.toString(),height:C.toString(),rx:b.toString(),ry:b.toString(),"data-type":"pcb_soldermask","data-pcb-layer":e.layer,...g??{}};return[P,{name:"rect",type:"element",value:"",children:[],attributes:M}]}if(h===0)return[{name:"rect",type:"element",value:"",children:[],attributes:{class:"pcb-pad-covered",fill:l,x:d?(-u/2).toString():(m-u/2).toString(),y:d?(-_/2).toString():(A-_/2).toString(),width:u.toString(),height:_.toString(),rx:p.toString(),ry:p.toString(),"data-type":"pcb_smtpad","data-pcb-layer":e.layer,...g??{}}}];let I={class:"pcb-soldermask-cutout",fill:r.substrate,x:d?(-x/2).toString():(m-x/2).toString(),y:d?(-C/2).toString():(A-C/2).toString(),width:x.toString(),height:C.toString(),rx:b.toString(),ry:b.toString(),"data-type":"pcb_soldermask_opening","data-pcb-layer":e.layer,...g??{}};return[{name:"rect",type:"element",value:"",children:[],attributes:I},y]}if(e.shape==="circle"){let d=e.radius*Math.abs(n.a),[u,_]=qme.applyToPoint(n,[e.x,e.y]),p={name:"circle",type:"element",value:"",children:[],attributes:{class:"pcb-pad",fill:v5(e.layer,r),cx:u.toString(),cy:_.toString(),r:d.toString(),"data-type":"pcb_smtpad","data-pcb-layer":e.layer,...s}};if(!c)return[p];let m=d+h;if(h<0){let g={name:"circle",type:"element",value:"",children:[],attributes:{class:"pcb-pad-covered",fill:l,cx:u.toString(),cy:_.toString(),r:d.toString(),"data-type":"pcb_smtpad","data-pcb-layer":e.layer}},f={name:"circle",type:"element",value:"",children:[],attributes:{class:"pcb-pad-exposed",fill:v5(e.layer,r),cx:u.toString(),cy:_.toString(),r:m.toString(),"data-type":"pcb_soldermask","data-pcb-layer":e.layer}};return[g,f]}if(h===0)return[{name:"circle",type:"element",value:"",children:[],attributes:{class:"pcb-pad-covered",fill:l,cx:u.toString(),cy:_.toString(),r:d.toString(),"data-type":"pcb_smtpad","data-pcb-layer":e.layer}}];return[{name:"circle",type:"element",value:"",children:[],attributes:{class:"pcb-soldermask-cutout",fill:r.substrate,cx:u.toString(),cy:_.toString(),r:m.toString(),"data-type":"pcb_soldermask_opening","data-pcb-layer":e.layer}},p]}if(e.shape==="polygon"){let d=(e.points??[]).map((m)=>qme.applyToPoint(n,[m.x,m.y])),u={name:"polygon",type:"element",value:"",children:[],attributes:{class:"pcb-pad",fill:v5(e.layer,r),points:d.map((m)=>m.join(",")).join(" "),"data-type":"pcb_smtpad","data-pcb-layer":e.layer,...s}};if(!c)return[u];let _=d;if(h!==0){let m=d.reduce((g,f)=>g+f[0],0)/d.length,A=d.reduce((g,f)=>g+f[1],0)/d.length;_=d.map(([g,f])=>{let y=g-m,x=f-A,C=Math.sqrt(y*y+x*x);if(C===0)return[g,f];let b=y/C,I=x/C;return[g+b*h,f+I*h]})}if(h<0){let m={name:"polygon",type:"element",value:"",children:[],attributes:{class:"pcb-pad-covered",fill:l,points:d.map((g)=>g.join(",")).join(" "),"data-type":"pcb_smtpad","data-pcb-layer":e.layer}},A={name:"polygon",type:"element",value:"",children:[],attributes:{class:"pcb-pad-exposed",fill:v5(e.layer,r),points:_.map((g)=>g.join(",")).join(" "),"data-type":"pcb_soldermask","data-pcb-layer":e.layer}};return[m,A]}if(h===0)return[{name:"polygon",type:"element",value:"",children:[],attributes:{class:"pcb-pad-covered",fill:l,points:d.map((A)=>A.join(",")).join(" "),"data-type":"pcb_smtpad","data-pcb-layer":e.layer}}];return[{name:"polygon",type:"element",value:"",children:[],attributes:{class:"pcb-soldermask-cutout",fill:r.substrate,points:_.map((m)=>m.join(",")).join(" "),"data-type":"pcb_soldermask_opening","data-pcb-layer":e.layer}},u]}return[]}var R0o=0.05,R3=4,Q0o=8,Qpo=11,yne=1,gne=5,k0o=1.5,kpo=2,Igt=gne+2,vgt=kpo+2,Jme=gne+R3+6,Frs=15,zrs=10,Ors=0.2,Vrs=50;function Ugt(e){let{groupAnchorPosition:t,componentPosition:n,transform:o,componentWidth:r=0,componentHeight:i=0,displayXOffset:s,displayYOffset:a}=e,c=[],[l,h]=Qgt.applyToPoint(o,[t.x,t.y]),[d,u]=Qgt.applyToPoint(o,[n.x,n.y]),_=n.x-t.x,p=n.y-t.y,m=Math.abs(o.a),A=r*m,g=i*m;c.push(Grs(l,h));let f=Yrs(l,h,d,u);c.push({name:"line",type:"element",attributes:{x1:f.x1.toString(),y1:f.y1.toString(),x2:f.x2.toString(),y2:f.y2.toString(),stroke:"#ffffff","stroke-width":"0.5","stroke-dasharray":"3,3",opacity:"0.5",class:"anchor-offset-connector"},children:[],value:""}),c.push({name:"circle",type:"element",attributes:{cx:d.toString(),cy:u.toString(),r:kpo.toString(),fill:"#ffffff",opacity:"0.7",class:"anchor-offset-component-marker"},children:[],value:""});let y=Math.abs(u-h),x=Math.abs(d-l),C=Math.sqrt(x*x+y*y),b=g/2+Frs,I=Math.max(b,Math.min(Vrs,C*Ors)),v=p>0?u-I:u+I,P=A/2+zrs,M=_>0?d+P:d-P;if(sBe(v,h)||sBe(v,u)){let B=Math.min(h,u),T=Math.max(h,u),N=B-Jme,D=T+Jme;v=Math.abs(v-N)<Math.abs(v-D)?N:D}if(sBe(M,l)||sBe(M,d)){let B=Math.min(l,d),T=Math.max(l,d),N=B-Jme,D=T+Jme;M=Math.abs(M-N)<Math.abs(M-D)?N:D}if(Math.abs(_)>R0o)c.push(...Urs({startX:l,endX:d,y:v,offsetMm:_,offsetY:p,displayOffset:s}));if(Math.abs(p)>R0o)c.push(...Wrs({x:M,startY:h,endY:u,offsetMm:p,offsetX:_,displayOffset:a}));return c}function Yrs(e,t,n,o){let r=n-e,i=o-t,s=Math.hypot(r,i),a=Igt+vgt;if(!(s>a))return{x1:e,y1:t,x2:n,y2:o};let c=r/s,l=i/s;return{x1:e+c*Igt,y1:t+l*Igt,x2:n-c*vgt,y2:o-l*vgt}}function sBe(e,t){return Math.abs(e-t)<Jme}function Grs(e,t){return{name:"g",type:"element",attributes:{class:"anchor-offset-marker","data-type":"anchor_offset_marker"},children:[{name:"line",type:"element",attributes:{x1:e.toString(),y1:(t-gne).toString(),x2:e.toString(),y2:(t+gne).toString(),stroke:"#ffffff","stroke-width":k0o.toString(),"stroke-linecap":"round"},children:[],value:""},{name:"line",type:"element",attributes:{x1:(e-gne).toString(),y1:t.toString(),x2:(e+gne).toString(),y2:t.toString(),stroke:"#ffffff","stroke-width":k0o.toString(),"stroke-linecap":"round"},children:[],value:""}],value:""}}function Urs({startX:e,endX:t,y:n,offsetMm:o,offsetY:r,displayOffset:i}){let s=[];s.push({name:"line",type:"element",attributes:{x1:e.toString(),y1:n.toString(),x2:t.toString(),y2:n.toString(),stroke:"#ffffff","stroke-width":yne.toString(),class:"anchor-offset-dimension-x"},children:[],value:""}),s.push({name:"line",type:"element",attributes:{x1:e.toString(),y1:(n-R3).toString(),x2:e.toString(),y2:(n+R3).toString(),stroke:"#ffffff","stroke-width":yne.toString()},children:[],value:""}),s.push({name:"line",type:"element",attributes:{x1:t.toString(),y1:(n-R3).toString(),x2:t.toString(),y2:(n+R3).toString(),stroke:"#ffffff","stroke-width":yne.toString()},children:[],value:""});let a=(e+t)/2,c=r>0?n-R3-Q0o:n+R3+Q0o;return s.push({name:"text",type:"element",attributes:{x:a.toString(),y:c.toString(),fill:"#ffffff","font-size":Qpo.toString(),"font-family":"Arial, sans-serif","text-anchor":"middle","dominant-baseline":r>0?"baseline":"hanging",class:"anchor-offset-label"},children:[{type:"text",value:Lpo("X",o,i),name:"",attributes:{},children:[]}],value:""}),s}function Wrs({x:e,startY:t,endY:n,offsetMm:o,offsetX:r,displayOffset:i}){let s=[];s.push({name:"line",type:"element",attributes:{x1:e.toString(),y1:t.toString(),x2:e.toString(),y2:n.toString(),stroke:"#ffffff","stroke-width":yne.toString(),class:"anchor-offset-dimension-y"},children:[],value:""}),s.push({name:"line",type:"element",attributes:{x1:(e-R3).toString(),y1:t.toString(),x2:(e+R3).toString(),y2:t.toString(),stroke:"#ffffff","stroke-width":yne.toString()},children:[],value:""}),s.push({name:"line",type:"element",attributes:{x1:(e-R3).toString(),y1:n.toString(),x2:(e+R3).toString(),y2:n.toString(),stroke:"#ffffff","stroke-width":yne.toString()},children:[],value:""});let a=(t+n)/2,c=r<0?e-R3-4:e+R3+4;return s.push({name:"text",type:"element",attributes:{x:c.toString(),y:a.toString(),fill:"#ffffff","font-size":Qpo.toString(),"font-family":"Arial, sans-serif","text-anchor":r<0?"end":"start","dominant-baseline":"middle",class:"anchor-offset-label"},children:[{type:"text",value:Lpo("Y",o,i),name:"",attributes:{},children:[]}],value:""}),s}function Lpo(e,t,n){let o=typeof n==="string"?n:t.toFixed(2),i=typeof o==="string"&&o.trim().endsWith("mm")?"":"mm";return`${e}: ${o}${i}`}function n_e(e){let t=e?.anchor_position??e?.center;if(t&&typeof t.x==="number"&&typeof t.y==="number")return{x:t.x,y:t.y};return}function Xrs(e,t){let{transform:n,colorMap:o,showSolderMask:r,circuitJson:i}=t,{width:s,height:a,center:c,outline:l,position_mode:h,anchor_position:d,display_offset_x:u,display_offset_y:_}=e,p;if(l&&Array.isArray(l)&&l.length>=3)p=l.map((A,g)=>{let[f,y]=dne.applyToPoint(n,[A.x,A.y]);return g===0?`M ${f} ${y}`:`L ${f} ${y}`}).join(" ");else{let A=s/2,g=a/2,f=dne.applyToPoint(n,[c.x-A,c.y-g]),y=dne.applyToPoint(n,[c.x+A,c.y-g]),x=dne.applyToPoint(n,[c.x+A,c.y+g]),C=dne.applyToPoint(n,[c.x-A,c.y+g]);p=`M ${f[0]} ${f[1]} L ${y[0]} ${y[1]} L ${x[0]} ${x[1]} L ${C[0]} ${C[1]}`}p+=" Z";let m=[];if(r){let g=(t.layer??"top")==="bottom"?"soldermask-bottom":"soldermask-top";m.push({name:"path",type:"element",value:"",children:[],attributes:{class:"pcb-board-soldermask",d:p,fill:o.soldermask.top,"fill-opacity":"0.8",stroke:"none","data-type":"pcb_soldermask","data-pcb-layer":g}})}if(m.push({name:"path",type:"element",value:"",children:[],attributes:{class:"pcb-board",d:p,fill:"none",stroke:o.boardOutline,"stroke-width":(0.1*Math.abs(n.a)).toString(),"data-type":"pcb_board","data-pcb-layer":"board"}}),t.showAnchorOffsets&&i&&h==="relative_to_panel_anchor"){let A=i.find((g)=>g.type==="pcb_panel");if(A){let g=n_e(A);if(g)m.push(...Ugt({groupAnchorPosition:g,componentPosition:d??c,transform:n,componentWidth:s,componentHeight:a,displayXOffset:u,displayYOffset:_}))}}return m}function jrs(e,t){let{transform:n,colorMap:o,showSolderMask:r}=t,i=Number(e.width),s=Number(e.height),a=e.center??{x:i/2,y:s/2},c=i/2,l=s/2,h=Zme.applyToPoint(n,[a.x-c,a.y-l]),d=Zme.applyToPoint(n,[a.x+c,a.y-l]),u=Zme.applyToPoint(n,[a.x+c,a.y+l]),_=Zme.applyToPoint(n,[a.x-c,a.y+l]),p=`M ${h[0]} ${h[1]} L ${d[0]} ${d[1]} L ${u[0]} ${u[1]} L ${_[0]} ${_[1]} Z`,m=e.covered_with_solder_mask!==!1,A=Boolean(r&&m);return[{name:"path",type:"element",value:"",children:[],attributes:{class:"pcb-panel",d:p,fill:"none",stroke:o.boardOutline,"stroke-width":(0.1*Math.abs(n.a)).toString(),"data-type":"pcb_panel","data-pcb-layer":"board"}}]}function Krs(e,t){let{transform:n,colorMap:o,showSolderMask:r}=t,i=t.layer??"top",[s,a]=Hpo.applyToPoint(n,[e.x,e.y]),c=Boolean(e.is_covered_with_solder_mask),l=(e.soldermask_margin??0)*Math.abs(n.a),h=r&&c&&l!==0,d=o.soldermask.top;if(e.hole_shape==="circle"||e.hole_shape==="square"){let u=e.hole_diameter*Math.abs(n.a),_=u/2;if(e.hole_shape==="circle"){let g={name:"circle",type:"element",attributes:{class:"pcb-hole",cx:s.toString(),cy:a.toString(),r:_.toString(),fill:o.drill,"data-type":"pcb_hole","data-pcb-layer":"drill"},children:[],value:""};if(!h)return[g];let f=_+l;if(l<0){let x={name:"circle",type:"element",value:"",children:[],attributes:{class:"pcb-hole-covered",fill:d,cx:s.toString(),cy:a.toString(),r:_.toString(),"data-type":"pcb_hole","data-pcb-layer":"drill"}},C={name:"circle",type:"element",value:"",children:[],attributes:{class:"pcb-hole-exposed",fill:o.drill,cx:s.toString(),cy:a.toString(),r:f.toString(),"data-type":"pcb_soldermask","data-pcb-layer":"drill"}};return[x,C]}return[{name:"circle",type:"element",value:"",children:[],attributes:{class:"pcb-soldermask-cutout",fill:o.substrate,cx:s.toString(),cy:a.toString(),r:f.toString(),"data-type":"pcb_soldermask_opening","data-pcb-layer":i}},g]}let p={name:"rect",type:"element",attributes:{class:"pcb-hole",x:(s-_).toString(),y:(a-_).toString(),width:u.toString(),height:u.toString(),fill:o.drill,"data-type":"pcb_hole","data-pcb-layer":"drill"},children:[],value:""};if(!h)return[p];let m=u+2*l;if(l<0){let g={name:"rect",type:"element",value:"",children:[],attributes:{class:"pcb-hole-covered",fill:d,x:(s-_).toString(),y:(a-_).toString(),width:u.toString(),height:u.toString(),"data-type":"pcb_hole","data-pcb-layer":"drill"}},f={name:"rect",type:"element",value:"",children:[],attributes:{class:"pcb-hole-exposed",fill:o.drill,x:(s-m/2).toString(),y:(a-m/2).toString(),width:m.toString(),height:m.toString(),"data-type":"pcb_soldermask","data-pcb-layer":"drill"}};return[g,f]}return[{name:"rect",type:"element",value:"",children:[],attributes:{class:"pcb-soldermask-cutout",fill:o.substrate,x:(s-m/2).toString(),y:(a-m/2).toString(),width:m.toString(),height:m.toString(),"data-type":"pcb_soldermask_opening","data-pcb-layer":i}},p]}if(e.hole_shape==="oval"){let u=e.hole_width*Math.abs(n.a),_=e.hole_height*Math.abs(n.a),p=u/2,m=_/2,A={name:"ellipse",type:"element",attributes:{class:"pcb-hole",cx:s.toString(),cy:a.toString(),rx:p.toString(),ry:m.toString(),fill:o.drill,"data-type":"pcb_hole","data-pcb-layer":"drill"},children:[],value:""};if(!h)return[A];let g=p+l,f=m+l;if(l<0){let x={name:"ellipse",type:"element",value:"",children:[],attributes:{class:"pcb-hole-covered",fill:d,cx:s.toString(),cy:a.toString(),rx:p.toString(),ry:m.toString(),"data-type":"pcb_hole","data-pcb-layer":"drill"}},C={name:"ellipse",type:"element",value:"",children:[],attributes:{class:"pcb-hole-exposed",fill:o.drill,cx:s.toString(),cy:a.toString(),rx:g.toString(),ry:f.toString(),"data-type":"pcb_soldermask","data-pcb-layer":"drill"}};return[x,C]}return[{name:"ellipse",type:"element",value:"",children:[],attributes:{class:"pcb-soldermask-cutout",fill:o.substrate,cx:s.toString(),cy:a.toString(),rx:g.toString(),ry:f.toString(),"data-type":"pcb_soldermask_opening","data-pcb-layer":i}},A]}if(e.hole_shape==="rect"){let u=e.hole_width*Math.abs(n.a),_=e.hole_height*Math.abs(n.a),p={name:"rect",type:"element",attributes:{class:"pcb-hole",x:(s-u/2).toString(),y:(a-_/2).toString(),width:u.toString(),height:_.toString(),fill:o.drill,"data-type":"pcb_hole","data-pcb-layer":"drill"},children:[],value:""};if(!h)return[p];let m=u+2*l,A=_+2*l;if(l<0){let f={name:"rect",type:"element",value:"",children:[],attributes:{class:"pcb-hole-covered",fill:d,x:(s-u/2).toString(),y:(a-_/2).toString(),width:u.toString(),height:_.toString(),"data-type":"pcb_hole","data-pcb-layer":"drill"}},y={name:"rect",type:"element",value:"",children:[],attributes:{class:"pcb-hole-exposed",fill:o.drill,x:(s-m/2).toString(),y:(a-A/2).toString(),width:m.toString(),height:A.toString(),"data-type":"pcb_soldermask","data-pcb-layer":"drill"}};return[f,y]}return[{name:"rect",type:"element",value:"",children:[],attributes:{class:"pcb-soldermask-cutout",fill:o.substrate,x:(s-m/2).toString(),y:(a-A/2).toString(),width:m.toString(),height:A.toString(),"data-type":"pcb_soldermask_opening","data-pcb-layer":i}},p]}if(e.hole_shape==="pill"){let u=e.hole_width*Math.abs(n.a),_=e.hole_height*Math.abs(n.a),p=u>_,m=Math.min(u,_)/2,A=Math.abs(p?u-_:_-u),g=p?`M${s-A/2},${a-m} h${A} a${m},${m} 0 0 1 0,${_} h-${A} a${m},${m} 0 0 1 0,-${_} z`:`M${s-m},${a-A/2} v${A} a${m},${m} 0 0 0 ${u},0 v-${A} a${m},${m} 0 0 0 -${u},0 z`,f={name:"path",type:"element",attributes:{class:"pcb-hole",fill:o.drill,d:g,"data-type":"pcb_hole","data-pcb-layer":"drill"},children:[],value:""};if(!h)return[f];let y=u+2*l,x=_+2*l,C=y>x,b=Math.min(y,x)/2,I=Math.abs(C?y-x:x-y),v=C?`M${s-I/2},${a-b} h${I} a${b},${b} 0 0 1 0,${x} h-${I} a${b},${b} 0 0 1 0,-${x} z`:`M${s-b},${a-I/2} v${I} a${b},${b} 0 0 0 ${y},0 v-${I} a${b},${b} 0 0 0 -${y},0 z`;if(l<0){let M={name:"path",type:"element",value:"",children:[],attributes:{class:"pcb-hole-covered",fill:d,d:g,"data-type":"pcb_hole","data-pcb-layer":"drill"}},B={name:"path",type:"element",value:"",children:[],attributes:{class:"pcb-hole-exposed",fill:o.drill,d:v,"data-type":"pcb_soldermask","data-pcb-layer":"drill"}};return[M,B]}return[{name:"path",type:"element",value:"",children:[],attributes:{class:"pcb-soldermask-cutout",fill:o.substrate,d:v,"data-type":"pcb_soldermask_opening","data-pcb-layer":i}},f]}if(e.hole_shape==="rotated_pill"){let u=e.hole_width*Math.abs(n.a),_=e.hole_height*Math.abs(n.a),p="ccw_rotation"in e?e.ccw_rotation??0:0,m=u>_,A=Math.min(u,_)/2,g=Math.abs(m?u-_:_-u),f=m?`M${-g/2},${-A} h${g} a${A},${A} 0 0 1 0,${_} h-${g} a${A},${A} 0 0 1 0,-${_} z`:`M${-A},${-g/2} v${g} a${A},${A} 0 0 0 ${u},0 v-${g} a${A},${A} 0 0 0 -${u},0 z`,y={name:"path",type:"element",attributes:{class:"pcb-hole",fill:o.drill,d:f,transform:`translate(${s} ${a}) rotate(${-p})`,"data-type":"pcb_hole","data-pcb-layer":"drill"},children:[],value:""};if(!h)return[y];let x=u+2*l,C=_+2*l,b=x>C,I=Math.min(x,C)/2,v=Math.abs(b?x-C:C-x),P=b?`M${-v/2},${-I} h${v} a${I},${I} 0 0 1 0,${C} h-${v} a${I},${I} 0 0 1 0,-${C} z`:`M${-I},${-v/2} v${v} a${I},${I} 0 0 0 ${x},0 v-${v} a${I},${I} 0 0 0 -${x},0 z`;if(l<0){let B={name:"path",type:"element",value:"",children:[],attributes:{class:"pcb-hole-covered",fill:d,d:f,transform:`translate(${s} ${a}) rotate(${-p})`,"data-type":"pcb_hole","data-pcb-layer":"drill"}},T={name:"path",type:"element",value:"",children:[],attributes:{class:"pcb-hole-exposed",fill:o.drill,d:P,transform:`translate(${s} ${a}) rotate(${-p})`,"data-type":"pcb_soldermask","data-pcb-layer":"drill"}};return[B,T]}return[{name:"path",type:"element",value:"",children:[],attributes:{class:"pcb-soldermask-cutout",fill:o.substrate,d:P,"data-type":"pcb_soldermask_opening","data-pcb-layer":i}},y]}return[]}var $rs=(e,t)=>{let n=w_(t).pcb_smtpad.get(e);if(n&&"x"in n&&"y"in n)return{x:n.x,y:n.y};let o=w_(t).pcb_plated_hole.get(e);if(o&&"x"in o&&"y"in o)return{x:o.x,y:o.y};return null},qrs=(e,t,n,o)=>{let r=n.getIdsConnectedToNet(t),i=null,s=1/0;for(let a of r){let c=$rs(a,o);if(c){let l=e.x-c.x,h=e.y-c.y,d=Math.sqrt(l*l+h*h);if(d>0&&d<s)s=d,i=c}}return i};function Jrs(e,t){let{transform:n}=t,o=oa(e),r=e.filter((c)=>c.type==="pcb_port"),i=e.filter((c)=>c.type==="source_trace"),s=[];r.forEach((c,l)=>{let h=c.pcb_port_id;if(!h)return;let d=o.getNetConnectedToId(h);if(!d)return;let u=!1,_=w_(e).source_port.getWhere({pcb_port_id:h});if(_&&_.source_port_id){let A=_.source_port_id;for(let g of i)if(Array.isArray(g.connected_source_port_ids)&&g.connected_source_port_ids.includes(A)&&Array.isArray(g.connected_source_net_ids)&&g.connected_source_net_ids.length>0){u=!0;break}}let p={x:c.x,y:c.y},m=qrs(p,d,o,e);if(!m)return;s.push({key:`${h}-${l}`,startPoint:p,endPoint:m,isInNet:u})});let a=[];for(let c of s){let l=kgt.applyToPoint(n,[c.startPoint.x,c.startPoint.y]),h=kgt.applyToPoint(n,[c.endPoint.x,c.endPoint.y]),d={x1:l[0].toString(),y1:l[1].toString(),x2:h[0].toString(),y2:h[1].toString(),stroke:"white","stroke-width":"1","stroke-dasharray":"6,6","data-type":"pcb_rats_nest","data-pcb-layer":"overlay"};a.push({name:"line",type:"element",attributes:d,value:"",children:[]})}return a}function Zrs(e,t){let{transform:n,colorMap:o}=t;if(e.shape==="rect"){let r=e,[i,s]=s6.applyToPoint(n,[r.center.x,r.center.y]),a=r.width*Math.abs(n.a),c=r.height*Math.abs(n.d),l=-(r.rotation??0),{corner_radius:h}=r,d=typeof h==="number"&&h>0?h:0,u=d*Math.abs(n.a),_=d*Math.abs(n.d),p={class:"pcb-cutout pcb-cutout-rect",x:(-a/2).toString(),y:(-c/2).toString(),width:a.toString(),height:c.toString(),fill:o.drill,transform:s6.toString(s6.compose(s6.translate(i,s),s6.rotate(l*Math.PI/180))),"data-type":"pcb_cutout","data-pcb-layer":"drill"};if(u>0)p.rx=u.toString();if(_>0)p.ry=_.toString();return[{name:"rect",type:"element",attributes:p,children:[],value:""}]}if(e.shape==="circle"){let r=e,[i,s]=s6.applyToPoint(n,[r.center.x,r.center.y]),a=r.radius*Math.abs(n.a);return[{name:"circle",type:"element",attributes:{class:"pcb-cutout pcb-cutout-circle",cx:i.toString(),cy:s.toString(),r:a.toString(),fill:o.drill,"data-type":"pcb_cutout","data-pcb-layer":"drill"},children:[],value:""}]}if(e.shape==="polygon"){let r=e;if(!r.points||r.points.length===0)return[];return[{name:"polygon",type:"element",attributes:{class:"pcb-cutout pcb-cutout-polygon",points:r.points.map((a)=>s6.applyToPoint(n,[a.x,a.y])).map((a)=>`${a[0]},${a[1]}`).join(" "),fill:o.drill,"data-type":"pcb_cutout","data-pcb-layer":"drill"},children:[],value:""}]}return[]}function eis(e,t){let{transform:n,colorMap:o}=t;if(!e.route||!Array.isArray(e.route))return[];let r=e.route[0],i=e.route[e.route.length-1],s=r&&i&&r.x===i.x&&r.y===i.y;return[{name:"path",type:"element",attributes:{class:"pcb-cutout pcb-cutout-path",d:e.route.slice(0,s?-1:void 0).map((c,l)=>{let[h,d]=Fpo.applyToPoint(n,[c.x,c.y]);return l===0?`M ${h} ${d}`:`L ${h} ${d}`}).join(" ")+(s?" Z":""),fill:o.drill,"data-type":"pcb_cutout_path","data-pcb-cutout-id":e.pcb_cutout_id,"data-pcb-layer":"drill"},value:"",children:[]}]}var zpo="pcb-keepout-pattern",Ane=20,tis=5,L0o="rgba(255, 107, 107, 0.2)";function nis(e){let t=[];for(let n=-Ane;n<=Ane;n+=tis)t.push({name:"line",type:"element",value:"",attributes:{x1:n.toString(),y1:"0",x2:(n+Ane).toString(),y2:Ane.toString(),stroke:e,"stroke-width":"1"},children:[]});return t}function ois(e){return{name:"defs",type:"element",value:"",attributes:{},children:[{name:"pattern",type:"element",value:"",attributes:{id:zpo,width:Ane.toString(),height:Ane.toString(),patternUnits:"userSpaceOnUse"},children:nis(e)}]}}function H0o(e,t,n,o){let r={class:`pcb-keepout ${n} pcb-keepout-background`,"data-type":"pcb_keepout","data-pcb-layer":t,"data-pcb-keepout-id":e,stroke:"none"};if(o)r["data-description"]=o;return r}function F0o(e,t,n,o){let r={class:`pcb-keepout ${n} pcb-keepout-pattern`,fill:`url(#${zpo})`,"data-type":"pcb_keepout","data-pcb-layer":t,"data-pcb-keepout-id":e,stroke:"none"};if(o)r["data-description"]=o;return r}function ris(e,t){let{transform:n,layer:o,colorMap:r}=t;if(o&&!e.layers.includes(o))return[];let i=[],s=r.keepout;for(let a of e.layers){if(o&&a!==o)continue;if(e.shape==="rect"){let c=e,[l,h]=yT.applyToPoint(n,[c.center.x,c.center.y]),d=c.width*Math.abs(n.a),u=c.height*Math.abs(n.d),_=yT.toString(yT.compose(yT.translate(l,h))),p={...H0o(c.pcb_keepout_id,a,"pcb-keepout-rect",c.description),x:(-d/2).toString(),y:(-u/2).toString(),width:d.toString(),height:u.toString(),fill:L0o,transform:_},m={...F0o(c.pcb_keepout_id,a,"pcb-keepout-rect",c.description),x:(-d/2).toString(),y:(-u/2).toString(),width:d.toString(),height:u.toString(),transform:_};i.push({name:"rect",type:"element",attributes:p,children:[],value:""},{name:"rect",type:"element",attributes:m,children:[],value:""})}else if(e.shape==="circle"){let c=e,[l,h]=yT.applyToPoint(n,[c.center.x,c.center.y]),d=c.radius*Math.abs(n.a),u={...H0o(c.pcb_keepout_id,a,"pcb-keepout-circle",c.description),cx:l.toString(),cy:h.toString(),r:d.toString(),fill:L0o},_={...F0o(c.pcb_keepout_id,a,"pcb-keepout-circle",c.description),cx:l.toString(),cy:h.toString(),r:d.toString()};i.push({name:"circle",type:"element",attributes:u,children:[],value:""},{name:"circle",type:"element",attributes:_,children:[],value:""})}}return i}function iis({elementType:e,shapeAttributes:t,layer:n,colorMap:o,additionalAttributes:r}){let i={class:"pcb-soldermask-cutout",fill:o.substrate,"data-type":"pcb_soldermask_opening","data-pcb-layer":n,...t,...r};return{name:e,type:"element",value:"",children:[],attributes:i}}function sis(e,t){let{transform:n,layer:o,colorMap:r,showSolderMask:i}=t,{layer:s}=e;if(o&&s!==o)return[];let a=Dpo(e,n);if(!a)return[];let{elementType:c,shapeAttributes:l}=a,h=v5(s,r),d="0.5",u=e.covered_with_solder_mask!==!1,_=s==="bottom"?r.soldermaskOverCopper.bottom:r.soldermaskOverCopper.top,p="0.9",m={name:c,type:"element",value:"",children:[],attributes:{class:`pcb-copper-pour pcb-copper-pour-${e.shape}`,...l,fill:h,"fill-opacity":d,"data-type":"pcb_copper_pour","data-pcb-layer":s}},A=i?u?Bpo({elementType:c,shapeAttributes:l,layer:s,fillColor:_,fillOpacity:p,className:"pcb-soldermask-covered-pour"}):iis({elementType:c,shapeAttributes:l,layer:s,colorMap:r}):null;if(!A)return[m];if(!u&&e.pcb_copper_pour_id?.includes("substrate_only"))return[A];return[m,A]}function ais(e,t){let{transform:n,layer:o}=t;if(o&&e.layer!==o)return[];let[r,i]=Opo.applyToPoint(n,[e.x,e.y]);if(e.shape==="rect"||e.shape==="rotated_rect"){let s=e.width*Math.abs(n.a),a=e.height*Math.abs(n.d);if(e.shape==="rotated_rect"&&e.ccw_rotation)return[{name:"rect",type:"element",attributes:{class:"pcb-solder-paste",fill:ane(e.layer),x:(-s/2).toString(),y:(-a/2).toString(),width:s.toString(),height:a.toString(),transform:`translate(${r} ${i}) rotate(${-e.ccw_rotation})`,"data-type":"pcb_solder_paste","data-pcb-layer":e.layer}}];return[{name:"rect",type:"element",attributes:{class:"pcb-solder-paste",fill:ane(e.layer),x:(r-s/2).toString(),y:(i-a/2).toString(),width:s.toString(),height:a.toString(),"data-type":"pcb_solder_paste","data-pcb-layer":e.layer}}]}if(e.shape==="pill"){let s=e.width*Math.abs(n.a),a=e.height*Math.abs(n.d),c=e.radius*Math.abs(n.a);return[{name:"rect",type:"element",attributes:{class:"pcb-solder-paste",fill:ane(e.layer),x:(r-s/2).toString(),y:(i-a/2).toString(),width:s.toString(),height:a.toString(),rx:c.toString(),"data-type":"pcb_solder_paste","data-pcb-layer":e.layer}}]}if(e.shape==="rotated_pill"){let s=e.width*Math.abs(n.a),a=e.height*Math.abs(n.d),c=e.radius*Math.abs(n.a);return[{name:"rect",type:"element",attributes:{class:"pcb-solder-paste",fill:ane(e.layer),x:(-s/2).toString(),y:(-a/2).toString(),width:s.toString(),height:a.toString(),rx:c.toString(),transform:`translate(${r} ${i}) rotate(${-e.ccw_rotation})`,"data-type":"pcb_solder_paste","data-pcb-layer":e.layer}}]}if(e.shape==="oval"){let s=e.width*Math.abs(n.a),a=e.height*Math.abs(n.d);return[{name:"ellipse",type:"element",attributes:{class:"pcb-solder-paste",fill:ane(e.layer),cx:r.toString(),cy:i.toString(),rx:(s/2).toString(),ry:(a/2).toString(),"data-type":"pcb_solder_paste","data-pcb-layer":e.layer}}]}if(e.shape==="circle"){let s=e.radius*Math.abs(n.a);return[{name:"circle",type:"element",attributes:{class:"pcb-solder-paste",fill:ane(e.layer),cx:r.toString(),cy:i.toString(),r:s.toString(),"data-type":"pcb_solder_paste","data-pcb-layer":e.layer}}]}}var cis="rgba(255, 255, 255, 0.5)",z0o="pcb-grid-pattern";function lis({grid:e,svgWidth:t,svgHeight:n}){if(!e)return{};let o=e.lineColor??cis,{cellSize:r,majorCellSize:i}=e,s=e.majorLineColor??o;if(i!==void 0){if(!r||r<=0)throw Error("grid.majorCellSize requires a positive grid.cellSize");if(i<=0)throw Error("grid.majorCellSize must be a positive multiple of grid.cellSize");let d=i/r,u=Math.round(d);if(!Number.isFinite(d)||Math.abs(d-u)>0.000001)throw Error("grid.majorCellSize must be a positive multiple of grid.cellSize")}if(!r||r<=0)return{};let a=i!==void 0,c=a?his(r,i,o,s):[{name:"path",type:"element",value:"",attributes:{d:`M ${r} 0 L 0 0 0 ${r}`,fill:"none",stroke:o,"stroke-width":"1","shape-rendering":"crispEdges"},children:[]}],l={name:"defs",type:"element",value:"",attributes:{},children:[{name:"pattern",type:"element",value:"",attributes:{id:z0o,width:a?i.toString():r.toString(),height:a?i.toString():r.toString(),patternUnits:"userSpaceOnUse"},children:c}]},h={name:"rect",type:"element",value:"",attributes:{x:"0",y:"0",width:t.toString(),height:n.toString(),fill:`url(#${z0o})`,"pointer-events":"none","data-type":"pcb_grid","data-pcb-layer":"global"},children:[]};return{defs:l,rect:h}}function his(e,t,n,o){let r=[],i=Math.round(t/e);for(let s=0;s<i;s+=1){let c=Number((s*e).toFixed(6)).toString(),l=s===0?o:n,h=t.toString();r.push({name:"line",type:"element",value:"",attributes:{x1:c,y1:"0",x2:c,y2:h,stroke:l,"stroke-width":"1","shape-rendering":"crispEdges"},children:[]}),r.push({name:"line",type:"element",value:"",attributes:{x1:"0",y1:c,x2:h,y2:c,stroke:l,"stroke-width":"1","shape-rendering":"crispEdges"},children:[]})}return r}function dis(e,t){let{transform:n,circuitJson:o}=t,{center:r,width:i,height:s,rotation:a=0}=e,[c,l]=Vpo.applyToPoint(n,[r.x,r.y]),h=i*Math.abs(n.a),d=s*Math.abs(n.d),u=`translate(${c}, ${l}) rotate(${-a}) scale(1, -1)`,_=[];if(t.showAnchorOffsets&&o&&e.position_mode==="relative_to_group_anchor"&&(e.positioned_relative_to_pcb_group_id||e.positioned_relative_to_pcb_board_id)){let p=uis(e,o);if(p)_.push(...Ugt({groupAnchorPosition:p,componentPosition:r,transform:n,componentWidth:i,componentHeight:s,displayXOffset:e.display_offset_x,displayYOffset:e.display_offset_y}))}if(!t.colorMap.debugComponent?.fill&&!t.colorMap.debugComponent?.stroke)return _;return _.push({name:"g",type:"element",attributes:{transform:u,"data-type":"pcb_component","data-pcb-layer":e.layer??"top"},children:[{name:"rect",type:"element",attributes:{class:"pcb-component",x:(-h/2).toString(),y:(-d/2).toString(),width:h.toString(),height:d.toString(),fill:t.colorMap.debugComponent.fill??"transparent",stroke:t.colorMap.debugComponent.stroke??"transparent","data-type":"pcb_component","data-pcb-layer":e.layer??"top"}}],value:""}),_}function uis(e,t){if(e.positioned_relative_to_pcb_group_id){let n=t.find((r)=>r.type==="pcb_group"&&r.pcb_group_id===e.positioned_relative_to_pcb_group_id),o=n_e(n);if(o)return o}if(e.positioned_relative_to_pcb_board_id){let n=t.find((r)=>r.type==="pcb_board"&&r.pcb_board_id===e.positioned_relative_to_pcb_board_id),o=n_e(n);if(o)return o}return}var O0o=["rgba(100, 200, 255, 0.6)","rgba(255, 150, 100, 0.6)","rgba(100, 255, 150, 0.6)","rgba(200, 100, 255, 0.6)","rgba(255, 220, 100, 0.6)","rgba(255, 100, 200, 0.6)","rgba(100, 255, 255, 0.6)","rgba(180, 255, 100, 0.6)"],pis=0.1;function mis(e,t){let{transform:n,circuitJson:o}=t,{center:r,width:i,height:s}=e,a=[];if(t.showAnchorOffsets&&e.position_mode==="relative_to_group_anchor"&&o){let v=gis(e,o);if(v)a.push(...Ugt({groupAnchorPosition:v,componentPosition:e.anchor_position??e.center,transform:n,componentWidth:e.width,componentHeight:e.height,displayXOffset:e.display_offset_x,displayYOffset:e.display_offset_y}))}let c=Array.isArray(e.outline)?e.outline:void 0,l=pis*Math.abs(n.a),h=0.3*Math.abs(n.a),d=0.15*Math.abs(n.a),u={class:"pcb-group",fill:"none",stroke:_is(e.pcb_group_id),"stroke-width":l.toString(),"stroke-dasharray":`${h} ${d}`,"data-type":"pcb_group","data-pcb-group-id":e.pcb_group_id,"data-pcb-layer":"overlay"};if(e.name)u["data-group-name"]=e.name;if(c&&c.length>=3&&c.every((v)=>v&&typeof v.x==="number"&&typeof v.y==="number")){let v=c.map((P,M)=>{let[B,T]=gBe.applyToPoint(n,[P.x,P.y]);return M===0?`M ${B} ${T}`:`L ${B} ${T}`}).join(" ");return a.push({name:"path",type:"element",value:"",children:[],attributes:{...u,d:`${v} Z`}}),a}if(!r||typeof r.x!=="number"||typeof r.y!=="number"||typeof i!=="number"||typeof s!=="number")return Tm(`[pcb_group] Invalid data for "${e.pcb_group_id}"${e.name?` (name: "${e.name}")`:""}: expected center {x: number, y: number}, width: number, height: number, got center=${JSON.stringify(r)}, width=${JSON.stringify(i)}, height=${JSON.stringify(s)}`),a;let _=i/2,p=s/2,[m,A]=gBe.applyToPoint(n,[r.x-_,r.y+p]),[g,f]=gBe.applyToPoint(n,[r.x+_,r.y-p]),y=Math.min(m,g),x=Math.min(A,f),C=Math.abs(g-m),b=Math.abs(f-A),I={name:"rect",type:"element",value:"",attributes:{...u,x:y.toString(),y:x.toString(),width:C.toString(),height:b.toString()},children:[]};return a.push(I),a}function _is(e){let t=e.match(/(\d+)$/),n=t?Number.parseInt(t[1],10):0;return O0o[n%O0o.length]}function gis(e,t){if(e.positioned_relative_to_pcb_group_id){let n=t.find((r)=>r.type==="pcb_group"&&r.pcb_group_id===e.positioned_relative_to_pcb_group_id),o=n_e(n);if(o)return o}if(e.positioned_relative_to_pcb_board_id){let n=t.find((r)=>r.type==="pcb_board"&&r.pcb_board_id===e.positioned_relative_to_pcb_board_id),o=n_e(n);if(o)return o}return}function Ypo(e){return e.find((n)=>n.type==="project_software_metadata"||n.type==="source_project_metadata")?.software_used_string}var Ais={name:"circuit-to-svg",type:"module",version:"0.0.431",repository:{type:"git",url:"https://github.com/tscircuit/circuit-to-svg.git"},description:"Convert Circuit JSON to SVG",main:"dist/index.js",files:["dist"],scripts:{start:"cosmos",prepublish:"npm run build",prepare:"node scripts/prepare-git.cjs",build:"tsup-node ./lib/index.ts --format esm --dts --sourcemap --external tscircuit",format:"biome format . --write","format:check":"biome format .",cosmos:"cosmos","cosmos-export":"cosmos-export"},license:"ISC",devDependencies:{"@biomejs/biome":"^1.9.4","@resvg/resvg-js":"^2.6.2","@tscircuit/alphabet":"^0.0.27","@tscircuit/checks-latest":"npm:@tscircuit/checks@0.0.179","@types/bun":"^1.2.8","@types/debug":"^4.1.12","@vitejs/plugin-react":"5.0.0",biome:"^0.3.3","bun-match-svg":"^0.0.12","circuit-json":"^0.0.491",esbuild:"^0.20.2","format-si-unit":"^0.0.12","performance-now":"^2.1.0",react:"19.1.0","react-cosmos":"7.0.0","react-cosmos-plugin-vite":"7.0.0","react-dom":"19.1.0",tscircuit:"^0.0.2629",tsup:"^8.0.2",typescript:"^5.4.5","vite-tsconfig-paths":"^5.0.1"},peerDependencies:{"@tscircuit/alphabet":"*"},dependencies:{"@types/node":"^22.5.5","bun-types":"^1.1.40","calculate-elbow":"0.0.12",debug:"^4.4.3","svg-path-commander":"^2.1.11",svgson:"^5.3.1","transformation-matrix":"^2.16.1"}},Gpo=Ais.version,fis={pcb_background:0,pcb_boundary:1,pcb_panel:5,pcb_board:10,pcb_cutout:15,pcb_cutout_path:15,pcb_keepout:16,pcb_hole:18,pcb_plated_hole_drill:19,pcb_plated_hole:20,pcb_trace_soldermask:25,pcb_trace:30,pcb_smtpad:30,pcb_copper_pour:35,pcb_via:36,pcb_soldermask:40,pcb_soldermask_opening:25,pcb_solder_paste:45,pcb_silkscreen_text:50,pcb_silkscreen_path:50,pcb_silkscreen_graphic:50,pcb_silkscreen_rect:50,pcb_silkscreen_circle:50,pcb_silkscreen_line:50,pcb_silkscreen_oval:50,pcb_silkscreen_pill:50,pcb_component:60,pcb_pad_pin_number:65,pcb_fabrication_note_text:70,pcb_fabrication_note_path:70,pcb_fabrication_note_rect:70,pcb_fabrication_note_dimension:70,pcb_note_dimension:70,pcb_note_text:70,pcb_note_rect:70,pcb_note_path:70,pcb_note_line:70,pcb_trace_error:80,pcb_footprint_overlap_error:80,pcb_component_outside_board_error:80,pcb_pad_trace_clearance_error:80,pcb_via_trace_clearance_error:80,pcb_connector_not_in_accessible_orientation_warning:80,pcb_manual_edit_conflict_warning:80,pcb_rats_nest:85,pcb_debug_object:90},V0o=100;function yis(e){return e.map((t,n)=>({object:t,index:n,layerPriority:xis(t.attributes?.["data-pcb-layer"]??void 0),typePriority:Cis(t.attributes?.["data-type"]??void 0)})).sort((t,n)=>{if(t.layerPriority!==n.layerPriority)return t.layerPriority-n.layerPriority;if(t.typePriority!==n.typePriority)return t.typePriority-n.typePriority;return t.index-n.index}).map(({object:t})=>t)}function xis(e){if(!e)return 500;let t=e.toLowerCase();if(t==="global")return-100;if(t==="bottom")return 4;if(t==="board")return 2;if(t==="soldermask-top"||t==="soldermask-bottom")return 3;if(t.startsWith("inner")){let n=t.match(/\d+/);return 5+(n?Number.parseInt(n[0],10):0)}if(t==="through")return 18;if(t==="top")return 17;if(t==="drill")return 30;if(t==="overlay")return 40;return 10}function Cis(e){if(!e)return V0o;return fis[e]??V0o}function bis({objects:e,layer:t,width:n,height:o,showSolderMask:r=!1}){let i=e.filter((h)=>h.attributes["data-pcb-layer"]===t&&(h.attributes.class==="pcb-pad"||h.attributes.class==="pcb-pad-exposed"||h.attributes["data-type"]==="pcb_soldermask_opening"));if(i.length===0)return null;let s=e.filter((h)=>h.attributes["data-type"]==="pcb_via").flatMap((h)=>h.children).filter((h)=>h.attributes.class==="pcb-via-tenting"),a=e.filter((h)=>r&&h.attributes["data-pcb-layer"]===t&&(h.attributes["data-type"]==="pcb_copper_pour"||h.attributes.class==="pcb-soldermask-covered-pour")),c=i.filter((h)=>h.attributes.class==="pcb-pad"||h.attributes.class==="pcb-pad-exposed"),l=[];for(let{targets:h,cutouts:d,maskId:u}of[{targets:s,cutouts:i,maskId:`via-tenting-mask-${t}`},{targets:a,cutouts:c,maskId:`copper-pour-pad-opening-mask-${t}`}]){if(h.length===0||d.length===0)continue;for(let _ of h)_.attributes.mask=`url(#${u})`;l.push(Iis(u,d,n,o))}if(l.length===0)return null;return{name:"defs",type:"element",value:"",attributes:{},children:l}}function Iis(e,t,n,o){return{name:"mask",type:"element",value:"",attributes:{id:e,maskUnits:"userSpaceOnUse",x:"0",y:"0",width:String(n),height:String(o)},children:[{name:"rect",type:"element",value:"",attributes:{x:"0",y:"0",width:String(n),height:String(o),fill:"white"},children:[]},...t.map((r)=>({...r,attributes:{...r.attributes,fill:"black"}}))]}}function Upo(e,t="error_text_overlay"){let n=e.filter((i)=>i.type.endsWith("_error"));if(n.length===0)return null;let o=n.map((i)=>i.message).filter((i)=>!!i);if(o.length===0)return null;return{name:"text",type:"element",value:"",attributes:{x:"10",y:"20",fill:"red","font-family":"monospace","font-size":"12px","data-type":t,"data-layer":"global"},children:o.map((i,s)=>({name:"tspan",type:"element",value:"",attributes:{x:"10",dy:s===0?"0":"1.2em"},children:[{type:"text",value:i,name:"",attributes:{},children:[]}]}))}}function vis({anchorPosition:e,textWidth:t,textHeight:n,anchorAlignment:o}){switch(o){case"top_left":return{x:e.x+t/2,y:e.y+n/2};case"top_center":return{x:e.x,y:e.y+n/2};case"top_right":return{x:e.x-t/2,y:e.y+n/2};case"center_left":return{x:e.x+t/2,y:e.y};case"center_right":return{x:e.x-t/2,y:e.y};case"bottom_left":return{x:e.x+t/2,y:e.y-n/2};case"bottom_center":return{x:e.x,y:e.y-n/2};case"bottom_right":return{x:e.x-t/2,y:e.y-n/2};case"center":default:return e}}function Sis(e){let{POSITIVE_INFINITY:t,POSITIVE_INFINITY:n,NEGATIVE_INFINITY:o,NEGATIVE_INFINITY:r}=Number,i=!1,{POSITIVE_INFINITY:s,POSITIVE_INFINITY:a,NEGATIVE_INFINITY:c,NEGATIVE_INFINITY:l}=Number,h=!1;for(let y of e)if(y.type==="pcb_panel"){let x=y,C=an.parse(x.width),b=an.parse(x.height);if(C===void 0||b===void 0)continue;let I=x.center??{x:C/2,y:b/2};d({center:I,width:C,height:b})}else if(y.type==="pcb_board"){if(y.outline&&Array.isArray(y.outline)&&y.outline.length>=3)_(y.outline),p(y.outline);else if("center"in y&&"width"in y&&"height"in y)d({center:y.center,width:y.width,height:y.height}),u({center:y.center,width:y.width,height:y.height})}else if(y.type==="pcb_courtyard_rect")d({center:y.center,width:y.width,height:y.height,ccwRotationDegrees:y.ccw_rotation});else if(y.type==="pcb_smtpad"){let x=y;if(x.shape==="rect"||x.shape==="pill")d({center:{x:x.x,y:x.y},width:x.width,height:x.height});else if(x.shape==="rotated_rect"||x.shape==="rotated_pill")d({center:{x:x.x,y:x.y},width:x.width,height:x.height,ccwRotationDegrees:x.ccw_rotation});else if(x.shape==="circle"){let C=an.parse(x.radius);if(C!==void 0)d({center:{x:x.x,y:x.y},width:C*2,height:C*2})}else if(x.shape==="polygon")m(x.points)}else if(y.type==="pcb_via"){let x=an.parse(y.outer_diameter);d({center:{x:y.x,y:y.y},width:x??0,height:x??0})}else if(y.type==="pcb_plated_hole"){let x=y,C={x:x.x,y:x.y};if(x.shape==="circle"){let b=an.parse(x.outer_diameter);d({center:C,width:b??0,height:b??0})}else if(x.shape==="oval"||x.shape==="pill")d({center:C,width:x.outer_width,height:x.outer_height});else if(x.shape==="circular_hole_with_rect_pad"||x.shape==="pill_hole_with_rect_pad")d({center:C,width:x.rect_pad_width,height:x.rect_pad_height});else if(x.shape==="rotated_pill_hole_with_rect_pad")d({center:C,width:x.rect_pad_width,height:x.rect_pad_height,ccwRotationDegrees:x.rect_ccw_rotation});else if(x.shape==="hole_with_polygon_pad")m((x.pad_outline??[]).map((b)=>({x:x.x+b.x,y:x.y+b.y})))}else if(y.type==="pcb_hole"){let x=y,C={x:x.x,y:x.y};if(x.hole_shape==="circle"||x.hole_shape==="square"){let b=an.parse(x.hole_diameter);d({center:C,width:b??0,height:b??0})}else if(x.hole_shape==="rotated_pill")d({center:C,width:x.hole_width,height:x.hole_height,ccwRotationDegrees:x.ccw_rotation});else if(x.hole_shape==="oval"||x.hole_shape==="rect"||x.hole_shape==="pill")d({center:C,width:x.hole_width,height:x.hole_height})}else if(y.type==="pcb_note_line")m([{x:y.x1,y:y.y1},{x:y.x2,y:y.y2}]);else if("x"in y&&"y"in y)d({center:{x:y.x,y:y.y},width:0,height:0});else if("route"in y)m(y.route);else if(y.type==="pcb_note_rect"||y.type==="pcb_fabrication_note_rect")d({center:y.center,width:y.width,height:y.height});else if(y.type==="pcb_note_dimension"||y.type==="pcb_fabrication_note_dimension"){let x=y,{from:C,to:b,text:I,font_size:v=1,arrow_size:P,offset_distance:M,offset_direction:B}=x;if(!C||!b||!P)continue;d({center:C,width:0,height:0}),d({center:b,width:0,height:0});let T=(ce)=>{let ue=Math.hypot(ce.x,ce.y)||1;return{x:ce.x/ue,y:ce.y/ue}},N=T({x:b.x-C.x,y:b.y-C.y});if(Number.isNaN(N.x)||Number.isNaN(N.y))continue;let D={x:-N.y,y:N.x},L=B&&typeof B.x==="number"&&typeof B.y==="number",H=L?T(B):{x:0,y:0},V=typeof M==="number"?M:0,O={x:H.x*V,y:H.y*V},U={x:C.x+O.x,y:C.y+O.y},j={x:b.x+O.x,y:b.y+O.y};d({center:U,width:0,height:0}),d({center:j,width:0,height:0});let Y=L&&(Math.abs(H.x)>Number.EPSILON||Math.abs(H.y)>Number.EPSILON)?H:D,X=V+P,K={x:C.x+Y.x*X,y:C.y+Y.y*X},J={x:b.x+Y.x*X,y:b.y+Y.y*X};d({center:K,width:0,height:0}),d({center:J,width:0,height:0});let ee=P/2,se={x:U.x+N.x*P,y:U.y+N.y*P},ne={x:j.x-N.x*P,y:j.y-N.y*P},re={x:se.x+D.x*ee,y:se.y+D.y*ee},Z={x:se.x-D.x*ee,y:se.y-D.y*ee};d({center:re,width:0,height:0}),d({center:Z,width:0,height:0});let te={x:ne.x+D.x*ee,y:ne.y+D.y*ee},ie={x:ne.x-D.x*ee,y:ne.y-D.y*ee};if(d({center:te,width:0,height:0}),d({center:ie,width:0,height:0}),I){let ce={x:(C.x+b.x)/2+O.x,y:(C.y+b.y)/2+O.y},ue=P*1.5,de={x:ce.x+D.x*ue,y:ce.y+D.y*ue},me=I.length*v*0.6;d({center:de,width:me,height:v})}}else if(y.type==="pcb_note_text"||y.type==="pcb_fabrication_note_text")g({text:y.text,anchorPosition:y.anchor_position,fontSize:y.font_size,anchorAlignment:y.anchor_alignment,ccwRotationDegrees:y.type==="pcb_fabrication_note_text"?y.ccw_rotation??1:0});else if(y.type==="pcb_cutout"){let x=y;if(x.shape==="rect")d({center:x.center,width:x.width,height:x.height,ccwRotationDegrees:x.rotation});else if(x.shape==="circle"){let C=an.parse(x.radius);if(C!==void 0)d({center:x.center,width:C*2,height:C*2})}else if(x.shape==="polygon")m(x.points);else if(x.shape==="path"){let C=x;if(C.route&&Array.isArray(C.route))m(C.route)}}else if(y.type==="pcb_keepout"){let x=y;if(x.shape==="rect")d({center:x.center,width:x.width,height:x.height});else if(x.shape==="circle"){let C=typeof x.radius==="number"?x.radius:an.parse(x.radius)??0;if(C>0)d({center:x.center,width:C*2,height:C*2})}}else if(y.type==="pcb_silkscreen_graphic"||y.type==="pcb_silkscreen_text"||y.type==="pcb_silkscreen_rect"||y.type==="pcb_silkscreen_circle"||y.type==="pcb_silkscreen_line"||y.type==="pcb_silkscreen_oval"||y.type==="pcb_silkscreen_pill")f(y);else if(y.type==="pcb_copper_text")d({center:y.anchor_position,width:0,height:0});else if(y.type==="pcb_copper_pour"){if(y.shape==="rect")d({center:y.center,width:y.width,height:y.height,ccwRotationDegrees:y.rotation});else if(y.shape==="polygon")m(y.points);else if(y.shape==="brep")m(y.brep_shape.outer_ring.vertices)}return{minX:t,minY:n,maxX:o,maxY:r,boardMinX:s,boardMinY:a,boardMaxX:c,boardMaxY:l,hasBounds:i,hasBoardBounds:h};function d({center:y,width:x,height:C,ccwRotationDegrees:b}){if(!y)return;let I=an.parse(y.x),v=an.parse(y.y);if(I===void 0||v===void 0)return;let P=an.parse(x)??0,M=an.parse(C)??0,B=P/2,T=M/2;if(typeof b==="number"&&b!==0){let N=b*Math.PI/180,D=Math.abs(Math.cos(N)),L=Math.abs(Math.sin(N)),H=B*D+T*L,V=B*L+T*D;B=H,T=V}t=Math.min(t,I-B),n=Math.min(n,v-T),o=Math.max(o,I+B),r=Math.max(r,v+T),i=!0}function u({center:y,width:x,height:C}){if(!y)return;let b=an.parse(y.x),I=an.parse(y.y);if(b===void 0||I===void 0)return;let v=an.parse(x)??0,P=an.parse(C)??0,M=v/2,B=P/2;s=Math.min(s,b-M),a=Math.min(a,I-B),c=Math.max(c,b+M),l=Math.max(l,I+B),i=!0,h=!0}function _(y){let x=!1;for(let C of y){let b=an.parse(C.x),I=an.parse(C.y);if(b===void 0||I===void 0)continue;t=Math.min(t,b),n=Math.min(n,I),o=Math.max(o,b),r=Math.max(r,I),x=!0}if(x)i=!0}function p(y){let x=!1;for(let C of y){let b=an.parse(C.x),I=an.parse(C.y);if(b===void 0||I===void 0)continue;s=Math.min(s,b),a=Math.min(a,I),c=Math.max(c,b),l=Math.max(l,I),x=!0}if(x)i=!0,h=!0}function m(y){let x=!1;for(let C of y)for(let b of A(C)){let I=an.parse(b.x),v=an.parse(b.y);if(I===void 0||v===void 0)continue;t=Math.min(t,I),n=Math.min(n,v),o=Math.max(o,I),r=Math.max(r,v),x=!0}if(x)i=!0}function A(y){return"route_type"in y?brs(y):[y]}function g({text:y,anchorPosition:x,fontSize:C=1,anchorAlignment:b="center",ccwRotationDegrees:I=0}){if(!y||!x)return;let v=y.split(`
`),M=Math.max(...v.map((N)=>N.length),0)*C*0.6,B=Math.max(v.length,1)*C,T=vis({anchorPosition:x,textWidth:M,textHeight:B,anchorAlignment:b});d({center:T,width:M,height:B,ccwRotationDegrees:I})}function f(y){if(y.type==="pcb_silkscreen_text")d({center:y.anchor_position,width:0,height:0});else if(y.type==="pcb_silkscreen_graphic"){for(let x of y.brep_shape.outer_ring.vertices)d({center:{x:x.x,y:x.y},width:0,height:0});for(let x of y.brep_shape.inner_rings??[])for(let C of x.vertices)d({center:{x:C.x,y:C.y},width:0,height:0})}else if(y.type==="pcb_silkscreen_path")m(y.route);else if(y.type==="pcb_silkscreen_rect")d({center:y.center,width:y.width,height:y.height,ccwRotationDegrees:y.ccw_rotation});else if(y.type==="pcb_silkscreen_circle"){let x=an.parse(y.radius);if(x!==void 0)d({center:y.center,width:x*2,height:x*2})}else if(y.type==="pcb_silkscreen_line")d({center:{x:y.x1,y:y.y1},width:0,height:0}),d({center:{x:y.x2,y:y.y2},width:0,height:0});else if(y.type==="pcb_silkscreen_oval"){let x=an.parse(y.radius_x),C=an.parse(y.radius_y);if(x!==void 0&&C!==void 0)d({center:y.center,width:x*2,height:C*2})}else if(y.type==="pcb_silkscreen_pill")d({center:y.center,width:y.width,height:y.height,ccwRotationDegrees:y.ccw_rotation});else if(y.type==="pcb_cutout"){let x=y;if(x.shape==="rect")d({center:x.center,width:x.width,height:x.height,ccwRotationDegrees:x.rotation});else if(x.shape==="circle"){let C=an.parse(x.radius);if(C!==void 0)d({center:x.center,width:C*2,height:C*2})}else if(x.shape==="polygon")m(x.points);else if(x.shape==="path"){let C=x;if(C.route&&Array.isArray(C.route))m(C.route)}}}}var Pis=({circuitJson:e,drawPaddingOutsideBoard:t,baseBounds:n,viewportOptions:o})=>{let r=t?1:0,i=t||!n.hasBoardBounds?n.minX:n.boardMinX,s=t||!n.hasBoardBounds?n.minY:n.boardMinY,a=t||!n.hasBoardBounds?n.maxX:n.boardMaxX,c=t||!n.hasBoardBounds?n.maxY:n.boardMaxY,l=!1,{POSITIVE_INFINITY:h,POSITIVE_INFINITY:d,NEGATIVE_INFINITY:u,NEGATIVE_INFINITY:_}=Number,p=new Map,m=new Map;for(let A of e)if(A.type==="pcb_panel"){let g=A,f=Y0o(g.center,g.width,g.height);if(!f)continue;if(h=Math.min(h,f.minX),d=Math.min(d,f.minY),u=Math.max(u,f.maxX),_=Math.max(_,f.maxY),l=!0,g.pcb_panel_id)p.set(g.pcb_panel_id,f)}else if(A.type==="pcb_board"){let g=A,y=Eis(g.outline)??Y0o(g.center,g.width,g.height);if(y&&g.pcb_board_id)m.set(g.pcb_board_id,y)}if(o?.viewport){let{minX:A,minY:g,maxX:f,maxY:y}=o.viewport;i=A,s=g,a=f,c=y,r=0}else if(o?.viewportTarget?.pcb_panel_id){let A=p.get(o.viewportTarget.pcb_panel_id);if(!A)throw Error(`Viewport target panel '${o.viewportTarget.pcb_panel_id}' not found`);i=A.minX,s=A.minY,a=A.maxX,c=A.maxY,r=0}else if(o?.viewportTarget?.pcb_board_id){let A=m.get(o.viewportTarget.pcb_board_id);if(!A)throw Error(`Viewport target board '${o.viewportTarget.pcb_board_id}' not found`);i=A.minX,s=A.minY,a=A.maxX,c=A.maxY,r=0}else if(l)i=h,s=d,a=u,c=_;return{boundsMinX:i,boundsMinY:s,boundsMaxX:a,boundsMaxY:c,padding:r}};function Y0o(e,t,n){if(!e||t===void 0||n===void 0)return;let o=an.parse(e.x),r=an.parse(e.y);if(o===void 0||r===void 0)return;let i=an.parse(t),s=an.parse(n);if(i===void 0||s===void 0)return;let a=i/2,c=s/2;return{minX:o-a,minY:r-c,maxX:o+a,maxY:r+c}}function Eis(e){if(!e||e.length<3)return;let{POSITIVE_INFINITY:t,POSITIVE_INFINITY:n,NEGATIVE_INFINITY:o,NEGATIVE_INFINITY:r}=Number;for(let i of e){let s=an.parse(i.x),a=an.parse(i.y);if(s===void 0||a===void 0)continue;t=Math.min(t,s),n=Math.min(n,a),o=Math.max(o,s),r=Math.max(r,a)}if(!Number.isFinite(t)||!Number.isFinite(n))return;if(!Number.isFinite(o)||!Number.isFinite(r))return;return{minX:t,minY:n,maxX:o,maxY:r}}var Mis=0.5,wis=0.42,Bis=0.58,Tis=0.75;function G0o(e,t){if(!t.showPinNumbers)return[];if(e.type==="pcb_smtpad"){if(t.layer&&e.layer!==t.layer)return[]}else if(t.layer&&!e.layers.includes(t.layer))return[];let n=Vos(e,t.circuitJson);if(!n)return[];let o=Dis(e);if(!o||o.width<=0||o.height<=0)return[];let r=Math.abs(t.transform.a),i=Math.min(Mis,o.height*wis,o.width*Tis/(n.length*Bis));if(i<=0)return[];let[s,a]=Wpo.applyToPoint(t.transform,[o.centerX,o.centerY]),c=e.type==="pcb_smtpad"?e.layer:"through",l=o.ccwRotation?`rotate(${-o.ccwRotation} ${s} ${a})`:void 0;return[{name:"text",type:"element",value:"",attributes:{class:"pcb-pad-pin-number",x:s.toString(),y:a.toString(),fill:"#b0b0b0","font-family":"Arial, sans-serif","font-size":(i*r).toString(),"font-weight":"500","text-anchor":"middle","dominant-baseline":"central","pointer-events":"none","data-type":"pcb_pad_pin_number","data-pcb-layer":c,"data-pin-number":n,...l?{transform:l}:{}},children:[{type:"text",value:n,name:"",attributes:{},children:[]}]}]}function Dis(e){if(e.type==="pcb_smtpad"){if(e.shape==="polygon")return U0o(e.points);if(e.shape==="circle")return{centerX:e.x,centerY:e.y,width:e.radius*2,height:e.radius*2,ccwRotation:0};return{centerX:e.x,centerY:e.y,width:e.width,height:e.height,ccwRotation:e.shape==="rotated_rect"||e.shape==="rotated_pill"?e.ccw_rotation:0}}if(e.shape==="circle")return{centerX:e.x,centerY:e.y,width:e.outer_diameter,height:e.outer_diameter,ccwRotation:0};if(e.shape==="oval"||e.shape==="pill")return{centerX:e.x,centerY:e.y,width:e.outer_width,height:e.outer_height,ccwRotation:e.ccw_rotation};if(e.shape==="hole_with_polygon_pad"){let t=U0o(e.pad_outline);if(!t)return;return{...t,centerX:e.x+t.centerX,centerY:e.y+t.centerY,ccwRotation:0}}if("rect_pad_width"in e)return{centerX:e.x,centerY:e.y,width:e.rect_pad_width,height:e.rect_pad_height,ccwRotation:e.shape==="rotated_pill_hole_with_rect_pad"?e.rect_ccw_rotation:e.shape==="circular_hole_with_rect_pad"?e.rect_ccw_rotation??0:0};return}function U0o(e){if(e.length===0)return;let t=e.map((a)=>a.x),n=e.map((a)=>a.y),o=Math.min(...t),r=Math.max(...t),i=Math.min(...n),s=Math.max(...n);return{centerX:(o+r)/2,centerY:(i+s)/2,width:r-o,height:s-i,ccwRotation:0}}var W0o="rgb(255, 208, 66)";function Nis(e,t){return e.map((n)=>({...n,attributes:{...n.attributes??{},"data-type":t.type,"data-pcb-layer":"overlay"}}))}function Ris(e,t,n){if(!n.shouldDrawWarnings)return[];let o=t.find((g)=>g.type==="pcb_component"&&g.pcb_component_id===e.pcb_component_id);if(!o)return[];let r=(o.rotation??0)*Math.PI/180,i=Math.cos(r),s=Math.sin(r),a=o.width/2,c=o.height/2,l=[{x:-a,y:-c},{x:a,y:-c},{x:a,y:c},{x:-a,y:c}].map((g)=>Xpo.applyToPoint(n.transform,{x:o.center.x+g.x*i-g.y*s,y:o.center.y+g.x*s+g.y*i})),h=Math.min(...l.map((g)=>g.x)),d=Math.min(...l.map((g)=>g.y)),u=Math.max(...l.map((g)=>g.x)),_=Math.max(...l.map((g)=>g.y)),p=u-h,m=_-d,A=h+p/2;return Nis([{name:"rect",type:"element",value:"",attributes:{x:h.toString(),y:d.toString(),width:p.toString(),height:m.toString(),fill:"none",stroke:W0o,"stroke-width":"2","stroke-dasharray":"6,3"},children:[]},{name:"text",type:"element",value:"",attributes:{x:A.toString(),y:(d-10).toString(),fill:W0o,"font-family":"sans-serif","font-size":"12","font-weight":"600","text-anchor":"middle"},children:[{type:"text",name:"",value:e.message,attributes:{},children:[]}]}],e)}var jpo="#ff4d4d",Qis=(e)=>({type:"text",value:e,name:"",attributes:{},children:[]}),Sgt=({label:e,x:t,y:n,style:o,anchor:r="start"})=>e?[{name:"text",type:"element",value:"",attributes:{x:t.toString(),y:n.toString(),fill:jpo,"font-family":"monospace","font-size":o.fontSize.toString(),"font-weight":"600","text-anchor":r},children:[Qis(e)]}]:[],kis=(e)=>({"data-type":"pcb_debug_object","data-pcb-layer":"overlay","data-pcb-debug-object-id":e.pcb_debug_object_id,"data-debug-shape":e.shape});function Lis({debugObject:e,transform:t,style:n,labelStackIndex:o=0}){let r=kis(e),i={fill:"none",stroke:jpo,"stroke-width":n.strokeWidth.toString(),"stroke-dasharray":`${n.dashLength},${n.dashLength}`};if(e.shape==="rect"){let c=une.applyToPoint(t,[e.center.x-e.size.width/2,e.center.y-e.size.height/2]),l=une.applyToPoint(t,[e.center.x+e.size.width/2,e.center.y+e.size.height/2]),h=Math.min(c[0],l[0]),d=Math.min(c[1],l[1]),u=Math.abs(l[0]-c[0]),_=Math.abs(l[1]-c[1]);return[{name:"g",type:"element",value:"",attributes:r,children:[{name:"rect",type:"element",value:"",attributes:{x:h.toString(),y:d.toString(),width:u.toString(),height:_.toString(),...i},children:[]},...Sgt({label:e.label,x:h,y:d-n.labelGap-o*(n.fontSize+n.labelGap),style:n})]}]}if(e.shape==="line"){let[c,l]=une.applyToPoint(t,[e.start.x,e.start.y]),[h,d]=une.applyToPoint(t,[e.end.x,e.end.y]);return[{name:"g",type:"element",value:"",attributes:r,children:[{name:"line",type:"element",value:"",attributes:{x1:c.toString(),y1:l.toString(),x2:h.toString(),y2:d.toString(),...i},children:[]},...Sgt({label:e.label,x:(c+h)/2,y:(l+d)/2-n.labelGap,style:n,anchor:"middle"})]}]}let[s,a]=une.applyToPoint(t,[e.center.x,e.center.y]);return[{name:"g",type:"element",value:"",attributes:r,children:[{name:"circle",type:"element",value:"",attributes:{cx:s.toString(),cy:a.toString(),r:n.pointRadius.toString(),...i},children:[]},...Sgt({label:e.label,x:s+n.pointRadius+n.labelGap,y:a-n.pointRadius,style:n})]}]}function His(e){let t=new Map,n=new Map,o=e.filter((s)=>s.type==="pcb_board");for(let s of e)switch(s.type){case"source_group":if(n.set(s.source_group_id,s.subcircuit_id??s.parent_subcircuit_id??s.parent_source_group_id),s.is_subcircuit&&s.subcircuit_id)n.set(s.subcircuit_id,s.parent_subcircuit_id??s.parent_source_group_id);break;case"pcb_group":n.set(s.pcb_group_id,s.subcircuit_id??s.source_group_id);break;case"pcb_component":n.set(s.pcb_component_id,s.subcircuit_id??s.pcb_group_id);break;case"pcb_trace":n.set(s.pcb_trace_id,s.subcircuit_id??s.pcb_group_id??s.pcb_component_id);break;case"pcb_via":n.set(s.pcb_via_id,s.subcircuit_id??s.pcb_group_id??s.pcb_trace_id);break}for(let s of o)if(t.set(s.pcb_board_id,s),s.subcircuit_id)t.set(s.subcircuit_id,s);let r=new Set;function i(s){if(t.has(s))return t.get(s);if(r.has(s)||!n.has(s))return;r.add(s);let a=n.get(s),c=a?i(a):o.length===1?o[0]:void 0;return t.set(s,c),r.delete(s),c}for(let s of n.keys())i(s);return t}function Kpo(e,t){if(t?.showFabricationNotes===!1)e=e.filter((ue)=>!ue.type.startsWith("pcb_fabrication_note_"));let n=Boolean(t?.xRayElementIds?.length);if(n&&t?.hiddenLayerOpacity!==void 0&&(!Number.isFinite(t.hiddenLayerOpacity)||t.hiddenLayerOpacity<0||t.hiddenLayerOpacity>1))throw Error("hiddenLayerOpacity must be between 0 and 1");let o=!n&&(t?.drawPaddingOutsideBoard??!0),r=t?.layer,i=t?.colorOverrides,s={...ip.copper};if(i?.copper){for(let[ue,de]of Object.entries(i.copper))if(de!==void 0)s[ue]=de}let a={copper:s,drill:i?.drill??ip.drill,silkscreen:{top:i?.silkscreen?.top??ip.silkscreen.top,bottom:i?.silkscreen?.bottom??ip.silkscreen.bottom},boardOutline:i?.boardOutline??ip.boardOutline,soldermask:{top:i?.soldermask?.top??ip.soldermask.top,bottom:i?.soldermask?.bottom??ip.soldermask.bottom},soldermaskOverCopper:{top:i?.soldermaskOverCopper?.top??ip.soldermaskOverCopper.top,bottom:i?.soldermaskOverCopper?.bottom??ip.soldermaskOverCopper.bottom},soldermaskWithCopperUnderneath:{top:i?.soldermaskWithCopperUnderneath?.top??ip.soldermaskWithCopperUnderneath.top,bottom:i?.soldermaskWithCopperUnderneath?.bottom??ip.soldermaskWithCopperUnderneath.bottom},substrate:i?.substrate??ip.substrate,courtyard:{top:i?.courtyard?.top??ip.courtyard.top,bottom:i?.courtyard?.bottom??ip.courtyard.bottom},keepout:i?.keepout??ip.keepout,debugComponent:{fill:i?.debugComponent?.fill??ip.debugComponent.fill,stroke:i?.debugComponent?.stroke??ip.debugComponent.stroke}},c=t?.showCourtyards?e:e.filter((ue)=>ue.type!=="pcb_courtyard_rect"),{minX:l,minY:h,maxX:d,maxY:u,boardMinX:_,boardMinY:p,boardMaxX:m,boardMaxY:A,hasBoardBounds:g}=Sis(c),{boundsMinX:f,boundsMinY:y,boundsMaxX:x,boundsMaxY:C,padding:b}=Pis({circuitJson:e,drawPaddingOutsideBoard:o,baseBounds:{minX:l,minY:h,maxX:d,maxY:u,boardMinX:_,boardMinY:p,boardMaxX:m,boardMaxY:A,hasBoardBounds:g},viewportOptions:{viewport:t?.viewport,viewportTarget:t?.viewportTarget}}),I=x-f+2*b,v=C-y+2*b,P=t?.width??800,M=t?.height??600;if(t?.matchBoardAspectRatio){let ue=x-f,de=C-y;if(ue>0&&de>0){let me=ue/de;if(t?.width&&!t?.height)M=t.width/me;else if(t?.height&&!t?.width)P=t.height*me;else M=P/me}}let B=[];for(let ue of e)if("route"in ue&&ue.route!==void 0)B.push(ue.route);let T=P/I,N=M/v,D=Math.min(T,N),L=(P-I*D)/2,H=(M-v*D)/2,V=fT.compose(fT.translate(L-f*D+b*D,M-H+y*D-b*D),fT.scale(D,-D)),O=Math.min(P,M),U=Math.max(1,Math.min(2,O*0.002)),j=Math.max(10,Math.min(18,O*0.02)),Y={transform:V,layer:r,shouldDrawErrors:t?.shouldDrawErrors,shouldDrawWarnings:t?.shouldDrawWarnings,showCourtyards:t?.showCourtyards,showPcbGroups:t?.showPcbGroups,drawPaddingOutsideBoard:o,colorMap:a,showSolderMask:t?.showSolderMask,showSolderPaste:t?.showSolderPaste,showPcbNotes:t?.showPcbNotes??!0,showDebugObjects:t?.showDebugObjects,debugObjectStyle:{fontSize:j,strokeWidth:U,dashLength:U*4,labelGap:j*0.35,pointRadius:U*3},showAnchorOffsets:t?.showAnchorOffsets,showPinNumbers:t?.showPinNumbers,circuitJson:e,boardOwnerMap:His(e),usedCopperPourTraceMaskIds:new Set},X=n?[]:e.flatMap((ue)=>X0o({elm:ue,circuitJson:e,ctx:Y})),K=String(0.05*D);for(let ue of e)if("stroke_width"in ue){K=String(D*ue.stroke_width);break}if(!n&&t?.shouldDrawRatsNest){let ue=Jrs(e,Y);X=[...X,...ue]}let J=n?aos({circuitJson:e,ctx:Y,selectedIds:t.xRayElementIds,hiddenOpacity:t?.hiddenLayerOpacity??0.2,width:P,height:M,create:(ue,de)=>X0o({elm:ue,circuitJson:e,ctx:de})}):wrs(yis(X)),ee=[{name:"style",type:"element",value:"",attributes:{},children:[{type:"text",value:"",name:"",attributes:{},children:[]}]}],se=lis({grid:n?void 0:t?.grid,svgWidth:P,svgHeight:M});if(se.defs)ee.push(se.defs);if(e.some((ue)=>ue.type==="pcb_keepout"))ee.push(ois(a.keepout??ip.keepout));let re=Mrs({circuitJson:e,transform:V,svgWidth:P,svgHeight:M,usedMaskIds:Y.usedCopperPourTraceMaskIds});if(re)ee.push(re);let Z=bis({showSolderMask:Y.showSolderMask,objects:X,layer:r??"top",width:P,height:M});if(Z)ee.push(Z);if(ee.push({name:"rect",type:"element",value:"",attributes:{class:"boundary",x:"0",y:"0",fill:t?.backgroundColor??"#000",width:P.toString(),height:M.toString(),"data-type":"pcb_background","data-pcb-layer":"global"},children:[]}),o)ee.push(Fis(V,l,h,d,u));if(ee.push(...J),se.rect)ee.push(se.rect);if(!n&&t?.showErrorsInTextOverlay){let ue=Upo(e,"pcb_error_text_overlay");if(ue)ee.push(ue)}let te=Ypo(e),ie=Gpo,ce={name:"svg",type:"element",attributes:{xmlns:"http://www.w3.org/2000/svg",width:P.toString(),height:M.toString(),...te&&{"data-software-used-string":te},...t?.includeVersion&&{"data-circuit-to-svg-version":ie}},value:"",children:ee.filter((ue)=>ue!==null)};try{return spo(ce)}catch(ue){throw console.error("Error stringifying SVG object:",ue),ue}}function X0o({elm:e,circuitJson:t,ctx:n}){switch(e.type){case"pcb_debug_object":return n.showDebugObjects?Lis({debugObject:e,transform:n.transform,style:n.debugObjectStyle,labelStackIndex:e.shape==="rect"?t.slice(0,t.indexOf(e)).filter((r)=>r.type==="pcb_debug_object"&&r.shape==="rect"&&r.center.x===e.center.x&&r.center.y===e.center.y&&r.size.width===e.size.width&&r.size.height===e.size.height).length:0}):[];case"pcb_trace_error":return cos(e,t,n).filter(Boolean);case"pcb_footprint_overlap_error":return dos(e,t,n).filter(Boolean);case"pcb_courtyard_overlap_error":return uos(e,t,n).filter(Boolean);case"pcb_component_outside_board_error":return _os(e,t,n).filter(Boolean);case"pcb_pad_trace_clearance_error":case"pcb_via_trace_clearance_error":return bos(e,t,n).filter(Boolean);case"pcb_connector_not_in_accessible_orientation_warning":case"pcb_manual_edit_conflict_warning":return Ris(e,t,n);case"pcb_component":return dis(e,n).filter(Boolean);case"pcb_trace":return Brs(e,n);case"pcb_copper_pour":return sis(e,n);case"pcb_plated_hole":return[...Gos(e,n).filter(Boolean),...G0o(e,n)];case"pcb_hole":return Krs(e,n);case"pcb_smtpad":return[...Hrs(e,n),...G0o(e,n)];case"pcb_solder_paste":return n.showSolderPaste?ais(e,n):[];case"pcb_silkscreen_text":return nrs(e,n);case"pcb_silkscreen_rect":return ors(e,n);case"pcb_silkscreen_circle":return ars(e,n);case"pcb_silkscreen_line":return crs(e,n);case"pcb_silkscreen_pill":return lrs(e,n);case"pcb_silkscreen_oval":return hrs(e,n);case"pcb_copper_text":return srs(e,n);case"pcb_courtyard_rect":if(!n.showCourtyards)return[];return drs(e,n);case"pcb_courtyard_polygon":if(!n.showCourtyards)return[];return urs(e,n);case"pcb_courtyard_circle":if(!n.showCourtyards)return[];return mrs(e,n);case"pcb_courtyard_outline":if(!n.showCourtyards)return[];return prs(e,n);case"pcb_fabrication_note_path":return Ios(e,n);case"pcb_fabrication_note_text":return vos(e,n);case"pcb_fabrication_note_rect":return Eos(e,n);case"pcb_fabrication_note_dimension":return Tos(e,n);case"pcb_note_dimension":if(!n.showPcbNotes)return[];return Dos(e,n);case"pcb_note_text":if(!n.showPcbNotes)return[];return Ros(e,n);case"pcb_note_rect":if(!n.showPcbNotes)return[];return Los(e,n);case"pcb_note_path":if(!n.showPcbNotes)return[];return Fos(e,n);case"pcb_note_line":if(!n.showPcbNotes)return[];return Oos(e,n);case"pcb_silkscreen_path":return Uos(e,n);case"pcb_silkscreen_graphic":return Wos(e,n);case"pcb_panel":return n.drawPaddingOutsideBoard?jrs(e,n):[];case"pcb_board":return n.drawPaddingOutsideBoard?Xrs(e,n):[];case"pcb_via":return Tpo(e,n);case"pcb_cutout":let o=e;if(o.shape==="path")return eis(o,n);return Zrs(e,n);case"pcb_keepout":return ris(e,n);case"pcb_group":return n.showPcbGroups?mis(e,n):[];default:return[]}}function Fis(e,t,n,o,r){let[i,s]=fT.applyToPoint(e,[t,n]),[a,c]=fT.applyToPoint(e,[o,r]),l=Math.abs(a-i),h=Math.abs(c-s),d=Math.min(i,a),u=Math.min(s,c);return{name:"rect",type:"element",value:"",children:[],attributes:{class:"pcb-boundary",fill:"none",stroke:"#fff","stroke-width":"0.3",x:d.toString(),y:u.toString(),width:l.toString(),height:h.toString(),"data-type":"pcb_boundary","data-pcb-layer":"global"}}}var Vis={pin_number:0.15,negated_pin_number:0.12,reference_designator:0.18,manufacturer_number:0.18,net_label:0.18,error:0.05},XL=(e,t)=>t??Vis[e],Q3=(e,t,n)=>Math.abs(e.a)*XL(t,n);function Zis(e){let{minX:t,minY:n,maxX:o,maxY:r}=e.bounds,i=e.cellSize??1,s=e.labelCells??!1,a=[],c=(l,h)=>{let[d,u]=$po.applyToPoint(e.transform,[l,h]);return{x:d,y:u}};for(let l=Math.floor(t);l<=Math.ceil(o);l+=i){let h=c(l,n),d=c(l,r);a.push({name:"line",type:"element",attributes:{x1:h.x.toString(),y1:h.y.toString(),x2:d.x.toString(),y2:d.y.toString(),stroke:YA.schematic.grid,"stroke-width":(0.01*Math.abs(e.transform.a)).toString(),"stroke-opacity":"0.5"}})}for(let l=Math.floor(n);l<=Math.ceil(r);l+=i){let h=c(t,l),d=c(o,l);a.push({name:"line",type:"element",attributes:{x1:h.x.toString(),y1:h.y.toString(),x2:d.x.toString(),y2:d.y.toString(),stroke:YA.schematic.grid,"stroke-width":(0.01*Math.abs(e.transform.a)).toString(),"stroke-opacity":"0.5"}})}if(s){let l=(h,d)=>{if(i<=0.1)return`${h.toFixed(1)},${d.toFixed(1)}`;return`${h},${d}`};for(let h=Math.floor(t);h<=Math.ceil(o);h+=i)for(let d=Math.floor(n);d<=Math.ceil(r);d+=i){let u=c(h,d);a.push({name:"text",type:"element",attributes:{x:(u.x-2.5).toString(),y:(u.y-5).toString(),fill:YA.schematic.grid,"font-size":(i/5*Math.abs(e.transform.a)).toString(),"fill-opacity":"0.5","text-anchor":"middle","dominant-baseline":"middle","font-family":"sans-serif"},children:[{type:"text",value:l(h,d),name:"",attributes:{},children:[]}]})}}return{name:"g",value:"",type:"element",attributes:{class:"grid sch-grid"},children:a}}function ess(e){let{points:t,transform:n}=e,o=[];for(let r of t){let[i,s]=pne.applyToPoint(n,[r.x-0.1,r.y-0.1]),[a,c]=pne.applyToPoint(n,[r.x+0.1,r.y+0.1]),[l,h]=pne.applyToPoint(n,[r.x-0.1,r.y+0.1]),[d,u]=pne.applyToPoint(n,[r.x+0.1,r.y-0.1]);o.push({name:"path",type:"element",attributes:{d:`M${i},${s} L${a},${c} M${l},${h} L${d},${u}`,stroke:YA.schematic.grid,"stroke-width":(0.02*Math.abs(n.a)).toString(),"stroke-opacity":"0.7"}});let[_,p]=pne.applyToPoint(n,[r.x+0.15,r.y-0.15]);o.push({name:"text",type:"element",attributes:{x:_.toString(),y:p.toString(),fill:YA.schematic.grid,"font-size":(0.1*Math.abs(n.a)).toString(),"fill-opacity":"0.7","text-anchor":"start","font-family":"sans-serif","dominant-baseline":"middle"},children:[{type:"text",value:r.label||`(${r.x},${r.y})`,name:"",attributes:{},children:[]}]})}return{name:"g",value:"",type:"element",attributes:{class:"labeled-points sch-labeled-points"},children:o}}function tss(e){return e.reduce((t,n)=>{if(!t)return n;if(n.sheet_index===void 0)return t;if(t.sheet_index===void 0)return n;return n.sheet_index<t.sheet_index?n:t},void 0)}var j0o={"0":{width:13,height:27,ascent:22,descent:5,left:-1,right:12},"1":{width:13,height:27,ascent:22,descent:5,left:-3,right:9},"2":{width:13,height:27,ascent:22,descent:5,left:-1,right:12},"3":{width:13,height:27,ascent:22,descent:5,left:-1,right:12},"4":{width:13,height:27,ascent:22,descent:5,left:0,right:12},"5":{width:13,height:27,ascent:22,descent:5,left:-1,right:12},"6":{width:13,height:27,ascent:22,descent:5,left:-1,right:12},"7":{width:13,height:27,ascent:22,descent:5,left:-1,right:12},"8":{width:13,height:27,ascent:22,descent:5,left:-1,right:12},"9":{width:13,height:27,ascent:22,descent:5,left:-1,right:12}," ":{width:7,height:27,ascent:22,descent:5,left:0,right:0},"!":{width:7,height:27,ascent:22,descent:5,left:-2,right:5},'"':{width:9,height:27,ascent:22,descent:5,left:-1,right:7},"#":{width:13,height:27,ascent:22,descent:5,left:0,right:13},$:{width:13,height:27,ascent:22,descent:5,left:-1,right:12},"%":{width:21,height:27,ascent:22,descent:5,left:-1,right:20},"&":{width:16,height:27,ascent:22,descent:5,left:-1,right:15},"'":{width:5,height:27,ascent:22,descent:5,left:-1,right:3},"(":{width:8,height:27,ascent:22,descent:5,left:-1,right:7},")":{width:8,height:27,ascent:22,descent:5,left:-1,right:7},"*":{width:9,height:27,ascent:22,descent:5,left:-1,right:8},"+":{width:14,height:27,ascent:22,descent:5,left:-1,right:13},",":{width:7,height:27,ascent:22,descent:5,left:-2,right:5},"-":{width:8,height:27,ascent:22,descent:5,left:-1,right:7},".":{width:7,height:27,ascent:22,descent:5,left:-2,right:5},"/":{width:7,height:27,ascent:22,descent:5,left:0,right:7},":":{width:7,height:27,ascent:22,descent:5,left:-2,right:5},";":{width:7,height:27,ascent:22,descent:5,left:-2,right:5},"<":{width:14,height:27,ascent:22,descent:5,left:-1,right:13},"=":{width:14,height:27,ascent:22,descent:5,left:-1,right:13},">":{width:14,height:27,ascent:22,descent:5,left:-1,right:13},"?":{width:13,height:27,ascent:22,descent:5,left:-1,right:12},"@":{width:24,height:27,ascent:22,descent:5,left:-1,right:23},A:{width:16,height:27,ascent:22,descent:5,left:0,right:16},B:{width:16,height:27,ascent:22,descent:5,left:-2,right:15},C:{width:17,height:27,ascent:22,descent:5,left:-1,right:16},D:{width:17,height:27,ascent:22,descent:5,left:-2,right:16},E:{width:16,height:27,ascent:22,descent:5,left:-2,right:15},F:{width:15,height:27,ascent:22,descent:5,left:-2,right:14},G:{width:19,height:27,ascent:22,descent:5,left:-1,right:17},H:{width:17,height:27,ascent:22,descent:5,left:-2,right:15},I:{width:7,height:27,ascent:22,descent:5,left:-2,right:5},J:{width:12,height:27,ascent:22,descent:5,left:-1,right:10},K:{width:16,height:27,ascent:22,descent:5,left:-2,right:16},L:{width:13,height:27,ascent:22,descent:5,left:-2,right:12},M:{width:20,height:27,ascent:22,descent:5,left:-2,right:18},N:{width:17,height:27,ascent:22,descent:5,left:-2,right:15},O:{width:19,height:27,ascent:22,descent:5,left:-1,right:18},P:{width:16,height:27,ascent:22,descent:5,left:-2,right:15},Q:{width:19,height:27,ascent:22,descent:5,left:-1,right:18},R:{width:17,height:27,ascent:22,descent:5,left:-2,right:17},S:{width:16,height:27,ascent:22,descent:5,left:-1,right:15},T:{width:15,height:27,ascent:22,descent:5,left:-1,right:14},U:{width:17,height:27,ascent:22,descent:5,left:-2,right:15},V:{width:16,height:27,ascent:22,descent:5,left:0,right:16},W:{width:23,height:27,ascent:22,descent:5,left:0,right:22},X:{width:16,height:27,ascent:22,descent:5,left:0,right:16},Y:{width:16,height:27,ascent:22,descent:5,left:0,right:16},Z:{width:15,height:27,ascent:22,descent:5,left:0,right:14},"[":{width:7,height:27,ascent:22,descent:5,left:-2,right:6},"\\":{width:7,height:27,ascent:22,descent:5,left:0,right:7},"]":{width:7,height:27,ascent:22,descent:5,left:0,right:5},"^":{width:11,height:27,ascent:22,descent:5,left:-1,right:11},_:{width:13,height:27,ascent:22,descent:5,left:0,right:14},"`":{width:8,height:27,ascent:22,descent:5,left:-1,right:5},a:{width:13,height:27,ascent:22,descent:5,left:-1,right:12},b:{width:13,height:27,ascent:22,descent:5,left:-2,right:12},c:{width:12,height:27,ascent:22,descent:5,left:-1,right:12},d:{width:13,height:27,ascent:22,descent:5,left:-1,right:12},e:{width:13,height:27,ascent:22,descent:5,left:-1,right:12},f:{width:7,height:27,ascent:22,descent:5,left:0,right:8},g:{width:13,height:27,ascent:22,descent:5,left:-1,right:12},h:{width:13,height:27,ascent:22,descent:5,left:-2,right:12},i:{width:5,height:27,ascent:22,descent:5,left:-2,right:4},j:{width:5,height:27,ascent:22,descent:5,left:1,right:4},k:{width:12,height:27,ascent:22,descent:5,left:-2,right:12},l:{width:5,height:27,ascent:22,descent:5,left:-2,right:4},m:{width:20,height:27,ascent:22,descent:5,left:-2,right:18},n:{width:13,height:27,ascent:22,descent:5,left:-2,right:12},o:{width:13,height:27,ascent:22,descent:5,left:-1,right:12},p:{width:13,height:27,ascent:22,descent:5,left:-2,right:12},q:{width:13,height:27,ascent:22,descent:5,left:-1,right:12},r:{width:8,height:27,ascent:22,descent:5,left:-2,right:8},s:{width:12,height:27,ascent:22,descent:5,left:-1,right:11},t:{width:7,height:27,ascent:22,descent:5,left:0,right:6},u:{width:13,height:27,ascent:22,descent:5,left:-2,right:12},v:{width:12,height:27,ascent:22,descent:5,left:0,right:12},w:{width:17,height:27,ascent:22,descent:5,left:0,right:17},x:{width:12,height:27,ascent:22,descent:5,left:0,right:12},y:{width:12,height:27,ascent:22,descent:5,left:0,right:12},z:{width:12,height:27,ascent:22,descent:5,left:0,right:11},"{":{width:8,height:27,ascent:22,descent:5,left:-1,right:7},"|":{width:6,height:27,ascent:22,descent:5,left:-2,right:4},"}":{width:8,height:27,ascent:22,descent:5,left:-1,right:7},"~":{width:14,height:27,ascent:22,descent:5,left:-1,right:13}},o_e=(e)=>{if(!e)return 0;let t=0;for(let n of e){let o=j0o[n];if(o)t+=o.width;else t+=j0o["?"].width}return t/27},qpo=0.65,Jpo=0.08;function CBe(e){return o_e(e.text||"")+(e.display_superscript?Jpo+o_e(e.display_superscript)*qpo:0)}function Xgt(e,t,n,o="central"){let r=[{type:"text",value:e,name:"",attributes:{},children:[]}];if(t)r.push({type:"element",name:"tspan",value:"",attributes:{class:"sch-net-label-superscript","font-size":`${n*qpo}px`,dx:`${n*Jpo}`,dy:`${-n*(o==="ideographic"?0.5:0.25)}`},children:[{type:"text",value:t,name:"",attributes:{},children:[]}]});return r}var bne=(e)=>{switch(e){case"top":return{x:0,y:-1};case"bottom":return{x:0,y:1};case"left":return{x:1,y:0};case"right":return{x:-1,y:0}}throw Error(`Invalid side: ${e}`)},WL=0.3,xne=0.3,Cne=0.06,Zpo=0.2,emo=(e)=>({"data-circuit-json-type":"schematic_net_label","data-schematic-net-label-id":e.schematic_net_label_id}),nss={top_left:"start",top_right:"end",middle_left:"start",middle_right:"end",bottom_left:"start",bottom_right:"end",center:"middle",middle_top:"middle",middle_bottom:"middle"},K0o={top_left:"hanging",top_right:"hanging",bottom_left:"ideographic",bottom_right:"ideographic",center:"middle",middle_left:"middle",middle_right:"middle",middle_top:"hanging",middle_bottom:"ideographic"};function oss(e){return{left:180,top:90,bottom:-90,right:0}[e]??0}function rss(e,t,n){let o=n+WL*2+Cne*e.text.length+xne,r=bne(e.anchor_side);return e.anchor_position??{x:e.center.x-r.x*o*t/2,y:e.center.y-r.y*o*t/2}}var iss=(e,t)=>{let n=e<0?e+2*Math.PI:e,o=t<0?t+2*Math.PI:t,r=Math.abs(n-o);if(r>Math.PI)r=2*Math.PI-r;return r},tmo=({schPorts:e,symbol:t,schComponent:n})=>{let o=e.map((a)=>{let c=a.center.x-n.center.x,l=a.center.y-n.center.y;return{port:a,angle:Math.atan2(l,c)}}),r=t.ports.map((a)=>{let c=a.x-t.center.x,l=a.y-t.center.y;return{port:a,angle:Math.atan2(l,c)}});o.sort((a,c)=>a.angle-c.angle),r.sort((a,c)=>a.angle-c.angle);let i=[],s=new Set;for(let a of o){let c=null;for(let l of r){if(s.has(l.port))continue;let h=iss(a.angle,l.angle);if(c===null||h<c.angleDiff)c={symbolPort:l.port,angleDiff:h}}if(c&&c.angleDiff<Math.PI/4)i.push({schPort:a.port,symbolPort:c.symbolPort}),s.add(c.symbolPort)}return i};function nmo(e,t,n,o){let r=Math.sqrt((n.x-e.x)**2+(n.y-e.y)**2),s=Math.sqrt((o.x-t.x)**2+(o.y-t.y)**2)/r,a=t.x-s*e.x,c=t.y-s*e.y,l=Ine.translate(a,c),h=Ine.scale(s,s);return Ine.compose(l,h)}function sss(e){let t=[],n=new Map,o=new Map,r=null;for(let i of e)if(i.type==="schematic_component")t.push(i);else if(i.type==="schematic_port"&&i.schematic_component_id){let s=n.get(i.schematic_component_id)??[];s.push(i),n.set(i.schematic_component_id,s)}else if(i.type==="source_component")o.set(i.source_component_id,i);for(let i of t){let s=ass({component:i,schematicPorts:n.get(i.schematic_component_id)??[],sourceComponent:i.source_component_id?o.get(i.source_component_id):void 0});if(!s)continue;r=r?rmo(r,s):s}return r}function ass({component:e,schematicPorts:t,sourceComponent:n}){if(!e.symbol_name)return null;let o=Es[e.symbol_name];if(!o)return null;let r=tmo({schPorts:t,symbol:o,schComponent:e});if(!r[0])return null;let i=nmo(r[1]?.symbolPort??o.center,r[1]?.schPort.center??e.center,r[0].symbolPort,r[0].schPort.center),s=null;for(let a of o.primitives){if(a.type!=="text")continue;let c=css({primitive:a,component:e,sourceComponent:n});if(!c)continue;let l=omo.applyToPoint(i,a),h=XL("reference_designator"),d=lss({x:l.x,y:l.y,width:o_e(c)*h,height:h,anchor:a.anchor});s=s?rmo(s,d):d}return s}function css({primitive:e,component:t,sourceComponent:n}){if(e.text==="{REF}")return n?.display_name??n?.name??"";if(e.text==="{VAL}")return t.symbol_display_value??"";return""}function lss({x:e,y:t,width:n,height:o,anchor:r}){let i=e,s=e,a=t-o/2,c=t+o/2;if(r.includes("left"))s=e+n;else if(r.includes("right"))i=e-n;else i=e-n/2,s=e+n/2;if(r.includes("top"))a=t-o,c=t;else if(r.includes("bottom"))a=t,c=t+o;return{minX:i,minY:a,maxX:s,maxY:c}}function rmo(e,t){return{minX:Math.min(e.minX,t.minX),minY:Math.min(e.minY,t.minY),maxX:Math.max(e.maxX,t.maxX),maxY:Math.max(e.maxY,t.maxY)}}var imo=(e,t)=>{if(e.column_widths&&e.column_widths.length>0&&e.row_heights&&e.row_heights.length>0){let h=(d)=>{if(typeof d==="number")return d;if(d.endsWith("mm"))return parseFloat(d);if(d.endsWith("in"))return parseFloat(d)*25.4;return parseFloat(d)};return{column_widths:e.column_widths.map(h),row_heights:e.row_heights.map(h)}}let n=t.filter((h)=>h.type==="schematic_table_cell"&&h.schematic_table_id===e.schematic_table_id);if(n.length===0)return{column_widths:[],row_heights:[]};let o=n.reduce((h,d)=>Math.max(h,d.end_column_index),-1)+1,r=n.reduce((h,d)=>Math.max(h,d.end_row_index),-1)+1,{cell_padding:i=0.2}=e,s=Array(o).fill(0),a=Array(r).fill(0),c={},l={};for(let h of n){let d=XL("reference_designator",h.font_size),_=o_e(h.text??"")*d+2*i,p=d*1.2+2*i,m=`${h.start_row_index}-${h.start_column_index}`;c[m]=_,l[m]=p}for(let h=0;h<r;h++)for(let d=0;d<o;d++){let u=`${h}-${d}`;if(c[u]&&c[u]>s[d])s[d]=c[u];if(l[u]&&l[u]>a[h])a[h]=l[u]}for(let h of n){if(h.start_column_index===h.end_column_index&&h.start_row_index===h.end_row_index)continue;let d=`${h.start_row_index}-${h.start_column_index}`,u=c[d],_=l[d];if(u===void 0||_===void 0)continue;let p=0;for(let A=h.start_column_index;A<=h.end_column_index;A++)p+=s[A];if(u>p){let g=(u-p)/(h.end_column_index-h.start_column_index+1);for(let f=h.start_column_index;f<=h.end_column_index;f++)s[f]+=g}let m=0;for(let A=h.start_row_index;A<=h.end_row_index;A++)m+=a[A];if(_>m){let g=(_-m)/(h.end_row_index-h.start_row_index+1);for(let f=h.start_row_index;f<=h.end_row_index;f++)a[f]+=g}}return{column_widths:s,row_heights:a}},hss=10.16,dss=1.1,jL=hss/dss,uss=297/jL,pss=210/jL,yTa=20/jL,aBe=5/jL;function jgt(e={}){let t=e.center??{x:0,y:0},n=e.sheet_width===void 0?uss:e.sheet_width/jL,o=e.sheet_height===void 0?pss:e.sheet_height/jL,r=t.x-n/2,i=t.x+n/2,s=t.y-o/2,a=t.y+o/2;return{center:t,width:n,height:o,minX:r,maxX:i,minY:s,maxY:a,innerMinX:r+aBe,innerMaxX:i-aBe,innerMinY:s+aBe,innerMaxY:a-aBe}}function mss(e,t=0.5){let{POSITIVE_INFINITY:n,POSITIVE_INFINITY:o,NEGATIVE_INFINITY:r,NEGATIVE_INFINITY:i}=Number,s=0.2;for(let l of e)if(l.type==="schematic_sheet"){let h=jgt(l);c(h.center,{width:h.width,height:h.height},0)}else if(l.type==="schematic_component")c(l.center,l.size,0);else if(l.type==="schematic_port")c(l.center,{width:s,height:s},0);else if(l.type==="schematic_debug_object"){if(l.shape==="rect")c(l.center,l.size,0);else if(l.shape==="line")c(l.start,{width:0.1,height:0.1},0),c(l.end,{width:0.1,height:0.1},0)}else if(l.type==="schematic_net_label"){let h=XL("net_label"),d=CBe(l),_=(d+WL*2+Cne*(l.text?.length||0)+xne)*h,p=Zpo,m=oss(l.anchor_side)/180*Math.PI,A=rss(l,h,d),g=bne(l.anchor_side),f={x:A.x+g.x*_/2,y:A.y+g.y*_/2};c(f,{width:_,height:p},m)}else if(l.type==="schematic_trace")for(let h of l.edges)c(h.from,{width:0.1,height:0.1},0),c(h.to,{width:0.1,height:0.1},0);else if(l.type==="schematic_text"){let d=XL("reference_designator",l.font_size)??0.18,u=l.text??"",_=l.display_superscript;if(_){let p=u.split(`
`),m=Math.max(...p.map((b,I)=>CBe({text:b,display_superscript:I===p.length-1?_:void 0})))*d,A=l.anchor,g=A==="left"||A.endsWith("_left")?m/2:A==="right"||A.endsWith("_right")?-m/2:0,f=A==="top"||A.startsWith("top_")?0:A==="bottom"||A.startsWith("bottom_")?-d:-d/2,y=(p.length+0.3)*d,x=-(f-0.3*d+y/2),C=-(l.rotation??0)*Math.PI/180;c({x:l.position.x+g*Math.cos(C)-x*Math.sin(C),y:l.position.y+g*Math.sin(C)+x*Math.cos(C)},{width:m,height:y},C)}else{let p=u.length*d,m=d;c(l.position,{width:p,height:m},l.rotation??0)}}else if(l.type==="schematic_voltage_probe"){if(c(l.position,{width:0.2,height:0.4},0),l.name){let h=XL("net_label"),d=o_e(l.name)*h,u=h,_=0.3,p=l.label_alignment??"top_right",m=l.position.x,A=l.position.y;if(p.includes("top"))A+=0.3+u/2;else if(p.includes("bottom"))A-=0.3+u/2;if(p.includes("right"))m+=0.3+d/2;else if(p.includes("left"))m-=0.3+d/2;c({x:m,y:A},{width:d,height:u},0)}}else if(l.type==="schematic_box")c({x:l.x+l.width/2,y:l.y+l.height/2},{width:l.width,height:l.height},0);else if(l.type==="schematic_table"){let{column_widths:h,row_heights:d}=imo(l,e),u=h.reduce((y,x)=>y+x,0),_=d.reduce((y,x)=>y+x,0),p=l.anchor??"center",m=l.anchor_position.x,A=l.anchor_position.y;if(p.includes("center"))m-=u/2;else if(p.includes("right"))m-=u;if(p.includes("center"))A+=_/2;else if(p.includes("bottom"))A+=_;let g=m+u/2,f=A-_/2;c({x:g,y:f},{width:u,height:_},0)}else if(l.type==="schematic_line")c({x:l.x1,y:l.y1},{width:0.02,height:0.02},0),c({x:l.x2,y:l.y2},{width:0.02,height:0.02},0);else if(l.type==="schematic_circle")c(l.center,{width:l.radius*2,height:l.radius*2},0);else if(l.type==="schematic_rect")c(l.center,{width:l.width,height:l.height},l.rotation);else if(l.type==="schematic_arc")c(l.center,{width:l.radius*2,height:l.radius*2},0);else if(l.type==="schematic_path"){if(l.points&&l.points.length>0)for(let h of l.points)c(h,{width:0.02,height:0.02},0)}if(!Number.isFinite(n))n=-1,o=-1,r=1,i=1;n-=t,o-=t,r+=t,i+=t;let a=sss(e);if(a){if(a.minX<n)n=a.minX-t;if(a.minY<o)o=a.minY-t;if(a.maxX>r)r=a.maxX+t;if(a.maxY>i)i=a.maxY+t}return{minX:n,minY:o,maxX:r,maxY:i};function c(l,h,d){let u=[{x:-h.width/2,y:-h.height/2},{x:h.width/2,y:-h.height/2},{x:h.width/2,y:h.height/2},{x:-h.width/2,y:h.height/2}];for(let _ of u){let p=_.x*Math.cos(d)-_.y*Math.sin(d)+l.x,m=_.x*Math.sin(d)+_.y*Math.cos(d)+l.y;n=Math.min(n,p),o=Math.min(o,m),r=Math.max(r,p),i=Math.max(i,m)}}}function cBe(e){if(!Number.isFinite(e))return"0";return Number.parseFloat(e.toFixed(6)).toString()}var r_e="image/svg+xml";function _ss({schematicGraphic:e,viewport:t}){let n=gss(e);return{name:"g",type:"element",value:"",attributes:{class:"schematic-graphic","pointer-events":"none","data-circuit-json-type":"schematic_graphic","data-schematic-graphic-id":e.schematic_graphic_id,...e.schematic_sheet_id?{"data-schematic-sheet-id":e.schematic_sheet_id}:{}},children:[{name:"image",type:"element",value:"",attributes:{href:n,x:cBe(t.x),y:cBe(t.y),width:cBe(t.width),height:cBe(t.height),preserveAspectRatio:"xMidYMid meet",overflow:"hidden","pointer-events":"none"},children:[]}]}}function gss(e){let t=`Unable to render schematic graphic "${e.schematic_graphic_id}"`,{asset:n,svg_content:o}=e;if(!n){if(o!==void 0)return $0o(o);throw Error(`${t}: asset or svg_content is required`)}if(smo(n.mimetype)!==r_e)throw Error(`${t}: asset.mimetype must be "${r_e}" (received ${JSON.stringify(n.mimetype)})`);let r=n.url.trim();if(r.toLowerCase().startsWith("data:"))return Ass(r,t),r;if(o!==void 0)return $0o(o);throw Error(`${t}: asset.url must be an inline SVG data URL because circuit-to-svg cannot synchronously load ${JSON.stringify(n.url)}`)}function Ass(e,t){let n=e.match(/^data:([^,]*),(.*)$/is);if(!n)throw Error(`${t}: asset.url is not a valid SVG data URL`);let o=n[1].split(";").map((c)=>c.trim());if(smo(o.shift()??"")!==r_e)throw Error(`${t}: asset.url must use the "${r_e}" media type`);let i=n[2],s=o.findIndex((c)=>c.toLowerCase()==="base64"),a=s!==-1;if(a&&s!==o.length-1)throw Error(`${t}: asset.url must place "base64" as its final metadata token`);if(a){let c=i.replace(/\s+/g,"");if(!/^(?:[a-z\d+/]{4})*(?:[a-z\d+/]{2}==|[a-z\d+/]{3}=)?$/i.test(c))throw Error(`${t}: asset.url is not a valid SVG data URL`);return}if(i.includes("#"))throw Error(`${t}: asset.url must percent-encode "#" in a non-base64 SVG data URL`);try{decodeURIComponent(i)}catch(c){throw Error(`${t}: asset.url is not a valid SVG data URL`,{cause:c})}}function $0o(e){let t=new TextEncoder().encode(e),n="",o=32768;for(let r=0;r<t.length;r+=o)n+=String.fromCharCode(...t.subarray(r,r+o));return`data:${r_e};base64,${btoa(n)}`}function smo(e){return(e.split(";",1)[0]??"").trim().toLowerCase()}var B_=(e)=>Math.abs(e.a)*0.02,Lgt=({text:e,realCenter:t,realToScreenTransform:n})=>{let o=amo.applyToPoint(n,t);return{type:"element",name:"text",value:"",attributes:{x:o.x.toString(),y:o.y.toString(),fill:"red","text-anchor":"middle","dominant-baseline":"middle","font-family":"sans-serif","font-size":`${Q3(n,"error")}px`},children:[{type:"text",value:e,name:"",attributes:{},children:[]}]}},fss=({schNetLabel:e,realToScreenTransform:t,colorMap:n})=>{if(!e.text)return[];let o=e.text.startsWith("N_"),r=o?e.text.slice(2):e.text,i=emo(e),s=[],a=Es[e.symbol_name];if(!a){let H=Lgt({text:`Symbol not found: ${e.symbol_name}`,realCenter:e.center,realToScreenTransform:t});return H.attributes={...H.attributes,...i},s.push(H),s}let c=a.primitives.filter((H)=>H.type==="path"),l=a.primitives.filter((H)=>H.type==="text"),h=a.primitives.filter((H)=>H.type==="circle"),d=a.primitives.filter((H)=>H.type==="box"),u={minX:Math.min(...c.flatMap((H)=>H.points.map((V)=>V.x))),maxX:Math.max(...c.flatMap((H)=>H.points.map((V)=>V.x))),minY:Math.min(...c.flatMap((H)=>H.points.map((V)=>V.y))),maxY:Math.max(...c.flatMap((H)=>H.points.map((V)=>V.y)))},_=XL("net_label"),m=CBe({...e,text:r})+WL*2+Cne*r.length+xne,A=bne(e.anchor_side),g=e.anchor_position??{x:e.center.x-A.x*m*_/2,y:e.center.y-A.y*m*_/2},y=w0.rotate(0/180*Math.PI),x={minX:Math.min(...a.primitives.flatMap((H)=>H.type==="path"?H.points.map((V)=>V.x):[])),maxX:Math.max(...a.primitives.flatMap((H)=>H.type==="path"?H.points.map((V)=>V.x):[])),minY:Math.min(...a.primitives.flatMap((H)=>H.type==="path"?H.points.map((V)=>V.y):[])),maxY:Math.max(...a.primitives.flatMap((H)=>H.type==="path"?H.points.map((V)=>V.y):[]))},C=a.ports?.[0]?{x:a.ports[0].x,y:a.ports[0].y}:{x:x.minX,y:(x.minY+x.maxY)/2},b=w0.applyToPoint(y,C),I=w0.compose(w0.translate(g.x-b.x,g.y-b.y),y,w0.scale(1)),[v,P]=w0.applyToPoint(w0.compose(t,I),[u.minX,u.minY]),[M,B]=w0.applyToPoint(w0.compose(t,I),[u.maxX,u.maxY]),T=Math.abs(B-P),N=Math.min(P,B),D=Math.abs(M-v),L=Math.min(v,M);s.push({name:"rect",type:"element",value:"",attributes:{class:"component-overlay sch-component-overlay sch-net-label-overlay",...i,x:L.toString(),y:N.toString(),width:D.toString(),height:T.toString(),fill:"transparent"},children:[]});for(let H of c){let V=H.points.map((O,U)=>{let[j,Y]=w0.applyToPoint(w0.compose(t,I),[O.x,O.y]);return`${U===0?"M":"L"} ${j} ${Y}`}).join(" ");s.push({name:"path",type:"element",attributes:{class:"sch-net-label-symbol-path",...i,d:V+(H.closed?" Z":""),stroke:n.schematic.component_outline,fill:"none","stroke-width":`${B_(t)}px`,"stroke-linecap":"round"},value:"",children:[]})}for(let H of l){let V=w0.applyToPoint(w0.compose(t,I),H),O=H.text;if(O==="{REF}")O=r||"";else if(O==="{VAL}")O="";let j=Math.abs(t.a)*0.1,Y={x:V.x,y:V.y};s.push({name:"text",type:"element",attributes:{class:"sch-net-label-symbol-text",...i,x:Y.x.toString(),y:Y.y.toString(),fill:n.schematic.label_local,"font-family":"sans-serif","text-anchor":nss[H.anchor],"dominant-baseline":K0o[H.anchor],"font-size":`${Q3(t,"reference_designator")}px`,...o&&O===r?{style:"text-decoration: overline;"}:{}},children:Xgt(O,H.text==="{REF}"?e.display_superscript:void 0,Q3(t,"reference_designator"),K0o[H.anchor]),value:""})}for(let H of d){let V=w0.applyToPoint(w0.compose(t,I),H),O=w0.compose(t,I).a;s.push({name:"rect",type:"element",attributes:{class:"sch-net-label-symbol-box",...i,x:V.x.toString(),y:V.y.toString(),width:(H.width*O).toString(),height:(H.height*O).toString(),fill:"red"},value:"",children:[]})}for(let H of h){let V=w0.applyToPoint(w0.compose(t,I),H),O=w0.compose(t,I).a;s.push({name:"circle",type:"element",attributes:{class:"sch-net-label-symbol-circle",...i,cx:V.x.toString(),cy:V.y.toString(),r:(H.radius*O).toString(),fill:"none",stroke:n.schematic.component_outline,"stroke-width":`${B_(t)}px`},value:"",children:[]})}return s},yss=({schNetLabel:e,realToScreenTransform:t,colorMap:n})=>{if(!e.text)return[];let o=e.text;if(e.symbol_name)return fss({schNetLabel:e,realToScreenTransform:t,colorMap:n});let r=emo(e),i=[],s=Q3(t,"net_label"),a=XL("net_label"),c=Zpo/a/2,l=CBe({...e,text:o}),h=a6.applyToPoint(t,e.center),d=bne(e.anchor_side),u={...d};u.y*=-1;let _=l+WL*2+Cne*o.length+xne,p=e.anchor_position?a6.applyToPoint(t,e.anchor_position):{x:h.x-u.x*_*s/2,y:h.y-u.y*_*s/2},m=e.anchor_position??{x:e.center.x-d.x*_*a/2,y:e.center.y-d.y*_*a/2},A={left:0,top:-90,bottom:90,right:180}[e.anchor_side],g=[{x:0,y:0},{x:WL,y:c},{x:WL*2+xne+Cne*o.length+l,y:c},{x:WL*2+xne+Cne*o.length+l,y:-c},{x:WL,y:-c}].map((b)=>a6.applyToPoint(a6.compose(t,a6.translate(m.x,m.y),a6.scale(a),a6.rotate(A/180*Math.PI)),b)),f=`
    M ${g[0].x},${g[0].y}
    L ${g[1].x},${g[1].y}
    L ${g[2].x},${g[2].y}
    L ${g[3].x},${g[3].y}
    L ${g[4].x},${g[4].y}
    Z
  `;i.push({name:"path",type:"element",attributes:{class:"net-label sch-net-label",...r,d:f,fill:n.schematic.label_background,stroke:n.schematic.label_global,"stroke-width":`${B_(t)}px`},value:"",children:[]});let y={x:p.x+u.x*s*0.5,y:p.y+u.y*s*0.5},x={left:"start",top:"start",bottom:"start",right:"end"}[e.anchor_side],C={left:"",right:"",top:`rotate(90 ${y.x} ${y.y})`,bottom:`rotate(-90 ${y.x} ${y.y})`}[e.anchor_side];return i.push({name:"text",type:"element",attributes:{class:"net-label-text sch-net-label-text",...r,x:y.x.toString(),y:y.y.toString(),fill:n.schematic.label_global,"text-anchor":x,"dominant-baseline":"central","font-family":"sans-serif","font-variant-numeric":"tabular-nums","font-size":`${s}px`,transform:C},children:Xgt(o,e.display_superscript,s),value:""}),i},xss=0.02,Css=({schPort:e,transform:t})=>{let n=cmo.applyToPoint(t,e.center),o=Math.abs(t.a)*xss*2;return[{name:"g",type:"element",value:"",attributes:{class:"schematic-port-hover sch-port-hover","data-schematic-port-id":e.source_port_id,...e.schematic_sheet_id?{"data-schematic-sheet-id":e.schematic_sheet_id}:{}},children:[{name:"circle",type:"element",value:"",attributes:{cx:n.x.toString(),cy:n.y.toString(),r:o.toString(),fill:"red",opacity:"0"},children:[]}]}]},bss=({component:e,transform:t,circuitJson:n})=>{let o=w_(n).schematic_port.list({schematic_component_id:e.schematic_component_id}),r=[];for(let i of o)r.push(...Css({schPort:i,transform:t}));return r},Iss=({schPort:e,transform:t,colorMap:n})=>{let{x:r,y:i}=e.center,s=[-1,1].map((a)=>{let c=Hgt.applyToPoint(t,{x:r-0.05,y:i-a*0.05}),l=Hgt.applyToPoint(t,{x:r+0.05,y:i+a*0.05});return`M ${c.x} ${c.y} L ${l.x} ${l.y}`}).join(" ");return{name:"path",type:"element",value:"",attributes:{class:"sch-port-no-connect","data-schematic-port-id":e.schematic_port_id,"data-source-port-id":e.source_port_id,d:s,fill:"none",stroke:n.schematic.no_connect,"stroke-width":`${B_(t)}px`,"stroke-linecap":"round"},children:[]}},q0o=0.02,vss=({schPort:e,transform:t,circuitJson:n,colorMap:o})=>{let r=[],i=Math.abs(t.a)*q0o,s=Math.abs(t.a)*q0o,a=Fgt.applyToPoint(t,e.center),c=n.find((h)=>h.type==="source_port"&&h.source_port_id===e.source_port_id);if(!c?.do_not_connect)r.push({name:"circle",type:"element",value:"",attributes:{class:"component-pin sch-component-pin sch-port-indicator",cx:a.x.toString(),cy:a.y.toString(),r:i.toString(),fill:"none",stroke:o.schematic.component_outline,"stroke-width":s.toString(),"data-schematic-port-id":e.schematic_port_id},children:[]});let l=e.display_pin_label??c?.name;if(l){let h={...e.center},d=e.distance_from_component_edge??0,u=0.05,_="middle",p="";switch(e.facing_direction){case"left":h.x+=d/2,h.y+=0.05,_="start";break;case"right":h.x-=d/2,h.y+=0.05,_="end";break;case"up":h.y-=d/2,h.x-=0.05,_="middle";break;case"down":h.y+=d/2,h.x-=0.05,_="middle";break}let m=Fgt.applyToPoint(t,h),A=Q3(t,"pin_number");if(e.facing_direction==="up"||e.facing_direction==="down")p=`rotate(-90 ${m.x} ${m.y})`;r.push({name:"text",type:"element",value:"",attributes:{class:"port-indicator-label sch-port-label",x:m.x.toString(),y:m.y.toString(),fill:o.schematic.component_outline,"font-family":"sans-serif","font-size":`${A*0.7}px`,"text-anchor":_,"dominant-baseline":"middle",...p&&{transform:p}},children:[{type:"text",value:l,name:"",attributes:{},children:[]}]})}return r},lmo=(e)=>({type:"element",name:"tspan",value:"",attributes:e.is_overlined?{"text-decoration":"overline"}:{},children:[{type:"text",name:"",value:e.text,attributes:{},children:[]}]}),Sss=(e)=>e.filter((t)=>t.text).map(lmo),Pss=(e)=>{let t=[[]];for(let n of e)n.text.split(`
`).forEach((o,r)=>{if(r>0)t.push([]);if(o)t.at(-1).push(lmo({...n,text:o}))});return t},Kgt=({elm:e,transform:t,colorMap:n})=>{let o=hmo.applyToPoint(t,e.position),r={center:"middle",center_right:"end",bottom_left:"start",bottom_center:"middle",bottom_right:"end",left:"start",right:"end",top:"middle",bottom:"middle",top_left:"start",top_center:"middle",top_right:"end",center_left:"start"},i={center:"middle",center_right:"middle",bottom_left:"ideographic",bottom_center:"ideographic",bottom_right:"ideographic",left:"middle",right:"middle",top:"hanging",bottom:"ideographic",top_left:"hanging",top_center:"hanging",top_right:"hanging",center_left:"middle"},s=e.text.split(`
`),a=Pss(e.text_parts??[]),c=s.length===1?e.text_parts?.length?a[0]:[{type:"text",value:e.text,name:e.schematic_text_id,attributes:{},children:[]}]:s.map((l,h)=>({type:"element",name:"tspan",value:"",attributes:{x:o.x.toString(),...h>0?{dy:"1em"}:{}},children:e.text_parts?.length?a[h]??[]:[{type:"text",value:l,name:h===0?e.schematic_text_id:"",attributes:{},children:[]}]}));if(e.display_superscript)(s.length===1?c:c[c.length-1].children).push(...Xgt("",e.display_superscript,Q3(t,"reference_designator",e.font_size),i[e.anchor]).slice(1));return{type:"element",name:"text",value:"",attributes:{class:"sch-text","data-schematic-text-id":e.schematic_text_id,x:o.x.toString(),y:o.y.toString(),fill:e.color??n.schematic.sheet_label,"text-anchor":r[e.anchor],"dominant-baseline":i[e.anchor],"font-family":"sans-serif","font-size":`${Q3(t,"reference_designator",e.font_size)}px`,transform:`rotate(${e.rotation}, ${o.x}, ${o.y})`},children:c}};function umo({schArc:e,transform:t,colorMap:n}){let o=dmo.applyToPoint(t,e.center),r=Math.abs(t.a)*e.radius,i=e.stroke_width??0.02,s=Math.abs(t.a)*i,a=e.start_angle_degrees*Math.PI/180,c=e.end_angle_degrees*Math.PI/180,l=o.x+r*Math.cos(a),h=o.y+r*Math.sin(a),d=o.x+r*Math.cos(c),u=o.y+r*Math.sin(c),_=e.end_angle_degrees-e.start_angle_degrees;if(e.direction==="clockwise")_=-_;if(_<0)_+=360;let p=_>180?1:0,m=e.direction==="clockwise"?1:0;return[{name:"path",type:"element",attributes:{class:"sch-arc",d:`M ${l} ${h} A ${r} ${r} 0 ${p} ${m} ${d} ${u}`,fill:"none",stroke:e.color,"stroke-width":s.toString(),...e.is_dashed&&{"stroke-dasharray":(s*3).toString()},"data-schematic-arc-id":e.schematic_arc_id,...e.schematic_component_id&&{"data-schematic-component-id":e.schematic_component_id}},children:[],value:""}]}var Ess=({schematicBox:e,transform:t,colorMap:n})=>{let o=zgt.applyToPoint(t,{x:e.x,y:e.y}),r=zgt.applyToPoint(t,{x:e.x+e.width,y:e.y+e.height}),i=Math.min(o.y,r.y),s=Math.max(o.y,r.y),a=Math.min(o.x,r.x),c=Math.max(o.x,r.x),l=B_(t),h={class:"schematic-box sch-box",x:a.toString(),y:i.toString(),width:(c-a).toString(),height:(s-i).toString(),"stroke-width":`${l}px`,stroke:n.schematic.component_outline||"black",fill:"transparent"};if(e.is_dashed){let d=8*l,u=4*l;h["stroke-dasharray"]=`${d} ${u}`}return[{name:"rect",type:"element",value:"",attributes:h,children:[]}]};function mmo({schCircle:e,transform:t,colorMap:n}){let o=pmo.applyToPoint(t,e.center),r=Math.abs(t.a)*e.radius,i=e.stroke_width??0.02,s=Math.abs(t.a)*i;return[{name:"circle",type:"element",attributes:{class:"sch-circle",cx:o.x.toString(),cy:o.y.toString(),r:r.toString(),fill:e.is_filled?e.fill_color??e.color:"none",stroke:e.color,"stroke-width":s.toString(),...e.is_dashed&&{"stroke-dasharray":(s*3).toString()},"data-schematic-circle-id":e.schematic_circle_id,...e.schematic_component_id&&{"data-schematic-component-id":e.schematic_component_id}},children:[],value:""}]}var _mo=(e,t)=>{for(let n of e){if(n.type!=="source_trace")continue;let o=n;if(Array.isArray(o.connected_source_port_ids)&&o.connected_source_port_ids.includes(t))return!0}return!1},Mss={top_left:"start",top_right:"end",middle_left:"start",middle_right:"end",bottom_left:"start",bottom_right:"end",center:"middle",middle_top:"middle",middle_bottom:"middle"},wss={top_left:"hanging",top_right:"hanging",bottom_left:"ideographic",bottom_right:"ideographic",center:"middle",middle_left:"middle",middle_right:"middle",middle_top:"hanging",middle_bottom:"ideographic"},Bss=({component:e,transform:t,circuitJson:n,colorMap:o})=>{let r=[],i=Es[e.symbol_name];if(!i)return[Lgt({text:`Symbol not found: ${e.symbol_name}`,realCenter:e.center,realToScreenTransform:t})];let s=w_(n).schematic_port.list({schematic_component_id:e.schematic_component_id}),a=w_(n).source_component.get(e.source_component_id),c=tmo({schPorts:s,symbol:i,schComponent:e});if(!c[0])return[Lgt({text:`Could not match ports for symbol ${e.symbol_name}`,realCenter:e.center,realToScreenTransform:t})];let l=nmo(c[1]?.symbolPort??i.center,c[1]?.schPort.center??e.center,c[0].symbolPort,c[0].schPort.center),h=i.primitives.filter((v)=>v.type==="path"),d=i.primitives.filter((v)=>v.type==="text"),u=i.primitives.filter((v)=>v.type==="circle"),_=i.primitives.filter((v)=>v.type==="box"),p=new Set;for(let v of c)if(_mo(n,v.schPort.source_port_id)||w_(n).source_port.get(v.schPort.source_port_id)?.do_not_connect)p.add(v.symbolPort);let m={minX:Math.min(...h.flatMap((v)=>v.points.map((P)=>P.x))),maxX:Math.max(...h.flatMap((v)=>v.points.map((P)=>P.x))),minY:Math.min(...h.flatMap((v)=>v.points.map((P)=>P.y))),maxY:Math.max(...h.flatMap((v)=>v.points.map((P)=>P.y)))},[A,g]=Kf.applyToPoint(Kf.compose(t,l),[m.minX,m.minY]),[f,y]=Kf.applyToPoint(Kf.compose(t,l),[m.maxX,m.maxY]),x=Math.abs(y-g),C=Math.min(g,y),b=Math.abs(f-A),I=Math.min(A,f);r.push({name:"rect",type:"element",value:"",attributes:{class:"component-overlay sch-component-overlay",x:I.toString(),y:C.toString(),width:b.toString(),height:x.toString(),fill:"transparent"},children:[]});for(let v of h){let{points:P,color:M,closed:B,fill:T}=v;r.push({type:"element",name:"path",attributes:{class:"sch-component-symbol-path",d:P.map((N,D)=>{let[L,H]=Kf.applyToPoint(Kf.compose(t,l),[N.x,N.y]);return`${D===0?"M":"L"} ${L} ${H}`}).join(" ")+(B?" Z":""),stroke:o.schematic.component_outline,fill:"none","stroke-width":`${B_(t)}px`,"stroke-linecap":"round"},value:"",children:[]})}for(let v of d){let P=Kf.applyToPoint(Kf.compose(t,l),v),M="",B=v.text==="{REF}";if(B)M=a?.display_name??a?.name??"";else if(v.text==="{VAL}")M=e.symbol_display_value??"";let T=wss[v.anchor];r.push({name:"text",type:"element",attributes:{class:B?"sch-component-name sch-component-text":"sch-component-text",x:P.x.toString(),y:P.y.toString(),...B?{stroke:o.schematic.background,"stroke-width":`${B_(t)}px`,"paint-order":"stroke"}:{},fill:o.schematic.label_local,"font-family":"sans-serif","text-anchor":Mss[v.anchor],"dominant-baseline":T,"font-size":`${Q3(t,"reference_designator")}px`},value:"",children:[{type:"text",value:M,name:"",attributes:{},children:[]}]})}for(let v of _){let P=Kf.applyToPoint(Kf.compose(t,l),v),M=Kf.compose(t,l).a;r.push({name:"rect",type:"element",attributes:{class:"sch-component-symbol-box",x:P.x.toString(),y:P.y.toString(),width:(v.width*M).toString(),height:(v.height*M).toString(),fill:"red"},value:"",children:[]})}for(let v of i.ports){if(p.has(v))continue;let P=Kf.applyToPoint(Kf.compose(t,l),v);r.push({type:"element",name:"circle",attributes:{class:"component-pin sch-component-pin",cx:P.x.toString(),cy:P.y.toString(),r:`${Math.abs(t.a)*0.02}px`,"stroke-width":`${B_(t)}px`,fill:"none",stroke:o.schematic.component_outline},value:"",children:[]})}for(let v of u){let P=Kf.applyToPoint(Kf.compose(t,l),v),M=Math.abs(v.radius*t.a);r.push({type:"element",name:"circle",attributes:{class:"sch-component-symbol-circle",cx:P.x.toString(),cy:P.y.toString(),r:`${M}px`,"stroke-width":`${B_(t)}px`,fill:"none",stroke:o.schematic.component_outline},value:"",children:[]})}return r},Xme=0.02,J0o=(e,t,n,o,r)=>{let i=Math.PI/6,s={x:e.x-n*Math.cos(t-i),y:e.y-n*Math.sin(t-i)},a={x:e.x-n*Math.cos(t+i),y:e.y-n*Math.sin(t+i)};return{name:"polygon",type:"element",attributes:{points:`${e.x},${e.y} ${s.x},${s.y} ${a.x},${a.y}`,fill:"white",stroke:o,"stroke-width":`${r}px`},value:"",children:[]}},Tss=({schPort:e,schComponent:t,transform:n,circuitJson:o})=>{let r=[],i=w_(o).source_port.get(e.source_port_id),s={x:e.center.x,y:e.center.y},a=e.distance_from_component_edge??0.4;switch(e.side_of_component){case"left":s.x+=a;break;case"right":s.x-=a;break;case"top":s.y-=a;break;case"bottom":s.y+=a;break}let c=ABe.applyToPoint(n,e.center),l=ABe.applyToPoint(n,s),h=i!=null&&i.source_component_id==null&&typeof e.is_connected==="boolean"?e.is_connected:_mo(o,e.source_port_id),d=e.is_drawn_with_inversion_circle??!1,u=0.06,_={...e.center};if(!h&&!i?.do_not_connect)switch(e.side_of_component){case"left":_.x+=Xme;break;case"right":_.x-=Xme;break;case"top":_.y-=Xme;break;case"bottom":_.y+=Xme;break}let p=ABe.applyToPoint(n,_);if(d){let y=Math.abs(n.a)*u,x={...l};switch(e.side_of_component){case"left":x.x-=y,l.x-=y*2;break;case"right":x.x+=y,l.x+=y*2;break;case"top":x.y-=y,l.y-=y*2;break;case"bottom":x.y+=y,l.y+=y*2;break}r.push({name:"circle",type:"element",attributes:{class:"component-pin sch-component-pin sch-inversion-bubble",cx:x.x.toString(),cy:x.y.toString(),r:y.toString(),fill:"white",stroke:YA.schematic.component_outline,"stroke-width":`${B_(n)}px`},value:"",children:[]})}r.push({name:"line",type:"element",attributes:{class:"component-pin sch-component-pin sch-port-line",x1:l.x.toString(),y1:l.y.toString(),x2:p.x.toString(),y2:p.y.toString(),"stroke-width":`${B_(n)}px`},value:"",children:[]});let m=Math.abs(n.a)*Xme,A=[];if(!h&&!i?.do_not_connect)A.push({name:"circle",type:"element",attributes:{class:"component-pin sch-component-pin sch-port-terminal",cx:c.x.toString(),cy:c.y.toString(),r:m.toString(),"stroke-width":`${B_(n)}px`},value:"",children:[]});A.push({name:"rect",type:"element",attributes:{x:(c.x-m).toString(),y:(c.y-m).toString(),width:(m*2).toString(),height:(m*2).toString(),opacity:"0"},value:"",children:[]}),r.push({name:"g",type:"element",value:"",attributes:{class:"sch-port","data-schematic-port-id":e.source_port_id},children:A});let{has_input_arrow:g,has_output_arrow:f}=e;if((g||f)&&e.side_of_component){let y=Math.abs(n.a)*0.1,x=YA.schematic.component_outline,C=y*Math.cos(Math.PI/6),b=B_(n)/3,I=0,v=0;if(e.side_of_component==="left")I=0,v=Math.PI;else if(e.side_of_component==="right")I=Math.PI,v=0;else if(e.side_of_component==="top")I=Math.PI/2,v=-Math.PI/2;else if(e.side_of_component==="bottom")I=-Math.PI/2,v=Math.PI/2;let P=g&&f,M={...l},B={...l};if(P){let T=C;if(e.side_of_component==="left")B.x-=T;else if(e.side_of_component==="right")B.x+=T;else if(e.side_of_component==="top")B.y-=T;else if(e.side_of_component==="bottom")B.y+=T}if(g)r.push(J0o(M,I,y,x,b));if(f){let T={x:B.x+y*Math.cos(v),y:B.y+y*Math.sin(v)};r.push(J0o(T,v,y,x,b))}}return r},Dss=(e)=>{let t=[],{schPort:n,schComponent:o,transform:r,circuitJson:i}=e,s={x:n.center.x,y:n.center.y};if(!n.side_of_component)return[];let a=bne(n.side_of_component),c=n.distance_from_component_edge??0.4;if(s.x+=a.x*c/2,s.y+=a.y*c/2,n.side_of_component==="top"||n.side_of_component==="bottom")s.x-=0.02;else s.y+=0.02;let l=gmo.applyToPoint(r,s);return t.push({name:"text",type:"element",attributes:{class:"pin-number sch-pin-number",x:l.x.toString(),y:l.y.toString(),style:"font-family: sans-serif;",fill:YA.schematic.pin_number,"text-anchor":"middle","dominant-baseline":"auto","font-size":`${Q3(r,"pin_number")}px`,transform:n.side_of_component==="top"||n.side_of_component==="bottom"?`rotate(-90 ${l.x} ${l.y})`:""},children:[{type:"text",value:n.pin_number?.toString()||"",name:"",attributes:{},children:[]}],value:""}),t},Z0o=0.1,fmo=(e)=>{let t=[],{schPort:n,schComponent:o,transform:r,labelColor:i=YA.schematic.pin_number,labelClassName:s="pin-number sch-pin-label"}=e,a={x:n.center.x,y:n.center.y};if(!n.side_of_component)return[];let c=bne(n.side_of_component),l=n.distance_from_component_edge??0.4;a.x+=c.x*(l+Z0o),a.y+=c.y*(l+Z0o);let h=Amo.applyToPoint(r,a),d=n.display_pin_label??o.port_labels?.[`${n.pin_number}`];if(!d)return[];let u=d.startsWith("N_"),_=u?d.slice(2):d,p=n.display_pin_label_text_parts,m=n.is_drawn_with_inversion_circle??!1,A=Q3(r,u||m?"negated_pin_number":"pin_number",n.display_pin_label_font_size);return t.push({name:"text",type:"element",attributes:{class:s,x:h.x.toString(),y:h.y.toString(),style:`font-family: sans-serif;${u&&!p?.length?" text-decoration: overline;":""}`,fill:i,"text-anchor":n.side_of_component==="left"||n.side_of_component==="bottom"?"start":"end","dominant-baseline":"middle","font-size":`${A}px`,transform:n.side_of_component==="top"||n.side_of_component==="bottom"?`rotate(-90 ${h.x} ${h.y})`:""},children:p?.length?Sss(p):[{type:"text",value:_||"",name:"",attributes:{},children:[]}],value:""}),t},Nss=(e)=>{let t=[],{schPort:n,schComponent:o,transform:r,circuitJson:i}=e;return t.push(...Tss(e)),t.push(...Dss(e)),t.push(...fmo(e)),t},Rss=({component:e,transform:t,circuitJson:n,colorMap:o})=>{let r=[],i=Ogt.applyToPoint(t,{x:e.center.x-e.size.width/2,y:e.center.y+e.size.height/2}),s=Ogt.applyToPoint(t,{x:e.center.x+e.size.width/2,y:e.center.y-e.size.height/2}),a=s.x-i.x,c=s.y-i.y;r.push({name:"rect",type:"element",value:"",attributes:{class:"component chip sch-component-body",x:i.x.toString(),y:i.y.toString(),width:a.toString(),height:c.toString(),"stroke-width":`${B_(t)}px`,fill:o.schematic.component_body,stroke:o.schematic.component_outline},children:[]}),r.push({name:"rect",type:"element",value:"",attributes:{class:"component-overlay sch-component-overlay",x:i.x.toString(),y:i.y.toString(),width:a.toString(),height:c.toString(),fill:"transparent"},children:[]});let l=w_(n).schematic_text.list();for(let d of l)if(d.schematic_component_id===e.schematic_component_id)r.push(Kgt({elm:d,transform:t,colorMap:o}));let h=w_(n).schematic_port.list({schematic_component_id:e.schematic_component_id});for(let d of h)r.push(...Nss({schPort:d,schComponent:e,transform:t,circuitJson:n}));return r};function ymo({isDashed:e,dashLength:t,dashGap:n,strokeWidth:o,transform:r}){if(!e)return;let i=Math.abs(r.a),s=o*i*3,a=t!==void 0?t*i:s,c=n!==void 0?n*i:s;return`${a} ${c}`}function xmo({schLine:e,transform:t,colorMap:n}){let o=Vgt.applyToPoint(t,{x:e.x1,y:e.y1}),r=Vgt.applyToPoint(t,{x:e.x2,y:e.y2}),i=e.stroke_width??0.02,s=Math.abs(t.a)*i,a=ymo({isDashed:e.is_dashed,dashLength:e.dash_length,dashGap:e.dash_gap,strokeWidth:i,transform:t});return[{name:"line",type:"element",attributes:{class:"sch-line",x1:o.x.toString(),y1:o.y.toString(),x2:r.x.toString(),y2:r.y.toString(),stroke:e.color,"stroke-width":s.toString(),...a&&{"stroke-dasharray":a},"data-schematic-line-id":e.schematic_line_id,...e.schematic_component_id&&{"data-schematic-component-id":e.schematic_component_id}},children:[],value:""}]}function bmo({schRect:e,transform:t,colorMap:n}){let o=Cmo.applyToPoint(t,e.center),r=Math.abs(t.a)*e.width,i=Math.abs(t.d)*e.height,s=e.stroke_width??0.02,a=Math.abs(t.a)*s,c=o.x-r/2,l=o.y-i/2;return[{name:"rect",type:"element",attributes:{class:"sch-rect",x:c.toString(),y:l.toString(),width:r.toString(),height:i.toString(),fill:e.is_filled?e.fill_color??e.color:"none",stroke:e.color,"stroke-width":a.toString(),...e.is_dashed&&{"stroke-dasharray":(a*3).toString()},...e.rotation!==0&&{transform:`rotate(${e.rotation} ${o.x} ${o.y})`},"data-schematic-rect-id":e.schematic_rect_id,...e.schematic_component_id&&{"data-schematic-component-id":e.schematic_component_id}},children:[],value:""}]}function vmo({schPath:e,transform:t,colorMap:n}){let o=e.stroke_color??n.schematic.component_outline,r=e.fill_color??"none",i=e.stroke_width??0.02,s=Math.abs(t.a)*i,a=ymo({isDashed:e.is_dashed,dashLength:e.dash_length,dashGap:e.dash_gap,strokeWidth:i,transform:t});if(!e.points||e.points.length<2)return[];return[{name:"path",type:"element",attributes:{class:"sch-path",d:e.points.map((h)=>Imo.applyToPoint(t,{x:h.x,y:h.y})).map((h,d)=>`${d===0?"M":"L"} ${h.x} ${h.y}`).join(" "),stroke:o,"stroke-width":s.toString(),fill:e.is_filled?r:"none","stroke-linecap":"round","stroke-linejoin":"round",...a&&{"stroke-dasharray":a},...e.schematic_component_id&&{"data-schematic-component-id":e.schematic_component_id}},children:[],value:""}]}var Qss=({component:e,transform:t,circuitJson:n,colorMap:o})=>{let r=[],i=e.schematic_component_id;for(let s of n){if(!("schematic_component_id"in s)||s.schematic_component_id!==i)continue;if(s.type==="schematic_text"&&e.is_box_with_pins===!1)r.push(Kgt({elm:s,transform:t,colorMap:o}));else if(s.type==="schematic_line")r.push(...xmo({schLine:s,transform:t,colorMap:o}));else if(s.type==="schematic_circle")r.push(...mmo({schCircle:s,transform:t,colorMap:o}));else if(s.type==="schematic_rect")r.push(...bmo({schRect:s,transform:t,colorMap:o}));else if(s.type==="schematic_arc")r.push(...umo({schArc:s,transform:t,colorMap:o}));else if(s.type==="schematic_path")r.push(...vmo({schPath:s,transform:t,colorMap:o}))}if(e.is_box_with_pins===!1){let s=n.filter((c)=>c.type==="schematic_line"&&c.schematic_component_id===i),a=n.filter((c)=>c.type==="schematic_port"&&c.schematic_component_id===i);for(let c of a){let l=s.find((m)=>m.x1===c.center.x&&m.y1===c.center.y||m.x2===c.center.x&&m.y2===c.center.y);if(!l)continue;let h=l.x1===c.center.x&&l.y1===c.center.y?{x:l.x2,y:l.y2}:{x:l.x1,y:l.y1},d=h.x-c.center.x,u=h.y-c.center.y,_=Math.abs(d)>Math.abs(u)?d>0?"left":"right":u>0?"bottom":"top",p=Math.max(Math.abs(d),Math.abs(u));r.push(...fmo({schPort:{...c,side_of_component:_,distance_from_component_edge:p},schComponent:e,transform:t,circuitJson:n,labelClassName:"port-label sch-pin-label",labelColor:o.schematic.pin_name}))}}return r};function kss(e){let{component:t}=e,n=[];if(t.is_box_with_pins!==!1)if(t.symbol_name)n=Bss(e);else n=Rss(e);let o=Qss(e),r=[...n,...o];return[{type:"element",name:"g",attributes:{class:"sch-component","data-circuit-json-type":"schematic_component","data-schematic-component-id":t.schematic_component_id,...t.schematic_sheet_id?{"data-schematic-sheet-id":t.schematic_sheet_id}:{}},children:r,value:""}]}function Lss({debugObject:e,transform:t}){if(e.shape==="rect"){let[n,o]=mne.applyToPoint(t,[e.center.x-e.size.width/2,e.center.y-e.size.height/2]),[r,i]=mne.applyToPoint(t,[e.center.x+e.size.width/2,e.center.y+e.size.height/2]);[o,i]=[Math.min(o,i),Math.max(o,i)];let s=Math.abs(r-n),a=Math.abs(i-o),[c,l]=mne.applyToPoint(t,[e.center.x,e.center.y]);return[{name:"rect",type:"element",value:"",attributes:{x:n.toString(),y:o.toString(),width:s.toString(),height:a.toString(),fill:"none",stroke:"red","stroke-width":(0.02*Math.abs(t.a)).toString(),"stroke-dasharray":"5,5"},children:e.label?[{name:"text",type:"element",value:"",attributes:{x:c.toString(),y:(l-10).toString(),"text-anchor":"middle","font-size":(0.2*Math.abs(t.a)).toString(),fill:"red"},children:[{type:"text",value:e.label,name:"",attributes:{},children:[]}]}]:[]}]}if(e.shape==="line"){let[n,o]=mne.applyToPoint(t,[e.start.x,e.start.y]),[r,i]=mne.applyToPoint(t,[e.end.x,e.end.y]),s=(n+r)/2,a=(o+i)/2;return[{name:"line",type:"element",value:"",attributes:{x1:n.toString(),y1:o.toString(),x2:r.toString(),y2:i.toString(),stroke:"red","stroke-width":(0.02*Math.abs(t.a)).toString(),"stroke-dasharray":"5,5"},children:e.label?[{name:"text",type:"element",value:"",attributes:{x:s.toString(),y:(a-10).toString(),"text-anchor":"middle","font-size":(0.2*Math.abs(t.a)).toString(),fill:"red"},children:[{type:"text",value:e.label,name:"",attributes:{},children:[]}]}]:[]}]}return[]}var Smo=0.2/jL,Hss=3/jL,lBe=["1","2","3","4","5","6"],jme=["A","B","C","D"];function Fss({schematicSheet:e,transform:t,colorMap:n}){let o=jgt(e),r=n.schematic.sheet,i=n.schematic.net_name,s=[epo({id:`${e.schematic_sheet_id}_outer`,center:o.center,width:o.width,height:o.height,transform:t,color:r}),epo({id:`${e.schematic_sheet_id}_inner`,center:o.center,width:o.innerMaxX-o.innerMinX,height:o.innerMaxY-o.innerMinY,transform:t,color:r})];for(let a=1;a<lBe.length;a++){let c=o.innerMinX+(o.innerMaxX-o.innerMinX)*a/lBe.length;s.push(hBe({id:`${e.schematic_sheet_id}_top_column_${a}`,x1:c,y1:o.maxY,x2:c,y2:o.innerMaxY,transform:t,color:r}),hBe({id:`${e.schematic_sheet_id}_bottom_column_${a}`,x1:c,y1:o.minY,x2:c,y2:o.innerMinY,transform:t,color:r}))}for(let a=1;a<jme.length;a++){let c=o.innerMinY+(o.innerMaxY-o.innerMinY)*a/jme.length;s.push(hBe({id:`${e.schematic_sheet_id}_left_row_${a}`,x1:o.minX,y1:c,x2:o.innerMinX,y2:c,transform:t,color:r}),hBe({id:`${e.schematic_sheet_id}_right_row_${a}`,x1:o.maxX,y1:c,x2:o.innerMaxX,y2:c,transform:t,color:r}))}return lBe.forEach((a,c)=>{let l=o.innerMinX+(o.innerMaxX-o.innerMinX)*(c+0.5)/lBe.length;s.push(dBe({text:a,x:l,y:(o.maxY+o.innerMaxY)/2,transform:t,color:i}),dBe({text:a,x:l,y:(o.minY+o.innerMinY)/2,transform:t,color:i}))}),jme.forEach((a,c)=>{let l=o.innerMinY+(o.innerMaxY-o.innerMinY)*(jme.length-c-0.5)/jme.length;s.push(dBe({text:a,x:(o.minX+o.innerMinX)/2,y:l,transform:t,color:i}),dBe({text:a,x:(o.maxX+o.innerMaxX)/2,y:l,transform:t,color:i}))}),[{name:"g",type:"element",value:"",attributes:{class:"schematic-sheet","data-circuit-json-type":"schematic_sheet","data-schematic-sheet-id":e.schematic_sheet_id},children:s}]}function epo({id:e,center:t,width:n,height:o,transform:r,color:i}){let s=i_e.applyToPoint(r,t),a=Math.abs(r.a)*n,c=Math.abs(r.d)*o;return{name:"rect",type:"element",value:"",attributes:{class:"sch-rect",x:(s.x-a/2).toString(),y:(s.y-c/2).toString(),width:a.toString(),height:c.toString(),fill:"none",stroke:i,"stroke-width":(Math.abs(r.a)*Smo).toString(),"data-schematic-rect-id":e},children:[]}}function hBe({id:e,x1:t,y1:n,x2:o,y2:r,transform:i,color:s}){let a=i_e.applyToPoint(i,{x:t,y:n}),c=i_e.applyToPoint(i,{x:o,y:r});return{name:"line",type:"element",value:"",attributes:{class:"sch-line",x1:a.x.toString(),y1:a.y.toString(),x2:c.x.toString(),y2:c.y.toString(),stroke:s,"stroke-width":(Math.abs(i.a)*Smo).toString(),"data-schematic-line-id":e},children:[]}}function dBe({text:e,x:t,y:n,transform:o,color:r}){let i=i_e.applyToPoint(o,{x:t,y:n});return{type:"element",name:"text",value:"",attributes:{class:"sch-text",x:i.x.toString(),y:i.y.toString(),fill:r,"text-anchor":"middle","dominant-baseline":"middle","font-family":"sans-serif","font-size":`${Q3(o,"reference_designator",Hss)}px`,transform:`rotate(0, ${i.x}, ${i.y})`},children:[{type:"text",value:e,name:"",attributes:{},children:[]}]}}var zss=({schematicTable:e,transform:t,colorMap:n,circuitJson:o})=>{let{anchor_position:r,border_width:i=0.05,anchor:s="center"}=e,{column_widths:a,row_heights:c}=imo(e,o),l=a.reduce((I,v)=>I+v,0),h=c.reduce((I,v)=>I+v,0),{x:d,y:u}=r;if(s.includes("center"))d-=l/2;else if(s.includes("right"))d-=l;if(s.includes("center"))u+=h/2;else if(s.includes("bottom"))u+=h;let _=[],p=i*Math.abs(t.a),m=B_(t),[A,g]=UL.applyToPoint(t,[d,u]),[f,y]=UL.applyToPoint(t,[d+l,u-h]);_.push({name:"rect",type:"element",attributes:{class:"sch-table-border",x:A.toString(),y:g.toString(),width:(f-A).toString(),height:(y-g).toString(),fill:"none",stroke:n.schematic.table,"stroke-width":p.toString()},children:[],value:""});let x=o.filter((I)=>I.type==="schematic_table_cell"&&I.schematic_table_id===e.schematic_table_id),C=d;for(let I=0;I<a.length-1;I++){C+=a[I];let v=u;for(let P=0;P<c.length;P++){let M=v-c[P];if(!x.some((T)=>T.start_column_index<=I&&T.end_column_index>I&&T.start_row_index<=P&&T.end_row_index>=P)){let T=UL.applyToPoint(t,{x:C,y:v}),N=UL.applyToPoint(t,{x:C,y:M});_.push({name:"line",type:"element",attributes:{class:"sch-table-grid-line",x1:T.x.toString(),y1:T.y.toString(),x2:N.x.toString(),y2:N.y.toString(),stroke:n.schematic.table,"stroke-width":m.toString()},children:[],value:""})}v=M}}let b=u;for(let I=0;I<c.length-1;I++){b-=c[I];let v=d;for(let P=0;P<a.length;P++){let M=v+a[P];if(!x.some((T)=>T.start_row_index<=I&&T.end_row_index>I&&T.start_column_index<=P&&T.end_column_index>=P)){let T=UL.applyToPoint(t,{x:v,y:b}),N=UL.applyToPoint(t,{x:M,y:b});_.push({name:"line",type:"element",attributes:{class:"sch-table-grid-line",x1:T.x.toString(),y1:T.y.toString(),x2:N.x.toString(),y2:N.y.toString(),stroke:n.schematic.table,"stroke-width":m.toString()},children:[],value:""})}v=M}}for(let I of x)if(I.text){let v=a.slice(I.start_column_index,I.end_column_index+1).reduce((j,Y)=>j+Y,0),P=c.slice(I.start_row_index,I.end_row_index+1).reduce((j,Y)=>j+Y,0),M=d+a.slice(0,I.start_column_index).reduce((j,Y)=>j+Y,0),B=u-c.slice(0,I.start_row_index).reduce((j,Y)=>j+Y,0),{cell_padding:T=0.2}=e,N=I.horizontal_align??"center",D=I.vertical_align??"middle",L={x:M+v/2,y:B-P/2};if(N==="left")L.x=M+T;else if(N==="right")L.x=M+v-T;if(D==="top")L.y=B-T;else if(D==="bottom")L.y=B-P+T;let H=UL.applyToPoint(t,L),V=Q3(t,"reference_designator",I.font_size),O={left:"start",center:"middle",right:"end"},U={top:"hanging",middle:"middle",bottom:"ideographic"};_.push({name:"text",type:"element",attributes:{class:"sch-table-text",x:H.x.toString(),y:H.y.toString(),"font-size":`${V}px`,"text-anchor":O[N],"dominant-baseline":U[D],fill:n.schematic.table,"font-family":"sans-serif"},children:[{type:"text",value:I.text,name:"",attributes:{},children:[]}],value:""})}return[{name:"g",type:"element",attributes:{class:"sch-table","data-schematic-table-id":e.schematic_table_id},children:_,value:""}]};function Oss({trace:e,transform:t,colorMap:n}){let o=e.edges;if(o.length===0)return[];let r=[],i=[],s="";for(let a=0;a<o.length;a++){let c=o[a];if(c.is_crossing)continue;let[l,h]=_ne.applyToPoint(t,[c.from.x,c.from.y]),[d,u]=_ne.applyToPoint(t,[c.to.x,c.to.y]);if(a===0||o[a-1]?.is_crossing)s+=`M ${l} ${h} L ${d} ${u}`;else s+=` L ${d} ${u}`}if(s)r.push({name:"path",type:"element",attributes:{d:s,class:"trace-invisible-hover-outline sch-trace-hitbox",stroke:n.schematic.wire,fill:"none","stroke-width":`${B_(t)*8}px`,"stroke-linecap":"round",opacity:"0","stroke-linejoin":"round"},value:"",children:[]}),r.push({name:"path",type:"element",attributes:{class:"sch-trace-path",d:s,stroke:n.schematic.wire,fill:"none","stroke-width":`${B_(t)}px`,"stroke-linecap":"round","stroke-linejoin":"round"},value:"",children:[]});for(let a of o){if(!a.is_crossing)continue;let[c,l]=_ne.applyToPoint(t,[a.from.x,a.from.y]),[h,d]=_ne.applyToPoint(t,[a.to.x,a.to.y]),u=(c+h)/2,_=(l+d)/2,p=h-c,m=d-l,A=Math.sqrt(p*p+m*m),g=A*0.7,f=-m/A*g,y=p/A*g,x=u+f,C=_-Math.abs(y);i.push({name:"path",type:"element",attributes:{class:"trace-crossing-outline sch-trace-crossing-outline",d:`M ${c} ${l} Q ${x} ${C} ${h} ${d}`,stroke:n.schematic.background,fill:"none","stroke-width":`${B_(t)*1.5}px`,"stroke-linecap":"butt"},value:"",children:[]}),i.push({name:"path",type:"element",attributes:{class:"sch-trace-crossing-path",d:`M ${c} ${l} Q ${x} ${C} ${h} ${d}`,stroke:n.schematic.wire,fill:"none","stroke-width":`${B_(t)}px`,"stroke-linecap":"round"},value:"",children:[]})}if(e.junctions)for(let a of e.junctions){let[c,l]=_ne.applyToPoint(t,[a.x,a.y]);i.push({name:"circle",type:"element",attributes:{cx:c.toString(),cy:l.toString(),r:(Math.abs(t.a)*0.03).toString(),class:"trace-junction sch-trace-junction",fill:n.schematic.junction},value:"",children:[]})}return[{name:"g",type:"element",value:"",attributes:{class:"trace sch-trace","data-layer":"base","data-circuit-json-type":"schematic_trace","data-schematic-trace-id":e.schematic_trace_id,...e.subcircuit_connectivity_map_key&&{"data-subcircuit-connectivity-map-key":e.subcircuit_connectivity_map_key}},children:r},{name:"g",type:"element",value:"",attributes:{class:"trace-overlays sch-trace-overlays","data-layer":"overlay","data-circuit-json-type":"schematic_trace","data-schematic-trace-id":e.schematic_trace_id,...e.subcircuit_connectivity_map_key&&{"data-subcircuit-connectivity-map-key":e.subcircuit_connectivity_map_key}},children:i}]}function Vss({probe:e,transform:t,colorMap:n,fallbackColor:o}){let[r,i]=Pmo.applyToPoint(t,[e.position.x,e.position.y]),s=e.color??o??n.schematic.reference,a=Math.abs(t.a)*0.6,c=Math.abs(t.a)*0.28,l=e.label_alignment??"top_right",h,d,u,_;switch(l){case"top_left":h=-135*Math.PI/180,d="end",u=-8,_=-8;break;case"top_center":h=-90*Math.PI/180,d="middle",u=0,_=-8;break;case"top_right":h=-45*Math.PI/180,d="start",u=8,_=-8;break;case"center_left":h=180*Math.PI/180,d="end",u=-8,_=0;break;case"center":h=-90*Math.PI/180,d="middle",u=0,_=-8;break;case"center_right":h=0*Math.PI/180,d="start",u=8,_=0;break;case"bottom_left":h=135*Math.PI/180,d="end",u=-8,_=8;break;case"bottom_center":h=90*Math.PI/180,d="middle",u=0,_=8;break;case"bottom_right":h=45*Math.PI/180,d="start",u=8,_=8;break;default:h=-50*Math.PI/180,d="start",u=8,_=0}let p=r+a*Math.cos(h),m=i+a*Math.sin(h),A=r,g=i,f=[`M ${p},${m}`,`L ${A},${g}`,`M ${A},${g}`,`L ${A-c*Math.cos((h*180/Math.PI+150)*Math.PI/180)},${g-c*Math.sin((h*180/Math.PI+150)*Math.PI/180)}`,`L ${A-c*Math.cos((h*180/Math.PI+210)*Math.PI/180)},${g-c*Math.sin((h*180/Math.PI+210)*Math.PI/180)}`,"Z"].join(" "),y=(p+u).toString(),x=(m+_).toString(),C=[];if(e.name&&e.voltage!==void 0)C.push({type:"element",name:"tspan",value:"",attributes:{x:y},children:[{type:"text",value:e.name,name:"",attributes:{},children:[]}]}),C.push({type:"element",name:"tspan",value:"",attributes:{x:y,dy:"1.2em"},children:[{type:"text",value:`${e.voltage}V`,name:"",attributes:{},children:[]}]});else{let b=[];if(e.name)b.push(e.name);if(e.voltage!==void 0)b.push(`${e.voltage}V`);C.push({type:"text",value:b.join(" "),name:"",attributes:{},children:[]})}return[{name:"path",type:"element",attributes:{class:"sch-voltage-probe",d:f,stroke:s,fill:s,"stroke-width":`${B_(t)}px`},value:"",children:[]},{type:"element",name:"text",value:"",attributes:{class:"sch-voltage-probe-label",x:y,y:x,fill:s,"text-anchor":d,"dominant-baseline":"middle","font-family":"sans-serif","font-size":`${Q3(t,"reference_designator")}px`,"font-weight":"bold","data-schematic-voltage-probe-id":e.schematic_voltage_probe_id},children:C}]}var e_e=6,uBe=12,jf=12,lne=6,tpo=14,pBe=11,npo=280,Yss=140,Emo=(e)=>e.type==="schematic_component_overlap_warning"||e.type==="schematic_component_styling_warning"||e.type==="schematic_element_outside_sheet_warning"||e.type==="schematic_manual_edit_conflict_warning";function Gss({circuitJson:e,transform:t,svgWidth:n,svgHeight:o,colorMap:r}){let i=r.schematic.erc_warning,s=[];return e.filter(Emo).flatMap((a)=>{let c=Uss(a,e,t);if(!c)return[];let l=Math.max(1,n-jf*2),h=Jss(a.message,Math.max(12,Math.floor((Math.min(npo,l)-lne*2)/(pBe*0.56)))),d=Math.max(...h.map((y)=>y.length)),u=Math.min(npo,l,Math.max(Math.min(Yss,l),d*pBe*0.56+lne*2)),_=lne*2+h.length*tpo,p=Kss({targetBounds:c,calloutWidth:u,calloutHeight:_,svgWidth:n,svgHeight:o,occupiedCalloutBounds:s});s.push(p);let m=qss(a),A=bBe(c,e_e),g=$ss(p,A);return[{name:"g",type:"element",value:"",attributes:{class:"schematic-warning","data-type":a.type,"data-warning-id":m,role:"note","aria-label":a.message},children:[{name:"rect",type:"element",value:"",attributes:{x:A.minX.toString(),y:A.minY.toString(),width:(A.maxX-A.minX).toString(),height:(A.maxY-A.minY).toString(),rx:"6",fill:"none",stroke:i,"stroke-width":"1","stroke-dasharray":"4,3","data-warning-reference":"target"},children:[]},{name:"line",type:"element",value:"",attributes:{x1:g.from.x.toString(),y1:g.from.y.toString(),x2:g.to.x.toString(),y2:g.to.y.toString(),stroke:i,"stroke-width":"1","data-warning-reference":"leader"},children:[]},{name:"rect",type:"element",value:"",attributes:{x:p.minX.toString(),y:p.minY.toString(),width:u.toString(),height:_.toString(),fill:"rgba(255, 250, 235, 0.97)",stroke:i,"stroke-width":"1","data-warning-reference":"callout"},children:[]},{name:"text",type:"element",value:"",attributes:{x:(p.minX+lne).toString(),y:(p.minY+lne+pBe).toString(),fill:"#5c4300","font-family":"sans-serif","font-size":pBe.toString()},children:h.map((y,x)=>({name:"tspan",type:"element",value:"",attributes:{x:(p.minX+lne).toString(),dy:x===0?"0":tpo.toString()},children:[tas(y)]}))}]}]})}function Uss(e,t,n){let r=Wss(e).map((i)=>Xss(t,i)).filter((i)=>Boolean(i)).map((i)=>jss(i,n)).filter((i)=>Boolean(i));if(r.length===0)return null;return r.reduce(Zss)}function Wss(e){switch(e.type){case"schematic_component_overlap_warning":return e.schematic_component_ids;case"schematic_component_styling_warning":return[e.schematic_component_id,...e.schematic_port_ids??[]];case"schematic_manual_edit_conflict_warning":return[e.schematic_component_id];case"schematic_element_outside_sheet_warning":return[e.schematic_element_id]}}function Xss(e,t){return e.find((n)=>{if(!n.type.startsWith("schematic_"))return!1;let o=`${n.type}_id`;return n[o]===t})}function jss(e,t){if(e.type==="schematic_component"){let n=iU.applyToPoint(t,{x:e.center.x-e.size.width/2,y:e.center.y+e.size.height/2}),o=iU.applyToPoint(t,{x:e.center.x+e.size.width/2,y:e.center.y-e.size.height/2});return Pgt([n,o])}if(e.type==="schematic_port"){let n=iU.applyToPoint(t,e.center);return bBe(Pgt([n]),4)}if(e.type==="schematic_net_label"){let n=iU.applyToPoint(t,e.anchor_position??e.center),o=Math.max(28,e.text.length*8);return{minX:n.x-o/2,minY:n.y-10,maxX:n.x+o/2,maxY:n.y+10}}if(e.type==="schematic_trace"){let n=e.edges.flatMap((o)=>[iU.applyToPoint(t,o.from),iU.applyToPoint(t,o.to)]);if(n.length===0)return null;return bBe(Pgt(n),4)}return null}function Kss({targetBounds:e,calloutWidth:t,calloutHeight:n,svgWidth:o,svgHeight:r,occupiedCalloutBounds:i}){let s=(e.minX+e.maxX)/2,a=(e.minY+e.maxY)/2,c=e.minY-e_e-uBe-n,l=e.maxY+e_e+uBe,h=e.minX-e_e-uBe-t,d=e.maxX+e_e+uBe,u=[];if(c>=jf)u.push(Kme({x:hne(s-t/2,jf,o-jf-t),y:c,width:t,height:n,side:"top"}));if(l+n<=r-jf)u.push(Kme({x:hne(s-t/2,jf,o-jf-t),y:l,width:t,height:n,side:"bottom"}));if(d+t<=o-jf)u.push(Kme({x:d,y:hne(a-n/2,jf,r-jf-n),width:t,height:n,side:"right"}));if(h>=jf)u.push(Kme({x:h,y:hne(a-n/2,jf,r-jf-n),width:t,height:n,side:"left"}));let _=u.find((p)=>i.every((m)=>!eas(bBe(p,4),m)));if(_)return _;if(u[0])return u[0];return Kme({x:hne(s-t/2,jf,o-jf-t),y:hne(c,jf,r-jf-n),width:t,height:n,side:"top"})}function $ss(e,t){let n=(t.minX+t.maxX)/2,o=(t.minY+t.maxY)/2,r=(e.minX+e.maxX)/2,i=(e.minY+e.maxY)/2;switch(e.side){case"top":return{from:{x:r,y:e.maxY},to:{x:n,y:t.minY}};case"bottom":return{from:{x:r,y:e.minY},to:{x:n,y:t.maxY}};case"left":return{from:{x:e.maxX,y:i},to:{x:t.minX,y:o}};case"right":return{from:{x:e.minX,y:i},to:{x:t.maxX,y:o}}}}function qss(e){switch(e.type){case"schematic_component_overlap_warning":return e.schematic_component_overlap_warning_id;case"schematic_component_styling_warning":return e.schematic_component_styling_warning_id;case"schematic_element_outside_sheet_warning":return e.schematic_element_outside_sheet_warning_id;case"schematic_manual_edit_conflict_warning":return e.schematic_manual_edit_conflict_warning_id}}function Jss(e,t){let n=e.trim().split(/\s+/),o=[],r="";for(let i of n){let s=r?`${r} ${i}`:i;if(s.length<=t||r.length===0){r=s;continue}o.push(r),r=i}if(r)o.push(r);return o.length>0?o:["Warning"]}function Pgt(e){return{minX:Math.min(...e.map((t)=>t.x)),minY:Math.min(...e.map((t)=>t.y)),maxX:Math.max(...e.map((t)=>t.x)),maxY:Math.max(...e.map((t)=>t.y))}}function Zss(e,t){return{minX:Math.min(e.minX,t.minX),minY:Math.min(e.minY,t.minY),maxX:Math.max(e.maxX,t.maxX),maxY:Math.max(e.maxY,t.maxY)}}function bBe(e,t){return{minX:e.minX-t,minY:e.minY-t,maxX:e.maxX+t,maxY:e.maxY+t}}function eas(e,t){return!(e.maxX<=t.minX||e.minX>=t.maxX||e.maxY<=t.minY||e.minY>=t.maxY)}function Kme({x:e,y:t,width:n,height:o,side:r}){return{minX:e,minY:t,maxX:e+n,maxY:t+o,side:r}}function hne(e,t,n){if(n<t)return(t+n)/2;return Math.min(Math.max(e,t),n)}function tas(e){return{name:"",type:"text",value:e,attributes:{},children:[]}}function Mmo(e,t){let n=e.filter((ne)=>ne.type==="schematic_sheet"),o=tss(n),r=o;if(t?.schematicSheetId!==void 0)r=n.find((ne)=>ne.schematic_sheet_id===t.schematicSheetId)??o;else if(t?.schematicSheetIndex!==void 0)r=n.find((ne)=>ne.sheet_index===t.schematicSheetIndex)??o;let i=r?e.filter((ne)=>!ne.type.startsWith("schematic_")||Emo(ne)||("schematic_sheet_id"in ne)&&ne.schematic_sheet_id===r.schematic_sheet_id):e,s=mss(i),a=s.maxX-s.minX,c=s.maxY-s.minY,l=t?.width??1200,h=t?.height??600,d=t?.colorOverrides,u={...YA,schematic:{...YA.schematic,...d?.schematic??{}}},_=a/c,p=l/h,m;if(_>p){let ne=l/_;m={x:0,y:(h-ne)/2}}else{let ne=h*_;m={x:(l-ne)/2,y:0}}let A=aU.fromTriangles([{x:s.minX,y:s.maxY},{x:s.maxX,y:s.maxY},{x:s.maxX,y:s.minY}],[{x:m.x,y:m.y},{x:l-m.x,y:m.y},{x:l-m.x,y:h-m.y}]),g=[];if(g.push({name:"rect",type:"element",attributes:{class:"boundary",x:"0",y:"0",width:l.toString(),height:h.toString()},children:[],value:""}),t?.grid){let ne=typeof t.grid==="object"?t.grid:{};g.push(Zis({bounds:s,transform:A,...ne}))}let f=[],y=[],x=[],C=[],b=[],I=[],v=[],P=[],M=[],B=[],T=[],N=[],D=[],L=[],H=[],V=[],O=[],U=nas({transform:A,svgWidth:l,svgHeight:h,schematicSheet:r}),j=Array.isArray(u.simulation_palette)?u.simulation_palette:Array.isArray(u.palette)?u.palette:[],Y=0;for(let ne of i)if(ne.type==="schematic_sheet")V.push(...Fss({schematicSheet:ne,transform:A,colorMap:u}));else if(ne.type==="schematic_graphic")O.push(_ss({schematicGraphic:ne,viewport:oas({availableViewport:U,schematicGraphic:ne,transform:A})}));else if(ne.type==="schematic_debug_object")f.push(...Lss({debugObject:ne,transform:A}));else if(ne.type==="schematic_component")y.push(...kss({component:ne,transform:A,circuitJson:i,colorMap:u})),M.push(...bss({component:ne,transform:A,circuitJson:i}));else if(ne.type==="schematic_box")v.push(...Ess({schematicBox:ne,transform:A,colorMap:u}));else if(ne.type==="schematic_trace")x.push(...Oss({trace:ne,transform:A,colorMap:u}));else if(ne.type==="schematic_net_label")C.push(...yss({schNetLabel:ne,realToScreenTransform:A,colorMap:u}));else if(ne.type==="schematic_text"&&!ne.schematic_component_id)b.push(Kgt({elm:ne,transform:A,colorMap:u}));else if(ne.type==="schematic_voltage_probe"){let re=j.length>0?j[Y%j.length]:void 0;Y+=1,I.push(...Vss({probe:ne,transform:A,colorMap:u,fallbackColor:re}))}else if(ne.type==="schematic_table")P.push(...zss({schematicTable:ne,transform:A,colorMap:u,circuitJson:i}));else if(ne.type==="schematic_line"){if(ne.schematic_component_id)continue;T.push(...xmo({schLine:ne,transform:A,colorMap:u}))}else if(ne.type==="schematic_circle"){if(ne.schematic_component_id)continue;N.push(...mmo({schCircle:ne,transform:A,colorMap:u}))}else if(ne.type==="schematic_rect"){if(ne.schematic_component_id)continue;D.push(...bmo({schRect:ne,transform:A,colorMap:u}))}else if(ne.type==="schematic_arc"){if(ne.schematic_component_id)continue;L.push(...umo({schArc:ne,transform:A,colorMap:u}))}else if(ne.type==="schematic_path"){if(ne.schematic_component_id)continue;H.push(...vmo({schPath:ne,transform:A,colorMap:u}))}else if(ne.type==="schematic_port"){let re=i.find((Z)=>Z.type==="source_port"&&Z.source_port_id===ne.source_port_id);if(re?.type==="source_port"&&re.do_not_connect===!0)B.push(Iss({schPort:ne,transform:A,colorMap:u}));if(t?.drawPorts)B.push(...vss({schPort:ne,transform:A,circuitJson:i,colorMap:u}))}let X=x.filter((ne)=>ne.attributes?.["data-layer"]!=="overlay"),K=x.filter((ne)=>ne.attributes?.["data-layer"]==="overlay");if(g.push(...O,...f,...V,...X,...K,...T,...N,...D,...L,...H,...y,...M,...B,...C,...b,...v,...I,...P),t?.labeledPoints)g.push(ess({points:t.labeledPoints,transform:A}));if(t?.shouldDrawWarnings)g.push(...Gss({circuitJson:i,transform:A,svgWidth:l,svgHeight:h,colorMap:u}));let J=Ypo(e),ee=Gpo;if(t?.showErrorsInTextOverlay){let ne=Upo(e);if(ne)g.push(ne)}let se={name:"svg",type:"element",attributes:{xmlns:"http://www.w3.org/2000/svg",class:["tscircuit-schematic",t?.className].filter(Boolean).join(" "),width:l.toString(),height:h.toString(),style:`background-color: ${u.schematic.background}`,"data-real-to-screen-transform":aU.toSVG(A),...J&&{"data-software-used-string":J},...t?.includeVersion&&{"data-circuit-to-svg-version":ee}},children:[{name:"style",type:"element",children:[{type:"text",value:`
              .boundary { fill: ${u.schematic.background}; }
              .schematic-boundary { fill: none; stroke: #fff; }
              .component { fill: none; stroke: ${u.schematic.component_outline}; }
              .chip { fill: ${u.schematic.component_body}; stroke: ${u.schematic.component_outline}; }
              .component-pin { fill: none; stroke: ${u.schematic.component_outline}; }
              .text { font-family: sans-serif; fill: ${u.schematic.wire}; }
              .pin-number { fill: ${u.schematic.pin_number}; }
              .port-label { fill: ${u.schematic.reference}; }
              .component-name { fill: ${u.schematic.reference}; }
              ${t?.css??""}
            `,name:"",attributes:{},children:[]}],value:"",attributes:{}},...g],value:""};return spo(se)}function nas({transform:e,svgWidth:t,svgHeight:n,schematicSheet:o}){if(!o)return{x:0,y:0,width:t,height:n};let r=jgt(o),i=aU.applyToPoint(e,{x:r.innerMinX,y:r.innerMaxY}),s=aU.applyToPoint(e,{x:r.innerMaxX,y:r.innerMinY});return{x:Math.min(i.x,s.x),y:Math.min(i.y,s.y),width:Math.abs(s.x-i.x),height:Math.abs(s.y-i.y)}}function oas({availableViewport:e,schematicGraphic:t,transform:n}){if(t.width===void 0&&t.height===void 0)return e;let o=t.width===void 0?e.width:opo(t.width*Math.hypot(n.a,n.b),e.width),r=t.height===void 0?e.height:opo(t.height*Math.hypot(n.c,n.d),e.height);return{x:e.x+(e.width-o)/2,y:e.y+(e.height-r)/2,width:o,height:r}}function opo(e,t){if(!Number.isFinite(e))return t;return Math.max(0,Math.min(e,t))}var kcs=Qe(rn(),1),Ggo=Qe(rn(),1);var Ugo=Qe(rn(),1),C_e=Qe(rn(),1),r1=Qe(rn(),1),Dne=Qe(wt(),1),kAt=Qe(p0(),1),xc=Qe(rn(),1),Wgo=Qe(wt(),1);function $gt(e,t){return Array.isArray(t)?[e.a*t[0]+e.c*t[1]+e.e,e.b*t[0]+e.d*t[1]+e.f]:{x:e.a*t.x+e.c*t.y+e.e,y:e.b*t.x+e.d*t.y+e.f}}function Bmo(){return{a:1,c:0,e:0,b:0,d:1,f:0}}function a_e(e){return typeof e>"u"}function UA(e,t=0){return{a:1,c:0,e,b:0,d:1,f:t}}function vne(...e){e=Array.isArray(e[0])?e[0]:e;let t=(n,o)=>({a:n.a*o.a+n.c*o.b,c:n.a*o.c+n.c*o.d,e:n.a*o.e+n.c*o.f+n.e,b:n.b*o.a+n.d*o.b,d:n.b*o.c+n.d*o.d,f:n.b*o.e+n.d*o.f+n.f});switch(e.length){case 0:throw Error("no matrices provided");case 1:return e[0];case 2:return t(e[0],e[1]);default:{let[n,o,...r]=e,i=t(n,o);return vne(i,...r)}}}function hv(...e){return vne(...e)}var{cos:KTa,sin:$Ta,PI:qTa}=Math;function cU(e,t=void 0,n=void 0,o=void 0){if(a_e(t))t=e;let r={a:e,c:0,e:0,b:0,d:t,f:0};if(a_e(n)||a_e(o))return r;return vne([UA(n,o),r,UA(-n,-o)])}var{tan:rDa}=Math;var qgt=({initialTransform:e,initialTouch1:t,initialTouch2:n,finalTouch1:o,finalTouch2:r})=>{if(!o||!r)return e;let i={x:(t.x+n.x)/2,y:(t.y+n.y)/2},s={x:(o.x+r.x)/2,y:(o.y+r.y)/2},a=Math.hypot(n.x-t.x,n.y-t.y),c=Math.hypot(r.x-o.x,r.y-o.y),l=a===0?1:c/a,h=s.x-i.x,d=s.y-i.y;return hv(UA(h,d),UA(i.x,i.y),cU(l,l),UA(-i.x,-i.y),e)};var WA=Qe(rn(),1),SBe=(e={})=>{let t=WA.useRef(null),[n,o]=WA.useState(0),r=e.canvasElm??t.current,[i,s]=WA.useState(e.initialTransform??Bmo()),[a,c]=WA.useState(0),[l,h]=WA.useReducer((y)=>y+1,0),d=WA.useCallback((y)=>{if(e.onSetTransform)e.onSetTransform(y);if(!e.transform)s(y)},[e.onSetTransform,s]),u=WA.useCallback((y)=>{d(y),h()},[d]),_=e.transform??i,p=WA.useCallback(()=>{o(Date.now())},[]),m=WA.useRef("none"),A=WA.useRef(null),g=WA.useRef(null);WA.useEffect(()=>{let y=e.canvasElm??t.current;if(y&&!r){c(a+1);return}if(!y){let O=setTimeout(()=>{c(a+1)},100);return()=>clearTimeout(O)}let x=e.transform??i,C={x:0,y:0},b={x:0,y:0},I=!1,v={x:0,y:0},P=(O)=>({x:O.pageX-y.getBoundingClientRect().left-window.scrollX,y:O.pageY-y.getBoundingClientRect().top-window.scrollY});function M(O){if(e.enabled===!1)return;if(e.shouldDrag&&!e.shouldDrag(O))return;if(C=P(O),Date.now()-n<100)return;I=!0,O.preventDefault()}function B(O){if(!I||e.enabled===!1)return;if(e.shouldDrag&&!e.shouldDrag(O))return;b=P(O);let U=hv(UA(b.x-C.x,b.y-C.y),x);d(U),x=U,I=!1}function T(O){if(v=P(O),!I||e.enabled===!1)return;if(e.shouldDrag&&!e.shouldDrag(O))return;b=P(O);let U=hv(UA(b.x-C.x,b.y-C.y),x);d(U)}function N(O){if(e.enabled===!1)return;if(e.shouldDrag&&!e.shouldDrag(O))return;let U=P(O),j=hv(UA(U.x,U.y),cU(1-O.deltaY/1000,1-O.deltaY/1000),UA(-U.x,-U.y),x);d(j),x=j,O.preventDefault()}function D(O){if(!I)return;if(e.shouldDrag&&!e.shouldDrag(O))return;if(y){let j=y.getBoundingClientRect();if(O.clientX>=j.left+10&&O.clientX<=j.right-10&&O.clientY>=j.top+10&&O.clientY<=j.bottom-10)return}I=!1,b=P(O);let U=hv(UA(b.x-C.x,b.y-C.y),x);d(U),x=U}function L(O){if(O.preventDefault(),e.enabled===!1)return;if(O.touches.length===1){m.current="drag";let U=O.touches[0];A.current={initialTransform:x,initialTouch:{x:U.clientX,y:U.clientY}}}else if(O.touches.length===2){m.current="pinch";let U=O.touches[0],j=O.touches[1];g.current={initialTransform:x,initialTouch1:{x:U.clientX,y:U.clientY},initialTouch2:{x:j.clientX,y:j.clientY},finalTouch1:null,finalTouch2:null}}}function H(O){if(O.preventDefault(),e.enabled===!1)return;if(m.current==="drag"&&O.touches.length===1&&A.current){let U=O.touches[0],j={x:U.clientX,y:U.clientY},Y=j.x-A.current.initialTouch.x,X=j.y-A.current.initialTouch.y,K=hv(UA(Y,X),A.current.initialTransform);d(K)}else if(m.current==="pinch"&&O.touches.length===2&&g.current){let U=O.touches[0],j=O.touches[1];g.current.finalTouch1={x:U.clientX,y:U.clientY},g.current.finalTouch2={x:j.clientX,y:j.clientY};let Y=qgt(g.current);d(Y)}}function V(O){O.preventDefault();let U=O.changedTouches[0];if(m.current==="drag"&&A.current&&U){let j={x:U.clientX,y:U.clientY},Y=j.x-A.current.initialTouch.x,X=j.y-A.current.initialTouch.y,K=hv(UA(Y,X),A.current.initialTransform);d(K),x=K}else if(m.current==="pinch"&&g.current){let j=qgt(g.current);d(j),x=j}m.current="none",A.current=null,g.current=null}return y.addEventListener("mousedown",M),y.addEventListener("mouseup",B),window.addEventListener("mousemove",T),y.addEventListener("mouseout",D),y.addEventListener("wheel",N),y.addEventListener("touchstart",L,{passive:!1}),y.addEventListener("touchmove",H,{passive:!1}),y.addEventListener("touchend",V,{passive:!1}),y.addEventListener("touchcancel",V,{passive:!1}),()=>{y.removeEventListener("mousedown",M),y.removeEventListener("mouseup",B),window.removeEventListener("mousemove",T),y.removeEventListener("mouseout",D),y.removeEventListener("wheel",N),y.removeEventListener("touchstart",L),y.removeEventListener("touchmove",H),y.removeEventListener("touchend",V),y.removeEventListener("touchcancel",V)}},[r,a,l,n,e.enabled,e.shouldDrag]);let f=WA.useCallback((y)=>$gt(_,y),[_]);return{ref:t,transform:_,applyTransformToPoint:f,setTransform:u,cancelDrag:p}};var b_e=Qe(rn(),1),Ng=Qe(rn(),1);var jA=Qe(rn(),1),Nne=Qe(so(),1),tTe=Qe(rn(),1),I_e=Qe(rn(),1),c6=Qe(so(),1),sp=Qe(so(),1),l6=Qe(rn(),1),k3=Qe(rn(),1),Kgo=Qe(so(),1),h6=Qe(rn(),1),yU=Qe(so(),1),yv=Qe(rn(),1),R_=Qe(so(),1),zl=Qe(so(),1),$go=Qe(rn(),1);var E5=Qe(rn(),1);var Bi=Qe(rn(),1);var dv=Qe(rn(),1);var EBe=Qe(so(),1),Dg=Qe(rn(),1);var $L=Qe(so(),1),sas=Object.defineProperty,Tg=(e,t)=>sas(e,"name",{value:t,configurable:!0});function c_e(e){let t=e+"CollectionProvider",[n,o]=zy(t),[r,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),s=Tg((m)=>{let{scope:A,children:g}=m,f=dv.useRef(null),y=dv.useRef(new Map).current;return EBe.jsx(r,{scope:A,itemMap:y,collectionRef:f,children:g})},"CollectionProvider");s.displayName=t;let a=e+"CollectionSlot",c=D3(a),l=dv.forwardRef((m,A)=>{let{scope:g,children:f}=m,y=i(a,g),x=rh(A,y.collectionRef);return EBe.jsx(c,{ref:x,children:f})});l.displayName=a;let h=e+"CollectionItemSlot",d="data-radix-collection-item",u=D3(h),_=dv.forwardRef((m,A)=>{let{scope:g,children:f,...y}=m,x=dv.useRef(null),C=rh(A,x),b=i(h,g);return dv.useEffect(()=>(b.itemMap.set(x,{ref:x,...y}),()=>void b.itemMap.delete(x))),EBe.jsx(u,{...{[d]:""},ref:C,children:f})});_.displayName=h;function p(m){let A=i(e+"CollectionConsumer",m);return dv.useCallback(()=>{let f=A.collectionRef.current;if(!f)return[];let y=Array.from(f.querySelectorAll(`[${d}]`));return Array.from(A.itemMap.values()).sort((b,I)=>y.indexOf(b.ref.current)-y.indexOf(I.ref.current))},[A.collectionRef,A.itemMap])}return Tg(p,"useCollection"),[{Provider:s,Slot:l,ItemSlot:_},p,o]}Tg(c_e,"createCollection");var Tmo=new WeakMap,PBe=class e extends Map{static{Tg(this,"OrderedDict")}#e;constructor(t){super(t);this.#e=[...super.keys()],Tmo.set(this,!0)}set(t,n){if(Tmo.get(this)&&!this.has(t))this.#e.push(t);return super.set(t,n),this}insert(t,n,o){let r=this.has(n),i=r?this.size:this.size+1,s=Jgt(t),a=s>=0?Math.min(s,i-1):Math.max(i+s,0);if(r?this.#e.indexOf(n)===a:a===this.size)return this.set(n,o),this;let c=this.#e.filter((h)=>h!==n);c.splice(a,0,n);let l=c.map((h)=>[h,h===n?o:this.get(h)]);this.clear();for(let[h,d]of l)this.set(h,d);return this}with(t,n,o){let r=new e(this);return r.insert(t,n,o),r}before(t){let n=this.#e.indexOf(t)-1;if(n<0)return;return this.entryAt(n)}setBefore(t,n,o){let r=this.#e.indexOf(t);if(r===-1)return this;let i=this.#e.indexOf(n),s=i!==-1&&i<r?r-1:r;return this.insert(s,n,o)}after(t){let n=this.#e.indexOf(t);if(n=n===-1||n===this.size-1?-1:n+1,n===-1)return;return this.entryAt(n)}setAfter(t,n,o){let r=this.#e.indexOf(t);if(r===-1)return this;let i=this.#e.indexOf(n),s=i!==-1&&i<=r?r:r+1;return this.insert(s,n,o)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return this.#e=[],super.clear()}delete(t){let n=super.delete(t);if(n)this.#e.splice(this.#e.indexOf(t),1);return n}deleteAt(t){let n=this.keyAt(t);if(n!==void 0)return this.delete(n);return!1}at(t){let n=MBe(this.#e,t);if(n!==void 0)return this.get(n)}entryAt(t){let n=MBe(this.#e,t);if(n!==void 0)return[n,this.get(n)]}indexOf(t){return this.#e.indexOf(t)}keyAt(t){return MBe(this.#e,t)}from(t,n){let o=this.indexOf(t);if(o===-1)return;let r=o+n;if(r<0)r=0;if(r>=this.size)r=this.size-1;return this.at(r)}keyFrom(t,n){let o=this.indexOf(t);if(o===-1)return;let r=o+n;if(r<0)r=0;if(r>=this.size)r=this.size-1;return this.keyAt(r)}find(t,n){let o=0;for(let r of this){if(Reflect.apply(t,n,[r,o,this]))return r;o++}return}findIndex(t,n){let o=0;for(let r of this){if(Reflect.apply(t,n,[r,o,this]))return o;o++}return-1}filter(t,n){let o=[],r=0;for(let i of this){if(Reflect.apply(t,n,[i,r,this]))o.push(i);r++}return new e(o)}map(t,n){let o=[],r=0;for(let i of this)o.push([i[0],Reflect.apply(t,n,[i,r,this])]),r++;return new e(o)}reduce(...t){let[n,o]=t,r=t.length>1;if(!r&&this.size===0)throw TypeError("Reduce of empty OrderedDict with no initial value");let i=0,s=o;for(let a of this){if(i===0&&!r)s=a;else s=Reflect.apply(n,this,[s,a,i,this]);i++}return s}reduceRight(...t){let[n,o]=t,r=t.length>1;if(!r&&this.size===0)throw TypeError("Reduce of empty OrderedDict with no initial value");let i=o;for(let s=this.size-1;s>=0;s--){let a=this.entryAt(s);if(s===this.size-1&&!r)i=a;else i=Reflect.apply(n,this,[i,a,s,this])}return i}sort(t){if(typeof t!=="function")throw TypeError("OrderedDict.sort requires a compare function");let n=[...this.entries()].sort(t);this.clear();for(let[o,r]of n)this.set(o,r);return this}toSorted(t){if(typeof t!=="function")throw TypeError("OrderedDict.toSorted requires a compare function");let n=[...this.entries()].sort(t);return new e(n)}toReversed(){let t=new e;for(let n=this.size-1;n>=0;n--){let o=this.keyAt(n),r=this.get(o);t.set(o,r)}return t}toSpliced(...t){let n=[...this.entries()];return n.splice(...t),new e(n)}slice(t,n){let o=new e;for(let r of this.#e.slice(t,n))o.set(r,this.get(r));return o}every(t,n){let o=0;for(let r of this){if(!Reflect.apply(t,n,[r,o,this]))return!1;o++}return!0}some(t,n){let o=0;for(let r of this){if(Reflect.apply(t,n,[r,o,this]))return!0;o++}return!1}};function MBe(e,t){if("at"in Array.prototype)return Array.prototype.at.call(e,t);let n=Dmo(e,t);return n===-1?void 0:e[n]}Tg(MBe,"at");function Dmo(e,t){let n=e.length,o=Jgt(t),r=o>=0?o:n+o;return r<0||r>=n?-1:r}Tg(Dmo,"toSafeIndex");function Jgt(e){return e!==e||e===0?0:Math.trunc(e)}Tg(Jgt,"toSafeInteger");function aas(e){let t=e+"CollectionProvider",[n,o]=zy(t),[r,i]=n(t);r.displayName=e+"CollectionStableContextProvider";let[s,a]=n(t);s.displayName=e+"CollectionStatefulContextProvider";let c=Tg(({state:b,...I})=>b?$L.jsx(h,{...I,state:b}):$L.jsx(l,{...I}),"CollectionProvider");c.displayName=t;let l=Tg((b)=>{let I=f();return $L.jsx(h,{...b,state:I})},"CollectionInit");l.displayName=e+"CollectionInit";let h=Tg((b)=>{let{scope:I,children:v,state:P}=b,M=Dg.useRef(null),[B,T]=Dg.useState(null),N=rh(M,T),[D,L]=P,H=Dg.useRef(new PBe),V=Dg.useCallback(()=>{let O=H.current;if(!Qmo(O))O.sort(wBe);return O},[]);return Dg.useEffect(()=>{if(!B)return;let O=kmo(()=>{L((U)=>{let j=U.toSorted(wBe);return j.some(([X],K)=>U.keyAt(K)!==X)?j:U})});return O.observe(B,{childList:!0,subtree:!0}),()=>{O.disconnect()}},[B,L]),$L.jsx(r,{scope:I,collectionElementRef:N,collectionElementRefObject:M,getCollection:V,setCollection:L,registryRef:H,children:$L.jsx(s,{scope:I,collectionElement:B,collection:D,children:v})})},"CollectionProviderImpl");h.displayName=e+"CollectionProviderImpl";let d=e+"CollectionSlot",u=D3(d),_=Dg.forwardRef((b,I)=>{let{scope:v,children:P}=b,M=i(d,v),B=rh(I,M.collectionElementRef);return $L.jsx(u,{ref:B,children:P})});_.displayName=d;let p=e+"CollectionItemSlot",m="data-radix-collection-item",A=D3(p),g=Dg.forwardRef((b,I)=>{let{scope:v,children:P,...M}=b,B=Dg.useRef(null),T=i(p,v),{setCollection:N,registryRef:D}=T,L=Dg.useRef(M);if(!Nmo(L.current,M))L.current=M;let H=L.current,V=Dg.useCallback((j)=>{let Y=D.current;if(j)Y.set(j,{...L.current,element:j});else if(B.current)Y.delete(B.current)},[D]),O=rh(I,V,B);bu(()=>{let j=B.current,Y=D.current;if(j&&Y.has(j))Y.set(j,{...H,element:j})},[H,D]);let U=Dg.useRef(null);return Dg.useEffect(()=>{let j=B.current,Y=U.current;if((Y?.element??null)===j&&(!j||Y?.itemData===H))return;U.current=j?{element:j,itemData:H}:null,N((X)=>{let K=new PBe(X);if(Y&&Y.element!==j)K.delete(Y.element);if(j)K.set(j,{...H,element:j});return K.sort(wBe)})}),Dg.useEffect(()=>()=>{let j=U.current;if(U.current=null,!j)return;N((Y)=>{if(!Y.has(j.element))return Y;let X=new PBe(Y);return X.delete(j.element),X})},[N]),$L.jsx(A,{...{[m]:""},ref:O,children:P})});g.displayName=p;function f(){return Dg.useState(new PBe)}Tg(f,"useInitCollection");function y(b){let{collection:I}=a(e+"CollectionConsumer",b);return I}Tg(y,"useCollection");function x(b){let{getCollection:I}=i(e+"CollectionConsumer",b);return I}return Tg(x,"useGetCollection"),[{Provider:c,Slot:_,ItemSlot:g},{createCollectionScope:o,useCollection:y,useGetCollection:x,useInitCollection:f}]}Tg(aas,"createCollection");function Nmo(e,t){if(e===t)return!0;if(typeof e!=="object"||typeof t!=="object")return!1;if(e==null||t==null)return!1;let n=Object.keys(e),o=Object.keys(t);if(n.length!==o.length)return!1;for(let r of n){if(!Object.prototype.hasOwnProperty.call(t,r))return!1;if(e[r]!==t[r])return!1}return!0}Tg(Nmo,"shallowEqual");function Rmo(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}Tg(Rmo,"isElementPreceding");function Qmo(e){let t;for(let n of e.keys()){if(t){let o=t.compareDocumentPosition(n);if(!(o&Node.DOCUMENT_POSITION_DISCONNECTED)&&o&Node.DOCUMENT_POSITION_PRECEDING)return!1}t=n}return!0}Tg(Qmo,"isInDocumentOrder");function wBe(e,t){return!e[1].element||!t[1].element?0:Rmo(e[1].element,t[1].element)?-1:1}Tg(wBe,"sortByDocumentPosition");function kmo(e){return new MutationObserver((n)=>{for(let o of n)if(o.type==="childList"){e();return}})}Tg(kmo,"getChildListObserver");var BBe=Qe(rn(),1),has=Qe(so(),1),cas=Object.defineProperty,las=(e,t)=>cas(e,"name",{value:t,configurable:!0}),das={LTR:"ltr",RTL:"rtl"},uas=BBe.createContext(void 0);function l_e(e){let t=BBe.useContext(uas);return e||t||das.LTR}las(l_e,"useDirection");var o1=Qe(rn(),1);var Fmo=["top","right","bottom","left"];var{min:jP,max:uv,round:d_e,floor:u_e}=Math,KP=(e)=>({x:e,y:e}),pas={left:"right",right:"left",bottom:"top",top:"bottom"};function Zgt(e,t,n){return uv(e,jP(t,n))}function $P(e,t){return typeof e==="function"?e(t):e}function xT(e){return e.split("-")[0]}function lU(e){return e.split("-")[1]}function DBe(e){return e==="x"?"y":"x"}function NBe(e){return e==="y"?"height":"width"}function pv(e){let t=e[0];return t==="t"||t==="b"?"y":"x"}function RBe(e){return DBe(pv(e))}function zmo(e,t,n){if(n===void 0)n=!1;let o=lU(e),r=RBe(e),i=NBe(r),s=r==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";if(t.reference[i]>t.floating[i])s=h_e(s);return[s,h_e(s)]}function Omo(e){let t=h_e(e);return[TBe(e),t,TBe(t)]}function TBe(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}var Lmo=["left","right"],Hmo=["right","left"],mas=["top","bottom"],_as=["bottom","top"];function gas(e,t,n){switch(e){case"top":case"bottom":if(n)return t?Hmo:Lmo;return t?Lmo:Hmo;case"left":case"right":return t?mas:_as;default:return[]}}function Vmo(e,t,n,o){let r=lU(e),i=gas(xT(e),n==="start",o);if(r){if(i=i.map((s)=>s+"-"+r),t)i=i.concat(i.map(TBe))}return i}function h_e(e){let t=xT(e);return pas[t]+e.slice(t.length)}function Aas(e){var t,n,o,r;return{top:(t=e.top)!=null?t:0,right:(n=e.right)!=null?n:0,bottom:(o=e.bottom)!=null?o:0,left:(r=e.left)!=null?r:0}}function eAt(e){return typeof e!=="number"?Aas(e):{top:e,right:e,bottom:e,left:e}}function hU(e){let{x:t,y:n,width:o,height:r}=e;return{width:o,height:r,top:n,left:t,right:t+o,bottom:n+r,x:t,y:n}}function Ymo(e,t,n){let{reference:o,floating:r}=e,i=pv(t),s=RBe(t),a=NBe(s),c=xT(t),l=i==="y",h=o.x+o.width/2-r.width/2,d=o.y+o.height/2-r.height/2,u=o[a]/2-r[a]/2,_;switch(c){case"top":_={x:h,y:o.y-r.height};break;case"bottom":_={x:h,y:o.y+o.height};break;case"right":_={x:o.x+o.width,y:d};break;case"left":_={x:o.x-r.width,y:d};break;default:_={x:o.x,y:o.y}}let p=lU(t);if(p)_[s]+=u*(p==="end"?1:-1)*(n&&l?-1:1);return _}async function Wmo(e,t){var n;if(t===void 0)t={};let{x:o,y:r,platform:i,rects:s,elements:a,strategy:c}=e,{boundary:l="clippingAncestors",rootBoundary:h="viewport",elementContext:d="floating",altBoundary:u=!1,padding:_=0}=$P(t,e),p=eAt(_),A=a[u?d==="floating"?"reference":"floating":d],g=hU(await i.getClippingRect({element:((n=await(i.isElement==null?void 0:i.isElement(A)))!=null?n:!0)?A:A.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(a.floating)),boundary:l,rootBoundary:h,strategy:c})),f=d==="floating"?{x:o,y:r,width:s.floating.width,height:s.floating.height}:s.reference,y=await(i.getOffsetParent==null?void 0:i.getOffsetParent(a.floating)),x=await(i.isElement==null?void 0:i.isElement(y))&&await(i.getScale==null?void 0:i.getScale(y))||{x:1,y:1},C=hU(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:f,offsetParent:y,strategy:c}):f);return{top:(g.top-C.top+p.top)/x.y,bottom:(C.bottom-g.bottom+p.bottom)/x.y,left:(g.left-C.left+p.left)/x.x,right:(C.right-g.right+p.right)/x.x}}var fas=50,Xmo=async(e,t,n)=>{let{placement:o="bottom",strategy:r="absolute",middleware:i=[],platform:s}=n,a=s.detectOverflow?s:{...s,detectOverflow:Wmo},c=await(s.isRTL==null?void 0:s.isRTL(t)),l=await s.getElementRects({reference:e,floating:t,strategy:r}),{x:h,y:d}=Ymo(l,o,c),u=o,_=0,p={};for(let m=0;m<i.length;m++){let A=i[m];if(!A)continue;let{name:g,fn:f}=A,{x:y,y:x,data:C,reset:b}=await f({x:h,y:d,initialPlacement:o,placement:u,strategy:r,middlewareData:p,rects:l,platform:a,elements:{reference:e,floating:t}});if(h=y!=null?y:h,d=x!=null?x:d,p[g]={...p[g],...C},b&&_<fas){if(_++,typeof b==="object"){if(b.placement)u=b.placement;if(b.rects)l=b.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:r}):b.rects;({x:h,y:d}=Ymo(l,u,c))}m=-1}}return{x:h,y:d,placement:u,strategy:r,middlewareData:p}},jmo=(e)=>({name:"arrow",options:e,async fn(t){let{x:n,y:o,placement:r,rects:i,platform:s,elements:a,middlewareData:c}=t,{element:l,padding:h=0}=$P(e,t)||{};if(l==null)return{};let d=eAt(h),u={x:n,y:o},_=RBe(r),p=NBe(_),m=await s.getDimensions(l),A=_==="y",g=A?"top":"left",f=A?"bottom":"right",y=A?"clientHeight":"clientWidth",x=i.reference[p]+i.reference[_]-u[_]-i.floating[p],C=u[_]-i.reference[_],b=await(s.getOffsetParent==null?void 0:s.getOffsetParent(l)),I=b?b[y]:0;if(!I||!await(s.isElement==null?void 0:s.isElement(b)))I=a.floating[y]||i.floating[p];let v=x/2-C/2,P=I/2-m[p]/2-1,M=jP(d[g],P),B=jP(d[f],P),T=I-m[p]-B,N=I/2-m[p]/2+v,D=Zgt(M,N,T),L=!c.arrow&&lU(r)!=null&&N!==D&&i.reference[p]/2-(N<M?M:B)-m[p]/2<0,H=L?N<M?N-M:N-T:0;return{[_]:u[_]+H,data:{[_]:D,centerOffset:N-D-H,...L&&{alignmentOffset:H}},reset:L}}});var Kmo=function(e){if(e===void 0)e={};return{name:"flip",options:e,async fn(t){var n,o;let{placement:r,middlewareData:i,rects:s,initialPlacement:a,platform:c,elements:l}=t,{mainAxis:h=!0,crossAxis:d=!0,fallbackPlacements:u,fallbackStrategy:_="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:m=!0,...A}=$P(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=xT(r),f=pv(a),y=xT(a)===a,x=await(c.isRTL==null?void 0:c.isRTL(l.floating)),C=u||(y||!m?[h_e(a)]:Omo(a)),b=p!=="none";if(!u&&b)C.push(...Vmo(a,m,p,x));let I=[a,...C],v=await c.detectOverflow(t,A),P=[],M=((o=i.flip)==null?void 0:o.overflows)||[];if(h)P.push(v[g]);if(d){let D=zmo(r,s,x);P.push(v[D[0]],v[D[1]])}if(M=[...M,{placement:r,overflows:P}],!P.every((D)=>D<=0)){var B,T;let D=(((B=i.flip)==null?void 0:B.index)||0)+1,L=I[D];if(L){if(!(d==="alignment"?f!==pv(L):!1)||M.every((O)=>pv(O.placement)===f?O.overflows[0]>0:!0))return{data:{index:D,overflows:M},reset:{placement:L}}}let H=(T=M.filter((V)=>V.overflows[0]<=0).sort((V,O)=>V.overflows[1]-O.overflows[1])[0])==null?void 0:T.placement;if(!H)switch(_){case"bestFit":{var N;let V=(N=M.filter((O)=>{if(b){let U=pv(O.placement);return U===f||U==="y"}return!0}).map((O)=>[O.placement,O.overflows.filter((U)=>U>0).reduce((U,j)=>U+j,0)]).sort((O,U)=>O[1]-U[1])[0])==null?void 0:N[0];if(V)H=V;break}case"initialPlacement":H=a;break}if(r!==H)return{reset:{placement:H}}}return{}}}};function Gmo(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Umo(e){return Fmo.some((t)=>e[t]>=0)}var $mo=function(e){if(e===void 0)e={};return{name:"hide",options:e,async fn(t){let{rects:n,platform:o}=t,{strategy:r="referenceHidden",...i}=$P(e,t);switch(r){case"referenceHidden":{let s=await o.detectOverflow(t,{...i,elementContext:"reference"}),a=Gmo(s,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:Umo(a)}}}case"escaped":{let s=await o.detectOverflow(t,{...i,altBoundary:!0}),a=Gmo(s,n.floating);return{data:{escapedOffsets:a,escaped:Umo(a)}}}default:return{}}}}};var qmo=new Set(["left","top"]);async function yas(e,t){let{placement:n,platform:o,elements:r}=e,i=await(o.isRTL==null?void 0:o.isRTL(r.floating)),s=xT(n),a=lU(n),c=pv(n)==="y",l=qmo.has(s)?-1:1,h=i&&c?-1:1,d=$P(t,e),{mainAxis:u,crossAxis:_,alignmentAxis:p}=typeof d==="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};if(a&&typeof p==="number")_=a==="end"?p*-1:p;return c?{x:_*h,y:u*l}:{x:u*l,y:_*h}}var Jmo=function(e){if(e===void 0)e=0;return{name:"offset",options:e,async fn(t){var n,o;let{x:r,y:i,placement:s,middlewareData:a}=t,c=await yas(t,e);if(s===((n=a.offset)==null?void 0:n.placement)&&(o=a.arrow)!=null&&o.alignmentOffset)return{};return{x:r+c.x,y:i+c.y,data:{...c,placement:s}}}}},Zmo=function(e){if(e===void 0)e={};return{name:"shift",options:e,async fn(t){let{x:n,y:o,placement:r,platform:i}=t,{mainAxis:s=!0,crossAxis:a=!1,limiter:c={fn:(f)=>{let{x:y,y:x}=f;return{x:y,y:x}}},...l}=$P(e,t),h={x:n,y:o},d=await i.detectOverflow(t,l),u=pv(r),_=DBe(u),p=h[_],m=h[u],A=(f,y)=>Zgt(y+d[f==="y"?"top":"left"],y,y-d[f==="y"?"bottom":"right"]);if(s)p=A(_,p);if(a)m=A(u,m);let g=c.fn({...t,[_]:p,[u]:m});return{...g,data:{x:g.x-n,y:g.y-o,enabled:{[_]:s,[u]:a}}}}}},e_o=function(e){if(e===void 0)e={};return{options:e,fn(t){var n,o;let{x:r,y:i,placement:s,rects:a,middlewareData:c}=t,{offset:l=0,mainAxis:h=!0,crossAxis:d=!0}=$P(e,t),u={x:r,y:i},_=pv(s),p=DBe(_),m=u[p],A=u[_],g=$P(l,t),f=typeof g==="number"?{mainAxis:g,crossAxis:0}:{mainAxis:(n=g.mainAxis)!=null?n:0,crossAxis:(o=g.crossAxis)!=null?o:0};if(h){let C=p==="y"?"height":"width",b=a.reference[p]-a.floating[C]+f.mainAxis,I=a.reference[p]+a.reference[C]-f.mainAxis;if(m<b)m=b;else if(m>I)m=I}if(d){var y,x;let C=p==="y"?"width":"height",b=qmo.has(xT(s)),I=a.reference[_]-a.floating[C]+(b?((y=c.offset)==null?void 0:y[_])||0:0)+(b?0:f.crossAxis),v=a.reference[_]+a.reference[C]+(b?0:((x=c.offset)==null?void 0:x[_])||0)-(b?f.crossAxis:0);if(A<I)A=I;else if(A>v)A=v}return{[p]:m,[_]:A}}}},t_o=function(e){if(e===void 0)e={};return{name:"size",options:e,async fn(t){let{placement:n,rects:o,platform:r,elements:i}=t,{apply:s=()=>{},...a}=$P(e,t),c=await r.detectOverflow(t,a),l=xT(n),h=lU(n),d=pv(n)==="y",{width:u,height:_}=o.floating,p,m;if(l==="top"||l==="bottom")p=l,m=h===(await(r.isRTL==null?void 0:r.isRTL(i.floating))?"start":"end")?"left":"right";else m=l,p=h==="end"?"top":"bottom";let A=_-c.top-c.bottom,g=u-c.left-c.right,f=jP(_-c[p],A),y=jP(u-c[m],g),x=t.middlewareData.shift,C=!x,b=f,I=y;if(x!=null&&x.enabled.x)I=g;if(x!=null&&x.enabled.y)b=A;if(C&&!h)if(d)I=u-2*uv(c.left,c.right);else b=_-2*uv(c.top,c.bottom);await s({...t,availableWidth:I,availableHeight:b});let v=await r.getDimensions(i.floating);if(u!==v.width||_!==v.height)return{reset:{rects:!0}};return{}}}};function QBe(){return typeof window<"u"}function pU(e){if(o_o(e))return(e.nodeName||"").toLowerCase();return"#document"}function Vy(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function qP(e){var t;return(t=(o_o(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function o_o(e){if(!QBe())return!1;return e instanceof Node||e instanceof Vy(e).Node}function mv(e){if(!QBe())return!1;return e instanceof Element||e instanceof Vy(e).Element}function CT(e){if(!QBe())return!1;return e instanceof HTMLElement||e instanceof Vy(e).HTMLElement}function n_o(e){if(!QBe()||typeof ShadowRoot>"u")return!1;return e instanceof ShadowRoot||e instanceof Vy(e).ShadowRoot}function p_e(e){let{overflow:t,overflowX:n,overflowY:o,display:r}=_v(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+n)&&r!=="inline"&&r!=="contents"}function r_o(e){return/^(table|td|th)$/.test(pU(e))}function m_e(e){try{if(e.matches(":popover-open"))return!0}catch(t){}try{return e.matches(":modal")}catch(t){return!1}}var xas=/transform|translate|scale|rotate|perspective|filter/,Cas=/paint|layout|strict|content/,dU=(e)=>!!e&&e!=="none",tAt;function kBe(e){let t=mv(e)?_v(e):e;return dU(t.transform)||dU(t.translate)||dU(t.scale)||dU(t.rotate)||dU(t.perspective)||!LBe()&&(dU(t.backdropFilter)||dU(t.filter))||xas.test(t.willChange||"")||Cas.test(t.contain||"")}function i_o(e){let t=qL(e);while(CT(t)&&!Sne(t)){if(kBe(t))return t;else if(m_e(t))return null;t=qL(t)}return null}function LBe(){if(tAt==null)tAt=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none");return tAt}function Sne(e){return/^(html|body|#document)$/.test(pU(e))}function _v(e){return Vy(e).getComputedStyle(e)}function __e(e){if(mv(e))return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop};return{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function qL(e){if(pU(e)==="html")return e;let t=e.assignedSlot||e.parentNode||n_o(e)&&e.host||qP(e);return n_o(t)?t.host:t}function s_o(e){let t=qL(e);if(Sne(t))return(e.ownerDocument||e).body;if(CT(t)&&p_e(t))return t;return s_o(t)}function uU(e,t,n){var o;if(t===void 0)t=[];if(n===void 0)n=!0;let r=s_o(e),i=r===((o=e.ownerDocument)==null?void 0:o.body),s=Vy(r);if(i){let a=HBe(s);return t.concat(s,s.visualViewport||[],p_e(r)?r:[],a&&n?uU(a):[])}else return t.concat(r,uU(r,[],n))}function HBe(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function l_o(e){let t=_v(e),n=parseFloat(t.width)||0,o=parseFloat(t.height)||0,r=CT(e),i=r?e.offsetWidth:n,s=r?e.offsetHeight:o,a=d_e(n)!==i||d_e(o)!==s;if(a)n=i,o=s;return{width:n,height:o,$:a}}function oAt(e){return!mv(e)?e.contextElement:e}function Pne(e){let t=oAt(e);if(!CT(t))return KP(1);let n=t.getBoundingClientRect(),{width:o,height:r,$:i}=l_o(t),s=(i?d_e(n.width):n.width)/o,a=(i?d_e(n.height):n.height)/r;if(!s||!Number.isFinite(s))s=1;if(!a||!Number.isFinite(a))a=1;return{x:s,y:a}}var bas=KP(0);function h_o(e){let t=Vy(e);if(!LBe()||!t.visualViewport)return bas;return{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Ias(e,t,n){if(t===void 0)t=!1;return!!n&&t&&n===Vy(e)}function mU(e,t,n,o){if(t===void 0)t=!1;if(n===void 0)n=!1;let r=e.getBoundingClientRect(),i=oAt(e),s=KP(1);if(t)if(o){if(mv(o))s=Pne(o)}else s=Pne(e);let a=Ias(i,n,o)?h_o(i):KP(0),c=(r.left+a.x)/s.x,l=(r.top+a.y)/s.y,h=r.width/s.x,d=r.height/s.y;if(i&&o){let u=Vy(i),_=mv(o)?Vy(o):o,p=u,m=HBe(p);while(m&&_!==p){let A=Pne(m),g=m.getBoundingClientRect(),f=_v(m),y=g.left+(m.clientLeft+parseFloat(f.paddingLeft))*A.x,x=g.top+(m.clientTop+parseFloat(f.paddingTop))*A.y;c*=A.x,l*=A.y,h*=A.x,d*=A.y,c+=y,l+=x,p=Vy(m),m=HBe(p)}}return hU({width:h,height:d,x:c,y:l})}function FBe(e,t){let n=__e(e).scrollLeft;if(!t)return mU(qP(e)).left+n;return t.left+n}function d_o(e,t){let n=e.getBoundingClientRect(),o=n.left+t.scrollLeft-FBe(e,n),r=n.top+t.scrollTop;return{x:o,y:r}}function vas(e){let{elements:t,rect:n,offsetParent:o,strategy:r}=e,i=r==="fixed",s=qP(o),a=t?m_e(t.floating):!1;if(o===s||a&&i)return n;let c={scrollLeft:0,scrollTop:0},l=KP(1),h=KP(0),d=CT(o);if(d||!i){if(pU(o)!=="body"||p_e(s))c=__e(o);if(d){let _=mU(o);l=Pne(o),h.x=_.x+o.clientLeft,h.y=_.y+o.clientTop}}let u=s&&!d&&!i?d_o(s,c):KP(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+h.x+u.x,y:n.y*l.y-c.scrollTop*l.y+h.y+u.y}}function Sas(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function Pas(e){let t=__e(e),n=e.ownerDocument.body,o=uv(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),r=uv(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),i=-t.scrollLeft+FBe(e),s=-t.scrollTop;if(_v(n).direction==="rtl")i+=uv(e.clientWidth,n.clientWidth)-o;return{width:o,height:r,x:i,y:s}}var Eas=25;function Mas(e,t,n){if(n===void 0)n="viewport";let o=n==="layoutViewport",r=Vy(e),i=qP(e),s=r.visualViewport,{clientWidth:a,clientHeight:c}=i,l=0,h=0;if(s){let u=!LBe()||t==="fixed";if(o){if(!u)l=-s.offsetLeft,h=-s.offsetTop}else if(a=s.width,c=s.height,u)l=s.offsetLeft,h=s.offsetTop}if(FBe(i)<=0){let u=i.ownerDocument,_=u.body,p=getComputedStyle(_),m=u.compatMode==="CSS1Compat"?parseFloat(p.marginLeft)+parseFloat(p.marginRight)||0:0,A=Math.abs(i.clientWidth-_.clientWidth-m),g=getComputedStyle(i).scrollbarGutter==="stable both-edges"?A/2:A;if(g<=Eas)a-=g}return{width:a,height:c,x:l,y:h}}function was(e,t){let n=mU(e,!0,t==="fixed"),o=n.top+e.clientTop,r=n.left+e.clientLeft,i=Pne(e),s=e.clientWidth*i.x,a=e.clientHeight*i.y,c=r*i.x,l=o*i.y;return{width:s,height:a,x:c,y:l}}function a_o(e,t,n){let o;if(t==="viewport"||t==="layoutViewport")o=Mas(e,n,t);else if(t==="document")o=Pas(qP(e));else if(mv(t))o=was(t,n);else{let r=h_o(e);o={x:t.x-r.x,y:t.y-r.y,width:t.width,height:t.height}}return hU(o)}function Bas(e,t){let n=t.get(e);if(n)return n;let o=uU(e,[],!1).filter((a)=>mv(a)&&pU(a)!=="body"),r=null,i=_v(e).position==="fixed",s=i?qL(e):e;while(mv(s)&&!Sne(s)){let a=_v(s),c=kBe(s),l=r?r.position:i?"fixed":"";if(!c&&(l==="fixed"||l==="absolute"&&a.position==="static"))o=o.filter((d)=>d!==s);else r=a;s=qL(s)}return t.set(e,o),o}function Tas(e){let{element:t,boundary:n,rootBoundary:o,strategy:r}=e,s=[...n==="clippingAncestors"?m_e(t)?[]:Bas(t,this._c):[].concat(n),o],a=a_o(t,s[0],r),{top:c,right:l,bottom:h,left:d}=a;for(let u=1;u<s.length;u++){let _=a_o(t,s[u],r);c=uv(_.top,c),l=jP(_.right,l),h=jP(_.bottom,h),d=uv(_.left,d)}return{width:l-d,height:h-c,x:d,y:c}}function Das(e){let{width:t,height:n}=l_o(e);return{width:t,height:n}}function Nas(e,t,n){let o=CT(t),r=qP(t),i=n==="fixed",s=mU(e,!0,i,t),a={scrollLeft:0,scrollTop:0},c=KP(0);if(o||!i){if(pU(t)!=="body"||p_e(r))a=__e(t);if(o){let u=mU(t,!0,i,t);c.x=u.x+t.clientLeft,c.y=u.y+t.clientTop}}if(!o&&r)c.x=FBe(r);let l=r&&!o&&!i?d_o(r,a):KP(0),h=s.left+a.scrollLeft-c.x-l.x,d=s.top+a.scrollTop-c.y-l.y;return{x:h,y:d,width:s.width,height:s.height}}function nAt(e){return _v(e).position==="static"}function c_o(e,t){if(!CT(e)||_v(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;if(qP(e)===n)n=n.ownerDocument.body;return n}function u_o(e,t){let n=Vy(e);if(m_e(e))return n;if(!CT(e)){let r=qL(e);while(r&&!Sne(r)){if(mv(r)&&!nAt(r))return r;r=qL(r)}return n}let o=c_o(e,t);while(o&&r_o(o)&&nAt(o))o=c_o(o,t);if(o&&Sne(o)&&nAt(o)&&!kBe(o))return n;return o||i_o(e)||n}var Ras=async function(e){let t=this.getOffsetParent||u_o,n=this.getDimensions,o=await n(e.floating);return{reference:Nas(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function Qas(e){return _v(e).direction==="rtl"}var p_o={convertOffsetParentRelativeRectToViewportRelativeRect:vas,getDocumentElement:qP,getClippingRect:Tas,getOffsetParent:u_o,getElementRects:Ras,getClientRects:Sas,getDimensions:Das,getScale:Pne,isElement:mv,isRTL:Qas};function m_o(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function kas(e,t,n){let o=null,r,i=qP(e);function s(){var h;clearTimeout(r),(h=o)==null||h.disconnect(),o=null}function a(h,d){if(h===void 0)h=!1;if(d===void 0)d=1;s();let u=e.getBoundingClientRect(),{left:_,top:p,width:m,height:A}=u;if(!h)t();if(!m||!A)return;let g=u_e(p),f=u_e(i.clientWidth-(_+m)),y=u_e(i.clientHeight-(p+A)),x=u_e(_),b={rootMargin:-g+"px "+-f+"px "+-y+"px "+-x+"px",threshold:uv(0,jP(1,d))||1},I=!0;function v(P){let M=P[0].intersectionRatio;if(!m_o(u,e.getBoundingClientRect()))return a();if(M!==d){if(!I)return a();if(!M)r=setTimeout(()=>{a(!1,0.0000001)},1000);else a(!1,M)}I=!1}try{o=new IntersectionObserver(v,{...b,root:i.ownerDocument})}catch(P){o=new IntersectionObserver(v,b)}o.observe(e)}let c=Vy(e),l=()=>a(n);return c.addEventListener("resize",l),a(!0),()=>{c.removeEventListener("resize",l),s()}}function rAt(e,t,n,o){if(o===void 0)o={};let{ancestorScroll:r=!0,ancestorResize:i=!0,elementResize:s=typeof ResizeObserver==="function",layoutShift:a=typeof IntersectionObserver==="function",animationFrame:c=!1}=o,l=oAt(e),h=r||i?[...l?uU(l):[],...t?uU(t):[]]:[];h.forEach((g)=>{r&&g.addEventListener("scroll",n),i&&g.addEventListener("resize",n)});let d=l&&a?kas(l,n,i):null,u=-1,_=null;if(s){if(_=new ResizeObserver((g)=>{let[f]=g;if(f&&f.target===l&&_&&t)_.unobserve(t),cancelAnimationFrame(u),u=requestAnimationFrame(()=>{var y;(y=_)==null||y.observe(t)});n()}),l&&!c)_.observe(l);if(t)_.observe(t)}let p,m=c?mU(e):null;if(c)A();function A(){let g=mU(e);if(m&&!m_o(m,g))n();m=g,p=requestAnimationFrame(A)}return n(),()=>{var g;if(h.forEach((f)=>{r&&f.removeEventListener("scroll",n),i&&f.removeEventListener("resize",n)}),d==null||d(),(g=_)==null||g.disconnect(),_=null,c)cancelAnimationFrame(p)}}var __o=Jmo;var g_o=Zmo,A_o=Kmo,f_o=t_o,y_o=$mo,iAt=jmo;var x_o=e_o,sAt=(e,t,n)=>{let o=new Map,r=n!=null?n:{},i={...p_o,...r.platform,_c:o};return Xmo(e,t,{...r,platform:i})};var T_=Qe(rn(),1),b_o=Qe(rn(),1),I_o=Qe(Y8(),1),Las=typeof document<"u",Has=function(){},zBe=Las?b_o.useLayoutEffect:Has;function OBe(e,t){if(e===t)return!0;if(typeof e!==typeof t)return!1;if(typeof e==="function"&&e.toString()===t.toString())return!0;let n,o,r;if(e&&t&&typeof e==="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(o=n;o--!==0;)if(!OBe(e[o],t[o]))return!1;return!0}if(r=Object.keys(e),n=r.length,n!==Object.keys(t).length)return!1;for(o=n;o--!==0;)if(!{}.hasOwnProperty.call(t,r[o]))return!1;for(o=n;o--!==0;){let i=r[o];if(i==="_owner"&&e.$$typeof)continue;if(!OBe(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function v_o(e){if(typeof window>"u")return 1;return(e.ownerDocument.defaultView||window).devicePixelRatio||1}function C_o(e,t){let n=v_o(e);return Math.round(t*n)/n}function aAt(e){let t=T_.useRef(e);return zBe(()=>{t.current=e}),t}function S_o(e){if(e===void 0)e={};let{placement:t="bottom",strategy:n="absolute",middleware:o=[],platform:r,elements:{reference:i,floating:s}={},transform:a=!0,whileElementsMounted:c,open:l}=e,[h,d]=T_.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[u,_]=T_.useState(o);if(!OBe(u,o))_(o);let[p,m]=T_.useState(null),[A,g]=T_.useState(null),f=T_.useCallback((O)=>{if(O!==b.current)b.current=O,m(O)},[]),y=T_.useCallback((O)=>{if(O!==I.current)I.current=O,g(O)},[]),x=i||p,C=s||A,b=T_.useRef(null),I=T_.useRef(null),v=T_.useRef(h),P=c!=null,M=aAt(c),B=aAt(r),T=aAt(l),N=T_.useCallback(()=>{if(!b.current||!I.current)return;let O={placement:t,strategy:n,middleware:u};if(B.current)O.platform=B.current;sAt(b.current,I.current,O).then((U)=>{let j={...U,isPositioned:T.current!==!1};if(D.current&&!OBe(v.current,j))v.current=j,I_o.flushSync(()=>{d(j)})})},[u,t,n,B,T]);zBe(()=>{if(l===!1&&v.current.isPositioned)v.current.isPositioned=!1,d((O)=>({...O,isPositioned:!1}))},[l]);let D=T_.useRef(!1);zBe(()=>(D.current=!0,()=>{D.current=!1}),[]),zBe(()=>{if(x)b.current=x;if(C)I.current=C;if(x&&C){if(M.current)return M.current(x,C,N);N()}},[x,C,N,M,P]);let L=T_.useMemo(()=>({reference:b,floating:I,setReference:f,setFloating:y}),[f,y]),H=T_.useMemo(()=>({reference:x,floating:C}),[x,C]),V=T_.useMemo(()=>{let O={position:n,left:0,top:0};if(!H.floating)return O;let U=C_o(H.floating,h.x),j=C_o(H.floating,h.y);if(a)return{...O,transform:"translate("+U+"px, "+j+"px)",...v_o(H.floating)>=1.5&&{willChange:"transform"}};return{position:n,left:U,top:j}},[n,a,H.floating,h.x,h.y]);return T_.useMemo(()=>({...h,update:N,refs:L,elements:H,floatingStyles:V}),[h,N,L,H,V])}var Fas=(e)=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){let{element:o,padding:r}=typeof e==="function"?e(n):e;if(o&&t(o)){if(o.current!=null)return iAt({element:o.current,padding:r}).fn(n);return{}}if(o)return iAt({element:o,padding:r}).fn(n);return{}}}},P_o=(e,t)=>{let n=__o(e);return{name:n.name,fn:n.fn,options:[e,t]}},E_o=(e,t)=>{let n=g_o(e);return{name:n.name,fn:n.fn,options:[e,t]}},M_o=(e,t)=>({fn:x_o(e).fn,options:[e,t]}),w_o=(e,t)=>{let n=A_o(e);return{name:n.name,fn:n.fn,options:[e,t]}},B_o=(e,t)=>{let n=f_o(e);return{name:n.name,fn:n.fn,options:[e,t]}};var T_o=(e,t)=>{let n=y_o(e);return{name:n.name,fn:n.fn,options:[e,t]}};var D_o=(e,t)=>{let n=Fas(e);return{name:n.name,fn:n.fn,options:[e,t]}};var N_o=Qe(rn(),1);var zas=Object.defineProperty,Oas=(e,t)=>zas(e,"name",{value:t,configurable:!0});function cAt(e){let[t,n]=N_o.useState(void 0);return bu(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let o=0,r=new ResizeObserver((i)=>{if(!Array.isArray(i))return;if(!i.length)return;let s=i[0];window.cancelAnimationFrame(o),o=window.requestAnimationFrame(()=>{let a,c;if("borderBoxSize"in s){let l=s.borderBoxSize,h=Array.isArray(l)?l[0]:l;a=h.inlineSize,c=h.blockSize}else a=e.offsetWidth,c=e.offsetHeight;n({width:a,height:c})})});return r.observe(e,{box:"border-box"}),()=>{window.cancelAnimationFrame(o),r.unobserve(e)}}else n(void 0)},[e]),t}Oas(cAt,"useSize");var Ene=Qe(so(),1),Vas=Object.defineProperty,JL=(e,t)=>Vas(e,"name",{value:t,configurable:!0});var R_o={Partial:"partial",Always:"always"},Q_o={Optimized:"optimized",Always:"always"},k_o="Popper",[L_o,lAt]=zy(k_o),[Yas,H_o]=L_o(k_o),hAt=JL((e)=>{let{__scopePopper:t,children:n}=e,[o,r]=o1.useState(null),[i,s]=o1.useState(void 0);return Ene.jsx(Yas,{scope:t,anchor:o,onAnchorChange:r,placementState:i,setPlacementState:s,children:n})},"Popper"),Gas="PopperAnchor",F_o=o1.forwardRef(JL(function(t,n){let{__scopePopper:o,virtualRef:r,...i}=t,s=H_o(Gas,o),a=o1.useRef(null),c=s.onAnchorChange,l=o1.useCallback((m)=>{if(a.current=m,m)c(m)},[c]),h=rh(n,l),d=o1.useRef(null);o1.useEffect(()=>{if(!r)return;let m=d.current;if(d.current=r.current,m!==d.current)c(d.current)});let u=s.placementState&&VBe(s.placementState),_=u?.[0],p=u?.[1];return r?null:Ene.jsx(op.div,{"data-radix-popper-side":_,"data-radix-popper-align":p,...i,ref:h})},"PopperAnchor")),z_o="PopperContent",[Uas,JNa]=L_o(z_o),O_o=o1.forwardRef(JL(function(t,n){let{__scopePopper:o,side:r="bottom",sideOffset:i=0,align:s="center",alignOffset:a=0,arrowPadding:c=0,avoidCollisions:l=!0,collisionBoundary:h=[],collisionPadding:d=0,sticky:u=R_o.Partial,hideWhenDetached:_=!1,updatePositionStrategy:p=Q_o.Optimized,onPlaced:m,...A}=t,g=H_o(z_o,o),[f,y]=o1.useState(null),x=rh(n,y),[C,b]=o1.useState(null),I=cAt(C),v=I?.width??0,P=I?.height??0,M=r+(s!=="center"?"-"+s:""),B=typeof d==="number"?d:{top:0,right:0,bottom:0,left:0,...d},T=Array.isArray(h)?h:[h],N=T.length>0,D={padding:B,boundary:T.filter(V_o),altBoundary:N},{refs:L,floatingStyles:H,placement:V,isPositioned:O,middlewareData:U}=S_o({strategy:"fixed",placement:M,whileElementsMounted:JL((...Z)=>rAt(...Z,{animationFrame:p===Q_o.Always}),"whileElementsMounted"),elements:{reference:g.anchor},middleware:[P_o({mainAxis:i+P,alignmentAxis:a}),l&&E_o({mainAxis:!0,crossAxis:!1,...u===R_o.Partial?{limiter:M_o()}:{},...D}),l&&w_o({...D}),B_o({...D,apply:JL(({elements:Z,rects:te,availableWidth:ie,availableHeight:ce})=>{let{width:ue,height:de}=te.reference,me=Z.floating.style;me.setProperty("--radix-popper-available-width",`${ie}px`),me.setProperty("--radix-popper-available-height",`${ce}px`),me.setProperty("--radix-popper-anchor-width",`${ue}px`),me.setProperty("--radix-popper-anchor-height",`${de}px`)},"apply")}),C&&D_o({element:C,padding:c}),Was({arrowWidth:v,arrowHeight:P}),_&&T_o(N?{strategy:"referenceHidden",...D}:{strategy:"referenceHidden",padding:D.padding,altBoundary:D.altBoundary})]}),j=g.setPlacementState;bu(()=>(j(V),()=>{j(void 0)}),[V,j]);let[Y,X]=VBe(V),K=Oy(m);bu(()=>{if(O)K?.()},[O,K]);let J=U.arrow?.x,ee=U.arrow?.y,se=U.arrow?.centerOffset!==0,[ne,re]=o1.useState();return bu(()=>{if(f)re(window.getComputedStyle(f).zIndex)},[f]),Ene.jsx("div",{ref:L.setFloating,"data-radix-popper-content-wrapper":"",style:{...H,transform:O?H.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ne,"--radix-popper-transform-origin":[U.transformOrigin?.x,U.transformOrigin?.y].join(" "),...U.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:Ene.jsx(Uas,{scope:o,placedSide:Y,placedAlign:X,onArrowChange:b,arrowX:J,arrowY:ee,shouldHideArrow:se,children:Ene.jsx(op.div,{"data-side":Y,"data-align":X,...A,ref:x,style:{...A.style,animation:!O?"none":A.style?.animation}})})})},"PopperContent"));function V_o(e){return e!==null}JL(V_o,"isNotNull");var Was=JL((e)=>({name:"transformOrigin",options:e,fn(t){let{placement:n,rects:o,middlewareData:r}=t,s=r.arrow?.centerOffset!==0,a=s?0:e.arrowWidth,c=s?0:e.arrowHeight,[l,h]=VBe(n),d={start:"0%",center:"50%",end:"100%"}[h],u=(r.arrow?.x??0)+a/2,_=(r.arrow?.y??0)+c/2,p="",m="";if(l==="bottom")p=s?d:`${u}px`,m=`${-c}px`;else if(l==="top")p=s?d:`${u}px`,m=`${o.floating.height+c}px`;else if(l==="right")p=`${-c}px`,m=s?d:`${_}px`;else if(l==="left")p=`${o.floating.width+c}px`,m=s?d:`${_}px`;return{data:{x:p,y:m}}}}),"transformOrigin");function VBe(e){let[t,n="center"]=e.split("-");return[t,n]}JL(VBe,"getSideAndAlignFromPlacement");var XA=Qe(rn(),1);var Kas=Qe(rn(),1),YBe=Qe(rn(),1),jas=Object.defineProperty,uAt=(e,t)=>jas(e,"name",{value:t,configurable:!0}),dAt=!1;function Y_o(){let[e,t]=YBe.useState(dAt);return YBe.useEffect(()=>{if(!dAt)dAt=!0,t(!0)},[]),e}uAt(Y_o,"useIsHydrated");var G_o=Kas[" useSyncExternalStore ".trim().toString()];function U_o(){return()=>{}}uAt(U_o,"subscribe");function W_o(){return G_o(U_o,()=>!0,()=>!1)}uAt(W_o,"useIsHydratedModern");var X_o=typeof G_o==="function"?W_o:Y_o;var ZL=Qe(so(),1),$as=Object.defineProperty,_U=(e,t)=>$as(e,"name",{value:t,configurable:!0}),pAt="rovingFocusGroup.onEntryFocus",qas={bubbles:!1,cancelable:!0},GBe="RovingFocusGroup",[mAt,K_o,Jas]=c_e(GBe),[Zas,_At]=zy(GBe,[Jas]),j_o={Vertical:"vertical",Horizontal:"horizontal"},ecs={LTR:"ltr",RTL:"rtl"},[tcs,ncs]=Zas(GBe),$_o=XA.forwardRef(_U(function(t,n){return ZL.jsx(mAt.Provider,{scope:t.__scopeRovingFocusGroup,children:ZL.jsx(mAt.Slot,{scope:t.__scopeRovingFocusGroup,children:ZL.jsx(ocs,{...t,ref:n})})})},"RovingFocusGroup")),ocs=XA.forwardRef(_U(function(t,n){let{__scopeRovingFocusGroup:o,orientation:r,loop:i=!1,dir:s,currentTabStopId:a,defaultCurrentTabStopId:c,onCurrentTabStopIdChange:l,onEntryFocus:h,preventScrollOnEntryFocus:d=!1,...u}=t,_=XA.useRef(null),p=rh(n,_),m=l_e(s),[A,g]=VL({prop:a,defaultProp:c??null,onChange:l,caller:GBe}),[f,y]=XA.useState(!1),x=Oy(h),C=K_o(o),b=XA.useRef(!1),[I,v]=XA.useState(0);return XA.useEffect(()=>{let P=_.current;if(P)return P.addEventListener(pAt,x),()=>P.removeEventListener(pAt,x)},[x]),ZL.jsx(tcs,{scope:o,orientation:r,dir:m,loop:i,currentTabStopId:A,onItemFocus:XA.useCallback((P)=>g(P),[g]),onItemShiftTab:XA.useCallback(()=>y(!0),[]),onFocusableItemAdd:XA.useCallback(()=>v((P)=>P+1),[]),onFocusableItemRemove:XA.useCallback(()=>v((P)=>P-1),[]),children:ZL.jsx(op.div,{tabIndex:f||I===0?-1:0,"data-orientation":r,...u,ref:p,style:{outline:"none",...t.style},onMouseDown:Ca(t.onMouseDown,()=>{b.current=!0}),onFocus:Ca(t.onFocus,(P)=>{let M=!b.current;if(P.target===P.currentTarget&&M&&!f){let B=new CustomEvent(pAt,qas);if(P.currentTarget.dispatchEvent(B),!B.defaultPrevented){let T=C().filter((V)=>V.focusable),N=T.find((V)=>V.active),D=T.find((V)=>V.id===A),H=[N,D,...T].filter(Boolean).map((V)=>V.ref.current);gAt(H,d)}}b.current=!1}),onBlur:Ca(t.onBlur,()=>y(!1))})})},"RovingFocusGroupImpl")),rcs="RovingFocusGroupItem",q_o=XA.forwardRef(_U(function(t,n){let{__scopeRovingFocusGroup:o,focusable:r=!0,active:i=!1,tabStopId:s,children:a,...c}=t,l=B3(),h=s||l,d=ncs(rcs,o),u=d.currentTabStopId===h,_=K_o(o),{onFocusableItemAdd:p,onFocusableItemRemove:m,currentTabStopId:A}=d,g=X_o();return bu(()=>{if(!g||!r)return;return p(),()=>m()},[g,r,p,m]),XA.useEffect(()=>{if(g||!r)return;return p(),()=>m()},[g,r,p,m]),ZL.jsx(mAt.ItemSlot,{scope:o,id:h,focusable:r,active:i,children:ZL.jsx(op.span,{tabIndex:u?0:-1,"data-orientation":d.orientation,...c,ref:n,onMouseDown:Ca(t.onMouseDown,(f)=>{if(!r)f.preventDefault();else d.onItemFocus(h)}),onFocus:Ca(t.onFocus,()=>d.onItemFocus(h)),onKeyDown:Ca(t.onKeyDown,(f)=>{if(f.key==="Tab"&&f.shiftKey){d.onItemShiftTab();return}if(f.target!==f.currentTarget)return;let y=Z_o(f,d.orientation,d.dir);if(y!==void 0){if(f.metaKey||f.ctrlKey||f.altKey||f.shiftKey)return;f.preventDefault();let C=_().filter((b)=>b.focusable).map((b)=>b.ref.current);if(y==="last")C.reverse();else if(y==="prev"||y==="next"){if(y==="prev")C.reverse();let b=C.indexOf(f.currentTarget);C=d.loop?ego(C,b+1):C.slice(b+1)}setTimeout(()=>gAt(C))}}),children:typeof a==="function"?a({isCurrentTabStop:u,hasTabStop:A!=null}):a})})},"RovingFocusGroupItem")),ics={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function J_o(e,t){if(t!==ecs.RTL)return e;return e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}_U(J_o,"getDirectionAwareKey");function Z_o(e,t,n){let o=J_o(e.key,n);if(t===j_o.Vertical&&["ArrowLeft","ArrowRight"].includes(o))return;if(t===j_o.Horizontal&&["ArrowUp","ArrowDown"].includes(o))return;return ics[o]}_U(Z_o,"getFocusIntent");function gAt(e,t=!1){let n=document.activeElement;for(let o of e){if(o===n)return;if(o.focus({preventScroll:t}),document.activeElement!==n)return}}_U(gAt,"focusFirst");function ego(e,t){return e.map((n,o)=>e[(t+o)%e.length])}_U(ego,"wrapArray");var Ja=Qe(so(),1),acs=Object.defineProperty,ih=(e,t)=>acs(e,"name",{value:t,configurable:!0}),ccs={LTR:"ltr",RTL:"rtl"},AAt=["Enter"," "],lcs=["ArrowDown","PageUp","Home"],ngo=["ArrowUp","PageDown","End"],hcs=[...lcs,...ngo],dcs={ltr:[...AAt,"ArrowRight"],rtl:[...AAt,"ArrowLeft"]},ucs={ltr:["ArrowLeft"],rtl:["ArrowRight"]},WBe="Menu",[g_e,pcs,mcs]=c_e(WBe),[gU,yAt]=zy(WBe,[mcs,lAt,_At]),XBe=lAt(),ogo=_At(),[rgo,eH]=gU(WBe),[_cs,f_e]=gU(WBe),igo=ih((e)=>{let{__scopeMenu:t,open:n=!1,children:o,dir:r,onOpenChange:i,modal:s=!0}=e,a=XBe(t),[c,l]=Bi.useState(null),h=Bi.useRef(!1),d=Oy(i),u=l_e(r);return Bi.useEffect(()=>{let _=ih(()=>{h.current=!0,document.addEventListener("pointerdown",p,{capture:!0,once:!0}),document.addEventListener("pointermove",p,{capture:!0,once:!0})},"handleKeyDown"),p=ih(()=>h.current=!1,"handlePointer");return document.addEventListener("keydown",_,{capture:!0}),()=>{document.removeEventListener("keydown",_,{capture:!0}),document.removeEventListener("pointerdown",p,{capture:!0}),document.removeEventListener("pointermove",p,{capture:!0})}},[]),Bi.useEffect(()=>{if(!n)return;let _=ih(()=>d(!1),"handleBlur");return window.addEventListener("blur",_),()=>window.removeEventListener("blur",_)},[n,d]),Ja.jsx(hAt,{...a,children:Ja.jsx(rgo,{scope:t,open:n,onOpenChange:d,content:c,onContentChange:l,children:Ja.jsx(_cs,{scope:t,onClose:Bi.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:h,dir:u,modal:s,children:o})})})},"Menu"),xAt=Bi.forwardRef(ih(function(t,n){let{__scopeMenu:o,...r}=t,i=XBe(o);return Ja.jsx(F_o,{...i,...r,ref:n})},"MenuAnchor")),sgo="MenuPortal",[gcs,ago]=gU(sgo,{forceMount:void 0}),cgo=ih((e)=>{let{__scopeMenu:t,forceMount:n,children:o,container:r}=e,i=eH(sgo,t);return Ja.jsx(gcs,{scope:t,forceMount:n,children:Ja.jsx(uT,{present:n||i.open,children:Ja.jsx(Qwe,{asChild:!0,container:r,children:o})})})},"MenuPortal"),gv="MenuContent",[Acs,CAt]=gU(gv),lgo=Bi.forwardRef(ih(function(t,n){let o=ago(gv,t.__scopeMenu),{forceMount:r=o.forceMount,...i}=t,s=eH(gv,t.__scopeMenu),a=f_e(gv,t.__scopeMenu);return Ja.jsx(g_e.Provider,{scope:t.__scopeMenu,children:Ja.jsx(uT,{present:r||s.open,children:Ja.jsx(g_e.Slot,{scope:t.__scopeMenu,children:a.modal?Ja.jsx(fcs,{...i,ref:n}):Ja.jsx(ycs,{...i,ref:n})})})})},"MenuContent")),fcs=Bi.forwardRef(ih(function(t,n){let o=eH(gv,t.__scopeMenu),r=Bi.useRef(null),i=rh(n,r);return Bi.useEffect(()=>{let s=r.current;if(s)return Uwe(s)},[]),Ja.jsx(bAt,{...t,ref:i,trapFocus:o.open,disableOutsidePointerEvents:o.open,disableOutsideScroll:!0,onFocusOutside:Ca(t.onFocusOutside,(s)=>s.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>o.onOpenChange(!1)})},"MenuRootContentModal")),ycs=Bi.forwardRef(ih(function(t,n){let o=eH(gv,t.__scopeMenu);return Ja.jsx(bAt,{...t,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>o.onOpenChange(!1)})},"MenuRootContentNonModal")),xcs=D3("MenuContent.ScrollLock"),bAt=Bi.forwardRef(ih(function(t,n){let{__scopeMenu:o,loop:r=!1,trapFocus:i,onOpenAutoFocus:s,onCloseAutoFocus:a,disableOutsidePointerEvents:c,onEntryFocus:l,onEscapeKeyDown:h,onPointerDownOutside:d,onFocusOutside:u,onInteractOutside:_,onDismiss:p,disableOutsideScroll:m,...A}=t,g=eH(gv,o),f=f_e(gv,o),y=XBe(o),x=ogo(o),C=pcs(o),[b,I]=Bi.useState(null),v=Bi.useRef(null),[P,M]=Bi.useState(null);d_t(P);let{nodes:B,registry:T}=Lme(),N=Boolean(i||m),D=rh(n,v,g.onContentChange,M),L=Bi.useRef(0),H=Bi.useRef(""),V=Bi.useRef(0),O=Bi.useRef(null),U=Bi.useRef("right"),j=Bi.useRef(0),Y=Bi.useMemo(()=>m?[v,...B.map((se)=>({current:se}))]:[],[v,B,m]),X=m?zme:Bi.Fragment,K=m?{as:xcs,allowPinchZoom:!0,shards:Y}:void 0,J=ih((se)=>{let ne=H.current+se,re=C().filter((me)=>!me.disabled),Z=document.activeElement,te=re.find((me)=>me.ref.current===Z)?.textValue,ie=re.map((me)=>me.textValue),ce=bgo(ie,ne,te),ue=re.find((me)=>me.textValue===ce)?.ref.current;function de(me){if(H.current=me,window.clearTimeout(L.current),me!=="")L.current=window.setTimeout(()=>de(""),1000)}if(ih(de,"updateSearch"),de(ne),ue)setTimeout(()=>ue.focus())},"handleTypeaheadSearch");Bi.useEffect(()=>()=>window.clearTimeout(L.current),[]),Jte();let ee=Bi.useCallback((se)=>U.current===O.current?.side&&vgo(se,O.current?.area),[]);return Ja.jsx(Acs,{scope:o,searchRef:H,onItemEnter:Bi.useCallback((se)=>{if(ee(se))se.preventDefault()},[ee]),onItemLeave:Bi.useCallback((se)=>{if(ee(se))return;v.current?.focus(),I(null)},[ee]),onTriggerLeave:Bi.useCallback((se)=>{if(ee(se))se.preventDefault()},[ee]),pointerGraceTimerRef:V,onPointerGraceIntentChange:Bi.useCallback((se)=>{O.current=se},[]),children:Ja.jsx(kme,{registry:N?T:null,children:Ja.jsx(X,{...K,children:Ja.jsx(Nwe,{asChild:!0,trapped:i,branches:B,onMountAutoFocus:Ca(s,(se)=>{se.preventDefault(),v.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:a,children:Ja.jsx(Dwe,{asChild:!0,disableOutsidePointerEvents:c,onEscapeKeyDown:h,onPointerDownOutside:d,onFocusOutside:u,onInteractOutside:_,onDismiss:p,children:Ja.jsx($_o,{asChild:!0,...x,dir:f.dir,orientation:"vertical",loop:r,currentTabStopId:b,onCurrentTabStopIdChange:I,onEntryFocus:Ca(l,(se)=>{if(!f.isUsingKeyboardRef.current)se.preventDefault()}),preventScrollOnEntryFocus:!0,children:Ja.jsx(O_o,{role:"menu","aria-orientation":"vertical","data-state":vAt(g.open),"data-radix-menu-content":"",dir:f.dir,...y,...A,ref:D,style:{outline:"none",...A.style},onKeyDown:Ca(A.onKeyDown,(se)=>{let re=se.target.closest("[data-radix-menu-content]")===se.currentTarget,Z=se.ctrlKey||se.altKey||se.metaKey,te=se.key.length===1;if(re){if(se.key==="Tab")se.preventDefault();if(!Z&&te)J(se.key)}let ie=v.current;if(se.target!==ie)return;if(!hcs.includes(se.key))return;se.preventDefault();let ue=C().filter((de)=>!de.disabled).map((de)=>de.ref.current);if(ngo.includes(se.key))ue.reverse();xgo(ue)}),onBlur:Ca(t.onBlur,(se)=>{if(!se.currentTarget.contains(se.target))window.clearTimeout(L.current),H.current=""}),onPointerMove:Ca(t.onPointerMove,Mne((se)=>{let ne=se.target,re=j.current!==se.clientX;if(se.currentTarget.contains(ne)&&re){let Z=se.clientX>j.current?"right":"left";U.current=Z,j.current=se.clientX}}))})})})})})})})},"MenuContentImpl"));var fAt="MenuItem",tgo="menu.itemSelect",IAt=Bi.forwardRef(ih(function(t,n){let{disabled:o=!1,onSelect:r,...i}=t,s=Bi.useRef(null),a=f_e(fAt,t.__scopeMenu),c=CAt(fAt,t.__scopeMenu),l=rh(n,s),h=Bi.useRef(!1),d=ih(()=>{let u=s.current;if(!o&&u){let _=new CustomEvent(tgo,{bubbles:!0,cancelable:!0});if(u.addEventListener(tgo,(p)=>r?.(p),{once:!0}),Rme(u,_),_.defaultPrevented)h.current=!1;else a.onClose()}},"handleSelect");return Ja.jsx(hgo,{...i,ref:l,disabled:o,onClick:Ca(t.onClick,d),onPointerDown:(u)=>{t.onPointerDown?.(u),h.current=!0},onPointerUp:Ca(t.onPointerUp,(u)=>{if(!h.current)u.currentTarget?.click()}),onKeyDown:Ca(t.onKeyDown,(u)=>{if(o||u.target!==u.currentTarget)return;if(c.searchRef.current!==""&&u.key===" ")return;if(AAt.includes(u.key))u.currentTarget.click(),u.preventDefault()})})},"MenuItem")),hgo=Bi.forwardRef(ih(function(t,n){let{__scopeMenu:o,disabled:r=!1,textValue:i,...s}=t,a=CAt(fAt,o),c=ogo(o),l=Bi.useRef(null),h=rh(n,l),[d,u]=Bi.useState(!1),[_,p]=Bi.useState("");return Bi.useEffect(()=>{let m=l.current;if(m)p((m.textContent??"").trim())},[s.children]),Ja.jsx(g_e.ItemSlot,{scope:o,disabled:r,textValue:i??_,children:Ja.jsx(q_o,{asChild:!0,...c,focusable:!r,children:Ja.jsx(op.div,{role:"menuitem","data-highlighted":d?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...s,ref:h,onPointerMove:Ca(t.onPointerMove,Mne((m)=>{if(r)a.onItemLeave(m);else if(a.onItemEnter(m),!m.defaultPrevented)m.currentTarget.focus({preventScroll:!0})})),onPointerLeave:Ca(t.onPointerLeave,Mne((m)=>a.onItemLeave(m))),onFocus:Ca(t.onFocus,()=>u(!0)),onBlur:Ca(t.onBlur,()=>u(!1))})})})},"MenuItemImpl")),dgo=Bi.forwardRef(ih(function(t,n){let{checked:o=!1,onCheckedChange:r,...i}=t;return Ja.jsx(bcs,{scope:t.__scopeMenu,checked:o,children:Ja.jsx(IAt,{role:"menuitemcheckbox","aria-checked":A_e(o)?"mixed":o,...i,ref:n,"data-state":SAt(o),onSelect:Ca(i.onSelect,()=>r?.(A_e(o)?!0:!o),{checkForDefaultPrevented:!1})})})},"MenuCheckboxItem")),Ccs="MenuRadioGroup",[BRa,TRa]=gU(Ccs,{value:void 0,onValueChange:ih(()=>{},"onValueChange")});var ugo="MenuItemIndicator",[bcs,Ics]=gU(ugo,{checked:!1}),pgo=Bi.forwardRef(ih(function(t,n){let{__scopeMenu:o,forceMount:r,...i}=t,s=Ics(ugo,o);return Ja.jsx(uT,{present:r||A_e(s.checked)||s.checked===!0,children:Ja.jsx(op.span,{...i,ref:n,"data-state":SAt(s.checked)})})},"MenuItemIndicator")),mgo=Bi.forwardRef(ih(function(t,n){let{__scopeMenu:o,...r}=t;return Ja.jsx(op.div,{role:"separator","aria-orientation":"horizontal",...r,ref:n})},"MenuSeparator"));var _go="MenuSub",[vcs,ggo]=gU(_go),Ago=ih((e)=>{let{__scopeMenu:t,children:n,open:o=!1,onOpenChange:r}=e,i=eH(_go,t),s=XBe(t),[a,c]=Bi.useState(null),[l,h]=Bi.useState(null),d=Oy(r);return Bi.useEffect(()=>{if(i.open===!1)d(!1);return()=>d(!1)},[i.open,d]),Ja.jsx(hAt,{...s,children:Ja.jsx(rgo,{scope:t,open:o,onOpenChange:d,content:l,onContentChange:h,children:Ja.jsx(vcs,{scope:t,contentId:B3(),triggerId:B3(),trigger:a,onTriggerChange:c,children:n})})})},"MenuSub"),UBe="MenuSubTrigger",fgo=Bi.forwardRef(ih(function(t,n){let o=eH(UBe,t.__scopeMenu),r=f_e(UBe,t.__scopeMenu),i=ggo(UBe,t.__scopeMenu),s=CAt(UBe,t.__scopeMenu),a=Bi.useRef(null),{pointerGraceTimerRef:c,onPointerGraceIntentChange:l}=s,h={__scopeMenu:t.__scopeMenu},d=Bi.useCallback(()=>{if(a.current)window.clearTimeout(a.current);a.current=null},[]);Bi.useEffect(()=>d,[d]),Bi.useEffect(()=>{let _=c.current;return()=>{window.clearTimeout(_),l(null)}},[c,l]);let u=rh(n,i.onTriggerChange);return Ja.jsx(xAt,{asChild:!0,...h,children:Ja.jsx(hgo,{id:i.triggerId,"aria-haspopup":"menu","aria-expanded":o.open,"aria-controls":o.open?i.contentId:void 0,"data-state":vAt(o.open),...t,ref:u,onClick:(_)=>{if(t.onClick?.(_),t.disabled||_.defaultPrevented)return;if(_.currentTarget.focus(),!o.open)o.onOpenChange(!0)},onPointerMove:Ca(t.onPointerMove,Mne((_)=>{if(s.onItemEnter(_),_.defaultPrevented)return;if(!t.disabled&&!o.open&&!a.current)s.onPointerGraceIntentChange(null),a.current=window.setTimeout(()=>{o.onOpenChange(!0),d()},100)})),onPointerLeave:Ca(t.onPointerLeave,Mne((_)=>{d();let p=o.content?.getBoundingClientRect();if(p){let m=o.content?.dataset.side,A=m==="right",g=A?-5:5,f=p[A?"left":"right"],y=p[A?"right":"left"];s.onPointerGraceIntentChange({area:[{x:_.clientX+g,y:_.clientY},{x:f,y:p.top},{x:y,y:p.top},{x:y,y:p.bottom},{x:f,y:p.bottom}],side:m}),window.clearTimeout(c.current),c.current=window.setTimeout(()=>s.onPointerGraceIntentChange(null),300)}else{if(s.onTriggerLeave(_),_.defaultPrevented)return;s.onPointerGraceIntentChange(null)}})),onKeyDown:Ca(t.onKeyDown,(_)=>{if(t.disabled||_.target!==_.currentTarget)return;if(s.searchRef.current!==""&&_.key===" ")return;if(dcs[r.dir].includes(_.key))o.onOpenChange(!0),o.content?.focus(),_.preventDefault()})})})},"MenuSubTrigger")),Scs="MenuSubContent",ygo=Bi.forwardRef(ih(function(t,n){let o=ago(gv,t.__scopeMenu),{forceMount:r=o.forceMount,align:i="start",...s}=t,a=eH(gv,t.__scopeMenu),c=f_e(gv,t.__scopeMenu),l=ggo(Scs,t.__scopeMenu),h=Bi.useRef(null),d=rh(n,h);return Ja.jsx(g_e.Provider,{scope:t.__scopeMenu,children:Ja.jsx(uT,{present:r||a.open,children:Ja.jsx(g_e.Slot,{scope:t.__scopeMenu,children:Ja.jsx(bAt,{id:l.contentId,"aria-labelledby":l.triggerId,...s,ref:d,align:i,side:c.dir===ccs.RTL?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:(u)=>{if(c.isUsingKeyboardRef.current)h.current?.focus();u.preventDefault()},onCloseAutoFocus:(u)=>u.preventDefault(),onFocusOutside:Ca(t.onFocusOutside,(u)=>{if(u.target!==l.trigger)a.onOpenChange(!1)}),onEscapeKeyDown:Ca(t.onEscapeKeyDown,(u)=>{c.onClose(),u.preventDefault()}),onKeyDown:Ca(t.onKeyDown,(u)=>{let _=u.currentTarget.contains(u.target),p=ucs[c.dir].includes(u.key);if(_&&p)a.onOpenChange(!1),l.trigger?.focus(),u.preventDefault()})})})})})},"MenuSubContent"));function vAt(e){return e?"open":"closed"}ih(vAt,"getOpenState");function A_e(e){return e==="indeterminate"}ih(A_e,"isIndeterminate");function SAt(e){return A_e(e)?"indeterminate":e?"checked":"unchecked"}ih(SAt,"getCheckedState");function xgo(e){let t=document.activeElement;for(let n of e){if(n===t)return;if(n.focus(),document.activeElement!==t)return}}ih(xgo,"focusFirst");function Cgo(e,t){return e.map((n,o)=>e[(t+o)%e.length])}ih(Cgo,"wrapArray");function bgo(e,t,n){let r=t.length>1&&Array.from(t).every((l)=>l===t[0])?t[0]:t,i=n?e.indexOf(n):-1,s=Cgo(e,Math.max(i,0));if(r.length===1)s=s.filter((l)=>l!==n);let c=s.find((l)=>l.toLowerCase().startsWith(r.toLowerCase()));return c!==n?c:void 0}ih(bgo,"getNextMatch");function Igo(e,t){let{x:n,y:o}=e,r=!1;for(let i=0,s=t.length-1;i<t.length;s=i++){let a=t[i],c=t[s],{x:l,y:h}=a,{x:d,y:u}=c;if(h>o!==u>o&&n<(d-l)*(o-h)/(u-h)+l)r=!r}return r}ih(Igo,"isPointInPolygon");function vgo(e,t){if(!t)return!1;let n={x:e.clientX,y:e.clientY};return Igo(n,t)}ih(vgo,"isPointerInGraceArea");function Mne(e){return(t)=>t.pointerType==="mouse"?e(t):void 0}ih(Mne,"whenMouse");var P5=Qe(so(),1),Ecs=Object.defineProperty,Av=(e,t)=>Ecs(e,"name",{value:t,configurable:!0}),PAt="DropdownMenu",[Mcs,GRa]=zy(PAt,[yAt]),fv=yAt(),[wcs,Sgo]=Mcs(PAt),jBe=Av((e)=>{let{__scopeDropdownMenu:t,children:n,dir:o,open:r,defaultOpen:i,onOpenChange:s,modal:a=!0}=e,c=fv(t),l=E5.useRef(null),[h,d]=VL({prop:r,defaultProp:i??!1,onChange:s,caller:PAt});return P5.jsx(wcs,{scope:t,triggerId:B3(),triggerRef:l,contentId:B3(),open:h,onOpenChange:d,onOpenToggle:E5.useCallback(()=>d((u)=>!u),[d]),modal:a,children:P5.jsx(igo,{...c,open:h,onOpenChange:d,dir:o,modal:a,children:n})})},"DropdownMenu"),Bcs="DropdownMenuTrigger",KBe=E5.forwardRef(Av(function(t,n){let{__scopeDropdownMenu:o,disabled:r=!1,...i}=t,s=Sgo(Bcs,o),a=fv(o),c=rh(n,s.triggerRef);return P5.jsx(xAt,{asChild:!0,...a,children:P5.jsx(op.button,{type:"button",id:s.triggerId,"aria-haspopup":"menu","aria-expanded":s.open,"aria-controls":s.open?s.contentId:void 0,"data-state":s.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...i,ref:c,onPointerDown:Ca(t.onPointerDown,(l)=>{if(!r&&l.button===0&&l.ctrlKey===!1){if(s.onOpenToggle(),!s.open)l.preventDefault()}}),onKeyDown:Ca(t.onKeyDown,(l)=>{if(r)return;if(["Enter"," "].includes(l.key))s.onOpenToggle();if(l.key==="ArrowDown")s.onOpenChange(!0);if(["Enter"," ","ArrowDown"].includes(l.key))l.preventDefault()})})})},"DropdownMenuTrigger")),y_e=Av((e)=>{let{__scopeDropdownMenu:t,...n}=e,o=fv(t);return P5.jsx(cgo,{...o,...n})},"DropdownMenuPortal"),Tcs="DropdownMenuContent",$Be=E5.forwardRef(Av(function(t,n){let{__scopeDropdownMenu:o,...r}=t,i=Sgo(Tcs,o),s=fv(o),a=E5.useRef(!1);return P5.jsx(lgo,{id:i.contentId,"aria-labelledby":i.triggerId,...s,...r,ref:n,onCloseAutoFocus:Ca(t.onCloseAutoFocus,(c)=>{if(!a.current)i.triggerRef.current?.focus();a.current=!1,c.preventDefault()}),onInteractOutside:Ca(t.onInteractOutside,(c)=>{let l=c.detail.originalEvent,h=l.button===0&&l.ctrlKey===!0,d=l.button===2||h;if(!i.modal||d)a.current=!0}),style:{...t.style,...{"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}}})},"DropdownMenuContent"));var bT=E5.forwardRef(Av(function(t,n){let{__scopeDropdownMenu:o,...r}=t,i=fv(o);return P5.jsx(IAt,{...i,...r,ref:n})},"DropdownMenuItem")),Pgo=E5.forwardRef(Av(function(t,n){let{__scopeDropdownMenu:o,...r}=t,i=fv(o);return P5.jsx(dgo,{...i,...r,ref:n})},"DropdownMenuCheckboxItem"));var Ego=E5.forwardRef(Av(function(t,n){let{__scopeDropdownMenu:o,...r}=t,i=fv(o);return P5.jsx(pgo,{...i,...r,ref:n})},"DropdownMenuItemIndicator")),EAt=E5.forwardRef(Av(function(t,n){let{__scopeDropdownMenu:o,...r}=t,i=fv(o);return P5.jsx(mgo,{...i,...r,ref:n})},"DropdownMenuSeparator"));var Mgo=Av((e)=>{let{__scopeDropdownMenu:t,children:n,open:o,onOpenChange:r,defaultOpen:i}=e,s=fv(t),[a,c]=VL({prop:o,defaultProp:i??!1,onChange:r,caller:"DropdownMenuSub"});return P5.jsx(Ago,{...s,open:a,onOpenChange:c,children:n})},"DropdownMenuSub"),wgo=E5.forwardRef(Av(function(t,n){let{__scopeDropdownMenu:o,...r}=t,i=fv(o);return P5.jsx(fgo,{...i,...r,ref:n})},"DropdownMenuSubTrigger")),Bgo=E5.forwardRef(Av(function(t,n){let{__scopeDropdownMenu:o,...r}=t,i=fv(o);return P5.jsx(ygo,{...i,...r,ref:n,style:{...t.style,...{"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}}})},"DropdownMenuSubContent"));var Hp=Qe(so(),1),fU=Qe(so(),1);var RAt=Qe(rn(),1),Ns=Qe(so(),1),D_=Qe(so(),1);var oTe=Qe(rn(),1),jls=Qe(wt(),1);var Kls=Qe(rn(),1),OAt=Qe(so(),1),qgo=Qe(so(),1),VAt=Qe(rn(),1);function QAt(e){let t=pA(e),n=new Map;for(let s of t.schematic_component.list())if(s.source_component_id)n.set(s.source_component_id,s.schematic_component_id);let o=new Map;for(let s of t.source_trace.list()){let a=s.subcircuit_connectivity_map_key;if(!a)continue;for(let c of s.connected_source_port_ids??[]){let l=n.get(t.source_port.get(c)?.source_component_id??"");if(!l)continue;if(!o.has(l))o.set(l,new Set);o.get(l).add(a)}}let r=new Map;for(let s of t.schematic_net_label.list()){if(!s.source_net_id)continue;let a=t.source_net.get(s.source_net_id)?.subcircuit_connectivity_map_key??s.source_net_id;r.set(s.schematic_net_label_id,a)}let i=new Map;for(let s of t.schematic_text.list()){if(!s.source_trace_id)continue;let a=t.source_trace.get(s.source_trace_id)?.subcircuit_connectivity_map_key;if(a)i.set(s.schematic_text_id,a)}return{componentIdToKeys:o,netLabelIdToKey:r,textIdToKey:i}}var eTe=(e,t)=>Math.hypot(e.x-t.x,e.y-t.y),Dgo=(e,t,n)=>{let o=n.x-t.x,r=n.y-t.y,i=o*o+r*r,s=i?Math.max(0,Math.min(1,((e.x-t.x)*o+(e.y-t.y)*r)/i)):0;return eTe(e,{x:t.x+s*o,y:t.y+s*r})},AU=(e,t,n)=>Math.abs(eTe(t,e)+eTe(e,n)-eTe(t,n))<0.00001;function Dcs(e,t){let n=QAt(t),o=e?.closest("[data-subcircuit-connectivity-map-key], [data-schematic-net-label-id], [data-schematic-text-id], [data-schematic-trace-id]");if(!o)return;let r=t.find((i)=>i.type==="schematic_trace"&&i.schematic_trace_id===o.getAttribute("data-schematic-trace-id"));return o.getAttribute("data-subcircuit-connectivity-map-key")||n.netLabelIdToKey.get(o.getAttribute("data-schematic-net-label-id"))||n.textIdToKey.get(o.getAttribute("data-schematic-text-id"))||(r?.type==="schematic_trace"?r.subcircuit_connectivity_map_key||t.filter((i)=>i.type==="source_trace").find((i)=>i.source_trace_id===r.source_trace_id)?.subcircuit_connectivity_map_key:void 0)}function Ncs(e,t){let n=QAt(e),o=e.filter((d)=>d.type==="source_trace"),r=e.filter((d)=>d.type==="schematic_trace"),i=e.filter((d)=>d.type==="schematic_sheet"),s=i[0]?.schematic_sheet_id,a=[];for(let d of r){if((d.subcircuit_connectivity_map_key??o.find((_)=>_.source_trace_id===d.source_trace_id)?.subcircuit_connectivity_map_key)!==t)continue;for(let _ of d.edges)a.push({a:_.from,b:_.to,sheet:d.schematic_sheet_id??s,target:{type:"schematic_trace",id:d.schematic_trace_id},sourceTraceId:d.source_trace_id,portIds:[_.from_schematic_port_id,_.to_schematic_port_id].filter((p)=>!!p),junctions:d.junctions})}for(let d of e)if(d.type==="schematic_net_label"&&n.netLabelIdToKey.get(d.schematic_net_label_id)===t){let u=d.anchor_position??d.center;a.push({a:u,b:u,sheet:d.schematic_sheet_id??s,target:{type:"schematic_net_label",id:d.schematic_net_label_id},name:d.text})}for(let d of e){if(d.type!=="schematic_text"||n.textIdToKey.get(d.schematic_text_id)!==t)continue;let u=d.schematic_sheet_id??s,p=a.filter((m)=>m.sheet===u&&m.sourceTraceId===d.source_trace_id).sort((m,A)=>Dgo(d.position,m.a,m.b)-Dgo(d.position,A.a,A.b))[0]?.a??d.position;a.push({a:p,b:p,sheet:u,target:{type:"schematic_text",id:d.schematic_text_id},name:d.text})}let c=a.map((d,u)=>u),l=(d)=>c[d]===d?d:c[d]=l(c[d]);for(let d=0;d<a.length;d++)for(let u=0;u<d;u++){let _=a[d],p=a[u];if(_.sheet!==p.sheet)continue;if(AU(_.a,p.a,p.b)||AU(_.b,p.a,p.b)||AU(p.a,_.a,_.b)||AU(p.b,_.a,_.b)||[..._.junctions??[],...p.junctions??[]].some((m)=>AU(m,_.a,_.b)&&AU(m,p.a,p.b)))c[l(d)]=l(u)}let h=new Map;return a.forEach((d,u)=>h.set(l(u),[...h.get(l(u))??[],d])),[...h.values()].map((d,u)=>{let _=d.find((f)=>f.target.type!=="schematic_trace")??d[0],m=e.filter((f)=>f.type==="schematic_port").filter((f)=>(f.schematic_sheet_id??s)===_.sheet&&d.some((y)=>y.portIds?.includes(f.schematic_port_id)||AU(f.center,y.a,y.b))).map((f)=>{let y=e.find((C)=>C.type==="source_port"&&C.source_port_id===f.source_port_id);if(y?.type!=="source_port")return;let x=e.find((C)=>C.type==="source_component"&&C.source_component_id===y.source_component_id);return x?.type==="source_component"?`${x.name}.${y.name??`pin${y.pin_number}`}`:void 0}).filter((f)=>!!f).sort(),A=i.findIndex((f)=>f.schematic_sheet_id===_.sheet);return{kind:"net",label:`${i[A]?.name??`Sheet ${Math.max(0,A)+1}`}: ${m[0]??_.name??`Location ${u+1}`}`,schematicSheetId:_.sheet,target:_.target,focusPoint:{x:(_.a.x+_.b.x)/2,y:(_.a.y+_.b.y)/2}}})}var Rcs={async load(){let e=await ylo("@tscircuit/circuit-json-schematic-placement-analysis");if(typeof e.createSchematicPlacementIssueArtifacts!=="function")throw Error("The style analyzer module does not export its analysis function.");return e}},d6={contextMenu:110,styleAnalysis:120,viewMenu:110,viewMenuIcon:48,clickToInteractOverlay:100,schematicComponentDetailsTooltip:105,schematicComponentHoverOutline:47,schematicPortHoverOutline:48,schematicSearch:101},Qcs=({circuitJson:e,onClose:t})=>{let[n,o]=nTe.useState({status:"loading"});return nTe.useEffect(()=>{let r=!1;o({status:"loading"});let i=window.setTimeout(async()=>{try{let{createSchematicPlacementIssueArtifacts:s}=await Rcs.load();if(r)return;let a=s(e);if(!r)o({status:"complete",artifacts:a})}catch(s){if(!r)o({status:"error",message:s instanceof Error?s.message:String(s)})}},0);return()=>{r=!0,window.clearTimeout(i)}},[e]),N_.jsx(slo,{open:!0,onOpenChange:(r)=>!r&&t(),children:N_.jsxs(llo,{children:[N_.jsx(hlo,{style:{position:"fixed",inset:0,background:"#0008",zIndex:d6.styleAnalysis}}),N_.jsxs(dlo,{style:{position:"fixed",top:"5vh",left:"50%",transform:"translateX(-50%)",width:"min(1000px, 94vw)",maxHeight:"90vh",overflowY:"auto",boxSizing:"border-box",padding:24,borderRadius:12,background:"#fafafa",color:"#171717",fontFamily:"system-ui, sans-serif",boxShadow:"0 20px 60px #0005",zIndex:d6.styleAnalysis},children:[N_.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:16},children:[N_.jsx(plo,{style:{margin:0,fontSize:22},children:"Style Analysis"}),N_.jsx(_lo,{style:{cursor:"pointer",padding:"6px 12px"},children:"Close"})]}),N_.jsx(mlo,{style:{color:"#525252"},children:"Placement and style issues across all schematic sheets. Each image highlights one issue with its description below."}),n.status==="loading"&&N_.jsx("p",{role:"status",children:"Running style analysis…"}),n.status==="error"&&N_.jsxs("p",{role:"alert",children:["Style analysis failed: ",n.message]}),n.status==="complete"&&N_.jsxs(N_.Fragment,{children:[N_.jsx("p",{role:"status",children:n.artifacts.length===0?"No style issues found.":`${n.artifacts.length} style ${n.artifacts.length===1?"issue":"issues"} found.`}),n.artifacts.map((r)=>N_.jsxs("section",{style:{marginTop:24,border:"1px solid #ddd",borderRadius:8,overflow:"hidden",background:"white"},children:[N_.jsxs("h3",{style:{margin:16,fontSize:16},children:[r.issueIndex+1,"."," ",r.issue.lineItemType.replace(/([a-z])([A-Z])/g,"$1 $2"),r.schematicSheetId&&N_.jsxs("small",{style:{display:"block",marginTop:4,color:"#525252"},children:["Sheet: ",r.schematicSheetId]})]}),N_.jsx("img",{src:`data:image/svg+xml;charset=utf-8,${encodeURIComponent(r.content)}`,alt:r.descriptionXml,loading:"lazy",style:{display:"block",width:"100%",height:"auto"}})]},r.issueIndex))]})]})]})})},wne={IS_SHOWING_SCHEMATIC_GROUPS:"schematic_viewer_show_groups",IS_SHOWING_SCHEMATIC_PORTS:"schematic_viewer_show_ports",SELECTED_SCHEMATIC_SHEET:"schematic_viewer_selected_sheet"},Ngo=(e,t)=>{if(typeof window>"u")return t;try{let n=localStorage.getItem(e);return n!==null?JSON.parse(n):t}catch{return t}},Rgo=(e,t)=>{if(typeof window>"u")return;try{localStorage.setItem(e,JSON.stringify(t))}catch{}},Lcs=(e)=>{if(typeof window>"u")return null;try{return localStorage.getItem(e)}catch{return null}},Hcs=(e,t)=>{if(typeof window>"u")return;try{localStorage.setItem(e,t)}catch{}},Qgo=["#8B0000","#2F4F4F","#191970","#006400","#FF4500","#800080","#2E8B57","#B8860B","#C71585","#008B8B"],Fcs=(e)=>{let{svgDivRef:t,circuitJson:n,circuitJsonKey:o,showGroups:r}=e;Ggo.useEffect(()=>{if(t.current)t.current.querySelectorAll(".schematic-group-overlay").forEach((a)=>a.remove());if(!t.current||!r||!n||n.length===0)return;let i=setTimeout(()=>{if(!t.current)return;let s=t.current.querySelector("svg");if(!s)return;s.querySelectorAll(".schematic-group-overlay").forEach((c)=>c.remove());try{let c=pA(n).source_group?.list().filter((f)=>!f.is_subcircuit)||[],l=pA(n).schematic_component?.list()||[],h=new Map;c.forEach((f)=>{let y=f;if(y.parent_source_group_id){let x=h.get(y.parent_source_group_id)||[];x.push(f.source_group_id),h.set(y.parent_source_group_id,x)}});let d=(f)=>{let y=[],x=h.get(f)||[];for(let C of x)y.push(C),y.push(...d(C));return y},u=(f)=>{let y=c.find((x)=>x.source_group_id===f);if(!y?.parent_source_group_id)return 0;return 1+u(y.parent_source_group_id)},_=c.length>0&&c.some((f)=>f.name&&f.name.trim()!==""),p=[];if(_){let f=new Map;for(let y of l){let x=pA(n).source_component.get(y.source_component_id);if(x?.source_group_id){if(!f.has(x.source_group_id))f.set(x.source_group_id,[]);f.get(x.source_group_id).push(y)}}c.forEach((y,x)=>{let C=f.get(y.source_group_id)||[],b=d(y.source_group_id);for(let I of b){let v=f.get(I)||[];C=[...C,...v]}if(C.length>0){let I=u(y.source_group_id),v=d(y.source_group_id).length>0;if(y.name?.startsWith("unnamed_board"))return;p.push({id:y.source_group_id,name:y.name||`Group ${x+1}`,components:C,color:Qgo[x%Qgo.length],depthLevel:I,hasChildren:v,sourceGroupId:y.source_group_id})}})}let m=s.viewBox.baseVal,A=s.getBoundingClientRect(),g=Math.min(A.width/m.width,A.height/m.height)||1;p.sort((f,y)=>f.depthLevel-y.depthLevel),p.forEach((f)=>{if(f.components.length===0)return;let y=zcs(f.components,s);if(!y)return;let x=Math.max(8,Math.min(25,15/Math.max(g,0.3))),C=f.hasChildren?x*0.6:0,b=x+C,I=Math.max(1,2/Math.max(g,0.5)),v=f.depthLevel===0?I:I*0.7,P=Math.max(4,8/Math.max(g,0.5)),M=f.hasChildren?1.3:1,B=P*M,T=B*0.5,N=document.createElementNS("http://www.w3.org/2000/svg","rect");N.setAttribute("class","schematic-group-overlay"),N.setAttribute("x",(y.minX-b).toString()),N.setAttribute("y",(y.minY-b).toString()),N.setAttribute("width",(y.maxX-y.minX+b*2).toString()),N.setAttribute("height",(y.maxY-y.minY+b*2).toString()),N.setAttribute("fill","none"),N.setAttribute("stroke",f.color),N.setAttribute("stroke-width",v.toString()),N.setAttribute("stroke-dasharray",`${B},${T}`),N.setAttribute("opacity","0.8"),N.setAttribute("rx","0"),N.setAttribute("ry","0");let D=Math.max(6,Math.min(20,14/Math.max(g,0.2))),L=f.depthLevel===0||f.depthLevel===1?0:f.depthLevel*0.2,H=D*(1-L),V=Math.max(1,H*0.2),O=f.name,U=document.createElementNS("http://www.w3.org/2000/svg","text");U.setAttribute("font-size",H.toString()),U.setAttribute("font-family","Arial, sans-serif"),U.textContent=O,s.appendChild(U);let j=U.getBBox();s.removeChild(U);let Y=j.width+V*2,X=H+V*2,K=y.minX-b,J=y.minY-b-X,ee=document.createElementNS("http://www.w3.org/2000/svg","rect");ee.setAttribute("class","schematic-group-overlay"),ee.setAttribute("x",K.toString()),ee.setAttribute("y",(J-X).toString()),ee.setAttribute("width",Y.toString()),ee.setAttribute("height",X.toString()),ee.setAttribute("fill","transparent"),ee.setAttribute("rx","0"),ee.setAttribute("ry","0");let se=document.createElementNS("http://www.w3.org/2000/svg","text");se.setAttribute("class","schematic-group-overlay"),se.setAttribute("x",(K+V).toString()),se.setAttribute("y",(J+X-V).toString()),se.setAttribute("fill",f.color),se.setAttribute("font-size",H.toString()),se.setAttribute("font-family","Arial, sans-serif"),se.setAttribute("font-weight",f.depthLevel===0?"600":"500"),se.setAttribute("stroke",f.color),se.setAttribute("stroke-width",Math.max(0.2,H*0.02).toString()),se.textContent=O,s.appendChild(N),s.appendChild(ee),s.appendChild(se)})}catch(c){console.error("Error creating group overlays:",c)}},10);return()=>clearTimeout(i)},[t,o,r])};function zcs(e,t){let n=1/0,o=1/0,r=-1/0,i=-1/0;for(let a of e){let c=t.querySelector(`g[data-schematic-component-id="${a.schematic_component_id}"]`);if(!c)c=t.querySelector(`[data-schematic-component-id="${a.schematic_component_id}"]`);if(c){let l=c.getBBox();n=Math.min(n,l.x),o=Math.min(o,l.y),r=Math.max(r,l.x+l.width),i=Math.max(i,l.y+l.height)}}if(n===1/0)return null;return{minX:n,minY:o,maxX:r,maxY:i}}var MAt="sch-net-faded",kgo="g.trace[data-subcircuit-connectivity-map-key], g.trace-overlays[data-subcircuit-connectivity-map-key]",wAt="[data-schematic-net-label-id], [data-schematic-text-id]",Ocs=({svgDivRef:e,circuitJson:t,circuitJsonKey:n,enabled:o})=>{Ugo.useEffect(()=>{let r=e.current;if(!o||!r)return;let{componentIdToKeys:i,netLabelIdToKey:s,textIdToKey:a}=QAt(t),c=[],l=new Map,h=null,d=()=>{for(let{el:g}of c)g.classList.remove(MAt);c=[],l.clear(),h=null;let A=r.querySelector("svg");if(!A)return;for(let g of Array.from(A.querySelectorAll(kgo))){let f=g.getAttribute("data-subcircuit-connectivity-map-key"),y=new Set;if(f)y.add(f),l.set(g,f);c.push({el:g,keys:y})}for(let g of Array.from(A.querySelectorAll("g[data-schematic-component-id]"))){let f=g.getAttribute("data-schematic-component-id");c.push({el:g,keys:i.get(f)??new Set})}for(let g of Array.from(A.querySelectorAll(wAt))){let f=s.get(g.getAttribute("data-schematic-net-label-id"))??a.get(g.getAttribute("data-schematic-text-id")),y=new Set;if(f)y.add(f),l.set(g,f);c.push({el:g,keys:y})}},u=(A)=>{if(A===h)return;h=A;for(let{el:g,keys:f}of c)g.classList.toggle(MAt,A!==null&&!f.has(A))},_=(A)=>{let g=A.target;if(!(g instanceof Element)){u(null);return}let f=g.closest(`${kgo}, ${wAt}`);if(f&&l.has(f)){u(l.get(f));return}for(let[y,x]of l){if(!y.matches(wAt))continue;let C=y.getBoundingClientRect();if(A.clientX>=C.left-6&&A.clientX<=C.right+6&&A.clientY>=C.top-6&&A.clientY<=C.bottom+6){u(x);return}}u(null)},p=()=>u(null);d(),r.addEventListener("mousemove",_),r.addEventListener("mouseleave",p);let m=new MutationObserver(d);return m.observe(r,{childList:!0}),()=>{m.disconnect(),r.removeEventListener("mousemove",_),r.removeEventListener("mouseleave",p);for(let{el:A}of c)A.classList.remove(MAt)}},[e,n,o])},BAt="http://www.w3.org/2000/svg",Vcs=({svgDivRef:e,svgContent:t,circuitJsonKey:n})=>{let o=C_e.useRef(new Set);C_e.useLayoutEffect(()=>{o.current.clear()},[n]),C_e.useLayoutEffect(()=>{let r=[];for(let i of e.current?.querySelectorAll(".schematic-warning")??[]){let s=i.getAttribute("data-warning-id"),a=i.querySelector('[data-warning-reference="callout"]');if(!s||!a)continue;let c=Array.from(i.children),l=c.map((y)=>y.style.display),h=i.getAttribute("role"),d=i.getAttribute("aria-label")??"Warning",u=document.createElementNS(BAt,"g");u.setAttribute("data-warning-icon",""),u.setAttribute("aria-hidden","true"),u.setAttribute("transform",`translate(${a.getAttribute("x")} ${a.getAttribute("y")})`);let _=document.createElementNS(BAt,"rect");_.setAttribute("width","24"),_.setAttribute("height","24"),_.setAttribute("fill",a.getAttribute("fill")??"#fffaeb"),_.setAttribute("stroke",a.getAttribute("stroke")??"#d99a00"),_.setAttribute("stroke-width","1");let p=document.createElementNS(BAt,"text");p.setAttribute("x","12"),p.setAttribute("y","12"),p.setAttribute("dominant-baseline","central"),p.setAttribute("text-anchor","middle"),p.setAttribute("font-size","16"),p.setAttribute("font-family","sans-serif"),p.setAttribute("font-weight","bold"),p.setAttribute("fill","#5c4300"),p.textContent="!",u.append(_,p),i.append(u),i.setAttribute("role","button"),i.setAttribute("tabindex","0"),i.style.cursor="pointer",i.style.outline="none";let m=()=>{let y=o.current.has(s);c.forEach((x,C)=>{x.style.display=y?"none":l[C]}),u.style.display=y?"":"none",i.setAttribute("aria-expanded",String(!y)),i.setAttribute("aria-label",`${y?"Expand":"Minimize"} warning: ${d}`)},A=(y)=>{if(y.preventDefault(),y.stopPropagation(),o.current.has(s))o.current.delete(s);else o.current.add(s);m()},g=(y)=>{if(y.key==="Enter"||y.key===" ")if(!y.repeat)A(y);else y.preventDefault()},f=(y)=>y.stopPropagation();i.addEventListener("click",A),i.addEventListener("keydown",g),i.addEventListener("mousedown",f),i.addEventListener("touchstart",f),m(),r.push(()=>{if(i.removeEventListener("click",A),i.removeEventListener("keydown",g),i.removeEventListener("mousedown",f),i.removeEventListener("touchstart",f),u.remove(),c.forEach((y,x)=>{y.style.display=l[x]}),h)i.setAttribute("role",h);else i.removeAttribute("role");i.setAttribute("aria-label",d),i.removeAttribute("aria-expanded"),i.removeAttribute("tabindex"),i.style.removeProperty("cursor"),i.style.removeProperty("outline")})}return()=>r.forEach((i)=>i())},[e,t,n])},NAt=(e)=>String(e??"").toLocaleLowerCase(),x_e=(e,t)=>{let n=NAt(e);if(n===t)return 0;if(n.startsWith(t))return 1;if(n.includes(t))return 2;return Number.POSITIVE_INFINITY},Ycs=(e)=>{if(!e)return;return String(e).replace(/^simple_/,"").replaceAll("_"," ").replace(/\b\w/g,(t)=>t.toLocaleUpperCase())},Gcs=(e,t,n)=>{let r=Ycs(e?.ftype);if(e?.ftype==="simple_chip"&&e.manufacturer_part_number)r=e.manufacturer_part_number;let i=[];if(e?.display_name===n&&e.name!==n)i.push(e.name);let s=e?.display_value;if(!s&&e){for(let a of["display_resistance","display_capacitance","display_inductance","display_frequency","symbol_display_value"])if(a in e){let c=e[a];if(typeof c==="string"){s=c;break}}}if(s??(s=t.symbol_display_value),r)i.push(r);if(s)i.push(s);if(!r&&!s&&e?.manufacturer_part_number)i.push(e.manufacturer_part_number);if(i.length===0)return;return i.join(" · ")},Ucs=(e)=>e.type==="source_component"&&("source_component_id"in e),Wcs=(e)=>e.type==="source_port",Xcs=(e)=>e.type==="source_trace",jcs=(e)=>e.type==="schematic_component",Kcs=(e)=>e.type==="schematic_port",$cs=(e)=>e.type==="schematic_net_label",qcs=(e)=>e.type==="schematic_sheet",TAt=({schematicSheets:e,schematicSheetId:t})=>{if(e.length<=1||!t)return;return e.find((n)=>n.schematic_sheet_id===t)?.name},Jcs=(e,t)=>{let n=NAt(t).trim();if(!n)return[];let o=new Map(e.filter(Ucs).map((h)=>[h.source_component_id,h])),r=new Map(e.filter(Wcs).map((h)=>[h.source_port_id,h])),i=e.filter(Kcs),s=e.filter(Xcs),a=e.filter(qcs),c=[],l=new Map;for(let h of e.filter(jcs)){let d=h.source_component_id?o.get(h.source_component_id):void 0,u=d?.display_name??d?.name??"Component",_=Math.min(x_e(d?.name,n),x_e(d?.display_name,n),x_e(d?.manufacturer_part_number,n));if(Number.isFinite(_)){let p={label:u,detail:Gcs(d,h,u),kind:"component",schematicSheetId:h.schematic_sheet_id,schematicSheetName:TAt({schematicSheets:a,schematicSheetId:h.schematic_sheet_id}),target:{type:"schematic_component",id:h.schematic_component_id}};c.push(p),l.set(p,_)}}for(let h of e.filter($cs)){if(!NAt(h.text).includes(n))continue;let d=new Set;for(let y of s.filter((x)=>x.connected_source_net_ids.includes(h.source_net_id)))for(let x of y.connected_source_port_ids)d.add(x);let u=h.anchor_position??h.center,_=i.filter((y)=>d.has(y.source_port_id)&&(!h.schematic_sheet_id||!y.schematic_sheet_id||y.schematic_sheet_id===h.schematic_sheet_id)).map((y)=>({port:y,distance:Math.hypot(y.center.x-u.x,y.center.y-u.y)})).filter(({distance:y})=>y<=1).sort((y,x)=>y.distance-x.distance)[0]?.port,p=_?r.get(_.source_port_id):void 0,m=p?.source_component_id?o.get(p.source_component_id):void 0,A=p?.name??(p?.pin_number!==void 0?`pin${p.pin_number}`:_?.display_pin_label),g=m?.name&&A?`Connected to ${m.name}.${A}`:void 0,f={label:h.text,detail:g,kind:"net",schematicSheetId:h.schematic_sheet_id,schematicSheetName:TAt({schematicSheets:a,schematicSheetId:h.schematic_sheet_id}),target:{type:"schematic_net_label",id:h.schematic_net_label_id}};c.push(f),l.set(f,x_e(h.text,n))}for(let h of e){if(h.type!=="schematic_text"||!h.source_trace_id)continue;let d=x_e(h.text,n);if(!Number.isFinite(d))continue;let u={label:h.text,kind:"net",schematicSheetId:h.schematic_sheet_id,schematicSheetName:TAt({schematicSheets:a,schematicSheetId:h.schematic_sheet_id}),target:{type:"schematic_text",id:h.schematic_text_id}};c.push(u),l.set(u,d)}return c.sort((h,d)=>(l.get(h)??Number.POSITIVE_INFINITY)-(l.get(d)??Number.POSITIVE_INFINITY)||h.label.localeCompare(d.label))},Zcs=({containerRect:e,targetRect:t,visibleProjection:n,minimumScale:o})=>{let r=n.a||1,i={x:t.left+t.width/2-e.left,y:t.top+t.height/2-e.top},s={x:(i.x-n.e)/r,y:(i.y-n.f)/r},a=Math.max(r,o);return{a,b:0,c:0,d:a,e:e.width/2-s.x*a,f:e.height/2-s.y*a}},els=1.8,Lgo=350,tls=({controller:e,circuitJson:t,circuitJsonKey:n,svgDivRef:o,containerRef:r,activeSheetId:i,hasMultipleSheets:s,handleSelectSheet:a,svgString:c,svgToScreenProjection:l,setSvgToScreenProjection:h,setIsInteractionEnabled:d})=>{let[u,_]=r1.useState(""),[p,m]=r1.useState(null),A=r1.useRef(null),g=r1.useMemo(()=>Jcs(t,u),[t,n,u]),f=r1.useCallback((I)=>{let v=o.current,P=r.current;if(!v||!P)return!1;let M=`data-${I.target.type.replaceAll("_","-")}-id`,B=Array.from(v.querySelectorAll(`[${M}]`)).find((H)=>H.getAttribute(M)===I.target.id);if(!B)return!1;let T=B.getBoundingClientRect();if(I.focusPoint){let H=B.closest("svg"),V=H?.getAttribute("data-real-to-screen-transform"),O=H?.getScreenCTM?.();if(V&&O){let U=Dne.applyToPoint(O,Dne.applyToPoint(Dne.fromString(V),I.focusPoint));T={left:U.x-1,top:U.y-1,width:2,height:2}}}let N=P.getBoundingClientRect();if(!N.width||!N.height)return!1;if(!T.width&&!T.height)return!1;if(A.current)clearTimeout(A.current);let D=l,L=getComputedStyle(v).transform;if(L&&L!=="none")try{D=Dne.fromString(L),v.style.transition="none",v.style.transform=L,v.offsetWidth}catch{}return v.style.transition=`transform ${Lgo}ms ease-in-out`,v.offsetWidth,h(Zcs({containerRect:N,targetRect:T,visibleProjection:D,minimumScale:els})),A.current=setTimeout(()=>{v.style.transition=""},Lgo),v.querySelectorAll(".schematic-search-match").forEach((H)=>H.classList.remove("schematic-search-match")),v.querySelectorAll(`[${M}]`).forEach((H)=>{if(H.getAttribute(M)===I.target.id)H.classList.add("schematic-search-match")}),!0},[r,h,o,l]),y=r1.useCallback((I)=>{if(d(!0),I.schematicSheetId&&I.schematicSheetId!==i&&s){a(I.schematicSheetId),m(I);return}f(I)},[i,f,a,s,d]),x=r1.useCallback(()=>{if(_(""),m(null),A.current)clearTimeout(A.current),A.current=null;if(o.current)o.current.style.transition="",o.current.querySelectorAll(".schematic-search-match").forEach((I)=>I.classList.remove("schematic-search-match"))},[o]),C=e?.focusRequest,b=e?.onFocusRequestHandled;return r1.useEffect(()=>{if(!C)return;let I=t.find((v)=>v.type==="schematic_component"&&v.schematic_component_id===C.schematicComponentId);if(I?.type!=="schematic_component"){m(null),b?.(C);return}if(d(!0),I.schematic_sheet_id&&s)a(I.schematic_sheet_id);m({kind:"component",label:I.schematic_component_id,schematicSheetId:I.schematic_sheet_id,target:{type:"schematic_component",id:I.schematic_component_id}})},[C,b,t,n,s,a,d]),r1.useEffect(()=>{if(!p||!c)return;if(s&&p.schematicSheetId&&p.schematicSheetId!==i)return;let I=requestAnimationFrame(()=>{if(f(p)){if(m(null),C?.schematicComponentId===p.target.id)b?.(C)}});return()=>cancelAnimationFrame(I)},[f,C,b,p,c,s,i]),r1.useEffect(()=>{if(u)return;o.current?.querySelectorAll(".schematic-search-match").forEach((I)=>I.classList.remove("schematic-search-match"))},[u,o]),r1.useEffect(()=>()=>{if(A.current)clearTimeout(A.current)},[]),{searchQuery:u,setSearchQuery:_,searchResults:g,handleSearchResultSelect:y,handleCancelSearch:x}},JRa=kAt.default("schematic-viewer"),nls=()=>{kAt.default.enable("schematic-viewer*")},ols=(e)=>{let[t,n]=b_e.useState(0),[o,r]=b_e.useState(0);return b_e.useEffect(()=>{if(!e.current)return;let i=()=>{let a=e.current?.getBoundingClientRect();n(a?.width||0),r(a?.height||0)};i();let s=new ResizeObserver(i);return s.observe(e.current),window.addEventListener("resize",i),()=>{s.disconnect(),window.removeEventListener("resize",i)}},[]),{containerWidth:t,containerHeight:o}},rls=600,qBe=10,ils=({containerRef:e})=>{let[t,n]=Ng.useState(null),[o,r]=Ng.useState(!1),[i,s]=Ng.useState({x:0,y:0}),a=Ng.useRef(null),c=Ng.useRef(null),l=Ng.useRef(null),h=Ng.useRef(0),d=Ng.useCallback(()=>{if(l.current===null)return;window.clearTimeout(l.current),l.current=null},[]),u=Ng.useCallback((g)=>{if(g.preventDefault(),Date.now()<h.current)return;let f=c.current;if(!f)return;let y=Math.abs(g.clientX-f.x)>qBe||Math.abs(g.clientY-f.y)>qBe;if(c.current=null,y)return;n(g.target instanceof Element?g.target:null),s({x:g.clientX,y:g.clientY}),r(!0)},[]),_=Ng.useCallback((g)=>{if(d(),g.touches.length!==1){c.current=null;return}let f=g.touches[0];if(!f)return;let y=g.target instanceof Element?g.target:null;c.current={x:f.clientX,y:f.clientY},l.current=window.setTimeout(()=>{let x=e.current;if(!x||!c.current)return;n(y);let C=x.getBoundingClientRect();s({x:C.left+C.width/2,y:C.top+C.height/2}),r(!0),h.current=Date.now()+1000,c.current=null},rls)},[d,e]),p=Ng.useCallback((g)=>{let f=c.current;if(!f||g.touches.length!==1)return;let y=g.touches[0];if(!y||Math.abs(y.clientX-f.x)>qBe||Math.abs(y.clientY-f.y)>qBe)c.current=null,d()},[d]),m=Ng.useCallback(()=>{d(),c.current=null},[d]),A=Ng.useCallback((g)=>{let f=g.target;if(a.current?.contains(f))return;if(f.closest?.("[data-radix-popper-content-wrapper], [data-radix-dropdown-menu-content]"))return;r(!1)},[]);return Ng.useEffect(()=>{if(!o)return;return document.addEventListener("mousedown",A),document.addEventListener("touchstart",A),()=>{document.removeEventListener("mousedown",A),document.removeEventListener("touchstart",A)}},[A,o]),Ng.useEffect(()=>d,[d]),{menuVisible:o,menuTarget:t,menuPos:i,menuRef:a,setMenuVisible:r,contextMenuEventHandlers:{onMouseDown:(g)=>{c.current=g.button===2||g.button===0&&g.ctrlKey?{x:g.clientX,y:g.clientY}:null},onContextMenu:u,onTouchStart:_,onTouchMove:p,onTouchEnd:m,onTouchCancel:m}}},sls=(e,t,n)=>e.filter((o)=>{if(!o.type.endsWith("_warning"))return!1;let r=o;return[["source_component",t.source_component_id],["schematic_component",t.schematic_component_id],["pcb_component",n?.pcb_component_id]].some(([s,a])=>{if(!a)return!1;let c=r[`${s}_ids`];return r[`${s}_id`]===a||Array.isArray(c)&&c.includes(a)||r.schematic_element_type===s&&r.schematic_element_id===a})}),als=new Set(["type","source_component_id","source_group_id","subcircuit_id","display_name","ftype","are_pins_interchangeable","supplier_part_numbers"]),Hgo=["name","resistance","capacitance","inductance","frequency","voltage","current","max_voltage_rating","max_current_rating","power_rating","manufacturer_part_number"],cls={jlcpcb:(e)=>`https://jlcpcb.com/partdetail/${encodeURIComponent(e)}`,lcsc:(e)=>`https://www.lcsc.com/product-detail/${encodeURIComponent(e)}.html`},lls=(e)=>{let t=e.trim(),n=/^c?(\d+)$/i.exec(t);return n?`C${n[1]}`:t},Fgo=(e)=>{let t=Hgo.indexOf(e);return t===-1?Hgo.length:t},hls=(e,t,n)=>{if(t==="name")return String(n);let o=e[`display_${t}`];if(typeof o==="string"&&o.trim()){let r=t==="resistance"?o.replace(/Ω$/,""):o;return JSON.stringify(r)}return JSON.stringify(n)??String(n)},dls=(e)=>Object.entries(e).filter(([t,n])=>{if(als.has(t))return!1;if(t.startsWith("display_")&&t.slice(8)in e)return!1;return n!==void 0&&n!==null&&n!==""}).sort(([t],[n])=>Fgo(t)-Fgo(n)||t.localeCompare(n)).map(([t,n])=>({key:t,label:t,value:hls(e,t,n)})),uls=(e)=>{let t=e.supplier_part_numbers;if(!t)return[];return["jlcpcb","lcsc"].flatMap((n)=>{let o=t[n];if(!Array.isArray(o))return[];let r=[...new Set(o.filter((i)=>Boolean(typeof i==="string"&&i.trim())).map(lls))];if(!r.length)return[];return[{key:`supplier_part_numbers.${n}`,label:n,links:r.map((i)=>({partNumber:i,href:cls[n](i)}))}]})},pls=(e,t)=>{let n=e.find((c)=>c.type==="schematic_component"&&c.schematic_component_id===t);if(!n)return null;let o=e.find((c)=>c.type==="source_component"&&c.source_component_id===n.source_component_id);if(!o)return null;let r=e.find((c)=>c.type==="pcb_component"&&c.source_component_id===o.source_component_id),i=e.find((c)=>c.type==="cad_component"&&c.source_component_id===o.source_component_id&&(!r||c.pcb_component_id===r.pcb_component_id)),s=r?.footprinter_string??i?.footprinter_string,a=r?mls(e,r.pcb_component_id):null;return{schematicComponent:n,sourceComponent:o,pcbComponent:r,footprinterString:s,footprintPreviewCircuitJson:a?.circuitJson,footprintPreviewViewBox:a?.viewBox,warnings:sls(e,n,r)}},JBe=2,mls=(e,t)=>{let n=e.find((i)=>i.type==="pcb_component"&&i.pcb_component_id===t);if(!n)return null;let o=ggt(n);if(!o)return null;let r={minX:o.minX-JBe,minY:o.minY-JBe,maxX:o.maxX+JBe,maxY:o.maxY+JBe};return{circuitJson:x0o(e,r),viewBox:r}},_ls=(e,t)=>{let n=Kpo(e,{width:320,height:240,viewport:t,backgroundColor:"#f8fafc",includeVersion:!1});return`data:image/svg+xml;charset=utf-8,${encodeURIComponent(n)}`},Xgo=(e,t)=>{let n=e?.closest("[data-schematic-component-id]")?.getAttribute("data-schematic-component-id"),o=e?.closest("[data-schematic-text-id]")?.getAttribute("data-schematic-text-id"),r=e?.closest("[data-schematic-port-id]")?.getAttribute("data-schematic-port-id");if(!n&&!o&&!r)return;let i=t.find((l)=>l.type==="schematic_text"&&l.schematic_text_id===o),s=t.find((l)=>l.type==="schematic_port"&&!!r&&(l.schematic_port_id===r||l.source_port_id===r)),a=n??(i?.type==="schematic_text"?i.schematic_component_id:void 0)??(s?.type==="schematic_port"?s.schematic_component_id:void 0);if(!a)return;let c=t.find((l)=>l.type==="schematic_component"&&l.schematic_component_id===a);if(c?.type!=="schematic_component")return;return c},gls=(e,t)=>{let n=Xgo(e,t);if(!n)return;let o=t.find((i)=>i.type==="source_component"&&i.source_component_id===n.source_component_id),r=t.find((i)=>i.type==="pcb_component"&&i.source_component_id===n.source_component_id);if(o?.type!=="source_component"||r?.type!=="pcb_component")return;return{source_component_id:o.source_component_id,schematic_component_id:n.schematic_component_id,pcb_component_id:r.pcb_component_id,refdes:o.name}},LAt=jA.createContext(null),Als=5,fls=(e,t)=>{if(!e&&!t)return!0;if(!e||!t)return!1;return e.minX===t.minX&&e.maxX===t.maxX&&e.minY===t.minY&&e.maxY===t.maxY},yls=({children:e})=>{if(jA.useContext(LAt))return Nne.jsx(Nne.Fragment,{children:e});return Nne.jsx(xls,{children:e})},xls=({children:e})=>{let t=jA.useRef({pointer:null,boundingBoxes:new Map,hoveringIds:new Set,subscribers:new Set,mouseDownPosition:null}),n=jA.useCallback(()=>{for(let h of t.current.subscribers)h()},[]),o=jA.useCallback(()=>{let h=t.current.pointer,d=new Set;if(h)for(let[_,p]of t.current.boundingBoxes){let m=p.bounds;if(!m)continue;if(h.x>=m.minX&&h.x<=m.maxX&&h.y>=m.minY&&h.y<=m.maxY)d.add(_)}let u=t.current.hoveringIds;if(d.size===u.size&&[...d].every((_)=>u.has(_)))return;t.current.hoveringIds=d,n()},[n]),r=jA.useCallback((h,d)=>{t.current.boundingBoxes.set(h,d),o()},[o]),i=jA.useCallback((h,d)=>{let u=t.current.boundingBoxes.get(h);if(u&&fls(u.bounds,d.bounds)&&u.onClick===d.onClick)return;t.current.boundingBoxes.set(h,d),o()},[o]),s=jA.useCallback((h)=>{if(t.current.boundingBoxes.delete(h))o()},[o]),a=jA.useCallback((h)=>(t.current.subscribers.add(h),()=>{t.current.subscribers.delete(h)}),[]),c=jA.useCallback((h)=>t.current.hoveringIds.has(h),[]);jA.useEffect(()=>{let h=(p)=>{let{clientX:m,clientY:A}=p,g=t.current.pointer;if(g&&g.x===m&&g.y===A)return;t.current.pointer={x:m,y:A},o()},d=()=>{if(t.current.pointer===null)return;t.current.pointer=null,t.current.mouseDownPosition=null,o()},u=(p)=>{t.current.mouseDownPosition={x:p.clientX,y:p.clientY}},_=(p)=>{let{clientX:m,clientY:A}=p,g=t.current.mouseDownPosition;if(g){if(Math.sqrt(Math.pow(m-g.x,2)+Math.pow(A-g.y,2))>Als){t.current.mouseDownPosition=null;return}}t.current.mouseDownPosition=null;for(let f of t.current.boundingBoxes.values()){let y=f.bounds;if(!y)continue;if(m>=y.minX&&m<=y.maxX&&A>=y.minY&&A<=y.maxY)f.onClick?.(p)}};return window.addEventListener("pointermove",h,{passive:!0}),window.addEventListener("pointerdown",h,{passive:!0}),window.addEventListener("pointerup",h,{passive:!0}),window.addEventListener("pointerleave",d),window.addEventListener("pointercancel",d),window.addEventListener("blur",d),window.addEventListener("mousedown",u,{passive:!0}),window.addEventListener("click",_,{passive:!0}),()=>{window.removeEventListener("pointermove",h),window.removeEventListener("pointerdown",h),window.removeEventListener("pointerup",h),window.removeEventListener("pointerleave",d),window.removeEventListener("pointercancel",d),window.removeEventListener("blur",d),window.removeEventListener("mousedown",u),window.removeEventListener("click",_)}},[o]);let l=jA.useMemo(()=>({registerBoundingBox:r,updateBoundingBox:i,unregisterBoundingBox:s,subscribe:a,isHovering:c}),[r,i,s,a,c]);return Nne.jsx(LAt.Provider,{value:l,children:e})},Tne=(e)=>{if(typeof e!=="number"&&typeof e!=="string")return null;if(typeof e==="string"&&!e.trim())return null;let t=Number(e);return Number.isFinite(t)&&t>=0?t:null},Cls=(e)=>{let t=Tne(e);if(t!==null)return t;if(typeof e!=="string")return null;try{let n=JSON.parse(e);if(Array.isArray(n))return Tne(n[0]?.price)}catch{return e.split(",").map((o)=>{let[r,i]=o.split(":");return{quantity:Tne(r?.split("-")[0]),price:Tne(i)}}).filter((o)=>o.quantity!==null&&o.price!==null).sort((o,r)=>o.quantity-r.quantity)[0]?.price??null}return null},bls=async(e,t,n=fetch)=>{let o=await n(`https://jlcsearch.tscircuit.com/api/search?q=${encodeURIComponent(e)}&limit=1`,{signal:t,cache:"no-store"});if(!o.ok)throw Error("JLC part lookup failed");let r=await o.json();if(!Array.isArray(r?.components))return null;let i=r.components.find((s)=>s&&String(s.lcsc).replace(/^c/i,"")===e.replace(/^c/i,""));if(!i)return null;return{price:Tne(i.price1)??Cls(i.price),stock:Tne(i.stock)}},Ils=(e)=>{if(e?.price==null)return"Price unavailable";let t={minimumFractionDigits:2,maximumFractionDigits:6};if(e.currency===null)return e.price.toLocaleString("en-US",t);return e.price.toLocaleString("en-US",{...t,style:"currency",currency:e.currency??"USD"})},vls=({partNumber:e,platformConfig:t})=>{let[n,o]=I_e.useState(null),[r,i]=I_e.useState(!0),s=t?.partsEngine,a=t?.platformFetch;return I_e.useEffect(()=>{let c=new AbortController,l=!0;i(!0),o(null);let h=setTimeout(()=>{if(c.abort(),l)i(!1)},1e4);return Promise.resolve().then(async()=>{if(s?.fetchPartAvailability)return await s.fetchPartAvailability({supplierName:"jlcpcb",supplierPartNumber:e,signal:c.signal,platformFetch:a})??null;return bls(e,c.signal,a)}).then((d)=>{if(l)o(d)}).catch(()=>{}).finally(()=>{if(clearTimeout(h),l)i(!1)}),()=>{l=!1,clearTimeout(h),c.abort()}},[e,s,a]),c6.jsx("span",{role:"status","aria-label":`${e} price and stock`,"aria-busy":r,style:{display:"block",color:"#64748b",marginTop:"2px"},children:r?c6.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:4},children:[c6.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12","aria-hidden":"true",children:c6.jsx("circle",{cx:"6",cy:"6",r:"4",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeDasharray:"18 8",children:c6.jsx("animateTransform",{attributeName:"transform",type:"rotate",from:"0 6 6",to:"360 6 6",dur:"1s",repeatCount:"indefinite"})})}),"Loading price and stock…"]}):c6.jsxs(c6.Fragment,{children:[c6.jsx("span",{style:{display:"block"},children:Ils(n)}),c6.jsx("span",{style:{display:"block"},children:n?.stock!=null?`${n.stock.toLocaleString("en-US")} in stock`:"Stock unavailable"})]})})},DAt={color:"#64748b",fontFamily:'ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace',fontSize:"12px",lineHeight:1.45},Sls=({platformConfig:e,sourceComponent:t,warnings:n=[],footprinterString:o,footprintPreviewCircuitJson:r,footprintPreviewViewBox:i,left:s,top:a,width:c,maxHeight:l})=>{let h=tTe.useMemo(()=>dls(t),[t]),d=tTe.useMemo(()=>uls(t),[t]),u=tTe.useMemo(()=>r?.length&&i?_ls(r,i):void 0,[r,i]);return sp.jsxs("dialog",{open:!0,"aria-label":`${t.name} component details`,"data-schematic-component-details-tooltip":!0,style:{position:"absolute",left:s,right:"auto",top:a,bottom:"auto",width:c,maxHeight:l,margin:0,padding:0,overflowY:"auto",overscrollBehavior:"contain",cursor:"auto",boxSizing:"border-box",border:"1px solid #cbd5e1",borderRadius:"4px",backgroundColor:"rgba(255, 255, 255, 0.98)",boxShadow:"0 20px 25px -5px rgba(15, 23, 42, 0.18), 0 8px 10px -6px rgba(15, 23, 42, 0.12)",color:"#0f172a",fontFamily:'Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif',pointerEvents:"auto",userSelect:"text",WebkitUserSelect:"text",zIndex:d6.schematicComponentDetailsTooltip},onMouseDown:(_)=>_.stopPropagation(),onClick:(_)=>_.stopPropagation(),onWheel:(_)=>_.stopPropagation(),children:[sp.jsxs("dl",{style:{display:"grid",gridTemplateColumns:"minmax(110px, 0.8fr) minmax(0, 1.2fr)",gap:"6px 12px",margin:0,padding:"8px"},children:[h.map((_)=>sp.jsxs("div",{style:{display:"contents"},children:[sp.jsx("dt",{style:DAt,children:_.label}),sp.jsx("dd",{style:{minWidth:0,margin:0,color:"#1e293b",fontFamily:'ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace',fontSize:"12px",lineHeight:1.45,overflowWrap:"anywhere"},children:_.value})]},_.key)),d.map((_)=>sp.jsxs("div",{style:{display:"contents"},children:[sp.jsx("dt",{style:DAt,children:_.label}),sp.jsx("dd",{style:{minWidth:0,margin:0,fontFamily:'ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace',fontSize:"12px",lineHeight:1.45,overflowWrap:"anywhere"},children:_.links.map((p,m)=>sp.jsxs("span",{style:_.label==="jlcpcb"?{display:"block",marginTop:m>0?6:0}:void 0,children:[_.label!=="jlcpcb"&&m>0&&", ",sp.jsx("a",{href:p.href,target:"_blank",rel:"noreferrer noopener",style:{color:"#2563eb",textDecoration:"underline"},children:p.partNumber}),_.label==="jlcpcb"&&sp.jsx(vls,{partNumber:p.partNumber,platformConfig:e},`${t.source_component_id}-${p.partNumber}`)]},p.href))})]},_.key)),o&&sp.jsxs("div",{style:{display:"contents"},children:[sp.jsx("dt",{style:DAt,children:"footprint"}),sp.jsx("dd",{style:{minWidth:0,margin:0,color:"#1e293b",fontFamily:'ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace',fontSize:"12px",lineHeight:1.45,overflowWrap:"anywhere"},children:JSON.stringify(o)})]})]}),n.length>0&&sp.jsxs("section",{"aria-label":"Component warnings",style:{margin:"0 8px 8px",padding:"8px",border:"1px solid #fcd34d",borderRadius:"4px",backgroundColor:"#fffbeb",color:"#92400e",fontSize:"12px",lineHeight:1.45,overflowWrap:"anywhere"},children:[sp.jsxs("strong",{children:["Warnings (",n.length,")"]}),sp.jsx("ul",{style:{margin:"4px 0 0",paddingLeft:"18px"},children:n.map((_,p)=>sp.jsx("li",{children:_.message},`${_.type}-${p}`))})]}),u&&sp.jsx("div",{style:{padding:"0 4px 4px"},children:sp.jsx("div",{style:{height:"210px",overflow:"hidden",border:"1px solid #e2e8f0",borderRadius:"2px",background:"#f8fafc"},children:sp.jsx("img",{src:u,alt:`${t.name}${o?` ${o}`:""} PCB footprint`,loading:"lazy",referrerPolicy:"no-referrer",style:{display:"block",width:"100%",height:"100%",objectFit:"contain"}})})})]})},jgo=(e)=>{let t=k3.useContext(LAt);if(!t)throw Error("useMouseEventsOverBoundingBox must be used within a MouseTracker");let n=k3.useId(),o=k3.useRef(e);o.current=e;let r=k3.useMemo(()=>(s)=>{o.current.onClick?.(s)},[]);return k3.useEffect(()=>(t.registerBoundingBox(n,{bounds:o.current.bounds,onClick:o.current.onClick?r:void 0}),()=>{t.unregisterBoundingBox(n)}),[t,r,n]),k3.useEffect(()=>{t.updateBoundingBox(n,{bounds:o.current.bounds,onClick:o.current.onClick?r:void 0})},[t,r,n,e.bounds?.minX,e.bounds?.maxX,e.bounds?.minY,e.bounds?.maxY,e.onClick]),{hovering:k3.useSyncExternalStore(t.subscribe,()=>t.isHovering(n),()=>!1)}},Pls=(e,t)=>{if(!e&&!t)return!0;if(!e||!t)return!1;return Math.abs(e.bounds.minX-t.bounds.minX)<0.5&&Math.abs(e.bounds.maxX-t.bounds.maxX)<0.5&&Math.abs(e.bounds.minY-t.bounds.minY)<0.5&&Math.abs(e.bounds.maxY-t.bounds.maxY)<0.5&&Math.abs(e.rect.left-t.rect.left)<0.5&&Math.abs(e.rect.top-t.rect.top)<0.5&&Math.abs(e.rect.width-t.rect.width)<0.5&&Math.abs(e.rect.height-t.rect.height)<0.5},Els=({componentId:e,svgDivRef:t,containerRef:n,onComponentClick:o,onHoverChange:r,showOutline:i,circuitJsonKey:s})=>{let[a,c]=l6.useState(null),l=l6.useRef(null),h=l6.useCallback(()=>{l.current=null;let A=t.current,g=n.current;if(!A||!g){c((b)=>b?null:b);return}let f=A.querySelector(`[data-schematic-component-id="${e}"]`);if(!f){c((b)=>b?null:b);return}let y=f.getBoundingClientRect(),x=g.getBoundingClientRect(),C={bounds:{minX:y.left,maxX:y.right,minY:y.top,maxY:y.bottom},rect:{left:y.left-x.left,top:y.top-x.top,width:y.width,height:y.height}};c((b)=>Pls(b,C)?b:C)},[e,n,t]),d=l6.useCallback(()=>{if(l.current!==null)return;l.current=window.requestAnimationFrame(h)},[h]);l6.useEffect(()=>{d()},[d,s]),l6.useEffect(()=>{d();let A=t.current,g=n.current;if(!A||!g)return;let f=typeof ResizeObserver<"u"?new ResizeObserver(()=>{d()}):null;f?.observe(g),f?.observe(A);let y=typeof MutationObserver<"u"?new MutationObserver(()=>{d()}):null;return y?.observe(A,{attributes:!0,attributeFilter:["style","transform"],subtree:!0,childList:!0}),window.addEventListener("scroll",d,!0),window.addEventListener("resize",d),()=>{if(f?.disconnect(),y?.disconnect(),window.removeEventListener("scroll",d,!0),window.removeEventListener("resize",d),l.current!==null)cancelAnimationFrame(l.current),l.current=null}},[d,t,n]);let u=l6.useCallback((A)=>{if(o)o(e,A)},[e,o]),_=a?.bounds??null,{hovering:p}=jgo({bounds:_,onClick:o?u:void 0});if(l6.useEffect(()=>{if(r)r(e,p)},[p,e,r]),!a||!p||!i)return null;let m=a.rect;return Kgo.jsx("div",{style:{position:"absolute",left:m.left,top:m.top,width:m.width,height:m.height,border:"1.5px solid rgba(51, 153, 255, 0.9)",pointerEvents:"none",zIndex:d6.schematicComponentHoverOutline}})},Mls=(e,t)=>{if(!e&&!t)return!0;if(!e||!t)return!1;return Math.abs(e.bounds.minX-t.bounds.minX)<0.5&&Math.abs(e.bounds.maxX-t.bounds.maxX)<0.5&&Math.abs(e.bounds.minY-t.bounds.minY)<0.5&&Math.abs(e.bounds.maxY-t.bounds.maxY)<0.5&&Math.abs(e.rect.left-t.rect.left)<0.5&&Math.abs(e.rect.top-t.rect.top)<0.5&&Math.abs(e.rect.width-t.rect.width)<0.5&&Math.abs(e.rect.height-t.rect.height)<0.5},wls=({portId:e,portLabel:t,svgDivRef:n,containerRef:o,onPortClick:r,onHoverChange:i,showOutline:s,circuitJsonKey:a})=>{let[c,l]=h6.useState(null),h=h6.useRef(null),d=h6.useCallback(()=>{h.current=null;let g=n.current,f=o.current;if(!g||!f){l((v)=>v?null:v);return}let y=g.querySelector(`[data-schematic-port-id="${e}"]`);if(!y){l((v)=>v?null:v);return}let x=y.getBoundingClientRect(),C=f.getBoundingClientRect(),b=4,I={bounds:{minX:x.left-b,maxX:x.right+b,minY:x.top-b,maxY:x.bottom+b},rect:{left:x.left-C.left-b,top:x.top-C.top-b,width:x.width+b*2,height:x.height+b*2}};l((v)=>Mls(v,I)?v:I)},[e,o,n]),u=h6.useCallback(()=>{if(h.current!==null)return;h.current=window.requestAnimationFrame(d)},[d]);h6.useEffect(()=>{u()},[u,a]),h6.useEffect(()=>{u();let g=n.current,f=o.current;if(!g||!f)return;let y=typeof ResizeObserver<"u"?new ResizeObserver(()=>{u()}):null;y?.observe(f),y?.observe(g);let x=typeof MutationObserver<"u"?new MutationObserver(()=>{u()}):null;return x?.observe(g,{attributes:!0,attributeFilter:["style","transform"],subtree:!0,childList:!0}),window.addEventListener("scroll",u,!0),window.addEventListener("resize",u),()=>{if(y?.disconnect(),x?.disconnect(),window.removeEventListener("scroll",u,!0),window.removeEventListener("resize",u),h.current!==null)cancelAnimationFrame(h.current),h.current=null}},[u,n,o]);let _=h6.useCallback((g)=>{if(r)r(e,g)},[e,r]),p=c?.bounds??null,{hovering:m}=jgo({bounds:p,onClick:r?_:void 0});if(h6.useEffect(()=>{if(i)i(e,m)},[m,e,i]),!c||!s)return null;let A=c.rect;return yU.jsxs(yU.Fragment,{children:[yU.jsx("div",{style:{position:"absolute",left:A.left,top:A.top,width:A.width,height:A.height,border:m?"1.5px solid rgba(255, 153, 51, 0.9)":"1.5px solid rgba(255, 153, 51, 0.3)",backgroundColor:m?"rgba(255, 153, 51, 0.15)":"rgba(255, 153, 51, 0.05)",borderRadius:"50%",pointerEvents:"none",zIndex:d6.schematicPortHoverOutline,transition:"border-color 0.15s, background-color 0.15s"}}),m&&t&&yU.jsx("div",{style:{position:"absolute",left:A.left+A.width/2,top:A.top-24,transform:"translateX(-50%)",backgroundColor:"rgba(0, 0, 0, 0.85)",color:"white",padding:"4px 8px",borderRadius:"4px",fontSize:"12px",fontFamily:"monospace",whiteSpace:"nowrap",pointerEvents:"none",zIndex:d6.schematicPortHoverOutline+1},children:t})]})},v_e=({children:e,size:t,strokeWidth:n})=>R_.jsx("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:n,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:e}),zgo=(e)=>R_.jsxs(v_e,{...e,children:[R_.jsx("circle",{cx:"11",cy:"11",r:"8"}),R_.jsx("path",{d:"m21 21-4.34-4.34"})]}),Bls=(e)=>R_.jsxs(v_e,{...e,children:[R_.jsx("path",{d:"M18 6 6 18"}),R_.jsx("path",{d:"m6 6 12 12"})]}),Tls=(e)=>R_.jsxs(v_e,{...e,children:[R_.jsx("rect",{x:"4",y:"4",width:"16",height:"16",rx:"2"}),R_.jsx("rect",{x:"8",y:"8",width:"8",height:"8",rx:"1"}),R_.jsx("path",{d:"M7 2v2M12 2v2M17 2v2M7 20v2M12 20v2M17 20v2M2 7h2M2 12h2M2 17h2M20 7h2M20 12h2M20 17h2"})]}),Dls=(e)=>R_.jsxs(v_e,{...e,children:[R_.jsx("path",{d:"M15 6a9 9 0 0 0-9 9V3"}),R_.jsx("circle",{cx:"18",cy:"6",r:"3"}),R_.jsx("circle",{cx:"6",cy:"18",r:"3"})]}),Nls=(e)=>R_.jsxs(v_e,{...e,children:[R_.jsx("path",{d:"M20 4v7a4 4 0 0 1-4 4H4"}),R_.jsx("path",{d:"m9 10-5 5 5 5"})]}),Rls=({text:e,query:t})=>{let n=t.trim().toLocaleLowerCase();if(!n)return e;let o=e.toLocaleLowerCase(),r=[],i=0,s=o.indexOf(n);while(s!==-1){if(s>i)r.push(e.slice(i,s));r.push(zl.jsx("strong",{style:{fontWeight:700},children:e.slice(s,s+n.length)},`${s}-${i}`)),i=s+n.length,s=o.indexOf(n,i)}if(i<e.length)r.push(e.slice(i));if(r.length>0)return r;return e},Qls=()=>{if(typeof navigator>"u")return"Ctrl F";if(/mac/i.test(navigator.platform))return"⌘ F";return"Ctrl F"},kls=({query:e,onQueryChange:t,onCancel:n,results:o,onSelect:r,viewerContainerRef:i})=>{let[s,a]=yv.useState(!1),[c,l]=yv.useState(null),[h,d]=yv.useState(null),u=yv.useRef(null),_=yv.useRef(null),p=Qls();yv.useEffect(()=>{l((P)=>{if(o.some((M)=>M.target.id===P))return P;return o.find((M)=>M.kind==="component")?.target.id??o[0]?.target.id??null})},[o]),yv.useEffect(()=>{if(!c)return;_.current?.querySelector(`[data-search-result-id="${c}"]`)?.scrollIntoView({behavior:"smooth",block:"nearest"})},[c]),yv.useEffect(()=>{let P=(B)=>{if(B.key==="Escape"&&s){B.preventDefault(),B.stopPropagation(),B.stopImmediatePropagation(),n(),a(!1),u.current?.blur();return}if(B.code!=="KeyF"&&B.key.toLocaleLowerCase()!=="f")return;if(!B.metaKey&&!B.ctrlKey)return;if(!i.current?.matches(":hover"))return;B.preventDefault(),B.stopPropagation(),B.stopImmediatePropagation(),a(!0),requestAnimationFrame(()=>{u.current?.focus(),u.current?.select()})},M=[window];try{if(window.parent!==window&&window.parent.document)M.push(window.parent)}catch{}return M.forEach((B)=>B.addEventListener("keydown",P,{capture:!0})),()=>{M.forEach((B)=>B.removeEventListener("keydown",P,{capture:!0}))}},[s,n,i]);let m=()=>{n(),a(!1),u.current?.blur()},A=(P)=>{if(a(!0),P)requestAnimationFrame(()=>u.current?.focus())},g=o.filter((P)=>P.kind==="component"),f=o.filter((P)=>P.kind==="net"),y=[...g,...f],x=y.find((P)=>P.target.id===c)??y[0],C=o.length===1?"1 result":`${o.length} results`,b="none";if(e)b="1px solid #e8e8e8";let I=(P)=>{if(P.key==="Enter"&&P.target instanceof Element&&P.target.closest('[aria-label="Clear search"]'))return;if(P.key==="Escape"){P.preventDefault(),m();return}if(y.length>0&&(P.key==="ArrowDown"||P.key==="ArrowUp")){P.preventDefault();let M=-1;if(P.key==="ArrowDown")M=1;l((B)=>{let T=y.findIndex((L)=>L.target.id===B),N=T;if(T===-1){if(N=0,M===1)N=-1}let D=(N+M+y.length)%y.length;return y[D]?.target.id??null});return}if(P.key==="Enter"&&x)P.preventDefault(),r(x)},v=(P,M)=>{if(M.length===0)return null;return zl.jsxs("section",{children:[zl.jsx("div",{style:{padding:"6px 12px 3px",backgroundColor:"#f7f7f8",color:"#777777",fontSize:"11px",fontWeight:600,letterSpacing:"0.02em",textTransform:"lowercase"},children:P}),M.map((B)=>{let T=B.target.id===x?.target.id,N=B.target.id===h,D="#ffffff";if(N||T)D="#f1f3f5";let L=zl.jsx(Dls,{size:15,strokeWidth:1.8});if(B.kind==="component")L=zl.jsx(Tls,{size:15,strokeWidth:1.8});let H=()=>{u.current?.blur(),l(B.target.id),r(B)};return zl.jsxs("button",{type:"button","data-search-result-id":B.target.id,onPointerUp:(V)=>{if(V.button===0)H()},onClick:(V)=>{if(V.detail===0)H()},onMouseEnter:()=>d(B.target.id),onMouseLeave:()=>d(null),style:{width:"100%",display:"flex",alignItems:"center",gap:"9px",padding:"7px 12px",border:"none",background:D,color:"#222222",cursor:"pointer",textAlign:"left"},children:[zl.jsx("span",{style:{width:"26px",height:"26px",flexShrink:0,display:"grid",placeItems:"center",border:"1px solid #e5e5e5",borderRadius:"6px",backgroundColor:"#f7f7f7",color:"#666666"},children:L}),zl.jsxs("span",{style:{minWidth:0,flex:1},children:[zl.jsx("span",{style:{display:"block",overflow:"hidden",fontSize:"13px",fontWeight:400,lineHeight:1.25,textOverflow:"ellipsis",whiteSpace:"nowrap"},children:zl.jsx(Rls,{text:B.label,query:e})}),B.detail&&zl.jsx("span",{style:{display:"block",overflow:"hidden",marginTop:"2px",color:"#777777",fontSize:"11px",lineHeight:1.2,textOverflow:"ellipsis",whiteSpace:"nowrap"},children:B.detail}),B.schematicSheetName&&zl.jsxs("span",{style:{display:"block",overflow:"hidden",marginTop:"2px",color:"#777777",fontSize:"11px",lineHeight:1.2,textOverflow:"ellipsis",whiteSpace:"nowrap"},children:["Sheet: ",B.schematicSheetName]})]}),T&&zl.jsx("span",{title:"Press Enter to open",style:{flexShrink:0,color:"#666666",fontSize:"17px",lineHeight:1},children:zl.jsx(Nls,{size:14,strokeWidth:1.8})})]},B.target.id)})]})};return zl.jsx("div",{"data-schematic-search":!0,onPointerDown:(P)=>P.stopPropagation(),onMouseDown:(P)=>P.stopPropagation(),onTouchStart:(P)=>P.stopPropagation(),onTouchEnd:(P)=>P.stopPropagation(),style:{position:"relative",zIndex:d6.schematicSearch,fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif'},children:!s?zl.jsx("button",{type:"button",title:"Search schematic","aria-label":"Search schematic",onPointerDown:(P)=>{if(P.stopPropagation(),P.pointerType!=="mouse")A(!1)},onPointerUp:(P)=>{if(P.pointerType==="mouse"&&P.button===0)A(!0)},onClick:(P)=>{if(P.detail===0)A(!0)},style:{width:"32px",height:"32px",display:"grid",placeItems:"center",padding:0,border:"none",borderRadius:"4px",backgroundColor:"#ffffff",color:"#000000",cursor:"pointer",boxShadow:"0 2px 4px rgba(0,0,0,0.1)"},children:zl.jsx(zgo,{size:16,strokeWidth:2})}):zl.jsxs("div",{onKeyDown:I,style:{width:"min(280px, calc(100vw - 32px))",overflow:"hidden",border:"none",borderRadius:"4px",backgroundColor:"#ffffff",boxShadow:"0 2px 4px rgba(0,0,0,0.1)"},children:[zl.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px",height:"32px",boxSizing:"border-box",padding:"0 12px",borderBottom:b},children:[zl.jsx(zgo,{size:15,strokeWidth:2}),zl.jsx("input",{ref:u,value:e,"aria-label":"Search components and nets",placeholder:"Search...",onPointerUp:(P)=>P.currentTarget.focus(),onChange:(P)=>t(P.target.value),style:{minWidth:0,flex:1,border:"none",outline:"none",fontSize:"13px",color:"#222222",background:"transparent"}}),e&&o.length>0?zl.jsx("span",{style:{flexShrink:0,color:"#888888",fontSize:"12px",whiteSpace:"nowrap"},children:C}):zl.jsx("kbd",{style:{flexShrink:0,padding:"2px 5px",border:"1px solid #dddddd",borderRadius:"4px",backgroundColor:"#f7f7f7",color:"#777777",fontFamily:"inherit",fontSize:"10px",lineHeight:1.2},children:p}),s&&zl.jsx("button",{type:"button","aria-label":"Clear search",onPointerUp:(P)=>{if(P.button===0)m()},onClick:(P)=>{if(P.detail===0)m()},style:{border:"none",background:"transparent",color:"#777777",cursor:"pointer",width:"20px",height:"20px",display:"grid",placeItems:"center",padding:0,lineHeight:1},children:zl.jsx(Bls,{size:16,strokeWidth:2})})]}),e&&zl.jsx("div",{ref:_,style:{maxHeight:"240px",overflowX:"hidden",overflowY:"auto",overscrollBehavior:"contain",scrollBehavior:"smooth",touchAction:"pan-y",WebkitOverflowScrolling:"touch"},onWheel:(P)=>P.stopPropagation(),onTouchMove:(P)=>P.stopPropagation(),children:o.length===0?zl.jsx("div",{style:{padding:"12px",color:"#777777",fontSize:"13px"},children:"No matching components or nets"}):zl.jsxs(zl.Fragment,{children:[v("components",g),v("nets",f)]})})]})})},HAt='system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',Lls={backgroundColor:"#ffffff",color:"#111111",borderRadius:8,boxShadow:"0 6px 24px rgba(0,0,0,0.12), 0 1px 3px rgba(0,0,0,0.08)",border:"1px solid #e5e7eb",padding:4,minWidth:200,maxWidth:320,maxHeight:320,overflowY:"auto",fontSize:13,fontFamily:HAt,outline:"none",zIndex:d6.viewMenu},Hls={display:"flex",alignItems:"center",gap:8,padding:"7px 10px 7px 8px",borderRadius:6,cursor:"pointer",outline:"none",userSelect:"none",color:"#111111",fontSize:13,fontFamily:HAt},Fls={width:16,height:16,flexShrink:0,display:"inline-flex",alignItems:"center",justifyContent:"center",color:"#111111"},Ogo={overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},zls=`
.sv-sheet-item[data-highlighted], .sv-sheet-item:hover { background-color: #f1f3f5; }
.sv-sheet-chevron { transition: transform 0.2s ease; }
[data-state="open"] > .sv-sheet-chevron { transform: rotate(180deg); }
`,Ols=()=>Hp.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:Hp.jsx("path",{d:"M20 6 9 17l-5-5"})}),Vls=({className:e})=>Hp.jsx("svg",{className:e,width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",style:{opacity:0.6,flexShrink:0},"aria-hidden":"true",children:Hp.jsx("path",{d:"m6 9 6 6 6-6"})}),Yls=({sheets:e,selectedSheetId:t,onSelectSheet:n})=>{let[o,r]=$go.useState(!1);if(e.length<=1)return null;let s=e.find((a)=>a.schematic_sheet_id===t)?.name??"Select sheet";return Hp.jsxs(Hp.Fragment,{children:[Hp.jsx("style",{children:zls}),Hp.jsxs(jBe,{open:o,onOpenChange:r,modal:!1,children:[Hp.jsx(KBe,{asChild:!0,children:Hp.jsxs("button",{type:"button",title:s,onPointerDown:(a)=>a.stopPropagation(),style:{display:"flex",alignItems:"center",gap:"6px",maxWidth:"220px",height:"32px",boxSizing:"border-box",padding:"0 12px",backgroundColor:"#ffffff",color:"#000000",border:"none",outline:"none",borderRadius:"4px",cursor:"pointer",boxShadow:"0 2px 4px rgba(0,0,0,0.1)",fontSize:"13px",fontFamily:HAt},children:[Hp.jsx("span",{style:{color:"#888888",flexShrink:0},children:"Sheet:"}),Hp.jsx("span",{style:{...Ogo,minWidth:0},children:s}),Hp.jsx(Vls,{className:"sv-sheet-chevron"})]})}),Hp.jsx(y_e,{children:Hp.jsx($Be,{style:Lls,side:"bottom",align:"start",sideOffset:8,collisionPadding:10,children:e.map((a)=>{let c=a.schematic_sheet_id===t;return Hp.jsxs(bT,{className:"sv-sheet-item",style:Hls,title:a.name,onSelect:(l)=>l.preventDefault(),onPointerUp:()=>{n(a.schematic_sheet_id),r(!1)},children:[Hp.jsx("span",{style:Fls,children:c&&Hp.jsx(Ols,{})}),Hp.jsx("span",{style:{...Ogo,minWidth:0},children:a.name})]},a.schematic_sheet_id)})})})]})]})},Gls=({count:e,showWarnings:t,onToggle:n})=>{let o=`${t?"Hide":"Show"} ${e} ${e===1?"warning":"warnings"}`;return fU.jsxs("button",{type:"button","data-schematic-warnings":!0,title:o,"aria-label":o,"aria-pressed":t,onClick:n,onPointerDown:(r)=>r.stopPropagation(),onMouseDown:(r)=>r.stopPropagation(),onTouchStart:(r)=>r.stopPropagation(),onTouchEnd:(r)=>r.stopPropagation(),style:{height:"32px",display:"flex",alignItems:"center",gap:"4px",padding:"0 8px",border:"none",borderRadius:"4px",backgroundColor:t?"#fff3cd":"#ffffff",color:"#946200",cursor:"pointer",boxShadow:"0 2px 4px rgba(0,0,0,0.1)",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif',fontSize:"12px",fontWeight:600},children:[fU.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[fU.jsx("path",{d:"M10.3 3.9 1.8 18.1A2 2 0 0 0 3.5 21h17a2 2 0 0 0 1.7-2.9L13.7 3.9a2 2 0 0 0-3.4 0Z"}),fU.jsx("path",{d:"M12 9v4m0 4h.01"})]}),fU.jsx("span",{children:e})]})},Uls={name:"@tscircuit/schematic-viewer",version:"2.0.104",repository:{type:"git",url:"https://github.com/tscircuit/schematic-viewer"},main:"dist/index.js",exports:{".":{types:"./dist/index.d.ts",default:"./dist/index.js"}},type:"module",scripts:{start:"cosmos",build:"tsup-node ./lib/index.ts --dts --format esm --sourcemap","build:site":"cosmos-export","test:package":"bun run build && bun run scripts/test-package.ts","vercel-build":"bun run build:site",format:"biome format --write .","format:check":"biome format ."},files:["dist"],devDependencies:{"@biomejs/biome":"^1.9.4","@types/bun":"latest","@types/debug":"^4.1.12","@types/jsdom":"^21.1.7","@types/react":"^19.0.1","@types/react-dom":"^19.0.2","@vitejs/plugin-react":"^4.3.4",jsdom:"^26.0.0",react:"^19.1.0","react-cosmos":"^6.2.1","react-cosmos-plugin-vite":"^6.2.0","react-dom":"^19.1.0","react-reconciler":"^0.31.0",semver:"^7.7.2",tscircuit:"^0.0.2460",tsup:"^8.3.5",vite:"^6.0.3","@tscircuit/circuit-json-schematic-placement-analysis":"https://jscdn.tscircuit.com/@tscircuit/circuit-json-schematic-placement-analysis/0.0.46.tgz"},peerDependencies:{typescript:"^5.0.0",tscircuit:"*"},dependencies:{"@radix-ui/react-dialog":"^1.1.23","@radix-ui/react-dropdown-menu":"^2.1.16","@tscircuit/circuit-json-util":"^0.0.108","@tscircuit/internal-dynamic-import":"^0.0.17","@tscircuit/props":"^0.0.697","@tscircuit/soup-util":"^0.0.41","circuit-json":"^0.0.479","circuit-to-svg":"^0.0.432",debug:"^4.4.0","performance-now":"^2.1.0","transformation-matrix":"^2.16.1","use-mouse-matrix-transform":"^1.2.2"}},FAt='system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',Vgo={backgroundColor:"#262626",color:"#fafafa",borderRadius:6,boxShadow:"0px 12px 48px -12px rgba(0, 0, 0, 0.5), 0px 8px 24px -8px rgba(0, 0, 0, 0.3)",border:"1px solid #333333",padding:4,minWidth:208,fontSize:14,fontWeight:400,fontFamily:FAt,outline:"none",zIndex:d6.contextMenu},tH={display:"flex",alignItems:"center",gap:8,padding:"6px 8px",borderRadius:6,cursor:"default",outline:"none",userSelect:"none",color:"#fafafa",fontSize:14,fontWeight:400,fontFamily:FAt},Bne={width:16,height:16,flexShrink:0,display:"inline-flex",alignItems:"center",justifyContent:"center",color:"#fafafa"},Ygo={height:1,backgroundColor:"#ffffff1a",margin:"4px 0"},Wls=`
.sv-vm-item[data-highlighted]:not([data-disabled]),
.sv-vm-item:hover:not([data-disabled]) { background-color: #404040; }
.sv-vm-item[data-disabled] { opacity: 0.45; cursor: not-allowed; }
`,ZBe=()=>Ns.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:Ns.jsx("path",{d:"M20 6 9 17l-5-5"})}),Xls=({isComponentMenu:e=!1,pcbComponent:t,onViewPcbComponent:n,netLocations:o=[],onSelectNetLocation:r,circuitJson:i,circuitJsonKey:s,menuRef:a,menuPos:c,onOpenChange:l,onRunStyleAnalysis:h,showGroups:d,onToggleGroups:u,showGrid:_,onToggleGrid:p,showPorts:m,onTogglePorts:A,showWarnings:g,onToggleWarnings:f})=>{let y=RAt.useMemo(()=>{if(!i||i.length===0)return!1;try{if((pA(i).source_group?.list()||[]).length>0)return!0;let b=pA(i).schematic_component?.list()||[];if(b.length>1){let I=new Set;for(let v of b){let P=pA(i).source_component.get(v.source_component_id);if(P?.ftype)I.add(P.ftype)}return I.size>1}return!1}catch(C){return console.error("Error checking for groups:",C),!1}},[s]),x=RAt.useMemo(()=>{if(!i||i.length===0)return!1;try{return(pA(i).schematic_port?.list()||[]).length>0}catch(C){return console.error("Error checking for schematic ports:",C),!1}},[s]);if(e&&(!t||!n))return null;return Ns.jsx("div",{ref:a,style:{position:"fixed",left:c.x,top:c.y,width:0,height:0},children:Ns.jsxs(jBe,{open:!0,onOpenChange:l,modal:!1,children:[Ns.jsx(KBe,{asChild:!0,children:Ns.jsx("div",{style:{position:"absolute",width:1,height:1}})}),Ns.jsx(y_e,{children:Ns.jsxs($Be,{style:Vgo,align:"start",sideOffset:0,collisionPadding:10,avoidCollisions:!0,children:[Ns.jsx("style",{children:Wls}),t&&n&&Ns.jsx(Ns.Fragment,{children:Ns.jsxs(bT,{className:"sv-vm-item",style:tH,onSelect:()=>{l(!1),n(t)},children:[Ns.jsx("span",{style:Bne,children:"↗"}),Ns.jsx("span",{children:"Show on PCB"})]})}),!e&&o.length>0&&Ns.jsxs(Mgo,{children:[Ns.jsxs(wgo,{className:"sv-vm-item",style:tH,children:["Net Locations ",Ns.jsx("span",{style:{marginLeft:"auto"},children:"›"})]}),Ns.jsx(y_e,{children:Ns.jsx(Bgo,{style:{...Vgo,maxHeight:"min(400px, var(--radix-dropdown-menu-content-available-height))",overflowY:"auto"},collisionPadding:10,children:o.map((C,b)=>Ns.jsx(bT,{className:"sv-vm-item",style:tH,onSelect:()=>r?.(C),children:C.label},b))})})]}),!e&&Ns.jsxs(Ns.Fragment,{children:[Ns.jsxs(bT,{className:"sv-vm-item",style:tH,disabled:!x,title:x?void 0:"No ports found in this schematic",onSelect:(C)=>C.preventDefault(),onPointerDown:(C)=>{if(C.preventDefault(),x)A(!m)},children:[Ns.jsx("span",{style:Bne,children:m&&Ns.jsx(ZBe,{})}),Ns.jsx("span",{children:"Show Schematic Ports"})]}),Ns.jsxs(bT,{className:"sv-vm-item",style:tH,disabled:!y,title:y?void 0:"No groups found in this schematic",onSelect:(C)=>C.preventDefault(),onPointerDown:(C)=>{if(C.preventDefault(),y)u(!d)},children:[Ns.jsx("span",{style:Bne,children:d&&Ns.jsx(ZBe,{})}),Ns.jsx("span",{children:"View Schematic Groups"})]}),Ns.jsxs(bT,{className:"sv-vm-item",style:tH,onSelect:(C)=>C.preventDefault(),onPointerDown:(C)=>{C.preventDefault(),p(!_)},children:[Ns.jsx("span",{style:Bne,children:_&&Ns.jsx(ZBe,{})}),Ns.jsx("span",{children:"Show Grid"})]}),Ns.jsxs(Pgo,{className:"sv-vm-item",style:tH,checked:g,onCheckedChange:f,onSelect:(C)=>C.preventDefault(),children:[Ns.jsx("span",{style:Bne,children:Ns.jsx(Ego,{children:Ns.jsx(ZBe,{})})}),Ns.jsx("span",{children:"Show Warnings"})]}),Ns.jsx(EAt,{style:Ygo}),Ns.jsxs(bT,{className:"sv-vm-item",style:tH,onSelect:h,children:[Ns.jsx("span",{style:Bne}),Ns.jsx("span",{children:"Run Style Analysis"})]}),Ns.jsx(EAt,{style:Ygo}),Ns.jsxs("div",{style:{padding:"4px 8px 4px 32px",fontSize:11,opacity:0.35,color:"#a1a1aa",letterSpacing:"0.2px",fontFamily:FAt},children:["@tscircuit/schematic-viewer@",String(Uls?.version)]})]})]})})]})})},zAt=({circuitJson:e,platformConfig:t,containerStyle:n,debugGrid:o=!1,debug:r=!1,clickToInteractEnabled:i=!1,colorOverrides:s,disableGroups:a=!1,netHoverHighlightEnabled:c=!0,onSchematicComponentClicked:l,showSchematicPorts:h,onSchematicPortClicked:d,onSchematicSheetChange:u,searchEnabled:_=!0,controller:p,onViewPcbComponent:m,css:A,className:g})=>{if(r)nls();let f=(Ye)=>`${Ye?.length||0}_${Ye?.editCount||0}`,y=xc.useMemo(()=>f(e),[e]),x=xc.useMemo(()=>{try{return e.filter((Ye)=>Ye?.type==="schematic_sheet").slice().sort((Ye,je)=>(Ye.sheet_index??0)-(je.sheet_index??0))}catch(Ye){return console.error("Failed to derive schematic sheets",Ye),[]}},[y]),C=x.length>1,b=x[0]?.schematic_sheet_id,[I,v]=xc.useState(()=>{let Ye=Lcs(wne.SELECTED_SCHEMATIC_SHEET);if(Ye&&x.some((je)=>je.schematic_sheet_id===Ye))return Ye;return b});xc.useEffect(()=>{if(!(I!==void 0&&x.some((je)=>je.schematic_sheet_id===I)))v(b)},[y]);let P=C?I??b:void 0,M=xc.useCallback((Ye)=>{v(Ye),Hcs(wne.SELECTED_SCHEMATIC_SHEET,Ye),u?.(Ye)},[u]),[B,T]=xc.useState(!1),[N,D]=xc.useState(null),[L,H]=xc.useState(!1),V=e.filter((Ye)=>Ye.type.startsWith("schematic_")&&Ye.type.endsWith("_warning")).length,O=o||B,[U,j]=xc.useState(!i),[Y,X]=xc.useState(()=>{if(a)return!1;return Ngo(wne.IS_SHOWING_SCHEMATIC_GROUPS,!1)}),[K,J]=xc.useState(()=>h??Ngo(wne.IS_SHOWING_SCHEMATIC_PORTS,!1));xc.useEffect(()=>{if(h!==void 0)J(h)},[h]);let[ee,se]=xc.useState(!1),ne=xc.useRef(new Set),[re,Z]=xc.useState(null),te=xc.useCallback((Ye,je)=>{if(je)ne.current.add(Ye);else ne.current.delete(Ye);se(ne.current.size>0)},[]),[ie,ce]=xc.useState(!1),ue=xc.useRef(new Set),de=xc.useCallback((Ye,je)=>{if(je)ue.current.add(Ye);else ue.current.delete(Ye);ce(ue.current.size>0)},[]),me=xc.useRef(null),ge=xc.useRef(null),xe=xc.useRef({x:1,y:1}),Ee=xc.useMemo(()=>{try{return(pA(e).schematic_component?.list()??[]).filter((je)=>!P||je.schematic_sheet_id===P).map((je)=>je.schematic_component_id)}catch(Ye){return console.error("Failed to derive schematic component ids",Ye),[]}},[y,e,P]),Re=xc.useMemo(()=>{if(!K)return[];try{return(pA(e).schematic_port?.list()??[]).filter((je)=>!P||je.schematic_sheet_id===P).map((je)=>{let st=pA(e).source_port.get(je.source_port_id),Nt=(st?.source_component_id?pA(e).source_component.get(st.source_component_id):null)?.name??"?",Ot=je.display_pin_label??st?.pin_number??st?.name??"?";return{portId:je.source_port_id,label:`${Nt}.${Ot}`}})}catch(Ye){return console.error("Failed to derive schematic port info",Ye),[]}},[y,e,K,P]),Me=(Ye)=>{let je=Ye.touches[0];ge.current={x:je.clientX,y:je.clientY}},_e=(Ye)=>{let je=Ye.changedTouches[0],st=ge.current;if(!st)return;let St=Math.abs(je.clientX-st.x),Nt=Math.abs(je.clientY-st.y);if(St<10&&Nt<10)Ye.preventDefault(),j(!0);ge.current=null},ye=xc.useCallback((Ye)=>{if(Ye.target instanceof Element&&Ye.target.closest("[data-schematic-search], [data-schematic-warnings], .schematic-warning, [data-schematic-component-details-tooltip]"))return!1;if(Ye.type!=="mousedown"||!("button"in Ye))return!0;return Ye.button!==2&&!(Ye.button===0&&Ye.ctrlKey)},[]),{ref:Se,transform:Ne,setTransform:Le}=SBe({onSetTransform(Ye){let je=Ye.a!==xe.current.x||Ye.d!==xe.current.y;if(xe.current={x:Ye.a,y:Ye.d},je)Z(null);if(!me.current)return;me.current.style.transform=Wgo.toString(Ye)},enabled:U,shouldDrag:ye}),{menuVisible:nt,menuPos:dt,menuRef:rt,setMenuVisible:pt,contextMenuEventHandlers:ct,menuTarget:Ct}=ils({containerRef:Se}),{containerWidth:kt,containerHeight:Lt}=ols(Se),Bt=xc.useMemo(()=>re?pls(e,re.schematicComponentId):null,[y,e,re]),xt=xc.useMemo(()=>{if(!re||!kt||!Lt)return null;let Ye=12,je=14,st=Math.min(420,kt-Ye*2),St=Math.min(520,Lt-Ye*2),{anchorX:Nt,anchorY:Ot}=re,Ut=Nt+je,mn=Nt-st-je,_n=Ut+st<=kt-Ye?Ut:mn>=Ye?mn:Math.max(Ye,Math.min(Nt-st/2,kt-st-Ye)),En=Math.max(Ye,Math.min(Ot-24,Lt-St-Ye));return{left:_n,top:En,width:st,maxHeight:St}},[re,kt,Lt]),Yt=xc.useCallback((Ye,je)=>{if(je.target instanceof Element&&je.target.closest("[data-schematic-component-details-tooltip]"))return;let st=Se.current?.getBoundingClientRect();if(!st)return;Z({schematicComponentId:Ye,anchorX:je.clientX-st.left,anchorY:je.clientY-st.top}),l?.({schematicComponentId:Ye,event:je})},[Se,l]);xc.useEffect(()=>{Z(null)},[y,P]),xc.useEffect(()=>{if(!re)return;let Ye=(st)=>{if(st.key==="Escape")Z(null)},je=(st)=>{if(st.target instanceof Element&&st.target.closest("[data-schematic-component-details-tooltip]"))return;Z(null)};return window.addEventListener("keydown",Ye),document.addEventListener("mousedown",je),()=>{window.removeEventListener("keydown",Ye),document.removeEventListener("mousedown",je)}},[re]);let ut=xc.useMemo(()=>{if(!kt||!Lt)return"";return Mmo(e,{width:kt,height:Lt||720,drawPorts:K,shouldDrawWarnings:L,schematicSheetId:P,grid:!O?void 0:{cellSize:1,labelCells:!0},colorOverrides:s,css:A,className:g})},[y,kt,Lt,O,L,K,P]),Ze=xc.useMemo(()=>ut.match(/<svg[^>]*style="[^"]*background-color:\s*([^;\"]+)/i)?.[1]??"transparent",[ut]),{searchQuery:Fe,setSearchQuery:tt,searchResults:Je,handleSearchResultSelect:$e,handleCancelSearch:ft}=tls({controller:p,circuitJson:e,circuitJsonKey:y,svgDivRef:me,containerRef:Se,activeSheetId:P,hasMultipleSheets:C,handleSelectSheet:M,svgString:ut,svgToScreenProjection:Ne,setSvgToScreenProjection:Le,setIsInteractionEnabled:j});Fcs({svgDivRef:me,circuitJson:e,circuitJsonKey:`${y}_${P??""}`,showGroups:Y&&!a}),Ocs({svgDivRef:me,circuitJson:e,circuitJsonKey:`${y}_${P??""}`,enabled:c});let vt=xc.useMemo(()=>D_.jsx("div",{ref:me,style:{pointerEvents:i?U?"auto":"none":"auto",transformOrigin:"0 0"},className:"schematic-component-clickable",dangerouslySetInnerHTML:{__html:ut}}),[ut,U,i]);return Vcs({svgDivRef:me,svgContent:vt,circuitJsonKey:y}),D_.jsxs(yls,{children:[c&&D_.jsx("style",{children:`.sch-net-faded { opacity: 0.35; }
            svg :is(g.trace, g.trace-overlays, g[data-schematic-component-id], [data-schematic-net-label-id]) { transition: opacity 0.12s ease-in-out; }`}),_&&D_.jsx("style",{children:`.schematic-search-match text,
            text.schematic-search-match {
              fill: #ff00d4 !important;
            }
            .schematic-search-match [stroke]:not(text):not([stroke="none"]),
            [stroke]:not(text):not([stroke="none"]).schematic-search-match {
              stroke: #ff00d4 !important;
            }
            .schematic-viewer-toolbar {
              flex-direction: row;
            }
            @media (max-width: 640px) {
              .schematic-viewer-toolbar {
                flex-direction: column;
              }
            }`}),D_.jsx("style",{children:".schematic-component-clickable [data-schematic-component-id]:hover { cursor: pointer !important; }"}),d&&D_.jsx("style",{children:"[data-schematic-port-id]:hover { cursor: pointer !important; }"}),D_.jsxs("div",{ref:Se,style:{position:"relative",backgroundColor:Ze,overflow:"hidden",cursor:i&&!U?"pointer":ee?"pointer":ie&&d?"pointer":"grab",minHeight:"300px",userSelect:"none",WebkitUserSelect:"none",WebkitTouchCallout:"none",...n},onMouseDownCapture:(Ye)=>{if(ct.onMouseDown(Ye),i&&!U){Ye.preventDefault(),Ye.stopPropagation();return}},onContextMenu:ct.onContextMenu,onTouchStart:(Ye)=>{Me(Ye),ct.onTouchStart(Ye)},onTouchMove:ct.onTouchMove,onTouchEnd:(Ye)=>{_e(Ye),ct.onTouchEnd()},onTouchCancel:ct.onTouchCancel,children:[!U&&i&&D_.jsx("div",{onClick:(Ye)=>{Ye.preventDefault(),Ye.stopPropagation(),j(!0)},style:{position:"absolute",inset:0,cursor:"pointer",zIndex:d6.clickToInteractOverlay,display:"flex",alignItems:"center",justifyContent:"center",pointerEvents:"all",touchAction:"pan-x pan-y pinch-zoom"},children:D_.jsx("div",{style:{backgroundColor:"rgba(0, 0, 0, 0.8)",color:"white",padding:"12px 24px",borderRadius:"8px",fontSize:"16px",fontFamily:"sans-serif",pointerEvents:"none"},children:typeof window<"u"&&(("ontouchstart"in window)||navigator.maxTouchPoints>0)?"Touch to Interact":"Click to Interact"})}),N&&D_.jsx(Qcs,{circuitJson:N,onClose:()=>D(null)}),nt&&D_.jsx(Xls,{isComponentMenu:!!Xgo(Ct,e),pcbComponent:gls(Ct,e),onViewPcbComponent:m,circuitJson:e,circuitJsonKey:y,netLocations:(()=>{let Ye=Dcs(Ct,e);return Ye?Ncs(e,Ye):[]})(),onSelectNetLocation:(Ye)=>{pt(!1),$e(Ye)},menuRef:rt,menuPos:dt,onOpenChange:pt,onRunStyleAnalysis:()=>{pt(!1),D(structuredClone(e))},showPorts:K,onTogglePorts:(Ye)=>{J(Ye),Rgo(wne.IS_SHOWING_SCHEMATIC_PORTS,Ye)},showGroups:Y,onToggleGroups:(Ye)=>{if(!a)X(Ye),Rgo(wne.IS_SHOWING_SCHEMATIC_GROUPS,Ye)},showWarnings:L,onToggleWarnings:H,showGrid:O,onToggleGrid:T}),D_.jsxs("div",{className:"schematic-viewer-toolbar",style:{position:"absolute",top:"16px",left:"16px",display:"flex",alignItems:"flex-start",gap:"8px",zIndex:d6.schematicSearch},children:[D_.jsx(Yls,{sheets:x,selectedSheetId:P,onSelectSheet:M}),_&&D_.jsx(kls,{query:Fe,onQueryChange:tt,onCancel:ft,results:Je,onSelect:$e,viewerContainerRef:Se}),V>0&&D_.jsx(Gls,{count:V,showWarnings:L,onToggle:()=>H((Ye)=>!Ye)})]}),Ee.map((Ye)=>D_.jsx(Els,{componentId:Ye,svgDivRef:me,containerRef:Se,showOutline:!0,circuitJsonKey:y,onHoverChange:te,onComponentClick:Yt},Ye)),vt,Bt&&xt&&D_.jsx(Sls,{platformConfig:t,sourceComponent:Bt.sourceComponent,warnings:Bt.warnings,footprinterString:Bt.footprinterString,footprintPreviewCircuitJson:Bt.footprintPreviewCircuitJson,footprintPreviewViewBox:Bt.footprintPreviewViewBox,...xt}),K&&Re.map(({portId:Ye,label:je})=>D_.jsx(wls,{portId:Ye,portLabel:je,svgDivRef:me,containerRef:Se,showOutline:!0,circuitJsonKey:y,onHoverChange:de,onPortClick:d?(st,St)=>{d?.({schematicPortId:st,event:St})}:void 0},Ye))]})]})};var $ls='system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',sQa={backgroundColor:"#ffffff",color:"#111111",borderRadius:8,boxShadow:"0 6px 24px rgba(0,0,0,0.12), 0 1px 3px rgba(0,0,0,0.08)",border:"1px solid #e5e7eb",padding:4,minWidth:220,maxWidth:360,maxHeight:320,overflowY:"auto",fontSize:13,fontFamily:$ls,outline:"none",zIndex:d6.viewMenu};var pAo=Object.freeze({left:0,top:0,width:16,height:16}),iTe=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),w_e=Object.freeze({...pAo,...iTe}),WAt=Object.freeze({...w_e,body:"",hidden:!1}),qls=Object.freeze({width:null,height:null}),mAo=Object.freeze({...qls,...iTe});function Jls(e,t=0){let n=e.replace(/^-?[0-9.]*/,"");function o(r){while(r<0)r+=4;return r%4}if(n===""){let r=parseInt(e);return isNaN(r)?0:o(r)}else if(n!==e){let r=0;switch(n){case"%":r=25;break;case"deg":r=90}if(r){let i=parseFloat(e.slice(0,e.length-n.length));if(isNaN(i))return 0;return i=i/r,i%1===0?o(i):0}}return t}var Zls=/[\s,]+/;function ehs(e,t){t.split(Zls).forEach((n)=>{switch(n.trim()){case"horizontal":e.hFlip=!0;break;case"vertical":e.vFlip=!0}})}var _Ao={...mAo,preserveAspectRatio:""};function Jgo(e){let t={..._Ao},n=(o,r)=>e.getAttribute(o)||r;return t.width=n("width",null),t.height=n("height",null),t.rotate=Jls(n("rotate","")),ehs(t,n("flip","")),t.preserveAspectRatio=n("preserveAspectRatio",n("preserveaspectratio","")),t}function ths(e,t){for(let n in _Ao)if(e[n]!==t[n])return!0;return!1}var gAo=/^[a-z0-9]+(-[a-z0-9]+)*$/,B_e=(e,t,n,o="")=>{let r=e.split(":");if(e.slice(0,1)==="@"){if(r.length<2||r.length>3)return null;o=r.shift().slice(1)}if(r.length>3||!r.length)return null;if(r.length>1){let a=r.pop(),c=r.pop(),l={provider:r.length>0?r[0]:o,prefix:c,name:a};return t&&!rTe(l)?null:l}let i=r[0],s=i.split("-");if(s.length>1){let a={provider:o,prefix:s.shift(),name:s.join("-")};return t&&!rTe(a)?null:a}if(n&&o===""){let a={provider:o,prefix:"",name:i};return t&&!rTe(a,n)?null:a}return null},rTe=(e,t)=>{if(!e)return!1;return!!((t&&e.prefix===""||!!e.prefix)&&!!e.name)};function nhs(e,t){let n=e.icons,o=e.aliases||Object.create(null),r=Object.create(null);function i(s){if(n[s])return r[s]=[];if(!(s in r)){r[s]=null;let a=o[s]&&o[s].parent,c=a&&i(a);if(c)r[s]=[a].concat(c)}return r[s]}return Object.keys(n).concat(Object.keys(o)).forEach(i),r}function ohs(e,t){let n={};if(!e.hFlip!==!t.hFlip)n.hFlip=!0;if(!e.vFlip!==!t.vFlip)n.vFlip=!0;let o=((e.rotate||0)+(t.rotate||0))%4;if(o)n.rotate=o;return n}function Zgo(e,t){let n=ohs(e,t);for(let o in WAt)if(o in iTe){if(o in e&&!(o in n))n[o]=iTe[o]}else if(o in t)n[o]=t[o];else if(o in e)n[o]=e[o];return n}function rhs(e,t,n){let o=e.icons,r=e.aliases||Object.create(null),i={};function s(a){i=Zgo(o[a]||r[a],i)}return s(t),n.forEach(s),Zgo(e,i)}function AAo(e,t){let n=[];if(typeof e!=="object"||typeof e.icons!=="object")return n;if(e.not_found instanceof Array)e.not_found.forEach((r)=>{t(r,null),n.push(r)});let o=nhs(e);for(let r in o){let i=o[r];if(i)t(r,rhs(e,r,i)),n.push(r)}return n}var ihs={provider:"",aliases:{},not_found:{},...pAo};function YAt(e,t){for(let n in t)if(n in e&&typeof e[n]!==typeof t[n])return!1;return!0}function fAo(e){if(typeof e!=="object"||e===null)return null;let t=e;if(typeof t.prefix!=="string"||!e.icons||typeof e.icons!=="object")return null;if(!YAt(e,ihs))return null;let n=t.icons;for(let r in n){let i=n[r];if(!r||typeof i.body!=="string"||!YAt(i,WAt))return null}let o=t.aliases||Object.create(null);for(let r in o){let i=o[r],s=i.parent;if(!r||typeof s!=="string"||!n[s]&&!o[s]||!YAt(i,WAt))return null}return t}var sTe=Object.create(null);function shs(e,t){return{provider:e,prefix:t,icons:Object.create(null),missing:new Set}}function IT(e,t){let n=sTe[e]||(sTe[e]=Object.create(null));return n[t]||(n[t]=shs(e,t))}function yAo(e,t){if(!fAo(t))return[];return AAo(t,(n,o)=>{if(o)e.icons[n]=o;else e.missing.add(n)})}function ahs(e,t,n){try{if(typeof n.body==="string")return e.icons[t]={...n},!0}catch(o){}return!1}function chs(e,t){let n=[];return(typeof e==="string"?[e]:Object.keys(sTe)).forEach((o)=>{(typeof o==="string"&&typeof t==="string"?[t]:Object.keys(sTe[o]||{})).forEach((r)=>{let i=IT(o,r);n=n.concat(Object.keys(i.icons).map((s)=>(o!==""?"@"+o+":":"")+r+":"+s))})}),n}var E_e=!1;function xAo(e){if(typeof e==="boolean")E_e=e;return E_e}function M_e(e){let t=typeof e==="string"?B_e(e,!0,E_e):e;if(t){let n=IT(t.provider,t.prefix),o=t.name;return n.icons[o]||(n.missing.has(o)?null:void 0)}}function CAo(e,t){let n=B_e(e,!0,E_e);if(!n)return!1;let o=IT(n.provider,n.prefix);if(t)return ahs(o,n.name,t);else return o.missing.add(n.name),!0}function eAo(e,t){if(typeof e!=="object")return!1;if(typeof t!=="string")t=e.provider||"";if(E_e&&!t&&!e.prefix){let r=!1;if(fAo(e))e.prefix="",AAo(e,(i,s)=>{if(CAo(i,s))r=!0});return r}let n=e.prefix;if(!rTe({prefix:n,name:"a"}))return!1;let o=IT(t,n);return!!yAo(o,e)}function lhs(e){return!!M_e(e)}function hhs(e){let t=M_e(e);return t?{...w_e,...t}:t}function bAo(e,t){e.forEach((n)=>{let o=n.loaderCallbacks;if(o)n.loaderCallbacks=o.filter((r)=>r.id!==t)})}function dhs(e){if(!e.pendingCallbacksFlag)e.pendingCallbacksFlag=!0,setTimeout(()=>{e.pendingCallbacksFlag=!1;let t=e.loaderCallbacks?e.loaderCallbacks.slice(0):[];if(!t.length)return;let n=!1,{provider:o,prefix:r}=e;t.forEach((i)=>{let s=i.icons,a=s.pending.length;if(s.pending=s.pending.filter((c)=>{if(c.prefix!==r)return!0;let l=c.name;if(e.icons[l])s.loaded.push({provider:o,prefix:r,name:l});else if(e.missing.has(l))s.missing.push({provider:o,prefix:r,name:l});else return n=!0,!0;return!1}),s.pending.length!==a){if(!n)bAo([e],i.id);i.callback(s.loaded.slice(0),s.missing.slice(0),s.pending.slice(0),i.abort)}})})}var uhs=0;function phs(e,t,n){let o=uhs++,r=bAo.bind(null,n,o);if(!t.pending.length)return r;let i={id:o,icons:t,callback:e,abort:r};return n.forEach((s)=>{(s.loaderCallbacks||(s.loaderCallbacks=[])).push(i)}),r}function mhs(e){let t={loaded:[],missing:[],pending:[]},n=Object.create(null);e.sort((r,i)=>{if(r.provider!==i.provider)return r.provider.localeCompare(i.provider);if(r.prefix!==i.prefix)return r.prefix.localeCompare(i.prefix);return r.name.localeCompare(i.name)});let o={provider:"",prefix:"",name:""};return e.forEach((r)=>{if(o.name===r.name&&o.prefix===r.prefix&&o.provider===r.provider)return;o=r;let{provider:i,prefix:s,name:a}=r,c=n[i]||(n[i]=Object.create(null)),l=c[s]||(c[s]=IT(i,s)),h;if(a in l.icons)h=t.loaded;else if(s===""||l.missing.has(a))h=t.missing;else h=t.pending;let d={provider:i,prefix:s,name:a};h.push(d)}),t}var XAt=Object.create(null);function tAo(e,t){XAt[e]=t}function jAt(e){return XAt[e]||XAt[""]}function _hs(e,t=!0,n=!1){let o=[];return e.forEach((r)=>{let i=typeof r==="string"?B_e(r,t,n):r;if(i)o.push(i)}),o}function JAt(e){let t;if(typeof e.resources==="string")t=[e.resources];else if(t=e.resources,!(t instanceof Array)||!t.length)return null;return{resources:t,path:e.path||"/",maxURL:e.maxURL||500,rotate:e.rotate||750,timeout:e.timeout||5000,random:e.random===!0,index:e.index||0,dataAfterTimeout:e.dataAfterTimeout!==!1}}var lTe=Object.create(null);lTe[""]=JAt({resources:["https://api.iconify.design"]});function nAo(e,t){let n=JAt(t);if(n===null)return!1;return lTe[e]=n,!0}function hTe(e){return lTe[e]}function ghs(){return Object.keys(lTe)}var Ahs={resources:[],index:0,timeout:2000,rotate:750,random:!1,dataAfterTimeout:!1};function fhs(e,t,n,o){let r=e.resources.length,i=e.random?Math.floor(Math.random()*r):e.index,s;if(e.random){let b=e.resources.slice(0);s=[];while(b.length>1){let I=Math.floor(Math.random()*b.length);s.push(b[I]),b=b.slice(0,I).concat(b.slice(I+1))}s=s.concat(b)}else s=e.resources.slice(i).concat(e.resources.slice(0,i));let a=Date.now(),c="pending",l=0,h,d=null,u=[],_=[];if(typeof o==="function")_.push(o);function p(){if(d)clearTimeout(d),d=null}function m(){if(c==="pending")c="aborted";p(),u.forEach((b)=>{if(b.status==="pending")b.status="aborted"}),u=[]}function A(b,I){if(I)_=[];if(typeof b==="function")_.push(b)}function g(){return{startTime:a,payload:t,status:c,queriesSent:l,queriesPending:u.length,subscribe:A,abort:m}}function f(){c="failed",_.forEach((b)=>{b(void 0,h)})}function y(){u.forEach((b)=>{if(b.status==="pending")b.status="aborted"}),u=[]}function x(b,I,v){let P=I!=="success";switch(u=u.filter((M)=>M!==b),c){case"pending":break;case"failed":if(P||!e.dataAfterTimeout)return;break;default:return}if(I==="abort"){h=v,f();return}if(P){if(h=v,!u.length)if(!s.length)f();else C();return}if(p(),y(),!e.random){let M=e.resources.indexOf(b.resource);if(M!==-1&&M!==e.index)e.index=M}c="completed",_.forEach((M)=>{M(v)})}function C(){if(c!=="pending")return;p();let b=s.shift();if(b===void 0){if(u.length){d=setTimeout(()=>{if(p(),c==="pending")y(),f()},e.timeout);return}f();return}let I={status:"pending",resource:b,callback:(v,P)=>{x(I,v,P)}};u.push(I),l++,d=setTimeout(C,e.rotate),n(b,t,I.callback)}return setTimeout(C),g}function IAo(e){let t={...Ahs,...e},n=[];function o(){n=n.filter((s)=>s().status==="pending")}function r(s,a,c){let l=fhs(t,s,a,(h,d)=>{if(o(),c)c(h,d)});return n.push(l),l}function i(s){return n.find((a)=>s(a))||null}return{query:r,find:i,setIndex:(s)=>{t.index=s},getIndex:()=>t.index,cleanup:o}}function oAo(){}var GAt=Object.create(null);function yhs(e){if(!GAt[e]){let t=hTe(e);if(!t)return;let n={config:t,redundancy:IAo(t)};GAt[e]=n}return GAt[e]}function vAo(e,t,n){let o,r;if(typeof e==="string"){let i=jAt(e);if(!i)return n(void 0,424),oAo;r=i.send;let s=yhs(e);if(s)o=s.redundancy}else{let i=JAt(e);if(i){o=IAo(i);let s=e.resources?e.resources[0]:"",a=jAt(s);if(a)r=a.send}}if(!o||!r)return n(void 0,424),oAo;return o.query(t,r,n)().abort}function rAo(){}function xhs(e){if(!e.iconsLoaderFlag)e.iconsLoaderFlag=!0,setTimeout(()=>{e.iconsLoaderFlag=!1,dhs(e)})}function Chs(e){let t=[],n=[];return e.forEach((o)=>{(o.match(gAo)?t:n).push(o)}),{valid:t,invalid:n}}function S_e(e,t,n){function o(){let r=e.pendingIcons;t.forEach((i)=>{if(r)r.delete(i);if(!e.icons[i])e.missing.add(i)})}if(n&&typeof n==="object")try{if(!yAo(e,n).length){o();return}}catch(r){console.error(r)}o(),xhs(e)}function iAo(e,t){if(e instanceof Promise)e.then((n)=>{t(n)}).catch(()=>{t(null)});else t(e)}function bhs(e,t){if(!e.iconsToLoad)e.iconsToLoad=t;else e.iconsToLoad=e.iconsToLoad.concat(t).sort();if(!e.iconsQueueFlag)e.iconsQueueFlag=!0,setTimeout(()=>{e.iconsQueueFlag=!1;let{provider:n,prefix:o}=e,r=e.iconsToLoad;if(delete e.iconsToLoad,!r||!r.length)return;let i=e.loadIcon;if(e.loadIcons&&(r.length>1||!i)){iAo(e.loadIcons(r,o,n),(l)=>{S_e(e,r,l)});return}if(i){r.forEach((l)=>{iAo(i(l,o,n),(h)=>{S_e(e,[l],h?{prefix:o,icons:{[l]:h}}:null)})});return}let{valid:s,invalid:a}=Chs(r);if(a.length)S_e(e,a,null);if(!s.length)return;let c=o.match(gAo)?jAt(n):null;if(!c){S_e(e,s,null);return}c.prepare(n,o,s).forEach((l)=>{vAo(n,l,(h)=>{S_e(e,l.icons,h)})})})}var ZAt=(e,t)=>{let n=_hs(e,!0,xAo()),o=mhs(n);if(!o.pending.length){let c=!0;if(t)setTimeout(()=>{if(c)t(o.loaded,o.missing,o.pending,rAo)});return()=>{c=!1}}let r=Object.create(null),i=[],s,a;return o.pending.forEach((c)=>{let{provider:l,prefix:h}=c;if(h===a&&l===s)return;s=l,a=h,i.push(IT(l,h));let d=r[l]||(r[l]=Object.create(null));if(!d[h])d[h]=[]}),o.pending.forEach((c)=>{let{provider:l,prefix:h,name:d}=c,u=IT(l,h),_=u.pendingIcons||(u.pendingIcons=new Set);if(!_.has(d))_.add(d),r[l][h].push(d)}),i.forEach((c)=>{let l=r[c.provider][c.prefix];if(l.length)bhs(c,l)}),t?phs(t,o,i):rAo},Ihs=(e)=>new Promise((t,n)=>{let o=typeof e==="string"?B_e(e,!0):e;if(!o){n(e);return}ZAt([o||e],(r)=>{if(r.length&&o){let i=M_e(o);if(i){t({...w_e,...i});return}}n(e)})});function sAo(e){try{let t=typeof e==="string"?JSON.parse(e):e;if(typeof t.body==="string")return{...t}}catch(t){}}function vhs(e,t){if(typeof e==="object")return{data:sAo(e),value:e};if(typeof e!=="string")return{value:e};if(e.includes("{")){let i=sAo(e);if(i)return{data:i,value:e}}let n=B_e(e,!0,!0);if(!n)return{value:e};let o=M_e(n);if(o!==void 0||!n.prefix)return{value:e,name:n,data:o};let r=ZAt([n],()=>t(e,n,M_e(n)));return{value:e,name:n,loading:r}}var SAo=!1;try{SAo=navigator.vendor.indexOf("Apple")===0}catch(e){}function Shs(e,t){switch(t){case"svg":case"bg":case"mask":return t}if(t!=="style"&&(SAo||e.indexOf("<a")===-1))return"svg";return e.indexOf("currentColor")===-1?"bg":"mask"}var Phs=/(-?[0-9.]*[0-9]+[0-9.]*)/g,Ehs=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function KAt(e,t,n){if(t===1)return e;if(n=n||100,typeof e==="number")return Math.ceil(e*t*n)/n;if(typeof e!=="string")return e;let o=e.split(Phs);if(o===null||!o.length)return e;let r=[],i=o.shift(),s=Ehs.test(i);while(!0){if(s){let a=parseFloat(i);if(isNaN(a))r.push(i);else r.push(Math.ceil(a*t*n)/n)}else r.push(i);if(i=o.shift(),i===void 0)return r.join("");s=!s}}function Mhs(e,t="defs"){let n="",o=e.indexOf("<"+t);while(o>=0){let r=e.indexOf(">",o),i=e.indexOf("</"+t);if(r===-1||i===-1)break;let s=e.indexOf(">",i);if(s===-1)break;n+=e.slice(r+1,i).trim(),e=e.slice(0,o).trim()+e.slice(s+1)}return{defs:n,content:e}}function whs(e,t){return e?"<defs>"+e+"</defs>"+t:t}function Bhs(e,t,n){let o=Mhs(e);return whs(o.defs,t+o.content+n)}var Ths=(e)=>e==="unset"||e==="undefined"||e==="none";function PAo(e,t){let n={...w_e,...e},o={...mAo,...t},r={left:n.left,top:n.top,width:n.width,height:n.height},i=n.body;[n,o].forEach((m)=>{let A=[],{hFlip:g,vFlip:f,rotate:y}=m;if(g)if(f)y+=2;else A.push("translate("+(r.width+r.left).toString()+" "+(0-r.top).toString()+")"),A.push("scale(-1 1)"),r.top=r.left=0;else if(f)A.push("translate("+(0-r.left).toString()+" "+(r.height+r.top).toString()+")"),A.push("scale(1 -1)"),r.top=r.left=0;let x;if(y<0)y-=Math.floor(y/4)*4;switch(y=y%4,y){case 1:x=r.height/2+r.top,A.unshift("rotate(90 "+x.toString()+" "+x.toString()+")");break;case 2:A.unshift("rotate(180 "+(r.width/2+r.left).toString()+" "+(r.height/2+r.top).toString()+")");break;case 3:x=r.width/2+r.left,A.unshift("rotate(-90 "+x.toString()+" "+x.toString()+")")}if(y%2===1){if(r.left!==r.top)x=r.left,r.left=r.top,r.top=x;if(r.width!==r.height)x=r.width,r.width=r.height,r.height=x}if(A.length)i=Bhs(i,'<g transform="'+A.join(" ")+'">',"</g>")});let{width:s,height:a}=o,{width:c,height:l}=r,h,d;if(s===null)d=a===null?"1em":a==="auto"?l:a,h=KAt(d,c/l);else h=s==="auto"?c:s,d=a===null?KAt(h,l/c):a==="auto"?l:a;let u={},_=(m,A)=>{if(!Ths(A))u[m]=A.toString()};_("width",h),_("height",d);let p=[r.left,r.top,c,l];return u.viewBox=p.join(" "),{attributes:u,viewBox:p,body:i}}function eft(e,t){let n=e.indexOf("xlink:")===-1?"":' xmlns:xlink="http://www.w3.org/1999/xlink"';for(let o in t)n+=" "+o+'="'+t[o]+'"';return'<svg xmlns="http://www.w3.org/2000/svg"'+n+">"+e+"</svg>"}function Dhs(e){return e.replace(/"/g,"'").replace(/%/g,"%25").replace(/#/g,"%23").replace(/</g,"%3C").replace(/>/g,"%3E").replace(/\s+/g," ").replace(/:/g,"%3A").replace(/\//g,"%2F")}function Nhs(e){return"data:image/svg+xml,"+Dhs(e)}function EAo(e){return'url("'+Nhs(e)+'")'}var Rhs=()=>{let e;try{if(e=fetch,typeof e==="function")return e}catch(t){}},aTe=Rhs();function Qhs(e){aTe=e}function khs(){return aTe}function Lhs(e,t){let n=hTe(e);if(!n)return 0;let o;if(!n.maxURL)o=0;else{let r=0;n.resources.forEach((s)=>{r=Math.max(r,s.length)});let i=t+".json?icons=";o=n.maxURL-r-n.path.length-i.length}return o}function Hhs(e){return e===404}var Fhs=(e,t,n)=>{let o=[],r=Lhs(e,t),i="icons",s={type:"icons",provider:e,prefix:t,icons:[]},a=0;return n.forEach((c,l)=>{if(a+=c.length+1,a>=r&&l>0)o.push(s),s={type:"icons",provider:e,prefix:t,icons:[]},a=c.length;s.icons.push(c)}),o.push(s),o};function zhs(e){if(typeof e==="string"){let t=hTe(e);if(t)return t.path}return"/"}var Ohs=(e,t,n)=>{if(!aTe){n("abort",424);return}let o=zhs(t.provider);switch(t.type){case"icons":{let i=t.prefix,s=t.icons.join(","),a=new URLSearchParams({icons:s});o+=i+".json?"+a.toString();break}case"custom":{let i=t.uri;o+=i.slice(0,1)==="/"?i.slice(1):i;break}default:n("abort",400);return}let r=503;aTe(e+o).then((i)=>{let s=i.status;if(s!==200){setTimeout(()=>{n(Hhs(s)?"abort":"next",s)});return}return r=501,i.json()}).then((i)=>{if(typeof i!=="object"||i===null){setTimeout(()=>{if(i===404)n("abort",i);else n("next",r)});return}setTimeout(()=>{n("success",i)})}).catch(()=>{n("next",r)})},Vhs={prepare:Fhs,send:Ohs};function Yhs(e,t,n){IT(n||"",t).loadIcons=e}function Ghs(e,t,n){IT(n||"",t).loadIcon=e}var UAt="data-style",MAo="",Rne={};function cTe(e){return":host{display:inline-block;vertical-align:"+(e?"-0.125em":"0")+"}span,svg{display:block;margin:auto}"+MAo}function Uhs(e){return"adoptedStyleSheets"in e&&typeof CSSStyleSheet==="function"&&typeof CSSStyleSheet.prototype.replaceSync==="function"}function Whs(e){let t=e?"inline":"block",n=Rne[t];if(!n)n=Rne[t]=new CSSStyleSheet,n.replaceSync(cTe(e));return n}function Xhs(e){MAo=e,Rne.inline?.replaceSync(cTe(!0)),Rne.block?.replaceSync(cTe(!1))}function aAo(e,t){if(Uhs(e)){let o=Whs(t),r=e.adoptedStyleSheets;if(r.includes(o))return;e.adoptedStyleSheets=r.filter((i)=>i!==Rne.inline&&i!==Rne.block).concat(o);return}let n=Array.from(e.childNodes).find((o)=>o.hasAttribute&&o.hasAttribute(UAt));if(!n)n=document.createElement("style"),n.setAttribute(UAt,UAt),e.appendChild(n);n.textContent=cTe(t)}function wAo(){tAo("",Vhs),xAo(!0);let e;try{e=window}catch(n){}if(e){if(e.IconifyPreload!==void 0){let n=e.IconifyPreload,o="Invalid IconifyPreload syntax.";if(typeof n==="object"&&n!==null)(n instanceof Array?n:[n]).forEach((r)=>{try{if(typeof r!=="object"||r===null||r instanceof Array||typeof r.icons!=="object"||typeof r.prefix!=="string"||!eAo(r))console.error("Invalid IconifyPreload syntax.")}catch(i){console.error("Invalid IconifyPreload syntax.")}})}if(e.IconifyProviders!==void 0){let n=e.IconifyProviders;if(typeof n==="object"&&n!==null)for(let o in n){let r="IconifyProviders["+o+"] is invalid.";try{let i=n[o];if(typeof i!=="object"||!i||i.resources===void 0)continue;if(!nAo(o,i))console.error(r)}catch(i){console.error(r)}}}}return{iconLoaded:lhs,getIcon:hhs,listIcons:chs,addIcon:CAo,addCollection:eAo,calculateSize:KAt,buildIcon:PAo,iconToHTML:eft,svgToURL:EAo,loadIcons:ZAt,loadIcon:Ihs,addAPIProvider:nAo,setCustomIconLoader:Ghs,setCustomIconsLoader:Yhs,appendCustomStyle:Xhs,_api:{getAPIConfig:hTe,setAPIModule:tAo,sendAPIQuery:vAo,setFetch:Qhs,getFetch:khs,listAPIProviders:ghs}}}var $At={"background-color":"currentColor"},BAo={"background-color":"transparent"},cAo={image:"var(--svg)",repeat:"no-repeat",size:"100% 100%"},lAo={"-webkit-mask":$At,mask:$At,background:BAo};for(let e in lAo){let t=lAo[e];for(let n in cAo)t[e+"-"+n]=cAo[n]}function hAo(e){return e?e+(e.match(/^[-0-9.]+$/)?"px":""):"inherit"}function jhs(e,t,n){let o=document.createElement("span"),r=e.body;if(r.indexOf("<a")!==-1)r+="<!-- "+Date.now()+" -->";let i=e.attributes,s=eft(r,{...i,width:t.width+"",height:t.height+""}),a=EAo(s),c=o.style,l={"--svg":a,width:hAo(i.width),height:hAo(i.height),...n?$At:BAo};for(let h in l)c.setProperty(h,l[h]);return o}var P_e;function Khs(){try{P_e=window.trustedTypes.createPolicy("iconify",{createHTML:(e)=>e})}catch(e){P_e=null}}function $hs(e){if(P_e===void 0)Khs();return P_e?P_e.createHTML(e):e}function qhs(e){let t=document.createElement("span"),n=e.attributes,o="";if(!n.width)o="width: inherit;";if(!n.height)o+="height: inherit;";if(o)n.style=o;let r=eft(e.body,n);return t.innerHTML=$hs(r),t.firstChild}function qAt(e){return Array.from(e.childNodes).find((t)=>{let n=t.tagName&&t.tagName.toUpperCase();return n==="SPAN"||n==="SVG"})}function dAo(e,t){let n=t.icon.data,o=t.customisations,r=PAo(n,o);if(o.preserveAspectRatio)r.attributes.preserveAspectRatio=o.preserveAspectRatio;let i=t.renderedMode,s;switch(i){case"svg":s=qhs(r);break;default:s=jhs(r,{...w_e,...n},i==="mask")}let a=qAt(e);if(a)if(s.tagName==="SPAN"&&a.tagName===s.tagName)a.setAttribute("style",s.getAttribute("style"));else e.replaceChild(s,a);else e.appendChild(s)}function uAo(e,t,n){let o=n&&(n.rendered?n:n.lastRender);return{rendered:!1,inline:t,icon:e,lastRender:o}}function Jhs(e="iconify-icon"){let t,n;try{t=window.customElements,n=window.HTMLElement}catch(a){return}if(!t||!n)return;let o=t.get(e);if(o)return o;let r=["icon","mode","inline","noobserver","width","height","rotate","flip"],i=class extends n{_shadowRoot;_initialised=!1;_state;_checkQueued=!1;_connected=!1;_observer=null;_visible=!0;constructor(){super();let a=this._shadowRoot=this.attachShadow({mode:"open"}),c=this.hasAttribute("inline");aAo(a,c),this._state=uAo({value:""},c),this._queueCheck()}connectedCallback(){this._connected=!0,this.startObserver()}disconnectedCallback(){this._connected=!1,this.stopObserver()}static get observedAttributes(){return r.slice(0)}attributeChangedCallback(a){switch(a){case"inline":{let c=this.hasAttribute("inline"),l=this._state;if(c!==l.inline)l.inline=c,aAo(this._shadowRoot,c);break}case"noobserver":{if(this.hasAttribute("noobserver"))this.startObserver();else this.stopObserver();break}default:this._queueCheck()}}get icon(){let a=this.getAttribute("icon");if(a&&a.slice(0,1)==="{")try{return JSON.parse(a)}catch(c){}return a}set icon(a){if(typeof a==="object")a=JSON.stringify(a);this.setAttribute("icon",a)}get inline(){return this.hasAttribute("inline")}set inline(a){if(a)this.setAttribute("inline","true");else this.removeAttribute("inline")}get observer(){return this.hasAttribute("observer")}set observer(a){if(a)this.setAttribute("observer","true");else this.removeAttribute("observer")}restartAnimation(){let a=this._state;if(a.rendered){let c=this._shadowRoot;if(a.renderedMode==="svg")try{c.lastChild.setCurrentTime(0);return}catch(l){}dAo(c,a)}}get status(){let a=this._state;return a.rendered?"rendered":a.icon.data===null?"failed":"loading"}_queueCheck(){if(!this._checkQueued)this._checkQueued=!0,setTimeout(()=>{this._check()})}_check(){if(!this._checkQueued)return;this._checkQueued=!1;let a=this._state,c=this.getAttribute("icon");if(c!==a.icon.value){this._iconChanged(c);return}if(!a.rendered||!this._visible)return;let l=this.getAttribute("mode"),h=Jgo(this);if(a.attrMode!==l||ths(a.customisations,h)||!qAt(this._shadowRoot))this._renderIcon(a.icon,h,l)}_iconChanged(a){let c=vhs(a,(l,h,d)=>{let u=this._state;if(u.rendered||this.getAttribute("icon")!==l)return;let _={value:l,name:h,data:d};if(_.data)this._gotIconData(_);else u.icon=_});if(c.data)this._gotIconData(c);else this._state=uAo(c,this._state.inline,this._state)}_forceRender(){if(!this._visible){let a=qAt(this._shadowRoot);if(a)this._shadowRoot.removeChild(a);return}this._queueCheck()}_gotIconData(a){this._checkQueued=!1,this._renderIcon(a,Jgo(this),this.getAttribute("mode"))}_renderIcon(a,c,l){let h=Shs(a.data.body,l),d=this._state.inline;dAo(this._shadowRoot,this._state={rendered:!0,icon:a,inline:d,customisations:c,attrMode:l,renderedMode:h})}startObserver(){if(!this._observer&&!this.hasAttribute("noobserver"))try{this._observer=new IntersectionObserver((a)=>{let c=a.some((l)=>l.isIntersecting);if(c!==this._visible)this._visible=c,this._forceRender()}),this._observer.observe(this)}catch(a){if(this._observer){try{this._observer.disconnect()}catch(c){}this._observer=null}}}stopObserver(){if(this._observer){if(this._observer.disconnect(),this._observer=null,this._visible=!0,this._connected)this._forceRender()}}};r.forEach((a)=>{if(!(a in i.prototype))Object.defineProperty(i.prototype,a,{get:function(){return this.getAttribute(a)},set:function(c){if(c!==null)this.setAttribute(a,c);else this.removeAttribute(a)}})});let s=wAo();for(let a in s)i[a]=i.prototype[a]=s[a];return t.define(e,i),i}var Zhs=Jhs()||wAo(),{iconLoaded:cQa,getIcon:lQa,listIcons:hQa,addIcon:dQa,addCollection:TAo,calculateSize:uQa,buildIcon:pQa,iconToHTML:mQa,svgToURL:_Qa,loadIcons:gQa,loadIcon:AQa,setCustomIconLoader:fQa,setCustomIconsLoader:yQa,addAPIProvider:xQa,_api:CQa}=Zhs;var DAo={prefix:"pixelarticons",icons:{"4g":{body:'<path fill="currentColor" d="M5 7H3v6h5v4h2V7H8v4H5zm16 0h-9v10h9v-6h-4v2h2v2h-5V9h7z"/>',hidden:!0},"4k":{body:'<path fill="currentColor" d="M3 7h2v4h4V7h2v10H9v-4H3zm10 0h2v4h2v2h-2v4h-2zm6 8h-2v-2h2zm0 0h2v2h-2zm0-6h-2v2h2zm0 0V7h2v2z"/>',hidden:!0},"4k-box":{body:'<path fill="currentColor" d="M3 4H1v16h22V4zm18 2v12H3V6zM7 8H5v5h4v3h2V8H9v3H7zm8 0h-2v8h2v-3h2v3h2v-3h-2v-2h2V8h-2v3h-2z"/>',hidden:!0},"5g":{body:'<path fill="currentColor" d="M10 7H3v6h5v2H3v2h7v-6H5V9h5zm11 0h-9v10h9v-6h-4v2h2v2h-5V9h7z"/>',hidden:!0},"a-arrow-down":{body:'<g fill="currentColor"><path d="M16 6h2v12h-2zm2 8h2v2h-2zm-4 0h2v2h-2zm4-2h4v2h-4zm-6 0h4v2h-4zM2 8h2v10H2zm6 0h2v10H8z"/><path d="M4 12h6v2H4zm0-6h4v2H4z"/></g>'},"a-arrow-down-sharp":{body:'<g fill="currentColor"><path d="M16 6h2v12h-2zm2 8h2v2h-2zm-4 0h2v2h-2zm4-2h4v2h-4zm-6 0h4v2h-4zM2 8h2v10H2zm6 0h2v10H8z"/><path d="M4 12h6v2H4zM2 6h8v2H2z"/></g>'},"a-arrow-up":{body:'<g fill="currentColor"><path d="M16 18h2V6h-2zm2-8h2V8h-2zm-4 0h2V8h-2zm4 2h4v-2h-4zm-6 0h4v-2h-4zM2 8h2v10H2zm6 0h2v10H8z"/><path d="M4 12h6v2H4zm0-6h4v2H4z"/></g>'},"a-arrow-up-sharp":{body:'<g fill="currentColor"><path d="M16 18h2V6h-2zm2-8h2V8h-2zm-4 0h2V8h-2zm4 2h4v-2h-4zm-6 0h4v-2h-4zM2 8h2v10H2zm6 0h2v10H8z"/><path d="M4 12h6v2H4zM2 6h8v2H2z"/></g>'},"ab-testing":{body:'<path fill="currentColor" d="M3 3h6v2H5v2h4v2H5v2h4v2H3zm6 8h2V9H9zm0-4h2V5H9zm4 4h8v10h-2v-4h-4v4h-2zm2 4h4v-2h-4zm0-12h6v6h-2V5h-4zM3 15h2v4h4v2H3z"/>',hidden:!0},ac:{body:'<path fill="currentColor" d="M13 2h-2v4H9V4H7v2h2v2h2v3H8V9H6V7H4v2h2v2H2v2h4v2H4v2h2v-2h2v-2h3v3H9v2H7v2h2v-2h2v4h2v-4h2v2h2v-2h-2v-2h-2v-3h3v2h2v2h2v-2h-2v-2h4v-2h-4V9h2V7h-2v2h-2v2h-3V8h2V6h2V4h-2v2h-2z"/>',hidden:!0},"add-box":{body:'<path fill="currentColor" d="M3 3h18v18H3zm16 16V5H5v14zm-6-8h4v2h-4v4h-2v-4H7v-2h4V7h2z"/>',hidden:!0},"add-box-multiple":{body:'<path fill="currentColor" d="M3 3h14v14H3zm12 12V5H5v10zm-8 6v-2h12V7h2v14zm4-12h2v2h-2v2H9v-2H7V9h2V7h2z"/>',hidden:!0},"add-col":{body:'<path fill="currentColor" d="M2 2h10v20H2v-2h8v-4H2v-2h8v-4H2V8h8V4H2zm17 9h3v2h-3v3h-2v-3h-3v-2h3V8h2z"/>',hidden:!0},"add-grid":{body:'<path fill="currentColor" d="M3 3h8v8H3zm6 6V5H5v4zm9 4h-2v3h-3v2h3v3h2v-3h3v-2h-3zM15 3h6v8h-8V3zm4 6V5h-4v4zM5 13h6v8H3v-8zm4 6v-4H5v4z"/>',hidden:!0},"add-row":{body:'<path fill="currentColor" d="M4 10V2H2v10h20V2h-2v8h-4V2h-2v8h-4V2H8v8zm9 9v3h-2v-3H8v-2h3v-3h2v3h3v2z"/>',hidden:!0},"ai-app-mac":{body:'<path fill="currentColor" d="M4 3h16v2H4zm0 16h6v2H4zM2 5h2v14H2zm18 0h2v8h-2zM6 7h2v2H6zm4 0h2v2h-2zm4 0h2v2h-2zm2 6h2v2h-2zm0 8h2v2h-2zm-4-4h2v2h-2zm8 0h2v2h-2zm-6-2h2v2h-2zm4 0h2v2h-2zm0 4h2v2h-2zm-4 0h2v2h-2z"/>'},"ai-app-mac-sharp":{body:'<path fill="currentColor" d="M2 3h20v2H2zm0 16h8v2H2zM2 5h2v14H2zm18 0h2v8h-2zM6 7h2v2H6zm4 0h2v2h-2zm4 0h2v2h-2zm2 6h2v2h-2zm0 8h2v2h-2zm-4-4h2v2h-2zm8 0h2v2h-2zm-6-2h2v2h-2zm4 0h2v2h-2zm0 4h2v2h-2zm-4 0h2v2h-2z"/>'},"ai-file":{body:'<g fill="currentColor"><path d="M6 4H4v8h2zm10-2H6v2h10zm4 4h-2v14h2zm-2 14h-4v2h4zM16 4h2v2h-2zm-4 0h2v6h-2z"/><path d="M12 8h6v2h-6zM2 16h2v6H2zm4 0h2v6H6zm4-2h2v8h-2zm-6 0h2v2H4zm0 4h2v2H4z"/></g>'},"ai-file-sharp":{body:'<g fill="currentColor"><path d="M6 4H4v8h2zm10-2H4v2h12zm4 4h-2v14h2zm0 14h-6v2h6zM16 4h2v2h-2zm-4 0h2v6h-2z"/><path d="M12 8h6v2h-6zM2 16h2v6H2zm4 0h2v6H6zm4-2h2v8h-2zm-8 0h6v2H2zm2 4h2v2H4z"/></g>'},"ai-scan":{body:'<path fill="currentColor" d="M9 11h2v2H9zm4 0h2v2h-2zM7 7h10v2H7zM5 9h2v6H5zm2 6h10v2H7zm10-6h2v6h-2zm-6-4h2v2h-2zM4 2h4v2H4zm0 18h4v2H4zM16 2h4v2h-4zm0 18h4v2h-4zM2 4h2v4H2zm0 12h2v4H2zM20 4h2v4h-2zm0 12h2v4h-2z"/>'},"ai-scan-sharp":{body:'<path fill="currentColor" d="M9 11h2v2H9zm4 0h2v2h-2zM5 7h14v2H5zm0 2h2v6H5zm0 6h14v2H5zm12-6h2v6h-2zm-6-4h2v2h-2zM2 2h6v2H2zm0 18h6v2H2zM16 2h6v2h-6zm0 18h6v2h-6zM2 4h2v4H2zm0 12h2v4H2zM20 4h2v4h-2zm0 12h2v4h-2z"/>'},"ai-settings-2":{body:'<g fill="currentColor"><path d="M18 2h2v2h-2zM4 2h2v2H4zm0 20h2v-2H4zM20 4h2v2h-2zM6 4h4v2H6zm0 16h4v-2H6zM18 6h2v4h-2zM4 6h2v4H4zm0 12h2v-4H4zM14 4h4v2h-4zM2 4h2v2H2zm0 16h2v-2H2z"/><path d="M8 2h2v4H8zm0 20h2v-4H8z"/><path d="M8 2h8v2H8zm0 20h4v-2H8zM2 8h2v8H2zm18 0h2v4h-2zM10 8h4v2h-4zm-2 2h2v4H8zm2 4h4v2h-4zm4-4h2v4h-2zm4 4h2v2h-2zm0 8h2v2h-2zm-4-4h2v2h-2zm8 0h2v2h-2zm-6-2h2v2h-2zm4 0h2v2h-2zm0 4h2v2h-2zm-4 0h2v2h-2z"/></g>'},"ai-settings-3":{body:'<g fill="currentColor"><path d="M4 2h2v2H4zm0 20h2v-2H4zM6 4h4v2H6zm0 16h4v-2H6zM4 6h2v4H4zm0 12h2v-4H4zM2 4h2v2H2zm0 16h2v-2H2z"/><path d="M8 2h2v4H8zm0 20h2v-4H8zM2 8h2v8H2zm8 0h3v2h-3zm4 3h4v2h-4zm2-8h2v2h-2zm-2 2h2v2h-2zm2 14h2v2h-2zm-2-2h2v2h-2zM10 2h3v2h-3zm0 18h3v2h-3zM8 10h2v4H8zm2 4h3v2h-3zm8-5h2v2h-2zm0-8h2v2h-2zm0 16h2v2h-2zm2-6h2v2h-2zm0-8h2v2h-2zm0 16h2v2h-2zm-2-6h2v2h-2zm0-8h2v2h-2zm0 16h2v2h-2z"/></g>'},"ai-user-circle":{body:'<path fill="currentColor" d="M6 2h8v2H6zm0 18h12v2H6zM4 4h2v2H4zM2 6h2v12H2zm20 4h-2v8h2zM4 18h2v2H4zm16 0h-2v2h2zM10 6h4v2h-4zM8 8h2v4H8zm2 4h4v2h-4zm4-4h2v4h-2zm-8 8h12v2H6zM18 2h2v2h-2zm-2 2h2v2h-2zm2 2h2v2h-2zm2-2h2v2h-2z"/>'},"ai-view":{body:'<path fill="currentColor" d="M2 15h2v2H2zm0 4h2v-2H2zm20-4h-2v2h2zm0 4h-2v-2h2zM4 13h4v2H4zm0 8h4v-2H4zm16-8h-4v2h4zm0 8h-4v-2h4zM8 11h8v2H8zm0 12h8v-2H8zm2-8h4v4h-4zm1-6V5h2v4zM3 7V5h2v2zm2 2V7h2v2zm14-2V5h2v2zm-2 2V7h2v2zM9 5V3h2v2zM1 5V3h2v2zm16 0V3h2v2zm-6-2V1h2v2zM3 3V1h2v2zm16 0V1h2v2zm-6 2V3h2v2zM5 5V3h2v2zm16 0V3h2v2z"/>'},"ai-voice":{body:'<path fill="currentColor" d="M4 3h16v2H4zm0 12h6v2H4zM2 5h2v10H2zm18 0h2v8h-2zM5 9h2v2H5zm3-2h2v6H8zm6 0h2v4h-2zm-3 2h2v3h-2zm5 4h2v2h-2zm0 8h2v2h-2zm-4-4h2v2h-2zm8 0h2v2h-2zm-6-2h2v2h-2zm4 0h2v2h-2zm0 4h2v2h-2zm-4 0h2v2h-2z"/>'},"ai-voice-sharp":{body:'<path fill="currentColor" d="M2 3h20v2H2zm0 12h8v2H2zM2 5h2v10H2zm18 0h2v8h-2zM5 9h2v2H5zm3-2h2v6H8zm6 0h2v4h-2zm-3 2h2v3h-2zm5 4h2v2h-2zm0 8h2v2h-2zm-4-4h2v2h-2zm8 0h2v2h-2zm-6-2h2v2h-2zm4 0h2v2h-2zm0 4h2v2h-2zm-4 0h2v2h-2z"/>'},airplay:{body:'<path fill="currentColor" d="M4 3h16v2H4zM2 5h2v12H2zm18 0h2v12h-2zM4 17h2v2H4zm14 0h2v2h-2zm-7-2h2v2h-2zm-2 2h4v2H9zm4 0h2v2h-2zm2 2h2v2h-2zm-8 0h8v2H7z"/>'},"airplay-sharp":{body:'<path fill="currentColor" d="M2 3h20v2H2zm0 2h2v12H2zm18 0h2v12h-2zM2 17h4v2H2zm16 0h4v2h-4zm-7-2h2v2h-2zm-2 2h4v2H9zm4 0h2v2h-2zm2 2h2v2h-2zm-8 0h8v2H7z"/>'},"alarm-clock":{body:'<path fill="currentColor" d="M8 5h8v2H8zm0 14h8v2H8zM6 7h2v2H6zm0 10h2v2H6zM16 7h2v2h-2zm0 10h2v2h-2zM4 9h2v8H4zm14 0h2v8h-2zM4 2h2v2H4zm0 17h2v2H4zm14 0h2v2h-2zm0-17h2v2h-2zM2 4h2v2H2zm18 0h2v2h-2zm-9 5h2v4h-2zm2 4h2v2h-2z"/>'},album:{body:'<g fill="currentColor"><path d="M4 2h16v2H4zm0 18h16v2H4zM2 4h2v16H2zm18 0h2v16h-2zm-4 0h2v8h-2zm-4 0h2v8h-2z"/><path d="M14 3h2v7h-2z"/></g>'},"album-sharp":{body:'<g fill="currentColor"><path d="M2 2h20v2H2zm0 18h20v2H2zM2 4h2v16H2zm18 0h2v16h-2zm-4 0h2v8h-2zm-4 0h2v8h-2z"/><path d="M14 3h2v7h-2z"/></g>'},alert:{body:'<path fill="currentColor" d="M13 1h-2v2H9v2H7v2H5v2H3v2H1v2h2v2h2v2h2v2h2v2h2v2h2v-2h2v-2h2v-2h2v-2h2v-2h2v-2h-2V9h-2V7h-2V5h-2V3h-2zm0 2v2h2v2h2v2h2v2h2v2h-2v2h-2v2h-2v2h-2v2h-2v-2H9v-2H7v-2H5v-2H3v-2h2V9h2V7h2V5h2V3zm0 4h-2v6h2zm0 8h-2v2h2z"/>',hidden:!0},algorithm:{body:'<g fill="currentColor"><path d="M11 16h4v2h-4zm-8 0h4v2H3zm16 0h4v2h-4zM9 16h2v6H9zm-8 0h2v6H1zm16 0h2v6h-2z"/><path d="M9 20h6v2H9zm-8 0h6v2H1zm16 0h6v2h-6z"/><path d="M13 16h2v6h-2zm-8 0h2v6H5zm16 0h2v6h-2zM8 8h8v2H8z"/><path d="M8 2h2v8H8z"/><path d="M8 2h8v2H8z"/><path d="M14 2h2v8h-2zM3 14h2v3H3zm2-2h14v2H5zm14 2h2v3h-2z"/><path d="M11 9h2v9h-2zm5-4h2v2h-2zm-5-5h2v2h-2zM6 5h2v2H6z"/></g>'},"algorithm-sharp":{body:'<g fill="currentColor"><path d="M11 16h4v2h-4zm-8 0h4v2H3zm16 0h4v2h-4zM9 16h2v6H9zm-8 0h2v6H1zm16 0h2v6h-2z"/><path d="M9 20h6v2H9zm-8 0h6v2H1zm16 0h6v2h-6z"/><path d="M13 16h2v6h-2zm-8 0h2v6H5zm16 0h2v6h-2zM8 8h8v2H8z"/><path d="M8 2h2v8H8z"/><path d="M8 2h8v2H8z"/><path d="M14 2h2v8h-2zM3 14h2v3H3zm0-2h18v2H3zm16 2h2v3h-2z"/><path d="M11 9h2v9h-2zm5-4h2v2h-2zm-5-5h2v2h-2zM6 5h2v2H6z"/></g>'},alien:{body:'<path fill="currentColor" d="M14 22h-4v-2h4zm-4-2H8v-2h2zm6 0h-2v-2h2zm-8-2H6v-2h2zm10 0h-2v-2h2zm-5-1h-2v-2h2zm-7-1H4v-2h2zm14 0h-2v-2h2zM4 14H2V6h2zm18 0h-2V6h2zm-12-4h1v3H8v-1H6V8h4zm8 2h-2v1h-3v-3h1V8h4zM6 6H4V4h2zm14 0h-2V4h2zm-2-2H6V2h12z"/>'},"align-center":{body:'<path fill="currentColor" d="M20 5H4v2h16zm-4 4H8v2h8zM4 13h16v2H4zm12 4H8v2h8z"/>',hidden:!0},"align-center-horizontal":{body:'<path fill="currentColor" d="M5 2h4v2H5zm10 3h4v2h-4zm0 14h4v-2h-4zM3 15h2v5H3zM3 4h2v5H3zm10 3h2v2h-2zm0 10h2v-2h-2zm-8 3h4v2H5zm4-5h2v5H9zM9 4h2v5H9zm10 3h2v2h-2zm0 10h2v-2h-2zM2 11h20v2H2z"/>'},"align-center-horizontal-sharp":{body:'<path fill="currentColor" d="M3 2h8v2H3zm10 3h8v2h-8zm0 14h8v-2h-8zM3 15h2v5H3zM3 4h2v5H3zm10 3h2v2h-2zm0 10h2v-2h-2zM3 20h8v2H3zm6-5h2v5H9zM9 4h2v5H9zm10 3h2v2h-2zm0 10h2v-2h-2zM2 11h20v2H2z"/>'},"align-center-vertical":{body:'<path fill="currentColor" d="M22 5v4h-2V5zm-3 10v4h-2v-4zM5 15v4h2v-4zM9 3v2H4V3zm11 0v2h-5V3zm-3 10v2h-2v-2zM7 13v2h2v-2zM4 5v4H2V5zm5 4v2H4V9zm11 0v2h-5V9zm-3 10v2h-2v-2zM7 19v2h2v-2zm6-17v20h-2V2z"/>'},"align-center-vertical-sharp":{body:'<path fill="currentColor" d="M22 3v8h-2V3zm-3 10v8h-2v-8zM5 13v8h2v-8zM9 3v2H4V3zm11 0v2h-5V3zm-3 10v2h-2v-2zM7 13v2h2v-2zM4 3v8H2V3zm5 6v2H4V9zm11 0v2h-5V9zm-3 10v2h-2v-2zM7 19v2h2v-2zm6-17v20h-2V2z"/>'},"align-end-horizontal":{body:'<path fill="currentColor" d="M5 2h4v2H5zM3 4h2v12H3zm2 12h4v2H5zM9 4h2v12H9zm6 5h4v2h-4zm-2 2h2v5h-2zm2 5h4v2h-4zm4-5h2v5h-2zM2 20h20v2H2z"/>'},"align-end-horizontal-sharp":{body:'<path fill="currentColor" d="M3 2h8v2H3zm0 2h2v12H3zm0 12h8v2H3zM9 4h2v12H9zm4 5h8v2h-8zm0 2h2v5h-2zm0 5h8v2h-8zm6-5h2v5h-2zM2 20h20v2H2z"/>'},"align-end-vertical":{body:'<path fill="currentColor" d="M2 5v4h2V5zm2-2v2h12V3zm12 2v4h2V5zM4 9v2h12V9zm5 6v4h2v-4zm2-2v2h5v-2zm5 2v4h2v-4zm-5 4v2h5v-2zm9-17v20h2V2z"/>'},"align-end-vertical-sharp":{body:'<path fill="currentColor" d="M2 5v4h2V5zm0-2v2h16V3zm14 2v4h2V5zM2 9v2h16V9zm7 6v4h2v-4zm0-2v2h9v-2zm7 2v4h2v-4zm-7 4v2h9v-2zM20 2v20h2V2z"/>'},"align-horizontal-distribute-center":{body:'<path fill="currentColor" d="M5 8h4V6H5zm10 2h4V8h-4zm-6 6h2V8H9zm10-2h2v-4h-2zM5 18h4v-2H5zm10-2h4v-2h-4zM3 16h2V8H3zm10-2h2v-4h-2zM6 2h2v4H6zm0 16h2v4H6zm10-2h2v6h-2zm0-14h2v6h-2z"/>'},"align-horizontal-distribute-center-sharp":{body:'<path fill="currentColor" d="M5 8h4V6H5zm10 2h4V8h-4zm-6 8h2V6H9zm10-2h2V8h-2zM5 18h4v-2H5zm10-2h4v-2h-4zM3 18h2V6H3zm10-2h2V8h-2zM6 2h2v4H6zm0 16h2v4H6zm10-2h2v6h-2zm0-14h2v6h-2z"/>'},"align-horizontal-distribute-end":{body:'<path fill="currentColor" d="M9 4H6v2h3zm2-2H9v20h2zM9 18H6v2h3zM6 6H4v12h2zm9 1h3v2h-3zm-2 2h2v6h-2zm2 6h3v2h-3zm3-13h2v20h-2z"/>'},"align-horizontal-distribute-end-sharp":{body:'<path fill="currentColor" d="M9 4H6v2h3zm2-2H9v20h2zM9 18H6v2h3zM6 4H4v16h2zm9 3h3v2h-3zm-2 0h2v10h-2zm2 8h3v2h-3zm3-13h2v20h-2z"/>'},"align-horizontal-distribute-start":{body:'<path fill="currentColor" d="M6 4h3v2H6zM4 2h2v20H4zm2 16h3v2H6zM9 6h2v12H9zm9 1h-3v2h3zm2 2h-2v6h2zm-2 6h-3v2h3zM15 2h-2v20h2z"/>'},"align-horizontal-distribute-start-sharp":{body:'<path fill="currentColor" d="M6 4h3v2H6zM4 2h2v20H4zm2 16h3v2H6zM9 4h2v16H9zm9 3h-3v2h3zm2 0h-2v10h2zm-2 8h-3v2h3zM15 2h-2v20h2z"/>'},"align-horizontal-justify-center":{body:'<path fill="currentColor" d="M11 2v20h2V2zM7 4H4v2h3zm2 2H7v12h2zM7 18H4v2h3zM4 6H2v12h2zm13 1h3v2h-3zm-2 2h2v6h-2zm2 6h3v2h-3zm3-6h2v6h-2z"/>'},"align-horizontal-justify-center-sharp":{body:'<path fill="currentColor" d="M11 2v20h2V2zM7 4H4v2h3zm2 0H7v16h2zM7 18H4v2h3zM4 4H2v16h2zm13 3h3v2h-3zm-2 0h2v10h-2zm2 8h3v2h-3zm3-8h2v10h-2z"/>'},"align-horizontal-justify-end":{body:'<path fill="currentColor" d="M20 2v20h2V2zM7 4H4v2h3zm2 2H7v12h2zM7 18H4v2h3zM4 6H2v12h2zm9 1h3v2h-3zm-2 2h2v6h-2zm2 6h3v2h-3zm3-6h2v6h-2z"/>'},"align-horizontal-justify-end-sharp":{body:'<path fill="currentColor" d="M20 2v20h2V2zM7 4H4v2h3zm2 0H7v16h2zM7 18H4v2h3zM4 4H2v16h2zm9 3h3v2h-3zm-2 0h2v10h-2zm2 8h3v2h-3zm3-8h2v10h-2z"/>'},"align-horizontal-justify-start":{body:'<path fill="currentColor" d="M4 2v20H2V2zm4 2h3v2H8zM6 6h2v12H6zm2 12h3v2H8zm3-12h2v12h-2zm6 1h3v2h-3zm-2 2h2v6h-2zm2 6h3v2h-3zm3-6h2v6h-2z"/>'},"align-horizontal-justify-start-sharp":{body:'<path fill="currentColor" d="M4 2v20H2V2zm4 2h3v2H8zM6 4h2v16H6zm2 14h3v2H8zm3-14h2v16h-2zm6 3h3v2h-3zm-2 0h2v10h-2zm2 8h3v2h-3zm3-8h2v10h-2z"/>'},"align-horizontal-space-around":{body:'<path fill="currentColor" d="M10 6h4v2h-4zM8 8h2v8H8zm2 8h4v2h-4zm4-8h2v8h-2zM4 2v20h2V2zm14 0v20h2V2z"/>'},"align-horizontal-space-around-sharp":{body:'<path fill="currentColor" d="M10 6h4v2h-4zM8 6h2v12H8zm2 10h4v2h-4zm4-10h2v12h-2zM4 2v20h2V2zm14 0v20h2V2z"/>'},"align-horizontal-space-between":{body:'<path fill="currentColor" d="M5 4h3v2H5zM3 2h2v20H3zm2 16h3v2H5zM8 6h2v12H8zm8 1h3v2h-3zm-2 2h2v6h-2zm2 6h3v2h-3zm3-13h2v20h-2z"/>'},"align-horizontal-space-between-sharp":{body:'<path fill="currentColor" d="M5 4h3v2H5zM3 2h2v20H3zm2 16h3v2H5zM8 4h2v16H8zm8 3h3v2h-3zm-2 0h2v10h-2zm2 8h3v2h-3zm3-13h2v20h-2z"/>'},"align-justify":{body:'<path fill="currentColor" d="M20 5H4v2h16zm0 4H4v2h16zM4 13h16v2H4zm16 4H4v2h16z"/>',hidden:!0},"align-left":{body:'<path fill="currentColor" d="M20 5H4v2h16zm-8 4H4v2h8zm8 4v2H4v-2zm-8 4H4v2h8z"/>',hidden:!0},"align-right":{body:'<path fill="currentColor" d="M4 5h16v2H4zm8 4h8v2h-8zm-8 4v2h16v-2zm8 4h8v2h-8z"/>',hidden:!0},"align-start-horizontal":{body:'<path fill="currentColor" d="M5 22h4v-2H5zm-2-2h2V8H3zM5 8h4V6H5zm4 12h2V8H9zm6-5h4v-2h-4zm-2-2h2V8h-2zm2-5h4V6h-4zm4 5h2V8h-2zM2 4h20V2H2z"/>'},"align-start-horizontal-sharp":{body:'<path fill="currentColor" d="M5 22h4v-2H5zm-2 0h2V6H3zM5 8h4V6H5zm4 14h2V6H9zm6-7h4v-2h-4zm-2 0h2V6h-2zm2-7h4V6h-4zm4 7h2V6h-2zM2 4h20V2H2z"/>'},"align-start-vertical":{body:'<path fill="currentColor" d="M22 5v4h-2V5zm-2-2v2H8V3zM8 5v4H6V5zm12 4v2H8V9zm-5 6v4h-2v-4zm-2-2v2H8v-2zm-5 2v4H6v-4zm5 4v2H8v-2zM4 2v20H2V2z"/>'},"align-start-vertical-sharp":{body:'<path fill="currentColor" d="M22 5v4h-2V5zm0-2v2H6V3zM8 5v4H6V5zm14 4v2H6V9zm-7 6v4h-2v-4zm0-2v2H6v-2zm-7 2v4H6v-4zm7 4v2H6v-2zM4 2v20H2V2z"/>'},"align-vertical-distribute-center":{body:'<path fill="currentColor" d="M8 19v-4H6v4zm2-10V5H8v4zm6 6v-2H8v2zM14 5V3h-4v2zm4 14v-4h-2v4zM16 9V5h-2v4zm0 12v-2H8v2zm-2-10V9h-4v2zM2 18v-2h4v2zm16 0v-2h4v2zM16 8V6h6v2zM2 8V6h6v2z"/>'},"align-vertical-distribute-center-sharp":{body:'<path fill="currentColor" d="M8 19v-4H6v4zm2-10V5H8v4zm8 6v-2H6v2zM16 5V3H8v2zm2 14v-4h-2v4zM16 9V5h-2v4zm2 12v-2H6v2zm-2-10V9H8v2zM2 18v-2h4v2zm16 0v-2h4v2zM16 8V6h6v2zM2 8V6h6v2z"/>'},"align-vertical-distribute-end":{body:'<path fill="currentColor" d="M4 18v-3h2v3zm-2 2v-2h20v2zm16-2v-3h2v3zM6 15v-2h12v2zm1-9v3h2V6zm2-2v2h6V4zm6 2v3h2V6zM2 9v2h20V9z"/>'},"align-vertical-distribute-end-sharp":{body:'<path fill="currentColor" d="M4 18v-3h2v3zm-2 2v-2h20v2zm16-2v-3h2v3zM4 15v-2h16v2zm3-9v3h2V6zm0-2v2h10V4zm8 2v3h2V6zM2 9v2h20V9z"/>'},"align-vertical-distribute-start":{body:'<path fill="currentColor" d="M4 6v3h2V6zM2 4v2h20V4zm16 2v3h2V6zM6 9v2h12V9zm1 9v-3h2v3zm2 2v-2h6v2zm6-2v-3h2v3zM2 15v-2h20v2z"/>'},"align-vertical-distribute-start-sharp":{body:'<path fill="currentColor" d="M4 6v3h2V6zM2 4v2h20V4zm16 2v3h2V6zM4 9v2h16V9zm3 9v-3h2v3zm0 2v-2h10v2zm8-2v-3h2v3zM2 15v-2h20v2z"/>'},"align-vertical-justify-center":{body:'<path fill="currentColor" d="M2 13h20v-2H2zm2 4v3h2v-3zm2-2v2h12v-2zm12 2v3h2v-3zM6 20v2h12v-2zM7 7V4h2v3zm2 2V7h6v2zm6-2V4h2v3zM9 4V2h6v2z"/>'},"align-vertical-justify-center-sharp":{body:'<path fill="currentColor" d="M2 13h20v-2H2zm2 4v3h2v-3zm0-2v2h16v-2zm14 2v3h2v-3zM4 20v2h16v-2zM7 7V4h2v3zm0 2V7h10v2zm8-2V4h2v3zM7 4V2h10v2z"/>'},"align-vertical-justify-end":{body:'<path fill="currentColor" d="M2 20h20v2H2zm2-4v-3h2v3zm2 2v-2h12v2zm12-2v-3h2v3zM6 13v-2h12v2zm1-6V4h2v3zm2 2V7h6v2zm6-2V4h2v3zM9 4V2h6v2z"/>'},"align-vertical-justify-end-sharp":{body:'<path fill="currentColor" d="M2 20h20v2H2zm2-4v-3h2v3zm0 2v-2h16v2zm14-2v-3h2v3zM4 13v-2h16v2zm3-6V4h2v3zm0 2V7h10v2zm8-2V4h2v3zM7 4V2h10v2z"/>'},"align-vertical-justify-start":{body:'<path fill="currentColor" d="M2 4h20V2H2zm5 4v3h2V8zm2-2v2h6V6zm6 2v3h2V8zm-6 3v2h6v-2zm-5 6v3h2v-3zm2-2v2h12v-2zm12 2v3h2v-3zM6 20v2h12v-2z"/>'},"align-vertical-justify-start-sharp":{body:'<path fill="currentColor" d="M2 4h20V2H2zm5 4v3h2V8zm0-2v2h10V6zm8 2v3h2V8zm-8 3v2h10v-2zm-3 6v3h2v-3zm0-2v2h16v-2zm14 2v3h2v-3zM4 20v2h16v-2z"/>'},"align-vertical-space-around":{body:'<path fill="currentColor" d="M18 10v4h-2v-4zm-2-2v2H8V8zm-8 2v4H6v-4zm8 4v2H8v-2zm6-10H2v2h20zm0 14H2v2h20z"/>'},"align-vertical-space-around-sharp":{body:'<path fill="currentColor" d="M18 10v4h-2v-4zm0-2v2H6V8zM8 10v4H6v-4zm10 4v2H6v-2zm4-10H2v2h20zm0 14H2v2h20z"/>'},"align-vertical-space-between":{body:'<path fill="currentColor" d="M4 19v-3h2v3zm-2 2v-2h20v2zm16-2v-3h2v3zM6 16v-2h12v2zm1-8V5h2v3zm2 2V8h6v2zm6-2V5h2v3zM2 5V3h20v2z"/>'},"align-vertical-space-between-sharp":{body:'<path fill="currentColor" d="M4 19v-3h2v3zm-2 2v-2h20v2zm16-2v-3h2v3zM4 16v-2h16v2zm3-8V5h2v3zm0 2V8h10v2zm8-2V5h2v3zM2 5V3h20v2z"/>'},ampersand:{body:'<path fill="currentColor" d="M15 11h6v2h-6zm2 2h2v2h-2zm-2 2h2v2h-2zm-2 2h2v2h-2zm-8 2h8v2H5zm-2-6h2v6H3zm2-2h4v2H5zm4-2h4v2H9zm4-4h2v4h-2zM7 3h6v2H7zM5 5h2v4H5zm4 8h2v2H9zM7 9h2v2H7zm4 6h2v2h-2zm4 4h4v2h-4z"/>'},"ampersand-sharp":{body:'<path fill="currentColor" d="M15 11h6v2h-6zm2 2h2v2h-2zm-2 2h2v2h-2zm-2 2h2v2h-2zm-8 2h8v2H5zm-2-8h2v10H3zm2 0h4v2H5zm4-2h4v2H9zm4-4h2v4h-2zM5 3h10v2H5zm0 2h2v4H5zm4 8h2v2H9zM7 9h2v2H7zm4 6h2v2h-2zm4 4h4v2h-4z"/>'},analytics:{body:'<path fill="currentColor" d="M4 2h16v2H4zm0 18h16v2H4zM2 4h2v16H2zm18 0h2v16h-2zm-9 8h2v6h-2zm-4 2h2v4H7zm8-8h2v12h-2z"/>'},"analytics-sharp":{body:'<path fill="currentColor" d="M2 2h20v2H2zm0 18h20v2H2zM2 4h2v16H2zm18 0h2v16h-2zm-9 8h2v6h-2zm-4 2h2v4H7zm8-8h2v12h-2z"/>'},anchor:{body:'<g fill="currentColor"><path d="M10 2h4v2h-4zm0 6h4v2h-4zM8 4h2v4H8zm6 0h2v4h-2z"/><path d="M11 9h2v12h-2z"/><path d="M5 20h14v2H5zm-2-8h2v8H3zm16 0h2v8h-2zM5 12h2v2H5zm12 0h2v2h-2z"/></g>'},"anchor-sharp":{body:'<g fill="currentColor"><path d="M8 2h8v2H8zm0 6h8v2H8zm0-4h2v4H8zm6 0h2v4h-2z"/><path d="M11 9h2v12h-2z"/><path d="M5 20h14v2H5zm-2-8h2v10H3zm16 0h2v10h-2zM5 12h2v2H5zm12 0h2v2h-2z"/></g>'},android:{body:'<path fill="currentColor" d="M2 12h2v6H2zm18 0h2v6h-2zM4 10h2v2H4zm4 2h2v4H8zm6 0h2v4h-2zm6-2h-2v2h2zM6 8h2v2H6zM4 6h2v2H4zM2 4h2v2H2zm16 4h-2v2h2zm2-2h-2v2h2zm2-2h-2v2h2zM8 6h8v2H8zM2 18h20v2H2z"/>'},"android-solid":{body:'<path fill="currentColor" d="M16 8h2v2h2v2h2v8H2v-8h2v-2h2V8h2V6h8zm-8 8h2v-4H8zm6-4v4h2v-4zM6 8H4V6h2zm14 0h-2V6h2zM4 6H2V4h2zm18 0h-2V4h2z"/>'},angry:{body:'<path fill="currentColor" d="M6 20h12v2H6zM6 2h12v2H6zm12 2h2v2h-2zM4 4h2v2H4zm0 14h2v2H4zm14 0h2v2h-2zM2 6h2v12H2zm18 0h2v12h-2zM7 7h2v2H7zm2 2h2v2H9zm6-2h2v2h-2zm-2 2h2v2h-2zm-6 6h2v2H7zm2-2h6v2H9zm6 2h2v2h-2z"/>'},"angry-sharp":{body:'<g fill="currentColor"><path d="M2 20h20v2H2zM2 2h20v2H2z"/><path d="M2 2h2v20H2zm18 0h2v20h-2zM7 7h2v2H7zm2 2h2v2H9zm6-2h2v2h-2zm-2 2h2v2h-2zm-6 6h2v2H7zm2-2h6v2H9zm6 2h2v2h-2z"/></g>'},animation:{body:'<path fill="currentColor" d="M4 2H2v12h2V4h10V2zm2 4h12v2H8v10H6zm4 4h12v12H10zm10 10v-8h-8v8z"/>',hidden:!0},annoyed:{body:'<path fill="currentColor" d="M6 20h12v2H6zM6 2h12v2H6zm12 2h2v2h-2zM4 4h2v2H4zm0 14h2v2H4zm14 0h2v2h-2zM2 6h2v12H2zm18 0h2v12h-2zM7 8h3v2H7zm7 0h3v2h-3zm-7 6h10v2H7z"/>'},"annoyed-sharp":{body:'<path fill="currentColor" d="M2 20h20v2H2zM2 2h20v2H2zm0 2h2v16H2zm18 0h2v16h-2zM7 8h3v2H7zm7 0h3v2h-3zm-7 6h10v2H7z"/>'},"app-mac":{body:'<path fill="currentColor" d="M4 3h16v2H4zm0 16h16v2H4zM2 5h2v14H2zm18 0h2v14h-2zM6 7h2v2H6zm4 0h2v2h-2zm4 0h2v2h-2z"/>'},"app-mac-sharp":{body:'<path fill="currentColor" d="M2 3h20v2H2zm0 16h20v2H2zM2 5h2v14H2zm18 0h2v14h-2zM6 7h2v2H6zm4 0h2v2h-2zm4 0h2v2h-2z"/>'},"app-windows":{body:'<path fill="currentColor" d="M4 3h16v2H4zm0 16h16v2H4zM2 5h2v14H2zm18 0h2v14h-2zM4 7h16v2H4zm8-2h2v2h-2zm4 0h2v2h-2z"/>'},"app-windows-sharp":{body:'<path fill="currentColor" d="M2 3h20v2H2zm0 16h20v2H2zM2 5h2v14H2zm18 0h2v14h-2zM4 7h16v2H4zm8-2h2v2h-2zm4 0h2v2h-2z"/>'},apple:{body:'<path fill="currentColor" d="M11 8h3v2h-3zm3-2h4v2h-4zm4 2h2v3h-2zm-2 3h2v4h-2zm2 4h2v5h-2zm-4 5h4v2h-4zm-3-2h3v2h-3zm-4 2h4v2H7zm-2-2h2v2H5zm-2-8h2v8H3zm2-2h2v2H5zm2-2h4v2H7zm5-3h2v2h-2zm2-2h2v2h-2z"/>'},"apple-solid":{body:'<path fill="currentColor" d="M11 8h3V6h4v2h2v3h-2v4h2v5h-2v2h-4v-2h-3v2H7v-2H5v-2H3v-8h2V8h2V6h4zm3-3h-2V3h2zm2-2h-2V1h2z"/>'},archive:{body:'<path fill="currentColor" d="M3 2h18v2H3zm0 5h18v2H3zM1 4h2v3H1zm20 0h2v3h-2zm-2 5h2v11h-2zM3 9h2v11H3zm2 11h14v2H5zm4-9h6v2H9z"/>'},"archive-sharp":{body:'<path fill="currentColor" d="M1 2h22v2H1zm0 5h22v2H1zm0-3h2v3H1zm20 0h2v3h-2zm-2 5h2v11h-2zM3 9h2v11H3zm0 11h18v2H3zm6-9h6v2H9z"/>'},"arrow-bar-down":{body:'<path fill="currentColor" d="M4 20h16v2H4zm7-18h2v16h-2zm2 12h2v2h-2zm2-2h2v2h-2zm2-2h2v2h-2zm-8 4h2v2H9zm-2-2h2v2H7zm-2-2h2v2H5z"/>'},"arrow-bar-left":{body:'<path fill="currentColor" d="M4 4v16H2V4zm18 7v2H6v-2zm-12 2v2H8v-2zm2 2v2h-2v-2zm2 2v2h-2v-2zm-4-8v2H8V9zm2-2v2h-2V7zm2-2v2h-2V5z"/>'},"arrow-bar-right":{body:'<path fill="currentColor" d="M20 4v16h2V4zM2 11v2h16v-2zm12 2v2h2v-2zm-2 2v2h2v-2zm-2 2v2h2v-2zm4-8v2h2V9zm-2-2v2h2V7zm-2-2v2h2V5z"/>'},"arrow-bar-up":{body:'<path fill="currentColor" d="M4 4h16V2H4zm7 18h2V6h-2zm2-12h2V8h-2zm2 2h2v-2h-2zm2 2h2v-2h-2zm-8-4h2V8H9zm-2 2h2v-2H7zm-2 2h2v-2H5z"/>'},"arrow-big-down":{body:'<path fill="currentColor" d="M8 3h8v2H8zm0 2h2v6H8zm-5 6h5v2H3zm0 2h2v2H3zm2 2h2v2H5zm2 2h2v2H7zm2 2h2v2H9zm2 2h2v2h-2zm2-2h2v2h-2zm2-2h2v2h-2zm2-2h2v2h-2zm2-4h2v4h-2zm-3 0h3v2h-3zm-2-6h2v6h-2z"/>'},"arrow-big-down-dash":{body:'<g fill="currentColor"><path d="M8 3h8v2H8zm0 4h8v2H8z"/><path d="M8 7h2v4H8zm-5 4h5v2H3zm0 2h2v2H3zm2 2h2v2H5zm2 2h2v2H7zm2 2h2v2H9zm2 2h2v2h-2zm2-2h2v2h-2zm2-2h2v2h-2zm2-2h2v2h-2zm2-4h2v4h-2zm-3 0h3v2h-3zm-2-4h2v4h-2z"/></g>'},"arrow-big-down-dash-sharp":{body:'<g fill="currentColor"><path d="M8 3h8v2H8zm0 4h8v2H8z"/><path d="M8 7h2v6H8zm-5 4h5v2H3zm0 2h2v2H3zm2 2h2v2H5zm2 2h2v2H7zm2 2h2v2H9zm2 2h2v2h-2zm2-2h2v2h-2zm2-2h2v2h-2zm2-2h2v2h-2zm2-4h2v4h-2zm-3 0h3v2h-3zm-2-4h2v6h-2z"/></g>'},"arrow-big-down-sharp":{body:'<path fill="currentColor" d="M8 3h8v2H8zm0 2h2v8H8zm-5 6h5v2H3zm0 2h2v2H3zm2 2h2v2H5zm2 2h2v2H7zm2 2h2v2H9zm2 2h2v2h-2zm2-2h2v2h-2zm2-2h2v2h-2zm2-2h2v2h-2zm2-4h2v4h-2zm-3 0h3v2h-3zm-2-6h2v8h-2z"/>'},"arrow-big-up":{body:'<path fill="currentColor" d="M8 21h8v-2H8zm0-2h2v-6H8zm-5-6h5v-2H3zm0-2h2V9H3zm2-2h2V7H5zm2-2h2V5H7zm2-2h2V3H9zm2-2h2V1h-2zm2 2h2V3h-2zm2 2h2V5h-2zm2 2h2V7h-2zm2 4h2V9h-2zm-3 0h3v-2h-3zm-2 6h2v-6h-2z"/>'},"arrow-big-up-dash":{body:'<g fill="currentColor"><path d="M8 21h8v-2H8zm0-4h8v-2H8z"/><path d="M8 17h2v-4H8zm-5-4h5v-2H3zm0-2h2V9H3zm2-2h2V7H5zm2-2h2V5H7zm2-2h2V3H9zm2-2h2V1h-2zm2 2h2V3h-2zm2 2h2V5h-2zm2 2h2V7h-2zm2 4h2V9h-2zm-3 0h3v-2h-3zm-2 4h2v-4h-2z"/></g>'},"arrow-big-up-dash-sharp":{body:'<g fill="currentColor"><path d="M8 21h8v-2H8zm0-4h8v-2H8z"/><path d="M8 17h2v-6H8zm-5-4h5v-2H3zm0-2h2V9H3zm2-2h2V7H5zm2-2h2V5H7zm2-2h2V3H9zm2-2h2V1h-2zm2 2h2V3h-2zm2 2h2V5h-2zm2 2h2V7h-2zm2 4h2V9h-2zm-3 0h3v-2h-3zm-2 4h2v-6h-2z"/></g>'},"arrow-big-up-sharp":{body:'<path fill="currentColor" d="M8 21h8v-2H8zm0-2h2v-8H8zm-5-6h5v-2H3zm0-2h2V9H3zm2-2h2V7H5zm2-2h2V5H7zm2-2h2V3H9zm2-2h2V1h-2zm2 2h2V3h-2zm2 2h2V5h-2zm2 2h2V7h-2zm2 4h2V9h-2zm-3 0h3v-2h-3zm-2 6h2v-8h-2z"/>'},"arrow-down":{body:'<path fill="currentColor" d="M13 12h6v2h-2v2h-2v2h-2v2h-2v-2H9v-2H7v-2H5v-2h6V4h2z"/>'},"arrow-down-box":{body:'<path fill="currentColor" d="M4 2h16v2H4zm0 18h16v2H4zM2 4h2v16H2zm18 0h2v16h-2zm-9 12h2v2h-2zm0-10h2v6h-2zm-2 8h6v2H9zm-2-2h10v2H7z"/>'},"arrow-down-box-sharp":{body:'<path fill="currentColor" d="M2 2h20v2H2zm0 18h20v2H2zM2 4h2v16H2zm18 0h2v16h-2zm-9 12h2v2h-2zm0-10h2v6h-2zm-2 8h6v2H9zm-2-2h10v2H7z"/>'},"arrow-down-circle":{body:'<path fill="currentColor" d="M11 16h2v2h-2zm0-10h2v6h-2zm-2 8h6v2H9zm-2-2h10v2H7zm11 6h2v2h-2zm0-14h2v2h-2zM4 4h2v2H4zm0 14h2v2H4zM6 2h12v2H6zm0 18h12v2H6zM2 6h2v12H2zm18 0h2v12h-2z"/>'},"arrow-down-diamond":{body:'<path fill="currentColor" d="M11 16h2v2h-2zm0-10h2v6h-2zm-2 8h6v2H9zm-2-2h10v2H7zm4-11h2v2h-2zm2 2h2v2h-2zm-2 0H9v2h2zm4 2h2v2h-2zM9 5H7v2h2zm8 2h2v2h-2zM7 7H5v2h2zm12 2h2v2h-2zM5 9H3v2h2zm16 2h2v2h-2zM3 11H1v2h2zm16 2h2v2h-2zM5 13H3v2h2zm12 2h2v2h-2zM7 15H5v2h2zm8 2h2v2h-2zm-6 0H7v2h2zm4 2h2v2h-2zm-2 0H9v2h2zm0 2h2v2h-2z"/>'},"arrow-down-narrow-wide":{body:'<g fill="currentColor"><path d="M6 3h2v18H6z"/><path d="M4 17h6v2H4zm-2-2h10v2H2zm8-12h6v2h-6zm0 4h9v2h-9zm0 4h12v2H10z"/></g>'},"arrow-down-wide-narrow":{body:'<g fill="currentColor"><path d="M6 3h2v18H6z"/><path d="M4 17h6v2H4zm-2-2h10v2H2zm8-2h6v-2h-6zm0-4h9V7h-9zm0-4h12V3H10z"/></g>'},"arrow-down-z-a":{body:'<g fill="currentColor"><path d="M14 3h7v2h-7zm0 6h7v2h-7zm2-2h2v2h-2zm2-2h2v2h-2zM6 3h2v18H6z"/><path d="M4 17h6v2H4zm-2-2h10v2H2zm12 0h2v6h-2zm2-2h3v2h-3zm3 2h2v6h-2zm-3 2h3v2h-3z"/></g>'},"arrow-down-z-a-sharp":{body:'<g fill="currentColor"><path d="M14 3h7v2h-7zm0 6h7v2h-7zm2-2h2v2h-2zm2-2h2v2h-2zM6 3h2v18H6z"/><path d="M4 17h6v2H4zm-2-2h10v2H2zm12 0h2v6h-2zm0-2h7v2h-7zm5 2h2v6h-2zm-3 2h3v2h-3z"/></g>'},"arrow-left":{body:'<g fill="currentColor"><path d="M20 11v2H4v-2zM8 13v2H6v-2zm2 2v2H8v-2zm2 2v2h-2v-2zm-4-6V9H6v2z"/><path d="M10 15V7H8v8zm2 2V5h-2v12z"/></g>'},"arrow-left-box":{body:'<path fill="currentColor" d="M4 2h16v2H4zm0 18h16v2H4zM2 4h2v16H2zm18 0h2v16h-2zM8.067 11.009v2h-2v-2zm10 0v2h-6v-2zm-8-2v6h-2v-6zm2-2v10h-2v-10z"/>'},"arrow-left-box-sharp":{body:'<path fill="currentColor" d="M2 2h20v2H2zm0 18h20v2H2zM2 4h2v16H2zm18 0h2v16h-2zM8.067 11.009v2h-2v-2zm10 0v2h-6v-2zm-8-2v6h-2v-6zm2-2v10h-2v-10z"/>'},"arrow-right":{body:'<g fill="currentColor"><path d="M4 11v2h16v-2zm12 2v2h2v-2zm-2 2v2h2v-2zm-2 2v2h2v-2zm4-6V9h2v2z"/><path d="M14 15V7h2v8zm-2 2V5h2v12z"/></g>'},"arrow-right-box":{body:'<path fill="currentColor" d="M4 2h16v2H4zm0 18h16v2H4zM2 4h2v16H2zm18 0h2v16h-2zm-3.933 7.009v2h2v-2zm-10 0v2h6v-2zm8-2v6h2v-6zm-2-2v10h2v-10z"/>'},"arrow-right-box-sharp":{body:'<path fill="currentColor" d="M2 2h20v2H2zm0 18h20v2H2zM2 4h2v16H2zm18 0h2v16h-2zm-3.933 7.009v2h2v-2zm-10 0v2h6v-2zm8-2v6h2v-6zm-2-2v10h2v-10z"/>'},"arrow-up":{body:'<g fill="currentColor"><path d="M11 20h2V4h-2zm2-12h2V6h-2zm2 2h2V8h-2zm2 2h2v-2h-2zm-6-4H9V6h2z"/><path d="M15 10H7V8h8zm2 2H5v-2h12z"/></g>'},"arrow-up-box":{body:'<path fill="currentColor" d="M4 2h16v2H4zm0 18h16v2H4zM2 4h2v16H2zm18 0h2v16h-2zm-8.933 4.009h2v-2h-2zm0 10h2v-6h-2zm-2-8h6v-2h-6zm-2 2h10v-2h-10z"/>'},"arrow-up-box-sharp":{body:'<path fill="currentColor" d="M2 2h20v2H2zm0 18h20v2H2zM2 4h2v16H2zm18 0h2v16h-2zm-8.933 4.009h2v-2h-2zm0 10h2v-6h-2zm-2-8h6v-2h-6zm-2 2h10v-2h-10z"/>'},"arrow-up-narrow-wide":{body:'<g fill="currentColor"><path d="M6 21h2V3H6z"/><path d="M4 7h6V5H4zM2 9h10V7H2zm8 2h6v2h-6zm0 4h9v2h-9zm0 4h12v2H10z"/></g>'},"arrow-up-wide-narrow":{body:'<g fill="currentColor"><path d="M6 21h2V3H6z"/><path d="M4 7h6V5H4zM2 9h10V7H2zm8 12h6v-2h-6zm0-4h9v-2h-9zm0-4h12v-2H10z"/></g>'},"arrow-up-z-a":{body:'<g fill="currentColor"><path d="M14 9h7v2h-7zm0-6h7v2h-7zm2 4h2v2h-2zm2-2h2v2h-2zM6 21h2V3H6z"/><path d="M4 7h6V5H4zM2 9h10V7H2zm12 6h2v6h-2zm2-2h3v2h-3zm3 2h2v6h-2zm-3 2h3v2h-3z"/></g>'},"arrow-up-z-a-sharp":{body:'<g fill="currentColor"><path d="M14 9h7v2h-7zm0-6h7v2h-7zm2 4h2v2h-2zm2-2h2v2h-2zM6 21h2V3H6z"/><path d="M4 7h6V5H4zM2 9h10V7H2zm12 6h2v6h-2zm0-2h7v2h-7zm5 2h2v6h-2zm-3 2h3v2h-3z"/></g>'},"arrows-horizontal":{body:'<g fill="currentColor"><path d="M13 13v-2h10v2zm6 2v-2h2v2zm-2 2v-2h2v2zm2-6V9h2v2z"/><path d="M17 15V7h2v8zm-6-2v-2H1v2zm-6 2v-2H3v2zm2 2v-2H5v2zm-2-6V9H3v2z"/><path d="M7 15V7H5v8z"/></g>'},"arrows-vertical":{body:'<g fill="currentColor"><path d="M13 11h-2V1h2zm2-6h-2V3h2zm2 2h-2V5h2zm-6-2H9V3h2z"/><path d="M15 7H7V5h8zm-2 6h-2v10h2zm2 6h-2v2h2zm2-2h-2v2h2zm-6 2H9v2h2z"/><path d="M15 17H7v2h8z"/></g>'},"art-text":{body:'<path fill="currentColor" d="M2 7h10v10H2zm8 8V9H4v6zm12-8h-8v2h8zm-8 4h8v2h-8zm8 4h-8v2h8z"/>',hidden:!0},article:{body:'<path fill="currentColor" d="M8 2h12v2H8zM6 4h2v16H6zm14 0h2v16h-2zM4 20h16v2H4zm-2-9h2v9H2zm2-2h2v2H4zm6-3h8v2h-8zm0 4h8v2h-8zm0-2h2v2h-2zm6 0h2v2h-2zm-6 5h8v2h-8zm0 3h4v2h-4z"/>'},"article-multiple":{body:'<path fill="currentColor" d="M3 1H1v18h18V1zm14 2v14H3V3zm4 18H5v2h18V5h-2zM15 5H5v2h10zM5 9h10v2H5zm7 4H5v2h7z"/>',hidden:!0},"article-sharp":{body:'<path fill="currentColor" d="M6 2h16v2H6zm0 2h2v16H6zm14 0h2v16h-2zM2 20h20v2H2zm0-9h2v9H2zm0-2h4v2H2zm8-3h8v2h-8zm0 4h8v2h-8zm0-2h2v2h-2zm6 0h2v2h-2zm-6 5h8v2h-8zm0 3h4v2h-4z"/>'},"aspect-ratio":{body:'<path fill="currentColor" d="M4 4h16v2H4zM2 6h2v12H2zm2 12h16v2H4zM20 6h2v12h-2zM6 8h4v2H6zm8 6h4v2h-4zm-8-4h2v2H6zm10 2h2v2h-2z"/>'},"aspect-ratio-sharp":{body:'<path fill="currentColor" d="M2 4h20v2H2zm0 2h2v12H2zm0 12h20v2H2zM20 6h2v12h-2zM6 8h4v2H6zm8 6h4v2h-4zm-8-4h2v2H6zm10 2h2v2h-2z"/>'},at:{body:'<path fill="currentColor" d="M4 4h16v12H8V8h8v6h2V6H6v12h14v2H4zm10 10v-4h-4v4z"/>',hidden:!0},"at-sign":{body:'<g fill="currentColor"><path d="M9 8h6v2H9zm0 6h8v2H9zm-2 0v-4h2v4z"/><path d="M13 14V8h2v6zm4-8h2v8h-2zM7 4h10v2H7zM3 8h2v8H3zm4 10h12v2H7zm-2-2h2v2H5zm14 0h2v2h-2zM5 6h2v2H5z"/></g>'},"at-sign-sharp":{body:'<g fill="currentColor"><path d="M9 8h6v2H9zm0 6h8v2H9zm-2 2V8h2v8z"/><path d="M13 14V8h2v6zm4-10h2v12h-2zM3 4h14v2H3zm0 2h2v12H3zm0 12h16v2H3z"/></g>'},attachment:{body:'<path fill="currentColor" d="M7 7v10H5V7zm12 0v12h-2V7zm-8 2v10H9V9zm4 0v8h-2V9zm0-6v2H9V3zm-2 4v2h-2V7zm4 12v2h-6v-2zm0-14v2h-2V5zM9 5v2H7V5z"/>'},"attachment-sharp":{body:'<path fill="currentColor" d="M7 3v14H5V3zm12 0v16h-2V3zm-8 6v10H9V9zm4 0v8h-2V9zm2-6v2H7V3zm-2 4v2H9V7zm4 12v2H9v-2z"/>'},"audio-device":{body:'<path fill="currentColor" d="M4 4h4v2H4v8h4v2H2V4zm6 0h10v2h-8v12h8v2H10zm12 0h-2v16h2zm-7 4h2v2h-2zm3 4h-4v4h4zM8 18H4v2h4z"/>',hidden:!0},"audio-waveform":{body:'<path fill="currentColor" d="M3 7h2v5H3zm4 0h2v13H7zm4-3h2v16h-2zm4 0h2v13h-2zM5 5h2v2H5zm4 15h2v2H9zm4-18h2v2h-2zm4 15h2v2h-2zm2-5h2v5h-2zm2-2h2v2h-2zM1 12h2v2H1z"/>'},"audio-waveform-sharp":{body:'<path fill="currentColor" d="M3 7h2v5H3zm4 0h2v13H7zm4-3h2v16h-2zm4 0h2v13h-2zM3 5h6v2H3zm4 15h6v2H7zm4-18h6v2h-6zm4 15h6v2h-6zm4-5h2v5h-2zm0-2h4v2h-4zM1 12h4v2H1z"/>'},avatar:{body:'<path fill="currentColor" d="M3 3h18v18H3zm16 16V5H5v14zM14 7h-4v4h4zm1 6H9v2H7v2h2v-2h6v2h2v-2h-2z"/>',hidden:!0},"avatar-circle":{body:'<path fill="currentColor" d="M6 2h12v2H6zm0 18h12v2H6zM2 6h2v12H2zm18 0h2v12h-2zM6 18h2v2H6zm10 0h2v2h-2zm2-14h2v2h-2zM4 4h2v2H4zm0 14h2v2H4zm14 0h2v2h-2zM8 16h8v2H8zm2-4h4v2h-4zM8 8h2v4H8zm2-2h4v2h-4zm4 2h2v4h-2z"/>'},"avatar-circle-minus":{body:'<g fill="currentColor"><path d="M6 2h12v2H6zm0 18h8v2H6zM2 6h2v12H2zm18 0h2v8h-2zM6 18h2v2H6zM18 4h2v2h-2zM4 4h2v2H4zm0 14h2v2H4zm14 0h2v2h-2zM8 16h6v2H8zm2-4h4v2h-4zM8 8h2v4H8zm2-2h4v2h-4zm4 2h2v4h-2z"/><path d="M16 18h6v2h-6z"/></g>'},"avatar-circle-minus-sharp":{body:'<g fill="currentColor"><path d="M6 2h12v2H6zm0 18h8v2H6zM2 6h2v12H2zm18 0h2v8h-2zM6 18h2v2H6zM18 4h2v2h-2zM4 4h2v2H4zm0 14h2v2H4zm14 0h2v2h-2zM6 16h8v2H6zm2-4h8v2H8zm0-4h2v4H8zm0-2h8v2H8zm6 2h2v4h-2z"/><path d="M16 18h6v2h-6z"/></g>'},"avatar-circle-plus":{body:'<g fill="currentColor"><path d="M6 2h12v2H6zm0 18h8v2H6zM2 6h2v12H2zm18 0h2v8h-2zM6 18h2v2H6zM18 4h2v2h-2zM4 4h2v2H4zm0 14h2v2H4zm14 0h2v2h-2zM8 16h6v2H8zm2-4h4v2h-4zM8 8h2v4H8zm2-2h4v2h-4zm4 2h2v4h-2z"/><path d="M18 16h2v6h-2z"/><path d="M16 18h6v2h-6z"/></g>'},"avatar-circle-plus-sharp":{body:'<g fill="currentColor"><path d="M6 2h12v2H6zm0 18h8v2H6zM2 6h2v12H2zm18 0h2v8h-2zM6 18h2v2H6zM18 4h2v2h-2zM4 4h2v2H4zm0 14h2v2H4zm14 0h2v2h-2zM6 16h8v2H6zm2-4h8v2H8zm0-4h2v4H8zm0-2h8v2H8zm6 2h2v4h-2z"/><path d="M18 16h2v6h-2z"/><path d="M16 18h6v2h-6z"/></g>'},"avatar-circle-sharp":{body:'<path fill="currentColor" d="M6 2h12v2H6zm0 18h12v2H6zM2 6h2v12H2zm18 0h2v12h-2zM6 18h2v2H6zm10 0h2v2h-2zm2-14h2v2h-2zM4 4h2v2H4zm0 14h2v2H4zm14 0h2v2h-2zM6 16h12v2H6zm2-4h8v2H8zm0-4h2v4H8zm0-2h8v2H8zm6 2h2v4h-2z"/>'},"avatar-circle-x":{body:'<path fill="currentColor" d="M6 2h12v2H6zm0 18h8v2H6zM2 6h2v12H2zm18 0h2v8h-2zM6 18h2v2H6zM18 4h2v2h-2zM4 4h2v2H4zm0 14h2v2H4zm4-2h6v2H8zm2-4h4v2h-4zM8 8h2v4H8zm2-2h4v2h-4zm4 2h2v4h-2zm4 10h2v2h-2zm-2-2h2v2h-2zm4 0h2v2h-2zm0 4h2v2h-2zm-4 0h2v2h-2z"/>'},"avatar-circle-x-sharp":{body:'<path fill="currentColor" d="M6 2h12v2H6zm0 18h8v2H6zM2 6h2v12H2zm18 0h2v8h-2zM6 18h2v2H6zM18 4h2v2h-2zM4 4h2v2H4zm0 14h2v2H4zm2-2h8v2H6zm2-4h8v2H8zm0-4h2v4H8zm0-2h8v2H8zm6 2h2v4h-2zm4 10h2v2h-2zm-2-2h2v2h-2zm4 0h2v2h-2zm0 4h2v2h-2zm-4 0h2v2h-2z"/>'},"avatar-square":{body:'<path fill="currentColor" d="M4 2h16v2H4zm0 18h16v2H4zM2 4h2v16H2zm18 0h2v16h-2zM6 18h2v2H6zm10 0h2v2h-2zm-8-2h8v2H8zm2-4h4v2h-4zM8 8h2v4H8zm2-2h4v2h-4zm4 2h2v4h-2z"/>'},"avatar-square-minus":{body:'<path fill="currentColor" d="M4 2h16v2H4zm0 18h10v2H4zM2 4h2v16H2zm18 0h2v10h-2zM6 18h2v2H6zm2-2h6v2H8zm2-4h4v2h-4zM8 8h2v4H8zm2-2h4v2h-4zm4 2h2v4h-2zm2 10h6v2h-6z"/>'},"avatar-square-minus-sharp":{body:'<path fill="currentColor" d="M2 2h20v2H2zm0 18h12v2H2zM2 4h2v16H2zm18 0h2v10h-2zM6 18h2v2H6zm0-2h8v2H6zm2-4h8v2H8zm0-4h2v4H8zm0-2h8v2H8zm6 2h2v4h-2zm2 10h6v2h-6z"/>'},"avatar-square-plus":{body:'<g fill="currentColor"><path d="M4 2h16v2H4zm0 18h10v2H4zM2 4h2v16H2zm18 0h2v10h-2zM6 18h2v2H6zm2-2h6v2H8zm2-4h4v2h-4zM8 8h2v4H8zm2-2h4v2h-4zm4 2h2v4h-2zm4 8h2v6h-2z"/><path d="M16 18h6v2h-6z"/></g>'},"avatar-square-plus-sharp":{body:'<g fill="currentColor"><path d="M2 2h20v2H2zm0 18h12v2H2zM2 4h2v16H2zm18 0h2v10h-2zM6 18h2v2H6zm0-2h8v2H6zm2-4h8v2H8zm0-4h2v4H8zm0-2h8v2H8zm6 2h2v4h-2zm4 8h2v6h-2z"/><path d="M16 18h6v2h-6z"/></g>'},"avatar-square-sharp":{body:'<path fill="currentColor" d="M2 2h20v2H2zm0 18h20v2H2zM2 4h2v16H2zm18 0h2v16h-2zM6 18h2v2H6zm10 0h2v2h-2zM6 16h12v2H6zm2-4h8v2H8zm0-4h2v4H8zm0-2h8v2H8zm6 2h2v4h-2z"/>'},"avatar-square-x":{body:'<path fill="currentColor" d="M4 2h16v2H4zm0 18h10v2H4zM2 4h2v16H2zm18 0h2v10h-2zM6 18h2v2H6zm2-2h6v2H8zm2-4h4v2h-4zM8 8h2v4H8zm2-2h4v2h-4zm4 2h2v4h-2zm4 10h2v2h-2zm-2-2h2v2h-2zm4 0h2v2h-2zm0 4h2v2h-2zm-4 0h2v2h-2z"/>'},"avatar-square-x-sharp":{body:'<path fill="currentColor" d="M2 2h20v2H2zm0 18h12v2H2zM2 4h2v16H2zm18 0h2v10h-2zM6 18h2v2H6zm0-2h8v2H6zm2-4h8v2H8zm0-4h2v4H8zm0-2h8v2H8zm6 2h2v4h-2zm4 10h2v2h-2zm-2-2h2v2h-2zm4 0h2v2h-2zm0 4h2v2h-2zm-4 0h2v2h-2z"/>'},backburger:{body:'<path fill="currentColor" d="M11 7h10v2H11zm-8 4h2V9h2v2h14v2H7v2H5v-2H3zm4 4v2h2v-2zm0-6V7h2v2zm14 6H11v2h10z"/>',hidden:!0},backpack:{body:'<g fill="currentColor"><path d="M5 6h14v2H5zM3 8h2v12H3zm2 12h14v2H5zM19 8h2v12h-2z"/><path d="M7 16h2v6H7zm8 0h2v6h-2zm-6-2h6v2H9zm-2-4h10v2H7zm1-6h2v2H8zm6 0h2v2h-2zm-4-2h4v2h-4z"/></g>'},"backpack-sharp":{body:'<g fill="currentColor"><path d="M3 6h18v2H3zm0 2h2v12H3zm0 12h18v2H3zM19 8h2v12h-2z"/><path d="M7 16h2v6H7zm8 0h2v6h-2zm-8-2h10v2H7zm0-4h10v2H7zm1-6h2v2H8zm6 0h2v2h-2zM8 2h8v2H8z"/></g>'},"badge-4k":{body:'<path fill="currentColor" d="M3 4h18v2H3zm0 14h18v2H3zM1 6h2v12H1zm20 0h2v12h-2zM5 8h2v5H5zm4 0h2v8H9zm4 0h2v8h-2zm4 0h2v3h-2zm0 5h2v3h-2zm-2-2h2v2h-2zm-8 0h2v2H7z"/>'},"badge-4k-sharp":{body:'<path fill="currentColor" d="M1 4h22v2H1zm0 14h22v2H1zM1 6h2v12H1zm20 0h2v12h-2zM5 8h2v5H5zm4 0h2v8H9zm4 0h2v8h-2zm4 0h2v3h-2zm0 5h2v3h-2zm-2-2h2v2h-2zm-8 0h2v2H7z"/>'},"badge-5k":{body:'<path fill="currentColor" d="M3 4h18v2H3zm0 14h18v2H3zM1 6h2v12H1zm20 0h2v12h-2zM5 8h2v5H5zm4 3h2v3H9zm4-3h2v8h-2zm4 0h2v3h-2zm0 5h2v3h-2zm-2-2h2v2h-2zm-8 0h2v2H7zm0-3h4v2H7zm-2 6h4v2H5z"/>'},"badge-5k-sharp":{body:'<path fill="currentColor" d="M1 4h22v2H1zm0 14h22v2H1zM1 6h2v12H1zm20 0h2v12h-2zM5 8h2v5H5zm4 3h2v3H9zm4-3h2v8h-2zm4 0h2v3h-2zm0 5h2v3h-2zm-2-2h2v2h-2zm-8 0h2v2H7zm0-3h4v2H7zm-2 6h4v2H5z"/>'},"badge-captions":{body:'<path fill="currentColor" d="M3 4h18v2H3zm0 14h18v2H3zM1 6h2v12H1zm20 0h2v12h-2zm-6 8h4v2h-4zM5 10h4v2H5zm0 4h8v2H5zm6-4h8v2h-8z"/>'},"badge-captions-sharp":{body:'<path fill="currentColor" d="M1 4h22v2H1zm0 14h22v2H1zM1 6h2v12H1zm20 0h2v12h-2zm-6 8h4v2h-4zM5 10h4v2H5zm0 4h8v2H5zm6-4h8v2h-8z"/>'},"badge-hd":{body:'<path fill="currentColor" d="M3 4h18v2H3zm0 14h18v2H3zM1 6h2v12H1zm20 0h2v12h-2zM5 8h2v8H5zm4 0h2v8H9zm4 0h2v8h-2zm2 0h2v2h-2zm0 6h2v2h-2zm2-4h2v4h-2zM7 11h2v2H7z"/>'},"badge-hd-sharp":{body:'<path fill="currentColor" d="M1 4h22v2H1zm0 14h22v2H1zM1 6h2v12H1zm20 0h2v12h-2zM5 8h2v8H5zm4 0h2v8H9zm4 0h2v8h-2zm2 0h2v2h-2zm0 6h2v2h-2zm2-4h2v4h-2zM7 11h2v2H7z"/>'},balloon:{body:'<path fill="currentColor" d="M9 1h6v2H9zM7 3h2v2H7zm8 0h2v2h-2zm-4 2h2v2h-2zm2 2h2v2h-2zM5 5h2v8H5zm12 0h2v8h-2zM7 13h2v2H7zm2 2h2v2H9zm4 4h4v2h-4zm-2-4h4v2h-4zm4-2h2v2h-2zm2 8h2v2h-2zm-6-4h2v2h-2z"/>'},banknote:{body:'<path fill="currentColor" d="M3 5h18v2H3zM1 7h2v10H1zm2 10h18v2H3zM21 7h2v10h-2zM11 9h2v2h-2zm-2 2h2v2H9zm2 2h2v2h-2zm2-2h2v2h-2zm4 0h2v2h-2zM5 11h2v2H5z"/>'},"banknote-sharp":{body:'<path fill="currentColor" d="M1 5h22v2H1zm0 2h2v10H1zm0 10h22v2H1zM21 7h2v10h-2zM9 9h6v2H9zm0 2h2v2H9zm0 2h6v2H9zm4-2h2v2h-2zm4 0h2v2h-2zM5 11h2v2H5z"/>'},barcode:{body:'<path fill="currentColor" d="M2 4h2v16H2zm4 0h3v16H6zm5 0h3v16h-3zm5 0h2v16h-2zm4 0h2v16h-2z"/>'},battery:{body:'<path fill="currentColor" d="M4 5h14v2H4zm0 12h14v2H4zM2 7h2v10H2zm16-2h2v14h-2zm2 4h2v6h-2z"/>'},"battery-1":{body:'<path fill="currentColor" d="M4 5H2v14h18v-4h2V9h-2V5zm14 2v10H4V7zM8 9H6v6h2z"/>',hidden:!0},"battery-2":{body:'<path fill="currentColor" d="M4 5H2v14h18v-4h2V9h-2V5zm14 2v10H4V7zM6 9h2v6H6zm6 0h-2v6h2z"/>',hidden:!0},"battery-charging":{body:'<path fill="currentColor" d="M4 5H2v14h6v-2H4V7h4V5zm10 0h6v4h2v6h-2v4h-6v-2h4V7h-4zm-4 2h2v4h4v2h-2v2h-2v2h-2v-4H6v-2h2V9h2z"/>',hidden:!0},"battery-full":{body:'<path fill="currentColor" d="M4 5h14v2H4zm0 12h14v2H4zM2 7h2v10H2zm16-2h2v14h-2zm2 4h2v6h-2zM6 9h2v6H6zm4 0h2v6h-2zm4 0h2v6h-2z"/>'},"battery-full-sharp":{body:'<path fill="currentColor" d="M4 5h14v2H4zm0 12h14v2H4zM2 5h2v14H2zm16 0h2v14h-2zm2 4h2v6h-2zM6 9h2v6H6zm4 0h2v6h-2zm4 0h2v6h-2z"/>'},"battery-low":{body:'<path fill="currentColor" d="M4 5h14v2H4zm0 12h14v2H4zM2 7h2v10H2zm16-2h2v14h-2zm2 4h2v6h-2zM6 9h2v6H6z"/>'},"battery-low-sharp":{body:'<path fill="currentColor" d="M4 5h14v2H4zm0 12h14v2H4zM2 5h2v14H2zm16 0h2v14h-2zm2 4h2v6h-2zM6 9h2v6H6z"/>'},"battery-medium":{body:'<path fill="currentColor" d="M4 5h14v2H4zm0 12h14v2H4zM2 7h2v10H2zm16-2h2v14h-2zm2 4h2v6h-2zM6 9h2v6H6zm4 0h2v6h-2z"/>'},"battery-medium-sharp":{body:'<path fill="currentColor" d="M4 5h14v2H4zm0 12h14v2H4zM2 5h2v14H2zm16 0h2v14h-2zm2 4h2v6h-2zM6 9h2v6H6zm4 0h2v6h-2z"/>'},"battery-sharp":{body:'<path fill="currentColor" d="M4 5h14v2H4zm0 12h14v2H4zM2 5h2v14H2zm16 0h2v14h-2zm2 4h2v6h-2z"/>'},bed:{body:'<g fill="currentColor"><path d="M2 4h2v16H2zm18 6h2v10h-2z"/><path d="M2 16h20v2H2zm2-8h16v2H4zm2 2h2v6H6z"/></g>'},"bed-sharp":{body:'<g fill="currentColor"><path d="M2 4h2v16H2zm18 6h2v10h-2z"/><path d="M2 16h20v2H2zm2-8h18v2H4zm2 2h2v6H6z"/></g>'},bell:{body:'<g fill="currentColor"><path d="M9 2h6v2H9zM7 4h2v2H7zm8 0h2v2h-2zM5 6h2v7H5zm12 0h2v7h-2zM3 13h2v4H3zm16 0h2v4h-2z"/><path d="M3 15h18v2H3zm5 3h2v2H8zm6 0h2v2h-2zm-4 2h4v2h-4z"/></g>'},"bell-off":{body:'<g fill="currentColor"><path d="M9 2h6v2H9zm6 2h2v2h-2zM5 6h2v7H5zm12 0h2v6h-2zM3 13h2v4H3z"/><path d="M3 15h14v2H3zm5 3h2v2H8zm6 0h2v2h-2zm-4 2h4v2h-4zM5 4h2v2H5zm2 2h2v2H7zm2 2h2v2H9zm2 2h2v2h-2zm2 2h2v2h-2z"/><path d="M15 14h2v2h-2zm2 2h2v2h-2zm2 2h2v2h-2zM3 2h2v2H3z"/></g>'},"bell-off-sharp":{body:'<g fill="currentColor"><path d="M9 2h6v2H9zm6 2h2v2h-2zM5 6h2v7H5zm12 0h2v6h-2zM3 13h2v4H3z"/><path d="M3 15h14v2H3zm5 3h2v2H8zm6 0h2v2h-2zm-6 2h8v2H8zM5 4h2v2H5zm2 2h2v2H7zm2 2h2v2H9zm2 2h2v2h-2zm2 2h2v2h-2z"/><path d="M15 14h2v2h-2zm2 2h2v2h-2zm2 2h2v2h-2zM3 2h2v2H3z"/></g>'},"bell-ring":{body:'<path fill="currentColor" d="M14 22h-4v-2h4zm-4-2H8v-2h2zm6 0h-2v-2h2zM5 15h14v-2h2v4H3v-4h2zm2-2H5V6h2zm12 0h-2V6h2zM3 6H1V4h2zm6 0H7V4h2zm8 0h-2V4h2zm6 0h-2V4h2zM5 4H3V2h2zm10 0H9V2h6zm6 0h-2V2h2z"/>'},"bell-ring-sharp":{body:'<path fill="currentColor" d="M16 22H8v-4h2v2h4v-2h2zM5 15h14v-2h2v4H3v-4h2zm2-2H5V6h2zm12 0h-2V6h2zM3 6H1V4h2zm6 0H7V4h2zm8 0h-2V4h2zm6 0h-2V4h2zM5 4H3V2h2zm10 0H9V2h6zm6 0h-2V2h2z"/>'},"bell-sharp":{body:'<g fill="currentColor"><path d="M9 2h6v2H9zM7 4h2v2H7zm8 0h2v2h-2zM5 6h2v7H5zm12 0h2v7h-2zM3 13h2v4H3zm16 0h2v4h-2z"/><path d="M3 15h18v2H3zm5 3h2v2H8zm6 0h2v2h-2zm-6 2h8v2H8z"/></g>'},binary:{body:'<path fill="currentColor" d="M7 3h2v2H7zm8 10h2v2h-2zM5 5h2v4H5zm8 10h2v4h-2zM9 5h2v4H9zm8 10h2v4h-2zM7 9h2v2H7zm8 10h2v2h-2zM13 3h4v2h-4zM5 13h4v2H5zm10-8h2v4h-2zM7 15h2v4H7zm6-6h6v2h-6zM5 19h6v2H5z"/>'},"binary-sharp":{body:'<path fill="currentColor" d="M5 3h6v2H5zm8 10h6v2h-6zM5 5h2v4H5zm8 10h2v4h-2zM9 5h2v4H9zm8 10h2v4h-2zM5 9h6v2H5zm8 10h6v2h-6zm0-16h4v2h-4zM5 13h4v2H5zm10-8h2v4h-2zM7 15h2v4H7zm6-6h6v2h-6zM5 19h6v2H5z"/>'},bitcoin:{body:'<path fill="currentColor" d="M13 3h2v2h2v2H9v4h8v2H9v4h8v2h-2v2h-2v-2h-2v2H9v-2H5v-2h2v-4H5v-2h2V7H5V5h4V3h2v2h2zm4 14v-4h2v4zm0-6V7h2v4z"/>',hidden:!0},blocks:{body:'<g fill="currentColor"><path d="M15 1h6v2h-6zm-2 2h2v6h-2zm2 6h6v2h-6zm6-6h2v6h-2zM3 5h6v2H3zM1 7h2v14H1zm2 14h14v2H3zm14-6h2v6h-2zM3 13h14v2H3z"/><path d="M9 7h2v14H9z"/></g>'},"blocks-sharp":{body:'<g fill="currentColor"><path d="M13 1h10v2H13zm0 2h2v6h-2zm0 6h10v2H13zm8-6h2v6h-2zM1 5h10v2H1zm0 2h2v16H1zm2 14h14v2H3zm14-8h2v10h-2zM3 13h14v2H3z"/><path d="M9 7h2v14H9z"/></g>'},bluesky:{body:'<path fill="currentColor" d="M11 15h2v2h-2zm5-2h2v2h-2zm-8 0H6v2h2zm10-2h2v2h-2zM6 11H4v2h2zm14-6h2v6h-2zM4 5H2v6h2zm9 12h2v2h-2zm-2 0H9v2h2zm7-2h2v4h-2zM6 15H4v4h2zm9 4h3v2h-3zm-6 0H6v2h3zm8-16h3v2h-3zM7 3H4v2h3zm8 2h2v2h-2zM9 5H7v2h2zm4 2h2v2h-2zm-2 0H9v2h2zm0 2h2v2h-2z"/>'},bluetooth:{body:'<path fill="currentColor" d="M15 3h-2v2h2v2h2v2h-2v2h2V9h2V7h-2V5h-2zm-2 0h-2v6H9V7H7V5H5v2h2v2h2v2h2v2H9v2H7v2H5v2h2v-2h2v-2h2v6h2zm2 8h-2v2h2v2h2v2h-2v2h-2v2h2v-2h2v-2h2v-2h-2v-2h-2z"/>',hidden:!0},bomb:{body:'<path fill="currentColor" d="M12 6h2v4h2v2h2v6h-2v2h-2v2H6v-2H4v-2H2v-6h2v-2h2V6h4V4h2zm0 10h2v-2h-2zm-2-2h2v-2h-2zm12-1h-2v-2h2zm0-3h-2V6h2zm-2-4h-2V4h2zm-2-2h-6V2h6z"/>'},book:{body:'<path fill="currentColor" d="M8 2h12v20H4V2zm4 8h-2v2H8V4H6v16h12V4h-4v8h-2z"/>',hidden:!0},"book-open":{body:'<path fill="currentColor" d="M2 3h9v2H2zM0 19h11v2H0zM13 3h9v2h-9zm0 16h11v2H13zM11 5h2v18h-2zM0 5h2v14H0zm22 0h2v14h-2zm-7 2h5v2h-5zm0 4h5v2h-5zm0 4h2v2h-2z"/>'},"book-open-sharp":{body:'<g fill="currentColor"><path d="M0 3h13v2H0zm0 16h11v2H0z"/><path d="M11 3h13v2H11zm2 16h11v2H13zM11 5h2v18h-2zM0 5h2v14H0zm22 0h2v14h-2zm-7 2h5v2h-5zm0 4h5v2h-5zm0 4h2v2h-2z"/></g>'},bookmark:{body:'<path fill="currentColor" d="M6 2h12v2H6zM4 4h2v18H4zm14 0h2v18h-2zm-2 16h2v2h-2zm-2-2h2v2h-2zm-8 2h2v2H6zm2-2h2v2H8zm2-2h4v2h-4z"/>'},"bookmark-sharp":{body:'<path fill="currentColor" d="M4 2h16v2H4zm0 2h2v18H4zm14 0h2v18h-2zm-2 16h2v2h-2zm-2-2h2v2h-2zm-8 2h2v2H6zm2-2h2v2H8zm2-2h4v2h-4z"/>'},bookmarks:{body:'<path fill="currentColor" d="M21 18V2H7v2h12v14zM5 6H3v16h4v-2h2v-2h2v2h2v2h4V6zm8 14v-2h-2v-2H9v2H7v2H5V8h10v12z"/>',hidden:!0},"bottle-wine":{body:'<path fill="currentColor" d="M9 1h6v2H9zm0 2h2v4H9zm4 0h2v4h-2zM7 7h2v2H7zm8 0h2v2h-2zm2 2h2v12h-2zM5 9h2v12H5zm2 12h10v2H7z"/>'},"bottle-wine-sharp":{body:'<path fill="currentColor" d="M9 1h6v2H9zm0 2h2v4H9zm4 0h2v4h-2zM7 7h2v2H7zm8 0h2v2h-2zm2 2h2v12h-2zM5 9h2v12H5zm0 12h14v2H5z"/>'},box:{body:'<g fill="currentColor"><path d="M14 4h4v2h-4zm-4-2h4v2h-4zM6 8h4v2H6zm0 10h4v2H6zm4-8h4v2h-4zm0 10h4v2h-4zm4-12h4v2h-4zm0 10h4v2h-4zM6 4h4v2H6zM2 6h4v2H2zm0 10h4v2H2zM18 6h4v2h-4zm0 10h4v2h-4z"/><path d="M2 6h2v12H2zm18 0h2v12h-2zm-8 6h2v8h-2z"/></g>'},braces:{body:'<path fill="currentColor" d="M6 4h4v2H6zm12 0h-4v2h4zM6 20h4v-2H6zm12 0h-4v-2h4zM4 6h2v5H4zm16 0h-2v5h2zM4 18h2v-5H4zm16 0h-2v-5h2zM2 11h2v2H2zm20 0h-2v2h2z"/>'},"braces-content":{body:'<path fill="currentColor" d="M5 4h4v2H5zm14 0h-4v2h4zM5 20h4v-2H5zm14 0h-4v-2h4zM3 6h2v5H3zm18 0h-2v5h2zM3 18h2v-5H3zm18 0h-2v-5h2zM1 11h2v2H1zm10 0h2v2h-2zm-4 0h2v2H7zm8 0h2v2h-2zm8 0h-2v2h2z"/>'},"braces-content-sharp":{body:'<path fill="currentColor" d="M3 4h6v2H3zm18 0h-6v2h6zM3 20h6v-2H3zm18 0h-6v-2h6zM3 6h2v5H3zm18 0h-2v5h2zM3 18h2v-5H3zm18 0h-2v-5h2zM1 11h2v2H1zm10 0h2v2h-2zm-4 0h2v2H7zm8 0h2v2h-2zm8 0h-2v2h2z"/>'},"braces-off":{body:'<g fill="currentColor"><path d="M8 3h2v2H8zm10 0h-4v2h4zM6 21h4v-2H6zm12 0h-4v-2h4zM4 5h2v6H4zm16 0h-2v6h2zM4 19h2v-6H4zm16-4h-2v-2h2zM2 11h2v2H2zm20 0h-2v2h2zM2 3h2v2H2z"/><path d="M4 5h2v2H4zm2 2h2v2H6zm2 2h2v2H8zm2 2h2v2h-2zm2 2h2v2h-2zm2 2h2v2h-2zm2 2h2v2h-2zm2 2h2v2h-2z"/></g>'},"braces-off-sharp":{body:'<g fill="currentColor"><path d="M8 3h2v2H8zm12 0h-6v2h6zM4 21h6v-2H4zm14 0h-4v-2h4zM4 5h2v6H4zm16 0h-2v6h2zM4 19h2v-6H4zm16-4h-2v-2h2zM2 11h2v2H2zm20 0h-2v2h2zM2 3h2v2H2z"/><path d="M4 5h2v2H4zm2 2h2v2H6zm2 2h2v2H8zm2 2h2v2h-2zm2 2h2v2h-2zm2 2h2v2h-2zm2 2h2v2h-2zm2 2h2v2h-2z"/></g>'},"braces-sharp":{body:'<path fill="currentColor" d="M4 4h6v2H4zm16 0h-6v2h6zM4 20h6v-2H4zm16 0h-6v-2h6zM4 6h2v5H4zm16 0h-2v5h2zM4 18h2v-5H4zm16 0h-2v-5h2zM2 11h2v2H2zm20 0h-2v2h2z"/>'},brackets:{body:'<path fill="currentColor" d="M5 4h4v2H5zm14 0h-4v2h4zM5 20h4v-2H5zm14 0h-4v-2h4zM3 6h2v12H3zm18 0h-2v12h2z"/>'},"brackets-angle":{body:'<path fill="currentColor" d="M8 5h2v2H8zM6 7h2v2H6zM4 9h2v2H4zm-2 2h2v2H2zm2 2h2v2H4zm2 2h2v2H6zm2 2h2v2H8zm8-12h-2v2h2zm2 2h-2v2h2zm2 2h-2v2h2zm2 2h-2v2h2zm-2 2h-2v2h2zm-2 2h-2v2h2zm-2 2h-2v2h2z"/>'},"brackets-angle-off":{body:'<path fill="currentColor" d="M2 1h2v2H2zm2 2h2v2H4zm2 2h2v2H6zm2 2h2v2H8zm2 2h2v2h-2zm2 2h2v2h-2zm2 2h2v2h-2zm2 2h2v2h-2zm2 2h2v2h-2zm2 2h2v2h-2zM4 9h2v2H4zm2-2h2v2H6zm-4 4h2v2H2zm2 2h2v2H4zm2 2h2v2H6zm2 2h2v2H8zm6 0h2v2h-2zm6-6h2v2h-2zm-2-2h2v2h-2zm-2-2h2v2h-2zm-2-2h2v2h-2z"/>'},"brackets-content":{body:'<path fill="currentColor" d="M5 4h4v2H5zm14 0h-4v2h4zM5 20h4v-2H5zm14 0h-4v-2h4zM3 6h2v12H3zm18 0h-2v12h2zm-10 5h2v2h-2zm-4 0h2v2H7zm8 0h2v2h-2z"/>'},"brackets-content-sharp":{body:'<path fill="currentColor" d="M3 4h6v2H3zm18 0h-6v2h6zM3 20h6v-2H3zm18 0h-6v-2h6zM3 6h2v12H3zm18 0h-2v12h2zm-10 5h2v2h-2zm-4 0h2v2H7zm8 0h2v2h-2z"/>'},"brackets-off":{body:'<path fill="currentColor" d="M19 3h-4v2h4zM5 21h4v-2H5zm14 0h-4v-2h4zM3 5h2v14H3zm18 0h-2v10h2zM3 3h2v2H3zm2 2h2v2H5zm2 2h2v2H7zm2 2h2v2H9zm2 2h2v2h-2zm2 2h2v2h-2zm2 2h2v2h-2zm2 2h2v2h-2zm2 2h2v2h-2z"/>'},"brackets-off-sharp":{body:'<path fill="currentColor" d="M21 3h-6v2h6zM3 21h6v-2H3zm16 0h-4v-2h4zM3 5h2v14H3zm18 0h-2v10h2zM3 3h2v2H3zm2 2h2v2H5zm2 2h2v2H7zm2 2h2v2H9zm2 2h2v2h-2zm2 2h2v2h-2zm2 2h2v2h-2zm2 2h2v2h-2zm2 2h2v2h-2z"/>'},"brackets-sharp":{body:'<path fill="currentColor" d="M3 4h6v2H3zm18 0h-6v2h6zM3 20h6v-2H3zm18 0h-6v-2h6zM3 6h2v12H3zm18 0h-2v12h2z"/>'},briefcase:{body:'<path fill="currentColor" d="M2 8h2v12H2zm18 0h2v12h-2zM4 6h16v2H4zm0 14h16v2H4zM8 4h2v2H8zm2-2h4v2h-4zm4 2h2v2h-2z"/>'},"briefcase-account":{body:'<path fill="currentColor" d="M16 3H8v4H2v14h20V7h-6zm-2 4h-4V5h4zM4 19V9h16v10zm6-8h4v3h-4zm-2 4h8v2H8z"/>',hidden:!0},"briefcase-check":{body:'<path fill="currentColor" d="M16 3H8v4H2v14h20V7h-6zm-2 4h-4V5h4zM4 19V9h16v10zm10-8h2v2h-2zm-2 4v-2h2v2zm-2 0h2v2h-2zm0 0H8v-2h2z"/>',hidden:!0},"briefcase-delete":{body:'<path fill="currentColor" d="M16 3H8v4H2v14h12v-2H4V9h16v4h2V7h-6zm-2 4h-4V5h4zm4 8h-2v2h2v2h-2v2h2v-2h2v2h2v-2h-2v-2h2v-2h-2v2h-2z"/>',hidden:!0},"briefcase-download":{body:'<path fill="currentColor" d="M8 3h8v4h6v14h-5v-2h3V9H4v10h3v2H2V7h6zm6 2h-4v2h4zm-3 6h2v6h2v2h-2v2h-2v-2H9v-2h2zm-2 6H7v-2h2zm6 0v-2h2v2z"/>',hidden:!0},"briefcase-minus":{body:'<path fill="currentColor" d="M8 3h8v4h6v6h-2V9H4v10h10v2H2V7h6zm6 2h-4v2h4zm2 12h6v2h-6z"/>',hidden:!0},"briefcase-plus":{body:'<path fill="currentColor" d="M8 3h8v4h6v4h-2V9H4v10h8v2H2V7h6zm2 4h4V5h-4zm7 14h2v-3h3v-2h-3v-3h-2v3h-3v2h3z"/>',hidden:!0},"briefcase-search":{body:'<path fill="currentColor" d="M16 3H8v4H2v14h10v-2H4V9h16v2h2V7h-6zm-2 4h-4V5h4zm6 6h-6v6h6v2h2v-2h-2zm-4 4v-2h2v2z"/>',hidden:!0},"briefcase-search-1":{body:'<path fill="currentColor" d="M16 3H8v4H2v14h7v-2H4V9h18V7h-6zm-2 4h-4V5h4zm0 4h8v2h-8zm0 10h-2v-8h2zm8 0v2h-8v-2zm0 0h2v-8h-2zm-6-6h2v2h2v2h-4z"/>',hidden:!0},"briefcase-sharp":{body:'<path fill="currentColor" d="M2 8h2v12H2zm18 0h2v12h-2zM2 6h20v2H2zm0 14h20v2H2zM8 4h2v2H8zm0-2h8v2H8zm6 2h2v2h-2z"/>'},"briefcase-upload":{body:'<path fill="currentColor" d="M8 3h8v4h6v14h-5v-2h3V9H4v10h3v2H2V7h6zm6 2h-4v2h4zm-3 16h2v-6h2v2h2v-2h-2v-2h-2v-2h-2v2H9v2H7v2h2v-2h2z"/>',hidden:!0},briefcases:{body:'<path fill="currentColor" d="M6 8h2v8H6zm14 0h2v8h-2zM8 6h12v2H8zm0 10h12v2H8zm-6-4h2v8H2zm2 8h12v2H4zm6-16h2v2h-2zm2-2h4v2h-4zm4 2h2v2h-2zM4 10h2v2H4zm12 8h2v2h-2z"/>'},"briefcases-sharp":{body:'<path fill="currentColor" d="M6 8h2v8H6zm14 0h2v8h-2zM6 6h16v2H6zm0 10h16v2H6zm-4-4h2v8H2zm0 8h16v2H2zm8-16h2v2h-2zm0-2h8v2h-8zm6 2h2v2h-2zM2 10h4v2H2zm14 8h2v2h-2z"/>'},brush:{body:'<g fill="currentColor"><path d="M7 2h10v2H7zM5 4h2v10H5zm12-2h2v12h-2z"/><path d="M13 2h2v6h-2zM9 2h2v4H9zm-4 8h14v2H5zm2 4h10v2H7zm2 2h2v4H9zm4 0h2v4h-2zm-4 4h6v2H9z"/></g>'},"brush-sharp":{body:'<g fill="currentColor"><path d="M5 2h12v2H5zm0 2h2v10H5zm12-2h2v12h-2z"/><path d="M13 2h2v6h-2zM9 2h2v4H9zm-4 8h14v2H5zm0 4h14v2H5zm4 2h2v4H9zm4 0h2v4h-2zm-4 4h6v2H9z"/></g>'},bug:{body:'<g fill="currentColor"><path d="M2 5h2v4H2zm20 0h-2v4h2zM4 9h2v2H4zm16 0h-2v2h2zM2 13h4v2H2zm20 0h-4v2h4zM4 17h2v2H4zm16 0h-2v2h2zM2 19h2v2H2zm20 0h-2v2h2zM6 11h12v2H6z"/><path d="M6 7h2v12H6zm10 0h2v12h-2zM8 19h8v2H8zM8 5h8v2H8z"/><path d="M11 15h2v6h-2zM8 1h2v6H8zm6 0h2v6h-2z"/></g>'},"bug-sharp":{body:'<g fill="currentColor"><path d="M2 5h2v4H2zm20 0h-2v4h2zM2 9h4v2H2zm20 0h-4v2h4zM2 13h4v2H2zm20 0h-4v2h4zM2 17h4v2H2zm20 0h-4v2h4zM2 19h2v2H2zm20 0h-2v2h2zM6 11h12v2H6z"/><path d="M6 5h2v14H6zm10 0h2v14h-2zM6 19h12v2H6zM8 5h8v2H8z"/><path d="M11 15h2v6h-2zM8 1h2v6H8zm6 0h2v6h-2z"/></g>'},building:{body:'<path fill="currentColor" d="M5 2h14v2H5zm0 18h14v2H5zM3 4h2v16H3zm16 0h2v16h-2zM7 6h2v2H7zm4 0h2v2h-2zm4 0h2v2h-2zm-8 4h2v2H7zm4 0h2v2h-2zm4 0h2v2h-2zm-8 4h2v2H7zm4 0h2v2h-2zm-1 4h4v2h-4zm5-4h2v2h-2z"/>'},"building-community":{body:'<path fill="currentColor" d="M4 20h16v2H4zM20 4h2v16h-2zM10 2h10v2H10zM8 8h2v2H8zm0-4h2v2H8zm2 6h2v2h-2zm2 2h2v2h-2zm2 2h2v6h-2zm-8-4h2v2H6zm-2 2h2v2H4zm-2 2h2v6H2zm14-8h2v2h-2zm-4 0h2v2h-2zm4 4h2v2h-2zm-8 6h2v4H8z"/>'},"building-community-sharp":{body:'<path fill="currentColor" d="M2 20h20v2H2zM20 4h2v16h-2zM8 2h14v2H8zm0 6h2v2H8zm0-4h2v2H8zm2 6h2v2h-2zm2 2h2v2h-2zm2 2h2v6h-2zm-8-4h2v2H6zm-2 2h2v2H4zm-2 2h2v6H2zm14-8h2v2h-2zm-4 0h2v2h-2zm4 4h2v2h-2zm-8 6h2v4H8z"/>'},"building-sharp":{body:'<path fill="currentColor" d="M3 2h18v2H3zm0 18h18v2H3zM3 4h2v16H3zm16 0h2v16h-2zM7 6h2v2H7zm4 0h2v2h-2zm4 0h2v2h-2zm-8 4h2v2H7zm4 0h2v2h-2zm4 0h2v2h-2zm-8 4h2v2H7zm4 0h2v2h-2zm-1 4h4v2h-4zm5-4h2v2h-2z"/>'},"building-skyscraper":{body:'<path fill="currentColor" d="M10 2h4v5h2v2h-2v11h4v-9h2v9h2v2H2v-2h2V8h2v12h6V4h-2zM8 6V4h2v2zm0 0H6v2h2zm10 5h-2V9h2zm-8-1H8v2h2zm-2 4h2v2H8z"/>',hidden:!0},buildings:{body:'<path fill="currentColor" d="M2 2h14v4h6v16H2zm18 6h-4v2h2v2h-2v2h2v2h-2v2h2v2h2zm-6-4H4v16h2v-2h6v2h2zM6 6h2v2H6zm6 0h-2v2h2zm-6 4h2v2H6zm6 0h-2v2h2zm-6 4h2v2H6zm6 0h-2v2h2z"/>',hidden:!0},bulletlist:{body:'<path fill="currentColor" d="M10 5h12v2H10zm0 4h8v2h-8zm0 4h12v2H10zm0 4h8v2h-8zm-4-6H4V9h2zM4 9H2V7h2zm4 0H6V7h2zM6 7H4V5h2zm-2 6h2v2H4zm0 4h2v2H4zm-2 0v-2h2v2zm4 0v-2h2v2z"/>'},"bulletlist-sharp":{body:'<path fill="currentColor" d="M10 5h12v2H10zm0 4h8v2h-8zm0 4h12v2H10zm0 4h8v2h-8zM4 7v2h2V7zm4 4H2V5h6zm-6 2h6v2H2zm0 4h6v2H2zm0 0v-2h2v2zm4 0v-2h2v2z"/>'},bullseye:{body:'<path fill="currentColor" d="M18 2H6v2H4v2H2v12h2v2h2v2h12v-2h2v-2h2V6h-2V4h-2zm0 2v2h2v12h-2v2H6v-2H4V6h2V4zm-8 6h4v4h-4zM8 6h8v2H8zm0 10H6V8h2zm8 0v2H8v-2zm0 0h2V8h-2z"/>',hidden:!0},"bullseye-arrow":{body:'<path fill="currentColor" d="M6 2h10v2H6zM4 6V4h2v2zm0 12H2V6h2zm2 2H4v-2h2zm12 0H6v2h12zm2-2v2h-2v-2zm0 0h2V8h-2zM12 6H8v2H6v8h2v2h8v-2h2v-4h-2v4H8V8h4zm2 8v-4h2V8h2V6h4V4h-2V2h-2v4h-2v2h-2v2h-4v4z"/>',hidden:!0},bus:{body:'<path fill="currentColor" d="M4 15h6v2H4zm10 0h6v2h-6zM4 19h6v2H4zm10 0h6v2h-6zM0 7h2v10H0zm2-2h18v2H2zm20 4h2v8h-2zM2 11h20v2H2zm2 6h2v2H4zm4 0h8v2H8zm-6 0h2v2H2zm16 0h4v2h-4zm2-10h2v2h-2zm-6 0h2v4h-2zM7 7h2v4H7z"/>'},"bus-sharp":{body:'<path fill="currentColor" d="M4 15h6v2H4zm10 0h6v2h-6zM4 19h6v2H4zm10 0h6v2h-6zM0 7h2v10H0zm0-2h22v2H0zm22 2h2v10h-2zM2 11h20v2H2zm2 6h2v2H4zm4 0h8v2H8zm-8 0h4v2H0zm18 0h6v2h-6zM14 7h2v4h-2zM7 7h2v4H7z"/>'},cake:{body:'<path fill="currentColor" d="M1 20h22v2H1zm2-8h2v8H3zm2-2h14v2H5zm14 2h2v8h-2zm-8-5h2v3h-2zM7 7h2v3H7zm8 0h2v3h-2zM7 3h2v2H7zm4 0h2v2h-2zm4 0h2v2h-2zM5 14h2v2H5zm2 2h4v2H7zm4-2h6v2h-6zm6 2h2v2h-2z"/>'},"cake-sharp":{body:'<path fill="currentColor" d="M1 20h22v2H1zm2-8h2v8H3zm0-2h18v2H3zm16 2h2v8h-2zm-8-5h2v3h-2zM7 7h2v3H7zm8 0h2v3h-2zM7 3h2v2H7zm4 0h2v2h-2zm4 0h2v2h-2zM5 14h2v2H5zm2 2h4v2H7zm4-2h6v2h-6zm6 2h2v2h-2z"/>'},calculator:{body:'<path fill="currentColor" d="M5 2h14v2H5zm0 18h14v2H5zM3 4h2v16H3zm16 0h2v16h-2zM7 6h10v4H7zm0 6h2v2H7zm4 0h2v2h-2zm4 0h2v2h-2zm-8 4h2v2H7zm4 0h2v2h-2zm4 0h2v2h-2z"/>'},"calculator-sharp":{body:'<path fill="currentColor" d="M3 2h18v2H3zm0 18h18v2H3zM3 4h2v16H3zm16 0h2v16h-2zM7 6h10v4H7zm0 6h2v2H7zm4 0h2v2h-2zm4 0h2v2h-2zm-8 4h2v2H7zm4 0h2v2h-2zm4 0h2v2h-2z"/>'},calendar:{body:'<path fill="currentColor" d="M5 4h14v2H5zm0 16h14v2H5zM3 10h2v10H3zm0-4h2v2H3zm16 0h2v2h-2zm0 4h2v10h-2zM3 8h18v2H3zm12-6h2v2h-2zM7 2h2v2H7z"/>'},"calendar-2":{body:'<path fill="currentColor" d="M5 4h14v2H5zm0 16h14v2H5zM3 10h2v10H3zm0-4h2v2H3zm16 0h2v2h-2zm0 4h2v10h-2zM3 8h18v2H3zm12-6h2v2h-2zM7 2h2v2H7zm0 10h2v2H7zm0 4h2v2H7zm4-4h2v2h-2zm0 4h2v2h-2zm4-4h2v2h-2z"/>'},"calendar-2-sharp":{body:'<path fill="currentColor" d="M3 4h18v2H3zm0 16h18v2H3zm0-10h2v10H3zm0-4h2v2H3zm16 0h2v2h-2zm0 4h2v10h-2zM3 8h18v2H3zm12-6h2v2h-2zM7 2h2v2H7zm0 10h2v2H7zm0 4h2v2H7zm4-4h2v2h-2zm0 4h2v2h-2zm4-4h2v2h-2z"/>'},"calendar-alert":{body:'<path fill="currentColor" d="M7 5V4H5v2H3v14h14V6h-2V4h-2v2H7zm-2 5V8h10v2zm0 2h10v6H5zm16-3V8h-2v6h2zm0 6h-2v2h2z"/>',hidden:!0},"calendar-arrow-left":{body:'<path fill="currentColor" d="M17 2h-2v2H9V2H7v2H3v8h2v-2h14v10h-8v2h10V4h-4zm2 6H5V6h14zm-6 8H7v-2h2v-2H7v2H5v2H3v2h2v2h2v2h2v-2H7v-2h6z"/>',hidden:!0},"calendar-arrow-right":{body:'<path fill="currentColor" d="M17 2h-2v2H9V2H7v2H3v18h10v-2H5V10h14v2h2V4h-4zM7 6h12v2H5V6zm14 10h-2v-2h-2v-2h-2v2h2v2h-6v2h6v2h-2v2h2v-2h2v-2h2z"/>',hidden:!0},"calendar-check":{body:'<path fill="currentColor" d="M15 2h2v2h4v18H3V4h4V2h2v2h6zm4 6V6H5v2zm0 2H5v10h14zm-3 2v2h-2v-2zm-4 4v-2h2v2zm-2 0h2v2h-2zm0 0H8v-2h2z"/>',hidden:!0},"calendar-export":{body:'<path fill="currentColor" d="M17 2h-2v2H9V2H7v2H3v18h4v-2H5V10h14v10h-2v2h4V4h-4zM7 6h12v2H5V6zm6 6h-2v6H9v-2H7v2h2v2h2v2h2v-2h2v-2h2v-2h-2v2h-2z"/>',hidden:!0},"calendar-grid":{body:'<path fill="currentColor" d="M3 3h18v18H3zm2 2v2h14V5zm14 4h-6v2h6zm0 4h-6v2h6zm0 4h-6v2h6zm-8 2v-2H5v2zm-6-4h6v-2H5zm0-4h6V9H5z"/>',hidden:!0},"calendar-import":{body:'<path fill="currentColor" d="M17 2h-2v2H9V2H7v2H3v18h4v-2H5V10h14v10h-2v2h4V4h-4zM7 6h12v2H5V6zm6 16h-2v-6H9v-2h2v-2h2v2h2v2h-2zm2-6v2h2v-2zm-6 0v2H7v-2z"/>',hidden:!0},"calendar-minus":{body:'<path fill="currentColor" d="M17 2h-2v2H9V2H7v2H3v18h18V4h-4zM7 6h12v2H5V6zM5 20V10h14v10zm10-6H9v2h6z"/>',hidden:!0},"calendar-month":{body:'<path fill="currentColor" d="M15 2h2v2h4v18H3V4h4V2h2v2h6zM9 6H5v2h14V6zm-4 4v10h14V10zm2 2h2v2H7zm6 0h-2v2h2zm2 0h2v2h-2zm-6 4H7v2h2zm2 0h2v2h-2zm6 0h-2v2h2z"/>',hidden:!0},"calendar-multiple":{body:'<path fill="currentColor" d="M17 2h2v2h4v14H5V4h4V2h2v2h6zm-6 4H7v2h14V6zm-4 4v6h14v-6zM3 20h16v2H1V8h2z"/>',hidden:!0},"calendar-multiple-check":{body:'<path fill="currentColor" d="M17 2h2v2h4v10h-2v-4H7v6h6v2H5V4h4V2h2v2h6zm-6 4H7v2h14V6zm2 14v2H1V8h2v12zm2-2h2v2h-2zm4 2v2h-2v-2zm2-2h-2v2h2zm0 0v-2h2v2z"/>',hidden:!0},"calendar-plus":{body:'<path fill="currentColor" d="M15 2h2v2h4v18H3V4h4V2h2v2h6zM9 6H5v2h14V6zm-4 4v10h14V10zm6 2h2v2h2v2h-2v2h-2v-2H9v-2h2z"/>',hidden:!0},"calendar-range":{body:'<path fill="currentColor" d="M5 4h14v2H5zm0 16h14v2H5zM3 10h2v10H3zm0-4h2v2H3zm16 0h2v2h-2zm0 4h2v10h-2zM3 8h18v2H3zm12-6h2v2h-2zM7 2h2v2H7zm4 10h6v2h-6zm-4 4h6v2H7z"/>'},"calendar-range-sharp":{body:'<path fill="currentColor" d="M3 4h18v2H3zm0 16h18v2H3zm0-10h2v10H3zm0-4h2v2H3zm16 0h2v2h-2zm0 4h2v10h-2zM3 8h18v2H3zm12-6h2v2h-2zM7 2h2v2H7zm4 10h6v2h-6zm-4 4h6v2H7z"/>'},"calendar-remove":{body:'<path fill="currentColor" d="M17 2h-2v2H9V2H7v2H3v18h18V4h-4zM7 6h12v2H5V6zM5 20V10h14v10zm6-4H9v2h2zm0-2v-2H9v2zm2 0h-2v2h2v2h2v-2h-2zm0 0v-2h2v2z"/>',hidden:!0},"calendar-search":{body:'<path fill="currentColor" d="M15 2h2v2h4v8h-2v-2H5v10h6v2H3V4h4V2h2v2h6zM9 6H5v2h14V6zm8 6v2h-4v-2zm-4 6h-2v-4h2zm4 0h-4v2h6v2h2v-2h-2v-6h-2z"/>',hidden:!0},"calendar-sharp":{body:'<path fill="currentColor" d="M3 4h18v2H3zm0 16h18v2H3zm0-10h2v10H3zm0-4h2v2H3zm16 0h2v2h-2zm0 4h2v10h-2zM3 8h18v2H3zm12-6h2v2h-2zM7 2h2v2H7z"/>'},"calendar-sort-ascending":{body:'<path fill="currentColor" d="M10 5H8v2H4V5H2v2H0v12h12V7h-2zM2 9h8v2H2zm0 8v-4h8v4zM20 7h-2v8h-2v-2h-2v2h2v2h2v2h2v-2h2v-2h2v-2h-2v2h-2z"/>',hidden:!0},"calendar-sort-descending":{body:'<path fill="currentColor" d="M10 5H8v2H4V5H2v2H0v12h12V7h-2zM2 9h8v2H2zm0 8v-4h8v4zm18 2h-2v-8h-2V9h2V7h2v2h2v2h-2zm2-8v2h2v-2zm-6 0v2h-2v-2z"/>',hidden:!0},"calendar-text":{body:'<path fill="currentColor" d="M5 4h14v2H5zm0 16h14v2H5zM3 10h2v10H3zm0-4h2v2H3zm16 0h2v2h-2zm0 4h2v10h-2zM3 8h18v2H3zm12-6h2v2h-2zM7 2h2v2H7zm0 10h8v2H7zm0 4h4v2H7z"/>'},"calendar-text-sharp":{body:'<path fill="currentColor" d="M3 4h18v2H3zm0 16h18v2H3zm0-10h2v10H3zm0-4h2v2H3zm16 0h2v2h-2zm0 4h2v10h-2zM3 8h18v2H3zm12-6h2v2h-2zM7 2h2v2H7zm0 10h8v2H7zm0 4h4v2H7z"/>'},"calendar-today":{body:'<path fill="currentColor" d="M17 2h-2v2H9V2H7v2H3v18h18V4h-4zM7 6h12v2H5V6zM5 20V10h14v10zm6-4v-4H7v4z"/>',hidden:!0},"calendar-tomorrow":{body:'<path fill="currentColor" d="M17 2h-2v2H9V2H7v2H3v18h18V4h-4zM7 6h12v2H5V6zM5 20V10h14v10zm12-2v-4h-4v4z"/>',hidden:!0},"calendar-week":{body:'<path fill="currentColor" d="M17 2h-2v2H9V2H7v2H3v18h18V4h-4zM7 6h12v2H5V6zM5 20V10h14v10zm12-8H7v2h10z"/>',hidden:!0},"calendar-week-begin":{body:'<path fill="currentColor" d="M17 2h-2v2H9V2H7v2H3v18h18V4h-4zM7 6h12v2H5V6zM5 20V10h14v10zm4-8H7v6h2z"/>',hidden:!0},"calendar-weekend":{body:'<path fill="currentColor" d="M17 2h-2v2H9V2H7v2H3v18h18V4h-4zM7 6h12v2H5V6zM5 20V10h14v10zm12-8h-2v6h2z"/>',hidden:!0},"calendar-weeks":{body:'<path fill="currentColor" d="M5 4h14v2H5zm0 16h14v2H5zM3 10h2v10H3zm0-4h2v2H3zm16 0h2v2h-2zm0 4h2v10h-2zM3 8h18v2H3zm12-6h2v2h-2zM7 2h2v2H7zm0 10h10v2H7zm0 4h10v2H7z"/>'},"calendar-weeks-sharp":{body:'<path fill="currentColor" d="M3 4h18v2H3zm0 16h18v2H3zm0-10h2v10H3zm0-4h2v2H3zm16 0h2v2h-2zm0 4h2v10h-2zM3 8h18v2H3zm12-6h2v2h-2zM7 2h2v2H7zm0 10h10v2H7zm0 4h10v2H7z"/>'},camera:{body:'<path fill="currentColor" d="M4 5h4v2H4zm4-2h8v2H8zm8 2h4v2h-4zM2 7h2v12H2zm2 12h16v2H4zM20 7h2v12h-2zM10 8h4v2h-4zm0 6h4v2h-4zm-2-4h2v4H8zm6 0h2v4h-2z"/>'},"camera-add":{body:'<path fill="currentColor" d="M5 2H3v3H0v2h3v3h2V7h3V5H5zm12 1h-7v2h5v2h5v12H5v-7H3v9h19V5h-5zm-7 6h4v2h2v4h-2v2h-4v-2h4v-4h-4zm-2 2h2v4H8z"/>',hidden:!0},"camera-alt":{body:'<path fill="currentColor" d="M4 4H2v16h20V4zm16 2v12H4V6zM8 8H6v2h2zm4 0h4v2h-4zm-2 2h2v4h-2zm6 4h2v-4h-2zm0 0h-4v2h4z"/>',hidden:!0},"camera-face":{body:'<path fill="currentColor" d="M7 3h10v2h5v16H2V7h2v12h16V7h-5V5H9v2H2V5h5zm7 12h-4v2h4zm-4-2v2H8v-2zm0-2V9H8v2zm6 2v2h-2v-2zm0-2V9h-2v2z"/>',hidden:!0},"camera-sharp":{body:'<path fill="currentColor" d="M2 5h6v2H2zm4-2h12v2H6zm10 2h6v2h-6zM2 7h2v12H2zm0 12h20v2H2zM20 7h2v12h-2zM10 8h4v2h-4zm0 6h4v2h-4zm-2-4h2v4H8zm6 0h2v4h-2z"/>'},cancel:{body:'<path fill="currentColor" d="M6 2h12v2H6zm0 18h12v2H6zM2 6h2v12H2zm18 0h2v12h-2zm-2-2h2v2h-2zm-2 2h2v2h-2zm-2 2h2v2h-2zm-2 2h2v2h-2zm-2 2h2v2h-2zm-2 2h2v2H8zm-2 2h2v2H6zm12 2h2v2h-2zM4 4h2v2H4zm0 14h2v2H4z"/>'},car:{body:'<path fill="currentColor" d="M4 13h6v2H4zm10 0h6v2h-6zM4 17h6v2H4zm10 0h6v2h-6zM2 15h4v2H2zm6 0h8v2H8zm10 0h4v2h-4zm4-4h2v4h-2zm-6-4h2v2h-2zM4 5h12v2H4zm-4 6h2v4H0zm12-2h10v2H12zM2 7h2v4H2zm8 0h2v2h-2z"/>'},"car-sharp":{body:'<path fill="currentColor" d="M4 13h6v2H4zm10 0h6v2h-6zM4 17h6v2H4zm10 0h6v2h-6zM2 15h4v2H2zm6 0h8v2H8zm11 0h5v2h-5zm3-4h2v4h-2zm-6-4h2v2h-2zM4 5h12v2H4zM0 9h2v8H0zm12 0h10v2H12zM2 5h2v6H2zm8 2h2v2h-2z"/>'},card:{body:'<path fill="currentColor" d="M4 4h16v2H4zm0 14h16v2H4zM2 6h2v12H2zm18 0h2v12h-2z"/>'},"card-id":{body:'<path fill="currentColor" d="M2 4h20v16H2zm2 2v4h16V6zm16 6H10v2h10zm0 4h-4v2h4zm-6 2v-2H4v2zM4 14h4v-2H4z"/>',hidden:!0},"card-plus":{body:'<path fill="currentColor" d="M22 4H2v16h10v-2H4V6h16v4h2zm-3 13h3v-2h-3v-3h-2v3h-3v2h3v3h2z"/>',hidden:!0},"card-sharp":{body:'<path fill="currentColor" d="M2 4h20v2H2zm0 14h20v2H2zM2 6h2v12H2zm18 0h2v12h-2z"/>'},"card-stack":{body:'<path fill="currentColor" d="M4 4h18v12H2V4zm16 10V6H4v8zm2 4H2v2h20z"/>',hidden:!0},"card-text":{body:'<path fill="currentColor" d="M6 8h12v2H6zm0 4h8v2H6zM4 4h16v2H4zm0 14h16v2H4zM2 6h2v12H2zm18 0h2v12h-2z"/>'},"card-text-sharp":{body:'<path fill="currentColor" d="M6 8h12v2H6zm0 4h8v2H6zM2 4h20v2H2zm0 14h20v2H2zM2 6h2v12H2zm18 0h2v12h-2z"/>'},cart:{body:'<path fill="currentColor" d="M2 2h4v4h16v11H4V4H2zm4 13h14V8H6zm0 4h3v3H6zm14 0h-3v3h3z"/>',hidden:!0},cast:{body:'<path fill="currentColor" d="M4 3h18v18h-8v-2h6V5H4v4H2V3zm0 16H2v2h2zm-2-4h4v2H2zm8-4H2v2h8v8h2V11zm-4 4h2v6H6z"/>',hidden:!0},castle:{body:'<path fill="currentColor" d="M1 8h2v12H1zm2 12h18v2H3zM21 8h2v12h-2zM3 10h18v2H3zm2-8h2v8H5zm12 0h2v8h-2zM7 4h10v2H7zm2-2h2v2H9zm4 0h2v2h-2zM8 16h2v4H8zm2-2h4v2h-4zm4 2h2v4h-2z"/>'},"castle-sharp":{body:'<path fill="currentColor" d="M1 8h2v12H1zm0 12h22v2H1zM21 8h2v12h-2zM3 10h18v2H3zm2-8h2v8H5zm12 0h2v8h-2zM7 4h10v2H7zm2-2h2v2H9zm4 0h2v2h-2zM8 16h2v4H8zm0-2h8v2H8zm6 2h2v4h-2z"/>'},"cellular-signal-0":{body:'<path fill="currentColor" d="M4 14h2v2H4zm7-4h2v2h-2zm7-6h2v2h-2zM2 16h2v2H2zm7-4h2v6H9zm7-6h2v12h-2zM6 14h2v4H6zm7-4h2v8h-2zm7-6h2v14h-2zM2 18h6v2H2zm7 0h6v2H9zm7 0h6v2h-6z"/>'},"cellular-signal-0-sharp":{body:'<path fill="currentColor" d="M4 14h2v2H4zm7-4h2v2h-2zm7-6h2v2h-2zM2 14h2v4H2zm7-4h2v8H9zm7-6h2v14h-2zM6 14h2v4H6zm7-4h2v8h-2zm7-6h2v14h-2zM2 18h6v2H2zm7 0h6v2H9zm7 0h6v2h-6z"/>'},"cellular-signal-1":{body:'<path fill="currentColor" d="M4 12h2v6H4zm7-2h2v2h-2zm7-6h2v2h-2zM2 14h2v4H2zm7-2h2v6H9zm7-6h2v12h-2zM6 12h2v6H6zm7-2h2v8h-2zm7-6h2v14h-2zM2 18h6v2H2zm7 0h6v2H9zm7 0h6v2h-6z"/>'},"cellular-signal-1-sharp":{body:'<path fill="currentColor" d="M4 12h2v6H4zm7-2h2v2h-2zm7-6h2v2h-2zM2 12h2v6H2zm7-2h2v8H9zm7-6h2v14h-2zM6 12h2v6H6zm7-2h2v8h-2zm7-6h2v14h-2zM2 18h6v2H2zm7 0h6v2H9zm7 0h6v2h-6z"/>'},"cellular-signal-2":{body:'<path fill="currentColor" d="M4 12h2v6H4zm7-4h2v10h-2zm7-4h2v2h-2zM2 14h2v4H2zm7-4h2v8H9zm7-4h2v12h-2zM6 12h2v6H6zm7-4h2v10h-2zm7-4h2v14h-2zM2 18h6v2H2zm7 0h6v2H9zm7 0h6v2h-6z"/>'},"cellular-signal-2-sharp":{body:'<path fill="currentColor" d="M4 12h2v6H4zm7-4h2v10h-2zm7-4h2v2h-2zM2 12h2v6H2zm7-4h2v10H9zm7-4h2v14h-2zM6 12h2v6H6zm7-4h2v10h-2zm7-4h2v14h-2zM2 18h6v2H2zm7 0h6v2H9zm7 0h6v2h-6z"/>'},"cellular-signal-3":{body:'<g fill="currentColor"><path d="M4 14h2v4H4zm7-4h2v8h-2zm7-6h2v14h-2zM2 16h2v3H2zm7-4h2v6H9zm7-6h2v12h-2zM6 14h2v5H6zm7-4h2v8h-2zm7-6h2v14h-2z"/><path d="M2 18h6v2H2zm7 0h6v2H9zm7 0h6v2h-6z"/></g>'},"cellular-signal-3-sharp":{body:'<g fill="currentColor"><path d="M4 14h2v4H4zm7-4h2v8h-2zm7-6h2v14h-2zM2 14h2v5H2zm7-4h2v8H9zm7-6h2v14h-2zM6 14h2v5H6zm7-4h2v8h-2zm7-6h2v14h-2z"/><path d="M2 18h6v2H2zm7 0h6v2H9zm7 0h6v2h-6z"/></g>'},"cellular-signal-off":{body:'<path fill="currentColor" d="M4 2H2v2h2v2H2v2h2V6h2v2h2V6H6V4h2V2H6v2H4zm12 2v16h6V4zm2 2h2v12h-2zm-9 4v10h6V10zm2 8v-6h2v6zm-3-4v6H2v-6zm-2 4v-2H4v2z"/>',hidden:!0},chart:{body:'<path fill="currentColor" d="M4 2h16v2H4zm0 18h16v2H4zM2 4h2v16H2zm18 0h2v16h-2zM7 11h2v6H7zm4-4h2v10h-2zm4 6h2v4h-2z"/>'},"chart-add":{body:'<path fill="currentColor" d="M3 3h10v2H5v14h14v-8h2v10H3zm6 8H7v6h2zm2-4h2v10h-2zm6 6h-2v4h2zm0-10h2v2h2v2h-2v2h-2V7h-2V5h2z"/>',hidden:!0},"chart-bar":{body:'<path fill="currentColor" d="M13 5h2v14h-2zm-2 4H9v10h2zm-4 4H5v6h2zm12 0h-2v6h2z"/>',hidden:!0},"chart-bar-big":{body:'<path fill="currentColor" d="M4 20h18v2H4zM2 2h2v18H2zm16 11v3h-2v-3zM8 13v3H6v-3zm8-2v2H8v-2zm0 5v2H8v-2zm4-12v3h-2V4zM8 4v3H6V4zm10-2v2H8V2zm0 5v2H8V7z"/>'},"chart-bar-big-sharp":{body:'<path fill="currentColor" d="M4 20h18v2H4zM2 2h2v20H2zm16 11v3h-2v-3zM8 13v3H6v-3zm10-2v2H6v-2zm0 5v2H6v-2zm2-12v3h-2V4zM8 4v3H6V4zm12-2v2H6V2zm0 5v2H6V7z"/>'},"chart-column-decreasing":{body:'<path fill="currentColor" d="M4 20h18v2H4zM2 2h2v18H2zm5 4h2v12H7zm5 4h2v8h-2zm5 4h2v4h-2z"/>'},"chart-column-decreasing-sharp":{body:'<path fill="currentColor" d="M4 20h18v2H4zM2 2h2v20H2zm5 4h2v12H7zm5 4h2v8h-2zm5 4h2v4h-2z"/>'},"chart-delete":{body:'<path fill="currentColor" d="M13 3H3v18h18V11h-2v8H5V5h8zm-6 8h2v6H7zm6-4h-2v10h2zm2 6h2v4h-2zm2-6h-2v2h2zm0-2V3h-2v2zm2 0h-2v2h2v2h2V7h-2zm0 0V3h2v2z"/>',hidden:!0},"chart-line":{body:'<path fill="currentColor" d="M22 22H4v-2h18zM4 20H2V2h2zm4-6H6v-2h2zm8 0h-2v-2h2zm-6-2H8v-2h2zm4 0h-2v-2h2zm4 0h-2v-2h2zm-6-2h-2V8h2zm8 0h-2V8h2zm2-2h-2V6h2z"/>'},"chart-line-sharp":{body:'<path fill="currentColor" d="M4 20h18v2H2V2h2zm4-6H6v-2h2zm8 0h-2v-2h2zm-6-2H8v-2h2zm4 0h-2v-2h2zm4 0h-2v-2h2zm-6-2h-2V8h2zm8 0h-2V8h2zm2-2h-2V6h2z"/>'},"chart-minus":{body:'<path fill="currentColor" d="M13 3H3v18h18V11h-2v8H5V5h8zm-6 8h2v6H7zm6-4h-2v10h2zm2 6h2v4h-2zm6-8h-6v2h6z"/>',hidden:!0},"chart-multiple":{body:'<path fill="currentColor" d="M3 2H1v16h18V2zm0 2h14v12H3zm18 2v14H5v2h18V6zM7 8H5v6h2zm2-2h2v8H9zm6 4h-2v4h2z"/>',hidden:!0},"chart-sharp":{body:'<path fill="currentColor" d="M2 2h20v2H2zm0 18h20v2H2zM2 4h2v16H2zm18 0h2v16h-2zM7 11h2v6H7zm4-4h2v10h-2zm4 6h2v4h-2z"/>'},chat:{body:'<path fill="currentColor" d="M20 2H2v20h2V4h16v12H6v2H4v2h2v-2h16V2z"/>',hidden:!0},check:{body:'<path fill="currentColor" d="M10 18H8v-2h2zm-2-2H6v-2h2zm4-2v2h-2v-2zm-6 0H4v-2h2zm8 0h-2v-2h2zm2-2h-2v-2h2zm2-2h-2V8h2zm2-2h-2V6h2z"/>'},"check-double":{body:'<path fill="currentColor" d="M7 18H5v-2h2zm6 0h-2v-2h2zm-8-2H3v-2h2zm4 0H7v-2h2zm6-2v2h-2v-2zM3 14H1v-2h2zm8 0H9v-2h2zm6 0h-2v-2h2zm-4-2h-2v-2h2zm6 0h-2v-2h2zm-4-2h-2V8h2zm6 0h-2V8h2zm-4-2h-2V6h2zm6 0h-2V6h2z"/>'},checkbox:{body:'<path fill="currentColor" d="M4 2h16v2H4zm0 18h16v2H4zM2 4h2v16H2zm18 0h2v16h-2z"/>'},"checkbox-on":{body:'<path fill="currentColor" d="M4 2h16v2H4zm0 18h16v2H4zM2 4h2v16H2zm18 0h2v16h-2zM7 12h2v2H7zm2 2h2v2H9zm2-2h2v2h-2zm2-2h2v2h-2zm2-2h2v2h-2z"/>'},"checkbox-on-sharp":{body:'<path fill="currentColor" d="M2 2h20v2H2zm0 18h20v2H2zM2 4h2v16H2zm18 0h2v16h-2zM7 12h2v2H7zm2 2h2v2H9zm2-2h2v2h-2zm2-2h2v2h-2zm2-2h2v2h-2z"/>'},"checkbox-sharp":{body:'<path fill="currentColor" d="M2 2h20v2H2zm0 18h20v2H2zM2 4h2v16H2zm18 0h2v16h-2z"/>'},checklist:{body:'<path fill="currentColor" d="M19 4h2v2h-2zm-2 4V6h2v2zm-2 0h2v2h-2zm0 0h-2V6h2zM3 6h8v2H3zm8 10H3v2h8zm7 2v-2h2v-2h-2v2h-2v-2h-2v2h2v2h-2v2h2v-2zm0 0v2h2v-2z"/>',hidden:!0},chess:{body:'<path fill="currentColor" d="M4 2h16v2H4zm0 18h16v2H4zM2 4h2v16H2zm18 0h2v16h-2zM8 4h4v4H8zM4 8h4v4H4zm4 4h4v4H8zm-4 4h4v4H4zM16 4h4v4h-4zm-4 4h4v4h-4zm4 4h4v4h-4zm-4 4h4v4h-4z"/>'},"chess-sharp":{body:'<path fill="currentColor" d="M2 2h20v2H2zm0 18h20v2H2zM2 4h2v16H2zm18 0h2v16h-2zM8 4h4v4H8zM4 8h4v4H4zm4 4h4v4H8zm-4 4h4v4H4zM16 4h4v4h-4zm-4 4h4v4h-4zm4 4h4v4h-4zm-4 4h4v4h-4z"/>'},"chevron-down":{body:'<path fill="currentColor" d="M13 16h-2v-2h2zm-2-2H9v-2h2zm4 0h-2v-2h2zm-6-2H7v-2h2zm8 0h-2v-2h2zM7 10H5V8h2zm12 0h-2V8h2z"/>'},"chevron-down-2":{body:'<path fill="currentColor" d="M17 9v2h-2v2h-2v2h-2v-2H9v-2H7V9z"/>'},"chevron-left":{body:'<path fill="currentColor" d="M8 13v-2h2v2zm2-2V9h2v2zm0 4v-2h2v2zm2-6V7h2v2zm0 8v-2h2v2zm2-10V5h2v2zm0 12v-2h2v2z"/>'},"chevron-left-2":{body:'<path fill="currentColor" d="M15 17h-2v-2h-2v-2H9v-2h2V9h2V7h2z"/>'},"chevron-right":{body:'<path fill="currentColor" d="M16 13v-2h-2v2zm-2-2V9h-2v2zm0 4v-2h-2v2zm-2-6V7h-2v2zm0 8v-2h-2v2zM10 7V5H8v2zm0 12v-2H8v2z"/>'},"chevron-right-2":{body:'<path fill="currentColor" d="M9 17h2v-2h2v-2h2v-2h-2V9h-2V7H9z"/>'},"chevron-up":{body:'<path fill="currentColor" d="M13 8h-2v2h2zm-2 2H9v2h2zm4 0h-2v2h2zm-6 2H7v2h2zm8 0h-2v2h2zM7 14H5v2h2zm12 0h-2v2h2z"/>'},"chevron-up-2":{body:'<path fill="currentColor" d="M17 15v-2h-2v-2h-2V9h-2v2H9v2H7v2z"/>'},"chevrons-horizontal":{body:'<path fill="currentColor" d="M10 15v2H8v-2zm6 2h-2v-2h2zm-8-2H6v-2h2zm10 0h-2v-2h2zM6 13H4v-2h2zm14 0h-2v-2h2zM8 11H6V9h2zm10 0h-2V9h2zm-8-2H8V7h2zm6 0h-2V7h2z"/>'},"chevrons-horizontal-2":{body:'<path fill="currentColor" d="M8 15H6v-2H4v-2h2V9h2V7h2v10H8zm8-6h2v2h2v2h-2v2h-2v2h-2V7h2z"/>'},"chevrons-vertical":{body:'<path fill="currentColor" d="M13 20h-2v-2h2zm-2-2H9v-2h2zm4 0h-2v-2h2zm-6-2H7v-2h2zm8-2v2h-2v-2zm-8-4H7V8h2zm8 0h-2V8h2zm-6-2H9V6h2zm4 0h-2V6h2zm-2-2h-2V4h2z"/>'},"chevrons-vertical-2":{body:'<path fill="currentColor" d="M15 16v2h-2v2h-2v-2H9v-2H7v-2h10v2zM9 8V6h2V4h2v2h2v2h2v2H7V8z"/>'},"cigarette-off":{body:'<g fill="currentColor"><path d="M2 13h2v2H2zm2-2h9v2H4zm0 4h13v2H4zm3-2h2v2H7zm10-2h3v2h-3zm3 2h2v2h-2z"/><path d="M11 11h2v2h-2zM9 9h2v2H9zM7 7h2v2H7zM5 5h2v2H5zM3 3h2v2H3zm10 10h2v2h-2zm2 2h2v2h-2zm2 2h2v2h-2zm2 2h2v2h-2zM14 6h2v3h-2zm-2-3h2v3h-2zm7 3h2v3h-2zm-2-3h2v3h-2z"/></g>'},"cigarette-off-sharp":{body:'<g fill="currentColor"><path d="M2 11h2v6H2zm2 0h9v2H4zm0 4h13v2H4zm3-2h2v2H7zm10-2h3v2h-3zm3 0h2v6h-2z"/><path d="M11 11h2v2h-2zM9 9h2v2H9zM7 7h2v2H7zM5 5h2v2H5zM3 3h2v2H3zm10 10h2v2h-2zm2 2h2v2h-2zm2 2h2v2h-2zm2 2h2v2h-2zM14 6h2v3h-2zm-2-3h2v3h-2zm7 3h2v3h-2zm-2-3h2v3h-2z"/></g>'},circle:{body:'<path fill="currentColor" d="M6 2h12v2H6zm0 18h12v2H6zM2 6h2v12H2zm18 0h2v12h-2zm-2-2h2v2h-2zm0 14h2v2h-2zM4 4h2v2H4zm0 14h2v2H4z"/>'},"circle-info":{body:'<path fill="currentColor" d="M18 22H6v-2h12zM6 20H4v-2h2zm14 0h-2v-2h2zM4 18H2V6h2zm18 0h-2V6h2zm-9-1h-2v-6h2zm0-8h-2V7h2zM6 6H4V4h2zm14 0h-2V4h2zm-2-2H6V2h12z"/>'},"circle-info-solid":{body:'<path fill="currentColor" d="M18 4h2v2h2v12h-2v2h-2v2H6v-2H4v-2H2V6h2V4h2V2h12zm-7 13h2v-6h-2zm0-8h2V7h-2z"/>'},"circle-pile":{body:'<path fill="currentColor" d="M11 2h2v2h-2zM7 9h2v2H7zm8 0h2v2h-2zM3 16h2v2H3zm8 0h2v2h-2zm8 0h2v2h-2zM9 4h2v2H9zm-4 7h2v2H5zm8 0h2v2h-2zM1 18h2v2H1zm8 0h2v2H9zm8 0h2v2h-2zM11 6h2v2h-2zm-4 7h2v2H7zm8 0h2v2h-2zM3 20h2v2H3zm8 0h2v2h-2zm8 0h2v2h-2zM13 4h2v2h-2zm-4 7h2v2H9zm8 0h2v2h-2zM5 18h2v2H5zm8 0h2v2h-2zm8 0h2v2h-2z"/>'},"circle-power":{body:'<path fill="currentColor" d="M6 20h12v2H6zM6 2h12v2H6zm12 2h2v2h-2zM4 4h2v2H4zm0 14h2v2H4zm14 0h2v2h-2zM2 6h2v12H2zm18 0h2v12h-2zM9 15h6v2H9zM7 9h2v6H7zm8 0h2v6h-2zm-4-2h2v5h-2z"/>'},"circle-question":{body:'<path fill="currentColor" d="M18 22H6v-2h12zM6 20H4v-2h2zm14 0h-2v-2h2zM4 18H2V6h2zm9 0h-2v-2h2zm9 0h-2V6h2zm-7-5h-2v2h-2v-4h4zm2-2h-2V8h2zm-8-1H7V8h2zm6-2H9V6h6zM6 6H4V4h2zm14 0h-2V4h2zm-2-2H6V2h12z"/>'},"circle-question-solid":{body:'<path fill="currentColor" d="M18 4h2v2h2v12h-2v2h-2v2H6v-2H4v-2H2V6h2V4h2V2h12zm-7 14h2v-2h-2zm0-3h2v-2h2v-2h-4zm4-4h2V8h-2zm-8-1h2V8H7zm2-2h6V6H9z"/>'},"circle-square":{body:'<g fill="currentColor"><path d="M11 9h9v2h-9zm0 11h9v2h-9zm-2-9h2v9H9zm11 0h2v9h-2zM6 2h7v2H6z"/><path d="M6 15h7v2H6zm7-11h2v2h-2zm0 9h2v2h-2zM4 4h2v2H4zm0 9h2v2H4zm11-7h2v7h-2zM2 6h2v7H2z"/></g>'},"circuit-board":{body:'<path fill="currentColor" d="M4 2h16v2H4zm0 18h16v2H4zM2 4h2v16H2zm18 0h2v16h-2zM8 6h2v2H8zm8 12h-2v-2h2zM6 8h2v2H6zm12 8h-2v-2h2zM8 10h2v2H8zm8 4h-2v-2h2zm-6-6h6v2h-6zm4 8H8v-2h6zm2-12h2v4h-2zM8 20H6v-4h2z"/>'},"circuit-board-sharp":{body:'<path fill="currentColor" d="M2 2h20v2H2zm0 18h20v2H2zM2 4h2v16H2zm18 0h2v16h-2zM8 6h2v2H8zm8 12h-2v-2h2zM6 8h2v2H6zm12 8h-2v-2h2zM8 10h2v2H8zm8 4h-2v-2h2zm-6-6h6v2h-6zm4 8H8v-2h6zm2-12h2v4h-2zM8 20H6v-4h2z"/>'},clapperboard:{body:'<path fill="currentColor" d="M4 3h16v2H4zm0 6h16v2H4zM2 5h2v14H2zm18 0h2v14h-2zM4 19h16v2H4zM18 7h-2v2h2zm-8 0H8v2h2zm6-2h-2v2h2zM8 5H6v2h2z"/>'},"clapperboard-sharp":{body:'<path fill="currentColor" d="M2 3h20v2H2zm2 6h16v2H4zM2 5h2v14H2zm18 0h2v14h-2zM2 19h20v2H2zM18 7h-2v2h2zm-8 0H8v2h2zm6-2h-2v2h2zM8 5H6v2h2z"/>'},clipboard:{body:'<path fill="currentColor" d="M4 6h2v14H4zm2 14h12v2H6zM18 6h2v14h-2zM6 4h2v2H6zm10 0h2v2h-2zm-6-2h4v2h-4zm0 4h4v2h-4zM8 2h2v6H8zm6 0h2v6h-2z"/>'},"clipboard-note":{body:'<g fill="currentColor"><path d="M20 12h2v8h-2zm-8-2h8v2h-8zm0 10h8v2h-8zm-2-8h2v8h-2zM6 2h8v2H6zm0 4h8v2H6zm0-2h2v2H6zm6 0h2v2h-2zm2 0h2v2h-2z"/><path d="M16 6h2v5h-2zM4 4h2v2H4zM2 6h2v12H2zm2 12h6v2H4zm2-8h4v2H6zm0 4h2v2H6zm11 2h5v2h-5z"/><path d="M16 16h2v6h-2z"/></g>'},"clipboard-note-sharp":{body:'<g fill="currentColor"><path d="M20 12h2v8h-2zm-10-2h12v2H10zm0 10h10v2H10zm0-8h2v8h-2zM6 2h8v2H6zm0 4h8v2H6zm0-2h2v2H6zm6 0h2v2h-2zm2 0h4v2h-4z"/><path d="M16 6h2v5h-2zM2 4h4v2H2zm0 2h2v12H2zm0 12h8v2H2zm4-8h2v2H6zm0 4h2v2H6zm11 2h5v2h-5z"/><path d="M16 16h2v6h-2z"/></g>'},"clipboard-sharp":{body:'<path fill="currentColor" d="M4 6h2v14H4zm0 14h16v2H4zM18 6h2v14h-2zM4 4h4v2H4zm12 0h4v2h-4zm-6-2h4v2h-4zm0 4h4v2h-4zM8 2h2v6H8zm6 0h2v6h-2z"/>'},clock:{body:'<path fill="currentColor" d="M6 2h12v2H6zM2 6h2v12H2zm18 0h2v12h-2zm-2-2h2v2h-2zM4 4h2v2H4zm2 18h12v-2H6zm12-2h2v-2h-2zM4 20h2v-2H4zm7-14h2v7h-2zm2 7h2v2h-2zm2 2h2v2h-2z"/>'},close:{body:'<path fill="currentColor" d="M7 19H5v-2h2zm12 0h-2v-2h2zM9 15v2H7v-2zm8 2h-2v-2h2zm-6-2H9v-2h2zm4 0h-2v-2h2zm-2-2h-2v-2h2zm-2-2H9V9h2zm4 0h-2V9h2zM9 9H7V7h2zm8 0h-2V7h2zM7 7H5V5h2zm12 0h-2V5h2z"/>'},"close-box":{body:'<path fill="currentColor" d="M5 3H3v18h18V3zm14 2v14H5V5zm-8 4H9V7H7v2h2v2h2v2H9v2H7v2h2v-2h2v-2h2v2h2v2h2v-2h-2v-2h-2v-2h2V9h2V7h-2v2h-2v2h-2z"/>',hidden:!0},cloud:{body:'<g fill="currentColor"><path d="M22 10h-4v2h4zm2 2h-2v6h2zm-2 6H2v2h20zM2 12H0v6h2zm2-2H2v2h2zm4-2H4v2h4zm8-4h-6v2h6zm-6 2H8v2h2zm0 4H8v2h2zm8-4h-2v2h2z"/><path d="M20 8h-2v4h2zm-2 4h-2v2h2z"/></g>'},"cloud-done":{body:'<path fill="currentColor" d="M16 4h-6v2H8v2H4v2H2v2H0v6h2v2h20v-2h2v-6h-2v-2h-2V8h-2V6h-2zm0 2v2h2v4h4v6H2v-6h2v-2h4V8h2V6zm-6 6H8v2h2v2h2v-2h2v-2h2v-2h-2v2h-2v2h-2z"/>',hidden:!0},"cloud-download":{body:'<path fill="currentColor" d="M10 4h6v2h-6zM8 8V6h2v2zm-4 2V8h4v2zm-2 2v-2h2v2zm0 6H0v-6h2zm0 0h5v2H2zM18 8h-2V6h2zm4 4h-4V8h2v2h2zm0 6v-6h2v6zm0 0v2h-5v-2zm-11 2h2v-2h2v-2h2v-2h-4V9h-2v5H7v2h2v2h2z"/>',hidden:!0},"cloud-moon":{body:'<path fill="currentColor" d="M14 22H4v-2h10zM4 20H2v-4h2zm12 0h-2v-4h2zm-6-2H8v-2h2zm-2-2H4v-2h4zm6 0h-2v-2h2zm6 0h-2v-2h2zm-8-2H8v-2h4zm10 0h-2v-4h-2V8h2V6h2zm-4-2h-4v-2h4zM8 10H6V6h2zm6 0h-2V6h2zm-4-4H8V4h2zm8-2h-2v2h-2V4h-4V2h8z"/>'},"cloud-server":{body:'<path fill="currentColor" d="M20 6h-2v2h2zm2 2h-2v4h2zm-2 4H4v2h16zM4 8H2v4h2zm4-2H4v2h4zm8-4h-6v2h6zm-6 2H8v2h2zm0 4H8v2h2zm8-4h-2v2h2zm0 4h-2v2h2zm-7 8h2v2h-2zm0 4h2v2h-2zm-7-2h7v2H4zm9 0h7v2h-7zm-2-4h2v2h-2z"/>'},"cloud-sun":{body:'<path fill="currentColor" d="M14 22H4v-2h10zM4 20H2v-4h2zm12 0h-2v-4h2zm-6-2H8v-2h2zm-2-2H4v-2h4zm6 0h-2v-2h2zm-2-2H8v-2h4zm12-1h-4v-2h4zm-6-1h-2v-2h2zM8 10H6V8h2zm8 0h-2V8h2zm-2-2H8V6h6zM6 6H4V4h2zm14 0h-2V4h2zM4 4H2V2h2zm9 0h-2V0h2zm9 0h-2V2h2z"/>'},"cloud-upload":{body:'<path fill="currentColor" d="M10 4h6v2h-6zM8 8V6h2v2zm-4 2V8h4v2zm-2 2v-2h2v2zm0 6H0v-6h2zm0 0h7v2H2zM18 8h-2V6h2zm4 4h-4V8h2v2h2zm0 6v-6h2v6zm0 0v2h-7v-2zM11 9h2v2h2v2h2v2h-4v5h-2v-5H7v-2h2v-2h2z"/>',hidden:!0},cocktail:{body:'<path fill="currentColor" d="M19 3H3v4h2v2h2v2h2v2h2v6H7v2h10v-2h-4v-6h2v-2h2V9h2V7h2V3zm0 4H5V5h14z"/>',hidden:!0},code:{body:'<path fill="currentColor" d="M11 18H9v-4h2zm-4-1H5v-2h2zm12-2v2h-2v-2zM5 15H3v-2h2zm16 0h-2v-2h2zm-8-1h-2v-4h2zM3 13H1v-2h2zm20 0h-2v-2h2zM5 11H3V9h2zm16 0h-2V9h2zm-6-1h-2V6h2zM7 9H5V7h2zm12 0h-2V7h2z"/>'},coffee:{body:'<path fill="currentColor" d="M4 4h16v2H4zm0 2h2v8H4zm2 8h10v2H6zm14-8h2v4h-2zm-2 4h2v2h-2zm-2-4h2v8h-2zM2 18h18v2H2z"/>'},"coffee-alt":{body:'<path fill="currentColor" d="M7 3H5v4h2zm4 0H9v4h2zm2 0h2v4h-2zm8 6H3v12h14v-5h4zm-2 5h-2v-3h2zM5 11h10v8H5z"/>',hidden:!0},"coffee-sharp":{body:'<path fill="currentColor" d="M4 4h16v2H4zm0 2h2v8H4zm0 8h14v2H4zM20 4h2v8h-2zm-2 6h2v2h-2zm-2-4h2v8h-2zM2 18h18v2H2z"/>'},coin:{body:'<path fill="currentColor" d="M6 2h12v2H6zM4 6V4h2v2zm0 12V6H2v12zm2 2v-2H4v2zm12 0v2H6v-2zm2-2v2h-2v-2zm0-12h2v12h-2zm0 0V4h-2v2zm-9-1h2v2h3v2h-6v2h6v6h-3v2h-2v-2H8v-2h6v-2H8V7h3z"/>',hidden:!0},coins:{body:'<g fill="currentColor"><path d="M6 2h6v2H6zM4 4h2v2H4zm8 0h2v2h-2zm-8 8h2v2H4zm8 0h2v2h-2zm-6 2h6v2H6zM2 6h2v6H2zm12 0h2v6h-2z"/><path d="M14 8h4v2h-4zm-4 10h2v2h-2zm8-8h2v2h-2zm-6 10h2v2h-2zm6-2h2v2h-2z"/><path d="M12 20h6v2h-6zm-4-6h2v4H8zm12-2h2v6h-2zM7 6h4v2H7z"/><path d="M9 6h2v6H9zm6 8h2v4h-2zm-1-2h3v2h-3z"/></g>'},collapse:{body:'<path fill="currentColor" d="M7 19h2v-2h2v-2h2v2h2v2h2v2H7zm13-6H4v-2h16zm-3-8h-2v2h-2v2h-2V7H9V5H7V3h10z"/>'},"colors-swatch":{body:'<path fill="currentColor" d="M14 2h6v2h-6zm0 18h6v2h-6zM4 20h10v2H4zm8-16h2v16h-2zm8 0h2v16h-2zM2 16h2v4H2zm2-2h8v2H4zm12 2h2v2h-2zM6 12h2v2H6zM4 8h2v4H4zm2-2h4v2H6zm4 2h2v2h-2z"/>'},"colors-swatch-sharp":{body:'<path fill="currentColor" d="M12 2h10v2H12zm2 18h8v2h-8zM4 20h10v2H4zm8-16h2v16h-2zm8 0h2v16h-2zM2 14h2v8H2zm2 0h8v2H4zm12 2h2v2h-2zM6 12h2v2H6zm-2-2h2v2H4zm2-2h2v2H6zm2-2h2v2H8zm2 2h2v2h-2z"/>'},command:{body:'<path fill="currentColor" d="M4 2H2v8h2zm16 0h2v8h-2zm-6 6h-4V2H4v2h4v4H4v2h4v4H4v2h4v4H4v2h6v-6h4v6h2v-6h4v-2h-4v-4h4V8h-4V2h-2zm-4 6v-4h4v4zM20 2h-4v2h4zM2 14h2v8H2zm14 6h4v2h-4zm6-6h-2v8h2z"/>',hidden:!0},comment:{body:'<path fill="currentColor" d="M4 2h16v2H4zm0 14h14v2H4zM2 4h2v12H2zm18 0h2v18h-2zm-2 14h2v2h-2z"/>'},"comment-sharp":{body:'<path fill="currentColor" d="M2 2h20v2H2zm0 14h16v2H2zM2 4h2v12H2zm18 0h2v18h-2zm-2 14h2v2h-2z"/>'},"comment-text":{body:'<path fill="currentColor" d="M4 2h16v2H4zm0 14h14v2H4zm2-6h6v2H6zm0-4h12v2H6zM2 4h2v12H2zm18 0h2v18h-2zm-2 14h2v2h-2z"/>'},"comment-text-sharp":{body:'<path fill="currentColor" d="M2 2h20v2H2zm0 14h16v2H2zm4-6h6v2H6zm0-4h12v2H6zM2 4h2v12H2zm18 0h2v18h-2zm-2 14h2v2h-2z"/>'},compass:{body:'<path fill="currentColor" d="M18 22H6v-2h12zM6 20H4v-2h2zm14 0h-2v-2h2zm-10-4h2v2h-2v1H8v-9h2zm-6 2H2V6h2zm18 0h-2V6h2zm-8-2h-2v-2h2zm2-2h-2V8h-2V6h2V5h2zm-3-1h-2v-2h2zm-1-3h-2V8h2zM6 6H4V4h2zm14 0h-2V4h2zm-2-2H6V2h12z"/>'},"compass-solid":{body:'<path fill="currentColor" d="M18 4h2v2h2v12h-2v2h-2v2H6v-2H4v-2H2V6h2V4h2V2h12zm-4 2h-2v2h-2v2H8v9h2v-1h2v-2h2v-2h2V5h-2zm-1 7h-2v-2h2z"/>'},computer:{body:'<path fill="currentColor" d="M6 1h12v2H6zm0 8h12v2H6zM4 3h2v6H4zm14 0h2v6h-2zM4 13h16v2H4zm0 8h16v2H4zm-2-6h2v6H2zm18 0h2v6h-2zM6 17h2v2H6zm4 0h8v2h-8zm-2-6h2v2H8zm6 0h2v2h-2z"/>'},"computer-sharp":{body:'<path fill="currentColor" d="M4 1h16v2H4zm0 8h16v2H4zm0-6h2v6H4zm14 0h2v6h-2zM2 13h20v2H2zm0 8h20v2H2zm0-6h2v6H2zm18 0h2v6h-2zM6 17h2v2H6zm4 0h8v2h-8zm-2-6h2v2H8zm6 0h2v2h-2z"/>'},contact:{body:'<path fill="currentColor" d="M2 2h20v2H2zM0 4h2v16H0zm22 0h2v16h-2zM2 20h20v2H2zM14 7h6v2h-6zm0 4h6v2h-6zm0 4h4v2h-4zM6 7h4v4H6zm0 6h4v2H6zm4 2h2v2h-2zm-6 0h2v2H4z"/>'},"contact-delete":{body:'<path fill="currentColor" d="M22 3H0v18h16v-2H2V5h20v10h2V3zM6 7h4v4H6zm0 8H4v2h2zm4 0H6v-2h4zm0 0v2h2v-2zm4-8h6v2h-6zm6 4h-6v2h6zm-6 4h2v2h-2zm8 4h-2v-2h-2v2h2v2h-2v2h2v-2h2v2h2v-2h-2zm0 0h2v-2h-2z"/>',hidden:!0},"contact-multiple":{body:'<path fill="currentColor" d="M4 3h20v14H4zm18 12V5H6v10zm-2 4H2V7H0v14h20zM9 7h2v2H9zm3 4H8v2h4zm2-4h6v2h-6zm6 4h-6v2h6z"/>',hidden:!0},"contact-plus":{body:'<path fill="currentColor" d="M2 3h22v11h-2V5H2v14h12v2H0V3zm8 4H6v4h4zm-6 6h8v4H4zm16-6h-6v2h6zm-6 4h6v2h-6zm3 4h-3v2h3zm4 6v3h-2v-3h-3v-2h3v-3h2v3h3v2z"/>',hidden:!0},"contact-sharp":{body:'<path fill="currentColor" d="M0 2h24v2H0zm0 2h2v16H0zm22 0h2v16h-2zM0 20h24v2H0zM14 7h6v2h-6zm0 4h6v2h-6zm0 4h4v2h-4zM6 7h4v4H6zm0 6h4v2H6zm4 2h2v2h-2zm-6 0h2v2H4z"/>'},copy:{body:'<path fill="currentColor" d="M8 6h12v2H8zM4 2h12v2H4zm2 6h2v12H6zM2 4h2v12H2zm6 16h12v2H8zM20 8h2v12h-2zm-4-4h2v2h-2zM4 16h2v2H4z"/>'},"copy-sharp":{body:'<path fill="currentColor" d="M6 6h16v2H6zM2 2h16v2H2zm4 6h2v12H6zM2 4h2v12H2zm4 16h16v2H6zM20 8h2v12h-2zm-4-4h2v2h-2zM2 16h4v2H2z"/>'},"copy-x":{body:'<path fill="currentColor" d="M8 6h12v2H8zM4 2h12v2H4zm2 6h2v12H6zM2 4h2v12H2zm6 16h12v2H8zM20 8h2v12h-2zm-4-4h2v2h-2zM4 16h2v2H4zm7-5h2v2h-2zm4 4h2v2h-2zm0-4h2v2h-2zm-4 4h2v2h-2zm2-2h2v2h-2z"/>'},"copy-x-sharp":{body:'<path fill="currentColor" d="M6 6h16v2H6zM2 2h16v2H2zm4 6h2v12H6zM2 4h2v12H2zm4 16h16v2H6zM20 8h2v12h-2zm-4-4h2v2h-2zM2 16h4v2H2zm9-5h2v2h-2zm4 4h2v2h-2zm0-4h2v2h-2zm-4 4h2v2h-2zm2-2h2v2h-2z"/>'},"corner-down-left":{body:'<g fill="currentColor"><path d="M18 16H4v-2h14zm2-2h-2V4h2z"/><path d="M8 10h2v8H8zm-2 2h2v2H6zm0 4h2v2H6zm2 2h2v2H8z"/></g>'},"corner-down-left-sharp":{body:'<g fill="currentColor"><path d="M18 16H4v-2h14zm2 0h-2V4h2z"/><path d="M8 10h2v8H8zm-2 2h2v2H6zm0 4h2v2H6zm2 2h2v2H8z"/></g>'},"corner-down-right":{body:'<g fill="currentColor"><path d="M6 16h14v-2H6zm-2-2h2V4H4z"/><path d="M16 10h-2v8h2zm2 2h-2v2h2zm0 4h-2v2h2zm-2 2h-2v2h2z"/></g>'},"corner-down-right-sharp":{body:'<g fill="currentColor"><path d="M6 16h14v-2H6zm-2 0h2V4H4z"/><path d="M16 10h-2v8h2zm2 2h-2v2h2zm0 4h-2v2h2zm-2 2h-2v2h2z"/></g>'},"corner-left-down":{body:'<g fill="currentColor"><path d="M8 6v14h2V6zm2-2v2h10V4zm4 12v-2h-2v2zm-2 2v-2h-2v2zm-4 0v-2H6v2z"/><path d="M14 16v-2H4v2z"/></g>'},"corner-left-down-sharp":{body:'<g fill="currentColor"><path d="M8 4v16h2V4zm2 0v2h10V4zm4 12v-2h-2v2zm-2 2v-2h-2v2zm-4 0v-2H6v2z"/><path d="M14 16v-2H4v2z"/></g>'},"corner-left-up":{body:'<g fill="currentColor"><path d="M8 18V4h2v14zm2 2v-2h10v2zm4-12v2h-2V8zm-2-2v2h-2V6zM8 6v2H6V6z"/><path d="M12 8v2H4V8z"/></g>'},"corner-left-up-sharp":{body:'<g fill="currentColor"><path d="M8 18V4h2v14zm0 2v-2h12v2zm6-12v2h-2V8zm-2-2v2h-2V6zM8 6v2H6V6z"/><path d="M12 8v2H4V8z"/></g>'},"corner-right-down":{body:'<g fill="currentColor"><path d="M16 6v14h-2V6zm-2-2v2H4V4z"/><path d="M10 16v-2h10v2zm2 2v-2h2v2zm4 0v-2h2v2z"/><path d="M18 16v-2h2v2z"/></g>'},"corner-right-down-sharp":{body:'<g fill="currentColor"><path d="M16 4v16h-2V4zm-2 0v2H4V4z"/><path d="M10 16v-2h10v2zm2 2v-2h2v2zm4 0v-2h2v2z"/><path d="M18 16v-2h2v2z"/></g>'},"corner-right-up":{body:'<g fill="currentColor"><path d="M16 18V4h-2v14zm-2 2v-2H4v2z"/><path d="M10 8v2h8V8zm2-2v2h2V6zm4 0v2h2V6zm2 2v2h2V8z"/></g>'},"corner-right-up-sharp":{body:'<g fill="currentColor"><path d="M16 20V4h-2v16zm-2 0v-2H4v2z"/><path d="M10 8v2h8V8zm2-2v2h2V6zm4 0v2h2V6zm2 2v2h2V8z"/></g>'},"corner-up-left":{body:'<g fill="currentColor"><path d="M18 8H4v2h14zm2 2h-2v10h2zM8 14h2v-2H8zm-2-2h2v-2H6zm0-4h2V6H6z"/><path d="M8 12h2V4H8z"/></g>'},"corner-up-left-sharp":{body:'<g fill="currentColor"><path d="M18 8H4v2h14zm2 0h-2v12h2zM8 14h2v-2H8zm-2-2h2v-2H6zm0-4h2V6H6z"/><path d="M8 12h2V4H8z"/></g>'},"corner-up-right":{body:'<g fill="currentColor"><path d="M6 8h14v2H6zm-2 2h2v10H4zm12 4h-2v-2h2zm2-2h-2v-2h2zm0-4h-2V6h2z"/><path d="M16 12h-2V4h2z"/></g>'},"corner-up-right-sharp":{body:'<g fill="currentColor"><path d="M6 8h14v2H6zM4 8h2v12H4zm12 6h-2v-2h2zm2-2h-2v-2h2zm0-4h-2V6h2z"/><path d="M16 12h-2V4h2z"/></g>'},cpu:{body:'<path fill="currentColor" d="M5 3h14v2H5zm0 16h14v2H5zM3 5h2v14H3zm16 0h2v14h-2zM9 7h6v2H9zm0 8h6v2H9zM7 9h2v6H7zm8 0h2v6h-2zm-4-8h2v2h-2zm0 20h2v2h-2zM1 11h2v2H1zm20 0h2v2h-2zm0-4h2v2h-2zm0 8h2v2h-2zM1 15h2v2H1zm0-8h2v2H1zm6-6h2v2H7zm8 0h2v2h-2zm0 20h2v2h-2zm-8 0h2v2H7z"/>'},"cpu-sharp":{body:'<path fill="currentColor" d="M5 3h14v2H5zm0 16h14v2H5zM3 5h2v14H3zm16 0h2v14h-2zM7 7h10v2H7zm0 8h10v2H7zm0-6h2v6H7zm8 0h2v6h-2zm-4-8h2v2h-2zm0 20h2v2h-2zM1 11h2v2H1zm20 0h2v2h-2zm0-4h2v2h-2zm0 8h2v2h-2zM1 15h2v2H1zm0-8h2v2H1zm6-6h2v2H7zm8 0h2v2h-2zm0 20h2v2h-2zm-8 0h2v2H7z"/>'},"credit-card":{body:'<path fill="currentColor" d="M4 4h16v2H4zm0 14h16v2H4zM2 6h2v12H2zm18 0h2v12h-2zM4 8h16v4H4zm2 6h6v2H6z"/>'},"credit-card-delete":{body:'<path fill="currentColor" d="M20 4H2v16h12v-2H4v-6h16V8H4V6h16zm0 0h2v8h-2zm2 14h-2v-2h2v-2h-2v2h-2v-2h-2v2h2v2h-2v2h2v-2h2v2h2z"/>',hidden:!0},"credit-card-minus":{body:'<path fill="currentColor" d="M20 4H2v16h12v-2H4v-6h16V8H4V6h16zm0 0h2v8h-2zm2 12h-6v2h6z"/>',hidden:!0},"credit-card-multiple":{body:'<path fill="currentColor" d="M1 3h16v2H3v2h14v4H3v4h14v2H1zm18 0h-2v14h2zM5 19h16v2H5zM23 7h-2v14h2z"/>',hidden:!0},"credit-card-plus":{body:'<path fill="currentColor" d="M2 4h18v2H4v2h16v4H4v6h10v2H2zm20 0h-2v8h2zm-4 10h2v2h2v2h-2v2h-2v-2h-2v-2h2z"/>',hidden:!0},"credit-card-settings":{body:'<path fill="currentColor" d="M20 4H2v16h18v-2H4v-6h16V8H4V6h16zm0 0h2v16h-2zm-7 18h-2v2h2zm2 0h2v2h-2zm-6 0H7v2h2z"/>',hidden:!0},"credit-card-sharp":{body:'<path fill="currentColor" d="M2 4h20v2H2zm0 14h20v2H2zM2 6h2v12H2zm18 0h2v12h-2zM4 8h16v4H4zm2 6h6v2H6z"/>'},"credit-card-wireless":{body:'<path fill="currentColor" d="M16 2H8v2H6v2h2V4h8v2h2V4h-2zM8 8h2v2H8zm6 0V6h-4v2zm0 0h2v2h-2zM4 11h16v12H4zm14 10v-3H6v3zm0-6v-2H6v2z"/>',hidden:!0},crop:{body:'<path fill="currentColor" d="M18 16h4v2h-4v4h-2V8h2zm-4 2H8v-2h6zm-6-2H6v-6h2zM8 6h8v2H2V6h4V2h2z"/>'},"crop-sharp":{body:'<path fill="currentColor" d="M8 6h10v10h4v2h-4v4h-2V8H2V6h4V2h2zm0 10h6v2H6v-8h2z"/>'},cross:{body:'<path fill="currentColor" d="M14 22h-4v-2h4zm-4-2H8v-4H4v-2h6zm10-4h-4v4h-2v-6h6zM4 14H2v-4h2zm18 0h-2v-4h2zm-12-4H4V8h4V4h2zm6-2h4v2h-6V4h2zm-2-4h-4V2h4z"/>'},"cross-glyph":{body:'<path fill="currentColor" d="M16 8h6v8h-6v6H8v-6H2V8h6V2h8z"/>'},"cross-sharp":{body:'<path fill="currentColor" d="M16 8h6v8h-6v6H8v-6H2V8h6V2h8zm-6 2H4v4h6v6h4v-6h6v-4h-6V4h-4z"/>'},"cross-solid":{body:'<path fill="currentColor" d="M14 4h2v4h4v2h2v4h-2v2h-4v4h-2v2h-4v-2H8v-4H4v-2H2v-4h2V8h4V4h2V2h4z"/>'},crown:{body:'<g fill="currentColor"><path d="M3 3h2v12H3zm16 0h2v12h-2zm-8 0h2v2h-2zM9 5h2v2H9zM5 5h2v2H5z"/><path d="M3 3h2v2H3zm4 4h2v2H7zm6-2h2v2h-2zm2 2h2v2h-2zm2-2h2v2h-2zM5 15h14v2H5zm-2 4h18v2H3z"/></g>'},"crown-sharp":{body:'<g fill="currentColor"><path d="M3 3h2v12H3zm16 0h2v12h-2zm-8 0h2v2h-2zM9 5h2v2H9zM5 5h2v2H5z"/><path d="M3 3h2v2H3zm4 4h2v2H7zm6-2h2v2h-2zm2 2h2v2h-2zm2-2h2v2h-2zM3 15h18v2H3zm0 4h18v2H3z"/></g>'},"cursor-minimal":{body:'<path fill="currentColor" d="M6 4h2v16H6zm2 0h2v2H8zm2 2h2v2h-2zm2 2h2v2h-2zm2 2h2v2h-2zm2 2h2v2h-2zm-8 6h2v2H8zm2-2h2v2h-2zm2-2h6v2h-6z"/>'},cut:{body:'<g fill="currentColor"><path d="M1 17h2v4H1zm14 0h2v4h-2zM3 21h4v2H3zm14 0h4v2h-4zM3 15h4v2H3zm14 0h4v2h-4zM7 17h2v4H7zm14 0h2v4h-2zM7 15h2v2H7zm8 0h2v2h-2zm-6-2h2v2H9zm6 0h-2v2h2zm-4-2h2v2h-2z"/><path d="M13 11h-2v2h2zm0-2h2v2h-2zm-2 0H9v2h2zm4-2h2v2h-2zM9 7H7v2h2zm8-2h2v2h-2zM7 5H5v2h2zm12-2h2v2h-2zM5 3H3v2h2z"/></g>'},"cut-sharp":{body:'<g fill="currentColor"><path d="M1 15h2v8H1zm14 2h2v4h-2zM3 21h6v2H3zm12 0h6v2h-6zM3 15h4v2H3zm14 0h4v2h-4zM7 17h2v4H7zm14-2h2v8h-2zM7 15h2v2H7zm8 0h2v2h-2zm-6-2h2v2H9zm6 0h-2v2h2zm-4-2h2v2h-2z"/><path d="M13 11h-2v2h2zm0-2h2v2h-2zm-2 0H9v2h2zm4-2h2v2h-2zM9 7H7v2h2zm8-2h2v2h-2zM7 5H5v2h2zm12-2h2v2h-2zM5 3H3v2h2z"/></g>'},dashboard:{body:'<path fill="currentColor" d="M3 3h8v10H3zm2 2v6h4V5zm8-2h8v6h-8zm2 2v2h4V5zm-2 6h8v10h-8zm2 2v6h4v-6zM3 15h8v6H3zm2 2v2h4v-2z"/>',hidden:!0},database:{body:'<path fill="currentColor" d="M2 6h2v4H2zm0 4h2v4H2zm0 4h2v4H2zm18-8h2v4h-2zm0 4h2v4h-2zm0 4h2v4h-2zM4 4h4v2H4zm0 8h4v-2H4zm0 4h4v-2H4zm0 4h4v-2H4zM16 4h4v2h-4zm0 8h4v-2h-4zm0 4h4v-2h-4zm0 4h4v-2h-4zM8 2h8v2H8zm0 12h8v-2H8zm0 4h8v-2H8zm0 4h8v-2H8z"/>'},"date-time":{body:'<path fill="currentColor" d="M21 23h-8v-2h8zM9 21H3v-2h6zm4 0h-2v-8h2zm10 0h-2v-8h2zM3 7h14V5h2v4H3v10H1V5h2zm15 10h2v2h-2v-1h-2v-4h2zm3-4h-8v-2h8zM7 3h6V1h2v2h2v2H3V3h2V1h2z"/>'},debug:{body:'<path fill="currentColor" d="M8 6h8v2H8zm0 14h8v2H8zM6 8h2v12H6zm10 0h2v12h-2zM4 8h2v2H4zm16 0h-2v2h2zM4 18h2v2H4zm16 0h-2v2h2zM2 20h2v2H2zm20 0h-2v2h2zM2 6h2v2H2zm20 0h-2v2h2zM2 13h4v2H2zm20 0h-4v2h4zM6 2h2v2H6zm2 2h2v2H8zm6 0h2v2h-2zm2-2h2v2h-2zm-6 8h4v2h-4zm0 4h4v2h-4z"/>'},"debug-check":{body:'<path fill="currentColor" d="M8 2H6v2h2v2H6v3H4V7H2v2h2v2h2v2H2v2h4v2H4v2H2v2h2v-2h2v3h6v-2H8V8h8v6h2v-3h2V9h2V7h-2v2h-2V6h-2V4h2V2h-2v2h-2v2h-4V4H8zm6 9h-4v2h4zm-4 4h2v2h-2zm4 3h2v2h-2zm4 2v2h-2v-2zm2-2h-2v2h2zm0 0v-2h2v2z"/>',hidden:!0},"debug-off":{body:'<path fill="currentColor" d="M16 2h2v2h-2zm4 7h-2V6h-2V4h-2v2h-2v2h4v5h2v2h4v-2h-4v-2h2zm0 0V7h2v2zM8 20v-9H6V9H4V7H2v2h2v2h2v2H2v2h4v2H4v2H2v2h2v-2h2v3h10v-2zm2-5h2v2h-2zM2 2h2v2H2zm4 4H4V4h2zm2 2H6V6h2zm2 2H8V8h2zm0 0v2h2v2h2v2h2v2h2v2h2v2h2v-2h-2v-2h-2v-2h-2v-2h-2v-2h-2v-2z"/>',hidden:!0},"debug-pause":{body:'<path fill="currentColor" d="M8 2H6v2h2v2H6v3H4V7H2v2h2v2h2v2H2v2h4v2H4v2H2v2h2v-2h2v3h8v-2H8V8h8v6h2v-3h2V9h2V7h-2v2h-2V6h-2V4h2V2h-2v2h-2v2h-4V4H8zm6 9h-4v2h4zm-4 4h4v2h-4zm6 1h2v6h-2zm6 0h-2v6h2z"/>',hidden:!0},"debug-play":{body:'<path fill="currentColor" d="M6 2h2v2H6zm10 2h-2v2h-4V4H8v2H6v3H4V7H2v2h2v2h2v2H2v2h4v2H4v2H2v2h2v-2h2v3h8v-2H8V8h8v3h4V9h2V7h-2v2h-2V6h-2zm0 0V2h2v2zm-6 7h4v2h-4zm4 4h-4v2h4zm4-2h-2v10h2v-2h2v-2h2v-2h-2v-2h-2z"/>',hidden:!0},"debug-stop":{body:'<path fill="currentColor" d="M6 2h2v2H6zm10 2h-2v2h-4V4H8v2H6v3H4V7H2v2h2v2h2v2H2v2h4v2H4v2H2v2h2v-2h2v3h8v-2H8V8h8v6h2v-3h2V9h2V7h-2v2h-2V6h-2zm0 0V2h2v2zm-6 7h4v2h-4zm4 4h-4v2h4zm8 1h-6v6h6z"/>',hidden:!0},delete:{body:'<path fill="currentColor" d="M6 7h2v2H6zm14 0h2v10h-2zM8 5h12v2H8zM4 9h2v2H4zm-2 2h2v2H2zm2 2h2v2H4zm2 2h2v2H6zm2 2h12v2H8zm6-6h2v2h-2zm2 2h2v2h-2zm0-4h2v2h-2zm-4 4h2v2h-2zm0-4h2v2h-2z"/>'},"delete-sharp":{body:'<path fill="currentColor" d="M6 7h2v2H6zm14 0h2v10h-2zM8 5h14v2H8zM4 9h2v2H4zm-2 2h2v2H2zm2 2h2v2H4zm2 2h2v2H6zm2 2h14v2H8zm6-6h2v2h-2zm2 2h2v2h-2zm0-4h2v2h-2zm-4 4h2v2h-2zm0-4h2v2h-2z"/>'},deno:{body:'<path fill="currentColor" d="M14 20h4v2H6v-2h6v-3h2zm-8 0H4v-2h2zm16-2h-2v2h-2v-4h2V6h2zM4 18H2V6h2zm8-1H8v-2h4zm6-1h-2v-6h2zM8 15H6v-5h2zm5-2h-2v-2h2zm3-3H8V8h8zM6 6H4V4h2zm14 0h-2V4h2zm-2-2H6V2h12z"/>'},"deno-solid":{body:'<path fill="currentColor" d="M18 4h2v2h2v12h-2v-2h-2v2h2v2h-2v2h-4v-5h-2v5H6v-2H4v-2H2V6h2V4h2V2h12zM8 17h4v-2H8zm0-7H6v5h2zh8v6h2v-6h-2V8H8zm3 3h2v-2h-2z"/>'},deskphone:{body:'<path fill="currentColor" d="M3 3h18v18H3zm2 2v6h8V5zm10 0v14h4V5zm-2 14v-2h-3v2zm-5 0v-2H5v2zm-3-4h3v-2H5zm5-2v2h3v-2z"/>',hidden:!0},"device-laptop":{body:'<path fill="currentColor" d="M6 4H4v12h16V4zm12 2v8H6V6zm4 12H2v2h20z"/>',hidden:!0},"device-phone":{body:'<path fill="currentColor" d="M6 3h12v18H6zm10 16V5h-2v2h-4V5H8v14zm-5-4h2v2h-2z"/>',hidden:!0},"device-tablet":{body:'<path fill="currentColor" d="M6 2H4v20h16V2zm12 2v16H6V4zm-5 12h-2v2h2z"/>',hidden:!0},"device-tv":{body:'<path fill="currentColor" d="M2 20h20V6h-7V4h-2v2h-2V4H9v2H2zM9 4V2H7v2zm6 0h2V2h-2zm5 4v10H4V8z"/>',hidden:!0},"device-tv-smart":{body:'<path fill="currentColor" d="M4 4h18v14h-6v2H8v-2H2V4zm16 12V6H4v10z"/>',hidden:!0},"device-vibrate":{body:'<path fill="currentColor" d="M8 3H6v18h12V3zm8 2v14H8V5zm-3 10h-2v2h2zm7-8h2v2h-2zm2 4V9h2v2zm0 2h-2v-2h2zm0 2v-2h2v2zm0 0v2h-2v-2zM2 17h2v-2H2v-2h2v-2H2V9h2V7H2v2H0v2h2v2H0v2h2z"/>',hidden:!0},"device-watch":{body:'<path fill="currentColor" d="M8 2h8v4h5v12h-5v4H8v-4H3V6h5zM5 16h14V8H5zm6-6h2v2h2v2h-4z"/>',hidden:!0},devices:{body:'<path fill="currentColor" d="M2 2h16v6h4v14H12v-6H2zm14 6V4H4v10h8V8zm-6-2H6v2h4zm10 14V10h-6v10zm-4-4h2v2h-2zM6 10h4v2H6z"/>',hidden:!0},"diamond-gem":{body:'<path fill="currentColor" d="M7 1h10v2H7zM5 3h2v2H5zm12 0h2v2h-2zm2 2h2v2h-2zm0 8h2v2h-2zm-2 2h2v2h-2zm-2 2h2v2h-2zm-2 2h2v2h-2zm-2 2h2v2h-2zm-2-2h2v2H9zm-2-2h2v2H7zm-2-2h2v2H5zm-2-2h2v2H3zm0-8h2v2H3zM1 7h2v6H1zm20 0h2v6h-2zM3 9h18v2H3zm6-6h2v3H9zM7 6h2v3H7zm8 0h2v3h-2zm-8 5h2v2H7zm2 2h2v3H9zm2 3h2v3h-2zm2-3h2v3h-2zm2-2h2v2h-2zm-2-8h2v3h-2z"/>'},dice:{body:'<path fill="currentColor" d="M5 3H3v18h18V3zm14 2v14H5V5zM9 7H7v2h2zm6 0h2v2h-2zm-6 8H7v2h2zm6 0h2v2h-2zm-2-4h-2v2h2z"/>',hidden:!0},directions:{body:'<g fill="currentColor"><path d="M2 2h2v2H2zm2 2h2v2H4zm2-2h2v2H6zM2 6h2v2H2zm4 0h2v2H6zm11 9h3v2h-3zm-2 2h2v3h-2zm2 3h3v2h-3zm3-3h2v3h-2zM15 2h2v10h-2zm-2 2h2v2h-2z"/><path d="M11 6h9v2h-9z"/><path d="M19 6h2v2h-2zm-2-2h2v2h-2zM6 12h9v2H6zm-2 2h2v4H4zm0 6h2v2H4z"/></g>'},"directions-sharp":{body:'<g fill="currentColor"><path d="M2 2h2v2H2zm2 2h2v2H4zm2-2h2v2H6zM2 6h2v2H2zm4 0h2v2H6zm11 9h3v2h-3zm-2 2h2v3h-2zm2 3h3v2h-3zm3-3h2v3h-2zM15 2h2v10h-2zm-2 2h2v2h-2z"/><path d="M11 6h9v2h-9z"/><path d="M19 6h2v2h-2zm-2-2h2v2h-2zM4 12h13v2H4zm0 2h2v4H4zm0 6h2v2H4z"/></g>'},discord:{body:'<path fill="currentColor" d="M9 21H5v-2h4zm10 0h-4v-2h4zM5 19H3v-2h2zm12-2h-2v2h-2v-2h-2v2H9v-2H7v-2h10zm4 2h-2v-2h2zM3 17H1V7h2zm20 0h-2V7h2zm-12-4H8v-3h3zm5 0h-3v-3h3zM5 7H3V5h2zm10 0H9V5h6zm6 0h-2V5h2zM9 5H5V3h4zm10 0h-4V3h4z"/>'},"discord-solid":{body:'<path fill="currentColor" d="M9 5h6V3h4v2h2v2h2v10h-2v2h-2v2h-4v-2h-2v-2h4v-2H7v2h4v2H9v2H5v-2H3v-2H1V7h2V5h2V3h4zm4 8h3v-3h-3zm-5 0h3v-3H8z"/>'},dock:{body:'<path fill="currentColor" d="M4 4h16v2H4zm0 14h16v2H4zM2 6h2v12H2zm18 0h2v12h-2zM4 8h16v2H4zm2 6h12v2H6z"/>'},"dock-sharp":{body:'<path fill="currentColor" d="M2 4h20v2H2zm0 14h20v2H2zM2 6h2v12H2zm18 0h2v12h-2zM4 8h16v2H4zm2 6h12v2H6z"/>'},docker:{body:'<path fill="currentColor" d="M16 20H6v-2h10zM6 18H4v-2h2zm12 0h-2v-2h2zm2-2h-2v-4H4v4H2v-6h16V8h2zM9 15H7v-2h2zM6 8H4V6h2zm3 0H7V6h2zm3 0h-2V6h2zm6 0h-2V6h2zm4 0h-2V6h2zM9 5H7V3h2zm3 0h-2V3h2z"/>'},"docker-solid":{body:'<path fill="currentColor" d="M20 16h-2v2h-2v2H6v-2H4v-2H2v-6h16V8h2zM7 15h2v-2H7zM6 8H4V6h2zm3 0H7V6h2zm3 0h-2V6h2zm6 0h-2V6h2zm4 0h-2V6h2zM9 5H7V3h2zm3 0h-2V3h2z"/>'},dog:{body:'<path fill="currentColor" d="M14 22h-4v-2h4zm2-2h-2v-2h-4v2H8v-2H5v-2h6v-2h2v2h6v2h-3zM3 10h2v6H3v-4H1V6h2zm20 2h-2v4h-2v-6h2V6h2zm-12 0H9V8h2zm4 0h-2V8h2zm-8-2H5V6h2zm12 0h-2V6h2zM5 6H3V4h2zm14-2h-2v2h-2V4H9v2H7V4H5V2h14zm2 2h-2V4h2z"/>'},dollar:{body:'<path fill="currentColor" d="M17 18h-4v4h-2v-4H7v-2h10zm2-2h-2v-3h2zm-2-3H7v-2h10zM7 11H5V8h2zm6-5h4v2H7V6h4V2h2z"/>'},"dollar-sharp":{body:'<path fill="currentColor" d="M19 18h-6v4h-2v-4H5v-2h12v-3H5V6h6V2h2v4h6v2H7v3h12z"/>'},"door-closed":{body:'<path fill="currentColor" d="M3 19h18v2H3zM5 5h2v14H5zm2-2h10v2H7zm10 2h2v14h-2zm-8 6h2v2H9z"/>'},"door-closed-sharp":{body:'<path fill="currentColor" d="M3 19h18v2H3zM5 5h2v14H5zm0-2h14v2H5zm12 2h2v14h-2zm-8 6h2v2H9z"/>'},downasaur:{body:'<path fill="currentColor" d="M6 4h14v2h2v6h-8v2h6v2h-4v2h-2v2H2V8h2V6h2zm2 6h2V8H8z"/>',hidden:!0},download:{body:'<g fill="currentColor"><path d="M21 15v4h-2v-4zm-2 4v2H5v-2zM5 15v4H3v-4zm8-12v14h-2V3z"/><path d="M7 11v2h10v-2zm2 2v2h2v-2zm4 0v2h2v-2z"/><path d="M15 11v2h2v-2z"/></g>'},"download-sharp":{body:'<g fill="currentColor"><path d="M21 15v4h-2v-4zm0 4v2H3v-2zM5 15v4H3v-4zm8-12v14h-2V3z"/><path d="M7 11v2h10v-2zm2 2v2h2v-2zm4 0v2h2v-2z"/><path d="M15 11v2h2v-2z"/></g>'},draft:{body:'<path fill="currentColor" d="M14 2h-4v2H8v2H6v2H4v2H2v12h20V10h-2V8h-2V6h-2V4h-2zm0 2v2h2v2h2v4h-2v2h-2v2h-4v-2H8v-2H6V8h2V6h2V4zm-8 8v2h2v2h2v2h4v-2h2v-2h2v-2h2v8H4v-8z"/>',hidden:!0},"drag-and-drop":{body:'<path fill="currentColor" d="M11 21H9v-2h2zm10 0h-2v-2h2zM9 19H7V9h2zm10-4h-2v2h-2v2h-2v-6h6zm0 4h-2v-2h2zM5 17H3v-2h2zm0-4H3v-2h2zm16-2h-2V9h2zM5 9H3V7h2zm14 0H9V7h10zM5 5H3V3h2zm4 0H7V3h2zm4 0h-2V3h2zm4 0h-2V3h2z"/>'},"drag-and-drop-glyph":{body:'<path fill="currentColor" d="M21 11H11v10H7V7h14zm0 10h-2v-2h2zm-2-6h-2v2h-2v2h-2v-6h6zm0 4h-2v-2h2zM5 17H3v-2h2zm0-4H3v-2h2zm0-4H3V7h2zm0-4H3V3h2zm4 0H7V3h2zm4 0h-2V3h2zm4 0h-2V3h2z"/>'},"drag-and-drop-sharp":{body:'<path fill="currentColor" d="M21 11h-2V9H9v10h2v2H7V7h14zm0 10h-2v-2h2zm-2-6h-2v2h-2v2h-2v-6h6zm0 4h-2v-2h2zM5 17H3v-2h2zm0-4H3v-2h2zm0-4H3V7h2zm0-4H3V3h2zm4 0H7V3h2zm4 0h-2V3h2zm4 0h-2V3h2z"/>'},"drag-and-drop-solid":{body:'<path fill="currentColor" d="M19 9h2v2H11v10H9v-2H7V9h2V7h10zm2 12h-2v-2h2zm-2-6h-2v2h-2v2h-2v-6h6zm0 4h-2v-2h2zM5 17H3v-2h2zm0-4H3v-2h2zm0-4H3V7h2zm0-4H3V3h2zm4 0H7V3h2zm4 0h-2V3h2zm4 0h-2V3h2z"/>'},drop:{body:'<path fill="currentColor" d="M13 2h-2v2H9v4H7v4H5v6h2v2h2v2h6v-2h2v-2h2v-6h-2V8h-2V4h-2zm0 2v4h2v4h2v6h-2v2H9v-2H7v-6h2V8h2V4z"/>',hidden:!0},"drop-area":{body:'<path fill="currentColor" d="M5 3H3v2h2zm2 0h2v2H7zm6 0h-2v2h2zm2 0h2v2h-2zm4 0h2v2h-2zM3 7h2v2H3zm2 4H3v2h2zm-2 4h2v2H3zm2 4H3v2h2zm2 0h2v2H7zm6 0h-2v2h2zm6-8h2v2h-2zm2-4h-2v2h2zm-6 10v-2h6v2h-2v2h-2v2h-2zm4 2v2h2v-2z"/>',hidden:!0},"drop-full":{body:'<path fill="currentColor" d="M11 2h2v2h2v4h2v4h2v6h-2v2h-2v2H9v-2H7v-2H5v-6h2V8h2V4h2z"/>',hidden:!0},"drop-half":{body:'<path fill="currentColor" d="M13 2h-2v2H9v4H7v4H5v6h2v2h2v2h6v-2h2v-2h2v-6h-2V8h-2V4h-2zm0 2v4h2v4h2v3H7v-3h2V8h2V4z"/>',hidden:!0},drum:{body:'<path fill="currentColor" d="M8 3h8v2H8zm0 10h8v2H8zm0 6h8v2H8zm-4-8h4v2H4zm0 6h4v2H4zm16-6h-4v2h4zm0 6h-4v2h4zM2 7h2v4H2zm0 4h2v6H2zm20-4h-2v4h2zm0 4h-2v6h2zM6 5h2v2H6zM4 3h2v2H4zM2 1h2v2H2zm6 6h2v2H8zm4 2h2v2h-2zm2-2h2v2h-2zm2-2h2v2h-2zm2-2h2v2h-2z"/>'},duplicate:{body:'<path fill="currentColor" d="M5 3h12v4h4v14H7v-4H3V3zm10 4V5H5v10h2V7zM9 17v2h10V9H9z"/>',hidden:!0},"duplicate-alt":{body:'<path fill="currentColor" d="M5 1H3v14h10v2h-2v2h2v-2h2v-2h2v-2h-2v-2h-2V9h-2v2h2v2H5V3h12V1zm4 4H7v6h2V7h10v14H9v-4H7v6h14V5z"/>',hidden:!0},earth:{body:'<path fill="currentColor" d="M6 2h12v2H6zm0 18h12v2H6zM18 4h2v2h-2zM4 18h2v2H4zM4 4h2v2H4zm14 14h2v2h-2zM2 6h2v12H2zm18 0h2v12h-2zM8 4h2v4H8zm2 4h4v2h-4zm4 2h4v2h-4zm4-2h2v2h-2zM4 12h2v2H4zm6 4h2v4h-2zm-4-2h4v2H6zm8 2h2v4h-2zm2-2h4v2h-4z"/>'},edit:{body:'<path fill="currentColor" d="M18 2h-2v2h-2v2h-2v2h-2v2H8v2H6v2H4v2H2v6h6v-2h2v-2h2v-2h2v-2h2v-2h2v-2h2V8h2V6h-2V4h-2zm0 8h-2v2h-2v2h-2v2h-2v2H8v-2H6v-2h2v-2h2v-2h2V8h2V6h2v2h2zM6 16H4v4h4v-2H6z"/>',hidden:!0},"edit-box":{body:'<path fill="currentColor" d="M18 2h-2v2h2zM4 4h6v2H4v14h14v-6h2v8H2V4zm4 8H6v6h6v-2h2v-2h-2v2H8zm4-2h-2v2H8v-2h2V8h2V6h2v2h-2zm2-6h2v2h-2zm4 0h2v2h2v2h-2v2h-2v2h-2v-2h2V8h2V6h-2zm-4 8h2v2h-2z"/>',hidden:!0},eraser:{body:'<path fill="currentColor" d="M15 18h6v2H7v-2h6v-2h2zm-8 0H5v-2h2zm-2-2H3v-2h2zm12 0h-2v-2h2zM7 14H5v-2h2zm8 0h-2v-2h2zm4 0h-2v-2h2zM9 12H7v-2h2zm4 0h-2v-2h2zm8 0h-2v-2h2zm-10-2H9V8h2zm8 0h-2V8h2zm-6-2h-2V6h2zm4 0h-2V6h2zm-2-2h-2V4h2z"/>'},"eraser-solid":{body:'<path fill="currentColor" d="M15 6h2v2h2v2h2v2h-2v2h-4v-2h-2v2h2v4h6v2H7v-2H5v-2H3v-2h2v-2h2v-2h4v2h2v-2h-2V6h2V4h2z"/>'},estate:{body:'<path fill="currentColor" d="M2 20h20v2H2zM2 4h2v16H2zm2-2h8v2H4zm8 2h2v16h-2zM6 6h4v2H6zm0 4h4v2H6zm1 6h2v4H7zm11-6h2v2h-2zm2 2h2v4h-2zm-4 0h2v4h-2zm2 4h2v4h-2z"/>'},"estate-sharp":{body:'<path fill="currentColor" d="M2 20h20v2H2zM2 4h2v16H2zm0-2h12v2H2zm10 2h2v16h-2zM6 6h4v2H6zm0 4h4v2H6zm1 6h2v4H7zm9-6h6v2h-6zm4 2h2v6h-2zm-4 0h2v6h-2zm2 4h2v4h-2z"/>'},euro:{body:'<path fill="currentColor" d="M19 20H9v-2h10zM9 9h7v2H9v2h7v2H9v3H7v-3H5v-2h2v-2H5V9h2V6h2zm10-3H9V4h10z"/>'},"euro-sharp":{body:'<path fill="currentColor" d="M19 4v2H9v3h7v2H9v2h7v2H9v3h10v2H7v-5H5v-2h2v-2H5V9h2V4z"/>'},expand:{body:'<path fill="currentColor" d="M4 13h16v-2H4zm7-8h2V3h-2zM9 7h4V5H9zm4 0h2V5h-2zm2 2h2V7h-2zM7 9h8V7H7zm4 10h2v2h-2zm-2-2h4v2H9zm4 0h2v2h-2zm2-2h2v2h-2zm-8 0h8v2H7z"/>'},"external-link":{body:'<g fill="currentColor"><path d="M11 5H5v2h6zM5 7H3v12h2zm12 12H5v2h12zm2-6h-2v6h2zm-8 0H9v2h2zm2-2h-2v2h2zm2-2h-2v2h2zm2-2h-2v2h2zm2-2h-2v2h2zm2-2h-2v8h2z"/><path d="M21 3h-8v2h8z"/></g>'},"external-link-sharp":{body:'<g fill="currentColor"><path d="M11 5H3v2h8zM5 7H3v12h2zm14 12H3v2h16zm0-6h-2v6h2zm-8 0H9v2h2zm2-2h-2v2h2zm2-2h-2v2h2zm2-2h-2v2h2zm2-2h-2v2h2zm2-2h-2v8h2z"/><path d="M21 3h-8v2h8z"/></g>'},eye:{body:'<path fill="currentColor" d="M16 20H8v-2h8zm-8-2H4v-2h4zm12 0h-4v-2h4zM4 16H2v-2h2zm10-6h-2v2h2zh2v4h-2v2h-4v-2H8v-4h2V8h4zm8 6h-2v-2h2zM2 14H0v-4h2zm22 0h-2v-4h2zM4 10H2V8h2zm18 0h-2V8h2zM8 8H4V6h4zm12 0h-4V6h4zm-4-2H8V4h8z"/>'},"eye-closed":{body:'<path fill="currentColor" d="M0 7h2v2H0zm4 4H2V9h2zm4 2v-2H4v2H2v2h2v-2zm8 0H8v2H6v2h2v-2h8v2h2v-2h-2zm4-2h-4v2h4v2h2v-2h-2zm2-2v2h-2V9zm0 0V7h2v2z"/>',hidden:!0},"eye-off":{body:'<g fill="currentColor"><path d="M0 10h2v4H0zm24 0h-2v4h2zm-8 0h-2v2h2zm-6 0H8v4h2zM2 8h2v2H2zm0 8h2v-2H2zm20-8h-2v2h2zm0 8h-2v-2h2zM4 6h4v2H4zm0 12h4v-2H4zM20 6h-4v2h4zM10 4h6v2h-6zM8 20h8v-2H8zm4-12h2v2h-2zm-2 6h4v2h-4zM8 8h2v2H8zm2 2h2v4h-2zm2 2h2v2h-2z"/><path d="M6 6h2v2H6zM4 4h2v2H4zM2 2h2v2H2zm12 12h2v2h-2zm2 2h2v2h-2zm2 2h2v2h-2zm2 2h2v2h-2z"/></g>'},facebook:{body:'<path fill="currentColor" d="M11 12H8v2h3v6h2v-6h4v-2h-4V6h4V4h-4V2h6v6h-4v2h4v6h-4v6H9v-6H6v-6h3V6h2zm2-6h-2V4h2z"/>'},"facebook-solid":{body:'<path fill="currentColor" d="M17 6h-4v4h4v4h-4v8H9v-8H6v-4h3V4h2V2h6z"/>'},factory:{body:'<path fill="currentColor" d="M2 4h2v16H2zm2 16h16v2H4zM20 7h2v13h-2zm-2 0h2v2h-2zm-6 0h2v2h-2zm4 2h2v2h-2zm-6 0h2v2h-2zm4-2h2v6h-2zM8 4h2v9H8zM4 2h6v2H4zm3 13h2v2H7zm4 0h2v2h-2zm4 0h2v2h-2z"/>'},"factory-sharp":{body:'<path fill="currentColor" d="M2 2h2v20H2zm2 18h16v2H4zM20 7h2v15h-2zm-2 0h2v2h-2zm-6 0h2v2h-2zm4 2h2v2h-2zm-6 0h2v2h-2zm4-2h2v6h-2zM8 4h2v9H8zM4 2h6v2H4zm3 13h2v2H7zm4 0h2v2h-2zm4 0h2v2h-2z"/>'},feather:{body:'<path fill="currentColor" d="M2 20h2v2H2zm6-2h6v2H8zm-2-2h2v2H6zm-2 2h2v2H4zm4-4h2v2H8zm2-2h2v2h-2zm2-2h2v2h-2zm2-2h2v2h-2zm0 8h2v2h-2zm2-2h2v2h-2zm2-2h2v2h-2zm2-6h2v6h-2zm-2-2h2v2h-2zM4 10h2v6H4zm2-2h2v2H6zm2-2h2v2H8zm2-2h2v2h-2zm2-2h6v2h-6z"/>'},figma:{body:'<path fill="currentColor" d="M11 22H7v-2h4zm-4-2H5v-4h2zM17 4h-4v4h4v2h-4v4h4v2h-4v4h-2v-4H7v-2h4v-4H7V8h4V4H7V2h10zM7 14H5v-4h2zm12 0h-2v-4h2zM7 8H5V4h2zm12 0h-2V4h2z"/>'},file:{body:'<g fill="currentColor"><path d="M6 4H4v16h2zm10-2H6v2h10zm4 4h-2v14h2zm-2 14H6v2h12zM16 4h2v2h-2zm-4 0h2v6h-2z"/><path d="M12 8h6v2h-6z"/></g>'},"file-alt":{body:'<path fill="currentColor" d="M21 22H3V2h12v2h2v2h2v2h2zM17 6h-2v2h2zM5 4v16h14V10h-6V4zm8 12H7v2h6zm-6-4h10v2H7zm4-4H7v2h4z"/>',hidden:!0},"file-delete":{body:'<path fill="currentColor" d="M11 22h10V8h-2V6h-2v2h-2V6h2V4h-2V2H3v12h2V4h8v6h6v10h-8zm-4-2H5v2H3v-2h2v-2H3v-2h2v2h2v-2h2v2H7zm0 0h2v2H7z"/>',hidden:!0},"file-flash":{body:'<path fill="currentColor" d="M19 22h-6v-2h6V10h-6V4H5v8H3V2h12v2h2v2h2v2h2v14zM17 6h-2v2h2zM7 12h2v4h4v2h-2v2H9v2H7v-4H3v-2h2v-2h2z"/>',hidden:!0},"file-minus":{body:'<path fill="currentColor" d="M13 22h8V8h-2V6h-2v2h-2V6h2V4h-2V2H3v13h2V4h8v6h6v10h-6zm-2-3H3v-2h8z"/>',hidden:!0},"file-multiple":{body:'<path fill="currentColor" d="M21 18H7V2h8v2h2v2h-2v2h2V6h2v2h2zM9 4v12h10v-6h-6V4zM3 6h2v14h12v2H3z"/>',hidden:!0},"file-off":{body:'<path fill="currentColor" d="M5 2H3v2h2v2h2v2h2v2h2v2h2v2h2v2h2v2h2v2h2v2h2v-2h-2v-2h-2v-2h-2v-2h-2v-2h-2v-2h6v4h2V8h-2V6h-2V4h-2V2H9v2h4v6h-2V8H9V6H7V4H5zm12 4v2h-2V6zM3 8h2v12h12v2H3z"/>',hidden:!0},"file-plus":{body:'<path fill="currentColor" d="M19 22h-7v-2h7V10h-6V4H5v8H3V2h12v2h2v2h2v2h2v14zM17 6h-2v2h2zM8 19h3v-2H8v-3H6v3H3v2h3v3h2z"/>',hidden:!0},"file-sharp":{body:'<g fill="currentColor"><path d="M6 4H4v16h2zm10-2H4v2h12zm4 4h-2v14h2zm0 14H4v2h16zM16 4h2v2h-2zm-4 0h2v6h-2z"/><path d="M12 8h6v2h-6z"/></g>'},"file-text":{body:'<g fill="currentColor"><path d="M6 4H4v16h2zm10-2H6v2h10zm4 4h-2v14h2zm-2 14H6v2h12zM16 4h2v2h-2zm-4 0h2v6h-2z"/><path d="M12 8h6v2h-6zm-4 8h8v2H8zm0-4h8v2H8zm0-4h2v2H8z"/></g>'},"file-text-sharp":{body:'<g fill="currentColor"><path d="M6 4H4v16h2zm10-2H4v2h12zm4 4h-2v14h2zm0 14H4v2h16zM16 4h2v2h-2zm-4 0h2v6h-2z"/><path d="M12 8h6v2h-6zm-4 8h8v2H8zm0-4h8v2H8zm0-4h2v2H8z"/></g>'},files:{body:'<g fill="currentColor"><path d="M9 3H7v14h2zM5 7H3v14h2zm12-6H9v2h8zm4 4h-2v12h2zm-2 12H9v2h10zm-4 4H5v2h10zm2-18h2v2h-2zm-4 0h2v6h-2z"/><path d="M13 7h6v2h-6zM5 5h2v2H5zm10 14h2v2h-2z"/></g>'},"files-sharp":{body:'<g fill="currentColor"><path d="M9 3H7v14h2zM5 7H3v14h2zm12-6H9v2h8zm4 4h-2v12h2zm-2 12H9v2h10zm-4 4H5v2h10zm2-18h2v2h-2zm-4 0h2v6h-2z"/><path d="M13 7h6v2h-6zM5 5h2v2H5zm10 14h2v2h-2z"/></g>'},fill:{body:'<path fill="currentColor" d="M9 2h2v2H9zm4 4V4h-2v2H9v2H7v2H5v2H3v2h2v2h2v2h2v2h2v2h2v-2h2v-2h2v-2h2v6h2V12h-2v-2h-2V8h-2V6zm0 0v2h2v2h2v2h2v2h-2v2h-2v2h-2v2h-2v-2H9v-2H7v-2H5v-2h2v-2h2V8h2V6z"/>',hidden:!0},"fill-half":{body:'<path fill="currentColor" d="M9 2h2v2H9zm4 4V4h-2v2H9v2H7v2H5v2H3v2h2v2h2v2h2v2h2v2h2v-2h2v-2h2v-2h2v6h2V12h-2v-2h-2V8h-2V6zm0 0v2h2v2h2v2h2v2H5v-2h2v-2h2V8h2V6z"/>',hidden:!0},filter:{body:'<path fill="currentColor" d="M11 20h2v2H9V12h2zm4 0h-2v-8h2zm-6-8H7v-2h2zm8 0h-2v-2h2zM7 10H5V8h2zm12 0h-2V8h2zm2-2h-2V4H5v4H3V2h18z"/>'},fire:{body:'<g fill="currentColor"><path d="M9 2h2v4H9zM7 6h2v2H7zM5 8h2v2H5zm8 2h2v2h-2zm2-2h2v2h-2zm2 2h2v2h-2zm2 2h2v6h-2zM3 10h2v8H3zm8-4h2v4h-2zm6 12h2v2h-2zM7 20h10v2H7zm-2-2h2v2H5zm4-2h6v4H9z"/><path d="M11 14h2v3h-2z"/></g>'},fish:{body:'<path fill="currentColor" d="M20 9h2v6h-2zm-2-2h2v2h-2zm0 8h2v2h-2zm-6 2h6v2h-6zm0-12h6v2h-6zM2 7h2v10H2zm2 2h2v2H4zm0 4h2v2H4zm2-2h2v2H6zm2-2h2v2H8zm0 4h2v2H8zm2 2h2v2h-2zm0-8h2v2h-2zm5 3h2v2h-2z"/>'},flag:{body:'<g fill="currentColor"><path d="M4 2h2v20H4z"/><path d="M4 4h16v2H4zm12 2h2v2h-2zm-2 2h2v2h-2zm2 2h2v2h-2zM4 12h16v2H4z"/></g>'},flatten:{body:'<g fill="currentColor"><path d="M4 16h16v2H4zm4 4h8v2H8zm3-18h2v12h-2z"/><path d="M9 10h6v2H9zM7 8h10v2H7z"/></g>'},"flip-horizontal-2":{body:'<path fill="currentColor" d="M11 7h2v4h-2zm0-6h2v4h-2zm0 12h2v4h-2zm0 6h2v4h-2zm-4-8h2v2H7zm10 0h-2v2h2zM5 13h2v2H5zm14 0h-2v2h2zM5 9h2v4H5zm14 0h-2v4h2zM3 7h2v10H3zm18 0h-2v10h2z"/>'},"flip-to-back":{body:'<path fill="currentColor" d="M9 3H7v2h2zm0 12H7v2h2zm2-12h2v2h-2zm2 12h-2v2h2zm2-12h2v2h-2zm2 12h-2v2h2zm2-12h2v2h-2zm2 4h-2v2h2zM7 7h2v2H7zm14 4h-2v2h2zM7 11h2v2H7zm14 4h-2v2h2zM3 7h2v12h12v2H3z"/>',hidden:!0},"flip-to-front":{body:'<path fill="currentColor" d="M21 3H7v14h14zm-2 12H9V5h10zM5 7H3v2h2zm-2 4h2v2H3zm2 4H3v2h2zm-2 4h2v2H3zm6 0H7v2h2zm2 0h2v2h-2zm6 0h-2v2h2z"/>',hidden:!0},"flip-vertical-2":{body:'<path fill="currentColor" d="M17 11v2h-4v-2zm6 0v2h-4v-2zm-12 0v2H7v-2zm-6 0v2H1v-2zm8-4v2h-2V7zm0 10v-2h-2v2zm0-12v2H9V5zm0 14v-2H9v2zm2-14v2h-2V5zm0 14v-2h-2v2zm2-16v2H7V3zm0 18v-2H7v2z"/>'},"float-center":{body:'<path fill="currentColor" d="M18 6h4v2h-4zm0 4h4v2h-4zM2 6h4v2H2zm0 4h4v2H2zm0 4h20v2H2zm0 4h20v2H2zm8-14h4v2h-4zm0 6h4v2h-4zM8 6h2v4H8zm6 0h2v4h-2z"/>'},"float-center-sharp":{body:'<path fill="currentColor" d="M18 6h4v2h-4zm0 4h4v2h-4zM2 6h4v2H2zm0 4h4v2H2zm0 4h20v2H2zm0 4h20v2H2zM8 4h8v2H8zm0 6h8v2H8zm0-4h2v4H8zm6 0h2v4h-2z"/>'},"float-left":{body:'<path fill="currentColor" d="M12 6h10v2H12zm0 4h10v2H12zM2 14h20v2H2zm0 4h20v2H2zM4 4h4v2H4zm0 6h4v2H4zM2 6h2v4H2zm6 0h2v4H8z"/>'},"float-left-sharp":{body:'<path fill="currentColor" d="M12 6h10v2H12zm0 4h10v2H12zM2 14h20v2H2zm0 4h20v2H2zM2 4h8v2H2zm0 6h8v2H2zm0-4h2v4H2zm6 0h2v4H8z"/>'},"float-right":{body:'<path fill="currentColor" d="M2 6h10v2H2zm0 4h10v2H2zm0 4h20v2H2zm0 4h20v2H2zM16 4h4v2h-4zm0 6h4v2h-4zm-2-4h2v4h-2zm6 0h2v4h-2z"/>'},"float-right-sharp":{body:'<path fill="currentColor" d="M2 6h10v2H2zm0 4h10v2H2zm0 4h20v2H2zm0 4h20v2H2zM14 4h8v2h-8zm0 6h8v2h-8zm0-4h2v4h-2zm6 0h2v4h-2z"/>'},folder:{body:'<path fill="currentColor" d="M4 4h6v2H4zm0 14h16v2H4zM20 8h2v10h-2zM2 6h2v12H2zm8 0h10v2H10z"/>'},"folder-minus":{body:'<path fill="currentColor" d="M12 4H2v16h20V6H12zm-2 4h10v10H4V6h6zm8 6v-2h-6v2z"/>',hidden:!0},"folder-plus":{body:'<g fill="currentColor"><path d="M4 4h6v2H4zm0 14h10v2H4zM20 8h2v6h-2zM2 6h2v12H2zm8 0h10v2H10zm12 12v2h-6v-2z"/><path d="M18 16h2v6h-2z"/></g>'},"folder-plus-sharp":{body:'<g fill="currentColor"><path d="M2 4h10v2H2zm0 14h12v2H2zM20 6h2v8h-2zM2 6h2v12H2zm8 0h10v2H10zm12 12v2h-6v-2z"/><path d="M18 16h2v6h-2z"/></g>'},"folder-sharp":{body:'<path fill="currentColor" d="M2 4h10v2H2zm0 14h20v2H2zM20 6h2v12h-2zM2 6h2v12H2zm8 0h10v2H10z"/>'},"folder-x":{body:'<path fill="currentColor" d="M12 4H2v16h20V6H12zm-2 4h10v10H4V6h6zm6 4h-2v-2h-2v2h2v2h-2v2h2v-2h2v2h2v-2h-2zm0 0h2v-2h-2z"/>',hidden:!0},forward:{body:'<path fill="currentColor" d="M2 11h2v6H2zm2 6h2v2H4zm2-2h4v2H6zm0-8h4v2H6zm4 8h2v6h-2zm0-12h2v6h-2zm2 16h2v2h-2zm2-2h2v2h-2zm2-2h2v2h-2zm2-2h2v2h-2zm2-2h2v2h-2zm-2-2h2v2h-2zm-2-2h2v2h-2zm-2-2h2v2h-2zm-2-2h2v2h-2zM4 9h2v2H4z"/>'},"forward-sharp":{body:'<g fill="currentColor"><path d="M2 7h2v12H2zm0 12h6v2H2zm4-4h4v2H6zM4 7h6v2H4zm6 8h2v6h-2z"/><path d="M6 15h2v6H6zm4-12h2v6h-2zm2 16h2v2h-2zm2-2h2v2h-2zm2-2h2v2h-2zm2-2h2v2h-2zm2-2h2v2h-2zm-2-2h2v2h-2zm-2-2h2v2h-2zm-2-2h2v2h-2zm-2-2h2v2h-2z"/></g>'},forwardburger:{body:'<path fill="currentColor" d="M13 7H3v2h10zm8 4h-2V9h-2V7h-2v2h2v2H3v2h14v2h-2v2h2v-2h2v-2h2zM3 15h10v2H3z"/>',hidden:!0},frame:{body:'<path fill="currentColor" d="M7 5h10V2h2v3h3v2h-3v10h3v2h-3v3h-2v-3H7v3H5v-3H2v-2h3V7H2V5h3V2h2zm0 12h10V7H7z"/>'},"frame-add":{body:'<path fill="currentColor" d="M2 3h20v18H2zm18 16V7H4v12zm-7-7h3v2h-3v3h-2v-3H8v-2h3V9h2z"/>',hidden:!0},"frame-check":{body:'<path fill="currentColor" d="M2 3h20v18H2zm18 16V7H4v12zm-4-9h-2v2h-2v2h-2v-2H8v2h2v2h2v-2h2v-2h2z"/>',hidden:!0},"frame-delete":{body:'<path fill="currentColor" d="M2 3h20v18H2zm18 16V7H4v12zM9 10h2v2H9zm4 2h-2v2H9v2h2v-2h2v2h2v-2h-2zm0 0v-2h2v2z"/>',hidden:!0},"frame-minus":{body:'<path fill="currentColor" d="M2 3h20v18H2zm18 16V7H4v12zM8 12h8v2H8z"/>',hidden:!0},frown:{body:'<path fill="currentColor" d="M6 20h12v2H6zM6 2h12v2H6zm12 2h2v2h-2zM4 4h2v2H4zm0 14h2v2H4zm14 0h2v2h-2zM2 6h2v12H2zm18 0h2v12h-2zM8 8h2v2H8zm6 0h2v2h-2zm-7 7h2v2H7zm2-2h6v2H9zm6 2h2v2h-2z"/>'},"gallery-thumbnails":{body:'<path fill="currentColor" d="M4 2h16v2H4zM2 4h2v12H2zm2 12h16v2H4zM20 4h2v12h-2zM3 20h3v2H3zm5 0h3v2H8zm5 0h3v2h-3zm5 0h3v2h-3z"/>'},"gallery-thumbnails-sharp":{body:'<path fill="currentColor" d="M4 2h16v2H4zM2 2h2v16H2zm2 14h16v2H4zM20 2h2v16h-2zM3 20h3v2H3zm5 0h3v2H8zm5 0h3v2h-3zm5 0h3v2h-3z"/>'},gamepad:{body:'<g fill="currentColor"><path d="M4 4h16v2H4zm0 14h16v2H4zM2 6h2v12H2zm18 0h2v12h-2zM8 9h2v6H8z"/><path d="M6 11h6v2H6zm8-2h2v2h-2zm2 4h2v2h-2z"/></g>'},"gamepad-sharp":{body:'<g fill="currentColor"><path d="M4 4h16v2H4zm0 14h16v2H4zM2 4h2v16H2zm18 0h2v16h-2zM8 9h2v6H8z"/><path d="M6 11h6v2H6zm8-2h2v2h-2zm2 4h2v2h-2z"/></g>'},gear:{body:'<path fill="currentColor" d="M18 22h-5v2h-2v-2H6v-2h12zM4 22H2v-2h2zm18 0h-2v-2h2zM6 20H4v-2h2zm14 0h-2v-2h2zM4 18H2v-5H0v-2h2V6h2zm4 0H6v-2h2zm14-7h2v2h-2v5h-2v-5h-4v3H8V8h8v3h4V6h2zm-12-1v4h4v-4zM8 8H6V6h2zM6 6H4V4h2zm14 0h-2V4h2zM4 4H2V2h2zm9-2h5v2H6V2h5V0h2zm9 2h-2V2h2z"/>'},"gear-solid":{body:'<path fill="currentColor" d="M18 22h-5v2h-2v-2H6v-2h12zM4 22H2v-2h2zm18 0h-2v-2h2zM6 20H4v-2h2zm14 0h-2v-2h2zM4 18H2v-5H0v-2h2V6h2zm4 0H6v-2h2zm14-7h2v2h-2v5h-2v-5h-4v3H8V8h8v3h4V6h2zM8 8H6V6h2zM6 6H4V4h2zm14 0h-2V4h2zM4 4H2V2h2zm9-2h5v2H6V2h5V0h2zm9 2h-2V2h2z"/>'},gif:{body:'<path fill="currentColor" d="M3 7h6v2H3v6h4v-2H5v-2h4v6H1V7zm14 0h6v2h-6v2h4v2h-4v4h-2V7zm-4 0h-2v10h2z"/>',hidden:!0},gift:{body:'<path fill="currentColor" d="M4 6h16v2H4zM2 8h2v4H2zm2 4h16v2H4zm16-4h2v4h-2zM6 4h2v2H6zm2-2h3v2H8zm3 2h2v2h-2zm2-2h3v2h-3zm3 2h2v2h-2zM4 14h2v6H4zm2 6h12v2H6zm12-6h2v6h-2zm-7-6h2v4h-2zm0 6h2v6h-2z"/>'},"gift-sharp":{body:'<path fill="currentColor" d="M2 6h20v2H2zm0 2h2v4H2zm0 4h20v2H2zm18-4h2v4h-2zM6 4h2v2H6zm2-2h3v2H8zm3 2h2v2h-2zm2-2h3v2h-3zm3 2h2v2h-2zM4 14h2v6H4zm0 6h16v2H4zm14-6h2v6h-2zm-7-6h2v4h-2zm0 6h2v6h-2z"/>'},"git-branch":{body:'<path fill="currentColor" d="M4 14h4v2H4zm0 6h4v2H4zm-2-4h2v4H2zm6 0h2v4H8zm8-14h4v2h-4zm0 6h4v2h-4zm-2-4h2v4h-2zm6 0h2v4h-2zm-8 13h5v2h-5zm5-5h2v5h-2zM5 2h2v10H5z"/>'},"git-branch-sharp":{body:'<path fill="currentColor" d="M2 14h8v2H2zm0 6h8v2H2zm0-4h2v4H2zm6 0h2v4H8zm6-14h8v2h-8zm0 6h8v2h-8zm0-4h2v4h-2zm6 0h2v4h-2zm-8 13h7v2h-7zm5-5h2v5h-2zM5 2h2v10H5z"/>'},"git-commit":{body:'<path fill="currentColor" d="M9 7h6v2H9zM7 9h2v6H7zm2 6h6v2H9zm6-6h2v6h-2zM0 11h5v2H0zm19 0h5v2h-5z"/>'},"git-commit-sharp":{body:'<path fill="currentColor" d="M7 7h10v2H7zm0 2h2v6H7zm0 6h10v2H7zm8-6h2v6h-2zM0 11h5v2H0zm19 0h5v2h-5z"/>'},"git-merge":{body:'<path fill="currentColor" d="M4 2h4v2H4zm0 6h4v2H4zM2 4h2v4H2zm6 0h2v4H8zm8 10h4v2h-4zm0 6h4v2h-4zm-2-4h2v4h-2zm6 0h2v4h-2zM5 12h2v10H5zm7 0h2v2h-2zm-2-2h2v2h-2z"/>'},"git-merge-sharp":{body:'<path fill="currentColor" d="M2 2h8v2H2zm0 6h8v2H2zm0-4h2v4H2zm6 0h2v4H8zm6 10h8v2h-8zm0 6h8v2h-8zm0-4h2v4h-2zm6 0h2v4h-2zM5 12h2v10H5zm7 0h2v2h-2zm-2-2h2v2h-2z"/>'},"git-pull-request":{body:'<path fill="currentColor" d="M4 10h4V8H4zm0-6h4V2H4zM2 8h2V4H2zm6 0h2V4H8zm8 14h4v-2h-4zm0-6h4v-2h-4zm-2 4h2v-4h-2zm6 0h2v-4h-2zM12 7h5V5h-5zM5 22h2V12H5z"/>'},"git-pull-request-sharp":{body:'<path fill="currentColor" d="M2 10h8V8H2zm0-6h8V2H2zm0 4h2V4H2zm6 0h2V4H8zm6 14h8v-2h-8zm0-6h8v-2h-8zm0 4h2v-4h-2zm6 0h2v-4h-2zM12 7h5V5h-5zM5 22h2V12H5z"/>'},github:{body:'<path fill="currentColor" d="M5 2h4v2H7v2H5zm0 10H3V6h2zm2 2H5v-2h2zm2 2v-2H7v2H3v-2H1v2h2v2h4v4h2v-4h2v-2zm0 0v2H7v-2zm6-12v2H9V4zm4 2h-2V4h-2V2h4zm0 6V6h2v6zm-2 2v-2h2v2zm-2 2v-2h2v2zm0 2h-2v-2h2zm0 0h2v4h-2z"/>'},"github-2":{body:'<path fill="currentColor" d="M6 2h12v2H6zm4 12H8v-2h2zm4 0v2h-4v-2zm0 0v-2h2v2z"/><path fill="currentColor" d="M6 6V4H4v2H2v12h2v2h2v2h12v-2h2v-2h2V6h-2V4h-2v2h-2v2H8V6zm2 6v-2h8v2h2V6h2v12h-2v2h-2v-4h-2v4h-4v-4H6v2h2v2H6v-2H4v-2h2v-2H4V6h2v6z"/>',hidden:!0},"github-solid":{body:'<path fill="currentColor" d="M19 14h-2v2h-2v2h2v4H7v-4H3v-2H1v-2h2v2h4v-2H5v-2H3V6h2V2h4v2h6V2h4v4h2v6h-2zM7 18h2v-2H7z"/>'},gitlab:{body:'<path fill="currentColor" d="M15 22H9v-2h6zm-6-2H7v-2h2zm8 0h-2v-2h2zM7 18H5v-2h2zm12 0h-2v-2h2zM5 16H3v-2h2zm16 0h-2v-2h2zM3 14H1V8h2zm20 0h-2V8h2zm-8-4H9V8h6zM5 8H3V4h2zm4 0H7V4h2zm8 0h-2V4h2zm4 0h-2V4h2zM7 4H5V2h2zm12 0h-2V2h2z"/>'},"gitlab-solid":{body:'<path fill="currentColor" d="M7 4h2v4h6V4h2V2h2v2h2v4h2v6h-2v2h-2v2h-2v2h-2v2H9v-2H7v-2H5v-2H3v-2H1V8h2V4h2V2h2z"/>'},globe:{body:'<g fill="currentColor"><path d="M6 2h12v2H6zm0 18h12v2H6zM4 4h2v2H4zm5 0h2v2H9zm0 14h2v2H9zm4 0h2v2h-2zM7 6h2v12H7zm8 0h2v12h-2zm-2-2h2v2h-2zm7 0h-2v2h2zM2 6h2v12H2zm20 0h-2v12h2zM4 18h2v2H4zm16 0h-2v2h2z"/><path d="M3 11h18v2H3z"/></g>'},gmail:{body:'<path fill="currentColor" d="M20 20H4v-2h16zM4 18H2V6h2zm18 0h-2V6h2zM8 10h2v2H8v4H6V8h2zm10 6h-2v-4h-2v-2h2V8h2zm-4-2h-4v-2h4zm6-8H4V4h16z"/>'},"gmail-solid":{body:'<path fill="currentColor" d="M20 20H4v-2H2V6h2V4h16v2h2v12h-2zM6 16h2v-4h2v-2H8V8H6zm10-6h-2v2h-4v2h4v-2h2v4h2V8h-2z"/>'},goal:{body:'<g fill="currentColor"><path d="M6 2h2v2H6zm0 18h12v2H6zm12-2h2v2h-2zM4 18h2v2H4zM4 4h2v2H4zm16 10h2v4h-2zM2 6h2v12H2zm6 10h8v2H8zM6 8h2v8H6zm10 6h2v2h-2zM10 2h2v12h-2z"/><path d="M10 2h6v2h-6zm0 6h6v2h-6zm6-4h6v2h-6zm0 6h6v2h-6zm4-4h2v4h-2z"/></g>'},google:{body:'<path fill="currentColor" d="M17 21H7v-2h10zM7 19H5v-2h2zm12 0h-2v-2h2zM5 17H3V7h2zm16 0h-2v-4h-6v-2h8zM7 7H5V5h2zm12 0h-2V5h2zm-2-2H7V3h10z"/>'},"google-chrome":{body:'<path fill="currentColor" d="M18 22H6v-2h4v-2h2v2h6zM6 20H4v-2h2zm14 0h-2v-2h2zM4 8h2v2H4v8H2V6h2zm10 10h-2v-2h-2v-2h4zm8 0h-2V6h2zm-12-4H8v-2H6v-2h4zm6 0h-2v-4h2zm-2-4h-4V8h4zm4-2h-4V6h4zM6 6H4V4h2zm14 0h-2V4h2zm-2-2H6V2h12z"/>'},"google-chrome-solid":{body:'<path fill="currentColor" d="M18 4h2v2h2v12h-2v2h-2v2H6v-2H4v-2H2V6h2V4h2V2h12zm-4 4h-4v2H6V8H4v2h2v2h2v2h2v2h2v2h-2v2h2v-2h2v-4h2v-4h-2zh4V6h-4zm0 6h-4v-4h4z"/>'},gps:{body:'<path fill="currentColor" d="M9 5h6v2H9zM7 7h2v2H7zm0 8h2v2H7zm8 0h2v2h-2zm0-8h2v2h-2zm2 2h2v6h-2zm-8 8h6v2H9zM5 9h2v6H5zm14 2h4v2h-4zM1 11h4v2H1zM11 1h2v4h-2zm0 18h2v4h-2z"/>'},"gps-2":{body:'<path fill="currentColor" d="M9 5h6v2H9zM7 7h2v2H7zm0 8h2v2H7zm8 0h2v2h-2zm0-8h2v2h-2zm2 2h2v6h-2zm-8 8h6v2H9zM5 9h2v6H5zm14 2h4v2h-4zM1 11h4v2H1zM11 1h2v4h-2zm0 18h2v4h-2zm0-10h2v2h-2zm-2 2h2v2H9zm2 2h2v2h-2zm2-2h2v2h-2z"/>'},"gps-2-sharp":{body:'<path fill="currentColor" d="M7 5h10v2H7zm10 0h2v14h-2zM7 17h10v2H7zM5 5h2v14H5zm14 6h4v2h-4zM1 11h4v2H1zM11 1h2v4h-2zm0 18h2v4h-2zm0-10h2v2h-2zm-2 2h2v2H9zm2 2h2v2h-2zm2-2h2v2h-2z"/>'},"gps-sharp":{body:'<path fill="currentColor" d="M7 5h10v2H7zm10 0h2v14h-2zM7 17h10v2H7zM5 5h2v14H5zm14 6h4v2h-4zM1 11h4v2H1zM11 1h2v4h-2zm0 18h2v4h-2z"/>'},gpu:{body:'<path fill="currentColor" d="M1 2h2v20H1zm2 2h18v2H3zm18 2h2v10h-2zM3 16h18v2H3zm4 2h2v2H7zm2 2h6v2H9zm6-2h2v2h-2zM7 8h2v2H7zm8 0h2v2h-2zM5 10h2v2H5zm8 0h2v2h-2zm-6 2h2v2H7zm8 0h2v2h-2zm-6-2h2v2H9zm8 0h2v2h-2z"/>'},"gpu-sharp":{body:'<path fill="currentColor" d="M1 2h2v20H1zm2 2h20v2H3zm18 2h2v10h-2zM3 16h20v2H3zm4 2h2v2H7zm0 2h10v2H7zm8-2h2v2h-2zM7 8h2v2H7zm8 0h2v2h-2zM5 10h2v2H5zm8 0h2v2h-2zm-6 2h2v2H7zm8 0h2v2h-2zm-6-2h2v2H9zm8 0h2v2h-2z"/>'},grid:{body:'<path fill="currentColor" d="M2 2h20v20H2zm2 2v4h4V4zm6 0v4h4V4zm6 0v4h4V4zm4 6h-4v4h4zm0 6h-4v4h4zm-6 4v-4h-4v4zm-6 0v-4H4v4zm-4-6h4v-4H4zm6-4v4h4v-4z"/>',hidden:!0},"grid-2x2-2":{body:'<g fill="currentColor"><path d="M4 2h16v2H4zM2 4h2v16H2zm2 7h16v2H4zm16-7h2v16h-2z"/><path d="M11 4h2v18h-2z"/><path d="M4 20h16v2H4z"/></g>'},"grid-2x2-2-sharp":{body:'<g fill="currentColor"><path d="M4 2h16v2H4zM2 2h2v20H2zm2 9h16v2H4zm16-9h2v20h-2z"/><path d="M11 4h2v18h-2z"/><path d="M4 20h16v2H4z"/></g>'},"grid-2x3":{body:'<g fill="currentColor"><path d="M4 2h16v2H4zm0 18h16v2H4zM2 4h2v16H2zm18 0h2v16h-2zm-7 0v16h-2V4z"/><path d="M20 8v2H4V8zm0 6v2H4v-2z"/></g>'},"grid-2x3-sharp":{body:'<g fill="currentColor"><path d="M2 2h20v2H2zm0 18h20v2H2zM2 4h2v16H2zm18 0h2v16h-2zm-7 0v16h-2V4z"/><path d="M20 8v2H4V8zm0 6v2H4v-2z"/></g>'},"grid-3x2":{body:'<g fill="currentColor"><path d="M4 2h16v2H4zm0 18h16v2H4zM2 4h2v16H2zm18 0h2v16h-2zM4 11h16v2H4z"/><path d="M8 4h2v16H8zm6 0h2v16h-2z"/></g>'},"grid-3x2-sharp":{body:'<g fill="currentColor"><path d="M2 2h20v2H2zm0 18h20v2H2zM2 4h2v16H2zm18 0h2v16h-2zM4 11h16v2H4z"/><path d="M8 4h2v16H8zm6 0h2v16h-2z"/></g>'},"grid-3x3":{body:'<g fill="currentColor"><path d="M4 2h16v2H4zm0 18h16v2H4zM2 4h2v16H2zm18 0h2v16h-2zM4 8h16v2H4zm0 6h16v2H4z"/><path d="M8 4h2v16H8zm6 0h2v16h-2z"/></g>'},"grid-3x3-sharp":{body:'<g fill="currentColor"><path d="M2 2h20v2H2zm0 18h20v2H2zM2 4h2v16H2zm18 0h2v16h-2zM4 8h16v2H4zm0 6h16v2H4z"/><path d="M8 4h2v16H8zm6 0h2v16h-2z"/></g>'},group:{body:'<path fill="currentColor" d="M3 3h18v18H3zm2 2v14h14V5zm2 2h4v4H7zm6 0h4v4h-4zm-6 6h4v4H7zm6 0h4v4h-4z"/>',hidden:!0},hand:{body:'<path fill="currentColor" d="M21 7h2v5h-2zm-4-2h2v7h-2zm-4-2h2v8h-2zM9 3h2v8H9zM5 5h2v8H5zm14 0h2v2h-2zm-4-2h2v2h-2zm-4-2h2v2h-2zM7 3h2v2H7zm-4 8h2v2H3zm-2 2h2v2H1zm0 2h2v2H1zm2 2h2v2H3zm2 2h2v2H5zm2 2h12v2H7zm12-2h2v2h-2zm2-7h2v7h-2zM5 13h2v2H5zm2 2h2v2H7z"/>'},handbag:{body:'<g fill="currentColor"><path d="M7 4h2v7H7zm2-2h6v2H9zm6 2h2v7h-2z"/><path d="M5 7h14v2H5zm14 2h2v5h-2zM5 9H3v5h2zm16 5h2v6h-2zM3 14H1v6h2zm0 6h18v2H3z"/></g>'},"handbag-sharp":{body:'<g fill="currentColor"><path d="M7 4h2v7H7zm2-2h6v2H9zm6 2h2v7h-2z"/><path d="M1 7h22v2H1zm20 2h2v11h-2zM3 9H1v11h2zM1 20h22v2H1z"/></g>'},hash:{body:'<path fill="currentColor" d="M9 3h2v5H9zm6 0h2v5h-2zm-7 7h2v4H8zm6 0h2v4h-2zm-7 6h2v5H7zm6 0h2v5h-2zM3 8h18v2H3zm0 6h18v2H3z"/>'},hd:{body:'<path fill="currentColor" d="M3 7h2v4h4V7h2v10H9v-4H5v4H3zm10 8V7h6v2h-4v6h4v2h-6zm6 0V9h2v6z"/>',hidden:!0},heading:{body:'<g fill="currentColor"><path d="M5 4h2v16H5z"/><path d="M5 11h14v2H5z"/><path d="M17 4h2v16h-2z"/></g>'},"heading-1":{body:'<g fill="currentColor"><path d="M3 6h2v12H3z"/><path d="M3 11h10v2H3z"/><path d="M11 6h2v12h-2zm8 2h2v10h-2zm-4 2h2v2h-2zm2-2h2v2h-2z"/></g>'},"heading-2":{body:'<g fill="currentColor"><path d="M3 6h2v12H3z"/><path d="M3 11h10v2H3z"/><path d="M11 6h2v12h-2zm4 10h6v2h-6zm0-2h2v2h-2zm2-2h2v2h-2zm2-2h2v2h-2zm-2-2h2v2h-2zm-2 0h2v2h-2z"/></g>'},"heading-3":{body:'<g fill="currentColor"><path d="M3 6h2v12H3z"/><path d="M3 11h10v2H3z"/><path d="M11 6h2v12h-2zm4 10h4v2h-4zm4-2h2v2h-2zm-4-2h4v2h-4zm4-2h2v2h-2zm-2-2h2v2h-2zm-2 0h2v2h-2z"/></g>'},"heading-4":{body:'<g fill="currentColor"><path d="M3 6h2v12H3z"/><path d="M3 11h10v2H3z"/><path d="M11 6h2v12h-2zm4 6h4v2h-4zm4-4h2v10h-2zm-4 0h2v4h-2z"/></g>'},"heading-5":{body:'<g fill="currentColor"><path d="M3 6h2v12H3z"/><path d="M3 11h10v2H3z"/><path d="M11 6h2v12h-2zm10 10h-6v2h6zm0-2h-2v2h2zm-2-2h-2v2h2zm-2-4h-2v6h2zm2 0h-2v2h2zm2 0h-2v2h2z"/></g>'},"heading-6":{body:'<g fill="currentColor"><path d="M3 6h2v12H3z"/><path d="M3 11h10v2H3z"/><path d="M11 6h2v12h-2zm4 10h4v2h-4zm4-2h2v2h-2zm-4 0h2v2h-2zm0-2h4v2h-4zm2-4h2v2h-2zm-2 2h2v2h-2z"/></g>'},headphone:{body:'<g fill="currentColor"><path d="M14 13h7v2h-7zm2 6h3v2h-3z"/><path d="M14 13h2v8h-2zm5-6h2v12h-2zM3 13h7v2H3zm2 6h3v2H5z"/><path d="M3 7h2v12H3zm5 6h2v8H8zM7 3h10v2H7zM5 5h2v2H5zm12 0h2v2h-2z"/></g>'},headset:{body:'<path fill="currentColor" d="M19 2H5v2H3v14h7v-8H5V4h14v6h-5v8h3v2h-6v2h8v-4h2V4h-2zm-3 10h3v4h-3zm-8 0v4H5v-4z"/>',hidden:!0},heart:{body:'<path fill="currentColor" d="M13 22h-2v-2h2zm-2-2H9v-2h2zm4 0h-2v-2h2zm-6-2H7v-2h2zm8 0h-2v-2h2zM7 16H5v-2h2zm12 0h-2v-2h2zM5 14H3v-2h2zm16 0h-2v-2h2zM3 12H1V6h2zm20 0h-2V6h2zM13 8h-2V6h2zM5 6H3V4h2zm6 0H9V4h2zm4 0h-2V4h2zm6 0h-2V4h2zM9 4H5V2h4zm10 0h-4V2h4z"/>'},helicopter:{body:'<g fill="currentColor"><path d="M2 8h2v8H2zm2 4h2v2H4zm2-4h2v8H6zm2-2h10v2H8zm10 2h2v2h-2zm2 2h2v6h-2zM8 16h12v2H8zm2 2h2v2h-2zm6 0h2v2h-2zM6 20h16v2H6zM4 2h18v2H4z"/><path d="M12 4h2v8h-2zm2 8h6v2h-6z"/></g>'},hidden:{body:'<path fill="currentColor" d="M8 6h8v2H8zm-4 4V8h4v2zm-2 2v-2h2v2zm0 2v-2H0v2zm2 2H2v-2h2zm4 2H4v-2h4zm8 0v2H8v-2zm4-2v2h-4v-2zm2-2v2h-2v-2zm0-2h2v2h-2zm-2-2h2v2h-2zm0 0V8h-4v2zM9 10h2v2H9zm4 2h-2v2H9v2h2v-2h2v2h2v-2h-2zm0 0v-2h2v2z"/>',hidden:!0},home:{body:'<path fill="currentColor" d="M4 20h16v2H4zm16-10h2v10h-2zM2 10h2v10H2zm2-2h2v2H4zm2-2h2v2H6zm2-2h2v2H8zm2-2h4v2h-4zm4 2h2v2h-2zm2 2h2v2h-2zm2 2h2v2h-2zM8 14h2v6H8zm2-2h4v2h-4zm4 2h2v6h-2z"/>'},"home-sharp":{body:'<path fill="currentColor" d="M2 20h20v2H2zm18-10h2v10h-2zM2 10h2v10H2zm2-2h2v2H4zm2-2h2v2H6zm2-2h2v2H8zm2-2h4v2h-4zm4 2h2v2h-2zm2 2h2v2h-2zm2 2h2v2h-2zM8 14h2v6H8zm0-2h8v2H8zm6 2h2v6h-2z"/>'},"hotel-bed":{body:'<path fill="currentColor" d="M2 16h10V8h10v2h-8v6h8v-6h2v10h-2v-2H2v2H0V4h2zm7-1H5v-2h4zm-4-2H3V9h2zm6 0H9V9h2zM9 9H5V7h4z"/>'},"hotel-bed-sharp":{body:'<path fill="currentColor" d="M2 16h10V8h12v12h-2v-2H2v2H0V4h2zm12 0h8v-6h-8zm-5-1H5v-2h4zm-4-2H3V9h2zm6 0H9V9h2zM9 9H5V7h4z"/>'},hourglass:{body:'<path fill="currentColor" d="M16 22H8v-2h8zm-8-2H6v-4h2zm10 0h-2v-4h2zm-8-4H8v-2h2zm6 0h-2v-2h2zm-6-6h4v4h-4zm0 0H8V8h2zm6 0h-2V8h2zM8 8H6V4h2zm10 0h-2V4h2zm-2-4H8V2h8z"/>'},"hourglass-glyph":{body:'<path fill="currentColor" d="M16 16h2v6H6v-6h2v-2h2v-4H8V8H6V2h12v6h-2v2h-2v4h2z"/>'},"hourglass-sharp":{body:'<path fill="currentColor" d="M8 20h8v-4h2v6H6v-6h2zm2-4H8v-2h2zm6 0h-2v-2h2zm-6-6h4v4h-4zm0 0H8V8h2zm6 0h-2V8h2zm2-2h-2V4H8v4H6V2h12z"/>'},"hourglass-solid":{body:'<path fill="currentColor" d="M10 14v-4H8V8H6V4h2V2h8v2h2v4h-2v2h-2v4h2v2h2v4h-2v2H8v-2H6v-4h2v-2z"/>'},hq:{body:'<path fill="currentColor" d="M3 7h2v4h4V7h2v10H9v-4H5v4H3zm10 2h2v6h-2zm6 6h-4v2h8v-2h-2V9h-2V7h-4v2h4z"/>',hidden:!0},human:{body:'<path fill="currentColor" d="M10 2h4v4h-4zM3 7h18v2H3zm6 2h2v7H9zm4 0h2v7h-2zm-4 7h2v6H9zm4 0h2v6h-2zm-2-2h2v2h-2z"/>'},"human-arms-down":{body:'<path fill="currentColor" d="M10 2h4v4h-4zM7 7h10v2H7zm2 2h2v7H9zm4 0h2v7h-2zm-4 7h2v6H9zm4 0h2v6h-2zm-2-2h2v2h-2zM5 9h2v2H5zm-2 2h2v2H3zm14-2h2v2h-2zm2 2h2v2h-2z"/>'},"human-arms-up":{body:'<path fill="currentColor" d="M10 2h4v4h-4zM7 7h10v2H7zm2 2h2v7H9zm4 0h2v7h-2zm-4 7h2v6H9zm4 0h2v6h-2zm-2-2h2v2h-2zM5 5h2v2H5zM3 3h2v2H3zm14 2h2v2h-2zm2-2h2v2h-2z"/>'},"human-handsdown":{body:'<path fill="currentColor" d="M10 2h4v4h-4zM7 7h10v2h-2v13h-2v-6h-2v6H9V9H7zm-2 4h2V9H5zm0 0v2H3v-2zm14 0h-2V9h2zm0 0h2v2h-2z"/>',hidden:!0},"human-handsup":{body:'<path fill="currentColor" d="M10 2h4v4h-4zM7 7h10v2h-2v13h-2v-6h-2v6H9V9H7zM5 5v2h2V5zm0 0H3V3h2zm14 0v2h-2V5zm0 0V3h2v2z"/>',hidden:!0},"human-height":{body:'<path fill="currentColor" d="M6 2h4v4H6zM3 7h10v9h-2v6H9v-6H7v6H5v-6H3zm18-4h-6v2h6zm-4 4h4v2h-4zm4 4h-6v2h6zm-6 8h6v2h-6zm6-4h-4v2h4z"/>',hidden:!0},"human-height-alt":{body:'<path fill="currentColor" d="M4 2h4v4H4zM1 7h10v9H9v6H7v-6H5v6H3v-6H1zm18-5h-2v2h-2v2h-2v2h2V6h2v12h-2v-2h-2v2h2v2h2v2h2v-2h2v-2h2v-2h-2v2h-2V6h2v2h2V6h-2V4h-2z"/>',hidden:!0},"human-run":{body:'<path fill="currentColor" d="M10 3H8v2H6v2h2V5h2v2h2v2h-2v2H8v2H6v2H4v-2H2v2h2v2h2v-2h4v2h2v2h-2v2h2v-2h2v-2h-2v-4h2v-2h2v2h2v2h2v-2h2v-2h-2v2h-2v-2h-2V9h2V5h-4v2h-2V5h-2z"/>',hidden:!0},"icon-category":{body:'<path fill="currentColor" d="M3 3h8v2H3zm0 6h8v2H3zm0-4h2v4H3zm6 0h2v4H9zm4-2h8v2h-8zm0 6h8v2h-8zm0-4h2v4h-2zm6 0h2v4h-2zM3 13h8v2H3zm0 6h8v2H3zm0-4h2v4H3zm6 0h2v4H9zm6-2h4v2h-4zm-2 2h2v4h-2zm2 4h4v2h-4zm4-4h2v4h-2z"/>'},icons:{body:'<g fill="currentColor"><path d="M3 1h6v2H3zM1 3h2v6H1zm2 6h6v2H3zm6-6h2v6H9zm4-2h2v2h-2zm2 2h2v2h-2zm2 2h2v2h-2zm2 2h2v2h-2zm2 2h2v2h-2zm-2-6h2v2h-2zm2-2h2v2h-2zm-6 6h2v2h-2zm-2 2h2v2h-2zm0 4h10v2H13zm0 8h10v2H13zm0-6h2v6h-2zm8 0h2v6h-2zM5 13h2v2H5zm2 2h2v4H7zm-4 0h2v4H3zm-2 4h2v4H1zm8 0h2v4H9z"/><path d="M1 21h10v2H1z"/></g>'},image:{body:'<g fill="currentColor"><path d="M4 2h16v2H4zm0 18h16v2H4zM2 4h2v16H2zm18 0h2v16h-2zm-4 8h2v2h-2zm-2 2h2v2h-2zm4 0h2v2h-2zm-8 0h2v2h-2zm2 2h2v2h-2zm2 2h2v2h-2z"/><path d="M20 16h2v2h-2zM8 16h2v2H8zm-2 2h2v2H6zM8 6h2v2H8zM6 8h2v2H6zm2 2h2v2H8zm2-2h2v2h-2z"/></g>'},"image-2-plus":{body:'<g fill="currentColor"><path d="M4 2h10v2H4zm0 18h16v2H4zM2 4h2v16H2zm18 6h2v10h-2zm-6 0h2v2h-2zm-2 2h2v2h-2zm4 0h2v2h-2zm-6 2h2v2h-2zm8 0h2v2h-2zM8 16h2v2H8zm-2 2h2v2H6zM8 6h2v2H8zM6 8h2v2H6zm2 2h2v2H8zm2-2h2v2h-2zm8-6h2v6h-2z"/><path d="M16 4h6v2h-6z"/></g>'},"image-2-plus-sharp":{body:'<g fill="currentColor"><path d="M2 2h12v2H2zm0 18h20v2H2zM2 4h2v16H2zm18 6h2v10h-2zm-6 0h2v2h-2zm-2 2h2v2h-2zm4 0h2v2h-2zm-6 2h2v2h-2zm8 0h2v2h-2zM8 16h2v2H8zm-2 2h2v2H6zM8 6h2v2H8zM6 8h2v2H6zm2 2h2v2H8zm2-2h2v2h-2zm8-6h2v6h-2z"/><path d="M16 4h6v2h-6z"/></g>'},"image-arrow-right":{body:'<path fill="currentColor" d="M19 1h-2v2h2v2h-6v2h6v2h-2v2h2V9h2V7h2V5h-2V3h-2zm-8 2H2v18h20v-8h-2v6H4V5h7zm1 8V9h2v2zm-2 2v-2h2v2zm-2 2v-2h2v2zm0 0v2H6v-2zm8-2h-2v-2h2zm0 0h2v2h-2zM6 7h2v2H6z"/>',hidden:!0},"image-broken":{body:'<path fill="currentColor" d="M22 3H2v18h20v-2h-2v-2h2v-2h-2v-2h2v-2h-2V9h2V7h-2V5h2zm-2 4v2h-2v2h2v2h-2v2h2v2h-2v2H4V5h14v2zm-6 2h-2v2h-2v2H8v2H6v2h2v-2h2v-2h2v-2h2v2h2v-2h-2zM6 7h2v2H6z"/>',hidden:!0},"image-delete":{body:'<path fill="currentColor" d="M14 3H2v18h20V11h-2v8H4V5h10zM6 7h2v2H6zm14-2h-2V3h-2v2h2v2h-2v2h2V7h2v2h2V7h-2zm0 0V3h2v2zm-8 4h2v2h-2zm-2 4v-2h2v2zm-2 2h2v-2H8zm0 0v2H6v-2zm8-2h-2v-2h2zm0 0h2v2h-2z"/>',hidden:!0},"image-flash":{body:'<path fill="currentColor" d="M18 0h2v4h4v2h-2v2h-2v2h-2V6h-4V4h2V2h2zM4 3h8v2H4v14h16v-7h2v9H2V3zm10 6h-2v2h-2v2H8v2H6v2h2v-2h2v-2h2v-2h2v2h2v2h2v-2h-2v-2h-2zM8 7H6v2h2z"/>',hidden:!0},"image-frame":{body:'<path fill="currentColor" d="M13 1h-2v2H9v2H7v2H2v16h20V7h-5V5h-2V3h-2zm2 6H9V5h2V3h2v2h2zM4 9h16v12H4zm10 6v-2h-2v2h-2v2H8v2h2v-2h2v-2zm2 2v-2h-2v2zm0 0v2h2v-2zM6 13v-2h2v2z"/>',hidden:!0},"image-gallery":{body:'<path fill="currentColor" d="M2 2h20v16h-5v2h-2v-2H9v2H7v-2H2zm5 18v2H5v-2zm10 0v2h2v-2zm3-16H4v12h16zm-8 4h2v2h-2zm-2 4v-2h2v2zm0 0v2H8v-2zm6 0h-2v-2h2zm0 0h2v2h-2zM8 6H6v2h2z"/>',hidden:!0},"image-multiple":{body:'<path fill="currentColor" d="M24 2H4v16h20zM6 16V4h16v12zM2 4H0v18h20v-2H2zm12 2h2v2h-2zm-2 4V8h2v2zm-2 2v-2h2v2zm0 0v2H8v-2zm8-2h-2V8h2zm0 0h2v2h-2zM8 6h2v2H8z"/>',hidden:!0},"image-new":{body:'<path fill="currentColor" d="M8 6h8v2H8zM6 8h2v8H6zm2 8h8v2H8zm8-8h2v8h-2zm-4 4h2v2h-2zm2-2h2v2h-2zm-4 4h2v2h-2zm1-13h2v3h-2zm0 19h2v3h-2zM1 11h3v2H1zm19 0h3v2h-3zm-1-8h2v2h-2zM3 3h2v2H3zM1 1h2v2H1zm2 18h2v2H3zm-2 2h2v2H1zm18-2h2v2h-2zm2 2h2v2h-2zm0-20h2v2h-2zM9 9h2v2H9z"/>'},"image-new-sharp":{body:'<path fill="currentColor" d="M6 6h12v2H6zm0 2h2v8H6zm0 8h12v2H6zm10-8h2v8h-2zm-2 4h2v2h-2zm-2-2h2v2h-2zm-2 2h2v2h-2zm-2 2h2v2H8zm3-13h2v3h-2zm0 19h2v3h-2zM1 11h3v2H1zm19 0h3v2h-3zm-1-8h2v2h-2zM3 3h2v2H3zM1 1h2v2H1zm2 18h2v2H3zm-2 2h2v2H1zm18-2h2v2h-2zm2 2h2v2h-2zm0-20h2v2h-2z"/>'},"image-plus":{body:'<path fill="currentColor" d="M4 3h10v2H4v14h16v-8h2v10H2V3zm10 6h-2v2h-2v2H8v2H6v2h2v-2h2v-2h2v-2h2v2h2v2h2v-2h-2v-2h-2zM8 7H6v2h2zm10-4h2v2h2v2h-2v2h-2V7h-2V5h2z"/>',hidden:!0},"image-sharp":{body:'<g fill="currentColor"><path d="M2 2h20v2H2zm0 18h20v2H2zM2 4h2v16H2zm18 0h2v16h-2zm-4 8h2v2h-2zm-2 2h2v2h-2zm4 0h2v2h-2zm-8 0h2v2h-2zm2 2h2v2h-2zm2 2h2v2h-2z"/><path d="M20 16h2v2h-2zM8 16h2v2H8zm-2 2h2v2H6zM8 6h2v2H8zM6 8h2v2H6zm2 2h2v2H8zm2-2h2v2h-2z"/></g>'},images:{body:'<path fill="currentColor" d="M7 2h14v2H7zm0 14h14v2H7zm-4 4h14v2H3zM5 4h2v12H5zM1 8h2v12H1zm20-4h2v12h-2zm-4 6h2v2h-2zm2 2h2v2h-2zm-4 0h2v2h-2zm-2 2h2v2h-2zm-2-8h2v2h-2zM9 8h2v2H9zm2 2h2v2h-2zm2-2h2v2h-2zM3 6h2v2H3zm14 12h2v2h-2z"/>'},"images-sharp":{body:'<path fill="currentColor" d="M5 2h18v2H5zm0 14h18v2H5zm-4 4h18v2H1zM5 4h2v12H5zM1 8h2v12H1zm20-4h2v12h-2zm-4 6h2v2h-2zm2 2h2v2h-2zm-4 0h2v2h-2zm-2 2h2v2h-2zm-2-8h2v2h-2zM9 8h2v2H9zm2 2h2v2h-2zm2-2h2v2h-2zM1 6h4v2H1zm16 12h2v2h-2z"/>'},inbox:{body:'<path fill="currentColor" d="M2 4h2v16H2zm2 16h16v2H4zM20 4h2v16h-2zM4 2h16v2H4zm0 12h4v2H4zm4 2h8v2H8zm8-2h4v2h-4z"/>'},"inbox-all":{body:'<path fill="currentColor" d="M3 2h18v20H3zm2 2v4h4v2h6V8h4V4zm14 6h-2v2H7v-2H5v4h14zm0 6h-2v2H7v-2H5v4h14z"/>',hidden:!0},"inbox-full":{body:'<path fill="currentColor" d="M3 2h18v20H3zm2 2v10h4v2h6v-2h4V4zm14 12h-2v2H7v-2H5v4h14zM7 6h10v2H7zm0 4h10v2H7z"/>',hidden:!0},"inbox-sharp":{body:'<path fill="currentColor" d="M2 4h2v16H2zm0 16h20v2H2zM20 4h2v16h-2zM2 2h20v2H2zm2 12h4v2H4zm2 2h12v2H6zm10-2h4v2h-4z"/>'},infinity:{body:'<path fill="currentColor" d="M8 18H4v-2h4zm12 0h-4v-2h4zM4 16H2v-2h2zm6 0H8v-2h2zm6 0h-2v-2h2zm6 0h-2v-2h2zM2 14H0v-4h2zm12 0h-2v-2h2zm10 0h-2v-4h2zm-12-2h-2v-2h2zm-8-2H2V8h2zm6 0H8V8h2zm6 0h-2V8h2zm6 0h-2V8h2zM8 8H4V6h4zm12 0h-4V6h4z"/>'},"infinity-glyph":{body:'<path fill="currentColor" d="M8 8H2v8h6v2H0V6h8zm16 10h-8v-2h6V8h-6V6h8zm-14-2H8v-2h2zm6 0h-2v-2h2zm-8-2H4v-4h4zm6 0h-2v-2h2zm6 0h-4v-4h4zm-8-2h-2v-2h2zm-2-2H8V8h2zm6 0h-2V8h2z"/>'},"infinity-sharp":{body:'<path fill="currentColor" d="M8 8H2v8h6v2H0V6h8zm16 10h-8v-2h6V8h-6V6h8zm-14-2H8v-2h2zm6 0h-2v-2h2zm-2-2h-2v-2h2zm-2-2h-2v-2h2zm-2-2H8V8h2zm6 0h-2V8h2z"/>'},"infinity-solid":{body:'<path fill="currentColor" d="M8 18H4v-2h4zm12 0h-4v-2h4zM4 16H2v-2h2zm6 0H8v-2h2zm6 0h-2v-2h2zm6 0h-2v-2h2zM2 14H0v-4h2zm6 0H4v-4h4zm6 0h-2v-2h2zm6 0h-4v-4h4zm4 0h-2v-4h2zm-12-2h-2v-2h2zm-8-2H2V8h2zm6 0H8V8h2zm6 0h-2V8h2zm6 0h-2V8h2zM8 8H4V6h4zm12 0h-4V6h4z"/>'},"info-box":{body:'<path fill="currentColor" d="M4 2h16v2H4zm0 18h16v2H4zM2 4h2v16H2zm18 0h2v16h-2zm-9 5h2V7h-2zm0 8h2v-6h-2z"/>'},"info-box-sharp":{body:'<path fill="currentColor" d="M2 2h20v2H2zm0 18h20v2H2zM2 4h2v16H2zm18 0h2v16h-2zm-9 5h2V7h-2zm0 8h2v-6h-2z"/>'},instagram:{body:'<path fill="currentColor" d="M18 22H6v-2h12zM6 20H4v-2h2zm14 0h-2v-2h2zM4 18H2V6h2zm18 0h-2V6h2zm-8-2h-4v-2h4zm-4-2H8v-4h2zm6 0h-2v-4h2zm-2-4h-4V8h4zm4-2h-2V6h2zM6 6H4V4h2zm14 0h-2V4h2zm-2-2H6V2h12z"/>'},"instagram-solid":{body:'<path fill="currentColor" d="M16 6v2h2V6zm-6 10h4v-2h-4zm-2-2h2v-4H8zm6 0h2v-4h-2zm-4-4h4V8h-4zm12-4v12h-2v2h-2v2H6v-2H4v-2H2V6h2V4h2V2h12v2h2v2z"/>'},invert:{body:'<path fill="currentColor" d="M4 2h16v2H4zm0 18h16v2H4zM2 4h2v16H2zm18 0h2v16h-2zM4 18h2v2H4zm0-2h4v2H4zm0-2h6v2H4zm0-2h8v2H4zm0-2h10v2H4zm0-2h12v2H4zm0-2h14v2H4zm0-2h16v2H4z"/>'},"invert-sharp":{body:'<path fill="currentColor" d="M2 2h20v2H2zm0 18h20v2H2zM2 4h2v16H2zm18 0h2v16h-2zM4 18h2v2H4zm0-2h4v2H4zm0-2h6v2H4zm0-2h8v2H4zm0-2h10v2H4zm0-2h12v2H4zm0-2h14v2H4zm0-2h16v2H4z"/>'},invoice:{body:'<path fill="currentColor" d="M5 20h2v2H3V4h2zm6 2H9v-2h2zm4 0h-2v-2h2zm6 0h-4v-2h2V4h2zM9 20H7v-2h2zm4 0h-2v-2h2zm4 0h-2v-2h2zm2-16H5V2h14z"/>'},"invoice-sharp":{body:'<path fill="currentColor" d="M21 22h-4v-2h2V4H5v16h2v2H3V2h18zm-10 0H9v-2h2zm4 0h-2v-2h2zm-6-2H7v-2h2zm4 0h-2v-2h2zm4 0h-2v-2h2z"/>'},iso:{body:'<path fill="currentColor" d="M8 3H6v3H3v2h3v3h2V8h3V6H8zm11 2h-2v2h-2v2h-2v2h-2v2H9v2H7v2H5v2h2v-2h2v-2h2v-2h2v-2h2V9h2V7h2zm-6 13v-2h8v2z"/>',hidden:!0},joystick:{body:'<path fill="currentColor" d="M4 14h16v2H4zm0 6h16v2H4zm-2-4h2v4H2zm18 0h2v4h-2zM10 2h4v2h-4zM8 4h2v4H8zm6 0h2v4h-2zm-4 4h4v2h-4zm1 2h2v4h-2zm-4 2h2v2H7z"/>'},"joystick-sharp":{body:'<path fill="currentColor" d="M2 14h20v2H2zm0 6h20v2H2zm0-4h2v4H2zm18 0h2v4h-2zM8 2h8v2H8zm0 2h2v4H8zm6 0h2v4h-2zM8 8h8v2H8zm3 2h2v4h-2zm-4 2h2v2H7z"/>'},kanban:{body:'<path fill="currentColor" d="M21 3H3v18h18zM5 19V5h14v14zM9 7H7v8h2zm2 0h2v4h-2zm6 0h-2v10h2z"/>',hidden:!0},key:{body:'<path fill="currentColor" d="M11 18H3v-2h8zm12-3h-2v3h-4v-2h2v-3h2v-2H11V8h2v1h10zM3 16H1V8h2zm14 0h-2v-1h-2v1h-2v-3h6zm-8-2H5v-4h4zm2-6H3V6h8z"/>'},"key-solid":{body:'<path fill="currentColor" d="M11 8h2v1h10v5h-2v4h-2v-4h-2v2h-2v-2h-2v2h-2v2H3v-2H1V8h2V6h8zm-6 6h4v-4H5z"/>'},keyboard:{body:'<path fill="currentColor" d="M21 21H3v-2h18zM3 19H1V5h2zm20 0h-2V5h2zm-5-2H6v-2h12zm-9-4H7v-2h2zm4 0h-2v-2h2zm4 0h-2v-2h2zM7 9H5V7h2zm4 0H9V7h2zm4 0h-2V7h2zm4 0h-2V7h2zm2-4H3V3h18z"/>'},"keyboard-glyph":{body:'<path fill="currentColor" d="M23 21H1V3h22zM6 17h12v-2H6zm1-4h2v-2H7zm4 0h2v-2h-2zm4 0h2v-2h-2zM5 9h2V7H5zm4 0h2V7H9zm4 0h2V7h-2zm4 0h2V7h-2z"/>'},"keyboard-music":{body:'<path fill="currentColor" d="M3 3h18v2H3zm0 16h18v2H3zM1 5h2v14H1zm20 0h2v14h-2zM3 11h18v2H3zm2-4h6v2H5zm8 0h2v2h-2zm4 0h2v2h-2zM5 13h2v4H5zm4 0h2v4H9zm4 0h2v4h-2zm4 0h2v4h-2z"/>'},"keyboard-music-sharp":{body:'<path fill="currentColor" d="M1 3h22v2H1zm0 16h22v2H1zM1 5h2v14H1zm20 0h2v14h-2zM3 11h18v2H3zm2-4h6v2H5zm8 0h2v2h-2zm4 0h2v2h-2zM5 13h2v4H5zm4 0h2v4H9zm4 0h2v4h-2zm4 0h2v4h-2z"/>'},"keyboard-sharp":{body:'<path fill="currentColor" d="M3 5v14h18V5zm15 12H6v-2h12zm-9-4H7v-2h2zm4 0h-2v-2h2zm4 0h-2v-2h2zM7 9H5V7h2zm4 0H9V7h2zm4 0h-2V7h2zm4 0h-2V7h2zm4 12H1V3h22z"/>'},"keyboard-solid":{body:'<path fill="currentColor" d="M21 5h2v14h-2v2H3v-2H1V5h2V3h18zM6 17h12v-2H6zm1-4h2v-2H7zm4 0h2v-2h-2zm4 0h2v-2h-2zM5 9h2V7H5zm4 0h2V7H9zm4 0h2V7h-2zm4 0h2V7h-2z"/>'},label:{body:'<path fill="currentColor" d="M16 22h-4v-2h4zm-4-2h-2v-2h2zm6 0h-2v-2h2zm-8-2H8v-2h2zm10 0h-2v-2h2zM8 16H6v-2h2zm14 0h-2v-4h2zM6 14H4v-2h2zm-2-2H2V4h2zm16 0h-2v-2h2zm-2-2h-2V8h2zM8 8H6V6h2zm8 0h-2V6h2zm-2-2h-2V4h2zm-2-2H4V2h8z"/>'},"label-alt":{body:'<path fill="currentColor" d="M16 5H2v14h14v-2h2v-2h2v-2h2v-2h-2V9h-2V7h-2zm0 2v2h2v2h2v2h-2v2h-2v2H4V7z"/>',hidden:!0},"label-alt-multiple":{body:'<path fill="currentColor" d="M8 5H6v10h12v-2h2v-2h2V9h-2V7h-2V5zm10 2v2h2v2h-2v2H8V7zM4 9H2v10h12v-2H4z"/>',hidden:!0},"label-sharp":{body:'<path fill="currentColor" d="M4 17h12v2H2v-4h2zm14 0h-2v-2h2zM6 15H4v-2h2zm14 0h-2v-2h2zM8 13H6v-2h2zm14 0h-2v-2h2zM6 11H4V9h2zm14 0h-2V9h2zm-4-4H4v2H2V5h14zm2 2h-2V7h2z"/>'},"label-solid":{body:'<path fill="currentColor" d="M12 4h2v2h2v2h2v2h2v2h2v4h-2v2h-2v2h-2v2h-4v-2h-2v-2H8v-2H6v-2H4v-2H2V4h2V2h8zM6 8h2V6H6z"/>'},languages:{body:'<path fill="currentColor" d="M7 2h4v2H7zM2 5h14v2H2zm9 2h2v2h-2zM9 9h2v2H9zm-2 2h2v2H7zM5 9h2v2H5zm4 4h2v2H9zm-4 0h2v2H5zm8 2h2v7h-2zm2-2h5v2h-5zm5 2h2v7h-2zm-5 2h5v2h-5z"/>'},"languages-sharp":{body:'<path fill="currentColor" d="M7 2h4v2H7zM2 5h14v2H2zm9 2h2v2h-2zM9 9h2v2H9zm-2 2h2v2H7zM5 9h2v2H5zm4 4h2v2H9zm-4 0h2v2H5zm8 2h2v7h-2zm0-2h9v2h-9zm7 2h2v7h-2zm-5 2h5v2h-5z"/>'},laptop:{body:'<path fill="currentColor" d="M3 18h18v-2h2v4H1v-4h2zm2-4h14V6h2v10H3V6h2zm14-8H5V4h14z"/>'},"laptop-glyph":{body:'<path fill="currentColor" d="M23 20H1v-4h22zm-2-6H3V4h18z"/>'},"laptop-sharp":{body:'<path fill="currentColor" d="M3 16v2h18v-2zm2-2h14V6H5zm18 6H1v-6h2V4h18v10h2z"/>'},"laptop-solid":{body:'<path fill="currentColor" d="M23 16v4H1v-4zM19 6h2v8H3V6h2V4h14z"/>'},lasso:{body:'<path fill="currentColor" d="M4 12h2v2H4zm-2 2h2v2H2zm2 2h2v4H4zm2-2h4v2H6zm0 6h2v2H6zm4-4h4v2h-4zm0-14h4v2h-4zm4 12h4v2h-4zm4-2h2v2h-2zm0-6h2v2h-2zM6 4h4v2H6zM4 6h2v2H4zm10-2h4v2h-4zm6 4h2v4h-2zM2 8h2v4H2z"/>'},laugh:{body:'<path fill="currentColor" d="M6 20h12v2H6zM6 2h12v2H6zm12 2h2v2h-2zM4 4h2v2H4zm0 14h2v2H4zm14 0h2v2h-2zM2 6h2v12H2zm18 0h2v12h-2zM7 14h2v2H7zm0-2h10v2H7zm2 4h6v2H9zm6-2h2v2h-2zM8 8h2v2H8zm6 0h2v2h-2z"/>'},"laugh-sharp":{body:'<path fill="currentColor" d="M4 20h16v2H4zM4 2h16v2H4zM2 2h2v20H2zm18 0h2v20h-2zM7 14h2v2H7zm0-2h10v2H7zm2 4h6v2H9zm6-2h2v2h-2zM8 8h2v2H8zm6 0h2v2h-2z"/>'},layout:{body:'<path fill="currentColor" d="M20 20H4v-2h4v-8H4v8H2V6h2v2h16V6h2v12h-2v-8H10v8h10zm0-14H4V4h16z"/>'},"layout-align-bottom":{body:'<path fill="currentColor" d="M16 4H8v12h8zm-6 10V6h4v8zm10 6v-2H4v2z"/>',hidden:!0},"layout-align-left":{body:'<path fill="currentColor" d="M20 16V8H8v8zm-10-6h8v4h-8zM4 20h2V4H4z"/>',hidden:!0},"layout-align-right":{body:'<path fill="currentColor" d="M4 8v8h12V8zm10 6H6v-4h8zm6-10h-2v16h2z"/>',hidden:!0},"layout-align-top":{body:'<path fill="currentColor" d="M16 20H8V8h8zm-6-10v8h4v-8zm10-6v2H4V4z"/>',hidden:!0},"layout-columns":{body:'<path fill="currentColor" d="M2 5h20v14H2zm2 2v10h7V7zm9 0v10h7V7z"/>',hidden:!0},"layout-distribute-horizontal":{body:'<path fill="currentColor" d="M6 4H4v16h2zm14 0h-2v16h2zM10 7h6v10H8V7zm4 8V9h-4v6z"/>',hidden:!0},"layout-distribute-vertical":{body:'<path fill="currentColor" d="M20 6V4H4v2zm0 14v-2H4v2zM17 8v8h-2V8zm-8 6v-4h6V8H7v8h8v-2z"/>',hidden:!0},"layout-footer":{body:'<path fill="currentColor" d="M2 5h20v14H2zm2 2v6h16V7zm16 8H4v2h16z"/>',hidden:!0},"layout-glyph":{body:'<path fill="currentColor" d="M8 20H2V10h6zm14 0H10V10h12zm0-12H2V4h20z"/>'},"layout-header":{body:'<path fill="currentColor" d="M2 19h20V5H2zm2-2v-6h16v6zm16-8H4V7h16z"/>',hidden:!0},"layout-rows":{body:'<path fill="currentColor" d="M2 5h20v14H2zm2 2v4h16V7zm16 6H4v4h16z"/>',hidden:!0},"layout-sharp":{body:'<path fill="currentColor" d="M22 20H2V4h20zm-12-2h10v-8H10zm-6 0h4v-8H4zM4 8h16V6H4z"/>'},"layout-sidebar-left":{body:'<path fill="currentColor" d="M2 5h20v14H2zm2 2v10h2V7zm4 0v10h12V7z"/>',hidden:!0},"layout-sidebar-right":{body:'<path fill="currentColor" d="M22 5H2v14h20zm-2 2v10h-2V7zm-4 0v10H4V7z"/>',hidden:!0},"layout-solid":{body:'<path fill="currentColor" d="M8 20H4v-2H2v-8h6zm14-2h-2v2H10V10h12zM20 6h2v2H2V6h2V4h16z"/>'},leaf:{body:'<path fill="currentColor" d="M1 18h2v4H1zm2-2h2v2H3zm2-2h6v2H5zm6-2h2v2h-2zm-6 6h4v2H5zm4 2h4v2H9zm4-2h4v2h-4zm4-2h2v2h-2zm2-8h2v8h-2zm0-4h2v4h-2zm-2-2h2v2h-2zm-4 2h4v2h-4zM7 6h6v2H7zM5 8h2v2H5zm-2 2h2v4H3z"/>'},"letter-a":{body:'<path fill="currentColor" d="M8 12h8V5h2v16h-2v-7H8v7H6V5h2zm8-7H8V3h8z"/>'},"letter-a-circle":{body:'<path fill="currentColor" d="M18 22H6v-2h12zM6 20H4v-2h2zm14 0h-2v-2h2zM4 18H2V6h2zm5-7h6V8h2v10h-2v-5H9v5H7V8h2zm13 7h-2V6h2zM15 8H9V6h6zM6 6H4V4h2zm14 0h-2V4h2zm-2-2H6V2h12z"/>'},"letter-b":{body:'<path fill="currentColor" d="M16 5H8v6h8v2H8v6h8v2H6V3h10zm2 14h-2v-6h2zm0-8h-2V5h2z"/>'},"letter-b-circle":{body:'<path fill="currentColor" d="M18 22H6v-2h12zM6 20H4v-2h2zm14 0h-2v-2h2zM4 18H2V6h2zM16 8H9v3h7v2H9v3h7v2H7V6h9zm6 10h-2V6h2zm-4-2h-2v-3h2zm0-5h-2V8h2zM6 6H4V4h2zm14 0h-2V4h2zm-2-2H6V2h12z"/>'},"letter-c":{body:'<path fill="currentColor" d="M16 21H8v-2h8zm-8-2H6V5h2zm10 0h-2v-3h2zm0-11h-2V5h2zm-2-3H8V3h8z"/>'},"letter-c-circle":{body:'<path fill="currentColor" d="M18 22H6v-2h12zM6 20H4v-2h2zm14 0h-2v-2h2zM4 18H2V6h2zm11 0H9v-2h6zm7 0h-2V6h2zM9 16H7V8h2zm8 0h-2v-2h2zm0-6h-2V8h2zm-2-2H9V6h6zM6 6H4V4h2zm14 0h-2V4h2zm-2-2H6V2h12z"/>'},"letter-d":{body:'<path fill="currentColor" d="M14 5H8v14h6v2H6V3h8zm2 14h-2v-2h2zm2-2h-2V7h2zM16 7h-2V5h2z"/>'},"letter-d-circle":{body:'<path fill="currentColor" d="M18 22H6v-2h12zM6 20H4v-2h2zm14 0h-2v-2h2zM4 18H2V6h2zM15 8h-5v8h5v2H8V6h7zm7 10h-2V6h2zm-5-2h-2V8h2zM6 6H4V4h2zm14 0h-2V4h2zm-2-2H6V2h12z"/>'},"letter-e":{body:'<path fill="currentColor" d="M18 5H8v6h8v2H8v6h10v2H6V3h12z"/>'},"letter-e-circle":{body:'<path fill="currentColor" d="M18 22H6v-2h12zM6 20H4v-2h2zm14 0h-2v-2h2zM4 18H2V6h2zM16 8h-6v3h4v2h-4v3h6v2H8V6h8zm6 10h-2V6h2zM6 6H4V4h2zm14 0h-2V4h2zm-2-2H6V2h12z"/>'},"letter-f":{body:'<path fill="currentColor" d="M18 5H8v6h8v2H8v8H6V3h12z"/>'},"letter-f-circle":{body:'<path fill="currentColor" d="M18 22H6v-2h12zM6 20H4v-2h2zm14 0h-2v-2h2zM4 18H2V6h2zM16 8h-6v3h4v2h-4v5H8V6h8zm6 10h-2V6h2zM6 6H4V4h2zm14 0h-2V4h2zm-2-2H6V2h12z"/>'},"letter-g":{body:'<path fill="currentColor" d="M16 21H8v-2h8zm-8-2H6V5h2zm10-7v7h-2v-5h-4v-2zm0-4h-2V5h2zm-2-3H8V3h8z"/>'},"letter-g-circle":{body:'<path fill="currentColor" d="M18 22H6v-2h12zM6 20H4v-2h2zm14 0h-2v-2h2zM4 18H2V6h2zm11 0H9v-2h6zm7 0h-2V6h2zM9 16H7V8h2zm8 0h-2v-3h-3v-2h5zm-2-8H9V6h6zM6 6H4V4h2zm14 0h-2V4h2zm-2-2H6V2h12z"/>'},"letter-h":{body:'<path fill="currentColor" d="M8 11h8V3h2v18h-2v-8H8v8H6V3h2z"/>'},"letter-h-circle":{body:'<path fill="currentColor" d="M18 22H6v-2h12zM6 20H4v-2h2zm14 0h-2v-2h2zM4 18H2V6h2zm18 0h-2V6h2zM9 11h6V7h2v10h-2v-4H9v4H7V7h2zM6 6H4V4h2zm14 0h-2V4h2zm-2-2H6V2h12z"/>'},"letter-i":{body:'<path fill="currentColor" d="M16 5h-3v14h3v2H8v-2h3V5H8V3h8z"/>'},"letter-i-circle":{body:'<path fill="currentColor" d="M18 22H6v-2h12zM6 20H4v-2h2zm14 0h-2v-2h2zM4 18H2V6h2zM15 8h-2v8h2v2H9v-2h2V8H9V6h6zm7 10h-2V6h2zM6 6H4V4h2zm14 0h-2V4h2zm-2-2H6V2h12z"/>'},"letter-j":{body:'<path fill="currentColor" d="M16 21H8v-2h8zm-8-2H6v-3h2zm10 0h-2V5h-4V3h6z"/>'},"letter-j-circle":{body:'<path fill="currentColor" d="M18 22H6v-2h12zM6 20H4v-2h2zm14 0h-2v-2h2zM4 18H2V6h2zm10 0h-4v-2h4zm8 0h-2V6h2zm-12-2H8v-2h2zm6 0h-2V8h-4V6h6zM6 6H4V4h2zm14 0h-2V4h2zm-2-2H6V2h12z"/>'},"letter-k":{body:'<path fill="currentColor" d="M8 11h2v2H8v8H6V3h2zm10 8v2h-2v-2zm-2 0h-2v-2h2zm-2-2h-2v-2h2zm-2-2h-2v-2h2zm0-4h-2V9h2zm2-2h-2V7h2zm2-2h-2V5h2zm2-2h-2V3h2z"/>'},"letter-k-circle":{body:'<path fill="currentColor" d="M18 22H6v-2h12zM6 20H4v-2h2zm14-2v2h-2v-2zM4 18H2V6h2zm18 0h-2V6h2zm-12-7h2v2h-2v4H8V7h2zm6 6h-2v-2h2zm-2-2h-2v-2h2zm0-4h-2V9h2zm2-2h-2V7h2zM6 6H4V4h2zm14 0h-2V4h2zm-2-2H6V2h12z"/>'},"letter-l":{body:'<path fill="currentColor" d="M8 19h10v2H6V3h2z"/>'},"letter-l-circle":{body:'<path fill="currentColor" d="M18 22H6v-2h12zM6 20H4v-2h2zm14-2v2h-2v-2zM4 18H2V6h2zm18 0h-2V6h2zm-12-3h6v2H8V7h2zM6 6H4V4h2zm14 0h-2V4h2zm-2-2H6V2h12z"/>'},"letter-m":{body:'<path fill="currentColor" d="M7 5h2v2H7v14H5V3h2zm12 16h-2V7h-2V5h2V3h2zm-6-10h-2V9h2zm-2-2H9V7h2zm4 0h-2V7h2z"/>'},"letter-m-circle":{body:'<path fill="currentColor" d="M18 22H6v-2h12zM6 20H4v-2h2zm14-2v2h-2v-2zM4 18H2V6h2zm18 0h-2V6h2zM9 9h2v2H9v6H7V7h2zm8 8h-2v-6h-2V9h2V7h2zm-4-4h-2v-2h2zM6 6H4V4h2zm14 0h-2V4h2zm-2-2H6V2h12z"/>'},"letter-n":{body:'<path fill="currentColor" d="M7 5h2v2H7v14H5V3h2zm12 16h-2v-2h-2v-2h2V3h2zm-4-4h-2v-3h2zm-2-3h-2v-4h2zm-2-4H9V7h2z"/>'},"letter-n-circle":{body:'<path fill="currentColor" d="M18 22H6v-2h12zM6 20H4v-2h2zm14-2v2h-2v-2zM4 18H2V6h2zm18 0h-2V6h2zM9 9h2v2H9v6H7V7h2zm8 8h-2v-2h-2v-2h2V7h2zm-4-4h-2v-2h2zM6 6H4V4h2zm14 0h-2V4h2zm-2-2H6V2h12z"/>'},"letter-o":{body:'<path fill="currentColor" d="M16 21H8v-2h8zm-8-2H6V5h2zm10 0h-2V5h2zM16 5H8V3h8z"/>'},"letter-o-circle":{body:'<path fill="currentColor" d="M18 22H6v-2h12zM6 20H4v-2h2zm14 0h-2v-2h2zM4 18H2V6h2zm11 0H9v-2h6zm7 0h-2V6h2zM9 16H7V8h2zm8 0h-2V8h2zm-2-8H9V6h6zM6 6H4V4h2zm14 0h-2V4h2zm-2-2H6V2h12z"/>'},"letter-p":{body:'<path fill="currentColor" d="M16 5H8v6h8v2H8v8H6V3h10zm2 6h-2V5h2z"/>'},"letter-p-circle":{body:'<path fill="currentColor" d="M18 22H6v-2h12zM6 20H4v-2h2zm14 0h-2v-2h2zM4 18H2V6h2zM15 8h-5v4h5v2h-5v4H8V6h7zm7 10h-2V6h2zm-5-6h-2V8h2zM6 6H4V4h2zm14 0h-2V4h2zm-2-2H6V2h12z"/>'},"letter-q":{body:'<path fill="currentColor" d="M14 21H8v-2h6zm6 0h-4v-2h4zM8 19H6V5h2zm8 0h-2v-2h2zm-2-2h-2v-2h2zm4 0h-2V5h2zM16 5H8V3h8z"/>'},"letter-q-circle":{body:'<path fill="currentColor" d="M18 22H6v-2h12zM6 20H4v-2h2zm14 0h-2v-2h2zM4 18H2V6h2zm9 0H9v-2h4zm4 0h-2v-2h2zm5 0h-2V6h2zM9 16H7V8h2zm6 0h-2v-2h2zm-2-2h-2v-2h2zm4 0h-2V8h2zm-2-6H9V6h6zM6 6H4V4h2zm14 0h-2V4h2zm-2-2H6V2h12z"/>'},"letter-r":{body:'<path fill="currentColor" d="M16 5H8v6h8v2h-4v2h-2v-2H8v8H6V3h10zm2 16h-2v-2h2zm-2-2h-2v-2h2zm-2-2h-2v-2h2zm4-6h-2V5h2z"/>'},"letter-r-circle":{body:'<path fill="currentColor" d="M18 22H6v-2h12zM6 20H4v-2h2zm14 0h-2v-2h2zM4 18H2V6h2zM14 8h-4v4h4v4h-2v-2h-2v4H8V6h6zm2 10h-2v-2h2zm6 0h-2V6h2zm-6-6h-2V8h2zM6 6H4V4h2zm14 0h-2V4h2zm-2-2H6V2h12z"/>'},"letter-s":{body:'<path fill="currentColor" d="M16 21H7v-2h9zm2-2h-2v-6h2zm-2-6H8v-2h8zm-8-2H6V5h2zm9-6H8V3h9z"/>'},"letter-s-circle":{body:'<path fill="currentColor" d="M18 22H6v-2h12zM6 20H4v-2h2zm14 0h-2v-2h2zM4 18H2V6h2zm10 0H9v-2h5zm8 0h-2V6h2zm-6-2h-2v-3h2zm-2-3h-4v-2h4zm-4-2H8V8h2zm5-3h-5V6h5zM6 6H4V4h2zm14 0h-2V4h2zm-2-2H6V2h12z"/>'},"letter-t":{body:'<path fill="currentColor" d="M13 21h-2V5H5V3h14v2h-6z"/>'},"letter-t-circle":{body:'<path fill="currentColor" d="M18 22H6v-2h12zM6 20H4v-2h2zm14 0h-2v-2h2zM4 18H2V6h2zM16 8h-3v10h-2V8H8V6h8zm6 10h-2V6h2zM6 6H4V4h2zm14 0h-2V4h2zm-2-2H6V2h12z"/>'},"letter-u":{body:'<path fill="currentColor" d="M16 21H8v-2h8zm-8-2H6V3h2zm10 0h-2V3h2z"/>'},"letter-u-circle":{body:'<path fill="currentColor" d="M18 22H6v-2h12zM6 20H4v-2h2zm14 0h-2v-2h2zM4 18H2V6h2zm11 0H9v-2h6zm7 0h-2V6h2zM9 16H7V7h2zm8 0h-2V7h2zM6 6H4V4h2zm14 0h-2V4h2zm-2-2H6V2h12z"/>'},"letter-v":{body:'<path fill="currentColor" d="M14 21h-4v-2h4zm-4-2H8v-4h2zm6 0h-2v-4h2zm-8-4H6V3h2zm10 0h-2V3h2z"/>'},"letter-v-circle":{body:'<path fill="currentColor" d="M18 22H6v-2h12zM6 20H4v-2h2zm14 0h-2v-2h2zM4 18H2V6h2zm9 0h-2v-2h2zm9 0h-2V6h2zm-11-2H9v-2h2zm4 0h-2v-2h2zm-6-2H7V7h2zm8 0h-2V7h2zM6 6H4V4h2zm14 0h-2V4h2zm-2-2H6V2h12z"/>'},"letter-w":{body:'<path fill="currentColor" d="M9 21H7v-2h2zm8 0h-2v-2h2zM7 19H5v-2h2zm4 0H9v-2h2zm4 0h-2v-2h2zm4 0h-2v-2h2zM5 17H3V3h2zm8 0h-2V3h2zm8 0h-2V3h2z"/>'},"letter-w-circle":{body:'<path fill="currentColor" d="M18 22H6v-2h12zM6 20H4v-2h2zm14 0h-2v-2h2zM4 18H2V6h2zm7 0H8v-2h3zm5 0h-3v-2h3zm6 0h-2V6h2zM8 16H6V7h2zm5 0h-2V7h2zm5 0h-2V7h2zM6 6H4V4h2zm14 0h-2V4h2zm-2-2H6V2h12z"/>'},"letter-x":{body:'<path fill="currentColor" d="M9 21H7v-4h2zm8 0h-2v-4h2zm-6-4H9v-4h2zm4 0h-2v-4h2zm-2-4h-2v-2h2zm-2-2H9V7h2zm4 0h-2V7h2zM9 7H7V3h2zm8 0h-2V3h2z"/>'},"letter-x-circle":{body:'<path fill="currentColor" d="M18 22H6v-2h12zM6 20H4v-2h2zm14 0h-2v-2h2zM4 18H2V6h2zm18 0h-2V6h2zM9 17H7v-2h2zm8 0h-2v-2h2zm-6-2H9v-2h2zm4 0h-2v-2h2zm-2-2h-2v-2h2zm-2-2H9V9h2zm4 0h-2V9h2zM9 9H7V7h2zm8 0h-2V7h2zM6 6H4V4h2zm14 0h-2V4h2zm-2-2H6V2h12z"/>'},"letter-y":{body:'<path fill="currentColor" d="M13 21h-2v-9h2zm-2-9H9V9h2zm4 0h-2V9h2zM9 9H7V6h2zm8 0h-2V6h2zM7 3v3H5V3zm12 3h-2V3h2z"/>'},"letter-y-circle":{body:'<path fill="currentColor" d="M18 22H6v-2h12zM6 20H4v-2h2zm14 0h-2v-2h2zM4 18H2V6h2zm9 0h-2v-7h2zm9 0h-2V6h2zm-11-7H9V9h2zm4 0h-2V9h2zM9 9H7V7h2zm8 0h-2V7h2zM6 6H4V4h2zm14 0h-2V4h2zm-2-2H6V2h12z"/>'},"letter-z":{body:'<path fill="currentColor" d="M17 21H7v-6h2v4h8zm-6-6H9v-2h2zm2-2h-2v-2h2zm2-2h-2V9h2zm2-2h-2V5H7V3h10z"/>'},"letter-z-circle":{body:'<path fill="currentColor" d="M18 22H6v-2h12zM6 20H4v-2h2zm14 0h-2v-2h2zM4 18H2V6h2zm6-2h6v2H8v-4h2zm12 2h-2V6h2zm-10-4h-2v-2h2zm2-2h-2v-2h2zm2-2h-2V8H8V6h8zM6 6H4V4h2zm14 0h-2V4h2zm-2-2H6V2h12z"/>'},library:{body:'<path fill="currentColor" d="M3 4h2v17H3zm4 4h2v13H7zm4-2h2v15h-2zm4 0h2v5h-2zm2 5h2v5h-2zm2 5h2v5h-2z"/>'},lightbulb:{body:'<path fill="currentColor" d="M9 4h6v2H9zM7 6h2v2H7zm8 0h2v2h-2zm4-2h2v2h-2zm2-2h2v2h-2zM0 10h3v2H0zm21 0h3v2h-3zM3 4h2v2H3zM1 2h2v2H1zm6 12h2v2H7zm8 0h2v2h-2zM5 8h2v6H5zm12 0h2v6h-2zm-8 8h6v2H9zm0 4h6v2H9zm0-2h2v2H9zm4 0h2v2h-2zM11 0h2v3h-2z"/>'},"lightbulb-2":{body:'<path fill="currentColor" d="M8 2h8v2H8zM6 6V4h2v2zm0 6H4V6h2zm2 2H6v-2h2zm2 0H8v4h8v-4h2v-2h2V6h-2V4h-2v2h2v6h-2v2h-2v2h-4zm2-2v2h-2v-2zm0-2h2v2h-2zm0-2v2h-2V8zm0 0V6h2v2zm4 14v-2H8v2z"/>',hidden:!0},"lightbulb-off":{body:'<path fill="currentColor" d="M9 3h6v2H9zM7 5h2v2H7zm8 0h2v2h-2zm-8 8h2v2H7zm8 0h2v2h-2zM5 7h2v6H5zm12 0h2v6h-2zm-8 8h6v2H9zm0 4h6v2H9zm0-2h2v2H9zm4 0h2v2h-2z"/>'},"lightbulb-on":{body:'<path fill="currentColor" d="M13 2h-2v4h2zm2 6H9v2H7v4h2v4h6v-4h2v-4h-2zm0 2v4h-2v2h-2v-2H9v-4zM9 20h6v2H9zm14-9v2h-4v-2zM5 13v-2H1v2zm12-7h2v2h-2zm2 0h2V4h-2zM5 6h2v2H5zm0 0V4H3v2z"/>',hidden:!0},link:{body:'<path fill="currentColor" d="M4 6h7v2H4zm0 10h7v2H4zM2 8h2v8H2zm18-2h-7v2h7zm0 10h-7v2h7zm2-8h-2v8h2zM7 11h10v2H7z"/>'},"link-sharp":{body:'<path fill="currentColor" d="M2 6h9v2H2zm0 10h9v2H2zm0-8h2v8H2zm20-2h-9v2h9zm0 10h-9v2h9zm0-8h-2v8h2zM7 11h10v2H7z"/>'},linkedin:{body:'<path fill="currentColor" d="M7 22H1V8h6zm12-12h-8v10h2v-8h4v2h-2v8H9V8h10zm4 12h-6v-8h2v6h2v-8h2zM3 20h2V10H3zm18-8h-2v-2h2zM5 7H3V5h2zM3 5H1V3h2zm4 0H5V3h2zM5 3H3V1h2z"/>'},"linkedin-2":{body:'<path fill="currentColor" d="M20 22H4v-2h16zM4 20H2V4h2zm18 0h-2V4h2zM9 17H7v-6h2zm6-6v2h-2v4h-2v-6zm2 6h-2v-4h2zM9 9H7V7h2zm11-5H4V2h16z"/>'},"linkedin-2-solid":{body:'<path fill="currentColor" d="M20 22H4v-2H2V4h2V2h16v2h2v16h-2zM7 17h2v-6H7zm4 0h2v-4h2v-2h-4zm4 0h2v-4h-2zM7 9h2V7H7z"/>'},linux:{body:'<path fill="currentColor" d="M15 22H9v-2h6zm-6-2H7v-2h2zm8 0h-2v-2h2zM3 14h4v4H5v-2H1v-4h2zm20 2h-4v2h-2v-4h4v-2h2zm-10-3h-2v-2H9V9h6v2h-2zm-8-1H3v-2h2zm16 0h-2v-2h2zM7 10H5V8h2zm12 0h-2V8h2zM9 8H7V4h2zm8 0h-2V4h2zm-2-4H9V2h6z"/>'},"linux-solid":{body:'<path fill="currentColor" d="M15 22H9v-2H7v-2H5v-2H1v-4h2v-2h2V8h2V4h2V2h6v2h2v4h2v2h2v2h2v4h-4v2h-2v2h-2zM9 9v2h2v2h2v-2h2V9z"/>'},list:{body:'<path fill="currentColor" d="M6 6H4v2h2zm14 0H8v2h12zM4 11h2v2H4zm16 0H8v2h12zM4 16h2v2H4zm16 0H8v2h12z"/>',hidden:!0},"list-box":{body:'<path fill="currentColor" d="M4 2h16v2H4zm2 5h2v2H6zm4 0h8v2h-8zm-4 4h2v2H6zm4 0h8v2h-8zm-4 4h2v2H6zm4 0h8v2h-8zm-6 5h16v2H4zM2 4h2v16H2zm18 0h2v16h-2z"/>'},"list-box-sharp":{body:'<path fill="currentColor" d="M2 2h20v2H2zm4 5h2v2H6zm4 0h8v2h-8zm-4 4h2v2H6zm4 0h8v2h-8zm-4 4h2v2H6zm4 0h8v2h-8zm-8 5h20v2H2zM2 4h2v16H2zm18 0h2v16h-2z"/>'},loader:{body:'<path fill="currentColor" d="M13 22h-2v-6h2zm-6-3H5v-2h2zm12 0h-2v-2h2zM9 17H7v-2h2zm8 0h-2v-2h2zm-9-4H2v-2h6zm14 0h-6v-2h6zM9 9H7V7h2zm8 0h-2V7h2zm-4-1h-2V2h2zM7 7H5V5h2zm12 0h-2V5h2z"/>'},loading:{body:'<path fill="currentColor" d="M4 12H2V6h2zm2-6H4V4h2zm6-2H6V2h6z"/>'},"loading-2":{body:'<path fill="currentColor" d="M18 22H6v-2h12zM6 20H4v-2h2zm14 0h-2v-2h2zM4 18H2V6h2zm18 0h-2v-6h2zM6 6H4V4h2zm6-2H6V2h6z"/>'},"loading-3":{body:'<path fill="currentColor" d="M18 22H6v-2h12zM6 20H4v-2h2zm14 0h-2v-2h2zM4 18H2v-6h2zm18 0h-2V6h2zM9 14.998h2v2H9V15H7V9h2zm6-6h2v2h-2V9H9V7h6zM20 6h-2V4h2zm-2-2h-6V2h6z"/>'},lock:{body:'<path fill="currentColor" d="M5 8h14v2H5zm0 12h14v2H5zM3 10h2v10H3zm16 0h2v10h-2zM7 4h2v4H7zm2-2h6v2H9zm6 2h2v4h-2z"/>'},"lock-open":{body:'<path fill="currentColor" d="M15 2H9v2H7v2h2V4h6v4H4v14h16V8h-3V4h-2zm0 8h3v10H6V10zm-2 3h-2v4h2z"/>',hidden:!0},"lock-sharp":{body:'<path fill="currentColor" d="M3 8h18v2H3zm0 12h18v2H3zm0-10h2v10H3zm16 0h2v10h-2zM7 4h2v4H7zm0-2h10v2H7zm8 2h2v4h-2z"/>'},login:{body:'<g fill="currentColor"><path d="M2 11h14v2H2zm10-2h2v2h-2z"/><path d="M10 7h2v10h-2zm2 6h2v2h-2zM6 2h12v2H6zm0 18h12v2H6zM4 4h2v5H4zm0 11h2v5H4zM18 4h2v16h-2z"/></g>'},"login-sharp":{body:'<g fill="currentColor"><path d="M2 11h14v2H2zm10-2h2v2h-2z"/><path d="M10 7h2v10h-2zm2 6h2v2h-2zM4 2h16v2H4zm0 18h16v2H4zM4 4h2v5H4zm0 11h2v5H4zM18 4h2v16h-2z"/></g>'},logout:{body:'<g fill="currentColor"><path d="M8 11h12v2H8zm8-2h2v2h-2z"/><path d="M14 7h2v10h-2zm2 6h2v2h-2zM6 2h12v2H6zm0 18h12v2H6zM4 4h2v16H4zm14 0h2v3h-2zm0 13h2v3h-2z"/></g>'},"logout-sharp":{body:'<g fill="currentColor"><path d="M8 11h12v2H8zm8-2h2v2h-2z"/><path d="M14 7h2v10h-2zm2 6h2v2h-2zM4 2h16v2H4zm0 18h16v2H4zM4 4h2v16H4zm14 0h2v3h-2zm0 13h2v3h-2z"/></g>'},luggage:{body:'<path fill="currentColor" d="M9 2h6v4h4v14h-2v2h-2v-2H9v2H7v-2H5V6h4zm2 4h2V4h-2zM7 18h10V8H7zm4-8v6H9v-6zm4 0v6h-2v-6z"/>',hidden:!0},"magic-edit":{body:'<path fill="currentColor" d="M16 2h4v2h-4zm2 2h2v2h-2zm-2 2h2v2h-2zm-2 2h2v2h-2zm-2 2h2v2h-2zm-2 2h2v2h-2zm-2 2h2v2H8zm-2 2h2v2H6zm-2 2h2v2H4zm-2-2h2v4H2zm2-2h2v2H4zm2-2h2v2H6zm2-2h2v2H8zm2-2h2v2h-2zm2-2h2v2h-2zm2-2h2v2h-2zm0 2h2v2h-2zm2-2h2v2h-2zm0 8h2v2h-2zm0 8h2v2h-2zm-4-4h2v2h-2zm8 0h2v2h-2zm-6-2h2v2h-2zm4 0h2v2h-2zm0 4h2v2h-2zm-4 0h2v2h-2zM4 2h2v2H4zM2 4h2v2H2zm2 2h2v2H4zm2-2h2v2H6zm14 6h2v2h-2zM8 20h2v2H8z"/>'},mail:{body:'<path fill="currentColor" d="M6 8h2v2H6zm2 2h2v2H8zm10-2h-2v2h2zm-2 2h-2v2h2zm-6 2h4v2h-4zM2 6h2v12H2zm18 0h2v12h-2zM4 4h16v2H4zm0 14h16v2H4z"/>'},"mail-arrow-right":{body:'<path fill="currentColor" d="M20 4H2v16h10v-2H4V6h16v6h2V4zM6 8h2v2H6zm4 4H8v-2h2zm4 0v2h-4v-2zm2-2v2h-2v-2zm0 0V8h2v2zm8 8h-2v-2h-2v-2h-2v2h2v2h-6v2h6v2h-2v2h2v-2h2v-2h2z"/>',hidden:!0},"mail-check":{body:'<path fill="currentColor" d="M4 4h18v10h-2V6H4v12h8v2H2V4zm4 4H6v2h2v2h2v2h4v-2h2v-2h2V8h-2v2h-2v2h-4v-2H8zm6 10h2v2h-2zm4 2v2h-2v-2zm2-2h-2v2h2zm0 0v-2h2v2z"/>',hidden:!0},"mail-delete":{body:'<path fill="currentColor" d="M20 4H2v16h12v-2H4V6h16v8h2V4zM6 8h2v2H6zm4 4H8v-2h2zm4 0v2h-4v-2zm2-2v2h-2v-2zm0 0V8h2v2zm2 6h-2v2h2v2h-2v2h2v-2h2v2h2v-2h-2v-2h2v-2h-2v2h-2z"/>',hidden:!0},"mail-flash":{body:'<path fill="currentColor" d="M4 4h18v8h-2V6H4v12h8v2H2V4zm4 4H6v2h2v2h2v2h4v-2h2v-2h2V8h-2v2h-2v2h-4v-2H8zm10 6h2v4h4v2h-2v2h-2v2h-2v-4h-4v-2h2v-2h2z"/>',hidden:!0},"mail-multiple":{body:'<path fill="currentColor" d="M24 2H4v16h20zM6 16V4h16v12zM2 7H0v15h19v-2H2zm8-1H8v2h2v2h2v2h4v-2h2V8h2V6h-2v2h-2v2h-4V8h-2z"/>',hidden:!0},"mail-off":{body:'<path fill="currentColor" d="M2 2h2v2H2zm4 4H4V4h2zm2 2H6V6h2zm2 2H8V8h2zm2 2h-2v-2h2zm2 0h-2v2h2v2h2v2h2v2h2v2h2v-2h-2v-2h-2v-2h-2v-2h-2zm2-2h-2v2h2zm0 0V8h2v2zm-6-6h12v12h-2V6H10zm4 14v2H2V8h2v10z"/>',hidden:!0},"mail-open":{body:'<path fill="currentColor" d="M4 8h2V6H4zm2 4h2v2H6zm-2-2h2v2H4zm14 0h2v2h-2zM6 6h2V4H6zm2 8h8v2H8zm12-6h-2V6h2zm-2 4h-2v2h2zm0-6h-2V4h2zM8 4h8V2H8zM2 8h2v12H2zm18 0h2v12h-2zM4 20h16v2H4z"/>'},"mail-open-sharp":{body:'<path fill="currentColor" d="M4 8h2V6H4zm2 4h2v2H6zm-2-2h2v2H4zm14 0h2v2h-2zM6 6h2V4H6zm2 8h8v2H8zm12-6h-2V6h2zm-2 4h-2v2h2zm0-6h-2V4h2zM8 4h8V2H8zM2 8h2v12H2zm18 0h2v12h-2zM2 20h20v2H2z"/>'},"mail-right":{body:'<g fill="currentColor"><path d="M6 8h2v2H6zm2 2h2v2H8zm10-2h-2v2h2zm-2 2h-2v2h2zm-6 2h4v2h-4z" opacity=".1"/><path d="M4 4h16v2H4zm0 14h8v2H4zM2 6h2v12H2zm18 0h2v6h-2zM6 8h2v2H6zm2 2h2v2H8zm6 0h2v2h-2zm2-2h2v2h-2zm-6 4h4v2h-4zm12 6h2v2h-2zm-8 0h4v2h-4zm6-2h2v6h-2zm-2-2h2v10h-2z"/></g>'},"mail-right-sharp":{body:'<g fill="currentColor"><path d="M6 8h2v2H6zm2 2h2v2H8zm10-2h-2v2h2zm-2 2h-2v2h2zm-6 2h4v2h-4z" opacity=".1"/><path d="M2 4h20v2H2zm0 14h10v2H2zM2 6h2v12H2zm18 0h2v6h-2zM6 8h2v2H6zm2 2h2v2H8zm6 0h2v2h-2zm2-2h2v2h-2zm-6 4h4v2h-4zm12 6h2v2h-2zm-8 0h4v2h-4zm6-2h2v6h-2zm-2-2h2v10h-2z"/></g>'},"mail-sharp":{body:'<path fill="currentColor" d="M6 8h2v2H6zm2 2h2v2H8zm10-2h-2v2h2zm-2 2h-2v2h2zm-6 2h4v2h-4zM2 6h2v12H2zm18 0h2v12h-2zM2 4h20v2H2zm0 14h20v2H2z"/>'},"mail-unread":{body:'<path fill="currentColor" d="M22 2h-6v6h6zM4 4h10v2H4v12h16v-8h2v10H2V4zm4 4H6v2h2v2h2v2h4v-2h2v-2h-2v2h-4v-2H8z"/>',hidden:!0},mailbox:{body:'<path fill="currentColor" d="M3 18h18v2H3zM1 8h2v10H1zm4-4h14v2H5zM3 6h2v2H3zm4 0h2v2H7zm12 0h2v2h-2zM9 8h2v10H9zm12 0h2v10h-2zM5 10h2v2H5zm9 0h4v2h-4zm2 2h2v2h-2z"/>'},"mailbox-sharp":{body:'<path fill="currentColor" d="M1 18h22v2H1zM1 8h2v10H1zm4-4h14v2H5zM3 6h2v2H3zm4 0h2v2H7zm12 0h2v2h-2zM9 8h2v10H9zm12 0h2v10h-2zM5 10h2v2H5zm9 0h4v2h-4zm2 2h2v2h-2z"/>'},map:{body:'<path fill="currentColor" d="M4 20h2v2H2V6h2zm12 0h2v2h-4v-2h-2v-2h2V8h-2V6h4zm-8 0H6v-2h2zm12 0h-2v-2h2zM10 4h2v2h-2v10h2v2H8V4H6V2h4zm12 14h-2V4h-2V2h4zM6 6H4V4h2zm12 0h-2V4h2z"/>'},"map-pin":{body:'<path fill="currentColor" d="M7 2h10v2H7zM5 4h2v2H5zm14 0h-2v2h2zM7 17h2v2H7zm2 2h2v2H9zm6-2h2v2h-2zm-2 2h2v2h-2zm-2 2h2v2h-2zm-6-7h2v3H5zm12 0h2v3h-2zM3 6h2v8H3zm18 0h-2v8h2zM10 6h4v2h-4zM8 8h2v4H8zm2 4h4v2h-4zm4-4h2v4h-2z"/>'},"map-pin-home":{body:'<path fill="currentColor" d="M6 2h10v2H6zM4 4h2v2H4zm14 0h-2v2h2zM6 17h2v2H6zm2 2h2v2H8zm2 2h2v2h-2zm-6-7h2v3H4zM2 6h2v8H2zm18 0h-2v3h2zM9 6h4v2H9zM7 8h2v4H7zm2 4h4v2H9zm4-4h2v4h-2zm3 5h2v2h-2zm-2 2h2v6h-2zm8 0h2v6h-2zm-4-4h2v2h-2zm2 2h2v2h-2zm-4 6h6v2h-6zm2-2h2v2h-2z"/>'},"map-solid":{body:'<path fill="currentColor" d="M8 20H6v2H2V6h2V4h2V2h2zm14-2h-2v2h-2v2h-2V4h2V2h4zM12 6h2v14h-2v-2h-2V4h2z"/>'},mastodon:{body:'<path fill="currentColor" d="M11 20v2H7v-2zm-4-2v2H5v-2zm6 0v2h-2v-2zM5 6v12H3V6zm6 10v2H9v-2zm8-2v2h-8v-2zm2-8v8h-2V6zM9 8v4H7V8zm8 0v4h-2V8zm-4 0v2h-2V8zm-2-2v2H9V6zm4 0v2h-2V6zM7 4v2H5V4zm12 0v2h-2V4zm-2-2v2H7V2z"/>'},"mastodon-solid":{body:'<path fill="currentColor" d="M17 4h2v2h2v8h-2v2h-8v2h2v2h-2v2H7v-2H5v-2H3V6h2V4h2V2h10zM9 8H7v4h2zh2v2h2V8h2v4h2V8h-2V6h-2v2h-2V6H9z"/>'},megaphone:{body:'<path fill="currentColor" d="M4 6h12v2H4zM2 8h2v6H2zm2 6h12v2H4zM20 2h2v18h-2zm-2 16h2v2h-2zm-2-2h2v2h-2zm0-12h2v2h-2zm2-2h2v2h-2zM8 8h2v6H8zm-2 8h2v4H6zm2 4h4v2H8zm2-4h2v4h-2z"/>'},"megaphone-sharp":{body:'<path fill="currentColor" d="M4 6h12v2H4zM2 6h2v10H2zm2 8h12v2H4zM20 2h2v18h-2zm-2 16h2v2h-2zm-2-2h2v2h-2zm0-12h2v2h-2zm2-2h2v2h-2zM8 8h2v6H8zm-2 8h2v4H6zm0 4h6v2H6zm4-4h2v4h-2z"/>'},meh:{body:'<path fill="currentColor" d="M6 20h12v2H6zM6 2h12v2H6zm12 2h2v2h-2zM4 4h2v2H4zm0 14h2v2H4zm14 0h2v2h-2zM2 6h2v12H2zm18 0h2v12h-2zM7 14h10v2H7zm1-6h2v2H8zm6 0h2v2h-2z"/>'},"meh-sharp":{body:'<path fill="currentColor" d="M4 20h16v2H4zM4 2h16v2H4zM2 2h2v20H2zm18 0h2v20h-2zM7 14h10v2H7zm1-6h2v2H8zm6 0h2v2h-2z"/>'},membercard:{body:'<path fill="currentColor" d="M20 19h-5v4h-2v-2h-2v2H9v-4H4v-2h16zM4 17H2V7h2zm18 0h-2V7h2zm-8-2H6v-2h8zm4-4H6V9h12zm2-4H4V5h16z"/>'},"membercard-sharp":{body:'<path fill="currentColor" d="M22 19h-7v4h-2v-2h-2v2H9v-4H2V5h20zM4 17h16V7H4zm10-2H6v-2h8zm4-4H6V9h12z"/>'},"memory-stick":{body:'<path fill="currentColor" d="M3 4h18v2H3zM1 6h2v3H1zm0 5h2v7H1zm20 0h2v7h-2zM3 9h2v2H3zm16 0h2v2h-2zm2-3h2v3h-2zM3 18h18v2H3zm0-4h18v2H3zm2 2h2v2H5zm4 0h2v2H9zm4 0h2v2h-2zm4 0h2v2h-2zM7 8h2v4H7zm4 0h2v4h-2zm4 0h2v4h-2z"/>'},"memory-stick-sharp":{body:'<path fill="currentColor" d="M1 4h22v2H1zm0 2h2v3H1zm0 5h2v7H1zm20 0h2v7h-2zM3 9h2v2H3zm16 0h2v2h-2zm2-3h2v3h-2zM1 18h22v2H1zm2-4h18v2H3zm2 2h2v2H5zm4 0h2v2H9zm4 0h2v2h-2zm4 0h2v2h-2zM7 8h2v4H7zm4 0h2v4h-2zm4 0h2v4h-2z"/>'},menu:{body:'<path fill="currentColor" d="M20 18H4v-2h16zm0-5H4v-2h16zm0-5H4V6h16z"/>'},"menu-circle":{body:'<path fill="currentColor" d="M6 2h12v2H6zm0 18h12v2H6zM2 6h2v12H2zm18 0h2v12h-2zm-2-2h2v2h-2zm0 14h2v2h-2zM4 4h2v2H4zm0 14h2v2H4zM7 7h10v2H7zm0 4h10v2H7zm0 4h10v2H7z"/>'},"menu-square":{body:'<path fill="currentColor" d="M4 2h16v2H4zm0 18h16v2H4zM2 4h2v16H2zm18 0h2v16h-2zM7 7h10v2H7zm0 4h10v2H7zm0 4h10v2H7z"/>'},"menu-square-sharp":{body:'<path fill="currentColor" d="M2 2h20v2H2zm0 18h20v2H2zM2 4h2v16H2zm18 0h2v16h-2zM7 7h10v2H7zm0 4h10v2H7zm0 4h10v2H7z"/>'},message:{body:'<path fill="currentColor" d="M20 2H4v2h16zm0 14H6v2h14zm2-12h-2v12h2zM4 4H2v18h2zm2 14H4v2h2z"/>'},"message-arrow-left":{body:'<path fill="currentColor" d="M4 2h18v12h-2V4H4v18H2V2zm2 14h4v2H6v2H4v-2h2zm16 0h-6v-2h2v-2h-2v2h-2v2h-2v2h2v2h2v2h2v-2h-2v-2h6z"/>',hidden:!0},"message-arrow-right":{body:'<path fill="currentColor" d="M4 2h18v10h-2V4H4v18H2V2zm2 14h4v2H6v2H4v-2h2zm16 0h-2v-2h-2v-2h-2v2h2v2h-6v2h6v2h-2v2h2v-2h2v-2h2z"/>',hidden:!0},"message-bookmark":{body:'<path fill="currentColor" d="M4 2h18v16H6v2H4v-2h2v-2h14V4H4v18H2V2zm14 4h-6v8h2v-2h2v2h2z"/>',hidden:!0},"message-clock":{body:'<path fill="currentColor" d="M20 2H2v20h2V4h16v4h2V2zM8 16H6v2H4v2h2v-2h2zm6-2h2v2h2v2h-4zm6-4h-8v2h-2v8h2v2h8v-2h2v-8h-2zm0 2v8h-8v-8z"/>',hidden:!0},"message-delete":{body:'<path fill="currentColor" d="M4 2h18v16H6v2H4v-2h2v-2h14V4H4v18H2V2zm9 7h-2V7H9v2h2v2H9v2h2v-2h2v2h2v-2h-2zm0 0V7h2v2z"/>',hidden:!0},"message-flash":{body:'<path fill="currentColor" d="M20 2H2v20h2V4h16v10h2V2zM10 16H6v2H4v2h2v-2h4zm6-4h2v4h4v2h-2v2h-2v2h-2v-4h-4v-2h2v-2h2z"/>',hidden:!0},"message-image":{body:'<path fill="currentColor" d="M4 2h18v16H6v2H4v-2h2v-2h14V4H4v18H2V2zm10 4h-2v2h-2v2H8v2H6v2h2v-2h2v-2h2V8h2v2h2v2h2v-2h-2V8h-2zM6 6h2v2H6z"/>',hidden:!0},"message-minus":{body:'<path fill="currentColor" d="M4 2h18v16H6v2H4v-2h2v-2h14V4H4v18H2V2zm12 7H8v2h8z"/>',hidden:!0},"message-plus":{body:'<path fill="currentColor" d="M20 2H2v20h2V4h16v12H6v2H4v2h2v-2h16V2zm-7 7h3v2h-3v3h-2v-3H8V9h3V6h2z"/>',hidden:!0},"message-processing":{body:'<path fill="currentColor" d="M4 2h18v16H6v2H4v-2h2v-2h14V4H4v18H2V2zm5 7H7v2h2zm2 0h2v2h-2zm6 0h-2v2h2z"/>',hidden:!0},"message-reply":{body:'<path fill="currentColor" d="M4 18h2v2H4v2H2V4h2zm6 0H6v-2h4zm6-6h4v2h-4v4h-2v-2h-2v-2h-2v-2h2v-2h2V8h2zm6 4h-2v-2h2zm0-6h-2V4h2zm-2-6H4V2h16z"/>'},"message-reply-glyph":{body:'<path fill="currentColor" d="M22 10h-4V6h-6v2h-2v2H8v8H6v2H4v2H2V2h20zm-6 2h4v2h-4v4h-2v-2h-2v-2h-2v-2h2v-2h2V8h2zm6 4h-2v-2h2z"/>'},"message-reply-sharp":{body:'<path fill="currentColor" d="M22 10h-2V4H4v14h2v2H4v2H2V2h20zm-12 8H6v-2h4zm6-6h4v2h-4v4h-2v-2h-2v-2h-2v-2h2v-2h2V8h2zm6 4h-2v-2h2z"/>'},"message-reply-solid":{body:'<path fill="currentColor" d="M20 4h2v6h-4V6h-6v2h-2v2H8v6h2v2H6v2H4v2H2V4h2V2h16zm-4 8h4v2h-4v4h-2v-2h-2v-2h-2v-2h2v-2h2V8h2zm6 4h-2v-2h2z"/>'},"message-sharp":{body:'<path fill="currentColor" d="M22 2H2v2h20zm0 14H6v2h16zm0-12h-2v12h2zM4 4H2v18h2zm2 14H4v2h2z"/>'},"message-text":{body:'<path fill="currentColor" d="M20 2H4v2h16zm0 14H6v2h14zm2-12h-2v12h2zM4 4H2v18h2zm2 14H4v2h2zm0-6h4v2H6zm0-4h8v2H6z"/>'},"message-text-sharp":{body:'<path fill="currentColor" d="M22 2H2v2h20zm0 14H6v2h16zm0-12h-2v12h2zM4 4H2v18h2zm2 14H4v2h2zm0-6h4v2H6zm0-4h8v2H6z"/>'},mic:{body:'<path fill="currentColor" d="M10 2h4v2h-4zM8 4h2v10H8zm2 10h4v2h-4zm4-10h2v10h-2zM4 10h2v6H4zm2 6h2v2H6zm2 2h8v2H8zm8-2h2v2h-2zm2-6h2v6h-2zm-7 10h2v2h-2z"/>'},"mic-off":{body:'<g fill="currentColor"><path d="M10 2h4v2h-4zM8 8h2v6H8zm2 6h4v2h-4zm4-10h2v6h-2zM4 10h2v6H4zm2 6h2v2H6zm2 2h8v2H8zm8-2h2v2h-2zm-2-2h2v2h-2zm-2-2h2v2h-2zm-2-2h2v2h-2z"/><path d="M8 8h2v2H8zM6 6h2v2H6zM4 4h2v2H4zM2 2h2v2H2zm16 16h2v2h-2zm2 2h2v2h-2zm-2-10h2v4h-2zm-7 10h2v2h-2z"/></g>'},"mic-off-sharp":{body:'<g fill="currentColor"><path d="M8 2h8v2H8zm0 6h2v8H8zm2 6h4v2h-4zm4-10h2v6h-2zM4 10h2v9H4zm2 8h12v2H6zm10-2h2v2h-2zm-2-2h2v2h-2zm-2-2h2v2h-2zm-2-2h2v2h-2z"/><path d="M8 8h2v2H8zM6 6h2v2H6zM4 4h2v2H4zM2 2h2v2H2zm16 16h2v2h-2zm2 2h2v2h-2zm-2-10h2v4h-2zm-7 10h2v2h-2z"/></g>'},"mic-sharp":{body:'<path fill="currentColor" d="M8 2h8v2H8zm0 2h2v10H8zm0 10h8v2H8zm6-10h2v10h-2zM4 10h2v8H4zm2 8h12v2H6zm12-8h2v8h-2zm-7 10h2v2h-2z"/>'},minus:{body:'<path fill="currentColor" d="M4 11h16v2H4z"/>'},"minus-box":{body:'<path fill="currentColor" d="M4 2h16v2H4zm0 18h16v2H4zM2 4h2v16H2zm18 0h2v16h-2zM8 11h8v2H8z"/>'},"minus-box-sharp":{body:'<path fill="currentColor" d="M2 2h20v2H2zm0 18h20v2H2zM2 4h2v16H2zm18 0h2v16h-2zM8 11h8v2H8z"/>'},"missed-call":{body:'<path fill="currentColor" d="M20 6h-4v2h2v2h-2v2h-2v2h-2v2h-2v-2H8v-2H6v-2H4V8H2v2h2v2h2v2h2v2h2v2h2v-2h2v-2h2v-2h2v-2h2v2h2V6z"/>',hidden:!0},modem:{body:'<path fill="currentColor" d="M4 12h16v2H4zm0 8h16v2H4zm-2-6h2v6H2zm18 0h2v6h-2zm-4 2h2v2h-2zm-4 0h2v2h-2zm2-6h2v2h-2zm-3-2h2v2h-2zM9 4h2v2H9zm10 0h2v2h-2zm-2 4h2v2h-2zm-4-2h4v2h-4zm-2-4h8v2h-8z"/>'},"modem-sharp":{body:'<path fill="currentColor" d="M2 12h20v2H2zm0 8h20v2H2zm0-6h2v6H2zm18 0h2v6h-2zm-4 2h2v2h-2zm-4 0h2v2h-2zm2-6h2v2h-2zm-3-2h2v2h-2zM9 4h2v2H9zm10 0h2v2h-2zm-2 4h2v2h-2zm-4-2h4v2h-4zm-2-4h8v2h-8z"/>'},money:{body:'<path fill="currentColor" d="M8 8h12v2H8zm0 10h12v2H8zm-2-8h2v8H6zm14 0h2v8h-2zM4 4h12v2H4zm0 10h2v2H4zM2 6h2v8H2zm14 0h2v2h-2zm-4 6h4v4h-4z"/>'},"money-sharp":{body:'<path fill="currentColor" d="M6 8h16v2H6zm0 10h16v2H6zm0-8h2v8H6zm14 0h2v8h-2zM2 4h16v2H2zm0 10h4v2H2zm0-8h2v8H2zm14 0h2v2h-2zm-4 6h4v4h-4z"/>'},monitor:{body:'<path fill="currentColor" d="M4 2h16v2H4zm0 14h16v2H4zM2 4h2v12H2zm18 0h2v12h-2zm-9 14h2v2h-2zm-3 2h8v2H8z"/>'},"monitor-sharp":{body:'<path fill="currentColor" d="M2 2h20v2H2zm0 14h20v2H2zM2 4h2v12H2zm18 0h2v12h-2zm-9 14h2v2h-2zm-3 2h8v2H8z"/>'},"mood-happy":{body:'<path fill="currentColor" d="M5 3h14v2H5zm0 16H3V5h2zm14 0v2H5v-2zm0 0h2V5h-2zM10 8H8v2h2zm4 0h2v2h-2zm-5 6v-2H7v2zm6 0v2H9v-2zm0 0h2v-2h-2z"/>',hidden:!0},"mood-neutral":{body:'<path fill="currentColor" d="M5 3h14v2H5zm0 16H3V5h2zm14 0v2H5v-2zm0 0h2V5h-2zM10 8H8v2h2zm4 0h2v2h-2zm1 5H9v2h6z"/>',hidden:!0},"mood-sad":{body:'<path fill="currentColor" d="M5 3h14v2H5zm0 16H3V5h2zm14 0v2H5v-2zm0 0h2V5h-2zM10 8H8v2h2zm4 0h2v2h-2zm-5 8v-2h6v2h2v-2h-2v-2H9v2H7v2z"/>',hidden:!0},moon:{body:'<path fill="currentColor" d="M18 22H8v-2h10zM8 20H6v-2h2zm12 0h-2v-2h2zM6 18H4v-2h2zm16 0h-2v-4h-2v-2h2v-2h2zM4 16H2V6h2zm14 0h-6v-2h6zm-6-2h-2v-2h2zm-2-2H8V6h2zM6 6H4V4h2zm8-2h-2v2h-2V4H6V2h8z"/>'},"moon-star":{body:'<path fill="currentColor" d="M6 2h8v2h-2v2h-2V4H6zM4 6V4h2v2zm0 10H2V6h2zm2 2H4v-2h2zm2 2H6v-2h2zm10 0v2H8v-2zm2-2v2h-2v-2zm-2-4v-2h2v-2h2v8h-2v-4zm-6 0h6v2h-6zm-2-2h2v2h-2zm0 0V6H8v6zm8-10h2v2h2v2h-2v2h-2V6h-2V4h2z"/>',hidden:!0},"moon-stars":{body:'<path fill="currentColor" d="M20 0h2v2h2v2h-2v2h-2V4h-2V2h2zM8 4h8v2h-2v2h-2V6H8zM6 8V6h2v2zm0 8H4V8h2zm2 2H6v-2h2zm8 0v2H8v-2zm2-2v2h-2v-2zm-2-4v-2h2V8h2v8h-2v-4zm-4 0h4v2h-4zm0 0V8h-2v4zm-8 6H2v2H0v2h2v2h2v-2h2v-2H4z"/>',hidden:!0},"more-horizontal":{body:'<path fill="currentColor" d="M3 9h2v2H3zm8 0h2v2h-2zm8 0h2v2h-2zM1 11h2v2H1zm8 0h2v2H9zm8 0h2v2h-2zM3 13h2v2H3zm8 0h2v2h-2zm8 0h2v2h-2zM5 11h2v2H5zm8 0h2v2h-2zm8 0h2v2h-2z"/>'},"more-horizontal-sharp":{body:'<path fill="currentColor" d="M1 9h6v2H1zm8 0h6v2H9zm8 0h6v2h-6zM1 11h2v2H1zm8 0h2v2H9zm8 0h2v2h-2zM1 13h6v2H1zm8 0h6v2H9zm8 0h6v2h-6zM5 11h2v2H5zm8 0h2v2h-2zm8 0h2v2h-2z"/>'},"more-vertical":{body:'<path fill="currentColor" d="M15 3v2h-2V3zm0 8v2h-2v-2zm0 8v2h-2v-2zM13 1v2h-2V1zm0 8v2h-2V9zm0 8v2h-2v-2zM11 3v2H9V3zm0 8v2H9v-2zm0 8v2H9v-2zm2-14v2h-2V5zm0 8v2h-2v-2zm0 8v2h-2v-2z"/>'},"more-vertical-sharp":{body:'<path fill="currentColor" d="M15 1v6h-2V1zm0 8v6h-2V9zm0 8v6h-2v-6zM13 1v2h-2V1zm0 8v2h-2V9zm0 8v2h-2v-2zM11 1v6H9V1zm0 8v6H9V9zm0 8v6H9v-6zm2-12v2h-2V5zm0 8v2h-2v-2zm0 8v2h-2v-2z"/>'},mouse:{body:'<path fill="currentColor" d="M8 2h8v2H8zm0 20h8v-2H8zM6 4h2v2H6zm0 16h2v-2H6zM16 4h2v2h-2zm0 16h2v-2h-2zM4 6h2v12H4zm14 0h2v12h-2zm-7 0h2v4h-2z"/>'},move:{body:'<path fill="currentColor" d="M13 2h2v2h2v2h-4v5h5V7h2v2h2v2h2v2h-2v2h-2v2h-2v-4h-5v5h4v2h-2v2h-2v2h-2v-2H9v-2H7v-2h4v-5H6v4H4v-2H2v-2H0v-2h2V9h2V7h2v4h5V6H7V4h2V2h2V0h2z"/>'},movie:{body:'<path fill="currentColor" d="M3 3h18v18H3zm2 2v2h2V5zm4 0v6h6V5zm8 0v2h2V5zm2 4h-2v2h2zm0 4h-2v2h2zm0 4h-2v2h2zm-4 2v-6H9v6zm-8 0v-2H5v2zm-2-4h2v-2H5zm0-4h2V9H5z"/>',hidden:!0},mug:{body:'<path fill="currentColor" d="M16 19H6v-2h10zm2-8h2v2h-2v4h-2V7H6v10H4V5h16v2h-2zm4 0h-2V7h2z"/>'},"mug-glyph":{body:'<path fill="currentColor" d="M22 13h-4v6H4V5h18zm-4-2h2V7h-2z"/>'},"mug-sharp":{body:'<path fill="currentColor" d="M16 17V7H6v10zm2-6h2V7h-2zm0 8H4V5h18v8h-4z"/>'},"mug-solid":{body:'<path fill="currentColor" d="M16 19H6v-2H4V5h16v2h-2v4h2v2h-2v4h-2zm6-8h-2V7h2z"/>'},music:{body:'<path fill="currentColor" d="M4 12h4v2H4zm-2 2h2v4H2zm2 4h4v2H4zM8 6h2v12H8zm10 0h2v12h-2zm-6 8h2v4h-2zm2-2h4v2h-4zm0 6h4v2h-4zM10 4h8v2h-8z"/>'},"music-sharp":{body:'<g fill="currentColor"><path d="M2 12h8v2H2zm0 2h2v4H2zm0 4h8v2H2z"/><path d="M8 6h2v12H8zm10 0h2v12h-2zm-6 8h2v4h-2z"/><path d="M12 12h8v2h-8zm0 6h8v2h-8zM8 4h12v2H8z"/></g>'},netlify:{body:'<path fill="currentColor" d="M13 23h-2v-6h2zm-7-3H4v-2h2zm2-2H6v-2h2zm5-3h-2v-2h2zm-6-2H0v-2h7zm4 0H9v-2h2zm4 0h-2v-2h2zm9 0h-7v-2h7zm-11-2h-2V9h2zM8 8H6V6h2zm5-1h-2V1h2zM6 6H4V4h2z"/>'},"netlify-solid":{body:'<path fill="currentColor" d="M13 23h-2v-6h2zm-7-3H4v-2h2zm2-2H6v-2h2zm7-3H9V9h6zm-8-2H0v-2h7zm17 0h-7v-2h7zM8 8H6V6h2zm5-1h-2V1h2zM6 6H4V4h2z"/>'},next:{body:'<path fill="currentColor" d="M6 4h2v2h2v2h2v2h2v4h-2v2h-2v2H8v2H6zm12 0h-2v16h2z"/>',hidden:!0},note:{body:'<path fill="currentColor" d="M2 4h2v16H2zm18 0h2v12h-2zM4 2h16v2H4zm14 14h2v2h-2zm-2 2h2v2h-2zM4 20h12v2H4zm10-8h6v2h-6zm-2 2h2v6h-2z"/>'},"note-delete":{body:'<path fill="currentColor" d="M11 2h10v14h-2v2h-2v-2h-2v2h2v2h-2v2H3V10h2v10h8v-6h6V4h-8zM7 4H5V2H3v2h2v2H3v2h2V6h2v2h2V6H7zm0 0h2V2H7z"/>',hidden:!0},"note-multiple":{body:'<path fill="currentColor" d="M21 6H7v16h8v-2h2v-2h-2v-2h2v2h2v-2h2zM9 20V8h10v6h-6v6zm-6-2h2V4h12V2H3z"/>',hidden:!0},"note-plus":{body:'<path fill="currentColor" d="M7 1H5v3H2v2h3v3h2V6h3V4H7zm12 1h-7v2h7v10h-6v6H5v-9H3v11h12v-2h2v-2h2v-2h2V2zm-2 16h-2v-2h2z"/>',hidden:!0},"note-sharp":{body:'<path fill="currentColor" d="M2 4h2v16H2zm18 0h2v12h-2zM2 2h20v2H2zm16 14h2v2h-2zm-2 2h2v2h-2zM2 20h14v2H2zm10-8h8v2h-8zm0 2h2v6h-2z"/>'},notebook:{body:'<g fill="currentColor"><path d="M6 2h14v2H6zm0 18h14v2H6zM20 4h2v16h-2zM4 4h2v16H4z"/><path d="M2 7h6v2H2zm0 4h6v2H2zm0 4h6v2H2zM16 4h2v16h-2z"/></g>'},"notebook-sharp":{body:'<g fill="currentColor"><path d="M4 2h18v2H4zm0 18h18v2H4zM20 4h2v16h-2zM4 4h2v16H4z"/><path d="M2 7h6v2H2zm0 4h6v2H2zm0 4h6v2H2zM16 4h2v16h-2z"/></g>'},notes:{body:'<g fill="currentColor"><path d="M6 8h2v12H6zM2 4h2v12H2zm18 4h2v8h-2zM8 6h12v2H8zM4 2h12v2H4zm14 14h2v2h-2zm-2 2h2v2h-2zm-8 2h8v2H8zm6-6h6v2h-6z"/><path d="M14 14h2v6h-2zm2-10h2v2h-2zM4 16h2v2H4z"/></g>'},"notes-delete":{body:'<path fill="currentColor" d="M19 2H3v20h10v-2H5V4h14v10h2V2zm-2 4H7v2h10zM7 10h10v2H7zm6 4H7v2h6zm6 4h-2v-2h-2v2h2v2h-2v2h2v-2h2v2h2v-2h-2zm0 0h2v-2h-2z"/>',hidden:!0},"notes-multiple":{body:'<path fill="currentColor" d="M7 0h16v20H5V0zm14 18V2H7v16zM9 4h10v2H9zm10 4H9v2h10zM9 12h7v2H9zm10 10H3V4H1v20h18z"/>',hidden:!0},"notes-plus":{body:'<path fill="currentColor" d="M5 2h16v12h-2V4H5v16h8v2H3V2zm2 4h10v2H7zm10 4H7v2h10zM7 14h7v2H7zm13 5h3v2h-3v3h-2v-3h-3v-2h3v-3h2z"/>',hidden:!0},"notes-sharp":{body:'<g fill="currentColor"><path d="M6 8h2v12H6zM2 4h2v12H2zm18 4h2v8h-2zM6 6h16v2H6zM2 2h16v2H2zm16 14h2v2h-2zm-2 2h2v2h-2zM6 20h10v2H6zm8-6h6v2h-6z"/><path d="M14 14h2v6h-2zm2-10h2v2h-2zM2 16h4v2H2z"/></g>'},notification:{body:'<path fill="currentColor" d="M14 4V2h-4v2H5v2h14V4zm5 12H5v-4H3v6h5v4h2v-4h4v2h-4v2h6v-4h5v-6h-2V6h-2v8h2zM5 6v8h2V6z"/>',hidden:!0},"notification-off":{body:'<path fill="currentColor" d="M14 2v2h5v2h-8V2zM5 16h9v2h2v4h-6v-2h4v-2h-4v4H8v-4H3v-6h2v-2h2v4H5zm16-2h-2v-2h-2V6h2v6h2zM5 2H3v2h2v2h2v2h2v2h2v2h2v2h2v2h2v2h2v2h2v-2h-2v-2h-2v-2h-2v-2h-2v-2h-2V8H9V6H7V4H5z"/>',hidden:!0},npm:{body:'<path fill="currentColor" d="M24 16H12v2H6v-2H0V7h24zM8 16h2v-2h3V9H8zm-6-2h1v-4h2v4h1V9H2zm13 0h1v-4h2v4h1v-4h2v4h1V9h-7zm-3-1h-2v-3h2z"/>'},open:{body:'<g fill="currentColor"><path d="M5 5h6v2H5zm8-2h8v2h-8zM5 19h12v2H5zM3 7h2v12H3zm14 6h2v6h-2z"/><path d="M19 3h2v8h-2zm-8 8h2v2h-2zm6-4h-2v2h2zm2-2h-2v2h2zm-4 4h-2v2h2zm-4 4H9v2h2z"/></g>'},"open-sharp":{body:'<g fill="currentColor"><path d="M3 5h8v2H3zm10-2h8v2h-8zM3 19h16v2H3zM3 7h2v12H3zm14 6h2v6h-2z"/><path d="M19 3h2v8h-2zm-8 8h2v2h-2zm6-4h-2v2h2zm2-2h-2v2h2zm-4 4h-2v2h2zm-4 4H9v2h2z"/></g>'},package:{body:'<g fill="currentColor"><path d="M10 20h4v2h-4zm0-16h4V2h-4zm0 6h4v2h-4zm4 8h4v2h-4zm0-12h4V4h-4zm0 2h4v2h-4zm4 8h4v2h-4zm0-8h4V6h-4zM6 18h4v2H6zM6 6h4V4H6zm0 2h4v2H6zm-4 8h4v2H2zm0-8h4V6H2z"/><path d="M2 6h2v12H2zm18 0h2v12h-2zm-8 6h2v8h-2zm-2-6h4v2h-4z"/></g>'},"paint-bucket":{body:'<path fill="currentColor" d="M8 3h8v2H8zm0 2H6v4H4v12h16V9h-2V5h-2v4H8zm8 6h2v8H6v-8h2v6h2v-4h2v2h2v-2h2z"/>',hidden:!0},paperclip:{body:'<path fill="currentColor" d="M5 5h16v10H7V9h10v2H9v2h10V7H5v10h14v2H3V5z"/>',hidden:!0},parking:{body:'<path fill="currentColor" d="M4 2h16v2H4zm0 18h16v2H4zM2 4h2v16H2zm18 0h2v16h-2zM8 6h2v12H8zm2 0h4v2h-4zm4 2h2v4h-2zm-4 4h4v2h-4z"/>'},"parking-off":{body:'<g fill="currentColor"><path d="M8 2h12v2H8zM4 20h14v2H4zM2 6h2v14H2zm18-2h2v12h-2zM8 8h2v10H8zm4-2h2v2h-2zm2 2h2v2h-2zm-4 4h4v2h-4zm10 8h2v2h-2zm-2-2h2v2h-2zm-2-2h2v2h-2zm-2-2h2v2h-2z"/><path d="M12 12h2v2h-2zm-2-2h2v2h-2zM8 8h2v2H8zM6 6h2v2H6zM4 4h2v2H4zM2 2h2v2H2z"/></g>'},"parking-off-sharp":{body:'<g fill="currentColor"><path d="M8 2h14v2H8zM4 20h14v2H4zM2 6h2v16H2zm18-2h2v12h-2zM8 8h2v10H8zm4-2h2v2h-2zm2 2h2v2h-2zm-4 4h4v2h-4zm10 8h2v2h-2zm-2-2h2v2h-2zm-2-2h2v2h-2zm-2-2h2v2h-2z"/><path d="M12 12h2v2h-2zm-2-2h2v2h-2zM8 8h2v2H8zM6 6h2v2H6zM4 4h2v2H4zM2 2h2v2H2z"/></g>'},"parking-sharp":{body:'<path fill="currentColor" d="M2 2h20v2H2zm0 18h20v2H2zM2 4h2v16H2zm18 0h2v16h-2zM8 6h2v12H8zm2 0h4v2h-4zm4 2h2v4h-2zm-4 4h4v2h-4z"/>'},"party-popper":{body:'<path fill="currentColor" d="M4 20h2v2H2v-4h2zm16 1h-2v-2h2zm-10-1H6v-2h4zm-4-2H4v-4h2zm8 0h-4v-2h4zm-4-2H8v-2h2zm6 0h-2v-4h2zm6 0h-2v-2h2zM8 14H6v-4h2zm12 0h-2v-2h2zm-6-2h-2v-2h2zm-2-2H8V8h4zm8-1h-4V7h4zM5 8H3V6h2zm17-1h-2V5h2zM12 6h-2V4h2zm-2-2H8V2h2zm7 0h-2V2h2z"/>'},pause:{body:'<path fill="currentColor" d="M10 20H4V4h6zm8-16v16h-6V4zm-4 2v12h2V6zM6 18h2V6H6z"/>'},"pause-solid":{body:'<path fill="currentColor" d="M10 20H4V4h6zm8-16v16h-6V4z"/>'},"pc-case":{body:'<path fill="currentColor" d="M4 2h16v2H4zm0 18h16v2H4zM6 4h2v16H6zM2 4h2v16H2zm18 0h2v16h-2zM10 6h8v2h-8zm0 4h2v2h-2z"/>'},"pc-case-sharp":{body:'<path fill="currentColor" d="M4 2h16v2H4zm0 18h16v2H4zM6 4h2v16H6zM2 2h2v20H2zm18 0h2v20h-2zM10 6h8v2h-8zm0 4h2v2h-2z"/>'},"pen-square":{body:'<path fill="currentColor" d="M5 3h6v2H5zM3 5h2v14H3zm16 8h2v6h-2zM5 19h14v2H5zm3-9h2v6H8zm2 4h4v2h-4zm0-6h2v2h-2zm2-2h2v2h-2zm2-2h2v2h-2zm2-2h2v2h-2zm2 2h2v2h-2zm2 2h2v2h-2zm-2 2h2v2h-2zm-2 2h2v2h-2zm-2 2h2v2h-2zm-4 0h2v2h-2z"/>'},"pen-square-sharp":{body:'<path fill="currentColor" d="M5 3h6v2H5zM3 3h2v18H3zm16 10h2v6h-2zM5 19h16v2H5zm3-9h2v6H8zm2 4h4v2h-4zm0-6h2v2h-2zm2-2h2v2h-2zm2-2h2v2h-2zm2-2h2v2h-2zm2 2h2v2h-2zm2 2h2v2h-2zm-2 2h2v2h-2zm-2 2h2v2h-2zm-2 2h2v2h-2zm-4 0h2v2h-2z"/>'},pencil:{body:'<path fill="currentColor" d="M4 16h2v2h2v2h2v2H2v-8h2zm8 4h-2v-2h2zm2-2h-2v-2h2zm-4-2H8v-2h2zm6 0h-2v-2h2zM6 14H4v-2h2zm6 0h-2v-2h2zm6 0h-2v-2h2zM8 12H6v-2h2zm6 0h-2v-2h2zm6 0h-2v-2h2zm-10-2H8V8h2zm8 0h-2V8h2zm4 0h-2V8h2zM12 8h-2V6h2zm4 0h-2V6h2zm4 0h-2V6h2zm-6-2h-2V4h2zm4 0h-2V4h2zm-2-2h-2V2h2z"/>'},percent:{body:'<path fill="currentColor" d="M6 20H4v-2h2zm12 0h-4v-2h4zM8 18H6v-2h2zm6 0h-2v-4h2zm6 0h-2v-4h2zm-10-2H8v-2h2zm2-2h-2v-2h2zm6 0h-4v-2h4zm-8-2H6v-2h4zm4 0h-2v-2h2zm-8-2H4V6h2zm6 0h-2V6h2zm4 0h-2V8h2zm2-2h-2V6h2zm-8-2H6V4h4zm10 0h-2V4h2z"/>'},phone:{body:'<path fill="currentColor" d="M4 1h5v2H4zm5 2h2v4H9zM7 7h2v4H7zm-3 5h2v2H4zM2 3h2v9H2zm7 8h2v2H9zm2 2h2v2h-2zm2 2h4v2h-4zm4-2h4v2h-4zm4 2h2v5h-2zM6 14h2v2H6zm2 2h2v2H8zm2 2h2v2h-2zm2 2h9v2h-9z"/>'},"phone-call":{body:'<path fill="currentColor" d="M4 1h5v2H4zm5 2h2v4H9zM7 7h2v4H7zm-3 5h2v2H4zM2 3h2v9H2zm7 8h2v2H9zm2 2h2v2h-2zm2 2h4v2h-4zm4-2h4v2h-4zm4 2h2v5h-2zM6 14h2v2H6zm2 2h2v2H8zm2 2h2v2h-2zm2 2h9v2h-9zm1-18h5v2h-5zm7 4h2v5h-2zm-2-2h2v2h-2zm-5 2h3v2h-3zm3 2h2v3h-2z"/>'},"phone-call-sharp":{body:'<path fill="currentColor" d="M2 1h9v2H2zm7 2h2v6H9zM7 7h2v4H7zm-3 5h2v2H4zM2 3h2v9H2zm7 8h2v2H9zm2 2h2v2h-2zm2 2h4v2h-4zm2-2h6v2h-6zm6 0h2v9h-2zM6 14h2v2H6zm2 2h2v2H8zm2 2h2v2h-2zm2 2h9v2h-9zm1-18h5v2h-5zm7 4h2v5h-2zm-2-2h2v2h-2zm-5 2h3v2h-3zm3 2h2v3h-2z"/>'},"phone-outgoing":{body:'<g fill="currentColor"><path d="M4 1h5v2H4zm5 2h2v4H9zM7 7h2v4H7zm-3 5h2v2H4zM2 3h2v9H2zm7 8h2v2H9zm2 2h2v2h-2zm2 2h4v2h-4zm4-2h4v2h-4zm4 2h2v5h-2zM6 14h2v2H6zm2 2h2v2H8zm2 2h2v2h-2zm2 2h9v2h-9zm9-9h-2V3h2z"/><path d="M21 5h-8V3h8zm-2 2h-2V5h2zm-2 2h-2V7h2zm-2 2h-2V9h2z"/></g>'},"phone-outgoing-sharp":{body:'<g fill="currentColor"><path d="M21 11h-2V3h2z"/><path d="M21 5h-8V3h8zm-2 2h-2V5h2zm-2 2h-2V7h2zm-2 2h-2V9h2zM2 1h9v2H2zm7 2h2v6H9zM7 7h2v4H7zm-3 5h2v2H4zM2 3h2v9H2zm7 8h2v2H9zm2 2h2v2h-2zm2 2h4v2h-4zm2-2h6v2h-6zm6 0h2v9h-2zM6 14h2v2H6zm2 2h2v2H8zm2 2h2v2h-2zm2 2h9v2h-9z"/></g>'},"phone-sharp":{body:'<path fill="currentColor" d="M2 1h9v2H2zm7 2h2v6H9zM7 7h2v4H7zm-3 5h2v2H4zM2 3h2v9H2zm7 8h2v2H9zm2 2h2v2h-2zm2 2h4v2h-4zm2-2h6v2h-6zm6 0h2v9h-2zM6 14h2v2H6zm2 2h2v2H8zm2 2h2v2h-2zm2 2h9v2h-9z"/>'},pi:{body:'<path fill="currentColor" d="M8 6h2v15H8zm6 0h2v13h-2zm2 13h4v2h-4zM6 4h14v2H6zM4 6h2v4H4z"/>'},"pi-circle":{body:'<g fill="currentColor"><path d="M2 6h2v12H2zm4 14h12v2H6zM20 6h2v12h-2zM6 2h12v2H6zM4 4h2v2H4zm0 14h2v2H4zm14 0h2v2h-2zm0-14h2v2h-2zM6 9h2v2H6zm2-2h10v2H8z"/><path d="M10 7h2v10h-2zm3 0h2v8h-2zm2 8h2v2h-2z"/></g>'},"picture-in-picture":{body:'<path fill="currentColor" d="M4 4h16v2H4zM2 6h2v12H2zm2 12h16v2H4zM20 6h2v12h-2zm-8 2h6v2h-6zm4 2h2v4h-2zm-6 2h6v2h-6zm0-4h2v4h-2z"/>'},"picture-in-picture-alt":{body:'<path fill="currentColor" d="M2 4h20v16H2zm2 2v12h16V6zm6 4h8v6h-8zm2 2v2h4v-2z"/>',hidden:!0},"picture-in-picture-sharp":{body:'<path fill="currentColor" d="M2 4h20v2H2zm0 2h2v12H2zm0 12h20v2H2zM20 6h2v12h-2zm-8 2h6v2h-6zm4 2h2v4h-2zm-6 2h6v2h-6zm0-4h2v4h-2z"/>'},pin:{body:'<path fill="currentColor" d="M7 2h10v2H7zM5 6V4h2v2zm0 8H3V6h2zm2 2H5v-2h2zm2 2H7v-2h2zm2 2H9v-2h2zm2 0v2h-2v-2zm2-2v2h-2v-2zm2-2v2h-2v-2zm2-2v2h-2v-2zm0-8h2v8h-2zm0 0V4h-2v2zm-5 2h-4v4h4z"/>',hidden:!0},pipette:{body:'<g fill="currentColor"><path d="M3 15h2v4H3zm2 4h4v2H5zm0-6h2v2H5zm4 4h2v2H9zm-2-6h2v2H7zm4 4h2v2h-2zM9 9h2v2H9zm4 4h2v2h-2zm-2-6h2v2h-2zM9 5h2v2H9zm2-2h2v2h-2zm2 2h2v2h-2zm2-2h2v2h-2zm2-2h2v2h-2zm2 2h2v2h-2zm2 2h2v2h-2zm-2 2h2v2h-2zm-2 2h2v2h-2zm2 2h2v2h-2zm-2 2h2v2h-2zm-4-4h2v2h-2zm2 2h2v2h-2zM1 19h2v4H1z"/><path d="M1 21h4v2H1z"/></g>'},pixelarticons:{body:'<path fill="currentColor" d="M7 13h2v2H7zm0-6h6v2H7zM4 2h16v2H4zm0 18h16v2H4zm-2 0V4h2v16zm18 0V4h2v16zM7 11h6v2H7zm4-2h2v2h-2zM7 9h2v2H7zm6 4h2v2h-2zm2-2h2v2h-2zm0 4h2v2h-2zm-4 0h2v2h-2z"/>'},play:{body:'<path fill="currentColor" d="M15 11h-2V9h2zm0 4h-2v-2h2zm-2 2h-2v-2h2zm0-8h-2V7h2zm-2-2H9V5h2zM9 21H7V3h2zm6-8h2v-2h-2zm-6 4h2v2H9z"/>'},playlist:{body:'<path fill="currentColor" d="M10 13h6V5h6v4h-4v10h-8zm2 2v2h4v-2zM2 17h6v2H2zm6-4H2v2h6zM2 9h12v2H2zm12-4H2v2h12z"/>',hidden:!0},plug:{body:'<path fill="currentColor" d="M16 18h-3v4h-2v-4H8v-2h8zm-8-2H6v-2h2zm10 0h-2v-2h2zm-8-9h4V2h2v5h5v2h-1v5h-2V9H6v5H4V9H3V7h5V2h2z"/>'},"plug-solid":{body:'<path fill="currentColor" d="M10 7h4V2h2v5h5v2h-1v5h-2v2h-2v2h-3v4h-2v-4H8v-2H6v-2H4V9H3V7h5V2h2z"/>'},plus:{body:'<path fill="currentColor" d="M13 11h7v2h-7v7h-2v-7H4v-2h7V4h2z"/>'},"plus-box":{body:'<g fill="currentColor"><path d="M4 2h16v2H4zm0 18h16v2H4zM2 4h2v16H2zm18 0h2v16h-2zM7 11h10v2H7z"/><path d="M11 17V7h2v10z"/></g>'},"plus-box-sharp":{body:'<g fill="currentColor"><path d="M2 2h20v2H2zm0 18h20v2H2zM2 4h2v16H2zm18 0h2v16h-2zM7 11h10v2H7z"/><path d="M11 17V7h2v10z"/></g>'},pnpm:{body:'<path fill="currentColor" d="M8 22H2v-6h6zm7 0H9v-6h6zm7 0h-6v-6h6zM4 20h2v-2H4zm7 0h2v-2h-2zm7 0h2v-2h-2zm-7-9v2h2v-2zm11 4h-6V9h6zm-4-2h2v-2h-2zM8 8H2V2h6zm7 0H9V2h6zm7 0h-6V2h6zM4 6h2V4H4zm7 0h2V4h-2zm7 0h2V4h-2zm-3 9H9V9h6z"/>'},"pnpm-solid":{body:'<path fill="currentColor" d="M8 22H2v-6h6zm7 0H9v-6h6zm7 0h-6v-6h6zm-7-7H9V9h6zm7 0h-6V9h6zM8 8H2V2h6zm7 0H9V2h6zm7 0h-6V2h6z"/>'},pointer:{body:'<path fill="currentColor" d="M17 9h2v3h-2zm-4-2h2v4h-2zM9 3h2v8H9zM5 3h2v10H5zm14 6h2v2h-2zm-4-2h2v2h-2zm-4 0h2v2h-2zM7 1h2v2H7zM3 11h2v2H3zm-2 2h2v2H1zm0 2h2v2H1zm2 2h2v2H3zm2 2h2v2H5zm2 2h12v2H7zm12-2h2v2h-2zm2-8h2v8h-2zM5 13h2v2H5zm2 2h2v2H7z"/>'},potion:{body:'<path fill="currentColor" d="M8 6h8v2H8zm0-4h8v2H8zm0 6h2v2H8zm6 0h2v2h-2zM6 20h12v2H6zm-2-8h2v8H4zm14 0h2v8h-2zM6 10h2v2H6zm10 0h2v2h-2zM6 4h2v2H6zm10 0h2v2h-2z"/>'},"potion-sharp":{body:'<path fill="currentColor" d="M8 6h8v2H8zm0-4h8v2H8zm0 6h2v2H8zm6 0h2v2h-2zM4 20h16v2H4zm0-8h2v8H4zm14 0h2v8h-2zM6 10h2v2H6zm10 0h2v2h-2zM6 2h2v6H6zm10 0h2v6h-2z"/>'},pound:{body:'<path fill="currentColor" d="M8 20H6v-2h2zm10 0h-8v-2h8zm-8-8h5v2h-5v4H8v-4H6v-2h2V6h2zm8-4h-2V6h2zm-2-2h-6V4h6z"/>'},power:{body:'<path fill="currentColor" d="M6 20h12v2H6zM18 6h2v2h-2zM4 6h2v2H4zm2-2h2v2H6zm10 0h2v2h-2zM4 18h2v2H4zm14 0h2v2h-2zM2 8h2v10H2zm18 0h2v10h-2zm-9-6h2v9h-2z"/>'},"power-off":{body:'<path fill="currentColor" d="M6 20h10v2H6zM18 6h2v2h-2zm-2-2h2v2h-2zM4 18h2v2H4zm14 0h2v2h-2zM2 8h2v10H2zm18 0h2v8h-2zm-9-6h2v6h-2zm9 18h2v2h-2zm-4-4h2v2h-2zm-2-2h2v2h-2zm-2-2h2v2h-2zm-2-2h2v2h-2zM8 8h2v2H8zM6 6h2v2H6zM4 4h2v2H4zM2 2h2v2H2z"/>'},presentation:{body:'<path fill="currentColor" d="M1 3h22v2H1zm1 2h2v11H2zm2 11h16v2H4zM20 5h2v11h-2zM9 18h2v2H9zm-2 2h2v2H7zm6-2h2v2h-2zm2 2h2v2h-2z"/>'},"presentation-sharp":{body:'<path fill="currentColor" d="M1 3h22v2H1zm1 2h2v11H2zm0 11h20v2H2zM20 5h2v11h-2zM9 18h2v2H9zm-2 2h2v2H7zm6-2h2v2h-2zm2 2h2v2h-2z"/>'},prev:{body:'<path fill="currentColor" d="M6 4h2v16H6zm12 0h-2v2h-2v3h-2v2h-2v2h2v3h2v2h2v2h2z"/>',hidden:!0},print:{body:'<path fill="currentColor" d="M6 2h12v6h4v10h-4v4H6v-4H2V8h4zm2 6h8V4H8zm-2 8v-4h12v4h2v-6H4v6zm2-2v6h8v-6z"/>',hidden:!0},printer:{body:'<g fill="currentColor"><path d="M6 4h2v4H6zm2-2h8v2H8zm8 2h2v4h-2z"/><path d="M4 6h16v2H4zM2 8h2v10H2zm2 10h2v2H4zm2-4h12v2H6z"/><path d="M6 14h2v8H6zm2 6h8v2H8zm8-6h2v8h-2zm2 4h2v2h-2zm2-10h2v10h-2zm-4 2h2v2h-2zm-4 0h2v2h-2z"/></g>'},"printer-minimal-sharp":{body:'<path fill="currentColor" d="M6 2h12v2H6zM4 8h16v2H4zm2-4h2v4H6zM2 8h2v8H2zm14-4h2v4h-2zM2 16h4v2H2zm4-2h2v6H6zm10 0h2v6h-2zM6 12h12v2H6zm0 8h12v2H6zm12-4h4v2h-4zm2-8h2v8h-2z"/>'},projector:{body:'<path fill="currentColor" d="M7 9h4v2H7zm-2 2h2v4H5zm2 4h4v2H7zm4-4h2v4h-2zm-8 0h2v2H3zm-2 2h2v6H1zm2 6h18v2H3zm18-6h2v6h-2zm-8-2h8v2h-8zM8 2h2v5H8zm4 4h2v2h-2zm2-2h2v2h-2zM4 6h2v2H4zM2 4h2v2H2zm13 11h4v2h-4z"/>'},proportions:{body:'<path fill="currentColor" d="M4 4h16v2H4zM2 6h2v12H2zm2 12h16v2H4zM20 6h2v12h-2zM4 10h12v2H4zm12 2h2v6h-2zm-5 0h2v6h-2z"/>'},"proportions-sharp":{body:'<path fill="currentColor" d="M2 4h20v2H2zm0 2h2v12H2zm0 12h20v2H2zM20 6h2v12h-2zM4 10h14v2H4zm12 2h2v6h-2zm-5 0h2v6h-2z"/>'},"qr-code":{body:'<path fill="currentColor" d="M7 22H4v-2h3zm6 0h-2v-3h2zm4 0h-2v-5h2zm5 0h-2v-2h2zM4 20H2v-3h2zm5 0H7v-3h2zm-2-3H4v-2h3zm6 0h-2v-2h2zm9 0h-5v-2h5zM4 13H2v-2h2zm7 0H6v-2h5zm7 0h-3v-2h3zm4 0h-2v-2h2zm-9-2h-2V6h2zM7 9H4V7h3zm13 0h-3V7h3zM4 7H2V4h2zm5 0H7V4h2zm8 0h-2V4h2zm5 0h-2V4h2zM7 4H4V2h3zm6 0h-2V2h2zm7 0h-3V2h3z"/>'},"qr-code-solid":{body:'<path fill="currentColor" d="M7 17h2v3H7v2H4v-2H2v-3h2v-2h3zm6 5h-2v-3h2zm4 0h-2v-5h2zm5 0h-2v-2h2zm-9-5h-2v-2h2zm9 0h-5v-2h5zM4 13H2v-2h2zm7 0H6v-2h5zm7 0h-3v-2h3zm4 0h-2v-2h2zm-9-2h-2V6h2zM7 4h2v3H7v2H4V7H2V4h2V2h3zm13 0h2v3h-2v2h-3V7h-2V4h2V2h3zm-7 0h-2V2h2z"/>'},"quote-text-inline":{body:'<path fill="currentColor" d="M2 8h4v4H2zm6 0h4v4H8zM2 6h2v2H2zm6 0h2v2H8zM4 4h2v2H4zm6 0h2v2h-2zm4 2h8v2h-8zm0 4h8v2h-8zM2 14h20v2H2zm0 4h20v2H2z"/>'},radio:{body:'<path fill="currentColor" d="M11 9h2v2h-2zm0 4h2v2h-2zm-2-2h2v2H9zm4 0h2v2h-2zm6-2h-2v6h2zM5 9h2v6H5zm18-2h-2v10h2zM1 7h2v10H1zm16 0h-2v2h2zM7 7h2v2H7zm14-2h-2v2h2zM3 5h2v2H3zm14 10h-2v2h2zM7 15h2v2H7zm14 2h-2v2h2zM3 17h2v2H3z"/>'},"radio-handheld":{body:'<path fill="currentColor" d="M9 2v5h8v15H7V2zm0 7v4h6V9zm6 6H9v5h6z"/>',hidden:!0},"radio-on":{body:'<path fill="currentColor" d="M17 3H7v2H5v2H3v10h2v2h2v2h10v-2h2v-2h2V7h-2V5h-2zm0 2v2h2v10h-2v2H7v-2H5V7h2V5zm-9 6h2v2h2v2h-2v-2H8zm8-2h-2v2h-2v2h2v-2h2z"/>',hidden:!0},"radio-signal":{body:'<path fill="currentColor" d="M19 2h2v2h-2zm2 14V4h2v12zm0 0v2h-2v-2zM1 4h2v12H1zm2 12h2v2H3zM3 4h2V2H3zm2 2h2v8H5zm2 8h2v2H7zm0-8h2V4H7zm10 0h2v8h-2zm0 0h-2V4h2zm0 8v2h-2v-2zm-6-7h4v6h-2v9h-2v-9H9V7zm0 4h2V9h-2z"/>',hidden:!0},"radio-tower":{body:'<path fill="currentColor" d="M22 2h-2v2h2v12h-2v2h2v-2h2V4h-2zM2 4H0v12h2v2h2v-2H2zm0 0V2h2v2zm4 2H4v8h2zm0 0V4h2v2zm4 0h4v2h-4zm0 6H8V8h2zm4 0h-4v2H8v4H6v4h2v-4h2v-4h4v4h2v4h2v-4h-2v-4h-2zm0 0h2V8h-2zm6-6h-2V4h-2v2h2v8h2z"/>',hidden:!0},radius:{body:'<path fill="currentColor" d="M2 6h2v12H2zm4 14h8v2H6zM20 6h2v8h-2zM6 2h12v2H6zM4 4h2v2H4zm0 14h2v2H4zM18 4h2v2h-2zm-8 6h2v2h-2zm2 2h2v2h-2zm2 2h2v2h-2zm2 6h6v2h-6zm0-4h6v2h-6zm0 2h2v2h-2zm4 0h2v2h-2z"/>'},ratio:{body:'<g fill="currentColor"><path d="M4 6h16v2H4z"/><path d="M6 20V4h2v16zM2 8h2v8H2zm6 14v-2h8v2z"/><path d="M4 16h16v2H4z"/><path d="M16 20V4h2v16zm4-12h2v8h-2zM8 4V2h8v2z"/></g>'},react:{body:'<path fill="currentColor" d="M8 22H4v-2h4zm12 0h-4v-2h4zM4 20H2v-4h2zm6 0H8v-2h2zm6 0h-2v-2h2zm6 0h-2v-4h2zm-8-2h-4v-2h4zm-8-2H4v-2h2zm4 0H8v-2h2zm6 0h-2v-2h2zm4 0h-2v-2h2zM4 14H2v-4h2zm4 0H6v-4h2zm6 0h-4v-4h4zm4 0h-2v-4h2zm4 0h-2v-4h2zM6 10H4V8h2zm4 0H8V8h2zm6 0h-2V8h2zm4 0h-2V8h2zM4 8H2V4h2zm10 0h-4V6h4zm8 0h-2V4h2zM10 6H8V4h2zm6 0h-2V4h2zM8 4H4V2h4zm12 0h-4V2h4z"/>'},"react-solid":{body:'<path fill="currentColor" d="M8 22H4v-2h4zm12 0h-4v-2h4zM4 20H2v-4h2zm6 0H8v-2h2zm6 0h-2v-2h2zm6 0h-2v-4h2zM10 10v4h4v-4zm-4 6H4v-2h2zm14 0h-2v-2h2zM4 14H2v-4h2zm18 0h-2v-4h2zM6 10H4V8h2zm14 0h-2V8h2zM4 8H2V4h2zm18 0h-2V4h2zM10 6H8V4h2zm6 0h-2V4h2zM8 4H4V2h4zm12 0h-4V2h4zm-2 6v4h-2v2h-2v2h-4v-2H8v-2H6v-4h2V8h2V6h4v2h2v2z"/>'},receipt:{body:'<path fill="currentColor" d="M3 2h2v18H3zm16 0h2v18h-2zM5 4h2v2H5zm4 0h2v2H9zM5 20h14v2H5zm8-16h2v2h-2zM7 2h2v2H7zm4 0h2v2h-2zm4 0h2v2h-2zm2 2h2v2h-2zM7 8h10v2H7zm0 4h10v2H7zm0 4h4v2H7z"/>'},"receipt-sharp":{body:'<path fill="currentColor" d="M3 2h2v18H3zm16 0h2v18h-2zM5 4h2v2H5zm4 0h2v2H9zM3 20h18v2H3zM13 4h2v2h-2zM7 2h2v2H7zm4 0h2v2h-2zm4 0h2v2h-2zm2 2h2v2h-2zM7 8h10v2H7zm0 4h10v2H7zm0 4h4v2H7z"/>'},reciept:{body:'<path fill="currentColor" d="M3 2h2v2h2v2H5v14h14V6h-2V4h2V2h2v20H3zm12 2V2h2v2zm-2 0h2v2h-2zm-2 0V2h2v2zM9 4h2v2H9zm0 0V2H7v2zm8 4H7v2h10zM7 12h10v2H7zm10 6v-2h-4v2z"/>',hidden:!0},"reciept-alt":{body:'<path fill="currentColor" d="M5 2H3v20h2v-2h2v2h2v-2h2v2h2v-2h2v2h2v-2h2v2h2V2h-2v2h-2V2h-2v2h-2V2h-2v2H9V2H7v2H5zm2 2h2v2h2V4h2v2h2V4h2v2h2v12h-2v2h-2v-2h-2v2h-2v-2H9v2H7v-2H5V6h2zm0 4h10v2H7zm10 4H7v2h10z"/>',hidden:!0},recycle:{body:'<g fill="currentColor"><path d="M10 17h2v2h-2zm2-2h2v6h-2zm2-2h2v10h-2zm2 4h4v2h-4zm4-3h2v3h-2zm-2-2h2v2h-2zM4 8h6v2H4zm4 2h2v4H8zm-2 0h2v2H6zm-2 2h2v2H4zm-2 2h2v3H2zm2 3h4v2H4zm9-9h6v2h-6z"/><path d="M17 4h2v6h-2zm-2 2h2v2h-2zm-2-3h2v3h-2zM8 3h2v3H8zm2-2h3v2h-3z"/></g>'},redo:{body:'<g fill="currentColor"><path d="M20 8H6v2h14zM4 10h2v8H4zm2 8h6v2H6z"/><path d="M18 6h-2v6h2zm-2-2h-2v8h2zm0 8h-2v2h2z"/></g>'},"redo-sharp":{body:'<g fill="currentColor"><path d="M20 8H6v2h14zM4 8h2v12H4zm2 10h6v2H6z"/><path d="M18 6h-2v6h2zm-2-2h-2v8h2zm0 8h-2v2h2z"/></g>'},refresh:{body:'<path fill="currentColor" d="M13 20H9v-2h4zm6-4h2v2h-2v2h-2v-2h-2v-2h2V8h2zM9 18H7v-2h2zM7 6h2v2H7v8H5V8H3V6h2V4h2zm8 10h-2v-2h2zm8 0h-2v-2h2zM3 10H1V8h2zm8 0H9V8h2zm6-2h-2V6h2zm-2-2h-4V4h4z"/>'},"refresh-glyph":{body:'<path fill="currentColor" d="M19 14h4v2h-2v2h-2v2h-2v-2h-2v-2h-2v-2h4V8h-4V6h6zM7 6h2v2h2v2H7v6h4v2H5v-8H1V8h2V6h2V4h2z"/>'},"refresh-sharp":{body:'<path fill="currentColor" d="M19 16h2v2h-2v2h-2v-2h-2v-2h2V8h-4V6h6zM7 6h2v2H7v8h4v2H5V8H3V6h2V4h2zm8 10h-2v-2h2zm8 0h-2v-2h2zM3 10H1V8h2zm8 0H9V8h2z"/>'},"refresh-solid":{body:'<path fill="currentColor" d="M13 20H9v-2h4zm6-6h4v2h-2v2h-2v2h-2v-2h-2v-2h-2v-2h4V8h2zM9 18H7v-2h2zM7 6h2v2h2v2H7v6H5v-6H1V8h2V6h2V4h2zm10 2h-2V6h2zm-2-2h-4V4h4z"/>'},reload:{body:'<g fill="currentColor"><path d="M16 4h2v6h-2zm-2-2h2v2h-2zm0 2h2v8h-2zM4 8H2v5h2z"/><path d="M4 6h16v2H4zm4 14H6v-6h2zm2 2H8v-2h2zm0-2H8v-8h2zm10-4h2v-5h-2z"/><path d="M20 18H4v-2h16z"/></g>'},"reload-sharp":{body:'<g fill="currentColor"><path d="M16 4h2v6h-2zm-2-2h2v2h-2zm0 2h2v8h-2zM4 8H2v5h2z"/><path d="M2 6h18v2H2zm6 14H6v-6h2zm2 2H8v-2h2zm0-2H8v-8h2zm10-4h2v-5h-2z"/><path d="M22 18H4v-2h18z"/></g>'},"remove-box":{body:'<path fill="currentColor" d="M5 3H3v18h18V3zm14 2v14H5V5zm-3 6H8v2h8z"/>',hidden:!0},"remove-box-multiple":{body:'<path fill="currentColor" d="M5 3H3v14h14V3zm10 2v10H5V5zm4 2v12H7v2h14V7zm-6 2H7v2h6z"/>',hidden:!0},repeat:{body:'<g fill="currentColor"><path d="M17 5h2v2h-2zM5 17h2v2H5zm6-14h2v6h-2zM9 1h2v8H9zm0 8h2v2H9zm10 8H9v2h10zM5 7H3v10h2z"/><path d="M13 15h-2v6h2zm2-2h-2v8h2zm0 8h-2v2h2zM5 5h10v2H5zm14 12h2V7h-2z"/></g>'},"repeat-1":{body:'<path fill="currentColor" d="M19 19h-4v4h-2v-2h-2v-2H9v-2h10zM7 19H5v-2h2zm-2-2H3V7h2zm16 0h-2V7h2zm-8-8v4h2v2H9v-2h2v-2H9V9zm-2-6h2v2h2v2H5V5h4V1h2zm8 4h-2V5h2z"/>'},"repeat-1-sharp":{body:'<path fill="currentColor" d="M21 19h-6v4h-2v-2h-2v-2H9v-2h10V7h-2V5h4zM11 3h2v2h2v2H5v10h2v2H3V5h6V1h2zm2 6v4h2v2H9v-2h2v-2H9V9z"/>'},"repeat-sharp":{body:'<g fill="currentColor"><path d="M17 5h2v2h-2zM5 17h2v2H5zm6-14h2v6h-2zM9 1h2v8H9zm0 8h2v2H9zm10 8H9v2h10zM5 5H3v14h2z"/><path d="M13 15h-2v6h2zm2-2h-2v8h2zm0 8h-2v2h2zM5 5h10v2H5zm14 14h2V5h-2z"/></g>'},reply:{body:'<path fill="currentColor" d="M12 19h-2v-2H8v-2H6v-2H4v-2h2V9h2V7h2V5h2v4h8v6h-8z"/>',hidden:!0},"reply-all":{body:'<path fill="currentColor" d="M13 19h2v-4h7V9h-7V5h-2v2h-2v2H9v2H7v2h2v2h2v2h2zM8 7H6v2H4v2H2v2h2v2h2v2h2v2h2v-2H8v-2H6v-2H4v-2h2V9h2zm0 0h2V5H8z"/>',hidden:!0},"road-sign":{body:'<g fill="currentColor"><path d="M2 10h2v2H2zm0 4h2v-2H2zm20-4h-2v2h2zm0 4h-2v-2h2zM4 8h2v2H4zm0 8h2v-2H4zm16-8h-2v2h2zm0 8h-2v-2h2zM6 6h2v2H6zm0 12h2v-2H6zM18 6h-2v2h2zm0 12h-2v-2h2zM8 4h2v2H8zm0 16h2v-2H8zm8-16h-2v2h2zm0 16h-2v-2h2zM10 2h2v2h-2zm0 20h2v-2h-2zm4-20h-2v2h2zm0 20h-2v-2h2zm2-11h2v2h-2zm-2-2h2v6h-2zm-2-2h2v10h-2zm-4 4h2v4H8z"/><path d="M10 11h3v2h-3z"/></g>'},robot:{body:'<path fill="currentColor" d="M5 7h14v2H5zm0 12h14v2H5zM3 9h2v10H3zm16 0h2v10h-2zM1 13h2v2H1zm20 0h2v2h-2zM11 5h2v2h-2zM7 3h4v2H7zm1 9h2v4H8zm6 0h2v4h-2z"/>'},"robot-face":{body:'<g fill="currentColor"><path d="M4 6h16v2H4zm0 14h16v2H4zM2 8h2v12H2zm18 0h2v12h-2z"/><path d="M11 4h2v4h-2zm-3 6h2v2H8zm6 0h4v2h-4zm-1-8h4v2h-4zM0 12h2v2H0zm22 0h2v2h-2zm-12 4h4v2h-4zm-2-2h2v2H8zm6 0h2v2h-2z"/></g>'},"robot-face-happy":{body:'<g fill="currentColor"><path d="M4 6h16v2H4zm0 14h16v2H4zM2 8h2v12H2zm18 0h2v12h-2z"/><path d="M11 4h2v4h-2zm-3 6h2v2H8zm6 0h2v2h-2zm-1-8h4v2h-4zM0 12h2v2H0zm22 0h2v2h-2zM7 14h10v2H7zm2 2h6v2H9z"/></g>'},"robot-face-happy-sharp":{body:'<path fill="currentColor" d="M2 6h20v2H2zm0 14h20v2H2zM2 8h2v12H2zm18 0h2v12h-2zm-9-6h2v4h-2zm-3 8h2v2H8zm6 0h2v2h-2zm-1-8h4v2h-4zM0 12h2v2H0zm22 0h2v2h-2zM7 14h10v2H7zm2 2h6v2H9z"/>'},"robot-face-sad":{body:'<g fill="currentColor"><path d="M4 6h16v2H4zm0 14h16v2H4zM2 8h2v12H2zm18 0h2v12h-2z"/><path d="M11 4h2v4h-2zM8 18h2v-2H8zm6 0h2v-2h-2zm-4-2h4v-2h-4zm-2-6h2v2H8zm6 0h2v2h-2zm-1-8h4v2h-4zM0 12h2v2H0zm22 0h2v2h-2z"/></g>'},"robot-face-sad-sharp":{body:'<path fill="currentColor" d="M2 6h20v2H2zm0 14h20v2H2zM2 8h2v12H2zm18 0h2v12h-2zm-9-6h2v4h-2zM8 18h2v-2H8zm6 0h2v-2h-2zm-4-2h4v-2h-4zm-2-6h2v2H8zm6 0h2v2h-2zm-1-8h4v2h-4zM0 12h2v2H0zm22 0h2v2h-2z"/>'},"robot-face-sharp":{body:'<path fill="currentColor" d="M2 6h20v2H2zm0 14h20v2H2zM2 8h2v12H2zm18 0h2v12h-2zm-9-6h2v4h-2zm-3 8h2v2H8zm6 0h4v2h-4zm-1-8h4v2h-4zM0 12h2v2H0zm22 0h2v2h-2zm-12 4h4v2h-4zm-2-2h2v2H8zm6 0h2v2h-2z"/>'},"robot-sharp":{body:'<path fill="currentColor" d="M3 7h18v2H3zm0 12h18v2H3zM3 9h2v10H3zm16 0h2v10h-2zM1 13h2v2H1zm20 0h2v2h-2zM11 5h2v2h-2zM7 3h4v2H7zm1 9h2v4H8zm6 0h2v4h-2z"/>'},"rounded-corner":{body:'<path fill="currentColor" d="M3 3h2v2H3zm0 4h2v2H3zm2 4H3v2h2zm-2 4h2v2H3zm2 4H3v2h2zm2 0h2v2H7zm6 0h-2v2h2zm2 0h2v2h-2zm6 0h-2v2h2zm-2-4h2v2h-2zM17 5h-2V3h-4v2h4v2h2v2h2v4h2V9h-2V7h-2zM7 3h2v2H7z"/>',hidden:!0},rss:{body:'<path fill="currentColor" d="M4 10h6v2H4zm8 4h2v6h-2zm6 0h2v6h-2zM4 16h4v4H4zm12-6h2v4h-2zm-2-2h2v2h-2zM4 4h6v2H4zm6 2h4v2h-4zm0 6h2v2h-2z"/>'},"rss-circle":{body:'<path fill="currentColor" d="M6 2h12v2H6zm0 18h12v2H6zM20 6h2v12h-2zM2 6h2v12H2zm5 9h2v2H7zm0-4h4v2H7zm0-4h6v2H7zm4 6h2v4h-2zm4-2h2v6h-2zm-2-2h2v2h-2zm-9 9h2v2H4zM4 4h2v2H4zm14 0h2v2h-2zm0 14h2v2h-2z"/>'},"rss-square":{body:'<path fill="currentColor" d="M4 2h16v2H4zm0 18h16v2H4zM20 4h2v16h-2zM2 4h2v16H2zm5 11h2v2H7zm0-4h4v2H7zm0-4h6v2H7zm4 6h2v4h-2zm4-2h2v6h-2zm-2-2h2v2h-2z"/>'},"rss-square-sharp":{body:'<path fill="currentColor" d="M2 2h20v2H2zm0 18h20v2H2zM20 4h2v16h-2zM2 4h2v16H2zm5 11h2v2H7zm0-4h4v2H7zm0-4h6v2H7zm4 6h2v4h-2zm4-2h2v6h-2zm-2-2h2v2h-2z"/>'},rubel:{body:'<path fill="currentColor" d="M17 6H9v5h8v2H9v2h6v2H9v3H7v-3H5v-2h2v-2H5v-2h2V4h10zm2 5h-2V6h2z"/>'},save:{body:'<path fill="currentColor" d="M20 22H4v-2h2v-6h2v6h8v-6h2v6h2zM4 20H2V4h2zm18 0h-2V6h2zm-6-6H8v-2h8zm-4-4H6V6h6zm8-4h-2V4h2zm-2-2H4V2h14z"/>'},"save-sharp":{body:'<path fill="currentColor" d="M16 20v-6H8v6zm-4-10H6V6h6zm8-4h-2V4h2zm0 14V6h2v16H2V2h16v2H4v16h2v-8h12v8z"/>'},scale:{body:'<g fill="currentColor"><path d="M13 9h2v2h-2zm2-2h2v2h-2zm2-2h2v2h-2zm2-2h2v8h-2z"/><path d="M13 3h8v2h-8zm-2 12H9v-2h2zm-2 2H7v-2h2zm-2 2H5v-2h2zm-2 2H3v-8h2z"/><path d="M11 21H3v-2h8z"/></g>'},"scan-barcode":{body:'<path fill="currentColor" d="M16 2h4v2h-4zm4 2h2v4h-2zm0 12h2v4h-2zm-4 4h4v2h-4zM4 20h4v2H4zm-2-4h2v4H2zM2 4h2v4H2zm2-2h4v2H4zm3 6h2v8H7zm4 0h2v8h-2zm5 0h2v8h-2z"/>'},"scan-barcode-sharp":{body:'<path fill="currentColor" d="M16 2h6v2h-6zm4 2h2v4h-2zm0 12h2v4h-2zm-4 4h6v2h-6zM2 20h6v2H2zm0-4h2v4H2zM2 4h2v4H2zm0-2h6v2H2zm5 6h2v8H7zm4 0h2v8h-2zm5 0h2v8h-2z"/>'},scissors:{body:'<path fill="currentColor" d="M5 2h4v2H5zm0 12h4v2H5zm0-6h4v2H5zm0 12h4v2H5zM3 4h2v4H3zm0 12h2v4H3zM9 4h2v4H9zm0 12h2v4H9zm0-8h2v2H9zm2 2h2v2h-2zm-2 4h2v2H9zm2-2h2v2h-2zm2-2h2v2h-2zm2 4h2v2h-2zm2 2h2v2h-2zm2 2h2v2h-2zM15 8h2v2h-2zm2-2h2v2h-2zm2-2h2v2h-2z"/>'},"scissors-sharp":{body:'<path fill="currentColor" d="M5 2h6v2H5zm0 12h4v2H5zm0-6h4v2H5zm0 12h6v2H5zM3 2h2v8H3zm0 12h2v8H3zM9 4h2v4H9zm0 12h2v4H9zm0-8h2v2H9zm2 2h2v2h-2zm-2 4h2v2H9zm2-2h2v2h-2zm2-2h2v2h-2zm2 4h2v2h-2zm2 2h2v2h-2zm2 2h2v2h-2zM15 8h2v2h-2zm2-2h2v2h-2zm2-2h2v2h-2z"/>'},script:{body:'<path fill="currentColor" d="M16 19h2v2H4v-2h10v-2h2zM6 15h8v2H4v2H2v-4h2V5h2zM20 5h2v6h-2v8h-2V5H6V3h14z"/>'},"script-sharp":{body:'<path fill="currentColor" d="M2 17h2v4H2zM18 5h2v16h-2zM4 3h2v12H4zm10 12h2v4h-2zM4 19h14v2H4zm-2-4h12v2H2zM6 3h14v2H6zm14 2h2v6h-2z"/>'},"script-text":{body:'<path fill="currentColor" d="M6 3h14v2h2v6h-2v8h-2V5H6zm8 14v-2H6V5H4v10H2v4h2v2h14v-2h-2v-2zm0 0v2H4v-2zM8 7h8v2H8zm8 4H8v2h8z"/>',hidden:!0},"scroll-horizontal":{body:'<g fill="currentColor"><path d="M8 3v2H4V3zm0 16v2H4v-2zm6-16v2h-4V3zm0 16v2h-4v-2zm6-16v2h-4V3zm0 16v2h-4v-2zM18 9v6h2V9z"/><path d="M2 11v2h20v-2z"/><path d="M16 7v10h2V7zM6 9v6H4V9zm2-2v10H6V7z"/></g>'},"scroll-vertical":{body:'<g fill="currentColor"><path d="M21 8h-2V4h2zM5 8H3V4h2zm16 6h-2v-4h2zM5 14H3v-4h2zm16 6h-2v-4h2zM5 20H3v-4h2zm10-2H9v2h6z"/><path d="M13 2h-2v20h2z"/><path d="M17 16H7v2h10zM15 6H9V4h6zm2 2H7V6h10z"/></g>'},sd:{body:'<path fill="currentColor" d="M18 2h2v20H4V6h2v14h12V4H8V2zM8 4H6v2h2zm6 2h2v4h-2zm-2 0h-2v4h2z"/>',hidden:!0},search:{body:'<path fill="currentColor" d="M22 22h-2v-2h2zm-2-2h-2v-2h2zm-6-2H6v-2h8zm4 0h-2v-2h2zM6 16H4v-2h2zm10 0h-2v-2h2zM4 14H2V6h2zm14 0h-2V6h2zM6 6H4V4h2zm10 0h-2V4h2zm-2-2H6V2h8z"/>'},section:{body:'<path fill="currentColor" d="M5 21H3v-2h2zm4 0H7v-2h2zm4 0h-2v-2h2zm4 0h-2v-2h2zm4 0h-2v-2h2zM5 17H3v-2h2zm16 0h-2v-2h2zM5 13H3v-2h2zm16 0h-2v-2h2zM5 9H3V7h2zm16 0h-2V7h2zM5 5H3V3h2zm4 0H7V3h2zm4 0h-2V3h2zm4 0h-2V3h2zm4 0h-2V3h2z"/>'},"section-copy":{body:'<path fill="currentColor" d="M9 21H7v-2h2zm4 0h-2v-2h2zm4 0h-2v-2h2zm4 0h-2v-2h2zM5 17H3v-2h2zm4 0H7v-2h2zm12 0h-2v-2h2zM5 13H3v-2h2zm4 0H7v-2h2zm12 0h-2v-2h2zM5 9H3V7h2zm4 0H7V7h2zm4 0h-2V7h2zm4 0h-2V7h2zm4 0h-2V7h2zM5 5H3V3h2zm4 0H7V3h2zm4 0h-2V3h2zm4 0h-2V3h2z"/>'},"section-minus":{body:'<path fill="currentColor" d="M5 21H3v-2h2zm4 0H7v-2h2zm4 0h-2v-2h2zm8-2h-6v-2h6zM5 17H3v-2h2zm0-4H3v-2h2zm16 0h-2v-2h2zM5 9H3V7h2zm16 0h-2V7h2zM5 5H3V3h2zm4 0H7V3h2zm4 0h-2V3h2zm4 0h-2V3h2zm4 0h-2V3h2z"/>'},"section-plus":{body:'<path fill="currentColor" d="M5 21H3v-2h2zm4 0H7v-2h2zm4 0h-2v-2h2zm6-4h2v2h-2v2h-2v-2h-2v-2h2v-2h2zM5 17H3v-2h2zm0-4H3v-2h2zm16 0h-2v-2h2zM5 9H3V7h2zm16 0h-2V7h2zM5 5H3V3h2zm4 0H7V3h2zm4 0h-2V3h2zm4 0h-2V3h2zm4 0h-2V3h2z"/>'},"section-x":{body:'<path fill="currentColor" d="M5 21H3v-2h2zm4 0H7v-2h2zm4 0h-2v-2h2zm4 0h-2v-2h2zm4 0h-2v-2h2zm-2-2h-2v-2h2zM5 17H3v-2h2zm12 0h-2v-2h2zm4 0h-2v-2h2zM5 13H3v-2h2zm16 0h-2v-2h2zM5 9H3V7h2zm16 0h-2V7h2zM5 5H3V3h2zm4 0H7V3h2zm4 0h-2V3h2zm4 0h-2V3h2zm4 0h-2V3h2z"/>'},send:{body:'<path fill="currentColor" d="M4 19h4v2H2v-8h2zm8 0H8v-2h4zm4-2h-4v-2h4zm4-2h-4v-2h4zm-10-2H4v-2h6zm12 0h-2v-2h2zM8 5H4v6H2V3h6zm12 6h-4V9h4zm-4-2h-4V7h4zm-4-2H8V5h4z"/>'},server:{body:'<path fill="currentColor" d="M6 7h4v2H6zm0 8h4v2H6zM2 5h2v14H2zm18 0h2v14h-2zM4 19h16v2H4zM4 3h16v2H4zm0 8h16v2H4z"/>'},"server-sharp":{body:'<g fill="currentColor"><path d="M6 7h4v2H6zm0 8h4v2H6zM2 5h2v14H2zm18 0h2v14h-2zM2 19h20v2H2zM2 3h20v2H2z"/><path d="M2 11h20v2H2z"/></g>'},"settings-2":{body:'<g fill="currentColor"><path d="M4 14h2v6H4zm6 0h2v6h-2zm-4-2h4v2H6zm0 8h4v2H6zm-4-4h2v2H2zm20-8h-4V6h4z"/><path d="M10 16h12v2H10zm4-8H2V6h12zm6-4v2h-2V4zm0 6V8h-2v2zm-6-8h4v2h-4zm0 10h4v-2h-4zm-2-8h2v2h-2zm0 6h2V8h-2z"/></g>'},"settings-2-sharp":{body:'<g fill="currentColor"><path d="M4 14h2v6H4zm5 0h2v6H9zm-5-2h7v2H4zm0 8h7v2H4zm-2-4h2v2H2zm20-8h-4V6h4z"/><path d="M10 16h12v2H10zm5-8H2V6h13zm5-4v2h-2V4zm0 6V8h-2v2zm-7-8h7v2h-7zm0 10h7v-2h-7zm0-8h2v2h-2zm0 6h2V8h-2z"/></g>'},"settings-cog":{body:'<path fill="currentColor" d="M4 20h3v-2h4v4h2v-4h4v2h-2v4H9v-4H7v2H2v-5h2zm18 2h-5v-2h3v-3h2zM6 11H2v2h4v4H4v-2H0V9h4V7h2zm14-2h4v6h-4v2h-2v-4h4v-2h-4V7h2zm-6 7h-4v-2h4zm-4-2H8v-4h2zm6 0h-2v-4h2zm-2-4h-4V8h4zM7 4H4v3H2V2h5zm8 0h2V2h5v5h-2V4h-3v2h-4V2h-2v4H7V4h2V0h6z"/>'},"settings-cog-2":{body:'<g fill="currentColor"><path d="M18 2h2v2h-2zM4 2h2v2H4zm16 20h-2v-2h2zM4 22h2v-2H4zM20 4h2v2h-2zM6 4h4v2H6zm12 16h-4v-2h4zM6 20h4v-2H6zM18 6h2v4h-2zM4 6h2v4H4zm16 12h-2v-4h2zM4 18h2v-4H4zM14 4h4v2h-4zM2 4h2v2H2zm20 16h-2v-2h2zM2 20h2v-2H2z"/><path d="M8 2h2v4H8zm0 20h2v-4H8z"/><path d="M8 2h8v2H8zm0 20h8v-2H8zM2 8h2v8H2zm20 8h-2V8h2z"/><path d="M20 8h2v4h-2zM10 8h4v2h-4zm-2 2h2v4H8zm2 4h4v2h-4zm4-4h2v4h-2z"/></g>'},shapes:{body:'<path fill="currentColor" d="M2 13h9v2H2zm0 2h2v5H2zm0 5h9v2H2zm7-5h2v5H9zm6-2h5v2h-5zm-2 2h2v5h-2zm2 5h5v2h-5zm5-5h2v5h-2zM7 9h10v2H7zm0-2h2v2H7zm2-3h2v3H9zm2-2h2v2h-2zm2 2h2v3h-2zm2 3h2v2h-2z"/>'},share:{body:'<path fill="currentColor" d="M20 22H4v-2h16zM4 20H2v-6h2zm18 0h-2v-6h2zM13 4h2v2h2v2h-4v10h-2V8H7V6h2V4h2V2h2zM9 14H4v-2h5zm11 0h-5v-2h5z"/>'},"share-sharp":{body:'<path fill="currentColor" d="M9 14H4v6h16v-6h-5v-2h7v10H2V12h7zm4-10h2v2h2v2h-4v10h-2V8H7V6h2V4h2V2h2z"/>'},"sharp-corner":{body:'<path fill="currentColor" d="M3 3h2v2H3zm0 4h2v2H3zm2 4H3v2h2zm-2 4h2v2H3zm2 4H3v2h2zm2 0h2v2H7zm6 0h-2v2h2zm2 0h2v2h-2zm6 0h-2v2h2zm-2-4h2v2h-2zm2-2V3H11v2h8v8zM7 3h2v2H7z"/>',hidden:!0},shield:{body:'<path fill="currentColor" d="M4 2h16v2H4zM2 4h2v10H2zm18 0h2v10h-2zM4 14h2v2H4zm2 2h2v2H6zm4 4h4v2h-4zm10-6h-2v2h2zm-2 2h-2v2h2zm-2 2h-2v2h2zm-6 0H8v2h2z"/>'},"shield-off":{body:'<path fill="currentColor" d="M8 2h14v12h-2V4H8zM2 8h2v6H2zm2 6h2v2H4zm4 2H6v2h2v2h2v2h4v-2h-4v-2H8zm10 0h-2v2h2v2h2v2h2v-2h-2v-2h-2zM4 2H2v2h2v2h2v2h2v2h2v2h2v2h2v2h2v-2h-2v-2h-2v-2h-2V8H8V6H6V4H4z"/>',hidden:!0},"shield-sharp":{body:'<path fill="currentColor" d="M2 2h20v2H2zm0 2h2v10H2zm18 0h2v10h-2zM4 14h2v2H4zm2 2h2v2H6zm4 4h4v2h-4zm10-6h-2v2h2zm-2 2h-2v2h2zm-2 2h-2v2h2zm-6 0H8v2h2z"/>'},ship:{body:'<g fill="currentColor"><path d="M14 8h2v2h-2zm4 8h2v2h-2zM8 4h2v4H8z"/><path d="M6 6h8v2H6zm-4 4h20v2H2zm18 2h2v4h-2zM2 12h2v6H2zm4-4h2v2H6z"/><path d="M0 16h4v2H0zm4 2h4v2H4zm4-2h4v2H8zm4 2h4v2h-4zm4-2h4v2h-4zm4 2h4v2h-4z"/></g>'},shirt:{body:'<g fill="currentColor"><path d="M4 3h6v2H4zM2 3h2v8H2zm2 6h4v2H4z"/><path d="M6 9h2v10H6zm2 10h8v2H8zm8-10h2v10h-2z"/><path d="M16 9h4v2h-4zm4-6h2v8h-2zm-6 0h6v2h-6zm-4 2h4v2h-4z"/></g>'},"shirt-sharp":{body:'<g fill="currentColor"><path d="M4 3h6v2H4zM2 3h2v8H2zm2 6h4v2H4z"/><path d="M6 9h2v10H6zm0 10h12v2H6zM16 9h2v10h-2z"/><path d="M16 9h4v2h-4zm4-6h2v8h-2zm-6 0h6v2h-6zM8 5h8v2H8z"/></g>'},"shopping-bag":{body:'<g fill="currentColor"><path d="M3 6h18v2H3zm2 14h14v2H5zM3 8h2v12H3zm16 0h2v12h-2z"/><path d="M7 4h2v6H7zm2-2h6v2H9zm6 2h2v6h-2z"/></g>'},"shopping-bag-sharp":{body:'<g fill="currentColor"><path d="M3 6h18v2H3zm2 14h14v2H5zM3 8h2v12H3zm16 0h2v12h-2z"/><path d="M7 4h2v6H7zm2-2h6v2H9zm6 2h2v6h-2z"/></g>'},"shopping-cart":{body:'<path fill="currentColor" d="M2 2h2v2H2zm2 6h2v4H4zm2 4h2v4H6zm2 4h10v2H8zm10-4h2v4h-2zm2-4h2v4h-2zM4 6h18v2H4zm0-4h2v4H4zm2 17h3v3H6zm11 0h3v3h-3z"/>'},shuffle:{body:'<path fill="currentColor" d="M10 19H2v-2h8zm12 0h-8v-2h8zm-10-2h-2v-6h2zm6-10h2v2h2v2h-2v2h-2v2h-2v-4h-4V9h4V5h2zM8 11H2V9h6z"/>'},"shuffle-sharp":{body:'<path fill="currentColor" d="M18 7h2v2h2v2h-2v2h-2v2h-2v-4h-4v8H2v-2h8V9h6V5h2zm4 12h-8v-2h8zM8 11H2V9h6z"/>'},signal:{body:'<path fill="currentColor" d="M19 3h2v18h-2zm-4 4h2v14h-2zm-4 4h2v10h-2zm-4 4h2v6H7zm-4 4h2v2H3z"/>'},siren:{body:'<path fill="currentColor" d="M6 11h2v5H6zm2-2h2v2H8zm2-2h4v2h-4zm4 2h2v2h-2zm2 2h2v5h-2zM6 16h12v2H6zm-2 4h16v2H4zm0-2h2v2H4zm14 0h2v2h-2zm-7-6h2v4h-2zm9-1h3v2h-3zM1 11h3v2H1zm5-6h2v2H6zm10 0h2v2h-2zm2-2h2v2h-2zM4 3h2v2H4zm7-1h2v3h-2z"/>'},"siren-off":{body:'<path fill="currentColor" d="M6 11h2v5H6zm2-2h2v2H8zm2-2h4v2h-4zm4 2h2v2h-2zm2 2h2v5h-2zM6 16h12v2H6zm-2 4h16v2H4zm0-2h2v2H4zm14 0h2v2h-2zm-7-6h2v4h-2z"/>'},"siren-off-sharp":{body:'<path fill="currentColor" d="M6 11h2v5H6zm2-2h2v2H8zm2-2h4v2h-4zm4 2h2v2h-2zm2 2h2v5h-2zM6 16h12v2H6zm-2 4h16v2H4zm0-4h2v4H4zm14 0h2v4h-2zm-7-4h2v4h-2z"/>'},"siren-sharp":{body:'<path fill="currentColor" d="M6 11h2v5H6zm2-2h2v2H8zm2-2h4v2h-4zm4 2h2v2h-2zm2 2h2v5h-2zM6 16h12v2H6zm-2 4h16v2H4zm0-4h2v4H4zm14 0h2v4h-2zm-7-4h2v4h-2zm9-1h3v2h-3zM1 11h3v2H1zm5-6h2v2H6zm10 0h2v2h-2zm2-2h2v2h-2zM4 3h2v2H4zm7-1h2v3h-2z"/>'},skull:{body:'<g fill="currentColor"><path d="M7 20h2v2H7zm4 0h2v2h-2zm4 0h2v2h-2zm-6-4h2v4H9zm4 0h2v4h-2zm-8-2h2v6H5zm12 0h2v6h-2z"/><path d="M3 14h4v2H3zM1 4h2v10H1zm20 0h2v10h-2zM3 2h18v2H3zm14 12h4v2h-4zM8 7h2v4H8zm6 0h2v4h-2z"/></g>'},"skull-sharp":{body:'<g fill="currentColor"><path d="M5 20h14v2H5zm4-4h2v4H9zm4 0h2v4h-2zm-8-2h2v6H5zm12 0h2v6h-2z"/><path d="M3 14h4v2H3zM1 2h2v14H1zm20 0h2v14h-2zM3 2h18v2H3zm14 12h4v2h-4zM8 7h2v4H8zm6 0h2v4h-2z"/></g>'},slack:{body:'<path fill="currentColor" d="M17 24h-2v-2h2zm-6-9h1v6h-1v2H8v-2H7v-6h1v-2h3zm6 5h-2v2h-2v-4h4zm2 2h-2v-2h2zM9 21h1v-6H9zm-5-2H2v-2h2zm-2-2H0v-2h2zm4 0H4v-2H2v-2h4zm15-4h2v3h-2v1h-6v-1h-2v-3h2v-1h6zm-6 2h6v-1h-6zM9 8h2v3H9v1H3v-1H1V8h2V7h6zm7-5h1v6h-1v2h-3V9h-1V3h1V1h3zm4 6h2v2h-4V7h2zM3 9v1h6V9zm11 0h1V3h-1zm10 0h-2V7h2zm-2-2h-2V5h2zM11 6H7V4h2V2h2zM7 4H5V2h2zm2-2H7V0h2z"/>'},"slack-solid":{body:'<path fill="currentColor" d="M17 20h2v2h-2v2h-2v-2h-2v-4h4zm-6-5h1v6h-1v2H8v-2H7v-6h1v-2h3zm-5 2H4v2H2v-2H0v-2h2v-2h4zm15-4h2v3h-2v1h-6v-1h-2v-3h2v-1h6zM9 8h2v3H9v1H3v-1H1V8h2V7h6zm7-5h1v6h-1v2h-3V9h-1V3h1V1h3zm6 4h2v2h-2v2h-4V7h2V5h2zM9 2h2v4H7V4H5V2h2V0h2z"/>'},sliders:{body:'<path fill="currentColor" d="M8 14H7v6H5v-6H2v-2h6zm5 6h-2V10h2zm9-2h-3v2h-2v-2h-1v-2h6zm-3-4h-2V4h2zM7 10H5V4h2zm6-4h2v2H9V6h2V4h2z"/>'},"sliders-2":{body:'<path fill="currentColor" d="M4 4h6v3h12v2H10v3H4V9H2V7h2zm2 2v4h2V6zm8 6h6v3h2v2h-2v3h-6v-3H2v-2h12zm2 2v4h2v-4z"/>',hidden:!0},"sliders-horizontal":{body:'<path fill="currentColor" d="M17 18h5v2h-5v2h-2v-6h2zm-4 2H2v-2h11zm-4-5H7v-2H2v-2h5V9h2zm13-2H11v-2h11zm-7-9h7v2h-7v2h-2V2h2zm-4 2H2V4h9z"/>'},"sliders-vertical":{body:'<path fill="currentColor" d="M8 15H6v7H4v-7H2v-2h6zm5 7h-2V11h2zm9-5h-2v5h-2v-5h-2v-2h6zm-2-4h-2V2h2zM6 11H4V2h2zm9-2H9V7h2V2h2v5h2z"/>'},"smart-home":{body:'<path fill="currentColor" d="M4 20h16v2H4zm16-10h2v10h-2zM2 10h2v10H2zm2-2h2v2H4zm2-2h2v2H6zm2-2h2v2H8zm2-2h4v2h-4zm4 2h2v2h-2zm2 2h2v2h-2zm2 2h2v2h-2zm-9 8h6v2H9zm-2-2h2v2H7zm8 0h2v2h-2z"/>'},"smart-home-sharp":{body:'<path fill="currentColor" d="M2 20h20v2H2zm18-10h2v10h-2zM2 10h2v10H2zm2-2h2v2H4zm2-2h2v2H6zm2-2h2v2H8zm2-2h4v2h-4zm4 2h2v2h-2zm2 2h2v2h-2zm2 2h2v2h-2zm-9 8h6v2H9zm-2-2h2v2H7zm8 0h2v2h-2z"/>'},smartphone:{body:'<path fill="currentColor" d="M6 2h12v2H6zm0 18h12v2H6zM4 4h2v16H4zm14 0h2v16h-2zm-7 13h2v2h-2z"/>'},"smartphone-sharp":{body:'<path fill="currentColor" d="M6 2h12v2H6zm0 18h12v2H6zM4 2h2v20H4zm14 0h2v20h-2zm-7 15h2v2h-2z"/>'},smile:{body:'<path fill="currentColor" d="M6 20h12v2H6zM6 2h12v2H6zm12 2h2v2h-2zM4 4h2v2H4zm0 14h2v2H4zm14 0h2v2h-2zM2 6h2v12H2zm18 0h2v12h-2zM7 13h2v2H7zm2 2h6v2H9zm6-2h2v2h-2zM8 8h2v2H8zm6 0h2v2h-2z"/>'},"smile-sharp":{body:'<path fill="currentColor" d="M4 20h16v2H4zM4 2h16v2H4zM2 2h2v20H2zm18 0h2v20h-2zM7 13h2v2H7zm2 2h6v2H9zm6-2h2v2h-2zM8 8h2v2H8zm6 0h2v2h-2z"/>'},snail:{body:'<path fill="currentColor" d="M20 22H6v-2h14zM6 20H4v-8h2zm14-4h2v4h-2v-2h-6v-2h4v-2h2zm-8 2h-2v-2h2zm-2-2H8V8H4V6h6zm4 0h-2V9h2zm8-2h-2V6h2zM4 12H2V8h2zm14 0h-2V9h2zm-2-3h-2V7h2zm-4-3h-2V4h2zm8 0h-2V4h2zM4 4H2V2h2zm4 0H6V2h2zm10 0h-6V2h6z"/>'},snake:{body:'<path fill="currentColor" d="M4 20h16v2H2v-4h2zM8 8h4v4h2V4h2v8h2v4h2V8h2v12h-2v-2H4v-4h2v2h10v-2H6v-2h4v-2H6V8H4V6h2V4h2zm-4 2H2V8h2zm0-4H2V4h2zm8 0h-2V4H8V2h6v2h-2z"/>'},snowflake:{body:'<path fill="currentColor" d="M13 24h-2v-2h2zm-2-2H9v-2H7v2H2v-5h2v3h3v-2h2v-2h2zm4-4h2v2h-2v2h-2v-6h2zm7 4h-5v-2h3v-3h2zM4 15H2v-2h6v2H6v2H4zm18 0h-2v2h-2v-2h-2v-2h6zM2 13H0v-2h2zm22 0h-2v-2h2zM6 9h2v2H2V9h2V7h2zm14 0h2v2h-6V9h2V7h2zm-9-1H9V6H7V4h2V2h2zm4-4h2V2h5v5h-2V4h-3v2h-2v2h-2V2h2zM7 4H4v3H2V2h5zm6-2h-2V0h2z"/>'},"snowflake-solid":{body:'<path fill="currentColor" d="M13 24h-2v-2h2zm-2-2H9v-2H7v2H2v-5h2v3h3v-2h2v-2h2zm4-4h2v2h-2v2h-2v-6h2zm7 4h-5v-2h3v-3h2zM8 15H6v2H4v-2H2v-2h6zm14 0h-2v2h-2v-2h-2v-2h6zm-8-1h-4v-4h4zM2 13H0v-2h2zm22 0h-2v-2h2zM6 9h2v2H2V9h2V7h2zm14 0h2v2h-6V9h2V7h2zm-9-1H9V6H7V4h2V2h2zm4-4h2V2h5v5h-2V4h-3v2h-2v2h-2V2h2zM7 4H4v3H2V2h5zm6-2h-2V0h2z"/>'},sofa:{body:'<path fill="currentColor" d="M5 3h14v2H5zM3 5h2v3H3zM1 8h6v2H1zm0 2h2v7H1zm2 7h18v2H3zm18-7h2v7h-2zm-4-2h6v2h-6zm0 2h2v2h-2zM7 12h10v2H7zm-2-2h2v2H5zm6-5h2v7h-2zm8 0h2v3h-2zm0 14h2v2h-2zM3 19h2v2H3z"/>'},"sofa-sharp":{body:'<path fill="currentColor" d="M3 3h18v2H3zm0 2h2v3H3zM1 8h6v2H1zm0 2h2v7H1zm0 7h22v2H1zm20-7h2v7h-2zm-4-2h6v2h-6zm0 2h2v2h-2zM5 12h14v2H5zm0-2h2v2H5zm6-5h2v7h-2zm8 0h2v3h-2zm0 14h2v2h-2zM3 19h2v2H3z"/>'},sort:{body:'<path fill="currentColor" d="M8 20H6V8H4V6h2V4h2v2h2v2H8zm2-12v2h2V8zM4 8v2H2V8zm14-4h-2v12h-2v-2h-2v2h2v2h2v2h2v-2h2v-2h2v-2h-2v2h-2z"/>',hidden:!0},"sort-alphabetic":{body:'<path fill="currentColor" d="M11 2h2v2h-2zm0 2v2H9V4zm2 0h2v2h-2zM9 18v2h2v2h2v-2h2v-2h-2v2h-2v-2zM8 8H2v8h2v-2h2v2h2zm-2 4H4v-2h2zm6-1v-1h2v1zm4-3h-6v8h6zm-4 6v-1h2v1zm10-6h-4v8h4v-2h-2v-4h2z"/>',hidden:!0},"sort-horizontal":{body:'<path fill="currentColor" d="M20 16v2H4v-2zm-10-2v2H6v-2zm0-2v2H8v-2zm0 6v2H6v-2zm0 2v2H8v-2zM4 6v2h16V6zm10-2v2h4V4zm0-2v2h2V2zm0 6v2h4V8zm0 2v2h2v-2z"/>'},"sort-numeric":{body:'<path fill="currentColor" d="M13 2h-2v2H9v2h2V4h2v2h2V4h-2zM2 8h4v8H4v-6H2zm6 0h6v5h-4v1h4v2H8v-5h4v-1H8zm12 0h-4v2h4v1h-4v2h4v1h-4v2h6V8zm-9 10v2H9v-2zm2 2h-2v2h2zm0 0v-2h2v2z"/>',hidden:!0},"sort-vertical":{body:'<path fill="currentColor" d="M16 4h2v16h-2zm-2 10h2v4h-2zm-2 0h2v2h-2zm6 0h2v4h-2zm2 0h2v2h-2zM6 20h2V4H6zM4 10h2V6H4zm-2 0h2V8H2zm6 0h2V6H8zm2 0h2V8h-2z"/>'},sparkle:{body:'<path fill="currentColor" d="M11 1h2v4h-2zm0 22h2v-4h-2zM9 5h2v4H9zm0 14h2v-4H9zm4-14h2v4h-2zm0 14h2v-4h-2zM5 9h4v2H5zm14 0h-4v2h4zM1 11h4v2H1zm22 0h-4v2h4zM5 13h4v2H5zm14 0h-4v2h4z"/>'},sparkles:{body:'<g fill="currentColor"><path d="M11 1h2v4h-2zm0 22h2v-4h-2zM9 5h2v4H9zm0 14h2v-4H9zm4-14h2v4h-2zm0 14h2v-4h-2zM5 9h4v2H5zm14 0h-4v2h4zM1 11h4v2H1zm22 0h-4v2h4zM5 13h4v2H5zm14 0h-4v2h4zm0-12h2v6h-2z"/><path d="M17 3h6v2h-6zM3 17h2v2H3zm-2 2h2v2H1zm2 2h2v2H3zm2-2h2v2H5z"/></g>'},speaker:{body:'<path fill="currentColor" d="M4 2H3v20h18V2zm15 2v16H5V4zm-6 2h-2v2h2zm-5 4h8v6h-2v-4h-4v4H8zm8 6H8v2h8z"/>',hidden:!0},"speed-fast":{body:'<path fill="currentColor" d="M5 19H3v-2h2zm16 0h-2v-2h2zM3 17H1v-6h2zm11 0h-4v-4h4zm9 0h-2v-6h2zm-7-4h-2v-2h2zM5 11H3V9h2zm13 0h-2V9h2zM9 9H5V7h4zm11 0h-2V7h2zm-5-2H9V5h6z"/>'},"speed-medium":{body:'<path fill="currentColor" d="M5 19H3v-2h2zm16 0h-2v-2h2zM3 17H1v-6h2zm11 0h-4v-4h1V5h2v8h1zm9 0h-2v-6h2zM5 11H3V9h2zm16 0h-2V9h2zM9 9H5V7h4zm10 0h-4V7h4z"/>'},"speed-slow":{body:'<path fill="currentColor" d="M5 19H3v-2h2zm16 0h-2v-2h2zM3 17H1v-6h2zm11 0h-4v-4h4zm9 0h-2v-6h2zm-13-4H8v-2h2zm-2-2H6V9h2zm13 0h-2V9h2zM6 7v2H4V7zm13 2h-4V7h4zm-4-2H9V5h6z"/>'},spinner:{body:'<path fill="currentColor" d="M13 22h-2v-7h2zm-8-1H3v-2h2zm16-2v2h-2v-2zM7 19H5v-2h2zm12 0h-2v-2h2zM9 17H7v-2h2zm8 0h-2v-2h2zm-8-4H2v-2h7zm13 0h-7v-2h7zM9 9H7V7h2zm4 0h-2V2h2zm4 0h-2V7h2zM7 7H5V5h2zm12 0h-2V5h2zM5 5H3V3h2zm16 0h-2V3h2z"/>'},"spline-cursor":{body:'<path fill="currentColor" d="M12 10h2v12h-2zm2 0h2v2h-2zm2 2h2v2h-2zm2 2h2v2h-2zm2 2h2v2h-2zm-6 4h2v2h-2zm2-2h6v2h-6zM4 15h3v2H4zM17 2h3v2h-3zM7 17h2v3H7zM20 4h2v3h-2zM2 17h2v3H2zM15 4h2v3h-2zM4 20h3v2H4zM17 7h3v2h-3zM4 8h2v5H4zm2-2h2v2H6zm2-2h5v2H8z"/>'},spotlight:{body:'<path fill="currentColor" d="M19 2H5v2h14zm0 18H5v2h14zM5 4H3v16h2zm16 0h-2v16h2zm-8 2H7v2h6zm-4 4H7v8h2zm8 0h-2v8h2zm-8 0h6v2H9zm0 6h6v2H9z"/>'},"spotlight-sharp":{body:'<path fill="currentColor" d="M21 2H3v2h18zm0 18H3v2h18zM5 4H3v16h2zm16 0h-2v16h2zm-8 2H7v2h6zm-4 4H7v8h2zm8 0h-2v8h2zm-8 0h6v2H9zm0 6h6v2H9z"/>'},spray:{body:'<path fill="currentColor" d="M4 9h6v2H4zm2-2h2v2H6zm-4 4h2v10H2zm2 8h6v2H4zm6-8h2v10h-2zm2-4h2v2h-2zm2-2h2v2h-2zm0 6h2V9h-2zm2-8h2v2h-2zm0 10h2v-2h-2zm2-12h2v2h-2zm0 14h2v-2h-2zm-2-8h2v2h-2zm2-2h2v2h-2zm0 4h2v2h-2z"/>'},"spray-can":{body:'<g fill="currentColor"><path d="M9 3h4v4H9zM7 7h8v2H7zM5 21h12v2H5zM15 9h2v12h-2zM5 9h2v12H5zm4 8h6v2H9z"/><path d="M9 13h2v6H9z"/><path d="M9 13h8v2H9zm6-10h2v2h-2zm2-2h2v2h-2zm0 4h2v2h-2z"/></g>'},"spray-image":{body:'<path fill="currentColor" d="M4 12h6v2H4zm2-2h2v2H6zm-4 4h2v6H2zm0 6h10v2H2zm8-6h2v6h-2zM4 2h16v2H4zM2 4h2v6H2zm18 0h2v16h-2zm-6 16h6v2h-6zm4-8h2v2h-2zm0 4h2v2h-2zm-6-6h2v2h-2zm2-2h2v2h-2zm0 8h2v2h-2zm2-6h2v2h-2zm0 4h2v2h-2zM8 6h2v2H8z"/>'},"spray-wave":{body:'<g fill="currentColor"><path d="M4 9h6v2H4zm2-2h2v2H6zm-4 4h2v10H2zm2 8h6v2H4zm6-8h2v10h-2z"/><path d="M6 15h6v2H6zm8-11h2v2h-2zm4-2h2v2h-2zm0 10h2v2h-2zm-2-6h2v4h-2zm4-2h2v8h-2zm-6 6h2v2h-2zm-3-3h2v2h-2z"/></g>'},square:{body:'<path fill="currentColor" d="M2 4h2v16H2zm2 16h16v2H4zM20 4h2v16h-2zM4 2h16v2H4z"/>'},"square-alert":{body:'<path fill="currentColor" d="M4 2h16v2H4zm0 18h16v2H4zM20 4h2v16h-2zM2 4h2v16H2zm9 2h2v8h-2zm0 10h2v2h-2z"/>'},"square-alert-sharp":{body:'<path fill="currentColor" d="M2 2h20v2H2zm0 18h20v2H2zM20 4h2v16h-2zM2 4h2v16H2zm9 2h2v8h-2zm0 10h2v2h-2z"/>'},"square-chevron-down":{body:'<path fill="currentColor" d="M4 20h16v2H4zM4 2h16v2H4zM2 4h2v16H2zm18 0h2v16h-2zm-9 11h2v-2h-2zm-2-2h2v-2H9zm-2-2h2V9H7zm6 2h2v-2h-2zm2-2h2V9h-2z"/>'},"square-chevron-down-sharp":{body:'<path fill="currentColor" d="M2 20h20v2H2zM2 2h20v2H2zm0 2h2v16H2zm18 0h2v16h-2zm-9 11h2v-2h-2zm-2-2h2v-2H9zm-2-2h2V9H7zm6 2h2v-2h-2zm2-2h2V9h-2z"/>'},"square-chevron-left":{body:'<path fill="currentColor" d="M4 20h16v2H4zM4 2h16v2H4zM2 4h2v16H2zm18 0h2v16h-2zM9 11v2h2v-2zm2-2v2h2V9zm2-2v2h2V7zm-2 6v2h2v-2zm2 2v2h2v-2z"/>'},"square-chevron-left-sharp":{body:'<path fill="currentColor" d="M2 20h20v2H2zM2 2h20v2H2zm0 2h2v16H2zm18 0h2v16h-2zM9 11v2h2v-2zm2-2v2h2V9zm2-2v2h2V7zm-2 6v2h2v-2zm2 2v2h2v-2z"/>'},"square-chevron-right":{body:'<path fill="currentColor" d="M4 20h16v2H4zM4 2h16v2H4zM2 4h2v16H2zm18 0h2v16h-2zm-5 7v2h-2v-2zm-2-2v2h-2V9zm-2-2v2H9V7zm2 6v2h-2v-2zm-2 2v2H9v-2z"/>'},"square-chevron-right-sharp":{body:'<path fill="currentColor" d="M2 20h20v2H2zM2 2h20v2H2zm0 2h2v16H2zm18 0h2v16h-2zm-5 7v2h-2v-2zm-2-2v2h-2V9zm-2-2v2H9V7zm2 6v2h-2v-2zm-2 2v2H9v-2z"/>'},"square-chevron-up":{body:'<path fill="currentColor" d="M4 20h16v2H4zM4 2h16v2H4zM2 4h2v16H2zm18 0h2v16h-2zm-9 5h2v2h-2zm-2 2h2v2H9zm-2 2h2v2H7zm6-2h2v2h-2zm2 2h2v2h-2z"/>'},"square-chevron-up-sharp":{body:'<path fill="currentColor" d="M2 20h20v2H2zM2 2h20v2H2zm0 2h2v16H2zm18 0h2v16h-2zm-9 5h2v2h-2zm-2 2h2v2H9zm-2 2h2v2H7zm6-2h2v2h-2zm2 2h2v2h-2z"/>'},"square-cursor":{body:'<path fill="currentColor" d="M12 10h2v12h-2zm2 0h2v2h-2zm2 2h2v2h-2zm2 2h2v2h-2zm2 2h2v2h-2zm-6 4h2v2h-2zm2-2h6v2h-6zM4 2h16v2H4zm0 18h6v2H4zM2 4h2v16H2zm18 0h2v8h-2z"/>'},"square-cursor-sharp":{body:'<path fill="currentColor" d="M12 10h2v12h-2zm2 0h2v2h-2zm2 2h2v2h-2zm2 2h2v2h-2zm2 2h2v2h-2zm-6 4h2v2h-2zm2-2h6v2h-6zM2 2h20v2H2zm0 18h8v2H2zM2 4h2v16H2zm18 0h2v8h-2z"/>'},"square-dashed-cursor":{body:'<path fill="currentColor" d="M12 10h2v12h-2zm2 0h2v2h-2zm2 2h2v2h-2zm2 2h2v2h-2zm2 2h2v2h-2zm-6 4h2v2h-2zm2-2h6v2h-6zM2 16h2v4H2zm2 4h2v2H4zm4 0h2v2H8zM2 10h2v4H2zm0-6h2v4H2zm2-2h2v2H4zm4 0h4v2H8zm6 0h4v2h-4zm6 2h2v4h-2zm0 6h2v2h-2z"/>'},"square-dashed-cursor-sharp":{body:'<g fill="currentColor"><path d="M12 10h2v12h-2zm2 0h2v2h-2zm2 2h2v2h-2zm2 2h2v2h-2zm2 2h2v2h-2zm-6 4h2v2h-2zm2-2h6v2h-6zM2 18h2v4H2zm2 2h2v2H4zm4 0h2v2H8zM2 8h2v4H2zm0-6h2v4H2zm2 0h2v2H4zm4 0h4v2H8zm10 0h4v2h-4z"/><path d="M20 2h2v4h-2zm0 6h2v4h-2zm-6-6h2v2h-2zM2 14h2v2H2z"/></g>'},"square-power":{body:'<path fill="currentColor" d="M4 20h16v2H4zM4 2h16v2H4zM2 4h2v16H2zm18 0h2v16h-2zM9 15h6v2H9zM7 9h2v6H7zm8 0h2v6h-2zm-4-2h2v5h-2z"/>'},"square-power-sharp":{body:'<path fill="currentColor" d="M2 20h20v2H2zM2 2h20v2H2zm0 2h2v16H2zm18 0h2v16h-2zM9 15h6v2H9zM7 9h2v6H7zm8 0h2v6h-2zm-4-2h2v5h-2z"/>'},"square-scissors":{body:'<path fill="currentColor" d="M4 2h16v2H4zm0 18h16v2H4zM2 4h2v16H2zm18 0h2v16h-2zm-4 3h2v2h-2zm-2 2h2v2h-2zm-2 2h2v2h-2zm4 4h2v2h-2zm-2-2h2v2h-2zm-4-2h2v2h-2zm0-2h2v2h-2zM8 7h2v2H8zm0 8h2v2H8zm-2-2h2v2H6zm2-2h2v2H8zM6 9h2v2H6zm4 4h2v2h-2z"/>'},"square-scissors-sharp":{body:'<path fill="currentColor" d="M2 2h20v2H2zm0 18h20v2H2zM2 4h2v16H2zm18 0h2v16h-2zm-4 3h2v2h-2zm-2 2h2v2h-2zm-2 2h2v2h-2zm4 4h2v2h-2zm-2-2h2v2h-2zm-4-2h2v2h-2zm0-2h2v2h-2zM8 7h2v2H8zm0 8h2v2H8zm-2-2h2v2H6zm2-2h2v2H8zM6 9h2v2H6zm4 4h2v2h-2z"/>'},"square-sharp":{body:'<path fill="currentColor" d="M2 4h2v16H2zm0 16h20v2H2zM20 4h2v16h-2zM2 2h20v2H2z"/>'},star:{body:'<path fill="currentColor" d="M5 20h3v2H3v-6h2zm16 2h-5v-2h3v-4h2zm-11-2H8v-2h2zm6 0h-2v-2h2zm-2-2h-4v-2h4zm-7-2H5v-3h2zm12 0h-2v-3h2zM5 13H3v-2h2zm16 0h-2v-2h2zM9 9H3v2H1V7h8zm14 2h-2V9h-6V7h8zM11 7H9V3h2zm4 0h-2V3h2zm-2-4h-2V1h2z"/>'},sticker:{body:'<g fill="currentColor"><path d="M4 4H2v16h2zm14-2H4v2h14zm4 4h-2v14h2zm-2 14H4v2h16zM18 4h2v2h-2zm-4 0h2v4h-2z"/><path d="M14 6h6v2h-6zm-6 8h2v2H8zm6 0h2v2h-2zm-4 2h4v2h-4zm-2-6h2v2H8zm6 0h2v2h-2z"/></g>'},"sticker-sharp":{body:'<g fill="currentColor"><path d="M4 4H2v16h2zm14-2H2v2h16zm4 4h-2v14h2zm0 14H2v2h20zM18 4h2v2h-2zm-4 0h2v4h-2z"/><path d="M14 6h6v2h-6zm-6 8h2v2H8zm6 0h2v2h-2zm-4 2h4v2h-4zm-2-6h2v2H8zm6 0h2v2h-2z"/></g>'},"sticky-note":{body:'<path fill="currentColor" d="M4 4H2v16h2zm12-2H4v2h12zm6 6h-2v12h2zm-2 12H4v2h16zM18 6h2v2h-2zm-2-2h2v2h-2zm-4 0h2v6h-2zm0 6h8v2h-8z"/>'},"sticky-note-sharp":{body:'<path fill="currentColor" d="M4 4H2v16h2zm12-2H2v2h14zm6 6h-2v12h2zm0 12H2v2h20zM18 6h2v2h-2zm-2-2h2v2h-2zm-4 0h2v6h-2zm0 6h8v2h-8z"/>'},"sticky-note-text":{body:'<path fill="currentColor" d="M4 4H2v16h2zm12-2H4v2h12zm6 6h-2v12h2zm-2 12H4v2h16zM18 6h2v2h-2zm-2-2h2v2h-2zm-4 0h2v6h-2zm0 6h8v2h-8zm-6 2h4v2H6zm0 4h6v2H6z"/>'},"sticky-note-text-sharp":{body:'<path fill="currentColor" d="M4 4H2v16h2zm12-2H2v2h14zm6 6h-2v12h2zm0 12H2v2h20zM18 6h2v2h-2zm-2-2h2v2h-2zm-4 0h2v6h-2zm0 6h8v2h-8zm-6 2h4v2H6zm0 4h6v2H6z"/>'},stop:{body:'<path fill="currentColor" d="M20 20H4V4h16zM6 18h12V6H6zm8-4h-4v-4h4z"/>'},"stop-solid":{body:'<path fill="currentColor" d="M20 20H4V4h16zm-10-6h4v-4h-4z"/>'},store:{body:'<path fill="currentColor" d="M3 13h2v8H3zm2 8h14v2H5zm14-8h2v8h-2zm-9-2h4v2h-4zm4-2h4v2h-4zm4 2h4v2h-4zM6 9h4v2H6zm-4 2h4v2H2zM0 7h2v4H0zm2-2h2v2H2zm18 0h2v2h-2zm2 2h2v4h-2zM4 3h16v2H4zm6 12h4v2h-4zm-2 2h2v4H8zm6 0h2v4h-2z"/>'},"store-sharp":{body:'<path fill="currentColor" d="M3 13h2v8H3zm0 8h18v2H3zm16-8h2v8h-2zm-9-2h4v2h-4zm4-2h4v2h-4zm4 2h4v2h-4zM6 9h4v2H6zm-4 2h4v2H2zM0 5h2v6H0zm22 0h2v6h-2zM0 3h24v2H0zm8 12h8v2H8zm0 2h2v4H8zm6 0h2v4h-2z"/>'},subscriptions:{body:'<path fill="currentColor" d="M4 10h16v2H4zm0 10h16v2H4zm-2-8h2v8H2zm18 0h2v8h-2zM6 6h12v2H6zm2-4h8v2H8zM6 16h2v2H6zm4 0h2v2h-2zm4 0h2v2h-2z"/>'},"subscriptions-sharp":{body:'<path fill="currentColor" d="M2 10h20v2H2zm0 10h20v2H2zm0-8h2v8H2zm18 0h2v8h-2zM6 6h12v2H6zm2-4h8v2H8zM6 16h2v2H6zm4 0h2v2h-2zm4 0h2v2h-2z"/>'},subtitles:{body:'<path fill="currentColor" d="M21 7h-8v10h8v-2h-6V9h6zM3 15V7h8v2H5v6h6v2H3z"/>',hidden:!0},suitcase:{body:'<path fill="currentColor" d="M4 6h16v2H4zM2 8h2v12H2zm18 0h2v12h-2zM4 20h16v2H4zM8 4h2v2H8zm2-2h4v2h-4zm4 2h2v2h-2zm-8 6h2v8H6zm10 0h2v8h-2z"/>'},"suitcase-sharp":{body:'<path fill="currentColor" d="M2 6h20v2H2zm0 2h2v12H2zm18 0h2v12h-2zM2 20h20v2H2zM8 4h2v2H8zm0-2h8v2H8zm6 2h2v2h-2zm-8 6h2v8H6zm10 0h2v8h-2z"/>'},sun:{body:'<path fill="currentColor" d="M13 22h-2v-3h2zm-6-3H5v-2h2zm12 0h-2v-2h2zm-4-2H9v-2h6zm-6-2H7V9h2zm8 0h-2V9h2zM5 13H2v-2h3zm17 0h-3v-2h3zm-7-4H9V7h6zM7 7H5V5h2zm12 0h-2V5h2zm-6-2h-2V2h2z"/>'},"sun-alt":{body:'<path fill="currentColor" d="M13 0h-2v4h2zM0 11v2h4v-2zm24 0v2h-4v-2zM13 24h-2v-4h2zM8 6h8v2H8zM6 8h2v8H6zm2 10v-2h8v2zm10-2h-2V8h2zm2-14h2v2h-2zm0 2v2h-2V4zm2 18h-2v-2h2zm-2-2h-2v-2h2zM4 2H2v2h2v2h2V4H4zM2 22h2v-2h2v-2H4v2H2z"/>',hidden:!0},"sun-solid":{body:'<path fill="currentColor" d="M13 22h-2v-3h2zm-6-3H5v-2h2zm12 0h-2v-2h2zM15 9h2v6h-2v2H9v-2H7V9h2V7h6zM5 13H2v-2h3zm17 0h-3v-2h3zM7 7H5V5h2zm12 0h-2V5h2zm-6-2h-2V2h2z"/>'},sunglasses:{body:'<path fill="currentColor" d="M15 10h5v2h-5zM4 10h5v2H4zm16 2h2v5h-2zM9 12h2v5H9zm4 0h2v5h-2zM2 12h2v5H2zm13 5h5v2h-5zM4 17h5v2H4zm7-5h2v2h-2zM2 6h2v6H2zm18 0h2v6h-2zM4 4h2v2H4zm14 0h2v2h-2zM6 12h3v2H6zm11 0h3v2h-3zM4 14h2v3H4zm11 0h2v3h-2zm-9 2h3v1H6zm11 0h3v1h-3zm-9-2h1v2H8zm11 0h1v2h-1z"/>'},"sunglasses-sharp":{body:'<path fill="currentColor" d="M13 10h7v2h-7zm-9 0h7v2H4zm16 2h2v5h-2zM9 12h2v5H9zm4 0h2v5h-2zM2 12h2v5H2zm11 5h9v2h-9zM2 17h9v2H2zm9-5h2v2h-2zM2 6h2v6H2zm18 0h2v6h-2zM4 4h2v2H4zm14 0h2v2h-2zM6 12h3v2H6zm11 0h3v2h-3zM4 14h2v3H4zm11 0h2v3h-2zm-9 2h3v1H6zm11 0h3v1h-3zm-9-2h1v2H8zm11 0h1v2h-1z"/>'},switch:{body:'<path fill="currentColor" d="M5 21H3v-2h2zm16 0h-6v-2h2v-2h2v-2h2zM7 19H5v-2h2zm2-2H7v-2h2zm8 0h-2v-2h2zm-2-2h-2v-2h2zm-2-2h-2v-2h2zm-2-2H9V9h2zm4 0h-2V9h2zM9 9H7V7h2zm8 0h-2V7h2zm4-6v6h-2V7h-2V5h-2V3zM7 7H5V5h2zM5 5H3V3h2z"/>'},sword:{body:'<path fill="currentColor" d="M11 2h2v2h-2zM9 4h2v12H9zm4 0h2v12h-2zM7 16h10v2H7zm4 2h2v4h-2z"/>'},sync:{body:'<path fill="currentColor" d="M4 9V7h12V5h2v2h2v2h-2v2h-2V9zm12 2h-2v2h2zm0-6h-2V3h2zm4 12v-2H8v-2h2v-2H8v2H6v2H4v2h2v2h2v2h2v-2H8v-2z"/>',hidden:!0},"t-arrow-down":{body:'<g fill="currentColor"><path d="M16 6h2v12h-2zm2 8h2v2h-2zm-4 0h2v2h-2zm4-2h4v2h-4zm-6 0h4v2h-4zM6 8h2v10H6zM2 6h8v2H2z"/><path d="M2 6h2v3H2zm8 0h2v3h-2zM4 16h6v2H4z"/></g>'},"t-arrow-up":{body:'<g fill="currentColor"><path d="M16 18h2V6h-2zm2-8h2V8h-2zm-4 0h2V8h-2zm4 2h4v-2h-4zm-6 0h4v-2h-4zM6 8h2v10H6zM2 6h8v2H2z"/><path d="M2 6h2v3H2zm8 0h2v3h-2zM4 16h6v2H4z"/></g>'},"t-rex":{body:'<path fill="currentColor" d="M18 23h-8v-2h2v-2h2v2h2v-4h2zm-8-8h2v4h-2v-2H6v-2h2v-2H4v-2h6zm10 2h-2v-2h2zm-6-2h-2v-2h2zm8 0h-2v-2h-2v-2h2V7h2zM4 7h4v2H4v2H2V3h2zm14 4h-2V9h2zm-2-2h-2V3h2zm-4-2h-2V5h2zm2-4H4V1h10z"/>'},tab:{body:'<path fill="currentColor" d="M2 6h2v12H2zm2 12h16v2H4zM20 6h2v12h-2zM4 4h16v2H4zm8 2h8v4h-8z"/>'},"tab-sharp":{body:'<path fill="currentColor" d="M2 6h2v12H2zm0 12h20v2H2zM20 6h2v12h-2zM2 4h20v2H2zm10 2h8v4h-8z"/>'},table:{body:'<path fill="currentColor" d="M2 3h20v18H2zm2 4v5h7V7zm9 0v5h7V7zm7 7h-7v5h7zm-9 5v-5H4v5z"/>',hidden:!0},tablet:{body:'<path fill="currentColor" d="M5 2h14v2H5zm0 18h14v2H5zM3 4h2v16H3zm16 0h2v16h-2zm-8 12h2v2h-2z"/>'},"tablet-sharp":{body:'<path fill="currentColor" d="M3 2h18v2H3zm0 18h18v2H3zM3 4h2v16H3zm16 0h2v16h-2zm-8 12h2v2h-2z"/>'},tangent:{body:'<g fill="currentColor"><path d="M6 16h2v2H6zm-2 0h2v2H4zm-2 0h2v6H2zm2 4h2v2H4zm2-2h2v4H6zM16 2h2v6h-2zm2 0h2v2h-2zm2 0h2v6h-2zm-2 4h2v2h-2zM8 14h2v2H8zm2-2h2v2h-2zm2-2h2v2h-2zm2-2h2v2h-2z"/><path d="M16 6h2v2h-2zm-2 6h4v2h-4zm4 2h4v2h-4zm-6-2h2v6h-2zm2 6h2v4h-2z"/></g>'},target:{body:'<path fill="currentColor" d="M5 1h14v2H5zM3 3h2v2H3zm0 16h2v2H3zm16 0h2v2h-2zm0-16h2v2h-2zm2 2h2v14h-2zM5 21h14v2H5zM1 5h2v14H1zm8 0h6v2H9zM5 9h2v6H5zm4 8h6v2H9zm8-8h2v6h-2zm-6 0h2v2h-2zM7 7h2v2H7zm0 8h2v2H7zm8 0h2v2h-2zm0-8h2v2h-2zm-6 4h2v2H9zm2 2h2v2h-2zm2-2h2v2h-2z"/>'},tea:{body:'<path fill="currentColor" d="M4 6h16v2H4zm0 2h2v10H4zm2 10h10v2H6zM20 8h2v4h-2zm-2 4h2v2h-2zm-2-4h2v10h-2zM7 2h2v2H7zm6 0h2v2h-2zM9 0h2v2H9zm6 0h2v2h-2zm-5 8h2v4h-2zm-2 4h6v4H8z"/>'},"tea-sharp":{body:'<path fill="currentColor" d="M4 6h16v2H4zm0 2h2v10H4zm0 10h14v2H4zM20 6h2v8h-2zm-2 6h2v2h-2zm-2-4h2v10h-2zM7 2h2v2H7zm6 0h2v2h-2zM9 0h2v2H9zm6 0h2v2h-2zm-5 8h2v4h-2zm-2 4h6v4H8z"/>'},teach:{body:'<g fill="currentColor"><path d="M3 2h4v4H3zM2 8h12v2H2zm7-4h11v2H9zm1 10h10v2H10z"/><path d="M2 9h6v7H2zm0 7h2v4H2zm4 0h2v4H6zM20 6h2v8h-2z"/></g>'},"teach-sharp":{body:'<g fill="currentColor"><path d="M3 2h4v4H3zM2 8h12v2H2zm7-4h11v2H9zm1 10h10v2H10z"/><path d="M2 9h6v7H2zm0 7h2v4H2zm4 0h2v4H6zM20 4h2v12h-2z"/></g>'},telegram:{body:'<path fill="currentColor" d="M19 23H5v-2h14zM5 21H3v-2h2zm16 0h-2v-2h2zM3 19H1V5h2zm14 0h-2v-2h-4v-2h4V7h-3V5h5zm6 0h-2V5h2zm-10-8v2h-2v2H9v2H7v-4h2v-2zm-6 2H4v-2h3zm2-2H7V9h2zm3-2H9V7h3zM5 5H3V3h2zm16 0h-2V3h2zm-2-2H5V1h14z"/>'},"telegram-glyph":{body:'<path fill="currentColor" d="M23 23H1V1h22zM13 7h-3v2H8v2H5v2h3v4h2v-2h2v2h4v2h2V5h-5zm3 8h-4v-2h2v-2h-4V9h4V7h2zm-6-2H8v-2h2z"/>'},"telegram-sharp":{body:'<path fill="currentColor" d="M23 23H1V1h22zM3 21h18V3H3zm15-2h-2v-2h-4v-2h4V7h-3V5h5zm-4-8v2h-2v2h-2v2H8v-4h2v-2zm-6 2H5v-2h3zm2-2H8V9h2zm3-2h-3V7h3z"/>'},"telegram-solid":{body:'<path fill="currentColor" d="M19 3h2v2h2v14h-2v2h-2v2H5v-2H3v-2H1V5h2V3h2V1h14zm-7 4H9v2H7v2H4v2h3v4h2v-2h2v2h4v2h2V5h-5zm3 8h-4v-2h2v-2H9V9h4V7h2zm-6-2H7v-2h2z"/>'},tent:{body:'<g fill="currentColor"><path d="M1 19h22v2H1z"/><path d="M3 17h2v3H3zm2-3h2v3H5zm2-3h2v3H7zm2-3h2v3H9zm2-3h2v3h-2zM9 3h2v2H9zm4 5h2v3h-2zm2 3h2v3h-2zm2 3h2v3h-2zm2 3h2v3h-2zM9 17h2v2H9zm4 0h2v2h-2zm-2-2h2v2h-2zm2-12h2v2h-2z"/></g>'},terminal:{body:'<path fill="currentColor" d="M4 2h16v2H4zm0 18h16v2H4zM2 4h2v16H2zm18 0h2v16h-2zM6 16h2v2H6zm2-2h2v2H8zm-2-2h2v2H6z"/>'},"terminal-sharp":{body:'<path fill="currentColor" d="M2 2h20v2H2zm0 18h20v2H2zM2 4h2v16H2zm18 0h2v16h-2zM6 16h2v2H6zm2-2h2v2H8zm-2-2h2v2H6z"/>'},"test-tube":{body:'<g fill="currentColor"><path d="M7 2h10v2H7zm1 2h2v16H8zm2 16h4v2h-4zm4-16h2v16h-2z"/><path d="M8 13h8v2H8z"/></g>'},"test-tube-sharp":{body:'<g fill="currentColor"><path d="M7 2h10v2H7zm1 2h2v16H8zm0 16h8v2H8zm6-16h2v16h-2z"/><path d="M8 13h8v2H8z"/></g>'},"text-add":{body:'<path fill="currentColor" d="M19 4H3v2h16zm0 4H3v2h16zM3 12h8v2H3zm8 4H3v2h8zm7-1h3v2h-3v3h-2v-3h-3v-2h3v-3h2z"/>',hidden:!0},"text-align-center":{body:'<path fill="currentColor" d="M2 5h20v2H2zm4 6h12v2H6zm-2 6h16v2H4z"/>'},"text-align-center-box":{body:'<path fill="currentColor" d="M4 2h16v2H4zm0 18h16v2H4zM2 4h2v16H2zm18 0h2v16h-2zM6 7h12v2H6zm3 4h6v2H9zm-2 4h10v2H7z"/>'},"text-align-center-box-sharp":{body:'<path fill="currentColor" d="M2 2h20v2H2zm0 18h20v2H2zM2 4h2v16H2zm18 0h2v16h-2zM6 7h12v2H6zm3 4h6v2H9zm-2 4h10v2H7z"/>'},"text-align-justify":{body:'<path fill="currentColor" d="M2 5h20v2H2zm0 6h20v2H2zm0 6h20v2H2z"/>'},"text-align-justify-box":{body:'<path fill="currentColor" d="M4 2h16v2H4zm0 18h16v2H4zM2 4h2v16H2zm18 0h2v16h-2zM6 7h12v2H6zm0 4h12v2H6zm0 4h12v2H6z"/>'},"text-align-justify-box-sharp":{body:'<path fill="currentColor" d="M2 2h20v2H2zm0 18h20v2H2zM2 4h2v16H2zm18 0h2v16h-2zM6 7h12v2H6zm0 4h12v2H6zm0 4h12v2H6z"/>'},"text-align-left":{body:'<path fill="currentColor" d="M2 5h20v2H2zm0 6h12v2H2zm0 6h16v2H2z"/>'},"text-align-left-box":{body:'<path fill="currentColor" d="M4 2h16v2H4zm0 18h16v2H4zM2 4h2v16H2zm18 0h2v16h-2zM6 7h12v2H6zm0 4h6v2H6zm0 4h10v2H6z"/>'},"text-align-left-box-sharp":{body:'<path fill="currentColor" d="M2 2h20v2H2zm0 18h20v2H2zM2 4h2v16H2zm18 0h2v16h-2zM6 7h12v2H6zm0 4h6v2H6zm0 4h10v2H6z"/>'},"text-align-right":{body:'<path fill="currentColor" d="M2 5h20v2H2zm8 6h12v2H10zm-4 6h16v2H6z"/>'},"text-align-right-box":{body:'<path fill="currentColor" d="M4 2h16v2H4zm0 18h16v2H4zM2 4h2v16H2zm18 0h2v16h-2zM6 7h12v2H6zm6 4h6v2h-6zm-4 4h10v2H8z"/>'},"text-align-right-box-sharp":{body:'<path fill="currentColor" d="M2 2h20v2H2zm0 18h20v2H2zM2 4h2v16H2zm18 0h2v16h-2zM6 7h12v2H6zm6 4h6v2h-6zm-4 4h10v2H8z"/>'},"text-colums":{body:'<path fill="currentColor" d="M11 19H3v-2h8zm10 0h-8v-2h8zm-10-4H3v-2h8zm10 0h-8v-2h8zm-10-4H3V9h8zm10 0h-8V9h8zM11 7H3V5h8zm10 0h-8V5h8z"/>'},"text-cursor":{body:'<path fill="currentColor" d="M5 2h4v2H5zm0 20h4v-2H5zM9 4h2v2H9zm0 16h2v-2H9zm4-16h2v2h-2zm0 16h2v-2h-2zm2-18h4v2h-4zm0 20h4v-2h-4zM11 6h2v12h-2z"/>'},"text-cursor-input":{body:'<path fill="currentColor" d="M5 3h4v2H5zm4 2h2v14H9zm2-2h4v2h-4zM4 7h3v2H4zM2 9h2v6H2zm2 6h3v2H4zm9 0h7v2h-7zm7-6h2v6h-2zm-7-2h7v2h-7zM6 19h3v2H6zm5 0h3v2h-3z"/>'},"text-cursor-input-sharp":{body:'<path fill="currentColor" d="M5 3h4v2H5zm4 2h2v14H9zm2-2h4v2h-4zM4 7h3v2H4zM2 7h2v10H2zm2 8h3v2H4zm9 0h7v2h-7zm7-8h2v10h-2zm-7 0h7v2h-7zM6 19h3v2H6zm5 0h3v2h-3z"/>'},"text-search":{body:'<path fill="currentColor" d="M20 4H4v2h16zm0 4H4v2h16zm-8 4H4v2h8zm8 0h-6v6h6v2h2v-2h-2zm-4 4v-2h2v2zm-4 0H4v2h8z"/>',hidden:!0},"text-start-a":{body:'<path fill="currentColor" d="M12 6h10v2H12zm0 4h10v2H12zM2 14h20v2H2zm0 4h20v2H2zM2 6h2v6H2zm6 0h2v6H8zM4 4h4v2H4zm0 4h4v2H4z"/>'},"text-start-a-sharp":{body:'<path fill="currentColor" d="M12 6h10v2H12zm0 4h10v2H12zM2 14h20v2H2zm0 4h20v2H2zM2 6h2v6H2zm6 0h2v6H8zM2 4h8v2H2zm2 4h4v2H4z"/>'},"text-start-t":{body:'<g fill="currentColor"><path d="M12 6h10v2H12zm0 4h10v2H12zM2 14h20v2H2zm0 4h20v2H2zM2 4h8v2H2zm3 2h2v6H5z"/><path d="M3 10h6v2H3zM2 6h2v2H2zm6 0h2v2H8z"/></g>'},"text-wrap":{body:'<g fill="currentColor"><path d="M3 5h16v2H3zm0 8h4v2H3zm0 4h6v2H3zm0-8h6v2H3zm16-2h2v6h-2zM9 13h10v2H9z"/><path d="M11 11h2v6h-2zm2-2h2v8h-2zm0 8h2v2h-2z"/></g>'},"text-wrap-sharp":{body:'<g fill="currentColor"><path d="M3 5h16v2H3zm0 8h4v2H3zm0 4h6v2H3zm0-8h6v2H3zm16-4h2v10h-2zM9 13h10v2H9z"/><path d="M11 11h2v6h-2zm2-2h2v8h-2zm0 8h2v2h-2z"/></g>'},thermometer:{body:'<g fill="currentColor"><path d="M9 2h6v2H9zm0 18h6v2H9zm2-4h2v2h-2zM7 4h2v16H7zm8 0h2v16h-2z"/><path d="M5 16h4v2H5zM5 6h4v2H5zm0 5h4v2H5z"/></g>'},"thermometer-sharp":{body:'<g fill="currentColor"><path d="M7 2h10v2H7zm0 18h10v2H7zm4-4h2v2h-2zM7 4h2v16H7zm8 0h2v16h-2z"/><path d="M5 16h4v2H5zM5 6h4v2H5zm0 5h4v2H5z"/></g>'},"thumbs-down":{body:'<path fill="currentColor" d="M2 12h2V4H2zm2-8h14V2H4zm14 4h2V4h-2zm2 4h2V8h-2zm-6 2h6v-2h-6zm0 2h2v-2h-2zm2 4h2v-4h-2zm-2 2h2v-2h-2zm-2-2h2v-2h-2zm-2-2h2v-2h-2zm-2-2h2v-2H8zm-4-2h4v-2H4zm2-2h2V4H6z"/>'},"thumbs-down-sharp":{body:'<path fill="currentColor" d="M2 14h2V2H2zM4 4h14V2H4zm14 4h2V4h-2zm2 4h2V8h-2zm-6 2h6v-2h-6zm0 2h2v-2h-2zm2 4h2v-4h-2zm-2 2h2v-2h-2zm-2-2h2v-2h-2zm-2-2h2v-2h-2zm-2-2h2v-2H8zm-4-2h4v-2H4zm2-2h2V4H6z"/>'},"thumbs-up":{body:'<path fill="currentColor" d="M2 12h2v8H2zm2 8h14v2H4zm14-4h2v4h-2zm2-4h2v4h-2zm-6-2h6v2h-6zm0-2h2v2h-2zm2-4h2v4h-2zm-2-2h2v2h-2zm-2 2h2v2h-2zm-2 2h2v2h-2zM8 8h2v2H8zm-4 2h4v2H4zm2 2h2v8H6z"/>'},"thumbs-up-sharp":{body:'<path fill="currentColor" d="M2 10h2v12H2zm2 10h14v2H4zm14-4h2v4h-2zm2-4h2v4h-2zm-6-2h6v2h-6zm0-2h2v2h-2zm2-4h2v4h-2zm-2-2h2v2h-2zm-2 2h2v2h-2zm-2 2h2v2h-2zM8 8h2v2H8zm-4 2h4v2H4zm2 2h2v8H6z"/>'},tiktok:{body:'<path fill="currentColor" d="M15 22H7v-2h8zm-8-2H5v-2h2zM17 8h2V6h2v4h-4v10h-2V6h2zM5 18H3v-6h2zM17 4h-4v14H9v-2h2v-2H9v-2h2v-2H7V8h4V2h6zM9 16H7v-2h2zm-2-4H5v-2h2zm12-6h-2V4h2z"/>'},timeline:{body:'<path fill="currentColor" d="M7 7h4v4H7zm-2 6v-2h2v2zm0 0v4H1v-4zm8 0h-2v-2h2zm4 0h-4v4h4zm2-2v2h-2v-2zm0 0h4V7h-4z"/>',hidden:!0},"toggle-left":{body:'<path fill="currentColor" d="M4 5h16v2H4zm0 12H2V7h2zm16 0v2H4v-2zm0 0h2V7h-2zM10 9H6v6h4z"/>',hidden:!0},"toggle-right":{body:'<path fill="currentColor" d="M4 5h16v2H4zm0 12H2V7h2zm16 0v2H4v-2zm0 0h2V7h-2zm-2-8h-4v6h4z"/>',hidden:!0},"toke-circle":{body:'<path fill="currentColor" d="M6 2h12v2H6zm0 18h12v2H6zM4 4h2v2H4zm16 0h-2v2h2zM2 6h2v12H2zm20 0h-2v12h2zM4 18h2v2H4zm16 0h-2v2h2zM11 7h2v2h-2zm0 8h2v2h-2zm-4-4h2v2H7zm8 0h2v2h-2zM9 9h2v2H9zm4 0h2v2h-2zm0 4h2v2h-2zm-4 0h2v2H9z"/>'},"toke-square":{body:'<path fill="currentColor" d="M4 2h16v2H4zm0 18h16v2H4zM2 4h2v16H2zm18 0h2v16h-2zm-9 3h2v2h-2zm0 8h2v2h-2zm-4-4h2v2H7zm8 0h2v2h-2zM9 9h2v2H9zm4 0h2v2h-2zm0 4h2v2h-2zm-4 0h2v2H9z"/>'},"toke-square-sharp":{body:'<path fill="currentColor" d="M2 2h20v2H2zm0 18h20v2H2zM2 4h2v16H2zm18 0h2v16h-2zm-9 3h2v2h-2zm0 8h2v2h-2zm-4-4h2v2H7zm8 0h2v2h-2zM9 9h2v2H9zm4 0h2v2h-2zm0 4h2v2h-2zm-4 0h2v2H9z"/>'},"tool-case":{body:'<path fill="currentColor" d="M2 11h20v2H2zm0 2h2v8H2zm2 8h16v2H4zm16-8h2v8h-2zM9 15h6v2H9zM4 8h2v3H4zm2-2h6v2H6zm6 2h2v3h-2zM8 4h2v2H8zm10 0h2v7h-2zm-8-2h8v2h-8z"/>'},"tool-case-sharp":{body:'<g fill="currentColor"><path d="M2 11h20v2H2zm0 2h2v8H2zm0 8h20v2H2zm18-8h2v8h-2zM9 15h6v2H9zM4 8h2v3H4zm0-2h10v2H4zm8 2h2v3h-2zM8 2h2v4H8zm10 1h2v8h-2z"/><path d="M8 2h12v2H8z"/></g>'},tools:{body:'<path fill="currentColor" d="M9 22H7v-2h2zm12-6h2v6h-6v-6h2v-6h2zm-2 2v2h2v-2zM7 20H5v-8h2zm4 0H9v-8h2zm-6-8H3v-2h2zm8 0h-2v-2h2zM3 10H1V4h2zm12 0h-2V4h2zm4 0h-2V4h2zm4 0h-2V4h2zM7 6h2V2h4v2h-2v4H5V4H3V2h4zm14-2h-2V2h2z"/>'},"tools-solid":{body:'<path fill="currentColor" d="M7 6h2V2h2v2h2v6h-2v2H9v4h2v6H5v-6h2v-4H5v-2H3V4h2V2h2zm12-2h2v6h-2v6h2v6h-6v-6h2v-6h-2V4h2V2h2z"/>'},tournament:{body:'<path fill="currentColor" d="M2 1h5v2H2zm0 12h5v2H2zm0-4h5v2H2zm0 12h5v2H2zM7 3h2v6H7zm7 4h2v10h-2zm-7 8h2v6H7zm2 2h5v2H9zM9 5h5v2H9zm7 6h6v2h-6z"/>'},"tournament-sharp":{body:'<path fill="currentColor" d="M2 1h5v2H2zm0 12h5v2H2zm0-4h5v2H2zm0 12h5v2H2zM7 1h2v10H7zm7 4h2v14h-2zm-7 8h2v10H7zm2 4h5v2H9zM9 5h5v2H9zm7 6h6v2h-6z"/>'},"track-changes":{body:'<path fill="currentColor" d="M11 2H2v20h20V4h-2v16H4V4h7v2H6v12h12V8h-2v8H8V8h3v2h-1v4h4v-4h-1V2z"/>',hidden:!0},trash:{body:'<path fill="currentColor" d="M18 22H6v-2h12zM9 6h6V4h2v2h5v2h-2v12h-2V8H6v12H4V8H2V6h5V4h2zm6-2H9V2h6z"/>'},"trash-alt":{body:'<path fill="currentColor" d="M16 2v4h6v2h-2v14H4V8H2V6h6V2zm-2 2h-4v2h4zm0 4H6v12h12V8z"/>',hidden:!0},"trash-sharp":{body:'<path fill="currentColor" d="M18 20V8H6v12zM9 6h6V4H9zm11 16H4V8H2V6h5V2h10v4h5v2h-2z"/>'},tree:{body:'<g fill="currentColor"><path d="M6 4h2v2H6zm2-2h8v2H8zm10 4h2v4h-2zm2 4h2v6h-2zm-2 6h2v2h-2zM4 16h2v2H4zm-2-6h2v6H2zm4 8h12v2H6zM4 6h2v4H4z"/><path d="M11 18h2v4h-2zm5-14h2v2h-2z"/></g>'},"tree-pine":{body:'<path fill="currentColor" d="M11 2h2v2h-2zM9 4h2v2H9zm4 0h2v2h-2zm2 2h2v2h-2zM7 6h2v2H7zm0 4h2v2H7zm-2 2h2v2H5zm2 2h2v2H7zm-2 2h2v2H5zm-2 2h18v2H3zM13 8h2v2h-2zm2 2h2v2h-2zM9 8h2v2H9zm8 4h2v2h-2zm-2 2h2v2h-2zm2 2h2v2h-2zm-6 4h2v2h-2z"/>'},trending:{body:'<path fill="currentColor" d="M3 4h2v14h16v2H3zm6 10H7v2h2zm2-2v2H9v-2zm2 0v-2h-2v2zm2 0h-2v2h2zm2-2h-2v2h2zm2-2v2h-2V8zm0 0V6h2v2z"/>',hidden:!0},"trending-down":{body:'<path fill="currentColor" d="M2 8h2v2h2v2h2v2h2v-2h2v-2h2v2h2v2h2v2h-4v2h8v-8h-2v4h-2v-2h-2v-2h-2V8h-2v2h-2v2H8v-2H6V8H4V6H2z"/>',hidden:!0},"trending-up":{body:'<path fill="currentColor" d="M4 18H2v-2h2zm2-2H4v-2h2zm8 0h-2v-2h2zm-6-2H6v-2h2zm4 0h-2v-2h2zm4 0h-2v-2h2zm6-8v8h-2v-4h-2V8h-4V6zm-12 6H8v-2h2zm8 0h-2v-2h2z"/>'},trophy:{body:'<path fill="currentColor" d="M16 17h-3v2h2v2H9v-2h2v-2H8v-2h8zm2-12h4v6h-2V7h-2v4h2v2h-2v2h-2V5H8v10H6v-2H4v-2h2V7H4v4H2V5h4V3h12z"/>'},"trophy-sharp":{body:'<path fill="currentColor" d="M18 5h4v8h-4v4h-5v2h2v2H9v-2h2v-2H6v-4H2V5h4V3h12zM8 15h8V5H8zm-4-4h2V7H4zm14 0h2V7h-2z"/>'},truck:{body:'<g fill="currentColor"><path d="M2 4h12v2H2zM0 16h4v2H0zm10 0h4v2h-4zm12-4h2v6h-2zm-8-6h2v12h-2zM0 6h2v10H0zm20 4h2v2h-2z"/><path d="M14 8h6v2h-6zM4 14h6v2H4zm10 0h6v2h-6zM4 16h2v2H4zm10 0h2v2h-2zM4 18h6v2H4zm10 0h6v2h-6zm-6-2h2v2H8zm10 0h4v2h-4z"/></g>'},"truck-sharp":{body:'<g fill="currentColor"><path d="M0 4h14v2H0zm0 12h4v2H0zm10 0h4v2h-4zm12-4h2v6h-2zm-8-8h2v14h-2zM0 6h2v10H0zm20 4h2v2h-2z"/><path d="M14 8h6v2h-6zM4 14h6v2H4zm10 0h6v2h-6zM4 16h2v2H4zm10 0h2v2h-2zM4 18h6v2H4zm10 0h6v2h-6zm-6-2h2v2H8zm10 0h4v2h-4z"/></g>'},tv:{body:'<path fill="currentColor" d="M4 3h16v2H4zM2 5h2v10H2zm2 10h16v2H4zM20 5h2v10h-2zM6 19h12v2H6zm3-2h2v2H9zm4 0h2v2h-2z"/>'},"tv-sharp":{body:'<path fill="currentColor" d="M2 3h20v2H2zm0 2h2v10H2zm0 10h20v2H2zM20 5h2v10h-2zM6 19h12v2H6zm3-2h2v2H9zm4 0h2v2h-2z"/>'},"twitter-bird":{body:'<path fill="currentColor" d="M14 21H6v-2h8zm-8-2H2v-2h4zm10 0h-2v-2h2zm-8-2H6v-2h2zm10 0h-2v-3h2zM6 15H4v-2h2zm14-1h-2v-2h2zM4 5h2v2H4v6H2V3h2zm14 3h4v4h-2v-2h-4V5h2zm-7 1H6V7h3V5h2zm5-4h-5V3h5z"/>'},"twitter-bird-solid":{body:'<path fill="currentColor" d="M14 21H6v-2H2v-2h4v-2H4v-2H2V3h2v2h2v2h3V5h2V3h5v2h2v3h4v4h-2v2h-2v3h-2v2h-2z"/>'},undo:{body:'<path fill="currentColor" d="M18 20h-6v-2h6zm2-2h-2v-8h2zm-10-4H8v-2H6v-2H4V8h2V6h2V4h2v4h8v2h-8z"/>'},"undo-sharp":{body:'<path fill="currentColor" d="M10 14H8v-2H6v-2H4V8h2V6h2V4h2v4h10v12h-8v-2h6v-8h-8z"/>'},ungroup:{body:'<path fill="currentColor" d="M7 3H3v4h4zm0 14H3v4h4zM17 3h4v4h-4zm4 14h-4v4h4zM8 8h2v2H8zm4 2h-2v4H8v2h2v-2h4v2h2v-2h-2v-4h2V8h-2v2z"/>',hidden:!0},university:{body:'<path fill="currentColor" d="M1 10h2v10H1zm2 10h18v2H3zm18-10h2v10h-2zM3 8h4v2H3zm14 0h4v2h-4zM7 6h2v2H7zm2-2h2v2H9zm2-2h2v2h-2zm2 2h2v2h-2zm2 2h2v2h-2zm-4 2h2v2h-2zm-2 2h2v2H9zm2 2h2v2h-2zm2-2h2v2h-2zm-8 3h2v2H5zm0 4h2v2H5zm12 0h2v2h-2zm0-4h2v2h-2zm-8 5h2v2H9zm0-2h6v2H9zm4 2h2v2h-2z"/>'},"university-sharp":{body:'<path fill="currentColor" d="M1 10h2v10H1zm0 10h22v2H1zm20-10h2v10h-2zM1 8h6v2H1zm16 0h6v2h-6zM7 6h2v2H7zm2-2h2v2H9zm2-2h2v2h-2zm2 2h2v2h-2zm2 2h2v2h-2zm-4 2h2v2h-2zm-2 2h2v2H9zm2 2h2v2h-2zm2-2h2v2h-2zm-8 3h2v2H5zm0 4h2v2H5zm12 0h2v2h-2zm0-4h2v2h-2zm-8 5h2v2H9zm0-2h6v2H9zm4 2h2v2h-2z"/>'},unlink:{body:'<path fill="currentColor" d="M4 6h5v2H4zm11 0h5v2h-5zm0 10h5v2h-5zM4 16h5v2H4zm16-8h2v8h-2zM2 8h2v8H2zm9-4h2v16h-2z"/>'},"unlink-sharp":{body:'<path fill="currentColor" d="M4 6h5v2H4zm11 0h5v2h-5zm0 10h5v2h-5zM4 16h5v2H4zM20 6h2v12h-2zM2 6h2v12H2zm9-2h2v16h-2z"/>'},unlock:{body:'<path fill="currentColor" d="M5 8h14v2H5zm0 12h14v2H5zM3 10h2v10H3zm16 0h2v10h-2zM7 4h2v4H7zm2-2h6v2H9zm6 2h2v2h-2z"/>'},"unlock-sharp":{body:'<path fill="currentColor" d="M3 8h18v2H3zm0 12h18v2H3zm0-10h2v10H3zm16 0h2v10h-2zM7 4h2v4H7zm0-2h10v2H7zm8 2h2v2h-2z"/>'},upload:{body:'<path fill="currentColor" d="M19 21H5v-2h14zM5 19H3v-4h2zm16 0h-2v-4h2zM13 5h2v2h2v2h-4v8h-2V9H7V7h2V5h2V3h2z"/>'},"upload-sharp":{body:'<path fill="currentColor" d="M5 19h14v-4h2v6H3v-6h2zm8-14h2v2h2v2h-4v8h-2V9H7V7h2V5h2V3h2z"/>'},usb:{body:'<path fill="currentColor" d="M19 22H5v-2h14zM7 13h10V4h2v9h2v7h-2v-5H5v5H3v-7h2V4h2zm4-2H9V6h2zm4 0h-2V6h2zm2-7H7V2h10z"/>'},"usb-glyph":{body:'<path fill="currentColor" d="M21 22H3v-7h18zm-2-9H5V2h14zM9 11h2V6H9zm4 0h2V6h-2z"/>'},"usb-sharp":{body:'<path fill="currentColor" d="M19 13h2v9H3v-9h2V2h14zM5 20h14v-5H5zm2-7h10V4H7zm4-2H9V6h2zm4 0h-2V6h2z"/>'},"usb-solid":{body:'<path fill="currentColor" d="M21 20h-2v2H5v-2H3v-5h18zM17 4h2v9H5V4h2V2h10zm-8 7h2V6H9zm4 0h2V6h-2z"/>'},user:{body:'<path fill="currentColor" d="M9 2h6v2H9zm0 8h6v2H9zm6-6h2v6h-2zM7 4h2v6H7zM4 18h2v4H4zm14 0h2v4h-2zM8 14h8v2H8zm-2 2h2v2H6zm10 0h2v2h-2z"/>'},"user-minus":{body:'<path fill="currentColor" d="M9 2h6v2H9zm0 8h6v2H9zm6-6h2v6h-2zM7 4h2v6H7zM4 18h2v4H4zm4-4h8v2H8zm-2 2h2v2H6zm10 2h6v2h-6z"/>'},"user-minus-sharp":{body:'<path fill="currentColor" d="M16 18h6v2h-6zM7 2h10v2H7zm0 8h10v2H7zm8-6h2v6h-2zM7 4h2v6H7zM4 14h2v8H4zm2 0h8v2H6z"/>'},"user-plus":{body:'<g fill="currentColor"><path d="M9 2h6v2H9zm0 8h6v2H9zm6-6h2v6h-2zM7 4h2v6H7zM4 18h2v4H4zm14 0h2v4h-2zM8 14h8v2H8zm-2 2h2v2H6z"/><path d="M18 16h2v6h-2z"/><path d="M16 18h6v2h-6z"/></g>'},"user-plus-sharp":{body:'<g fill="currentColor"><path d="M18 18h2v4h-2z"/><path d="M18 16h2v6h-2z"/><path d="M16 18h6v2h-6zM7 2h10v2H7zm0 8h10v2H7zm8-6h2v6h-2zM7 4h2v6H7zM4 14h2v8H4zm2 0h8v2H6z"/></g>'},"user-sharp":{body:'<path fill="currentColor" d="M7 2h10v2H7zm0 8h10v2H7zm8-6h2v6h-2zM7 4h2v6H7zM4 14h2v8H4zm14 0h2v8h-2zM6 14h12v2H6z"/>'},"user-x":{body:'<path fill="currentColor" d="M9 2h6v2H9zm0 8h6v2H9zm6-6h2v6h-2zM7 4h2v6H7zM4 18h2v4H4zm16 2h2v2h-2zM8 14h6v2H8zm-2 2h2v2H6zm10 0h2v2h-2zm2 2h2v2h-2zm2-2h2v2h-2zm-4 4h2v2h-2z"/>'},"user-x-sharp":{body:'<path fill="currentColor" d="M20 20h2v2h-2zm-4-4h2v2h-2zm2 2h2v2h-2zm2-2h2v2h-2zm-4 4h2v2h-2zM7 2h10v2H7zm0 8h10v2H7zm8-6h2v6h-2zM7 4h2v6H7zM4 14h2v8H4zm2 0h8v2H6z"/>'},users:{body:'<path fill="currentColor" d="M5 2h6v2H5zm10 0h4v2h-4zM5 10h6v2H5zm10 0h4v2h-4zm4-6h2v6h-2zm-8 0h2v6h-2zM3 4h2v6H3zM0 18h2v4H0zm14 0h2v4h-2zm8 0h2v4h-2zM4 14h8v2H4zm12 0h4v2h-4zM2 16h2v2H2zm10 0h2v2h-2zm8 0h2v2h-2z"/>'},"users-sharp":{body:'<path fill="currentColor" d="M3 2h10v2H3zm12 0h6v2h-6zM3 10h10v2H3zm12 0h6v2h-6zm-4-6h2v6h-2zm8 0h2v6h-2zM3 4h2v6H3zM0 14h2v8H0zm14 0h2v8h-2zm8 0h2v8h-2zM2 14h12v2H2zm16 0h4v2h-4z"/>'},"utility-pole":{body:'<g fill="currentColor"><path d="M11 2h2v20h-2z"/><path d="M1 5h22v2H1zm8 6h2v2H9zm4 0h2v2h-2zm2-2h2v2h-2zm2-2h2v2h-2zm2-4h2v2h-2zm-4 0h2v2h-2zM7 3h2v2H7zM3 3h2v2H3zm4 6h2v2H7zM5 7h2v2H5z"/></g>'},vercel:{body:'<path fill="currentColor" d="M3 18h18v-1h2v3H1v-3h2zm2-1H3v-3h2zm16 0h-2v-3h2zM7 14H5v-3h2zm12 0h-2v-3h2zM9 11H7V8h2zm8 0h-2V8h2zm-6-3H9V5h2zm4 0h-2V5h2zm-2-3h-2V3h2z"/>'},"vercel-solid":{body:'<path fill="currentColor" d="M13 5h2v3h2v3h2v3h2v3h2v3H1v-3h2v-3h2v-3h2V8h2V5h2V3h2z"/>'},vibrate:{body:'<path fill="currentColor" d="M8 3h8v2H8zm0 16h8v2H8zM6 5h2v14H6zm10 0h2v14h-2zm-5 11h2v2h-2zm13-9h-2v2h2zM0 7h2v2H0zm22 2h-2v2h2zM2 9h2v2H2zm22 2h-2v2h2zM0 11h2v2H0zm22 2h-2v2h2zM2 13h2v2H2zm22 2h-2v2h2zM0 15h2v2H0z"/>'},"vibrate-sharp":{body:'<path fill="currentColor" d="M6 3h12v2H6zm0 16h12v2H6zM6 5h2v14H6zm10 0h2v14h-2zm-5 11h2v2h-2zm13-9h-2v2h2zM0 7h2v2H0zm22 2h-2v2h2zM2 9h2v2H2zm22 2h-2v2h2zM0 11h2v2H0zm22 2h-2v2h2zM2 13h2v2H2zm22 2h-2v2h2zM0 15h2v2H0z"/>'},video:{body:'<path fill="currentColor" d="M20 17V7h2v10zm-2-2V9h2v6zM2 7h2v10H2zm14 0h2v10h-2zM4 5h12v2H4zm0 12h12v2H4z"/>'},"video-off":{body:'<path fill="currentColor" d="M4 5H2v14h14v-4h2v2h2v2h2V5h-2v2h-2v2h-2V5zm10 12H4V7h10zm-4-6H8V9H6v2h2v2H6v2h2v-2h2v2h2v-2h-2zm0 0V9h2v2z"/>',hidden:!0},"video-sharp":{body:'<path fill="currentColor" d="M20 17V7h2v10zm-2-2V9h2v6zM2 7h2v10H2zm14 0h2v10h-2zM2 5h16v2H2zm0 12h16v2H2z"/>'},"view-col":{body:'<path fill="currentColor" d="M2 5h20v14H2zm2 2v10h4V7zm6 0v10h4V7zm6 0v10h4V7z"/>',hidden:!0},"view-list":{body:'<path fill="currentColor" d="M2 5h20v14H2zm2 2v2h16V7zm16 4H4v2h16zm0 4H4v2h16z"/>',hidden:!0},"viewport-narrow":{body:'<path fill="currentColor" d="M10 2H8v4h2V4h4v2h2V2zM8 20v-2h2v2h4v-2h2v4H8zm9-9h5v2h-5v2h-2v-2h-2v-2h2V9h2zm0-2V7h2v2zm0 6h2v2h-2zM2 11h5V9h2v2h2v2H9v2H7v-2H2zm5 4v2H5v-2zm0-6V7H5v2z"/>',hidden:!0},"viewport-wide":{body:'<path fill="currentColor" d="M4 2H2v4h2V4h16v2h2V2zM2 20v-2h2v2h16v-2h2v4H2zm16-9h-5v2h5v2h-2v2h2v-2h2v-2h2v-2h-2V9h-2V7h-2v2h2zm-7 0H6V9h2V7H6v2H4v2H2v2h2v2h2v2h2v-2H6v-2h5z"/>',hidden:!0},visible:{body:'<path fill="currentColor" d="M0 0h2v2H0zm2 2h2v2H2zm18 0h2v2h-2zm2-2h2v2h-2zM2 20h2v2H2zm-2 2h2v2H0zm20-2h2v2h-2zm2 2h2v2h-2zM8 17h8v2H8zm8-2h4v2h-4zm-8 0H4v2h4zm8-8h4v2h-4zM8 7H4v2h4zm12 2h2v2h-2zM4 9H2v2h2zm18 2h2v2h-2zM2 11H0v2h2zm18 2h2v2h-2zM4 13H2v2h2zm4-8h8v2H8zm2 5h4v4h-4z"/>',hidden:!0},volume:{body:'<path fill="currentColor" d="M17 22h-2v-2h-2v-2h2V6h-2V4h2V2h2zm-4-4h-2v-2h2zM11 8v2H9v4h2v2H7V8zm2 0h-2V6h2z"/>'},"volume-1":{body:'<path fill="currentColor" d="M15 22h-2v-2h-2v-2h2V6h-2V4h2V2h2zm-4-4H9v-2h2zM9 8v2H7v4h2v2H5V8zm10 6h-2v-4h2zm-8-6H9V6h2z"/>'},"volume-2":{body:'<path fill="currentColor" d="M13 22h-2v-2H9v-2h2V6H9V4h2V2h2zm-4-4H7v-2h2zm10 0h-4v-2h4zM7 10H5v4h2v2H3V8h4zm14 6h-2V8h2zm-4-2h-2v-4h2zM9 8H7V6h2zm10 0h-4V6h4z"/>'},"volume-3":{body:'<path fill="currentColor" d="M11 22H9v-2H7v-2h2V6H7V4h2V2h2zm8 0h-6v-2h6zm2-2h-2v-2h2zM7 18H5v-2h2zm10 0h-4v-2h4zm6 0h-2V6h2zM5 10H3v4h2v2H1V8h4zm14 6h-2V8h2zm-4-2h-2v-4h2zM7 8H5V6h2zm10 0h-4V6h4zm4-2h-2V4h2zm-2-2h-6V2h6z"/>'},"volume-minus":{body:'<path fill="currentColor" d="M12 2h-2v2H8v2H6v2H2v8h4v2h2v2h2v2h2zM8 18v-2H6v-2H4v-4h2V8h2V6h2v12zm14-7h-8v2h8z"/>',hidden:!0},"volume-plus":{body:'<path fill="currentColor" d="M10 2h2v20h-2v-2H8v-2h2V6H8V4h2zM6 8V6h2v2zm0 8H2V8h4v2H4v4h2zm0 0v2h2v-2zm13-5h3v2h-3v3h-2v-3h-3v-2h3V8h2z"/>',hidden:!0},"volume-vibrate":{body:'<path fill="currentColor" d="M14 2h-2v2h-2v2H8v2H4v8h4v2h2v2h2v2h2zm-4 16v-2H8v-2H6v-4h2V8h2V6h2v12zm8-15h-2v2h2v2h-2v2h2v2h-2v2h2v2h-2v2h2v2h-2v2h2v-2h2v-2h-2v-2h2v-2h-2v-2h2V9h-2V7h2V5h-2z"/>',hidden:!0},"volume-x":{body:'<path fill="currentColor" d="M13 22h-2v-2H9v-2h2V6H9V4h2V2h2zm-4-4H7v-2h2zm-2-8H5v4h2v2H3V8h4zm10.001 5.224h-2v-2H17v-2h-1.999v-2h2v2H19v2h-1.999zm3.999 0h-2v-2h2zm0-4h-2v-2h2zM9 8H7V6h2z"/>'},"volume-x-solid":{body:'<path fill="currentColor" d="M13 22h-2v-2H9v-2H7v-2H3V8h4V6h2V4h2V2h2zm4.001-6.776h-2v-2H17v-2h-1.999v-2h2v2H19v2h-1.999zm3.999 0h-2v-2h2zm0-4h-2v-2h2z"/>'},wall:{body:'<path fill="currentColor" d="M4 2h16v2H4zm0 18h16v2H4zM2 4h2v16H2zm18 0h2v16h-2zM4 8h16v2H4zm0 6h16v2H4zM6 4h2v4H6zm2 12h2v4H8zm6-12h2v4h-2zm2 12h2v4h-2zm-5-6h2v4h-2z"/>'},"wall-sharp":{body:'<path fill="currentColor" d="M2 2h20v2H2zm0 18h20v2H2zM2 4h2v16H2zm18 0h2v16h-2zM4 8h16v2H4zm0 6h16v2H4zM6 4h2v4H6zm2 12h2v4H8zm6-12h2v4h-2zm2 12h2v4h-2zm-5-6h2v4h-2z"/>'},wallet:{body:'<g fill="currentColor"><path d="M18 5h2v2h-2zM4 3h14v2H4zM2 5h2v14H2zm2 14h16v2H4zm12-4h6v2h-6zm0-4h6v2h-6zm-2 0h2v6h-2z"/><path d="M20 7h2v12h-2zM4 7h16v2H4z"/></g>'},"wallet-sharp":{body:'<g fill="currentColor"><path d="M18 5h2v2h-2zM2 3h18v2H2zm0 2h2v14H2zm0 14h20v2H2zm14-4h6v2h-6zm0-4h6v2h-6zm-2 0h2v6h-2z"/><path d="M20 7h2v12h-2zM4 7h16v2H4z"/></g>'},wand:{body:'<path fill="currentColor" d="M14 22h-2v-2h2zm6 0h-2v-2h2zM5 19h4v2H3v-6h2zm13 1h-2v-2h2zm4 0h-2v-2h2zm-11-1H9v-3h2zm9-1h-2v-2h2zm-7-2h-2v-3h2zm-5-1H5v-2h3zm3-2H8v-2h3zm4 0h-2v-2h2zm6 0h-2v-2h2zM4 12H2v-2h2zm9-1h-2V9h2zm4 0h-2V9h2zm-2-2h-2V7h2zm4 0h-2V7h2zM6 8H4V6h2zm11-1h-2V5h2zm4 0h-2V5h-2V3h4zM4 6H2V4h2zm4 0H6V4h2zm5-1h-2V3h2zM6 4H4V2h2z"/>'},"wand-solid":{body:'<path fill="currentColor" d="M14 22h-2v-2h2zm6 0h-2v-2h2zm1-15h-2v2h-2v2h-2v2h-2v3h-2v3H9v2H3v-6h2v-2h3v-2h3V9h2V7h2V5h2V3h4zm-3 13h-2v-2h2zm4 0h-2v-2h2zm-2-2h-2v-2h2zm1-5h-2v-2h2zM4 12H2v-2h2zm2-4H4V6h2zM4 6H2V4h2zm4 0H6V4h2zm5-1h-2V3h2zM6 4H4V2h2z"/>'},warehouse:{body:'<g fill="currentColor"><path d="M6 10h12v2H6z"/><path d="M6 10h2v10H6zm2 5h8v2H8zm-6 5h20v2H2zm14-10h2v10h-2z"/><path d="M2 6h2v16H2z"/><path d="M2 6h4v2H2zm4-2h4v2H6zm8 0h4v2h-4zm4 2h4v2h-4zm-8-4h4v2h-4z"/><path d="M20 6h2v16h-2z"/></g>'},"warning-box":{body:'<path fill="currentColor" d="M3 3h16v2H5v14h14v2H3zm18 0h-2v18h2zM11 15h2v2h-2zm2-8h-2v6h2z"/>',hidden:!0},"warning-diamond":{body:'<path fill="currentColor" d="M2 10h2v2H2zm0 4h2v-2H2zm20-4h-2v2h2zm0 4h-2v-2h2zM4 8h2v2H4zm0 8h2v-2H4zm16-8h-2v2h2zm0 8h-2v-2h2zM6 6h2v2H6zm0 12h2v-2H6zM18 6h-2v2h2zm0 12h-2v-2h2zM8 4h2v2H8zm0 16h2v-2H8zm8-16h-2v2h2zm0 16h-2v-2h2zM10 2h2v2h-2zm0 20h2v-2h-2zm4-20h-2v2h2zm0 20h-2v-2h2zm-3-5h2v-2h-2zm0-4h2V7h-2z"/>'},watch:{body:'<path fill="currentColor" d="M15 23h-2v-4h-2v4H9v-6h6zm-6-6H7v-2h2zm8 0h-2v-2h2zM7 15H5V9h2zm12 0h-2V9h2zm-6-4h2v2h-4V9h2zM9 9H7V7h2zm8 0h-2V7h2zm-6-4h2V1h2v6H9V1h2z"/>'},"watch-glyph":{body:'<path fill="currentColor" d="M15 23h-2v-4h-2v4H9v-4H5V5h4V1h2v4h2V1h2v4h4v14h-4zm-4-9h4v-2h-2V9h-2z"/>'},"watch-sharp":{body:'<path fill="currentColor" d="M11 5h2V1h2v4h4v14h-4v4h-2v-4h-2v4H9v-4H5V5h4V1h2zM7 17h10V7H7zm6-5h2v2h-4V9h2z"/>'},"watch-solid":{body:'<path fill="currentColor" d="M15 23h-2v-4h-2v4H9v-6H7v-2H5V9h2V7h2V1h2v4h2V1h2v6h2v2h2v6h-2v2h-2zm-4-10h4v-2h-2V9h-2z"/>'},waves:{body:'<path fill="currentColor" d="M2 18h4v-2H2zm0-6h4v-2H2zm0-6h4V4H2zm4 14h4v-2H6zm0-6h4v-2H6zm0-6h4V6H6zm4 10h4v-2h-4zm0-6h4v-2h-4zm0-6h4V4h-4zm4 14h4v-2h-4zm0-6h4v-2h-4zm0-6h4V6h-4zm4 10h4v-2h-4zm0-6h4v-2h-4zm0-6h4V4h-4z"/>'},"waves-arrow-down":{body:'<g fill="currentColor"><path d="M2 21h4v-2H2zm0-6h4v-2H2zm4 8h4v-2H6zm0-6h4v-2H6zm4 4h4v-2h-4zm4 2h4v-2h-4zm0-6h4v-2h-4zm-4-2h4v-2h-4zm8 6h4v-2h-4zm0-6h4v-2h-4zM11 1h2v10h-2z"/><path d="M9 7h6v2H9zM7 5h10v2H7z"/></g>'},"waves-arrow-up":{body:'<g fill="currentColor"><path d="M2 21h4v-2H2zm0-6h4v-2H2zm4 8h4v-2H6zm0-6h4v-2H6zm4 4h4v-2h-4zm4 2h4v-2h-4zm0-6h4v-2h-4zm-4-2h4v-2h-4zm8 6h4v-2h-4zm0-6h4v-2h-4zm-7-4h2V1h-2z"/><path d="M9 5h6V3H9zM7 7h10V5H7z"/></g>'},webcam:{body:'<path fill="currentColor" d="M4 20h16v-2h2v4H2v-4h2zm2-2H4v-2h2zm10 0H8v-2h8zm4 0h-2v-2h2zM8 16H6v-2h2zm10 0h-2v-2h2zM6 14H4V6h2zm8-6h2v4h-2v2h-4v-2H8V8h2v2h2V8h-2V6h4zm6 6h-2V6h2zM8 6H6V4h2zm10 0h-2V4h2zm-2-2H8V2h8z"/>'},whatsapp:{body:'<path fill="currentColor" d="M4 20h14v2H2V6h2zm16 0h-2v-2h2zm-9-9H9v2h2v2h2v-2h4v5h-7v-1H9v-2H7v-1H6V7h5zm11 7h-2V6h2zM6 6H4V4h2zm14 0h-2V4h2zm-2-2H6V2h12z"/>'},"whatsapp-solid":{body:'<path fill="currentColor" d="M20 4v2h2v12h-2v2h-2v2H2V6h2V4h2V2h12v2zM6 14h1v1h2v2h1v1h7v-5h-4v2h-2v-2H9v-2h2V7H6z"/>'},wifi:{body:'<path fill="currentColor" d="M11 19h2v2h-2zm-4-3h2v2H7zm8 0h2v2h-2zm-6-2h6v2H9zm-5-1h2v2H4zm2-2h2v2H6zm2-2h8v2H8zm-7 1h2v2H1zm20 0h2v2h-2zM3 8h2v2H3zm2-2h2v2H5zm2-2h10v2H7zm12 4h2v2h-2zm-2-2h2v2h-2zm1 7h2v2h-2zm-2-2h2v2h-2z"/>'},wind:{body:'<path fill="currentColor" d="M2 7h10v2H2zm10-4h2v4h-2zM7 1h5v2H7zM2 11h18v2H2zm18-4h2v4h-2zm-4-2h4v2h-4zM2 17h12v-2H2zm12 2h2v-2h-2zm-5 2h5v-2H9z"/>'},"window-frame":{body:'<path fill="currentColor" d="M4 2h16v2H4zm0 6h16v2H4zm0 12h16v2H4zM2 4h2v16H2zm18 0h2v16h-2zM5 5h2v2H5zm3 0h2v2H8z"/>'},"window-frame-sharp":{body:'<path fill="currentColor" d="M2 2h20v2H2zm2 6h16v2H4zM2 20h20v2H2zM2 4h2v16H2zm18 0h2v16h-2zM5 5h2v2H5zm3 0h2v2H8z"/>'},x:{body:'<path fill="currentColor" d="M6 20H4v-2h2zm14-2h2v2h-6v-2h2v-2h2zM8 18H6v-2h2zm8 0h-2v-2h2zm-6-2H8v-2h2zm4 0h-2v-2h2zm4 0h-2v-2h2zm-6-2h-2v-2h2zm4 0h-2v-2h2zm-6-2H8v-2h2zm4 0h-2v-2h2zm-6-2H6V8h2zm4 0h-2V8h2zm4 0h-2V8h2zM8 6H6v2H4V6H2V4h6zm2 2H8V6h2zm8 0h-2V6h2zm2-2h-2V4h2z"/>'},"x-solid":{body:'<path fill="currentColor" d="M6 20H4v-2h2zM8 6h2v2h2v2h2v2h2v2h2v2h2v2h2v2h-6v-2h-2v-2h-2v-2h-2v-2H8v-2H6V8H4V6H2V4h6zm0 12H6v-2h2zm2-2H8v-2h2zm6-6h-2V8h2zm2-2h-2V6h2zm2-2h-2V4h2z"/>'},youtube:{body:'<path fill="currentColor" d="M20 20H4v-2h16zM4 18H2V6h2zm18 0h-2V6h2zM12 9h-2v6h2v2H8V7h4zm3 6h-3v-2h3zm2-2h-2v-2h2zm-2-2h-3V9h3zm5-5H4V4h16z"/>'},"youtube-solid":{body:'<path fill="currentColor" d="M20 6h2v12h-2v2H4v-2H2V6h2V4h16zM8 17h4v-2h3v-2h2v-2h-2V9h-3V7H8z"/>'},zap:{body:'<path fill="currentColor" d="M4 13h8v6h2v2h-2v2h-2v-8H2v-4h2zm12 6h-2v-2h2zm2-2h-2v-2h2zm2-2h-2v-2h2zm-6-6h8v4h-2v-2h-8V5h-2V3h2V1h2zm-8 2H4V9h2zm2-2H6V7h2zm2-2H8V5h2z"/>'},"zap-off":{body:'<g fill="currentColor"><path d="M10 13h2v10h-2z"/><path d="M2 13h10v2H2zM12 1h2v6h-2zm4 8h6v2h-6zm4 2h2v2h-2zm-4 4h2v2h-2zm-2 2h2v2h-2zm-2 2h2v2h-2zM2 11h2v2H2zm2-2h2v2H4zm2-2h2v2H6zm4-4h2v2h-2zM2 1h2v2H2zm2 2h2v2H4zm2 2h2v2H6zm2 2h2v2H8zm2 2h2v2h-2zm2 2h2v2h-2zm2 2h2v2h-2z"/><path d="M16 15h2v2h-2zm2 2h2v2h-2zm2 2h2v2h-2z"/></g>'},"zoom-in":{body:'<path fill="currentColor" d="M22 22h-2v-2h2zm-2-2h-2v-2h2zm-6-2H6v-2h8zm4 0h-2v-2h2zM6 16H4v-2h2zm10 0h-2v-2h2zM4 14H2V6h2zm7-5h3v2h-3v3H9v-3H6V9h3V6h2zm7 5h-2V6h2zM6 6H4V4h2zm10 0h-2V4h2zm-2-2H6V2h8z"/>'},"zoom-out":{body:'<path fill="currentColor" d="M22 22h-2v-2h2zm-2-2h-2v-2h2zm-6-2H6v-2h8zm4 0h-2v-2h2zM6 16H4v-2h2zm10 0h-2v-2h2zM4 14H2V6h2zm14 0h-2V6h2zm-4-5v2H6V9zM6 6H4V4h2zm10 0h-2V4h2zm-2-2H6V2h8z"/>'}},aliases:{dashbaord:{parent:"dashboard"},"sort-alpabetic":{parent:"sort-alphabetic"}},lastModified:1787067615,width:24,height:24};TAo(DAo);var xU=null,tft=null,CU=null,nft=null,bU=null,oft=null;function tds(e,t){if(!e)return;if(tft!==e){if(xU)xU.unmount(),xU=null;e.innerHTML="",xU=IU.createRoot(e),tft=e}if(!xU)xU=IU.createRoot(e),tft=e;xU.render(dTe.default.createElement(j0t,{circuitJson:t||[],autoRotateDisabled:!0,clickToInteractEnabled:!1,onCameraControllerReady:(n)=>{if(typeof window<"u")window.cadCameraController=n}}))}function nds(e,t,n){if(!e)return;if(nft!==e){if(CU)CU.unmount(),CU=null;e.innerHTML="",CU=IU.createRoot(e),nft=e}if(!CU)CU=IU.createRoot(e),nft=e;CU.render(dTe.default.createElement(Xmt,{circuitJson:t||[],allowEditing:!1,onViewSchematicComponent:(o)=>{if(o?.refdes&&n)n(o.refdes)}}))}function ods(e,t,n){if(!e)return;if(oft!==e){if(bU)bU.unmount(),bU=null;e.innerHTML="",bU=IU.createRoot(e),oft=e}if(!bU)bU=IU.createRoot(e),oft=e;bU.render(dTe.default.createElement(zAt,{circuitJson:t||[],containerStyle:{width:"100%",height:"100%"},onSchematicComponentClicked:(o)=>{if(o?.schematicComponentId&&n)n(o.schematicComponentId)},onViewPcbComponent:(o)=>{if(o?.refdes&&n)n(o.refdes)}}))}var NAo={convertCircuitJsonToSchematicSvg:uz,convertCircuitJsonToPcbSvg:yie,colorMap:Zh,CadViewer:j0t,PCBViewer:Xmt,SchematicViewer:zAt,render3dViewer:tds,renderPcbViewer:nds,renderSchematicViewer:ods};if(typeof window<"u")window.Tscircuit=NAo,window.dispatchEvent(new CustomEvent("tscircuit-ready"));var RQa=NAo;export{j0t as CadViewer,Xmt as PCBViewer,zAt as SchematicViewer,NAo as Tscircuit,Zh as colorMap,yie as convertCircuitJsonToPcbSvg,uz as convertCircuitJsonToSchematicSvg,RQa as default,tds as render3dViewer,nds as renderPcbViewer,ods as renderSchematicViewer};